From: Andrea Amorese Date: Tue, 1 Mar 2022 10:26:46 +0000 (+0100) Subject: Built motion from commit 6418d6aa.|2.6.3 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%2011license.mail?a=commitdiff_plain;h=1ffe2da4ac056c83106d32f587031302ea44ccba;p=motion2.git Built motion from commit 6418d6aa.|2.6.3 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index a28f7a5..2125b0d 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-03-01T09:54:25.740Z", + "time": "2022-03-01T10:13:02.437Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 520ce81..53c7748 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-03-01T09:54:25.740Z", + "time": "2022-03-01T10:13:02.437Z", "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 59281e5..2de7b1f 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 _0xf4ad=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x1d7104,_0x513970){var _0x15c4f0=function(_0xb42f53){while(--_0xb42f53){_0x1d7104['push'](_0x1d7104['shift']());}};_0x15c4f0(++_0x513970);}(_0xf4ad,0x10a));var _0xdf4a=function(_0x1b8c71,_0x41d8ab){_0x1b8c71=_0x1b8c71-0x0;var _0x539905=_0xf4ad[_0x1b8c71];return _0x539905;};'use strict';var Sequelize=require(_0xdf4a('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf4a('0x1')],'get':function(_0x2dc0b0){return this[_0xdf4a('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xdf4a('0x3'),_0xdf4a('0x4'),_0xdf4a('0x5'),_0xdf4a('0x6'),_0xdf4a('0x7'),_0xdf4a('0x8'),_0xdf4a('0x9'),_0xdf4a('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xdf4a('0xb')},'data1':{'type':Sequelize[_0xdf4a('0xc')](0x1000),'comment':_0xdf4a('0xd')},'data2':{'type':Sequelize[_0xdf4a('0xc')](0x1000),'comment':_0xdf4a('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdf4a('0xf')},'data4':{'type':Sequelize[_0xdf4a('0xc')](0x1000),'comments':_0xdf4a('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xdf4a('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0xdf4a('0x12')},'data7':{'type':Sequelize[_0xdf4a('0x13')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x417b=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','TEXT','exports','VIRTUAL','getDataValue','STRING','contactManager','motionbar','jscripty','urlForward','browser'];(function(_0xc8e7ea,_0x5ac842){var _0x15392a=function(_0x3de88e){while(--_0x3de88e){_0xc8e7ea['push'](_0xc8e7ea['shift']());}};_0x15392a(++_0x5ac842);}(_0x417b,0x7e));var _0xb417=function(_0x4e6f37,_0x1ad479){_0x4e6f37=_0x4e6f37-0x0;var _0x2264da=_0x417b[_0x4e6f37];return _0x2264da;};'use strict';var Sequelize=require('sequelize');module[_0xb417('0x0')]={'name':{'type':Sequelize[_0xb417('0x1')],'get':function(_0x1b6446){return this[_0xb417('0x2')]('action');}},'action':{'type':Sequelize[_0xb417('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb417('0x4'),'integration',_0xb417('0x5'),_0xb417('0x6'),_0xb417('0x7'),_0xb417('0x8'),_0xb417('0x9'),_0xb417('0xa')]],'msg':_0xb417('0xb')}},'comment':_0xb417('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xb417('0xc')},'data3':{'type':Sequelize[_0xb417('0x3')](0x1000),'comment':_0xb417('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xb417('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xb417('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xb417('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index cdab88d..1a1109e 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 _0xb88d=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','body','Action','find','catch','params','eml-format'];(function(_0x44f781,_0x1b984e){var _0x1b0b31=function(_0x50819f){while(--_0x50819f){_0x44f781['push'](_0x44f781['shift']());}};_0x1b0b31(++_0x1b984e);}(_0xb88d,0x14f));var _0xdb88=function(_0x5ebac3,_0x312731){_0x5ebac3=_0x5ebac3-0x0;var _0x2ac6b2=_0xb88d[_0x5ebac3];return _0x2ac6b2;};'use strict';var emlformat=require(_0xdb88('0x0'));var rimraf=require(_0xdb88('0x1'));var zipdir=require(_0xdb88('0x2'));var jsonpatch=require(_0xdb88('0x3'));var rp=require(_0xdb88('0x4'));var moment=require('moment');var BPromise=require(_0xdb88('0x5'));var Mustache=require(_0xdb88('0x6'));var util=require('util');var path=require(_0xdb88('0x7'));var sox=require(_0xdb88('0x8'));var csv=require(_0xdb88('0x9'));var ejs=require(_0xdb88('0xa'));var fs=require('fs');var fs_extra=require(_0xdb88('0xb'));var _=require(_0xdb88('0xc'));var squel=require(_0xdb88('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdb88('0xe'));var toCsv=require(_0xdb88('0x9'));var querystring=require('querystring');var Papa=require(_0xdb88('0xf'));var Redis=require(_0xdb88('0x10'));var authService=require(_0xdb88('0x11'));var qs=require(_0xdb88('0x12'));var as=require(_0xdb88('0x13'));var hardwareService=require(_0xdb88('0x14'));var logger=require(_0xdb88('0x15'))(_0xdb88('0x16'));var utils=require(_0xdb88('0x17'));var config=require(_0xdb88('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ccf99,_0x103068){_0x103068=_0x103068||0xcc;return function(_0xf0f935){if(_0xf0f935){return _0x5ccf99[_0xdb88('0x19')](_0x103068);}return _0x5ccf99[_0xdb88('0x1a')](_0x103068)[_0xdb88('0x1b')]();};}function respondWithResult(_0x453143,_0x35ca8e){_0x35ca8e=_0x35ca8e||0xc8;return function(_0x305c0b){if(_0x305c0b){return _0x453143[_0xdb88('0x1a')](_0x35ca8e)[_0xdb88('0x1c')](_0x305c0b);}};}function respondWithFilteredResult(_0x1d829a,_0x166029){return function(_0x30ce9a){if(_0x30ce9a){var _0x563024=typeof _0x166029[_0xdb88('0x1d')]===_0xdb88('0x1e')&&typeof _0x166029[_0xdb88('0x1f')]===_0xdb88('0x1e');var _0x273666=_0x30ce9a['count'];var _0x43ca8b=_0x563024?0x0:_0x166029[_0xdb88('0x1d')];var _0x1453d5=_0x563024?_0x30ce9a['count']:_0x166029[_0xdb88('0x1d')]+_0x166029[_0xdb88('0x1f')];var _0x2bbc31;if(_0x1453d5>=_0x273666){_0x1453d5=_0x273666;_0x2bbc31=0xc8;}else{_0x2bbc31=0xce;}_0x1d829a[_0xdb88('0x1a')](_0x2bbc31);return _0x1d829a[_0xdb88('0x20')](_0xdb88('0x21'),_0x43ca8b+'-'+_0x1453d5+'/'+_0x273666)[_0xdb88('0x1c')](_0x30ce9a);}return null;};}function patchUpdates(_0x50aa47){return function(_0x1b45ed){try{jsonpatch[_0xdb88('0x22')](_0x1b45ed,_0x50aa47,!![]);}catch(_0x137071){return BPromise[_0xdb88('0x23')](_0x137071);}return _0x1b45ed[_0xdb88('0x24')]();};}function saveUpdates(_0x484403,_0x761418){return function(_0x1c2b52){if(_0x1c2b52){return _0x1c2b52[_0xdb88('0x25')](_0x484403)[_0xdb88('0x26')](function(_0x3a67c5){return _0x3a67c5;});}return null;};}function removeEntity(_0x4892de,_0x2cc36c){return function(_0x4d5f38){if(_0x4d5f38){return _0x4d5f38[_0xdb88('0x27')]()[_0xdb88('0x26')](function(){_0x4892de[_0xdb88('0x1a')](0xcc)[_0xdb88('0x1b')]();});}};}function handleEntityNotFound(_0x3d2bd7,_0x41c08d){return function(_0x12ca2e){if(!_0x12ca2e){_0x3d2bd7[_0xdb88('0x19')](0x194);}return _0x12ca2e;};}function handleError(_0x1308de,_0x3b7297){_0x3b7297=_0x3b7297||0x1f4;return function(_0x52e2a4){logger[_0xdb88('0x28')](_0x52e2a4[_0xdb88('0x29')]);if(_0x52e2a4['name']){delete _0x52e2a4[_0xdb88('0x2a')];}_0x1308de[_0xdb88('0x1a')](_0x3b7297)['send'](_0x52e2a4);};}exports[_0xdb88('0x25')]=function(_0x1b9e2b,_0x328e63){if(_0x1b9e2b[_0xdb88('0x2b')]['id']){delete _0x1b9e2b[_0xdb88('0x2b')]['id'];}return db[_0xdb88('0x2c')][_0xdb88('0x2d')]({'where':{'id':_0x1b9e2b['params']['id']}})['then'](handleEntityNotFound(_0x328e63,null))[_0xdb88('0x26')](saveUpdates(_0x1b9e2b[_0xdb88('0x2b')],null))['then'](respondWithResult(_0x328e63,null))[_0xdb88('0x2e')](handleError(_0x328e63,null));};exports[_0xdb88('0x27')]=function(_0x33ce8f,_0x58f935){return db[_0xdb88('0x2c')][_0xdb88('0x2d')]({'where':{'id':_0x33ce8f[_0xdb88('0x2f')]['id']}})['then'](handleEntityNotFound(_0x58f935,null))[_0xdb88('0x26')](removeEntity(_0x58f935,null))[_0xdb88('0x2e')](handleError(_0x58f935,null));}; \ No newline at end of file +var _0x5b29=['send','body','Action','find','then','catch','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','sendStatus','error','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b29,0x177));var _0x95b2=function(_0x13f343,_0x3be1c3){_0x13f343=_0x13f343-0x0;var _0x107e29=_0x5b29[_0x13f343];return _0x107e29;};'use strict';var emlformat=require(_0x95b2('0x0'));var rimraf=require(_0x95b2('0x1'));var zipdir=require(_0x95b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95b2('0x3'));var moment=require(_0x95b2('0x4'));var BPromise=require(_0x95b2('0x5'));var Mustache=require(_0x95b2('0x6'));var util=require(_0x95b2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x95b2('0x8'));var ejs=require(_0x95b2('0x9'));var fs=require('fs');var fs_extra=require(_0x95b2('0xa'));var _=require(_0x95b2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x95b2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x95b2('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x95b2('0xd'));var authService=require(_0x95b2('0xe'));var qs=require(_0x95b2('0xf'));var as=require(_0x95b2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x95b2('0x11'));var utils=require(_0x95b2('0x12'));var config=require(_0x95b2('0x13'));var licenseUtil=require(_0x95b2('0x14'));var db=require(_0x95b2('0x15'))['db'];function respondWithStatusCode(_0x589341,_0x3659db){_0x3659db=_0x3659db||0xcc;return function(_0xb67e1b){if(_0xb67e1b){return _0x589341['sendStatus'](_0x3659db);}return _0x589341[_0x95b2('0x16')](_0x3659db)['end']();};}function respondWithResult(_0x49f1f1,_0x4fd16d){_0x4fd16d=_0x4fd16d||0xc8;return function(_0x2d1966){if(_0x2d1966){return _0x49f1f1[_0x95b2('0x16')](_0x4fd16d)[_0x95b2('0x17')](_0x2d1966);}};}function respondWithFilteredResult(_0x4494f2,_0x1e5447){return function(_0xb07f48){if(_0xb07f48){var _0x427cab=typeof _0x1e5447[_0x95b2('0x18')]===_0x95b2('0x19')&&typeof _0x1e5447[_0x95b2('0x1a')]===_0x95b2('0x19');var _0x32880f=_0xb07f48[_0x95b2('0x1b')];var _0x59ede5=_0x427cab?0x0:_0x1e5447['offset'];var _0x3ebb3a=_0x427cab?_0xb07f48['count']:_0x1e5447[_0x95b2('0x18')]+_0x1e5447[_0x95b2('0x1a')];var _0x34da41;if(_0x3ebb3a>=_0x32880f){_0x3ebb3a=_0x32880f;_0x34da41=0xc8;}else{_0x34da41=0xce;}_0x4494f2['status'](_0x34da41);return _0x4494f2[_0x95b2('0x1c')]('Content-Range',_0x59ede5+'-'+_0x3ebb3a+'/'+_0x32880f)[_0x95b2('0x17')](_0xb07f48);}return null;};}function patchUpdates(_0x551cd8){return function(_0x22791c){try{jsonpatch[_0x95b2('0x1d')](_0x22791c,_0x551cd8,!![]);}catch(_0x3ffe0c){return BPromise[_0x95b2('0x1e')](_0x3ffe0c);}return _0x22791c[_0x95b2('0x1f')]();};}function saveUpdates(_0x1ffbfa,_0x44b4c5){return function(_0x4870ef){if(_0x4870ef){return _0x4870ef[_0x95b2('0x20')](_0x1ffbfa)['then'](function(_0x23ef83){return _0x23ef83;});}return null;};}function removeEntity(_0x2ef34d,_0x35cdb0){return function(_0x5429fa){if(_0x5429fa){return _0x5429fa[_0x95b2('0x21')]()['then'](function(){_0x2ef34d[_0x95b2('0x16')](0xcc)[_0x95b2('0x22')]();});}};}function handleEntityNotFound(_0x5c287e,_0x41619d){return function(_0x3c8c51){if(!_0x3c8c51){_0x5c287e[_0x95b2('0x23')](0x194);}return _0x3c8c51;};}function handleError(_0x10ba99,_0x5d617c){_0x5d617c=_0x5d617c||0x1f4;return function(_0x1969e9){logger[_0x95b2('0x24')](_0x1969e9[_0x95b2('0x25')]);if(_0x1969e9['name']){delete _0x1969e9[_0x95b2('0x26')];}_0x10ba99['status'](_0x5d617c)[_0x95b2('0x27')](_0x1969e9);};}exports[_0x95b2('0x20')]=function(_0x439be0,_0xe0a064){if(_0x439be0[_0x95b2('0x28')]['id']){delete _0x439be0[_0x95b2('0x28')]['id'];}return db[_0x95b2('0x29')][_0x95b2('0x2a')]({'where':{'id':_0x439be0['params']['id']}})['then'](handleEntityNotFound(_0xe0a064,null))[_0x95b2('0x2b')](saveUpdates(_0x439be0['body'],null))[_0x95b2('0x2b')](respondWithResult(_0xe0a064,null))[_0x95b2('0x2c')](handleError(_0xe0a064,null));};exports[_0x95b2('0x21')]=function(_0x29c74f,_0x23c191){return db[_0x95b2('0x29')][_0x95b2('0x2a')]({'where':{'id':_0x29c74f[_0x95b2('0x2d')]['id']}})[_0x95b2('0x2b')](handleEntityNotFound(_0x23c191,null))[_0x95b2('0x2b')](removeEntity(_0x23c191,null))[_0x95b2('0x2c')](handleError(_0x23c191,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ecd938d..b06f3fc 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 _0x091a=['path','rimraf','./action.attributes','define','Action','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x372da5,_0x45f6b5){var _0x2b40cc=function(_0x3884b6){while(--_0x3884b6){_0x372da5['push'](_0x372da5['shift']());}};_0x2b40cc(++_0x45f6b5);}(_0x091a,0xc3));var _0xa091=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x091a[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0xa091('0x0'));var logger=require(_0xa091('0x1'))('api');var moment=require(_0xa091('0x2'));var BPromise=require(_0xa091('0x3'));var rp=require(_0xa091('0x4'));var fs=require('fs');var path=require(_0xa091('0x5'));var rimraf=require(_0xa091('0x6'));var config=require('../../config/environment');var attributes=require(_0xa091('0x7'));module['exports']=function(_0xb80f44,_0x533be7){return _0xb80f44[_0xa091('0x8')](_0xa091('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x685a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0x685a,0x1b2));var _0xa685=function(_0x4c3590,_0x217497){_0x4c3590=_0x4c3590-0x0;var _0x14d697=_0x685a[_0x4c3590];return _0x14d697;};'use strict';var _=require(_0xa685('0x0'));var util=require(_0xa685('0x1'));var logger=require(_0xa685('0x2'))(_0xa685('0x3'));var moment=require(_0xa685('0x4'));var BPromise=require(_0xa685('0x5'));var rp=require(_0xa685('0x6'));var fs=require('fs');var path=require(_0xa685('0x7'));var rimraf=require(_0xa685('0x8'));var config=require(_0xa685('0x9'));var attributes=require(_0xa685('0xa'));module['exports']=function(_0x4aad41,_0x4da922){return _0x4aad41[_0xa685('0xb')](_0xa685('0xc'),attributes,{'tableName':_0xa685('0xd'),'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 903f84d..4a52822 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4427c2,_0x1f48a6){var _0x366ed6=function(_0x298957){while(--_0x298957){_0x4427c2['push'](_0x4427c2['shift']());}};_0x366ed6(++_0x1f48a6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x5fc3[_0x3b711c];return _0x2685f0;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0xe2ba19,_0x3ebe18){var _0x45c743=function(_0x4c2b6b){while(--_0x4c2b6b){_0xe2ba19['push'](_0xe2ba19['shift']());}};_0x45c743(++_0x3ebe18);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 02d4c51..0bea5e3 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 _0x5120=['path','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','update','delete','isAuthenticated','exports','multer','util'];(function(_0x3d7f9f,_0x52fb2){var _0x33b11f=function(_0x1985ad){while(--_0x1985ad){_0x3d7f9f['push'](_0x3d7f9f['shift']());}};_0x33b11f(++_0x52fb2);}(_0x5120,0x16a));var _0x0512=function(_0x2fe5a8,_0x36dfc3){_0x2fe5a8=_0x2fe5a8-0x0;var _0x5cf27c=_0x5120[_0x2fe5a8];return _0x5cf27c;};'use strict';var multer=require(_0x0512('0x0'));var util=require(_0x0512('0x1'));var path=require(_0x0512('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0512('0x3'));var auth=require(_0x0512('0x4'));var interaction=require(_0x0512('0x5'));var config=require('../../config/environment');var controller=require(_0x0512('0x6'));router[_0x0512('0x7')](_0x0512('0x8'),auth['isAuthenticated'](),controller[_0x0512('0x9')]);router[_0x0512('0xa')](_0x0512('0x8'),auth[_0x0512('0xb')](),controller['destroy']);module[_0x0512('0xc')]=router; \ No newline at end of file +var _0x8411=['connect-timeout','express','../../components/auth/service','./action.controller','isAuthenticated','delete','/:id','destroy','util','path'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x8411,0x1e8));var _0x1841=function(_0x14901d,_0x4f1c8b){_0x14901d=_0x14901d-0x0;var _0x302364=_0x8411[_0x14901d];return _0x302364;};'use strict';var multer=require('multer');var util=require(_0x1841('0x0'));var path=require(_0x1841('0x1'));var timeout=require(_0x1841('0x2'));var express=require(_0x1841('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1841('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1841('0x5'));router['put']('/:id',auth[_0x1841('0x6')](),controller['update']);router[_0x1841('0x7')](_0x1841('0x8'),auth[_0x1841('0x6')](),controller[_0x1841('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 1c90ed2..9fa9947 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x2c8c7c,_0x1f3b93){var _0x24b19a=function(_0x2dd0be){while(--_0x2dd0be){_0x2c8c7c['push'](_0x2c8c7c['shift']());}};_0x24b19a(++_0x1f3b93);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file +var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0xbb3e2c,_0x39dbdb){var _0x22adce=function(_0x13f506){while(--_0x13f506){_0xbb3e2c['push'](_0xbb3e2c['shift']());}};_0x22adce(++_0x39dbdb);}(_0xeec6,0x1c2));var _0x6eec=function(_0x294b6,_0x2907ae){_0x294b6=_0x294b6-0x0;var _0x38bb97=_0xeec6[_0x294b6];return _0x38bb97;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f775f3c..48b9fb9 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 _0x3258=['save','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','create','body','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','update','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','from','table','MetricId','metric','function','replace','format','order','orderBy','DESC','joins','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','DATE(%s)','IS\x20NULL','operator','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','conditions','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','run','runReport','left_join','COUNT(DISTINCT\x20%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','apply','reject'];(function(_0x3c172f,_0x2927ab){var _0x4748b9=function(_0x34f03c){while(--_0x34f03c){_0x3c172f['push'](_0x3c172f['shift']());}};_0x4748b9(++_0x2927ab);}(_0x3258,0x88));var _0x8325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3258[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8325('0x0'));var rimraf=require(_0x8325('0x1'));var zipdir=require(_0x8325('0x2'));var jsonpatch=require(_0x8325('0x3'));var rp=require(_0x8325('0x4'));var moment=require(_0x8325('0x5'));var BPromise=require(_0x8325('0x6'));var Mustache=require(_0x8325('0x7'));var util=require(_0x8325('0x8'));var path=require(_0x8325('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8325('0xa'));var fs=require('fs');var fs_extra=require(_0x8325('0xb'));var _=require(_0x8325('0xc'));var squel=require(_0x8325('0xd'));var crypto=require(_0x8325('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8325('0xf'));var toCsv=require(_0x8325('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8325('0x11'));var qs=require(_0x8325('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8325('0x13'));var logger=require('../../config/logger')(_0x8325('0x14'));var utils=require(_0x8325('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8325('0x16'))['db'];var dbH=require(_0x8325('0x16'))[_0x8325('0x17')];function respondWithStatusCode(_0xa0ee74,_0x10c44b){_0x10c44b=_0x10c44b||0xcc;return function(_0x5a4fea){if(_0x5a4fea){return _0xa0ee74[_0x8325('0x18')](_0x10c44b);}return _0xa0ee74['status'](_0x10c44b)[_0x8325('0x19')]();};}function respondWithResult(_0x167651,_0xcee207){_0xcee207=_0xcee207||0xc8;return function(_0x1c64da){if(_0x1c64da){return _0x167651[_0x8325('0x1a')](_0xcee207)[_0x8325('0x1b')](_0x1c64da);}};}function respondWithFilteredResult(_0x4eef54,_0x242887){return function(_0x458116){if(_0x458116){var _0x8da6ac=typeof _0x242887[_0x8325('0x1c')]===_0x8325('0x1d')&&typeof _0x242887['limit']===_0x8325('0x1d');var _0x14df3a=_0x458116['count'];var _0x78b25=_0x8da6ac?0x0:_0x242887[_0x8325('0x1c')];var _0x512709=_0x8da6ac?_0x458116['count']:_0x242887[_0x8325('0x1c')]+_0x242887[_0x8325('0x1e')];var _0x36a593;if(_0x512709>=_0x14df3a){_0x512709=_0x14df3a;_0x36a593=0xc8;}else{_0x36a593=0xce;}_0x4eef54['status'](_0x36a593);return _0x4eef54['set']('Content-Range',_0x78b25+'-'+_0x512709+'/'+_0x14df3a)['json'](_0x458116);}return null;};}function patchUpdates(_0x35fad3){return function(_0x219bb5){try{jsonpatch[_0x8325('0x1f')](_0x219bb5,_0x35fad3,!![]);}catch(_0xe2808f){return BPromise[_0x8325('0x20')](_0xe2808f);}return _0x219bb5[_0x8325('0x21')]();};}function saveUpdates(_0x5a0a14,_0x173f31){return function(_0x1d355a){if(_0x1d355a){return _0x1d355a['update'](_0x5a0a14)[_0x8325('0x22')](function(_0x841044){return _0x841044;});}return null;};}function removeEntity(_0x2ae7a6,_0x3960d2){return function(_0x371180){if(_0x371180){return _0x371180[_0x8325('0x23')]()['then'](function(){var _0x37730f=_0x371180[_0x8325('0x24')]({'plain':!![]});var _0x1ea9a3=_0x8325('0x25');return db[_0x8325('0x26')][_0x8325('0x23')]({'where':{'type':_0x1ea9a3,'resourceId':_0x37730f['id']}})[_0x8325('0x22')](function(){return _0x371180;});})[_0x8325('0x22')](function(){_0x2ae7a6[_0x8325('0x1a')](0xcc)[_0x8325('0x19')]();});}};}function handleEntityNotFound(_0x386b42,_0x540efa){return function(_0xf44648){if(!_0xf44648){_0x386b42['sendStatus'](0x194);}return _0xf44648;};}function handleError(_0x16f03b,_0x1e90f2){_0x1e90f2=_0x1e90f2||0x1f4;return function(_0x280ff1){logger[_0x8325('0x27')](_0x280ff1[_0x8325('0x28')]);if(_0x280ff1[_0x8325('0x29')]){delete _0x280ff1[_0x8325('0x29')];}_0x16f03b['status'](_0x1e90f2)[_0x8325('0x2a')](_0x280ff1);};}exports['index']=function(_0x4e9aed,_0x4a5180){var _0x212b93={},_0x4bd15f={},_0x7be883={'count':0x0,'rows':[]};var _0x11b544=_[_0x8325('0x2b')](db[_0x8325('0x2c')][_0x8325('0x2d')],function(_0x1394cf){return{'name':_0x1394cf[_0x8325('0x2e')],'type':_0x1394cf['type'][_0x8325('0x2f')]};});_0x4bd15f['model']=_['map'](_0x11b544,_0x8325('0x29'));_0x4bd15f[_0x8325('0x30')]=_[_0x8325('0x31')](_0x4e9aed['query']);_0x4bd15f['filters']=_[_0x8325('0x32')](_0x4bd15f[_0x8325('0x33')],_0x4bd15f[_0x8325('0x30')]);_0x212b93[_0x8325('0x34')]=_[_0x8325('0x32')](_0x4bd15f[_0x8325('0x33')],qs[_0x8325('0x35')](_0x4e9aed['query'][_0x8325('0x35')]));_0x212b93['attributes']=_0x212b93[_0x8325('0x34')][_0x8325('0x36')]?_0x212b93[_0x8325('0x34')]:_0x4bd15f[_0x8325('0x33')];if(!_0x4e9aed[_0x8325('0x30')][_0x8325('0x37')](_0x8325('0x38'))){_0x212b93['limit']=qs[_0x8325('0x1e')](_0x4e9aed[_0x8325('0x30')][_0x8325('0x1e')]);_0x212b93[_0x8325('0x1c')]=qs[_0x8325('0x1c')](_0x4e9aed['query'][_0x8325('0x1c')]);}_0x212b93['order']=qs[_0x8325('0x39')](_0x4e9aed['query'][_0x8325('0x39')]);_0x212b93[_0x8325('0x3a')]=qs[_0x8325('0x3b')](_[_0x8325('0x3c')](_0x4e9aed[_0x8325('0x30')],_0x4bd15f[_0x8325('0x3b')]),_0x11b544);if(_0x4e9aed[_0x8325('0x30')][_0x8325('0x3d')]){_0x212b93[_0x8325('0x3a')]=_[_0x8325('0x3e')](_0x212b93[_0x8325('0x3a')],{'$or':_[_0x8325('0x2b')](_0x11b544,function(_0x432dce){if(_0x432dce['type']!==_0x8325('0x3f')){var _0x333ed0={};_0x333ed0[_0x432dce[_0x8325('0x29')]]={'$like':'%'+_0x4e9aed[_0x8325('0x30')][_0x8325('0x3d')]+'%'};return _0x333ed0;}})});}_0x212b93=_[_0x8325('0x3e')]({},_0x212b93,_0x4e9aed[_0x8325('0x40')]);var _0x38ee88={'where':_0x212b93['where']};return db[_0x8325('0x2c')][_0x8325('0x41')](_0x38ee88)[_0x8325('0x22')](function(_0x1b961a){_0x7be883[_0x8325('0x41')]=_0x1b961a;if(_0x4e9aed[_0x8325('0x30')][_0x8325('0x42')]){_0x212b93[_0x8325('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x212b93);})['then'](function(_0x5f1a8d){_0x7be883[_0x8325('0x44')]=_0x5f1a8d;return _0x7be883;})['then'](respondWithFilteredResult(_0x4a5180,_0x212b93))[_0x8325('0x45')](handleError(_0x4a5180,null));};exports[_0x8325('0x46')]=function(_0x16a107,_0x4dc13b){var _0x83e71f={'raw':![],'where':{'id':_0x16a107[_0x8325('0x47')]['id']}},_0x201c54={};_0x201c54[_0x8325('0x33')]=_[_0x8325('0x31')](db[_0x8325('0x2c')][_0x8325('0x2d')]);_0x201c54['query']=_[_0x8325('0x31')](_0x16a107[_0x8325('0x30')]);_0x201c54['filters']=_[_0x8325('0x32')](_0x201c54[_0x8325('0x33')],_0x201c54['query']);_0x83e71f[_0x8325('0x34')]=_[_0x8325('0x32')](_0x201c54['model'],qs[_0x8325('0x35')](_0x16a107[_0x8325('0x30')][_0x8325('0x35')]));_0x83e71f[_0x8325('0x34')]=_0x83e71f[_0x8325('0x34')]['length']?_0x83e71f['attributes']:_0x201c54[_0x8325('0x33')];if(_0x16a107['query'][_0x8325('0x42')]){_0x83e71f[_0x8325('0x43')]=[{'all':!![]}];}_0x83e71f=_[_0x8325('0x3e')]({},_0x83e71f,_0x16a107[_0x8325('0x40')]);return db[_0x8325('0x2c')][_0x8325('0x48')](_0x83e71f)[_0x8325('0x22')](handleEntityNotFound(_0x4dc13b,null))[_0x8325('0x22')](respondWithResult(_0x4dc13b,null))[_0x8325('0x45')](handleError(_0x4dc13b,null));};exports[_0x8325('0x49')]=function(_0x2bba91,_0x479101){return db[_0x8325('0x2c')]['create'](_0x2bba91[_0x8325('0x4a')],{})['then'](function(_0x27be5c){var _0x5d6081=_0x2bba91['user']['get']({'plain':!![]});if(!_0x5d6081)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d6081[_0x8325('0x4b')]===_0x8325('0x4c')){var _0x5437ce=_0x27be5c[_0x8325('0x24')]({'plain':!![]});var _0x160666=_0x8325('0x4d');return db[_0x8325('0x4e')]['find']({'where':{'name':_0x160666,'userProfileId':_0x5d6081[_0x8325('0x4f')]},'raw':!![]})['then'](function(_0x4b058a){if(_0x4b058a&&_0x4b058a[_0x8325('0x50')]===0x0){return db[_0x8325('0x26')][_0x8325('0x49')]({'name':_0x5437ce['name'],'resourceId':_0x5437ce['id'],'type':_0x8325('0x25'),'sectionId':_0x4b058a['id']},{})[_0x8325('0x22')](function(){return _0x27be5c;});}else{return _0x27be5c;}})[_0x8325('0x45')](function(_0x598a31){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x598a31);throw _0x598a31;});}return _0x27be5c;})['then'](respondWithResult(_0x479101,0xc9))[_0x8325('0x45')](handleError(_0x479101,null));};exports[_0x8325('0x51')]=function(_0x1b729b,_0x4a326c){if(_0x1b729b['body']['id']){delete _0x1b729b['body']['id'];}return db[_0x8325('0x2c')]['find']({'where':{'id':_0x1b729b[_0x8325('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a326c,null))['then'](saveUpdates(_0x1b729b['body'],null))[_0x8325('0x22')](respondWithResult(_0x4a326c,null))['catch'](handleError(_0x4a326c,null));};exports['destroy']=function(_0x2c0d8b,_0x13c8eb){return db[_0x8325('0x2c')]['find']({'where':{'id':_0x2c0d8b[_0x8325('0x47')]['id']}})['then'](handleEntityNotFound(_0x13c8eb,null))[_0x8325('0x22')](removeEntity(_0x13c8eb,null))['catch'](handleError(_0x13c8eb,null));};exports['preview']=function(_0x14df1f,_0xccf2ac){var _0x64a4dc=0xa;var _0x13d0e5=[_0x8325('0x52'),'left_join',_0x8325('0x53'),_0x8325('0x54')];var _0x1fb38b={'SUM':_0x8325('0x55'),'COUNT':_0x8325('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8325('0x57'),'MIN':_0x8325('0x58'),'AVG':_0x8325('0x59'),'GROUP_CONCAT':_0x8325('0x5a'),'GROUP_CONCAT ASC':_0x8325('0x5b'),'GROUP_CONCAT DESC':_0x8325('0x5c')};var _0x4ccc13={'SEC_TO_TIME':_0x8325('0x5d'),'DATE':'DATE(%s)','HOUR':_0x8325('0x5e'),'ROUND':_0x8325('0x5f'),'UNIX_TIMESTAMP':_0x8325('0x60')};var _0x31638f=function(_0xa02311){return!_[_0x8325('0x61')](['IS\x20NULL',_0x8325('0x62'),_0x8325('0x63'),_0x8325('0x64')],_0xa02311);};var _0x516ee9=function(_0x369c85){if(!_0x369c85||!_0x369c85[_0x8325('0x65')][_0x8325('0x36')]){return'';}for(var _0x1931d6='(',_0x3b0350=0x0;_0x3b0350<_0x369c85[_0x8325('0x65')][_0x8325('0x36')];_0x3b0350+=0x1){_0x3b0350>0x0&&(_0x1931d6+='\x20'+_0x369c85['operator']+'\x20');_0x1931d6+=_0x369c85[_0x8325('0x65')][_0x3b0350][_0x8325('0x66')]?_0x516ee9(_0x369c85['rules'][_0x3b0350][_0x8325('0x66')]):_0x369c85[_0x8325('0x65')][_0x3b0350][_0x8325('0x67')]+'\x20'+_0x369c85[_0x8325('0x65')][_0x3b0350][_0x8325('0x68')]+(_0x31638f(_0x369c85[_0x8325('0x65')][_0x3b0350][_0x8325('0x68')])?'\x20'+_0x369c85[_0x8325('0x65')][_0x3b0350][_0x8325('0x69')]:'');}return _0x1931d6+')';};var _0x340e71={'where':{'id':_0x14df1f['params']['id']}},_0x2fb57d,_0x27bb89,_0x55cf80,_0x57f79a,_0x20c978;_0x340e71=_[_0x8325('0x3e')]({},_0x340e71,_0x14df1f[_0x8325('0x40')]);return db[_0x8325('0x2c')][_0x8325('0x48')](_0x340e71)['then'](function(_0x151c91){if(_0x151c91){_0x2fb57d=_0x151c91;return _0x151c91[_0x8325('0x6a')]();}return null;})[_0x8325('0x22')](function(_0x28b186){if(_0x28b186){if(!_0x28b186[_0x8325('0x36')]){throw new db[(_0x8325('0x6b'))][(_0x8325('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27bb89=_0x28b186;return db[_0x8325('0x6d')][_0x8325('0x6e')]({'raw':!![]});}return null;})[_0x8325('0x22')](function(_0x5c4a58){if(_0x5c4a58){_0x55cf80=_[_0x8325('0x6f')](_0x5c4a58,'id');var _0x3081d6;var _0x4d4fd1=squel['select']();_0x4d4fd1[_0x8325('0x70')](_0x2fb57d[_0x8325('0x71')]);for(var _0x59ae09=0x0;_0x59ae09<_0x27bb89[_0x8325('0x36')];_0x59ae09+=0x1){_0x3081d6=_0x27bb89[_0x59ae09][_0x8325('0x72')]?_0x55cf80[_0x27bb89[_0x59ae09][_0x8325('0x72')]][_0x8325('0x73')]:_0x27bb89[_0x59ae09][_0x8325('0x67')];_0x3081d6=_0x27bb89[_0x59ae09][_0x8325('0x74')]?_[_0x8325('0x75')](_0x1fb38b[_0x27bb89[_0x59ae09][_0x8325('0x74')]],'%s',_0x3081d6):_0x3081d6;_0x3081d6=_0x27bb89[_0x59ae09]['format']?_[_0x8325('0x75')](_0x4ccc13[_0x27bb89[_0x59ae09][_0x8325('0x76')]],'%s',_0x3081d6):_0x3081d6;if(_0x27bb89[_0x59ae09]['groupBy']){_0x4d4fd1['group'](_0x3081d6);}_0x27bb89[_0x59ae09]['orderBy']&&_0x4d4fd1[_0x8325('0x77')](_0x3081d6,_0x27bb89[_0x59ae09][_0x8325('0x78')]===_0x8325('0x79')?![]:!![]);_0x4d4fd1['field'](_0x3081d6,_0x27bb89[_0x59ae09]['alias']||_0x3081d6);}if(_0x2fb57d[_0x8325('0x7a')]){_0x2fb57d[_0x8325('0x7a')]=JSON['parse'](_0x2fb57d[_0x8325('0x7a')]);for(var _0x2dce6d=0x0;_0x2dce6d<_0x2fb57d['joins'][_0x8325('0x36')];_0x2dce6d+=0x1){if(_0x2fb57d[_0x8325('0x7a')][_0x2dce6d][_0x8325('0x7b')]&&_[_0x8325('0x61')](_0x13d0e5,_0x2fb57d[_0x8325('0x7a')][_0x2dce6d][_0x8325('0x7b')])&&_0x2fb57d['joins'][_0x2dce6d][_0x8325('0x7c')]&&_0x2fb57d[_0x8325('0x7a')][_0x2dce6d][_0x8325('0x7d')]&&_0x2fb57d[_0x8325('0x7a')][_0x2dce6d][_0x8325('0x7e')]){_0x4d4fd1[_0x2fb57d['joins'][_0x2dce6d][_0x8325('0x7b')]](_0x2fb57d[_0x8325('0x7a')][_0x2dce6d]['foreignTable'],null,util[_0x8325('0x76')](_0x8325('0x7f'),_0x2fb57d['table'],_0x2fb57d[_0x8325('0x7a')][_0x2dce6d]['parentKey'],_0x2fb57d[_0x8325('0x7a')][_0x2dce6d][_0x8325('0x7d')],_0x2fb57d[_0x8325('0x7a')][_0x2dce6d][_0x8325('0x7e')]));}}}if(_0x2fb57d['conditions']){_0x2fb57d['conditions']=JSON[_0x8325('0x80')](_0x2fb57d['conditions']);_0x4d4fd1[_0x8325('0x3a')](_0x516ee9(_0x2fb57d['conditions'][_0x8325('0x66')]));}_0x20c978=_0x4d4fd1[_0x8325('0x81')]();_0x4d4fd1[_0x8325('0x1e')](_0x64a4dc);_0x4d4fd1[_0x8325('0x1c')](0x0);logger[_0x8325('0x82')](_0x8325('0x83'),_0x4d4fd1[_0x8325('0x84')]());return dbH[_0x8325('0x85')]['query'](_0x4d4fd1[_0x8325('0x84')](),{'type':dbH[_0x8325('0x85')][_0x8325('0x86')][_0x8325('0x87')]});}})['then'](respondWithResult(_0xccf2ac,null))['catch'](handleError(_0xccf2ac,null));};function runReport(_0x56298d,_0x3fca55,_0x26b344){var _0x1f09d5=_0x3fca55[_0x8325('0x29')];var _0x15abf8=0xa;var _0x122d6f=[_0x8325('0x52'),'left_join',_0x8325('0x53'),'cross_join'];var _0x10a86b={'SUM':_0x8325('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x8325('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8325('0x5c')};var _0x1d6cd3={'SEC_TO_TIME':_0x8325('0x5d'),'DATE':_0x8325('0x88'),'HOUR':_0x8325('0x5e'),'ROUND':_0x8325('0x5f'),'UNIX_TIMESTAMP':_0x8325('0x60')};var _0x2217fe=function(_0x4afcbe){return!_[_0x8325('0x61')]([_0x8325('0x89'),_0x8325('0x62'),_0x8325('0x63'),'IS\x20NOT\x20EMPTY'],_0x4afcbe);};var _0x2c1db2=function(_0x2e145f){if(!_0x2e145f||!_0x2e145f[_0x8325('0x65')][_0x8325('0x36')]){return'';}for(var _0x39ac7f='(',_0x472fea=0x0;_0x472fea<_0x2e145f[_0x8325('0x65')][_0x8325('0x36')];_0x472fea+=0x1){_0x472fea>0x0&&(_0x39ac7f+='\x20'+_0x2e145f[_0x8325('0x8a')]+'\x20');_0x39ac7f+=_0x2e145f[_0x8325('0x65')][_0x472fea][_0x8325('0x66')]?_0x2c1db2(_0x2e145f[_0x8325('0x65')][_0x472fea][_0x8325('0x66')]):_0x2e145f[_0x8325('0x65')][_0x472fea][_0x8325('0x67')]+'\x20'+_0x2e145f[_0x8325('0x65')][_0x472fea][_0x8325('0x68')]+(_0x2217fe(_0x2e145f[_0x8325('0x65')][_0x472fea][_0x8325('0x68')])?'\x20'+_0x2e145f[_0x8325('0x65')][_0x472fea][_0x8325('0x69')]:'');}return _0x39ac7f+')';};var _0x559891={'where':{'id':_0x56298d['id']}},_0x488c76,_0x520320,_0x5f0d35,_0x2e6e1b,_0x819516;_0x559891=_[_0x8325('0x3e')]({},_0x559891,_0x26b344);return db[_0x8325('0x2c')][_0x8325('0x48')](_0x559891)[_0x8325('0x22')](function(_0x1c080f){if(_0x1c080f){_0x488c76=_0x1c080f;return _0x1c080f[_0x8325('0x6a')]();}return null;})[_0x8325('0x22')](function(_0x994f14){if(_0x994f14){if(!_0x994f14[_0x8325('0x36')]){throw new db[(_0x8325('0x6b'))]['ValidationErrorItem'](_0x8325('0x8b'),0x193);}_0x520320=_0x994f14;return db['AnalyticMetric'][_0x8325('0x6e')]({'raw':!![]});}return null;})[_0x8325('0x22')](function(_0x764669){if(_0x764669){_0x5f0d35=_['keyBy'](_0x764669,'id');var _0x46ecc3;var _0x220af2=squel['select']();_0x220af2[_0x8325('0x70')](_0x488c76['table']);for(var _0x4e4d7c=0x0;_0x4e4d7c<_0x520320[_0x8325('0x36')];_0x4e4d7c+=0x1){_0x46ecc3=_0x520320[_0x4e4d7c][_0x8325('0x72')]?_0x5f0d35[_0x520320[_0x4e4d7c]['MetricId']][_0x8325('0x73')]:_0x520320[_0x4e4d7c][_0x8325('0x67')];_0x46ecc3=_0x520320[_0x4e4d7c]['function']?_['replace'](_0x10a86b[_0x520320[_0x4e4d7c][_0x8325('0x74')]],'%s',_0x46ecc3):_0x46ecc3;_0x46ecc3=_0x520320[_0x4e4d7c]['format']?_[_0x8325('0x75')](_0x1d6cd3[_0x520320[_0x4e4d7c]['format']],'%s',_0x46ecc3):_0x46ecc3;if(_0x520320[_0x4e4d7c][_0x8325('0x8c')]){_0x220af2[_0x8325('0x66')](_0x46ecc3);}_0x520320[_0x4e4d7c][_0x8325('0x78')]&&_0x220af2[_0x8325('0x77')](_0x46ecc3,_0x520320[_0x4e4d7c][_0x8325('0x78')]===_0x8325('0x79')?![]:!![]);_0x220af2[_0x8325('0x67')](_0x46ecc3,_0x520320[_0x4e4d7c][_0x8325('0x8d')]||_0x46ecc3);}if(_0x488c76[_0x8325('0x7a')]){_0x488c76[_0x8325('0x7a')]=JSON[_0x8325('0x80')](_0x488c76['joins']);for(var _0x6c77ff=0x0;_0x6c77ff<_0x488c76[_0x8325('0x7a')][_0x8325('0x36')];_0x6c77ff+=0x1){if(_0x488c76['joins'][_0x6c77ff]['type']&&_[_0x8325('0x61')](_0x122d6f,_0x488c76[_0x8325('0x7a')][_0x6c77ff]['type'])&&_0x488c76[_0x8325('0x7a')][_0x6c77ff][_0x8325('0x7c')]&&_0x488c76[_0x8325('0x7a')][_0x6c77ff][_0x8325('0x7d')]&&_0x488c76['joins'][_0x6c77ff]['foreignKey']){_0x220af2[_0x488c76[_0x8325('0x7a')][_0x6c77ff][_0x8325('0x7b')]](_0x488c76['joins'][_0x6c77ff][_0x8325('0x7d')],null,util[_0x8325('0x76')](_0x8325('0x7f'),_0x488c76[_0x8325('0x71')],_0x488c76[_0x8325('0x7a')][_0x6c77ff][_0x8325('0x7c')],_0x488c76[_0x8325('0x7a')][_0x6c77ff][_0x8325('0x7d')],_0x488c76[_0x8325('0x7a')][_0x6c77ff][_0x8325('0x7e')]));}}}if(_0x488c76[_0x8325('0x8e')]){_0x488c76[_0x8325('0x8e')]=JSON[_0x8325('0x80')](_0x488c76[_0x8325('0x8e')]);_0x220af2[_0x8325('0x3a')](_0x2c1db2(_0x488c76[_0x8325('0x8e')][_0x8325('0x66')]));}_0x819516=_0x220af2['clone']();_0x220af2['limit'](_0x15abf8);_0x220af2['offset'](0x0);return;}})[_0x8325('0x22')](function(){if(_0x3fca55[_0x8325('0x8f')]===_0x8325('0x90')){return null;}var _0x3479ae=_[_0x8325('0x3e')](_0x3fca55,{'name':_0x3fca55[_0x8325('0x91')]||_0x3fca55[_0x8325('0x29')]||_0x488c76[_0x8325('0x29')],'basename':_0x1f09d5,'savename':util[_0x8325('0x76')](_0x8325('0x92'),_0x3fca55[_0x8325('0x29')]||_0x488c76[_0x8325('0x29')],require(_0x8325('0x93'))[_0x8325('0x94')](0x4),_0x3fca55['output']||_0x8325('0x95')),'reportId':_0x488c76['id'],'reportType':_0x8325('0x96')});return db[_0x8325('0x97')][_0x8325('0x49')](_0x3479ae,{'raw':!![]});})[_0x8325('0x22')](function(_0x4f8059){if(_0x488c76[_0x8325('0x71')]===_0x8325('0x98')){_0x819516[_0x8325('0x3a')](_0x488c76['table']+_0x8325('0x99'),_0x3fca55['startDate'],_0x3fca55['endDate']);}else{_0x819516[_0x8325('0x3a')](_0x488c76[_0x8325('0x71')]+_0x8325('0x9a'),_0x3fca55['startDate'],_0x3fca55[_0x8325('0x9b')]);}if(_0x4f8059){logger[_0x8325('0x9c')](_0x8325('0x9d'),_0x819516[_0x8325('0x84')]());require(_0x8325('0x9e'))[_0x8325('0x9f')](path[_0x8325('0x52')](__dirname,_0x8325('0xa0'),_0x4f8059[_0x8325('0x8f')]),[_0x4f8059['id'],_0x819516[_0x8325('0x84')](),path[_0x8325('0x52')](__dirname,_0x8325('0xa1'),_0x4f8059[_0x8325('0xa2')]),_0x1f09d5]);return _0x4f8059;}else{var _0x436fe6=squel[_0x8325('0xa3')]();_0x436fe6[_0x8325('0x70')]('('+_0x819516['toString']()+')',_0x8325('0xa4'));_0x436fe6[_0x8325('0x67')]('COUNT(*)','count');_0x819516[_0x8325('0x1e')](_0x3fca55[_0x8325('0x1e')]||_0x15abf8);_0x819516[_0x8325('0x1c')](_0x3fca55[_0x8325('0x1c')]||0x0);return dbH[_0x8325('0x85')][_0x8325('0x30')](_0x436fe6['toString'](),{'type':dbH[_0x8325('0x85')][_0x8325('0x86')][_0x8325('0x87')]})[_0x8325('0x22')](function(_0x5e05cb){if(!_0x5e05cb[_0x8325('0x36')]){_0x2e6e1b=0x0;}else{_0x2e6e1b=_0x5e05cb[0x0]['count']||0x0;}return dbH[_0x8325('0x85')][_0x8325('0x30')](_0x819516[_0x8325('0x84')](),{'type':dbH['sequelize'][_0x8325('0x86')][_0x8325('0x87')]});})[_0x8325('0x22')](function(_0x3e87e7){return{'rows':_0x3e87e7||[],'count':_0x2e6e1b};});}});}exports[_0x8325('0xa5')]=function(_0xf165ba,_0x4b7aed){return runReport(_0xf165ba[_0x8325('0x47')],_0xf165ba[_0x8325('0x30')],_0xf165ba['options'])[_0x8325('0x22')](respondWithResult(_0x4b7aed,null))[_0x8325('0x45')](handleError(_0x4b7aed,null));};exports[_0x8325('0xa6')]=runReport;exports[_0x8325('0x30')]=function(_0x5e0dba,_0x16084f){var _0x552e3a=0xa;var _0x322de7=[_0x8325('0x52'),_0x8325('0xa7'),'right_join',_0x8325('0x54')];var _0x8d72bf={'SUM':_0x8325('0x55'),'COUNT':_0x8325('0x56'),'COUNT DISTINCT':_0x8325('0xa8'),'MAX':'MAX(%s)','MIN':_0x8325('0x58'),'AVG':_0x8325('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8325('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x47b768={'SEC_TO_TIME':_0x8325('0x5d'),'DATE':_0x8325('0x88'),'HOUR':_0x8325('0x5e'),'ROUND':_0x8325('0x5f'),'UNIX_TIMESTAMP':_0x8325('0x60')};var _0x2fab93=function(_0x3ed437){return!_['includes']([_0x8325('0x89'),_0x8325('0x62'),_0x8325('0x63'),_0x8325('0x64')],_0x3ed437);};var _0x55ba33=function(_0x328430){if(!_0x328430||!_0x328430['rules'][_0x8325('0x36')]){return'';}for(var _0xff8924='(',_0x35e37c=0x0;_0x35e37c<_0x328430[_0x8325('0x65')]['length'];_0x35e37c+=0x1){_0x35e37c>0x0&&(_0xff8924+='\x20'+_0x328430['operator']+'\x20');_0xff8924+=_0x328430[_0x8325('0x65')][_0x35e37c][_0x8325('0x66')]?_0x55ba33(_0x328430[_0x8325('0x65')][_0x35e37c][_0x8325('0x66')]):_0x328430[_0x8325('0x65')][_0x35e37c][_0x8325('0x67')]+'\x20'+_0x328430[_0x8325('0x65')][_0x35e37c][_0x8325('0x68')]+(_0x2fab93(_0x328430[_0x8325('0x65')][_0x35e37c][_0x8325('0x68')])?'\x20'+_0x328430['rules'][_0x35e37c][_0x8325('0x69')]:'');}return _0xff8924+')';};var _0x13ed53={'where':{'id':_0x5e0dba[_0x8325('0x47')]['id']}},_0x386308,_0x593efb,_0x2d1c6d,_0x22a1c7,_0x54359c;_0x13ed53=_[_0x8325('0x3e')]({},_0x13ed53,_0x5e0dba[_0x8325('0x40')]);return db[_0x8325('0x2c')]['find'](_0x13ed53)['then'](function(_0x4db0ce){if(_0x4db0ce){_0x386308=_0x4db0ce;return _0x4db0ce[_0x8325('0x6a')]();}return null;})['then'](function(_0x2ec166){if(_0x2ec166){if(!_0x2ec166[_0x8325('0x36')]){throw new db['Sequelize'][(_0x8325('0x6c'))](_0x8325('0x8b'),0x193);}_0x593efb=_0x2ec166;return db[_0x8325('0x6d')][_0x8325('0x6e')]({'raw':!![]});}return null;})[_0x8325('0x22')](function(_0x3ce676){if(_0x3ce676){_0x2d1c6d=_[_0x8325('0x6f')](_0x3ce676,'id');var _0x5e5f22;var _0x263e76=squel[_0x8325('0xa3')]();_0x263e76[_0x8325('0x70')](_0x386308[_0x8325('0x71')]);for(var _0x40f9f6=0x0;_0x40f9f6<_0x593efb[_0x8325('0x36')];_0x40f9f6+=0x1){_0x5e5f22=_0x593efb[_0x40f9f6][_0x8325('0x72')]?_0x2d1c6d[_0x593efb[_0x40f9f6][_0x8325('0x72')]][_0x8325('0x73')]:_0x593efb[_0x40f9f6]['field'];_0x5e5f22=_0x593efb[_0x40f9f6][_0x8325('0x74')]?_['replace'](_0x8d72bf[_0x593efb[_0x40f9f6][_0x8325('0x74')]],'%s',_0x5e5f22):_0x5e5f22;_0x5e5f22=_0x593efb[_0x40f9f6][_0x8325('0x76')]?_[_0x8325('0x75')](_0x47b768[_0x593efb[_0x40f9f6][_0x8325('0x76')]],'%s',_0x5e5f22):_0x5e5f22;if(_0x593efb[_0x40f9f6][_0x8325('0x8c')]){_0x263e76[_0x8325('0x66')](_0x5e5f22);}_0x593efb[_0x40f9f6][_0x8325('0x78')]&&_0x263e76[_0x8325('0x77')](_0x5e5f22,_0x593efb[_0x40f9f6][_0x8325('0x78')]===_0x8325('0x79')?![]:!![]);_0x263e76[_0x8325('0x67')](_0x5e5f22,_0x593efb[_0x40f9f6][_0x8325('0x8d')]||_0x5e5f22);}if(_0x386308[_0x8325('0x7a')]){_0x386308[_0x8325('0x7a')]=JSON['parse'](_0x386308[_0x8325('0x7a')]);for(var _0xab8cd8=0x0;_0xab8cd8<_0x386308[_0x8325('0x7a')][_0x8325('0x36')];_0xab8cd8+=0x1){if(_0x386308[_0x8325('0x7a')][_0xab8cd8]['type']&&_[_0x8325('0x61')](_0x322de7,_0x386308['joins'][_0xab8cd8][_0x8325('0x7b')])&&_0x386308[_0x8325('0x7a')][_0xab8cd8][_0x8325('0x7c')]&&_0x386308[_0x8325('0x7a')][_0xab8cd8]['foreignTable']&&_0x386308[_0x8325('0x7a')][_0xab8cd8][_0x8325('0x7e')]){_0x263e76[_0x386308[_0x8325('0x7a')][_0xab8cd8]['type']](_0x386308['joins'][_0xab8cd8][_0x8325('0x7d')],null,util['format'](_0x8325('0x7f'),_0x386308['table'],_0x386308[_0x8325('0x7a')][_0xab8cd8][_0x8325('0x7c')],_0x386308[_0x8325('0x7a')][_0xab8cd8][_0x8325('0x7d')],_0x386308[_0x8325('0x7a')][_0xab8cd8][_0x8325('0x7e')]));}}}if(_0x386308[_0x8325('0x8e')]){_0x386308[_0x8325('0x8e')]=JSON[_0x8325('0x80')](_0x386308[_0x8325('0x8e')]);_0x263e76['where'](_0x55ba33(_0x386308['conditions']['group']));}_0x54359c=_0x263e76[_0x8325('0x81')]();_0x263e76[_0x8325('0x1e')](_0x552e3a);_0x263e76[_0x8325('0x1c')](0x0);logger[_0x8325('0x82')](_0x8325('0x83'),_0x263e76[_0x8325('0x84')]());return dbH[_0x8325('0x85')][_0x8325('0x30')](_0x263e76[_0x8325('0x84')](),{'type':dbH[_0x8325('0x85')][_0x8325('0x86')][_0x8325('0x87')]});}})[_0x8325('0x22')](function(){return{'sql':_0x54359c[_0x8325('0x84')]()};})[_0x8325('0x22')](respondWithResult(_0x16084f,null))[_0x8325('0x45')](handleError(_0x16084f,null));}; \ No newline at end of file +var _0x7b8e=['body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','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\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','toString','QueryTypes','SELECT','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','getFields','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../files/reports','savename','countTable','COUNT(*)','sequelize','run','runReport','debug','Limited\x20Query:','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','CustomReports','error','stack','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create'];(function(_0x199844,_0x4f4a27){var _0xb7e793=function(_0x2461cb){while(--_0x2461cb){_0x199844['push'](_0x199844['shift']());}};_0xb7e793(++_0x4f4a27);}(_0x7b8e,0x102));var _0xe7b8=function(_0x18cd2f,_0x2f1cd5){_0x18cd2f=_0x18cd2f-0x0;var _0x51d21a=_0x7b8e[_0x18cd2f];return _0x51d21a;};'use strict';var emlformat=require(_0xe7b8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe7b8('0x1'));var moment=require(_0xe7b8('0x2'));var BPromise=require(_0xe7b8('0x3'));var Mustache=require(_0xe7b8('0x4'));var util=require(_0xe7b8('0x5'));var path=require(_0xe7b8('0x6'));var sox=require(_0xe7b8('0x7'));var csv=require(_0xe7b8('0x8'));var ejs=require(_0xe7b8('0x9'));var fs=require('fs');var fs_extra=require(_0xe7b8('0xa'));var _=require(_0xe7b8('0xb'));var squel=require(_0xe7b8('0xc'));var crypto=require(_0xe7b8('0xd'));var jsforce=require(_0xe7b8('0xe'));var deskjs=require(_0xe7b8('0xf'));var toCsv=require(_0xe7b8('0x8'));var querystring=require(_0xe7b8('0x10'));var Papa=require(_0xe7b8('0x11'));var Redis=require('ioredis');var authService=require(_0xe7b8('0x12'));var qs=require(_0xe7b8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7b8('0x14'));var logger=require('../../config/logger')(_0xe7b8('0x15'));var utils=require(_0xe7b8('0x16'));var config=require(_0xe7b8('0x17'));var licenseUtil=require(_0xe7b8('0x18'));var db=require(_0xe7b8('0x19'))['db'];var dbH=require('../../mysqldb')[_0xe7b8('0x1a')];function respondWithStatusCode(_0x1639f9,_0x3a95fd){_0x3a95fd=_0x3a95fd||0xcc;return function(_0x506193){if(_0x506193){return _0x1639f9[_0xe7b8('0x1b')](_0x3a95fd);}return _0x1639f9[_0xe7b8('0x1c')](_0x3a95fd)[_0xe7b8('0x1d')]();};}function respondWithResult(_0x4a170c,_0x340f49){_0x340f49=_0x340f49||0xc8;return function(_0x1f08d5){if(_0x1f08d5){return _0x4a170c[_0xe7b8('0x1c')](_0x340f49)['json'](_0x1f08d5);}};}function respondWithFilteredResult(_0x39b574,_0x5b04c1){return function(_0x59d527){if(_0x59d527){var _0x226417=typeof _0x5b04c1[_0xe7b8('0x1e')]===_0xe7b8('0x1f')&&typeof _0x5b04c1[_0xe7b8('0x20')]===_0xe7b8('0x1f');var _0xbf422a=_0x59d527[_0xe7b8('0x21')];var _0x1dcb66=_0x226417?0x0:_0x5b04c1[_0xe7b8('0x1e')];var _0x23ffcb=_0x226417?_0x59d527[_0xe7b8('0x21')]:_0x5b04c1[_0xe7b8('0x1e')]+_0x5b04c1[_0xe7b8('0x20')];var _0x1927fc;if(_0x23ffcb>=_0xbf422a){_0x23ffcb=_0xbf422a;_0x1927fc=0xc8;}else{_0x1927fc=0xce;}_0x39b574[_0xe7b8('0x1c')](_0x1927fc);return _0x39b574[_0xe7b8('0x22')](_0xe7b8('0x23'),_0x1dcb66+'-'+_0x23ffcb+'/'+_0xbf422a)[_0xe7b8('0x24')](_0x59d527);}return null;};}function patchUpdates(_0x27c1d5){return function(_0x4e4be5){try{jsonpatch[_0xe7b8('0x25')](_0x4e4be5,_0x27c1d5,!![]);}catch(_0x39ee2d){return BPromise[_0xe7b8('0x26')](_0x39ee2d);}return _0x4e4be5['save']();};}function saveUpdates(_0x17dc16,_0x709f1b){return function(_0x3a3c65){if(_0x3a3c65){return _0x3a3c65[_0xe7b8('0x27')](_0x17dc16)['then'](function(_0x40b8e3){return _0x40b8e3;});}return null;};}function removeEntity(_0x552cba,_0x2c80dc){return function(_0xc0aa51){if(_0xc0aa51){return _0xc0aa51['destroy']()[_0xe7b8('0x28')](function(){var _0xe839b8=_0xc0aa51[_0xe7b8('0x29')]({'plain':!![]});var _0x506739=_0xe7b8('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x506739,'resourceId':_0xe839b8['id']}})[_0xe7b8('0x28')](function(){return _0xc0aa51;});})[_0xe7b8('0x28')](function(){_0x552cba[_0xe7b8('0x1c')](0xcc)[_0xe7b8('0x1d')]();});}};}function handleEntityNotFound(_0x46801,_0x3d9a54){return function(_0x3be7d9){if(!_0x3be7d9){_0x46801[_0xe7b8('0x1b')](0x194);}return _0x3be7d9;};}function handleError(_0x118b9f,_0x5a2353){_0x5a2353=_0x5a2353||0x1f4;return function(_0x1e02a8){logger[_0xe7b8('0x2b')](_0x1e02a8[_0xe7b8('0x2c')]);if(_0x1e02a8[_0xe7b8('0x2d')]){delete _0x1e02a8['name'];}_0x118b9f[_0xe7b8('0x1c')](_0x5a2353)['send'](_0x1e02a8);};}exports[_0xe7b8('0x2e')]=function(_0x2a65b3,_0x34fc5f){var _0x52ec18={},_0x2aed10={},_0x7b4c4c={'count':0x0,'rows':[]};var _0x505de2=_['map'](db[_0xe7b8('0x2f')][_0xe7b8('0x30')],function(_0x10493c){return{'name':_0x10493c[_0xe7b8('0x31')],'type':_0x10493c[_0xe7b8('0x32')]['key']};});_0x2aed10[_0xe7b8('0x33')]=_[_0xe7b8('0x34')](_0x505de2,_0xe7b8('0x2d'));_0x2aed10[_0xe7b8('0x35')]=_['keys'](_0x2a65b3[_0xe7b8('0x35')]);_0x2aed10[_0xe7b8('0x36')]=_[_0xe7b8('0x37')](_0x2aed10[_0xe7b8('0x33')],_0x2aed10[_0xe7b8('0x35')]);_0x52ec18[_0xe7b8('0x38')]=_['intersection'](_0x2aed10['model'],qs['fields'](_0x2a65b3[_0xe7b8('0x35')][_0xe7b8('0x39')]));_0x52ec18['attributes']=_0x52ec18[_0xe7b8('0x38')][_0xe7b8('0x3a')]?_0x52ec18['attributes']:_0x2aed10[_0xe7b8('0x33')];if(!_0x2a65b3[_0xe7b8('0x35')]['hasOwnProperty']('nolimit')){_0x52ec18[_0xe7b8('0x20')]=qs[_0xe7b8('0x20')](_0x2a65b3['query'][_0xe7b8('0x20')]);_0x52ec18[_0xe7b8('0x1e')]=qs[_0xe7b8('0x1e')](_0x2a65b3[_0xe7b8('0x35')]['offset']);}_0x52ec18[_0xe7b8('0x3b')]=qs['sort'](_0x2a65b3[_0xe7b8('0x35')][_0xe7b8('0x3c')]);_0x52ec18['where']=qs[_0xe7b8('0x36')](_[_0xe7b8('0x3d')](_0x2a65b3[_0xe7b8('0x35')],_0x2aed10[_0xe7b8('0x36')]),_0x505de2);if(_0x2a65b3[_0xe7b8('0x35')]['filter']){_0x52ec18[_0xe7b8('0x3e')]=_[_0xe7b8('0x3f')](_0x52ec18[_0xe7b8('0x3e')],{'$or':_[_0xe7b8('0x34')](_0x505de2,function(_0x3440ea){if(_0x3440ea['type']!==_0xe7b8('0x40')){var _0x4d7922={};_0x4d7922[_0x3440ea[_0xe7b8('0x2d')]]={'$like':'%'+_0x2a65b3[_0xe7b8('0x35')][_0xe7b8('0x41')]+'%'};return _0x4d7922;}})});}_0x52ec18=_[_0xe7b8('0x3f')]({},_0x52ec18,_0x2a65b3[_0xe7b8('0x42')]);var _0x1d19f8={'where':_0x52ec18['where']};return db[_0xe7b8('0x2f')][_0xe7b8('0x21')](_0x1d19f8)['then'](function(_0xc16675){_0x7b4c4c['count']=_0xc16675;if(_0x2a65b3[_0xe7b8('0x35')][_0xe7b8('0x43')]){_0x52ec18[_0xe7b8('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe7b8('0x45')](_0x52ec18);})[_0xe7b8('0x28')](function(_0x2e21c0){_0x7b4c4c[_0xe7b8('0x46')]=_0x2e21c0;return _0x7b4c4c;})['then'](respondWithFilteredResult(_0x34fc5f,_0x52ec18))[_0xe7b8('0x47')](handleError(_0x34fc5f,null));};exports[_0xe7b8('0x48')]=function(_0x3b2c8c,_0x31080e){var _0x4c4533={'raw':![],'where':{'id':_0x3b2c8c['params']['id']}},_0x5f1d5f={};_0x5f1d5f[_0xe7b8('0x33')]=_[_0xe7b8('0x49')](db[_0xe7b8('0x2f')]['rawAttributes']);_0x5f1d5f[_0xe7b8('0x35')]=_[_0xe7b8('0x49')](_0x3b2c8c['query']);_0x5f1d5f['filters']=_[_0xe7b8('0x37')](_0x5f1d5f[_0xe7b8('0x33')],_0x5f1d5f['query']);_0x4c4533[_0xe7b8('0x38')]=_['intersection'](_0x5f1d5f[_0xe7b8('0x33')],qs[_0xe7b8('0x39')](_0x3b2c8c[_0xe7b8('0x35')][_0xe7b8('0x39')]));_0x4c4533[_0xe7b8('0x38')]=_0x4c4533[_0xe7b8('0x38')][_0xe7b8('0x3a')]?_0x4c4533[_0xe7b8('0x38')]:_0x5f1d5f['model'];if(_0x3b2c8c[_0xe7b8('0x35')][_0xe7b8('0x43')]){_0x4c4533['include']=[{'all':!![]}];}_0x4c4533=_[_0xe7b8('0x3f')]({},_0x4c4533,_0x3b2c8c[_0xe7b8('0x42')]);return db[_0xe7b8('0x2f')][_0xe7b8('0x4a')](_0x4c4533)[_0xe7b8('0x28')](handleEntityNotFound(_0x31080e,null))[_0xe7b8('0x28')](respondWithResult(_0x31080e,null))[_0xe7b8('0x47')](handleError(_0x31080e,null));};exports[_0xe7b8('0x4b')]=function(_0x4bf4f6,_0x3320d8){return db[_0xe7b8('0x2f')][_0xe7b8('0x4b')](_0x4bf4f6[_0xe7b8('0x4c')],{})[_0xe7b8('0x28')](function(_0x433479){var _0x3046d3=_0x4bf4f6['user'][_0xe7b8('0x29')]({'plain':!![]});if(!_0x3046d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3046d3[_0xe7b8('0x4d')]===_0xe7b8('0x4e')){var _0x1e3547=_0x433479[_0xe7b8('0x29')]({'plain':!![]});var _0x4c64d1='Reports';return db[_0xe7b8('0x4f')][_0xe7b8('0x4a')]({'where':{'name':_0x4c64d1,'userProfileId':_0x3046d3[_0xe7b8('0x50')]},'raw':!![]})[_0xe7b8('0x28')](function(_0x42f3d3){if(_0x42f3d3&&_0x42f3d3[_0xe7b8('0x51')]===0x0){return db[_0xe7b8('0x52')][_0xe7b8('0x4b')]({'name':_0x1e3547['name'],'resourceId':_0x1e3547['id'],'type':_0xe7b8('0x2a'),'sectionId':_0x42f3d3['id']},{})[_0xe7b8('0x28')](function(){return _0x433479;});}else{return _0x433479;}})[_0xe7b8('0x47')](function(_0x40211f){logger['error'](_0xe7b8('0x53'),_0x40211f);throw _0x40211f;});}return _0x433479;})['then'](respondWithResult(_0x3320d8,0xc9))[_0xe7b8('0x47')](handleError(_0x3320d8,null));};exports[_0xe7b8('0x27')]=function(_0x1f4b2b,_0x1a5caf){if(_0x1f4b2b[_0xe7b8('0x4c')]['id']){delete _0x1f4b2b[_0xe7b8('0x4c')]['id'];}return db[_0xe7b8('0x2f')][_0xe7b8('0x4a')]({'where':{'id':_0x1f4b2b[_0xe7b8('0x54')]['id']}})['then'](handleEntityNotFound(_0x1a5caf,null))[_0xe7b8('0x28')](saveUpdates(_0x1f4b2b[_0xe7b8('0x4c')],null))[_0xe7b8('0x28')](respondWithResult(_0x1a5caf,null))[_0xe7b8('0x47')](handleError(_0x1a5caf,null));};exports[_0xe7b8('0x55')]=function(_0x37f1c6,_0x13403a){return db[_0xe7b8('0x2f')][_0xe7b8('0x4a')]({'where':{'id':_0x37f1c6[_0xe7b8('0x54')]['id']}})[_0xe7b8('0x28')](handleEntityNotFound(_0x13403a,null))[_0xe7b8('0x28')](removeEntity(_0x13403a,null))['catch'](handleError(_0x13403a,null));};exports['preview']=function(_0xc21b64,_0x1b5b97){var _0x21c24b=0xa;var _0x41f1a0=[_0xe7b8('0x56'),_0xe7b8('0x57'),_0xe7b8('0x58'),_0xe7b8('0x59')];var _0x1e590f={'SUM':_0xe7b8('0x5a'),'COUNT':_0xe7b8('0x5b'),'COUNT DISTINCT':_0xe7b8('0x5c'),'MAX':_0xe7b8('0x5d'),'MIN':_0xe7b8('0x5e'),'AVG':_0xe7b8('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe7b8('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5ed355={'SEC_TO_TIME':_0xe7b8('0x61'),'DATE':_0xe7b8('0x62'),'HOUR':_0xe7b8('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe7b8('0x64')};var _0x506057=function(_0x222cac){return!_[_0xe7b8('0x65')]([_0xe7b8('0x66'),_0xe7b8('0x67'),'IS\x20EMPTY',_0xe7b8('0x68')],_0x222cac);};var _0x428dba=function(_0x375108){if(!_0x375108||!_0x375108['rules'][_0xe7b8('0x3a')]){return'';}for(var _0x361ed6='(',_0x26023b=0x0;_0x26023b<_0x375108['rules'][_0xe7b8('0x3a')];_0x26023b+=0x1){_0x26023b>0x0&&(_0x361ed6+='\x20'+_0x375108[_0xe7b8('0x69')]+'\x20');_0x361ed6+=_0x375108[_0xe7b8('0x6a')][_0x26023b][_0xe7b8('0x6b')]?_0x428dba(_0x375108[_0xe7b8('0x6a')][_0x26023b][_0xe7b8('0x6b')]):_0x375108[_0xe7b8('0x6a')][_0x26023b][_0xe7b8('0x6c')]+'\x20'+_0x375108[_0xe7b8('0x6a')][_0x26023b][_0xe7b8('0x6d')]+(_0x506057(_0x375108[_0xe7b8('0x6a')][_0x26023b][_0xe7b8('0x6d')])?'\x20'+_0x375108['rules'][_0x26023b]['value']:'');}return _0x361ed6+')';};var _0x2f640f={'where':{'id':_0xc21b64[_0xe7b8('0x54')]['id']}},_0x2e6872,_0x763075,_0x35f576,_0xf79d8c,_0x499428;_0x2f640f=_[_0xe7b8('0x3f')]({},_0x2f640f,_0xc21b64['options']);return db[_0xe7b8('0x2f')][_0xe7b8('0x4a')](_0x2f640f)[_0xe7b8('0x28')](function(_0x2af765){if(_0x2af765){_0x2e6872=_0x2af765;return _0x2af765['getFields']();}return null;})[_0xe7b8('0x28')](function(_0x2e89c9){if(_0x2e89c9){if(!_0x2e89c9[_0xe7b8('0x3a')]){throw new db[(_0xe7b8('0x6e'))][(_0xe7b8('0x6f'))](_0xe7b8('0x70'),0x193);}_0x763075=_0x2e89c9;return db[_0xe7b8('0x71')][_0xe7b8('0x45')]({'raw':!![]});}return null;})['then'](function(_0x433079){if(_0x433079){_0x35f576=_[_0xe7b8('0x72')](_0x433079,'id');var _0x116015;var _0x2f79b3=squel[_0xe7b8('0x73')]();_0x2f79b3[_0xe7b8('0x74')](_0x2e6872[_0xe7b8('0x75')]);for(var _0x1985c2=0x0;_0x1985c2<_0x763075[_0xe7b8('0x3a')];_0x1985c2+=0x1){_0x116015=_0x763075[_0x1985c2][_0xe7b8('0x76')]?_0x35f576[_0x763075[_0x1985c2]['MetricId']][_0xe7b8('0x77')]:_0x763075[_0x1985c2][_0xe7b8('0x6c')];_0x116015=_0x763075[_0x1985c2][_0xe7b8('0x78')]?_[_0xe7b8('0x79')](_0x1e590f[_0x763075[_0x1985c2][_0xe7b8('0x78')]],'%s',_0x116015):_0x116015;_0x116015=_0x763075[_0x1985c2][_0xe7b8('0x7a')]?_[_0xe7b8('0x79')](_0x5ed355[_0x763075[_0x1985c2][_0xe7b8('0x7a')]],'%s',_0x116015):_0x116015;if(_0x763075[_0x1985c2][_0xe7b8('0x7b')]){_0x2f79b3[_0xe7b8('0x6b')](_0x116015);}_0x763075[_0x1985c2][_0xe7b8('0x7c')]&&_0x2f79b3[_0xe7b8('0x3b')](_0x116015,_0x763075[_0x1985c2][_0xe7b8('0x7c')]===_0xe7b8('0x7d')?![]:!![]);_0x2f79b3['field'](_0x116015,_0x763075[_0x1985c2][_0xe7b8('0x7e')]||_0x116015);}if(_0x2e6872[_0xe7b8('0x7f')]){_0x2e6872['joins']=JSON[_0xe7b8('0x80')](_0x2e6872['joins']);for(var _0x5dc2f0=0x0;_0x5dc2f0<_0x2e6872[_0xe7b8('0x7f')][_0xe7b8('0x3a')];_0x5dc2f0+=0x1){if(_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0]['type']&&_[_0xe7b8('0x65')](_0x41f1a0,_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0][_0xe7b8('0x32')])&&_0x2e6872['joins'][_0x5dc2f0][_0xe7b8('0x81')]&&_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0]['foreignTable']&&_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0][_0xe7b8('0x82')]){_0x2f79b3[_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0][_0xe7b8('0x32')]](_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0][_0xe7b8('0x83')],null,util[_0xe7b8('0x7a')]('%s.%s\x20=\x20%s.%s',_0x2e6872['table'],_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0][_0xe7b8('0x81')],_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0][_0xe7b8('0x83')],_0x2e6872[_0xe7b8('0x7f')][_0x5dc2f0][_0xe7b8('0x82')]));}}}if(_0x2e6872[_0xe7b8('0x84')]){_0x2e6872[_0xe7b8('0x84')]=JSON['parse'](_0x2e6872[_0xe7b8('0x84')]);_0x2f79b3[_0xe7b8('0x3e')](_0x428dba(_0x2e6872['conditions']['group']));}_0x499428=_0x2f79b3[_0xe7b8('0x85')]();_0x2f79b3[_0xe7b8('0x20')](_0x21c24b);_0x2f79b3[_0xe7b8('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x2f79b3[_0xe7b8('0x86')]());return dbH['sequelize']['query'](_0x2f79b3[_0xe7b8('0x86')](),{'type':dbH['sequelize'][_0xe7b8('0x87')][_0xe7b8('0x88')]});}})[_0xe7b8('0x28')](respondWithResult(_0x1b5b97,null))['catch'](handleError(_0x1b5b97,null));};function runReport(_0x10d1cd,_0x3114d5,_0x3599a7){var _0x4563c7=_0x3114d5['name'];var _0x53610d=0xa;var _0x12e3d9=[_0xe7b8('0x56'),_0xe7b8('0x57'),'right_join',_0xe7b8('0x59')];var _0x4390b3={'SUM':_0xe7b8('0x5a'),'COUNT':_0xe7b8('0x5b'),'COUNT DISTINCT':_0xe7b8('0x5c'),'MAX':'MAX(%s)','MIN':_0xe7b8('0x5e'),'AVG':_0xe7b8('0x5f'),'GROUP_CONCAT':_0xe7b8('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe7b8('0x8a')};var _0x158888={'SEC_TO_TIME':_0xe7b8('0x61'),'DATE':_0xe7b8('0x62'),'HOUR':_0xe7b8('0x63'),'ROUND':_0xe7b8('0x8b'),'UNIX_TIMESTAMP':_0xe7b8('0x64')};var _0x59fbf7=function(_0x7b3098){return!_[_0xe7b8('0x65')](['IS\x20NULL',_0xe7b8('0x67'),'IS\x20EMPTY',_0xe7b8('0x68')],_0x7b3098);};var _0x2c46a9=function(_0x2941ca){if(!_0x2941ca||!_0x2941ca[_0xe7b8('0x6a')][_0xe7b8('0x3a')]){return'';}for(var _0x2376cb='(',_0x2a77fd=0x0;_0x2a77fd<_0x2941ca['rules'][_0xe7b8('0x3a')];_0x2a77fd+=0x1){_0x2a77fd>0x0&&(_0x2376cb+='\x20'+_0x2941ca[_0xe7b8('0x69')]+'\x20');_0x2376cb+=_0x2941ca[_0xe7b8('0x6a')][_0x2a77fd]['group']?_0x2c46a9(_0x2941ca[_0xe7b8('0x6a')][_0x2a77fd][_0xe7b8('0x6b')]):_0x2941ca[_0xe7b8('0x6a')][_0x2a77fd][_0xe7b8('0x6c')]+'\x20'+_0x2941ca[_0xe7b8('0x6a')][_0x2a77fd][_0xe7b8('0x6d')]+(_0x59fbf7(_0x2941ca[_0xe7b8('0x6a')][_0x2a77fd][_0xe7b8('0x6d')])?'\x20'+_0x2941ca[_0xe7b8('0x6a')][_0x2a77fd]['value']:'');}return _0x2376cb+')';};var _0x3921b4={'where':{'id':_0x10d1cd['id']}},_0xf8e1f7,_0x42bed7,_0x5c1bea,_0x3cff38,_0x30fb8d;_0x3921b4=_[_0xe7b8('0x3f')]({},_0x3921b4,_0x3599a7);return db[_0xe7b8('0x2f')][_0xe7b8('0x4a')](_0x3921b4)[_0xe7b8('0x28')](function(_0x21ba08){if(_0x21ba08){_0xf8e1f7=_0x21ba08;return _0x21ba08[_0xe7b8('0x8c')]();}return null;})['then'](function(_0x1a761c){if(_0x1a761c){if(!_0x1a761c[_0xe7b8('0x3a')]){throw new db[(_0xe7b8('0x6e'))][(_0xe7b8('0x6f'))](_0xe7b8('0x70'),0x193);}_0x42bed7=_0x1a761c;return db[_0xe7b8('0x71')][_0xe7b8('0x45')]({'raw':!![]});}return null;})['then'](function(_0x5e1d8c){if(_0x5e1d8c){_0x5c1bea=_[_0xe7b8('0x72')](_0x5e1d8c,'id');var _0x367af1;var _0x210410=squel[_0xe7b8('0x73')]();_0x210410[_0xe7b8('0x74')](_0xf8e1f7['table']);for(var _0x25eb83=0x0;_0x25eb83<_0x42bed7[_0xe7b8('0x3a')];_0x25eb83+=0x1){_0x367af1=_0x42bed7[_0x25eb83]['MetricId']?_0x5c1bea[_0x42bed7[_0x25eb83][_0xe7b8('0x76')]][_0xe7b8('0x77')]:_0x42bed7[_0x25eb83]['field'];_0x367af1=_0x42bed7[_0x25eb83]['function']?_[_0xe7b8('0x79')](_0x4390b3[_0x42bed7[_0x25eb83]['function']],'%s',_0x367af1):_0x367af1;_0x367af1=_0x42bed7[_0x25eb83][_0xe7b8('0x7a')]?_['replace'](_0x158888[_0x42bed7[_0x25eb83]['format']],'%s',_0x367af1):_0x367af1;if(_0x42bed7[_0x25eb83][_0xe7b8('0x7b')]){_0x210410['group'](_0x367af1);}_0x42bed7[_0x25eb83][_0xe7b8('0x7c')]&&_0x210410[_0xe7b8('0x3b')](_0x367af1,_0x42bed7[_0x25eb83][_0xe7b8('0x7c')]===_0xe7b8('0x7d')?![]:!![]);_0x210410['field'](_0x367af1,_0x42bed7[_0x25eb83][_0xe7b8('0x7e')]||_0x367af1);}if(_0xf8e1f7[_0xe7b8('0x7f')]){_0xf8e1f7['joins']=JSON[_0xe7b8('0x80')](_0xf8e1f7['joins']);for(var _0x13befb=0x0;_0x13befb<_0xf8e1f7[_0xe7b8('0x7f')]['length'];_0x13befb+=0x1){if(_0xf8e1f7['joins'][_0x13befb][_0xe7b8('0x32')]&&_['includes'](_0x12e3d9,_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb]['type'])&&_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb][_0xe7b8('0x81')]&&_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb][_0xe7b8('0x83')]&&_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb][_0xe7b8('0x82')]){_0x210410[_0xf8e1f7['joins'][_0x13befb][_0xe7b8('0x32')]](_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb][_0xe7b8('0x83')],null,util[_0xe7b8('0x7a')](_0xe7b8('0x8d'),_0xf8e1f7[_0xe7b8('0x75')],_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb][_0xe7b8('0x81')],_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb][_0xe7b8('0x83')],_0xf8e1f7[_0xe7b8('0x7f')][_0x13befb][_0xe7b8('0x82')]));}}}if(_0xf8e1f7[_0xe7b8('0x84')]){_0xf8e1f7[_0xe7b8('0x84')]=JSON[_0xe7b8('0x80')](_0xf8e1f7[_0xe7b8('0x84')]);_0x210410[_0xe7b8('0x3e')](_0x2c46a9(_0xf8e1f7['conditions'][_0xe7b8('0x6b')]));}_0x30fb8d=_0x210410[_0xe7b8('0x85')]();_0x210410[_0xe7b8('0x20')](_0x53610d);_0x210410[_0xe7b8('0x1e')](0x0);return;}})[_0xe7b8('0x28')](function(){if(_0x3114d5[_0xe7b8('0x8e')]===_0xe7b8('0x8f')){return null;}var _0x230935=_[_0xe7b8('0x3f')](_0x3114d5,{'name':_0x3114d5[_0xe7b8('0x90')]||_0x3114d5[_0xe7b8('0x2d')]||_0xf8e1f7[_0xe7b8('0x2d')],'basename':_0x4563c7,'savename':util[_0xe7b8('0x7a')](_0xe7b8('0x91'),_0x3114d5['name']||_0xf8e1f7[_0xe7b8('0x2d')],require('randomstring')[_0xe7b8('0x92')](0x4),_0x3114d5[_0xe7b8('0x8e')]||_0xe7b8('0x93')),'reportId':_0xf8e1f7['id'],'reportType':_0xe7b8('0x94')});return db[_0xe7b8('0x95')][_0xe7b8('0x4b')](_0x230935,{'raw':!![]});})[_0xe7b8('0x28')](function(_0x17e347){if(_0xf8e1f7['table']===_0xe7b8('0x96')){_0x30fb8d[_0xe7b8('0x3e')](_0xf8e1f7[_0xe7b8('0x75')]+_0xe7b8('0x97'),_0x3114d5[_0xe7b8('0x98')],_0x3114d5[_0xe7b8('0x99')]);}else{_0x30fb8d[_0xe7b8('0x3e')](_0xf8e1f7['table']+_0xe7b8('0x9a'),_0x3114d5[_0xe7b8('0x98')],_0x3114d5[_0xe7b8('0x99')]);}if(_0x17e347){logger[_0xe7b8('0x9b')](_0xe7b8('0x9c'),_0x30fb8d[_0xe7b8('0x86')]());require('child_process')[_0xe7b8('0x9d')](path[_0xe7b8('0x56')](__dirname,'../../components/export/',_0x17e347[_0xe7b8('0x8e')]),[_0x17e347['id'],_0x30fb8d[_0xe7b8('0x86')](),path[_0xe7b8('0x56')](__dirname,_0xe7b8('0x9e'),_0x17e347[_0xe7b8('0x9f')]),_0x4563c7]);return _0x17e347;}else{var _0x4f49b5=squel['select']();_0x4f49b5['from']('('+_0x30fb8d[_0xe7b8('0x86')]()+')',_0xe7b8('0xa0'));_0x4f49b5['field'](_0xe7b8('0xa1'),_0xe7b8('0x21'));_0x30fb8d[_0xe7b8('0x20')](_0x3114d5[_0xe7b8('0x20')]||_0x53610d);_0x30fb8d[_0xe7b8('0x1e')](_0x3114d5[_0xe7b8('0x1e')]||0x0);return dbH[_0xe7b8('0xa2')][_0xe7b8('0x35')](_0x4f49b5['toString'](),{'type':dbH[_0xe7b8('0xa2')]['QueryTypes'][_0xe7b8('0x88')]})['then'](function(_0x32990f){if(!_0x32990f[_0xe7b8('0x3a')]){_0x3cff38=0x0;}else{_0x3cff38=_0x32990f[0x0][_0xe7b8('0x21')]||0x0;}return dbH[_0xe7b8('0xa2')][_0xe7b8('0x35')](_0x30fb8d[_0xe7b8('0x86')](),{'type':dbH[_0xe7b8('0xa2')]['QueryTypes'][_0xe7b8('0x88')]});})[_0xe7b8('0x28')](function(_0x2a9d01){return{'rows':_0x2a9d01||[],'count':_0x3cff38};});}});}exports[_0xe7b8('0xa3')]=function(_0x588f2e,_0xe4220){return runReport(_0x588f2e[_0xe7b8('0x54')],_0x588f2e['query'],_0x588f2e[_0xe7b8('0x42')])[_0xe7b8('0x28')](respondWithResult(_0xe4220,null))[_0xe7b8('0x47')](handleError(_0xe4220,null));};exports[_0xe7b8('0xa4')]=runReport;exports[_0xe7b8('0x35')]=function(_0xc125e5,_0x50c595){var _0x152dc5=0xa;var _0x557e28=[_0xe7b8('0x56'),'left_join',_0xe7b8('0x58'),_0xe7b8('0x59')];var _0x90595b={'SUM':'SUM(%s)','COUNT':_0xe7b8('0x5b'),'COUNT DISTINCT':_0xe7b8('0x5c'),'MAX':_0xe7b8('0x5d'),'MIN':_0xe7b8('0x5e'),'AVG':_0xe7b8('0x5f'),'GROUP_CONCAT':_0xe7b8('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe7b8('0x8a')};var _0x33d289={'SEC_TO_TIME':_0xe7b8('0x61'),'DATE':_0xe7b8('0x62'),'HOUR':_0xe7b8('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe7b8('0x64')};var _0x1ac922=function(_0x1a1538){return!_[_0xe7b8('0x65')](['IS\x20NULL',_0xe7b8('0x67'),'IS\x20EMPTY',_0xe7b8('0x68')],_0x1a1538);};var _0x33e808=function(_0x5f01c8){if(!_0x5f01c8||!_0x5f01c8[_0xe7b8('0x6a')][_0xe7b8('0x3a')]){return'';}for(var _0x55f386='(',_0x4a110c=0x0;_0x4a110c<_0x5f01c8[_0xe7b8('0x6a')]['length'];_0x4a110c+=0x1){_0x4a110c>0x0&&(_0x55f386+='\x20'+_0x5f01c8[_0xe7b8('0x69')]+'\x20');_0x55f386+=_0x5f01c8[_0xe7b8('0x6a')][_0x4a110c]['group']?_0x33e808(_0x5f01c8[_0xe7b8('0x6a')][_0x4a110c][_0xe7b8('0x6b')]):_0x5f01c8[_0xe7b8('0x6a')][_0x4a110c][_0xe7b8('0x6c')]+'\x20'+_0x5f01c8[_0xe7b8('0x6a')][_0x4a110c][_0xe7b8('0x6d')]+(_0x1ac922(_0x5f01c8[_0xe7b8('0x6a')][_0x4a110c][_0xe7b8('0x6d')])?'\x20'+_0x5f01c8['rules'][_0x4a110c]['value']:'');}return _0x55f386+')';};var _0x53083c={'where':{'id':_0xc125e5[_0xe7b8('0x54')]['id']}},_0x334694,_0x46a97b,_0x2b82b7,_0xe10e5,_0x41ca25;_0x53083c=_[_0xe7b8('0x3f')]({},_0x53083c,_0xc125e5['options']);return db['AnalyticCustomReport'][_0xe7b8('0x4a')](_0x53083c)['then'](function(_0x23358d){if(_0x23358d){_0x334694=_0x23358d;return _0x23358d[_0xe7b8('0x8c')]();}return null;})[_0xe7b8('0x28')](function(_0x543330){if(_0x543330){if(!_0x543330[_0xe7b8('0x3a')]){throw new db[(_0xe7b8('0x6e'))]['ValidationErrorItem'](_0xe7b8('0x70'),0x193);}_0x46a97b=_0x543330;return db[_0xe7b8('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe7b8('0x28')](function(_0x28f787){if(_0x28f787){_0x2b82b7=_[_0xe7b8('0x72')](_0x28f787,'id');var _0xab154d;var _0x53a556=squel[_0xe7b8('0x73')]();_0x53a556[_0xe7b8('0x74')](_0x334694[_0xe7b8('0x75')]);for(var _0x5611b4=0x0;_0x5611b4<_0x46a97b[_0xe7b8('0x3a')];_0x5611b4+=0x1){_0xab154d=_0x46a97b[_0x5611b4][_0xe7b8('0x76')]?_0x2b82b7[_0x46a97b[_0x5611b4]['MetricId']]['metric']:_0x46a97b[_0x5611b4][_0xe7b8('0x6c')];_0xab154d=_0x46a97b[_0x5611b4][_0xe7b8('0x78')]?_['replace'](_0x90595b[_0x46a97b[_0x5611b4][_0xe7b8('0x78')]],'%s',_0xab154d):_0xab154d;_0xab154d=_0x46a97b[_0x5611b4][_0xe7b8('0x7a')]?_['replace'](_0x33d289[_0x46a97b[_0x5611b4][_0xe7b8('0x7a')]],'%s',_0xab154d):_0xab154d;if(_0x46a97b[_0x5611b4][_0xe7b8('0x7b')]){_0x53a556[_0xe7b8('0x6b')](_0xab154d);}_0x46a97b[_0x5611b4]['orderBy']&&_0x53a556[_0xe7b8('0x3b')](_0xab154d,_0x46a97b[_0x5611b4][_0xe7b8('0x7c')]===_0xe7b8('0x7d')?![]:!![]);_0x53a556[_0xe7b8('0x6c')](_0xab154d,_0x46a97b[_0x5611b4]['alias']||_0xab154d);}if(_0x334694[_0xe7b8('0x7f')]){_0x334694[_0xe7b8('0x7f')]=JSON['parse'](_0x334694[_0xe7b8('0x7f')]);for(var _0x531cad=0x0;_0x531cad<_0x334694['joins']['length'];_0x531cad+=0x1){if(_0x334694[_0xe7b8('0x7f')][_0x531cad][_0xe7b8('0x32')]&&_[_0xe7b8('0x65')](_0x557e28,_0x334694[_0xe7b8('0x7f')][_0x531cad]['type'])&&_0x334694[_0xe7b8('0x7f')][_0x531cad]['parentKey']&&_0x334694[_0xe7b8('0x7f')][_0x531cad][_0xe7b8('0x83')]&&_0x334694[_0xe7b8('0x7f')][_0x531cad][_0xe7b8('0x82')]){_0x53a556[_0x334694[_0xe7b8('0x7f')][_0x531cad][_0xe7b8('0x32')]](_0x334694[_0xe7b8('0x7f')][_0x531cad][_0xe7b8('0x83')],null,util[_0xe7b8('0x7a')](_0xe7b8('0x8d'),_0x334694[_0xe7b8('0x75')],_0x334694[_0xe7b8('0x7f')][_0x531cad][_0xe7b8('0x81')],_0x334694[_0xe7b8('0x7f')][_0x531cad]['foreignTable'],_0x334694[_0xe7b8('0x7f')][_0x531cad][_0xe7b8('0x82')]));}}}if(_0x334694[_0xe7b8('0x84')]){_0x334694['conditions']=JSON[_0xe7b8('0x80')](_0x334694[_0xe7b8('0x84')]);_0x53a556['where'](_0x33e808(_0x334694[_0xe7b8('0x84')]['group']));}_0x41ca25=_0x53a556['clone']();_0x53a556['limit'](_0x152dc5);_0x53a556[_0xe7b8('0x1e')](0x0);logger[_0xe7b8('0xa5')](_0xe7b8('0xa6'),_0x53a556[_0xe7b8('0x86')]());return dbH['sequelize'][_0xe7b8('0x35')](_0x53a556[_0xe7b8('0x86')](),{'type':dbH['sequelize'][_0xe7b8('0x87')][_0xe7b8('0x88')]});}})['then'](function(){return{'sql':_0x41ca25['toString']()};})['then'](respondWithResult(_0x50c595,null))[_0xe7b8('0x47')](handleError(_0x50c595,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 2f40661..424e0d6 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 _0xce06=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports'];(function(_0x334266,_0x901100){var _0x3a28d9=function(_0x526491){while(--_0x526491){_0x334266['push'](_0x334266['shift']());}};_0x3a28d9(++_0x901100);}(_0xce06,0x111));var _0x6ce0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xce06[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6ce0('0x0'));var util=require(_0x6ce0('0x1'));var logger=require(_0x6ce0('0x2'))(_0x6ce0('0x3'));var moment=require(_0x6ce0('0x4'));var BPromise=require(_0x6ce0('0x5'));var rp=require(_0x6ce0('0x6'));var fs=require('fs');var path=require(_0x6ce0('0x7'));var rimraf=require('rimraf');var config=require(_0x6ce0('0x8'));var attributes=require(_0x6ce0('0x9'));module[_0x6ce0('0xa')]=function(_0x640630,_0x23f7cf){return _0x640630['define'](_0x6ce0('0xb'),attributes,{'tableName':_0x6ce0('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefa9=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','request-promise'];(function(_0x1f2f86,_0x57341c){var _0x43a6b3=function(_0x30430b){while(--_0x30430b){_0x1f2f86['push'](_0x1f2f86['shift']());}};_0x43a6b3(++_0x57341c);}(_0xefa9,0x104));var _0x9efa=function(_0x3d7a9f,_0x24e0f1){_0x3d7a9f=_0x3d7a9f-0x0;var _0x13f5f1=_0xefa9[_0x3d7a9f];return _0x13f5f1;};'use strict';var _=require(_0x9efa('0x0'));var util=require(_0x9efa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9efa('0x2'));var BPromise=require('bluebird');var rp=require(_0x9efa('0x3'));var fs=require('fs');var path=require(_0x9efa('0x4'));var rimraf=require(_0x9efa('0x5'));var config=require(_0x9efa('0x6'));var attributes=require(_0x9efa('0x7'));module[_0x9efa('0x8')]=function(_0x27b7aa,_0x8cefc7){return _0x27b7aa[_0x9efa('0x9')](_0x9efa('0xa'),attributes,{'tableName':_0x9efa('0xb'),'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 c56de05..aeec99d 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 _0xac03=['message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3f7879,_0x32cca7){var _0x2817ac=function(_0x5e963e){while(--_0x5e963e){_0x3f7879['push'](_0x3f7879['shift']());}};_0x2817ac(++_0x32cca7);}(_0xac03,0x81));var _0x3ac0=function(_0x39b360,_0x528399){_0x39b360=_0x39b360-0x0;var _0x29c614=_0xac03[_0x39b360];return _0x29c614;};'use strict';var _=require(_0x3ac0('0x0'));var util=require(_0x3ac0('0x1'));var moment=require('moment');var BPromise=require(_0x3ac0('0x2'));var rs=require(_0x3ac0('0x3'));var fs=require('fs');var Redis=require(_0x3ac0('0x4'));var db=require(_0x3ac0('0x5'))['db'];var utils=require(_0x3ac0('0x6'));var logger=require('../../config/logger')(_0x3ac0('0x7'));var config=require(_0x3ac0('0x8'));var jayson=require(_0x3ac0('0x9'));var client=jayson[_0x3ac0('0xa')][_0x3ac0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f2703,_0x4ba6d2,_0x2c5f5d){return new BPromise(function(_0x2e4e0e,_0x44d158){return client[_0x3ac0('0xc')](_0x5f2703,_0x2c5f5d)[_0x3ac0('0xd')](function(_0x527139){logger['info'](_0x3ac0('0xe'),_0x4ba6d2,'request\x20sent');logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4ba6d2,_0x3ac0('0xf'),JSON['stringify'](_0x527139));if(_0x527139[_0x3ac0('0x10')]){if(_0x527139[_0x3ac0('0x10')][_0x3ac0('0x11')]===0x1f4){logger[_0x3ac0('0x10')](_0x3ac0('0xe'),_0x4ba6d2,_0x527139[_0x3ac0('0x10')][_0x3ac0('0x12')]);return _0x44d158(_0x527139[_0x3ac0('0x10')][_0x3ac0('0x12')]);}logger[_0x3ac0('0x10')](_0x3ac0('0xe'),_0x4ba6d2,_0x527139[_0x3ac0('0x10')][_0x3ac0('0x12')]);return _0x2e4e0e(_0x527139[_0x3ac0('0x10')][_0x3ac0('0x12')]);}else{logger[_0x3ac0('0x13')](_0x3ac0('0xe'),_0x4ba6d2,'request\x20sent');_0x2e4e0e(_0x527139[_0x3ac0('0x14')]['message']);}})['catch'](function(_0x5744e3){logger['error'](_0x3ac0('0xe'),_0x4ba6d2,_0x5744e3);_0x44d158(_0x5744e3);});});} \ No newline at end of file +var _0xc3c4=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x408cdf,_0xa1fed2){var _0x284381=function(_0x2ad6bb){while(--_0x2ad6bb){_0x408cdf['push'](_0x408cdf['shift']());}};_0x284381(++_0xa1fed2);}(_0xc3c4,0x95));var _0x4c3c=function(_0x57ba77,_0x11a782){_0x57ba77=_0x57ba77-0x0;var _0x510e70=_0xc3c4[_0x57ba77];return _0x510e70;};'use strict';var _=require('lodash');var util=require(_0x4c3c('0x0'));var moment=require(_0x4c3c('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c3c('0x2'));var fs=require('fs');var Redis=require(_0x4c3c('0x3'));var db=require(_0x4c3c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4c3c('0x5'));var jayson=require(_0x4c3c('0x6'));var client=jayson[_0x4c3c('0x7')][_0x4c3c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ac5ab,_0x23311b,_0x220dd6){return new BPromise(function(_0x26ba24,_0x1d3e43){return client[_0x4c3c('0x9')](_0x1ac5ab,_0x220dd6)[_0x4c3c('0xa')](function(_0x1d8da0){logger[_0x4c3c('0xb')](_0x4c3c('0xc'),_0x23311b,_0x4c3c('0xd'));logger[_0x4c3c('0xe')](_0x4c3c('0xf'),_0x23311b,_0x4c3c('0xd'),JSON['stringify'](_0x1d8da0));if(_0x1d8da0[_0x4c3c('0x10')]){if(_0x1d8da0['error'][_0x4c3c('0x11')]===0x1f4){logger[_0x4c3c('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x23311b,_0x1d8da0[_0x4c3c('0x10')]['message']);return _0x1d3e43(_0x1d8da0[_0x4c3c('0x10')][_0x4c3c('0x12')]);}logger[_0x4c3c('0x10')](_0x4c3c('0xc'),_0x23311b,_0x1d8da0['error'][_0x4c3c('0x12')]);return _0x26ba24(_0x1d8da0[_0x4c3c('0x10')]['message']);}else{logger['info'](_0x4c3c('0xc'),_0x23311b,'request\x20sent');_0x26ba24(_0x1d8da0[_0x4c3c('0x13')][_0x4c3c('0x12')]);}})['catch'](function(_0x5900a1){logger[_0x4c3c('0x10')](_0x4c3c('0xc'),_0x23311b,_0x5900a1);_0x1d3e43(_0x5900a1);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index c39f7ed..b46732e 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 _0x67f0=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','run','query','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x67f0,0x163));var _0x067f=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x67f0[_0x496333];return _0x44256e;};'use strict';var multer=require(_0x067f('0x0'));var util=require(_0x067f('0x1'));var path=require(_0x067f('0x2'));var timeout=require(_0x067f('0x3'));var express=require(_0x067f('0x4'));var router=express[_0x067f('0x5')]();var fs_extra=require(_0x067f('0x6'));var auth=require(_0x067f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x067f('0x8'));var controller=require(_0x067f('0x9'));router[_0x067f('0xa')]('/',auth[_0x067f('0xb')](),controller[_0x067f('0xc')]);router['get']('/:id',auth[_0x067f('0xb')](),controller[_0x067f('0xd')]);router['get'](_0x067f('0xe'),auth[_0x067f('0xb')](),controller[_0x067f('0xf')]);router[_0x067f('0xa')]('/:id/run',auth[_0x067f('0xb')](),controller[_0x067f('0x10')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x067f('0x11')]);router[_0x067f('0x12')]('/',auth[_0x067f('0xb')](),controller['create']);router[_0x067f('0x13')](_0x067f('0x14'),auth[_0x067f('0xb')](),controller['update']);router[_0x067f('0x15')](_0x067f('0x14'),auth[_0x067f('0xb')](),controller[_0x067f('0x16')]);module[_0x067f('0x17')]=router; \ No newline at end of file +var _0xdcce=['index','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x4497b2,_0x174577){var _0x2fbfeb=function(_0x41e1fb){while(--_0x41e1fb){_0x4497b2['push'](_0x4497b2['shift']());}};_0x2fbfeb(++_0x174577);}(_0xdcce,0xa6));var _0xedcc=function(_0xebe75b,_0xdb1fe0){_0xebe75b=_0xebe75b-0x0;var _0x25abbf=_0xdcce[_0xebe75b];return _0x25abbf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xedcc('0x0'));var timeout=require(_0xedcc('0x1'));var express=require(_0xedcc('0x2'));var router=express[_0xedcc('0x3')]();var fs_extra=require(_0xedcc('0x4'));var auth=require(_0xedcc('0x5'));var interaction=require(_0xedcc('0x6'));var config=require('../../config/environment');var controller=require(_0xedcc('0x7'));router[_0xedcc('0x8')]('/',auth[_0xedcc('0x9')](),controller[_0xedcc('0xa')]);router[_0xedcc('0x8')](_0xedcc('0xb'),auth[_0xedcc('0x9')](),controller[_0xedcc('0xc')]);router[_0xedcc('0x8')](_0xedcc('0xd'),auth[_0xedcc('0x9')](),controller['preview']);router[_0xedcc('0x8')](_0xedcc('0xe'),auth[_0xedcc('0x9')](),controller[_0xedcc('0xf')]);router['get'](_0xedcc('0x10'),auth['isAuthenticated'](),controller[_0xedcc('0x11')]);router['post']('/',auth[_0xedcc('0x9')](),controller['create']);router['put'](_0xedcc('0xb'),auth['isAuthenticated'](),controller[_0xedcc('0x12')]);router[_0xedcc('0x13')](_0xedcc('0xb'),auth[_0xedcc('0x9')](),controller[_0xedcc('0x14')]);module[_0xedcc('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 3906383..0a9f9b6 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x37b31c,_0x19ffd5){var _0x18cccc=function(_0x29f594){while(--_0x29f594){_0x37b31c['push'](_0x37b31c['shift']());}};_0x18cccc(++_0x19ffd5);}(_0x5fab,0x177));var _0xb5fa=function(_0x1a127a,_0x42f6e6){_0x1a127a=_0x1a127a-0x0;var _0x2a724b=_0x5fab[_0x1a127a];return _0x2a724b;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file +var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5136df,_0xaf9b6f){_0x5136df=_0x5136df-0x0;var _0x1cd16b=_0x8ef6[_0x5136df];return _0x1cd16b;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 02d415a..1e358c1 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 _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0x46ed,0x168));var _0xd46e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x46ed[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5167bb8..b647555 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 _0xbe26=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird'];(function(_0x3f37c0,_0x427ba2){var _0x10f08b=function(_0x318474){while(--_0x318474){_0x3f37c0['push'](_0x3f37c0['shift']());}};_0x10f08b(++_0x427ba2);}(_0xbe26,0x19c));var _0x6be2=function(_0x2e486c,_0x289304){_0x2e486c=_0x2e486c-0x0;var _0x5936b8=_0xbe26[_0x2e486c];return _0x5936b8;};'use strict';var _=require('lodash');var util=require(_0x6be2('0x0'));var logger=require(_0x6be2('0x1'))(_0x6be2('0x2'));var moment=require('moment');var BPromise=require(_0x6be2('0x3'));var rp=require(_0x6be2('0x4'));var fs=require('fs');var path=require(_0x6be2('0x5'));var rimraf=require(_0x6be2('0x6'));var config=require(_0x6be2('0x7'));var attributes=require(_0x6be2('0x8'));module[_0x6be2('0x9')]=function(_0x34a3f8,_0x331f3e){return _0x34a3f8[_0x6be2('0xa')](_0x6be2('0xb'),attributes,{'tableName':_0x6be2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bc8=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x2bc8,0x1e0));var _0x82bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x82bc('0x0'));var logger=require(_0x82bc('0x1'))(_0x82bc('0x2'));var moment=require(_0x82bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x82bc('0x4'));var fs=require('fs');var path=require(_0x82bc('0x5'));var rimraf=require(_0x82bc('0x6'));var config=require(_0x82bc('0x7'));var attributes=require(_0x82bc('0x8'));module['exports']=function(_0x4d703f,_0x4fd45c){return _0x4d703f[_0x82bc('0x9')](_0x82bc('0xa'),attributes,{'tableName':_0x82bc('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 97caffe..93600d5 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 _0x02f9=['AnalyticDefaultReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x14c65b,_0x10b662){var _0x7ed29a=function(_0x70006){while(--_0x70006){_0x14c65b['push'](_0x14c65b['shift']());}};_0x7ed29a(++_0x10b662);}(_0x02f9,0x1f1));var _0x902f=function(_0x1be218,_0x4d1ee0){_0x1be218=_0x1be218-0x0;var _0x8ff181=_0x02f9[_0x1be218];return _0x8ff181;};'use strict';var _=require('lodash');var util=require(_0x902f('0x0'));var moment=require(_0x902f('0x1'));var BPromise=require(_0x902f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x902f('0x3'))['db'];var utils=require(_0x902f('0x4'));var logger=require('../../config/logger')(_0x902f('0x5'));var config=require(_0x902f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x902f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x246012,_0x3dae4d,_0x1a6482){return new BPromise(function(_0x1989c8,_0x429e20){return client['request'](_0x246012,_0x1a6482)[_0x902f('0x8')](function(_0x31fa71){logger[_0x902f('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3dae4d,_0x902f('0xa'));logger[_0x902f('0xb')](_0x902f('0xc'),_0x3dae4d,'request\x20sent',JSON[_0x902f('0xd')](_0x31fa71));if(_0x31fa71[_0x902f('0xe')]){if(_0x31fa71[_0x902f('0xe')]['code']===0x1f4){logger[_0x902f('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3dae4d,_0x31fa71[_0x902f('0xe')][_0x902f('0xf')]);return _0x429e20(_0x31fa71[_0x902f('0xe')][_0x902f('0xf')]);}logger[_0x902f('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3dae4d,_0x31fa71[_0x902f('0xe')]['message']);return _0x1989c8(_0x31fa71[_0x902f('0xe')][_0x902f('0xf')]);}else{logger['info'](_0x902f('0x10'),_0x3dae4d,_0x902f('0xa'));_0x1989c8(_0x31fa71[_0x902f('0x11')]['message']);}})[_0x902f('0x12')](function(_0x1c59b0){logger['error'](_0x902f('0x10'),_0x3dae4d,_0x1c59b0);_0x429e20(_0x1c59b0);});});} \ No newline at end of file +var _0x99f7=['message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x16cb98,_0x4ac78f){var _0x19372a=function(_0x48d3b9){while(--_0x48d3b9){_0x16cb98['push'](_0x16cb98['shift']());}};_0x19372a(++_0x4ac78f);}(_0x99f7,0x94));var _0x799f=function(_0x4d555f,_0x14f6af){_0x4d555f=_0x4d555f-0x0;var _0x73c5db=_0x99f7[_0x4d555f];return _0x73c5db;};'use strict';var _=require(_0x799f('0x0'));var util=require(_0x799f('0x1'));var moment=require('moment');var BPromise=require(_0x799f('0x2'));var rs=require(_0x799f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x799f('0x4'));var logger=require(_0x799f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x799f('0x6'));var client=jayson[_0x799f('0x7')][_0x799f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x182fa2,_0x4ccb28,_0x429eec){return new BPromise(function(_0x135870,_0x24f585){return client['request'](_0x182fa2,_0x429eec)['then'](function(_0x1248dc){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ccb28,_0x799f('0x9'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4ccb28,_0x799f('0x9'),JSON[_0x799f('0xa')](_0x1248dc));if(_0x1248dc[_0x799f('0xb')]){if(_0x1248dc[_0x799f('0xb')][_0x799f('0xc')]===0x1f4){logger[_0x799f('0xb')](_0x799f('0xd'),_0x4ccb28,_0x1248dc[_0x799f('0xb')]['message']);return _0x24f585(_0x1248dc['error'][_0x799f('0xe')]);}logger[_0x799f('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ccb28,_0x1248dc[_0x799f('0xb')][_0x799f('0xe')]);return _0x135870(_0x1248dc[_0x799f('0xb')][_0x799f('0xe')]);}else{logger[_0x799f('0xf')](_0x799f('0xd'),_0x4ccb28,'request\x20sent');_0x135870(_0x1248dc[_0x799f('0x10')][_0x799f('0xe')]);}})[_0x799f('0x11')](function(_0x31c43a){logger[_0x799f('0xb')](_0x799f('0xd'),_0x4ccb28,_0x31c43a);_0x24f585(_0x31c43a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a9d135b..5edf147 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 _0x147b=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','update'];(function(_0x48bab5,_0x164159){var _0x3a3442=function(_0x4d796a){while(--_0x4d796a){_0x48bab5['push'](_0x48bab5['shift']());}};_0x3a3442(++_0x164159);}(_0x147b,0x193));var _0xb147=function(_0x2a56ce,_0x448f12){_0x2a56ce=_0x2a56ce-0x0;var _0x1f9977=_0x147b[_0x2a56ce];return _0x1f9977;};'use strict';var multer=require(_0xb147('0x0'));var util=require(_0xb147('0x1'));var path=require('path');var timeout=require(_0xb147('0x2'));var express=require(_0xb147('0x3'));var router=express['Router']();var fs_extra=require(_0xb147('0x4'));var auth=require(_0xb147('0x5'));var interaction=require(_0xb147('0x6'));var config=require('../../config/environment');var controller=require(_0xb147('0x7'));router['get']('/',auth[_0xb147('0x8')](),controller[_0xb147('0x9')]);router[_0xb147('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb147('0xb')]);router[_0xb147('0xa')](_0xb147('0xc'),auth[_0xb147('0x8')](),controller[_0xb147('0xd')]);router[_0xb147('0xa')](_0xb147('0xe'),auth[_0xb147('0x8')](),controller['run']);router['get'](_0xb147('0xf'),auth[_0xb147('0x8')](),controller[_0xb147('0x10')]);router[_0xb147('0x11')]('/',auth[_0xb147('0x8')](),controller[_0xb147('0x12')]);router[_0xb147('0x13')](_0xb147('0x14'),auth[_0xb147('0x8')](),controller[_0xb147('0x15')]);router[_0xb147('0x16')]('/:id',auth[_0xb147('0x8')](),controller[_0xb147('0x17')]);module[_0xb147('0x18')]=router; \ No newline at end of file +var _0x5e8f=['fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','post','put','delete','destroy','multer','util','path'];(function(_0x5e2f58,_0x217c92){var _0x3bfae4=function(_0x2d916a){while(--_0x2d916a){_0x5e2f58['push'](_0x5e2f58['shift']());}};_0x3bfae4(++_0x217c92);}(_0x5e8f,0x179));var _0xf5e8=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x5e8f[_0x562faf];return _0x22c1f6;};'use strict';var multer=require(_0xf5e8('0x0'));var util=require(_0xf5e8('0x1'));var path=require(_0xf5e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf5e8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf5e8('0x4'));var config=require(_0xf5e8('0x5'));var controller=require(_0xf5e8('0x6'));router[_0xf5e8('0x7')]('/',auth[_0xf5e8('0x8')](),controller[_0xf5e8('0x9')]);router['get'](_0xf5e8('0xa'),auth[_0xf5e8('0x8')](),controller[_0xf5e8('0xb')]);router[_0xf5e8('0x7')](_0xf5e8('0xc'),auth[_0xf5e8('0x8')](),controller[_0xf5e8('0xd')]);router[_0xf5e8('0x7')]('/:id/run',auth[_0xf5e8('0x8')](),controller[_0xf5e8('0xe')]);router[_0xf5e8('0x7')]('/:id/query',auth[_0xf5e8('0x8')](),controller['query']);router[_0xf5e8('0xf')]('/',auth[_0xf5e8('0x8')](),controller['create']);router[_0xf5e8('0x10')](_0xf5e8('0xa'),auth[_0xf5e8('0x8')](),controller['update']);router[_0xf5e8('0x11')](_0xf5e8('0xa'),auth[_0xf5e8('0x8')](),controller[_0xf5e8('0x12')]);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 e0dba88..0da5201 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 _0x0c2e=['scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx','csv','DATE','manual'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0c2e,0x1bf));var _0xe0c2=function(_0x55b021,_0x275042){_0x55b021=_0x55b021-0x0;var _0x145e5c=_0x0c2e[_0x55b021];return _0x145e5c;};'use strict';var Sequelize=require(_0xe0c2('0x0'));var moment=require('moment');module[_0xe0c2('0x1')]={'name':{'type':Sequelize[_0xe0c2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe0c2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xe0c2('0x3')]('csv',_0xe0c2('0x4'),_0xe0c2('0x5')),'allowNull':![],'defaultValue':_0xe0c2('0x6')},'savename':{'type':Sequelize[_0xe0c2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe0c2('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xe0c2('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0xe0c2('0x8'),_0xe0c2('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe0c2('0xa')](0xb)[_0xe0c2('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9820=['ENUM','csv','pdf','xlsx','DATE','scheduled','manual','sequelize','exports','STRING'];(function(_0xdd5c6c,_0x1f58d8){var _0xd6d10b=function(_0x2ca3ac){while(--_0x2ca3ac){_0xdd5c6c['push'](_0xdd5c6c['shift']());}};_0xd6d10b(++_0x1f58d8);}(_0x9820,0x18d));var _0x0982=function(_0x38c199,_0x2b9db2){_0x38c199=_0x38c199-0x0;var _0x354416=_0x9820[_0x38c199];return _0x354416;};'use strict';var Sequelize=require(_0x0982('0x0'));var moment=require('moment');module[_0x0982('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0982('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0982('0x3')](_0x0982('0x4'),_0x0982('0x5'),_0x0982('0x6')),'allowNull':![],'defaultValue':_0x0982('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x0982('0x7')]},'endDate':{'type':Sequelize[_0x0982('0x7')]},'status':{'type':Sequelize[_0x0982('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x0982('0x3')]('manual',_0x0982('0x8')),'allowNull':![],'defaultValue':_0x0982('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x0982('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 1a20caf..98cce9d 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 _0xfb16=['Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','ExtractedReports','UserProfileResource','error','name','index','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','include','rows','catch','show','params','rawAttributes','keys','length','includeAll','find','create','body','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','root','server/files/reports'];(function(_0x5e4a61,_0x403c59){var _0x1374aa=function(_0x4e0911){while(--_0x4e0911){_0x5e4a61['push'](_0x5e4a61['shift']());}};_0x1374aa(++_0x403c59);}(_0xfb16,0x182));var _0x6fb1=function(_0x5eac49,_0x12f821){_0x5eac49=_0x5eac49-0x0;var _0x2bd68f=_0xfb16[_0x5eac49];return _0x2bd68f;};'use strict';var emlformat=require(_0x6fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fb1('0x1'));var jsonpatch=require(_0x6fb1('0x2'));var rp=require(_0x6fb1('0x3'));var moment=require(_0x6fb1('0x4'));var BPromise=require(_0x6fb1('0x5'));var Mustache=require(_0x6fb1('0x6'));var util=require(_0x6fb1('0x7'));var path=require(_0x6fb1('0x8'));var sox=require(_0x6fb1('0x9'));var csv=require(_0x6fb1('0xa'));var ejs=require(_0x6fb1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6fb1('0xc'));var jsforce=require(_0x6fb1('0xd'));var deskjs=require(_0x6fb1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6fb1('0xf'));var Papa=require(_0x6fb1('0x10'));var Redis=require(_0x6fb1('0x11'));var authService=require(_0x6fb1('0x12'));var qs=require(_0x6fb1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fb1('0x14'));var logger=require(_0x6fb1('0x15'))(_0x6fb1('0x16'));var utils=require(_0x6fb1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6fb1('0x18'));var db=require(_0x6fb1('0x19'))['db'];function respondWithStatusCode(_0x42b5a0,_0x229ba7){_0x229ba7=_0x229ba7||0xcc;return function(_0x5318d9){if(_0x5318d9){return _0x42b5a0[_0x6fb1('0x1a')](_0x229ba7);}return _0x42b5a0[_0x6fb1('0x1b')](_0x229ba7)[_0x6fb1('0x1c')]();};}function respondWithResult(_0x555d89,_0x28ee1d){_0x28ee1d=_0x28ee1d||0xc8;return function(_0x36b34e){if(_0x36b34e){return _0x555d89['status'](_0x28ee1d)['json'](_0x36b34e);}};}function respondWithFilteredResult(_0xc683d4,_0x5b0e5e){return function(_0x260e0d){if(_0x260e0d){var _0x27077d=typeof _0x5b0e5e[_0x6fb1('0x1d')]===_0x6fb1('0x1e')&&typeof _0x5b0e5e[_0x6fb1('0x1f')]===_0x6fb1('0x1e');var _0x1a92ae=_0x260e0d['count'];var _0x341baf=_0x27077d?0x0:_0x5b0e5e['offset'];var _0x790a69=_0x27077d?_0x260e0d[_0x6fb1('0x20')]:_0x5b0e5e[_0x6fb1('0x1d')]+_0x5b0e5e[_0x6fb1('0x1f')];var _0x34c960;if(_0x790a69>=_0x1a92ae){_0x790a69=_0x1a92ae;_0x34c960=0xc8;}else{_0x34c960=0xce;}_0xc683d4[_0x6fb1('0x1b')](_0x34c960);return _0xc683d4[_0x6fb1('0x21')](_0x6fb1('0x22'),_0x341baf+'-'+_0x790a69+'/'+_0x1a92ae)['json'](_0x260e0d);}return null;};}function patchUpdates(_0x1ff0c3){return function(_0x673204){try{jsonpatch[_0x6fb1('0x23')](_0x673204,_0x1ff0c3,!![]);}catch(_0x49bc07){return BPromise[_0x6fb1('0x24')](_0x49bc07);}return _0x673204['save']();};}function saveUpdates(_0xe3835a,_0x184dca){return function(_0xdd581d){if(_0xdd581d){return _0xdd581d[_0x6fb1('0x25')](_0xe3835a)['then'](function(_0x4f8053){return _0x4f8053;});}return null;};}function removeEntity(_0xb52e37,_0x314f3c){return function(_0x2e3dae){if(_0x2e3dae){return _0x2e3dae[_0x6fb1('0x26')]()[_0x6fb1('0x27')](function(){var _0x327e25=_0x2e3dae['get']({'plain':!![]});var _0x4ddf93=_0x6fb1('0x28');return db[_0x6fb1('0x29')][_0x6fb1('0x26')]({'where':{'type':_0x4ddf93,'resourceId':_0x327e25['id']}})['then'](function(){return _0x2e3dae;});})['then'](function(){_0xb52e37[_0x6fb1('0x1b')](0xcc)[_0x6fb1('0x1c')]();});}};}function handleEntityNotFound(_0x578238,_0xb3c210){return function(_0x474b9a){if(!_0x474b9a){_0x578238[_0x6fb1('0x1a')](0x194);}return _0x474b9a;};}function handleError(_0x150fbe,_0x7c7152){_0x7c7152=_0x7c7152||0x1f4;return function(_0x509f84){logger[_0x6fb1('0x2a')](_0x509f84['stack']);if(_0x509f84[_0x6fb1('0x2b')]){delete _0x509f84['name'];}_0x150fbe[_0x6fb1('0x1b')](_0x7c7152)['send'](_0x509f84);};}exports[_0x6fb1('0x2c')]=function(_0x3917f4,_0x381920){var _0x2b6644={},_0x1fcc26={},_0x265ef3={'count':0x0,'rows':[]};var _0x19305d=_['map'](db['AnalyticExtractedReport']['rawAttributes'],function(_0x5f15d2){return{'name':_0x5f15d2['fieldName'],'type':_0x5f15d2[_0x6fb1('0x2d')][_0x6fb1('0x2e')]};});_0x1fcc26[_0x6fb1('0x2f')]=_[_0x6fb1('0x30')](_0x19305d,_0x6fb1('0x2b'));_0x1fcc26[_0x6fb1('0x31')]=_['keys'](_0x3917f4[_0x6fb1('0x31')]);_0x1fcc26[_0x6fb1('0x32')]=_[_0x6fb1('0x33')](_0x1fcc26[_0x6fb1('0x2f')],_0x1fcc26[_0x6fb1('0x31')]);_0x2b6644[_0x6fb1('0x34')]=_[_0x6fb1('0x33')](_0x1fcc26['model'],qs[_0x6fb1('0x35')](_0x3917f4[_0x6fb1('0x31')]['fields']));_0x2b6644['attributes']=_0x2b6644[_0x6fb1('0x34')]['length']?_0x2b6644['attributes']:_0x1fcc26[_0x6fb1('0x2f')];if(!_0x3917f4[_0x6fb1('0x31')][_0x6fb1('0x36')](_0x6fb1('0x37'))){_0x2b6644[_0x6fb1('0x1f')]=qs[_0x6fb1('0x1f')](_0x3917f4[_0x6fb1('0x31')][_0x6fb1('0x1f')]);_0x2b6644[_0x6fb1('0x1d')]=qs[_0x6fb1('0x1d')](_0x3917f4[_0x6fb1('0x31')][_0x6fb1('0x1d')]);}_0x2b6644[_0x6fb1('0x38')]=qs[_0x6fb1('0x39')](_0x3917f4[_0x6fb1('0x31')][_0x6fb1('0x39')]);_0x2b6644[_0x6fb1('0x3a')]=qs[_0x6fb1('0x32')](_[_0x6fb1('0x3b')](_0x3917f4[_0x6fb1('0x31')],_0x1fcc26[_0x6fb1('0x32')]),_0x19305d);if(_0x3917f4[_0x6fb1('0x31')][_0x6fb1('0x3c')]){_0x2b6644['where']=_[_0x6fb1('0x3d')](_0x2b6644[_0x6fb1('0x3a')],{'$or':_[_0x6fb1('0x30')](_0x19305d,function(_0x4233fc){if(_0x4233fc[_0x6fb1('0x2d')]!==_0x6fb1('0x3e')){var _0x153c9a={};_0x153c9a[_0x4233fc['name']]={'$like':'%'+_0x3917f4[_0x6fb1('0x31')][_0x6fb1('0x3c')]+'%'};return _0x153c9a;}})});}_0x2b6644=_[_0x6fb1('0x3d')]({},_0x2b6644,_0x3917f4[_0x6fb1('0x3f')]);var _0x49368c={'where':_0x2b6644[_0x6fb1('0x3a')]};return db[_0x6fb1('0x40')][_0x6fb1('0x20')](_0x49368c)[_0x6fb1('0x27')](function(_0x77ad06){_0x265ef3[_0x6fb1('0x20')]=_0x77ad06;if(_0x3917f4['query']['includeAll']){_0x2b6644[_0x6fb1('0x41')]=[{'all':!![]}];}return db[_0x6fb1('0x40')]['findAll'](_0x2b6644);})[_0x6fb1('0x27')](function(_0x31af16){_0x265ef3[_0x6fb1('0x42')]=_0x31af16;return _0x265ef3;})['then'](respondWithFilteredResult(_0x381920,_0x2b6644))[_0x6fb1('0x43')](handleError(_0x381920,null));};exports[_0x6fb1('0x44')]=function(_0x68adfe,_0x35fd4e){var _0x5b34c8={'raw':!![],'where':{'id':_0x68adfe[_0x6fb1('0x45')]['id']}},_0x20aa1b={};_0x20aa1b[_0x6fb1('0x2f')]=_['keys'](db[_0x6fb1('0x40')][_0x6fb1('0x46')]);_0x20aa1b[_0x6fb1('0x31')]=_[_0x6fb1('0x47')](_0x68adfe[_0x6fb1('0x31')]);_0x20aa1b['filters']=_['intersection'](_0x20aa1b[_0x6fb1('0x2f')],_0x20aa1b[_0x6fb1('0x31')]);_0x5b34c8['attributes']=_[_0x6fb1('0x33')](_0x20aa1b[_0x6fb1('0x2f')],qs['fields'](_0x68adfe['query'][_0x6fb1('0x35')]));_0x5b34c8[_0x6fb1('0x34')]=_0x5b34c8[_0x6fb1('0x34')][_0x6fb1('0x48')]?_0x5b34c8[_0x6fb1('0x34')]:_0x20aa1b[_0x6fb1('0x2f')];if(_0x68adfe[_0x6fb1('0x31')][_0x6fb1('0x49')]){_0x5b34c8[_0x6fb1('0x41')]=[{'all':!![]}];}_0x5b34c8=_[_0x6fb1('0x3d')]({},_0x5b34c8,_0x68adfe[_0x6fb1('0x3f')]);return db[_0x6fb1('0x40')][_0x6fb1('0x4a')](_0x5b34c8)[_0x6fb1('0x27')](handleEntityNotFound(_0x35fd4e,null))['then'](respondWithResult(_0x35fd4e,null))[_0x6fb1('0x43')](handleError(_0x35fd4e,null));};exports[_0x6fb1('0x4b')]=function(_0x2a9b66,_0x1a3517){return db['AnalyticExtractedReport'][_0x6fb1('0x4b')](_0x2a9b66[_0x6fb1('0x4c')],{})[_0x6fb1('0x27')](function(_0x1bc8d5){var _0x13b065=_0x2a9b66[_0x6fb1('0x4d')][_0x6fb1('0x4e')]({'plain':!![]});if(!_0x13b065)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13b065[_0x6fb1('0x4f')]==='user'){var _0x41e710=_0x1bc8d5[_0x6fb1('0x4e')]({'plain':!![]});var _0x453555='ExtractedReports';return db[_0x6fb1('0x50')]['find']({'where':{'name':_0x453555,'userProfileId':_0x13b065['userProfileId']},'raw':!![]})['then'](function(_0x333654){if(_0x333654&&_0x333654['autoAssociation']===0x0){return db[_0x6fb1('0x29')][_0x6fb1('0x4b')]({'name':_0x41e710[_0x6fb1('0x2b')],'resourceId':_0x41e710['id'],'type':_0x333654[_0x6fb1('0x2b')],'sectionId':_0x333654['id']},{})['then'](function(){return _0x1bc8d5;});}else{return _0x1bc8d5;}})[_0x6fb1('0x43')](function(_0x517e9a){logger[_0x6fb1('0x2a')](_0x6fb1('0x51'),_0x517e9a);throw _0x517e9a;});}return _0x1bc8d5;})[_0x6fb1('0x27')](respondWithResult(_0x1a3517,0xc9))['catch'](handleError(_0x1a3517,null));};exports[_0x6fb1('0x25')]=function(_0x3cb3e6,_0x5636e7){if(_0x3cb3e6[_0x6fb1('0x4c')]['id']){delete _0x3cb3e6[_0x6fb1('0x4c')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3cb3e6[_0x6fb1('0x45')]['id']}})['then'](handleEntityNotFound(_0x5636e7,null))[_0x6fb1('0x27')](saveUpdates(_0x3cb3e6[_0x6fb1('0x4c')],null))[_0x6fb1('0x27')](respondWithResult(_0x5636e7,null))[_0x6fb1('0x43')](handleError(_0x5636e7,null));};exports[_0x6fb1('0x26')]=function(_0x31fcf1,_0x14c1e1){return db['AnalyticExtractedReport'][_0x6fb1('0x4a')]({'where':{'id':_0x31fcf1[_0x6fb1('0x45')]['id']}})[_0x6fb1('0x27')](handleEntityNotFound(_0x14c1e1,null))[_0x6fb1('0x27')](removeEntity(_0x14c1e1,null))[_0x6fb1('0x43')](handleError(_0x14c1e1,null));};exports[_0x6fb1('0x52')]=function(_0x24cb00,_0x2b43dd,_0x1078a9){return db[_0x6fb1('0x40')][_0x6fb1('0x4a')]({'where':{'id':_0x24cb00[_0x6fb1('0x45')]['id']},'attributes':[_0x6fb1('0x2b'),_0x6fb1('0x53'),_0x6fb1('0x54'),_0x6fb1('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x2b43dd,null))[_0x6fb1('0x27')](function(_0x5d7262){if(_0x5d7262){if(!fs[_0x6fb1('0x56')](path['join'](config[_0x6fb1('0x57')],_0x6fb1('0x58'),_0x5d7262[_0x6fb1('0x54')]))){throw new db[(_0x6fb1('0x59'))][(_0x6fb1('0x5a'))](_0x6fb1('0x5b'));}if(_0x24cb00[_0x6fb1('0x31')][_0x6fb1('0x5c')]){return _0x2b43dd['sendStatus'](0xc8);}return _0x2b43dd[_0x6fb1('0x52')](path['join'](config[_0x6fb1('0x57')],_0x6fb1('0x58'),_0x5d7262['savename']),util['format'](_0x6fb1('0x5d'),_0x5d7262['basename']||_0x5d7262[_0x6fb1('0x2b')],_0x5d7262[_0x6fb1('0x55')][_0x6fb1('0x5e')]()));}})[_0x6fb1('0x43')](handleError(_0x2b43dd,null));}; \ No newline at end of file +var _0xd2ad=['then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','savename','output','existsSync','join','server/files/reports','ValidationError','exists','root','format','%s.%s','basename','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update'];(function(_0x315ef2,_0x4ca8a3){var _0x23eec8=function(_0x269f4b){while(--_0x269f4b){_0x315ef2['push'](_0x315ef2['shift']());}};_0x23eec8(++_0x4ca8a3);}(_0xd2ad,0x19c));var _0xdd2a=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0xd2ad[_0x5c14f6];return _0x4949b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdd2a('0x0'));var BPromise=require(_0xdd2a('0x1'));var Mustache=require('mustache');var util=require(_0xdd2a('0x2'));var path=require(_0xdd2a('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd2a('0x4'));var fs=require('fs');var fs_extra=require(_0xdd2a('0x5'));var _=require(_0xdd2a('0x6'));var squel=require(_0xdd2a('0x7'));var crypto=require(_0xdd2a('0x8'));var jsforce=require(_0xdd2a('0x9'));var deskjs=require(_0xdd2a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xdd2a('0xb'));var Papa=require(_0xdd2a('0xc'));var Redis=require(_0xdd2a('0xd'));var authService=require(_0xdd2a('0xe'));var qs=require(_0xdd2a('0xf'));var as=require(_0xdd2a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdd2a('0x11'));var utils=require('../../config/utils');var config=require(_0xdd2a('0x12'));var licenseUtil=require(_0xdd2a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a3aa4,_0x1924a1){_0x1924a1=_0x1924a1||0xcc;return function(_0xc540ed){if(_0xc540ed){return _0x3a3aa4[_0xdd2a('0x14')](_0x1924a1);}return _0x3a3aa4[_0xdd2a('0x15')](_0x1924a1)[_0xdd2a('0x16')]();};}function respondWithResult(_0x43649f,_0x2f972c){_0x2f972c=_0x2f972c||0xc8;return function(_0x41bdb6){if(_0x41bdb6){return _0x43649f['status'](_0x2f972c)['json'](_0x41bdb6);}};}function respondWithFilteredResult(_0x3b01a6,_0x117ec5){return function(_0x11d0e4){if(_0x11d0e4){var _0x44e7f1=typeof _0x117ec5[_0xdd2a('0x17')]==='undefined'&&typeof _0x117ec5[_0xdd2a('0x18')]===_0xdd2a('0x19');var _0x7520c4=_0x11d0e4[_0xdd2a('0x1a')];var _0x3583de=_0x44e7f1?0x0:_0x117ec5[_0xdd2a('0x17')];var _0x5d2dce=_0x44e7f1?_0x11d0e4[_0xdd2a('0x1a')]:_0x117ec5[_0xdd2a('0x17')]+_0x117ec5[_0xdd2a('0x18')];var _0x310251;if(_0x5d2dce>=_0x7520c4){_0x5d2dce=_0x7520c4;_0x310251=0xc8;}else{_0x310251=0xce;}_0x3b01a6[_0xdd2a('0x15')](_0x310251);return _0x3b01a6[_0xdd2a('0x1b')](_0xdd2a('0x1c'),_0x3583de+'-'+_0x5d2dce+'/'+_0x7520c4)[_0xdd2a('0x1d')](_0x11d0e4);}return null;};}function patchUpdates(_0x576fa1){return function(_0x15300d){try{jsonpatch[_0xdd2a('0x1e')](_0x15300d,_0x576fa1,!![]);}catch(_0x52e610){return BPromise[_0xdd2a('0x1f')](_0x52e610);}return _0x15300d['save']();};}function saveUpdates(_0x3810b3,_0x19d95d){return function(_0x1c4710){if(_0x1c4710){return _0x1c4710[_0xdd2a('0x20')](_0x3810b3)[_0xdd2a('0x21')](function(_0x5df39b){return _0x5df39b;});}return null;};}function removeEntity(_0x14122b,_0x33d6ec){return function(_0x257e92){if(_0x257e92){return _0x257e92[_0xdd2a('0x22')]()[_0xdd2a('0x21')](function(){var _0x458357=_0x257e92[_0xdd2a('0x23')]({'plain':!![]});var _0x20009d=_0xdd2a('0x24');return db[_0xdd2a('0x25')]['destroy']({'where':{'type':_0x20009d,'resourceId':_0x458357['id']}})[_0xdd2a('0x21')](function(){return _0x257e92;});})[_0xdd2a('0x21')](function(){_0x14122b[_0xdd2a('0x15')](0xcc)[_0xdd2a('0x16')]();});}};}function handleEntityNotFound(_0x19671c,_0x4732d9){return function(_0x29fde5){if(!_0x29fde5){_0x19671c[_0xdd2a('0x14')](0x194);}return _0x29fde5;};}function handleError(_0x670354,_0x1401a0){_0x1401a0=_0x1401a0||0x1f4;return function(_0x1458b6){logger[_0xdd2a('0x26')](_0x1458b6[_0xdd2a('0x27')]);if(_0x1458b6['name']){delete _0x1458b6[_0xdd2a('0x28')];}_0x670354[_0xdd2a('0x15')](_0x1401a0)['send'](_0x1458b6);};}exports[_0xdd2a('0x29')]=function(_0x1b5947,_0x5aea7c){var _0x1ef7b8={},_0x1c8970={},_0x46885c={'count':0x0,'rows':[]};var _0x30637c=_['map'](db[_0xdd2a('0x2a')][_0xdd2a('0x2b')],function(_0x5df7d6){return{'name':_0x5df7d6[_0xdd2a('0x2c')],'type':_0x5df7d6[_0xdd2a('0x2d')][_0xdd2a('0x2e')]};});_0x1c8970[_0xdd2a('0x2f')]=_[_0xdd2a('0x30')](_0x30637c,'name');_0x1c8970[_0xdd2a('0x31')]=_[_0xdd2a('0x32')](_0x1b5947[_0xdd2a('0x31')]);_0x1c8970[_0xdd2a('0x33')]=_[_0xdd2a('0x34')](_0x1c8970[_0xdd2a('0x2f')],_0x1c8970[_0xdd2a('0x31')]);_0x1ef7b8['attributes']=_['intersection'](_0x1c8970['model'],qs['fields'](_0x1b5947[_0xdd2a('0x31')][_0xdd2a('0x35')]));_0x1ef7b8[_0xdd2a('0x36')]=_0x1ef7b8[_0xdd2a('0x36')][_0xdd2a('0x37')]?_0x1ef7b8[_0xdd2a('0x36')]:_0x1c8970[_0xdd2a('0x2f')];if(!_0x1b5947['query'][_0xdd2a('0x38')](_0xdd2a('0x39'))){_0x1ef7b8[_0xdd2a('0x18')]=qs[_0xdd2a('0x18')](_0x1b5947[_0xdd2a('0x31')]['limit']);_0x1ef7b8[_0xdd2a('0x17')]=qs[_0xdd2a('0x17')](_0x1b5947['query'][_0xdd2a('0x17')]);}_0x1ef7b8['order']=qs['sort'](_0x1b5947[_0xdd2a('0x31')]['sort']);_0x1ef7b8[_0xdd2a('0x3a')]=qs[_0xdd2a('0x33')](_['pick'](_0x1b5947[_0xdd2a('0x31')],_0x1c8970[_0xdd2a('0x33')]),_0x30637c);if(_0x1b5947[_0xdd2a('0x31')]['filter']){_0x1ef7b8[_0xdd2a('0x3a')]=_['merge'](_0x1ef7b8['where'],{'$or':_[_0xdd2a('0x30')](_0x30637c,function(_0x130208){if(_0x130208[_0xdd2a('0x2d')]!==_0xdd2a('0x3b')){var _0x1c809a={};_0x1c809a[_0x130208[_0xdd2a('0x28')]]={'$like':'%'+_0x1b5947[_0xdd2a('0x31')]['filter']+'%'};return _0x1c809a;}})});}_0x1ef7b8=_[_0xdd2a('0x3c')]({},_0x1ef7b8,_0x1b5947[_0xdd2a('0x3d')]);var _0x3d745a={'where':_0x1ef7b8[_0xdd2a('0x3a')]};return db[_0xdd2a('0x2a')][_0xdd2a('0x1a')](_0x3d745a)[_0xdd2a('0x21')](function(_0x3d347b){_0x46885c[_0xdd2a('0x1a')]=_0x3d347b;if(_0x1b5947[_0xdd2a('0x31')]['includeAll']){_0x1ef7b8[_0xdd2a('0x3e')]=[{'all':!![]}];}return db[_0xdd2a('0x2a')][_0xdd2a('0x3f')](_0x1ef7b8);})[_0xdd2a('0x21')](function(_0x28704f){_0x46885c[_0xdd2a('0x40')]=_0x28704f;return _0x46885c;})[_0xdd2a('0x21')](respondWithFilteredResult(_0x5aea7c,_0x1ef7b8))['catch'](handleError(_0x5aea7c,null));};exports[_0xdd2a('0x41')]=function(_0x2d9705,_0x351b3d){var _0x4abd34={'raw':!![],'where':{'id':_0x2d9705[_0xdd2a('0x42')]['id']}},_0x5c76ef={};_0x5c76ef[_0xdd2a('0x2f')]=_['keys'](db[_0xdd2a('0x2a')][_0xdd2a('0x2b')]);_0x5c76ef[_0xdd2a('0x31')]=_[_0xdd2a('0x32')](_0x2d9705[_0xdd2a('0x31')]);_0x5c76ef[_0xdd2a('0x33')]=_[_0xdd2a('0x34')](_0x5c76ef[_0xdd2a('0x2f')],_0x5c76ef['query']);_0x4abd34[_0xdd2a('0x36')]=_[_0xdd2a('0x34')](_0x5c76ef[_0xdd2a('0x2f')],qs[_0xdd2a('0x35')](_0x2d9705[_0xdd2a('0x31')]['fields']));_0x4abd34[_0xdd2a('0x36')]=_0x4abd34[_0xdd2a('0x36')][_0xdd2a('0x37')]?_0x4abd34[_0xdd2a('0x36')]:_0x5c76ef[_0xdd2a('0x2f')];if(_0x2d9705[_0xdd2a('0x31')][_0xdd2a('0x43')]){_0x4abd34[_0xdd2a('0x3e')]=[{'all':!![]}];}_0x4abd34=_[_0xdd2a('0x3c')]({},_0x4abd34,_0x2d9705[_0xdd2a('0x3d')]);return db[_0xdd2a('0x2a')][_0xdd2a('0x44')](_0x4abd34)[_0xdd2a('0x21')](handleEntityNotFound(_0x351b3d,null))['then'](respondWithResult(_0x351b3d,null))[_0xdd2a('0x45')](handleError(_0x351b3d,null));};exports[_0xdd2a('0x46')]=function(_0x210fc8,_0x286330){return db['AnalyticExtractedReport'][_0xdd2a('0x46')](_0x210fc8['body'],{})[_0xdd2a('0x21')](function(_0x3ed79d){var _0x414bc7=_0x210fc8[_0xdd2a('0x47')]['get']({'plain':!![]});if(!_0x414bc7)throw new Error(_0xdd2a('0x48'));if(_0x414bc7[_0xdd2a('0x49')]===_0xdd2a('0x47')){var _0x2d4696=_0x3ed79d[_0xdd2a('0x23')]({'plain':!![]});var _0x1fa4fd=_0xdd2a('0x24');return db['UserProfileSection'][_0xdd2a('0x44')]({'where':{'name':_0x1fa4fd,'userProfileId':_0x414bc7[_0xdd2a('0x4a')]},'raw':!![]})[_0xdd2a('0x21')](function(_0x1a20e8){if(_0x1a20e8&&_0x1a20e8['autoAssociation']===0x0){return db[_0xdd2a('0x25')][_0xdd2a('0x46')]({'name':_0x2d4696[_0xdd2a('0x28')],'resourceId':_0x2d4696['id'],'type':_0x1a20e8[_0xdd2a('0x28')],'sectionId':_0x1a20e8['id']},{})[_0xdd2a('0x21')](function(){return _0x3ed79d;});}else{return _0x3ed79d;}})['catch'](function(_0x2a510e){logger['error'](_0xdd2a('0x4b'),_0x2a510e);throw _0x2a510e;});}return _0x3ed79d;})[_0xdd2a('0x21')](respondWithResult(_0x286330,0xc9))[_0xdd2a('0x45')](handleError(_0x286330,null));};exports[_0xdd2a('0x20')]=function(_0x2f0d03,_0x38af0c){if(_0x2f0d03[_0xdd2a('0x4c')]['id']){delete _0x2f0d03[_0xdd2a('0x4c')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2f0d03[_0xdd2a('0x42')]['id']}})['then'](handleEntityNotFound(_0x38af0c,null))['then'](saveUpdates(_0x2f0d03[_0xdd2a('0x4c')],null))[_0xdd2a('0x21')](respondWithResult(_0x38af0c,null))['catch'](handleError(_0x38af0c,null));};exports[_0xdd2a('0x22')]=function(_0x4e70cc,_0x406067){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4e70cc[_0xdd2a('0x42')]['id']}})[_0xdd2a('0x21')](handleEntityNotFound(_0x406067,null))['then'](removeEntity(_0x406067,null))['catch'](handleError(_0x406067,null));};exports[_0xdd2a('0x4d')]=function(_0x253168,_0x38e341,_0x4957ba){return db['AnalyticExtractedReport'][_0xdd2a('0x44')]({'where':{'id':_0x253168[_0xdd2a('0x42')]['id']},'attributes':[_0xdd2a('0x28'),'basename',_0xdd2a('0x4e'),_0xdd2a('0x4f')],'raw':!![]})[_0xdd2a('0x21')](handleEntityNotFound(_0x38e341,null))[_0xdd2a('0x21')](function(_0xf94209){if(_0xf94209){if(!fs[_0xdd2a('0x50')](path[_0xdd2a('0x51')](config['root'],_0xdd2a('0x52'),_0xf94209[_0xdd2a('0x4e')]))){throw new db['Sequelize'][(_0xdd2a('0x53'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x253168[_0xdd2a('0x31')][_0xdd2a('0x54')]){return _0x38e341[_0xdd2a('0x14')](0xc8);}return _0x38e341[_0xdd2a('0x4d')](path[_0xdd2a('0x51')](config[_0xdd2a('0x55')],_0xdd2a('0x52'),_0xf94209[_0xdd2a('0x4e')]),util[_0xdd2a('0x56')](_0xdd2a('0x57'),_0xf94209[_0xdd2a('0x58')]||_0xf94209['name'],_0xf94209[_0xdd2a('0x4f')]['toLowerCase']()));}})['catch'](handleError(_0x38e341,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 5edef2d..df13e7b 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 _0x28ef=['../../config/environment','exports','define','analytics_extracted_reports','lodash','util','bluebird','request-promise','path'];(function(_0x4043ce,_0x175dcc){var _0x191365=function(_0x361aa0){while(--_0x361aa0){_0x4043ce['push'](_0x4043ce['shift']());}};_0x191365(++_0x175dcc);}(_0x28ef,0x136));var _0xf28e=function(_0x2e7f05,_0x3642e7){_0x2e7f05=_0x2e7f05-0x0;var _0x5a5739=_0x28ef[_0x2e7f05];return _0x5a5739;};'use strict';var _=require(_0xf28e('0x0'));var util=require(_0xf28e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf28e('0x2'));var rp=require(_0xf28e('0x3'));var fs=require('fs');var path=require(_0xf28e('0x4'));var rimraf=require('rimraf');var config=require(_0xf28e('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf28e('0x6')]=function(_0xd3b801,_0x33dd18){return _0xd3b801[_0xf28e('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0xf28e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f05=['define','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x2922c2,_0x7f1b96){var _0x3f3279=function(_0x31b817){while(--_0x31b817){_0x2922c2['push'](_0x2922c2['shift']());}};_0x3f3279(++_0x7f1b96);}(_0x3f05,0x106));var _0x53f0=function(_0x1cdc3f,_0x310b3f){_0x1cdc3f=_0x1cdc3f-0x0;var _0x3ece4b=_0x3f05[_0x1cdc3f];return _0x3ece4b;};'use strict';var _=require(_0x53f0('0x0'));var util=require(_0x53f0('0x1'));var logger=require('../../config/logger')(_0x53f0('0x2'));var moment=require(_0x53f0('0x3'));var BPromise=require(_0x53f0('0x4'));var rp=require(_0x53f0('0x5'));var fs=require('fs');var path=require(_0x53f0('0x6'));var rimraf=require(_0x53f0('0x7'));var config=require(_0x53f0('0x8'));var attributes=require(_0x53f0('0x9'));module[_0x53f0('0xa')]=function(_0x2b378a,_0x4f8072){return _0x2b378a[_0x53f0('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x53f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 5c27935..5edfe27 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 _0x4a2f=['code','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4a2f,0x7d));var _0xf4a2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4a2f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xf4a2('0x0'));var util=require('util');var moment=require(_0xf4a2('0x1'));var BPromise=require(_0xf4a2('0x2'));var rs=require(_0xf4a2('0x3'));var fs=require('fs');var Redis=require(_0xf4a2('0x4'));var db=require(_0xf4a2('0x5'))['db'];var utils=require(_0xf4a2('0x6'));var logger=require(_0xf4a2('0x7'))(_0xf4a2('0x8'));var config=require(_0xf4a2('0x9'));var jayson=require(_0xf4a2('0xa'));var client=jayson[_0xf4a2('0xb')][_0xf4a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ebff2,_0xfef7bf,_0x286e43){return new BPromise(function(_0xaa8ea8,_0x260167){return client[_0xf4a2('0xd')](_0x2ebff2,_0x286e43)[_0xf4a2('0xe')](function(_0x4514bb){logger['info'](_0xf4a2('0xf'),_0xfef7bf,_0xf4a2('0x10'));logger[_0xf4a2('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xfef7bf,_0xf4a2('0x10'),JSON[_0xf4a2('0x12')](_0x4514bb));if(_0x4514bb['error']){if(_0x4514bb['error'][_0xf4a2('0x13')]===0x1f4){logger[_0xf4a2('0x14')](_0xf4a2('0xf'),_0xfef7bf,_0x4514bb[_0xf4a2('0x14')][_0xf4a2('0x15')]);return _0x260167(_0x4514bb['error']['message']);}logger[_0xf4a2('0x14')](_0xf4a2('0xf'),_0xfef7bf,_0x4514bb['error']['message']);return _0xaa8ea8(_0x4514bb[_0xf4a2('0x14')][_0xf4a2('0x15')]);}else{logger[_0xf4a2('0x16')](_0xf4a2('0xf'),_0xfef7bf,'request\x20sent');_0xaa8ea8(_0x4514bb['result'][_0xf4a2('0x15')]);}})[_0xf4a2('0x17')](function(_0x5d34ce){logger['error'](_0xf4a2('0xf'),_0xfef7bf,_0x5d34ce);_0x260167(_0x5d34ce);});});} \ No newline at end of file +var _0x9d1d=['AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x1265e4,_0x63d7ab){var _0x4ffc8c=function(_0x1b7ab3){while(--_0x1b7ab3){_0x1265e4['push'](_0x1265e4['shift']());}};_0x4ffc8c(++_0x63d7ab);}(_0x9d1d,0x118));var _0xd9d1=function(_0x2f7534,_0x17b853){_0x2f7534=_0x2f7534-0x0;var _0x2b1738=_0x9d1d[_0x2f7534];return _0x2b1738;};'use strict';var _=require(_0xd9d1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd9d1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd9d1('0x2'));var logger=require(_0xd9d1('0x3'))('rpc');var config=require(_0xd9d1('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd9d1('0x5')][_0xd9d1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5aa4fe,_0x3c84b3,_0x44f5e9){return new BPromise(function(_0x18dd92,_0x2e8f88){return client[_0xd9d1('0x7')](_0x5aa4fe,_0x44f5e9)[_0xd9d1('0x8')](function(_0x1ab0f0){logger['info'](_0xd9d1('0x9'),_0x3c84b3,'request\x20sent');logger[_0xd9d1('0xa')](_0xd9d1('0xb'),_0x3c84b3,_0xd9d1('0xc'),JSON[_0xd9d1('0xd')](_0x1ab0f0));if(_0x1ab0f0[_0xd9d1('0xe')]){if(_0x1ab0f0['error'][_0xd9d1('0xf')]===0x1f4){logger[_0xd9d1('0xe')](_0xd9d1('0x9'),_0x3c84b3,_0x1ab0f0[_0xd9d1('0xe')][_0xd9d1('0x10')]);return _0x2e8f88(_0x1ab0f0[_0xd9d1('0xe')][_0xd9d1('0x10')]);}logger[_0xd9d1('0xe')](_0xd9d1('0x9'),_0x3c84b3,_0x1ab0f0['error'][_0xd9d1('0x10')]);return _0x18dd92(_0x1ab0f0[_0xd9d1('0xe')][_0xd9d1('0x10')]);}else{logger['info'](_0xd9d1('0x9'),_0x3c84b3,_0xd9d1('0xc'));_0x18dd92(_0x1ab0f0['result'][_0xd9d1('0x10')]);}})['catch'](function(_0x15a694){logger['error'](_0xd9d1('0x9'),_0x3c84b3,_0x15a694);_0x2e8f88(_0x15a694);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e1c910f..9f725ee 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 _0x2741=['delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','show','/:id/download','isAuthenticated','post','create','update'];(function(_0x91a6b1,_0x45bf86){var _0x101dbe=function(_0x1ac221){while(--_0x1ac221){_0x91a6b1['push'](_0x91a6b1['shift']());}};_0x101dbe(++_0x45bf86);}(_0x2741,0x1d6));var _0x1274=function(_0x110fe3,_0x5c4ae0){_0x110fe3=_0x110fe3-0x0;var _0x3ea632=_0x2741[_0x110fe3];return _0x3ea632;};'use strict';var multer=require(_0x1274('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1274('0x1'));var express=require(_0x1274('0x2'));var router=express['Router']();var fs_extra=require(_0x1274('0x3'));var auth=require(_0x1274('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1274('0x5'));var controller=require(_0x1274('0x6'));router[_0x1274('0x7')]('/',auth['isAuthenticated'](),controller[_0x1274('0x8')]);router[_0x1274('0x7')](_0x1274('0x9'),auth['isAuthenticated'](),controller[_0x1274('0xa')]);router[_0x1274('0x7')](_0x1274('0xb'),auth[_0x1274('0xc')](),controller['download']);router[_0x1274('0xd')]('/',auth[_0x1274('0xc')](),controller[_0x1274('0xe')]);router['put'](_0x1274('0x9'),auth['isAuthenticated'](),controller[_0x1274('0xf')]);router[_0x1274('0x10')](_0x1274('0x9'),auth[_0x1274('0xc')](),controller['destroy']);module[_0x1274('0x11')]=router; \ No newline at end of file +var _0xcb83=['create','put','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','download','post'];(function(_0x59a448,_0x5a87d4){var _0x10288e=function(_0x3f250d){while(--_0x3f250d){_0x59a448['push'](_0x59a448['shift']());}};_0x10288e(++_0x5a87d4);}(_0xcb83,0x100));var _0x3cb8=function(_0x1db31f,_0x564d1f){_0x1db31f=_0x1db31f-0x0;var _0x2fbe25=_0xcb83[_0x1db31f];return _0x2fbe25;};'use strict';var multer=require('multer');var util=require(_0x3cb8('0x0'));var path=require(_0x3cb8('0x1'));var timeout=require('connect-timeout');var express=require(_0x3cb8('0x2'));var router=express[_0x3cb8('0x3')]();var fs_extra=require(_0x3cb8('0x4'));var auth=require(_0x3cb8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3cb8('0x6'));router['get']('/',auth[_0x3cb8('0x7')](),controller[_0x3cb8('0x8')]);router[_0x3cb8('0x9')](_0x3cb8('0xa'),auth[_0x3cb8('0x7')](),controller[_0x3cb8('0xb')]);router[_0x3cb8('0x9')]('/:id/download',auth[_0x3cb8('0x7')](),controller[_0x3cb8('0xc')]);router[_0x3cb8('0xd')]('/',auth[_0x3cb8('0x7')](),controller[_0x3cb8('0xe')]);router[_0x3cb8('0xf')]('/:id',auth[_0x3cb8('0x7')](),controller[_0x3cb8('0x10')]);router['delete'](_0x3cb8('0xa'),auth[_0x3cb8('0x7')](),controller[_0x3cb8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 8fe4353..00570bf 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 _0xd489=['TEXT','STRING','BOOLEAN','exports'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xd489,0x11f));var _0x9d48=function(_0x37c36c,_0x24de58){_0x37c36c=_0x37c36c-0x0;var _0x28d60f=_0xd489[_0x37c36c];return _0x28d60f;};'use strict';var Sequelize=require('sequelize');module[_0x9d48('0x0')]={'field':{'type':Sequelize[_0x9d48('0x1')]},'alias':{'type':Sequelize[_0x9d48('0x2')]},'function':{'type':Sequelize[_0x9d48('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9d48('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x9d48('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd51c=['sequelize','exports','TEXT','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd51c,0xa0));var _0xcd51=function(_0x211a02,_0x3b5362){_0x211a02=_0x211a02-0x0;var _0x13d91c=_0xd51c[_0x211a02];return _0x13d91c;};'use strict';var Sequelize=require(_0xcd51('0x0'));module[_0xcd51('0x1')]={'field':{'type':Sequelize[_0xcd51('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xcd51('0x3')]},'format':{'type':Sequelize[_0xcd51('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xcd51('0x3')]},'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 0a0551c..ece827a 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 _0x736a=['status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x535b11,_0x4e1aa3){var _0x201379=function(_0x1228fb){while(--_0x1228fb){_0x535b11['push'](_0x535b11['shift']());}};_0x201379(++_0x4e1aa3);}(_0x736a,0x123));var _0xa736=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x736a[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0xa736('0x0'));var rimraf=require(_0xa736('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa736('0x2'));var rp=require(_0xa736('0x3'));var moment=require('moment');var BPromise=require(_0xa736('0x4'));var Mustache=require(_0xa736('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa736('0x6'));var csv=require(_0xa736('0x7'));var ejs=require(_0xa736('0x8'));var fs=require('fs');var fs_extra=require(_0xa736('0x9'));var _=require(_0xa736('0xa'));var squel=require(_0xa736('0xb'));var crypto=require(_0xa736('0xc'));var jsforce=require(_0xa736('0xd'));var deskjs=require(_0xa736('0xe'));var toCsv=require(_0xa736('0x7'));var querystring=require('querystring');var Papa=require(_0xa736('0xf'));var Redis=require(_0xa736('0x10'));var authService=require(_0xa736('0x11'));var qs=require(_0xa736('0x12'));var as=require(_0xa736('0x13'));var hardwareService=require(_0xa736('0x14'));var logger=require('../../config/logger')(_0xa736('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa736('0x16'));var db=require(_0xa736('0x17'))['db'];function respondWithStatusCode(_0xe8c5d3,_0x45c0e0){_0x45c0e0=_0x45c0e0||0xcc;return function(_0x2c201e){if(_0x2c201e){return _0xe8c5d3[_0xa736('0x18')](_0x45c0e0);}return _0xe8c5d3[_0xa736('0x19')](_0x45c0e0)[_0xa736('0x1a')]();};}function respondWithResult(_0x4567e6,_0x571a2e){_0x571a2e=_0x571a2e||0xc8;return function(_0x1a5989){if(_0x1a5989){return _0x4567e6[_0xa736('0x19')](_0x571a2e)[_0xa736('0x1b')](_0x1a5989);}};}function respondWithFilteredResult(_0x6d6ede,_0xe3ce72){return function(_0x38d9eb){if(_0x38d9eb){var _0x24c860=typeof _0xe3ce72[_0xa736('0x1c')]==='undefined'&&typeof _0xe3ce72[_0xa736('0x1d')]===_0xa736('0x1e');var _0x184dfe=_0x38d9eb[_0xa736('0x1f')];var _0x2de995=_0x24c860?0x0:_0xe3ce72[_0xa736('0x1c')];var _0xa1ec78=_0x24c860?_0x38d9eb[_0xa736('0x1f')]:_0xe3ce72[_0xa736('0x1c')]+_0xe3ce72[_0xa736('0x1d')];var _0x243695;if(_0xa1ec78>=_0x184dfe){_0xa1ec78=_0x184dfe;_0x243695=0xc8;}else{_0x243695=0xce;}_0x6d6ede[_0xa736('0x19')](_0x243695);return _0x6d6ede[_0xa736('0x20')](_0xa736('0x21'),_0x2de995+'-'+_0xa1ec78+'/'+_0x184dfe)[_0xa736('0x1b')](_0x38d9eb);}return null;};}function patchUpdates(_0x37a124){return function(_0x221013){try{jsonpatch['apply'](_0x221013,_0x37a124,!![]);}catch(_0x356126){return BPromise[_0xa736('0x22')](_0x356126);}return _0x221013[_0xa736('0x23')]();};}function saveUpdates(_0x399ea1,_0xc57fef){return function(_0x1a9010){if(_0x1a9010){return _0x1a9010[_0xa736('0x24')](_0x399ea1)[_0xa736('0x25')](function(_0x358920){return _0x358920;});}return null;};}function removeEntity(_0x1bb096,_0x119b71){return function(_0x4d5ca2){if(_0x4d5ca2){return _0x4d5ca2[_0xa736('0x26')]()[_0xa736('0x25')](function(){_0x1bb096['status'](0xcc)[_0xa736('0x1a')]();});}};}function handleEntityNotFound(_0x50a9ab,_0x41b2a8){return function(_0xb555a3){if(!_0xb555a3){_0x50a9ab['sendStatus'](0x194);}return _0xb555a3;};}function handleError(_0x5aac5a,_0x1fa734){_0x1fa734=_0x1fa734||0x1f4;return function(_0x393aca){logger['error'](_0x393aca[_0xa736('0x27')]);if(_0x393aca[_0xa736('0x28')]){delete _0x393aca[_0xa736('0x28')];}_0x5aac5a['status'](_0x1fa734)['send'](_0x393aca);};}exports[_0xa736('0x29')]=function(_0x3ac443,_0x263d81){var _0x1fc9f5={},_0x31ec95={},_0x60911e={'count':0x0,'rows':[]};var _0x639bbb=_[_0xa736('0x2a')](db[_0xa736('0x2b')][_0xa736('0x2c')],function(_0x7b4e62){return{'name':_0x7b4e62['fieldName'],'type':_0x7b4e62['type'][_0xa736('0x2d')]};});_0x31ec95[_0xa736('0x2e')]=_[_0xa736('0x2a')](_0x639bbb,_0xa736('0x28'));_0x31ec95['query']=_[_0xa736('0x2f')](_0x3ac443['query']);_0x31ec95[_0xa736('0x30')]=_[_0xa736('0x31')](_0x31ec95[_0xa736('0x2e')],_0x31ec95[_0xa736('0x32')]);_0x1fc9f5['attributes']=_[_0xa736('0x31')](_0x31ec95[_0xa736('0x2e')],qs[_0xa736('0x33')](_0x3ac443[_0xa736('0x32')][_0xa736('0x33')]));_0x1fc9f5[_0xa736('0x34')]=_0x1fc9f5[_0xa736('0x34')][_0xa736('0x35')]?_0x1fc9f5[_0xa736('0x34')]:_0x31ec95[_0xa736('0x2e')];if(!_0x3ac443[_0xa736('0x32')]['hasOwnProperty'](_0xa736('0x36'))){_0x1fc9f5[_0xa736('0x1d')]=qs[_0xa736('0x1d')](_0x3ac443[_0xa736('0x32')][_0xa736('0x1d')]);_0x1fc9f5[_0xa736('0x1c')]=qs[_0xa736('0x1c')](_0x3ac443['query'][_0xa736('0x1c')]);}_0x1fc9f5[_0xa736('0x37')]=qs[_0xa736('0x38')](_0x3ac443['query'][_0xa736('0x38')]);_0x1fc9f5[_0xa736('0x39')]=qs['filters'](_['pick'](_0x3ac443[_0xa736('0x32')],_0x31ec95[_0xa736('0x30')]),_0x639bbb);if(_0x3ac443[_0xa736('0x32')][_0xa736('0x3a')]){_0x1fc9f5['where']=_[_0xa736('0x3b')](_0x1fc9f5[_0xa736('0x39')],{'$or':_[_0xa736('0x2a')](_0x639bbb,function(_0x3d7b44){if(_0x3d7b44[_0xa736('0x3c')]!==_0xa736('0x3d')){var _0x3366e2={};_0x3366e2[_0x3d7b44[_0xa736('0x28')]]={'$like':'%'+_0x3ac443[_0xa736('0x32')][_0xa736('0x3a')]+'%'};return _0x3366e2;}})});}_0x1fc9f5=_[_0xa736('0x3b')]({},_0x1fc9f5,_0x3ac443[_0xa736('0x3e')]);var _0x3a9694={'where':_0x1fc9f5[_0xa736('0x39')]};return db[_0xa736('0x2b')]['count'](_0x3a9694)[_0xa736('0x25')](function(_0x1f4db0){_0x60911e[_0xa736('0x1f')]=_0x1f4db0;if(_0x3ac443[_0xa736('0x32')][_0xa736('0x3f')]){_0x1fc9f5[_0xa736('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa736('0x41')](_0x1fc9f5);})[_0xa736('0x25')](function(_0x14455a){_0x60911e['rows']=_0x14455a;return _0x60911e;})[_0xa736('0x25')](respondWithFilteredResult(_0x263d81,_0x1fc9f5))[_0xa736('0x42')](handleError(_0x263d81,null));};exports[_0xa736('0x43')]=function(_0x444bf6,_0x2e8174){var _0x110d95={'raw':![],'where':{'id':_0x444bf6['params']['id']}},_0x5ca1ac={};_0x5ca1ac[_0xa736('0x2e')]=_[_0xa736('0x2f')](db[_0xa736('0x2b')][_0xa736('0x2c')]);_0x5ca1ac[_0xa736('0x32')]=_[_0xa736('0x2f')](_0x444bf6['query']);_0x5ca1ac['filters']=_['intersection'](_0x5ca1ac['model'],_0x5ca1ac[_0xa736('0x32')]);_0x110d95['attributes']=_[_0xa736('0x31')](_0x5ca1ac[_0xa736('0x2e')],qs[_0xa736('0x33')](_0x444bf6[_0xa736('0x32')][_0xa736('0x33')]));_0x110d95[_0xa736('0x34')]=_0x110d95[_0xa736('0x34')][_0xa736('0x35')]?_0x110d95['attributes']:_0x5ca1ac[_0xa736('0x2e')];if(_0x444bf6[_0xa736('0x32')][_0xa736('0x3f')]){_0x110d95[_0xa736('0x40')]=[{'all':!![]}];}_0x110d95=_['merge']({},_0x110d95,_0x444bf6[_0xa736('0x3e')]);return db[_0xa736('0x2b')][_0xa736('0x44')](_0x110d95)['then'](handleEntityNotFound(_0x2e8174,null))[_0xa736('0x25')](respondWithResult(_0x2e8174,null))[_0xa736('0x42')](handleError(_0x2e8174,null));};exports[_0xa736('0x45')]=function(_0x57b95f,_0x28b5d3){return db['AnalyticFieldReport']['create'](_0x57b95f[_0xa736('0x46')],{})['then'](respondWithResult(_0x28b5d3,0xc9))[_0xa736('0x42')](handleError(_0x28b5d3,null));};exports[_0xa736('0x47')]=function(_0x24ac88,_0xc3a565){return db[_0xa736('0x2b')][_0xa736('0x47')](_0x24ac88['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xc3a565,0xc9))[_0xa736('0x42')](handleError(_0xc3a565,null));};exports[_0xa736('0x24')]=function(_0x4aea1f,_0x167e90){if(_0x4aea1f['body']['id']){delete _0x4aea1f[_0xa736('0x46')]['id'];}return db['AnalyticFieldReport'][_0xa736('0x44')]({'where':{'id':_0x4aea1f[_0xa736('0x48')]['id']}})[_0xa736('0x25')](handleEntityNotFound(_0x167e90,null))['then'](saveUpdates(_0x4aea1f[_0xa736('0x46')],null))['then'](respondWithResult(_0x167e90,null))[_0xa736('0x42')](handleError(_0x167e90,null));};exports[_0xa736('0x26')]=function(_0x1eb022,_0x18f322){return db[_0xa736('0x2b')][_0xa736('0x44')]({'where':{'id':_0x1eb022[_0xa736('0x48')]['id']}})[_0xa736('0x25')](handleEntityNotFound(_0x18f322,null))[_0xa736('0x25')](removeEntity(_0x18f322,null))[_0xa736('0x42')](handleError(_0x18f322,null));};exports[_0xa736('0x49')]=function(_0x46c79a,_0x3c33c9){return db[_0xa736('0x2b')]['destroy']({'where':{'id':_0x46c79a[_0xa736('0x32')][_0xa736('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3c33c9,0xcc))[_0xa736('0x42')](handleError(_0x3c33c9,null));};exports[_0xa736('0x4b')]=function(_0x1fa9bc,_0x2e7dae,_0x4c9d09){return db['AnalyticCustomReport'][_0xa736('0x4c')]({'where':{'id':_0x1fa9bc[_0xa736('0x48')]['id']}})[_0xa736('0x25')](handleEntityNotFound(_0x2e7dae,null))[_0xa736('0x25')](function(_0x55c67a){if(_0x55c67a){return db['sequelize'][_0xa736('0x4d')](function(_0x8d66e4){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x1fa9bc[_0xa736('0x48')]['id']},'transaction':_0x8d66e4})[_0xa736('0x25')](function(_0x172a2b){var _0x3e0558=_['map'](_0x1fa9bc['body'],function(_0x109300){delete _0x109300['id'];_0x109300[_0xa736('0x4e')]=_0x1fa9bc[_0xa736('0x48')]['id'];return _0x109300;});return db[_0xa736('0x2b')][_0xa736('0x47')](_0x3e0558,{'transaction':_0x8d66e4});});})['then'](function(){return db[_0xa736('0x2b')][_0xa736('0x41')]({'where':{'CustomReportId':_0x1fa9bc['params']['id']}});});}})[_0xa736('0x25')](respondWithResult(_0x2e7dae,null))[_0xa736('0x42')](handleError(_0x2e7dae,null));}; \ No newline at end of file +var _0xd5f0=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','includeAll','find','create','body','catch','bulkCreate','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service'];(function(_0x4f9e31,_0x19881c){var _0x2f9fc7=function(_0x318c57){while(--_0x318c57){_0x4f9e31['push'](_0x4f9e31['shift']());}};_0x2f9fc7(++_0x19881c);}(_0xd5f0,0x1bd));var _0x0d5f=function(_0x4d1aba,_0x2f0e4a){_0x4d1aba=_0x4d1aba-0x0;var _0x46b53b=_0xd5f0[_0x4d1aba];return _0x46b53b;};'use strict';var emlformat=require(_0x0d5f('0x0'));var rimraf=require(_0x0d5f('0x1'));var zipdir=require(_0x0d5f('0x2'));var jsonpatch=require(_0x0d5f('0x3'));var rp=require(_0x0d5f('0x4'));var moment=require(_0x0d5f('0x5'));var BPromise=require(_0x0d5f('0x6'));var Mustache=require(_0x0d5f('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0d5f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d5f('0x9'));var _=require(_0x0d5f('0xa'));var squel=require(_0x0d5f('0xb'));var crypto=require('crypto');var jsforce=require(_0x0d5f('0xc'));var deskjs=require(_0x0d5f('0xd'));var toCsv=require(_0x0d5f('0xe'));var querystring=require('querystring');var Papa=require(_0x0d5f('0xf'));var Redis=require('ioredis');var authService=require(_0x0d5f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d5f('0x11'));var logger=require(_0x0d5f('0x12'))(_0x0d5f('0x13'));var utils=require(_0x0d5f('0x14'));var config=require(_0x0d5f('0x15'));var licenseUtil=require(_0x0d5f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x69fc28,_0x3ae624){_0x3ae624=_0x3ae624||0xcc;return function(_0xdc49bb){if(_0xdc49bb){return _0x69fc28[_0x0d5f('0x17')](_0x3ae624);}return _0x69fc28[_0x0d5f('0x18')](_0x3ae624)[_0x0d5f('0x19')]();};}function respondWithResult(_0x3c56b1,_0xf90305){_0xf90305=_0xf90305||0xc8;return function(_0x567b99){if(_0x567b99){return _0x3c56b1[_0x0d5f('0x18')](_0xf90305)[_0x0d5f('0x1a')](_0x567b99);}};}function respondWithFilteredResult(_0x53b71c,_0x27138b){return function(_0xf98e53){if(_0xf98e53){var _0x6c76f8=typeof _0x27138b[_0x0d5f('0x1b')]==='undefined'&&typeof _0x27138b['limit']===_0x0d5f('0x1c');var _0x3c3175=_0xf98e53[_0x0d5f('0x1d')];var _0x217983=_0x6c76f8?0x0:_0x27138b['offset'];var _0x1fdf27=_0x6c76f8?_0xf98e53[_0x0d5f('0x1d')]:_0x27138b[_0x0d5f('0x1b')]+_0x27138b['limit'];var _0x48be00;if(_0x1fdf27>=_0x3c3175){_0x1fdf27=_0x3c3175;_0x48be00=0xc8;}else{_0x48be00=0xce;}_0x53b71c[_0x0d5f('0x18')](_0x48be00);return _0x53b71c['set']('Content-Range',_0x217983+'-'+_0x1fdf27+'/'+_0x3c3175)[_0x0d5f('0x1a')](_0xf98e53);}return null;};}function patchUpdates(_0x399b6a){return function(_0x5dd908){try{jsonpatch[_0x0d5f('0x1e')](_0x5dd908,_0x399b6a,!![]);}catch(_0x30f62c){return BPromise['reject'](_0x30f62c);}return _0x5dd908['save']();};}function saveUpdates(_0x2c24bb,_0x5d6751){return function(_0x10d73d){if(_0x10d73d){return _0x10d73d[_0x0d5f('0x1f')](_0x2c24bb)[_0x0d5f('0x20')](function(_0x571fb4){return _0x571fb4;});}return null;};}function removeEntity(_0x3bd7f8,_0x4d6b97){return function(_0x5a338a){if(_0x5a338a){return _0x5a338a[_0x0d5f('0x21')]()[_0x0d5f('0x20')](function(){_0x3bd7f8[_0x0d5f('0x18')](0xcc)[_0x0d5f('0x19')]();});}};}function handleEntityNotFound(_0x2ffae3,_0x188939){return function(_0xb59240){if(!_0xb59240){_0x2ffae3[_0x0d5f('0x17')](0x194);}return _0xb59240;};}function handleError(_0x24c233,_0x143c8e){_0x143c8e=_0x143c8e||0x1f4;return function(_0x335e33){logger[_0x0d5f('0x22')](_0x335e33[_0x0d5f('0x23')]);if(_0x335e33['name']){delete _0x335e33[_0x0d5f('0x24')];}_0x24c233[_0x0d5f('0x18')](_0x143c8e)[_0x0d5f('0x25')](_0x335e33);};}exports[_0x0d5f('0x26')]=function(_0x443f9a,_0x3b3d3a){var _0x2a29db={},_0x2ec983={},_0xc659c9={'count':0x0,'rows':[]};var _0x554bc6=_[_0x0d5f('0x27')](db[_0x0d5f('0x28')][_0x0d5f('0x29')],function(_0x487b61){return{'name':_0x487b61[_0x0d5f('0x2a')],'type':_0x487b61[_0x0d5f('0x2b')]['key']};});_0x2ec983[_0x0d5f('0x2c')]=_[_0x0d5f('0x27')](_0x554bc6,_0x0d5f('0x24'));_0x2ec983[_0x0d5f('0x2d')]=_['keys'](_0x443f9a['query']);_0x2ec983[_0x0d5f('0x2e')]=_[_0x0d5f('0x2f')](_0x2ec983[_0x0d5f('0x2c')],_0x2ec983[_0x0d5f('0x2d')]);_0x2a29db[_0x0d5f('0x30')]=_[_0x0d5f('0x2f')](_0x2ec983[_0x0d5f('0x2c')],qs['fields'](_0x443f9a[_0x0d5f('0x2d')][_0x0d5f('0x31')]));_0x2a29db[_0x0d5f('0x30')]=_0x2a29db[_0x0d5f('0x30')][_0x0d5f('0x32')]?_0x2a29db[_0x0d5f('0x30')]:_0x2ec983['model'];if(!_0x443f9a[_0x0d5f('0x2d')]['hasOwnProperty'](_0x0d5f('0x33'))){_0x2a29db['limit']=qs[_0x0d5f('0x34')](_0x443f9a['query'][_0x0d5f('0x34')]);_0x2a29db[_0x0d5f('0x1b')]=qs[_0x0d5f('0x1b')](_0x443f9a[_0x0d5f('0x2d')]['offset']);}_0x2a29db['order']=qs[_0x0d5f('0x35')](_0x443f9a[_0x0d5f('0x2d')]['sort']);_0x2a29db[_0x0d5f('0x36')]=qs['filters'](_[_0x0d5f('0x37')](_0x443f9a[_0x0d5f('0x2d')],_0x2ec983['filters']),_0x554bc6);if(_0x443f9a[_0x0d5f('0x2d')]['filter']){_0x2a29db[_0x0d5f('0x36')]=_['merge'](_0x2a29db[_0x0d5f('0x36')],{'$or':_[_0x0d5f('0x27')](_0x554bc6,function(_0x1f0b49){if(_0x1f0b49[_0x0d5f('0x2b')]!==_0x0d5f('0x38')){var _0x322681={};_0x322681[_0x1f0b49['name']]={'$like':'%'+_0x443f9a[_0x0d5f('0x2d')][_0x0d5f('0x39')]+'%'};return _0x322681;}})});}_0x2a29db=_['merge']({},_0x2a29db,_0x443f9a[_0x0d5f('0x3a')]);var _0x59bd70={'where':_0x2a29db['where']};return db[_0x0d5f('0x28')]['count'](_0x59bd70)['then'](function(_0x56deaf){_0xc659c9[_0x0d5f('0x1d')]=_0x56deaf;if(_0x443f9a[_0x0d5f('0x2d')]['includeAll']){_0x2a29db[_0x0d5f('0x3b')]=[{'all':!![]}];}return db[_0x0d5f('0x28')][_0x0d5f('0x3c')](_0x2a29db);})[_0x0d5f('0x20')](function(_0x378bcf){_0xc659c9[_0x0d5f('0x3d')]=_0x378bcf;return _0xc659c9;})['then'](respondWithFilteredResult(_0x3b3d3a,_0x2a29db))['catch'](handleError(_0x3b3d3a,null));};exports[_0x0d5f('0x3e')]=function(_0xfdf8dd,_0x301791){var _0x42adf4={'raw':![],'where':{'id':_0xfdf8dd[_0x0d5f('0x3f')]['id']}},_0x57be30={};_0x57be30[_0x0d5f('0x2c')]=_['keys'](db[_0x0d5f('0x28')][_0x0d5f('0x29')]);_0x57be30[_0x0d5f('0x2d')]=_[_0x0d5f('0x40')](_0xfdf8dd[_0x0d5f('0x2d')]);_0x57be30[_0x0d5f('0x2e')]=_['intersection'](_0x57be30[_0x0d5f('0x2c')],_0x57be30[_0x0d5f('0x2d')]);_0x42adf4[_0x0d5f('0x30')]=_[_0x0d5f('0x2f')](_0x57be30['model'],qs['fields'](_0xfdf8dd[_0x0d5f('0x2d')][_0x0d5f('0x31')]));_0x42adf4[_0x0d5f('0x30')]=_0x42adf4[_0x0d5f('0x30')][_0x0d5f('0x32')]?_0x42adf4['attributes']:_0x57be30['model'];if(_0xfdf8dd['query'][_0x0d5f('0x41')]){_0x42adf4[_0x0d5f('0x3b')]=[{'all':!![]}];}_0x42adf4=_['merge']({},_0x42adf4,_0xfdf8dd[_0x0d5f('0x3a')]);return db[_0x0d5f('0x28')][_0x0d5f('0x42')](_0x42adf4)[_0x0d5f('0x20')](handleEntityNotFound(_0x301791,null))[_0x0d5f('0x20')](respondWithResult(_0x301791,null))['catch'](handleError(_0x301791,null));};exports[_0x0d5f('0x43')]=function(_0x37ee7a,_0x338961){return db['AnalyticFieldReport']['create'](_0x37ee7a[_0x0d5f('0x44')],{})['then'](respondWithResult(_0x338961,0xc9))[_0x0d5f('0x45')](handleError(_0x338961,null));};exports[_0x0d5f('0x46')]=function(_0x202c79,_0x363266){return db['AnalyticFieldReport']['bulkCreate'](_0x202c79[_0x0d5f('0x44')],{'raw':![],'individualHooks':!![]})[_0x0d5f('0x20')](respondWithResult(_0x363266,0xc9))['catch'](handleError(_0x363266,null));};exports['update']=function(_0xc42649,_0x16ac1e){if(_0xc42649[_0x0d5f('0x44')]['id']){delete _0xc42649[_0x0d5f('0x44')]['id'];}return db[_0x0d5f('0x28')]['find']({'where':{'id':_0xc42649['params']['id']}})[_0x0d5f('0x20')](handleEntityNotFound(_0x16ac1e,null))[_0x0d5f('0x20')](saveUpdates(_0xc42649['body'],null))[_0x0d5f('0x20')](respondWithResult(_0x16ac1e,null))[_0x0d5f('0x45')](handleError(_0x16ac1e,null));};exports[_0x0d5f('0x21')]=function(_0x17a60b,_0xbaa927){return db[_0x0d5f('0x28')]['find']({'where':{'id':_0x17a60b[_0x0d5f('0x3f')]['id']}})['then'](handleEntityNotFound(_0xbaa927,null))[_0x0d5f('0x20')](removeEntity(_0xbaa927,null))['catch'](handleError(_0xbaa927,null));};exports['bulkDestroy']=function(_0x3a6ca0,_0x1b3a06){return db[_0x0d5f('0x28')]['destroy']({'where':{'id':_0x3a6ca0['query'][_0x0d5f('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1b3a06,0xcc))[_0x0d5f('0x45')](handleError(_0x1b3a06,null));};exports['addFields']=function(_0x475998,_0x257c8b,_0x1a9e1d){return db[_0x0d5f('0x48')][_0x0d5f('0x49')]({'where':{'id':_0x475998['params']['id']}})[_0x0d5f('0x20')](handleEntityNotFound(_0x257c8b,null))[_0x0d5f('0x20')](function(_0x563d75){if(_0x563d75){return db[_0x0d5f('0x4a')][_0x0d5f('0x4b')](function(_0x11dfa7){return db[_0x0d5f('0x28')]['destroy']({'where':{'CustomReportId':_0x475998['params']['id']},'transaction':_0x11dfa7})[_0x0d5f('0x20')](function(_0x221c05){var _0x1d158e=_[_0x0d5f('0x27')](_0x475998[_0x0d5f('0x44')],function(_0x372e14){delete _0x372e14['id'];_0x372e14[_0x0d5f('0x4c')]=_0x475998[_0x0d5f('0x3f')]['id'];return _0x372e14;});return db[_0x0d5f('0x28')]['bulkCreate'](_0x1d158e,{'transaction':_0x11dfa7});});})[_0x0d5f('0x20')](function(){return db[_0x0d5f('0x28')][_0x0d5f('0x3c')]({'where':{'CustomReportId':_0x475998[_0x0d5f('0x3f')]['id']}});});}})[_0x0d5f('0x20')](respondWithResult(_0x257c8b,null))[_0x0d5f('0x45')](handleError(_0x257c8b,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index c556ec5..75df6dc 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 _0x589f=['../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x36dc6f,_0x4995e0){var _0x5cd4db=function(_0x1aa23e){while(--_0x1aa23e){_0x36dc6f['push'](_0x36dc6f['shift']());}};_0x5cd4db(++_0x4995e0);}(_0x589f,0x116));var _0xf589=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x589f[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0xf589('0x0'));var util=require('util');var logger=require(_0xf589('0x1'))(_0xf589('0x2'));var moment=require(_0xf589('0x3'));var BPromise=require(_0xf589('0x4'));var rp=require(_0xf589('0x5'));var fs=require('fs');var path=require(_0xf589('0x6'));var rimraf=require(_0xf589('0x7'));var config=require(_0xf589('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xf589('0x9')]=function(_0x941dde,_0x24690e){return _0x941dde[_0xf589('0xa')](_0xf589('0xb'),attributes,{'tableName':_0xf589('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf903=['../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x73c90,_0x622ac2){var _0x2607de=function(_0x2bde87){while(--_0x2bde87){_0x73c90['push'](_0x73c90['shift']());}};_0x2607de(++_0x622ac2);}(_0xf903,0x116));var _0x3f90=function(_0x54f1dd,_0x43f45a){_0x54f1dd=_0x54f1dd-0x0;var _0x460649=_0xf903[_0x54f1dd];return _0x460649;};'use strict';var _=require(_0x3f90('0x0'));var util=require(_0x3f90('0x1'));var logger=require(_0x3f90('0x2'))(_0x3f90('0x3'));var moment=require(_0x3f90('0x4'));var BPromise=require('bluebird');var rp=require(_0x3f90('0x5'));var fs=require('fs');var path=require(_0x3f90('0x6'));var rimraf=require(_0x3f90('0x7'));var config=require(_0x3f90('0x8'));var attributes=require(_0x3f90('0x9'));module[_0x3f90('0xa')]=function(_0x538cd8,_0x5e14d0){return _0x538cd8['define'](_0x3f90('0xb'),attributes,{'tableName':_0x3f90('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 17b45bc..702e519 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 _0x26cb=['http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x5f5b28,_0x577f60){var _0x3f735a=function(_0x2d9e51){while(--_0x2d9e51){_0x5f5b28['push'](_0x5f5b28['shift']());}};_0x3f735a(++_0x577f60);}(_0x26cb,0x86));var _0xb26c=function(_0x1075b6,_0x5dec3a){_0x1075b6=_0x1075b6-0x0;var _0x4c236d=_0x26cb[_0x1075b6];return _0x4c236d;};'use strict';var _=require(_0xb26c('0x0'));var util=require(_0xb26c('0x1'));var moment=require(_0xb26c('0x2'));var BPromise=require(_0xb26c('0x3'));var rs=require(_0xb26c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb26c('0x5'))['db'];var utils=require(_0xb26c('0x6'));var logger=require('../../config/logger')(_0xb26c('0x7'));var config=require(_0xb26c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb26c('0x9')][_0xb26c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x481e35,_0x4e9635,_0xe3eb5e){return new BPromise(function(_0x3dce70,_0x583df7){return client[_0xb26c('0xb')](_0x481e35,_0xe3eb5e)['then'](function(_0x2c6147){logger['info'](_0xb26c('0xc'),_0x4e9635,_0xb26c('0xd'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4e9635,_0xb26c('0xd'),JSON[_0xb26c('0xe')](_0x2c6147));if(_0x2c6147['error']){if(_0x2c6147[_0xb26c('0xf')]['code']===0x1f4){logger['error'](_0xb26c('0xc'),_0x4e9635,_0x2c6147[_0xb26c('0xf')][_0xb26c('0x10')]);return _0x583df7(_0x2c6147[_0xb26c('0xf')]['message']);}logger['error'](_0xb26c('0xc'),_0x4e9635,_0x2c6147['error'][_0xb26c('0x10')]);return _0x3dce70(_0x2c6147[_0xb26c('0xf')][_0xb26c('0x10')]);}else{logger[_0xb26c('0x11')](_0xb26c('0xc'),_0x4e9635,_0xb26c('0xd'));_0x3dce70(_0x2c6147['result'][_0xb26c('0x10')]);}})['catch'](function(_0x12e01a){logger[_0xb26c('0xf')](_0xb26c('0xc'),_0x4e9635,_0x12e01a);_0x583df7(_0x12e01a);});});} \ No newline at end of file +var _0x53b0=['http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1a1eab,_0x129c01){var _0x3d6122=function(_0x4bb7de){while(--_0x4bb7de){_0x1a1eab['push'](_0x1a1eab['shift']());}};_0x3d6122(++_0x129c01);}(_0x53b0,0xbd));var _0x053b=function(_0x20e506,_0x3c1f37){_0x20e506=_0x20e506-0x0;var _0x1a8d17=_0x53b0[_0x20e506];return _0x1a8d17;};'use strict';var _=require(_0x053b('0x0'));var util=require(_0x053b('0x1'));var moment=require(_0x053b('0x2'));var BPromise=require('bluebird');var rs=require(_0x053b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x053b('0x4'));var logger=require('../../config/logger')(_0x053b('0x5'));var config=require(_0x053b('0x6'));var jayson=require(_0x053b('0x7'));var client=jayson[_0x053b('0x8')][_0x053b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bfd18,_0x307686,_0x4a0173){return new BPromise(function(_0x41257b,_0x23cf84){return client[_0x053b('0xa')](_0x3bfd18,_0x4a0173)['then'](function(_0x2d32f2){logger[_0x053b('0xb')](_0x053b('0xc'),_0x307686,_0x053b('0xd'));logger[_0x053b('0xe')](_0x053b('0xf'),_0x307686,'request\x20sent',JSON[_0x053b('0x10')](_0x2d32f2));if(_0x2d32f2[_0x053b('0x11')]){if(_0x2d32f2[_0x053b('0x11')][_0x053b('0x12')]===0x1f4){logger[_0x053b('0x11')](_0x053b('0xc'),_0x307686,_0x2d32f2[_0x053b('0x11')][_0x053b('0x13')]);return _0x23cf84(_0x2d32f2[_0x053b('0x11')][_0x053b('0x13')]);}logger[_0x053b('0x11')](_0x053b('0xc'),_0x307686,_0x2d32f2['error'][_0x053b('0x13')]);return _0x41257b(_0x2d32f2[_0x053b('0x11')][_0x053b('0x13')]);}else{logger['info'](_0x053b('0xc'),_0x307686,'request\x20sent');_0x41257b(_0x2d32f2[_0x053b('0x14')][_0x053b('0x13')]);}})[_0x053b('0x15')](function(_0x56841a){logger[_0x053b('0x11')](_0x053b('0xc'),_0x307686,_0x56841a);_0x23cf84(_0x56841a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0e7f717..8fe75be 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(_0x587f89,_0x2272f3){var _0x18c8c7=function(_0x55192c){while(--_0x55192c){_0x587f89['push'](_0x587f89['shift']());}};_0x18c8c7(++_0x2272f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 3537e38..9512ac7 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 _0x61a5=['name','TEXT','sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x61a5,0x19e));var _0x561a=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x61a5[_0x35af23];return _0x340506;};'use strict';var Sequelize=require(_0x561a('0x0'));module['exports']={'name':{'type':Sequelize[_0x561a('0x1')],'allowNull':![],'unique':_0x561a('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x561a('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x61a5=['name','TEXT','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x61a5,0x19e));var _0x561a=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x61a5[_0x393500];return _0x120d3b;};'use strict';var Sequelize=require(_0x561a('0x0'));module['exports']={'name':{'type':Sequelize[_0x561a('0x1')],'allowNull':![],'unique':_0x561a('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x561a('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 7fdcd5b..6eec4e5 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 _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x49789d,_0x57eb1a){var _0x6e859d=function(_0x9fd46c){while(--_0x9fd46c){_0x49789d['push'](_0x49789d['shift']());}};_0x6e859d(++_0x57eb1a);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x75d99f,_0x24fbac){_0x75d99f=_0x75d99f-0x0;var _0x37f992=_0xdbf5[_0x75d99f];return _0x37f992;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file +var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x57e4aa,_0x482b33){var _0x203e32=function(_0xf03c77){while(--_0xf03c77){_0x57e4aa['push'](_0x57e4aa['shift']());}};_0x203e32(++_0x482b33);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2b667c,_0x3f9a1b){_0x2b667c=_0x2b667c-0x0;var _0x5e9d6c=_0x8d0e[_0x2b667c];return _0x5e9d6c;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 091643a..28831d0 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 _0x1c3b=['define','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x3a223a,_0x303433){var _0xb6ac7d=function(_0x4a076d){while(--_0x4a076d){_0x3a223a['push'](_0x3a223a['shift']());}};_0xb6ac7d(++_0x303433);}(_0x1c3b,0xab));var _0xb1c3=function(_0x556ad3,_0x2371b9){_0x556ad3=_0x556ad3-0x0;var _0x19c724=_0x1c3b[_0x556ad3];return _0x19c724;};'use strict';var _=require(_0xb1c3('0x0'));var util=require(_0xb1c3('0x1'));var logger=require(_0xb1c3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb1c3('0x3'));var rp=require(_0xb1c3('0x4'));var fs=require('fs');var path=require(_0xb1c3('0x5'));var rimraf=require(_0xb1c3('0x6'));var config=require(_0xb1c3('0x7'));var attributes=require(_0xb1c3('0x8'));module['exports']=function(_0x472813,_0x62da34){return _0x472813[_0xb1c3('0x9')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x24e6b3,_0x426b42){var _0x29437a=function(_0x13d84e){while(--_0x13d84e){_0x24e6b3['push'](_0x24e6b3['shift']());}};_0x29437a(++_0x426b42);}(_0xfcf0,0x138));var _0x0fcf=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xfcf0[_0x28394f];return _0x2618d2;};'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':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 5b0ab08..95921d8 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 _0x1017=['result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x24f35b,_0x16e123){var _0x476ddc=function(_0x5ce196){while(--_0x5ce196){_0x24f35b['push'](_0x24f35b['shift']());}};_0x476ddc(++_0x16e123);}(_0x1017,0xbf));var _0x7101=function(_0x2c3329,_0x4740d7){_0x2c3329=_0x2c3329-0x0;var _0x2880bc=_0x1017[_0x2c3329];return _0x2880bc;};'use strict';var _=require(_0x7101('0x0'));var util=require('util');var moment=require(_0x7101('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7101('0x2'));var db=require(_0x7101('0x3'))['db'];var utils=require(_0x7101('0x4'));var logger=require(_0x7101('0x5'))('rpc');var config=require(_0x7101('0x6'));var jayson=require(_0x7101('0x7'));var client=jayson[_0x7101('0x8')][_0x7101('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3318ca,_0x4e17d7,_0x144889){return new BPromise(function(_0xad6e57,_0x327b62){return client[_0x7101('0xa')](_0x3318ca,_0x144889)['then'](function(_0x2d7ce5){logger['info'](_0x7101('0xb'),_0x4e17d7,_0x7101('0xc'));logger['debug'](_0x7101('0xd'),_0x4e17d7,_0x7101('0xc'),JSON['stringify'](_0x2d7ce5));if(_0x2d7ce5[_0x7101('0xe')]){if(_0x2d7ce5['error'][_0x7101('0xf')]===0x1f4){logger[_0x7101('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4e17d7,_0x2d7ce5[_0x7101('0xe')][_0x7101('0x10')]);return _0x327b62(_0x2d7ce5[_0x7101('0xe')][_0x7101('0x10')]);}logger[_0x7101('0xe')](_0x7101('0xb'),_0x4e17d7,_0x2d7ce5[_0x7101('0xe')][_0x7101('0x10')]);return _0xad6e57(_0x2d7ce5[_0x7101('0xe')]['message']);}else{logger[_0x7101('0x11')](_0x7101('0xb'),_0x4e17d7,_0x7101('0xc'));_0xad6e57(_0x2d7ce5[_0x7101('0x12')]['message']);}})['catch'](function(_0x2eede0){logger[_0x7101('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4e17d7,_0x2eede0);_0x327b62(_0x2eede0);});});} \ No newline at end of file +var _0xcb06=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','request\x20sent','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x209ed7,_0x1e5a1b){var _0x2d8fd5=function(_0x58e63c){while(--_0x58e63c){_0x209ed7['push'](_0x209ed7['shift']());}};_0x2d8fd5(++_0x1e5a1b);}(_0xcb06,0x145));var _0x6cb0=function(_0x167260,_0x38fb1a){_0x167260=_0x167260-0x0;var _0x33aa98=_0xcb06[_0x167260];return _0x33aa98;};'use strict';var _=require(_0x6cb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6cb0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cb0('0x2'));var db=require(_0x6cb0('0x3'))['db'];var utils=require(_0x6cb0('0x4'));var logger=require(_0x6cb0('0x5'))(_0x6cb0('0x6'));var config=require(_0x6cb0('0x7'));var jayson=require(_0x6cb0('0x8'));var client=jayson[_0x6cb0('0x9')][_0x6cb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562073,_0x176ead,_0x41e5ca){return new BPromise(function(_0x1c9664,_0xf81043){return client[_0x6cb0('0xb')](_0x562073,_0x41e5ca)[_0x6cb0('0xc')](function(_0x1b39da){logger[_0x6cb0('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x176ead,'request\x20sent');logger[_0x6cb0('0xe')](_0x6cb0('0xf'),_0x176ead,'request\x20sent',JSON[_0x6cb0('0x10')](_0x1b39da));if(_0x1b39da[_0x6cb0('0x11')]){if(_0x1b39da[_0x6cb0('0x11')]['code']===0x1f4){logger[_0x6cb0('0x11')](_0x6cb0('0x12'),_0x176ead,_0x1b39da[_0x6cb0('0x11')]['message']);return _0xf81043(_0x1b39da[_0x6cb0('0x11')]['message']);}logger['error'](_0x6cb0('0x12'),_0x176ead,_0x1b39da[_0x6cb0('0x11')]['message']);return _0x1c9664(_0x1b39da['error']['message']);}else{logger[_0x6cb0('0xd')](_0x6cb0('0x12'),_0x176ead,_0x6cb0('0x13'));_0x1c9664(_0x1b39da['result'][_0x6cb0('0x14')]);}})[_0x6cb0('0x15')](function(_0xa8a95e){logger[_0x6cb0('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x176ead,_0xa8a95e);_0xf81043(_0xa8a95e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 97aa5a6..f779eba 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 _0x6363=['./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d0566,_0x3217e7){var _0x18ec61=function(_0x267521){while(--_0x267521){_0x1d0566['push'](_0x1d0566['shift']());}};_0x18ec61(++_0x3217e7);}(_0x6363,0x13a));var _0x3636=function(_0x4df412,_0x179167){_0x4df412=_0x4df412-0x0;var _0xa22b15=_0x6363[_0x4df412];return _0xa22b15;};'use strict';var multer=require(_0x3636('0x0'));var util=require('util');var path=require(_0x3636('0x1'));var timeout=require(_0x3636('0x2'));var express=require(_0x3636('0x3'));var router=express[_0x3636('0x4')]();var fs_extra=require(_0x3636('0x5'));var auth=require(_0x3636('0x6'));var interaction=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var controller=require(_0x3636('0x9'));router[_0x3636('0xa')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0xc')]);router[_0x3636('0xa')](_0x3636('0xd'),auth['isAuthenticated'](),controller[_0x3636('0xe')]);router['post']('/',auth[_0x3636('0xb')](),controller[_0x3636('0xf')]);router[_0x3636('0x10')](_0x3636('0xd'),auth[_0x3636('0xb')](),controller[_0x3636('0x11')]);router[_0x3636('0x12')](_0x3636('0xd'),auth[_0x3636('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x600f=['isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0x3f8fde,_0x1ce304){var _0x1fb818=function(_0x4637a0){while(--_0x4637a0){_0x3f8fde['push'](_0x3f8fde['shift']());}};_0x1fb818(++_0x1ce304);}(_0x600f,0xb4));var _0xf600=function(_0x4e9fed,_0x19f4f3){_0x4e9fed=_0x4e9fed-0x0;var _0x5c8cc0=_0x600f[_0x4e9fed];return _0x5c8cc0;};'use strict';var multer=require(_0xf600('0x0'));var util=require(_0xf600('0x1'));var path=require(_0xf600('0x2'));var timeout=require('connect-timeout');var express=require(_0xf600('0x3'));var router=express['Router']();var fs_extra=require(_0xf600('0x4'));var auth=require(_0xf600('0x5'));var interaction=require(_0xf600('0x6'));var config=require(_0xf600('0x7'));var controller=require(_0xf600('0x8'));router[_0xf600('0x9')]('/',auth[_0xf600('0xa')](),controller[_0xf600('0xb')]);router['get'](_0xf600('0xc'),auth['isAuthenticated'](),controller[_0xf600('0xd')]);router['post']('/',auth[_0xf600('0xa')](),controller[_0xf600('0xe')]);router[_0xf600('0xf')](_0xf600('0xc'),auth['isAuthenticated'](),controller[_0xf600('0x10')]);router[_0xf600('0x11')](_0xf600('0xc'),auth[_0xf600('0xa')](),controller['destroy']);module[_0xf600('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index c698b54..7e9d9be 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 _0xfb17=['exports','TEXT','sequelize'];(function(_0x19cb36,_0x4bab45){var _0x1b901c=function(_0x41152b){while(--_0x41152b){_0x19cb36['push'](_0x19cb36['shift']());}};_0x1b901c(++_0x4bab45);}(_0xfb17,0x16d));var _0x7fb1=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfb17[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x7fb1('0x0'));module[_0x7fb1('0x1')]={'tree':{'type':Sequelize[_0x7fb1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1eda=['TEXT','exports'];(function(_0x5be5cb,_0x8f2d7a){var _0x3f3288=function(_0x34ea29){while(--_0x34ea29){_0x5be5cb['push'](_0x5be5cb['shift']());}};_0x3f3288(++_0x8f2d7a);}(_0x1eda,0x69));var _0xa1ed=function(_0x59fd2d,_0x4a2c26){_0x59fd2d=_0x59fd2d-0x0;var _0x2ed5e0=_0x1eda[_0x59fd2d];return _0x2ed5e0;};'use strict';var Sequelize=require('sequelize');module[_0xa1ed('0x0')]={'tree':{'type':Sequelize[_0xa1ed('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index d4ea6fe..64c908f 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 _0x21cd=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','update','then','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','catch','create','body','find'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x21cd,0x8a));var _0xd21c=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x21cd[_0x5627e1];return _0x2f013f;};'use strict';var emlformat=require(_0xd21c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd21c('0x1'));var jsonpatch=require(_0xd21c('0x2'));var rp=require(_0xd21c('0x3'));var moment=require(_0xd21c('0x4'));var BPromise=require(_0xd21c('0x5'));var Mustache=require(_0xd21c('0x6'));var util=require(_0xd21c('0x7'));var path=require(_0xd21c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd21c('0x9'));var fs=require('fs');var fs_extra=require(_0xd21c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd21c('0xb'));var jsforce=require(_0xd21c('0xc'));var deskjs=require(_0xd21c('0xd'));var toCsv=require(_0xd21c('0xe'));var querystring=require('querystring');var Papa=require(_0xd21c('0xf'));var Redis=require(_0xd21c('0x10'));var authService=require(_0xd21c('0x11'));var qs=require(_0xd21c('0x12'));var as=require(_0xd21c('0x13'));var hardwareService=require(_0xd21c('0x14'));var logger=require('../../config/logger')(_0xd21c('0x15'));var utils=require(_0xd21c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd21c('0x17'));var db=require(_0xd21c('0x18'))['db'];function respondWithStatusCode(_0x42a65d,_0x22e387){_0x22e387=_0x22e387||0xcc;return function(_0x42bea3){if(_0x42bea3){return _0x42a65d[_0xd21c('0x19')](_0x22e387);}return _0x42a65d['status'](_0x22e387)[_0xd21c('0x1a')]();};}function respondWithResult(_0x6b2909,_0x24c109){_0x24c109=_0x24c109||0xc8;return function(_0x3b1bcf){if(_0x3b1bcf){return _0x6b2909[_0xd21c('0x1b')](_0x24c109)[_0xd21c('0x1c')](_0x3b1bcf);}};}function respondWithFilteredResult(_0x29751e,_0x19ee3d){return function(_0x10a8cb){if(_0x10a8cb){var _0x437777=typeof _0x19ee3d[_0xd21c('0x1d')]==='undefined'&&typeof _0x19ee3d['limit']===_0xd21c('0x1e');var _0x57aabd=_0x10a8cb[_0xd21c('0x1f')];var _0x1bc940=_0x437777?0x0:_0x19ee3d['offset'];var _0x4e8278=_0x437777?_0x10a8cb['count']:_0x19ee3d['offset']+_0x19ee3d['limit'];var _0x565a16;if(_0x4e8278>=_0x57aabd){_0x4e8278=_0x57aabd;_0x565a16=0xc8;}else{_0x565a16=0xce;}_0x29751e['status'](_0x565a16);return _0x29751e['set']('Content-Range',_0x1bc940+'-'+_0x4e8278+'/'+_0x57aabd)[_0xd21c('0x1c')](_0x10a8cb);}return null;};}function patchUpdates(_0x43c20b){return function(_0x285c72){try{jsonpatch['apply'](_0x285c72,_0x43c20b,!![]);}catch(_0x59faeb){return BPromise['reject'](_0x59faeb);}return _0x285c72['save']();};}function saveUpdates(_0x585768,_0x38a507){return function(_0xa4d9f6){if(_0xa4d9f6){return _0xa4d9f6[_0xd21c('0x20')](_0x585768)[_0xd21c('0x21')](function(_0x25af05){return _0x25af05;});}return null;};}function removeEntity(_0x28979d,_0x1b30d8){return function(_0x4aa2ee){if(_0x4aa2ee){return _0x4aa2ee['destroy']()[_0xd21c('0x21')](function(){_0x28979d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2296fe,_0x2f52cd){return function(_0x83d36e){if(!_0x83d36e){_0x2296fe['sendStatus'](0x194);}return _0x83d36e;};}function handleError(_0x51df9a,_0x44d7b6){_0x44d7b6=_0x44d7b6||0x1f4;return function(_0x5bd10c){logger[_0xd21c('0x22')](_0x5bd10c[_0xd21c('0x23')]);if(_0x5bd10c[_0xd21c('0x24')]){delete _0x5bd10c[_0xd21c('0x24')];}_0x51df9a[_0xd21c('0x1b')](_0x44d7b6)[_0xd21c('0x25')](_0x5bd10c);};}exports[_0xd21c('0x26')]=function(_0x40eebc,_0x3d4a9e){var _0x2f6b7c={},_0xb2a69e={},_0x40e729={'count':0x0,'rows':[]};var _0x3e819b=_[_0xd21c('0x27')](db[_0xd21c('0x28')]['rawAttributes'],function(_0x495b35){return{'name':_0x495b35[_0xd21c('0x29')],'type':_0x495b35[_0xd21c('0x2a')]['key']};});_0xb2a69e[_0xd21c('0x2b')]=_[_0xd21c('0x27')](_0x3e819b,_0xd21c('0x24'));_0xb2a69e[_0xd21c('0x2c')]=_[_0xd21c('0x2d')](_0x40eebc[_0xd21c('0x2c')]);_0xb2a69e[_0xd21c('0x2e')]=_[_0xd21c('0x2f')](_0xb2a69e[_0xd21c('0x2b')],_0xb2a69e[_0xd21c('0x2c')]);_0x2f6b7c[_0xd21c('0x30')]=_[_0xd21c('0x2f')](_0xb2a69e['model'],qs[_0xd21c('0x31')](_0x40eebc[_0xd21c('0x2c')]['fields']));_0x2f6b7c[_0xd21c('0x30')]=_0x2f6b7c[_0xd21c('0x30')][_0xd21c('0x32')]?_0x2f6b7c[_0xd21c('0x30')]:_0xb2a69e[_0xd21c('0x2b')];if(!_0x40eebc[_0xd21c('0x2c')]['hasOwnProperty'](_0xd21c('0x33'))){_0x2f6b7c['limit']=qs['limit'](_0x40eebc[_0xd21c('0x2c')]['limit']);_0x2f6b7c[_0xd21c('0x1d')]=qs['offset'](_0x40eebc[_0xd21c('0x2c')][_0xd21c('0x1d')]);}_0x2f6b7c[_0xd21c('0x34')]=qs[_0xd21c('0x35')](_0x40eebc['query'][_0xd21c('0x35')]);_0x2f6b7c[_0xd21c('0x36')]=qs['filters'](_[_0xd21c('0x37')](_0x40eebc[_0xd21c('0x2c')],_0xb2a69e[_0xd21c('0x2e')]),_0x3e819b);if(_0x40eebc['query'][_0xd21c('0x38')]){_0x2f6b7c[_0xd21c('0x36')]=_[_0xd21c('0x39')](_0x2f6b7c['where'],{'$or':_[_0xd21c('0x27')](_0x3e819b,function(_0x4724bc){if(_0x4724bc[_0xd21c('0x2a')]!==_0xd21c('0x3a')){var _0x253434={};_0x253434[_0x4724bc[_0xd21c('0x24')]]={'$like':'%'+_0x40eebc[_0xd21c('0x2c')][_0xd21c('0x38')]+'%'};return _0x253434;}})});}_0x2f6b7c=_['merge']({},_0x2f6b7c,_0x40eebc[_0xd21c('0x3b')]);var _0x4aacef={'where':_0x2f6b7c[_0xd21c('0x36')]};return db[_0xd21c('0x28')][_0xd21c('0x1f')](_0x4aacef)[_0xd21c('0x21')](function(_0x28f069){_0x40e729[_0xd21c('0x1f')]=_0x28f069;if(_0x40eebc[_0xd21c('0x2c')][_0xd21c('0x3c')]){_0x2f6b7c['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xd21c('0x3d')](_0x2f6b7c);})[_0xd21c('0x21')](function(_0x2813b6){_0x40e729['rows']=_0x2813b6;return _0x40e729;})[_0xd21c('0x21')](respondWithFilteredResult(_0x3d4a9e,_0x2f6b7c))['catch'](handleError(_0x3d4a9e,null));};exports[_0xd21c('0x3e')]=function(_0x4ab80f,_0x8029f4){var _0x25d965={'raw':!![],'where':{'id':_0x4ab80f[_0xd21c('0x3f')]['id']}},_0x40d427={};_0x40d427['model']=_[_0xd21c('0x2d')](db[_0xd21c('0x28')][_0xd21c('0x40')]);_0x40d427[_0xd21c('0x2c')]=_[_0xd21c('0x2d')](_0x4ab80f[_0xd21c('0x2c')]);_0x40d427[_0xd21c('0x2e')]=_[_0xd21c('0x2f')](_0x40d427[_0xd21c('0x2b')],_0x40d427[_0xd21c('0x2c')]);_0x25d965[_0xd21c('0x30')]=_['intersection'](_0x40d427[_0xd21c('0x2b')],qs[_0xd21c('0x31')](_0x4ab80f[_0xd21c('0x2c')][_0xd21c('0x31')]));_0x25d965[_0xd21c('0x30')]=_0x25d965[_0xd21c('0x30')][_0xd21c('0x32')]?_0x25d965[_0xd21c('0x30')]:_0x40d427[_0xd21c('0x2b')];if(_0x4ab80f[_0xd21c('0x2c')][_0xd21c('0x3c')]){_0x25d965['include']=[{'all':!![]}];}_0x25d965=_[_0xd21c('0x39')]({},_0x25d965,_0x4ab80f[_0xd21c('0x3b')]);return db[_0xd21c('0x28')]['find'](_0x25d965)['then'](handleEntityNotFound(_0x8029f4,null))[_0xd21c('0x21')](respondWithResult(_0x8029f4,null))[_0xd21c('0x41')](handleError(_0x8029f4,null));};exports[_0xd21c('0x42')]=function(_0x4ebc37,_0x77f5ad){return db[_0xd21c('0x28')][_0xd21c('0x42')](_0x4ebc37[_0xd21c('0x43')],{})[_0xd21c('0x21')](respondWithResult(_0x77f5ad,0xc9))['catch'](handleError(_0x77f5ad,null));};exports['update']=function(_0x39196b,_0x883ccd){if(_0x39196b['body']['id']){delete _0x39196b['body']['id'];}return db[_0xd21c('0x28')]['find']({'where':{'id':_0x39196b[_0xd21c('0x3f')]['id']}})[_0xd21c('0x21')](handleEntityNotFound(_0x883ccd,null))[_0xd21c('0x21')](saveUpdates(_0x39196b[_0xd21c('0x43')],null))[_0xd21c('0x21')](respondWithResult(_0x883ccd,null))[_0xd21c('0x41')](handleError(_0x883ccd,null));};exports['destroy']=function(_0x362429,_0x2b22b7){return db['AnalyticTreeReport'][_0xd21c('0x44')]({'where':{'id':_0x362429[_0xd21c('0x3f')]['id']}})[_0xd21c('0x21')](handleEntityNotFound(_0x2b22b7,null))[_0xd21c('0x21')](removeEntity(_0x2b22b7,null))[_0xd21c('0x41')](handleError(_0x2b22b7,null));}; \ No newline at end of file +var _0x31ba=['attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','keys','AnalyticTreeReport','length','create','body','find','params','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query'];(function(_0x407054,_0x1792fa){var _0x2c3874=function(_0x49b327){while(--_0x49b327){_0x407054['push'](_0x407054['shift']());}};_0x2c3874(++_0x1792fa);}(_0x31ba,0x143));var _0xa31b=function(_0x3e130f,_0x309c01){_0x3e130f=_0x3e130f-0x0;var _0xf4d530=_0x31ba[_0x3e130f];return _0xf4d530;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa31b('0x0'));var zipdir=require(_0xa31b('0x1'));var jsonpatch=require(_0xa31b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa31b('0x3'));var Mustache=require(_0xa31b('0x4'));var util=require(_0xa31b('0x5'));var path=require(_0xa31b('0x6'));var sox=require(_0xa31b('0x7'));var csv=require(_0xa31b('0x8'));var ejs=require(_0xa31b('0x9'));var fs=require('fs');var fs_extra=require(_0xa31b('0xa'));var _=require('lodash');var squel=require(_0xa31b('0xb'));var crypto=require(_0xa31b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa31b('0xd'));var toCsv=require(_0xa31b('0x8'));var querystring=require('querystring');var Papa=require(_0xa31b('0xe'));var Redis=require(_0xa31b('0xf'));var authService=require(_0xa31b('0x10'));var qs=require(_0xa31b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa31b('0x12'));var logger=require(_0xa31b('0x13'))('api');var utils=require(_0xa31b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa31b('0x15'));var db=require(_0xa31b('0x16'))['db'];function respondWithStatusCode(_0x3453f4,_0x35f7b8){_0x35f7b8=_0x35f7b8||0xcc;return function(_0x3ded9d){if(_0x3ded9d){return _0x3453f4[_0xa31b('0x17')](_0x35f7b8);}return _0x3453f4[_0xa31b('0x18')](_0x35f7b8)['end']();};}function respondWithResult(_0x3d8d3d,_0x4d1e4b){_0x4d1e4b=_0x4d1e4b||0xc8;return function(_0x65b358){if(_0x65b358){return _0x3d8d3d[_0xa31b('0x18')](_0x4d1e4b)['json'](_0x65b358);}};}function respondWithFilteredResult(_0x2b295b,_0x3457f4){return function(_0x58858c){if(_0x58858c){var _0xe773c=typeof _0x3457f4[_0xa31b('0x19')]===_0xa31b('0x1a')&&typeof _0x3457f4[_0xa31b('0x1b')]==='undefined';var _0x7e80e1=_0x58858c['count'];var _0x9d6e32=_0xe773c?0x0:_0x3457f4['offset'];var _0x273ba9=_0xe773c?_0x58858c['count']:_0x3457f4[_0xa31b('0x19')]+_0x3457f4['limit'];var _0x5b6ce5;if(_0x273ba9>=_0x7e80e1){_0x273ba9=_0x7e80e1;_0x5b6ce5=0xc8;}else{_0x5b6ce5=0xce;}_0x2b295b[_0xa31b('0x18')](_0x5b6ce5);return _0x2b295b[_0xa31b('0x1c')]('Content-Range',_0x9d6e32+'-'+_0x273ba9+'/'+_0x7e80e1)[_0xa31b('0x1d')](_0x58858c);}return null;};}function patchUpdates(_0x18ae16){return function(_0x2c94b7){try{jsonpatch[_0xa31b('0x1e')](_0x2c94b7,_0x18ae16,!![]);}catch(_0x360616){return BPromise[_0xa31b('0x1f')](_0x360616);}return _0x2c94b7[_0xa31b('0x20')]();};}function saveUpdates(_0x5c2321,_0x1d5c7d){return function(_0x3ff02c){if(_0x3ff02c){return _0x3ff02c[_0xa31b('0x21')](_0x5c2321)['then'](function(_0x4819d1){return _0x4819d1;});}return null;};}function removeEntity(_0x8a5342,_0xc49b98){return function(_0x1d4605){if(_0x1d4605){return _0x1d4605['destroy']()[_0xa31b('0x22')](function(){_0x8a5342['status'](0xcc)[_0xa31b('0x23')]();});}};}function handleEntityNotFound(_0x1bafa9,_0x329e35){return function(_0xe2e347){if(!_0xe2e347){_0x1bafa9[_0xa31b('0x17')](0x194);}return _0xe2e347;};}function handleError(_0x31b376,_0x300f2a){_0x300f2a=_0x300f2a||0x1f4;return function(_0x192c44){logger[_0xa31b('0x24')](_0x192c44[_0xa31b('0x25')]);if(_0x192c44['name']){delete _0x192c44[_0xa31b('0x26')];}_0x31b376[_0xa31b('0x18')](_0x300f2a)[_0xa31b('0x27')](_0x192c44);};}exports[_0xa31b('0x28')]=function(_0x121c6d,_0x34636b){var _0x5ab6c6={},_0xd12042={},_0x40def6={'count':0x0,'rows':[]};var _0x37df9b=_[_0xa31b('0x29')](db['AnalyticTreeReport'][_0xa31b('0x2a')],function(_0x1d0365){return{'name':_0x1d0365[_0xa31b('0x2b')],'type':_0x1d0365['type'][_0xa31b('0x2c')]};});_0xd12042['model']=_[_0xa31b('0x29')](_0x37df9b,'name');_0xd12042['query']=_['keys'](_0x121c6d['query']);_0xd12042['filters']=_['intersection'](_0xd12042[_0xa31b('0x2d')],_0xd12042[_0xa31b('0x2e')]);_0x5ab6c6[_0xa31b('0x2f')]=_[_0xa31b('0x30')](_0xd12042[_0xa31b('0x2d')],qs['fields'](_0x121c6d[_0xa31b('0x2e')][_0xa31b('0x31')]));_0x5ab6c6[_0xa31b('0x2f')]=_0x5ab6c6[_0xa31b('0x2f')]['length']?_0x5ab6c6[_0xa31b('0x2f')]:_0xd12042[_0xa31b('0x2d')];if(!_0x121c6d[_0xa31b('0x2e')]['hasOwnProperty'](_0xa31b('0x32'))){_0x5ab6c6[_0xa31b('0x1b')]=qs[_0xa31b('0x1b')](_0x121c6d[_0xa31b('0x2e')][_0xa31b('0x1b')]);_0x5ab6c6['offset']=qs[_0xa31b('0x19')](_0x121c6d[_0xa31b('0x2e')]['offset']);}_0x5ab6c6[_0xa31b('0x33')]=qs[_0xa31b('0x34')](_0x121c6d[_0xa31b('0x2e')][_0xa31b('0x34')]);_0x5ab6c6[_0xa31b('0x35')]=qs[_0xa31b('0x36')](_[_0xa31b('0x37')](_0x121c6d['query'],_0xd12042['filters']),_0x37df9b);if(_0x121c6d[_0xa31b('0x2e')][_0xa31b('0x38')]){_0x5ab6c6[_0xa31b('0x35')]=_['merge'](_0x5ab6c6[_0xa31b('0x35')],{'$or':_[_0xa31b('0x29')](_0x37df9b,function(_0x6744a9){if(_0x6744a9['type']!==_0xa31b('0x39')){var _0x4f5848={};_0x4f5848[_0x6744a9['name']]={'$like':'%'+_0x121c6d[_0xa31b('0x2e')][_0xa31b('0x38')]+'%'};return _0x4f5848;}})});}_0x5ab6c6=_[_0xa31b('0x3a')]({},_0x5ab6c6,_0x121c6d[_0xa31b('0x3b')]);var _0x5713b4={'where':_0x5ab6c6[_0xa31b('0x35')]};return db['AnalyticTreeReport']['count'](_0x5713b4)[_0xa31b('0x22')](function(_0x513a85){_0x40def6[_0xa31b('0x3c')]=_0x513a85;if(_0x121c6d['query'][_0xa31b('0x3d')]){_0x5ab6c6[_0xa31b('0x3e')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa31b('0x3f')](_0x5ab6c6);})[_0xa31b('0x22')](function(_0x2da855){_0x40def6[_0xa31b('0x40')]=_0x2da855;return _0x40def6;})[_0xa31b('0x22')](respondWithFilteredResult(_0x34636b,_0x5ab6c6))[_0xa31b('0x41')](handleError(_0x34636b,null));};exports[_0xa31b('0x42')]=function(_0x44c854,_0x984937){var _0x48c513={'raw':!![],'where':{'id':_0x44c854['params']['id']}},_0x331055={};_0x331055[_0xa31b('0x2d')]=_[_0xa31b('0x43')](db[_0xa31b('0x44')]['rawAttributes']);_0x331055[_0xa31b('0x2e')]=_[_0xa31b('0x43')](_0x44c854[_0xa31b('0x2e')]);_0x331055[_0xa31b('0x36')]=_['intersection'](_0x331055[_0xa31b('0x2d')],_0x331055[_0xa31b('0x2e')]);_0x48c513['attributes']=_['intersection'](_0x331055['model'],qs[_0xa31b('0x31')](_0x44c854['query'][_0xa31b('0x31')]));_0x48c513['attributes']=_0x48c513[_0xa31b('0x2f')][_0xa31b('0x45')]?_0x48c513[_0xa31b('0x2f')]:_0x331055[_0xa31b('0x2d')];if(_0x44c854['query'][_0xa31b('0x3d')]){_0x48c513['include']=[{'all':!![]}];}_0x48c513=_['merge']({},_0x48c513,_0x44c854[_0xa31b('0x3b')]);return db['AnalyticTreeReport']['find'](_0x48c513)[_0xa31b('0x22')](handleEntityNotFound(_0x984937,null))[_0xa31b('0x22')](respondWithResult(_0x984937,null))['catch'](handleError(_0x984937,null));};exports[_0xa31b('0x46')]=function(_0x5786e3,_0x53768c){return db[_0xa31b('0x44')][_0xa31b('0x46')](_0x5786e3[_0xa31b('0x47')],{})[_0xa31b('0x22')](respondWithResult(_0x53768c,0xc9))[_0xa31b('0x41')](handleError(_0x53768c,null));};exports[_0xa31b('0x21')]=function(_0x303743,_0x505b90){if(_0x303743[_0xa31b('0x47')]['id']){delete _0x303743[_0xa31b('0x47')]['id'];}return db[_0xa31b('0x44')][_0xa31b('0x48')]({'where':{'id':_0x303743[_0xa31b('0x49')]['id']}})[_0xa31b('0x22')](handleEntityNotFound(_0x505b90,null))[_0xa31b('0x22')](saveUpdates(_0x303743[_0xa31b('0x47')],null))[_0xa31b('0x22')](respondWithResult(_0x505b90,null))[_0xa31b('0x41')](handleError(_0x505b90,null));};exports['destroy']=function(_0x5bded2,_0x550fcf){return db[_0xa31b('0x44')][_0xa31b('0x48')]({'where':{'id':_0x5bded2[_0xa31b('0x49')]['id']}})['then'](handleEntityNotFound(_0x550fcf,null))['then'](removeEntity(_0x550fcf,null))[_0xa31b('0x41')](handleError(_0x550fcf,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 34b5d2a..2c02753 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 _0xbc9b=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbc9b,0xbe));var _0xbbc9=function(_0x123c66,_0xf350c2){_0x123c66=_0x123c66-0x0;var _0x3afdd4=_0xbc9b[_0x123c66];return _0x3afdd4;};'use strict';var _=require(_0xbbc9('0x0'));var util=require(_0xbbc9('0x1'));var logger=require(_0xbbc9('0x2'))(_0xbbc9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbbc9('0x4'));var fs=require('fs');var path=require(_0xbbc9('0x5'));var rimraf=require(_0xbbc9('0x6'));var config=require(_0xbbc9('0x7'));var attributes=require(_0xbbc9('0x8'));module[_0xbbc9('0x9')]=function(_0x231bae,_0x185c6f){return _0x231bae[_0xbbc9('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xbbc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e24=['path','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x17e347,_0x1faf41){var _0x1b80cb=function(_0x3debd7){while(--_0x3debd7){_0x17e347['push'](_0x17e347['shift']());}};_0x1b80cb(++_0x1faf41);}(_0x8e24,0x176));var _0x48e2=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0x8e24[_0xf6e75d];return _0x27514d;};'use strict';var _=require(_0x48e2('0x0'));var util=require(_0x48e2('0x1'));var logger=require(_0x48e2('0x2'))(_0x48e2('0x3'));var moment=require(_0x48e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x48e2('0x5'));var fs=require('fs');var path=require(_0x48e2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x48e2('0x7'));module['exports']=function(_0xecf6f0,_0x2ede33){return _0xecf6f0['define'](_0x48e2('0x8'),attributes,{'tableName':_0x48e2('0x9'),'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 45f87bb..dee64d5 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x774a9c,_0x56c8df){var _0xd71292=function(_0x15c716){while(--_0x15c716){_0x774a9c['push'](_0x774a9c['shift']());}};_0xd71292(++_0x56c8df);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2b10b5,_0x5c1f2e){var _0x545669=function(_0x4208be){while(--_0x4208be){_0x2b10b5['push'](_0x2b10b5['shift']());}};_0x545669(++_0x5c1f2e);}(_0xadb5,0xad));var _0x5adb=function(_0x4cfae6,_0x4332e8){_0x4cfae6=_0x4cfae6-0x0;var _0x2c399c=_0xadb5[_0x4cfae6];return _0x2c399c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 0f02387..61e4b77 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 _0x582e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x71ae3c,_0x404627){var _0x194072=function(_0x13c008){while(--_0x13c008){_0x71ae3c['push'](_0x71ae3c['shift']());}};_0x194072(++_0x404627);}(_0x582e,0xa5));var _0xe582=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x582e[_0x4eaa4c];return _0x15aec6;};'use strict';var multer=require(_0xe582('0x0'));var util=require(_0xe582('0x1'));var path=require(_0xe582('0x2'));var timeout=require(_0xe582('0x3'));var express=require(_0xe582('0x4'));var router=express['Router']();var fs_extra=require(_0xe582('0x5'));var auth=require(_0xe582('0x6'));var interaction=require(_0xe582('0x7'));var config=require(_0xe582('0x8'));var controller=require(_0xe582('0x9'));router['get']('/',auth[_0xe582('0xa')](),controller[_0xe582('0xb')]);router[_0xe582('0xc')](_0xe582('0xd'),auth[_0xe582('0xa')](),controller[_0xe582('0xe')]);router[_0xe582('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe582('0x10')](_0xe582('0xd'),auth[_0xe582('0xa')](),controller[_0xe582('0x11')]);router[_0xe582('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe582('0x13')]);module[_0xe582('0x14')]=router; \ No newline at end of file +var _0xda78=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xda78,0x9d));var _0x8da7=function(_0x4c97ea,_0x25b9a2){_0x4c97ea=_0x4c97ea-0x0;var _0x521af1=_0xda78[_0x4c97ea];return _0x521af1;};'use strict';var multer=require(_0x8da7('0x0'));var util=require(_0x8da7('0x1'));var path=require(_0x8da7('0x2'));var timeout=require(_0x8da7('0x3'));var express=require(_0x8da7('0x4'));var router=express[_0x8da7('0x5')]();var fs_extra=require(_0x8da7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8da7('0x7'));var config=require(_0x8da7('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x8da7('0x9')]('/',auth[_0x8da7('0xa')](),controller[_0x8da7('0xb')]);router[_0x8da7('0x9')](_0x8da7('0xc'),auth[_0x8da7('0xa')](),controller['show']);router[_0x8da7('0xd')]('/',auth['isAuthenticated'](),controller[_0x8da7('0xe')]);router[_0x8da7('0xf')]('/:id',auth[_0x8da7('0xa')](),controller[_0x8da7('0x10')]);router[_0x8da7('0x11')](_0x8da7('0xc'),auth[_0x8da7('0xa')](),controller[_0x8da7('0x12')]);module[_0x8da7('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 55f8334..45ba0ba 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 _0xde6c=['exports','STRING','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xde6c,0x119));var _0xcde6=function(_0xbd7925,_0x2d046b){_0xbd7925=_0xbd7925-0x0;var _0x213b72=_0xde6c[_0xbd7925];return _0x213b72;};'use strict';var Sequelize=require(_0xcde6('0x0'));module[_0xcde6('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xcde6('0x2')]},'type':{'type':Sequelize[_0xcde6('0x2')]}}; \ No newline at end of file +var _0x5309=['sequelize','exports','STRING'];(function(_0x521ea9,_0x4dff06){var _0x42898b=function(_0x57c8a8){while(--_0x57c8a8){_0x521ea9['push'](_0x521ea9['shift']());}};_0x42898b(++_0x4dff06);}(_0x5309,0x1aa));var _0x9530=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x5309[_0x71b765];return _0x34cb24;};'use strict';var Sequelize=require(_0x9530('0x0'));module[_0x9530('0x1')]={'name':{'type':Sequelize[_0x9530('0x2')]},'basename':{'type':Sequelize[_0x9530('0x2')]},'type':{'type':Sequelize[_0x9530('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 20edff1..f530daf 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 _0x9ecc=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','destroy','create','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','map','Attachment','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields'];(function(_0x57eef3,_0x425914){var _0xb88467=function(_0x612b1a){while(--_0x612b1a){_0x57eef3['push'](_0x57eef3['shift']());}};_0xb88467(++_0x425914);}(_0x9ecc,0x191));var _0xc9ec=function(_0x388096,_0x50b7c8){_0x388096=_0x388096-0x0;var _0x38c620=_0x9ecc[_0x388096];return _0x38c620;};'use strict';var emlformat=require(_0xc9ec('0x0'));var rimraf=require(_0xc9ec('0x1'));var zipdir=require(_0xc9ec('0x2'));var jsonpatch=require(_0xc9ec('0x3'));var rp=require('request-promise');var moment=require(_0xc9ec('0x4'));var BPromise=require(_0xc9ec('0x5'));var Mustache=require(_0xc9ec('0x6'));var util=require(_0xc9ec('0x7'));var path=require('path');var sox=require(_0xc9ec('0x8'));var csv=require(_0xc9ec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9ec('0xa'));var _=require(_0xc9ec('0xb'));var squel=require('squel');var crypto=require(_0xc9ec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc9ec('0xd'));var toCsv=require(_0xc9ec('0x9'));var querystring=require(_0xc9ec('0xe'));var Papa=require(_0xc9ec('0xf'));var Redis=require(_0xc9ec('0x10'));var authService=require(_0xc9ec('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc9ec('0x12'));var hardwareService=require(_0xc9ec('0x13'));var logger=require(_0xc9ec('0x14'))(_0xc9ec('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc9ec('0x16'));var db=require(_0xc9ec('0x17'))['db'];function respondWithStatusCode(_0x46b97a,_0x3f4f36){_0x3f4f36=_0x3f4f36||0xcc;return function(_0x116fa5){if(_0x116fa5){return _0x46b97a[_0xc9ec('0x18')](_0x3f4f36);}return _0x46b97a[_0xc9ec('0x19')](_0x3f4f36)[_0xc9ec('0x1a')]();};}function respondWithResult(_0x595b9e,_0x16cdf3){_0x16cdf3=_0x16cdf3||0xc8;return function(_0x5c3d20){if(_0x5c3d20){return _0x595b9e['status'](_0x16cdf3)[_0xc9ec('0x1b')](_0x5c3d20);}};}function respondWithFilteredResult(_0x325146,_0x446378){return function(_0x222fde){if(_0x222fde){var _0x55141f=typeof _0x446378[_0xc9ec('0x1c')]==='undefined'&&typeof _0x446378[_0xc9ec('0x1d')]===_0xc9ec('0x1e');var _0x4be207=_0x222fde[_0xc9ec('0x1f')];var _0x48b62a=_0x55141f?0x0:_0x446378['offset'];var _0x59d617=_0x55141f?_0x222fde[_0xc9ec('0x1f')]:_0x446378[_0xc9ec('0x1c')]+_0x446378['limit'];var _0xe98179;if(_0x59d617>=_0x4be207){_0x59d617=_0x4be207;_0xe98179=0xc8;}else{_0xe98179=0xce;}_0x325146[_0xc9ec('0x19')](_0xe98179);return _0x325146[_0xc9ec('0x20')]('Content-Range',_0x48b62a+'-'+_0x59d617+'/'+_0x4be207)[_0xc9ec('0x1b')](_0x222fde);}return null;};}function patchUpdates(_0x48a320){return function(_0x1ee0dd){try{jsonpatch[_0xc9ec('0x21')](_0x1ee0dd,_0x48a320,!![]);}catch(_0x497daa){return BPromise[_0xc9ec('0x22')](_0x497daa);}return _0x1ee0dd[_0xc9ec('0x23')]();};}function saveUpdates(_0x1a8668,_0x2ccec4){return function(_0x461ac7){if(_0x461ac7){return _0x461ac7[_0xc9ec('0x24')](_0x1a8668)[_0xc9ec('0x25')](function(_0xfa284a){return _0xfa284a;});}return null;};}function removeEntity(_0x83d3fc,_0x21e8d9){return function(_0x5ca6ef){if(_0x5ca6ef){return _0x5ca6ef['destroy']()[_0xc9ec('0x25')](function(){_0x83d3fc[_0xc9ec('0x19')](0xcc)[_0xc9ec('0x1a')]();});}};}function handleEntityNotFound(_0x3bfa9e,_0x282fbc){return function(_0x391c12){if(!_0x391c12){_0x3bfa9e[_0xc9ec('0x18')](0x194);}return _0x391c12;};}function handleError(_0x1e72c3,_0x33b269){_0x33b269=_0x33b269||0x1f4;return function(_0x203c07){logger[_0xc9ec('0x26')](_0x203c07[_0xc9ec('0x27')]);if(_0x203c07[_0xc9ec('0x28')]){delete _0x203c07[_0xc9ec('0x28')];}_0x1e72c3[_0xc9ec('0x19')](_0x33b269)[_0xc9ec('0x29')](_0x203c07);};}exports['index']=function(_0x41499f,_0x42dacd){var _0x4379e7={},_0x57a564={},_0x5a421e={'count':0x0,'rows':[]};var _0x456faa=_[_0xc9ec('0x2a')](db[_0xc9ec('0x2b')][_0xc9ec('0x2c')],function(_0x531e3a){return{'name':_0x531e3a[_0xc9ec('0x2d')],'type':_0x531e3a[_0xc9ec('0x2e')]['key']};});_0x57a564[_0xc9ec('0x2f')]=_['map'](_0x456faa,_0xc9ec('0x28'));_0x57a564['query']=_[_0xc9ec('0x30')](_0x41499f[_0xc9ec('0x31')]);_0x57a564[_0xc9ec('0x32')]=_[_0xc9ec('0x33')](_0x57a564[_0xc9ec('0x2f')],_0x57a564['query']);_0x4379e7[_0xc9ec('0x34')]=_[_0xc9ec('0x33')](_0x57a564[_0xc9ec('0x2f')],qs[_0xc9ec('0x35')](_0x41499f[_0xc9ec('0x31')][_0xc9ec('0x35')]));_0x4379e7[_0xc9ec('0x34')]=_0x4379e7['attributes'][_0xc9ec('0x36')]?_0x4379e7['attributes']:_0x57a564[_0xc9ec('0x2f')];if(!_0x41499f[_0xc9ec('0x31')][_0xc9ec('0x37')](_0xc9ec('0x38'))){_0x4379e7['limit']=qs[_0xc9ec('0x1d')](_0x41499f[_0xc9ec('0x31')]['limit']);_0x4379e7[_0xc9ec('0x1c')]=qs[_0xc9ec('0x1c')](_0x41499f[_0xc9ec('0x31')][_0xc9ec('0x1c')]);}_0x4379e7[_0xc9ec('0x39')]=qs[_0xc9ec('0x3a')](_0x41499f[_0xc9ec('0x31')][_0xc9ec('0x3a')]);_0x4379e7[_0xc9ec('0x3b')]=qs[_0xc9ec('0x32')](_[_0xc9ec('0x3c')](_0x41499f['query'],_0x57a564['filters']),_0x456faa);if(_0x41499f['query'][_0xc9ec('0x3d')]){_0x4379e7['where']=_[_0xc9ec('0x3e')](_0x4379e7[_0xc9ec('0x3b')],{'$or':_[_0xc9ec('0x2a')](_0x456faa,function(_0x558b86){if(_0x558b86[_0xc9ec('0x2e')]!==_0xc9ec('0x3f')){var _0x27d111={};_0x27d111[_0x558b86['name']]={'$like':'%'+_0x41499f['query'][_0xc9ec('0x3d')]+'%'};return _0x27d111;}})});}_0x4379e7=_['merge']({},_0x4379e7,_0x41499f[_0xc9ec('0x40')]);var _0x32bb53={'where':_0x4379e7['where']};return db[_0xc9ec('0x2b')][_0xc9ec('0x1f')](_0x32bb53)[_0xc9ec('0x25')](function(_0x57258a){_0x5a421e[_0xc9ec('0x1f')]=_0x57258a;if(_0x41499f['query'][_0xc9ec('0x41')]){_0x4379e7[_0xc9ec('0x42')]=[{'all':!![]}];}return db[_0xc9ec('0x2b')][_0xc9ec('0x43')](_0x4379e7);})['then'](function(_0x464922){_0x5a421e[_0xc9ec('0x44')]=_0x464922;return _0x5a421e;})[_0xc9ec('0x25')](respondWithFilteredResult(_0x42dacd,_0x4379e7))[_0xc9ec('0x45')](handleError(_0x42dacd,null));};exports[_0xc9ec('0x46')]=function(_0x171ae0,_0x155feb){var _0x14aa21={'raw':!![],'where':{'id':_0x171ae0[_0xc9ec('0x47')]['id']}},_0x461007={};_0x461007[_0xc9ec('0x2f')]=_[_0xc9ec('0x30')](db[_0xc9ec('0x2b')]['rawAttributes']);_0x461007['query']=_['keys'](_0x171ae0['query']);_0x461007[_0xc9ec('0x32')]=_['intersection'](_0x461007[_0xc9ec('0x2f')],_0x461007[_0xc9ec('0x31')]);_0x14aa21[_0xc9ec('0x34')]=_[_0xc9ec('0x33')](_0x461007[_0xc9ec('0x2f')],qs[_0xc9ec('0x35')](_0x171ae0['query']['fields']));_0x14aa21['attributes']=_0x14aa21[_0xc9ec('0x34')][_0xc9ec('0x36')]?_0x14aa21[_0xc9ec('0x34')]:_0x461007[_0xc9ec('0x2f')];if(_0x171ae0[_0xc9ec('0x31')][_0xc9ec('0x41')]){_0x14aa21['include']=[{'all':!![]}];}_0x14aa21=_['merge']({},_0x14aa21,_0x171ae0[_0xc9ec('0x40')]);return db[_0xc9ec('0x2b')]['find'](_0x14aa21)[_0xc9ec('0x25')](handleEntityNotFound(_0x155feb,null))['then'](respondWithResult(_0x155feb,null))[_0xc9ec('0x45')](handleError(_0x155feb,null));};exports[_0xc9ec('0x48')]=function(_0xff7b31,_0x1815ef){var _0x34ecb8={'where':{'id':_0xff7b31['params']['id']}},_0x551255={};_0x551255['model']=_['keys'](db[_0xc9ec('0x2b')][_0xc9ec('0x2c')]);_0x34ecb8[_0xc9ec('0x34')]=_[_0xc9ec('0x33')](_0x551255['model'],qs[_0xc9ec('0x35')](_0xff7b31[_0xc9ec('0x31')][_0xc9ec('0x35')]));_0x34ecb8[_0xc9ec('0x34')]=_0x34ecb8[_0xc9ec('0x34')]['length']?_0x34ecb8[_0xc9ec('0x34')]:_0x551255[_0xc9ec('0x2f')];if(_0xff7b31[_0xc9ec('0x31')]['includeAll']){_0x34ecb8[_0xc9ec('0x42')]=[{'all':!![]}];}_0x34ecb8=_['merge']({},_0x34ecb8,_0xff7b31[_0xc9ec('0x40')]);return db[_0xc9ec('0x2b')][_0xc9ec('0x49')](_0x34ecb8)[_0xc9ec('0x25')](handleEntityNotFound(_0x1815ef,null))['then'](function(_0x4facf6){if(_0x4facf6){var _0x3f492b=_0x4facf6[_0xc9ec('0x4a')]({'plain':!![]});_0x3f492b=qs[_0xc9ec('0x4b')](_0x3f492b,['id',_0xc9ec('0x4c'),_0xc9ec('0x4d')]);_0xff7b31['body']=_[_0xc9ec('0x4b')](_0xff7b31['body'],['id','createdAt',_0xc9ec('0x4d')]);return db[_0xc9ec('0x2b')]['create'](_[_0xc9ec('0x3e')](_0x3f492b,_0xff7b31['body']),{'include':_0xff7b31[_0xc9ec('0x31')][_0xc9ec('0x41')]?[{'all':!![]}]:undefined});}})[_0xc9ec('0x25')](respondWithResult(_0x1815ef,0xc9))[_0xc9ec('0x45')](handleError(_0x1815ef,null));};exports[_0xc9ec('0x24')]=function(_0x33370c,_0x72f1cc){if(_0x33370c[_0xc9ec('0x4e')]['id']){delete _0x33370c[_0xc9ec('0x4e')]['id'];}return db[_0xc9ec('0x2b')]['find']({'where':{'id':_0x33370c['params']['id']}})[_0xc9ec('0x25')](handleEntityNotFound(_0x72f1cc,null))['then'](saveUpdates(_0x33370c[_0xc9ec('0x4e')],null))[_0xc9ec('0x25')](respondWithResult(_0x72f1cc,null))[_0xc9ec('0x45')](handleError(_0x72f1cc,null));};exports[_0xc9ec('0x4f')]=function(_0x583fa8,_0x3e1eb5){return db[_0xc9ec('0x2b')][_0xc9ec('0x49')]({'where':{'id':_0x583fa8[_0xc9ec('0x47')]['id']}})[_0xc9ec('0x25')](handleEntityNotFound(_0x3e1eb5,null))[_0xc9ec('0x25')](removeEntity(_0x3e1eb5,null))['catch'](handleError(_0x3e1eb5,null));};exports[_0xc9ec('0x50')]=function(_0x5a3838,_0x1b149e,_0x49ffdc){_0x5a3838[_0xc9ec('0x4e')][_0xc9ec('0x28')]=_0x5a3838[_0xc9ec('0x51')]['originalname'];_0x5a3838['body']['basename']=_0x5a3838['file'][_0xc9ec('0x52')];_0x5a3838['body'][_0xc9ec('0x2e')]=_0x5a3838['file'][_0xc9ec('0x53')];return db[_0xc9ec('0x2b')][_0xc9ec('0x50')](_0x5a3838[_0xc9ec('0x4e')])[_0xc9ec('0x25')](respondWithResult(_0x1b149e,0xc9))[_0xc9ec('0x45')](handleError(_0x1b149e,null));};exports[_0xc9ec('0x54')]=function(_0x96ac84,_0xf6cf36,_0x25dbd5){return db[_0xc9ec('0x2b')][_0xc9ec('0x55')]({'where':{'id':_0x96ac84[_0xc9ec('0x47')]['id']},'raw':!![]})[_0xc9ec('0x25')](handleEntityNotFound(_0xf6cf36,null))[_0xc9ec('0x25')](function(_0x3b699d){if(_0x3b699d){var _0x5d1af3=_0x3b699d[_0xc9ec('0x56')]!==null;var _0x2f9fe7=path[_0xc9ec('0x57')](config[_0xc9ec('0x58')],_0xc9ec('0x59'));if(_0x5d1af3){_0x2f9fe7=path[_0xc9ec('0x57')](_0x2f9fe7,'offline-chat/');}var _0x1039eb=path[_0xc9ec('0x57')](_0x2f9fe7,_0x3b699d[_0xc9ec('0x5a')]);return _0xf6cf36[_0xc9ec('0x54')](_0x1039eb);}})['catch'](handleError(_0xf6cf36,null));}; \ No newline at end of file +var _0x3372=['mustache','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','includeAll','include','findAll','rows','catch','params','options','find','clone','get','omit','createdAt','updatedAt','body','create','update','originalname','basename','file','download','join','root','server/files/attachments/','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0x3372,0x9d));var _0x2337=function(_0x335c76,_0x417659){_0x335c76=_0x335c76-0x0;var _0xce558b=_0x3372[_0x335c76];return _0xce558b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2337('0x0'));var jsonpatch=require(_0x2337('0x1'));var rp=require(_0x2337('0x2'));var moment=require(_0x2337('0x3'));var BPromise=require(_0x2337('0x4'));var Mustache=require(_0x2337('0x5'));var util=require('util');var path=require(_0x2337('0x6'));var sox=require(_0x2337('0x7'));var csv=require(_0x2337('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2337('0x9'));var _=require(_0x2337('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2337('0xb'));var toCsv=require(_0x2337('0x8'));var querystring=require(_0x2337('0xc'));var Papa=require(_0x2337('0xd'));var Redis=require(_0x2337('0xe'));var authService=require(_0x2337('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2337('0x10'));var hardwareService=require(_0x2337('0x11'));var logger=require(_0x2337('0x12'))(_0x2337('0x13'));var utils=require('../../config/utils');var config=require(_0x2337('0x14'));var licenseUtil=require(_0x2337('0x15'));var db=require(_0x2337('0x16'))['db'];function respondWithStatusCode(_0x546279,_0x1e005f){_0x1e005f=_0x1e005f||0xcc;return function(_0x1943a3){if(_0x1943a3){return _0x546279['sendStatus'](_0x1e005f);}return _0x546279['status'](_0x1e005f)[_0x2337('0x17')]();};}function respondWithResult(_0x58210a,_0x48d141){_0x48d141=_0x48d141||0xc8;return function(_0x42d16f){if(_0x42d16f){return _0x58210a[_0x2337('0x18')](_0x48d141)[_0x2337('0x19')](_0x42d16f);}};}function respondWithFilteredResult(_0x4e1a81,_0x3e4167){return function(_0x1d3ba2){if(_0x1d3ba2){var _0x2cd7ba=typeof _0x3e4167[_0x2337('0x1a')]===_0x2337('0x1b')&&typeof _0x3e4167[_0x2337('0x1c')]===_0x2337('0x1b');var _0x55ad57=_0x1d3ba2[_0x2337('0x1d')];var _0x3e420c=_0x2cd7ba?0x0:_0x3e4167[_0x2337('0x1a')];var _0x3a59ac=_0x2cd7ba?_0x1d3ba2['count']:_0x3e4167[_0x2337('0x1a')]+_0x3e4167[_0x2337('0x1c')];var _0x548f64;if(_0x3a59ac>=_0x55ad57){_0x3a59ac=_0x55ad57;_0x548f64=0xc8;}else{_0x548f64=0xce;}_0x4e1a81[_0x2337('0x18')](_0x548f64);return _0x4e1a81[_0x2337('0x1e')](_0x2337('0x1f'),_0x3e420c+'-'+_0x3a59ac+'/'+_0x55ad57)[_0x2337('0x19')](_0x1d3ba2);}return null;};}function patchUpdates(_0x10094a){return function(_0x414a28){try{jsonpatch[_0x2337('0x20')](_0x414a28,_0x10094a,!![]);}catch(_0x62ba78){return BPromise[_0x2337('0x21')](_0x62ba78);}return _0x414a28[_0x2337('0x22')]();};}function saveUpdates(_0x26da2b,_0x5b60e8){return function(_0x2a9d4b){if(_0x2a9d4b){return _0x2a9d4b['update'](_0x26da2b)[_0x2337('0x23')](function(_0x4d2a3b){return _0x4d2a3b;});}return null;};}function removeEntity(_0x28e688,_0x34c790){return function(_0x48b3f3){if(_0x48b3f3){return _0x48b3f3[_0x2337('0x24')]()[_0x2337('0x23')](function(){_0x28e688['status'](0xcc)[_0x2337('0x17')]();});}};}function handleEntityNotFound(_0x45aa45,_0x5eb201){return function(_0x42cd3a){if(!_0x42cd3a){_0x45aa45['sendStatus'](0x194);}return _0x42cd3a;};}function handleError(_0xfa8cab,_0x863beb){_0x863beb=_0x863beb||0x1f4;return function(_0x134baa){logger[_0x2337('0x25')](_0x134baa[_0x2337('0x26')]);if(_0x134baa[_0x2337('0x27')]){delete _0x134baa[_0x2337('0x27')];}_0xfa8cab[_0x2337('0x18')](_0x863beb)[_0x2337('0x28')](_0x134baa);};}exports['index']=function(_0x4dc6f7,_0x51f8f5){var _0x5cfddb={},_0x1d664={},_0x188e98={'count':0x0,'rows':[]};var _0x11c4e8=_[_0x2337('0x29')](db[_0x2337('0x2a')][_0x2337('0x2b')],function(_0x1ef4e3){return{'name':_0x1ef4e3[_0x2337('0x2c')],'type':_0x1ef4e3['type']['key']};});_0x1d664[_0x2337('0x2d')]=_['map'](_0x11c4e8,_0x2337('0x27'));_0x1d664[_0x2337('0x2e')]=_[_0x2337('0x2f')](_0x4dc6f7[_0x2337('0x2e')]);_0x1d664[_0x2337('0x30')]=_['intersection'](_0x1d664[_0x2337('0x2d')],_0x1d664[_0x2337('0x2e')]);_0x5cfddb['attributes']=_[_0x2337('0x31')](_0x1d664[_0x2337('0x2d')],qs[_0x2337('0x32')](_0x4dc6f7[_0x2337('0x2e')][_0x2337('0x32')]));_0x5cfddb['attributes']=_0x5cfddb[_0x2337('0x33')][_0x2337('0x34')]?_0x5cfddb[_0x2337('0x33')]:_0x1d664[_0x2337('0x2d')];if(!_0x4dc6f7[_0x2337('0x2e')]['hasOwnProperty'](_0x2337('0x35'))){_0x5cfddb[_0x2337('0x1c')]=qs[_0x2337('0x1c')](_0x4dc6f7[_0x2337('0x2e')][_0x2337('0x1c')]);_0x5cfddb['offset']=qs[_0x2337('0x1a')](_0x4dc6f7['query'][_0x2337('0x1a')]);}_0x5cfddb[_0x2337('0x36')]=qs[_0x2337('0x37')](_0x4dc6f7[_0x2337('0x2e')][_0x2337('0x37')]);_0x5cfddb[_0x2337('0x38')]=qs[_0x2337('0x30')](_['pick'](_0x4dc6f7['query'],_0x1d664[_0x2337('0x30')]),_0x11c4e8);if(_0x4dc6f7[_0x2337('0x2e')]['filter']){_0x5cfddb['where']=_['merge'](_0x5cfddb[_0x2337('0x38')],{'$or':_[_0x2337('0x29')](_0x11c4e8,function(_0x405afb){if(_0x405afb['type']!=='VIRTUAL'){var _0x44a0be={};_0x44a0be[_0x405afb[_0x2337('0x27')]]={'$like':'%'+_0x4dc6f7[_0x2337('0x2e')]['filter']+'%'};return _0x44a0be;}})});}_0x5cfddb=_[_0x2337('0x39')]({},_0x5cfddb,_0x4dc6f7['options']);var _0x4642d2={'where':_0x5cfddb['where']};return db[_0x2337('0x2a')][_0x2337('0x1d')](_0x4642d2)[_0x2337('0x23')](function(_0x14c349){_0x188e98['count']=_0x14c349;if(_0x4dc6f7[_0x2337('0x2e')][_0x2337('0x3a')]){_0x5cfddb[_0x2337('0x3b')]=[{'all':!![]}];}return db[_0x2337('0x2a')][_0x2337('0x3c')](_0x5cfddb);})[_0x2337('0x23')](function(_0x1ef1d2){_0x188e98[_0x2337('0x3d')]=_0x1ef1d2;return _0x188e98;})[_0x2337('0x23')](respondWithFilteredResult(_0x51f8f5,_0x5cfddb))[_0x2337('0x3e')](handleError(_0x51f8f5,null));};exports['show']=function(_0x30eb33,_0xdea8a4){var _0x4e8563={'raw':!![],'where':{'id':_0x30eb33[_0x2337('0x3f')]['id']}},_0xbe5901={};_0xbe5901[_0x2337('0x2d')]=_[_0x2337('0x2f')](db['Attachment']['rawAttributes']);_0xbe5901[_0x2337('0x2e')]=_['keys'](_0x30eb33[_0x2337('0x2e')]);_0xbe5901[_0x2337('0x30')]=_[_0x2337('0x31')](_0xbe5901[_0x2337('0x2d')],_0xbe5901['query']);_0x4e8563[_0x2337('0x33')]=_[_0x2337('0x31')](_0xbe5901[_0x2337('0x2d')],qs['fields'](_0x30eb33['query']['fields']));_0x4e8563[_0x2337('0x33')]=_0x4e8563[_0x2337('0x33')][_0x2337('0x34')]?_0x4e8563[_0x2337('0x33')]:_0xbe5901[_0x2337('0x2d')];if(_0x30eb33[_0x2337('0x2e')][_0x2337('0x3a')]){_0x4e8563['include']=[{'all':!![]}];}_0x4e8563=_[_0x2337('0x39')]({},_0x4e8563,_0x30eb33[_0x2337('0x40')]);return db[_0x2337('0x2a')][_0x2337('0x41')](_0x4e8563)[_0x2337('0x23')](handleEntityNotFound(_0xdea8a4,null))['then'](respondWithResult(_0xdea8a4,null))[_0x2337('0x3e')](handleError(_0xdea8a4,null));};exports[_0x2337('0x42')]=function(_0x440be9,_0x5c5d17){var _0x3cba5c={'where':{'id':_0x440be9[_0x2337('0x3f')]['id']}},_0x23bbd5={};_0x23bbd5['model']=_['keys'](db['Attachment'][_0x2337('0x2b')]);_0x3cba5c[_0x2337('0x33')]=_[_0x2337('0x31')](_0x23bbd5[_0x2337('0x2d')],qs['fields'](_0x440be9['query'][_0x2337('0x32')]));_0x3cba5c[_0x2337('0x33')]=_0x3cba5c[_0x2337('0x33')][_0x2337('0x34')]?_0x3cba5c['attributes']:_0x23bbd5[_0x2337('0x2d')];if(_0x440be9[_0x2337('0x2e')][_0x2337('0x3a')]){_0x3cba5c[_0x2337('0x3b')]=[{'all':!![]}];}_0x3cba5c=_[_0x2337('0x39')]({},_0x3cba5c,_0x440be9['options']);return db[_0x2337('0x2a')]['find'](_0x3cba5c)[_0x2337('0x23')](handleEntityNotFound(_0x5c5d17,null))[_0x2337('0x23')](function(_0x2d1f88){if(_0x2d1f88){var _0x550f80=_0x2d1f88[_0x2337('0x43')]({'plain':!![]});_0x550f80=qs[_0x2337('0x44')](_0x550f80,['id',_0x2337('0x45'),_0x2337('0x46')]);_0x440be9[_0x2337('0x47')]=_[_0x2337('0x44')](_0x440be9[_0x2337('0x47')],['id',_0x2337('0x45'),_0x2337('0x46')]);return db['Attachment'][_0x2337('0x48')](_[_0x2337('0x39')](_0x550f80,_0x440be9[_0x2337('0x47')]),{'include':_0x440be9[_0x2337('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x5c5d17,0xc9))['catch'](handleError(_0x5c5d17,null));};exports[_0x2337('0x49')]=function(_0x472a22,_0x58d584){if(_0x472a22[_0x2337('0x47')]['id']){delete _0x472a22[_0x2337('0x47')]['id'];}return db[_0x2337('0x2a')]['find']({'where':{'id':_0x472a22[_0x2337('0x3f')]['id']}})[_0x2337('0x23')](handleEntityNotFound(_0x58d584,null))[_0x2337('0x23')](saveUpdates(_0x472a22[_0x2337('0x47')],null))[_0x2337('0x23')](respondWithResult(_0x58d584,null))[_0x2337('0x3e')](handleError(_0x58d584,null));};exports[_0x2337('0x24')]=function(_0x4b6976,_0x2fccc9){return db[_0x2337('0x2a')][_0x2337('0x41')]({'where':{'id':_0x4b6976[_0x2337('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2fccc9,null))['then'](removeEntity(_0x2fccc9,null))['catch'](handleError(_0x2fccc9,null));};exports[_0x2337('0x48')]=function(_0x36bed2,_0x26486c,_0xb7b255){_0x36bed2[_0x2337('0x47')][_0x2337('0x27')]=_0x36bed2['file'][_0x2337('0x4a')];_0x36bed2[_0x2337('0x47')][_0x2337('0x4b')]=_0x36bed2[_0x2337('0x4c')]['filename'];_0x36bed2[_0x2337('0x47')]['type']=_0x36bed2['file']['mimetype'];return db[_0x2337('0x2a')][_0x2337('0x48')](_0x36bed2[_0x2337('0x47')])[_0x2337('0x23')](respondWithResult(_0x26486c,0xc9))[_0x2337('0x3e')](handleError(_0x26486c,null));};exports[_0x2337('0x4d')]=function(_0x53e724,_0x513e31,_0x3f1412){return db[_0x2337('0x2a')]['findOne']({'where':{'id':_0x53e724[_0x2337('0x3f')]['id']},'raw':!![]})[_0x2337('0x23')](handleEntityNotFound(_0x513e31,null))[_0x2337('0x23')](function(_0x44b6de){if(_0x44b6de){var _0x7ee385=_0x44b6de['ChatOfflineMessageId']!==null;var _0x57da6e=path[_0x2337('0x4e')](config[_0x2337('0x4f')],_0x2337('0x50'));if(_0x7ee385){_0x57da6e=path['join'](_0x57da6e,'offline-chat/');}var _0x30d01f=path[_0x2337('0x4e')](_0x57da6e,_0x44b6de[_0x2337('0x4b')]);return _0x513e31[_0x2337('0x4d')](_0x30d01f);}})[_0x2337('0x3e')](handleError(_0x513e31,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 808a643..94f2b2a 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 _0xa561=['Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x4c9a7d,_0x386611){var _0x2f7fb9=function(_0x2c9fcc){while(--_0x2c9fcc){_0x4c9a7d['push'](_0x4c9a7d['shift']());}};_0x2f7fb9(++_0x386611);}(_0xa561,0xaa));var _0x1a56=function(_0x236a9b,_0x430d06){_0x236a9b=_0x236a9b-0x0;var _0x209d9e=_0xa561[_0x236a9b];return _0x209d9e;};'use strict';var _=require(_0x1a56('0x0'));var util=require(_0x1a56('0x1'));var logger=require(_0x1a56('0x2'))(_0x1a56('0x3'));var moment=require(_0x1a56('0x4'));var BPromise=require(_0x1a56('0x5'));var rp=require(_0x1a56('0x6'));var fs=require('fs');var path=require(_0x1a56('0x7'));var rimraf=require(_0x1a56('0x8'));var config=require(_0x1a56('0x9'));var attributes=require(_0x1a56('0xa'));module['exports']=function(_0x5b8f21,_0x3c00ff){return _0x5b8f21[_0x1a56('0xb')](_0x1a56('0xc'),attributes,{'tableName':_0x1a56('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfbf=['moment','request-promise','path','../../config/environment','./attachment.attributes','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfbf,0xcd));var _0xfcfb=function(_0x989a9f,_0x45a537){_0x989a9f=_0x989a9f-0x0;var _0x3d4cbf=_0xcfbf[_0x989a9f];return _0x3d4cbf;};'use strict';var _=require(_0xfcfb('0x0'));var util=require(_0xfcfb('0x1'));var logger=require(_0xfcfb('0x2'))(_0xfcfb('0x3'));var moment=require(_0xfcfb('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcfb('0x5'));var fs=require('fs');var path=require(_0xfcfb('0x6'));var rimraf=require('rimraf');var config=require(_0xfcfb('0x7'));var attributes=require(_0xfcfb('0x8'));module['exports']=function(_0x2e7487,_0x2b26b4){return _0x2e7487['define'](_0xfcfb('0x9'),attributes,{'tableName':_0xfcfb('0xa'),'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 623dfd4..7986ca8 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 _0x4058=['request','then','info','request\x20sent','debug','stringify','Attachment,\x20%s,\x20%s','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0x4058,0x129));var _0x8405=function(_0x3628db,_0x38e034){_0x3628db=_0x3628db-0x0;var _0xf62fab=_0x4058[_0x3628db];return _0xf62fab;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var moment=require(_0x8405('0x2'));var BPromise=require(_0x8405('0x3'));var rs=require(_0x8405('0x4'));var fs=require('fs');var Redis=require(_0x8405('0x5'));var db=require(_0x8405('0x6'))['db'];var utils=require(_0x8405('0x7'));var logger=require(_0x8405('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8405('0x9')][_0x8405('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d9bf6,_0x1322e5,_0x1cb061){return new BPromise(function(_0x479c97,_0x16d810){return client[_0x8405('0xb')](_0x3d9bf6,_0x1cb061)[_0x8405('0xc')](function(_0x53bd7c){logger[_0x8405('0xd')]('Attachment,\x20%s,\x20%s',_0x1322e5,_0x8405('0xe'));logger[_0x8405('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1322e5,_0x8405('0xe'),JSON[_0x8405('0x10')](_0x53bd7c));if(_0x53bd7c['error']){if(_0x53bd7c['error']['code']===0x1f4){logger['error'](_0x8405('0x11'),_0x1322e5,_0x53bd7c['error']['message']);return _0x16d810(_0x53bd7c['error']['message']);}logger['error'](_0x8405('0x11'),_0x1322e5,_0x53bd7c[_0x8405('0x12')]['message']);return _0x479c97(_0x53bd7c[_0x8405('0x12')][_0x8405('0x13')]);}else{logger[_0x8405('0xd')](_0x8405('0x11'),_0x1322e5,'request\x20sent');_0x479c97(_0x53bd7c[_0x8405('0x14')][_0x8405('0x13')]);}})[_0x8405('0x15')](function(_0x30cef7){logger[_0x8405('0x12')](_0x8405('0x11'),_0x1322e5,_0x30cef7);_0x16d810(_0x30cef7);});});}exports[_0x8405('0x16')]=function(_0x358633){var _0x30a506=this;return new Promise(function(_0x1e608f,_0x34c79c){return db[_0x8405('0x17')][_0x8405('0x18')](_0x358633[_0x8405('0x19')],{'raw':_0x358633[_0x8405('0x1a')]?_0x358633[_0x8405('0x1a')][_0x8405('0x1b')]===undefined?!![]:![]:!![]})[_0x8405('0xc')](function(_0x2483ab){logger[_0x8405('0xd')](_0x8405('0x16'),_0x358633);logger[_0x8405('0xf')](_0x8405('0x16'),_0x358633,JSON[_0x8405('0x10')](_0x2483ab));_0x1e608f(_0x2483ab);})[_0x8405('0x15')](function(_0x1e8d08){logger['error']('CreateAttachment',_0x1e8d08[_0x8405('0x13')],_0x358633);_0x34c79c(_0x30a506[_0x8405('0x12')](0x1f4,_0x1e8d08[_0x8405('0x13')]));});});}; \ No newline at end of file +var _0x6ddd=['bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','CreateAttachment','moment'];(function(_0x1f7bc7,_0x58ac4a){var _0x2d4aa8=function(_0x2fa336){while(--_0x2fa336){_0x1f7bc7['push'](_0x1f7bc7['shift']());}};_0x2d4aa8(++_0x58ac4a);}(_0x6ddd,0xae));var _0xd6dd=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6ddd[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6dd('0x0'));var BPromise=require(_0xd6dd('0x1'));var rs=require(_0xd6dd('0x2'));var fs=require('fs');var Redis=require(_0xd6dd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6dd('0x4'));var logger=require('../../config/logger')(_0xd6dd('0x5'));var config=require('../../config/environment');var jayson=require(_0xd6dd('0x6'));var client=jayson[_0xd6dd('0x7')][_0xd6dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49d412,_0x402dee,_0x1f0c46){return new BPromise(function(_0x12f605,_0x229a81){return client['request'](_0x49d412,_0x1f0c46)[_0xd6dd('0x9')](function(_0x1f5d7a){logger[_0xd6dd('0xa')](_0xd6dd('0xb'),_0x402dee,_0xd6dd('0xc'));logger[_0xd6dd('0xd')](_0xd6dd('0xe'),_0x402dee,_0xd6dd('0xc'),JSON[_0xd6dd('0xf')](_0x1f5d7a));if(_0x1f5d7a[_0xd6dd('0x10')]){if(_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x11')]===0x1f4){logger['error'](_0xd6dd('0xb'),_0x402dee,_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x12')]);return _0x229a81(_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x12')]);}logger[_0xd6dd('0x10')](_0xd6dd('0xb'),_0x402dee,_0x1f5d7a['error'][_0xd6dd('0x12')]);return _0x12f605(_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x12')]);}else{logger[_0xd6dd('0xa')](_0xd6dd('0xb'),_0x402dee,_0xd6dd('0xc'));_0x12f605(_0x1f5d7a[_0xd6dd('0x13')][_0xd6dd('0x12')]);}})[_0xd6dd('0x14')](function(_0xbce865){logger[_0xd6dd('0x10')](_0xd6dd('0xb'),_0x402dee,_0xbce865);_0x229a81(_0xbce865);});});}exports['CreateAttachment']=function(_0x254fb9){var _0x365abc=this;return new Promise(function(_0x3941d3,_0xc65e92){return db['Attachment']['create'](_0x254fb9[_0xd6dd('0x15')],{'raw':_0x254fb9[_0xd6dd('0x16')]?_0x254fb9['options'][_0xd6dd('0x17')]===undefined?!![]:![]:!![]})[_0xd6dd('0x9')](function(_0x4f27dd){logger[_0xd6dd('0xa')](_0xd6dd('0x18'),_0x254fb9);logger[_0xd6dd('0xd')]('CreateAttachment',_0x254fb9,JSON[_0xd6dd('0xf')](_0x4f27dd));_0x3941d3(_0x4f27dd);})[_0xd6dd('0x14')](function(_0x2acc65){logger['error'](_0xd6dd('0x18'),_0x2acc65[_0xd6dd('0x12')],_0x254fb9);_0xc65e92(_0x365abc[_0xd6dd('0x10')](0x1f4,_0x2acc65[_0xd6dd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 44dd65f..de80bc9 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(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x131205,_0x57575c){_0x131205=_0x131205-0x0;var _0x305300=_0x0b0e[_0x131205];return _0x305300;};'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(_0x17a40f,_0x38032b){var _0x8312c9=function(_0x662968){while(--_0x662968){_0x17a40f['push'](_0x17a40f['shift']());}};_0x8312c9(++_0x38032b);}(_0x757a,0xde));var _0xa757=function(_0x1f4b23,_0x2242a6){_0x1f4b23=_0x1f4b23-0x0;var _0x514fce=_0x757a[_0x1f4b23];return _0x514fce;};'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 e5ec213..00a40ee 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 _0x966f=['disabled','blocked','online','admin','user','agent','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','User','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/logger','undefined','baseDN','url','activedirectory','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role'];(function(_0x39c2a7,_0x586289){var _0x48653d=function(_0x3fcf3b){while(--_0x3fcf3b){_0x39c2a7['push'](_0x39c2a7['shift']());}};_0x48653d(++_0x586289);}(_0x966f,0x6d));var _0xf966=function(_0x3b0716,_0x194d62){_0x3b0716=_0x3b0716-0x0;var _0x30fe1f=_0x966f[_0x3b0716];return _0x30fe1f;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xf966('0x0'));var ActiveDirectory=require(_0xf966('0x1'));var BPromise=require(_0xf966('0x2'));var util=require('util');var db=require(_0xf966('0x3'))['db'];var authService=require(_0xf966('0x4'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0xf966('0x5'))('api');function isActiveDirectoryConfigured(_0x116fcc){var _0x2d36a0=![];if(typeof _0x116fcc['activedirectory']!==_0xf966('0x6')){_0x2d36a0=_0x116fcc['activedirectory'][_0xf966('0x7')]&&_0x116fcc['activedirectory'][_0xf966('0x8')]&&_0x116fcc[_0xf966('0x9')][_0xf966('0xa')];}return _0x2d36a0;}function adAuthenticate(_0x3254bf,_0x31d961,_0x535cac){return new BPromise(function(_0x390389,_0x45be29){try{var _0x316b7b=new ActiveDirectory(_0x3254bf);_0x316b7b[_0xf966('0xb')](_0x31d961,_0x535cac,function(_0x558dc0,_0x34f938){if(_0x558dc0){logger[_0xf966('0xc')](_0xf966('0xd'),_0x31d961,util['inspect'](_0x558dc0,{'showHidden':![],'depth':null}));_0x45be29('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x34f938){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x31d961);_0x45be29('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x390389(_0x34f938);}});}catch(_0x13267f){_0x45be29(_0x13267f);}});}function ActiveDirectoryAuthenticate(_0x5d01a3,_0x338af9,_0x3984c3,_0x543f74){var _0x586109,_0x28566a;if(!isActiveDirectoryConfigured(config)){logger[_0xf966('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x338af9);return _0x543f74(null,![],{'message':_0xf966('0xe')});}return db[_0xf966('0xf')][_0xf966('0x10')]({'where':{'id':0x1},'attributes':[_0xf966('0x11'),'blockDuration'],'raw':!![]})[_0xf966('0x12')](function(_0x49f905){_0x586109=_0x49f905;if(!_0x586109[_0xf966('0x11')]){logger[_0xf966('0xc')](_0xf966('0x13'),_0x338af9);throw new Error(_0xf966('0xe'));}return _0x5d01a3[_0xf966('0x10')]({'attributes':['id',_0xf966('0x14'),_0xf966('0x15'),'salt',_0xf966('0x16'),_0xf966('0x17'),_0xf966('0x18'),'blockedAt',_0xf966('0x19')],'where':{'name':_0x338af9,'role':{'$or':[_0xf966('0x1a'),_0xf966('0x1b'),_0xf966('0x1c')]},'adSsoEnabled':!![]}});})[_0xf966('0x12')](function(_0x1a109a){if(!_0x1a109a||_0x1a109a&&_0x1a109a[_0xf966('0x14')]!==_0x338af9){throw new Error(_0xf966('0xe'));}_0x28566a=_0x1a109a;var _0x4c6fc2=_0x28566a[_0xf966('0x14')]+'@'+config[_0xf966('0x9')][_0xf966('0xa')];return adAuthenticate(config[_0xf966('0x9')],_0x4c6fc2,_0x3984c3);})[_0xf966('0x12')](function(_0x5d5f4d){if(_0x28566a[_0xf966('0x17')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x586109[_0xf966('0x1d')]>0x0){if(_0x28566a[_0xf966('0x18')]){if(moment(_0x28566a[_0xf966('0x1e')])[_0xf966('0x1f')](_0x586109[_0xf966('0x1d')],_0xf966('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xf966('0x21')](_0x28566a,0x0,![],null)[_0xf966('0x12')](function(){return utils['getLicense'](_0x28566a);})[_0xf966('0x12')](function(){return _0x543f74(null,_0x28566a);});}else{return utils[_0xf966('0x22')](_0x28566a)[_0xf966('0x12')](function(){return _0x543f74(null,_0x28566a);});}}else{return utils[_0xf966('0x22')](_0x28566a)[_0xf966('0x12')](function(){return _0x543f74(null,_0x28566a);});}})[_0xf966('0x23')](function(_0x4c8a46){return _0x543f74(null,![],_0x4c8a46);});}function handleError(_0x5be111,_0xdad0a0,_0x536255){return _0x5be111[_0xf966('0x24')](_0xdad0a0||0x1f4)[_0xf966('0x25')]({'message':_0x536255?_0x536255[_0xf966('0x26')]||_0x536255:''});}exports[_0xf966('0x27')]=function(_0x445dd9,_0x4a3dea,_0xb799b){passport[_0xf966('0xb')](_0xf966('0x28'),function(_0x4c7b9d,_0xb8affc,_0x288436){var _0xee3a7b=_0x4c7b9d||_0x288436;if(_0xee3a7b){return handleError(_0x4a3dea,0x191,_0xee3a7b);}if(!_0xb8affc){return handleError(_0x4a3dea,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5628d5={'payload':{'id':_0xb8affc['id'],'role':_0xb8affc[_0xf966('0x16')]},'options':{'expiresIn':0x15180}};return authService[_0xf966('0x29')](_0x5628d5)[_0xf966('0x12')](function(_0x350b5b){_0x4a3dea[_0xf966('0x2a')]({'id':_0xb8affc['id'],'token':_0x350b5b,'statusCall':'','isAlreadyLogged':_0xb8affc[_0xf966('0x19')]});});}})(_0x445dd9,_0x4a3dea,_0xb799b);};passport['use'](_0xf966('0x28'),new LocalStrategy({'usernameField':_0xf966('0x14'),'passwordField':'password'},function(_0x1c1afc,_0x230f0b,_0x4f2c9f){return ActiveDirectoryAuthenticate(db[_0xf966('0x2b')],_0x1c1afc,_0x230f0b,_0x4f2c9f);})); \ No newline at end of file +var _0x71fd=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','disabled','blocked','blockedAt','admin','user','agent','domain','add','minutes','getLicense','catch','send','message','login','signToken','online','use','ad-login','User','passport-local','moment','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x71fd,0x1c1));var _0xd71f=function(_0x426076,_0xfdf5d2){_0x426076=_0x426076-0x0;var _0x1e9565=_0x71fd[_0x426076];return _0x1e9565;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xd71f('0x0'))['Strategy'];var moment=require(_0xd71f('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xd71f('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0xd71f('0x3'));var utils=require(_0xd71f('0x4'));var config=require(_0xd71f('0x5'));var logger=require(_0xd71f('0x6'))(_0xd71f('0x7'));function isActiveDirectoryConfigured(_0x2be03c){var _0x44073b=![];if(typeof _0x2be03c[_0xd71f('0x8')]!==_0xd71f('0x9')){_0x44073b=_0x2be03c['activedirectory']['baseDN']&&_0x2be03c['activedirectory']['url']&&_0x2be03c[_0xd71f('0x8')]['domain'];}return _0x44073b;}function adAuthenticate(_0x347f92,_0x27be32,_0x1d2ad0){return new BPromise(function(_0x3b4781,_0x5f2ccf){try{var _0xb68675=new ActiveDirectory(_0x347f92);_0xb68675['authenticate'](_0x27be32,_0x1d2ad0,function(_0x19e2f5,_0xcd5619){if(_0x19e2f5){logger[_0xd71f('0xa')]('Error\x20authenticate\x20%s:\x20%s',_0x27be32,util[_0xd71f('0xb')](_0x19e2f5,{'showHidden':![],'depth':null}));_0x5f2ccf(_0xd71f('0xc'));}else if(!_0xcd5619){logger['error'](_0xd71f('0xd'),_0x27be32);_0x5f2ccf(_0xd71f('0xc'));}else{_0x3b4781(_0xcd5619);}});}catch(_0x3672d7){_0x5f2ccf(_0x3672d7);}});}function ActiveDirectoryAuthenticate(_0x48f224,_0x1a571a,_0x970cc6,_0x223177){var _0x39c85e,_0x13cecd;if(!isActiveDirectoryConfigured(config)){logger[_0xd71f('0xa')](_0xd71f('0xe'),_0x1a571a);return _0x223177(null,![],{'message':_0xd71f('0xc')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xd71f('0xf'),_0xd71f('0x10')],'raw':!![]})[_0xd71f('0x11')](function(_0x5db4a0){_0x39c85e=_0x5db4a0;if(!_0x39c85e[_0xd71f('0xf')]){logger['error'](_0xd71f('0x12'),_0x1a571a);throw new Error(_0xd71f('0xc'));}return _0x48f224[_0xd71f('0x13')]({'attributes':['id',_0xd71f('0x14'),_0xd71f('0x15'),'salt',_0xd71f('0x16'),_0xd71f('0x17'),_0xd71f('0x18'),_0xd71f('0x19'),'online'],'where':{'name':_0x1a571a,'role':{'$or':[_0xd71f('0x1a'),_0xd71f('0x1b'),_0xd71f('0x1c')]},'adSsoEnabled':!![]}});})[_0xd71f('0x11')](function(_0x33013e){if(!_0x33013e||_0x33013e&&_0x33013e['name']!==_0x1a571a){throw new Error(_0xd71f('0xc'));}_0x13cecd=_0x33013e;var _0x1fc148=_0x13cecd['name']+'@'+config['activedirectory'][_0xd71f('0x1d')];return adAuthenticate(config['activedirectory'],_0x1fc148,_0x970cc6);})[_0xd71f('0x11')](function(_0xdec4bd){if(_0x13cecd[_0xd71f('0x17')]){throw new Error(_0xd71f('0xc'));}if(_0x39c85e[_0xd71f('0x10')]>0x0){if(_0x13cecd[_0xd71f('0x18')]){if(moment(_0x13cecd[_0xd71f('0x19')])[_0xd71f('0x1e')](_0x39c85e['blockDuration'],_0xd71f('0x1f'))>moment()){throw new Error(_0xd71f('0xc'));}return utils['clearBlockUser'](_0x13cecd,0x0,![],null)['then'](function(){return utils[_0xd71f('0x20')](_0x13cecd);})['then'](function(){return _0x223177(null,_0x13cecd);});}else{return utils['getLicense'](_0x13cecd)[_0xd71f('0x11')](function(){return _0x223177(null,_0x13cecd);});}}else{return utils[_0xd71f('0x20')](_0x13cecd)[_0xd71f('0x11')](function(){return _0x223177(null,_0x13cecd);});}})[_0xd71f('0x21')](function(_0x199893){return _0x223177(null,![],_0x199893);});}function handleError(_0x2215fe,_0x4f2a5a,_0x5883c3){return _0x2215fe['status'](_0x4f2a5a||0x1f4)[_0xd71f('0x22')]({'message':_0x5883c3?_0x5883c3[_0xd71f('0x23')]||_0x5883c3:''});}exports[_0xd71f('0x24')]=function(_0x2eb63d,_0x4920b3,_0x597948){passport['authenticate']('ad-login',function(_0x4153a9,_0x397001,_0x2c9005){var _0x5ccd04=_0x4153a9||_0x2c9005;if(_0x5ccd04){return handleError(_0x4920b3,0x191,_0x5ccd04);}if(!_0x397001){return handleError(_0x4920b3,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x71403c={'payload':{'id':_0x397001['id'],'role':_0x397001['role']},'options':{'expiresIn':0x15180}};return authService[_0xd71f('0x25')](_0x71403c)[_0xd71f('0x11')](function(_0x5e2aa7){_0x4920b3['json']({'id':_0x397001['id'],'token':_0x5e2aa7,'statusCall':'','isAlreadyLogged':_0x397001[_0xd71f('0x26')]});});}})(_0x2eb63d,_0x4920b3,_0x597948);};passport[_0xd71f('0x27')](_0xd71f('0x28'),new LocalStrategy({'usernameField':_0xd71f('0x14'),'passwordField':_0xd71f('0x15')},function(_0x3661bb,_0x163b00,_0x2e75ea){return ActiveDirectoryAuthenticate(db[_0xd71f('0x29')],_0x3661bb,_0x163b00,_0x2e75ea);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 038f9c4..8460cb2 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 _0x7325=['post','express','Router','./authActiveDirectory.controller'];(function(_0x2234c1,_0x15c4eb){var _0x3bdec3=function(_0x77810){while(--_0x77810){_0x2234c1['push'](_0x2234c1['shift']());}};_0x3bdec3(++_0x15c4eb);}(_0x7325,0x169));var _0x5732=function(_0x40867a,_0x4900af){_0x40867a=_0x40867a-0x0;var _0x1ce5c1=_0x7325[_0x40867a];return _0x1ce5c1;};'use strict';var express=require(_0x5732('0x0'));var router=express[_0x5732('0x1')]();var controller=require(_0x5732('0x2'));router[_0x5732('0x3')]('/',controller['login']);module['exports']=router; \ No newline at end of file +var _0x9e1e=['Router','./authActiveDirectory.controller','post','login','express'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x9e1e,0x1f3));var _0xe9e1=function(_0x19cedb,_0x1485f8){_0x19cedb=_0x19cedb-0x0;var _0x573c41=_0x9e1e[_0x19cedb];return _0x573c41;};'use strict';var express=require(_0xe9e1('0x0'));var router=express[_0xe9e1('0x1')]();var controller=require(_0xe9e1('0x2'));router[_0xe9e1('0x3')]('/',controller[_0xe9e1('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index cbf39b2..b1d48cd 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(_0x7ad796,_0x2e8606){var _0x392371=function(_0xa4d4e0){while(--_0xa4d4e0){_0x7ad796['push'](_0x7ad796['shift']());}};_0x392371(++_0x2e8606);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(_0x482598,_0x54c1cf){var _0x4c9aae=function(_0xd8a837){while(--_0xd8a837){_0x482598['push'](_0x482598['shift']());}};_0x4c9aae(++_0x54c1cf);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 7c54114..9cd99e9 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 _0x7839=['../../components/auth/service','get','login','/callback','callback','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x2417f9,_0x803ba4){var _0x142d82=function(_0xd430d1){while(--_0xd430d1){_0x2417f9['push'](_0x2417f9['shift']());}};_0x142d82(++_0x803ba4);}(_0x7839,0xa0));var _0x9783=function(_0x477ab0,_0x277e88){_0x477ab0=_0x477ab0-0x0;var _0x4fdf77=_0x7839[_0x477ab0];return _0x4fdf77;};'use strict';var express=require(_0x9783('0x0'));var passport=require(_0x9783('0x1'));var router=express[_0x9783('0x2')]();var controller=require(_0x9783('0x3'));var userController=require(_0x9783('0x4'));var authService=require(_0x9783('0x5'));router[_0x9783('0x6')]('/',controller[_0x9783('0x7')]);router[_0x9783('0x6')](_0x9783('0x8'),controller[_0x9783('0x9')],authService['isMiddleware'],userController[_0x9783('0x7')],authService['setTokenCookie']);module[_0x9783('0xa')]=router; \ No newline at end of file +var _0x970a=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x2bf4e5,_0x4784af){var _0x5875be=function(_0x3fff3c){while(--_0x3fff3c){_0x2bf4e5['push'](_0x2bf4e5['shift']());}};_0x5875be(++_0x4784af);}(_0x970a,0xee));var _0xa970=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x970a[_0x172133];return _0x2460e5;};'use strict';var express=require(_0xa970('0x0'));var passport=require(_0xa970('0x1'));var router=express[_0xa970('0x2')]();var controller=require(_0xa970('0x3'));var userController=require(_0xa970('0x4'));var authService=require(_0xa970('0x5'));router[_0xa970('0x6')]('/',controller[_0xa970('0x7')]);router[_0xa970('0x6')](_0xa970('0x8'),controller[_0xa970('0x9')],authService[_0xa970('0xa')],userController[_0xa970('0x7')],authService[_0xa970('0xb')]);module[_0xa970('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 064cc01..11e70bb 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 _0xbdad=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','login','local-login','json','online','body','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','Strategy','jayson/promise','lodash','randomstring','moment','client','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user'];(function(_0x202f5f,_0x3ba477){var _0x3157d5=function(_0x278df9){while(--_0x278df9){_0x202f5f['push'](_0x202f5f['shift']());}};_0x3157d5(++_0x3ba477);}(_0xbdad,0x120));var _0xdbda=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbdad[_0xfae23b];return _0x200640;};'use strict';var util=require(_0xdbda('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xdbda('0x1')];var jayson=require(_0xdbda('0x2'));var _=require(_0xdbda('0x3'));var rs=require(_0xdbda('0x4'));var moment=require(_0xdbda('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xdbda('0x6')]['http']({'port':0x232b});function localAuthenticate(_0x9ed0b3,_0x5925ac,_0x5330e2,_0x4075b1){var _0x5624bd,_0x3c1721;return db[_0xdbda('0x7')][_0xdbda('0x8')]({'where':{'id':0x1},'attributes':[_0xdbda('0x9'),'blockDuration'],'raw':!![]})[_0xdbda('0xa')](function(_0x1a6aee){_0x5624bd=_0x1a6aee;return _0x9ed0b3[_0xdbda('0x8')]({'attributes':['id',_0xdbda('0xb'),_0xdbda('0xc'),_0xdbda('0xd'),_0xdbda('0xe'),_0xdbda('0xf'),_0xdbda('0x10'),_0xdbda('0x11'),_0xdbda('0x12')],'where':{'name':_0x5925ac,'role':{'$or':['admin',_0xdbda('0x13'),_0xdbda('0x14')]}}});})[_0xdbda('0xa')](function(_0x291871){if(!_0x291871||_0x291871&&_0x291871['name']!==_0x5925ac){throw new Error(_0xdbda('0x15'));}else{_0x3c1721=_0x291871;return _0x3c1721;}})[_0xdbda('0xa')](function(){_0x3c1721['authenticate'](_0x5330e2,function(_0x5d3a06,_0x2c0c2c){var _0x45c54b=_0x3c1721[_0xdbda('0x12')]+0x1;if(_0x5d3a06){return _0x4075b1(_0x5d3a06);}else if(!_0x2c0c2c){if(_0x3c1721[_0xdbda('0xf')]){return _0x4075b1(null,![],{'message':_0xdbda('0x15')});}else if(_0x5624bd[_0xdbda('0x9')]>0x0){if(_0x3c1721[_0xdbda('0x10')]){if(_0x5624bd[_0xdbda('0x16')]>0x0){if(moment(_0x3c1721[_0xdbda('0x11')])['add'](_0x5624bd['blockDuration'],'minutes')>moment()){return _0x4075b1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xdbda('0x17')](_0x3c1721,_0x45c54b,![],null)[_0xdbda('0xa')](function(){return _0x4075b1(null,![],{'message':_0xdbda('0x15')});});}}else{return _0x4075b1(null,![],{'message':_0xdbda('0x15')});}}else{if(_0x45c54b>=_0x5624bd[_0xdbda('0x9')]){return utils[_0xdbda('0x17')](_0x3c1721,0x0,!![],moment())['then'](function(){return _0x4075b1(null,![],{'message':_0xdbda('0x15')});});}else{return utils[_0xdbda('0x17')](_0x3c1721,_0x45c54b,![],null)[_0xdbda('0xa')](function(){return _0x4075b1(null,![],{'message':_0xdbda('0x15')});});}}}else{return _0x4075b1(null,![],{'message':_0xdbda('0x15')});}}else{if(_0x3c1721[_0xdbda('0xf')]){return _0x4075b1(null,![],{'message':_0xdbda('0x15')});}else if(_0x5624bd['allowedLoginAttempts']>0x0){if(_0x3c1721[_0xdbda('0x10')]){if(_0x5624bd['blockDuration']>0x0){if(moment(_0x3c1721[_0xdbda('0x11')])['add'](_0x5624bd[_0xdbda('0x16')],_0xdbda('0x18'))>moment()){return _0x4075b1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3c1721,0x0,![],null)[_0xdbda('0xa')](function(){return utils[_0xdbda('0x19')](_0x3c1721);})[_0xdbda('0xa')](function(){return _0x4075b1(null,_0x3c1721);});}}else{return _0x4075b1(null,![],{'message':_0xdbda('0x15')});}}else{return utils[_0xdbda('0x17')](_0x3c1721,0x0,![],null)[_0xdbda('0xa')](function(){return utils['getLicense'](_0x3c1721);})[_0xdbda('0xa')](function(){return _0x4075b1(null,_0x3c1721);})[_0xdbda('0x1a')](function(_0x39e657){return _0x4075b1(null,![],_0x39e657);});}}else{if(_0x3c1721[_0xdbda('0x10')]){return _0x4075b1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x3c1721)[_0xdbda('0xa')](function(){return _0x4075b1(null,_0x3c1721);});}}}});})[_0xdbda('0x1a')](function(_0xa0282d){return _0x4075b1(null,![],_0xa0282d);});}function sendServiceMail(_0x3c62db){return db[_0xdbda('0x1b')][_0xdbda('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xdbda('0xb'),_0xdbda('0x1d')],'include':[{'model':db[_0xdbda('0x1e')],'as':'Smtp','include':[{'model':db[_0xdbda('0x1f')],'as':_0xdbda('0x1f')}]}]})['then'](function(_0x1e8eba){if(!_0x1e8eba){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1e35f=_0x1e8eba[_0xdbda('0x20')]();var _0x4605c3={'account':_0x1e35f,'message':_[_0xdbda('0x21')]({'from':util[_0xdbda('0x22')](_0xdbda('0x23'),_0x1e8eba[_0xdbda('0xb')],_0x1e8eba['email']||_0x1e8eba[_0xdbda('0x24')][_0xdbda('0x13')])},_0x3c62db)};return client[_0xdbda('0x25')](_0xdbda('0x26'),_0x4605c3);})[_0xdbda('0xa')](function(_0x38e11f){if(_0x38e11f['error']){throw new Error(util[_0xdbda('0x22')](_0xdbda('0x27'),_0x38e11f[_0xdbda('0x28')][_0xdbda('0x29')]||JSON['stringify'](_0x38e11f[_0xdbda('0x28')])));}return!![];});}function handleError(_0x23fde2,_0x6fe001,_0x5e0563){return _0x23fde2[_0xdbda('0x2a')](_0x6fe001||0x1f4)['send']({'message':_0x5e0563?_0x5e0563[_0xdbda('0x29')]||_0x5e0563:''});}exports[_0xdbda('0x2b')]=function(_0x85683a,_0xf99822,_0x1f1a4a){passport['authenticate'](_0xdbda('0x2c'),function(_0x237294,_0x3fd499,_0xe030db){var _0x59ccf0=_0x237294||_0xe030db;if(_0x59ccf0){return handleError(_0xf99822,0x191,_0x59ccf0);}if(!_0x3fd499){return handleError(_0xf99822,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3ea481={'payload':{'id':_0x3fd499['id'],'role':_0x3fd499['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3ea481)[_0xdbda('0xa')](function(_0xb31987){_0xf99822[_0xdbda('0x2d')]({'id':_0x3fd499['id'],'token':_0xb31987,'statusCall':'','isAlreadyLogged':_0x3fd499[_0xdbda('0x2e')]});});}})(_0x85683a,_0xf99822,_0x1f1a4a);};exports['forgot']=function(_0x3fb3d9,_0x256331){if(!_0x3fb3d9[_0xdbda('0x2f')][_0xdbda('0x1d')]){return handleError(_0x256331,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x232470=rs[_0xdbda('0x30')]();_0x3fb3d9[_0xdbda('0x2f')][_0xdbda('0x1d')]=_0x3fb3d9[_0xdbda('0x2f')]['email'][_0xdbda('0x31')]()['toLowerCase']();var _0x26f676;return db[_0xdbda('0x7')][_0xdbda('0x8')]({'where':{'id':0x1},'attributes':[_0xdbda('0x9'),_0xdbda('0x16')],'raw':!![]})['then'](function(_0x23fdb3){_0x26f676=_0x23fdb3;return db['User'][_0xdbda('0x1c')]({'where':{'email':_0x3fb3d9['body']['email']}});})[_0xdbda('0xa')](function(_0x33b6d5){if(!_0x33b6d5){throw new Error(_0xdbda('0x32'));}if(_0x33b6d5['disabled']){throw new Error(_0xdbda('0x33'));}if(_0x33b6d5[_0xdbda('0x10')]){if(moment(_0x33b6d5[_0xdbda('0x11')])['add'](_0x26f676[_0xdbda('0x16')],_0xdbda('0x18'))>moment()){throw new Error(_0xdbda('0x34'));}else{_0x33b6d5['blocked']=![];_0x33b6d5[_0xdbda('0x11')]=null;}}_0x33b6d5[_0xdbda('0x35')]=_0x232470;_0x33b6d5[_0xdbda('0x36')]=Date[_0xdbda('0x37')]()+0x36ee80;return _0x33b6d5['save']();})[_0xdbda('0xa')](function(){return sendServiceMail({'to':_0x3fb3d9['body'][_0xdbda('0x1d')],'subject':_0xdbda('0x38'),'text':_0xdbda('0x39')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xdbda('0x3a')+_0x3fb3d9[_0xdbda('0x3b')][_0xdbda('0x3c')]+'/reset/'+_0x232470+'\x0a\x0a'+_0xdbda('0x3d')});})['then'](function(){_0x256331[_0xdbda('0x2a')](0xc8)['send']({'message':_0xdbda('0x3e')});})[_0xdbda('0x1a')](function(_0x14a00b){return handleError(_0x256331,0x1f4,_0x14a00b);});};exports[_0xdbda('0x3f')]=function(_0x4a0af4,_0x178624){return db[_0xdbda('0x40')][_0xdbda('0x1c')]({'where':{'resetPasswordToken':_0x4a0af4[_0xdbda('0x41')][_0xdbda('0x42')],'resetPasswordExpires':{'$gt':Date[_0xdbda('0x37')]()}}})[_0xdbda('0xa')](function(_0x55b8e1){if(!_0x55b8e1){throw new Error(_0xdbda('0x43'));}return db[_0xdbda('0x7')][_0xdbda('0x8')]({'attributes':['id','securePassword',_0xdbda('0x44'),_0xdbda('0x45')]})['then'](function(_0x269424){if(_0x269424[_0xdbda('0x46')])authService[_0xdbda('0x47')](_0x4a0af4['body'][_0xdbda('0xc')]);if(!_0x269424[_0xdbda('0x44')]||!_0x55b8e1[_0xdbda('0x48')])return _0x55b8e1;authService[_0xdbda('0x49')](_0x4a0af4['body'][_0xdbda('0xc')],_0x55b8e1[_0xdbda('0x48')],_0x269424[_0xdbda('0x45')]);return _0x55b8e1;})[_0xdbda('0xa')](function(){_0x55b8e1[_0xdbda('0xc')]=_0x4a0af4['body'][_0xdbda('0xc')];_0x55b8e1['resetPasswordToken']=null;_0x55b8e1[_0xdbda('0x36')]=null;return _0x55b8e1[_0xdbda('0x4a')]();});})[_0xdbda('0xa')](function(){_0x178624[_0xdbda('0x2a')](0xc8)['send']({'message':_0xdbda('0x4b')});})[_0xdbda('0x1a')](function(_0x6afb65){return handleError(_0x178624,0x1f4,_0x6afb65);});};passport[_0xdbda('0x4c')]('local-login',new LocalStrategy({'usernameField':_0xdbda('0xb'),'passwordField':_0xdbda('0xc')},function(_0x4d04d7,_0x3feef5,_0x4f0140){return localAuthenticate(db[_0xdbda('0x40')],_0x4d04d7,_0x3feef5,_0x4f0140);})); \ No newline at end of file +var _0x899b=['blocked','blockedAt','loginAttempts','user','agent','authenticate','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x899b,0x139));var _0xb899=function(_0x538e73,_0xe25f8b){_0x538e73=_0x538e73-0x0;var _0xdc1e1=_0x899b[_0x538e73];return _0xdc1e1;};'use strict';var util=require(_0xb899('0x0'));var passport=require(_0xb899('0x1'));var LocalStrategy=require(_0xb899('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xb899('0x3'));var moment=require(_0xb899('0x4'));var db=require(_0xb899('0x5'))['db'];var authService=require(_0xb899('0x6'));var utils=require(_0xb899('0x7'));var client=jayson[_0xb899('0x8')][_0xb899('0x9')]({'port':0x232b});function localAuthenticate(_0x17e98f,_0x40ef3b,_0x3bcd3b,_0x23c2eb){var _0x52faa2,_0x4e8f46;return db['Setting'][_0xb899('0xa')]({'where':{'id':0x1},'attributes':[_0xb899('0xb'),_0xb899('0xc')],'raw':!![]})[_0xb899('0xd')](function(_0x23030b){_0x52faa2=_0x23030b;return _0x17e98f['findOne']({'attributes':['id',_0xb899('0xe'),_0xb899('0xf'),_0xb899('0x10'),_0xb899('0x11'),_0xb899('0x12'),_0xb899('0x13'),_0xb899('0x14'),_0xb899('0x15')],'where':{'name':_0x40ef3b,'role':{'$or':['admin',_0xb899('0x16'),_0xb899('0x17')]}}});})[_0xb899('0xd')](function(_0x58d036){if(!_0x58d036||_0x58d036&&_0x58d036[_0xb899('0xe')]!==_0x40ef3b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4e8f46=_0x58d036;return _0x4e8f46;}})[_0xb899('0xd')](function(){_0x4e8f46[_0xb899('0x18')](_0x3bcd3b,function(_0x39fe04,_0x432863){var _0x333e7d=_0x4e8f46[_0xb899('0x15')]+0x1;if(_0x39fe04){return _0x23c2eb(_0x39fe04);}else if(!_0x432863){if(_0x4e8f46[_0xb899('0x12')]){return _0x23c2eb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x52faa2[_0xb899('0xb')]>0x0){if(_0x4e8f46['blocked']){if(_0x52faa2[_0xb899('0xc')]>0x0){if(moment(_0x4e8f46['blockedAt'])['add'](_0x52faa2[_0xb899('0xc')],_0xb899('0x19'))>moment()){return _0x23c2eb(null,![],{'message':_0xb899('0x1a')});}else{return utils[_0xb899('0x1b')](_0x4e8f46,_0x333e7d,![],null)['then'](function(){return _0x23c2eb(null,![],{'message':_0xb899('0x1a')});});}}else{return _0x23c2eb(null,![],{'message':_0xb899('0x1a')});}}else{if(_0x333e7d>=_0x52faa2[_0xb899('0xb')]){return utils[_0xb899('0x1b')](_0x4e8f46,0x0,!![],moment())[_0xb899('0xd')](function(){return _0x23c2eb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xb899('0x1b')](_0x4e8f46,_0x333e7d,![],null)['then'](function(){return _0x23c2eb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x23c2eb(null,![],{'message':_0xb899('0x1a')});}}else{if(_0x4e8f46['disabled']){return _0x23c2eb(null,![],{'message':_0xb899('0x1a')});}else if(_0x52faa2[_0xb899('0xb')]>0x0){if(_0x4e8f46[_0xb899('0x13')]){if(_0x52faa2[_0xb899('0xc')]>0x0){if(moment(_0x4e8f46[_0xb899('0x14')])['add'](_0x52faa2[_0xb899('0xc')],'minutes')>moment()){return _0x23c2eb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x4e8f46,0x0,![],null)[_0xb899('0xd')](function(){return utils[_0xb899('0x1c')](_0x4e8f46);})[_0xb899('0xd')](function(){return _0x23c2eb(null,_0x4e8f46);});}}else{return _0x23c2eb(null,![],{'message':_0xb899('0x1a')});}}else{return utils[_0xb899('0x1b')](_0x4e8f46,0x0,![],null)[_0xb899('0xd')](function(){return utils[_0xb899('0x1c')](_0x4e8f46);})['then'](function(){return _0x23c2eb(null,_0x4e8f46);})[_0xb899('0x1d')](function(_0x4a2cbb){return _0x23c2eb(null,![],_0x4a2cbb);});}}else{if(_0x4e8f46['blocked']){return _0x23c2eb(null,![],{'message':_0xb899('0x1a')});}else{return utils[_0xb899('0x1c')](_0x4e8f46)[_0xb899('0xd')](function(){return _0x23c2eb(null,_0x4e8f46);});}}}});})['catch'](function(_0x410663){return _0x23c2eb(null,![],_0x410663);});}function sendServiceMail(_0x4350a1){return db[_0xb899('0x1e')][_0xb899('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xb899('0xe'),'email'],'include':[{'model':db[_0xb899('0x20')],'as':_0xb899('0x21'),'include':[{'model':db['CloudProvider'],'as':_0xb899('0x22')}]}]})[_0xb899('0xd')](function(_0x55bf05){if(!_0x55bf05){throw new Error(_0xb899('0x23'));}var _0x236ae9=_0x55bf05[_0xb899('0x24')]();var _0x5c4788={'account':_0x236ae9,'message':_[_0xb899('0x25')]({'from':util[_0xb899('0x26')]('\x22%s\x22\x20<%s>',_0x55bf05[_0xb899('0xe')],_0x55bf05[_0xb899('0x27')]||_0x55bf05[_0xb899('0x21')][_0xb899('0x16')])},_0x4350a1)};return client[_0xb899('0x28')](_0xb899('0x29'),_0x5c4788);})[_0xb899('0xd')](function(_0x1a18ab){if(_0x1a18ab[_0xb899('0x2a')]){throw new Error(util['format'](_0xb899('0x2b'),_0x1a18ab[_0xb899('0x2a')][_0xb899('0x2c')]||JSON['stringify'](_0x1a18ab[_0xb899('0x2a')])));}return!![];});}function handleError(_0x4724e5,_0x2a9bb1,_0x2dfcb8){return _0x4724e5[_0xb899('0x2d')](_0x2a9bb1||0x1f4)[_0xb899('0x2e')]({'message':_0x2dfcb8?_0x2dfcb8[_0xb899('0x2c')]||_0x2dfcb8:''});}exports[_0xb899('0x2f')]=function(_0x3b6481,_0x4ed535,_0x4984ef){passport[_0xb899('0x18')](_0xb899('0x30'),function(_0x5b7473,_0x10a086,_0x16cea7){var _0x434679=_0x5b7473||_0x16cea7;if(_0x434679){return handleError(_0x4ed535,0x191,_0x434679);}if(!_0x10a086){return handleError(_0x4ed535,0x194,{'message':_0xb899('0x31')});}else{var _0x7e57e8={'payload':{'id':_0x10a086['id'],'role':_0x10a086[_0xb899('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xb899('0x32')](_0x7e57e8)[_0xb899('0xd')](function(_0x58aea9){_0x4ed535[_0xb899('0x33')]({'id':_0x10a086['id'],'token':_0x58aea9,'statusCall':'','isAlreadyLogged':_0x10a086['online']});});}})(_0x3b6481,_0x4ed535,_0x4984ef);};exports[_0xb899('0x34')]=function(_0x505350,_0x9db60a){if(!_0x505350[_0xb899('0x35')][_0xb899('0x27')]){return handleError(_0x9db60a,0x1f4,{'message':_0xb899('0x36')});}var _0x123efb=rs[_0xb899('0x37')]();_0x505350[_0xb899('0x35')][_0xb899('0x27')]=_0x505350[_0xb899('0x35')]['email'][_0xb899('0x38')]()['toLowerCase']();var _0x272b37;return db[_0xb899('0x39')][_0xb899('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb899('0xc')],'raw':!![]})[_0xb899('0xd')](function(_0x3612e4){_0x272b37=_0x3612e4;return db[_0xb899('0x3a')][_0xb899('0x1f')]({'where':{'email':_0x505350[_0xb899('0x35')][_0xb899('0x27')]}});})[_0xb899('0xd')](function(_0x262c08){if(!_0x262c08){throw new Error(_0xb899('0x3b'));}if(_0x262c08['disabled']){throw new Error(_0xb899('0x3c'));}if(_0x262c08[_0xb899('0x13')]){if(moment(_0x262c08[_0xb899('0x14')])[_0xb899('0x3d')](_0x272b37[_0xb899('0xc')],_0xb899('0x19'))>moment()){throw new Error(_0xb899('0x3e'));}else{_0x262c08['blocked']=![];_0x262c08[_0xb899('0x14')]=null;}}_0x262c08[_0xb899('0x3f')]=_0x123efb;_0x262c08[_0xb899('0x40')]=Date[_0xb899('0x41')]()+0x36ee80;return _0x262c08[_0xb899('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x505350['body'][_0xb899('0x27')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'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'+_0xb899('0x43')+_0x505350[_0xb899('0x44')][_0xb899('0x45')]+_0xb899('0x46')+_0x123efb+'\x0a\x0a'+_0xb899('0x47')});})[_0xb899('0xd')](function(){_0x9db60a[_0xb899('0x2d')](0xc8)[_0xb899('0x2e')]({'message':_0xb899('0x48')});})[_0xb899('0x1d')](function(_0xdcdce1){return handleError(_0x9db60a,0x1f4,_0xdcdce1);});};exports[_0xb899('0x49')]=function(_0x4dfb95,_0x5098fd){return db[_0xb899('0x3a')][_0xb899('0x1f')]({'where':{'resetPasswordToken':_0x4dfb95[_0xb899('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x40e7a8){if(!_0x40e7a8){throw new Error(_0xb899('0x4b'));}return db[_0xb899('0x39')][_0xb899('0xa')]({'attributes':['id',_0xb899('0x4c'),_0xb899('0x4d'),_0xb899('0x4e')]})[_0xb899('0xd')](function(_0x24238){if(_0x24238[_0xb899('0x4c')])authService['validatePasswordPattern'](_0x4dfb95['body'][_0xb899('0xf')]);if(!_0x24238[_0xb899('0x4d')]||!_0x40e7a8['previousPasswords'])return _0x40e7a8;authService[_0xb899('0x4f')](_0x4dfb95['body'][_0xb899('0xf')],_0x40e7a8[_0xb899('0x50')],_0x24238[_0xb899('0x4e')]);return _0x40e7a8;})['then'](function(){_0x40e7a8[_0xb899('0xf')]=_0x4dfb95['body'][_0xb899('0xf')];_0x40e7a8[_0xb899('0x3f')]=null;_0x40e7a8[_0xb899('0x40')]=null;return _0x40e7a8['save']();});})['then'](function(){_0x5098fd[_0xb899('0x2d')](0xc8)['send']({'message':_0xb899('0x51')});})[_0xb899('0x1d')](function(_0x3c9988){return handleError(_0x5098fd,0x1f4,_0x3c9988);});};passport[_0xb899('0x52')](_0xb899('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0xb899('0xf')},function(_0x4f5d82,_0x580b79,_0x2684b9){return localAuthenticate(db['User'],_0x4f5d82,_0x580b79,_0x2684b9);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 3b1e7c9..23438c8 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 _0x763c=['forgot','/reset/:token','reset','exports','express','Router','post','/forgot'];(function(_0x4874ae,_0xe1d104){var _0x402527=function(_0x39d683){while(--_0x39d683){_0x4874ae['push'](_0x4874ae['shift']());}};_0x402527(++_0xe1d104);}(_0x763c,0x13c));var _0xc763=function(_0x187309,_0x1f0bc9){_0x187309=_0x187309-0x0;var _0x57dcf1=_0x763c[_0x187309];return _0x57dcf1;};'use strict';var express=require(_0xc763('0x0'));var router=express[_0xc763('0x1')]();var controller=require('./authLocal.controller');router[_0xc763('0x2')]('/',controller['login']);router[_0xc763('0x2')](_0xc763('0x3'),controller[_0xc763('0x4')]);router['post'](_0xc763('0x5'),controller[_0xc763('0x6')]);module[_0xc763('0x7')]=router; \ No newline at end of file +var _0xadd2=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xadd2,0x170));var _0x2add=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xadd2[_0x1cc8fe];return _0x230054;};'use strict';var express=require('express');var router=express[_0x2add('0x0')]();var controller=require(_0x2add('0x1'));router[_0x2add('0x2')]('/',controller[_0x2add('0x3')]);router[_0x2add('0x2')](_0x2add('0x4'),controller[_0x2add('0x5')]);router[_0x2add('0x2')](_0x2add('0x6'),controller['reset']);module[_0x2add('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a2c4037..81f3999 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 _0x5e06=['exports','STRING','BOOLEAN','sequelize'];(function(_0x177d96,_0x3e9f5f){var _0xb125e0=function(_0x18716d){while(--_0x18716d){_0x177d96['push'](_0x177d96['shift']());}};_0xb125e0(++_0x3e9f5f);}(_0x5e06,0xe3));var _0x65e0=function(_0x3624cd,_0x26ef4e){_0x3624cd=_0x3624cd-0x0;var _0x43f35d=_0x5e06[_0x3624cd];return _0x43f35d;};'use strict';var Sequelize=require(_0x65e0('0x0'));module[_0x65e0('0x1')]={'name':{'type':Sequelize[_0x65e0('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x65e0('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x65e0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x3946=['STRING','INTEGER','sequelize','exports'];(function(_0x30399c,_0x57b2aa){var _0x4a0491=function(_0x52535f){while(--_0x52535f){_0x30399c['push'](_0x30399c['shift']());}};_0x4a0491(++_0x57b2aa);}(_0x3946,0x1da));var _0x6394=function(_0x389726,_0x282267){_0x389726=_0x389726-0x0;var _0x295a74=_0x3946[_0x389726];return _0x295a74;};'use strict';var Sequelize=require(_0x6394('0x0'));module[_0x6394('0x1')]={'name':{'type':Sequelize[_0x6394('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x6394('0x2')]},'description':{'type':Sequelize[_0x6394('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6394('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 1328e2a..438296e 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 _0xfa51=['undefined','count','offset','set','Content-Range','apply','save','then','destroy','end','error','stack','name','map','Automation','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','find','body','update','params','addConditions','ids','getConditions','Condition','options','hasOwnProperty','addActions','omit','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfa51,0x8b));var _0x1fa5=function(_0x534b26,_0x475e4d){_0x534b26=_0x534b26-0x0;var _0xedd55d=_0xfa51[_0x534b26];return _0xedd55d;};'use strict';var emlformat=require(_0x1fa5('0x0'));var rimraf=require(_0x1fa5('0x1'));var zipdir=require(_0x1fa5('0x2'));var jsonpatch=require(_0x1fa5('0x3'));var rp=require(_0x1fa5('0x4'));var moment=require('moment');var BPromise=require(_0x1fa5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1fa5('0x6'));var sox=require(_0x1fa5('0x7'));var csv=require(_0x1fa5('0x8'));var ejs=require(_0x1fa5('0x9'));var fs=require('fs');var fs_extra=require(_0x1fa5('0xa'));var _=require(_0x1fa5('0xb'));var squel=require(_0x1fa5('0xc'));var crypto=require('crypto');var jsforce=require(_0x1fa5('0xd'));var deskjs=require(_0x1fa5('0xe'));var toCsv=require(_0x1fa5('0x8'));var querystring=require(_0x1fa5('0xf'));var Papa=require('papaparse');var Redis=require(_0x1fa5('0x10'));var authService=require(_0x1fa5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1fa5('0x12'));var hardwareService=require(_0x1fa5('0x13'));var logger=require('../../config/logger')(_0x1fa5('0x14'));var utils=require(_0x1fa5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1fa5('0x16'));var db=require(_0x1fa5('0x17'))['db'];function respondWithStatusCode(_0x476b01,_0x5266ea){_0x5266ea=_0x5266ea||0xcc;return function(_0x401180){if(_0x401180){return _0x476b01[_0x1fa5('0x18')](_0x5266ea);}return _0x476b01[_0x1fa5('0x19')](_0x5266ea)['end']();};}function respondWithResult(_0x406579,_0x20712e){_0x20712e=_0x20712e||0xc8;return function(_0x16b5c5){if(_0x16b5c5){return _0x406579[_0x1fa5('0x19')](_0x20712e)[_0x1fa5('0x1a')](_0x16b5c5);}};}function respondWithFilteredResult(_0x27e38e,_0x5abf2d){return function(_0x6ad103){if(_0x6ad103){var _0x2b2bc4=typeof _0x5abf2d['offset']===_0x1fa5('0x1b')&&typeof _0x5abf2d['limit']===_0x1fa5('0x1b');var _0x101311=_0x6ad103[_0x1fa5('0x1c')];var _0x53bbee=_0x2b2bc4?0x0:_0x5abf2d[_0x1fa5('0x1d')];var _0x1b2b66=_0x2b2bc4?_0x6ad103[_0x1fa5('0x1c')]:_0x5abf2d[_0x1fa5('0x1d')]+_0x5abf2d['limit'];var _0x2ff4ed;if(_0x1b2b66>=_0x101311){_0x1b2b66=_0x101311;_0x2ff4ed=0xc8;}else{_0x2ff4ed=0xce;}_0x27e38e[_0x1fa5('0x19')](_0x2ff4ed);return _0x27e38e[_0x1fa5('0x1e')](_0x1fa5('0x1f'),_0x53bbee+'-'+_0x1b2b66+'/'+_0x101311)['json'](_0x6ad103);}return null;};}function patchUpdates(_0x3893c5){return function(_0x327768){try{jsonpatch[_0x1fa5('0x20')](_0x327768,_0x3893c5,!![]);}catch(_0x4cec55){return BPromise['reject'](_0x4cec55);}return _0x327768[_0x1fa5('0x21')]();};}function saveUpdates(_0x5b4787,_0x5cce6b){return function(_0x5cf1b4){if(_0x5cf1b4){return _0x5cf1b4['update'](_0x5b4787)[_0x1fa5('0x22')](function(_0x382455){return _0x382455;});}return null;};}function removeEntity(_0x4784f7,_0x3cbd26){return function(_0x348843){if(_0x348843){return _0x348843[_0x1fa5('0x23')]()[_0x1fa5('0x22')](function(){_0x4784f7[_0x1fa5('0x19')](0xcc)[_0x1fa5('0x24')]();});}};}function handleEntityNotFound(_0x6abaf6,_0x5d7355){return function(_0x3339f9){if(!_0x3339f9){_0x6abaf6[_0x1fa5('0x18')](0x194);}return _0x3339f9;};}function handleError(_0x180912,_0x327a42){_0x327a42=_0x327a42||0x1f4;return function(_0x41da36){logger[_0x1fa5('0x25')](_0x41da36[_0x1fa5('0x26')]);if(_0x41da36[_0x1fa5('0x27')]){delete _0x41da36['name'];}_0x180912[_0x1fa5('0x19')](_0x327a42)['send'](_0x41da36);};}exports['index']=function(_0x23c144,_0x57ebcf){var _0x59a98d={},_0x494bda={},_0x969b31={'count':0x0,'rows':[]};var _0x181621=_[_0x1fa5('0x28')](db[_0x1fa5('0x29')][_0x1fa5('0x2a')],function(_0xe665c5){return{'name':_0xe665c5[_0x1fa5('0x2b')],'type':_0xe665c5[_0x1fa5('0x2c')]['key']};});_0x494bda[_0x1fa5('0x2d')]=_['map'](_0x181621,_0x1fa5('0x27'));_0x494bda['query']=_['keys'](_0x23c144[_0x1fa5('0x2e')]);_0x494bda['filters']=_[_0x1fa5('0x2f')](_0x494bda[_0x1fa5('0x2d')],_0x494bda['query']);_0x59a98d[_0x1fa5('0x30')]=_[_0x1fa5('0x2f')](_0x494bda['model'],qs[_0x1fa5('0x31')](_0x23c144['query']['fields']));_0x59a98d[_0x1fa5('0x30')]=_0x59a98d[_0x1fa5('0x30')][_0x1fa5('0x32')]?_0x59a98d['attributes']:_0x494bda[_0x1fa5('0x2d')];if(!_0x23c144['query']['hasOwnProperty'](_0x1fa5('0x33'))){_0x59a98d['limit']=qs[_0x1fa5('0x34')](_0x23c144[_0x1fa5('0x2e')]['limit']);_0x59a98d[_0x1fa5('0x1d')]=qs[_0x1fa5('0x1d')](_0x23c144[_0x1fa5('0x2e')][_0x1fa5('0x1d')]);}_0x59a98d[_0x1fa5('0x35')]=qs['sort'](_0x23c144[_0x1fa5('0x2e')][_0x1fa5('0x36')]);_0x59a98d[_0x1fa5('0x37')]=qs[_0x1fa5('0x38')](_[_0x1fa5('0x39')](_0x23c144['query'],_0x494bda[_0x1fa5('0x38')]),_0x181621);if(_0x23c144['query'][_0x1fa5('0x3a')]){_0x59a98d['where']=_[_0x1fa5('0x3b')](_0x59a98d[_0x1fa5('0x37')],{'$or':_[_0x1fa5('0x28')](_0x181621,function(_0x29c05d){if(_0x29c05d['type']!==_0x1fa5('0x3c')){var _0x3db3c6={};_0x3db3c6[_0x29c05d[_0x1fa5('0x27')]]={'$like':'%'+_0x23c144['query'][_0x1fa5('0x3a')]+'%'};return _0x3db3c6;}})});}_0x59a98d=_[_0x1fa5('0x3b')]({},_0x59a98d,_0x23c144['options']);var _0x38e17d={'where':_0x59a98d['where']};return db[_0x1fa5('0x29')][_0x1fa5('0x1c')](_0x38e17d)[_0x1fa5('0x22')](function(_0x47a96a){_0x969b31[_0x1fa5('0x1c')]=_0x47a96a;if(_0x23c144[_0x1fa5('0x2e')][_0x1fa5('0x3d')]){_0x59a98d[_0x1fa5('0x3e')]=[{'all':!![]}];}return db[_0x1fa5('0x29')][_0x1fa5('0x3f')](_0x59a98d);})['then'](function(_0xcd11b8){_0x969b31[_0x1fa5('0x40')]=_0xcd11b8;return _0x969b31;})['then'](respondWithFilteredResult(_0x57ebcf,_0x59a98d))[_0x1fa5('0x41')](handleError(_0x57ebcf,null));};exports[_0x1fa5('0x42')]=function(_0x1336ed,_0x61b34e){var _0x39e619={'raw':![],'where':{'id':_0x1336ed['params']['id']}},_0x172409={};_0x172409['model']=_[_0x1fa5('0x43')](db['Automation']['rawAttributes']);_0x172409['query']=_[_0x1fa5('0x43')](_0x1336ed[_0x1fa5('0x2e')]);_0x172409[_0x1fa5('0x38')]=_[_0x1fa5('0x2f')](_0x172409['model'],_0x172409[_0x1fa5('0x2e')]);_0x39e619[_0x1fa5('0x30')]=_[_0x1fa5('0x2f')](_0x172409['model'],qs[_0x1fa5('0x31')](_0x1336ed[_0x1fa5('0x2e')][_0x1fa5('0x31')]));_0x39e619[_0x1fa5('0x30')]=_0x39e619['attributes']['length']?_0x39e619[_0x1fa5('0x30')]:_0x172409[_0x1fa5('0x2d')];if(_0x1336ed[_0x1fa5('0x2e')]['includeAll']){_0x39e619[_0x1fa5('0x3e')]=[{'all':!![]}];}_0x39e619=_[_0x1fa5('0x3b')]({},_0x39e619,_0x1336ed['options']);return db[_0x1fa5('0x29')][_0x1fa5('0x44')](_0x39e619)[_0x1fa5('0x22')](handleEntityNotFound(_0x61b34e,null))[_0x1fa5('0x22')](respondWithResult(_0x61b34e,null))[_0x1fa5('0x41')](handleError(_0x61b34e,null));};exports['create']=function(_0x4bc8b2,_0x3e9137){return db[_0x1fa5('0x29')]['create'](_0x4bc8b2[_0x1fa5('0x45')],{})[_0x1fa5('0x22')](respondWithResult(_0x3e9137,0xc9))['catch'](handleError(_0x3e9137,null));};exports[_0x1fa5('0x46')]=function(_0x10bf63,_0x51571f){if(_0x10bf63[_0x1fa5('0x45')]['id']){delete _0x10bf63[_0x1fa5('0x45')]['id'];}return db[_0x1fa5('0x29')][_0x1fa5('0x44')]({'where':{'id':_0x10bf63[_0x1fa5('0x47')]['id']}})[_0x1fa5('0x22')](handleEntityNotFound(_0x51571f,null))[_0x1fa5('0x22')](saveUpdates(_0x10bf63[_0x1fa5('0x45')],null))[_0x1fa5('0x22')](respondWithResult(_0x51571f,null))[_0x1fa5('0x41')](handleError(_0x51571f,null));};exports[_0x1fa5('0x23')]=function(_0x32e04e,_0x377132){return db[_0x1fa5('0x29')]['find']({'where':{'id':_0x32e04e[_0x1fa5('0x47')]['id']}})['then'](handleEntityNotFound(_0x377132,null))[_0x1fa5('0x22')](removeEntity(_0x377132,null))[_0x1fa5('0x41')](handleError(_0x377132,null));};exports[_0x1fa5('0x48')]=function(_0x554939,_0x3a6028,_0x51c2c6){return db['Condition'][_0x1fa5('0x44')]({'where':{'id':_0x554939[_0x1fa5('0x47')]['id']}})[_0x1fa5('0x22')](handleEntityNotFound(_0x3a6028,null))[_0x1fa5('0x22')](function(_0x3bd5dc){if(_0x3bd5dc){return _0x3bd5dc['addConditions'](_0x554939[_0x1fa5('0x45')][_0x1fa5('0x49')],_['omit'](_0x554939[_0x1fa5('0x45')],['ids','id'])||{});}})[_0x1fa5('0x22')](respondWithResult(_0x3a6028,null))[_0x1fa5('0x41')](handleError(_0x3a6028,null));};exports[_0x1fa5('0x4a')]=function(_0x65e3ab,_0x44458b,_0x1e7222){var _0x9c3031={};var _0x4cc7a3={};var _0x3c0dab;var _0x1b97af;return db[_0x1fa5('0x29')]['findOne']({'where':{'id':_0x65e3ab[_0x1fa5('0x47')]['id']}})[_0x1fa5('0x22')](handleEntityNotFound(_0x44458b,null))['then'](function(_0x517c91){if(_0x517c91){_0x3c0dab=_0x517c91;_0x4cc7a3[_0x1fa5('0x2d')]=_['keys'](db[_0x1fa5('0x4b')]['rawAttributes']);_0x4cc7a3[_0x1fa5('0x2e')]=_[_0x1fa5('0x43')](_0x65e3ab[_0x1fa5('0x2e')]);_0x4cc7a3['filters']=_['intersection'](_0x4cc7a3[_0x1fa5('0x2d')],_0x4cc7a3['query']);_0x9c3031[_0x1fa5('0x30')]=_[_0x1fa5('0x2f')](_0x4cc7a3['model'],qs[_0x1fa5('0x31')](_0x65e3ab[_0x1fa5('0x2e')][_0x1fa5('0x31')]));_0x9c3031[_0x1fa5('0x30')]=_0x9c3031['attributes'][_0x1fa5('0x32')]?_0x9c3031[_0x1fa5('0x30')]:_0x4cc7a3['model'];_0x9c3031[_0x1fa5('0x35')]=qs[_0x1fa5('0x36')](_0x65e3ab[_0x1fa5('0x2e')][_0x1fa5('0x36')]);_0x9c3031[_0x1fa5('0x37')]=qs[_0x1fa5('0x38')](_[_0x1fa5('0x39')](_0x65e3ab[_0x1fa5('0x2e')],_0x4cc7a3[_0x1fa5('0x38')]));if(_0x65e3ab['query'][_0x1fa5('0x3a')]){_0x9c3031[_0x1fa5('0x37')]=_['merge'](_0x9c3031[_0x1fa5('0x37')],{'$or':_[_0x1fa5('0x28')](_0x9c3031[_0x1fa5('0x30')],function(_0x3113ac){var _0x37a916={};_0x37a916[_0x3113ac]={'$like':'%'+_0x65e3ab[_0x1fa5('0x2e')][_0x1fa5('0x3a')]+'%'};return _0x37a916;})});}_0x9c3031=_['merge']({},_0x9c3031,_0x65e3ab[_0x1fa5('0x4c')]);return _0x3c0dab[_0x1fa5('0x4a')](_0x9c3031);}})[_0x1fa5('0x22')](function(_0x2d219d){if(_0x2d219d){_0x1b97af=_0x2d219d['length'];if(!_0x65e3ab[_0x1fa5('0x2e')][_0x1fa5('0x4d')](_0x1fa5('0x33'))){_0x9c3031['limit']=qs[_0x1fa5('0x34')](_0x65e3ab[_0x1fa5('0x2e')]['limit']);_0x9c3031['offset']=qs[_0x1fa5('0x1d')](_0x65e3ab['query']['offset']);}return _0x3c0dab[_0x1fa5('0x4a')](_0x9c3031);}})[_0x1fa5('0x22')](function(_0x3536f7){if(_0x3536f7){return _0x3536f7?{'count':_0x1b97af,'rows':_0x3536f7}:null;}})['then'](respondWithResult(_0x44458b,null))[_0x1fa5('0x41')](handleError(_0x44458b,null));};exports[_0x1fa5('0x4e')]=function(_0x5ad08a,_0x550bc7,_0x5804c4){return db['Action'][_0x1fa5('0x44')]({'where':{'id':_0x5ad08a[_0x1fa5('0x47')]['id']}})[_0x1fa5('0x22')](handleEntityNotFound(_0x550bc7,null))['then'](function(_0x13f609){if(_0x13f609){return _0x13f609[_0x1fa5('0x4e')](_0x5ad08a['body'][_0x1fa5('0x49')],_[_0x1fa5('0x4f')](_0x5ad08a['body'],[_0x1fa5('0x49'),'id'])||{});}})[_0x1fa5('0x22')](respondWithResult(_0x550bc7,null))[_0x1fa5('0x41')](handleError(_0x550bc7,null));};exports['getActions']=function(_0x1b33e0,_0x28f140,_0x116c4c){var _0x57322c={};var _0x271bca={};var _0x559267;var _0x2b9b16;return db[_0x1fa5('0x29')][_0x1fa5('0x50')]({'where':{'id':_0x1b33e0[_0x1fa5('0x47')]['id']}})[_0x1fa5('0x22')](handleEntityNotFound(_0x28f140,null))[_0x1fa5('0x22')](function(_0x182a13){if(_0x182a13){_0x559267=_0x182a13;_0x271bca[_0x1fa5('0x2d')]=_[_0x1fa5('0x43')](db[_0x1fa5('0x51')]['rawAttributes']);_0x271bca['query']=_['keys'](_0x1b33e0[_0x1fa5('0x2e')]);_0x271bca['filters']=_[_0x1fa5('0x2f')](_0x271bca[_0x1fa5('0x2d')],_0x271bca[_0x1fa5('0x2e')]);_0x57322c[_0x1fa5('0x30')]=_['intersection'](_0x271bca[_0x1fa5('0x2d')],qs[_0x1fa5('0x31')](_0x1b33e0[_0x1fa5('0x2e')]['fields']));_0x57322c[_0x1fa5('0x30')]=_0x57322c[_0x1fa5('0x30')]['length']?_0x57322c[_0x1fa5('0x30')]:_0x271bca[_0x1fa5('0x2d')];_0x57322c[_0x1fa5('0x35')]=qs[_0x1fa5('0x36')](_0x1b33e0[_0x1fa5('0x2e')][_0x1fa5('0x36')]);_0x57322c[_0x1fa5('0x37')]=qs['filters'](_[_0x1fa5('0x39')](_0x1b33e0['query'],_0x271bca[_0x1fa5('0x38')]));if(_0x1b33e0[_0x1fa5('0x2e')][_0x1fa5('0x3a')]){_0x57322c[_0x1fa5('0x37')]=_[_0x1fa5('0x3b')](_0x57322c[_0x1fa5('0x37')],{'$or':_[_0x1fa5('0x28')](_0x57322c[_0x1fa5('0x30')],function(_0x15d212){var _0x4f3443={};_0x4f3443[_0x15d212]={'$like':'%'+_0x1b33e0[_0x1fa5('0x2e')][_0x1fa5('0x3a')]+'%'};return _0x4f3443;})});}_0x57322c=_[_0x1fa5('0x3b')]({},_0x57322c,_0x1b33e0['options']);return _0x559267[_0x1fa5('0x52')](_0x57322c);}})[_0x1fa5('0x22')](function(_0x20b918){if(_0x20b918){_0x2b9b16=_0x20b918[_0x1fa5('0x32')];if(!_0x1b33e0[_0x1fa5('0x2e')][_0x1fa5('0x4d')](_0x1fa5('0x33'))){_0x57322c[_0x1fa5('0x34')]=qs['limit'](_0x1b33e0['query'][_0x1fa5('0x34')]);_0x57322c['offset']=qs[_0x1fa5('0x1d')](_0x1b33e0[_0x1fa5('0x2e')][_0x1fa5('0x1d')]);}return _0x559267['getActions'](_0x57322c);}})[_0x1fa5('0x22')](function(_0xcf0e0){if(_0xcf0e0){return _0xcf0e0?{'count':_0x2b9b16,'rows':_0xcf0e0}:null;}})['then'](respondWithResult(_0x28f140,null))[_0x1fa5('0x41')](handleError(_0x28f140,null));}; \ No newline at end of file +var _0x2825=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','destroy','params','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','getActions','Action','rimraf','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x576183,_0x43d3e1){var _0x442d1f=function(_0x3b4b07){while(--_0x3b4b07){_0x576183['push'](_0x576183['shift']());}};_0x442d1f(++_0x43d3e1);}(_0x2825,0x118));var _0x5282=function(_0x31f076,_0x24d048){_0x31f076=_0x31f076-0x0;var _0x1cc9ab=_0x2825[_0x31f076];return _0x1cc9ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5282('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5282('0x1'));var BPromise=require(_0x5282('0x2'));var Mustache=require('mustache');var util=require(_0x5282('0x3'));var path=require(_0x5282('0x4'));var sox=require(_0x5282('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5282('0x6'));var _=require(_0x5282('0x7'));var squel=require(_0x5282('0x8'));var crypto=require(_0x5282('0x9'));var jsforce=require(_0x5282('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5282('0xb'));var Papa=require('papaparse');var Redis=require(_0x5282('0xc'));var authService=require(_0x5282('0xd'));var qs=require(_0x5282('0xe'));var as=require(_0x5282('0xf'));var hardwareService=require(_0x5282('0x10'));var logger=require(_0x5282('0x11'))(_0x5282('0x12'));var utils=require(_0x5282('0x13'));var config=require(_0x5282('0x14'));var licenseUtil=require(_0x5282('0x15'));var db=require(_0x5282('0x16'))['db'];function respondWithStatusCode(_0x17a781,_0x258363){_0x258363=_0x258363||0xcc;return function(_0x5bcb94){if(_0x5bcb94){return _0x17a781[_0x5282('0x17')](_0x258363);}return _0x17a781[_0x5282('0x18')](_0x258363)[_0x5282('0x19')]();};}function respondWithResult(_0x515248,_0x215aa8){_0x215aa8=_0x215aa8||0xc8;return function(_0x21d419){if(_0x21d419){return _0x515248[_0x5282('0x18')](_0x215aa8)[_0x5282('0x1a')](_0x21d419);}};}function respondWithFilteredResult(_0x11a63e,_0x2a8eb9){return function(_0x1733d0){if(_0x1733d0){var _0x1e034a=typeof _0x2a8eb9[_0x5282('0x1b')]===_0x5282('0x1c')&&typeof _0x2a8eb9[_0x5282('0x1d')]===_0x5282('0x1c');var _0x2f11e5=_0x1733d0[_0x5282('0x1e')];var _0x53f8aa=_0x1e034a?0x0:_0x2a8eb9['offset'];var _0x4cefce=_0x1e034a?_0x1733d0[_0x5282('0x1e')]:_0x2a8eb9[_0x5282('0x1b')]+_0x2a8eb9[_0x5282('0x1d')];var _0x2a7d57;if(_0x4cefce>=_0x2f11e5){_0x4cefce=_0x2f11e5;_0x2a7d57=0xc8;}else{_0x2a7d57=0xce;}_0x11a63e[_0x5282('0x18')](_0x2a7d57);return _0x11a63e[_0x5282('0x1f')](_0x5282('0x20'),_0x53f8aa+'-'+_0x4cefce+'/'+_0x2f11e5)[_0x5282('0x1a')](_0x1733d0);}return null;};}function patchUpdates(_0x33e03d){return function(_0x69a066){try{jsonpatch['apply'](_0x69a066,_0x33e03d,!![]);}catch(_0x51c5c4){return BPromise[_0x5282('0x21')](_0x51c5c4);}return _0x69a066['save']();};}function saveUpdates(_0x3345f5,_0x3d247e){return function(_0x455752){if(_0x455752){return _0x455752[_0x5282('0x22')](_0x3345f5)[_0x5282('0x23')](function(_0x598175){return _0x598175;});}return null;};}function removeEntity(_0x2ee942,_0x1958c2){return function(_0xc6eba9){if(_0xc6eba9){return _0xc6eba9['destroy']()[_0x5282('0x23')](function(){_0x2ee942[_0x5282('0x18')](0xcc)[_0x5282('0x19')]();});}};}function handleEntityNotFound(_0x2903d3,_0x126493){return function(_0x399d7b){if(!_0x399d7b){_0x2903d3['sendStatus'](0x194);}return _0x399d7b;};}function handleError(_0x370fae,_0x2e7fdb){_0x2e7fdb=_0x2e7fdb||0x1f4;return function(_0x46f447){logger['error'](_0x46f447[_0x5282('0x24')]);if(_0x46f447['name']){delete _0x46f447[_0x5282('0x25')];}_0x370fae[_0x5282('0x18')](_0x2e7fdb)[_0x5282('0x26')](_0x46f447);};}exports[_0x5282('0x27')]=function(_0x37cc9a,_0x2e87dd){var _0x318abd={},_0x7a121a={},_0x170b4c={'count':0x0,'rows':[]};var _0x1fee28=_['map'](db[_0x5282('0x28')][_0x5282('0x29')],function(_0x57ad18){return{'name':_0x57ad18[_0x5282('0x2a')],'type':_0x57ad18[_0x5282('0x2b')][_0x5282('0x2c')]};});_0x7a121a[_0x5282('0x2d')]=_[_0x5282('0x2e')](_0x1fee28,'name');_0x7a121a[_0x5282('0x2f')]=_[_0x5282('0x30')](_0x37cc9a[_0x5282('0x2f')]);_0x7a121a[_0x5282('0x31')]=_['intersection'](_0x7a121a[_0x5282('0x2d')],_0x7a121a[_0x5282('0x2f')]);_0x318abd[_0x5282('0x32')]=_[_0x5282('0x33')](_0x7a121a[_0x5282('0x2d')],qs[_0x5282('0x34')](_0x37cc9a[_0x5282('0x2f')][_0x5282('0x34')]));_0x318abd['attributes']=_0x318abd[_0x5282('0x32')][_0x5282('0x35')]?_0x318abd[_0x5282('0x32')]:_0x7a121a['model'];if(!_0x37cc9a[_0x5282('0x2f')][_0x5282('0x36')]('nolimit')){_0x318abd[_0x5282('0x1d')]=qs['limit'](_0x37cc9a[_0x5282('0x2f')]['limit']);_0x318abd['offset']=qs[_0x5282('0x1b')](_0x37cc9a['query'][_0x5282('0x1b')]);}_0x318abd[_0x5282('0x37')]=qs[_0x5282('0x38')](_0x37cc9a[_0x5282('0x2f')][_0x5282('0x38')]);_0x318abd['where']=qs[_0x5282('0x31')](_[_0x5282('0x39')](_0x37cc9a[_0x5282('0x2f')],_0x7a121a[_0x5282('0x31')]),_0x1fee28);if(_0x37cc9a['query'][_0x5282('0x3a')]){_0x318abd[_0x5282('0x3b')]=_[_0x5282('0x3c')](_0x318abd[_0x5282('0x3b')],{'$or':_['map'](_0x1fee28,function(_0x49618a){if(_0x49618a[_0x5282('0x2b')]!==_0x5282('0x3d')){var _0x319667={};_0x319667[_0x49618a[_0x5282('0x25')]]={'$like':'%'+_0x37cc9a[_0x5282('0x2f')][_0x5282('0x3a')]+'%'};return _0x319667;}})});}_0x318abd=_['merge']({},_0x318abd,_0x37cc9a[_0x5282('0x3e')]);var _0x2a6db5={'where':_0x318abd[_0x5282('0x3b')]};return db[_0x5282('0x28')][_0x5282('0x1e')](_0x2a6db5)['then'](function(_0x4c4e5f){_0x170b4c[_0x5282('0x1e')]=_0x4c4e5f;if(_0x37cc9a[_0x5282('0x2f')][_0x5282('0x3f')]){_0x318abd[_0x5282('0x40')]=[{'all':!![]}];}return db[_0x5282('0x28')]['findAll'](_0x318abd);})[_0x5282('0x23')](function(_0x4daa8d){_0x170b4c[_0x5282('0x41')]=_0x4daa8d;return _0x170b4c;})[_0x5282('0x23')](respondWithFilteredResult(_0x2e87dd,_0x318abd))[_0x5282('0x42')](handleError(_0x2e87dd,null));};exports['show']=function(_0x534eb6,_0x4c4692){var _0x13c34a={'raw':![],'where':{'id':_0x534eb6['params']['id']}},_0x2f37c2={};_0x2f37c2[_0x5282('0x2d')]=_[_0x5282('0x30')](db[_0x5282('0x28')][_0x5282('0x29')]);_0x2f37c2['query']=_[_0x5282('0x30')](_0x534eb6[_0x5282('0x2f')]);_0x2f37c2[_0x5282('0x31')]=_[_0x5282('0x33')](_0x2f37c2[_0x5282('0x2d')],_0x2f37c2['query']);_0x13c34a[_0x5282('0x32')]=_['intersection'](_0x2f37c2[_0x5282('0x2d')],qs[_0x5282('0x34')](_0x534eb6[_0x5282('0x2f')][_0x5282('0x34')]));_0x13c34a['attributes']=_0x13c34a[_0x5282('0x32')][_0x5282('0x35')]?_0x13c34a[_0x5282('0x32')]:_0x2f37c2[_0x5282('0x2d')];if(_0x534eb6['query'][_0x5282('0x3f')]){_0x13c34a['include']=[{'all':!![]}];}_0x13c34a=_[_0x5282('0x3c')]({},_0x13c34a,_0x534eb6[_0x5282('0x3e')]);return db[_0x5282('0x28')][_0x5282('0x43')](_0x13c34a)['then'](handleEntityNotFound(_0x4c4692,null))['then'](respondWithResult(_0x4c4692,null))[_0x5282('0x42')](handleError(_0x4c4692,null));};exports[_0x5282('0x44')]=function(_0x166990,_0x19010c){return db[_0x5282('0x28')]['create'](_0x166990[_0x5282('0x45')],{})[_0x5282('0x23')](respondWithResult(_0x19010c,0xc9))['catch'](handleError(_0x19010c,null));};exports['update']=function(_0x48b3ee,_0xf48bd7){if(_0x48b3ee['body']['id']){delete _0x48b3ee[_0x5282('0x45')]['id'];}return db[_0x5282('0x28')][_0x5282('0x43')]({'where':{'id':_0x48b3ee['params']['id']}})[_0x5282('0x23')](handleEntityNotFound(_0xf48bd7,null))['then'](saveUpdates(_0x48b3ee[_0x5282('0x45')],null))[_0x5282('0x23')](respondWithResult(_0xf48bd7,null))[_0x5282('0x42')](handleError(_0xf48bd7,null));};exports[_0x5282('0x46')]=function(_0x23591c,_0x433604){return db[_0x5282('0x28')][_0x5282('0x43')]({'where':{'id':_0x23591c[_0x5282('0x47')]['id']}})[_0x5282('0x23')](handleEntityNotFound(_0x433604,null))[_0x5282('0x23')](removeEntity(_0x433604,null))[_0x5282('0x42')](handleError(_0x433604,null));};exports[_0x5282('0x48')]=function(_0x1b9fa8,_0x237206,_0x26398d){return db[_0x5282('0x49')][_0x5282('0x43')]({'where':{'id':_0x1b9fa8['params']['id']}})[_0x5282('0x23')](handleEntityNotFound(_0x237206,null))[_0x5282('0x23')](function(_0xf289ea){if(_0xf289ea){return _0xf289ea['addConditions'](_0x1b9fa8[_0x5282('0x45')][_0x5282('0x4a')],_[_0x5282('0x4b')](_0x1b9fa8[_0x5282('0x45')],[_0x5282('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x237206,null))[_0x5282('0x42')](handleError(_0x237206,null));};exports[_0x5282('0x4c')]=function(_0x567d9b,_0x62f4bb,_0x3d0250){var _0x2cbb3c={};var _0x7c8615={};var _0x1713e5;var _0x4a1ea0;return db[_0x5282('0x28')][_0x5282('0x4d')]({'where':{'id':_0x567d9b[_0x5282('0x47')]['id']}})['then'](handleEntityNotFound(_0x62f4bb,null))['then'](function(_0x3438f9){if(_0x3438f9){_0x1713e5=_0x3438f9;_0x7c8615[_0x5282('0x2d')]=_[_0x5282('0x30')](db[_0x5282('0x49')]['rawAttributes']);_0x7c8615['query']=_[_0x5282('0x30')](_0x567d9b['query']);_0x7c8615[_0x5282('0x31')]=_[_0x5282('0x33')](_0x7c8615[_0x5282('0x2d')],_0x7c8615[_0x5282('0x2f')]);_0x2cbb3c[_0x5282('0x32')]=_['intersection'](_0x7c8615['model'],qs[_0x5282('0x34')](_0x567d9b['query'][_0x5282('0x34')]));_0x2cbb3c[_0x5282('0x32')]=_0x2cbb3c[_0x5282('0x32')][_0x5282('0x35')]?_0x2cbb3c[_0x5282('0x32')]:_0x7c8615['model'];_0x2cbb3c[_0x5282('0x37')]=qs[_0x5282('0x38')](_0x567d9b[_0x5282('0x2f')][_0x5282('0x38')]);_0x2cbb3c[_0x5282('0x3b')]=qs[_0x5282('0x31')](_[_0x5282('0x39')](_0x567d9b['query'],_0x7c8615[_0x5282('0x31')]));if(_0x567d9b[_0x5282('0x2f')]['filter']){_0x2cbb3c[_0x5282('0x3b')]=_['merge'](_0x2cbb3c[_0x5282('0x3b')],{'$or':_['map'](_0x2cbb3c[_0x5282('0x32')],function(_0x1d9c30){var _0x294cb4={};_0x294cb4[_0x1d9c30]={'$like':'%'+_0x567d9b['query'][_0x5282('0x3a')]+'%'};return _0x294cb4;})});}_0x2cbb3c=_[_0x5282('0x3c')]({},_0x2cbb3c,_0x567d9b['options']);return _0x1713e5[_0x5282('0x4c')](_0x2cbb3c);}})[_0x5282('0x23')](function(_0x2ad083){if(_0x2ad083){_0x4a1ea0=_0x2ad083[_0x5282('0x35')];if(!_0x567d9b[_0x5282('0x2f')]['hasOwnProperty'](_0x5282('0x4e'))){_0x2cbb3c[_0x5282('0x1d')]=qs['limit'](_0x567d9b[_0x5282('0x2f')][_0x5282('0x1d')]);_0x2cbb3c[_0x5282('0x1b')]=qs['offset'](_0x567d9b['query']['offset']);}return _0x1713e5[_0x5282('0x4c')](_0x2cbb3c);}})['then'](function(_0x37e380){if(_0x37e380){return _0x37e380?{'count':_0x4a1ea0,'rows':_0x37e380}:null;}})[_0x5282('0x23')](respondWithResult(_0x62f4bb,null))[_0x5282('0x42')](handleError(_0x62f4bb,null));};exports[_0x5282('0x4f')]=function(_0x37ebfa,_0x43699e,_0x1a0edf){return db['Action'][_0x5282('0x43')]({'where':{'id':_0x37ebfa[_0x5282('0x47')]['id']}})[_0x5282('0x23')](handleEntityNotFound(_0x43699e,null))[_0x5282('0x23')](function(_0x66fffd){if(_0x66fffd){return _0x66fffd[_0x5282('0x4f')](_0x37ebfa[_0x5282('0x45')][_0x5282('0x4a')],_[_0x5282('0x4b')](_0x37ebfa[_0x5282('0x45')],[_0x5282('0x4a'),'id'])||{});}})[_0x5282('0x23')](respondWithResult(_0x43699e,null))[_0x5282('0x42')](handleError(_0x43699e,null));};exports[_0x5282('0x50')]=function(_0x19a2f1,_0x117428,_0x4a4771){var _0x218172={};var _0x4f7f0c={};var _0x4129b6;var _0x230874;return db[_0x5282('0x28')]['findOne']({'where':{'id':_0x19a2f1[_0x5282('0x47')]['id']}})['then'](handleEntityNotFound(_0x117428,null))[_0x5282('0x23')](function(_0x27837e){if(_0x27837e){_0x4129b6=_0x27837e;_0x4f7f0c[_0x5282('0x2d')]=_['keys'](db[_0x5282('0x51')][_0x5282('0x29')]);_0x4f7f0c['query']=_['keys'](_0x19a2f1['query']);_0x4f7f0c[_0x5282('0x31')]=_[_0x5282('0x33')](_0x4f7f0c[_0x5282('0x2d')],_0x4f7f0c['query']);_0x218172['attributes']=_[_0x5282('0x33')](_0x4f7f0c['model'],qs[_0x5282('0x34')](_0x19a2f1['query'][_0x5282('0x34')]));_0x218172['attributes']=_0x218172[_0x5282('0x32')]['length']?_0x218172[_0x5282('0x32')]:_0x4f7f0c[_0x5282('0x2d')];_0x218172[_0x5282('0x37')]=qs[_0x5282('0x38')](_0x19a2f1['query'][_0x5282('0x38')]);_0x218172[_0x5282('0x3b')]=qs[_0x5282('0x31')](_[_0x5282('0x39')](_0x19a2f1[_0x5282('0x2f')],_0x4f7f0c[_0x5282('0x31')]));if(_0x19a2f1[_0x5282('0x2f')]['filter']){_0x218172[_0x5282('0x3b')]=_[_0x5282('0x3c')](_0x218172['where'],{'$or':_[_0x5282('0x2e')](_0x218172[_0x5282('0x32')],function(_0x5999eb){var _0x3240e3={};_0x3240e3[_0x5999eb]={'$like':'%'+_0x19a2f1[_0x5282('0x2f')][_0x5282('0x3a')]+'%'};return _0x3240e3;})});}_0x218172=_[_0x5282('0x3c')]({},_0x218172,_0x19a2f1[_0x5282('0x3e')]);return _0x4129b6[_0x5282('0x50')](_0x218172);}})[_0x5282('0x23')](function(_0x5592cc){if(_0x5592cc){_0x230874=_0x5592cc[_0x5282('0x35')];if(!_0x19a2f1[_0x5282('0x2f')][_0x5282('0x36')](_0x5282('0x4e'))){_0x218172[_0x5282('0x1d')]=qs[_0x5282('0x1d')](_0x19a2f1[_0x5282('0x2f')][_0x5282('0x1d')]);_0x218172[_0x5282('0x1b')]=qs[_0x5282('0x1b')](_0x19a2f1[_0x5282('0x2f')][_0x5282('0x1b')]);}return _0x4129b6[_0x5282('0x50')](_0x218172);}})[_0x5282('0x23')](function(_0x5b4711){if(_0x5b4711){return _0x5b4711?{'count':_0x230874,'rows':_0x5b4711}:null;}})[_0x5282('0x23')](respondWithResult(_0x117428,null))[_0x5282('0x42')](handleError(_0x117428,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 7454d94..e6a5eb7 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 _0xce49=['Automation','tools_automations','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x25280c,_0x51b10d){var _0xda8307=function(_0x565db3){while(--_0x565db3){_0x25280c['push'](_0x25280c['shift']());}};_0xda8307(++_0x51b10d);}(_0xce49,0x110));var _0x9ce4=function(_0x1a8e8c,_0x5e661a){_0x1a8e8c=_0x1a8e8c-0x0;var _0x1d1387=_0xce49[_0x1a8e8c];return _0x1d1387;};'use strict';var _=require(_0x9ce4('0x0'));var util=require('util');var logger=require(_0x9ce4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9ce4('0x2'));var rp=require(_0x9ce4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ce4('0x4'));var config=require(_0x9ce4('0x5'));var attributes=require(_0x9ce4('0x6'));module[_0x9ce4('0x7')]=function(_0x163ddc,_0x1c95eb){return _0x163ddc['define'](_0x9ce4('0x8'),attributes,{'tableName':_0x9ce4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c14=['moment','bluebird','request-promise','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api'];(function(_0x5f5b62,_0x5246f9){var _0x5adce8=function(_0xc9198b){while(--_0xc9198b){_0x5f5b62['push'](_0x5f5b62['shift']());}};_0x5adce8(++_0x5246f9);}(_0x9c14,0x168));var _0x49c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x49c1('0x0'));var util=require(_0x49c1('0x1'));var logger=require('../../config/logger')(_0x49c1('0x2'));var moment=require(_0x49c1('0x3'));var BPromise=require(_0x49c1('0x4'));var rp=require(_0x49c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c1('0x6'));module[_0x49c1('0x7')]=function(_0x341dd5,_0x153139){return _0x341dd5[_0x49c1('0x8')](_0x49c1('0x9'),attributes,{'tableName':_0x49c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 4455571..a484623 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 _0x7880=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x10bc80,_0x138ccb){var _0x29e8a4=function(_0x48bc45){while(--_0x48bc45){_0x10bc80['push'](_0x10bc80['shift']());}};_0x29e8a4(++_0x138ccb);}(_0x7880,0x10f));var _0x0788=function(_0x203451,_0x36cdd9){_0x203451=_0x203451-0x0;var _0x23dc34=_0x7880[_0x203451];return _0x23dc34;};'use strict';var _=require(_0x0788('0x0'));var util=require('util');var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0788('0x6'));var config=require('../../config/environment');var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ece1c,_0x14cfa5,_0x450b71){return new BPromise(function(_0x5366c7,_0x1662a2){return client[_0x0788('0xa')](_0x5ece1c,_0x450b71)[_0x0788('0xb')](function(_0x95ebe3){logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x14cfa5,_0x0788('0xe'),JSON[_0x0788('0x11')](_0x95ebe3));if(_0x95ebe3['error']){if(_0x95ebe3[_0x0788('0x12')]['code']===0x1f4){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x95ebe3[_0x0788('0x12')][_0x0788('0x13')]);return _0x1662a2(_0x95ebe3[_0x0788('0x12')]['message']);}logger[_0x0788('0x12')]('Automation,\x20%s,\x20%s',_0x14cfa5,_0x95ebe3[_0x0788('0x12')]['message']);return _0x5366c7(_0x95ebe3['error'][_0x0788('0x13')]);}else{logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,'request\x20sent');_0x5366c7(_0x95ebe3[_0x0788('0x14')][_0x0788('0x13')]);}})['catch'](function(_0x334f58){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x334f58);_0x1662a2(_0x334f58);});});} \ No newline at end of file +var _0x60a5=['then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x1a1131,_0x404e25){var _0x2a73ee=function(_0x18690f){while(--_0x18690f){_0x1a1131['push'](_0x1a1131['shift']());}};_0x2a73ee(++_0x404e25);}(_0x60a5,0x83));var _0x560a=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x60a5[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x560a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x560a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x560a('0x2'))['db'];var utils=require(_0x560a('0x3'));var logger=require(_0x560a('0x4'))('rpc');var config=require(_0x560a('0x5'));var jayson=require(_0x560a('0x6'));var client=jayson[_0x560a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fa23,_0x55eb57,_0x53a664){return new BPromise(function(_0x3ac39e,_0x1891ea){return client[_0x560a('0x8')](_0x52fa23,_0x53a664)[_0x560a('0x9')](function(_0x52c52e){logger['info'](_0x560a('0xa'),_0x55eb57,'request\x20sent');logger[_0x560a('0xb')](_0x560a('0xc'),_0x55eb57,'request\x20sent',JSON[_0x560a('0xd')](_0x52c52e));if(_0x52c52e[_0x560a('0xe')]){if(_0x52c52e[_0x560a('0xe')][_0x560a('0xf')]===0x1f4){logger[_0x560a('0xe')](_0x560a('0xa'),_0x55eb57,_0x52c52e[_0x560a('0xe')][_0x560a('0x10')]);return _0x1891ea(_0x52c52e[_0x560a('0xe')]['message']);}logger[_0x560a('0xe')](_0x560a('0xa'),_0x55eb57,_0x52c52e[_0x560a('0xe')]['message']);return _0x3ac39e(_0x52c52e[_0x560a('0xe')][_0x560a('0x10')]);}else{logger[_0x560a('0x11')](_0x560a('0xa'),_0x55eb57,'request\x20sent');_0x3ac39e(_0x52c52e[_0x560a('0x12')][_0x560a('0x10')]);}})[_0x560a('0x13')](function(_0x3f9f15){logger['error']('Automation,\x20%s,\x20%s',_0x55eb57,_0x3f9f15);_0x1891ea(_0x3f9f15);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 48f749c..cc87daa 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 _0x92e8=['../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions','put','/:id','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x168258,_0x5c8632){var _0x2da37c=function(_0x37f305){while(--_0x37f305){_0x168258['push'](_0x168258['shift']());}};_0x2da37c(++_0x5c8632);}(_0x92e8,0x7f));var _0x892e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x92e8[_0x5c9307];return _0x373e29;};'use strict';var multer=require(_0x892e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x892e('0x1'));var express=require('express');var router=express[_0x892e('0x2')]();var fs_extra=require(_0x892e('0x3'));var auth=require(_0x892e('0x4'));var interaction=require(_0x892e('0x5'));var config=require(_0x892e('0x6'));var controller=require(_0x892e('0x7'));router['get']('/',auth[_0x892e('0x8')](),controller['index']);router[_0x892e('0x9')]('/:id',auth[_0x892e('0x8')](),controller['show']);router[_0x892e('0x9')](_0x892e('0xa'),auth[_0x892e('0x8')](),controller['getConditions']);router[_0x892e('0x9')](_0x892e('0xb'),auth[_0x892e('0x8')](),controller[_0x892e('0xc')]);router[_0x892e('0xd')]('/',auth['isAuthenticated'](),controller[_0x892e('0xe')]);router[_0x892e('0xd')](_0x892e('0xa'),auth['isAuthenticated'](),controller[_0x892e('0xf')]);router['post'](_0x892e('0xb'),auth[_0x892e('0x8')](),controller[_0x892e('0x10')]);router[_0x892e('0x11')](_0x892e('0x12'),auth[_0x892e('0x8')](),controller[_0x892e('0x13')]);router[_0x892e('0x14')](_0x892e('0x12'),auth[_0x892e('0x8')](),controller[_0x892e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x180b=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions'];(function(_0x3fb1cb,_0x14d85a){var _0x7bc2b6=function(_0x118f09){while(--_0x118f09){_0x3fb1cb['push'](_0x3fb1cb['shift']());}};_0x7bc2b6(++_0x14d85a);}(_0x180b,0xdc));var _0xb180=function(_0x749e4c,_0x51dfe4){_0x749e4c=_0x749e4c-0x0;var _0x17c459=_0x180b[_0x749e4c];return _0x17c459;};'use strict';var multer=require(_0xb180('0x0'));var util=require(_0xb180('0x1'));var path=require(_0xb180('0x2'));var timeout=require('connect-timeout');var express=require(_0xb180('0x3'));var router=express[_0xb180('0x4')]();var fs_extra=require(_0xb180('0x5'));var auth=require(_0xb180('0x6'));var interaction=require(_0xb180('0x7'));var config=require(_0xb180('0x8'));var controller=require(_0xb180('0x9'));router[_0xb180('0xa')]('/',auth[_0xb180('0xb')](),controller[_0xb180('0xc')]);router[_0xb180('0xa')](_0xb180('0xd'),auth[_0xb180('0xb')](),controller[_0xb180('0xe')]);router['get']('/:id/conditions',auth[_0xb180('0xb')](),controller[_0xb180('0xf')]);router[_0xb180('0xa')](_0xb180('0x10'),auth[_0xb180('0xb')](),controller[_0xb180('0x11')]);router[_0xb180('0x12')]('/',auth[_0xb180('0xb')](),controller[_0xb180('0x13')]);router[_0xb180('0x12')](_0xb180('0x14'),auth[_0xb180('0xb')](),controller[_0xb180('0x15')]);router[_0xb180('0x12')](_0xb180('0x10'),auth['isAuthenticated'](),controller[_0xb180('0x16')]);router['put'](_0xb180('0xd'),auth['isAuthenticated'](),controller[_0xb180('0x17')]);router[_0xb180('0x18')](_0xb180('0xd'),auth['isAuthenticated'](),controller[_0xb180('0x19')]);module[_0xb180('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 32f0200..25ca52f 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 _0x2143=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED'];(function(_0x5ee228,_0x139acc){var _0x200a1d=function(_0x33c73a){while(--_0x33c73a){_0x5ee228['push'](_0x5ee228['shift']());}};_0x200a1d(++_0x139acc);}(_0x2143,0xf0));var _0x3214=function(_0x32c81b,_0x2945f7){_0x32c81b=_0x32c81b-0x0;var _0x54fd24=_0x2143[_0x32c81b];return _0x54fd24;};'use strict';var Sequelize=require(_0x3214('0x0'));module[_0x3214('0x1')]={'name':{'type':Sequelize[_0x3214('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x3214('0x2')]},'active':{'type':Sequelize[_0x3214('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x3214('0x6')](0x4)[_0x3214('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x3214('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3214('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3214('0x6')](0x3)[_0x3214('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x3214('0x6')](0x3)[_0x3214('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3214('0x6')](0x5)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3214('0x7')],'defaultValue':0x3,'comment':_0x3214('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3214('0x6')](0x5)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3214('0x6')](0x3)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3214('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x3214('0x3')](_0x3214('0xf'),_0x3214('0x10'),'onlyIfOpen'),'defaultValue':_0x3214('0xf')},'dialAMDActive':{'type':Sequelize[_0x3214('0x5')],'defaultValue':0x0,'comment':_0x3214('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x3214('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3214('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x3214('0x6')](0x9)[_0x3214('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3214('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3214('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3214('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x3214('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3214('0x6')](0x9)[_0x3214('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3214('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3214('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3214('0x6')](0x5)[_0x3214('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3214('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3214('0x6')](0x9)[_0x3214('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3214('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3214('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3214('0x6')](0x3)[_0x3214('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3214('0x18')},'dialCutDigit':{'type':Sequelize[_0x3214('0x6')](0x3)[_0x3214('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3214('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0x3214('0x6')](0x3)[_0x3214('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3214('0x6')](0x3)[_0x3214('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x3214('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x3214('0x6')](0x5)[_0x3214('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3214('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x1d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3214('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x1e')}}; \ No newline at end of file +var _0xa91a=['STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports'];(function(_0x36b96b,_0x2a6330){var _0x32f74e=function(_0x251534){while(--_0x251534){_0x36b96b['push'](_0x36b96b['shift']());}};_0x32f74e(++_0x2a6330);}(_0xa91a,0x167));var _0xaa91=function(_0x210980,_0x52f3ad){_0x210980=_0x210980-0x0;var _0x4242a0=_0xa91a[_0x210980];return _0x4242a0;};'use strict';var Sequelize=require('sequelize');module[_0xaa91('0x0')]={'name':{'type':Sequelize[_0xaa91('0x1')],'unique':_0xaa91('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xaa91('0x3')](_0xaa91('0x4')),'allowNull':![],'defaultValue':_0xaa91('0x4')},'description':{'type':Sequelize[_0xaa91('0x1')]},'active':{'type':Sequelize[_0xaa91('0x5')],'defaultValue':0x0,'comment':_0xaa91('0x6')},'limitCalls':{'type':Sequelize[_0xaa91('0x7')](0x4)[_0xaa91('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xaa91('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xaa91('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xaa91('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa91('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa91('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaa91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa91('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xaa91('0x7')](0x5)[_0xaa91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa91('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'comment':_0xaa91('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xaa91('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xaa91('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xaa91('0x1')],'defaultValue':_0xaa91('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xaa91('0x3')]('always',_0xaa91('0x11'),_0xaa91('0x12')),'defaultValue':_0xaa91('0x13')},'dialAMDActive':{'type':Sequelize[_0xaa91('0x5')],'defaultValue':0x0,'comment':_0xaa91('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xaa91('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xaa91('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xaa91('0x7')](0x9)[_0xaa91('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xaa91('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xaa91('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xaa91('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xaa91('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaa91('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xaa91('0x7')](0x9)[_0xaa91('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xaa91('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xaa91('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xaa91('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xaa91('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xaa91('0x7')](0x5)[_0xaa91('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xaa91('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xaa91('0x7')](0x9)[_0xaa91('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaa91('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xaa91('0x3')]('DESC',_0xaa91('0x1e')),'defaultValue':_0xaa91('0x1f')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xaa91('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaa91('0x20')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xaa91('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaa91('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa91('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xaa91('0x7')](0x5)[_0xaa91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa91('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xaa91('0x7')](0x5)[_0xaa91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa91('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xaa91('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xaa91('0x7')](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa91('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xaa91('0x7')](0x5)[_0xaa91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaa91('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaa91('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaa91('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaa91('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 1f71a1c..63aa6e3 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 _0x10d6=['field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','fromQuery','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','CmList','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','merge','where','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','clone','updatedAt','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','count','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select'];(function(_0x34046c,_0x283124){var _0x5d4d17=function(_0x172fc1){while(--_0x172fc1){_0x34046c['push'](_0x34046c['shift']());}};_0x5d4d17(++_0x283124);}(_0x10d6,0x145));var _0x610d=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x10d6[_0x2bc1fe];return _0x1a47a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x610d('0x0'));var zipdir=require(_0x610d('0x1'));var jsonpatch=require(_0x610d('0x2'));var rp=require('request-promise');var moment=require(_0x610d('0x3'));var BPromise=require(_0x610d('0x4'));var Mustache=require(_0x610d('0x5'));var util=require(_0x610d('0x6'));var path=require(_0x610d('0x7'));var sox=require(_0x610d('0x8'));var csv=require(_0x610d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x610d('0xa'));var _=require(_0x610d('0xb'));var squel=require(_0x610d('0xc'));var crypto=require(_0x610d('0xd'));var jsforce=require(_0x610d('0xe'));var deskjs=require(_0x610d('0xf'));var toCsv=require(_0x610d('0x9'));var querystring=require(_0x610d('0x10'));var Papa=require(_0x610d('0x11'));var Redis=require(_0x610d('0x12'));var authService=require(_0x610d('0x13'));var qs=require(_0x610d('0x14'));var as=require(_0x610d('0x15'));var hardwareService=require(_0x610d('0x16'));var logger=require('../../config/logger')(_0x610d('0x17'));var utils=require(_0x610d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x610d('0x19'));var db=require(_0x610d('0x1a'))['db'];function respondWithStatusCode(_0x57e0d4,_0x29bc8e){_0x29bc8e=_0x29bc8e||0xcc;return function(_0x2f226f){if(_0x2f226f){return _0x57e0d4[_0x610d('0x1b')](_0x29bc8e);}return _0x57e0d4['status'](_0x29bc8e)[_0x610d('0x1c')]();};}function respondWithResult(_0x36bbf3,_0x2a34a2){_0x2a34a2=_0x2a34a2||0xc8;return function(_0x590806){if(_0x590806){return _0x36bbf3['status'](_0x2a34a2)['json'](_0x590806);}};}function respondWithFilteredResult(_0x2c8406,_0x20db4b){return function(_0x1cafc9){if(_0x1cafc9){var _0x505dce=typeof _0x20db4b[_0x610d('0x1d')]==='undefined'&&typeof _0x20db4b[_0x610d('0x1e')]===_0x610d('0x1f');var _0x1ad466=_0x1cafc9['count'];var _0x2a4f41=_0x505dce?0x0:_0x20db4b['offset'];var _0x19b6e1=_0x505dce?_0x1cafc9['count']:_0x20db4b[_0x610d('0x1d')]+_0x20db4b[_0x610d('0x1e')];var _0x241275;if(_0x19b6e1>=_0x1ad466){_0x19b6e1=_0x1ad466;_0x241275=0xc8;}else{_0x241275=0xce;}_0x2c8406[_0x610d('0x20')](_0x241275);return _0x2c8406[_0x610d('0x21')](_0x610d('0x22'),_0x2a4f41+'-'+_0x19b6e1+'/'+_0x1ad466)[_0x610d('0x23')](_0x1cafc9);}return null;};}function patchUpdates(_0x5d0f95){return function(_0x40a275){try{jsonpatch[_0x610d('0x24')](_0x40a275,_0x5d0f95,!![]);}catch(_0x534743){return BPromise[_0x610d('0x25')](_0x534743);}return _0x40a275[_0x610d('0x26')]();};}function saveUpdates(_0x7acc43,_0x47ddd4){return function(_0x2ed804){if(_0x2ed804){return _0x2ed804[_0x610d('0x27')](_0x7acc43)['then'](function(_0x4e7caf){return _0x4e7caf;});}return null;};}function removeEntity(_0x12b17b,_0x335a9f){return function(_0x108dac){if(_0x108dac){return _0x108dac[_0x610d('0x28')]()[_0x610d('0x29')](function(){var _0x3ff3d4=_0x108dac[_0x610d('0x2a')]({'plain':!![]});var _0x7e7c5a=_0x610d('0x2b');return db[_0x610d('0x2c')][_0x610d('0x28')]({'where':{'type':_0x7e7c5a,'resourceId':_0x3ff3d4['id']}})[_0x610d('0x29')](function(){return _0x108dac;});})['then'](function(){_0x12b17b[_0x610d('0x20')](0xcc)[_0x610d('0x1c')]();});}};}function handleEntityNotFound(_0x889281,_0x3cecbb){return function(_0x249c91){if(!_0x249c91){_0x889281[_0x610d('0x1b')](0x194);}return _0x249c91;};}function handleError(_0x2bf05f,_0x42c9f6){_0x42c9f6=_0x42c9f6||0x1f4;return function(_0x415c35){logger[_0x610d('0x2d')](_0x415c35[_0x610d('0x2e')]);if(_0x415c35['name']){delete _0x415c35[_0x610d('0x2f')];}_0x2bf05f[_0x610d('0x20')](_0x42c9f6)[_0x610d('0x30')](_0x415c35);};}exports['index']=function(_0x26a761,_0xa78d6e){var _0x226f0b={},_0x3884dd={},_0x159c9c={'count':0x0,'rows':[]};var _0x314965=_[_0x610d('0x31')](db['Campaign'][_0x610d('0x32')],function(_0x50d75c){return{'name':_0x50d75c['fieldName'],'type':_0x50d75c[_0x610d('0x33')][_0x610d('0x34')]};});_0x3884dd[_0x610d('0x35')]=_['map'](_0x314965,'name');_0x3884dd[_0x610d('0x36')]=_[_0x610d('0x37')](_0x26a761[_0x610d('0x36')]);_0x3884dd['filters']=_[_0x610d('0x38')](_0x3884dd['model'],_0x3884dd[_0x610d('0x36')]);_0x226f0b[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3884dd[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x26a761['query']['fields']));_0x226f0b[_0x610d('0x39')]=_0x226f0b[_0x610d('0x39')][_0x610d('0x3b')]?_0x226f0b[_0x610d('0x39')]:_0x3884dd[_0x610d('0x35')];if(!_0x26a761[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x226f0b['limit']=qs[_0x610d('0x1e')](_0x26a761[_0x610d('0x36')]['limit']);_0x226f0b['offset']=qs['offset'](_0x26a761['query'][_0x610d('0x1d')]);}_0x226f0b[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x26a761[_0x610d('0x36')][_0x610d('0x3e')]);_0x226f0b['where']=qs['filters'](_[_0x610d('0x3f')](_0x26a761['query'],_0x3884dd[_0x610d('0x40')]),_0x314965);if(_0x26a761[_0x610d('0x36')]['filter']){_0x226f0b['where']=_[_0x610d('0x41')](_0x226f0b[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x314965,function(_0x16d35b){if(_0x16d35b[_0x610d('0x33')]!==_0x610d('0x43')){var _0x2dbccb={};_0x2dbccb[_0x16d35b[_0x610d('0x2f')]]={'$like':'%'+_0x26a761[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x2dbccb;}})});}_0x226f0b=_[_0x610d('0x41')]({},_0x226f0b,_0x26a761[_0x610d('0x45')]);var _0x29fcc4={'where':_0x226f0b[_0x610d('0x42')]};return db[_0x610d('0x46')]['count'](_0x29fcc4)['then'](function(_0x498296){_0x159c9c['count']=_0x498296;if(_0x26a761['query'][_0x610d('0x47')]){_0x226f0b[_0x610d('0x48')]=[{'all':!![]}];}return db[_0x610d('0x46')]['findAll'](_0x226f0b);})[_0x610d('0x29')](function(_0x12f83b){_0x159c9c[_0x610d('0x49')]=_0x12f83b;return _0x159c9c;})[_0x610d('0x29')](respondWithFilteredResult(_0xa78d6e,_0x226f0b))[_0x610d('0x4a')](handleError(_0xa78d6e,null));};exports['show']=function(_0x17d7a5,_0x5160e2){var _0x7dc21b={'raw':![],'where':{'id':_0x17d7a5[_0x610d('0x4b')]['id']}},_0x59c603={};_0x59c603[_0x610d('0x35')]=_[_0x610d('0x37')](db['Campaign'][_0x610d('0x32')]);_0x59c603['query']=_[_0x610d('0x37')](_0x17d7a5[_0x610d('0x36')]);_0x59c603[_0x610d('0x40')]=_[_0x610d('0x38')](_0x59c603['model'],_0x59c603['query']);_0x7dc21b[_0x610d('0x39')]=_[_0x610d('0x38')](_0x59c603['model'],qs[_0x610d('0x3a')](_0x17d7a5['query'][_0x610d('0x3a')]));_0x7dc21b[_0x610d('0x39')]=_0x7dc21b[_0x610d('0x39')][_0x610d('0x3b')]?_0x7dc21b[_0x610d('0x39')]:_0x59c603[_0x610d('0x35')];if(_0x17d7a5['query'][_0x610d('0x47')]){_0x7dc21b['include']=[{'all':!![]}];}_0x7dc21b=_[_0x610d('0x41')]({},_0x7dc21b,_0x17d7a5['options']);return db[_0x610d('0x46')][_0x610d('0x4c')](_0x7dc21b)[_0x610d('0x29')](handleEntityNotFound(_0x5160e2,null))[_0x610d('0x29')](respondWithResult(_0x5160e2,null))[_0x610d('0x4a')](handleError(_0x5160e2,null));};exports[_0x610d('0x4d')]=function(_0x585345,_0x3e6c4f){return db[_0x610d('0x46')][_0x610d('0x4d')](_0x585345[_0x610d('0x4e')],{})[_0x610d('0x29')](function(_0x2cd7c3){var _0x5e8dd9=_0x585345[_0x610d('0x4f')][_0x610d('0x2a')]({'plain':!![]});if(!_0x5e8dd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e8dd9[_0x610d('0x50')]===_0x610d('0x4f')){var _0x585858=_0x2cd7c3[_0x610d('0x2a')]({'plain':!![]});var _0x47895f=_0x610d('0x2b');return db[_0x610d('0x51')][_0x610d('0x4c')]({'where':{'name':_0x47895f,'userProfileId':_0x5e8dd9[_0x610d('0x52')]},'raw':!![]})[_0x610d('0x29')](function(_0x3a2e5c){if(_0x3a2e5c&&_0x3a2e5c[_0x610d('0x53')]===0x0){return db[_0x610d('0x2c')]['create']({'name':_0x585858[_0x610d('0x2f')],'resourceId':_0x585858['id'],'type':_0x3a2e5c[_0x610d('0x2f')],'sectionId':_0x3a2e5c['id']},{})[_0x610d('0x29')](function(){return _0x2cd7c3;});}else{return _0x2cd7c3;}})[_0x610d('0x4a')](function(_0x2b523f){logger[_0x610d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b523f);throw _0x2b523f;});}return _0x2cd7c3;})[_0x610d('0x29')](respondWithResult(_0x3e6c4f,0xc9))[_0x610d('0x4a')](handleError(_0x3e6c4f,null));};exports[_0x610d('0x54')]=function(_0xf4e816,_0x467fbd){var _0x2d65b4={'where':{'id':_0xf4e816[_0x610d('0x4b')]['id']}},_0x55a8e8={};_0x55a8e8[_0x610d('0x35')]=_['keys'](db['Campaign'][_0x610d('0x32')]);_0x2d65b4[_0x610d('0x39')]=_['intersection'](_0x55a8e8[_0x610d('0x35')],qs[_0x610d('0x3a')](_0xf4e816[_0x610d('0x36')][_0x610d('0x3a')]));_0x2d65b4[_0x610d('0x39')]=_0x2d65b4['attributes']['length']?_0x2d65b4[_0x610d('0x39')]:_0x55a8e8[_0x610d('0x35')];if(_0xf4e816[_0x610d('0x36')][_0x610d('0x47')]){_0x2d65b4[_0x610d('0x48')]=[{'all':!![]}];}_0x2d65b4=_[_0x610d('0x41')]({},_0x2d65b4,_0xf4e816['options']);return db[_0x610d('0x46')][_0x610d('0x4c')](_0x2d65b4)[_0x610d('0x29')](handleEntityNotFound(_0x467fbd,null))['then'](function(_0x2beff7){if(_0x2beff7){var _0x5cfe00=_0x2beff7['get']({'plain':!![]});_0x5cfe00=qs['omit'](_0x5cfe00,['id','createdAt',_0x610d('0x55')]);_0xf4e816[_0x610d('0x4e')]=_[_0x610d('0x56')](_0xf4e816['body'],['id',_0x610d('0x57'),'updatedAt']);return db[_0x610d('0x46')][_0x610d('0x4d')](_['merge'](_0x5cfe00,_0xf4e816[_0x610d('0x4e')]),{'include':_0xf4e816[_0x610d('0x36')][_0x610d('0x47')]?[{'all':!![]}]:undefined})[_0x610d('0x29')](function(_0x549671){var _0x3115cb=_0xf4e816['user'][_0x610d('0x2a')]({'plain':!![]});if(!_0x3115cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3115cb[_0x610d('0x50')]===_0x610d('0x4f')){var _0x567606=_0x549671[_0x610d('0x2a')]({'plain':!![]});var _0x56a44c=_0x610d('0x2b');return db[_0x610d('0x51')]['find']({'where':{'name':_0x56a44c,'userProfileId':_0x3115cb['userProfileId']},'raw':!![]})[_0x610d('0x29')](function(_0x3d7621){if(_0x3d7621&&_0x3d7621[_0x610d('0x53')]===0x0){return db[_0x610d('0x2c')][_0x610d('0x4d')]({'name':_0x567606[_0x610d('0x2f')],'resourceId':_0x567606['id'],'type':_0x3d7621[_0x610d('0x2f')],'sectionId':_0x3d7621['id']},{})[_0x610d('0x29')](function(){return _0x549671;});}else{return _0x549671;}})[_0x610d('0x4a')](function(_0x23a464){logger[_0x610d('0x2d')](_0x610d('0x58'),_0x23a464);throw _0x23a464;});}return _0x549671;});}})[_0x610d('0x29')](respondWithResult(_0x467fbd,0xc9))[_0x610d('0x4a')](handleError(_0x467fbd,null));};exports[_0x610d('0x27')]=function(_0x428d53,_0x5684e2){if(_0x428d53[_0x610d('0x4e')]['id']){delete _0x428d53[_0x610d('0x4e')]['id'];}return db['Campaign']['find']({'where':{'id':_0x428d53[_0x610d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5684e2,null))['then'](saveUpdates(_0x428d53['body'],null))[_0x610d('0x29')](respondWithResult(_0x5684e2,null))[_0x610d('0x4a')](handleError(_0x5684e2,null));};exports[_0x610d('0x28')]=function(_0x54ac18,_0x1a60d1){return db['Campaign']['find']({'where':{'id':_0x54ac18[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x1a60d1,null))[_0x610d('0x29')](removeEntity(_0x1a60d1,null))[_0x610d('0x4a')](handleError(_0x1a60d1,null));};exports[_0x610d('0x59')]=function(_0x3f6f18,_0xe3ffe,_0xa86545){var _0x36ce98={'raw':!![],'where':{}};var _0x1ad245={};var _0x6b8fca={'count':0x0,'rows':[]};return db['Campaign'][_0x610d('0x5a')]({'where':{'id':_0x3f6f18[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0xe3ffe,null))[_0x610d('0x29')](function(_0x466f37){if(_0x466f37){_0x1ad245[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmHopper']['rawAttributes']);_0x1ad245[_0x610d('0x36')]=_[_0x610d('0x37')](_0x3f6f18[_0x610d('0x36')]);_0x1ad245[_0x610d('0x40')]=_['intersection'](_0x1ad245[_0x610d('0x35')],_0x1ad245[_0x610d('0x36')]);_0x36ce98[_0x610d('0x39')]=_[_0x610d('0x38')](_0x1ad245[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x3f6f18[_0x610d('0x36')]['fields']));_0x36ce98['attributes']=_0x36ce98[_0x610d('0x39')]['length']?_0x36ce98[_0x610d('0x39')]:_0x1ad245[_0x610d('0x35')];if(!_0x3f6f18[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x36ce98['limit']=qs['limit'](_0x3f6f18[_0x610d('0x36')][_0x610d('0x1e')]);_0x36ce98['offset']=qs[_0x610d('0x1d')](_0x3f6f18[_0x610d('0x36')][_0x610d('0x1d')]);}_0x36ce98['order']=qs[_0x610d('0x3e')](_0x3f6f18[_0x610d('0x36')][_0x610d('0x3e')]);_0x36ce98['where']=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x3f6f18[_0x610d('0x36')],_0x1ad245['filters']));_0x36ce98[_0x610d('0x42')]['CampaignId']=_0x466f37['id'];if(_0x3f6f18[_0x610d('0x36')]['filter']){_0x36ce98['where']=_[_0x610d('0x41')](_0x36ce98[_0x610d('0x42')],{'$or':_['map'](_0x36ce98[_0x610d('0x39')],function(_0x16abab){var _0x188dbd={};_0x188dbd[_0x16abab]={'$like':'%'+_0x3f6f18[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x188dbd;})});}_0x36ce98=_[_0x610d('0x41')]({},_0x36ce98,_0x3f6f18[_0x610d('0x45')]);return db[_0x610d('0x5b')][_0x610d('0x5c')]({'where':_0x36ce98[_0x610d('0x42')]})[_0x610d('0x29')](function(_0x1e16e0){_0x6b8fca[_0x610d('0x5c')]=_0x1e16e0;if(_0x3f6f18[_0x610d('0x36')][_0x610d('0x47')]){_0x36ce98[_0x610d('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0x610d('0x5d')](_0x36ce98);})[_0x610d('0x29')](function(_0xf7409a){_0x6b8fca['rows']=_0xf7409a;return _0x6b8fca;});}})['then'](respondWithFilteredResult(_0xe3ffe,_0x36ce98))['catch'](handleError(_0xe3ffe,null));};exports[_0x610d('0x5e')]=function(_0x357778,_0x15b722,_0xc7bb5e){var _0x3ee379={'raw':!![],'where':{}};var _0x3789bb={};var _0x12f276={'count':0x0,'rows':[]};return db['Campaign'][_0x610d('0x5a')]({'where':{'id':_0x357778[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x15b722,null))['then'](function(_0x4abc25){if(_0x4abc25){_0x3789bb[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x5f')][_0x610d('0x32')]);_0x3789bb[_0x610d('0x36')]=_[_0x610d('0x37')](_0x357778[_0x610d('0x36')]);_0x3789bb[_0x610d('0x40')]=_[_0x610d('0x38')](_0x3789bb[_0x610d('0x35')],_0x3789bb[_0x610d('0x36')]);_0x3ee379[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3789bb[_0x610d('0x35')],qs['fields'](_0x357778[_0x610d('0x36')][_0x610d('0x3a')]));_0x3ee379['attributes']=_0x3ee379[_0x610d('0x39')][_0x610d('0x3b')]?_0x3ee379['attributes']:_0x3789bb[_0x610d('0x35')];if(!_0x357778[_0x610d('0x36')][_0x610d('0x3c')]('nolimit')){_0x3ee379[_0x610d('0x1e')]=qs[_0x610d('0x1e')](_0x357778['query'][_0x610d('0x1e')]);_0x3ee379[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x357778[_0x610d('0x36')][_0x610d('0x1d')]);}_0x3ee379[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x357778[_0x610d('0x36')][_0x610d('0x3e')]);_0x3ee379[_0x610d('0x42')]=qs[_0x610d('0x40')](_['pick'](_0x357778[_0x610d('0x36')],_0x3789bb['filters']));_0x3ee379[_0x610d('0x42')][_0x610d('0x60')]=_0x4abc25['id'];if(_0x357778['query'][_0x610d('0x44')]){_0x3ee379[_0x610d('0x42')]=_['merge'](_0x3ee379['where'],{'$or':_[_0x610d('0x31')](_0x3ee379[_0x610d('0x39')],function(_0x59ec18){var _0x163543={};_0x163543[_0x59ec18]={'$like':'%'+_0x357778['query']['filter']+'%'};return _0x163543;})});}_0x3ee379=_[_0x610d('0x41')]({},_0x3ee379,_0x357778[_0x610d('0x45')]);return db[_0x610d('0x5f')][_0x610d('0x5c')]({'where':_0x3ee379['where']})['then'](function(_0x2312e9){_0x12f276['count']=_0x2312e9;if(_0x357778['query'][_0x610d('0x47')]){_0x3ee379[_0x610d('0x48')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x610d('0x5d')](_0x3ee379);})['then'](function(_0x465c57){_0x12f276['rows']=_0x465c57;return _0x12f276;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x15b722,_0x3ee379))[_0x610d('0x4a')](handleError(_0x15b722,null));};exports[_0x610d('0x61')]=function(_0x29c52f,_0x51b7bd,_0x87ec6c){var _0x1d3891={'raw':!![],'where':{}};var _0x1f9511={};var _0x53bc7a={'count':0x0,'rows':[]};return db[_0x610d('0x46')][_0x610d('0x5a')]({'where':{'id':_0x29c52f[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x51b7bd,null))[_0x610d('0x29')](function(_0x1ea9a7){if(_0x1ea9a7){_0x1f9511[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x62')][_0x610d('0x32')]);_0x1f9511['query']=_[_0x610d('0x37')](_0x29c52f['query']);_0x1f9511[_0x610d('0x40')]=_['intersection'](_0x1f9511['model'],_0x1f9511[_0x610d('0x36')]);_0x1d3891['attributes']=_[_0x610d('0x38')](_0x1f9511['model'],qs[_0x610d('0x3a')](_0x29c52f[_0x610d('0x36')]['fields']));_0x1d3891[_0x610d('0x39')]=_0x1d3891[_0x610d('0x39')][_0x610d('0x3b')]?_0x1d3891[_0x610d('0x39')]:_0x1f9511['model'];if(!_0x29c52f[_0x610d('0x36')][_0x610d('0x3c')](_0x610d('0x63'))){_0x1d3891['limit']=qs[_0x610d('0x1e')](_0x29c52f[_0x610d('0x36')][_0x610d('0x1e')]);_0x1d3891[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x29c52f[_0x610d('0x36')][_0x610d('0x1d')]);}_0x1d3891[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x29c52f['query']['sort']);_0x1d3891[_0x610d('0x42')]=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x29c52f[_0x610d('0x36')],_0x1f9511['filters']));_0x1d3891[_0x610d('0x42')][_0x610d('0x60')]=_0x1ea9a7['id'];if(_0x29c52f[_0x610d('0x36')][_0x610d('0x44')]){_0x1d3891[_0x610d('0x42')]=_[_0x610d('0x41')](_0x1d3891[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x1d3891['attributes'],function(_0x2f37d0){var _0x1b388c={};_0x1b388c[_0x2f37d0]={'$like':'%'+_0x29c52f[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x1b388c;})});}_0x1d3891=_['merge']({},_0x1d3891,_0x29c52f['options']);return db[_0x610d('0x62')][_0x610d('0x5c')]({'where':_0x1d3891['where']})[_0x610d('0x29')](function(_0x127234){_0x53bc7a['count']=_0x127234;if(_0x29c52f[_0x610d('0x36')][_0x610d('0x47')]){_0x1d3891[_0x610d('0x48')]=[{'all':!![]}];}return db[_0x610d('0x62')][_0x610d('0x5d')](_0x1d3891);})[_0x610d('0x29')](function(_0x317a48){_0x53bc7a[_0x610d('0x49')]=_0x317a48;return _0x53bc7a;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x51b7bd,_0x1d3891))['catch'](handleError(_0x51b7bd,null));};exports[_0x610d('0x64')]=function(_0x19c786,_0x562d2e,_0x146b6d){var _0x2e3a85={'raw':!![],'where':{}};var _0x3016f5={};var _0x480775={'count':0x0,'rows':[]};return db[_0x610d('0x46')][_0x610d('0x5a')]({'where':{'id':_0x19c786[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x562d2e,null))[_0x610d('0x29')](function(_0x3dbea1){if(_0x3dbea1){_0x3016f5[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmHopperBlack'][_0x610d('0x32')]);_0x3016f5[_0x610d('0x36')]=_[_0x610d('0x37')](_0x19c786[_0x610d('0x36')]);_0x3016f5[_0x610d('0x40')]=_[_0x610d('0x38')](_0x3016f5[_0x610d('0x35')],_0x3016f5['query']);_0x2e3a85[_0x610d('0x39')]=_[_0x610d('0x38')](_0x3016f5[_0x610d('0x35')],qs[_0x610d('0x3a')](_0x19c786[_0x610d('0x36')][_0x610d('0x3a')]));_0x2e3a85[_0x610d('0x39')]=_0x2e3a85[_0x610d('0x39')][_0x610d('0x3b')]?_0x2e3a85[_0x610d('0x39')]:_0x3016f5[_0x610d('0x35')];if(!_0x19c786[_0x610d('0x36')][_0x610d('0x3c')](_0x610d('0x63'))){_0x2e3a85[_0x610d('0x1e')]=qs['limit'](_0x19c786[_0x610d('0x36')][_0x610d('0x1e')]);_0x2e3a85[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x19c786[_0x610d('0x36')][_0x610d('0x1d')]);}_0x2e3a85[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x19c786[_0x610d('0x36')][_0x610d('0x3e')]);_0x2e3a85[_0x610d('0x42')]=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x19c786[_0x610d('0x36')],_0x3016f5[_0x610d('0x40')]));_0x2e3a85['where'][_0x610d('0x60')]=_0x3dbea1['id'];if(_0x19c786['query']['filter']){_0x2e3a85[_0x610d('0x42')]=_[_0x610d('0x41')](_0x2e3a85[_0x610d('0x42')],{'$or':_[_0x610d('0x31')](_0x2e3a85[_0x610d('0x39')],function(_0x5f0f5d){var _0x5384be={};_0x5384be[_0x5f0f5d]={'$like':'%'+_0x19c786['query'][_0x610d('0x44')]+'%'};return _0x5384be;})});}_0x2e3a85=_[_0x610d('0x41')]({},_0x2e3a85,_0x19c786[_0x610d('0x45')]);return db['CmHopperBlack'][_0x610d('0x5c')]({'where':_0x2e3a85[_0x610d('0x42')]})[_0x610d('0x29')](function(_0x13293f){_0x480775['count']=_0x13293f;if(_0x19c786[_0x610d('0x36')][_0x610d('0x47')]){_0x2e3a85['include']=[{'all':!![]}];}return db[_0x610d('0x65')]['findAll'](_0x2e3a85);})['then'](function(_0x454e18){_0x480775[_0x610d('0x49')]=_0x454e18;return _0x480775;});}})[_0x610d('0x29')](respondWithFilteredResult(_0x562d2e,_0x2e3a85))['catch'](handleError(_0x562d2e,null));};exports['getLists']=function(_0x24838b,_0x232cdb,_0x29de6f){var _0x12fec2={};var _0x1f355c={};var _0x347263;var _0x2cf784;return db[_0x610d('0x46')]['findOne']({'where':{'id':_0x24838b[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x232cdb,null))[_0x610d('0x29')](function(_0x113b3c){if(_0x113b3c){_0x347263=_0x113b3c;_0x1f355c[_0x610d('0x35')]=_[_0x610d('0x37')](db['CmList']['rawAttributes']);_0x1f355c[_0x610d('0x36')]=_[_0x610d('0x37')](_0x24838b[_0x610d('0x36')]);_0x1f355c[_0x610d('0x40')]=_[_0x610d('0x38')](_0x1f355c[_0x610d('0x35')],_0x1f355c[_0x610d('0x36')]);_0x12fec2[_0x610d('0x39')]=_[_0x610d('0x38')](_0x1f355c[_0x610d('0x35')],qs['fields'](_0x24838b[_0x610d('0x36')][_0x610d('0x3a')]));_0x12fec2[_0x610d('0x39')]=_0x12fec2[_0x610d('0x39')]['length']?_0x12fec2[_0x610d('0x39')]:_0x1f355c[_0x610d('0x35')];_0x12fec2[_0x610d('0x3d')]=qs[_0x610d('0x3e')](_0x24838b[_0x610d('0x36')][_0x610d('0x3e')]);_0x12fec2[_0x610d('0x42')]=qs['filters'](_['pick'](_0x24838b['query'],_0x1f355c[_0x610d('0x40')]));if(_0x24838b[_0x610d('0x36')][_0x610d('0x44')]){_0x12fec2[_0x610d('0x42')]=_[_0x610d('0x41')](_0x12fec2[_0x610d('0x42')],{'$or':_['map'](_0x12fec2['attributes'],function(_0x391444){var _0xcb169a={};_0xcb169a[_0x391444]={'$like':'%'+_0x24838b['query'][_0x610d('0x44')]+'%'};return _0xcb169a;})});}_0x12fec2=_['merge']({},_0x12fec2,_0x24838b[_0x610d('0x45')]);return _0x347263[_0x610d('0x66')](_0x12fec2);}})[_0x610d('0x29')](function(_0x272053){if(_0x272053){_0x2cf784=_0x272053[_0x610d('0x3b')];if(!_0x24838b[_0x610d('0x36')]['hasOwnProperty']('nolimit')){_0x12fec2[_0x610d('0x1e')]=qs[_0x610d('0x1e')](_0x24838b['query'][_0x610d('0x1e')]);_0x12fec2[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x24838b[_0x610d('0x36')][_0x610d('0x1d')]);}return _0x347263[_0x610d('0x66')](_0x12fec2);}})[_0x610d('0x29')](function(_0x2ffc4a){if(_0x2ffc4a){return _0x2ffc4a?{'count':_0x2cf784,'rows':_0x2ffc4a}:null;}})[_0x610d('0x29')](respondWithResult(_0x232cdb,null))[_0x610d('0x4a')](handleError(_0x232cdb,null));};exports[_0x610d('0x67')]=function(_0x42364c,_0x3ddb2f,_0x42ec64){var _0x59b5c9,_0x51eb27;var _0x9b78db=[];var _0x1dc97a=moment()[_0x610d('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x42364c[_0x610d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ddb2f,null))['then'](function(_0x18e2ba){if(_0x18e2ba){_0x51eb27=_0x18e2ba;return _0x18e2ba[_0x610d('0x67')](_0x42364c[_0x610d('0x4e')]['ids'],_[_0x610d('0x56')](_0x42364c[_0x610d('0x4e')],[_0x610d('0x69'),'id'])||{});}return null;})[_0x610d('0x6a')](function(_0x24fbfd){var _0x170e02;var _0xbc6672;_0x59b5c9=_0x24fbfd||[];var _0x137f77=[];if(_0x24fbfd){for(var _0x5789d8=0x0;_0x5789d8<_0x24fbfd[_0x610d('0x3b')];_0x5789d8+=0x1){var _0x1d3362=_0x24fbfd[_0x5789d8][_0x610d('0x2a')]({'plain':!![]});_0x51eb27['dialCheckDuplicateType']=_0x42364c['body']['dialCheckDuplicateType']?_0x42364c[_0x610d('0x4e')][_0x610d('0x6b')]:_0x51eb27[_0x610d('0x6b')];switch(_0x51eb27[_0x610d('0x6b')]){case'always':_0x170e02=squel[_0x610d('0x6c')]()[_0x610d('0x6d')](_0x610d('0x6e'))['fromQuery']([_0x610d('0x6f'),_0x610d('0x70'),_0x610d('0x71'),_0x610d('0x72'),_0x610d('0x60'),_0x610d('0x57'),_0x610d('0x55')],squel[_0x610d('0x73')]()[_0x610d('0x74')]('phone',_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x75'),'scheduledAt')[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x1d3362['CmListId'][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x42364c[_0x610d('0x4b')]['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))[_0x610d('0x77')](_0x610d('0x78'))['where'](_0x610d('0x79'))[_0x610d('0x42')]('ListId\x20=\x20?',_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')]())[_0x610d('0x42')](_0x610d('0x7b'))[_0x610d('0x42')](_0x610d('0x7c'),squel[_0x610d('0x73')]()[_0x610d('0x74')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x610d('0x7d'))[_0x610d('0x42')](_0x610d('0x7e'),_0x42364c['params']['id'][_0x610d('0x76')]()))[_0x610d('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x610d('0x74')]('COALESCE(phone,\x27\x27)')[_0x610d('0x77')](_0x610d('0x6e'))[_0x610d('0x42')](_0x610d('0x7e'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())))[_0x610d('0x76')]();break;case'onlyIfOpen':_0x170e02=squel[_0x610d('0x6c')]()['into'](_0x610d('0x6e'))[_0x610d('0x7f')](['phone',_0x610d('0x70'),_0x610d('0x71'),_0x610d('0x72'),_0x610d('0x60'),_0x610d('0x57'),'updatedAt'],squel['select']()['field'](_0x610d('0x6f'),_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x70'))['field']('id','ContactId')[_0x610d('0x74')](_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')](),'ListId')[_0x610d('0x74')](_0x42364c['params']['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))[_0x610d('0x77')](_0x610d('0x78'))[_0x610d('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1d3362['CmListId'][_0x610d('0x76')]())['where'](_0x610d('0x7b'))[_0x610d('0x42')](_0x610d('0x7c'),squel[_0x610d('0x73')]()[_0x610d('0x74')](_0x610d('0x80'))[_0x610d('0x77')]('cm_hopper')['where'](_0x610d('0x7e'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())))[_0x610d('0x76')]();break;default:_0x170e02=squel['insert']()[_0x610d('0x6d')](_0x610d('0x6e'))[_0x610d('0x7f')]([_0x610d('0x6f'),'scheduledAt',_0x610d('0x71'),_0x610d('0x72'),'CampaignId',_0x610d('0x57'),_0x610d('0x55')],squel['select']()['field'](_0x610d('0x6f'),_0x610d('0x6f'))['field'](_0x610d('0x75'),_0x610d('0x70'))[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x42364c['params']['id'][_0x610d('0x76')](),_0x610d('0x60'))['field']('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))['field']('\x27'+_0x1dc97a+'\x27','updatedAt')[_0x610d('0x77')]('cm_contacts')[_0x610d('0x42')]('deletedAt\x20IS\x20NULL')[_0x610d('0x42')](_0x610d('0x81'),_0x1d3362[_0x610d('0x7a')]['toString']())[_0x610d('0x42')](_0x610d('0x7b')))[_0x610d('0x76')]();}_0xbc6672=squel[_0x610d('0x6c')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x610d('0x82'),_0x610d('0x70'),'phone',_0x610d('0x83'),'createdAt',_0x610d('0x55')],squel[_0x610d('0x73')]()[_0x610d('0x74')]('h.id','id')['field'](_0x610d('0x75'),_0x610d('0x70'))['field']('ci.item',_0x610d('0x6f'))[_0x610d('0x74')](_0x610d('0x84'),_0x610d('0x83'))[_0x610d('0x74')]('\x27'+_0x1dc97a+'\x27',_0x610d('0x57'))['field']('\x27'+_0x1dc97a+'\x27',_0x610d('0x55'))['from'](_0x610d('0x85'),'ci')['join'](_0x610d('0x6e'),'h',_0x610d('0x86'))[_0x610d('0x42')](_0x610d('0x87'),_0x1d3362[_0x610d('0x7a')][_0x610d('0x76')]())[_0x610d('0x42')](_0x610d('0x88'),_0x42364c[_0x610d('0x4b')]['id'][_0x610d('0x76')]())[_0x610d('0x42')]('h.createdAt\x20=\x20?',_0x1dc97a))[_0x610d('0x76')]();_0x137f77['push'](db[_0x610d('0x89')][_0x610d('0x36')](_0x170e02));_0x9b78db[_0x610d('0x8a')](db[_0x610d('0x89')][_0x610d('0x36')](_0xbc6672));}return BPromise['all'](_0x137f77);}})['then'](function(){return BPromise[_0x610d('0x8b')](_0x9b78db);})[_0x610d('0x29')](function(){return _0x59b5c9;})[_0x610d('0x29')](respondWithResult(_0x3ddb2f,null))[_0x610d('0x4a')](handleError(_0x3ddb2f,null));};exports[_0x610d('0x8c')]=function(_0x137d30,_0xd55192,_0x137eb6){return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x137d30[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0xd55192,null))[_0x610d('0x29')](function(_0x3adf86){if(_0x3adf86){return _0x3adf86[_0x610d('0x8c')](_0x137d30['query'][_0x610d('0x69')]);}})[_0x610d('0x29')](function(_0x16d85b){if(_0x16d85b){return db[_0x610d('0x5b')][_0x610d('0x28')]({'where':{'ListId':_0x137d30[_0x610d('0x36')]['ids'],'CampaignId':_0x137d30[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](function(){return _0x16d85b;});}})[_0x610d('0x29')](respondWithStatusCode(_0xd55192,null))[_0x610d('0x4a')](handleError(_0xd55192,null));};exports['getBlackLists']=function(_0x5a8368,_0x2ddce6,_0x2107e3){var _0x3b8ece={};var _0x19ef4b={};var _0x500437;var _0x12fe22;return db[_0x610d('0x46')]['findOne']({'where':{'id':_0x5a8368[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x2ddce6,null))[_0x610d('0x29')](function(_0x4322b3){if(_0x4322b3){_0x500437=_0x4322b3;_0x19ef4b[_0x610d('0x35')]=_[_0x610d('0x37')](db[_0x610d('0x8d')][_0x610d('0x32')]);_0x19ef4b['query']=_[_0x610d('0x37')](_0x5a8368[_0x610d('0x36')]);_0x19ef4b[_0x610d('0x40')]=_[_0x610d('0x38')](_0x19ef4b[_0x610d('0x35')],_0x19ef4b['query']);_0x3b8ece[_0x610d('0x39')]=_[_0x610d('0x38')](_0x19ef4b[_0x610d('0x35')],qs['fields'](_0x5a8368['query'][_0x610d('0x3a')]));_0x3b8ece[_0x610d('0x39')]=_0x3b8ece[_0x610d('0x39')][_0x610d('0x3b')]?_0x3b8ece['attributes']:_0x19ef4b['model'];_0x3b8ece[_0x610d('0x3d')]=qs['sort'](_0x5a8368[_0x610d('0x36')]['sort']);_0x3b8ece['where']=qs[_0x610d('0x40')](_[_0x610d('0x3f')](_0x5a8368[_0x610d('0x36')],_0x19ef4b[_0x610d('0x40')]));if(_0x5a8368[_0x610d('0x36')]['filter']){_0x3b8ece[_0x610d('0x42')]=_['merge'](_0x3b8ece[_0x610d('0x42')],{'$or':_['map'](_0x3b8ece[_0x610d('0x39')],function(_0x58378b){var _0x3f172e={};_0x3f172e[_0x58378b]={'$like':'%'+_0x5a8368[_0x610d('0x36')][_0x610d('0x44')]+'%'};return _0x3f172e;})});}_0x3b8ece=_[_0x610d('0x41')]({},_0x3b8ece,_0x5a8368['options']);return _0x500437[_0x610d('0x8e')](_0x3b8ece);}})[_0x610d('0x29')](function(_0x5451be){if(_0x5451be){_0x12fe22=_0x5451be[_0x610d('0x3b')];if(!_0x5a8368[_0x610d('0x36')]['hasOwnProperty'](_0x610d('0x63'))){_0x3b8ece['limit']=qs[_0x610d('0x1e')](_0x5a8368[_0x610d('0x36')]['limit']);_0x3b8ece[_0x610d('0x1d')]=qs[_0x610d('0x1d')](_0x5a8368[_0x610d('0x36')][_0x610d('0x1d')]);}return _0x500437[_0x610d('0x8e')](_0x3b8ece);}})[_0x610d('0x29')](function(_0x3f0c94){if(_0x3f0c94){return _0x3f0c94?{'count':_0x12fe22,'rows':_0x3f0c94}:null;}})['then'](respondWithResult(_0x2ddce6,null))[_0x610d('0x4a')](handleError(_0x2ddce6,null));};exports[_0x610d('0x8f')]=function(_0x3be743,_0x3b3fbe,_0x108ea6){var _0x3da964,_0x3a047b;var _0x3e945d=[];var _0x5a5492=moment()['format'](_0x610d('0x90'));return db[_0x610d('0x46')][_0x610d('0x4c')]({'where':{'id':_0x3be743[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x3b3fbe,null))['then'](function(_0xc936cf){if(_0xc936cf){_0x3a047b=_0xc936cf;return _0xc936cf[_0x610d('0x8f')](_0x3be743[_0x610d('0x4e')][_0x610d('0x69')],_[_0x610d('0x56')](_0x3be743[_0x610d('0x4e')],['ids','id'])||{});}return null;})[_0x610d('0x6a')](function(_0x1b9b45){var _0x4df8ec;var _0x1126c8;_0x3da964=_0x1b9b45||[];var _0x8a5d2c=[];if(_0x1b9b45){for(var _0xdad211=0x0;_0xdad211<_0x1b9b45[_0x610d('0x3b')];_0xdad211+=0x1){var _0x42627d=_0x1b9b45[_0xdad211][_0x610d('0x2a')]({'plain':!![]});_0x4df8ec=squel['insert']()[_0x610d('0x6d')](_0x610d('0x91'))[_0x610d('0x7f')]([_0x610d('0x6f'),_0x610d('0x71'),'ListId',_0x610d('0x60'),_0x610d('0x57'),_0x610d('0x55')],squel[_0x610d('0x73')]()['field']('phone',_0x610d('0x6f'))[_0x610d('0x74')]('id',_0x610d('0x71'))[_0x610d('0x74')](_0x42627d['CmListId'][_0x610d('0x76')](),_0x610d('0x72'))[_0x610d('0x74')](_0x3be743[_0x610d('0x4b')]['id']['toString'](),_0x610d('0x60'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x57'))[_0x610d('0x74')](_0x610d('0x75'),_0x610d('0x55'))['from'](_0x610d('0x78'))['where'](_0x610d('0x79'))[_0x610d('0x42')](_0x610d('0x81'),_0x42627d[_0x610d('0x7a')]['toString']())[_0x610d('0x42')](_0x610d('0x7b')))[_0x610d('0x76')]();_0x8a5d2c['push'](db[_0x610d('0x89')]['query'](_0x4df8ec));}return BPromise[_0x610d('0x8b')](_0x8a5d2c);}})[_0x610d('0x29')](function(){return _0x3da964;})[_0x610d('0x29')](respondWithResult(_0x3b3fbe,null))[_0x610d('0x4a')](handleError(_0x3b3fbe,null));};exports[_0x610d('0x92')]=function(_0x563656,_0x46983b,_0x4c21fa){return db['Campaign'][_0x610d('0x4c')]({'where':{'id':_0x563656['params']['id']}})[_0x610d('0x29')](handleEntityNotFound(_0x46983b,null))[_0x610d('0x29')](function(_0x41857a){if(_0x41857a){return _0x41857a[_0x610d('0x92')](_0x563656[_0x610d('0x36')][_0x610d('0x69')]);}})[_0x610d('0x29')](function(_0x56bd57){if(_0x56bd57){return db['CmHopperBlack'][_0x610d('0x28')]({'where':{'ListId':_0x563656[_0x610d('0x36')][_0x610d('0x69')],'CampaignId':_0x563656[_0x610d('0x4b')]['id']}})[_0x610d('0x29')](function(){return _0x56bd57;});}})[_0x610d('0x29')](respondWithStatusCode(_0x46983b,null))['catch'](handleError(_0x46983b,null));}; \ No newline at end of file +var _0x4f8b=['COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','name','send','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Campaign','includeAll','include','findAll','catch','rawAttributes','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','error','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','insert','into','fromQuery'];(function(_0x3660a3,_0x19f6c6){var _0x121a2b=function(_0x1af75b){while(--_0x1af75b){_0x3660a3['push'](_0x3660a3['shift']());}};_0x121a2b(++_0x19f6c6);}(_0x4f8b,0x12e));var _0xb4f8=function(_0x35b622,_0x2fa4a1){_0x35b622=_0x35b622-0x0;var _0x447767=_0x4f8b[_0x35b622];return _0x447767;};'use strict';var emlformat=require(_0xb4f8('0x0'));var rimraf=require(_0xb4f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4f8('0x2'));var moment=require(_0xb4f8('0x3'));var BPromise=require(_0xb4f8('0x4'));var Mustache=require(_0xb4f8('0x5'));var util=require(_0xb4f8('0x6'));var path=require('path');var sox=require(_0xb4f8('0x7'));var csv=require(_0xb4f8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4f8('0x9'));var _=require(_0xb4f8('0xa'));var squel=require('squel');var crypto=require(_0xb4f8('0xb'));var jsforce=require(_0xb4f8('0xc'));var deskjs=require(_0xb4f8('0xd'));var toCsv=require(_0xb4f8('0x8'));var querystring=require(_0xb4f8('0xe'));var Papa=require(_0xb4f8('0xf'));var Redis=require(_0xb4f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4f8('0x11'));var as=require(_0xb4f8('0x12'));var hardwareService=require(_0xb4f8('0x13'));var logger=require(_0xb4f8('0x14'))(_0xb4f8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb4f8('0x16'))['db'];function respondWithStatusCode(_0x55f60b,_0x26c8fb){_0x26c8fb=_0x26c8fb||0xcc;return function(_0x1d0a37){if(_0x1d0a37){return _0x55f60b['sendStatus'](_0x26c8fb);}return _0x55f60b[_0xb4f8('0x17')](_0x26c8fb)[_0xb4f8('0x18')]();};}function respondWithResult(_0xacdbad,_0x309b62){_0x309b62=_0x309b62||0xc8;return function(_0x4d3017){if(_0x4d3017){return _0xacdbad[_0xb4f8('0x17')](_0x309b62)[_0xb4f8('0x19')](_0x4d3017);}};}function respondWithFilteredResult(_0x39ed9e,_0x4f00a0){return function(_0x2061e2){if(_0x2061e2){var _0x47ebe5=typeof _0x4f00a0[_0xb4f8('0x1a')]===_0xb4f8('0x1b')&&typeof _0x4f00a0[_0xb4f8('0x1c')]===_0xb4f8('0x1b');var _0x578e4c=_0x2061e2[_0xb4f8('0x1d')];var _0x4c3e35=_0x47ebe5?0x0:_0x4f00a0[_0xb4f8('0x1a')];var _0x1a50bd=_0x47ebe5?_0x2061e2[_0xb4f8('0x1d')]:_0x4f00a0['offset']+_0x4f00a0[_0xb4f8('0x1c')];var _0x4eff64;if(_0x1a50bd>=_0x578e4c){_0x1a50bd=_0x578e4c;_0x4eff64=0xc8;}else{_0x4eff64=0xce;}_0x39ed9e[_0xb4f8('0x17')](_0x4eff64);return _0x39ed9e['set'](_0xb4f8('0x1e'),_0x4c3e35+'-'+_0x1a50bd+'/'+_0x578e4c)[_0xb4f8('0x19')](_0x2061e2);}return null;};}function patchUpdates(_0x1c1a84){return function(_0x380649){try{jsonpatch[_0xb4f8('0x1f')](_0x380649,_0x1c1a84,!![]);}catch(_0x3ef98c){return BPromise[_0xb4f8('0x20')](_0x3ef98c);}return _0x380649['save']();};}function saveUpdates(_0x53ce83,_0x4415e7){return function(_0x35311c){if(_0x35311c){return _0x35311c[_0xb4f8('0x21')](_0x53ce83)[_0xb4f8('0x22')](function(_0x2bfdf2){return _0x2bfdf2;});}return null;};}function removeEntity(_0x56eb04,_0x3eb502){return function(_0x3a37e9){if(_0x3a37e9){return _0x3a37e9['destroy']()[_0xb4f8('0x22')](function(){var _0x18efcb=_0x3a37e9[_0xb4f8('0x23')]({'plain':!![]});var _0x54e6fc=_0xb4f8('0x24');return db[_0xb4f8('0x25')][_0xb4f8('0x26')]({'where':{'type':_0x54e6fc,'resourceId':_0x18efcb['id']}})['then'](function(){return _0x3a37e9;});})[_0xb4f8('0x22')](function(){_0x56eb04[_0xb4f8('0x17')](0xcc)[_0xb4f8('0x18')]();});}};}function handleEntityNotFound(_0x5ab6ac,_0x46d85e){return function(_0x1847c6){if(!_0x1847c6){_0x5ab6ac[_0xb4f8('0x27')](0x194);}return _0x1847c6;};}function handleError(_0x2801d9,_0x2183e1){_0x2183e1=_0x2183e1||0x1f4;return function(_0x44ed1f){logger['error'](_0x44ed1f[_0xb4f8('0x28')]);if(_0x44ed1f[_0xb4f8('0x29')]){delete _0x44ed1f[_0xb4f8('0x29')];}_0x2801d9[_0xb4f8('0x17')](_0x2183e1)[_0xb4f8('0x2a')](_0x44ed1f);};}exports['index']=function(_0x45cd75,_0xd58c27){var _0xfbd30f={},_0x511bf8={},_0x3b3a40={'count':0x0,'rows':[]};var _0x312f9a=_['map'](db['Campaign']['rawAttributes'],function(_0x5c5899){return{'name':_0x5c5899[_0xb4f8('0x2b')],'type':_0x5c5899[_0xb4f8('0x2c')][_0xb4f8('0x2d')]};});_0x511bf8[_0xb4f8('0x2e')]=_[_0xb4f8('0x2f')](_0x312f9a,_0xb4f8('0x29'));_0x511bf8['query']=_[_0xb4f8('0x30')](_0x45cd75[_0xb4f8('0x31')]);_0x511bf8[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x511bf8[_0xb4f8('0x2e')],_0x511bf8[_0xb4f8('0x31')]);_0xfbd30f['attributes']=_[_0xb4f8('0x33')](_0x511bf8['model'],qs['fields'](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xfbd30f[_0xb4f8('0x35')]=_0xfbd30f['attributes'][_0xb4f8('0x36')]?_0xfbd30f[_0xb4f8('0x35')]:_0x511bf8[_0xb4f8('0x2e')];if(!_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0xfbd30f['limit']=qs[_0xb4f8('0x1c')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xfbd30f['offset']=qs[_0xb4f8('0x1a')](_0x45cd75['query']['offset']);}_0xfbd30f[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xfbd30f[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x45cd75['query'],_0x511bf8[_0xb4f8('0x32')]),_0x312f9a);if(_0x45cd75['query'][_0xb4f8('0x3d')]){_0xfbd30f['where']=_['merge'](_0xfbd30f[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x312f9a,function(_0x45a398){if(_0x45a398[_0xb4f8('0x2c')]!=='VIRTUAL'){var _0x61fbbb={};_0x61fbbb[_0x45a398[_0xb4f8('0x29')]]={'$like':'%'+_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x61fbbb;}})});}_0xfbd30f=_[_0xb4f8('0x3e')]({},_0xfbd30f,_0x45cd75[_0xb4f8('0x3f')]);var _0x541c17={'where':_0xfbd30f['where']};return db[_0xb4f8('0x40')][_0xb4f8('0x1d')](_0x541c17)[_0xb4f8('0x22')](function(_0x468066){_0x3b3a40[_0xb4f8('0x1d')]=_0x468066;if(_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xfbd30f[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x40')][_0xb4f8('0x43')](_0xfbd30f);})[_0xb4f8('0x22')](function(_0x10910c){_0x3b3a40['rows']=_0x10910c;return _0x3b3a40;})['then'](respondWithFilteredResult(_0xd58c27,_0xfbd30f))[_0xb4f8('0x44')](handleError(_0xd58c27,null));};exports['show']=function(_0x3ebe57,_0x2b5526){var _0xb7ccef={'raw':![],'where':{'id':_0x3ebe57['params']['id']}},_0x20d4ef={};_0x20d4ef[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['Campaign'][_0xb4f8('0x45')]);_0x20d4ef[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3ebe57['query']);_0x20d4ef[_0xb4f8('0x32')]=_['intersection'](_0x20d4ef['model'],_0x20d4ef[_0xb4f8('0x31')]);_0xb7ccef[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x20d4ef[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xb7ccef[_0xb4f8('0x35')]=_0xb7ccef[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xb7ccef[_0xb4f8('0x35')]:_0x20d4ef['model'];if(_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xb7ccef[_0xb4f8('0x42')]=[{'all':!![]}];}_0xb7ccef=_['merge']({},_0xb7ccef,_0x3ebe57['options']);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0xb7ccef)[_0xb4f8('0x22')](handleEntityNotFound(_0x2b5526,null))[_0xb4f8('0x22')](respondWithResult(_0x2b5526,null))['catch'](handleError(_0x2b5526,null));};exports['create']=function(_0x354193,_0xd6f96a){return db[_0xb4f8('0x40')]['create'](_0x354193['body'],{})[_0xb4f8('0x22')](function(_0x209080){var _0x5af092=_0x354193['user'][_0xb4f8('0x23')]({'plain':!![]});if(!_0x5af092)throw new Error(_0xb4f8('0x47'));if(_0x5af092[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x764bee=_0x209080[_0xb4f8('0x23')]({'plain':!![]});var _0x2bedde='IvrCampaigns';return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2bedde,'userProfileId':_0x5af092[_0xb4f8('0x4a')]},'raw':!![]})[_0xb4f8('0x22')](function(_0x26b3e9){if(_0x26b3e9&&_0x26b3e9[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x764bee[_0xb4f8('0x29')],'resourceId':_0x764bee['id'],'type':_0x26b3e9[_0xb4f8('0x29')],'sectionId':_0x26b3e9['id']},{})[_0xb4f8('0x22')](function(){return _0x209080;});}else{return _0x209080;}})[_0xb4f8('0x44')](function(_0x2fa127){logger[_0xb4f8('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa127);throw _0x2fa127;});}return _0x209080;})[_0xb4f8('0x22')](respondWithResult(_0xd6f96a,0xc9))[_0xb4f8('0x44')](handleError(_0xd6f96a,null));};exports[_0xb4f8('0x4e')]=function(_0x145972,_0x26ec45){var _0x19723f={'where':{'id':_0x145972[_0xb4f8('0x4f')]['id']}},_0x4f7d97={};_0x4f7d97[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x40')][_0xb4f8('0x45')]);_0x19723f[_0xb4f8('0x35')]=_['intersection'](_0x4f7d97[_0xb4f8('0x2e')],qs['fields'](_0x145972['query'][_0xb4f8('0x34')]));_0x19723f[_0xb4f8('0x35')]=_0x19723f[_0xb4f8('0x35')]['length']?_0x19723f['attributes']:_0x4f7d97[_0xb4f8('0x2e')];if(_0x145972[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x19723f[_0xb4f8('0x42')]=[{'all':!![]}];}_0x19723f=_[_0xb4f8('0x3e')]({},_0x19723f,_0x145972[_0xb4f8('0x3f')]);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0x19723f)['then'](handleEntityNotFound(_0x26ec45,null))[_0xb4f8('0x22')](function(_0x2b5f3b){if(_0x2b5f3b){var _0xb7ff27=_0x2b5f3b[_0xb4f8('0x23')]({'plain':!![]});_0xb7ff27=qs[_0xb4f8('0x50')](_0xb7ff27,['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);_0x145972[_0xb4f8('0x53')]=_[_0xb4f8('0x50')](_0x145972[_0xb4f8('0x53')],['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);return db['Campaign'][_0xb4f8('0x4c')](_[_0xb4f8('0x3e')](_0xb7ff27,_0x145972[_0xb4f8('0x53')]),{'include':_0x145972['query']['includeAll']?[{'all':!![]}]:undefined})[_0xb4f8('0x22')](function(_0x190860){var _0x2b0e43=_0x145972[_0xb4f8('0x49')]['get']({'plain':!![]});if(!_0x2b0e43)throw new Error(_0xb4f8('0x47'));if(_0x2b0e43[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x2b7c6f=_0x190860[_0xb4f8('0x23')]({'plain':!![]});var _0x2ed38c=_0xb4f8('0x24');return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2ed38c,'userProfileId':_0x2b0e43['userProfileId']},'raw':!![]})[_0xb4f8('0x22')](function(_0x4335a2){if(_0x4335a2&&_0x4335a2[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x2b7c6f[_0xb4f8('0x29')],'resourceId':_0x2b7c6f['id'],'type':_0x4335a2[_0xb4f8('0x29')],'sectionId':_0x4335a2['id']},{})[_0xb4f8('0x22')](function(){return _0x190860;});}else{return _0x190860;}})[_0xb4f8('0x44')](function(_0xe413a6){logger['error'](_0xb4f8('0x54'),_0xe413a6);throw _0xe413a6;});}return _0x190860;});}})[_0xb4f8('0x22')](respondWithResult(_0x26ec45,0xc9))['catch'](handleError(_0x26ec45,null));};exports[_0xb4f8('0x21')]=function(_0x5181da,_0x51036a){if(_0x5181da['body']['id']){delete _0x5181da[_0xb4f8('0x53')]['id'];}return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5181da[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x51036a,null))[_0xb4f8('0x22')](saveUpdates(_0x5181da[_0xb4f8('0x53')],null))[_0xb4f8('0x22')](respondWithResult(_0x51036a,null))['catch'](handleError(_0x51036a,null));};exports['destroy']=function(_0x287159,_0x4ad8cc){return db[_0xb4f8('0x40')][_0xb4f8('0x46')]({'where':{'id':_0x287159['params']['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x4ad8cc,null))['then'](removeEntity(_0x4ad8cc,null))[_0xb4f8('0x44')](handleError(_0x4ad8cc,null));};exports[_0xb4f8('0x55')]=function(_0x3d7c55,_0x27957e,_0x5cf35f){var _0x5c61c3={'raw':!![],'where':{}};var _0x2bf0af={};var _0x452fad={'count':0x0,'rows':[]};return db['Campaign'][_0xb4f8('0x56')]({'where':{'id':_0x3d7c55[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x27957e,null))[_0xb4f8('0x22')](function(_0x5b91b7){if(_0x5b91b7){_0x2bf0af[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x57')][_0xb4f8('0x45')]);_0x2bf0af[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3d7c55['query']);_0x2bf0af[_0xb4f8('0x32')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],_0x2bf0af[_0xb4f8('0x31')]);_0x5c61c3[_0xb4f8('0x35')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x5c61c3[_0xb4f8('0x35')]=_0x5c61c3[_0xb4f8('0x35')]['length']?_0x5c61c3[_0xb4f8('0x35')]:_0x2bf0af[_0xb4f8('0x2e')];if(!_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x5c61c3[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x5c61c3[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x5c61c3[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x3d7c55[_0xb4f8('0x31')]['sort']);_0x5c61c3[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x3d7c55[_0xb4f8('0x31')],_0x2bf0af[_0xb4f8('0x32')]));_0x5c61c3[_0xb4f8('0x3b')][_0xb4f8('0x58')]=_0x5b91b7['id'];if(_0x3d7c55[_0xb4f8('0x31')]['filter']){_0x5c61c3[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x5c61c3[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x5c61c3[_0xb4f8('0x35')],function(_0x33d582){var _0x1ebf98={};_0x1ebf98[_0x33d582]={'$like':'%'+_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x1ebf98;})});}_0x5c61c3=_[_0xb4f8('0x3e')]({},_0x5c61c3,_0x3d7c55[_0xb4f8('0x3f')]);return db[_0xb4f8('0x57')][_0xb4f8('0x1d')]({'where':_0x5c61c3[_0xb4f8('0x3b')]})['then'](function(_0x504d70){_0x452fad['count']=_0x504d70;if(_0x3d7c55['query'][_0xb4f8('0x41')]){_0x5c61c3[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0xb4f8('0x43')](_0x5c61c3);})['then'](function(_0x157c94){_0x452fad[_0xb4f8('0x59')]=_0x157c94;return _0x452fad;});}})['then'](respondWithFilteredResult(_0x27957e,_0x5c61c3))[_0xb4f8('0x44')](handleError(_0x27957e,null));};exports[_0xb4f8('0x5a')]=function(_0x3b0a96,_0x143f5e,_0xd679bb){var _0x38cf92={'raw':!![],'where':{}};var _0x10e684={};var _0x38ff42={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x3b0a96[_0xb4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x143f5e,null))[_0xb4f8('0x22')](function(_0x328f16){if(_0x328f16){_0x10e684[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['CmHopperHistory']['rawAttributes']);_0x10e684[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3b0a96[_0xb4f8('0x31')]);_0x10e684[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x10e684[_0xb4f8('0x2e')],_0x10e684[_0xb4f8('0x31')]);_0x38cf92[_0xb4f8('0x35')]=_['intersection'](_0x10e684[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3b0a96['query']['fields']));_0x38cf92[_0xb4f8('0x35')]=_0x38cf92[_0xb4f8('0x35')]['length']?_0x38cf92['attributes']:_0x10e684[_0xb4f8('0x2e')];if(!_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x37')]('nolimit')){_0x38cf92[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x38cf92[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x38cf92[_0xb4f8('0x39')]=qs['sort'](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0x38cf92[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x3b0a96['query'],_0x10e684['filters']));_0x38cf92[_0xb4f8('0x3b')]['CampaignId']=_0x328f16['id'];if(_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x38cf92[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x38cf92[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x38cf92[_0xb4f8('0x35')],function(_0x6fdde9){var _0x56a972={};_0x56a972[_0x6fdde9]={'$like':'%'+_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x56a972;})});}_0x38cf92=_[_0xb4f8('0x3e')]({},_0x38cf92,_0x3b0a96[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5b')]['count']({'where':_0x38cf92['where']})[_0xb4f8('0x22')](function(_0x11107c){_0x38ff42[_0xb4f8('0x1d')]=_0x11107c;if(_0x3b0a96['query'][_0xb4f8('0x41')]){_0x38cf92[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x5b')]['findAll'](_0x38cf92);})[_0xb4f8('0x22')](function(_0x51ac1c){_0x38ff42[_0xb4f8('0x59')]=_0x51ac1c;return _0x38ff42;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x143f5e,_0x38cf92))[_0xb4f8('0x44')](handleError(_0x143f5e,null));};exports[_0xb4f8('0x5c')]=function(_0x2293de,_0x7efc72,_0x28ee6d){var _0x190b52={'raw':!![],'where':{}};var _0x16e5d1={};var _0x5f2268={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x2293de[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x7efc72,null))[_0xb4f8('0x22')](function(_0x260599){if(_0x260599){_0x16e5d1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5d')][_0xb4f8('0x45')]);_0x16e5d1[_0xb4f8('0x31')]=_['keys'](_0x2293de[_0xb4f8('0x31')]);_0x16e5d1[_0xb4f8('0x32')]=_['intersection'](_0x16e5d1[_0xb4f8('0x2e')],_0x16e5d1[_0xb4f8('0x31')]);_0x190b52[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x16e5d1[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x2293de[_0xb4f8('0x31')]['fields']));_0x190b52[_0xb4f8('0x35')]=_0x190b52[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0x190b52[_0xb4f8('0x35')]:_0x16e5d1['model'];if(!_0x2293de['query'][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x190b52[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x190b52[_0xb4f8('0x1a')]=qs['offset'](_0x2293de['query'][_0xb4f8('0x1a')]);}_0x190b52['order']=qs[_0xb4f8('0x3a')](_0x2293de['query'][_0xb4f8('0x3a')]);_0x190b52['where']=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x2293de[_0xb4f8('0x31')],_0x16e5d1[_0xb4f8('0x32')]));_0x190b52['where']['CampaignId']=_0x260599['id'];if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x190b52[_0xb4f8('0x3b')]=_['merge'](_0x190b52[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x190b52[_0xb4f8('0x35')],function(_0x49ce04){var _0x429b74={};_0x429b74[_0x49ce04]={'$like':'%'+_0x2293de[_0xb4f8('0x31')]['filter']+'%'};return _0x429b74;})});}_0x190b52=_[_0xb4f8('0x3e')]({},_0x190b52,_0x2293de[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5d')][_0xb4f8('0x1d')]({'where':_0x190b52[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x317852){_0x5f2268[_0xb4f8('0x1d')]=_0x317852;if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x190b52['include']=[{'all':!![]}];}return db[_0xb4f8('0x5d')][_0xb4f8('0x43')](_0x190b52);})[_0xb4f8('0x22')](function(_0x832959){_0x5f2268[_0xb4f8('0x59')]=_0x832959;return _0x5f2268;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x7efc72,_0x190b52))['catch'](handleError(_0x7efc72,null));};exports['getHopperBlacks']=function(_0x4c3a22,_0x22e240,_0x523834){var _0x1d0f50={'raw':!![],'where':{}};var _0x5cdcf1={};var _0x13ca9c={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x4c3a22['params']['id']}})['then'](handleEntityNotFound(_0x22e240,null))['then'](function(_0xeaf7ea){if(_0xeaf7ea){_0x5cdcf1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5e')][_0xb4f8('0x45')]);_0x5cdcf1[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x4c3a22[_0xb4f8('0x31')]);_0x5cdcf1[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x5cdcf1[_0xb4f8('0x2e')],_0x5cdcf1[_0xb4f8('0x31')]);_0x1d0f50['attributes']=_[_0xb4f8('0x33')](_0x5cdcf1['model'],qs[_0xb4f8('0x34')](_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x1d0f50[_0xb4f8('0x35')]=_0x1d0f50[_0xb4f8('0x35')]['length']?_0x1d0f50[_0xb4f8('0x35')]:_0x5cdcf1[_0xb4f8('0x2e')];if(!_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x1d0f50['limit']=qs[_0xb4f8('0x1c')](_0x4c3a22['query']['limit']);_0x1d0f50[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x4c3a22[_0xb4f8('0x31')]['offset']);}_0x1d0f50[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x4c3a22['query'][_0xb4f8('0x3a')]);_0x1d0f50[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x4c3a22[_0xb4f8('0x31')],_0x5cdcf1[_0xb4f8('0x32')]));_0x1d0f50['where']['CampaignId']=_0xeaf7ea['id'];if(_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x1d0f50[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x1d0f50[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x1d0f50[_0xb4f8('0x35')],function(_0x217727){var _0x402bc5={};_0x402bc5[_0x217727]={'$like':'%'+_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x402bc5;})});}_0x1d0f50=_['merge']({},_0x1d0f50,_0x4c3a22['options']);return db[_0xb4f8('0x5e')][_0xb4f8('0x1d')]({'where':_0x1d0f50[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x2f783c){_0x13ca9c[_0xb4f8('0x1d')]=_0x2f783c;if(_0x4c3a22['query']['includeAll']){_0x1d0f50[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xb4f8('0x43')](_0x1d0f50);})[_0xb4f8('0x22')](function(_0x4db640){_0x13ca9c[_0xb4f8('0x59')]=_0x4db640;return _0x13ca9c;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x22e240,_0x1d0f50))[_0xb4f8('0x44')](handleError(_0x22e240,null));};exports['getLists']=function(_0x544389,_0x52dde0,_0x4ad351){var _0x9510d1={};var _0x16a448={};var _0x359578;var _0x1bf012;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x544389[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x52dde0,null))[_0xb4f8('0x22')](function(_0x2fcef7){if(_0x2fcef7){_0x359578=_0x2fcef7;_0x16a448[_0xb4f8('0x2e')]=_['keys'](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x16a448[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x544389[_0xb4f8('0x31')]);_0x16a448['filters']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],_0x16a448[_0xb4f8('0x31')]);_0x9510d1['attributes']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],qs['fields'](_0x544389[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x9510d1['attributes']=_0x9510d1[_0xb4f8('0x35')]['length']?_0x9510d1[_0xb4f8('0x35')]:_0x16a448[_0xb4f8('0x2e')];_0x9510d1[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x544389['query'][_0xb4f8('0x3a')]);_0x9510d1[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x544389[_0xb4f8('0x31')],_0x16a448['filters']));if(_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x9510d1['where']=_[_0xb4f8('0x3e')](_0x9510d1[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x9510d1['attributes'],function(_0x39dfec){var _0x22475={};_0x22475[_0x39dfec]={'$like':'%'+_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x22475;})});}_0x9510d1=_[_0xb4f8('0x3e')]({},_0x9510d1,_0x544389[_0xb4f8('0x3f')]);return _0x359578[_0xb4f8('0x60')](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x650c44){if(_0x650c44){_0x1bf012=_0x650c44[_0xb4f8('0x36')];if(!_0x544389[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x9510d1['limit']=qs[_0xb4f8('0x1c')](_0x544389['query'][_0xb4f8('0x1c')]);_0x9510d1[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x544389['query'][_0xb4f8('0x1a')]);}return _0x359578['getLists'](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x57a8eb){if(_0x57a8eb){return _0x57a8eb?{'count':_0x1bf012,'rows':_0x57a8eb}:null;}})['then'](respondWithResult(_0x52dde0,null))[_0xb4f8('0x44')](handleError(_0x52dde0,null));};exports[_0xb4f8('0x61')]=function(_0x13ff2e,_0x2c3742,_0x261fda){var _0x3377ed,_0xbdc026;var _0x1cdb4e=[];var _0x5e598b=moment()[_0xb4f8('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x13ff2e[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x2c3742,null))[_0xb4f8('0x22')](function(_0x3c6af0){if(_0x3c6af0){_0xbdc026=_0x3c6af0;return _0x3c6af0[_0xb4f8('0x61')](_0x13ff2e[_0xb4f8('0x53')][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x13ff2e[_0xb4f8('0x53')],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x41e7e3){var _0x2da7b7;var _0x2f77e4;_0x3377ed=_0x41e7e3||[];var _0x1a27fd=[];if(_0x41e7e3){for(var _0x223316=0x0;_0x223316<_0x41e7e3[_0xb4f8('0x36')];_0x223316+=0x1){var _0x3c6efe=_0x41e7e3[_0x223316][_0xb4f8('0x23')]({'plain':!![]});_0xbdc026[_0xb4f8('0x65')]=_0x13ff2e['body'][_0xb4f8('0x65')]?_0x13ff2e['body'][_0xb4f8('0x65')]:_0xbdc026[_0xb4f8('0x65')];switch(_0xbdc026[_0xb4f8('0x65')]){case'always':_0x2da7b7=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xb4f8('0x66'),_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId',_0xb4f8('0x51'),_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x66'),_0xb4f8('0x66'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')]('id','ContactId')[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e['params']['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))['from'](_0xb4f8('0x6f'))['where'](_0xb4f8('0x70'))[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())['where'](_0xb4f8('0x71'))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')](_0xb4f8('0x73'))[_0xb4f8('0x74')](_0xb4f8('0x75'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e[_0xb4f8('0x4f')]['id']['toString']()))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('COALESCE(phone,\x27\x27)')[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')]('CampaignId\x20=\x20?',_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;case _0xb4f8('0x78'):_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),'ContactId','ListId','CampaignId',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field']('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id']['toString'](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))['field']('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')]('deletedAt\x20IS\x20NULL')[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x71'))[_0xb4f8('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xb4f8('0x7c'))[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e['params']['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;default:_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')](_0xb4f8('0x77'))[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),_0xb4f8('0x58'),_0xb4f8('0x51'),_0xb4f8('0x52')],squel['select']()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3c6efe['CmListId'][_0xb4f8('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb4f8('0x6e')]();}_0x2f77e4=squel[_0xb4f8('0x79')]()['into'](_0xb4f8('0x7e'))['fromQuery'](['cmHopperId','scheduledAt','phone','OrderBy',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x7f'),'id')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')](_0xb4f8('0x80'),'phone')['field'](_0xb4f8('0x81'),_0xb4f8('0x82'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x83'),'ci')['join'](_0xb4f8('0x77'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xb4f8('0x3b')](_0xb4f8('0x84'),_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x85'),_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())['where']('h.createdAt\x20=\x20?',_0x5e598b))[_0xb4f8('0x6e')]();_0x1a27fd[_0xb4f8('0x86')](db[_0xb4f8('0x87')]['query'](_0x2da7b7));_0x1cdb4e['push'](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x2f77e4));}return BPromise[_0xb4f8('0x88')](_0x1a27fd);}})['then'](function(){return BPromise[_0xb4f8('0x88')](_0x1cdb4e);})[_0xb4f8('0x22')](function(){return _0x3377ed;})[_0xb4f8('0x22')](respondWithResult(_0x2c3742,null))[_0xb4f8('0x44')](handleError(_0x2c3742,null));};exports[_0xb4f8('0x89')]=function(_0x24352f,_0xf312f2,_0x1b8554){return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0xf312f2,null))[_0xb4f8('0x22')](function(_0x24a96c){if(_0x24a96c){return _0x24a96c[_0xb4f8('0x89')](_0x24352f['query'][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x512186){if(_0x512186){return db[_0xb4f8('0x57')][_0xb4f8('0x26')]({'where':{'ListId':_0x24352f[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x512186;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0xf312f2,null))[_0xb4f8('0x44')](handleError(_0xf312f2,null));};exports[_0xb4f8('0x8a')]=function(_0xcb45c2,_0x3fc537,_0x4dc1b7){var _0xd35ee9={};var _0x231489={};var _0x26479;var _0x6448bf;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0xcb45c2[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x3fc537,null))[_0xb4f8('0x22')](function(_0x3cfce2){if(_0x3cfce2){_0x26479=_0x3cfce2;_0x231489[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x231489[_0xb4f8('0x31')]=_['keys'](_0xcb45c2[_0xb4f8('0x31')]);_0x231489[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x231489[_0xb4f8('0x2e')],_0x231489['query']);_0xd35ee9[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x231489['model'],qs[_0xb4f8('0x34')](_0xcb45c2[_0xb4f8('0x31')]['fields']));_0xd35ee9[_0xb4f8('0x35')]=_0xd35ee9[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xd35ee9[_0xb4f8('0x35')]:_0x231489['model'];_0xd35ee9[_0xb4f8('0x39')]=qs['sort'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xd35ee9[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0xcb45c2[_0xb4f8('0x31')],_0x231489['filters']));if(_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0xd35ee9[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0xd35ee9[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0xd35ee9[_0xb4f8('0x35')],function(_0x558c26){var _0x2dda50={};_0x2dda50[_0x558c26]={'$like':'%'+_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x2dda50;})});}_0xd35ee9=_['merge']({},_0xd35ee9,_0xcb45c2[_0xb4f8('0x3f')]);return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x5289c9){if(_0x5289c9){_0x6448bf=_0x5289c9[_0xb4f8('0x36')];if(!_0xcb45c2[_0xb4f8('0x31')]['hasOwnProperty']('nolimit')){_0xd35ee9[_0xb4f8('0x1c')]=qs['limit'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xd35ee9[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x40329d){if(_0x40329d){return _0x40329d?{'count':_0x6448bf,'rows':_0x40329d}:null;}})[_0xb4f8('0x22')](respondWithResult(_0x3fc537,null))[_0xb4f8('0x44')](handleError(_0x3fc537,null));};exports[_0xb4f8('0x8b')]=function(_0x503f08,_0x5a22a0,_0x319c39){var _0x2360b0,_0x48f759;var _0x4f686c=[];var _0x314d21=moment()[_0xb4f8('0x62')](_0xb4f8('0x8c'));return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x503f08[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x5a22a0,null))['then'](function(_0x18c7d3){if(_0x18c7d3){_0x48f759=_0x18c7d3;return _0x18c7d3[_0xb4f8('0x8b')](_0x503f08['body'][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x503f08['body'],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x4abfd0){var _0x19a586;var _0x4b4456;_0x2360b0=_0x4abfd0||[];var _0x53365d=[];if(_0x4abfd0){for(var _0x221c3a=0x0;_0x221c3a<_0x4abfd0['length'];_0x221c3a+=0x1){var _0x3ac0cc=_0x4abfd0[_0x221c3a][_0xb4f8('0x23')]({'plain':!![]});_0x19a586=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper_black')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId','createdAt',_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))[_0xb4f8('0x6b')]('id',_0xb4f8('0x68'))['field'](_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x503f08[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),'CampaignId')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x51'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),'updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x53365d[_0xb4f8('0x86')](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x19a586));}return BPromise[_0xb4f8('0x88')](_0x53365d);}})[_0xb4f8('0x22')](function(){return _0x2360b0;})['then'](respondWithResult(_0x5a22a0,null))[_0xb4f8('0x44')](handleError(_0x5a22a0,null));};exports[_0xb4f8('0x8d')]=function(_0x5100d8,_0x380ca2,_0x13523d){return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x380ca2,null))[_0xb4f8('0x22')](function(_0x1df1a4){if(_0x1df1a4){return _0x1df1a4['removeBlackLists'](_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x19346f){if(_0x19346f){return db[_0xb4f8('0x5e')][_0xb4f8('0x26')]({'where':{'ListId':_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x19346f;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0x380ca2,null))[_0xb4f8('0x44')](handleError(_0x380ca2,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 7a14db0..e3b086d 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(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x230284,_0x1e5b98){var _0x379935=function(_0x17872a){while(--_0x17872a){_0x230284['push'](_0x230284['shift']());}};_0x379935(++_0x1e5b98);}(_0x7a54,0x106));var _0x47a5=function(_0x23aee1,_0x35b7ed){_0x23aee1=_0x23aee1-0x0;var _0x2b054f=_0x7a54[_0x23aee1];return _0x2b054f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 1ce3690..f8c6c0f 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 _0xc02d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x418799,_0x14f50a){var _0x408715=function(_0x2114c1){while(--_0x2114c1){_0x418799['push'](_0x418799['shift']());}};_0x408715(++_0x14f50a);}(_0xc02d,0x1aa));var _0xdc02=function(_0x17135e,_0x33ba4a){_0x17135e=_0x17135e-0x0;var _0xba6c61=_0xc02d[_0x17135e];return _0xba6c61;};'use strict';var _=require('lodash');var util=require(_0xdc02('0x0'));var moment=require(_0xdc02('0x1'));var BPromise=require(_0xdc02('0x2'));var rs=require(_0xdc02('0x3'));var fs=require('fs');var Redis=require(_0xdc02('0x4'));var db=require(_0xdc02('0x5'))['db'];var utils=require(_0xdc02('0x6'));var logger=require(_0xdc02('0x7'))(_0xdc02('0x8'));var config=require(_0xdc02('0x9'));var jayson=require(_0xdc02('0xa'));var client=jayson['client'][_0xdc02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc472b,_0x30e0ad,_0x1560da){return new BPromise(function(_0x4a678f,_0x50a902){return client[_0xdc02('0xc')](_0xc472b,_0x1560da)[_0xdc02('0xd')](function(_0x1fed26){logger['info'](_0xdc02('0xe'),_0x30e0ad,'request\x20sent');logger[_0xdc02('0xf')](_0xdc02('0x10'),_0x30e0ad,_0xdc02('0x11'),JSON[_0xdc02('0x12')](_0x1fed26));if(_0x1fed26['error']){if(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x14')]===0x1f4){logger[_0xdc02('0x13')](_0xdc02('0xe'),_0x30e0ad,_0x1fed26['error'][_0xdc02('0x15')]);return _0x50a902(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x15')]);}logger['error'](_0xdc02('0xe'),_0x30e0ad,_0x1fed26['error'][_0xdc02('0x15')]);return _0x4a678f(_0x1fed26[_0xdc02('0x13')][_0xdc02('0x15')]);}else{logger['info'](_0xdc02('0xe'),_0x30e0ad,_0xdc02('0x11'));_0x4a678f(_0x1fed26[_0xdc02('0x16')]['message']);}})[_0xdc02('0x17')](function(_0x4d96ef){logger[_0xdc02('0x13')](_0xdc02('0xe'),_0x30e0ad,_0x4d96ef);_0x50a902(_0x4d96ef);});});}exports[_0xdc02('0x18')]=function(_0x26be9e){var _0x532a50=this;return new Promise(function(_0x4f731f,_0x88b0b2){return db[_0xdc02('0x19')][_0xdc02('0x1a')]({'raw':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1c')]===undefined?!![]:![]:!![],'where':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1d')]||null:null,'attributes':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1e')]||null:null,'limit':_0x26be9e['options']?_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x1f')]||null:null,'include':_0x26be9e[_0xdc02('0x1b')]?_0x26be9e['options'][_0xdc02('0x20')]?_[_0xdc02('0x21')](_0x26be9e[_0xdc02('0x1b')][_0xdc02('0x20')],function(_0x4017d4){return{'model':db[_0x4017d4[_0xdc02('0x22')]],'as':_0x4017d4['as'],'attributes':_0x4017d4[_0xdc02('0x1e')],'include':_0x4017d4['include']?_[_0xdc02('0x21')](_0x4017d4[_0xdc02('0x20')],function(_0x11b57c){return{'model':db[_0x11b57c[_0xdc02('0x22')]],'as':_0x11b57c['as'],'attributes':_0x11b57c[_0xdc02('0x1e')],'include':_0x11b57c['include']?_[_0xdc02('0x21')](_0x11b57c[_0xdc02('0x20')],function(_0x54ecd7){return{'model':db[_0x54ecd7[_0xdc02('0x22')]],'as':_0x54ecd7['as'],'attributes':_0x54ecd7[_0xdc02('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdc02('0xd')](function(_0x4492f8){logger[_0xdc02('0x23')](_0xdc02('0x18'),_0x26be9e);logger['debug']('GetCampaign',_0x26be9e,JSON[_0xdc02('0x12')](_0x4492f8));_0x4f731f(_0x4492f8);})[_0xdc02('0x17')](function(_0x5eb292){logger[_0xdc02('0x13')](_0xdc02('0x18'),_0x5eb292[_0xdc02('0x15')],_0x26be9e);_0x88b0b2(_0x532a50['error'](0x1f4,_0x5eb292[_0xdc02('0x15')]));});});}; \ No newline at end of file +var _0x2557=['options','raw','attributes','limit','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2557,0x11e));var _0x7255=function(_0x70cdaa,_0x19c4fb){_0x70cdaa=_0x70cdaa-0x0;var _0x460dd2=_0x2557[_0x70cdaa];return _0x460dd2;};'use strict';var _=require(_0x7255('0x0'));var util=require('util');var moment=require(_0x7255('0x1'));var BPromise=require(_0x7255('0x2'));var rs=require(_0x7255('0x3'));var fs=require('fs');var Redis=require(_0x7255('0x4'));var db=require(_0x7255('0x5'))['db'];var utils=require(_0x7255('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7255('0x7'));var client=jayson[_0x7255('0x8')][_0x7255('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x841417,_0x419dc0,_0x2142a5){return new BPromise(function(_0x5b6aa4,_0x3baa49){return client[_0x7255('0xa')](_0x841417,_0x2142a5)[_0x7255('0xb')](function(_0x5388d5){logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));logger[_0x7255('0xf')](_0x7255('0x10'),_0x419dc0,_0x7255('0xe'),JSON[_0x7255('0x11')](_0x5388d5));if(_0x5388d5['error']){if(_0x5388d5[_0x7255('0x12')]['code']===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x419dc0,_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);return _0x3baa49(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x5388d5[_0x7255('0x12')]['message']);return _0x5b6aa4(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}else{logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));_0x5b6aa4(_0x5388d5[_0x7255('0x14')][_0x7255('0x13')]);}})[_0x7255('0x15')](function(_0x1dc830){logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x1dc830);_0x3baa49(_0x1dc830);});});}exports[_0x7255('0x16')]=function(_0x19dac1){var _0x2c0cd7=this;return new Promise(function(_0x3db713,_0x33f843){return db[_0x7255('0x17')]['findAll']({'raw':_0x19dac1['options']?_0x19dac1[_0x7255('0x18')][_0x7255('0x19')]===undefined?!![]:![]:!![],'where':_0x19dac1[_0x7255('0x18')]?_0x19dac1[_0x7255('0x18')]['where']||null:null,'attributes':_0x19dac1[_0x7255('0x18')]?_0x19dac1[_0x7255('0x18')][_0x7255('0x1a')]||null:null,'limit':_0x19dac1[_0x7255('0x18')]?_0x19dac1[_0x7255('0x18')][_0x7255('0x1b')]||null:null,'include':_0x19dac1[_0x7255('0x18')]?_0x19dac1[_0x7255('0x18')]['include']?_[_0x7255('0x1c')](_0x19dac1[_0x7255('0x18')][_0x7255('0x1d')],function(_0x358e87){return{'model':db[_0x358e87[_0x7255('0x1e')]],'as':_0x358e87['as'],'attributes':_0x358e87[_0x7255('0x1a')],'include':_0x358e87[_0x7255('0x1d')]?_['map'](_0x358e87[_0x7255('0x1d')],function(_0x455098){return{'model':db[_0x455098[_0x7255('0x1e')]],'as':_0x455098['as'],'attributes':_0x455098['attributes'],'include':_0x455098[_0x7255('0x1d')]?_['map'](_0x455098[_0x7255('0x1d')],function(_0x193e69){return{'model':db[_0x193e69['model']],'as':_0x193e69['as'],'attributes':_0x193e69[_0x7255('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7255('0xb')](function(_0x93c316){logger[_0x7255('0xc')](_0x7255('0x16'),_0x19dac1);logger[_0x7255('0xf')]('GetCampaign',_0x19dac1,JSON[_0x7255('0x11')](_0x93c316));_0x3db713(_0x93c316);})[_0x7255('0x15')](function(_0x563233){logger['error'](_0x7255('0x16'),_0x563233[_0x7255('0x13')],_0x19dac1);_0x33f843(_0x2c0cd7[_0x7255('0x12')](0x1f4,_0x563233[_0x7255('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index a7779b9..707c3b9 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 _0x383a=['../../config/environment','isAuthenticated','index','get','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x383a,0x1ad));var _0xa383=function(_0x5dd52e,_0x98ee28){_0x5dd52e=_0x5dd52e-0x0;var _0x4d2f78=_0x383a[_0x5dd52e];return _0x4d2f78;};'use strict';var multer=require('multer');var util=require(_0xa383('0x0'));var path=require(_0xa383('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa383('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa383('0x3'));var interaction=require(_0xa383('0x4'));var config=require(_0xa383('0x5'));var controller=require('./campaign.controller');router['get']('/',auth[_0xa383('0x6')](),controller[_0xa383('0x7')]);router[_0xa383('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xa383('0x9'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xa383('0x8')](_0xa383('0xa'),auth['isAuthenticated'](),controller[_0xa383('0xb')]);router[_0xa383('0x8')](_0xa383('0xc'),auth['isAuthenticated'](),controller[_0xa383('0xd')]);router['get']('/:id/hopper_black',auth[_0xa383('0x6')](),controller[_0xa383('0xe')]);router[_0xa383('0x8')](_0xa383('0xf'),auth['isAuthenticated'](),controller[_0xa383('0x10')]);router[_0xa383('0x8')](_0xa383('0x11'),auth[_0xa383('0x6')](),controller[_0xa383('0x12')]);router[_0xa383('0x13')]('/',auth[_0xa383('0x6')](),controller[_0xa383('0x14')]);router['post']('/:id/clone',auth[_0xa383('0x6')](),controller[_0xa383('0x15')]);router[_0xa383('0x13')](_0xa383('0xf'),auth['isAuthenticated'](),controller[_0xa383('0x16')]);router['post'](_0xa383('0x11'),auth[_0xa383('0x6')](),controller[_0xa383('0x17')]);router[_0xa383('0x18')](_0xa383('0x19'),auth[_0xa383('0x6')](),controller[_0xa383('0x1a')]);router[_0xa383('0x1b')](_0xa383('0x19'),auth[_0xa383('0x6')](),controller['destroy']);router['delete']('/:id/lists',auth[_0xa383('0x6')](),controller[_0xa383('0x1c')]);router['delete'](_0xa383('0x11'),auth['isAuthenticated'](),controller[_0xa383('0x1d')]);module[_0xa383('0x1e')]=router; \ No newline at end of file +var _0x032e=['getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists'];(function(_0x18097c,_0x56ae06){var _0x418a7d=function(_0x5a862f){while(--_0x5a862f){_0x18097c['push'](_0x18097c['shift']());}};_0x418a7d(++_0x56ae06);}(_0x032e,0x124));var _0xe032=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x032e[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0xc')]);router[_0xe032('0x8')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0x8')](_0xe032('0xf'),auth['isAuthenticated'](),controller[_0xe032('0x10')]);router[_0xe032('0x8')](_0xe032('0x11'),auth[_0xe032('0x9')](),controller[_0xe032('0x12')]);router[_0xe032('0x8')](_0xe032('0x13'),auth['isAuthenticated'](),controller[_0xe032('0x14')]);router[_0xe032('0x8')](_0xe032('0x15'),auth[_0xe032('0x9')](),controller['getLists']);router[_0xe032('0x8')](_0xe032('0x16'),auth[_0xe032('0x9')](),controller[_0xe032('0x17')]);router[_0xe032('0x18')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0x19')]);router['post'](_0xe032('0x1a'),auth[_0xe032('0x9')](),controller[_0xe032('0x1b')]);router[_0xe032('0x18')](_0xe032('0x15'),auth[_0xe032('0x9')](),controller['addLists']);router[_0xe032('0x18')](_0xe032('0x16'),auth[_0xe032('0x9')](),controller[_0xe032('0x1c')]);router[_0xe032('0x1d')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe032('0x1e')]('/:id',auth[_0xe032('0x9')](),controller[_0xe032('0x1f')]);router[_0xe032('0x1e')](_0xe032('0x15'),auth[_0xe032('0x9')](),controller[_0xe032('0x20')]);router[_0xe032('0x1e')]('/:id/blacklists',auth[_0xe032('0x9')](),controller[_0xe032('0x21')]);module[_0xe032('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 364f533..94658d2 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 _0xa598=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x84c5de,_0x507105){var _0x3aedd8=function(_0x2e4d8a){while(--_0x2e4d8a){_0x84c5de['push'](_0x84c5de['shift']());}};_0x3aedd8(++_0x507105);}(_0xa598,0x13b));var _0x8a59=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xa598[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x8a59('0x0'));module[_0x8a59('0x1')]={'key':{'type':Sequelize[_0x8a59('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8a59('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8a59('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8a59('0x4')](_0x8a59('0x5'));}}}; \ No newline at end of file +var _0x5b28=['TEXT','STRING','key','sequelize','exports'];(function(_0x17f590,_0xdfb569){var _0x3a3748=function(_0x424aed){while(--_0x424aed){_0x17f590['push'](_0x17f590['shift']());}};_0x3a3748(++_0xdfb569);}(_0x5b28,0x1f2));var _0x85b2=function(_0x283656,_0x138850){_0x283656=_0x283656-0x0;var _0x119de8=_0x5b28[_0x283656];return _0x119de8;};'use strict';var Sequelize=require(_0x85b2('0x0'));module[_0x85b2('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x85b2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x85b2('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x85b2('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b8e8a34..58e55e1 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 _0x5647=['key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','CannedAnswers','UserProfileResource','error','stack','name','index','map','CannedAnswer','fieldName','type'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5647,0x1eb));var _0x7564=function(_0x5cc87c,_0x2c2f25){_0x5cc87c=_0x5cc87c-0x0;var _0x4c824b=_0x5647[_0x5cc87c];return _0x4c824b;};'use strict';var emlformat=require(_0x7564('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7564('0x1'));var moment=require(_0x7564('0x2'));var BPromise=require(_0x7564('0x3'));var Mustache=require(_0x7564('0x4'));var util=require(_0x7564('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7564('0x6'));var ejs=require(_0x7564('0x7'));var fs=require('fs');var fs_extra=require(_0x7564('0x8'));var _=require(_0x7564('0x9'));var squel=require(_0x7564('0xa'));var crypto=require(_0x7564('0xb'));var jsforce=require(_0x7564('0xc'));var deskjs=require(_0x7564('0xd'));var toCsv=require(_0x7564('0x6'));var querystring=require(_0x7564('0xe'));var Papa=require(_0x7564('0xf'));var Redis=require(_0x7564('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7564('0x11'));var hardwareService=require(_0x7564('0x12'));var logger=require('../../config/logger')(_0x7564('0x13'));var utils=require(_0x7564('0x14'));var config=require(_0x7564('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7564('0x16'))['db'];function respondWithStatusCode(_0x561c46,_0x29ac05){_0x29ac05=_0x29ac05||0xcc;return function(_0x449277){if(_0x449277){return _0x561c46[_0x7564('0x17')](_0x29ac05);}return _0x561c46[_0x7564('0x18')](_0x29ac05)[_0x7564('0x19')]();};}function respondWithResult(_0x386fb7,_0x53c3aa){_0x53c3aa=_0x53c3aa||0xc8;return function(_0x15f648){if(_0x15f648){return _0x386fb7['status'](_0x53c3aa)[_0x7564('0x1a')](_0x15f648);}};}function respondWithFilteredResult(_0x1070ce,_0x175390){return function(_0x3bf7dd){if(_0x3bf7dd){var _0x20c8ee=typeof _0x175390[_0x7564('0x1b')]==='undefined'&&typeof _0x175390[_0x7564('0x1c')]===_0x7564('0x1d');var _0x4b4d14=_0x3bf7dd[_0x7564('0x1e')];var _0x29ebfd=_0x20c8ee?0x0:_0x175390[_0x7564('0x1b')];var _0x28a319=_0x20c8ee?_0x3bf7dd[_0x7564('0x1e')]:_0x175390[_0x7564('0x1b')]+_0x175390[_0x7564('0x1c')];var _0x429cca;if(_0x28a319>=_0x4b4d14){_0x28a319=_0x4b4d14;_0x429cca=0xc8;}else{_0x429cca=0xce;}_0x1070ce[_0x7564('0x18')](_0x429cca);return _0x1070ce[_0x7564('0x1f')](_0x7564('0x20'),_0x29ebfd+'-'+_0x28a319+'/'+_0x4b4d14)[_0x7564('0x1a')](_0x3bf7dd);}return null;};}function patchUpdates(_0xdf572a){return function(_0x1b1f20){try{jsonpatch[_0x7564('0x21')](_0x1b1f20,_0xdf572a,!![]);}catch(_0x433c9b){return BPromise[_0x7564('0x22')](_0x433c9b);}return _0x1b1f20[_0x7564('0x23')]();};}function saveUpdates(_0x1a6020,_0x1c55f5){return function(_0x382770){if(_0x382770){return _0x382770[_0x7564('0x24')](_0x1a6020)['then'](function(_0x545431){return _0x545431;});}return null;};}function removeEntity(_0x314709,_0xf0c062){return function(_0x5b4e15){if(_0x5b4e15){return _0x5b4e15[_0x7564('0x25')]()[_0x7564('0x26')](function(){var _0x1a4ad7=_0x5b4e15['get']({'plain':!![]});var _0xe3280d=_0x7564('0x27');return db[_0x7564('0x28')]['destroy']({'where':{'type':_0xe3280d,'resourceId':_0x1a4ad7['id']}})[_0x7564('0x26')](function(){return _0x5b4e15;});})[_0x7564('0x26')](function(){_0x314709['status'](0xcc)[_0x7564('0x19')]();});}};}function handleEntityNotFound(_0xfef0f7,_0x5aa7c5){return function(_0x349063){if(!_0x349063){_0xfef0f7[_0x7564('0x17')](0x194);}return _0x349063;};}function handleError(_0x3be9b3,_0x5af88d){_0x5af88d=_0x5af88d||0x1f4;return function(_0x3aa7f0){logger[_0x7564('0x29')](_0x3aa7f0[_0x7564('0x2a')]);if(_0x3aa7f0[_0x7564('0x2b')]){delete _0x3aa7f0[_0x7564('0x2b')];}_0x3be9b3[_0x7564('0x18')](_0x5af88d)['send'](_0x3aa7f0);};}exports[_0x7564('0x2c')]=function(_0x1b3401,_0x3700e0){var _0x407e84={},_0x46d04f={},_0x2ba211={'count':0x0,'rows':[]};var _0x27c774=_[_0x7564('0x2d')](db[_0x7564('0x2e')]['rawAttributes'],function(_0x10af62){return{'name':_0x10af62[_0x7564('0x2f')],'type':_0x10af62[_0x7564('0x30')][_0x7564('0x31')]};});_0x46d04f['model']=_[_0x7564('0x2d')](_0x27c774,_0x7564('0x2b'));_0x46d04f['query']=_[_0x7564('0x32')](_0x1b3401[_0x7564('0x33')]);_0x46d04f[_0x7564('0x34')]=_['intersection'](_0x46d04f[_0x7564('0x35')],_0x46d04f[_0x7564('0x33')]);_0x407e84[_0x7564('0x36')]=_[_0x7564('0x37')](_0x46d04f[_0x7564('0x35')],qs[_0x7564('0x38')](_0x1b3401[_0x7564('0x33')][_0x7564('0x38')]));_0x407e84['attributes']=_0x407e84[_0x7564('0x36')][_0x7564('0x39')]?_0x407e84[_0x7564('0x36')]:_0x46d04f[_0x7564('0x35')];if(!_0x1b3401['query'][_0x7564('0x3a')](_0x7564('0x3b'))){_0x407e84['limit']=qs[_0x7564('0x1c')](_0x1b3401[_0x7564('0x33')][_0x7564('0x1c')]);_0x407e84[_0x7564('0x1b')]=qs[_0x7564('0x1b')](_0x1b3401[_0x7564('0x33')][_0x7564('0x1b')]);}_0x407e84[_0x7564('0x3c')]=qs[_0x7564('0x3d')](_0x1b3401['query'][_0x7564('0x3d')]);_0x407e84['where']=qs[_0x7564('0x34')](_[_0x7564('0x3e')](_0x1b3401[_0x7564('0x33')],_0x46d04f[_0x7564('0x34')]),_0x27c774);if(_0x1b3401[_0x7564('0x33')][_0x7564('0x3f')]){_0x407e84[_0x7564('0x40')]=_[_0x7564('0x41')](_0x407e84[_0x7564('0x40')],{'$or':[{'key':{'$like':'%'+_0x1b3401[_0x7564('0x33')][_0x7564('0x3f')]+'%'}},{'value':{'$like':'%'+_0x1b3401[_0x7564('0x33')]['filter']+'%'}}]});}_0x407e84=_[_0x7564('0x41')]({},_0x407e84,_0x1b3401[_0x7564('0x42')]);var _0x402f41={'where':_0x407e84[_0x7564('0x40')]};return db[_0x7564('0x2e')][_0x7564('0x1e')](_0x402f41)['then'](function(_0x444d9d){_0x2ba211[_0x7564('0x1e')]=_0x444d9d;if(_0x1b3401['query'][_0x7564('0x43')]){_0x407e84['include']=[{'all':!![]}];}return db[_0x7564('0x2e')]['findAll'](_0x407e84);})[_0x7564('0x26')](function(_0x970cec){_0x2ba211[_0x7564('0x44')]=_0x970cec;return _0x2ba211;})[_0x7564('0x26')](respondWithFilteredResult(_0x3700e0,_0x407e84))[_0x7564('0x45')](handleError(_0x3700e0,null));};exports[_0x7564('0x46')]=function(_0x282b10,_0x2fe4a4){var _0x616e0a={'raw':!![],'where':{'id':_0x282b10[_0x7564('0x47')]['id']}},_0xa0eb16={};_0xa0eb16[_0x7564('0x35')]=_[_0x7564('0x32')](db[_0x7564('0x2e')][_0x7564('0x48')]);_0xa0eb16['query']=_[_0x7564('0x32')](_0x282b10['query']);_0xa0eb16['filters']=_[_0x7564('0x37')](_0xa0eb16[_0x7564('0x35')],_0xa0eb16[_0x7564('0x33')]);_0x616e0a[_0x7564('0x36')]=_[_0x7564('0x37')](_0xa0eb16[_0x7564('0x35')],qs[_0x7564('0x38')](_0x282b10[_0x7564('0x33')][_0x7564('0x38')]));_0x616e0a[_0x7564('0x36')]=_0x616e0a[_0x7564('0x36')]['length']?_0x616e0a[_0x7564('0x36')]:_0xa0eb16['model'];if(_0x282b10[_0x7564('0x33')][_0x7564('0x43')]){_0x616e0a[_0x7564('0x49')]=[{'all':!![]}];}_0x616e0a=_['merge']({},_0x616e0a,_0x282b10[_0x7564('0x42')]);return db[_0x7564('0x2e')][_0x7564('0x4a')](_0x616e0a)[_0x7564('0x26')](handleEntityNotFound(_0x2fe4a4,null))[_0x7564('0x26')](respondWithResult(_0x2fe4a4,null))['catch'](handleError(_0x2fe4a4,null));};exports['update']=function(_0x14eb6b,_0x256667){if(_0x14eb6b[_0x7564('0x4b')]['id']){delete _0x14eb6b['body']['id'];}return db[_0x7564('0x2e')]['find']({'where':{'id':_0x14eb6b[_0x7564('0x47')]['id']}})[_0x7564('0x26')](handleEntityNotFound(_0x256667,null))[_0x7564('0x26')](saveUpdates(_0x14eb6b[_0x7564('0x4b')],null))[_0x7564('0x26')](respondWithResult(_0x256667,null))[_0x7564('0x45')](handleError(_0x256667,null));};exports['destroy']=function(_0x382fa8,_0x377459){return db[_0x7564('0x2e')][_0x7564('0x4a')]({'where':{'id':_0x382fa8[_0x7564('0x47')]['id']}})['then'](handleEntityNotFound(_0x377459,null))[_0x7564('0x26')](removeEntity(_0x377459,null))[_0x7564('0x45')](handleError(_0x377459,null));};exports[_0x7564('0x4c')]=function(_0x172949,_0x546100){var _0x3a79b3={'key':_0x172949[_0x7564('0x4b')]['key']};if(_0x172949[_0x7564('0x4b')][_0x7564('0x4d')]){_0x3a79b3[_0x7564('0x4d')]=_0x172949['body'][_0x7564('0x4d')];}else if(_0x172949['body']['SmsAccountId']){_0x3a79b3[_0x7564('0x4e')]=_0x172949['body'][_0x7564('0x4e')];}else if(_0x172949[_0x7564('0x4b')][_0x7564('0x4f')]){_0x3a79b3['OpenchannelAccountId']=_0x172949['body'][_0x7564('0x4f')];}else if(_0x172949[_0x7564('0x4b')][_0x7564('0x50')]){_0x3a79b3[_0x7564('0x50')]=_0x172949['body']['ChatWebsiteId'];}return db['CannedAnswer'][_0x7564('0x4a')]({'where':_0x3a79b3})['then'](function(_0x27dc31){if(_0x27dc31){throw new db[(_0x7564('0x51'))][(_0x7564('0x52'))](_0x7564('0x53'));}return db['CannedAnswer'][_0x7564('0x4c')](_0x172949[_0x7564('0x4b')]);})[_0x7564('0x26')](function(_0x12217a){var _0x4a6d18=_0x172949[_0x7564('0x54')][_0x7564('0x55')]({'plain':!![]});if(!_0x4a6d18)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a6d18[_0x7564('0x56')]===_0x7564('0x54')){var _0x185543=_0x12217a[_0x7564('0x55')]({'plain':!![]});return db[_0x7564('0x57')][_0x7564('0x4a')]({'where':{'name':_0x7564('0x27'),'userProfileId':_0x4a6d18[_0x7564('0x58')]},'raw':!![]})[_0x7564('0x26')](function(_0x28c3c6){if(_0x28c3c6&&_0x28c3c6['autoAssociation']===0x0){return db[_0x7564('0x28')]['create']({'name':_0x185543['name'],'resourceId':_0x185543['id'],'type':_0x28c3c6[_0x7564('0x2b')],'sectionId':_0x28c3c6['id']},{})['then'](function(){return _0x12217a;});}else{return _0x12217a;}})[_0x7564('0x45')](function(_0x8406d){logger[_0x7564('0x29')](_0x7564('0x59'),_0x8406d);throw _0x8406d;});}return _0x12217a;})[_0x7564('0x26')](respondWithResult(_0x546100,0xc9))[_0x7564('0x45')](handleError(_0x546100,null));}; \ No newline at end of file +var _0xe868=['stack','name','index','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','catch','show','params','include','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','create','role','user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error'];(function(_0x124728,_0x463dca){var _0x8eb20f=function(_0x49d9de){while(--_0x49d9de){_0x124728['push'](_0x124728['shift']());}};_0x8eb20f(++_0x463dca);}(_0xe868,0x189));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e86('0x0'));var zipdir=require(_0x8e86('0x1'));var jsonpatch=require(_0x8e86('0x2'));var rp=require('request-promise');var moment=require(_0x8e86('0x3'));var BPromise=require(_0x8e86('0x4'));var Mustache=require('mustache');var util=require(_0x8e86('0x5'));var path=require('path');var sox=require(_0x8e86('0x6'));var csv=require(_0x8e86('0x7'));var ejs=require(_0x8e86('0x8'));var fs=require('fs');var fs_extra=require(_0x8e86('0x9'));var _=require(_0x8e86('0xa'));var squel=require(_0x8e86('0xb'));var crypto=require(_0x8e86('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8e86('0xd'));var toCsv=require(_0x8e86('0x7'));var querystring=require(_0x8e86('0xe'));var Papa=require(_0x8e86('0xf'));var Redis=require(_0x8e86('0x10'));var authService=require(_0x8e86('0x11'));var qs=require(_0x8e86('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e86('0x13'));var utils=require('../../config/utils');var config=require(_0x8e86('0x14'));var licenseUtil=require(_0x8e86('0x15'));var db=require(_0x8e86('0x16'))['db'];function respondWithStatusCode(_0x5ccbc6,_0x50bc33){_0x50bc33=_0x50bc33||0xcc;return function(_0xb4ffa6){if(_0xb4ffa6){return _0x5ccbc6[_0x8e86('0x17')](_0x50bc33);}return _0x5ccbc6[_0x8e86('0x18')](_0x50bc33)[_0x8e86('0x19')]();};}function respondWithResult(_0x4edaba,_0x8d7f18){_0x8d7f18=_0x8d7f18||0xc8;return function(_0x154d72){if(_0x154d72){return _0x4edaba[_0x8e86('0x18')](_0x8d7f18)[_0x8e86('0x1a')](_0x154d72);}};}function respondWithFilteredResult(_0x25f598,_0x49f271){return function(_0x193d11){if(_0x193d11){var _0x20e413=typeof _0x49f271['offset']===_0x8e86('0x1b')&&typeof _0x49f271['limit']===_0x8e86('0x1b');var _0x33cbd5=_0x193d11[_0x8e86('0x1c')];var _0x182bc9=_0x20e413?0x0:_0x49f271[_0x8e86('0x1d')];var _0x3e6fc3=_0x20e413?_0x193d11[_0x8e86('0x1c')]:_0x49f271[_0x8e86('0x1d')]+_0x49f271[_0x8e86('0x1e')];var _0x55201b;if(_0x3e6fc3>=_0x33cbd5){_0x3e6fc3=_0x33cbd5;_0x55201b=0xc8;}else{_0x55201b=0xce;}_0x25f598['status'](_0x55201b);return _0x25f598[_0x8e86('0x1f')](_0x8e86('0x20'),_0x182bc9+'-'+_0x3e6fc3+'/'+_0x33cbd5)['json'](_0x193d11);}return null;};}function patchUpdates(_0x5180e5){return function(_0x418ddc){try{jsonpatch[_0x8e86('0x21')](_0x418ddc,_0x5180e5,!![]);}catch(_0x57d8af){return BPromise[_0x8e86('0x22')](_0x57d8af);}return _0x418ddc[_0x8e86('0x23')]();};}function saveUpdates(_0x34679f,_0x53fc8e){return function(_0x186ae5){if(_0x186ae5){return _0x186ae5[_0x8e86('0x24')](_0x34679f)[_0x8e86('0x25')](function(_0x2c05b5){return _0x2c05b5;});}return null;};}function removeEntity(_0x4e4a2a,_0x379549){return function(_0x1cf5bb){if(_0x1cf5bb){return _0x1cf5bb[_0x8e86('0x26')]()[_0x8e86('0x25')](function(){var _0x4a63b2=_0x1cf5bb[_0x8e86('0x27')]({'plain':!![]});var _0x56523f='CannedAnswers';return db[_0x8e86('0x28')][_0x8e86('0x26')]({'where':{'type':_0x56523f,'resourceId':_0x4a63b2['id']}})[_0x8e86('0x25')](function(){return _0x1cf5bb;});})[_0x8e86('0x25')](function(){_0x4e4a2a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f48cf,_0x674ef6){return function(_0x58a316){if(!_0x58a316){_0x5f48cf['sendStatus'](0x194);}return _0x58a316;};}function handleError(_0x2879df,_0x35c76d){_0x35c76d=_0x35c76d||0x1f4;return function(_0x220e78){logger[_0x8e86('0x29')](_0x220e78[_0x8e86('0x2a')]);if(_0x220e78[_0x8e86('0x2b')]){delete _0x220e78['name'];}_0x2879df[_0x8e86('0x18')](_0x35c76d)['send'](_0x220e78);};}exports[_0x8e86('0x2c')]=function(_0x1a2492,_0x2c18fc){var _0xa8ff0a={},_0x553113={},_0x5d13ea={'count':0x0,'rows':[]};var _0x34d3d6=_['map'](db['CannedAnswer'][_0x8e86('0x2d')],function(_0x4273d0){return{'name':_0x4273d0[_0x8e86('0x2e')],'type':_0x4273d0[_0x8e86('0x2f')][_0x8e86('0x30')]};});_0x553113['model']=_[_0x8e86('0x31')](_0x34d3d6,_0x8e86('0x2b'));_0x553113['query']=_[_0x8e86('0x32')](_0x1a2492[_0x8e86('0x33')]);_0x553113[_0x8e86('0x34')]=_[_0x8e86('0x35')](_0x553113['model'],_0x553113[_0x8e86('0x33')]);_0xa8ff0a[_0x8e86('0x36')]=_['intersection'](_0x553113[_0x8e86('0x37')],qs[_0x8e86('0x38')](_0x1a2492[_0x8e86('0x33')][_0x8e86('0x38')]));_0xa8ff0a[_0x8e86('0x36')]=_0xa8ff0a['attributes']['length']?_0xa8ff0a[_0x8e86('0x36')]:_0x553113[_0x8e86('0x37')];if(!_0x1a2492[_0x8e86('0x33')][_0x8e86('0x39')](_0x8e86('0x3a'))){_0xa8ff0a[_0x8e86('0x1e')]=qs['limit'](_0x1a2492[_0x8e86('0x33')][_0x8e86('0x1e')]);_0xa8ff0a[_0x8e86('0x1d')]=qs[_0x8e86('0x1d')](_0x1a2492['query'][_0x8e86('0x1d')]);}_0xa8ff0a[_0x8e86('0x3b')]=qs[_0x8e86('0x3c')](_0x1a2492[_0x8e86('0x33')][_0x8e86('0x3c')]);_0xa8ff0a[_0x8e86('0x3d')]=qs['filters'](_[_0x8e86('0x3e')](_0x1a2492[_0x8e86('0x33')],_0x553113[_0x8e86('0x34')]),_0x34d3d6);if(_0x1a2492[_0x8e86('0x33')]['filter']){_0xa8ff0a[_0x8e86('0x3d')]=_[_0x8e86('0x3f')](_0xa8ff0a[_0x8e86('0x3d')],{'$or':[{'key':{'$like':'%'+_0x1a2492[_0x8e86('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x1a2492[_0x8e86('0x33')][_0x8e86('0x40')]+'%'}}]});}_0xa8ff0a=_['merge']({},_0xa8ff0a,_0x1a2492[_0x8e86('0x41')]);var _0x509d04={'where':_0xa8ff0a[_0x8e86('0x3d')]};return db[_0x8e86('0x42')]['count'](_0x509d04)[_0x8e86('0x25')](function(_0x29c99d){_0x5d13ea[_0x8e86('0x1c')]=_0x29c99d;if(_0x1a2492['query'][_0x8e86('0x43')]){_0xa8ff0a['include']=[{'all':!![]}];}return db[_0x8e86('0x42')]['findAll'](_0xa8ff0a);})[_0x8e86('0x25')](function(_0x39a441){_0x5d13ea['rows']=_0x39a441;return _0x5d13ea;})[_0x8e86('0x25')](respondWithFilteredResult(_0x2c18fc,_0xa8ff0a))[_0x8e86('0x44')](handleError(_0x2c18fc,null));};exports[_0x8e86('0x45')]=function(_0x3f2c6e,_0x460d61){var _0x28bf62={'raw':!![],'where':{'id':_0x3f2c6e[_0x8e86('0x46')]['id']}},_0x3dd3c0={};_0x3dd3c0['model']=_['keys'](db[_0x8e86('0x42')][_0x8e86('0x2d')]);_0x3dd3c0[_0x8e86('0x33')]=_[_0x8e86('0x32')](_0x3f2c6e[_0x8e86('0x33')]);_0x3dd3c0[_0x8e86('0x34')]=_[_0x8e86('0x35')](_0x3dd3c0[_0x8e86('0x37')],_0x3dd3c0[_0x8e86('0x33')]);_0x28bf62[_0x8e86('0x36')]=_['intersection'](_0x3dd3c0[_0x8e86('0x37')],qs['fields'](_0x3f2c6e[_0x8e86('0x33')][_0x8e86('0x38')]));_0x28bf62['attributes']=_0x28bf62[_0x8e86('0x36')]['length']?_0x28bf62['attributes']:_0x3dd3c0[_0x8e86('0x37')];if(_0x3f2c6e[_0x8e86('0x33')]['includeAll']){_0x28bf62[_0x8e86('0x47')]=[{'all':!![]}];}_0x28bf62=_[_0x8e86('0x3f')]({},_0x28bf62,_0x3f2c6e[_0x8e86('0x41')]);return db[_0x8e86('0x42')]['find'](_0x28bf62)['then'](handleEntityNotFound(_0x460d61,null))[_0x8e86('0x25')](respondWithResult(_0x460d61,null))[_0x8e86('0x44')](handleError(_0x460d61,null));};exports[_0x8e86('0x24')]=function(_0x5b660e,_0x502ecc){if(_0x5b660e[_0x8e86('0x48')]['id']){delete _0x5b660e[_0x8e86('0x48')]['id'];}return db[_0x8e86('0x42')][_0x8e86('0x49')]({'where':{'id':_0x5b660e[_0x8e86('0x46')]['id']}})['then'](handleEntityNotFound(_0x502ecc,null))[_0x8e86('0x25')](saveUpdates(_0x5b660e['body'],null))[_0x8e86('0x25')](respondWithResult(_0x502ecc,null))[_0x8e86('0x44')](handleError(_0x502ecc,null));};exports['destroy']=function(_0x5d3926,_0x12707d){return db[_0x8e86('0x42')]['find']({'where':{'id':_0x5d3926[_0x8e86('0x46')]['id']}})[_0x8e86('0x25')](handleEntityNotFound(_0x12707d,null))[_0x8e86('0x25')](removeEntity(_0x12707d,null))[_0x8e86('0x44')](handleError(_0x12707d,null));};exports['create']=function(_0x4cd55a,_0x4139bc){var _0x5175cb={'key':_0x4cd55a[_0x8e86('0x48')][_0x8e86('0x30')]};if(_0x4cd55a[_0x8e86('0x48')]['MailAccountId']){_0x5175cb[_0x8e86('0x4a')]=_0x4cd55a['body'][_0x8e86('0x4a')];}else if(_0x4cd55a[_0x8e86('0x48')][_0x8e86('0x4b')]){_0x5175cb['SmsAccountId']=_0x4cd55a['body'][_0x8e86('0x4b')];}else if(_0x4cd55a[_0x8e86('0x48')][_0x8e86('0x4c')]){_0x5175cb[_0x8e86('0x4c')]=_0x4cd55a[_0x8e86('0x48')][_0x8e86('0x4c')];}else if(_0x4cd55a[_0x8e86('0x48')]['ChatWebsiteId']){_0x5175cb[_0x8e86('0x4d')]=_0x4cd55a[_0x8e86('0x48')][_0x8e86('0x4d')];}return db[_0x8e86('0x42')][_0x8e86('0x49')]({'where':_0x5175cb})[_0x8e86('0x25')](function(_0x44d25f){if(_0x44d25f){throw new db['Sequelize'][(_0x8e86('0x4e'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x8e86('0x42')][_0x8e86('0x4f')](_0x4cd55a[_0x8e86('0x48')]);})[_0x8e86('0x25')](function(_0x2e89a0){var _0x125d9d=_0x4cd55a['user']['get']({'plain':!![]});if(!_0x125d9d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x125d9d[_0x8e86('0x50')]===_0x8e86('0x51')){var _0x573526=_0x2e89a0[_0x8e86('0x27')]({'plain':!![]});return db[_0x8e86('0x52')][_0x8e86('0x49')]({'where':{'name':_0x8e86('0x53'),'userProfileId':_0x125d9d[_0x8e86('0x54')]},'raw':!![]})['then'](function(_0x5066e2){if(_0x5066e2&&_0x5066e2[_0x8e86('0x55')]===0x0){return db[_0x8e86('0x28')]['create']({'name':_0x573526[_0x8e86('0x2b')],'resourceId':_0x573526['id'],'type':_0x5066e2[_0x8e86('0x2b')],'sectionId':_0x5066e2['id']},{})[_0x8e86('0x25')](function(){return _0x2e89a0;});}else{return _0x2e89a0;}})[_0x8e86('0x44')](function(_0x399c5e){logger[_0x8e86('0x29')](_0x8e86('0x56'),_0x399c5e);throw _0x399c5e;});}return _0x2e89a0;})[_0x8e86('0x25')](respondWithResult(_0x4139bc,0xc9))['catch'](handleError(_0x4139bc,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index e4a8d5c..1217b50 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 _0xd526=['./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd526,0xee));var _0x6d52=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd526[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x6d52('0x0'));var util=require(_0x6d52('0x1'));var logger=require(_0x6d52('0x2'))(_0x6d52('0x3'));var moment=require(_0x6d52('0x4'));var BPromise=require(_0x6d52('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d52('0x6'));var rimraf=require(_0x6d52('0x7'));var config=require(_0x6d52('0x8'));var attributes=require(_0x6d52('0x9'));module[_0x6d52('0xa')]=function(_0x4e466b,_0x1112e0){return _0x4e466b['define']('CannedAnswer',attributes,{'tableName':_0x6d52('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6d52('0xc')});}; \ No newline at end of file +var _0x91f3=['../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x5184d5,_0x562640){var _0x543c3d=function(_0x1af9ec){while(--_0x1af9ec){_0x5184d5['push'](_0x5184d5['shift']());}};_0x543c3d(++_0x562640);}(_0x91f3,0x19d));var _0x391f=function(_0x1e643a,_0x252f5c){_0x1e643a=_0x1e643a-0x0;var _0x47bb38=_0x91f3[_0x1e643a];return _0x47bb38;};'use strict';var _=require(_0x391f('0x0'));var util=require(_0x391f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x391f('0x2'));var BPromise=require(_0x391f('0x3'));var rp=require(_0x391f('0x4'));var fs=require('fs');var path=require(_0x391f('0x5'));var rimraf=require(_0x391f('0x6'));var config=require(_0x391f('0x7'));var attributes=require(_0x391f('0x8'));module[_0x391f('0x9')]=function(_0x3f4727,_0x485676){return _0x3f4727[_0x391f('0xa')]('CannedAnswer',attributes,{'tableName':_0x391f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index bd4bf28..cce0ad3 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(_0x2ffce8,_0x21ad44){var _0x43ce90=function(_0x9cf720){while(--_0x9cf720){_0x2ffce8['push'](_0x2ffce8['shift']());}};_0x43ce90(++_0x21ad44);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x1f16c5,_0x1bd5bb){var _0x24054c=function(_0xb61a23){while(--_0xb61a23){_0x1f16c5['push'](_0x1f16c5['shift']());}};_0x24054c(++_0x1bd5bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 70aa128..9bd6abb 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 _0x3beb=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x8383bc,_0x457b76){var _0x4c74ca=function(_0x4009a3){while(--_0x4009a3){_0x8383bc['push'](_0x8383bc['shift']());}};_0x4c74ca(++_0x457b76);}(_0x3beb,0xcb));var _0xb3be=function(_0x3495aa,_0x20e418){_0x3495aa=_0x3495aa-0x0;var _0x240368=_0x3beb[_0x3495aa];return _0x240368;};'use strict';var multer=require(_0xb3be('0x0'));var util=require(_0xb3be('0x1'));var path=require('path');var timeout=require(_0xb3be('0x2'));var express=require(_0xb3be('0x3'));var router=express[_0xb3be('0x4')]();var fs_extra=require(_0xb3be('0x5'));var auth=require(_0xb3be('0x6'));var interaction=require(_0xb3be('0x7'));var config=require('../../config/environment');var controller=require(_0xb3be('0x8'));router[_0xb3be('0x9')]('/',auth[_0xb3be('0xa')](),controller[_0xb3be('0xb')]);router[_0xb3be('0x9')](_0xb3be('0xc'),auth[_0xb3be('0xa')](),controller['show']);router[_0xb3be('0xd')]('/',auth[_0xb3be('0xa')](),controller[_0xb3be('0xe')]);router[_0xb3be('0xf')](_0xb3be('0xc'),auth[_0xb3be('0xa')](),controller[_0xb3be('0x10')]);router[_0xb3be('0x11')](_0xb3be('0xc'),auth['isAuthenticated'](),controller[_0xb3be('0x12')]);module[_0xb3be('0x13')]=router; \ No newline at end of file +var _0x7347=['create','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x4f4cc9,_0x4b217c){var _0x44c665=function(_0x80825b){while(--_0x80825b){_0x4f4cc9['push'](_0x4f4cc9['shift']());}};_0x44c665(++_0x4b217c);}(_0x7347,0x1a9));var _0x7734=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7347[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x7734('0x0'));var path=require(_0x7734('0x1'));var timeout=require(_0x7734('0x2'));var express=require(_0x7734('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7734('0x4'));var config=require(_0x7734('0x5'));var controller=require('./cannedAnswer.controller');router[_0x7734('0x6')]('/',auth[_0x7734('0x7')](),controller['index']);router[_0x7734('0x6')](_0x7734('0x8'),auth[_0x7734('0x7')](),controller['show']);router['post']('/',auth[_0x7734('0x7')](),controller[_0x7734('0x9')]);router['put'](_0x7734('0x8'),auth[_0x7734('0x7')](),controller[_0x7734('0xa')]);router[_0x7734('0xb')](_0x7734('0x8'),auth[_0x7734('0x7')](),controller[_0x7734('0xc')]);module[_0x7734('0xd')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 282d824..ec692ce 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 _0x407f=['STRING','INTEGER','1970-01-01\x2000:00:01'];(function(_0x6b81bb,_0x29178c){var _0x3039a5=function(_0x650f55){while(--_0x650f55){_0x6b81bb['push'](_0x6b81bb['shift']());}};_0x3039a5(++_0x29178c);}(_0x407f,0xc2));var _0xf407=function(_0x4cb441,_0x4fe8f2){_0x4cb441=_0x4cb441-0x0;var _0x1cba94=_0x407f[_0x4cb441];return _0x1cba94;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xf407('0x0')},'clid':{'type':Sequelize[_0xf407('0x1')]},'src':{'type':Sequelize[_0xf407('0x1')]},'dst':{'type':Sequelize[_0xf407('0x1')]},'dcontext':{'type':Sequelize[_0xf407('0x1')]},'channel':{'type':Sequelize[_0xf407('0x1')]},'dstchannel':{'type':Sequelize[_0xf407('0x1')]},'lastapp':{'type':Sequelize[_0xf407('0x1')]},'lastdata':{'type':Sequelize[_0xf407('0x1')]},'duration':{'type':Sequelize[_0xf407('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf407('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf407('0x1')]},'amaflags':{'type':Sequelize[_0xf407('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf407('0x1')]},'userfield':{'type':Sequelize[_0xf407('0x1')]},'uniqueid':{'type':Sequelize[_0xf407('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf407('0x1')]},'peeraccount':{'type':Sequelize[_0xf407('0x1')]},'type':{'type':Sequelize[_0xf407('0x1')]},'tag':{'type':Sequelize[_0xf407('0x1')]}}; \ No newline at end of file +var _0xeda0=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x4bad4f,_0x51d40c){var _0x41b7ce=function(_0x55cc69){while(--_0x55cc69){_0x4bad4f['push'](_0x4bad4f['shift']());}};_0x41b7ce(++_0x51d40c);}(_0xeda0,0x1d8));var _0x0eda=function(_0xf9b736,_0x5cfe10){_0xf9b736=_0xf9b736-0x0;var _0x44b206=_0xeda0[_0xf9b736];return _0x44b206;};'use strict';var Sequelize=require(_0x0eda('0x0'));module[_0x0eda('0x1')]={'calldate':{'type':Sequelize[_0x0eda('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x0eda('0x3')]},'src':{'type':Sequelize[_0x0eda('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0eda('0x3')]},'dstchannel':{'type':Sequelize[_0x0eda('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0eda('0x3')]},'duration':{'type':Sequelize[_0x0eda('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0eda('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0eda('0x3')]},'amaflags':{'type':Sequelize[_0x0eda('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0eda('0x3')]},'userfield':{'type':Sequelize[_0x0eda('0x3')]},'uniqueid':{'type':Sequelize[_0x0eda('0x3')]},'linkedid':{'type':Sequelize[_0x0eda('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0eda('0x3')]},'type':{'type':Sequelize[_0x0eda('0x3')]},'tag':{'type':Sequelize[_0x0eda('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ce63bc3..d30c396 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 _0x7d9f=['util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','Cdr','rawAttributes','model','keys','attributes','intersection','fields','query','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x35b2a1,_0x4cdca8){var _0x6023da=function(_0x10cd9f){while(--_0x10cd9f){_0x35b2a1['push'](_0x35b2a1['shift']());}};_0x6023da(++_0x4cdca8);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x7d9f[_0x57add2];return _0x4e3670;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={},_0x508b00={},_0x20315e={'count':0x0,'rows':[]};var _0x193add=_[_0xf7d9('0x29')](db[_0xf7d9('0x2a')][_0xf7d9('0x2b')],function(_0x16318f){return{'name':_0x16318f['fieldName'],'type':_0x16318f['type']['key']};});_0x508b00[_0xf7d9('0x2c')]=_['map'](_0x193add,_0xf7d9('0x27'));_0x508b00['query']=_[_0xf7d9('0x2d')](_0x3847ff['query']);_0x508b00['filters']=_['intersection'](_0x508b00[_0xf7d9('0x2c')],_0x508b00['query']);_0x2c04c3[_0xf7d9('0x2e')]=_[_0xf7d9('0x2f')](_0x508b00[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2c04c3[_0xf7d9('0x2e')]=_0x2c04c3[_0xf7d9('0x2e')]['length']?_0x2c04c3[_0xf7d9('0x2e')]:_0x508b00[_0xf7d9('0x2c')];if(!_0x3847ff['query']['hasOwnProperty'](_0xf7d9('0x32'))){_0x2c04c3[_0xf7d9('0x1b')]=qs[_0xf7d9('0x1b')](_0x3847ff['query'][_0xf7d9('0x1b')]);_0x2c04c3[_0xf7d9('0x1d')]=qs[_0xf7d9('0x1d')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x1d')]);}_0x2c04c3[_0xf7d9('0x33')]=qs[_0xf7d9('0x34')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x34')]);_0x2c04c3[_0xf7d9('0x35')]=qs[_0xf7d9('0x36')](_['pick'](_0x3847ff[_0xf7d9('0x31')],_0x508b00['filters']),_0x193add);if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x37')]){_0x2c04c3[_0xf7d9('0x35')]=_[_0xf7d9('0x38')](_0x2c04c3['where'],{'$or':_['map'](_0x193add,function(_0x2173e2){if(_0x2173e2['type']!==_0xf7d9('0x39')){var _0xb3723c={};_0xb3723c[_0x2173e2[_0xf7d9('0x27')]]={'$like':'%'+_0x3847ff[_0xf7d9('0x31')]['filter']+'%'};return _0xb3723c;}})});}_0x2c04c3=_['merge']({},_0x2c04c3,_0x3847ff[_0xf7d9('0x3a')]);var _0x410c72={'where':_0x2c04c3[_0xf7d9('0x35')]};return db[_0xf7d9('0x2a')]['count'](_0x410c72)[_0xf7d9('0x24')](function(_0xd6d84f){_0x20315e[_0xf7d9('0x1e')]=_0xd6d84f;if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2c04c3['include']=[{'all':!![]}];}return db[_0xf7d9('0x2a')][_0xf7d9('0x3c')](_0x2c04c3);})[_0xf7d9('0x24')](function(_0x3db665){_0x20315e[_0xf7d9('0x3d')]=_0x3db665;return _0x20315e;})[_0xf7d9('0x24')](respondWithFilteredResult(_0x2b5f17,_0x2c04c3))[_0xf7d9('0x3e')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x3f')]=function(_0x40d026,_0x3d056f){var _0x2a349b={'raw':!![],'where':{'id':_0x40d026['params']['id']}},_0x46b7d4={};_0x46b7d4[_0xf7d9('0x2c')]=_[_0xf7d9('0x2d')](db['Cdr']['rawAttributes']);_0x46b7d4['query']=_[_0xf7d9('0x2d')](_0x40d026['query']);_0x46b7d4[_0xf7d9('0x36')]=_[_0xf7d9('0x2f')](_0x46b7d4[_0xf7d9('0x2c')],_0x46b7d4[_0xf7d9('0x31')]);_0x2a349b[_0xf7d9('0x2e')]=_['intersection'](_0x46b7d4[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2a349b[_0xf7d9('0x2e')]=_0x2a349b['attributes']['length']?_0x2a349b[_0xf7d9('0x2e')]:_0x46b7d4[_0xf7d9('0x2c')];if(_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2a349b[_0xf7d9('0x40')]=[{'all':!![]}];}_0x2a349b=_['merge']({},_0x2a349b,_0x40d026[_0xf7d9('0x3a')]);return db['Cdr'][_0xf7d9('0x41')](_0x2a349b)[_0xf7d9('0x24')](handleEntityNotFound(_0x3d056f,null))[_0xf7d9('0x24')](respondWithResult(_0x3d056f,null))[_0xf7d9('0x3e')](handleError(_0x3d056f,null));};exports[_0xf7d9('0x42')]=function(_0x1e3a53,_0x4003e9){return db[_0xf7d9('0x2a')][_0xf7d9('0x42')](_0x1e3a53[_0xf7d9('0x43')],{})[_0xf7d9('0x24')](respondWithResult(_0x4003e9,0xc9))[_0xf7d9('0x3e')](handleError(_0x4003e9,null));};exports[_0xf7d9('0x23')]=function(_0x3cdeb5,_0x50731a){if(_0x3cdeb5[_0xf7d9('0x43')]['id']){delete _0x3cdeb5[_0xf7d9('0x43')]['id'];}return db['Cdr']['find']({'where':{'id':_0x3cdeb5[_0xf7d9('0x44')]['id']}})['then'](handleEntityNotFound(_0x50731a,null))['then'](saveUpdates(_0x3cdeb5[_0xf7d9('0x43')],null))[_0xf7d9('0x24')](respondWithResult(_0x50731a,null))[_0xf7d9('0x3e')](handleError(_0x50731a,null));};exports[_0xf7d9('0x45')]=function(_0xf923e0,_0x9c3719){return db[_0xf7d9('0x2a')][_0xf7d9('0x41')]({'where':{'id':_0xf923e0[_0xf7d9('0x44')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x9c3719,null))[_0xf7d9('0x24')](removeEntity(_0x9c3719,null))[_0xf7d9('0x3e')](handleError(_0x9c3719,null));};exports['describe']=function(_0x48076b,_0x42da01){return db[_0xf7d9('0x2a')][_0xf7d9('0x46')]()[_0xf7d9('0x24')](respondWithResult(_0x42da01,null))['catch'](handleError(_0x42da01,null));}; \ No newline at end of file +var _0xef17=['key','map','intersection','model','attributes','fields','length','query','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','offset','json','apply','reject','save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName'];(function(_0x4dd2cd,_0x4e3ec4){var _0x2c423d=function(_0x542c95){while(--_0x542c95){_0x4dd2cd['push'](_0x4dd2cd['shift']());}};_0x2c423d(++_0x4e3ec4);}(_0xef17,0x136));var _0x7ef1=function(_0xd2d907,_0x5cc0d2){_0xd2d907=_0xd2d907-0x0;var _0x2347b5=_0xef17[_0xd2d907];return _0x2347b5;};'use strict';var emlformat=require(_0x7ef1('0x0'));var rimraf=require(_0x7ef1('0x1'));var zipdir=require(_0x7ef1('0x2'));var jsonpatch=require(_0x7ef1('0x3'));var rp=require(_0x7ef1('0x4'));var moment=require(_0x7ef1('0x5'));var BPromise=require(_0x7ef1('0x6'));var Mustache=require(_0x7ef1('0x7'));var util=require(_0x7ef1('0x8'));var path=require('path');var sox=require(_0x7ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x7ef1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ef1('0xc'));var deskjs=require(_0x7ef1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ef1('0xe'));var Papa=require(_0x7ef1('0xf'));var Redis=require(_0x7ef1('0x10'));var authService=require(_0x7ef1('0x11'));var qs=require(_0x7ef1('0x12'));var as=require(_0x7ef1('0x13'));var hardwareService=require(_0x7ef1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7ef1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122c8a,_0x51e226){_0x51e226=_0x51e226||0xcc;return function(_0x36ddf9){if(_0x36ddf9){return _0x122c8a[_0x7ef1('0x16')](_0x51e226);}return _0x122c8a[_0x7ef1('0x17')](_0x51e226)[_0x7ef1('0x18')]();};}function respondWithResult(_0x39ea9c,_0x317125){_0x317125=_0x317125||0xc8;return function(_0x26e9fb){if(_0x26e9fb){return _0x39ea9c[_0x7ef1('0x17')](_0x317125)['json'](_0x26e9fb);}};}function respondWithFilteredResult(_0x4de80f,_0x267f0e){return function(_0x5d0499){if(_0x5d0499){var _0x20b843=typeof _0x267f0e[_0x7ef1('0x19')]==='undefined'&&typeof _0x267f0e['limit']==='undefined';var _0x300645=_0x5d0499['count'];var _0x3a5835=_0x20b843?0x0:_0x267f0e['offset'];var _0x5a7b2b=_0x20b843?_0x5d0499['count']:_0x267f0e[_0x7ef1('0x19')]+_0x267f0e['limit'];var _0x38c5a7;if(_0x5a7b2b>=_0x300645){_0x5a7b2b=_0x300645;_0x38c5a7=0xc8;}else{_0x38c5a7=0xce;}_0x4de80f[_0x7ef1('0x17')](_0x38c5a7);return _0x4de80f['set']('Content-Range',_0x3a5835+'-'+_0x5a7b2b+'/'+_0x300645)[_0x7ef1('0x1a')](_0x5d0499);}return null;};}function patchUpdates(_0x5490b9){return function(_0x458459){try{jsonpatch[_0x7ef1('0x1b')](_0x458459,_0x5490b9,!![]);}catch(_0x2f8164){return BPromise[_0x7ef1('0x1c')](_0x2f8164);}return _0x458459[_0x7ef1('0x1d')]();};}function saveUpdates(_0xf24942,_0x20887b){return function(_0xd71594){if(_0xd71594){return _0xd71594['update'](_0xf24942)[_0x7ef1('0x1e')](function(_0x3b118f){return _0x3b118f;});}return null;};}function removeEntity(_0x3f26fb,_0x3324d4){return function(_0x31b5bf){if(_0x31b5bf){return _0x31b5bf[_0x7ef1('0x1f')]()[_0x7ef1('0x1e')](function(){_0x3f26fb[_0x7ef1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1ace,_0x33e008){return function(_0x12ef5a){if(!_0x12ef5a){_0x4b1ace[_0x7ef1('0x16')](0x194);}return _0x12ef5a;};}function handleError(_0xcfce5e,_0x19c2c2){_0x19c2c2=_0x19c2c2||0x1f4;return function(_0x4cfa16){logger[_0x7ef1('0x20')](_0x4cfa16[_0x7ef1('0x21')]);if(_0x4cfa16[_0x7ef1('0x22')]){delete _0x4cfa16[_0x7ef1('0x22')];}_0xcfce5e[_0x7ef1('0x17')](_0x19c2c2)[_0x7ef1('0x23')](_0x4cfa16);};}exports[_0x7ef1('0x24')]=function(_0x58e7ee,_0x2e8f1b){var _0x4b0380={},_0x3306b0={},_0x2546bf={'count':0x0,'rows':[]};var _0x4b5fde=_['map'](db[_0x7ef1('0x25')][_0x7ef1('0x26')],function(_0x5ab3a5){return{'name':_0x5ab3a5[_0x7ef1('0x27')],'type':_0x5ab3a5['type'][_0x7ef1('0x28')]};});_0x3306b0['model']=_[_0x7ef1('0x29')](_0x4b5fde,_0x7ef1('0x22'));_0x3306b0['query']=_['keys'](_0x58e7ee['query']);_0x3306b0['filters']=_[_0x7ef1('0x2a')](_0x3306b0[_0x7ef1('0x2b')],_0x3306b0['query']);_0x4b0380[_0x7ef1('0x2c')]=_['intersection'](_0x3306b0['model'],qs[_0x7ef1('0x2d')](_0x58e7ee['query'][_0x7ef1('0x2d')]));_0x4b0380[_0x7ef1('0x2c')]=_0x4b0380[_0x7ef1('0x2c')][_0x7ef1('0x2e')]?_0x4b0380['attributes']:_0x3306b0[_0x7ef1('0x2b')];if(!_0x58e7ee[_0x7ef1('0x2f')]['hasOwnProperty']('nolimit')){_0x4b0380['limit']=qs['limit'](_0x58e7ee[_0x7ef1('0x2f')]['limit']);_0x4b0380[_0x7ef1('0x19')]=qs[_0x7ef1('0x19')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x19')]);}_0x4b0380[_0x7ef1('0x30')]=qs[_0x7ef1('0x31')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x31')]);_0x4b0380[_0x7ef1('0x32')]=qs[_0x7ef1('0x33')](_[_0x7ef1('0x34')](_0x58e7ee['query'],_0x3306b0[_0x7ef1('0x33')]),_0x4b5fde);if(_0x58e7ee[_0x7ef1('0x2f')]['filter']){_0x4b0380[_0x7ef1('0x32')]=_[_0x7ef1('0x35')](_0x4b0380[_0x7ef1('0x32')],{'$or':_[_0x7ef1('0x29')](_0x4b5fde,function(_0x8ef5b3){if(_0x8ef5b3['type']!==_0x7ef1('0x36')){var _0x1ccbfb={};_0x1ccbfb[_0x8ef5b3[_0x7ef1('0x22')]]={'$like':'%'+_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x37')]+'%'};return _0x1ccbfb;}})});}_0x4b0380=_[_0x7ef1('0x35')]({},_0x4b0380,_0x58e7ee[_0x7ef1('0x38')]);var _0x238aa7={'where':_0x4b0380[_0x7ef1('0x32')]};return db[_0x7ef1('0x25')][_0x7ef1('0x39')](_0x238aa7)[_0x7ef1('0x1e')](function(_0x2da912){_0x2546bf[_0x7ef1('0x39')]=_0x2da912;if(_0x58e7ee[_0x7ef1('0x2f')]['includeAll']){_0x4b0380[_0x7ef1('0x3a')]=[{'all':!![]}];}return db[_0x7ef1('0x25')][_0x7ef1('0x3b')](_0x4b0380);})[_0x7ef1('0x1e')](function(_0x3889d7){_0x2546bf[_0x7ef1('0x3c')]=_0x3889d7;return _0x2546bf;})[_0x7ef1('0x1e')](respondWithFilteredResult(_0x2e8f1b,_0x4b0380))[_0x7ef1('0x3d')](handleError(_0x2e8f1b,null));};exports[_0x7ef1('0x3e')]=function(_0x1cff0b,_0x3e5ecd){var _0x374bf5={'raw':!![],'where':{'id':_0x1cff0b['params']['id']}},_0x2fb6c4={};_0x2fb6c4[_0x7ef1('0x2b')]=_[_0x7ef1('0x3f')](db[_0x7ef1('0x25')][_0x7ef1('0x26')]);_0x2fb6c4[_0x7ef1('0x2f')]=_[_0x7ef1('0x3f')](_0x1cff0b['query']);_0x2fb6c4[_0x7ef1('0x33')]=_[_0x7ef1('0x2a')](_0x2fb6c4[_0x7ef1('0x2b')],_0x2fb6c4[_0x7ef1('0x2f')]);_0x374bf5[_0x7ef1('0x2c')]=_[_0x7ef1('0x2a')](_0x2fb6c4['model'],qs[_0x7ef1('0x2d')](_0x1cff0b[_0x7ef1('0x2f')][_0x7ef1('0x2d')]));_0x374bf5[_0x7ef1('0x2c')]=_0x374bf5['attributes'][_0x7ef1('0x2e')]?_0x374bf5['attributes']:_0x2fb6c4['model'];if(_0x1cff0b[_0x7ef1('0x2f')]['includeAll']){_0x374bf5[_0x7ef1('0x3a')]=[{'all':!![]}];}_0x374bf5=_['merge']({},_0x374bf5,_0x1cff0b[_0x7ef1('0x38')]);return db[_0x7ef1('0x25')][_0x7ef1('0x40')](_0x374bf5)[_0x7ef1('0x1e')](handleEntityNotFound(_0x3e5ecd,null))[_0x7ef1('0x1e')](respondWithResult(_0x3e5ecd,null))[_0x7ef1('0x3d')](handleError(_0x3e5ecd,null));};exports[_0x7ef1('0x41')]=function(_0x106096,_0x49e089){return db['Cdr'][_0x7ef1('0x41')](_0x106096[_0x7ef1('0x42')],{})['then'](respondWithResult(_0x49e089,0xc9))[_0x7ef1('0x3d')](handleError(_0x49e089,null));};exports[_0x7ef1('0x43')]=function(_0xd06ca9,_0x5ce876){if(_0xd06ca9['body']['id']){delete _0xd06ca9[_0x7ef1('0x42')]['id'];}return db['Cdr']['find']({'where':{'id':_0xd06ca9[_0x7ef1('0x44')]['id']}})[_0x7ef1('0x1e')](handleEntityNotFound(_0x5ce876,null))[_0x7ef1('0x1e')](saveUpdates(_0xd06ca9[_0x7ef1('0x42')],null))[_0x7ef1('0x1e')](respondWithResult(_0x5ce876,null))['catch'](handleError(_0x5ce876,null));};exports[_0x7ef1('0x1f')]=function(_0x4e425b,_0x350dde){return db['Cdr'][_0x7ef1('0x40')]({'where':{'id':_0x4e425b['params']['id']}})['then'](handleEntityNotFound(_0x350dde,null))[_0x7ef1('0x1e')](removeEntity(_0x350dde,null))['catch'](handleError(_0x350dde,null));};exports[_0x7ef1('0x45')]=function(_0x30a4ce,_0x54a0bb){return db[_0x7ef1('0x25')][_0x7ef1('0x45')]()[_0x7ef1('0x1e')](respondWithResult(_0x54a0bb,null))['catch'](handleError(_0x54a0bb,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d3bb652..49c27b1 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4c7abd,_0x58e363){var _0x4cee23=function(_0xcab98){while(--_0xcab98){_0x4c7abd['push'](_0x4c7abd['shift']());}};_0x4cee23(++_0x58e363);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x27b987,_0x737ee5){var _0x3662f9=function(_0x581def){while(--_0x581def){_0x27b987['push'](_0x27b987['shift']());}};_0x3662f9(++_0x737ee5);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 3a3eb51..6baaba0 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 _0x5fbc=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x320b8e,_0x1da3fe){var _0x55a10a=function(_0x148a56){while(--_0x148a56){_0x320b8e['push'](_0x320b8e['shift']());}};_0x55a10a(++_0x1da3fe);}(_0x5fbc,0x95));var _0xc5fb=function(_0x447fa4,_0x23fa5d){_0x447fa4=_0x447fa4-0x0;var _0x4bf9d1=_0x5fbc[_0x447fa4];return _0x4bf9d1;};'use strict';var _=require(_0xc5fb('0x0'));var util=require(_0xc5fb('0x1'));var moment=require(_0xc5fb('0x2'));var BPromise=require(_0xc5fb('0x3'));var rs=require(_0xc5fb('0x4'));var fs=require('fs');var Redis=require(_0xc5fb('0x5'));var db=require(_0xc5fb('0x6'))['db'];var utils=require(_0xc5fb('0x7'));var logger=require(_0xc5fb('0x8'))(_0xc5fb('0x9'));var config=require(_0xc5fb('0xa'));var jayson=require(_0xc5fb('0xb'));var client=jayson[_0xc5fb('0xc')][_0xc5fb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x563c4e,_0x14bda3,_0x4c0ba1){return new BPromise(function(_0x15420b,_0x398dfd){return client['request'](_0x563c4e,_0x4c0ba1)[_0xc5fb('0xe')](function(_0x5838c9){logger[_0xc5fb('0xf')](_0xc5fb('0x10'),_0x14bda3,_0xc5fb('0x11'));logger[_0xc5fb('0x12')]('Cdr,\x20%s,\x20%s,\x20%s',_0x14bda3,_0xc5fb('0x11'),JSON[_0xc5fb('0x13')](_0x5838c9));if(_0x5838c9[_0xc5fb('0x14')]){if(_0x5838c9['error']['code']===0x1f4){logger[_0xc5fb('0x14')](_0xc5fb('0x10'),_0x14bda3,_0x5838c9['error'][_0xc5fb('0x15')]);return _0x398dfd(_0x5838c9[_0xc5fb('0x14')]['message']);}logger[_0xc5fb('0x14')](_0xc5fb('0x10'),_0x14bda3,_0x5838c9['error']['message']);return _0x15420b(_0x5838c9['error'][_0xc5fb('0x15')]);}else{logger[_0xc5fb('0xf')](_0xc5fb('0x10'),_0x14bda3,_0xc5fb('0x11'));_0x15420b(_0x5838c9[_0xc5fb('0x16')][_0xc5fb('0x15')]);}})[_0xc5fb('0x17')](function(_0x4ad875){logger[_0xc5fb('0x14')](_0xc5fb('0x10'),_0x14bda3,_0x4ad875);_0x398dfd(_0x4ad875);});});} \ No newline at end of file +var _0x7240=['../../mysqldb','../../config/logger','rpc','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7240,0xe3));var _0x0724=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7240[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x0724('0x0'));var moment=require(_0x0724('0x1'));var BPromise=require(_0x0724('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0724('0x3'));var db=require(_0x0724('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0724('0x5'))(_0x0724('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0724('0x7')][_0x0724('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6744cc,_0x3f8745,_0x7c173e){return new BPromise(function(_0x1ddc7f,_0x46548b){return client[_0x0724('0x9')](_0x6744cc,_0x7c173e)[_0x0724('0xa')](function(_0x16e3ed){logger[_0x0724('0xb')](_0x0724('0xc'),_0x3f8745,_0x0724('0xd'));logger[_0x0724('0xe')](_0x0724('0xf'),_0x3f8745,'request\x20sent',JSON[_0x0724('0x10')](_0x16e3ed));if(_0x16e3ed['error']){if(_0x16e3ed[_0x0724('0x11')][_0x0724('0x12')]===0x1f4){logger[_0x0724('0x11')](_0x0724('0xc'),_0x3f8745,_0x16e3ed['error'][_0x0724('0x13')]);return _0x46548b(_0x16e3ed[_0x0724('0x11')]['message']);}logger['error'](_0x0724('0xc'),_0x3f8745,_0x16e3ed[_0x0724('0x11')][_0x0724('0x13')]);return _0x1ddc7f(_0x16e3ed['error']['message']);}else{logger[_0x0724('0xb')](_0x0724('0xc'),_0x3f8745,_0x0724('0xd'));_0x1ddc7f(_0x16e3ed['result'][_0x0724('0x13')]);}})[_0x0724('0x14')](function(_0x507185){logger['error'](_0x0724('0xc'),_0x3f8745,_0x507185);_0x46548b(_0x507185);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index bbcbb00..45e5e9c 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x378380,_0x31dba0){var _0x2a4744=function(_0x3c2fa2){while(--_0x3c2fa2){_0x378380['push'](_0x378380['shift']());}};_0x2a4744(++_0x31dba0);}(_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 +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(_0x1dc1ea,_0x44ab67){var _0x44e0e2=function(_0x415548){while(--_0x415548){_0x1dc1ea['push'](_0x1dc1ea['shift']());}};_0x44e0e2(++_0x44ab67);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 2070d46..e1d1b41 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 _0x3e86=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x3e86,0x87));var _0x63e8=function(_0x25d235,_0x4f57e0){_0x25d235=_0x25d235-0x0;var _0x4439d4=_0x3e86[_0x25d235];return _0x4439d4;};'use strict';var Sequelize=require('sequelize');module[_0x63e8('0x0')]={'priority':{'type':Sequelize[_0x63e8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x63e8('0x2')],'allowNull':![],'defaultValue':_0x63e8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x63e8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x63e8('0x4')}}; \ No newline at end of file +var _0x2e3d=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0xb2c3c2,_0x1d0ff7){var _0x42ff7c=function(_0x2eaddf){while(--_0x2eaddf){_0xb2c3c2['push'](_0xb2c3c2['shift']());}};_0x42ff7c(++_0x1d0ff7);}(_0x2e3d,0xe8));var _0xd2e3=function(_0xba3186,_0x2ae799){_0xba3186=_0xba3186-0x0;var _0x293640=_0x2e3d[_0xba3186];return _0x293640;};'use strict';var Sequelize=require(_0xd2e3('0x0'));module[_0xd2e3('0x1')]={'priority':{'type':Sequelize[_0xd2e3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd2e3('0x3')],'allowNull':![],'defaultValue':_0xd2e3('0x4')},'appdata':{'type':Sequelize[_0xd2e3('0x5')]()},'description':{'type':Sequelize[_0xd2e3('0x3')]},'interval':{'type':Sequelize[_0xd2e3('0x3')],'defaultValue':_0xd2e3('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 685dbe6..68db5c1 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 _0x2f3a=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','name','show','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','length','include','find','catch','params','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x17063a,_0x126be2){var _0x22fa29=function(_0x4dec9a){while(--_0x4dec9a){_0x17063a['push'](_0x17063a['shift']());}};_0x22fa29(++_0x126be2);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x469780,_0x13effe){_0x469780=_0x469780-0x0;var _0x2a2ed5=_0x2f3a[_0x469780];return _0x2a2ed5;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require(_0xa2f3('0x6'));var path=require('path');var sox=require(_0xa2f3('0x7'));var csv=require('to-csv');var ejs=require(_0xa2f3('0x8'));var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2f3('0xa'));var jsforce=require(_0xa2f3('0xb'));var deskjs=require(_0xa2f3('0xc'));var toCsv=require(_0xa2f3('0xd'));var querystring=require('querystring');var Papa=require(_0xa2f3('0xe'));var Redis=require(_0xa2f3('0xf'));var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))(_0xa2f3('0x14'));var utils=require('../../config/utils');var config=require(_0xa2f3('0x15'));var licenseUtil=require(_0xa2f3('0x16'));var db=require(_0xa2f3('0x17'))['db'];function respondWithStatusCode(_0x58f6df,_0x6aa8f2){_0x6aa8f2=_0x6aa8f2||0xcc;return function(_0x194281){if(_0x194281){return _0x58f6df[_0xa2f3('0x18')](_0x6aa8f2);}return _0x58f6df[_0xa2f3('0x19')](_0x6aa8f2)[_0xa2f3('0x1a')]();};}function respondWithResult(_0xd4f9db,_0x3907fe){_0x3907fe=_0x3907fe||0xc8;return function(_0x4544d4){if(_0x4544d4){return _0xd4f9db[_0xa2f3('0x19')](_0x3907fe)['json'](_0x4544d4);}};}function respondWithFilteredResult(_0xdc3967,_0x33bf10){return function(_0x74fb58){if(_0x74fb58){var _0x51d297=typeof _0x33bf10[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x33bf10['limit']==='undefined';var _0xb1fe06=_0x74fb58[_0xa2f3('0x1d')];var _0x2db0d2=_0x51d297?0x0:_0x33bf10[_0xa2f3('0x1b')];var _0x205578=_0x51d297?_0x74fb58[_0xa2f3('0x1d')]:_0x33bf10[_0xa2f3('0x1b')]+_0x33bf10[_0xa2f3('0x1e')];var _0x550d68;if(_0x205578>=_0xb1fe06){_0x205578=_0xb1fe06;_0x550d68=0xc8;}else{_0x550d68=0xce;}_0xdc3967[_0xa2f3('0x19')](_0x550d68);return _0xdc3967[_0xa2f3('0x1f')]('Content-Range',_0x2db0d2+'-'+_0x205578+'/'+_0xb1fe06)['json'](_0x74fb58);}return null;};}function patchUpdates(_0x2f74a0){return function(_0x53af81){try{jsonpatch[_0xa2f3('0x20')](_0x53af81,_0x2f74a0,!![]);}catch(_0x147fb7){return BPromise['reject'](_0x147fb7);}return _0x53af81[_0xa2f3('0x21')]();};}function saveUpdates(_0x3e055d,_0x14d989){return function(_0x2685bb){if(_0x2685bb){return _0x2685bb[_0xa2f3('0x22')](_0x3e055d)[_0xa2f3('0x23')](function(_0x37f8c2){return _0x37f8c2;});}return null;};}function removeEntity(_0xa02908,_0x49a589){return function(_0x81af9b){if(_0x81af9b){return _0x81af9b[_0xa2f3('0x24')]()[_0xa2f3('0x23')](function(){_0xa02908[_0xa2f3('0x19')](0xcc)[_0xa2f3('0x1a')]();});}};}function handleEntityNotFound(_0x2e6332,_0x1be0c1){return function(_0x5347de){if(!_0x5347de){_0x2e6332['sendStatus'](0x194);}return _0x5347de;};}function handleError(_0x2f4248,_0x4319f3){_0x4319f3=_0x4319f3||0x1f4;return function(_0x1dd4ec){logger[_0xa2f3('0x25')](_0x1dd4ec['stack']);if(_0x1dd4ec[_0xa2f3('0x26')]){delete _0x1dd4ec[_0xa2f3('0x26')];}_0x2f4248[_0xa2f3('0x19')](_0x4319f3)['send'](_0x1dd4ec);};}exports[_0xa2f3('0x27')]=function(_0x4ec4ab,_0x1ceea4){var _0x5b868c={'raw':!![],'where':{'id':_0x4ec4ab['params']['id']}},_0x452142={};_0x452142[_0xa2f3('0x28')]=_['keys'](db[_0xa2f3('0x29')][_0xa2f3('0x2a')]);_0x452142[_0xa2f3('0x2b')]=_[_0xa2f3('0x2c')](_0x4ec4ab[_0xa2f3('0x2b')]);_0x452142['filters']=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],_0x452142[_0xa2f3('0x2b')]);_0x5b868c[_0xa2f3('0x2e')]=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],qs[_0xa2f3('0x2f')](_0x4ec4ab[_0xa2f3('0x2b')][_0xa2f3('0x2f')]));_0x5b868c['attributes']=_0x5b868c[_0xa2f3('0x2e')][_0xa2f3('0x30')]?_0x5b868c[_0xa2f3('0x2e')]:_0x452142[_0xa2f3('0x28')];if(_0x4ec4ab[_0xa2f3('0x2b')]['includeAll']){_0x5b868c[_0xa2f3('0x31')]=[{'all':!![]}];}_0x5b868c=_['merge']({},_0x5b868c,_0x4ec4ab['options']);return db[_0xa2f3('0x29')][_0xa2f3('0x32')](_0x5b868c)['then'](handleEntityNotFound(_0x1ceea4,null))[_0xa2f3('0x23')](respondWithResult(_0x1ceea4,null))[_0xa2f3('0x33')](handleError(_0x1ceea4,null));};exports['update']=function(_0x386f66,_0x3cb618){if(_0x386f66['body']['id']){delete _0x386f66['body']['id'];}return db[_0xa2f3('0x29')][_0xa2f3('0x32')]({'where':{'id':_0x386f66[_0xa2f3('0x34')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x3cb618,null))['then'](saveUpdates(_0x386f66[_0xa2f3('0x35')],null))['then'](respondWithResult(_0x3cb618,null))[_0xa2f3('0x33')](handleError(_0x3cb618,null));};exports['destroy']=function(_0x5ac995,_0x37cd82){return db[_0xa2f3('0x29')]['find']({'where':{'id':_0x5ac995[_0xa2f3('0x34')]['id']}})['then'](handleEntityNotFound(_0x37cd82,null))[_0xa2f3('0x23')](removeEntity(_0x37cd82,null))[_0xa2f3('0x33')](handleError(_0x37cd82,null));}; \ No newline at end of file +var _0x78f0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x441382,_0x12dab9){var _0x4f24bf=function(_0x1e9732){while(--_0x1e9732){_0x441382['push'](_0x441382['shift']());}};_0x4f24bf(++_0x12dab9);}(_0x78f0,0x15d));var _0x078f=function(_0x483d5c,_0x51b1ab){_0x483d5c=_0x483d5c-0x0;var _0x26b2c3=_0x78f0[_0x483d5c];return _0x26b2c3;};'use strict';var emlformat=require(_0x078f('0x0'));var rimraf=require(_0x078f('0x1'));var zipdir=require(_0x078f('0x2'));var jsonpatch=require(_0x078f('0x3'));var rp=require(_0x078f('0x4'));var moment=require(_0x078f('0x5'));var BPromise=require(_0x078f('0x6'));var Mustache=require(_0x078f('0x7'));var util=require('util');var path=require(_0x078f('0x8'));var sox=require(_0x078f('0x9'));var csv=require(_0x078f('0xa'));var ejs=require(_0x078f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x078f('0xc'));var squel=require(_0x078f('0xd'));var crypto=require('crypto');var jsforce=require(_0x078f('0xe'));var deskjs=require(_0x078f('0xf'));var toCsv=require(_0x078f('0xa'));var querystring=require(_0x078f('0x10'));var Papa=require(_0x078f('0x11'));var Redis=require(_0x078f('0x12'));var authService=require(_0x078f('0x13'));var qs=require(_0x078f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x078f('0x15'));var logger=require(_0x078f('0x16'))('api');var utils=require(_0x078f('0x17'));var config=require(_0x078f('0x18'));var licenseUtil=require(_0x078f('0x19'));var db=require(_0x078f('0x1a'))['db'];function respondWithStatusCode(_0x5b6b5a,_0x5de876){_0x5de876=_0x5de876||0xcc;return function(_0xe740c0){if(_0xe740c0){return _0x5b6b5a[_0x078f('0x1b')](_0x5de876);}return _0x5b6b5a[_0x078f('0x1c')](_0x5de876)[_0x078f('0x1d')]();};}function respondWithResult(_0x5df646,_0x36670d){_0x36670d=_0x36670d||0xc8;return function(_0x2d29f8){if(_0x2d29f8){return _0x5df646['status'](_0x36670d)[_0x078f('0x1e')](_0x2d29f8);}};}function respondWithFilteredResult(_0x1a44f1,_0x21fc72){return function(_0x363dfd){if(_0x363dfd){var _0x247de9=typeof _0x21fc72[_0x078f('0x1f')]==='undefined'&&typeof _0x21fc72['limit']===_0x078f('0x20');var _0x1e32c0=_0x363dfd[_0x078f('0x21')];var _0x19a182=_0x247de9?0x0:_0x21fc72[_0x078f('0x1f')];var _0x25bb2d=_0x247de9?_0x363dfd[_0x078f('0x21')]:_0x21fc72[_0x078f('0x1f')]+_0x21fc72[_0x078f('0x22')];var _0x276442;if(_0x25bb2d>=_0x1e32c0){_0x25bb2d=_0x1e32c0;_0x276442=0xc8;}else{_0x276442=0xce;}_0x1a44f1[_0x078f('0x1c')](_0x276442);return _0x1a44f1[_0x078f('0x23')]('Content-Range',_0x19a182+'-'+_0x25bb2d+'/'+_0x1e32c0)[_0x078f('0x1e')](_0x363dfd);}return null;};}function patchUpdates(_0x52c74f){return function(_0x567d26){try{jsonpatch[_0x078f('0x24')](_0x567d26,_0x52c74f,!![]);}catch(_0x3c70c2){return BPromise[_0x078f('0x25')](_0x3c70c2);}return _0x567d26[_0x078f('0x26')]();};}function saveUpdates(_0x712d52,_0x2c6db4){return function(_0x104eeb){if(_0x104eeb){return _0x104eeb[_0x078f('0x27')](_0x712d52)[_0x078f('0x28')](function(_0x4b8d12){return _0x4b8d12;});}return null;};}function removeEntity(_0x1f6b98,_0x14ad5c){return function(_0x363cce){if(_0x363cce){return _0x363cce['destroy']()['then'](function(){_0x1f6b98[_0x078f('0x1c')](0xcc)[_0x078f('0x1d')]();});}};}function handleEntityNotFound(_0x3d9d08,_0x240fb4){return function(_0x25fe4f){if(!_0x25fe4f){_0x3d9d08[_0x078f('0x1b')](0x194);}return _0x25fe4f;};}function handleError(_0x186fe3,_0x4e738b){_0x4e738b=_0x4e738b||0x1f4;return function(_0x1f6596){logger[_0x078f('0x29')](_0x1f6596['stack']);if(_0x1f6596[_0x078f('0x2a')]){delete _0x1f6596[_0x078f('0x2a')];}_0x186fe3[_0x078f('0x1c')](_0x4e738b)[_0x078f('0x2b')](_0x1f6596);};}exports[_0x078f('0x2c')]=function(_0xd57307,_0x1a8530){var _0xe41e2e={'raw':!![],'where':{'id':_0xd57307[_0x078f('0x2d')]['id']}},_0x1f0ad6={};_0x1f0ad6[_0x078f('0x2e')]=_[_0x078f('0x2f')](db[_0x078f('0x30')][_0x078f('0x31')]);_0x1f0ad6[_0x078f('0x32')]=_[_0x078f('0x2f')](_0xd57307[_0x078f('0x32')]);_0x1f0ad6[_0x078f('0x33')]=_['intersection'](_0x1f0ad6[_0x078f('0x2e')],_0x1f0ad6['query']);_0xe41e2e['attributes']=_[_0x078f('0x34')](_0x1f0ad6[_0x078f('0x2e')],qs[_0x078f('0x35')](_0xd57307[_0x078f('0x32')]['fields']));_0xe41e2e[_0x078f('0x36')]=_0xe41e2e[_0x078f('0x36')][_0x078f('0x37')]?_0xe41e2e[_0x078f('0x36')]:_0x1f0ad6[_0x078f('0x2e')];if(_0xd57307['query'][_0x078f('0x38')]){_0xe41e2e[_0x078f('0x39')]=[{'all':!![]}];}_0xe41e2e=_['merge']({},_0xe41e2e,_0xd57307['options']);return db[_0x078f('0x30')][_0x078f('0x3a')](_0xe41e2e)['then'](handleEntityNotFound(_0x1a8530,null))[_0x078f('0x28')](respondWithResult(_0x1a8530,null))[_0x078f('0x3b')](handleError(_0x1a8530,null));};exports[_0x078f('0x27')]=function(_0x5165e4,_0x2dfad1){if(_0x5165e4[_0x078f('0x3c')]['id']){delete _0x5165e4[_0x078f('0x3c')]['id'];}return db[_0x078f('0x30')][_0x078f('0x3a')]({'where':{'id':_0x5165e4[_0x078f('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2dfad1,null))[_0x078f('0x28')](saveUpdates(_0x5165e4[_0x078f('0x3c')],null))[_0x078f('0x28')](respondWithResult(_0x2dfad1,null))[_0x078f('0x3b')](handleError(_0x2dfad1,null));};exports['destroy']=function(_0x474a46,_0x2b1e0f){return db[_0x078f('0x30')][_0x078f('0x3a')]({'where':{'id':_0x474a46[_0x078f('0x2d')]['id']}})[_0x078f('0x28')](handleEntityNotFound(_0x2b1e0f,null))[_0x078f('0x28')](removeEntity(_0x2b1e0f,null))[_0x078f('0x3b')](handleError(_0x2b1e0f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d473d17..806ec7a 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 _0xc8c3=['util','../../config/logger','bluebird','request-promise','path','./chatApplication.attributes','exports','chat_applications','utf8mb4','lodash'];(function(_0x502846,_0x1386ff){var _0x3047fc=function(_0x18cb5e){while(--_0x18cb5e){_0x502846['push'](_0x502846['shift']());}};_0x3047fc(++_0x1386ff);}(_0xc8c3,0x1c1));var _0x3c8c=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0xc8c3[_0x326e79];return _0x37eb89;};'use strict';var _=require(_0x3c8c('0x0'));var util=require(_0x3c8c('0x1'));var logger=require(_0x3c8c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3c8c('0x3'));var rp=require(_0x3c8c('0x4'));var fs=require('fs');var path=require(_0x3c8c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3c8c('0x6'));module[_0x3c8c('0x7')]=function(_0xa99947,_0x5e1173){return _0xa99947['define']('ChatApplication',attributes,{'tableName':_0x3c8c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c8c('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc87e=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc87e,0x17b));var _0xec87=function(_0x31caa8,_0x3f5f6c){_0x31caa8=_0x31caa8-0x0;var _0x2f5c18=_0xc87e[_0x31caa8];return _0x2f5c18;};'use strict';var _=require(_0xec87('0x0'));var util=require(_0xec87('0x1'));var logger=require(_0xec87('0x2'))(_0xec87('0x3'));var moment=require(_0xec87('0x4'));var BPromise=require(_0xec87('0x5'));var rp=require(_0xec87('0x6'));var fs=require('fs');var path=require(_0xec87('0x7'));var rimraf=require(_0xec87('0x8'));var config=require('../../config/environment');var attributes=require(_0xec87('0x9'));module[_0xec87('0xa')]=function(_0x100da4,_0x551b6f){return _0x100da4['define'](_0xec87('0xb'),attributes,{'tableName':_0xec87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec87('0xd'),'collate':_0xec87('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 2a293bb..8c440c7 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 _0x7c35=['code','message','ChatApplication,\x20%s,\x20%s','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error'];(function(_0x14c7b3,_0x4677b7){var _0x1518ef=function(_0x3bc379){while(--_0x3bc379){_0x14c7b3['push'](_0x14c7b3['shift']());}};_0x1518ef(++_0x4677b7);}(_0x7c35,0x1a8));var _0x57c3=function(_0x3f12ef,_0x445139){_0x3f12ef=_0x3f12ef-0x0;var _0x29b0d1=_0x7c35[_0x3f12ef];return _0x29b0d1;};'use strict';var _=require(_0x57c3('0x0'));var util=require(_0x57c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x57c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57c3('0x3'))['db'];var utils=require(_0x57c3('0x4'));var logger=require(_0x57c3('0x5'))(_0x57c3('0x6'));var config=require('../../config/environment');var jayson=require(_0x57c3('0x7'));var client=jayson[_0x57c3('0x8')][_0x57c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53bcbe,_0x3ebdcd,_0x468fa6){return new BPromise(function(_0x3749ca,_0x2685c7){return client[_0x57c3('0xa')](_0x53bcbe,_0x468fa6)['then'](function(_0x5398e9){logger[_0x57c3('0xb')]('ChatApplication,\x20%s,\x20%s',_0x3ebdcd,_0x57c3('0xc'));logger[_0x57c3('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x3ebdcd,_0x57c3('0xc'),JSON[_0x57c3('0xe')](_0x5398e9));if(_0x5398e9[_0x57c3('0xf')]){if(_0x5398e9[_0x57c3('0xf')][_0x57c3('0x10')]===0x1f4){logger[_0x57c3('0xf')]('ChatApplication,\x20%s,\x20%s',_0x3ebdcd,_0x5398e9[_0x57c3('0xf')][_0x57c3('0x11')]);return _0x2685c7(_0x5398e9[_0x57c3('0xf')][_0x57c3('0x11')]);}logger['error'](_0x57c3('0x12'),_0x3ebdcd,_0x5398e9['error'][_0x57c3('0x11')]);return _0x3749ca(_0x5398e9['error'][_0x57c3('0x11')]);}else{logger[_0x57c3('0xb')](_0x57c3('0x12'),_0x3ebdcd,_0x57c3('0xc'));_0x3749ca(_0x5398e9[_0x57c3('0x13')]['message']);}})['catch'](function(_0x3e322d){logger[_0x57c3('0xf')](_0x57c3('0x12'),_0x3ebdcd,_0x3e322d);_0x2685c7(_0x3e322d);});});} \ No newline at end of file +var _0xe909=['client','http','request','then','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','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe909,0xaf));var _0x9e90=function(_0x111bab,_0x271498){_0x111bab=_0x111bab-0x0;var _0x5999fa=_0xe909[_0x111bab];return _0x5999fa;};'use strict';var _=require(_0x9e90('0x0'));var util=require(_0x9e90('0x1'));var moment=require(_0x9e90('0x2'));var BPromise=require(_0x9e90('0x3'));var rs=require(_0x9e90('0x4'));var fs=require('fs');var Redis=require(_0x9e90('0x5'));var db=require(_0x9e90('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e90('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9e90('0x8'));var client=jayson[_0x9e90('0x9')][_0x9e90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3afa3d,_0x158a22,_0x8c92b8){return new BPromise(function(_0x459be9,_0x1123c4){return client[_0x9e90('0xb')](_0x3afa3d,_0x8c92b8)[_0x9e90('0xc')](function(_0x50413c){logger['info'](_0x9e90('0xd'),_0x158a22,_0x9e90('0xe'));logger[_0x9e90('0xf')](_0x9e90('0x10'),_0x158a22,'request\x20sent',JSON[_0x9e90('0x11')](_0x50413c));if(_0x50413c[_0x9e90('0x12')]){if(_0x50413c['error'][_0x9e90('0x13')]===0x1f4){logger[_0x9e90('0x12')](_0x9e90('0xd'),_0x158a22,_0x50413c[_0x9e90('0x12')][_0x9e90('0x14')]);return _0x1123c4(_0x50413c['error'][_0x9e90('0x14')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x158a22,_0x50413c[_0x9e90('0x12')][_0x9e90('0x14')]);return _0x459be9(_0x50413c[_0x9e90('0x12')][_0x9e90('0x14')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x158a22,_0x9e90('0xe'));_0x459be9(_0x50413c[_0x9e90('0x15')][_0x9e90('0x14')]);}})[_0x9e90('0x16')](function(_0x561090){logger[_0x9e90('0x12')]('ChatApplication,\x20%s,\x20%s',_0x158a22,_0x561090);_0x1123c4(_0x561090);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 636279a..a9f1848 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 _0xd053=['/:id','isAuthenticated','show','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get'];(function(_0x5bd001,_0x4b9f83){var _0x319f00=function(_0x265146){while(--_0x265146){_0x5bd001['push'](_0x5bd001['shift']());}};_0x319f00(++_0x4b9f83);}(_0xd053,0x185));var _0x3d05=function(_0x2e5636,_0x2b9540){_0x2e5636=_0x2e5636-0x0;var _0x4d7371=_0xd053[_0x2e5636];return _0x4d7371;};'use strict';var multer=require(_0x3d05('0x0'));var util=require(_0x3d05('0x1'));var path=require(_0x3d05('0x2'));var timeout=require(_0x3d05('0x3'));var express=require(_0x3d05('0x4'));var router=express[_0x3d05('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3d05('0x6'));var interaction=require(_0x3d05('0x7'));var config=require(_0x3d05('0x8'));var controller=require(_0x3d05('0x9'));router[_0x3d05('0xa')](_0x3d05('0xb'),auth[_0x3d05('0xc')](),controller[_0x3d05('0xd')]);router[_0x3d05('0xe')](_0x3d05('0xb'),auth[_0x3d05('0xc')](),controller['update']);router['delete'](_0x3d05('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3d05('0xf')]=router; \ No newline at end of file +var _0x08ea=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x4da466,_0x547783){var _0x51ab64=function(_0x5bcfad){while(--_0x5bcfad){_0x4da466['push'](_0x4da466['shift']());}};_0x51ab64(++_0x547783);}(_0x08ea,0x10e));var _0xa08e=function(_0x4e4ee9,_0x5e3caf){_0x4e4ee9=_0x4e4ee9-0x0;var _0x3235e4=_0x08ea[_0x4e4ee9];return _0x3235e4;};'use strict';var multer=require(_0xa08e('0x0'));var util=require(_0xa08e('0x1'));var path=require(_0xa08e('0x2'));var timeout=require('connect-timeout');var express=require(_0xa08e('0x3'));var router=express[_0xa08e('0x4')]();var fs_extra=require(_0xa08e('0x5'));var auth=require(_0xa08e('0x6'));var interaction=require(_0xa08e('0x7'));var config=require('../../config/environment');var controller=require(_0xa08e('0x8'));router[_0xa08e('0x9')]('/:id',auth[_0xa08e('0xa')](),controller[_0xa08e('0xb')]);router[_0xa08e('0xc')](_0xa08e('0xd'),auth[_0xa08e('0xa')](),controller[_0xa08e('0xe')]);router[_0xa08e('0xf')](_0xa08e('0xd'),auth[_0xa08e('0xa')](),controller[_0xa08e('0x10')]);module[_0xa08e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c350cca..384aefe 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 _0x287e=['exports','STRING','BOOLEAN','sequelize'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x287e,0x1e3));var _0xe287=function(_0xa36bd6,_0x423c7a){_0xa36bd6=_0xa36bd6-0x0;var _0x25153d=_0x287e[_0xa36bd6];return _0x25153d;};'use strict';var Sequelize=require(_0xe287('0x0'));module[_0xe287('0x1')]={'name':{'type':Sequelize[_0xe287('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe287('0x2')]},'write':{'type':Sequelize[_0xe287('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1799=['STRING','BOOLEAN','sequelize'];(function(_0x4fc915,_0x39b32e){var _0x42f0d0=function(_0x193c83){while(--_0x193c83){_0x4fc915['push'](_0x4fc915['shift']());}};_0x42f0d0(++_0x39b32e);}(_0x1799,0x161));var _0x9179=function(_0x30779e,_0x51d772){_0x30779e=_0x30779e-0x0;var _0xc5a803=_0x1799[_0x30779e];return _0xc5a803;};'use strict';var Sequelize=require(_0x9179('0x0'));module['exports']={'name':{'type':Sequelize[_0x9179('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9179('0x1')]},'write':{'type':Sequelize[_0x9179('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 a3ff1bc..f9c60b2 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 _0x6f1e=['describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','order','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','Content-Range','save','update','destroy','then','stack','name','send','index','map','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','show','includeAll','options','find','create','body','params'];(function(_0x3fc58c,_0xa5e32e){var _0x32ad03=function(_0x11bc61){while(--_0x11bc61){_0x3fc58c['push'](_0x3fc58c['shift']());}};_0x32ad03(++_0xa5e32e);}(_0x6f1e,0x134));var _0xe6f1=function(_0x316dcc,_0x35c7ed){_0x316dcc=_0x316dcc-0x0;var _0x5c1022=_0x6f1e[_0x316dcc];return _0x5c1022;};'use strict';var emlformat=require(_0xe6f1('0x0'));var rimraf=require(_0xe6f1('0x1'));var zipdir=require(_0xe6f1('0x2'));var jsonpatch=require(_0xe6f1('0x3'));var rp=require(_0xe6f1('0x4'));var moment=require('moment');var BPromise=require(_0xe6f1('0x5'));var Mustache=require(_0xe6f1('0x6'));var util=require(_0xe6f1('0x7'));var path=require(_0xe6f1('0x8'));var sox=require(_0xe6f1('0x9'));var csv=require(_0xe6f1('0xa'));var ejs=require(_0xe6f1('0xb'));var fs=require('fs');var fs_extra=require(_0xe6f1('0xc'));var _=require(_0xe6f1('0xd'));var squel=require(_0xe6f1('0xe'));var crypto=require('crypto');var jsforce=require(_0xe6f1('0xf'));var deskjs=require(_0xe6f1('0x10'));var toCsv=require(_0xe6f1('0xa'));var querystring=require(_0xe6f1('0x11'));var Papa=require('papaparse');var Redis=require(_0xe6f1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe6f1('0x13'));var as=require(_0xe6f1('0x14'));var hardwareService=require(_0xe6f1('0x15'));var logger=require(_0xe6f1('0x16'))(_0xe6f1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe6f1('0x18'));var db=require(_0xe6f1('0x19'))['db'];config['redis']=_['defaults'](config[_0xe6f1('0x1a')],{'host':_0xe6f1('0x1b'),'port':0x18eb});var socket=require(_0xe6f1('0x1c'))(new Redis(config['redis']));require(_0xe6f1('0x1d'))['register'](socket);function respondWithStatusCode(_0x423ad2,_0x1cbc79){_0x1cbc79=_0x1cbc79||0xcc;return function(_0x554899){if(_0x554899){return _0x423ad2[_0xe6f1('0x1e')](_0x1cbc79);}return _0x423ad2[_0xe6f1('0x1f')](_0x1cbc79)[_0xe6f1('0x20')]();};}function respondWithResult(_0x3ca40a,_0x45993d){_0x45993d=_0x45993d||0xc8;return function(_0x167dd4){if(_0x167dd4){return _0x3ca40a[_0xe6f1('0x1f')](_0x45993d)[_0xe6f1('0x21')](_0x167dd4);}};}function respondWithFilteredResult(_0x3ff11f,_0x15fd28){return function(_0x1f876b){if(_0x1f876b){var _0x4841fb=typeof _0x15fd28[_0xe6f1('0x22')]==='undefined'&&typeof _0x15fd28[_0xe6f1('0x23')]==='undefined';var _0x108a0a=_0x1f876b['count'];var _0x4aed6b=_0x4841fb?0x0:_0x15fd28[_0xe6f1('0x22')];var _0x310ed5=_0x4841fb?_0x1f876b['count']:_0x15fd28[_0xe6f1('0x22')]+_0x15fd28[_0xe6f1('0x23')];var _0x1aab31;if(_0x310ed5>=_0x108a0a){_0x310ed5=_0x108a0a;_0x1aab31=0xc8;}else{_0x1aab31=0xce;}_0x3ff11f[_0xe6f1('0x1f')](_0x1aab31);return _0x3ff11f['set'](_0xe6f1('0x24'),_0x4aed6b+'-'+_0x310ed5+'/'+_0x108a0a)['json'](_0x1f876b);}return null;};}function patchUpdates(_0x2048cb){return function(_0x1e1c30){try{jsonpatch['apply'](_0x1e1c30,_0x2048cb,!![]);}catch(_0x171399){return BPromise['reject'](_0x171399);}return _0x1e1c30[_0xe6f1('0x25')]();};}function saveUpdates(_0x2792ed,_0x2fd179){return function(_0x3d9dc7){if(_0x3d9dc7){return _0x3d9dc7[_0xe6f1('0x26')](_0x2792ed)['then'](function(_0x72b911){return _0x72b911;});}return null;};}function removeEntity(_0x900de6,_0x442264){return function(_0x863c1a){if(_0x863c1a){return _0x863c1a[_0xe6f1('0x27')]()[_0xe6f1('0x28')](function(){_0x900de6[_0xe6f1('0x1f')](0xcc)[_0xe6f1('0x20')]();});}};}function handleEntityNotFound(_0x5c5d02,_0xcabe98){return function(_0x1d450d){if(!_0x1d450d){_0x5c5d02[_0xe6f1('0x1e')](0x194);}return _0x1d450d;};}function handleError(_0x2b908b,_0x2e460d){_0x2e460d=_0x2e460d||0x1f4;return function(_0x455a89){logger['error'](_0x455a89[_0xe6f1('0x29')]);if(_0x455a89[_0xe6f1('0x2a')]){delete _0x455a89[_0xe6f1('0x2a')];}_0x2b908b[_0xe6f1('0x1f')](_0x2e460d)[_0xe6f1('0x2b')](_0x455a89);};}exports[_0xe6f1('0x2c')]=function(_0x570823,_0xb8ceb){var _0xe9f547={},_0x56fe7a={},_0xe86161={'count':0x0,'rows':[]};var _0x5524b4=_[_0xe6f1('0x2d')](db[_0xe6f1('0x2e')][_0xe6f1('0x2f')],function(_0x285054){return{'name':_0x285054['fieldName'],'type':_0x285054[_0xe6f1('0x30')]['key']};});_0x56fe7a[_0xe6f1('0x31')]=_[_0xe6f1('0x2d')](_0x5524b4,_0xe6f1('0x2a'));_0x56fe7a[_0xe6f1('0x32')]=_[_0xe6f1('0x33')](_0x570823[_0xe6f1('0x32')]);_0x56fe7a[_0xe6f1('0x34')]=_[_0xe6f1('0x35')](_0x56fe7a[_0xe6f1('0x31')],_0x56fe7a[_0xe6f1('0x32')]);_0xe9f547[_0xe6f1('0x36')]=_[_0xe6f1('0x35')](_0x56fe7a['model'],qs[_0xe6f1('0x37')](_0x570823['query'][_0xe6f1('0x37')]));_0xe9f547[_0xe6f1('0x36')]=_0xe9f547[_0xe6f1('0x36')][_0xe6f1('0x38')]?_0xe9f547[_0xe6f1('0x36')]:_0x56fe7a[_0xe6f1('0x31')];if(!_0x570823[_0xe6f1('0x32')][_0xe6f1('0x39')]('nolimit')){_0xe9f547[_0xe6f1('0x23')]=qs[_0xe6f1('0x23')](_0x570823['query'][_0xe6f1('0x23')]);_0xe9f547[_0xe6f1('0x22')]=qs[_0xe6f1('0x22')](_0x570823['query']['offset']);}_0xe9f547['order']=qs[_0xe6f1('0x3a')](_0x570823['query']['sort']);_0xe9f547[_0xe6f1('0x3b')]=qs['filters'](_[_0xe6f1('0x3c')](_0x570823[_0xe6f1('0x32')],_0x56fe7a[_0xe6f1('0x34')]),_0x5524b4);if(_0x570823[_0xe6f1('0x32')][_0xe6f1('0x3d')]){_0xe9f547[_0xe6f1('0x3b')]=_[_0xe6f1('0x3e')](_0xe9f547[_0xe6f1('0x3b')],{'$or':_[_0xe6f1('0x2d')](_0x5524b4,function(_0x402be8){if(_0x402be8[_0xe6f1('0x30')]!==_0xe6f1('0x3f')){var _0x39218e={};_0x39218e[_0x402be8[_0xe6f1('0x2a')]]={'$like':'%'+_0x570823['query'][_0xe6f1('0x3d')]+'%'};return _0x39218e;}})});}_0xe9f547=_[_0xe6f1('0x3e')]({},_0xe9f547,_0x570823['options']);var _0x384ee6={'where':_0xe9f547['where']};return db[_0xe6f1('0x2e')][_0xe6f1('0x40')](_0x384ee6)['then'](function(_0x913e0a){_0xe86161[_0xe6f1('0x40')]=_0x913e0a;if(_0x570823[_0xe6f1('0x32')]['includeAll']){_0xe9f547[_0xe6f1('0x41')]=[{'all':!![]}];}return db[_0xe6f1('0x2e')][_0xe6f1('0x42')](_0xe9f547);})[_0xe6f1('0x28')](function(_0x114ec3){_0xe86161[_0xe6f1('0x43')]=_0x114ec3;return _0xe86161;})[_0xe6f1('0x28')](respondWithFilteredResult(_0xb8ceb,_0xe9f547))[_0xe6f1('0x44')](handleError(_0xb8ceb,null));};exports[_0xe6f1('0x45')]=function(_0x5d10e5,_0x462121){var _0xab19cc={'raw':!![],'where':{'id':_0x5d10e5['params']['id']}},_0x1111e9={};_0x1111e9[_0xe6f1('0x31')]=_[_0xe6f1('0x33')](db[_0xe6f1('0x2e')][_0xe6f1('0x2f')]);_0x1111e9[_0xe6f1('0x32')]=_[_0xe6f1('0x33')](_0x5d10e5[_0xe6f1('0x32')]);_0x1111e9[_0xe6f1('0x34')]=_[_0xe6f1('0x35')](_0x1111e9[_0xe6f1('0x31')],_0x1111e9['query']);_0xab19cc['attributes']=_[_0xe6f1('0x35')](_0x1111e9[_0xe6f1('0x31')],qs['fields'](_0x5d10e5['query'][_0xe6f1('0x37')]));_0xab19cc['attributes']=_0xab19cc[_0xe6f1('0x36')][_0xe6f1('0x38')]?_0xab19cc[_0xe6f1('0x36')]:_0x1111e9[_0xe6f1('0x31')];if(_0x5d10e5[_0xe6f1('0x32')][_0xe6f1('0x46')]){_0xab19cc['include']=[{'all':!![]}];}_0xab19cc=_[_0xe6f1('0x3e')]({},_0xab19cc,_0x5d10e5[_0xe6f1('0x47')]);return db[_0xe6f1('0x2e')][_0xe6f1('0x48')](_0xab19cc)[_0xe6f1('0x28')](handleEntityNotFound(_0x462121,null))[_0xe6f1('0x28')](respondWithResult(_0x462121,null))['catch'](handleError(_0x462121,null));};exports[_0xe6f1('0x49')]=function(_0x46411c,_0x35b788){return db['ChatGroup']['create'](_0x46411c['body'],{})[_0xe6f1('0x28')](respondWithResult(_0x35b788,0xc9))[_0xe6f1('0x44')](handleError(_0x35b788,null));};exports[_0xe6f1('0x26')]=function(_0x2d09c2,_0x22b43e){if(_0x2d09c2[_0xe6f1('0x4a')]['id']){delete _0x2d09c2[_0xe6f1('0x4a')]['id'];}return db[_0xe6f1('0x2e')]['find']({'where':{'id':_0x2d09c2['params']['id']}})[_0xe6f1('0x28')](handleEntityNotFound(_0x22b43e,null))[_0xe6f1('0x28')](saveUpdates(_0x2d09c2['body'],null))[_0xe6f1('0x28')](respondWithResult(_0x22b43e,null))[_0xe6f1('0x44')](handleError(_0x22b43e,null));};exports[_0xe6f1('0x27')]=function(_0xc2cf88,_0x5be89d){return db[_0xe6f1('0x2e')][_0xe6f1('0x48')]({'where':{'id':_0xc2cf88[_0xe6f1('0x4b')]['id']}})[_0xe6f1('0x28')](handleEntityNotFound(_0x5be89d,null))[_0xe6f1('0x28')](removeEntity(_0x5be89d,null))[_0xe6f1('0x44')](handleError(_0x5be89d,null));};exports[_0xe6f1('0x4c')]=function(_0x28b241,_0x32e644){return db[_0xe6f1('0x2e')]['describe']()['then'](respondWithResult(_0x32e644,null))['catch'](handleError(_0x32e644,null));};exports[_0xe6f1('0x4d')]=function(_0x375de9,_0x3c7aaf,_0x2c3c50){return db[_0xe6f1('0x4e')]['count']({'where':{'ChatGroupId':_0x375de9['params']['id'],'ToId':_0x375de9[_0xe6f1('0x4f')]['id'],'read':![]}})[_0xe6f1('0x28')](function(_0x39e9d9){return{'id':_[_0xe6f1('0x50')](_0x375de9[_0xe6f1('0x4b')]['id']),'count':_0x39e9d9};})[_0xe6f1('0x28')](respondWithResult(_0x3c7aaf,null))['catch'](handleError(_0x3c7aaf,null));};exports[_0xe6f1('0x51')]=function(_0x3e2eb9,_0x440d16,_0xc9c23f){return db['ChatGroup'][_0xe6f1('0x48')]({'where':{'id':_0x3e2eb9[_0xe6f1('0x4b')]['id']}})[_0xe6f1('0x28')](handleEntityNotFound(_0x440d16,null))[_0xe6f1('0x28')](function(_0x636a75){if(_0x636a75){return _0x636a75['addMembers'](_0x3e2eb9[_0xe6f1('0x4a')][_0xe6f1('0x52')],_['omit'](_0x3e2eb9[_0xe6f1('0x4a')],['ids','id'])||{});}})[_0xe6f1('0x28')](respondWithResult(_0x440d16,null))['catch'](handleError(_0x440d16,null));};exports[_0xe6f1('0x53')]=function(_0x560d94,_0x3ce83a,_0xe6ddb2){var _0x3810f2={};var _0x2ef849={};var _0x4b15b1;var _0x142ada;return db[_0xe6f1('0x2e')][_0xe6f1('0x54')]({'where':{'id':_0x560d94[_0xe6f1('0x4b')]['id']}})[_0xe6f1('0x28')](handleEntityNotFound(_0x3ce83a,null))[_0xe6f1('0x28')](function(_0x2aa1a3){if(_0x2aa1a3){_0x4b15b1=_0x2aa1a3;_0x2ef849[_0xe6f1('0x31')]=_[_0xe6f1('0x33')](db[_0xe6f1('0x55')]['rawAttributes']);_0x2ef849[_0xe6f1('0x32')]=_[_0xe6f1('0x33')](_0x560d94[_0xe6f1('0x32')]);_0x2ef849['filters']=_[_0xe6f1('0x35')](_0x2ef849[_0xe6f1('0x31')],_0x2ef849['query']);_0x3810f2[_0xe6f1('0x36')]=_[_0xe6f1('0x35')](_0x2ef849[_0xe6f1('0x31')],qs[_0xe6f1('0x37')](_0x560d94['query']['fields']));_0x3810f2['attributes']=_0x3810f2['attributes']['length']?_0x3810f2[_0xe6f1('0x36')]:_0x2ef849['model'];_0x3810f2[_0xe6f1('0x56')]=qs[_0xe6f1('0x3a')](_0x560d94[_0xe6f1('0x32')][_0xe6f1('0x3a')]);_0x3810f2[_0xe6f1('0x3b')]=qs['filters'](_[_0xe6f1('0x3c')](_0x560d94[_0xe6f1('0x32')],_0x2ef849['filters']));if(_0x560d94['query'][_0xe6f1('0x3d')]){_0x3810f2[_0xe6f1('0x3b')]=_[_0xe6f1('0x3e')](_0x3810f2[_0xe6f1('0x3b')],{'$or':_[_0xe6f1('0x2d')](_0x3810f2[_0xe6f1('0x36')],function(_0x5ccd38){var _0x331fa2={};_0x331fa2[_0x5ccd38]={'$like':'%'+_0x560d94['query'][_0xe6f1('0x3d')]+'%'};return _0x331fa2;})});}_0x3810f2=_[_0xe6f1('0x3e')]({},_0x3810f2,_0x560d94['options']);return _0x4b15b1[_0xe6f1('0x53')](_0x3810f2);}})[_0xe6f1('0x28')](function(_0x230e6){if(_0x230e6){_0x142ada=_0x230e6[_0xe6f1('0x38')];if(!_0x560d94[_0xe6f1('0x32')]['hasOwnProperty'](_0xe6f1('0x57'))){_0x3810f2[_0xe6f1('0x23')]=qs[_0xe6f1('0x23')](_0x560d94[_0xe6f1('0x32')]['limit']);_0x3810f2[_0xe6f1('0x22')]=qs[_0xe6f1('0x22')](_0x560d94[_0xe6f1('0x32')][_0xe6f1('0x22')]);}return _0x4b15b1['getMembers'](_0x3810f2);}})[_0xe6f1('0x28')](function(_0x58fbbc){if(_0x58fbbc){return _0x58fbbc?{'count':_0x142ada,'rows':_0x58fbbc}:null;}})['then'](respondWithResult(_0x3ce83a,null))[_0xe6f1('0x44')](handleError(_0x3ce83a,null));};exports[_0xe6f1('0x58')]=function(_0xc9dd0a,_0x386043,_0xf5cc9c){return db[_0xe6f1('0x2e')][_0xe6f1('0x48')]({'where':{'id':_0xc9dd0a[_0xe6f1('0x4b')]['id']}})[_0xe6f1('0x28')](handleEntityNotFound(_0x386043,null))[_0xe6f1('0x28')](function(_0x41ab81){if(_0x41ab81){return _0x41ab81['removeMembers'](_0xc9dd0a[_0xe6f1('0x32')][_0xe6f1('0x52')]);}})['then'](respondWithStatusCode(_0x386043,null))['catch'](handleError(_0x386043,null));};exports[_0xe6f1('0x59')]=function(_0x2fc505,_0x304383,_0x108200){if(_0x2fc505[_0xe6f1('0x4a')]['id']){delete _0x2fc505[_0xe6f1('0x4a')]['id'];}return db[_0xe6f1('0x2e')][_0xe6f1('0x48')]({'where':{'id':_0x2fc505[_0xe6f1('0x4b')]['id']}})[_0xe6f1('0x28')](handleEntityNotFound(_0x304383,null))[_0xe6f1('0x28')](function(_0x3cade6){if(_0x3cade6){_0x2fc505[_0xe6f1('0x4a')][_0xe6f1('0x5a')]=_0x3cade6['id'];return db[_0xe6f1('0x4e')][_0xe6f1('0x49')](_0x2fc505['body']);}})[_0xe6f1('0x28')](respondWithResult(_0x304383,null))['catch'](handleError(_0x304383,null));};exports[_0xe6f1('0x5b')]=function(_0x209a44,_0x27851a,_0x1ab9d2){var _0x140a63={};var _0xc8a4f1={};var _0x1061fc;var _0x5f422b;return db['ChatGroup'][_0xe6f1('0x54')]({'where':{'id':_0x209a44[_0xe6f1('0x4b')]['id']}})[_0xe6f1('0x28')](handleEntityNotFound(_0x27851a,null))['then'](function(_0x1e6285){if(_0x1e6285){_0x1061fc=_0x1e6285;_0xc8a4f1['model']=_[_0xe6f1('0x33')](db['ChatInternalMessage'][_0xe6f1('0x2f')]);_0xc8a4f1['query']=_['keys'](_0x209a44[_0xe6f1('0x32')]);_0xc8a4f1[_0xe6f1('0x34')]=_[_0xe6f1('0x35')](_0xc8a4f1['model'],_0xc8a4f1[_0xe6f1('0x32')]);_0x140a63[_0xe6f1('0x36')]=_[_0xe6f1('0x35')](_0xc8a4f1[_0xe6f1('0x31')],qs[_0xe6f1('0x37')](_0x209a44[_0xe6f1('0x32')][_0xe6f1('0x37')]));_0x140a63[_0xe6f1('0x36')]=_0x140a63['attributes'][_0xe6f1('0x38')]?_0x140a63['attributes']:_0xc8a4f1[_0xe6f1('0x31')];_0x140a63[_0xe6f1('0x56')]=qs[_0xe6f1('0x3a')](_0x209a44[_0xe6f1('0x32')][_0xe6f1('0x3a')]);_0x140a63['where']=qs[_0xe6f1('0x34')](_[_0xe6f1('0x3c')](_0x209a44[_0xe6f1('0x32')],_0xc8a4f1['filters']));if(_0x209a44[_0xe6f1('0x32')]['filter']){_0x140a63['where']=_[_0xe6f1('0x3e')](_0x140a63[_0xe6f1('0x3b')],{'$or':_['map'](_0x140a63[_0xe6f1('0x36')],function(_0xa1b4be){var _0x45a17e={};_0x45a17e[_0xa1b4be]={'$like':'%'+_0x209a44[_0xe6f1('0x32')][_0xe6f1('0x3d')]+'%'};return _0x45a17e;})});}if(_0x209a44[_0xe6f1('0x32')][_0xe6f1('0x5c')]){var _0x2592e6=_0x209a44[_0xe6f1('0x32')][_0xe6f1('0x5c')][_0xe6f1('0x5d')](',');var _0x520c64={};_0x520c64[_0x2592e6[0x0]]={'$gte':moment(_0x2592e6[0x1])[_0xe6f1('0x5e')](_0xe6f1('0x5f'))};_0x140a63[_0xe6f1('0x3b')]=_[_0xe6f1('0x3e')](_0x140a63[_0xe6f1('0x3b')],_0x520c64);}_0x140a63=_[_0xe6f1('0x3e')]({},_0x140a63,_0x209a44[_0xe6f1('0x47')]);return _0x1061fc[_0xe6f1('0x5b')](_0x140a63);}})[_0xe6f1('0x28')](function(_0x11f686){if(_0x11f686){_0x5f422b=_0x11f686[_0xe6f1('0x38')];if(!_0x209a44['query'][_0xe6f1('0x39')](_0xe6f1('0x57'))){_0x140a63['limit']=qs[_0xe6f1('0x23')](_0x209a44['query'][_0xe6f1('0x23')]);_0x140a63[_0xe6f1('0x22')]=qs['offset'](_0x209a44[_0xe6f1('0x32')][_0xe6f1('0x22')]);}return _0x1061fc[_0xe6f1('0x5b')](_0x140a63);}})[_0xe6f1('0x28')](function(_0x24f30b){if(_0x24f30b){return _0x24f30b?{'count':_0x5f422b,'rows':_0x24f30b}:null;}})[_0xe6f1('0x28')](respondWithResult(_0x27851a,null))['catch'](handleError(_0x27851a,null));}; \ No newline at end of file +var _0x8605=['to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','ChatGroup','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','findAll','rows','catch','include','find','create','body','params','describe','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','getMessages','$gte','split','rimraf','zip-dir','fast-json-patch','request-promise','util','path'];(function(_0x46bd7e,_0x55f146){var _0x2b8e37=function(_0x56bd92){while(--_0x56bd92){_0x46bd7e['push'](_0x46bd7e['shift']());}};_0x2b8e37(++_0x55f146);}(_0x8605,0x1a8));var _0x5860=function(_0x30fb08,_0x1a0eaf){_0x30fb08=_0x30fb08-0x0;var _0x1366bd=_0x8605[_0x30fb08];return _0x1366bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5860('0x0'));var zipdir=require(_0x5860('0x1'));var jsonpatch=require(_0x5860('0x2'));var rp=require(_0x5860('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5860('0x4'));var path=require(_0x5860('0x5'));var sox=require('sox');var csv=require(_0x5860('0x6'));var ejs=require(_0x5860('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5860('0x8'));var deskjs=require(_0x5860('0x9'));var toCsv=require(_0x5860('0x6'));var querystring=require(_0x5860('0xa'));var Papa=require(_0x5860('0xb'));var Redis=require(_0x5860('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5860('0xd'));var as=require(_0x5860('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5860('0xf'))(_0x5860('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5860('0x11'));var db=require(_0x5860('0x12'))['db'];config[_0x5860('0x13')]=_[_0x5860('0x14')](config[_0x5860('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x5860('0x15'))(new Redis(config[_0x5860('0x13')]));require(_0x5860('0x16'))[_0x5860('0x17')](socket);function respondWithStatusCode(_0x28364a,_0x228812){_0x228812=_0x228812||0xcc;return function(_0x5e1344){if(_0x5e1344){return _0x28364a['sendStatus'](_0x228812);}return _0x28364a[_0x5860('0x18')](_0x228812)['end']();};}function respondWithResult(_0x371429,_0x3f73bd){_0x3f73bd=_0x3f73bd||0xc8;return function(_0x2acee0){if(_0x2acee0){return _0x371429[_0x5860('0x18')](_0x3f73bd)[_0x5860('0x19')](_0x2acee0);}};}function respondWithFilteredResult(_0x3bcc5d,_0x2e52bb){return function(_0x29296d){if(_0x29296d){var _0x12060d=typeof _0x2e52bb[_0x5860('0x1a')]==='undefined'&&typeof _0x2e52bb[_0x5860('0x1b')]===_0x5860('0x1c');var _0x2c7785=_0x29296d[_0x5860('0x1d')];var _0x229d02=_0x12060d?0x0:_0x2e52bb[_0x5860('0x1a')];var _0x45389b=_0x12060d?_0x29296d[_0x5860('0x1d')]:_0x2e52bb[_0x5860('0x1a')]+_0x2e52bb[_0x5860('0x1b')];var _0x5343c2;if(_0x45389b>=_0x2c7785){_0x45389b=_0x2c7785;_0x5343c2=0xc8;}else{_0x5343c2=0xce;}_0x3bcc5d['status'](_0x5343c2);return _0x3bcc5d['set'](_0x5860('0x1e'),_0x229d02+'-'+_0x45389b+'/'+_0x2c7785)[_0x5860('0x19')](_0x29296d);}return null;};}function patchUpdates(_0x39cc04){return function(_0x4ec3e8){try{jsonpatch['apply'](_0x4ec3e8,_0x39cc04,!![]);}catch(_0x57addf){return BPromise[_0x5860('0x1f')](_0x57addf);}return _0x4ec3e8[_0x5860('0x20')]();};}function saveUpdates(_0x5278ec,_0x219a01){return function(_0x71d62b){if(_0x71d62b){return _0x71d62b[_0x5860('0x21')](_0x5278ec)[_0x5860('0x22')](function(_0x2776d5){return _0x2776d5;});}return null;};}function removeEntity(_0x45ed88,_0x805f29){return function(_0x166032){if(_0x166032){return _0x166032[_0x5860('0x23')]()[_0x5860('0x22')](function(){_0x45ed88[_0x5860('0x18')](0xcc)[_0x5860('0x24')]();});}};}function handleEntityNotFound(_0x5c4347,_0x86856){return function(_0x337b38){if(!_0x337b38){_0x5c4347[_0x5860('0x25')](0x194);}return _0x337b38;};}function handleError(_0x5708a2,_0x4dd939){_0x4dd939=_0x4dd939||0x1f4;return function(_0x7d63f6){logger[_0x5860('0x26')](_0x7d63f6[_0x5860('0x27')]);if(_0x7d63f6[_0x5860('0x28')]){delete _0x7d63f6[_0x5860('0x28')];}_0x5708a2['status'](_0x4dd939)[_0x5860('0x29')](_0x7d63f6);};}exports[_0x5860('0x2a')]=function(_0x37d1c1,_0x470577){var _0x4e1d56={},_0x8c2cb={},_0x355dc6={'count':0x0,'rows':[]};var _0x191e69=_['map'](db[_0x5860('0x2b')][_0x5860('0x2c')],function(_0x408620){return{'name':_0x408620['fieldName'],'type':_0x408620[_0x5860('0x2d')][_0x5860('0x2e')]};});_0x8c2cb[_0x5860('0x2f')]=_[_0x5860('0x30')](_0x191e69,_0x5860('0x28'));_0x8c2cb[_0x5860('0x31')]=_[_0x5860('0x32')](_0x37d1c1[_0x5860('0x31')]);_0x8c2cb[_0x5860('0x33')]=_[_0x5860('0x34')](_0x8c2cb[_0x5860('0x2f')],_0x8c2cb['query']);_0x4e1d56[_0x5860('0x35')]=_[_0x5860('0x34')](_0x8c2cb[_0x5860('0x2f')],qs[_0x5860('0x36')](_0x37d1c1[_0x5860('0x31')]['fields']));_0x4e1d56[_0x5860('0x35')]=_0x4e1d56['attributes'][_0x5860('0x37')]?_0x4e1d56['attributes']:_0x8c2cb['model'];if(!_0x37d1c1[_0x5860('0x31')][_0x5860('0x38')](_0x5860('0x39'))){_0x4e1d56[_0x5860('0x1b')]=qs[_0x5860('0x1b')](_0x37d1c1[_0x5860('0x31')][_0x5860('0x1b')]);_0x4e1d56[_0x5860('0x1a')]=qs['offset'](_0x37d1c1[_0x5860('0x31')][_0x5860('0x1a')]);}_0x4e1d56[_0x5860('0x3a')]=qs[_0x5860('0x3b')](_0x37d1c1[_0x5860('0x31')][_0x5860('0x3b')]);_0x4e1d56['where']=qs[_0x5860('0x33')](_[_0x5860('0x3c')](_0x37d1c1['query'],_0x8c2cb[_0x5860('0x33')]),_0x191e69);if(_0x37d1c1[_0x5860('0x31')][_0x5860('0x3d')]){_0x4e1d56[_0x5860('0x3e')]=_[_0x5860('0x3f')](_0x4e1d56['where'],{'$or':_[_0x5860('0x30')](_0x191e69,function(_0x5ab21f){if(_0x5ab21f[_0x5860('0x2d')]!=='VIRTUAL'){var _0x7d3fc3={};_0x7d3fc3[_0x5ab21f[_0x5860('0x28')]]={'$like':'%'+_0x37d1c1[_0x5860('0x31')]['filter']+'%'};return _0x7d3fc3;}})});}_0x4e1d56=_['merge']({},_0x4e1d56,_0x37d1c1[_0x5860('0x40')]);var _0x278351={'where':_0x4e1d56['where']};return db[_0x5860('0x2b')][_0x5860('0x1d')](_0x278351)['then'](function(_0x219aac){_0x355dc6['count']=_0x219aac;if(_0x37d1c1['query']['includeAll']){_0x4e1d56['include']=[{'all':!![]}];}return db[_0x5860('0x2b')][_0x5860('0x41')](_0x4e1d56);})[_0x5860('0x22')](function(_0x295d56){_0x355dc6[_0x5860('0x42')]=_0x295d56;return _0x355dc6;})[_0x5860('0x22')](respondWithFilteredResult(_0x470577,_0x4e1d56))[_0x5860('0x43')](handleError(_0x470577,null));};exports['show']=function(_0x1796e4,_0x11952b){var _0x251fb2={'raw':!![],'where':{'id':_0x1796e4['params']['id']}},_0x491859={};_0x491859[_0x5860('0x2f')]=_[_0x5860('0x32')](db[_0x5860('0x2b')][_0x5860('0x2c')]);_0x491859['query']=_[_0x5860('0x32')](_0x1796e4[_0x5860('0x31')]);_0x491859[_0x5860('0x33')]=_['intersection'](_0x491859['model'],_0x491859[_0x5860('0x31')]);_0x251fb2['attributes']=_[_0x5860('0x34')](_0x491859[_0x5860('0x2f')],qs[_0x5860('0x36')](_0x1796e4[_0x5860('0x31')][_0x5860('0x36')]));_0x251fb2[_0x5860('0x35')]=_0x251fb2[_0x5860('0x35')][_0x5860('0x37')]?_0x251fb2[_0x5860('0x35')]:_0x491859['model'];if(_0x1796e4[_0x5860('0x31')]['includeAll']){_0x251fb2[_0x5860('0x44')]=[{'all':!![]}];}_0x251fb2=_[_0x5860('0x3f')]({},_0x251fb2,_0x1796e4[_0x5860('0x40')]);return db['ChatGroup'][_0x5860('0x45')](_0x251fb2)['then'](handleEntityNotFound(_0x11952b,null))[_0x5860('0x22')](respondWithResult(_0x11952b,null))['catch'](handleError(_0x11952b,null));};exports['create']=function(_0x755c15,_0x23ec7b){return db[_0x5860('0x2b')][_0x5860('0x46')](_0x755c15['body'],{})[_0x5860('0x22')](respondWithResult(_0x23ec7b,0xc9))[_0x5860('0x43')](handleError(_0x23ec7b,null));};exports['update']=function(_0x20ae5b,_0x3e8910){if(_0x20ae5b[_0x5860('0x47')]['id']){delete _0x20ae5b[_0x5860('0x47')]['id'];}return db[_0x5860('0x2b')]['find']({'where':{'id':_0x20ae5b[_0x5860('0x48')]['id']}})[_0x5860('0x22')](handleEntityNotFound(_0x3e8910,null))[_0x5860('0x22')](saveUpdates(_0x20ae5b['body'],null))[_0x5860('0x22')](respondWithResult(_0x3e8910,null))[_0x5860('0x43')](handleError(_0x3e8910,null));};exports[_0x5860('0x23')]=function(_0x19ad6b,_0x582191){return db['ChatGroup']['find']({'where':{'id':_0x19ad6b[_0x5860('0x48')]['id']}})['then'](handleEntityNotFound(_0x582191,null))['then'](removeEntity(_0x582191,null))[_0x5860('0x43')](handleError(_0x582191,null));};exports[_0x5860('0x49')]=function(_0xa643d1,_0x415975){return db[_0x5860('0x2b')][_0x5860('0x49')]()[_0x5860('0x22')](respondWithResult(_0x415975,null))[_0x5860('0x43')](handleError(_0x415975,null));};exports['getUnread']=function(_0x415f1a,_0x5ebbd1,_0x1ea179){return db[_0x5860('0x4a')]['count']({'where':{'ChatGroupId':_0x415f1a[_0x5860('0x48')]['id'],'ToId':_0x415f1a['user']['id'],'read':![]}})[_0x5860('0x22')](function(_0x2991c0){return{'id':_['toInteger'](_0x415f1a[_0x5860('0x48')]['id']),'count':_0x2991c0};})[_0x5860('0x22')](respondWithResult(_0x5ebbd1,null))[_0x5860('0x43')](handleError(_0x5ebbd1,null));};exports[_0x5860('0x4b')]=function(_0xc46bef,_0x4ed4e6,_0x497c97){return db[_0x5860('0x2b')][_0x5860('0x45')]({'where':{'id':_0xc46bef[_0x5860('0x48')]['id']}})[_0x5860('0x22')](handleEntityNotFound(_0x4ed4e6,null))['then'](function(_0x39282b){if(_0x39282b){return _0x39282b[_0x5860('0x4b')](_0xc46bef[_0x5860('0x47')][_0x5860('0x4c')],_[_0x5860('0x4d')](_0xc46bef['body'],[_0x5860('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x4ed4e6,null))[_0x5860('0x43')](handleError(_0x4ed4e6,null));};exports[_0x5860('0x4e')]=function(_0x5c91ff,_0x321c9b,_0x433ee3){var _0x277d61={};var _0x457366={};var _0x19a366;var _0x371f51;return db[_0x5860('0x2b')][_0x5860('0x4f')]({'where':{'id':_0x5c91ff[_0x5860('0x48')]['id']}})['then'](handleEntityNotFound(_0x321c9b,null))[_0x5860('0x22')](function(_0x328bb5){if(_0x328bb5){_0x19a366=_0x328bb5;_0x457366[_0x5860('0x2f')]=_['keys'](db[_0x5860('0x50')]['rawAttributes']);_0x457366[_0x5860('0x31')]=_[_0x5860('0x32')](_0x5c91ff['query']);_0x457366[_0x5860('0x33')]=_[_0x5860('0x34')](_0x457366['model'],_0x457366[_0x5860('0x31')]);_0x277d61['attributes']=_[_0x5860('0x34')](_0x457366[_0x5860('0x2f')],qs['fields'](_0x5c91ff['query'][_0x5860('0x36')]));_0x277d61[_0x5860('0x35')]=_0x277d61[_0x5860('0x35')]['length']?_0x277d61[_0x5860('0x35')]:_0x457366[_0x5860('0x2f')];_0x277d61[_0x5860('0x3a')]=qs['sort'](_0x5c91ff[_0x5860('0x31')]['sort']);_0x277d61[_0x5860('0x3e')]=qs['filters'](_[_0x5860('0x3c')](_0x5c91ff[_0x5860('0x31')],_0x457366[_0x5860('0x33')]));if(_0x5c91ff[_0x5860('0x31')]['filter']){_0x277d61['where']=_['merge'](_0x277d61['where'],{'$or':_['map'](_0x277d61[_0x5860('0x35')],function(_0x52c035){var _0x387b69={};_0x387b69[_0x52c035]={'$like':'%'+_0x5c91ff[_0x5860('0x31')][_0x5860('0x3d')]+'%'};return _0x387b69;})});}_0x277d61=_[_0x5860('0x3f')]({},_0x277d61,_0x5c91ff['options']);return _0x19a366['getMembers'](_0x277d61);}})['then'](function(_0x72abf6){if(_0x72abf6){_0x371f51=_0x72abf6[_0x5860('0x37')];if(!_0x5c91ff[_0x5860('0x31')]['hasOwnProperty']('nolimit')){_0x277d61[_0x5860('0x1b')]=qs[_0x5860('0x1b')](_0x5c91ff[_0x5860('0x31')][_0x5860('0x1b')]);_0x277d61['offset']=qs['offset'](_0x5c91ff[_0x5860('0x31')][_0x5860('0x1a')]);}return _0x19a366[_0x5860('0x4e')](_0x277d61);}})['then'](function(_0x54b26e){if(_0x54b26e){return _0x54b26e?{'count':_0x371f51,'rows':_0x54b26e}:null;}})[_0x5860('0x22')](respondWithResult(_0x321c9b,null))[_0x5860('0x43')](handleError(_0x321c9b,null));};exports[_0x5860('0x51')]=function(_0x1c2ef3,_0x143cb3,_0x4e7bd1){return db[_0x5860('0x2b')][_0x5860('0x45')]({'where':{'id':_0x1c2ef3[_0x5860('0x48')]['id']}})['then'](handleEntityNotFound(_0x143cb3,null))[_0x5860('0x22')](function(_0x3e5822){if(_0x3e5822){return _0x3e5822['removeMembers'](_0x1c2ef3[_0x5860('0x31')]['ids']);}})[_0x5860('0x22')](respondWithStatusCode(_0x143cb3,null))[_0x5860('0x43')](handleError(_0x143cb3,null));};exports['addMessage']=function(_0x857ec9,_0xbfabca,_0x317e83){if(_0x857ec9[_0x5860('0x47')]['id']){delete _0x857ec9[_0x5860('0x47')]['id'];}return db[_0x5860('0x2b')][_0x5860('0x45')]({'where':{'id':_0x857ec9['params']['id']}})['then'](handleEntityNotFound(_0xbfabca,null))[_0x5860('0x22')](function(_0x10a748){if(_0x10a748){_0x857ec9[_0x5860('0x47')][_0x5860('0x52')]=_0x10a748['id'];return db[_0x5860('0x4a')][_0x5860('0x46')](_0x857ec9[_0x5860('0x47')]);}})[_0x5860('0x22')](respondWithResult(_0xbfabca,null))['catch'](handleError(_0xbfabca,null));};exports[_0x5860('0x53')]=function(_0x24630d,_0x1bbf15,_0x154127){var _0x3a226b={};var _0x436654={};var _0x4a3a00;var _0x537fd6;return db[_0x5860('0x2b')][_0x5860('0x4f')]({'where':{'id':_0x24630d[_0x5860('0x48')]['id']}})[_0x5860('0x22')](handleEntityNotFound(_0x1bbf15,null))['then'](function(_0x560e59){if(_0x560e59){_0x4a3a00=_0x560e59;_0x436654['model']=_[_0x5860('0x32')](db[_0x5860('0x4a')]['rawAttributes']);_0x436654[_0x5860('0x31')]=_[_0x5860('0x32')](_0x24630d[_0x5860('0x31')]);_0x436654[_0x5860('0x33')]=_[_0x5860('0x34')](_0x436654[_0x5860('0x2f')],_0x436654[_0x5860('0x31')]);_0x3a226b['attributes']=_['intersection'](_0x436654['model'],qs[_0x5860('0x36')](_0x24630d['query'][_0x5860('0x36')]));_0x3a226b[_0x5860('0x35')]=_0x3a226b[_0x5860('0x35')]['length']?_0x3a226b[_0x5860('0x35')]:_0x436654[_0x5860('0x2f')];_0x3a226b[_0x5860('0x3a')]=qs['sort'](_0x24630d['query']['sort']);_0x3a226b[_0x5860('0x3e')]=qs['filters'](_[_0x5860('0x3c')](_0x24630d[_0x5860('0x31')],_0x436654['filters']));if(_0x24630d['query'][_0x5860('0x3d')]){_0x3a226b[_0x5860('0x3e')]=_[_0x5860('0x3f')](_0x3a226b['where'],{'$or':_[_0x5860('0x30')](_0x3a226b[_0x5860('0x35')],function(_0x1a8b43){var _0x571d3a={};_0x571d3a[_0x1a8b43]={'$like':'%'+_0x24630d[_0x5860('0x31')][_0x5860('0x3d')]+'%'};return _0x571d3a;})});}if(_0x24630d[_0x5860('0x31')][_0x5860('0x54')]){var _0x3d0ddc=_0x24630d[_0x5860('0x31')][_0x5860('0x54')][_0x5860('0x55')](',');var _0x5d1f6d={};_0x5d1f6d[_0x3d0ddc[0x0]]={'$gte':moment(_0x3d0ddc[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3a226b[_0x5860('0x3e')]=_[_0x5860('0x3f')](_0x3a226b[_0x5860('0x3e')],_0x5d1f6d);}_0x3a226b=_['merge']({},_0x3a226b,_0x24630d[_0x5860('0x40')]);return _0x4a3a00[_0x5860('0x53')](_0x3a226b);}})[_0x5860('0x22')](function(_0x590275){if(_0x590275){_0x537fd6=_0x590275[_0x5860('0x37')];if(!_0x24630d[_0x5860('0x31')]['hasOwnProperty'](_0x5860('0x39'))){_0x3a226b[_0x5860('0x1b')]=qs['limit'](_0x24630d[_0x5860('0x31')]['limit']);_0x3a226b[_0x5860('0x1a')]=qs[_0x5860('0x1a')](_0x24630d[_0x5860('0x31')][_0x5860('0x1a')]);}return _0x4a3a00[_0x5860('0x53')](_0x3a226b);}})[_0x5860('0x22')](function(_0x534b73){if(_0x534b73){return _0x534b73?{'count':_0x537fd6,'rows':_0x534b73}:null;}})[_0x5860('0x22')](respondWithResult(_0x1bbf15,null))[_0x5860('0x43')](handleError(_0x1bbf15,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index fd27fa0..a282f3d 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 _0xb271=['hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x47c618,_0x1af968){var _0x143657=function(_0xdded10){while(--_0xdded10){_0x47c618['push'](_0x47c618['shift']());}};_0x143657(++_0x1af968);}(_0xb271,0xf6));var _0x1b27=function(_0x1ea7a1,_0x3259eb){_0x1ea7a1=_0x1ea7a1-0x0;var _0x3e30dd=_0xb271[_0x1ea7a1];return _0x3e30dd;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x1b27('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1b27('0x1')](0x0);var events={'afterCreate':_0x1b27('0x2'),'afterUpdate':_0x1b27('0x3'),'afterDestroy':_0x1b27('0x4')};function emitEvent(_0x392edf){return function(_0x56e6c3,_0x4d8d2c,_0x1d5d22){ChatGroupEvents[_0x1b27('0x5')](_0x392edf+':'+_0x56e6c3['id'],_0x56e6c3);ChatGroupEvents[_0x1b27('0x5')](_0x392edf,_0x56e6c3);_0x1d5d22(null);};}for(var e in events){if(events[_0x1b27('0x6')](e)){var event=events[e];ChatGroup[_0x1b27('0x7')](e,emitEvent(event));}}module[_0x1b27('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xfc4f=['save','update','remove','emit','hook','exports','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0xfc4f,0x192));var _0xffc4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xfc4f[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xffc4('0x0'))['db'][_0xffc4('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xffc4('0x2')](0x0);var events={'afterCreate':_0xffc4('0x3'),'afterUpdate':_0xffc4('0x4'),'afterDestroy':_0xffc4('0x5')};function emitEvent(_0x27bcf3){return function(_0x5943be,_0x289659,_0x211cfa){ChatGroupEvents[_0xffc4('0x6')](_0x27bcf3+':'+_0x5943be['id'],_0x5943be);ChatGroupEvents[_0xffc4('0x6')](_0x27bcf3,_0x5943be);_0x211cfa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xffc4('0x7')](e,emitEvent(event));}}module[_0xffc4('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index a8ec2a6..6f84e04 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 _0x1aaf=['bluebird','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','api','moment'];(function(_0x216008,_0x2d1023){var _0x4d384f=function(_0x3fd7e2){while(--_0x3fd7e2){_0x216008['push'](_0x216008['shift']());}};_0x4d384f(++_0x2d1023);}(_0x1aaf,0x11c));var _0xf1aa=function(_0x496b50,_0x2d033c){_0x496b50=_0x496b50-0x0;var _0x418ae4=_0x1aaf[_0x496b50];return _0x418ae4;};'use strict';var _=require(_0xf1aa('0x0'));var util=require(_0xf1aa('0x1'));var logger=require('../../config/logger')(_0xf1aa('0x2'));var moment=require(_0xf1aa('0x3'));var BPromise=require(_0xf1aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1aa('0x5'));var rimraf=require(_0xf1aa('0x6'));var config=require('../../config/environment');var attributes=require(_0xf1aa('0x7'));module[_0xf1aa('0x8')]=function(_0x1708aa,_0x299316){return _0x1708aa[_0xf1aa('0x9')](_0xf1aa('0xa'),attributes,{'tableName':_0xf1aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bf5=['moment','bluebird','path','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','api'];(function(_0x2cb14c,_0x1c5bb2){var _0x470a41=function(_0x29a43b){while(--_0x29a43b){_0x2cb14c['push'](_0x2cb14c['shift']());}};_0x470a41(++_0x1c5bb2);}(_0x2bf5,0xe4));var _0x52bf=function(_0x32409e,_0x1a54bf){_0x32409e=_0x32409e-0x0;var _0x220390=_0x2bf5[_0x32409e];return _0x220390;};'use strict';var _=require('lodash');var util=require(_0x52bf('0x0'));var logger=require(_0x52bf('0x1'))(_0x52bf('0x2'));var moment=require(_0x52bf('0x3'));var BPromise=require(_0x52bf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52bf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x52bf('0x6'));module[_0x52bf('0x7')]=function(_0x434e57,_0x2e16dc){return _0x434e57[_0x52bf('0x8')](_0x52bf('0x9'),attributes,{'tableName':_0x52bf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index b90592e..a39b5ae 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 _0x7531=['catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x287693,_0x7cbe79){var _0x404a95=function(_0x2b0d0a){while(--_0x2b0d0a){_0x287693['push'](_0x287693['shift']());}};_0x404a95(++_0x7cbe79);}(_0x7531,0x69));var _0x1753=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7531[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1753('0x0'));var util=require(_0x1753('0x1'));var moment=require(_0x1753('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1753('0x3'))['db'];var utils=require(_0x1753('0x4'));var logger=require('../../config/logger')(_0x1753('0x5'));var config=require(_0x1753('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1753('0x7')][_0x1753('0x8')]({'port':0x232a});config[_0x1753('0x9')]=_[_0x1753('0xa')](config[_0x1753('0x9')],{'host':_0x1753('0xb'),'port':0x18eb});var socket=require(_0x1753('0xc'))(new Redis(config['redis']));require(_0x1753('0xd'))[_0x1753('0xe')](socket);function respondWithRpcPromise(_0x45e6a1,_0x22c360,_0xe67769){return new BPromise(function(_0x13ea00,_0x5697e8){return client['request'](_0x45e6a1,_0xe67769)[_0x1753('0xf')](function(_0x22a91a){logger[_0x1753('0x10')](_0x1753('0x11'),_0x22c360,_0x1753('0x12'));logger[_0x1753('0x13')](_0x1753('0x14'),_0x22c360,_0x1753('0x12'),JSON[_0x1753('0x15')](_0x22a91a));if(_0x22a91a['error']){if(_0x22a91a[_0x1753('0x16')]['code']===0x1f4){logger['error'](_0x1753('0x11'),_0x22c360,_0x22a91a[_0x1753('0x16')][_0x1753('0x17')]);return _0x5697e8(_0x22a91a['error'][_0x1753('0x17')]);}logger[_0x1753('0x16')](_0x1753('0x11'),_0x22c360,_0x22a91a[_0x1753('0x16')][_0x1753('0x17')]);return _0x13ea00(_0x22a91a[_0x1753('0x16')][_0x1753('0x17')]);}else{logger[_0x1753('0x10')](_0x1753('0x11'),_0x22c360,_0x1753('0x12'));_0x13ea00(_0x22a91a[_0x1753('0x18')][_0x1753('0x17')]);}})[_0x1753('0x19')](function(_0x28bd8c){logger['error'](_0x1753('0x11'),_0x22c360,_0x28bd8c);_0x5697e8(_0x28bd8c);});});} \ No newline at end of file +var _0x4737=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then'];(function(_0xe9c58a,_0x12efc5){var _0x4e4b8c=function(_0x3fe77e){while(--_0x3fe77e){_0xe9c58a['push'](_0xe9c58a['shift']());}};_0x4e4b8c(++_0x12efc5);}(_0x4737,0x141));var _0x7473=function(_0x31f2c0,_0x2e485d){_0x31f2c0=_0x31f2c0-0x0;var _0x3d173e=_0x4737[_0x31f2c0];return _0x3d173e;};'use strict';var _=require(_0x7473('0x0'));var util=require(_0x7473('0x1'));var moment=require(_0x7473('0x2'));var BPromise=require(_0x7473('0x3'));var rs=require(_0x7473('0x4'));var fs=require('fs');var Redis=require(_0x7473('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7473('0x6'))('rpc');var config=require(_0x7473('0x7'));var jayson=require(_0x7473('0x8'));var client=jayson[_0x7473('0x9')]['http']({'port':0x232a});config[_0x7473('0xa')]=_[_0x7473('0xb')](config['redis'],{'host':_0x7473('0xc'),'port':0x18eb});var socket=require(_0x7473('0xd'))(new Redis(config[_0x7473('0xa')]));require(_0x7473('0xe'))[_0x7473('0xf')](socket);function respondWithRpcPromise(_0x40dbd4,_0x4f996d,_0x52f315){return new BPromise(function(_0x11fb0a,_0x54afcf){return client['request'](_0x40dbd4,_0x52f315)[_0x7473('0x10')](function(_0x1c4683){logger[_0x7473('0x11')](_0x7473('0x12'),_0x4f996d,_0x7473('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4f996d,_0x7473('0x13'),JSON[_0x7473('0x14')](_0x1c4683));if(_0x1c4683[_0x7473('0x15')]){if(_0x1c4683[_0x7473('0x15')][_0x7473('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4f996d,_0x1c4683['error']['message']);return _0x54afcf(_0x1c4683[_0x7473('0x15')]['message']);}logger[_0x7473('0x15')](_0x7473('0x12'),_0x4f996d,_0x1c4683[_0x7473('0x15')]['message']);return _0x11fb0a(_0x1c4683[_0x7473('0x15')][_0x7473('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x4f996d,_0x7473('0x13'));_0x11fb0a(_0x1c4683[_0x7473('0x18')]['message']);}})[_0x7473('0x19')](function(_0x48cc91){logger[_0x7473('0x15')]('ChatGroup,\x20%s,\x20%s',_0x4f996d,_0x48cc91);_0x54afcf(_0x48cc91);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 2daddc9..d4bb746 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 _0xebee=['length','chatGroup:','./chatGroup.events','save','remove','emit','register'];(function(_0x5bd7a3,_0x5899b1){var _0x29e95b=function(_0x2ba879){while(--_0x2ba879){_0x5bd7a3['push'](_0x5bd7a3['shift']());}};_0x29e95b(++_0x5899b1);}(_0xebee,0x19f));var _0xeebe=function(_0x57bf6c,_0x7b6f54){_0x57bf6c=_0x57bf6c-0x0;var _0x100831=_0xebee[_0x57bf6c];return _0x100831;};'use strict';var ChatGroupEvents=require(_0xeebe('0x0'));var events=[_0xeebe('0x1'),_0xeebe('0x2'),'update'];function createListener(_0x1b8251,_0x4d02a9){return function(_0xaaf982){_0x4d02a9[_0xeebe('0x3')](_0x1b8251,_0xaaf982);};}function removeListener(_0x2b741b,_0x4e8fc9){return function(){ChatGroupEvents['removeListener'](_0x2b741b,_0x4e8fc9);};}exports[_0xeebe('0x4')]=function(_0x5640ca){for(var _0x10d3d4=0x0,_0x1b4531=events[_0xeebe('0x5')];_0x10d3d4<_0x1b4531;_0x10d3d4++){var _0x27a0b2=events[_0x10d3d4];var _0x159e85=createListener(_0xeebe('0x6')+_0x27a0b2,_0x5640ca);ChatGroupEvents['on'](_0x27a0b2,_0x159e85);}}; \ No newline at end of file +var _0x3298=['register','length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0xf051df,_0xe76946){var _0x331fca=function(_0x30929d){while(--_0x30929d){_0xf051df['push'](_0xf051df['shift']());}};_0x331fca(++_0xe76946);}(_0x3298,0x173));var _0x8329=function(_0x3455b1,_0x273b1f){_0x3455b1=_0x3455b1-0x0;var _0x2c1cd6=_0x3298[_0x3455b1];return _0x2c1cd6;};'use strict';var ChatGroupEvents=require(_0x8329('0x0'));var events=[_0x8329('0x1'),_0x8329('0x2'),'update'];function createListener(_0x4db992,_0xe787ca){return function(_0x48b6b3){_0xe787ca[_0x8329('0x3')](_0x4db992,_0x48b6b3);};}function removeListener(_0x533589,_0x5711b7){return function(){ChatGroupEvents[_0x8329('0x4')](_0x533589,_0x5711b7);};}exports[_0x8329('0x5')]=function(_0x2146f4){for(var _0x606831=0x0,_0x46e67f=events[_0x8329('0x6')];_0x606831<_0x46e67f;_0x606831++){var _0x2735d7=events[_0x606831];var _0x4ae7f5=createListener(_0x8329('0x7')+_0x2735d7,_0x2146f4);ChatGroupEvents['on'](_0x2735d7,_0x4ae7f5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 85171a3..86ad512 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 _0x4401=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x151602,_0x5cc3b0){var _0xb2820a=function(_0x3d09a2){while(--_0x3d09a2){_0x151602['push'](_0x151602['shift']());}};_0xb2820a(++_0x5cc3b0);}(_0x4401,0x9f));var _0x1440=function(_0x4c3d60,_0x4a09ef){_0x4c3d60=_0x4c3d60-0x0;var _0xed5711=_0x4401[_0x4c3d60];return _0xed5711;};'use strict';var multer=require(_0x1440('0x0'));var util=require('util');var path=require(_0x1440('0x1'));var timeout=require(_0x1440('0x2'));var express=require(_0x1440('0x3'));var router=express['Router']();var fs_extra=require(_0x1440('0x4'));var auth=require(_0x1440('0x5'));var interaction=require(_0x1440('0x6'));var config=require(_0x1440('0x7'));var controller=require('./chatGroup.controller');router[_0x1440('0x8')]('/',auth[_0x1440('0x9')](),controller[_0x1440('0xa')]);router[_0x1440('0x8')](_0x1440('0xb'),auth[_0x1440('0x9')](),controller[_0x1440('0xc')]);router[_0x1440('0x8')]('/:id',auth[_0x1440('0x9')](),controller['show']);router[_0x1440('0x8')](_0x1440('0xd'),auth[_0x1440('0x9')](),controller[_0x1440('0xe')]);router['get'](_0x1440('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x1440('0x8')](_0x1440('0x10'),auth[_0x1440('0x9')](),controller[_0x1440('0x11')]);router['post']('/',auth[_0x1440('0x9')](),controller[_0x1440('0x12')]);router[_0x1440('0x13')](_0x1440('0xf'),auth[_0x1440('0x9')](),controller[_0x1440('0x14')]);router[_0x1440('0x13')](_0x1440('0x10'),auth[_0x1440('0x9')](),controller[_0x1440('0x15')]);router[_0x1440('0x16')]('/:id',auth[_0x1440('0x9')](),controller['update']);router[_0x1440('0x17')](_0x1440('0x18'),auth[_0x1440('0x9')](),controller[_0x1440('0x19')]);router['delete'](_0x1440('0xf'),auth[_0x1440('0x9')](),controller['removeMembers']);module[_0x1440('0x1a')]=router; \ No newline at end of file +var _0xf92b=['/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x17c4e9,_0x181765){var _0x5941e0=function(_0x52f379){while(--_0x52f379){_0x17c4e9['push'](_0x17c4e9['shift']());}};_0x5941e0(++_0x181765);}(_0xf92b,0x165));var _0xbf92=function(_0x513d68,_0x5af32b){_0x513d68=_0x513d68-0x0;var _0x3df1e3=_0xf92b[_0x513d68];return _0x3df1e3;};'use strict';var multer=require(_0xbf92('0x0'));var util=require(_0xbf92('0x1'));var path=require(_0xbf92('0x2'));var timeout=require(_0xbf92('0x3'));var express=require(_0xbf92('0x4'));var router=express[_0xbf92('0x5')]();var fs_extra=require(_0xbf92('0x6'));var auth=require(_0xbf92('0x7'));var interaction=require(_0xbf92('0x8'));var config=require('../../config/environment');var controller=require(_0xbf92('0x9'));router['get']('/',auth[_0xbf92('0xa')](),controller[_0xbf92('0xb')]);router[_0xbf92('0xc')](_0xbf92('0xd'),auth[_0xbf92('0xa')](),controller[_0xbf92('0xe')]);router['get'](_0xbf92('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0xbf92('0x10'),auth['isAuthenticated'](),controller[_0xbf92('0x11')]);router[_0xbf92('0xc')](_0xbf92('0x12'),auth[_0xbf92('0xa')](),controller[_0xbf92('0x13')]);router['get'](_0xbf92('0x14'),auth['isAuthenticated'](),controller[_0xbf92('0x15')]);router[_0xbf92('0x16')]('/',auth['isAuthenticated'](),controller[_0xbf92('0x17')]);router[_0xbf92('0x16')](_0xbf92('0x12'),auth[_0xbf92('0xa')](),controller[_0xbf92('0x18')]);router[_0xbf92('0x16')]('/:id/messages',auth['isAuthenticated'](),controller[_0xbf92('0x19')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xbf92('0x1a')]);router[_0xbf92('0x1b')](_0xbf92('0xf'),auth[_0xbf92('0xa')](),controller[_0xbf92('0x1c')]);router[_0xbf92('0x1b')]('/:id/members',auth[_0xbf92('0xa')](),controller[_0xbf92('0x1d')]);module[_0xbf92('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index a846771..875aa64 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 _0x1d21=['DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING'];(function(_0x146f1c,_0x24cf0c){var _0x200166=function(_0x25b1bd){while(--_0x25b1bd){_0x146f1c['push'](_0x146f1c['shift']());}};_0x200166(++_0x24cf0c);}(_0x1d21,0x158));var _0x11d2=function(_0x482393,_0x355061){_0x482393=_0x482393-0x0;var _0x4c07ae=_0x1d21[_0x482393];return _0x4c07ae;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'closed':{'type':Sequelize[_0x11d2('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x11d2('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x11d2('0x4'),_0x11d2('0x5')),'defaultValue':_0x11d2('0x4')},'ratingMessage':{'type':Sequelize[_0x11d2('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x11d2('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x11d2('0x8')]},'disposition':{'type':Sequelize[_0x11d2('0x7')]},'secondDisposition':{'type':Sequelize[_0x11d2('0x7')]},'thirdDisposition':{'type':Sequelize[_0x11d2('0x7')]},'note':{'type':Sequelize[_0x11d2('0x7')]},'browserName':{'type':Sequelize[_0x11d2('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x11d2('0x7')]},'osVersion':{'type':Sequelize[_0x11d2('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x11d2('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x11d2('0x6')]},'customerIp':{'type':Sequelize[_0x11d2('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x11d2('0x9'))},'read1stAt':{'type':Sequelize[_0x11d2('0x8')]},'lastMsgAt':{'type':Sequelize[_0x11d2('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x11d2('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x11d2('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x11d2('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x11d2('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf6e8=['STRING','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x5b87aa,_0x385e12){var _0x484f45=function(_0x1d8c0f){while(--_0x1d8c0f){_0x5b87aa['push'](_0x5b87aa['shift']());}};_0x484f45(++_0x385e12);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x521449,_0x39fb84){_0x521449=_0x521449-0x0;var _0x1e1c06=_0xf6e8[_0x521449];return _0x1e1c06;};'use strict';var Sequelize=require('sequelize');module[_0x8f6e('0x0')]={'closed':{'type':Sequelize[_0x8f6e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8f6e('0x2')]},'ratingType':{'type':Sequelize[_0x8f6e('0x3')](_0x8f6e('0x4'),_0x8f6e('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8f6e('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8f6e('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8f6e('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8f6e('0x7')]},'thirdDisposition':{'type':Sequelize[_0x8f6e('0x7')]},'note':{'type':Sequelize[_0x8f6e('0x7')]},'browserName':{'type':Sequelize[_0x8f6e('0x7')]},'browserVersion':{'type':Sequelize[_0x8f6e('0x7')]},'osName':{'type':Sequelize[_0x8f6e('0x7')]},'osVersion':{'type':Sequelize[_0x8f6e('0x7')]},'deviceModel':{'type':Sequelize[_0x8f6e('0x7')]},'deviceVendor':{'type':Sequelize[_0x8f6e('0x7')]},'deviceType':{'type':Sequelize[_0x8f6e('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x8f6e('0x7')]},'formData':{'type':Sequelize[_0x8f6e('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x8f6e('0x8')]},'lastMsgAt':{'type':Sequelize[_0x8f6e('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x8f6e('0x3')]('in',_0x8f6e('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8f6e('0x7')]},'customerPort':{'type':Sequelize[_0x8f6e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x8f6e('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x8f6e('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f23cc01..4163de2 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 _0xd64b=['`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','includeAll','include','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooMetadata','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','System','Visitor','agentIdentifier','%s%d','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','sort','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Owner','Chat','Account','closedAt','browserName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','request-promise','bluebird','mustache','util','path','ejs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','send','render','body','contact','agent','interaction','account','Users','map','fullname','TagIds','forEach','Tags','push','answered','total','closed','UserId','waiting','talking','disposition','abandoned','unmanaged','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','select','field','name','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having'];(function(_0x567fff,_0xd8acd8){var _0x465a37=function(_0x9d7bf7){while(--_0x9d7bf7){_0x567fff['push'](_0x567fff['shift']());}};_0x465a37(++_0xd8acd8);}(_0xd64b,0xc1));var _0xbd64=function(_0x5560f6,_0x225f9c){_0x5560f6=_0x5560f6-0x0;var _0x25d4ef=_0xd64b[_0x5560f6];return _0x25d4ef;};'use strict';var rimraf=require(_0xbd64('0x0'));var zipdir=require('zip-dir');var rp=require(_0xbd64('0x1'));var moment=require('moment');var BPromise=require(_0xbd64('0x2'));var Mustache=require(_0xbd64('0x3'));var util=require(_0xbd64('0x4'));var path=require(_0xbd64('0x5'));var ejs=require(_0xbd64('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xbd64('0x7'));var pdf=require(_0xbd64('0x8'));var logger=require(_0xbd64('0x9'))(_0xbd64('0xa'));var config=require(_0xbd64('0xb'));var db=require(_0xbd64('0xc'))['db'];config[_0xbd64('0xd')]=_['defaults'](config['redis'],{'host':_0xbd64('0xe'),'port':0x18eb});var socket=require(_0xbd64('0xf'))(new Redis(config[_0xbd64('0xd')]));require('./chatInteraction.socket')[_0xbd64('0x10')](socket);var jayson=require(_0xbd64('0x11'));var client=jayson[_0xbd64('0x12')][_0xbd64('0x13')]({'port':0x232b});var client9004=jayson['client'][_0xbd64('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5f2adf,_0x136f60,_0x2729d8,_0x3a941c){return new BPromise(function(_0x2183e2,_0x367824){var _0x27438c=_0x3a941c||client;return _0x27438c[_0xbd64('0x14')](_0x5f2adf,_0x2729d8)[_0xbd64('0x15')](function(_0x2b5808){logger['info'](_0xbd64('0x16'),_0x136f60,_0xbd64('0x17'));logger[_0xbd64('0x18')](_0xbd64('0x19'),_0x136f60,_0xbd64('0x17'),JSON['stringify'](_0x2b5808));if(_0x2b5808[_0xbd64('0x1a')]){if(_0x2b5808['error'][_0xbd64('0x1b')]===0x1f4){logger[_0xbd64('0x1a')](_0xbd64('0x16'),_0x136f60,_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);return _0x367824(_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);}logger[_0xbd64('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x136f60,_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);return _0x2183e2(_0x2b5808['error']['message']);}else{logger[_0xbd64('0x1d')](_0xbd64('0x16'),_0x136f60,_0xbd64('0x17'));_0x2183e2(_0x2b5808[_0xbd64('0x1e')][_0xbd64('0x1c')]);}})[_0xbd64('0x1f')](function(_0x5dc2bd){logger['error'](_0xbd64('0x16'),_0x136f60,_0x5dc2bd);_0x367824(_0x5dc2bd);});});}function respondWithStatusCode(_0x41f2f,_0x12f67b){_0x12f67b=_0x12f67b||0xcc;return function(_0x365d88){if(_0x365d88){return _0x41f2f['sendStatus'](_0x12f67b);}return _0x41f2f['status'](_0x12f67b)[_0xbd64('0x20')]();};}function respondWithResult(_0x4afaff,_0x46ab38){_0x46ab38=_0x46ab38||0xc8;return function(_0x5b356b){if(_0x5b356b){return _0x4afaff[_0xbd64('0x21')](_0x46ab38)[_0xbd64('0x22')](_0x5b356b);}};}function respondWithFilteredResult(_0x3d12a0,_0x2d0993){return function(_0x5ae417){if(_0x5ae417){var _0x9d0fb8=typeof _0x2d0993[_0xbd64('0x23')]===_0xbd64('0x24')&&typeof _0x2d0993[_0xbd64('0x25')]==='undefined';var _0x4e8719=_0x5ae417[_0xbd64('0x26')];var _0x49eac5=_0x9d0fb8?0x0:_0x2d0993['offset'];var _0xfa918=_0x9d0fb8?_0x5ae417['count']:_0x2d0993[_0xbd64('0x23')]+_0x2d0993['limit'];var _0x28199c;if(_0xfa918>=_0x4e8719){_0xfa918=_0x4e8719;_0x28199c=0xc8;}else{_0x28199c=0xce;}_0x3d12a0['status'](_0x28199c);return _0x3d12a0[_0xbd64('0x27')](_0xbd64('0x28'),_0x49eac5+'-'+_0xfa918+'/'+_0x4e8719)[_0xbd64('0x22')](_0x5ae417);}return null;};}function saveUpdates(_0x210fff){return function(_0x306f19){if(_0x306f19){return _0x306f19[_0xbd64('0x29')](_0x210fff)['then'](function(_0x35bdd5){return _0x35bdd5;});}return null;};}function removeEntity(_0xe876c9){return function(_0xc44280){if(_0xc44280){return _0xc44280[_0xbd64('0x2a')]()[_0xbd64('0x15')](function(){_0xe876c9[_0xbd64('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5961){return function(_0x1e4593){if(!_0x1e4593){_0x4c5961['sendStatus'](0x194);}return _0x1e4593;};}function handleError(_0xebed78,_0x3bce1b){_0x3bce1b=_0x3bce1b||0x1f4;return function(_0x54459f){logger['error'](_0x54459f[_0xbd64('0x2b')]);if(_0x54459f['name']){delete _0x54459f['name'];}_0xebed78[_0xbd64('0x21')](_0x3bce1b)[_0xbd64('0x2c')](_0x54459f);};}function getMustacheRender(_0x192ca3,_0x50c58e){return Mustache[_0xbd64('0x2d')](_0x192ca3,_['merge'](_0x50c58e[_0xbd64('0x2e')],{'contact':_0x50c58e[_0xbd64('0x2f')],'message':_0x50c58e[_0xbd64('0x1c')],'agent':_0x50c58e[_0xbd64('0x30')],'interaction':_0x50c58e[_0xbd64('0x31')],'account':_0x50c58e[_0xbd64('0x32')]}))||'';}function getInteractionUsers(_0x513339,_0x4d870e){return new BPromise(function(_0x1a3c0f,_0x2be110){try{if(_0x4d870e[_0x513339['id']]){_0x513339[_0xbd64('0x33')]=_[_0xbd64('0x34')](_0x4d870e[_0x513339['id']],function(_0x5cf522){return{'id':_0x5cf522['id'],'fullname':_0x5cf522[_0xbd64('0x35')]};});}}catch(_0x54784f){_0x2be110(_0x54784f);}_0x1a3c0f(_0x513339);});}function getInteractionTags(_0x5a74a9,_0x1db1fa){return new BPromise(function(_0x1bcd4c,_0x21f518){try{if(_0x5a74a9['TagIds']){_0x5a74a9['Tags']=[];_0x5a74a9[_0xbd64('0x36')]['split'](',')[_0xbd64('0x37')](function(_0x4e1f11){_0x5a74a9[_0xbd64('0x38')][_0xbd64('0x39')](_0x1db1fa[_0x4e1f11]);});}delete _0x5a74a9['TagIds'];}catch(_0x107da1){_0x21f518(_0x107da1);}_0x1bcd4c(_0x5a74a9);});}function updateChatInteraction(_0x51ae42,_0x534091,_0x380f32){return new BPromise(function(_0x195d89,_0x252fc4){return getInteractionUsers(_0x51ae42,_0x380f32)['then'](function(_0x540e2a){return getInteractionTags(_0x540e2a,_0x534091);})['then'](function(_0x344d46){return getStateInteraction(_0x344d46);})[_0xbd64('0x15')](function(_0x51d54b){_0x195d89(_0x51d54b);})[_0xbd64('0x1f')](function(_0x34b19a){_0x252fc4(_0x34b19a);});});}function getStateInteraction(_0x19832c){return new BPromise(function(_0x27fd12){_0x19832c['waiting']=0x0;_0x19832c['talking']=0x0;_0x19832c[_0xbd64('0x3a')]=0x0;_0x19832c['unmanaged']=0x0;_0x19832c['abandoned']=0x0;_0x19832c[_0xbd64('0x3b')]=0x0;if(!_0x19832c[_0xbd64('0x3c')]&&!_0x19832c[_0xbd64('0x3d')]){_0x19832c[_0xbd64('0x3e')]+=0x1;}if(!_0x19832c[_0xbd64('0x3c')]&&_0x19832c[_0xbd64('0x3d')]){_0x19832c[_0xbd64('0x3f')]+=0x1;if(_0x19832c[_0xbd64('0x3e')]){_0x19832c['waiting']-=0x1;}}if(_0x19832c[_0xbd64('0x3c')]&&_0x19832c[_0xbd64('0x40')]==='abandoned'){_0x19832c[_0xbd64('0x41')]+=0x1;if(_0x19832c[_0xbd64('0x3e')]){_0x19832c[_0xbd64('0x3e')]-=0x1;}}else if(_0x19832c[_0xbd64('0x3c')]&&!_0x19832c[_0xbd64('0x3d')]&&_0x19832c[_0xbd64('0x40')]){_0x19832c[_0xbd64('0x42')]+=0x1;if(_0x19832c['waiting']){_0x19832c[_0xbd64('0x3e')]-=0x1;}}else if(_0x19832c['closed']&&_0x19832c[_0xbd64('0x3d')]){_0x19832c['answered']+=0x1;if(_0x19832c[_0xbd64('0x3f')]){_0x19832c[_0xbd64('0x3f')]-=0x1;}}_0x19832c[_0xbd64('0x3b')]+=0x1;_0x27fd12(_0x19832c);});}exports['index']=function(_0x23bf21,_0x495522){var _0x526705={},_0x553fa0={},_0x3304b7={'count':0x0,'rows':[]};var _0x2abe23=_[_0xbd64('0x34')](db[_0xbd64('0x43')][_0xbd64('0x44')],function(_0x3079b6){return{'name':_0x3079b6[_0xbd64('0x45')],'type':_0x3079b6['type'][_0xbd64('0x46')]};});_0x553fa0[_0xbd64('0x47')]=_[_0xbd64('0x34')](_0x2abe23,'name');_0x553fa0[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x23bf21[_0xbd64('0x48')]);_0x553fa0[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x553fa0['model'],_0x553fa0[_0xbd64('0x48')]);_0x526705[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x553fa0[_0xbd64('0x47')],qs['fields'](_0x23bf21['query'][_0xbd64('0x4d')]));_0x526705[_0xbd64('0x4c')]=_0x526705[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x526705[_0xbd64('0x4c')]:_0x553fa0[_0xbd64('0x47')];if(!_0x23bf21[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x526705[_0xbd64('0x25')]=qs[_0xbd64('0x25')](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x25')]);_0x526705[_0xbd64('0x23')]=qs[_0xbd64('0x23')](_0x23bf21['query'][_0xbd64('0x23')]);}_0x526705['order']=qs['sort'](_0x23bf21['query']['sort']);_0x526705[_0xbd64('0x51')]=qs[_0xbd64('0x4a')](_['pick'](_0x23bf21[_0xbd64('0x48')],_0x553fa0[_0xbd64('0x4a')]),_0x2abe23);var _0x46a3af=[];var _0x57e811=squel[_0xbd64('0x52')]()[_0xbd64('0x53')]('id')[_0xbd64('0x53')](_0xbd64('0x54'))[_0xbd64('0x53')](_0xbd64('0x55'))['from']('tools_tags');var _0x4bd09c=squel[_0xbd64('0x52')]()[_0xbd64('0x53')](_0xbd64('0x56'))[_0xbd64('0x53')]('u.fullname')[_0xbd64('0x53')](_0xbd64('0x57'))[_0xbd64('0x58')](_0xbd64('0x59'),'ui')[_0xbd64('0x5a')](_0xbd64('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x270910=squel[_0xbd64('0x52')]()[_0xbd64('0x58')](_0xbd64('0x5c'),'i')[_0xbd64('0x5a')](_0xbd64('0x5d'),'c',_0xbd64('0x5e'))[_0xbd64('0x5a')](_0xbd64('0x5b'),'o',_0xbd64('0x5f'))[_0xbd64('0x5a')](_0xbd64('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0xbd64('0x61'),'me',_0xbd64('0x62'))['left_join']('chat_interaction_has_tags','it',_0xbd64('0x63'))[_0xbd64('0x5a')]('tools_tags','t',_0xbd64('0x64'));var _0x13f083=squel[_0xbd64('0x65')]();var _0x3b592e=[];var _0x713652=squel[_0xbd64('0x65')]();var _0x2d788;if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x66')]){_0x2d788=as['parseSearch'](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x66')]);var _0x166783=_0x2d788['sqlOperator'];for(var _0x8ec428=0x0;_0x8ec428<_0x2d788[_0xbd64('0x67')]['length'];_0x8ec428++){var _0x4423d9=_0x2d788[_0xbd64('0x67')][_0x8ec428];var _0x16634d='i';var _0x220603=_[_0xbd64('0x68')](_0x2abe23,[_0xbd64('0x54'),_0x4423d9['field']]);if(!_0x220603){switch(_0x4423d9[_0xbd64('0x53')]){case _0xbd64('0x69'):if(_0x4423d9[_0xbd64('0x6a')]==0x1){_0x270910[_0xbd64('0x6b')]('`'+_0x4423d9['field']+_0xbd64('0x6c'));}else{_0x270910[_0xbd64('0x6b')]('`'+_0x4423d9['field']+_0xbd64('0x6d'));}break;case'Contact':if(_0x4423d9[_0xbd64('0x6e')]===_0xbd64('0x6f')){if(_0x4423d9[_0xbd64('0x6a')][_0xbd64('0x70')]('\x20')['length']>0x1){_0x13f083[_0x166783](_0xbd64('0x71'),qs[_0xbd64('0x72')](_0x4423d9[_0xbd64('0x6a')]),null);}else{var _0x23925c='%'+_0x4423d9[_0xbd64('0x6a')]+'%';_0x13f083[_0x166783](_0xbd64('0x73'),_0x23925c,_0x23925c,_0x23925c);}}else{_0x220603=_['find'](_0x2abe23,['name','ContactId']);_0x4423d9[_0xbd64('0x53')]=_0xbd64('0x74');_0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0[_0xbd64('0x6a')]['start'],_0x2b95a0[_0xbd64('0x6a')][_0xbd64('0x20')]);}break;case _0xbd64('0x78'):var _0x333720=_0x4423d9[_0xbd64('0x6a')][_0xbd64('0x70')](',')[_0xbd64('0x34')](function(_0x3d7e47){return Number(_0x3d7e47);});_0x333720[_0xbd64('0x37')](function(_0x18e724){_0x713652['or'](_0xbd64('0x79'),'%,'+_0x18e724+',%');});_0x3b592e=_[_0xbd64('0x7a')](_0x3b592e,_0x333720);break;case'User':if(_0x4423d9['operator']===_0xbd64('0x6f')){_0x13f083[_0x166783](_0xbd64('0x7b'),'%'+_0x4423d9[_0xbd64('0x6a')]+'%',null);}else{_0x220603=_['find'](_0x2abe23,[_0xbd64('0x54'),'UserId']);_0x4423d9[_0xbd64('0x53')]=_0xbd64('0x3d');_0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0['text'],_0x2b95a0[_0xbd64('0x6a')]['start'],_0x2b95a0[_0xbd64('0x6a')][_0xbd64('0x20')]);}break;case _0xbd64('0x2e'):_0x2b95a0=as[_0xbd64('0x75')]('me',null,_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0['value'][_0xbd64('0x7c')],_0x2b95a0[_0xbd64('0x6a')]['end']);break;}}else{var _0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0['value'][_0xbd64('0x7c')],_0x2b95a0['value'][_0xbd64('0x20')]);}}}else{var _0x4de7e0=_(_0x23bf21[_0xbd64('0x48')])['keys']()['map'](function(_0x51e0b0){return _['some'](_0x2abe23,[_0xbd64('0x54'),_0x51e0b0])?_0x51e0b0:undefined;})[_0xbd64('0x7d')]()[_0xbd64('0x6a')]();if(!_[_0xbd64('0x7e')](_0x4de7e0)){_0x4de7e0[_0xbd64('0x37')](function(_0x4ea72d){if(_0x4ea72d===_0xbd64('0x7f')){_0x270910[_0xbd64('0x51')](_0xbd64('0x80'),[][_0xbd64('0x81')](_0x23bf21[_0xbd64('0x48')][_0x4ea72d]));}else if(_0x4ea72d==='createdAt'){var _0x1abf2f=JSON[_0xbd64('0x82')](_0x23bf21[_0xbd64('0x48')][_0x4ea72d])[_0xbd64('0x83')];var _0x5875da=JSON['parse'](_0x23bf21[_0xbd64('0x48')][_0x4ea72d])[_0xbd64('0x84')];_0x270910[_0xbd64('0x51')](_0xbd64('0x85'),_0x1abf2f,_0x5875da);}else{if(_0x23bf21[_0xbd64('0x48')][_0x4ea72d]===_0xbd64('0x86')){_0x270910[_0xbd64('0x51')]('i.'+_0x4ea72d+_0xbd64('0x87'));}else{_0x270910['where']('i.'+_0x4ea72d+_0xbd64('0x88'),_0x23bf21['query'][_0x4ea72d]);}}});}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x89')]){if(_0x23bf21[_0xbd64('0x48')]['read']==0x1){_0x270910[_0xbd64('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x270910['having'](_0xbd64('0x8a'));}}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')]){_0x3b592e=_['isArray'](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')])?_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')]:new Array(_0x23bf21['query'][_0xbd64('0x8b')]);_0x3b592e[_0xbd64('0x37')](function(_0x355b87){_0x713652['or'](_0xbd64('0x79'),'%,'+_0x355b87+',%');});}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8c')]){var _0x3bc2e8=_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8c')][_0xbd64('0x8d')]('\x5c','\x5c\x5c')[_0xbd64('0x8d')](/'/g,'\x27\x27');if(qs[_0xbd64('0x8e')](_0x3bc2e8)){_0x13f083['or'](_0xbd64('0x8f'),_0x3bc2e8+'%');}else{_0x13f083['or'](_0xbd64('0x90'),qs['getFullTextValue'](_0x3bc2e8))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3bc2e8+'%');}}}_0x270910[_0xbd64('0x51')](_0x13f083);_0x270910[_0xbd64('0x91')](_0xbd64('0x92'));var _0x586056={'type':db[_0xbd64('0x93')]['QueryTypes'][_0xbd64('0x94')],'raw':!![]};var _0x99ee7f=_0x270910[_0xbd64('0x95')]();_0x99ee7f[_0xbd64('0x53')]('i.id');_0x99ee7f[_0xbd64('0x53')](_0xbd64('0x96'),'unreadMessages');if(_0x526705[_0xbd64('0x97')]){_0x526705['order'][_0xbd64('0x37')](function(_0x2415a8){var _0x38e860=_0x2415a8[0x0]===_0xbd64('0x98')?_0x2415a8[0x0]:'i.'+_0x2415a8[0x0];_0x270910[_0xbd64('0x97')](_0x38e860,_0x2415a8[0x1]===_0xbd64('0x99')?![]:!![]);});}if(!_['isEmpty'](_0x3b592e)){_0x270910[_0xbd64('0x6b')](_0x713652);_0x99ee7f['where'](_0xbd64('0x9a'),_0x3b592e);}BPromise[_0xbd64('0x9b')]()['then'](function(){if(!_0x2d788){if(_0x23bf21[_0xbd64('0x48')]['ChatWebsiteId'])return;_0x99ee7f[_0xbd64('0x51')](_0xbd64('0x9c'));_0x270910[_0xbd64('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x23bf21[_0xbd64('0x9d')][_0xbd64('0x9e')]!==_0xbd64('0x30'))return;return _0x23bf21[_0xbd64('0x9d')][_0xbd64('0x9f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x58efa2){if(_[_0xbd64('0x7e')](_0x58efa2)){_0x99ee7f[_0xbd64('0x51')](_0xbd64('0xa0'));_0x270910[_0xbd64('0x51')](_0xbd64('0xa0'));}else{_0x99ee7f[_0xbd64('0x51')](_0xbd64('0x80'),_[_0xbd64('0x34')](_0x58efa2,'id'));_0x270910[_0xbd64('0x51')](_0xbd64('0x80'),_[_0xbd64('0x34')](_0x58efa2,'id'));}});})[_0xbd64('0x15')](function(){if(_0x23bf21[_0xbd64('0x9d')]['role']===_0xbd64('0x30')&&!_0x2d788&&!_0x23bf21[_0xbd64('0x48')]['ChatWebsiteId'])return[];return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x99ee7f[_0xbd64('0xa2')](),_0x586056);})[_0xbd64('0x15')](function(_0x4e948c){_0x3304b7['count']=_0x4e948c[_0xbd64('0x4e')];if(_0x3304b7[_0xbd64('0x26')]===0x0)return[];return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x57e811[_0xbd64('0xa2')](),_0x586056)[_0xbd64('0x15')](function(_0x23cead){_0x46a3af=_[_0xbd64('0xa3')](_0x23cead,'id');_0x586056=_[_0xbd64('0xa4')](_0x586056,{'model':db[_0xbd64('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x4d')]){_0x526705['attributes'][_0xbd64('0x37')](function(_0x13c379){_0x270910[_0xbd64('0x53')]('i.'+_0x13c379);});}else{_0x270910['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbd64('0x69'));_0x270910[_0xbd64('0x53')]('a.key',_0xbd64('0xa5'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa6'),_0xbd64('0xa7'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa8'),_0xbd64('0x98'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa9'));_0x270910[_0xbd64('0x53')](_0xbd64('0xaa'),_0xbd64('0xab'));_0x270910['field'](_0xbd64('0xac'),'Contact.lastName');_0x270910[_0xbd64('0x53')](_0xbd64('0xad'),_0xbd64('0xae'));_0x270910[_0xbd64('0x53')](_0xbd64('0xaf'),'Contact.phone');_0x270910[_0xbd64('0x53')](_0xbd64('0xb0'),_0xbd64('0xb1'));_0x270910[_0xbd64('0x53')]('c.fax',_0xbd64('0xb2'));_0x270910['field'](_0xbd64('0xb3'),_0xbd64('0xb4'));_0x270910[_0xbd64('0x53')](_0xbd64('0xb5'),_0xbd64('0xb6'));_0x270910[_0xbd64('0x53')](_0xbd64('0xb7'),'TagIds');}if(_0x526705[_0xbd64('0x25')])_0x270910[_0xbd64('0x25')](_0x526705[_0xbd64('0x25')]);if(_0x526705[_0xbd64('0x23')])_0x270910['offset'](_0x526705[_0xbd64('0x23')]);return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x270910[_0xbd64('0xa2')](),_0x586056);})[_0xbd64('0x15')](function(_0x2add60){if(_0x2add60[_0xbd64('0x4e')]>0x0)_0x4bd09c['where'](_0xbd64('0xb8'),_['map'](_0x2add60,'id'));return db[_0xbd64('0xa1')]['query'](_0x4bd09c['toString'](),_0x586056)[_0xbd64('0x15')](function(_0x1c2d76){var _0x29706a=_['groupBy'](_0x1c2d76,_0xbd64('0xb9'));var _0x49d6fe=[];_0x2add60[_0xbd64('0x37')](function(_0x48a1b1){_0x49d6fe['push'](updateChatInteraction(_0x48a1b1,_0x46a3af,_0x29706a));});return BPromise[_0xbd64('0xba')](_0x49d6fe);});});})[_0xbd64('0x15')](function(_0x30a8b4){_0x3304b7[_0xbd64('0xbb')]=_0x30a8b4;return _0x3304b7;})[_0xbd64('0x15')](respondWithFilteredResult(_0x495522,_0x526705))[_0xbd64('0x1f')](handleError(_0x495522,null));};exports[_0xbd64('0xbc')]=function(_0x475506,_0x5ecd1e){var _0x58d2c6={'raw':![],'where':{'id':_0x475506['params']['id']}},_0xd7e9dd={};_0xd7e9dd[_0xbd64('0x47')]=_[_0xbd64('0x49')](db[_0xbd64('0x43')]['rawAttributes']);_0xd7e9dd[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x475506['query']);_0xd7e9dd[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0xd7e9dd['model'],_0xd7e9dd['query']);_0x58d2c6[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0xd7e9dd[_0xbd64('0x47')],qs[_0xbd64('0x4d')](_0x475506[_0xbd64('0x48')][_0xbd64('0x4d')]));_0x58d2c6[_0xbd64('0x4c')]=_0x58d2c6[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x58d2c6[_0xbd64('0x4c')]:_0xd7e9dd[_0xbd64('0x47')];if(_0x475506[_0xbd64('0x48')][_0xbd64('0xbd')]){_0x58d2c6[_0xbd64('0xbe')]=[{'all':!![]}];}_0x58d2c6=_[_0xbd64('0xa4')]({},_0x58d2c6,_0x475506['options']);return db[_0xbd64('0x43')]['find'](_0x58d2c6)[_0xbd64('0x15')](handleEntityNotFound(_0x5ecd1e,null))[_0xbd64('0x15')](respondWithResult(_0x5ecd1e,null))['catch'](handleError(_0x5ecd1e,null));};exports[_0xbd64('0xbf')]=function(_0x4ad565,_0x2614bf){return db[_0xbd64('0x43')][_0xbd64('0xbf')](_0x4ad565[_0xbd64('0x2e')],{})['then'](respondWithResult(_0x2614bf,0xc9))[_0xbd64('0x1f')](handleError(_0x2614bf,null));};exports[_0xbd64('0x29')]=function(_0x291861,_0x459a16){if(_0x291861['body']['id']){delete _0x291861['body']['id'];}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x291861[_0xbd64('0xc0')]['id']}})['then'](handleEntityNotFound(_0x459a16,null))[_0xbd64('0x15')](saveUpdates(_0x291861['body'],null))[_0xbd64('0x15')](respondWithResult(_0x459a16,null))[_0xbd64('0x1f')](handleError(_0x459a16,null));};exports[_0xbd64('0x2a')]=function(_0x3337a5,_0x37ca27){return db['ChatInteraction']['find']({'where':{'id':_0x3337a5[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x37ca27,null))[_0xbd64('0x15')](removeEntity(_0x37ca27,null))['catch'](handleError(_0x37ca27,null));};exports[_0xbd64('0xc1')]=function(_0x4e1359,_0x11ab17){return db[_0xbd64('0x43')][_0xbd64('0xc1')]()['then'](respondWithResult(_0x11ab17,null))[_0xbd64('0x1f')](handleError(_0x11ab17,null));};exports[_0xbd64('0xc2')]=function(_0x496475,_0x4d5ad0){var _0x13be0b=_0x496475['params']['id'];var _0x4d1a95;var _0x1442ee;var _0x237a8c;return db['ChatInteraction'][_0xbd64('0xc3')]({'where':{'id':_0x13be0b}})['then'](function(_0x4011c5){_0x4d1a95=_0x4011c5;return db[_0xbd64('0xc4')][_0xbd64('0xc3')]({'where':{'id':_0x4011c5['ChatWebsiteId']},'attributes':['id',_0xbd64('0xc5'),'vidaooEscalation','vidaooTopic','vidaooNote',_0xbd64('0xc6')],'raw':!![]});})[_0xbd64('0x15')](function(_0xdf1c41){if(_0xdf1c41&&_0xdf1c41['vidaooApiKey']&&_0xdf1c41[_0xbd64('0xc7')]){_0x1442ee=_0xdf1c41;var _0x4a745f={'interaction':{'id':_0x13be0b},'agent':{'id':_0x496475[_0xbd64('0x9d')]['id'],'name':_0x496475['user']['name'],'fullname':_0x496475['user'][_0xbd64('0x35')],'email':_0x496475[_0xbd64('0x9d')][_0xbd64('0xc8')]},'contact':_0x496475[_0xbd64('0x2e')]['contact'],'account':_0x496475[_0xbd64('0x2e')][_0xbd64('0x32')]};var _0xef51de={'rejectUnauthorized':![],'method':'POST','url':_0xbd64('0xc9'),'headers':{'X-APIKEY':_0xdf1c41['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x496475[_0xbd64('0x9d')][_0xbd64('0xc8')]],'buttons':null,'topic':_0x1442ee[_0xbd64('0xca')],'note':_[_0xbd64('0xcb')](_0x1442ee[_0xbd64('0xcc')])?null:getMustacheRender(_0x1442ee[_0xbd64('0xcc')],_0x4a745f),'metadata':null},'redirect':_0xbd64('0xcd'),'json':!![]};try{if(!_[_0xbd64('0xcb')](_0x1442ee[_0xbd64('0xc6')])){var _0x871906=getMustacheRender(_0x1442ee[_0xbd64('0xc6')],_0x4a745f);var _0x17f82d=JSON[_0xbd64('0x82')](_0x871906);_0xef51de['body']['metadata']=_0x17f82d;}}catch(_0x3ccf53){throw new db[(_0xbd64('0x93'))][(_0xbd64('0xce'))](_0xbd64('0xcf'));}return rp(_0xef51de);}else{throw new db['Sequelize'][(_0xbd64('0xce'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xbd64('0x15')](function(_0x5ecf80){_0x237a8c=_0x5ecf80;if(_0x237a8c['id']){var _0x5b7dbd={'body':_0x237a8c[_0xbd64('0xd0')],'ChatWebsiteId':_0x1442ee['id'],'ChatInteractionId':_0x4d1a95['id'],'direction':_0xbd64('0xd1'),'UserId':_0x496475['user']['id']};return db[_0xbd64('0xd2')]['create'](_0x5b7dbd,{});}else{throw new db[(_0xbd64('0x93'))]['ValidationError'](_0xbd64('0xd3'));}})[_0xbd64('0x15')](function(){return _0x4d1a95[_0xbd64('0xd4')]({'vidaooSessionId':_0x237a8c['id']});})['then'](respondWithResult(_0x4d5ad0,null))[_0xbd64('0x1f')](handleError(_0x4d5ad0,null));};exports[_0xbd64('0xd5')]=function(_0x314899,_0x3fac1a){if(_0x314899[_0xbd64('0x2e')]['id']){delete _0x314899[_0xbd64('0x2e')]['id'];}return db[_0xbd64('0x43')]['find']({'where':{'id':_0x314899[_0xbd64('0xc0')]['id']},'include':[{'model':db[_0xbd64('0xd6')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x3fac1a,null))['then'](saveUpdates(_0x314899[_0xbd64('0x2e')],null))[_0xbd64('0x15')](respondWithResult(_0x3fac1a,null))[_0xbd64('0x1f')](handleError(_0x3fac1a,null));};exports['abandon']=function(_0x1b2a3e,_0x5d1231){if(_0x1b2a3e[_0xbd64('0x2e')]['id']){delete _0x1b2a3e['body']['id'];}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x1b2a3e[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](function(_0xe1837c){if(!_0xe1837c){logger[_0xbd64('0x1a')](_0xbd64('0xd7'),_0xbd64('0xd8'),0x194,_0xbd64('0xd9'));_0x5d1231[_0xbd64('0xda')](0x194);}else{if(_0xe1837c[_0xbd64('0x3d')]){throw new db['Sequelize'][(_0xbd64('0xce'))](_0xbd64('0xdb'));}}return _0xe1837c;})[_0xbd64('0x15')](function(_0x23fd87){if(_0x23fd87){return _0x23fd87[_0xbd64('0x29')]({'closed':_0x1b2a3e[_0xbd64('0x2e')][_0xbd64('0x3c')],'disposition':_0x1b2a3e[_0xbd64('0x2e')][_0xbd64('0x40')]})['then'](function(_0x5e5211){return _0x5e5211;});}})[_0xbd64('0x15')](function(){return respondWithRpcPromise(_0xbd64('0xdc'),'abandon',_0x1b2a3e[_0xbd64('0x2e')],client9004);})[_0xbd64('0x15')](respondWithResult(_0x5d1231,null))['catch'](handleError(_0x5d1231,null));};exports[_0xbd64('0xdd')]=function(_0x4fdc08,_0x368998){_0x4fdc08[_0xbd64('0x2e')][_0xbd64('0x54')]=_0x4fdc08[_0xbd64('0xde')][_0xbd64('0xdf')];_0x4fdc08['body']['basename']=_0x4fdc08['file']['filename'];_0x4fdc08[_0xbd64('0x2e')]['type']=_0x4fdc08[_0xbd64('0xde')]['mimetype'];return db['Attachment'][_0xbd64('0xbf')](_0x4fdc08[_0xbd64('0x2e')])[_0xbd64('0x15')](respondWithResult(_0x368998,0xc9))[_0xbd64('0x1f')](handleError(_0x368998,null));};exports[_0xbd64('0xe0')]=function(_0x385178,_0x13fae5){return db[_0xbd64('0x43')][_0xbd64('0xc3')]({'where':{'id':_0x385178[_0xbd64('0xc0')]['id']},'raw':!![]})[_0xbd64('0x15')](handleEntityNotFound(_0x13fae5,null))[_0xbd64('0x15')](function(_0x5efd7c){if(_0x5efd7c){if(_0x5efd7c[_0xbd64('0x3c')]){return _0x13fae5[_0xbd64('0x21')](0x193)[_0xbd64('0x22')]({'status':0x193,'message':_0xbd64('0xe1')});}return db[_0xbd64('0xe2')][_0xbd64('0xc3')]({'where':{'id':_0x385178['query'][_0xbd64('0xe3')]},'raw':!![]})[_0xbd64('0x15')](handleEntityNotFound(_0x13fae5,null));}})[_0xbd64('0x15')](function(_0x2c2664){if(_0x2c2664){var _0x52011f=_0x2c2664[_0xbd64('0xe4')]!==null;var _0x117595=path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],'server/files/attachments/');if(_0x52011f){_0x117595=path[_0xbd64('0xe5')](_0x117595,'offline-chat/');}var _0x5dd4db=path['join'](_0x117595,_0x2c2664[_0xbd64('0xe7')]);return _0x13fae5[_0xbd64('0xe8')](_0x5dd4db);}})['catch'](handleError(_0x13fae5,null));};exports['close']=function(_0x54831a,_0x1d8739){var _0x1c64ca=null;var _0x65c02b=null;var _0x545933=null;if(_0x54831a['body']['id']){delete _0x54831a[_0xbd64('0x2e')]['id'];}if(_0x54831a['body'][_0xbd64('0xe9')]){_0x545933=path['join'](config[_0xbd64('0xe6')],_0xbd64('0xea'),util[_0xbd64('0xeb')](_0xbd64('0xec'),Date['now']()));_0x54831a[_0xbd64('0x2e')][_0xbd64('0xed')]=_0x545933;}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x54831a['params']['id']},'include':[{'model':db[_0xbd64('0xd2')],'as':_0xbd64('0xee'),'include':[{'model':db[_0xbd64('0xef')],'as':_0xbd64('0xef')}]}]})[_0xbd64('0x15')](handleEntityNotFound(_0x1d8739,null))[_0xbd64('0x15')](saveUpdates(_0x54831a[_0xbd64('0x2e')],null))[_0xbd64('0x15')](function(_0x3d02a3){if(_0x3d02a3){_0x1c64ca=_0x3d02a3;return db['ChatWebsite']['find']({'where':{'id':_0x1c64ca[_0xbd64('0x7f')]}});}})['then'](function(_0x1b4d1a){if(_0x1b4d1a){_0x65c02b=_0x1b4d1a;return db[_0xbd64('0xd6')][_0xbd64('0x68')]({'where':{'id':_0x1c64ca['ContactId']}});}})['then'](function(_0x1798e1){if(_0x1798e1){if(_0x545933){var _0x394dd0=null;for(var _0x2b532a=0x1;_0x2b532a<_0x1c64ca[_0xbd64('0xee')][_0xbd64('0x4e')];++_0x2b532a){_0x394dd0=_0x1c64ca[_0xbd64('0xee')][_0x2b532a];var _0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')]('%s%d',_0x65c02b['agentAlias'],_0x394dd0[_0xbd64('0x3d')]):_0xbd64('0xf0');var _0x4022da=_0x54831a[_0xbd64('0x2e')]['customer']||util[_0xbd64('0xeb')]('%s%d',_0xbd64('0xf1'),_0x394dd0['ContactId']);switch(_0x65c02b[_0xbd64('0xf2')]){case'website_alias':_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')](_0xbd64('0xf3'),_0x65c02b[_0xbd64('0xf4')],_0x394dd0[_0xbd64('0x3d')]):_0xbd64('0xf0');break;case'agent_alias':_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?_0x394dd0['User'][_0xbd64('0xf5')]||_0x394dd0['User']['fullname']:_0xbd64('0xf0');break;case _0xbd64('0xf6'):_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?_0x394dd0['User'][_0xbd64('0x35')]:_0xbd64('0xf0');break;default:_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')](_0xbd64('0xf3'),_0x65c02b['agentAlias'],_0x394dd0[_0xbd64('0x3d')]):'System';}var _0x5ec435=util[_0xbd64('0xeb')](_0xbd64('0xf7'),moment(_0x394dd0[_0xbd64('0xf8')])[_0xbd64('0xeb')](_0xbd64('0xf9')),_0x394dd0[_0xbd64('0xfa')]==='in'?_0x4022da:_0x1ac26f,_0x394dd0[_0xbd64('0x2e')]);if(!_0x394dd0[_0xbd64('0xfb')]){fs[_0xbd64('0xfc')](_0x545933,_0x5ec435);}}return db[_0xbd64('0xfd')][_0xbd64('0xc3')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbd64('0xfe'),'raw':!![],'include':[{'model':db[_0xbd64('0xff')],'as':_0xbd64('0xff'),'raw':!![]}]}]});}}})[_0xbd64('0x15')](function(_0x4e69f8){if(!_0x4e69f8||!_0x4e69f8[_0xbd64('0xfe')]||!_0x54831a[_0xbd64('0x2e')])return _0x1c64ca;var _0x4a6ea9=_0x4e69f8['getSmtpOptions']();return respondWithRpcPromise(_0xbd64('0x100'),_0xbd64('0x101'),{'account':_0x4a6ea9,'message':{'from':util[_0xbd64('0xeb')](_0xbd64('0x102'),_0x4e69f8[_0xbd64('0x54')],_0x4e69f8[_0xbd64('0xc8')]||_0x4e69f8['Smtp'][_0xbd64('0x9d')]),'to':_0x54831a[_0xbd64('0x2e')][_0xbd64('0xe9')],'subject':_0xbd64('0x103'),'text':util['format'](_0xbd64('0x104'),_0x54831a['body'][_0xbd64('0xe9')]),'attachments':[{'path':_0x545933}]}})[_0xbd64('0x15')](function(){return _0x1c64ca;})[_0xbd64('0x1f')](function(_0x44662a){logger['error'](_0x44662a);});})[_0xbd64('0x15')](respondWithStatusCode(_0x1d8739,0xc8))['catch'](handleError(_0x1d8739,null));};exports[_0xbd64('0x105')]=function(_0x4cf6ec,_0x28ae53){return db['ChatMessage'][_0xbd64('0x68')]({'where':{'id':_0x4cf6ec[_0xbd64('0xc0')]['id']}})['then'](handleEntityNotFound(_0x28ae53,null))[_0xbd64('0x15')](function(_0x4238ae){if(_0x4238ae){return _0x4238ae['addMessage'](_0x4cf6ec[_0xbd64('0x2e')][_0xbd64('0x106')],_[_0xbd64('0x107')](_0x4cf6ec['body'],[_0xbd64('0x106'),'id'])||{});}})[_0xbd64('0x15')](respondWithResult(_0x28ae53,null))[_0xbd64('0x1f')](handleError(_0x28ae53,null));};exports['getMessages']=function(_0x475fc3,_0x46f980){var _0x5c9a2f={'raw':![],'where':{}};var _0x512f76={};var _0x4452ba={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x475fc3[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x46f980,null))[_0xbd64('0x15')](function(_0x5423f1){if(_0x5423f1){_0x512f76[_0xbd64('0x47')]=_['keys'](db[_0xbd64('0xd2')]['rawAttributes']);_0x512f76[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x475fc3['query']);_0x512f76[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x512f76[_0xbd64('0x47')],_0x512f76[_0xbd64('0x48')]);_0x5c9a2f[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x512f76['model'],qs[_0xbd64('0x4d')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x4d')]));_0x5c9a2f[_0xbd64('0x4c')]=_0x5c9a2f[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x5c9a2f['attributes']:_0x512f76['model'];if(!_0x475fc3[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x5c9a2f['limit']=qs[_0xbd64('0x25')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x25')]);_0x5c9a2f[_0xbd64('0x23')]=qs[_0xbd64('0x23')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x23')]);}_0x5c9a2f['order']=qs[_0xbd64('0x108')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x108')]);_0x5c9a2f[_0xbd64('0x51')]=qs['filters'](_['pick'](_0x475fc3['query'],_0x512f76[_0xbd64('0x4a')]));_0x5c9a2f['where'][_0xbd64('0xb9')]=_0x5423f1['id'];if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0x8c')]){_0x5c9a2f['where']=_[_0xbd64('0xa4')](_0x5c9a2f[_0xbd64('0x51')],{'$or':_[_0xbd64('0x34')](_0x5c9a2f[_0xbd64('0x4c')],function(_0x3248fa){var _0x996723={};_0x996723[_0x3248fa]={'$like':'%'+_0x475fc3[_0xbd64('0x48')][_0xbd64('0x8c')]+'%'};return _0x996723;})});}if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0x83')]){var _0x217a57=_0x475fc3[_0xbd64('0x48')][_0xbd64('0x83')]['split'](',');var _0x233441={};_0x233441[_0x217a57[0x0]]={'$gte':moment(_0x217a57[0x1])['format'](_0xbd64('0x109'))};_0x5c9a2f[_0xbd64('0x51')]=_[_0xbd64('0xa4')](_0x5c9a2f[_0xbd64('0x51')],_0x233441);}_0x5c9a2f=_[_0xbd64('0xa4')]({},_0x5c9a2f,_0x475fc3[_0xbd64('0x10a')]);return db['ChatMessage']['count']({'where':_0x5c9a2f['where']})['then'](function(_0x2f75d1){_0x4452ba[_0xbd64('0x26')]=_0x2f75d1;if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0xbd')]){_0x5c9a2f[_0xbd64('0xbe')]=[{'all':!![]}];}return db[_0xbd64('0xd2')][_0xbd64('0x10b')](_0x5c9a2f);})[_0xbd64('0x15')](function(_0x50abe1){_0x4452ba[_0xbd64('0xbb')]=_0x50abe1;return _0x4452ba;});}})[_0xbd64('0x15')](respondWithFilteredResult(_0x46f980,_0x5c9a2f))['catch'](handleError(_0x46f980,null));};exports[_0xbd64('0x10c')]=function(_0x41294f,_0x3f3cd6){var _0x47806e={'where':{}},_0x39b3c7={},_0x325f67={'count':0x0,'rows':[]};return db[_0xbd64('0x43')][_0xbd64('0xc3')]({'where':{'id':_0x41294f[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x3f3cd6,null))[_0xbd64('0x15')](function(_0x489033){if(_0x489033){_0x39b3c7[_0xbd64('0x47')]=_[_0xbd64('0x49')](db[_0xbd64('0xd2')]['rawAttributes']);_0x39b3c7[_0xbd64('0x48')]=_['keys'](_0x41294f[_0xbd64('0x48')]);_0x39b3c7[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x39b3c7['model'],_0x39b3c7['query']);_0x47806e[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x39b3c7['model'],qs[_0xbd64('0x4d')](_0x41294f['query'][_0xbd64('0x4d')]));_0x47806e[_0xbd64('0x4c')]=_0x47806e[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x47806e[_0xbd64('0x4c')]:_0x39b3c7[_0xbd64('0x47')];if(!_0x41294f[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x47806e[_0xbd64('0x25')]=qs['limit'](_0x41294f['query'][_0xbd64('0x25')]);_0x47806e[_0xbd64('0x23')]=qs['offset'](_0x41294f[_0xbd64('0x48')][_0xbd64('0x23')]);}_0x47806e[_0xbd64('0x97')]=qs[_0xbd64('0x108')](_0x41294f['query'][_0xbd64('0x108')]);_0x47806e[_0xbd64('0x51')]=qs[_0xbd64('0x4a')](_['pick'](_0x41294f['query'],_0x39b3c7[_0xbd64('0x4a')]));_0x47806e[_0xbd64('0x51')][_0xbd64('0xb9')]=_0x489033['id'];if(_0x41294f['query'][_0xbd64('0x8c')]){_0x47806e['where']=_[_0xbd64('0xa4')](_0x47806e['where'],{'$or':_[_0xbd64('0x34')](_0x47806e['attributes'],function(_0x305199){var _0x37498c={};_0x37498c[_0x305199]={'$like':'%'+_0x41294f[_0xbd64('0x48')][_0xbd64('0x8c')]+'%'};return _0x37498c;})});}_0x47806e['where'][_0xbd64('0xfb')]=![];if(_0x41294f[_0xbd64('0x48')]['id']){_0x47806e[_0xbd64('0x51')]['id']={'$gt':_0x41294f[_0xbd64('0x48')]['id']};}_0x47806e=_[_0xbd64('0xa4')]({},_0x47806e,_0x41294f[_0xbd64('0x10a')]);return db[_0xbd64('0xd2')][_0xbd64('0x26')]({'where':_0x47806e[_0xbd64('0x51')]})[_0xbd64('0x15')](function(_0x197e24){_0x325f67['count']=_0x197e24;_0x47806e[_0xbd64('0xbe')]=[];if(_0x41294f[_0xbd64('0x48')]['includeAgent']){_0x47806e['include'][_0xbd64('0x39')]({'model':db[_0xbd64('0xef')],'as':'User','attributes':['id',_0xbd64('0x35'),_0xbd64('0xf5')]});}if(_0x41294f[_0xbd64('0x48')]['includeAll']){_0x47806e[_0xbd64('0xbe')]=[{'all':!![]}];}return db[_0xbd64('0xd2')]['findAll'](_0x47806e);})[_0xbd64('0x15')](function(_0x17cacc){_0x325f67[_0xbd64('0xbb')]=_0x17cacc;return _0x325f67;});}})[_0xbd64('0x15')](respondWithFilteredResult(_0x3f3cd6,_0x47806e))[_0xbd64('0x1f')](handleError(_0x3f3cd6,null));};exports[_0xbd64('0x10d')]=function(_0x1d759c,_0x171d75){return db[_0xbd64('0x43')]['find']({'where':{'id':_0x1d759c['params']['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x171d75,null))['then'](function(_0x2acfac){if(_0x2acfac){return _0x2acfac['setTags'](_0x1d759c[_0xbd64('0x2e')]['ids'],_[_0xbd64('0x107')](_0x1d759c[_0xbd64('0x2e')],['ids','id'])||{})[_0xbd64('0x10e')](function(){return db[_0xbd64('0x78')][_0xbd64('0x10b')]({'attributes':['id',_0xbd64('0x54'),_0xbd64('0x55')],'where':{'id':_0x1d759c[_0xbd64('0x2e')][_0xbd64('0x106')]}});})[_0xbd64('0x15')](function(_0x160744){socket[_0xbd64('0x10f')](_0xbd64('0x110'),{'id':Number(_0x1d759c[_0xbd64('0xc0')]['id']),'tags':_0x160744||[]});return{'id':Number(_0x1d759c[_0xbd64('0xc0')]['id']),'tags':_0x160744||[]};});}})[_0xbd64('0x15')](respondWithResult(_0x171d75,null))[_0xbd64('0x1f')](handleError(_0x171d75,null));};exports[_0xbd64('0x111')]=function(_0x384d15,_0x24eec6){return db[_0xbd64('0x43')]['find']({'where':{'id':_0x384d15[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x24eec6,null))[_0xbd64('0x15')](function(_0x483727){if(_0x483727){return _0x483727[_0xbd64('0x111')](_0x384d15[_0xbd64('0x48')][_0xbd64('0x106')]);}})[_0xbd64('0x15')](respondWithStatusCode(_0x24eec6,null))[_0xbd64('0x1f')](handleError(_0x24eec6,null));};exports[_0xbd64('0xe8')]=function(_0x89472a,_0x22dd66){var _0x2137fc=moment()[_0xbd64('0x112')]()[_0xbd64('0xa2')]();var _0x1267c8=path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],_0xbd64('0x113'),'files',_0xbd64('0x114'));var _0x356b58=path[_0xbd64('0xe5')](config['root'],_0xbd64('0x113'),_0xbd64('0x115'),_0xbd64('0x116'));var _0x23e5d8=path[_0xbd64('0xe5')](_0x1267c8,_0x2137fc);var _0x18b84f=util[_0xbd64('0xeb')](_0xbd64('0x117'),_0x89472a[_0xbd64('0xc0')]['id'],_0x2137fc);var _0x281df6=path['join'](_0x1267c8,_0x18b84f);var _0x4021f2=[];_0x4021f2['push']({'model':db[_0xbd64('0xef')],'as':'User','attributes':['id',_0xbd64('0x35')],'raw':!![]});_0x4021f2[_0xbd64('0x39')]({'model':db[_0xbd64('0xd6')],'as':_0xbd64('0x118'),'attributes':['id',_0xbd64('0x119'),_0xbd64('0x11a')],'raw':!![]});if(_0x89472a[_0xbd64('0x48')][_0xbd64('0x116')]){_0x4021f2[_0xbd64('0x39')]({'model':db[_0xbd64('0xe2')],'as':_0xbd64('0xe2'),'raw':!![]});}var _0x3edc3b=[{'model':db[_0xbd64('0xd2')],'as':'Messages','attributes':['id','body',_0xbd64('0xf8'),_0xbd64('0xfa'),_0xbd64('0xfb'),_0xbd64('0x89')],'include':_0x4021f2}];_0x3edc3b[_0xbd64('0x39')]({'model':db[_0xbd64('0xc4')],'as':'Account','attributes':['id',_0xbd64('0x54')]});_0x3edc3b['push']({'model':db[_0xbd64('0xef')],'as':_0xbd64('0x11b'),'attributes':['id','fullname']});return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x89472a[_0xbd64('0xc0')]['id']},'include':_0x3edc3b})[_0xbd64('0x15')](handleEntityNotFound(_0x22dd66,null))[_0xbd64('0x15')](function(_0x10a22f){if(_0x10a22f){var _0x3db848=_0x10a22f['get']({'plain':!![]});fs['mkdirSync'](_0x23e5d8);var _0x5422bc={'channel':_0xbd64('0x11c'),'account':_0x3db848[_0xbd64('0x11d')][_0xbd64('0x54')],'agent':_0x3db848[_0xbd64('0x11b')]?_0x3db848['Owner'][_0xbd64('0x35')]:'N.A.','createdAt':moment(_0x3db848['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbd64('0xa2')](),'closedAt':_0x3db848[_0xbd64('0x3c')]?moment(_0x3db848[_0xbd64('0x11e')])[_0xbd64('0xeb')](_0xbd64('0x109'))['toString']():'','disposition':_0x3db848[_0xbd64('0x40')],'chatInfo':{'browser':_0x3db848[_0xbd64('0x11f')],'os':_0x3db848['osName'],'referer':_0x3db848['referer'],'customerIp':_0x3db848[_0xbd64('0x120')],'customerPort':_0x3db848['customerPort']?_0x3db848[_0xbd64('0x121')]:_0xbd64('0x122')},'messages':_(_0x3db848[_0xbd64('0xee')])[_0xbd64('0x123')]()[_0xbd64('0x8c')]({'secret':![]})[_0xbd64('0x34')](function(_0x20bdb5){if(_0x20bdb5[_0xbd64('0xe2')]){var _0x4020a1=path[_0xbd64('0xe5')](_0x356b58,_0x20bdb5[_0xbd64('0xe2')][_0xbd64('0xe7')]);if(fs[_0xbd64('0x124')](_0x4020a1)){fs[_0xbd64('0x125')](_0x4020a1)['pipe'](fs[_0xbd64('0x126')](path['join'](_0x23e5d8,_0x20bdb5[_0xbd64('0xe2')]['basename'])));}}return{'date':moment(_0x20bdb5[_0xbd64('0xf8')])[_0xbd64('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbd64('0xa2')](),'sender':_0x20bdb5[_0xbd64('0xfa')]===_0xbd64('0xd1')?_0x20bdb5['User']?_0x20bdb5[_0xbd64('0xef')][_0xbd64('0x35')]:_0xbd64('0xf0'):_0x20bdb5[_0xbd64('0x118')][_0xbd64('0x119')]+(_0x20bdb5['Contact'][_0xbd64('0x11a')]?'\x20'+_0x20bdb5['Contact']['lastName']:''),'body':_0x20bdb5['Attachment']?_0x20bdb5[_0xbd64('0xe2')]['basename']:_0x20bdb5[_0xbd64('0x2e')],'direction':_0x20bdb5[_0xbd64('0xfa')]===_0xbd64('0xd1')?'A':'C','secret':_0x20bdb5[_0xbd64('0xfb')],'read':_0x20bdb5[_0xbd64('0x89')],'attachment':_0x20bdb5['Attachment']};})[_0xbd64('0x6a')]()};return ejs['renderFile'](path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],'server',_0xbd64('0x127'),_0xbd64('0x128')),{'interaction':_0x5422bc})[_0xbd64('0x15')](function(_0x1f5879){var _0x142845=path[_0xbd64('0xe5')](_0x23e5d8,_0xbd64('0x129')+_0x3db848['id']+'-'+_0x2137fc+_0xbd64('0x12a'));var _0x33a5c9={'path':_0x142845,'channel':'Chat','interactionId':_0x3db848['id']};return pdf[_0xbd64('0x12b')](_0x1f5879,_0x33a5c9);})['then'](function(){return new Promise(function(_0x5df014,_0x5d8bf1){zipdir(_0x23e5d8,{'saveTo':_0x281df6},function(_0x101acc,_0x4fceed){if(_0x101acc)return _0x5d8bf1(_0x101acc);return _0x5df014(_0x4fceed);});})[_0xbd64('0x15')](function(){return new BPromise(function(_0x4996bb,_0x1da281){rimraf(_0x23e5d8,function(_0x516378){if(_0x516378)_0x1da281(_0x516378);return _0x4996bb();});});})[_0xbd64('0x15')](function(){return _0x22dd66[_0xbd64('0xe8')](_0x281df6,_0x18b84f,function(_0x2583cd){if(_0x2583cd){logger[_0xbd64('0x1a')](_0xbd64('0x12c'),_0x2583cd);}else{fs['unlinkSync'](_0x281df6);}});});});}else{return _0x22dd66[_0xbd64('0xda')](0xc8);}})[_0xbd64('0x1f')](handleError(_0x22dd66,null));}; \ No newline at end of file +var _0x99e9=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','some','compact','isEmpty','forEach','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','rawAttributes','include','options','create','body','describe','createVidaooSession','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','attachmentUpload','file','basename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','ChatWebsite','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','includeAgent','addTags','setTags','spread','emit','removeTags','download','unix','server','files','tmp','attachments','lastName','createdAt','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','zip-dir','request-promise','moment','bluebird','util','path','ejs','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','render','merge','interaction','account','Users','fullname','Tags','split','push','TagIds','waiting','talking','unmanaged','abandoned','total','closed','UserId','disposition','map','ChatInteraction','fieldName','type','key','keys','intersection','model','attributes','fields','length','hasOwnProperty','query','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','text','end','Tag','User'];(function(_0x8f435b,_0x509cf1){var _0x22f74c=function(_0x3f4e09){while(--_0x3f4e09){_0x8f435b['push'](_0x8f435b['shift']());}};_0x22f74c(++_0x509cf1);}(_0x99e9,0xb4));var _0x999e=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0x99e9[_0x52a6e3];return _0x8910d0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x999e('0x0'));var rp=require(_0x999e('0x1'));var moment=require(_0x999e('0x2'));var BPromise=require(_0x999e('0x3'));var Mustache=require('mustache');var util=require(_0x999e('0x4'));var path=require(_0x999e('0x5'));var ejs=require(_0x999e('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x999e('0x7'));var Redis=require('ioredis');var qs=require(_0x999e('0x8'));var as=require(_0x999e('0x9'));var pdf=require(_0x999e('0xa'));var logger=require(_0x999e('0xb'))('api');var config=require(_0x999e('0xc'));var db=require(_0x999e('0xd'))['db'];config[_0x999e('0xe')]=_[_0x999e('0xf')](config[_0x999e('0xe')],{'host':_0x999e('0x10'),'port':0x18eb});var socket=require(_0x999e('0x11'))(new Redis(config[_0x999e('0xe')]));require(_0x999e('0x12'))[_0x999e('0x13')](socket);var jayson=require(_0x999e('0x14'));var client=jayson[_0x999e('0x15')][_0x999e('0x16')]({'port':0x232b});var client9004=jayson[_0x999e('0x15')][_0x999e('0x16')]({'port':0x232c});function respondWithRpcPromise(_0xdb587b,_0x26b55a,_0x47a3c1,_0x15f771){return new BPromise(function(_0x54afad,_0x3e6f5a){var _0x387924=_0x15f771||client;return _0x387924[_0x999e('0x17')](_0xdb587b,_0x47a3c1)['then'](function(_0x28bdd1){logger['info'](_0x999e('0x18'),_0x26b55a,'request\x20sent');logger['debug'](_0x999e('0x19'),_0x26b55a,_0x999e('0x1a'),JSON[_0x999e('0x1b')](_0x28bdd1));if(_0x28bdd1[_0x999e('0x1c')]){if(_0x28bdd1[_0x999e('0x1c')][_0x999e('0x1d')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x26b55a,_0x28bdd1['error'][_0x999e('0x1e')]);return _0x3e6f5a(_0x28bdd1[_0x999e('0x1c')][_0x999e('0x1e')]);}logger[_0x999e('0x1c')](_0x999e('0x18'),_0x26b55a,_0x28bdd1[_0x999e('0x1c')]['message']);return _0x54afad(_0x28bdd1['error'][_0x999e('0x1e')]);}else{logger[_0x999e('0x1f')](_0x999e('0x18'),_0x26b55a,'request\x20sent');_0x54afad(_0x28bdd1[_0x999e('0x20')][_0x999e('0x1e')]);}})[_0x999e('0x21')](function(_0x36fce4){logger[_0x999e('0x1c')](_0x999e('0x18'),_0x26b55a,_0x36fce4);_0x3e6f5a(_0x36fce4);});});}function respondWithStatusCode(_0x427bcf,_0x4d4474){_0x4d4474=_0x4d4474||0xcc;return function(_0x54ad83){if(_0x54ad83){return _0x427bcf[_0x999e('0x22')](_0x4d4474);}return _0x427bcf[_0x999e('0x23')](_0x4d4474)['end']();};}function respondWithResult(_0x452acd,_0xe324d8){_0xe324d8=_0xe324d8||0xc8;return function(_0x3f548e){if(_0x3f548e){return _0x452acd[_0x999e('0x23')](_0xe324d8)[_0x999e('0x24')](_0x3f548e);}};}function respondWithFilteredResult(_0x320634,_0x4f8406){return function(_0x2e1cc5){if(_0x2e1cc5){var _0x4199ff=typeof _0x4f8406[_0x999e('0x25')]===_0x999e('0x26')&&typeof _0x4f8406[_0x999e('0x27')]===_0x999e('0x26');var _0x44b790=_0x2e1cc5['count'];var _0x28f803=_0x4199ff?0x0:_0x4f8406['offset'];var _0x4fed13=_0x4199ff?_0x2e1cc5[_0x999e('0x28')]:_0x4f8406[_0x999e('0x25')]+_0x4f8406[_0x999e('0x27')];var _0x555ca0;if(_0x4fed13>=_0x44b790){_0x4fed13=_0x44b790;_0x555ca0=0xc8;}else{_0x555ca0=0xce;}_0x320634[_0x999e('0x23')](_0x555ca0);return _0x320634[_0x999e('0x29')](_0x999e('0x2a'),_0x28f803+'-'+_0x4fed13+'/'+_0x44b790)[_0x999e('0x24')](_0x2e1cc5);}return null;};}function saveUpdates(_0x15dca1){return function(_0x327079){if(_0x327079){return _0x327079[_0x999e('0x2b')](_0x15dca1)[_0x999e('0x2c')](function(_0x27102b){return _0x27102b;});}return null;};}function removeEntity(_0x3ddacb){return function(_0x53ece1){if(_0x53ece1){return _0x53ece1[_0x999e('0x2d')]()[_0x999e('0x2c')](function(){_0x3ddacb[_0x999e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca5b8){return function(_0x5af72c){if(!_0x5af72c){_0x2ca5b8['sendStatus'](0x194);}return _0x5af72c;};}function handleError(_0x28a228,_0x332195){_0x332195=_0x332195||0x1f4;return function(_0x5aa206){logger['error'](_0x5aa206[_0x999e('0x2e')]);if(_0x5aa206[_0x999e('0x2f')]){delete _0x5aa206[_0x999e('0x2f')];}_0x28a228[_0x999e('0x23')](_0x332195)['send'](_0x5aa206);};}function getMustacheRender(_0x2724be,_0x41d6f1){return Mustache[_0x999e('0x30')](_0x2724be,_[_0x999e('0x31')](_0x41d6f1['body'],{'contact':_0x41d6f1['contact'],'message':_0x41d6f1[_0x999e('0x1e')],'agent':_0x41d6f1['agent'],'interaction':_0x41d6f1[_0x999e('0x32')],'account':_0x41d6f1[_0x999e('0x33')]}))||'';}function getInteractionUsers(_0x69e059,_0x14c9e0){return new BPromise(function(_0x5ad3f1,_0xebda67){try{if(_0x14c9e0[_0x69e059['id']]){_0x69e059[_0x999e('0x34')]=_['map'](_0x14c9e0[_0x69e059['id']],function(_0x4808d1){return{'id':_0x4808d1['id'],'fullname':_0x4808d1[_0x999e('0x35')]};});}}catch(_0x4aa98c){_0xebda67(_0x4aa98c);}_0x5ad3f1(_0x69e059);});}function getInteractionTags(_0xa0c150,_0x5dac45){return new BPromise(function(_0x518083,_0x504ac1){try{if(_0xa0c150['TagIds']){_0xa0c150[_0x999e('0x36')]=[];_0xa0c150['TagIds'][_0x999e('0x37')](',')['forEach'](function(_0x4cfa34){_0xa0c150['Tags'][_0x999e('0x38')](_0x5dac45[_0x4cfa34]);});}delete _0xa0c150[_0x999e('0x39')];}catch(_0xd529df){_0x504ac1(_0xd529df);}_0x518083(_0xa0c150);});}function updateChatInteraction(_0xe3c089,_0x379064,_0x368183){return new BPromise(function(_0x32e494,_0x176a8c){return getInteractionUsers(_0xe3c089,_0x368183)['then'](function(_0x3ff20a){return getInteractionTags(_0x3ff20a,_0x379064);})[_0x999e('0x2c')](function(_0x1e1229){return getStateInteraction(_0x1e1229);})[_0x999e('0x2c')](function(_0x5dd3db){_0x32e494(_0x5dd3db);})[_0x999e('0x21')](function(_0x53730c){_0x176a8c(_0x53730c);});});}function getStateInteraction(_0x36194c){return new BPromise(function(_0x35b318){_0x36194c[_0x999e('0x3a')]=0x0;_0x36194c[_0x999e('0x3b')]=0x0;_0x36194c['answered']=0x0;_0x36194c[_0x999e('0x3c')]=0x0;_0x36194c[_0x999e('0x3d')]=0x0;_0x36194c[_0x999e('0x3e')]=0x0;if(!_0x36194c['closed']&&!_0x36194c['UserId']){_0x36194c[_0x999e('0x3a')]+=0x1;}if(!_0x36194c[_0x999e('0x3f')]&&_0x36194c[_0x999e('0x40')]){_0x36194c[_0x999e('0x3b')]+=0x1;if(_0x36194c[_0x999e('0x3a')]){_0x36194c[_0x999e('0x3a')]-=0x1;}}if(_0x36194c[_0x999e('0x3f')]&&_0x36194c[_0x999e('0x41')]===_0x999e('0x3d')){_0x36194c[_0x999e('0x3d')]+=0x1;if(_0x36194c['waiting']){_0x36194c['waiting']-=0x1;}}else if(_0x36194c[_0x999e('0x3f')]&&!_0x36194c[_0x999e('0x40')]&&_0x36194c[_0x999e('0x41')]){_0x36194c[_0x999e('0x3c')]+=0x1;if(_0x36194c[_0x999e('0x3a')]){_0x36194c[_0x999e('0x3a')]-=0x1;}}else if(_0x36194c['closed']&&_0x36194c[_0x999e('0x40')]){_0x36194c['answered']+=0x1;if(_0x36194c['talking']){_0x36194c[_0x999e('0x3b')]-=0x1;}}_0x36194c['total']+=0x1;_0x35b318(_0x36194c);});}exports['index']=function(_0x5a7366,_0x4f904e){var _0xc89b1={},_0x2841f7={},_0x5e50f5={'count':0x0,'rows':[]};var _0x4542e6=_[_0x999e('0x42')](db[_0x999e('0x43')]['rawAttributes'],function(_0x4b230d){return{'name':_0x4b230d[_0x999e('0x44')],'type':_0x4b230d[_0x999e('0x45')][_0x999e('0x46')]};});_0x2841f7['model']=_['map'](_0x4542e6,'name');_0x2841f7['query']=_[_0x999e('0x47')](_0x5a7366['query']);_0x2841f7['filters']=_[_0x999e('0x48')](_0x2841f7[_0x999e('0x49')],_0x2841f7['query']);_0xc89b1[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x2841f7['model'],qs[_0x999e('0x4b')](_0x5a7366['query'][_0x999e('0x4b')]));_0xc89b1[_0x999e('0x4a')]=_0xc89b1['attributes'][_0x999e('0x4c')]?_0xc89b1[_0x999e('0x4a')]:_0x2841f7['model'];if(!_0x5a7366['query'][_0x999e('0x4d')]('nolimit')){_0xc89b1['limit']=qs['limit'](_0x5a7366[_0x999e('0x4e')][_0x999e('0x27')]);_0xc89b1[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x5a7366[_0x999e('0x4e')][_0x999e('0x25')]);}_0xc89b1['order']=qs[_0x999e('0x4f')](_0x5a7366[_0x999e('0x4e')]['sort']);_0xc89b1[_0x999e('0x50')]=qs[_0x999e('0x51')](_[_0x999e('0x52')](_0x5a7366[_0x999e('0x4e')],_0x2841f7[_0x999e('0x51')]),_0x4542e6);var _0x334d19=[];var _0x428842=squel[_0x999e('0x53')]()[_0x999e('0x54')]('id')['field'](_0x999e('0x2f'))[_0x999e('0x54')](_0x999e('0x55'))[_0x999e('0x56')]('tools_tags');var _0x392324=squel[_0x999e('0x53')]()[_0x999e('0x54')](_0x999e('0x57'))[_0x999e('0x54')](_0x999e('0x58'))[_0x999e('0x54')](_0x999e('0x59'))['from']('user_has_chat_interactions','ui')[_0x999e('0x5a')](_0x999e('0x5b'),'u',_0x999e('0x5c'));var _0xefd231=squel[_0x999e('0x53')]()[_0x999e('0x56')](_0x999e('0x5d'),'i')['left_join']('cm_contacts','c',_0x999e('0x5e'))[_0x999e('0x5a')](_0x999e('0x5b'),'o',_0x999e('0x5f'))[_0x999e('0x5a')]('chat_websites','a',_0x999e('0x60'))[_0x999e('0x5a')](_0x999e('0x61'),'me',_0x999e('0x62'))[_0x999e('0x5a')](_0x999e('0x63'),'it',_0x999e('0x64'))['left_join'](_0x999e('0x65'),'t','t.id\x20=\x20it.TagId');var _0xe35369=squel[_0x999e('0x66')]();var _0x2ce0b3=[];var _0x25f6a6=squel[_0x999e('0x66')]();var _0x53cfbc;if(_0x5a7366['query'][_0x999e('0x67')]){_0x53cfbc=as[_0x999e('0x68')](_0x5a7366[_0x999e('0x4e')][_0x999e('0x67')]);var _0x470e51=_0x53cfbc[_0x999e('0x69')];for(var _0x23fd58=0x0;_0x23fd58<_0x53cfbc[_0x999e('0x6a')][_0x999e('0x4c')];_0x23fd58++){var _0x7f9dfe=_0x53cfbc[_0x999e('0x6a')][_0x23fd58];var _0xcc200b='i';var _0x77a387=_[_0x999e('0x6b')](_0x4542e6,[_0x999e('0x2f'),_0x7f9dfe['field']]);if(!_0x77a387){switch(_0x7f9dfe[_0x999e('0x54')]){case _0x999e('0x6c'):if(_0x7f9dfe[_0x999e('0x6d')]==0x1){_0xefd231[_0x999e('0x6e')]('`'+_0x7f9dfe['field']+'`\x20=\x200');}else{_0xefd231[_0x999e('0x6e')]('`'+_0x7f9dfe[_0x999e('0x54')]+_0x999e('0x6f'));}break;case _0x999e('0x70'):if(_0x7f9dfe[_0x999e('0x71')]===_0x999e('0x72')){if(_0x7f9dfe[_0x999e('0x6d')][_0x999e('0x37')]('\x20')[_0x999e('0x4c')]>0x1){_0xe35369[_0x470e51]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x999e('0x73')](_0x7f9dfe['value']),null);}else{var _0x184b3e='%'+_0x7f9dfe[_0x999e('0x6d')]+'%';_0xe35369[_0x470e51]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x184b3e,_0x184b3e,_0x184b3e);}}else{_0x77a387=_[_0x999e('0x6b')](_0x4542e6,[_0x999e('0x2f'),_0x999e('0x74')]);_0x7f9dfe[_0x999e('0x54')]=_0x999e('0x74');_0x1f0dc3=as['buildExpression'](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value']['start'],_0x1f0dc3['value'][_0x999e('0x76')]);}break;case _0x999e('0x77'):var _0x3432fd=_0x7f9dfe[_0x999e('0x6d')][_0x999e('0x37')](',')['map'](function(_0x492a5a){return Number(_0x492a5a);});_0x3432fd['forEach'](function(_0x49293d){_0x25f6a6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x49293d+',%');});_0x2ce0b3=_['union'](_0x2ce0b3,_0x3432fd);break;case _0x999e('0x78'):if(_0x7f9dfe['operator']===_0x999e('0x72')){_0xe35369[_0x470e51](_0x999e('0x79'),'%'+_0x7f9dfe[_0x999e('0x6d')]+'%',null);}else{_0x77a387=_['find'](_0x4542e6,[_0x999e('0x2f'),_0x999e('0x40')]);_0x7f9dfe[_0x999e('0x54')]=_0x999e('0x40');_0x1f0dc3=as[_0x999e('0x7a')](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value'][_0x999e('0x7b')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x76')]);}break;case'body':_0x1f0dc3=as[_0x999e('0x7a')]('me',null,_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value'][_0x999e('0x7b')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x76')]);break;}}else{var _0x1f0dc3=as[_0x999e('0x7a')](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x7b')],_0x1f0dc3['value'][_0x999e('0x76')]);}}}else{var _0x21a712=_(_0x5a7366[_0x999e('0x4e')])['keys']()[_0x999e('0x42')](function(_0x48e0ca){return _[_0x999e('0x7c')](_0x4542e6,[_0x999e('0x2f'),_0x48e0ca])?_0x48e0ca:undefined;})[_0x999e('0x7d')]()['value']();if(!_[_0x999e('0x7e')](_0x21a712)){_0x21a712[_0x999e('0x7f')](function(_0x1d6b40){if(_0x1d6b40===_0x999e('0x80')){_0xefd231[_0x999e('0x50')](_0x999e('0x81'),[]['concat'](_0x5a7366[_0x999e('0x4e')][_0x1d6b40]));}else if(_0x1d6b40==='createdAt'){var _0x34f25c=JSON['parse'](_0x5a7366['query'][_0x1d6b40])[_0x999e('0x82')];var _0x5d136c=JSON[_0x999e('0x83')](_0x5a7366[_0x999e('0x4e')][_0x1d6b40])['$lte'];_0xefd231[_0x999e('0x50')](_0x999e('0x84'),_0x34f25c,_0x5d136c);}else{if(_0x5a7366['query'][_0x1d6b40]===_0x999e('0x85')){_0xefd231[_0x999e('0x50')]('i.'+_0x1d6b40+_0x999e('0x86'));}else{_0xefd231[_0x999e('0x50')]('i.'+_0x1d6b40+_0x999e('0x87'),_0x5a7366[_0x999e('0x4e')][_0x1d6b40]);}}});}if(_0x5a7366[_0x999e('0x4e')][_0x999e('0x88')]){if(_0x5a7366['query']['read']==0x1){_0xefd231[_0x999e('0x6e')](_0x999e('0x89'));}else{_0xefd231[_0x999e('0x6e')](_0x999e('0x8a'));}}if(_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')]){_0x2ce0b3=_['isArray'](_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')])?_0x5a7366['query'][_0x999e('0x8b')]:new Array(_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')]);_0x2ce0b3['forEach'](function(_0x389520){_0x25f6a6['or'](_0x999e('0x8c'),'%,'+_0x389520+',%');});}if(_0x5a7366[_0x999e('0x4e')]['filter']){var _0x216040=_0x5a7366[_0x999e('0x4e')][_0x999e('0x8d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x999e('0x8e')](_0x216040)){_0xe35369['or']('i.id\x20LIKE\x20?',_0x216040+'%');}else{_0xe35369['or'](_0x999e('0x8f'),qs[_0x999e('0x73')](_0x216040))['or'](_0x999e('0x90'),_0x216040+'%');}}}_0xefd231[_0x999e('0x50')](_0xe35369);_0xefd231[_0x999e('0x91')](_0x999e('0x92'));var _0x43043a={'type':db['Sequelize'][_0x999e('0x93')]['SELECT'],'raw':!![]};var _0x5a65c8=_0xefd231[_0x999e('0x94')]();_0x5a65c8[_0x999e('0x54')](_0x999e('0x92'));_0x5a65c8[_0x999e('0x54')](_0x999e('0x95'),_0x999e('0x6c'));if(_0xc89b1['order']){_0xc89b1[_0x999e('0x96')]['forEach'](function(_0x302161){var _0x1f39c0=_0x302161[0x0]===_0x999e('0x97')?_0x302161[0x0]:'i.'+_0x302161[0x0];_0xefd231['order'](_0x1f39c0,_0x302161[0x1]===_0x999e('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x2ce0b3)){_0xefd231[_0x999e('0x6e')](_0x25f6a6);_0x5a65c8[_0x999e('0x50')](_0x999e('0x99'),_0x2ce0b3);}BPromise[_0x999e('0x9a')]()[_0x999e('0x2c')](function(){if(!_0x53cfbc){if(_0x5a7366['query']['ChatWebsiteId'])return;_0x5a65c8[_0x999e('0x50')](_0x999e('0x9b'));_0xefd231[_0x999e('0x50')](_0x999e('0x9b'));return;}if(_0x5a7366[_0x999e('0x9c')][_0x999e('0x9d')]!==_0x999e('0x9e'))return;return _0x5a7366[_0x999e('0x9c')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x999e('0x2c')](function(_0xaed39c){if(_[_0x999e('0x7e')](_0xaed39c)){_0x5a65c8[_0x999e('0x50')](_0x999e('0x9f'));_0xefd231[_0x999e('0x50')](_0x999e('0x9f'));}else{_0x5a65c8[_0x999e('0x50')]('i.ChatWebsiteId\x20IN\x20?',_[_0x999e('0x42')](_0xaed39c,'id'));_0xefd231[_0x999e('0x50')](_0x999e('0x81'),_[_0x999e('0x42')](_0xaed39c,'id'));}});})[_0x999e('0x2c')](function(){if(_0x5a7366[_0x999e('0x9c')][_0x999e('0x9d')]===_0x999e('0x9e')&&!_0x53cfbc&&!_0x5a7366['query'][_0x999e('0x80')])return[];return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x5a65c8['toString'](),_0x43043a);})[_0x999e('0x2c')](function(_0x3edea2){_0x5e50f5[_0x999e('0x28')]=_0x3edea2[_0x999e('0x4c')];if(_0x5e50f5[_0x999e('0x28')]===0x0)return[];return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x428842[_0x999e('0xa1')](),_0x43043a)[_0x999e('0x2c')](function(_0x4ee1d4){_0x334d19=_[_0x999e('0xa2')](_0x4ee1d4,'id');_0x43043a=_[_0x999e('0x31')](_0x43043a,{'model':db[_0x999e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a7366['query']['fields']){_0xc89b1[_0x999e('0x4a')][_0x999e('0x7f')](function(_0x421f60){_0xefd231['field']('i.'+_0x421f60);});}else{_0xefd231[_0x999e('0x54')](_0x999e('0x95'),_0x999e('0x6c'));_0xefd231['field'](_0x999e('0xa3'),_0x999e('0xa4'));_0xefd231['field'](_0x999e('0xa5'),'Account.mandatoryDisposition');_0xefd231['field'](_0x999e('0xa6'),_0x999e('0x97'));_0xefd231[_0x999e('0x54')](_0x999e('0xa7'));_0xefd231['field'](_0x999e('0xa8'),_0x999e('0xa9'));_0xefd231[_0x999e('0x54')](_0x999e('0xaa'),_0x999e('0xab'));_0xefd231['field'](_0x999e('0xac'),_0x999e('0xad'));_0xefd231[_0x999e('0x54')]('c.phone',_0x999e('0xae'));_0xefd231[_0x999e('0x54')](_0x999e('0xaf'),_0x999e('0xb0'));_0xefd231[_0x999e('0x54')](_0x999e('0xb1'),_0x999e('0xb2'));_0xefd231[_0x999e('0x54')]('o.fullname',_0x999e('0xb3'));_0xefd231[_0x999e('0x54')](_0x999e('0xb4'),_0x999e('0xb5'));_0xefd231['field'](_0x999e('0xb6'),_0x999e('0x39'));}if(_0xc89b1[_0x999e('0x27')])_0xefd231[_0x999e('0x27')](_0xc89b1[_0x999e('0x27')]);if(_0xc89b1['offset'])_0xefd231[_0x999e('0x25')](_0xc89b1[_0x999e('0x25')]);return db[_0x999e('0xa0')][_0x999e('0x4e')](_0xefd231[_0x999e('0xa1')](),_0x43043a);})[_0x999e('0x2c')](function(_0x5ca126){if(_0x5ca126['length']>0x0)_0x392324[_0x999e('0x50')](_0x999e('0xb7'),_['map'](_0x5ca126,'id'));return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x392324['toString'](),_0x43043a)[_0x999e('0x2c')](function(_0x230dd6){var _0x131123=_[_0x999e('0xb8')](_0x230dd6,_0x999e('0xb9'));var _0x5e2f44=[];_0x5ca126[_0x999e('0x7f')](function(_0x33edad){_0x5e2f44[_0x999e('0x38')](updateChatInteraction(_0x33edad,_0x334d19,_0x131123));});return BPromise[_0x999e('0xba')](_0x5e2f44);});});})[_0x999e('0x2c')](function(_0x9361d5){_0x5e50f5[_0x999e('0xbb')]=_0x9361d5;return _0x5e50f5;})['then'](respondWithFilteredResult(_0x4f904e,_0xc89b1))[_0x999e('0x21')](handleError(_0x4f904e,null));};exports['show']=function(_0x2dfa8d,_0xd93cfb){var _0x2c9520={'raw':![],'where':{'id':_0x2dfa8d[_0x999e('0xbc')]['id']}},_0x2bcab1={};_0x2bcab1[_0x999e('0x49')]=_[_0x999e('0x47')](db[_0x999e('0x43')][_0x999e('0xbd')]);_0x2bcab1['query']=_[_0x999e('0x47')](_0x2dfa8d['query']);_0x2bcab1[_0x999e('0x51')]=_['intersection'](_0x2bcab1[_0x999e('0x49')],_0x2bcab1['query']);_0x2c9520['attributes']=_[_0x999e('0x48')](_0x2bcab1[_0x999e('0x49')],qs['fields'](_0x2dfa8d['query'][_0x999e('0x4b')]));_0x2c9520[_0x999e('0x4a')]=_0x2c9520[_0x999e('0x4a')][_0x999e('0x4c')]?_0x2c9520[_0x999e('0x4a')]:_0x2bcab1['model'];if(_0x2dfa8d[_0x999e('0x4e')]['includeAll']){_0x2c9520[_0x999e('0xbe')]=[{'all':!![]}];}_0x2c9520=_[_0x999e('0x31')]({},_0x2c9520,_0x2dfa8d[_0x999e('0xbf')]);return db[_0x999e('0x43')]['find'](_0x2c9520)[_0x999e('0x2c')](handleEntityNotFound(_0xd93cfb,null))[_0x999e('0x2c')](respondWithResult(_0xd93cfb,null))[_0x999e('0x21')](handleError(_0xd93cfb,null));};exports[_0x999e('0xc0')]=function(_0xf51d13,_0x1304f2){return db[_0x999e('0x43')][_0x999e('0xc0')](_0xf51d13[_0x999e('0xc1')],{})['then'](respondWithResult(_0x1304f2,0xc9))[_0x999e('0x21')](handleError(_0x1304f2,null));};exports[_0x999e('0x2b')]=function(_0x2fd5cd,_0x39dfbc){if(_0x2fd5cd[_0x999e('0xc1')]['id']){delete _0x2fd5cd[_0x999e('0xc1')]['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x2fd5cd['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x39dfbc,null))['then'](saveUpdates(_0x2fd5cd[_0x999e('0xc1')],null))[_0x999e('0x2c')](respondWithResult(_0x39dfbc,null))['catch'](handleError(_0x39dfbc,null));};exports[_0x999e('0x2d')]=function(_0x1daa73,_0x27c5d9){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x1daa73['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x27c5d9,null))['then'](removeEntity(_0x27c5d9,null))['catch'](handleError(_0x27c5d9,null));};exports[_0x999e('0xc2')]=function(_0x16b8f4,_0x1a8269){return db['ChatInteraction'][_0x999e('0xc2')]()[_0x999e('0x2c')](respondWithResult(_0x1a8269,null))[_0x999e('0x21')](handleError(_0x1a8269,null));};exports[_0x999e('0xc3')]=function(_0x28a9fe,_0x191506){var _0x392488=_0x28a9fe['params']['id'];var _0xe325ef;var _0x3bacb4;var _0x5e0400;return db[_0x999e('0x43')]['findOne']({'where':{'id':_0x392488}})[_0x999e('0x2c')](function(_0xc1a8ce){_0xe325ef=_0xc1a8ce;return db['ChatWebsite']['findOne']({'where':{'id':_0xc1a8ce['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0x999e('0xc4'),_0x999e('0xc5')],'raw':!![]});})[_0x999e('0x2c')](function(_0x1b1716){if(_0x1b1716&&_0x1b1716[_0x999e('0xc6')]&&_0x1b1716[_0x999e('0xc7')]){_0x3bacb4=_0x1b1716;var _0xf8fb4={'interaction':{'id':_0x392488},'agent':{'id':_0x28a9fe[_0x999e('0x9c')]['id'],'name':_0x28a9fe[_0x999e('0x9c')][_0x999e('0x2f')],'fullname':_0x28a9fe['user'][_0x999e('0x35')],'email':_0x28a9fe[_0x999e('0x9c')][_0x999e('0xc8')]},'contact':_0x28a9fe[_0x999e('0xc1')][_0x999e('0xc9')],'account':_0x28a9fe[_0x999e('0xc1')][_0x999e('0x33')]};var _0x2b9b50={'rejectUnauthorized':![],'method':_0x999e('0xca'),'url':_0x999e('0xcb'),'headers':{'X-APIKEY':_0x1b1716[_0x999e('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x28a9fe[_0x999e('0x9c')][_0x999e('0xc8')]],'buttons':null,'topic':_0x3bacb4[_0x999e('0xcc')],'note':_[_0x999e('0xcd')](_0x3bacb4[_0x999e('0xc4')])?null:getMustacheRender(_0x3bacb4['vidaooNote'],_0xf8fb4),'metadata':null},'redirect':_0x999e('0xce'),'json':!![]};try{if(!_['isNull'](_0x3bacb4['vidaooMetadata'])){var _0x20812f=getMustacheRender(_0x3bacb4['vidaooMetadata'],_0xf8fb4);var _0x459142=JSON['parse'](_0x20812f);_0x2b9b50[_0x999e('0xc1')]['metadata']=_0x459142;}}catch(_0x13caa5){throw new db['Sequelize'][(_0x999e('0xcf'))](_0x999e('0xd0'));}return rp(_0x2b9b50);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x999e('0x2c')](function(_0x2b8609){_0x5e0400=_0x2b8609;if(_0x5e0400['id']){var _0x1c324d={'body':_0x5e0400['join_url'],'ChatWebsiteId':_0x3bacb4['id'],'ChatInteractionId':_0xe325ef['id'],'direction':'out','UserId':_0x28a9fe[_0x999e('0x9c')]['id']};return db['ChatMessage'][_0x999e('0xc0')](_0x1c324d,{});}else{throw new db[(_0x999e('0xd1'))][(_0x999e('0xcf'))](_0x999e('0xd2'));}})[_0x999e('0x2c')](function(){return _0xe325ef[_0x999e('0xd3')]({'vidaooSessionId':_0x5e0400['id']});})[_0x999e('0x2c')](respondWithResult(_0x191506,null))[_0x999e('0x21')](handleError(_0x191506,null));};exports[_0x999e('0xd4')]=function(_0x2034f3,_0x4b9ec3){if(_0x2034f3[_0x999e('0xc1')]['id']){delete _0x2034f3['body']['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x2034f3['params']['id']},'include':[{'model':db[_0x999e('0xd5')],'as':_0x999e('0x70')}]})[_0x999e('0x2c')](handleEntityNotFound(_0x4b9ec3,null))[_0x999e('0x2c')](saveUpdates(_0x2034f3['body'],null))[_0x999e('0x2c')](respondWithResult(_0x4b9ec3,null))[_0x999e('0x21')](handleError(_0x4b9ec3,null));};exports[_0x999e('0xd6')]=function(_0x457f07,_0x4da13d){if(_0x457f07['body']['id']){delete _0x457f07[_0x999e('0xc1')]['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x457f07[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](function(_0x2e9dd0){if(!_0x2e9dd0){logger['error'](_0x999e('0xd7'),_0x999e('0xd6'),0x194,'entity\x20not\x20found');_0x4da13d['sendStatus'](0x194);}else{if(_0x2e9dd0[_0x999e('0x40')]){throw new db[(_0x999e('0xd1'))][(_0x999e('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x2e9dd0;})[_0x999e('0x2c')](function(_0x1c1a62){if(_0x1c1a62){return _0x1c1a62[_0x999e('0x2b')]({'closed':_0x457f07[_0x999e('0xc1')]['closed'],'disposition':_0x457f07[_0x999e('0xc1')][_0x999e('0x41')]})[_0x999e('0x2c')](function(_0x5a04d3){return _0x5a04d3;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x999e('0xd6'),_0x457f07['body'],client9004);})[_0x999e('0x2c')](respondWithResult(_0x4da13d,null))[_0x999e('0x21')](handleError(_0x4da13d,null));};exports[_0x999e('0xd8')]=function(_0x27978d,_0x31c0c3){_0x27978d[_0x999e('0xc1')][_0x999e('0x2f')]=_0x27978d[_0x999e('0xd9')]['originalname'];_0x27978d['body'][_0x999e('0xda')]=_0x27978d[_0x999e('0xd9')]['filename'];_0x27978d[_0x999e('0xc1')]['type']=_0x27978d['file'][_0x999e('0xdb')];return db[_0x999e('0xdc')][_0x999e('0xc0')](_0x27978d[_0x999e('0xc1')])[_0x999e('0x2c')](respondWithResult(_0x31c0c3,0xc9))[_0x999e('0x21')](handleError(_0x31c0c3,null));};exports[_0x999e('0xdd')]=function(_0x3131a2,_0x31fa6c){return db[_0x999e('0x43')][_0x999e('0xde')]({'where':{'id':_0x3131a2['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x31fa6c,null))[_0x999e('0x2c')](function(_0x41b122){if(_0x41b122){if(_0x41b122['closed']){return _0x31fa6c[_0x999e('0x23')](0x193)['json']({'status':0x193,'message':_0x999e('0xdf')});}return db[_0x999e('0xdc')][_0x999e('0xde')]({'where':{'id':_0x3131a2['query'][_0x999e('0xe0')]},'raw':!![]})[_0x999e('0x2c')](handleEntityNotFound(_0x31fa6c,null));}})[_0x999e('0x2c')](function(_0x1b0128){if(_0x1b0128){var _0x10ea96=_0x1b0128['ChatOfflineMessageId']!==null;var _0x5d0f54=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0xe3'));if(_0x10ea96){_0x5d0f54=path[_0x999e('0xe1')](_0x5d0f54,_0x999e('0xe4'));}var _0xc91cf5=path[_0x999e('0xe1')](_0x5d0f54,_0x1b0128[_0x999e('0xda')]);return _0x31fa6c['download'](_0xc91cf5);}})[_0x999e('0x21')](handleError(_0x31fa6c,null));};exports[_0x999e('0xe5')]=function(_0x3cf88d,_0x31ff46){var _0x24bfd1=null;var _0x1a2a5e=null;var _0x57529d=null;if(_0x3cf88d['body']['id']){delete _0x3cf88d[_0x999e('0xc1')]['id'];}if(_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')]){_0x57529d=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0xe7'),util[_0x999e('0xe8')](_0x999e('0xe9'),Date[_0x999e('0xea')]()));_0x3cf88d[_0x999e('0xc1')][_0x999e('0xeb')]=_0x57529d;}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x3cf88d['params']['id']},'include':[{'model':db[_0x999e('0xec')],'as':_0x999e('0xed'),'include':[{'model':db['User'],'as':_0x999e('0x78')}]}]})[_0x999e('0x2c')](handleEntityNotFound(_0x31ff46,null))[_0x999e('0x2c')](saveUpdates(_0x3cf88d[_0x999e('0xc1')],null))[_0x999e('0x2c')](function(_0x2f793c){if(_0x2f793c){_0x24bfd1=_0x2f793c;return db[_0x999e('0xee')][_0x999e('0x6b')]({'where':{'id':_0x24bfd1['ChatWebsiteId']}});}})[_0x999e('0x2c')](function(_0x459bbe){if(_0x459bbe){_0x1a2a5e=_0x459bbe;return db['CmContact'][_0x999e('0x6b')]({'where':{'id':_0x24bfd1[_0x999e('0x74')]}});}})[_0x999e('0x2c')](function(_0x2091a3){if(_0x2091a3){if(_0x57529d){var _0x5c51f9=null;for(var _0x572d81=0x1;_0x572d81<_0x24bfd1[_0x999e('0xed')][_0x999e('0x4c')];++_0x572d81){_0x5c51f9=_0x24bfd1[_0x999e('0xed')][_0x572d81];var _0x298c2c=_0x5c51f9['UserId']?util['format'](_0x999e('0xef'),_0x1a2a5e['agentAlias'],_0x5c51f9['UserId']):_0x999e('0xf0');var _0x53d3f1=_0x3cf88d['body'][_0x999e('0xf1')]||util['format'](_0x999e('0xef'),_0x999e('0xf2'),_0x5c51f9[_0x999e('0x74')]);switch(_0x1a2a5e[_0x999e('0xf3')]){case _0x999e('0xf4'):_0x298c2c=_0x5c51f9['UserId']?util[_0x999e('0xe8')]('%s%d',_0x1a2a5e[_0x999e('0xf5')],_0x5c51f9[_0x999e('0x40')]):_0x999e('0xf0');break;case _0x999e('0xf6'):_0x298c2c=_0x5c51f9[_0x999e('0x40')]?_0x5c51f9[_0x999e('0x78')]['alias']||_0x5c51f9[_0x999e('0x78')][_0x999e('0x35')]:_0x999e('0xf0');break;case _0x999e('0xf7'):_0x298c2c=_0x5c51f9[_0x999e('0x40')]?_0x5c51f9[_0x999e('0x78')]['fullname']:_0x999e('0xf0');break;default:_0x298c2c=_0x5c51f9[_0x999e('0x40')]?util['format'](_0x999e('0xef'),_0x1a2a5e[_0x999e('0xf5')],_0x5c51f9[_0x999e('0x40')]):'System';}var _0x18b2aa=util[_0x999e('0xe8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x5c51f9['createdAt'])[_0x999e('0xe8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x5c51f9[_0x999e('0xf8')]==='in'?_0x53d3f1:_0x298c2c,_0x5c51f9[_0x999e('0xc1')]);if(!_0x5c51f9[_0x999e('0xf9')]){fs[_0x999e('0xfa')](_0x57529d,_0x18b2aa);}}return db[_0x999e('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x999e('0xfc'),'raw':!![],'include':[{'model':db[_0x999e('0xfd')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x999e('0x2c')](function(_0x2e9c95){if(!_0x2e9c95||!_0x2e9c95['Smtp']||!_0x3cf88d[_0x999e('0xc1')])return _0x24bfd1;var _0x4cf199=_0x2e9c95['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x999e('0xfe'),{'account':_0x4cf199,'message':{'from':util[_0x999e('0xe8')]('\x22%s\x22\x20<%s>',_0x2e9c95['name'],_0x2e9c95['email']||_0x2e9c95[_0x999e('0xfc')]['user']),'to':_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')],'subject':_0x999e('0xff'),'text':util[_0x999e('0xe8')](_0x999e('0x100'),_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')]),'attachments':[{'path':_0x57529d}]}})[_0x999e('0x2c')](function(){return _0x24bfd1;})['catch'](function(_0x4a32f7){logger[_0x999e('0x1c')](_0x4a32f7);});})[_0x999e('0x2c')](respondWithStatusCode(_0x31ff46,0xc8))[_0x999e('0x21')](handleError(_0x31ff46,null));};exports[_0x999e('0x101')]=function(_0x55b0e5,_0x516a01){return db[_0x999e('0xec')][_0x999e('0x6b')]({'where':{'id':_0x55b0e5[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x516a01,null))[_0x999e('0x2c')](function(_0x51966e){if(_0x51966e){return _0x51966e[_0x999e('0x101')](_0x55b0e5[_0x999e('0xc1')][_0x999e('0x102')],_['omit'](_0x55b0e5[_0x999e('0xc1')],[_0x999e('0x102'),'id'])||{});}})['then'](respondWithResult(_0x516a01,null))['catch'](handleError(_0x516a01,null));};exports[_0x999e('0x103')]=function(_0x51bffa,_0x542b39){var _0x237a69={'raw':![],'where':{}};var _0x3729e1={};var _0x4f1e06={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x51bffa['params']['id']}})['then'](handleEntityNotFound(_0x542b39,null))['then'](function(_0xd62f58){if(_0xd62f58){_0x3729e1[_0x999e('0x49')]=_[_0x999e('0x47')](db['ChatMessage'][_0x999e('0xbd')]);_0x3729e1[_0x999e('0x4e')]=_[_0x999e('0x47')](_0x51bffa['query']);_0x3729e1[_0x999e('0x51')]=_[_0x999e('0x48')](_0x3729e1[_0x999e('0x49')],_0x3729e1[_0x999e('0x4e')]);_0x237a69[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x3729e1['model'],qs[_0x999e('0x4b')](_0x51bffa['query'][_0x999e('0x4b')]));_0x237a69[_0x999e('0x4a')]=_0x237a69[_0x999e('0x4a')][_0x999e('0x4c')]?_0x237a69[_0x999e('0x4a')]:_0x3729e1[_0x999e('0x49')];if(!_0x51bffa['query'][_0x999e('0x4d')](_0x999e('0x104'))){_0x237a69['limit']=qs[_0x999e('0x27')](_0x51bffa['query']['limit']);_0x237a69[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x51bffa[_0x999e('0x4e')]['offset']);}_0x237a69['order']=qs[_0x999e('0x4f')](_0x51bffa[_0x999e('0x4e')][_0x999e('0x4f')]);_0x237a69[_0x999e('0x50')]=qs[_0x999e('0x51')](_['pick'](_0x51bffa[_0x999e('0x4e')],_0x3729e1[_0x999e('0x51')]));_0x237a69[_0x999e('0x50')][_0x999e('0xb9')]=_0xd62f58['id'];if(_0x51bffa[_0x999e('0x4e')]['filter']){_0x237a69[_0x999e('0x50')]=_[_0x999e('0x31')](_0x237a69[_0x999e('0x50')],{'$or':_[_0x999e('0x42')](_0x237a69['attributes'],function(_0x1dcd99){var _0x4a4cae={};_0x4a4cae[_0x1dcd99]={'$like':'%'+_0x51bffa[_0x999e('0x4e')][_0x999e('0x8d')]+'%'};return _0x4a4cae;})});}if(_0x51bffa['query']['$gte']){var _0x2c7f82=_0x51bffa[_0x999e('0x4e')][_0x999e('0x82')][_0x999e('0x37')](',');var _0x118c1e={};_0x118c1e[_0x2c7f82[0x0]]={'$gte':moment(_0x2c7f82[0x1])['format'](_0x999e('0x105'))};_0x237a69[_0x999e('0x50')]=_[_0x999e('0x31')](_0x237a69['where'],_0x118c1e);}_0x237a69=_[_0x999e('0x31')]({},_0x237a69,_0x51bffa['options']);return db[_0x999e('0xec')][_0x999e('0x28')]({'where':_0x237a69[_0x999e('0x50')]})[_0x999e('0x2c')](function(_0x597a35){_0x4f1e06['count']=_0x597a35;if(_0x51bffa[_0x999e('0x4e')][_0x999e('0x106')]){_0x237a69[_0x999e('0xbe')]=[{'all':!![]}];}return db[_0x999e('0xec')][_0x999e('0x107')](_0x237a69);})[_0x999e('0x2c')](function(_0x139487){_0x4f1e06['rows']=_0x139487;return _0x4f1e06;});}})[_0x999e('0x2c')](respondWithFilteredResult(_0x542b39,_0x237a69))['catch'](handleError(_0x542b39,null));};exports['getMyMessages']=function(_0x10d312,_0x1f19d0){var _0xf9a5ff={'where':{}},_0x3163f1={},_0x377931={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x999e('0xde')]({'where':{'id':_0x10d312[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x1f19d0,null))[_0x999e('0x2c')](function(_0x4f8e5c){if(_0x4f8e5c){_0x3163f1[_0x999e('0x49')]=_[_0x999e('0x47')](db[_0x999e('0xec')]['rawAttributes']);_0x3163f1[_0x999e('0x4e')]=_[_0x999e('0x47')](_0x10d312[_0x999e('0x4e')]);_0x3163f1[_0x999e('0x51')]=_['intersection'](_0x3163f1[_0x999e('0x49')],_0x3163f1[_0x999e('0x4e')]);_0xf9a5ff[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x3163f1[_0x999e('0x49')],qs[_0x999e('0x4b')](_0x10d312[_0x999e('0x4e')][_0x999e('0x4b')]));_0xf9a5ff['attributes']=_0xf9a5ff[_0x999e('0x4a')]['length']?_0xf9a5ff['attributes']:_0x3163f1[_0x999e('0x49')];if(!_0x10d312[_0x999e('0x4e')][_0x999e('0x4d')](_0x999e('0x104'))){_0xf9a5ff['limit']=qs[_0x999e('0x27')](_0x10d312[_0x999e('0x4e')]['limit']);_0xf9a5ff[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x10d312[_0x999e('0x4e')][_0x999e('0x25')]);}_0xf9a5ff[_0x999e('0x96')]=qs['sort'](_0x10d312[_0x999e('0x4e')]['sort']);_0xf9a5ff[_0x999e('0x50')]=qs[_0x999e('0x51')](_[_0x999e('0x52')](_0x10d312[_0x999e('0x4e')],_0x3163f1[_0x999e('0x51')]));_0xf9a5ff[_0x999e('0x50')][_0x999e('0xb9')]=_0x4f8e5c['id'];if(_0x10d312[_0x999e('0x4e')]['filter']){_0xf9a5ff[_0x999e('0x50')]=_[_0x999e('0x31')](_0xf9a5ff['where'],{'$or':_[_0x999e('0x42')](_0xf9a5ff['attributes'],function(_0x1db16c){var _0x4c6fad={};_0x4c6fad[_0x1db16c]={'$like':'%'+_0x10d312['query'][_0x999e('0x8d')]+'%'};return _0x4c6fad;})});}_0xf9a5ff[_0x999e('0x50')]['secret']=![];if(_0x10d312[_0x999e('0x4e')]['id']){_0xf9a5ff[_0x999e('0x50')]['id']={'$gt':_0x10d312[_0x999e('0x4e')]['id']};}_0xf9a5ff=_[_0x999e('0x31')]({},_0xf9a5ff,_0x10d312[_0x999e('0xbf')]);return db[_0x999e('0xec')][_0x999e('0x28')]({'where':_0xf9a5ff[_0x999e('0x50')]})['then'](function(_0x1a5fc2){_0x377931[_0x999e('0x28')]=_0x1a5fc2;_0xf9a5ff['include']=[];if(_0x10d312['query'][_0x999e('0x108')]){_0xf9a5ff['include'][_0x999e('0x38')]({'model':db[_0x999e('0x78')],'as':_0x999e('0x78'),'attributes':['id',_0x999e('0x35'),'alias']});}if(_0x10d312['query'][_0x999e('0x106')]){_0xf9a5ff[_0x999e('0xbe')]=[{'all':!![]}];}return db[_0x999e('0xec')][_0x999e('0x107')](_0xf9a5ff);})[_0x999e('0x2c')](function(_0x359277){_0x377931[_0x999e('0xbb')]=_0x359277;return _0x377931;});}})[_0x999e('0x2c')](respondWithFilteredResult(_0x1f19d0,_0xf9a5ff))['catch'](handleError(_0x1f19d0,null));};exports[_0x999e('0x109')]=function(_0x16323c,_0x4da0bc){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x16323c['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x4da0bc,null))[_0x999e('0x2c')](function(_0x2707dc){if(_0x2707dc){return _0x2707dc[_0x999e('0x10a')](_0x16323c['body'][_0x999e('0x102')],_['omit'](_0x16323c[_0x999e('0xc1')],[_0x999e('0x102'),'id'])||{})[_0x999e('0x10b')](function(){return db['Tag']['findAll']({'attributes':['id',_0x999e('0x2f'),_0x999e('0x55')],'where':{'id':_0x16323c['body'][_0x999e('0x102')]}});})[_0x999e('0x2c')](function(_0x392d35){socket[_0x999e('0x10c')]('chatInteractionTags:save',{'id':Number(_0x16323c[_0x999e('0xbc')]['id']),'tags':_0x392d35||[]});return{'id':Number(_0x16323c['params']['id']),'tags':_0x392d35||[]};});}})[_0x999e('0x2c')](respondWithResult(_0x4da0bc,null))[_0x999e('0x21')](handleError(_0x4da0bc,null));};exports[_0x999e('0x10d')]=function(_0x3a63f5,_0x201add){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x3a63f5[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x201add,null))['then'](function(_0x563457){if(_0x563457){return _0x563457['removeTags'](_0x3a63f5['query']['ids']);}})[_0x999e('0x2c')](respondWithStatusCode(_0x201add,null))[_0x999e('0x21')](handleError(_0x201add,null));};exports[_0x999e('0x10e')]=function(_0x35c0e4,_0x49af7d){var _0x49ce92=moment()[_0x999e('0x10f')]()[_0x999e('0xa1')]();var _0x21ecc2=path['join'](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x111'),_0x999e('0x112'));var _0x3c0a39=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x111'),_0x999e('0x113'));var _0x375777=path[_0x999e('0xe1')](_0x21ecc2,_0x49ce92);var _0x34323f=util[_0x999e('0xe8')]('transcript-%d-%s.zip',_0x35c0e4[_0x999e('0xbc')]['id'],_0x49ce92);var _0x527d6d=path[_0x999e('0xe1')](_0x21ecc2,_0x34323f);var _0x2b3e01=[];_0x2b3e01[_0x999e('0x38')]({'model':db['User'],'as':_0x999e('0x78'),'attributes':['id',_0x999e('0x35')],'raw':!![]});_0x2b3e01[_0x999e('0x38')]({'model':db[_0x999e('0xd5')],'as':_0x999e('0x70'),'attributes':['id','firstName',_0x999e('0x114')],'raw':!![]});if(_0x35c0e4[_0x999e('0x4e')][_0x999e('0x113')]){_0x2b3e01[_0x999e('0x38')]({'model':db[_0x999e('0xdc')],'as':_0x999e('0xdc'),'raw':!![]});}var _0x1c7b1e=[{'model':db['ChatMessage'],'as':_0x999e('0xed'),'attributes':['id',_0x999e('0xc1'),_0x999e('0x115'),_0x999e('0xf8'),_0x999e('0xf9'),_0x999e('0x88')],'include':_0x2b3e01}];_0x1c7b1e['push']({'model':db['ChatWebsite'],'as':_0x999e('0x116'),'attributes':['id','name']});_0x1c7b1e[_0x999e('0x38')]({'model':db[_0x999e('0x78')],'as':_0x999e('0x117'),'attributes':['id',_0x999e('0x35')]});return db['ChatInteraction'][_0x999e('0x6b')]({'where':{'id':_0x35c0e4['params']['id']},'include':_0x1c7b1e})[_0x999e('0x2c')](handleEntityNotFound(_0x49af7d,null))[_0x999e('0x2c')](function(_0x2d29ee){if(_0x2d29ee){var _0x14350e=_0x2d29ee[_0x999e('0x118')]({'plain':!![]});fs[_0x999e('0x119')](_0x375777);var _0x256c4c={'channel':_0x999e('0x11a'),'account':_0x14350e[_0x999e('0x116')][_0x999e('0x2f')],'agent':_0x14350e[_0x999e('0x117')]?_0x14350e[_0x999e('0x117')][_0x999e('0x35')]:_0x999e('0x11b'),'createdAt':moment(_0x14350e[_0x999e('0x115')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x14350e[_0x999e('0x3f')]?moment(_0x14350e[_0x999e('0x11c')])[_0x999e('0xe8')](_0x999e('0x105'))[_0x999e('0xa1')]():'','disposition':_0x14350e['disposition'],'chatInfo':{'browser':_0x14350e[_0x999e('0x11d')],'os':_0x14350e[_0x999e('0x11e')],'referer':_0x14350e[_0x999e('0x11f')],'customerIp':_0x14350e[_0x999e('0x120')],'customerPort':_0x14350e[_0x999e('0x121')]?_0x14350e[_0x999e('0x121')]:_0x999e('0x11b')},'messages':_(_0x14350e[_0x999e('0xed')])[_0x999e('0x122')]()[_0x999e('0x8d')]({'secret':![]})['map'](function(_0x2ec1e4){if(_0x2ec1e4[_0x999e('0xdc')]){var _0x5b7284=path[_0x999e('0xe1')](_0x3c0a39,_0x2ec1e4[_0x999e('0xdc')][_0x999e('0xda')]);if(fs[_0x999e('0x123')](_0x5b7284)){fs['createReadStream'](_0x5b7284)['pipe'](fs[_0x999e('0x124')](path['join'](_0x375777,_0x2ec1e4['Attachment']['basename'])));}}return{'date':moment(_0x2ec1e4[_0x999e('0x115')])[_0x999e('0xe8')](_0x999e('0x105'))[_0x999e('0xa1')](),'sender':_0x2ec1e4['direction']==='out'?_0x2ec1e4[_0x999e('0x78')]?_0x2ec1e4[_0x999e('0x78')]['fullname']:_0x999e('0xf0'):_0x2ec1e4['Contact']['firstName']+(_0x2ec1e4[_0x999e('0x70')][_0x999e('0x114')]?'\x20'+_0x2ec1e4[_0x999e('0x70')]['lastName']:''),'body':_0x2ec1e4[_0x999e('0xdc')]?_0x2ec1e4[_0x999e('0xdc')]['basename']:_0x2ec1e4[_0x999e('0xc1')],'direction':_0x2ec1e4['direction']===_0x999e('0x125')?'A':'C','secret':_0x2ec1e4['secret'],'read':_0x2ec1e4[_0x999e('0x88')],'attachment':_0x2ec1e4[_0x999e('0xdc')]};})[_0x999e('0x6d')]()};return ejs[_0x999e('0x126')](path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x127'),_0x999e('0x128')),{'interaction':_0x256c4c})[_0x999e('0x2c')](function(_0x17fff9){var _0x33763d=path[_0x999e('0xe1')](_0x375777,_0x999e('0x129')+_0x14350e['id']+'-'+_0x49ce92+_0x999e('0x12a'));var _0x29aeb7={'path':_0x33763d,'channel':'Chat','interactionId':_0x14350e['id']};return pdf[_0x999e('0x12b')](_0x17fff9,_0x29aeb7);})[_0x999e('0x2c')](function(){return new Promise(function(_0x1bebaf,_0x3cf4aa){zipdir(_0x375777,{'saveTo':_0x527d6d},function(_0x3141f3,_0x2c56b5){if(_0x3141f3)return _0x3cf4aa(_0x3141f3);return _0x1bebaf(_0x2c56b5);});})[_0x999e('0x2c')](function(){return new BPromise(function(_0x27eb61,_0x5a2902){rimraf(_0x375777,function(_0x5ec0a5){if(_0x5ec0a5)_0x5a2902(_0x5ec0a5);return _0x27eb61();});});})[_0x999e('0x2c')](function(){return _0x49af7d['download'](_0x527d6d,_0x34323f,function(_0x38b97e){if(_0x38b97e){logger[_0x999e('0x1c')](_0x999e('0x12c'),_0x38b97e);}else{fs['unlinkSync'](_0x527d6d);}});});});}else{return _0x49af7d['sendStatus'](0xc8);}})[_0x999e('0x21')](handleError(_0x49af7d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 90d6033..e32b5fc 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 _0x0fd8=['remove','getUsers','then','setDataValue','Users','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save'];(function(_0x40d4e6,_0x44f185){var _0x1eda0f=function(_0x1f687d){while(--_0x1f687d){_0x40d4e6['push'](_0x40d4e6['shift']());}};_0x1eda0f(++_0x44f185);}(_0x0fd8,0x1db));var _0x80fd=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x0fd8[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0x80fd('0x0'));var ChatInteraction=require(_0x80fd('0x1'))['db'][_0x80fd('0x2')];var ChatMessage=require(_0x80fd('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x80fd('0x3')](0x0);var events={'afterCreate':_0x80fd('0x4'),'afterUpdate':'update','afterDestroy':_0x80fd('0x5')};function emitEvent(_0x16b8cd){return function(_0x495f2f,_0x3e8d5f,_0x2f1535){_0x495f2f[_0x80fd('0x6')]({'attributes':['id'],'raw':!![]})[_0x80fd('0x7')](function(_0x4409e2){_0x495f2f[_0x80fd('0x8')](_0x80fd('0x9'),_0x4409e2['map'](function(_0xd444dc){return{'id':_0xd444dc['id']};}));return ChatMessage[_0x80fd('0xa')]({'where':{'ChatInteractionId':_0x495f2f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x80fd('0x7')](function(_0x515fac){_0x495f2f[_0x80fd('0x8')]('unreadMessages',_0x515fac['length']);ChatInteractionEvents[_0x80fd('0xb')](_0x16b8cd+':'+_0x495f2f['id'],_0x495f2f);ChatInteractionEvents[_0x80fd('0xb')](_0x16b8cd,_0x495f2f);_0x2f1535(null);})[_0x80fd('0xc')](_0x2f1535(null));};}for(var e in events){if(events[_0x80fd('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x80fd('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x0135=['then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','getUsers'];(function(_0x1e7066,_0x5da90c){var _0x58632d=function(_0x5cb9d8){while(--_0x5cb9d8){_0x1e7066['push'](_0x1e7066['shift']());}};_0x58632d(++_0x5da90c);}(_0x0135,0x81));var _0x5013=function(_0x31d68f,_0x36adaf){_0x31d68f=_0x31d68f-0x0;var _0x379f3a=_0x0135[_0x31d68f];return _0x379f3a;};'use strict';var EventEmitter=require(_0x5013('0x0'));var ChatInteraction=require(_0x5013('0x1'))['db'][_0x5013('0x2')];var ChatMessage=require(_0x5013('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5013('0x3')](0x0);var events={'afterCreate':_0x5013('0x4'),'afterUpdate':_0x5013('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f413d){return function(_0x1b2bb9,_0x12414f,_0x5c379d){_0x1b2bb9[_0x5013('0x6')]({'attributes':['id'],'raw':!![]})[_0x5013('0x7')](function(_0x1b1af1){_0x1b2bb9['setDataValue'](_0x5013('0x8'),_0x1b1af1[_0x5013('0x9')](function(_0x47ce73){return{'id':_0x47ce73['id']};}));return ChatMessage[_0x5013('0xa')]({'where':{'ChatInteractionId':_0x1b2bb9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5013('0x7')](function(_0x20f8bd){_0x1b2bb9['setDataValue'](_0x5013('0xb'),_0x20f8bd[_0x5013('0xc')]);ChatInteractionEvents[_0x5013('0xd')](_0x1f413d+':'+_0x1b2bb9['id'],_0x1b2bb9);ChatInteractionEvents[_0x5013('0xd')](_0x1f413d,_0x1b2bb9);_0x5c379d(null);})[_0x5013('0xe')](_0x5c379d(null));};}for(var e in events){if(events[_0x5013('0xf')](e)){var event=events[e];ChatInteraction[_0x5013('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ef6ba40..c4934d5 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 _0x5d90=['api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x5d90,0xec));var _0x05d9=function(_0x5e1b03,_0x851e75){_0x5e1b03=_0x5e1b03-0x0;var _0x580064=_0x5d90[_0x5e1b03];return _0x580064;};'use strict';var _=require('lodash');var util=require(_0x05d9('0x0'));var logger=require(_0x05d9('0x1'))(_0x05d9('0x2'));var moment=require(_0x05d9('0x3'));var BPromise=require('bluebird');var rp=require(_0x05d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05d9('0x5'));var config=require(_0x05d9('0x6'));var attributes=require(_0x05d9('0x7'));module[_0x05d9('0x8')]=function(_0x5cc7e0,_0x20dafa){return _0x5cc7e0['define'](_0x05d9('0x9'),attributes,{'tableName':_0x05d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22bca4,_0x5e5f88,_0x22af91){if(_0x22bca4[_0x05d9('0xb')](_0x05d9('0xc'))){_0x22bca4[_0x05d9('0xd')]=moment()[_0x05d9('0xe')](_0x05d9('0xf'));}_0x22af91(null,_0x22bca4);}},'charset':'utf8mb4','collate':_0x05d9('0x10')});}; \ No newline at end of file +var _0x4c6f=['api','path','rimraf','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x46e690,_0x385cec){var _0x2a0cf5=function(_0x23b0d4){while(--_0x23b0d4){_0x46e690['push'](_0x46e690['shift']());}};_0x2a0cf5(++_0x385cec);}(_0x4c6f,0x1bd));var _0xf4c6=function(_0x5bd1a9,_0x313714){_0x5bd1a9=_0x5bd1a9-0x0;var _0x2ba345=_0x4c6f[_0x5bd1a9];return _0x2ba345;};'use strict';var _=require(_0xf4c6('0x0'));var util=require(_0xf4c6('0x1'));var logger=require(_0xf4c6('0x2'))(_0xf4c6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4c6('0x4'));var rimraf=require(_0xf4c6('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x3447a0,_0x1bd481){return _0x3447a0[_0xf4c6('0x6')](_0xf4c6('0x7'),attributes,{'tableName':_0xf4c6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51fcfa,_0x124dac,_0x572ab5){if(_0x51fcfa[_0xf4c6('0x9')](_0xf4c6('0xa'))){_0x51fcfa[_0xf4c6('0xb')]=moment()[_0xf4c6('0xc')](_0xf4c6('0xd'));}_0x572ab5(null,_0x51fcfa);}},'charset':_0xf4c6('0xe'),'collate':_0xf4c6('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index b218e8c..42bcbdb 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 _0x57a6=['message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','limit','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x57a6,0x145));var _0x657a=function(_0x2c8bb5,_0x94e62e){_0x2c8bb5=_0x2c8bb5-0x0;var _0x3d0e5c=_0x57a6[_0x2c8bb5];return _0x3d0e5c;};'use strict';var _=require(_0x657a('0x0'));var util=require(_0x657a('0x1'));var moment=require('moment');var BPromise=require(_0x657a('0x2'));var rs=require(_0x657a('0x3'));var fs=require('fs');var Redis=require(_0x657a('0x4'));var db=require(_0x657a('0x5'))['db'];var utils=require(_0x657a('0x6'));var logger=require(_0x657a('0x7'))(_0x657a('0x8'));var config=require(_0x657a('0x9'));var jayson=require(_0x657a('0xa'));var client=jayson['client'][_0x657a('0xb')]({'port':0x232a});config[_0x657a('0xc')]=_[_0x657a('0xd')](config['redis'],{'host':_0x657a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x657a('0xf'))[_0x657a('0x10')](socket);function respondWithRpcPromise(_0x1e5687,_0x136389,_0x4073e2){return new BPromise(function(_0x2707e4,_0x4ffec4){return client[_0x657a('0x11')](_0x1e5687,_0x4073e2)[_0x657a('0x12')](function(_0x279d9e){logger[_0x657a('0x13')](_0x657a('0x14'),_0x136389,_0x657a('0x15'));logger[_0x657a('0x16')](_0x657a('0x17'),_0x136389,_0x657a('0x15'),JSON[_0x657a('0x18')](_0x279d9e));if(_0x279d9e[_0x657a('0x19')]){if(_0x279d9e[_0x657a('0x19')][_0x657a('0x1a')]===0x1f4){logger[_0x657a('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x136389,_0x279d9e[_0x657a('0x19')][_0x657a('0x1b')]);return _0x4ffec4(_0x279d9e[_0x657a('0x19')][_0x657a('0x1b')]);}logger[_0x657a('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x136389,_0x279d9e[_0x657a('0x19')][_0x657a('0x1b')]);return _0x2707e4(_0x279d9e['error'][_0x657a('0x1b')]);}else{logger[_0x657a('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x136389,'request\x20sent');_0x2707e4(_0x279d9e[_0x657a('0x1c')][_0x657a('0x1b')]);}})[_0x657a('0x1d')](function(_0x5a7b07){logger[_0x657a('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x136389,_0x5a7b07);_0x4ffec4(_0x5a7b07);});});}exports[_0x657a('0x1e')]=function(_0x288194){var _0x1dec98=this;return new Promise(function(_0x34130c,_0x4a93e3){return db[_0x657a('0x1f')][_0x657a('0x20')](_0x288194['body'],{'raw':_0x288194[_0x657a('0x21')]?_0x288194[_0x657a('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x288194['options']?_0x288194[_0x657a('0x21')][_0x657a('0x22')]||null:null,'attributes':_0x288194['options']?_0x288194[_0x657a('0x21')]['attributes']||null:null,'limit':_0x288194[_0x657a('0x21')]?_0x288194[_0x657a('0x21')][_0x657a('0x23')]||null:null})[_0x657a('0x12')](function(_0x172e39){logger[_0x657a('0x13')](_0x657a('0x1e'),_0x288194);logger[_0x657a('0x16')]('UpdateChatInteraction',_0x288194,JSON[_0x657a('0x18')](_0x172e39));_0x34130c(_0x172e39);})[_0x657a('0x1d')](function(_0x5beda8){logger['error'](_0x657a('0x1e'),_0x5beda8['message'],_0x288194);_0x4a93e3(_0x1dec98['error'](0x1f4,_0x5beda8[_0x657a('0x1b')]));});});};exports[_0x657a('0x24')]=function(_0x45bbbc){return new Promise(function(_0x1180fe,_0x42c79a){return db[_0x657a('0x1f')][_0x657a('0x25')]({'where':_0x45bbbc[_0x657a('0x21')]?_0x45bbbc[_0x657a('0x21')][_0x657a('0x22')]||null:null})[_0x657a('0x12')](function(_0x4cde06){if(_0x4cde06){return _0x4cde06[_0x657a('0x26')](_0x45bbbc[_0x657a('0x27')][_0x657a('0x28')],_[_0x657a('0x29')](_0x45bbbc[_0x657a('0x27')],[_0x657a('0x28'),'id'])||{});}})[_0x657a('0x2a')](function(_0x3aba96){logger[_0x657a('0x13')](_0x657a('0x2b'),_0x45bbbc);logger['debug'](_0x657a('0x2b'),_0x45bbbc,JSON[_0x657a('0x18')](_0x3aba96));_0x1180fe(_0x3aba96);})[_0x657a('0x1d')](function(_0x7c2204){logger[_0x657a('0x19')](_0x657a('0x2b'),_0x7c2204[_0x657a('0x1b')],_0x45bbbc);_0x42c79a(_this[_0x657a('0x19')](0x1f4,_0x7c2204[_0x657a('0x1b')]));});});}; \ No newline at end of file +var _0xf70c=['http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','UpdateChatInteraction','body','options','raw','where','attributes','limit','then','catch','AddTagsToChatInteraction','ChatInteraction','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1191b9,_0xc252f6){var _0x5a16d3=function(_0x54a0c1){while(--_0x54a0c1){_0x1191b9['push'](_0x1191b9['shift']());}};_0x5a16d3(++_0xc252f6);}(_0xf70c,0x146));var _0xcf70=function(_0x1432f,_0x5b5f34){_0x1432f=_0x1432f-0x0;var _0x14356e=_0xf70c[_0x1432f];return _0x14356e;};'use strict';var _=require(_0xcf70('0x0'));var util=require(_0xcf70('0x1'));var moment=require('moment');var BPromise=require(_0xcf70('0x2'));var rs=require(_0xcf70('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf70('0x4'))['db'];var utils=require(_0xcf70('0x5'));var logger=require(_0xcf70('0x6'))(_0xcf70('0x7'));var config=require('../../config/environment');var jayson=require(_0xcf70('0x8'));var client=jayson[_0xcf70('0x9')][_0xcf70('0xa')]({'port':0x232a});config[_0xcf70('0xb')]=_['defaults'](config[_0xcf70('0xb')],{'host':_0xcf70('0xc'),'port':0x18eb});var socket=require(_0xcf70('0xd'))(new Redis(config[_0xcf70('0xb')]));require(_0xcf70('0xe'))[_0xcf70('0xf')](socket);function respondWithRpcPromise(_0x43d19e,_0x7bd3bd,_0x1efb48){return new BPromise(function(_0x172b66,_0x748114){return client[_0xcf70('0x10')](_0x43d19e,_0x1efb48)['then'](function(_0x2e9691){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x7bd3bd,_0xcf70('0x11'));logger[_0xcf70('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x7bd3bd,_0xcf70('0x11'),JSON[_0xcf70('0x13')](_0x2e9691));if(_0x2e9691[_0xcf70('0x14')]){if(_0x2e9691[_0xcf70('0x14')][_0xcf70('0x15')]===0x1f4){logger['error'](_0xcf70('0x16'),_0x7bd3bd,_0x2e9691['error'][_0xcf70('0x17')]);return _0x748114(_0x2e9691['error'][_0xcf70('0x17')]);}logger['error'](_0xcf70('0x16'),_0x7bd3bd,_0x2e9691[_0xcf70('0x14')]['message']);return _0x172b66(_0x2e9691[_0xcf70('0x14')]['message']);}else{logger[_0xcf70('0x18')](_0xcf70('0x16'),_0x7bd3bd,'request\x20sent');_0x172b66(_0x2e9691[_0xcf70('0x19')][_0xcf70('0x17')]);}})['catch'](function(_0x570ab9){logger[_0xcf70('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x7bd3bd,_0x570ab9);_0x748114(_0x570ab9);});});}exports[_0xcf70('0x1a')]=function(_0x4192e0){var _0x378e52=this;return new Promise(function(_0x3f05c7,_0xcb69ac){return db['ChatInteraction']['update'](_0x4192e0[_0xcf70('0x1b')],{'raw':_0x4192e0['options']?_0x4192e0[_0xcf70('0x1c')][_0xcf70('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4192e0[_0xcf70('0x1c')]?_0x4192e0[_0xcf70('0x1c')][_0xcf70('0x1e')]||null:null,'attributes':_0x4192e0[_0xcf70('0x1c')]?_0x4192e0[_0xcf70('0x1c')][_0xcf70('0x1f')]||null:null,'limit':_0x4192e0[_0xcf70('0x1c')]?_0x4192e0[_0xcf70('0x1c')][_0xcf70('0x20')]||null:null})[_0xcf70('0x21')](function(_0x311480){logger[_0xcf70('0x18')]('UpdateChatInteraction',_0x4192e0);logger[_0xcf70('0x12')]('UpdateChatInteraction',_0x4192e0,JSON[_0xcf70('0x13')](_0x311480));_0x3f05c7(_0x311480);})[_0xcf70('0x22')](function(_0x26e3be){logger[_0xcf70('0x14')](_0xcf70('0x1a'),_0x26e3be[_0xcf70('0x17')],_0x4192e0);_0xcb69ac(_0x378e52[_0xcf70('0x14')](0x1f4,_0x26e3be[_0xcf70('0x17')]));});});};exports[_0xcf70('0x23')]=function(_0x271bc0){return new Promise(function(_0x1583b7,_0x221e08){return db[_0xcf70('0x24')]['find']({'where':_0x271bc0['options']?_0x271bc0[_0xcf70('0x1c')][_0xcf70('0x1e')]||null:null})[_0xcf70('0x21')](function(_0x82ad6e){if(_0x82ad6e){return _0x82ad6e[_0xcf70('0x25')](_0x271bc0[_0xcf70('0x1b')]['ids'],_[_0xcf70('0x26')](_0x271bc0['body'],[_0xcf70('0x27'),'id'])||{});}})[_0xcf70('0x28')](function(_0x328c3e){logger['info'](_0xcf70('0x29'),_0x271bc0);logger['debug']('AddTags',_0x271bc0,JSON[_0xcf70('0x13')](_0x328c3e));_0x1583b7(_0x328c3e);})[_0xcf70('0x22')](function(_0x4c9df3){logger[_0xcf70('0x14')](_0xcf70('0x29'),_0x4c9df3['message'],_0x271bc0);_0x221e08(_this[_0xcf70('0x14')](0x1f4,_0x4c9df3[_0xcf70('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3ef471f..6a99b84 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 _0xda0b=['removeListener','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x5b9f0b,_0x1a21f9){var _0x47eaaf=function(_0xe2d336){while(--_0xe2d336){_0x5b9f0b['push'](_0x5b9f0b['shift']());}};_0x47eaaf(++_0x1a21f9);}(_0xda0b,0x18b));var _0xbda0=function(_0x1fc963,_0x526186){_0x1fc963=_0x1fc963-0x0;var _0x1019e6=_0xda0b[_0x1fc963];return _0x1019e6;};'use strict';var ChatInteractionEvents=require(_0xbda0('0x0'));var events=[_0xbda0('0x1'),_0xbda0('0x2'),_0xbda0('0x3')];function createListener(_0x328593,_0x449c49){return function(_0x4d2efc){_0x449c49[_0xbda0('0x4')](_0x328593,_0x4d2efc);};}function removeListener(_0x13b1c8,_0x2a20cf){return function(){ChatInteractionEvents[_0xbda0('0x5')](_0x13b1c8,_0x2a20cf);};}exports['register']=function(_0x43ae52){for(var _0x3550f3=0x0,_0xc90982=events[_0xbda0('0x6')];_0x3550f3<_0xc90982;_0x3550f3++){var _0x3dfe56=events[_0x3550f3];var _0x2d0c02=createListener(_0xbda0('0x7')+_0x3dfe56,_0x43ae52);ChatInteractionEvents['on'](_0x3dfe56,_0x2d0c02);}}; \ No newline at end of file +var _0x279c=['./chatInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x279c,0x111));var _0xc279=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x279c[_0x166d93];return _0xba708;};'use strict';var ChatInteractionEvents=require(_0xc279('0x0'));var events=[_0xc279('0x1'),'remove',_0xc279('0x2')];function createListener(_0x16218c,_0x3590c4){return function(_0x24c61d){_0x3590c4[_0xc279('0x3')](_0x16218c,_0x24c61d);};}function removeListener(_0x5f12a8,_0x13350c){return function(){ChatInteractionEvents[_0xc279('0x4')](_0x5f12a8,_0x13350c);};}exports[_0xc279('0x5')]=function(_0x3339bb){for(var _0x584628=0x0,_0x4ce659=events[_0xc279('0x6')];_0x584628<_0x4ce659;_0x584628++){var _0x2d59e4=events[_0x584628];var _0x349049=createListener('chatInteraction:'+_0x2d59e4,_0x3339bb);ChatInteractionEvents['on'](_0x2d59e4,_0x349049);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 055255e..bcaae86 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 _0xf77b=['/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','diskStorage','join','root','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:update','update','put'];(function(_0x1abac0,_0x1723c6){var _0x44effe=function(_0x4fbd9f){while(--_0x4fbd9f){_0x1abac0['push'](_0x1abac0['shift']());}};_0x44effe(++_0x1723c6);}(_0xf77b,0x72));var _0xbf77=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0xf77b[_0x152fe3];return _0xc5bb39;};'use strict';var multer=require('multer');var util=require(_0xbf77('0x0'));var path=require(_0xbf77('0x1'));var timeout=require(_0xbf77('0x2'));var express=require(_0xbf77('0x3'));var router=express[_0xbf77('0x4')]();var fs_extra=require(_0xbf77('0x5'));var auth=require(_0xbf77('0x6'));var interaction=require(_0xbf77('0x7'));var config=require(_0xbf77('0x8'));var controller=require('./chatInteraction.controller');router[_0xbf77('0x9')]('/',auth[_0xbf77('0xa')](),controller[_0xbf77('0xb')]);router[_0xbf77('0x9')](_0xbf77('0xc'),auth[_0xbf77('0xa')](),controller['describe']);router[_0xbf77('0x9')](_0xbf77('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xbf77('0xe')]);router[_0xbf77('0x9')](_0xbf77('0xf'),auth[_0xbf77('0x10')](),controller['attachmentDownload']);router[_0xbf77('0x9')](_0xbf77('0x11'),auth[_0xbf77('0xa')](),controller[_0xbf77('0x12')]);router[_0xbf77('0x9')](_0xbf77('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xbf77('0x14')]);router['get']('/:id/download',auth[_0xbf77('0xa')](),controller['download']);router[_0xbf77('0x15')]('/',auth['isAuthenticated'](),controller[_0xbf77('0x16')]);router['post'](_0xbf77('0x17'),auth[_0xbf77('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xbf77('0x18')]({'destination':function(_0x5c7e79,_0x199cf0,_0x20ed4d){_0x20ed4d(null,path[_0xbf77('0x19')](config[_0xbf77('0x1a')],'server/files/attachments/'));},'filename':function(_0x2eb795,_0x47e027,_0x173278){_0x173278(null,util['format'](_0xbf77('0x1b'),Date[_0xbf77('0x1c')](),_0x47e027[_0xbf77('0x1d')][_0xbf77('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbf77('0x15')](_0xbf77('0x1f'),upload[_0xbf77('0x20')](_0xbf77('0x21')),controller[_0xbf77('0x22')]);router[_0xbf77('0x15')](_0xbf77('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xbf77('0x23')]);router['post'](_0xbf77('0x24'),auth[_0xbf77('0xa')](),interaction[_0xbf77('0x25')]('chat','chatinteraction:addtags'),controller['addTags']);router['put'](_0xbf77('0xd'),auth[_0xbf77('0xa')](),interaction[_0xbf77('0x25')](_0xbf77('0x26'),_0xbf77('0x27')),controller[_0xbf77('0x28')]);router[_0xbf77('0x29')](_0xbf77('0x2a'),controller[_0xbf77('0x2b')]);router[_0xbf77('0x29')](_0xbf77('0x2c'),auth[_0xbf77('0x10')](),controller[_0xbf77('0x2d')]);router[_0xbf77('0x29')](_0xbf77('0x2e'),controller[_0xbf77('0x2f')]);router['delete'](_0xbf77('0xd'),auth[_0xbf77('0xa')](),interaction['tracked'](_0xbf77('0x26'),_0xbf77('0x30')),controller['destroy']);router[_0xbf77('0x31')](_0xbf77('0x24'),auth[_0xbf77('0xa')](),controller[_0xbf77('0x32')]);module[_0xbf77('0x33')]=router; \ No newline at end of file +var _0x82d2=['/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','update','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x4eb963,_0x21c7d1){var _0x28a20d=function(_0x4101e9){while(--_0x4101e9){_0x4eb963['push'](_0x4eb963['shift']());}};_0x28a20d(++_0x21c7d1);}(_0x82d2,0x1d3));var _0x282d=function(_0x564702,_0x2af34d){_0x564702=_0x564702-0x0;var _0x45369d=_0x82d2[_0x564702];return _0x45369d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x282d('0x0'));var timeout=require(_0x282d('0x1'));var express=require(_0x282d('0x2'));var router=express[_0x282d('0x3')]();var fs_extra=require(_0x282d('0x4'));var auth=require(_0x282d('0x5'));var interaction=require(_0x282d('0x6'));var config=require(_0x282d('0x7'));var controller=require('./chatInteraction.controller');router[_0x282d('0x8')]('/',auth[_0x282d('0x9')](),controller[_0x282d('0xa')]);router[_0x282d('0x8')](_0x282d('0xb'),auth['isAuthenticated'](),controller[_0x282d('0xc')]);router['get'](_0x282d('0xd'),auth[_0x282d('0xe')](),controller['show']);router['get'](_0x282d('0xf'),auth[_0x282d('0xe')](),controller['attachmentDownload']);router[_0x282d('0x8')](_0x282d('0x10'),auth[_0x282d('0x9')](),controller[_0x282d('0x11')]);router[_0x282d('0x8')](_0x282d('0x12'),auth[_0x282d('0xe')](),controller[_0x282d('0x13')]);router[_0x282d('0x8')](_0x282d('0x14'),auth[_0x282d('0x9')](),controller[_0x282d('0x15')]);router[_0x282d('0x16')]('/',auth[_0x282d('0x9')](),controller['create']);router[_0x282d('0x16')](_0x282d('0x17'),auth[_0x282d('0x9')](),controller[_0x282d('0x18')]);var upload=multer({'storage':multer[_0x282d('0x19')]({'destination':function(_0x463a3c,_0x3e5bd5,_0x347f95){_0x347f95(null,path[_0x282d('0x1a')](config['root'],_0x282d('0x1b')));},'filename':function(_0x105acd,_0x3e8a75,_0x22e2bb){_0x22e2bb(null,util[_0x282d('0x1c')]('%s-%s',Date['now'](),_0x3e8a75['originalname'][_0x282d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x282d('0x1e')](_0x282d('0x1f')),controller[_0x282d('0x20')]);router[_0x282d('0x16')](_0x282d('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x282d('0x21')]);router[_0x282d('0x16')](_0x282d('0x22'),auth['isAuthenticated'](),interaction[_0x282d('0x23')]('chat',_0x282d('0x24')),controller[_0x282d('0x25')]);router[_0x282d('0x26')]('/:id',auth[_0x282d('0x9')](),interaction[_0x282d('0x23')](_0x282d('0x27'),'chatinteraction:update'),controller[_0x282d('0x28')]);router[_0x282d('0x26')]('/:id/custom_update',controller['customUpdate']);router[_0x282d('0x26')](_0x282d('0x29'),auth[_0x282d('0xe')](),controller['abandon']);router[_0x282d('0x26')](_0x282d('0x2a'),controller['close']);router[_0x282d('0x2b')](_0x282d('0xd'),auth[_0x282d('0x9')](),interaction[_0x282d('0x23')](_0x282d('0x27'),_0x282d('0x2c')),controller[_0x282d('0x2d')]);router[_0x282d('0x2b')](_0x282d('0x22'),auth[_0x282d('0x9')](),controller[_0x282d('0x2e')]);module[_0x282d('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 1966a1c..7ab255a 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 _0x320d=['sequelize','exports','TEXT','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x320d,0x1a0));var _0xd320=function(_0x3c3586,_0x36429b){_0x3c3586=_0x3c3586-0x0;var _0x235984=_0x320d[_0x3c3586];return _0x235984;};'use strict';var Sequelize=require(_0xd320('0x0'));module[_0xd320('0x1')]={'body':{'type':Sequelize[_0xd320('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd320('0x3')]}}; \ No newline at end of file +var _0xe083=['sequelize','exports','TEXT','medium','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe083,0x12c));var _0x3e08=function(_0x295b78,_0x56c7c4){_0x295b78=_0x295b78-0x0;var _0x5bd489=_0xe083[_0x295b78];return _0x5bd489;};'use strict';var Sequelize=require(_0x3e08('0x0'));module[_0x3e08('0x1')]={'body':{'type':Sequelize[_0x3e08('0x2')](_0x3e08('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3e08('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9aee616..a75e2df 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 _0x824d=['sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','body','find','describe','get','lastMessageAt','createdAt','format','lastMessage','getUsers','User','agent','user','role','internal','online','lastLoginAt','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','isEmpty','resourceId','push','FromId','read','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','ChatInternalMessage','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x18ca63,_0x43868e){var _0x24d865=function(_0x24f891){while(--_0x24f891){_0x18ca63['push'](_0x18ca63['shift']());}};_0x24d865(++_0x43868e);}(_0x824d,0x15b));var _0xd824=function(_0xa3dbb2,_0x3baa29){_0xa3dbb2=_0xa3dbb2-0x0;var _0x1a1d61=_0x824d[_0xa3dbb2];return _0x1a1d61;};'use strict';var emlformat=require(_0xd824('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd824('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd824('0x2'));var BPromise=require(_0xd824('0x3'));var Mustache=require(_0xd824('0x4'));var util=require(_0xd824('0x5'));var path=require(_0xd824('0x6'));var sox=require(_0xd824('0x7'));var csv=require(_0xd824('0x8'));var ejs=require(_0xd824('0x9'));var fs=require('fs');var fs_extra=require(_0xd824('0xa'));var _=require(_0xd824('0xb'));var squel=require(_0xd824('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd824('0xd'));var toCsv=require(_0xd824('0x8'));var querystring=require(_0xd824('0xe'));var Papa=require(_0xd824('0xf'));var Redis=require('ioredis');var authService=require(_0xd824('0x10'));var qs=require(_0xd824('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd824('0x12'));var logger=require(_0xd824('0x13'))(_0xd824('0x14'));var utils=require(_0xd824('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd824('0x16'))['db'];config[_0xd824('0x17')]=_[_0xd824('0x18')](config[_0xd824('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xd824('0x19'))(new Redis(config[_0xd824('0x17')]));require(_0xd824('0x1a'))[_0xd824('0x1b')](socket);function respondWithStatusCode(_0x3bcfea,_0x387125){_0x387125=_0x387125||0xcc;return function(_0x135677){if(_0x135677){return _0x3bcfea[_0xd824('0x1c')](_0x387125);}return _0x3bcfea[_0xd824('0x1d')](_0x387125)[_0xd824('0x1e')]();};}function respondWithResult(_0x942ee4,_0x8db263){_0x8db263=_0x8db263||0xc8;return function(_0x54e5be){if(_0x54e5be){return _0x942ee4['status'](_0x8db263)[_0xd824('0x1f')](_0x54e5be);}};}function respondWithFilteredResult(_0x22b7f1,_0x504eca){return function(_0x538578){if(_0x538578){var _0x331b7c=typeof _0x504eca['offset']==='undefined'&&typeof _0x504eca['limit']===_0xd824('0x20');var _0x17a996=_0x538578[_0xd824('0x21')];var _0x4ee167=_0x331b7c?0x0:_0x504eca[_0xd824('0x22')];var _0x397bf9=_0x331b7c?_0x538578[_0xd824('0x21')]:_0x504eca[_0xd824('0x22')]+_0x504eca['limit'];var _0x332e33;if(_0x397bf9>=_0x17a996){_0x397bf9=_0x17a996;_0x332e33=0xc8;}else{_0x332e33=0xce;}_0x22b7f1[_0xd824('0x1d')](_0x332e33);return _0x22b7f1[_0xd824('0x23')](_0xd824('0x24'),_0x4ee167+'-'+_0x397bf9+'/'+_0x17a996)[_0xd824('0x1f')](_0x538578);}return null;};}function patchUpdates(_0x26c8ef){return function(_0xdf4c08){try{jsonpatch[_0xd824('0x25')](_0xdf4c08,_0x26c8ef,!![]);}catch(_0x5ac11c){return BPromise['reject'](_0x5ac11c);}return _0xdf4c08[_0xd824('0x26')]();};}function saveUpdates(_0x528d5c,_0x33d6be){return function(_0x4d1071){if(_0x4d1071){return _0x4d1071[_0xd824('0x27')](_0x528d5c)[_0xd824('0x28')](function(_0xcb3fee){return _0xcb3fee;});}return null;};}function removeEntity(_0x3c36d5,_0x2c93c3){return function(_0x2d153e){if(_0x2d153e){return _0x2d153e[_0xd824('0x29')]()[_0xd824('0x28')](function(){_0x3c36d5[_0xd824('0x1d')](0xcc)[_0xd824('0x1e')]();});}};}function handleEntityNotFound(_0x7ff57b,_0x300ab3){return function(_0x43816c){if(!_0x43816c){_0x7ff57b['sendStatus'](0x194);}return _0x43816c;};}function handleError(_0xf443df,_0x41192e){_0x41192e=_0x41192e||0x1f4;return function(_0x1d427a){logger[_0xd824('0x2a')](_0x1d427a[_0xd824('0x2b')]);if(_0x1d427a[_0xd824('0x2c')]){delete _0x1d427a[_0xd824('0x2c')];}_0xf443df[_0xd824('0x1d')](_0x41192e)[_0xd824('0x2d')](_0x1d427a);};}exports['index']=function(_0x414bb9,_0x2a59a1){var _0x149bc3={},_0x117cb6={},_0x2436a9={'count':0x0,'rows':[]};var _0x529f9a=_[_0xd824('0x2e')](db[_0xd824('0x2f')]['rawAttributes'],function(_0x3f2662){return{'name':_0x3f2662[_0xd824('0x30')],'type':_0x3f2662['type'][_0xd824('0x31')]};});_0x117cb6[_0xd824('0x32')]=_[_0xd824('0x2e')](_0x529f9a,_0xd824('0x2c'));_0x117cb6[_0xd824('0x33')]=_[_0xd824('0x34')](_0x414bb9['query']);_0x117cb6[_0xd824('0x35')]=_['intersection'](_0x117cb6[_0xd824('0x32')],_0x117cb6['query']);_0x149bc3[_0xd824('0x36')]=_[_0xd824('0x37')](_0x117cb6[_0xd824('0x32')],qs['fields'](_0x414bb9[_0xd824('0x33')][_0xd824('0x38')]));_0x149bc3[_0xd824('0x36')]=_0x149bc3[_0xd824('0x36')][_0xd824('0x39')]?_0x149bc3[_0xd824('0x36')]:_0x117cb6[_0xd824('0x32')];if(!_0x414bb9['query'][_0xd824('0x3a')](_0xd824('0x3b'))){_0x149bc3[_0xd824('0x3c')]=qs[_0xd824('0x3c')](_0x414bb9['query'][_0xd824('0x3c')]);_0x149bc3['offset']=qs['offset'](_0x414bb9['query'][_0xd824('0x22')]);}_0x149bc3['order']=qs[_0xd824('0x3d')](_0x414bb9[_0xd824('0x33')][_0xd824('0x3d')]);_0x149bc3[_0xd824('0x3e')]=qs['filters'](_[_0xd824('0x3f')](_0x414bb9[_0xd824('0x33')],_0x117cb6[_0xd824('0x35')]),_0x529f9a);if(_0x414bb9[_0xd824('0x33')]['filter']){_0x149bc3['where']=_[_0xd824('0x40')](_0x149bc3[_0xd824('0x3e')],{'$or':_[_0xd824('0x2e')](_0x529f9a,function(_0x1d54d9){if(_0x1d54d9[_0xd824('0x41')]!==_0xd824('0x42')){var _0x59eea1={};_0x59eea1[_0x1d54d9['name']]={'$like':'%'+_0x414bb9['query'][_0xd824('0x43')]+'%'};return _0x59eea1;}})});}_0x149bc3=_[_0xd824('0x40')]({},_0x149bc3,_0x414bb9[_0xd824('0x44')]);var _0x929658={'where':_0x149bc3[_0xd824('0x3e')]};return db['ChatInternalMessage']['count'](_0x929658)[_0xd824('0x28')](function(_0x2aa87a){_0x2436a9[_0xd824('0x21')]=_0x2aa87a;if(_0x414bb9[_0xd824('0x33')][_0xd824('0x45')]){_0x149bc3[_0xd824('0x46')]=[{'all':!![]}];}return db[_0xd824('0x2f')][_0xd824('0x47')](_0x149bc3);})[_0xd824('0x28')](function(_0x2fb57a){_0x2436a9[_0xd824('0x48')]=_0x2fb57a;return _0x2436a9;})[_0xd824('0x28')](respondWithFilteredResult(_0x2a59a1,_0x149bc3))[_0xd824('0x49')](handleError(_0x2a59a1,null));};exports['show']=function(_0x4a6ed8,_0x1e2f39){var _0x56961a={'raw':!![],'where':{'id':_0x4a6ed8[_0xd824('0x4a')]['id']}},_0xe6c6bd={};_0xe6c6bd[_0xd824('0x32')]=_['keys'](db[_0xd824('0x2f')][_0xd824('0x4b')]);_0xe6c6bd[_0xd824('0x33')]=_['keys'](_0x4a6ed8[_0xd824('0x33')]);_0xe6c6bd[_0xd824('0x35')]=_[_0xd824('0x37')](_0xe6c6bd[_0xd824('0x32')],_0xe6c6bd['query']);_0x56961a[_0xd824('0x36')]=_['intersection'](_0xe6c6bd['model'],qs[_0xd824('0x38')](_0x4a6ed8[_0xd824('0x33')][_0xd824('0x38')]));_0x56961a['attributes']=_0x56961a['attributes'][_0xd824('0x39')]?_0x56961a['attributes']:_0xe6c6bd[_0xd824('0x32')];if(_0x4a6ed8['query'][_0xd824('0x45')]){_0x56961a[_0xd824('0x46')]=[{'all':!![]}];}_0x56961a=_[_0xd824('0x40')]({},_0x56961a,_0x4a6ed8[_0xd824('0x44')]);return db['ChatInternalMessage']['find'](_0x56961a)[_0xd824('0x28')](handleEntityNotFound(_0x1e2f39,null))[_0xd824('0x28')](respondWithResult(_0x1e2f39,null))[_0xd824('0x49')](handleError(_0x1e2f39,null));};exports['create']=function(_0x268b22,_0xccdbd7){return db['ChatInternalMessage']['create'](_0x268b22['body'],{})['then'](respondWithResult(_0xccdbd7,0xc9))['catch'](handleError(_0xccdbd7,null));};exports[_0xd824('0x27')]=function(_0x4bb3aa,_0x37faab){if(_0x4bb3aa[_0xd824('0x4c')]['id']){delete _0x4bb3aa[_0xd824('0x4c')]['id'];}return db[_0xd824('0x2f')][_0xd824('0x4d')]({'where':{'id':_0x4bb3aa['params']['id']}})[_0xd824('0x28')](handleEntityNotFound(_0x37faab,null))[_0xd824('0x28')](saveUpdates(_0x4bb3aa[_0xd824('0x4c')],null))['then'](respondWithResult(_0x37faab,null))[_0xd824('0x49')](handleError(_0x37faab,null));};exports[_0xd824('0x29')]=function(_0x4710cf,_0x398402){return db['ChatInternalMessage'][_0xd824('0x4d')]({'where':{'id':_0x4710cf[_0xd824('0x4a')]['id']}})[_0xd824('0x28')](handleEntityNotFound(_0x398402,null))['then'](removeEntity(_0x398402,null))[_0xd824('0x49')](handleError(_0x398402,null));};exports[_0xd824('0x4e')]=function(_0x2b991c,_0x5d6669){return db[_0xd824('0x2f')][_0xd824('0x4e')]()[_0xd824('0x28')](respondWithResult(_0x5d6669,null))[_0xd824('0x49')](handleError(_0x5d6669,null));};function wrapUser(_0x333539){return function(_0xb66d1a){var _0x205f7a=_0x333539[_0xd824('0x4f')]({'plain':!![]});_0x205f7a['messages']=[];if(_0xb66d1a){_0x205f7a[_0xd824('0x50')]=_0xb66d1a[_0xd824('0x51')];_0x205f7a['lastMessage']=_0xb66d1a;}else{_0x205f7a[_0xd824('0x50')]=moment(0x0)[_0xd824('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x205f7a[_0xd824('0x53')]={};}return _0x205f7a;};}exports[_0xd824('0x54')]=function(_0x272f96,_0x383c4e,_0x51f5c2){var _0x229547=[];return db[_0xd824('0x55')][_0xd824('0x47')]({'where':{'role':[_0xd824('0x56'),'admin',_0xd824('0x57')]},'attributes':['id','fullname',_0xd824('0x2c'),_0xd824('0x58'),'userpic',_0xd824('0x59'),_0xd824('0x5a'),_0xd824('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0xd824('0x3d')]('-online'),'include':[{'model':db[_0xd824('0x5c')],'as':_0xd824('0x5d'),'attributes':['id',_0xd824('0x2c'),'type'],'through':{'attributes':[]}}]})[_0xd824('0x28')](function(_0xb0348a){if(_0xb0348a){var _0x2868aa=_0x272f96[_0xd824('0x57')][_0xd824('0x4f')]({'plain':!![]});if(!_0x2868aa)throw new Error(_0xd824('0x5e'));if(_0x2868aa[_0xd824('0x58')]===_0xd824('0x57')){return db[_0xd824('0x5f')][_0xd824('0x4d')]({'where':{'name':'Agents','userProfileId':_0x2868aa[_0xd824('0x60')]},'raw':!![]})['then'](function(_0x5afb97){if(_0x5afb97){if(_0x5afb97['autoAssociation']===0x0){return db['UserProfileResource'][_0xd824('0x47')]({'where':{'sectionId':_0x5afb97['id']},'raw':!![]})[_0xd824('0x28')](function(_0x14066c){var _0x12b0a4=[];if(_[_0xd824('0x61')](_0x14066c)){_0x12b0a4=_['filter'](_0xb0348a,function(_0x338413){if(_0x338413[_0xd824('0x58')]!==_0xd824('0x56')){return _0x338413;}});return _0x12b0a4;}else{for(var _0x42a76f=0x0;_0x42a76f<_0xb0348a['length'];_0x42a76f++){var _0x528920=_0xb0348a[_0x42a76f];if(_0x528920[_0xd824('0x58')]===_0xd824('0x56')){var _0x57f148=_[_0xd824('0x4d')](_0x14066c,function(_0x4d2f15){return _0x4d2f15[_0xd824('0x62')]===_0x528920['id'];});if(_0x57f148)_0x12b0a4[_0xd824('0x63')](_0x528920);}else{_0x12b0a4['push'](_0x528920);}}return _0x12b0a4;}});}else{return _0xb0348a;}}else{var _0xa87e23=_['filter'](_0xb0348a,function(_0x3bff89){if(_0x3bff89[_0xd824('0x58')]!==_0xd824('0x56')){return _0x3bff89;}});return _0xa87e23;}});}else{return _0xb0348a;}}})[_0xd824('0x28')](function(_0x439a2f){var _0x46ed2e=[];if(_0x439a2f){_0x229547=_0x439a2f;for(var _0x2a3d26=0x0;_0x2a3d26<_0x439a2f[_0xd824('0x39')];_0x2a3d26+=0x1){_0x229547[_0x2a3d26]['messages']=[];_0x46ed2e['push'](db[_0xd824('0x2f')][_0xd824('0x4d')]({'where':{'FromId':[_0x272f96[_0xd824('0x57')]['id'],_0x439a2f[_0x2a3d26]['id']],'ToId':[_0x272f96['user']['id'],_0x439a2f[_0x2a3d26]['id']],'ChatGroupId':null},'attributes':['id',_0xd824('0x51'),_0xd824('0x64'),'ToId',_0xd824('0x65'),_0xd824('0x4c')],'order':qs[_0xd824('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd824('0x28')](wrapUser(_0x439a2f[_0x2a3d26])));}return BPromise['all'](_0x46ed2e);}return[];})['then'](function(_0x271814){return{'rows':_0x271814,'count':_0x271814[_0xd824('0x39')]};})[_0xd824('0x28')](respondWithResult(_0x383c4e,null))[_0xd824('0x49')](handleError(_0x383c4e,null));}; \ No newline at end of file +var _0xfabf=['apply','save','update','destroy','then','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId','push','messages','FromId','ToId','read','all','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range'];(function(_0x15d226,_0x5ed691){var _0x39ed63=function(_0x507aee){while(--_0x507aee){_0x15d226['push'](_0x15d226['shift']());}};_0x39ed63(++_0x5ed691);}(_0xfabf,0x199));var _0xffab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfabf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xffab('0x0'));var rimraf=require(_0xffab('0x1'));var zipdir=require(_0xffab('0x2'));var jsonpatch=require(_0xffab('0x3'));var rp=require(_0xffab('0x4'));var moment=require(_0xffab('0x5'));var BPromise=require(_0xffab('0x6'));var Mustache=require(_0xffab('0x7'));var util=require(_0xffab('0x8'));var path=require(_0xffab('0x9'));var sox=require(_0xffab('0xa'));var csv=require(_0xffab('0xb'));var ejs=require(_0xffab('0xc'));var fs=require('fs');var fs_extra=require(_0xffab('0xd'));var _=require(_0xffab('0xe'));var squel=require(_0xffab('0xf'));var crypto=require(_0xffab('0x10'));var jsforce=require(_0xffab('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xffab('0xb'));var querystring=require(_0xffab('0x12'));var Papa=require(_0xffab('0x13'));var Redis=require(_0xffab('0x14'));var authService=require(_0xffab('0x15'));var qs=require(_0xffab('0x16'));var as=require(_0xffab('0x17'));var hardwareService=require(_0xffab('0x18'));var logger=require(_0xffab('0x19'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xffab('0x1a'))['db'];config[_0xffab('0x1b')]=_[_0xffab('0x1c')](config[_0xffab('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xffab('0x1d')](socket);function respondWithStatusCode(_0x151f2a,_0x54dc50){_0x54dc50=_0x54dc50||0xcc;return function(_0x1ccef1){if(_0x1ccef1){return _0x151f2a[_0xffab('0x1e')](_0x54dc50);}return _0x151f2a[_0xffab('0x1f')](_0x54dc50)[_0xffab('0x20')]();};}function respondWithResult(_0x49defd,_0x31c510){_0x31c510=_0x31c510||0xc8;return function(_0x473292){if(_0x473292){return _0x49defd[_0xffab('0x1f')](_0x31c510)[_0xffab('0x21')](_0x473292);}};}function respondWithFilteredResult(_0x38ca20,_0x1f5d1a){return function(_0x403d87){if(_0x403d87){var _0x443628=typeof _0x1f5d1a['offset']===_0xffab('0x22')&&typeof _0x1f5d1a[_0xffab('0x23')]===_0xffab('0x22');var _0x4f9390=_0x403d87['count'];var _0x1e1d8d=_0x443628?0x0:_0x1f5d1a[_0xffab('0x24')];var _0x17688b=_0x443628?_0x403d87['count']:_0x1f5d1a[_0xffab('0x24')]+_0x1f5d1a[_0xffab('0x23')];var _0x54c48e;if(_0x17688b>=_0x4f9390){_0x17688b=_0x4f9390;_0x54c48e=0xc8;}else{_0x54c48e=0xce;}_0x38ca20[_0xffab('0x1f')](_0x54c48e);return _0x38ca20[_0xffab('0x25')](_0xffab('0x26'),_0x1e1d8d+'-'+_0x17688b+'/'+_0x4f9390)[_0xffab('0x21')](_0x403d87);}return null;};}function patchUpdates(_0x26f93){return function(_0x433d61){try{jsonpatch[_0xffab('0x27')](_0x433d61,_0x26f93,!![]);}catch(_0x55f459){return BPromise['reject'](_0x55f459);}return _0x433d61[_0xffab('0x28')]();};}function saveUpdates(_0x1f59ed,_0x242e5c){return function(_0x2c984b){if(_0x2c984b){return _0x2c984b[_0xffab('0x29')](_0x1f59ed)['then'](function(_0xf35cf5){return _0xf35cf5;});}return null;};}function removeEntity(_0x4baac3,_0x57bd8e){return function(_0x203514){if(_0x203514){return _0x203514[_0xffab('0x2a')]()[_0xffab('0x2b')](function(){_0x4baac3[_0xffab('0x1f')](0xcc)[_0xffab('0x20')]();});}};}function handleEntityNotFound(_0x4e6d15,_0x5676c5){return function(_0x403734){if(!_0x403734){_0x4e6d15['sendStatus'](0x194);}return _0x403734;};}function handleError(_0x37adb7,_0x5f42f4){_0x5f42f4=_0x5f42f4||0x1f4;return function(_0x395e5e){logger['error'](_0x395e5e['stack']);if(_0x395e5e[_0xffab('0x2c')]){delete _0x395e5e[_0xffab('0x2c')];}_0x37adb7['status'](_0x5f42f4)[_0xffab('0x2d')](_0x395e5e);};}exports[_0xffab('0x2e')]=function(_0x2b523e,_0x13000c){var _0x22c9bb={},_0x1aab71={},_0x3dc52b={'count':0x0,'rows':[]};var _0x52393f=_['map'](db[_0xffab('0x2f')][_0xffab('0x30')],function(_0x2185be){return{'name':_0x2185be[_0xffab('0x31')],'type':_0x2185be['type'][_0xffab('0x32')]};});_0x1aab71[_0xffab('0x33')]=_[_0xffab('0x34')](_0x52393f,_0xffab('0x2c'));_0x1aab71[_0xffab('0x35')]=_[_0xffab('0x36')](_0x2b523e[_0xffab('0x35')]);_0x1aab71[_0xffab('0x37')]=_[_0xffab('0x38')](_0x1aab71['model'],_0x1aab71[_0xffab('0x35')]);_0x22c9bb[_0xffab('0x39')]=_['intersection'](_0x1aab71[_0xffab('0x33')],qs[_0xffab('0x3a')](_0x2b523e[_0xffab('0x35')][_0xffab('0x3a')]));_0x22c9bb[_0xffab('0x39')]=_0x22c9bb[_0xffab('0x39')]['length']?_0x22c9bb['attributes']:_0x1aab71['model'];if(!_0x2b523e[_0xffab('0x35')]['hasOwnProperty'](_0xffab('0x3b'))){_0x22c9bb['limit']=qs[_0xffab('0x23')](_0x2b523e[_0xffab('0x35')][_0xffab('0x23')]);_0x22c9bb[_0xffab('0x24')]=qs['offset'](_0x2b523e[_0xffab('0x35')][_0xffab('0x24')]);}_0x22c9bb[_0xffab('0x3c')]=qs[_0xffab('0x3d')](_0x2b523e[_0xffab('0x35')]['sort']);_0x22c9bb[_0xffab('0x3e')]=qs[_0xffab('0x37')](_[_0xffab('0x3f')](_0x2b523e[_0xffab('0x35')],_0x1aab71[_0xffab('0x37')]),_0x52393f);if(_0x2b523e[_0xffab('0x35')][_0xffab('0x40')]){_0x22c9bb['where']=_[_0xffab('0x41')](_0x22c9bb[_0xffab('0x3e')],{'$or':_['map'](_0x52393f,function(_0x52c075){if(_0x52c075[_0xffab('0x42')]!==_0xffab('0x43')){var _0x25ebdb={};_0x25ebdb[_0x52c075[_0xffab('0x2c')]]={'$like':'%'+_0x2b523e['query'][_0xffab('0x40')]+'%'};return _0x25ebdb;}})});}_0x22c9bb=_['merge']({},_0x22c9bb,_0x2b523e['options']);var _0x3bf9a8={'where':_0x22c9bb[_0xffab('0x3e')]};return db[_0xffab('0x2f')][_0xffab('0x44')](_0x3bf9a8)['then'](function(_0x485dec){_0x3dc52b[_0xffab('0x44')]=_0x485dec;if(_0x2b523e[_0xffab('0x35')][_0xffab('0x45')]){_0x22c9bb['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0xffab('0x46')](_0x22c9bb);})[_0xffab('0x2b')](function(_0x5aa35d){_0x3dc52b[_0xffab('0x47')]=_0x5aa35d;return _0x3dc52b;})[_0xffab('0x2b')](respondWithFilteredResult(_0x13000c,_0x22c9bb))[_0xffab('0x48')](handleError(_0x13000c,null));};exports[_0xffab('0x49')]=function(_0x537e41,_0x1dab74){var _0x5410a9={'raw':!![],'where':{'id':_0x537e41[_0xffab('0x4a')]['id']}},_0x3efd30={};_0x3efd30[_0xffab('0x33')]=_[_0xffab('0x36')](db[_0xffab('0x2f')][_0xffab('0x30')]);_0x3efd30[_0xffab('0x35')]=_[_0xffab('0x36')](_0x537e41['query']);_0x3efd30[_0xffab('0x37')]=_[_0xffab('0x38')](_0x3efd30['model'],_0x3efd30[_0xffab('0x35')]);_0x5410a9[_0xffab('0x39')]=_[_0xffab('0x38')](_0x3efd30[_0xffab('0x33')],qs[_0xffab('0x3a')](_0x537e41['query'][_0xffab('0x3a')]));_0x5410a9['attributes']=_0x5410a9[_0xffab('0x39')][_0xffab('0x4b')]?_0x5410a9[_0xffab('0x39')]:_0x3efd30[_0xffab('0x33')];if(_0x537e41[_0xffab('0x35')][_0xffab('0x45')]){_0x5410a9[_0xffab('0x4c')]=[{'all':!![]}];}_0x5410a9=_[_0xffab('0x41')]({},_0x5410a9,_0x537e41['options']);return db[_0xffab('0x2f')][_0xffab('0x4d')](_0x5410a9)[_0xffab('0x2b')](handleEntityNotFound(_0x1dab74,null))[_0xffab('0x2b')](respondWithResult(_0x1dab74,null))[_0xffab('0x48')](handleError(_0x1dab74,null));};exports[_0xffab('0x4e')]=function(_0x53ce40,_0x5cde21){return db[_0xffab('0x2f')][_0xffab('0x4e')](_0x53ce40[_0xffab('0x4f')],{})[_0xffab('0x2b')](respondWithResult(_0x5cde21,0xc9))[_0xffab('0x48')](handleError(_0x5cde21,null));};exports[_0xffab('0x29')]=function(_0x57cd37,_0x23f3ee){if(_0x57cd37[_0xffab('0x4f')]['id']){delete _0x57cd37[_0xffab('0x4f')]['id'];}return db[_0xffab('0x2f')]['find']({'where':{'id':_0x57cd37[_0xffab('0x4a')]['id']}})[_0xffab('0x2b')](handleEntityNotFound(_0x23f3ee,null))[_0xffab('0x2b')](saveUpdates(_0x57cd37[_0xffab('0x4f')],null))[_0xffab('0x2b')](respondWithResult(_0x23f3ee,null))[_0xffab('0x48')](handleError(_0x23f3ee,null));};exports['destroy']=function(_0x214b31,_0x3d74a2){return db[_0xffab('0x2f')]['find']({'where':{'id':_0x214b31[_0xffab('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d74a2,null))['then'](removeEntity(_0x3d74a2,null))[_0xffab('0x48')](handleError(_0x3d74a2,null));};exports[_0xffab('0x50')]=function(_0xf30a60,_0x30b5d6){return db[_0xffab('0x2f')]['describe']()[_0xffab('0x2b')](respondWithResult(_0x30b5d6,null))[_0xffab('0x48')](handleError(_0x30b5d6,null));};function wrapUser(_0x255ee8){return function(_0x1e62be){var _0x3682f1=_0x255ee8[_0xffab('0x51')]({'plain':!![]});_0x3682f1['messages']=[];if(_0x1e62be){_0x3682f1[_0xffab('0x52')]=_0x1e62be[_0xffab('0x53')];_0x3682f1[_0xffab('0x54')]=_0x1e62be;}else{_0x3682f1[_0xffab('0x52')]=moment(0x0)[_0xffab('0x55')](_0xffab('0x56'));_0x3682f1['lastMessage']={};}return _0x3682f1;};}exports[_0xffab('0x57')]=function(_0x5e583b,_0x2572bd,_0x1e8269){var _0x227808=[];return db[_0xffab('0x58')][_0xffab('0x46')]({'where':{'role':[_0xffab('0x59'),'admin',_0xffab('0x5a')]},'attributes':['id','fullname',_0xffab('0x2c'),_0xffab('0x5b'),_0xffab('0x5c'),_0xffab('0x5d'),_0xffab('0x5e'),_0xffab('0x5f'),_0xffab('0x60'),_0xffab('0x61')],'order':qs['sort'](_0xffab('0x62')),'include':[{'model':db[_0xffab('0x63')],'as':_0xffab('0x64'),'attributes':['id',_0xffab('0x2c'),_0xffab('0x42')],'through':{'attributes':[]}}]})[_0xffab('0x2b')](function(_0x2eac47){if(_0x2eac47){var _0x255918=_0x5e583b[_0xffab('0x5a')][_0xffab('0x51')]({'plain':!![]});if(!_0x255918)throw new Error(_0xffab('0x65'));if(_0x255918[_0xffab('0x5b')]===_0xffab('0x5a')){return db[_0xffab('0x66')][_0xffab('0x4d')]({'where':{'name':_0xffab('0x67'),'userProfileId':_0x255918['userProfileId']},'raw':!![]})[_0xffab('0x2b')](function(_0x121837){if(_0x121837){if(_0x121837[_0xffab('0x68')]===0x0){return db['UserProfileResource'][_0xffab('0x46')]({'where':{'sectionId':_0x121837['id']},'raw':!![]})['then'](function(_0x87f594){var _0x599279=[];if(_['isEmpty'](_0x87f594)){_0x599279=_['filter'](_0x2eac47,function(_0x3b1cf1){if(_0x3b1cf1[_0xffab('0x5b')]!==_0xffab('0x59')){return _0x3b1cf1;}});return _0x599279;}else{for(var _0x140beb=0x0;_0x140beb<_0x2eac47[_0xffab('0x4b')];_0x140beb++){var _0x14b006=_0x2eac47[_0x140beb];if(_0x14b006['role']==='agent'){var _0x2ffc72=_[_0xffab('0x4d')](_0x87f594,function(_0x46ad71){return _0x46ad71[_0xffab('0x69')]===_0x14b006['id'];});if(_0x2ffc72)_0x599279[_0xffab('0x6a')](_0x14b006);}else{_0x599279[_0xffab('0x6a')](_0x14b006);}}return _0x599279;}});}else{return _0x2eac47;}}else{var _0x3e1521=_[_0xffab('0x40')](_0x2eac47,function(_0xd31529){if(_0xd31529[_0xffab('0x5b')]!==_0xffab('0x59')){return _0xd31529;}});return _0x3e1521;}});}else{return _0x2eac47;}}})['then'](function(_0x42f566){var _0x152dd0=[];if(_0x42f566){_0x227808=_0x42f566;for(var _0x1742f2=0x0;_0x1742f2<_0x42f566[_0xffab('0x4b')];_0x1742f2+=0x1){_0x227808[_0x1742f2][_0xffab('0x6b')]=[];_0x152dd0[_0xffab('0x6a')](db[_0xffab('0x2f')]['find']({'where':{'FromId':[_0x5e583b[_0xffab('0x5a')]['id'],_0x42f566[_0x1742f2]['id']],'ToId':[_0x5e583b[_0xffab('0x5a')]['id'],_0x42f566[_0x1742f2]['id']],'ChatGroupId':null},'attributes':['id',_0xffab('0x53'),_0xffab('0x6c'),_0xffab('0x6d'),_0xffab('0x6e'),_0xffab('0x4f')],'order':qs[_0xffab('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xffab('0x2b')](wrapUser(_0x42f566[_0x1742f2])));}return BPromise[_0xffab('0x6f')](_0x152dd0);}return[];})[_0xffab('0x2b')](function(_0xd7d724){return{'rows':_0xd7d724,'count':_0xd7d724['length']};})['then'](respondWithResult(_0x2572bd,null))[_0xffab('0x48')](handleError(_0x2572bd,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 9ce9dff..10215b0 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 _0x8044=['ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0x8044,0x170));var _0x4804=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x8044[_0x3b5ad9];return _0x611ae9;};'use strict';var EventEmitter=require(_0x4804('0x0'));var ChatInternalMessage=require(_0x4804('0x1'))['db'][_0x4804('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4804('0x3')](0x0);var events={'afterCreate':_0x4804('0x4'),'afterUpdate':_0x4804('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d6d6a){return function(_0x361aae,_0x1e482c,_0x3a3938){ChatInternalMessageEvents['emit'](_0x4d6d6a+':'+_0x361aae['id'],_0x361aae);ChatInternalMessageEvents[_0x4804('0x6')](_0x4d6d6a,_0x361aae);_0x3a3938(null);};}for(var e in events){if(events[_0x4804('0x7')](e)){var event=events[e];ChatInternalMessage[_0x4804('0x8')](e,emitEvent(event));}}module[_0x4804('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x9431=['events','../../mysqldb','ChatInternalMessage','update','remove','emit','hasOwnProperty'];(function(_0x30a6d6,_0x603c35){var _0x361ea1=function(_0x4d35a7){while(--_0x4d35a7){_0x30a6d6['push'](_0x30a6d6['shift']());}};_0x361ea1(++_0x603c35);}(_0x9431,0xa8));var _0x1943=function(_0x42f2f2,_0x2dcbe3){_0x42f2f2=_0x42f2f2-0x0;var _0x1a696c=_0x9431[_0x42f2f2];return _0x1a696c;};'use strict';var EventEmitter=require(_0x1943('0x0'));var ChatInternalMessage=require(_0x1943('0x1'))['db'][_0x1943('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1943('0x3'),'afterDestroy':_0x1943('0x4')};function emitEvent(_0x59d0f3){return function(_0x5e74aa,_0x40ec64,_0x3e2ad1){ChatInternalMessageEvents[_0x1943('0x5')](_0x59d0f3+':'+_0x5e74aa['id'],_0x5e74aa);ChatInternalMessageEvents['emit'](_0x59d0f3,_0x5e74aa);_0x3e2ad1(null);};}for(var e in events){if(events[_0x1943('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 4014a6b..ed79fe8 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 _0x4445=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x5f49b3,_0x1ea166){var _0x373e8a=function(_0x306bc2){while(--_0x306bc2){_0x5f49b3['push'](_0x5f49b3['shift']());}};_0x373e8a(++_0x1ea166);}(_0x4445,0x18a));var _0x5444=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x4445[_0x5d07ff];return _0x5226ad;};'use strict';var _=require(_0x5444('0x0'));var util=require(_0x5444('0x1'));var logger=require(_0x5444('0x2'))(_0x5444('0x3'));var moment=require('moment');var BPromise=require(_0x5444('0x4'));var rp=require(_0x5444('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5444('0x6'));var attributes=require(_0x5444('0x7'));module[_0x5444('0x8')]=function(_0x33ddd8,_0x5bf938){return _0x33ddd8[_0x5444('0x9')](_0x5444('0xa'),attributes,{'tableName':_0x5444('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5444('0xc'),'collate':_0x5444('0xd')});}; \ No newline at end of file +var _0x3286=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5b1aed,_0x322c17){var _0x26add8=function(_0x58a9d7){while(--_0x58a9d7){_0x5b1aed['push'](_0x5b1aed['shift']());}};_0x26add8(++_0x322c17);}(_0x3286,0x85));var _0x6328=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3286[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6328('0x0'));var util=require(_0x6328('0x1'));var logger=require(_0x6328('0x2'))(_0x6328('0x3'));var moment=require(_0x6328('0x4'));var BPromise=require(_0x6328('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6328('0x6'));var rimraf=require(_0x6328('0x7'));var config=require(_0x6328('0x8'));var attributes=require(_0x6328('0x9'));module['exports']=function(_0x282e61,_0x1ce728){return _0x282e61[_0x6328('0xa')](_0x6328('0xb'),attributes,{'tableName':_0x6328('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6328('0xd'),'collate':_0x6328('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 5a65aba..51c9677 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 _0xe57e=['result','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x2997d4,_0x21ca22){var _0x544af0=function(_0x3bccce){while(--_0x3bccce){_0x2997d4['push'](_0x2997d4['shift']());}};_0x544af0(++_0x21ca22);}(_0xe57e,0xf2));var _0xee57=function(_0x15d3c5,_0x54d919){_0x15d3c5=_0x15d3c5-0x0;var _0x1077e0=_0xe57e[_0x15d3c5];return _0x1077e0;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var moment=require(_0xee57('0x1'));var BPromise=require(_0xee57('0x2'));var rs=require(_0xee57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee57('0x4'));var logger=require('../../config/logger')(_0xee57('0x5'));var config=require(_0xee57('0x6'));var jayson=require(_0xee57('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xee57('0x8')]=_[_0xee57('0x9')](config[_0xee57('0x8')],{'host':_0xee57('0xa'),'port':0x18eb});var socket=require(_0xee57('0xb'))(new Redis(config[_0xee57('0x8')]));require(_0xee57('0xc'))['register'](socket);function respondWithRpcPromise(_0x571f54,_0x195956,_0x3bbe45){return new BPromise(function(_0x3a9422,_0x39428b){return client[_0xee57('0xd')](_0x571f54,_0x3bbe45)[_0xee57('0xe')](function(_0x6a8687){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x195956,_0xee57('0xf'));logger[_0xee57('0x10')](_0xee57('0x11'),_0x195956,_0xee57('0xf'),JSON[_0xee57('0x12')](_0x6a8687));if(_0x6a8687['error']){if(_0x6a8687[_0xee57('0x13')]['code']===0x1f4){logger[_0xee57('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x195956,_0x6a8687[_0xee57('0x13')]['message']);return _0x39428b(_0x6a8687['error'][_0xee57('0x14')]);}logger[_0xee57('0x13')](_0xee57('0x15'),_0x195956,_0x6a8687[_0xee57('0x13')]['message']);return _0x3a9422(_0x6a8687[_0xee57('0x13')][_0xee57('0x14')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x195956,'request\x20sent');_0x3a9422(_0x6a8687[_0xee57('0x16')]['message']);}})[_0xee57('0x17')](function(_0x3f202f){logger[_0xee57('0x13')](_0xee57('0x15'),_0x195956,_0x3f202f);_0x39428b(_0x3f202f);});});} \ No newline at end of file +var _0x65ac=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x23bc53,_0x2f5f2c){var _0xcb298d=function(_0x3d3cdd){while(--_0x3d3cdd){_0x23bc53['push'](_0x23bc53['shift']());}};_0xcb298d(++_0x2f5f2c);}(_0x65ac,0x100));var _0xc65a=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x65ac[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require('lodash');var util=require(_0xc65a('0x0'));var moment=require(_0xc65a('0x1'));var BPromise=require(_0xc65a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc65a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc65a('0x4'));var logger=require('../../config/logger')(_0xc65a('0x5'));var config=require(_0xc65a('0x6'));var jayson=require(_0xc65a('0x7'));var client=jayson[_0xc65a('0x8')][_0xc65a('0x9')]({'port':0x232a});config[_0xc65a('0xa')]=_[_0xc65a('0xb')](config[_0xc65a('0xa')],{'host':_0xc65a('0xc'),'port':0x18eb});var socket=require(_0xc65a('0xd'))(new Redis(config[_0xc65a('0xa')]));require(_0xc65a('0xe'))[_0xc65a('0xf')](socket);function respondWithRpcPromise(_0x3c3522,_0x1ff711,_0x37569b){return new BPromise(function(_0x2a574c,_0x14e923){return client[_0xc65a('0x10')](_0x3c3522,_0x37569b)[_0xc65a('0x11')](function(_0x1bcb0f){logger[_0xc65a('0x12')](_0xc65a('0x13'),_0x1ff711,_0xc65a('0x14'));logger[_0xc65a('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1ff711,_0xc65a('0x14'),JSON[_0xc65a('0x16')](_0x1bcb0f));if(_0x1bcb0f[_0xc65a('0x17')]){if(_0x1bcb0f['error']['code']===0x1f4){logger[_0xc65a('0x17')](_0xc65a('0x13'),_0x1ff711,_0x1bcb0f['error'][_0xc65a('0x18')]);return _0x14e923(_0x1bcb0f['error'][_0xc65a('0x18')]);}logger[_0xc65a('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x1ff711,_0x1bcb0f[_0xc65a('0x17')]['message']);return _0x2a574c(_0x1bcb0f[_0xc65a('0x17')]['message']);}else{logger[_0xc65a('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1ff711,_0xc65a('0x14'));_0x2a574c(_0x1bcb0f[_0xc65a('0x19')][_0xc65a('0x18')]);}})[_0xc65a('0x1a')](function(_0x3261a4){logger[_0xc65a('0x17')](_0xc65a('0x13'),_0x1ff711,_0x3261a4);_0x14e923(_0x3261a4);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4137201..e1bc709 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 _0xd8c7=['emit','removeListener','register','chatInternalMessage:','save','remove','update'];(function(_0x57e7d6,_0x1839d9){var _0x3fe8eb=function(_0x52875f){while(--_0x52875f){_0x57e7d6['push'](_0x57e7d6['shift']());}};_0x3fe8eb(++_0x1839d9);}(_0xd8c7,0x170));var _0x7d8c=function(_0x22cb69,_0x585150){_0x22cb69=_0x22cb69-0x0;var _0x302879=_0xd8c7[_0x22cb69];return _0x302879;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x7d8c('0x0'),_0x7d8c('0x1'),_0x7d8c('0x2')];function createListener(_0x43170b,_0x433740){return function(_0x2549ca){_0x433740[_0x7d8c('0x3')](_0x43170b,_0x2549ca);};}function removeListener(_0x1a2f28,_0x1c4152){return function(){ChatInternalMessageEvents[_0x7d8c('0x4')](_0x1a2f28,_0x1c4152);};}exports[_0x7d8c('0x5')]=function(_0x16af39){for(var _0x22815a=0x0,_0x21e603=events['length'];_0x22815a<_0x21e603;_0x22815a++){var _0x12dc3a=events[_0x22815a];var _0x30fe18=createListener(_0x7d8c('0x6')+_0x12dc3a,_0x16af39);ChatInternalMessageEvents['on'](_0x12dc3a,_0x30fe18);}}; \ No newline at end of file +var _0x84a2=['./chatInternalMessage.events','save','update','removeListener','register','length'];(function(_0x442599,_0x112b2a){var _0x1198d5=function(_0x5e429e){while(--_0x5e429e){_0x442599['push'](_0x442599['shift']());}};_0x1198d5(++_0x112b2a);}(_0x84a2,0x1f2));var _0x284a=function(_0x442ae6,_0x58743b){_0x442ae6=_0x442ae6-0x0;var _0x581317=_0x84a2[_0x442ae6];return _0x581317;};'use strict';var ChatInternalMessageEvents=require(_0x284a('0x0'));var events=[_0x284a('0x1'),'remove',_0x284a('0x2')];function createListener(_0x172350,_0x591c1c){return function(_0xa2de3e){_0x591c1c['emit'](_0x172350,_0xa2de3e);};}function removeListener(_0xec69fa,_0x229bed){return function(){ChatInternalMessageEvents[_0x284a('0x3')](_0xec69fa,_0x229bed);};}exports[_0x284a('0x4')]=function(_0x122b1e){for(var _0x115443=0x0,_0x4de826=events[_0x284a('0x5')];_0x115443<_0x4de826;_0x115443++){var _0x3e98ca=events[_0x115443];var _0x42ff25=createListener('chatInternalMessage:'+_0x3e98ca,_0x122b1e);ChatInternalMessageEvents['on'](_0x3e98ca,_0x42ff25);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index d594f73..7fb9ebb 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 _0x5836=['post','create','put','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/users','getUsers','/:id'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0x5836,0x1bc));var _0x6583=function(_0x5c049a,_0x2c1263){_0x5c049a=_0x5c049a-0x0;var _0x168e70=_0x5836[_0x5c049a];return _0x168e70;};'use strict';var multer=require(_0x6583('0x0'));var util=require(_0x6583('0x1'));var path=require(_0x6583('0x2'));var timeout=require('connect-timeout');var express=require(_0x6583('0x3'));var router=express[_0x6583('0x4')]();var fs_extra=require(_0x6583('0x5'));var auth=require(_0x6583('0x6'));var interaction=require(_0x6583('0x7'));var config=require('../../config/environment');var controller=require(_0x6583('0x8'));router[_0x6583('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6583('0x9')](_0x6583('0xa'),auth[_0x6583('0xb')](),controller[_0x6583('0xc')]);router[_0x6583('0x9')](_0x6583('0xd'),auth['isAuthenticated'](),controller[_0x6583('0xe')]);router[_0x6583('0x9')](_0x6583('0xf'),auth[_0x6583('0xb')](),controller['show']);router[_0x6583('0x10')]('/',auth[_0x6583('0xb')](),controller[_0x6583('0x11')]);router[_0x6583('0x12')](_0x6583('0xf'),controller['update']);router[_0x6583('0x13')](_0x6583('0xf'),auth[_0x6583('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3dbb=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x3dbb,0x183));var _0xb3db=function(_0x2c1a27,_0x4cd2d9){_0x2c1a27=_0x2c1a27-0x0;var _0x58a7f7=_0x3dbb[_0x2c1a27];return _0x58a7f7;};'use strict';var multer=require(_0xb3db('0x0'));var util=require(_0xb3db('0x1'));var path=require(_0xb3db('0x2'));var timeout=require(_0xb3db('0x3'));var express=require('express');var router=express[_0xb3db('0x4')]();var fs_extra=require(_0xb3db('0x5'));var auth=require(_0xb3db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb3db('0x7'));var controller=require(_0xb3db('0x8'));router[_0xb3db('0x9')]('/',auth[_0xb3db('0xa')](),controller['index']);router[_0xb3db('0x9')](_0xb3db('0xb'),auth[_0xb3db('0xa')](),controller[_0xb3db('0xc')]);router[_0xb3db('0x9')]('/users',auth[_0xb3db('0xa')](),controller[_0xb3db('0xd')]);router[_0xb3db('0x9')](_0xb3db('0xe'),auth[_0xb3db('0xa')](),controller[_0xb3db('0xf')]);router[_0xb3db('0x10')]('/',auth[_0xb3db('0xa')](),controller[_0xb3db('0x11')]);router[_0xb3db('0x12')](_0xb3db('0xe'),controller[_0xb3db('0x13')]);router[_0xb3db('0x14')](_0xb3db('0xe'),auth[_0xb3db('0xa')](),controller[_0xb3db('0x15')]);module[_0xb3db('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 f7601d9..e6345e5 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 _0xaf4c=['out','DATE','STRING','exports','TEXT','BOOLEAN','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x58d0d9,_0x9a0e52){_0x58d0d9=_0x58d0d9-0x0;var _0x2e6612=_0xaf4c[_0x58d0d9];return _0x2e6612;};'use strict';var Sequelize=require('sequelize');module[_0xcaf4('0x0')]={'body':{'type':Sequelize[_0xcaf4('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcaf4('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcaf4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcaf4('0x3')]('in','out'),'defaultValue':_0xcaf4('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xcaf4('0x5')]},'providerName':{'type':Sequelize[_0xcaf4('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8a5c=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x5126fd,_0x539bd4){var _0x683d8f=function(_0x3db972){while(--_0x3db972){_0x5126fd['push'](_0x5126fd['shift']());}};_0x683d8f(++_0x539bd4);}(_0x8a5c,0x136));var _0xc8a5=function(_0xaeeb0a,_0x1f5856){_0xaeeb0a=_0xaeeb0a-0x0;var _0x459077=_0x8a5c[_0xaeeb0a];return _0x459077;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'body':{'type':Sequelize[_0xc8a5('0x2')](_0xc8a5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc8a5('0x5')]('in',_0xc8a5('0x6')),'defaultValue':_0xc8a5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc8a5('0x7')]},'providerResponse':{'type':Sequelize[_0xc8a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 2280ccf..4a8ab37 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 _0x4b07=['agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','rejectmessage','parse','eml-format','rimraf','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','findAll','params','length','includeAll','include','options','find','create','body','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x101bab,_0x1ab123){var _0x28ee68=function(_0x1b92b6){while(--_0x1b92b6){_0x101bab['push'](_0x101bab['shift']());}};_0x28ee68(++_0x1ab123);}(_0x4b07,0x122));var _0x74b0=function(_0x2cad1d,_0x95a8c7){_0x2cad1d=_0x2cad1d-0x0;var _0x4a900c=_0x4b07[_0x2cad1d];return _0x4a900c;};'use strict';var emlformat=require(_0x74b0('0x0'));var rimraf=require(_0x74b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x74b0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74b0('0x3'));var util=require(_0x74b0('0x4'));var path=require('path');var sox=require(_0x74b0('0x5'));var csv=require(_0x74b0('0x6'));var ejs=require(_0x74b0('0x7'));var fs=require('fs');var fs_extra=require(_0x74b0('0x8'));var _=require(_0x74b0('0x9'));var squel=require(_0x74b0('0xa'));var crypto=require(_0x74b0('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x74b0('0x6'));var querystring=require('querystring');var Papa=require(_0x74b0('0xc'));var Redis=require(_0x74b0('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x74b0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b0('0xf'))(_0x74b0('0x10'));var utils=require(_0x74b0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x74b0('0x12'));var db=require('../../mysqldb')['db'];config[_0x74b0('0x13')]=_['defaults'](config[_0x74b0('0x13')],{'host':_0x74b0('0x14'),'port':0x18eb});var socket=require(_0x74b0('0x15'))(new Redis(config[_0x74b0('0x13')]));require('./chatMessage.socket')[_0x74b0('0x16')](socket);var jayson=require(_0x74b0('0x17'));var client=jayson[_0x74b0('0x18')][_0x74b0('0x19')]({'port':0x232c});var client9002=jayson[_0x74b0('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fc923,_0x224739,_0x35e384,_0x6ad3b0){return new BPromise(function(_0x24fd89,_0x64ff6a){var _0x3a1598=_0x6ad3b0||client;return _0x3a1598[_0x74b0('0x1a')](_0x1fc923,_0x35e384)[_0x74b0('0x1b')](function(_0x28c6fd){logger[_0x74b0('0x1c')](_0x74b0('0x1d'),_0x224739,'request\x20sent');logger[_0x74b0('0x1e')](_0x74b0('0x1f'),_0x224739,_0x74b0('0x20'),JSON['stringify'](_0x28c6fd));if(_0x28c6fd['error']){if(_0x28c6fd['error'][_0x74b0('0x21')]===0x1f4){logger[_0x74b0('0x22')](_0x74b0('0x1d'),_0x224739,_0x28c6fd[_0x74b0('0x22')][_0x74b0('0x23')]);return _0x64ff6a(_0x28c6fd[_0x74b0('0x22')][_0x74b0('0x23')]);}logger['error'](_0x74b0('0x1d'),_0x224739,_0x28c6fd['error'][_0x74b0('0x23')]);return _0x24fd89(_0x28c6fd[_0x74b0('0x22')][_0x74b0('0x23')]);}else{logger[_0x74b0('0x1c')](_0x74b0('0x1d'),_0x224739,_0x74b0('0x20'));_0x24fd89(_0x28c6fd[_0x74b0('0x24')][_0x74b0('0x23')]);}})[_0x74b0('0x25')](function(_0x21032a){logger[_0x74b0('0x22')]('ChatMessage,\x20%s,\x20%s',_0x224739,_0x21032a);_0x64ff6a(_0x21032a);});});}function respondWithStatusCode(_0x8a1731,_0x5755a9){_0x5755a9=_0x5755a9||0xcc;return function(_0x40c214){if(_0x40c214){return _0x8a1731['sendStatus'](_0x5755a9);}return _0x8a1731[_0x74b0('0x26')](_0x5755a9)[_0x74b0('0x27')]();};}function respondWithResult(_0x1fd88e,_0x40c004){_0x40c004=_0x40c004||0xc8;return function(_0xd7b09f){if(_0xd7b09f){return _0x1fd88e[_0x74b0('0x26')](_0x40c004)[_0x74b0('0x28')](_0xd7b09f);}};}function respondWithFilteredResult(_0x579da0,_0x2fba1f){return function(_0x5cfaf9){if(_0x5cfaf9){var _0x16548a=typeof _0x2fba1f[_0x74b0('0x29')]==='undefined'&&typeof _0x2fba1f[_0x74b0('0x2a')]===_0x74b0('0x2b');var _0x1c23a3=_0x5cfaf9[_0x74b0('0x2c')];var _0x1bad91=_0x16548a?0x0:_0x2fba1f[_0x74b0('0x29')];var _0x13a2a6=_0x16548a?_0x5cfaf9[_0x74b0('0x2c')]:_0x2fba1f[_0x74b0('0x29')]+_0x2fba1f['limit'];var _0xe1913;if(_0x13a2a6>=_0x1c23a3){_0x13a2a6=_0x1c23a3;_0xe1913=0xc8;}else{_0xe1913=0xce;}_0x579da0[_0x74b0('0x26')](_0xe1913);return _0x579da0[_0x74b0('0x2d')]('Content-Range',_0x1bad91+'-'+_0x13a2a6+'/'+_0x1c23a3)[_0x74b0('0x28')](_0x5cfaf9);}return null;};}function patchUpdates(_0x6914d8){return function(_0x4d3b47){try{jsonpatch[_0x74b0('0x2e')](_0x4d3b47,_0x6914d8,!![]);}catch(_0x3df1a1){return BPromise[_0x74b0('0x2f')](_0x3df1a1);}return _0x4d3b47[_0x74b0('0x30')]();};}function saveUpdates(_0xa81008,_0x1d39f7){return function(_0xe7f5b6){if(_0xe7f5b6){return _0xe7f5b6[_0x74b0('0x31')](_0xa81008)[_0x74b0('0x1b')](function(_0x38ac9f){return _0x38ac9f;});}return null;};}function removeEntity(_0x36d34d,_0x581e81){return function(_0x51ec9d){if(_0x51ec9d){return _0x51ec9d[_0x74b0('0x32')]()['then'](function(){_0x36d34d[_0x74b0('0x26')](0xcc)[_0x74b0('0x27')]();});}};}function handleEntityNotFound(_0x46fd99,_0x5b487d){return function(_0x15d8a2){if(!_0x15d8a2){_0x46fd99[_0x74b0('0x33')](0x194);}return _0x15d8a2;};}function handleError(_0x470b0f,_0x83dd55){_0x83dd55=_0x83dd55||0x1f4;return function(_0x1331c6){logger['error'](_0x1331c6[_0x74b0('0x34')]);if(_0x1331c6[_0x74b0('0x35')]){delete _0x1331c6[_0x74b0('0x35')];}_0x470b0f['status'](_0x83dd55)['send'](_0x1331c6);};}exports[_0x74b0('0x36')]=function(_0x2b6d2a,_0x2bb2d6){var _0x2526c0={},_0x2a19ec={},_0x48e45a={'count':0x0,'rows':[]};var _0x45fd96=_[_0x74b0('0x37')](db[_0x74b0('0x38')][_0x74b0('0x39')],function(_0x590411){return{'name':_0x590411[_0x74b0('0x3a')],'type':_0x590411[_0x74b0('0x3b')][_0x74b0('0x3c')]};});_0x2a19ec['model']=_[_0x74b0('0x37')](_0x45fd96,'name');_0x2a19ec['query']=_[_0x74b0('0x3d')](_0x2b6d2a[_0x74b0('0x3e')]);_0x2a19ec[_0x74b0('0x3f')]=_[_0x74b0('0x40')](_0x2a19ec[_0x74b0('0x41')],_0x2a19ec['query']);_0x2526c0[_0x74b0('0x42')]=_['intersection'](_0x2a19ec[_0x74b0('0x41')],qs[_0x74b0('0x43')](_0x2b6d2a['query']['fields']));_0x2526c0['attributes']=_0x2526c0[_0x74b0('0x42')]['length']?_0x2526c0['attributes']:_0x2a19ec[_0x74b0('0x41')];if(!_0x2b6d2a[_0x74b0('0x3e')][_0x74b0('0x44')]('nolimit')){_0x2526c0[_0x74b0('0x2a')]=qs[_0x74b0('0x2a')](_0x2b6d2a[_0x74b0('0x3e')][_0x74b0('0x2a')]);_0x2526c0['offset']=qs[_0x74b0('0x29')](_0x2b6d2a[_0x74b0('0x3e')][_0x74b0('0x29')]);}_0x2526c0['order']=qs[_0x74b0('0x45')](_0x2b6d2a[_0x74b0('0x3e')][_0x74b0('0x45')]);_0x2526c0[_0x74b0('0x46')]=qs[_0x74b0('0x3f')](_['pick'](_0x2b6d2a[_0x74b0('0x3e')],_0x2a19ec['filters']),_0x45fd96);if(_0x2b6d2a[_0x74b0('0x3e')][_0x74b0('0x47')]){_0x2526c0[_0x74b0('0x46')]=_[_0x74b0('0x48')](_0x2526c0[_0x74b0('0x46')],{'$or':_[_0x74b0('0x37')](_0x45fd96,function(_0x56ab3d){if(_0x56ab3d[_0x74b0('0x3b')]!==_0x74b0('0x49')){var _0x5e31b8={};_0x5e31b8[_0x56ab3d[_0x74b0('0x35')]]={'$like':'%'+_0x2b6d2a[_0x74b0('0x3e')][_0x74b0('0x47')]+'%'};return _0x5e31b8;}})});}_0x2526c0=_[_0x74b0('0x48')]({},_0x2526c0,_0x2b6d2a['options']);var _0x33e251={'where':_0x2526c0[_0x74b0('0x46')]};return db[_0x74b0('0x38')][_0x74b0('0x2c')](_0x33e251)[_0x74b0('0x1b')](function(_0x27a786){_0x48e45a[_0x74b0('0x2c')]=_0x27a786;if(_0x2b6d2a[_0x74b0('0x3e')]['includeAll']){_0x2526c0['include']=[{'all':!![]}];}return db[_0x74b0('0x38')][_0x74b0('0x4a')](_0x2526c0);})['then'](function(_0x3992b9){_0x48e45a['rows']=_0x3992b9;return _0x48e45a;})[_0x74b0('0x1b')](respondWithFilteredResult(_0x2bb2d6,_0x2526c0))[_0x74b0('0x25')](handleError(_0x2bb2d6,null));};exports['show']=function(_0x469a5c,_0x4e3b78){var _0x45fa0e={'raw':!![],'where':{'id':_0x469a5c[_0x74b0('0x4b')]['id']}},_0x16e0a4={};_0x16e0a4[_0x74b0('0x41')]=_[_0x74b0('0x3d')](db[_0x74b0('0x38')][_0x74b0('0x39')]);_0x16e0a4['query']=_[_0x74b0('0x3d')](_0x469a5c['query']);_0x16e0a4[_0x74b0('0x3f')]=_['intersection'](_0x16e0a4[_0x74b0('0x41')],_0x16e0a4[_0x74b0('0x3e')]);_0x45fa0e[_0x74b0('0x42')]=_[_0x74b0('0x40')](_0x16e0a4[_0x74b0('0x41')],qs['fields'](_0x469a5c[_0x74b0('0x3e')][_0x74b0('0x43')]));_0x45fa0e[_0x74b0('0x42')]=_0x45fa0e[_0x74b0('0x42')][_0x74b0('0x4c')]?_0x45fa0e[_0x74b0('0x42')]:_0x16e0a4[_0x74b0('0x41')];if(_0x469a5c[_0x74b0('0x3e')][_0x74b0('0x4d')]){_0x45fa0e[_0x74b0('0x4e')]=[{'all':!![]}];}_0x45fa0e=_[_0x74b0('0x48')]({},_0x45fa0e,_0x469a5c[_0x74b0('0x4f')]);return db['ChatMessage'][_0x74b0('0x50')](_0x45fa0e)['then'](handleEntityNotFound(_0x4e3b78,null))[_0x74b0('0x1b')](respondWithResult(_0x4e3b78,null))[_0x74b0('0x25')](handleError(_0x4e3b78,null));};exports['create']=function(_0x53ea7a,_0x45df59){return db[_0x74b0('0x38')][_0x74b0('0x51')](_0x53ea7a[_0x74b0('0x52')],{})[_0x74b0('0x1b')](respondWithResult(_0x45df59,0xc9))[_0x74b0('0x25')](handleError(_0x45df59,null));};exports[_0x74b0('0x31')]=function(_0x33e398,_0x1c8dbc){if(_0x33e398[_0x74b0('0x52')]['id']){delete _0x33e398[_0x74b0('0x52')]['id'];}return db[_0x74b0('0x38')][_0x74b0('0x50')]({'where':{'id':_0x33e398[_0x74b0('0x4b')]['id']}})[_0x74b0('0x1b')](handleEntityNotFound(_0x1c8dbc,null))[_0x74b0('0x1b')](saveUpdates(_0x33e398[_0x74b0('0x52')],null))[_0x74b0('0x1b')](respondWithResult(_0x1c8dbc,null))[_0x74b0('0x25')](handleError(_0x1c8dbc,null));};exports['destroy']=function(_0x1dda0e,_0x4e3680){return db[_0x74b0('0x38')][_0x74b0('0x50')]({'where':{'id':_0x1dda0e['params']['id']}})[_0x74b0('0x1b')](handleEntityNotFound(_0x4e3680,null))[_0x74b0('0x1b')](removeEntity(_0x4e3680,null))[_0x74b0('0x25')](handleError(_0x4e3680,null));};exports[_0x74b0('0x53')]=function(_0x50640d,_0xccd9b8){return db[_0x74b0('0x38')]['describe']()[_0x74b0('0x1b')](respondWithResult(_0xccd9b8,null))[_0x74b0('0x25')](handleError(_0xccd9b8,null));};var interaction_log=require(_0x74b0('0xf'))('chat-interactions');exports['accept']=function(_0x32de6c,_0x55f05f,_0x159803){var _0x5cc2f5={'agent':{},'channel':_0x74b0('0x54')};if(_0x32de6c[_0x74b0('0x52')]['id']){delete _0x32de6c[_0x74b0('0x52')]['id'];}_0x32de6c['body'][_0x74b0('0x55')]=!![];_0x32de6c[_0x74b0('0x52')][_0x74b0('0x56')]=moment()[_0x74b0('0x57')](_0x74b0('0x58'));_0x32de6c[_0x74b0('0x52')][_0x74b0('0x59')]=_0x32de6c[_0x74b0('0x52')]['UserId']||_0x32de6c[_0x74b0('0x5a')]['id'];_0x5cc2f5[_0x74b0('0x5b')]['id']=_0x32de6c['body'][_0x74b0('0x59')];return db[_0x74b0('0x38')]['find']({'where':{'id':_0x32de6c[_0x74b0('0x4b')]['id'],'UserId':null}})[_0x74b0('0x1b')](handleEntityNotFound(_0x55f05f,null))['then'](saveUpdates(_0x32de6c[_0x74b0('0x52')],null))['then'](function(_0x19a195){if(_0x19a195){_0x5cc2f5[_0x74b0('0x23')]=_0x19a195['get']({'plain':!![]});return db[_0x74b0('0x5c')][_0x74b0('0x50')]({'where':{'id':_0x19a195[_0x74b0('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x55f05f,null))[_0x74b0('0x1b')](function(_0xe0e58a){if(_0xe0e58a){return _0xe0e58a[_0x74b0('0x31')]({'UserId':_0x32de6c[_0x74b0('0x52')][_0x74b0('0x59')],'read1stAt':_[_0x74b0('0x5e')](_0xe0e58a[_0x74b0('0x5f')])?moment()[_0x74b0('0x57')](_0x74b0('0x58')):undefined});}return null;})['then'](function(_0x3ff17c){if(_0x3ff17c){_0x5cc2f5[_0x74b0('0x60')]=_0x3ff17c[_0x74b0('0x61')]({'plain':!![]});interaction_log[_0x74b0('0x1c')](_0x74b0('0x62'),_0x32de6c[_0x74b0('0x5a')]['id'],_0x32de6c[_0x74b0('0x5a')][_0x74b0('0x35')],_0x32de6c[_0x74b0('0x5a')][_0x74b0('0x63')],_0x5cc2f5[_0x74b0('0x60')]['id'],_0x32de6c['body']?JSON[_0x74b0('0x64')](_0x32de6c[_0x74b0('0x52')]):_0x74b0('0x65'));return respondWithRpcPromise(_0x74b0('0x66'),_0x74b0('0x67'),_0x5cc2f5);}return null;})[_0x74b0('0x1b')](function(_0x5811b6){var _0x3ca7b5=_0x74b0('0x68')+_0x5811b6[_0x74b0('0x23')][_0x74b0('0x69')];return db['sequelize'][_0x74b0('0x3e')](_0x3ca7b5,{'type':db['Sequelize'][_0x74b0('0x6a')][_0x74b0('0x6b')],'raw':!![]})[_0x74b0('0x1b')](function(_0x4d250c){return _0x4d250c;});})[_0x74b0('0x1b')](function(_0x461fd6){if(_0x461fd6){_0x5cc2f5[_0x74b0('0x23')]['contact']=_0x461fd6[0x0];if(!_0x32de6c[_0x74b0('0x52')][_0x74b0('0x59')])return;return db[_0x74b0('0x6c')][_0x74b0('0x50')]({'where':{'id':_0x32de6c['body']['UserId'],'role':_0x74b0('0x5b')},'attributes':['id',_0x74b0('0x35'),_0x74b0('0x6d'),_0x74b0('0x6e'),_0x74b0('0x6f')],'raw':!![]});}return null;})[_0x74b0('0x1b')](function(_0x30d2df){if(!_0x30d2df)return null;_0x5cc2f5[_0x74b0('0x23')]['agent']=_0x30d2df;return _0x5cc2f5;})['then'](function(_0x2228f2){if(_0x2228f2){if(_0x32de6c[_0x74b0('0x52')]['manual']){_0x5cc2f5[_0x74b0('0x23')][_0x74b0('0x70')]=util[_0x74b0('0x57')](_0x74b0('0x71'),_0x32de6c[_0x74b0('0x5a')]['name']);_0x5cc2f5[_0x74b0('0x23')][_0x74b0('0x72')]=_0x5cc2f5[_0x74b0('0x72')];_0x5cc2f5['message'][_0x74b0('0x73')]=_0x5cc2f5[_0x74b0('0x72')];_0x5cc2f5['message'][_0x74b0('0x74')]=_0x74b0('0x75');return respondWithRpcPromise('EventManager',_0x74b0('0x76'),{'event':'acceptmessage','message':_[_0x74b0('0x48')](_0x5cc2f5[_0x74b0('0x23')],JSON['parse'](_0x5cc2f5[_0x74b0('0x60')][_0x74b0('0x77')]))},client9002)[_0x74b0('0x1b')](function(){return _0x5cc2f5;});}return _0x5cc2f5;}return null;})['then'](respondWithResult(_0x55f05f,null))[_0x74b0('0x25')](handleError(_0x55f05f,null));};var interaction_log=require(_0x74b0('0xf'))('chat-interactions');exports[_0x74b0('0x2f')]=function(_0x4b00c5,_0x41953c,_0x3ffd21){var _0x25d1e8={'agent':{},'channel':'chat'};if(_0x4b00c5['body']['id']){delete _0x4b00c5[_0x74b0('0x52')]['id'];}_0x4b00c5[_0x74b0('0x52')][_0x74b0('0x59')]=_0x4b00c5['body'][_0x74b0('0x59')]||_0x4b00c5[_0x74b0('0x5a')]['id'];_0x25d1e8[_0x74b0('0x5b')]['id']=_0x4b00c5[_0x74b0('0x52')]['UserId'];return db['ChatMessage'][_0x74b0('0x50')]({'where':{'id':_0x4b00c5['params']['id'],'UserId':null}})[_0x74b0('0x1b')](handleEntityNotFound(_0x41953c,null))[_0x74b0('0x1b')](function(_0x5043b2){if(_0x5043b2){_0x25d1e8[_0x74b0('0x23')]=_0x5043b2['get']({'plain':!![]});return db['ChatInteraction'][_0x74b0('0x50')]({'where':{'id':_0x5043b2[_0x74b0('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x41953c,null))[_0x74b0('0x1b')](function(_0x55e7b0){if(_0x55e7b0){_0x25d1e8[_0x74b0('0x60')]=_0x55e7b0[_0x74b0('0x61')]({'plain':!![]});interaction_log[_0x74b0('0x1c')](_0x74b0('0x78'),_0x4b00c5[_0x74b0('0x5a')]['id'],_0x4b00c5[_0x74b0('0x5a')][_0x74b0('0x35')],_0x4b00c5[_0x74b0('0x5a')][_0x74b0('0x63')],_0x25d1e8['interaction']['id'],_0x4b00c5[_0x74b0('0x52')]?JSON[_0x74b0('0x64')](_0x4b00c5['body']):_0x74b0('0x65'));return respondWithRpcPromise(_0x74b0('0x79'),_0x74b0('0x7a'),_0x25d1e8);}return null;})[_0x74b0('0x1b')](function(_0x234162){var _0x4e03b9=_0x74b0('0x68')+_0x234162[_0x74b0('0x23')][_0x74b0('0x69')];return db[_0x74b0('0x7b')]['query'](_0x4e03b9,{'type':db[_0x74b0('0x7c')][_0x74b0('0x6a')]['SELECT'],'raw':!![]})[_0x74b0('0x1b')](function(_0xb4807a){return _0xb4807a;});})['then'](function(_0x1ee48e){if(_0x1ee48e){_0x25d1e8[_0x74b0('0x23')]['contact']=_0x1ee48e[0x0];if(!_0x4b00c5[_0x74b0('0x52')][_0x74b0('0x59')])return;return db['User']['find']({'where':{'id':_0x4b00c5[_0x74b0('0x52')]['UserId'],'role':'agent'},'attributes':['id',_0x74b0('0x35'),_0x74b0('0x6d'),_0x74b0('0x6e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x552804){if(!_0x552804)return null;_0x25d1e8[_0x74b0('0x23')][_0x74b0('0x5b')]=_0x552804;return _0x25d1e8;})[_0x74b0('0x1b')](function(_0x12d26e){if(_0x12d26e){_0x12d26e['message'][_0x74b0('0x70')]=util['format'](_0x74b0('0x71'),_0x4b00c5['user'][_0x74b0('0x35')]);_0x12d26e[_0x74b0('0x23')][_0x74b0('0x72')]=_0x25d1e8[_0x74b0('0x72')];_0x12d26e[_0x74b0('0x23')][_0x74b0('0x73')]=_0x25d1e8[_0x74b0('0x72')];_0x12d26e[_0x74b0('0x23')]['event']=_0x74b0('0x2f');respondWithRpcPromise('EventManager',_0x74b0('0x76'),{'event':_0x74b0('0x7d'),'message':_['merge'](_0x25d1e8[_0x74b0('0x23')],JSON[_0x74b0('0x7e')](_0x25d1e8['interaction'][_0x74b0('0x77')]))},client9002);return _0x25d1e8;}return null;})['then'](respondWithResult(_0x41953c,null))[_0x74b0('0x25')](handleError(_0x41953c,null));}; \ No newline at end of file +var _0xbb0f=['rejectMessage','ContactId','sequelize','motionChannel','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','params','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage'];(function(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0xbb0f,0x8d));var _0xfbb0=function(_0x5da3c0,_0x58c5b3){_0x5da3c0=_0x5da3c0-0x0;var _0x5d09f8=_0xbb0f[_0x5da3c0];return _0x5d09f8;};'use strict';var emlformat=require(_0xfbb0('0x0'));var rimraf=require(_0xfbb0('0x1'));var zipdir=require(_0xfbb0('0x2'));var jsonpatch=require(_0xfbb0('0x3'));var rp=require(_0xfbb0('0x4'));var moment=require(_0xfbb0('0x5'));var BPromise=require(_0xfbb0('0x6'));var Mustache=require('mustache');var util=require(_0xfbb0('0x7'));var path=require('path');var sox=require(_0xfbb0('0x8'));var csv=require(_0xfbb0('0x9'));var ejs=require(_0xfbb0('0xa'));var fs=require('fs');var fs_extra=require(_0xfbb0('0xb'));var _=require('lodash');var squel=require(_0xfbb0('0xc'));var crypto=require(_0xfbb0('0xd'));var jsforce=require(_0xfbb0('0xe'));var deskjs=require(_0xfbb0('0xf'));var toCsv=require(_0xfbb0('0x9'));var querystring=require(_0xfbb0('0x10'));var Papa=require(_0xfbb0('0x11'));var Redis=require('ioredis');var authService=require(_0xfbb0('0x12'));var qs=require(_0xfbb0('0x13'));var as=require(_0xfbb0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfbb0('0x15'))(_0xfbb0('0x16'));var utils=require(_0xfbb0('0x17'));var config=require(_0xfbb0('0x18'));var licenseUtil=require(_0xfbb0('0x19'));var db=require('../../mysqldb')['db'];config[_0xfbb0('0x1a')]=_[_0xfbb0('0x1b')](config[_0xfbb0('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xfbb0('0x1c'))(new Redis(config['redis']));require(_0xfbb0('0x1d'))[_0xfbb0('0x1e')](socket);var jayson=require(_0xfbb0('0x1f'));var client=jayson['client'][_0xfbb0('0x20')]({'port':0x232c});var client9002=jayson[_0xfbb0('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3351,_0x149760,_0x316ddd,_0x1bcc73){return new BPromise(function(_0x54c2c6,_0x1661cf){var _0x26765b=_0x1bcc73||client;return _0x26765b[_0xfbb0('0x22')](_0x2f3351,_0x316ddd)['then'](function(_0x2973ae){logger['info'](_0xfbb0('0x23'),_0x149760,'request\x20sent');logger[_0xfbb0('0x24')](_0xfbb0('0x25'),_0x149760,_0xfbb0('0x26'),JSON[_0xfbb0('0x27')](_0x2973ae));if(_0x2973ae[_0xfbb0('0x28')]){if(_0x2973ae[_0xfbb0('0x28')]['code']===0x1f4){logger[_0xfbb0('0x28')]('ChatMessage,\x20%s,\x20%s',_0x149760,_0x2973ae[_0xfbb0('0x28')][_0xfbb0('0x29')]);return _0x1661cf(_0x2973ae['error'][_0xfbb0('0x29')]);}logger[_0xfbb0('0x28')]('ChatMessage,\x20%s,\x20%s',_0x149760,_0x2973ae[_0xfbb0('0x28')][_0xfbb0('0x29')]);return _0x54c2c6(_0x2973ae[_0xfbb0('0x28')][_0xfbb0('0x29')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x149760,_0xfbb0('0x26'));_0x54c2c6(_0x2973ae[_0xfbb0('0x2a')]['message']);}})[_0xfbb0('0x2b')](function(_0x571df5){logger[_0xfbb0('0x28')](_0xfbb0('0x23'),_0x149760,_0x571df5);_0x1661cf(_0x571df5);});});}function respondWithStatusCode(_0x2a2a72,_0x2fd7a2){_0x2fd7a2=_0x2fd7a2||0xcc;return function(_0x5a117f){if(_0x5a117f){return _0x2a2a72['sendStatus'](_0x2fd7a2);}return _0x2a2a72[_0xfbb0('0x2c')](_0x2fd7a2)[_0xfbb0('0x2d')]();};}function respondWithResult(_0x15f06f,_0x38f449){_0x38f449=_0x38f449||0xc8;return function(_0x2dba69){if(_0x2dba69){return _0x15f06f['status'](_0x38f449)[_0xfbb0('0x2e')](_0x2dba69);}};}function respondWithFilteredResult(_0x230f54,_0x47e55d){return function(_0x3ad4d0){if(_0x3ad4d0){var _0xee7cf4=typeof _0x47e55d['offset']===_0xfbb0('0x2f')&&typeof _0x47e55d[_0xfbb0('0x30')]===_0xfbb0('0x2f');var _0x57f8c7=_0x3ad4d0[_0xfbb0('0x31')];var _0xb959e3=_0xee7cf4?0x0:_0x47e55d[_0xfbb0('0x32')];var _0x4fbd2a=_0xee7cf4?_0x3ad4d0[_0xfbb0('0x31')]:_0x47e55d[_0xfbb0('0x32')]+_0x47e55d[_0xfbb0('0x30')];var _0x68f449;if(_0x4fbd2a>=_0x57f8c7){_0x4fbd2a=_0x57f8c7;_0x68f449=0xc8;}else{_0x68f449=0xce;}_0x230f54['status'](_0x68f449);return _0x230f54[_0xfbb0('0x33')](_0xfbb0('0x34'),_0xb959e3+'-'+_0x4fbd2a+'/'+_0x57f8c7)[_0xfbb0('0x2e')](_0x3ad4d0);}return null;};}function patchUpdates(_0x5cdd90){return function(_0x1d5923){try{jsonpatch[_0xfbb0('0x35')](_0x1d5923,_0x5cdd90,!![]);}catch(_0x57b469){return BPromise[_0xfbb0('0x36')](_0x57b469);}return _0x1d5923[_0xfbb0('0x37')]();};}function saveUpdates(_0x246756,_0x12d6eb){return function(_0x9dbf2b){if(_0x9dbf2b){return _0x9dbf2b[_0xfbb0('0x38')](_0x246756)['then'](function(_0x20be67){return _0x20be67;});}return null;};}function removeEntity(_0x325d4b,_0x221144){return function(_0x18b8c2){if(_0x18b8c2){return _0x18b8c2['destroy']()[_0xfbb0('0x39')](function(){_0x325d4b[_0xfbb0('0x2c')](0xcc)[_0xfbb0('0x2d')]();});}};}function handleEntityNotFound(_0x39b6dd,_0xfda7eb){return function(_0x281e59){if(!_0x281e59){_0x39b6dd[_0xfbb0('0x3a')](0x194);}return _0x281e59;};}function handleError(_0x5d1929,_0x394048){_0x394048=_0x394048||0x1f4;return function(_0x409811){logger[_0xfbb0('0x28')](_0x409811[_0xfbb0('0x3b')]);if(_0x409811['name']){delete _0x409811[_0xfbb0('0x3c')];}_0x5d1929['status'](_0x394048)[_0xfbb0('0x3d')](_0x409811);};}exports[_0xfbb0('0x3e')]=function(_0x30159a,_0xe080dd){var _0x446daf={},_0x248e8c={},_0x59c087={'count':0x0,'rows':[]};var _0x3ec4d4=_[_0xfbb0('0x3f')](db[_0xfbb0('0x40')][_0xfbb0('0x41')],function(_0x2e8f40){return{'name':_0x2e8f40[_0xfbb0('0x42')],'type':_0x2e8f40['type']['key']};});_0x248e8c[_0xfbb0('0x43')]=_['map'](_0x3ec4d4,_0xfbb0('0x3c'));_0x248e8c[_0xfbb0('0x44')]=_[_0xfbb0('0x45')](_0x30159a[_0xfbb0('0x44')]);_0x248e8c[_0xfbb0('0x46')]=_[_0xfbb0('0x47')](_0x248e8c[_0xfbb0('0x43')],_0x248e8c['query']);_0x446daf[_0xfbb0('0x48')]=_[_0xfbb0('0x47')](_0x248e8c[_0xfbb0('0x43')],qs['fields'](_0x30159a[_0xfbb0('0x44')][_0xfbb0('0x49')]));_0x446daf['attributes']=_0x446daf[_0xfbb0('0x48')][_0xfbb0('0x4a')]?_0x446daf['attributes']:_0x248e8c[_0xfbb0('0x43')];if(!_0x30159a[_0xfbb0('0x44')][_0xfbb0('0x4b')]('nolimit')){_0x446daf[_0xfbb0('0x30')]=qs[_0xfbb0('0x30')](_0x30159a[_0xfbb0('0x44')][_0xfbb0('0x30')]);_0x446daf['offset']=qs[_0xfbb0('0x32')](_0x30159a[_0xfbb0('0x44')]['offset']);}_0x446daf['order']=qs[_0xfbb0('0x4c')](_0x30159a[_0xfbb0('0x44')][_0xfbb0('0x4c')]);_0x446daf['where']=qs[_0xfbb0('0x46')](_[_0xfbb0('0x4d')](_0x30159a[_0xfbb0('0x44')],_0x248e8c[_0xfbb0('0x46')]),_0x3ec4d4);if(_0x30159a[_0xfbb0('0x44')][_0xfbb0('0x4e')]){_0x446daf[_0xfbb0('0x4f')]=_[_0xfbb0('0x50')](_0x446daf[_0xfbb0('0x4f')],{'$or':_['map'](_0x3ec4d4,function(_0xfd33b4){if(_0xfd33b4[_0xfbb0('0x51')]!==_0xfbb0('0x52')){var _0x1c5d7b={};_0x1c5d7b[_0xfd33b4['name']]={'$like':'%'+_0x30159a[_0xfbb0('0x44')][_0xfbb0('0x4e')]+'%'};return _0x1c5d7b;}})});}_0x446daf=_[_0xfbb0('0x50')]({},_0x446daf,_0x30159a[_0xfbb0('0x53')]);var _0x5a4752={'where':_0x446daf[_0xfbb0('0x4f')]};return db[_0xfbb0('0x40')][_0xfbb0('0x31')](_0x5a4752)[_0xfbb0('0x39')](function(_0x4f6bda){_0x59c087[_0xfbb0('0x31')]=_0x4f6bda;if(_0x30159a[_0xfbb0('0x44')][_0xfbb0('0x54')]){_0x446daf[_0xfbb0('0x55')]=[{'all':!![]}];}return db[_0xfbb0('0x40')][_0xfbb0('0x56')](_0x446daf);})[_0xfbb0('0x39')](function(_0x57b2b7){_0x59c087['rows']=_0x57b2b7;return _0x59c087;})[_0xfbb0('0x39')](respondWithFilteredResult(_0xe080dd,_0x446daf))['catch'](handleError(_0xe080dd,null));};exports[_0xfbb0('0x57')]=function(_0x22865f,_0x537e07){var _0x471be1={'raw':!![],'where':{'id':_0x22865f['params']['id']}},_0x20f24f={};_0x20f24f['model']=_[_0xfbb0('0x45')](db[_0xfbb0('0x40')][_0xfbb0('0x41')]);_0x20f24f[_0xfbb0('0x44')]=_[_0xfbb0('0x45')](_0x22865f[_0xfbb0('0x44')]);_0x20f24f[_0xfbb0('0x46')]=_['intersection'](_0x20f24f['model'],_0x20f24f['query']);_0x471be1['attributes']=_[_0xfbb0('0x47')](_0x20f24f['model'],qs[_0xfbb0('0x49')](_0x22865f[_0xfbb0('0x44')]['fields']));_0x471be1[_0xfbb0('0x48')]=_0x471be1[_0xfbb0('0x48')]['length']?_0x471be1[_0xfbb0('0x48')]:_0x20f24f[_0xfbb0('0x43')];if(_0x22865f[_0xfbb0('0x44')][_0xfbb0('0x54')]){_0x471be1['include']=[{'all':!![]}];}_0x471be1=_['merge']({},_0x471be1,_0x22865f[_0xfbb0('0x53')]);return db[_0xfbb0('0x40')][_0xfbb0('0x58')](_0x471be1)[_0xfbb0('0x39')](handleEntityNotFound(_0x537e07,null))[_0xfbb0('0x39')](respondWithResult(_0x537e07,null))[_0xfbb0('0x2b')](handleError(_0x537e07,null));};exports[_0xfbb0('0x59')]=function(_0x32f2e4,_0x2da146){return db[_0xfbb0('0x40')][_0xfbb0('0x59')](_0x32f2e4[_0xfbb0('0x5a')],{})[_0xfbb0('0x39')](respondWithResult(_0x2da146,0xc9))[_0xfbb0('0x2b')](handleError(_0x2da146,null));};exports[_0xfbb0('0x38')]=function(_0x4cee27,_0x556c43){if(_0x4cee27[_0xfbb0('0x5a')]['id']){delete _0x4cee27['body']['id'];}return db['ChatMessage']['find']({'where':{'id':_0x4cee27[_0xfbb0('0x5b')]['id']}})[_0xfbb0('0x39')](handleEntityNotFound(_0x556c43,null))[_0xfbb0('0x39')](saveUpdates(_0x4cee27['body'],null))[_0xfbb0('0x39')](respondWithResult(_0x556c43,null))[_0xfbb0('0x2b')](handleError(_0x556c43,null));};exports['destroy']=function(_0x5a29d0,_0x1bf420){return db['ChatMessage'][_0xfbb0('0x58')]({'where':{'id':_0x5a29d0[_0xfbb0('0x5b')]['id']}})[_0xfbb0('0x39')](handleEntityNotFound(_0x1bf420,null))[_0xfbb0('0x39')](removeEntity(_0x1bf420,null))['catch'](handleError(_0x1bf420,null));};exports[_0xfbb0('0x5c')]=function(_0x3e6f5f,_0x2c5c29){return db[_0xfbb0('0x40')][_0xfbb0('0x5c')]()[_0xfbb0('0x39')](respondWithResult(_0x2c5c29,null))[_0xfbb0('0x2b')](handleError(_0x2c5c29,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xfbb0('0x5d')]=function(_0x54ee86,_0x2fd89b,_0xe997b1){var _0x4f22f4={'agent':{},'channel':_0xfbb0('0x5e')};if(_0x54ee86[_0xfbb0('0x5a')]['id']){delete _0x54ee86[_0xfbb0('0x5a')]['id'];}_0x54ee86[_0xfbb0('0x5a')][_0xfbb0('0x5f')]=!![];_0x54ee86['body'][_0xfbb0('0x60')]=moment()['format'](_0xfbb0('0x61'));_0x54ee86['body'][_0xfbb0('0x62')]=_0x54ee86[_0xfbb0('0x5a')][_0xfbb0('0x62')]||_0x54ee86[_0xfbb0('0x63')]['id'];_0x4f22f4[_0xfbb0('0x64')]['id']=_0x54ee86[_0xfbb0('0x5a')][_0xfbb0('0x62')];return db[_0xfbb0('0x40')]['find']({'where':{'id':_0x54ee86[_0xfbb0('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2fd89b,null))['then'](saveUpdates(_0x54ee86[_0xfbb0('0x5a')],null))[_0xfbb0('0x39')](function(_0x20c7cf){if(_0x20c7cf){_0x4f22f4['message']=_0x20c7cf[_0xfbb0('0x65')]({'plain':!![]});return db[_0xfbb0('0x66')][_0xfbb0('0x58')]({'where':{'id':_0x20c7cf[_0xfbb0('0x67')]}});}return null;})[_0xfbb0('0x39')](handleEntityNotFound(_0x2fd89b,null))[_0xfbb0('0x39')](function(_0x3685c2){if(_0x3685c2){return _0x3685c2['update']({'UserId':_0x54ee86[_0xfbb0('0x5a')]['UserId'],'read1stAt':_[_0xfbb0('0x68')](_0x3685c2[_0xfbb0('0x69')])?moment()['format'](_0xfbb0('0x61')):undefined});}return null;})[_0xfbb0('0x39')](function(_0x1b3c39){if(_0x1b3c39){_0x4f22f4[_0xfbb0('0x6a')]=_0x1b3c39[_0xfbb0('0x65')]({'plain':!![]});interaction_log[_0xfbb0('0x6b')](_0xfbb0('0x6c'),_0x54ee86[_0xfbb0('0x63')]['id'],_0x54ee86[_0xfbb0('0x63')][_0xfbb0('0x3c')],_0x54ee86['user'][_0xfbb0('0x6d')],_0x4f22f4[_0xfbb0('0x6a')]['id'],_0x54ee86[_0xfbb0('0x5a')]?JSON[_0xfbb0('0x27')](_0x54ee86[_0xfbb0('0x5a')]):_0xfbb0('0x6e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4f22f4);}return null;})['then'](function(_0xaafdf9){var _0x36800c=_0xfbb0('0x6f')+_0xaafdf9['message']['ContactId'];return db['sequelize'][_0xfbb0('0x44')](_0x36800c,{'type':db[_0xfbb0('0x70')][_0xfbb0('0x71')][_0xfbb0('0x72')],'raw':!![]})[_0xfbb0('0x39')](function(_0x1a1f80){return _0x1a1f80;});})['then'](function(_0x14b661){if(_0x14b661){_0x4f22f4[_0xfbb0('0x29')][_0xfbb0('0x73')]=_0x14b661[0x0];if(!_0x54ee86[_0xfbb0('0x5a')][_0xfbb0('0x62')])return;return db[_0xfbb0('0x74')][_0xfbb0('0x58')]({'where':{'id':_0x54ee86[_0xfbb0('0x5a')]['UserId'],'role':_0xfbb0('0x64')},'attributes':['id',_0xfbb0('0x3c'),_0xfbb0('0x75'),_0xfbb0('0x76'),_0xfbb0('0x77')],'raw':!![]});}return null;})[_0xfbb0('0x39')](function(_0x36840b){if(!_0x36840b)return null;_0x4f22f4['message'][_0xfbb0('0x64')]=_0x36840b;return _0x4f22f4;})['then'](function(_0x25b5fb){if(_0x25b5fb){if(_0x54ee86[_0xfbb0('0x5a')][_0xfbb0('0x78')]){_0x4f22f4[_0xfbb0('0x29')][_0xfbb0('0x79')]=util[_0xfbb0('0x7a')](_0xfbb0('0x7b'),_0x54ee86[_0xfbb0('0x63')]['name']);_0x4f22f4['message'][_0xfbb0('0x7c')]=_0x4f22f4[_0xfbb0('0x7c')];_0x4f22f4['message']['motionChannel']=_0x4f22f4['channel'];_0x4f22f4[_0xfbb0('0x29')][_0xfbb0('0x7d')]=_0xfbb0('0x5d');return respondWithRpcPromise(_0xfbb0('0x7e'),_0xfbb0('0x7e'),{'event':_0xfbb0('0x7f'),'message':_[_0xfbb0('0x50')](_0x4f22f4['message'],JSON[_0xfbb0('0x80')](_0x4f22f4[_0xfbb0('0x6a')][_0xfbb0('0x81')]))},client9002)[_0xfbb0('0x39')](function(){return _0x4f22f4;});}return _0x4f22f4;}return null;})['then'](respondWithResult(_0x2fd89b,null))['catch'](handleError(_0x2fd89b,null));};var interaction_log=require('../../config/logger')(_0xfbb0('0x82'));exports[_0xfbb0('0x36')]=function(_0x5e993c,_0x4560c0,_0xea0ae7){var _0x1ae81b={'agent':{},'channel':_0xfbb0('0x5e')};if(_0x5e993c[_0xfbb0('0x5a')]['id']){delete _0x5e993c['body']['id'];}_0x5e993c[_0xfbb0('0x5a')][_0xfbb0('0x62')]=_0x5e993c['body'][_0xfbb0('0x62')]||_0x5e993c[_0xfbb0('0x63')]['id'];_0x1ae81b[_0xfbb0('0x64')]['id']=_0x5e993c['body'][_0xfbb0('0x62')];return db[_0xfbb0('0x40')]['find']({'where':{'id':_0x5e993c[_0xfbb0('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4560c0,null))[_0xfbb0('0x39')](function(_0x233264){if(_0x233264){_0x1ae81b['message']=_0x233264[_0xfbb0('0x65')]({'plain':!![]});return db[_0xfbb0('0x66')][_0xfbb0('0x58')]({'where':{'id':_0x233264['ChatInteractionId']}});}return null;})[_0xfbb0('0x39')](handleEntityNotFound(_0x4560c0,null))[_0xfbb0('0x39')](function(_0x5428ae){if(_0x5428ae){_0x1ae81b[_0xfbb0('0x6a')]=_0x5428ae['get']({'plain':!![]});interaction_log[_0xfbb0('0x6b')](_0xfbb0('0x83'),_0x5e993c['user']['id'],_0x5e993c[_0xfbb0('0x63')][_0xfbb0('0x3c')],_0x5e993c[_0xfbb0('0x63')][_0xfbb0('0x6d')],_0x1ae81b['interaction']['id'],_0x5e993c[_0xfbb0('0x5a')]?JSON[_0xfbb0('0x27')](_0x5e993c[_0xfbb0('0x5a')]):_0xfbb0('0x6e'));return respondWithRpcPromise(_0xfbb0('0x84'),_0xfbb0('0x85'),_0x1ae81b);}return null;})[_0xfbb0('0x39')](function(_0x542145){var _0x29c001=_0xfbb0('0x6f')+_0x542145[_0xfbb0('0x29')][_0xfbb0('0x86')];return db[_0xfbb0('0x87')][_0xfbb0('0x44')](_0x29c001,{'type':db[_0xfbb0('0x70')][_0xfbb0('0x71')][_0xfbb0('0x72')],'raw':!![]})[_0xfbb0('0x39')](function(_0xe93da6){return _0xe93da6;});})['then'](function(_0x2cdb6b){if(_0x2cdb6b){_0x1ae81b[_0xfbb0('0x29')][_0xfbb0('0x73')]=_0x2cdb6b[0x0];if(!_0x5e993c['body']['UserId'])return;return db[_0xfbb0('0x74')][_0xfbb0('0x58')]({'where':{'id':_0x5e993c[_0xfbb0('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0xfbb0('0x3c'),_0xfbb0('0x75'),'email','internal'],'raw':!![]});}return null;})[_0xfbb0('0x39')](function(_0x29ee3e){if(!_0x29ee3e)return null;_0x1ae81b[_0xfbb0('0x29')][_0xfbb0('0x64')]=_0x29ee3e;return _0x1ae81b;})[_0xfbb0('0x39')](function(_0x3b9142){if(_0x3b9142){_0x3b9142['message'][_0xfbb0('0x79')]=util['format'](_0xfbb0('0x7b'),_0x5e993c[_0xfbb0('0x63')][_0xfbb0('0x3c')]);_0x3b9142[_0xfbb0('0x29')][_0xfbb0('0x7c')]=_0x1ae81b['channel'];_0x3b9142['message'][_0xfbb0('0x88')]=_0x1ae81b['channel'];_0x3b9142[_0xfbb0('0x29')][_0xfbb0('0x7d')]=_0xfbb0('0x36');respondWithRpcPromise(_0xfbb0('0x7e'),_0xfbb0('0x7e'),{'event':'rejectmessage','message':_[_0xfbb0('0x50')](_0x1ae81b[_0xfbb0('0x29')],JSON['parse'](_0x1ae81b[_0xfbb0('0x6a')]['formData']))},client9002);return _0x1ae81b;}return null;})[_0xfbb0('0x39')](respondWithResult(_0x4560c0,null))['catch'](handleError(_0x4560c0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 6829fbc..4f520e4 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 _0x24c4=['emit','hasOwnProperty','hook','exports','events','ChatMessage','update','remove'];(function(_0x2cddec,_0x163188){var _0x287acb=function(_0x1f30b1){while(--_0x1f30b1){_0x2cddec['push'](_0x2cddec['shift']());}};_0x287acb(++_0x163188);}(_0x24c4,0x134));var _0x424c=function(_0x156f51,_0x48e17){_0x156f51=_0x156f51-0x0;var _0x111d61=_0x24c4[_0x156f51];return _0x111d61;};'use strict';var EventEmitter=require(_0x424c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x424c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x424c('0x2'),'afterDestroy':_0x424c('0x3')};function emitEvent(_0x111a2c){return function(_0x42b9bf,_0x5a3e5d,_0x1f1717){ChatMessageEvents[_0x424c('0x4')](_0x111a2c+':'+_0x42b9bf['id'],_0x42b9bf);ChatMessageEvents[_0x424c('0x4')](_0x111a2c,_0x42b9bf);_0x1f1717(null);};}for(var e in events){if(events[_0x424c('0x5')](e)){var event=events[e];ChatMessage[_0x424c('0x6')](e,emitEvent(event));}}module[_0x424c('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x614e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x614e,0x9a));var _0xe614=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x614e[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xe614('0x0'));var ChatMessage=require(_0xe614('0x1'))['db'][_0xe614('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe614('0x3')](0x0);var events={'afterCreate':_0xe614('0x4'),'afterUpdate':_0xe614('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4cd353){return function(_0x601275,_0x5d9a5b,_0x44841b){ChatMessageEvents['emit'](_0x4cd353+':'+_0x601275['id'],_0x601275);ChatMessageEvents[_0xe614('0x6')](_0x4cd353,_0x601275);_0x44841b(null);};}for(var e in events){if(events[_0xe614('0x7')](e)){var event=events[e];ChatMessage[_0xe614('0x8')](e,emitEvent(event));}}module[_0xe614('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 0650f65..6641376 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 _0x6367=['./chatMessage.attributes','exports','define','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4838e2,_0x552238){var _0x2d8bed=function(_0xa8e141){while(--_0xa8e141){_0x4838e2['push'](_0x4838e2['shift']());}};_0x2d8bed(++_0x552238);}(_0x6367,0x1d5));var _0x7636=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6367[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x7636('0x0'));var logger=require('../../config/logger')(_0x7636('0x1'));var moment=require(_0x7636('0x2'));var BPromise=require(_0x7636('0x3'));var rp=require(_0x7636('0x4'));var fs=require('fs');var path=require(_0x7636('0x5'));var rimraf=require('rimraf');var config=require(_0x7636('0x6'));var attributes=require(_0x7636('0x7'));module[_0x7636('0x8')]=function(_0x1dee30,_0x5297d0){return _0x1dee30[_0x7636('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x7636('0xa'),'fields':[_0x7636('0xb')],'type':_0x7636('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a478a,_0x2e4141,_0x4cc5a6){var _0x140d97=_0x1dee30[_0x7636('0xd')];var _0x51bb02=_0x4a478a[_0x7636('0xe')]({'plain':!![]});if(_0x51bb02[_0x7636('0xf')][_0x7636('0x10')]()==='in'||_0x51bb02[_0x7636('0xf')][_0x7636('0x10')]()===_0x7636('0x11')&&!_0x51bb02[_0x7636('0x12')]&&!_[_0x7636('0x13')](_0x51bb02[_0x7636('0x14')])){_0x140d97['ChatInteraction'][_0x7636('0x15')]({'where':{'id':_0x51bb02[_0x7636('0x16')]}})['then'](function(_0x1fcfb8){if(_0x1fcfb8){_0x1fcfb8[_0x7636('0x17')]({'lastMsgAt':_0x51bb02['createdAt'],'lastMsgDirection':_0x51bb02[_0x7636('0xf')][_0x7636('0x10')]()});}})[_0x7636('0x18')](function(_0x55f36c){console[_0x7636('0x19')](_0x55f36c);});}_0x4cc5a6();}},'charset':_0x7636('0x1a'),'collate':_0x7636('0x1b')});}; \ No newline at end of file +var _0x8781=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','utf8mb4','lodash','util','api','moment','request-promise','rimraf'];(function(_0x568bd7,_0x23eea6){var _0x203cda=function(_0x26d94f){while(--_0x26d94f){_0x568bd7['push'](_0x568bd7['shift']());}};_0x203cda(++_0x23eea6);}(_0x8781,0x118));var _0x1878=function(_0x115e15,_0x5c5a94){_0x115e15=_0x115e15-0x0;var _0x57924b=_0x8781[_0x115e15];return _0x57924b;};'use strict';var _=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var logger=require('../../config/logger')(_0x1878('0x2'));var moment=require(_0x1878('0x3'));var BPromise=require('bluebird');var rp=require(_0x1878('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1878('0x5'));var config=require(_0x1878('0x6'));var attributes=require(_0x1878('0x7'));module[_0x1878('0x8')]=function(_0x21515f,_0x5745c7){return _0x21515f[_0x1878('0x9')](_0x1878('0xa'),attributes,{'tableName':_0x1878('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1878('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7c7243,_0x1ec2f0,_0x40fe0c){var _0x14a49d=_0x21515f[_0x1878('0xd')];var _0x2110fd=_0x7c7243['get']({'plain':!![]});if(_0x2110fd[_0x1878('0xe')][_0x1878('0xf')]()==='in'||_0x2110fd[_0x1878('0xe')][_0x1878('0xf')]()===_0x1878('0x10')&&!_0x2110fd[_0x1878('0x11')]&&!_[_0x1878('0x12')](_0x2110fd[_0x1878('0x13')])){_0x14a49d['ChatInteraction'][_0x1878('0x14')]({'where':{'id':_0x2110fd[_0x1878('0x15')]}})[_0x1878('0x16')](function(_0x2b01cf){if(_0x2b01cf){_0x2b01cf[_0x1878('0x17')]({'lastMsgAt':_0x2110fd[_0x1878('0x18')],'lastMsgDirection':_0x2110fd[_0x1878('0xe')][_0x1878('0xf')]()});}})['catch'](function(_0x18ce07){console['error'](_0x18ce07);});}_0x40fe0c();}},'charset':_0x1878('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index dc8fdac..659f29a 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 _0xdaa3=['ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x615802,_0x4dca0c){var _0x4adf7a=function(_0x3b3b11){while(--_0x3b3b11){_0x615802['push'](_0x615802['shift']());}};_0x4adf7a(++_0x4dca0c);}(_0xdaa3,0xe0));var _0x3daa=function(_0x22ffcf,_0x19de8b){_0x22ffcf=_0x22ffcf-0x0;var _0x2bd6ca=_0xdaa3[_0x22ffcf];return _0x2bd6ca;};'use strict';var _=require(_0x3daa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3daa('0x1'));var rs=require(_0x3daa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3daa('0x3'))['db'];var utils=require(_0x3daa('0x4'));var logger=require(_0x3daa('0x5'))(_0x3daa('0x6'));var config=require(_0x3daa('0x7'));var jayson=require(_0x3daa('0x8'));var client=jayson[_0x3daa('0x9')][_0x3daa('0xa')]({'port':0x232a});config[_0x3daa('0xb')]=_[_0x3daa('0xc')](config['redis'],{'host':_0x3daa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3daa('0xb')]));require(_0x3daa('0xe'))[_0x3daa('0xf')](socket);function respondWithRpcPromise(_0x4e1717,_0x1acb76,_0x5d5cb7){return new BPromise(function(_0x15e0f5,_0x2a6cbe){return client[_0x3daa('0x10')](_0x4e1717,_0x5d5cb7)[_0x3daa('0x11')](function(_0xb4acd0){logger[_0x3daa('0x12')](_0x3daa('0x13'),_0x1acb76,'request\x20sent');logger[_0x3daa('0x14')](_0x3daa('0x15'),_0x1acb76,_0x3daa('0x16'),JSON[_0x3daa('0x17')](_0xb4acd0));if(_0xb4acd0[_0x3daa('0x18')]){if(_0xb4acd0['error'][_0x3daa('0x19')]===0x1f4){logger[_0x3daa('0x18')]('ChatMessage,\x20%s,\x20%s',_0x1acb76,_0xb4acd0['error']['message']);return _0x2a6cbe(_0xb4acd0[_0x3daa('0x18')][_0x3daa('0x1a')]);}logger[_0x3daa('0x18')](_0x3daa('0x13'),_0x1acb76,_0xb4acd0[_0x3daa('0x18')][_0x3daa('0x1a')]);return _0x15e0f5(_0xb4acd0[_0x3daa('0x18')][_0x3daa('0x1a')]);}else{logger[_0x3daa('0x12')]('ChatMessage,\x20%s,\x20%s',_0x1acb76,_0x3daa('0x16'));_0x15e0f5(_0xb4acd0[_0x3daa('0x1b')]['message']);}})[_0x3daa('0x1c')](function(_0x365fe1){logger['error'](_0x3daa('0x13'),_0x1acb76,_0x365fe1);_0x2a6cbe(_0x365fe1);});});}exports[_0x3daa('0x1d')]=function(_0x248a79){var _0x1fa2dc=this;return new Promise(function(_0x5d1f89,_0xf60b9b){return db[_0x3daa('0x1e')][_0x3daa('0x1f')](_0x248a79[_0x3daa('0x20')],{'raw':_0x248a79[_0x3daa('0x21')]?_0x248a79[_0x3daa('0x21')][_0x3daa('0x22')]===undefined?!![]:![]:!![]})[_0x3daa('0x11')](function(_0x12ba8a){logger['info']('CreateChatMessage',_0x248a79);logger[_0x3daa('0x14')](_0x3daa('0x1d'),_0x248a79,JSON['stringify'](_0x12ba8a));_0x5d1f89(_0x12ba8a);})['catch'](function(_0x138606){logger[_0x3daa('0x18')](_0x3daa('0x1d'),_0x138606[_0x3daa('0x1a')],_0x248a79);_0xf60b9b(_0x1fa2dc[_0x3daa('0x18')](0x1f4,_0x138606[_0x3daa('0x1a')]));});});}; \ No newline at end of file +var _0x818b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create','options','raw','debug','CreateChatMessage','lodash','util'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x818b,0x152));var _0xb818=function(_0x26b047,_0x3988e0){_0x26b047=_0x26b047-0x0;var _0x2826b8=_0x818b[_0x26b047];return _0x2826b8;};'use strict';var _=require(_0xb818('0x0'));var util=require(_0xb818('0x1'));var moment=require(_0xb818('0x2'));var BPromise=require(_0xb818('0x3'));var rs=require(_0xb818('0x4'));var fs=require('fs');var Redis=require(_0xb818('0x5'));var db=require(_0xb818('0x6'))['db'];var utils=require(_0xb818('0x7'));var logger=require('../../config/logger')(_0xb818('0x8'));var config=require(_0xb818('0x9'));var jayson=require(_0xb818('0xa'));var client=jayson[_0xb818('0xb')][_0xb818('0xc')]({'port':0x232a});config[_0xb818('0xd')]=_['defaults'](config[_0xb818('0xd')],{'host':_0xb818('0xe'),'port':0x18eb});var socket=require(_0xb818('0xf'))(new Redis(config[_0xb818('0xd')]));require(_0xb818('0x10'))['register'](socket);function respondWithRpcPromise(_0x2632b6,_0x4db179,_0x417c60){return new BPromise(function(_0x3caac1,_0x21e7cc){return client[_0xb818('0x11')](_0x2632b6,_0x417c60)[_0xb818('0x12')](function(_0x1e9244){logger[_0xb818('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4db179,'request\x20sent');logger['debug'](_0xb818('0x14'),_0x4db179,_0xb818('0x15'),JSON['stringify'](_0x1e9244));if(_0x1e9244[_0xb818('0x16')]){if(_0x1e9244[_0xb818('0x16')][_0xb818('0x17')]===0x1f4){logger[_0xb818('0x16')](_0xb818('0x18'),_0x4db179,_0x1e9244['error'][_0xb818('0x19')]);return _0x21e7cc(_0x1e9244[_0xb818('0x16')][_0xb818('0x19')]);}logger[_0xb818('0x16')](_0xb818('0x18'),_0x4db179,_0x1e9244[_0xb818('0x16')][_0xb818('0x19')]);return _0x3caac1(_0x1e9244['error'][_0xb818('0x19')]);}else{logger[_0xb818('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4db179,_0xb818('0x15'));_0x3caac1(_0x1e9244[_0xb818('0x1a')][_0xb818('0x19')]);}})[_0xb818('0x1b')](function(_0x155319){logger['error'](_0xb818('0x18'),_0x4db179,_0x155319);_0x21e7cc(_0x155319);});});}exports['CreateChatMessage']=function(_0xa3af14){var _0x44f5b3=this;return new Promise(function(_0x10c02a,_0x291854){return db[_0xb818('0x1c')][_0xb818('0x1d')](_0xa3af14['body'],{'raw':_0xa3af14[_0xb818('0x1e')]?_0xa3af14['options'][_0xb818('0x1f')]===undefined?!![]:![]:!![]})[_0xb818('0x12')](function(_0x1e73e6){logger[_0xb818('0x13')]('CreateChatMessage',_0xa3af14);logger[_0xb818('0x20')](_0xb818('0x21'),_0xa3af14,JSON['stringify'](_0x1e73e6));_0x10c02a(_0x1e73e6);})[_0xb818('0x1b')](function(_0x21d10e){logger[_0xb818('0x16')](_0xb818('0x21'),_0x21d10e[_0xb818('0x19')],_0xa3af14);_0x291854(_0x44f5b3[_0xb818('0x16')](0x1f4,_0x21d10e[_0xb818('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ae32cbb..c773e62 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 _0xe0ae=['update','emit','removeListener','length','chatMessage:','remove'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xe0ae,0xa1));var _0xee0a=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xe0ae[_0x176329];return _0x31997c;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xee0a('0x0'),_0xee0a('0x1')];function createListener(_0x49a5e2,_0x42f3f6){return function(_0x4fa2cf){_0x42f3f6[_0xee0a('0x2')](_0x49a5e2,_0x4fa2cf);};}function removeListener(_0x45bbca,_0x4cd518){return function(){ChatMessageEvents[_0xee0a('0x3')](_0x45bbca,_0x4cd518);};}exports['register']=function(_0x5bef07){for(var _0x39a302=0x0,_0x1c5071=events[_0xee0a('0x4')];_0x39a302<_0x1c5071;_0x39a302++){var _0x344355=events[_0x39a302];var _0x5e6d2e=createListener(_0xee0a('0x5')+_0x344355,_0x5bef07);ChatMessageEvents['on'](_0x344355,_0x5e6d2e);}}; \ No newline at end of file +var _0x3d6d=['update','emit','removeListener','length','./chatMessage.events','save','remove'];(function(_0x553952,_0x566b64){var _0x4040a3=function(_0x3ae023){while(--_0x3ae023){_0x553952['push'](_0x553952['shift']());}};_0x4040a3(++_0x566b64);}(_0x3d6d,0xb3));var _0xd3d6=function(_0xb64e9e,_0x519fb2){_0xb64e9e=_0xb64e9e-0x0;var _0x1c63f4=_0x3d6d[_0xb64e9e];return _0x1c63f4;};'use strict';var ChatMessageEvents=require(_0xd3d6('0x0'));var events=[_0xd3d6('0x1'),_0xd3d6('0x2'),_0xd3d6('0x3')];function createListener(_0x380c09,_0x1e1915){return function(_0x366f41){_0x1e1915[_0xd3d6('0x4')](_0x380c09,_0x366f41);};}function removeListener(_0x297bd6,_0x3d5e37){return function(){ChatMessageEvents[_0xd3d6('0x5')](_0x297bd6,_0x3d5e37);};}exports['register']=function(_0x5400f8){for(var _0x3f36=0x0,_0x1f02f5=events[_0xd3d6('0x6')];_0x3f36<_0x1f02f5;_0x3f36++){var _0x3c2a9b=events[_0x3f36];var _0x4356b7=createListener('chatMessage:'+_0x3c2a9b,_0x5400f8);ChatMessageEvents['on'](_0x3c2a9b,_0x4356b7);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 96d3969..d32d6fb 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 _0xe928=['show','post','tracked','chat','create','put','update','/:id/accept','accept','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x5a82c2,_0x57b813){var _0x5e10fc=function(_0xd56c47){while(--_0xd56c47){_0x5a82c2['push'](_0x5a82c2['shift']());}};_0x5e10fc(++_0x57b813);}(_0xe928,0xd0));var _0x8e92=function(_0x236f0a,_0xdda8f1){_0x236f0a=_0x236f0a-0x0;var _0x1b7512=_0xe928[_0x236f0a];return _0x1b7512;};'use strict';var multer=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var path=require('path');var timeout=require(_0x8e92('0x2'));var express=require('express');var router=express[_0x8e92('0x3')]();var fs_extra=require(_0x8e92('0x4'));var auth=require(_0x8e92('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e92('0x6'));var controller=require('./chatMessage.controller');router[_0x8e92('0x7')]('/',auth[_0x8e92('0x8')](),controller['index']);router['get'](_0x8e92('0x9'),auth['isAuthenticated'](),controller[_0x8e92('0xa')]);router[_0x8e92('0x7')](_0x8e92('0xb'),auth[_0x8e92('0x8')](),controller[_0x8e92('0xc')]);router[_0x8e92('0xd')]('/',auth[_0x8e92('0x8')](),interaction[_0x8e92('0xe')](_0x8e92('0xf'),'chatmessage:create'),controller[_0x8e92('0x10')]);router[_0x8e92('0x11')](_0x8e92('0xb'),controller[_0x8e92('0x12')]);router[_0x8e92('0x11')](_0x8e92('0x13'),auth[_0x8e92('0x8')](),controller[_0x8e92('0x14')]);router['put']('/:id/reject',auth[_0x8e92('0x8')](),controller['reject']);router['delete'](_0x8e92('0xb'),auth[_0x8e92('0x8')](),controller[_0x8e92('0x15')]);module['exports']=router; \ No newline at end of file +var _0x90ba=['show','chatmessage:create','create','put','/:id','update','/:id/accept','accept','reject','delete','isAuthenticated','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','index','/describe'];(function(_0x570995,_0x2dffdf){var _0x3b7ee9=function(_0x31652b){while(--_0x31652b){_0x570995['push'](_0x570995['shift']());}};_0x3b7ee9(++_0x2dffdf);}(_0x90ba,0x15d));var _0xa90b=function(_0x2422bd,_0x1120d2){_0x2422bd=_0x2422bd-0x0;var _0x1a6113=_0x90ba[_0x2422bd];return _0x1a6113;};'use strict';var multer=require(_0xa90b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa90b('0x1'));var express=require(_0xa90b('0x2'));var router=express[_0xa90b('0x3')]();var fs_extra=require(_0xa90b('0x4'));var auth=require(_0xa90b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa90b('0x6'));var controller=require(_0xa90b('0x7'));router[_0xa90b('0x8')]('/',auth['isAuthenticated'](),controller[_0xa90b('0x9')]);router[_0xa90b('0x8')](_0xa90b('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa90b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa90b('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0xa90b('0xc')),controller[_0xa90b('0xd')]);router[_0xa90b('0xe')](_0xa90b('0xf'),controller[_0xa90b('0x10')]);router[_0xa90b('0xe')](_0xa90b('0x11'),auth['isAuthenticated'](),controller[_0xa90b('0x12')]);router[_0xa90b('0xe')]('/:id/reject',auth['isAuthenticated'](),controller[_0xa90b('0x13')]);router[_0xa90b('0x14')]('/:id',auth[_0xa90b('0x15')](),controller[_0xa90b('0x16')]);module[_0xa90b('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 9b7d301..6eb2da1 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(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0x0b0e[_0x3b4b1d];return _0x488c36;};'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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x3cb4d8,_0x382da8){var _0x28c8c8=function(_0x20f457){while(--_0x20f457){_0x3cb4d8['push'](_0x3cb4d8['shift']());}};_0x28c8c8(++_0x382da8);}(_0xdb28,0x106));var _0x8db2=function(_0x547b15,_0xb2899f){_0x547b15=_0x547b15-0x0;var _0x3ae536=_0xdb28[_0x547b15];return _0x3ae536;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a0aa2bb..1737118 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x313649,_0x20c268){var _0x2e8a6c=function(_0x25c05d){while(--_0x25c05d){_0x313649['push'](_0x313649['shift']());}};_0x2e8a6c(++_0x20c268);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7a54,0x106));var _0x47a5=function(_0x42892e,_0x3011cf){_0x42892e=_0x42892e-0x0;var _0x1f0825=_0x7a54[_0x42892e];return _0x1f0825;};'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 2df8fbb..52761f3 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 _0xe108=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x421e6b,_0x4fa4c4){var _0x1969d5=function(_0x40042a){while(--_0x40042a){_0x421e6b['push'](_0x421e6b['shift']());}};_0x1969d5(++_0x4fa4c4);}(_0xe108,0x6b));var _0x8e10=function(_0x2c8afe,_0x100f80){_0x2c8afe=_0x2c8afe-0x0;var _0x982977=_0xe108[_0x2c8afe];return _0x982977;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x8e10('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8e10('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e10('0x2'),'afterDestroy':_0x8e10('0x3')};function emitEvent(_0x3ba22c){return function(_0x5bba28,_0x18df45,_0x287494){ChatOfflineMessageEvents['emit'](_0x3ba22c+':'+_0x5bba28['id'],_0x5bba28);ChatOfflineMessageEvents[_0x8e10('0x4')](_0x3ba22c,_0x5bba28);_0x287494(null);};}for(var e in events){if(events[_0x8e10('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x8e10('0x6')](e,emitEvent(event));}}module[_0x8e10('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x80c3=['events','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x5a2d30,_0x4257c9){var _0x4d5d6c=function(_0x1bdff5){while(--_0x1bdff5){_0x5a2d30['push'](_0x5a2d30['shift']());}};_0x4d5d6c(++_0x4257c9);}(_0x80c3,0x18f));var _0x380c=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x80c3[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require(_0x380c('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x380c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x380c('0x2'),'afterDestroy':_0x380c('0x3')};function emitEvent(_0x24728a){return function(_0x52fd7e,_0x565a08,_0x553158){ChatOfflineMessageEvents[_0x380c('0x4')](_0x24728a+':'+_0x52fd7e['id'],_0x52fd7e);ChatOfflineMessageEvents['emit'](_0x24728a,_0x52fd7e);_0x553158(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x380c('0x5')](e,emitEvent(event));}}module[_0x380c('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index e0436a9..5c36b4c 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 _0x1d1a=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x33c663,_0x4416ed){var _0x4c6299=function(_0x4c1937){while(--_0x4c1937){_0x33c663['push'](_0x33c663['shift']());}};_0x4c6299(++_0x4416ed);}(_0x1d1a,0x153));var _0xa1d1=function(_0x2c182d,_0x55f3fa){_0x2c182d=_0x2c182d-0x0;var _0x5d359e=_0x1d1a[_0x2c182d];return _0x5d359e;};'use strict';var attributes=require(_0xa1d1('0x0'));module[_0xa1d1('0x1')]=function(_0xdb4786){return _0xdb4786[_0xa1d1('0x2')](_0xa1d1('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa1d1('0x4'),'collate':_0xa1d1('0x5')});}; \ No newline at end of file +var _0x350c=['utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x27d8a6,_0x420cba){var _0x4ebf0d=function(_0x21f982){while(--_0x21f982){_0x27d8a6['push'](_0x27d8a6['shift']());}};_0x4ebf0d(++_0x420cba);}(_0x350c,0x8c));var _0xc350=function(_0x5721ec,_0x29dc91){_0x5721ec=_0x5721ec-0x0;var _0x27a36a=_0x350c[_0x5721ec];return _0x27a36a;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xc350('0x0')]=function(_0x5aaf86){return _0x5aaf86[_0xc350('0x1')](_0xc350('0x2'),attributes,{'tableName':_0xc350('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc350('0x4'),'collate':_0xc350('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 4d0dd02..4c79b73 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 _0xdb60=['result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','error','code','ChatOfflineMessage,\x20%s,\x20%s','message'];(function(_0x2e4545,_0xc5d28e){var _0x473ffd=function(_0x29c0f5){while(--_0x29c0f5){_0x2e4545['push'](_0x2e4545['shift']());}};_0x473ffd(++_0xc5d28e);}(_0xdb60,0xd3));var _0x0db6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdb60[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0db6('0x0'));var util=require('util');var moment=require(_0x0db6('0x1'));var BPromise=require(_0x0db6('0x2'));var rs=require(_0x0db6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0db6('0x4'));var logger=require(_0x0db6('0x5'))('rpc');var config=require(_0x0db6('0x6'));var jayson=require(_0x0db6('0x7'));var client=jayson[_0x0db6('0x8')][_0x0db6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b02f6,_0x220308,_0x49656d){return new BPromise(function(_0x1c051b,_0x48e6a7){return client[_0x0db6('0xa')](_0x5b02f6,_0x49656d)['then'](function(_0x3e4c40){logger[_0x0db6('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x220308,_0x0db6('0xc'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x220308,'request\x20sent',JSON['stringify'](_0x3e4c40));if(_0x3e4c40[_0x0db6('0xd')]){if(_0x3e4c40[_0x0db6('0xd')][_0x0db6('0xe')]===0x1f4){logger[_0x0db6('0xd')](_0x0db6('0xf'),_0x220308,_0x3e4c40[_0x0db6('0xd')]['message']);return _0x48e6a7(_0x3e4c40[_0x0db6('0xd')][_0x0db6('0x10')]);}logger[_0x0db6('0xd')](_0x0db6('0xf'),_0x220308,_0x3e4c40[_0x0db6('0xd')][_0x0db6('0x10')]);return _0x1c051b(_0x3e4c40['error'][_0x0db6('0x10')]);}else{logger['info'](_0x0db6('0xf'),_0x220308,'request\x20sent');_0x1c051b(_0x3e4c40[_0x0db6('0x11')][_0x0db6('0x10')]);}})[_0x0db6('0x12')](function(_0x4c2432){logger[_0x0db6('0xd')](_0x0db6('0xf'),_0x220308,_0x4c2432);_0x48e6a7(_0x4c2432);});});} \ No newline at end of file +var _0x151b=['../../config/environment','jayson/promise','client','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x23586c,_0x354b0f){var _0x154bed=function(_0x10de3d){while(--_0x10de3d){_0x23586c['push'](_0x23586c['shift']());}};_0x154bed(++_0x354b0f);}(_0x151b,0x1dc));var _0xb151=function(_0x5db979,_0x110889){_0x5db979=_0x5db979-0x0;var _0x4a28c6=_0x151b[_0x5db979];return _0x4a28c6;};'use strict';var _=require(_0xb151('0x0'));var util=require('util');var moment=require(_0xb151('0x1'));var BPromise=require(_0xb151('0x2'));var rs=require(_0xb151('0x3'));var fs=require('fs');var Redis=require(_0xb151('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb151('0x5'));var logger=require('../../config/logger')(_0xb151('0x6'));var config=require(_0xb151('0x7'));var jayson=require(_0xb151('0x8'));var client=jayson[_0xb151('0x9')][_0xb151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be3b3,_0x107560,_0x5b0d37){return new BPromise(function(_0x599e73,_0x325b7e){return client['request'](_0x1be3b3,_0x5b0d37)['then'](function(_0x1950f0){logger[_0xb151('0xb')](_0xb151('0xc'),_0x107560,_0xb151('0xd'));logger[_0xb151('0xe')](_0xb151('0xf'),_0x107560,'request\x20sent',JSON[_0xb151('0x10')](_0x1950f0));if(_0x1950f0[_0xb151('0x11')]){if(_0x1950f0['error'][_0xb151('0x12')]===0x1f4){logger[_0xb151('0x11')](_0xb151('0xc'),_0x107560,_0x1950f0[_0xb151('0x11')][_0xb151('0x13')]);return _0x325b7e(_0x1950f0[_0xb151('0x11')][_0xb151('0x13')]);}logger[_0xb151('0x11')](_0xb151('0xc'),_0x107560,_0x1950f0[_0xb151('0x11')][_0xb151('0x13')]);return _0x599e73(_0x1950f0[_0xb151('0x11')][_0xb151('0x13')]);}else{logger[_0xb151('0xb')](_0xb151('0xc'),_0x107560,_0xb151('0xd'));_0x599e73(_0x1950f0[_0xb151('0x14')][_0xb151('0x13')]);}})['catch'](function(_0x394966){logger[_0xb151('0x11')](_0xb151('0xc'),_0x107560,_0x394966);_0x325b7e(_0x394966);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index abbf46b..1446352 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 _0xa3ca=['delete','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','post','create','put','update'];(function(_0x2df630,_0x39d2d9){var _0xf81f7f=function(_0x262159){while(--_0x262159){_0x2df630['push'](_0x2df630['shift']());}};_0xf81f7f(++_0x39d2d9);}(_0xa3ca,0xf0));var _0xaa3c=function(_0x5e01ca,_0x2e113e){_0x5e01ca=_0x5e01ca-0x0;var _0x482dcd=_0xa3ca[_0x5e01ca];return _0x482dcd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa3c('0x0'));var timeout=require('connect-timeout');var express=require(_0xaa3c('0x1'));var router=express['Router']();var fs_extra=require(_0xaa3c('0x2'));var auth=require(_0xaa3c('0x3'));var interaction=require(_0xaa3c('0x4'));var config=require(_0xaa3c('0x5'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0xaa3c('0x6')](),controller[_0xaa3c('0x7')]);router['get'](_0xaa3c('0x8'),auth[_0xaa3c('0x6')](),controller['describe']);router[_0xaa3c('0x9')](_0xaa3c('0xa'),auth[_0xaa3c('0x6')](),controller['show']);router[_0xaa3c('0xb')]('/',auth[_0xaa3c('0x6')](),controller[_0xaa3c('0xc')]);router[_0xaa3c('0xd')](_0xaa3c('0xa'),auth[_0xaa3c('0x6')](),controller[_0xaa3c('0xe')]);router[_0xaa3c('0xf')](_0xaa3c('0xa'),auth[_0xaa3c('0x6')](),controller['destroy']);module[_0xaa3c('0x10')]=router; \ No newline at end of file +var _0xe826=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f26b5,_0x58dd90){var _0xe917d5=function(_0x1fe007){while(--_0x1fe007){_0x2f26b5['push'](_0x2f26b5['shift']());}};_0xe917d5(++_0x58dd90);}(_0xe826,0xf4));var _0x6e82=function(_0x2179e3,_0x3f7767){_0x2179e3=_0x2179e3-0x0;var _0x3a350b=_0xe826[_0x2179e3];return _0x3a350b;};'use strict';var multer=require(_0x6e82('0x0'));var util=require(_0x6e82('0x1'));var path=require(_0x6e82('0x2'));var timeout=require(_0x6e82('0x3'));var express=require('express');var router=express[_0x6e82('0x4')]();var fs_extra=require(_0x6e82('0x5'));var auth=require(_0x6e82('0x6'));var interaction=require(_0x6e82('0x7'));var config=require(_0x6e82('0x8'));var controller=require(_0x6e82('0x9'));router[_0x6e82('0xa')]('/',auth[_0x6e82('0xb')](),controller[_0x6e82('0xc')]);router[_0x6e82('0xa')](_0x6e82('0xd'),auth['isAuthenticated'](),controller[_0x6e82('0xe')]);router[_0x6e82('0xa')](_0x6e82('0xf'),auth['isAuthenticated'](),controller[_0x6e82('0x10')]);router[_0x6e82('0x11')]('/',auth['isAuthenticated'](),controller[_0x6e82('0x12')]);router['put'](_0x6e82('0xf'),auth[_0x6e82('0xb')](),controller[_0x6e82('0x13')]);router[_0x6e82('0x14')](_0x6e82('0xf'),auth[_0x6e82('0xb')](),controller[_0x6e82('0x15')]);module[_0x6e82('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 530b965..62cc93f 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 _0xc11d=['ENUM','mouseOver','INTEGER','sequelize','exports'];(function(_0x43a753,_0xdaf919){var _0x24fef0=function(_0x5f18db){while(--_0x5f18db){_0x43a753['push'](_0x43a753['shift']());}};_0x24fef0(++_0xdaf919);}(_0xc11d,0xad));var _0xdc11=function(_0x447de3,_0x8d7994){_0x447de3=_0x447de3-0x0;var _0x49d79c=_0xc11d[_0x447de3];return _0x49d79c;};'use strict';var Sequelize=require(_0xdc11('0x0'));module[_0xdc11('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xdc11('0x2')]('mouseOver','timeout'),'defaultValue':_0xdc11('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdc11('0x4')]}}; \ No newline at end of file +var _0x5b7d=['exports','ENUM','mouseOver','INTEGER'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0x5b7d,0x80));var _0xd5b7=function(_0x5dd742,_0x574fc8){_0x5dd742=_0x5dd742-0x0;var _0x2bbc75=_0x5b7d[_0x5dd742];return _0x2bbc75;};'use strict';var Sequelize=require('sequelize');module[_0xd5b7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd5b7('0x1')](_0xd5b7('0x2'),'timeout'),'defaultValue':_0xd5b7('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd5b7('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index e1d5f60..1d43b78 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 _0xb8ca=['Content-Range','apply','update','then','destroy','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0xf06b98,_0x2e921c){var _0x5bdd46=function(_0x249800){while(--_0x249800){_0xf06b98['push'](_0xf06b98['shift']());}};_0x5bdd46(++_0x2e921c);}(_0xb8ca,0x89));var _0xab8c=function(_0x1e88b0,_0x48448b){_0x1e88b0=_0x1e88b0-0x0;var _0x48402f=_0xb8ca[_0x1e88b0];return _0x48402f;};'use strict';var emlformat=require(_0xab8c('0x0'));var rimraf=require(_0xab8c('0x1'));var zipdir=require(_0xab8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab8c('0x3'));var moment=require(_0xab8c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab8c('0x5'));var path=require(_0xab8c('0x6'));var sox=require(_0xab8c('0x7'));var csv=require(_0xab8c('0x8'));var ejs=require(_0xab8c('0x9'));var fs=require('fs');var fs_extra=require(_0xab8c('0xa'));var _=require(_0xab8c('0xb'));var squel=require('squel');var crypto=require(_0xab8c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xab8c('0xd'));var toCsv=require(_0xab8c('0x8'));var querystring=require(_0xab8c('0xe'));var Papa=require(_0xab8c('0xf'));var Redis=require(_0xab8c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xab8c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab8c('0x12'));var utils=require(_0xab8c('0x13'));var config=require(_0xab8c('0x14'));var licenseUtil=require(_0xab8c('0x15'));var db=require(_0xab8c('0x16'))['db'];function respondWithStatusCode(_0x45c51c,_0x208420){_0x208420=_0x208420||0xcc;return function(_0x3b1143){if(_0x3b1143){return _0x45c51c[_0xab8c('0x17')](_0x208420);}return _0x45c51c[_0xab8c('0x18')](_0x208420)[_0xab8c('0x19')]();};}function respondWithResult(_0x309229,_0x2cbc8e){_0x2cbc8e=_0x2cbc8e||0xc8;return function(_0x18880f){if(_0x18880f){return _0x309229[_0xab8c('0x18')](_0x2cbc8e)['json'](_0x18880f);}};}function respondWithFilteredResult(_0x5e796b,_0x422ab8){return function(_0x1f24b3){if(_0x1f24b3){var _0x59e32d=typeof _0x422ab8[_0xab8c('0x1a')]===_0xab8c('0x1b')&&typeof _0x422ab8[_0xab8c('0x1c')]===_0xab8c('0x1b');var _0x1ead6f=_0x1f24b3[_0xab8c('0x1d')];var _0x41bb92=_0x59e32d?0x0:_0x422ab8[_0xab8c('0x1a')];var _0x427b1c=_0x59e32d?_0x1f24b3['count']:_0x422ab8[_0xab8c('0x1a')]+_0x422ab8[_0xab8c('0x1c')];var _0x1a0625;if(_0x427b1c>=_0x1ead6f){_0x427b1c=_0x1ead6f;_0x1a0625=0xc8;}else{_0x1a0625=0xce;}_0x5e796b[_0xab8c('0x18')](_0x1a0625);return _0x5e796b[_0xab8c('0x1e')](_0xab8c('0x1f'),_0x41bb92+'-'+_0x427b1c+'/'+_0x1ead6f)['json'](_0x1f24b3);}return null;};}function patchUpdates(_0x240077){return function(_0x234bf5){try{jsonpatch[_0xab8c('0x20')](_0x234bf5,_0x240077,!![]);}catch(_0x101abc){return BPromise['reject'](_0x101abc);}return _0x234bf5['save']();};}function saveUpdates(_0x42600f,_0x542bac){return function(_0x315acd){if(_0x315acd){return _0x315acd[_0xab8c('0x21')](_0x42600f)[_0xab8c('0x22')](function(_0x1d8fcb){return _0x1d8fcb;});}return null;};}function removeEntity(_0x554507,_0x4f73bc){return function(_0x3a589f){if(_0x3a589f){return _0x3a589f[_0xab8c('0x23')]()[_0xab8c('0x22')](function(){_0x554507[_0xab8c('0x18')](0xcc)[_0xab8c('0x19')]();});}};}function handleEntityNotFound(_0x482adc,_0x57c99a){return function(_0x5228f6){if(!_0x5228f6){_0x482adc[_0xab8c('0x17')](0x194);}return _0x5228f6;};}function handleError(_0x16d724,_0x481a73){_0x481a73=_0x481a73||0x1f4;return function(_0x23a854){logger['error'](_0x23a854[_0xab8c('0x24')]);if(_0x23a854[_0xab8c('0x25')]){delete _0x23a854[_0xab8c('0x25')];}_0x16d724['status'](_0x481a73)[_0xab8c('0x26')](_0x23a854);};}exports['show']=function(_0x315ed2,_0x52b176){var _0x136267={'raw':!![],'where':{'id':_0x315ed2[_0xab8c('0x27')]['id']}},_0x4b43e1={};_0x4b43e1[_0xab8c('0x28')]=_[_0xab8c('0x29')](db[_0xab8c('0x2a')][_0xab8c('0x2b')]);_0x4b43e1[_0xab8c('0x2c')]=_[_0xab8c('0x29')](_0x315ed2[_0xab8c('0x2c')]);_0x4b43e1[_0xab8c('0x2d')]=_[_0xab8c('0x2e')](_0x4b43e1[_0xab8c('0x28')],_0x4b43e1['query']);_0x136267['attributes']=_[_0xab8c('0x2e')](_0x4b43e1[_0xab8c('0x28')],qs[_0xab8c('0x2f')](_0x315ed2['query'][_0xab8c('0x2f')]));_0x136267[_0xab8c('0x30')]=_0x136267[_0xab8c('0x30')][_0xab8c('0x31')]?_0x136267[_0xab8c('0x30')]:_0x4b43e1['model'];if(_0x315ed2['query'][_0xab8c('0x32')]){_0x136267[_0xab8c('0x33')]=[{'all':!![]}];}_0x136267=_['merge']({},_0x136267,_0x315ed2['options']);return db[_0xab8c('0x2a')]['find'](_0x136267)['then'](handleEntityNotFound(_0x52b176,null))[_0xab8c('0x22')](respondWithResult(_0x52b176,null))[_0xab8c('0x34')](handleError(_0x52b176,null));};exports[_0xab8c('0x35')]=function(_0x2cfe5c,_0x168be0){return db[_0xab8c('0x2a')][_0xab8c('0x35')](_0x2cfe5c[_0xab8c('0x36')],{})[_0xab8c('0x22')](respondWithResult(_0x168be0,0xc9))[_0xab8c('0x34')](handleError(_0x168be0,null));};exports['update']=function(_0x16cb8b,_0x1818ef){if(_0x16cb8b[_0xab8c('0x36')]['id']){delete _0x16cb8b[_0xab8c('0x36')]['id'];}return db[_0xab8c('0x2a')][_0xab8c('0x37')]({'where':{'id':_0x16cb8b[_0xab8c('0x27')]['id']}})[_0xab8c('0x22')](handleEntityNotFound(_0x1818ef,null))['then'](saveUpdates(_0x16cb8b[_0xab8c('0x36')],null))['then'](respondWithResult(_0x1818ef,null))['catch'](handleError(_0x1818ef,null));};exports[_0xab8c('0x23')]=function(_0x39e8a1,_0x393eac){return db[_0xab8c('0x2a')]['find']({'where':{'id':_0x39e8a1[_0xab8c('0x27')]['id']}})[_0xab8c('0x22')](handleEntityNotFound(_0x393eac,null))[_0xab8c('0x22')](removeEntity(_0x393eac,null))[_0xab8c('0x34')](handleError(_0x393eac,null));}; \ No newline at end of file +var _0xed08=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','show','params','rawAttributes','query','intersection','model','fields','attributes','length','include','options','ChatProactiveAction','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x352325,_0x1de824){var _0x171c94=function(_0x302cf0){while(--_0x302cf0){_0x352325['push'](_0x352325['shift']());}};_0x171c94(++_0x1de824);}(_0xed08,0x67));var _0x8ed0=function(_0x57346a,_0x3d53f5){_0x57346a=_0x57346a-0x0;var _0x76d5ed=_0xed08[_0x57346a];return _0x76d5ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed0('0x0'));var zipdir=require(_0x8ed0('0x1'));var jsonpatch=require(_0x8ed0('0x2'));var rp=require(_0x8ed0('0x3'));var moment=require(_0x8ed0('0x4'));var BPromise=require(_0x8ed0('0x5'));var Mustache=require(_0x8ed0('0x6'));var util=require(_0x8ed0('0x7'));var path=require(_0x8ed0('0x8'));var sox=require(_0x8ed0('0x9'));var csv=require(_0x8ed0('0xa'));var ejs=require(_0x8ed0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ed0('0xc'));var squel=require(_0x8ed0('0xd'));var crypto=require(_0x8ed0('0xe'));var jsforce=require(_0x8ed0('0xf'));var deskjs=require(_0x8ed0('0x10'));var toCsv=require(_0x8ed0('0xa'));var querystring=require(_0x8ed0('0x11'));var Papa=require('papaparse');var Redis=require(_0x8ed0('0x12'));var authService=require(_0x8ed0('0x13'));var qs=require(_0x8ed0('0x14'));var as=require(_0x8ed0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ed0('0x16'))(_0x8ed0('0x17'));var utils=require(_0x8ed0('0x18'));var config=require(_0x8ed0('0x19'));var licenseUtil=require(_0x8ed0('0x1a'));var db=require(_0x8ed0('0x1b'))['db'];function respondWithStatusCode(_0x1b2161,_0x431018){_0x431018=_0x431018||0xcc;return function(_0x3ed67b){if(_0x3ed67b){return _0x1b2161[_0x8ed0('0x1c')](_0x431018);}return _0x1b2161['status'](_0x431018)[_0x8ed0('0x1d')]();};}function respondWithResult(_0x14d46a,_0x5e4ea7){_0x5e4ea7=_0x5e4ea7||0xc8;return function(_0x1e729a){if(_0x1e729a){return _0x14d46a[_0x8ed0('0x1e')](_0x5e4ea7)['json'](_0x1e729a);}};}function respondWithFilteredResult(_0x469354,_0x21f4fd){return function(_0x5eda69){if(_0x5eda69){var _0x72bf7a=typeof _0x21f4fd[_0x8ed0('0x1f')]==='undefined'&&typeof _0x21f4fd[_0x8ed0('0x20')]===_0x8ed0('0x21');var _0xb255c=_0x5eda69['count'];var _0x55a134=_0x72bf7a?0x0:_0x21f4fd['offset'];var _0x12fb2c=_0x72bf7a?_0x5eda69[_0x8ed0('0x22')]:_0x21f4fd[_0x8ed0('0x1f')]+_0x21f4fd[_0x8ed0('0x20')];var _0x3548a2;if(_0x12fb2c>=_0xb255c){_0x12fb2c=_0xb255c;_0x3548a2=0xc8;}else{_0x3548a2=0xce;}_0x469354[_0x8ed0('0x1e')](_0x3548a2);return _0x469354[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x55a134+'-'+_0x12fb2c+'/'+_0xb255c)[_0x8ed0('0x25')](_0x5eda69);}return null;};}function patchUpdates(_0x5b8dcb){return function(_0x55726a){try{jsonpatch[_0x8ed0('0x26')](_0x55726a,_0x5b8dcb,!![]);}catch(_0x23e6c2){return BPromise['reject'](_0x23e6c2);}return _0x55726a[_0x8ed0('0x27')]();};}function saveUpdates(_0x28351a,_0x322e90){return function(_0xcba4d4){if(_0xcba4d4){return _0xcba4d4['update'](_0x28351a)[_0x8ed0('0x28')](function(_0x397b51){return _0x397b51;});}return null;};}function removeEntity(_0x5f19e9,_0x1bf9ef){return function(_0xf6208a){if(_0xf6208a){return _0xf6208a[_0x8ed0('0x29')]()[_0x8ed0('0x28')](function(){_0x5f19e9[_0x8ed0('0x1e')](0xcc)[_0x8ed0('0x1d')]();});}};}function handleEntityNotFound(_0x551c91,_0x5165c3){return function(_0x2a35b1){if(!_0x2a35b1){_0x551c91[_0x8ed0('0x1c')](0x194);}return _0x2a35b1;};}function handleError(_0x3a17d4,_0x158364){_0x158364=_0x158364||0x1f4;return function(_0x108f04){logger[_0x8ed0('0x2a')](_0x108f04['stack']);if(_0x108f04[_0x8ed0('0x2b')]){delete _0x108f04[_0x8ed0('0x2b')];}_0x3a17d4['status'](_0x158364)[_0x8ed0('0x2c')](_0x108f04);};}exports[_0x8ed0('0x2d')]=function(_0x29c986,_0x25617c){var _0x15eec2={'raw':!![],'where':{'id':_0x29c986[_0x8ed0('0x2e')]['id']}},_0xec3bd2={};_0xec3bd2['model']=_['keys'](db['ChatProactiveAction'][_0x8ed0('0x2f')]);_0xec3bd2[_0x8ed0('0x30')]=_['keys'](_0x29c986[_0x8ed0('0x30')]);_0xec3bd2['filters']=_[_0x8ed0('0x31')](_0xec3bd2[_0x8ed0('0x32')],_0xec3bd2['query']);_0x15eec2['attributes']=_[_0x8ed0('0x31')](_0xec3bd2[_0x8ed0('0x32')],qs[_0x8ed0('0x33')](_0x29c986['query'][_0x8ed0('0x33')]));_0x15eec2['attributes']=_0x15eec2[_0x8ed0('0x34')][_0x8ed0('0x35')]?_0x15eec2[_0x8ed0('0x34')]:_0xec3bd2[_0x8ed0('0x32')];if(_0x29c986[_0x8ed0('0x30')]['includeAll']){_0x15eec2[_0x8ed0('0x36')]=[{'all':!![]}];}_0x15eec2=_['merge']({},_0x15eec2,_0x29c986[_0x8ed0('0x37')]);return db[_0x8ed0('0x38')][_0x8ed0('0x39')](_0x15eec2)[_0x8ed0('0x28')](handleEntityNotFound(_0x25617c,null))[_0x8ed0('0x28')](respondWithResult(_0x25617c,null))[_0x8ed0('0x3a')](handleError(_0x25617c,null));};exports[_0x8ed0('0x3b')]=function(_0x44f82e,_0x3714f6){return db[_0x8ed0('0x38')][_0x8ed0('0x3b')](_0x44f82e[_0x8ed0('0x3c')],{})[_0x8ed0('0x28')](respondWithResult(_0x3714f6,0xc9))['catch'](handleError(_0x3714f6,null));};exports[_0x8ed0('0x3d')]=function(_0x58b2b6,_0x3aacf9){if(_0x58b2b6['body']['id']){delete _0x58b2b6[_0x8ed0('0x3c')]['id'];}return db[_0x8ed0('0x38')][_0x8ed0('0x39')]({'where':{'id':_0x58b2b6['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x3aacf9,null))[_0x8ed0('0x28')](saveUpdates(_0x58b2b6[_0x8ed0('0x3c')],null))['then'](respondWithResult(_0x3aacf9,null))['catch'](handleError(_0x3aacf9,null));};exports[_0x8ed0('0x29')]=function(_0x2c155a,_0x7e32b0){return db[_0x8ed0('0x38')]['find']({'where':{'id':_0x2c155a[_0x8ed0('0x2e')]['id']}})['then'](handleEntityNotFound(_0x7e32b0,null))[_0x8ed0('0x28')](removeEntity(_0x7e32b0,null))[_0x8ed0('0x3a')](handleError(_0x7e32b0,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 4fca533..9fc9adf 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 _0x069b=['define','lodash','util','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x069b,0x149));var _0xb069=function(_0x18bdba,_0x11379e){_0x18bdba=_0x18bdba-0x0;var _0x28c499=_0x069b[_0x18bdba];return _0x28c499;};'use strict';var _=require(_0xb069('0x0'));var util=require(_0xb069('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb069('0x2'));var rp=require(_0xb069('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb069('0x4'));var attributes=require(_0xb069('0x5'));module[_0xb069('0x6')]=function(_0x479235,_0x6c3e51){return _0x479235[_0xb069('0x7')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fb3=['./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xfad1a7,_0x2e3b8d){var _0x571012=function(_0x33255d){while(--_0x33255d){_0xfad1a7['push'](_0xfad1a7['shift']());}};_0x571012(++_0x2e3b8d);}(_0x9fb3,0x17a));var _0x39fb=function(_0x4f3129,_0x3af060){_0x4f3129=_0x4f3129-0x0;var _0x101261=_0x9fb3[_0x4f3129];return _0x101261;};'use strict';var _=require('lodash');var util=require(_0x39fb('0x0'));var logger=require(_0x39fb('0x1'))('api');var moment=require(_0x39fb('0x2'));var BPromise=require(_0x39fb('0x3'));var rp=require(_0x39fb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39fb('0x5'));var config=require(_0x39fb('0x6'));var attributes=require(_0x39fb('0x7'));module[_0x39fb('0x8')]=function(_0x5acc26,_0x4351d7){return _0x5acc26['define'](_0x39fb('0x9'),attributes,{'tableName':_0x39fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index c26b970..8f662c6 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 _0xa16f=['catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4b0b58,_0x316a14){var _0x4d430c=function(_0x28ac98){while(--_0x28ac98){_0x4b0b58['push'](_0x4b0b58['shift']());}};_0x4d430c(++_0x316a14);}(_0xa16f,0xd9));var _0xfa16=function(_0x3134f1,_0x5087da){_0x3134f1=_0x3134f1-0x0;var _0x4472d9=_0xa16f[_0x3134f1];return _0x4472d9;};'use strict';var _=require(_0xfa16('0x0'));var util=require(_0xfa16('0x1'));var moment=require('moment');var BPromise=require(_0xfa16('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa16('0x3'))['db'];var utils=require(_0xfa16('0x4'));var logger=require(_0xfa16('0x5'))(_0xfa16('0x6'));var config=require(_0xfa16('0x7'));var jayson=require(_0xfa16('0x8'));var client=jayson[_0xfa16('0x9')][_0xfa16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fffe4,_0x1c0cde,_0x116d95){return new BPromise(function(_0x38df04,_0x576b9b){return client[_0xfa16('0xb')](_0x7fffe4,_0x116d95)[_0xfa16('0xc')](function(_0x13f84d){logger['info'](_0xfa16('0xd'),_0x1c0cde,_0xfa16('0xe'));logger[_0xfa16('0xf')](_0xfa16('0x10'),_0x1c0cde,_0xfa16('0xe'),JSON[_0xfa16('0x11')](_0x13f84d));if(_0x13f84d[_0xfa16('0x12')]){if(_0x13f84d[_0xfa16('0x12')][_0xfa16('0x13')]===0x1f4){logger[_0xfa16('0x12')](_0xfa16('0xd'),_0x1c0cde,_0x13f84d['error'][_0xfa16('0x14')]);return _0x576b9b(_0x13f84d[_0xfa16('0x12')][_0xfa16('0x14')]);}logger[_0xfa16('0x12')](_0xfa16('0xd'),_0x1c0cde,_0x13f84d[_0xfa16('0x12')]['message']);return _0x38df04(_0x13f84d[_0xfa16('0x12')][_0xfa16('0x14')]);}else{logger[_0xfa16('0x15')](_0xfa16('0xd'),_0x1c0cde,'request\x20sent');_0x38df04(_0x13f84d[_0xfa16('0x16')][_0xfa16('0x14')]);}})[_0xfa16('0x17')](function(_0x5cb26e){logger[_0xfa16('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x1c0cde,_0x5cb26e);_0x576b9b(_0x5cb26e);});});} \ No newline at end of file +var _0x66af=['error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x66af,0x1a8));var _0xf66a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x66af[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf66a('0x0'));var BPromise=require(_0xf66a('0x1'));var rs=require(_0xf66a('0x2'));var fs=require('fs');var Redis=require(_0xf66a('0x3'));var db=require(_0xf66a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf66a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf66a('0x6'));var client=jayson[_0xf66a('0x7')][_0xf66a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ae693,_0x3db346,_0x587682){return new BPromise(function(_0x5dd75f,_0x17e559){return client[_0xf66a('0x9')](_0x4ae693,_0x587682)[_0xf66a('0xa')](function(_0x1f2357){logger[_0xf66a('0xb')](_0xf66a('0xc'),_0x3db346,_0xf66a('0xd'));logger[_0xf66a('0xe')](_0xf66a('0xf'),_0x3db346,'request\x20sent',JSON['stringify'](_0x1f2357));if(_0x1f2357[_0xf66a('0x10')]){if(_0x1f2357[_0xf66a('0x10')][_0xf66a('0x11')]===0x1f4){logger['error'](_0xf66a('0xc'),_0x3db346,_0x1f2357[_0xf66a('0x10')][_0xf66a('0x12')]);return _0x17e559(_0x1f2357['error'][_0xf66a('0x12')]);}logger[_0xf66a('0x10')](_0xf66a('0xc'),_0x3db346,_0x1f2357['error'][_0xf66a('0x12')]);return _0x5dd75f(_0x1f2357['error'][_0xf66a('0x12')]);}else{logger[_0xf66a('0xb')](_0xf66a('0xc'),_0x3db346,_0xf66a('0xd'));_0x5dd75f(_0x1f2357[_0xf66a('0x13')][_0xf66a('0x12')]);}})['catch'](function(_0x367f20){logger[_0xf66a('0x10')](_0xf66a('0xc'),_0x3db346,_0x367f20);_0x17e559(_0x367f20);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b7516e8..24b39b8 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 _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x24f92f,_0x27178a){var _0x42b86a=function(_0x20d63d){while(--_0x20d63d){_0x24f92f['push'](_0x24f92f['shift']());}};_0x42b86a(++_0x27178a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x24ca[_0x3d4876];return _0x58ca9d;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router; \ No newline at end of file +var _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3f6e44,_0x342e67){_0x3f6e44=_0x3f6e44-0x0;var _0x3f549e=_0x9c5a[_0x3f6e44];return _0x3f549e;};'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('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 6e2d51d..3ee6a51 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 _0x8c39=['INTEGER','ENUM','rrmemory','roundrobin','STRING','name'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8c39,0xe2));var _0x98c3=function(_0x5a71a2,_0x18e231){_0x5a71a2=_0x5a71a2-0x0;var _0x863f4d=_0x8c39[_0x5a71a2];return _0x863f4d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x98c3('0x0')],'unique':_0x98c3('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x98c3('0x0')]},'timeout':{'type':Sequelize[_0x98c3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x98c3('0x3')](_0x98c3('0x4'),'beepall',_0x98c3('0x5'))}}; \ No newline at end of file +var _0xdca1=['roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x1c28c1,_0x3edfdc){var _0x58ec71=function(_0x469aea){while(--_0x469aea){_0x1c28c1['push'](_0x1c28c1['shift']());}};_0x58ec71(++_0x3edfdc);}(_0xdca1,0x145));var _0x1dca=function(_0x2165b,_0x39e1e4){_0x2165b=_0x2165b-0x0;var _0x29bc2a=_0xdca1[_0x2165b];return _0x29bc2a;};'use strict';var Sequelize=require(_0x1dca('0x0'));module[_0x1dca('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1dca('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1dca('0x3')]},'timeout':{'type':Sequelize[_0x1dca('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1dca('0x5')](_0x1dca('0x6'),_0x1dca('0x7'),_0x1dca('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index d86a360..d40483d 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 _0xe3a0=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','ChatQueue','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','get','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','isArray','userChatQueue:remove','getAgents','moment','util'];(function(_0x3bf62b,_0xe8a57d){var _0x5c635b=function(_0x39513c){while(--_0x39513c){_0x3bf62b['push'](_0x3bf62b['shift']());}};_0x5c635b(++_0xe8a57d);}(_0xe3a0,0x122));var _0x0e3a=function(_0x4b85d5,_0x9c90f3){_0x4b85d5=_0x4b85d5-0x0;var _0x159269=_0xe3a0[_0x4b85d5];return _0x159269;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e3a('0x0'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0e3a('0x1'));var path=require('path');var sox=require(_0x0e3a('0x2'));var csv=require(_0x0e3a('0x3'));var ejs=require(_0x0e3a('0x4'));var fs=require('fs');var fs_extra=require(_0x0e3a('0x5'));var _=require(_0x0e3a('0x6'));var squel=require(_0x0e3a('0x7'));var crypto=require(_0x0e3a('0x8'));var jsforce=require(_0x0e3a('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0e3a('0x3'));var querystring=require(_0x0e3a('0xa'));var Papa=require(_0x0e3a('0xb'));var Redis=require(_0x0e3a('0xc'));var authService=require(_0x0e3a('0xd'));var qs=require(_0x0e3a('0xe'));var as=require(_0x0e3a('0xf'));var hardwareService=require(_0x0e3a('0x10'));var logger=require('../../config/logger')(_0x0e3a('0x11'));var utils=require(_0x0e3a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0e3a('0x13'));var db=require(_0x0e3a('0x14'))['db'];config[_0x0e3a('0x15')]=_[_0x0e3a('0x16')](config['redis'],{'host':_0x0e3a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e3a('0x15')]));require(_0x0e3a('0x18'))['register'](socket);var jayson=require(_0x0e3a('0x19'));var client=jayson[_0x0e3a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c0777,_0x3e7c14,_0x5a9cff,_0x2e56aa){return new BPromise(function(_0x4557e4,_0x4164c3){var _0x2d2c4d=_0x2e56aa||client;return _0x2d2c4d[_0x0e3a('0x1b')](_0x1c0777,_0x5a9cff)[_0x0e3a('0x1c')](function(_0x490322){logger['info'](_0x0e3a('0x1d'),_0x3e7c14,_0x0e3a('0x1e'));logger[_0x0e3a('0x1f')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3e7c14,_0x0e3a('0x1e'),JSON['stringify'](_0x490322));if(_0x490322[_0x0e3a('0x20')]){if(_0x490322[_0x0e3a('0x20')]['code']===0x1f4){logger[_0x0e3a('0x20')](_0x0e3a('0x1d'),_0x3e7c14,_0x490322[_0x0e3a('0x20')][_0x0e3a('0x21')]);return _0x4164c3(_0x490322[_0x0e3a('0x20')][_0x0e3a('0x21')]);}logger['error'](_0x0e3a('0x1d'),_0x3e7c14,_0x490322['error']['message']);return _0x4557e4(_0x490322[_0x0e3a('0x20')][_0x0e3a('0x21')]);}else{logger['info'](_0x0e3a('0x1d'),_0x3e7c14,_0x0e3a('0x1e'));_0x4557e4(_0x490322[_0x0e3a('0x22')][_0x0e3a('0x21')]);}})['catch'](function(_0x59194d){logger[_0x0e3a('0x20')](_0x0e3a('0x1d'),_0x3e7c14,_0x59194d);_0x4164c3(_0x59194d);});});}function respondWithStatusCode(_0x290081,_0x59a14b){_0x59a14b=_0x59a14b||0xcc;return function(_0x445205){if(_0x445205){return _0x290081['sendStatus'](_0x59a14b);}return _0x290081['status'](_0x59a14b)[_0x0e3a('0x23')]();};}function respondWithResult(_0xd14970,_0x5e479c){_0x5e479c=_0x5e479c||0xc8;return function(_0x42ca12){if(_0x42ca12){return _0xd14970[_0x0e3a('0x24')](_0x5e479c)[_0x0e3a('0x25')](_0x42ca12);}};}function respondWithFilteredResult(_0x1a32d3,_0x3e71c4){return function(_0x2bbbc4){if(_0x2bbbc4){var _0x1e16f1=typeof _0x3e71c4['offset']===_0x0e3a('0x26')&&typeof _0x3e71c4[_0x0e3a('0x27')]===_0x0e3a('0x26');var _0x4a9cbd=_0x2bbbc4[_0x0e3a('0x28')];var _0xa6b35b=_0x1e16f1?0x0:_0x3e71c4[_0x0e3a('0x29')];var _0x34203a=_0x1e16f1?_0x2bbbc4[_0x0e3a('0x28')]:_0x3e71c4['offset']+_0x3e71c4[_0x0e3a('0x27')];var _0x303095;if(_0x34203a>=_0x4a9cbd){_0x34203a=_0x4a9cbd;_0x303095=0xc8;}else{_0x303095=0xce;}_0x1a32d3[_0x0e3a('0x24')](_0x303095);return _0x1a32d3[_0x0e3a('0x2a')](_0x0e3a('0x2b'),_0xa6b35b+'-'+_0x34203a+'/'+_0x4a9cbd)['json'](_0x2bbbc4);}return null;};}function patchUpdates(_0x4fc4de){return function(_0x378f28){try{jsonpatch[_0x0e3a('0x2c')](_0x378f28,_0x4fc4de,!![]);}catch(_0x563f34){return BPromise['reject'](_0x563f34);}return _0x378f28['save']();};}function saveUpdates(_0x50fd5b,_0x3e1af3){return function(_0x2ac2cb){if(_0x2ac2cb){return _0x2ac2cb[_0x0e3a('0x2d')](_0x50fd5b)[_0x0e3a('0x1c')](function(_0x1b1f7c){return _0x1b1f7c;});}return null;};}function removeEntity(_0x1de4d0,_0x491dda){return function(_0x41f7c3){if(_0x41f7c3){return _0x41f7c3[_0x0e3a('0x2e')]()['then'](function(){var _0x903631=_0x41f7c3['get']({'plain':!![]});var _0x35c1a3=_0x0e3a('0x2f');return db[_0x0e3a('0x30')][_0x0e3a('0x2e')]({'where':{'type':_0x35c1a3,'resourceId':_0x903631['id']}})[_0x0e3a('0x1c')](function(){return _0x41f7c3;});})['then'](function(){_0x1de4d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40aec8,_0x49d3cf){return function(_0x55759d){if(!_0x55759d){_0x40aec8[_0x0e3a('0x31')](0x194);}return _0x55759d;};}function handleError(_0x4b04cf,_0x4988b1){_0x4988b1=_0x4988b1||0x1f4;return function(_0x5d962d){logger[_0x0e3a('0x20')](_0x5d962d[_0x0e3a('0x32')]);if(_0x5d962d[_0x0e3a('0x33')]){delete _0x5d962d['name'];}_0x4b04cf[_0x0e3a('0x24')](_0x4988b1)[_0x0e3a('0x34')](_0x5d962d);};}exports[_0x0e3a('0x35')]=function(_0x824789,_0xb18430){var _0xe42046={},_0x9294fd={},_0x19bfa2={'count':0x0,'rows':[]};var _0x12a012=_['map'](db[_0x0e3a('0x36')]['rawAttributes'],function(_0x3a5e58){return{'name':_0x3a5e58[_0x0e3a('0x37')],'type':_0x3a5e58[_0x0e3a('0x38')][_0x0e3a('0x39')]};});_0x9294fd[_0x0e3a('0x3a')]=_[_0x0e3a('0x3b')](_0x12a012,_0x0e3a('0x33'));_0x9294fd[_0x0e3a('0x3c')]=_[_0x0e3a('0x3d')](_0x824789[_0x0e3a('0x3c')]);_0x9294fd[_0x0e3a('0x3e')]=_[_0x0e3a('0x3f')](_0x9294fd['model'],_0x9294fd[_0x0e3a('0x3c')]);_0xe42046['attributes']=_['intersection'](_0x9294fd[_0x0e3a('0x3a')],qs[_0x0e3a('0x40')](_0x824789[_0x0e3a('0x3c')][_0x0e3a('0x40')]));_0xe42046[_0x0e3a('0x41')]=_0xe42046[_0x0e3a('0x41')][_0x0e3a('0x42')]?_0xe42046['attributes']:_0x9294fd[_0x0e3a('0x3a')];if(!_0x824789[_0x0e3a('0x3c')][_0x0e3a('0x43')](_0x0e3a('0x44'))){_0xe42046['limit']=qs[_0x0e3a('0x27')](_0x824789[_0x0e3a('0x3c')][_0x0e3a('0x27')]);_0xe42046['offset']=qs[_0x0e3a('0x29')](_0x824789['query']['offset']);}_0xe42046[_0x0e3a('0x45')]=qs[_0x0e3a('0x46')](_0x824789[_0x0e3a('0x3c')][_0x0e3a('0x46')]);_0xe42046[_0x0e3a('0x47')]=qs[_0x0e3a('0x3e')](_[_0x0e3a('0x48')](_0x824789[_0x0e3a('0x3c')],_0x9294fd[_0x0e3a('0x3e')]),_0x12a012);if(_0x824789[_0x0e3a('0x3c')][_0x0e3a('0x49')]){_0xe42046['where']=_[_0x0e3a('0x4a')](_0xe42046[_0x0e3a('0x47')],{'$or':_[_0x0e3a('0x3b')](_0x12a012,function(_0x598700){if(_0x598700[_0x0e3a('0x38')]!==_0x0e3a('0x4b')){var _0x5635fc={};_0x5635fc[_0x598700[_0x0e3a('0x33')]]={'$like':'%'+_0x824789['query']['filter']+'%'};return _0x5635fc;}})});}_0xe42046=_[_0x0e3a('0x4a')]({},_0xe42046,_0x824789[_0x0e3a('0x4c')]);var _0x40fc18={'where':_0xe42046[_0x0e3a('0x47')]};return db[_0x0e3a('0x36')][_0x0e3a('0x28')](_0x40fc18)['then'](function(_0x5f184b){_0x19bfa2['count']=_0x5f184b;if(_0x824789[_0x0e3a('0x3c')][_0x0e3a('0x4d')]){_0xe42046[_0x0e3a('0x4e')]=[{'all':!![]}];}return db[_0x0e3a('0x36')][_0x0e3a('0x4f')](_0xe42046);})[_0x0e3a('0x1c')](function(_0x1836da){_0x19bfa2['rows']=_0x1836da;return _0x19bfa2;})[_0x0e3a('0x1c')](respondWithFilteredResult(_0xb18430,_0xe42046))[_0x0e3a('0x50')](handleError(_0xb18430,null));};exports[_0x0e3a('0x51')]=function(_0x24dca5,_0x13ba0e){var _0x5442a6={'raw':!![],'where':{'id':_0x24dca5[_0x0e3a('0x52')]['id']}},_0x140233={};_0x140233[_0x0e3a('0x3a')]=_[_0x0e3a('0x3d')](db[_0x0e3a('0x36')][_0x0e3a('0x53')]);_0x140233[_0x0e3a('0x3c')]=_[_0x0e3a('0x3d')](_0x24dca5['query']);_0x140233[_0x0e3a('0x3e')]=_[_0x0e3a('0x3f')](_0x140233[_0x0e3a('0x3a')],_0x140233[_0x0e3a('0x3c')]);_0x5442a6[_0x0e3a('0x41')]=_['intersection'](_0x140233['model'],qs['fields'](_0x24dca5[_0x0e3a('0x3c')]['fields']));_0x5442a6[_0x0e3a('0x41')]=_0x5442a6[_0x0e3a('0x41')][_0x0e3a('0x42')]?_0x5442a6['attributes']:_0x140233[_0x0e3a('0x3a')];if(_0x24dca5[_0x0e3a('0x3c')][_0x0e3a('0x4d')]){_0x5442a6[_0x0e3a('0x4e')]=[{'all':!![]}];}_0x5442a6=_[_0x0e3a('0x4a')]({},_0x5442a6,_0x24dca5['options']);return db[_0x0e3a('0x36')]['find'](_0x5442a6)[_0x0e3a('0x1c')](handleEntityNotFound(_0x13ba0e,null))['then'](respondWithResult(_0x13ba0e,null))[_0x0e3a('0x50')](handleError(_0x13ba0e,null));};exports[_0x0e3a('0x54')]=function(_0x5bd3eb,_0x15cbea){return db['ChatQueue']['create'](_0x5bd3eb['body'],{})[_0x0e3a('0x1c')](function(_0xf46ba){var _0x2df8d2=_0x5bd3eb[_0x0e3a('0x55')]['get']({'plain':!![]});if(!_0x2df8d2)throw new Error(_0x0e3a('0x56'));if(_0x2df8d2[_0x0e3a('0x57')]===_0x0e3a('0x55')){var _0x27a434=_0xf46ba['get']({'plain':!![]});var _0x186f16=_0x0e3a('0x2f');return db['UserProfileSection'][_0x0e3a('0x58')]({'where':{'name':_0x186f16,'userProfileId':_0x2df8d2['userProfileId']},'raw':!![]})[_0x0e3a('0x1c')](function(_0x4769fa){if(_0x4769fa&&_0x4769fa[_0x0e3a('0x59')]===0x0){return db['UserProfileResource'][_0x0e3a('0x54')]({'name':_0x27a434['name'],'resourceId':_0x27a434['id'],'type':_0x4769fa[_0x0e3a('0x33')],'sectionId':_0x4769fa['id']},{})[_0x0e3a('0x1c')](function(){return _0xf46ba;});}else{return _0xf46ba;}})['catch'](function(_0x526593){logger[_0x0e3a('0x20')](_0x0e3a('0x5a'),_0x526593);throw _0x526593;});}return _0xf46ba;})[_0x0e3a('0x1c')](respondWithResult(_0x15cbea,0xc9))[_0x0e3a('0x50')](handleError(_0x15cbea,null));};exports[_0x0e3a('0x2d')]=function(_0x98057e,_0x549c44){if(_0x98057e['body']['id']){delete _0x98057e['body']['id'];}return db[_0x0e3a('0x36')][_0x0e3a('0x58')]({'where':{'id':_0x98057e['params']['id']}})['then'](handleEntityNotFound(_0x549c44,null))[_0x0e3a('0x1c')](saveUpdates(_0x98057e[_0x0e3a('0x5b')],null))[_0x0e3a('0x1c')](respondWithResult(_0x549c44,null))[_0x0e3a('0x50')](handleError(_0x549c44,null));};exports['destroy']=function(_0x3f378b,_0x2df077){return db['ChatQueue'][_0x0e3a('0x58')]({'where':{'id':_0x3f378b['params']['id']}})[_0x0e3a('0x1c')](handleEntityNotFound(_0x2df077,null))[_0x0e3a('0x1c')](removeEntity(_0x2df077,null))[_0x0e3a('0x50')](handleError(_0x2df077,null));};exports[_0x0e3a('0x5c')]=function(_0x35f30b,_0x4e78d9){return db[_0x0e3a('0x36')][_0x0e3a('0x5c')]()[_0x0e3a('0x1c')](respondWithResult(_0x4e78d9,null))[_0x0e3a('0x50')](handleError(_0x4e78d9,null));};exports[_0x0e3a('0x5d')]=function(_0x577433,_0x30f0ad,_0x4dcd4a){var _0x586de0={'raw':!![],'where':{}},_0x258aa0={},_0x41e16a;return db[_0x0e3a('0x36')][_0x0e3a('0x5e')]({'where':{'id':_0x577433[_0x0e3a('0x52')]['id']}})[_0x0e3a('0x1c')](handleEntityNotFound(_0x30f0ad,null))['then'](function(_0x1228aa){if(_0x1228aa){_0x41e16a=_0x1228aa['get']({'plain':!![]});_0x258aa0[_0x0e3a('0x3a')]=_[_0x0e3a('0x3d')](db[_0x0e3a('0x5f')]['rawAttributes']);_0x258aa0[_0x0e3a('0x3c')]=_[_0x0e3a('0x3d')](_0x577433[_0x0e3a('0x3c')]);_0x258aa0['filters']=_[_0x0e3a('0x3f')](_0x258aa0[_0x0e3a('0x3a')],_0x258aa0[_0x0e3a('0x3c')]);_0x586de0[_0x0e3a('0x41')]=_[_0x0e3a('0x3f')](_0x258aa0[_0x0e3a('0x3a')],qs[_0x0e3a('0x40')](_0x577433[_0x0e3a('0x3c')]['fields']));_0x586de0[_0x0e3a('0x41')]=_0x586de0[_0x0e3a('0x41')][_0x0e3a('0x42')]?_0x586de0['attributes']:_0x258aa0[_0x0e3a('0x3a')];if(!_0x577433[_0x0e3a('0x3c')][_0x0e3a('0x43')](_0x0e3a('0x44'))){_0x586de0[_0x0e3a('0x27')]=qs[_0x0e3a('0x27')](_0x577433[_0x0e3a('0x3c')]['limit']);_0x586de0[_0x0e3a('0x29')]=qs[_0x0e3a('0x29')](_0x577433[_0x0e3a('0x3c')][_0x0e3a('0x29')]);}_0x586de0[_0x0e3a('0x45')]=qs[_0x0e3a('0x46')](_0x577433[_0x0e3a('0x3c')][_0x0e3a('0x46')]);_0x586de0['where']=qs[_0x0e3a('0x3e')](_[_0x0e3a('0x48')](_0x577433[_0x0e3a('0x3c')],_0x258aa0[_0x0e3a('0x3e')]));_0x586de0[_0x0e3a('0x47')]['ChatQueueId']=_0x1228aa['id'];if(_0x577433['query'][_0x0e3a('0x49')]){_0x586de0['where']=_[_0x0e3a('0x4a')](_0x586de0[_0x0e3a('0x47')],{'$or':_[_0x0e3a('0x3b')](_0x586de0['attributes'],function(_0x5c0f94){var _0x5bacbe={};_0x5bacbe[_0x5c0f94]={'$like':'%'+_0x577433[_0x0e3a('0x3c')][_0x0e3a('0x49')]+'%'};return _0x5bacbe;})});}_0x586de0=_[_0x0e3a('0x4a')]({},_0x586de0,_0x577433[_0x0e3a('0x4c')]);return db['UserChatQueue'][_0x0e3a('0x4f')](_0x586de0);}})[_0x0e3a('0x1c')](function(_0x347788){if(_0x347788){return db[_0x0e3a('0x60')][_0x0e3a('0x61')]({'where':{'id':_[_0x0e3a('0x3b')](_0x347788,_0x0e3a('0x62')),'role':_0x0e3a('0x63')},'attributes':['id',_0x0e3a('0x33'),_0x0e3a('0x64'),_0x0e3a('0x65'),_0x0e3a('0x66')]});}})['then'](function(_0x404cb5){if(_0x404cb5){return{'count':_0x404cb5['count'],'rows':_[_0x0e3a('0x3b')](_0x404cb5[_0x0e3a('0x67')],function(_0x348b9a){return{'membername':_0x348b9a[_0x0e3a('0x33')],'UserId':_0x348b9a['id'],'queue_name':_0x41e16a[_0x0e3a('0x33')],'ChatQueueId':_0x41e16a['id'],'interface':util['format'](_0x0e3a('0x68'),'SIP',_0x348b9a[_0x0e3a('0x33')]),'penalty':0x0,'paused':_0x348b9a['chatPause'],'createdAt':_0x348b9a[_0x0e3a('0x66')],'updatedAt':_0x348b9a[_0x0e3a('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0e3a('0x1c')](respondWithFilteredResult(_0x30f0ad,_0x586de0))[_0x0e3a('0x50')](handleError(_0x30f0ad,null));};exports[_0x0e3a('0x69')]=function(_0x2dc679,_0x408d4e,_0x56b944){var _0x369130={};var _0x3ee573={};var _0x492e83;var _0x4fcbd0;return db[_0x0e3a('0x36')][_0x0e3a('0x5e')]({'where':{'id':_0x2dc679['params']['id']}})[_0x0e3a('0x1c')](handleEntityNotFound(_0x408d4e,null))[_0x0e3a('0x1c')](function(_0x223242){if(_0x223242){_0x492e83=_0x223242;_0x3ee573['model']=_[_0x0e3a('0x3d')](db[_0x0e3a('0x6a')][_0x0e3a('0x53')]);_0x3ee573[_0x0e3a('0x3c')]=_[_0x0e3a('0x3d')](_0x2dc679[_0x0e3a('0x3c')]);_0x3ee573[_0x0e3a('0x3e')]=_[_0x0e3a('0x3f')](_0x3ee573['model'],_0x3ee573[_0x0e3a('0x3c')]);_0x369130[_0x0e3a('0x41')]=_[_0x0e3a('0x3f')](_0x3ee573['model'],qs['fields'](_0x2dc679['query'][_0x0e3a('0x40')]));_0x369130[_0x0e3a('0x41')]=_0x369130[_0x0e3a('0x41')][_0x0e3a('0x42')]?_0x369130[_0x0e3a('0x41')]:_0x3ee573[_0x0e3a('0x3a')];_0x369130[_0x0e3a('0x45')]=qs['sort'](_0x2dc679['query'][_0x0e3a('0x46')]);_0x369130['where']=qs[_0x0e3a('0x3e')](_[_0x0e3a('0x48')](_0x2dc679[_0x0e3a('0x3c')],_0x3ee573[_0x0e3a('0x3e')]));if(_0x2dc679['query'][_0x0e3a('0x49')]){_0x369130[_0x0e3a('0x47')]=_[_0x0e3a('0x4a')](_0x369130['where'],{'$or':_[_0x0e3a('0x3b')](_0x369130[_0x0e3a('0x41')],function(_0x8d788d){var _0x34b578={};_0x34b578[_0x8d788d]={'$like':'%'+_0x2dc679[_0x0e3a('0x3c')][_0x0e3a('0x49')]+'%'};return _0x34b578;})});}_0x369130=_['merge']({},_0x369130,_0x2dc679[_0x0e3a('0x4c')]);return _0x492e83[_0x0e3a('0x69')](_0x369130);}})[_0x0e3a('0x1c')](function(_0x24e4ef){if(_0x24e4ef){_0x4fcbd0=_0x24e4ef[_0x0e3a('0x42')];if(!_0x2dc679['query'][_0x0e3a('0x43')](_0x0e3a('0x44'))){_0x369130[_0x0e3a('0x27')]=qs[_0x0e3a('0x27')](_0x2dc679[_0x0e3a('0x3c')][_0x0e3a('0x27')]);_0x369130[_0x0e3a('0x29')]=qs[_0x0e3a('0x29')](_0x2dc679['query'][_0x0e3a('0x29')]);}return _0x492e83['getTeams'](_0x369130);}})[_0x0e3a('0x1c')](function(_0x502628){if(_0x502628){return _0x502628?{'count':_0x4fcbd0,'rows':_0x502628}:null;}})[_0x0e3a('0x1c')](respondWithResult(_0x408d4e,null))['catch'](handleError(_0x408d4e,null));};exports[_0x0e3a('0x6b')]=function(_0x42fece,_0x3df70b,_0x57670b){var _0x18cb1f=_0x42fece[_0x0e3a('0x5b')][_0x0e3a('0x6c')];return db['Team'][_0x0e3a('0x4f')]({'where':{'id':_0x18cb1f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0e3a('0x6d'),'attributes':['id','name',_0x0e3a('0x6e'),_0x0e3a('0x6f'),'interface'],'raw':!![]}]})[_0x0e3a('0x1c')](function(_0x100917){if(_0x100917){var _0x3659a4=_[_0x0e3a('0x70')](_0x100917,function(_0x20e679){var _0x236071=_0x20e679[_0x0e3a('0x71')]({'plain':!![]});return _0x236071['Agents'];});return db[_0x0e3a('0x36')][_0x0e3a('0x58')]({'where':{'id':_0x42fece['params']['id']}})[_0x0e3a('0x1c')](function(_0x4c3d61){return db[_0x0e3a('0x72')][_0x0e3a('0x73')](function(_0x33ae1a){return _0x4c3d61[_0x0e3a('0x6b')](_0x18cb1f,{'transaction':_0x33ae1a})[_0x0e3a('0x1c')](function(){return BPromise[_0x0e3a('0x74')](_0x3659a4,function(_0x430587){return db['UserChatQueue'][_0x0e3a('0x75')]({'where':{'UserId':_0x430587['id'],'ChatQueueId':_0x42fece[_0x0e3a('0x52')]['id']},'transaction':_0x33ae1a});});})[_0x0e3a('0x1c')](function(){_0x3659a4[_0x0e3a('0x76')](function(_0x2cbbe3){socket[_0x0e3a('0x77')](_0x0e3a('0x78'),{'UserId':_0x2cbbe3['id'],'ChatQueueId':_0x4c3d61['id']});});});});});}})['then'](respondWithStatusCode(_0x3df70b,null))[_0x0e3a('0x50')](handleError(_0x3df70b,null));};exports[_0x0e3a('0x79')]=function(_0x314465,_0x9eec7f,_0x226b3b){return db[_0x0e3a('0x6a')][_0x0e3a('0x4f')]({'where':{'id':_0x314465[_0x0e3a('0x3c')][_0x0e3a('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x0e3a('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x9eec7f,null))[_0x0e3a('0x1c')](function(_0x3a74aa){var _0x2fe556=_[_0x0e3a('0x3b')](_0x3a74aa,'id');var _0x3062bd=[];var _0x3c3945=[];var _0x5902a7=squel[_0x0e3a('0x7a')]();_0x5902a7[_0x0e3a('0x7b')]('tq.TeamId')[_0x0e3a('0x7c')](_0x0e3a('0x7d'),'tq')['join'](_0x0e3a('0x7e'),'ut',_0x0e3a('0x7f'))[_0x0e3a('0x47')](_0x0e3a('0x80'),_0x314465['params']['id']);for(var _0xb4714f=0x0;_0xb4714f<_0x3a74aa[_0x0e3a('0x42')];_0xb4714f+=0x1){let _0x2cbfb6=_0x3a74aa[_0xb4714f];for(var _0x85ca0c=0x0;_0x85ca0c<_0x2cbfb6[_0x0e3a('0x6d')][_0x0e3a('0x42')];_0x85ca0c+=0x1){let _0x1f740e=_0x2cbfb6[_0x0e3a('0x6d')][_0x85ca0c];var _0x380096=_0x5902a7[_0x0e3a('0x81')]();_0x380096['where'](_0x0e3a('0x82'),_0x1f740e['id']);_0x3c3945[_0x0e3a('0x83')](db[_0x0e3a('0x72')][_0x0e3a('0x3c')](_0x380096[_0x0e3a('0x84')](),{'type':db[_0x0e3a('0x72')][_0x0e3a('0x85')]['SELECT']})[_0x0e3a('0x1c')](function(_0x509aa0){if(_0x509aa0[_0x0e3a('0x42')]===0x1){return _0x1f740e['id'];}else{var _0x41c2db=_[_0x0e3a('0x86')](_[_0x0e3a('0x3b')](_0x509aa0,_0x0e3a('0x87')),function(_0x4d7eec){return _[_0x0e3a('0x88')](_0x2fe556,_0x4d7eec);});if(_0x41c2db){return _0x1f740e['id'];}}}));}}return BPromise[_0x0e3a('0x89')](_0x3c3945)[_0x0e3a('0x1c')](function(_0x4359d2){_0x3062bd=_(_0x3062bd)['union'](_0x4359d2)[_0x0e3a('0x8a')]()[_0x0e3a('0x8b')]();return db[_0x0e3a('0x36')][_0x0e3a('0x58')]({'where':{'id':_0x314465['params']['id']}})[_0x0e3a('0x1c')](function(_0x19063b){return db[_0x0e3a('0x72')]['transaction'](function(_0x2cd0d2){return _0x19063b[_0x0e3a('0x79')](_0x314465[_0x0e3a('0x3c')]['ids'],{'transaction':_0x2cd0d2})[_0x0e3a('0x1c')](function(){if(!_[_0x0e3a('0x8c')](_0x3062bd)){return _0x19063b[_0x0e3a('0x8d')](_0x3062bd,{'transaction':_0x2cd0d2});}})['then'](function(){_0x3062bd[_0x0e3a('0x76')](function(_0x17a351){socket['emit']('userChatQueue:remove',{'UserId':_0x17a351,'ChatQueueId':_0x19063b['id']});});});});});});})['then'](respondWithStatusCode(_0x9eec7f,null))[_0x0e3a('0x50')](handleError(_0x9eec7f,null));};exports['addAgents']=function(_0x595b42,_0x318185,_0x3ae8f0){return db[_0x0e3a('0x36')][_0x0e3a('0x58')]({'where':{'id':_0x595b42[_0x0e3a('0x52')]['id']}})['then'](handleEntityNotFound(_0x318185,null))['then'](function(_0x30ae0f){if(_0x30ae0f){return _0x30ae0f[_0x0e3a('0x8e')](_0x595b42[_0x0e3a('0x5b')]['ids'],_['omit'](_0x595b42[_0x0e3a('0x5b')],[_0x0e3a('0x6c'),'id'])||{})['spread'](function(_0x10a942){for(var _0x3666fe=0x0;_0x3666fe<_0x595b42[_0x0e3a('0x5b')][_0x0e3a('0x6c')][_0x0e3a('0x42')];_0x3666fe+=0x1){socket[_0x0e3a('0x77')](_0x0e3a('0x78'),{'UserId':Number(_0x595b42[_0x0e3a('0x5b')][_0x0e3a('0x6c')][_0x3666fe]),'ChatQueueId':Number(_0x595b42[_0x0e3a('0x52')]['id'])});}return _0x10a942;});}})['then'](respondWithResult(_0x318185,null))['catch'](handleError(_0x318185,null));};exports[_0x0e3a('0x8d')]=function(_0x386cd3,_0x17aa56,_0xf6f7bb){return db[_0x0e3a('0x36')][_0x0e3a('0x58')]({'where':{'id':_0x386cd3[_0x0e3a('0x52')]['id']}})[_0x0e3a('0x1c')](handleEntityNotFound(_0x17aa56,null))[_0x0e3a('0x1c')](function(_0x3f60bd){if(_0x3f60bd){return _0x3f60bd[_0x0e3a('0x8d')](_0x386cd3[_0x0e3a('0x3c')][_0x0e3a('0x6c')])[_0x0e3a('0x1c')](function(){if(_[_0x0e3a('0x8f')](_0x386cd3['query']['ids'])){for(var _0x448c7f=0x0;_0x448c7f<_0x386cd3[_0x0e3a('0x3c')][_0x0e3a('0x6c')][_0x0e3a('0x42')];_0x448c7f+=0x1){socket[_0x0e3a('0x77')](_0x0e3a('0x90'),{'UserId':Number(_0x386cd3['query'][_0x0e3a('0x6c')][_0x448c7f]),'ChatQueueId':Number(_0x386cd3[_0x0e3a('0x52')]['id'])});}}else{socket[_0x0e3a('0x77')](_0x0e3a('0x90'),{'UserId':Number(_0x386cd3[_0x0e3a('0x3c')][_0x0e3a('0x6c')]),'ChatQueueId':Number(_0x386cd3[_0x0e3a('0x52')]['id'])});}});}})[_0x0e3a('0x1c')](respondWithStatusCode(_0x17aa56,null))['catch'](handleError(_0x17aa56,null));};exports[_0x0e3a('0x91')]=function(_0x4e1f61,_0x32c332,_0x1ec642){var _0xb2f245={};var _0x15b97d={};var _0x3a1246;var _0x3af7da;return db[_0x0e3a('0x36')][_0x0e3a('0x5e')]({'where':{'id':_0x4e1f61[_0x0e3a('0x52')]['id']}})[_0x0e3a('0x1c')](handleEntityNotFound(_0x32c332,null))[_0x0e3a('0x1c')](function(_0x4e801a){if(_0x4e801a){_0x3a1246=_0x4e801a;_0x15b97d[_0x0e3a('0x3a')]=_[_0x0e3a('0x3d')](db[_0x0e3a('0x60')][_0x0e3a('0x53')]);_0x15b97d[_0x0e3a('0x3c')]=_['keys'](_0x4e1f61[_0x0e3a('0x3c')]);_0x15b97d['filters']=_[_0x0e3a('0x3f')](_0x15b97d[_0x0e3a('0x3a')],_0x15b97d[_0x0e3a('0x3c')]);_0xb2f245[_0x0e3a('0x41')]=_[_0x0e3a('0x3f')](_0x15b97d[_0x0e3a('0x3a')],qs[_0x0e3a('0x40')](_0x4e1f61[_0x0e3a('0x3c')][_0x0e3a('0x40')]));_0xb2f245[_0x0e3a('0x41')]=_0xb2f245['attributes']['length']?_0xb2f245[_0x0e3a('0x41')]:_0x15b97d[_0x0e3a('0x3a')];_0xb2f245[_0x0e3a('0x45')]=qs[_0x0e3a('0x46')](_0x4e1f61[_0x0e3a('0x3c')][_0x0e3a('0x46')]);_0xb2f245['where']=qs[_0x0e3a('0x3e')](_[_0x0e3a('0x48')](_0x4e1f61['query'],_0x15b97d[_0x0e3a('0x3e')]));if(_0x4e1f61[_0x0e3a('0x3c')][_0x0e3a('0x49')]){_0xb2f245[_0x0e3a('0x47')]=_[_0x0e3a('0x4a')](_0xb2f245[_0x0e3a('0x47')],{'$or':_['map'](_0xb2f245['attributes'],function(_0xb98429){var _0x549d8c={};_0x549d8c[_0xb98429]={'$like':'%'+_0x4e1f61[_0x0e3a('0x3c')]['filter']+'%'};return _0x549d8c;})});}_0xb2f245=_[_0x0e3a('0x4a')]({},_0xb2f245,_0x4e1f61[_0x0e3a('0x4c')]);return _0x3a1246[_0x0e3a('0x91')](_0xb2f245);}})[_0x0e3a('0x1c')](function(_0x532bdf){if(_0x532bdf){_0x3af7da=_0x532bdf[_0x0e3a('0x42')];if(!_0x4e1f61['query'][_0x0e3a('0x43')]('nolimit')){_0xb2f245['limit']=qs['limit'](_0x4e1f61[_0x0e3a('0x3c')][_0x0e3a('0x27')]);_0xb2f245[_0x0e3a('0x29')]=qs['offset'](_0x4e1f61[_0x0e3a('0x3c')][_0x0e3a('0x29')]);}return _0x3a1246['getAgents'](_0xb2f245);}})[_0x0e3a('0x1c')](function(_0x259835){if(_0x259835){return _0x259835?{'count':_0x3af7da,'rows':_0x259835}:null;}})['then'](respondWithResult(_0x32c332,null))[_0x0e3a('0x50')](handleError(_0x32c332,null));}; \ No newline at end of file +var _0x0d8a=['offset','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','ChatQueue','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','keys','rawAttributes','includeAll','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','pick','ChatQueueId','UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','getTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','ids','isEmpty','userChatQueue:remove','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','undefined','count'];(function(_0x154b99,_0x1ccd36){var _0x23811f=function(_0x28d21d){while(--_0x28d21d){_0x154b99['push'](_0x154b99['shift']());}};_0x23811f(++_0x1ccd36);}(_0x0d8a,0x18c));var _0xa0d8=function(_0x1f2fdc,_0x3f5ac6){_0x1f2fdc=_0x1f2fdc-0x0;var _0x3a3fd7=_0x0d8a[_0x1f2fdc];return _0x3a3fd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0d8('0x0'));var zipdir=require(_0xa0d8('0x1'));var jsonpatch=require(_0xa0d8('0x2'));var rp=require('request-promise');var moment=require(_0xa0d8('0x3'));var BPromise=require(_0xa0d8('0x4'));var Mustache=require(_0xa0d8('0x5'));var util=require(_0xa0d8('0x6'));var path=require(_0xa0d8('0x7'));var sox=require(_0xa0d8('0x8'));var csv=require(_0xa0d8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa0d8('0xa'));var _=require(_0xa0d8('0xb'));var squel=require(_0xa0d8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa0d8('0x9'));var querystring=require(_0xa0d8('0xd'));var Papa=require(_0xa0d8('0xe'));var Redis=require(_0xa0d8('0xf'));var authService=require(_0xa0d8('0x10'));var qs=require(_0xa0d8('0x11'));var as=require(_0xa0d8('0x12'));var hardwareService=require(_0xa0d8('0x13'));var logger=require('../../config/logger')(_0xa0d8('0x14'));var utils=require(_0xa0d8('0x15'));var config=require(_0xa0d8('0x16'));var licenseUtil=require(_0xa0d8('0x17'));var db=require(_0xa0d8('0x18'))['db'];config[_0xa0d8('0x19')]=_['defaults'](config['redis'],{'host':_0xa0d8('0x1a'),'port':0x18eb});var socket=require(_0xa0d8('0x1b'))(new Redis(config[_0xa0d8('0x19')]));require(_0xa0d8('0x1c'))['register'](socket);var jayson=require(_0xa0d8('0x1d'));var client=jayson['client'][_0xa0d8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4274f2,_0x43356a,_0x498137,_0x206ca5){return new BPromise(function(_0x2a8936,_0x52776d){var _0x216209=_0x206ca5||client;return _0x216209[_0xa0d8('0x1f')](_0x4274f2,_0x498137)[_0xa0d8('0x20')](function(_0x5d7d83){logger[_0xa0d8('0x21')](_0xa0d8('0x22'),_0x43356a,_0xa0d8('0x23'));logger[_0xa0d8('0x24')](_0xa0d8('0x25'),_0x43356a,_0xa0d8('0x23'),JSON[_0xa0d8('0x26')](_0x5d7d83));if(_0x5d7d83[_0xa0d8('0x27')]){if(_0x5d7d83['error'][_0xa0d8('0x28')]===0x1f4){logger[_0xa0d8('0x27')](_0xa0d8('0x22'),_0x43356a,_0x5d7d83[_0xa0d8('0x27')][_0xa0d8('0x29')]);return _0x52776d(_0x5d7d83[_0xa0d8('0x27')][_0xa0d8('0x29')]);}logger[_0xa0d8('0x27')]('ChatQueue,\x20%s,\x20%s',_0x43356a,_0x5d7d83[_0xa0d8('0x27')][_0xa0d8('0x29')]);return _0x2a8936(_0x5d7d83['error'][_0xa0d8('0x29')]);}else{logger[_0xa0d8('0x21')](_0xa0d8('0x22'),_0x43356a,'request\x20sent');_0x2a8936(_0x5d7d83[_0xa0d8('0x2a')]['message']);}})['catch'](function(_0x4d0de6){logger[_0xa0d8('0x27')]('ChatQueue,\x20%s,\x20%s',_0x43356a,_0x4d0de6);_0x52776d(_0x4d0de6);});});}function respondWithStatusCode(_0x1f9dbb,_0x4c3e81){_0x4c3e81=_0x4c3e81||0xcc;return function(_0x45dee7){if(_0x45dee7){return _0x1f9dbb['sendStatus'](_0x4c3e81);}return _0x1f9dbb[_0xa0d8('0x2b')](_0x4c3e81)[_0xa0d8('0x2c')]();};}function respondWithResult(_0x53a6d0,_0x54fe97){_0x54fe97=_0x54fe97||0xc8;return function(_0x5b7314){if(_0x5b7314){return _0x53a6d0[_0xa0d8('0x2b')](_0x54fe97)[_0xa0d8('0x2d')](_0x5b7314);}};}function respondWithFilteredResult(_0x2e38b2,_0x12aa6a){return function(_0x1d85ac){if(_0x1d85ac){var _0x38d8d9=typeof _0x12aa6a['offset']==='undefined'&&typeof _0x12aa6a['limit']===_0xa0d8('0x2e');var _0x99aa34=_0x1d85ac[_0xa0d8('0x2f')];var _0x67c6ce=_0x38d8d9?0x0:_0x12aa6a[_0xa0d8('0x30')];var _0x1e9b4e=_0x38d8d9?_0x1d85ac['count']:_0x12aa6a['offset']+_0x12aa6a['limit'];var _0x50c977;if(_0x1e9b4e>=_0x99aa34){_0x1e9b4e=_0x99aa34;_0x50c977=0xc8;}else{_0x50c977=0xce;}_0x2e38b2[_0xa0d8('0x2b')](_0x50c977);return _0x2e38b2[_0xa0d8('0x31')](_0xa0d8('0x32'),_0x67c6ce+'-'+_0x1e9b4e+'/'+_0x99aa34)[_0xa0d8('0x2d')](_0x1d85ac);}return null;};}function patchUpdates(_0x1103e7){return function(_0x1be1bf){try{jsonpatch[_0xa0d8('0x33')](_0x1be1bf,_0x1103e7,!![]);}catch(_0x39865b){return BPromise['reject'](_0x39865b);}return _0x1be1bf[_0xa0d8('0x34')]();};}function saveUpdates(_0xda9ecd,_0x5c3c5a){return function(_0x4c55cd){if(_0x4c55cd){return _0x4c55cd[_0xa0d8('0x35')](_0xda9ecd)[_0xa0d8('0x20')](function(_0x1c5cff){return _0x1c5cff;});}return null;};}function removeEntity(_0x8f2899,_0x15fbd1){return function(_0x2ad1d2){if(_0x2ad1d2){return _0x2ad1d2[_0xa0d8('0x36')]()[_0xa0d8('0x20')](function(){var _0x5d8418=_0x2ad1d2[_0xa0d8('0x37')]({'plain':!![]});var _0x5643b4='ChatQueues';return db[_0xa0d8('0x38')][_0xa0d8('0x36')]({'where':{'type':_0x5643b4,'resourceId':_0x5d8418['id']}})[_0xa0d8('0x20')](function(){return _0x2ad1d2;});})[_0xa0d8('0x20')](function(){_0x8f2899[_0xa0d8('0x2b')](0xcc)[_0xa0d8('0x2c')]();});}};}function handleEntityNotFound(_0x3b4a33,_0x24a5fb){return function(_0x2969d3){if(!_0x2969d3){_0x3b4a33[_0xa0d8('0x39')](0x194);}return _0x2969d3;};}function handleError(_0x2946d8,_0x180c39){_0x180c39=_0x180c39||0x1f4;return function(_0x39563c){logger[_0xa0d8('0x27')](_0x39563c[_0xa0d8('0x3a')]);if(_0x39563c['name']){delete _0x39563c[_0xa0d8('0x3b')];}_0x2946d8[_0xa0d8('0x2b')](_0x180c39)[_0xa0d8('0x3c')](_0x39563c);};}exports[_0xa0d8('0x3d')]=function(_0x5239ba,_0x9fcc40){var _0x581b2d={},_0x9df359={},_0x41f134={'count':0x0,'rows':[]};var _0x270cee=_[_0xa0d8('0x3e')](db[_0xa0d8('0x3f')]['rawAttributes'],function(_0x107944){return{'name':_0x107944['fieldName'],'type':_0x107944['type']['key']};});_0x9df359[_0xa0d8('0x40')]=_[_0xa0d8('0x3e')](_0x270cee,_0xa0d8('0x3b'));_0x9df359[_0xa0d8('0x41')]=_['keys'](_0x5239ba[_0xa0d8('0x41')]);_0x9df359[_0xa0d8('0x42')]=_[_0xa0d8('0x43')](_0x9df359[_0xa0d8('0x40')],_0x9df359[_0xa0d8('0x41')]);_0x581b2d[_0xa0d8('0x44')]=_[_0xa0d8('0x43')](_0x9df359[_0xa0d8('0x40')],qs[_0xa0d8('0x45')](_0x5239ba['query'][_0xa0d8('0x45')]));_0x581b2d['attributes']=_0x581b2d[_0xa0d8('0x44')][_0xa0d8('0x46')]?_0x581b2d[_0xa0d8('0x44')]:_0x9df359[_0xa0d8('0x40')];if(!_0x5239ba[_0xa0d8('0x41')][_0xa0d8('0x47')](_0xa0d8('0x48'))){_0x581b2d[_0xa0d8('0x49')]=qs[_0xa0d8('0x49')](_0x5239ba[_0xa0d8('0x41')][_0xa0d8('0x49')]);_0x581b2d[_0xa0d8('0x30')]=qs['offset'](_0x5239ba[_0xa0d8('0x41')][_0xa0d8('0x30')]);}_0x581b2d[_0xa0d8('0x4a')]=qs[_0xa0d8('0x4b')](_0x5239ba[_0xa0d8('0x41')][_0xa0d8('0x4b')]);_0x581b2d[_0xa0d8('0x4c')]=qs[_0xa0d8('0x42')](_['pick'](_0x5239ba[_0xa0d8('0x41')],_0x9df359['filters']),_0x270cee);if(_0x5239ba['query'][_0xa0d8('0x4d')]){_0x581b2d[_0xa0d8('0x4c')]=_[_0xa0d8('0x4e')](_0x581b2d[_0xa0d8('0x4c')],{'$or':_[_0xa0d8('0x3e')](_0x270cee,function(_0x3130d5){if(_0x3130d5[_0xa0d8('0x4f')]!==_0xa0d8('0x50')){var _0x43331b={};_0x43331b[_0x3130d5[_0xa0d8('0x3b')]]={'$like':'%'+_0x5239ba['query']['filter']+'%'};return _0x43331b;}})});}_0x581b2d=_['merge']({},_0x581b2d,_0x5239ba[_0xa0d8('0x51')]);var _0x35bb21={'where':_0x581b2d[_0xa0d8('0x4c')]};return db[_0xa0d8('0x3f')][_0xa0d8('0x2f')](_0x35bb21)[_0xa0d8('0x20')](function(_0xabe8a1){_0x41f134['count']=_0xabe8a1;if(_0x5239ba[_0xa0d8('0x41')]['includeAll']){_0x581b2d['include']=[{'all':!![]}];}return db['ChatQueue'][_0xa0d8('0x52')](_0x581b2d);})[_0xa0d8('0x20')](function(_0x489762){_0x41f134[_0xa0d8('0x53')]=_0x489762;return _0x41f134;})['then'](respondWithFilteredResult(_0x9fcc40,_0x581b2d))['catch'](handleError(_0x9fcc40,null));};exports[_0xa0d8('0x54')]=function(_0x2a4805,_0x5766fb){var _0x2e4741={'raw':!![],'where':{'id':_0x2a4805[_0xa0d8('0x55')]['id']}},_0x1ab823={};_0x1ab823[_0xa0d8('0x40')]=_[_0xa0d8('0x56')](db[_0xa0d8('0x3f')][_0xa0d8('0x57')]);_0x1ab823[_0xa0d8('0x41')]=_[_0xa0d8('0x56')](_0x2a4805[_0xa0d8('0x41')]);_0x1ab823[_0xa0d8('0x42')]=_[_0xa0d8('0x43')](_0x1ab823[_0xa0d8('0x40')],_0x1ab823[_0xa0d8('0x41')]);_0x2e4741[_0xa0d8('0x44')]=_[_0xa0d8('0x43')](_0x1ab823[_0xa0d8('0x40')],qs['fields'](_0x2a4805[_0xa0d8('0x41')][_0xa0d8('0x45')]));_0x2e4741['attributes']=_0x2e4741[_0xa0d8('0x44')]['length']?_0x2e4741[_0xa0d8('0x44')]:_0x1ab823[_0xa0d8('0x40')];if(_0x2a4805[_0xa0d8('0x41')][_0xa0d8('0x58')]){_0x2e4741[_0xa0d8('0x59')]=[{'all':!![]}];}_0x2e4741=_[_0xa0d8('0x4e')]({},_0x2e4741,_0x2a4805[_0xa0d8('0x51')]);return db[_0xa0d8('0x3f')][_0xa0d8('0x5a')](_0x2e4741)['then'](handleEntityNotFound(_0x5766fb,null))[_0xa0d8('0x20')](respondWithResult(_0x5766fb,null))[_0xa0d8('0x5b')](handleError(_0x5766fb,null));};exports[_0xa0d8('0x5c')]=function(_0x52f8d9,_0x42da41){return db[_0xa0d8('0x3f')][_0xa0d8('0x5c')](_0x52f8d9['body'],{})[_0xa0d8('0x20')](function(_0x1dbf4e){var _0x25d4c4=_0x52f8d9['user']['get']({'plain':!![]});if(!_0x25d4c4)throw new Error(_0xa0d8('0x5d'));if(_0x25d4c4['role']===_0xa0d8('0x5e')){var _0x15f8b4=_0x1dbf4e['get']({'plain':!![]});var _0x32217a='ChatQueues';return db[_0xa0d8('0x5f')][_0xa0d8('0x5a')]({'where':{'name':_0x32217a,'userProfileId':_0x25d4c4['userProfileId']},'raw':!![]})[_0xa0d8('0x20')](function(_0x53aff7){if(_0x53aff7&&_0x53aff7[_0xa0d8('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x15f8b4['name'],'resourceId':_0x15f8b4['id'],'type':_0x53aff7[_0xa0d8('0x3b')],'sectionId':_0x53aff7['id']},{})[_0xa0d8('0x20')](function(){return _0x1dbf4e;});}else{return _0x1dbf4e;}})[_0xa0d8('0x5b')](function(_0x34a665){logger[_0xa0d8('0x27')](_0xa0d8('0x61'),_0x34a665);throw _0x34a665;});}return _0x1dbf4e;})[_0xa0d8('0x20')](respondWithResult(_0x42da41,0xc9))[_0xa0d8('0x5b')](handleError(_0x42da41,null));};exports[_0xa0d8('0x35')]=function(_0xce884a,_0x3aa468){if(_0xce884a[_0xa0d8('0x62')]['id']){delete _0xce884a[_0xa0d8('0x62')]['id'];}return db[_0xa0d8('0x3f')][_0xa0d8('0x5a')]({'where':{'id':_0xce884a[_0xa0d8('0x55')]['id']}})[_0xa0d8('0x20')](handleEntityNotFound(_0x3aa468,null))['then'](saveUpdates(_0xce884a['body'],null))[_0xa0d8('0x20')](respondWithResult(_0x3aa468,null))[_0xa0d8('0x5b')](handleError(_0x3aa468,null));};exports[_0xa0d8('0x36')]=function(_0x6802b7,_0x13f6f4){return db['ChatQueue'][_0xa0d8('0x5a')]({'where':{'id':_0x6802b7['params']['id']}})[_0xa0d8('0x20')](handleEntityNotFound(_0x13f6f4,null))[_0xa0d8('0x20')](removeEntity(_0x13f6f4,null))['catch'](handleError(_0x13f6f4,null));};exports[_0xa0d8('0x63')]=function(_0x5519ce,_0x2d17f6){return db[_0xa0d8('0x3f')][_0xa0d8('0x63')]()[_0xa0d8('0x20')](respondWithResult(_0x2d17f6,null))[_0xa0d8('0x5b')](handleError(_0x2d17f6,null));};exports[_0xa0d8('0x64')]=function(_0x35c9ce,_0x5de51c,_0x4853cd){var _0x19b4ff={'raw':!![],'where':{}},_0x104569={},_0x2daa5c;return db[_0xa0d8('0x3f')][_0xa0d8('0x65')]({'where':{'id':_0x35c9ce[_0xa0d8('0x55')]['id']}})[_0xa0d8('0x20')](handleEntityNotFound(_0x5de51c,null))[_0xa0d8('0x20')](function(_0x1f5c1e){if(_0x1f5c1e){_0x2daa5c=_0x1f5c1e[_0xa0d8('0x37')]({'plain':!![]});_0x104569[_0xa0d8('0x40')]=_[_0xa0d8('0x56')](db['UserChatQueue'][_0xa0d8('0x57')]);_0x104569[_0xa0d8('0x41')]=_[_0xa0d8('0x56')](_0x35c9ce[_0xa0d8('0x41')]);_0x104569[_0xa0d8('0x42')]=_[_0xa0d8('0x43')](_0x104569[_0xa0d8('0x40')],_0x104569[_0xa0d8('0x41')]);_0x19b4ff[_0xa0d8('0x44')]=_[_0xa0d8('0x43')](_0x104569[_0xa0d8('0x40')],qs['fields'](_0x35c9ce[_0xa0d8('0x41')][_0xa0d8('0x45')]));_0x19b4ff[_0xa0d8('0x44')]=_0x19b4ff[_0xa0d8('0x44')][_0xa0d8('0x46')]?_0x19b4ff[_0xa0d8('0x44')]:_0x104569['model'];if(!_0x35c9ce[_0xa0d8('0x41')][_0xa0d8('0x47')]('nolimit')){_0x19b4ff[_0xa0d8('0x49')]=qs[_0xa0d8('0x49')](_0x35c9ce[_0xa0d8('0x41')][_0xa0d8('0x49')]);_0x19b4ff[_0xa0d8('0x30')]=qs[_0xa0d8('0x30')](_0x35c9ce[_0xa0d8('0x41')][_0xa0d8('0x30')]);}_0x19b4ff[_0xa0d8('0x4a')]=qs[_0xa0d8('0x4b')](_0x35c9ce[_0xa0d8('0x41')]['sort']);_0x19b4ff['where']=qs[_0xa0d8('0x42')](_[_0xa0d8('0x66')](_0x35c9ce[_0xa0d8('0x41')],_0x104569[_0xa0d8('0x42')]));_0x19b4ff[_0xa0d8('0x4c')][_0xa0d8('0x67')]=_0x1f5c1e['id'];if(_0x35c9ce[_0xa0d8('0x41')][_0xa0d8('0x4d')]){_0x19b4ff[_0xa0d8('0x4c')]=_[_0xa0d8('0x4e')](_0x19b4ff['where'],{'$or':_[_0xa0d8('0x3e')](_0x19b4ff[_0xa0d8('0x44')],function(_0x1686d5){var _0x95e877={};_0x95e877[_0x1686d5]={'$like':'%'+_0x35c9ce[_0xa0d8('0x41')][_0xa0d8('0x4d')]+'%'};return _0x95e877;})});}_0x19b4ff=_[_0xa0d8('0x4e')]({},_0x19b4ff,_0x35c9ce[_0xa0d8('0x51')]);return db[_0xa0d8('0x68')]['findAll'](_0x19b4ff);}})['then'](function(_0x581814){if(_0x581814){return db[_0xa0d8('0x69')]['findAndCountAll']({'where':{'id':_['map'](_0x581814,_0xa0d8('0x6a')),'role':_0xa0d8('0x6b')},'attributes':['id',_0xa0d8('0x3b'),_0xa0d8('0x6c'),_0xa0d8('0x6d'),_0xa0d8('0x6e')]});}})[_0xa0d8('0x20')](function(_0x19b03e){if(_0x19b03e){return{'count':_0x19b03e[_0xa0d8('0x2f')],'rows':_[_0xa0d8('0x3e')](_0x19b03e[_0xa0d8('0x53')],function(_0x4afca0){return{'membername':_0x4afca0[_0xa0d8('0x3b')],'UserId':_0x4afca0['id'],'queue_name':_0x2daa5c[_0xa0d8('0x3b')],'ChatQueueId':_0x2daa5c['id'],'interface':util['format']('%s/%s','SIP',_0x4afca0[_0xa0d8('0x3b')]),'penalty':0x0,'paused':_0x4afca0[_0xa0d8('0x6c')],'createdAt':_0x4afca0[_0xa0d8('0x6e')],'updatedAt':_0x4afca0[_0xa0d8('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa0d8('0x20')](respondWithFilteredResult(_0x5de51c,_0x19b4ff))['catch'](handleError(_0x5de51c,null));};exports[_0xa0d8('0x6f')]=function(_0x21e67e,_0x442a81,_0x399c8d){var _0x55914b={};var _0x243cf1={};var _0x16d139;var _0x4e4572;return db[_0xa0d8('0x3f')]['findOne']({'where':{'id':_0x21e67e[_0xa0d8('0x55')]['id']}})[_0xa0d8('0x20')](handleEntityNotFound(_0x442a81,null))[_0xa0d8('0x20')](function(_0x44872a){if(_0x44872a){_0x16d139=_0x44872a;_0x243cf1[_0xa0d8('0x40')]=_['keys'](db[_0xa0d8('0x70')][_0xa0d8('0x57')]);_0x243cf1[_0xa0d8('0x41')]=_[_0xa0d8('0x56')](_0x21e67e['query']);_0x243cf1[_0xa0d8('0x42')]=_['intersection'](_0x243cf1['model'],_0x243cf1[_0xa0d8('0x41')]);_0x55914b[_0xa0d8('0x44')]=_[_0xa0d8('0x43')](_0x243cf1[_0xa0d8('0x40')],qs[_0xa0d8('0x45')](_0x21e67e['query'][_0xa0d8('0x45')]));_0x55914b['attributes']=_0x55914b['attributes'][_0xa0d8('0x46')]?_0x55914b[_0xa0d8('0x44')]:_0x243cf1[_0xa0d8('0x40')];_0x55914b[_0xa0d8('0x4a')]=qs[_0xa0d8('0x4b')](_0x21e67e[_0xa0d8('0x41')][_0xa0d8('0x4b')]);_0x55914b['where']=qs[_0xa0d8('0x42')](_[_0xa0d8('0x66')](_0x21e67e['query'],_0x243cf1[_0xa0d8('0x42')]));if(_0x21e67e[_0xa0d8('0x41')][_0xa0d8('0x4d')]){_0x55914b[_0xa0d8('0x4c')]=_[_0xa0d8('0x4e')](_0x55914b[_0xa0d8('0x4c')],{'$or':_[_0xa0d8('0x3e')](_0x55914b[_0xa0d8('0x44')],function(_0x2fd519){var _0x59d883={};_0x59d883[_0x2fd519]={'$like':'%'+_0x21e67e[_0xa0d8('0x41')][_0xa0d8('0x4d')]+'%'};return _0x59d883;})});}_0x55914b=_[_0xa0d8('0x4e')]({},_0x55914b,_0x21e67e[_0xa0d8('0x51')]);return _0x16d139['getTeams'](_0x55914b);}})[_0xa0d8('0x20')](function(_0x5397e6){if(_0x5397e6){_0x4e4572=_0x5397e6['length'];if(!_0x21e67e[_0xa0d8('0x41')][_0xa0d8('0x47')](_0xa0d8('0x48'))){_0x55914b[_0xa0d8('0x49')]=qs[_0xa0d8('0x49')](_0x21e67e[_0xa0d8('0x41')][_0xa0d8('0x49')]);_0x55914b[_0xa0d8('0x30')]=qs[_0xa0d8('0x30')](_0x21e67e[_0xa0d8('0x41')][_0xa0d8('0x30')]);}return _0x16d139['getTeams'](_0x55914b);}})['then'](function(_0x25d897){if(_0x25d897){return _0x25d897?{'count':_0x4e4572,'rows':_0x25d897}:null;}})[_0xa0d8('0x20')](respondWithResult(_0x442a81,null))['catch'](handleError(_0x442a81,null));};exports['addTeams']=function(_0x264965,_0x404803,_0xad9eab){var _0xa5f29f=_0x264965[_0xa0d8('0x62')]['ids'];return db[_0xa0d8('0x70')]['findAll']({'where':{'id':_0xa5f29f},'attributes':['id'],'include':[{'model':db[_0xa0d8('0x69')],'as':_0xa0d8('0x71'),'attributes':['id',_0xa0d8('0x3b'),_0xa0d8('0x72'),'voicePause',_0xa0d8('0x73')],'raw':!![]}]})[_0xa0d8('0x20')](function(_0xfc632d){if(_0xfc632d){var _0x4fd8c0=_[_0xa0d8('0x74')](_0xfc632d,function(_0x213057){var _0x372512=_0x213057[_0xa0d8('0x37')]({'plain':!![]});return _0x372512[_0xa0d8('0x71')];});return db['ChatQueue'][_0xa0d8('0x5a')]({'where':{'id':_0x264965[_0xa0d8('0x55')]['id']}})[_0xa0d8('0x20')](function(_0x19d1e0){return db[_0xa0d8('0x75')][_0xa0d8('0x76')](function(_0x2de9b8){return _0x19d1e0['addTeams'](_0xa5f29f,{'transaction':_0x2de9b8})[_0xa0d8('0x20')](function(){return BPromise[_0xa0d8('0x77')](_0x4fd8c0,function(_0x51876b){return db[_0xa0d8('0x68')][_0xa0d8('0x78')]({'where':{'UserId':_0x51876b['id'],'ChatQueueId':_0x264965[_0xa0d8('0x55')]['id']},'transaction':_0x2de9b8});});})[_0xa0d8('0x20')](function(){_0x4fd8c0[_0xa0d8('0x79')](function(_0x9c833e){socket[_0xa0d8('0x7a')](_0xa0d8('0x7b'),{'UserId':_0x9c833e['id'],'ChatQueueId':_0x19d1e0['id']});});});});});}})['then'](respondWithStatusCode(_0x404803,null))[_0xa0d8('0x5b')](handleError(_0x404803,null));};exports['removeTeams']=function(_0x14e0a7,_0x1a0347,_0x7686eb){return db['Team'][_0xa0d8('0x52')]({'where':{'id':_0x14e0a7[_0xa0d8('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa0d8('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa0d8('0x20')](handleEntityNotFound(_0x1a0347,null))[_0xa0d8('0x20')](function(_0x499cd4){var _0xe4750b=_['map'](_0x499cd4,'id');var _0x286abb=[];var _0x5d2be5=[];var _0x245182=squel[_0xa0d8('0x7c')]();_0x245182[_0xa0d8('0x7d')](_0xa0d8('0x7e'))[_0xa0d8('0x7f')]('team_has_chat_queues','tq')['join'](_0xa0d8('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa0d8('0x81'),_0x14e0a7[_0xa0d8('0x55')]['id']);for(var _0x42b3c0=0x0;_0x42b3c0<_0x499cd4[_0xa0d8('0x46')];_0x42b3c0+=0x1){let _0x10ef1d=_0x499cd4[_0x42b3c0];for(var _0x1d67a0=0x0;_0x1d67a0<_0x10ef1d[_0xa0d8('0x71')][_0xa0d8('0x46')];_0x1d67a0+=0x1){let _0x34615f=_0x10ef1d[_0xa0d8('0x71')][_0x1d67a0];var _0x3403b9=_0x245182[_0xa0d8('0x82')]();_0x3403b9[_0xa0d8('0x4c')](_0xa0d8('0x83'),_0x34615f['id']);_0x5d2be5[_0xa0d8('0x84')](db[_0xa0d8('0x75')][_0xa0d8('0x41')](_0x3403b9[_0xa0d8('0x85')](),{'type':db['sequelize']['QueryTypes'][_0xa0d8('0x86')]})[_0xa0d8('0x20')](function(_0x41f69a){if(_0x41f69a[_0xa0d8('0x46')]===0x1){return _0x34615f['id'];}else{var _0x14a33f=_[_0xa0d8('0x87')](_[_0xa0d8('0x3e')](_0x41f69a,_0xa0d8('0x88')),function(_0xe4da0c){return _[_0xa0d8('0x89')](_0xe4750b,_0xe4da0c);});if(_0x14a33f){return _0x34615f['id'];}}}));}}return BPromise[_0xa0d8('0x8a')](_0x5d2be5)['then'](function(_0xf851f2){_0x286abb=_(_0x286abb)[_0xa0d8('0x8b')](_0xf851f2)['compact']()[_0xa0d8('0x8c')]();return db[_0xa0d8('0x3f')][_0xa0d8('0x5a')]({'where':{'id':_0x14e0a7[_0xa0d8('0x55')]['id']}})[_0xa0d8('0x20')](function(_0x2d5286){return db[_0xa0d8('0x75')][_0xa0d8('0x76')](function(_0x3ace30){return _0x2d5286['removeTeams'](_0x14e0a7['query'][_0xa0d8('0x8d')],{'transaction':_0x3ace30})[_0xa0d8('0x20')](function(){if(!_[_0xa0d8('0x8e')](_0x286abb)){return _0x2d5286['removeAgents'](_0x286abb,{'transaction':_0x3ace30});}})[_0xa0d8('0x20')](function(){_0x286abb[_0xa0d8('0x79')](function(_0x598568){socket[_0xa0d8('0x7a')](_0xa0d8('0x8f'),{'UserId':_0x598568,'ChatQueueId':_0x2d5286['id']});});});});});});})[_0xa0d8('0x20')](respondWithStatusCode(_0x1a0347,null))[_0xa0d8('0x5b')](handleError(_0x1a0347,null));};exports['addAgents']=function(_0x1d7483,_0x155697,_0x106406){return db[_0xa0d8('0x3f')][_0xa0d8('0x5a')]({'where':{'id':_0x1d7483[_0xa0d8('0x55')]['id']}})[_0xa0d8('0x20')](handleEntityNotFound(_0x155697,null))[_0xa0d8('0x20')](function(_0x39ba87){if(_0x39ba87){return _0x39ba87['addAgents'](_0x1d7483[_0xa0d8('0x62')]['ids'],_['omit'](_0x1d7483[_0xa0d8('0x62')],[_0xa0d8('0x8d'),'id'])||{})[_0xa0d8('0x90')](function(_0x411ce2){for(var _0x539de5=0x0;_0x539de5<_0x1d7483['body'][_0xa0d8('0x8d')]['length'];_0x539de5+=0x1){socket[_0xa0d8('0x7a')](_0xa0d8('0x7b'),{'UserId':Number(_0x1d7483['body'][_0xa0d8('0x8d')][_0x539de5]),'ChatQueueId':Number(_0x1d7483['params']['id'])});}return _0x411ce2;});}})[_0xa0d8('0x20')](respondWithResult(_0x155697,null))[_0xa0d8('0x5b')](handleError(_0x155697,null));};exports[_0xa0d8('0x91')]=function(_0x4dbfdc,_0x2cde16,_0xb0fad9){return db[_0xa0d8('0x3f')][_0xa0d8('0x5a')]({'where':{'id':_0x4dbfdc[_0xa0d8('0x55')]['id']}})[_0xa0d8('0x20')](handleEntityNotFound(_0x2cde16,null))['then'](function(_0x1f98d8){if(_0x1f98d8){return _0x1f98d8[_0xa0d8('0x91')](_0x4dbfdc[_0xa0d8('0x41')]['ids'])[_0xa0d8('0x20')](function(){if(_[_0xa0d8('0x92')](_0x4dbfdc[_0xa0d8('0x41')]['ids'])){for(var _0x464cba=0x0;_0x464cba<_0x4dbfdc['query'][_0xa0d8('0x8d')][_0xa0d8('0x46')];_0x464cba+=0x1){socket[_0xa0d8('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x4dbfdc[_0xa0d8('0x41')][_0xa0d8('0x8d')][_0x464cba]),'ChatQueueId':Number(_0x4dbfdc[_0xa0d8('0x55')]['id'])});}}else{socket[_0xa0d8('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x4dbfdc[_0xa0d8('0x41')][_0xa0d8('0x8d')]),'ChatQueueId':Number(_0x4dbfdc[_0xa0d8('0x55')]['id'])});}});}})[_0xa0d8('0x20')](respondWithStatusCode(_0x2cde16,null))['catch'](handleError(_0x2cde16,null));};exports['getAgents']=function(_0x17c6e4,_0x4a39a0,_0x28889f){var _0x19b4bb={};var _0x100efb={};var _0x13fc7b;var _0x39b08c;return db[_0xa0d8('0x3f')][_0xa0d8('0x65')]({'where':{'id':_0x17c6e4[_0xa0d8('0x55')]['id']}})['then'](handleEntityNotFound(_0x4a39a0,null))[_0xa0d8('0x20')](function(_0x590af9){if(_0x590af9){_0x13fc7b=_0x590af9;_0x100efb['model']=_[_0xa0d8('0x56')](db[_0xa0d8('0x69')][_0xa0d8('0x57')]);_0x100efb[_0xa0d8('0x41')]=_[_0xa0d8('0x56')](_0x17c6e4[_0xa0d8('0x41')]);_0x100efb[_0xa0d8('0x42')]=_[_0xa0d8('0x43')](_0x100efb[_0xa0d8('0x40')],_0x100efb[_0xa0d8('0x41')]);_0x19b4bb[_0xa0d8('0x44')]=_[_0xa0d8('0x43')](_0x100efb[_0xa0d8('0x40')],qs['fields'](_0x17c6e4[_0xa0d8('0x41')][_0xa0d8('0x45')]));_0x19b4bb[_0xa0d8('0x44')]=_0x19b4bb['attributes'][_0xa0d8('0x46')]?_0x19b4bb[_0xa0d8('0x44')]:_0x100efb[_0xa0d8('0x40')];_0x19b4bb[_0xa0d8('0x4a')]=qs['sort'](_0x17c6e4[_0xa0d8('0x41')]['sort']);_0x19b4bb['where']=qs['filters'](_['pick'](_0x17c6e4[_0xa0d8('0x41')],_0x100efb[_0xa0d8('0x42')]));if(_0x17c6e4['query'][_0xa0d8('0x4d')]){_0x19b4bb[_0xa0d8('0x4c')]=_[_0xa0d8('0x4e')](_0x19b4bb[_0xa0d8('0x4c')],{'$or':_['map'](_0x19b4bb['attributes'],function(_0x17aff2){var _0x1ee925={};_0x1ee925[_0x17aff2]={'$like':'%'+_0x17c6e4[_0xa0d8('0x41')][_0xa0d8('0x4d')]+'%'};return _0x1ee925;})});}_0x19b4bb=_[_0xa0d8('0x4e')]({},_0x19b4bb,_0x17c6e4['options']);return _0x13fc7b['getAgents'](_0x19b4bb);}})[_0xa0d8('0x20')](function(_0x3c6123){if(_0x3c6123){_0x39b08c=_0x3c6123[_0xa0d8('0x46')];if(!_0x17c6e4[_0xa0d8('0x41')][_0xa0d8('0x47')](_0xa0d8('0x48'))){_0x19b4bb[_0xa0d8('0x49')]=qs['limit'](_0x17c6e4[_0xa0d8('0x41')][_0xa0d8('0x49')]);_0x19b4bb[_0xa0d8('0x30')]=qs['offset'](_0x17c6e4['query'][_0xa0d8('0x30')]);}return _0x13fc7b[_0xa0d8('0x93')](_0x19b4bb);}})['then'](function(_0x3f5fe0){if(_0x3f5fe0){return _0x3f5fe0?{'count':_0x39b08c,'rows':_0x3f5fe0}:null;}})[_0xa0d8('0x20')](respondWithResult(_0x4a39a0,null))[_0xa0d8('0x5b')](handleError(_0x4a39a0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index c04e1d1..f46f3b7 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 _0x7c94=['save','update','remove','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners'];(function(_0x6549ff,_0x44ee99){var _0x18ed41=function(_0x278bdb){while(--_0x278bdb){_0x6549ff['push'](_0x6549ff['shift']());}};_0x18ed41(++_0x44ee99);}(_0x7c94,0x1c0));var _0x47c9=function(_0x4683c5,_0x3cbf9a){_0x4683c5=_0x4683c5-0x0;var _0x577ff7=_0x7c94[_0x4683c5];return _0x577ff7;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x47c9('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x47c9('0x1')](0x0);var events={'afterCreate':_0x47c9('0x2'),'afterUpdate':_0x47c9('0x3'),'afterDestroy':_0x47c9('0x4')};function emitEvent(_0x590f09){return function(_0x157053,_0x3b2732,_0x2d373c){ChatQueueEvents[_0x47c9('0x5')](_0x590f09+':'+_0x157053['id'],_0x157053);ChatQueueEvents[_0x47c9('0x5')](_0x590f09,_0x157053);_0x2d373c(null);};}for(var e in events){if(events[_0x47c9('0x6')](e)){var event=events[e];ChatQueue[_0x47c9('0x7')](e,emitEvent(event));}}module[_0x47c9('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xa841=['emit','hasOwnProperty','exports','events','../../mysqldb','save','update','remove'];(function(_0x494f30,_0x23c4f2){var _0x3c62ec=function(_0x5e1807){while(--_0x5e1807){_0x494f30['push'](_0x494f30['shift']());}};_0x3c62ec(++_0x23c4f2);}(_0xa841,0x113));var _0x1a84=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xa841[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require(_0x1a84('0x0'));var ChatQueue=require(_0x1a84('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1a84('0x2'),'afterUpdate':_0x1a84('0x3'),'afterDestroy':_0x1a84('0x4')};function emitEvent(_0x297319){return function(_0x12099c,_0x3d83a5,_0x12e254){ChatQueueEvents[_0x1a84('0x5')](_0x297319+':'+_0x12099c['id'],_0x12099c);ChatQueueEvents['emit'](_0x297319,_0x12099c);_0x12e254(null);};}for(var e in events){if(events[_0x1a84('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x1a84('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index fb19e43..4a69ae8 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 _0x9c5a=['ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x413e45,_0x1c861d){var _0x17a026=function(_0x149d33){while(--_0x149d33){_0x413e45['push'](_0x413e45['shift']());}};_0x17a026(++_0x1c861d);}(_0x9c5a,0xec));var _0xa9c5=function(_0x425ad4,_0x4bddce){_0x425ad4=_0x425ad4-0x0;var _0x134957=_0x9c5a[_0x425ad4];return _0x134957;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa9c5('0x0'))(_0xa9c5('0x1'));var moment=require(_0xa9c5('0x2'));var BPromise=require(_0xa9c5('0x3'));var rp=require(_0xa9c5('0x4'));var fs=require('fs');var path=require(_0xa9c5('0x5'));var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require(_0xa9c5('0x8'));module[_0xa9c5('0x9')]=function(_0x422274,_0x3d4764){return _0x422274[_0xa9c5('0xa')](_0xa9c5('0xb'),attributes,{'tableName':_0xa9c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61e1=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x98d3ee,_0x588a0f){var _0x3c5936=function(_0x51f05b){while(--_0x51f05b){_0x98d3ee['push'](_0x98d3ee['shift']());}};_0x3c5936(++_0x588a0f);}(_0x61e1,0x1b2));var _0x161e=function(_0x2ca2e3,_0x5658f7){_0x2ca2e3=_0x2ca2e3-0x0;var _0x5220d2=_0x61e1[_0x2ca2e3];return _0x5220d2;};'use strict';var _=require(_0x161e('0x0'));var util=require(_0x161e('0x1'));var logger=require(_0x161e('0x2'))(_0x161e('0x3'));var moment=require(_0x161e('0x4'));var BPromise=require(_0x161e('0x5'));var rp=require(_0x161e('0x6'));var fs=require('fs');var path=require(_0x161e('0x7'));var rimraf=require(_0x161e('0x8'));var config=require(_0x161e('0x9'));var attributes=require(_0x161e('0xa'));module[_0x161e('0xb')]=function(_0x40e04e,_0x13ecbb){return _0x40e04e[_0x161e('0xc')]('ChatQueue',attributes,{'tableName':'chat_queues','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 1c0b916..2775ebd 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 _0x0457=['attributes','limit','include','map','model','ShowChatQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where'];(function(_0x14b698,_0x543a10){var _0x291d5d=function(_0x4e058f){while(--_0x4e058f){_0x14b698['push'](_0x14b698['shift']());}};_0x291d5d(++_0x543a10);}(_0x0457,0x11f));var _0x7045=function(_0x1db76,_0x1e047c){_0x1db76=_0x1db76-0x0;var _0x49f54d=_0x0457[_0x1db76];return _0x49f54d;};'use strict';var _=require('lodash');var util=require(_0x7045('0x0'));var moment=require(_0x7045('0x1'));var BPromise=require('bluebird');var rs=require(_0x7045('0x2'));var fs=require('fs');var Redis=require(_0x7045('0x3'));var db=require(_0x7045('0x4'))['db'];var utils=require(_0x7045('0x5'));var logger=require(_0x7045('0x6'))(_0x7045('0x7'));var config=require('../../config/environment');var jayson=require(_0x7045('0x8'));var client=jayson['client'][_0x7045('0x9')]({'port':0x232a});config[_0x7045('0xa')]=_[_0x7045('0xb')](config[_0x7045('0xa')],{'host':_0x7045('0xc'),'port':0x18eb});var socket=require(_0x7045('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x7045('0xe')](socket);function respondWithRpcPromise(_0x3f7aea,_0x1fcc85,_0xa0cd){return new BPromise(function(_0x7871fd,_0x4e1a06){return client[_0x7045('0xf')](_0x3f7aea,_0xa0cd)[_0x7045('0x10')](function(_0x1f819d){logger[_0x7045('0x11')](_0x7045('0x12'),_0x1fcc85,_0x7045('0x13'));logger[_0x7045('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1fcc85,_0x7045('0x13'),JSON[_0x7045('0x15')](_0x1f819d));if(_0x1f819d['error']){if(_0x1f819d['error'][_0x7045('0x16')]===0x1f4){logger[_0x7045('0x17')]('ChatQueue,\x20%s,\x20%s',_0x1fcc85,_0x1f819d[_0x7045('0x17')][_0x7045('0x18')]);return _0x4e1a06(_0x1f819d[_0x7045('0x17')][_0x7045('0x18')]);}logger[_0x7045('0x17')]('ChatQueue,\x20%s,\x20%s',_0x1fcc85,_0x1f819d[_0x7045('0x17')][_0x7045('0x18')]);return _0x7871fd(_0x1f819d[_0x7045('0x17')][_0x7045('0x18')]);}else{logger[_0x7045('0x11')](_0x7045('0x12'),_0x1fcc85,_0x7045('0x13'));_0x7871fd(_0x1f819d[_0x7045('0x19')][_0x7045('0x18')]);}})[_0x7045('0x1a')](function(_0x57e966){logger['error'](_0x7045('0x12'),_0x1fcc85,_0x57e966);_0x4e1a06(_0x57e966);});});}exports[_0x7045('0x1b')]=function(_0x1c4837){var _0xe50cb0=this;return new Promise(function(_0x5cc189,_0x4a438d){return db[_0x7045('0x1c')][_0x7045('0x1d')]({'raw':_0x1c4837[_0x7045('0x1e')]?_0x1c4837['options'][_0x7045('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c4837[_0x7045('0x1e')]?_0x1c4837['options'][_0x7045('0x20')]||null:null,'attributes':_0x1c4837[_0x7045('0x1e')]?_0x1c4837['options'][_0x7045('0x21')]||null:null,'limit':_0x1c4837[_0x7045('0x1e')]?_0x1c4837[_0x7045('0x1e')][_0x7045('0x22')]||null:null,'include':_0x1c4837['options']?_0x1c4837['options'][_0x7045('0x23')]?_[_0x7045('0x24')](_0x1c4837[_0x7045('0x1e')][_0x7045('0x23')],function(_0x54508a){return{'model':db[_0x54508a[_0x7045('0x25')]],'as':_0x54508a['as'],'attributes':_0x54508a[_0x7045('0x21')],'include':_0x54508a['include']?_[_0x7045('0x24')](_0x54508a[_0x7045('0x23')],function(_0x38658e){return{'model':db[_0x38658e[_0x7045('0x25')]],'as':_0x38658e['as'],'attributes':_0x38658e['attributes'],'include':_0x38658e[_0x7045('0x23')]?_[_0x7045('0x24')](_0x38658e[_0x7045('0x23')],function(_0x2e7e65){return{'model':db[_0x2e7e65[_0x7045('0x25')]],'as':_0x2e7e65['as'],'attributes':_0x2e7e65[_0x7045('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7045('0x10')](function(_0x4e078b){logger[_0x7045('0x11')](_0x7045('0x1b'),_0x1c4837);logger[_0x7045('0x14')](_0x7045('0x1b'),_0x1c4837,JSON[_0x7045('0x15')](_0x4e078b));_0x5cc189(_0x4e078b);})['catch'](function(_0x25dd21){logger[_0x7045('0x17')]('GetChatQueue',_0x25dd21[_0x7045('0x18')],_0x1c4837);_0x4a438d(_0xe50cb0['error'](0x1f4,_0x25dd21['message']));});});};exports[_0x7045('0x26')]=function(_0x2826a5){var _0x179a05=this;return new Promise(function(_0x574f9f,_0x1a794f){return db[_0x7045('0x1c')][_0x7045('0x27')]({'raw':_0x2826a5[_0x7045('0x1e')]?_0x2826a5['options'][_0x7045('0x1f')]===undefined?!![]:![]:!![],'where':_0x2826a5[_0x7045('0x1e')]?_0x2826a5[_0x7045('0x1e')]['where']||null:null,'attributes':_0x2826a5[_0x7045('0x1e')]?_0x2826a5[_0x7045('0x1e')][_0x7045('0x21')]||null:null,'include':_0x2826a5[_0x7045('0x1e')]?_0x2826a5[_0x7045('0x1e')][_0x7045('0x23')]?_[_0x7045('0x24')](_0x2826a5['options']['include'],function(_0x2a869d){return{'model':db[_0x2a869d['model']],'as':_0x2a869d['as'],'attributes':_0x2a869d[_0x7045('0x21')],'include':_0x2a869d[_0x7045('0x23')]?_['map'](_0x2a869d[_0x7045('0x23')],function(_0xae575d){return{'model':db[_0xae575d['model']],'as':_0xae575d['as'],'attributes':_0xae575d[_0x7045('0x21')],'include':_0xae575d[_0x7045('0x23')]?_[_0x7045('0x24')](_0xae575d[_0x7045('0x23')],function(_0xbb438c){return{'model':db[_0xbb438c[_0x7045('0x25')]],'as':_0xbb438c['as'],'attributes':_0xbb438c[_0x7045('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7045('0x10')](function(_0x223fd){logger[_0x7045('0x11')](_0x7045('0x26'),_0x2826a5);logger['debug']('ShowChatQueue',_0x2826a5,JSON[_0x7045('0x15')](_0x223fd));_0x574f9f(_0x223fd);})[_0x7045('0x1a')](function(_0x46e9cc){logger['error']('ShowChatQueue',_0x46e9cc['message'],_0x2826a5);_0x1a794f(_0x179a05['error'](0x1f4,_0x46e9cc['message']));});});}; \ No newline at end of file +var _0x3eae=['jayson/promise','http','redis','socket.io-emitter','./chatQueue.socket','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','map','include','model','attributes','ShowChatQueue','find','where','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x1678c8,_0x1c32f4){var _0x387aa9=function(_0x2803bd){while(--_0x2803bd){_0x1678c8['push'](_0x1678c8['shift']());}};_0x387aa9(++_0x1c32f4);}(_0x3eae,0x66));var _0xe3ea=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x3eae[_0x5f0501];return _0x3c2c45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe3ea('0x0'));var BPromise=require(_0xe3ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3ea('0x2'));var db=require(_0xe3ea('0x3'))['db'];var utils=require(_0xe3ea('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe3ea('0x5'));var jayson=require(_0xe3ea('0x6'));var client=jayson['client'][_0xe3ea('0x7')]({'port':0x232a});config[_0xe3ea('0x8')]=_['defaults'](config[_0xe3ea('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3ea('0x9'))(new Redis(config[_0xe3ea('0x8')]));require(_0xe3ea('0xa'))['register'](socket);function respondWithRpcPromise(_0xd81169,_0x1b6707,_0x1ef29c){return new BPromise(function(_0x31a966,_0x3175e0){return client[_0xe3ea('0xb')](_0xd81169,_0x1ef29c)[_0xe3ea('0xc')](function(_0x2eae0d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x1b6707,_0xe3ea('0xd'));logger[_0xe3ea('0xe')](_0xe3ea('0xf'),_0x1b6707,_0xe3ea('0xd'),JSON[_0xe3ea('0x10')](_0x2eae0d));if(_0x2eae0d[_0xe3ea('0x11')]){if(_0x2eae0d[_0xe3ea('0x11')][_0xe3ea('0x12')]===0x1f4){logger[_0xe3ea('0x11')](_0xe3ea('0x13'),_0x1b6707,_0x2eae0d[_0xe3ea('0x11')][_0xe3ea('0x14')]);return _0x3175e0(_0x2eae0d[_0xe3ea('0x11')]['message']);}logger[_0xe3ea('0x11')](_0xe3ea('0x13'),_0x1b6707,_0x2eae0d[_0xe3ea('0x11')][_0xe3ea('0x14')]);return _0x31a966(_0x2eae0d[_0xe3ea('0x11')][_0xe3ea('0x14')]);}else{logger[_0xe3ea('0x15')](_0xe3ea('0x13'),_0x1b6707,_0xe3ea('0xd'));_0x31a966(_0x2eae0d[_0xe3ea('0x16')][_0xe3ea('0x14')]);}})[_0xe3ea('0x17')](function(_0x255a50){logger[_0xe3ea('0x11')](_0xe3ea('0x13'),_0x1b6707,_0x255a50);_0x3175e0(_0x255a50);});});}exports[_0xe3ea('0x18')]=function(_0x1280be){var _0xa367ed=this;return new Promise(function(_0x1f28ca,_0x29e32e){return db[_0xe3ea('0x19')][_0xe3ea('0x1a')]({'raw':_0x1280be[_0xe3ea('0x1b')]?_0x1280be[_0xe3ea('0x1b')][_0xe3ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x1280be['options']?_0x1280be['options']['where']||null:null,'attributes':_0x1280be[_0xe3ea('0x1b')]?_0x1280be['options']['attributes']||null:null,'limit':_0x1280be[_0xe3ea('0x1b')]?_0x1280be[_0xe3ea('0x1b')]['limit']||null:null,'include':_0x1280be[_0xe3ea('0x1b')]?_0x1280be[_0xe3ea('0x1b')]['include']?_[_0xe3ea('0x1d')](_0x1280be['options'][_0xe3ea('0x1e')],function(_0x3255ad){return{'model':db[_0x3255ad[_0xe3ea('0x1f')]],'as':_0x3255ad['as'],'attributes':_0x3255ad['attributes'],'include':_0x3255ad[_0xe3ea('0x1e')]?_[_0xe3ea('0x1d')](_0x3255ad['include'],function(_0x522a3f){return{'model':db[_0x522a3f['model']],'as':_0x522a3f['as'],'attributes':_0x522a3f['attributes'],'include':_0x522a3f['include']?_['map'](_0x522a3f[_0xe3ea('0x1e')],function(_0x3e7c9f){return{'model':db[_0x3e7c9f[_0xe3ea('0x1f')]],'as':_0x3e7c9f['as'],'attributes':_0x3e7c9f[_0xe3ea('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48a6a1){logger[_0xe3ea('0x15')]('GetChatQueue',_0x1280be);logger[_0xe3ea('0xe')](_0xe3ea('0x18'),_0x1280be,JSON[_0xe3ea('0x10')](_0x48a6a1));_0x1f28ca(_0x48a6a1);})['catch'](function(_0x5c8a68){logger[_0xe3ea('0x11')](_0xe3ea('0x18'),_0x5c8a68['message'],_0x1280be);_0x29e32e(_0xa367ed[_0xe3ea('0x11')](0x1f4,_0x5c8a68[_0xe3ea('0x14')]));});});};exports[_0xe3ea('0x21')]=function(_0x482376){var _0x2aa2b9=this;return new Promise(function(_0x6e44a5,_0x58b8ca){return db[_0xe3ea('0x19')][_0xe3ea('0x22')]({'raw':_0x482376[_0xe3ea('0x1b')]?_0x482376[_0xe3ea('0x1b')][_0xe3ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x482376[_0xe3ea('0x1b')]?_0x482376[_0xe3ea('0x1b')][_0xe3ea('0x23')]||null:null,'attributes':_0x482376[_0xe3ea('0x1b')]?_0x482376['options']['attributes']||null:null,'include':_0x482376[_0xe3ea('0x1b')]?_0x482376[_0xe3ea('0x1b')][_0xe3ea('0x1e')]?_[_0xe3ea('0x1d')](_0x482376[_0xe3ea('0x1b')][_0xe3ea('0x1e')],function(_0x588595){return{'model':db[_0x588595['model']],'as':_0x588595['as'],'attributes':_0x588595[_0xe3ea('0x20')],'include':_0x588595[_0xe3ea('0x1e')]?_[_0xe3ea('0x1d')](_0x588595[_0xe3ea('0x1e')],function(_0x18a547){return{'model':db[_0x18a547[_0xe3ea('0x1f')]],'as':_0x18a547['as'],'attributes':_0x18a547[_0xe3ea('0x20')],'include':_0x18a547[_0xe3ea('0x1e')]?_[_0xe3ea('0x1d')](_0x18a547[_0xe3ea('0x1e')],function(_0x53a1ec){return{'model':db[_0x53a1ec[_0xe3ea('0x1f')]],'as':_0x53a1ec['as'],'attributes':_0x53a1ec[_0xe3ea('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe3ea('0xc')](function(_0x5b73b3){logger['info']('ShowChatQueue',_0x482376);logger[_0xe3ea('0xe')](_0xe3ea('0x21'),_0x482376,JSON['stringify'](_0x5b73b3));_0x6e44a5(_0x5b73b3);})[_0xe3ea('0x17')](function(_0x2db6f7){logger[_0xe3ea('0x11')]('ShowChatQueue',_0x2db6f7[_0xe3ea('0x14')],_0x482376);_0x58b8ca(_0x2aa2b9[_0xe3ea('0x11')](0x1f4,_0x2db6f7[_0xe3ea('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 8da24b0..55ad2e0 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 _0xb458=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x4a3f9e,_0x3b330){var _0x3024d6=function(_0x2712e7){while(--_0x2712e7){_0x4a3f9e['push'](_0x4a3f9e['shift']());}};_0x3024d6(++_0x3b330);}(_0xb458,0x103));var _0x8b45=function(_0x1f547a,_0x3e066d){_0x1f547a=_0x1f547a-0x0;var _0x4da3e8=_0xb458[_0x1f547a];return _0x4da3e8;};'use strict';var ChatQueueEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatQueueEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatQueue:'+_0x3a8ccb,_0x5cc2d5);ChatQueueEvents['on'](_0x3a8ccb,_0x32342f);}}; \ No newline at end of file +var _0xe14d=['update','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x2f6c38,_0x3fef4d){var _0x12d7f7=function(_0x342d12){while(--_0x342d12){_0x2f6c38['push'](_0x2f6c38['shift']());}};_0x12d7f7(++_0x3fef4d);}(_0xe14d,0x1ee));var _0xde14=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xe14d[_0x4bfac3];return _0x15f0f2;};'use strict';var ChatQueueEvents=require(_0xde14('0x0'));var events=[_0xde14('0x1'),_0xde14('0x2'),_0xde14('0x3')];function createListener(_0x48b392,_0x1c5b4){return function(_0x28965b){_0x1c5b4['emit'](_0x48b392,_0x28965b);};}function removeListener(_0x1c3e94,_0x13c24e){return function(){ChatQueueEvents[_0xde14('0x4')](_0x1c3e94,_0x13c24e);};}exports[_0xde14('0x5')]=function(_0x461af3){for(var _0xba1514=0x0,_0x4b1f6b=events['length'];_0xba1514<_0x4b1f6b;_0xba1514++){var _0x1bd49d=events[_0xba1514];var _0x115b7d=createListener(_0xde14('0x6')+_0x1bd49d,_0x461af3);ChatQueueEvents['on'](_0x1bd49d,_0x115b7d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index bc5aee6..9e1f3a6 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x5fc3[_0x375492];return _0x18ba5b;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2f0581,_0x4a7c00){var _0x5623ac=function(_0x4d7ccd){while(--_0x4d7ccd){_0x2f0581['push'](_0x2f0581['shift']());}};_0x5623ac(++_0x4a7c00);}(_0x7217,0x19e));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 7aa18c5..9ab16ff 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 _0xcdbd=['DATE','moment','exports','STRING'];(function(_0xdb1aff,_0x5e06c4){var _0x5d4d79=function(_0x6185ed){while(--_0x6185ed){_0xdb1aff['push'](_0xdb1aff['shift']());}};_0x5d4d79(++_0x5e06c4);}(_0xcdbd,0x15d));var _0xdcdb=function(_0x404658,_0x24f685){_0x404658=_0x404658-0x0;var _0x397410=_0xcdbd[_0x404658];return _0x397410;};'use strict';var moment=require(_0xdcdb('0x0'));var Sequelize=require('sequelize');module[_0xdcdb('0x1')]={'uniqueid':{'type':Sequelize[_0xdcdb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdcdb('0x2')]},'joinAt':{'type':Sequelize[_0xdcdb('0x3')]},'leaveAt':{'type':Sequelize[_0xdcdb('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdcdb('0x3')]},'reason':{'type':Sequelize[_0xdcdb('0x2')]}}; \ No newline at end of file +var _0x46f8=['moment','exports','STRING','DATE'];(function(_0x5bfb78,_0x22e3ff){var _0x4efd00=function(_0x5c9496){while(--_0x5c9496){_0x5bfb78['push'](_0x5bfb78['shift']());}};_0x4efd00(++_0x22e3ff);}(_0x46f8,0x150));var _0x846f=function(_0x19fe1e,_0x5915a0){_0x19fe1e=_0x19fe1e-0x0;var _0x394dca=_0x46f8[_0x19fe1e];return _0x394dca;};'use strict';var moment=require(_0x846f('0x0'));var Sequelize=require('sequelize');module[_0x846f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x846f('0x2')]},'joinAt':{'type':Sequelize[_0x846f('0x3')]},'leaveAt':{'type':Sequelize[_0x846f('0x3')]},'acceptAt':{'type':Sequelize[_0x846f('0x3')]},'exitAt':{'type':Sequelize[_0x846f('0x3')]},'reason':{'type':Sequelize[_0x846f('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1d9f7b1..d20d4b0 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 _0xee3c=['VIRTUAL','then','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x3e735d,_0x9b475b){var _0x100daa=function(_0x289158){while(--_0x289158){_0x3e735d['push'](_0x3e735d['shift']());}};_0x100daa(++_0x9b475b);}(_0xee3c,0x14a));var _0xcee3=function(_0x303bdc,_0x2c0640){_0x303bdc=_0x303bdc-0x0;var _0x221004=_0xee3c[_0x303bdc];return _0x221004;};'use strict';var emlformat=require(_0xcee3('0x0'));var rimraf=require(_0xcee3('0x1'));var zipdir=require(_0xcee3('0x2'));var jsonpatch=require(_0xcee3('0x3'));var rp=require(_0xcee3('0x4'));var moment=require(_0xcee3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcee3('0x6'));var path=require(_0xcee3('0x7'));var sox=require(_0xcee3('0x8'));var csv=require(_0xcee3('0x9'));var ejs=require(_0xcee3('0xa'));var fs=require('fs');var fs_extra=require(_0xcee3('0xb'));var _=require(_0xcee3('0xc'));var squel=require(_0xcee3('0xd'));var crypto=require(_0xcee3('0xe'));var jsforce=require(_0xcee3('0xf'));var deskjs=require(_0xcee3('0x10'));var toCsv=require(_0xcee3('0x9'));var querystring=require(_0xcee3('0x11'));var Papa=require(_0xcee3('0x12'));var Redis=require(_0xcee3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcee3('0x14'));var as=require(_0xcee3('0x15'));var hardwareService=require(_0xcee3('0x16'));var logger=require(_0xcee3('0x17'))(_0xcee3('0x18'));var utils=require(_0xcee3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xcee3('0x1a'));var db=require(_0xcee3('0x1b'))['db'];function respondWithStatusCode(_0x2db8ff,_0x1a47e1){_0x1a47e1=_0x1a47e1||0xcc;return function(_0xc4f4f2){if(_0xc4f4f2){return _0x2db8ff['sendStatus'](_0x1a47e1);}return _0x2db8ff[_0xcee3('0x1c')](_0x1a47e1)['end']();};}function respondWithResult(_0x559250,_0x53c810){_0x53c810=_0x53c810||0xc8;return function(_0x3ea063){if(_0x3ea063){return _0x559250[_0xcee3('0x1c')](_0x53c810)['json'](_0x3ea063);}};}function respondWithFilteredResult(_0x50bbf2,_0x34854a){return function(_0x505f09){if(_0x505f09){var _0x420b46=typeof _0x34854a['offset']===_0xcee3('0x1d')&&typeof _0x34854a[_0xcee3('0x1e')]==='undefined';var _0xc139b5=_0x505f09[_0xcee3('0x1f')];var _0x40cb8b=_0x420b46?0x0:_0x34854a[_0xcee3('0x20')];var _0x50bf6e=_0x420b46?_0x505f09[_0xcee3('0x1f')]:_0x34854a[_0xcee3('0x20')]+_0x34854a[_0xcee3('0x1e')];var _0x11bf37;if(_0x50bf6e>=_0xc139b5){_0x50bf6e=_0xc139b5;_0x11bf37=0xc8;}else{_0x11bf37=0xce;}_0x50bbf2['status'](_0x11bf37);return _0x50bbf2[_0xcee3('0x21')](_0xcee3('0x22'),_0x40cb8b+'-'+_0x50bf6e+'/'+_0xc139b5)[_0xcee3('0x23')](_0x505f09);}return null;};}function patchUpdates(_0x8b2470){return function(_0x11d116){try{jsonpatch[_0xcee3('0x24')](_0x11d116,_0x8b2470,!![]);}catch(_0x195ba9){return BPromise[_0xcee3('0x25')](_0x195ba9);}return _0x11d116[_0xcee3('0x26')]();};}function saveUpdates(_0x46d7a9,_0x40dd10){return function(_0xa1efbf){if(_0xa1efbf){return _0xa1efbf[_0xcee3('0x27')](_0x46d7a9)['then'](function(_0x1fee89){return _0x1fee89;});}return null;};}function removeEntity(_0x277194,_0x240736){return function(_0x1ee247){if(_0x1ee247){return _0x1ee247[_0xcee3('0x28')]()['then'](function(){_0x277194['status'](0xcc)[_0xcee3('0x29')]();});}};}function handleEntityNotFound(_0x5b92ba,_0x544509){return function(_0x228ff6){if(!_0x228ff6){_0x5b92ba['sendStatus'](0x194);}return _0x228ff6;};}function handleError(_0x452837,_0x202bfd){_0x202bfd=_0x202bfd||0x1f4;return function(_0x19a15e){logger['error'](_0x19a15e[_0xcee3('0x2a')]);if(_0x19a15e['name']){delete _0x19a15e[_0xcee3('0x2b')];}_0x452837['status'](_0x202bfd)[_0xcee3('0x2c')](_0x19a15e);};}exports[_0xcee3('0x2d')]=function(_0x5d965d,_0x3a2532){var _0x1efb1b={},_0x5c1a32={},_0x400cfe={'count':0x0,'rows':[]};var _0x4ef9da=_['map'](db[_0xcee3('0x2e')]['rawAttributes'],function(_0x22e342){return{'name':_0x22e342[_0xcee3('0x2f')],'type':_0x22e342[_0xcee3('0x30')][_0xcee3('0x31')]};});_0x5c1a32[_0xcee3('0x32')]=_[_0xcee3('0x33')](_0x4ef9da,_0xcee3('0x2b'));_0x5c1a32['query']=_[_0xcee3('0x34')](_0x5d965d['query']);_0x5c1a32[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x5c1a32[_0xcee3('0x32')],_0x5c1a32[_0xcee3('0x37')]);_0x1efb1b[_0xcee3('0x38')]=_[_0xcee3('0x36')](_0x5c1a32[_0xcee3('0x32')],qs[_0xcee3('0x39')](_0x5d965d['query'][_0xcee3('0x39')]));_0x1efb1b[_0xcee3('0x38')]=_0x1efb1b[_0xcee3('0x38')]['length']?_0x1efb1b[_0xcee3('0x38')]:_0x5c1a32[_0xcee3('0x32')];if(!_0x5d965d['query'][_0xcee3('0x3a')]('nolimit')){_0x1efb1b[_0xcee3('0x1e')]=qs['limit'](_0x5d965d['query'][_0xcee3('0x1e')]);_0x1efb1b['offset']=qs[_0xcee3('0x20')](_0x5d965d[_0xcee3('0x37')][_0xcee3('0x20')]);}_0x1efb1b[_0xcee3('0x3b')]=qs['sort'](_0x5d965d['query'][_0xcee3('0x3c')]);_0x1efb1b[_0xcee3('0x3d')]=qs['filters'](_[_0xcee3('0x3e')](_0x5d965d[_0xcee3('0x37')],_0x5c1a32['filters']),_0x4ef9da);if(_0x5d965d[_0xcee3('0x37')][_0xcee3('0x3f')]){_0x1efb1b[_0xcee3('0x3d')]=_[_0xcee3('0x40')](_0x1efb1b[_0xcee3('0x3d')],{'$or':_[_0xcee3('0x33')](_0x4ef9da,function(_0x49f1dc){if(_0x49f1dc[_0xcee3('0x30')]!==_0xcee3('0x41')){var _0x28e726={};_0x28e726[_0x49f1dc[_0xcee3('0x2b')]]={'$like':'%'+_0x5d965d[_0xcee3('0x37')][_0xcee3('0x3f')]+'%'};return _0x28e726;}})});}_0x1efb1b=_[_0xcee3('0x40')]({},_0x1efb1b,_0x5d965d['options']);var _0x139ddc={'where':_0x1efb1b[_0xcee3('0x3d')]};return db[_0xcee3('0x2e')]['count'](_0x139ddc)[_0xcee3('0x42')](function(_0x436961){_0x400cfe['count']=_0x436961;if(_0x5d965d[_0xcee3('0x37')][_0xcee3('0x43')]){_0x1efb1b[_0xcee3('0x44')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xcee3('0x45')](_0x1efb1b);})[_0xcee3('0x42')](function(_0x1bb4a8){_0x400cfe[_0xcee3('0x46')]=_0x1bb4a8;return _0x400cfe;})[_0xcee3('0x42')](respondWithFilteredResult(_0x3a2532,_0x1efb1b))['catch'](handleError(_0x3a2532,null));};exports['show']=function(_0x42e197,_0x41cd61){var _0x45df47={'raw':!![],'where':{'id':_0x42e197[_0xcee3('0x47')]['id']}},_0x47159f={};_0x47159f[_0xcee3('0x32')]=_[_0xcee3('0x34')](db[_0xcee3('0x2e')]['rawAttributes']);_0x47159f[_0xcee3('0x37')]=_[_0xcee3('0x34')](_0x42e197[_0xcee3('0x37')]);_0x47159f[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x47159f[_0xcee3('0x32')],_0x47159f[_0xcee3('0x37')]);_0x45df47['attributes']=_[_0xcee3('0x36')](_0x47159f['model'],qs[_0xcee3('0x39')](_0x42e197[_0xcee3('0x37')]['fields']));_0x45df47[_0xcee3('0x38')]=_0x45df47[_0xcee3('0x38')][_0xcee3('0x48')]?_0x45df47[_0xcee3('0x38')]:_0x47159f[_0xcee3('0x32')];if(_0x42e197[_0xcee3('0x37')][_0xcee3('0x43')]){_0x45df47[_0xcee3('0x44')]=[{'all':!![]}];}_0x45df47=_[_0xcee3('0x40')]({},_0x45df47,_0x42e197[_0xcee3('0x49')]);return db['ChatQueueReport'][_0xcee3('0x4a')](_0x45df47)[_0xcee3('0x42')](handleEntityNotFound(_0x41cd61,null))['then'](respondWithResult(_0x41cd61,null))[_0xcee3('0x4b')](handleError(_0x41cd61,null));};exports[_0xcee3('0x4c')]=function(_0x31393e,_0x2726d9){return db[_0xcee3('0x2e')][_0xcee3('0x4c')](_0x31393e[_0xcee3('0x4d')],{})['then'](respondWithResult(_0x2726d9,0xc9))[_0xcee3('0x4b')](handleError(_0x2726d9,null));};exports[_0xcee3('0x27')]=function(_0x20bfc5,_0x27022b){if(_0x20bfc5[_0xcee3('0x4d')]['id']){delete _0x20bfc5[_0xcee3('0x4d')]['id'];}return db['ChatQueueReport'][_0xcee3('0x4a')]({'where':{'id':_0x20bfc5['params']['id']}})[_0xcee3('0x42')](handleEntityNotFound(_0x27022b,null))[_0xcee3('0x42')](saveUpdates(_0x20bfc5[_0xcee3('0x4d')],null))['then'](respondWithResult(_0x27022b,null))['catch'](handleError(_0x27022b,null));};exports[_0xcee3('0x28')]=function(_0x319c25,_0x47c149){return db[_0xcee3('0x2e')]['find']({'where':{'id':_0x319c25[_0xcee3('0x47')]['id']}})[_0xcee3('0x42')](handleEntityNotFound(_0x47c149,null))[_0xcee3('0x42')](removeEntity(_0x47c149,null))[_0xcee3('0x4b')](handleError(_0x47c149,null));};exports['describe']=function(_0x5b1d42,_0x491ca0){return db[_0xcee3('0x2e')][_0xcee3('0x4e')]()[_0xcee3('0x42')](respondWithResult(_0x491ca0,null))['catch'](handleError(_0x491ca0,null));}; \ No newline at end of file +var _0xa7ee=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','ChatQueueReport','fieldName','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x2ece7f,_0x239216){var _0x10fe10=function(_0xd2b37c){while(--_0xd2b37c){_0x2ece7f['push'](_0x2ece7f['shift']());}};_0x10fe10(++_0x239216);}(_0xa7ee,0x159));var _0xea7e=function(_0x597eb2,_0x165f5c){_0x597eb2=_0x597eb2-0x0;var _0x56875f=_0xa7ee[_0x597eb2];return _0x56875f;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require(_0xea7e('0x2'));var rp=require(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea7e('0x5'));var path=require('path');var sox=require(_0xea7e('0x6'));var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require('lodash');var squel=require(_0xea7e('0xa'));var crypto=require(_0xea7e('0xb'));var jsforce=require(_0xea7e('0xc'));var deskjs=require(_0xea7e('0xd'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0xf'));var as=require(_0xea7e('0x10'));var hardwareService=require(_0xea7e('0x11'));var logger=require(_0xea7e('0x12'))('api');var utils=require(_0xea7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea7e('0x14'));var db=require(_0xea7e('0x15'))['db'];function respondWithStatusCode(_0x138555,_0x1d2702){_0x1d2702=_0x1d2702||0xcc;return function(_0x97ec09){if(_0x97ec09){return _0x138555[_0xea7e('0x16')](_0x1d2702);}return _0x138555[_0xea7e('0x17')](_0x1d2702)[_0xea7e('0x18')]();};}function respondWithResult(_0x4c5137,_0x25317c){_0x25317c=_0x25317c||0xc8;return function(_0x3ef916){if(_0x3ef916){return _0x4c5137[_0xea7e('0x17')](_0x25317c)[_0xea7e('0x19')](_0x3ef916);}};}function respondWithFilteredResult(_0x57d27e,_0x18f7f0){return function(_0x4d3796){if(_0x4d3796){var _0x5c7466=typeof _0x18f7f0[_0xea7e('0x1a')]===_0xea7e('0x1b')&&typeof _0x18f7f0[_0xea7e('0x1c')]==='undefined';var _0x5c3b15=_0x4d3796[_0xea7e('0x1d')];var _0x5becf4=_0x5c7466?0x0:_0x18f7f0[_0xea7e('0x1a')];var _0x125aec=_0x5c7466?_0x4d3796['count']:_0x18f7f0['offset']+_0x18f7f0[_0xea7e('0x1c')];var _0x59e8d8;if(_0x125aec>=_0x5c3b15){_0x125aec=_0x5c3b15;_0x59e8d8=0xc8;}else{_0x59e8d8=0xce;}_0x57d27e['status'](_0x59e8d8);return _0x57d27e[_0xea7e('0x1e')]('Content-Range',_0x5becf4+'-'+_0x125aec+'/'+_0x5c3b15)[_0xea7e('0x19')](_0x4d3796);}return null;};}function patchUpdates(_0x1def2a){return function(_0x5c8d42){try{jsonpatch[_0xea7e('0x1f')](_0x5c8d42,_0x1def2a,!![]);}catch(_0x52dfb0){return BPromise[_0xea7e('0x20')](_0x52dfb0);}return _0x5c8d42[_0xea7e('0x21')]();};}function saveUpdates(_0xf779ad,_0xd441f8){return function(_0x372b9d){if(_0x372b9d){return _0x372b9d[_0xea7e('0x22')](_0xf779ad)['then'](function(_0xd41599){return _0xd41599;});}return null;};}function removeEntity(_0x1ddcc7,_0x4e8b96){return function(_0xb8149f){if(_0xb8149f){return _0xb8149f[_0xea7e('0x23')]()[_0xea7e('0x24')](function(){_0x1ddcc7['status'](0xcc)[_0xea7e('0x18')]();});}};}function handleEntityNotFound(_0x400125,_0x41b995){return function(_0x49ce51){if(!_0x49ce51){_0x400125[_0xea7e('0x16')](0x194);}return _0x49ce51;};}function handleError(_0x2a6623,_0x41d40c){_0x41d40c=_0x41d40c||0x1f4;return function(_0x7a75a6){logger[_0xea7e('0x25')](_0x7a75a6[_0xea7e('0x26')]);if(_0x7a75a6[_0xea7e('0x27')]){delete _0x7a75a6[_0xea7e('0x27')];}_0x2a6623[_0xea7e('0x17')](_0x41d40c)[_0xea7e('0x28')](_0x7a75a6);};}exports['index']=function(_0x1744f3,_0xd856de){var _0x4d3c38={},_0x2a1753={},_0x3a9465={'count':0x0,'rows':[]};var _0x1951c0=_[_0xea7e('0x29')](db[_0xea7e('0x2a')]['rawAttributes'],function(_0x38d8a7){return{'name':_0x38d8a7[_0xea7e('0x2b')],'type':_0x38d8a7['type'][_0xea7e('0x2c')]};});_0x2a1753[_0xea7e('0x2d')]=_['map'](_0x1951c0,_0xea7e('0x27'));_0x2a1753['query']=_[_0xea7e('0x2e')](_0x1744f3[_0xea7e('0x2f')]);_0x2a1753[_0xea7e('0x30')]=_[_0xea7e('0x31')](_0x2a1753[_0xea7e('0x2d')],_0x2a1753[_0xea7e('0x2f')]);_0x4d3c38['attributes']=_[_0xea7e('0x31')](_0x2a1753[_0xea7e('0x2d')],qs[_0xea7e('0x32')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x32')]));_0x4d3c38[_0xea7e('0x33')]=_0x4d3c38['attributes']['length']?_0x4d3c38[_0xea7e('0x33')]:_0x2a1753[_0xea7e('0x2d')];if(!_0x1744f3[_0xea7e('0x2f')]['hasOwnProperty'](_0xea7e('0x34'))){_0x4d3c38[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x1c')]);_0x4d3c38[_0xea7e('0x1a')]=qs[_0xea7e('0x1a')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x1a')]);}_0x4d3c38[_0xea7e('0x35')]=qs[_0xea7e('0x36')](_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x36')]);_0x4d3c38[_0xea7e('0x37')]=qs[_0xea7e('0x30')](_['pick'](_0x1744f3[_0xea7e('0x2f')],_0x2a1753[_0xea7e('0x30')]),_0x1951c0);if(_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x38')]){_0x4d3c38['where']=_[_0xea7e('0x39')](_0x4d3c38['where'],{'$or':_[_0xea7e('0x29')](_0x1951c0,function(_0x51ceb2){if(_0x51ceb2[_0xea7e('0x3a')]!==_0xea7e('0x3b')){var _0x468606={};_0x468606[_0x51ceb2[_0xea7e('0x27')]]={'$like':'%'+_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x38')]+'%'};return _0x468606;}})});}_0x4d3c38=_['merge']({},_0x4d3c38,_0x1744f3[_0xea7e('0x3c')]);var _0x369cad={'where':_0x4d3c38['where']};return db[_0xea7e('0x2a')]['count'](_0x369cad)[_0xea7e('0x24')](function(_0x233824){_0x3a9465['count']=_0x233824;if(_0x1744f3[_0xea7e('0x2f')][_0xea7e('0x3d')]){_0x4d3c38[_0xea7e('0x3e')]=[{'all':!![]}];}return db[_0xea7e('0x2a')][_0xea7e('0x3f')](_0x4d3c38);})[_0xea7e('0x24')](function(_0x2db099){_0x3a9465[_0xea7e('0x40')]=_0x2db099;return _0x3a9465;})[_0xea7e('0x24')](respondWithFilteredResult(_0xd856de,_0x4d3c38))[_0xea7e('0x41')](handleError(_0xd856de,null));};exports[_0xea7e('0x42')]=function(_0x40093a,_0x44a501){var _0x18fd0f={'raw':!![],'where':{'id':_0x40093a['params']['id']}},_0x507d92={};_0x507d92['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x507d92[_0xea7e('0x2f')]=_['keys'](_0x40093a[_0xea7e('0x2f')]);_0x507d92[_0xea7e('0x30')]=_['intersection'](_0x507d92['model'],_0x507d92[_0xea7e('0x2f')]);_0x18fd0f[_0xea7e('0x33')]=_[_0xea7e('0x31')](_0x507d92[_0xea7e('0x2d')],qs['fields'](_0x40093a['query'][_0xea7e('0x32')]));_0x18fd0f['attributes']=_0x18fd0f[_0xea7e('0x33')][_0xea7e('0x43')]?_0x18fd0f['attributes']:_0x507d92[_0xea7e('0x2d')];if(_0x40093a[_0xea7e('0x2f')]['includeAll']){_0x18fd0f[_0xea7e('0x3e')]=[{'all':!![]}];}_0x18fd0f=_[_0xea7e('0x39')]({},_0x18fd0f,_0x40093a['options']);return db['ChatQueueReport'][_0xea7e('0x44')](_0x18fd0f)[_0xea7e('0x24')](handleEntityNotFound(_0x44a501,null))['then'](respondWithResult(_0x44a501,null))[_0xea7e('0x41')](handleError(_0x44a501,null));};exports[_0xea7e('0x45')]=function(_0x4dd73b,_0x45901a){return db[_0xea7e('0x2a')][_0xea7e('0x45')](_0x4dd73b[_0xea7e('0x46')],{})[_0xea7e('0x24')](respondWithResult(_0x45901a,0xc9))[_0xea7e('0x41')](handleError(_0x45901a,null));};exports[_0xea7e('0x22')]=function(_0x593d13,_0x351a61){if(_0x593d13[_0xea7e('0x46')]['id']){delete _0x593d13[_0xea7e('0x46')]['id'];}return db[_0xea7e('0x2a')][_0xea7e('0x44')]({'where':{'id':_0x593d13[_0xea7e('0x47')]['id']}})['then'](handleEntityNotFound(_0x351a61,null))[_0xea7e('0x24')](saveUpdates(_0x593d13[_0xea7e('0x46')],null))[_0xea7e('0x24')](respondWithResult(_0x351a61,null))[_0xea7e('0x41')](handleError(_0x351a61,null));};exports[_0xea7e('0x23')]=function(_0x365b39,_0x5318b4){return db[_0xea7e('0x2a')][_0xea7e('0x44')]({'where':{'id':_0x365b39[_0xea7e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5318b4,null))[_0xea7e('0x24')](removeEntity(_0x5318b4,null))[_0xea7e('0x41')](handleError(_0x5318b4,null));};exports['describe']=function(_0x1e9a90,_0x377fb9){return db[_0xea7e('0x2a')][_0xea7e('0x48')]()[_0xea7e('0x24')](respondWithResult(_0x377fb9,null))[_0xea7e('0x41')](handleError(_0x377fb9,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 4f0e84f..43c6ef6 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5b5047,_0x228694){var _0x11680e=function(_0x406801){while(--_0x406801){_0x5b5047['push'](_0x5b5047['shift']());}};_0x11680e(++_0x228694);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb7e7[_0x1f9f37];return _0x21c080;};'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'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x54f2a7,_0x242b0f){var _0x51234e=function(_0x44ad0b){while(--_0x44ad0b){_0x54f2a7['push'](_0x54f2a7['shift']());}};_0x51234e(++_0x242b0f);}(_0x757a,0xde));var _0xa757=function(_0x519cbb,_0x482372){_0x519cbb=_0x519cbb-0x0;var _0x45f192=_0x757a[_0x519cbb];return _0x45f192;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 7e088a3..93eec8a 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 _0xb235=['request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','UpdateChatQueueReport','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb235,0xb5));var _0x5b23=function(_0x30af23,_0x1b9d6a){_0x30af23=_0x30af23-0x0;var _0x5cea96=_0xb235[_0x30af23];return _0x5cea96;};'use strict';var _=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var moment=require('moment');var BPromise=require(_0x5b23('0x2'));var rs=require(_0x5b23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b23('0x4'))['db'];var utils=require(_0x5b23('0x5'));var logger=require(_0x5b23('0x6'))('rpc');var config=require(_0x5b23('0x7'));var jayson=require(_0x5b23('0x8'));var client=jayson[_0x5b23('0x9')][_0x5b23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d94a4,_0x5e390,_0x5ce7c4){return new BPromise(function(_0xe27265,_0x37e7ce){return client[_0x5b23('0xb')](_0x1d94a4,_0x5ce7c4)['then'](function(_0x5af4e2){logger[_0x5b23('0xc')](_0x5b23('0xd'),_0x5e390,_0x5b23('0xe'));logger['debug'](_0x5b23('0xf'),_0x5e390,'request\x20sent',JSON[_0x5b23('0x10')](_0x5af4e2));if(_0x5af4e2[_0x5b23('0x11')]){if(_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x12')]===0x1f4){logger[_0x5b23('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x5e390,_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x13')]);return _0x37e7ce(_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x13')]);}logger[_0x5b23('0x11')](_0x5b23('0xd'),_0x5e390,_0x5af4e2[_0x5b23('0x11')]['message']);return _0xe27265(_0x5af4e2[_0x5b23('0x11')][_0x5b23('0x13')]);}else{logger['info'](_0x5b23('0xd'),_0x5e390,_0x5b23('0xe'));_0xe27265(_0x5af4e2['result']['message']);}})[_0x5b23('0x14')](function(_0x515f56){logger[_0x5b23('0x11')](_0x5b23('0xd'),_0x5e390,_0x515f56);_0x37e7ce(_0x515f56);});});}exports[_0x5b23('0x15')]=function(_0x29dfbc){var _0x4e6bc1=this;return new Promise(function(_0x5b754a,_0x447990){return db[_0x5b23('0x16')][_0x5b23('0x17')](_0x29dfbc[_0x5b23('0x18')],{'raw':_0x29dfbc[_0x5b23('0x19')]?_0x29dfbc[_0x5b23('0x19')][_0x5b23('0x1a')]===undefined?!![]:![]:!![]})[_0x5b23('0x1b')](function(_0x2eff29){logger[_0x5b23('0xc')]('CreateChatQueueReport',_0x29dfbc);logger[_0x5b23('0x1c')]('CreateChatQueueReport',_0x29dfbc,JSON['stringify'](_0x2eff29));_0x5b754a(_0x2eff29);})[_0x5b23('0x14')](function(_0x9c86ba){logger[_0x5b23('0x11')](_0x5b23('0x15'),_0x9c86ba[_0x5b23('0x13')],_0x29dfbc);_0x447990(_0x4e6bc1[_0x5b23('0x11')](0x1f4,_0x9c86ba[_0x5b23('0x13')]));});});};exports[_0x5b23('0x1d')]=function(_0x48b9dd){var _0x1e4f37=this;return new Promise(function(_0x4303ee,_0x241865){return db['ChatQueueReport']['update'](_0x48b9dd[_0x5b23('0x18')],{'raw':_0x48b9dd['options']?_0x48b9dd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48b9dd['options']?_0x48b9dd['options'][_0x5b23('0x1e')]||null:null,'attributes':_0x48b9dd[_0x5b23('0x19')]?_0x48b9dd[_0x5b23('0x19')][_0x5b23('0x1f')]||null:null,'limit':_0x48b9dd['options']?_0x48b9dd[_0x5b23('0x19')]['limit']||null:null})[_0x5b23('0x1b')](function(_0x1896c6){logger['info'](_0x5b23('0x1d'),_0x48b9dd);logger[_0x5b23('0x1c')](_0x5b23('0x1d'),_0x48b9dd,JSON['stringify'](_0x1896c6));_0x4303ee(_0x1896c6);})[_0x5b23('0x14')](function(_0xc6b184){logger[_0x5b23('0x11')](_0x5b23('0x1d'),_0xc6b184['message'],_0x48b9dd);_0x241865(_0x1e4f37[_0x5b23('0x11')](0x1f4,_0xc6b184[_0x5b23('0x13')]));});});}; \ No newline at end of file +var _0x18ec=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','ChatQueueReport,\x20%s,\x20%s','message','error','result','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','catch','UpdateChatQueueReport','update','where','attributes','limit'];(function(_0x123626,_0x5835fb){var _0x6146e7=function(_0x43f8bb){while(--_0x43f8bb){_0x123626['push'](_0x123626['shift']());}};_0x6146e7(++_0x5835fb);}(_0x18ec,0x6c));var _0xc18e=function(_0x495995,_0x2d2328){_0x495995=_0x495995-0x0;var _0x522d91=_0x18ec[_0x495995];return _0x522d91;};'use strict';var _=require(_0xc18e('0x0'));var util=require(_0xc18e('0x1'));var moment=require(_0xc18e('0x2'));var BPromise=require(_0xc18e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc18e('0x4'));var db=require(_0xc18e('0x5'))['db'];var utils=require(_0xc18e('0x6'));var logger=require(_0xc18e('0x7'))('rpc');var config=require(_0xc18e('0x8'));var jayson=require(_0xc18e('0x9'));var client=jayson[_0xc18e('0xa')][_0xc18e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43a65a,_0x59cd9f,_0xbec8ad){return new BPromise(function(_0x34342f,_0x21fd26){return client[_0xc18e('0xc')](_0x43a65a,_0xbec8ad)[_0xc18e('0xd')](function(_0x5abe8e){logger[_0xc18e('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x59cd9f,_0xc18e('0xf'));logger[_0xc18e('0x10')](_0xc18e('0x11'),_0x59cd9f,_0xc18e('0xf'),JSON[_0xc18e('0x12')](_0x5abe8e));if(_0x5abe8e['error']){if(_0x5abe8e['error'][_0xc18e('0x13')]===0x1f4){logger['error'](_0xc18e('0x14'),_0x59cd9f,_0x5abe8e['error'][_0xc18e('0x15')]);return _0x21fd26(_0x5abe8e[_0xc18e('0x16')]['message']);}logger[_0xc18e('0x16')](_0xc18e('0x14'),_0x59cd9f,_0x5abe8e[_0xc18e('0x16')]['message']);return _0x34342f(_0x5abe8e['error']['message']);}else{logger[_0xc18e('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x59cd9f,_0xc18e('0xf'));_0x34342f(_0x5abe8e[_0xc18e('0x17')][_0xc18e('0x15')]);}})['catch'](function(_0x56eba9){logger['error'](_0xc18e('0x14'),_0x59cd9f,_0x56eba9);_0x21fd26(_0x56eba9);});});}exports['CreateChatQueueReport']=function(_0x5365f2){var _0x2d7935=this;return new Promise(function(_0x1807e9,_0x48b763){return db[_0xc18e('0x18')][_0xc18e('0x19')](_0x5365f2[_0xc18e('0x1a')],{'raw':_0x5365f2[_0xc18e('0x1b')]?_0x5365f2[_0xc18e('0x1b')][_0xc18e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2a681c){logger[_0xc18e('0xe')]('CreateChatQueueReport',_0x5365f2);logger[_0xc18e('0x10')](_0xc18e('0x1d'),_0x5365f2,JSON[_0xc18e('0x12')](_0x2a681c));_0x1807e9(_0x2a681c);})[_0xc18e('0x1e')](function(_0x22b9a5){logger[_0xc18e('0x16')](_0xc18e('0x1d'),_0x22b9a5[_0xc18e('0x15')],_0x5365f2);_0x48b763(_0x2d7935[_0xc18e('0x16')](0x1f4,_0x22b9a5['message']));});});};exports[_0xc18e('0x1f')]=function(_0x49a070){var _0x40fd0e=this;return new Promise(function(_0x16f9cf,_0x5d2a18){return db[_0xc18e('0x18')][_0xc18e('0x20')](_0x49a070['body'],{'raw':_0x49a070[_0xc18e('0x1b')]?_0x49a070[_0xc18e('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49a070['options']?_0x49a070[_0xc18e('0x1b')][_0xc18e('0x21')]||null:null,'attributes':_0x49a070[_0xc18e('0x1b')]?_0x49a070[_0xc18e('0x1b')][_0xc18e('0x22')]||null:null,'limit':_0x49a070[_0xc18e('0x1b')]?_0x49a070['options'][_0xc18e('0x23')]||null:null})[_0xc18e('0xd')](function(_0x153675){logger[_0xc18e('0xe')]('UpdateChatQueueReport',_0x49a070);logger[_0xc18e('0x10')]('UpdateChatQueueReport',_0x49a070,JSON[_0xc18e('0x12')](_0x153675));_0x16f9cf(_0x153675);})[_0xc18e('0x1e')](function(_0x3a889b){logger[_0xc18e('0x16')]('UpdateChatQueueReport',_0x3a889b[_0xc18e('0x15')],_0x49a070);_0x5d2a18(_0x40fd0e[_0xc18e('0x16')](0x1f4,_0x3a889b['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index f7e5841..9bb3af8 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 _0x910e=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','isAuthenticated','/:id','show'];(function(_0x1c962e,_0xcfb220){var _0x2ecb50=function(_0x322ba4){while(--_0x322ba4){_0x1c962e['push'](_0x1c962e['shift']());}};_0x2ecb50(++_0xcfb220);}(_0x910e,0x196));var _0xe910=function(_0x1f6179,_0x60f4ce){_0x1f6179=_0x1f6179-0x0;var _0x5156e9=_0x910e[_0x1f6179];return _0x5156e9;};'use strict';var multer=require(_0xe910('0x0'));var util=require(_0xe910('0x1'));var path=require('path');var timeout=require(_0xe910('0x2'));var express=require('express');var router=express[_0xe910('0x3')]();var fs_extra=require(_0xe910('0x4'));var auth=require(_0xe910('0x5'));var interaction=require(_0xe910('0x6'));var config=require(_0xe910('0x7'));var controller=require(_0xe910('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe910('0x9')]);router[_0xe910('0xa')]('/describe',auth[_0xe910('0xb')](),controller['describe']);router[_0xe910('0xa')](_0xe910('0xc'),auth[_0xe910('0xb')](),controller[_0xe910('0xd')]);router[_0xe910('0xe')]('/',auth[_0xe910('0xb')](),controller[_0xe910('0xf')]);router[_0xe910('0x10')](_0xe910('0xc'),auth[_0xe910('0xb')](),controller[_0xe910('0x11')]);router[_0xe910('0x12')]('/:id',auth[_0xe910('0xb')](),controller[_0xe910('0x13')]);module[_0xe910('0x14')]=router; \ No newline at end of file +var _0x79d8=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./chatQueueReport.controller','index','isAuthenticated','describe','get'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x79d8,0x1d5));var _0x879d=function(_0x190a7c,_0x1d44e6){_0x190a7c=_0x190a7c-0x0;var _0x167ae2=_0x79d8[_0x190a7c];return _0x167ae2;};'use strict';var multer=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var path=require(_0x879d('0x2'));var timeout=require(_0x879d('0x3'));var express=require('express');var router=express[_0x879d('0x4')]();var fs_extra=require(_0x879d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x879d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x879d('0x7')]);router['get']('/describe',auth[_0x879d('0x8')](),controller[_0x879d('0x9')]);router[_0x879d('0xa')](_0x879d('0xb'),auth[_0x879d('0x8')](),controller[_0x879d('0xc')]);router[_0x879d('0xd')]('/',auth[_0x879d('0x8')](),controller[_0x879d('0xe')]);router[_0x879d('0xf')](_0x879d('0xb'),auth[_0x879d('0x8')](),controller[_0x879d('0x10')]);router[_0x879d('0x11')]('/:id',auth[_0x879d('0x8')](),controller[_0x879d('0x12')]);module[_0x879d('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d2bbc00..aff75c7 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5ec932,_0x1262b0){var _0x4ce07f=function(_0x329171){while(--_0x329171){_0x5ec932['push'](_0x5ec932['shift']());}};_0x4ce07f(++_0x1262b0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5720cd,_0x24af37){_0x5720cd=_0x5720cd-0x0;var _0xc5e801=_0xf4eb[_0x5720cd];return _0xc5e801;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2dce20,_0x2e23d3){var _0x523a13=function(_0x45f754){while(--_0x45f754){_0x2dce20['push'](_0x2dce20['shift']());}};_0x523a13(++_0x2e23d3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x23de45,_0x2311b3){_0x23de45=_0x23de45-0x0;var _0x4a27cf=_0xf4eb[_0x23de45];return _0x4a27cf;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 4ab677a..fa091c3 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 _0xb70e=['../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','ChatTransferReport','findAll','rows','catch','show','params','length','include','options','find','create','update','body','describe','zip-dir','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x521a46,_0x4d00de){var _0x901ea=function(_0x33eb75){while(--_0x33eb75){_0x521a46['push'](_0x521a46['shift']());}};_0x901ea(++_0x4d00de);}(_0xb70e,0x1a6));var _0xeb70=function(_0x5f30c3,_0x531cd8){_0x5f30c3=_0x5f30c3-0x0;var _0x35a5a1=_0xb70e[_0x5f30c3];return _0x35a5a1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb70('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb70('0x1'));var moment=require('moment');var BPromise=require(_0xeb70('0x2'));var Mustache=require(_0xeb70('0x3'));var util=require('util');var path=require(_0xeb70('0x4'));var sox=require('sox');var csv=require(_0xeb70('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb70('0x6'));var _=require(_0xeb70('0x7'));var squel=require(_0xeb70('0x8'));var crypto=require(_0xeb70('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xeb70('0xa'));var toCsv=require(_0xeb70('0x5'));var querystring=require(_0xeb70('0xb'));var Papa=require(_0xeb70('0xc'));var Redis=require(_0xeb70('0xd'));var authService=require(_0xeb70('0xe'));var qs=require(_0xeb70('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb70('0x10'));var logger=require('../../config/logger')(_0xeb70('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb70('0x12'));var db=require(_0xeb70('0x13'))['db'];function respondWithStatusCode(_0x3105bf,_0x407917){_0x407917=_0x407917||0xcc;return function(_0x43bc4c){if(_0x43bc4c){return _0x3105bf[_0xeb70('0x14')](_0x407917);}return _0x3105bf[_0xeb70('0x15')](_0x407917)[_0xeb70('0x16')]();};}function respondWithResult(_0x3dcb8c,_0xa167b5){_0xa167b5=_0xa167b5||0xc8;return function(_0x1bc67b){if(_0x1bc67b){return _0x3dcb8c[_0xeb70('0x15')](_0xa167b5)[_0xeb70('0x17')](_0x1bc67b);}};}function respondWithFilteredResult(_0x31fc9d,_0x340ba4){return function(_0xfedce9){if(_0xfedce9){var _0x2e154f=typeof _0x340ba4['offset']===_0xeb70('0x18')&&typeof _0x340ba4[_0xeb70('0x19')]===_0xeb70('0x18');var _0x379fab=_0xfedce9[_0xeb70('0x1a')];var _0x560d1f=_0x2e154f?0x0:_0x340ba4[_0xeb70('0x1b')];var _0x113da8=_0x2e154f?_0xfedce9[_0xeb70('0x1a')]:_0x340ba4['offset']+_0x340ba4[_0xeb70('0x19')];var _0x358d0b;if(_0x113da8>=_0x379fab){_0x113da8=_0x379fab;_0x358d0b=0xc8;}else{_0x358d0b=0xce;}_0x31fc9d[_0xeb70('0x15')](_0x358d0b);return _0x31fc9d[_0xeb70('0x1c')](_0xeb70('0x1d'),_0x560d1f+'-'+_0x113da8+'/'+_0x379fab)[_0xeb70('0x17')](_0xfedce9);}return null;};}function patchUpdates(_0x4424ac){return function(_0x14583a){try{jsonpatch[_0xeb70('0x1e')](_0x14583a,_0x4424ac,!![]);}catch(_0x180193){return BPromise[_0xeb70('0x1f')](_0x180193);}return _0x14583a[_0xeb70('0x20')]();};}function saveUpdates(_0x17fc72,_0x527320){return function(_0x4bceb5){if(_0x4bceb5){return _0x4bceb5['update'](_0x17fc72)[_0xeb70('0x21')](function(_0x3df46f){return _0x3df46f;});}return null;};}function removeEntity(_0xcea15a,_0x448d93){return function(_0x5ac5ea){if(_0x5ac5ea){return _0x5ac5ea[_0xeb70('0x22')]()['then'](function(){_0xcea15a['status'](0xcc)[_0xeb70('0x16')]();});}};}function handleEntityNotFound(_0x31b709,_0x500851){return function(_0x5b4283){if(!_0x5b4283){_0x31b709[_0xeb70('0x14')](0x194);}return _0x5b4283;};}function handleError(_0x489222,_0x6db78e){_0x6db78e=_0x6db78e||0x1f4;return function(_0x4004a3){logger[_0xeb70('0x23')](_0x4004a3[_0xeb70('0x24')]);if(_0x4004a3[_0xeb70('0x25')]){delete _0x4004a3[_0xeb70('0x25')];}_0x489222[_0xeb70('0x15')](_0x6db78e)[_0xeb70('0x26')](_0x4004a3);};}exports[_0xeb70('0x27')]=function(_0x410f1d,_0x4df6a3){var _0x3d2b1f={},_0x15973f={},_0x222fd4={'count':0x0,'rows':[]};var _0x449ea3=_[_0xeb70('0x28')](db['ChatTransferReport'][_0xeb70('0x29')],function(_0x396881){return{'name':_0x396881['fieldName'],'type':_0x396881[_0xeb70('0x2a')][_0xeb70('0x2b')]};});_0x15973f[_0xeb70('0x2c')]=_[_0xeb70('0x28')](_0x449ea3,_0xeb70('0x25'));_0x15973f[_0xeb70('0x2d')]=_[_0xeb70('0x2e')](_0x410f1d[_0xeb70('0x2d')]);_0x15973f[_0xeb70('0x2f')]=_[_0xeb70('0x30')](_0x15973f[_0xeb70('0x2c')],_0x15973f[_0xeb70('0x2d')]);_0x3d2b1f[_0xeb70('0x31')]=_[_0xeb70('0x30')](_0x15973f['model'],qs[_0xeb70('0x32')](_0x410f1d[_0xeb70('0x2d')][_0xeb70('0x32')]));_0x3d2b1f['attributes']=_0x3d2b1f[_0xeb70('0x31')]['length']?_0x3d2b1f[_0xeb70('0x31')]:_0x15973f[_0xeb70('0x2c')];if(!_0x410f1d[_0xeb70('0x2d')][_0xeb70('0x33')]('nolimit')){_0x3d2b1f[_0xeb70('0x19')]=qs[_0xeb70('0x19')](_0x410f1d[_0xeb70('0x2d')][_0xeb70('0x19')]);_0x3d2b1f['offset']=qs['offset'](_0x410f1d[_0xeb70('0x2d')][_0xeb70('0x1b')]);}_0x3d2b1f['order']=qs[_0xeb70('0x34')](_0x410f1d['query'][_0xeb70('0x34')]);_0x3d2b1f[_0xeb70('0x35')]=qs[_0xeb70('0x2f')](_[_0xeb70('0x36')](_0x410f1d[_0xeb70('0x2d')],_0x15973f[_0xeb70('0x2f')]),_0x449ea3);if(_0x410f1d[_0xeb70('0x2d')][_0xeb70('0x37')]){_0x3d2b1f[_0xeb70('0x35')]=_[_0xeb70('0x38')](_0x3d2b1f[_0xeb70('0x35')],{'$or':_['map'](_0x449ea3,function(_0x5d8900){if(_0x5d8900[_0xeb70('0x2a')]!==_0xeb70('0x39')){var _0x568477={};_0x568477[_0x5d8900[_0xeb70('0x25')]]={'$like':'%'+_0x410f1d[_0xeb70('0x2d')][_0xeb70('0x37')]+'%'};return _0x568477;}})});}_0x3d2b1f=_[_0xeb70('0x38')]({},_0x3d2b1f,_0x410f1d['options']);var _0x5d15e9={'where':_0x3d2b1f[_0xeb70('0x35')]};return db['ChatTransferReport']['count'](_0x5d15e9)[_0xeb70('0x21')](function(_0x5e5e3a){_0x222fd4[_0xeb70('0x1a')]=_0x5e5e3a;if(_0x410f1d[_0xeb70('0x2d')][_0xeb70('0x3a')]){_0x3d2b1f['include']=[{'all':!![]}];}return db[_0xeb70('0x3b')][_0xeb70('0x3c')](_0x3d2b1f);})['then'](function(_0x588a81){_0x222fd4[_0xeb70('0x3d')]=_0x588a81;return _0x222fd4;})[_0xeb70('0x21')](respondWithFilteredResult(_0x4df6a3,_0x3d2b1f))[_0xeb70('0x3e')](handleError(_0x4df6a3,null));};exports[_0xeb70('0x3f')]=function(_0x50d326,_0x1a77e0){var _0x349048={'raw':!![],'where':{'id':_0x50d326[_0xeb70('0x40')]['id']}},_0x1bed51={};_0x1bed51[_0xeb70('0x2c')]=_[_0xeb70('0x2e')](db['ChatTransferReport'][_0xeb70('0x29')]);_0x1bed51['query']=_[_0xeb70('0x2e')](_0x50d326[_0xeb70('0x2d')]);_0x1bed51[_0xeb70('0x2f')]=_[_0xeb70('0x30')](_0x1bed51['model'],_0x1bed51[_0xeb70('0x2d')]);_0x349048['attributes']=_[_0xeb70('0x30')](_0x1bed51['model'],qs[_0xeb70('0x32')](_0x50d326[_0xeb70('0x2d')][_0xeb70('0x32')]));_0x349048['attributes']=_0x349048[_0xeb70('0x31')][_0xeb70('0x41')]?_0x349048[_0xeb70('0x31')]:_0x1bed51['model'];if(_0x50d326[_0xeb70('0x2d')][_0xeb70('0x3a')]){_0x349048[_0xeb70('0x42')]=[{'all':!![]}];}_0x349048=_['merge']({},_0x349048,_0x50d326[_0xeb70('0x43')]);return db[_0xeb70('0x3b')][_0xeb70('0x44')](_0x349048)[_0xeb70('0x21')](handleEntityNotFound(_0x1a77e0,null))[_0xeb70('0x21')](respondWithResult(_0x1a77e0,null))[_0xeb70('0x3e')](handleError(_0x1a77e0,null));};exports[_0xeb70('0x45')]=function(_0x4820b6,_0x3280f6){return db[_0xeb70('0x3b')]['create'](_0x4820b6['body'],{})[_0xeb70('0x21')](respondWithResult(_0x3280f6,0xc9))[_0xeb70('0x3e')](handleError(_0x3280f6,null));};exports[_0xeb70('0x46')]=function(_0x5c9db7,_0x390935){if(_0x5c9db7[_0xeb70('0x47')]['id']){delete _0x5c9db7[_0xeb70('0x47')]['id'];}return db[_0xeb70('0x3b')]['find']({'where':{'id':_0x5c9db7[_0xeb70('0x40')]['id']}})[_0xeb70('0x21')](handleEntityNotFound(_0x390935,null))[_0xeb70('0x21')](saveUpdates(_0x5c9db7[_0xeb70('0x47')],null))['then'](respondWithResult(_0x390935,null))[_0xeb70('0x3e')](handleError(_0x390935,null));};exports[_0xeb70('0x22')]=function(_0x58eb15,_0x5c2fa1){return db[_0xeb70('0x3b')][_0xeb70('0x44')]({'where':{'id':_0x58eb15['params']['id']}})['then'](handleEntityNotFound(_0x5c2fa1,null))[_0xeb70('0x21')](removeEntity(_0x5c2fa1,null))[_0xeb70('0x3e')](handleError(_0x5c2fa1,null));};exports[_0xeb70('0x48')]=function(_0x234861,_0x377702){return db[_0xeb70('0x3b')][_0xeb70('0x48')]()[_0xeb70('0x21')](respondWithResult(_0x377702,null))[_0xeb70('0x3e')](handleError(_0x377702,null));}; \ No newline at end of file +var _0xd364=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','ChatTransferReport','rawAttributes','fieldName','type','key','map','keys','filters','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','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','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3c7a98,_0x4f3fc7){var _0x1d44b1=function(_0x1bafeb){while(--_0x1bafeb){_0x3c7a98['push'](_0x3c7a98['shift']());}};_0x1d44b1(++_0x4f3fc7);}(_0xd364,0x1da));var _0x4d36=function(_0x249db1,_0x272b32){_0x249db1=_0x249db1-0x0;var _0x1799c9=_0xd364[_0x249db1];return _0x1799c9;};'use strict';var emlformat=require(_0x4d36('0x0'));var rimraf=require(_0x4d36('0x1'));var zipdir=require(_0x4d36('0x2'));var jsonpatch=require(_0x4d36('0x3'));var rp=require(_0x4d36('0x4'));var moment=require(_0x4d36('0x5'));var BPromise=require(_0x4d36('0x6'));var Mustache=require(_0x4d36('0x7'));var util=require(_0x4d36('0x8'));var path=require(_0x4d36('0x9'));var sox=require(_0x4d36('0xa'));var csv=require(_0x4d36('0xb'));var ejs=require(_0x4d36('0xc'));var fs=require('fs');var fs_extra=require(_0x4d36('0xd'));var _=require(_0x4d36('0xe'));var squel=require('squel');var crypto=require(_0x4d36('0xf'));var jsforce=require(_0x4d36('0x10'));var deskjs=require(_0x4d36('0x11'));var toCsv=require(_0x4d36('0xb'));var querystring=require(_0x4d36('0x12'));var Papa=require(_0x4d36('0x13'));var Redis=require(_0x4d36('0x14'));var authService=require(_0x4d36('0x15'));var qs=require(_0x4d36('0x16'));var as=require(_0x4d36('0x17'));var hardwareService=require(_0x4d36('0x18'));var logger=require(_0x4d36('0x19'))(_0x4d36('0x1a'));var utils=require(_0x4d36('0x1b'));var config=require(_0x4d36('0x1c'));var licenseUtil=require(_0x4d36('0x1d'));var db=require(_0x4d36('0x1e'))['db'];function respondWithStatusCode(_0x63718,_0x32ba13){_0x32ba13=_0x32ba13||0xcc;return function(_0x168255){if(_0x168255){return _0x63718[_0x4d36('0x1f')](_0x32ba13);}return _0x63718[_0x4d36('0x20')](_0x32ba13)[_0x4d36('0x21')]();};}function respondWithResult(_0x1302a2,_0x4f50ba){_0x4f50ba=_0x4f50ba||0xc8;return function(_0x582a90){if(_0x582a90){return _0x1302a2['status'](_0x4f50ba)[_0x4d36('0x22')](_0x582a90);}};}function respondWithFilteredResult(_0x3698b1,_0x232184){return function(_0x6ef265){if(_0x6ef265){var _0xae5a35=typeof _0x232184[_0x4d36('0x23')]===_0x4d36('0x24')&&typeof _0x232184[_0x4d36('0x25')]==='undefined';var _0x1f6dab=_0x6ef265[_0x4d36('0x26')];var _0x3a78db=_0xae5a35?0x0:_0x232184[_0x4d36('0x23')];var _0xcf7ddd=_0xae5a35?_0x6ef265['count']:_0x232184[_0x4d36('0x23')]+_0x232184[_0x4d36('0x25')];var _0x401a05;if(_0xcf7ddd>=_0x1f6dab){_0xcf7ddd=_0x1f6dab;_0x401a05=0xc8;}else{_0x401a05=0xce;}_0x3698b1[_0x4d36('0x20')](_0x401a05);return _0x3698b1[_0x4d36('0x27')](_0x4d36('0x28'),_0x3a78db+'-'+_0xcf7ddd+'/'+_0x1f6dab)[_0x4d36('0x22')](_0x6ef265);}return null;};}function patchUpdates(_0x57c9d6){return function(_0x559649){try{jsonpatch[_0x4d36('0x29')](_0x559649,_0x57c9d6,!![]);}catch(_0x7dfba2){return BPromise[_0x4d36('0x2a')](_0x7dfba2);}return _0x559649[_0x4d36('0x2b')]();};}function saveUpdates(_0x29f337,_0x300dba){return function(_0x36e496){if(_0x36e496){return _0x36e496[_0x4d36('0x2c')](_0x29f337)['then'](function(_0x2b4b3d){return _0x2b4b3d;});}return null;};}function removeEntity(_0x5b6615,_0x48fd4a){return function(_0x514f43){if(_0x514f43){return _0x514f43[_0x4d36('0x2d')]()[_0x4d36('0x2e')](function(){_0x5b6615['status'](0xcc)[_0x4d36('0x21')]();});}};}function handleEntityNotFound(_0x1be154,_0x5168d2){return function(_0x355a3f){if(!_0x355a3f){_0x1be154['sendStatus'](0x194);}return _0x355a3f;};}function handleError(_0x46352e,_0x45d66c){_0x45d66c=_0x45d66c||0x1f4;return function(_0x57d0b5){logger[_0x4d36('0x2f')](_0x57d0b5['stack']);if(_0x57d0b5[_0x4d36('0x30')]){delete _0x57d0b5[_0x4d36('0x30')];}_0x46352e[_0x4d36('0x20')](_0x45d66c)['send'](_0x57d0b5);};}exports['index']=function(_0x2205a9,_0x1fabe5){var _0x41ba34={},_0x3713cb={},_0x504a8b={'count':0x0,'rows':[]};var _0x202a75=_['map'](db[_0x4d36('0x31')][_0x4d36('0x32')],function(_0x973bbb){return{'name':_0x973bbb[_0x4d36('0x33')],'type':_0x973bbb[_0x4d36('0x34')][_0x4d36('0x35')]};});_0x3713cb['model']=_[_0x4d36('0x36')](_0x202a75,_0x4d36('0x30'));_0x3713cb['query']=_[_0x4d36('0x37')](_0x2205a9['query']);_0x3713cb[_0x4d36('0x38')]=_['intersection'](_0x3713cb['model'],_0x3713cb[_0x4d36('0x39')]);_0x41ba34[_0x4d36('0x3a')]=_[_0x4d36('0x3b')](_0x3713cb[_0x4d36('0x3c')],qs[_0x4d36('0x3d')](_0x2205a9[_0x4d36('0x39')][_0x4d36('0x3d')]));_0x41ba34[_0x4d36('0x3a')]=_0x41ba34[_0x4d36('0x3a')][_0x4d36('0x3e')]?_0x41ba34[_0x4d36('0x3a')]:_0x3713cb[_0x4d36('0x3c')];if(!_0x2205a9['query'][_0x4d36('0x3f')](_0x4d36('0x40'))){_0x41ba34[_0x4d36('0x25')]=qs['limit'](_0x2205a9[_0x4d36('0x39')][_0x4d36('0x25')]);_0x41ba34[_0x4d36('0x23')]=qs['offset'](_0x2205a9[_0x4d36('0x39')][_0x4d36('0x23')]);}_0x41ba34[_0x4d36('0x41')]=qs[_0x4d36('0x42')](_0x2205a9['query'][_0x4d36('0x42')]);_0x41ba34[_0x4d36('0x43')]=qs[_0x4d36('0x38')](_[_0x4d36('0x44')](_0x2205a9['query'],_0x3713cb['filters']),_0x202a75);if(_0x2205a9[_0x4d36('0x39')][_0x4d36('0x45')]){_0x41ba34['where']=_[_0x4d36('0x46')](_0x41ba34[_0x4d36('0x43')],{'$or':_['map'](_0x202a75,function(_0x334c1d){if(_0x334c1d[_0x4d36('0x34')]!==_0x4d36('0x47')){var _0x1b9b93={};_0x1b9b93[_0x334c1d['name']]={'$like':'%'+_0x2205a9[_0x4d36('0x39')][_0x4d36('0x45')]+'%'};return _0x1b9b93;}})});}_0x41ba34=_[_0x4d36('0x46')]({},_0x41ba34,_0x2205a9[_0x4d36('0x48')]);var _0x24b003={'where':_0x41ba34[_0x4d36('0x43')]};return db[_0x4d36('0x31')][_0x4d36('0x26')](_0x24b003)['then'](function(_0x5a6a74){_0x504a8b['count']=_0x5a6a74;if(_0x2205a9[_0x4d36('0x39')]['includeAll']){_0x41ba34[_0x4d36('0x49')]=[{'all':!![]}];}return db[_0x4d36('0x31')][_0x4d36('0x4a')](_0x41ba34);})[_0x4d36('0x2e')](function(_0x39296e){_0x504a8b[_0x4d36('0x4b')]=_0x39296e;return _0x504a8b;})[_0x4d36('0x2e')](respondWithFilteredResult(_0x1fabe5,_0x41ba34))[_0x4d36('0x4c')](handleError(_0x1fabe5,null));};exports['show']=function(_0x4e2097,_0x3cac79){var _0x1c393b={'raw':!![],'where':{'id':_0x4e2097[_0x4d36('0x4d')]['id']}},_0x5ea3ba={};_0x5ea3ba[_0x4d36('0x3c')]=_[_0x4d36('0x37')](db[_0x4d36('0x31')][_0x4d36('0x32')]);_0x5ea3ba[_0x4d36('0x39')]=_[_0x4d36('0x37')](_0x4e2097[_0x4d36('0x39')]);_0x5ea3ba[_0x4d36('0x38')]=_[_0x4d36('0x3b')](_0x5ea3ba[_0x4d36('0x3c')],_0x5ea3ba[_0x4d36('0x39')]);_0x1c393b[_0x4d36('0x3a')]=_[_0x4d36('0x3b')](_0x5ea3ba[_0x4d36('0x3c')],qs[_0x4d36('0x3d')](_0x4e2097['query']['fields']));_0x1c393b[_0x4d36('0x3a')]=_0x1c393b['attributes']['length']?_0x1c393b[_0x4d36('0x3a')]:_0x5ea3ba[_0x4d36('0x3c')];if(_0x4e2097[_0x4d36('0x39')][_0x4d36('0x4e')]){_0x1c393b[_0x4d36('0x49')]=[{'all':!![]}];}_0x1c393b=_['merge']({},_0x1c393b,_0x4e2097[_0x4d36('0x48')]);return db[_0x4d36('0x31')][_0x4d36('0x4f')](_0x1c393b)[_0x4d36('0x2e')](handleEntityNotFound(_0x3cac79,null))[_0x4d36('0x2e')](respondWithResult(_0x3cac79,null))[_0x4d36('0x4c')](handleError(_0x3cac79,null));};exports[_0x4d36('0x50')]=function(_0x4827a9,_0x18f6ce){return db[_0x4d36('0x31')][_0x4d36('0x50')](_0x4827a9[_0x4d36('0x51')],{})[_0x4d36('0x2e')](respondWithResult(_0x18f6ce,0xc9))['catch'](handleError(_0x18f6ce,null));};exports[_0x4d36('0x2c')]=function(_0xb71df9,_0x240222){if(_0xb71df9[_0x4d36('0x51')]['id']){delete _0xb71df9['body']['id'];}return db[_0x4d36('0x31')][_0x4d36('0x4f')]({'where':{'id':_0xb71df9['params']['id']}})[_0x4d36('0x2e')](handleEntityNotFound(_0x240222,null))[_0x4d36('0x2e')](saveUpdates(_0xb71df9['body'],null))['then'](respondWithResult(_0x240222,null))['catch'](handleError(_0x240222,null));};exports[_0x4d36('0x2d')]=function(_0x16e5e3,_0x56e4bf){return db[_0x4d36('0x31')][_0x4d36('0x4f')]({'where':{'id':_0x16e5e3['params']['id']}})[_0x4d36('0x2e')](handleEntityNotFound(_0x56e4bf,null))[_0x4d36('0x2e')](removeEntity(_0x56e4bf,null))[_0x4d36('0x4c')](handleError(_0x56e4bf,null));};exports[_0x4d36('0x52')]=function(_0x5f43ec,_0x162ab4){return db[_0x4d36('0x31')]['describe']()['then'](respondWithResult(_0x162ab4,null))[_0x4d36('0x4c')](handleError(_0x162ab4,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index b6856e5..3716007 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 _0xc9fa=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid'];(function(_0x1fbaa4,_0x456743){var _0x8c25c1=function(_0x4bb73d){while(--_0x4bb73d){_0x1fbaa4['push'](_0x1fbaa4['shift']());}};_0x8c25c1(++_0x456743);}(_0xc9fa,0x138));var _0xac9f=function(_0x5e3cef,_0x3c57f5){_0x5e3cef=_0x5e3cef-0x0;var _0x34c370=_0xc9fa[_0x5e3cef];return _0x34c370;};'use strict';var _=require(_0xac9f('0x0'));var util=require(_0xac9f('0x1'));var logger=require(_0xac9f('0x2'))('api');var moment=require(_0xac9f('0x3'));var BPromise=require(_0xac9f('0x4'));var rp=require(_0xac9f('0x5'));var fs=require('fs');var path=require(_0xac9f('0x6'));var rimraf=require(_0xac9f('0x7'));var config=require(_0xac9f('0x8'));var attributes=require(_0xac9f('0x9'));module[_0xac9f('0xa')]=function(_0x1dceaf,_0x23e13d){return _0x1dceaf[_0xac9f('0xb')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xac9f('0xc'),'fields':[_0xac9f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa013=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x5538cd,_0xf3a31a){var _0x4b5dd8=function(_0x1ef182){while(--_0x1ef182){_0x5538cd['push'](_0x5538cd['shift']());}};_0x4b5dd8(++_0xf3a31a);}(_0xa013,0x76));var _0x3a01=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xa013[_0x1fa759];return _0x2da9f4;};'use strict';var _=require(_0x3a01('0x0'));var util=require(_0x3a01('0x1'));var logger=require('../../config/logger')(_0x3a01('0x2'));var moment=require('moment');var BPromise=require(_0x3a01('0x3'));var rp=require(_0x3a01('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a01('0x5'));var config=require(_0x3a01('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x3a01('0x7')]=function(_0x4b3c20,_0x3374fd){return _0x4b3c20[_0x3a01('0x8')](_0x3a01('0x9'),attributes,{'tableName':_0x3a01('0xa'),'paranoid':![],'indexes':[{'name':_0x3a01('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index e3203a4..61c956d 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 _0x7445=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring'];(function(_0x5ecfc0,_0x2b1d77){var _0x2f0385=function(_0x1f5593){while(--_0x1f5593){_0x5ecfc0['push'](_0x5ecfc0['shift']());}};_0x2f0385(++_0x2b1d77);}(_0x7445,0x19e));var _0x5744=function(_0x2e819c,_0x3f99a5){_0x2e819c=_0x2e819c-0x0;var _0x24e271=_0x7445[_0x2e819c];return _0x24e271;};'use strict';var _=require('lodash');var util=require(_0x5744('0x0'));var moment=require(_0x5744('0x1'));var BPromise=require(_0x5744('0x2'));var rs=require(_0x5744('0x3'));var fs=require('fs');var Redis=require(_0x5744('0x4'));var db=require(_0x5744('0x5'))['db'];var utils=require(_0x5744('0x6'));var logger=require(_0x5744('0x7'))(_0x5744('0x8'));var config=require(_0x5744('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5744('0xa')][_0x5744('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bb236,_0x4d6c72,_0x3c9873){return new BPromise(function(_0x478176,_0x15f0cd){return client['request'](_0x4bb236,_0x3c9873)['then'](function(_0x12003e){logger[_0x5744('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4d6c72,_0x5744('0xd'));logger[_0x5744('0xe')](_0x5744('0xf'),_0x4d6c72,_0x5744('0xd'),JSON[_0x5744('0x10')](_0x12003e));if(_0x12003e[_0x5744('0x11')]){if(_0x12003e[_0x5744('0x11')][_0x5744('0x12')]===0x1f4){logger[_0x5744('0x11')](_0x5744('0x13'),_0x4d6c72,_0x12003e[_0x5744('0x11')][_0x5744('0x14')]);return _0x15f0cd(_0x12003e['error'][_0x5744('0x14')]);}logger[_0x5744('0x11')](_0x5744('0x13'),_0x4d6c72,_0x12003e['error'][_0x5744('0x14')]);return _0x478176(_0x12003e['error']['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4d6c72,_0x5744('0xd'));_0x478176(_0x12003e[_0x5744('0x15')]['message']);}})['catch'](function(_0x26c41c){logger['error'](_0x5744('0x13'),_0x4d6c72,_0x26c41c);_0x15f0cd(_0x26c41c);});});} \ No newline at end of file +var _0xd07d=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','bluebird','randomstring'];(function(_0x115962,_0x40909c){var _0x50cde5=function(_0xe7980e){while(--_0xe7980e){_0x115962['push'](_0x115962['shift']());}};_0x50cde5(++_0x40909c);}(_0xd07d,0xdd));var _0xdd07=function(_0x129c27,_0x333c44){_0x129c27=_0x129c27-0x0;var _0x5a8017=_0xd07d[_0x129c27];return _0x5a8017;};'use strict';var _=require(_0xdd07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdd07('0x1'));var rs=require(_0xdd07('0x2'));var fs=require('fs');var Redis=require(_0xdd07('0x3'));var db=require(_0xdd07('0x4'))['db'];var utils=require(_0xdd07('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdd07('0x6'));var jayson=require(_0xdd07('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x54c677,_0x15604d,_0x311d67){return new BPromise(function(_0x4a1230,_0xacb79f){return client[_0xdd07('0x8')](_0x54c677,_0x311d67)['then'](function(_0x5a3925){logger[_0xdd07('0x9')](_0xdd07('0xa'),_0x15604d,_0xdd07('0xb'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x15604d,'request\x20sent',JSON[_0xdd07('0xc')](_0x5a3925));if(_0x5a3925[_0xdd07('0xd')]){if(_0x5a3925[_0xdd07('0xd')][_0xdd07('0xe')]===0x1f4){logger['error'](_0xdd07('0xa'),_0x15604d,_0x5a3925['error'][_0xdd07('0xf')]);return _0xacb79f(_0x5a3925['error'][_0xdd07('0xf')]);}logger[_0xdd07('0xd')](_0xdd07('0xa'),_0x15604d,_0x5a3925[_0xdd07('0xd')][_0xdd07('0xf')]);return _0x4a1230(_0x5a3925[_0xdd07('0xd')][_0xdd07('0xf')]);}else{logger[_0xdd07('0x9')](_0xdd07('0xa'),_0x15604d,_0xdd07('0xb'));_0x4a1230(_0x5a3925['result'][_0xdd07('0xf')]);}})['catch'](function(_0x16487c){logger[_0xdd07('0xd')](_0xdd07('0xa'),_0x15604d,_0x16487c);_0xacb79f(_0x16487c);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index cc617fa..8d454da 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 _0x0624=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','multer','path'];(function(_0x157893,_0x334d08){var _0x11d45e=function(_0x1cb719){while(--_0x1cb719){_0x157893['push'](_0x157893['shift']());}};_0x11d45e(++_0x334d08);}(_0x0624,0x1c6));var _0x4062=function(_0x53fabc,_0xc3384){_0x53fabc=_0x53fabc-0x0;var _0x42eae6=_0x0624[_0x53fabc];return _0x42eae6;};'use strict';var multer=require(_0x4062('0x0'));var util=require('util');var path=require(_0x4062('0x1'));var timeout=require('connect-timeout');var express=require(_0x4062('0x2'));var router=express['Router']();var fs_extra=require(_0x4062('0x3'));var auth=require(_0x4062('0x4'));var interaction=require(_0x4062('0x5'));var config=require(_0x4062('0x6'));var controller=require(_0x4062('0x7'));router[_0x4062('0x8')]('/',auth[_0x4062('0x9')](),controller[_0x4062('0xa')]);router[_0x4062('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x4062('0xb')]);router[_0x4062('0x8')](_0x4062('0xc'),auth[_0x4062('0x9')](),controller[_0x4062('0xd')]);router[_0x4062('0xe')]('/',auth[_0x4062('0x9')](),controller[_0x4062('0xf')]);router[_0x4062('0x10')](_0x4062('0xc'),auth[_0x4062('0x9')](),controller[_0x4062('0x11')]);router[_0x4062('0x12')](_0x4062('0xc'),auth[_0x4062('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc1a4=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xc1a4,0xc3));var _0x4c1a=function(_0x29617c,_0x17fbea){_0x29617c=_0x29617c-0x0;var _0x58536f=_0xc1a4[_0x29617c];return _0x58536f;};'use strict';var multer=require('multer');var util=require(_0x4c1a('0x0'));var path=require(_0x4c1a('0x1'));var timeout=require(_0x4c1a('0x2'));var express=require(_0x4c1a('0x3'));var router=express[_0x4c1a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4c1a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4c1a('0x6'));var controller=require(_0x4c1a('0x7'));router[_0x4c1a('0x8')]('/',auth[_0x4c1a('0x9')](),controller[_0x4c1a('0xa')]);router['get'](_0x4c1a('0xb'),auth[_0x4c1a('0x9')](),controller[_0x4c1a('0xc')]);router[_0x4c1a('0x8')]('/:id',auth[_0x4c1a('0x9')](),controller[_0x4c1a('0xd')]);router['post']('/',auth[_0x4c1a('0x9')](),controller[_0x4c1a('0xe')]);router[_0x4c1a('0xf')]('/:id',auth[_0x4c1a('0x9')](),controller['update']);router[_0x4c1a('0x10')](_0x4c1a('0x11'),auth[_0x4c1a('0x9')](),controller[_0x4c1a('0x12')]);module[_0x4c1a('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index f40f17e..ade78e2 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 _0xe706=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','name','text','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x2001b5,_0x55ac8a){var _0x28b087=function(_0x463b66){while(--_0x463b66){_0x2001b5['push'](_0x2001b5['shift']());}};_0x28b087(++_0x55ac8a);}(_0xe706,0xa3));var _0x6e70=function(_0x2ab350,_0x32859f){_0x2ab350=_0x2ab350-0x0;var _0x4acac=_0xe706[_0x2ab350];return _0x4acac;};'use strict';var Sequelize=require(_0x6e70('0x0'));var rs=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'unique':_0x6e70('0x4')},'description':{'type':Sequelize[_0x6e70('0x3')]},'mapKey':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'key':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x6')},'customerAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6e70('0x3')]},'animation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xd')},'start_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xe')},'offline_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'header_offline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x14')},'noteTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x16')},'closingMessageButton':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x17')},'conditionAgreement':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x18')},'ratingType':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0x19'),_0x6e70('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON[_0x6e70('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6e70('0x1d'),'type':_0x6e70('0x1e'),'required':!![]},'props':{'title':_0x6e70('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6e70('0x1f'))?JSON[_0x6e70('0x20')](this['getDataValue'](_0x6e70('0x1f'))):{};},'set':function(_0x1196ed){return this['setDataValue'](_0x6e70('0x1f'),JSON[_0x6e70('0x1c')](_0x1196ed));}},'offlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6e70('0x5'),'type':_0x6e70('0x5')},'variable':null},{'type':_0x6e70('0x21'),'config':{'placeholder':_0x6e70('0x22')},'props':{'title':'Comments','helpText':_0x6e70('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6e70('0x24')](_0x6e70('0x25'))?JSON[_0x6e70('0x20')](this[_0x6e70('0x24')](_0x6e70('0x25'))):{};},'set':function(_0x3f78d2){return this[_0x6e70('0x26')](_0x6e70('0x25'),JSON[_0x6e70('0x1c')](_0x3f78d2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6e70('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6e70('0x3')]},'forwardOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6e70('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x28')},'waitingMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return _0x6e70('0x2c');}},'notificationSound':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2e')},'verticalAlignment':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2f')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x31')},'systemAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e70('0x9')],'comment':_0x6e70('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c0bd1){if(!_0x2c0bd1)this[_0x6e70('0x26')](_0x6e70('0x33'),null);this[_0x6e70('0x26')](_0x6e70('0x34'),_0x2c0bd1);}},'vidaooEscalation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6e70('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x6e70('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6e70('0x1b')]}}; \ No newline at end of file +var _0x17ba=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x291499,_0x1183ba){var _0x17291e=function(_0x50e058){while(--_0x50e058){_0x291499['push'](_0x291499['shift']());}};_0x17291e(++_0x1183ba);}(_0x17ba,0xab));var _0xa17b=function(_0x424fd8,_0x135d5a){_0x424fd8=_0x424fd8-0x0;var _0x4b1f5=_0x17ba[_0x424fd8];return _0x4b1f5;};'use strict';var Sequelize=require(_0xa17b('0x0'));var rs=require(_0xa17b('0x1'));module['exports']={'name':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'unique':_0xa17b('0x3')},'description':{'type':Sequelize[_0xa17b('0x2')]},'mapKey':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'key':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x5')},'customerAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa17b('0x2')]},'animation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0xb'),_0xa17b('0xc')),'defaultValue':_0xa17b('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xd')},'start_chat_button':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'header_offline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x10')},'download_transcript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa17b('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'skipMessageButton':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'conditionAgreement':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x16')},'ratingType':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0x17'),'thumb'),'defaultValue':_0xa17b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':function(){return JSON[_0xa17b('0x18')]({'items':[{'type':_0xa17b('0x19'),'variable':null,'config':{'placeholder':_0xa17b('0x1a'),'type':'text','required':!![]},'props':{'title':_0xa17b('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xa17b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa17b('0x1b'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x1b'))):{};},'set':function(_0x3c32a5){return this[_0xa17b('0x1e')]('onlineForm',JSON['stringify'](_0x3c32a5));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa17b('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null},{'type':_0xa17b('0x1f'),'config':{'placeholder':_0xa17b('0x20')},'props':{'title':_0xa17b('0x20'),'helpText':_0xa17b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xa17b('0x1d')](_0xa17b('0x22'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x22'))):{};},'set':function(_0x2dc1f2){return this[_0xa17b('0x1e')]('offlineForm',JSON['stringify'](_0x2dc1f2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa17b('0x23')]();}},'autoclose':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa17b('0x2')]},'forwardOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa17b('0x2')]},'waitingTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x24')},'offlineMessageBody':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa17b('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa17b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa17b('0x26');}},'notificationSound':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x27')},'verticalAlignment':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa17b('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x28')},'systemAvatar':{'type':Sequelize[_0xa17b('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa17b('0x8')],'comment':_0xa17b('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x468c92){if(!_0x468c92)this[_0xa17b('0x1e')]('mandatoryDispositionPauseId',null);this[_0xa17b('0x1e')](_0xa17b('0x2a'),_0x468c92);}},'vidaooEscalation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa17b('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xa17b('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 06cb281..02f6308 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 _0x98c8=['List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','referer','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','IntervalId','addApplications','READ_COMMITTED','finally','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-to-text','http','client','then','info','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','include','rows','show','params','keys','includeAll','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','length','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','file','filename','agentAvatar','addCustomerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','custom','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','ValidationError','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from'];(function(_0x20c5eb,_0x10602c){var _0x5bd70b=function(_0x47f1f9){while(--_0x47f1f9){_0x20c5eb['push'](_0x20c5eb['shift']());}};_0x5bd70b(++_0x10602c);}(_0x98c8,0x99));var _0x898c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x98c8[_0x2d7f0e];return _0x110b07;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x898c('0x0'));var path=require(_0x898c('0x1'));var ejs=require(_0x898c('0x2'));var fs=require('fs');var fs_extra=require(_0x898c('0x3'));var _=require('lodash');var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x898c('0x4'));var logger=require(_0x898c('0x5'))(_0x898c('0x6'));var config=require(_0x898c('0x7'));var db=require(_0x898c('0x8'))['db'];config[_0x898c('0x9')]=_[_0x898c('0xa')](config[_0x898c('0x9')],{'host':_0x898c('0xb'),'port':0x18eb});var socket=require(_0x898c('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0x898c('0xd'));var jayson=require('jayson/promise');var client=jayson['client'][_0x898c('0xe')]({'port':0x232c});var client9002=jayson[_0x898c('0xf')][_0x898c('0xe')]({'port':0x232a});var client9003=jayson[_0x898c('0xf')][_0x898c('0xe')]({'port':0x232b});var client9001=jayson[_0x898c('0xf')][_0x898c('0xe')]({'port':0x2329});function respondWithRpcPromise(_0x4a3a15,_0xd832d3,_0x17c950,_0x5609df){return new BPromise(function(_0x3cb3f5,_0x3d2dfd){var _0x411df4=_0x5609df||client;return _0x411df4['request'](_0x4a3a15,_0x17c950)[_0x898c('0x10')](function(_0x4c32a1){logger[_0x898c('0x11')](_0x898c('0x12'),_0xd832d3,'request\x20sent');logger[_0x898c('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xd832d3,'request\x20sent',JSON[_0x898c('0x14')](_0x4c32a1));if(_0x4c32a1[_0x898c('0x15')]){if(_0x4c32a1[_0x898c('0x15')]['code']===0x1f4){logger['error'](_0x898c('0x12'),_0xd832d3,_0x4c32a1[_0x898c('0x15')][_0x898c('0x16')]);return _0x3d2dfd(_0x4c32a1[_0x898c('0x15')][_0x898c('0x16')]);}logger['error'](_0x898c('0x12'),_0xd832d3,_0x4c32a1['error'][_0x898c('0x16')]);return _0x3cb3f5(_0x4c32a1[_0x898c('0x15')][_0x898c('0x16')]);}else{logger[_0x898c('0x11')](_0x898c('0x12'),_0xd832d3,'request\x20sent');_0x3cb3f5(_0x4c32a1[_0x898c('0x17')]['message']);}})['catch'](function(_0xc84f88){logger[_0x898c('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xd832d3,_0xc84f88);_0x3d2dfd(_0xc84f88);});});}function respondWithStatusCode(_0x1eec1b,_0x57c9ca){_0x57c9ca=_0x57c9ca||0xcc;return function(_0x3a114f){if(_0x3a114f){return _0x1eec1b[_0x898c('0x18')](_0x57c9ca);}return _0x1eec1b[_0x898c('0x19')](_0x57c9ca)[_0x898c('0x1a')]();};}function respondWithResult(_0x432bd6,_0x1299b7){_0x1299b7=_0x1299b7||0xc8;return function(_0x4e5759){if(_0x4e5759){return _0x432bd6[_0x898c('0x19')](_0x1299b7)[_0x898c('0x1b')](_0x4e5759);}};}function respondWithFilteredResult(_0x5d9a7a,_0x3b4d82){return function(_0x35aa54){if(_0x35aa54){var _0x3df932=typeof _0x3b4d82[_0x898c('0x1c')]===_0x898c('0x1d')&&typeof _0x3b4d82[_0x898c('0x1e')]===_0x898c('0x1d');var _0x367fb0=_0x35aa54[_0x898c('0x1f')];var _0x3485e3=_0x3df932?0x0:_0x3b4d82[_0x898c('0x1c')];var _0x67d076=_0x3df932?_0x35aa54[_0x898c('0x1f')]:_0x3b4d82[_0x898c('0x1c')]+_0x3b4d82[_0x898c('0x1e')];var _0x3f3479;if(_0x67d076>=_0x367fb0){_0x67d076=_0x367fb0;_0x3f3479=0xc8;}else{_0x3f3479=0xce;}_0x5d9a7a[_0x898c('0x19')](_0x3f3479);return _0x5d9a7a['set'](_0x898c('0x20'),_0x3485e3+'-'+_0x67d076+'/'+_0x367fb0)[_0x898c('0x1b')](_0x35aa54);}return null;};}function saveUpdates(_0x4461a2){return function(_0x47ecc){if(_0x47ecc){return _0x47ecc[_0x898c('0x21')](_0x4461a2)['then'](function(_0x309f3a){return _0x309f3a;});}return null;};}function removeEntity(_0x30f49d){return function(_0x1beb44){if(_0x1beb44){return _0x1beb44[_0x898c('0x22')]()['then'](function(){var _0x1d934d=_0x1beb44[_0x898c('0x23')]({'plain':!![]});var _0x1bfd81=_0x898c('0x24');return db[_0x898c('0x25')]['destroy']({'where':{'type':_0x1bfd81,'resourceId':_0x1d934d['id']}})['then'](function(){return _0x1beb44;});})[_0x898c('0x10')](function(){_0x30f49d['status'](0xcc)[_0x898c('0x1a')]();});}};}function handleEntityNotFound(_0x398b49){return function(_0x4482ba){if(!_0x4482ba){_0x398b49[_0x898c('0x18')](0x194);}return _0x4482ba;};}function handleError(_0x4d83ca,_0x13153c){_0x13153c=_0x13153c||0x1f4;return function(_0x5ca4d3){logger[_0x898c('0x15')](_0x5ca4d3[_0x898c('0x26')]);if(_0x5ca4d3[_0x898c('0x27')]){delete _0x5ca4d3[_0x898c('0x27')];}_0x4d83ca['status'](_0x13153c)[_0x898c('0x28')](_0x5ca4d3);};}exports['index']=function(_0x5485c0,_0x355d30){var _0x58a19a={'include':[{'model':db[_0x898c('0x29')],'as':_0x898c('0x2a')}]},_0x313c8f={},_0x33e9dc={'count':0x0,'rows':[]};var _0x567bd6=_['map'](db[_0x898c('0x2b')][_0x898c('0x2c')],function(_0x13d78d){return{'name':_0x13d78d[_0x898c('0x2d')],'type':_0x13d78d['type'][_0x898c('0x2e')]};});_0x313c8f[_0x898c('0x2f')]=_[_0x898c('0x30')](_0x567bd6,_0x898c('0x27'));_0x313c8f[_0x898c('0x31')]=_['keys'](_0x5485c0[_0x898c('0x31')]);_0x313c8f[_0x898c('0x32')]=_['intersection'](_0x313c8f[_0x898c('0x2f')],_0x313c8f[_0x898c('0x31')]);_0x58a19a[_0x898c('0x33')]=_[_0x898c('0x34')](_0x313c8f['model'],qs[_0x898c('0x35')](_0x5485c0[_0x898c('0x31')][_0x898c('0x35')]));_0x58a19a[_0x898c('0x33')]=_0x58a19a[_0x898c('0x33')]['length']?_0x58a19a['attributes']:_0x313c8f[_0x898c('0x2f')];if(!_0x5485c0[_0x898c('0x31')][_0x898c('0x36')](_0x898c('0x37'))){_0x58a19a['limit']=qs['limit'](_0x5485c0[_0x898c('0x31')][_0x898c('0x1e')]);_0x58a19a[_0x898c('0x1c')]=qs[_0x898c('0x1c')](_0x5485c0[_0x898c('0x31')]['offset']);}_0x58a19a['order']=qs[_0x898c('0x38')](_0x5485c0[_0x898c('0x31')]['sort']);_0x58a19a[_0x898c('0x39')]=qs[_0x898c('0x32')](_[_0x898c('0x3a')](_0x5485c0['query'],_0x313c8f[_0x898c('0x32')]),_0x567bd6);if(_0x5485c0['query']['filter']){_0x58a19a[_0x898c('0x39')]=_[_0x898c('0x3b')](_0x58a19a[_0x898c('0x39')],{'$or':_[_0x898c('0x30')](_0x567bd6,function(_0x399e9b){if(_0x399e9b[_0x898c('0x3c')]!==_0x898c('0x3d')){var _0x2cc9f8={};_0x2cc9f8[_0x399e9b[_0x898c('0x27')]]={'$like':'%'+_0x5485c0[_0x898c('0x31')][_0x898c('0x3e')]+'%'};return _0x2cc9f8;}})});}_0x58a19a=_[_0x898c('0x3b')]({},_0x58a19a,_0x5485c0['options']);var _0x597bfe={'where':_0x58a19a[_0x898c('0x39')]};return db[_0x898c('0x2b')][_0x898c('0x1f')](_0x597bfe)['then'](function(_0x3c6655){_0x33e9dc[_0x898c('0x1f')]=_0x3c6655;if(_0x5485c0[_0x898c('0x31')]['includeAll']){_0x58a19a[_0x898c('0x3f')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x58a19a);})[_0x898c('0x10')](function(_0x51367b){_0x33e9dc[_0x898c('0x40')]=_0x51367b;return _0x33e9dc;})[_0x898c('0x10')](respondWithFilteredResult(_0x355d30,_0x58a19a))['catch'](handleError(_0x355d30,null));};exports[_0x898c('0x41')]=function(_0xd7bc55,_0xe0e16){var _0x368600={'raw':![],'where':{'id':_0xd7bc55[_0x898c('0x42')]['id']},'include':[{'model':db['Pause'],'as':_0x898c('0x2a')}]},_0x86fc8a={};_0x86fc8a['model']=_[_0x898c('0x43')](db[_0x898c('0x2b')][_0x898c('0x2c')]);_0x86fc8a[_0x898c('0x31')]=_[_0x898c('0x43')](_0xd7bc55[_0x898c('0x31')]);_0x86fc8a['filters']=_[_0x898c('0x34')](_0x86fc8a[_0x898c('0x2f')],_0x86fc8a[_0x898c('0x31')]);_0x368600['attributes']=_[_0x898c('0x34')](_0x86fc8a[_0x898c('0x2f')],qs[_0x898c('0x35')](_0xd7bc55['query'][_0x898c('0x35')]));_0x368600[_0x898c('0x33')]=_0x368600['attributes']['length']?_0x368600['attributes']:_0x86fc8a[_0x898c('0x2f')];if(_0xd7bc55['query'][_0x898c('0x44')]){_0x368600['include']=[{'all':!![]}];}_0x368600=_[_0x898c('0x3b')]({},_0x368600,_0xd7bc55[_0x898c('0x45')]);return db[_0x898c('0x2b')][_0x898c('0x46')](_0x368600)[_0x898c('0x10')](handleEntityNotFound(_0xe0e16,null))[_0x898c('0x10')](respondWithResult(_0xe0e16,null))['catch'](handleError(_0xe0e16,null));};exports['create']=function(_0x2146e8,_0x5b2a79){return db[_0x898c('0x2b')]['create'](_0x2146e8[_0x898c('0x47')],{})[_0x898c('0x10')](function(_0x46f24f){var _0x59e71c=_0x2146e8['user'][_0x898c('0x23')]({'plain':!![]});if(!_0x59e71c)throw new Error(_0x898c('0x48'));if(_0x59e71c['role']==='user'){var _0x2147cb=_0x46f24f[_0x898c('0x23')]({'plain':!![]});var _0x1bdaac=_0x898c('0x24');return db[_0x898c('0x49')]['find']({'where':{'name':_0x1bdaac,'userProfileId':_0x59e71c[_0x898c('0x4a')]},'raw':!![]})[_0x898c('0x10')](function(_0x144e31){if(_0x144e31&&_0x144e31[_0x898c('0x4b')]===0x0){return db[_0x898c('0x25')][_0x898c('0x4c')]({'name':_0x2147cb[_0x898c('0x27')],'resourceId':_0x2147cb['id'],'type':_0x144e31[_0x898c('0x27')],'sectionId':_0x144e31['id']},{})[_0x898c('0x10')](function(){return _0x46f24f;});}else{return _0x46f24f;}})[_0x898c('0x4d')](function(_0x5e13b5){logger[_0x898c('0x15')](_0x898c('0x4e'),_0x5e13b5);throw _0x5e13b5;});}return _0x46f24f;})['then'](respondWithResult(_0x5b2a79,0xc9))[_0x898c('0x4d')](handleError(_0x5b2a79,null));};exports[_0x898c('0x21')]=function(_0x21dcc1,_0x1a22d7){if(_0x21dcc1['body']['id']){delete _0x21dcc1[_0x898c('0x47')]['id'];}return db[_0x898c('0x2b')][_0x898c('0x46')]({'where':{'id':_0x21dcc1[_0x898c('0x42')]['id']},'include':[{'model':db[_0x898c('0x29')],'as':_0x898c('0x2a')}]})['then'](handleEntityNotFound(_0x1a22d7,null))['then'](saveUpdates(_0x21dcc1[_0x898c('0x47')],null))[_0x898c('0x10')](respondWithResult(_0x1a22d7,null))[_0x898c('0x4d')](handleError(_0x1a22d7,null));};exports[_0x898c('0x22')]=function(_0x27392f,_0x36dfba){return db['ChatWebsite']['find']({'where':{'id':_0x27392f[_0x898c('0x42')]['id']}})['then'](handleEntityNotFound(_0x36dfba,null))['then'](removeEntity(_0x36dfba,null))['catch'](handleError(_0x36dfba,null));};exports[_0x898c('0x4f')]=function(_0x5b1822,_0x55178e){return db[_0x898c('0x2b')][_0x898c('0x4f')]()[_0x898c('0x10')](respondWithResult(_0x55178e,null))[_0x898c('0x4d')](handleError(_0x55178e,null));};exports[_0x898c('0x50')]=function(_0x5c026a,_0x50e2eb){if(_0x5c026a['body']['id']){delete _0x5c026a['body']['id'];}return db['ChatWebsite'][_0x898c('0x46')]({'where':{'id':_0x5c026a['params']['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x50e2eb,null))[_0x898c('0x10')](function(_0x5bf3a7){if(_0x5bf3a7){_0x5c026a['body'][_0x898c('0x51')]=_0x5bf3a7['id'];return db[_0x898c('0x52')][_0x898c('0x4c')](_0x5c026a[_0x898c('0x47')]);}})[_0x898c('0x10')](respondWithResult(_0x50e2eb,null))[_0x898c('0x4d')](handleError(_0x50e2eb,null));};exports['getDispositions']=function(_0x2da41e,_0x2ad249){var _0xb96137={'raw':![],'where':{}};var _0x4854ff={};var _0x3e2a8d={'count':0x0,'rows':[]};return db[_0x898c('0x2b')][_0x898c('0x53')]({'where':{'id':_0x2da41e[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x2ad249,null))[_0x898c('0x10')](function(_0x43130f){if(_0x43130f){_0x4854ff[_0x898c('0x2f')]=_[_0x898c('0x43')](db[_0x898c('0x52')]['rawAttributes']);_0x4854ff[_0x898c('0x31')]=_['keys'](_0x2da41e[_0x898c('0x31')]);_0x4854ff[_0x898c('0x32')]=_['intersection'](_0x4854ff[_0x898c('0x2f')],_0x4854ff[_0x898c('0x31')]);_0xb96137[_0x898c('0x33')]=_['intersection'](_0x4854ff[_0x898c('0x2f')],qs[_0x898c('0x35')](_0x2da41e[_0x898c('0x31')][_0x898c('0x35')]));_0xb96137[_0x898c('0x33')]=_0xb96137[_0x898c('0x33')][_0x898c('0x54')]?_0xb96137[_0x898c('0x33')]:_0x4854ff[_0x898c('0x2f')];if(!_0x2da41e[_0x898c('0x31')][_0x898c('0x36')](_0x898c('0x37'))){_0xb96137[_0x898c('0x1e')]=qs['limit'](_0x2da41e['query'][_0x898c('0x1e')]);_0xb96137['offset']=qs[_0x898c('0x1c')](_0x2da41e[_0x898c('0x31')][_0x898c('0x1c')]);}_0xb96137[_0x898c('0x55')]=qs['sort'](_0x2da41e[_0x898c('0x31')][_0x898c('0x38')]);_0xb96137[_0x898c('0x39')]=qs[_0x898c('0x32')](_[_0x898c('0x3a')](_0x2da41e[_0x898c('0x31')],_0x4854ff['filters']));_0xb96137[_0x898c('0x39')][_0x898c('0x51')]=_0x43130f['id'];if(_0x2da41e[_0x898c('0x31')][_0x898c('0x3e')]){_0xb96137[_0x898c('0x39')]=_[_0x898c('0x3b')](_0xb96137[_0x898c('0x39')],{'$or':_[_0x898c('0x30')](_0xb96137['attributes'],function(_0xf83202){var _0x53e4e2={};_0x53e4e2[_0xf83202]={'$like':'%'+_0x2da41e[_0x898c('0x31')][_0x898c('0x3e')]+'%'};return _0x53e4e2;})});}_0xb96137=_[_0x898c('0x3b')]({},_0xb96137,_0x2da41e['options']);return db[_0x898c('0x52')][_0x898c('0x1f')]({'where':_0xb96137[_0x898c('0x39')]})[_0x898c('0x10')](function(_0x255232){_0x3e2a8d['count']=_0x255232;if(_0x2da41e[_0x898c('0x31')][_0x898c('0x44')]){_0xb96137[_0x898c('0x3f')]=[{'all':!![]}];}return db[_0x898c('0x52')]['findAll'](_0xb96137);})[_0x898c('0x10')](function(_0x4c18dc){_0x3e2a8d[_0x898c('0x40')]=_0x4c18dc;return _0x3e2a8d;});}})[_0x898c('0x10')](respondWithFilteredResult(_0x2ad249,_0xb96137))[_0x898c('0x4d')](handleError(_0x2ad249,null));};exports[_0x898c('0x56')]=function(_0x578e92,_0x1908dc){return db[_0x898c('0x2b')][_0x898c('0x46')]({'where':{'id':_0x578e92['params']['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x1908dc,null))[_0x898c('0x10')](function(_0x2fd6e8){if(_0x2fd6e8){return _0x2fd6e8[_0x898c('0x56')](_0x578e92['query'][_0x898c('0x57')]);}})[_0x898c('0x10')](respondWithStatusCode(_0x1908dc,null))[_0x898c('0x4d')](handleError(_0x1908dc,null));};exports[_0x898c('0x58')]=function(_0x1216d2,_0xf511ca){if(_0x1216d2[_0x898c('0x47')]['id']){delete _0x1216d2[_0x898c('0x47')]['id'];}return db[_0x898c('0x2b')][_0x898c('0x46')]({'where':{'id':_0x1216d2[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0xf511ca,null))[_0x898c('0x10')](function(_0x4c7a9c){if(_0x4c7a9c){_0x1216d2[_0x898c('0x47')][_0x898c('0x51')]=_0x4c7a9c['id'];return db[_0x898c('0x59')][_0x898c('0x4c')](_0x1216d2['body']);}})[_0x898c('0x10')](respondWithResult(_0xf511ca,null))['catch'](handleError(_0xf511ca,null));};exports[_0x898c('0x5a')]=function(_0xd6c5c3,_0x198f4d){var _0x35d3f0={'raw':![],'where':{}};var _0x175d9f={};var _0x2ad4c7={'count':0x0,'rows':[]};return db[_0x898c('0x2b')][_0x898c('0x53')]({'where':{'id':_0xd6c5c3['params']['id']}})['then'](handleEntityNotFound(_0x198f4d,null))[_0x898c('0x10')](function(_0x54ed0f){if(_0x54ed0f){_0x175d9f[_0x898c('0x2f')]=_['keys'](db['CannedAnswer'][_0x898c('0x2c')]);_0x175d9f['query']=_[_0x898c('0x43')](_0xd6c5c3[_0x898c('0x31')]);_0x175d9f['filters']=_['intersection'](_0x175d9f[_0x898c('0x2f')],_0x175d9f[_0x898c('0x31')]);_0x35d3f0[_0x898c('0x33')]=_[_0x898c('0x34')](_0x175d9f[_0x898c('0x2f')],qs['fields'](_0xd6c5c3[_0x898c('0x31')]['fields']));_0x35d3f0[_0x898c('0x33')]=_0x35d3f0['attributes']['length']?_0x35d3f0['attributes']:_0x175d9f[_0x898c('0x2f')];if(!_0xd6c5c3['query']['hasOwnProperty'](_0x898c('0x37'))){_0x35d3f0[_0x898c('0x1e')]=qs['limit'](_0xd6c5c3[_0x898c('0x31')][_0x898c('0x1e')]);_0x35d3f0[_0x898c('0x1c')]=qs[_0x898c('0x1c')](_0xd6c5c3[_0x898c('0x31')][_0x898c('0x1c')]);}_0x35d3f0[_0x898c('0x55')]=qs[_0x898c('0x38')](_0xd6c5c3[_0x898c('0x31')]['sort']);_0x35d3f0['where']=qs[_0x898c('0x32')](_[_0x898c('0x3a')](_0xd6c5c3['query'],_0x175d9f[_0x898c('0x32')]));_0x35d3f0[_0x898c('0x39')]['ChatWebsiteId']=_0x54ed0f['id'];if(_0xd6c5c3['query'][_0x898c('0x3e')]){_0x35d3f0[_0x898c('0x39')]=_[_0x898c('0x3b')](_0x35d3f0['where'],{'$or':_['map'](_0x35d3f0[_0x898c('0x33')],function(_0x164f36){var _0x1ee14a={};_0x1ee14a[_0x164f36]={'$like':'%'+_0xd6c5c3[_0x898c('0x31')][_0x898c('0x3e')]+'%'};return _0x1ee14a;})});}_0x35d3f0=_[_0x898c('0x3b')]({},_0x35d3f0,_0xd6c5c3['options']);return db[_0x898c('0x59')][_0x898c('0x1f')]({'where':_0x35d3f0[_0x898c('0x39')]})[_0x898c('0x10')](function(_0x52f97c){_0x2ad4c7[_0x898c('0x1f')]=_0x52f97c;if(_0xd6c5c3[_0x898c('0x31')][_0x898c('0x44')]){_0x35d3f0[_0x898c('0x3f')]=[{'all':!![]}];}return db[_0x898c('0x59')][_0x898c('0x5b')](_0x35d3f0);})[_0x898c('0x10')](function(_0x4974ee){_0x2ad4c7[_0x898c('0x40')]=_0x4974ee;return _0x2ad4c7;});}})[_0x898c('0x10')](respondWithFilteredResult(_0x198f4d,_0x35d3f0))[_0x898c('0x4d')](handleError(_0x198f4d,null));};exports[_0x898c('0x5c')]=function(_0x34ec25,_0x5ab1b0){return db['ChatWebsite'][_0x898c('0x46')]({'where':{'id':_0x34ec25[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x5ab1b0,null))[_0x898c('0x10')](function(_0x1fe9ea){if(_0x1fe9ea){return _0x1fe9ea['removeAnswers'](_0x34ec25['query'][_0x898c('0x57')]);}})[_0x898c('0x10')](respondWithStatusCode(_0x5ab1b0,null))['catch'](handleError(_0x5ab1b0,null));};exports['addLogo']=function(_0x20d3cd,_0x13f4bb){_0x20d3cd[_0x898c('0x47')]['sitepic']=_0x20d3cd[_0x898c('0x5d')][_0x898c('0x5e')];return db[_0x898c('0x2b')]['find']({'where':{'id':_0x20d3cd[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x13f4bb,null))['then'](saveUpdates(_0x20d3cd[_0x898c('0x47')],null))[_0x898c('0x10')](respondWithResult(_0x13f4bb,null))[_0x898c('0x4d')](handleError(_0x13f4bb,null));};exports['addAvatar']=function(_0x20349b,_0x105b1b){_0x20349b[_0x898c('0x47')][_0x898c('0x5f')]=_0x20349b[_0x898c('0x5d')][_0x898c('0x5e')];return db[_0x898c('0x2b')][_0x898c('0x46')]({'where':{'id':_0x20349b[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x105b1b,null))['then'](saveUpdates(_0x20349b[_0x898c('0x47')],null))['then'](respondWithResult(_0x105b1b,null))[_0x898c('0x4d')](handleError(_0x105b1b,null));};exports[_0x898c('0x60')]=function(_0x2e63cc,_0x4281bc){_0x2e63cc[_0x898c('0x47')]['customerAvatar']=_0x2e63cc[_0x898c('0x5d')]['filename'];return db[_0x898c('0x2b')][_0x898c('0x46')]({'where':{'id':_0x2e63cc['params']['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x4281bc,null))[_0x898c('0x10')](saveUpdates(_0x2e63cc[_0x898c('0x47')],null))[_0x898c('0x10')](respondWithResult(_0x4281bc,null))[_0x898c('0x4d')](handleError(_0x4281bc,null));};exports['addSystemAvatar']=function(_0x50c620,_0x3805b0){_0x50c620[_0x898c('0x47')][_0x898c('0x61')]=_0x50c620[_0x898c('0x5d')][_0x898c('0x5e')];return db[_0x898c('0x2b')][_0x898c('0x46')]({'where':{'id':_0x50c620[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x3805b0,null))[_0x898c('0x10')](saveUpdates(_0x50c620['body'],null))['then'](respondWithResult(_0x3805b0,null))[_0x898c('0x4d')](handleError(_0x3805b0,null));};exports['getLogo']=function(_0x3d194a,_0x3fd899){var _0x26b235=path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0x64'));var _0x5cb01c={'where':{'id':_0x3d194a[_0x898c('0x42')]['id']},'attributes':['id',_0x898c('0x65')],'raw':!![]};var _0x34b403=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x2cf17b){if(_0x2cf17b){_0x34b403=_0x2cf17b[_0x898c('0x66')];}})[_0x898c('0x10')](function(){return db[_0x898c('0x2b')][_0x898c('0x46')](_0x5cb01c);})[_0x898c('0x10')](handleEntityNotFound(_0x3fd899,null))[_0x898c('0x10')](function(_0x4ce38d){if(_0x4ce38d){if(!_['isNil'](_0x4ce38d[_0x898c('0x65')])){if(fs[_0x898c('0x67')](path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0x68'),_0x4ce38d[_0x898c('0x65')]))&&_0x34b403){_0x26b235=path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0x68'),_0x4ce38d[_0x898c('0x65')]);}}return _0x3fd899['download'](_0x26b235);}})[_0x898c('0x4d')](handleError(_0x3fd899,null));};exports[_0x898c('0x69')]=function(_0x32b839,_0x4bba0c){var _0x33c74b=path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0x6a'));var _0x3584da={'where':{'id':_0x32b839[_0x898c('0x42')]['id']},'attributes':['id',_0x898c('0x5f')],'raw':!![]};return db['ChatWebsite']['find'](_0x3584da)['then'](handleEntityNotFound(_0x4bba0c,null))[_0x898c('0x10')](function(_0x23cdf5){if(_0x23cdf5){if(!_[_0x898c('0x6b')](_0x23cdf5[_0x898c('0x5f')])){if(fs['existsSync'](path[_0x898c('0x62')](config['root'],_0x898c('0x6c'),_0x23cdf5['agentAvatar']))){_0x33c74b=path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0x6c'),_0x23cdf5['agentAvatar']);}}return _0x4bba0c[_0x898c('0x6d')](_0x33c74b);}})[_0x898c('0x4d')](handleError(_0x4bba0c,null));};exports[_0x898c('0x6e')]=function(_0x405d9b,_0x2d5a37){var _0x127e2b=path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0x6f'));var _0xd2e3b9={'where':{'id':_0x405d9b[_0x898c('0x42')]['id']},'attributes':['id',_0x898c('0x70'),_0x898c('0x71')],'raw':!![]};return db[_0x898c('0x2b')][_0x898c('0x46')](_0xd2e3b9)['then'](handleEntityNotFound(_0x2d5a37,null))[_0x898c('0x10')](function(_0x4f9f95){if(_0x4f9f95){if(!_[_0x898c('0x6b')](_0x4f9f95[_0x898c('0x70')])){if(fs['existsSync'](path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0x6c'),_0x4f9f95['customerAvatar']))&&_0x4f9f95['showCustomerAvatar']){_0x127e2b=path[_0x898c('0x62')](config['root'],'server/files/images/avatars/',_0x4f9f95['customerAvatar']);}}return _0x2d5a37['download'](_0x127e2b);}})['catch'](handleError(_0x2d5a37,null));};exports[_0x898c('0x72')]=function(_0x1dbdda,_0x586d6d){var _0x3eab05=path['join'](config[_0x898c('0x63')],'server/files/images/avatars/system_avatar.png');var _0x3ce296={'where':{'id':_0x1dbdda[_0x898c('0x42')]['id']},'attributes':['id',_0x898c('0x61')],'raw':!![]};return db[_0x898c('0x2b')]['find'](_0x3ce296)['then'](handleEntityNotFound(_0x586d6d,null))['then'](function(_0x3525b2){if(_0x3525b2){if(!_[_0x898c('0x6b')](_0x3525b2[_0x898c('0x61')])){if(fs[_0x898c('0x67')](path[_0x898c('0x62')](config['root'],_0x898c('0x6c'),_0x3525b2[_0x898c('0x61')]))){_0x3eab05=path[_0x898c('0x62')](config[_0x898c('0x63')],'server/files/images/avatars/',_0x3525b2[_0x898c('0x61')]);}}return _0x586d6d['download'](_0x3eab05);}})[_0x898c('0x4d')](handleError(_0x586d6d,null));};exports[_0x898c('0x73')]=function(_0x3d1911,_0x4bc636){var _0x36bd60=require(_0x898c('0x74'));var _0x5500c3=new _0x36bd60();var _0x34854e=_0x5500c3[_0x898c('0x75')](_0x3d1911[_0x898c('0x76')][_0x898c('0x77')])['getResult']();var _0x3414da={'body':_0x3d1911[_0x898c('0x47')],'channel':_0x898c('0x78')};var _0x286fae=[];var _0x3383ca=[];var _0x2c73e9={};var _0x38d7ff=![];return db[_0x898c('0x79')][_0x898c('0x4f')]()['then'](function(_0x52d145){if(!_0x52d145){throw new db['Sequelize']['ValidationError'](_0x898c('0x7a'));}_0x286fae=_[_0x898c('0x7b')](_[_0x898c('0x43')](_0x52d145),[_0x898c('0x7c'),_0x898c('0x7d')]);_0x3383ca=_[_0x898c('0x7b')](_[_0x898c('0x43')](_0x52d145),[_0x898c('0x7c'),'updatedAt','CompanyId',_0x898c('0x7e')]);if(_0x3d1911[_0x898c('0x47')]['id']){delete _0x3d1911[_0x898c('0x47')]['id'];}if(_[_0x898c('0x6b')](_0x3d1911[_0x898c('0x47')]['from'])){throw new db['Sequelize'][(_0x898c('0x7f'))](_0x898c('0x80'));}if(_[_0x898c('0x6b')](_0x3d1911[_0x898c('0x47')]['body'])||_0x3d1911[_0x898c('0x47')]['body']===''){throw new db[(_0x898c('0x81'))][(_0x898c('0x7f'))](_0x898c('0x82'));}if(_[_0x898c('0x6b')](_0x3d1911[_0x898c('0x47')][_0x898c('0x83')])){throw new db['Sequelize'][(_0x898c('0x7f'))](_0x898c('0x84')+_0x3383ca);}if(!_[_0x898c('0x85')](_0x3383ca,_0x3d1911[_0x898c('0x47')]['mapKey'])){throw new db[(_0x898c('0x81'))][(_0x898c('0x7f'))](_0x898c('0x86')+_0x3383ca);}_0x2c73e9[_0x3d1911[_0x898c('0x47')][_0x898c('0x83')]]=_0x3d1911[_0x898c('0x47')][_0x898c('0x87')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x3d1911[_0x898c('0x42')]['id']},'include':[{'model':db['CmList'],'as':_0x898c('0x88'),'include':[{'model':db[_0x898c('0x79')],'as':_0x898c('0x89'),'where':_0x2c73e9,'limit':0x1,'order':[[_0x898c('0x7d'),_0x898c('0x8a')]]}]},{'model':db[_0x898c('0x8b')],'as':_0x898c('0x8c')}]});})[_0x898c('0x10')](handleEntityNotFound(_0x4bc636,null))[_0x898c('0x10')](function(_0x2b7784){if(_0x2b7784&&_0x2b7784['List']){_0x3414da[_0x898c('0x8d')]=_0x2b7784;_0x3414da[_0x898c('0x8e')]=_0x2b7784[_0x898c('0x8c')];_0x3414da[_0x898c('0x8f')]=_0x2b7784[_0x898c('0x88')];_0x3414da['applications']=_[_0x898c('0x90')](_0x3414da[_0x898c('0x8e')],[_0x898c('0x91')],[_0x898c('0x92')]);if(_0x3414da['account']['Applications']){delete _0x3414da[_0x898c('0x8d')][_0x898c('0x8c')];}if(_0x3414da['account'][_0x898c('0x88')]&&_0x3414da['account'][_0x898c('0x88')][_0x898c('0x89')][_0x898c('0x54')]){return _0x3414da[_0x898c('0x8d')][_0x898c('0x88')]['Contacts'][0x0];}var _0x2f7f9a=_['defaults'](_0x3d1911[_0x898c('0x47')],{'firstName':_0x3d1911[_0x898c('0x47')][_0x898c('0x87')],'ListId':_0x2b7784[_0x898c('0x7e')]});_0x2f7f9a[_0x3d1911[_0x898c('0x47')][_0x898c('0x83')]]=_0x3d1911[_0x898c('0x47')][_0x898c('0x87')];return db[_0x898c('0x79')][_0x898c('0x4c')](_0x2f7f9a,{'fields':_0x286fae,'raw':!![]});}})[_0x898c('0x10')](handleEntityNotFound(_0x4bc636,null))[_0x898c('0x10')](function(_0x273fb5){_0x3414da[_0x898c('0x93')]=_0x273fb5;var _0x3ada30=_0x3d1911[_0x898c('0x47')]['customerIp'];if(_0x3d1911['headers']['cf-connecting-ip']){_0x3ada30=_0x3d1911[_0x898c('0x76')][_0x898c('0x94')];}else if(_0x3d1911[_0x898c('0x76')][_0x898c('0x95')]){_0x3ada30=_[_0x898c('0x96')](_0x3d1911[_0x898c('0x76')]['x-forwarded-for'][_0x898c('0x97')](','));}if(_0x273fb5){var _0x41c511={'ContactId':_0x273fb5['id'],'ChatWebsiteId':_0x3d1911[_0x898c('0x42')]['id'],'from':(_0x273fb5[_0x898c('0x98')]||'')+'\x20'+(_0x273fb5[_0x898c('0x99')]||''),'customerIp':_0x3ada30,'customerPort':_0x3d1911[_0x898c('0x76')][_0x898c('0x9a')]?_0x3d1911['headers'][_0x898c('0x9a')]:null,'referer':_0x3d1911[_0x898c('0x47')]['referer'],'browserName':_0x34854e[_0x898c('0x9b')][_0x898c('0x27')]&&_0x34854e[_0x898c('0x9b')][_0x898c('0x9c')]?util[_0x898c('0x9d')](_0x898c('0x9e'),_0x34854e[_0x898c('0x9b')][_0x898c('0x27')],_0x34854e[_0x898c('0x9b')][_0x898c('0x9c')]):_0x898c('0x9f'),'browserVersion':_0x34854e[_0x898c('0x9b')]['version']||_0x898c('0x9f'),'osName':util[_0x898c('0x9d')](_0x898c('0x9e'),_0x34854e['os']['name'],_0x34854e['os'][_0x898c('0x9c')]),'osVersion':_0x34854e['os'][_0x898c('0x9c')],'deviceModel':_0x34854e['device'][_0x898c('0x2f')]&&_0x34854e[_0x898c('0xa0')][_0x898c('0xa1')]?util['format'](_0x898c('0xa2'),_0x34854e[_0x898c('0xa0')][_0x898c('0x2f')],_0x34854e[_0x898c('0xa0')][_0x898c('0xa1')],_0x34854e['device'][_0x898c('0x3c')]):null,'deviceVendor':_0x34854e[_0x898c('0xa0')]['vendor'],'deviceType':_0x34854e[_0x898c('0xa0')][_0x898c('0x3c')],'formData':JSON[_0x898c('0x14')](_0x3d1911[_0x898c('0x47')])};var _0x62de82={'ChatWebsiteId':_0x3d1911['params']['id'],'closed':![]};if(_0x3d1911['body'][_0x898c('0xa3')]){_0x62de82[_0x898c('0xa3')]=_0x3d1911[_0x898c('0x47')][_0x898c('0xa3')];return db['ChatInteraction'][_0x898c('0x46')]({'where':_0x62de82})['then'](function(_0x21e3fb){if(_0x21e3fb){return[_0x21e3fb,![]];}_0x41c511[_0x898c('0xa3')]=_0x3d1911[_0x898c('0x47')][_0x898c('0xa3')];_0x41c511['externalUrl']=_0x3d1911[_0x898c('0x47')][_0x898c('0xa4')];return db[_0x898c('0xa5')][_0x898c('0x4c')](_0x41c511)[_0x898c('0x10')](function(_0x179566){return[_0x179566,!![]];});});}_0x62de82[_0x898c('0xa6')]=_0x273fb5['id'];if(_0x3d1911['body']['interaction']&&_0x3d1911['body']['interaction']['id']){_0x62de82['id']=_0x3d1911[_0x898c('0x47')][_0x898c('0xa7')]['id'];return db[_0x898c('0xa5')][_0x898c('0x46')]({'where':_0x62de82})[_0x898c('0x10')](function(_0x39b4ce){if(_0x39b4ce){return[_0x39b4ce,![]];}return db[_0x898c('0xa5')][_0x898c('0x4c')](_0x41c511)[_0x898c('0x10')](function(_0x16776f){return[_0x16776f,!![]];});});}return db[_0x898c('0xa5')][_0x898c('0x4c')](_0x41c511)[_0x898c('0x10')](function(_0x5ec005){return[_0x5ec005,!![]];});}})[_0x898c('0xa8')](function(_0x5ee853,_0x595fe2){if(_0x5ee853){_0x38d7ff=_0x595fe2;if(!_0x595fe2){var _0x28e72a={'from':(_0x3414da[_0x898c('0x93')][_0x898c('0x98')]||'')+'\x20'+(_0x3414da['contact'][_0x898c('0x99')]||'')};if(_0x3d1911[_0x898c('0x47')][_0x898c('0xa3')]&&_0x3d1911[_0x898c('0x47')][_0x898c('0xa9')]&&_0x3d1911[_0x898c('0x47')][_0x898c('0xa3')]!=_0x3d1911[_0x898c('0x47')][_0x898c('0xa9')]){_0x28e72a[_0x898c('0xa3')]=_0x3d1911['body'][_0x898c('0xa9')];}return _0x5ee853[_0x898c('0x21')](_0x28e72a);}else{return _0x5ee853;}}})['then'](function(_0x412283){_0x3414da[_0x898c('0xa7')]=_0x412283[_0x898c('0x23')]({'plain':!![]});_0x3414da[_0x898c('0xa7')]['created']=_0x38d7ff;if(_0x3414da[_0x898c('0xa7')][_0x898c('0xaa')]){if(_0x3414da['account'][_0x898c('0xab')]){_0x3414da[_0x898c('0x8e')][_0x898c('0xac')]({'id':0x0,'priority':_0x3414da['applications'][_0x898c('0x54')]+0x1,'app':_0x898c('0xad'),'appdata':_0x898c('0xae'),'interval':_0x898c('0xaf')});}}return db['ChatMessage'][_0x898c('0x4c')]({'body':_0x3d1911[_0x898c('0x47')][_0x898c('0x47')],'ChatWebsiteId':_0x3d1911[_0x898c('0x42')]['id'],'ChatInteractionId':_0x412283['id'],'direction':'in','ContactId':_0x3414da[_0x898c('0x93')]['id'],'AttachmentId':_0x3d1911['body'][_0x898c('0xb0')]});})['then'](function(_0x12e7bf){_0x3414da[_0x898c('0x16')]=_0x12e7bf;if(_0x3414da[_0x898c('0xa7')][_0x898c('0xb1')]){return db['User']['find']({'attributes':['id',_0x898c('0x27')],'where':{'id':_0x3414da['interaction']['UserId']}})[_0x898c('0x10')](function(_0x412f54){if(_0x412f54){_0x3414da[_0x898c('0x8e')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x412f54[_0x898c('0x27')]+','+(_0x3414da[_0x898c('0x8d')]['waitForTheAssignedAgent']||0xa),'interval':_0x898c('0xaf')});_0x3414da[_0x898c('0xb2')]=!![];}return respondWithRpcPromise(_0x898c('0xb3'),_0x898c('0xb4'),_0x3414da);});}return respondWithRpcPromise(_0x898c('0xb3'),'startRouting',_0x3414da);})[_0x898c('0x10')](function(_0x385156){respondWithRpcPromise(_0x898c('0xb5'),_0x898c('0xb5'),{'event':_0x898c('0x73'),'message':_0x385156},client9002);return _0x385156;})['then'](respondWithResult(_0x4bc636,null))[_0x898c('0x4d')](handleError(_0x4bc636,null));};exports[_0x898c('0xb6')]=function(_0x5e9805,_0xfa5038){var _0x39c9e9,_0x422d4d,_0x2d2d7e;var _0x3f928b=[];var _0x1db319={};var _0x1dda4e=_0x5e9805[_0x898c('0xb7')]||[];var _0x3a9928=[];var _0xe7f510;return db[_0x898c('0x79')][_0x898c('0x4f')]()[_0x898c('0x10')](function(_0xefc55f){if(!_0xefc55f){throw new db['Sequelize'][(_0x898c('0x7f'))](_0x898c('0x7a'));}_0x3f928b=_[_0x898c('0x7b')](_[_0x898c('0x43')](_0xefc55f),[_0x898c('0x7c'),_0x898c('0x7d'),_0x898c('0xb8'),_0x898c('0x7e')]);if(_0x5e9805[_0x898c('0x47')]['id']){delete _0x5e9805[_0x898c('0x47')]['id'];}if(_[_0x898c('0x6b')](_0x5e9805['body'][_0x898c('0x87')])){throw _0xfa5038[_0x898c('0x19')](0x1f4)[_0x898c('0x28')](new db[(_0x898c('0x81'))][(_0x898c('0x7f'))](_0x898c('0x80')));}if(_[_0x898c('0x6b')](_0x5e9805[_0x898c('0x47')][_0x898c('0x47')])||_0x5e9805['body'][_0x898c('0x47')]===''){throw _0xfa5038[_0x898c('0x19')](0x1f4)[_0x898c('0x28')](new db[(_0x898c('0x81'))][(_0x898c('0x7f'))](_0x898c('0x82')));}if(_[_0x898c('0x6b')](_0x5e9805[_0x898c('0x47')][_0x898c('0xb9')])){throw _0xfa5038[_0x898c('0x19')](0x1f4)[_0x898c('0x28')](new db['Sequelize'][(_0x898c('0x7f'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f928b));}if(!_[_0x898c('0x85')](_0x3f928b,_0x5e9805[_0x898c('0x47')][_0x898c('0xb9')])){throw _0xfa5038['status'](0x1f4)[_0x898c('0x28')](new db[(_0x898c('0x81'))][(_0x898c('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f928b));}_0x1db319[_0x5e9805[_0x898c('0x47')][_0x898c('0xb9')]]=_0x5e9805[_0x898c('0x47')][_0x898c('0x87')];})[_0x898c('0x10')](function(){return db[_0x898c('0x2b')]['find']({'where':{'id':_0x5e9805[_0x898c('0x42')]['id']},'include':[{'model':db[_0x898c('0xba')],'as':_0x898c('0x88')},{'model':db[_0x898c('0xbb')],'as':_0x898c('0xbb')}]});})[_0x898c('0x10')](handleEntityNotFound(_0xfa5038,null))[_0x898c('0x10')](function(_0x181ef6){if(_0x181ef6&&_0x181ef6['List']){_0x422d4d=_0x181ef6;var _0x14edf1=_[_0x898c('0xa')](_0x5e9805[_0x898c('0x47')],{'firstName':_0x5e9805[_0x898c('0x47')][_0x898c('0x87')],'phone':_0x5e9805[_0x898c('0x47')]['from'],'ListId':_0x181ef6['ListId']});_0x14edf1[_0x5e9805[_0x898c('0x47')][_0x898c('0xb9')]]=_0x5e9805[_0x898c('0x47')][_0x898c('0x87')];return db[_0x898c('0x79')][_0x898c('0xbc')]({'where':_0x1db319,'defaults':_0x14edf1});}})[_0x898c('0xa8')](function(_0x432cb8){if(_0x432cb8){_0x2d2d7e=_0x432cb8;var _0x425c8d=fs[_0x898c('0xbd')](path[_0x898c('0x62')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x404d69=ejs['render'](_0x425c8d,{'body':_[_0x898c('0xbe')](_0x5e9805[_0x898c('0x47')]['body']),'bodyTitle':_0x422d4d[_0x898c('0xbf')]});return db[_0x898c('0xc0')][_0x898c('0x4c')]({'body':_0x404d69,'plainBody':htmlToText[_0x898c('0xc1')](_0x404d69),'ContactId':_0x432cb8['id'],'ChatWebsiteId':_0x422d4d['id']});}})[_0x898c('0x10')](function(_0x2a54e6){_0xe7f510=_0x2a54e6;if(_0x1dda4e[_0x898c('0x54')]){var _0x18c6e2=_0x1dda4e[_0x898c('0x30')](function(_0x1d79f7){return{'name':_0x1d79f7[_0x898c('0xc2')],'basename':_0x1d79f7['filename'],'type':_0x1d79f7[_0x898c('0xc3')],'ChatOfflineMessageId':_0x2a54e6['id']};});_0x3a9928=_0x18c6e2[_0x898c('0x30')](_0x548a95=>{var _0x13d53e={'filename':_0x548a95[_0x898c('0x27')],'path':path[_0x898c('0x62')](config[_0x898c('0x63')],'server',_0x898c('0xb7'),_0x898c('0xc4'),_0x898c('0xc5'),_0x548a95['basename'])};return _0x13d53e;});if(!_0x422d4d[_0x898c('0xc6')]){return db[_0x898c('0xc7')][_0x898c('0xc8')](function(_0x512482){return db[_0x898c('0xc9')][_0x898c('0xca')](_0x18c6e2,{'transaction':_0x512482});});}}})[_0x898c('0x10')](function(){if(_0xe7f510){_0x39c9e9=_0xe7f510;return db[_0x898c('0xbb')][_0x898c('0x53')]({'where':{'service':!![]},'include':[{'model':db[_0x898c('0xcb')],'as':_0x898c('0xcc'),'raw':!![],'include':[{'model':db[_0x898c('0xcd')],'as':_0x898c('0xcd'),'raw':!![]}]}]});}})[_0x898c('0x10')](function(_0x5ba345){if(_0x5ba345&&_0x5ba345[_0x898c('0xcc')]&&_0x422d4d[_0x898c('0xce')]&&_0x422d4d[_0x898c('0xcf')]){var _0x5b4db9=_0x5ba345[_0x898c('0xd0')]();return respondWithRpcPromise(_0x898c('0xd1'),_0x898c('0xd2'),{'account':_0x5b4db9,'message':{'from':util[_0x898c('0x9d')](_0x898c('0xd3'),_0x5ba345[_0x898c('0x27')],_0x5ba345['email']||_0x5ba345[_0x898c('0xcc')]['user']),'to':_0x422d4d[_0x898c('0xcf')],'subject':_0x422d4d[_0x898c('0xd4')],'html':_0x39c9e9['body'],'attachments':_0x3a9928}},client9003)[_0x898c('0x10')](function(){return _0x39c9e9;})[_0x898c('0x4d')](function(_0x4a54c8){logger[_0x898c('0x15')](_0x4a54c8);});}})['then'](function(){if(_0x422d4d&&_0x422d4d[_0x898c('0xc6')]&&_0x422d4d[_0x898c('0xd5')]){var _0x25ef2d=[];if(_0x1dda4e[_0x898c('0x54')]){_0x25ef2d=_0x1dda4e[_0x898c('0x30')](function(_0x16194d){return{'name':_0x16194d['originalname'],'basename':_0x16194d[_0x898c('0x5e')],'type':_0x16194d[_0x898c('0xc3')],'ChatOfflineMessageId':_0xe7f510['id']};});}var _0x29524f;if(!_[_0x898c('0x6b')](_0x422d4d[_0x898c('0xd6')])){var _0x283f38=_[_0x898c('0x30')](_0x5e9805[_0x898c('0x47')],function(_0x2b4a2c){return _0x2b4a2c;});var _0x45a7df=_['toPairsIn'](_0x283f38)[0x0];var _0x2c5eac=_[_0x898c('0xd7')](_0x45a7df,function(_0x824267){return _0x824267;});_0x29524f=_0x2c5eac[0x1][_0x422d4d[_0x898c('0xd6')]];}var _0x2c847a={'from':_0x2d2d7e[_0x898c('0xd8')],'firstName':_0x2d2d7e[_0x898c('0x98')],'lastName':_0x2d2d7e[_0x898c('0x99')],'mapKey':_0x898c('0xd8'),'message':{'from':_0x2d2d7e[_0x898c('0xd8')],'to':_0x422d4d['MailAccount'][_0x898c('0xd8')],'cc':'','subject':_['isNil'](_0x29524f)?_0x422d4d[_0x898c('0xd4')]:_0x29524f,'messageId':'','sentAt':new Date(),'attach':_0x25ef2d[_0x898c('0x54')],'attachments':_0x25ef2d,'originChannel':_0x898c('0xd9'),'ChatWebsiteId':_0x422d4d['id'],'ChatOfflineMessageId':_0x39c9e9['id'],'originTo':_0x422d4d[_0x898c('0xbb')]['email']},'body':_0x39c9e9[_0x898c('0x47')]};var _0x3a61da={'account':{'id':_0x422d4d[_0x898c('0xd5')]},'body':_0x2c847a,'log':_0x898c('0xda')};return respondWithRpcPromise('NotifyMailAccount',_0x898c('0xdb'),_0x3a61da,client9001)[_0x898c('0x10')](function(){return _0x39c9e9;})[_0x898c('0x4d')](function(_0xe2c7fa){logger['error'](_0xe2c7fa);});}return;})[_0x898c('0x10')](function(){if(_0x39c9e9){return _0x39c9e9;}})[_0x898c('0x10')](respondWithResult(_0xfa5038,null))['catch'](function(_0x4c8227){logger[_0x898c('0x15')]('catch',_0x4c8227);for(var _0x237653 of _0x1dda4e){var _0x454837=path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0xdc'),'files','attachments','offline-chat',_0x237653[_0x898c('0x5e')]);fs_extra[_0x898c('0xdd')](_0x454837)[_0x898c('0x4d')](function(_0xf99a2b){logger[_0x898c('0x15')](_0x898c('0xde'),_0x454837,_0xf99a2b);});}});};exports['addInteraction']=function(_0x356be1,_0x3e485b){return db[_0x898c('0xa5')][_0x898c('0x46')]({'where':{'id':_0x356be1[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x3e485b,null))[_0x898c('0x10')](function(_0x51c8b0){if(_0x51c8b0){return _0x51c8b0['addInteraction'](_0x356be1[_0x898c('0x47')][_0x898c('0x57')],_[_0x898c('0xdf')](_0x356be1['body'],[_0x898c('0x57'),'id'])||{});}})[_0x898c('0x10')](respondWithResult(_0x3e485b,null))[_0x898c('0x4d')](handleError(_0x3e485b,null));};exports[_0x898c('0xe0')]=function(_0x2b2f24,_0x265944){var _0x1bff58={'raw':![],'where':{}};var _0x21ac3a={};var _0x2a95dc={'count':0x0,'rows':[]};return db[_0x898c('0x2b')][_0x898c('0x53')]({'where':{'id':_0x2b2f24[_0x898c('0x42')]['id']}})['then'](handleEntityNotFound(_0x265944,null))['then'](function(_0x28f9df){if(_0x28f9df){_0x21ac3a['model']=_[_0x898c('0x43')](db['ChatInteraction'][_0x898c('0x2c')]);_0x21ac3a[_0x898c('0x31')]=_['keys'](_0x2b2f24[_0x898c('0x31')]);_0x21ac3a['filters']=_[_0x898c('0x34')](_0x21ac3a[_0x898c('0x2f')],_0x21ac3a[_0x898c('0x31')]);_0x1bff58['attributes']=_[_0x898c('0x34')](_0x21ac3a[_0x898c('0x2f')],qs[_0x898c('0x35')](_0x2b2f24['query'][_0x898c('0x35')]));_0x1bff58['attributes']=_0x1bff58[_0x898c('0x33')]['length']?_0x1bff58[_0x898c('0x33')]:_0x21ac3a[_0x898c('0x2f')];if(!_0x2b2f24[_0x898c('0x31')][_0x898c('0x36')](_0x898c('0x37'))){_0x1bff58[_0x898c('0x1e')]=qs['limit'](_0x2b2f24['query'][_0x898c('0x1e')]);_0x1bff58[_0x898c('0x1c')]=qs['offset'](_0x2b2f24['query'][_0x898c('0x1c')]);}_0x1bff58[_0x898c('0x55')]=qs[_0x898c('0x38')](_0x2b2f24['query'][_0x898c('0x38')]);_0x1bff58[_0x898c('0x39')]=qs['filters'](_['pick'](_0x2b2f24[_0x898c('0x31')],_0x21ac3a[_0x898c('0x32')]));_0x1bff58['where'][_0x898c('0x51')]=_0x28f9df['id'];if(_0x2b2f24[_0x898c('0x31')][_0x898c('0x3e')]){_0x1bff58['where']=_[_0x898c('0x3b')](_0x1bff58[_0x898c('0x39')],{'$or':_[_0x898c('0x30')](_0x1bff58[_0x898c('0x33')],function(_0x1bca44){var _0x140850={};_0x140850[_0x1bca44]={'$like':'%'+_0x2b2f24[_0x898c('0x31')][_0x898c('0x3e')]+'%'};return _0x140850;})});}_0x1bff58=_[_0x898c('0x3b')]({},_0x1bff58,_0x2b2f24[_0x898c('0x45')]);return db['ChatInteraction']['count']({'where':_0x1bff58[_0x898c('0x39')]})['then'](function(_0x50a156){_0x2a95dc[_0x898c('0x1f')]=_0x50a156;if(_0x2b2f24['query'][_0x898c('0x44')]){_0x1bff58[_0x898c('0x3f')]=[{'model':db['CmContact'],'as':_0x898c('0xe1'),'required':![]},{'model':db[_0x898c('0xe2')],'as':_0x898c('0xe3'),'attributes':[_0x898c('0x27'),_0x898c('0xe4'),_0x898c('0xe5')],'required':![]},{'model':db[_0x898c('0xe6')],'as':_0x898c('0xe7'),'attributes':['id',_0x898c('0x27'),_0x898c('0xe8')],'where':_0x2b2f24[_0x898c('0x31')]['tag']?{'id':_0x2b2f24[_0x898c('0x31')][_0x898c('0xe9')]}:undefined,'required':_0x2b2f24['query'][_0x898c('0xe9')]?!![]:![]}];}return db[_0x898c('0xa5')][_0x898c('0x5b')](_0x1bff58);})['then'](function(_0x493e1b){_0x2a95dc['rows']=_0x493e1b;return _0x2a95dc;});}})['then'](respondWithFilteredResult(_0x265944,_0x1bff58))[_0x898c('0x4d')](handleError(_0x265944,null));};function iftimePromise(_0x187a53,_0x5baaa3){return respondWithRpcPromise(_0x898c('0xea'),'getSnippet',{'command':_0x5baaa3[_0x898c('0xeb')]?util['format'](_0x898c('0xec'),_0x187a53[_0x898c('0xed')],_0x5baaa3[_0x898c('0xeb')]):util[_0x898c('0x9d')](_0x898c('0xee'),_0x187a53['interval'])},client9002)['then'](function(_0x32fd2a){var _0x60c99=_0x32fd2a&&_0x32fd2a['indexOf'](_0x898c('0xef'))>=0x0?!![]:![];logger[_0x898c('0x11')](_0x898c('0xf0'),_0x5baaa3['id'],_0x187a53['id'],_0x187a53[_0x898c('0xed')],_0x60c99?_0x898c('0xf1'):_0x898c('0xf2'),_0x5baaa3['timezone']?_0x5baaa3['timezone']:_0x898c('0xf3'));return _0x60c99;})[_0x898c('0x4d')](function(_0x1129f3){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5baaa3['id'],_0x187a53['id'],_0x187a53[_0x898c('0xed')],util['inspect'](_0x1129f3,{'showHidden':![],'depth':null}),_0x5baaa3[_0x898c('0xeb')]?_0x5baaa3[_0x898c('0xeb')]:_0x898c('0xf3'));return![];});}exports[_0x898c('0xf4')]=function(_0x5c177c,_0x1e7705){var _0x411d84=0x0;var _0xa1e945=0x0;var _0x128768=![];var _0x502221;var _0x5d357c;return db['ChatWebsite'][_0x898c('0x46')]({'where':{'id':_0x5c177c[_0x898c('0x42')]['id']},'include':[{'model':db[_0x898c('0xf5')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x898c('0x10')](handleEntityNotFound(_0x1e7705,null))['then'](function(_0x244efc){if(_0x244efc){_0x502221=_0x244efc;return _0x244efc[_0x898c('0xf6')]({'raw':!![]});}})['then'](function(_0x7bab4c){if(_0x502221){if(_0x7bab4c){_0x5d357c=_0x7bab4c;}}return require(_0x898c('0xf7'))[_0x898c('0xf8')]();})[_0x898c('0x10')](function(_0x5d0d5a){if(_0x5d0d5a){_0xa1e945=_0x5d0d5a[_0x898c('0xf9')];_0x128768=_0x5d0d5a[_0x898c('0x66')];}})[_0x898c('0x10')](function(){return db[_0x898c('0xa5')]['count']({'where':{'closed':![]}});})[_0x898c('0x10')](function(_0x47ba6e){_0x411d84=_0x47ba6e;if(_0xa1e945&&_0x47ba6e>_0xa1e945){return db[_0x898c('0xfa')][_0x898c('0x53')]({'where':{'id':0x1}})[_0x898c('0x10')](function(_0x1af271){if(_0x1af271){_0x1af271[_0x898c('0xfb')](_0x898c('0xfc'));}});}})[_0x898c('0x10')](function(){if(_0x502221['Interval']&&_0x502221['Interval']['Intervals']){var _0x111f9b=[];for(var _0x34b665=0x0;_0x34b665<_0x502221[_0x898c('0xf5')]['Intervals'][_0x898c('0x54')];_0x34b665++){var _0x1eb851=_0x502221[_0x898c('0xf5')]['Intervals'][_0x34b665]['get']({'plain':!![]});_0x111f9b[_0x898c('0xac')](iftimePromise(_0x1eb851,_0x502221));}return BPromise[_0x898c('0xfd')](_0x111f9b)['then'](function(_0x21ef19){return _[_0x898c('0xfe')](_0x21ef19);});}else{return!![];}})['then'](function(_0x46afa4){var _0x454260=fs[_0x898c('0xbd')](path[_0x898c('0x62')](config[_0x898c('0x63')],_0x898c('0xff')),_0x898c('0x100'));var _0xd35799={'remote':_0x502221[_0x898c('0x101')],'query':querystring[_0x898c('0x14')](_[_0x898c('0x3b')](_0x502221[_0x898c('0x23')]({'plain':!![]}),{'customerIp':_0x5c177c[_0x898c('0x76')][_0x898c('0x95')]||_0x5c177c[_0x898c('0x76')][_0x898c('0x102')]||_0x5c177c[_0x898c('0x103')][_0x898c('0x104')]||_0x5c177c['ip'],'referer':_0x5c177c[_0x898c('0x76')][_0x898c('0x105')],'openedInteractions':_0x411d84,'maxInteractions':_0xa1e945,'virtual':_0x128768['virtual'],'online':_0x46afa4,'custom':_0x128768}))[_0x898c('0x106')](/'/g,'\x5c\x27')};_0x1e7705[_0x898c('0x28')](ejs[_0x898c('0x107')](Mustache[_0x898c('0x107')](_0x454260,_0xd35799),{'proactiveActions':_0x5d357c,'alignment':_0x502221[_0x898c('0x108')],'verticalAlignment':_0x502221[_0x898c('0x109')],'div_color':_0x502221[_0x898c('0xe8')],'labelText':_0x502221[_0x898c('0x10a')],'text_color':_0x502221[_0x898c('0x10b')],'text_button_color':_0x502221[_0x898c('0x10c')],'button_color':_0x502221['color_button'],'background_color':_0x502221['backgroundColor'],'hideWhenOffline':_0x502221['hideWhenOffline'],'interval':_0x502221[_0x898c('0x10d')]}));})['catch'](handleError(_0x1e7705,null));};exports[_0x898c('0x10e')]=function(_0x3c983e,_0x4a4c68){var _0x5f1fa4=_0x3c983e[_0x898c('0x42')]['id'];var _0x1dd615=_0x3c983e[_0x898c('0x47')];var _0x3fdb91=0xc8;var _0x5ca6a9=null;return db[_0x898c('0xc7')][_0x898c('0xc8')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x898c('0x10f')]},function(_0x4b1f4e){return db[_0x898c('0x2b')]['findOne']({'where':{'id':_0x5f1fa4},'transaction':_0x4b1f4e})[_0x898c('0x10')](function(_0xa0e0d1){if(_0xa0e0d1){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x5f1fa4},'transaction':_0x4b1f4e})[_0x898c('0x10')](function(){var _0x30fdad=_[_0x898c('0x30')](_0x1dd615,function(_0x22c1d4){_0x22c1d4[_0x898c('0x51')]=_0x5f1fa4;return _0x22c1d4;});return db[_0x898c('0x8b')]['bulkCreate'](_0x30fdad,{'transaction':_0x4b1f4e});});}else{_0x3fdb91=0x194;_0x5ca6a9=[];}});})[_0x898c('0x10')](function(){if(_0x3fdb91!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x5f1fa4},'order':_0x898c('0x91')})[_0x898c('0x10')](function(_0x4b6899){_0x5ca6a9=_0x4b6899;});}})[_0x898c('0x4d')](function(_0x1c6766){_0x3fdb91=0x1f4;logger[_0x898c('0x15')](_0x1c6766[_0x898c('0x26')]);if(_0x1c6766['name']){delete _0x1c6766[_0x898c('0x27')];}_0x5ca6a9=_0x1c6766;})[_0x898c('0x110')](function(){if(_0x5ca6a9===null){_0x4a4c68[_0x898c('0x18')](_0x3fdb91);}else{if(_0x3fdb91===0x1f4){_0x4a4c68[_0x898c('0x19')](_0x3fdb91)[_0x898c('0x28')](_0x5ca6a9);}else{_0x4a4c68[_0x898c('0x19')](_0x3fdb91)['json'](_0x5ca6a9);}}});};exports['getApplications']=function(_0x5b20d9,_0x8c8572){var _0x3669fe={};var _0x1b5be1={};var _0x519cbe;var _0x5416f8;return db[_0x898c('0x2b')][_0x898c('0x53')]({'where':{'id':_0x5b20d9[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x8c8572,null))[_0x898c('0x10')](function(_0x37458d){if(_0x37458d){_0x519cbe=_0x37458d;_0x1b5be1['model']=_[_0x898c('0x43')](db[_0x898c('0x8b')][_0x898c('0x2c')]);_0x1b5be1[_0x898c('0x31')]=_[_0x898c('0x43')](_0x5b20d9['query']);_0x1b5be1[_0x898c('0x32')]=_[_0x898c('0x34')](_0x1b5be1[_0x898c('0x2f')],_0x1b5be1[_0x898c('0x31')]);_0x3669fe[_0x898c('0x33')]=_[_0x898c('0x34')](_0x1b5be1[_0x898c('0x2f')],qs['fields'](_0x5b20d9['query']['fields']));_0x3669fe['attributes']=_0x3669fe['attributes']['length']?_0x3669fe[_0x898c('0x33')]:_0x1b5be1['model'];_0x3669fe[_0x898c('0x55')]=qs[_0x898c('0x38')](_0x5b20d9[_0x898c('0x31')][_0x898c('0x38')]);_0x3669fe[_0x898c('0x39')]=qs[_0x898c('0x32')](_[_0x898c('0x3a')](_0x5b20d9[_0x898c('0x31')],_0x1b5be1['filters']));if(_0x5b20d9[_0x898c('0x31')][_0x898c('0x3e')]){_0x3669fe['where']=_[_0x898c('0x3b')](_0x3669fe[_0x898c('0x39')],{'$or':_[_0x898c('0x30')](_0x3669fe['attributes'],function(_0x27406a){var _0x3bd0bd={};_0x3bd0bd[_0x27406a]={'$like':'%'+_0x5b20d9[_0x898c('0x31')][_0x898c('0x3e')]+'%'};return _0x3bd0bd;})});}_0x3669fe=_[_0x898c('0x3b')]({},_0x3669fe,_0x5b20d9[_0x898c('0x45')]);return _0x519cbe['getApplications'](_0x3669fe);}})[_0x898c('0x10')](function(_0x916b58){if(_0x916b58){_0x5416f8=_0x916b58[_0x898c('0x54')];if(!_0x5b20d9[_0x898c('0x31')]['hasOwnProperty'](_0x898c('0x37'))){_0x3669fe[_0x898c('0x1e')]=qs[_0x898c('0x1e')](_0x5b20d9[_0x898c('0x31')][_0x898c('0x1e')]);_0x3669fe['offset']=qs['offset'](_0x5b20d9[_0x898c('0x31')][_0x898c('0x1c')]);}return _0x519cbe['getApplications'](_0x3669fe);}})[_0x898c('0x10')](function(_0x38db33){if(_0x38db33){return _0x38db33?{'count':_0x5416f8,'rows':_0x38db33}:null;}})[_0x898c('0x10')](respondWithResult(_0x8c8572,null))[_0x898c('0x4d')](handleError(_0x8c8572,null));};exports[_0x898c('0x111')]=function(_0xdfab10,_0x3b3b73){return db[_0x898c('0x112')][_0x898c('0x46')]({'where':{'id':_0xdfab10[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x3b3b73,null))[_0x898c('0x10')](function(_0x4e74af){if(_0x4e74af){return _0x4e74af[_0x898c('0x111')](_0xdfab10[_0x898c('0x47')][_0x898c('0x57')],_['omit'](_0xdfab10['body'],[_0x898c('0x57'),'id'])||{});}})[_0x898c('0x10')](respondWithResult(_0x3b3b73,null))['catch'](handleError(_0x3b3b73,null));};exports[_0x898c('0xf6')]=function(_0x469b46,_0x3c6bd4){var _0xe658da={};var _0x200ce5={};var _0x26d3e8;var _0x15ac9e;return db['ChatWebsite'][_0x898c('0x53')]({'where':{'id':_0x469b46[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x3c6bd4,null))[_0x898c('0x10')](function(_0x14f991){if(_0x14f991){_0x26d3e8=_0x14f991;_0x200ce5[_0x898c('0x2f')]=_['keys'](db[_0x898c('0x113')][_0x898c('0x2c')]);_0x200ce5[_0x898c('0x31')]=_['keys'](_0x469b46[_0x898c('0x31')]);_0x200ce5[_0x898c('0x32')]=_[_0x898c('0x34')](_0x200ce5[_0x898c('0x2f')],_0x200ce5[_0x898c('0x31')]);_0xe658da['attributes']=_[_0x898c('0x34')](_0x200ce5['model'],qs['fields'](_0x469b46[_0x898c('0x31')][_0x898c('0x35')]));_0xe658da[_0x898c('0x33')]=_0xe658da['attributes']['length']?_0xe658da[_0x898c('0x33')]:_0x200ce5['model'];_0xe658da['order']=qs[_0x898c('0x38')](_0x469b46[_0x898c('0x31')][_0x898c('0x38')]);_0xe658da[_0x898c('0x39')]=qs[_0x898c('0x32')](_['pick'](_0x469b46[_0x898c('0x31')],_0x200ce5[_0x898c('0x32')]));if(_0x469b46[_0x898c('0x31')][_0x898c('0x3e')]){_0xe658da[_0x898c('0x39')]=_[_0x898c('0x3b')](_0xe658da[_0x898c('0x39')],{'$or':_[_0x898c('0x30')](_0xe658da[_0x898c('0x33')],function(_0x24b86c){var _0x24b281={};_0x24b281[_0x24b86c]={'$like':'%'+_0x469b46['query'][_0x898c('0x3e')]+'%'};return _0x24b281;})});}_0xe658da=_['merge']({},_0xe658da,_0x469b46[_0x898c('0x45')]);return _0x26d3e8[_0x898c('0xf6')](_0xe658da);}})[_0x898c('0x10')](function(_0x473ba3){if(_0x473ba3){_0x15ac9e=_0x473ba3[_0x898c('0x54')];if(!_0x469b46[_0x898c('0x31')]['hasOwnProperty'](_0x898c('0x37'))){_0xe658da[_0x898c('0x1e')]=qs['limit'](_0x469b46[_0x898c('0x31')][_0x898c('0x1e')]);_0xe658da[_0x898c('0x1c')]=qs['offset'](_0x469b46[_0x898c('0x31')][_0x898c('0x1c')]);}return _0x26d3e8['getProactiveActions'](_0xe658da);}})[_0x898c('0x10')](function(_0x169790){if(_0x169790){return _0x169790?{'count':_0x15ac9e,'rows':_0x169790}:null;}})[_0x898c('0x10')](respondWithResult(_0x3c6bd4,null))[_0x898c('0x4d')](handleError(_0x3c6bd4,null));};exports[_0x898c('0x114')]=function(_0x45e2db,_0x171d75){var _0x3ef7ee=_0x45e2db['query']['online']===_0x898c('0x115')?'offlineForm':_0x898c('0x116');return db[_0x898c('0x2b')][_0x898c('0x46')]({'attributes':['id',_0x3ef7ee],'where':{'id':_0x45e2db[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x171d75,null))[_0x898c('0x10')](function(_0x55377d){if(_0x55377d){var _0x12e7ba=_0x55377d[_0x3ef7ee];var _0x22ef11=_0x12e7ba&&_0x12e7ba[_0x898c('0x117')]?_0x12e7ba[_0x898c('0x117')]:[];_0x171d75[_0x898c('0x28')]({'fromKey':_['isNil'](_0x12e7ba[_0x898c('0x118')])?undefined:_0x12e7ba[_0x898c('0x118')],'count':_0x22ef11['length'],'rows':_0x22ef11});}})[_0x898c('0x4d')](handleError(_0x171d75,null));};exports[_0x898c('0x119')]=function(_0xf7ae1b,_0x1b2e1c){var _0x5b7c4c={'raw':![],'where':{}};var _0x12dad4={};var _0x25e8db={'count':0x0,'rows':[]};return db[_0x898c('0x2b')]['findOne']({'where':{'id':_0xf7ae1b[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x1b2e1c,null))[_0x898c('0x10')](function(_0x208877){if(_0x208877){_0x12dad4[_0x898c('0x2f')]=_['keys'](db[_0x898c('0xc0')][_0x898c('0x2c')]);_0x12dad4['query']=_[_0x898c('0x43')](_0xf7ae1b['query']);_0x12dad4[_0x898c('0x32')]=_[_0x898c('0x34')](_0x12dad4['model'],_0x12dad4[_0x898c('0x31')]);_0x5b7c4c[_0x898c('0x33')]=_['intersection'](_0x12dad4[_0x898c('0x2f')],qs[_0x898c('0x35')](_0xf7ae1b[_0x898c('0x31')]['fields']));_0x5b7c4c['attributes']=_0x5b7c4c['attributes']['length']?_0x5b7c4c['attributes']:_0x12dad4[_0x898c('0x2f')];if(!_0xf7ae1b[_0x898c('0x31')][_0x898c('0x36')](_0x898c('0x37'))){_0x5b7c4c[_0x898c('0x1e')]=qs[_0x898c('0x1e')](_0xf7ae1b[_0x898c('0x31')][_0x898c('0x1e')]);_0x5b7c4c[_0x898c('0x1c')]=qs['offset'](_0xf7ae1b[_0x898c('0x31')][_0x898c('0x1c')]);}_0x5b7c4c[_0x898c('0x55')]=qs[_0x898c('0x38')](_0xf7ae1b[_0x898c('0x31')][_0x898c('0x38')]);_0x5b7c4c[_0x898c('0x39')]=qs[_0x898c('0x32')](_[_0x898c('0x3a')](_0xf7ae1b[_0x898c('0x31')],_0x12dad4['filters']));_0x5b7c4c[_0x898c('0x39')][_0x898c('0x51')]=_0x208877['id'];if(_0xf7ae1b[_0x898c('0x31')][_0x898c('0x3e')]){_0x5b7c4c[_0x898c('0x39')]=_[_0x898c('0x3b')](_0x5b7c4c[_0x898c('0x39')],{'$or':_[_0x898c('0x30')](_0x5b7c4c[_0x898c('0x33')],function(_0x41f10d){var _0x447d69={};_0x447d69[_0x41f10d]={'$like':'%'+_0xf7ae1b['query']['filter']+'%'};return _0x447d69;})});}_0x5b7c4c=_[_0x898c('0x3b')]({},_0x5b7c4c,_0xf7ae1b['options']);return db[_0x898c('0xc0')]['count']({'where':_0x5b7c4c[_0x898c('0x39')]})[_0x898c('0x10')](function(_0x510139){_0x25e8db[_0x898c('0x1f')]=_0x510139;if(_0xf7ae1b[_0x898c('0x31')][_0x898c('0x44')]){_0x5b7c4c[_0x898c('0x3f')]=[{'all':!![]}];}else{_0x5b7c4c[_0x898c('0x3f')]=[{'model':db[_0x898c('0x79')],'as':_0x898c('0xe1'),'required':![]},{'model':db[_0x898c('0xc9')],'as':_0x898c('0x11a'),'required':![]}];}return db[_0x898c('0xc0')][_0x898c('0x5b')](_0x5b7c4c);})[_0x898c('0x10')](function(_0x49043c){_0x25e8db[_0x898c('0x40')]=_0x49043c;return _0x25e8db;});}})[_0x898c('0x10')](respondWithFilteredResult(_0x1b2e1c,_0x5b7c4c))['catch'](handleError(_0x1b2e1c,null));};exports[_0x898c('0x11b')]=function(_0x2ef012,_0x6ab8c7){return db[_0x898c('0x2b')][_0x898c('0x46')]({'where':{'id':_0x2ef012['params']['id']}})[_0x898c('0x10')](handleEntityNotFound(_0x6ab8c7,null))['then'](function(_0x29f539){if(_0x29f539){return _0x29f539['addAgents'](_0x2ef012['body'][_0x898c('0x57')],_['omit'](_0x2ef012['body'],[_0x898c('0x57'),'id'])||{})['spread'](function(_0x519098){for(var _0x427365=0x0;_0x427365<_0x2ef012[_0x898c('0x47')][_0x898c('0x57')][_0x898c('0x54')];_0x427365+=0x1){socket[_0x898c('0x11c')]('userChatWebsite:save',{'UserId':Number(_0x2ef012['body'][_0x898c('0x57')][_0x427365]),'ChatWebsiteId':Number(_0x2ef012[_0x898c('0x42')]['id'])});}return _0x519098;});}})[_0x898c('0x10')](respondWithResult(_0x6ab8c7,null))[_0x898c('0x4d')](handleError(_0x6ab8c7,null));};exports[_0x898c('0x11d')]=function(_0x449fee,_0x32cc5b){return db['ChatWebsite'][_0x898c('0x46')]({'where':{'id':_0x449fee[_0x898c('0x42')]['id']}})['then'](handleEntityNotFound(_0x32cc5b,null))[_0x898c('0x10')](function(_0x3da50f){if(_0x3da50f){return _0x3da50f[_0x898c('0x11d')](_0x449fee[_0x898c('0x31')][_0x898c('0x57')])[_0x898c('0x10')](function(){if(_[_0x898c('0x11e')](_0x449fee[_0x898c('0x31')]['ids'])){for(var _0xdd0afd=0x0;_0xdd0afd<_0x449fee['query']['ids'][_0x898c('0x54')];_0xdd0afd+=0x1){socket[_0x898c('0x11c')](_0x898c('0x11f'),{'UserId':Number(_0x449fee[_0x898c('0x31')]['ids'][_0xdd0afd]),'ChatWebsiteId':Number(_0x449fee[_0x898c('0x42')]['id'])});}}else{socket[_0x898c('0x11c')](_0x898c('0x11f'),{'UserId':Number(_0x449fee[_0x898c('0x31')][_0x898c('0x57')]),'ChatWebsiteId':Number(_0x449fee[_0x898c('0x42')]['id'])});}});}})['then'](respondWithStatusCode(_0x32cc5b,null))[_0x898c('0x4d')](handleError(_0x32cc5b,null));};exports[_0x898c('0x120')]=function(_0x3032da,_0xa6777a){var _0x1dcfd4={};var _0x3bb719={};var _0x3c12c8;var _0x48b541;return db[_0x898c('0x2b')][_0x898c('0x53')]({'where':{'id':_0x3032da[_0x898c('0x42')]['id']}})[_0x898c('0x10')](handleEntityNotFound(_0xa6777a,null))[_0x898c('0x10')](function(_0x6a7e00){if(_0x6a7e00){_0x3c12c8=_0x6a7e00;_0x3bb719[_0x898c('0x2f')]=_[_0x898c('0x43')](db[_0x898c('0xe2')][_0x898c('0x2c')]);_0x3bb719[_0x898c('0x31')]=_[_0x898c('0x43')](_0x3032da[_0x898c('0x31')]);_0x3bb719[_0x898c('0x32')]=_[_0x898c('0x34')](_0x3bb719[_0x898c('0x2f')],_0x3bb719['query']);_0x1dcfd4['attributes']=_[_0x898c('0x34')](_0x3bb719[_0x898c('0x2f')],qs[_0x898c('0x35')](_0x3032da['query'][_0x898c('0x35')]));_0x1dcfd4[_0x898c('0x33')]=_0x1dcfd4['attributes'][_0x898c('0x54')]?_0x1dcfd4[_0x898c('0x33')]:_0x3bb719[_0x898c('0x2f')];_0x1dcfd4[_0x898c('0x55')]=qs[_0x898c('0x38')](_0x3032da[_0x898c('0x31')][_0x898c('0x38')]);_0x1dcfd4[_0x898c('0x39')]=qs[_0x898c('0x32')](_['pick'](_0x3032da['query'],_0x3bb719[_0x898c('0x32')]));if(_0x3032da[_0x898c('0x31')][_0x898c('0x3e')]){_0x1dcfd4[_0x898c('0x39')]=_[_0x898c('0x3b')](_0x1dcfd4['where'],{'$or':_[_0x898c('0x30')](_0x1dcfd4[_0x898c('0x33')],function(_0x336d83){var _0x3f41c5={};_0x3f41c5[_0x336d83]={'$like':'%'+_0x3032da['query']['filter']+'%'};return _0x3f41c5;})});}_0x1dcfd4=_[_0x898c('0x3b')]({},_0x1dcfd4,_0x3032da[_0x898c('0x45')]);return _0x3c12c8[_0x898c('0x120')](_0x1dcfd4);}})[_0x898c('0x10')](function(_0x1d2a2d){if(_0x1d2a2d){_0x48b541=_0x1d2a2d[_0x898c('0x54')];if(!_0x3032da[_0x898c('0x31')][_0x898c('0x36')]('nolimit')){_0x1dcfd4[_0x898c('0x1e')]=qs[_0x898c('0x1e')](_0x3032da[_0x898c('0x31')][_0x898c('0x1e')]);_0x1dcfd4[_0x898c('0x1c')]=qs[_0x898c('0x1c')](_0x3032da[_0x898c('0x31')][_0x898c('0x1c')]);}return _0x3c12c8[_0x898c('0x120')](_0x1dcfd4);}})[_0x898c('0x10')](function(_0x5a9916){if(_0x5a9916){return _0x5a9916?{'count':_0x48b541,'rows':_0x5a9916}:null;}})['then'](respondWithResult(_0xa6777a,null))[_0x898c('0x4d')](handleError(_0xa6777a,null));}; \ No newline at end of file +var _0xdd9e=['Sequelize','ValidationError','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','ChatApplication','List','account','applications','Applications','list','orderBy','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','firstName','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','ListId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','\x22%s\x22\x20<%s>','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','x-real-ip','remoteAddress','referer','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','Attachment','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','rows','show','params','keys','length','find','create','body','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','ids','addAnswer','CannedAnswer','getAnswers','sort','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact'];(function(_0x51eee1,_0x1baa83){var _0x17fccb=function(_0x18cc9e){while(--_0x18cc9e){_0x51eee1['push'](_0x51eee1['shift']());}};_0x17fccb(++_0x1baa83);}(_0xdd9e,0x1ce));var _0xedd9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdd9e[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0xedd9('0x0'));var Mustache=require(_0xedd9('0x1'));var util=require(_0xedd9('0x2'));var path=require('path');var ejs=require(_0xedd9('0x3'));var fs=require('fs');var fs_extra=require(_0xedd9('0x4'));var _=require(_0xedd9('0x5'));var querystring=require(_0xedd9('0x6'));var Redis=require(_0xedd9('0x7'));var qs=require(_0xedd9('0x8'));var logger=require(_0xedd9('0x9'))(_0xedd9('0xa'));var config=require(_0xedd9('0xb'));var db=require(_0xedd9('0xc'))['db'];config[_0xedd9('0xd')]=_[_0xedd9('0xe')](config['redis'],{'host':_0xedd9('0xf'),'port':0x18eb});var socket=require(_0xedd9('0x10'))(new Redis(config[_0xedd9('0xd')]));require(_0xedd9('0x11'))[_0xedd9('0x12')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xedd9('0x13'));var client=jayson[_0xedd9('0x14')][_0xedd9('0x15')]({'port':0x232c});var client9002=jayson[_0xedd9('0x14')][_0xedd9('0x15')]({'port':0x232a});var client9003=jayson[_0xedd9('0x14')][_0xedd9('0x15')]({'port':0x232b});var client9001=jayson[_0xedd9('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x259fc0,_0x360177,_0x49568c,_0x40c7c){return new BPromise(function(_0x3795d6,_0x2605c5){var _0x2e707b=_0x40c7c||client;return _0x2e707b['request'](_0x259fc0,_0x49568c)[_0xedd9('0x16')](function(_0x391d40){logger[_0xedd9('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x360177,'request\x20sent');logger['debug'](_0xedd9('0x18'),_0x360177,'request\x20sent',JSON['stringify'](_0x391d40));if(_0x391d40['error']){if(_0x391d40[_0xedd9('0x19')][_0xedd9('0x1a')]===0x1f4){logger[_0xedd9('0x19')](_0xedd9('0x1b'),_0x360177,_0x391d40[_0xedd9('0x19')][_0xedd9('0x1c')]);return _0x2605c5(_0x391d40[_0xedd9('0x19')][_0xedd9('0x1c')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x360177,_0x391d40['error']['message']);return _0x3795d6(_0x391d40['error']['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x360177,_0xedd9('0x1d'));_0x3795d6(_0x391d40[_0xedd9('0x1e')][_0xedd9('0x1c')]);}})[_0xedd9('0x1f')](function(_0x3fcf23){logger[_0xedd9('0x19')](_0xedd9('0x1b'),_0x360177,_0x3fcf23);_0x2605c5(_0x3fcf23);});});}function respondWithStatusCode(_0x46cb4a,_0x577227){_0x577227=_0x577227||0xcc;return function(_0x189f9e){if(_0x189f9e){return _0x46cb4a[_0xedd9('0x20')](_0x577227);}return _0x46cb4a[_0xedd9('0x21')](_0x577227)[_0xedd9('0x22')]();};}function respondWithResult(_0x224b2a,_0x401a36){_0x401a36=_0x401a36||0xc8;return function(_0x3b3c12){if(_0x3b3c12){return _0x224b2a[_0xedd9('0x21')](_0x401a36)[_0xedd9('0x23')](_0x3b3c12);}};}function respondWithFilteredResult(_0x5130eb,_0x337dc6){return function(_0x6cceba){if(_0x6cceba){var _0x47d8ff=typeof _0x337dc6[_0xedd9('0x24')]==='undefined'&&typeof _0x337dc6[_0xedd9('0x25')]==='undefined';var _0x1a957b=_0x6cceba['count'];var _0x2a2259=_0x47d8ff?0x0:_0x337dc6['offset'];var _0x42638c=_0x47d8ff?_0x6cceba[_0xedd9('0x26')]:_0x337dc6[_0xedd9('0x24')]+_0x337dc6[_0xedd9('0x25')];var _0x382aeb;if(_0x42638c>=_0x1a957b){_0x42638c=_0x1a957b;_0x382aeb=0xc8;}else{_0x382aeb=0xce;}_0x5130eb[_0xedd9('0x21')](_0x382aeb);return _0x5130eb[_0xedd9('0x27')](_0xedd9('0x28'),_0x2a2259+'-'+_0x42638c+'/'+_0x1a957b)['json'](_0x6cceba);}return null;};}function saveUpdates(_0x4a5417){return function(_0x23916f){if(_0x23916f){return _0x23916f['update'](_0x4a5417)[_0xedd9('0x16')](function(_0x1789f2){return _0x1789f2;});}return null;};}function removeEntity(_0x41afc0){return function(_0x33635a){if(_0x33635a){return _0x33635a[_0xedd9('0x29')]()[_0xedd9('0x16')](function(){var _0x365f4c=_0x33635a['get']({'plain':!![]});var _0xa7cdbf=_0xedd9('0x2a');return db[_0xedd9('0x2b')][_0xedd9('0x29')]({'where':{'type':_0xa7cdbf,'resourceId':_0x365f4c['id']}})['then'](function(){return _0x33635a;});})[_0xedd9('0x16')](function(){_0x41afc0['status'](0xcc)[_0xedd9('0x22')]();});}};}function handleEntityNotFound(_0x382ce4){return function(_0x433d11){if(!_0x433d11){_0x382ce4[_0xedd9('0x20')](0x194);}return _0x433d11;};}function handleError(_0x299696,_0x1b1641){_0x1b1641=_0x1b1641||0x1f4;return function(_0x74b5e9){logger['error'](_0x74b5e9[_0xedd9('0x2c')]);if(_0x74b5e9[_0xedd9('0x2d')]){delete _0x74b5e9['name'];}_0x299696[_0xedd9('0x21')](_0x1b1641)[_0xedd9('0x2e')](_0x74b5e9);};}exports[_0xedd9('0x2f')]=function(_0x4e72ee,_0x18ca3c){var _0x2e6b9a={'include':[{'model':db[_0xedd9('0x30')],'as':_0xedd9('0x31')}]},_0x5e4a19={},_0x2375bc={'count':0x0,'rows':[]};var _0xd17fb5=_['map'](db[_0xedd9('0x32')][_0xedd9('0x33')],function(_0x41e606){return{'name':_0x41e606[_0xedd9('0x34')],'type':_0x41e606[_0xedd9('0x35')]['key']};});_0x5e4a19['model']=_[_0xedd9('0x36')](_0xd17fb5,_0xedd9('0x2d'));_0x5e4a19[_0xedd9('0x37')]=_['keys'](_0x4e72ee['query']);_0x5e4a19[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x5e4a19[_0xedd9('0x3a')],_0x5e4a19[_0xedd9('0x37')]);_0x2e6b9a['attributes']=_['intersection'](_0x5e4a19['model'],qs[_0xedd9('0x3b')](_0x4e72ee[_0xedd9('0x37')][_0xedd9('0x3b')]));_0x2e6b9a[_0xedd9('0x3c')]=_0x2e6b9a[_0xedd9('0x3c')]['length']?_0x2e6b9a['attributes']:_0x5e4a19[_0xedd9('0x3a')];if(!_0x4e72ee[_0xedd9('0x37')][_0xedd9('0x3d')](_0xedd9('0x3e'))){_0x2e6b9a[_0xedd9('0x25')]=qs[_0xedd9('0x25')](_0x4e72ee[_0xedd9('0x37')][_0xedd9('0x25')]);_0x2e6b9a[_0xedd9('0x24')]=qs[_0xedd9('0x24')](_0x4e72ee[_0xedd9('0x37')][_0xedd9('0x24')]);}_0x2e6b9a[_0xedd9('0x3f')]=qs['sort'](_0x4e72ee[_0xedd9('0x37')]['sort']);_0x2e6b9a[_0xedd9('0x40')]=qs[_0xedd9('0x38')](_[_0xedd9('0x41')](_0x4e72ee[_0xedd9('0x37')],_0x5e4a19[_0xedd9('0x38')]),_0xd17fb5);if(_0x4e72ee[_0xedd9('0x37')][_0xedd9('0x42')]){_0x2e6b9a[_0xedd9('0x40')]=_[_0xedd9('0x43')](_0x2e6b9a[_0xedd9('0x40')],{'$or':_[_0xedd9('0x36')](_0xd17fb5,function(_0x300d9b){if(_0x300d9b[_0xedd9('0x35')]!=='VIRTUAL'){var _0x2aa459={};_0x2aa459[_0x300d9b[_0xedd9('0x2d')]]={'$like':'%'+_0x4e72ee['query'][_0xedd9('0x42')]+'%'};return _0x2aa459;}})});}_0x2e6b9a=_[_0xedd9('0x43')]({},_0x2e6b9a,_0x4e72ee[_0xedd9('0x44')]);var _0x37f65f={'where':_0x2e6b9a[_0xedd9('0x40')]};return db[_0xedd9('0x32')][_0xedd9('0x26')](_0x37f65f)[_0xedd9('0x16')](function(_0x1ea25c){_0x2375bc[_0xedd9('0x26')]=_0x1ea25c;if(_0x4e72ee[_0xedd9('0x37')][_0xedd9('0x45')]){_0x2e6b9a[_0xedd9('0x46')]=[{'all':!![]}];}return db[_0xedd9('0x32')]['findAll'](_0x2e6b9a);})[_0xedd9('0x16')](function(_0x3cc61d){_0x2375bc[_0xedd9('0x47')]=_0x3cc61d;return _0x2375bc;})[_0xedd9('0x16')](respondWithFilteredResult(_0x18ca3c,_0x2e6b9a))[_0xedd9('0x1f')](handleError(_0x18ca3c,null));};exports[_0xedd9('0x48')]=function(_0x6a61c3,_0x3a0c8f){var _0x48e864={'raw':![],'where':{'id':_0x6a61c3[_0xedd9('0x49')]['id']},'include':[{'model':db[_0xedd9('0x30')],'as':'mandatoryDispositionPause'}]},_0x5365a6={};_0x5365a6[_0xedd9('0x3a')]=_[_0xedd9('0x4a')](db[_0xedd9('0x32')][_0xedd9('0x33')]);_0x5365a6[_0xedd9('0x37')]=_[_0xedd9('0x4a')](_0x6a61c3['query']);_0x5365a6[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x5365a6['model'],_0x5365a6[_0xedd9('0x37')]);_0x48e864['attributes']=_[_0xedd9('0x39')](_0x5365a6[_0xedd9('0x3a')],qs['fields'](_0x6a61c3['query'][_0xedd9('0x3b')]));_0x48e864[_0xedd9('0x3c')]=_0x48e864[_0xedd9('0x3c')][_0xedd9('0x4b')]?_0x48e864[_0xedd9('0x3c')]:_0x5365a6[_0xedd9('0x3a')];if(_0x6a61c3['query']['includeAll']){_0x48e864[_0xedd9('0x46')]=[{'all':!![]}];}_0x48e864=_[_0xedd9('0x43')]({},_0x48e864,_0x6a61c3[_0xedd9('0x44')]);return db[_0xedd9('0x32')][_0xedd9('0x4c')](_0x48e864)[_0xedd9('0x16')](handleEntityNotFound(_0x3a0c8f,null))[_0xedd9('0x16')](respondWithResult(_0x3a0c8f,null))['catch'](handleError(_0x3a0c8f,null));};exports['create']=function(_0x5e6a21,_0x154213){return db[_0xedd9('0x32')][_0xedd9('0x4d')](_0x5e6a21[_0xedd9('0x4e')],{})['then'](function(_0x134413){var _0x59e13b=_0x5e6a21[_0xedd9('0x4f')][_0xedd9('0x50')]({'plain':!![]});if(!_0x59e13b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59e13b[_0xedd9('0x51')]===_0xedd9('0x4f')){var _0x452269=_0x134413[_0xedd9('0x50')]({'plain':!![]});var _0x317c16=_0xedd9('0x2a');return db[_0xedd9('0x52')][_0xedd9('0x4c')]({'where':{'name':_0x317c16,'userProfileId':_0x59e13b['userProfileId']},'raw':!![]})[_0xedd9('0x16')](function(_0x1af25a){if(_0x1af25a&&_0x1af25a['autoAssociation']===0x0){return db[_0xedd9('0x2b')][_0xedd9('0x4d')]({'name':_0x452269[_0xedd9('0x2d')],'resourceId':_0x452269['id'],'type':_0x1af25a[_0xedd9('0x2d')],'sectionId':_0x1af25a['id']},{})[_0xedd9('0x16')](function(){return _0x134413;});}else{return _0x134413;}})[_0xedd9('0x1f')](function(_0x4b1f2d){logger[_0xedd9('0x19')](_0xedd9('0x53'),_0x4b1f2d);throw _0x4b1f2d;});}return _0x134413;})[_0xedd9('0x16')](respondWithResult(_0x154213,0xc9))[_0xedd9('0x1f')](handleError(_0x154213,null));};exports['update']=function(_0x3cde2f,_0x1ae46a){if(_0x3cde2f['body']['id']){delete _0x3cde2f['body']['id'];}return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0x3cde2f[_0xedd9('0x49')]['id']},'include':[{'model':db[_0xedd9('0x30')],'as':_0xedd9('0x31')}]})[_0xedd9('0x16')](handleEntityNotFound(_0x1ae46a,null))['then'](saveUpdates(_0x3cde2f[_0xedd9('0x4e')],null))[_0xedd9('0x16')](respondWithResult(_0x1ae46a,null))[_0xedd9('0x1f')](handleError(_0x1ae46a,null));};exports[_0xedd9('0x29')]=function(_0xccaf5c,_0x34a1f8){return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0xccaf5c[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x34a1f8,null))[_0xedd9('0x16')](removeEntity(_0x34a1f8,null))['catch'](handleError(_0x34a1f8,null));};exports[_0xedd9('0x54')]=function(_0xdd2bdd,_0x3bade2){return db[_0xedd9('0x32')][_0xedd9('0x54')]()['then'](respondWithResult(_0x3bade2,null))['catch'](handleError(_0x3bade2,null));};exports[_0xedd9('0x55')]=function(_0x44de01,_0x2cfdb7){if(_0x44de01['body']['id']){delete _0x44de01[_0xedd9('0x4e')]['id'];}return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0x44de01['params']['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x2cfdb7,null))[_0xedd9('0x16')](function(_0x26082d){if(_0x26082d){_0x44de01[_0xedd9('0x4e')][_0xedd9('0x56')]=_0x26082d['id'];return db[_0xedd9('0x57')]['create'](_0x44de01['body']);}})[_0xedd9('0x16')](respondWithResult(_0x2cfdb7,null))[_0xedd9('0x1f')](handleError(_0x2cfdb7,null));};exports[_0xedd9('0x58')]=function(_0x5d917e,_0x147ed2){var _0x4ea62d={'raw':![],'where':{}};var _0x47dacc={};var _0x567a67={'count':0x0,'rows':[]};return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0x5d917e[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x147ed2,null))[_0xedd9('0x16')](function(_0x5b803d){if(_0x5b803d){_0x47dacc[_0xedd9('0x3a')]=_['keys'](db[_0xedd9('0x57')][_0xedd9('0x33')]);_0x47dacc[_0xedd9('0x37')]=_[_0xedd9('0x4a')](_0x5d917e[_0xedd9('0x37')]);_0x47dacc[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x47dacc['model'],_0x47dacc['query']);_0x4ea62d[_0xedd9('0x3c')]=_[_0xedd9('0x39')](_0x47dacc['model'],qs[_0xedd9('0x3b')](_0x5d917e[_0xedd9('0x37')]['fields']));_0x4ea62d[_0xedd9('0x3c')]=_0x4ea62d[_0xedd9('0x3c')]['length']?_0x4ea62d[_0xedd9('0x3c')]:_0x47dacc[_0xedd9('0x3a')];if(!_0x5d917e[_0xedd9('0x37')][_0xedd9('0x3d')](_0xedd9('0x3e'))){_0x4ea62d[_0xedd9('0x25')]=qs[_0xedd9('0x25')](_0x5d917e[_0xedd9('0x37')]['limit']);_0x4ea62d['offset']=qs['offset'](_0x5d917e[_0xedd9('0x37')][_0xedd9('0x24')]);}_0x4ea62d[_0xedd9('0x3f')]=qs['sort'](_0x5d917e['query']['sort']);_0x4ea62d[_0xedd9('0x40')]=qs[_0xedd9('0x38')](_[_0xedd9('0x41')](_0x5d917e['query'],_0x47dacc['filters']));_0x4ea62d[_0xedd9('0x40')][_0xedd9('0x56')]=_0x5b803d['id'];if(_0x5d917e['query'][_0xedd9('0x42')]){_0x4ea62d[_0xedd9('0x40')]=_[_0xedd9('0x43')](_0x4ea62d[_0xedd9('0x40')],{'$or':_[_0xedd9('0x36')](_0x4ea62d[_0xedd9('0x3c')],function(_0x28bc05){var _0x31884f={};_0x31884f[_0x28bc05]={'$like':'%'+_0x5d917e['query'][_0xedd9('0x42')]+'%'};return _0x31884f;})});}_0x4ea62d=_[_0xedd9('0x43')]({},_0x4ea62d,_0x5d917e[_0xedd9('0x44')]);return db[_0xedd9('0x57')]['count']({'where':_0x4ea62d[_0xedd9('0x40')]})['then'](function(_0x735158){_0x567a67[_0xedd9('0x26')]=_0x735158;if(_0x5d917e[_0xedd9('0x37')][_0xedd9('0x45')]){_0x4ea62d[_0xedd9('0x46')]=[{'all':!![]}];}return db['Disposition'][_0xedd9('0x5a')](_0x4ea62d);})[_0xedd9('0x16')](function(_0x280f64){_0x567a67['rows']=_0x280f64;return _0x567a67;});}})[_0xedd9('0x16')](respondWithFilteredResult(_0x147ed2,_0x4ea62d))['catch'](handleError(_0x147ed2,null));};exports['removeDispositions']=function(_0x95f2a2,_0x29b479){return db[_0xedd9('0x32')]['find']({'where':{'id':_0x95f2a2[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x29b479,null))['then'](function(_0x543eab){if(_0x543eab){return _0x543eab['removeDispositions'](_0x95f2a2[_0xedd9('0x37')][_0xedd9('0x5b')]);}})[_0xedd9('0x16')](respondWithStatusCode(_0x29b479,null))[_0xedd9('0x1f')](handleError(_0x29b479,null));};exports[_0xedd9('0x5c')]=function(_0x581862,_0x531c50){if(_0x581862[_0xedd9('0x4e')]['id']){delete _0x581862[_0xedd9('0x4e')]['id'];}return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0x581862['params']['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x531c50,null))[_0xedd9('0x16')](function(_0x11e838){if(_0x11e838){_0x581862[_0xedd9('0x4e')][_0xedd9('0x56')]=_0x11e838['id'];return db[_0xedd9('0x5d')]['create'](_0x581862['body']);}})[_0xedd9('0x16')](respondWithResult(_0x531c50,null))[_0xedd9('0x1f')](handleError(_0x531c50,null));};exports[_0xedd9('0x5e')]=function(_0x58b188,_0x44dffb){var _0x5dbf16={'raw':![],'where':{}};var _0x3a5856={};var _0x5e29d9={'count':0x0,'rows':[]};return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0x58b188['params']['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x44dffb,null))[_0xedd9('0x16')](function(_0x43ebc0){if(_0x43ebc0){_0x3a5856[_0xedd9('0x3a')]=_[_0xedd9('0x4a')](db[_0xedd9('0x5d')][_0xedd9('0x33')]);_0x3a5856['query']=_['keys'](_0x58b188['query']);_0x3a5856[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x3a5856[_0xedd9('0x3a')],_0x3a5856[_0xedd9('0x37')]);_0x5dbf16['attributes']=_['intersection'](_0x3a5856[_0xedd9('0x3a')],qs['fields'](_0x58b188[_0xedd9('0x37')][_0xedd9('0x3b')]));_0x5dbf16[_0xedd9('0x3c')]=_0x5dbf16['attributes'][_0xedd9('0x4b')]?_0x5dbf16['attributes']:_0x3a5856[_0xedd9('0x3a')];if(!_0x58b188[_0xedd9('0x37')]['hasOwnProperty'](_0xedd9('0x3e'))){_0x5dbf16[_0xedd9('0x25')]=qs['limit'](_0x58b188[_0xedd9('0x37')]['limit']);_0x5dbf16[_0xedd9('0x24')]=qs[_0xedd9('0x24')](_0x58b188[_0xedd9('0x37')]['offset']);}_0x5dbf16[_0xedd9('0x3f')]=qs['sort'](_0x58b188[_0xedd9('0x37')][_0xedd9('0x5f')]);_0x5dbf16[_0xedd9('0x40')]=qs['filters'](_[_0xedd9('0x41')](_0x58b188['query'],_0x3a5856[_0xedd9('0x38')]));_0x5dbf16[_0xedd9('0x40')][_0xedd9('0x56')]=_0x43ebc0['id'];if(_0x58b188[_0xedd9('0x37')][_0xedd9('0x42')]){_0x5dbf16[_0xedd9('0x40')]=_['merge'](_0x5dbf16[_0xedd9('0x40')],{'$or':_[_0xedd9('0x36')](_0x5dbf16[_0xedd9('0x3c')],function(_0x821821){var _0x3683b3={};_0x3683b3[_0x821821]={'$like':'%'+_0x58b188[_0xedd9('0x37')]['filter']+'%'};return _0x3683b3;})});}_0x5dbf16=_[_0xedd9('0x43')]({},_0x5dbf16,_0x58b188[_0xedd9('0x44')]);return db[_0xedd9('0x5d')][_0xedd9('0x26')]({'where':_0x5dbf16['where']})[_0xedd9('0x16')](function(_0x366be3){_0x5e29d9[_0xedd9('0x26')]=_0x366be3;if(_0x58b188[_0xedd9('0x37')]['includeAll']){_0x5dbf16[_0xedd9('0x46')]=[{'all':!![]}];}return db[_0xedd9('0x5d')][_0xedd9('0x5a')](_0x5dbf16);})[_0xedd9('0x16')](function(_0x12f645){_0x5e29d9['rows']=_0x12f645;return _0x5e29d9;});}})[_0xedd9('0x16')](respondWithFilteredResult(_0x44dffb,_0x5dbf16))[_0xedd9('0x1f')](handleError(_0x44dffb,null));};exports[_0xedd9('0x60')]=function(_0x3247f9,_0x4e6b14){return db['ChatWebsite'][_0xedd9('0x4c')]({'where':{'id':_0x3247f9[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x4e6b14,null))[_0xedd9('0x16')](function(_0x487189){if(_0x487189){return _0x487189[_0xedd9('0x60')](_0x3247f9[_0xedd9('0x37')]['ids']);}})[_0xedd9('0x16')](respondWithStatusCode(_0x4e6b14,null))[_0xedd9('0x1f')](handleError(_0x4e6b14,null));};exports[_0xedd9('0x61')]=function(_0x31944d,_0x33e51b){_0x31944d[_0xedd9('0x4e')]['sitepic']=_0x31944d[_0xedd9('0x62')][_0xedd9('0x63')];return db['ChatWebsite']['find']({'where':{'id':_0x31944d[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x33e51b,null))[_0xedd9('0x16')](saveUpdates(_0x31944d['body'],null))['then'](respondWithResult(_0x33e51b,null))[_0xedd9('0x1f')](handleError(_0x33e51b,null));};exports[_0xedd9('0x64')]=function(_0x15b904,_0xfde18e){_0x15b904['body'][_0xedd9('0x65')]=_0x15b904[_0xedd9('0x62')]['filename'];return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0x15b904[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0xfde18e,null))[_0xedd9('0x16')](saveUpdates(_0x15b904[_0xedd9('0x4e')],null))[_0xedd9('0x16')](respondWithResult(_0xfde18e,null))[_0xedd9('0x1f')](handleError(_0xfde18e,null));};exports['addCustomerAvatar']=function(_0x22db28,_0x32d1c2){_0x22db28[_0xedd9('0x4e')]['customerAvatar']=_0x22db28[_0xedd9('0x62')][_0xedd9('0x63')];return db['ChatWebsite'][_0xedd9('0x4c')]({'where':{'id':_0x22db28['params']['id']}})['then'](handleEntityNotFound(_0x32d1c2,null))[_0xedd9('0x16')](saveUpdates(_0x22db28[_0xedd9('0x4e')],null))[_0xedd9('0x16')](respondWithResult(_0x32d1c2,null))[_0xedd9('0x1f')](handleError(_0x32d1c2,null));};exports[_0xedd9('0x66')]=function(_0x4cde26,_0x1f6180){_0x4cde26[_0xedd9('0x4e')][_0xedd9('0x67')]=_0x4cde26['file']['filename'];return db[_0xedd9('0x32')]['find']({'where':{'id':_0x4cde26['params']['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x1f6180,null))[_0xedd9('0x16')](saveUpdates(_0x4cde26[_0xedd9('0x4e')],null))[_0xedd9('0x16')](respondWithResult(_0x1f6180,null))[_0xedd9('0x1f')](handleError(_0x1f6180,null));};exports[_0xedd9('0x68')]=function(_0x46c395,_0x1dbc7c){var _0x539d2a=path[_0xedd9('0x69')](config[_0xedd9('0x6a')],_0xedd9('0x6b'));var _0x4766d3={'where':{'id':_0x46c395[_0xedd9('0x49')]['id']},'attributes':['id',_0xedd9('0x6c')],'raw':!![]};var _0x1d2b9b=![];return require(_0xedd9('0x6d'))[_0xedd9('0x6e')]()[_0xedd9('0x16')](function(_0x42f96c){if(_0x42f96c){_0x1d2b9b=_0x42f96c[_0xedd9('0x6f')];}})[_0xedd9('0x16')](function(){return db[_0xedd9('0x32')]['find'](_0x4766d3);})[_0xedd9('0x16')](handleEntityNotFound(_0x1dbc7c,null))[_0xedd9('0x16')](function(_0x37404a){if(_0x37404a){if(!_['isNil'](_0x37404a[_0xedd9('0x6c')])){if(fs[_0xedd9('0x70')](path['join'](config[_0xedd9('0x6a')],'server/files/images/logos/',_0x37404a[_0xedd9('0x6c')]))&&_0x1d2b9b){_0x539d2a=path[_0xedd9('0x69')](config[_0xedd9('0x6a')],_0xedd9('0x71'),_0x37404a[_0xedd9('0x6c')]);}}return _0x1dbc7c[_0xedd9('0x72')](_0x539d2a);}})[_0xedd9('0x1f')](handleError(_0x1dbc7c,null));};exports[_0xedd9('0x73')]=function(_0xbd6c22,_0x294722){var _0x349afa=path['join'](config['root'],_0xedd9('0x74'));var _0x381ec6={'where':{'id':_0xbd6c22[_0xedd9('0x49')]['id']},'attributes':['id',_0xedd9('0x65')],'raw':!![]};return db[_0xedd9('0x32')][_0xedd9('0x4c')](_0x381ec6)[_0xedd9('0x16')](handleEntityNotFound(_0x294722,null))[_0xedd9('0x16')](function(_0x59087e){if(_0x59087e){if(!_[_0xedd9('0x75')](_0x59087e[_0xedd9('0x65')])){if(fs[_0xedd9('0x70')](path[_0xedd9('0x69')](config[_0xedd9('0x6a')],_0xedd9('0x76'),_0x59087e['agentAvatar']))){_0x349afa=path[_0xedd9('0x69')](config['root'],'server/files/images/avatars/',_0x59087e[_0xedd9('0x65')]);}}return _0x294722[_0xedd9('0x72')](_0x349afa);}})[_0xedd9('0x1f')](handleError(_0x294722,null));};exports[_0xedd9('0x77')]=function(_0x275b3d,_0x45f530){var _0x746857=path[_0xedd9('0x69')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x10f5af={'where':{'id':_0x275b3d[_0xedd9('0x49')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xedd9('0x32')][_0xedd9('0x4c')](_0x10f5af)[_0xedd9('0x16')](handleEntityNotFound(_0x45f530,null))[_0xedd9('0x16')](function(_0x307c39){if(_0x307c39){if(!_['isNil'](_0x307c39[_0xedd9('0x78')])){if(fs[_0xedd9('0x70')](path[_0xedd9('0x69')](config[_0xedd9('0x6a')],_0xedd9('0x76'),_0x307c39[_0xedd9('0x78')]))&&_0x307c39['showCustomerAvatar']){_0x746857=path['join'](config[_0xedd9('0x6a')],_0xedd9('0x76'),_0x307c39[_0xedd9('0x78')]);}}return _0x45f530['download'](_0x746857);}})['catch'](handleError(_0x45f530,null));};exports[_0xedd9('0x79')]=function(_0x2bd213,_0x2ba989){var _0x536b45=path['join'](config[_0xedd9('0x6a')],_0xedd9('0x7a'));var _0x304356={'where':{'id':_0x2bd213[_0xedd9('0x49')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xedd9('0x32')][_0xedd9('0x4c')](_0x304356)['then'](handleEntityNotFound(_0x2ba989,null))[_0xedd9('0x16')](function(_0x4f8795){if(_0x4f8795){if(!_[_0xedd9('0x75')](_0x4f8795['systemAvatar'])){if(fs[_0xedd9('0x70')](path['join'](config[_0xedd9('0x6a')],_0xedd9('0x76'),_0x4f8795[_0xedd9('0x67')]))){_0x536b45=path[_0xedd9('0x69')](config['root'],_0xedd9('0x76'),_0x4f8795[_0xedd9('0x67')]);}}return _0x2ba989[_0xedd9('0x72')](_0x536b45);}})[_0xedd9('0x1f')](handleError(_0x2ba989,null));};exports[_0xedd9('0x7b')]=function(_0x4f307c,_0xb6bd0c){var _0x2796cd=require(_0xedd9('0x7c'));var _0x1926cb=new _0x2796cd();var _0x529ea2=_0x1926cb['setUA'](_0x4f307c[_0xedd9('0x7d')][_0xedd9('0x7e')])[_0xedd9('0x7f')]();var _0x396e76={'body':_0x4f307c[_0xedd9('0x4e')],'channel':_0xedd9('0x80')};var _0x40f7c3=[];var _0x389cc9=[];var _0x41a4df={};var _0x28dc61=![];return db[_0xedd9('0x81')][_0xedd9('0x54')]()[_0xedd9('0x16')](function(_0x426599){if(!_0x426599){throw new db[(_0xedd9('0x82'))][(_0xedd9('0x83'))]('no\x20available\x20attributes');}_0x40f7c3=_[_0xedd9('0x84')](_[_0xedd9('0x4a')](_0x426599),[_0xedd9('0x85'),_0xedd9('0x86')]);_0x389cc9=_[_0xedd9('0x84')](_[_0xedd9('0x4a')](_0x426599),[_0xedd9('0x85'),_0xedd9('0x86'),'CompanyId','ListId']);if(_0x4f307c[_0xedd9('0x4e')]['id']){delete _0x4f307c[_0xedd9('0x4e')]['id'];}if(_[_0xedd9('0x75')](_0x4f307c['body'][_0xedd9('0x87')])){throw new db[(_0xedd9('0x82'))]['ValidationError'](_0xedd9('0x88'));}if(_[_0xedd9('0x75')](_0x4f307c['body'][_0xedd9('0x4e')])||_0x4f307c[_0xedd9('0x4e')][_0xedd9('0x4e')]===''){throw new db[(_0xedd9('0x82'))][(_0xedd9('0x83'))](_0xedd9('0x89'));}if(_[_0xedd9('0x75')](_0x4f307c['body'][_0xedd9('0x8a')])){throw new db[(_0xedd9('0x82'))][(_0xedd9('0x83'))](_0xedd9('0x8b')+_0x389cc9);}if(!_[_0xedd9('0x8c')](_0x389cc9,_0x4f307c[_0xedd9('0x4e')][_0xedd9('0x8a')])){throw new db[(_0xedd9('0x82'))][(_0xedd9('0x83'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x389cc9);}_0x41a4df[_0x4f307c[_0xedd9('0x4e')][_0xedd9('0x8a')]]=_0x4f307c['body'][_0xedd9('0x87')];})['then'](function(){return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0x4f307c[_0xedd9('0x49')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xedd9('0x8d'),'where':_0x41a4df,'limit':0x1,'order':[[_0xedd9('0x86'),_0xedd9('0x8e')]]}]},{'model':db[_0xedd9('0x8f')],'as':'Applications'}]});})[_0xedd9('0x16')](handleEntityNotFound(_0xb6bd0c,null))['then'](function(_0x45f60b){if(_0x45f60b&&_0x45f60b[_0xedd9('0x90')]){_0x396e76[_0xedd9('0x91')]=_0x45f60b;_0x396e76[_0xedd9('0x92')]=_0x45f60b[_0xedd9('0x93')];_0x396e76[_0xedd9('0x94')]=_0x45f60b[_0xedd9('0x90')];_0x396e76[_0xedd9('0x92')]=_[_0xedd9('0x95')](_0x396e76['applications'],[_0xedd9('0x96')],['asc']);if(_0x396e76[_0xedd9('0x91')][_0xedd9('0x93')]){delete _0x396e76['account'][_0xedd9('0x93')];}if(_0x396e76[_0xedd9('0x91')][_0xedd9('0x90')]&&_0x396e76['account'][_0xedd9('0x90')][_0xedd9('0x8d')][_0xedd9('0x4b')]){return _0x396e76[_0xedd9('0x91')][_0xedd9('0x90')][_0xedd9('0x8d')][0x0];}var _0x150595=_['defaults'](_0x4f307c[_0xedd9('0x4e')],{'firstName':_0x4f307c[_0xedd9('0x4e')][_0xedd9('0x87')],'ListId':_0x45f60b['ListId']});_0x150595[_0x4f307c[_0xedd9('0x4e')]['mapKey']]=_0x4f307c['body'][_0xedd9('0x87')];return db[_0xedd9('0x81')][_0xedd9('0x4d')](_0x150595,{'fields':_0x40f7c3,'raw':!![]});}})[_0xedd9('0x16')](handleEntityNotFound(_0xb6bd0c,null))[_0xedd9('0x16')](function(_0x217909){_0x396e76[_0xedd9('0x97')]=_0x217909;var _0x2b5e32=_0x4f307c[_0xedd9('0x4e')][_0xedd9('0x98')];if(_0x4f307c[_0xedd9('0x7d')][_0xedd9('0x99')]){_0x2b5e32=_0x4f307c['headers'][_0xedd9('0x99')];}else if(_0x4f307c[_0xedd9('0x7d')][_0xedd9('0x9a')]){_0x2b5e32=_[_0xedd9('0x9b')](_0x4f307c[_0xedd9('0x7d')][_0xedd9('0x9a')][_0xedd9('0x9c')](','));}if(_0x217909){var _0x25d59b={'ContactId':_0x217909['id'],'ChatWebsiteId':_0x4f307c['params']['id'],'from':(_0x217909['firstName']||'')+'\x20'+(_0x217909[_0xedd9('0x9d')]||''),'customerIp':_0x2b5e32,'customerPort':_0x4f307c[_0xedd9('0x7d')][_0xedd9('0x9e')]?_0x4f307c['headers'][_0xedd9('0x9e')]:null,'referer':_0x4f307c[_0xedd9('0x4e')]['referer'],'browserName':_0x529ea2[_0xedd9('0x9f')][_0xedd9('0x2d')]&&_0x529ea2[_0xedd9('0x9f')][_0xedd9('0xa0')]?util[_0xedd9('0xa1')](_0xedd9('0xa2'),_0x529ea2[_0xedd9('0x9f')][_0xedd9('0x2d')],_0x529ea2['browser'][_0xedd9('0xa0')]):_0xedd9('0xa3'),'browserVersion':_0x529ea2[_0xedd9('0x9f')][_0xedd9('0xa0')]||'unknown','osName':util['format'](_0xedd9('0xa2'),_0x529ea2['os'][_0xedd9('0x2d')],_0x529ea2['os']['version']),'osVersion':_0x529ea2['os'][_0xedd9('0xa0')],'deviceModel':_0x529ea2[_0xedd9('0xa4')][_0xedd9('0x3a')]&&_0x529ea2[_0xedd9('0xa4')][_0xedd9('0xa5')]?util[_0xedd9('0xa1')](_0xedd9('0xa6'),_0x529ea2[_0xedd9('0xa4')]['model'],_0x529ea2[_0xedd9('0xa4')][_0xedd9('0xa5')],_0x529ea2[_0xedd9('0xa4')][_0xedd9('0x35')]):null,'deviceVendor':_0x529ea2[_0xedd9('0xa4')][_0xedd9('0xa5')],'deviceType':_0x529ea2['device'][_0xedd9('0x35')],'formData':JSON[_0xedd9('0xa7')](_0x4f307c[_0xedd9('0x4e')])};var _0x5202c9={'ChatWebsiteId':_0x4f307c[_0xedd9('0x49')]['id'],'closed':![]};if(_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xa8')]){_0x5202c9[_0xedd9('0xa8')]=_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xa8')];return db['ChatInteraction'][_0xedd9('0x4c')]({'where':_0x5202c9})[_0xedd9('0x16')](function(_0x1bbc44){if(_0x1bbc44){return[_0x1bbc44,![]];}_0x25d59b[_0xedd9('0xa8')]=_0x4f307c['body'][_0xedd9('0xa8')];_0x25d59b['externalUrl']=_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xa9')];return db[_0xedd9('0xaa')][_0xedd9('0x4d')](_0x25d59b)[_0xedd9('0x16')](function(_0x1003a9){return[_0x1003a9,!![]];});});}_0x5202c9[_0xedd9('0xab')]=_0x217909['id'];if(_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xac')]&&_0x4f307c[_0xedd9('0x4e')]['interaction']['id']){_0x5202c9['id']=_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xac')]['id'];return db[_0xedd9('0xaa')][_0xedd9('0x4c')]({'where':_0x5202c9})['then'](function(_0x549783){if(_0x549783){return[_0x549783,![]];}return db[_0xedd9('0xaa')]['create'](_0x25d59b)['then'](function(_0x816483){return[_0x816483,!![]];});});}return db['ChatInteraction'][_0xedd9('0x4d')](_0x25d59b)['then'](function(_0x204747){return[_0x204747,!![]];});}})[_0xedd9('0xad')](function(_0x45eb99,_0x14e40a){if(_0x45eb99){_0x28dc61=_0x14e40a;if(!_0x14e40a){var _0xb54bf={'from':(_0x396e76[_0xedd9('0x97')][_0xedd9('0xae')]||'')+'\x20'+(_0x396e76['contact']['lastName']||'')};if(_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xa8')]&&_0x4f307c['body'][_0xedd9('0xaf')]&&_0x4f307c[_0xedd9('0x4e')]['threadId']!=_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xaf')]){_0xb54bf[_0xedd9('0xa8')]=_0x4f307c[_0xedd9('0x4e')][_0xedd9('0xaf')];}return _0x45eb99[_0xedd9('0xb0')](_0xb54bf);}else{return _0x45eb99;}}})[_0xedd9('0x16')](function(_0x2e4c85){_0x396e76['interaction']=_0x2e4c85[_0xedd9('0x50')]({'plain':!![]});_0x396e76[_0xedd9('0xac')]['created']=_0x28dc61;if(_0x396e76[_0xedd9('0xac')][_0xedd9('0xb1')]){if(_0x396e76['account'][_0xedd9('0xb2')]){_0x396e76[_0xedd9('0x92')][_0xedd9('0xb3')]({'id':0x0,'priority':_0x396e76[_0xedd9('0x92')]['length']+0x1,'app':_0xedd9('0xb4'),'appdata':_0xedd9('0xb5'),'interval':_0xedd9('0xb6')});}}return db[_0xedd9('0xb7')][_0xedd9('0x4d')]({'body':_0x4f307c['body'][_0xedd9('0x4e')],'ChatWebsiteId':_0x4f307c['params']['id'],'ChatInteractionId':_0x2e4c85['id'],'direction':'in','ContactId':_0x396e76['contact']['id'],'AttachmentId':_0x4f307c['body'][_0xedd9('0xb8')]});})[_0xedd9('0x16')](function(_0x19bca1){_0x396e76[_0xedd9('0x1c')]=_0x19bca1;if(_0x396e76[_0xedd9('0xac')][_0xedd9('0xb9')]){return db[_0xedd9('0xba')]['find']({'attributes':['id','name'],'where':{'id':_0x396e76[_0xedd9('0xac')]['UserId']}})['then'](function(_0x2f95cd){if(_0x2f95cd){_0x396e76[_0xedd9('0x92')][_0xedd9('0xbb')]({'id':0x0,'priority':0x0,'app':_0xedd9('0xbc'),'appdata':_0x2f95cd[_0xedd9('0x2d')]+','+(_0x396e76[_0xedd9('0x91')][_0xedd9('0xbd')]||0xa),'interval':_0xedd9('0xb6')});_0x396e76[_0xedd9('0xbe')]=!![];}return respondWithRpcPromise(_0xedd9('0xbf'),_0xedd9('0xc0'),_0x396e76);});}return respondWithRpcPromise(_0xedd9('0xbf'),_0xedd9('0xc0'),_0x396e76);})[_0xedd9('0x16')](function(_0x1973ae){respondWithRpcPromise(_0xedd9('0xc1'),_0xedd9('0xc1'),{'event':_0xedd9('0x7b'),'message':_0x1973ae},client9002);return _0x1973ae;})[_0xedd9('0x16')](respondWithResult(_0xb6bd0c,null))[_0xedd9('0x1f')](handleError(_0xb6bd0c,null));};exports[_0xedd9('0xc2')]=function(_0x3df69b,_0x377f98){var _0x2c0e34,_0x28ae5c,_0x3289db;var _0x5bf346=[];var _0xf56ced={};var _0x27febf=_0x3df69b[_0xedd9('0xc3')]||[];var _0x56132f=[];var _0x292644;return db[_0xedd9('0x81')][_0xedd9('0x54')]()[_0xedd9('0x16')](function(_0x119a45){if(!_0x119a45){throw new db['Sequelize'][(_0xedd9('0x83'))]('no\x20available\x20attributes');}_0x5bf346=_[_0xedd9('0x84')](_[_0xedd9('0x4a')](_0x119a45),[_0xedd9('0x85'),'updatedAt',_0xedd9('0xc4'),_0xedd9('0xc5')]);if(_0x3df69b[_0xedd9('0x4e')]['id']){delete _0x3df69b[_0xedd9('0x4e')]['id'];}if(_[_0xedd9('0x75')](_0x3df69b[_0xedd9('0x4e')][_0xedd9('0x87')])){throw _0x377f98[_0xedd9('0x21')](0x1f4)[_0xedd9('0x2e')](new db[(_0xedd9('0x82'))][(_0xedd9('0x83'))]('from\x20is\x20mandatory'));}if(_[_0xedd9('0x75')](_0x3df69b[_0xedd9('0x4e')][_0xedd9('0x4e')])||_0x3df69b['body']['body']===''){throw _0x377f98[_0xedd9('0x21')](0x1f4)[_0xedd9('0x2e')](new db['Sequelize'][(_0xedd9('0x83'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x3df69b[_0xedd9('0x4e')][_0xedd9('0xc6')])){throw _0x377f98[_0xedd9('0x21')](0x1f4)[_0xedd9('0x2e')](new db[(_0xedd9('0x82'))][(_0xedd9('0x83'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5bf346));}if(!_[_0xedd9('0x8c')](_0x5bf346,_0x3df69b['body'][_0xedd9('0xc6')])){throw _0x377f98[_0xedd9('0x21')](0x1f4)[_0xedd9('0x2e')](new db[(_0xedd9('0x82'))][(_0xedd9('0x83'))](_0xedd9('0xc7')+_0x5bf346));}_0xf56ced[_0x3df69b[_0xedd9('0x4e')][_0xedd9('0xc6')]]=_0x3df69b['body'][_0xedd9('0x87')];})[_0xedd9('0x16')](function(){return db[_0xedd9('0x32')]['find']({'where':{'id':_0x3df69b[_0xedd9('0x49')]['id']},'include':[{'model':db[_0xedd9('0xc8')],'as':'List'},{'model':db[_0xedd9('0xc9')],'as':_0xedd9('0xc9')}]});})[_0xedd9('0x16')](handleEntityNotFound(_0x377f98,null))[_0xedd9('0x16')](function(_0x2362b8){if(_0x2362b8&&_0x2362b8[_0xedd9('0x90')]){_0x28ae5c=_0x2362b8;var _0x408edd=_[_0xedd9('0xe')](_0x3df69b[_0xedd9('0x4e')],{'firstName':_0x3df69b[_0xedd9('0x4e')]['from'],'phone':_0x3df69b[_0xedd9('0x4e')]['from'],'ListId':_0x2362b8[_0xedd9('0xc5')]});_0x408edd[_0x3df69b[_0xedd9('0x4e')][_0xedd9('0xc6')]]=_0x3df69b['body'][_0xedd9('0x87')];return db['CmContact'][_0xedd9('0xca')]({'where':_0xf56ced,'defaults':_0x408edd});}})['spread'](function(_0x22fa6a){if(_0x22fa6a){_0x3289db=_0x22fa6a;var _0x5646a9=fs[_0xedd9('0xcb')](path[_0xedd9('0x69')](config[_0xedd9('0x6a')],'server/files/templates/chatOfflineMessage.ejs'),_0xedd9('0xcc'));var _0xe92e4f=ejs[_0xedd9('0xcd')](_0x5646a9,{'body':_[_0xedd9('0xce')](_0x3df69b['body'][_0xedd9('0x4e')]),'bodyTitle':_0x28ae5c[_0xedd9('0xcf')]});return db[_0xedd9('0xd0')]['create']({'body':_0xe92e4f,'plainBody':htmlToText[_0xedd9('0xd1')](_0xe92e4f),'ContactId':_0x22fa6a['id'],'ChatWebsiteId':_0x28ae5c['id']});}})[_0xedd9('0x16')](function(_0x4d260d){_0x292644=_0x4d260d;if(_0x27febf[_0xedd9('0x4b')]){var _0x5f0fa1=_0x27febf[_0xedd9('0x36')](function(_0x5039af){return{'name':_0x5039af[_0xedd9('0xd2')],'basename':_0x5039af[_0xedd9('0x63')],'type':_0x5039af['mimetype'],'ChatOfflineMessageId':_0x4d260d['id']};});_0x56132f=_0x5f0fa1[_0xedd9('0x36')](_0x2b7034=>{var _0x17db15={'filename':_0x2b7034['name'],'path':path[_0xedd9('0x69')](config[_0xedd9('0x6a')],_0xedd9('0xd3'),_0xedd9('0xc3'),_0xedd9('0xd4'),_0xedd9('0xd5'),_0x2b7034[_0xedd9('0xd6')])};return _0x17db15;});if(!_0x28ae5c[_0xedd9('0xd7')]){return db[_0xedd9('0xd8')][_0xedd9('0xd9')](function(_0x13aaad){return db['Attachment'][_0xedd9('0xda')](_0x5f0fa1,{'transaction':_0x13aaad});});}}})[_0xedd9('0x16')](function(){if(_0x292644){_0x2c0e34=_0x292644;return db[_0xedd9('0xc9')][_0xedd9('0x59')]({'where':{'service':!![]},'include':[{'model':db[_0xedd9('0xdb')],'as':_0xedd9('0xdc'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xedd9('0xdd'),'raw':!![]}]}]});}})[_0xedd9('0x16')](function(_0x4ab589){if(_0x4ab589&&_0x4ab589[_0xedd9('0xdc')]&&_0x28ae5c[_0xedd9('0xde')]&&_0x28ae5c['forwardOfflineAddress']){var _0x43d25d=_0x4ab589['getSmtpOptions']();return respondWithRpcPromise(_0xedd9('0xdf'),'sendMail',{'account':_0x43d25d,'message':{'from':util['format'](_0xedd9('0xe0'),_0x4ab589[_0xedd9('0x2d')],_0x4ab589['email']||_0x4ab589[_0xedd9('0xdc')][_0xedd9('0x4f')]),'to':_0x28ae5c['forwardOfflineAddress'],'subject':_0x28ae5c['offlineMessageSubject'],'html':_0x2c0e34[_0xedd9('0x4e')],'attachments':_0x56132f}},client9003)['then'](function(){return _0x2c0e34;})[_0xedd9('0x1f')](function(_0x24edf2){logger[_0xedd9('0x19')](_0x24edf2);});}})[_0xedd9('0x16')](function(){if(_0x28ae5c&&_0x28ae5c[_0xedd9('0xd7')]&&_0x28ae5c[_0xedd9('0xe1')]){var _0x50d9cf=[];if(_0x27febf[_0xedd9('0x4b')]){_0x50d9cf=_0x27febf[_0xedd9('0x36')](function(_0x2bdea8){return{'name':_0x2bdea8[_0xedd9('0xd2')],'basename':_0x2bdea8[_0xedd9('0x63')],'type':_0x2bdea8[_0xedd9('0xe2')],'ChatOfflineMessageId':_0x292644['id']};});}var _0x48244c;if(!_[_0xedd9('0x75')](_0x28ae5c[_0xedd9('0xe3')])){var _0x453658=_[_0xedd9('0x36')](_0x3df69b[_0xedd9('0x4e')],function(_0x4958b9){return _0x4958b9;});var _0x5eab33=_[_0xedd9('0xe4')](_0x453658)[0x0];var _0xaa8be5=_[_0xedd9('0xe5')](_0x5eab33,function(_0x43f329){return _0x43f329;});_0x48244c=_0xaa8be5[0x1][_0x28ae5c['subjectOffline']];}var _0x822916={'from':_0x3289db[_0xedd9('0xe6')],'firstName':_0x3289db[_0xedd9('0xae')],'lastName':_0x3289db[_0xedd9('0x9d')],'mapKey':_0xedd9('0xe6'),'message':{'from':_0x3289db[_0xedd9('0xe6')],'to':_0x28ae5c[_0xedd9('0xc9')][_0xedd9('0xe6')],'cc':'','subject':_[_0xedd9('0x75')](_0x48244c)?_0x28ae5c['offlineMessageSubject']:_0x48244c,'messageId':'','sentAt':new Date(),'attach':_0x50d9cf['length'],'attachments':_0x50d9cf,'originChannel':_0xedd9('0xe7'),'ChatWebsiteId':_0x28ae5c['id'],'ChatOfflineMessageId':_0x2c0e34['id'],'originTo':_0x28ae5c['MailAccount']['email']},'body':_0x2c0e34['body']};var _0x23d6e1={'account':{'id':_0x28ae5c[_0xedd9('0xe1')]},'body':_0x822916,'log':_0xedd9('0xe8')};return respondWithRpcPromise(_0xedd9('0xe8'),_0xedd9('0xe9'),_0x23d6e1,client9001)[_0xedd9('0x16')](function(){return _0x2c0e34;})[_0xedd9('0x1f')](function(_0x2aeedd){logger[_0xedd9('0x19')](_0x2aeedd);});}return;})[_0xedd9('0x16')](function(){if(_0x2c0e34){return _0x2c0e34;}})[_0xedd9('0x16')](respondWithResult(_0x377f98,null))[_0xedd9('0x1f')](function(_0x30365a){logger[_0xedd9('0x19')](_0xedd9('0x1f'),_0x30365a);for(var _0x24eff7 of _0x27febf){var _0x4a0187=path[_0xedd9('0x69')](config['root'],_0xedd9('0xd3'),'files',_0xedd9('0xd4'),'offline-chat',_0x24eff7[_0xedd9('0x63')]);fs_extra[_0xedd9('0xea')](_0x4a0187)['catch'](function(_0x47e88a){logger[_0xedd9('0x19')](_0xedd9('0xeb'),_0x4a0187,_0x47e88a);});}});};exports[_0xedd9('0xec')]=function(_0x1848a6,_0x2058a1){return db[_0xedd9('0xaa')]['find']({'where':{'id':_0x1848a6[_0xedd9('0x49')]['id']}})['then'](handleEntityNotFound(_0x2058a1,null))[_0xedd9('0x16')](function(_0x463a87){if(_0x463a87){return _0x463a87['addInteraction'](_0x1848a6[_0xedd9('0x4e')][_0xedd9('0x5b')],_[_0xedd9('0xed')](_0x1848a6[_0xedd9('0x4e')],['ids','id'])||{});}})[_0xedd9('0x16')](respondWithResult(_0x2058a1,null))[_0xedd9('0x1f')](handleError(_0x2058a1,null));};exports[_0xedd9('0xee')]=function(_0x49a933,_0xcac85){var _0x4dfec0={'raw':![],'where':{}};var _0x52bdba={};var _0x30c575={'count':0x0,'rows':[]};return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0x49a933[_0xedd9('0x49')]['id']}})['then'](handleEntityNotFound(_0xcac85,null))['then'](function(_0x9d1bd4){if(_0x9d1bd4){_0x52bdba[_0xedd9('0x3a')]=_[_0xedd9('0x4a')](db[_0xedd9('0xaa')][_0xedd9('0x33')]);_0x52bdba[_0xedd9('0x37')]=_[_0xedd9('0x4a')](_0x49a933[_0xedd9('0x37')]);_0x52bdba[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x52bdba[_0xedd9('0x3a')],_0x52bdba['query']);_0x4dfec0[_0xedd9('0x3c')]=_[_0xedd9('0x39')](_0x52bdba[_0xedd9('0x3a')],qs[_0xedd9('0x3b')](_0x49a933[_0xedd9('0x37')][_0xedd9('0x3b')]));_0x4dfec0[_0xedd9('0x3c')]=_0x4dfec0['attributes'][_0xedd9('0x4b')]?_0x4dfec0[_0xedd9('0x3c')]:_0x52bdba[_0xedd9('0x3a')];if(!_0x49a933[_0xedd9('0x37')][_0xedd9('0x3d')](_0xedd9('0x3e'))){_0x4dfec0[_0xedd9('0x25')]=qs['limit'](_0x49a933['query'][_0xedd9('0x25')]);_0x4dfec0[_0xedd9('0x24')]=qs['offset'](_0x49a933[_0xedd9('0x37')]['offset']);}_0x4dfec0[_0xedd9('0x3f')]=qs[_0xedd9('0x5f')](_0x49a933[_0xedd9('0x37')]['sort']);_0x4dfec0[_0xedd9('0x40')]=qs[_0xedd9('0x38')](_[_0xedd9('0x41')](_0x49a933['query'],_0x52bdba[_0xedd9('0x38')]));_0x4dfec0[_0xedd9('0x40')]['ChatWebsiteId']=_0x9d1bd4['id'];if(_0x49a933[_0xedd9('0x37')][_0xedd9('0x42')]){_0x4dfec0[_0xedd9('0x40')]=_[_0xedd9('0x43')](_0x4dfec0[_0xedd9('0x40')],{'$or':_['map'](_0x4dfec0[_0xedd9('0x3c')],function(_0x20c28c){var _0x20e378={};_0x20e378[_0x20c28c]={'$like':'%'+_0x49a933['query']['filter']+'%'};return _0x20e378;})});}_0x4dfec0=_[_0xedd9('0x43')]({},_0x4dfec0,_0x49a933[_0xedd9('0x44')]);return db[_0xedd9('0xaa')][_0xedd9('0x26')]({'where':_0x4dfec0[_0xedd9('0x40')]})[_0xedd9('0x16')](function(_0x21d2b4){_0x30c575['count']=_0x21d2b4;if(_0x49a933[_0xedd9('0x37')][_0xedd9('0x45')]){_0x4dfec0[_0xedd9('0x46')]=[{'model':db[_0xedd9('0x81')],'as':_0xedd9('0xef'),'required':![]},{'model':db[_0xedd9('0xba')],'as':_0xedd9('0xf0'),'attributes':['name','fullname',_0xedd9('0xf1')],'required':![]},{'model':db[_0xedd9('0xf2')],'as':_0xedd9('0xf3'),'attributes':['id',_0xedd9('0x2d'),'color'],'where':_0x49a933[_0xedd9('0x37')][_0xedd9('0xf4')]?{'id':_0x49a933['query'][_0xedd9('0xf4')]}:undefined,'required':_0x49a933[_0xedd9('0x37')][_0xedd9('0xf4')]?!![]:![]}];}return db[_0xedd9('0xaa')][_0xedd9('0x5a')](_0x4dfec0);})[_0xedd9('0x16')](function(_0x476d00){_0x30c575['rows']=_0x476d00;return _0x30c575;});}})[_0xedd9('0x16')](respondWithFilteredResult(_0xcac85,_0x4dfec0))[_0xedd9('0x1f')](handleError(_0xcac85,null));};function iftimePromise(_0x2ffc41,_0x440d4b){return respondWithRpcPromise(_0xedd9('0xf5'),'getSnippet',{'command':_0x440d4b[_0xedd9('0xf6')]?util[_0xedd9('0xa1')](_0xedd9('0xf7'),_0x2ffc41[_0xedd9('0xf8')],_0x440d4b[_0xedd9('0xf6')]):util[_0xedd9('0xa1')]('iftime\x20%s',_0x2ffc41[_0xedd9('0xf8')])},client9002)[_0xedd9('0x16')](function(_0x2d994b){var _0x3addc2=_0x2d994b&&_0x2d994b[_0xedd9('0xf9')]('true')>=0x0?!![]:![];logger[_0xedd9('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x440d4b['id'],_0x2ffc41['id'],_0x2ffc41[_0xedd9('0xf8')],_0x3addc2?_0xedd9('0xfa'):_0xedd9('0xfb'),_0x440d4b[_0xedd9('0xf6')]?_0x440d4b[_0xedd9('0xf6')]:_0xedd9('0xfc'));return _0x3addc2;})['catch'](function(_0x532ae0){logger[_0xedd9('0x19')](_0xedd9('0xfd'),_0x440d4b['id'],_0x2ffc41['id'],_0x2ffc41[_0xedd9('0xf8')],util[_0xedd9('0xfe')](_0x532ae0,{'showHidden':![],'depth':null}),_0x440d4b[_0xedd9('0xf6')]?_0x440d4b[_0xedd9('0xf6')]:_0xedd9('0xfc'));return![];});}exports[_0xedd9('0xff')]=function(_0x2e6b81,_0x5789bc){var _0x91f39=0x0;var _0x16f31c=0x0;var _0x2a040c=![];var _0x108582;var _0x13f0ad;return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0x2e6b81[_0xedd9('0x49')]['id']},'include':[{'model':db['Interval'],'as':_0xedd9('0x100'),'include':[{'model':db[_0xedd9('0x100')],'as':_0xedd9('0x101'),'attributes':['id',_0xedd9('0xf8')],'raw':!![]}]}]})[_0xedd9('0x16')](handleEntityNotFound(_0x5789bc,null))[_0xedd9('0x16')](function(_0x2548cd){if(_0x2548cd){_0x108582=_0x2548cd;return _0x2548cd[_0xedd9('0x102')]({'raw':!![]});}})['then'](function(_0x4ab00a){if(_0x108582){if(_0x4ab00a){_0x13f0ad=_0x4ab00a;}}return require(_0xedd9('0x6d'))[_0xedd9('0x6e')]();})[_0xedd9('0x16')](function(_0xa56202){if(_0xa56202){_0x16f31c=_0xa56202[_0xedd9('0x103')];_0x2a040c=_0xa56202['custom'];}})['then'](function(){return db[_0xedd9('0xaa')][_0xedd9('0x26')]({'where':{'closed':![]}});})['then'](function(_0x11f74d){_0x91f39=_0x11f74d;if(_0x16f31c&&_0x11f74d>_0x16f31c){return db['License'][_0xedd9('0x59')]({'where':{'id':0x1}})[_0xedd9('0x16')](function(_0x1908ed){if(_0x1908ed){_0x1908ed[_0xedd9('0x104')](_0xedd9('0x105'));}});}})[_0xedd9('0x16')](function(){if(_0x108582[_0xedd9('0x100')]&&_0x108582[_0xedd9('0x100')][_0xedd9('0x101')]){var _0x4f1d21=[];for(var _0x389c1a=0x0;_0x389c1a<_0x108582[_0xedd9('0x100')][_0xedd9('0x101')][_0xedd9('0x4b')];_0x389c1a++){var _0x34cd7a=_0x108582[_0xedd9('0x100')][_0xedd9('0x101')][_0x389c1a]['get']({'plain':!![]});_0x4f1d21[_0xedd9('0xb3')](iftimePromise(_0x34cd7a,_0x108582));}return BPromise[_0xedd9('0x106')](_0x4f1d21)[_0xedd9('0x16')](function(_0x4c9e41){return _[_0xedd9('0x107')](_0x4c9e41);});}else{return!![];}})[_0xedd9('0x16')](function(_0x2273cd){var _0xa63e57=fs[_0xedd9('0xcb')](path['join'](config[_0xedd9('0x6a')],'server/files/chat/iframe.ejs'),_0xedd9('0xcc'));var _0x48ecf5={'remote':_0x108582['remote'],'query':querystring[_0xedd9('0xa7')](_['merge'](_0x108582['get']({'plain':!![]}),{'customerIp':_0x2e6b81[_0xedd9('0x7d')][_0xedd9('0x9a')]||_0x2e6b81['headers'][_0xedd9('0x108')]||_0x2e6b81['connection'][_0xedd9('0x109')]||_0x2e6b81['ip'],'referer':_0x2e6b81[_0xedd9('0x7d')][_0xedd9('0x10a')],'openedInteractions':_0x91f39,'maxInteractions':_0x16f31c,'virtual':_0x2a040c[_0xedd9('0x103')],'online':_0x2273cd,'custom':_0x2a040c}))['replace'](/'/g,'\x5c\x27')};_0x5789bc['send'](ejs[_0xedd9('0xcd')](Mustache[_0xedd9('0xcd')](_0xa63e57,_0x48ecf5),{'proactiveActions':_0x13f0ad,'alignment':_0x108582[_0xedd9('0x10b')],'verticalAlignment':_0x108582[_0xedd9('0x10c')],'div_color':_0x108582[_0xedd9('0x10d')],'labelText':_0x108582[_0xedd9('0x10e')],'text_color':_0x108582[_0xedd9('0x10f')],'text_button_color':_0x108582[_0xedd9('0x110')],'button_color':_0x108582[_0xedd9('0x111')],'background_color':_0x108582[_0xedd9('0x112')],'hideWhenOffline':_0x108582[_0xedd9('0x113')],'interval':_0x108582[_0xedd9('0x114')]}));})['catch'](handleError(_0x5789bc,null));};exports['addApplications']=function(_0x5ca914,_0x572ba4){var _0xce01a4=_0x5ca914[_0xedd9('0x49')]['id'];var _0x7b88a5=_0x5ca914[_0xedd9('0x4e')];var _0x217879=0xc8;var _0x2177fd=null;return db[_0xedd9('0xd8')][_0xedd9('0xd9')]({'isolationLevel':db[_0xedd9('0xd8')][_0xedd9('0x115')][_0xedd9('0x116')]['READ_COMMITTED']},function(_0x36519f){return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0xce01a4},'transaction':_0x36519f})[_0xedd9('0x16')](function(_0x38209b){if(_0x38209b){return db[_0xedd9('0x8f')][_0xedd9('0x29')]({'where':{'ChatWebsiteId':_0xce01a4},'transaction':_0x36519f})['then'](function(){var _0x230c0e=_[_0xedd9('0x36')](_0x7b88a5,function(_0x1a4eba){_0x1a4eba[_0xedd9('0x56')]=_0xce01a4;return _0x1a4eba;});return db[_0xedd9('0x8f')][_0xedd9('0xda')](_0x230c0e,{'transaction':_0x36519f});});}else{_0x217879=0x194;_0x2177fd=[];}});})[_0xedd9('0x16')](function(){if(_0x217879!==0x194){return db[_0xedd9('0x8f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xce01a4},'order':_0xedd9('0x96')})['then'](function(_0x29b05d){_0x2177fd=_0x29b05d;});}})[_0xedd9('0x1f')](function(_0x451306){_0x217879=0x1f4;logger[_0xedd9('0x19')](_0x451306['stack']);if(_0x451306['name']){delete _0x451306['name'];}_0x2177fd=_0x451306;})[_0xedd9('0x117')](function(){if(_0x2177fd===null){_0x572ba4[_0xedd9('0x20')](_0x217879);}else{if(_0x217879===0x1f4){_0x572ba4[_0xedd9('0x21')](_0x217879)[_0xedd9('0x2e')](_0x2177fd);}else{_0x572ba4[_0xedd9('0x21')](_0x217879)['json'](_0x2177fd);}}});};exports[_0xedd9('0x118')]=function(_0xc5ddf8,_0x2912e5){var _0x76cb66={};var _0x160ebb={};var _0x2a3589;var _0x5ebe59;return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0xc5ddf8['params']['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x2912e5,null))[_0xedd9('0x16')](function(_0x5b3dfc){if(_0x5b3dfc){_0x2a3589=_0x5b3dfc;_0x160ebb[_0xedd9('0x3a')]=_['keys'](db[_0xedd9('0x8f')]['rawAttributes']);_0x160ebb[_0xedd9('0x37')]=_['keys'](_0xc5ddf8[_0xedd9('0x37')]);_0x160ebb[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x160ebb['model'],_0x160ebb[_0xedd9('0x37')]);_0x76cb66[_0xedd9('0x3c')]=_['intersection'](_0x160ebb[_0xedd9('0x3a')],qs[_0xedd9('0x3b')](_0xc5ddf8['query']['fields']));_0x76cb66[_0xedd9('0x3c')]=_0x76cb66[_0xedd9('0x3c')]['length']?_0x76cb66[_0xedd9('0x3c')]:_0x160ebb[_0xedd9('0x3a')];_0x76cb66[_0xedd9('0x3f')]=qs[_0xedd9('0x5f')](_0xc5ddf8[_0xedd9('0x37')][_0xedd9('0x5f')]);_0x76cb66[_0xedd9('0x40')]=qs['filters'](_[_0xedd9('0x41')](_0xc5ddf8[_0xedd9('0x37')],_0x160ebb[_0xedd9('0x38')]));if(_0xc5ddf8[_0xedd9('0x37')]['filter']){_0x76cb66[_0xedd9('0x40')]=_['merge'](_0x76cb66['where'],{'$or':_[_0xedd9('0x36')](_0x76cb66[_0xedd9('0x3c')],function(_0x3f2fe4){var _0x32288e={};_0x32288e[_0x3f2fe4]={'$like':'%'+_0xc5ddf8['query'][_0xedd9('0x42')]+'%'};return _0x32288e;})});}_0x76cb66=_[_0xedd9('0x43')]({},_0x76cb66,_0xc5ddf8[_0xedd9('0x44')]);return _0x2a3589[_0xedd9('0x118')](_0x76cb66);}})[_0xedd9('0x16')](function(_0x4ba5cc){if(_0x4ba5cc){_0x5ebe59=_0x4ba5cc[_0xedd9('0x4b')];if(!_0xc5ddf8[_0xedd9('0x37')][_0xedd9('0x3d')](_0xedd9('0x3e'))){_0x76cb66[_0xedd9('0x25')]=qs[_0xedd9('0x25')](_0xc5ddf8[_0xedd9('0x37')][_0xedd9('0x25')]);_0x76cb66[_0xedd9('0x24')]=qs[_0xedd9('0x24')](_0xc5ddf8['query'][_0xedd9('0x24')]);}return _0x2a3589[_0xedd9('0x118')](_0x76cb66);}})[_0xedd9('0x16')](function(_0x4f9eab){if(_0x4f9eab){return _0x4f9eab?{'count':_0x5ebe59,'rows':_0x4f9eab}:null;}})['then'](respondWithResult(_0x2912e5,null))[_0xedd9('0x1f')](handleError(_0x2912e5,null));};exports[_0xedd9('0x119')]=function(_0x204e16,_0x26df3b){return db['chatProactiveAction']['find']({'where':{'id':_0x204e16[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x26df3b,null))['then'](function(_0x119ec1){if(_0x119ec1){return _0x119ec1[_0xedd9('0x119')](_0x204e16['body'][_0xedd9('0x5b')],_[_0xedd9('0xed')](_0x204e16[_0xedd9('0x4e')],[_0xedd9('0x5b'),'id'])||{});}})[_0xedd9('0x16')](respondWithResult(_0x26df3b,null))[_0xedd9('0x1f')](handleError(_0x26df3b,null));};exports[_0xedd9('0x102')]=function(_0x301396,_0x312db2){var _0xb0e4ba={};var _0x2598bb={};var _0xd434ba;var _0x5e89dd;return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0x301396[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x312db2,null))[_0xedd9('0x16')](function(_0x5bd849){if(_0x5bd849){_0xd434ba=_0x5bd849;_0x2598bb[_0xedd9('0x3a')]=_[_0xedd9('0x4a')](db[_0xedd9('0x11a')][_0xedd9('0x33')]);_0x2598bb[_0xedd9('0x37')]=_['keys'](_0x301396['query']);_0x2598bb[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x2598bb[_0xedd9('0x3a')],_0x2598bb[_0xedd9('0x37')]);_0xb0e4ba[_0xedd9('0x3c')]=_[_0xedd9('0x39')](_0x2598bb[_0xedd9('0x3a')],qs[_0xedd9('0x3b')](_0x301396['query']['fields']));_0xb0e4ba[_0xedd9('0x3c')]=_0xb0e4ba['attributes']['length']?_0xb0e4ba[_0xedd9('0x3c')]:_0x2598bb[_0xedd9('0x3a')];_0xb0e4ba[_0xedd9('0x3f')]=qs['sort'](_0x301396[_0xedd9('0x37')][_0xedd9('0x5f')]);_0xb0e4ba[_0xedd9('0x40')]=qs['filters'](_[_0xedd9('0x41')](_0x301396['query'],_0x2598bb[_0xedd9('0x38')]));if(_0x301396[_0xedd9('0x37')][_0xedd9('0x42')]){_0xb0e4ba[_0xedd9('0x40')]=_[_0xedd9('0x43')](_0xb0e4ba[_0xedd9('0x40')],{'$or':_[_0xedd9('0x36')](_0xb0e4ba[_0xedd9('0x3c')],function(_0x5f3333){var _0x4661fc={};_0x4661fc[_0x5f3333]={'$like':'%'+_0x301396[_0xedd9('0x37')][_0xedd9('0x42')]+'%'};return _0x4661fc;})});}_0xb0e4ba=_[_0xedd9('0x43')]({},_0xb0e4ba,_0x301396['options']);return _0xd434ba[_0xedd9('0x102')](_0xb0e4ba);}})[_0xedd9('0x16')](function(_0x301bfb){if(_0x301bfb){_0x5e89dd=_0x301bfb[_0xedd9('0x4b')];if(!_0x301396[_0xedd9('0x37')][_0xedd9('0x3d')]('nolimit')){_0xb0e4ba[_0xedd9('0x25')]=qs[_0xedd9('0x25')](_0x301396['query'][_0xedd9('0x25')]);_0xb0e4ba[_0xedd9('0x24')]=qs[_0xedd9('0x24')](_0x301396['query'][_0xedd9('0x24')]);}return _0xd434ba[_0xedd9('0x102')](_0xb0e4ba);}})[_0xedd9('0x16')](function(_0x25f782){if(_0x25f782){return _0x25f782?{'count':_0x5e89dd,'rows':_0x25f782}:null;}})['then'](respondWithResult(_0x312db2,null))[_0xedd9('0x1f')](handleError(_0x312db2,null));};exports[_0xedd9('0x11b')]=function(_0x4717cc,_0x21b240){var _0x5eb021=_0x4717cc[_0xedd9('0x37')][_0xedd9('0x11c')]==='false'?_0xedd9('0x11d'):_0xedd9('0x11e');return db['ChatWebsite'][_0xedd9('0x4c')]({'attributes':['id',_0x5eb021],'where':{'id':_0x4717cc[_0xedd9('0x49')]['id']}})['then'](handleEntityNotFound(_0x21b240,null))[_0xedd9('0x16')](function(_0x5004f3){if(_0x5004f3){var _0x40ff95=_0x5004f3[_0x5eb021];var _0x1831c2=_0x40ff95&&_0x40ff95[_0xedd9('0x11f')]?_0x40ff95[_0xedd9('0x11f')]:[];_0x21b240['send']({'fromKey':_[_0xedd9('0x75')](_0x40ff95[_0xedd9('0x120')])?undefined:_0x40ff95[_0xedd9('0x120')],'count':_0x1831c2[_0xedd9('0x4b')],'rows':_0x1831c2});}})[_0xedd9('0x1f')](handleError(_0x21b240,null));};exports['getOfflineMessages']=function(_0x35f441,_0x11bb93){var _0x3ba469={'raw':![],'where':{}};var _0xc6ebc7={};var _0x456c58={'count':0x0,'rows':[]};return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0x35f441[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x11bb93,null))[_0xedd9('0x16')](function(_0x104c25){if(_0x104c25){_0xc6ebc7[_0xedd9('0x3a')]=_['keys'](db[_0xedd9('0xd0')]['rawAttributes']);_0xc6ebc7['query']=_[_0xedd9('0x4a')](_0x35f441[_0xedd9('0x37')]);_0xc6ebc7[_0xedd9('0x38')]=_['intersection'](_0xc6ebc7[_0xedd9('0x3a')],_0xc6ebc7['query']);_0x3ba469[_0xedd9('0x3c')]=_['intersection'](_0xc6ebc7[_0xedd9('0x3a')],qs[_0xedd9('0x3b')](_0x35f441[_0xedd9('0x37')][_0xedd9('0x3b')]));_0x3ba469[_0xedd9('0x3c')]=_0x3ba469['attributes'][_0xedd9('0x4b')]?_0x3ba469['attributes']:_0xc6ebc7[_0xedd9('0x3a')];if(!_0x35f441[_0xedd9('0x37')][_0xedd9('0x3d')](_0xedd9('0x3e'))){_0x3ba469[_0xedd9('0x25')]=qs[_0xedd9('0x25')](_0x35f441['query'][_0xedd9('0x25')]);_0x3ba469[_0xedd9('0x24')]=qs[_0xedd9('0x24')](_0x35f441[_0xedd9('0x37')][_0xedd9('0x24')]);}_0x3ba469['order']=qs[_0xedd9('0x5f')](_0x35f441[_0xedd9('0x37')][_0xedd9('0x5f')]);_0x3ba469['where']=qs[_0xedd9('0x38')](_[_0xedd9('0x41')](_0x35f441[_0xedd9('0x37')],_0xc6ebc7['filters']));_0x3ba469[_0xedd9('0x40')]['ChatWebsiteId']=_0x104c25['id'];if(_0x35f441[_0xedd9('0x37')]['filter']){_0x3ba469['where']=_[_0xedd9('0x43')](_0x3ba469[_0xedd9('0x40')],{'$or':_[_0xedd9('0x36')](_0x3ba469[_0xedd9('0x3c')],function(_0xffb452){var _0x9a6a64={};_0x9a6a64[_0xffb452]={'$like':'%'+_0x35f441['query'][_0xedd9('0x42')]+'%'};return _0x9a6a64;})});}_0x3ba469=_[_0xedd9('0x43')]({},_0x3ba469,_0x35f441[_0xedd9('0x44')]);return db[_0xedd9('0xd0')][_0xedd9('0x26')]({'where':_0x3ba469[_0xedd9('0x40')]})[_0xedd9('0x16')](function(_0x553021){_0x456c58['count']=_0x553021;if(_0x35f441[_0xedd9('0x37')][_0xedd9('0x45')]){_0x3ba469[_0xedd9('0x46')]=[{'all':!![]}];}else{_0x3ba469[_0xedd9('0x46')]=[{'model':db[_0xedd9('0x81')],'as':_0xedd9('0xef'),'required':![]},{'model':db[_0xedd9('0x121')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x3ba469);})['then'](function(_0x4fb271){_0x456c58[_0xedd9('0x47')]=_0x4fb271;return _0x456c58;});}})[_0xedd9('0x16')](respondWithFilteredResult(_0x11bb93,_0x3ba469))[_0xedd9('0x1f')](handleError(_0x11bb93,null));};exports[_0xedd9('0x122')]=function(_0x53b9bf,_0x1f4165){return db[_0xedd9('0x32')][_0xedd9('0x4c')]({'where':{'id':_0x53b9bf['params']['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x1f4165,null))[_0xedd9('0x16')](function(_0x36348c){if(_0x36348c){return _0x36348c[_0xedd9('0x122')](_0x53b9bf['body'][_0xedd9('0x5b')],_[_0xedd9('0xed')](_0x53b9bf[_0xedd9('0x4e')],['ids','id'])||{})[_0xedd9('0xad')](function(_0x54c0ac){for(var _0x394bc6=0x0;_0x394bc6<_0x53b9bf['body'][_0xedd9('0x5b')]['length'];_0x394bc6+=0x1){socket[_0xedd9('0x123')]('userChatWebsite:save',{'UserId':Number(_0x53b9bf[_0xedd9('0x4e')]['ids'][_0x394bc6]),'ChatWebsiteId':Number(_0x53b9bf[_0xedd9('0x49')]['id'])});}return _0x54c0ac;});}})[_0xedd9('0x16')](respondWithResult(_0x1f4165,null))[_0xedd9('0x1f')](handleError(_0x1f4165,null));};exports[_0xedd9('0x124')]=function(_0x629f28,_0x17fcdb){return db[_0xedd9('0x32')]['find']({'where':{'id':_0x629f28['params']['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x17fcdb,null))[_0xedd9('0x16')](function(_0x138dd1){if(_0x138dd1){return _0x138dd1[_0xedd9('0x124')](_0x629f28[_0xedd9('0x37')][_0xedd9('0x5b')])[_0xedd9('0x16')](function(){if(_[_0xedd9('0x125')](_0x629f28['query'][_0xedd9('0x5b')])){for(var _0x562696=0x0;_0x562696<_0x629f28[_0xedd9('0x37')][_0xedd9('0x5b')][_0xedd9('0x4b')];_0x562696+=0x1){socket[_0xedd9('0x123')](_0xedd9('0x126'),{'UserId':Number(_0x629f28['query'][_0xedd9('0x5b')][_0x562696]),'ChatWebsiteId':Number(_0x629f28['params']['id'])});}}else{socket[_0xedd9('0x123')](_0xedd9('0x126'),{'UserId':Number(_0x629f28[_0xedd9('0x37')]['ids']),'ChatWebsiteId':Number(_0x629f28['params']['id'])});}});}})['then'](respondWithStatusCode(_0x17fcdb,null))[_0xedd9('0x1f')](handleError(_0x17fcdb,null));};exports[_0xedd9('0x127')]=function(_0x106c90,_0x5e64b2){var _0x2b6939={};var _0x573dff={};var _0x3a16c1;var _0x24479b;return db[_0xedd9('0x32')][_0xedd9('0x59')]({'where':{'id':_0x106c90[_0xedd9('0x49')]['id']}})[_0xedd9('0x16')](handleEntityNotFound(_0x5e64b2,null))[_0xedd9('0x16')](function(_0xa8f1e0){if(_0xa8f1e0){_0x3a16c1=_0xa8f1e0;_0x573dff[_0xedd9('0x3a')]=_[_0xedd9('0x4a')](db[_0xedd9('0xba')][_0xedd9('0x33')]);_0x573dff[_0xedd9('0x37')]=_[_0xedd9('0x4a')](_0x106c90[_0xedd9('0x37')]);_0x573dff[_0xedd9('0x38')]=_[_0xedd9('0x39')](_0x573dff['model'],_0x573dff[_0xedd9('0x37')]);_0x2b6939[_0xedd9('0x3c')]=_['intersection'](_0x573dff['model'],qs[_0xedd9('0x3b')](_0x106c90[_0xedd9('0x37')][_0xedd9('0x3b')]));_0x2b6939[_0xedd9('0x3c')]=_0x2b6939[_0xedd9('0x3c')]['length']?_0x2b6939[_0xedd9('0x3c')]:_0x573dff[_0xedd9('0x3a')];_0x2b6939['order']=qs['sort'](_0x106c90[_0xedd9('0x37')]['sort']);_0x2b6939[_0xedd9('0x40')]=qs[_0xedd9('0x38')](_['pick'](_0x106c90[_0xedd9('0x37')],_0x573dff[_0xedd9('0x38')]));if(_0x106c90[_0xedd9('0x37')][_0xedd9('0x42')]){_0x2b6939[_0xedd9('0x40')]=_['merge'](_0x2b6939['where'],{'$or':_[_0xedd9('0x36')](_0x2b6939[_0xedd9('0x3c')],function(_0x9c4756){var _0x41a2c8={};_0x41a2c8[_0x9c4756]={'$like':'%'+_0x106c90[_0xedd9('0x37')][_0xedd9('0x42')]+'%'};return _0x41a2c8;})});}_0x2b6939=_[_0xedd9('0x43')]({},_0x2b6939,_0x106c90[_0xedd9('0x44')]);return _0x3a16c1[_0xedd9('0x127')](_0x2b6939);}})['then'](function(_0x2ec546){if(_0x2ec546){_0x24479b=_0x2ec546[_0xedd9('0x4b')];if(!_0x106c90[_0xedd9('0x37')][_0xedd9('0x3d')]('nolimit')){_0x2b6939[_0xedd9('0x25')]=qs[_0xedd9('0x25')](_0x106c90['query'][_0xedd9('0x25')]);_0x2b6939[_0xedd9('0x24')]=qs[_0xedd9('0x24')](_0x106c90[_0xedd9('0x37')][_0xedd9('0x24')]);}return _0x3a16c1['getAgents'](_0x2b6939);}})[_0xedd9('0x16')](function(_0x5cb025){if(_0x5cb025){return _0x5cb025?{'count':_0x24479b,'rows':_0x5cb025}:null;}})['then'](respondWithResult(_0x5e64b2,null))[_0xedd9('0x1f')](handleError(_0x5e64b2,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0369343..a67d607 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 _0xc770=['emit','hasOwnProperty','hook','events','../../mysqldb','save','update','remove'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0c77('0x0'));var ChatWebsite=require(_0x0c77('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0c77('0x2'),'afterUpdate':_0x0c77('0x3'),'afterDestroy':_0x0c77('0x4')};function emitEvent(_0x23ae87){return function(_0xdcfb07,_0x18e293,_0x2a7b4b){ChatWebsiteEvents[_0x0c77('0x5')](_0x23ae87+':'+_0xdcfb07['id'],_0xdcfb07);ChatWebsiteEvents['emit'](_0x23ae87,_0xdcfb07);_0x2a7b4b(null);};}for(var e in events){if(events[_0x0c77('0x6')](e)){var event=events[e];ChatWebsite[_0x0c77('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xa630=['exports','events','../../mysqldb','save','remove','emit','hook'];(function(_0x21c1f7,_0xb7aa8a){var _0x3a736f=function(_0x5dcd18){while(--_0x5dcd18){_0x21c1f7['push'](_0x21c1f7['shift']());}};_0x3a736f(++_0xb7aa8a);}(_0xa630,0xbe));var _0x0a63=function(_0x55f11c,_0x123063){_0x55f11c=_0x55f11c-0x0;var _0x5569cc=_0xa630[_0x55f11c];return _0x5569cc;};'use strict';var EventEmitter=require(_0x0a63('0x0'));var ChatWebsite=require(_0x0a63('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a63('0x2'),'afterUpdate':'update','afterDestroy':_0x0a63('0x3')};function emitEvent(_0x506b55){return function(_0x91a747,_0x3bcb90,_0x2cfdeb){ChatWebsiteEvents[_0x0a63('0x4')](_0x506b55+':'+_0x91a747['id'],_0x91a747);ChatWebsiteEvents[_0x0a63('0x4')](_0x506b55,_0x91a747);_0x2cfdeb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0a63('0x5')](e,emitEvent(event));}}module[_0x0a63('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b585812..2d9388a 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 _0xfbd5=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','ChatWebsite','chat_websites','lodash','util'];(function(_0x5e2954,_0x21a728){var _0x3d1d5d=function(_0xffd6f){while(--_0xffd6f){_0x5e2954['push'](_0x5e2954['shift']());}};_0x3d1d5d(++_0x21a728);}(_0xfbd5,0x142));var _0x5fbd=function(_0x2f7729,_0x471148){_0x2f7729=_0x2f7729-0x0;var _0x1cb7bd=_0xfbd5[_0x2f7729];return _0x1cb7bd;};'use strict';var _=require(_0x5fbd('0x0'));var util=require(_0x5fbd('0x1'));var logger=require(_0x5fbd('0x2'))(_0x5fbd('0x3'));var moment=require(_0x5fbd('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fbd('0x5'));var fs=require('fs');var path=require(_0x5fbd('0x6'));var rimraf=require(_0x5fbd('0x7'));var config=require(_0x5fbd('0x8'));var attributes=require('./chatWebsite.attributes');module[_0x5fbd('0x9')]=function(_0x418717,_0x2aa401){return _0x418717['define'](_0x5fbd('0xa'),attributes,{'tableName':_0x5fbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf79=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','../../config/logger','api','moment'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0xbf79,0x19f));var _0x9bf7=function(_0x198dca,_0x4b298a){_0x198dca=_0x198dca-0x0;var _0x196623=_0xbf79[_0x198dca];return _0x196623;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9bf7('0x0'))(_0x9bf7('0x1'));var moment=require(_0x9bf7('0x2'));var BPromise=require(_0x9bf7('0x3'));var rp=require(_0x9bf7('0x4'));var fs=require('fs');var path=require(_0x9bf7('0x5'));var rimraf=require(_0x9bf7('0x6'));var config=require(_0x9bf7('0x7'));var attributes=require(_0x9bf7('0x8'));module[_0x9bf7('0x9')]=function(_0x281c3f,_0x4aa16c){return _0x281c3f[_0x9bf7('0xa')]('ChatWebsite',attributes,{'tableName':'chat_websites','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 30bd263..028af5e 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 _0x751d=['redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x2234c9,_0x13c194){var _0x487867=function(_0x417e3e){while(--_0x417e3e){_0x2234c9['push'](_0x2234c9['shift']());}};_0x487867(++_0x13c194);}(_0x751d,0x145));var _0xd751=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x751d[_0x264545];return _0x114d10;};'use strict';var _=require(_0xd751('0x0'));var util=require(_0xd751('0x1'));var moment=require(_0xd751('0x2'));var BPromise=require(_0xd751('0x3'));var rs=require(_0xd751('0x4'));var fs=require('fs');var Redis=require(_0xd751('0x5'));var db=require(_0xd751('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd751('0x7'))(_0xd751('0x8'));var config=require('../../config/environment');var jayson=require(_0xd751('0x9'));var client=jayson[_0xd751('0xa')]['http']({'port':0x232a});config[_0xd751('0xb')]=_[_0xd751('0xc')](config[_0xd751('0xb')],{'host':_0xd751('0xd'),'port':0x18eb});var socket=require(_0xd751('0xe'))(new Redis(config['redis']));require(_0xd751('0xf'))[_0xd751('0x10')](socket);function respondWithRpcPromise(_0x426baa,_0x1acf86,_0x196f3c){return new BPromise(function(_0x3d874c,_0x5c250a){return client[_0xd751('0x11')](_0x426baa,_0x196f3c)[_0xd751('0x12')](function(_0x2a7b65){logger[_0xd751('0x13')](_0xd751('0x14'),_0x1acf86,'request\x20sent');logger[_0xd751('0x15')](_0xd751('0x16'),_0x1acf86,_0xd751('0x17'),JSON[_0xd751('0x18')](_0x2a7b65));if(_0x2a7b65['error']){if(_0x2a7b65[_0xd751('0x19')]['code']===0x1f4){logger[_0xd751('0x19')](_0xd751('0x14'),_0x1acf86,_0x2a7b65[_0xd751('0x19')][_0xd751('0x1a')]);return _0x5c250a(_0x2a7b65[_0xd751('0x19')][_0xd751('0x1a')]);}logger[_0xd751('0x19')](_0xd751('0x14'),_0x1acf86,_0x2a7b65[_0xd751('0x19')][_0xd751('0x1a')]);return _0x3d874c(_0x2a7b65['error'][_0xd751('0x1a')]);}else{logger[_0xd751('0x13')](_0xd751('0x14'),_0x1acf86,_0xd751('0x17'));_0x3d874c(_0x2a7b65['result']['message']);}})[_0xd751('0x1b')](function(_0x44ef73){logger[_0xd751('0x19')](_0xd751('0x14'),_0x1acf86,_0x44ef73);_0x5c250a(_0x44ef73);});});} \ No newline at end of file +var _0xf0de=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x4a8184,_0x5a195a){var _0x426cf9=function(_0x5a7b1f){while(--_0x5a7b1f){_0x4a8184['push'](_0x4a8184['shift']());}};_0x426cf9(++_0x5a195a);}(_0xf0de,0xc2));var _0xef0d=function(_0x2cacce,_0x455afb){_0x2cacce=_0x2cacce-0x0;var _0x47a7e1=_0xf0de[_0x2cacce];return _0x47a7e1;};'use strict';var _=require(_0xef0d('0x0'));var util=require(_0xef0d('0x1'));var moment=require(_0xef0d('0x2'));var BPromise=require(_0xef0d('0x3'));var rs=require(_0xef0d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xef0d('0x5'));var logger=require(_0xef0d('0x6'))(_0xef0d('0x7'));var config=require(_0xef0d('0x8'));var jayson=require(_0xef0d('0x9'));var client=jayson['client'][_0xef0d('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xef0d('0xb')],{'host':_0xef0d('0xc'),'port':0x18eb});var socket=require(_0xef0d('0xd'))(new Redis(config[_0xef0d('0xb')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5d21f0,_0x3ef3a1,_0x157be9){return new BPromise(function(_0x45c1c2,_0x2be0ce){return client[_0xef0d('0xe')](_0x5d21f0,_0x157be9)['then'](function(_0xf6b558){logger[_0xef0d('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x3ef3a1,_0xef0d('0x10'));logger[_0xef0d('0x11')](_0xef0d('0x12'),_0x3ef3a1,_0xef0d('0x10'),JSON[_0xef0d('0x13')](_0xf6b558));if(_0xf6b558[_0xef0d('0x14')]){if(_0xf6b558[_0xef0d('0x14')][_0xef0d('0x15')]===0x1f4){logger[_0xef0d('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x3ef3a1,_0xf6b558[_0xef0d('0x14')][_0xef0d('0x16')]);return _0x2be0ce(_0xf6b558['error'][_0xef0d('0x16')]);}logger['error'](_0xef0d('0x17'),_0x3ef3a1,_0xf6b558[_0xef0d('0x14')][_0xef0d('0x16')]);return _0x45c1c2(_0xf6b558[_0xef0d('0x14')]['message']);}else{logger['info'](_0xef0d('0x17'),_0x3ef3a1,_0xef0d('0x10'));_0x45c1c2(_0xf6b558[_0xef0d('0x18')][_0xef0d('0x16')]);}})['catch'](function(_0x4bf4b7){logger[_0xef0d('0x14')](_0xef0d('0x17'),_0x3ef3a1,_0x4bf4b7);_0x2be0ce(_0x4bf4b7);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index efc64ea..01bba74 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 _0x008f=['./chatWebsite.events','save','update','emit','removeListener','length','chatWebsite:'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x008f,0xe7));var _0xf008=function(_0x35dfe6,_0x4244fa){_0x35dfe6=_0x35dfe6-0x0;var _0x59651c=_0x008f[_0x35dfe6];return _0x59651c;};'use strict';var ChatWebsiteEvents=require(_0xf008('0x0'));var events=[_0xf008('0x1'),'remove',_0xf008('0x2')];function createListener(_0x133112,_0x1252d5){return function(_0x3e729b){_0x1252d5[_0xf008('0x3')](_0x133112,_0x3e729b);};}function removeListener(_0x144f98,_0x51c5de){return function(){ChatWebsiteEvents[_0xf008('0x4')](_0x144f98,_0x51c5de);};}exports['register']=function(_0x29da0c){for(var _0x269af9=0x0,_0x3f256c=events[_0xf008('0x5')];_0x269af9<_0x3f256c;_0x269af9++){var _0x1057fa=events[_0x269af9];var _0x56b83d=createListener(_0xf008('0x6')+_0x1057fa,_0x29da0c);ChatWebsiteEvents['on'](_0x1057fa,_0x56b83d);}}; \ No newline at end of file +var _0x78cc=['chatWebsite:','./chatWebsite.events','save','remove','emit','register','length'];(function(_0x5e99c1,_0x39033f){var _0x3dabc5=function(_0x546e93){while(--_0x546e93){_0x5e99c1['push'](_0x5e99c1['shift']());}};_0x3dabc5(++_0x39033f);}(_0x78cc,0xef));var _0xc78c=function(_0x4771b6,_0x30f250){_0x4771b6=_0x4771b6-0x0;var _0x3e226d=_0x78cc[_0x4771b6];return _0x3e226d;};'use strict';var ChatWebsiteEvents=require(_0xc78c('0x0'));var events=[_0xc78c('0x1'),_0xc78c('0x2'),'update'];function createListener(_0x5317c9,_0x3e8302){return function(_0x399dc0){_0x3e8302[_0xc78c('0x3')](_0x5317c9,_0x399dc0);};}function removeListener(_0x164618,_0x1a7b45){return function(){ChatWebsiteEvents['removeListener'](_0x164618,_0x1a7b45);};}exports[_0xc78c('0x4')]=function(_0x223a97){for(var _0x46f5a4=0x0,_0x22b545=events[_0xc78c('0x5')];_0x46f5a4<_0x22b545;_0x46f5a4++){var _0x38fc53=events[_0x46f5a4];var _0x54042c=createListener(_0xc78c('0x6')+_0x38fc53,_0x223a97);ChatWebsiteEvents['on'](_0x38fc53,_0x54042c);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 522e56b..22aa387 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 _0x670e=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','server/files/images/logos/','%s-%s','now','single','file','addLogo','join','root','server/files/images/avatars/','format','originalname','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeAgents','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','/:id','get','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions'];(function(_0x1d2b66,_0x256c6e){var _0x445a66=function(_0x2e5845){while(--_0x2e5845){_0x1d2b66['push'](_0x1d2b66['shift']());}};_0x445a66(++_0x256c6e);}(_0x670e,0x105));var _0xe670=function(_0x5cdfa,_0xb08daf){_0x5cdfa=_0x5cdfa-0x0;var _0xf9c3b6=_0x670e[_0x5cdfa];return _0xf9c3b6;};'use strict';var multer=require(_0xe670('0x0'));var util=require('util');var path=require(_0xe670('0x1'));var timeout=require('connect-timeout');var express=require(_0xe670('0x2'));var router=express['Router']();var fs_extra=require(_0xe670('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe670('0x4'));var config=require(_0xe670('0x5'));var controller=require(_0xe670('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe670('0x7')]);router['get'](_0xe670('0x8'),auth[_0xe670('0x9')](),controller[_0xe670('0xa')]);router['get'](_0xe670('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe670('0xc')](_0xe670('0xd'),auth['isAuthenticated'](),controller[_0xe670('0xe')]);router['get'](_0xe670('0xf'),auth[_0xe670('0x9')](),controller[_0xe670('0x10')]);router[_0xe670('0xc')](_0xe670('0x11'),controller[_0xe670('0x12')]);router[_0xe670('0xc')]('/:id/avatar',controller['getAvatar']);router['get'](_0xe670('0x13'),controller[_0xe670('0x14')]);router[_0xe670('0xc')](_0xe670('0x15'),controller['getSystemAvatar']);router[_0xe670('0xc')](_0xe670('0x16'),auth[_0xe670('0x9')](),controller[_0xe670('0x17')]);router[_0xe670('0xc')](_0xe670('0x18'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xe670('0x9')](),controller[_0xe670('0x19')]);router[_0xe670('0xc')](_0xe670('0x1a'),auth[_0xe670('0x9')](),controller[_0xe670('0x1b')]);router[_0xe670('0xc')](_0xe670('0x1c'),controller[_0xe670('0x1d')]);router[_0xe670('0xc')](_0xe670('0x1e'),auth[_0xe670('0x9')](),controller[_0xe670('0x1f')]);router[_0xe670('0xc')](_0xe670('0x20'),auth[_0xe670('0x9')](),controller[_0xe670('0x21')]);router[_0xe670('0x22')]('/',auth[_0xe670('0x9')](),controller[_0xe670('0x23')]);router[_0xe670('0x22')](_0xe670('0xd'),auth[_0xe670('0x9')](),controller[_0xe670('0x24')]);router[_0xe670('0x22')]('/:id/canned_answers',auth[_0xe670('0x9')](),controller[_0xe670('0x25')]);var upload=multer({'storage':multer[_0xe670('0x26')]({'destination':function(_0x5d7738,_0x32087f,_0x1d4cf0){_0x1d4cf0(null,path['join'](config['root'],_0xe670('0x27')));},'filename':function(_0x152cf8,_0x6cb069,_0x52077e){_0x52077e(null,util['format'](_0xe670('0x28'),Date[_0xe670('0x29')](),_0x6cb069['originalname']));}})});router[_0xe670('0x22')](_0xe670('0x11'),upload[_0xe670('0x2a')](_0xe670('0x2b')),controller[_0xe670('0x2c')]);var upload=multer({'storage':multer[_0xe670('0x26')]({'destination':function(_0x32c3dd,_0x5c3c32,_0x15b704){_0x15b704(null,path[_0xe670('0x2d')](config[_0xe670('0x2e')],_0xe670('0x2f')));},'filename':function(_0x1fd86b,_0x49f9d3,_0x2f0bc4){_0x2f0bc4(null,util[_0xe670('0x30')](_0xe670('0x28'),Date['now'](),_0x49f9d3[_0xe670('0x31')]));}})});router['post'](_0xe670('0x32'),upload['single'](_0xe670('0x2b')),controller[_0xe670('0x33')]);var upload=multer({'storage':multer[_0xe670('0x26')]({'destination':function(_0x295c35,_0x59629e,_0x1db4e2){_0x1db4e2(null,path[_0xe670('0x2d')](config[_0xe670('0x2e')],_0xe670('0x2f')));},'filename':function(_0x430ba7,_0x211374,_0x2cbdad){_0x2cbdad(null,util[_0xe670('0x30')](_0xe670('0x28'),Date[_0xe670('0x29')](),_0x211374[_0xe670('0x31')]));}})});router[_0xe670('0x22')]('/:id/customer_avatar',upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe670('0x26')]({'destination':function(_0x3d8a34,_0x2ce0a0,_0x377549){_0x377549(null,path[_0xe670('0x2d')](config[_0xe670('0x2e')],_0xe670('0x2f')));},'filename':function(_0x2ab8d1,_0x5ad794,_0x24f7f3){_0x24f7f3(null,util[_0xe670('0x30')](_0xe670('0x28'),Date[_0xe670('0x29')](),_0x5ad794[_0xe670('0x31')]));}})});router[_0xe670('0x22')]('/:id/system_avatar',upload[_0xe670('0x2a')](_0xe670('0x2b')),controller[_0xe670('0x34')]);router[_0xe670('0x22')](_0xe670('0x35'),controller[_0xe670('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xe670('0x26')]({'destination':function(_0x48132b,_0x595724,_0x2ec6f3){const _0x45e7ed=path[_0xe670('0x2d')](config[_0xe670('0x2e')],_0xe670('0x37'),_0xe670('0x38'),_0xe670('0x39'));fs_extra[_0xe670('0x3a')](_0x45e7ed,function(){_0x2ec6f3(null,_0x45e7ed);});},'filename':function(_0x339936,_0x3b41e0,_0x491790){const _0x3ea5f0=_0x3b41e0[_0xe670('0x31')][_0xe670('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1012e9=path['extname'](_0x3ea5f0);const _0x1da8f1=Date[_0xe670('0x29')]()+'-'+_0x3ea5f0[_0xe670('0x3b')](_0x1012e9,'')+_0x1012e9;_0x491790(null,_0x1da8f1);}})});router['post'](_0xe670('0x3c'),offlineUploadMulter[_0xe670('0x3d')](),controller[_0xe670('0x3e')]);router[_0xe670('0x22')](_0xe670('0x16'),auth[_0xe670('0x9')](),controller[_0xe670('0x3f')]);router[_0xe670('0x22')]('/:id/applications',auth[_0xe670('0x9')](),controller[_0xe670('0x40')]);router['post'](_0xe670('0x1a'),auth[_0xe670('0x9')](),controller[_0xe670('0x41')]);router[_0xe670('0x22')](_0xe670('0x20'),auth[_0xe670('0x9')](),controller[_0xe670('0x42')]);router[_0xe670('0x43')](_0xe670('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe670('0x44')](_0xe670('0xb'),auth[_0xe670('0x9')](),controller[_0xe670('0x45')]);router[_0xe670('0x44')](_0xe670('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xe670('0x44')](_0xe670('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xe670('0x44')](_0xe670('0x20'),auth[_0xe670('0x9')](),controller[_0xe670('0x46')]);module[_0xe670('0x47')]=router; \ No newline at end of file +var _0xd2df=['/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','originalname','addLogo','server/files/images/avatars/','%s-%s','single','file','addCustomerAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','now','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','put','update','delete','removeDispositions','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x1070ef,_0x1fe7f0){var _0x2de974=function(_0x4e706b){while(--_0x4e706b){_0x1070ef['push'](_0x1070ef['shift']());}};_0x2de974(++_0x1fe7f0);}(_0xd2df,0x105));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var path=require(_0xfd2d('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd2d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfd2d('0x4'));var interaction=require(_0xfd2d('0x5'));var config=require(_0xfd2d('0x6'));var controller=require(_0xfd2d('0x7'));router[_0xfd2d('0x8')]('/',auth[_0xfd2d('0x9')](),controller['index']);router[_0xfd2d('0x8')](_0xfd2d('0xa'),auth[_0xfd2d('0x9')](),controller[_0xfd2d('0xb')]);router['get'](_0xfd2d('0xc'),auth[_0xfd2d('0x9')](),controller[_0xfd2d('0xd')]);router[_0xfd2d('0x8')](_0xfd2d('0xe'),auth[_0xfd2d('0x9')](),controller[_0xfd2d('0xf')]);router[_0xfd2d('0x8')](_0xfd2d('0x10'),auth[_0xfd2d('0x9')](),controller['getAnswers']);router[_0xfd2d('0x8')](_0xfd2d('0x11'),controller[_0xfd2d('0x12')]);router[_0xfd2d('0x8')](_0xfd2d('0x13'),controller[_0xfd2d('0x14')]);router['get'](_0xfd2d('0x15'),controller[_0xfd2d('0x16')]);router[_0xfd2d('0x8')](_0xfd2d('0x17'),controller[_0xfd2d('0x18')]);router[_0xfd2d('0x8')](_0xfd2d('0x19'),auth['isAuthenticated'](),controller[_0xfd2d('0x1a')]);router[_0xfd2d('0x8')](_0xfd2d('0x1b'),controller[_0xfd2d('0x1c')]);router[_0xfd2d('0x8')](_0xfd2d('0x1d'),auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x1e')]);router[_0xfd2d('0x8')](_0xfd2d('0x1f'),auth['isAuthenticated'](),controller[_0xfd2d('0x20')]);router[_0xfd2d('0x8')](_0xfd2d('0x21'),controller[_0xfd2d('0x22')]);router['get'](_0xfd2d('0x23'),auth['isAuthenticated'](),controller[_0xfd2d('0x24')]);router[_0xfd2d('0x8')]('/:id/users',auth[_0xfd2d('0x9')](),controller['getAgents']);router[_0xfd2d('0x25')]('/',auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x26')]);router['post'](_0xfd2d('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xfd2d('0x25')](_0xfd2d('0x10'),auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x27')]);var upload=multer({'storage':multer[_0xfd2d('0x28')]({'destination':function(_0x5ca01e,_0x26d1da,_0x4cd473){_0x4cd473(null,path[_0xfd2d('0x29')](config[_0xfd2d('0x2a')],_0xfd2d('0x2b')));},'filename':function(_0x5bbd07,_0x3d8409,_0x2b4520){_0x2b4520(null,util[_0xfd2d('0x2c')]('%s-%s',Date['now'](),_0x3d8409[_0xfd2d('0x2d')]));}})});router['post'](_0xfd2d('0x11'),upload['single']('file'),controller[_0xfd2d('0x2e')]);var upload=multer({'storage':multer[_0xfd2d('0x28')]({'destination':function(_0x5b5ec8,_0x71d405,_0x79ec92){_0x79ec92(null,path[_0xfd2d('0x29')](config[_0xfd2d('0x2a')],_0xfd2d('0x2f')));},'filename':function(_0x593de9,_0x3fb234,_0x351d34){_0x351d34(null,util['format'](_0xfd2d('0x30'),Date['now'](),_0x3fb234['originalname']));}})});router['post'](_0xfd2d('0x13'),upload[_0xfd2d('0x31')](_0xfd2d('0x32')),controller['addAvatar']);var upload=multer({'storage':multer[_0xfd2d('0x28')]({'destination':function(_0x274cfd,_0xe58970,_0x10ee78){_0x10ee78(null,path[_0xfd2d('0x29')](config[_0xfd2d('0x2a')],_0xfd2d('0x2f')));},'filename':function(_0x32d7d0,_0xc461c9,_0x3bdffa){_0x3bdffa(null,util[_0xfd2d('0x2c')](_0xfd2d('0x30'),Date['now'](),_0xc461c9['originalname']));}})});router[_0xfd2d('0x25')](_0xfd2d('0x15'),upload[_0xfd2d('0x31')](_0xfd2d('0x32')),controller[_0xfd2d('0x33')]);var upload=multer({'storage':multer[_0xfd2d('0x28')]({'destination':function(_0x224e68,_0x1dbbe0,_0x255c51){_0x255c51(null,path[_0xfd2d('0x29')](config['root'],_0xfd2d('0x2f')));},'filename':function(_0x468253,_0x5f3ee2,_0x40d794){_0x40d794(null,util[_0xfd2d('0x2c')](_0xfd2d('0x30'),Date['now'](),_0x5f3ee2[_0xfd2d('0x2d')]));}})});router[_0xfd2d('0x25')](_0xfd2d('0x17'),upload[_0xfd2d('0x31')](_0xfd2d('0x32')),controller['addSystemAvatar']);router[_0xfd2d('0x25')]('/:id/notify',controller[_0xfd2d('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x13d4b0,_0x327b3b,_0xc728dc){const _0x41fe7b=path[_0xfd2d('0x29')](config[_0xfd2d('0x2a')],_0xfd2d('0x35'),_0xfd2d('0x36'),_0xfd2d('0x37'));fs_extra[_0xfd2d('0x38')](_0x41fe7b,function(){_0xc728dc(null,_0x41fe7b);});},'filename':function(_0x52cff8,_0x2cc2d0,_0x271229){const _0x167d01=_0x2cc2d0[_0xfd2d('0x2d')][_0xfd2d('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x56fdca=path['extname'](_0x167d01);const _0x3b8101=Date[_0xfd2d('0x3a')]()+'-'+_0x167d01['replace'](_0x56fdca,'')+_0x56fdca;_0x271229(null,_0x3b8101);}})});router[_0xfd2d('0x25')](_0xfd2d('0x3b'),offlineUploadMulter[_0xfd2d('0x3c')](),controller[_0xfd2d('0x3d')]);router[_0xfd2d('0x25')](_0xfd2d('0x19'),auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x3e')]);router[_0xfd2d('0x25')]('/:id/applications',auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x3f')]);router[_0xfd2d('0x25')](_0xfd2d('0x1f'),auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x40')]);router[_0xfd2d('0x25')](_0xfd2d('0x41'),auth[_0xfd2d('0x9')](),controller['addAgents']);router[_0xfd2d('0x42')]('/:id',auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x43')]);router['delete'](_0xfd2d('0xc'),auth[_0xfd2d('0x9')](),controller['destroy']);router[_0xfd2d('0x44')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xfd2d('0x45')]);router[_0xfd2d('0x44')](_0xfd2d('0x10'),auth[_0xfd2d('0x9')](),controller['removeAnswers']);router[_0xfd2d('0x44')]('/:id/users',auth[_0xfd2d('0x9')](),controller[_0xfd2d('0x46')]);module[_0xfd2d('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index dc9f14e..bf48d47 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 _0x32c3=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x32c3,0x197));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};var beaverLogger=require(_0x332c('0x0'));var express=require(_0x332c('0x1'));var auth=require(_0x332c('0x2'));var config=require(_0x332c('0x3'));var router=express[_0x332c('0x4')]();var isProduction=config[_0x332c('0x5')]===_0x332c('0x6')||![];function clientSideLogs(_0x569bba,_0x41b581,_0x55c82c){var _0x2b36ad=_0x569bba[_0x332c('0x7')][_0x332c('0x8')](_0x332c('0x9'));if(!_0x2b36ad){throw new Error(_0x332c('0xa'));}return beaverLogger[_0x332c('0xb')]({'uri':_0x332c('0xc'),'logger':_0x2b36ad,'enableCors':!isProduction})(_0x569bba,_0x41b581,_0x55c82c);}router[_0x332c('0xd')](auth[_0x332c('0xe')](),clientSideLogs);module[_0x332c('0xf')]=router; \ No newline at end of file +var _0xbbc6=['app','get','Client-Side\x20logger\x20not\x20found!','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','production'];(function(_0x137759,_0x58921b){var _0xc0ed9f=function(_0x2ad8bf){while(--_0x2ad8bf){_0x137759['push'](_0x137759['shift']());}};_0xc0ed9f(++_0x58921b);}(_0xbbc6,0x1ef));var _0x6bbc=function(_0x1f3e6d,_0x1574e1){_0x1f3e6d=_0x1f3e6d-0x0;var _0x74a5b1=_0xbbc6[_0x1f3e6d];return _0x74a5b1;};var beaverLogger=require(_0x6bbc('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x6bbc('0x1'));var router=express[_0x6bbc('0x2')]();var isProduction=config[_0x6bbc('0x3')]===_0x6bbc('0x4')||![];function clientSideLogs(_0x580207,_0xa11d02,_0xa2edc6){var _0x6b1b64=_0x580207[_0x6bbc('0x5')][_0x6bbc('0x6')]('client-side-logger');if(!_0x6b1b64){throw new Error(_0x6bbc('0x7'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x6b1b64,'enableCors':!isProduction})(_0x580207,_0xa11d02,_0xa2edc6);}router['use'](auth[_0x6bbc('0x8')](),clientSideLogs);module[_0x6bbc('0x9')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 3a1aa6e..44e0932 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 _0xa1f9=['STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x37012f,_0x53f654){var _0x4903cc=function(_0x8cfceb){while(--_0x8cfceb){_0x37012f['push'](_0x37012f['shift']());}};_0x4903cc(++_0x53f654);}(_0xa1f9,0x82));var _0x9a1f=function(_0x1194cf,_0x3e40b2){_0x1194cf=_0x1194cf-0x0;var _0x12cd20=_0xa1f9[_0x1194cf];return _0x12cd20;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9a1f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9a1f('0x1')](_0x9a1f('0x2'),'Google',_0x9a1f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9a1f('0x1')](_0x9a1f('0x4'),_0x9a1f('0x5'))},'data1':{'type':Sequelize[_0x9a1f('0x0')],'comment':_0x9a1f('0x6')},'data2':{'type':Sequelize[_0x9a1f('0x0')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x9a1f('0x0')],'comment':_0x9a1f('0x7')},'data4':{'type':Sequelize[_0x9a1f('0x0')],'comment':_0x9a1f('0x8')},'data5':{'type':Sequelize[_0x9a1f('0x9')],'comment':_0x9a1f('0xa')},'data6':{'type':Sequelize[_0x9a1f('0x9')],'comment':_0x9a1f('0xb')},'data7':{'type':Sequelize[_0x9a1f('0x9')],'comment':_0x9a1f('0xc')}}; \ No newline at end of file +var _0x6a48=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x6a48,0xa0));var _0x86a4=function(_0x5c4865,_0x2d7a7f){_0x5c4865=_0x5c4865-0x0;var _0x477869=_0x6a48[_0x5c4865];return _0x477869;};'use strict';var Sequelize=require(_0x86a4('0x0'));module[_0x86a4('0x1')]={'name':{'type':Sequelize[_0x86a4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x86a4('0x3')](_0x86a4('0x4'),_0x86a4('0x5'),_0x86a4('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x86a4('0x3')](_0x86a4('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x86a4('0x8')},'data2':{'type':Sequelize[_0x86a4('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x86a4('0x9')},'data4':{'type':Sequelize[_0x86a4('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x86a4('0xa')],'comment':_0x86a4('0xb')},'data6':{'type':Sequelize[_0x86a4('0xa')],'comment':_0x86a4('0xc')},'data7':{'type':Sequelize[_0x86a4('0xa')],'comment':_0x86a4('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 12f0ee4..fbcffff 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 _0x3395=['error','stack','name','send','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','show','params','length','decryptString','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy'];(function(_0x387340,_0x30e8bd){var _0x14b27a=function(_0x4736e9){while(--_0x4736e9){_0x387340['push'](_0x387340['shift']());}};_0x14b27a(++_0x30e8bd);}(_0x3395,0x1d3));var _0x5339=function(_0x5ade40,_0x254d9d){_0x5ade40=_0x5ade40-0x0;var _0x30a11b=_0x3395[_0x5ade40];return _0x30a11b;};'use strict';var _=require('lodash');var Redis=require(_0x5339('0x0'));var qs=require(_0x5339('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x5339('0x2'));var logger=require(_0x5339('0x3'))(_0x5339('0x4'));var db=require(_0x5339('0x5'))['db'];var oauth=require(_0x5339('0x6'));config[_0x5339('0x7')]=_[_0x5339('0x8')](config[_0x5339('0x7')],{'host':_0x5339('0x9'),'port':0x18eb});var socket=require(_0x5339('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x5339('0x7')]);function respondWithStatusCode(_0xf4bffc,_0x224de3){_0x224de3=_0x224de3||0xcc;return function(_0x54238d){if(_0x54238d){return _0xf4bffc['sendStatus'](_0x224de3);}return _0xf4bffc[_0x5339('0xb')](_0x224de3)[_0x5339('0xc')]();};}function respondWithResult(_0x4dfdf8,_0x42cd5e){_0x42cd5e=_0x42cd5e||0xc8;return function(_0x53c462){if(_0x53c462){return _0x4dfdf8[_0x5339('0xb')](_0x42cd5e)[_0x5339('0xd')](_0x53c462);}};}function respondWithFilteredResult(_0x12ede1,_0x32ac1b){return function(_0x2aac08){if(_0x2aac08){var _0x287e95=typeof _0x32ac1b[_0x5339('0xe')]===_0x5339('0xf')&&typeof _0x32ac1b[_0x5339('0x10')]===_0x5339('0xf');var _0x174352=_0x2aac08[_0x5339('0x11')];var _0x5eb3c7=_0x287e95?0x0:_0x32ac1b['offset'];var _0x476e95=_0x287e95?_0x2aac08[_0x5339('0x11')]:_0x32ac1b[_0x5339('0xe')]+_0x32ac1b[_0x5339('0x10')];var _0x3628ea;if(_0x476e95>=_0x174352){_0x476e95=_0x174352;_0x3628ea=0xc8;}else{_0x3628ea=0xce;}_0x12ede1[_0x5339('0xb')](_0x3628ea);return _0x12ede1[_0x5339('0x12')](_0x5339('0x13'),_0x5eb3c7+'-'+_0x476e95+'/'+_0x174352)['json'](_0x2aac08);}return null;};}function saveUpdates(_0x5a8d3e){return function(_0x43306f){if(_0x43306f){return _0x43306f[_0x5339('0x14')](_0x5a8d3e)[_0x5339('0x15')](function(_0x565564){return _0x565564;});}return null;};}function removeEntity(_0x554c9d){return function(_0x19c084){if(_0x19c084){return _0x19c084[_0x5339('0x16')]()[_0x5339('0x15')](function(){_0x554c9d[_0x5339('0xb')](0xcc)[_0x5339('0xc')]();});}};}function handleEntityNotFound(_0x24d982){return function(_0x44e34b){if(!_0x44e34b){_0x24d982['sendStatus'](0x194);}return _0x44e34b;};}function handleError(_0x354d05,_0xafecd1){_0xafecd1=_0xafecd1||0x1f4;return function(_0x4793e8){logger[_0x5339('0x17')](_0x4793e8[_0x5339('0x18')]);if(_0x4793e8['name']){delete _0x4793e8[_0x5339('0x19')];}_0x354d05[_0x5339('0xb')](_0xafecd1)[_0x5339('0x1a')](_0x4793e8);};}function maskClientSecret(_0x2effed){return _['padEnd'](_0x2effed['slice'](0x0,0x3),0x14,'*');}exports[_0x5339('0x1b')]=function(_0x48bd42,_0x4bb47e){var _0x23c682={},_0x1cc0e8={},_0x6ac33f={'count':0x0,'rows':[]};var _0xafc43e=_[_0x5339('0x1c')](db[_0x5339('0x1d')][_0x5339('0x1e')],function(_0x28bbe6){return{'name':_0x28bbe6[_0x5339('0x1f')],'type':_0x28bbe6[_0x5339('0x20')][_0x5339('0x21')]};});_0x1cc0e8[_0x5339('0x22')]=_[_0x5339('0x1c')](_0xafc43e,_0x5339('0x19'));_0x1cc0e8[_0x5339('0x23')]=_[_0x5339('0x24')](_0x48bd42[_0x5339('0x23')]);_0x1cc0e8[_0x5339('0x25')]=_['intersection'](_0x1cc0e8[_0x5339('0x22')],_0x1cc0e8[_0x5339('0x23')]);_0x23c682[_0x5339('0x26')]=_[_0x5339('0x27')](_0x1cc0e8[_0x5339('0x22')],qs[_0x5339('0x28')](_0x48bd42[_0x5339('0x23')]['fields']));_0x23c682[_0x5339('0x26')]=_0x23c682[_0x5339('0x26')]['length']?_0x23c682[_0x5339('0x26')]:_0x1cc0e8[_0x5339('0x22')];if(!_0x48bd42[_0x5339('0x23')][_0x5339('0x29')]('nolimit')){_0x23c682['limit']=qs[_0x5339('0x10')](_0x48bd42[_0x5339('0x23')][_0x5339('0x10')]);_0x23c682[_0x5339('0xe')]=qs[_0x5339('0xe')](_0x48bd42[_0x5339('0x23')][_0x5339('0xe')]);}_0x23c682[_0x5339('0x2a')]=qs['sort'](_0x48bd42['query'][_0x5339('0x2b')]);_0x23c682['where']=qs[_0x5339('0x25')](_[_0x5339('0x2c')](_0x48bd42[_0x5339('0x23')],_0x1cc0e8[_0x5339('0x25')]),_0xafc43e);if(_0x48bd42['query']['filter']){_0x23c682[_0x5339('0x2d')]=_['merge'](_0x23c682['where'],{'$or':_[_0x5339('0x1c')](_0xafc43e,function(_0x2802a2){if(_0x2802a2[_0x5339('0x20')]!==_0x5339('0x2e')){var _0x4005e5={};_0x4005e5[_0x2802a2[_0x5339('0x19')]]={'$like':'%'+_0x48bd42['query'][_0x5339('0x2f')]+'%'};return _0x4005e5;}})});}_0x23c682=_[_0x5339('0x30')]({},_0x23c682,_0x48bd42[_0x5339('0x31')]);var _0xaa8aed={'where':_0x23c682[_0x5339('0x2d')]};return db['CloudProvider']['count'](_0xaa8aed)['then'](function(_0x353d65){_0x6ac33f['count']=_0x353d65;if(_0x48bd42[_0x5339('0x23')][_0x5339('0x32')]){_0x23c682[_0x5339('0x33')]=[{'all':!![]}];}return db[_0x5339('0x1d')][_0x5339('0x34')](_0x23c682);})[_0x5339('0x15')](function(_0x3943ca){_0x6ac33f[_0x5339('0x35')]=_[_0x5339('0x1c')](_0x3943ca,function(_0x2dd5d6){if(_0x2dd5d6[_0x5339('0x36')]===_0x5339('0x37')){var _0x38a7b8=encryptor['decryptString'](_0x2dd5d6[_0x5339('0x38')]);_0x2dd5d6[_0x5339('0x38')]=maskClientSecret(_0x38a7b8);}return _0x2dd5d6;});return _0x6ac33f;})[_0x5339('0x15')](respondWithFilteredResult(_0x4bb47e,_0x23c682))['catch'](handleError(_0x4bb47e,null));};exports[_0x5339('0x39')]=function(_0x1fb63f,_0x549fe1){var _0x39c6a6={'raw':!![],'where':{'id':_0x1fb63f[_0x5339('0x3a')]['id']}},_0x20fabe={};_0x20fabe[_0x5339('0x22')]=_['keys'](db[_0x5339('0x1d')][_0x5339('0x1e')]);_0x20fabe['query']=_[_0x5339('0x24')](_0x1fb63f[_0x5339('0x23')]);_0x20fabe[_0x5339('0x25')]=_[_0x5339('0x27')](_0x20fabe[_0x5339('0x22')],_0x20fabe[_0x5339('0x23')]);_0x39c6a6['attributes']=_['intersection'](_0x20fabe['model'],qs[_0x5339('0x28')](_0x1fb63f[_0x5339('0x23')][_0x5339('0x28')]));_0x39c6a6[_0x5339('0x26')]=_0x39c6a6[_0x5339('0x26')][_0x5339('0x3b')]?_0x39c6a6[_0x5339('0x26')]:_0x20fabe[_0x5339('0x22')];if(_0x1fb63f[_0x5339('0x23')][_0x5339('0x32')]){_0x39c6a6[_0x5339('0x33')]=[{'all':!![]}];}_0x39c6a6=_[_0x5339('0x30')]({},_0x39c6a6,_0x1fb63f['options']);return db[_0x5339('0x1d')]['find'](_0x39c6a6)[_0x5339('0x15')](handleEntityNotFound(_0x549fe1,null))['then'](function(_0xb303f9){if(_0xb303f9[_0x5339('0x36')]===_0x5339('0x37')){var _0x2cb5be=encryptor[_0x5339('0x3c')](_0xb303f9[_0x5339('0x38')]);_0xb303f9['data3']=maskClientSecret(_0x2cb5be);}return _0xb303f9;})[_0x5339('0x15')](respondWithResult(_0x549fe1,null))['catch'](handleError(_0x549fe1,null));};exports[_0x5339('0x3d')]=function(_0x5b6bc3,_0x100114){if(!_0x5b6bc3['body'][_0x5339('0x19')])throw new Error(_0x5339('0x3e'));if(!_0x5b6bc3['body']['service'])throw new Error(_0x5339('0x3f'));var _0x362d46=db[_0x5339('0x1d')][_0x5339('0x1e')][_0x5339('0x36')][_0x5339('0x40')];if(!_0x362d46[_0x5339('0x41')](_0x5b6bc3[_0x5339('0x42')][_0x5339('0x36')]))throw new Error(_0x5339('0x43')+_0x362d46[_0x5339('0x44')](',\x20'));if(_0x5b6bc3[_0x5339('0x42')][_0x5339('0x36')]==='MicrosoftAzure'&&_0x5b6bc3[_0x5339('0x42')][_0x5339('0x38')]){_0x5b6bc3[_0x5339('0x42')][_0x5339('0x38')]=encryptor[_0x5339('0x45')](_0x5b6bc3[_0x5339('0x42')][_0x5339('0x38')]);}return db[_0x5339('0x1d')][_0x5339('0x3d')](_0x5b6bc3[_0x5339('0x42')],{})[_0x5339('0x15')](respondWithResult(_0x100114,0xc9))[_0x5339('0x46')](handleError(_0x100114,null));};exports['update']=function(_0x53f947,_0x44ba1d){if(_0x53f947[_0x5339('0x42')]['id']){delete _0x53f947[_0x5339('0x42')]['id'];}return db[_0x5339('0x1d')][_0x5339('0x47')]({'where':{'id':_0x53f947['params']['id']}})[_0x5339('0x15')](handleEntityNotFound(_0x44ba1d,null))[_0x5339('0x15')](function(_0x826dfb){if(_0x826dfb[_0x5339('0x36')]===_0x5339('0x37')&&_0x53f947[_0x5339('0x42')]['data3']){_0x53f947[_0x5339('0x42')][_0x5339('0x38')]=encryptor['encryptString'](_0x53f947[_0x5339('0x42')]['data3']);}return _0x826dfb;})[_0x5339('0x15')](saveUpdates(_0x53f947[_0x5339('0x42')],null))[_0x5339('0x15')](respondWithResult(_0x44ba1d,null))[_0x5339('0x46')](handleError(_0x44ba1d,null));};exports['destroy']=function(_0x2fe344,_0x223893){return db['CloudProvider']['find']({'where':{'id':_0x2fe344['params']['id']}})['then'](handleEntityNotFound(_0x223893,null))['then'](removeEntity(_0x223893,null))['catch'](handleError(_0x223893,null));};exports[_0x5339('0x48')]=function(_0x5d1dd6,_0x30d483){return db[_0x5339('0x1d')][_0x5339('0x49')]({'where':{'id':_0x5d1dd6[_0x5339('0x3a')]['id']},'raw':!![]})[_0x5339('0x15')](function(_0x18d298){if(!_0x18d298)return _0x30d483['sendStatus'](0x194);return{'url':oauth[_0x5339('0x4a')](_0x18d298,_0x5d1dd6['user']['id'])};})[_0x5339('0x15')](respondWithResult(_0x30d483,null))[_0x5339('0x46')](handleError(_0x30d483,null));};exports[_0x5339('0x4b')]=function(_0x4d9aed,_0x8b7f86){var _0x19bcd8=_0x4d9aed[_0x5339('0x42')];var _0x589558;var _0x178dd7;if(_0x19bcd8[_0x5339('0x17')])throw _0x19bcd8;redis[_0x5339('0x4c')](_0x19bcd8[_0x5339('0x4d')])[_0x5339('0x15')](function(_0x2b372a){if(!_0x2b372a)throw new Error(_0x5339('0x4e'));_0x589558=JSON['parse'](_0x2b372a);var _0x54ec2d=Buffer[_0x5339('0x4f')](_0x19bcd8['state'],'base64')[_0x5339('0x50')](_0x5339('0x51'));_0x178dd7=JSON[_0x5339('0x52')](_0x54ec2d);if(!oauth['isValidIdToken'](_0x19bcd8[_0x5339('0x53')],_0x589558[_0x5339('0x54')]))throw new Error(_0x5339('0x55'));redis[_0x5339('0x56')](_0x19bcd8[_0x5339('0x4d')]);return oauth[_0x5339('0x57')](_0x19bcd8[_0x5339('0x58')],_0x589558);})['then'](function(_0x413d98){_0x589558[_0x5339('0x59')]=_0x413d98[_0x5339('0x5a')];_0x589558['data6']=_0x413d98[_0x5339('0x5b')];return db[_0x5339('0x1d')][_0x5339('0x14')]({'data5':_0x589558[_0x5339('0x59')],'data6':_0x589558[_0x5339('0x5c')]},{'where':{'id':_0x589558['id']}});})[_0x5339('0x15')](function(){oauth[_0x5339('0x5d')](_0x589558);socket[_0x5339('0x5e')]('microsoftAuthorization:success',{'id':_0x178dd7['id']});return;})[_0x5339('0x15')](respondWithStatusCode(_0x8b7f86,null))[_0x5339('0x46')](function(_0xdf057d){if(_0x178dd7){socket[_0x5339('0x5e')]('microsoftAuthorization:error',{'id':_0x178dd7['id']});}if(!_0x589558){logger[_0x5339('0x17')](_0x5339('0x5f'),_0xdf057d);return _0x8b7f86[_0x5339('0xb')](0x1f4)[_0x5339('0x1a')](_0xdf057d['message']);}logger[_0x5339('0x17')](_0x5339('0x60'),_0x589558['id'],JSON[_0x5339('0x61')](_0xdf057d));});}; \ No newline at end of file +var _0xb153=['destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','from','state','base64','ascii','parse','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','data5','data6','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','json','update','then','error','name','send','CloudProvider','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','encryptString'];(function(_0x4154e4,_0x1f31fb){var _0x166cea=function(_0x57bf46){while(--_0x57bf46){_0x4154e4['push'](_0x4154e4['shift']());}};_0x166cea(++_0x1f31fb);}(_0xb153,0x13b));var _0x3b15=function(_0x5c9640,_0x176dd9){_0x5c9640=_0x5c9640-0x0;var _0x4ee51e=_0xb153[_0x5c9640];return _0x4ee51e;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x3b15('0x0'));var config=require(_0x3b15('0x1'));var logger=require(_0x3b15('0x2'))(_0x3b15('0x3'));var db=require(_0x3b15('0x4'))['db'];var oauth=require(_0x3b15('0x5'));config[_0x3b15('0x6')]=_[_0x3b15('0x7')](config[_0x3b15('0x6')],{'host':_0x3b15('0x8'),'port':0x18eb});var socket=require(_0x3b15('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x3b15('0x6')]);function respondWithStatusCode(_0xf7cda8,_0x12db40){_0x12db40=_0x12db40||0xcc;return function(_0x2b8efc){if(_0x2b8efc){return _0xf7cda8[_0x3b15('0xa')](_0x12db40);}return _0xf7cda8['status'](_0x12db40)[_0x3b15('0xb')]();};}function respondWithResult(_0x445e27,_0x43197b){_0x43197b=_0x43197b||0xc8;return function(_0x2632f9){if(_0x2632f9){return _0x445e27[_0x3b15('0xc')](_0x43197b)['json'](_0x2632f9);}};}function respondWithFilteredResult(_0x223396,_0x3e9490){return function(_0x1492f9){if(_0x1492f9){var _0x3f60bf=typeof _0x3e9490[_0x3b15('0xd')]===_0x3b15('0xe')&&typeof _0x3e9490[_0x3b15('0xf')]===_0x3b15('0xe');var _0x521fd3=_0x1492f9['count'];var _0x5ce1f2=_0x3f60bf?0x0:_0x3e9490[_0x3b15('0xd')];var _0x7d6ba1=_0x3f60bf?_0x1492f9[_0x3b15('0x10')]:_0x3e9490[_0x3b15('0xd')]+_0x3e9490[_0x3b15('0xf')];var _0x190d47;if(_0x7d6ba1>=_0x521fd3){_0x7d6ba1=_0x521fd3;_0x190d47=0xc8;}else{_0x190d47=0xce;}_0x223396[_0x3b15('0xc')](_0x190d47);return _0x223396[_0x3b15('0x11')]('Content-Range',_0x5ce1f2+'-'+_0x7d6ba1+'/'+_0x521fd3)[_0x3b15('0x12')](_0x1492f9);}return null;};}function saveUpdates(_0x181320){return function(_0x3c3dcf){if(_0x3c3dcf){return _0x3c3dcf[_0x3b15('0x13')](_0x181320)[_0x3b15('0x14')](function(_0xbab224){return _0xbab224;});}return null;};}function removeEntity(_0x6a4571){return function(_0x530061){if(_0x530061){return _0x530061['destroy']()[_0x3b15('0x14')](function(){_0x6a4571['status'](0xcc)[_0x3b15('0xb')]();});}};}function handleEntityNotFound(_0x3837c8){return function(_0x46c573){if(!_0x46c573){_0x3837c8[_0x3b15('0xa')](0x194);}return _0x46c573;};}function handleError(_0x2e2c60,_0x1bf0cb){_0x1bf0cb=_0x1bf0cb||0x1f4;return function(_0x42b9a8){logger[_0x3b15('0x15')](_0x42b9a8['stack']);if(_0x42b9a8[_0x3b15('0x16')]){delete _0x42b9a8[_0x3b15('0x16')];}_0x2e2c60[_0x3b15('0xc')](_0x1bf0cb)[_0x3b15('0x17')](_0x42b9a8);};}function maskClientSecret(_0x440b32){return _['padEnd'](_0x440b32['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x1fa4b8,_0x20cb8b){var _0x16f26b={},_0x5dcc15={},_0x505a27={'count':0x0,'rows':[]};var _0x1612fe=_['map'](db[_0x3b15('0x18')][_0x3b15('0x19')],function(_0x2faa20){return{'name':_0x2faa20[_0x3b15('0x1a')],'type':_0x2faa20[_0x3b15('0x1b')]['key']};});_0x5dcc15[_0x3b15('0x1c')]=_[_0x3b15('0x1d')](_0x1612fe,_0x3b15('0x16'));_0x5dcc15[_0x3b15('0x1e')]=_[_0x3b15('0x1f')](_0x1fa4b8['query']);_0x5dcc15['filters']=_[_0x3b15('0x20')](_0x5dcc15['model'],_0x5dcc15['query']);_0x16f26b[_0x3b15('0x21')]=_['intersection'](_0x5dcc15[_0x3b15('0x1c')],qs[_0x3b15('0x22')](_0x1fa4b8[_0x3b15('0x1e')]['fields']));_0x16f26b[_0x3b15('0x21')]=_0x16f26b[_0x3b15('0x21')][_0x3b15('0x23')]?_0x16f26b[_0x3b15('0x21')]:_0x5dcc15[_0x3b15('0x1c')];if(!_0x1fa4b8[_0x3b15('0x1e')][_0x3b15('0x24')](_0x3b15('0x25'))){_0x16f26b[_0x3b15('0xf')]=qs[_0x3b15('0xf')](_0x1fa4b8['query']['limit']);_0x16f26b['offset']=qs['offset'](_0x1fa4b8[_0x3b15('0x1e')][_0x3b15('0xd')]);}_0x16f26b[_0x3b15('0x26')]=qs[_0x3b15('0x27')](_0x1fa4b8[_0x3b15('0x1e')][_0x3b15('0x27')]);_0x16f26b[_0x3b15('0x28')]=qs[_0x3b15('0x29')](_[_0x3b15('0x2a')](_0x1fa4b8['query'],_0x5dcc15[_0x3b15('0x29')]),_0x1612fe);if(_0x1fa4b8[_0x3b15('0x1e')][_0x3b15('0x2b')]){_0x16f26b['where']=_[_0x3b15('0x2c')](_0x16f26b['where'],{'$or':_['map'](_0x1612fe,function(_0x47bdc6){if(_0x47bdc6[_0x3b15('0x1b')]!=='VIRTUAL'){var _0x72d8d2={};_0x72d8d2[_0x47bdc6['name']]={'$like':'%'+_0x1fa4b8[_0x3b15('0x1e')][_0x3b15('0x2b')]+'%'};return _0x72d8d2;}})});}_0x16f26b=_[_0x3b15('0x2c')]({},_0x16f26b,_0x1fa4b8['options']);var _0xa7e8be={'where':_0x16f26b[_0x3b15('0x28')]};return db[_0x3b15('0x18')]['count'](_0xa7e8be)[_0x3b15('0x14')](function(_0x2efa7c){_0x505a27[_0x3b15('0x10')]=_0x2efa7c;if(_0x1fa4b8[_0x3b15('0x1e')][_0x3b15('0x2d')]){_0x16f26b[_0x3b15('0x2e')]=[{'all':!![]}];}return db[_0x3b15('0x18')][_0x3b15('0x2f')](_0x16f26b);})[_0x3b15('0x14')](function(_0x2ec39b){_0x505a27[_0x3b15('0x30')]=_[_0x3b15('0x1d')](_0x2ec39b,function(_0x3ed598){if(_0x3ed598[_0x3b15('0x31')]===_0x3b15('0x32')){var _0xb2bdb1=encryptor[_0x3b15('0x33')](_0x3ed598[_0x3b15('0x34')]);_0x3ed598[_0x3b15('0x34')]=maskClientSecret(_0xb2bdb1);}return _0x3ed598;});return _0x505a27;})['then'](respondWithFilteredResult(_0x20cb8b,_0x16f26b))[_0x3b15('0x35')](handleError(_0x20cb8b,null));};exports[_0x3b15('0x36')]=function(_0x5cf817,_0x1b824e){var _0x2c60e5={'raw':!![],'where':{'id':_0x5cf817[_0x3b15('0x37')]['id']}},_0xdb5bb6={};_0xdb5bb6['model']=_['keys'](db[_0x3b15('0x18')][_0x3b15('0x19')]);_0xdb5bb6[_0x3b15('0x1e')]=_[_0x3b15('0x1f')](_0x5cf817[_0x3b15('0x1e')]);_0xdb5bb6['filters']=_[_0x3b15('0x20')](_0xdb5bb6[_0x3b15('0x1c')],_0xdb5bb6[_0x3b15('0x1e')]);_0x2c60e5[_0x3b15('0x21')]=_[_0x3b15('0x20')](_0xdb5bb6[_0x3b15('0x1c')],qs[_0x3b15('0x22')](_0x5cf817[_0x3b15('0x1e')][_0x3b15('0x22')]));_0x2c60e5['attributes']=_0x2c60e5[_0x3b15('0x21')][_0x3b15('0x23')]?_0x2c60e5['attributes']:_0xdb5bb6[_0x3b15('0x1c')];if(_0x5cf817[_0x3b15('0x1e')][_0x3b15('0x2d')]){_0x2c60e5['include']=[{'all':!![]}];}_0x2c60e5=_['merge']({},_0x2c60e5,_0x5cf817[_0x3b15('0x38')]);return db['CloudProvider'][_0x3b15('0x39')](_0x2c60e5)[_0x3b15('0x14')](handleEntityNotFound(_0x1b824e,null))['then'](function(_0x3f2ddf){if(_0x3f2ddf[_0x3b15('0x31')]==='MicrosoftAzure'){var _0x5bab1d=encryptor['decryptString'](_0x3f2ddf['data3']);_0x3f2ddf[_0x3b15('0x34')]=maskClientSecret(_0x5bab1d);}return _0x3f2ddf;})[_0x3b15('0x14')](respondWithResult(_0x1b824e,null))['catch'](handleError(_0x1b824e,null));};exports[_0x3b15('0x3a')]=function(_0x4e0749,_0x127608){if(!_0x4e0749['body'][_0x3b15('0x16')])throw new Error(_0x3b15('0x3b'));if(!_0x4e0749[_0x3b15('0x3c')][_0x3b15('0x31')])throw new Error(_0x3b15('0x3d'));var _0x54c448=db[_0x3b15('0x18')][_0x3b15('0x19')][_0x3b15('0x31')][_0x3b15('0x3e')];if(!_0x54c448[_0x3b15('0x3f')](_0x4e0749[_0x3b15('0x3c')][_0x3b15('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x54c448['join'](',\x20'));if(_0x4e0749[_0x3b15('0x3c')][_0x3b15('0x31')]===_0x3b15('0x32')&&_0x4e0749['body'][_0x3b15('0x34')]){_0x4e0749[_0x3b15('0x3c')][_0x3b15('0x34')]=encryptor[_0x3b15('0x40')](_0x4e0749['body'][_0x3b15('0x34')]);}return db[_0x3b15('0x18')][_0x3b15('0x3a')](_0x4e0749[_0x3b15('0x3c')],{})[_0x3b15('0x14')](respondWithResult(_0x127608,0xc9))[_0x3b15('0x35')](handleError(_0x127608,null));};exports[_0x3b15('0x13')]=function(_0x3f03a4,_0x51132f){if(_0x3f03a4[_0x3b15('0x3c')]['id']){delete _0x3f03a4[_0x3b15('0x3c')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x3f03a4[_0x3b15('0x37')]['id']}})[_0x3b15('0x14')](handleEntityNotFound(_0x51132f,null))[_0x3b15('0x14')](function(_0x49a43a){if(_0x49a43a[_0x3b15('0x31')]==='MicrosoftAzure'&&_0x3f03a4['body'][_0x3b15('0x34')]){_0x3f03a4[_0x3b15('0x3c')][_0x3b15('0x34')]=encryptor[_0x3b15('0x40')](_0x3f03a4['body'][_0x3b15('0x34')]);}return _0x49a43a;})[_0x3b15('0x14')](saveUpdates(_0x3f03a4[_0x3b15('0x3c')],null))[_0x3b15('0x14')](respondWithResult(_0x51132f,null))[_0x3b15('0x35')](handleError(_0x51132f,null));};exports[_0x3b15('0x41')]=function(_0x1b062d,_0x47afcf){return db[_0x3b15('0x18')][_0x3b15('0x39')]({'where':{'id':_0x1b062d[_0x3b15('0x37')]['id']}})[_0x3b15('0x14')](handleEntityNotFound(_0x47afcf,null))['then'](removeEntity(_0x47afcf,null))['catch'](handleError(_0x47afcf,null));};exports[_0x3b15('0x42')]=function(_0x3b9693,_0xab63b8){return db[_0x3b15('0x18')][_0x3b15('0x43')]({'where':{'id':_0x3b9693[_0x3b15('0x37')]['id']},'raw':!![]})[_0x3b15('0x14')](function(_0x39aacc){if(!_0x39aacc)return _0xab63b8[_0x3b15('0xa')](0x194);return{'url':oauth[_0x3b15('0x44')](_0x39aacc,_0x3b9693[_0x3b15('0x45')]['id'])};})[_0x3b15('0x14')](respondWithResult(_0xab63b8,null))[_0x3b15('0x35')](handleError(_0xab63b8,null));};exports[_0x3b15('0x46')]=function(_0x2e4127,_0xea82a9){var _0x2a1425=_0x2e4127[_0x3b15('0x3c')];var _0x3e2c5b;var _0xbb96c;if(_0x2a1425[_0x3b15('0x15')])throw _0x2a1425;redis[_0x3b15('0x47')](_0x2a1425['state'])[_0x3b15('0x14')](function(_0x2024a6){if(!_0x2024a6)throw new Error(_0x3b15('0x48'));_0x3e2c5b=JSON['parse'](_0x2024a6);var _0x362420=Buffer[_0x3b15('0x49')](_0x2a1425[_0x3b15('0x4a')],_0x3b15('0x4b'))['toString'](_0x3b15('0x4c'));_0xbb96c=JSON[_0x3b15('0x4d')](_0x362420);if(!oauth[_0x3b15('0x4e')](_0x2a1425['id_token'],_0x3e2c5b[_0x3b15('0x4f')]))throw new Error(_0x3b15('0x50'));redis['del'](_0x2a1425[_0x3b15('0x4a')]);return oauth[_0x3b15('0x51')](_0x2a1425[_0x3b15('0x52')],_0x3e2c5b);})[_0x3b15('0x14')](function(_0x202ff1){_0x3e2c5b['data5']=_0x202ff1[_0x3b15('0x53')];_0x3e2c5b['data6']=_0x202ff1[_0x3b15('0x54')];return db[_0x3b15('0x18')][_0x3b15('0x13')]({'data5':_0x3e2c5b[_0x3b15('0x55')],'data6':_0x3e2c5b[_0x3b15('0x56')]},{'where':{'id':_0x3e2c5b['id']}});})['then'](function(){oauth[_0x3b15('0x57')](_0x3e2c5b);socket['emit'](_0x3b15('0x58'),{'id':_0xbb96c['id']});return;})['then'](respondWithStatusCode(_0xea82a9,null))[_0x3b15('0x35')](function(_0x3587c3){if(_0xbb96c){socket[_0x3b15('0x59')](_0x3b15('0x5a'),{'id':_0xbb96c['id']});}if(!_0x3e2c5b){logger[_0x3b15('0x15')](_0x3b15('0x5b'),_0x3587c3);return _0xea82a9[_0x3b15('0xc')](0x1f4)[_0x3b15('0x17')](_0x3587c3[_0x3b15('0x5c')]);}logger[_0x3b15('0x15')](_0x3b15('0x5d'),_0x3e2c5b['id'],JSON[_0x3b15('0x5e')](_0x3587c3));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index df5525a..9cc6954 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 _0xc13e=['rimraf','../../config/environment','exports','define','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xc13e,0xa1));var _0xec13=function(_0x5630dc,_0x3fd55a){_0x5630dc=_0x5630dc-0x0;var _0x3229da=_0xc13e[_0x5630dc];return _0x3229da;};'use strict';var _=require(_0xec13('0x0'));var util=require(_0xec13('0x1'));var logger=require(_0xec13('0x2'))(_0xec13('0x3'));var moment=require(_0xec13('0x4'));var BPromise=require(_0xec13('0x5'));var rp=require(_0xec13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec13('0x7'));var config=require(_0xec13('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xec13('0x9')]=function(_0x5459b5,_0x4cd47f){return _0x5459b5[_0xec13('0xa')]('CloudProvider',attributes,{'tableName':_0xec13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce92=['path','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b6456,_0x3909b){var _0xc8de=function(_0x1e43c8){while(--_0x1e43c8){_0x1b6456['push'](_0x1b6456['shift']());}};_0xc8de(++_0x3909b);}(_0xce92,0x186));var _0x2ce9=function(_0x159c68,_0xc544c9){_0x159c68=_0x159c68-0x0;var _0x32792f=_0xce92[_0x159c68];return _0x32792f;};'use strict';var _=require(_0x2ce9('0x0'));var util=require('util');var logger=require(_0x2ce9('0x1'))(_0x2ce9('0x2'));var moment=require(_0x2ce9('0x3'));var BPromise=require(_0x2ce9('0x4'));var rp=require(_0x2ce9('0x5'));var fs=require('fs');var path=require(_0x2ce9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x2ce9('0x7')]=function(_0x52ae15,_0x2024b4){return _0x52ae15[_0x2ce9('0x8')](_0x2ce9('0x9'),attributes,{'tableName':_0x2ce9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 5c9915b..d97d3d0 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 _0x2c89=['decode','payload','audience','isAfter','unix','exp','resolve','then','findOne','refresh_token','data6','data4','decryptString','data3','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','CloudProvider','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','data7','/.default','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','client_id','join','response_mode','form_post','scope','state','nonce','prompt','login','map','value','oauth2Claims','replace','oauth2/','data1','set'];(function(_0x18c7bb,_0x4ea395){var _0x47d2c2=function(_0x4fd515){while(--_0x4fd515){_0x18c7bb['push'](_0x18c7bb['shift']());}};_0x47d2c2(++_0x4ea395);}(_0x2c89,0x109));var _0x92c8=function(_0x536073,_0x27429b){_0x536073=_0x536073-0x0;var _0x5453ec=_0x2c89[_0x536073];return _0x5453ec;};'use strict';var _=require(_0x92c8('0x0'));var crypto=require(_0x92c8('0x1'));var jwt=require(_0x92c8('0x2'));var moment=require('moment');var Redis=require(_0x92c8('0x3'));var rp=require(_0x92c8('0x4'));var util=require('util');var encryptor=require(_0x92c8('0x5'));var config=require(_0x92c8('0x6'));var logger=require(_0x92c8('0x7'))('api');var schedule=require(_0x92c8('0x8'));var db=require(_0x92c8('0x9'))['db'];config[_0x92c8('0xa')]=_[_0x92c8('0xb')](config[_0x92c8('0xa')],{'host':_0x92c8('0xc'),'port':0x18eb});var redis=new Redis(config[_0x92c8('0xa')]);var MICROSOFT_AUTH_URL=_0x92c8('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x92c8('0xe'),'profile',_0x92c8('0xf'),_0x92c8('0x10'),_0x92c8('0x11'),_0x92c8('0x12'),_0x92c8('0x13')],'Dynamics365':[_0x92c8('0xe'),_0x92c8('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x92c8('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x92c8('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x264962){var _0x5ba709=_['map'](AZURE_AUTH_SCOPES[_0x264962['type']]);if(_0x264962[_0x92c8('0x16')]===_0x92c8('0x17'))_0x5ba709['push'](_0x264962[_0x92c8('0x18')]+_0x92c8('0x19'));return _0x5ba709['join']('\x20');}function getAccessTokenScope(_0x4bd447){if(_0x4bd447[_0x92c8('0x16')]===_0x92c8('0x1a'))return _0x92c8('0x11');if(_0x4bd447[_0x92c8('0x16')]===_0x92c8('0x17'))return _0x4bd447[_0x92c8('0x18')]+_0x92c8('0x19');}function generateMicrosoftAuthorizationUrl(_0x255807,_0x5bce42){var _0x2c97d1=MICROSOFT_AUTH_URL['replace'](_0x92c8('0x1b'),_0x255807[_0x92c8('0x1c')]);var _0xb18b32=[_0x92c8('0x1d'),_0x92c8('0x1e')];var _0x264978=Buffer[_0x92c8('0x1f')](JSON[_0x92c8('0x20')]({'id':_0x5bce42}))[_0x92c8('0x21')](_0x92c8('0x22'));var _0x20f2a0=crypto['randomBytes'](0x10)['toString']('hex');var _0x4c03c1=getAuthorizationScopes(_0x255807);var _0x40c985=[{'key':_0x92c8('0x23'),'value':_0x255807['data1']},{'key':'response_type','value':encodeURIComponent(_0xb18b32[_0x92c8('0x24')]('\x20'))},{'key':'redirect_uri','value':_0x255807['data4']},{'key':_0x92c8('0x25'),'value':_0x92c8('0x26')},{'key':_0x92c8('0x27'),'value':encodeURIComponent(_0x4c03c1)},{'key':_0x92c8('0x28'),'value':_0x264978},{'key':_0x92c8('0x29'),'value':_0x20f2a0},{'key':_0x92c8('0x2a'),'value':_0x92c8('0x2b')}];var _0x10fc75=_0x2c97d1+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x92c8('0x2c')](_0x40c985,function(_0x343c80){return _0x343c80['key']+'='+_0x343c80[_0x92c8('0x2d')];})[_0x92c8('0x24')]('&');_0x255807[_0x92c8('0x2e')]={'issuer':_0x2c97d1[_0x92c8('0x2f')](_0x92c8('0x30'),''),'audience':_0x255807[_0x92c8('0x31')],'state':_0x264978,'nonce':_0x20f2a0};redis[_0x92c8('0x32')](_0x264978,JSON['stringify'](_0x255807));return _0x10fc75;}function isValidIdToken(_0x830017,_0x107df1){try{var _0x4aabf1=jwt[_0x92c8('0x33')](_0x830017,{'complete':!![]});var _0xff876e=_0x4aabf1[_0x92c8('0x34')];if(_0xff876e['iss']!==_0x107df1['issuer'])return![];if(_0xff876e['aud']!==_0x107df1[_0x92c8('0x35')])return![];if(_0xff876e[_0x92c8('0x29')]!==_0x107df1[_0x92c8('0x29')])return![];if(moment()[_0x92c8('0x36')](moment[_0x92c8('0x37')](_0xff876e[_0x92c8('0x38')])))return![];return!![];}catch(_0x13d4bb){throw _0x13d4bb;}}function refreshOauth2MicrosoftAccessToken(_0x5bbaaa){return Promise[_0x92c8('0x39')]()[_0x92c8('0x3a')](function(){if(_0x5bbaaa['data3'])return _0x5bbaaa;return db['CloudProvider'][_0x92c8('0x3b')]({'where':{'id':_0x5bbaaa['id']},'raw':!![]});})[_0x92c8('0x3a')](function(_0x4afd1d){var _0xff8520={'grant_type':_0x92c8('0x3c'),'refresh_token':_0x4afd1d[_0x92c8('0x3d')],'scope':getAccessTokenScope(_0x4afd1d),'redirect_uri':_0x4afd1d[_0x92c8('0x3e')],'client_id':_0x4afd1d[_0x92c8('0x31')],'client_secret':encryptor[_0x92c8('0x3f')](_0x4afd1d[_0x92c8('0x40')])};var _0x18ed19={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x92c8('0x2f')](_0x92c8('0x1b'),_0x4afd1d['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xff8520,'json':!![]};return rp(_0x18ed19);})['then'](function(_0x59dad5){_0x5bbaaa[_0x92c8('0x41')]=_0x59dad5['access_token'];_0x5bbaaa['data6']=_0x59dad5[_0x92c8('0x3c')];return db['CloudProvider'][_0x92c8('0x42')]({'data5':_0x5bbaaa[_0x92c8('0x41')],'data6':_0x5bbaaa[_0x92c8('0x3d')]},{'where':{'id':_0x5bbaaa['id']}});})[_0x92c8('0x3a')](function(){return _0x5bbaaa;})[_0x92c8('0x43')](function(_0x451533){logger[_0x92c8('0x44')](_0x92c8('0x45'),_0x5bbaaa['id'],_0x451533);});}function getOauth2MicrosoftAccessToken(_0x154b09,_0x428798){var _0x24f0f5={'grant_type':_0x92c8('0x46'),'code':_0x154b09,'scope':getAccessTokenScope(_0x428798),'redirect_uri':_0x428798[_0x92c8('0x3e')],'client_id':_0x428798['data1'],'client_secret':encryptor[_0x92c8('0x3f')](_0x428798[_0x92c8('0x40')])};var _0x1fd2ca={'method':_0x92c8('0x47'),'uri':MICROSOFT_AUTH_URL[_0x92c8('0x2f')](_0x92c8('0x1b'),_0x428798['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x24f0f5,'json':!![]};return rp(_0x1fd2ca);}function startRefreshInterval(_0x55f71a){var _0x5c7f50=schedule[_0x92c8('0x48')];if(_0x5c7f50[_0x55f71a['id']])clearInterval(_0x5c7f50[_0x55f71a['id']]);_0x5c7f50[_0x55f71a['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x55f71a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x92c8('0x48')]=_0x5c7f50;}function startAllRefreshIntervals(){return db[_0x92c8('0x49')][_0x92c8('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x92c8('0x3a')](function(_0x20d094){var _0x566206=_0x20d094['map'](function(_0x2d7799){return refreshOauth2MicrosoftAccessToken(_0x2d7799)[_0x92c8('0x3a')](function(_0x10a1b1){startRefreshInterval(_0x10a1b1);});});return Promise[_0x92c8('0x4b')](_0x566206);})['catch'](function(_0x427c24){var _0x43f6be=_0x427c24?util[_0x92c8('0x4c')](_0x427c24,{'showHidden':![],'depth':null}):'';logger[_0x92c8('0x44')](_0x92c8('0x4d'),_0x43f6be);});}module[_0x92c8('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xdffe=['data7','/.default','join','{TENANT_ID}','code','id_token','toString','base64','randomBytes','client_id','data1','redirect_uri','data4','response_mode','prompt','login','key','oauth2Claims','replace','set','stringify','decode','iss','issuer','aud','audience','unix','resolve','data3','CloudProvider','findOne','decryptString','POST','then','access_token','refresh_token','update','data5','data6','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data2','intervals','bind','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','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','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push'];(function(_0x5c3fac,_0x5f0267){var _0x382099=function(_0x3f2865){while(--_0x3f2865){_0x5c3fac['push'](_0x5c3fac['shift']());}};_0x382099(++_0x5f0267);}(_0xdffe,0x7f));var _0xedff=function(_0x126252,_0x2e41d4){_0x126252=_0x126252-0x0;var _0x589e99=_0xdffe[_0x126252];return _0x589e99;};'use strict';var _=require(_0xedff('0x0'));var crypto=require(_0xedff('0x1'));var jwt=require(_0xedff('0x2'));var moment=require(_0xedff('0x3'));var Redis=require(_0xedff('0x4'));var rp=require(_0xedff('0x5'));var util=require(_0xedff('0x6'));var encryptor=require(_0xedff('0x7'));var config=require('../../config/environment');var logger=require(_0xedff('0x8'))('api');var schedule=require(_0xedff('0x9'));var db=require(_0xedff('0xa'))['db'];config[_0xedff('0xb')]=_[_0xedff('0xc')](config['redis'],{'host':_0xedff('0xd'),'port':0x18eb});var redis=new Redis(config[_0xedff('0xb')]);var MICROSOFT_AUTH_URL=_0xedff('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xedff('0xf'),_0xedff('0x10'),'email',_0xedff('0x11'),_0xedff('0x12'),_0xedff('0x13'),_0xedff('0x14')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xedff('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xedff('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3cc087){var _0x553508=_[_0xedff('0x17')](AZURE_AUTH_SCOPES[_0x3cc087[_0xedff('0x18')]]);if(_0x3cc087[_0xedff('0x18')]===_0xedff('0x19'))_0x553508[_0xedff('0x1a')](_0x3cc087[_0xedff('0x1b')]+_0xedff('0x1c'));return _0x553508[_0xedff('0x1d')]('\x20');}function getAccessTokenScope(_0x30cb7d){if(_0x30cb7d[_0xedff('0x18')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x30cb7d[_0xedff('0x18')]==='Dynamics365')return _0x30cb7d[_0xedff('0x1b')]+_0xedff('0x1c');}function generateMicrosoftAuthorizationUrl(_0x1e55e6,_0x37267f){var _0x28b478=MICROSOFT_AUTH_URL['replace'](_0xedff('0x1e'),_0x1e55e6['data2']);var _0x2b32ef=[_0xedff('0x1f'),_0xedff('0x20')];var _0x4358d0=Buffer['from'](JSON['stringify']({'id':_0x37267f}))[_0xedff('0x21')](_0xedff('0x22'));var _0x49040b=crypto[_0xedff('0x23')](0x10)['toString']('hex');var _0x14f36b=getAuthorizationScopes(_0x1e55e6);var _0x2845d3=[{'key':_0xedff('0x24'),'value':_0x1e55e6[_0xedff('0x25')]},{'key':'response_type','value':encodeURIComponent(_0x2b32ef[_0xedff('0x1d')]('\x20'))},{'key':_0xedff('0x26'),'value':_0x1e55e6[_0xedff('0x27')]},{'key':_0xedff('0x28'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x14f36b)},{'key':'state','value':_0x4358d0},{'key':'nonce','value':_0x49040b},{'key':_0xedff('0x29'),'value':_0xedff('0x2a')}];var _0x21e826=_0x28b478+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2845d3,function(_0x482225){return _0x482225[_0xedff('0x2b')]+'='+_0x482225['value'];})[_0xedff('0x1d')]('&');_0x1e55e6[_0xedff('0x2c')]={'issuer':_0x28b478[_0xedff('0x2d')]('oauth2/',''),'audience':_0x1e55e6['data1'],'state':_0x4358d0,'nonce':_0x49040b};redis[_0xedff('0x2e')](_0x4358d0,JSON[_0xedff('0x2f')](_0x1e55e6));return _0x21e826;}function isValidIdToken(_0x342403,_0x3efbcb){try{var _0xd8d112=jwt[_0xedff('0x30')](_0x342403,{'complete':!![]});var _0x3946ac=_0xd8d112['payload'];if(_0x3946ac[_0xedff('0x31')]!==_0x3efbcb[_0xedff('0x32')])return![];if(_0x3946ac[_0xedff('0x33')]!==_0x3efbcb[_0xedff('0x34')])return![];if(_0x3946ac['nonce']!==_0x3efbcb['nonce'])return![];if(moment()['isAfter'](moment[_0xedff('0x35')](_0x3946ac['exp'])))return![];return!![];}catch(_0x12bf5d){throw _0x12bf5d;}}function refreshOauth2MicrosoftAccessToken(_0x5cb81b){return Promise[_0xedff('0x36')]()['then'](function(){if(_0x5cb81b[_0xedff('0x37')])return _0x5cb81b;return db[_0xedff('0x38')][_0xedff('0x39')]({'where':{'id':_0x5cb81b['id']},'raw':!![]});})['then'](function(_0x3a76b9){var _0x398f55={'grant_type':'refresh_token','refresh_token':_0x3a76b9['data6'],'scope':getAccessTokenScope(_0x3a76b9),'redirect_uri':_0x3a76b9[_0xedff('0x27')],'client_id':_0x3a76b9[_0xedff('0x25')],'client_secret':encryptor[_0xedff('0x3a')](_0x3a76b9['data3'])};var _0x34a338={'method':_0xedff('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xedff('0x2d')](_0xedff('0x1e'),_0x3a76b9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x398f55,'json':!![]};return rp(_0x34a338);})[_0xedff('0x3c')](function(_0x40c429){_0x5cb81b['data5']=_0x40c429[_0xedff('0x3d')];_0x5cb81b['data6']=_0x40c429[_0xedff('0x3e')];return db['CloudProvider'][_0xedff('0x3f')]({'data5':_0x5cb81b[_0xedff('0x40')],'data6':_0x5cb81b[_0xedff('0x41')]},{'where':{'id':_0x5cb81b['id']}});})[_0xedff('0x3c')](function(){return _0x5cb81b;})[_0xedff('0x42')](function(_0x139447){logger['error'](_0xedff('0x43'),_0x5cb81b['id'],_0x139447);});}function getOauth2MicrosoftAccessToken(_0x384add,_0x507d15){var _0x5f2528={'grant_type':_0xedff('0x44'),'code':_0x384add,'scope':getAccessTokenScope(_0x507d15),'redirect_uri':_0x507d15[_0xedff('0x27')],'client_id':_0x507d15[_0xedff('0x25')],'client_secret':encryptor[_0xedff('0x3a')](_0x507d15['data3'])};var _0x5216d3={'method':_0xedff('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xedff('0x2d')](_0xedff('0x1e'),_0x507d15[_0xedff('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5f2528,'json':!![]};return rp(_0x5216d3);}function startRefreshInterval(_0x30540e){var _0x5ea2ce=schedule[_0xedff('0x46')];if(_0x5ea2ce[_0x30540e['id']])clearInterval(_0x5ea2ce[_0x30540e['id']]);_0x5ea2ce[_0x30540e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xedff('0x47')](this,{'id':_0x30540e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5ea2ce;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xa4f4b){var _0x5e23c2=_0xa4f4b[_0xedff('0x17')](function(_0x3d2c1b){return refreshOauth2MicrosoftAccessToken(_0x3d2c1b)[_0xedff('0x3c')](function(_0x34a335){startRefreshInterval(_0x34a335);});});return Promise[_0xedff('0x48')](_0x5e23c2);})[_0xedff('0x42')](function(_0x4e9684){var _0x4e04b3=_0x4e9684?util[_0xedff('0x49')](_0x4e9684,{'showHidden':![],'depth':null}):'';logger[_0xedff('0x4a')](_0xedff('0x4b'),_0x4e04b3);});}module[_0xedff('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 5e1889a..d11c0bb 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 _0x6582=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6582,0x108));var _0x2658=function(_0x3452eb,_0x44035e){_0x3452eb=_0x3452eb-0x0;var _0x4244fd=_0x6582[_0x3452eb];return _0x4244fd;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});} \ No newline at end of file +var _0xf79e=['jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x15251b,_0x1f22f0){var _0x181da3=function(_0x40600a){while(--_0x40600a){_0x15251b['push'](_0x15251b['shift']());}};_0x181da3(++_0x1f22f0);}(_0xf79e,0x185));var _0xef79=function(_0x35e6e6,_0x2cfd9d){_0x35e6e6=_0x35e6e6-0x0;var _0x48a23c=_0xf79e[_0x35e6e6];return _0x48a23c;};'use strict';var _=require('lodash');var util=require(_0xef79('0x0'));var moment=require(_0xef79('0x1'));var BPromise=require(_0xef79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef79('0x3'));var db=require(_0xef79('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef79('0x5'));var config=require(_0xef79('0x6'));var jayson=require(_0xef79('0x7'));var client=jayson[_0xef79('0x8')][_0xef79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa668,_0x49d0ea,_0x1e7443){return new BPromise(function(_0x4a8de0,_0x33b384){return client[_0xef79('0xa')](_0x2fa668,_0x1e7443)['then'](function(_0x42dee6){logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));logger[_0xef79('0xe')](_0xef79('0xf'),_0x49d0ea,_0xef79('0xd'),JSON[_0xef79('0x10')](_0x42dee6));if(_0x42dee6['error']){if(_0x42dee6[_0xef79('0x11')][_0xef79('0x12')]===0x1f4){logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);return _0x33b384(_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);}logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6['error']['message']);return _0x4a8de0(_0x42dee6['error']['message']);}else{logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));_0x4a8de0(_0x42dee6[_0xef79('0x14')]['message']);}})[_0xef79('0x15')](function(_0x6a689c){logger['error'](_0xef79('0xc'),_0x49d0ea,_0x6a689c);_0x33b384(_0x6a689c);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index fe82b13..ad34477 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(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7a54,0x106));var _0x47a5=function(_0x2c5f51,_0x23591a){_0x2c5f51=_0x2c5f51-0x0;var _0x5222d0=_0x7a54[_0x2c5f51];return _0x5222d0;};'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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x181bc7,_0x319c0e){var _0x3df160=function(_0x2b3dee){while(--_0x2b3dee){_0x181bc7['push'](_0x181bc7['shift']());}};_0x3df160(++_0x319c0e);}(_0x2ef3,0xba));var _0x32ef=function(_0x499945,_0x324328){_0x499945=_0x499945-0x0;var _0x2f89f8=_0x2ef3[_0x499945];return _0x2f89f8;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index f77c7d2..cb91ef5 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 _0xa71e=['exports','name','STRING','sequelize'];(function(_0x102613,_0x7a27b2){var _0x599929=function(_0x3895a6){while(--_0x3895a6){_0x102613['push'](_0x102613['shift']());}};_0x599929(++_0x7a27b2);}(_0xa71e,0x7b));var _0xea71=function(_0x4da382,_0x4cfc5d){_0x4da382=_0x4da382-0x0;var _0x10073f=_0xa71e[_0x4da382];return _0x10073f;};'use strict';var Sequelize=require(_0xea71('0x0'));module[_0xea71('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xea71('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xea71('0x3')]},'website':{'type':Sequelize[_0xea71('0x3')]},'phone':{'type':Sequelize[_0xea71('0x3')]},'fax':{'type':Sequelize[_0xea71('0x3')]},'type':{'type':Sequelize[_0xea71('0x3')]},'street':{'type':Sequelize[_0xea71('0x3')]},'postalCode':{'type':Sequelize[_0xea71('0x3')]},'city':{'type':Sequelize[_0xea71('0x3')]},'country':{'type':Sequelize[_0xea71('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xea71('0x3')]},'sStreet':{'type':Sequelize[_0xea71('0x3')]},'sPostalCode':{'type':Sequelize[_0xea71('0x3')]},'sCity':{'type':Sequelize[_0xea71('0x3')]},'sCountry':{'type':Sequelize[_0xea71('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf718=['STRING','name','sequelize','exports'];(function(_0x53a24c,_0x464b5e){var _0x43c85d=function(_0x3b6c3a){while(--_0x3b6c3a){_0x53a24c['push'](_0x53a24c['shift']());}};_0x43c85d(++_0x464b5e);}(_0xf718,0x122));var _0x8f71=function(_0x57aa92,_0x1488e5){_0x57aa92=_0x57aa92-0x0;var _0x108f8d=_0xf718[_0x57aa92];return _0x108f8d;};'use strict';var Sequelize=require(_0x8f71('0x0'));module[_0x8f71('0x1')]={'name':{'type':Sequelize[_0x8f71('0x2')],'unique':_0x8f71('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x8f71('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8f71('0x2')]},'fax':{'type':Sequelize[_0x8f71('0x2')]},'type':{'type':Sequelize[_0x8f71('0x2')]},'street':{'type':Sequelize[_0x8f71('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8f71('0x2')]},'email':{'type':Sequelize[_0x8f71('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x8f71('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x8f71('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index e6168a9..8b3f916 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 _0xd38c=['CmCompany','describe','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','filter','merge','options','count','includeAll','findAll','catch','params','rawAttributes','fields','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','CmContact','omit','ids','getContacts','findOne','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','send'];(function(_0x47cfc1,_0x178da4){var _0x10b652=function(_0x175468){while(--_0x175468){_0x47cfc1['push'](_0x47cfc1['shift']());}};_0x10b652(++_0x178da4);}(_0xd38c,0xd0));var _0xcd38=function(_0x49bfff,_0x1d56d2){_0x49bfff=_0x49bfff-0x0;var _0x447f91=_0xd38c[_0x49bfff];return _0x447f91;};'use strict';var emlformat=require(_0xcd38('0x0'));var rimraf=require(_0xcd38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd38('0x2'));var rp=require(_0xcd38('0x3'));var moment=require(_0xcd38('0x4'));var BPromise=require(_0xcd38('0x5'));var Mustache=require(_0xcd38('0x6'));var util=require(_0xcd38('0x7'));var path=require('path');var sox=require(_0xcd38('0x8'));var csv=require('to-csv');var ejs=require(_0xcd38('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcd38('0xa'));var jsforce=require(_0xcd38('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcd38('0xc'));var querystring=require(_0xcd38('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd38('0xe'));var as=require(_0xcd38('0xf'));var hardwareService=require(_0xcd38('0x10'));var logger=require(_0xcd38('0x11'))(_0xcd38('0x12'));var utils=require(_0xcd38('0x13'));var config=require(_0xcd38('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd38('0x15'))['db'];function respondWithStatusCode(_0x55f734,_0x220d8c){_0x220d8c=_0x220d8c||0xcc;return function(_0x342526){if(_0x342526){return _0x55f734[_0xcd38('0x16')](_0x220d8c);}return _0x55f734[_0xcd38('0x17')](_0x220d8c)[_0xcd38('0x18')]();};}function respondWithResult(_0x46ab80,_0x19815d){_0x19815d=_0x19815d||0xc8;return function(_0x2ad334){if(_0x2ad334){return _0x46ab80[_0xcd38('0x17')](_0x19815d)[_0xcd38('0x19')](_0x2ad334);}};}function respondWithFilteredResult(_0x176096,_0x4ea158){return function(_0x55cf40){if(_0x55cf40){var _0x5a3ae7=typeof _0x4ea158[_0xcd38('0x1a')]===_0xcd38('0x1b')&&typeof _0x4ea158[_0xcd38('0x1c')]===_0xcd38('0x1b');var _0x68e2b1=_0x55cf40['count'];var _0x11cd4e=_0x5a3ae7?0x0:_0x4ea158[_0xcd38('0x1a')];var _0x36745a=_0x5a3ae7?_0x55cf40['count']:_0x4ea158[_0xcd38('0x1a')]+_0x4ea158[_0xcd38('0x1c')];var _0x41b16a;if(_0x36745a>=_0x68e2b1){_0x36745a=_0x68e2b1;_0x41b16a=0xc8;}else{_0x41b16a=0xce;}_0x176096[_0xcd38('0x17')](_0x41b16a);return _0x176096['set'](_0xcd38('0x1d'),_0x11cd4e+'-'+_0x36745a+'/'+_0x68e2b1)['json'](_0x55cf40);}return null;};}function patchUpdates(_0x23bb32){return function(_0x2d1520){try{jsonpatch[_0xcd38('0x1e')](_0x2d1520,_0x23bb32,!![]);}catch(_0x54c6b9){return BPromise['reject'](_0x54c6b9);}return _0x2d1520[_0xcd38('0x1f')]();};}function saveUpdates(_0x297dd9,_0x401738){return function(_0x65d10f){if(_0x65d10f){return _0x65d10f[_0xcd38('0x20')](_0x297dd9)[_0xcd38('0x21')](function(_0x131e1a){return _0x131e1a;});}return null;};}function removeEntity(_0x585e19,_0x179676){return function(_0x399bc4){if(_0x399bc4){return _0x399bc4[_0xcd38('0x22')]()[_0xcd38('0x21')](function(){var _0x41fda2=_0x399bc4[_0xcd38('0x23')]({'plain':!![]});var _0x3d53a3=_0xcd38('0x24');return db[_0xcd38('0x25')][_0xcd38('0x22')]({'where':{'type':_0x3d53a3,'resourceId':_0x41fda2['id']}})[_0xcd38('0x21')](function(){return _0x399bc4;});})[_0xcd38('0x21')](function(){_0x585e19[_0xcd38('0x17')](0xcc)[_0xcd38('0x18')]();});}};}function handleEntityNotFound(_0x6b552c,_0x20e2f3){return function(_0x57d260){if(!_0x57d260){_0x6b552c[_0xcd38('0x16')](0x194);}return _0x57d260;};}function handleError(_0x19d855,_0x215d8a){_0x215d8a=_0x215d8a||0x1f4;return function(_0x108105){logger[_0xcd38('0x26')](_0x108105[_0xcd38('0x27')]);if(_0x108105['name']){delete _0x108105['name'];}_0x19d855[_0xcd38('0x17')](_0x215d8a)[_0xcd38('0x28')](_0x108105);};}exports['index']=function(_0x49c2a7,_0x458110){var _0x31ee1f={},_0x2b565a={},_0x24df2f={'count':0x0,'rows':[]};return db[_0xcd38('0x29')][_0xcd38('0x2a')]()[_0xcd38('0x21')](function(_0x4d8dc0){_0x2b565a['model']=_[_0xcd38('0x2b')](_0x4d8dc0);_0x2b565a['query']=_['keys'](_0x49c2a7[_0xcd38('0x2c')]);_0x2b565a['filters']=_[_0xcd38('0x2d')](_0x2b565a[_0xcd38('0x2e')],_0x2b565a[_0xcd38('0x2c')]);_0x31ee1f[_0xcd38('0x2f')]=_[_0xcd38('0x2d')](_0x2b565a[_0xcd38('0x2e')],qs['fields'](_0x49c2a7['query']['fields']));_0x31ee1f[_0xcd38('0x2f')]=_0x31ee1f[_0xcd38('0x2f')][_0xcd38('0x30')]?_0x31ee1f['attributes']:_0x2b565a['model'];if(!_0x49c2a7[_0xcd38('0x2c')][_0xcd38('0x31')](_0xcd38('0x32'))){_0x31ee1f[_0xcd38('0x1c')]=qs[_0xcd38('0x1c')](_0x49c2a7[_0xcd38('0x2c')][_0xcd38('0x1c')]);_0x31ee1f['offset']=qs[_0xcd38('0x1a')](_0x49c2a7[_0xcd38('0x2c')][_0xcd38('0x1a')]);}_0x31ee1f['order']=qs[_0xcd38('0x33')](_0x49c2a7[_0xcd38('0x2c')]['sort']);_0x31ee1f['where']=qs[_0xcd38('0x34')](_[_0xcd38('0x35')](_0x49c2a7[_0xcd38('0x2c')],_0x2b565a[_0xcd38('0x34')]),_0x4d8dc0);if(_0x49c2a7[_0xcd38('0x2c')]['filter']){_0x31ee1f[_0xcd38('0x36')]=_['merge'](_0x31ee1f['where'],{'$or':_['map'](_0x31ee1f[_0xcd38('0x2f')],function(_0x248d54){var _0x410a99={};_0x410a99[_0x248d54]={'$like':'%'+_0x49c2a7[_0xcd38('0x2c')][_0xcd38('0x37')]+'%'};return _0x410a99;})});}_0x31ee1f=_[_0xcd38('0x38')]({},_0x31ee1f,_0x49c2a7[_0xcd38('0x39')]);var _0x1d1447={'where':_0x31ee1f[_0xcd38('0x36')]};return db[_0xcd38('0x29')][_0xcd38('0x3a')](_0x1d1447)[_0xcd38('0x21')](function(_0x4785ad){_0x24df2f[_0xcd38('0x3a')]=_0x4785ad;if(_0x49c2a7[_0xcd38('0x2c')][_0xcd38('0x3b')]){_0x31ee1f['include']=[{'all':!![]}];}return db[_0xcd38('0x29')][_0xcd38('0x3c')](_0x31ee1f);})['then'](function(_0x46363c){_0x24df2f['rows']=_0x46363c;return _0x24df2f;})[_0xcd38('0x21')](respondWithFilteredResult(_0x458110,_0x31ee1f))[_0xcd38('0x3d')](handleError(_0x458110,null));})[_0xcd38('0x3d')](handleError(_0x458110,null));};exports['show']=function(_0x5c587b,_0x21951e){var _0x2de800={'raw':![],'where':{'id':_0x5c587b[_0xcd38('0x3e')]['id']}},_0x9abaca={};_0x9abaca[_0xcd38('0x2e')]=_[_0xcd38('0x2b')](db[_0xcd38('0x29')][_0xcd38('0x3f')]);_0x9abaca[_0xcd38('0x2c')]=_['keys'](_0x5c587b[_0xcd38('0x2c')]);_0x9abaca[_0xcd38('0x34')]=_['intersection'](_0x9abaca[_0xcd38('0x2e')],_0x9abaca[_0xcd38('0x2c')]);_0x2de800[_0xcd38('0x2f')]=_['intersection'](_0x9abaca['model'],qs[_0xcd38('0x40')](_0x5c587b[_0xcd38('0x2c')][_0xcd38('0x40')]));_0x2de800[_0xcd38('0x2f')]=_0x2de800[_0xcd38('0x2f')][_0xcd38('0x30')]?_0x2de800[_0xcd38('0x2f')]:_0x9abaca['model'];if(_0x5c587b[_0xcd38('0x2c')][_0xcd38('0x3b')]){_0x2de800[_0xcd38('0x41')]=[{'all':!![]}];}_0x2de800=_['merge']({},_0x2de800,_0x5c587b[_0xcd38('0x39')]);return db['CmCompany']['find'](_0x2de800)['then'](handleEntityNotFound(_0x21951e,null))['then'](respondWithResult(_0x21951e,null))[_0xcd38('0x3d')](handleError(_0x21951e,null));};exports[_0xcd38('0x42')]=function(_0x44d3b9,_0x1fd4a0){return db[_0xcd38('0x29')]['create'](_0x44d3b9[_0xcd38('0x43')],{})[_0xcd38('0x21')](function(_0x1eb201){var _0x3da986=_0x44d3b9[_0xcd38('0x44')][_0xcd38('0x23')]({'plain':!![]});if(!_0x3da986)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da986[_0xcd38('0x45')]===_0xcd38('0x44')){var _0x5cf1e5=_0x1eb201[_0xcd38('0x23')]({'plain':!![]});var _0x6242cf=_0xcd38('0x24');return db[_0xcd38('0x46')]['find']({'where':{'name':_0x6242cf,'userProfileId':_0x3da986[_0xcd38('0x47')]},'raw':!![]})[_0xcd38('0x21')](function(_0x299ece){if(_0x299ece&&_0x299ece[_0xcd38('0x48')]===0x0){return db[_0xcd38('0x25')]['create']({'name':_0x5cf1e5['name'],'resourceId':_0x5cf1e5['id'],'type':_0x299ece[_0xcd38('0x49')],'sectionId':_0x299ece['id']},{})[_0xcd38('0x21')](function(){return _0x1eb201;});}else{return _0x1eb201;}})[_0xcd38('0x3d')](function(_0x30cb8b){logger[_0xcd38('0x26')](_0xcd38('0x4a'),_0x30cb8b);throw _0x30cb8b;});}return _0x1eb201;})['then'](respondWithResult(_0x1fd4a0,0xc9))['catch'](handleError(_0x1fd4a0,null));};exports[_0xcd38('0x20')]=function(_0x3138ca,_0x1c2b4e){if(_0x3138ca[_0xcd38('0x43')]['id']){delete _0x3138ca[_0xcd38('0x43')]['id'];}return db['CmCompany'][_0xcd38('0x4b')]({'where':{'id':_0x3138ca[_0xcd38('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1c2b4e,null))['then'](saveUpdates(_0x3138ca['body'],null))[_0xcd38('0x21')](respondWithResult(_0x1c2b4e,null))[_0xcd38('0x3d')](handleError(_0x1c2b4e,null));};exports[_0xcd38('0x22')]=function(_0x5d0e92,_0x5db1af){return db[_0xcd38('0x29')][_0xcd38('0x4b')]({'where':{'id':_0x5d0e92['params']['id']}})[_0xcd38('0x21')](handleEntityNotFound(_0x5db1af,null))[_0xcd38('0x21')](removeEntity(_0x5db1af,null))[_0xcd38('0x3d')](handleError(_0x5db1af,null));};exports[_0xcd38('0x2a')]=function(_0x29a1ea,_0x455ad7){return db[_0xcd38('0x29')]['describe']()['then'](respondWithResult(_0x455ad7,null))[_0xcd38('0x3d')](handleError(_0x455ad7,null));};exports[_0xcd38('0x4c')]=function(_0x4b8aa8,_0x1d47cc,_0x58459b){return db[_0xcd38('0x4d')][_0xcd38('0x4b')]({'where':{'id':_0x4b8aa8[_0xcd38('0x3e')]['id']}})[_0xcd38('0x21')](handleEntityNotFound(_0x1d47cc,null))[_0xcd38('0x21')](function(_0x3e7a04){if(_0x3e7a04){return _0x3e7a04['addContacts'](_0x4b8aa8[_0xcd38('0x43')]['ids'],_[_0xcd38('0x4e')](_0x4b8aa8[_0xcd38('0x43')],[_0xcd38('0x4f'),'id'])||{});}})[_0xcd38('0x21')](respondWithResult(_0x1d47cc,null))[_0xcd38('0x3d')](handleError(_0x1d47cc,null));};exports[_0xcd38('0x50')]=function(_0x5aa2c6,_0x18a44a,_0x3a3bc2){var _0x14fb55={};var _0x43614f={};var _0x4fd117;var _0x43dac1;return db[_0xcd38('0x29')][_0xcd38('0x51')]({'where':{'id':_0x5aa2c6[_0xcd38('0x3e')]['id']}})[_0xcd38('0x21')](handleEntityNotFound(_0x18a44a,null))[_0xcd38('0x21')](function(_0x5ebde0){if(_0x5ebde0){_0x4fd117=_0x5ebde0;_0x43614f[_0xcd38('0x2e')]=_[_0xcd38('0x2b')](db['CmContact'][_0xcd38('0x3f')]);_0x43614f[_0xcd38('0x2c')]=_[_0xcd38('0x2b')](_0x5aa2c6[_0xcd38('0x2c')]);_0x43614f[_0xcd38('0x34')]=_[_0xcd38('0x2d')](_0x43614f[_0xcd38('0x2e')],_0x43614f[_0xcd38('0x2c')]);_0x14fb55[_0xcd38('0x2f')]=_[_0xcd38('0x2d')](_0x43614f['model'],qs[_0xcd38('0x40')](_0x5aa2c6[_0xcd38('0x2c')][_0xcd38('0x40')]));_0x14fb55[_0xcd38('0x2f')]=_0x14fb55[_0xcd38('0x2f')][_0xcd38('0x30')]?_0x14fb55[_0xcd38('0x2f')]:_0x43614f[_0xcd38('0x2e')];_0x14fb55['order']=qs['sort'](_0x5aa2c6[_0xcd38('0x2c')][_0xcd38('0x33')]);_0x14fb55[_0xcd38('0x36')]=qs[_0xcd38('0x34')](_[_0xcd38('0x35')](_0x5aa2c6[_0xcd38('0x2c')],_0x43614f[_0xcd38('0x34')]));if(_0x5aa2c6[_0xcd38('0x2c')][_0xcd38('0x37')]){_0x14fb55[_0xcd38('0x36')]=_[_0xcd38('0x38')](_0x14fb55[_0xcd38('0x36')],{'$or':_[_0xcd38('0x52')](_0x14fb55['attributes'],function(_0x532d36){var _0x2a7c8f={};_0x2a7c8f[_0x532d36]={'$like':'%'+_0x5aa2c6[_0xcd38('0x2c')][_0xcd38('0x37')]+'%'};return _0x2a7c8f;})});}_0x14fb55=_[_0xcd38('0x38')]({},_0x14fb55,_0x5aa2c6['options']);return _0x4fd117[_0xcd38('0x50')](_0x14fb55);}})[_0xcd38('0x21')](function(_0x3c7729){if(_0x3c7729){_0x43dac1=_0x3c7729[_0xcd38('0x30')];if(!_0x5aa2c6[_0xcd38('0x2c')]['hasOwnProperty']('nolimit')){_0x14fb55['limit']=qs['limit'](_0x5aa2c6['query'][_0xcd38('0x1c')]);_0x14fb55[_0xcd38('0x1a')]=qs[_0xcd38('0x1a')](_0x5aa2c6[_0xcd38('0x2c')][_0xcd38('0x1a')]);}return _0x4fd117[_0xcd38('0x50')](_0x14fb55);}})['then'](function(_0x18b6c5){if(_0x18b6c5){return _0x18b6c5?{'count':_0x43dac1,'rows':_0x18b6c5}:null;}})['then'](respondWithResult(_0x18a44a,null))[_0xcd38('0x3d')](handleError(_0x18a44a,null));}; \ No newline at end of file +var _0x4265=['../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Companies','UserProfileResource','end','error','stack','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','ids','findOne','order','getContacts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4265,0x1f2));var _0x5426=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x4265[_0x42bdad];return _0x122626;};'use strict';var emlformat=require(_0x5426('0x0'));var rimraf=require(_0x5426('0x1'));var zipdir=require(_0x5426('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5426('0x3'));var moment=require(_0x5426('0x4'));var BPromise=require(_0x5426('0x5'));var Mustache=require('mustache');var util=require(_0x5426('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5426('0x7'));var ejs=require(_0x5426('0x8'));var fs=require('fs');var fs_extra=require(_0x5426('0x9'));var _=require(_0x5426('0xa'));var squel=require(_0x5426('0xb'));var crypto=require(_0x5426('0xc'));var jsforce=require(_0x5426('0xd'));var deskjs=require(_0x5426('0xe'));var toCsv=require(_0x5426('0x7'));var querystring=require(_0x5426('0xf'));var Papa=require(_0x5426('0x10'));var Redis=require(_0x5426('0x11'));var authService=require(_0x5426('0x12'));var qs=require(_0x5426('0x13'));var as=require(_0x5426('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5426('0x15'));var utils=require(_0x5426('0x16'));var config=require(_0x5426('0x17'));var licenseUtil=require(_0x5426('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ff9d,_0x6df5b3){_0x6df5b3=_0x6df5b3||0xcc;return function(_0x3da179){if(_0x3da179){return _0x1ff9d[_0x5426('0x19')](_0x6df5b3);}return _0x1ff9d[_0x5426('0x1a')](_0x6df5b3)['end']();};}function respondWithResult(_0xa3da8b,_0x4121db){_0x4121db=_0x4121db||0xc8;return function(_0x473920){if(_0x473920){return _0xa3da8b['status'](_0x4121db)[_0x5426('0x1b')](_0x473920);}};}function respondWithFilteredResult(_0x29b8fa,_0x2b515d){return function(_0x57b15b){if(_0x57b15b){var _0x2032f0=typeof _0x2b515d[_0x5426('0x1c')]===_0x5426('0x1d')&&typeof _0x2b515d[_0x5426('0x1e')]===_0x5426('0x1d');var _0x17e0cd=_0x57b15b['count'];var _0x42b572=_0x2032f0?0x0:_0x2b515d['offset'];var _0x1d6be9=_0x2032f0?_0x57b15b[_0x5426('0x1f')]:_0x2b515d['offset']+_0x2b515d[_0x5426('0x1e')];var _0x39ad4d;if(_0x1d6be9>=_0x17e0cd){_0x1d6be9=_0x17e0cd;_0x39ad4d=0xc8;}else{_0x39ad4d=0xce;}_0x29b8fa[_0x5426('0x1a')](_0x39ad4d);return _0x29b8fa[_0x5426('0x20')](_0x5426('0x21'),_0x42b572+'-'+_0x1d6be9+'/'+_0x17e0cd)[_0x5426('0x1b')](_0x57b15b);}return null;};}function patchUpdates(_0x53afa2){return function(_0x17eb85){try{jsonpatch[_0x5426('0x22')](_0x17eb85,_0x53afa2,!![]);}catch(_0x171476){return BPromise['reject'](_0x171476);}return _0x17eb85[_0x5426('0x23')]();};}function saveUpdates(_0xf21446,_0x53a9a6){return function(_0x57e798){if(_0x57e798){return _0x57e798[_0x5426('0x24')](_0xf21446)[_0x5426('0x25')](function(_0x2f1999){return _0x2f1999;});}return null;};}function removeEntity(_0x66d888,_0x5d0814){return function(_0x172bf3){if(_0x172bf3){return _0x172bf3['destroy']()[_0x5426('0x25')](function(){var _0x1915b1=_0x172bf3[_0x5426('0x26')]({'plain':!![]});var _0x12a75a=_0x5426('0x27');return db[_0x5426('0x28')]['destroy']({'where':{'type':_0x12a75a,'resourceId':_0x1915b1['id']}})[_0x5426('0x25')](function(){return _0x172bf3;});})[_0x5426('0x25')](function(){_0x66d888[_0x5426('0x1a')](0xcc)[_0x5426('0x29')]();});}};}function handleEntityNotFound(_0x59202a,_0x5488a0){return function(_0x197020){if(!_0x197020){_0x59202a[_0x5426('0x19')](0x194);}return _0x197020;};}function handleError(_0x179cb3,_0x4190db){_0x4190db=_0x4190db||0x1f4;return function(_0x5aff7c){logger[_0x5426('0x2a')](_0x5aff7c[_0x5426('0x2b')]);if(_0x5aff7c[_0x5426('0x2c')]){delete _0x5aff7c[_0x5426('0x2c')];}_0x179cb3[_0x5426('0x1a')](_0x4190db)[_0x5426('0x2d')](_0x5aff7c);};}exports['index']=function(_0x2f0fe0,_0x52ff7){var _0x4615a0={},_0x5305e6={},_0x4f39b2={'count':0x0,'rows':[]};return db[_0x5426('0x2e')][_0x5426('0x2f')]()['then'](function(_0x56761c){_0x5305e6[_0x5426('0x30')]=_[_0x5426('0x31')](_0x56761c);_0x5305e6[_0x5426('0x32')]=_['keys'](_0x2f0fe0[_0x5426('0x32')]);_0x5305e6['filters']=_[_0x5426('0x33')](_0x5305e6['model'],_0x5305e6[_0x5426('0x32')]);_0x4615a0[_0x5426('0x34')]=_[_0x5426('0x33')](_0x5305e6[_0x5426('0x30')],qs[_0x5426('0x35')](_0x2f0fe0[_0x5426('0x32')][_0x5426('0x35')]));_0x4615a0[_0x5426('0x34')]=_0x4615a0['attributes'][_0x5426('0x36')]?_0x4615a0['attributes']:_0x5305e6[_0x5426('0x30')];if(!_0x2f0fe0[_0x5426('0x32')][_0x5426('0x37')]('nolimit')){_0x4615a0[_0x5426('0x1e')]=qs[_0x5426('0x1e')](_0x2f0fe0[_0x5426('0x32')][_0x5426('0x1e')]);_0x4615a0[_0x5426('0x1c')]=qs[_0x5426('0x1c')](_0x2f0fe0[_0x5426('0x32')][_0x5426('0x1c')]);}_0x4615a0['order']=qs[_0x5426('0x38')](_0x2f0fe0[_0x5426('0x32')][_0x5426('0x38')]);_0x4615a0[_0x5426('0x39')]=qs['filters'](_[_0x5426('0x3a')](_0x2f0fe0[_0x5426('0x32')],_0x5305e6[_0x5426('0x3b')]),_0x56761c);if(_0x2f0fe0[_0x5426('0x32')][_0x5426('0x3c')]){_0x4615a0[_0x5426('0x39')]=_[_0x5426('0x3d')](_0x4615a0[_0x5426('0x39')],{'$or':_[_0x5426('0x3e')](_0x4615a0[_0x5426('0x34')],function(_0x46f098){var _0x16127c={};_0x16127c[_0x46f098]={'$like':'%'+_0x2f0fe0['query'][_0x5426('0x3c')]+'%'};return _0x16127c;})});}_0x4615a0=_['merge']({},_0x4615a0,_0x2f0fe0[_0x5426('0x3f')]);var _0x2ec686={'where':_0x4615a0['where']};return db['CmCompany']['count'](_0x2ec686)['then'](function(_0x5a17ac){_0x4f39b2[_0x5426('0x1f')]=_0x5a17ac;if(_0x2f0fe0[_0x5426('0x32')][_0x5426('0x40')]){_0x4615a0[_0x5426('0x41')]=[{'all':!![]}];}return db[_0x5426('0x2e')][_0x5426('0x42')](_0x4615a0);})[_0x5426('0x25')](function(_0x5a118a){_0x4f39b2[_0x5426('0x43')]=_0x5a118a;return _0x4f39b2;})[_0x5426('0x25')](respondWithFilteredResult(_0x52ff7,_0x4615a0))['catch'](handleError(_0x52ff7,null));})[_0x5426('0x44')](handleError(_0x52ff7,null));};exports[_0x5426('0x45')]=function(_0x49cab7,_0x43e3d8){var _0x5747ad={'raw':![],'where':{'id':_0x49cab7[_0x5426('0x46')]['id']}},_0x198a48={};_0x198a48[_0x5426('0x30')]=_[_0x5426('0x31')](db[_0x5426('0x2e')][_0x5426('0x47')]);_0x198a48[_0x5426('0x32')]=_[_0x5426('0x31')](_0x49cab7[_0x5426('0x32')]);_0x198a48[_0x5426('0x3b')]=_['intersection'](_0x198a48[_0x5426('0x30')],_0x198a48[_0x5426('0x32')]);_0x5747ad[_0x5426('0x34')]=_[_0x5426('0x33')](_0x198a48[_0x5426('0x30')],qs[_0x5426('0x35')](_0x49cab7[_0x5426('0x32')][_0x5426('0x35')]));_0x5747ad['attributes']=_0x5747ad[_0x5426('0x34')][_0x5426('0x36')]?_0x5747ad[_0x5426('0x34')]:_0x198a48[_0x5426('0x30')];if(_0x49cab7[_0x5426('0x32')][_0x5426('0x40')]){_0x5747ad[_0x5426('0x41')]=[{'all':!![]}];}_0x5747ad=_[_0x5426('0x3d')]({},_0x5747ad,_0x49cab7[_0x5426('0x3f')]);return db[_0x5426('0x2e')][_0x5426('0x48')](_0x5747ad)[_0x5426('0x25')](handleEntityNotFound(_0x43e3d8,null))[_0x5426('0x25')](respondWithResult(_0x43e3d8,null))[_0x5426('0x44')](handleError(_0x43e3d8,null));};exports[_0x5426('0x49')]=function(_0x5a4d25,_0x3ed9e0){return db[_0x5426('0x2e')]['create'](_0x5a4d25[_0x5426('0x4a')],{})[_0x5426('0x25')](function(_0x23248a){var _0x2a1e96=_0x5a4d25[_0x5426('0x4b')][_0x5426('0x26')]({'plain':!![]});if(!_0x2a1e96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a1e96[_0x5426('0x4c')]==='user'){var _0x464d0d=_0x23248a['get']({'plain':!![]});var _0x20979d=_0x5426('0x27');return db[_0x5426('0x4d')][_0x5426('0x48')]({'where':{'name':_0x20979d,'userProfileId':_0x2a1e96[_0x5426('0x4e')]},'raw':!![]})[_0x5426('0x25')](function(_0x5d0741){if(_0x5d0741&&_0x5d0741['autoAssociation']===0x0){return db[_0x5426('0x28')][_0x5426('0x49')]({'name':_0x464d0d['name'],'resourceId':_0x464d0d['id'],'type':_0x5d0741[_0x5426('0x2c')],'sectionId':_0x5d0741['id']},{})[_0x5426('0x25')](function(){return _0x23248a;});}else{return _0x23248a;}})[_0x5426('0x44')](function(_0x509fd8){logger['error'](_0x5426('0x4f'),_0x509fd8);throw _0x509fd8;});}return _0x23248a;})[_0x5426('0x25')](respondWithResult(_0x3ed9e0,0xc9))[_0x5426('0x44')](handleError(_0x3ed9e0,null));};exports[_0x5426('0x24')]=function(_0xd31331,_0x1474c9){if(_0xd31331[_0x5426('0x4a')]['id']){delete _0xd31331[_0x5426('0x4a')]['id'];}return db[_0x5426('0x2e')][_0x5426('0x48')]({'where':{'id':_0xd31331[_0x5426('0x46')]['id']}})[_0x5426('0x25')](handleEntityNotFound(_0x1474c9,null))['then'](saveUpdates(_0xd31331[_0x5426('0x4a')],null))['then'](respondWithResult(_0x1474c9,null))[_0x5426('0x44')](handleError(_0x1474c9,null));};exports[_0x5426('0x50')]=function(_0x3ae74d,_0x1bd6b7){return db[_0x5426('0x2e')][_0x5426('0x48')]({'where':{'id':_0x3ae74d[_0x5426('0x46')]['id']}})[_0x5426('0x25')](handleEntityNotFound(_0x1bd6b7,null))[_0x5426('0x25')](removeEntity(_0x1bd6b7,null))[_0x5426('0x44')](handleError(_0x1bd6b7,null));};exports[_0x5426('0x2f')]=function(_0x184b61,_0x21bf4b){return db[_0x5426('0x2e')]['describe']()['then'](respondWithResult(_0x21bf4b,null))[_0x5426('0x44')](handleError(_0x21bf4b,null));};exports[_0x5426('0x51')]=function(_0x3be754,_0x1fe471,_0x44b589){return db[_0x5426('0x52')][_0x5426('0x48')]({'where':{'id':_0x3be754['params']['id']}})[_0x5426('0x25')](handleEntityNotFound(_0x1fe471,null))['then'](function(_0x5d322b){if(_0x5d322b){return _0x5d322b[_0x5426('0x51')](_0x3be754[_0x5426('0x4a')]['ids'],_['omit'](_0x3be754['body'],[_0x5426('0x53'),'id'])||{});}})['then'](respondWithResult(_0x1fe471,null))[_0x5426('0x44')](handleError(_0x1fe471,null));};exports['getContacts']=function(_0x18c684,_0x591e24,_0x47ce85){var _0x3a8c71={};var _0x1fe716={};var _0x3cb87c;var _0xfaa27a;return db['CmCompany'][_0x5426('0x54')]({'where':{'id':_0x18c684[_0x5426('0x46')]['id']}})['then'](handleEntityNotFound(_0x591e24,null))[_0x5426('0x25')](function(_0x5a5a0e){if(_0x5a5a0e){_0x3cb87c=_0x5a5a0e;_0x1fe716['model']=_[_0x5426('0x31')](db[_0x5426('0x52')]['rawAttributes']);_0x1fe716[_0x5426('0x32')]=_[_0x5426('0x31')](_0x18c684[_0x5426('0x32')]);_0x1fe716[_0x5426('0x3b')]=_[_0x5426('0x33')](_0x1fe716[_0x5426('0x30')],_0x1fe716['query']);_0x3a8c71[_0x5426('0x34')]=_[_0x5426('0x33')](_0x1fe716['model'],qs[_0x5426('0x35')](_0x18c684[_0x5426('0x32')][_0x5426('0x35')]));_0x3a8c71[_0x5426('0x34')]=_0x3a8c71[_0x5426('0x34')][_0x5426('0x36')]?_0x3a8c71[_0x5426('0x34')]:_0x1fe716['model'];_0x3a8c71[_0x5426('0x55')]=qs[_0x5426('0x38')](_0x18c684[_0x5426('0x32')][_0x5426('0x38')]);_0x3a8c71[_0x5426('0x39')]=qs['filters'](_[_0x5426('0x3a')](_0x18c684[_0x5426('0x32')],_0x1fe716[_0x5426('0x3b')]));if(_0x18c684['query']['filter']){_0x3a8c71[_0x5426('0x39')]=_[_0x5426('0x3d')](_0x3a8c71[_0x5426('0x39')],{'$or':_['map'](_0x3a8c71[_0x5426('0x34')],function(_0x45098c){var _0x41039a={};_0x41039a[_0x45098c]={'$like':'%'+_0x18c684['query']['filter']+'%'};return _0x41039a;})});}_0x3a8c71=_[_0x5426('0x3d')]({},_0x3a8c71,_0x18c684['options']);return _0x3cb87c['getContacts'](_0x3a8c71);}})[_0x5426('0x25')](function(_0x40cfca){if(_0x40cfca){_0xfaa27a=_0x40cfca['length'];if(!_0x18c684['query'][_0x5426('0x37')]('nolimit')){_0x3a8c71['limit']=qs[_0x5426('0x1e')](_0x18c684[_0x5426('0x32')][_0x5426('0x1e')]);_0x3a8c71[_0x5426('0x1c')]=qs[_0x5426('0x1c')](_0x18c684[_0x5426('0x32')][_0x5426('0x1c')]);}return _0x3cb87c[_0x5426('0x56')](_0x3a8c71);}})[_0x5426('0x25')](function(_0x3d3b40){if(_0x3d3b40){return _0x3d3b40?{'count':_0xfaa27a,'rows':_0x3d3b40}:null;}})['then'](respondWithResult(_0x591e24,null))[_0x5426('0x44')](handleError(_0x591e24,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 9439c5a..0d097aa 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 _0x59a4=['define','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x1b100f,_0x467de2){var _0x559b32=function(_0x3b791d){while(--_0x3b791d){_0x1b100f['push'](_0x1b100f['shift']());}};_0x559b32(++_0x467de2);}(_0x59a4,0x16a));var _0x459a=function(_0x1d1854,_0x4a83b1){_0x1d1854=_0x1d1854-0x0;var _0x5b2acb=_0x59a4[_0x1d1854];return _0x5b2acb;};'use strict';var _=require(_0x459a('0x0'));var util=require('util');var logger=require(_0x459a('0x1'))(_0x459a('0x2'));var moment=require(_0x459a('0x3'));var BPromise=require(_0x459a('0x4'));var rp=require(_0x459a('0x5'));var fs=require('fs');var path=require(_0x459a('0x6'));var rimraf=require(_0x459a('0x7'));var config=require(_0x459a('0x8'));var attributes=require(_0x459a('0x9'));module['exports']=function(_0x27d981,_0x13248f){return _0x27d981[_0x459a('0xa')]('CmCompany',attributes,{'tableName':_0x459a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdadc=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','moment'];(function(_0x2ed643,_0x333aa1){var _0x559599=function(_0x5a2ebc){while(--_0x5a2ebc){_0x2ed643['push'](_0x2ed643['shift']());}};_0x559599(++_0x333aa1);}(_0xdadc,0x12a));var _0xcdad=function(_0x369270,_0x363e1b){_0x369270=_0x369270-0x0;var _0xd65f5e=_0xdadc[_0x369270];return _0xd65f5e;};'use strict';var _=require(_0xcdad('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcdad('0x1'));var BPromise=require('bluebird');var rp=require(_0xcdad('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdad('0x3'));var config=require(_0xcdad('0x4'));var attributes=require(_0xcdad('0x5'));module[_0xcdad('0x6')]=function(_0x21704f,_0x3becfb){return _0x21704f[_0xcdad('0x7')](_0xcdad('0x8'),attributes,{'tableName':_0xcdad('0x9'),'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 f088ca0..1c3cc01 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 _0xca94=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xca94,0x15e));var _0x4ca9=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xca94[_0x5cc8];return _0x450661;};'use strict';var _=require(_0x4ca9('0x0'));var util=require(_0x4ca9('0x1'));var moment=require(_0x4ca9('0x2'));var BPromise=require(_0x4ca9('0x3'));var rs=require(_0x4ca9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ca9('0x5'))['db'];var utils=require(_0x4ca9('0x6'));var logger=require(_0x4ca9('0x7'))(_0x4ca9('0x8'));var config=require(_0x4ca9('0x9'));var jayson=require(_0x4ca9('0xa'));var client=jayson[_0x4ca9('0xb')][_0x4ca9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47daa2,_0x4ea31c,_0x4837ea){return new BPromise(function(_0x21ea57,_0x463bcf){return client[_0x4ca9('0xd')](_0x47daa2,_0x4837ea)['then'](function(_0x261369){logger[_0x4ca9('0xe')](_0x4ca9('0xf'),_0x4ea31c,_0x4ca9('0x10'));logger[_0x4ca9('0x11')](_0x4ca9('0x12'),_0x4ea31c,_0x4ca9('0x10'),JSON[_0x4ca9('0x13')](_0x261369));if(_0x261369['error']){if(_0x261369['error'][_0x4ca9('0x14')]===0x1f4){logger[_0x4ca9('0x15')](_0x4ca9('0xf'),_0x4ea31c,_0x261369[_0x4ca9('0x15')][_0x4ca9('0x16')]);return _0x463bcf(_0x261369[_0x4ca9('0x15')][_0x4ca9('0x16')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x4ea31c,_0x261369[_0x4ca9('0x15')]['message']);return _0x21ea57(_0x261369[_0x4ca9('0x15')][_0x4ca9('0x16')]);}else{logger['info'](_0x4ca9('0xf'),_0x4ea31c,_0x4ca9('0x10'));_0x21ea57(_0x261369[_0x4ca9('0x17')][_0x4ca9('0x16')]);}})[_0x4ca9('0x18')](function(_0xa0393f){logger[_0x4ca9('0x15')](_0x4ca9('0xf'),_0x4ea31c,_0xa0393f);_0x463bcf(_0xa0393f);});});} \ No newline at end of file +var _0xe701=['stringify','error','code','message','CmCompany,\x20%s,\x20%s','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5c4bd4,_0x2f6760){var _0x5366aa=function(_0x21abfc){while(--_0x21abfc){_0x5c4bd4['push'](_0x5c4bd4['shift']());}};_0x5366aa(++_0x2f6760);}(_0xe701,0x11e));var _0x1e70=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe701[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x1e70('0x0'));var moment=require(_0x1e70('0x1'));var BPromise=require('bluebird');var rs=require(_0x1e70('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e70('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e70('0x4'))(_0x1e70('0x5'));var config=require('../../config/environment');var jayson=require(_0x1e70('0x6'));var client=jayson[_0x1e70('0x7')][_0x1e70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a9a8c,_0x5a0ba0,_0x5792d9){return new BPromise(function(_0x179110,_0x5b0d25){return client['request'](_0x3a9a8c,_0x5792d9)[_0x1e70('0x9')](function(_0x3e756e){logger[_0x1e70('0xa')]('CmCompany,\x20%s,\x20%s',_0x5a0ba0,'request\x20sent');logger[_0x1e70('0xb')](_0x1e70('0xc'),_0x5a0ba0,_0x1e70('0xd'),JSON[_0x1e70('0xe')](_0x3e756e));if(_0x3e756e['error']){if(_0x3e756e[_0x1e70('0xf')][_0x1e70('0x10')]===0x1f4){logger[_0x1e70('0xf')]('CmCompany,\x20%s,\x20%s',_0x5a0ba0,_0x3e756e['error'][_0x1e70('0x11')]);return _0x5b0d25(_0x3e756e[_0x1e70('0xf')][_0x1e70('0x11')]);}logger['error'](_0x1e70('0x12'),_0x5a0ba0,_0x3e756e['error'][_0x1e70('0x11')]);return _0x179110(_0x3e756e[_0x1e70('0xf')][_0x1e70('0x11')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x5a0ba0,_0x1e70('0xd'));_0x179110(_0x3e756e['result']['message']);}})[_0x1e70('0x13')](function(_0x4a1ae6){logger[_0x1e70('0xf')](_0x1e70('0x12'),_0x5a0ba0,_0x4a1ae6);_0x5b0d25(_0x4a1ae6);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 3281dc0..ca54b56 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 _0xada7=['../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1ea21a,_0x3120bb){var _0x5d871b=function(_0x4c1757){while(--_0x4c1757){_0x1ea21a['push'](_0x1ea21a['shift']());}};_0x5d871b(++_0x3120bb);}(_0xada7,0x186));var _0x7ada=function(_0x57ed95,_0x2f1d13){_0x57ed95=_0x57ed95-0x0;var _0x27ee08=_0xada7[_0x57ed95];return _0x27ee08;};'use strict';var multer=require(_0x7ada('0x0'));var util=require(_0x7ada('0x1'));var path=require('path');var timeout=require(_0x7ada('0x2'));var express=require(_0x7ada('0x3'));var router=express[_0x7ada('0x4')]();var fs_extra=require(_0x7ada('0x5'));var auth=require(_0x7ada('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ada('0x7'));var controller=require(_0x7ada('0x8'));router[_0x7ada('0x9')]('/',auth[_0x7ada('0xa')](),controller[_0x7ada('0xb')]);router[_0x7ada('0x9')]('/describe',auth[_0x7ada('0xa')](),controller['describe']);router['get'](_0x7ada('0xc'),auth[_0x7ada('0xa')](),controller['show']);router[_0x7ada('0x9')](_0x7ada('0xd'),auth[_0x7ada('0xa')](),controller[_0x7ada('0xe')]);router[_0x7ada('0xf')]('/',auth['isAuthenticated'](),controller[_0x7ada('0x10')]);router[_0x7ada('0xf')](_0x7ada('0xd'),auth[_0x7ada('0xa')](),controller[_0x7ada('0x11')]);router[_0x7ada('0x12')](_0x7ada('0xc'),auth[_0x7ada('0xa')](),controller[_0x7ada('0x13')]);router[_0x7ada('0x14')](_0x7ada('0xc'),auth[_0x7ada('0xa')](),controller[_0x7ada('0x15')]);module['exports']=router; \ No newline at end of file +var _0x797a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','update','delete','destroy','exports','util','express','Router'];(function(_0xfbc1b3,_0x5ceffb){var _0x17ee77=function(_0x1a33c6){while(--_0x1a33c6){_0xfbc1b3['push'](_0xfbc1b3['shift']());}};_0x17ee77(++_0x5ceffb);}(_0x797a,0xe4));var _0xa797=function(_0x5546da,_0x4fd96e){_0x5546da=_0x5546da-0x0;var _0x4ebf1f=_0x797a[_0x5546da];return _0x4ebf1f;};'use strict';var multer=require('multer');var util=require(_0xa797('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa797('0x1'));var router=express[_0xa797('0x2')]();var fs_extra=require(_0xa797('0x3'));var auth=require(_0xa797('0x4'));var interaction=require(_0xa797('0x5'));var config=require(_0xa797('0x6'));var controller=require(_0xa797('0x7'));router[_0xa797('0x8')]('/',auth[_0xa797('0x9')](),controller[_0xa797('0xa')]);router[_0xa797('0x8')]('/describe',auth[_0xa797('0x9')](),controller[_0xa797('0xb')]);router[_0xa797('0x8')](_0xa797('0xc'),auth['isAuthenticated'](),controller[_0xa797('0xd')]);router['get'](_0xa797('0xe'),auth[_0xa797('0x9')](),controller[_0xa797('0xf')]);router[_0xa797('0x10')]('/',auth[_0xa797('0x9')](),controller['create']);router[_0xa797('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router['put']('/:id',auth[_0xa797('0x9')](),controller[_0xa797('0x11')]);router[_0xa797('0x12')]('/:id',auth[_0xa797('0x9')](),controller[_0xa797('0x13')]);module[_0xa797('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index b923145..47e8feb 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 _0x912c=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x45d307,_0x59b1a7){var _0x1f306a=function(_0x3c58a7){while(--_0x3c58a7){_0x45d307['push'](_0x45d307['shift']());}};_0x1f306a(++_0x59b1a7);}(_0x912c,0x18a));var _0xc912=function(_0x7cdaf1,_0x40e620){_0x7cdaf1=_0x7cdaf1-0x0;var _0xf58e9a=_0x912c[_0x7cdaf1];return _0xf58e9a;};'use strict';var _=require(_0xc912('0x0'));var Sequelize=require(_0xc912('0x1'));module[_0xc912('0x2')]={'firstName':{'type':Sequelize[_0xc912('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc912('0x3')]},'street':{'type':Sequelize[_0xc912('0x3')]},'postalCode':{'type':Sequelize[_0xc912('0x3')]},'city':{'type':Sequelize[_0xc912('0x3')]},'country':{'type':Sequelize[_0xc912('0x3')]},'dateOfBirth':{'type':Sequelize[_0xc912('0x3')]},'description':{'type':Sequelize[_0xc912('0x4')]},'phone':{'type':Sequelize[_0xc912('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc912('0x3')]},'email':{'type':Sequelize[_0xc912('0x3')]},'url':{'type':Sequelize[_0xc912('0x3')]},'facebook':{'type':Sequelize[_0xc912('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc912('0x3')]},'viber':{'type':Sequelize[_0xc912('0x3')]},'line':{'type':Sequelize[_0xc912('0x3')]},'wechat':{'type':Sequelize[_0xc912('0x3')]},'telegram':{'type':Sequelize[_0xc912('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xc912('0x3')]},'priority':{'type':Sequelize[_0xc912('0x5')](0x2)[_0xc912('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc912('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xc912('0x3')]},'utcOffset':{'type':Sequelize[_0xc912('0x5')]}}; \ No newline at end of file +var _0x2864=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash'];(function(_0x37d0bc,_0x109b96){var _0x170e60=function(_0xae2ad){while(--_0xae2ad){_0x37d0bc['push'](_0x37d0bc['shift']());}};_0x170e60(++_0x109b96);}(_0x2864,0x141));var _0x4286=function(_0x233811,_0x1283e9){_0x233811=_0x233811-0x0;var _0x292f41=_0x2864[_0x233811];return _0x292f41;};'use strict';var _=require(_0x4286('0x0'));var Sequelize=require('sequelize');module[_0x4286('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x4286('0x2')]},'street':{'type':Sequelize[_0x4286('0x2')]},'postalCode':{'type':Sequelize[_0x4286('0x2')]},'city':{'type':Sequelize[_0x4286('0x2')]},'country':{'type':Sequelize[_0x4286('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4286('0x2')]},'description':{'type':Sequelize[_0x4286('0x3')]},'phone':{'type':Sequelize[_0x4286('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4286('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x4286('0x2')]},'facebook':{'type':Sequelize[_0x4286('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x4286('0x2')]},'skype':{'type':Sequelize[_0x4286('0x2')]},'teams':{'type':Sequelize[_0x4286('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x4286('0x2')]},'telegram':{'type':Sequelize[_0x4286('0x2')]},'UserId':{'type':Sequelize[_0x4286('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x4286('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4286('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4286('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x4286('0x2')]},'utcOffset':{'type':Sequelize[_0x4286('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index fad72b7..e6238a9 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 _0xd019=['[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','$or','findOrCreate','contact','show','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','cf_%d','format','table','id\x20=\x20?','toParam','phone','options','getTags','setTags','ids','OrderBy','item_types','ItemTypeId','items','description','contact\x20phone\x20exists','CmHopper','CmHopperAdditionalPhone','PHONE','item','ItemType.OrderBy','bulkCreate','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','ContactId','includeAll','include','getHopperFinals','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','parse','meta','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','uniqueid','source','destination','callerid','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closed','disposition','key','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','bluebird','util','path','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./cmContact.socket','register','status','json','offset','limit','count','Content-Range','update','then','end','sendStatus','error','stack','name','index','CmContact','describe','keys','length','startsWith','cf_','findOne','trimStart','all','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','Tag','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','value','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','text','push','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','resolve','user','role','agent','User','c.ListId\x20IS\x20NULL','ListId','toString','keyBy','merge','c.lastName','c.phone','c.mobile','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize','Tags','rows','catch','destroy','find','params','tags','columnName','displayName','analytics','CmCustomField','findAll','values','body','get','info','CmHopperBlack'];(function(_0x456064,_0x4e09a1){var _0x4d5d7c=function(_0x338e1c){while(--_0x338e1c){_0x456064['push'](_0x456064['shift']());}};_0x4d5d7c(++_0x4e09a1);}(_0xd019,0x1c9));var _0x9d01=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0xd019[_0x23be51];return _0x47a26d;};'use strict';var moment=require('moment');var BPromise=require(_0x9d01('0x0'));var util=require(_0x9d01('0x1'));var path=require(_0x9d01('0x2'));var fs=require('fs');var _=require(_0x9d01('0x3'));var squel=require(_0x9d01('0x4'));var Papa=require(_0x9d01('0x5'));var Redis=require('ioredis');var qs=require(_0x9d01('0x6'));var as=require(_0x9d01('0x7'));var logger=require(_0x9d01('0x8'))('api');var config=require(_0x9d01('0x9'));var shared=require('../../config/environment/shared');var db=require(_0x9d01('0xa'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9d01('0xb'),'port':0x18eb});var socket=require(_0x9d01('0xc'))(new Redis(config[_0x9d01('0xd')]));require(_0x9d01('0xe'))[_0x9d01('0xf')](socket);function respondWithResult(_0x234d94,_0x166b9a){_0x166b9a=_0x166b9a||0xc8;return function(_0x38e094){if(_0x38e094){return _0x234d94[_0x9d01('0x10')](_0x166b9a)[_0x9d01('0x11')](_0x38e094);}};}function respondWithFilteredResult(_0x2ac085,_0x4420fc){return function(_0x15c10f){if(_0x15c10f){var _0x46e996=typeof _0x4420fc[_0x9d01('0x12')]==='undefined'&&typeof _0x4420fc[_0x9d01('0x13')]==='undefined';var _0x525363=_0x15c10f[_0x9d01('0x14')];var _0x2d07a7=_0x46e996?0x0:_0x4420fc[_0x9d01('0x12')];var _0x57dd11=_0x46e996?_0x15c10f[_0x9d01('0x14')]:_0x4420fc[_0x9d01('0x12')]+_0x4420fc[_0x9d01('0x13')];var _0x11b559;if(_0x57dd11>=_0x525363){_0x57dd11=_0x525363;_0x11b559=0xc8;}else{_0x11b559=0xce;}_0x2ac085[_0x9d01('0x10')](_0x11b559);return _0x2ac085['set'](_0x9d01('0x15'),_0x2d07a7+'-'+_0x57dd11+'/'+_0x525363)['json'](_0x15c10f);}return null;};}function saveUpdates(_0x180df4){return function(_0x5411d5){if(_0x5411d5){return _0x5411d5[_0x9d01('0x16')](_0x180df4)['then'](function(_0x28cb46){return _0x28cb46;});}return null;};}function removeEntity(_0x10db37){return function(_0x24564c){if(_0x24564c){return _0x24564c['destroy']()[_0x9d01('0x17')](function(){_0x10db37[_0x9d01('0x10')](0xcc)[_0x9d01('0x18')]();});}};}function handleEntityNotFound(_0x5c8e3b){return function(_0x11ab80){if(!_0x11ab80){_0x5c8e3b[_0x9d01('0x19')](0x194);}return _0x11ab80;};}function handleError(_0x17f722,_0x28c80d){_0x28c80d=_0x28c80d||0x1f4;return function(_0x40fc46){logger[_0x9d01('0x1a')](_0x40fc46[_0x9d01('0x1b')]);if(_0x40fc46[_0x9d01('0x1c')]){delete _0x40fc46['name'];}_0x17f722['status'](_0x28c80d)['send'](_0x40fc46);};}exports[_0x9d01('0x1d')]=function(_0x152b99,_0x1dab01){var _0x4b1c70={},_0x2431f1={},_0x643c93={'count':0x0,'rows':[]};return db[_0x9d01('0x1e')][_0x9d01('0x1f')]()[_0x9d01('0x17')](function(_0x3a865f){var _0x22fdc5=[];for(var _0x36d34e=0x0;_0x36d34e0x1){_0x5073a['or'](_0x9d01('0x60'),qs['getFullTextValue'](_0x469f93),null);}else{if(qs['isNumeric'](_0x469f93)){_0x5073a['or'](_0x9d01('0x61'),_0x469f93+'%');_0x5073a['or']('c.phone\x20LIKE\x20?',_0x469f93+'%');_0x5073a['or']('c.mobile\x20LIKE\x20?',_0x469f93+'%');_0x5073a['or']('c.fax\x20LIKE\x20?',_0x469f93+'%');}else if(qs[_0x9d01('0x62')](_0x469f93)){_0x5073a['or']('c.email\x20LIKE\x20?',_0x469f93+'%');}else{_0x5073a['or'](_0x9d01('0x63'),'%'+_0x469f93+'%');_0x5073a['or'](_0x9d01('0x64'),'%'+_0x469f93+'%');_0x5073a['or'](_0x9d01('0x65'),'%'+_0x469f93+'%');}}}}_0x123f35['where'](_0x5073a);_0x123f35[_0x9d01('0x66')](_0x9d01('0x67'));var _0x2dc8e7={'type':db[_0x9d01('0x68')][_0x9d01('0x69')][_0x9d01('0x6a')],'raw':!![]};var _0x4cc808=_0x123f35[_0x9d01('0x6b')]()[_0x9d01('0x34')](_0x9d01('0x67'));if(_0x4b1c70['order']){_0x4b1c70['order'][_0x9d01('0x47')](function(_0x1a9315){_0x123f35[_0x9d01('0x30')]('c.'+_0x1a9315[0x0],_0x1a9315[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9d01('0x56')](_0x58bb3f)){_0x123f35[_0x9d01('0x6c')](_0x36b8ed);_0x4cc808[_0x9d01('0x3f')](_0x9d01('0x6d'),_0x58bb3f);}BPromise[_0x9d01('0x6e')]()[_0x9d01('0x17')](function(){if(!_0x21a8d8)return;if(_0x152b99[_0x9d01('0x6f')][_0x9d01('0x70')]!==_0x9d01('0x71'))return;if(!_['some'](_0x21a8d8[_0x9d01('0x44')],[_0x9d01('0x34'),_0x9d01('0x72')])){return _0x152b99[_0x9d01('0x6f')]['getLists']({'attributes':['id'],'raw':!![]})['then'](function(_0x22d0f7){if(_[_0x9d01('0x56')](_0x22d0f7)){_0x4cc808[_0x9d01('0x3f')]('c.ListId\x20IS\x20NULL');_0x123f35[_0x9d01('0x3f')](_0x9d01('0x73'));}else{_0x4cc808[_0x9d01('0x3f')](_0x9d01('0x57'),_[_0x9d01('0x46')](_0x22d0f7,'id'));_0x123f35[_0x9d01('0x3f')]('c.ListId\x20IN\x20?',_[_0x9d01('0x46')](_0x22d0f7,'id'));}});}})[_0x9d01('0x17')](function(){if(_0x152b99[_0x9d01('0x6f')]['role']===_0x9d01('0x71')&&!_0x21a8d8&&!_0x152b99['query'][_0x9d01('0x74')])return[];return db['sequelize'][_0x9d01('0x29')](_0x4cc808[_0x9d01('0x75')](),_0x2dc8e7);})[_0x9d01('0x17')](function(_0x63678e){_0x643c93['count']=_0x63678e[_0x9d01('0x21')];if(_0x643c93[_0x9d01('0x14')]===0x0)return[];return db['sequelize'][_0x9d01('0x29')](_0x2f3bf6[_0x9d01('0x75')](),_0x2dc8e7)[_0x9d01('0x17')](function(_0x4ff930){_0x201ad9=_[_0x9d01('0x76')](_0x4ff930,'id');_0x2dc8e7=_[_0x9d01('0x77')](_0x2dc8e7,{'model':db[_0x9d01('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x152b99[_0x9d01('0x29')]['fields']){_0x4b1c70[_0x9d01('0x2b')]['forEach'](function(_0x551b9f){_0x123f35[_0x9d01('0x34')]('c.'+_0x551b9f);});}else{_0x123f35[_0x9d01('0x34')]('c.id');_0x123f35[_0x9d01('0x34')]('c.firstName');_0x123f35[_0x9d01('0x34')](_0x9d01('0x78'));_0x123f35['field'](_0x9d01('0x79'));_0x123f35['field'](_0x9d01('0x7a'));_0x123f35[_0x9d01('0x34')]('c.fax');_0x123f35[_0x9d01('0x34')]('c.email');_0x123f35[_0x9d01('0x34')](_0x9d01('0x7b'));_0x123f35[_0x9d01('0x34')](_0x9d01('0x7c'));_0x123f35[_0x9d01('0x34')](_0x9d01('0x7d'));_0x123f35['field'](_0x9d01('0x7e'));_0x123f35['field'](_0x9d01('0x7f'),_0x9d01('0x80'));}if(_0x4b1c70[_0x9d01('0x13')])_0x123f35[_0x9d01('0x13')](_0x4b1c70[_0x9d01('0x13')]);if(_0x4b1c70['offset'])_0x123f35['offset'](_0x4b1c70[_0x9d01('0x12')]);return db[_0x9d01('0x81')][_0x9d01('0x29')](_0x123f35[_0x9d01('0x75')](),_0x2dc8e7);});})[_0x9d01('0x17')](function(_0x375ece){_0x375ece[_0x9d01('0x47')](function(_0x4df9e4){if(_0x4df9e4['TagIds']){_0x4df9e4[_0x9d01('0x82')]=[];_0x4df9e4[_0x9d01('0x80')]['split'](',')[_0x9d01('0x47')](function(_0x443971){_0x4df9e4[_0x9d01('0x82')][_0x9d01('0x54')](_0x201ad9[_0x443971]);});}delete _0x4df9e4['TagIds'];});_0x643c93[_0x9d01('0x83')]=_0x375ece;return _0x643c93;})[_0x9d01('0x17')](respondWithFilteredResult(_0x1dab01,_0x4b1c70));})[_0x9d01('0x84')](handleError(_0x1dab01,null));};exports[_0x9d01('0x85')]=function(_0x218b46,_0x3f9091){return db[_0x9d01('0x1e')][_0x9d01('0x86')]({'where':{'id':_0x218b46[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0x3f9091,null))['then'](removeEntity(_0x3f9091,null))['catch'](handleError(_0x3f9091,null));};exports[_0x9d01('0x1f')]=function(_0x10538a,_0x431b87){return db[_0x9d01('0x1e')][_0x9d01('0x1f')]()[_0x9d01('0x17')](function(_0x40deac){delete _0x40deac[_0x9d01('0x88')];for(var _0x3323a6=0x0;_0x3323a60x0){return new Promise(function(_0x2f983b,_0x1becbf){var _0x1f47cb=[];for(var _0x5b8f3a=0x0;_0x5b8f3a<_0x5025fc['length'];_0x5b8f3a++){_0x1f47cb[_0x9d01('0x54')](insertAdditionalPhones(_0x5025fc[_0x5b8f3a][_0x9d01('0xb3')],_0x5025fc[_0x5b8f3a][_0x9d01('0xae')]));}Promise[_0x9d01('0x26')](_0x1f47cb)[_0x9d01('0x17')](function(){_0x2f983b(0x1);});})[_0x9d01('0x17')](function(){return{'success':_0x5dbcba,'failure':_0x5c7719,'duplicates':_0x4e64f4};});}else{return{'success':_0x5dbcba,'failure':_0x5c7719,'duplicates':_0x4e64f4};}}})[_0x9d01('0x17')](respondWithResult(_0x3c8dea,0xc9))['catch'](handleError(_0x3c8dea,null));};exports[_0x9d01('0xb4')]=function(_0x395fe0,_0x399edd){var _0x1f120f;return db[_0x9d01('0x1e')]['describe']()[_0x9d01('0x17')](function(_0x3887f4){return db['CmContact'][_0x9d01('0x86')]({'where':{'id':_0x395fe0[_0x9d01('0x87')]['id']},'include':[{'model':db['Tag'],'as':_0x9d01('0x82'),'attributes':['id','name',_0x9d01('0x35')],'required':_0x395fe0[_0x9d01('0x29')][_0x9d01('0x5b')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x9d01('0xb5'),'where':{'CmContactId':_0x395fe0[_0x9d01('0x87')]['id']},'required':![],'include':[{'model':db[_0x9d01('0xb6')],'as':_0x9d01('0xb7')}]}],'order':[db[_0x9d01('0x81')][_0x9d01('0xb8')](_0x9d01('0xb9'))],'attributes':_[_0x9d01('0x20')](_0x3887f4)});})[_0x9d01('0x17')](function(_0x528070){if(!_[_0x9d01('0xaa')](_0x528070)){_0x1f120f=_0x528070[_0x9d01('0x90')]({'plain':!![]});var _0x239fa1={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x528070&&_0x528070['ListId']){if(_0x528070[_0x9d01('0x74')]){_0x239fa1['where'][_0x9d01('0xba')][_0x9d01('0x54')]({'ListId':{'$ne':_0x528070[_0x9d01('0x74')]}});}}return db['CmCustomField']['findAll'](_0x239fa1);}})[_0x9d01('0x17')](function(_0x217e96){if(!_[_0x9d01('0xaa')](_0x217e96)){return _[_0x9d01('0xbb')](_0x1f120f,_[_0x9d01('0x46')](_0x217e96,function(_0x5e8b6e){return util['format'](_0x9d01('0xbc'),_0x5e8b6e['id']);}));}})['then'](handleEntityNotFound(_0x399edd,null))[_0x9d01('0x17')](respondWithResult(_0x399edd,null))[_0x9d01('0x84')](handleError(_0x399edd,null));};exports[_0x9d01('0x16')]=function(_0x1ecd89,_0xfa0754){var _0x56abbe;if(_0x1ecd89[_0x9d01('0x8f')]['id']){delete _0x1ecd89[_0x9d01('0x8f')]['id'];}if(!_[_0x9d01('0xaa')](_0x1ecd89['body'][_0x9d01('0xab')])){var _0x2a6e5a=_0x1ecd89[_0x9d01('0x8f')][_0x9d01('0xab')];if(!_[_0x9d01('0xaa')](shared[_0x9d01('0xac')][_0x2a6e5a]))_0x1ecd89[_0x9d01('0x8f')][_0x9d01('0xad')]=shared[_0x9d01('0xac')][_0x2a6e5a][_0x9d01('0xad')];}return db[_0x9d01('0x1e')][_0x9d01('0x86')]({'where':{'id':_0x1ecd89[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0xfa0754,null))[_0x9d01('0x17')](saveUpdates(_0x1ecd89[_0x9d01('0x8f')],null))[_0x9d01('0x17')](function(_0x507474){_0x56abbe=_0x507474;var _0x3209de={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x507474&&_0x507474['ListId']){if(_0x507474[_0x9d01('0x74')]){_0x3209de['where']['$and'][_0x9d01('0x54')]({'ListId':{'$ne':_0x507474[_0x9d01('0x74')]}});}}return db[_0x9d01('0x8c')][_0x9d01('0x8d')](_0x3209de);})[_0x9d01('0x17')](function(_0x3027b1){if(_0x3027b1){return _[_0x9d01('0xbb')](_['pickBy'](_0x1ecd89[_0x9d01('0x8f')],function(_0x4d1bd4,_0x52cd3a){return _['startsWith'](_0x52cd3a,'cf_');}),_[_0x9d01('0x46')](_0x3027b1,function(_0x55ff55){return util[_0x9d01('0xbd')]('cf_%d',_0x55ff55['id']);}));}})[_0x9d01('0x17')](function(_0x6607fe){if(_0x6607fe&&!_['isEmpty'](_0x6607fe)){var _0x41fb78=squel['update']()[_0x9d01('0xbe')](_0x9d01('0x38'))['setFields'](_0x6607fe)[_0x9d01('0x3f')](_0x9d01('0xbf'),_0x1ecd89[_0x9d01('0x87')]['id'])[_0x9d01('0xc0')]();return db['sequelize'][_0x9d01('0x29')](_0x41fb78[_0x9d01('0x53')],{'replacements':_0x41fb78[_0x9d01('0x8e')]});}})['then'](function(){if(_0x1ecd89['body']['phone']&&_0x56abbe){return db['CmHopper']['update']({'phone':_0x1ecd89[_0x9d01('0x8f')][_0x9d01('0xc1')],'OrderBy':0x0},{'where':{'ContactId':_0x56abbe['id']}});}})[_0x9d01('0x17')](function(){return _0x56abbe;})[_0x9d01('0x17')](respondWithResult(_0xfa0754,null))[_0x9d01('0x84')](handleError(_0xfa0754,null));};exports['getTags']=function(_0x1ffcac,_0x137e13){var _0x54af92={};var _0x173075={};var _0x2ccc39;var _0x1c46ba;return db[_0x9d01('0x1e')][_0x9d01('0x24')]({'where':{'id':_0x1ffcac[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0x137e13,null))[_0x9d01('0x17')](function(_0x3d8c34){if(_0x3d8c34){_0x2ccc39=_0x3d8c34;_0x173075[_0x9d01('0x28')]=_[_0x9d01('0x20')](db[_0x9d01('0x45')]['rawAttributes']);_0x173075[_0x9d01('0x29')]=_[_0x9d01('0x20')](_0x1ffcac[_0x9d01('0x29')]);_0x173075[_0x9d01('0x2a')]=_[_0x9d01('0x2c')](_0x173075['model'],_0x173075[_0x9d01('0x29')]);_0x54af92['attributes']=_['intersection'](_0x173075['model'],qs['fields'](_0x1ffcac[_0x9d01('0x29')][_0x9d01('0x2d')]));_0x54af92[_0x9d01('0x2b')]=_0x54af92[_0x9d01('0x2b')][_0x9d01('0x21')]?_0x54af92['attributes']:_0x173075[_0x9d01('0x28')];_0x54af92['order']=qs[_0x9d01('0x31')](_0x1ffcac[_0x9d01('0x29')][_0x9d01('0x31')]);_0x54af92[_0x9d01('0x3f')]=qs['filters'](_[_0x9d01('0x32')](_0x1ffcac[_0x9d01('0x29')],_0x173075['filters']));if(_0x1ffcac[_0x9d01('0x29')]['filter']){_0x54af92[_0x9d01('0x3f')]=_['merge'](_0x54af92[_0x9d01('0x3f')],{'$or':_[_0x9d01('0x46')](_0x54af92[_0x9d01('0x2b')],function(_0x4dc832){var _0x2d22b4={};_0x2d22b4[_0x4dc832]={'$like':'%'+_0x1ffcac[_0x9d01('0x29')]['filter']+'%'};return _0x2d22b4;})});}_0x54af92=_[_0x9d01('0x77')]({},_0x54af92,_0x1ffcac[_0x9d01('0xc2')]);return _0x2ccc39[_0x9d01('0xc3')](_0x54af92);}})[_0x9d01('0x17')](function(_0x46fa6f){if(_0x46fa6f){_0x1c46ba=_0x46fa6f[_0x9d01('0x21')];if(!_0x1ffcac[_0x9d01('0x29')][_0x9d01('0x2e')](_0x9d01('0x2f'))){_0x54af92[_0x9d01('0x13')]=qs[_0x9d01('0x13')](_0x1ffcac[_0x9d01('0x29')]['limit']);_0x54af92['offset']=qs[_0x9d01('0x12')](_0x1ffcac[_0x9d01('0x29')][_0x9d01('0x12')]);}return _0x2ccc39['getTags'](_0x54af92);}})['then'](function(_0x37b919){if(_0x37b919){return _0x37b919?{'count':_0x1c46ba,'rows':_0x37b919}:null;}})[_0x9d01('0x17')](respondWithResult(_0x137e13,null))[_0x9d01('0x84')](handleError(_0x137e13,null));};exports[_0x9d01('0xc4')]=function(_0x228214,_0x523b1d){if(_0x228214[_0x9d01('0x8f')]['id']){delete _0x228214['body']['id'];}return db[_0x9d01('0x1e')][_0x9d01('0x24')]({'where':{'id':_0x228214[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0x523b1d,null))[_0x9d01('0x17')](function(_0x39b89c){if(_0x39b89c){return _0x39b89c[_0x9d01('0xc4')](_0x228214[_0x9d01('0x8f')][_0x9d01('0xc5')]||[]);}return null;})[_0x9d01('0x17')](respondWithResult(_0x523b1d,null))[_0x9d01('0x84')](handleError(_0x523b1d,null));};exports['setAdditionalPhones']=function(_0x237440,_0x4e9e5d){var _0x2eb7af=[];_0x2eb7af[_0x9d01('0x54')](addAdditionalPhones(_0x237440[_0x9d01('0x8f')]));Promise[_0x9d01('0x26')](_0x2eb7af)[_0x9d01('0x17')](function(){_0x2eb7af=[];_0x2eb7af['push'](deleteCmHopperPhones(_0x237440[_0x9d01('0x8f')]['id']));_0x2eb7af[_0x9d01('0x54')](addCmHopperPhones(_0x237440[_0x9d01('0x8f')]['id']));Promise[_0x9d01('0x26')](_0x2eb7af)['then'](function(){return[0x1];})[_0x9d01('0x17')](respondWithResult(_0x4e9e5d,null));});};function addAdditionalPhones(_0x158dc0){var _0x4e3ae3;return new Promise(function(_0x4827ec,_0x45f1e0){return db[_0x9d01('0x9d')][_0x9d01('0x85')]({'where':{'CmContactId':_0x158dc0['id']}})['then'](function(){db['ContactItemType'][_0x9d01('0x8d')]({'raw':!![],'attributes':['id',_0x9d01('0xc6')]})[_0x9d01('0x17')](function(_0xb89909){var _0x391641=[];for(var _0x199d03=0x0;_0x199d03<_0x158dc0['items']['length'];_0x199d03++){var _0x1e607d=_0x158dc0[_0x9d01('0xc7')]?_[_0x9d01('0xaa')](_0x158dc0[_0x9d01('0xc7')][_0x199d03])?'':_0x158dc0[_0x9d01('0xc7')][_0x199d03]:_0x158dc0['items'][_0x199d03][_0x9d01('0xc8')]?_0x158dc0[_0x9d01('0xc9')][_0x199d03]['ItemTypeId']:'';var _0x51ddd5=_[_0x9d01('0xaa')](_0x158dc0[_0x9d01('0xc9')][_0x199d03]['description'])?'':_0x158dc0['items'][_0x199d03][_0x9d01('0xca')];var _0x1b32b8=_0x1e607d+':'+_0x158dc0[_0x9d01('0xc9')][_0x199d03][_0x9d01('0xc1')]+'§'+_0x51ddd5;if(_[_0x9d01('0xaa')](_0x4e3ae3))_0x4e3ae3=_0x1b32b8;else _0x4e3ae3+=';'+_0x1b32b8;var _0xb0fde8=null;if(_0x158dc0['item_types']){if(!_[_0x9d01('0xaa')](_0x158dc0['item_types'][_0x199d03])){var _0x22846d=_[_0x9d01('0x86')](_0xb89909,function(_0x5957b6){return _0x5957b6['id']===_0x158dc0['item_types'][_0x199d03];});if(!_[_0x9d01('0xaa')](_0x22846d)){_0xb0fde8=_0x22846d[_0x9d01('0xc6')];}}}else{if(!_[_0x9d01('0xaa')](_0x158dc0[_0x9d01('0xc9')][_0x199d03])){var _0x22846d=_[_0x9d01('0x86')](_0xb89909,function(_0x86fdcf){return _0x86fdcf['id']===_0x158dc0['items'][_0x199d03][_0x9d01('0xc8')];});if(!_[_0x9d01('0xaa')](_0x22846d)){_0xb0fde8=_0x199d03;}}}if(_[_0x9d01('0xaa')](_0xb0fde8)){_0xb0fde8=0x64;}_0x391641[_0x9d01('0x54')](addAdditionalPhone(_0x158dc0['id'],_0x158dc0['items'][_0x199d03][_0x9d01('0xc1')],_0x158dc0[_0x9d01('0xc7')]?_[_0x9d01('0xaa')](_0x158dc0['item_types'][_0x199d03])?null:_0x158dc0[_0x9d01('0xc7')][_0x199d03]:_0x158dc0[_0x9d01('0xc9')][_0x199d03][_0x9d01('0xc8')]?_0x158dc0['items'][_0x199d03]['ItemTypeId']:null,_0xb0fde8,_0x51ddd5));}Promise[_0x9d01('0x26')](_0x391641)[_0x9d01('0x17')](function(){db[_0x9d01('0x1e')][_0x9d01('0x16')]({'AdditionalPhones':_0x4e3ae3},{'where':{'id':_0x158dc0['id']}})['then'](function(){_0x4827ec(0x1);});});});});});}function addAdditionalPhone(_0x1ccff2,_0x1ccda8,_0x214f1a,_0x1f67dc,_0x151198){return db[_0x9d01('0x9d')][_0x9d01('0x86')]({'where':{'CmContactId':_0x1ccff2,'item':_0x1ccda8}})['then'](function(_0x3a7618){if(_0x3a7618)logger[_0x9d01('0x91')](_0x9d01('0xcb'),_0x3a7618);else{db['CmContactHasItem'][_0x9d01('0x94')]({'CmContactId':_0x1ccff2,'item':_0x1ccda8,'ItemTypeId':_0x214f1a,'OrderBy':_0x1f67dc,'ItemClass':'PHONE','description':_0x151198});}});}function deletePhones(_0x17b3a6){return db['CmContactHasItem'][_0x9d01('0x85')]({'where':{'CmContactId':_0x17b3a6}});}function deleteCmHopperPhones(_0x4c3781){return new Promise(function(_0x55e00a,_0x5aa8ff){return db[_0x9d01('0xcc')][_0x9d01('0x8d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4c3781}})[_0x9d01('0x17')](function(_0xb2f1e1){db[_0x9d01('0xcd')][_0x9d01('0x85')]({'where':{'CmHopperId':{'$in':_[_0x9d01('0x46')](_0xb2f1e1,'id')}}});})[_0x9d01('0x17')](function(){_0x55e00a(0x1);});});}function addCmHopperPhones(_0x32c770){return new Promise(function(_0xc6fc12,_0x45bc76){return db[_0x9d01('0xcc')][_0x9d01('0x8d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x32c770}})['then'](function(_0x374335){var _0xbb2795=[];_['map'](_0x374335,function(_0x5e4391){_0xbb2795[_0x9d01('0x54')](createCmHopperPhone(_0x32c770,_0x5e4391['id']));});Promise[_0x9d01('0x26')](_0xbb2795)[_0x9d01('0x17')](function(){_0xc6fc12(0x1);});});});}function createCmHopperPhone(_0x434323,_0x445d53){return new Promise(function(_0x40d9ae,_0x4c212c){db[_0x9d01('0x9d')][_0x9d01('0x8d')]({'raw':!![],'attributes':['item',_0x9d01('0xc6')],'where':{'CmContactId':_0x434323,'ItemClass':_0x9d01('0xce')},'include':[{'model':db[_0x9d01('0xb6')],'attributes':['OrderBy'],'as':_0x9d01('0xb7')}],'order':['OrderBy',db[_0x9d01('0x81')][_0x9d01('0xb8')]('`ItemType`.OrderBy')]})[_0x9d01('0x17')](function(_0x383599){var _0x20c5b1=0x1;var _0x14ac5a=_['map'](_0x383599,function(_0x3f1f45){_0x3f1f45['CmHopperId']=_0x445d53;_0x3f1f45[_0x9d01('0xc1')]=_0x3f1f45[_0x9d01('0xcf')];_0x3f1f45[_0x9d01('0xc6')]=_0x20c5b1;delete _0x3f1f45[_0x9d01('0xd0')];_0x20c5b1=_0x20c5b1+0x1;return _0x3f1f45;});return db['CmHopperAdditionalPhone'][_0x9d01('0xd1')](_0x14ac5a,{});})['then'](function(){_0x40d9ae(0x1);});});}function insertAdditionalPhones(_0x2fc940,_0x319a28){return new Promise(function(_0x256e1f,_0xbe6af9){var _0x44c66f=[];for(var _0x12943e=0x0;_0x12943e<_0x319a28[_0x9d01('0x21')];_0x12943e++){var _0x5b9ca2=_0x319a28[_0x12943e];_0x44c66f[_0x9d01('0x54')](parseContactItemType(_0x5b9ca2));}Promise[_0x9d01('0x26')](_0x44c66f)['then'](function(){var _0x41631a={'id':_0x2fc940['id'],'items':_0x319a28};return addAdditionalPhones(_0x41631a)[_0x9d01('0x17')](function(_0x442c8c){return addCmHopperPhones(_0x2fc940['id']);});})['then'](function(){_0x256e1f(_0x2fc940);});});}function parseContactItemType(_0xd303ab){return new Promise(function(_0x46ba1d,_0x266abe){if(_0xd303ab['hasOwnProperty'](_0x9d01('0xc8'))){_0x46ba1d(_0xd303ab);}else{return db[_0x9d01('0xb6')][_0x9d01('0x86')]({'where':{'name':_0xd303ab[_0x9d01('0xb7')]}})[_0x9d01('0x17')](function(_0x403855){if(_[_0x9d01('0xaa')](_0x403855))_0xd303ab[_0x9d01('0xc8')]=null;else _0xd303ab[_0x9d01('0xc8')]=_0x403855['id'];_0x46ba1d(_0xd303ab);});}});}exports['getAdditionalPhones']=function(_0x3dc01b,_0x1fe6f4){return db[_0x9d01('0x9d')][_0x9d01('0x8d')]({'raw':!![],'where':{'CmContactId':_0x3dc01b[_0x9d01('0x87')]['id'],'ItemClass':_0x9d01('0xce')},'include':[{'model':db['ContactItemType'],'as':_0x9d01('0xb7')}],'order':[[_0x9d01('0xc6')],[db[_0x9d01('0x81')][_0x9d01('0xb8')]('`ItemType`.OrderBy')]]})[_0x9d01('0x17')](function(_0x46b7ad){return _0x46b7ad;})['then'](respondWithResult(_0x1fe6f4,null))[_0x9d01('0x84')](handleError(_0x1fe6f4,null));};exports['duplicateAdditionalPhones']=function(_0xea27e2,_0x5a7c7e){return db['CmContactHasItem'][_0x9d01('0x8d')]({'raw':!![],'where':{'CmContactId':_0xea27e2['body'][_0x9d01('0xd2')]}})[_0x9d01('0x17')](function(_0x1fffe8){var _0x4d7775=_['map'](_0x1fffe8,function(_0x54b152){_0x54b152[_0x9d01('0xd3')]=_0xea27e2['body'][_0x9d01('0xd4')];return _0x54b152;});return db[_0x9d01('0x9d')]['bulkCreate'](_0x4d7775,{});})['then'](function(_0x607641){return addCmHopperPhones(_0xea27e2[_0x9d01('0x8f')][_0x9d01('0xd4')]);})[_0x9d01('0x17')](function(_0x3c8750){return['ok'];})['then'](respondWithResult(_0x5a7c7e,null))[_0x9d01('0x84')](handleError(_0x5a7c7e,null));};exports[_0x9d01('0xd5')]=function(_0x49733b,_0x4eb0ea){var _0x5d7279=[];_0x5d7279[_0x9d01('0x54')](createCmHopperPhone(_0x49733b[_0x9d01('0x8f')]['id'],_0x49733b[_0x9d01('0x8f')][_0x9d01('0xd6')]));Promise[_0x9d01('0x26')](_0x5d7279)[_0x9d01('0x17')](function(){return[0x1];})[_0x9d01('0x17')](respondWithResult(_0x4eb0ea,null));};exports[_0x9d01('0xd7')]=function(_0x2400d6,_0x5e3ef8){var _0x36cc6f={'raw':![],'where':{}};var _0x1000de={};var _0x1f0ff8={'count':0x0,'rows':[]};return db['CmContact'][_0x9d01('0x24')]({'where':{'id':_0x2400d6[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0x5e3ef8,null))[_0x9d01('0x17')](function(_0x191758){if(_0x191758){_0x1000de['model']=_['keys'](db['CmHopper'][_0x9d01('0xd8')]);_0x1000de['query']=_[_0x9d01('0x20')](_0x2400d6[_0x9d01('0x29')]);_0x1000de[_0x9d01('0x2a')]=_[_0x9d01('0x2c')](_0x1000de[_0x9d01('0x28')],_0x1000de[_0x9d01('0x29')]);_0x36cc6f['attributes']=_['intersection'](_0x1000de[_0x9d01('0x28')],qs['fields'](_0x2400d6[_0x9d01('0x29')][_0x9d01('0x2d')]));_0x36cc6f[_0x9d01('0x2b')]=_0x36cc6f[_0x9d01('0x2b')][_0x9d01('0x21')]?_0x36cc6f[_0x9d01('0x2b')]:_0x1000de[_0x9d01('0x28')];if(!_0x2400d6[_0x9d01('0x29')]['hasOwnProperty'](_0x9d01('0x2f'))){_0x36cc6f[_0x9d01('0x13')]=qs[_0x9d01('0x13')](_0x2400d6[_0x9d01('0x29')][_0x9d01('0x13')]);_0x36cc6f[_0x9d01('0x12')]=qs['offset'](_0x2400d6[_0x9d01('0x29')][_0x9d01('0x12')]);}_0x36cc6f[_0x9d01('0x30')]=qs[_0x9d01('0x31')](_0x2400d6[_0x9d01('0x29')][_0x9d01('0x31')]);_0x36cc6f[_0x9d01('0x3f')]=qs['filters'](_[_0x9d01('0x32')](_0x2400d6[_0x9d01('0x29')],_0x1000de[_0x9d01('0x2a')]));_0x36cc6f[_0x9d01('0x3f')]['ContactId']=_0x191758['id'];if(_0x2400d6[_0x9d01('0x29')][_0x9d01('0x5d')]){_0x36cc6f['where']=_['merge'](_0x36cc6f[_0x9d01('0x3f')],{'$or':_[_0x9d01('0x46')](_0x36cc6f[_0x9d01('0x2b')],function(_0x50278e){var _0x3a875f={};_0x3a875f[_0x50278e]={'$like':'%'+_0x2400d6[_0x9d01('0x29')][_0x9d01('0x5d')]+'%'};return _0x3a875f;})});}_0x36cc6f=_['merge']({},_0x36cc6f,_0x2400d6[_0x9d01('0xc2')]);return db[_0x9d01('0xcc')][_0x9d01('0x14')]({'where':_0x36cc6f[_0x9d01('0x3f')]})[_0x9d01('0x17')](function(_0x1867a6){_0x1f0ff8[_0x9d01('0x14')]=_0x1867a6;if(_0x2400d6[_0x9d01('0x29')]['includeAll']){_0x36cc6f['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x36cc6f);})[_0x9d01('0x17')](function(_0x5b7f7d){_0x1f0ff8[_0x9d01('0x83')]=_0x5b7f7d;return _0x1f0ff8;});}})[_0x9d01('0x17')](respondWithFilteredResult(_0x5e3ef8,_0x36cc6f))[_0x9d01('0x84')](handleError(_0x5e3ef8,null));};exports['getHopperHistories']=function(_0x4678d8,_0x3031bc){var _0x8e8262={'raw':!![],'where':{}};var _0xc7857e={};var _0x32db8f={'count':0x0,'rows':[]};return db[_0x9d01('0x1e')][_0x9d01('0x24')]({'where':{'id':_0x4678d8[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0x3031bc,null))[_0x9d01('0x17')](function(_0xddf090){if(_0xddf090){_0xc7857e[_0x9d01('0x28')]=_[_0x9d01('0x20')](db[_0x9d01('0x9e')][_0x9d01('0xd8')]);_0xc7857e[_0x9d01('0x29')]=_[_0x9d01('0x20')](_0x4678d8[_0x9d01('0x29')]);_0xc7857e[_0x9d01('0x2a')]=_['intersection'](_0xc7857e[_0x9d01('0x28')],_0xc7857e[_0x9d01('0x29')]);_0x8e8262[_0x9d01('0x2b')]=_[_0x9d01('0x2c')](_0xc7857e['model'],qs['fields'](_0x4678d8['query']['fields']));_0x8e8262[_0x9d01('0x2b')]=_0x8e8262['attributes'][_0x9d01('0x21')]?_0x8e8262[_0x9d01('0x2b')]:_0xc7857e[_0x9d01('0x28')];if(!_0x4678d8[_0x9d01('0x29')][_0x9d01('0x2e')](_0x9d01('0x2f'))){_0x8e8262[_0x9d01('0x13')]=qs['limit'](_0x4678d8['query']['limit']);_0x8e8262[_0x9d01('0x12')]=qs[_0x9d01('0x12')](_0x4678d8[_0x9d01('0x29')][_0x9d01('0x12')]);}_0x8e8262[_0x9d01('0x30')]=qs[_0x9d01('0x31')](_0x4678d8[_0x9d01('0x29')][_0x9d01('0x31')]);_0x8e8262[_0x9d01('0x3f')]=qs['filters'](_[_0x9d01('0x32')](_0x4678d8['query'],_0xc7857e[_0x9d01('0x2a')]));_0x8e8262[_0x9d01('0x3f')][_0x9d01('0xd9')]=_0xddf090['id'];if(_0x4678d8[_0x9d01('0x29')][_0x9d01('0x5d')]){_0x8e8262[_0x9d01('0x3f')]=_[_0x9d01('0x77')](_0x8e8262[_0x9d01('0x3f')],{'$or':_[_0x9d01('0x46')](_0x8e8262[_0x9d01('0x2b')],function(_0x23ba86){var _0x3b8ed2={};_0x3b8ed2[_0x23ba86]={'$like':'%'+_0x4678d8['query'][_0x9d01('0x5d')]+'%'};return _0x3b8ed2;})});}_0x8e8262=_[_0x9d01('0x77')]({},_0x8e8262,_0x4678d8[_0x9d01('0xc2')]);return db[_0x9d01('0x9e')][_0x9d01('0x14')]({'where':_0x8e8262[_0x9d01('0x3f')]})[_0x9d01('0x17')](function(_0x7253d2){_0x32db8f[_0x9d01('0x14')]=_0x7253d2;if(_0x4678d8[_0x9d01('0x29')][_0x9d01('0xda')]){_0x8e8262[_0x9d01('0xdb')]=[{'all':!![]}];}return db[_0x9d01('0x9e')]['findAll'](_0x8e8262);})['then'](function(_0x15199d){_0x32db8f['rows']=_0x15199d;return _0x32db8f;});}})[_0x9d01('0x17')](respondWithFilteredResult(_0x3031bc,_0x8e8262))[_0x9d01('0x84')](handleError(_0x3031bc,null));};exports[_0x9d01('0xdc')]=function(_0x4eb360,_0x1b1792){var _0x46d5a1={'raw':!![],'where':{}};var _0x35641e={};var _0x3d3499={'count':0x0,'rows':[]};return db['CmContact'][_0x9d01('0x24')]({'where':{'id':_0x4eb360[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0x1b1792,null))[_0x9d01('0x17')](function(_0x11fa18){if(_0x11fa18){_0x35641e['model']=_[_0x9d01('0x20')](db[_0x9d01('0xdd')][_0x9d01('0xd8')]);_0x35641e['query']=_[_0x9d01('0x20')](_0x4eb360[_0x9d01('0x29')]);_0x35641e[_0x9d01('0x2a')]=_[_0x9d01('0x2c')](_0x35641e[_0x9d01('0x28')],_0x35641e[_0x9d01('0x29')]);_0x46d5a1[_0x9d01('0x2b')]=_['intersection'](_0x35641e[_0x9d01('0x28')],qs[_0x9d01('0x2d')](_0x4eb360[_0x9d01('0x29')][_0x9d01('0x2d')]));_0x46d5a1['attributes']=_0x46d5a1[_0x9d01('0x2b')][_0x9d01('0x21')]?_0x46d5a1[_0x9d01('0x2b')]:_0x35641e[_0x9d01('0x28')];if(!_0x4eb360[_0x9d01('0x29')][_0x9d01('0x2e')]('nolimit')){_0x46d5a1['limit']=qs['limit'](_0x4eb360[_0x9d01('0x29')][_0x9d01('0x13')]);_0x46d5a1[_0x9d01('0x12')]=qs['offset'](_0x4eb360[_0x9d01('0x29')][_0x9d01('0x12')]);}_0x46d5a1[_0x9d01('0x30')]=qs[_0x9d01('0x31')](_0x4eb360[_0x9d01('0x29')]['sort']);_0x46d5a1['where']=qs['filters'](_['pick'](_0x4eb360['query'],_0x35641e[_0x9d01('0x2a')]));_0x46d5a1[_0x9d01('0x3f')]['ContactId']=_0x11fa18['id'];if(_0x4eb360[_0x9d01('0x29')][_0x9d01('0x5d')]){_0x46d5a1[_0x9d01('0x3f')]=_[_0x9d01('0x77')](_0x46d5a1[_0x9d01('0x3f')],{'$or':_[_0x9d01('0x46')](_0x46d5a1[_0x9d01('0x2b')],function(_0x4855d3){var _0x549a0e={};_0x549a0e[_0x4855d3]={'$like':'%'+_0x4eb360[_0x9d01('0x29')]['filter']+'%'};return _0x549a0e;})});}_0x46d5a1=_[_0x9d01('0x77')]({},_0x46d5a1,_0x4eb360[_0x9d01('0xc2')]);return db['CmHopperFinal'][_0x9d01('0x14')]({'where':_0x46d5a1[_0x9d01('0x3f')]})['then'](function(_0x2856a9){_0x3d3499[_0x9d01('0x14')]=_0x2856a9;if(_0x4eb360['query'][_0x9d01('0xda')]){_0x46d5a1['include']=[{'all':!![]}];}return db[_0x9d01('0xdd')][_0x9d01('0x8d')](_0x46d5a1);})[_0x9d01('0x17')](function(_0xecab2){_0x3d3499[_0x9d01('0x83')]=_0xecab2;return _0x3d3499;});}})['then'](respondWithFilteredResult(_0x1b1792,_0x46d5a1))[_0x9d01('0x84')](handleError(_0x1b1792,null));};exports['getJscriptySessions']=function(_0x58ae00,_0x48c259){var _0x369dfe={'raw':!![],'where':{}};var _0x5b93d5={};var _0x42176c={'count':0x0,'rows':[]};return db[_0x9d01('0x1e')][_0x9d01('0x24')]({'where':{'id':_0x58ae00[_0x9d01('0x87')]['id']}})[_0x9d01('0x17')](handleEntityNotFound(_0x48c259,null))[_0x9d01('0x17')](function(_0x313769){if(_0x313769){_0x5b93d5['model']=_[_0x9d01('0x20')](db[_0x9d01('0xa5')][_0x9d01('0xd8')]);_0x5b93d5[_0x9d01('0x29')]=_[_0x9d01('0x20')](_0x58ae00[_0x9d01('0x29')]);_0x5b93d5[_0x9d01('0x2a')]=_[_0x9d01('0x2c')](_0x5b93d5[_0x9d01('0x28')],_0x5b93d5[_0x9d01('0x29')]);_0x369dfe[_0x9d01('0x2b')]=_[_0x9d01('0x2c')](_0x5b93d5[_0x9d01('0x28')],qs[_0x9d01('0x2d')](_0x58ae00[_0x9d01('0x29')][_0x9d01('0x2d')]));_0x369dfe['attributes']=_0x369dfe[_0x9d01('0x2b')][_0x9d01('0x21')]?_0x369dfe[_0x9d01('0x2b')]:_0x5b93d5[_0x9d01('0x28')];if(!_0x58ae00['query']['hasOwnProperty'](_0x9d01('0x2f'))){_0x369dfe[_0x9d01('0x13')]=qs[_0x9d01('0x13')](_0x58ae00['query'][_0x9d01('0x13')]);_0x369dfe[_0x9d01('0x12')]=qs[_0x9d01('0x12')](_0x58ae00['query'][_0x9d01('0x12')]);}_0x369dfe[_0x9d01('0x30')]=qs[_0x9d01('0x31')](_0x58ae00[_0x9d01('0x29')]['sort']);_0x369dfe['where']=qs[_0x9d01('0x2a')](_[_0x9d01('0x32')](_0x58ae00['query'],_0x5b93d5[_0x9d01('0x2a')]));_0x369dfe[_0x9d01('0x3f')]['ContactId']=_0x313769['id'];if(_0x58ae00[_0x9d01('0x29')][_0x9d01('0x5d')]){_0x369dfe[_0x9d01('0x3f')]=_[_0x9d01('0x77')](_0x369dfe[_0x9d01('0x3f')],{'$or':_[_0x9d01('0x46')](_0x369dfe['attributes'],function(_0x236251){var _0x1684fc={};_0x1684fc[_0x236251]={'$like':'%'+_0x58ae00[_0x9d01('0x29')][_0x9d01('0x5d')]+'%'};return _0x1684fc;})});}_0x369dfe=_[_0x9d01('0x77')]({},_0x369dfe,_0x58ae00[_0x9d01('0xc2')]);return db[_0x9d01('0xa5')][_0x9d01('0x14')]({'where':_0x369dfe[_0x9d01('0x3f')]})['then'](function(_0x3933d4){_0x42176c['count']=_0x3933d4;if(_0x58ae00[_0x9d01('0x29')][_0x9d01('0xda')]){_0x369dfe[_0x9d01('0xdb')]=[{'all':!![]}];}return db[_0x9d01('0xa5')]['findAll'](_0x369dfe);})[_0x9d01('0x17')](function(_0x382baa){_0x42176c[_0x9d01('0x83')]=_0x382baa;return _0x42176c;});}})['then'](respondWithFilteredResult(_0x48c259,_0x369dfe))[_0x9d01('0x84')](handleError(_0x48c259,null));};exports[_0x9d01('0xde')]=function(_0x3de1f3,_0x2e0364){try{if(!_0x3de1f3[_0x9d01('0x8f')]['ListId']){throw new Error(_0x9d01('0xdf'));}if(!_0x3de1f3[_0x9d01('0x8f')][_0x9d01('0xe0')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x3de1f3[_0x9d01('0x8f')][_0x9d01('0xe1')]){throw new Error(_0x9d01('0xe2'));}if(!_0x3de1f3['body'][_0x9d01('0xe3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x14fd9f=_0x3de1f3[_0x9d01('0x8f')][_0x9d01('0xe0')]['split'](',');var _0x11b3c7=_0x3de1f3['body'][_0x9d01('0xe1')][_0x9d01('0x5f')](',');if(!_0x14fd9f[_0x9d01('0x21')]||!_0x11b3c7[_0x9d01('0x21')]||_0x14fd9f['length']!==_0x11b3c7[_0x9d01('0x21')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3de1f3[_0x9d01('0x8f')][_0x9d01('0x2d')]=_[_0x9d01('0xe4')](_0x14fd9f,_0x11b3c7);if(!_0x3de1f3['body'][_0x9d01('0x2d')][_0x9d01('0xc1')]){throw new Error(_0x9d01('0xe5'));}if(!_0x3de1f3['body'][_0x9d01('0x2d')][_0x9d01('0xe6')]){throw new Error(_0x9d01('0xe7'));}var _0x557513=path[_0x9d01('0xa9')](config[_0x9d01('0xe8')],_0x9d01('0xe9'),_0x3de1f3[_0x9d01('0xea')]['filename']);fs['chmodSync'](_0x557513,parseInt(_0x9d01('0xeb'),0x8));var _0x381844=require('child_process')[_0x9d01('0xec')](path[_0x9d01('0xa9')](__dirname,_0x9d01('0xed')),[_0x557513,_0x3de1f3[_0x9d01('0x8f')][_0x9d01('0xe0')],_0x3de1f3['body'][_0x9d01('0xe1')],_0x3de1f3[_0x9d01('0x8f')]['ListId'],_0x3de1f3['body'][_0x9d01('0xee')],_0x3de1f3[_0x9d01('0x8f')][_0x9d01('0xb0')],_0x3de1f3[_0x9d01('0x8f')][_0x9d01('0xe3')]]);return _0x2e0364[_0x9d01('0x10')](0xc8)['json']({'message':_0x9d01('0xef'),'pid':_0x381844[_0x9d01('0xf0')]});}catch(_0x16f92d){return _0x2e0364['status'](0x1f4)[_0x9d01('0xf1')](_0x16f92d);}};exports[_0x9d01('0xf2')]=function(_0x366cfc,_0x363b49){var _0x355e57=fs['createReadStream'](_0x366cfc['file'][_0x9d01('0x2')]);Papa[_0x9d01('0xf3')](_0x355e57,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5bbdcb){return _0x363b49[_0x9d01('0x10')](0xc8)[_0x9d01('0x11')]({'file':_0x366cfc[_0x9d01('0xea')],'fields':_0x5bbdcb[_0x9d01('0xf4')][_0x9d01('0x2d')]});}});};exports['import']=function(_0x3a4544,_0xd59f16){return db[_0x9d01('0x72')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9d01('0x71')}})[_0x9d01('0x17')](function(_0x3b048b){var _0x43d591=![];if(!_0x3a4544['body'][_0x9d01('0x74')]){throw new Error(_0x9d01('0xdf'));}if(!_0x3a4544[_0x9d01('0x8f')][_0x9d01('0xf5')][_0x9d01('0xc1')]){throw new Error(_0x9d01('0xe5'));}if(!_0x3a4544[_0x9d01('0x8f')][_0x9d01('0xf5')][_0x9d01('0xe6')]){throw new Error(_0x9d01('0xe7'));}if(!_0x3a4544['body']['socket_timestamp']){throw new Error(_0x9d01('0xf6'));}var _0x15b514=require('child_process')['fork'](path[_0x9d01('0xa9')](__dirname,'../../components/import/cm/csv2'),[_0x3a4544[_0x9d01('0x87')]['id'],JSON[_0x9d01('0xf7')](_0x3a4544[_0x9d01('0x8f')]),JSON[_0x9d01('0xf7')](_0x3b048b)]);_0x15b514['on'](_0x9d01('0xf8'),function(){_0x43d591=!![];return _0xd59f16[_0x9d01('0x10')](0xc8)[_0x9d01('0x11')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x15b514[_0x9d01('0xf0')]});});_0x15b514['on'](_0x9d01('0xf9'),function(_0x55e01f){if(_0x55e01f&&!_0x43d591){return _0xd59f16[_0x9d01('0x10')](0x1f4)['json']({'message':_0x9d01('0xfa'),'pid':_0x15b514[_0x9d01('0xf0')]});}});})[_0x9d01('0x84')](handleError(_0xd59f16,null));};exports[_0x9d01('0xfb')]=function(_0x18e571,_0x5e2113,_0x4f9718){return db[_0x9d01('0x72')][_0x9d01('0x8d')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})['then'](function(_0x16ca97){var _0x2d82d=![];if(!_0x18e571[_0x9d01('0x8f')]['ListId']){throw new Error(_0x9d01('0xdf'));}if(!_0x18e571[_0x9d01('0x8f')]['binding'][_0x9d01('0xc1')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x18e571['body']['binding'][_0x9d01('0xe6')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x18e571[_0x9d01('0x8f')][_0x9d01('0xe3')]){throw new Error(_0x9d01('0xf6'));}var _0xe20439=require('child_process')['fork'](path[_0x9d01('0xa9')](__dirname,_0x9d01('0xfc')),[_0x18e571[_0x9d01('0x87')]['id'],JSON[_0x9d01('0xf7')](_0x18e571['body']),JSON['stringify'](_0x16ca97)]);_0xe20439['on'](_0x9d01('0xf8'),function(_0x5eaf38){_0x2d82d=!![];return _0x5e2113[_0x9d01('0x10')](0xc8)[_0x9d01('0x11')]({'message':_0x9d01('0xfd'),'pid':_0xe20439[_0x9d01('0xf0')]});});_0xe20439['on'](_0x9d01('0xf9'),function(_0x173b16){if(_0x173b16&&!_0x2d82d){return _0x5e2113['status'](0x1f4)['json']({'message':_0x9d01('0xfa'),'pid':_0xe20439[_0x9d01('0xf0')]});}});})['catch'](handleError(_0x5e2113,null));};exports[_0x9d01('0xfe')]=function(_0x132070,_0x262f5f){var _0x13524d=[_0x9d01('0xff'),_0x9d01('0x100'),_0x9d01('0x101'),_0x9d01('0x102'),'fax',_0x9d01('0x103'),_0x9d01('0x104')];var _0x19bcd2={'offset':0x0,'order':qs[_0x9d01('0x31')](_0x9d01('0x105'))},_0x5bdec9={'count':0x0,'rows':[]};Promise[_0x9d01('0x6e')]()['then'](function(){if(_0x132070[_0x9d01('0x29')][_0x9d01('0x106')]){if(!_[_0x9d01('0x107')](_0x13524d,_0x132070[_0x9d01('0x29')][_0x9d01('0x106')][_0x9d01('0x108')]())){throw new Error('Invalid\x20channel');}_0x13524d=[_0x132070[_0x9d01('0x29')][_0x9d01('0x106')][_0x9d01('0x108')]()];}if(_0x132070[_0x9d01('0x29')]['range']){try{var _0x12ab2e=JSON[_0x9d01('0xf3')](_0x132070['query'][_0x9d01('0x109')]);if(!moment(_0x12ab2e[_0x9d01('0x36')])['isValid']()){throw new Error(_0x9d01('0x10a'));}if(!moment(_0x12ab2e['to'])[_0x9d01('0x10b')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x496ed1){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x132070[_0x9d01('0x29')][_0x9d01('0x2e')](_0x9d01('0x2f'))){_0x19bcd2[_0x9d01('0x13')]=qs['limit'](_0x132070['query'][_0x9d01('0x13')]||0xa);_0x19bcd2[_0x9d01('0x12')]=qs[_0x9d01('0x12')](_0x132070[_0x9d01('0x29')][_0x9d01('0x12')]);}var _0x2afce5=_0x13524d[_0x9d01('0x46')](function(_0x5c0d57){if(_0x5c0d57===_0x9d01('0x104')){var _0x48739f={'attributes':['id',_0x9d01('0x10c'),'type',_0x9d01('0x10d'),_0x9d01('0x10e'),_0x9d01('0x10f'),'starttime','endtime',_0x9d01('0x110'),_0x9d01('0x111'),_0x9d01('0x112'),_0x9d01('0x113'),_0x9d01('0x114'),'userThirdDisposition',_0x9d01('0x115')],'where':{'ContactId':_0x132070[_0x9d01('0x87')]['id']},'include':[{'model':db[_0x9d01('0x72')],'as':_0x9d01('0x72'),'attributes':['id',_0x9d01('0x1c'),_0x9d01('0x116'),_0x9d01('0x117')]}],'order':[['createdAt',_0x9d01('0x118')]]};if(_0x132070[_0x9d01('0x29')][_0x9d01('0x109')]){_0x48739f['where'][_0x9d01('0x112')]={'$gte':_0x12ab2e[_0x9d01('0x36')],'$lte':_0x12ab2e['to']};}return db[_0x9d01('0xa0')][_0x9d01('0x119')](_0x48739f)[_0x9d01('0x17')](function(_0x10b004){_0x5bdec9[_0x9d01('0x14')]+=_0x10b004[_0x9d01('0x14')];return _[_0x9d01('0x46')](_0x10b004[_0x9d01('0x83')],function(_0x5d4ea8){var _0x1c50b7=_0x5d4ea8[_0x9d01('0x90')]({'plain':!![]});_0x1c50b7[_0x9d01('0x106')]=_0x5c0d57;if(_0x1c50b7[_0x9d01('0x72')]){_0x1c50b7[_0x9d01('0x72')]={'id':_0x1c50b7[_0x9d01('0x72')]['id'],'name':_0x1c50b7[_0x9d01('0x72')]['name'],'fullname':_0x1c50b7[_0x9d01('0x72')][_0x9d01('0x116')],'alias':_0x1c50b7[_0x9d01('0x72')][_0x9d01('0x117')]};}return _0x1c50b7;});});}else{var _0x8acfeb=_[_0x9d01('0x11a')](_0x5c0d57)+(_0x5c0d57===_0x9d01('0x100')?_0x9d01('0x11b'):_0x9d01('0x11c'));var _0x4dd0e1={'attributes':['id',_0x9d01('0x11d'),'closedAt','createdAt',_0x9d01('0x111'),_0x9d01('0x11e'),'secondDisposition','thirdDisposition',_0x9d01('0x115'),_0x8acfeb+'Id'],'where':{'ContactId':_0x132070['params']['id']},'include':[{'model':db[_0x8acfeb],'as':_0x9d01('0x11c'),'attributes':['id',_0x9d01('0x1c'),_0x9d01('0x11f')]},{'model':db[_0x9d01('0x72')],'as':_0x9d01('0x120'),'attributes':['id',_0x9d01('0x1c'),_0x9d01('0x116')]},{'model':db[_0x9d01('0x45')],'as':_0x9d01('0x82'),'attributes':['id',_0x9d01('0x1c'),_0x9d01('0x35')],'through':{'attributes':[]}}],'order':[[_0x9d01('0x112'),_0x9d01('0x118')]]};if(_0x132070[_0x9d01('0x29')]['range']){_0x4dd0e1[_0x9d01('0x3f')][_0x9d01('0x112')]={'$gte':_0x12ab2e[_0x9d01('0x36')],'$lte':_0x12ab2e['to']};}switch(_0x5c0d57){case _0x9d01('0x100'):_0x4dd0e1[_0x9d01('0x2b')][_0x9d01('0x54')]('browserName',_0x9d01('0x121'),_0x9d01('0x122'),_0x9d01('0x123'),_0x9d01('0x124'),_0x9d01('0x125'),'ratingType','ratingValue','referer');break;case _0x9d01('0xff'):_0x4dd0e1['attributes'][_0x9d01('0x54')](_0x9d01('0x126'),_0x9d01('0x127'));break;case'openchannel':_0x4dd0e1[_0x9d01('0x2b')]['push'](_0x9d01('0x128'),_0x9d01('0x129'));break;}return db[_[_0x9d01('0x11a')](_0x5c0d57)+'Interaction']['findAndCountAll'](_0x4dd0e1)[_0x9d01('0x17')](function(_0x43d0a3){_0x5bdec9[_0x9d01('0x14')]+=_0x43d0a3[_0x9d01('0x14')];return _[_0x9d01('0x46')](_0x43d0a3['rows'],function(_0x3849d1){var _0x59919a=_0x3849d1['get']({'plain':!![]});_0x59919a[_0x9d01('0x106')]=_0x5c0d57;if(_0x59919a[_0x9d01('0x120')]){_0x59919a['Owner']={'id':_0x59919a[_0x9d01('0x120')]['id'],'name':_0x59919a['Owner'][_0x9d01('0x1c')],'fullname':_0x59919a[_0x9d01('0x120')][_0x9d01('0x116')]};}return _0x59919a;});});}});return Promise[_0x9d01('0x26')](_0x2afce5);})[_0x9d01('0x17')](function(_0x3ad918){return _(_0x3ad918)[_0x9d01('0x12a')]()[_0x9d01('0x12b')](_0x9d01('0x112'))[_0x9d01('0x12c')]()[_0x9d01('0x4c')]();})[_0x9d01('0x17')](function(_0x750921){_0x5bdec9[_0x9d01('0x83')]=_0x19bcd2[_0x9d01('0x13')]?_0x750921[_0x9d01('0x12d')](_0x19bcd2[_0x9d01('0x12')],_0x19bcd2[_0x9d01('0x12')]+_0x19bcd2[_0x9d01('0x13')]):_0x750921;return _0x5bdec9;})[_0x9d01('0x17')](respondWithFilteredResult(_0x262f5f,_0x19bcd2))[_0x9d01('0x84')](handleError(_0x262f5f,null));}; \ No newline at end of file +var _0xc410=['uniqueid','type','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerPort','deviceModel','ratingType','ratingValue','subject','substatus','openchannel','externalUrl','threadId','flatten','sortBy','reverse','path','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','limit','set','update','then','destroy','end','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','findOne','trimStart','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','map','forEach','union','User','and','dateOfBirth','datetime','DATE','buildExpression','start','isNil','Contact','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','split','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','DESC','having','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','isEmpty','sequelize','toString','keyBy','merge','c.mobile','c.fax','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','displayName','CmCustomField','findAll','columnName','alias','custom','values','body','from','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','all','show','Tag','CmContactHasItem','Phones','ContactItemType','ItemType','Phones.OrderBy','$and','omit','pickBy','format','setFields','id\x20=\x20?','toParam','phone','options','getTags','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','literal','ItemType.OrderBy','`ItemType`.OrderBy','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','ContactId','include','getHopperHistories','CmHopperHistory','includeAll','getJscriptySessions','uploadCsv','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','root','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','parse','file','import','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','No\x20ListId\x20specified','getJourney','mail','chat','sms','fax','whatsapp','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter'];(function(_0xea6c20,_0x5a0de8){var _0x458655=function(_0x4afe96){while(--_0x4afe96){_0xea6c20['push'](_0xea6c20['shift']());}};_0x458655(++_0x5a0de8);}(_0xc410,0x14e));var _0x0c41=function(_0x4c1176,_0xf999e9){_0x4c1176=_0x4c1176-0x0;var _0x2aca97=_0xc410[_0x4c1176];return _0x2aca97;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x0c41('0x0'));var fs=require('fs');var _=require(_0x0c41('0x1'));var squel=require(_0x0c41('0x2'));var Papa=require(_0x0c41('0x3'));var Redis=require(_0x0c41('0x4'));var qs=require('../../components/parsers/qs');var as=require(_0x0c41('0x5'));var logger=require(_0x0c41('0x6'))(_0x0c41('0x7'));var config=require('../../config/environment');var shared=require(_0x0c41('0x8'));var db=require(_0x0c41('0x9'))['db'];config[_0x0c41('0xa')]=_[_0x0c41('0xb')](config[_0x0c41('0xa')],{'host':_0x0c41('0xc'),'port':0x18eb});var socket=require(_0x0c41('0xd'))(new Redis(config[_0x0c41('0xa')]));require(_0x0c41('0xe'))[_0x0c41('0xf')](socket);function respondWithResult(_0x1e1e4a,_0x2c2e25){_0x2c2e25=_0x2c2e25||0xc8;return function(_0xfb82d){if(_0xfb82d){return _0x1e1e4a[_0x0c41('0x10')](_0x2c2e25)[_0x0c41('0x11')](_0xfb82d);}};}function respondWithFilteredResult(_0x26046d,_0x2c9573){return function(_0x3c2c09){if(_0x3c2c09){var _0x3850d0=typeof _0x2c9573[_0x0c41('0x12')]==='undefined'&&typeof _0x2c9573['limit']===_0x0c41('0x13');var _0x54fe2c=_0x3c2c09[_0x0c41('0x14')];var _0x2ee814=_0x3850d0?0x0:_0x2c9573[_0x0c41('0x12')];var _0x1e22d7=_0x3850d0?_0x3c2c09[_0x0c41('0x14')]:_0x2c9573[_0x0c41('0x12')]+_0x2c9573[_0x0c41('0x15')];var _0x268285;if(_0x1e22d7>=_0x54fe2c){_0x1e22d7=_0x54fe2c;_0x268285=0xc8;}else{_0x268285=0xce;}_0x26046d[_0x0c41('0x10')](_0x268285);return _0x26046d[_0x0c41('0x16')]('Content-Range',_0x2ee814+'-'+_0x1e22d7+'/'+_0x54fe2c)[_0x0c41('0x11')](_0x3c2c09);}return null;};}function saveUpdates(_0x337b42){return function(_0x42f44b){if(_0x42f44b){return _0x42f44b[_0x0c41('0x17')](_0x337b42)[_0x0c41('0x18')](function(_0x471db4){return _0x471db4;});}return null;};}function removeEntity(_0x26586a){return function(_0x260ffc){if(_0x260ffc){return _0x260ffc[_0x0c41('0x19')]()[_0x0c41('0x18')](function(){_0x26586a[_0x0c41('0x10')](0xcc)[_0x0c41('0x1a')]();});}};}function handleEntityNotFound(_0x501ae5){return function(_0x27cec6){if(!_0x27cec6){_0x501ae5['sendStatus'](0x194);}return _0x27cec6;};}function handleError(_0x550333,_0x5e035b){_0x5e035b=_0x5e035b||0x1f4;return function(_0x286e3f){logger[_0x0c41('0x1b')](_0x286e3f[_0x0c41('0x1c')]);if(_0x286e3f[_0x0c41('0x1d')]){delete _0x286e3f[_0x0c41('0x1d')];}_0x550333['status'](_0x5e035b)[_0x0c41('0x1e')](_0x286e3f);};}exports[_0x0c41('0x1f')]=function(_0x1ea405,_0x10a6ce){var _0x477c9f={},_0x1a78e9={},_0x1c128b={'count':0x0,'rows':[]};return db[_0x0c41('0x20')][_0x0c41('0x21')]()[_0x0c41('0x18')](function(_0x5a0e15){var _0x49db90=[];for(var _0x46a43a=0x0;_0x46a43a0x1){_0x1e4734['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0c41('0x5f')](_0x28a6d5),null);}else{if(qs['isNumeric'](_0x28a6d5)){_0x1e4734['or'](_0x0c41('0x60'),_0x28a6d5+'%');_0x1e4734['or'](_0x0c41('0x61'),_0x28a6d5+'%');_0x1e4734['or']('c.mobile\x20LIKE\x20?',_0x28a6d5+'%');_0x1e4734['or'](_0x0c41('0x62'),_0x28a6d5+'%');}else if(qs[_0x0c41('0x63')](_0x28a6d5)){_0x1e4734['or'](_0x0c41('0x64'),_0x28a6d5+'%');}else{_0x1e4734['or'](_0x0c41('0x65'),'%'+_0x28a6d5+'%');_0x1e4734['or'](_0x0c41('0x66'),'%'+_0x28a6d5+'%');_0x1e4734['or'](_0x0c41('0x64'),'%'+_0x28a6d5+'%');}}}}_0x332537[_0x0c41('0x34')](_0x1e4734);_0x332537[_0x0c41('0x67')](_0x0c41('0x68'));var _0x22e148={'type':db[_0x0c41('0x69')][_0x0c41('0x6a')]['SELECT'],'raw':!![]};var _0x30945f=_0x332537[_0x0c41('0x6b')]()[_0x0c41('0x37')]('c.id');if(_0x477c9f[_0x0c41('0x32')]){_0x477c9f[_0x0c41('0x32')][_0x0c41('0x4a')](function(_0x3d45db){_0x332537['order']('c.'+_0x3d45db[0x0],_0x3d45db[0x1]===_0x0c41('0x6c')?![]:!![]);});}if(!_['isEmpty'](_0x340cc9)){_0x332537[_0x0c41('0x6d')](_0x2c8d9c);_0x30945f[_0x0c41('0x34')](_0x0c41('0x6e'),_0x340cc9);}BPromise[_0x0c41('0x6f')]()[_0x0c41('0x18')](function(){if(!_0x4401da)return;if(_0x1ea405['user'][_0x0c41('0x70')]!==_0x0c41('0x71'))return;if(!_[_0x0c41('0x72')](_0x4401da[_0x0c41('0x46')],[_0x0c41('0x37'),_0x0c41('0x4c')])){return _0x1ea405[_0x0c41('0x73')][_0x0c41('0x74')]({'attributes':['id'],'raw':!![]})[_0x0c41('0x18')](function(_0x17153c){if(_[_0x0c41('0x75')](_0x17153c)){_0x30945f[_0x0c41('0x34')]('c.ListId\x20IS\x20NULL');_0x332537[_0x0c41('0x34')]('c.ListId\x20IS\x20NULL');}else{_0x30945f[_0x0c41('0x34')](_0x0c41('0x56'),_['map'](_0x17153c,'id'));_0x332537[_0x0c41('0x34')]('c.ListId\x20IN\x20?',_[_0x0c41('0x49')](_0x17153c,'id'));}});}})[_0x0c41('0x18')](function(){if(_0x1ea405[_0x0c41('0x73')]['role']===_0x0c41('0x71')&&!_0x4401da&&!_0x1ea405[_0x0c41('0x2b')][_0x0c41('0x55')])return[];return db[_0x0c41('0x76')]['query'](_0x30945f[_0x0c41('0x77')](),_0x22e148);})[_0x0c41('0x18')](function(_0x1c9641){_0x1c128b['count']=_0x1c9641[_0x0c41('0x23')];if(_0x1c128b[_0x0c41('0x14')]===0x0)return[];return db[_0x0c41('0x76')][_0x0c41('0x2b')](_0x55a002[_0x0c41('0x77')](),_0x22e148)[_0x0c41('0x18')](function(_0x19e444){_0x32cf17=_[_0x0c41('0x78')](_0x19e444,'id');_0x22e148=_[_0x0c41('0x79')](_0x22e148,{'model':db[_0x0c41('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ea405[_0x0c41('0x2b')][_0x0c41('0x2f')]){_0x477c9f['attributes'][_0x0c41('0x4a')](function(_0x4559ee){_0x332537[_0x0c41('0x37')]('c.'+_0x4559ee);});}else{_0x332537[_0x0c41('0x37')]('c.id');_0x332537['field']('c.firstName');_0x332537['field']('c.lastName');_0x332537[_0x0c41('0x37')]('c.phone');_0x332537['field'](_0x0c41('0x7a'));_0x332537[_0x0c41('0x37')](_0x0c41('0x7b'));_0x332537[_0x0c41('0x37')]('c.email');_0x332537[_0x0c41('0x37')]('c.ListId');_0x332537['field'](_0x0c41('0x7c'));_0x332537[_0x0c41('0x37')]('c.deletedAt');_0x332537[_0x0c41('0x37')](_0x0c41('0x7d'));_0x332537[_0x0c41('0x37')](_0x0c41('0x7e'),'TagIds');}if(_0x477c9f[_0x0c41('0x15')])_0x332537[_0x0c41('0x15')](_0x477c9f[_0x0c41('0x15')]);if(_0x477c9f[_0x0c41('0x12')])_0x332537['offset'](_0x477c9f[_0x0c41('0x12')]);return db[_0x0c41('0x76')][_0x0c41('0x2b')](_0x332537[_0x0c41('0x77')](),_0x22e148);});})['then'](function(_0x79592f){_0x79592f[_0x0c41('0x4a')](function(_0x185872){if(_0x185872[_0x0c41('0x7f')]){_0x185872[_0x0c41('0x80')]=[];_0x185872['TagIds'][_0x0c41('0x5e')](',')[_0x0c41('0x4a')](function(_0x2e2602){_0x185872[_0x0c41('0x80')]['push'](_0x32cf17[_0x2e2602]);});}delete _0x185872[_0x0c41('0x7f')];});_0x1c128b[_0x0c41('0x81')]=_0x79592f;return _0x1c128b;})[_0x0c41('0x18')](respondWithFilteredResult(_0x10a6ce,_0x477c9f));})[_0x0c41('0x82')](handleError(_0x10a6ce,null));};exports[_0x0c41('0x19')]=function(_0xf76923,_0x19dd00){return db[_0x0c41('0x20')][_0x0c41('0x47')]({'where':{'id':_0xf76923[_0x0c41('0x83')]['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0x19dd00,null))['then'](removeEntity(_0x19dd00,null))[_0x0c41('0x82')](handleError(_0x19dd00,null));};exports[_0x0c41('0x21')]=function(_0x2ee2f6,_0x1fb693){return db[_0x0c41('0x20')][_0x0c41('0x21')]()[_0x0c41('0x18')](function(_0x41df41){delete _0x41df41[_0x0c41('0x84')];for(var _0x617ae4=0x0;_0x617ae40x0){return new Promise(function(_0x4efe2f,_0x33ade1){var _0x51ac63=[];for(var _0x4ebaff=0x0;_0x4ebaff<_0x987411[_0x0c41('0x23')];_0x4ebaff++){_0x51ac63['push'](insertAdditionalPhones(_0x987411[_0x4ebaff]['contact'],_0x987411[_0x4ebaff][_0x0c41('0xaa')]));}Promise[_0x0c41('0xb1')](_0x51ac63)['then'](function(){_0x4efe2f(0x1);});})[_0x0c41('0x18')](function(){return{'success':_0x3bbc5d,'failure':_0x25e300,'duplicates':_0x170007};});}else{return{'success':_0x3bbc5d,'failure':_0x25e300,'duplicates':_0x170007};}}})[_0x0c41('0x18')](respondWithResult(_0x3b14d1,0xc9))[_0x0c41('0x82')](handleError(_0x3b14d1,null));};exports[_0x0c41('0xb2')]=function(_0x4423c8,_0x4ba2e6){var _0x9076fd;return db[_0x0c41('0x20')][_0x0c41('0x21')]()[_0x0c41('0x18')](function(_0x5ca4d6){return db[_0x0c41('0x20')][_0x0c41('0x47')]({'where':{'id':_0x4423c8[_0x0c41('0x83')]['id']},'include':[{'model':db[_0x0c41('0xb3')],'as':_0x0c41('0x80'),'attributes':['id',_0x0c41('0x1d'),_0x0c41('0x38')],'required':_0x4423c8[_0x0c41('0x2b')][_0x0c41('0x59')]?!![]:![]},{'model':db[_0x0c41('0xb4')],'as':_0x0c41('0xb5'),'where':{'CmContactId':_0x4423c8['params']['id']},'required':![],'include':[{'model':db[_0x0c41('0xb6')],'as':_0x0c41('0xb7')}]}],'order':[db[_0x0c41('0x76')]['literal'](_0x0c41('0xb8'))],'attributes':_[_0x0c41('0x22')](_0x5ca4d6)});})[_0x0c41('0x18')](function(_0x23eac0){if(!_[_0x0c41('0x53')](_0x23eac0)){_0x9076fd=_0x23eac0[_0x0c41('0x8e')]({'plain':!![]});var _0x1bbed6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x23eac0&&_0x23eac0[_0x0c41('0x55')]){if(_0x23eac0['ListId']){_0x1bbed6[_0x0c41('0x34')]['$and']['push']({'ListId':{'$ne':_0x23eac0[_0x0c41('0x55')]}});}}return db[_0x0c41('0x86')]['findAll'](_0x1bbed6);}})[_0x0c41('0x18')](function(_0x12b3bb){if(!_[_0x0c41('0x53')](_0x12b3bb)){return _['omit'](_0x9076fd,_['map'](_0x12b3bb,function(_0xdf50cb){return util['format']('cf_%d',_0xdf50cb['id']);}));}})[_0x0c41('0x18')](handleEntityNotFound(_0x4ba2e6,null))['then'](respondWithResult(_0x4ba2e6,null))['catch'](handleError(_0x4ba2e6,null));};exports[_0x0c41('0x17')]=function(_0x4de791,_0x1f9486){var _0x411d4c;if(_0x4de791[_0x0c41('0x8c')]['id']){delete _0x4de791[_0x0c41('0x8c')]['id'];}if(!_['isNil'](_0x4de791['body'][_0x0c41('0xa7')])){var _0x34d074=_0x4de791[_0x0c41('0x8c')][_0x0c41('0xa7')];if(!_['isNil'](shared[_0x0c41('0xa8')][_0x34d074]))_0x4de791['body'][_0x0c41('0xa9')]=shared[_0x0c41('0xa8')][_0x34d074][_0x0c41('0xa9')];}return db['CmContact'][_0x0c41('0x47')]({'where':{'id':_0x4de791['params']['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0x1f9486,null))[_0x0c41('0x18')](saveUpdates(_0x4de791[_0x0c41('0x8c')],null))[_0x0c41('0x18')](function(_0x5141fb){_0x411d4c=_0x5141fb;var _0x548b59={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5141fb&&_0x5141fb['ListId']){if(_0x5141fb['ListId']){_0x548b59[_0x0c41('0x34')][_0x0c41('0xb9')]['push']({'ListId':{'$ne':_0x5141fb[_0x0c41('0x55')]}});}}return db[_0x0c41('0x86')][_0x0c41('0x87')](_0x548b59);})[_0x0c41('0x18')](function(_0x3bfda3){if(_0x3bfda3){return _[_0x0c41('0xba')](_[_0x0c41('0xbb')](_0x4de791[_0x0c41('0x8c')],function(_0x91dd0,_0x4e411f){return _[_0x0c41('0x24')](_0x4e411f,_0x0c41('0x25'));}),_['map'](_0x3bfda3,function(_0x3e0822){return util[_0x0c41('0xbc')]('cf_%d',_0x3e0822['id']);}));}})[_0x0c41('0x18')](function(_0x46d3ef){if(_0x46d3ef&&!_[_0x0c41('0x75')](_0x46d3ef)){var _0x339ef5=squel[_0x0c41('0x17')]()['table']('cm_contacts')[_0x0c41('0xbd')](_0x46d3ef)[_0x0c41('0x34')](_0x0c41('0xbe'),_0x4de791[_0x0c41('0x83')]['id'])[_0x0c41('0xbf')]();return db[_0x0c41('0x76')][_0x0c41('0x2b')](_0x339ef5['text'],{'replacements':_0x339ef5['values']});}})[_0x0c41('0x18')](function(){if(_0x4de791[_0x0c41('0x8c')][_0x0c41('0xc0')]&&_0x411d4c){return db[_0x0c41('0x91')]['update']({'phone':_0x4de791[_0x0c41('0x8c')][_0x0c41('0xc0')],'OrderBy':0x0},{'where':{'ContactId':_0x411d4c['id']}});}})[_0x0c41('0x18')](function(){return _0x411d4c;})['then'](respondWithResult(_0x1f9486,null))[_0x0c41('0x82')](handleError(_0x1f9486,null));};exports['getTags']=function(_0x5f4818,_0xfd58b2){var _0x87c740={};var _0xbd86e6={};var _0x40a051;var _0x294c39;return db[_0x0c41('0x20')]['findOne']({'where':{'id':_0x5f4818[_0x0c41('0x83')]['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0xfd58b2,null))['then'](function(_0x18d27d){if(_0x18d27d){_0x40a051=_0x18d27d;_0xbd86e6[_0x0c41('0x2a')]=_[_0x0c41('0x22')](db['Tag']['rawAttributes']);_0xbd86e6['query']=_[_0x0c41('0x22')](_0x5f4818['query']);_0xbd86e6[_0x0c41('0x2c')]=_[_0x0c41('0x2d')](_0xbd86e6['model'],_0xbd86e6[_0x0c41('0x2b')]);_0x87c740[_0x0c41('0x2e')]=_[_0x0c41('0x2d')](_0xbd86e6[_0x0c41('0x2a')],qs[_0x0c41('0x2f')](_0x5f4818['query'][_0x0c41('0x2f')]));_0x87c740[_0x0c41('0x2e')]=_0x87c740[_0x0c41('0x2e')][_0x0c41('0x23')]?_0x87c740[_0x0c41('0x2e')]:_0xbd86e6[_0x0c41('0x2a')];_0x87c740[_0x0c41('0x32')]=qs[_0x0c41('0x33')](_0x5f4818[_0x0c41('0x2b')][_0x0c41('0x33')]);_0x87c740[_0x0c41('0x34')]=qs[_0x0c41('0x2c')](_[_0x0c41('0x35')](_0x5f4818[_0x0c41('0x2b')],_0xbd86e6['filters']));if(_0x5f4818[_0x0c41('0x2b')][_0x0c41('0x5c')]){_0x87c740[_0x0c41('0x34')]=_[_0x0c41('0x79')](_0x87c740[_0x0c41('0x34')],{'$or':_[_0x0c41('0x49')](_0x87c740['attributes'],function(_0x160fed){var _0x348cf2={};_0x348cf2[_0x160fed]={'$like':'%'+_0x5f4818['query'][_0x0c41('0x5c')]+'%'};return _0x348cf2;})});}_0x87c740=_[_0x0c41('0x79')]({},_0x87c740,_0x5f4818[_0x0c41('0xc1')]);return _0x40a051[_0x0c41('0xc2')](_0x87c740);}})['then'](function(_0x37c1f3){if(_0x37c1f3){_0x294c39=_0x37c1f3[_0x0c41('0x23')];if(!_0x5f4818[_0x0c41('0x2b')]['hasOwnProperty'](_0x0c41('0x31'))){_0x87c740[_0x0c41('0x15')]=qs[_0x0c41('0x15')](_0x5f4818['query'][_0x0c41('0x15')]);_0x87c740['offset']=qs[_0x0c41('0x12')](_0x5f4818[_0x0c41('0x2b')][_0x0c41('0x12')]);}return _0x40a051['getTags'](_0x87c740);}})[_0x0c41('0x18')](function(_0x1c7a71){if(_0x1c7a71){return _0x1c7a71?{'count':_0x294c39,'rows':_0x1c7a71}:null;}})[_0x0c41('0x18')](respondWithResult(_0xfd58b2,null))[_0x0c41('0x82')](handleError(_0xfd58b2,null));};exports[_0x0c41('0xc3')]=function(_0x1a2b40,_0x248d1f){if(_0x1a2b40['body']['id']){delete _0x1a2b40['body']['id'];}return db[_0x0c41('0x20')][_0x0c41('0x27')]({'where':{'id':_0x1a2b40[_0x0c41('0x83')]['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0x248d1f,null))[_0x0c41('0x18')](function(_0x162915){if(_0x162915){return _0x162915['setTags'](_0x1a2b40[_0x0c41('0x8c')][_0x0c41('0xc4')]||[]);}return null;})[_0x0c41('0x18')](respondWithResult(_0x248d1f,null))[_0x0c41('0x82')](handleError(_0x248d1f,null));};exports['setAdditionalPhones']=function(_0x5a6fc9,_0xf9333b){var _0x3f5351=[];_0x3f5351[_0x0c41('0x26')](addAdditionalPhones(_0x5a6fc9[_0x0c41('0x8c')]));Promise[_0x0c41('0xb1')](_0x3f5351)['then'](function(){_0x3f5351=[];_0x3f5351[_0x0c41('0x26')](deleteCmHopperPhones(_0x5a6fc9[_0x0c41('0x8c')]['id']));_0x3f5351['push'](addCmHopperPhones(_0x5a6fc9['body']['id']));Promise[_0x0c41('0xb1')](_0x3f5351)[_0x0c41('0x18')](function(){return[0x1];})[_0x0c41('0x18')](respondWithResult(_0xf9333b,null));});};function addAdditionalPhones(_0x1efaf7){var _0x142a30;return new Promise(function(_0x9ac740,_0x35c10b){return db[_0x0c41('0xb4')][_0x0c41('0x19')]({'where':{'CmContactId':_0x1efaf7['id']}})[_0x0c41('0x18')](function(){db[_0x0c41('0xb6')][_0x0c41('0x87')]({'raw':!![],'attributes':['id',_0x0c41('0xc5')]})['then'](function(_0x26d776){var _0x4a14ce=[];for(var _0x14b16d=0x0;_0x14b16d<_0x1efaf7[_0x0c41('0xc6')][_0x0c41('0x23')];_0x14b16d++){var _0x2b3517=_0x1efaf7[_0x0c41('0xc7')]?_[_0x0c41('0x53')](_0x1efaf7[_0x0c41('0xc7')][_0x14b16d])?'':_0x1efaf7[_0x0c41('0xc7')][_0x14b16d]:_0x1efaf7[_0x0c41('0xc6')][_0x14b16d][_0x0c41('0xc8')]?_0x1efaf7[_0x0c41('0xc6')][_0x14b16d][_0x0c41('0xc8')]:'';var _0x414737=_['isNil'](_0x1efaf7[_0x0c41('0xc6')][_0x14b16d]['description'])?'':_0x1efaf7[_0x0c41('0xc6')][_0x14b16d][_0x0c41('0xc9')];var _0x56f56b=_0x2b3517+':'+_0x1efaf7[_0x0c41('0xc6')][_0x14b16d][_0x0c41('0xc0')]+'§'+_0x414737;if(_[_0x0c41('0x53')](_0x142a30))_0x142a30=_0x56f56b;else _0x142a30+=';'+_0x56f56b;var _0x8d6bba=null;if(_0x1efaf7[_0x0c41('0xc7')]){if(!_[_0x0c41('0x53')](_0x1efaf7['item_types'][_0x14b16d])){var _0x5895e9=_[_0x0c41('0x47')](_0x26d776,function(_0x366d38){return _0x366d38['id']===_0x1efaf7['item_types'][_0x14b16d];});if(!_['isNil'](_0x5895e9)){_0x8d6bba=_0x5895e9[_0x0c41('0xc5')];}}}else{if(!_[_0x0c41('0x53')](_0x1efaf7[_0x0c41('0xc6')][_0x14b16d])){var _0x5895e9=_[_0x0c41('0x47')](_0x26d776,function(_0x38214b){return _0x38214b['id']===_0x1efaf7[_0x0c41('0xc6')][_0x14b16d][_0x0c41('0xc8')];});if(!_[_0x0c41('0x53')](_0x5895e9)){_0x8d6bba=_0x14b16d;}}}if(_[_0x0c41('0x53')](_0x8d6bba)){_0x8d6bba=0x64;}_0x4a14ce[_0x0c41('0x26')](addAdditionalPhone(_0x1efaf7['id'],_0x1efaf7['items'][_0x14b16d]['phone'],_0x1efaf7[_0x0c41('0xc7')]?_[_0x0c41('0x53')](_0x1efaf7[_0x0c41('0xc7')][_0x14b16d])?null:_0x1efaf7[_0x0c41('0xc7')][_0x14b16d]:_0x1efaf7[_0x0c41('0xc6')][_0x14b16d][_0x0c41('0xc8')]?_0x1efaf7[_0x0c41('0xc6')][_0x14b16d][_0x0c41('0xc8')]:null,_0x8d6bba,_0x414737));}Promise[_0x0c41('0xb1')](_0x4a14ce)['then'](function(){db[_0x0c41('0x20')][_0x0c41('0x17')]({'AdditionalPhones':_0x142a30},{'where':{'id':_0x1efaf7['id']}})[_0x0c41('0x18')](function(){_0x9ac740(0x1);});});});});});}function addAdditionalPhone(_0x704188,_0x995af4,_0x5dd88a,_0x4dce45,_0x2ef1ad){return db[_0x0c41('0xb4')][_0x0c41('0x47')]({'where':{'CmContactId':_0x704188,'item':_0x995af4}})[_0x0c41('0x18')](function(_0x147870){if(_0x147870)logger[_0x0c41('0x90')](_0x0c41('0xca'),_0x147870);else{db[_0x0c41('0xb4')][_0x0c41('0x94')]({'CmContactId':_0x704188,'item':_0x995af4,'ItemTypeId':_0x5dd88a,'OrderBy':_0x4dce45,'ItemClass':_0x0c41('0xcb'),'description':_0x2ef1ad});}});}function deletePhones(_0x3527a8){return db['CmContactHasItem'][_0x0c41('0x19')]({'where':{'CmContactId':_0x3527a8}});}function deleteCmHopperPhones(_0x45da37){return new Promise(function(_0x57a3a,_0x279f17){return db[_0x0c41('0x91')][_0x0c41('0x87')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x45da37}})[_0x0c41('0x18')](function(_0x58f8ca){db[_0x0c41('0xcc')][_0x0c41('0x19')]({'where':{'CmHopperId':{'$in':_[_0x0c41('0x49')](_0x58f8ca,'id')}}});})['then'](function(){_0x57a3a(0x1);});});}function addCmHopperPhones(_0x4400b6){return new Promise(function(_0x3a460f,_0x13a91d){return db[_0x0c41('0x91')][_0x0c41('0x87')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4400b6}})[_0x0c41('0x18')](function(_0x5aeec1){var _0x205e80=[];_[_0x0c41('0x49')](_0x5aeec1,function(_0x3978c8){_0x205e80[_0x0c41('0x26')](createCmHopperPhone(_0x4400b6,_0x3978c8['id']));});Promise['all'](_0x205e80)[_0x0c41('0x18')](function(){_0x3a460f(0x1);});});});}function createCmHopperPhone(_0x3a7f14,_0x39800a){return new Promise(function(_0x5114de,_0x49162b){db['CmContactHasItem'][_0x0c41('0x87')]({'raw':!![],'attributes':[_0x0c41('0xcd'),'OrderBy'],'where':{'CmContactId':_0x3a7f14,'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'attributes':[_0x0c41('0xc5')],'as':_0x0c41('0xb7')}],'order':['OrderBy',db[_0x0c41('0x76')][_0x0c41('0xce')]('`ItemType`.OrderBy')]})['then'](function(_0x1a08c3){var _0x89e9f6=0x1;var _0x37f507=_[_0x0c41('0x49')](_0x1a08c3,function(_0x4ec33b){_0x4ec33b['CmHopperId']=_0x39800a;_0x4ec33b[_0x0c41('0xc0')]=_0x4ec33b[_0x0c41('0xcd')];_0x4ec33b[_0x0c41('0xc5')]=_0x89e9f6;delete _0x4ec33b[_0x0c41('0xcf')];_0x89e9f6=_0x89e9f6+0x1;return _0x4ec33b;});return db['CmHopperAdditionalPhone'][_0x0c41('0xab')](_0x37f507,{});})[_0x0c41('0x18')](function(){_0x5114de(0x1);});});}function insertAdditionalPhones(_0x3eadb3,_0x4df93f){return new Promise(function(_0x56e232,_0x3722e9){var _0x359e73=[];for(var _0xbdc6bb=0x0;_0xbdc6bb<_0x4df93f[_0x0c41('0x23')];_0xbdc6bb++){var _0xf7fea8=_0x4df93f[_0xbdc6bb];_0x359e73[_0x0c41('0x26')](parseContactItemType(_0xf7fea8));}Promise[_0x0c41('0xb1')](_0x359e73)[_0x0c41('0x18')](function(){var _0x3b2872={'id':_0x3eadb3['id'],'items':_0x4df93f};return addAdditionalPhones(_0x3b2872)[_0x0c41('0x18')](function(_0x2eb12d){return addCmHopperPhones(_0x3eadb3['id']);});})[_0x0c41('0x18')](function(){_0x56e232(_0x3eadb3);});});}function parseContactItemType(_0x56efd5){return new Promise(function(_0x48d4c8,_0x486bd7){if(_0x56efd5[_0x0c41('0x30')](_0x0c41('0xc8'))){_0x48d4c8(_0x56efd5);}else{return db[_0x0c41('0xb6')][_0x0c41('0x47')]({'where':{'name':_0x56efd5['ItemType']}})[_0x0c41('0x18')](function(_0x22dc68){if(_['isNil'](_0x22dc68))_0x56efd5[_0x0c41('0xc8')]=null;else _0x56efd5['ItemTypeId']=_0x22dc68['id'];_0x48d4c8(_0x56efd5);});}});}exports['getAdditionalPhones']=function(_0x2a1fcc,_0x120c54){return db[_0x0c41('0xb4')]['findAll']({'raw':!![],'where':{'CmContactId':_0x2a1fcc[_0x0c41('0x83')]['id'],'ItemClass':_0x0c41('0xcb')},'include':[{'model':db[_0x0c41('0xb6')],'as':_0x0c41('0xb7')}],'order':[[_0x0c41('0xc5')],[db[_0x0c41('0x76')][_0x0c41('0xce')](_0x0c41('0xd0'))]]})[_0x0c41('0x18')](function(_0x1ecb37){return _0x1ecb37;})['then'](respondWithResult(_0x120c54,null))[_0x0c41('0x82')](handleError(_0x120c54,null));};exports['duplicateAdditionalPhones']=function(_0x24d17e,_0x49668d){return db[_0x0c41('0xb4')][_0x0c41('0x87')]({'raw':!![],'where':{'CmContactId':_0x24d17e[_0x0c41('0x8c')][_0x0c41('0xd1')]}})[_0x0c41('0x18')](function(_0x433e21){var _0x346f5b=_['map'](_0x433e21,function(_0x10cb05){_0x10cb05[_0x0c41('0xd2')]=_0x24d17e[_0x0c41('0x8c')][_0x0c41('0xd3')];return _0x10cb05;});return db[_0x0c41('0xb4')]['bulkCreate'](_0x346f5b,{});})[_0x0c41('0x18')](function(_0x433ec5){return addCmHopperPhones(_0x24d17e['body'][_0x0c41('0xd3')]);})[_0x0c41('0x18')](function(_0x414df2){return['ok'];})[_0x0c41('0x18')](respondWithResult(_0x49668d,null))[_0x0c41('0x82')](handleError(_0x49668d,null));};exports[_0x0c41('0xd4')]=function(_0x902ff7,_0x42caa3){var _0x5a900a=[];_0x5a900a['push'](createCmHopperPhone(_0x902ff7[_0x0c41('0x8c')]['id'],_0x902ff7['body'][_0x0c41('0xd5')]));Promise[_0x0c41('0xb1')](_0x5a900a)['then'](function(){return[0x1];})[_0x0c41('0x18')](respondWithResult(_0x42caa3,null));};exports[_0x0c41('0xd6')]=function(_0x329037,_0x5c86c5){var _0x409bdc={'raw':![],'where':{}};var _0x456544={};var _0x46af5a={'count':0x0,'rows':[]};return db[_0x0c41('0x20')][_0x0c41('0x27')]({'where':{'id':_0x329037[_0x0c41('0x83')]['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0x5c86c5,null))[_0x0c41('0x18')](function(_0x1adf46){if(_0x1adf46){_0x456544[_0x0c41('0x2a')]=_[_0x0c41('0x22')](db['CmHopper'][_0x0c41('0xd7')]);_0x456544[_0x0c41('0x2b')]=_[_0x0c41('0x22')](_0x329037[_0x0c41('0x2b')]);_0x456544[_0x0c41('0x2c')]=_[_0x0c41('0x2d')](_0x456544[_0x0c41('0x2a')],_0x456544['query']);_0x409bdc[_0x0c41('0x2e')]=_[_0x0c41('0x2d')](_0x456544[_0x0c41('0x2a')],qs['fields'](_0x329037['query']['fields']));_0x409bdc[_0x0c41('0x2e')]=_0x409bdc[_0x0c41('0x2e')][_0x0c41('0x23')]?_0x409bdc[_0x0c41('0x2e')]:_0x456544[_0x0c41('0x2a')];if(!_0x329037[_0x0c41('0x2b')]['hasOwnProperty'](_0x0c41('0x31'))){_0x409bdc['limit']=qs[_0x0c41('0x15')](_0x329037['query']['limit']);_0x409bdc[_0x0c41('0x12')]=qs[_0x0c41('0x12')](_0x329037[_0x0c41('0x2b')]['offset']);}_0x409bdc[_0x0c41('0x32')]=qs[_0x0c41('0x33')](_0x329037['query'][_0x0c41('0x33')]);_0x409bdc[_0x0c41('0x34')]=qs[_0x0c41('0x2c')](_[_0x0c41('0x35')](_0x329037[_0x0c41('0x2b')],_0x456544['filters']));_0x409bdc[_0x0c41('0x34')][_0x0c41('0xd8')]=_0x1adf46['id'];if(_0x329037[_0x0c41('0x2b')][_0x0c41('0x5c')]){_0x409bdc[_0x0c41('0x34')]=_['merge'](_0x409bdc[_0x0c41('0x34')],{'$or':_[_0x0c41('0x49')](_0x409bdc['attributes'],function(_0x5c72e0){var _0x5bbd2f={};_0x5bbd2f[_0x5c72e0]={'$like':'%'+_0x329037[_0x0c41('0x2b')][_0x0c41('0x5c')]+'%'};return _0x5bbd2f;})});}_0x409bdc=_[_0x0c41('0x79')]({},_0x409bdc,_0x329037['options']);return db['CmHopper'][_0x0c41('0x14')]({'where':_0x409bdc[_0x0c41('0x34')]})[_0x0c41('0x18')](function(_0xb15426){_0x46af5a[_0x0c41('0x14')]=_0xb15426;if(_0x329037[_0x0c41('0x2b')]['includeAll']){_0x409bdc[_0x0c41('0xd9')]=[{'all':!![]}];}return db[_0x0c41('0x91')][_0x0c41('0x87')](_0x409bdc);})[_0x0c41('0x18')](function(_0x55622f){_0x46af5a['rows']=_0x55622f;return _0x46af5a;});}})[_0x0c41('0x18')](respondWithFilteredResult(_0x5c86c5,_0x409bdc))['catch'](handleError(_0x5c86c5,null));};exports[_0x0c41('0xda')]=function(_0x2af4fe,_0x2f6639){var _0x2d19e7={'raw':!![],'where':{}};var _0x2848df={};var _0x282106={'count':0x0,'rows':[]};return db['CmContact'][_0x0c41('0x27')]({'where':{'id':_0x2af4fe[_0x0c41('0x83')]['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0x2f6639,null))['then'](function(_0x5de416){if(_0x5de416){_0x2848df[_0x0c41('0x2a')]=_['keys'](db['CmHopperHistory'][_0x0c41('0xd7')]);_0x2848df[_0x0c41('0x2b')]=_[_0x0c41('0x22')](_0x2af4fe['query']);_0x2848df[_0x0c41('0x2c')]=_[_0x0c41('0x2d')](_0x2848df['model'],_0x2848df[_0x0c41('0x2b')]);_0x2d19e7[_0x0c41('0x2e')]=_[_0x0c41('0x2d')](_0x2848df[_0x0c41('0x2a')],qs['fields'](_0x2af4fe[_0x0c41('0x2b')]['fields']));_0x2d19e7['attributes']=_0x2d19e7['attributes'][_0x0c41('0x23')]?_0x2d19e7[_0x0c41('0x2e')]:_0x2848df[_0x0c41('0x2a')];if(!_0x2af4fe[_0x0c41('0x2b')][_0x0c41('0x30')](_0x0c41('0x31'))){_0x2d19e7['limit']=qs[_0x0c41('0x15')](_0x2af4fe[_0x0c41('0x2b')][_0x0c41('0x15')]);_0x2d19e7['offset']=qs[_0x0c41('0x12')](_0x2af4fe[_0x0c41('0x2b')][_0x0c41('0x12')]);}_0x2d19e7[_0x0c41('0x32')]=qs[_0x0c41('0x33')](_0x2af4fe['query'][_0x0c41('0x33')]);_0x2d19e7[_0x0c41('0x34')]=qs[_0x0c41('0x2c')](_[_0x0c41('0x35')](_0x2af4fe[_0x0c41('0x2b')],_0x2848df[_0x0c41('0x2c')]));_0x2d19e7[_0x0c41('0x34')][_0x0c41('0xd8')]=_0x5de416['id'];if(_0x2af4fe[_0x0c41('0x2b')][_0x0c41('0x5c')]){_0x2d19e7[_0x0c41('0x34')]=_['merge'](_0x2d19e7[_0x0c41('0x34')],{'$or':_[_0x0c41('0x49')](_0x2d19e7['attributes'],function(_0x639e45){var _0x4c078c={};_0x4c078c[_0x639e45]={'$like':'%'+_0x2af4fe[_0x0c41('0x2b')][_0x0c41('0x5c')]+'%'};return _0x4c078c;})});}_0x2d19e7=_['merge']({},_0x2d19e7,_0x2af4fe['options']);return db[_0x0c41('0xdb')]['count']({'where':_0x2d19e7[_0x0c41('0x34')]})[_0x0c41('0x18')](function(_0x467c0d){_0x282106['count']=_0x467c0d;if(_0x2af4fe[_0x0c41('0x2b')][_0x0c41('0xdc')]){_0x2d19e7[_0x0c41('0xd9')]=[{'all':!![]}];}return db[_0x0c41('0xdb')][_0x0c41('0x87')](_0x2d19e7);})[_0x0c41('0x18')](function(_0x32cde2){_0x282106[_0x0c41('0x81')]=_0x32cde2;return _0x282106;});}})[_0x0c41('0x18')](respondWithFilteredResult(_0x2f6639,_0x2d19e7))['catch'](handleError(_0x2f6639,null));};exports['getHopperFinals']=function(_0x116c71,_0x16aebb){var _0x337f2e={'raw':!![],'where':{}};var _0x1f3730={};var _0x2d1614={'count':0x0,'rows':[]};return db[_0x0c41('0x20')][_0x0c41('0x27')]({'where':{'id':_0x116c71[_0x0c41('0x83')]['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0x16aebb,null))['then'](function(_0x15452c){if(_0x15452c){_0x1f3730[_0x0c41('0x2a')]=_['keys'](db[_0x0c41('0x9d')][_0x0c41('0xd7')]);_0x1f3730['query']=_['keys'](_0x116c71['query']);_0x1f3730['filters']=_[_0x0c41('0x2d')](_0x1f3730['model'],_0x1f3730[_0x0c41('0x2b')]);_0x337f2e[_0x0c41('0x2e')]=_[_0x0c41('0x2d')](_0x1f3730[_0x0c41('0x2a')],qs[_0x0c41('0x2f')](_0x116c71['query'][_0x0c41('0x2f')]));_0x337f2e['attributes']=_0x337f2e['attributes'][_0x0c41('0x23')]?_0x337f2e[_0x0c41('0x2e')]:_0x1f3730[_0x0c41('0x2a')];if(!_0x116c71[_0x0c41('0x2b')][_0x0c41('0x30')](_0x0c41('0x31'))){_0x337f2e[_0x0c41('0x15')]=qs[_0x0c41('0x15')](_0x116c71[_0x0c41('0x2b')][_0x0c41('0x15')]);_0x337f2e[_0x0c41('0x12')]=qs[_0x0c41('0x12')](_0x116c71[_0x0c41('0x2b')]['offset']);}_0x337f2e['order']=qs[_0x0c41('0x33')](_0x116c71[_0x0c41('0x2b')]['sort']);_0x337f2e[_0x0c41('0x34')]=qs[_0x0c41('0x2c')](_[_0x0c41('0x35')](_0x116c71[_0x0c41('0x2b')],_0x1f3730['filters']));_0x337f2e[_0x0c41('0x34')][_0x0c41('0xd8')]=_0x15452c['id'];if(_0x116c71['query'][_0x0c41('0x5c')]){_0x337f2e['where']=_[_0x0c41('0x79')](_0x337f2e[_0x0c41('0x34')],{'$or':_[_0x0c41('0x49')](_0x337f2e['attributes'],function(_0x10c6ce){var _0x4424c3={};_0x4424c3[_0x10c6ce]={'$like':'%'+_0x116c71['query'][_0x0c41('0x5c')]+'%'};return _0x4424c3;})});}_0x337f2e=_[_0x0c41('0x79')]({},_0x337f2e,_0x116c71[_0x0c41('0xc1')]);return db[_0x0c41('0x9d')][_0x0c41('0x14')]({'where':_0x337f2e['where']})['then'](function(_0x21199c){_0x2d1614[_0x0c41('0x14')]=_0x21199c;if(_0x116c71[_0x0c41('0x2b')][_0x0c41('0xdc')]){_0x337f2e['include']=[{'all':!![]}];}return db[_0x0c41('0x9d')][_0x0c41('0x87')](_0x337f2e);})[_0x0c41('0x18')](function(_0x2829f6){_0x2d1614[_0x0c41('0x81')]=_0x2829f6;return _0x2d1614;});}})[_0x0c41('0x18')](respondWithFilteredResult(_0x16aebb,_0x337f2e))[_0x0c41('0x82')](handleError(_0x16aebb,null));};exports[_0x0c41('0xdd')]=function(_0x4f3f76,_0x27ef1e){var _0x5cb3bc={'raw':!![],'where':{}};var _0x2a0fb4={};var _0x4c7f21={'count':0x0,'rows':[]};return db[_0x0c41('0x20')][_0x0c41('0x27')]({'where':{'id':_0x4f3f76[_0x0c41('0x83')]['id']}})[_0x0c41('0x18')](handleEntityNotFound(_0x27ef1e,null))[_0x0c41('0x18')](function(_0x2356ff){if(_0x2356ff){_0x2a0fb4[_0x0c41('0x2a')]=_[_0x0c41('0x22')](db[_0x0c41('0xa5')][_0x0c41('0xd7')]);_0x2a0fb4[_0x0c41('0x2b')]=_['keys'](_0x4f3f76['query']);_0x2a0fb4['filters']=_[_0x0c41('0x2d')](_0x2a0fb4[_0x0c41('0x2a')],_0x2a0fb4['query']);_0x5cb3bc[_0x0c41('0x2e')]=_[_0x0c41('0x2d')](_0x2a0fb4['model'],qs[_0x0c41('0x2f')](_0x4f3f76[_0x0c41('0x2b')][_0x0c41('0x2f')]));_0x5cb3bc[_0x0c41('0x2e')]=_0x5cb3bc[_0x0c41('0x2e')][_0x0c41('0x23')]?_0x5cb3bc[_0x0c41('0x2e')]:_0x2a0fb4[_0x0c41('0x2a')];if(!_0x4f3f76[_0x0c41('0x2b')]['hasOwnProperty'](_0x0c41('0x31'))){_0x5cb3bc[_0x0c41('0x15')]=qs['limit'](_0x4f3f76[_0x0c41('0x2b')][_0x0c41('0x15')]);_0x5cb3bc[_0x0c41('0x12')]=qs['offset'](_0x4f3f76[_0x0c41('0x2b')][_0x0c41('0x12')]);}_0x5cb3bc[_0x0c41('0x32')]=qs[_0x0c41('0x33')](_0x4f3f76[_0x0c41('0x2b')][_0x0c41('0x33')]);_0x5cb3bc['where']=qs[_0x0c41('0x2c')](_[_0x0c41('0x35')](_0x4f3f76['query'],_0x2a0fb4[_0x0c41('0x2c')]));_0x5cb3bc[_0x0c41('0x34')][_0x0c41('0xd8')]=_0x2356ff['id'];if(_0x4f3f76['query'][_0x0c41('0x5c')]){_0x5cb3bc['where']=_[_0x0c41('0x79')](_0x5cb3bc['where'],{'$or':_['map'](_0x5cb3bc[_0x0c41('0x2e')],function(_0x3cf092){var _0x2cbde9={};_0x2cbde9[_0x3cf092]={'$like':'%'+_0x4f3f76[_0x0c41('0x2b')]['filter']+'%'};return _0x2cbde9;})});}_0x5cb3bc=_['merge']({},_0x5cb3bc,_0x4f3f76[_0x0c41('0xc1')]);return db['JscriptySessionReport'][_0x0c41('0x14')]({'where':_0x5cb3bc[_0x0c41('0x34')]})[_0x0c41('0x18')](function(_0x350ecc){_0x4c7f21[_0x0c41('0x14')]=_0x350ecc;if(_0x4f3f76[_0x0c41('0x2b')][_0x0c41('0xdc')]){_0x5cb3bc[_0x0c41('0xd9')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0c41('0x87')](_0x5cb3bc);})[_0x0c41('0x18')](function(_0x52d122){_0x4c7f21[_0x0c41('0x81')]=_0x52d122;return _0x4c7f21;});}})[_0x0c41('0x18')](respondWithFilteredResult(_0x27ef1e,_0x5cb3bc))[_0x0c41('0x82')](handleError(_0x27ef1e,null));};exports[_0x0c41('0xde')]=function(_0x528482,_0x7f27f){try{if(!_0x528482[_0x0c41('0x8c')][_0x0c41('0x55')]){throw new Error('No\x20ListId\x20specified');}if(!_0x528482['body'][_0x0c41('0xdf')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x528482[_0x0c41('0x8c')][_0x0c41('0xe0')]){throw new Error(_0x0c41('0xe1'));}if(!_0x528482['body'][_0x0c41('0xe2')]){throw new Error(_0x0c41('0xe3'));}var _0x37413e=_0x528482[_0x0c41('0x8c')][_0x0c41('0xdf')][_0x0c41('0x5e')](',');var _0x543529=_0x528482['body'][_0x0c41('0xe0')][_0x0c41('0x5e')](',');if(!_0x37413e['length']||!_0x543529[_0x0c41('0x23')]||_0x37413e[_0x0c41('0x23')]!==_0x543529['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x528482[_0x0c41('0x8c')][_0x0c41('0x2f')]=_['zipObject'](_0x37413e,_0x543529);if(!_0x528482[_0x0c41('0x8c')][_0x0c41('0x2f')][_0x0c41('0xc0')]){throw new Error(_0x0c41('0xe4'));}if(!_0x528482[_0x0c41('0x8c')][_0x0c41('0x2f')][_0x0c41('0xe5')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x2ba4c5=path['join'](config[_0x0c41('0xe6')],'server/files/tmp',_0x528482['file']['filename']);fs['chmodSync'](_0x2ba4c5,parseInt(_0x0c41('0xe7'),0x8));var _0x414dea=require('child_process')[_0x0c41('0xe8')](path[_0x0c41('0x8f')](__dirname,_0x0c41('0xe9')),[_0x2ba4c5,_0x528482[_0x0c41('0x8c')][_0x0c41('0xdf')],_0x528482[_0x0c41('0x8c')][_0x0c41('0xe0')],_0x528482[_0x0c41('0x8c')][_0x0c41('0x55')],_0x528482['body'][_0x0c41('0xea')],_0x528482['body'][_0x0c41('0xad')],_0x528482[_0x0c41('0x8c')][_0x0c41('0xe2')]]);return _0x7f27f['status'](0xc8)['json']({'message':_0x0c41('0xeb'),'pid':_0x414dea[_0x0c41('0xec')]});}catch(_0x520d86){return _0x7f27f['status'](0x1f4)[_0x0c41('0x1e')](_0x520d86);}};exports[_0x0c41('0xed')]=function(_0x321079,_0x5f831a){var _0x780987=fs['createReadStream'](_0x321079['file'][_0x0c41('0x0')]);Papa[_0x0c41('0xee')](_0x780987,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0xf98b1b){return _0x5f831a[_0x0c41('0x10')](0xc8)[_0x0c41('0x11')]({'file':_0x321079[_0x0c41('0xef')],'fields':_0xf98b1b['meta'][_0x0c41('0x2f')]});}});};exports[_0x0c41('0xf0')]=function(_0x3b9f4d,_0x580ee0){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0c41('0x71')}})[_0x0c41('0x18')](function(_0xa1a1ca){var _0x41f987=![];if(!_0x3b9f4d[_0x0c41('0x8c')][_0x0c41('0x55')]){throw new Error('No\x20ListId\x20specified');}if(!_0x3b9f4d[_0x0c41('0x8c')][_0x0c41('0xf1')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3b9f4d[_0x0c41('0x8c')][_0x0c41('0xf1')][_0x0c41('0xe5')]){throw new Error(_0x0c41('0xf2'));}if(!_0x3b9f4d[_0x0c41('0x8c')][_0x0c41('0xe2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5b7721=require(_0x0c41('0xf3'))[_0x0c41('0xe8')](path['join'](__dirname,_0x0c41('0xf4')),[_0x3b9f4d['params']['id'],JSON[_0x0c41('0xf5')](_0x3b9f4d[_0x0c41('0x8c')]),JSON['stringify'](_0xa1a1ca)]);_0x5b7721['on'](_0x0c41('0xf6'),function(){_0x41f987=!![];return _0x580ee0[_0x0c41('0x10')](0xc8)['json']({'message':_0x0c41('0xf7'),'pid':_0x5b7721[_0x0c41('0xec')]});});_0x5b7721['on'](_0x0c41('0xf8'),function(_0x463990){if(_0x463990&&!_0x41f987){return _0x580ee0['status'](0x1f4)[_0x0c41('0x11')]({'message':_0x0c41('0xf9'),'pid':_0x5b7721[_0x0c41('0xec')]});}});})[_0x0c41('0x82')](handleError(_0x580ee0,null));};exports[_0x0c41('0xfa')]=function(_0x22f63d,_0x3e621a,_0x1f9d1b){return db['User'][_0x0c41('0x87')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0c41('0x71')}})['then'](function(_0x2ba998){var _0x472e73=![];if(!_0x22f63d['body'][_0x0c41('0x55')]){throw new Error(_0x0c41('0xfb'));}if(!_0x22f63d[_0x0c41('0x8c')][_0x0c41('0xf1')][_0x0c41('0xc0')]){throw new Error(_0x0c41('0xe4'));}if(!_0x22f63d[_0x0c41('0x8c')][_0x0c41('0xf1')][_0x0c41('0xe5')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x22f63d[_0x0c41('0x8c')][_0x0c41('0xe2')]){throw new Error(_0x0c41('0xe3'));}var _0xd0e91e=require(_0x0c41('0xf3'))[_0x0c41('0xe8')](path[_0x0c41('0x8f')](__dirname,'../../components/import/cm/csvUpdates'),[_0x22f63d[_0x0c41('0x83')]['id'],JSON['stringify'](_0x22f63d[_0x0c41('0x8c')]),JSON['stringify'](_0x2ba998)]);_0xd0e91e['on'](_0x0c41('0xf6'),function(_0x291f4f){_0x472e73=!![];return _0x3e621a['status'](0xc8)['json']({'message':_0x0c41('0xf7'),'pid':_0xd0e91e[_0x0c41('0xec')]});});_0xd0e91e['on'](_0x0c41('0xf8'),function(_0x5aa835){if(_0x5aa835&&!_0x472e73){return _0x3e621a[_0x0c41('0x10')](0x1f4)['json']({'message':_0x0c41('0xf9'),'pid':_0xd0e91e[_0x0c41('0xec')]});}});})[_0x0c41('0x82')](handleError(_0x3e621a,null));};exports[_0x0c41('0xfc')]=function(_0x21a3e7,_0x36f0a2){var _0x3b8cc2=[_0x0c41('0xfd'),_0x0c41('0xfe'),_0x0c41('0xff'),'openchannel',_0x0c41('0x100'),_0x0c41('0x101'),'voice'];var _0x4ae528={'offset':0x0,'order':qs[_0x0c41('0x33')]('-createdAt')},_0x5ecf66={'count':0x0,'rows':[]};Promise[_0x0c41('0x6f')]()['then'](function(){if(_0x21a3e7['query'][_0x0c41('0x102')]){if(!_['includes'](_0x3b8cc2,_0x21a3e7[_0x0c41('0x2b')]['channel'][_0x0c41('0x103')]())){throw new Error('Invalid\x20channel');}_0x3b8cc2=[_0x21a3e7[_0x0c41('0x2b')][_0x0c41('0x102')]['toLowerCase']()];}if(_0x21a3e7[_0x0c41('0x2b')][_0x0c41('0x104')]){try{var _0x40c674=JSON[_0x0c41('0xee')](_0x21a3e7[_0x0c41('0x2b')][_0x0c41('0x104')]);if(!moment(_0x40c674[_0x0c41('0x8d')])[_0x0c41('0x105')]()){throw new Error(_0x0c41('0x106'));}if(!moment(_0x40c674['to'])[_0x0c41('0x105')]()){throw new Error(_0x0c41('0x107'));}}catch(_0x96b165){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x21a3e7[_0x0c41('0x2b')][_0x0c41('0x30')](_0x0c41('0x31'))){_0x4ae528[_0x0c41('0x15')]=qs[_0x0c41('0x15')](_0x21a3e7['query'][_0x0c41('0x15')]||0xa);_0x4ae528[_0x0c41('0x12')]=qs[_0x0c41('0x12')](_0x21a3e7[_0x0c41('0x2b')][_0x0c41('0x12')]);}var _0x2daff7=_0x3b8cc2['map'](function(_0x16aae9){if(_0x16aae9==='voice'){var _0x3eb02c={'attributes':['id',_0x0c41('0x108'),_0x0c41('0x109'),_0x0c41('0x10a'),_0x0c41('0x10b'),_0x0c41('0x10c'),_0x0c41('0x10d'),'endtime',_0x0c41('0x10e'),_0x0c41('0x10f'),_0x0c41('0x110'),_0x0c41('0x111'),'userSecondDisposition',_0x0c41('0x112'),_0x0c41('0x113')],'where':{'ContactId':_0x21a3e7['params']['id']},'include':[{'model':db[_0x0c41('0x4c')],'as':_0x0c41('0x4c'),'attributes':['id',_0x0c41('0x1d'),_0x0c41('0x114'),_0x0c41('0x89')]}],'order':[[_0x0c41('0x110'),'DESC']]};if(_0x21a3e7[_0x0c41('0x2b')][_0x0c41('0x104')]){_0x3eb02c[_0x0c41('0x34')][_0x0c41('0x110')]={'$gte':_0x40c674['from'],'$lte':_0x40c674['to']};}return db[_0x0c41('0x9f')][_0x0c41('0x115')](_0x3eb02c)[_0x0c41('0x18')](function(_0xe3ca52){_0x5ecf66[_0x0c41('0x14')]+=_0xe3ca52[_0x0c41('0x14')];return _[_0x0c41('0x49')](_0xe3ca52[_0x0c41('0x81')],function(_0xfdbaa2){var _0x493a15=_0xfdbaa2[_0x0c41('0x8e')]({'plain':!![]});_0x493a15[_0x0c41('0x102')]=_0x16aae9;if(_0x493a15[_0x0c41('0x4c')]){_0x493a15['User']={'id':_0x493a15[_0x0c41('0x4c')]['id'],'name':_0x493a15[_0x0c41('0x4c')][_0x0c41('0x1d')],'fullname':_0x493a15['User'][_0x0c41('0x114')],'alias':_0x493a15[_0x0c41('0x4c')][_0x0c41('0x89')]};}return _0x493a15;});});}else{var _0x5c9d00=_[_0x0c41('0x116')](_0x16aae9)+(_0x16aae9===_0x0c41('0xfe')?_0x0c41('0x117'):_0x0c41('0x118'));var _0x5d1bc3={'attributes':['id','closed',_0x0c41('0x119'),'createdAt',_0x0c41('0x10f'),_0x0c41('0x11a'),_0x0c41('0x11b'),_0x0c41('0x11c'),_0x0c41('0x113'),_0x5c9d00+'Id'],'where':{'ContactId':_0x21a3e7['params']['id']},'include':[{'model':db[_0x5c9d00],'as':'Account','attributes':['id','name','key']},{'model':db[_0x0c41('0x4c')],'as':_0x0c41('0x11d'),'attributes':['id',_0x0c41('0x1d'),_0x0c41('0x114')]},{'model':db[_0x0c41('0xb3')],'as':_0x0c41('0x80'),'attributes':['id',_0x0c41('0x1d'),_0x0c41('0x38')],'through':{'attributes':[]}}],'order':[[_0x0c41('0x110'),'DESC']]};if(_0x21a3e7[_0x0c41('0x2b')]['range']){_0x5d1bc3['where']['createdAt']={'$gte':_0x40c674[_0x0c41('0x8d')],'$lte':_0x40c674['to']};}switch(_0x16aae9){case _0x0c41('0xfe'):_0x5d1bc3['attributes'][_0x0c41('0x26')](_0x0c41('0x11e'),'customerIp',_0x0c41('0x11f'),_0x0c41('0x120'),'osName','ratingMessage',_0x0c41('0x121'),_0x0c41('0x122'),'referer');break;case _0x0c41('0xfd'):_0x5d1bc3[_0x0c41('0x2e')][_0x0c41('0x26')](_0x0c41('0x123'),_0x0c41('0x124'));break;case _0x0c41('0x125'):_0x5d1bc3[_0x0c41('0x2e')][_0x0c41('0x26')](_0x0c41('0x126'),_0x0c41('0x127'));break;}return db[_[_0x0c41('0x116')](_0x16aae9)+'Interaction'][_0x0c41('0x115')](_0x5d1bc3)[_0x0c41('0x18')](function(_0x2678af){_0x5ecf66['count']+=_0x2678af[_0x0c41('0x14')];return _[_0x0c41('0x49')](_0x2678af[_0x0c41('0x81')],function(_0x2471cd){var _0x7bb945=_0x2471cd[_0x0c41('0x8e')]({'plain':!![]});_0x7bb945['channel']=_0x16aae9;if(_0x7bb945[_0x0c41('0x11d')]){_0x7bb945[_0x0c41('0x11d')]={'id':_0x7bb945['Owner']['id'],'name':_0x7bb945[_0x0c41('0x11d')][_0x0c41('0x1d')],'fullname':_0x7bb945[_0x0c41('0x11d')][_0x0c41('0x114')]};}return _0x7bb945;});});}});return Promise[_0x0c41('0xb1')](_0x2daff7);})[_0x0c41('0x18')](function(_0x4807ee){return _(_0x4807ee)[_0x0c41('0x128')]()[_0x0c41('0x129')]('createdAt')[_0x0c41('0x12a')]()['value']();})['then'](function(_0xc1672b){_0x5ecf66[_0x0c41('0x81')]=_0x4ae528['limit']?_0xc1672b['slice'](_0x4ae528[_0x0c41('0x12')],_0x4ae528['offset']+_0x4ae528[_0x0c41('0x15')]):_0xc1672b;return _0x5ecf66;})[_0x0c41('0x18')](respondWithFilteredResult(_0x36f0a2,_0x4ae528))['catch'](handleError(_0x36f0a2,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 3dd6a35..b3d3ae0 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 _0x544a=['../../mysqldb','CmContact','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1bd7b7,_0x18e7c4){var _0x46a408=function(_0x447563){while(--_0x447563){_0x1bd7b7['push'](_0x1bd7b7['shift']());}};_0x46a408(++_0x18e7c4);}(_0x544a,0x1d3));var _0xa544=function(_0x51bad7,_0x2b4d80){_0x51bad7=_0x51bad7-0x0;var _0x55ef0b=_0x544a[_0x51bad7];return _0x55ef0b;};'use strict';var EventEmitter=require(_0xa544('0x0'));var CmContact=require(_0xa544('0x1'))['db'][_0xa544('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa544('0x3'),'afterDestroy':_0xa544('0x4')};function emitEvent(_0x16cebd){return function(_0x33a734,_0x3c1fa8,_0x23d2fc){CmContactEvents[_0xa544('0x5')](_0x16cebd+':'+_0x33a734['id'],_0x33a734);CmContactEvents['emit'](_0x16cebd,_0x33a734);_0x23d2fc(null);};}for(var e in events){if(events[_0xa544('0x6')](e)){var event=events[e];CmContact[_0xa544('0x7')](e,emitEvent(event));}}module[_0xa544('0x8')]=CmContactEvents; \ No newline at end of file +var _0x3e13=['CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x13a1ed,_0x426cf1){var _0x4aca18=function(_0x159154){while(--_0x159154){_0x13a1ed['push'](_0x13a1ed['shift']());}};_0x4aca18(++_0x426cf1);}(_0x3e13,0x111));var _0x33e1=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x3e13[_0x5ac84c];return _0x3c53d2;};'use strict';var EventEmitter=require(_0x33e1('0x0'));var CmContact=require(_0x33e1('0x1'))['db'][_0x33e1('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x33e1('0x3')](0x0);var events={'afterCreate':_0x33e1('0x4'),'afterUpdate':_0x33e1('0x5'),'afterDestroy':_0x33e1('0x6')};function emitEvent(_0x132019){return function(_0x1ab83d,_0xe88117,_0x538f4c){CmContactEvents[_0x33e1('0x7')](_0x132019+':'+_0x1ab83d['id'],_0x1ab83d);CmContactEvents[_0x33e1('0x7')](_0x132019,_0x1ab83d);_0x538f4c(null);};}for(var e in events){if(events[_0x33e1('0x8')](e)){var event=events[e];CmContact[_0x33e1('0x9')](e,emitEvent(event));}}module[_0x33e1('0xa')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index fc524d5..237cf8a 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 _0x5488=['cmContact,\x20afterCreate\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','findAll','outbound','length','get','onlyIfOpen','CmList','BlackLists','cmContact,\x20%s,\x20%s','message','dialCheckDuplicateType','Lists','always','CmHopperBlack','isEmpty','destroy','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','dialTimezone','utcOffset','add','minutes','then','CmHopper','findOne','create','ListId','priority','callbackUniqueid','catch'];(function(_0x435f1c,_0x44e40d){var _0x413354=function(_0x421c9c){while(--_0x421c9c){_0x435f1c['push'](_0x435f1c['shift']());}};_0x413354(++_0x44e40d);}(_0x5488,0x13a));var _0x8548=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x5488[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0x8548('0x0'));var logger=require(_0x8548('0x1'))(_0x8548('0x2'));var moment=require('moment');var BPromise=require(_0x8548('0x3'));var rp=require(_0x8548('0x4'));var fs=require('fs');var path=require(_0x8548('0x5'));var rimraf=require(_0x8548('0x6'));var config=require(_0x8548('0x7'));var shared=require(_0x8548('0x8'));var attributes=require('./cmContact.attributes');module[_0x8548('0x9')]=function(_0x4a8365,_0x215cf1){return _0x4a8365['define'](_0x8548('0xa'),attributes,{'tableName':_0x8548('0xb'),'paranoid':!![],'indexes':[{'name':_0x8548('0xc'),'fields':['phone']},{'name':_0x8548('0xd'),'fields':[_0x8548('0xe'),_0x8548('0xf'),_0x8548('0xc'),_0x8548('0x10'),'fax','email'],'type':_0x8548('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x8548('0x12'),'hooks':{'afterCreate':function(_0xf1f91f,_0x4d4c4e,_0xbce86){var _0x2e08b9=_0x4a8365[_0x8548('0x13')];var _0x437bd0=_0xf1f91f['get']({'plain':!![]});function _0xf81810(){return function(_0x5049c8){logger[_0x8548('0x14')](_0x8548('0x15'),_0x8548('0x16'),util[_0x8548('0x17')](_0x5049c8,{'showHidden':![],'depth':null}));};}function _0xf9fbc0(_0x255798,_0x23231e){var _0x456563=_0x23231e[_0x8548('0x18')]?_0x23231e[_0x8548('0x18')]:moment()[_0x8548('0x19')](_0x8548('0x1a'));return new BPromise(function(_0x3c46a7,_0x1da503){if(_[_0x8548('0x1b')](_0x23231e['dialTimezone'])){_0x3c46a7({'ret':_0x456563});}else{_0x2e08b9[_0x8548('0x1c')]['findOne']({'where':{'id':_0x255798['id']}})['then'](function(_0x4b8ec4){if(!_[_0x8548('0x1b')](_0x4b8ec4)){var _0x1f5147=_0x4b8ec4[_0x8548('0x1d')];if(!_[_0x8548('0x1b')](_0x1f5147)){var _0x10f5c8=shared['timezones'];var _0x2106cb=_0x10f5c8[_0x1f5147];var _0x52c750=_0x10f5c8[_0x23231e[_0x8548('0x1d')]];if(!_[_0x8548('0x1b')](_0x2106cb)&&!_[_0x8548('0x1b')](_0x52c750)){var _0x237a2d=_0x2106cb['utcOffset']-_0x52c750[_0x8548('0x1e')];_0x456563=_0x23231e['scheduledat']?_0x23231e['scheduledat']:moment();var _0x5505fb=moment(_0x456563)[_0x8548('0x1f')](_0x237a2d,_0x8548('0x20'));_0x3c46a7({'ret':_0x5505fb[_0x8548('0x19')](_0x8548('0x1a'))});}else _0x3c46a7({'ret':_0x456563});}else _0x3c46a7({'ret':_0x456563});}else{_0x3c46a7({'ret':_0x456563});}});}});return 0xa;}var _0x32ab3a=function(_0x27e8df){return new BPromise(function(_0x447bde,_0x3d1e55){_0xf9fbc0(_0x27e8df,_0x437bd0)[_0x8548('0x21')](function(_0x899aee){_0x437bd0['scheduledat']=_0x899aee['ret'];_0x2e08b9[_0x8548('0x22')][_0x8548('0x23')]({'where':{'phone':_0x437bd0['phone'],'VoiceQueueId':_0x27e8df['id']}})[_0x8548('0x21')](function(_0x5744a1){if(!_['isNil'](_0x5744a1)){throw new Error('cmContact,\x20afterCreate\x20'+_0x437bd0['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x27e8df['id']);}return _0x2e08b9['CmHopper'][_0x8548('0x24')]({'phone':_0x437bd0[_0x8548('0xc')],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0[_0x8548('0x25')],'priority':_0x437bd0[_0x8548('0x26')]?_0x437bd0['priority']:0x2,'scheduledat':_0x437bd0[_0x8548('0x18')]?_0x437bd0[_0x8548('0x18')]:moment()[_0x8548('0x19')](_0x8548('0x1a')),'callback':_0x437bd0[_0x8548('0x27')]?!![]:![],'callbackuniqueid':_0x437bd0[_0x8548('0x27')]?_0x437bd0[_0x8548('0x27')]:undefined,'callbackat':_0x437bd0[_0x8548('0x27')]?moment()[_0x8548('0x19')](_0x8548('0x1a')):undefined,'VoiceQueueId':_0x27e8df['id']});})[_0x8548('0x28')](function(_0x5849c5){_0x3d1e55(_0x5849c5);});});});};var _0x41be21=function(_0x1b64ea){return new BPromise(function(_0x530637,_0x1ad84b){_0xf9fbc0(_0x1b64ea,_0x437bd0)[_0x8548('0x21')](function(_0x1cf017){_0x437bd0[_0x8548('0x18')]=_0x1cf017['ret'];_0x2e08b9[_0x8548('0x22')][_0x8548('0x23')]({'where':{'phone':_0x437bd0[_0x8548('0xc')],'VoiceQueueId':_0x1b64ea['id']}})[_0x8548('0x21')](function(_0x3a717b){if(!_[_0x8548('0x1b')](_0x3a717b)){throw new Error(_0x8548('0x29')+_0x437bd0['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1b64ea['id']);}return _0x2e08b9['CmHopperFinal'][_0x8548('0x23')]({'where':{'calleridnum':_0x437bd0[_0x8548('0xc')],'VoiceQueueId':_0x1b64ea['id']}});})['then'](function(_0x2fe51f){if(!_[_0x8548('0x1b')](_0x2fe51f)){throw new Error(_0x8548('0x2a')+_0x437bd0[_0x8548('0xc')]+_0x8548('0x2b')+_0x1b64ea['id']);}return _0x2e08b9[_0x8548('0x22')][_0x8548('0x24')]({'phone':_0x437bd0[_0x8548('0xc')],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0[_0x8548('0x25')],'priority':_0x437bd0['priority']?_0x437bd0['priority']:0x2,'scheduledat':_0x437bd0[_0x8548('0x18')]?_0x437bd0[_0x8548('0x18')]:moment()[_0x8548('0x19')](_0x8548('0x1a')),'callback':_0x437bd0[_0x8548('0x27')]?!![]:![],'callbackuniqueid':_0x437bd0['callbackUniqueid']?_0x437bd0[_0x8548('0x27')]:undefined,'callbackat':_0x437bd0[_0x8548('0x27')]?moment()[_0x8548('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1b64ea['id']});})[_0x8548('0x28')](function(_0x312dd5){_0x1ad84b(_0x312dd5);});});});};function _0x210220(){return function(_0x200f9a){logger[_0x8548('0x14')](_0x8548('0x15'),_0x8548('0x16'),util[_0x8548('0x17')](_0x200f9a,{'showHidden':![],'depth':null}));};}function _0x3a5b1c(_0x123fd9,_0x5f15ac){var _0xd06a63=_0x5f15ac[_0x8548('0x18')]?_0x5f15ac[_0x8548('0x18')]:moment()[_0x8548('0x19')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0xda9fe1,_0x317a10){if(_[_0x8548('0x1b')](_0x5f15ac[_0x8548('0x1d')])){_0xda9fe1({'ret':_0xd06a63});}else{_0x2e08b9[_0x8548('0x2c')][_0x8548('0x23')]({'where':{'id':_0x123fd9['id']}})[_0x8548('0x21')](function(_0x535cca){if(!_[_0x8548('0x1b')](_0x535cca)){var _0x20dd07=_0x535cca['dialTimezone'];if(!_[_0x8548('0x1b')](_0x20dd07)){var _0x4cbf3a=shared[_0x8548('0x2d')];var _0x2dded6=_0x4cbf3a[_0x20dd07];var _0x505374=_0x4cbf3a[_0x5f15ac[_0x8548('0x1d')]];if(!_[_0x8548('0x1b')](_0x2dded6)&&!_[_0x8548('0x1b')](_0x505374)){var _0x418e59=_0x2dded6['utcOffset']-_0x505374[_0x8548('0x1e')];_0xd06a63=_0x5f15ac[_0x8548('0x18')]?_0x5f15ac[_0x8548('0x18')]:moment();var _0x1175b0=moment(_0xd06a63)[_0x8548('0x1f')](_0x418e59,_0x8548('0x20'));_0xda9fe1({'ret':_0x1175b0[_0x8548('0x19')](_0x8548('0x1a'))});}else _0xda9fe1({'ret':_0xd06a63});}else _0xda9fe1({'ret':_0xd06a63});}else{_0xda9fe1({'ret':_0xd06a63});}});}});return 0xa;}var _0x131dd2=function(_0x3869f9){return new BPromise(function(_0x355b2d,_0x389f91){_0x3a5b1c(_0x3869f9,_0x437bd0)[_0x8548('0x21')](function(_0xf99ec6){_0x437bd0[_0x8548('0x18')]=_0xf99ec6['ret'];_0x2e08b9['CmHopper'][_0x8548('0x23')]({'where':{'phone':_0x437bd0[_0x8548('0xc')],'CampaignId':_0x3869f9['id']}})[_0x8548('0x21')](function(_0x588fc3){if(!_['isNil'](_0x588fc3)){throw new Error('cmContact,\x20afterCreate\x20'+_0x437bd0[_0x8548('0xc')]+_0x8548('0x2e')+_0x3869f9['id']);}return _0x2e08b9[_0x8548('0x22')][_0x8548('0x24')]({'phone':_0x437bd0[_0x8548('0xc')],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0[_0x8548('0x25')],'priority':_0x437bd0['priority']?_0x437bd0[_0x8548('0x26')]:0x2,'scheduledat':_0x437bd0[_0x8548('0x18')]?_0x437bd0[_0x8548('0x18')]:moment()[_0x8548('0x19')](_0x8548('0x1a')),'callback':_0x437bd0[_0x8548('0x27')]?!![]:![],'callbackuniqueid':_0x437bd0['callbackUniqueid']?_0x437bd0[_0x8548('0x27')]:undefined,'callbackat':_0x437bd0[_0x8548('0x27')]?moment()['format'](_0x8548('0x1a')):undefined,'CampaignId':_0x3869f9['id']});})[_0x8548('0x28')](function(_0x4b3ba0){_0x389f91(_0x4b3ba0);});});});};var _0xd82116=function(_0x2a422b){return new BPromise(function(_0x17cfb0,_0x5ec265){_0x3a5b1c(_0x2a422b,_0x437bd0)['then'](function(_0xc8ad5e){_0x437bd0[_0x8548('0x18')]=_0xc8ad5e[_0x8548('0x2f')];_0x2e08b9[_0x8548('0x22')][_0x8548('0x23')]({'where':{'phone':_0x437bd0['phone'],'CampaignId':_0x2a422b['id']}})[_0x8548('0x21')](function(_0x127ecd){if(!_[_0x8548('0x1b')](_0x127ecd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x437bd0[_0x8548('0xc')]+_0x8548('0x30')+_0x2a422b['id']);}return _0x2e08b9[_0x8548('0x31')][_0x8548('0x23')]({'where':{'calleridnum':_0x437bd0[_0x8548('0xc')],'CampaignId':_0x2a422b['id']}});})['then'](function(_0x2be0de){if(!_[_0x8548('0x1b')](_0x2be0de)){throw new Error(_0x8548('0x2a')+_0x437bd0[_0x8548('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x2a422b['id']);}return _0x2e08b9[_0x8548('0x22')][_0x8548('0x24')]({'phone':_0x437bd0[_0x8548('0xc')],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0[_0x8548('0x25')],'priority':_0x437bd0[_0x8548('0x26')]?_0x437bd0[_0x8548('0x26')]:0x2,'scheduledat':_0x437bd0[_0x8548('0x18')]?_0x437bd0[_0x8548('0x18')]:moment()[_0x8548('0x19')](_0x8548('0x1a')),'callback':_0x437bd0[_0x8548('0x27')]?!![]:![],'callbackuniqueid':_0x437bd0[_0x8548('0x27')]?_0x437bd0[_0x8548('0x27')]:undefined,'callbackat':_0x437bd0['callbackUniqueid']?moment()[_0x8548('0x19')](_0x8548('0x1a')):undefined,'CampaignId':_0x2a422b['id']});})['catch'](function(_0x287895){_0x5ec265(_0x287895);});});});};if(_0x437bd0[_0x8548('0x25')]){_0x2e08b9[_0x8548('0x1c')][_0x8548('0x32')]({'where':{'type':_0x8548('0x33')},'attributes':['id','dialCheckDuplicateType',_0x8548('0x1d')],'include':[{'model':_0x2e08b9['CmList'],'as':'Lists','where':{'id':_0x437bd0['ListId']}}]})[_0x8548('0x21')](function(_0x306321){if(_0x306321){var _0x4e7723=[];for(var _0x510d92=0x0,_0x2b5307;_0x510d92<_0x306321[_0x8548('0x34')];_0x510d92+=0x1){_0x2b5307=_0x306321[_0x510d92][_0x8548('0x35')]({'plain':!![]});switch(_0x2b5307['dialCheckDuplicateType']){case'always':_0x41be21(_0x2b5307)[_0x8548('0x28')](_0xf81810());break;case _0x8548('0x36'):_0x32ab3a(_0x2b5307)[_0x8548('0x28')](_0xf81810());break;default:_0x3a5b1c(_0x2b5307,_0x437bd0)[_0x8548('0x21')](function(_0x573dcf){_0x437bd0[_0x8548('0x18')]=_0x573dcf[_0x8548('0x2f')];_0x2e08b9[_0x8548('0x22')]['create']({'phone':_0x437bd0['phone'],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0[_0x8548('0x25')],'scheduledat':_0x437bd0['scheduledat']?_0x437bd0[_0x8548('0x18')]:moment()[_0x8548('0x19')](_0x8548('0x1a')),'priority':_0x437bd0[_0x8548('0x26')]?_0x437bd0[_0x8548('0x26')]:0x2,'callback':_0x437bd0['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x437bd0[_0x8548('0x27')]?_0x437bd0['callbackUniqueid']:undefined,'callbackat':_0x437bd0[_0x8548('0x27')]?moment()[_0x8548('0x19')](_0x8548('0x1a')):undefined,'VoiceQueueId':_0x2b5307['id']})['catch'](_0xf81810());});}}}})['then'](function(){return _0x2e08b9['VoiceQueue'][_0x8548('0x32')]({'where':{'type':_0x8548('0x33')},'attributes':['id'],'include':[{'model':_0x2e08b9[_0x8548('0x37')],'as':_0x8548('0x38'),'where':{'id':_0x437bd0[_0x8548('0x25')]}}]})['then'](function(_0x584488){if(_0x584488){var _0x1b8eb0=[];for(var _0xc90848=0x0,_0x2fcbf0;_0xc90848<_0x584488[_0x8548('0x34')];_0xc90848+=0x1){_0x2fcbf0=_0x584488[_0xc90848][_0x8548('0x35')]({'plain':!![]});_0x2e08b9['CmHopperBlack'][_0x8548('0x24')]({'phone':_0x437bd0['phone'],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0['ListId'],'VoiceQueueId':_0x2fcbf0['id']})[_0x8548('0x28')](function(_0x45f92f){logger[_0x8548('0x14')](_0x8548('0x39'),_0x8548('0x16'),_0x45f92f[_0x8548('0x3a')]);});}}});})['then'](function(){return _0x2e08b9[_0x8548('0x2c')][_0x8548('0x32')]({'attributes':['id',_0x8548('0x3b'),_0x8548('0x1d')],'include':[{'model':_0x2e08b9[_0x8548('0x37')],'as':_0x8548('0x3c'),'where':{'id':_0x437bd0[_0x8548('0x25')]}}]})[_0x8548('0x21')](function(_0x117a4e){if(_0x117a4e){var _0x40068a=[];for(var _0x481ee1=0x0,_0x3819f9;_0x481ee1<_0x117a4e[_0x8548('0x34')];_0x481ee1+=0x1){_0x3819f9=_0x117a4e[_0x481ee1][_0x8548('0x35')]({'plain':!![]});switch(_0x3819f9[_0x8548('0x3b')]){case _0x8548('0x3d'):_0xd82116(_0x3819f9)['catch'](_0x210220());break;case _0x8548('0x36'):_0x131dd2(_0x3819f9)['catch'](_0x210220());break;default:_0x2e08b9['CmHopper'][_0x8548('0x24')]({'phone':_0x437bd0[_0x8548('0xc')],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0[_0x8548('0x25')],'scheduledat':_0x437bd0[_0x8548('0x18')]?_0x437bd0[_0x8548('0x18')]:moment()[_0x8548('0x19')](_0x8548('0x1a')),'priority':_0x437bd0[_0x8548('0x26')]?_0x437bd0[_0x8548('0x26')]:0x2,'callback':_0x437bd0[_0x8548('0x27')]?!![]:![],'callbackuniqueid':_0x437bd0['callbackUniqueid']?_0x437bd0[_0x8548('0x27')]:undefined,'callbackat':_0x437bd0[_0x8548('0x27')]?moment()[_0x8548('0x19')](_0x8548('0x1a')):undefined,'CampaignId':_0x3819f9['id']})[_0x8548('0x28')](_0x210220());}}}});})[_0x8548('0x21')](function(){return _0x2e08b9[_0x8548('0x2c')]['findAll']({'attributes':['id'],'include':[{'model':_0x2e08b9[_0x8548('0x37')],'as':_0x8548('0x38'),'where':{'id':_0x437bd0[_0x8548('0x25')]}}]})['then'](function(_0x52be8e){if(_0x52be8e){var _0x3feb2d=[];for(var _0x1b3714=0x0,_0x43283c;_0x1b3714<_0x52be8e[_0x8548('0x34')];_0x1b3714+=0x1){_0x43283c=_0x52be8e[_0x1b3714][_0x8548('0x35')]({'plain':!![]});_0x2e08b9[_0x8548('0x3e')][_0x8548('0x24')]({'phone':_0x437bd0['phone'],'ContactId':_0x437bd0['id'],'ListId':_0x437bd0[_0x8548('0x25')],'CampaignId':_0x43283c['id']})[_0x8548('0x28')](function(_0x538777){logger[_0x8548('0x14')](_0x8548('0x39'),_0x8548('0x16'),_0x538777[_0x8548('0x3a')]);});}}});})[_0x8548('0x21')](function(){_0xbce86();})[_0x8548('0x28')](function(_0xc71fcf){logger['error'](_0x8548('0x39'),_0x8548('0x16'),_0xc71fcf['message']);_0xbce86(_0xc71fcf);});}else{_0xbce86(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x24d918,_0x1c90ed,_0x31cee8){var _0x4ac741=_0x4a8365[_0x8548('0x13')];var _0x571445=_0x24d918[_0x8548('0x35')]({'plain':!![]});return _0x4ac741['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x571445['ListId'],'ContactId':_0x571445['id']}})[_0x8548('0x21')](function(_0x29f5fd){if(!_[_0x8548('0x3f')](_0x29f5fd)){var _0x593ad1=[];for(var _0x259231=0x0;_0x259231<_0x29f5fd[_0x8548('0x34')];_0x259231+=0x1){var _0x4471de=_0x4ac741['CmHopper'][_0x8548('0x40')]({'where':{'ListId':_0x29f5fd[_0x259231]['ListId'],'ContactId':_0x29f5fd[_0x259231]['ContactId'],'VoiceQueueId':_0x29f5fd[_0x259231][_0x8548('0x41')],'CampaignId':_0x29f5fd[_0x259231]['CampaignId']}});_0x593ad1[_0x8548('0x42')](_0x4471de);}return BPromise[_0x8548('0x43')](_0x593ad1);}})[_0x8548('0x21')](function(_0x4720cc){logger[_0x8548('0x44')](_0x8548('0x45'),util[_0x8548('0x17')](_0x4720cc,{'showHidden':![],'depth':null}));_0x31cee8();})['catch'](function(_0x1362e6){logger[_0x8548('0x14')](_0x8548('0x46'),util['inspect'](_0x1362e6,{'showHidden':![],'depth':null}));_0x31cee8(_0x1362e6);});}}});}; \ No newline at end of file +var _0x4dfd=['onlyIfOpen','BlackLists','get','CmHopperBlack','cmContact,\x20%s,\x20%s','destroy','ContactId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','api','request-promise','path','../../config/environment','./cmContact.attributes','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','isNil','dialTimezone','VoiceQueue','findOne','timezones','utcOffset','add','format','YYYY-MM-DD\x20HH:mm:ss','then','ret','CmHopper','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always'];(function(_0x364048,_0x34dea3){var _0x591678=function(_0x239c0a){while(--_0x239c0a){_0x364048['push'](_0x364048['shift']());}};_0x591678(++_0x34dea3);}(_0x4dfd,0x15b));var _0xd4df=function(_0x56d8b3,_0x286029){_0x56d8b3=_0x56d8b3-0x0;var _0x1f0402=_0x4dfd[_0x56d8b3];return _0x1f0402;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd4df('0x0'))(_0xd4df('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd4df('0x2'));var fs=require('fs');var path=require(_0xd4df('0x3'));var rimraf=require('rimraf');var config=require(_0xd4df('0x4'));var shared=require('../../config/environment/shared');var attributes=require(_0xd4df('0x5'));module['exports']=function(_0xd20865,_0x22637c){return _0xd20865['define'](_0xd4df('0x6'),attributes,{'tableName':_0xd4df('0x7'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0xd4df('0x8')]},{'name':_0xd4df('0x9'),'fields':['firstName',_0xd4df('0xa'),'phone',_0xd4df('0xb'),_0xd4df('0xc'),_0xd4df('0xd')],'type':_0xd4df('0xe')}],'timestamps':!![],'charset':_0xd4df('0xf'),'collate':_0xd4df('0x10'),'hooks':{'afterCreate':function(_0x33bb05,_0x189b20,_0x5380ff){var _0x33871d=_0xd20865[_0xd4df('0x11')];var _0x299a62=_0x33bb05['get']({'plain':!![]});function _0x3175e2(){return function(_0x1668b4){logger[_0xd4df('0x12')](_0xd4df('0x13'),_0xd4df('0x14'),util[_0xd4df('0x15')](_0x1668b4,{'showHidden':![],'depth':null}));};}function _0x1d8da7(_0x2d2cb9,_0x190295){var _0x29a360=_0x190295[_0xd4df('0x16')]?_0x190295[_0xd4df('0x16')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x5504dd,_0x51cf60){if(_[_0xd4df('0x17')](_0x190295[_0xd4df('0x18')])){_0x5504dd({'ret':_0x29a360});}else{_0x33871d[_0xd4df('0x19')][_0xd4df('0x1a')]({'where':{'id':_0x2d2cb9['id']}})['then'](function(_0x39e804){if(!_[_0xd4df('0x17')](_0x39e804)){var _0x2d8774=_0x39e804['dialTimezone'];if(!_['isNil'](_0x2d8774)){var _0x36ba39=shared[_0xd4df('0x1b')];var _0x469de7=_0x36ba39[_0x2d8774];var _0x4238ea=_0x36ba39[_0x190295[_0xd4df('0x18')]];if(!_['isNil'](_0x469de7)&&!_[_0xd4df('0x17')](_0x4238ea)){var _0x3f6bc9=_0x469de7[_0xd4df('0x1c')]-_0x4238ea[_0xd4df('0x1c')];_0x29a360=_0x190295[_0xd4df('0x16')]?_0x190295[_0xd4df('0x16')]:moment();var _0x279133=moment(_0x29a360)[_0xd4df('0x1d')](_0x3f6bc9,'minutes');_0x5504dd({'ret':_0x279133[_0xd4df('0x1e')](_0xd4df('0x1f'))});}else _0x5504dd({'ret':_0x29a360});}else _0x5504dd({'ret':_0x29a360});}else{_0x5504dd({'ret':_0x29a360});}});}});return 0xa;}var _0x122a1b=function(_0x5f0da2){return new BPromise(function(_0x112e3f,_0x341aa3){_0x1d8da7(_0x5f0da2,_0x299a62)[_0xd4df('0x20')](function(_0x3d838c){_0x299a62[_0xd4df('0x16')]=_0x3d838c[_0xd4df('0x21')];_0x33871d[_0xd4df('0x22')][_0xd4df('0x1a')]({'where':{'phone':_0x299a62[_0xd4df('0x8')],'VoiceQueueId':_0x5f0da2['id']}})[_0xd4df('0x20')](function(_0x14deda){if(!_[_0xd4df('0x17')](_0x14deda)){throw new Error(_0xd4df('0x23')+_0x299a62[_0xd4df('0x8')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5f0da2['id']);}return _0x33871d[_0xd4df('0x22')][_0xd4df('0x24')]({'phone':_0x299a62[_0xd4df('0x8')],'ContactId':_0x299a62['id'],'ListId':_0x299a62['ListId'],'priority':_0x299a62[_0xd4df('0x25')]?_0x299a62[_0xd4df('0x25')]:0x2,'scheduledat':_0x299a62[_0xd4df('0x16')]?_0x299a62[_0xd4df('0x16')]:moment()[_0xd4df('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x299a62[_0xd4df('0x26')]?!![]:![],'callbackuniqueid':_0x299a62[_0xd4df('0x26')]?_0x299a62['callbackUniqueid']:undefined,'callbackat':_0x299a62['callbackUniqueid']?moment()[_0xd4df('0x1e')](_0xd4df('0x1f')):undefined,'VoiceQueueId':_0x5f0da2['id']});})[_0xd4df('0x27')](function(_0x4d733e){_0x341aa3(_0x4d733e);});});});};var _0x2330c6=function(_0x51739d){return new BPromise(function(_0x4f2451,_0x2b3e15){_0x1d8da7(_0x51739d,_0x299a62)['then'](function(_0xbaf59f){_0x299a62['scheduledat']=_0xbaf59f[_0xd4df('0x21')];_0x33871d[_0xd4df('0x22')][_0xd4df('0x1a')]({'where':{'phone':_0x299a62[_0xd4df('0x8')],'VoiceQueueId':_0x51739d['id']}})['then'](function(_0x48a5b0){if(!_[_0xd4df('0x17')](_0x48a5b0)){throw new Error(_0xd4df('0x23')+_0x299a62[_0xd4df('0x8')]+_0xd4df('0x28')+_0x51739d['id']);}return _0x33871d[_0xd4df('0x29')][_0xd4df('0x1a')]({'where':{'calleridnum':_0x299a62['phone'],'VoiceQueueId':_0x51739d['id']}});})['then'](function(_0x430d0d){if(!_['isNil'](_0x430d0d)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x299a62['phone']+_0xd4df('0x2a')+_0x51739d['id']);}return _0x33871d[_0xd4df('0x22')]['create']({'phone':_0x299a62['phone'],'ContactId':_0x299a62['id'],'ListId':_0x299a62[_0xd4df('0x2b')],'priority':_0x299a62[_0xd4df('0x25')]?_0x299a62[_0xd4df('0x25')]:0x2,'scheduledat':_0x299a62[_0xd4df('0x16')]?_0x299a62['scheduledat']:moment()[_0xd4df('0x1e')](_0xd4df('0x1f')),'callback':_0x299a62[_0xd4df('0x26')]?!![]:![],'callbackuniqueid':_0x299a62['callbackUniqueid']?_0x299a62[_0xd4df('0x26')]:undefined,'callbackat':_0x299a62[_0xd4df('0x26')]?moment()['format'](_0xd4df('0x1f')):undefined,'VoiceQueueId':_0x51739d['id']});})[_0xd4df('0x27')](function(_0x562c21){_0x2b3e15(_0x562c21);});});});};function _0xffe26f(){return function(_0x46a95d){logger[_0xd4df('0x12')](_0xd4df('0x13'),_0xd4df('0x14'),util[_0xd4df('0x15')](_0x46a95d,{'showHidden':![],'depth':null}));};}function _0x9c929(_0xb222f9,_0x23cc44){var _0x1d3de1=_0x23cc44[_0xd4df('0x16')]?_0x23cc44[_0xd4df('0x16')]:moment()[_0xd4df('0x1e')](_0xd4df('0x1f'));return new BPromise(function(_0x47239d,_0x883e0c){if(_[_0xd4df('0x17')](_0x23cc44[_0xd4df('0x18')])){_0x47239d({'ret':_0x1d3de1});}else{_0x33871d[_0xd4df('0x2c')][_0xd4df('0x1a')]({'where':{'id':_0xb222f9['id']}})[_0xd4df('0x20')](function(_0x43d2ce){if(!_['isNil'](_0x43d2ce)){var _0x2b8e98=_0x43d2ce[_0xd4df('0x18')];if(!_[_0xd4df('0x17')](_0x2b8e98)){var _0x3893d8=shared['timezones'];var _0x2e4976=_0x3893d8[_0x2b8e98];var _0x1ed78b=_0x3893d8[_0x23cc44['dialTimezone']];if(!_[_0xd4df('0x17')](_0x2e4976)&&!_[_0xd4df('0x17')](_0x1ed78b)){var _0x242400=_0x2e4976['utcOffset']-_0x1ed78b[_0xd4df('0x1c')];_0x1d3de1=_0x23cc44[_0xd4df('0x16')]?_0x23cc44[_0xd4df('0x16')]:moment();var _0x16d521=moment(_0x1d3de1)['add'](_0x242400,'minutes');_0x47239d({'ret':_0x16d521[_0xd4df('0x1e')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x47239d({'ret':_0x1d3de1});}else _0x47239d({'ret':_0x1d3de1});}else{_0x47239d({'ret':_0x1d3de1});}});}});return 0xa;}var _0x485166=function(_0x434a9a){return new BPromise(function(_0x5a0a2c,_0x5d52c8){_0x9c929(_0x434a9a,_0x299a62)[_0xd4df('0x20')](function(_0x4e701e){_0x299a62[_0xd4df('0x16')]=_0x4e701e[_0xd4df('0x21')];_0x33871d[_0xd4df('0x22')]['findOne']({'where':{'phone':_0x299a62[_0xd4df('0x8')],'CampaignId':_0x434a9a['id']}})['then'](function(_0x5582a7){if(!_[_0xd4df('0x17')](_0x5582a7)){throw new Error(_0xd4df('0x23')+_0x299a62[_0xd4df('0x8')]+_0xd4df('0x2d')+_0x434a9a['id']);}return _0x33871d[_0xd4df('0x22')]['create']({'phone':_0x299a62[_0xd4df('0x8')],'ContactId':_0x299a62['id'],'ListId':_0x299a62[_0xd4df('0x2b')],'priority':_0x299a62[_0xd4df('0x25')]?_0x299a62['priority']:0x2,'scheduledat':_0x299a62[_0xd4df('0x16')]?_0x299a62[_0xd4df('0x16')]:moment()[_0xd4df('0x1e')](_0xd4df('0x1f')),'callback':_0x299a62['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x299a62[_0xd4df('0x26')]?_0x299a62['callbackUniqueid']:undefined,'callbackat':_0x299a62[_0xd4df('0x26')]?moment()[_0xd4df('0x1e')](_0xd4df('0x1f')):undefined,'CampaignId':_0x434a9a['id']});})['catch'](function(_0x16c8f9){_0x5d52c8(_0x16c8f9);});});});};var _0x56c76b=function(_0x454803){return new BPromise(function(_0x318ce2,_0x550f16){_0x9c929(_0x454803,_0x299a62)[_0xd4df('0x20')](function(_0x24526e){_0x299a62[_0xd4df('0x16')]=_0x24526e[_0xd4df('0x21')];_0x33871d[_0xd4df('0x22')][_0xd4df('0x1a')]({'where':{'phone':_0x299a62[_0xd4df('0x8')],'CampaignId':_0x454803['id']}})[_0xd4df('0x20')](function(_0x499cec){if(!_[_0xd4df('0x17')](_0x499cec)){throw new Error(_0xd4df('0x23')+_0x299a62[_0xd4df('0x8')]+_0xd4df('0x2e')+_0x454803['id']);}return _0x33871d['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x299a62['phone'],'CampaignId':_0x454803['id']}});})[_0xd4df('0x20')](function(_0x188520){if(!_[_0xd4df('0x17')](_0x188520)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x299a62[_0xd4df('0x8')]+_0xd4df('0x2f')+_0x454803['id']);}return _0x33871d[_0xd4df('0x22')][_0xd4df('0x24')]({'phone':_0x299a62['phone'],'ContactId':_0x299a62['id'],'ListId':_0x299a62[_0xd4df('0x2b')],'priority':_0x299a62[_0xd4df('0x25')]?_0x299a62['priority']:0x2,'scheduledat':_0x299a62[_0xd4df('0x16')]?_0x299a62['scheduledat']:moment()[_0xd4df('0x1e')](_0xd4df('0x1f')),'callback':_0x299a62[_0xd4df('0x26')]?!![]:![],'callbackuniqueid':_0x299a62[_0xd4df('0x26')]?_0x299a62[_0xd4df('0x26')]:undefined,'callbackat':_0x299a62[_0xd4df('0x26')]?moment()['format'](_0xd4df('0x1f')):undefined,'CampaignId':_0x454803['id']});})[_0xd4df('0x27')](function(_0x4c6ea9){_0x550f16(_0x4c6ea9);});});});};if(_0x299a62[_0xd4df('0x2b')]){_0x33871d[_0xd4df('0x19')][_0xd4df('0x30')]({'where':{'type':_0xd4df('0x31')},'attributes':['id',_0xd4df('0x32'),_0xd4df('0x18')],'include':[{'model':_0x33871d[_0xd4df('0x33')],'as':_0xd4df('0x34'),'where':{'id':_0x299a62['ListId']}}]})[_0xd4df('0x20')](function(_0x3396e0){if(_0x3396e0){var _0x4a5d55=[];for(var _0x5661d9=0x0,_0x9d74c8;_0x5661d9<_0x3396e0[_0xd4df('0x35')];_0x5661d9+=0x1){_0x9d74c8=_0x3396e0[_0x5661d9]['get']({'plain':!![]});switch(_0x9d74c8[_0xd4df('0x32')]){case _0xd4df('0x36'):_0x2330c6(_0x9d74c8)[_0xd4df('0x27')](_0x3175e2());break;case _0xd4df('0x37'):_0x122a1b(_0x9d74c8)['catch'](_0x3175e2());break;default:_0x9c929(_0x9d74c8,_0x299a62)[_0xd4df('0x20')](function(_0x1adcfb){_0x299a62['scheduledat']=_0x1adcfb[_0xd4df('0x21')];_0x33871d['CmHopper'][_0xd4df('0x24')]({'phone':_0x299a62[_0xd4df('0x8')],'ContactId':_0x299a62['id'],'ListId':_0x299a62['ListId'],'scheduledat':_0x299a62[_0xd4df('0x16')]?_0x299a62[_0xd4df('0x16')]:moment()[_0xd4df('0x1e')](_0xd4df('0x1f')),'priority':_0x299a62[_0xd4df('0x25')]?_0x299a62[_0xd4df('0x25')]:0x2,'callback':_0x299a62['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x299a62['callbackUniqueid']?_0x299a62['callbackUniqueid']:undefined,'callbackat':_0x299a62[_0xd4df('0x26')]?moment()[_0xd4df('0x1e')](_0xd4df('0x1f')):undefined,'VoiceQueueId':_0x9d74c8['id']})[_0xd4df('0x27')](_0x3175e2());});}}}})[_0xd4df('0x20')](function(){return _0x33871d[_0xd4df('0x19')][_0xd4df('0x30')]({'where':{'type':_0xd4df('0x31')},'attributes':['id'],'include':[{'model':_0x33871d['CmList'],'as':_0xd4df('0x38'),'where':{'id':_0x299a62[_0xd4df('0x2b')]}}]})[_0xd4df('0x20')](function(_0x271382){if(_0x271382){var _0x33370c=[];for(var _0x22d334=0x0,_0x4fd167;_0x22d334<_0x271382[_0xd4df('0x35')];_0x22d334+=0x1){_0x4fd167=_0x271382[_0x22d334][_0xd4df('0x39')]({'plain':!![]});_0x33871d['CmHopperBlack'][_0xd4df('0x24')]({'phone':_0x299a62[_0xd4df('0x8')],'ContactId':_0x299a62['id'],'ListId':_0x299a62[_0xd4df('0x2b')],'VoiceQueueId':_0x4fd167['id']})['catch'](function(_0x4b63f7){logger[_0xd4df('0x12')]('cmContact,\x20%s,\x20%s',_0xd4df('0x14'),_0x4b63f7['message']);});}}});})[_0xd4df('0x20')](function(){return _0x33871d['Campaign'][_0xd4df('0x30')]({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x33871d[_0xd4df('0x33')],'as':_0xd4df('0x34'),'where':{'id':_0x299a62[_0xd4df('0x2b')]}}]})[_0xd4df('0x20')](function(_0x4c5f53){if(_0x4c5f53){var _0x52fd01=[];for(var _0x326772=0x0,_0x164444;_0x326772<_0x4c5f53[_0xd4df('0x35')];_0x326772+=0x1){_0x164444=_0x4c5f53[_0x326772]['get']({'plain':!![]});switch(_0x164444[_0xd4df('0x32')]){case _0xd4df('0x36'):_0x56c76b(_0x164444)[_0xd4df('0x27')](_0xffe26f());break;case _0xd4df('0x37'):_0x485166(_0x164444)[_0xd4df('0x27')](_0xffe26f());break;default:_0x33871d[_0xd4df('0x22')][_0xd4df('0x24')]({'phone':_0x299a62[_0xd4df('0x8')],'ContactId':_0x299a62['id'],'ListId':_0x299a62[_0xd4df('0x2b')],'scheduledat':_0x299a62[_0xd4df('0x16')]?_0x299a62[_0xd4df('0x16')]:moment()[_0xd4df('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x299a62[_0xd4df('0x25')]?_0x299a62[_0xd4df('0x25')]:0x2,'callback':_0x299a62['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x299a62[_0xd4df('0x26')]?_0x299a62[_0xd4df('0x26')]:undefined,'callbackat':_0x299a62['callbackUniqueid']?moment()[_0xd4df('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x164444['id']})[_0xd4df('0x27')](_0xffe26f());}}}});})[_0xd4df('0x20')](function(){return _0x33871d[_0xd4df('0x2c')]['findAll']({'attributes':['id'],'include':[{'model':_0x33871d[_0xd4df('0x33')],'as':_0xd4df('0x38'),'where':{'id':_0x299a62[_0xd4df('0x2b')]}}]})[_0xd4df('0x20')](function(_0x2b4ca2){if(_0x2b4ca2){var _0x2c734d=[];for(var _0x183161=0x0,_0x53dc84;_0x183161<_0x2b4ca2[_0xd4df('0x35')];_0x183161+=0x1){_0x53dc84=_0x2b4ca2[_0x183161][_0xd4df('0x39')]({'plain':!![]});_0x33871d[_0xd4df('0x3a')][_0xd4df('0x24')]({'phone':_0x299a62[_0xd4df('0x8')],'ContactId':_0x299a62['id'],'ListId':_0x299a62[_0xd4df('0x2b')],'CampaignId':_0x53dc84['id']})[_0xd4df('0x27')](function(_0xa7dae0){logger['error'](_0xd4df('0x3b'),_0xd4df('0x14'),_0xa7dae0['message']);});}}});})[_0xd4df('0x20')](function(){_0x5380ff();})[_0xd4df('0x27')](function(_0x2cfe58){logger[_0xd4df('0x12')](_0xd4df('0x3b'),_0xd4df('0x14'),_0x2cfe58['message']);_0x5380ff(_0x2cfe58);});}else{_0x5380ff(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x5271bf,_0x409690,_0x1e4f3a){var _0x59566b=_0xd20865[_0xd4df('0x11')];var _0x5e8a48=_0x5271bf['get']({'plain':!![]});return _0x59566b[_0xd4df('0x22')][_0xd4df('0x30')]({'raw':!![],'where':{'ListId':_0x5e8a48['ListId'],'ContactId':_0x5e8a48['id']}})['then'](function(_0x4f7edf){if(!_['isEmpty'](_0x4f7edf)){var _0x841ba=[];for(var _0x42d09d=0x0;_0x42d09d<_0x4f7edf['length'];_0x42d09d+=0x1){var _0xe6c59b=_0x59566b[_0xd4df('0x22')][_0xd4df('0x3c')]({'where':{'ListId':_0x4f7edf[_0x42d09d][_0xd4df('0x2b')],'ContactId':_0x4f7edf[_0x42d09d][_0xd4df('0x3d')],'VoiceQueueId':_0x4f7edf[_0x42d09d]['VoiceQueueId'],'CampaignId':_0x4f7edf[_0x42d09d][_0xd4df('0x3e')]}});_0x841ba[_0xd4df('0x3f')](_0xe6c59b);}return BPromise['all'](_0x841ba);}})[_0xd4df('0x20')](function(_0x4518da){logger[_0xd4df('0x40')](_0xd4df('0x41'),util[_0xd4df('0x15')](_0x4518da,{'showHidden':![],'depth':null}));_0x1e4f3a();})['catch'](function(_0x208f96){logger[_0xd4df('0x12')](_0xd4df('0x42'),util[_0xd4df('0x15')](_0x208f96,{'showHidden':![],'depth':null}));_0x1e4f3a(_0x208f96);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index f51ea54..761f7b6 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0xeccb4,_0x3e6b44){var _0x75e2a7=function(_0x3c2b66){while(--_0x3c2b66){_0xeccb4['push'](_0xeccb4['shift']());}};_0x75e2a7(++_0x3e6b44);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x4526aa,_0xd497){var _0xf45b74=function(_0x46a990){while(--_0x46a990){_0x4526aa['push'](_0x4526aa['shift']());}};_0xf45b74(++_0xd497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 76c9a73..5a892ac 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 _0x0f69=['STRING','INTEGER'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x0f69,0x173));var _0x90f6=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x0f69[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0x90f6('0x0')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x90f6('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x90f6('0x1')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x90f6('0x0')],'defaultValue':null},'description':{'type':Sequelize[_0x90f6('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0x871e=['sequelize','INTEGER','STRING'];(function(_0x543463,_0x5421b6){var _0x1be9a4=function(_0x58dffd){while(--_0x58dffd){_0x543463['push'](_0x543463['shift']());}};_0x1be9a4(++_0x5421b6);}(_0x871e,0x1b0));var _0xe871=function(_0x12a918,_0x871b78){_0x12a918=_0x12a918-0x0;var _0x17d571=_0x871e[_0x12a918];return _0x17d571;};'use strict';var Sequelize=require(_0xe871('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xe871('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xe871('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xe871('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xe871('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xe871('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xe871('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 1b309f5..9837c7a 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 _0xf81e=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','json','offset','undefined','limit','count','status','set','update','then','destroy','get','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','role','user','UserProfileSection','autoAssociation','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xf81e,0x8c));var _0xef81=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf81e[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xef81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef81('0x1'));var jsonpatch=require(_0xef81('0x2'));var rp=require(_0xef81('0x3'));var moment=require(_0xef81('0x4'));var BPromise=require(_0xef81('0x5'));var Mustache=require('mustache');var util=require(_0xef81('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xef81('0x7'));var ejs=require(_0xef81('0x8'));var fs=require('fs');var fs_extra=require(_0xef81('0x9'));var _=require('lodash');var squel=require(_0xef81('0xa'));var crypto=require(_0xef81('0xb'));var jsforce=require(_0xef81('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xef81('0x7'));var querystring=require(_0xef81('0xd'));var Papa=require(_0xef81('0xe'));var Redis=require(_0xef81('0xf'));var authService=require(_0xef81('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xef81('0x11'));var hardwareService=require(_0xef81('0x12'));var logger=require(_0xef81('0x13'))(_0xef81('0x14'));var utils=require(_0xef81('0x15'));var config=require(_0xef81('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cc5b1,_0x4942ef){_0x4942ef=_0x4942ef||0xcc;return function(_0x79c48f){if(_0x79c48f){return _0x2cc5b1['sendStatus'](_0x4942ef);}return _0x2cc5b1['status'](_0x4942ef)[_0xef81('0x17')]();};}function respondWithResult(_0x32bfd5,_0x57c622){_0x57c622=_0x57c622||0xc8;return function(_0x46035b){if(_0x46035b){return _0x32bfd5['status'](_0x57c622)[_0xef81('0x18')](_0x46035b);}};}function respondWithFilteredResult(_0x466237,_0x5179ed){return function(_0x28c9f4){if(_0x28c9f4){var _0x1f1ea3=typeof _0x5179ed[_0xef81('0x19')]===_0xef81('0x1a')&&typeof _0x5179ed[_0xef81('0x1b')]===_0xef81('0x1a');var _0x56e9e6=_0x28c9f4[_0xef81('0x1c')];var _0x4db1ac=_0x1f1ea3?0x0:_0x5179ed[_0xef81('0x19')];var _0x3a4313=_0x1f1ea3?_0x28c9f4[_0xef81('0x1c')]:_0x5179ed['offset']+_0x5179ed[_0xef81('0x1b')];var _0x227a0c;if(_0x3a4313>=_0x56e9e6){_0x3a4313=_0x56e9e6;_0x227a0c=0xc8;}else{_0x227a0c=0xce;}_0x466237[_0xef81('0x1d')](_0x227a0c);return _0x466237[_0xef81('0x1e')]('Content-Range',_0x4db1ac+'-'+_0x3a4313+'/'+_0x56e9e6)[_0xef81('0x18')](_0x28c9f4);}return null;};}function patchUpdates(_0x4092ca){return function(_0xb8fabf){try{jsonpatch['apply'](_0xb8fabf,_0x4092ca,!![]);}catch(_0x233500){return BPromise['reject'](_0x233500);}return _0xb8fabf['save']();};}function saveUpdates(_0x6a8c2b,_0x4d02ad){return function(_0xea11c7){if(_0xea11c7){return _0xea11c7[_0xef81('0x1f')](_0x6a8c2b)[_0xef81('0x20')](function(_0x344856){return _0x344856;});}return null;};}function removeEntity(_0x5e65eb,_0x105edd){return function(_0x2114b3){if(_0x2114b3){return _0x2114b3[_0xef81('0x21')]()[_0xef81('0x20')](function(){var _0x12f52=_0x2114b3[_0xef81('0x22')]({'plain':!![]});var _0x1e1cf9=_0xef81('0x23');return db[_0xef81('0x24')][_0xef81('0x21')]({'where':{'type':_0x1e1cf9,'resourceId':_0x12f52['id']}})[_0xef81('0x20')](function(){return _0x2114b3;});})[_0xef81('0x20')](function(){_0x5e65eb[_0xef81('0x1d')](0xcc)[_0xef81('0x17')]();});}};}function handleEntityNotFound(_0xa40910,_0x48cdda){return function(_0x463725){if(!_0x463725){_0xa40910[_0xef81('0x25')](0x194);}return _0x463725;};}function handleError(_0x43b4da,_0x386d8a){_0x386d8a=_0x386d8a||0x1f4;return function(_0x2123e1){logger[_0xef81('0x26')](_0x2123e1[_0xef81('0x27')]);if(_0x2123e1[_0xef81('0x28')]){delete _0x2123e1[_0xef81('0x28')];}_0x43b4da[_0xef81('0x1d')](_0x386d8a)[_0xef81('0x29')](_0x2123e1);};}exports[_0xef81('0x2a')]=function(_0x111cfb,_0x38e78c){var _0x2fbd41={},_0x1645cd={},_0x4eedc0={'count':0x0,'rows':[]};var _0x3123d0=_[_0xef81('0x2b')](db[_0xef81('0x2c')][_0xef81('0x2d')],function(_0x3c8eb6){return{'name':_0x3c8eb6['fieldName'],'type':_0x3c8eb6[_0xef81('0x2e')]['key']};});_0x1645cd['model']=_['map'](_0x3123d0,_0xef81('0x28'));_0x1645cd[_0xef81('0x2f')]=_[_0xef81('0x30')](_0x111cfb[_0xef81('0x2f')]);_0x1645cd['filters']=_[_0xef81('0x31')](_0x1645cd[_0xef81('0x32')],_0x1645cd['query']);_0x2fbd41[_0xef81('0x33')]=_[_0xef81('0x31')](_0x1645cd[_0xef81('0x32')],qs['fields'](_0x111cfb[_0xef81('0x2f')][_0xef81('0x34')]));_0x2fbd41['attributes']=_0x2fbd41[_0xef81('0x33')][_0xef81('0x35')]?_0x2fbd41[_0xef81('0x33')]:_0x1645cd['model'];if(!_0x111cfb[_0xef81('0x2f')][_0xef81('0x36')](_0xef81('0x37'))){_0x2fbd41[_0xef81('0x1b')]=qs[_0xef81('0x1b')](_0x111cfb['query'][_0xef81('0x1b')]);_0x2fbd41[_0xef81('0x19')]=qs[_0xef81('0x19')](_0x111cfb[_0xef81('0x2f')]['offset']);}_0x2fbd41[_0xef81('0x38')]=qs[_0xef81('0x39')](_0x111cfb[_0xef81('0x2f')][_0xef81('0x39')]);_0x2fbd41['where']=qs[_0xef81('0x3a')](_[_0xef81('0x3b')](_0x111cfb['query'],_0x1645cd['filters']),_0x3123d0);if(_0x111cfb[_0xef81('0x2f')][_0xef81('0x3c')]){_0x2fbd41[_0xef81('0x3d')]=_['merge'](_0x2fbd41[_0xef81('0x3d')],{'$or':_[_0xef81('0x2b')](_0x3123d0,function(_0x114e3b){if(_0x114e3b[_0xef81('0x2e')]!==_0xef81('0x3e')){var _0x4c6c49={};_0x4c6c49[_0x114e3b['name']]={'$like':'%'+_0x111cfb[_0xef81('0x2f')]['filter']+'%'};return _0x4c6c49;}})});}_0x2fbd41=_[_0xef81('0x3f')]({},_0x2fbd41,_0x111cfb[_0xef81('0x40')]);var _0xa377a2={'where':_0x2fbd41[_0xef81('0x3d')]};return db['CmContactHasItem'][_0xef81('0x1c')](_0xa377a2)[_0xef81('0x20')](function(_0x2c8ab6){_0x4eedc0[_0xef81('0x1c')]=_0x2c8ab6;if(_0x111cfb[_0xef81('0x2f')][_0xef81('0x41')]){_0x2fbd41[_0xef81('0x42')]=[{'all':!![]}];}return db[_0xef81('0x2c')][_0xef81('0x43')](_0x2fbd41);})[_0xef81('0x20')](function(_0x32797d){_0x4eedc0['rows']=_0x32797d;return _0x4eedc0;})['then'](respondWithFilteredResult(_0x38e78c,_0x2fbd41))[_0xef81('0x44')](handleError(_0x38e78c,null));};exports[_0xef81('0x45')]=function(_0x37ea6b,_0x180cef){var _0x3db7e6={'raw':!![],'where':{'id':_0x37ea6b['params']['id']}},_0x18e8e3={};_0x18e8e3[_0xef81('0x32')]=_[_0xef81('0x30')](db['CmContactHasItem']['rawAttributes']);_0x18e8e3[_0xef81('0x2f')]=_[_0xef81('0x30')](_0x37ea6b[_0xef81('0x2f')]);_0x18e8e3[_0xef81('0x3a')]=_['intersection'](_0x18e8e3[_0xef81('0x32')],_0x18e8e3['query']);_0x3db7e6[_0xef81('0x33')]=_[_0xef81('0x31')](_0x18e8e3[_0xef81('0x32')],qs['fields'](_0x37ea6b['query']['fields']));_0x3db7e6['attributes']=_0x3db7e6[_0xef81('0x33')][_0xef81('0x35')]?_0x3db7e6[_0xef81('0x33')]:_0x18e8e3['model'];if(_0x37ea6b[_0xef81('0x2f')][_0xef81('0x41')]){_0x3db7e6[_0xef81('0x42')]=[{'all':!![]}];}_0x3db7e6=_[_0xef81('0x3f')]({},_0x3db7e6,_0x37ea6b[_0xef81('0x40')]);return db[_0xef81('0x2c')][_0xef81('0x46')](_0x3db7e6)[_0xef81('0x20')](handleEntityNotFound(_0x180cef,null))[_0xef81('0x20')](respondWithResult(_0x180cef,null))['catch'](handleError(_0x180cef,null));};exports['create']=function(_0x2e9c97,_0x1846a7){return db[_0xef81('0x2c')][_0xef81('0x47')](_0x2e9c97['body'],{})[_0xef81('0x20')](function(_0x16b1d2){var _0x20b695=_0x2e9c97['user'][_0xef81('0x22')]({'plain':!![]});if(!_0x20b695)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20b695[_0xef81('0x48')]===_0xef81('0x49')){var _0x1c0cbc=_0x16b1d2[_0xef81('0x22')]({'plain':!![]});var _0x25abb8=_0xef81('0x23');return db[_0xef81('0x4a')][_0xef81('0x46')]({'where':{'name':_0x25abb8,'userProfileId':_0x20b695['userProfileId']},'raw':!![]})[_0xef81('0x20')](function(_0x417410){if(_0x417410&&_0x417410[_0xef81('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c0cbc[_0xef81('0x28')],'resourceId':_0x1c0cbc['id'],'type':_0x417410[_0xef81('0x28')],'sectionId':_0x417410['id']},{})[_0xef81('0x20')](function(){return _0x16b1d2;});}else{return _0x16b1d2;}})[_0xef81('0x44')](function(_0x2f07bf){logger[_0xef81('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f07bf);throw _0x2f07bf;});}return _0x16b1d2;})[_0xef81('0x20')](respondWithResult(_0x1846a7,0xc9))[_0xef81('0x44')](handleError(_0x1846a7,null));};exports[_0xef81('0x1f')]=function(_0x3900cf,_0x18493d){if(_0x3900cf[_0xef81('0x4c')]['id']){delete _0x3900cf[_0xef81('0x4c')]['id'];}return db[_0xef81('0x2c')][_0xef81('0x46')]({'where':{'id':_0x3900cf[_0xef81('0x4d')]['id']}})[_0xef81('0x20')](handleEntityNotFound(_0x18493d,null))['then'](saveUpdates(_0x3900cf[_0xef81('0x4c')],null))['then'](respondWithResult(_0x18493d,null))[_0xef81('0x44')](handleError(_0x18493d,null));};exports[_0xef81('0x21')]=function(_0x94148b,_0x2293a2){return db[_0xef81('0x2c')]['find']({'where':{'id':_0x94148b['params']['id']}})[_0xef81('0x20')](handleEntityNotFound(_0x2293a2,null))['then'](removeEntity(_0x2293a2,null))['catch'](handleError(_0x2293a2,null));}; \ No newline at end of file +var _0x2217=['attributes','length','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','CmContactHasItem','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','intersection','model','fields'];(function(_0x5d345b,_0x40234c){var _0x2d2b37=function(_0x15d479){while(--_0x15d479){_0x5d345b['push'](_0x5d345b['shift']());}};_0x2d2b37(++_0x40234c);}(_0x2217,0xb5));var _0x7221=function(_0x563a21,_0x236f38){_0x563a21=_0x563a21-0x0;var _0x505edd=_0x2217[_0x563a21];return _0x505edd;};'use strict';var emlformat=require(_0x7221('0x0'));var rimraf=require(_0x7221('0x1'));var zipdir=require(_0x7221('0x2'));var jsonpatch=require(_0x7221('0x3'));var rp=require(_0x7221('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7221('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7221('0x6'));var ejs=require(_0x7221('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7221('0x8'));var squel=require(_0x7221('0x9'));var crypto=require(_0x7221('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7221('0xb'));var toCsv=require(_0x7221('0x6'));var querystring=require(_0x7221('0xc'));var Papa=require(_0x7221('0xd'));var Redis=require('ioredis');var authService=require(_0x7221('0xe'));var qs=require(_0x7221('0xf'));var as=require(_0x7221('0x10'));var hardwareService=require(_0x7221('0x11'));var logger=require('../../config/logger')(_0x7221('0x12'));var utils=require(_0x7221('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289544,_0x1549e5){_0x1549e5=_0x1549e5||0xcc;return function(_0x9fa386){if(_0x9fa386){return _0x289544[_0x7221('0x14')](_0x1549e5);}return _0x289544['status'](_0x1549e5)[_0x7221('0x15')]();};}function respondWithResult(_0x4355b9,_0x1ac6b5){_0x1ac6b5=_0x1ac6b5||0xc8;return function(_0x4c73a5){if(_0x4c73a5){return _0x4355b9[_0x7221('0x16')](_0x1ac6b5)[_0x7221('0x17')](_0x4c73a5);}};}function respondWithFilteredResult(_0x5d8398,_0x1c3781){return function(_0x306572){if(_0x306572){var _0x563781=typeof _0x1c3781['offset']===_0x7221('0x18')&&typeof _0x1c3781[_0x7221('0x19')]===_0x7221('0x18');var _0x9b0d2b=_0x306572['count'];var _0xd7db06=_0x563781?0x0:_0x1c3781['offset'];var _0x53f71b=_0x563781?_0x306572[_0x7221('0x1a')]:_0x1c3781[_0x7221('0x1b')]+_0x1c3781[_0x7221('0x19')];var _0x43bb38;if(_0x53f71b>=_0x9b0d2b){_0x53f71b=_0x9b0d2b;_0x43bb38=0xc8;}else{_0x43bb38=0xce;}_0x5d8398['status'](_0x43bb38);return _0x5d8398['set'](_0x7221('0x1c'),_0xd7db06+'-'+_0x53f71b+'/'+_0x9b0d2b)[_0x7221('0x17')](_0x306572);}return null;};}function patchUpdates(_0x2b278c){return function(_0x381f68){try{jsonpatch[_0x7221('0x1d')](_0x381f68,_0x2b278c,!![]);}catch(_0x562476){return BPromise[_0x7221('0x1e')](_0x562476);}return _0x381f68[_0x7221('0x1f')]();};}function saveUpdates(_0x2b596e,_0x44585a){return function(_0x4add3e){if(_0x4add3e){return _0x4add3e[_0x7221('0x20')](_0x2b596e)[_0x7221('0x21')](function(_0x88543d){return _0x88543d;});}return null;};}function removeEntity(_0x198ab2,_0x5632a7){return function(_0x4343f0){if(_0x4343f0){return _0x4343f0[_0x7221('0x22')]()['then'](function(){var _0x15ef8f=_0x4343f0[_0x7221('0x23')]({'plain':!![]});var _0x5667b4='CmContactHasItems';return db[_0x7221('0x24')][_0x7221('0x22')]({'where':{'type':_0x5667b4,'resourceId':_0x15ef8f['id']}})[_0x7221('0x21')](function(){return _0x4343f0;});})[_0x7221('0x21')](function(){_0x198ab2['status'](0xcc)[_0x7221('0x15')]();});}};}function handleEntityNotFound(_0xb37cd4,_0x334434){return function(_0x478adf){if(!_0x478adf){_0xb37cd4[_0x7221('0x14')](0x194);}return _0x478adf;};}function handleError(_0x18f428,_0x503cc4){_0x503cc4=_0x503cc4||0x1f4;return function(_0x6ac888){logger[_0x7221('0x25')](_0x6ac888[_0x7221('0x26')]);if(_0x6ac888[_0x7221('0x27')]){delete _0x6ac888[_0x7221('0x27')];}_0x18f428[_0x7221('0x16')](_0x503cc4)[_0x7221('0x28')](_0x6ac888);};}exports[_0x7221('0x29')]=function(_0x11c447,_0x2961b6){var _0x34f8d9={},_0x45fbca={},_0x3cc649={'count':0x0,'rows':[]};var _0x51e135=_[_0x7221('0x2a')](db['CmContactHasItem'][_0x7221('0x2b')],function(_0x256175){return{'name':_0x256175[_0x7221('0x2c')],'type':_0x256175['type'][_0x7221('0x2d')]};});_0x45fbca['model']=_['map'](_0x51e135,_0x7221('0x27'));_0x45fbca['query']=_['keys'](_0x11c447[_0x7221('0x2e')]);_0x45fbca['filters']=_[_0x7221('0x2f')](_0x45fbca[_0x7221('0x30')],_0x45fbca[_0x7221('0x2e')]);_0x34f8d9['attributes']=_[_0x7221('0x2f')](_0x45fbca[_0x7221('0x30')],qs[_0x7221('0x31')](_0x11c447[_0x7221('0x2e')][_0x7221('0x31')]));_0x34f8d9['attributes']=_0x34f8d9[_0x7221('0x32')][_0x7221('0x33')]?_0x34f8d9[_0x7221('0x32')]:_0x45fbca[_0x7221('0x30')];if(!_0x11c447[_0x7221('0x2e')]['hasOwnProperty'](_0x7221('0x34'))){_0x34f8d9[_0x7221('0x19')]=qs[_0x7221('0x19')](_0x11c447[_0x7221('0x2e')][_0x7221('0x19')]);_0x34f8d9['offset']=qs[_0x7221('0x1b')](_0x11c447[_0x7221('0x2e')][_0x7221('0x1b')]);}_0x34f8d9['order']=qs[_0x7221('0x35')](_0x11c447[_0x7221('0x2e')][_0x7221('0x35')]);_0x34f8d9[_0x7221('0x36')]=qs[_0x7221('0x37')](_['pick'](_0x11c447['query'],_0x45fbca[_0x7221('0x37')]),_0x51e135);if(_0x11c447[_0x7221('0x2e')][_0x7221('0x38')]){_0x34f8d9[_0x7221('0x36')]=_[_0x7221('0x39')](_0x34f8d9[_0x7221('0x36')],{'$or':_['map'](_0x51e135,function(_0x55532d){if(_0x55532d[_0x7221('0x3a')]!==_0x7221('0x3b')){var _0x32dbe3={};_0x32dbe3[_0x55532d[_0x7221('0x27')]]={'$like':'%'+_0x11c447['query'][_0x7221('0x38')]+'%'};return _0x32dbe3;}})});}_0x34f8d9=_[_0x7221('0x39')]({},_0x34f8d9,_0x11c447[_0x7221('0x3c')]);var _0x34595b={'where':_0x34f8d9[_0x7221('0x36')]};return db['CmContactHasItem'][_0x7221('0x1a')](_0x34595b)[_0x7221('0x21')](function(_0x1a6434){_0x3cc649[_0x7221('0x1a')]=_0x1a6434;if(_0x11c447[_0x7221('0x2e')][_0x7221('0x3d')]){_0x34f8d9[_0x7221('0x3e')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x7221('0x3f')](_0x34f8d9);})[_0x7221('0x21')](function(_0x2688f1){_0x3cc649['rows']=_0x2688f1;return _0x3cc649;})[_0x7221('0x21')](respondWithFilteredResult(_0x2961b6,_0x34f8d9))[_0x7221('0x40')](handleError(_0x2961b6,null));};exports[_0x7221('0x41')]=function(_0x1a842b,_0x3b939c){var _0x1dc6ca={'raw':!![],'where':{'id':_0x1a842b[_0x7221('0x42')]['id']}},_0x175e7f={};_0x175e7f[_0x7221('0x30')]=_[_0x7221('0x43')](db['CmContactHasItem'][_0x7221('0x2b')]);_0x175e7f[_0x7221('0x2e')]=_[_0x7221('0x43')](_0x1a842b[_0x7221('0x2e')]);_0x175e7f[_0x7221('0x37')]=_['intersection'](_0x175e7f[_0x7221('0x30')],_0x175e7f[_0x7221('0x2e')]);_0x1dc6ca['attributes']=_['intersection'](_0x175e7f['model'],qs[_0x7221('0x31')](_0x1a842b[_0x7221('0x2e')]['fields']));_0x1dc6ca['attributes']=_0x1dc6ca['attributes'][_0x7221('0x33')]?_0x1dc6ca['attributes']:_0x175e7f[_0x7221('0x30')];if(_0x1a842b[_0x7221('0x2e')]['includeAll']){_0x1dc6ca[_0x7221('0x3e')]=[{'all':!![]}];}_0x1dc6ca=_[_0x7221('0x39')]({},_0x1dc6ca,_0x1a842b['options']);return db[_0x7221('0x44')][_0x7221('0x45')](_0x1dc6ca)[_0x7221('0x21')](handleEntityNotFound(_0x3b939c,null))['then'](respondWithResult(_0x3b939c,null))[_0x7221('0x40')](handleError(_0x3b939c,null));};exports['create']=function(_0x544135,_0x3253e8){return db['CmContactHasItem'][_0x7221('0x46')](_0x544135[_0x7221('0x47')],{})[_0x7221('0x21')](function(_0x3cee9c){var _0x442ba2=_0x544135['user'][_0x7221('0x23')]({'plain':!![]});if(!_0x442ba2)throw new Error(_0x7221('0x48'));if(_0x442ba2[_0x7221('0x49')]===_0x7221('0x4a')){var _0x238770=_0x3cee9c['get']({'plain':!![]});var _0x2048ec='CmContactHasItems';return db[_0x7221('0x4b')]['find']({'where':{'name':_0x2048ec,'userProfileId':_0x442ba2['userProfileId']},'raw':!![]})[_0x7221('0x21')](function(_0x3a8cf4){if(_0x3a8cf4&&_0x3a8cf4['autoAssociation']===0x0){return db[_0x7221('0x24')][_0x7221('0x46')]({'name':_0x238770[_0x7221('0x27')],'resourceId':_0x238770['id'],'type':_0x3a8cf4[_0x7221('0x27')],'sectionId':_0x3a8cf4['id']},{})[_0x7221('0x21')](function(){return _0x3cee9c;});}else{return _0x3cee9c;}})[_0x7221('0x40')](function(_0x48467a){logger[_0x7221('0x25')](_0x7221('0x4c'),_0x48467a);throw _0x48467a;});}return _0x3cee9c;})[_0x7221('0x21')](respondWithResult(_0x3253e8,0xc9))[_0x7221('0x40')](handleError(_0x3253e8,null));};exports['update']=function(_0x35c3e4,_0x18a64e){if(_0x35c3e4[_0x7221('0x47')]['id']){delete _0x35c3e4[_0x7221('0x47')]['id'];}return db['CmContactHasItem'][_0x7221('0x45')]({'where':{'id':_0x35c3e4[_0x7221('0x42')]['id']}})[_0x7221('0x21')](handleEntityNotFound(_0x18a64e,null))['then'](saveUpdates(_0x35c3e4[_0x7221('0x47')],null))[_0x7221('0x21')](respondWithResult(_0x18a64e,null))[_0x7221('0x40')](handleError(_0x18a64e,null));};exports['destroy']=function(_0x571b5d,_0x2de83c){return db['CmContactHasItem'][_0x7221('0x45')]({'where':{'id':_0x571b5d[_0x7221('0x42')]['id']}})[_0x7221('0x21')](handleEntityNotFound(_0x2de83c,null))['then'](removeEntity(_0x2de83c,null))[_0x7221('0x40')](handleError(_0x2de83c,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 0e96aa1..839269e 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 _0x2c4b=['exports','define','CmContactHasItem','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x3859b4,_0x542748){var _0x48f59c=function(_0x531610){while(--_0x531610){_0x3859b4['push'](_0x3859b4['shift']());}};_0x48f59c(++_0x542748);}(_0x2c4b,0xea));var _0xb2c4=function(_0x107ba0,_0xf83ce){_0x107ba0=_0x107ba0-0x0;var _0x1e0128=_0x2c4b[_0x107ba0];return _0x1e0128;};'use strict';var _=require(_0xb2c4('0x0'));var util=require(_0xb2c4('0x1'));var logger=require(_0xb2c4('0x2'))('api');var moment=require(_0xb2c4('0x3'));var BPromise=require(_0xb2c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2c4('0x5'));var config=require(_0xb2c4('0x6'));var attributes=require(_0xb2c4('0x7'));module[_0xb2c4('0x8')]=function(_0x517ad6,_0x3a3546){return _0x517ad6[_0xb2c4('0x9')](_0xb2c4('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4a7=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xe4a7,0x111));var _0x7e4a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe4a7[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7e4a('0x0'));var util=require(_0x7e4a('0x1'));var logger=require(_0x7e4a('0x2'))('api');var moment=require(_0x7e4a('0x3'));var BPromise=require(_0x7e4a('0x4'));var rp=require(_0x7e4a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e4a('0x6'));var config=require(_0x7e4a('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0x7e4a('0x8')]=function(_0x3b0ff2,_0x505649){return _0x3b0ff2[_0x7e4a('0x9')](_0x7e4a('0xa'),attributes,{'tableName':_0x7e4a('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 e39120a..4b1a791 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 _0x77bb=['code','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1f77d5,_0x1ffe37){var _0x41f34b=function(_0x259f3c){while(--_0x259f3c){_0x1f77d5['push'](_0x1f77d5['shift']());}};_0x41f34b(++_0x1ffe37);}(_0x77bb,0xe6));var _0xb77b=function(_0x2c7972,_0x4efb41){_0x2c7972=_0x2c7972-0x0;var _0x4ca1dd=_0x77bb[_0x2c7972];return _0x4ca1dd;};'use strict';var _=require(_0xb77b('0x0'));var util=require(_0xb77b('0x1'));var moment=require(_0xb77b('0x2'));var BPromise=require(_0xb77b('0x3'));var rs=require(_0xb77b('0x4'));var fs=require('fs');var Redis=require(_0xb77b('0x5'));var db=require(_0xb77b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb77b('0x7'))(_0xb77b('0x8'));var config=require(_0xb77b('0x9'));var jayson=require(_0xb77b('0xa'));var client=jayson[_0xb77b('0xb')][_0xb77b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x435167,_0x6b54e4,_0x5b2aa7){return new BPromise(function(_0x1ecc35,_0x17b4b0){return client[_0xb77b('0xd')](_0x435167,_0x5b2aa7)[_0xb77b('0xe')](function(_0x51fa9b){logger['info'](_0xb77b('0xf'),_0x6b54e4,_0xb77b('0x10'));logger[_0xb77b('0x11')](_0xb77b('0x12'),_0x6b54e4,_0xb77b('0x10'),JSON[_0xb77b('0x13')](_0x51fa9b));if(_0x51fa9b['error']){if(_0x51fa9b['error'][_0xb77b('0x14')]===0x1f4){logger[_0xb77b('0x15')](_0xb77b('0xf'),_0x6b54e4,_0x51fa9b[_0xb77b('0x15')][_0xb77b('0x16')]);return _0x17b4b0(_0x51fa9b[_0xb77b('0x15')][_0xb77b('0x16')]);}logger[_0xb77b('0x15')]('CmContactHasItem,\x20%s,\x20%s',_0x6b54e4,_0x51fa9b[_0xb77b('0x15')]['message']);return _0x1ecc35(_0x51fa9b['error']['message']);}else{logger[_0xb77b('0x17')]('CmContactHasItem,\x20%s,\x20%s',_0x6b54e4,_0xb77b('0x10'));_0x1ecc35(_0x51fa9b[_0xb77b('0x18')][_0xb77b('0x16')]);}})['catch'](function(_0x5543f0){logger[_0xb77b('0x15')](_0xb77b('0xf'),_0x6b54e4,_0x5543f0);_0x17b4b0(_0x5543f0);});});} \ No newline at end of file +var _0xb847=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x3f0d4f,_0x282677){var _0x175bd3=function(_0x55cd82){while(--_0x55cd82){_0x3f0d4f['push'](_0x3f0d4f['shift']());}};_0x175bd3(++_0x282677);}(_0xb847,0xc4));var _0x7b84=function(_0x4109e7,_0x2c8158){_0x4109e7=_0x4109e7-0x0;var _0x28d807=_0xb847[_0x4109e7];return _0x28d807;};'use strict';var _=require(_0x7b84('0x0'));var util=require(_0x7b84('0x1'));var moment=require('moment');var BPromise=require(_0x7b84('0x2'));var rs=require(_0x7b84('0x3'));var fs=require('fs');var Redis=require(_0x7b84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b84('0x5'));var logger=require(_0x7b84('0x6'))(_0x7b84('0x7'));var config=require(_0x7b84('0x8'));var jayson=require(_0x7b84('0x9'));var client=jayson['client'][_0x7b84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x589d14,_0x444979,_0x17bfd6){return new BPromise(function(_0xe7b5e2,_0x40a49d){return client['request'](_0x589d14,_0x17bfd6)[_0x7b84('0xb')](function(_0x1187a6){logger[_0x7b84('0xc')](_0x7b84('0xd'),_0x444979,_0x7b84('0xe'));logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x444979,_0x7b84('0xe'),JSON[_0x7b84('0xf')](_0x1187a6));if(_0x1187a6[_0x7b84('0x10')]){if(_0x1187a6[_0x7b84('0x10')][_0x7b84('0x11')]===0x1f4){logger[_0x7b84('0x10')](_0x7b84('0xd'),_0x444979,_0x1187a6[_0x7b84('0x10')][_0x7b84('0x12')]);return _0x40a49d(_0x1187a6[_0x7b84('0x10')][_0x7b84('0x12')]);}logger[_0x7b84('0x10')](_0x7b84('0xd'),_0x444979,_0x1187a6['error'][_0x7b84('0x12')]);return _0xe7b5e2(_0x1187a6[_0x7b84('0x10')][_0x7b84('0x12')]);}else{logger['info'](_0x7b84('0xd'),_0x444979,'request\x20sent');_0xe7b5e2(_0x1187a6[_0x7b84('0x13')][_0x7b84('0x12')]);}})['catch'](function(_0x466c02){logger[_0x7b84('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x444979,_0x466c02);_0x40a49d(_0x466c02);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index b0eaecb..d459078 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 _0x93cf=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','post'];(function(_0x2f742b,_0x2565c5){var _0x4f363b=function(_0x14f922){while(--_0x14f922){_0x2f742b['push'](_0x2f742b['shift']());}};_0x4f363b(++_0x2565c5);}(_0x93cf,0x181));var _0xf93c=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x93cf[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xf93c('0x0'));var util=require(_0xf93c('0x1'));var path=require(_0xf93c('0x2'));var timeout=require(_0xf93c('0x3'));var express=require(_0xf93c('0x4'));var router=express[_0xf93c('0x5')]();var fs_extra=require(_0xf93c('0x6'));var auth=require(_0xf93c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0xf93c('0x8')]('/',auth[_0xf93c('0x9')](),controller[_0xf93c('0xa')]);router[_0xf93c('0x8')](_0xf93c('0xb'),auth[_0xf93c('0x9')](),controller[_0xf93c('0xc')]);router[_0xf93c('0xd')]('/',auth[_0xf93c('0x9')](),controller[_0xf93c('0xe')]);router[_0xf93c('0xf')](_0xf93c('0xb'),auth[_0xf93c('0x9')](),controller[_0xf93c('0x10')]);router[_0xf93c('0x11')](_0xf93c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xf93c('0x12')]=router; \ No newline at end of file +var _0x758f=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','isAuthenticated','index','get','/:id','create','put','update','delete','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x758f,0x187));var _0xf758=function(_0x1eb186,_0x3e8197){_0x1eb186=_0x1eb186-0x0;var _0x49079e=_0x758f[_0x1eb186];return _0x49079e;};'use strict';var multer=require('multer');var util=require(_0xf758('0x0'));var path=require(_0xf758('0x1'));var timeout=require('connect-timeout');var express=require(_0xf758('0x2'));var router=express[_0xf758('0x3')]();var fs_extra=require(_0xf758('0x4'));var auth=require(_0xf758('0x5'));var interaction=require(_0xf758('0x6'));var config=require('../../config/environment');var controller=require(_0xf758('0x7'));router['get']('/',auth[_0xf758('0x8')](),controller[_0xf758('0x9')]);router[_0xf758('0xa')](_0xf758('0xb'),auth[_0xf758('0x8')](),controller['show']);router['post']('/',auth[_0xf758('0x8')](),controller[_0xf758('0xc')]);router[_0xf758('0xd')](_0xf758('0xb'),auth[_0xf758('0x8')](),controller[_0xf758('0xe')]);router[_0xf758('0xf')](_0xf758('0xb'),auth[_0xf758('0x8')](),controller['destroy']);module[_0xf758('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 2c4b919..0a05ec1 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 _0x2dd1=['setDataValue','name','TEXT','long','getDataValue','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','alias','STRING'];(function(_0x742be2,_0x20a767){var _0x5d29f6=function(_0x43f46d){while(--_0x43f46d){_0x742be2['push'](_0x742be2['shift']());}};_0x5d29f6(++_0x20a767);}(_0x2dd1,0x1be));var _0x12dd=function(_0xb95823,_0x1fa7fe){_0xb95823=_0xb95823-0x0;var _0x4be3ae=_0x2dd1[_0xb95823];return _0x4be3ae;};'use strict';var Sequelize=require('sequelize');var _=require(_0x12dd('0x0'));module[_0x12dd('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xb557f7){return this['getDataValue'](_0x12dd('0x2'));}},'alias':{'type':Sequelize[_0x12dd('0x3')],'allowNull':![],'set':function(_0x44fc5e){this[_0x12dd('0x4')](_0x12dd('0x2'),_0x44fc5e?_0x44fc5e:this['getDataValue'](_0x12dd('0x5')));}},'type':{'type':Sequelize[_0x12dd('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x12dd('0x6')](_0x12dd('0x7')),'get':function(){if(this[_0x12dd('0x8')](_0x12dd('0x9'))===_0x12dd('0xa')){return JSON[_0x12dd('0xb')](this['getDataValue']('values'));}else{return this[_0x12dd('0x8')](_0x12dd('0xc'));}},'set':function(_0x332525){if(Array[_0x12dd('0xd')](_0x332525)){this[_0x12dd('0x4')](_0x12dd('0xc'),JSON[_0x12dd('0xe')](_0x332525));}else{this[_0x12dd('0x4')]('values',_0x332525);}}},'required':{'type':Sequelize[_0x12dd('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x12dd('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x12dd('0x10')](_0x12dd('0x11'))}}; \ No newline at end of file +var _0x01f4=['sequelize','lodash','exports','VIRTUAL','alias','STRING','name','long','type','parse','getDataValue','values','isArray','setDataValue','stringify','BOOLEAN','ENUM'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x01f4,0x132));var _0x401f=function(_0x59b5c3,_0x4993dc){_0x59b5c3=_0x59b5c3-0x0;var _0x3849a6=_0x01f4[_0x59b5c3];return _0x3849a6;};'use strict';var Sequelize=require(_0x401f('0x0'));var _=require(_0x401f('0x1'));module[_0x401f('0x2')]={'name':{'type':Sequelize[_0x401f('0x3')],'get':function(_0x3feda2){return this['getDataValue'](_0x401f('0x4'));}},'alias':{'type':Sequelize[_0x401f('0x5')],'allowNull':![],'set':function(_0x4e810f){this['setDataValue'](_0x401f('0x4'),_0x4e810f?_0x4e810f:this['getDataValue'](_0x401f('0x6')));}},'type':{'type':Sequelize[_0x401f('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x401f('0x7')),'get':function(){if(this['getDataValue'](_0x401f('0x8'))==='select'){return JSON[_0x401f('0x9')](this['getDataValue']('values'));}else{return this[_0x401f('0xa')](_0x401f('0xb'));}},'set':function(_0x158030){if(Array[_0x401f('0xc')](_0x158030)){this[_0x401f('0xd')](_0x401f('0xb'),JSON[_0x401f('0xe')](_0x158030));}else{this[_0x401f('0xd')]('values',_0x158030);}}},'required':{'type':Sequelize[_0x401f('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x401f('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9f47aa4..c2ea4e1 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 _0x6778=['limit','count','status','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','options','find','body','destroy','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined'];(function(_0x6e0b73,_0x1277bd){var _0x479fa1=function(_0x5b9ec3){while(--_0x5b9ec3){_0x6e0b73['push'](_0x6e0b73['shift']());}};_0x479fa1(++_0x1277bd);}(_0x6778,0x9d));var _0x8677=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x6778[_0x4c7fb5];return _0x2e10ac;};'use strict';var emlformat=require(_0x8677('0x0'));var rimraf=require(_0x8677('0x1'));var zipdir=require(_0x8677('0x2'));var jsonpatch=require(_0x8677('0x3'));var rp=require(_0x8677('0x4'));var moment=require(_0x8677('0x5'));var BPromise=require(_0x8677('0x6'));var Mustache=require(_0x8677('0x7'));var util=require(_0x8677('0x8'));var path=require(_0x8677('0x9'));var sox=require(_0x8677('0xa'));var csv=require(_0x8677('0xb'));var ejs=require(_0x8677('0xc'));var fs=require('fs');var fs_extra=require(_0x8677('0xd'));var _=require(_0x8677('0xe'));var squel=require('squel');var crypto=require(_0x8677('0xf'));var jsforce=require(_0x8677('0x10'));var deskjs=require(_0x8677('0x11'));var toCsv=require(_0x8677('0xb'));var querystring=require(_0x8677('0x12'));var Papa=require(_0x8677('0x13'));var Redis=require(_0x8677('0x14'));var authService=require(_0x8677('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8677('0x16'));var logger=require(_0x8677('0x17'))(_0x8677('0x18'));var utils=require(_0x8677('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8677('0x1a'));var db=require(_0x8677('0x1b'))['db'];function respondWithStatusCode(_0x491e5a,_0x62f037){_0x62f037=_0x62f037||0xcc;return function(_0x1edc70){if(_0x1edc70){return _0x491e5a[_0x8677('0x1c')](_0x62f037);}return _0x491e5a['status'](_0x62f037)[_0x8677('0x1d')]();};}function respondWithResult(_0x34cdf8,_0x2bc242){_0x2bc242=_0x2bc242||0xc8;return function(_0x3bef89){if(_0x3bef89){return _0x34cdf8['status'](_0x2bc242)[_0x8677('0x1e')](_0x3bef89);}};}function respondWithFilteredResult(_0x2cfdd1,_0x2796a4){return function(_0x674641){if(_0x674641){var _0x22ec28=typeof _0x2796a4[_0x8677('0x1f')]===_0x8677('0x20')&&typeof _0x2796a4[_0x8677('0x21')]===_0x8677('0x20');var _0x285d81=_0x674641[_0x8677('0x22')];var _0x44dca7=_0x22ec28?0x0:_0x2796a4[_0x8677('0x1f')];var _0x479a2f=_0x22ec28?_0x674641[_0x8677('0x22')]:_0x2796a4[_0x8677('0x1f')]+_0x2796a4[_0x8677('0x21')];var _0x487c6f;if(_0x479a2f>=_0x285d81){_0x479a2f=_0x285d81;_0x487c6f=0xc8;}else{_0x487c6f=0xce;}_0x2cfdd1[_0x8677('0x23')](_0x487c6f);return _0x2cfdd1[_0x8677('0x24')](_0x8677('0x25'),_0x44dca7+'-'+_0x479a2f+'/'+_0x285d81)[_0x8677('0x1e')](_0x674641);}return null;};}function patchUpdates(_0x6d561){return function(_0x249107){try{jsonpatch[_0x8677('0x26')](_0x249107,_0x6d561,!![]);}catch(_0x5c889f){return BPromise['reject'](_0x5c889f);}return _0x249107[_0x8677('0x27')]();};}function saveUpdates(_0x597040,_0x3d6a33){return function(_0x3135d7){if(_0x3135d7){return _0x3135d7[_0x8677('0x28')](_0x597040)[_0x8677('0x29')](function(_0x4c3213){return _0x4c3213;});}return null;};}function removeEntity(_0x350c74,_0x59669a){return function(_0x37e1c8){if(_0x37e1c8){return _0x37e1c8['destroy']()[_0x8677('0x29')](function(){_0x350c74[_0x8677('0x23')](0xcc)[_0x8677('0x1d')]();});}};}function handleEntityNotFound(_0x34a8b8,_0x1c7d31){return function(_0x10286e){if(!_0x10286e){_0x34a8b8[_0x8677('0x1c')](0x194);}return _0x10286e;};}function handleError(_0x5c76d7,_0x87d8ef){_0x87d8ef=_0x87d8ef||0x1f4;return function(_0x554e04){logger[_0x8677('0x2a')](_0x554e04[_0x8677('0x2b')]);if(_0x554e04[_0x8677('0x2c')]){delete _0x554e04[_0x8677('0x2c')];}_0x5c76d7[_0x8677('0x23')](_0x87d8ef)[_0x8677('0x2d')](_0x554e04);};}exports[_0x8677('0x2e')]=function(_0x476081,_0xe53924){var _0x7ba6ec={},_0x17f45f={},_0x344ad0={'count':0x0,'rows':[]};var _0x1a79d9=_[_0x8677('0x2f')](db[_0x8677('0x30')][_0x8677('0x31')],function(_0x207b7d){return{'name':_0x207b7d[_0x8677('0x32')],'type':_0x207b7d[_0x8677('0x33')][_0x8677('0x34')]};});_0x17f45f['model']=_[_0x8677('0x35')](_[_0x8677('0x2f')](_0x1a79d9,_0x8677('0x2c')),[_0x8677('0x2c')]);_0x17f45f['query']=_['keys'](_0x476081[_0x8677('0x36')]);_0x17f45f[_0x8677('0x37')]=_[_0x8677('0x38')](_0x17f45f[_0x8677('0x39')],_0x17f45f['query']);_0x7ba6ec[_0x8677('0x3a')]=_[_0x8677('0x38')](_0x17f45f[_0x8677('0x39')],qs[_0x8677('0x3b')](_0x476081[_0x8677('0x36')][_0x8677('0x3b')]));_0x7ba6ec[_0x8677('0x3a')]=_0x7ba6ec['attributes'][_0x8677('0x3c')]?_0x7ba6ec['attributes']:_0x17f45f['model'];if(!_0x476081[_0x8677('0x36')][_0x8677('0x3d')](_0x8677('0x3e'))){_0x7ba6ec[_0x8677('0x21')]=qs[_0x8677('0x21')](_0x476081[_0x8677('0x36')][_0x8677('0x21')]);_0x7ba6ec[_0x8677('0x1f')]=qs[_0x8677('0x1f')](_0x476081[_0x8677('0x36')]['offset']);}_0x7ba6ec[_0x8677('0x3f')]=qs[_0x8677('0x40')](_0x476081[_0x8677('0x36')][_0x8677('0x40')]);_0x7ba6ec[_0x8677('0x41')]=qs[_0x8677('0x37')](_[_0x8677('0x42')](_0x476081[_0x8677('0x36')],_0x17f45f[_0x8677('0x37')]),_0x1a79d9);if(_0x476081[_0x8677('0x36')][_0x8677('0x43')]){_0x7ba6ec['where']=_[_0x8677('0x44')](_0x7ba6ec[_0x8677('0x41')],{'$or':_['map'](_0x1a79d9,function(_0x21b8ba){if(_0x21b8ba[_0x8677('0x33')]!==_0x8677('0x45')){var _0x3f0382={};_0x3f0382[_0x21b8ba['name']]={'$like':'%'+_0x476081[_0x8677('0x36')]['filter']+'%'};return _0x3f0382;}})});}_0x7ba6ec=_[_0x8677('0x44')]({},_0x7ba6ec,_0x476081['options']);var _0x4fbe00={'where':_0x7ba6ec[_0x8677('0x41')]};return db[_0x8677('0x30')][_0x8677('0x22')](_0x4fbe00)[_0x8677('0x29')](function(_0x1580e4){_0x344ad0[_0x8677('0x22')]=_0x1580e4;if(_0x476081['query']['includeAll']){_0x7ba6ec[_0x8677('0x46')]=[{'all':!![]}];}return db[_0x8677('0x30')][_0x8677('0x47')](_0x7ba6ec);})[_0x8677('0x29')](function(_0x3d9ae5){_0x344ad0[_0x8677('0x48')]=_0x3d9ae5;return _0x344ad0;})[_0x8677('0x29')](respondWithFilteredResult(_0xe53924,_0x7ba6ec))[_0x8677('0x49')](handleError(_0xe53924,null));};exports[_0x8677('0x4a')]=function(_0x4d0013,_0x1725dc){var _0x2abe1f={'raw':!![],'where':{'id':_0x4d0013[_0x8677('0x4b')]['id']}},_0x5a4525={};_0x5a4525[_0x8677('0x39')]=_[_0x8677('0x4c')](db[_0x8677('0x30')][_0x8677('0x31')]);_0x5a4525[_0x8677('0x36')]=_[_0x8677('0x4c')](_0x4d0013[_0x8677('0x36')]);_0x5a4525[_0x8677('0x37')]=_[_0x8677('0x38')](_0x5a4525[_0x8677('0x39')],_0x5a4525[_0x8677('0x36')]);_0x2abe1f[_0x8677('0x3a')]=_[_0x8677('0x38')](_0x5a4525['model'],qs[_0x8677('0x3b')](_0x4d0013[_0x8677('0x36')][_0x8677('0x3b')]));_0x2abe1f[_0x8677('0x3a')]=_0x2abe1f[_0x8677('0x3a')][_0x8677('0x3c')]?_0x2abe1f[_0x8677('0x3a')]:_0x5a4525['model'];if(_0x4d0013['query'][_0x8677('0x4d')]){_0x2abe1f['include']=[{'all':!![]}];}_0x2abe1f=_[_0x8677('0x44')]({},_0x2abe1f,_0x4d0013[_0x8677('0x4e')]);return db[_0x8677('0x30')][_0x8677('0x4f')](_0x2abe1f)[_0x8677('0x29')](handleEntityNotFound(_0x1725dc,null))['then'](respondWithResult(_0x1725dc,null))[_0x8677('0x49')](handleError(_0x1725dc,null));};exports[_0x8677('0x28')]=function(_0x880e1a,_0x57aebf){if(_0x880e1a['body']['id']){delete _0x880e1a[_0x8677('0x50')]['id'];}return db[_0x8677('0x30')][_0x8677('0x4f')]({'where':{'id':_0x880e1a['params']['id']}})['then'](handleEntityNotFound(_0x57aebf,null))[_0x8677('0x29')](saveUpdates(_0x880e1a['body'],null))[_0x8677('0x29')](respondWithResult(_0x57aebf,null))[_0x8677('0x49')](handleError(_0x57aebf,null));};exports[_0x8677('0x51')]=function(_0x2301ad,_0x16c9e3){return db[_0x8677('0x30')][_0x8677('0x4f')]({'where':{'id':_0x2301ad[_0x8677('0x4b')]['id']}})['then'](handleEntityNotFound(_0x16c9e3,null))[_0x8677('0x29')](removeEntity(_0x16c9e3,null))[_0x8677('0x49')](handleError(_0x16c9e3,null));};exports[_0x8677('0x52')]=function(_0x2ab72f,_0x3d3f24){var _0x5d1ba3;return db[_0x8677('0x53')][_0x8677('0x54')](function(_0x54fad4){return db['CmCustomField'][_0x8677('0x52')](_0x2ab72f[_0x8677('0x50')],{'transaction':_0x54fad4})[_0x8677('0x29')](function(_0x5a71f7){_0x5d1ba3=_0x5a71f7;var _0x332bd8={'type':db[_0x8677('0x55')][_0x8677('0x56')],'transaction':_0x54fad4};switch(_0x2ab72f[_0x8677('0x50')][_0x8677('0x33')]){case'text':_0x332bd8['type']=db['Sequelize'][_0x8677('0x56')];break;case _0x8677('0x57'):_0x332bd8[_0x8677('0x33')]=db['Sequelize'][_0x8677('0x58')];break;case _0x8677('0x59'):_0x332bd8[_0x8677('0x33')]=db[_0x8677('0x55')][_0x8677('0x5a')];_0x332bd8[_0x8677('0x5b')]=![];break;default:}return db[_0x8677('0x53')]['queryInterface']['addColumn'](_0x8677('0x5c'),util[_0x8677('0x5d')](_0x8677('0x5e'),_0x5d1ba3['id']),_0x332bd8);})[_0x8677('0x29')](function(){return _0x5d1ba3;});})[_0x8677('0x29')](respondWithResult(_0x3d3f24,0xc9))[_0x8677('0x49')](handleError(_0x3d3f24,null));}; \ No newline at end of file +var _0x04f3=['status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','CmCustomField','includeAll','include','rows','catch','show','find','body','params','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus'];(function(_0x5066b6,_0xf29a2b){var _0x1fd084=function(_0x4bc577){while(--_0x4bc577){_0x5066b6['push'](_0x5066b6['shift']());}};_0x1fd084(++_0xf29a2b);}(_0x04f3,0x8c));var _0x304f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x04f3[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x304f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x304f('0x1'));var jsonpatch=require(_0x304f('0x2'));var rp=require(_0x304f('0x3'));var moment=require(_0x304f('0x4'));var BPromise=require(_0x304f('0x5'));var Mustache=require('mustache');var util=require(_0x304f('0x6'));var path=require(_0x304f('0x7'));var sox=require(_0x304f('0x8'));var csv=require(_0x304f('0x9'));var ejs=require(_0x304f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x304f('0xb'));var squel=require(_0x304f('0xc'));var crypto=require('crypto');var jsforce=require(_0x304f('0xd'));var deskjs=require(_0x304f('0xe'));var toCsv=require(_0x304f('0x9'));var querystring=require(_0x304f('0xf'));var Papa=require(_0x304f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x304f('0x11'));var as=require(_0x304f('0x12'));var hardwareService=require(_0x304f('0x13'));var logger=require(_0x304f('0x14'))(_0x304f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x304f('0x16'))['db'];function respondWithStatusCode(_0x350e04,_0x33e3e1){_0x33e3e1=_0x33e3e1||0xcc;return function(_0x24c3d1){if(_0x24c3d1){return _0x350e04[_0x304f('0x17')](_0x33e3e1);}return _0x350e04[_0x304f('0x18')](_0x33e3e1)['end']();};}function respondWithResult(_0xaf120e,_0xa3a8cb){_0xa3a8cb=_0xa3a8cb||0xc8;return function(_0x435e38){if(_0x435e38){return _0xaf120e[_0x304f('0x18')](_0xa3a8cb)[_0x304f('0x19')](_0x435e38);}};}function respondWithFilteredResult(_0x433c40,_0x14a24d){return function(_0x43123d){if(_0x43123d){var _0x2072ca=typeof _0x14a24d[_0x304f('0x1a')]===_0x304f('0x1b')&&typeof _0x14a24d[_0x304f('0x1c')]==='undefined';var _0x2db1a6=_0x43123d[_0x304f('0x1d')];var _0x3a6299=_0x2072ca?0x0:_0x14a24d['offset'];var _0x20a509=_0x2072ca?_0x43123d[_0x304f('0x1d')]:_0x14a24d[_0x304f('0x1a')]+_0x14a24d['limit'];var _0x4b787c;if(_0x20a509>=_0x2db1a6){_0x20a509=_0x2db1a6;_0x4b787c=0xc8;}else{_0x4b787c=0xce;}_0x433c40[_0x304f('0x18')](_0x4b787c);return _0x433c40[_0x304f('0x1e')](_0x304f('0x1f'),_0x3a6299+'-'+_0x20a509+'/'+_0x2db1a6)[_0x304f('0x19')](_0x43123d);}return null;};}function patchUpdates(_0xe275c7){return function(_0x53a9f0){try{jsonpatch[_0x304f('0x20')](_0x53a9f0,_0xe275c7,!![]);}catch(_0x41d777){return BPromise['reject'](_0x41d777);}return _0x53a9f0[_0x304f('0x21')]();};}function saveUpdates(_0x37d529,_0x4fea4b){return function(_0x881d6){if(_0x881d6){return _0x881d6[_0x304f('0x22')](_0x37d529)[_0x304f('0x23')](function(_0x8f2103){return _0x8f2103;});}return null;};}function removeEntity(_0x57adb2,_0x555f73){return function(_0x2707ed){if(_0x2707ed){return _0x2707ed[_0x304f('0x24')]()['then'](function(){_0x57adb2['status'](0xcc)[_0x304f('0x25')]();});}};}function handleEntityNotFound(_0x155c80,_0x165e8b){return function(_0x3e5471){if(!_0x3e5471){_0x155c80['sendStatus'](0x194);}return _0x3e5471;};}function handleError(_0x72b89a,_0x4169f4){_0x4169f4=_0x4169f4||0x1f4;return function(_0x5e0612){logger['error'](_0x5e0612[_0x304f('0x26')]);if(_0x5e0612['name']){delete _0x5e0612[_0x304f('0x27')];}_0x72b89a['status'](_0x4169f4)['send'](_0x5e0612);};}exports[_0x304f('0x28')]=function(_0x42073c,_0x3b4855){var _0x33815c={},_0x66a452={},_0x430f94={'count':0x0,'rows':[]};var _0x20d049=_[_0x304f('0x29')](db['CmCustomField'][_0x304f('0x2a')],function(_0x274dac){return{'name':_0x274dac[_0x304f('0x2b')],'type':_0x274dac[_0x304f('0x2c')][_0x304f('0x2d')]};});_0x66a452[_0x304f('0x2e')]=_['differenceBy'](_[_0x304f('0x29')](_0x20d049,_0x304f('0x27')),[_0x304f('0x27')]);_0x66a452[_0x304f('0x2f')]=_[_0x304f('0x30')](_0x42073c[_0x304f('0x2f')]);_0x66a452[_0x304f('0x31')]=_['intersection'](_0x66a452[_0x304f('0x2e')],_0x66a452[_0x304f('0x2f')]);_0x33815c[_0x304f('0x32')]=_[_0x304f('0x33')](_0x66a452[_0x304f('0x2e')],qs[_0x304f('0x34')](_0x42073c[_0x304f('0x2f')][_0x304f('0x34')]));_0x33815c[_0x304f('0x32')]=_0x33815c['attributes'][_0x304f('0x35')]?_0x33815c[_0x304f('0x32')]:_0x66a452[_0x304f('0x2e')];if(!_0x42073c['query'][_0x304f('0x36')](_0x304f('0x37'))){_0x33815c[_0x304f('0x1c')]=qs[_0x304f('0x1c')](_0x42073c['query'][_0x304f('0x1c')]);_0x33815c['offset']=qs[_0x304f('0x1a')](_0x42073c['query'][_0x304f('0x1a')]);}_0x33815c['order']=qs[_0x304f('0x38')](_0x42073c[_0x304f('0x2f')][_0x304f('0x38')]);_0x33815c[_0x304f('0x39')]=qs['filters'](_['pick'](_0x42073c[_0x304f('0x2f')],_0x66a452[_0x304f('0x31')]),_0x20d049);if(_0x42073c[_0x304f('0x2f')][_0x304f('0x3a')]){_0x33815c['where']=_[_0x304f('0x3b')](_0x33815c['where'],{'$or':_[_0x304f('0x29')](_0x20d049,function(_0x383361){if(_0x383361[_0x304f('0x2c')]!=='VIRTUAL'){var _0x349e18={};_0x349e18[_0x383361['name']]={'$like':'%'+_0x42073c[_0x304f('0x2f')]['filter']+'%'};return _0x349e18;}})});}_0x33815c=_[_0x304f('0x3b')]({},_0x33815c,_0x42073c[_0x304f('0x3c')]);var _0x58b0b8={'where':_0x33815c['where']};return db[_0x304f('0x3d')][_0x304f('0x1d')](_0x58b0b8)[_0x304f('0x23')](function(_0x58c9a0){_0x430f94[_0x304f('0x1d')]=_0x58c9a0;if(_0x42073c[_0x304f('0x2f')][_0x304f('0x3e')]){_0x33815c[_0x304f('0x3f')]=[{'all':!![]}];}return db[_0x304f('0x3d')]['findAll'](_0x33815c);})[_0x304f('0x23')](function(_0x531af6){_0x430f94[_0x304f('0x40')]=_0x531af6;return _0x430f94;})[_0x304f('0x23')](respondWithFilteredResult(_0x3b4855,_0x33815c))[_0x304f('0x41')](handleError(_0x3b4855,null));};exports[_0x304f('0x42')]=function(_0x27bcb9,_0x6538d4){var _0x1d4f5c={'raw':!![],'where':{'id':_0x27bcb9['params']['id']}},_0x3301e1={};_0x3301e1['model']=_[_0x304f('0x30')](db['CmCustomField'][_0x304f('0x2a')]);_0x3301e1[_0x304f('0x2f')]=_['keys'](_0x27bcb9[_0x304f('0x2f')]);_0x3301e1[_0x304f('0x31')]=_['intersection'](_0x3301e1[_0x304f('0x2e')],_0x3301e1['query']);_0x1d4f5c[_0x304f('0x32')]=_['intersection'](_0x3301e1[_0x304f('0x2e')],qs[_0x304f('0x34')](_0x27bcb9[_0x304f('0x2f')][_0x304f('0x34')]));_0x1d4f5c['attributes']=_0x1d4f5c['attributes']['length']?_0x1d4f5c[_0x304f('0x32')]:_0x3301e1['model'];if(_0x27bcb9[_0x304f('0x2f')][_0x304f('0x3e')]){_0x1d4f5c[_0x304f('0x3f')]=[{'all':!![]}];}_0x1d4f5c=_[_0x304f('0x3b')]({},_0x1d4f5c,_0x27bcb9['options']);return db[_0x304f('0x3d')][_0x304f('0x43')](_0x1d4f5c)[_0x304f('0x23')](handleEntityNotFound(_0x6538d4,null))[_0x304f('0x23')](respondWithResult(_0x6538d4,null))[_0x304f('0x41')](handleError(_0x6538d4,null));};exports[_0x304f('0x22')]=function(_0x1c9559,_0x5b0adf){if(_0x1c9559[_0x304f('0x44')]['id']){delete _0x1c9559[_0x304f('0x44')]['id'];}return db['CmCustomField'][_0x304f('0x43')]({'where':{'id':_0x1c9559[_0x304f('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b0adf,null))[_0x304f('0x23')](saveUpdates(_0x1c9559['body'],null))['then'](respondWithResult(_0x5b0adf,null))[_0x304f('0x41')](handleError(_0x5b0adf,null));};exports['destroy']=function(_0x300b41,_0x259e8a){return db['CmCustomField'][_0x304f('0x43')]({'where':{'id':_0x300b41[_0x304f('0x45')]['id']}})[_0x304f('0x23')](handleEntityNotFound(_0x259e8a,null))['then'](removeEntity(_0x259e8a,null))['catch'](handleError(_0x259e8a,null));};exports[_0x304f('0x46')]=function(_0x37e82e,_0x26cf58){var _0x281cf6;return db[_0x304f('0x47')][_0x304f('0x48')](function(_0x38726c){return db[_0x304f('0x3d')][_0x304f('0x46')](_0x37e82e['body'],{'transaction':_0x38726c})['then'](function(_0x5354d5){_0x281cf6=_0x5354d5;var _0x2e7459={'type':db[_0x304f('0x49')][_0x304f('0x4a')],'transaction':_0x38726c};switch(_0x37e82e[_0x304f('0x44')][_0x304f('0x2c')]){case'text':_0x2e7459['type']=db[_0x304f('0x49')][_0x304f('0x4a')];break;case _0x304f('0x4b'):_0x2e7459[_0x304f('0x2c')]=db['Sequelize'][_0x304f('0x4c')];break;case _0x304f('0x4d'):_0x2e7459['type']=db['Sequelize']['BOOLEAN'];_0x2e7459[_0x304f('0x4e')]=![];break;default:}return db[_0x304f('0x47')]['queryInterface'][_0x304f('0x4f')](_0x304f('0x50'),util['format'](_0x304f('0x51'),_0x281cf6['id']),_0x2e7459);})['then'](function(){return _0x281cf6;});})[_0x304f('0x23')](respondWithResult(_0x26cf58,0xc9))[_0x304f('0x41')](handleError(_0x26cf58,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0c134be..ddfeb49 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 _0xb7d5=['./cmCustomField.attributes','define','cm_custom_fields','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5beae3,_0x8626db){var _0x4f7ed4=function(_0x393ee4){while(--_0x393ee4){_0x5beae3['push'](_0x5beae3['shift']());}};_0x4f7ed4(++_0x8626db);}(_0xb7d5,0x107));var _0x5b7d=function(_0x530b58,_0x15840a){_0x530b58=_0x530b58-0x0;var _0x376993=_0xb7d5[_0x530b58];return _0x376993;};'use strict';var _=require('lodash');var util=require(_0x5b7d('0x0'));var logger=require(_0x5b7d('0x1'))('api');var moment=require(_0x5b7d('0x2'));var BPromise=require(_0x5b7d('0x3'));var rp=require(_0x5b7d('0x4'));var fs=require('fs');var path=require(_0x5b7d('0x5'));var rimraf=require(_0x5b7d('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b7d('0x7'));module['exports']=function(_0x4a0a71,_0x24b7f1){return _0x4a0a71[_0x5b7d('0x8')]('CmCustomField',attributes,{'tableName':_0x5b7d('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6862=['rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x6862,0x179));var _0x2686=function(_0x485f49,_0x4d42f7){_0x485f49=_0x485f49-0x0;var _0x1c5b17=_0x6862[_0x485f49];return _0x1c5b17;};'use strict';var _=require(_0x2686('0x0'));var util=require(_0x2686('0x1'));var logger=require(_0x2686('0x2'))(_0x2686('0x3'));var moment=require(_0x2686('0x4'));var BPromise=require(_0x2686('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2686('0x6'));var rimraf=require(_0x2686('0x7'));var config=require(_0x2686('0x8'));var attributes=require(_0x2686('0x9'));module['exports']=function(_0x4a9d95,_0x421011){return _0x4a9d95['define'](_0x2686('0xa'),attributes,{'tableName':_0x2686('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index ebb6c1f..6c7df9b 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 _0x98d1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','CmCustomField,\x20%s,\x20%s','message','result','util','bluebird'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x98d1,0x1a2));var _0x198d=function(_0x45306d,_0x3eed71){_0x45306d=_0x45306d-0x0;var _0x3e4d84=_0x98d1[_0x45306d];return _0x3e4d84;};'use strict';var _=require('lodash');var util=require(_0x198d('0x0'));var moment=require('moment');var BPromise=require(_0x198d('0x1'));var rs=require(_0x198d('0x2'));var fs=require('fs');var Redis=require(_0x198d('0x3'));var db=require(_0x198d('0x4'))['db'];var utils=require(_0x198d('0x5'));var logger=require(_0x198d('0x6'))(_0x198d('0x7'));var config=require(_0x198d('0x8'));var jayson=require(_0x198d('0x9'));var client=jayson[_0x198d('0xa')][_0x198d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2101c2,_0x5a7be3,_0x593baa){return new BPromise(function(_0x30a7f2,_0x233aa5){return client[_0x198d('0xc')](_0x2101c2,_0x593baa)[_0x198d('0xd')](function(_0x5e43cf){logger[_0x198d('0xe')]('CmCustomField,\x20%s,\x20%s',_0x5a7be3,'request\x20sent');logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x5a7be3,_0x198d('0xf'),JSON['stringify'](_0x5e43cf));if(_0x5e43cf['error']){if(_0x5e43cf[_0x198d('0x10')][_0x198d('0x11')]===0x1f4){logger[_0x198d('0x10')](_0x198d('0x12'),_0x5a7be3,_0x5e43cf[_0x198d('0x10')][_0x198d('0x13')]);return _0x233aa5(_0x5e43cf[_0x198d('0x10')][_0x198d('0x13')]);}logger[_0x198d('0x10')]('CmCustomField,\x20%s,\x20%s',_0x5a7be3,_0x5e43cf[_0x198d('0x10')][_0x198d('0x13')]);return _0x30a7f2(_0x5e43cf[_0x198d('0x10')][_0x198d('0x13')]);}else{logger[_0x198d('0xe')](_0x198d('0x12'),_0x5a7be3,_0x198d('0xf'));_0x30a7f2(_0x5e43cf[_0x198d('0x14')][_0x198d('0x13')]);}})['catch'](function(_0x411f9d){logger[_0x198d('0x10')](_0x198d('0x12'),_0x5a7be3,_0x411f9d);_0x233aa5(_0x411f9d);});});} \ No newline at end of file +var _0xaf31=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CmCustomField,\x20%s,\x20%s','lodash'];(function(_0x1670c0,_0x228b9e){var _0x21743e=function(_0xe5090a){while(--_0xe5090a){_0x1670c0['push'](_0x1670c0['shift']());}};_0x21743e(++_0x228b9e);}(_0xaf31,0x155));var _0x1af3=function(_0x411f83,_0x191c84){_0x411f83=_0x411f83-0x0;var _0x4a9718=_0xaf31[_0x411f83];return _0x4a9718;};'use strict';var _=require(_0x1af3('0x0'));var util=require(_0x1af3('0x1'));var moment=require(_0x1af3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1af3('0x3'));var db=require(_0x1af3('0x4'))['db'];var utils=require(_0x1af3('0x5'));var logger=require('../../config/logger')(_0x1af3('0x6'));var config=require('../../config/environment');var jayson=require(_0x1af3('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b189f,_0x7477bd,_0x1b8711){return new BPromise(function(_0x31b74b,_0x33d8de){return client['request'](_0x3b189f,_0x1b8711)[_0x1af3('0x8')](function(_0x52b9b1){logger['info']('CmCustomField,\x20%s,\x20%s',_0x7477bd,_0x1af3('0x9'));logger[_0x1af3('0xa')](_0x1af3('0xb'),_0x7477bd,_0x1af3('0x9'),JSON[_0x1af3('0xc')](_0x52b9b1));if(_0x52b9b1[_0x1af3('0xd')]){if(_0x52b9b1[_0x1af3('0xd')]['code']===0x1f4){logger[_0x1af3('0xd')]('CmCustomField,\x20%s,\x20%s',_0x7477bd,_0x52b9b1[_0x1af3('0xd')][_0x1af3('0xe')]);return _0x33d8de(_0x52b9b1[_0x1af3('0xd')][_0x1af3('0xe')]);}logger[_0x1af3('0xd')]('CmCustomField,\x20%s,\x20%s',_0x7477bd,_0x52b9b1[_0x1af3('0xd')][_0x1af3('0xe')]);return _0x31b74b(_0x52b9b1[_0x1af3('0xd')][_0x1af3('0xe')]);}else{logger[_0x1af3('0xf')]('CmCustomField,\x20%s,\x20%s',_0x7477bd,'request\x20sent');_0x31b74b(_0x52b9b1['result']['message']);}})[_0x1af3('0x10')](function(_0x17de56){logger[_0x1af3('0xd')](_0x1af3('0x11'),_0x7477bd,_0x17de56);_0x33d8de(_0x17de56);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f8f2738..1eec3a5 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 _0xf3a7=['post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x560abe,_0x25fe25){var _0x2e04b5=function(_0x5bb04e){while(--_0x5bb04e){_0x560abe['push'](_0x560abe['shift']());}};_0x2e04b5(++_0x25fe25);}(_0xf3a7,0x99));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7f3a('0x0'));var path=require(_0x7f3a('0x1'));var timeout=require(_0x7f3a('0x2'));var express=require(_0x7f3a('0x3'));var router=express[_0x7f3a('0x4')]();var fs_extra=require(_0x7f3a('0x5'));var auth=require(_0x7f3a('0x6'));var interaction=require(_0x7f3a('0x7'));var config=require(_0x7f3a('0x8'));var controller=require(_0x7f3a('0x9'));router['get']('/',auth[_0x7f3a('0xa')](),controller[_0x7f3a('0xb')]);router[_0x7f3a('0xc')](_0x7f3a('0xd'),auth[_0x7f3a('0xa')](),controller[_0x7f3a('0xe')]);router[_0x7f3a('0xf')]('/',auth['isAuthenticated'](),controller[_0x7f3a('0x10')]);router[_0x7f3a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7f3a('0x12')]);router[_0x7f3a('0x13')]('/:id',auth[_0x7f3a('0xa')](),controller['destroy']);module[_0x7f3a('0x14')]=router; \ No newline at end of file +var _0x432b=['Router','../../components/interaction/service','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x565d34,_0x4176da){var _0x3751e7=function(_0x42428b){while(--_0x42428b){_0x565d34['push'](_0x565d34['shift']());}};_0x3751e7(++_0x4176da);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb432('0x0'));var util=require('util');var path=require(_0xb432('0x1'));var timeout=require(_0xb432('0x2'));var express=require(_0xb432('0x3'));var router=express[_0xb432('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb432('0x5'));var config=require('../../config/environment');var controller=require(_0xb432('0x6'));router['get']('/',auth[_0xb432('0x7')](),controller[_0xb432('0x8')]);router[_0xb432('0x9')](_0xb432('0xa'),auth[_0xb432('0x7')](),controller[_0xb432('0xb')]);router[_0xb432('0xc')]('/',auth[_0xb432('0x7')](),controller['create']);router[_0xb432('0xd')](_0xb432('0xa'),auth[_0xb432('0x7')](),controller[_0xb432('0xe')]);router[_0xb432('0xf')](_0xb432('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xb432('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8df33b2..1113763 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 _0x8cd0=['exports','BOOLEAN','DATE','format','INTEGER','STRING','contactListQueue','moment','sequelize'];(function(_0x2029f7,_0x53b3f1){var _0x5c6c6f=function(_0x22836a){while(--_0x22836a){_0x2029f7['push'](_0x2029f7['shift']());}};_0x5c6c6f(++_0x53b3f1);}(_0x8cd0,0x16f));var _0x08cd=function(_0x59a1ce,_0x36bdc7){_0x59a1ce=_0x59a1ce-0x0;var _0x2a58f4=_0x8cd0[_0x59a1ce];return _0x2a58f4;};'use strict';var moment=require(_0x08cd('0x0'));var Sequelize=require(_0x08cd('0x1'));module[_0x08cd('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x08cd('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x08cd('0x4')],'defaultValue':moment()[_0x08cd('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x08cd('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x08cd('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x08cd('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x08cd('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x08cd('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x08cd('0x4')]},'priority':{'type':Sequelize[_0x08cd('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x08cd('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x08cd('0x6')],'unique':_0x08cd('0x8')},'ListId':{'type':Sequelize[_0x08cd('0x6')],'unique':_0x08cd('0x8')},'UserId':{'type':Sequelize[_0x08cd('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x08cd('0x6')],'unique':_0x08cd('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x08cd('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x08cd('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x08cd('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x08cd('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x08cd('0x7')]},'recallmeNotifiedDate':{'type':Sequelize[_0x08cd('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x0afe=['format','INTEGER','STRING','contactListQueue','moment','sequelize','BOOLEAN','DATE'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0afe,0x1c4));var _0xe0af=function(_0x164758,_0x5a580d){_0x164758=_0x164758-0x0;var _0x420774=_0x0afe[_0x164758];return _0x420774;};'use strict';var moment=require(_0xe0af('0x0'));var Sequelize=require(_0xe0af('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xe0af('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe0af('0x3')],'defaultValue':moment()[_0xe0af('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xe0af('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe0af('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe0af('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe0af('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe0af('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe0af('0x3')]},'priority':{'type':Sequelize[_0xe0af('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xe0af('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xe0af('0x7')},'UserId':{'type':Sequelize[_0xe0af('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xe0af('0x5')],'unique':_0xe0af('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xe0af('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe0af('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xe0af('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe0af('0x6')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'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 f4c9efe..e0133a6 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 _0xa9b1=['finally','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','dialPreviewAutoRecallMe','direction','prev','isEmpty','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','hopperIds','literal','findOne','recallme','UPDATE','Contact','CmCompany','List','Queue','dialActive','getPreviewRecall','scheduledat','LOCK','Company','CmList','getOpenContacts','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','Content-Range','update','sendStatus','stack','name','status','send','index','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','intersection','concat','$or','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$like','$overlap','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname'];(function(_0xb25f8e,_0x29fa11){var _0x19cc63=function(_0x4cb8ee){while(--_0x4cb8ee){_0xb25f8e['push'](_0xb25f8e['shift']());}};_0x19cc63(++_0x29fa11);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x1a9b('0x0'));var logger=require(_0x1a9b('0x1'))(_0x1a9b('0x2'));var shared=require(_0x1a9b('0x3'));var db=require(_0x1a9b('0x4'))['db'];function respondWithResult(_0x10c90c,_0x52f55f){_0x52f55f=_0x52f55f||0xc8;return function(_0x57b453){if(_0x57b453){return _0x10c90c['status'](_0x52f55f)[_0x1a9b('0x5')](_0x57b453);}};}function respondWithFilteredResult(_0x15861d,_0x1a78b6){return function(_0xc55657){if(_0xc55657){var _0x32cff5=typeof _0x1a78b6[_0x1a9b('0x6')]===_0x1a9b('0x7')&&typeof _0x1a78b6[_0x1a9b('0x8')]===_0x1a9b('0x7');var _0xec5160=_0xc55657[_0x1a9b('0x9')];var _0x57659a=_0x32cff5?0x0:_0x1a78b6['offset'];var _0x4e1aef=_0x32cff5?_0xc55657[_0x1a9b('0x9')]:_0x1a78b6[_0x1a9b('0x6')]+_0x1a78b6[_0x1a9b('0x8')];var _0x5ad5e4;if(_0x4e1aef>=_0xec5160){_0x4e1aef=_0xec5160;_0x5ad5e4=0xc8;}else{_0x5ad5e4=0xce;}_0x15861d['status'](_0x5ad5e4);return _0x15861d['set'](_0x1a9b('0xa'),_0x57659a+'-'+_0x4e1aef+'/'+_0xec5160)[_0x1a9b('0x5')](_0xc55657);}return null;};}function saveUpdates(_0x2c75cf,_0x11bf7e){return function(_0x2c3170){if(_0x2c3170){return _0x2c3170[_0x1a9b('0xb')](_0x2c75cf)['then'](function(_0x3c1ba4){return _0x3c1ba4;});}return null;};}function handleEntityNotFound(_0x34f082,_0x245883){return function(_0x53c725){if(!_0x53c725){_0x34f082[_0x1a9b('0xc')](0x194);}return _0x53c725;};}function handleError(_0x38145b,_0x55a00d){_0x55a00d=_0x55a00d||0x1f4;return function(_0x2a7d72){logger['error'](_0x2a7d72[_0x1a9b('0xd')]);if(_0x2a7d72[_0x1a9b('0xe')]){delete _0x2a7d72[_0x1a9b('0xe')];}_0x38145b[_0x1a9b('0xf')](_0x55a00d)[_0x1a9b('0x10')](_0x2a7d72);};}exports[_0x1a9b('0x11')]=function(_0x37057a,_0x205a0d){var _0x10acc3={},_0x1281c2={},_0x53ea09={'count':0x0,'rows':[]};var _0x13be9a=_[_0x1a9b('0x12')](db[_0x1a9b('0x13')][_0x1a9b('0x14')],function(_0x5687fc){return{'name':_0x5687fc[_0x1a9b('0x15')],'type':_0x5687fc[_0x1a9b('0x16')]['key']};});_0x1281c2[_0x1a9b('0x17')]=_[_0x1a9b('0x12')](_0x13be9a,_0x1a9b('0xe'));_0x1281c2[_0x1a9b('0x18')]=_[_0x1a9b('0x19')](_0x37057a['query']);_0x1281c2[_0x1a9b('0x1a')]=_[_0x1a9b('0x1b')](_0x1281c2[_0x1a9b('0x17')],_0x1281c2[_0x1a9b('0x18')]);_0x1281c2[_0x1a9b('0x1a')]=_[_0x1a9b('0x1c')](_0x1281c2[_0x1a9b('0x1a')],['$and',_0x1a9b('0x1d'),'$gt',_0x1a9b('0x1e'),_0x1a9b('0x1f'),_0x1a9b('0x20'),'$ne',_0x1a9b('0x21'),_0x1a9b('0x22'),_0x1a9b('0x23'),_0x1a9b('0x24'),_0x1a9b('0x25'),_0x1a9b('0x26'),'$like',_0x1a9b('0x27'),_0x1a9b('0x28'),'$notILike',_0x1a9b('0x29'),_0x1a9b('0x2a'),'$contains','$contained',_0x1a9b('0x2b')]);_0x10acc3[_0x1a9b('0x2c')]=_['intersection'](_0x1281c2[_0x1a9b('0x17')],qs[_0x1a9b('0x2d')](_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x2d')]));_0x10acc3[_0x1a9b('0x2c')]=_0x10acc3[_0x1a9b('0x2c')][_0x1a9b('0x2e')]?_0x10acc3['attributes']:_0x1281c2[_0x1a9b('0x17')];if(!_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x2f')](_0x1a9b('0x30'))){_0x10acc3[_0x1a9b('0x8')]=qs[_0x1a9b('0x8')](_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x8')]);_0x10acc3[_0x1a9b('0x6')]=qs[_0x1a9b('0x6')](_0x37057a[_0x1a9b('0x18')]['offset']);}_0x10acc3['order']=qs[_0x1a9b('0x31')](_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x31')]);_0x10acc3['where']=qs[_0x1a9b('0x1a')](_['pick'](_0x37057a[_0x1a9b('0x18')],_0x1281c2['filters']),_0x13be9a);if(_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x32')]){_0x10acc3['where']=_[_0x1a9b('0x33')](_0x10acc3['where'],{'$or':_[_0x1a9b('0x12')](_0x13be9a,function(_0x34c457){if(_0x34c457[_0x1a9b('0x16')]!==_0x1a9b('0x34')){var _0x5ccdfe={};_0x5ccdfe[_0x34c457[_0x1a9b('0xe')]]={'$like':'%'+_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x32')]+'%'};return _0x5ccdfe;}})});}_0x10acc3=_['merge']({},_0x10acc3,_0x37057a[_0x1a9b('0x35')]);var _0x5be8b9={'where':_0x10acc3['where']};return db[_0x1a9b('0x13')][_0x1a9b('0x9')](_0x5be8b9)[_0x1a9b('0x36')](function(_0x42f540){_0x53ea09[_0x1a9b('0x9')]=_0x42f540;if(_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x37')]){_0x10acc3['include']=[{'all':!![]}];}return db[_0x1a9b('0x13')][_0x1a9b('0x38')](_0x10acc3);})[_0x1a9b('0x36')](function(_0x55d8de){_0x53ea09[_0x1a9b('0x39')]=_0x55d8de;return _0x53ea09;})[_0x1a9b('0x36')](respondWithFilteredResult(_0x205a0d,_0x10acc3))[_0x1a9b('0x3a')](handleError(_0x205a0d,null));};exports[_0x1a9b('0x3b')]=function(_0x5d6213,_0x58d5b6){var _0x10e80f={'raw':!![],'where':{'id':_0x5d6213[_0x1a9b('0x3c')]['id']}},_0x45e50f={};_0x45e50f['model']=_['keys'](db[_0x1a9b('0x13')][_0x1a9b('0x14')]);_0x45e50f[_0x1a9b('0x18')]=_[_0x1a9b('0x19')](_0x5d6213[_0x1a9b('0x18')]);_0x45e50f[_0x1a9b('0x1a')]=_[_0x1a9b('0x1b')](_0x45e50f['model'],_0x45e50f[_0x1a9b('0x18')]);_0x10e80f[_0x1a9b('0x2c')]=_[_0x1a9b('0x1b')](_0x45e50f[_0x1a9b('0x17')],qs[_0x1a9b('0x2d')](_0x5d6213[_0x1a9b('0x18')][_0x1a9b('0x2d')]));_0x10e80f[_0x1a9b('0x2c')]=_0x10e80f[_0x1a9b('0x2c')][_0x1a9b('0x2e')]?_0x10e80f[_0x1a9b('0x2c')]:_0x45e50f[_0x1a9b('0x17')];if(_0x5d6213[_0x1a9b('0x18')][_0x1a9b('0x37')]){_0x10e80f[_0x1a9b('0x3d')]=[{'all':!![]}];}_0x10e80f=_[_0x1a9b('0x33')]({},_0x10e80f,_0x5d6213['options']);return db[_0x1a9b('0x13')][_0x1a9b('0x3e')](_0x10e80f)['then'](handleEntityNotFound(_0x58d5b6,null))[_0x1a9b('0x36')](respondWithResult(_0x58d5b6,null))['catch'](handleError(_0x58d5b6,null));};exports['create']=function(_0x2311eb,_0x30f5b5){return db[_0x1a9b('0x13')][_0x1a9b('0x3f')](_0x2311eb[_0x1a9b('0x40')],{})[_0x1a9b('0x36')](respondWithResult(_0x30f5b5,0xc9))[_0x1a9b('0x3a')](handleError(_0x30f5b5,null));};exports['update']=function(_0x1e63ac,_0x3595fa){if(_0x1e63ac[_0x1a9b('0x40')]['id']){delete _0x1e63ac[_0x1a9b('0x40')]['id'];}return db['CmHopper'][_0x1a9b('0x3e')]({'where':{'id':_0x1e63ac[_0x1a9b('0x3c')]['id']}})[_0x1a9b('0x36')](handleEntityNotFound(_0x3595fa,null))[_0x1a9b('0x36')](saveUpdates(_0x1e63ac['body'],null))[_0x1a9b('0x36')](respondWithResult(_0x3595fa,null))[_0x1a9b('0x3a')](handleError(_0x3595fa,null));};exports[_0x1a9b('0x41')]=function(_0x1e93df,_0x38c609){return db['CmHopper']['describe']()[_0x1a9b('0x36')](respondWithResult(_0x38c609,null))[_0x1a9b('0x3a')](handleError(_0x38c609,null));};exports['destroy']=function(_0x52b06e,_0x252140){var _0x369156;var _0xb09b40=_0x52b06e['params']['id'];return db[_0x1a9b('0x13')][_0x1a9b('0x3e')]({'where':{'id':_0x52b06e[_0x1a9b('0x3c')]['id']}})[_0x1a9b('0x36')](handleEntityNotFound(_0x252140,null))[_0x1a9b('0x36')](function(_0x15cd36){if(_0x15cd36){return _0x15cd36[_0x1a9b('0x42')]()['then'](function(_0x54b9ac){return _0x54b9ac;});}})['then'](function(_0x4d4f86){_0x369156=_0x4d4f86;if(_0x4d4f86){if(_0x4d4f86[_0x1a9b('0x43')]||_0x4d4f86[_0x1a9b('0x44')]){return db[_0x4d4f86[_0x1a9b('0x43')]?_0x1a9b('0x45'):'Campaign'][_0x1a9b('0x3e')]({'where':{'id':_0x4d4f86[_0x1a9b('0x43')]?_0x4d4f86[_0x1a9b('0x43')]:_0x4d4f86[_0x1a9b('0x44')]},'attributes':['id',_0x1a9b('0xe')],'raw':!![]});}}})[_0x1a9b('0x36')](function(_0xedb034){var _0x38eeac={};if(_0xedb034){_[_0x1a9b('0x33')](_0x38eeac,_[_0x1a9b('0x46')](_0x369156[_0x1a9b('0x47')],[_0x1a9b('0x48'),_0x1a9b('0x49'),'id']));_0x38eeac[_0x1a9b('0x4a')]=0x15;_0x38eeac[_0x1a9b('0x4b')]=_0x1a9b('0x4c');_0x38eeac[_0x1a9b('0x4d')]=_0xedb034[_0x1a9b('0xe')];_0x38eeac[_0x1a9b('0x4e')]=_0x52b06e[_0x1a9b('0x4f')][_0x1a9b('0xe')];_0x38eeac['UserId']=_0x52b06e['user']['id'];_0x38eeac[_0x1a9b('0x4c')]=!![];_0x38eeac[_0x1a9b('0x50')]=moment()[_0x1a9b('0x51')](_0x1a9b('0x52'));_0x38eeac['calleridnum']=_0x369156[_0x1a9b('0x53')];_0x38eeac['campaigntype']=_0x369156[_0x1a9b('0x43')]?_0x1a9b('0x54'):_0x1a9b('0x55');return db[_0x1a9b('0x56')][_0x1a9b('0x3e')]({'where':{'id':_0x38eeac[_0x1a9b('0x57')]},'attributes':[_0x1a9b('0x58'),_0x1a9b('0x59')]})[_0x1a9b('0x36')](function(_0x403dd9){if(!_[_0x1a9b('0x5a')](_0x252140)&&!_[_0x1a9b('0x5a')](_0x403dd9[_0x1a9b('0x58')])){_0x38eeac[_0x1a9b('0x5b')]=_0x403dd9[_0x1a9b('0x58')];if(!_[_0x1a9b('0x5a')](_0x403dd9[_0x1a9b('0x59')])){_0x38eeac[_0x1a9b('0x5b')]+='\x20'+_0x403dd9['lastName'];}}})[_0x1a9b('0x5c')](function(){return db[_0x1a9b('0x5d')][_0x1a9b('0x3f')](_0x38eeac);});}})[_0x1a9b('0x36')](function(_0x492f16){return db['CmHopperAdditionalPhone'][_0x1a9b('0x42')]({'where':{'CmHopperId':_0xb09b40}});})[_0x1a9b('0x36')](function(){return _0x252140[_0x1a9b('0xf')](0xcc)[_0x1a9b('0x5e')]();})[_0x1a9b('0x3a')](handleError(_0x252140,null));};exports[_0x1a9b('0x5f')]=function(_0x6c5881,_0x17bd17){var _0x4723df=[];return db[_0x1a9b('0x56')][_0x1a9b('0x41')]()[_0x1a9b('0x36')](function(_0x48e3dd){_0x4723df=_[_0x1a9b('0x19')](_0x48e3dd);return _0x6c5881[_0x1a9b('0x4f')][_0x1a9b('0x60')]({'where':{'type':_0x1a9b('0x61'),'dialActive':!![],'dialMethod':_0x1a9b('0x62')},'attributes':['id',_0x1a9b('0x63'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x1a9b('0x36')](function(_0x43261a){if(_0x43261a&&_0x43261a[_0x1a9b('0x2e')]){return db['sequelize'][_0x1a9b('0x64')](function(_0x1dcac3){var _0x546f17={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1a9b('0x51')](_0x1a9b('0x52'))},'VoiceQueueId':{'$in':_[_0x1a9b('0x12')](_0x43261a,'id')},'$or':[{'UserId':null},{'UserId':_0x6c5881[_0x1a9b('0x4f')]['id']}]};var _0x2e49bd={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x43261a)[_0x1a9b('0x32')]([_0x1a9b('0x65'),0x0])[_0x1a9b('0x12')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x6c5881['user']['id']}]};var _0x3186f1={'$or':[_0x546f17,_0x2e49bd]};var _0x2eff0b=[];if(_0x6c5881[_0x1a9b('0x40')][_0x1a9b('0x66')]&&_0x6c5881['body'][_0x1a9b('0x66')]===_0x1a9b('0x67')){if(!_[_0x1a9b('0x68')](_0x6c5881['body']['hopperIds'])){_0x3186f1['id']={'$in':_0x6c5881[_0x1a9b('0x40')]['hopperIds']};}_0x2eff0b=[['priority',_0x1a9b('0x69')],[_0x1a9b('0x6a'),_0x43261a[0x0][_0x1a9b('0x63')]==='ASC'?_0x1a9b('0x6b'):_0x1a9b('0x69')],db[_0x1a9b('0x6c')]['literal'](_0x1a9b('0x6d')),['id','DESC']];}else{if(!_['isEmpty'](_0x6c5881[_0x1a9b('0x40')][_0x1a9b('0x6e')])){_0x3186f1['id']={'$notIn':_0x6c5881[_0x1a9b('0x40')][_0x1a9b('0x6e')]};}_0x2eff0b=[['priority','DESC'],[_0x1a9b('0x6a'),_0x43261a[0x0][_0x1a9b('0x63')]],db[_0x1a9b('0x6c')][_0x1a9b('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x1a9b('0x69')]];}return db[_0x1a9b('0x13')][_0x1a9b('0x70')]({'attributes':['id','scheduledat',_0x1a9b('0x53'),_0x1a9b('0x71')],'where':_0x3186f1,'order':_0x2eff0b,'transaction':_0x1dcac3,'lock':_0x1dcac3['LOCK'][_0x1a9b('0x72')],'include':[{'model':db[_0x1a9b('0x56')],'as':_0x1a9b('0x73'),'attributes':_0x4723df,'include':[{'model':db[_0x1a9b('0x74')],'as':'Company','attributes':['id',_0x1a9b('0xe')]}]},{'model':db['CmList'],'as':_0x1a9b('0x75'),'attributes':['id',_0x1a9b('0xe')]},{'model':db['VoiceQueue'],'as':_0x1a9b('0x76'),'attributes':['id',_0x1a9b('0xe'),_0x1a9b('0x77')]}]})['then'](function(_0x3b9fc8){if(_0x3b9fc8){return _0x3b9fc8['update']({'UserId':_0x6c5881['user']['id']},{'transaction':_0x1dcac3});}});});}})['then'](handleEntityNotFound(_0x17bd17,null))[_0x1a9b('0x36')](respondWithResult(_0x17bd17,null))[_0x1a9b('0x3a')](handleError(_0x17bd17,null));};exports[_0x1a9b('0x78')]=function(_0x18ef58,_0xab4227,_0x2c1920){var _0x43928e=[];var _0x362d29=_0x18ef58[_0x1a9b('0x3c')]['id'];var _0x5ef94f=_0x18ef58[_0x1a9b('0x4f')]['id'];return db['CmContact'][_0x1a9b('0x41')]()[_0x1a9b('0x36')](function(_0x42402e){_0x43928e=_[_0x1a9b('0x19')](_0x42402e);return db[_0x1a9b('0x6c')][_0x1a9b('0x64')](function(_0x3fb0d0){const _0x3de959={'id':_0x362d29};return db[_0x1a9b('0x13')][_0x1a9b('0x70')]({'attributes':['id',_0x1a9b('0x79'),_0x1a9b('0x71')],'where':_0x3de959,'transaction':_0x3fb0d0,'lock':_0x3fb0d0[_0x1a9b('0x7a')][_0x1a9b('0x72')],'include':[{'model':db['CmContact'],'as':_0x1a9b('0x73'),'attributes':_0x43928e,'include':[{'model':db['CmCompany'],'as':_0x1a9b('0x7b'),'attributes':['id',_0x1a9b('0xe')]}]},{'model':db[_0x1a9b('0x7c')],'as':_0x1a9b('0x75'),'attributes':['id',_0x1a9b('0xe')]},{'model':db['VoiceQueue'],'as':_0x1a9b('0x76'),'attributes':['id','name','dialActive']}]})[_0x1a9b('0x36')](function(_0x2a066f){if(_0x2a066f){return _0x2a066f[_0x1a9b('0xb')]({'UserId':_0x5ef94f},{'transaction':_0x3fb0d0});}});});})[_0x1a9b('0x36')](handleEntityNotFound(_0xab4227,null))[_0x1a9b('0x36')](respondWithResult(_0xab4227,null))['catch'](handleError(_0xab4227,null));};exports[_0x1a9b('0x7d')]=function(_0x58a334,_0x438da7){return _0x58a334[_0x1a9b('0x4f')][_0x1a9b('0x60')]({'where':{'type':_0x1a9b('0x61'),'dialActive':!![],'dialMethod':_0x1a9b('0x62')},'attributes':['id'],'raw':!![]})['then'](function(_0x3d0325){if(_0x3d0325&&_0x3d0325[_0x1a9b('0x2e')]){return db['CmHopper'][_0x1a9b('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1a9b('0x51')](_0x1a9b('0x52'))},'VoiceQueueId':{'$in':_[_0x1a9b('0x12')](_0x3d0325,'id')},'$or':[{'UserId':null},{'UserId':_0x58a334['user']['id']}]}});}return 0x0;})['then'](function(_0x16457b){if(!_[_0x1a9b('0x5a')](_0x16457b)&&_['isNumber'](_0x16457b)){return _0x438da7[_0x1a9b('0xf')](0xc8)[_0x1a9b('0x5')]({'contacts':_0x16457b});}else{logger[_0x1a9b('0x7e')](_0x1a9b('0x7f'),'getOpenContacts',0x194,_0x1a9b('0x80'));_0x438da7['sendStatus'](0x194);}})['catch'](handleError(_0x438da7,null));};exports[_0x1a9b('0x81')]=function(_0x2ecaa8,_0x1e5f1c){var _0x18b3a2=shared[_0x1a9b('0x82')];var _0x5c6e01=[];_[_0x1a9b('0x12')](_0x18b3a2,function(_0x17f4b7){_0x5c6e01[_0x1a9b('0x83')]({'id':_0x17f4b7[_0x1a9b('0xe')],'name':_0x17f4b7[_0x1a9b('0xe')],'utcOffset':_0x17f4b7[_0x1a9b('0x84')]});});return _0x1e5f1c[_0x1a9b('0xf')](0xc8)['json']({'tz':_0x5c6e01});};exports['getTimezone']=function(_0x6817a7,_0x4ff768){var _0x22682b=shared[_0x1a9b('0x82')];var _0x7e442b={};if(!_[_0x1a9b('0x5a')](_0x22682b[_0x6817a7[_0x1a9b('0x40')]['id']]))_0x7e442b=_0x22682b[_0x6817a7[_0x1a9b('0x40')]['id']];return _0x4ff768[_0x1a9b('0xf')](0xc8)[_0x1a9b('0x5')](_0x7e442b);}; \ No newline at end of file +var _0x7d9f=['destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getVoiceQueues','preview','length','sequelize','transaction','format','dialPreviewAutoRecallMe','value','direction','isEmpty','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','recallme','Contact','getOpenContacts','outbound','isNumber','entity\x20not\x20found','push','utcOffset','getTimezone','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','update','then','sendStatus','error','stack','send','index','map','CmHopper','fieldName','type','key','model','name','query','filters','concat','$gt','$gte','$lt','$ne','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','find','create','body','describe'];(function(_0x70a8a5,_0x35a384){var _0x2b563b=function(_0x4bbb5b){while(--_0x4bbb5b){_0x70a8a5['push'](_0x70a8a5['shift']());}};_0x2b563b(++_0x35a384);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x3f32e4,_0x4681c7){_0x3f32e4=_0x3f32e4-0x0;var _0x18fbef=_0x7d9f[_0x3f32e4];return _0x18fbef;};'use strict';var moment=require(_0xf7d9('0x0'));var _=require(_0xf7d9('0x1'));var qs=require(_0xf7d9('0x2'));var logger=require(_0xf7d9('0x3'))(_0xf7d9('0x4'));var shared=require('../../config/environment');var db=require(_0xf7d9('0x5'))['db'];function respondWithResult(_0x1051a9,_0xd43b74){_0xd43b74=_0xd43b74||0xc8;return function(_0x159e95){if(_0x159e95){return _0x1051a9[_0xf7d9('0x6')](_0xd43b74)['json'](_0x159e95);}};}function respondWithFilteredResult(_0x4b50c7,_0x2eb0f1){return function(_0x250675){if(_0x250675){var _0x5772b4=typeof _0x2eb0f1[_0xf7d9('0x7')]===_0xf7d9('0x8')&&typeof _0x2eb0f1['limit']===_0xf7d9('0x8');var _0x4cd620=_0x250675[_0xf7d9('0x9')];var _0x33360a=_0x5772b4?0x0:_0x2eb0f1['offset'];var _0x560a34=_0x5772b4?_0x250675[_0xf7d9('0x9')]:_0x2eb0f1[_0xf7d9('0x7')]+_0x2eb0f1[_0xf7d9('0xa')];var _0x58e74c;if(_0x560a34>=_0x4cd620){_0x560a34=_0x4cd620;_0x58e74c=0xc8;}else{_0x58e74c=0xce;}_0x4b50c7['status'](_0x58e74c);return _0x4b50c7[_0xf7d9('0xb')](_0xf7d9('0xc'),_0x33360a+'-'+_0x560a34+'/'+_0x4cd620)[_0xf7d9('0xd')](_0x250675);}return null;};}function saveUpdates(_0x35e156,_0x594dfe){return function(_0x16e680){if(_0x16e680){return _0x16e680[_0xf7d9('0xe')](_0x35e156)[_0xf7d9('0xf')](function(_0x403859){return _0x403859;});}return null;};}function handleEntityNotFound(_0x49f766,_0x189c82){return function(_0x359843){if(!_0x359843){_0x49f766[_0xf7d9('0x10')](0x194);}return _0x359843;};}function handleError(_0x18b119,_0x5d3029){_0x5d3029=_0x5d3029||0x1f4;return function(_0x405ed4){logger[_0xf7d9('0x11')](_0x405ed4[_0xf7d9('0x12')]);if(_0x405ed4['name']){delete _0x405ed4['name'];}_0x18b119[_0xf7d9('0x6')](_0x5d3029)[_0xf7d9('0x13')](_0x405ed4);};}exports[_0xf7d9('0x14')]=function(_0x5d1098,_0x44ebd3){var _0x32b68d={},_0x5eb7c9={},_0x1e4298={'count':0x0,'rows':[]};var _0x4ab10a=_[_0xf7d9('0x15')](db[_0xf7d9('0x16')]['rawAttributes'],function(_0x34acd2){return{'name':_0x34acd2[_0xf7d9('0x17')],'type':_0x34acd2[_0xf7d9('0x18')][_0xf7d9('0x19')]};});_0x5eb7c9[_0xf7d9('0x1a')]=_[_0xf7d9('0x15')](_0x4ab10a,_0xf7d9('0x1b'));_0x5eb7c9[_0xf7d9('0x1c')]=_['keys'](_0x5d1098['query']);_0x5eb7c9[_0xf7d9('0x1d')]=_['intersection'](_0x5eb7c9[_0xf7d9('0x1a')],_0x5eb7c9[_0xf7d9('0x1c')]);_0x5eb7c9['filters']=_[_0xf7d9('0x1e')](_0x5eb7c9[_0xf7d9('0x1d')],['$and','$or',_0xf7d9('0x1f'),_0xf7d9('0x20'),_0xf7d9('0x21'),'$lte',_0xf7d9('0x22'),'$eq',_0xf7d9('0x23'),_0xf7d9('0x24'),_0xf7d9('0x25'),'$in',_0xf7d9('0x26'),_0xf7d9('0x27'),_0xf7d9('0x28'),_0xf7d9('0x29'),_0xf7d9('0x2a'),'$like',_0xf7d9('0x2b'),_0xf7d9('0x2c'),_0xf7d9('0x2d'),_0xf7d9('0x2e')]);_0x32b68d['attributes']=_[_0xf7d9('0x2f')](_0x5eb7c9[_0xf7d9('0x1a')],qs[_0xf7d9('0x30')](_0x5d1098[_0xf7d9('0x1c')][_0xf7d9('0x30')]));_0x32b68d[_0xf7d9('0x31')]=_0x32b68d['attributes']['length']?_0x32b68d['attributes']:_0x5eb7c9[_0xf7d9('0x1a')];if(!_0x5d1098['query'][_0xf7d9('0x32')]('nolimit')){_0x32b68d[_0xf7d9('0xa')]=qs['limit'](_0x5d1098['query']['limit']);_0x32b68d[_0xf7d9('0x7')]=qs['offset'](_0x5d1098[_0xf7d9('0x1c')][_0xf7d9('0x7')]);}_0x32b68d[_0xf7d9('0x33')]=qs[_0xf7d9('0x34')](_0x5d1098[_0xf7d9('0x1c')][_0xf7d9('0x34')]);_0x32b68d[_0xf7d9('0x35')]=qs[_0xf7d9('0x1d')](_['pick'](_0x5d1098[_0xf7d9('0x1c')],_0x5eb7c9[_0xf7d9('0x1d')]),_0x4ab10a);if(_0x5d1098['query']['filter']){_0x32b68d[_0xf7d9('0x35')]=_[_0xf7d9('0x36')](_0x32b68d[_0xf7d9('0x35')],{'$or':_['map'](_0x4ab10a,function(_0x449311){if(_0x449311[_0xf7d9('0x18')]!==_0xf7d9('0x37')){var _0x1be610={};_0x1be610[_0x449311[_0xf7d9('0x1b')]]={'$like':'%'+_0x5d1098[_0xf7d9('0x1c')][_0xf7d9('0x38')]+'%'};return _0x1be610;}})});}_0x32b68d=_[_0xf7d9('0x36')]({},_0x32b68d,_0x5d1098[_0xf7d9('0x39')]);var _0x1c42bb={'where':_0x32b68d[_0xf7d9('0x35')]};return db['CmHopper'][_0xf7d9('0x9')](_0x1c42bb)['then'](function(_0x17bc77){_0x1e4298[_0xf7d9('0x9')]=_0x17bc77;if(_0x5d1098[_0xf7d9('0x1c')][_0xf7d9('0x3a')]){_0x32b68d['include']=[{'all':!![]}];}return db['CmHopper'][_0xf7d9('0x3b')](_0x32b68d);})['then'](function(_0x16e604){_0x1e4298[_0xf7d9('0x3c')]=_0x16e604;return _0x1e4298;})[_0xf7d9('0xf')](respondWithFilteredResult(_0x44ebd3,_0x32b68d))[_0xf7d9('0x3d')](handleError(_0x44ebd3,null));};exports['show']=function(_0x54150a,_0xc31f5a){var _0x410c72={'raw':!![],'where':{'id':_0x54150a[_0xf7d9('0x3e')]['id']}},_0x148872={};_0x148872['model']=_[_0xf7d9('0x3f')](db[_0xf7d9('0x16')][_0xf7d9('0x40')]);_0x148872[_0xf7d9('0x1c')]=_[_0xf7d9('0x3f')](_0x54150a['query']);_0x148872[_0xf7d9('0x1d')]=_[_0xf7d9('0x2f')](_0x148872[_0xf7d9('0x1a')],_0x148872[_0xf7d9('0x1c')]);_0x410c72[_0xf7d9('0x31')]=_[_0xf7d9('0x2f')](_0x148872[_0xf7d9('0x1a')],qs[_0xf7d9('0x30')](_0x54150a[_0xf7d9('0x1c')][_0xf7d9('0x30')]));_0x410c72[_0xf7d9('0x31')]=_0x410c72[_0xf7d9('0x31')]['length']?_0x410c72[_0xf7d9('0x31')]:_0x148872[_0xf7d9('0x1a')];if(_0x54150a['query']['includeAll']){_0x410c72['include']=[{'all':!![]}];}_0x410c72=_[_0xf7d9('0x36')]({},_0x410c72,_0x54150a['options']);return db[_0xf7d9('0x16')][_0xf7d9('0x41')](_0x410c72)[_0xf7d9('0xf')](handleEntityNotFound(_0xc31f5a,null))[_0xf7d9('0xf')](respondWithResult(_0xc31f5a,null))[_0xf7d9('0x3d')](handleError(_0xc31f5a,null));};exports['create']=function(_0x30a1ef,_0x3ba2f8){return db[_0xf7d9('0x16')][_0xf7d9('0x42')](_0x30a1ef[_0xf7d9('0x43')],{})['then'](respondWithResult(_0x3ba2f8,0xc9))['catch'](handleError(_0x3ba2f8,null));};exports[_0xf7d9('0xe')]=function(_0x113a2b,_0x1cf7e3){if(_0x113a2b[_0xf7d9('0x43')]['id']){delete _0x113a2b[_0xf7d9('0x43')]['id'];}return db['CmHopper'][_0xf7d9('0x41')]({'where':{'id':_0x113a2b['params']['id']}})[_0xf7d9('0xf')](handleEntityNotFound(_0x1cf7e3,null))[_0xf7d9('0xf')](saveUpdates(_0x113a2b[_0xf7d9('0x43')],null))[_0xf7d9('0xf')](respondWithResult(_0x1cf7e3,null))[_0xf7d9('0x3d')](handleError(_0x1cf7e3,null));};exports[_0xf7d9('0x44')]=function(_0x4003e9,_0x3087d8){return db[_0xf7d9('0x16')][_0xf7d9('0x44')]()[_0xf7d9('0xf')](respondWithResult(_0x3087d8,null))[_0xf7d9('0x3d')](handleError(_0x3087d8,null));};exports[_0xf7d9('0x45')]=function(_0x3cdeb5,_0x50731a){var _0xff0aa2;var _0x1f1ee5=_0x3cdeb5['params']['id'];return db['CmHopper'][_0xf7d9('0x41')]({'where':{'id':_0x3cdeb5['params']['id']}})['then'](handleEntityNotFound(_0x50731a,null))[_0xf7d9('0xf')](function(_0x1dae4b){if(_0x1dae4b){return _0x1dae4b[_0xf7d9('0x45')]()[_0xf7d9('0xf')](function(_0xf923e0){return _0xf923e0;});}})[_0xf7d9('0xf')](function(_0x152bf8){_0xff0aa2=_0x152bf8;if(_0x152bf8){if(_0x152bf8[_0xf7d9('0x46')]||_0x152bf8[_0xf7d9('0x47')]){return db[_0x152bf8[_0xf7d9('0x46')]?_0xf7d9('0x48'):_0xf7d9('0x49')]['find']({'where':{'id':_0x152bf8['VoiceQueueId']?_0x152bf8[_0xf7d9('0x46')]:_0x152bf8[_0xf7d9('0x47')]},'attributes':['id',_0xf7d9('0x1b')],'raw':!![]});}}})[_0xf7d9('0xf')](function(_0x5b62b4){var _0x472e00={};if(_0x5b62b4){_[_0xf7d9('0x36')](_0x472e00,_[_0xf7d9('0x4a')](_0xff0aa2[_0xf7d9('0x4b')],[_0xf7d9('0x4c'),_0xf7d9('0x4d'),'id']));_0x472e00[_0xf7d9('0x4e')]=0x15;_0x472e00[_0xf7d9('0x4f')]=_0xf7d9('0x50');_0x472e00[_0xf7d9('0x51')]=_0x5b62b4[_0xf7d9('0x1b')];_0x472e00['membername']=_0x3cdeb5[_0xf7d9('0x52')][_0xf7d9('0x1b')];_0x472e00[_0xf7d9('0x53')]=_0x3cdeb5[_0xf7d9('0x52')]['id'];_0x472e00[_0xf7d9('0x50')]=!![];_0x472e00[_0xf7d9('0x54')]=moment()['format'](_0xf7d9('0x55'));_0x472e00[_0xf7d9('0x56')]=_0xff0aa2[_0xf7d9('0x57')];_0x472e00[_0xf7d9('0x58')]=_0xff0aa2[_0xf7d9('0x46')]?'queue':_0xf7d9('0x59');return db[_0xf7d9('0x5a')][_0xf7d9('0x41')]({'where':{'id':_0x472e00[_0xf7d9('0x5b')]},'attributes':[_0xf7d9('0x5c'),_0xf7d9('0x5d')]})[_0xf7d9('0xf')](function(_0x45a7dd){if(!_[_0xf7d9('0x5e')](_0x50731a)&&!_[_0xf7d9('0x5e')](_0x45a7dd[_0xf7d9('0x5c')])){_0x472e00[_0xf7d9('0x5f')]=_0x45a7dd[_0xf7d9('0x5c')];if(!_[_0xf7d9('0x5e')](_0x45a7dd[_0xf7d9('0x5d')])){_0x472e00[_0xf7d9('0x5f')]+='\x20'+_0x45a7dd['lastName'];}}})[_0xf7d9('0x60')](function(){return db[_0xf7d9('0x61')]['create'](_0x472e00);});}})[_0xf7d9('0xf')](function(_0x438a81){return db[_0xf7d9('0x62')][_0xf7d9('0x45')]({'where':{'CmHopperId':_0x1f1ee5}});})[_0xf7d9('0xf')](function(){return _0x50731a['status'](0xcc)[_0xf7d9('0x63')]();})[_0xf7d9('0x3d')](handleError(_0x50731a,null));};exports['getPreview']=function(_0x2c31ff,_0x1f2378){var _0x5cc42e=[];return db[_0xf7d9('0x5a')][_0xf7d9('0x44')]()[_0xf7d9('0xf')](function(_0x4ed050){_0x5cc42e=_['keys'](_0x4ed050);return _0x2c31ff['user'][_0xf7d9('0x64')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xf7d9('0x65')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0xf7d9('0xf')](function(_0x16ed09){if(_0x16ed09&&_0x16ed09[_0xf7d9('0x66')]){return db[_0xf7d9('0x67')][_0xf7d9('0x68')](function(_0x226cba){var _0x56feae={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf7d9('0x69')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xf7d9('0x15')](_0x16ed09,'id')},'$or':[{'UserId':null},{'UserId':_0x2c31ff[_0xf7d9('0x52')]['id']}]};var _0x38dbc4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x16ed09)[_0xf7d9('0x38')]([_0xf7d9('0x6a'),0x0])[_0xf7d9('0x15')]('id')[_0xf7d9('0x6b')]()},'$or':[{'UserId':null},{'UserId':_0x2c31ff['user']['id']}]};var _0x56055b={'$or':[_0x56feae,_0x38dbc4]};var _0x3bb613=[];if(_0x2c31ff[_0xf7d9('0x43')]['direction']&&_0x2c31ff[_0xf7d9('0x43')][_0xf7d9('0x6c')]==='prev'){if(!_[_0xf7d9('0x6d')](_0x2c31ff[_0xf7d9('0x43')][_0xf7d9('0x6e')])){_0x56055b['id']={'$in':_0x2c31ff[_0xf7d9('0x43')][_0xf7d9('0x6e')]};}_0x3bb613=[[_0xf7d9('0x6f'),'ASC'],[_0xf7d9('0x70'),_0x16ed09[0x0][_0xf7d9('0x71')]==='ASC'?_0xf7d9('0x72'):'ASC'],db[_0xf7d9('0x67')][_0xf7d9('0x73')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0xf7d9('0x6d')](_0x2c31ff[_0xf7d9('0x43')][_0xf7d9('0x6e')])){_0x56055b['id']={'$notIn':_0x2c31ff[_0xf7d9('0x43')]['hopperIds']};}_0x3bb613=[[_0xf7d9('0x6f'),_0xf7d9('0x72')],[_0xf7d9('0x70'),_0x16ed09[0x0][_0xf7d9('0x71')]],db[_0xf7d9('0x67')][_0xf7d9('0x73')](_0xf7d9('0x74')),['id',_0xf7d9('0x75')]];}return db[_0xf7d9('0x16')][_0xf7d9('0x76')]({'attributes':['id',_0xf7d9('0x77'),_0xf7d9('0x57'),'recallme'],'where':_0x56055b,'order':_0x3bb613,'transaction':_0x226cba,'lock':_0x226cba[_0xf7d9('0x78')][_0xf7d9('0x79')],'include':[{'model':db[_0xf7d9('0x5a')],'as':'Contact','attributes':_0x5cc42e,'include':[{'model':db[_0xf7d9('0x7a')],'as':_0xf7d9('0x7b'),'attributes':['id',_0xf7d9('0x1b')]}]},{'model':db[_0xf7d9('0x7c')],'as':_0xf7d9('0x7d'),'attributes':['id',_0xf7d9('0x1b')]},{'model':db[_0xf7d9('0x48')],'as':_0xf7d9('0x7e'),'attributes':['id',_0xf7d9('0x1b'),_0xf7d9('0x7f')]}]})['then'](function(_0x1d0aa9){if(_0x1d0aa9){return _0x1d0aa9[_0xf7d9('0xe')]({'UserId':_0x2c31ff[_0xf7d9('0x52')]['id']},{'transaction':_0x226cba});}});});}})[_0xf7d9('0xf')](handleEntityNotFound(_0x1f2378,null))[_0xf7d9('0xf')](respondWithResult(_0x1f2378,null))[_0xf7d9('0x3d')](handleError(_0x1f2378,null));};exports[_0xf7d9('0x80')]=function(_0x56d52e,_0x1ac106,_0x559ee7){var _0x486994=[];var _0x7e094c=_0x56d52e[_0xf7d9('0x3e')]['id'];var _0x35c54e=_0x56d52e[_0xf7d9('0x52')]['id'];return db[_0xf7d9('0x5a')][_0xf7d9('0x44')]()[_0xf7d9('0xf')](function(_0x36dc41){_0x486994=_[_0xf7d9('0x3f')](_0x36dc41);return db['sequelize'][_0xf7d9('0x68')](function(_0x424774){const _0x4e1d85={'id':_0x7e094c};return db['CmHopper']['findOne']({'attributes':['id','scheduledat',_0xf7d9('0x81')],'where':_0x4e1d85,'transaction':_0x424774,'lock':_0x424774[_0xf7d9('0x78')][_0xf7d9('0x79')],'include':[{'model':db['CmContact'],'as':_0xf7d9('0x82'),'attributes':_0x486994,'include':[{'model':db['CmCompany'],'as':_0xf7d9('0x7b'),'attributes':['id','name']}]},{'model':db[_0xf7d9('0x7c')],'as':'List','attributes':['id',_0xf7d9('0x1b')]},{'model':db['VoiceQueue'],'as':_0xf7d9('0x7e'),'attributes':['id',_0xf7d9('0x1b'),_0xf7d9('0x7f')]}]})[_0xf7d9('0xf')](function(_0x336ba0){if(_0x336ba0){return _0x336ba0['update']({'UserId':_0x35c54e},{'transaction':_0x424774});}});});})[_0xf7d9('0xf')](handleEntityNotFound(_0x1ac106,null))['then'](respondWithResult(_0x1ac106,null))[_0xf7d9('0x3d')](handleError(_0x1ac106,null));};exports[_0xf7d9('0x83')]=function(_0x52673b,_0x150d8a){return _0x52673b['user'][_0xf7d9('0x64')]({'where':{'type':_0xf7d9('0x84'),'dialActive':!![],'dialMethod':_0xf7d9('0x65')},'attributes':['id'],'raw':!![]})['then'](function(_0x1b97cc){if(_0x1b97cc&&_0x1b97cc['length']){return db['CmHopper'][_0xf7d9('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xf7d9('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x1b97cc,'id')},'$or':[{'UserId':null},{'UserId':_0x52673b[_0xf7d9('0x52')]['id']}]}});}return 0x0;})[_0xf7d9('0xf')](function(_0x2d8d62){if(!_[_0xf7d9('0x5e')](_0x2d8d62)&&_[_0xf7d9('0x85')](_0x2d8d62)){return _0x150d8a[_0xf7d9('0x6')](0xc8)[_0xf7d9('0xd')]({'contacts':_0x2d8d62});}else{logger[_0xf7d9('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xf7d9('0x83'),0x194,_0xf7d9('0x86'));_0x150d8a['sendStatus'](0x194);}})[_0xf7d9('0x3d')](handleError(_0x150d8a,null));};exports['getTimezones']=function(_0x5d5022,_0x2bf903){var _0x3e16b0=shared['timezones'];var _0x65d731=[];_[_0xf7d9('0x15')](_0x3e16b0,function(_0x1fd85f){_0x65d731[_0xf7d9('0x87')]({'id':_0x1fd85f[_0xf7d9('0x1b')],'name':_0x1fd85f[_0xf7d9('0x1b')],'utcOffset':_0x1fd85f[_0xf7d9('0x88')]});});return _0x2bf903[_0xf7d9('0x6')](0xc8)[_0xf7d9('0xd')]({'tz':_0x65d731});};exports[_0xf7d9('0x89')]=function(_0x335a04,_0x3461c0){var _0x2cc0f9=shared[_0xf7d9('0x8a')];var _0x46d836={};if(!_[_0xf7d9('0x5e')](_0x2cc0f9[_0x335a04[_0xf7d9('0x43')]['id']]))_0x46d836=_0x2cc0f9[_0x335a04['body']['id']];return _0x3461c0[_0xf7d9('0x6')](0xc8)[_0xf7d9('0xd')](_0x46d836);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 46a2e43..43e9c6f 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x4eeb0b,_0x3ea590){var _0x403f61=function(_0x2e5b8b){while(--_0x2e5b8b){_0x4eeb0b['push'](_0x4eeb0b['shift']());}};_0x403f61(++_0x3ea590);}(_0xafc4,0x69));var _0x4afc=function(_0x74306c,_0x558214){_0x74306c=_0x74306c-0x0;var _0x1027cb=_0xafc4[_0x74306c];return _0x1027cb;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x4afc('0xa')]},{'name':_0x4afc('0xb'),'fields':[_0x4afc('0xb')]},{'name':_0x4afc('0xc'),'fields':[_0x4afc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x571827,_0x5913fd){var _0xdccd1d=function(_0x5d1fe3){while(--_0x5d1fe3){_0x571827['push'](_0x571827['shift']());}};_0xdccd1d(++_0x5913fd);}(_0x6d38,0x1ef));var _0x86d3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6d38[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x86d3('0x9')]},{'name':_0x86d3('0xa'),'fields':[_0x86d3('0xa')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index f2677f6..f46186d 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 _0x3cb4=['include','map','model','GetCmHopper','ShowCmHopper','raw','CreateCmHopper','body','UpdateCmHopper','CmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','length','UserId','push','includes','all','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','name','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','attributes','limit'];(function(_0x353222,_0x519e9f){var _0x2c08da=function(_0x4fe0a8){while(--_0x4fe0a8){_0x353222['push'](_0x353222['shift']());}};_0x2c08da(++_0x519e9f);}(_0x3cb4,0x1f1));var _0x43cb=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x3cb4[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var util=require(_0x43cb('0x0'));var moment=require(_0x43cb('0x1'));var BPromise=require(_0x43cb('0x2'));var db=require(_0x43cb('0x3'))['db'];var logger=require(_0x43cb('0x4'))(_0x43cb('0x5'));var jayson=require(_0x43cb('0x6'));var client=jayson[_0x43cb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd0cdc5,_0x183d87,_0x41a4dc){return new BPromise(function(_0x520a60,_0x3246e8){return client[_0x43cb('0x8')](_0xd0cdc5,_0x41a4dc)[_0x43cb('0x9')](function(_0x5f0427){logger[_0x43cb('0xa')](_0x43cb('0xb'),_0x183d87,_0x43cb('0xc'));logger[_0x43cb('0xd')](_0x43cb('0xe'),_0x183d87,'request\x20sent',JSON[_0x43cb('0xf')](_0x5f0427));if(_0x5f0427[_0x43cb('0x10')]){if(_0x5f0427[_0x43cb('0x10')]['code']===0x1f4){logger['error'](_0x43cb('0xb'),_0x183d87,_0x5f0427['error']['message']);return _0x3246e8(_0x5f0427['error']['message']);}logger[_0x43cb('0x10')](_0x43cb('0xb'),_0x183d87,_0x5f0427[_0x43cb('0x10')][_0x43cb('0x11')]);return _0x520a60(_0x5f0427[_0x43cb('0x10')][_0x43cb('0x11')]);}else{logger[_0x43cb('0xa')](_0x43cb('0xb'),_0x183d87,_0x43cb('0xc'));_0x520a60(_0x5f0427[_0x43cb('0x12')][_0x43cb('0x11')]);}})[_0x43cb('0x13')](function(_0x9a8ae0){logger[_0x43cb('0x10')](_0x43cb('0xb'),_0x183d87,_0x9a8ae0);_0x3246e8(_0x9a8ae0);});});}exports['GetCmHopper']=function(_0x4d939b){var _0x4a8455=this;return new Promise(function(_0x366af3,_0x15e135){return db['CmHopper'][_0x43cb('0x14')]({'raw':_0x4d939b[_0x43cb('0x15')]?_0x4d939b[_0x43cb('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4d939b[_0x43cb('0x15')]?_0x4d939b[_0x43cb('0x15')][_0x43cb('0x16')]||null:null,'attributes':_0x4d939b['options']?_0x4d939b['options'][_0x43cb('0x17')]||null:null,'limit':_0x4d939b[_0x43cb('0x15')]?_0x4d939b[_0x43cb('0x15')][_0x43cb('0x18')]||null:null,'include':_0x4d939b[_0x43cb('0x15')]?_0x4d939b[_0x43cb('0x15')][_0x43cb('0x19')]?_[_0x43cb('0x1a')](_0x4d939b[_0x43cb('0x15')]['include'],function(_0x2ab4e3){return{'model':db[_0x2ab4e3[_0x43cb('0x1b')]],'as':_0x2ab4e3['as'],'attributes':_0x2ab4e3[_0x43cb('0x17')],'include':_0x2ab4e3[_0x43cb('0x19')]?_[_0x43cb('0x1a')](_0x2ab4e3['include'],function(_0x649af6){return{'model':db[_0x649af6[_0x43cb('0x1b')]],'as':_0x649af6['as'],'attributes':_0x649af6['attributes'],'include':_0x649af6['include']?_[_0x43cb('0x1a')](_0x649af6[_0x43cb('0x19')],function(_0x53095f){return{'model':db[_0x53095f[_0x43cb('0x1b')]],'as':_0x53095f['as'],'attributes':_0x53095f['attributes']};}):[]};}):[]};}):[]:[]})[_0x43cb('0x9')](function(_0x2dbd36){logger[_0x43cb('0xa')](_0x43cb('0x1c'),_0x4d939b);logger[_0x43cb('0xd')]('GetCmHopper',_0x4d939b,JSON[_0x43cb('0xf')](_0x2dbd36));_0x366af3(_0x2dbd36);})[_0x43cb('0x13')](function(_0x5552c2){logger[_0x43cb('0x10')]('GetCmHopper',_0x5552c2[_0x43cb('0x11')],_0x4d939b);_0x15e135(_0x4a8455[_0x43cb('0x10')](0x1f4,_0x5552c2[_0x43cb('0x11')]));});});};exports[_0x43cb('0x1d')]=function(_0x77420){var _0x5173c1=this;return new Promise(function(_0x1a27fa,_0x562f14){return db['CmHopper']['find']({'raw':_0x77420['options']?_0x77420['options'][_0x43cb('0x1e')]===undefined?!![]:![]:!![],'where':_0x77420['options']?_0x77420['options'][_0x43cb('0x16')]||null:null,'attributes':_0x77420[_0x43cb('0x15')]?_0x77420[_0x43cb('0x15')][_0x43cb('0x17')]||null:null,'include':_0x77420[_0x43cb('0x15')]?_0x77420[_0x43cb('0x15')][_0x43cb('0x19')]?_[_0x43cb('0x1a')](_0x77420[_0x43cb('0x15')]['include'],function(_0x475403){return{'model':db[_0x475403[_0x43cb('0x1b')]],'as':_0x475403['as'],'attributes':_0x475403[_0x43cb('0x17')],'include':_0x475403[_0x43cb('0x19')]?_[_0x43cb('0x1a')](_0x475403[_0x43cb('0x19')],function(_0x3e2800){return{'model':db[_0x3e2800[_0x43cb('0x1b')]],'as':_0x3e2800['as'],'attributes':_0x3e2800[_0x43cb('0x17')],'include':_0x3e2800['include']?_[_0x43cb('0x1a')](_0x3e2800[_0x43cb('0x19')],function(_0x81b552){return{'model':db[_0x81b552[_0x43cb('0x1b')]],'as':_0x81b552['as'],'attributes':_0x81b552['attributes']};}):[]};}):[]};}):[]:[]})[_0x43cb('0x9')](function(_0x27e1aa){logger['info'](_0x43cb('0x1d'),_0x77420);logger[_0x43cb('0xd')](_0x43cb('0x1d'),_0x77420,JSON[_0x43cb('0xf')](_0x27e1aa));_0x1a27fa(_0x27e1aa);})[_0x43cb('0x13')](function(_0x3276a4){logger[_0x43cb('0x10')](_0x43cb('0x1d'),_0x3276a4['message'],_0x77420);_0x562f14(_0x5173c1['error'](0x1f4,_0x3276a4['message']));});});};exports[_0x43cb('0x1f')]=function(_0x5a0382){var _0x4280c4=this;return new Promise(function(_0x53de1c,_0x31e421){return db['CmHopper']['create'](_0x5a0382[_0x43cb('0x20')],{'raw':_0x5a0382[_0x43cb('0x15')]?_0x5a0382[_0x43cb('0x15')][_0x43cb('0x1e')]===undefined?!![]:![]:!![]})[_0x43cb('0x9')](function(_0x3379b0){logger[_0x43cb('0xa')](_0x43cb('0x1f'),_0x5a0382);logger[_0x43cb('0xd')](_0x43cb('0x1f'),_0x5a0382,JSON['stringify'](_0x3379b0));_0x53de1c(_0x3379b0);})[_0x43cb('0x13')](function(_0x60ad23){logger[_0x43cb('0x10')]('CreateCmHopper',_0x60ad23['message'],_0x5a0382);_0x31e421(_0x4280c4['error'](0x1f4,_0x60ad23['message']));});});};exports[_0x43cb('0x21')]=function(_0xa14bf4){var _0x1a1099=this;return new Promise(function(_0xf9dd68,_0x204073){return db[_0x43cb('0x22')][_0x43cb('0x23')](_0xa14bf4[_0x43cb('0x20')],{'raw':_0xa14bf4[_0x43cb('0x15')]?_0xa14bf4[_0x43cb('0x15')][_0x43cb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa14bf4[_0x43cb('0x15')]?_0xa14bf4[_0x43cb('0x15')][_0x43cb('0x16')]||null:null,'attributes':_0xa14bf4[_0x43cb('0x15')]?_0xa14bf4[_0x43cb('0x15')][_0x43cb('0x17')]||null:null,'limit':_0xa14bf4[_0x43cb('0x15')]?_0xa14bf4[_0x43cb('0x15')][_0x43cb('0x18')]||null:null})[_0x43cb('0x9')](function(_0x19864e){logger['info'](_0x43cb('0x21'),_0xa14bf4);logger[_0x43cb('0xa')](_0x43cb('0x24'),JSON[_0x43cb('0xf')](_0xa14bf4[_0x43cb('0x15')][_0x43cb('0x16')]),_0xa14bf4[_0x43cb('0x20')][_0x43cb('0x25')]);logger[_0x43cb('0xd')](_0x43cb('0x21'),_0xa14bf4,JSON[_0x43cb('0xf')](_0x19864e));_0xf9dd68(_0x19864e);})[_0x43cb('0x13')](function(_0x26cb29){logger[_0x43cb('0x10')](_0x43cb('0x21'),_0x26cb29[_0x43cb('0x11')],_0xa14bf4);_0x204073(_0x1a1099[_0x43cb('0x10')](0x1f4,_0x26cb29[_0x43cb('0x11')]));});});};exports['DestroyCmHopper']=function(_0x1d185d){var _0x482be0=this;return new Promise(function(_0x4040ad,_0xf72fab){return db[_0x43cb('0x22')]['destroy']({'where':_0x1d185d[_0x43cb('0x15')]?_0x1d185d[_0x43cb('0x15')][_0x43cb('0x16')]||null:null})[_0x43cb('0x9')](function(_0x3ccaeb){logger[_0x43cb('0xa')](_0x43cb('0x26'),_0x1d185d);logger['debug'](_0x43cb('0x26'),_0x1d185d,JSON[_0x43cb('0xf')](_0x3ccaeb));_0x4040ad(_0x3ccaeb);})[_0x43cb('0x13')](function(_0x2ef140){logger[_0x43cb('0x10')]('DestroyCmHopper',_0x2ef140['message'],_0x1d185d);_0xf72fab(_0x482be0[_0x43cb('0x10')](0x1f4,_0x2ef140[_0x43cb('0x11')]));});});};exports[_0x43cb('0x27')]=function(_0x2a48f9){var _0xedc49b=this;return new Promise(function(_0x4d2c06,_0x4cb5fb){return db[_0x43cb('0x28')][_0x43cb('0x29')]()[_0x43cb('0x9')](function(_0x4107bd){return db[_0x43cb('0x2a')][_0x43cb('0x2b')](function(_0x3b38da){return db['CmHopper'][_0x43cb('0x14')]({'where':_0x2a48f9[_0x43cb('0x15')]?_0x2a48f9[_0x43cb('0x15')]['where']||null:null,'attributes':_0x2a48f9[_0x43cb('0x15')]?_0x2a48f9[_0x43cb('0x15')]['attributes']||null:null,'limit':_0x2a48f9[_0x43cb('0x15')]?_0x2a48f9[_0x43cb('0x15')][_0x43cb('0x18')]||null:null,'order':_0x2a48f9[_0x43cb('0x15')]?_0x2a48f9[_0x43cb('0x15')][_0x43cb('0x2c')]||null:null,'transaction':_0x3b38da,'lock':_0x3b38da[_0x43cb('0x2d')][_0x43cb('0x2e')],'include':[{'model':db['CmContact'],'as':_0x43cb('0x2f'),'attributes':_[_0x43cb('0x30')](_0x4107bd)},{'model':db[_0x43cb('0x31')],'as':_0x43cb('0x32'),'attributes':['id','name','voicePause']}]})['then'](function(_0x2bbf43){var _0x2464a3=[];var _0x58c265=[];for(var _0x2802fc=0x0;_0x2802fc<_0x2bbf43[_0x43cb('0x33')];_0x2802fc+=0x1){var _0x23f4ba=_0x2bbf43[_0x2802fc][_0x43cb('0x34')];if(_0x23f4ba===null){_0x2464a3[_0x43cb('0x35')](_0x2bbf43[_0x2802fc][_0x43cb('0x23')](_0x2a48f9[_0x43cb('0x20')],{'transaction':_0x3b38da}));}else if(!_0x58c265[_0x43cb('0x36')](_0x23f4ba)){_0x58c265[_0x43cb('0x35')](_0x23f4ba);_0x2464a3[_0x43cb('0x35')](_0x2bbf43[_0x2802fc][_0x43cb('0x23')](_0x2a48f9[_0x43cb('0x20')],{'transaction':_0x3b38da}));}}return BPromise[_0x43cb('0x37')](_0x2464a3);});})[_0x43cb('0x9')](function(_0x48abc9){logger[_0x43cb('0xa')]('GetContactDialer',_0x2a48f9);if(_0x48abc9[_0x43cb('0x33')]>0x0){logger[_0x43cb('0xa')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x48abc9[0x0][_0x43cb('0x38')]['id'],_0x48abc9[0x0][_0x43cb('0x38')][_0x43cb('0x39')],_0x48abc9[0x0][_0x43cb('0x38')][_0x43cb('0x25')]);}logger[_0x43cb('0xd')]('GetContactDialer',_0x2a48f9,JSON[_0x43cb('0xf')](_0x48abc9));_0x4d2c06(_0x48abc9);})[_0x43cb('0x13')](function(_0x5eb663){logger[_0x43cb('0x10')](_0x43cb('0x27'),_0x5eb663['message'],_0x2a48f9);_0x4cb5fb(_0xedc49b[_0x43cb('0x10')](0x1f4,_0x5eb663[_0x43cb('0x11')]));});});});};exports[_0x43cb('0x3a')]=function(_0x2177e3){var _0x4989d0=this;return new Promise(function(_0x4cea3d,_0x22f39b){return db[_0x43cb('0x2a')][_0x43cb('0x2b')](function(_0x11f82b){return db[_0x43cb('0x3b')][_0x43cb('0x3c')](_0x2177e3[_0x43cb('0x20')],{'raw':_0x2177e3[_0x43cb('0x15')]?_0x2177e3['options'][_0x43cb('0x1e')]===undefined?!![]:![]:!![],'transaction':_0x11f82b})[_0x43cb('0x9')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x2177e3[_0x43cb('0x15')][_0x43cb('0x16')]),_0x2177e3[_0x43cb('0x15')]['where'][_0x43cb('0x25')]);return db['CmHopper'][_0x43cb('0x3d')]({'where':_0x2177e3['options']?_0x2177e3[_0x43cb('0x15')]['where']||null:null,'transaction':_0x11f82b});});})[_0x43cb('0x9')](function(_0x40288a){logger['info'](_0x43cb('0x3a'),_0x2177e3);logger[_0x43cb('0xd')](_0x43cb('0x3a'),_0x2177e3,JSON[_0x43cb('0xf')](_0x40288a));_0x4cea3d(_0x40288a);})[_0x43cb('0x13')](function(_0x4c5ab7){logger[_0x43cb('0x10')]('MoveContactManagedDialer',_0x4c5ab7['message'],_0x2177e3);_0x22f39b(_0x4989d0[_0x43cb('0x10')](0x1f4,_0x4c5ab7['message']));});});};exports[_0x43cb('0x3e')]=function(_0x16ffe4){var _0x249471=this;return new Promise(function(_0x33ec26,_0x4db737){return db[_0x43cb('0x22')][_0x43cb('0x14')]({'raw':_0x16ffe4['options']?_0x16ffe4[_0x43cb('0x15')][_0x43cb('0x1e')]===undefined?!![]:![]:!![],'where':_0x16ffe4[_0x43cb('0x15')]?_0x16ffe4[_0x43cb('0x15')][_0x43cb('0x16')]||null:null,'attributes':[[db[_0x43cb('0x2a')]['fn'](_0x43cb('0x3f'),db[_0x43cb('0x2a')]['fn']('IF',db[_0x43cb('0x2a')][_0x43cb('0x40')](_0x43cb('0x41')+util[_0x43cb('0x42')](_0x43cb('0x43'),moment()[_0x43cb('0x42')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x43cb('0x44')))),_0x43cb('0x45')]]})['then'](function(_0x45e6bd){logger[_0x43cb('0xa')](_0x43cb('0x3e'),_0x16ffe4);logger['debug'](_0x43cb('0x3e'),_0x16ffe4,JSON['stringify'](_0x45e6bd));_0x33ec26(_0x45e6bd);})[_0x43cb('0x13')](function(_0x171f24){logger[_0x43cb('0x10')](_0x43cb('0x3e'),_0x171f24[_0x43cb('0x11')],_0x16ffe4);_0x4db737(_0x249471[_0x43cb('0x10')](0x1f4,_0x171f24[_0x43cb('0x11')]));});});};exports['GetContactRecallMe']=function(_0x3f31f4){var _0x2bc617=this;return new Promise(function(_0x1cd8cc,_0x1be925){return db[_0x43cb('0x28')][_0x43cb('0x29')]()[_0x43cb('0x9')](function(_0x2ac523){return db[_0x43cb('0x2a')]['transaction'](function(_0x5356cd){return db[_0x43cb('0x22')][_0x43cb('0x14')]({'where':_0x3f31f4[_0x43cb('0x15')]?_0x3f31f4[_0x43cb('0x15')][_0x43cb('0x16')]||null:null,'attributes':_0x3f31f4['options']?_0x3f31f4[_0x43cb('0x15')][_0x43cb('0x17')]||null:null,'limit':0x1,'order':_0x3f31f4[_0x43cb('0x15')]?_0x3f31f4[_0x43cb('0x15')]['order']||null:null,'group':db[_0x43cb('0x22')]['UserId'],'transaction':_0x5356cd,'lock':_0x5356cd[_0x43cb('0x2d')][_0x43cb('0x2e')],'include':_0x3f31f4[_0x43cb('0x15')]?_0x3f31f4[_0x43cb('0x15')][_0x43cb('0x19')]?_[_0x43cb('0x1a')](_0x3f31f4['options']['include'],function(_0xcd6622){return{'model':db[_0xcd6622[_0x43cb('0x1b')]],'as':_0xcd6622['as'],'attributes':_0xcd6622[_0x43cb('0x17')],'include':_0xcd6622['include']?_[_0x43cb('0x1a')](_0xcd6622[_0x43cb('0x19')],function(_0x499909){return{'model':db[_0x499909[_0x43cb('0x1b')]],'as':_0x499909['as'],'attributes':_0x499909['attributes'],'include':_0x499909[_0x43cb('0x19')]?_[_0x43cb('0x1a')](_0x499909['include'],function(_0x44e232){return{'model':db[_0x44e232[_0x43cb('0x1b')]],'as':_0x44e232['as'],'attributes':_0x44e232[_0x43cb('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43cb('0x9')](function(_0x23a950){var _0x1f00e7=[];for(var _0x12ba30=0x0;_0x12ba30<_0x23a950['length'];_0x12ba30+=0x1){_0x1f00e7[_0x43cb('0x35')](_0x23a950[_0x12ba30][_0x43cb('0x23')](_0x3f31f4['body'],{'transaction':_0x5356cd}));}return BPromise[_0x43cb('0x37')](_0x1f00e7);});})[_0x43cb('0x9')](function(_0x1c4e6c){logger[_0x43cb('0xa')](_0x43cb('0x46'),_0x3f31f4);logger['debug'](_0x43cb('0x46'),_0x3f31f4,JSON[_0x43cb('0xf')](_0x1c4e6c));_0x1cd8cc(_0x1c4e6c);})[_0x43cb('0x13')](function(_0x2f1359){logger['error']('GetContactRecallMe',_0x2f1359[_0x43cb('0x11')],_0x3f31f4);_0x1be925(_0x2bc617['error'](0x1f4,_0x2f1359[_0x43cb('0x11')]));});});});};exports[_0x43cb('0x47')]=function(_0x5b3b49){var _0x2a52b4=this;return new Promise(function(_0x14a9ce,_0x3b8cd6){db['CmContact']['describe']()[_0x43cb('0x9')](function(_0x2e3ed6){return db['CmHopper'][_0x43cb('0x14')]({'raw':_0x5b3b49[_0x43cb('0x15')]?_0x5b3b49['options'][_0x43cb('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b3b49['options']?_0x5b3b49[_0x43cb('0x15')]['where']||null:null,'attributes':_0x5b3b49[_0x43cb('0x15')]?_0x5b3b49['options'][_0x43cb('0x17')]||null:null,'limit':_0x5b3b49[_0x43cb('0x15')]?_0x5b3b49['options'][_0x43cb('0x18')]||null:null,'include':_0x5b3b49['options']?_0x5b3b49[_0x43cb('0x15')]['include']?_[_0x43cb('0x1a')](_0x5b3b49[_0x43cb('0x15')]['include'],function(_0x164fc7){return{'model':db[_0x164fc7[_0x43cb('0x1b')]],'as':_0x164fc7['as'],'attributes':_0x164fc7['as']==='Contact'?_[_0x43cb('0x30')](_0x2e3ed6):_0x164fc7['attributes'],'include':_0x164fc7['include']?_['map'](_0x164fc7[_0x43cb('0x19')],function(_0x3370a1){return{'model':db[_0x3370a1[_0x43cb('0x1b')]],'as':_0x3370a1['as'],'attributes':_0x3370a1['attributes'],'include':_0x3370a1[_0x43cb('0x19')]?_['map'](_0x3370a1[_0x43cb('0x19')],function(_0x55d15c){return{'model':db[_0x55d15c[_0x43cb('0x1b')]],'as':_0x55d15c['as'],'attributes':_0x55d15c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x106667){logger[_0x43cb('0xa')](_0x43cb('0x1c'),_0x5b3b49);logger['debug'](_0x43cb('0x1c'),_0x5b3b49,JSON[_0x43cb('0xf')](_0x106667));_0x14a9ce(_0x106667);})[_0x43cb('0x13')](function(_0x3fbcad){logger[_0x43cb('0x10')](_0x43cb('0x1c'),_0x3fbcad[_0x43cb('0x11')],_0x5b3b49);_0x3b8cd6(_0x2a52b4['error'](0x1f4,_0x3fbcad[_0x43cb('0x11')]));});});});};exports[_0x43cb('0x48')]=function(_0x38a1b4){var _0x4896c9=this;return new Promise(function(_0x3c0f7c,_0x581343){return db[_0x43cb('0x28')][_0x43cb('0x49')]({'raw':!![],'where':{'phone':_0x38a1b4[_0x43cb('0x15')][_0x43cb('0x16')][_0x43cb('0x4a')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x43cb('0x9')](function(_0x53ca82){logger[_0x43cb('0xa')](_0x43cb('0x4b'),_0x38a1b4);logger[_0x43cb('0xd')](_0x43cb('0x4b'),_0x38a1b4,JSON['stringify'](_0x53ca82));_0x3c0f7c(_0x53ca82);})[_0x43cb('0x13')](function(_0x117930){logger['error'](_0x43cb('0x4b'),_0x117930['message'],_0x38a1b4);_0x581343(_0x4896c9[_0x43cb('0x10')](0x1f4,_0x117930[_0x43cb('0x11')]));});});};exports[_0x43cb('0x4c')]=function(_0x47be38){var _0x1ec417=this;return new Promise(function(_0x43445b,_0x199351){return db[_0x43cb('0x2a')][_0x43cb('0x2b')](function(_0x1f6ee1){return db['CmHopper'][_0x43cb('0x23')]({'active':![]},{'where':{},'transaction':_0x1f6ee1})[_0x43cb('0x9')](function(_0x5c4b65){logger[_0x43cb('0xa')](_0x43cb('0x4c'),_0x47be38);logger[_0x43cb('0xd')](_0x43cb('0x4c'),_0x47be38,JSON[_0x43cb('0xf')](_0x5c4b65));_0x43445b(_0x5c4b65);})[_0x43cb('0x13')](function(_0x1e8f0a){logger[_0x43cb('0x10')]('ResetActiveCalls',_0x1e8f0a[_0x43cb('0x11')],_0x47be38);_0x199351(_0x1ec417[_0x43cb('0x10')](0x1f4,_0x1e8f0a[_0x43cb('0x11')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0xcd5c9d){var _0xb1a289=this;var _0x31ed64=_0xcd5c9d[_0x43cb('0x20')][_0x43cb('0x16')][_0x43cb('0x4d')];var _0x131618=_0xcd5c9d[_0x43cb('0x20')][_0x43cb('0x16')][_0x43cb('0x4e')];var _0x264b41=_0xcd5c9d['body']['where'][_0x43cb('0x4f')];return new Promise(function(_0xc7cebc,_0xd8711a){return db[_0x43cb('0x22')][_0x43cb('0x14')]({'where':{'voiceQueueId':{'$in':_0x31ed64},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x43cb('0x2a')][_0x43cb('0x40')](_0x43cb('0x50')+_0x131618+'\x20MINUTE'),'$gt':db['sequelize'][_0x43cb('0x40')](_0x43cb('0x51'))}},'UserId':{'$in':_0x264b41}},'include':[{'model':db[_0x43cb('0x28')],'as':'Contact'},{'model':db[_0x43cb('0x31')],'as':_0x43cb('0x32'),'attributes':['id',_0x43cb('0x52'),_0x43cb('0x53')]},{'model':db[_0x43cb('0x54')],'as':_0x43cb('0x55')}]})[_0x43cb('0x9')](function(_0x322e06){if(_0x322e06[_0x43cb('0x33')]>0x0){return db[_0x43cb('0x2a')][_0x43cb('0x2b')](function(_0xb6896){return db[_0x43cb('0x22')][_0x43cb('0x23')]({'recallmeNotifiedDate':db['sequelize'][_0x43cb('0x40')](_0x43cb('0x51'))},{'where':{'id':{'$in':_[_0x43cb('0x1a')](_0x322e06,'id')}},'transaction':_0xb6896})['then'](function(){_0xc7cebc(_0x322e06);})[_0x43cb('0x13')](function(_0x21e223){logger[_0x43cb('0x10')](_0x43cb('0x56'),_0x21e223[_0x43cb('0x11')],_0xcd5c9d);_0xd8711a(_0xb1a289[_0x43cb('0x10')](0x1f4,_0x21e223[_0x43cb('0x11')]));});})[_0x43cb('0x13')](function(_0x259fe6){logger[_0x43cb('0x10')](_0x43cb('0x56'),_0x259fe6['message'],_0xcd5c9d);_0xd8711a(_0xb1a289[_0x43cb('0x10')](0x1f4,_0x259fe6[_0x43cb('0x11')]));});}else{_0xc7cebc(_0x322e06);}});});}; \ No newline at end of file +var _0x36f9=['debug','CmHopper,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','include','map','model','stringify','ShowCmHopper','find','then','CreateCmHopper','create','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','CmContact','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','keys','Agent','push','includes','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','describe','UserId','GetContactRecallMe','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','voicePause','CmList','List','lodash','moment','../../config/logger','rpc','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent'];(function(_0x4bfc7a,_0x578eac){var _0x24edff=function(_0x5ea63c){while(--_0x5ea63c){_0x4bfc7a['push'](_0x4bfc7a['shift']());}};_0x24edff(++_0x578eac);}(_0x36f9,0x151));var _0x936f=function(_0x10c5a1,_0x58bf0c){_0x10c5a1=_0x10c5a1-0x0;var _0x24cbc4=_0x36f9[_0x10c5a1];return _0x24cbc4;};'use strict';var _=require(_0x936f('0x0'));var util=require('util');var moment=require(_0x936f('0x1'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x936f('0x2'))(_0x936f('0x3'));var jayson=require(_0x936f('0x4'));var client=jayson[_0x936f('0x5')][_0x936f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x144124,_0xcd8e72,_0xb18ba3){return new BPromise(function(_0x1c9c87,_0x361291){return client[_0x936f('0x7')](_0x144124,_0xb18ba3)['then'](function(_0xdaf708){logger[_0x936f('0x8')](_0x936f('0x9'),_0xcd8e72,_0x936f('0xa'));logger[_0x936f('0xb')](_0x936f('0xc'),_0xcd8e72,_0x936f('0xa'),JSON['stringify'](_0xdaf708));if(_0xdaf708['error']){if(_0xdaf708['error'][_0x936f('0xd')]===0x1f4){logger[_0x936f('0xe')](_0x936f('0x9'),_0xcd8e72,_0xdaf708[_0x936f('0xe')][_0x936f('0xf')]);return _0x361291(_0xdaf708[_0x936f('0xe')][_0x936f('0xf')]);}logger[_0x936f('0xe')]('CmHopper,\x20%s,\x20%s',_0xcd8e72,_0xdaf708[_0x936f('0xe')][_0x936f('0xf')]);return _0x1c9c87(_0xdaf708[_0x936f('0xe')][_0x936f('0xf')]);}else{logger[_0x936f('0x8')](_0x936f('0x9'),_0xcd8e72,'request\x20sent');_0x1c9c87(_0xdaf708[_0x936f('0x10')]['message']);}})[_0x936f('0x11')](function(_0x401dfd){logger['error'](_0x936f('0x9'),_0xcd8e72,_0x401dfd);_0x361291(_0x401dfd);});});}exports[_0x936f('0x12')]=function(_0x4dcb6d){var _0x4c8b6e=this;return new Promise(function(_0x298ece,_0x5df84f){return db[_0x936f('0x13')]['findAll']({'raw':_0x4dcb6d[_0x936f('0x14')]?_0x4dcb6d[_0x936f('0x14')][_0x936f('0x15')]===undefined?!![]:![]:!![],'where':_0x4dcb6d[_0x936f('0x14')]?_0x4dcb6d[_0x936f('0x14')][_0x936f('0x16')]||null:null,'attributes':_0x4dcb6d[_0x936f('0x14')]?_0x4dcb6d[_0x936f('0x14')][_0x936f('0x17')]||null:null,'limit':_0x4dcb6d[_0x936f('0x14')]?_0x4dcb6d['options']['limit']||null:null,'include':_0x4dcb6d[_0x936f('0x14')]?_0x4dcb6d[_0x936f('0x14')][_0x936f('0x18')]?_[_0x936f('0x19')](_0x4dcb6d[_0x936f('0x14')][_0x936f('0x18')],function(_0x4ed032){return{'model':db[_0x4ed032[_0x936f('0x1a')]],'as':_0x4ed032['as'],'attributes':_0x4ed032[_0x936f('0x17')],'include':_0x4ed032[_0x936f('0x18')]?_[_0x936f('0x19')](_0x4ed032[_0x936f('0x18')],function(_0x482f16){return{'model':db[_0x482f16['model']],'as':_0x482f16['as'],'attributes':_0x482f16[_0x936f('0x17')],'include':_0x482f16[_0x936f('0x18')]?_[_0x936f('0x19')](_0x482f16[_0x936f('0x18')],function(_0x2dbbd5){return{'model':db[_0x2dbbd5[_0x936f('0x1a')]],'as':_0x2dbbd5['as'],'attributes':_0x2dbbd5[_0x936f('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e00de){logger[_0x936f('0x8')](_0x936f('0x12'),_0x4dcb6d);logger[_0x936f('0xb')]('GetCmHopper',_0x4dcb6d,JSON[_0x936f('0x1b')](_0x5e00de));_0x298ece(_0x5e00de);})['catch'](function(_0x49407b){logger[_0x936f('0xe')]('GetCmHopper',_0x49407b['message'],_0x4dcb6d);_0x5df84f(_0x4c8b6e[_0x936f('0xe')](0x1f4,_0x49407b[_0x936f('0xf')]));});});};exports[_0x936f('0x1c')]=function(_0x53b908){var _0x29a89d=this;return new Promise(function(_0x12db98,_0x4126ed){return db[_0x936f('0x13')][_0x936f('0x1d')]({'raw':_0x53b908[_0x936f('0x14')]?_0x53b908['options'][_0x936f('0x15')]===undefined?!![]:![]:!![],'where':_0x53b908['options']?_0x53b908['options'][_0x936f('0x16')]||null:null,'attributes':_0x53b908[_0x936f('0x14')]?_0x53b908[_0x936f('0x14')][_0x936f('0x17')]||null:null,'include':_0x53b908[_0x936f('0x14')]?_0x53b908[_0x936f('0x14')][_0x936f('0x18')]?_[_0x936f('0x19')](_0x53b908[_0x936f('0x14')][_0x936f('0x18')],function(_0x37d6b2){return{'model':db[_0x37d6b2[_0x936f('0x1a')]],'as':_0x37d6b2['as'],'attributes':_0x37d6b2[_0x936f('0x17')],'include':_0x37d6b2[_0x936f('0x18')]?_[_0x936f('0x19')](_0x37d6b2[_0x936f('0x18')],function(_0x5c772f){return{'model':db[_0x5c772f[_0x936f('0x1a')]],'as':_0x5c772f['as'],'attributes':_0x5c772f[_0x936f('0x17')],'include':_0x5c772f['include']?_['map'](_0x5c772f[_0x936f('0x18')],function(_0x16c8ac){return{'model':db[_0x16c8ac['model']],'as':_0x16c8ac['as'],'attributes':_0x16c8ac[_0x936f('0x17')]};}):[]};}):[]};}):[]:[]})[_0x936f('0x1e')](function(_0x331c3e){logger[_0x936f('0x8')](_0x936f('0x1c'),_0x53b908);logger[_0x936f('0xb')](_0x936f('0x1c'),_0x53b908,JSON['stringify'](_0x331c3e));_0x12db98(_0x331c3e);})[_0x936f('0x11')](function(_0x12cf81){logger[_0x936f('0xe')](_0x936f('0x1c'),_0x12cf81[_0x936f('0xf')],_0x53b908);_0x4126ed(_0x29a89d[_0x936f('0xe')](0x1f4,_0x12cf81[_0x936f('0xf')]));});});};exports[_0x936f('0x1f')]=function(_0x26118c){var _0x976d5=this;return new Promise(function(_0x53e82c,_0x485f4c){return db[_0x936f('0x13')][_0x936f('0x20')](_0x26118c['body'],{'raw':_0x26118c[_0x936f('0x14')]?_0x26118c[_0x936f('0x14')][_0x936f('0x15')]===undefined?!![]:![]:!![]})[_0x936f('0x1e')](function(_0x40d1c3){logger[_0x936f('0x8')](_0x936f('0x1f'),_0x26118c);logger[_0x936f('0xb')]('CreateCmHopper',_0x26118c,JSON[_0x936f('0x1b')](_0x40d1c3));_0x53e82c(_0x40d1c3);})['catch'](function(_0x672ed2){logger[_0x936f('0xe')]('CreateCmHopper',_0x672ed2['message'],_0x26118c);_0x485f4c(_0x976d5[_0x936f('0xe')](0x1f4,_0x672ed2[_0x936f('0xf')]));});});};exports[_0x936f('0x21')]=function(_0x1f6b20){var _0x3f2ed2=this;return new Promise(function(_0x3b0db4,_0x3c0869){return db[_0x936f('0x13')][_0x936f('0x22')](_0x1f6b20['body'],{'raw':_0x1f6b20[_0x936f('0x14')]?_0x1f6b20[_0x936f('0x14')][_0x936f('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f6b20['options']?_0x1f6b20['options']['where']||null:null,'attributes':_0x1f6b20[_0x936f('0x14')]?_0x1f6b20[_0x936f('0x14')][_0x936f('0x17')]||null:null,'limit':_0x1f6b20['options']?_0x1f6b20[_0x936f('0x14')][_0x936f('0x23')]||null:null})[_0x936f('0x1e')](function(_0x4a01f7){logger[_0x936f('0x8')](_0x936f('0x21'),_0x1f6b20);logger[_0x936f('0x8')](_0x936f('0x24'),JSON[_0x936f('0x1b')](_0x1f6b20[_0x936f('0x14')][_0x936f('0x16')]),_0x1f6b20[_0x936f('0x25')][_0x936f('0x26')]);logger[_0x936f('0xb')](_0x936f('0x21'),_0x1f6b20,JSON['stringify'](_0x4a01f7));_0x3b0db4(_0x4a01f7);})[_0x936f('0x11')](function(_0x530a7e){logger[_0x936f('0xe')](_0x936f('0x21'),_0x530a7e[_0x936f('0xf')],_0x1f6b20);_0x3c0869(_0x3f2ed2[_0x936f('0xe')](0x1f4,_0x530a7e[_0x936f('0xf')]));});});};exports['DestroyCmHopper']=function(_0x456143){var _0x3ea2e5=this;return new Promise(function(_0x42b6aa,_0x257f6d){return db[_0x936f('0x13')]['destroy']({'where':_0x456143[_0x936f('0x14')]?_0x456143['options']['where']||null:null})[_0x936f('0x1e')](function(_0x1e1e07){logger[_0x936f('0x8')](_0x936f('0x27'),_0x456143);logger[_0x936f('0xb')](_0x936f('0x27'),_0x456143,JSON[_0x936f('0x1b')](_0x1e1e07));_0x42b6aa(_0x1e1e07);})[_0x936f('0x11')](function(_0x3d0fbc){logger['error'](_0x936f('0x27'),_0x3d0fbc[_0x936f('0xf')],_0x456143);_0x257f6d(_0x3ea2e5['error'](0x1f4,_0x3d0fbc[_0x936f('0xf')]));});});};exports['GetContactDialer']=function(_0x49ad5e){var _0x1e6899=this;return new Promise(function(_0x281a1e,_0xaebbd8){return db[_0x936f('0x28')]['describe']()[_0x936f('0x1e')](function(_0x4b9f55){return db[_0x936f('0x29')][_0x936f('0x2a')](function(_0x444ff2){return db[_0x936f('0x13')][_0x936f('0x2b')]({'where':_0x49ad5e['options']?_0x49ad5e[_0x936f('0x14')]['where']||null:null,'attributes':_0x49ad5e[_0x936f('0x14')]?_0x49ad5e[_0x936f('0x14')]['attributes']||null:null,'limit':_0x49ad5e['options']?_0x49ad5e[_0x936f('0x14')]['limit']||null:null,'order':_0x49ad5e[_0x936f('0x14')]?_0x49ad5e[_0x936f('0x14')][_0x936f('0x2c')]||null:null,'transaction':_0x444ff2,'lock':_0x444ff2[_0x936f('0x2d')][_0x936f('0x2e')],'include':[{'model':db[_0x936f('0x28')],'as':_0x936f('0x2f'),'attributes':_[_0x936f('0x30')](_0x4b9f55)},{'model':db['User'],'as':_0x936f('0x31'),'attributes':['id','name','voicePause']}]})['then'](function(_0x1e7682){var _0x1e0175=[];var _0x302148=[];for(var _0x3df838=0x0;_0x3df838<_0x1e7682['length'];_0x3df838+=0x1){var _0x1fdc83=_0x1e7682[_0x3df838]['UserId'];if(_0x1fdc83===null){_0x1e0175[_0x936f('0x32')](_0x1e7682[_0x3df838][_0x936f('0x22')](_0x49ad5e[_0x936f('0x25')],{'transaction':_0x444ff2}));}else if(!_0x302148[_0x936f('0x33')](_0x1fdc83)){_0x302148[_0x936f('0x32')](_0x1fdc83);_0x1e0175['push'](_0x1e7682[_0x3df838]['update'](_0x49ad5e[_0x936f('0x25')],{'transaction':_0x444ff2}));}}return BPromise[_0x936f('0x34')](_0x1e0175);});})[_0x936f('0x1e')](function(_0x38b566){logger[_0x936f('0x8')](_0x936f('0x35'),_0x49ad5e);if(_0x38b566[_0x936f('0x36')]>0x0){logger[_0x936f('0x8')](_0x936f('0x37'),_0x38b566[0x0][_0x936f('0x38')]['id'],_0x38b566[0x0]['dataValues']['ContactId'],_0x38b566[0x0][_0x936f('0x38')][_0x936f('0x26')]);}logger['debug'](_0x936f('0x35'),_0x49ad5e,JSON['stringify'](_0x38b566));_0x281a1e(_0x38b566);})[_0x936f('0x11')](function(_0x221f5e){logger['error']('GetContactDialer',_0x221f5e[_0x936f('0xf')],_0x49ad5e);_0xaebbd8(_0x1e6899[_0x936f('0xe')](0x1f4,_0x221f5e[_0x936f('0xf')]));});});});};exports[_0x936f('0x39')]=function(_0x376753){var _0x48416e=this;return new Promise(function(_0x5ccecc,_0x12848d){return db[_0x936f('0x29')][_0x936f('0x2a')](function(_0x19928d){return db[_0x936f('0x3a')][_0x936f('0x20')](_0x376753[_0x936f('0x25')],{'raw':_0x376753[_0x936f('0x14')]?_0x376753[_0x936f('0x14')][_0x936f('0x15')]===undefined?!![]:![]:!![],'transaction':_0x19928d})[_0x936f('0x1e')](function(){logger[_0x936f('0x8')](_0x936f('0x3b'),JSON[_0x936f('0x1b')](_0x376753[_0x936f('0x14')][_0x936f('0x16')]),_0x376753[_0x936f('0x14')][_0x936f('0x16')][_0x936f('0x26')]);return db[_0x936f('0x13')][_0x936f('0x3c')]({'where':_0x376753['options']?_0x376753[_0x936f('0x14')][_0x936f('0x16')]||null:null,'transaction':_0x19928d});});})[_0x936f('0x1e')](function(_0x33c690){logger[_0x936f('0x8')](_0x936f('0x39'),_0x376753);logger[_0x936f('0xb')](_0x936f('0x39'),_0x376753,JSON[_0x936f('0x1b')](_0x33c690));_0x5ccecc(_0x33c690);})[_0x936f('0x11')](function(_0x566f7e){logger[_0x936f('0xe')](_0x936f('0x39'),_0x566f7e[_0x936f('0xf')],_0x376753);_0x12848d(_0x48416e[_0x936f('0xe')](0x1f4,_0x566f7e[_0x936f('0xf')]));});});};exports[_0x936f('0x3d')]=function(_0x1cadf4){var _0x1ed135=this;return new Promise(function(_0x440303,_0x28a2c3){return db[_0x936f('0x13')][_0x936f('0x2b')]({'raw':_0x1cadf4[_0x936f('0x14')]?_0x1cadf4[_0x936f('0x14')][_0x936f('0x15')]===undefined?!![]:![]:!![],'where':_0x1cadf4['options']?_0x1cadf4['options'][_0x936f('0x16')]||null:null,'attributes':[[db[_0x936f('0x29')]['fn'](_0x936f('0x3e'),db['sequelize']['fn']('IF',db[_0x936f('0x29')]['literal'](_0x936f('0x3f')+util[_0x936f('0x40')](_0x936f('0x41'),moment()[_0x936f('0x40')](_0x936f('0x42')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x936f('0x1e')](function(_0xc4601f){logger[_0x936f('0x8')](_0x936f('0x3d'),_0x1cadf4);logger['debug'](_0x936f('0x3d'),_0x1cadf4,JSON[_0x936f('0x1b')](_0xc4601f));_0x440303(_0xc4601f);})[_0x936f('0x11')](function(_0xd3101a){logger['error'](_0x936f('0x3d'),_0xd3101a[_0x936f('0xf')],_0x1cadf4);_0x28a2c3(_0x1ed135[_0x936f('0xe')](0x1f4,_0xd3101a[_0x936f('0xf')]));});});};exports['GetContactRecallMe']=function(_0x47200c){var _0x114b19=this;return new Promise(function(_0x2d9fd7,_0x43c504){return db[_0x936f('0x28')][_0x936f('0x43')]()[_0x936f('0x1e')](function(_0x16e053){return db[_0x936f('0x29')][_0x936f('0x2a')](function(_0x9b831){return db['CmHopper'][_0x936f('0x2b')]({'where':_0x47200c[_0x936f('0x14')]?_0x47200c[_0x936f('0x14')][_0x936f('0x16')]||null:null,'attributes':_0x47200c['options']?_0x47200c[_0x936f('0x14')][_0x936f('0x17')]||null:null,'limit':0x1,'order':_0x47200c['options']?_0x47200c[_0x936f('0x14')]['order']||null:null,'group':db[_0x936f('0x13')][_0x936f('0x44')],'transaction':_0x9b831,'lock':_0x9b831['LOCK'][_0x936f('0x2e')],'include':_0x47200c[_0x936f('0x14')]?_0x47200c[_0x936f('0x14')][_0x936f('0x18')]?_[_0x936f('0x19')](_0x47200c[_0x936f('0x14')][_0x936f('0x18')],function(_0x1a1321){return{'model':db[_0x1a1321[_0x936f('0x1a')]],'as':_0x1a1321['as'],'attributes':_0x1a1321[_0x936f('0x17')],'include':_0x1a1321['include']?_['map'](_0x1a1321['include'],function(_0x1cdb76){return{'model':db[_0x1cdb76[_0x936f('0x1a')]],'as':_0x1cdb76['as'],'attributes':_0x1cdb76[_0x936f('0x17')],'include':_0x1cdb76[_0x936f('0x18')]?_[_0x936f('0x19')](_0x1cdb76['include'],function(_0x32fb0f){return{'model':db[_0x32fb0f[_0x936f('0x1a')]],'as':_0x32fb0f['as'],'attributes':_0x32fb0f[_0x936f('0x17')]};}):[]};}):[]};}):[]:[]})[_0x936f('0x1e')](function(_0x25d51f){var _0xedc90b=[];for(var _0x3242af=0x0;_0x3242af<_0x25d51f[_0x936f('0x36')];_0x3242af+=0x1){_0xedc90b[_0x936f('0x32')](_0x25d51f[_0x3242af][_0x936f('0x22')](_0x47200c['body'],{'transaction':_0x9b831}));}return BPromise['all'](_0xedc90b);});})['then'](function(_0x345ca6){logger[_0x936f('0x8')](_0x936f('0x45'),_0x47200c);logger['debug'](_0x936f('0x45'),_0x47200c,JSON[_0x936f('0x1b')](_0x345ca6));_0x2d9fd7(_0x345ca6);})[_0x936f('0x11')](function(_0x3f4115){logger[_0x936f('0xe')](_0x936f('0x45'),_0x3f4115['message'],_0x47200c);_0x43c504(_0x114b19[_0x936f('0xe')](0x1f4,_0x3f4115[_0x936f('0xf')]));});});});};exports['GetCmHopperPreview']=function(_0x21494d){var _0x577e27=this;return new Promise(function(_0x79420b,_0x18297e){db[_0x936f('0x28')]['describe']()[_0x936f('0x1e')](function(_0x3e58ca){return db[_0x936f('0x13')][_0x936f('0x2b')]({'raw':_0x21494d[_0x936f('0x14')]?_0x21494d['options'][_0x936f('0x15')]===undefined?!![]:![]:!![],'where':_0x21494d[_0x936f('0x14')]?_0x21494d[_0x936f('0x14')][_0x936f('0x16')]||null:null,'attributes':_0x21494d[_0x936f('0x14')]?_0x21494d['options'][_0x936f('0x17')]||null:null,'limit':_0x21494d['options']?_0x21494d['options'][_0x936f('0x23')]||null:null,'include':_0x21494d[_0x936f('0x14')]?_0x21494d[_0x936f('0x14')][_0x936f('0x18')]?_['map'](_0x21494d[_0x936f('0x14')][_0x936f('0x18')],function(_0x29b76a){return{'model':db[_0x29b76a[_0x936f('0x1a')]],'as':_0x29b76a['as'],'attributes':_0x29b76a['as']==='Contact'?_[_0x936f('0x30')](_0x3e58ca):_0x29b76a[_0x936f('0x17')],'include':_0x29b76a[_0x936f('0x18')]?_[_0x936f('0x19')](_0x29b76a[_0x936f('0x18')],function(_0x4b0a44){return{'model':db[_0x4b0a44['model']],'as':_0x4b0a44['as'],'attributes':_0x4b0a44[_0x936f('0x17')],'include':_0x4b0a44[_0x936f('0x18')]?_[_0x936f('0x19')](_0x4b0a44[_0x936f('0x18')],function(_0xdab17c){return{'model':db[_0xdab17c[_0x936f('0x1a')]],'as':_0xdab17c['as'],'attributes':_0xdab17c[_0x936f('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x241852){logger[_0x936f('0x8')](_0x936f('0x12'),_0x21494d);logger[_0x936f('0xb')](_0x936f('0x12'),_0x21494d,JSON[_0x936f('0x1b')](_0x241852));_0x79420b(_0x241852);})['catch'](function(_0x45e087){logger[_0x936f('0xe')](_0x936f('0x12'),_0x45e087[_0x936f('0xf')],_0x21494d);_0x18297e(_0x577e27['error'](0x1f4,_0x45e087[_0x936f('0xf')]));});});});};exports['GetContactByPhone']=function(_0x5d02a5){var _0x326e12=this;return new Promise(function(_0x328965,_0x27d20a){return db[_0x936f('0x28')][_0x936f('0x46')]({'raw':!![],'where':{'phone':_0x5d02a5[_0x936f('0x14')]['where'][_0x936f('0x47')]},'attributes':['id',_0x936f('0x48')],'order':[['id',_0x936f('0x49')]]})[_0x936f('0x1e')](function(_0x586e64){logger['info'](_0x936f('0x4a'),_0x5d02a5);logger['debug'](_0x936f('0x4a'),_0x5d02a5,JSON[_0x936f('0x1b')](_0x586e64));_0x328965(_0x586e64);})[_0x936f('0x11')](function(_0x59b425){logger[_0x936f('0xe')](_0x936f('0x4a'),_0x59b425[_0x936f('0xf')],_0x5d02a5);_0x27d20a(_0x326e12[_0x936f('0xe')](0x1f4,_0x59b425[_0x936f('0xf')]));});});};exports[_0x936f('0x4b')]=function(_0x1f357e){var _0xc24c60=this;return new Promise(function(_0x588a07,_0x287f11){return db[_0x936f('0x29')]['transaction'](function(_0xfa9e0){return db[_0x936f('0x13')][_0x936f('0x22')]({'active':![]},{'where':{},'transaction':_0xfa9e0})[_0x936f('0x1e')](function(_0x23935f){logger[_0x936f('0x8')](_0x936f('0x4b'),_0x1f357e);logger[_0x936f('0xb')](_0x936f('0x4b'),_0x1f357e,JSON[_0x936f('0x1b')](_0x23935f));_0x588a07(_0x23935f);})[_0x936f('0x11')](function(_0x2a8d09){logger[_0x936f('0xe')](_0x936f('0x4b'),_0x2a8d09['message'],_0x1f357e);_0x287f11(_0xc24c60['error'](0x1f4,_0x2a8d09[_0x936f('0xf')]));});});});};exports[_0x936f('0x4c')]=function(_0x464be9){var _0x48016a=this;var _0x3d74d6=_0x464be9[_0x936f('0x25')][_0x936f('0x16')][_0x936f('0x4d')];var _0x31d564=_0x464be9['body'][_0x936f('0x16')][_0x936f('0x4e')];var _0x5f163d=_0x464be9[_0x936f('0x25')][_0x936f('0x16')]['availableAgentsIds'];return new Promise(function(_0x472366,_0x56ef64){return db[_0x936f('0x13')]['findAll']({'where':{'voiceQueueId':{'$in':_0x3d74d6},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x936f('0x29')][_0x936f('0x4f')](_0x936f('0x50')+_0x31d564+_0x936f('0x51')),'$gt':db[_0x936f('0x29')][_0x936f('0x4f')](_0x936f('0x52'))}},'UserId':{'$in':_0x5f163d}},'include':[{'model':db['CmContact'],'as':_0x936f('0x2f')},{'model':db['User'],'as':_0x936f('0x31'),'attributes':['id',_0x936f('0x53'),_0x936f('0x54')]},{'model':db[_0x936f('0x55')],'as':_0x936f('0x56')}]})[_0x936f('0x1e')](function(_0x5ceed2){if(_0x5ceed2[_0x936f('0x36')]>0x0){return db['sequelize'][_0x936f('0x2a')](function(_0x5cff69){return db[_0x936f('0x13')]['update']({'recallmeNotifiedDate':db[_0x936f('0x29')]['literal'](_0x936f('0x52'))},{'where':{'id':{'$in':_[_0x936f('0x19')](_0x5ceed2,'id')}},'transaction':_0x5cff69})['then'](function(){_0x472366(_0x5ceed2);})[_0x936f('0x11')](function(_0x11f519){logger[_0x936f('0xe')]('CmHopperHandlePreviewRecallNotifications',_0x11f519[_0x936f('0xf')],_0x464be9);_0x56ef64(_0x48016a[_0x936f('0xe')](0x1f4,_0x11f519[_0x936f('0xf')]));});})[_0x936f('0x11')](function(_0x5b387c){logger[_0x936f('0xe')]('CmHopperHandlePreviewRecallNotifications',_0x5b387c[_0x936f('0xf')],_0x464be9);_0x56ef64(_0x48016a[_0x936f('0xe')](0x1f4,_0x5b387c[_0x936f('0xf')]));});}else{_0x472366(_0x5ceed2);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 548af8e..fd21746 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 _0x069e=['express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','delete','/:id','destroy','exports'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x069e,0x108));var _0xe069=function(_0xea6c20,_0x5a0de8){_0xea6c20=_0xea6c20-0x0;var _0x458655=_0x069e[_0xea6c20];return _0x458655;};'use strict';var express=require(_0xe069('0x0'));var router=express[_0xe069('0x1')]();var auth=require(_0xe069('0x2'));var controller=require(_0xe069('0x3'));router[_0xe069('0x4')]('/',auth[_0xe069('0x5')](),controller[_0xe069('0x6')]);router[_0xe069('0x4')]('/describe',auth[_0xe069('0x5')](),controller[_0xe069('0x7')]);router[_0xe069('0x4')](_0xe069('0x8'),auth[_0xe069('0x5')](),controller[_0xe069('0x9')]);router[_0xe069('0x4')]('/timezones',auth[_0xe069('0x5')](),controller[_0xe069('0xa')]);router[_0xe069('0x4')]('/:id',auth[_0xe069('0x5')](),controller[_0xe069('0xb')]);router[_0xe069('0x4')](_0xe069('0xc'),auth['isAuthenticated'](),controller[_0xe069('0xd')]);router[_0xe069('0xe')]('/',auth['isAuthenticated'](),controller[_0xe069('0xf')]);router[_0xe069('0xe')](_0xe069('0x10'),auth[_0xe069('0x5')](),controller[_0xe069('0x11')]);router[_0xe069('0xe')](_0xe069('0x12'),auth[_0xe069('0x5')](),controller['getTimezone']);router[_0xe069('0x13')]('/:id',auth[_0xe069('0x5')](),controller['update']);router[_0xe069('0x14')](_0xe069('0x15'),auth[_0xe069('0x5')](),controller[_0xe069('0x16')]);module[_0xe069('0x17')]=router; \ No newline at end of file +var _0x015c=['Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','getOpenContacts','/timezones','/:id','/:id/previewrecall','post','create','/preview','/timezone','update','delete','destroy','exports','express'];(function(_0x12b03c,_0x2869d5){var _0x2f6efc=function(_0x477bef){while(--_0x477bef){_0x12b03c['push'](_0x12b03c['shift']());}};_0x2f6efc(++_0x2869d5);}(_0x015c,0xc7));var _0xc015=function(_0x54cd93,_0x2be51f){_0x54cd93=_0x54cd93-0x0;var _0x4042d7=_0x015c[_0x54cd93];return _0x4042d7;};'use strict';var express=require(_0xc015('0x0'));var router=express[_0xc015('0x1')]();var auth=require(_0xc015('0x2'));var controller=require(_0xc015('0x3'));router[_0xc015('0x4')]('/',auth[_0xc015('0x5')](),controller[_0xc015('0x6')]);router[_0xc015('0x4')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc015('0x4')](_0xc015('0x7'),auth[_0xc015('0x5')](),controller[_0xc015('0x8')]);router[_0xc015('0x4')](_0xc015('0x9'),auth['isAuthenticated'](),controller['getTimezones']);router[_0xc015('0x4')](_0xc015('0xa'),auth[_0xc015('0x5')](),controller['show']);router[_0xc015('0x4')](_0xc015('0xb'),auth['isAuthenticated'](),controller['getPreviewRecall']);router[_0xc015('0xc')]('/',auth[_0xc015('0x5')](),controller[_0xc015('0xd')]);router[_0xc015('0xc')](_0xc015('0xe'),auth['isAuthenticated'](),controller['getPreview']);router[_0xc015('0xc')](_0xc015('0xf'),auth[_0xc015('0x5')](),controller['getTimezone']);router['put'](_0xc015('0xa'),auth[_0xc015('0x5')](),controller[_0xc015('0x10')]);router[_0xc015('0x11')](_0xc015('0xa'),auth[_0xc015('0x5')](),controller[_0xc015('0x12')]);module[_0xc015('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index f2c02e6..51e20ae 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 _0xd6e8=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','INTEGER'];(function(_0x5bc0f9,_0x1de7b0){var _0x50c294=function(_0x14a9b9){while(--_0x14a9b9){_0x5bc0f9['push'](_0x5bc0f9['shift']());}};_0x50c294(++_0x1de7b0);}(_0xd6e8,0x1d7));var _0x8d6e=function(_0x3a841d,_0x151ba7){_0x3a841d=_0x3a841d-0x0;var _0x55ef7d=_0xd6e8[_0x3a841d];return _0x55ef7d;};'use strict';var moment=require('moment');var Sequelize=require(_0x8d6e('0x0'));module[_0x8d6e('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x8d6e('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x8d6e('0x4'))},'countbusyretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8d6e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff9c=['DATE','moment','sequelize','exports','INTEGER','STRING'];(function(_0x3c4fee,_0x5013ed){var _0x48bac4=function(_0x348b90){while(--_0x348b90){_0x3c4fee['push'](_0x3c4fee['shift']());}};_0x48bac4(++_0x5013ed);}(_0xff9c,0x169));var _0xcff9=function(_0x2146b9,_0x139252){_0x2146b9=_0x2146b9-0x0;var _0x50c2b3=_0xff9c[_0x2146b9];return _0x50c2b3;};'use strict';var moment=require(_0xcff9('0x0'));var Sequelize=require(_0xcff9('0x1'));module[_0xcff9('0x2')]={'CmHopperId':{'type':Sequelize[_0xcff9('0x3')]},'phone':{'type':Sequelize[_0xcff9('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xcff9('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcff9('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 31100ee..e9c0541 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 _0x3a3e=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','stack','name','send','index','map','CmHopperAdditionalPhone','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x2814f7,_0x21211c){var _0x5b2e11=function(_0x50b4b2){while(--_0x50b4b2){_0x2814f7['push'](_0x2814f7['shift']());}};_0x5b2e11(++_0x21211c);}(_0x3a3e,0x14c));var _0xe3a3=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x3a3e[_0x2dea24];return _0x309d58;};'use strict';var emlformat=require(_0xe3a3('0x0'));var rimraf=require(_0xe3a3('0x1'));var zipdir=require(_0xe3a3('0x2'));var jsonpatch=require(_0xe3a3('0x3'));var rp=require(_0xe3a3('0x4'));var moment=require('moment');var BPromise=require(_0xe3a3('0x5'));var Mustache=require('mustache');var util=require(_0xe3a3('0x6'));var path=require(_0xe3a3('0x7'));var sox=require('sox');var csv=require(_0xe3a3('0x8'));var ejs=require(_0xe3a3('0x9'));var fs=require('fs');var fs_extra=require(_0xe3a3('0xa'));var _=require('lodash');var squel=require(_0xe3a3('0xb'));var crypto=require(_0xe3a3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe3a3('0xd'));var toCsv=require(_0xe3a3('0x8'));var querystring=require('querystring');var Papa=require(_0xe3a3('0xe'));var Redis=require(_0xe3a3('0xf'));var authService=require(_0xe3a3('0x10'));var qs=require(_0xe3a3('0x11'));var as=require(_0xe3a3('0x12'));var hardwareService=require(_0xe3a3('0x13'));var logger=require(_0xe3a3('0x14'))(_0xe3a3('0x15'));var utils=require(_0xe3a3('0x16'));var config=require(_0xe3a3('0x17'));var licenseUtil=require(_0xe3a3('0x18'));var db=require(_0xe3a3('0x19'))['db'];function respondWithStatusCode(_0x3f36bc,_0x82567c){_0x82567c=_0x82567c||0xcc;return function(_0x468917){if(_0x468917){return _0x3f36bc[_0xe3a3('0x1a')](_0x82567c);}return _0x3f36bc[_0xe3a3('0x1b')](_0x82567c)[_0xe3a3('0x1c')]();};}function respondWithResult(_0x24b739,_0x25c2e1){_0x25c2e1=_0x25c2e1||0xc8;return function(_0x1324e4){if(_0x1324e4){return _0x24b739[_0xe3a3('0x1b')](_0x25c2e1)[_0xe3a3('0x1d')](_0x1324e4);}};}function respondWithFilteredResult(_0x7c34fb,_0x40843b){return function(_0x1fad38){if(_0x1fad38){var _0x1af565=typeof _0x40843b[_0xe3a3('0x1e')]===_0xe3a3('0x1f')&&typeof _0x40843b[_0xe3a3('0x20')]===_0xe3a3('0x1f');var _0xb0c625=_0x1fad38[_0xe3a3('0x21')];var _0x341962=_0x1af565?0x0:_0x40843b['offset'];var _0x39fe2c=_0x1af565?_0x1fad38['count']:_0x40843b[_0xe3a3('0x1e')]+_0x40843b[_0xe3a3('0x20')];var _0x852682;if(_0x39fe2c>=_0xb0c625){_0x39fe2c=_0xb0c625;_0x852682=0xc8;}else{_0x852682=0xce;}_0x7c34fb[_0xe3a3('0x1b')](_0x852682);return _0x7c34fb[_0xe3a3('0x22')]('Content-Range',_0x341962+'-'+_0x39fe2c+'/'+_0xb0c625)[_0xe3a3('0x1d')](_0x1fad38);}return null;};}function patchUpdates(_0x138b71){return function(_0x478568){try{jsonpatch['apply'](_0x478568,_0x138b71,!![]);}catch(_0x321211){return BPromise['reject'](_0x321211);}return _0x478568[_0xe3a3('0x23')]();};}function saveUpdates(_0x5816e6,_0x4ee705){return function(_0x430c){if(_0x430c){return _0x430c[_0xe3a3('0x24')](_0x5816e6)[_0xe3a3('0x25')](function(_0x30176a){return _0x30176a;});}return null;};}function removeEntity(_0x4ddb22,_0x451af1){return function(_0x477a2f){if(_0x477a2f){return _0x477a2f['destroy']()[_0xe3a3('0x25')](function(){var _0x1b7a0c=_0x477a2f[_0xe3a3('0x26')]({'plain':!![]});var _0x297a67=_0xe3a3('0x27');return db[_0xe3a3('0x28')][_0xe3a3('0x29')]({'where':{'type':_0x297a67,'resourceId':_0x1b7a0c['id']}})[_0xe3a3('0x25')](function(){return _0x477a2f;});})[_0xe3a3('0x25')](function(){_0x4ddb22['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3a2b,_0xb039f7){return function(_0x4251f5){if(!_0x4251f5){_0x1b3a2b['sendStatus'](0x194);}return _0x4251f5;};}function handleError(_0x480ffa,_0x3fcdab){_0x3fcdab=_0x3fcdab||0x1f4;return function(_0x55ef88){logger['error'](_0x55ef88[_0xe3a3('0x2a')]);if(_0x55ef88[_0xe3a3('0x2b')]){delete _0x55ef88['name'];}_0x480ffa[_0xe3a3('0x1b')](_0x3fcdab)[_0xe3a3('0x2c')](_0x55ef88);};}exports[_0xe3a3('0x2d')]=function(_0x4f4b45,_0x5a0070){var _0x32129f={},_0x5ccb17={},_0x508d8f={'count':0x0,'rows':[]};var _0x445689=_[_0xe3a3('0x2e')](db[_0xe3a3('0x2f')]['rawAttributes'],function(_0x5a42e5){return{'name':_0x5a42e5[_0xe3a3('0x30')],'type':_0x5a42e5['type'][_0xe3a3('0x31')]};});_0x5ccb17['model']=_[_0xe3a3('0x2e')](_0x445689,_0xe3a3('0x2b'));_0x5ccb17[_0xe3a3('0x32')]=_[_0xe3a3('0x33')](_0x4f4b45[_0xe3a3('0x32')]);_0x5ccb17[_0xe3a3('0x34')]=_[_0xe3a3('0x35')](_0x5ccb17[_0xe3a3('0x36')],_0x5ccb17[_0xe3a3('0x32')]);_0x32129f[_0xe3a3('0x37')]=_[_0xe3a3('0x35')](_0x5ccb17['model'],qs[_0xe3a3('0x38')](_0x4f4b45[_0xe3a3('0x32')]['fields']));_0x32129f[_0xe3a3('0x37')]=_0x32129f[_0xe3a3('0x37')][_0xe3a3('0x39')]?_0x32129f['attributes']:_0x5ccb17['model'];if(!_0x4f4b45[_0xe3a3('0x32')]['hasOwnProperty'](_0xe3a3('0x3a'))){_0x32129f[_0xe3a3('0x20')]=qs['limit'](_0x4f4b45['query'][_0xe3a3('0x20')]);_0x32129f[_0xe3a3('0x1e')]=qs[_0xe3a3('0x1e')](_0x4f4b45[_0xe3a3('0x32')][_0xe3a3('0x1e')]);}_0x32129f['order']=qs['sort'](_0x4f4b45[_0xe3a3('0x32')]['sort']);_0x32129f[_0xe3a3('0x3b')]=qs[_0xe3a3('0x34')](_[_0xe3a3('0x3c')](_0x4f4b45[_0xe3a3('0x32')],_0x5ccb17[_0xe3a3('0x34')]),_0x445689);if(_0x4f4b45['query'][_0xe3a3('0x3d')]){_0x32129f[_0xe3a3('0x3b')]=_[_0xe3a3('0x3e')](_0x32129f[_0xe3a3('0x3b')],{'$or':_['map'](_0x445689,function(_0x52a16b){if(_0x52a16b[_0xe3a3('0x3f')]!=='VIRTUAL'){var _0x1c00dc={};_0x1c00dc[_0x52a16b['name']]={'$like':'%'+_0x4f4b45[_0xe3a3('0x32')][_0xe3a3('0x3d')]+'%'};return _0x1c00dc;}})});}_0x32129f=_['merge']({},_0x32129f,_0x4f4b45['options']);var _0x15cb88={'where':_0x32129f[_0xe3a3('0x3b')]};return db[_0xe3a3('0x2f')][_0xe3a3('0x21')](_0x15cb88)[_0xe3a3('0x25')](function(_0x1d60fc){_0x508d8f[_0xe3a3('0x21')]=_0x1d60fc;if(_0x4f4b45[_0xe3a3('0x32')][_0xe3a3('0x40')]){_0x32129f[_0xe3a3('0x41')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xe3a3('0x42')](_0x32129f);})[_0xe3a3('0x25')](function(_0x41b9af){_0x508d8f[_0xe3a3('0x43')]=_0x41b9af;return _0x508d8f;})[_0xe3a3('0x25')](respondWithFilteredResult(_0x5a0070,_0x32129f))[_0xe3a3('0x44')](handleError(_0x5a0070,null));};exports[_0xe3a3('0x45')]=function(_0x50d93b,_0x18e2ac){var _0x304756={'raw':!![],'where':{'id':_0x50d93b[_0xe3a3('0x46')]['id']}},_0x7a43e4={};_0x7a43e4['model']=_[_0xe3a3('0x33')](db[_0xe3a3('0x2f')][_0xe3a3('0x47')]);_0x7a43e4[_0xe3a3('0x32')]=_['keys'](_0x50d93b[_0xe3a3('0x32')]);_0x7a43e4['filters']=_['intersection'](_0x7a43e4[_0xe3a3('0x36')],_0x7a43e4[_0xe3a3('0x32')]);_0x304756[_0xe3a3('0x37')]=_[_0xe3a3('0x35')](_0x7a43e4['model'],qs[_0xe3a3('0x38')](_0x50d93b[_0xe3a3('0x32')]['fields']));_0x304756['attributes']=_0x304756[_0xe3a3('0x37')]['length']?_0x304756[_0xe3a3('0x37')]:_0x7a43e4[_0xe3a3('0x36')];if(_0x50d93b[_0xe3a3('0x32')][_0xe3a3('0x40')]){_0x304756['include']=[{'all':!![]}];}_0x304756=_['merge']({},_0x304756,_0x50d93b[_0xe3a3('0x48')]);return db[_0xe3a3('0x2f')][_0xe3a3('0x49')](_0x304756)['then'](handleEntityNotFound(_0x18e2ac,null))[_0xe3a3('0x25')](respondWithResult(_0x18e2ac,null))[_0xe3a3('0x44')](handleError(_0x18e2ac,null));};exports[_0xe3a3('0x4a')]=function(_0x1c9749,_0x45e212){return db[_0xe3a3('0x2f')][_0xe3a3('0x4a')](_0x1c9749[_0xe3a3('0x4b')],{})[_0xe3a3('0x25')](function(_0x58e60e){var _0x21030a=_0x1c9749['user'][_0xe3a3('0x26')]({'plain':!![]});if(!_0x21030a)throw new Error(_0xe3a3('0x4c'));if(_0x21030a['role']==='user'){var _0x292fb1=_0x58e60e[_0xe3a3('0x26')]({'plain':!![]});var _0x415972=_0xe3a3('0x27');return db[_0xe3a3('0x4d')][_0xe3a3('0x49')]({'where':{'name':_0x415972,'userProfileId':_0x21030a[_0xe3a3('0x4e')]},'raw':!![]})[_0xe3a3('0x25')](function(_0x4fe005){if(_0x4fe005&&_0x4fe005[_0xe3a3('0x4f')]===0x0){return db[_0xe3a3('0x28')]['create']({'name':_0x292fb1[_0xe3a3('0x2b')],'resourceId':_0x292fb1['id'],'type':_0x4fe005[_0xe3a3('0x2b')],'sectionId':_0x4fe005['id']},{})[_0xe3a3('0x25')](function(){return _0x58e60e;});}else{return _0x58e60e;}})[_0xe3a3('0x44')](function(_0x3f31b4){logger[_0xe3a3('0x50')](_0xe3a3('0x51'),_0x3f31b4);throw _0x3f31b4;});}return _0x58e60e;})[_0xe3a3('0x25')](respondWithResult(_0x45e212,0xc9))[_0xe3a3('0x44')](handleError(_0x45e212,null));};exports[_0xe3a3('0x24')]=function(_0xf721b3,_0x1e60b2){if(_0xf721b3['body']['id']){delete _0xf721b3[_0xe3a3('0x4b')]['id'];}return db[_0xe3a3('0x2f')]['find']({'where':{'id':_0xf721b3[_0xe3a3('0x46')]['id']}})[_0xe3a3('0x25')](handleEntityNotFound(_0x1e60b2,null))[_0xe3a3('0x25')](saveUpdates(_0xf721b3[_0xe3a3('0x4b')],null))[_0xe3a3('0x25')](respondWithResult(_0x1e60b2,null))['catch'](handleError(_0x1e60b2,null));};exports['destroy']=function(_0x5c0a32,_0x135c05){return db[_0xe3a3('0x2f')][_0xe3a3('0x49')]({'where':{'id':_0x5c0a32[_0xe3a3('0x46')]['id']}})[_0xe3a3('0x25')](handleEntityNotFound(_0x135c05,null))[_0xe3a3('0x25')](removeEntity(_0x135c05,null))[_0xe3a3('0x44')](handleError(_0x135c05,null));}; \ No newline at end of file +var _0xf688=['get','role','CmHopperAdditionalPhones','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','CmHopperAdditionalPhone','type','key','map','filters','intersection','model','query','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','include','catch','show','keys','rawAttributes','options','find','create','body','user'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xf688,0xa3));var _0x8f68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf688[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8f68('0x0'));var rimraf=require(_0x8f68('0x1'));var zipdir=require(_0x8f68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f68('0x3'));var moment=require(_0x8f68('0x4'));var BPromise=require(_0x8f68('0x5'));var Mustache=require(_0x8f68('0x6'));var util=require(_0x8f68('0x7'));var path=require(_0x8f68('0x8'));var sox=require(_0x8f68('0x9'));var csv=require(_0x8f68('0xa'));var ejs=require(_0x8f68('0xb'));var fs=require('fs');var fs_extra=require(_0x8f68('0xc'));var _=require('lodash');var squel=require(_0x8f68('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8f68('0xa'));var querystring=require(_0x8f68('0xe'));var Papa=require(_0x8f68('0xf'));var Redis=require('ioredis');var authService=require(_0x8f68('0x10'));var qs=require(_0x8f68('0x11'));var as=require(_0x8f68('0x12'));var hardwareService=require(_0x8f68('0x13'));var logger=require('../../config/logger')(_0x8f68('0x14'));var utils=require('../../config/utils');var config=require(_0x8f68('0x15'));var licenseUtil=require(_0x8f68('0x16'));var db=require(_0x8f68('0x17'))['db'];function respondWithStatusCode(_0x5eb772,_0x2505c0){_0x2505c0=_0x2505c0||0xcc;return function(_0x58c636){if(_0x58c636){return _0x5eb772[_0x8f68('0x18')](_0x2505c0);}return _0x5eb772[_0x8f68('0x19')](_0x2505c0)[_0x8f68('0x1a')]();};}function respondWithResult(_0x247966,_0xe24696){_0xe24696=_0xe24696||0xc8;return function(_0x4d115b){if(_0x4d115b){return _0x247966[_0x8f68('0x19')](_0xe24696)['json'](_0x4d115b);}};}function respondWithFilteredResult(_0x1c9de4,_0x35c577){return function(_0x11eed7){if(_0x11eed7){var _0x2cceb6=typeof _0x35c577[_0x8f68('0x1b')]===_0x8f68('0x1c')&&typeof _0x35c577[_0x8f68('0x1d')]===_0x8f68('0x1c');var _0x195071=_0x11eed7[_0x8f68('0x1e')];var _0x54c4f7=_0x2cceb6?0x0:_0x35c577[_0x8f68('0x1b')];var _0x353c0f=_0x2cceb6?_0x11eed7[_0x8f68('0x1e')]:_0x35c577[_0x8f68('0x1b')]+_0x35c577[_0x8f68('0x1d')];var _0x57be4b;if(_0x353c0f>=_0x195071){_0x353c0f=_0x195071;_0x57be4b=0xc8;}else{_0x57be4b=0xce;}_0x1c9de4['status'](_0x57be4b);return _0x1c9de4[_0x8f68('0x1f')](_0x8f68('0x20'),_0x54c4f7+'-'+_0x353c0f+'/'+_0x195071)[_0x8f68('0x21')](_0x11eed7);}return null;};}function patchUpdates(_0x1ed474){return function(_0x2c5e8c){try{jsonpatch[_0x8f68('0x22')](_0x2c5e8c,_0x1ed474,!![]);}catch(_0x6d47c){return BPromise['reject'](_0x6d47c);}return _0x2c5e8c[_0x8f68('0x23')]();};}function saveUpdates(_0x1cf643,_0x1174ff){return function(_0x1b4837){if(_0x1b4837){return _0x1b4837[_0x8f68('0x24')](_0x1cf643)[_0x8f68('0x25')](function(_0x1fda62){return _0x1fda62;});}return null;};}function removeEntity(_0x3f6d71,_0x35d853){return function(_0x408a47){if(_0x408a47){return _0x408a47[_0x8f68('0x26')]()['then'](function(){var _0x51ff17=_0x408a47['get']({'plain':!![]});var _0x3f87b5='CmHopperAdditionalPhones';return db['UserProfileResource'][_0x8f68('0x26')]({'where':{'type':_0x3f87b5,'resourceId':_0x51ff17['id']}})[_0x8f68('0x25')](function(){return _0x408a47;});})[_0x8f68('0x25')](function(){_0x3f6d71['status'](0xcc)[_0x8f68('0x1a')]();});}};}function handleEntityNotFound(_0x3d78f7,_0x34f6e6){return function(_0x459475){if(!_0x459475){_0x3d78f7[_0x8f68('0x18')](0x194);}return _0x459475;};}function handleError(_0x506138,_0x1e9cd2){_0x1e9cd2=_0x1e9cd2||0x1f4;return function(_0x3573b8){logger[_0x8f68('0x27')](_0x3573b8[_0x8f68('0x28')]);if(_0x3573b8[_0x8f68('0x29')]){delete _0x3573b8[_0x8f68('0x29')];}_0x506138[_0x8f68('0x19')](_0x1e9cd2)[_0x8f68('0x2a')](_0x3573b8);};}exports[_0x8f68('0x2b')]=function(_0x48d801,_0x3eafa4){var _0x1a664a={},_0xaf6a4e={},_0x465c7a={'count':0x0,'rows':[]};var _0xc6834e=_['map'](db[_0x8f68('0x2c')]['rawAttributes'],function(_0x3fc281){return{'name':_0x3fc281['fieldName'],'type':_0x3fc281[_0x8f68('0x2d')][_0x8f68('0x2e')]};});_0xaf6a4e['model']=_[_0x8f68('0x2f')](_0xc6834e,_0x8f68('0x29'));_0xaf6a4e['query']=_['keys'](_0x48d801['query']);_0xaf6a4e[_0x8f68('0x30')]=_[_0x8f68('0x31')](_0xaf6a4e[_0x8f68('0x32')],_0xaf6a4e[_0x8f68('0x33')]);_0x1a664a[_0x8f68('0x34')]=_[_0x8f68('0x31')](_0xaf6a4e[_0x8f68('0x32')],qs['fields'](_0x48d801[_0x8f68('0x33')][_0x8f68('0x35')]));_0x1a664a[_0x8f68('0x34')]=_0x1a664a[_0x8f68('0x34')][_0x8f68('0x36')]?_0x1a664a[_0x8f68('0x34')]:_0xaf6a4e[_0x8f68('0x32')];if(!_0x48d801[_0x8f68('0x33')]['hasOwnProperty'](_0x8f68('0x37'))){_0x1a664a[_0x8f68('0x1d')]=qs[_0x8f68('0x1d')](_0x48d801[_0x8f68('0x33')][_0x8f68('0x1d')]);_0x1a664a['offset']=qs[_0x8f68('0x1b')](_0x48d801[_0x8f68('0x33')]['offset']);}_0x1a664a['order']=qs['sort'](_0x48d801[_0x8f68('0x33')][_0x8f68('0x38')]);_0x1a664a[_0x8f68('0x39')]=qs[_0x8f68('0x30')](_[_0x8f68('0x3a')](_0x48d801[_0x8f68('0x33')],_0xaf6a4e[_0x8f68('0x30')]),_0xc6834e);if(_0x48d801['query']['filter']){_0x1a664a[_0x8f68('0x39')]=_[_0x8f68('0x3b')](_0x1a664a[_0x8f68('0x39')],{'$or':_[_0x8f68('0x2f')](_0xc6834e,function(_0x4a7e2e){if(_0x4a7e2e[_0x8f68('0x2d')]!==_0x8f68('0x3c')){var _0x3919a0={};_0x3919a0[_0x4a7e2e['name']]={'$like':'%'+_0x48d801['query']['filter']+'%'};return _0x3919a0;}})});}_0x1a664a=_[_0x8f68('0x3b')]({},_0x1a664a,_0x48d801['options']);var _0x3599e3={'where':_0x1a664a['where']};return db[_0x8f68('0x2c')][_0x8f68('0x1e')](_0x3599e3)[_0x8f68('0x25')](function(_0xda3fd0){_0x465c7a[_0x8f68('0x1e')]=_0xda3fd0;if(_0x48d801[_0x8f68('0x33')]['includeAll']){_0x1a664a[_0x8f68('0x3d')]=[{'all':!![]}];}return db[_0x8f68('0x2c')]['findAll'](_0x1a664a);})[_0x8f68('0x25')](function(_0xd8d621){_0x465c7a['rows']=_0xd8d621;return _0x465c7a;})['then'](respondWithFilteredResult(_0x3eafa4,_0x1a664a))[_0x8f68('0x3e')](handleError(_0x3eafa4,null));};exports[_0x8f68('0x3f')]=function(_0x58f870,_0x4dd552){var _0x336c60={'raw':!![],'where':{'id':_0x58f870['params']['id']}},_0x1f56f7={};_0x1f56f7[_0x8f68('0x32')]=_[_0x8f68('0x40')](db['CmHopperAdditionalPhone'][_0x8f68('0x41')]);_0x1f56f7['query']=_[_0x8f68('0x40')](_0x58f870[_0x8f68('0x33')]);_0x1f56f7['filters']=_[_0x8f68('0x31')](_0x1f56f7['model'],_0x1f56f7[_0x8f68('0x33')]);_0x336c60[_0x8f68('0x34')]=_[_0x8f68('0x31')](_0x1f56f7[_0x8f68('0x32')],qs['fields'](_0x58f870[_0x8f68('0x33')][_0x8f68('0x35')]));_0x336c60[_0x8f68('0x34')]=_0x336c60['attributes'][_0x8f68('0x36')]?_0x336c60[_0x8f68('0x34')]:_0x1f56f7[_0x8f68('0x32')];if(_0x58f870[_0x8f68('0x33')]['includeAll']){_0x336c60[_0x8f68('0x3d')]=[{'all':!![]}];}_0x336c60=_[_0x8f68('0x3b')]({},_0x336c60,_0x58f870[_0x8f68('0x42')]);return db[_0x8f68('0x2c')][_0x8f68('0x43')](_0x336c60)['then'](handleEntityNotFound(_0x4dd552,null))[_0x8f68('0x25')](respondWithResult(_0x4dd552,null))[_0x8f68('0x3e')](handleError(_0x4dd552,null));};exports[_0x8f68('0x44')]=function(_0x628337,_0x220689){return db['CmHopperAdditionalPhone'][_0x8f68('0x44')](_0x628337[_0x8f68('0x45')],{})[_0x8f68('0x25')](function(_0x59c882){var _0x1b4efd=_0x628337[_0x8f68('0x46')][_0x8f68('0x47')]({'plain':!![]});if(!_0x1b4efd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b4efd[_0x8f68('0x48')]==='user'){var _0x5dcb38=_0x59c882[_0x8f68('0x47')]({'plain':!![]});var _0x5cc606=_0x8f68('0x49');return db['UserProfileSection'][_0x8f68('0x43')]({'where':{'name':_0x5cc606,'userProfileId':_0x1b4efd[_0x8f68('0x4a')]},'raw':!![]})['then'](function(_0x1fa0e5){if(_0x1fa0e5&&_0x1fa0e5['autoAssociation']===0x0){return db[_0x8f68('0x4b')][_0x8f68('0x44')]({'name':_0x5dcb38['name'],'resourceId':_0x5dcb38['id'],'type':_0x1fa0e5[_0x8f68('0x29')],'sectionId':_0x1fa0e5['id']},{})['then'](function(){return _0x59c882;});}else{return _0x59c882;}})[_0x8f68('0x3e')](function(_0x395c4a){logger[_0x8f68('0x27')](_0x8f68('0x4c'),_0x395c4a);throw _0x395c4a;});}return _0x59c882;})['then'](respondWithResult(_0x220689,0xc9))[_0x8f68('0x3e')](handleError(_0x220689,null));};exports['update']=function(_0x515873,_0x44398d){if(_0x515873[_0x8f68('0x45')]['id']){delete _0x515873[_0x8f68('0x45')]['id'];}return db[_0x8f68('0x2c')][_0x8f68('0x43')]({'where':{'id':_0x515873[_0x8f68('0x4d')]['id']}})[_0x8f68('0x25')](handleEntityNotFound(_0x44398d,null))[_0x8f68('0x25')](saveUpdates(_0x515873[_0x8f68('0x45')],null))[_0x8f68('0x25')](respondWithResult(_0x44398d,null))[_0x8f68('0x3e')](handleError(_0x44398d,null));};exports[_0x8f68('0x26')]=function(_0x5c5649,_0x42054f){return db[_0x8f68('0x2c')][_0x8f68('0x43')]({'where':{'id':_0x5c5649['params']['id']}})[_0x8f68('0x25')](handleEntityNotFound(_0x42054f,null))[_0x8f68('0x25')](removeEntity(_0x42054f,null))[_0x8f68('0x3e')](handleError(_0x42054f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index dea6591..43567ee 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 _0xf873=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf873,0xb2));var _0x3f87=function(_0x28ac68,_0x3682f7){_0x28ac68=_0x28ac68-0x0;var _0x4e81d1=_0xf873[_0x28ac68];return _0x4e81d1;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var logger=require(_0x3f87('0x1'))(_0x3f87('0x2'));var moment=require(_0x3f87('0x3'));var BPromise=require(_0x3f87('0x4'));var rp=require(_0x3f87('0x5'));var fs=require('fs');var path=require(_0x3f87('0x6'));var rimraf=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x3f87('0x9')]=function(_0x43c8e4,_0x27c03e){return _0x43c8e4['define'](_0x3f87('0xa'),attributes,{'tableName':_0x3f87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e30=['./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3e30,0x17d));var _0x03e3=function(_0x39e6e6,_0x3e4898){_0x39e6e6=_0x39e6e6-0x0;var _0x4ecd7b=_0x3e30[_0x39e6e6];return _0x4ecd7b;};'use strict';var _=require('lodash');var util=require(_0x03e3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x03e3('0x1'));var BPromise=require(_0x03e3('0x2'));var rp=require(_0x03e3('0x3'));var fs=require('fs');var path=require(_0x03e3('0x4'));var rimraf=require('rimraf');var config=require(_0x03e3('0x5'));var attributes=require(_0x03e3('0x6'));module['exports']=function(_0xa075eb,_0x40630d){return _0xa075eb[_0x03e3('0x7')](_0x03e3('0x8'),attributes,{'tableName':'cm_hopper_additional_phones','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 f97a299..ee4ff7a 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 _0x806a=['info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','then','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnosuchnumberretry','catch','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','ListId','duration','waitTime','ASC','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x52e0da,_0x46546d){var _0x3490ec=function(_0x426afd){while(--_0x426afd){_0x52e0da['push'](_0x52e0da['shift']());}};_0x3490ec(++_0x46546d);}(_0x806a,0x6c));var _0xa806=function(_0x23a57e,_0x202b2a){_0x23a57e=_0x23a57e-0x0;var _0x52fc8e=_0x806a[_0x23a57e];return _0x52fc8e;};'use strict';var _=require(_0xa806('0x0'));var util=require('util');var moment=require(_0xa806('0x1'));var BPromise=require(_0xa806('0x2'));var rs=require(_0xa806('0x3'));var fs=require('fs');var Redis=require(_0xa806('0x4'));var db=require(_0xa806('0x5'))['db'];var utils=require(_0xa806('0x6'));var logger=require(_0xa806('0x7'))(_0xa806('0x8'));var config=require(_0xa806('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa806('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b38f4,_0x39c9aa,_0x3a6116){return new BPromise(function(_0x1fea94,_0x5c6eb0){return client[_0xa806('0xb')](_0x2b38f4,_0x3a6116)['then'](function(_0xd61388){logger[_0xa806('0xc')](_0xa806('0xd'),_0x39c9aa,'request\x20sent');logger[_0xa806('0xe')](_0xa806('0xf'),_0x39c9aa,_0xa806('0x10'),JSON[_0xa806('0x11')](_0xd61388));if(_0xd61388[_0xa806('0x12')]){if(_0xd61388[_0xa806('0x12')][_0xa806('0x13')]===0x1f4){logger[_0xa806('0x12')](_0xa806('0xd'),_0x39c9aa,_0xd61388[_0xa806('0x12')][_0xa806('0x14')]);return _0x5c6eb0(_0xd61388['error'][_0xa806('0x14')]);}logger[_0xa806('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x39c9aa,_0xd61388[_0xa806('0x12')][_0xa806('0x14')]);return _0x1fea94(_0xd61388[_0xa806('0x12')][_0xa806('0x14')]);}else{logger[_0xa806('0xc')](_0xa806('0xd'),_0x39c9aa,'request\x20sent');_0x1fea94(_0xd61388[_0xa806('0x15')]['message']);}})['catch'](function(_0x3f12a4){logger[_0xa806('0x12')](_0xa806('0xd'),_0x39c9aa,_0x3f12a4);_0x5c6eb0(_0x3f12a4);});});}exports['VerifyAdditionalPhones']=function(_0x197753){var _0xd4b14d=this;return new Promise(function(_0x8b508a,_0x2769bd){return db['CmHopper'][_0xa806('0x16')]({'raw':!![],'where':{'ContactId':_0x197753[_0xa806('0x17')][_0xa806('0x18')],'ListId':_0x197753[_0xa806('0x17')]['ListId'],'VoiceQueueId':_0x197753['body'][_0xa806('0x19')]===undefined?null:_0x197753[_0xa806('0x17')][_0xa806('0x19')],'CampaignId':_0x197753['body'][_0xa806('0x1a')]===undefined?null:_0x197753[_0xa806('0x17')][_0xa806('0x1a')]}})['then'](function(_0x473bf7){if(_0x473bf7!=null){return db[_0xa806('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x473bf7['id'],'OrderBy':{'$gt':_0x473bf7[_0xa806('0x1c')]}},'order':[['OrderBy','ASC']]})[_0xa806('0x1d')](function(_0x53b9c2){var _0x2c3c4a=0x0;if(_0x53b9c2){if(_0x53b9c2[_0xa806('0x1e')]+_0x53b9c2[_0xa806('0x1f')]+_0x53b9c2[_0xa806('0x20')]+_0x53b9c2['countnosuchnumberretry']+_0x53b9c2[_0xa806('0x21')]+_0x53b9c2[_0xa806('0x22')]+_0x53b9c2[_0xa806('0x23')]+_0x53b9c2[_0xa806('0x24')]<_0x197753[_0xa806('0x25')][_0xa806('0x26')])_0x2c3c4a=0x1;_0x8b508a({'additional':_0x2c3c4a});}else{return db[_0xa806('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x473bf7['id']},'order':[[_0xa806('0x1c'),'ASC']]})[_0xa806('0x1d')](function(_0x593a5e){var _0xb7b57d=0x0;if(_0x593a5e){if(_0x593a5e['countbusyretry']+_0x593a5e[_0xa806('0x1f')]+_0x593a5e[_0xa806('0x20')]+_0x593a5e[_0xa806('0x27')]+_0x593a5e['countdropretry']+_0x593a5e[_0xa806('0x22')]+_0x593a5e[_0xa806('0x23')]+_0x593a5e[_0xa806('0x24')]<_0x197753[_0xa806('0x25')][_0xa806('0x26')])_0xb7b57d=0x1;_0x8b508a({'additional':_0xb7b57d});}else{_0x8b508a({'additional':0x0});}})[_0xa806('0x28')](function(_0x49a42c){logger[_0xa806('0x12')](_0xa806('0x29'),_0x49a42c['message']);_0x2769bd(_0xd4b14d[_0xa806('0x12')](0x1f4,_0x49a42c[_0xa806('0x14')]));});}})[_0xa806('0x28')](function(_0x57483d){logger[_0xa806('0x12')](_0xa806('0x29'),_0x57483d[_0xa806('0x14')]);_0x2769bd(_0xd4b14d['error'](0x1f4,_0x57483d['message']));});}else _0x8b508a({'additional':0x0});});});};exports[_0xa806('0x2a')]=function(_0x5d98a8){var _0x548b95=this;return new Promise(function(_0x39abdf,_0x197918){return db[_0xa806('0x2b')][_0xa806('0x16')]({'raw':!![],'where':{'ContactId':_0x5d98a8[_0xa806('0x17')]['ContactId'],'ListId':_0x5d98a8[_0xa806('0x17')][_0xa806('0x2c')],'VoiceQueueId':_0x5d98a8['body'][_0xa806('0x19')]===undefined?null:_0x5d98a8[_0xa806('0x17')]['VoiceQueueId'],'CampaignId':_0x5d98a8[_0xa806('0x17')][_0xa806('0x1a')]===undefined?null:_0x5d98a8['body']['CampaignId']}})['then'](function(_0x3d3d49){if(_0x3d3d49!=null){return db['CmHopperAdditionalPhone'][_0xa806('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3d3d49['id'],'OrderBy':{'$gte':_0x3d3d49[_0xa806('0x1c')]}},'order':[[_0xa806('0x1c'),'ASC']]})[_0xa806('0x1d')](function(_0x502c09){if(_0x502c09)return activateAdditionalPhone(_0x3d3d49,_0x5d98a8[_0xa806('0x17')],_0x502c09,_0x5d98a8[_0xa806('0x2d')],_0x5d98a8[_0xa806('0x2e')])[_0xa806('0x1d')](function(_0x302e69){_0x39abdf(_0x302e69);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x3d3d49['id']},'order':[[_0xa806('0x1c'),_0xa806('0x2f')]]})[_0xa806('0x1d')](function(_0xb4c1b7){if(_0xb4c1b7)return activateAdditionalPhone(_0x3d3d49,_0x5d98a8[_0xa806('0x17')],_0xb4c1b7,_0x5d98a8['duration'],_0x5d98a8[_0xa806('0x2e')])[_0xa806('0x1d')](function(_0x53e239){_0x39abdf(_0x53e239);});else{_0x39abdf({'id':_0x3d3d49['id'],'phone':''});}})[_0xa806('0x28')](function(_0x2c8361){logger[_0xa806('0x12')]('VerifyAdditionalPhones',_0x2c8361[_0xa806('0x14')]);_0x197918(_0x548b95['error'](0x1f4,_0x2c8361['message']));});}})[_0xa806('0x28')](function(_0x23d518){logger[_0xa806('0x12')]('VerifyAdditionalPhones',_0x23d518[_0xa806('0x14')]);_0x197918(_0x548b95[_0xa806('0x12')](0x1f4,_0x23d518[_0xa806('0x14')]));});}else _0x39abdf(0x1);});});};function activateAdditionalPhone(_0x1f1992,_0x41f0a3,_0xd74a14,_0x589958,_0x39c29e){return new Promise(function(_0x3b44b6,_0x435769){var _0x4fe3d2;if(_[_0xa806('0x30')](_0xd74a14['scheduledat'])){_0xd74a14[_0xa806('0x31')]=moment();}if(moment()>moment(_0xd74a14[_0xa806('0x31')])){_0x4fe3d2=moment()[_0xa806('0x32')](_0x39c29e||0x3,'minutes');}else{if(_0xd74a14['OrderBy']==0x0){_0x4fe3d2=moment(_0xd74a14[_0xa806('0x31')]);}else{_0x4fe3d2=moment()[_0xa806('0x32')](_0x39c29e||0x3,_0xa806('0x33'));}}if(_[_0xa806('0x30')](_0x4fe3d2)){_0x4fe3d2=moment()['add'](_0x39c29e||0x3,'minutes');}var _0x471521={'phone':_0x1f1992['phone'],'active':0x0,'OrderBy':_[_0xa806('0x30')](_0x1f1992['OrderBy'])?0x0:_0x1f1992[_0xa806('0x1c')],'scheduledat':moment()[_0xa806('0x32')](_0x589958||0x1,_0xa806('0x33')),'countbusyretry':_0x41f0a3[_0xa806('0x1e')],'countcongestionretry':_0x41f0a3[_0xa806('0x1f')],'countnoanswerretry':_0x41f0a3['countnoanswerretry'],'countnosuchnumberretry':_0x41f0a3[_0xa806('0x27')],'countdropretry':_0x41f0a3[_0xa806('0x21')],'countabandonedretry':_0x41f0a3['countabandonedretry'],'countmachineretry':_0x41f0a3[_0xa806('0x23')],'countagentrejectretry':_0x41f0a3[_0xa806('0x24')],'createdAt':_0x41f0a3[_0xa806('0x34')],'updatedAt':_0x41f0a3[_0xa806('0x35')]};var _0x27bff8={'CmHopperId':_0x1f1992['id'],'phone':_0xd74a14[_0xa806('0x36')],'active':0x0,'OrderBy':_['isNil'](_0xd74a14[_0xa806('0x1c')])?0x0:_0xd74a14[_0xa806('0x1c')],'scheduledat':_0x4fe3d2,'countbusyretry':_0xd74a14[_0xa806('0x1e')],'countcongestionretry':_0xd74a14[_0xa806('0x1f')],'countnoanswerretry':_0xd74a14[_0xa806('0x20')],'countnosuchnumberretry':_0xd74a14[_0xa806('0x27')],'countdropretry':_0xd74a14[_0xa806('0x21')],'countabandonedretry':_0xd74a14['countabandonedretry'],'countmachineretry':_0xd74a14[_0xa806('0x23')],'countagentrejectretry':_0xd74a14[_0xa806('0x24')],'createdAt':_0xd74a14[_0xa806('0x34')],'updatedAt':_0xd74a14[_0xa806('0x35')]};return db[_0xa806('0x37')][_0xa806('0x38')](function(_0x528883){return db[_0xa806('0x1b')]['update'](_0x471521,{'where':{'id':_0xd74a14['id']}},{'transaction':_0x528883})['then'](function(){return db[_0xa806('0x2b')][_0xa806('0x39')](_0x27bff8,{'where':{'id':_0x1f1992['id']}},{'transaction':_0x528883});});})[_0xa806('0x1d')](function(_0x205a46){_0x3b44b6({'id':_0x1f1992['id'],'phone':_0xd74a14[_0xa806('0x36')]});})[_0xa806('0x28')](function(_0x5f597d){logger[_0xa806('0x12')](_0xa806('0x3a'),_0x5f597d[_0xa806('0x14')]);_0x435769({'error':_0x5f597d[_0xa806('0x14')]});});});}exports[_0xa806('0x3b')]=function(_0x37841e){var _0x1e0490=this;return new Promise(function(_0x1f5f3e,_0x4fbe4c){return db['CmHopper'][_0xa806('0x39')](_0x37841e[_0xa806('0x17')]['field'],{'where':{'id':_0x37841e[_0xa806('0x17')]['id']}})[_0xa806('0x1d')](function(_0x55e13d){_0x1f5f3e(_0x55e13d);})[_0xa806('0x28')](function(_0x22bf12){logger[_0xa806('0x12')](_0xa806('0x3b'),_0x22bf12[_0xa806('0x14')]);_0x4fbe4c(_0x1e0490[_0xa806('0x12')](0x1f4,_0x22bf12[_0xa806('0x14')]));});});}; \ No newline at end of file +var _0x9c83=['ListId','VoiceQueueId','OrderBy','ASC','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','CmHopperAdditionalPhone','countnoanswerretry','countnosuchnumberretry','entity','catch','SwapAdditionalPhones','ContactId','CampaignId','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','phone','updatedAt','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','result','VerifyAdditionalPhones','CmHopper','findOne','body'];(function(_0x22265c,_0x20db65){var _0x357cb9=function(_0x22139d){while(--_0x22139d){_0x22265c['push'](_0x22265c['shift']());}};_0x357cb9(++_0x20db65);}(_0x9c83,0x138));var _0x39c8=function(_0x274af9,_0x38b2ef){_0x274af9=_0x274af9-0x0;var _0x5db20b=_0x9c83[_0x274af9];return _0x5db20b;};'use strict';var _=require(_0x39c8('0x0'));var util=require('util');var moment=require(_0x39c8('0x1'));var BPromise=require(_0x39c8('0x2'));var rs=require(_0x39c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39c8('0x4'))['db'];var utils=require(_0x39c8('0x5'));var logger=require(_0x39c8('0x6'))(_0x39c8('0x7'));var config=require(_0x39c8('0x8'));var jayson=require(_0x39c8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48163b,_0x1ab5cc,_0x10ce7c){return new BPromise(function(_0x563683,_0x301d22){return client[_0x39c8('0xa')](_0x48163b,_0x10ce7c)[_0x39c8('0xb')](function(_0x21640e){logger[_0x39c8('0xc')](_0x39c8('0xd'),_0x1ab5cc,_0x39c8('0xe'));logger[_0x39c8('0xf')](_0x39c8('0x10'),_0x1ab5cc,_0x39c8('0xe'),JSON['stringify'](_0x21640e));if(_0x21640e['error']){if(_0x21640e[_0x39c8('0x11')]['code']===0x1f4){logger[_0x39c8('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1ab5cc,_0x21640e['error'][_0x39c8('0x12')]);return _0x301d22(_0x21640e[_0x39c8('0x11')]['message']);}logger['error'](_0x39c8('0xd'),_0x1ab5cc,_0x21640e[_0x39c8('0x11')][_0x39c8('0x12')]);return _0x563683(_0x21640e[_0x39c8('0x11')][_0x39c8('0x12')]);}else{logger[_0x39c8('0xc')](_0x39c8('0xd'),_0x1ab5cc,_0x39c8('0xe'));_0x563683(_0x21640e[_0x39c8('0x13')][_0x39c8('0x12')]);}})['catch'](function(_0x4d9bf9){logger[_0x39c8('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1ab5cc,_0x4d9bf9);_0x301d22(_0x4d9bf9);});});}exports[_0x39c8('0x14')]=function(_0x8b89aa){var _0xc7364a=this;return new Promise(function(_0x4c4446,_0x67ff00){return db[_0x39c8('0x15')][_0x39c8('0x16')]({'raw':!![],'where':{'ContactId':_0x8b89aa[_0x39c8('0x17')]['ContactId'],'ListId':_0x8b89aa[_0x39c8('0x17')][_0x39c8('0x18')],'VoiceQueueId':_0x8b89aa[_0x39c8('0x17')][_0x39c8('0x19')]===undefined?null:_0x8b89aa[_0x39c8('0x17')][_0x39c8('0x19')],'CampaignId':_0x8b89aa['body']['CampaignId']===undefined?null:_0x8b89aa[_0x39c8('0x17')]['CampaignId']}})['then'](function(_0x21cd4d){if(_0x21cd4d!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x21cd4d['id'],'OrderBy':{'$gt':_0x21cd4d[_0x39c8('0x1a')]}},'order':[[_0x39c8('0x1a'),_0x39c8('0x1b')]]})[_0x39c8('0xb')](function(_0x548b33){var _0x203835=0x0;if(_0x548b33){if(_0x548b33[_0x39c8('0x1c')]+_0x548b33[_0x39c8('0x1d')]+_0x548b33['countnoanswerretry']+_0x548b33['countnosuchnumberretry']+_0x548b33[_0x39c8('0x1e')]+_0x548b33[_0x39c8('0x1f')]+_0x548b33[_0x39c8('0x20')]+_0x548b33[_0x39c8('0x21')]<_0x8b89aa['entity']['dialGlobalMaxRetry'])_0x203835=0x1;_0x4c4446({'additional':_0x203835});}else{return db[_0x39c8('0x22')][_0x39c8('0x16')]({'raw':!![],'where':{'CmHopperId':_0x21cd4d['id']},'order':[['OrderBy',_0x39c8('0x1b')]]})[_0x39c8('0xb')](function(_0x354760){var _0x4b06a8=0x0;if(_0x354760){if(_0x354760[_0x39c8('0x1c')]+_0x354760[_0x39c8('0x1d')]+_0x354760[_0x39c8('0x23')]+_0x354760[_0x39c8('0x24')]+_0x354760[_0x39c8('0x1e')]+_0x354760[_0x39c8('0x1f')]+_0x354760['countmachineretry']+_0x354760[_0x39c8('0x21')]<_0x8b89aa[_0x39c8('0x25')]['dialGlobalMaxRetry'])_0x4b06a8=0x1;_0x4c4446({'additional':_0x4b06a8});}else{_0x4c4446({'additional':0x0});}})[_0x39c8('0x26')](function(_0x175b0c){logger['error']('VerifyAdditionalPhones',_0x175b0c[_0x39c8('0x12')]);_0x67ff00(_0xc7364a[_0x39c8('0x11')](0x1f4,_0x175b0c[_0x39c8('0x12')]));});}})[_0x39c8('0x26')](function(_0x2243f4){logger['error']('VerifyAdditionalPhones',_0x2243f4[_0x39c8('0x12')]);_0x67ff00(_0xc7364a[_0x39c8('0x11')](0x1f4,_0x2243f4['message']));});}else _0x4c4446({'additional':0x0});});});};exports[_0x39c8('0x27')]=function(_0x135ffe){var _0x50ee4c=this;return new Promise(function(_0x4bd8c2,_0x230c06){return db[_0x39c8('0x15')]['findOne']({'raw':!![],'where':{'ContactId':_0x135ffe[_0x39c8('0x17')][_0x39c8('0x28')],'ListId':_0x135ffe[_0x39c8('0x17')][_0x39c8('0x18')],'VoiceQueueId':_0x135ffe[_0x39c8('0x17')][_0x39c8('0x19')]===undefined?null:_0x135ffe[_0x39c8('0x17')][_0x39c8('0x19')],'CampaignId':_0x135ffe['body']['CampaignId']===undefined?null:_0x135ffe[_0x39c8('0x17')][_0x39c8('0x29')]}})[_0x39c8('0xb')](function(_0x3eb4ee){if(_0x3eb4ee!=null){return db[_0x39c8('0x22')][_0x39c8('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3eb4ee['id'],'OrderBy':{'$gte':_0x3eb4ee[_0x39c8('0x1a')]}},'order':[[_0x39c8('0x1a'),_0x39c8('0x1b')]]})['then'](function(_0x29658a){if(_0x29658a)return activateAdditionalPhone(_0x3eb4ee,_0x135ffe['body'],_0x29658a,_0x135ffe[_0x39c8('0x2a')],_0x135ffe[_0x39c8('0x2b')])[_0x39c8('0xb')](function(_0xe965ff){_0x4bd8c2(_0xe965ff);});else{return db[_0x39c8('0x22')][_0x39c8('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3eb4ee['id']},'order':[['OrderBy',_0x39c8('0x1b')]]})[_0x39c8('0xb')](function(_0x9d2da2){if(_0x9d2da2)return activateAdditionalPhone(_0x3eb4ee,_0x135ffe[_0x39c8('0x17')],_0x9d2da2,_0x135ffe[_0x39c8('0x2a')],_0x135ffe[_0x39c8('0x2b')])[_0x39c8('0xb')](function(_0xcdabe0){_0x4bd8c2(_0xcdabe0);});else{_0x4bd8c2({'id':_0x3eb4ee['id'],'phone':''});}})[_0x39c8('0x26')](function(_0x87c55e){logger['error'](_0x39c8('0x14'),_0x87c55e['message']);_0x230c06(_0x50ee4c[_0x39c8('0x11')](0x1f4,_0x87c55e[_0x39c8('0x12')]));});}})[_0x39c8('0x26')](function(_0x5d1022){logger[_0x39c8('0x11')](_0x39c8('0x14'),_0x5d1022[_0x39c8('0x12')]);_0x230c06(_0x50ee4c[_0x39c8('0x11')](0x1f4,_0x5d1022[_0x39c8('0x12')]));});}else _0x4bd8c2(0x1);});});};function activateAdditionalPhone(_0x42f91e,_0x23bc18,_0x427f7c,_0x1c6857,_0x45a850){return new Promise(function(_0x50c224,_0x3f2aaa){var _0x1d0d2b;if(_[_0x39c8('0x2c')](_0x427f7c[_0x39c8('0x2d')])){_0x427f7c[_0x39c8('0x2d')]=moment();}if(moment()>moment(_0x427f7c[_0x39c8('0x2d')])){_0x1d0d2b=moment()[_0x39c8('0x2e')](_0x45a850||0x3,'minutes');}else{if(_0x427f7c[_0x39c8('0x1a')]==0x0){_0x1d0d2b=moment(_0x427f7c[_0x39c8('0x2d')]);}else{_0x1d0d2b=moment()[_0x39c8('0x2e')](_0x45a850||0x3,_0x39c8('0x2f'));}}if(_[_0x39c8('0x2c')](_0x1d0d2b)){_0x1d0d2b=moment()[_0x39c8('0x2e')](_0x45a850||0x3,_0x39c8('0x2f'));}var _0x1488b0={'phone':_0x42f91e['phone'],'active':0x0,'OrderBy':_[_0x39c8('0x2c')](_0x42f91e[_0x39c8('0x1a')])?0x0:_0x42f91e[_0x39c8('0x1a')],'scheduledat':moment()[_0x39c8('0x2e')](_0x1c6857||0x1,_0x39c8('0x2f')),'countbusyretry':_0x23bc18[_0x39c8('0x1c')],'countcongestionretry':_0x23bc18[_0x39c8('0x1d')],'countnoanswerretry':_0x23bc18[_0x39c8('0x23')],'countnosuchnumberretry':_0x23bc18[_0x39c8('0x24')],'countdropretry':_0x23bc18[_0x39c8('0x1e')],'countabandonedretry':_0x23bc18[_0x39c8('0x1f')],'countmachineretry':_0x23bc18['countmachineretry'],'countagentrejectretry':_0x23bc18[_0x39c8('0x21')],'createdAt':_0x23bc18[_0x39c8('0x30')],'updatedAt':_0x23bc18['updatedAt']};var _0x471924={'CmHopperId':_0x42f91e['id'],'phone':_0x427f7c[_0x39c8('0x31')],'active':0x0,'OrderBy':_[_0x39c8('0x2c')](_0x427f7c['OrderBy'])?0x0:_0x427f7c['OrderBy'],'scheduledat':_0x1d0d2b,'countbusyretry':_0x427f7c[_0x39c8('0x1c')],'countcongestionretry':_0x427f7c['countcongestionretry'],'countnoanswerretry':_0x427f7c[_0x39c8('0x23')],'countnosuchnumberretry':_0x427f7c[_0x39c8('0x24')],'countdropretry':_0x427f7c[_0x39c8('0x1e')],'countabandonedretry':_0x427f7c[_0x39c8('0x1f')],'countmachineretry':_0x427f7c[_0x39c8('0x20')],'countagentrejectretry':_0x427f7c[_0x39c8('0x21')],'createdAt':_0x427f7c[_0x39c8('0x30')],'updatedAt':_0x427f7c[_0x39c8('0x32')]};return db['sequelize'][_0x39c8('0x33')](function(_0x4ce75d){return db[_0x39c8('0x22')][_0x39c8('0x34')](_0x1488b0,{'where':{'id':_0x427f7c['id']}},{'transaction':_0x4ce75d})['then'](function(){return db['CmHopper'][_0x39c8('0x34')](_0x471924,{'where':{'id':_0x42f91e['id']}},{'transaction':_0x4ce75d});});})[_0x39c8('0xb')](function(_0x158f75){_0x50c224({'id':_0x42f91e['id'],'phone':_0x427f7c['phone']});})[_0x39c8('0x26')](function(_0x5f05d6){logger['error'](_0x39c8('0x35'),_0x5f05d6[_0x39c8('0x12')]);_0x3f2aaa({'error':_0x5f05d6[_0x39c8('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x5b3bdd){var _0x2ba4ba=this;return new Promise(function(_0xa80d52,_0x312d17){return db[_0x39c8('0x15')][_0x39c8('0x34')](_0x5b3bdd['body'][_0x39c8('0x36')],{'where':{'id':_0x5b3bdd[_0x39c8('0x17')]['id']}})[_0x39c8('0xb')](function(_0x2498a3){_0xa80d52(_0x2498a3);})['catch'](function(_0x272b4b){logger[_0x39c8('0x11')](_0x39c8('0x37'),_0x272b4b['message']);_0x312d17(_0x2ba4ba['error'](0x1f4,_0x272b4b[_0x39c8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 953dbb0..9cbfd29 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 _0xcb6a=['show','post','create','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','get','/:id'];(function(_0x4d528f,_0x587c3a){var _0x33f73b=function(_0x489990){while(--_0x489990){_0x4d528f['push'](_0x4d528f['shift']());}};_0x33f73b(++_0x587c3a);}(_0xcb6a,0x16a));var _0xacb6=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xcb6a[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0xacb6('0x0'));var util=require(_0xacb6('0x1'));var path=require(_0xacb6('0x2'));var timeout=require(_0xacb6('0x3'));var express=require('express');var router=express[_0xacb6('0x4')]();var fs_extra=require(_0xacb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacb6('0x6'));var config=require(_0xacb6('0x7'));var controller=require(_0xacb6('0x8'));router['get']('/',auth[_0xacb6('0x9')](),controller['index']);router[_0xacb6('0xa')](_0xacb6('0xb'),auth[_0xacb6('0x9')](),controller[_0xacb6('0xc')]);router[_0xacb6('0xd')]('/',auth[_0xacb6('0x9')](),controller[_0xacb6('0xe')]);router['put'](_0xacb6('0xb'),auth[_0xacb6('0x9')](),controller['update']);router['delete'](_0xacb6('0xb'),auth[_0xacb6('0x9')](),controller[_0xacb6('0xf')]);module[_0xacb6('0x10')]=router; \ No newline at end of file +var _0x93cc=['get','/:id','show','post','create','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x93cc,0x90));var _0xc93c=function(_0x543b2a,_0x53acd7){_0x543b2a=_0x543b2a-0x0;var _0x43c7c8=_0x93cc[_0x543b2a];return _0x43c7c8;};'use strict';var multer=require(_0xc93c('0x0'));var util=require(_0xc93c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc93c('0x2'));var router=express[_0xc93c('0x3')]();var fs_extra=require(_0xc93c('0x4'));var auth=require(_0xc93c('0x5'));var interaction=require(_0xc93c('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth[_0xc93c('0x7')](),controller[_0xc93c('0x8')]);router[_0xc93c('0x9')](_0xc93c('0xa'),auth[_0xc93c('0x7')](),controller[_0xc93c('0xb')]);router[_0xc93c('0xc')]('/',auth[_0xc93c('0x7')](),controller[_0xc93c('0xd')]);router['put']('/:id',auth[_0xc93c('0x7')](),controller[_0xc93c('0xe')]);router['delete']('/:id',auth[_0xc93c('0x7')](),controller[_0xc93c('0xf')]);module[_0xc93c('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index f2a781e..36018b5 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 _0x5379=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x5379,0x1a2));var _0x9537=function(_0xacb858,_0x3c3ad7){_0xacb858=_0xacb858-0x0;var _0x12fe1f=_0x5379[_0xacb858];return _0x12fe1f;};'use strict';var moment=require(_0x9537('0x0'));var Sequelize=require(_0x9537('0x1'));module[_0x9537('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9537('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x9537('0x3')],'unique':_0x9537('0x4')},'VoiceQueueId':{'type':Sequelize[_0x9537('0x3')],'unique':_0x9537('0x4')}}; \ No newline at end of file +var _0x30bc=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x4e502e,_0x2a7c94){var _0x25c957=function(_0x2f6f74){while(--_0x2f6f74){_0x4e502e['push'](_0x4e502e['shift']());}};_0x25c957(++_0x2a7c94);}(_0x30bc,0x149));var _0xc30b=function(_0xe52657,_0x374354){_0xe52657=_0xe52657-0x0;var _0x4f14ea=_0x30bc[_0xe52657];return _0x4f14ea;};'use strict';var moment=require(_0xc30b('0x0'));var Sequelize=require(_0xc30b('0x1'));module[_0xc30b('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc30b('0x3')],'unique':_0xc30b('0x4')},'ListId':{'type':Sequelize[_0xc30b('0x3')],'unique':_0xc30b('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc30b('0x3')],'unique':_0xc30b('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 1325422..12a958d 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 _0xd7c1=['params','include','options','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7c1,0xa5));var _0x1d7c=function(_0x1964de,_0x4c169e){_0x1964de=_0x1964de-0x0;var _0x5bd015=_0xd7c1[_0x1964de];return _0x5bd015;};'use strict';var emlformat=require(_0x1d7c('0x0'));var rimraf=require(_0x1d7c('0x1'));var zipdir=require(_0x1d7c('0x2'));var jsonpatch=require(_0x1d7c('0x3'));var rp=require(_0x1d7c('0x4'));var moment=require(_0x1d7c('0x5'));var BPromise=require(_0x1d7c('0x6'));var Mustache=require(_0x1d7c('0x7'));var util=require(_0x1d7c('0x8'));var path=require(_0x1d7c('0x9'));var sox=require(_0x1d7c('0xa'));var csv=require(_0x1d7c('0xb'));var ejs=require(_0x1d7c('0xc'));var fs=require('fs');var fs_extra=require(_0x1d7c('0xd'));var _=require(_0x1d7c('0xe'));var squel=require(_0x1d7c('0xf'));var crypto=require(_0x1d7c('0x10'));var jsforce=require(_0x1d7c('0x11'));var deskjs=require(_0x1d7c('0x12'));var toCsv=require(_0x1d7c('0xb'));var querystring=require(_0x1d7c('0x13'));var Papa=require(_0x1d7c('0x14'));var Redis=require('ioredis');var authService=require(_0x1d7c('0x15'));var qs=require(_0x1d7c('0x16'));var as=require(_0x1d7c('0x17'));var hardwareService=require(_0x1d7c('0x18'));var logger=require('../../config/logger')(_0x1d7c('0x19'));var utils=require(_0x1d7c('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x1d7c('0x1b'));var db=require(_0x1d7c('0x1c'))['db'];function respondWithStatusCode(_0x3f1a2d,_0x5c4be8){_0x5c4be8=_0x5c4be8||0xcc;return function(_0x27aec0){if(_0x27aec0){return _0x3f1a2d['sendStatus'](_0x5c4be8);}return _0x3f1a2d[_0x1d7c('0x1d')](_0x5c4be8)[_0x1d7c('0x1e')]();};}function respondWithResult(_0x18c997,_0x45883e){_0x45883e=_0x45883e||0xc8;return function(_0x4ccd30){if(_0x4ccd30){return _0x18c997[_0x1d7c('0x1d')](_0x45883e)['json'](_0x4ccd30);}};}function respondWithFilteredResult(_0xdcbacb,_0x49dbb4){return function(_0x41112d){if(_0x41112d){var _0x591d79=typeof _0x49dbb4[_0x1d7c('0x1f')]===_0x1d7c('0x20')&&typeof _0x49dbb4[_0x1d7c('0x21')]===_0x1d7c('0x20');var _0xc0fd09=_0x41112d['count'];var _0x114e7c=_0x591d79?0x0:_0x49dbb4[_0x1d7c('0x1f')];var _0x4dece9=_0x591d79?_0x41112d[_0x1d7c('0x22')]:_0x49dbb4['offset']+_0x49dbb4['limit'];var _0x29b24c;if(_0x4dece9>=_0xc0fd09){_0x4dece9=_0xc0fd09;_0x29b24c=0xc8;}else{_0x29b24c=0xce;}_0xdcbacb[_0x1d7c('0x1d')](_0x29b24c);return _0xdcbacb[_0x1d7c('0x23')](_0x1d7c('0x24'),_0x114e7c+'-'+_0x4dece9+'/'+_0xc0fd09)[_0x1d7c('0x25')](_0x41112d);}return null;};}function patchUpdates(_0x132fe8){return function(_0x249174){try{jsonpatch[_0x1d7c('0x26')](_0x249174,_0x132fe8,!![]);}catch(_0x1dafe8){return BPromise[_0x1d7c('0x27')](_0x1dafe8);}return _0x249174[_0x1d7c('0x28')]();};}function saveUpdates(_0x54d553,_0x56e887){return function(_0x5d96c7){if(_0x5d96c7){return _0x5d96c7['update'](_0x54d553)[_0x1d7c('0x29')](function(_0x3037ed){return _0x3037ed;});}return null;};}function removeEntity(_0x33e74e,_0x57c6e7){return function(_0x32faab){if(_0x32faab){return _0x32faab['destroy']()[_0x1d7c('0x29')](function(){_0x33e74e[_0x1d7c('0x1d')](0xcc)[_0x1d7c('0x1e')]();});}};}function handleEntityNotFound(_0x520909,_0x4a16ae){return function(_0x20a576){if(!_0x20a576){_0x520909[_0x1d7c('0x2a')](0x194);}return _0x20a576;};}function handleError(_0x1026c3,_0x4337ce){_0x4337ce=_0x4337ce||0x1f4;return function(_0x13eca4){logger[_0x1d7c('0x2b')](_0x13eca4[_0x1d7c('0x2c')]);if(_0x13eca4[_0x1d7c('0x2d')]){delete _0x13eca4[_0x1d7c('0x2d')];}_0x1026c3[_0x1d7c('0x1d')](_0x4337ce)['send'](_0x13eca4);};}exports[_0x1d7c('0x2e')]=function(_0x41f226,_0x53aa5f){var _0x45e5e4={},_0x3ef33a={},_0x1bc265={'count':0x0,'rows':[]};var _0x23f4b2=_[_0x1d7c('0x2f')](db[_0x1d7c('0x30')][_0x1d7c('0x31')],function(_0x107037){return{'name':_0x107037[_0x1d7c('0x32')],'type':_0x107037[_0x1d7c('0x33')]['key']};});_0x3ef33a[_0x1d7c('0x34')]=_[_0x1d7c('0x2f')](_0x23f4b2,_0x1d7c('0x2d'));_0x3ef33a[_0x1d7c('0x35')]=_[_0x1d7c('0x36')](_0x41f226[_0x1d7c('0x35')]);_0x3ef33a[_0x1d7c('0x37')]=_['intersection'](_0x3ef33a[_0x1d7c('0x34')],_0x3ef33a[_0x1d7c('0x35')]);_0x45e5e4[_0x1d7c('0x38')]=_[_0x1d7c('0x39')](_0x3ef33a[_0x1d7c('0x34')],qs[_0x1d7c('0x3a')](_0x41f226['query'][_0x1d7c('0x3a')]));_0x45e5e4[_0x1d7c('0x38')]=_0x45e5e4[_0x1d7c('0x38')][_0x1d7c('0x3b')]?_0x45e5e4[_0x1d7c('0x38')]:_0x3ef33a[_0x1d7c('0x34')];if(!_0x41f226[_0x1d7c('0x35')][_0x1d7c('0x3c')](_0x1d7c('0x3d'))){_0x45e5e4['limit']=qs[_0x1d7c('0x21')](_0x41f226[_0x1d7c('0x35')][_0x1d7c('0x21')]);_0x45e5e4['offset']=qs[_0x1d7c('0x1f')](_0x41f226[_0x1d7c('0x35')][_0x1d7c('0x1f')]);}_0x45e5e4['order']=qs[_0x1d7c('0x3e')](_0x41f226[_0x1d7c('0x35')]['sort']);_0x45e5e4[_0x1d7c('0x3f')]=qs[_0x1d7c('0x37')](_['pick'](_0x41f226['query'],_0x3ef33a[_0x1d7c('0x37')]),_0x23f4b2);if(_0x41f226[_0x1d7c('0x35')][_0x1d7c('0x40')]){_0x45e5e4[_0x1d7c('0x3f')]=_[_0x1d7c('0x41')](_0x45e5e4['where'],{'$or':_[_0x1d7c('0x2f')](_0x23f4b2,function(_0x54afe0){if(_0x54afe0[_0x1d7c('0x33')]!==_0x1d7c('0x42')){var _0x5e2544={};_0x5e2544[_0x54afe0[_0x1d7c('0x2d')]]={'$like':'%'+_0x41f226[_0x1d7c('0x35')]['filter']+'%'};return _0x5e2544;}})});}_0x45e5e4=_['merge']({},_0x45e5e4,_0x41f226['options']);var _0x209f54={'where':_0x45e5e4['where']};return db['CmHopperBlack']['count'](_0x209f54)[_0x1d7c('0x29')](function(_0x41d306){_0x1bc265[_0x1d7c('0x22')]=_0x41d306;if(_0x41f226[_0x1d7c('0x35')][_0x1d7c('0x43')]){_0x45e5e4['include']=[{'all':!![]}];}return db[_0x1d7c('0x30')][_0x1d7c('0x44')](_0x45e5e4);})[_0x1d7c('0x29')](function(_0x5b9d94){_0x1bc265[_0x1d7c('0x45')]=_0x5b9d94;return _0x1bc265;})['then'](respondWithFilteredResult(_0x53aa5f,_0x45e5e4))[_0x1d7c('0x46')](handleError(_0x53aa5f,null));};exports[_0x1d7c('0x47')]=function(_0x41596f,_0x35f771){var _0x370372={'raw':!![],'where':{'id':_0x41596f[_0x1d7c('0x48')]['id']}},_0x3808f5={};_0x3808f5[_0x1d7c('0x34')]=_[_0x1d7c('0x36')](db[_0x1d7c('0x30')][_0x1d7c('0x31')]);_0x3808f5[_0x1d7c('0x35')]=_[_0x1d7c('0x36')](_0x41596f[_0x1d7c('0x35')]);_0x3808f5['filters']=_[_0x1d7c('0x39')](_0x3808f5[_0x1d7c('0x34')],_0x3808f5[_0x1d7c('0x35')]);_0x370372['attributes']=_[_0x1d7c('0x39')](_0x3808f5[_0x1d7c('0x34')],qs[_0x1d7c('0x3a')](_0x41596f['query'][_0x1d7c('0x3a')]));_0x370372['attributes']=_0x370372['attributes'][_0x1d7c('0x3b')]?_0x370372[_0x1d7c('0x38')]:_0x3808f5[_0x1d7c('0x34')];if(_0x41596f[_0x1d7c('0x35')]['includeAll']){_0x370372[_0x1d7c('0x49')]=[{'all':!![]}];}_0x370372=_[_0x1d7c('0x41')]({},_0x370372,_0x41596f[_0x1d7c('0x4a')]);return db['CmHopperBlack'][_0x1d7c('0x4b')](_0x370372)[_0x1d7c('0x29')](handleEntityNotFound(_0x35f771,null))[_0x1d7c('0x29')](respondWithResult(_0x35f771,null))[_0x1d7c('0x46')](handleError(_0x35f771,null));};exports[_0x1d7c('0x4c')]=function(_0x10b6f5,_0xa75777){if(_0x10b6f5[_0x1d7c('0x4d')]['id']){delete _0x10b6f5['body']['id'];}return db[_0x1d7c('0x30')][_0x1d7c('0x4b')]({'where':{'id':_0x10b6f5[_0x1d7c('0x48')]['id']}})[_0x1d7c('0x29')](handleEntityNotFound(_0xa75777,null))[_0x1d7c('0x29')](saveUpdates(_0x10b6f5[_0x1d7c('0x4d')],null))[_0x1d7c('0x29')](respondWithResult(_0xa75777,null))['catch'](handleError(_0xa75777,null));};exports['destroy']=function(_0x1ab34a,_0x2dcc56){return db[_0x1d7c('0x30')][_0x1d7c('0x4b')]({'where':{'id':_0x1ab34a[_0x1d7c('0x48')]['id']}})[_0x1d7c('0x29')](handleEntityNotFound(_0x2dcc56,null))[_0x1d7c('0x29')](removeEntity(_0x2dcc56,null))[_0x1d7c('0x46')](handleError(_0x2dcc56,null));};exports[_0x1d7c('0x4e')]=function(_0x43959e,_0x29d760){return db[_0x1d7c('0x30')][_0x1d7c('0x4e')]()['then'](respondWithResult(_0x29d760,null))[_0x1d7c('0x46')](handleError(_0x29d760,null));}; \ No newline at end of file +var _0xf333=['stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus'];(function(_0x46ec8a,_0x13d167){var _0x29d461=function(_0x55ee91){while(--_0x55ee91){_0x46ec8a['push'](_0x46ec8a['shift']());}};_0x29d461(++_0x13d167);}(_0xf333,0x1d4));var _0x3f33=function(_0x1242d3,_0x1f0490){_0x1242d3=_0x1242d3-0x0;var _0xa2a0f=_0xf333[_0x1242d3];return _0xa2a0f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f33('0x0'));var zipdir=require(_0x3f33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f33('0x2'));var moment=require('moment');var BPromise=require(_0x3f33('0x3'));var Mustache=require(_0x3f33('0x4'));var util=require('util');var path=require(_0x3f33('0x5'));var sox=require(_0x3f33('0x6'));var csv=require(_0x3f33('0x7'));var ejs=require(_0x3f33('0x8'));var fs=require('fs');var fs_extra=require(_0x3f33('0x9'));var _=require('lodash');var squel=require(_0x3f33('0xa'));var crypto=require(_0x3f33('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3f33('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3f33('0xd'));var Papa=require(_0x3f33('0xe'));var Redis=require(_0x3f33('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f33('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f33('0x11'));var logger=require(_0x3f33('0x12'))('api');var utils=require(_0x3f33('0x13'));var config=require(_0x3f33('0x14'));var licenseUtil=require(_0x3f33('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x300f3c,_0x5984b9){_0x5984b9=_0x5984b9||0xcc;return function(_0x266f5d){if(_0x266f5d){return _0x300f3c['sendStatus'](_0x5984b9);}return _0x300f3c[_0x3f33('0x16')](_0x5984b9)[_0x3f33('0x17')]();};}function respondWithResult(_0x47c0c6,_0x3f8d5e){_0x3f8d5e=_0x3f8d5e||0xc8;return function(_0x170656){if(_0x170656){return _0x47c0c6[_0x3f33('0x16')](_0x3f8d5e)[_0x3f33('0x18')](_0x170656);}};}function respondWithFilteredResult(_0x17db94,_0x386f68){return function(_0x394180){if(_0x394180){var _0x4c43a5=typeof _0x386f68[_0x3f33('0x19')]==='undefined'&&typeof _0x386f68[_0x3f33('0x1a')]==='undefined';var _0x5d58d9=_0x394180[_0x3f33('0x1b')];var _0x31b330=_0x4c43a5?0x0:_0x386f68[_0x3f33('0x19')];var _0x149ed8=_0x4c43a5?_0x394180[_0x3f33('0x1b')]:_0x386f68[_0x3f33('0x19')]+_0x386f68[_0x3f33('0x1a')];var _0x324ba9;if(_0x149ed8>=_0x5d58d9){_0x149ed8=_0x5d58d9;_0x324ba9=0xc8;}else{_0x324ba9=0xce;}_0x17db94[_0x3f33('0x16')](_0x324ba9);return _0x17db94[_0x3f33('0x1c')](_0x3f33('0x1d'),_0x31b330+'-'+_0x149ed8+'/'+_0x5d58d9)['json'](_0x394180);}return null;};}function patchUpdates(_0x29e4ae){return function(_0x2acfa9){try{jsonpatch[_0x3f33('0x1e')](_0x2acfa9,_0x29e4ae,!![]);}catch(_0x23519d){return BPromise[_0x3f33('0x1f')](_0x23519d);}return _0x2acfa9['save']();};}function saveUpdates(_0x565b93,_0x472e23){return function(_0x4350e6){if(_0x4350e6){return _0x4350e6[_0x3f33('0x20')](_0x565b93)[_0x3f33('0x21')](function(_0x254e40){return _0x254e40;});}return null;};}function removeEntity(_0x564b0e,_0x3e9153){return function(_0x23fc67){if(_0x23fc67){return _0x23fc67[_0x3f33('0x22')]()[_0x3f33('0x21')](function(){_0x564b0e[_0x3f33('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26fb9d,_0x514b31){return function(_0x3f7209){if(!_0x3f7209){_0x26fb9d[_0x3f33('0x23')](0x194);}return _0x3f7209;};}function handleError(_0x2f9ab1,_0x248488){_0x248488=_0x248488||0x1f4;return function(_0x2c88f6){logger['error'](_0x2c88f6[_0x3f33('0x24')]);if(_0x2c88f6[_0x3f33('0x25')]){delete _0x2c88f6[_0x3f33('0x25')];}_0x2f9ab1['status'](_0x248488)[_0x3f33('0x26')](_0x2c88f6);};}exports[_0x3f33('0x27')]=function(_0xbdff29,_0x2269eb){var _0x2962d7={},_0x4330bc={},_0x2adf92={'count':0x0,'rows':[]};var _0x2ad275=_['map'](db[_0x3f33('0x28')][_0x3f33('0x29')],function(_0x1338d4){return{'name':_0x1338d4[_0x3f33('0x2a')],'type':_0x1338d4[_0x3f33('0x2b')][_0x3f33('0x2c')]};});_0x4330bc[_0x3f33('0x2d')]=_['map'](_0x2ad275,'name');_0x4330bc[_0x3f33('0x2e')]=_[_0x3f33('0x2f')](_0xbdff29[_0x3f33('0x2e')]);_0x4330bc[_0x3f33('0x30')]=_[_0x3f33('0x31')](_0x4330bc[_0x3f33('0x2d')],_0x4330bc[_0x3f33('0x2e')]);_0x2962d7[_0x3f33('0x32')]=_[_0x3f33('0x31')](_0x4330bc[_0x3f33('0x2d')],qs['fields'](_0xbdff29[_0x3f33('0x2e')][_0x3f33('0x33')]));_0x2962d7[_0x3f33('0x32')]=_0x2962d7[_0x3f33('0x32')][_0x3f33('0x34')]?_0x2962d7[_0x3f33('0x32')]:_0x4330bc[_0x3f33('0x2d')];if(!_0xbdff29['query'][_0x3f33('0x35')]('nolimit')){_0x2962d7['limit']=qs[_0x3f33('0x1a')](_0xbdff29[_0x3f33('0x2e')]['limit']);_0x2962d7[_0x3f33('0x19')]=qs['offset'](_0xbdff29[_0x3f33('0x2e')][_0x3f33('0x19')]);}_0x2962d7[_0x3f33('0x36')]=qs['sort'](_0xbdff29[_0x3f33('0x2e')][_0x3f33('0x37')]);_0x2962d7[_0x3f33('0x38')]=qs[_0x3f33('0x30')](_[_0x3f33('0x39')](_0xbdff29[_0x3f33('0x2e')],_0x4330bc[_0x3f33('0x30')]),_0x2ad275);if(_0xbdff29[_0x3f33('0x2e')][_0x3f33('0x3a')]){_0x2962d7[_0x3f33('0x38')]=_[_0x3f33('0x3b')](_0x2962d7[_0x3f33('0x38')],{'$or':_[_0x3f33('0x3c')](_0x2ad275,function(_0x4500bd){if(_0x4500bd[_0x3f33('0x2b')]!==_0x3f33('0x3d')){var _0x2f5eed={};_0x2f5eed[_0x4500bd[_0x3f33('0x25')]]={'$like':'%'+_0xbdff29['query'][_0x3f33('0x3a')]+'%'};return _0x2f5eed;}})});}_0x2962d7=_['merge']({},_0x2962d7,_0xbdff29[_0x3f33('0x3e')]);var _0x49bdef={'where':_0x2962d7[_0x3f33('0x38')]};return db[_0x3f33('0x28')]['count'](_0x49bdef)[_0x3f33('0x21')](function(_0x5aa1d4){_0x2adf92[_0x3f33('0x1b')]=_0x5aa1d4;if(_0xbdff29['query'][_0x3f33('0x3f')]){_0x2962d7[_0x3f33('0x40')]=[{'all':!![]}];}return db[_0x3f33('0x28')][_0x3f33('0x41')](_0x2962d7);})['then'](function(_0x57f702){_0x2adf92[_0x3f33('0x42')]=_0x57f702;return _0x2adf92;})[_0x3f33('0x21')](respondWithFilteredResult(_0x2269eb,_0x2962d7))[_0x3f33('0x43')](handleError(_0x2269eb,null));};exports[_0x3f33('0x44')]=function(_0x4aea88,_0x28af95){var _0xf8f04f={'raw':!![],'where':{'id':_0x4aea88[_0x3f33('0x45')]['id']}},_0x489f73={};_0x489f73['model']=_[_0x3f33('0x2f')](db[_0x3f33('0x28')][_0x3f33('0x29')]);_0x489f73[_0x3f33('0x2e')]=_[_0x3f33('0x2f')](_0x4aea88[_0x3f33('0x2e')]);_0x489f73[_0x3f33('0x30')]=_['intersection'](_0x489f73[_0x3f33('0x2d')],_0x489f73[_0x3f33('0x2e')]);_0xf8f04f[_0x3f33('0x32')]=_[_0x3f33('0x31')](_0x489f73[_0x3f33('0x2d')],qs['fields'](_0x4aea88['query'][_0x3f33('0x33')]));_0xf8f04f[_0x3f33('0x32')]=_0xf8f04f[_0x3f33('0x32')][_0x3f33('0x34')]?_0xf8f04f[_0x3f33('0x32')]:_0x489f73['model'];if(_0x4aea88[_0x3f33('0x2e')][_0x3f33('0x3f')]){_0xf8f04f[_0x3f33('0x40')]=[{'all':!![]}];}_0xf8f04f=_[_0x3f33('0x3b')]({},_0xf8f04f,_0x4aea88[_0x3f33('0x3e')]);return db[_0x3f33('0x28')]['find'](_0xf8f04f)['then'](handleEntityNotFound(_0x28af95,null))[_0x3f33('0x21')](respondWithResult(_0x28af95,null))['catch'](handleError(_0x28af95,null));};exports['update']=function(_0xd3f398,_0x3a5e25){if(_0xd3f398['body']['id']){delete _0xd3f398[_0x3f33('0x46')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0xd3f398[_0x3f33('0x45')]['id']}})[_0x3f33('0x21')](handleEntityNotFound(_0x3a5e25,null))['then'](saveUpdates(_0xd3f398[_0x3f33('0x46')],null))['then'](respondWithResult(_0x3a5e25,null))[_0x3f33('0x43')](handleError(_0x3a5e25,null));};exports[_0x3f33('0x22')]=function(_0x2669db,_0x1d4759){return db['CmHopperBlack']['find']({'where':{'id':_0x2669db[_0x3f33('0x45')]['id']}})[_0x3f33('0x21')](handleEntityNotFound(_0x1d4759,null))['then'](removeEntity(_0x1d4759,null))[_0x3f33('0x43')](handleError(_0x1d4759,null));};exports[_0x3f33('0x47')]=function(_0x2d4ae6,_0x92eb06){return db[_0x3f33('0x28')][_0x3f33('0x47')]()['then'](respondWithResult(_0x92eb06,null))[_0x3f33('0x43')](handleError(_0x92eb06,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a01fe14..a19c136 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 _0x0d26=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x0d26,0x11e));var _0x60d2=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x0d26[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x60d2('0x0'));var util=require('util');var logger=require(_0x60d2('0x1'))(_0x60d2('0x2'));var moment=require(_0x60d2('0x3'));var BPromise=require(_0x60d2('0x4'));var rp=require(_0x60d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60d2('0x6'));var config=require(_0x60d2('0x7'));var attributes=require(_0x60d2('0x8'));module[_0x60d2('0x9')]=function(_0x63336,_0x58ea4e){return _0x63336[_0x60d2('0xa')](_0x60d2('0xb'),attributes,{'tableName':_0x60d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab65=['define','CmHopperBlack','../../config/logger','api','moment','path','rimraf','./cmHopperBlack.attributes','exports'];(function(_0x59d4d1,_0x10639b){var _0x4bfc11=function(_0x28e0b2){while(--_0x28e0b2){_0x59d4d1['push'](_0x59d4d1['shift']());}};_0x4bfc11(++_0x10639b);}(_0xab65,0x89));var _0x5ab6=function(_0xbd4582,_0x22b664){_0xbd4582=_0xbd4582-0x0;var _0x5b99f5=_0xab65[_0xbd4582];return _0x5b99f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5ab6('0x0'))(_0x5ab6('0x1'));var moment=require(_0x5ab6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ab6('0x3'));var rimraf=require(_0x5ab6('0x4'));var config=require('../../config/environment');var attributes=require(_0x5ab6('0x5'));module[_0x5ab6('0x6')]=function(_0x181b35,_0x5d37bc){return _0x181b35[_0x5ab6('0x7')](_0x5ab6('0x8'),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 60bcde0..e88b5c0 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 _0x933f=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x293396,_0x4c283b){var _0x3dce96=function(_0xbdc9d){while(--_0xbdc9d){_0x293396['push'](_0x293396['shift']());}};_0x3dce96(++_0x4c283b);}(_0x933f,0x103));var _0xf933=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x933f[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xf933('0x0'));var util=require(_0xf933('0x1'));var moment=require(_0xf933('0x2'));var BPromise=require(_0xf933('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf933('0x4'));var db=require(_0xf933('0x5'))['db'];var utils=require(_0xf933('0x6'));var logger=require('../../config/logger')(_0xf933('0x7'));var config=require('../../config/environment');var jayson=require(_0xf933('0x8'));var client=jayson[_0xf933('0x9')][_0xf933('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20b425,_0x259e8e,_0x4d371e){return new BPromise(function(_0x236d80,_0x5b342c){return client[_0xf933('0xb')](_0x20b425,_0x4d371e)[_0xf933('0xc')](function(_0x31202e){logger[_0xf933('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x259e8e,_0xf933('0xe'));logger[_0xf933('0xf')](_0xf933('0x10'),_0x259e8e,'request\x20sent',JSON['stringify'](_0x31202e));if(_0x31202e[_0xf933('0x11')]){if(_0x31202e[_0xf933('0x11')][_0xf933('0x12')]===0x1f4){logger['error'](_0xf933('0x13'),_0x259e8e,_0x31202e[_0xf933('0x11')][_0xf933('0x14')]);return _0x5b342c(_0x31202e[_0xf933('0x11')][_0xf933('0x14')]);}logger[_0xf933('0x11')](_0xf933('0x13'),_0x259e8e,_0x31202e[_0xf933('0x11')][_0xf933('0x14')]);return _0x236d80(_0x31202e['error']['message']);}else{logger[_0xf933('0xd')](_0xf933('0x13'),_0x259e8e,_0xf933('0xe'));_0x236d80(_0x31202e[_0xf933('0x15')][_0xf933('0x14')]);}})[_0xf933('0x16')](function(_0x3c0974){logger[_0xf933('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x259e8e,_0x3c0974);_0x5b342c(_0x3c0974);});});}exports[_0xf933('0x17')]=function(_0x31cc62){var _0x3078f3=this;return new Promise(function(_0x3498bc,_0x3b5283){return db[_0xf933('0x18')]['findAll']({'raw':_0x31cc62[_0xf933('0x19')]?_0x31cc62[_0xf933('0x19')][_0xf933('0x1a')]===undefined?!![]:![]:!![],'where':_0x31cc62['options']?_0x31cc62[_0xf933('0x19')][_0xf933('0x1b')]||null:null,'attributes':_0x31cc62[_0xf933('0x19')]?_0x31cc62[_0xf933('0x19')][_0xf933('0x1c')]||null:null,'limit':_0x31cc62[_0xf933('0x19')]?_0x31cc62[_0xf933('0x19')][_0xf933('0x1d')]||null:null,'include':_0x31cc62[_0xf933('0x19')]?_0x31cc62[_0xf933('0x19')][_0xf933('0x1e')]?_[_0xf933('0x1f')](_0x31cc62[_0xf933('0x19')][_0xf933('0x1e')],function(_0x48233a){return{'model':db[_0x48233a['model']],'as':_0x48233a['as'],'attributes':_0x48233a[_0xf933('0x1c')],'include':_0x48233a[_0xf933('0x1e')]?_[_0xf933('0x1f')](_0x48233a[_0xf933('0x1e')],function(_0x591c0b){return{'model':db[_0x591c0b[_0xf933('0x20')]],'as':_0x591c0b['as'],'attributes':_0x591c0b[_0xf933('0x1c')],'include':_0x591c0b[_0xf933('0x1e')]?_[_0xf933('0x1f')](_0x591c0b[_0xf933('0x1e')],function(_0x59f896){return{'model':db[_0x59f896[_0xf933('0x20')]],'as':_0x59f896['as'],'attributes':_0x59f896['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57e792){logger[_0xf933('0xd')](_0xf933('0x17'),_0x31cc62);logger[_0xf933('0xf')](_0xf933('0x17'),_0x31cc62,JSON[_0xf933('0x21')](_0x57e792));_0x3498bc(_0x57e792);})[_0xf933('0x16')](function(_0x48ff84){logger[_0xf933('0x11')](_0xf933('0x17'),_0x48ff84[_0xf933('0x14')],_0x31cc62);_0x3b5283(_0x3078f3[_0xf933('0x11')](0x1f4,_0x48ff84[_0xf933('0x14')]));});});};exports[_0xf933('0x22')]=function(_0x469807){var _0x1b0fb8=this;return new Promise(function(_0x5ef0b9,_0x5875d9){return db['CmHopperBlack'][_0xf933('0x23')](_0x469807[_0xf933('0x24')],{'raw':_0x469807[_0xf933('0x19')]?_0x469807[_0xf933('0x19')][_0xf933('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469807[_0xf933('0x19')]?_0x469807[_0xf933('0x19')][_0xf933('0x1b')]||null:null,'attributes':_0x469807['options']?_0x469807[_0xf933('0x19')][_0xf933('0x1c')]||null:null,'limit':_0x469807['options']?_0x469807['options'][_0xf933('0x1d')]||null:null})['then'](function(_0x25ed15){logger[_0xf933('0xd')](_0xf933('0x22'),_0x469807);logger[_0xf933('0xf')](_0xf933('0x22'),_0x469807,JSON[_0xf933('0x21')](_0x25ed15));_0x5ef0b9(_0x25ed15);})[_0xf933('0x16')](function(_0x4f2ce5){logger[_0xf933('0x11')](_0xf933('0x22'),_0x4f2ce5['message'],_0x469807);_0x5875d9(_0x1b0fb8[_0xf933('0x11')](0x1f4,_0x4f2ce5[_0xf933('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x1ccf9b){var _0x12d1c4=this;return new Promise(function(_0x276351,_0x31fd24){return db[_0xf933('0x18')]['destroy']({'where':_0x1ccf9b[_0xf933('0x19')]?_0x1ccf9b['options'][_0xf933('0x1b')]||null:null})[_0xf933('0xc')](function(_0xac7c35){logger[_0xf933('0xd')](_0xf933('0x25'),_0x1ccf9b);logger[_0xf933('0xf')](_0xf933('0x25'),_0x1ccf9b,JSON[_0xf933('0x21')](_0xac7c35));_0x276351(_0xac7c35);})[_0xf933('0x16')](function(_0x1ba870){logger['error'](_0xf933('0x25'),_0x1ba870['message'],_0x1ccf9b);_0x31fd24(_0x12d1c4[_0xf933('0x11')](0x1f4,_0x1ba870[_0xf933('0x14')]));});});}; \ No newline at end of file +var _0x3011=['client','request','then','info','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperBlack,\x20%s,\x20%s','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4e0b01,_0x530178){var _0x5790d7=function(_0xd81a07){while(--_0xd81a07){_0x4e0b01['push'](_0x4e0b01['shift']());}};_0x5790d7(++_0x530178);}(_0x3011,0x15d));var _0x1301=function(_0x53ce52,_0x4a5fc9){_0x53ce52=_0x53ce52-0x0;var _0xfd0768=_0x3011[_0x53ce52];return _0xfd0768;};'use strict';var _=require(_0x1301('0x0'));var util=require(_0x1301('0x1'));var moment=require(_0x1301('0x2'));var BPromise=require(_0x1301('0x3'));var rs=require(_0x1301('0x4'));var fs=require('fs');var Redis=require(_0x1301('0x5'));var db=require(_0x1301('0x6'))['db'];var utils=require(_0x1301('0x7'));var logger=require(_0x1301('0x8'))(_0x1301('0x9'));var config=require('../../config/environment');var jayson=require(_0x1301('0xa'));var client=jayson[_0x1301('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2985a4,_0x124185,_0x3a1232){return new BPromise(function(_0x16cf7a,_0x501933){return client[_0x1301('0xc')](_0x2985a4,_0x3a1232)[_0x1301('0xd')](function(_0x1d9657){logger[_0x1301('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x124185,'request\x20sent');logger['debug'](_0x1301('0xf'),_0x124185,_0x1301('0x10'),JSON[_0x1301('0x11')](_0x1d9657));if(_0x1d9657[_0x1301('0x12')]){if(_0x1d9657[_0x1301('0x12')]['code']===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x124185,_0x1d9657[_0x1301('0x12')][_0x1301('0x13')]);return _0x501933(_0x1d9657[_0x1301('0x12')][_0x1301('0x13')]);}logger['error'](_0x1301('0x14'),_0x124185,_0x1d9657[_0x1301('0x12')][_0x1301('0x13')]);return _0x16cf7a(_0x1d9657[_0x1301('0x12')][_0x1301('0x13')]);}else{logger[_0x1301('0xe')](_0x1301('0x14'),_0x124185,'request\x20sent');_0x16cf7a(_0x1d9657[_0x1301('0x15')][_0x1301('0x13')]);}})[_0x1301('0x16')](function(_0x4c16c8){logger[_0x1301('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x124185,_0x4c16c8);_0x501933(_0x4c16c8);});});}exports[_0x1301('0x17')]=function(_0x1d4668){var _0x292926=this;return new Promise(function(_0x56c02d,_0x52a42d){return db[_0x1301('0x18')][_0x1301('0x19')]({'raw':_0x1d4668[_0x1301('0x1a')]?_0x1d4668[_0x1301('0x1a')][_0x1301('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d4668['options']?_0x1d4668[_0x1301('0x1a')][_0x1301('0x1c')]||null:null,'attributes':_0x1d4668[_0x1301('0x1a')]?_0x1d4668['options'][_0x1301('0x1d')]||null:null,'limit':_0x1d4668[_0x1301('0x1a')]?_0x1d4668[_0x1301('0x1a')][_0x1301('0x1e')]||null:null,'include':_0x1d4668[_0x1301('0x1a')]?_0x1d4668[_0x1301('0x1a')][_0x1301('0x1f')]?_[_0x1301('0x20')](_0x1d4668[_0x1301('0x1a')][_0x1301('0x1f')],function(_0x24679b){return{'model':db[_0x24679b[_0x1301('0x21')]],'as':_0x24679b['as'],'attributes':_0x24679b['attributes'],'include':_0x24679b['include']?_['map'](_0x24679b[_0x1301('0x1f')],function(_0xb3db12){return{'model':db[_0xb3db12[_0x1301('0x21')]],'as':_0xb3db12['as'],'attributes':_0xb3db12[_0x1301('0x1d')],'include':_0xb3db12[_0x1301('0x1f')]?_[_0x1301('0x20')](_0xb3db12[_0x1301('0x1f')],function(_0x378a0f){return{'model':db[_0x378a0f[_0x1301('0x21')]],'as':_0x378a0f['as'],'attributes':_0x378a0f[_0x1301('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1301('0xd')](function(_0x416b4f){logger[_0x1301('0xe')](_0x1301('0x17'),_0x1d4668);logger[_0x1301('0x22')](_0x1301('0x17'),_0x1d4668,JSON['stringify'](_0x416b4f));_0x56c02d(_0x416b4f);})[_0x1301('0x16')](function(_0x1f4f16){logger[_0x1301('0x12')](_0x1301('0x17'),_0x1f4f16[_0x1301('0x13')],_0x1d4668);_0x52a42d(_0x292926[_0x1301('0x12')](0x1f4,_0x1f4f16[_0x1301('0x13')]));});});};exports[_0x1301('0x23')]=function(_0x2c8f00){var _0x12f48c=this;return new Promise(function(_0x283c45,_0x291872){return db[_0x1301('0x18')][_0x1301('0x24')](_0x2c8f00[_0x1301('0x25')],{'raw':_0x2c8f00[_0x1301('0x1a')]?_0x2c8f00[_0x1301('0x1a')][_0x1301('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c8f00[_0x1301('0x1a')]?_0x2c8f00[_0x1301('0x1a')][_0x1301('0x1c')]||null:null,'attributes':_0x2c8f00[_0x1301('0x1a')]?_0x2c8f00[_0x1301('0x1a')]['attributes']||null:null,'limit':_0x2c8f00[_0x1301('0x1a')]?_0x2c8f00['options'][_0x1301('0x1e')]||null:null})['then'](function(_0x5d6363){logger[_0x1301('0xe')](_0x1301('0x23'),_0x2c8f00);logger[_0x1301('0x22')](_0x1301('0x23'),_0x2c8f00,JSON[_0x1301('0x11')](_0x5d6363));_0x283c45(_0x5d6363);})[_0x1301('0x16')](function(_0x1b122c){logger[_0x1301('0x12')](_0x1301('0x23'),_0x1b122c[_0x1301('0x13')],_0x2c8f00);_0x291872(_0x12f48c[_0x1301('0x12')](0x1f4,_0x1b122c['message']));});});};exports[_0x1301('0x26')]=function(_0x40d3f1){var _0x3b05e2=this;return new Promise(function(_0x15edc1,_0x485c85){return db[_0x1301('0x18')][_0x1301('0x27')]({'where':_0x40d3f1['options']?_0x40d3f1['options'][_0x1301('0x1c')]||null:null})[_0x1301('0xd')](function(_0x21c3d5){logger[_0x1301('0xe')](_0x1301('0x26'),_0x40d3f1);logger['debug'](_0x1301('0x26'),_0x40d3f1,JSON[_0x1301('0x11')](_0x21c3d5));_0x15edc1(_0x21c3d5);})['catch'](function(_0x538f1c){logger['error'](_0x1301('0x26'),_0x538f1c[_0x1301('0x13')],_0x40d3f1);_0x485c85(_0x3b05e2['error'](0x1f4,_0x538f1c['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 56981ba..b5e1c8a 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 _0xe2fe=['/describe','describe','/:id','put','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./cmHopperBlack.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0xc')](_0xee2f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xee2f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4fb4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0x3feb8a,_0x47c784){var _0x4523ca=function(_0x4fba86){while(--_0x4fba86){_0x3feb8a['push'](_0x3feb8a['shift']());}};_0x4523ca(++_0x47c784);}(_0x4fb4,0x190));var _0x44fb=function(_0x3200a0,_0x2258fd){_0x3200a0=_0x3200a0-0x0;var _0xb56eb0=_0x4fb4[_0x3200a0];return _0xb56eb0;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index e11ebac..56d134e 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 _0x17a4=['followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x148c8f,_0x25ad65){var _0x56b75f=function(_0x43c2fc){while(--_0x43c2fc){_0x148c8f['push'](_0x148c8f['shift']());}};_0x56b75f(++_0x25ad65);}(_0x17a4,0x101));var _0x417a=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x17a4[_0x4ca6a4];return _0x120555;};'use strict';var Sequelize=require(_0x417a('0x0'));var moment=require(_0x417a('0x1'));module[_0x417a('0x2')]={'state':{'type':Sequelize[_0x417a('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x417a('0x4')]},'scheduledat':{'type':Sequelize[_0x417a('0x5')]},'countbusyretry':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x417a('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x417a('0x4')]},'originatecalleridname':{'type':Sequelize[_0x417a('0x4')]},'calleridnum':{'type':Sequelize[_0x417a('0x4')]},'calleridname':{'type':Sequelize[_0x417a('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x417a('0x5')]},'droptime':{'type':Sequelize[_0x417a('0x5')]},'endtime':{'type':Sequelize[_0x417a('0x5')]},'ringtime':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x417a('0x4')]},'campaign':{'type':Sequelize[_0x417a('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x417a('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x417a('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x417a('0x4')]},'dispositionat':{'type':Sequelize[_0x417a('0x5')],'set':function(_0x102088){var _0x214134=this[_0x417a('0x6')]('endtime');if(_0x214134&&_0x102088){this['setDataValue'](_0x417a('0x7'),moment(_0x102088)[_0x417a('0x8')](moment(_0x214134),_0x417a('0x9')));}}},'amd':{'type':Sequelize[_0x417a('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x417a('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x417a('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x417a('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x417a('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x417a('0x5')]},'deleted':{'type':Sequelize[_0x417a('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x417a('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x417a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7a4e=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','diff','seconds','BOOLEAN'];(function(_0x1510b9,_0x2b0346){var _0x380390=function(_0x572449){while(--_0x572449){_0x1510b9['push'](_0x1510b9['shift']());}};_0x380390(++_0x2b0346);}(_0x7a4e,0xbb));var _0xe7a4=function(_0x25e7ee,_0x4d8966){_0x25e7ee=_0x25e7ee-0x0;var _0x1251f2=_0x7a4e[_0x25e7ee];return _0x1251f2;};'use strict';var Sequelize=require(_0xe7a4('0x0'));var moment=require(_0xe7a4('0x1'));module[_0xe7a4('0x2')]={'state':{'type':Sequelize[_0xe7a4('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xe7a4('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe7a4('0x4')]},'starttime':{'type':Sequelize[_0xe7a4('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xe7a4('0x5')]},'endtime':{'type':Sequelize[_0xe7a4('0x5')]},'ringtime':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe7a4('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe7a4('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xe7a4('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe7a4('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe7a4('0x4')]},'dispositionat':{'type':Sequelize[_0xe7a4('0x5')],'set':function(_0x4f80ba){var _0xd2bd6b=this[_0xe7a4('0x6')]('endtime');if(_0xd2bd6b&&_0x4f80ba){this[_0xe7a4('0x7')]('followuptime',moment(_0x4f80ba)[_0xe7a4('0x8')](moment(_0xd2bd6b),_0xe7a4('0x9')));}}},'amd':{'type':Sequelize[_0xe7a4('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe7a4('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe7a4('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe7a4('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe7a4('0x5')]},'callback':{'type':Sequelize[_0xe7a4('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe7a4('0x5')]},'deleted':{'type':Sequelize[_0xe7a4('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe7a4('0x5')]},'recallme':{'type':Sequelize[_0xe7a4('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe7a4('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe7a4('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 443e63a..635b3c4 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 _0x0295=['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','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x52ad34,_0x3d90be){var _0x2fe90a=function(_0x3a27f6){while(--_0x3a27f6){_0x52ad34['push'](_0x52ad34['shift']());}};_0x2fe90a(++_0x3d90be);}(_0x0295,0x1f0));var _0x5029=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x0295[_0x35ef6b];return _0x3ad145;};'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['CmHopperFinal'][_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['CmHopperFinal'][_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')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file +var _0xc1c6=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperFinal','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','ANY_VALUE(ContactId)','field','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x956ba,_0x2505f5){_0x956ba=_0x956ba-0x0;var _0x1432d9=_0xc1c6[_0x956ba];return _0x1432d9;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['CmHopperFinal']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['CmHopperFinal'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['describe']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')]()[_0x6c1c('0x25')](respondWithResult(_0x58d075,null))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x26cf7f,_0x52c14d){if(_0x26cf7f[_0x6c1c('0x48')][_0x6c1c('0x49')]){delete _0x26cf7f['body'][_0x6c1c('0x49')];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'uniqueid':_0x26cf7f[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x52c14d,null))[_0x6c1c('0x25')](saveUpdates(_0x26cf7f[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0x52c14d,null))['catch'](handleError(_0x52c14d,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x56b367,_0x5714a6,_0x5008b7){return db[_0x6c1c('0x2b')][_0x6c1c('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x56b367['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x53')))),'congestionContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x55')))),_0x6c1c('0x56')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize'][_0x6c1c('0x4e')](_0x6c1c('0x57')))),_0x6c1c('0x58')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),'answeringMachine']]})[_0x6c1c('0x25')](handleEntityNotFound(_0x5714a6,null))[_0x6c1c('0x25')](respondWithResult(_0x5714a6,null))[_0x6c1c('0x41')](handleError(_0x5714a6,null));};exports[_0x6c1c('0x5a')]=function(_0x14f3b5,_0x3229e6,_0xed095f){return db['CmHopperFinal'][_0x6c1c('0x3f')]({'raw':![],'where':{'CampaignId':_0x14f3b5['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x53')))),_0x6c1c('0x5b')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x5c')))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x6c1c('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),_0x6c1c('0x5d')]]})[_0x6c1c('0x25')](handleEntityNotFound(_0x3229e6,null))[_0x6c1c('0x25')](respondWithResult(_0x3229e6,null))['catch'](handleError(_0x3229e6,null));};exports[_0x6c1c('0x5e')]=function(_0x16b741,_0x204e78,_0x5a919a){return db['VoiceQueue']['find']({'where':{'id':_0x16b741[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x204e78,null))['then'](function(_0x10e499){var _0x579ca3;if(_0x10e499){_0x579ca3=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))[_0x6c1c('0x62')](['phone',_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId','VoiceQueueId',_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))['field']('NOW()','scheduledAt')['field'](_0x6c1c('0x6a'),'ContactId')[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))['field'](_0x6c1c('0x6e'),_0x6c1c('0x6f'))[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x65'))['field'](_0x6c1c('0x70'),'updatedAt')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x16b741['body'][_0x6c1c('0x76')]['toString']())['where'](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x69'))['from'](_0x6c1c('0x61'))['where'](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]()))['where'](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')]('calleridnum')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))['toString']();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x579ca3);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x204e78,null))[_0x6c1c('0x41')](handleError(_0x204e78,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1ad9e2,_0x44d8c4,_0x33a141){return db['Campaign'][_0x6c1c('0x46')]({'where':{'id':_0x1ad9e2[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x44d8c4,null))[_0x6c1c('0x25')](function(_0x50b56b){var _0x1a493a;if(_0x50b56b){_0x1a493a=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))['fromQuery']([_0x6c1c('0x69'),_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId',_0x6c1c('0x7b'),_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))[_0x6c1c('0x6b')]('NOW()',_0x6c1c('0x63'))['field'](_0x6c1c('0x6a'),_0x6c1c('0x64'))[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))[_0x6c1c('0x6b')](_0x6c1c('0x7c'),_0x6c1c('0x7b'))['field'](_0x6c1c('0x70'),'createdAt')[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x66'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2[_0x6c1c('0x43')]['id']['toString']())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x1ad9e2['body']['state'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x69'))[_0x6c1c('0x71')](_0x6c1c('0x61'))[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2['params']['id'][_0x6c1c('0x74')]()))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x7e'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')]('CampaignId\x20=\x20?',_0x1ad9e2['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))[_0x6c1c('0x74')]();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x1a493a);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x44d8c4,null))[_0x6c1c('0x41')](handleError(_0x44d8c4,null));};exports['checkContactHopper']=function(_0x3e40b6,_0x654041,_0x1a0da8){return db[_0x6c1c('0x7f')][_0x6c1c('0x80')]({'where':{'VoiceQueueId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x6f')],'CampaignId':_0x3e40b6[_0x6c1c('0x48')]['CampaignId'],'ContactId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x64')]}})[_0x6c1c('0x25')](handleEntityNotFound(_0x654041,null))[_0x6c1c('0x25')](function(_0x385629){if(_0x385629){return _0x385629;}return null;})[_0x6c1c('0x25')](respondWithResult(_0x654041,null))[_0x6c1c('0x41')](handleError(_0x654041,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d50e4d7..c9d806d 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 _0x96b9=['exports','CmHopperFinal','cm_hopper_final','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x16d724,_0x2f094b){var _0xd18803=function(_0x535e9d){while(--_0x535e9d){_0x16d724['push'](_0x16d724['shift']());}};_0xd18803(++_0x2f094b);}(_0x96b9,0x1f0));var _0x996b=function(_0x990cec,_0x43477f){_0x990cec=_0x990cec-0x0;var _0x3a1a9f=_0x96b9[_0x990cec];return _0x3a1a9f;};'use strict';var _=require(_0x996b('0x0'));var util=require(_0x996b('0x1'));var logger=require(_0x996b('0x2'))(_0x996b('0x3'));var moment=require(_0x996b('0x4'));var BPromise=require(_0x996b('0x5'));var rp=require(_0x996b('0x6'));var fs=require('fs');var path=require(_0x996b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x996b('0x8')]=function(_0x4c2890,_0x2c4f24){return _0x4c2890['define'](_0x996b('0x9'),attributes,{'tableName':_0x996b('0xa'),'paranoid':![],'indexes':[{'name':_0x996b('0xb'),'fields':[_0x996b('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x680b=['moment','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api'];(function(_0xd1ce83,_0x4199ec){var _0x51aabb=function(_0xa05538){while(--_0xa05538){_0xd1ce83['push'](_0xd1ce83['shift']());}};_0x51aabb(++_0x4199ec);}(_0x680b,0x169));var _0xb680=function(_0xff7b93,_0x261696){_0xff7b93=_0xff7b93-0x0;var _0x55906a=_0x680b[_0xff7b93];return _0x55906a;};'use strict';var _=require(_0xb680('0x0'));var util=require('util');var logger=require(_0xb680('0x1'))(_0xb680('0x2'));var moment=require(_0xb680('0x3'));var BPromise=require(_0xb680('0x4'));var rp=require(_0xb680('0x5'));var fs=require('fs');var path=require(_0xb680('0x6'));var rimraf=require('rimraf');var config=require(_0xb680('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0xb680('0x8')]=function(_0x1f6caf,_0x4fe27c){return _0x1f6caf[_0xb680('0x9')](_0xb680('0xa'),attributes,{'tableName':_0xb680('0xb'),'paranoid':![],'indexes':[{'name':_0xb680('0xc'),'fields':[_0xb680('0xc')]},{'name':'uniqueid','fields':[_0xb680('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 3ee5d76..bd4a157 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(_0x185651,_0x5200ca){var _0x138b2a=function(_0x581611){while(--_0x581611){_0x185651['push'](_0x185651['shift']());}};_0x138b2a(++_0x5200ca);}(_0x7a54,0x106));var _0x47a5=function(_0x531579,_0x5b1f0e){_0x531579=_0x531579-0x0;var _0x22c20a=_0x7a54[_0x531579];return _0x22c20a;};'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(_0x92f8b,_0x5cf8a6){var _0x5f8d0d=function(_0xe43752){while(--_0xe43752){_0x92f8b['push'](_0x92f8b['shift']());}};_0x5f8d0d(++_0x5cf8a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a9782,_0x15760c){_0x1a9782=_0x1a9782-0x0;var _0x58b4d0=_0xb10b[_0x1a9782];return _0x58b4d0;};'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 d25dedd..7e80a92 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 _0x871e=['describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','put','/:id','update','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe'];(function(_0x5dc8ea,_0x55e8f0){var _0x37de09=function(_0x4576c2){while(--_0x4576c2){_0x5dc8ea['push'](_0x5dc8ea['shift']());}};_0x37de09(++_0x55e8f0);}(_0x871e,0x185));var _0xe871=function(_0x411e5e,_0x46917a){_0x411e5e=_0x411e5e-0x0;var _0x46d930=_0x871e[_0x411e5e];return _0x46d930;};'use strict';var multer=require(_0xe871('0x0'));var util=require(_0xe871('0x1'));var path=require('path');var timeout=require(_0xe871('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe871('0x3'));var interaction=require(_0xe871('0x4'));var config=require(_0xe871('0x5'));var controller=require(_0xe871('0x6'));router[_0xe871('0x7')]('/',auth[_0xe871('0x8')](),controller[_0xe871('0x9')]);router['get'](_0xe871('0xa'),auth['isAuthenticated'](),controller[_0xe871('0xb')]);router['get']('/:id',auth[_0xe871('0x8')](),controller[_0xe871('0xc')]);router[_0xe871('0x7')](_0xe871('0xd'),auth['isAuthenticated'](),controller[_0xe871('0xe')]);router[_0xe871('0x7')](_0xe871('0xf'),auth['isAuthenticated'](),controller[_0xe871('0x10')]);router[_0xe871('0x11')](_0xe871('0x12'),auth[_0xe871('0x8')](),controller[_0xe871('0x13')]);router['post'](_0xe871('0x14'),auth[_0xe871('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xe871('0x11')](_0xe871('0x15'),auth[_0xe871('0x8')](),controller['checkContactHopper']);router[_0xe871('0x16')](_0xe871('0x17'),auth[_0xe871('0x8')](),controller[_0xe871('0x18')]);module['exports']=router; \ No newline at end of file +var _0x5432=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x4497ad,_0x4adfcc){var _0x355ad5=function(_0x40b574){while(--_0x40b574){_0x4497ad['push'](_0x4497ad['shift']());}};_0x355ad5(++_0x4adfcc);}(_0x5432,0xc8));var _0x2543=function(_0x58ea8e,_0x32d248){_0x58ea8e=_0x58ea8e-0x0;var _0x1bd062=_0x5432[_0x58ea8e];return _0x1bd062;};'use strict';var multer=require(_0x2543('0x0'));var util=require(_0x2543('0x1'));var path=require(_0x2543('0x2'));var timeout=require(_0x2543('0x3'));var express=require(_0x2543('0x4'));var router=express[_0x2543('0x5')]();var fs_extra=require(_0x2543('0x6'));var auth=require(_0x2543('0x7'));var interaction=require(_0x2543('0x8'));var config=require(_0x2543('0x9'));var controller=require(_0x2543('0xa'));router[_0x2543('0xb')]('/',auth[_0x2543('0xc')](),controller['index']);router[_0x2543('0xb')](_0x2543('0xd'),auth[_0x2543('0xc')](),controller[_0x2543('0xe')]);router[_0x2543('0xb')](_0x2543('0xf'),auth[_0x2543('0xc')](),controller[_0x2543('0x10')]);router['get'](_0x2543('0x11'),auth[_0x2543('0xc')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x2543('0xb')](_0x2543('0x12'),auth['isAuthenticated'](),controller[_0x2543('0x13')]);router[_0x2543('0x14')](_0x2543('0x15'),auth[_0x2543('0xc')](),controller[_0x2543('0x16')]);router['post'](_0x2543('0x17'),auth[_0x2543('0xc')](),controller[_0x2543('0x18')]);router['post'](_0x2543('0x19'),auth[_0x2543('0xc')](),controller[_0x2543('0x1a')]);router['put']('/:id',auth[_0x2543('0xc')](),controller[_0x2543('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c364394..3a8bb51 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 _0x9adc=['sequelize','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x58dedc,_0x493348){var _0x1810b9=function(_0x234716){while(--_0x234716){_0x58dedc['push'](_0x58dedc['shift']());}};_0x1810b9(++_0x493348);}(_0x9adc,0xaf));var _0xc9ad=function(_0x553e28,_0x471307){_0x553e28=_0x553e28-0x0;var _0x1a7029=_0x9adc[_0x553e28];return _0x1a7029;};'use strict';var Sequelize=require(_0xc9ad('0x0'));module['exports']={'state':{'type':Sequelize[_0xc9ad('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc9ad('0x2')]},'scheduledat':{'type':Sequelize[_0xc9ad('0x3')]},'countbusyretry':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc9ad('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc9ad('0x2')]},'originatecalleridname':{'type':Sequelize[_0xc9ad('0x2')]},'calleridnum':{'type':Sequelize[_0xc9ad('0x2')]},'calleridname':{'type':Sequelize[_0xc9ad('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc9ad('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc9ad('0x3')]},'ringtime':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc9ad('0x2')]},'campaign':{'type':Sequelize[_0xc9ad('0x2')]},'campaigntype':{'type':Sequelize[_0xc9ad('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xc9ad('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xc9ad('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc9ad('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc9ad('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc9ad('0x3')]},'edited':{'type':Sequelize[_0xc9ad('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc9ad('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc9ad('0x2')]}}; \ No newline at end of file +var _0x80b2=['DATE','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x150a90,_0x1846e8){var _0x47e458=function(_0x33950d){while(--_0x33950d){_0x150a90['push'](_0x150a90['shift']());}};_0x47e458(++_0x1846e8);}(_0x80b2,0x141));var _0x280b=function(_0x2fbba3,_0x30a7d9){_0x2fbba3=_0x2fbba3-0x0;var _0x26f102=_0x80b2[_0x2fbba3];return _0x26f102;};'use strict';var Sequelize=require(_0x280b('0x0'));module[_0x280b('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x280b('0x2')]},'scheduledat':{'type':Sequelize[_0x280b('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x280b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x280b('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x280b('0x2')]},'calleridname':{'type':Sequelize[_0x280b('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x280b('0x3')]},'answertime':{'type':Sequelize[_0x280b('0x3')]},'droptime':{'type':Sequelize[_0x280b('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x280b('0x2')]},'campaign':{'type':Sequelize[_0x280b('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x280b('0x2')]},'amd':{'type':Sequelize[_0x280b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x280b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x280b('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x280b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x280b('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x280b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x280b('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x280b('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 901b67d..9bed55d 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 _0x1bb3=['moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','stack','name','map','CmHopperHistory','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','find','create','body','describe','uniqueid','params','eml-format','rimraf','zip-dir','request-promise'];(function(_0x33b25d,_0x524f60){var _0x12ca8b=function(_0x49f54e){while(--_0x49f54e){_0x33b25d['push'](_0x33b25d['shift']());}};_0x12ca8b(++_0x524f60);}(_0x1bb3,0x1c4));var _0x31bb=function(_0x1227f0,_0x37ac67){_0x1227f0=_0x1227f0-0x0;var _0xa2a2ab=_0x1bb3[_0x1227f0];return _0xa2a2ab;};'use strict';var emlformat=require(_0x31bb('0x0'));var rimraf=require(_0x31bb('0x1'));var zipdir=require(_0x31bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31bb('0x3'));var moment=require(_0x31bb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31bb('0x5'));var path=require(_0x31bb('0x6'));var sox=require(_0x31bb('0x7'));var csv=require(_0x31bb('0x8'));var ejs=require(_0x31bb('0x9'));var fs=require('fs');var fs_extra=require(_0x31bb('0xa'));var _=require('lodash');var squel=require(_0x31bb('0xb'));var crypto=require(_0x31bb('0xc'));var jsforce=require(_0x31bb('0xd'));var deskjs=require(_0x31bb('0xe'));var toCsv=require(_0x31bb('0x8'));var querystring=require('querystring');var Papa=require(_0x31bb('0xf'));var Redis=require(_0x31bb('0x10'));var authService=require(_0x31bb('0x11'));var qs=require(_0x31bb('0x12'));var as=require(_0x31bb('0x13'));var hardwareService=require(_0x31bb('0x14'));var logger=require(_0x31bb('0x15'))('api');var utils=require(_0x31bb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x31bb('0x17'));var db=require(_0x31bb('0x18'))['db'];function respondWithStatusCode(_0x103b54,_0x4bd193){_0x4bd193=_0x4bd193||0xcc;return function(_0x1c4dfb){if(_0x1c4dfb){return _0x103b54[_0x31bb('0x19')](_0x4bd193);}return _0x103b54[_0x31bb('0x1a')](_0x4bd193)[_0x31bb('0x1b')]();};}function respondWithResult(_0x53b308,_0x5847d2){_0x5847d2=_0x5847d2||0xc8;return function(_0xf06c4c){if(_0xf06c4c){return _0x53b308[_0x31bb('0x1a')](_0x5847d2)[_0x31bb('0x1c')](_0xf06c4c);}};}function respondWithFilteredResult(_0x349cad,_0x2f3d25){return function(_0x27037d){if(_0x27037d){var _0x446a2f=typeof _0x2f3d25[_0x31bb('0x1d')]===_0x31bb('0x1e')&&typeof _0x2f3d25[_0x31bb('0x1f')]===_0x31bb('0x1e');var _0x5ad770=_0x27037d[_0x31bb('0x20')];var _0x15ef36=_0x446a2f?0x0:_0x2f3d25[_0x31bb('0x1d')];var _0x2350fa=_0x446a2f?_0x27037d['count']:_0x2f3d25['offset']+_0x2f3d25[_0x31bb('0x1f')];var _0x3792db;if(_0x2350fa>=_0x5ad770){_0x2350fa=_0x5ad770;_0x3792db=0xc8;}else{_0x3792db=0xce;}_0x349cad[_0x31bb('0x1a')](_0x3792db);return _0x349cad['set']('Content-Range',_0x15ef36+'-'+_0x2350fa+'/'+_0x5ad770)[_0x31bb('0x1c')](_0x27037d);}return null;};}function patchUpdates(_0xeba41b){return function(_0x3c390f){try{jsonpatch[_0x31bb('0x21')](_0x3c390f,_0xeba41b,!![]);}catch(_0x27f072){return BPromise['reject'](_0x27f072);}return _0x3c390f[_0x31bb('0x22')]();};}function saveUpdates(_0x102bd9,_0x250d05){return function(_0x40cf72){if(_0x40cf72){return _0x40cf72[_0x31bb('0x23')](_0x102bd9)[_0x31bb('0x24')](function(_0x1a0626){return _0x1a0626;});}return null;};}function removeEntity(_0xaadb54,_0x39091a){return function(_0x28a9f8){if(_0x28a9f8){return _0x28a9f8[_0x31bb('0x25')]()[_0x31bb('0x24')](function(){_0xaadb54['status'](0xcc)[_0x31bb('0x1b')]();});}};}function handleEntityNotFound(_0x117619,_0x27601b){return function(_0x29f6f3){if(!_0x29f6f3){_0x117619[_0x31bb('0x19')](0x194);}return _0x29f6f3;};}function handleError(_0x5110cf,_0x64c5c7){_0x64c5c7=_0x64c5c7||0x1f4;return function(_0x5dc1cb){logger['error'](_0x5dc1cb[_0x31bb('0x26')]);if(_0x5dc1cb[_0x31bb('0x27')]){delete _0x5dc1cb[_0x31bb('0x27')];}_0x5110cf[_0x31bb('0x1a')](_0x64c5c7)['send'](_0x5dc1cb);};}exports['index']=function(_0x39a025,_0x1d85f8){var _0x5b050d={},_0x21d73d={},_0x4e23d3={'count':0x0,'rows':[]};var _0x23a188=_[_0x31bb('0x28')](db[_0x31bb('0x29')]['rawAttributes'],function(_0xc4a13c){return{'name':_0xc4a13c[_0x31bb('0x2a')],'type':_0xc4a13c[_0x31bb('0x2b')][_0x31bb('0x2c')]};});_0x21d73d['model']=_['map'](_0x23a188,_0x31bb('0x27'));_0x21d73d[_0x31bb('0x2d')]=_['keys'](_0x39a025[_0x31bb('0x2d')]);_0x21d73d[_0x31bb('0x2e')]=_[_0x31bb('0x2f')](_0x21d73d[_0x31bb('0x30')],_0x21d73d[_0x31bb('0x2d')]);_0x5b050d['attributes']=_[_0x31bb('0x2f')](_0x21d73d[_0x31bb('0x30')],qs[_0x31bb('0x31')](_0x39a025[_0x31bb('0x2d')][_0x31bb('0x31')]));_0x5b050d[_0x31bb('0x32')]=_0x5b050d['attributes'][_0x31bb('0x33')]?_0x5b050d[_0x31bb('0x32')]:_0x21d73d[_0x31bb('0x30')];if(!_0x39a025['query'][_0x31bb('0x34')](_0x31bb('0x35'))){_0x5b050d[_0x31bb('0x1f')]=qs[_0x31bb('0x1f')](_0x39a025[_0x31bb('0x2d')][_0x31bb('0x1f')]);_0x5b050d[_0x31bb('0x1d')]=qs[_0x31bb('0x1d')](_0x39a025[_0x31bb('0x2d')]['offset']);}_0x5b050d[_0x31bb('0x36')]=qs[_0x31bb('0x37')](_0x39a025[_0x31bb('0x2d')]['sort']);_0x5b050d[_0x31bb('0x38')]=qs[_0x31bb('0x2e')](_[_0x31bb('0x39')](_0x39a025[_0x31bb('0x2d')],_0x21d73d[_0x31bb('0x2e')]),_0x23a188);if(_0x39a025[_0x31bb('0x2d')][_0x31bb('0x3a')]){_0x5b050d[_0x31bb('0x38')]=_[_0x31bb('0x3b')](_0x5b050d[_0x31bb('0x38')],{'$or':_['map'](_0x23a188,function(_0x44c3e0){if(_0x44c3e0[_0x31bb('0x2b')]!==_0x31bb('0x3c')){var _0x36e481={};_0x36e481[_0x44c3e0['name']]={'$like':'%'+_0x39a025[_0x31bb('0x2d')][_0x31bb('0x3a')]+'%'};return _0x36e481;}})});}_0x5b050d=_[_0x31bb('0x3b')]({},_0x5b050d,_0x39a025['options']);var _0x54eba8={'where':_0x5b050d[_0x31bb('0x38')]};return db[_0x31bb('0x29')]['count'](_0x54eba8)[_0x31bb('0x24')](function(_0x21af81){_0x4e23d3[_0x31bb('0x20')]=_0x21af81;if(_0x39a025[_0x31bb('0x2d')][_0x31bb('0x3d')]){_0x5b050d[_0x31bb('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x31bb('0x3f')](_0x5b050d);})[_0x31bb('0x24')](function(_0x358a99){_0x4e23d3[_0x31bb('0x40')]=_0x358a99;return _0x4e23d3;})[_0x31bb('0x24')](respondWithFilteredResult(_0x1d85f8,_0x5b050d))[_0x31bb('0x41')](handleError(_0x1d85f8,null));};exports[_0x31bb('0x42')]=function(_0x16517d,_0x14f4bc){var _0x12a8d5={'raw':!![],'where':{'id':_0x16517d['params']['id']}},_0xfba905={};_0xfba905[_0x31bb('0x30')]=_[_0x31bb('0x43')](db[_0x31bb('0x29')][_0x31bb('0x44')]);_0xfba905['query']=_[_0x31bb('0x43')](_0x16517d['query']);_0xfba905['filters']=_[_0x31bb('0x2f')](_0xfba905['model'],_0xfba905[_0x31bb('0x2d')]);_0x12a8d5[_0x31bb('0x32')]=_[_0x31bb('0x2f')](_0xfba905[_0x31bb('0x30')],qs['fields'](_0x16517d['query'][_0x31bb('0x31')]));_0x12a8d5[_0x31bb('0x32')]=_0x12a8d5['attributes'][_0x31bb('0x33')]?_0x12a8d5[_0x31bb('0x32')]:_0xfba905[_0x31bb('0x30')];if(_0x16517d[_0x31bb('0x2d')][_0x31bb('0x3d')]){_0x12a8d5[_0x31bb('0x3e')]=[{'all':!![]}];}_0x12a8d5=_[_0x31bb('0x3b')]({},_0x12a8d5,_0x16517d[_0x31bb('0x45')]);return db[_0x31bb('0x29')][_0x31bb('0x46')](_0x12a8d5)['then'](handleEntityNotFound(_0x14f4bc,null))[_0x31bb('0x24')](respondWithResult(_0x14f4bc,null))[_0x31bb('0x41')](handleError(_0x14f4bc,null));};exports[_0x31bb('0x47')]=function(_0x57111b,_0x82992){return db[_0x31bb('0x29')]['create'](_0x57111b[_0x31bb('0x48')],{})[_0x31bb('0x24')](respondWithResult(_0x82992,0xc9))['catch'](handleError(_0x82992,null));};exports[_0x31bb('0x49')]=function(_0x351a61,_0x13ec9f){return db[_0x31bb('0x29')][_0x31bb('0x49')]()['then'](respondWithResult(_0x13ec9f,null))[_0x31bb('0x41')](handleError(_0x13ec9f,null));};exports['update']=function(_0x418b59,_0x539858){if(_0x418b59[_0x31bb('0x48')][_0x31bb('0x4a')]){delete _0x418b59[_0x31bb('0x48')][_0x31bb('0x4a')];}return db[_0x31bb('0x29')][_0x31bb('0x46')]({'where':{'uniqueid':_0x418b59[_0x31bb('0x4b')]['id']}})[_0x31bb('0x24')](handleEntityNotFound(_0x539858,null))[_0x31bb('0x24')](saveUpdates(_0x418b59[_0x31bb('0x48')],null))[_0x31bb('0x24')](respondWithResult(_0x539858,null))[_0x31bb('0x41')](handleError(_0x539858,null));}; \ No newline at end of file +var _0x56b9=['sendStatus','end','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','CmHopperHistory','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','find','create','body','describe','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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/environment','../../config/license/util','../../mysqldb'];(function(_0x4e3939,_0x51d584){var _0x258e04=function(_0x4ec56b){while(--_0x4ec56b){_0x4e3939['push'](_0x4e3939['shift']());}};_0x258e04(++_0x51d584);}(_0x56b9,0x1a7));var _0x956b=function(_0x7c4840,_0x43dc5c){_0x7c4840=_0x7c4840-0x0;var _0x1a19a5=_0x56b9[_0x7c4840];return _0x1a19a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x956b('0x0'));var zipdir=require(_0x956b('0x1'));var jsonpatch=require(_0x956b('0x2'));var rp=require(_0x956b('0x3'));var moment=require(_0x956b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x956b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x956b('0x6'));var csv=require('to-csv');var ejs=require(_0x956b('0x7'));var fs=require('fs');var fs_extra=require(_0x956b('0x8'));var _=require(_0x956b('0x9'));var squel=require('squel');var crypto=require(_0x956b('0xa'));var jsforce=require(_0x956b('0xb'));var deskjs=require(_0x956b('0xc'));var toCsv=require(_0x956b('0xd'));var querystring=require(_0x956b('0xe'));var Papa=require(_0x956b('0xf'));var Redis=require(_0x956b('0x10'));var authService=require(_0x956b('0x11'));var qs=require(_0x956b('0x12'));var as=require(_0x956b('0x13'));var hardwareService=require(_0x956b('0x14'));var logger=require(_0x956b('0x15'))(_0x956b('0x16'));var utils=require(_0x956b('0x17'));var config=require(_0x956b('0x18'));var licenseUtil=require(_0x956b('0x19'));var db=require(_0x956b('0x1a'))['db'];function respondWithStatusCode(_0x260181,_0x8ac6c3){_0x8ac6c3=_0x8ac6c3||0xcc;return function(_0x2b7fe7){if(_0x2b7fe7){return _0x260181[_0x956b('0x1b')](_0x8ac6c3);}return _0x260181['status'](_0x8ac6c3)[_0x956b('0x1c')]();};}function respondWithResult(_0x1f9d11,_0x319eac){_0x319eac=_0x319eac||0xc8;return function(_0x10c924){if(_0x10c924){return _0x1f9d11[_0x956b('0x1d')](_0x319eac)[_0x956b('0x1e')](_0x10c924);}};}function respondWithFilteredResult(_0x4195a4,_0x1da7ff){return function(_0xca7017){if(_0xca7017){var _0x16b573=typeof _0x1da7ff['offset']==='undefined'&&typeof _0x1da7ff[_0x956b('0x1f')]==='undefined';var _0x792f4=_0xca7017[_0x956b('0x20')];var _0x1cb11a=_0x16b573?0x0:_0x1da7ff[_0x956b('0x21')];var _0x1ca6ff=_0x16b573?_0xca7017[_0x956b('0x20')]:_0x1da7ff['offset']+_0x1da7ff[_0x956b('0x1f')];var _0x518de5;if(_0x1ca6ff>=_0x792f4){_0x1ca6ff=_0x792f4;_0x518de5=0xc8;}else{_0x518de5=0xce;}_0x4195a4[_0x956b('0x1d')](_0x518de5);return _0x4195a4[_0x956b('0x22')]('Content-Range',_0x1cb11a+'-'+_0x1ca6ff+'/'+_0x792f4)['json'](_0xca7017);}return null;};}function patchUpdates(_0x5e71d9){return function(_0x432836){try{jsonpatch[_0x956b('0x23')](_0x432836,_0x5e71d9,!![]);}catch(_0x20aca1){return BPromise[_0x956b('0x24')](_0x20aca1);}return _0x432836[_0x956b('0x25')]();};}function saveUpdates(_0x2132a2,_0x27e9fd){return function(_0x22f882){if(_0x22f882){return _0x22f882[_0x956b('0x26')](_0x2132a2)[_0x956b('0x27')](function(_0x4529bd){return _0x4529bd;});}return null;};}function removeEntity(_0x52aff8,_0x3c28cb){return function(_0x248ceb){if(_0x248ceb){return _0x248ceb[_0x956b('0x28')]()[_0x956b('0x27')](function(){_0x52aff8[_0x956b('0x1d')](0xcc)[_0x956b('0x1c')]();});}};}function handleEntityNotFound(_0x286509,_0x1de283){return function(_0x221a89){if(!_0x221a89){_0x286509[_0x956b('0x1b')](0x194);}return _0x221a89;};}function handleError(_0x500b5e,_0xfd9d15){_0xfd9d15=_0xfd9d15||0x1f4;return function(_0x14f038){logger[_0x956b('0x29')](_0x14f038[_0x956b('0x2a')]);if(_0x14f038[_0x956b('0x2b')]){delete _0x14f038['name'];}_0x500b5e[_0x956b('0x1d')](_0xfd9d15)[_0x956b('0x2c')](_0x14f038);};}exports['index']=function(_0x9f938b,_0x12f1d5){var _0x2c256b={},_0x40a7a2={},_0x552407={'count':0x0,'rows':[]};var _0x12507b=_['map'](db[_0x956b('0x2d')][_0x956b('0x2e')],function(_0x3ddeb0){return{'name':_0x3ddeb0[_0x956b('0x2f')],'type':_0x3ddeb0[_0x956b('0x30')]['key']};});_0x40a7a2[_0x956b('0x31')]=_[_0x956b('0x32')](_0x12507b,_0x956b('0x2b'));_0x40a7a2[_0x956b('0x33')]=_[_0x956b('0x34')](_0x9f938b['query']);_0x40a7a2[_0x956b('0x35')]=_[_0x956b('0x36')](_0x40a7a2[_0x956b('0x31')],_0x40a7a2[_0x956b('0x33')]);_0x2c256b['attributes']=_[_0x956b('0x36')](_0x40a7a2[_0x956b('0x31')],qs[_0x956b('0x37')](_0x9f938b[_0x956b('0x33')][_0x956b('0x37')]));_0x2c256b[_0x956b('0x38')]=_0x2c256b['attributes']['length']?_0x2c256b['attributes']:_0x40a7a2[_0x956b('0x31')];if(!_0x9f938b[_0x956b('0x33')][_0x956b('0x39')]('nolimit')){_0x2c256b[_0x956b('0x1f')]=qs[_0x956b('0x1f')](_0x9f938b[_0x956b('0x33')][_0x956b('0x1f')]);_0x2c256b[_0x956b('0x21')]=qs[_0x956b('0x21')](_0x9f938b[_0x956b('0x33')]['offset']);}_0x2c256b['order']=qs[_0x956b('0x3a')](_0x9f938b[_0x956b('0x33')]['sort']);_0x2c256b['where']=qs[_0x956b('0x35')](_[_0x956b('0x3b')](_0x9f938b[_0x956b('0x33')],_0x40a7a2[_0x956b('0x35')]),_0x12507b);if(_0x9f938b[_0x956b('0x33')][_0x956b('0x3c')]){_0x2c256b['where']=_['merge'](_0x2c256b[_0x956b('0x3d')],{'$or':_[_0x956b('0x32')](_0x12507b,function(_0x8101cc){if(_0x8101cc[_0x956b('0x30')]!==_0x956b('0x3e')){var _0x36dca9={};_0x36dca9[_0x8101cc[_0x956b('0x2b')]]={'$like':'%'+_0x9f938b[_0x956b('0x33')][_0x956b('0x3c')]+'%'};return _0x36dca9;}})});}_0x2c256b=_[_0x956b('0x3f')]({},_0x2c256b,_0x9f938b[_0x956b('0x40')]);var _0x48ae44={'where':_0x2c256b[_0x956b('0x3d')]};return db[_0x956b('0x2d')][_0x956b('0x20')](_0x48ae44)[_0x956b('0x27')](function(_0x54c69c){_0x552407[_0x956b('0x20')]=_0x54c69c;if(_0x9f938b[_0x956b('0x33')][_0x956b('0x41')]){_0x2c256b[_0x956b('0x42')]=[{'all':!![]}];}return db[_0x956b('0x2d')]['findAll'](_0x2c256b);})['then'](function(_0x2cf386){_0x552407[_0x956b('0x43')]=_0x2cf386;return _0x552407;})[_0x956b('0x27')](respondWithFilteredResult(_0x12f1d5,_0x2c256b))[_0x956b('0x44')](handleError(_0x12f1d5,null));};exports[_0x956b('0x45')]=function(_0x2cf79a,_0x1fd8e8){var _0x562b96={'raw':!![],'where':{'id':_0x2cf79a['params']['id']}},_0x4a0d9f={};_0x4a0d9f[_0x956b('0x31')]=_[_0x956b('0x34')](db[_0x956b('0x2d')][_0x956b('0x2e')]);_0x4a0d9f[_0x956b('0x33')]=_['keys'](_0x2cf79a[_0x956b('0x33')]);_0x4a0d9f[_0x956b('0x35')]=_['intersection'](_0x4a0d9f['model'],_0x4a0d9f['query']);_0x562b96[_0x956b('0x38')]=_['intersection'](_0x4a0d9f[_0x956b('0x31')],qs[_0x956b('0x37')](_0x2cf79a[_0x956b('0x33')][_0x956b('0x37')]));_0x562b96['attributes']=_0x562b96[_0x956b('0x38')]['length']?_0x562b96['attributes']:_0x4a0d9f[_0x956b('0x31')];if(_0x2cf79a['query'][_0x956b('0x41')]){_0x562b96[_0x956b('0x42')]=[{'all':!![]}];}_0x562b96=_['merge']({},_0x562b96,_0x2cf79a[_0x956b('0x40')]);return db[_0x956b('0x2d')][_0x956b('0x46')](_0x562b96)[_0x956b('0x27')](handleEntityNotFound(_0x1fd8e8,null))[_0x956b('0x27')](respondWithResult(_0x1fd8e8,null))[_0x956b('0x44')](handleError(_0x1fd8e8,null));};exports[_0x956b('0x47')]=function(_0x36935b,_0x1a9847){return db[_0x956b('0x2d')][_0x956b('0x47')](_0x36935b[_0x956b('0x48')],{})[_0x956b('0x27')](respondWithResult(_0x1a9847,0xc9))[_0x956b('0x44')](handleError(_0x1a9847,null));};exports[_0x956b('0x49')]=function(_0x5534b4,_0x521fef){return db['CmHopperHistory'][_0x956b('0x49')]()[_0x956b('0x27')](respondWithResult(_0x521fef,null))[_0x956b('0x44')](handleError(_0x521fef,null));};exports['update']=function(_0x3e8221,_0x18da67){if(_0x3e8221[_0x956b('0x48')]['uniqueid']){delete _0x3e8221['body']['uniqueid'];}return db['CmHopperHistory'][_0x956b('0x46')]({'where':{'uniqueid':_0x3e8221[_0x956b('0x4a')]['id']}})[_0x956b('0x27')](handleEntityNotFound(_0x18da67,null))[_0x956b('0x27')](saveUpdates(_0x3e8221[_0x956b('0x48')],null))[_0x956b('0x27')](respondWithResult(_0x18da67,null))[_0x956b('0x44')](handleError(_0x18da67,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index d9873d9..bb97c00 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 _0xd1f1=['rimraf','../../config/environment','exports','define','CmHopperHistory','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x98ac1f,_0x2effb0){_0x98ac1f=_0x98ac1f-0x0;var _0x1579d1=_0xd1f1[_0x98ac1f];return _0x1579d1;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var logger=require('../../config/logger')(_0x1d1f('0x2'));var moment=require(_0x1d1f('0x3'));var BPromise=require(_0x1d1f('0x4'));var rp=require(_0x1d1f('0x5'));var fs=require('fs');var path=require(_0x1d1f('0x6'));var rimraf=require(_0x1d1f('0x7'));var config=require(_0x1d1f('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0x1d1f('0x9')]=function(_0x246882,_0x68d881){return _0x246882[_0x1d1f('0xa')](_0x1d1f('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x1d1f('0xc'),'fields':[_0x1d1f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaebd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x4eca46,_0x16fda6){_0x4eca46=_0x4eca46-0x0;var _0xaffac6=_0xaebd[_0x4eca46];return _0xaffac6;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0xdaeb('0xc')]},{'name':_0xdaeb('0xd'),'fields':[_0xdaeb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index b917602..2f8e343 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 _0x6b3f=['outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null'];(function(_0x2c62d7,_0x47f918){var _0x67ac1c=function(_0x45289c){while(--_0x45289c){_0x2c62d7['push'](_0x2c62d7['shift']());}};_0x67ac1c(++_0x47f918);}(_0x6b3f,0x1b4));var _0xf6b3=function(_0xfe26e2,_0x425556){_0xfe26e2=_0xfe26e2-0x0;var _0x230688=_0x6b3f[_0xfe26e2];return _0x230688;};'use strict';var _=require('lodash');var util=require(_0xf6b3('0x0'));var moment=require(_0xf6b3('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6b3('0x2'));var fs=require('fs');var Redis=require(_0xf6b3('0x3'));var db=require(_0xf6b3('0x4'))['db'];var utils=require(_0xf6b3('0x5'));var logger=require(_0xf6b3('0x6'))('rpc');var config=require(_0xf6b3('0x7'));var jayson=require(_0xf6b3('0x8'));var client=jayson[_0xf6b3('0x9')][_0xf6b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x206b8b,_0x28fa4e,_0xc3694f){return new BPromise(function(_0x2f4d69,_0x5abb5e){return client[_0xf6b3('0xb')](_0x206b8b,_0xc3694f)[_0xf6b3('0xc')](function(_0x2ca270){logger['info'](_0xf6b3('0xd'),_0x28fa4e,_0xf6b3('0xe'));logger[_0xf6b3('0xf')](_0xf6b3('0x10'),_0x28fa4e,_0xf6b3('0xe'),JSON[_0xf6b3('0x11')](_0x2ca270));if(_0x2ca270['error']){if(_0x2ca270[_0xf6b3('0x12')][_0xf6b3('0x13')]===0x1f4){logger['error'](_0xf6b3('0xd'),_0x28fa4e,_0x2ca270['error'][_0xf6b3('0x14')]);return _0x5abb5e(_0x2ca270['error']['message']);}logger[_0xf6b3('0x12')](_0xf6b3('0xd'),_0x28fa4e,_0x2ca270[_0xf6b3('0x12')][_0xf6b3('0x14')]);return _0x2f4d69(_0x2ca270[_0xf6b3('0x12')]['message']);}else{logger[_0xf6b3('0x15')](_0xf6b3('0xd'),_0x28fa4e,_0xf6b3('0xe'));_0x2f4d69(_0x2ca270[_0xf6b3('0x16')][_0xf6b3('0x14')]);}})[_0xf6b3('0x17')](function(_0x2cfc8d){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x28fa4e,_0x2cfc8d);_0x5abb5e(_0x2cfc8d);});});}exports[_0xf6b3('0x18')]=function(_0x5710f0){var _0x2be823=this;return new Promise(function(_0x25d7d3,_0x58d622){return db['CmHopperHistory'][_0xf6b3('0x19')](_0x5710f0[_0xf6b3('0x1a')],{'raw':_0x5710f0['options']?_0x5710f0[_0xf6b3('0x1b')][_0xf6b3('0x1c')]===undefined?!![]:![]:!![]})[_0xf6b3('0xc')](function(_0x171c99){logger[_0xf6b3('0x15')](_0xf6b3('0x18'),_0x5710f0);logger['debug'](_0xf6b3('0x18'),_0x5710f0,JSON[_0xf6b3('0x11')](_0x171c99));_0x25d7d3(_0x171c99);})[_0xf6b3('0x17')](function(_0x415e53){logger[_0xf6b3('0x12')]('CreateCmHopperHistory',_0x415e53[_0xf6b3('0x14')],_0x5710f0);_0x58d622(_0x2be823[_0xf6b3('0x12')](0x1f4,_0x415e53[_0xf6b3('0x14')]));});});};exports[_0xf6b3('0x1d')]=function(_0x41db04){var _0xf432f1=this;return new Promise(function(_0x16747b,_0x3384a0){return db[_0xf6b3('0x1e')][_0xf6b3('0x1f')]({'raw':_0x41db04['options']?_0x41db04[_0xf6b3('0x1b')][_0xf6b3('0x1c')]===undefined?!![]:![]:!![],'where':_0x41db04[_0xf6b3('0x1b')]?_0x41db04[_0xf6b3('0x1b')][_0xf6b3('0x20')]||null:null,'attributes':[[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['col']('id')),_0xf6b3('0x23')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0xf6b3('0x25')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x26')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')]['literal'](_0xf6b3('0x27')))),_0xf6b3('0x28')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x29'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x2a')))),_0xf6b3('0x2b')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x29'),db[_0xf6b3('0x21')]['fn']('IF',db['sequelize'][_0xf6b3('0x24')](_0xf6b3('0x2c')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x378edd){logger['info']('AvgHandleTime',_0x41db04);logger['debug']('AvgHandleTime',_0x41db04,JSON[_0xf6b3('0x11')](_0x378edd));_0x16747b(_0x378edd);})[_0xf6b3('0x17')](function(_0x1dff76){logger[_0xf6b3('0x12')](_0xf6b3('0x1d'),_0x1dff76[_0xf6b3('0x14')],_0x41db04);_0x3384a0(_0xf432f1['error'](0x1f4,_0x1dff76['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x2d18cc){var _0x480cf3=this;return new Promise(function(_0x337715,_0x28fcd0){return db[_0xf6b3('0x1e')][_0xf6b3('0x1f')]({'raw':_0x2d18cc[_0xf6b3('0x1b')]?_0x2d18cc[_0xf6b3('0x1b')][_0xf6b3('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d18cc[_0xf6b3('0x1b')]?_0x2d18cc[_0xf6b3('0x1b')][_0xf6b3('0x20')]||null:null,'attributes':[[_0xf6b3('0x2d'),_0xf6b3('0x2e')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')]('`state`\x20=\x200,\x201,\x20null'))),_0xf6b3('0x2f')],[db['sequelize']['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db['sequelize'][_0xf6b3('0x24')](_0xf6b3('0x30')))),_0xf6b3('0x31')],[db['sequelize']['fn']('COUNT',db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0xf6b3('0x32')],[db['sequelize']['fn'](_0xf6b3('0x22'),db['sequelize']['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x33')))),_0xf6b3('0x34')],[db['sequelize']['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0xf6b3('0x35')],[db['sequelize']['fn']('COUNT',db[_0xf6b3('0x21')]['fn']('IF',db['sequelize'][_0xf6b3('0x24')](_0xf6b3('0x36')))),'outboundDropCallsDayTimeout'],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0xf6b3('0x21')]['fn']('COUNT',db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')]['literal'](_0xf6b3('0x38')))),_0xf6b3('0x39')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db['sequelize']['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x3a')))),_0xf6b3('0x3b')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0xf6b3('0x24')](_0xf6b3('0x3c')))),_0xf6b3('0x3d')],[db['sequelize']['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x3e')))),_0xf6b3('0x3f')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x40')))),_0xf6b3('0x41')],[db[_0xf6b3('0x21')]['fn']('COUNT',db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')](_0xf6b3('0x42')))),_0xf6b3('0x3f')],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xf6b3('0x43')]],'group':[_0xf6b3('0x2d')]})['then'](function(_0x40595a){logger['info']('GetVoiceQueueHopperHistory',_0x2d18cc);logger[_0xf6b3('0xf')]('GetVoiceQueueHopperHistory',_0x2d18cc,JSON['stringify'](_0x40595a));_0x337715(_0x40595a);})[_0xf6b3('0x17')](function(_0x491729){logger['error']('GetVoiceQueueHopperHistory',_0x491729[_0xf6b3('0x14')],_0x2d18cc);_0x28fcd0(_0x480cf3[_0xf6b3('0x12')](0x1f4,_0x491729['message']));});});};exports[_0xf6b3('0x44')]=function(_0xa9318d){var _0x51ec4c=this;return new Promise(function(_0x503fac,_0x25bde2){return db['CmHopperHistory']['findAll']({'raw':_0xa9318d[_0xf6b3('0x1b')]?_0xa9318d[_0xf6b3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xa9318d[_0xf6b3('0x1b')]?_0xa9318d[_0xf6b3('0x1b')][_0xf6b3('0x20')]||null:null,'attributes':[[_0xf6b3('0x2d'),_0xf6b3('0x2e')],[db['sequelize']['fn']('COUNT',db[_0xf6b3('0x21')][_0xf6b3('0x45')]('id')),'ivrTotalCallsDays'],[db[_0xf6b3('0x21')]['fn'](_0xf6b3('0x22'),db[_0xf6b3('0x21')]['fn']('IF',db[_0xf6b3('0x21')][_0xf6b3('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0xf6b3('0x46')]],'group':[_0xf6b3('0x2d')]})['then'](function(_0x222108){logger[_0xf6b3('0x15')](_0xf6b3('0x44'),_0xa9318d);logger[_0xf6b3('0xf')](_0xf6b3('0x44'),_0xa9318d,JSON[_0xf6b3('0x11')](_0x222108));_0x503fac(_0x222108);})['catch'](function(_0xa0125b){logger[_0xf6b3('0x12')](_0xf6b3('0x44'),_0xa0125b['message'],_0xa9318d);_0x25bde2(_0x51ec4c[_0xf6b3('0x12')](0x1f4,_0xa0125b[_0xf6b3('0x14')]));});});}; \ No newline at end of file +var _0x57ae=['raw','catch','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','stringify','GetVoiceQueueHopperHistory','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','campaign','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','options'];(function(_0xb9fe33,_0x47a545){var _0x15f7c2=function(_0x24f0e3){while(--_0x24f0e3){_0xb9fe33['push'](_0xb9fe33['shift']());}};_0x15f7c2(++_0x47a545);}(_0x57ae,0xb4));var _0xe57a=function(_0x3a3902,_0x51f82f){_0x3a3902=_0x3a3902-0x0;var _0x1d4ae5=_0x57ae[_0x3a3902];return _0x1d4ae5;};'use strict';var _=require('lodash');var util=require(_0xe57a('0x0'));var moment=require(_0xe57a('0x1'));var BPromise=require(_0xe57a('0x2'));var rs=require(_0xe57a('0x3'));var fs=require('fs');var Redis=require(_0xe57a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe57a('0x5'));var logger=require(_0xe57a('0x6'))(_0xe57a('0x7'));var config=require(_0xe57a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe57a('0x9')][_0xe57a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48c4b7,_0x4d1332,_0x104f83){return new BPromise(function(_0x8ced4,_0x2a89c9){return client[_0xe57a('0xb')](_0x48c4b7,_0x104f83)[_0xe57a('0xc')](function(_0x2bf3d7){logger['info'](_0xe57a('0xd'),_0x4d1332,_0xe57a('0xe'));logger[_0xe57a('0xf')](_0xe57a('0x10'),_0x4d1332,_0xe57a('0xe'),JSON['stringify'](_0x2bf3d7));if(_0x2bf3d7[_0xe57a('0x11')]){if(_0x2bf3d7[_0xe57a('0x11')][_0xe57a('0x12')]===0x1f4){logger[_0xe57a('0x11')](_0xe57a('0xd'),_0x4d1332,_0x2bf3d7['error']['message']);return _0x2a89c9(_0x2bf3d7[_0xe57a('0x11')][_0xe57a('0x13')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4d1332,_0x2bf3d7[_0xe57a('0x11')]['message']);return _0x8ced4(_0x2bf3d7[_0xe57a('0x11')][_0xe57a('0x13')]);}else{logger[_0xe57a('0x14')](_0xe57a('0xd'),_0x4d1332,_0xe57a('0xe'));_0x8ced4(_0x2bf3d7[_0xe57a('0x15')][_0xe57a('0x13')]);}})['catch'](function(_0x523107){logger[_0xe57a('0x11')](_0xe57a('0xd'),_0x4d1332,_0x523107);_0x2a89c9(_0x523107);});});}exports[_0xe57a('0x16')]=function(_0x158cff){var _0xcdbc94=this;return new Promise(function(_0x1ff544,_0x146dfd){return db[_0xe57a('0x17')][_0xe57a('0x18')](_0x158cff[_0xe57a('0x19')],{'raw':_0x158cff[_0xe57a('0x1a')]?_0x158cff['options'][_0xe57a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x15c377){logger[_0xe57a('0x14')]('CreateCmHopperHistory',_0x158cff);logger['debug']('CreateCmHopperHistory',_0x158cff,JSON['stringify'](_0x15c377));_0x1ff544(_0x15c377);})[_0xe57a('0x1c')](function(_0x1a3ddc){logger[_0xe57a('0x11')](_0xe57a('0x16'),_0x1a3ddc[_0xe57a('0x13')],_0x158cff);_0x146dfd(_0xcdbc94[_0xe57a('0x11')](0x1f4,_0x1a3ddc[_0xe57a('0x13')]));});});};exports[_0xe57a('0x1d')]=function(_0x2ff816){var _0x4cb9cb=this;return new Promise(function(_0x3dc29c,_0x4de603){return db[_0xe57a('0x17')][_0xe57a('0x1e')]({'raw':_0x2ff816[_0xe57a('0x1a')]?_0x2ff816[_0xe57a('0x1a')][_0xe57a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ff816[_0xe57a('0x1a')]?_0x2ff816[_0xe57a('0x1a')][_0xe57a('0x1f')]||null:null,'attributes':[[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['col']('id')),_0xe57a('0x22')],[db[_0xe57a('0x20')]['fn']('COUNT',db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x24')))),_0xe57a('0x25')],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),_0xe57a('0x26')],[db[_0xe57a('0x20')]['fn']('COUNT',db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x27')))),_0xe57a('0x28')],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x29'),db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')]['literal'](_0xe57a('0x2a')))),_0xe57a('0x2b')],[db['sequelize']['fn']('AVG',db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x2ef961){logger[_0xe57a('0x14')]('AvgHandleTime',_0x2ff816);logger['debug'](_0xe57a('0x1d'),_0x2ff816,JSON[_0xe57a('0x2c')](_0x2ef961));_0x3dc29c(_0x2ef961);})[_0xe57a('0x1c')](function(_0x189d01){logger[_0xe57a('0x11')](_0xe57a('0x1d'),_0x189d01[_0xe57a('0x13')],_0x2ff816);_0x4de603(_0x4cb9cb[_0xe57a('0x11')](0x1f4,_0x189d01[_0xe57a('0x13')]));});});};exports[_0xe57a('0x2d')]=function(_0x1a7676){var _0x39a8a2=this;return new Promise(function(_0x4d4214,_0x295317){return db[_0xe57a('0x17')][_0xe57a('0x1e')]({'raw':_0x1a7676[_0xe57a('0x1a')]?_0x1a7676[_0xe57a('0x1a')][_0xe57a('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a7676[_0xe57a('0x1a')]?_0x1a7676[_0xe57a('0x1a')][_0xe57a('0x1f')]||null:null,'attributes':[['campaign','name'],[db[_0xe57a('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x2e')))),_0xe57a('0x2f')],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x30')))),'outboundNoAnswerCallsDay'],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0xe57a('0x23')](_0xe57a('0x24')))),'outboundAnswerCallsDay'],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['fn']('IF',db['sequelize'][_0xe57a('0x23')](_0xe57a('0x31')))),_0xe57a('0x32')],[db[_0xe57a('0x20')]['fn']('COUNT',db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0xe57a('0x33')],[db['sequelize']['fn'](_0xe57a('0x21'),db['sequelize']['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x34')))),_0xe57a('0x35')],[db['sequelize']['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['fn']('IF',db['sequelize']['literal'](_0xe57a('0x36')))),_0xe57a('0x37')],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db['sequelize']['fn']('IF',db[_0xe57a('0x20')]['literal'](_0xe57a('0x38')))),_0xe57a('0x39')],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db['sequelize']['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x3a')))),_0xe57a('0x3b')],[db['sequelize']['fn'](_0xe57a('0x21'),db['sequelize']['fn']('IF',db[_0xe57a('0x20')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0xe57a('0x3c')],[db['sequelize']['fn'](_0xe57a('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0xe57a('0x23')](_0xe57a('0x3d')))),_0xe57a('0x3e')],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x3f')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db[_0xe57a('0x20')]['fn']('IF',db['sequelize'][_0xe57a('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xe57a('0x40')]})[_0xe57a('0xc')](function(_0x192a76){logger[_0xe57a('0x14')](_0xe57a('0x2d'),_0x1a7676);logger[_0xe57a('0xf')](_0xe57a('0x2d'),_0x1a7676,JSON['stringify'](_0x192a76));_0x4d4214(_0x192a76);})[_0xe57a('0x1c')](function(_0x2b06a8){logger[_0xe57a('0x11')](_0xe57a('0x2d'),_0x2b06a8['message'],_0x1a7676);_0x295317(_0x39a8a2[_0xe57a('0x11')](0x1f4,_0x2b06a8[_0xe57a('0x13')]));});});};exports[_0xe57a('0x41')]=function(_0x343311){var _0x530e2e=this;return new Promise(function(_0x1f19d3,_0xf174c9){return db['CmHopperHistory']['findAll']({'raw':_0x343311[_0xe57a('0x1a')]?_0x343311[_0xe57a('0x1a')][_0xe57a('0x1b')]===undefined?!![]:![]:!![],'where':_0x343311[_0xe57a('0x1a')]?_0x343311[_0xe57a('0x1a')][_0xe57a('0x1f')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0xe57a('0x21'),db['sequelize'][_0xe57a('0x42')]('id')),_0xe57a('0x43')],[db[_0xe57a('0x20')]['fn'](_0xe57a('0x21'),db['sequelize']['fn']('IF',db[_0xe57a('0x20')][_0xe57a('0x23')](_0xe57a('0x24')))),_0xe57a('0x44')]],'group':[_0xe57a('0x40')]})[_0xe57a('0xc')](function(_0x3547d8){logger['info'](_0xe57a('0x41'),_0x343311);logger['debug'](_0xe57a('0x41'),_0x343311,JSON[_0xe57a('0x2c')](_0x3547d8));_0x1f19d3(_0x3547d8);})['catch'](function(_0x4d68a5){logger[_0xe57a('0x11')]('GetCampaignHopperHistory',_0x4d68a5[_0xe57a('0x13')],_0x343311);_0xf174c9(_0x530e2e[_0xe57a('0x11')](0x1f4,_0x4d68a5[_0xe57a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f05b850..3cb32ab 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 _0x713e=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','Router'];(function(_0x5530ed,_0x2342f2){var _0x2797ef=function(_0x5529ac){while(--_0x5529ac){_0x5530ed['push'](_0x5530ed['shift']());}};_0x2797ef(++_0x2342f2);}(_0x713e,0xfb));var _0xe713=function(_0x1af91a,_0x308ab2){_0x1af91a=_0x1af91a-0x0;var _0x5c1fa6=_0x713e[_0x1af91a];return _0x5c1fa6;};'use strict';var multer=require(_0xe713('0x0'));var util=require('util');var path=require(_0xe713('0x1'));var timeout=require(_0xe713('0x2'));var express=require(_0xe713('0x3'));var router=express[_0xe713('0x4')]();var fs_extra=require(_0xe713('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe713('0x6'));var config=require(_0xe713('0x7'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0xe713('0x8')](),controller['index']);router['get']('/describe',auth[_0xe713('0x8')](),controller['describe']);router['get'](_0xe713('0x9'),auth[_0xe713('0x8')](),controller[_0xe713('0xa')]);router[_0xe713('0xb')]('/',auth[_0xe713('0x8')](),controller[_0xe713('0xc')]);router[_0xe713('0xd')](_0xe713('0x9'),auth['isAuthenticated'](),controller[_0xe713('0xe')]);module[_0xe713('0xf')]=router; \ No newline at end of file +var _0x1910=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','index','get','/:id','isAuthenticated','show','post','create','put','exports','util','path'];(function(_0x746985,_0x109c91){var _0x49a212=function(_0x1f84b9){while(--_0x1f84b9){_0x746985['push'](_0x746985['shift']());}};_0x49a212(++_0x109c91);}(_0x1910,0x1da));var _0x0191=function(_0x7e624a,_0x2ed4f4){_0x7e624a=_0x7e624a-0x0;var _0x54352f=_0x1910[_0x7e624a];return _0x54352f;};'use strict';var multer=require('multer');var util=require(_0x0191('0x0'));var path=require(_0x0191('0x1'));var timeout=require(_0x0191('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0191('0x3'));var auth=require(_0x0191('0x4'));var interaction=require(_0x0191('0x5'));var config=require(_0x0191('0x6'));var controller=require(_0x0191('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0191('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0191('0x9')](_0x0191('0xa'),auth[_0x0191('0xb')](),controller[_0x0191('0xc')]);router[_0x0191('0xd')]('/',auth[_0x0191('0xb')](),controller[_0x0191('0xe')]);router[_0x0191('0xf')](_0x0191('0xa'),auth[_0x0191('0xb')](),controller['update']);module[_0x0191('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 1200e5c..28fb2bd 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 _0x28e3=['STRING','name','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x28e3,0x106));var _0x328e=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x28e3[_0x547456];return _0xc1fd7b;};'use strict';var Sequelize=require(_0x328e('0x0'));module[_0x328e('0x1')]={'name':{'type':Sequelize[_0x328e('0x2')],'unique':_0x328e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x328e('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','name','sequelize'];(function(_0x3910ab,_0x383237){var _0x4c2c2e=function(_0x550962){while(--_0x550962){_0x3910ab['push'](_0x3910ab['shift']());}};_0x4c2c2e(++_0x383237);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ab93440..3a3b875 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 _0xa46a=['isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','hasOwnProperty','pick','raw','getContactsCsv','ContactItemType','OrderBy','CmCustomField','select','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','customField_','alias','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','format','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','CmList','findAll','rows','catch','find','create','body','user','get','role','Lists','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getDispositions','findOne','Disposition','ListId','removeDispositions','ids','addContacts','CmContact','tags','join'];(function(_0x1fbb92,_0x3a1efb){var _0x2ea46b=function(_0xded481){while(--_0xded481){_0x1fbb92['push'](_0x1fbb92['shift']());}};_0x2ea46b(++_0x3a1efb);}(_0xa46a,0xe9));var _0xaa46=function(_0x317b2e,_0x165181){_0x317b2e=_0x317b2e-0x0;var _0x1a30d6=_0xa46a[_0x317b2e];return _0x1a30d6;};'use strict';var emlformat=require(_0xaa46('0x0'));var rimraf=require(_0xaa46('0x1'));var zipdir=require(_0xaa46('0x2'));var jsonpatch=require(_0xaa46('0x3'));var rp=require(_0xaa46('0x4'));var moment=require('moment');var BPromise=require(_0xaa46('0x5'));var Mustache=require(_0xaa46('0x6'));var util=require('util');var path=require(_0xaa46('0x7'));var sox=require(_0xaa46('0x8'));var csv=require(_0xaa46('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa46('0xa'));var _=require(_0xaa46('0xb'));var squel=require(_0xaa46('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa46('0xd'));var toCsv=require(_0xaa46('0x9'));var querystring=require(_0xaa46('0xe'));var Papa=require(_0xaa46('0xf'));var Redis=require(_0xaa46('0x10'));var authService=require(_0xaa46('0x11'));var qs=require(_0xaa46('0x12'));var as=require(_0xaa46('0x13'));var hardwareService=require(_0xaa46('0x14'));var logger=require('../../config/logger')(_0xaa46('0x15'));var utils=require('../../config/utils');var config=require(_0xaa46('0x16'));var licenseUtil=require(_0xaa46('0x17'));var db=require(_0xaa46('0x18'))['db'];var csv_results;config[_0xaa46('0x19')]=_[_0xaa46('0x1a')](config[_0xaa46('0x19')],{'host':_0xaa46('0x1b'),'port':0x18eb});var socket=require(_0xaa46('0x1c'))(new Redis(config[_0xaa46('0x19')]));require('./cmList.socket')[_0xaa46('0x1d')](socket);function respondWithStatusCode(_0x1f3191,_0x46d435){_0x46d435=_0x46d435||0xcc;return function(_0x15444e){if(_0x15444e){return _0x1f3191[_0xaa46('0x1e')](_0x46d435);}return _0x1f3191[_0xaa46('0x1f')](_0x46d435)['end']();};}function respondWithResult(_0x24f947,_0x54f689){_0x54f689=_0x54f689||0xc8;return function(_0x410bca){if(_0x410bca){return _0x24f947['status'](_0x54f689)[_0xaa46('0x20')](_0x410bca);}};}function respondWithFilteredResult(_0xfbb333,_0x405b53){return function(_0x469c90){if(_0x469c90){var _0x48a4b8=typeof _0x405b53[_0xaa46('0x21')]==='undefined'&&typeof _0x405b53[_0xaa46('0x22')]===_0xaa46('0x23');var _0x5f7602=_0x469c90[_0xaa46('0x24')];var _0x3149eb=_0x48a4b8?0x0:_0x405b53['offset'];var _0x3770ef=_0x48a4b8?_0x469c90[_0xaa46('0x24')]:_0x405b53['offset']+_0x405b53[_0xaa46('0x22')];var _0x584a35;if(_0x3770ef>=_0x5f7602){_0x3770ef=_0x5f7602;_0x584a35=0xc8;}else{_0x584a35=0xce;}_0xfbb333[_0xaa46('0x1f')](_0x584a35);return _0xfbb333[_0xaa46('0x25')](_0xaa46('0x26'),_0x3149eb+'-'+_0x3770ef+'/'+_0x5f7602)[_0xaa46('0x20')](_0x469c90);}return null;};}function patchUpdates(_0x39db64){return function(_0x2e3626){try{jsonpatch[_0xaa46('0x27')](_0x2e3626,_0x39db64,!![]);}catch(_0x2565f8){return BPromise['reject'](_0x2565f8);}return _0x2e3626[_0xaa46('0x28')]();};}function saveUpdates(_0x1b3b5b,_0x1963fa){return function(_0x392636){if(_0x392636){return _0x392636[_0xaa46('0x29')](_0x1b3b5b)[_0xaa46('0x2a')](function(_0x45437e){return _0x45437e;});}return null;};}function removeEntity(_0x561082,_0x1c0cf5){return function(_0x2f1479){if(_0x2f1479){return _0x2f1479[_0xaa46('0x2b')]()[_0xaa46('0x2a')](function(){var _0x1b4be0=_0x2f1479['get']({'plain':!![]});var _0x5440e6='Lists';return db[_0xaa46('0x2c')][_0xaa46('0x2b')]({'where':{'type':_0x5440e6,'resourceId':_0x1b4be0['id']}})[_0xaa46('0x2a')](function(){return _0x2f1479;});})['then'](function(){_0x561082[_0xaa46('0x1f')](0xcc)[_0xaa46('0x2d')]();});}};}function handleEntityNotFound(_0x3feb44,_0x369dbb){return function(_0x2d9d06){if(!_0x2d9d06){_0x3feb44[_0xaa46('0x1e')](0x194);}return _0x2d9d06;};}function handleError(_0x669dee,_0x37fb19){_0x37fb19=_0x37fb19||0x1f4;return function(_0x33aef3){logger[_0xaa46('0x2e')](_0x33aef3[_0xaa46('0x2f')]);if(_0x33aef3[_0xaa46('0x30')]){delete _0x33aef3[_0xaa46('0x30')];}_0x669dee[_0xaa46('0x1f')](_0x37fb19)[_0xaa46('0x31')](_0x33aef3);};}exports[_0xaa46('0x32')]=function(_0x195944,_0x1a1c44){var _0x63d98f={},_0x3717ee={},_0x55a700={'count':0x0,'rows':[]};var _0x12354b=_[_0xaa46('0x33')](db['CmList'][_0xaa46('0x34')],function(_0x430c26){return{'name':_0x430c26[_0xaa46('0x35')],'type':_0x430c26[_0xaa46('0x36')]['key']};});_0x3717ee[_0xaa46('0x37')]=_[_0xaa46('0x33')](_0x12354b,_0xaa46('0x30'));_0x3717ee['query']=_[_0xaa46('0x38')](_0x195944[_0xaa46('0x39')]);_0x3717ee[_0xaa46('0x3a')]=_[_0xaa46('0x3b')](_0x3717ee[_0xaa46('0x37')],_0x3717ee['query']);_0x63d98f['attributes']=_[_0xaa46('0x3b')](_0x3717ee['model'],qs[_0xaa46('0x3c')](_0x195944[_0xaa46('0x39')][_0xaa46('0x3c')]));_0x63d98f[_0xaa46('0x3d')]=_0x63d98f[_0xaa46('0x3d')][_0xaa46('0x3e')]?_0x63d98f[_0xaa46('0x3d')]:_0x3717ee[_0xaa46('0x37')];if(!_0x195944[_0xaa46('0x39')]['hasOwnProperty'](_0xaa46('0x3f'))){_0x63d98f[_0xaa46('0x22')]=qs['limit'](_0x195944[_0xaa46('0x39')]['limit']);_0x63d98f[_0xaa46('0x21')]=qs['offset'](_0x195944[_0xaa46('0x39')][_0xaa46('0x21')]);}_0x63d98f[_0xaa46('0x40')]=qs[_0xaa46('0x41')](_0x195944[_0xaa46('0x39')][_0xaa46('0x41')]);_0x63d98f[_0xaa46('0x42')]=qs[_0xaa46('0x3a')](_['pick'](_0x195944[_0xaa46('0x39')],_0x3717ee[_0xaa46('0x3a')]),_0x12354b);if(_0x195944[_0xaa46('0x39')][_0xaa46('0x43')]){_0x63d98f[_0xaa46('0x42')]=_['merge'](_0x63d98f[_0xaa46('0x42')],{'$or':_[_0xaa46('0x33')](_0x12354b,function(_0x1ff6c7){if(_0x1ff6c7[_0xaa46('0x36')]!==_0xaa46('0x44')){var _0x2630f1={};_0x2630f1[_0x1ff6c7[_0xaa46('0x30')]]={'$like':'%'+_0x195944[_0xaa46('0x39')][_0xaa46('0x43')]+'%'};return _0x2630f1;}})});}_0x63d98f=_[_0xaa46('0x45')]({},_0x63d98f,_0x195944[_0xaa46('0x46')]);var _0x10e3f2={'where':_0x63d98f[_0xaa46('0x42')]};return db['CmList'][_0xaa46('0x24')](_0x10e3f2)[_0xaa46('0x2a')](function(_0x34d15b){_0x55a700['count']=_0x34d15b;if(_0x195944[_0xaa46('0x39')][_0xaa46('0x47')]){_0x63d98f[_0xaa46('0x48')]=[{'all':!![]}];}return db[_0xaa46('0x49')][_0xaa46('0x4a')](_0x63d98f);})[_0xaa46('0x2a')](function(_0xf01513){_0x55a700[_0xaa46('0x4b')]=_0xf01513;return _0x55a700;})[_0xaa46('0x2a')](respondWithFilteredResult(_0x1a1c44,_0x63d98f))[_0xaa46('0x4c')](handleError(_0x1a1c44,null));};exports['show']=function(_0x1a27b8,_0x1cb253){var _0x2e8c76={'raw':![],'where':{'id':_0x1a27b8['params']['id']}},_0x25ee9e={};_0x25ee9e['model']=_[_0xaa46('0x38')](db[_0xaa46('0x49')][_0xaa46('0x34')]);_0x25ee9e[_0xaa46('0x39')]=_[_0xaa46('0x38')](_0x1a27b8['query']);_0x25ee9e[_0xaa46('0x3a')]=_[_0xaa46('0x3b')](_0x25ee9e[_0xaa46('0x37')],_0x25ee9e['query']);_0x2e8c76[_0xaa46('0x3d')]=_[_0xaa46('0x3b')](_0x25ee9e[_0xaa46('0x37')],qs[_0xaa46('0x3c')](_0x1a27b8[_0xaa46('0x39')][_0xaa46('0x3c')]));_0x2e8c76[_0xaa46('0x3d')]=_0x2e8c76['attributes'][_0xaa46('0x3e')]?_0x2e8c76[_0xaa46('0x3d')]:_0x25ee9e[_0xaa46('0x37')];if(_0x1a27b8[_0xaa46('0x39')][_0xaa46('0x47')]){_0x2e8c76[_0xaa46('0x48')]=[{'all':!![]}];}_0x2e8c76=_['merge']({},_0x2e8c76,_0x1a27b8[_0xaa46('0x46')]);return db[_0xaa46('0x49')][_0xaa46('0x4d')](_0x2e8c76)['then'](handleEntityNotFound(_0x1cb253,null))[_0xaa46('0x2a')](respondWithResult(_0x1cb253,null))[_0xaa46('0x4c')](handleError(_0x1cb253,null));};exports[_0xaa46('0x4e')]=function(_0x5c69c7,_0x1eb690){return db[_0xaa46('0x49')][_0xaa46('0x4e')](_0x5c69c7[_0xaa46('0x4f')],{})[_0xaa46('0x2a')](function(_0x1affe6){var _0x385abf=_0x5c69c7[_0xaa46('0x50')][_0xaa46('0x51')]({'plain':!![]});if(!_0x385abf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x385abf[_0xaa46('0x52')]===_0xaa46('0x50')){var _0x31d080=_0x1affe6[_0xaa46('0x51')]({'plain':!![]});var _0x2977f0=_0xaa46('0x53');return db[_0xaa46('0x54')][_0xaa46('0x4d')]({'where':{'name':_0x2977f0,'userProfileId':_0x385abf[_0xaa46('0x55')]},'raw':!![]})[_0xaa46('0x2a')](function(_0x3fe22c){if(_0x3fe22c&&_0x3fe22c['autoAssociation']===0x0){return db[_0xaa46('0x2c')][_0xaa46('0x4e')]({'name':_0x31d080['name'],'resourceId':_0x31d080['id'],'type':_0x3fe22c[_0xaa46('0x30')],'sectionId':_0x3fe22c['id']},{})[_0xaa46('0x2a')](function(){return _0x1affe6;});}else{return _0x1affe6;}})[_0xaa46('0x4c')](function(_0x28c85c){logger['error'](_0xaa46('0x56'),_0x28c85c);throw _0x28c85c;});}return _0x1affe6;})[_0xaa46('0x2a')](respondWithResult(_0x1eb690,0xc9))[_0xaa46('0x4c')](handleError(_0x1eb690,null));};exports[_0xaa46('0x29')]=function(_0x5ac887,_0x4870df){if(_0x5ac887[_0xaa46('0x4f')]['id']){delete _0x5ac887[_0xaa46('0x4f')]['id'];}return db['CmList'][_0xaa46('0x4d')]({'where':{'id':_0x5ac887[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x4870df,null))['then'](saveUpdates(_0x5ac887[_0xaa46('0x4f')],null))['then'](respondWithResult(_0x4870df,null))['catch'](handleError(_0x4870df,null));};exports['destroy']=function(_0x2d1b12,_0x607c91){return db[_0xaa46('0x49')][_0xaa46('0x4d')]({'where':{'id':_0x2d1b12[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x607c91,null))[_0xaa46('0x2a')](removeEntity(_0x607c91,null))[_0xaa46('0x4c')](handleError(_0x607c91,null));};exports['describe']=function(_0x42d4d5,_0x3ab368){return db[_0xaa46('0x49')][_0xaa46('0x58')]()[_0xaa46('0x2a')](respondWithResult(_0x3ab368,null))[_0xaa46('0x4c')](handleError(_0x3ab368,null));};exports['addDisposition']=function(_0x19cb74,_0x2a7d75,_0x540362){if(_0x19cb74[_0xaa46('0x4f')]['id']){delete _0x19cb74['body']['id'];}return db[_0xaa46('0x49')][_0xaa46('0x4d')]({'where':{'id':_0x19cb74['params']['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x2a7d75,null))['then'](function(_0x25b869){if(_0x25b869){_0x19cb74[_0xaa46('0x4f')]['ListId']=_0x25b869['id'];return db['Disposition'][_0xaa46('0x4e')](_0x19cb74[_0xaa46('0x4f')]);}})['then'](respondWithResult(_0x2a7d75,null))[_0xaa46('0x4c')](handleError(_0x2a7d75,null));};exports[_0xaa46('0x59')]=function(_0x249e56,_0x5fbfe8,_0x451d29){var _0x1bef26={'raw':![],'where':{}};var _0x11ab74={};var _0x146540={'count':0x0,'rows':[]};return db['CmList'][_0xaa46('0x5a')]({'where':{'id':_0x249e56[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x5fbfe8,null))[_0xaa46('0x2a')](function(_0x4606bf){if(_0x4606bf){_0x11ab74[_0xaa46('0x37')]=_[_0xaa46('0x38')](db[_0xaa46('0x5b')][_0xaa46('0x34')]);_0x11ab74[_0xaa46('0x39')]=_[_0xaa46('0x38')](_0x249e56['query']);_0x11ab74[_0xaa46('0x3a')]=_[_0xaa46('0x3b')](_0x11ab74[_0xaa46('0x37')],_0x11ab74[_0xaa46('0x39')]);_0x1bef26[_0xaa46('0x3d')]=_['intersection'](_0x11ab74['model'],qs[_0xaa46('0x3c')](_0x249e56[_0xaa46('0x39')]['fields']));_0x1bef26[_0xaa46('0x3d')]=_0x1bef26[_0xaa46('0x3d')][_0xaa46('0x3e')]?_0x1bef26[_0xaa46('0x3d')]:_0x11ab74[_0xaa46('0x37')];if(!_0x249e56[_0xaa46('0x39')]['hasOwnProperty'](_0xaa46('0x3f'))){_0x1bef26['limit']=qs[_0xaa46('0x22')](_0x249e56['query'][_0xaa46('0x22')]);_0x1bef26[_0xaa46('0x21')]=qs[_0xaa46('0x21')](_0x249e56[_0xaa46('0x39')]['offset']);}_0x1bef26[_0xaa46('0x40')]=qs[_0xaa46('0x41')](_0x249e56[_0xaa46('0x39')][_0xaa46('0x41')]);_0x1bef26['where']=qs['filters'](_['pick'](_0x249e56[_0xaa46('0x39')],_0x11ab74[_0xaa46('0x3a')]));_0x1bef26[_0xaa46('0x42')][_0xaa46('0x5c')]=_0x4606bf['id'];if(_0x249e56[_0xaa46('0x39')][_0xaa46('0x43')]){_0x1bef26[_0xaa46('0x42')]=_[_0xaa46('0x45')](_0x1bef26[_0xaa46('0x42')],{'$or':_['map'](_0x1bef26[_0xaa46('0x3d')],function(_0x369910){var _0x3e83f9={};_0x3e83f9[_0x369910]={'$like':'%'+_0x249e56[_0xaa46('0x39')]['filter']+'%'};return _0x3e83f9;})});}_0x1bef26=_['merge']({},_0x1bef26,_0x249e56[_0xaa46('0x46')]);return db['Disposition'][_0xaa46('0x24')]({'where':_0x1bef26[_0xaa46('0x42')]})[_0xaa46('0x2a')](function(_0x439bdb){_0x146540[_0xaa46('0x24')]=_0x439bdb;if(_0x249e56[_0xaa46('0x39')][_0xaa46('0x47')]){_0x1bef26[_0xaa46('0x48')]=[{'all':!![]}];}return db['Disposition'][_0xaa46('0x4a')](_0x1bef26);})[_0xaa46('0x2a')](function(_0x18fe03){_0x146540[_0xaa46('0x4b')]=_0x18fe03;return _0x146540;});}})[_0xaa46('0x2a')](respondWithFilteredResult(_0x5fbfe8,_0x1bef26))[_0xaa46('0x4c')](handleError(_0x5fbfe8,null));};exports[_0xaa46('0x5d')]=function(_0x169182,_0x5a47d5,_0x383507){return db[_0xaa46('0x49')][_0xaa46('0x4d')]({'where':{'id':_0x169182[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x5a47d5,null))[_0xaa46('0x2a')](function(_0x3c0ae1){if(_0x3c0ae1){return _0x3c0ae1['removeDispositions'](_0x169182[_0xaa46('0x39')][_0xaa46('0x5e')]);}})[_0xaa46('0x2a')](respondWithStatusCode(_0x5a47d5,null))[_0xaa46('0x4c')](handleError(_0x5a47d5,null));};exports[_0xaa46('0x5f')]=function(_0xb2e288,_0x39eb01,_0x5c3b30){return db['CmList'][_0xaa46('0x4d')]({'where':{'id':_0xb2e288[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x39eb01,null))['then'](function(_0x59e4ad){if(_0x59e4ad){var _0x190b6d=[];var _0x4a94bf={'success':[],'errors':[]};return db[_0xaa46('0x60')][_0xaa46('0x58')]()[_0xaa46('0x2a')](function(_0x48cadf){if(_0xb2e288['body']['tags']&&_['isArray'](_0xb2e288[_0xaa46('0x4f')][_0xaa46('0x61')])){if(_0xb2e288[_0xaa46('0x4f')][_0xaa46('0x61')][_0xaa46('0x3e')]){_0xb2e288[_0xaa46('0x4f')]['tags']=_0xb2e288['body'][_0xaa46('0x61')][_0xaa46('0x62')](';')+';';}else{_0xb2e288[_0xaa46('0x4f')][_0xaa46('0x61')]=null;}}else{_0xb2e288[_0xaa46('0x4f')][_0xaa46('0x61')]=null;}if(_0xb2e288[_0xaa46('0x4f')]&&_[_0xaa46('0x63')](_0xb2e288[_0xaa46('0x4f')])){for(var _0x10118=0x0;_0x10118<_0xb2e288[_0xaa46('0x4f')][_0xaa46('0x3e')];_0x10118+=0x1){_0xb2e288[_0xaa46('0x4f')][_0x10118][_0xaa46('0x5c')]=_0xb2e288[_0xaa46('0x57')]['id'];_0x190b6d[_0xaa46('0x64')](_0xb2e288[_0xaa46('0x4f')][_0x10118]);}return BPromise[_0xaa46('0x65')](_0x190b6d,function(_0x8c55bf){return db['CmContact'][_0xaa46('0x4e')](_[_0xaa46('0x66')](_0x8c55bf,[_0xaa46('0x5e'),'id'])||{},{'fields':_[_0xaa46('0x38')](_0x48cadf),'raw':!![]})[_0xaa46('0x2a')](function(_0x1a9966){_0x4a94bf[_0xaa46('0x67')]['push'](_0x1a9966[_0xaa46('0x68')]);})['catch'](function(_0x56558e){_0x4a94bf[_0xaa46('0x69')][_0xaa46('0x64')]({'data':_0x8c55bf,'error':_0x56558e[_0xaa46('0x6a')]});});})[_0xaa46('0x2a')](function(_0xd34b99){return _0x4a94bf;})[_0xaa46('0x4c')](function(_0x20c2b9){return _0x20c2b9;});}else{_0x39eb01[_0xaa46('0x1f')](0x190)[_0xaa46('0x20')]({'message':_0xaa46('0x6b')});}});}})[_0xaa46('0x2a')](respondWithResult(_0x39eb01,null))[_0xaa46('0x4c')](handleError(_0x39eb01,null));};exports[_0xaa46('0x6c')]=function(_0x1c88ad,_0x4feb3a,_0x33d311){var _0x3983b1;return db['CmList'][_0xaa46('0x4d')]({'where':{'id':_0x1c88ad[_0xaa46('0x57')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xaa46('0x6d')}]})[_0xaa46('0x2a')](handleEntityNotFound(_0x4feb3a,null))[_0xaa46('0x2a')](function(_0x4c0833){if(_0x4c0833){_0x3983b1=_0x4c0833;return db[_0xaa46('0x60')][_0xaa46('0x34')];}})['then'](function(_0x3ac42b){if(_0x3ac42b){var _0x11f78e={};var _0x442780={};_0x442780[_0xaa46('0x37')]=_[_0xaa46('0x6e')](_[_0xaa46('0x38')](_0x3ac42b),_[_0xaa46('0x33')](_0x3983b1[_0xaa46('0x6d')],function(_0x533bd5){return util['format']('cf_%d',_0x533bd5['id']);}));_0x442780['query']=_[_0xaa46('0x38')](_0x1c88ad[_0xaa46('0x39')]);_0x442780['filters']=_[_0xaa46('0x3b')](_0x442780[_0xaa46('0x37')],_0x442780[_0xaa46('0x39')]);_0x11f78e['attributes']=_[_0xaa46('0x3b')](_0x442780[_0xaa46('0x37')],qs[_0xaa46('0x3c')](_0x1c88ad[_0xaa46('0x39')][_0xaa46('0x3c')]));_0x11f78e[_0xaa46('0x3d')]=_0x11f78e[_0xaa46('0x3d')]['length']?_0x11f78e['attributes']:_0x442780['model'];if(!_0x1c88ad[_0xaa46('0x39')][_0xaa46('0x6f')]('nolimit')){_0x11f78e[_0xaa46('0x22')]=qs[_0xaa46('0x22')](_0x1c88ad[_0xaa46('0x39')]['limit']);_0x11f78e[_0xaa46('0x21')]=qs[_0xaa46('0x21')](_0x1c88ad[_0xaa46('0x39')][_0xaa46('0x21')]);}_0x11f78e[_0xaa46('0x40')]=qs[_0xaa46('0x41')](_0x1c88ad[_0xaa46('0x39')]['sort']);_0x11f78e[_0xaa46('0x42')]=qs[_0xaa46('0x3a')](_[_0xaa46('0x70')](_0x1c88ad[_0xaa46('0x39')],_0x442780[_0xaa46('0x3a')]));_0x11f78e[_0xaa46('0x71')]=!![];if(_0x1c88ad[_0xaa46('0x39')]['filter']){_0x11f78e['where']=_['merge'](_0x11f78e['where'],{'$or':_['map'](_0x11f78e['attributes'],function(_0x2a0513){var _0x2104b7={};_0x2104b7[_0x2a0513]={'$like':'%'+_0x1c88ad[_0xaa46('0x39')][_0xaa46('0x43')]+'%'};return _0x2104b7;})});}_0x11f78e=_['merge']({},_0x11f78e,_0x1c88ad['options']);return _0x3983b1['getContacts'](_0x11f78e);}})[_0xaa46('0x2a')](respondWithResult(_0x4feb3a,null))[_0xaa46('0x4c')](handleError(_0x4feb3a,null));};exports[_0xaa46('0x72')]=function(_0xc3efee,_0x22a56f,_0x24e3cb){var _0x4e8add;var _0x4586b1;var _0x41b62d;var _0x3e8b93=_0xc3efee[_0xaa46('0x57')]['id'];csv_results=[];return db[_0xaa46('0x73')][_0xaa46('0x4a')]({'attributes':['id','name'],'raw':!![],'order':[_0xaa46('0x74')]})['then'](function(_0x5820d0){_0x4e8add=_0x5820d0;var _0xb651d9=_[_0xaa46('0x38')](db[_0xaa46('0x60')][_0xaa46('0x34')]);return db[_0xaa46('0x75')][_0xaa46('0x4a')]({'raw':!![],'attributes':['id','alias']})[_0xaa46('0x2a')](function(_0x5b1d65){_0x4586b1=_0x5b1d65;var _0x2e778b=squel[_0xaa46('0x76')]()['fields'](_0xb651d9)[_0xaa46('0x77')](_0xaa46('0x78'),'c')[_0xaa46('0x42')](_0xaa46('0x79'),_0x3e8b93)[_0xaa46('0x42')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x18d3b1=0x0;_0x18d3b1<_0x4586b1['length'];_0x18d3b1++){_0x2e778b[_0xaa46('0x7a')](_0xaa46('0x7b')+_0x4586b1[_0x18d3b1]['id'],_0xaa46('0x7c')+_0x4586b1[_0x18d3b1][_0xaa46('0x7d')]);}for(var _0x18d3b1=0x0;_0x18d3b1<_0x4e8add['length'];_0x18d3b1++){_0x2e778b[_0xaa46('0x7a')](squel['select']()['field'](_0xaa46('0x7e'))[_0xaa46('0x77')](_0xaa46('0x7f'))[_0xaa46('0x42')](_0xaa46('0x80'),_0x4e8add[_0x18d3b1]['id'])[_0xaa46('0x42')](_0xaa46('0x81')),_0xaa46('0x82')+_0x4e8add[_0x18d3b1][_0xaa46('0x30')]);_0x2e778b[_0xaa46('0x7a')](squel['select']()[_0xaa46('0x7a')](_0xaa46('0x83'))['from'](_0xaa46('0x7f'))['where']('ItemTypeId\x20=\x20?',_0x4e8add[_0x18d3b1]['id'])[_0xaa46('0x42')](_0xaa46('0x81')),_0xaa46('0x84')+_0x4e8add[_0x18d3b1]['name']);}var _0x2166b3=[];_0x2166b3['push'](_0x2e778b[_0xaa46('0x85')]());BPromise[_0xaa46('0x65')](_0x2166b3,handleQuery)[_0xaa46('0x2a')](function(_0x45bf79){handleQuery(_0x2e778b[_0xaa46('0x85')]());var _0x26818a=csv_results[0x0];if(!_[_0xaa46('0x86')](_0x26818a)){var _0x1a6bd6=toCsv(_0x26818a);var _0x694681=Date[_0xaa46('0x87')]();fs['writeFileSync'](util['format'](_0xaa46('0x88'),_0x3e8b93,_0x694681),_0x1a6bd6);_0x22a56f[_0xaa46('0x89')](_0xaa46('0x8a'),'attachment;\x20filename='+util[_0xaa46('0x8b')]('list_%d_%s.csv',_0x3e8b93,_0x694681));_0x22a56f[_0xaa46('0x89')](_0xaa46('0x8c'),_0xaa46('0x8d'));return _0x22a56f[_0xaa46('0x8e')](util[_0xaa46('0x8b')](_0xaa46('0x88'),_0x3e8b93,_0x694681));}else{return _0x22a56f[_0xaa46('0x1e')](0xcc);}});});});};exports[_0xaa46('0x8f')]=function(_0x631ec6,_0x184711,_0x35151f){var _0x40339a;delete _0x631ec6[_0xaa46('0x4f')]['id'];return db[_0xaa46('0x49')]['findOne']({'where':{'id':_0x631ec6[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x184711,null))['then'](function(_0x2b01f1){if(_0x2b01f1){return db[_0xaa46('0x90')][_0xaa46('0x91')](function(_0x117b50){return db[_0xaa46('0x75')][_0xaa46('0x4e')](_0x631ec6[_0xaa46('0x4f')],{'transaction':_0x117b50})['then'](function(_0x459593){_0x40339a=_0x459593;return _0x2b01f1[_0xaa46('0x92')](_0x459593,{'transaction':_0x117b50});})[_0xaa46('0x2a')](function(){var _0x2c5cf3={'type':db['Sequelize'][_0xaa46('0x93')],'transaction':_0x117b50};switch(_0x631ec6[_0xaa46('0x4f')][_0xaa46('0x36')]){case _0xaa46('0x94'):_0x2c5cf3[_0xaa46('0x36')]=db[_0xaa46('0x95')]['TEXT'];break;case'number':_0x2c5cf3[_0xaa46('0x36')]=db[_0xaa46('0x95')][_0xaa46('0x96')];break;case _0xaa46('0x97'):_0x2c5cf3[_0xaa46('0x36')]=db['Sequelize'][_0xaa46('0x98')];_0x2c5cf3[_0xaa46('0x99')]=![];break;default:}return db[_0xaa46('0x90')]['queryInterface']['addColumn']('cm_contacts',util[_0xaa46('0x8b')](_0xaa46('0x9a'),_0x40339a['id']),_0x2c5cf3);})[_0xaa46('0x2a')](function(){return _0x40339a;});});}})[_0xaa46('0x2a')](respondWithResult(_0x184711,null))['catch'](handleError(_0x184711,null));};exports['getCustomFields']=function(_0x1346af,_0x2af8a6,_0x36fb2e){var _0x558ee3={};var _0x596700={};var _0x18becd;var _0x4d183e;return db[_0xaa46('0x49')][_0xaa46('0x5a')]({'where':{'id':_0x1346af[_0xaa46('0x57')]['id']}})['then'](handleEntityNotFound(_0x2af8a6,null))[_0xaa46('0x2a')](function(_0x48cf0d){if(_0x48cf0d){_0x18becd=_0x48cf0d;_0x596700['model']=_[_0xaa46('0x38')](db[_0xaa46('0x75')][_0xaa46('0x34')]);_0x596700[_0xaa46('0x39')]=_[_0xaa46('0x38')](_0x1346af[_0xaa46('0x39')]);_0x596700['filters']=_[_0xaa46('0x3b')](_0x596700['model'],_0x596700[_0xaa46('0x39')]);_0x558ee3[_0xaa46('0x3d')]=_[_0xaa46('0x3b')](_0x596700[_0xaa46('0x37')],qs[_0xaa46('0x3c')](_0x1346af[_0xaa46('0x39')]['fields']));_0x558ee3[_0xaa46('0x3d')]=_0x558ee3[_0xaa46('0x3d')]['length']?_0x558ee3['attributes']:_0x596700['model'];_0x558ee3[_0xaa46('0x40')]=qs[_0xaa46('0x41')](_0x1346af[_0xaa46('0x39')]['sort']);_0x558ee3[_0xaa46('0x42')]=qs['filters'](_['pick'](_0x1346af[_0xaa46('0x39')],_0x596700['filters']));_0x558ee3[_0xaa46('0x42')]=_[_0xaa46('0x45')](_0x558ee3[_0xaa46('0x42')],{'$or':[{'ListId':_0x48cf0d['id']},{'ListId':null}]});if(_0x1346af[_0xaa46('0x39')]['filter']){_0x558ee3[_0xaa46('0x42')]=_[_0xaa46('0x45')](_0x558ee3[_0xaa46('0x42')],{'$or':_[_0xaa46('0x33')](_0x558ee3[_0xaa46('0x3d')],function(_0x178898){var _0x7bb305={};_0x7bb305[_0x178898]={'$like':'%'+_0x1346af[_0xaa46('0x39')][_0xaa46('0x43')]+'%'};return _0x7bb305;})});}_0x558ee3=_['merge']({},_0x558ee3,_0x1346af[_0xaa46('0x46')]);return db[_0xaa46('0x75')][_0xaa46('0x9b')](_0x558ee3);}})[_0xaa46('0x2a')](respondWithResult(_0x2af8a6,null))[_0xaa46('0x4c')](handleError(_0x2af8a6,null));};exports[_0xaa46('0x9c')]=function(_0x56688e,_0x1486ad){return db[_0xaa46('0x75')]['findAndCountAll']({'where':{'ListId':null}})[_0xaa46('0x2a')](handleEntityNotFound(_0x1486ad,null))[_0xaa46('0x2a')](function(_0x5c046b){return _0x5c046b;})['then'](respondWithResult(_0x1486ad,null))[_0xaa46('0x4c')](handleError(_0x1486ad,null));};exports[_0xaa46('0x9d')]=function(_0x1eaa40,_0x593e93,_0x43ade2){return db[_0xaa46('0x49')][_0xaa46('0x4d')]({'where':{'id':_0x1eaa40[_0xaa46('0x57')]['id']}})['then'](handleEntityNotFound(_0x593e93,null))[_0xaa46('0x2a')](function(_0x4cf7fa){if(_0x4cf7fa){return _0x4cf7fa['addAgents'](_0x1eaa40[_0xaa46('0x4f')]['ids'],_[_0xaa46('0x66')](_0x1eaa40[_0xaa46('0x4f')],[_0xaa46('0x5e'),'id'])||{})[_0xaa46('0x9e')](function(_0xea16dd){for(var _0x2792af=0x0;_0x2792af<_0x1eaa40[_0xaa46('0x4f')][_0xaa46('0x5e')][_0xaa46('0x3e')];_0x2792af+=0x1){socket[_0xaa46('0x9f')](_0xaa46('0xa0'),{'UserId':Number(_0x1eaa40[_0xaa46('0x4f')][_0xaa46('0x5e')][_0x2792af]),'CmListId':Number(_0x1eaa40[_0xaa46('0x57')]['id'])});}return _0xea16dd;});}})[_0xaa46('0x2a')](respondWithResult(_0x593e93,null))[_0xaa46('0x4c')](handleError(_0x593e93,null));};exports[_0xaa46('0xa1')]=function(_0x3d3546,_0x173892,_0x1ce6e0){return db[_0xaa46('0x49')]['find']({'where':{'id':_0x3d3546[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x173892,null))[_0xaa46('0x2a')](function(_0x5dc8e0){if(_0x5dc8e0){return _0x5dc8e0[_0xaa46('0xa1')](_0x3d3546[_0xaa46('0x39')]['ids'])[_0xaa46('0x2a')](function(){if(_[_0xaa46('0x63')](_0x3d3546[_0xaa46('0x39')]['ids'])){for(var _0x203800=0x0;_0x203800<_0x3d3546[_0xaa46('0x39')][_0xaa46('0x5e')]['length'];_0x203800+=0x1){socket[_0xaa46('0x9f')]('userCmList:remove',{'UserId':Number(_0x3d3546[_0xaa46('0x39')][_0xaa46('0x5e')][_0x203800]),'CmListId':Number(_0x3d3546[_0xaa46('0x57')]['id'])});}}else{socket[_0xaa46('0x9f')](_0xaa46('0xa2'),{'UserId':Number(_0x3d3546['query'][_0xaa46('0x5e')]),'CmListId':Number(_0x3d3546[_0xaa46('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x173892,null))[_0xaa46('0x4c')](handleError(_0x173892,null));};exports['getAgents']=function(_0x416496,_0x73221e,_0x29d979){var _0x252529={};var _0x214eca={};var _0x77e77b;var _0x12b268;return db['CmList'][_0xaa46('0x5a')]({'where':{'id':_0x416496[_0xaa46('0x57')]['id']}})[_0xaa46('0x2a')](handleEntityNotFound(_0x73221e,null))[_0xaa46('0x2a')](function(_0x1dab77){if(_0x1dab77){_0x77e77b=_0x1dab77;_0x214eca[_0xaa46('0x37')]=_[_0xaa46('0x38')](db[_0xaa46('0xa3')][_0xaa46('0x34')]);_0x214eca[_0xaa46('0x39')]=_[_0xaa46('0x38')](_0x416496[_0xaa46('0x39')]);_0x214eca['filters']=_[_0xaa46('0x3b')](_0x214eca[_0xaa46('0x37')],_0x214eca[_0xaa46('0x39')]);_0x252529[_0xaa46('0x3d')]=_['intersection'](_0x214eca['model'],qs[_0xaa46('0x3c')](_0x416496[_0xaa46('0x39')]['fields']));_0x252529[_0xaa46('0x3d')]=_0x252529['attributes']['length']?_0x252529['attributes']:_0x214eca['model'];_0x252529['order']=qs[_0xaa46('0x41')](_0x416496['query']['sort']);_0x252529[_0xaa46('0x42')]=qs[_0xaa46('0x3a')](_['pick'](_0x416496[_0xaa46('0x39')],_0x214eca[_0xaa46('0x3a')]));if(_0x416496[_0xaa46('0x39')][_0xaa46('0x43')]){_0x252529['where']=_[_0xaa46('0x45')](_0x252529[_0xaa46('0x42')],{'$or':_[_0xaa46('0x33')](_0x252529[_0xaa46('0x3d')],function(_0x23756e){var _0x43c66d={};_0x43c66d[_0x23756e]={'$like':'%'+_0x416496['query'][_0xaa46('0x43')]+'%'};return _0x43c66d;})});}_0x252529=_[_0xaa46('0x45')]({},_0x252529,_0x416496[_0xaa46('0x46')]);return _0x77e77b[_0xaa46('0xa4')](_0x252529);}})['then'](function(_0x1f034e){if(_0x1f034e){_0x12b268=_0x1f034e['length'];if(!_0x416496['query'][_0xaa46('0x6f')](_0xaa46('0x3f'))){_0x252529[_0xaa46('0x22')]=qs[_0xaa46('0x22')](_0x416496['query'][_0xaa46('0x22')]);_0x252529['offset']=qs[_0xaa46('0x21')](_0x416496[_0xaa46('0x39')][_0xaa46('0x21')]);}return _0x77e77b[_0xaa46('0xa4')](_0x252529);}})[_0xaa46('0x2a')](function(_0x2035b6){if(_0x2035b6){return _0x2035b6?{'count':_0x12b268,'rows':_0x2035b6}:null;}})['then'](respondWithResult(_0x73221e,null))[_0xaa46('0x4c')](handleError(_0x73221e,null));};function handleQuery(_0x4688db){logger[_0xaa46('0xa5')](_0x4688db);return db[_0xaa46('0x90')][_0xaa46('0x39')](_0x4688db)['spread'](function(_0xc1fdce){csv_results[_0xaa46('0x64')](_0xc1fdce);})[_0xaa46('0x4c')](function(_0x52ec7c){logger[_0xaa46('0x2e')](_0x52ec7c[_0xaa46('0x6a')]);});} \ No newline at end of file +var _0xdc29=['from','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/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','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','get','stack','name','send','index','map','CmList','rawAttributes','type','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','role','user','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','length','order','pick','ListId','addContacts','CmContact','tags','isArray','join','push','each','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','ContactItemType','OrderBy','select'];(function(_0x52033d,_0x47da3d){var _0x48880b=function(_0x1b87b8){while(--_0x1b87b8){_0x52033d['push'](_0x52033d['shift']());}};_0x48880b(++_0x47da3d);}(_0xdc29,0x186));var _0x9dc2=function(_0x30ba7b,_0x22d9f9){_0x30ba7b=_0x30ba7b-0x0;var _0x361c36=_0xdc29[_0x30ba7b];return _0x361c36;};'use strict';var emlformat=require(_0x9dc2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dc2('0x1'));var jsonpatch=require(_0x9dc2('0x2'));var rp=require(_0x9dc2('0x3'));var moment=require(_0x9dc2('0x4'));var BPromise=require(_0x9dc2('0x5'));var Mustache=require(_0x9dc2('0x6'));var util=require(_0x9dc2('0x7'));var path=require(_0x9dc2('0x8'));var sox=require(_0x9dc2('0x9'));var csv=require(_0x9dc2('0xa'));var ejs=require(_0x9dc2('0xb'));var fs=require('fs');var fs_extra=require(_0x9dc2('0xc'));var _=require(_0x9dc2('0xd'));var squel=require(_0x9dc2('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9dc2('0xf'));var toCsv=require(_0x9dc2('0xa'));var querystring=require(_0x9dc2('0x10'));var Papa=require(_0x9dc2('0x11'));var Redis=require(_0x9dc2('0x12'));var authService=require(_0x9dc2('0x13'));var qs=require(_0x9dc2('0x14'));var as=require(_0x9dc2('0x15'));var hardwareService=require(_0x9dc2('0x16'));var logger=require(_0x9dc2('0x17'))(_0x9dc2('0x18'));var utils=require(_0x9dc2('0x19'));var config=require(_0x9dc2('0x1a'));var licenseUtil=require(_0x9dc2('0x1b'));var db=require(_0x9dc2('0x1c'))['db'];var csv_results;config[_0x9dc2('0x1d')]=_[_0x9dc2('0x1e')](config[_0x9dc2('0x1d')],{'host':_0x9dc2('0x1f'),'port':0x18eb});var socket=require(_0x9dc2('0x20'))(new Redis(config[_0x9dc2('0x1d')]));require(_0x9dc2('0x21'))[_0x9dc2('0x22')](socket);function respondWithStatusCode(_0x3302e1,_0x2dcff3){_0x2dcff3=_0x2dcff3||0xcc;return function(_0x154cc5){if(_0x154cc5){return _0x3302e1[_0x9dc2('0x23')](_0x2dcff3);}return _0x3302e1[_0x9dc2('0x24')](_0x2dcff3)[_0x9dc2('0x25')]();};}function respondWithResult(_0x1c701a,_0x24a1d0){_0x24a1d0=_0x24a1d0||0xc8;return function(_0x55dc32){if(_0x55dc32){return _0x1c701a[_0x9dc2('0x24')](_0x24a1d0)[_0x9dc2('0x26')](_0x55dc32);}};}function respondWithFilteredResult(_0x4b0795,_0x411d66){return function(_0x31dbd9){if(_0x31dbd9){var _0x2cc880=typeof _0x411d66[_0x9dc2('0x27')]===_0x9dc2('0x28')&&typeof _0x411d66['limit']===_0x9dc2('0x28');var _0x1b8655=_0x31dbd9[_0x9dc2('0x29')];var _0x49714c=_0x2cc880?0x0:_0x411d66['offset'];var _0x53668e=_0x2cc880?_0x31dbd9[_0x9dc2('0x29')]:_0x411d66[_0x9dc2('0x27')]+_0x411d66['limit'];var _0x2a8b14;if(_0x53668e>=_0x1b8655){_0x53668e=_0x1b8655;_0x2a8b14=0xc8;}else{_0x2a8b14=0xce;}_0x4b0795[_0x9dc2('0x24')](_0x2a8b14);return _0x4b0795['set'](_0x9dc2('0x2a'),_0x49714c+'-'+_0x53668e+'/'+_0x1b8655)[_0x9dc2('0x26')](_0x31dbd9);}return null;};}function patchUpdates(_0x371ad8){return function(_0x5c0f5a){try{jsonpatch['apply'](_0x5c0f5a,_0x371ad8,!![]);}catch(_0x569071){return BPromise[_0x9dc2('0x2b')](_0x569071);}return _0x5c0f5a[_0x9dc2('0x2c')]();};}function saveUpdates(_0x472bd0,_0x20f62c){return function(_0x44b5dc){if(_0x44b5dc){return _0x44b5dc[_0x9dc2('0x2d')](_0x472bd0)['then'](function(_0x3efc4a){return _0x3efc4a;});}return null;};}function removeEntity(_0x4cbf81,_0x202366){return function(_0xcd266a){if(_0xcd266a){return _0xcd266a['destroy']()[_0x9dc2('0x2e')](function(){var _0x36a74f=_0xcd266a[_0x9dc2('0x2f')]({'plain':!![]});var _0x207c3f='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x207c3f,'resourceId':_0x36a74f['id']}})['then'](function(){return _0xcd266a;});})[_0x9dc2('0x2e')](function(){_0x4cbf81[_0x9dc2('0x24')](0xcc)[_0x9dc2('0x25')]();});}};}function handleEntityNotFound(_0x5d874a,_0x1a8512){return function(_0xb739c4){if(!_0xb739c4){_0x5d874a['sendStatus'](0x194);}return _0xb739c4;};}function handleError(_0x1c21ed,_0x515014){_0x515014=_0x515014||0x1f4;return function(_0x24562f){logger['error'](_0x24562f[_0x9dc2('0x30')]);if(_0x24562f[_0x9dc2('0x31')]){delete _0x24562f['name'];}_0x1c21ed[_0x9dc2('0x24')](_0x515014)[_0x9dc2('0x32')](_0x24562f);};}exports[_0x9dc2('0x33')]=function(_0x156618,_0x3ded16){var _0x30edf2={},_0x34e505={},_0x13782d={'count':0x0,'rows':[]};var _0x4bc7f1=_[_0x9dc2('0x34')](db[_0x9dc2('0x35')][_0x9dc2('0x36')],function(_0x6e4cf){return{'name':_0x6e4cf['fieldName'],'type':_0x6e4cf[_0x9dc2('0x37')]['key']};});_0x34e505[_0x9dc2('0x38')]=_[_0x9dc2('0x34')](_0x4bc7f1,_0x9dc2('0x31'));_0x34e505[_0x9dc2('0x39')]=_['keys'](_0x156618[_0x9dc2('0x39')]);_0x34e505['filters']=_['intersection'](_0x34e505[_0x9dc2('0x38')],_0x34e505[_0x9dc2('0x39')]);_0x30edf2[_0x9dc2('0x3a')]=_[_0x9dc2('0x3b')](_0x34e505[_0x9dc2('0x38')],qs[_0x9dc2('0x3c')](_0x156618[_0x9dc2('0x39')][_0x9dc2('0x3c')]));_0x30edf2[_0x9dc2('0x3a')]=_0x30edf2[_0x9dc2('0x3a')]['length']?_0x30edf2[_0x9dc2('0x3a')]:_0x34e505[_0x9dc2('0x38')];if(!_0x156618[_0x9dc2('0x39')][_0x9dc2('0x3d')](_0x9dc2('0x3e'))){_0x30edf2[_0x9dc2('0x3f')]=qs[_0x9dc2('0x3f')](_0x156618['query'][_0x9dc2('0x3f')]);_0x30edf2[_0x9dc2('0x27')]=qs[_0x9dc2('0x27')](_0x156618['query']['offset']);}_0x30edf2['order']=qs['sort'](_0x156618[_0x9dc2('0x39')][_0x9dc2('0x40')]);_0x30edf2[_0x9dc2('0x41')]=qs[_0x9dc2('0x42')](_['pick'](_0x156618[_0x9dc2('0x39')],_0x34e505[_0x9dc2('0x42')]),_0x4bc7f1);if(_0x156618[_0x9dc2('0x39')][_0x9dc2('0x43')]){_0x30edf2[_0x9dc2('0x41')]=_[_0x9dc2('0x44')](_0x30edf2[_0x9dc2('0x41')],{'$or':_[_0x9dc2('0x34')](_0x4bc7f1,function(_0x1fc188){if(_0x1fc188[_0x9dc2('0x37')]!=='VIRTUAL'){var _0x118a01={};_0x118a01[_0x1fc188[_0x9dc2('0x31')]]={'$like':'%'+_0x156618[_0x9dc2('0x39')][_0x9dc2('0x43')]+'%'};return _0x118a01;}})});}_0x30edf2=_['merge']({},_0x30edf2,_0x156618['options']);var _0x323ff2={'where':_0x30edf2[_0x9dc2('0x41')]};return db[_0x9dc2('0x35')][_0x9dc2('0x29')](_0x323ff2)[_0x9dc2('0x2e')](function(_0x57d591){_0x13782d['count']=_0x57d591;if(_0x156618[_0x9dc2('0x39')][_0x9dc2('0x45')]){_0x30edf2['include']=[{'all':!![]}];}return db[_0x9dc2('0x35')][_0x9dc2('0x46')](_0x30edf2);})[_0x9dc2('0x2e')](function(_0x1536a6){_0x13782d[_0x9dc2('0x47')]=_0x1536a6;return _0x13782d;})[_0x9dc2('0x2e')](respondWithFilteredResult(_0x3ded16,_0x30edf2))[_0x9dc2('0x48')](handleError(_0x3ded16,null));};exports[_0x9dc2('0x49')]=function(_0x104c85,_0x5b43ec){var _0x4f1ac3={'raw':![],'where':{'id':_0x104c85[_0x9dc2('0x4a')]['id']}},_0x5a0789={};_0x5a0789[_0x9dc2('0x38')]=_[_0x9dc2('0x4b')](db[_0x9dc2('0x35')][_0x9dc2('0x36')]);_0x5a0789['query']=_[_0x9dc2('0x4b')](_0x104c85['query']);_0x5a0789[_0x9dc2('0x42')]=_[_0x9dc2('0x3b')](_0x5a0789[_0x9dc2('0x38')],_0x5a0789[_0x9dc2('0x39')]);_0x4f1ac3['attributes']=_[_0x9dc2('0x3b')](_0x5a0789[_0x9dc2('0x38')],qs['fields'](_0x104c85['query'][_0x9dc2('0x3c')]));_0x4f1ac3[_0x9dc2('0x3a')]=_0x4f1ac3[_0x9dc2('0x3a')]['length']?_0x4f1ac3[_0x9dc2('0x3a')]:_0x5a0789[_0x9dc2('0x38')];if(_0x104c85['query'][_0x9dc2('0x45')]){_0x4f1ac3[_0x9dc2('0x4c')]=[{'all':!![]}];}_0x4f1ac3=_[_0x9dc2('0x44')]({},_0x4f1ac3,_0x104c85[_0x9dc2('0x4d')]);return db[_0x9dc2('0x35')][_0x9dc2('0x4e')](_0x4f1ac3)[_0x9dc2('0x2e')](handleEntityNotFound(_0x5b43ec,null))[_0x9dc2('0x2e')](respondWithResult(_0x5b43ec,null))[_0x9dc2('0x48')](handleError(_0x5b43ec,null));};exports[_0x9dc2('0x4f')]=function(_0x651ea9,_0x54e02b){return db['CmList'][_0x9dc2('0x4f')](_0x651ea9[_0x9dc2('0x50')],{})['then'](function(_0x4160d4){var _0x170d2=_0x651ea9['user'][_0x9dc2('0x2f')]({'plain':!![]});if(!_0x170d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x170d2[_0x9dc2('0x51')]===_0x9dc2('0x52')){var _0x116e0c=_0x4160d4[_0x9dc2('0x2f')]({'plain':!![]});var _0x16f4e1=_0x9dc2('0x53');return db[_0x9dc2('0x54')][_0x9dc2('0x4e')]({'where':{'name':_0x16f4e1,'userProfileId':_0x170d2[_0x9dc2('0x55')]},'raw':!![]})[_0x9dc2('0x2e')](function(_0x46f61f){if(_0x46f61f&&_0x46f61f[_0x9dc2('0x56')]===0x0){return db[_0x9dc2('0x57')]['create']({'name':_0x116e0c['name'],'resourceId':_0x116e0c['id'],'type':_0x46f61f[_0x9dc2('0x31')],'sectionId':_0x46f61f['id']},{})[_0x9dc2('0x2e')](function(){return _0x4160d4;});}else{return _0x4160d4;}})[_0x9dc2('0x48')](function(_0x5b5460){logger[_0x9dc2('0x58')](_0x9dc2('0x59'),_0x5b5460);throw _0x5b5460;});}return _0x4160d4;})[_0x9dc2('0x2e')](respondWithResult(_0x54e02b,0xc9))[_0x9dc2('0x48')](handleError(_0x54e02b,null));};exports[_0x9dc2('0x2d')]=function(_0x5b9517,_0x219a2b){if(_0x5b9517[_0x9dc2('0x50')]['id']){delete _0x5b9517['body']['id'];}return db[_0x9dc2('0x35')][_0x9dc2('0x4e')]({'where':{'id':_0x5b9517[_0x9dc2('0x4a')]['id']}})[_0x9dc2('0x2e')](handleEntityNotFound(_0x219a2b,null))[_0x9dc2('0x2e')](saveUpdates(_0x5b9517[_0x9dc2('0x50')],null))['then'](respondWithResult(_0x219a2b,null))[_0x9dc2('0x48')](handleError(_0x219a2b,null));};exports['destroy']=function(_0x37617a,_0x12c72c){return db[_0x9dc2('0x35')][_0x9dc2('0x4e')]({'where':{'id':_0x37617a['params']['id']}})['then'](handleEntityNotFound(_0x12c72c,null))[_0x9dc2('0x2e')](removeEntity(_0x12c72c,null))[_0x9dc2('0x48')](handleError(_0x12c72c,null));};exports[_0x9dc2('0x5a')]=function(_0x4ed730,_0xc4e8d2){return db[_0x9dc2('0x35')][_0x9dc2('0x5a')]()['then'](respondWithResult(_0xc4e8d2,null))['catch'](handleError(_0xc4e8d2,null));};exports[_0x9dc2('0x5b')]=function(_0x47ef89,_0x4b64b4,_0x21208e){if(_0x47ef89[_0x9dc2('0x50')]['id']){delete _0x47ef89[_0x9dc2('0x50')]['id'];}return db[_0x9dc2('0x35')]['find']({'where':{'id':_0x47ef89[_0x9dc2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b64b4,null))[_0x9dc2('0x2e')](function(_0x436728){if(_0x436728){_0x47ef89[_0x9dc2('0x50')]['ListId']=_0x436728['id'];return db[_0x9dc2('0x5c')][_0x9dc2('0x4f')](_0x47ef89[_0x9dc2('0x50')]);}})[_0x9dc2('0x2e')](respondWithResult(_0x4b64b4,null))[_0x9dc2('0x48')](handleError(_0x4b64b4,null));};exports[_0x9dc2('0x5d')]=function(_0x2bbd44,_0x94a187,_0x4209ae){var _0x46aca5={'raw':![],'where':{}};var _0x5df15b={};var _0x5a26e2={'count':0x0,'rows':[]};return db[_0x9dc2('0x35')][_0x9dc2('0x5e')]({'where':{'id':_0x2bbd44[_0x9dc2('0x4a')]['id']}})[_0x9dc2('0x2e')](handleEntityNotFound(_0x94a187,null))['then'](function(_0x40e034){if(_0x40e034){_0x5df15b[_0x9dc2('0x38')]=_[_0x9dc2('0x4b')](db[_0x9dc2('0x5c')][_0x9dc2('0x36')]);_0x5df15b[_0x9dc2('0x39')]=_[_0x9dc2('0x4b')](_0x2bbd44[_0x9dc2('0x39')]);_0x5df15b['filters']=_['intersection'](_0x5df15b[_0x9dc2('0x38')],_0x5df15b[_0x9dc2('0x39')]);_0x46aca5[_0x9dc2('0x3a')]=_[_0x9dc2('0x3b')](_0x5df15b['model'],qs[_0x9dc2('0x3c')](_0x2bbd44['query']['fields']));_0x46aca5[_0x9dc2('0x3a')]=_0x46aca5[_0x9dc2('0x3a')][_0x9dc2('0x5f')]?_0x46aca5['attributes']:_0x5df15b[_0x9dc2('0x38')];if(!_0x2bbd44['query'][_0x9dc2('0x3d')](_0x9dc2('0x3e'))){_0x46aca5[_0x9dc2('0x3f')]=qs['limit'](_0x2bbd44['query'][_0x9dc2('0x3f')]);_0x46aca5[_0x9dc2('0x27')]=qs[_0x9dc2('0x27')](_0x2bbd44[_0x9dc2('0x39')][_0x9dc2('0x27')]);}_0x46aca5[_0x9dc2('0x60')]=qs['sort'](_0x2bbd44['query'][_0x9dc2('0x40')]);_0x46aca5[_0x9dc2('0x41')]=qs['filters'](_[_0x9dc2('0x61')](_0x2bbd44[_0x9dc2('0x39')],_0x5df15b[_0x9dc2('0x42')]));_0x46aca5[_0x9dc2('0x41')][_0x9dc2('0x62')]=_0x40e034['id'];if(_0x2bbd44[_0x9dc2('0x39')]['filter']){_0x46aca5[_0x9dc2('0x41')]=_[_0x9dc2('0x44')](_0x46aca5[_0x9dc2('0x41')],{'$or':_[_0x9dc2('0x34')](_0x46aca5[_0x9dc2('0x3a')],function(_0x5e3d2e){var _0x1e2ab9={};_0x1e2ab9[_0x5e3d2e]={'$like':'%'+_0x2bbd44[_0x9dc2('0x39')][_0x9dc2('0x43')]+'%'};return _0x1e2ab9;})});}_0x46aca5=_['merge']({},_0x46aca5,_0x2bbd44[_0x9dc2('0x4d')]);return db[_0x9dc2('0x5c')][_0x9dc2('0x29')]({'where':_0x46aca5['where']})[_0x9dc2('0x2e')](function(_0x5e1d89){_0x5a26e2['count']=_0x5e1d89;if(_0x2bbd44[_0x9dc2('0x39')]['includeAll']){_0x46aca5['include']=[{'all':!![]}];}return db[_0x9dc2('0x5c')][_0x9dc2('0x46')](_0x46aca5);})[_0x9dc2('0x2e')](function(_0x1fb627){_0x5a26e2['rows']=_0x1fb627;return _0x5a26e2;});}})['then'](respondWithFilteredResult(_0x94a187,_0x46aca5))[_0x9dc2('0x48')](handleError(_0x94a187,null));};exports['removeDispositions']=function(_0x40210a,_0x55170b,_0x3f1090){return db['CmList']['find']({'where':{'id':_0x40210a['params']['id']}})[_0x9dc2('0x2e')](handleEntityNotFound(_0x55170b,null))[_0x9dc2('0x2e')](function(_0x4a4978){if(_0x4a4978){return _0x4a4978['removeDispositions'](_0x40210a[_0x9dc2('0x39')]['ids']);}})[_0x9dc2('0x2e')](respondWithStatusCode(_0x55170b,null))[_0x9dc2('0x48')](handleError(_0x55170b,null));};exports[_0x9dc2('0x63')]=function(_0x2a3c55,_0x4a5c52,_0x1073d2){return db[_0x9dc2('0x35')][_0x9dc2('0x4e')]({'where':{'id':_0x2a3c55[_0x9dc2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a5c52,null))[_0x9dc2('0x2e')](function(_0x229f4b){if(_0x229f4b){var _0x440365=[];var _0x4fd8bf={'success':[],'errors':[]};return db[_0x9dc2('0x64')][_0x9dc2('0x5a')]()[_0x9dc2('0x2e')](function(_0x23b25b){if(_0x2a3c55[_0x9dc2('0x50')][_0x9dc2('0x65')]&&_[_0x9dc2('0x66')](_0x2a3c55['body'][_0x9dc2('0x65')])){if(_0x2a3c55[_0x9dc2('0x50')][_0x9dc2('0x65')][_0x9dc2('0x5f')]){_0x2a3c55[_0x9dc2('0x50')]['tags']=_0x2a3c55['body'][_0x9dc2('0x65')][_0x9dc2('0x67')](';')+';';}else{_0x2a3c55[_0x9dc2('0x50')][_0x9dc2('0x65')]=null;}}else{_0x2a3c55[_0x9dc2('0x50')][_0x9dc2('0x65')]=null;}if(_0x2a3c55[_0x9dc2('0x50')]&&_[_0x9dc2('0x66')](_0x2a3c55[_0x9dc2('0x50')])){for(var _0x316222=0x0;_0x316222<_0x2a3c55[_0x9dc2('0x50')][_0x9dc2('0x5f')];_0x316222+=0x1){_0x2a3c55['body'][_0x316222][_0x9dc2('0x62')]=_0x2a3c55[_0x9dc2('0x4a')]['id'];_0x440365[_0x9dc2('0x68')](_0x2a3c55[_0x9dc2('0x50')][_0x316222]);}return BPromise[_0x9dc2('0x69')](_0x440365,function(_0x221817){return db[_0x9dc2('0x64')]['create'](_[_0x9dc2('0x6a')](_0x221817,[_0x9dc2('0x6b'),'id'])||{},{'fields':_[_0x9dc2('0x4b')](_0x23b25b),'raw':!![]})[_0x9dc2('0x2e')](function(_0x3a77ed){_0x4fd8bf[_0x9dc2('0x6c')][_0x9dc2('0x68')](_0x3a77ed[_0x9dc2('0x6d')]);})['catch'](function(_0x224d24){_0x4fd8bf[_0x9dc2('0x6e')][_0x9dc2('0x68')]({'data':_0x221817,'error':_0x224d24[_0x9dc2('0x6f')]});});})[_0x9dc2('0x2e')](function(_0x2032ad){return _0x4fd8bf;})[_0x9dc2('0x48')](function(_0x295f85){return _0x295f85;});}else{_0x4a5c52[_0x9dc2('0x24')](0x190)[_0x9dc2('0x26')]({'message':_0x9dc2('0x70')});}});}})[_0x9dc2('0x2e')](respondWithResult(_0x4a5c52,null))[_0x9dc2('0x48')](handleError(_0x4a5c52,null));};exports[_0x9dc2('0x71')]=function(_0x287c5b,_0x5c9771,_0x26d5aa){var _0x278a0e;return db[_0x9dc2('0x35')][_0x9dc2('0x4e')]({'where':{'id':_0x287c5b[_0x9dc2('0x4a')]['id']},'include':[{'model':db[_0x9dc2('0x72')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x5c9771,null))[_0x9dc2('0x2e')](function(_0x4a6585){if(_0x4a6585){_0x278a0e=_0x4a6585;return db[_0x9dc2('0x64')][_0x9dc2('0x36')];}})[_0x9dc2('0x2e')](function(_0x2eab34){if(_0x2eab34){var _0x47c087={};var _0x2219f5={};_0x2219f5[_0x9dc2('0x38')]=_[_0x9dc2('0x73')](_[_0x9dc2('0x4b')](_0x2eab34),_[_0x9dc2('0x34')](_0x278a0e[_0x9dc2('0x74')],function(_0x30e9d0){return util[_0x9dc2('0x75')](_0x9dc2('0x76'),_0x30e9d0['id']);}));_0x2219f5['query']=_[_0x9dc2('0x4b')](_0x287c5b[_0x9dc2('0x39')]);_0x2219f5[_0x9dc2('0x42')]=_[_0x9dc2('0x3b')](_0x2219f5[_0x9dc2('0x38')],_0x2219f5[_0x9dc2('0x39')]);_0x47c087[_0x9dc2('0x3a')]=_['intersection'](_0x2219f5['model'],qs['fields'](_0x287c5b[_0x9dc2('0x39')]['fields']));_0x47c087[_0x9dc2('0x3a')]=_0x47c087[_0x9dc2('0x3a')]['length']?_0x47c087[_0x9dc2('0x3a')]:_0x2219f5[_0x9dc2('0x38')];if(!_0x287c5b['query'][_0x9dc2('0x3d')](_0x9dc2('0x3e'))){_0x47c087[_0x9dc2('0x3f')]=qs[_0x9dc2('0x3f')](_0x287c5b[_0x9dc2('0x39')][_0x9dc2('0x3f')]);_0x47c087[_0x9dc2('0x27')]=qs[_0x9dc2('0x27')](_0x287c5b[_0x9dc2('0x39')]['offset']);}_0x47c087['order']=qs[_0x9dc2('0x40')](_0x287c5b['query'][_0x9dc2('0x40')]);_0x47c087[_0x9dc2('0x41')]=qs['filters'](_['pick'](_0x287c5b['query'],_0x2219f5[_0x9dc2('0x42')]));_0x47c087[_0x9dc2('0x77')]=!![];if(_0x287c5b[_0x9dc2('0x39')][_0x9dc2('0x43')]){_0x47c087[_0x9dc2('0x41')]=_[_0x9dc2('0x44')](_0x47c087[_0x9dc2('0x41')],{'$or':_['map'](_0x47c087[_0x9dc2('0x3a')],function(_0x414a4e){var _0xa711cf={};_0xa711cf[_0x414a4e]={'$like':'%'+_0x287c5b[_0x9dc2('0x39')]['filter']+'%'};return _0xa711cf;})});}_0x47c087=_[_0x9dc2('0x44')]({},_0x47c087,_0x287c5b[_0x9dc2('0x4d')]);return _0x278a0e['getContacts'](_0x47c087);}})[_0x9dc2('0x2e')](respondWithResult(_0x5c9771,null))['catch'](handleError(_0x5c9771,null));};exports['getContactsCsv']=function(_0x533d15,_0xf8abec,_0x3344a0){var _0x529fc4;var _0x18af08;var _0x267c15;var _0x24ffdf=_0x533d15[_0x9dc2('0x4a')]['id'];csv_results=[];return db[_0x9dc2('0x78')][_0x9dc2('0x46')]({'attributes':['id',_0x9dc2('0x31')],'raw':!![],'order':[_0x9dc2('0x79')]})[_0x9dc2('0x2e')](function(_0x2f89dd){_0x529fc4=_0x2f89dd;var _0x48132b=_[_0x9dc2('0x4b')](db['CmContact'][_0x9dc2('0x36')]);return db[_0x9dc2('0x72')]['findAll']({'raw':!![],'attributes':['id','alias']})[_0x9dc2('0x2e')](function(_0x272011){_0x18af08=_0x272011;var _0x422d5f=squel[_0x9dc2('0x7a')]()[_0x9dc2('0x3c')](_0x48132b)[_0x9dc2('0x7b')]('cm_contacts','c')[_0x9dc2('0x41')]('c.ListId\x20=\x20?',_0x24ffdf)[_0x9dc2('0x41')](_0x9dc2('0x7c'))[_0x9dc2('0x7d')]();for(var _0x268c8b=0x0;_0x268c8b<_0x18af08[_0x9dc2('0x5f')];_0x268c8b++){_0x422d5f[_0x9dc2('0x7e')](_0x9dc2('0x7f')+_0x18af08[_0x268c8b]['id'],_0x9dc2('0x80')+_0x18af08[_0x268c8b][_0x9dc2('0x81')]);}for(var _0x268c8b=0x0;_0x268c8b<_0x529fc4['length'];_0x268c8b++){_0x422d5f['field'](squel[_0x9dc2('0x7a')]()[_0x9dc2('0x7e')]('item')['from'](_0x9dc2('0x82'))[_0x9dc2('0x41')](_0x9dc2('0x83'),_0x529fc4[_0x268c8b]['id'])[_0x9dc2('0x41')](_0x9dc2('0x84')),_0x9dc2('0x85')+_0x529fc4[_0x268c8b][_0x9dc2('0x31')]);_0x422d5f[_0x9dc2('0x7e')](squel['select']()[_0x9dc2('0x7e')](_0x9dc2('0x86'))[_0x9dc2('0x7b')](_0x9dc2('0x82'))[_0x9dc2('0x41')](_0x9dc2('0x83'),_0x529fc4[_0x268c8b]['id'])[_0x9dc2('0x41')](_0x9dc2('0x84')),'description_additionalPhone_'+_0x529fc4[_0x268c8b][_0x9dc2('0x31')]);}var _0x514b4f=[];_0x514b4f[_0x9dc2('0x68')](_0x422d5f[_0x9dc2('0x87')]());BPromise[_0x9dc2('0x69')](_0x514b4f,handleQuery)['then'](function(_0x509e8e){handleQuery(_0x422d5f['toString']());var _0x25c192=csv_results[0x0];if(!_[_0x9dc2('0x88')](_0x25c192)){var _0x39ee50=toCsv(_0x25c192);var _0x281c57=Date[_0x9dc2('0x89')]();fs[_0x9dc2('0x8a')](util['format'](_0x9dc2('0x8b'),_0x24ffdf,_0x281c57),_0x39ee50);_0xf8abec['setHeader'](_0x9dc2('0x8c'),'attachment;\x20filename='+util['format'](_0x9dc2('0x8d'),_0x24ffdf,_0x281c57));_0xf8abec[_0x9dc2('0x8e')](_0x9dc2('0x8f'),'text/csv');return _0xf8abec[_0x9dc2('0x90')](util['format']('/tmp/list_%d_%s.csv',_0x24ffdf,_0x281c57));}else{return _0xf8abec['sendStatus'](0xcc);}});});});};exports[_0x9dc2('0x91')]=function(_0x2cb632,_0x4eb788,_0x57ffcc){var _0x544e49;delete _0x2cb632[_0x9dc2('0x50')]['id'];return db['CmList'][_0x9dc2('0x5e')]({'where':{'id':_0x2cb632[_0x9dc2('0x4a')]['id']}})[_0x9dc2('0x2e')](handleEntityNotFound(_0x4eb788,null))['then'](function(_0x39e8ab){if(_0x39e8ab){return db[_0x9dc2('0x92')][_0x9dc2('0x93')](function(_0xddbf23){return db[_0x9dc2('0x72')][_0x9dc2('0x4f')](_0x2cb632[_0x9dc2('0x50')],{'transaction':_0xddbf23})['then'](function(_0x59d234){_0x544e49=_0x59d234;return _0x39e8ab[_0x9dc2('0x94')](_0x59d234,{'transaction':_0xddbf23});})[_0x9dc2('0x2e')](function(){var _0x44080e={'type':db[_0x9dc2('0x95')]['TEXT'],'transaction':_0xddbf23};switch(_0x2cb632['body']['type']){case _0x9dc2('0x96'):_0x44080e['type']=db['Sequelize'][_0x9dc2('0x97')];break;case _0x9dc2('0x98'):_0x44080e['type']=db[_0x9dc2('0x95')][_0x9dc2('0x99')];break;case'switch':_0x44080e[_0x9dc2('0x37')]=db[_0x9dc2('0x95')][_0x9dc2('0x9a')];_0x44080e[_0x9dc2('0x9b')]=![];break;default:}return db[_0x9dc2('0x92')]['queryInterface'][_0x9dc2('0x9c')](_0x9dc2('0x9d'),util[_0x9dc2('0x75')](_0x9dc2('0x9e'),_0x544e49['id']),_0x44080e);})['then'](function(){return _0x544e49;});});}})[_0x9dc2('0x2e')](respondWithResult(_0x4eb788,null))[_0x9dc2('0x48')](handleError(_0x4eb788,null));};exports[_0x9dc2('0x9f')]=function(_0x2708a1,_0x20da89,_0x50115c){var _0x28fe20={};var _0x2c4a78={};var _0x2593ac;var _0xffc7e6;return db[_0x9dc2('0x35')][_0x9dc2('0x5e')]({'where':{'id':_0x2708a1[_0x9dc2('0x4a')]['id']}})[_0x9dc2('0x2e')](handleEntityNotFound(_0x20da89,null))['then'](function(_0x1debc3){if(_0x1debc3){_0x2593ac=_0x1debc3;_0x2c4a78[_0x9dc2('0x38')]=_['keys'](db[_0x9dc2('0x72')]['rawAttributes']);_0x2c4a78[_0x9dc2('0x39')]=_[_0x9dc2('0x4b')](_0x2708a1['query']);_0x2c4a78['filters']=_[_0x9dc2('0x3b')](_0x2c4a78[_0x9dc2('0x38')],_0x2c4a78[_0x9dc2('0x39')]);_0x28fe20[_0x9dc2('0x3a')]=_[_0x9dc2('0x3b')](_0x2c4a78[_0x9dc2('0x38')],qs[_0x9dc2('0x3c')](_0x2708a1[_0x9dc2('0x39')][_0x9dc2('0x3c')]));_0x28fe20[_0x9dc2('0x3a')]=_0x28fe20[_0x9dc2('0x3a')][_0x9dc2('0x5f')]?_0x28fe20['attributes']:_0x2c4a78[_0x9dc2('0x38')];_0x28fe20[_0x9dc2('0x60')]=qs['sort'](_0x2708a1[_0x9dc2('0x39')][_0x9dc2('0x40')]);_0x28fe20[_0x9dc2('0x41')]=qs[_0x9dc2('0x42')](_[_0x9dc2('0x61')](_0x2708a1['query'],_0x2c4a78['filters']));_0x28fe20[_0x9dc2('0x41')]=_[_0x9dc2('0x44')](_0x28fe20[_0x9dc2('0x41')],{'$or':[{'ListId':_0x1debc3['id']},{'ListId':null}]});if(_0x2708a1[_0x9dc2('0x39')]['filter']){_0x28fe20[_0x9dc2('0x41')]=_[_0x9dc2('0x44')](_0x28fe20[_0x9dc2('0x41')],{'$or':_['map'](_0x28fe20[_0x9dc2('0x3a')],function(_0x4ff0f1){var _0x56aa5e={};_0x56aa5e[_0x4ff0f1]={'$like':'%'+_0x2708a1['query'][_0x9dc2('0x43')]+'%'};return _0x56aa5e;})});}_0x28fe20=_[_0x9dc2('0x44')]({},_0x28fe20,_0x2708a1[_0x9dc2('0x4d')]);return db[_0x9dc2('0x72')][_0x9dc2('0xa0')](_0x28fe20);}})[_0x9dc2('0x2e')](respondWithResult(_0x20da89,null))[_0x9dc2('0x48')](handleError(_0x20da89,null));};exports[_0x9dc2('0xa1')]=function(_0x4d801f,_0x1a5a12){return db[_0x9dc2('0x72')]['findAndCountAll']({'where':{'ListId':null}})[_0x9dc2('0x2e')](handleEntityNotFound(_0x1a5a12,null))[_0x9dc2('0x2e')](function(_0x3959eb){return _0x3959eb;})['then'](respondWithResult(_0x1a5a12,null))[_0x9dc2('0x48')](handleError(_0x1a5a12,null));};exports[_0x9dc2('0xa2')]=function(_0x348242,_0x52133d,_0x43b36c){return db[_0x9dc2('0x35')][_0x9dc2('0x4e')]({'where':{'id':_0x348242['params']['id']}})[_0x9dc2('0x2e')](handleEntityNotFound(_0x52133d,null))[_0x9dc2('0x2e')](function(_0x218585){if(_0x218585){return _0x218585[_0x9dc2('0xa2')](_0x348242[_0x9dc2('0x50')][_0x9dc2('0x6b')],_[_0x9dc2('0x6a')](_0x348242[_0x9dc2('0x50')],[_0x9dc2('0x6b'),'id'])||{})[_0x9dc2('0xa3')](function(_0x1af5f8){for(var _0x9b3cb1=0x0;_0x9b3cb1<_0x348242['body'][_0x9dc2('0x6b')][_0x9dc2('0x5f')];_0x9b3cb1+=0x1){socket[_0x9dc2('0xa4')](_0x9dc2('0xa5'),{'UserId':Number(_0x348242[_0x9dc2('0x50')][_0x9dc2('0x6b')][_0x9b3cb1]),'CmListId':Number(_0x348242[_0x9dc2('0x4a')]['id'])});}return _0x1af5f8;});}})[_0x9dc2('0x2e')](respondWithResult(_0x52133d,null))[_0x9dc2('0x48')](handleError(_0x52133d,null));};exports[_0x9dc2('0xa6')]=function(_0xbbc1ec,_0x3a602b,_0x523fdd){return db['CmList']['find']({'where':{'id':_0xbbc1ec['params']['id']}})['then'](handleEntityNotFound(_0x3a602b,null))[_0x9dc2('0x2e')](function(_0x390489){if(_0x390489){return _0x390489[_0x9dc2('0xa6')](_0xbbc1ec[_0x9dc2('0x39')]['ids'])['then'](function(){if(_[_0x9dc2('0x66')](_0xbbc1ec[_0x9dc2('0x39')]['ids'])){for(var _0x4cb6e9=0x0;_0x4cb6e9<_0xbbc1ec[_0x9dc2('0x39')]['ids']['length'];_0x4cb6e9+=0x1){socket[_0x9dc2('0xa4')](_0x9dc2('0xa7'),{'UserId':Number(_0xbbc1ec[_0x9dc2('0x39')][_0x9dc2('0x6b')][_0x4cb6e9]),'CmListId':Number(_0xbbc1ec['params']['id'])});}}else{socket['emit'](_0x9dc2('0xa7'),{'UserId':Number(_0xbbc1ec[_0x9dc2('0x39')][_0x9dc2('0x6b')]),'CmListId':Number(_0xbbc1ec[_0x9dc2('0x4a')]['id'])});}});}})[_0x9dc2('0x2e')](respondWithStatusCode(_0x3a602b,null))[_0x9dc2('0x48')](handleError(_0x3a602b,null));};exports[_0x9dc2('0xa8')]=function(_0x48f155,_0x1a7836,_0x372f7a){var _0x4a595e={};var _0x31acab={};var _0x1e2f5a;var _0x3354b4;return db['CmList']['findOne']({'where':{'id':_0x48f155[_0x9dc2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a7836,null))[_0x9dc2('0x2e')](function(_0x3f49f7){if(_0x3f49f7){_0x1e2f5a=_0x3f49f7;_0x31acab[_0x9dc2('0x38')]=_['keys'](db[_0x9dc2('0xa9')][_0x9dc2('0x36')]);_0x31acab[_0x9dc2('0x39')]=_[_0x9dc2('0x4b')](_0x48f155[_0x9dc2('0x39')]);_0x31acab['filters']=_[_0x9dc2('0x3b')](_0x31acab[_0x9dc2('0x38')],_0x31acab[_0x9dc2('0x39')]);_0x4a595e[_0x9dc2('0x3a')]=_[_0x9dc2('0x3b')](_0x31acab[_0x9dc2('0x38')],qs[_0x9dc2('0x3c')](_0x48f155[_0x9dc2('0x39')]['fields']));_0x4a595e[_0x9dc2('0x3a')]=_0x4a595e[_0x9dc2('0x3a')][_0x9dc2('0x5f')]?_0x4a595e[_0x9dc2('0x3a')]:_0x31acab[_0x9dc2('0x38')];_0x4a595e['order']=qs[_0x9dc2('0x40')](_0x48f155['query'][_0x9dc2('0x40')]);_0x4a595e[_0x9dc2('0x41')]=qs[_0x9dc2('0x42')](_[_0x9dc2('0x61')](_0x48f155[_0x9dc2('0x39')],_0x31acab['filters']));if(_0x48f155[_0x9dc2('0x39')][_0x9dc2('0x43')]){_0x4a595e[_0x9dc2('0x41')]=_['merge'](_0x4a595e['where'],{'$or':_[_0x9dc2('0x34')](_0x4a595e[_0x9dc2('0x3a')],function(_0x32302d){var _0x2db3e8={};_0x2db3e8[_0x32302d]={'$like':'%'+_0x48f155[_0x9dc2('0x39')][_0x9dc2('0x43')]+'%'};return _0x2db3e8;})});}_0x4a595e=_[_0x9dc2('0x44')]({},_0x4a595e,_0x48f155[_0x9dc2('0x4d')]);return _0x1e2f5a['getAgents'](_0x4a595e);}})[_0x9dc2('0x2e')](function(_0x4b80af){if(_0x4b80af){_0x3354b4=_0x4b80af[_0x9dc2('0x5f')];if(!_0x48f155[_0x9dc2('0x39')]['hasOwnProperty'](_0x9dc2('0x3e'))){_0x4a595e[_0x9dc2('0x3f')]=qs[_0x9dc2('0x3f')](_0x48f155[_0x9dc2('0x39')][_0x9dc2('0x3f')]);_0x4a595e[_0x9dc2('0x27')]=qs[_0x9dc2('0x27')](_0x48f155[_0x9dc2('0x39')][_0x9dc2('0x27')]);}return _0x1e2f5a[_0x9dc2('0xa8')](_0x4a595e);}})[_0x9dc2('0x2e')](function(_0x279ef5){if(_0x279ef5){return _0x279ef5?{'count':_0x3354b4,'rows':_0x279ef5}:null;}})[_0x9dc2('0x2e')](respondWithResult(_0x1a7836,null))[_0x9dc2('0x48')](handleError(_0x1a7836,null));};function handleQuery(_0x3ff3e4){logger[_0x9dc2('0xaa')](_0x3ff3e4);return db[_0x9dc2('0x92')][_0x9dc2('0x39')](_0x3ff3e4)['spread'](function(_0x724811){csv_results[_0x9dc2('0x68')](_0x724811);})[_0x9dc2('0x48')](function(_0x29df7e){logger['error'](_0x29df7e['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d7283c1..8a68a36 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x970aea,_0x250239){var _0x351eb5=function(_0x1b0606){while(--_0x1b0606){_0x970aea['push'](_0x970aea['shift']());}};_0x351eb5(++_0x250239);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x2383c3,_0x4fd9de){var _0x2cadbc=function(_0x2d0810){while(--_0x2d0810){_0x2383c3['push'](_0x2383c3['shift']());}};_0x2cadbc(++_0x4fd9de);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 6454c3b..a6337f0 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 _0x70e0=['cm_lists','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes'];(function(_0x13518d,_0x5536b0){var _0x1fe3e8=function(_0x33d72c){while(--_0x33d72c){_0x13518d['push'](_0x13518d['shift']());}};_0x1fe3e8(++_0x5536b0);}(_0x70e0,0x17b));var _0x070e=function(_0xa4dd0e,_0x23b1ed){_0xa4dd0e=_0xa4dd0e-0x0;var _0x522f0e=_0x70e0[_0xa4dd0e];return _0x522f0e;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('CmList',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['exports','define','CmList','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x38483c,_0x2e05){var _0x2da4a5=function(_0x5c93dd){while(--_0x5c93dd){_0x38483c['push'](_0x38483c['shift']());}};_0x2da4a5(++_0x2e05);}(_0x702d,0x147));var _0xd702=function(_0x4a0f08,_0xb3cfca){_0x4a0f08=_0x4a0f08-0x0;var _0x30fe2b=_0x702d[_0x4a0f08];return _0x30fe2b;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./cmList.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 96e88d4..64d1225 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 _0x9052=['then','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CmList,\x20%s,\x20%s','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./cmList.socket','register','request'];(function(_0xed6f46,_0x1c9006){var _0x5b267c=function(_0x59f0d2){while(--_0x59f0d2){_0xed6f46['push'](_0xed6f46['shift']());}};_0x5b267c(++_0x1c9006);}(_0x9052,0xfd));var _0x2905=function(_0x4f7c69,_0x3b2733){_0x4f7c69=_0x4f7c69-0x0;var _0x18033f=_0x9052[_0x4f7c69];return _0x18033f;};'use strict';var _=require('lodash');var util=require(_0x2905('0x0'));var moment=require(_0x2905('0x1'));var BPromise=require(_0x2905('0x2'));var rs=require(_0x2905('0x3'));var fs=require('fs');var Redis=require(_0x2905('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2905('0x5'));var logger=require(_0x2905('0x6'))('rpc');var config=require(_0x2905('0x7'));var jayson=require(_0x2905('0x8'));var client=jayson[_0x2905('0x9')][_0x2905('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x2905('0xb'),'port':0x18eb});var socket=require(_0x2905('0xc'))(new Redis(config[_0x2905('0xd')]));require(_0x2905('0xe'))[_0x2905('0xf')](socket);function respondWithRpcPromise(_0x1b28b9,_0x3bb196,_0x29f3cf){return new BPromise(function(_0x1bcc48,_0x2c8a3b){return client[_0x2905('0x10')](_0x1b28b9,_0x29f3cf)[_0x2905('0x11')](function(_0x11d230){logger['info']('CmList,\x20%s,\x20%s',_0x3bb196,'request\x20sent');logger['debug'](_0x2905('0x12'),_0x3bb196,_0x2905('0x13'),JSON[_0x2905('0x14')](_0x11d230));if(_0x11d230[_0x2905('0x15')]){if(_0x11d230['error'][_0x2905('0x16')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x3bb196,_0x11d230[_0x2905('0x15')][_0x2905('0x17')]);return _0x2c8a3b(_0x11d230['error'][_0x2905('0x17')]);}logger['error']('CmList,\x20%s,\x20%s',_0x3bb196,_0x11d230[_0x2905('0x15')][_0x2905('0x17')]);return _0x1bcc48(_0x11d230[_0x2905('0x15')][_0x2905('0x17')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x3bb196,_0x2905('0x13'));_0x1bcc48(_0x11d230[_0x2905('0x18')][_0x2905('0x17')]);}})[_0x2905('0x19')](function(_0x248c70){logger[_0x2905('0x15')](_0x2905('0x1a'),_0x3bb196,_0x248c70);_0x2c8a3b(_0x248c70);});});} \ No newline at end of file +var _0x3df7=['then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./cmList.socket','register'];(function(_0x2afcc9,_0x37987c){var _0x2cab56=function(_0x542b2c){while(--_0x542b2c){_0x2afcc9['push'](_0x2afcc9['shift']());}};_0x2cab56(++_0x37987c);}(_0x3df7,0x191));var _0x73df=function(_0x5d7b32,_0x576d74){_0x5d7b32=_0x5d7b32-0x0;var _0x674552=_0x3df7[_0x5d7b32];return _0x674552;};'use strict';var _=require(_0x73df('0x0'));var util=require('util');var moment=require(_0x73df('0x1'));var BPromise=require('bluebird');var rs=require(_0x73df('0x2'));var fs=require('fs');var Redis=require(_0x73df('0x3'));var db=require(_0x73df('0x4'))['db'];var utils=require(_0x73df('0x5'));var logger=require(_0x73df('0x6'))(_0x73df('0x7'));var config=require('../../config/environment');var jayson=require(_0x73df('0x8'));var client=jayson['client'][_0x73df('0x9')]({'port':0x232a});config[_0x73df('0xa')]=_[_0x73df('0xb')](config[_0x73df('0xa')],{'host':_0x73df('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73df('0xa')]));require(_0x73df('0xd'))[_0x73df('0xe')](socket);function respondWithRpcPromise(_0x340ff8,_0x1ef09a,_0xd37edd){return new BPromise(function(_0x1bc0ef,_0x14662a){return client['request'](_0x340ff8,_0xd37edd)[_0x73df('0xf')](function(_0xfdf50e){logger['info'](_0x73df('0x10'),_0x1ef09a,_0x73df('0x11'));logger[_0x73df('0x12')](_0x73df('0x13'),_0x1ef09a,_0x73df('0x11'),JSON['stringify'](_0xfdf50e));if(_0xfdf50e[_0x73df('0x14')]){if(_0xfdf50e['error'][_0x73df('0x15')]===0x1f4){logger[_0x73df('0x14')](_0x73df('0x10'),_0x1ef09a,_0xfdf50e[_0x73df('0x14')][_0x73df('0x16')]);return _0x14662a(_0xfdf50e[_0x73df('0x14')][_0x73df('0x16')]);}logger[_0x73df('0x14')](_0x73df('0x10'),_0x1ef09a,_0xfdf50e[_0x73df('0x14')][_0x73df('0x16')]);return _0x1bc0ef(_0xfdf50e['error']['message']);}else{logger[_0x73df('0x17')](_0x73df('0x10'),_0x1ef09a,_0x73df('0x11'));_0x1bc0ef(_0xfdf50e[_0x73df('0x18')][_0x73df('0x16')]);}})[_0x73df('0x19')](function(_0x2fccd1){logger[_0x73df('0x14')](_0x73df('0x10'),_0x1ef09a,_0x2fccd1);_0x14662a(_0x2fccd1);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 25427b0..534bc73 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 _0xc47b=['save','remove','update','emit','removeListener','register','length','cmList:','./cmList.events'];(function(_0x314466,_0x4a8ac9){var _0x2ae89b=function(_0x5e1a9c){while(--_0x5e1a9c){_0x314466['push'](_0x314466['shift']());}};_0x2ae89b(++_0x4a8ac9);}(_0xc47b,0x14c));var _0xbc47=function(_0x4ba033,_0x27d647){_0x4ba033=_0x4ba033-0x0;var _0x546e3e=_0xc47b[_0x4ba033];return _0x546e3e;};'use strict';var CmListEvents=require(_0xbc47('0x0'));var events=[_0xbc47('0x1'),_0xbc47('0x2'),_0xbc47('0x3')];function createListener(_0x3d24af,_0xb57557){return function(_0x33d0e2){_0xb57557[_0xbc47('0x4')](_0x3d24af,_0x33d0e2);};}function removeListener(_0x393053,_0x49da83){return function(){CmListEvents[_0xbc47('0x5')](_0x393053,_0x49da83);};}exports[_0xbc47('0x6')]=function(_0x2fb712){for(var _0x39422b=0x0,_0x463a82=events[_0xbc47('0x7')];_0x39422b<_0x463a82;_0x39422b++){var _0x4b85ae=events[_0x39422b];var _0x131a5=createListener(_0xbc47('0x8')+_0x4b85ae,_0x2fb712);CmListEvents['on'](_0x4b85ae,_0x131a5);}}; \ No newline at end of file +var _0xa34a=['removeListener','register','length','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x21fd6c,_0x3caa22){var _0x1c751f=function(_0xbf4d60){while(--_0xbf4d60){_0x21fd6c['push'](_0x21fd6c['shift']());}};_0x1c751f(++_0x3caa22);}(_0xa34a,0x109));var _0xaa34=function(_0x31a190,_0x555518){_0x31a190=_0x31a190-0x0;var _0x8676f=_0xa34a[_0x31a190];return _0x8676f;};'use strict';var CmListEvents=require(_0xaa34('0x0'));var events=[_0xaa34('0x1'),_0xaa34('0x2'),_0xaa34('0x3')];function createListener(_0x521180,_0x2261a4){return function(_0x162b9f){_0x2261a4[_0xaa34('0x4')](_0x521180,_0x162b9f);};}function removeListener(_0x48cc8a,_0x3c6d79){return function(){CmListEvents[_0xaa34('0x5')](_0x48cc8a,_0x3c6d79);};}exports[_0xaa34('0x6')]=function(_0x3622db){for(var _0x38f634=0x0,_0x17c35d=events[_0xaa34('0x7')];_0x38f634<_0x17c35d;_0x38f634++){var _0x1cf849=events[_0x38f634];var _0x5aeea1=createListener(_0xaa34('0x8')+_0x1cf849,_0x3622db);CmListEvents['on'](_0x1cf849,_0x5aeea1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5b78ce8..7ea8965 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 _0xb2d4=['/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','addDisposition','addContacts','post','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/global_fields','/:id','show'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb2d4,0x10a));var _0x4b2d=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xb2d4[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x4b2d('0x0'));var util=require('util');var path=require(_0x4b2d('0x1'));var timeout=require('connect-timeout');var express=require(_0x4b2d('0x2'));var router=express[_0x4b2d('0x3')]();var fs_extra=require(_0x4b2d('0x4'));var auth=require(_0x4b2d('0x5'));var interaction=require(_0x4b2d('0x6'));var config=require(_0x4b2d('0x7'));var controller=require('./cmList.controller');router[_0x4b2d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4b2d('0x8')](_0x4b2d('0x9'),auth[_0x4b2d('0xa')](),controller['describe']);router[_0x4b2d('0x8')](_0x4b2d('0xb'),auth[_0x4b2d('0xa')](),controller['getGlobalCustomFields']);router[_0x4b2d('0x8')](_0x4b2d('0xc'),auth['isAuthenticated'](),controller[_0x4b2d('0xd')]);router[_0x4b2d('0x8')](_0x4b2d('0xe'),auth[_0x4b2d('0xa')](),controller[_0x4b2d('0xf')]);router[_0x4b2d('0x8')](_0x4b2d('0x10'),auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x11')]);router[_0x4b2d('0x8')](_0x4b2d('0x12'),auth['isAuthenticated'](),controller[_0x4b2d('0x13')]);router[_0x4b2d('0x8')](_0x4b2d('0x14'),auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x15')]);router[_0x4b2d('0x8')](_0x4b2d('0x16'),auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x17')]);router['post']('/',auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x18')]);router['post'](_0x4b2d('0xe'),auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x19')]);router['post']('/:id/contacts',auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x1a')]);router[_0x4b2d('0x1b')](_0x4b2d('0x14'),auth[_0x4b2d('0xa')](),controller['addCustomField']);router[_0x4b2d('0x1b')](_0x4b2d('0x16'),auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x1c')]);router[_0x4b2d('0x1d')]('/:id',auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x1e')]);router[_0x4b2d('0x1f')]('/:id',auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x20')]);router[_0x4b2d('0x1f')]('/:id/dispositions',auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x21')]);router[_0x4b2d('0x1f')](_0x4b2d('0x16'),auth[_0x4b2d('0xa')](),controller[_0x4b2d('0x22')]);module['exports']=router; \ No newline at end of file +var _0xcc19=['addCustomField','addAgents','put','update','delete','destroy','removeDispositions','/:id/users','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','create','post','addContacts'];(function(_0x8c90b1,_0x2579ab){var _0x4f1f9c=function(_0x948f53){while(--_0x948f53){_0x8c90b1['push'](_0x8c90b1['shift']());}};_0x4f1f9c(++_0x2579ab);}(_0xcc19,0xbd));var _0x9cc1=function(_0x559364,_0x223995){_0x559364=_0x559364-0x0;var _0x3b4555=_0xcc19[_0x559364];return _0x3b4555;};'use strict';var multer=require(_0x9cc1('0x0'));var util=require(_0x9cc1('0x1'));var path=require('path');var timeout=require(_0x9cc1('0x2'));var express=require(_0x9cc1('0x3'));var router=express[_0x9cc1('0x4')]();var fs_extra=require(_0x9cc1('0x5'));var auth=require(_0x9cc1('0x6'));var interaction=require(_0x9cc1('0x7'));var config=require(_0x9cc1('0x8'));var controller=require(_0x9cc1('0x9'));router[_0x9cc1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9cc1('0xa')](_0x9cc1('0xb'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0xd')]);router[_0x9cc1('0xa')](_0x9cc1('0xe'),auth['isAuthenticated'](),controller[_0x9cc1('0xf')]);router[_0x9cc1('0xa')](_0x9cc1('0x10'),auth[_0x9cc1('0xc')](),controller['show']);router[_0x9cc1('0xa')](_0x9cc1('0x11'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x12')]);router[_0x9cc1('0xa')](_0x9cc1('0x13'),auth[_0x9cc1('0xc')](),controller['getContacts']);router[_0x9cc1('0xa')](_0x9cc1('0x14'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x15')]);router[_0x9cc1('0xa')](_0x9cc1('0x16'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x17')]);router[_0x9cc1('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x18')]);router[_0x9cc1('0x19')](_0x9cc1('0x11'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x9cc1('0x19')](_0x9cc1('0x13'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x1a')]);router['post'](_0x9cc1('0x16'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x1b')]);router[_0x9cc1('0x19')]('/:id/users',auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x1c')]);router[_0x9cc1('0x1d')](_0x9cc1('0x10'),auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x1e')]);router[_0x9cc1('0x1f')]('/:id',auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x20')]);router['delete']('/:id/dispositions',auth[_0x9cc1('0xc')](),controller[_0x9cc1('0x21')]);router['delete'](_0x9cc1('0x22'),auth[_0x9cc1('0xc')](),controller['removeAgents']);module[_0x9cc1('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ec6fef2..859922c 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 _0xfd16=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xfd16,0xc0));var _0x6fd1=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xfd16[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x6fd1('0x0'));module[_0x6fd1('0x1')]={'name':{'type':Sequelize[_0x6fd1('0x2')],'get':function(_0x2d7452){return this[_0x6fd1('0x3')](_0x6fd1('0x4'));}},'field':{'type':Sequelize[_0x6fd1('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5df8=['getDataValue','field','STRING','exports','VIRTUAL'];(function(_0x9a4c49,_0x2d03e7){var _0x183b42=function(_0x38e04e){while(--_0x38e04e){_0x9a4c49['push'](_0x9a4c49['shift']());}};_0x183b42(++_0x2d03e7);}(_0x5df8,0x94));var _0x85df=function(_0x4b3a49,_0xeadd7c){_0x4b3a49=_0x4b3a49-0x0;var _0x1d4545=_0x5df8[_0x4b3a49];return _0x1d4545;};'use strict';var Sequelize=require('sequelize');module[_0x85df('0x0')]={'name':{'type':Sequelize[_0x85df('0x1')],'get':function(_0x163802){return this[_0x85df('0x2')](_0x85df('0x3'));}},'field':{'type':Sequelize[_0x85df('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x85df('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x85df('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 55672a2..af7b6c4 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0xa47c2f,_0x59c03c){var _0x48635c=function(_0x22e448){while(--_0x22e448){_0xa47c2f['push'](_0xa47c2f['shift']());}};_0x48635c(++_0x59c03c);}(_0x7a54,0x106));var _0x47a5=function(_0x36f1a3,_0x486458){_0x36f1a3=_0x36f1a3-0x0;var _0x528949=_0x7a54[_0x36f1a3];return _0x528949;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x5de3cd,_0x1465fc){var _0x570274=function(_0x320586){while(--_0x320586){_0x5de3cd['push'](_0x5de3cd['shift']());}};_0x570274(++_0x1465fc);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 70adf36..fa309e9 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 _0x4e9f=['../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x35592d,_0x3ae801){var _0x44ac11=function(_0x296e99){while(--_0x296e99){_0x35592d['push'](_0x35592d['shift']());}};_0x44ac11(++_0x3ae801);}(_0x4e9f,0xc6));var _0xf4e9=function(_0x44a35b,_0x52ebb2){_0x44a35b=_0x44a35b-0x0;var _0x2d9f4e=_0x4e9f[_0x44a35b];return _0x2d9f4e;};'use strict';var _=require(_0xf4e9('0x0'));var util=require(_0xf4e9('0x1'));var logger=require(_0xf4e9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf4e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4e9('0x4'));var rimraf=require(_0xf4e9('0x5'));var config=require(_0xf4e9('0x6'));var attributes=require(_0xf4e9('0x7'));module[_0xf4e9('0x8')]=function(_0x4a9455,_0x572f6e){return _0x4a9455[_0xf4e9('0x9')](_0xf4e9('0xa'),attributes,{'tableName':_0xf4e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f7b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','lodash'];(function(_0x3df58d,_0x25f9dc){var _0x354ccb=function(_0x27e6d4){while(--_0x27e6d4){_0x3df58d['push'](_0x3df58d['shift']());}};_0x354ccb(++_0x25f9dc);}(_0x0f7b,0xe9));var _0xb0f7=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x0f7b[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0xb0f7('0x0'));var util=require(_0xb0f7('0x1'));var logger=require(_0xb0f7('0x2'))(_0xb0f7('0x3'));var moment=require(_0xb0f7('0x4'));var BPromise=require(_0xb0f7('0x5'));var rp=require(_0xb0f7('0x6'));var fs=require('fs');var path=require(_0xb0f7('0x7'));var rimraf=require(_0xb0f7('0x8'));var config=require('../../config/environment');var attributes=require(_0xb0f7('0x9'));module[_0xb0f7('0xa')]=function(_0x3e4f0f,_0x51442b){return _0x3e4f0f[_0xb0f7('0xb')](_0xb0f7('0xc'),attributes,{'tableName':'tools_conditions','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 e37ea3c..fc30c4b 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 _0x7d23=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x171900,_0xa1a88b){var _0x34ffbb=function(_0x567453){while(--_0x567453){_0x171900['push'](_0x171900['shift']());}};_0x34ffbb(++_0xa1a88b);}(_0x7d23,0xea));var _0x37d2=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7d23[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x37d2('0x0'));var util=require('util');var moment=require(_0x37d2('0x1'));var BPromise=require(_0x37d2('0x2'));var rs=require(_0x37d2('0x3'));var fs=require('fs');var Redis=require(_0x37d2('0x4'));var db=require(_0x37d2('0x5'))['db'];var utils=require(_0x37d2('0x6'));var logger=require(_0x37d2('0x7'))(_0x37d2('0x8'));var config=require('../../config/environment');var jayson=require(_0x37d2('0x9'));var client=jayson[_0x37d2('0xa')][_0x37d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x301a8e,_0x3b901a,_0x1c4d98){return new BPromise(function(_0x55214c,_0x1ae3d1){return client[_0x37d2('0xc')](_0x301a8e,_0x1c4d98)[_0x37d2('0xd')](function(_0x14b952){logger[_0x37d2('0xe')](_0x37d2('0xf'),_0x3b901a,'request\x20sent');logger[_0x37d2('0x10')](_0x37d2('0x11'),_0x3b901a,_0x37d2('0x12'),JSON[_0x37d2('0x13')](_0x14b952));if(_0x14b952['error']){if(_0x14b952[_0x37d2('0x14')][_0x37d2('0x15')]===0x1f4){logger[_0x37d2('0x14')](_0x37d2('0xf'),_0x3b901a,_0x14b952[_0x37d2('0x14')]['message']);return _0x1ae3d1(_0x14b952[_0x37d2('0x14')][_0x37d2('0x16')]);}logger[_0x37d2('0x14')](_0x37d2('0xf'),_0x3b901a,_0x14b952['error'][_0x37d2('0x16')]);return _0x55214c(_0x14b952[_0x37d2('0x14')][_0x37d2('0x16')]);}else{logger[_0x37d2('0xe')](_0x37d2('0xf'),_0x3b901a,_0x37d2('0x12'));_0x55214c(_0x14b952['result'][_0x37d2('0x16')]);}})[_0x37d2('0x17')](function(_0x5b90ab){logger[_0x37d2('0x14')](_0x37d2('0xf'),_0x3b901a,_0x5b90ab);_0x1ae3d1(_0x5b90ab);});});} \ No newline at end of file +var _0xe3bc=['info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1f737c,_0x4db00c){var _0x301e4b=function(_0x296589){while(--_0x296589){_0x1f737c['push'](_0x1f737c['shift']());}};_0x301e4b(++_0x4db00c);}(_0xe3bc,0x111));var _0xce3b=function(_0x5ec2de,_0x47b6e4){_0x5ec2de=_0x5ec2de-0x0;var _0xabfd75=_0xe3bc[_0x5ec2de];return _0xabfd75;};'use strict';var _=require('lodash');var util=require(_0xce3b('0x0'));var moment=require(_0xce3b('0x1'));var BPromise=require(_0xce3b('0x2'));var rs=require(_0xce3b('0x3'));var fs=require('fs');var Redis=require(_0xce3b('0x4'));var db=require(_0xce3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xce3b('0x6'))(_0xce3b('0x7'));var config=require('../../config/environment');var jayson=require(_0xce3b('0x8'));var client=jayson[_0xce3b('0x9')][_0xce3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40a50f,_0x4f64c6,_0x1c3a3b){return new BPromise(function(_0x521c6b,_0x2753c6){return client[_0xce3b('0xb')](_0x40a50f,_0x1c3a3b)[_0xce3b('0xc')](function(_0x421889){logger[_0xce3b('0xd')]('Condition,\x20%s,\x20%s',_0x4f64c6,_0xce3b('0xe'));logger[_0xce3b('0xf')](_0xce3b('0x10'),_0x4f64c6,_0xce3b('0xe'),JSON[_0xce3b('0x11')](_0x421889));if(_0x421889[_0xce3b('0x12')]){if(_0x421889[_0xce3b('0x12')][_0xce3b('0x13')]===0x1f4){logger[_0xce3b('0x12')](_0xce3b('0x14'),_0x4f64c6,_0x421889[_0xce3b('0x12')][_0xce3b('0x15')]);return _0x2753c6(_0x421889['error'][_0xce3b('0x15')]);}logger[_0xce3b('0x12')](_0xce3b('0x14'),_0x4f64c6,_0x421889[_0xce3b('0x12')][_0xce3b('0x15')]);return _0x521c6b(_0x421889['error'][_0xce3b('0x15')]);}else{logger[_0xce3b('0xd')](_0xce3b('0x14'),_0x4f64c6,_0xce3b('0xe'));_0x521c6b(_0x421889['result'][_0xce3b('0x15')]);}})['catch'](function(_0x40d0dd){logger[_0xce3b('0x12')](_0xce3b('0x14'),_0x4f64c6,_0x40d0dd);_0x2753c6(_0x40d0dd);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5d398a8..26d43e5 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 _0xc859=['../../config/environment','/:id','isAuthenticated','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x24c405,_0x56d6fb){var _0x383aef=function(_0x20da69){while(--_0x20da69){_0x24c405['push'](_0x24c405['shift']());}};_0x383aef(++_0x56d6fb);}(_0xc859,0x7d));var _0x9c85=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc859[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require('multer');var util=require(_0x9c85('0x0'));var path=require(_0x9c85('0x1'));var timeout=require(_0x9c85('0x2'));var express=require(_0x9c85('0x3'));var router=express[_0x9c85('0x4')]();var fs_extra=require(_0x9c85('0x5'));var auth=require(_0x9c85('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9c85('0x7'));var controller=require('./condition.controller');router['put'](_0x9c85('0x8'),auth[_0x9c85('0x9')](),controller['update']);router['delete'](_0x9c85('0x8'),auth[_0x9c85('0x9')](),controller[_0x9c85('0xa')]);module['exports']=router; \ No newline at end of file +var _0xffa5=['delete','isAuthenticated','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','update'];(function(_0x57a5b7,_0x4d5e36){var _0x1c11b3=function(_0x4a981a){while(--_0x4a981a){_0x57a5b7['push'](_0x57a5b7['shift']());}};_0x1c11b3(++_0x4d5e36);}(_0xffa5,0x1d4));var _0x5ffa=function(_0x1ed3e3,_0x53307e){_0x1ed3e3=_0x1ed3e3-0x0;var _0x5447f5=_0xffa5[_0x1ed3e3];return _0x5447f5;};'use strict';var multer=require(_0x5ffa('0x0'));var util=require(_0x5ffa('0x1'));var path=require(_0x5ffa('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ffa('0x3'));var router=express[_0x5ffa('0x4')]();var fs_extra=require(_0x5ffa('0x5'));var auth=require(_0x5ffa('0x6'));var interaction=require(_0x5ffa('0x7'));var config=require('../../config/environment');var controller=require(_0x5ffa('0x8'));router[_0x5ffa('0x9')](_0x5ffa('0xa'),auth['isAuthenticated'](),controller[_0x5ffa('0xb')]);router[_0x5ffa('0xc')](_0x5ffa('0xa'),auth[_0x5ffa('0xd')](),controller[_0x5ffa('0xe')]);module[_0x5ffa('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 07a44b0..781c643 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 _0x219f=['sequelize','exports','STRING','name','INTEGER'];(function(_0xf64e5,_0x4a3232){var _0x5f312c=function(_0x4d816c){while(--_0x4d816c){_0xf64e5['push'](_0xf64e5['shift']());}};_0x5f312c(++_0x4a3232);}(_0x219f,0xc3));var _0xf219=function(_0x136e1c,_0x5330fa){_0x136e1c=_0x136e1c-0x0;var _0x249703=_0x219f[_0x136e1c];return _0x249703;};'use strict';var Sequelize=require(_0xf219('0x0'));module[_0xf219('0x1')]={'name':{'type':Sequelize[_0xf219('0x2')],'allowNull':![],'unique':_0xf219('0x3')},'OrderBy':{'type':Sequelize[_0xf219('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xf219('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x220b=['name','INTEGER','exports','STRING'];(function(_0x4954e8,_0x4692e3){var _0x2fff1c=function(_0x370939){while(--_0x370939){_0x4954e8['push'](_0x4954e8['shift']());}};_0x2fff1c(++_0x4692e3);}(_0x220b,0x1a2));var _0xb220=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x220b[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require('sequelize');module[_0xb220('0x0')]={'name':{'type':Sequelize[_0xb220('0x1')],'allowNull':![],'unique':_0xb220('0x2')},'OrderBy':{'type':Sequelize[_0xb220('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 39816e2..1f87196 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 _0x8f4c=['merge','options','includeAll','include','rows','catch','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','ContactItemTypes','error','stack','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8f4c,0x113));var _0xc8f4=function(_0x37c219,_0x16d29c){_0x37c219=_0x37c219-0x0;var _0x52b594=_0x8f4c[_0x37c219];return _0x52b594;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){var _0x3782fd=_0x5d54a9['get']({'plain':!![]});var _0x177a44=_0xc8f4('0x26');return db['UserProfileResource'][_0xc8f4('0x25')]({'where':{'type':_0x177a44,'resourceId':_0x3782fd['id']}})[_0xc8f4('0x24')](function(){return _0x5d54a9;});})[_0xc8f4('0x24')](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db490,_0x3484b6){return function(_0x5db666){if(!_0x5db666){_0x3db490[_0xc8f4('0x17')](0x194);}return _0x5db666;};}function handleError(_0x37957c,_0x157ad5){_0x157ad5=_0x157ad5||0x1f4;return function(_0x1b70bc){logger[_0xc8f4('0x27')](_0x1b70bc[_0xc8f4('0x28')]);if(_0x1b70bc['name']){delete _0x1b70bc[_0xc8f4('0x29')];}_0x37957c[_0xc8f4('0x18')](_0x157ad5)[_0xc8f4('0x2a')](_0x1b70bc);};}exports['index']=function(_0xf4a556,_0x3a4b1b){var _0x5ab6cb={},_0x56ec4b={},_0x4d6c43={'count':0x0,'rows':[]};var _0x2717ff=_[_0xc8f4('0x2b')](db[_0xc8f4('0x2c')][_0xc8f4('0x2d')],function(_0x273e73){return{'name':_0x273e73[_0xc8f4('0x2e')],'type':_0x273e73[_0xc8f4('0x2f')][_0xc8f4('0x30')]};});_0x56ec4b['model']=_[_0xc8f4('0x2b')](_0x2717ff,_0xc8f4('0x29'));_0x56ec4b[_0xc8f4('0x31')]=_['keys'](_0xf4a556[_0xc8f4('0x31')]);_0x56ec4b[_0xc8f4('0x32')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],_0x56ec4b[_0xc8f4('0x31')]);_0x5ab6cb[_0xc8f4('0x34')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0xf4a556[_0xc8f4('0x31')]['fields']));_0x5ab6cb[_0xc8f4('0x34')]=_0x5ab6cb[_0xc8f4('0x34')][_0xc8f4('0x36')]?_0x5ab6cb[_0xc8f4('0x34')]:_0x56ec4b[_0xc8f4('0x33')];if(!_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0x5ab6cb[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0x5ab6cb[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1d')]);}_0x5ab6cb['order']=qs[_0xc8f4('0x39')](_0xf4a556['query'][_0xc8f4('0x39')]);_0x5ab6cb['where']=qs[_0xc8f4('0x32')](_[_0xc8f4('0x3a')](_0xf4a556[_0xc8f4('0x31')],_0x56ec4b[_0xc8f4('0x32')]),_0x2717ff);if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]){_0x5ab6cb[_0xc8f4('0x3c')]=_['merge'](_0x5ab6cb[_0xc8f4('0x3c')],{'$or':_[_0xc8f4('0x2b')](_0x2717ff,function(_0x3963f4){if(_0x3963f4[_0xc8f4('0x2f')]!=='VIRTUAL'){var _0x172836={};_0x172836[_0x3963f4[_0xc8f4('0x29')]]={'$like':'%'+_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x172836;}})});}_0x5ab6cb=_[_0xc8f4('0x3d')]({},_0x5ab6cb,_0xf4a556[_0xc8f4('0x3e')]);var _0xca3cc={'where':_0x5ab6cb[_0xc8f4('0x3c')]};return db[_0xc8f4('0x2c')][_0xc8f4('0x1c')](_0xca3cc)[_0xc8f4('0x24')](function(_0xd56415){_0x4d6c43['count']=_0xd56415;if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x5ab6cb[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x2c')]['findAll'](_0x5ab6cb);})['then'](function(_0x413a55){_0x4d6c43[_0xc8f4('0x41')]=_0x413a55;return _0x4d6c43;})['then'](respondWithFilteredResult(_0x3a4b1b,_0x5ab6cb))[_0xc8f4('0x42')](handleError(_0x3a4b1b,null));};exports[_0xc8f4('0x43')]=function(_0x530b69,_0x5a85bb){var _0x3c8569={'raw':!![],'where':{'id':_0x530b69[_0xc8f4('0x44')]['id']}},_0x342c28={};_0x342c28[_0xc8f4('0x33')]=_[_0xc8f4('0x45')](db[_0xc8f4('0x2c')]['rawAttributes']);_0x342c28['query']=_[_0xc8f4('0x45')](_0x530b69[_0xc8f4('0x31')]);_0x342c28[_0xc8f4('0x32')]=_['intersection'](_0x342c28['model'],_0x342c28['query']);_0x3c8569['attributes']=_['intersection'](_0x342c28[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0x530b69[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x3c8569[_0xc8f4('0x34')]=_0x3c8569[_0xc8f4('0x34')]['length']?_0x3c8569[_0xc8f4('0x34')]:_0x342c28[_0xc8f4('0x33')];if(_0x530b69['query']['includeAll']){_0x3c8569[_0xc8f4('0x40')]=[{'all':!![]}];}_0x3c8569=_[_0xc8f4('0x3d')]({},_0x3c8569,_0x530b69[_0xc8f4('0x3e')]);return db[_0xc8f4('0x2c')]['find'](_0x3c8569)['then'](handleEntityNotFound(_0x5a85bb,null))[_0xc8f4('0x24')](respondWithResult(_0x5a85bb,null))[_0xc8f4('0x42')](handleError(_0x5a85bb,null));};exports[_0xc8f4('0x46')]=function(_0x2bc4db,_0x141f81){return db[_0xc8f4('0x2c')]['create'](_0x2bc4db['body'],{})[_0xc8f4('0x24')](function(_0x447473){var _0x199b7d=_0x2bc4db[_0xc8f4('0x47')][_0xc8f4('0x48')]({'plain':!![]});if(!_0x199b7d)throw new Error(_0xc8f4('0x49'));if(_0x199b7d[_0xc8f4('0x4a')]===_0xc8f4('0x47')){var _0x3d9d67=_0x447473['get']({'plain':!![]});var _0x5c7768=_0xc8f4('0x26');return db[_0xc8f4('0x4b')][_0xc8f4('0x4c')]({'where':{'name':_0x5c7768,'userProfileId':_0x199b7d[_0xc8f4('0x4d')]},'raw':!![]})[_0xc8f4('0x24')](function(_0x165aac){if(_0x165aac&&_0x165aac[_0xc8f4('0x4e')]===0x0){return db[_0xc8f4('0x4f')][_0xc8f4('0x46')]({'name':_0x3d9d67[_0xc8f4('0x29')],'resourceId':_0x3d9d67['id'],'type':_0x165aac[_0xc8f4('0x29')],'sectionId':_0x165aac['id']},{})[_0xc8f4('0x24')](function(){return _0x447473;});}else{return _0x447473;}})[_0xc8f4('0x42')](function(_0x4ec67d){logger[_0xc8f4('0x27')](_0xc8f4('0x50'),_0x4ec67d);throw _0x4ec67d;});}return _0x447473;})[_0xc8f4('0x24')](respondWithResult(_0x141f81,0xc9))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports['update']=function(_0xd6052d,_0x450059){if(_0xd6052d['body']['id']){delete _0xd6052d['body']['id'];}return db[_0xc8f4('0x2c')]['find']({'where':{'id':_0xd6052d[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x450059,null))[_0xc8f4('0x24')](saveUpdates(_0xd6052d[_0xc8f4('0x51')],null))[_0xc8f4('0x24')](respondWithResult(_0x450059,null))[_0xc8f4('0x42')](handleError(_0x450059,null));};exports[_0xc8f4('0x25')]=function(_0x1f7602,_0x172c77){return db[_0xc8f4('0x2c')][_0xc8f4('0x4c')]({'where':{'id':_0x1f7602['params']['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x172c77,null))[_0xc8f4('0x24')](db[_0xc8f4('0x52')][_0xc8f4('0x53')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1f7602['params']['id']}}))[_0xc8f4('0x24')](removeEntity(_0x172c77,null))['catch'](handleError(_0x172c77,null));}; \ No newline at end of file +var _0x4e2e=['include','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','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','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','get','ContactItemTypes','UserProfileResource','error','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x2f7100,_0x50a6e7){var _0x911524=function(_0x1d49ab){while(--_0x1d49ab){_0x2f7100['push'](_0x2f7100['shift']());}};_0x911524(++_0x50a6e7);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x4efaec,_0x43fdfd){_0x4efaec=_0x4efaec-0x0;var _0x5c0164=_0x4e2e[_0x4efaec];return _0x5c0164;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];function respondWithStatusCode(_0x20d34e,_0x19c6ef){_0x19c6ef=_0x19c6ef||0xcc;return function(_0x13657c){if(_0x13657c){return _0x20d34e['sendStatus'](_0x19c6ef);}return _0x20d34e[_0xe4e2('0x1a')](_0x19c6ef)[_0xe4e2('0x1b')]();};}function respondWithResult(_0xb45217,_0x4e0bc2){_0x4e0bc2=_0x4e0bc2||0xc8;return function(_0x202486){if(_0x202486){return _0xb45217['status'](_0x4e0bc2)['json'](_0x202486);}};}function respondWithFilteredResult(_0x117a2a,_0x2d2018){return function(_0x1f9b2d){if(_0x1f9b2d){var _0x28ee12=typeof _0x2d2018[_0xe4e2('0x1c')]==='undefined'&&typeof _0x2d2018[_0xe4e2('0x1d')]===_0xe4e2('0x1e');var _0x340935=_0x1f9b2d['count'];var _0x196f16=_0x28ee12?0x0:_0x2d2018['offset'];var _0x1d5e9d=_0x28ee12?_0x1f9b2d[_0xe4e2('0x1f')]:_0x2d2018[_0xe4e2('0x1c')]+_0x2d2018[_0xe4e2('0x1d')];var _0x3dfbdf;if(_0x1d5e9d>=_0x340935){_0x1d5e9d=_0x340935;_0x3dfbdf=0xc8;}else{_0x3dfbdf=0xce;}_0x117a2a[_0xe4e2('0x1a')](_0x3dfbdf);return _0x117a2a[_0xe4e2('0x20')](_0xe4e2('0x21'),_0x196f16+'-'+_0x1d5e9d+'/'+_0x340935)[_0xe4e2('0x22')](_0x1f9b2d);}return null;};}function patchUpdates(_0x362741){return function(_0x5a84c5){try{jsonpatch[_0xe4e2('0x23')](_0x5a84c5,_0x362741,!![]);}catch(_0x2e7ecd){return BPromise[_0xe4e2('0x24')](_0x2e7ecd);}return _0x5a84c5[_0xe4e2('0x25')]();};}function saveUpdates(_0xbdf1ad,_0x23b466){return function(_0x16f14b){if(_0x16f14b){return _0x16f14b['update'](_0xbdf1ad)[_0xe4e2('0x26')](function(_0x2ab435){return _0x2ab435;});}return null;};}function removeEntity(_0x2088b9,_0x5373c0){return function(_0x353030){if(_0x353030){return _0x353030[_0xe4e2('0x27')]()['then'](function(){var _0xcba85a=_0x353030[_0xe4e2('0x28')]({'plain':!![]});var _0x29143c=_0xe4e2('0x29');return db[_0xe4e2('0x2a')]['destroy']({'where':{'type':_0x29143c,'resourceId':_0xcba85a['id']}})[_0xe4e2('0x26')](function(){return _0x353030;});})[_0xe4e2('0x26')](function(){_0x2088b9[_0xe4e2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a31b8,_0x41cfd9){return function(_0x31f651){if(!_0x31f651){_0x3a31b8['sendStatus'](0x194);}return _0x31f651;};}function handleError(_0x2e5a65,_0x50b4d9){_0x50b4d9=_0x50b4d9||0x1f4;return function(_0x477b5c){logger[_0xe4e2('0x2b')](_0x477b5c['stack']);if(_0x477b5c[_0xe4e2('0x2c')]){delete _0x477b5c[_0xe4e2('0x2c')];}_0x2e5a65[_0xe4e2('0x1a')](_0x50b4d9)[_0xe4e2('0x2d')](_0x477b5c);};}exports[_0xe4e2('0x2e')]=function(_0x4d33de,_0x5f30dc){var _0x2cb235={},_0x2fe075={},_0x12848d={'count':0x0,'rows':[]};var _0x26fb97=_[_0xe4e2('0x2f')](db[_0xe4e2('0x30')][_0xe4e2('0x31')],function(_0x40569e){return{'name':_0x40569e[_0xe4e2('0x32')],'type':_0x40569e[_0xe4e2('0x33')][_0xe4e2('0x34')]};});_0x2fe075[_0xe4e2('0x35')]=_['map'](_0x26fb97,_0xe4e2('0x2c'));_0x2fe075[_0xe4e2('0x36')]=_[_0xe4e2('0x37')](_0x4d33de[_0xe4e2('0x36')]);_0x2fe075[_0xe4e2('0x38')]=_[_0xe4e2('0x39')](_0x2fe075['model'],_0x2fe075[_0xe4e2('0x36')]);_0x2cb235[_0xe4e2('0x3a')]=_[_0xe4e2('0x39')](_0x2fe075[_0xe4e2('0x35')],qs[_0xe4e2('0x3b')](_0x4d33de[_0xe4e2('0x36')][_0xe4e2('0x3b')]));_0x2cb235[_0xe4e2('0x3a')]=_0x2cb235[_0xe4e2('0x3a')][_0xe4e2('0x3c')]?_0x2cb235[_0xe4e2('0x3a')]:_0x2fe075['model'];if(!_0x4d33de[_0xe4e2('0x36')]['hasOwnProperty'](_0xe4e2('0x3d'))){_0x2cb235[_0xe4e2('0x1d')]=qs['limit'](_0x4d33de[_0xe4e2('0x36')][_0xe4e2('0x1d')]);_0x2cb235[_0xe4e2('0x1c')]=qs[_0xe4e2('0x1c')](_0x4d33de['query'][_0xe4e2('0x1c')]);}_0x2cb235['order']=qs[_0xe4e2('0x3e')](_0x4d33de['query'][_0xe4e2('0x3e')]);_0x2cb235[_0xe4e2('0x3f')]=qs[_0xe4e2('0x38')](_['pick'](_0x4d33de[_0xe4e2('0x36')],_0x2fe075[_0xe4e2('0x38')]),_0x26fb97);if(_0x4d33de['query'][_0xe4e2('0x40')]){_0x2cb235[_0xe4e2('0x3f')]=_[_0xe4e2('0x41')](_0x2cb235[_0xe4e2('0x3f')],{'$or':_[_0xe4e2('0x2f')](_0x26fb97,function(_0x242435){if(_0x242435[_0xe4e2('0x33')]!==_0xe4e2('0x42')){var _0xc07ff5={};_0xc07ff5[_0x242435['name']]={'$like':'%'+_0x4d33de['query'][_0xe4e2('0x40')]+'%'};return _0xc07ff5;}})});}_0x2cb235=_[_0xe4e2('0x41')]({},_0x2cb235,_0x4d33de[_0xe4e2('0x43')]);var _0x3e1ae5={'where':_0x2cb235['where']};return db['ContactItemType'][_0xe4e2('0x1f')](_0x3e1ae5)[_0xe4e2('0x26')](function(_0x3080d5){_0x12848d[_0xe4e2('0x1f')]=_0x3080d5;if(_0x4d33de['query'][_0xe4e2('0x44')]){_0x2cb235[_0xe4e2('0x45')]=[{'all':!![]}];}return db[_0xe4e2('0x30')]['findAll'](_0x2cb235);})[_0xe4e2('0x26')](function(_0x4789cf){_0x12848d[_0xe4e2('0x46')]=_0x4789cf;return _0x12848d;})[_0xe4e2('0x26')](respondWithFilteredResult(_0x5f30dc,_0x2cb235))['catch'](handleError(_0x5f30dc,null));};exports['show']=function(_0x41f16c,_0x87eb2d){var _0x39fff5={'raw':!![],'where':{'id':_0x41f16c[_0xe4e2('0x47')]['id']}},_0x5c29c3={};_0x5c29c3[_0xe4e2('0x35')]=_['keys'](db[_0xe4e2('0x30')][_0xe4e2('0x31')]);_0x5c29c3[_0xe4e2('0x36')]=_[_0xe4e2('0x37')](_0x41f16c[_0xe4e2('0x36')]);_0x5c29c3[_0xe4e2('0x38')]=_[_0xe4e2('0x39')](_0x5c29c3[_0xe4e2('0x35')],_0x5c29c3['query']);_0x39fff5[_0xe4e2('0x3a')]=_[_0xe4e2('0x39')](_0x5c29c3['model'],qs['fields'](_0x41f16c[_0xe4e2('0x36')][_0xe4e2('0x3b')]));_0x39fff5[_0xe4e2('0x3a')]=_0x39fff5['attributes'][_0xe4e2('0x3c')]?_0x39fff5[_0xe4e2('0x3a')]:_0x5c29c3[_0xe4e2('0x35')];if(_0x41f16c[_0xe4e2('0x36')]['includeAll']){_0x39fff5[_0xe4e2('0x45')]=[{'all':!![]}];}_0x39fff5=_[_0xe4e2('0x41')]({},_0x39fff5,_0x41f16c[_0xe4e2('0x43')]);return db[_0xe4e2('0x30')]['find'](_0x39fff5)[_0xe4e2('0x26')](handleEntityNotFound(_0x87eb2d,null))[_0xe4e2('0x26')](respondWithResult(_0x87eb2d,null))['catch'](handleError(_0x87eb2d,null));};exports[_0xe4e2('0x48')]=function(_0xedcd86,_0x21e5d7){return db['ContactItemType'][_0xe4e2('0x48')](_0xedcd86[_0xe4e2('0x49')],{})[_0xe4e2('0x26')](function(_0x599978){var _0x5edd7e=_0xedcd86[_0xe4e2('0x4a')]['get']({'plain':!![]});if(!_0x5edd7e)throw new Error(_0xe4e2('0x4b'));if(_0x5edd7e['role']===_0xe4e2('0x4a')){var _0x2125df=_0x599978[_0xe4e2('0x28')]({'plain':!![]});var _0x553817=_0xe4e2('0x29');return db['UserProfileSection'][_0xe4e2('0x4c')]({'where':{'name':_0x553817,'userProfileId':_0x5edd7e[_0xe4e2('0x4d')]},'raw':!![]})['then'](function(_0x9d00fb){if(_0x9d00fb&&_0x9d00fb['autoAssociation']===0x0){return db[_0xe4e2('0x2a')][_0xe4e2('0x48')]({'name':_0x2125df['name'],'resourceId':_0x2125df['id'],'type':_0x9d00fb[_0xe4e2('0x2c')],'sectionId':_0x9d00fb['id']},{})[_0xe4e2('0x26')](function(){return _0x599978;});}else{return _0x599978;}})[_0xe4e2('0x4e')](function(_0x3e540d){logger[_0xe4e2('0x2b')](_0xe4e2('0x4f'),_0x3e540d);throw _0x3e540d;});}return _0x599978;})[_0xe4e2('0x26')](respondWithResult(_0x21e5d7,0xc9))[_0xe4e2('0x4e')](handleError(_0x21e5d7,null));};exports[_0xe4e2('0x50')]=function(_0x503b77,_0x3e65df){if(_0x503b77[_0xe4e2('0x49')]['id']){delete _0x503b77[_0xe4e2('0x49')]['id'];}return db[_0xe4e2('0x30')][_0xe4e2('0x4c')]({'where':{'id':_0x503b77[_0xe4e2('0x47')]['id']}})[_0xe4e2('0x26')](handleEntityNotFound(_0x3e65df,null))[_0xe4e2('0x26')](saveUpdates(_0x503b77[_0xe4e2('0x49')],null))[_0xe4e2('0x26')](respondWithResult(_0x3e65df,null))[_0xe4e2('0x4e')](handleError(_0x3e65df,null));};exports['destroy']=function(_0x17a350,_0x435ae0){return db[_0xe4e2('0x30')][_0xe4e2('0x4c')]({'where':{'id':_0x17a350['params']['id']}})[_0xe4e2('0x26')](handleEntityNotFound(_0x435ae0,null))[_0xe4e2('0x26')](db['CmContactHasItem'][_0xe4e2('0x50')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x17a350[_0xe4e2('0x47')]['id']}}))[_0xe4e2('0x26')](removeEntity(_0x435ae0,null))[_0xe4e2('0x4e')](handleError(_0x435ae0,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 9c9a33f..a762194 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 _0xfd1e=['define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports'];(function(_0x257352,_0x241c46){var _0x6737c=function(_0x40055c){while(--_0x40055c){_0x257352['push'](_0x257352['shift']());}};_0x6737c(++_0x241c46);}(_0xfd1e,0x92));var _0xefd1=function(_0xb40a82,_0x44f625){_0xb40a82=_0xb40a82-0x0;var _0x22807f=_0xfd1e[_0xb40a82];return _0x22807f;};'use strict';var _=require(_0xefd1('0x0'));var util=require(_0xefd1('0x1'));var logger=require(_0xefd1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xefd1('0x3'));var rp=require(_0xefd1('0x4'));var fs=require('fs');var path=require(_0xefd1('0x5'));var rimraf=require(_0xefd1('0x6'));var config=require(_0xefd1('0x7'));var attributes=require(_0xefd1('0x8'));module[_0xefd1('0x9')]=function(_0x18d66b,_0x325406){return _0x18d66b[_0xefd1('0xa')](_0xefd1('0xb'),attributes,{'tableName':_0xefd1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23e4=['bluebird','request-promise','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','api','moment'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x23e4,0x13b));var _0x423e=function(_0x58480a,_0x27bcb2){_0x58480a=_0x58480a-0x0;var _0x1fb159=_0x23e4[_0x58480a];return _0x1fb159;};'use strict';var _=require(_0x423e('0x0'));var util=require(_0x423e('0x1'));var logger=require('../../config/logger')(_0x423e('0x2'));var moment=require(_0x423e('0x3'));var BPromise=require(_0x423e('0x4'));var rp=require(_0x423e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x423e('0x6'));module[_0x423e('0x7')]=function(_0xd3ae92,_0x152739){return _0xd3ae92[_0x423e('0x8')](_0x423e('0x9'),attributes,{'tableName':_0x423e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 2a4438d..1439f9c 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 _0x2cb0=['../../config/environment','jayson/promise','client','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x2cb0,0x12c));var _0x02cb=function(_0x1bbdca,_0x2efe61){_0x1bbdca=_0x1bbdca-0x0;var _0xcbd55=_0x2cb0[_0x1bbdca];return _0xcbd55;};'use strict';var _=require(_0x02cb('0x0'));var util=require(_0x02cb('0x1'));var moment=require('moment');var BPromise=require(_0x02cb('0x2'));var rs=require(_0x02cb('0x3'));var fs=require('fs');var Redis=require(_0x02cb('0x4'));var db=require(_0x02cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02cb('0x6'))(_0x02cb('0x7'));var config=require(_0x02cb('0x8'));var jayson=require(_0x02cb('0x9'));var client=jayson[_0x02cb('0xa')][_0x02cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x291240,_0x19713d,_0x5afd2a){return new BPromise(function(_0x175b98,_0x294182){return client[_0x02cb('0xc')](_0x291240,_0x5afd2a)[_0x02cb('0xd')](function(_0xcdfc87){logger['info'](_0x02cb('0xe'),_0x19713d,_0x02cb('0xf'));logger[_0x02cb('0x10')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x19713d,_0x02cb('0xf'),JSON[_0x02cb('0x11')](_0xcdfc87));if(_0xcdfc87[_0x02cb('0x12')]){if(_0xcdfc87[_0x02cb('0x12')]['code']===0x1f4){logger[_0x02cb('0x12')](_0x02cb('0xe'),_0x19713d,_0xcdfc87[_0x02cb('0x12')][_0x02cb('0x13')]);return _0x294182(_0xcdfc87[_0x02cb('0x12')][_0x02cb('0x13')]);}logger['error'](_0x02cb('0xe'),_0x19713d,_0xcdfc87[_0x02cb('0x12')][_0x02cb('0x13')]);return _0x175b98(_0xcdfc87['error'][_0x02cb('0x13')]);}else{logger[_0x02cb('0x14')](_0x02cb('0xe'),_0x19713d,_0x02cb('0xf'));_0x175b98(_0xcdfc87[_0x02cb('0x15')]['message']);}})['catch'](function(_0x30f8c6){logger[_0x02cb('0x12')](_0x02cb('0xe'),_0x19713d,_0x30f8c6);_0x294182(_0x30f8c6);});});} \ No newline at end of file +var _0xdb21=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48535c,_0x33c086){var _0x2cf084=function(_0x3a1896){while(--_0x3a1896){_0x48535c['push'](_0x48535c['shift']());}};_0x2cf084(++_0x33c086);}(_0xdb21,0xcd));var _0x1db2=function(_0x519380,_0x7f196){_0x519380=_0x519380-0x0;var _0x60ba2c=_0xdb21[_0x519380];return _0x60ba2c;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var moment=require('moment');var BPromise=require(_0x1db2('0x2'));var rs=require(_0x1db2('0x3'));var fs=require('fs');var Redis=require(_0x1db2('0x4'));var db=require(_0x1db2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1db2('0x6'))(_0x1db2('0x7'));var config=require(_0x1db2('0x8'));var jayson=require(_0x1db2('0x9'));var client=jayson[_0x1db2('0xa')][_0x1db2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2091b4,_0x1d210b,_0x6285ab){return new BPromise(function(_0x55af3a,_0x32d875){return client[_0x1db2('0xc')](_0x2091b4,_0x6285ab)[_0x1db2('0xd')](function(_0x4c4834){logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x1d210b,_0x1db2('0x10'));logger[_0x1db2('0x11')](_0x1db2('0x12'),_0x1d210b,_0x1db2('0x10'),JSON[_0x1db2('0x13')](_0x4c4834));if(_0x4c4834[_0x1db2('0x14')]){if(_0x4c4834['error'][_0x1db2('0x15')]===0x1f4){logger[_0x1db2('0x14')](_0x1db2('0xf'),_0x1d210b,_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);return _0x32d875(_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);}logger['error'](_0x1db2('0xf'),_0x1d210b,_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);return _0x55af3a(_0x4c4834[_0x1db2('0x14')][_0x1db2('0x16')]);}else{logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x1d210b,_0x1db2('0x10'));_0x55af3a(_0x4c4834[_0x1db2('0x17')][_0x1db2('0x16')]);}})[_0x1db2('0x18')](function(_0xf3aec0){logger['error'](_0x1db2('0xf'),_0x1d210b,_0xf3aec0);_0x32d875(_0xf3aec0);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 3805cfa..aeab410 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 _0x5291=['put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create'];(function(_0xa626be,_0x542d5f){var _0x1b68ab=function(_0x34c963){while(--_0x34c963){_0xa626be['push'](_0xa626be['shift']());}};_0x1b68ab(++_0x542d5f);}(_0x5291,0xaf));var _0x1529=function(_0x1e9abe,_0x4983cc){_0x1e9abe=_0x1e9abe-0x0;var _0x4727db=_0x5291[_0x1e9abe];return _0x4727db;};'use strict';var multer=require(_0x1529('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1529('0x1'));var express=require(_0x1529('0x2'));var router=express['Router']();var fs_extra=require(_0x1529('0x3'));var auth=require(_0x1529('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1529('0x5'));var controller=require('./contactItemType.controller');router[_0x1529('0x6')]('/',auth[_0x1529('0x7')](),controller[_0x1529('0x8')]);router[_0x1529('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x1529('0x9')]);router[_0x1529('0xa')]('/',auth[_0x1529('0x7')](),controller[_0x1529('0xb')]);router[_0x1529('0xc')]('/:id',auth[_0x1529('0x7')](),controller[_0x1529('0xd')]);router[_0x1529('0xe')]('/:id',auth[_0x1529('0x7')](),controller[_0x1529('0xf')]);module[_0x1529('0x10')]=router; \ No newline at end of file +var _0x0512=['post','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','isAuthenticated','index','/:id','show'];(function(_0x714b9d,_0x2492e9){var _0x6eb82a=function(_0x1607d3){while(--_0x1607d3){_0x714b9d['push'](_0x714b9d['shift']());}};_0x6eb82a(++_0x2492e9);}(_0x0512,0xe4));var _0x2051=function(_0xb0d919,_0xaf3555){_0xb0d919=_0xb0d919-0x0;var _0x20cd14=_0x0512[_0xb0d919];return _0x20cd14;};'use strict';var multer=require(_0x2051('0x0'));var util=require('util');var path=require(_0x2051('0x1'));var timeout=require(_0x2051('0x2'));var express=require('express');var router=express[_0x2051('0x3')]();var fs_extra=require(_0x2051('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2051('0x5'));var config=require(_0x2051('0x6'));var controller=require(_0x2051('0x7'));router['get']('/',auth[_0x2051('0x8')](),controller[_0x2051('0x9')]);router['get'](_0x2051('0xa'),auth[_0x2051('0x8')](),controller[_0x2051('0xb')]);router[_0x2051('0xc')]('/',auth[_0x2051('0x8')](),controller['create']);router[_0x2051('0xd')]('/:id',auth[_0x2051('0x8')](),controller[_0x2051('0xe')]);router['delete'](_0x2051('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x2051('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 9961c79..89b2875 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 _0x0713=['STRING','name'];(function(_0x14a8c4,_0x3ff392){var _0x3e3a53=function(_0x5a8efb){while(--_0x5a8efb){_0x14a8c4['push'](_0x14a8c4['shift']());}};_0x3e3a53(++_0x3ff392);}(_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 _0xe706=['STRING','sequelize','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe706,0xa3));var _0x6e70=function(_0x529351,_0x3ac704){_0x529351=_0x529351-0x0;var _0x41cd56=_0xe706[_0x529351];return _0x41cd56;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 1b20e96..1518116 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 _0x3c10=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','nolimit','rimraf','bluebird','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','get','CustomDashboards','destroy','then','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','sort','where','filters','filter','merge','VIRTUAL','options','Dashboard','include','findAll','rows','show','params','intersection','includeAll'];(function(_0x5be432,_0x59d680){var _0x651bb3=function(_0x5a62e7){while(--_0x5a62e7){_0x5be432['push'](_0x5be432['shift']());}};_0x651bb3(++_0x59d680);}(_0x3c10,0xab));var _0x03c1=function(_0x2058e4,_0x353116){_0x2058e4=_0x2058e4-0x0;var _0x3be03c=_0x3c10[_0x2058e4];return _0x3be03c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03c1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x03c1('0x1'));var Mustache=require('mustache');var util=require(_0x03c1('0x2'));var path=require(_0x03c1('0x3'));var sox=require('sox');var csv=require(_0x03c1('0x4'));var ejs=require(_0x03c1('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03c1('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x03c1('0x7'));var toCsv=require(_0x03c1('0x4'));var querystring=require(_0x03c1('0x8'));var Papa=require(_0x03c1('0x9'));var Redis=require(_0x03c1('0xa'));var authService=require(_0x03c1('0xb'));var qs=require(_0x03c1('0xc'));var as=require(_0x03c1('0xd'));var hardwareService=require(_0x03c1('0xe'));var logger=require('../../config/logger')(_0x03c1('0xf'));var utils=require('../../config/utils');var config=require(_0x03c1('0x10'));var licenseUtil=require(_0x03c1('0x11'));var db=require(_0x03c1('0x12'))['db'];config[_0x03c1('0x13')]=_[_0x03c1('0x14')](config['redis'],{'host':_0x03c1('0x15'),'port':0x18eb});var socket=require(_0x03c1('0x16'))(new Redis(config[_0x03c1('0x13')]));require('./dashboard.socket')[_0x03c1('0x17')](socket);function respondWithStatusCode(_0x4a2db7,_0x3a3547){_0x3a3547=_0x3a3547||0xcc;return function(_0x303170){if(_0x303170){return _0x4a2db7[_0x03c1('0x18')](_0x3a3547);}return _0x4a2db7[_0x03c1('0x19')](_0x3a3547)[_0x03c1('0x1a')]();};}function respondWithResult(_0x267257,_0x48807b){_0x48807b=_0x48807b||0xc8;return function(_0x45accf){if(_0x45accf){return _0x267257[_0x03c1('0x19')](_0x48807b)['json'](_0x45accf);}};}function respondWithFilteredResult(_0x5d3096,_0x10d73e){return function(_0x3d046e){if(_0x3d046e){var _0x4ea33c=typeof _0x10d73e[_0x03c1('0x1b')]==='undefined'&&typeof _0x10d73e[_0x03c1('0x1c')]===_0x03c1('0x1d');var _0x18e6a0=_0x3d046e['count'];var _0x20e8c0=_0x4ea33c?0x0:_0x10d73e[_0x03c1('0x1b')];var _0x6b7e79=_0x4ea33c?_0x3d046e[_0x03c1('0x1e')]:_0x10d73e[_0x03c1('0x1b')]+_0x10d73e[_0x03c1('0x1c')];var _0x28a4e2;if(_0x6b7e79>=_0x18e6a0){_0x6b7e79=_0x18e6a0;_0x28a4e2=0xc8;}else{_0x28a4e2=0xce;}_0x5d3096[_0x03c1('0x19')](_0x28a4e2);return _0x5d3096['set'](_0x03c1('0x1f'),_0x20e8c0+'-'+_0x6b7e79+'/'+_0x18e6a0)[_0x03c1('0x20')](_0x3d046e);}return null;};}function patchUpdates(_0xce06fc){return function(_0x43318a){try{jsonpatch[_0x03c1('0x21')](_0x43318a,_0xce06fc,!![]);}catch(_0x262a8e){return BPromise[_0x03c1('0x22')](_0x262a8e);}return _0x43318a[_0x03c1('0x23')]();};}function saveUpdates(_0x2fe4a7,_0x53d005){return function(_0x2bbae9){if(_0x2bbae9){return _0x2bbae9[_0x03c1('0x24')](_0x2fe4a7)['then'](function(_0x32fde6){return _0x32fde6;});}return null;};}function removeEntity(_0x3a40d2,_0x386237){return function(_0x57fd28){if(_0x57fd28){return _0x57fd28['destroy']()['then'](function(){var _0x3038f6=_0x57fd28[_0x03c1('0x25')]({'plain':!![]});var _0x1a26f=_0x03c1('0x26');return db['UserProfileResource'][_0x03c1('0x27')]({'where':{'type':_0x1a26f,'resourceId':_0x3038f6['id']}})[_0x03c1('0x28')](function(){return _0x57fd28;});})['then'](function(){_0x3a40d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c738,_0x29087c){return function(_0x3d8ab0){if(!_0x3d8ab0){_0x50c738[_0x03c1('0x18')](0x194);}return _0x3d8ab0;};}function handleError(_0x3229b1,_0x4d185c){_0x4d185c=_0x4d185c||0x1f4;return function(_0x5f6fe){logger['error'](_0x5f6fe['stack']);if(_0x5f6fe['name']){delete _0x5f6fe[_0x03c1('0x29')];}_0x3229b1[_0x03c1('0x19')](_0x4d185c)['send'](_0x5f6fe);};}exports[_0x03c1('0x2a')]=function(_0x1cde6d,_0x40a794){var _0x4a8655={},_0xe97416={},_0x52e85f={'count':0x0,'rows':[]};var _0x2a11c0=_[_0x03c1('0x2b')](db['Dashboard'][_0x03c1('0x2c')],function(_0x51bf6c){return{'name':_0x51bf6c[_0x03c1('0x2d')],'type':_0x51bf6c[_0x03c1('0x2e')][_0x03c1('0x2f')]};});_0xe97416[_0x03c1('0x30')]=_['map'](_0x2a11c0,'name');_0xe97416[_0x03c1('0x31')]=_[_0x03c1('0x32')](_0x1cde6d[_0x03c1('0x31')]);_0xe97416['filters']=_['intersection'](_0xe97416['model'],_0xe97416[_0x03c1('0x31')]);_0x4a8655[_0x03c1('0x33')]=_['intersection'](_0xe97416[_0x03c1('0x30')],qs['fields'](_0x1cde6d[_0x03c1('0x31')][_0x03c1('0x34')]));_0x4a8655[_0x03c1('0x33')]=_0x4a8655[_0x03c1('0x33')][_0x03c1('0x35')]?_0x4a8655[_0x03c1('0x33')]:_0xe97416[_0x03c1('0x30')];if(!_0x1cde6d['query']['hasOwnProperty']('nolimit')){_0x4a8655[_0x03c1('0x1c')]=qs[_0x03c1('0x1c')](_0x1cde6d['query'][_0x03c1('0x1c')]);_0x4a8655[_0x03c1('0x1b')]=qs['offset'](_0x1cde6d['query']['offset']);}_0x4a8655['order']=qs[_0x03c1('0x36')](_0x1cde6d[_0x03c1('0x31')][_0x03c1('0x36')]);_0x4a8655[_0x03c1('0x37')]=qs[_0x03c1('0x38')](_['pick'](_0x1cde6d[_0x03c1('0x31')],_0xe97416[_0x03c1('0x38')]),_0x2a11c0);if(_0x1cde6d[_0x03c1('0x31')][_0x03c1('0x39')]){_0x4a8655['where']=_[_0x03c1('0x3a')](_0x4a8655['where'],{'$or':_['map'](_0x2a11c0,function(_0x3c9ef1){if(_0x3c9ef1[_0x03c1('0x2e')]!==_0x03c1('0x3b')){var _0x22a579={};_0x22a579[_0x3c9ef1[_0x03c1('0x29')]]={'$like':'%'+_0x1cde6d[_0x03c1('0x31')][_0x03c1('0x39')]+'%'};return _0x22a579;}})});}_0x4a8655=_[_0x03c1('0x3a')]({},_0x4a8655,_0x1cde6d[_0x03c1('0x3c')]);var _0x345af1={'where':_0x4a8655[_0x03c1('0x37')]};return db[_0x03c1('0x3d')][_0x03c1('0x1e')](_0x345af1)[_0x03c1('0x28')](function(_0x3dbde3){_0x52e85f[_0x03c1('0x1e')]=_0x3dbde3;if(_0x1cde6d[_0x03c1('0x31')]['includeAll']){_0x4a8655[_0x03c1('0x3e')]=[{'all':!![]}];}return db[_0x03c1('0x3d')][_0x03c1('0x3f')](_0x4a8655);})['then'](function(_0x28a650){_0x52e85f[_0x03c1('0x40')]=_0x28a650;return _0x52e85f;})['then'](respondWithFilteredResult(_0x40a794,_0x4a8655))['catch'](handleError(_0x40a794,null));};exports[_0x03c1('0x41')]=function(_0x473c4e,_0x58ab30){var _0x2f450d={'raw':![],'where':{'id':_0x473c4e[_0x03c1('0x42')]['id']}},_0xc6a766={};_0xc6a766[_0x03c1('0x30')]=_[_0x03c1('0x32')](db[_0x03c1('0x3d')]['rawAttributes']);_0xc6a766['query']=_[_0x03c1('0x32')](_0x473c4e[_0x03c1('0x31')]);_0xc6a766[_0x03c1('0x38')]=_[_0x03c1('0x43')](_0xc6a766['model'],_0xc6a766[_0x03c1('0x31')]);_0x2f450d['attributes']=_[_0x03c1('0x43')](_0xc6a766['model'],qs[_0x03c1('0x34')](_0x473c4e['query'][_0x03c1('0x34')]));_0x2f450d[_0x03c1('0x33')]=_0x2f450d[_0x03c1('0x33')]['length']?_0x2f450d[_0x03c1('0x33')]:_0xc6a766['model'];if(_0x473c4e[_0x03c1('0x31')][_0x03c1('0x44')]){_0x2f450d[_0x03c1('0x3e')]=[{'all':!![]}];}_0x2f450d=_[_0x03c1('0x3a')]({},_0x2f450d,_0x473c4e[_0x03c1('0x3c')]);return db[_0x03c1('0x3d')][_0x03c1('0x45')](_0x2f450d)[_0x03c1('0x28')](handleEntityNotFound(_0x58ab30,null))[_0x03c1('0x28')](respondWithResult(_0x58ab30,null))['catch'](handleError(_0x58ab30,null));};exports[_0x03c1('0x46')]=function(_0x499dae,_0x4aa70c){return db[_0x03c1('0x3d')][_0x03c1('0x46')](_0x499dae[_0x03c1('0x47')],{})['then'](function(_0x11d702){var _0x3f1f0c=_0x499dae['user'][_0x03c1('0x25')]({'plain':!![]});if(!_0x3f1f0c)throw new Error(_0x03c1('0x48'));if(_0x3f1f0c[_0x03c1('0x49')]===_0x03c1('0x4a')){var _0xfc21de=_0x11d702[_0x03c1('0x25')]({'plain':!![]});var _0x51840d=_0x03c1('0x26');return db[_0x03c1('0x4b')][_0x03c1('0x45')]({'where':{'name':_0x51840d,'userProfileId':_0x3f1f0c[_0x03c1('0x4c')]},'raw':!![]})['then'](function(_0x12608a){if(_0x12608a&&_0x12608a[_0x03c1('0x4d')]===0x0){return db[_0x03c1('0x4e')]['create']({'name':_0xfc21de['name'],'resourceId':_0xfc21de['id'],'type':_0x12608a['name'],'sectionId':_0x12608a['id']},{})[_0x03c1('0x28')](function(){return _0x11d702;});}else{return _0x11d702;}})['catch'](function(_0x33b25f){logger[_0x03c1('0x4f')](_0x03c1('0x50'),_0x33b25f);throw _0x33b25f;});}return _0x11d702;})[_0x03c1('0x28')](respondWithResult(_0x4aa70c,0xc9))[_0x03c1('0x51')](handleError(_0x4aa70c,null));};exports[_0x03c1('0x52')]=function(_0x756b53,_0x47c29c){var _0x25c117={'where':{'id':_0x756b53[_0x03c1('0x42')]['id']}},_0x2d86aa={};_0x2d86aa[_0x03c1('0x30')]=_[_0x03c1('0x32')](db[_0x03c1('0x3d')]['rawAttributes']);_0x25c117[_0x03c1('0x33')]=_[_0x03c1('0x43')](_0x2d86aa[_0x03c1('0x30')],qs[_0x03c1('0x34')](_0x756b53[_0x03c1('0x31')][_0x03c1('0x34')]));_0x25c117[_0x03c1('0x33')]=_0x25c117['attributes']['length']?_0x25c117[_0x03c1('0x33')]:_0x2d86aa[_0x03c1('0x30')];if(_0x756b53[_0x03c1('0x31')][_0x03c1('0x44')]){_0x25c117[_0x03c1('0x3e')]=[{'all':!![]}];}_0x25c117=_[_0x03c1('0x3a')]({},_0x25c117,_0x756b53['options']);return db[_0x03c1('0x3d')][_0x03c1('0x45')](_0x25c117)[_0x03c1('0x28')](handleEntityNotFound(_0x47c29c,null))[_0x03c1('0x28')](function(_0x692972){if(_0x692972){var _0x513c4c=_0x692972[_0x03c1('0x25')]({'plain':!![]});_0x513c4c=qs[_0x03c1('0x53')](_0x513c4c,['id',_0x03c1('0x54'),_0x03c1('0x55')]);_0x756b53[_0x03c1('0x47')]=_[_0x03c1('0x53')](_0x756b53['body'],['id',_0x03c1('0x54'),_0x03c1('0x55')]);return db[_0x03c1('0x3d')][_0x03c1('0x46')](_[_0x03c1('0x3a')](_0x513c4c,_0x756b53['body']),{'include':_0x756b53[_0x03c1('0x31')][_0x03c1('0x44')]?[{'all':!![]}]:undefined})[_0x03c1('0x28')](function(_0xc78a57){var _0x308b8a=_0x756b53['user'][_0x03c1('0x25')]({'plain':!![]});if(!_0x308b8a)throw new Error(_0x03c1('0x48'));if(_0x308b8a['role']==='user'){var _0xccdb0b=_0xc78a57[_0x03c1('0x25')]({'plain':!![]});var _0x466f61=_0x03c1('0x26');return db[_0x03c1('0x4b')][_0x03c1('0x45')]({'where':{'name':_0x466f61,'userProfileId':_0x308b8a['userProfileId']},'raw':!![]})[_0x03c1('0x28')](function(_0x486d1c){if(_0x486d1c&&_0x486d1c['autoAssociation']===0x0){return db[_0x03c1('0x4e')][_0x03c1('0x46')]({'name':_0xccdb0b[_0x03c1('0x29')],'resourceId':_0xccdb0b['id'],'type':_0x486d1c[_0x03c1('0x29')],'sectionId':_0x486d1c['id']},{})[_0x03c1('0x28')](function(){return _0xc78a57;});}else{return _0xc78a57;}})['catch'](function(_0x1c34f4){logger[_0x03c1('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c34f4);throw _0x1c34f4;});}return _0xc78a57;});}})[_0x03c1('0x28')](respondWithResult(_0x47c29c,0xc9))['catch'](handleError(_0x47c29c,null));};exports[_0x03c1('0x24')]=function(_0x1432fa,_0xc625ab){if(_0x1432fa[_0x03c1('0x47')]['id']){delete _0x1432fa[_0x03c1('0x47')]['id'];}return db[_0x03c1('0x3d')][_0x03c1('0x45')]({'where':{'id':_0x1432fa[_0x03c1('0x42')]['id']}})[_0x03c1('0x28')](handleEntityNotFound(_0xc625ab,null))[_0x03c1('0x28')](saveUpdates(_0x1432fa['body'],null))['then'](respondWithResult(_0xc625ab,null))[_0x03c1('0x51')](handleError(_0xc625ab,null));};exports[_0x03c1('0x27')]=function(_0x14bed3,_0x58cd6b){return db[_0x03c1('0x3d')][_0x03c1('0x45')]({'where':{'id':_0x14bed3[_0x03c1('0x42')]['id']}})[_0x03c1('0x28')](handleEntityNotFound(_0x58cd6b,null))['then'](removeEntity(_0x58cd6b,null))['catch'](handleError(_0x58cd6b,null));};function widgetAttributes(_0x250876){try{switch(_0x250876[_0x03c1('0x2e')]){case _0x03c1('0x56'):return[{'name':_0x03c1('0x57'),'value':_0x250876[_0x03c1('0x57')]||(_0x250876['attrs']&&_0x250876[_0x03c1('0x58')][0x0]?_0x250876[_0x03c1('0x58')][0x0][_0x03c1('0x59')]:undefined)||'https://'}];case'custom':return[{'name':_0x03c1('0x5a'),'value':_0x250876['attrPath']||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x0]?_0x250876[_0x03c1('0x58')][0x0][_0x03c1('0x59')]:undefined)||''}];case _0x03c1('0x5b'):return[{'name':_0x03c1('0x5c'),'value':_0x250876[_0x03c1('0x5c')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x0]?_0x250876[_0x03c1('0x58')][0x0]['value']:undefined)||_0x03c1('0x5d')},{'name':_0x03c1('0x5e'),'value':_0x250876[_0x03c1('0x5e')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x1]?_0x250876[_0x03c1('0x58')][0x1][_0x03c1('0x59')]:undefined)||'0.00'},{'name':_0x03c1('0x5f'),'value':_0x250876[_0x03c1('0x5f')]||(_0x250876['attrs']&&_0x250876[_0x03c1('0x58')][0x2]?_0x250876[_0x03c1('0x58')][0x2][_0x03c1('0x59')]:undefined)||0xc}];case'counter':return[{'name':_0x03c1('0x60'),'value':_0x250876[_0x03c1('0x60')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x0]?_0x250876['attrs'][0x0][_0x03c1('0x59')]:undefined)||_0x03c1('0x61')},{'name':_0x03c1('0x62'),'value':_0x250876[_0x03c1('0x62')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x1]?_0x250876[_0x03c1('0x58')][0x1][_0x03c1('0x59')]:undefined)||[]},{'name':_0x03c1('0x5f'),'value':_0x250876[_0x03c1('0x5f')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x2]?_0x250876[_0x03c1('0x58')][0x2]['value']:undefined)||0x14},{'name':_0x03c1('0x63'),'value':_0x250876[_0x03c1('0x63')]||(_0x250876['attrs']&&_0x250876[_0x03c1('0x58')][0x3]?_0x250876[_0x03c1('0x58')][0x3][_0x03c1('0x59')]:undefined)||_0x03c1('0x64')},{'name':'attrEmailAccounts','value':_0x250876[_0x03c1('0x65')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x4]?_0x250876[_0x03c1('0x58')][0x4][_0x03c1('0x59')]:undefined)||''},{'name':_0x03c1('0x66'),'value':_0x250876['attrFaxAccounts']||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x5]?_0x250876[_0x03c1('0x58')][0x5][_0x03c1('0x59')]:undefined)||''},{'name':_0x03c1('0x67'),'value':_0x250876[_0x03c1('0x67')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x6]?_0x250876[_0x03c1('0x58')][0x6][_0x03c1('0x59')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x250876[_0x03c1('0x68')]||(_0x250876['attrs']&&_0x250876[_0x03c1('0x58')][0x7]?_0x250876['attrs'][0x7][_0x03c1('0x59')]:undefined)||''},{'name':_0x03c1('0x69'),'value':_0x250876[_0x03c1('0x69')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x8]?_0x250876[_0x03c1('0x58')][0x8][_0x03c1('0x59')]:undefined)||''},{'name':'attrChatWebsites','value':_0x250876[_0x03c1('0x6a')]||(_0x250876['attrs']&&_0x250876['attrs'][0x9]?_0x250876[_0x03c1('0x58')][0x9][_0x03c1('0x59')]:undefined)||''}];case _0x03c1('0x6b'):case'pie-chart':return[{'name':_0x03c1('0x6c'),'value':_0x250876[_0x03c1('0x6c')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x0]?_0x250876[_0x03c1('0x58')][0x0][_0x03c1('0x59')]:undefined)||_0x03c1('0x61')},{'name':'attrSerie2','value':_0x250876['attrSerie2']||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x1]?_0x250876['attrs'][0x1][_0x03c1('0x59')]:undefined)||null},{'name':_0x03c1('0x6d'),'value':_0x250876[_0x03c1('0x6d')]||(_0x250876['attrs']&&_0x250876['attrs'][0x2]?_0x250876['attrs'][0x2][_0x03c1('0x59')]:undefined)||null},{'name':_0x03c1('0x62'),'value':_0x250876[_0x03c1('0x62')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x3]?_0x250876[_0x03c1('0x58')][0x3][_0x03c1('0x59')]:undefined)||[]},{'name':'attrChannel','value':_0x250876[_0x03c1('0x63')]||(_0x250876['attrs']&&_0x250876[_0x03c1('0x58')][0x4]?_0x250876[_0x03c1('0x58')][0x4][_0x03c1('0x59')]:undefined)||'voice'},{'name':_0x03c1('0x65'),'value':_0x250876[_0x03c1('0x65')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x5]?_0x250876[_0x03c1('0x58')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x250876['attrFaxAccounts']||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x6]?_0x250876[_0x03c1('0x58')][0x6][_0x03c1('0x59')]:undefined)||''},{'name':_0x03c1('0x67'),'value':_0x250876[_0x03c1('0x67')]||(_0x250876['attrs']&&_0x250876[_0x03c1('0x58')][0x7]?_0x250876[_0x03c1('0x58')][0x7][_0x03c1('0x59')]:undefined)||''},{'name':_0x03c1('0x68'),'value':_0x250876[_0x03c1('0x68')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x8]?_0x250876[_0x03c1('0x58')][0x8]['value']:undefined)||''},{'name':_0x03c1('0x69'),'value':_0x250876[_0x03c1('0x69')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x9]?_0x250876['attrs'][0x9][_0x03c1('0x59')]:undefined)||''},{'name':'attrChatWebsites','value':_0x250876[_0x03c1('0x6a')]||(_0x250876[_0x03c1('0x58')]&&_0x250876['attrs'][0xa]?_0x250876[_0x03c1('0x58')][0xa][_0x03c1('0x59')]:undefined)||''}];case _0x03c1('0x6e'):return[{'name':_0x03c1('0x6f'),'type':_0x250876[_0x03c1('0x70')]||(_0x250876[_0x03c1('0x58')]&&_0x250876['attrs'][0x0]?_0x250876[_0x03c1('0x58')][0x0][_0x03c1('0x2e')]:undefined)||null,'value':_0x250876[_0x03c1('0x6f')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x0]?_0x250876['attrs'][0x0][_0x03c1('0x59')]:undefined)||null},{'name':_0x03c1('0x71'),'value':_0x250876[_0x03c1('0x71')]||(_0x250876[_0x03c1('0x58')]&&_0x250876[_0x03c1('0x58')][0x1]?_0x250876[_0x03c1('0x58')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x386f0d){logger['error'](_0x03c1('0x72'),JSON[_0x03c1('0x73')](_0x386f0d));return[];}}exports[_0x03c1('0x74')]=function(_0x5b5df6,_0x44c410,_0x9ae31e){if(_0x5b5df6[_0x03c1('0x47')]['id']){delete _0x5b5df6['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x5b5df6[_0x03c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x44c410,null))[_0x03c1('0x28')](function(_0x35653e){if(_0x35653e){_0x5b5df6[_0x03c1('0x47')]['DashboardId']=_0x35653e['id'];_0x5b5df6[_0x03c1('0x47')]['attrs']=widgetAttributes(_0x5b5df6[_0x03c1('0x47')]);return db[_0x03c1('0x75')][_0x03c1('0x46')](_0x5b5df6[_0x03c1('0x47')]);}})[_0x03c1('0x28')](respondWithResult(_0x44c410,null))[_0x03c1('0x51')](handleError(_0x44c410,null));};exports['getItems']=function(_0x2c65cd,_0x2d595f,_0x2c6058){var _0x564dcd={};var _0xf51ef9={};var _0x598e5a;var _0x254fbe;return db[_0x03c1('0x3d')]['findOne']({'where':{'id':_0x2c65cd['params']['id']}})[_0x03c1('0x28')](handleEntityNotFound(_0x2d595f,null))[_0x03c1('0x28')](function(_0x2df6d3){if(_0x2df6d3){_0x598e5a=_0x2df6d3;_0xf51ef9['model']=_[_0x03c1('0x32')](db['DashboardItem'][_0x03c1('0x2c')]);_0xf51ef9[_0x03c1('0x31')]=_['keys'](_0x2c65cd['query']);_0xf51ef9['filters']=_[_0x03c1('0x43')](_0xf51ef9['model'],_0xf51ef9[_0x03c1('0x31')]);_0x564dcd[_0x03c1('0x33')]=_[_0x03c1('0x43')](_0xf51ef9[_0x03c1('0x30')],qs[_0x03c1('0x34')](_0x2c65cd[_0x03c1('0x31')]['fields']));_0x564dcd[_0x03c1('0x33')]=_0x564dcd[_0x03c1('0x33')][_0x03c1('0x35')]?_0x564dcd[_0x03c1('0x33')]:_0xf51ef9[_0x03c1('0x30')];_0x564dcd['order']=qs[_0x03c1('0x36')](_0x2c65cd[_0x03c1('0x31')][_0x03c1('0x36')]);_0x564dcd[_0x03c1('0x37')]=qs[_0x03c1('0x38')](_['pick'](_0x2c65cd[_0x03c1('0x31')],_0xf51ef9[_0x03c1('0x38')]));if(_0x2c65cd[_0x03c1('0x31')]['filter']){_0x564dcd[_0x03c1('0x37')]=_['merge'](_0x564dcd[_0x03c1('0x37')],{'$or':_[_0x03c1('0x2b')](_0x564dcd[_0x03c1('0x33')],function(_0x578c7c){var _0x2e54c1={};_0x2e54c1[_0x578c7c]={'$like':'%'+_0x2c65cd[_0x03c1('0x31')][_0x03c1('0x39')]+'%'};return _0x2e54c1;})});}_0x564dcd=_[_0x03c1('0x3a')]({},_0x564dcd,_0x2c65cd[_0x03c1('0x3c')]);return _0x598e5a[_0x03c1('0x76')](_0x564dcd);}})['then'](function(_0x2259f0){if(_0x2259f0){_0x254fbe=_0x2259f0[_0x03c1('0x35')];if(!_0x2c65cd['query']['hasOwnProperty'](_0x03c1('0x77'))){_0x564dcd[_0x03c1('0x1c')]=qs[_0x03c1('0x1c')](_0x2c65cd[_0x03c1('0x31')][_0x03c1('0x1c')]);_0x564dcd[_0x03c1('0x1b')]=qs['offset'](_0x2c65cd['query'][_0x03c1('0x1b')]);}return _0x598e5a[_0x03c1('0x76')](_0x564dcd);}})[_0x03c1('0x28')](function(_0x3a1497){if(_0x3a1497){return _0x3a1497?{'count':_0x254fbe,'rows':_0x3a1497}:null;}})[_0x03c1('0x28')](respondWithResult(_0x2d595f,null))[_0x03c1('0x51')](handleError(_0x2d595f,null));}; \ No newline at end of file +var _0xa6f4=['stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','find','create','body','role','UserProfileSection','autoAssociation','error','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','pick','nolimit','getItems','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','save','update','destroy','then','get','CustomDashboards','UserProfileResource'];(function(_0x437162,_0x1b67cd){var _0x4976bb=function(_0x5d4d10){while(--_0x5d4d10){_0x437162['push'](_0x437162['shift']());}};_0x4976bb(++_0x1b67cd);}(_0xa6f4,0x1da));var _0x4a6f=function(_0x4a593f,_0x5c9862){_0x4a593f=_0x4a593f-0x0;var _0x2bc897=_0xa6f4[_0x4a593f];return _0x2bc897;};'use strict';var emlformat=require(_0x4a6f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4a6f('0x1'));var rp=require(_0x4a6f('0x2'));var moment=require(_0x4a6f('0x3'));var BPromise=require(_0x4a6f('0x4'));var Mustache=require(_0x4a6f('0x5'));var util=require(_0x4a6f('0x6'));var path=require(_0x4a6f('0x7'));var sox=require(_0x4a6f('0x8'));var csv=require(_0x4a6f('0x9'));var ejs=require(_0x4a6f('0xa'));var fs=require('fs');var fs_extra=require(_0x4a6f('0xb'));var _=require('lodash');var squel=require(_0x4a6f('0xc'));var crypto=require(_0x4a6f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4a6f('0xe'));var Papa=require(_0x4a6f('0xf'));var Redis=require(_0x4a6f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4a6f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a6f('0x12'));var utils=require(_0x4a6f('0x13'));var config=require(_0x4a6f('0x14'));var licenseUtil=require(_0x4a6f('0x15'));var db=require(_0x4a6f('0x16'))['db'];config[_0x4a6f('0x17')]=_[_0x4a6f('0x18')](config[_0x4a6f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a6f('0x19'))(new Redis(config[_0x4a6f('0x17')]));require(_0x4a6f('0x1a'))[_0x4a6f('0x1b')](socket);function respondWithStatusCode(_0x15ebc5,_0x11c0b9){_0x11c0b9=_0x11c0b9||0xcc;return function(_0x7ddb6f){if(_0x7ddb6f){return _0x15ebc5[_0x4a6f('0x1c')](_0x11c0b9);}return _0x15ebc5[_0x4a6f('0x1d')](_0x11c0b9)[_0x4a6f('0x1e')]();};}function respondWithResult(_0x3af382,_0xfbf2fd){_0xfbf2fd=_0xfbf2fd||0xc8;return function(_0x373b11){if(_0x373b11){return _0x3af382[_0x4a6f('0x1d')](_0xfbf2fd)['json'](_0x373b11);}};}function respondWithFilteredResult(_0x1b2067,_0x44e26e){return function(_0x59ebe9){if(_0x59ebe9){var _0x5c9cdf=typeof _0x44e26e['offset']===_0x4a6f('0x1f')&&typeof _0x44e26e['limit']===_0x4a6f('0x1f');var _0x157048=_0x59ebe9['count'];var _0xd1acbe=_0x5c9cdf?0x0:_0x44e26e[_0x4a6f('0x20')];var _0x569b87=_0x5c9cdf?_0x59ebe9[_0x4a6f('0x21')]:_0x44e26e['offset']+_0x44e26e[_0x4a6f('0x22')];var _0xd4b748;if(_0x569b87>=_0x157048){_0x569b87=_0x157048;_0xd4b748=0xc8;}else{_0xd4b748=0xce;}_0x1b2067[_0x4a6f('0x1d')](_0xd4b748);return _0x1b2067[_0x4a6f('0x23')](_0x4a6f('0x24'),_0xd1acbe+'-'+_0x569b87+'/'+_0x157048)[_0x4a6f('0x25')](_0x59ebe9);}return null;};}function patchUpdates(_0x103eeb){return function(_0x33b55e){try{jsonpatch[_0x4a6f('0x26')](_0x33b55e,_0x103eeb,!![]);}catch(_0x511a1f){return BPromise['reject'](_0x511a1f);}return _0x33b55e[_0x4a6f('0x27')]();};}function saveUpdates(_0x2924ff,_0xc4ef16){return function(_0x283bb0){if(_0x283bb0){return _0x283bb0[_0x4a6f('0x28')](_0x2924ff)['then'](function(_0x321268){return _0x321268;});}return null;};}function removeEntity(_0x85fb4,_0x15c75d){return function(_0x50a3bc){if(_0x50a3bc){return _0x50a3bc[_0x4a6f('0x29')]()[_0x4a6f('0x2a')](function(){var _0x571b68=_0x50a3bc[_0x4a6f('0x2b')]({'plain':!![]});var _0x2dc786=_0x4a6f('0x2c');return db[_0x4a6f('0x2d')]['destroy']({'where':{'type':_0x2dc786,'resourceId':_0x571b68['id']}})[_0x4a6f('0x2a')](function(){return _0x50a3bc;});})[_0x4a6f('0x2a')](function(){_0x85fb4['status'](0xcc)[_0x4a6f('0x1e')]();});}};}function handleEntityNotFound(_0x5138fa,_0x3d7446){return function(_0x38f514){if(!_0x38f514){_0x5138fa[_0x4a6f('0x1c')](0x194);}return _0x38f514;};}function handleError(_0x587882,_0x43974d){_0x43974d=_0x43974d||0x1f4;return function(_0x102db0){logger['error'](_0x102db0[_0x4a6f('0x2e')]);if(_0x102db0[_0x4a6f('0x2f')]){delete _0x102db0['name'];}_0x587882[_0x4a6f('0x1d')](_0x43974d)[_0x4a6f('0x30')](_0x102db0);};}exports[_0x4a6f('0x31')]=function(_0x124831,_0xf637e3){var _0x20924b={},_0x3ed7fa={},_0x1268d6={'count':0x0,'rows':[]};var _0x128c92=_[_0x4a6f('0x32')](db[_0x4a6f('0x33')][_0x4a6f('0x34')],function(_0x365f44){return{'name':_0x365f44[_0x4a6f('0x35')],'type':_0x365f44['type'][_0x4a6f('0x36')]};});_0x3ed7fa[_0x4a6f('0x37')]=_[_0x4a6f('0x32')](_0x128c92,_0x4a6f('0x2f'));_0x3ed7fa['query']=_['keys'](_0x124831[_0x4a6f('0x38')]);_0x3ed7fa[_0x4a6f('0x39')]=_[_0x4a6f('0x3a')](_0x3ed7fa[_0x4a6f('0x37')],_0x3ed7fa[_0x4a6f('0x38')]);_0x20924b['attributes']=_[_0x4a6f('0x3a')](_0x3ed7fa[_0x4a6f('0x37')],qs['fields'](_0x124831['query'][_0x4a6f('0x3b')]));_0x20924b[_0x4a6f('0x3c')]=_0x20924b[_0x4a6f('0x3c')]['length']?_0x20924b['attributes']:_0x3ed7fa[_0x4a6f('0x37')];if(!_0x124831[_0x4a6f('0x38')][_0x4a6f('0x3d')]('nolimit')){_0x20924b['limit']=qs['limit'](_0x124831[_0x4a6f('0x38')][_0x4a6f('0x22')]);_0x20924b[_0x4a6f('0x20')]=qs[_0x4a6f('0x20')](_0x124831[_0x4a6f('0x38')][_0x4a6f('0x20')]);}_0x20924b[_0x4a6f('0x3e')]=qs['sort'](_0x124831['query'][_0x4a6f('0x3f')]);_0x20924b[_0x4a6f('0x40')]=qs[_0x4a6f('0x39')](_['pick'](_0x124831[_0x4a6f('0x38')],_0x3ed7fa[_0x4a6f('0x39')]),_0x128c92);if(_0x124831[_0x4a6f('0x38')][_0x4a6f('0x41')]){_0x20924b[_0x4a6f('0x40')]=_['merge'](_0x20924b[_0x4a6f('0x40')],{'$or':_[_0x4a6f('0x32')](_0x128c92,function(_0x6532b3){if(_0x6532b3[_0x4a6f('0x42')]!==_0x4a6f('0x43')){var _0x561ee9={};_0x561ee9[_0x6532b3['name']]={'$like':'%'+_0x124831[_0x4a6f('0x38')][_0x4a6f('0x41')]+'%'};return _0x561ee9;}})});}_0x20924b=_[_0x4a6f('0x44')]({},_0x20924b,_0x124831[_0x4a6f('0x45')]);var _0x238c51={'where':_0x20924b[_0x4a6f('0x40')]};return db[_0x4a6f('0x33')][_0x4a6f('0x21')](_0x238c51)['then'](function(_0x4a4a0a){_0x1268d6[_0x4a6f('0x21')]=_0x4a4a0a;if(_0x124831[_0x4a6f('0x38')][_0x4a6f('0x46')]){_0x20924b['include']=[{'all':!![]}];}return db['Dashboard'][_0x4a6f('0x47')](_0x20924b);})['then'](function(_0x1914b8){_0x1268d6[_0x4a6f('0x48')]=_0x1914b8;return _0x1268d6;})[_0x4a6f('0x2a')](respondWithFilteredResult(_0xf637e3,_0x20924b))[_0x4a6f('0x49')](handleError(_0xf637e3,null));};exports[_0x4a6f('0x4a')]=function(_0x1b992a,_0x40bd7f){var _0x485746={'raw':![],'where':{'id':_0x1b992a[_0x4a6f('0x4b')]['id']}},_0x2ee36d={};_0x2ee36d[_0x4a6f('0x37')]=_[_0x4a6f('0x4c')](db[_0x4a6f('0x33')][_0x4a6f('0x34')]);_0x2ee36d['query']=_[_0x4a6f('0x4c')](_0x1b992a[_0x4a6f('0x38')]);_0x2ee36d[_0x4a6f('0x39')]=_['intersection'](_0x2ee36d[_0x4a6f('0x37')],_0x2ee36d[_0x4a6f('0x38')]);_0x485746[_0x4a6f('0x3c')]=_['intersection'](_0x2ee36d[_0x4a6f('0x37')],qs[_0x4a6f('0x3b')](_0x1b992a[_0x4a6f('0x38')][_0x4a6f('0x3b')]));_0x485746[_0x4a6f('0x3c')]=_0x485746['attributes'][_0x4a6f('0x4d')]?_0x485746[_0x4a6f('0x3c')]:_0x2ee36d[_0x4a6f('0x37')];if(_0x1b992a[_0x4a6f('0x38')]['includeAll']){_0x485746['include']=[{'all':!![]}];}_0x485746=_[_0x4a6f('0x44')]({},_0x485746,_0x1b992a[_0x4a6f('0x45')]);return db[_0x4a6f('0x33')][_0x4a6f('0x4e')](_0x485746)[_0x4a6f('0x2a')](handleEntityNotFound(_0x40bd7f,null))['then'](respondWithResult(_0x40bd7f,null))[_0x4a6f('0x49')](handleError(_0x40bd7f,null));};exports[_0x4a6f('0x4f')]=function(_0x5620ca,_0x295d7e){return db[_0x4a6f('0x33')]['create'](_0x5620ca[_0x4a6f('0x50')],{})[_0x4a6f('0x2a')](function(_0x1e2590){var _0x8a125d=_0x5620ca['user'][_0x4a6f('0x2b')]({'plain':!![]});if(!_0x8a125d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8a125d[_0x4a6f('0x51')]==='user'){var _0x1fe8f8=_0x1e2590['get']({'plain':!![]});var _0x526d16='CustomDashboards';return db[_0x4a6f('0x52')][_0x4a6f('0x4e')]({'where':{'name':_0x526d16,'userProfileId':_0x8a125d['userProfileId']},'raw':!![]})[_0x4a6f('0x2a')](function(_0x5dd07b){if(_0x5dd07b&&_0x5dd07b[_0x4a6f('0x53')]===0x0){return db[_0x4a6f('0x2d')]['create']({'name':_0x1fe8f8[_0x4a6f('0x2f')],'resourceId':_0x1fe8f8['id'],'type':_0x5dd07b[_0x4a6f('0x2f')],'sectionId':_0x5dd07b['id']},{})['then'](function(){return _0x1e2590;});}else{return _0x1e2590;}})[_0x4a6f('0x49')](function(_0x1cd298){logger[_0x4a6f('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cd298);throw _0x1cd298;});}return _0x1e2590;})['then'](respondWithResult(_0x295d7e,0xc9))[_0x4a6f('0x49')](handleError(_0x295d7e,null));};exports['clone']=function(_0xe886a6,_0x4dea8e){var _0x3a3c09={'where':{'id':_0xe886a6[_0x4a6f('0x4b')]['id']}},_0x4847f7={};_0x4847f7['model']=_[_0x4a6f('0x4c')](db[_0x4a6f('0x33')][_0x4a6f('0x34')]);_0x3a3c09['attributes']=_['intersection'](_0x4847f7[_0x4a6f('0x37')],qs[_0x4a6f('0x3b')](_0xe886a6['query'][_0x4a6f('0x3b')]));_0x3a3c09['attributes']=_0x3a3c09[_0x4a6f('0x3c')]['length']?_0x3a3c09[_0x4a6f('0x3c')]:_0x4847f7[_0x4a6f('0x37')];if(_0xe886a6['query'][_0x4a6f('0x46')]){_0x3a3c09['include']=[{'all':!![]}];}_0x3a3c09=_[_0x4a6f('0x44')]({},_0x3a3c09,_0xe886a6[_0x4a6f('0x45')]);return db['Dashboard'][_0x4a6f('0x4e')](_0x3a3c09)['then'](handleEntityNotFound(_0x4dea8e,null))[_0x4a6f('0x2a')](function(_0x5a1a76){if(_0x5a1a76){var _0x51a693=_0x5a1a76[_0x4a6f('0x2b')]({'plain':!![]});_0x51a693=qs[_0x4a6f('0x55')](_0x51a693,['id','createdAt',_0x4a6f('0x56')]);_0xe886a6[_0x4a6f('0x50')]=_[_0x4a6f('0x55')](_0xe886a6['body'],['id',_0x4a6f('0x57'),'updatedAt']);return db['Dashboard']['create'](_[_0x4a6f('0x44')](_0x51a693,_0xe886a6[_0x4a6f('0x50')]),{'include':_0xe886a6[_0x4a6f('0x38')][_0x4a6f('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x3a6408){var _0x1eef17=_0xe886a6['user'][_0x4a6f('0x2b')]({'plain':!![]});if(!_0x1eef17)throw new Error(_0x4a6f('0x58'));if(_0x1eef17[_0x4a6f('0x51')]===_0x4a6f('0x59')){var _0x180eb1=_0x3a6408[_0x4a6f('0x2b')]({'plain':!![]});var _0xcf11b8=_0x4a6f('0x2c');return db['UserProfileSection'][_0x4a6f('0x4e')]({'where':{'name':_0xcf11b8,'userProfileId':_0x1eef17[_0x4a6f('0x5a')]},'raw':!![]})[_0x4a6f('0x2a')](function(_0x1ee87b){if(_0x1ee87b&&_0x1ee87b[_0x4a6f('0x53')]===0x0){return db[_0x4a6f('0x2d')][_0x4a6f('0x4f')]({'name':_0x180eb1[_0x4a6f('0x2f')],'resourceId':_0x180eb1['id'],'type':_0x1ee87b['name'],'sectionId':_0x1ee87b['id']},{})[_0x4a6f('0x2a')](function(){return _0x3a6408;});}else{return _0x3a6408;}})[_0x4a6f('0x49')](function(_0x3ec99e){logger[_0x4a6f('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ec99e);throw _0x3ec99e;});}return _0x3a6408;});}})[_0x4a6f('0x2a')](respondWithResult(_0x4dea8e,0xc9))['catch'](handleError(_0x4dea8e,null));};exports['update']=function(_0x1da5c5,_0x41f8c5){if(_0x1da5c5[_0x4a6f('0x50')]['id']){delete _0x1da5c5[_0x4a6f('0x50')]['id'];}return db[_0x4a6f('0x33')][_0x4a6f('0x4e')]({'where':{'id':_0x1da5c5[_0x4a6f('0x4b')]['id']}})[_0x4a6f('0x2a')](handleEntityNotFound(_0x41f8c5,null))[_0x4a6f('0x2a')](saveUpdates(_0x1da5c5['body'],null))[_0x4a6f('0x2a')](respondWithResult(_0x41f8c5,null))[_0x4a6f('0x49')](handleError(_0x41f8c5,null));};exports['destroy']=function(_0x695d02,_0x87ff74){return db[_0x4a6f('0x33')][_0x4a6f('0x4e')]({'where':{'id':_0x695d02['params']['id']}})['then'](handleEntityNotFound(_0x87ff74,null))['then'](removeEntity(_0x87ff74,null))[_0x4a6f('0x49')](handleError(_0x87ff74,null));};function widgetAttributes(_0x230712){try{switch(_0x230712[_0x4a6f('0x42')]){case _0x4a6f('0x5b'):return[{'name':_0x4a6f('0x5c'),'value':_0x230712[_0x4a6f('0x5c')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x0]?_0x230712[_0x4a6f('0x5d')][0x0]['value']:undefined)||_0x4a6f('0x5e')}];case _0x4a6f('0x5f'):return[{'name':_0x4a6f('0x60'),'value':_0x230712[_0x4a6f('0x60')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712['attrs'][0x0]?_0x230712[_0x4a6f('0x5d')][0x0][_0x4a6f('0x61')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x230712[_0x4a6f('0x62')]||(_0x230712['attrs']&&_0x230712[_0x4a6f('0x5d')][0x0]?_0x230712['attrs'][0x0][_0x4a6f('0x61')]:undefined)||_0x4a6f('0x63')},{'name':_0x4a6f('0x64'),'value':_0x230712[_0x4a6f('0x64')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x1]?_0x230712[_0x4a6f('0x5d')][0x1]['value']:undefined)||_0x4a6f('0x65')},{'name':_0x4a6f('0x66'),'value':_0x230712[_0x4a6f('0x66')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x2]?_0x230712[_0x4a6f('0x5d')][0x2][_0x4a6f('0x61')]:undefined)||0xc}];case'counter':return[{'name':_0x4a6f('0x67'),'value':_0x230712[_0x4a6f('0x67')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x0]?_0x230712[_0x4a6f('0x5d')][0x0][_0x4a6f('0x61')]:undefined)||'total'},{'name':_0x4a6f('0x68'),'value':_0x230712[_0x4a6f('0x68')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712['attrs'][0x1]?_0x230712[_0x4a6f('0x5d')][0x1]['value']:undefined)||[]},{'name':_0x4a6f('0x66'),'value':_0x230712[_0x4a6f('0x66')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x2]?_0x230712[_0x4a6f('0x5d')][0x2][_0x4a6f('0x61')]:undefined)||0x14},{'name':_0x4a6f('0x69'),'value':_0x230712[_0x4a6f('0x69')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x3]?_0x230712[_0x4a6f('0x5d')][0x3][_0x4a6f('0x61')]:undefined)||_0x4a6f('0x6a')},{'name':_0x4a6f('0x6b'),'value':_0x230712[_0x4a6f('0x6b')]||(_0x230712['attrs']&&_0x230712['attrs'][0x4]?_0x230712[_0x4a6f('0x5d')][0x4][_0x4a6f('0x61')]:undefined)||''},{'name':_0x4a6f('0x6c'),'value':_0x230712[_0x4a6f('0x6c')]||(_0x230712['attrs']&&_0x230712[_0x4a6f('0x5d')][0x5]?_0x230712['attrs'][0x5][_0x4a6f('0x61')]:undefined)||''},{'name':_0x4a6f('0x6d'),'value':_0x230712['attrSmsAccounts']||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x6]?_0x230712[_0x4a6f('0x5d')][0x6]['value']:undefined)||''},{'name':_0x4a6f('0x6e'),'value':_0x230712['attrOpenchannelAccounts']||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x7]?_0x230712[_0x4a6f('0x5d')][0x7]['value']:undefined)||''},{'name':_0x4a6f('0x6f'),'value':_0x230712[_0x4a6f('0x6f')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x8]?_0x230712['attrs'][0x8][_0x4a6f('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0x230712[_0x4a6f('0x70')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x9]?_0x230712[_0x4a6f('0x5d')][0x9][_0x4a6f('0x61')]:undefined)||''}];case _0x4a6f('0x71'):case _0x4a6f('0x72'):return[{'name':_0x4a6f('0x73'),'value':_0x230712[_0x4a6f('0x73')]||(_0x230712['attrs']&&_0x230712[_0x4a6f('0x5d')][0x0]?_0x230712[_0x4a6f('0x5d')][0x0]['value']:undefined)||_0x4a6f('0x74')},{'name':_0x4a6f('0x75'),'value':_0x230712[_0x4a6f('0x75')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x1]?_0x230712[_0x4a6f('0x5d')][0x1][_0x4a6f('0x61')]:undefined)||null},{'name':_0x4a6f('0x76'),'value':_0x230712[_0x4a6f('0x76')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x2]?_0x230712[_0x4a6f('0x5d')][0x2][_0x4a6f('0x61')]:undefined)||null},{'name':_0x4a6f('0x68'),'value':_0x230712[_0x4a6f('0x68')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712['attrs'][0x3]?_0x230712['attrs'][0x3][_0x4a6f('0x61')]:undefined)||[]},{'name':'attrChannel','value':_0x230712[_0x4a6f('0x69')]||(_0x230712['attrs']&&_0x230712[_0x4a6f('0x5d')][0x4]?_0x230712[_0x4a6f('0x5d')][0x4][_0x4a6f('0x61')]:undefined)||'voice'},{'name':_0x4a6f('0x6b'),'value':_0x230712[_0x4a6f('0x6b')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x5]?_0x230712[_0x4a6f('0x5d')][0x5][_0x4a6f('0x61')]:undefined)||''},{'name':_0x4a6f('0x6c'),'value':_0x230712[_0x4a6f('0x6c')]||(_0x230712['attrs']&&_0x230712['attrs'][0x6]?_0x230712['attrs'][0x6][_0x4a6f('0x61')]:undefined)||''},{'name':_0x4a6f('0x6d'),'value':_0x230712[_0x4a6f('0x6d')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x7]?_0x230712[_0x4a6f('0x5d')][0x7][_0x4a6f('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x230712[_0x4a6f('0x6e')]||(_0x230712['attrs']&&_0x230712[_0x4a6f('0x5d')][0x8]?_0x230712[_0x4a6f('0x5d')][0x8]['value']:undefined)||''},{'name':_0x4a6f('0x6f'),'value':_0x230712['attrWhatsappAccounts']||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x9]?_0x230712[_0x4a6f('0x5d')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x230712[_0x4a6f('0x70')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0xa]?_0x230712[_0x4a6f('0x5d')][0xa][_0x4a6f('0x61')]:undefined)||''}];case _0x4a6f('0x77'):return[{'name':'attrReport','type':_0x230712['reportType']||(_0x230712[_0x4a6f('0x5d')]&&_0x230712[_0x4a6f('0x5d')][0x0]?_0x230712[_0x4a6f('0x5d')][0x0][_0x4a6f('0x42')]:undefined)||null,'value':_0x230712[_0x4a6f('0x78')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712['attrs'][0x0]?_0x230712[_0x4a6f('0x5d')][0x0][_0x4a6f('0x61')]:undefined)||null},{'name':'attrRefresh','value':_0x230712[_0x4a6f('0x79')]||(_0x230712[_0x4a6f('0x5d')]&&_0x230712['attrs'][0x1]?_0x230712['attrs'][0x1][_0x4a6f('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x572575){logger['error'](_0x4a6f('0x7a'),JSON[_0x4a6f('0x7b')](_0x572575));return[];}}exports[_0x4a6f('0x7c')]=function(_0x599383,_0x255df3,_0x2b4174){if(_0x599383['body']['id']){delete _0x599383['body']['id'];}return db[_0x4a6f('0x33')][_0x4a6f('0x4e')]({'where':{'id':_0x599383[_0x4a6f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x255df3,null))['then'](function(_0x185b3a){if(_0x185b3a){_0x599383[_0x4a6f('0x50')][_0x4a6f('0x7d')]=_0x185b3a['id'];_0x599383[_0x4a6f('0x50')][_0x4a6f('0x5d')]=widgetAttributes(_0x599383['body']);return db[_0x4a6f('0x7e')][_0x4a6f('0x4f')](_0x599383[_0x4a6f('0x50')]);}})[_0x4a6f('0x2a')](respondWithResult(_0x255df3,null))[_0x4a6f('0x49')](handleError(_0x255df3,null));};exports['getItems']=function(_0x587f7d,_0x299472,_0x2e3bb3){var _0x551c34={};var _0x2cf3bd={};var _0x2151a0;var _0x42d6a0;return db[_0x4a6f('0x33')]['findOne']({'where':{'id':_0x587f7d[_0x4a6f('0x4b')]['id']}})[_0x4a6f('0x2a')](handleEntityNotFound(_0x299472,null))[_0x4a6f('0x2a')](function(_0x10def0){if(_0x10def0){_0x2151a0=_0x10def0;_0x2cf3bd[_0x4a6f('0x37')]=_[_0x4a6f('0x4c')](db[_0x4a6f('0x7e')][_0x4a6f('0x34')]);_0x2cf3bd[_0x4a6f('0x38')]=_[_0x4a6f('0x4c')](_0x587f7d[_0x4a6f('0x38')]);_0x2cf3bd[_0x4a6f('0x39')]=_[_0x4a6f('0x3a')](_0x2cf3bd[_0x4a6f('0x37')],_0x2cf3bd[_0x4a6f('0x38')]);_0x551c34['attributes']=_['intersection'](_0x2cf3bd['model'],qs['fields'](_0x587f7d[_0x4a6f('0x38')]['fields']));_0x551c34[_0x4a6f('0x3c')]=_0x551c34[_0x4a6f('0x3c')][_0x4a6f('0x4d')]?_0x551c34[_0x4a6f('0x3c')]:_0x2cf3bd[_0x4a6f('0x37')];_0x551c34['order']=qs[_0x4a6f('0x3f')](_0x587f7d[_0x4a6f('0x38')]['sort']);_0x551c34['where']=qs[_0x4a6f('0x39')](_[_0x4a6f('0x7f')](_0x587f7d['query'],_0x2cf3bd[_0x4a6f('0x39')]));if(_0x587f7d['query'][_0x4a6f('0x41')]){_0x551c34['where']=_[_0x4a6f('0x44')](_0x551c34[_0x4a6f('0x40')],{'$or':_[_0x4a6f('0x32')](_0x551c34[_0x4a6f('0x3c')],function(_0x547abb){var _0x307716={};_0x307716[_0x547abb]={'$like':'%'+_0x587f7d[_0x4a6f('0x38')][_0x4a6f('0x41')]+'%'};return _0x307716;})});}_0x551c34=_['merge']({},_0x551c34,_0x587f7d[_0x4a6f('0x45')]);return _0x2151a0['getItems'](_0x551c34);}})[_0x4a6f('0x2a')](function(_0x84d791){if(_0x84d791){_0x42d6a0=_0x84d791['length'];if(!_0x587f7d['query'][_0x4a6f('0x3d')](_0x4a6f('0x80'))){_0x551c34[_0x4a6f('0x22')]=qs[_0x4a6f('0x22')](_0x587f7d['query'][_0x4a6f('0x22')]);_0x551c34[_0x4a6f('0x20')]=qs[_0x4a6f('0x20')](_0x587f7d[_0x4a6f('0x38')]['offset']);}return _0x2151a0[_0x4a6f('0x81')](_0x551c34);}})[_0x4a6f('0x2a')](function(_0x2e2bc4){if(_0x2e2bc4){return _0x2e2bc4?{'count':_0x42d6a0,'rows':_0x2e2bc4}:null;}})[_0x4a6f('0x2a')](respondWithResult(_0x299472,null))[_0x4a6f('0x49')](handleError(_0x299472,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6a35366..04b6b75 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 _0xe837=['Dashboard','setMaxListeners','save','emit','hook','exports','../../mysqldb'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0xe837,0x141));var _0x7e83=function(_0x5ece84,_0xc06c9f){_0x5ece84=_0x5ece84-0x0;var _0x2a12c4=_0xe837[_0x5ece84];return _0x2a12c4;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x7e83('0x0'))['db'][_0x7e83('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7e83('0x2')](0x0);var events={'afterCreate':_0x7e83('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c7284){return function(_0x859a9,_0x123ec5,_0x35ac9a){DashboardEvents[_0x7e83('0x4')](_0x1c7284+':'+_0x859a9['id'],_0x859a9);DashboardEvents[_0x7e83('0x4')](_0x1c7284,_0x859a9);_0x35ac9a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x7e83('0x5')](e,emitEvent(event));}}module[_0x7e83('0x6')]=DashboardEvents; \ No newline at end of file +var _0x7f9c=['save','emit','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x2aab6e,_0x2d3b9b){var _0x1b2930=function(_0x28d299){while(--_0x28d299){_0x2aab6e['push'](_0x2aab6e['shift']());}};_0x1b2930(++_0x2d3b9b);}(_0x7f9c,0x9c));var _0xc7f9=function(_0x5093bd,_0x50cb62){_0x5093bd=_0x5093bd-0x0;var _0x22babc=_0x7f9c[_0x5093bd];return _0x22babc;};'use strict';var EventEmitter=require(_0xc7f9('0x0'));var Dashboard=require(_0xc7f9('0x1'))['db'][_0xc7f9('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc7f9('0x3')](0x0);var events={'afterCreate':_0xc7f9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4d1a07){return function(_0x5b5695,_0x1e9775,_0x3bc12f){DashboardEvents['emit'](_0x4d1a07+':'+_0x5b5695['id'],_0x5b5695);DashboardEvents[_0xc7f9('0x5')](_0x4d1a07,_0x5b5695);_0x3bc12f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xc7f9('0x6')](e,emitEvent(event));}}module[_0xc7f9('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index dde93dc..d9922da 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 _0xa0b6=['./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x49ad60,_0x422b30){var _0x394030=function(_0x3a2c5e){while(--_0x3a2c5e){_0x49ad60['push'](_0x49ad60['shift']());}};_0x394030(++_0x422b30);}(_0xa0b6,0x74));var _0x6a0b=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xa0b6[_0x3a7a9c];return _0x59156e;};'use strict';var _=require(_0x6a0b('0x0'));var util=require(_0x6a0b('0x1'));var logger=require(_0x6a0b('0x2'))(_0x6a0b('0x3'));var moment=require(_0x6a0b('0x4'));var BPromise=require(_0x6a0b('0x5'));var rp=require(_0x6a0b('0x6'));var fs=require('fs');var path=require(_0x6a0b('0x7'));var rimraf=require(_0x6a0b('0x8'));var config=require(_0x6a0b('0x9'));var attributes=require(_0x6a0b('0xa'));module[_0x6a0b('0xb')]=function(_0xee4bc8,_0x31464c){return _0xee4bc8['define'](_0x6a0b('0xc'),attributes,{'tableName':_0x6a0b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa528=['request-promise','path','rimraf','./dashboard.attributes','exports','dashboards','lodash','util','../../config/logger','moment','bluebird'];(function(_0x52de9b,_0x19df61){var _0x1ad0c7=function(_0x26a38c){while(--_0x26a38c){_0x52de9b['push'](_0x52de9b['shift']());}};_0x1ad0c7(++_0x19df61);}(_0xa528,0x171));var _0x8a52=function(_0x424329,_0x1a3e61){_0x424329=_0x424329-0x0;var _0x324625=_0xa528[_0x424329];return _0x324625;};'use strict';var _=require(_0x8a52('0x0'));var util=require(_0x8a52('0x1'));var logger=require(_0x8a52('0x2'))('api');var moment=require(_0x8a52('0x3'));var BPromise=require(_0x8a52('0x4'));var rp=require(_0x8a52('0x5'));var fs=require('fs');var path=require(_0x8a52('0x6'));var rimraf=require(_0x8a52('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a52('0x8'));module[_0x8a52('0x9')]=function(_0x1fb4d6,_0xc5cf25){return _0x1fb4d6['define']('Dashboard',attributes,{'tableName':_0x8a52('0xa'),'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 32c4dc1..b9c07c9 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 _0x495b=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x495b,0xa9));var _0xb495=function(_0x1d68b4,_0x742835){_0x1d68b4=_0x1d68b4-0x0;var _0x285f8=_0x495b[_0x1d68b4];return _0x285f8;};'use strict';var _=require(_0xb495('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb495('0x1'));var fs=require('fs');var Redis=require(_0xb495('0x2'));var db=require(_0xb495('0x3'))['db'];var utils=require(_0xb495('0x4'));var logger=require('../../config/logger')(_0xb495('0x5'));var config=require(_0xb495('0x6'));var jayson=require(_0xb495('0x7'));var client=jayson[_0xb495('0x8')][_0xb495('0x9')]({'port':0x232a});config[_0xb495('0xa')]=_[_0xb495('0xb')](config[_0xb495('0xa')],{'host':_0xb495('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb495('0xa')]));require(_0xb495('0xd'))[_0xb495('0xe')](socket);function respondWithRpcPromise(_0x416599,_0x31efad,_0x7a7126){return new BPromise(function(_0x185b9b,_0x134227){return client[_0xb495('0xf')](_0x416599,_0x7a7126)[_0xb495('0x10')](function(_0x44c1c4){logger['info'](_0xb495('0x11'),_0x31efad,_0xb495('0x12'));logger[_0xb495('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x31efad,_0xb495('0x12'),JSON[_0xb495('0x14')](_0x44c1c4));if(_0x44c1c4['error']){if(_0x44c1c4[_0xb495('0x15')][_0xb495('0x16')]===0x1f4){logger['error'](_0xb495('0x11'),_0x31efad,_0x44c1c4[_0xb495('0x15')]['message']);return _0x134227(_0x44c1c4[_0xb495('0x15')][_0xb495('0x17')]);}logger[_0xb495('0x15')](_0xb495('0x11'),_0x31efad,_0x44c1c4[_0xb495('0x15')]['message']);return _0x185b9b(_0x44c1c4[_0xb495('0x15')][_0xb495('0x17')]);}else{logger['info'](_0xb495('0x11'),_0x31efad,'request\x20sent');_0x185b9b(_0x44c1c4[_0xb495('0x18')]['message']);}})['catch'](function(_0x50e1f4){logger[_0xb495('0x15')]('Dashboard,\x20%s,\x20%s',_0x31efad,_0x50e1f4);_0x134227(_0x50e1f4);});});} \ No newline at end of file +var _0x6f20=['../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x6f20,0x1d0));var _0x06f2=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0x6f20[_0x503cd5];return _0x1fdf1e;};'use strict';var _=require('lodash');var util=require(_0x06f2('0x0'));var moment=require('moment');var BPromise=require(_0x06f2('0x1'));var rs=require(_0x06f2('0x2'));var fs=require('fs');var Redis=require(_0x06f2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x06f2('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x06f2('0x5'));var client=jayson[_0x06f2('0x6')][_0x06f2('0x7')]({'port':0x232a});config[_0x06f2('0x8')]=_[_0x06f2('0x9')](config[_0x06f2('0x8')],{'host':_0x06f2('0xa'),'port':0x18eb});var socket=require(_0x06f2('0xb'))(new Redis(config[_0x06f2('0x8')]));require(_0x06f2('0xc'))[_0x06f2('0xd')](socket);function respondWithRpcPromise(_0x36e334,_0x355eb4,_0x358552){return new BPromise(function(_0x499a39,_0x530fdd){return client[_0x06f2('0xe')](_0x36e334,_0x358552)[_0x06f2('0xf')](function(_0x24fab9){logger[_0x06f2('0x10')](_0x06f2('0x11'),_0x355eb4,'request\x20sent');logger[_0x06f2('0x12')](_0x06f2('0x13'),_0x355eb4,_0x06f2('0x14'),JSON['stringify'](_0x24fab9));if(_0x24fab9['error']){if(_0x24fab9[_0x06f2('0x15')][_0x06f2('0x16')]===0x1f4){logger['error'](_0x06f2('0x11'),_0x355eb4,_0x24fab9[_0x06f2('0x15')]['message']);return _0x530fdd(_0x24fab9[_0x06f2('0x15')]['message']);}logger['error'](_0x06f2('0x11'),_0x355eb4,_0x24fab9[_0x06f2('0x15')][_0x06f2('0x17')]);return _0x499a39(_0x24fab9[_0x06f2('0x15')][_0x06f2('0x17')]);}else{logger['info'](_0x06f2('0x11'),_0x355eb4,'request\x20sent');_0x499a39(_0x24fab9[_0x06f2('0x18')][_0x06f2('0x17')]);}})[_0x06f2('0x19')](function(_0x482313){logger[_0x06f2('0x15')](_0x06f2('0x11'),_0x355eb4,_0x482313);_0x530fdd(_0x482313);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 17d2fe9..9b19504 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 _0xdfe4=['./dashboard.events','remove','update','emit','removeListener','register','length','dashboard:'];(function(_0x4c79fc,_0x1cd15e){var _0x3b3c53=function(_0x3faf03){while(--_0x3faf03){_0x4c79fc['push'](_0x4c79fc['shift']());}};_0x3b3c53(++_0x1cd15e);}(_0xdfe4,0x100));var _0x4dfe=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xdfe4[_0x2b5eae];return _0x5f3ac9;};'use strict';var DashboardEvents=require(_0x4dfe('0x0'));var events=['save',_0x4dfe('0x1'),_0x4dfe('0x2')];function createListener(_0x3a7b11,_0xee163d){return function(_0x3f47e4){_0xee163d[_0x4dfe('0x3')](_0x3a7b11,_0x3f47e4);};}function removeListener(_0x1ee1b3,_0x411d9c){return function(){DashboardEvents[_0x4dfe('0x4')](_0x1ee1b3,_0x411d9c);};}exports[_0x4dfe('0x5')]=function(_0x422fe1){for(var _0x276cfe=0x0,_0x2b9f83=events[_0x4dfe('0x6')];_0x276cfe<_0x2b9f83;_0x276cfe++){var _0x249117=events[_0x276cfe];var _0x5f4638=createListener(_0x4dfe('0x7')+_0x249117,_0x422fe1);DashboardEvents['on'](_0x249117,_0x5f4638);}}; \ No newline at end of file +var _0xf600=['./dashboard.events','save','update','emit','removeListener','register','length','dashboard:'];(function(_0x3d1e25,_0x251b4d){var _0x78b4d5=function(_0x47618f){while(--_0x47618f){_0x3d1e25['push'](_0x3d1e25['shift']());}};_0x78b4d5(++_0x251b4d);}(_0xf600,0x68));var _0x0f60=function(_0x16387f,_0x2b39c8){_0x16387f=_0x16387f-0x0;var _0x161eaa=_0xf600[_0x16387f];return _0x161eaa;};'use strict';var DashboardEvents=require(_0x0f60('0x0'));var events=[_0x0f60('0x1'),'remove',_0x0f60('0x2')];function createListener(_0x300208,_0xff7884){return function(_0x40ecf1){_0xff7884[_0x0f60('0x3')](_0x300208,_0x40ecf1);};}function removeListener(_0x4ae553,_0x45e4cd){return function(){DashboardEvents[_0x0f60('0x4')](_0x4ae553,_0x45e4cd);};}exports[_0x0f60('0x5')]=function(_0x2cd9d7){for(var _0x464349=0x0,_0x4e148b=events[_0x0f60('0x6')];_0x464349<_0x4e148b;_0x464349++){var _0x31a125=events[_0x464349];var _0x1b7695=createListener(_0x0f60('0x7')+_0x31a125,_0x2cd9d7);DashboardEvents['on'](_0x31a125,_0x1b7695);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 720d12f..65bab3d 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 _0xd47a=['/:id','isAuthenticated','show','/:id/items','post','create','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','index'];(function(_0x5d1afe,_0x4d5c87){var _0x3a49a0=function(_0x261186){while(--_0x261186){_0x5d1afe['push'](_0x5d1afe['shift']());}};_0x3a49a0(++_0x4d5c87);}(_0xd47a,0x165));var _0xad47=function(_0x215775,_0x15bc76){_0x215775=_0x215775-0x0;var _0x2c189d=_0xd47a[_0x215775];return _0x2c189d;};'use strict';var multer=require(_0xad47('0x0'));var util=require(_0xad47('0x1'));var path=require(_0xad47('0x2'));var timeout=require(_0xad47('0x3'));var express=require(_0xad47('0x4'));var router=express[_0xad47('0x5')]();var fs_extra=require(_0xad47('0x6'));var auth=require(_0xad47('0x7'));var interaction=require(_0xad47('0x8'));var config=require('../../config/environment');var controller=require(_0xad47('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xad47('0xa')]);router['get'](_0xad47('0xb'),auth[_0xad47('0xc')](),controller[_0xad47('0xd')]);router['get'](_0xad47('0xe'),auth[_0xad47('0xc')](),controller['getItems']);router[_0xad47('0xf')]('/',auth[_0xad47('0xc')](),controller[_0xad47('0x10')]);router[_0xad47('0xf')]('/:id/clone',auth[_0xad47('0xc')](),controller['clone']);router[_0xad47('0xf')](_0xad47('0xe'),auth[_0xad47('0xc')](),controller[_0xad47('0x11')]);router[_0xad47('0x12')](_0xad47('0xb'),auth[_0xad47('0xc')](),controller[_0xad47('0x13')]);router[_0xad47('0x14')]('/:id',auth[_0xad47('0xc')](),controller[_0xad47('0x15')]);module[_0xad47('0x16')]=router; \ No newline at end of file +var _0xaf84=['addItem','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/clone','clone','/:id/items'];(function(_0x137755,_0x36ed3d){var _0x3e8b0e=function(_0x189f24){while(--_0x189f24){_0x137755['push'](_0x137755['shift']());}};_0x3e8b0e(++_0x36ed3d);}(_0xaf84,0xcd));var _0x4af8=function(_0x578e76,_0x2047bb){_0x578e76=_0x578e76-0x0;var _0x26e58b=_0xaf84[_0x578e76];return _0x26e58b;};'use strict';var multer=require(_0x4af8('0x0'));var util=require(_0x4af8('0x1'));var path=require(_0x4af8('0x2'));var timeout=require(_0x4af8('0x3'));var express=require(_0x4af8('0x4'));var router=express['Router']();var fs_extra=require(_0x4af8('0x5'));var auth=require(_0x4af8('0x6'));var interaction=require(_0x4af8('0x7'));var config=require(_0x4af8('0x8'));var controller=require(_0x4af8('0x9'));router[_0x4af8('0xa')]('/',auth[_0x4af8('0xb')](),controller[_0x4af8('0xc')]);router[_0x4af8('0xa')](_0x4af8('0xd'),auth[_0x4af8('0xb')](),controller[_0x4af8('0xe')]);router[_0x4af8('0xa')]('/:id/items',auth['isAuthenticated'](),controller['getItems']);router[_0x4af8('0xf')]('/',auth[_0x4af8('0xb')](),controller[_0x4af8('0x10')]);router[_0x4af8('0xf')](_0x4af8('0x11'),auth['isAuthenticated'](),controller[_0x4af8('0x12')]);router['post'](_0x4af8('0x13'),auth[_0x4af8('0xb')](),controller[_0x4af8('0x14')]);router[_0x4af8('0x15')](_0x4af8('0xd'),auth[_0x4af8('0xb')](),controller[_0x4af8('0x16')]);router[_0x4af8('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4af8('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index dd50558..17cecf2 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 _0x6f47=['#ffffff','squel','lodash','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x59a7e3,_0x287fcd){var _0xf09556=function(_0x452b36){while(--_0x452b36){_0x59a7e3['push'](_0x59a7e3['shift']());}};_0xf09556(++_0x287fcd);}(_0x6f47,0xc7));var _0x76f4=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x6f47[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));module['exports']={'title':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x76f4('0x3')]('long'),'get':function(){try{return JSON[_0x76f4('0x4')](this[_0x76f4('0x5')](_0x76f4('0x6')));}catch(_0x2523ba){return[];}},'set':function(_0x5754ca){try{this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')](_0x5754ca));}catch(_0x497f99){this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![],'defaultValue':_0x76f4('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x76f4('0x2')]},'titleFontSize':{'type':Sequelize[_0x76f4('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0x53ec,0x192));var _0xc53e=function(_0x5e9c85,_0x461674){_0x5e9c85=_0x5e9c85-0x0;var _0xcbdcf7=_0x53ec[_0x5e9c85];return _0xcbdcf7;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'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 2b88c3f..4bac0b4 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 _0x853e=['attrRefresh','widgetAttributes:\x20%s','stringify','body','create','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','merge','options','find','params','catch','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type'];(function(_0x3a3df9,_0x260c41){var _0x5457e0=function(_0x494fc2){while(--_0x494fc2){_0x3a3df9['push'](_0x3a3df9['shift']());}};_0x5457e0(++_0x260c41);}(_0x853e,0x1ea));var _0xe853=function(_0x186833,_0xdf7874){_0x186833=_0x186833-0x0;var _0x4cfe83=_0x853e[_0x186833];return _0x4cfe83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe853('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe853('0x1'));var rp=require('request-promise');var moment=require(_0xe853('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe853('0x3'));var util=require(_0xe853('0x4'));var path=require(_0xe853('0x5'));var sox=require(_0xe853('0x6'));var csv=require(_0xe853('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe853('0x8'));var _=require(_0xe853('0x9'));var squel=require(_0xe853('0xa'));var crypto=require(_0xe853('0xb'));var jsforce=require(_0xe853('0xc'));var deskjs=require(_0xe853('0xd'));var toCsv=require(_0xe853('0x7'));var querystring=require(_0xe853('0xe'));var Papa=require(_0xe853('0xf'));var Redis=require(_0xe853('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe853('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe853('0x12'));var config=require(_0xe853('0x13'));var licenseUtil=require(_0xe853('0x14'));var db=require('../../mysqldb')['db'];config[_0xe853('0x15')]=_[_0xe853('0x16')](config[_0xe853('0x15')],{'host':_0xe853('0x17'),'port':0x18eb});var socket=require(_0xe853('0x18'))(new Redis(config[_0xe853('0x15')]));require(_0xe853('0x19'))['register'](socket);function respondWithStatusCode(_0x4b8e2c,_0x5db22d){_0x5db22d=_0x5db22d||0xcc;return function(_0x552812){if(_0x552812){return _0x4b8e2c[_0xe853('0x1a')](_0x5db22d);}return _0x4b8e2c[_0xe853('0x1b')](_0x5db22d)[_0xe853('0x1c')]();};}function respondWithResult(_0x11e4a0,_0x21c5f0){_0x21c5f0=_0x21c5f0||0xc8;return function(_0x9309a5){if(_0x9309a5){return _0x11e4a0[_0xe853('0x1b')](_0x21c5f0)[_0xe853('0x1d')](_0x9309a5);}};}function respondWithFilteredResult(_0x2a98fa,_0x2f7e6e){return function(_0x30d868){if(_0x30d868){var _0x1d2526=typeof _0x2f7e6e[_0xe853('0x1e')]===_0xe853('0x1f')&&typeof _0x2f7e6e[_0xe853('0x20')]===_0xe853('0x1f');var _0x5f45cf=_0x30d868[_0xe853('0x21')];var _0x2e4fd0=_0x1d2526?0x0:_0x2f7e6e[_0xe853('0x1e')];var _0x3ecb11=_0x1d2526?_0x30d868[_0xe853('0x21')]:_0x2f7e6e[_0xe853('0x1e')]+_0x2f7e6e[_0xe853('0x20')];var _0x3d9e77;if(_0x3ecb11>=_0x5f45cf){_0x3ecb11=_0x5f45cf;_0x3d9e77=0xc8;}else{_0x3d9e77=0xce;}_0x2a98fa[_0xe853('0x1b')](_0x3d9e77);return _0x2a98fa[_0xe853('0x22')](_0xe853('0x23'),_0x2e4fd0+'-'+_0x3ecb11+'/'+_0x5f45cf)['json'](_0x30d868);}return null;};}function patchUpdates(_0x110362){return function(_0x3b6a23){try{jsonpatch[_0xe853('0x24')](_0x3b6a23,_0x110362,!![]);}catch(_0x209049){return BPromise[_0xe853('0x25')](_0x209049);}return _0x3b6a23[_0xe853('0x26')]();};}function saveUpdates(_0x3fa0e3,_0x217612){return function(_0x5466d7){if(_0x5466d7){return _0x5466d7[_0xe853('0x27')](_0x3fa0e3)[_0xe853('0x28')](function(_0x198895){return _0x198895;});}return null;};}function removeEntity(_0x2cb2f1,_0x105ce2){return function(_0x58454e){if(_0x58454e){return _0x58454e[_0xe853('0x29')]()[_0xe853('0x28')](function(){_0x2cb2f1['status'](0xcc)[_0xe853('0x1c')]();});}};}function handleEntityNotFound(_0x4d285a,_0x5c8852){return function(_0x545738){if(!_0x545738){_0x4d285a['sendStatus'](0x194);}return _0x545738;};}function handleError(_0x124049,_0x42c14f){_0x42c14f=_0x42c14f||0x1f4;return function(_0x438b5b){logger[_0xe853('0x2a')](_0x438b5b[_0xe853('0x2b')]);if(_0x438b5b[_0xe853('0x2c')]){delete _0x438b5b[_0xe853('0x2c')];}_0x124049[_0xe853('0x1b')](_0x42c14f)[_0xe853('0x2d')](_0x438b5b);};}exports[_0xe853('0x2e')]=function(_0x51fc77,_0x5d4876){var _0x139fa2={'raw':![],'where':{'id':_0x51fc77['params']['id']}},_0x82cb01={};_0x82cb01[_0xe853('0x2f')]=_['keys'](db[_0xe853('0x30')][_0xe853('0x31')]);_0x82cb01[_0xe853('0x32')]=_['keys'](_0x51fc77[_0xe853('0x32')]);_0x82cb01[_0xe853('0x33')]=_[_0xe853('0x34')](_0x82cb01[_0xe853('0x2f')],_0x82cb01[_0xe853('0x32')]);_0x139fa2[_0xe853('0x35')]=_[_0xe853('0x34')](_0x82cb01[_0xe853('0x2f')],qs[_0xe853('0x36')](_0x51fc77[_0xe853('0x32')][_0xe853('0x36')]));_0x139fa2['attributes']=_0x139fa2[_0xe853('0x35')]['length']?_0x139fa2[_0xe853('0x35')]:_0x82cb01[_0xe853('0x2f')];if(_0x51fc77[_0xe853('0x32')][_0xe853('0x37')]){_0x139fa2['include']=[{'all':!![]}];}_0x139fa2=_[_0xe853('0x38')]({},_0x139fa2,_0x51fc77[_0xe853('0x39')]);return db[_0xe853('0x30')][_0xe853('0x3a')](_0x139fa2)[_0xe853('0x28')](handleEntityNotFound(_0x5d4876,null))[_0xe853('0x28')](respondWithResult(_0x5d4876,null))['catch'](handleError(_0x5d4876,null));};exports[_0xe853('0x29')]=function(_0x40c7aa,_0x13bd8d){return db[_0xe853('0x30')][_0xe853('0x3a')]({'where':{'id':_0x40c7aa[_0xe853('0x3b')]['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x13bd8d,null))[_0xe853('0x28')](removeEntity(_0x13bd8d,null))[_0xe853('0x3c')](handleError(_0x13bd8d,null));};function widgetAttributes(_0x5d9735){try{switch(_0x5d9735['type']){case _0xe853('0x3d'):return[{'name':_0xe853('0x3e'),'value':_0x5d9735[_0xe853('0x3e')]||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x0]?_0x5d9735['attrs'][0x0]['value']:undefined)||'https://'}];case _0xe853('0x40'):return[{'name':_0xe853('0x41'),'value':_0x5d9735[_0xe853('0x41')]||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x0]?_0x5d9735[_0xe853('0x3f')][0x0][_0xe853('0x42')]:undefined)||''}];case _0xe853('0x43'):return[{'name':_0xe853('0x44'),'value':_0x5d9735[_0xe853('0x44')]||(_0x5d9735['attrs']&&_0x5d9735['attrs'][0x0]?_0x5d9735[_0xe853('0x3f')][0x0]['value']:undefined)||_0xe853('0x45')},{'name':_0xe853('0x46'),'value':_0x5d9735[_0xe853('0x46')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x1]?_0x5d9735[_0xe853('0x3f')][0x1][_0xe853('0x42')]:undefined)||'0.00'},{'name':_0xe853('0x47'),'value':_0x5d9735[_0xe853('0x47')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735['attrs'][0x2]?_0x5d9735[_0xe853('0x3f')][0x2][_0xe853('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0xe853('0x48'),'value':_0x5d9735[_0xe853('0x48')]||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x0]?_0x5d9735[_0xe853('0x3f')][0x0][_0xe853('0x42')]:undefined)||_0xe853('0x49')},{'name':'attrVoiceQueues','value':_0x5d9735[_0xe853('0x4a')]||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x1]?_0x5d9735[_0xe853('0x3f')][0x1][_0xe853('0x42')]:undefined)||[]},{'name':'attrFontSize','value':_0x5d9735[_0xe853('0x47')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735['attrs'][0x2]?_0x5d9735[_0xe853('0x3f')][0x2]['value']:undefined)||0x14},{'name':_0xe853('0x4b'),'value':_0x5d9735[_0xe853('0x4b')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x3]?_0x5d9735['attrs'][0x3]['value']:undefined)||_0xe853('0x4c')},{'name':_0xe853('0x4d'),'value':_0x5d9735['attrEmailAccounts']||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x4]?_0x5d9735['attrs'][0x4]['value']:undefined)||''},{'name':_0xe853('0x4e'),'value':_0x5d9735[_0xe853('0x4e')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x5]?_0x5d9735[_0xe853('0x3f')][0x5][_0xe853('0x42')]:undefined)||''},{'name':_0xe853('0x4f'),'value':_0x5d9735[_0xe853('0x4f')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x6]?_0x5d9735['attrs'][0x6]['value']:undefined)||''},{'name':_0xe853('0x50'),'value':_0x5d9735[_0xe853('0x50')]||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x7]?_0x5d9735[_0xe853('0x3f')][0x7]['value']:undefined)||''},{'name':_0xe853('0x51'),'value':_0x5d9735[_0xe853('0x51')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735['attrs'][0x8]?_0x5d9735[_0xe853('0x3f')][0x8][_0xe853('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5d9735[_0xe853('0x52')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x9]?_0x5d9735[_0xe853('0x3f')][0x9][_0xe853('0x42')]:undefined)||''}];case _0xe853('0x53'):case _0xe853('0x54'):return[{'name':_0xe853('0x55'),'value':_0x5d9735['attrSerie1']||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x0]?_0x5d9735[_0xe853('0x3f')][0x0][_0xe853('0x42')]:undefined)||_0xe853('0x49')},{'name':_0xe853('0x56'),'value':_0x5d9735[_0xe853('0x56')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x1]?_0x5d9735[_0xe853('0x3f')][0x1][_0xe853('0x42')]:undefined)||null},{'name':_0xe853('0x57'),'value':_0x5d9735[_0xe853('0x57')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x2]?_0x5d9735[_0xe853('0x3f')][0x2]['value']:undefined)||null},{'name':_0xe853('0x4a'),'value':_0x5d9735['attrVoiceQueues']||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x3]?_0x5d9735[_0xe853('0x3f')][0x3]['value']:undefined)||[]},{'name':_0xe853('0x4b'),'value':_0x5d9735[_0xe853('0x4b')]||(_0x5d9735['attrs']&&_0x5d9735['attrs'][0x4]?_0x5d9735[_0xe853('0x3f')][0x4][_0xe853('0x42')]:undefined)||'voice'},{'name':_0xe853('0x4d'),'value':_0x5d9735[_0xe853('0x4d')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x5]?_0x5d9735[_0xe853('0x3f')][0x5][_0xe853('0x42')]:undefined)||''},{'name':_0xe853('0x4e'),'value':_0x5d9735['attrFaxAccounts']||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x6]?_0x5d9735[_0xe853('0x3f')][0x6][_0xe853('0x42')]:undefined)||''},{'name':_0xe853('0x4f'),'value':_0x5d9735['attrSmsAccounts']||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x7]?_0x5d9735[_0xe853('0x3f')][0x7][_0xe853('0x42')]:undefined)||''},{'name':_0xe853('0x50'),'value':_0x5d9735[_0xe853('0x50')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735['attrs'][0x8]?_0x5d9735[_0xe853('0x3f')][0x8]['value']:undefined)||''},{'name':_0xe853('0x51'),'value':_0x5d9735[_0xe853('0x51')]||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x9]?_0x5d9735[_0xe853('0x3f')][0x9]['value']:undefined)||''},{'name':_0xe853('0x52'),'value':_0x5d9735[_0xe853('0x52')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735['attrs'][0xa]?_0x5d9735['attrs'][0xa]['value']:undefined)||''}];case _0xe853('0x58'):return[{'name':_0xe853('0x59'),'type':_0x5d9735[_0xe853('0x5a')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x0]?_0x5d9735[_0xe853('0x3f')][0x0][_0xe853('0x5b')]:undefined)||null,'value':_0x5d9735[_0xe853('0x59')]||(_0x5d9735[_0xe853('0x3f')]&&_0x5d9735[_0xe853('0x3f')][0x0]?_0x5d9735['attrs'][0x0][_0xe853('0x42')]:undefined)||null},{'name':_0xe853('0x5c'),'value':_0x5d9735[_0xe853('0x5c')]||(_0x5d9735['attrs']&&_0x5d9735[_0xe853('0x3f')][0x1]?_0x5d9735[_0xe853('0x3f')][0x1][_0xe853('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x1acc07){logger[_0xe853('0x2a')](_0xe853('0x5d'),JSON[_0xe853('0x5e')](_0x1acc07));return[];}}exports['create']=function(_0x4f8699,_0x215e51){if(_0x4f8699[_0xe853('0x5f')]){_0x4f8699[_0xe853('0x5f')][_0xe853('0x3f')]=widgetAttributes(_0x4f8699[_0xe853('0x5f')]);}return db[_0xe853('0x30')][_0xe853('0x60')](_0x4f8699[_0xe853('0x5f')],{})['then'](respondWithResult(_0x215e51,0xc9))[_0xe853('0x3c')](handleError(_0x215e51,null));};exports[_0xe853('0x27')]=function(_0x49a91e,_0x223475){if(_0x49a91e['body']['id']){delete _0x49a91e[_0xe853('0x5f')]['id'];}_0x49a91e['body']['attrs']=widgetAttributes(_0x49a91e[_0xe853('0x5f')]);return db['DashboardItem'][_0xe853('0x3a')]({'where':{'id':_0x49a91e['params']['id']}})['then'](handleEntityNotFound(_0x223475,null))[_0xe853('0x28')](saveUpdates(_0x49a91e[_0xe853('0x5f')],null))[_0xe853('0x28')](respondWithResult(_0x223475,null))[_0xe853('0x3c')](handleError(_0x223475,null));}; \ No newline at end of file +var _0x83d0=['fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','rawAttributes','keys','filters','query','attributes','fields','length','includeAll','include','options','DashboardItem','find','attrUrl','attrs','value','attrHourFormat','HH:mm:ss','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','reportType','type','attrReport','attrRefresh','stringify','create','body','catch','eml-format','rimraf','zip-dir'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x83d0,0xb7));var _0x083d=function(_0x91e558,_0x13d88c){_0x91e558=_0x91e558-0x0;var _0x10c029=_0x83d0[_0x91e558];return _0x10c029;};'use strict';var emlformat=require(_0x083d('0x0'));var rimraf=require(_0x083d('0x1'));var zipdir=require(_0x083d('0x2'));var jsonpatch=require(_0x083d('0x3'));var rp=require(_0x083d('0x4'));var moment=require(_0x083d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x083d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x083d('0x7'));var csv=require(_0x083d('0x8'));var ejs=require(_0x083d('0x9'));var fs=require('fs');var fs_extra=require(_0x083d('0xa'));var _=require(_0x083d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x083d('0xc'));var deskjs=require(_0x083d('0xd'));var toCsv=require(_0x083d('0x8'));var querystring=require('querystring');var Papa=require(_0x083d('0xe'));var Redis=require(_0x083d('0xf'));var authService=require(_0x083d('0x10'));var qs=require(_0x083d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x083d('0x12'));var logger=require('../../config/logger')(_0x083d('0x13'));var utils=require(_0x083d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x083d('0x15'));var db=require(_0x083d('0x16'))['db'];config[_0x083d('0x17')]=_[_0x083d('0x18')](config[_0x083d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x083d('0x19'))(new Redis(config[_0x083d('0x17')]));require('./dashboardItem.socket')[_0x083d('0x1a')](socket);function respondWithStatusCode(_0x525a36,_0x47a16d){_0x47a16d=_0x47a16d||0xcc;return function(_0x4169ca){if(_0x4169ca){return _0x525a36[_0x083d('0x1b')](_0x47a16d);}return _0x525a36[_0x083d('0x1c')](_0x47a16d)[_0x083d('0x1d')]();};}function respondWithResult(_0x381455,_0x4d6456){_0x4d6456=_0x4d6456||0xc8;return function(_0x2ec521){if(_0x2ec521){return _0x381455['status'](_0x4d6456)[_0x083d('0x1e')](_0x2ec521);}};}function respondWithFilteredResult(_0x28893f,_0x24708d){return function(_0xb34759){if(_0xb34759){var _0xdfd7de=typeof _0x24708d[_0x083d('0x1f')]===_0x083d('0x20')&&typeof _0x24708d[_0x083d('0x21')]===_0x083d('0x20');var _0x2cb79c=_0xb34759[_0x083d('0x22')];var _0xb8a16f=_0xdfd7de?0x0:_0x24708d['offset'];var _0x24dd4e=_0xdfd7de?_0xb34759['count']:_0x24708d[_0x083d('0x1f')]+_0x24708d[_0x083d('0x21')];var _0x48bf68;if(_0x24dd4e>=_0x2cb79c){_0x24dd4e=_0x2cb79c;_0x48bf68=0xc8;}else{_0x48bf68=0xce;}_0x28893f[_0x083d('0x1c')](_0x48bf68);return _0x28893f['set']('Content-Range',_0xb8a16f+'-'+_0x24dd4e+'/'+_0x2cb79c)['json'](_0xb34759);}return null;};}function patchUpdates(_0xcde93c){return function(_0x32f1ba){try{jsonpatch[_0x083d('0x23')](_0x32f1ba,_0xcde93c,!![]);}catch(_0x2669b6){return BPromise[_0x083d('0x24')](_0x2669b6);}return _0x32f1ba[_0x083d('0x25')]();};}function saveUpdates(_0x5d8397,_0x9e0377){return function(_0x33f423){if(_0x33f423){return _0x33f423['update'](_0x5d8397)[_0x083d('0x26')](function(_0x38ca23){return _0x38ca23;});}return null;};}function removeEntity(_0x33d32a,_0x3117af){return function(_0x42a8f8){if(_0x42a8f8){return _0x42a8f8[_0x083d('0x27')]()[_0x083d('0x26')](function(){_0x33d32a[_0x083d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6bccbd,_0x50e5ae){return function(_0x2252fa){if(!_0x2252fa){_0x6bccbd[_0x083d('0x1b')](0x194);}return _0x2252fa;};}function handleError(_0x252340,_0x449ed8){_0x449ed8=_0x449ed8||0x1f4;return function(_0x3e59d0){logger[_0x083d('0x28')](_0x3e59d0[_0x083d('0x29')]);if(_0x3e59d0[_0x083d('0x2a')]){delete _0x3e59d0[_0x083d('0x2a')];}_0x252340[_0x083d('0x1c')](_0x449ed8)[_0x083d('0x2b')](_0x3e59d0);};}exports[_0x083d('0x2c')]=function(_0x4588df,_0x2c7223){var _0x28b90e={'raw':![],'where':{'id':_0x4588df[_0x083d('0x2d')]['id']}},_0x563817={};_0x563817[_0x083d('0x2e')]=_['keys'](db['DashboardItem'][_0x083d('0x2f')]);_0x563817['query']=_[_0x083d('0x30')](_0x4588df['query']);_0x563817[_0x083d('0x31')]=_['intersection'](_0x563817[_0x083d('0x2e')],_0x563817[_0x083d('0x32')]);_0x28b90e[_0x083d('0x33')]=_['intersection'](_0x563817['model'],qs[_0x083d('0x34')](_0x4588df['query'][_0x083d('0x34')]));_0x28b90e[_0x083d('0x33')]=_0x28b90e[_0x083d('0x33')][_0x083d('0x35')]?_0x28b90e['attributes']:_0x563817[_0x083d('0x2e')];if(_0x4588df[_0x083d('0x32')][_0x083d('0x36')]){_0x28b90e[_0x083d('0x37')]=[{'all':!![]}];}_0x28b90e=_['merge']({},_0x28b90e,_0x4588df[_0x083d('0x38')]);return db[_0x083d('0x39')][_0x083d('0x3a')](_0x28b90e)[_0x083d('0x26')](handleEntityNotFound(_0x2c7223,null))['then'](respondWithResult(_0x2c7223,null))['catch'](handleError(_0x2c7223,null));};exports[_0x083d('0x27')]=function(_0x7ae2c4,_0x3b0025){return db[_0x083d('0x39')][_0x083d('0x3a')]({'where':{'id':_0x7ae2c4['params']['id']}})[_0x083d('0x26')](handleEntityNotFound(_0x3b0025,null))[_0x083d('0x26')](removeEntity(_0x3b0025,null))['catch'](handleError(_0x3b0025,null));};function widgetAttributes(_0x952022){try{switch(_0x952022['type']){case'iframe':return[{'name':_0x083d('0x3b'),'value':_0x952022[_0x083d('0x3b')]||(_0x952022['attrs']&&_0x952022[_0x083d('0x3c')][0x0]?_0x952022[_0x083d('0x3c')][0x0][_0x083d('0x3d')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x952022['attrPath']||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x0]?_0x952022[_0x083d('0x3c')][0x0][_0x083d('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x083d('0x3e'),'value':_0x952022[_0x083d('0x3e')]||(_0x952022['attrs']&&_0x952022[_0x083d('0x3c')][0x0]?_0x952022[_0x083d('0x3c')][0x0][_0x083d('0x3d')]:undefined)||_0x083d('0x3f')},{'name':_0x083d('0x40'),'value':_0x952022[_0x083d('0x40')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x1]?_0x952022['attrs'][0x1][_0x083d('0x3d')]:undefined)||_0x083d('0x41')},{'name':_0x083d('0x42'),'value':_0x952022[_0x083d('0x42')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x2]?_0x952022[_0x083d('0x3c')][0x2]['value']:undefined)||0xc}];case _0x083d('0x43'):return[{'name':_0x083d('0x44'),'value':_0x952022['attrMetric']||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x0]?_0x952022[_0x083d('0x3c')][0x0][_0x083d('0x3d')]:undefined)||_0x083d('0x45')},{'name':'attrVoiceQueues','value':_0x952022[_0x083d('0x46')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x1]?_0x952022[_0x083d('0x3c')][0x1][_0x083d('0x3d')]:undefined)||[]},{'name':'attrFontSize','value':_0x952022[_0x083d('0x42')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x2]?_0x952022[_0x083d('0x3c')][0x2][_0x083d('0x3d')]:undefined)||0x14},{'name':_0x083d('0x47'),'value':_0x952022['attrChannel']||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x3]?_0x952022[_0x083d('0x3c')][0x3][_0x083d('0x3d')]:undefined)||_0x083d('0x48')},{'name':_0x083d('0x49'),'value':_0x952022[_0x083d('0x49')]||(_0x952022['attrs']&&_0x952022['attrs'][0x4]?_0x952022['attrs'][0x4][_0x083d('0x3d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x952022[_0x083d('0x4a')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x5]?_0x952022[_0x083d('0x3c')][0x5]['value']:undefined)||''},{'name':_0x083d('0x4b'),'value':_0x952022[_0x083d('0x4b')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x6]?_0x952022[_0x083d('0x3c')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x952022['attrOpenchannelAccounts']||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x7]?_0x952022[_0x083d('0x3c')][0x7][_0x083d('0x3d')]:undefined)||''},{'name':_0x083d('0x4c'),'value':_0x952022[_0x083d('0x4c')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x8]?_0x952022[_0x083d('0x3c')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x952022[_0x083d('0x4d')]||(_0x952022['attrs']&&_0x952022[_0x083d('0x3c')][0x9]?_0x952022[_0x083d('0x3c')][0x9][_0x083d('0x3d')]:undefined)||''}];case _0x083d('0x4e'):case _0x083d('0x4f'):return[{'name':'attrSerie1','value':_0x952022[_0x083d('0x50')]||(_0x952022['attrs']&&_0x952022['attrs'][0x0]?_0x952022[_0x083d('0x3c')][0x0][_0x083d('0x3d')]:undefined)||_0x083d('0x45')},{'name':_0x083d('0x51'),'value':_0x952022[_0x083d('0x51')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x1]?_0x952022['attrs'][0x1][_0x083d('0x3d')]:undefined)||null},{'name':_0x083d('0x52'),'value':_0x952022[_0x083d('0x52')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x2]?_0x952022[_0x083d('0x3c')][0x2][_0x083d('0x3d')]:undefined)||null},{'name':_0x083d('0x46'),'value':_0x952022['attrVoiceQueues']||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x3]?_0x952022[_0x083d('0x3c')][0x3][_0x083d('0x3d')]:undefined)||[]},{'name':_0x083d('0x47'),'value':_0x952022[_0x083d('0x47')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x4]?_0x952022[_0x083d('0x3c')][0x4][_0x083d('0x3d')]:undefined)||_0x083d('0x48')},{'name':_0x083d('0x49'),'value':_0x952022[_0x083d('0x49')]||(_0x952022['attrs']&&_0x952022['attrs'][0x5]?_0x952022[_0x083d('0x3c')][0x5][_0x083d('0x3d')]:undefined)||''},{'name':_0x083d('0x4a'),'value':_0x952022[_0x083d('0x4a')]||(_0x952022['attrs']&&_0x952022[_0x083d('0x3c')][0x6]?_0x952022[_0x083d('0x3c')][0x6][_0x083d('0x3d')]:undefined)||''},{'name':_0x083d('0x4b'),'value':_0x952022[_0x083d('0x4b')]||(_0x952022['attrs']&&_0x952022['attrs'][0x7]?_0x952022[_0x083d('0x3c')][0x7][_0x083d('0x3d')]:undefined)||''},{'name':_0x083d('0x53'),'value':_0x952022['attrOpenchannelAccounts']||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x8]?_0x952022['attrs'][0x8][_0x083d('0x3d')]:undefined)||''},{'name':_0x083d('0x4c'),'value':_0x952022['attrWhatsappAccounts']||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x9]?_0x952022['attrs'][0x9][_0x083d('0x3d')]:undefined)||''},{'name':_0x083d('0x4d'),'value':_0x952022['attrChatWebsites']||(_0x952022['attrs']&&_0x952022[_0x083d('0x3c')][0xa]?_0x952022[_0x083d('0x3c')][0xa][_0x083d('0x3d')]:undefined)||''}];case _0x083d('0x54'):return[{'name':'attrReport','type':_0x952022[_0x083d('0x55')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x0]?_0x952022['attrs'][0x0][_0x083d('0x56')]:undefined)||null,'value':_0x952022[_0x083d('0x57')]||(_0x952022[_0x083d('0x3c')]&&_0x952022[_0x083d('0x3c')][0x0]?_0x952022['attrs'][0x0]['value']:undefined)||null},{'name':_0x083d('0x58'),'value':_0x952022[_0x083d('0x58')]||(_0x952022['attrs']&&_0x952022[_0x083d('0x3c')][0x1]?_0x952022[_0x083d('0x3c')][0x1][_0x083d('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x3fc931){logger[_0x083d('0x28')]('widgetAttributes:\x20%s',JSON[_0x083d('0x59')](_0x3fc931));return[];}}exports[_0x083d('0x5a')]=function(_0xda7409,_0x3a1807){if(_0xda7409[_0x083d('0x5b')]){_0xda7409[_0x083d('0x5b')][_0x083d('0x3c')]=widgetAttributes(_0xda7409[_0x083d('0x5b')]);}return db['DashboardItem'][_0x083d('0x5a')](_0xda7409[_0x083d('0x5b')],{})[_0x083d('0x26')](respondWithResult(_0x3a1807,0xc9))['catch'](handleError(_0x3a1807,null));};exports['update']=function(_0x63eda5,_0x43298f){if(_0x63eda5[_0x083d('0x5b')]['id']){delete _0x63eda5[_0x083d('0x5b')]['id'];}_0x63eda5['body'][_0x083d('0x3c')]=widgetAttributes(_0x63eda5['body']);return db['DashboardItem'][_0x083d('0x3a')]({'where':{'id':_0x63eda5[_0x083d('0x2d')]['id']}})[_0x083d('0x26')](handleEntityNotFound(_0x43298f,null))[_0x083d('0x26')](saveUpdates(_0x63eda5[_0x083d('0x5b')],null))[_0x083d('0x26')](respondWithResult(_0x43298f,null))[_0x083d('0x5c')](handleError(_0x43298f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 67696b6..3c0aeff 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 _0x1ec6=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove'];(function(_0x16f77c,_0x5256b1){var _0x78986e=function(_0x10430){while(--_0x10430){_0x16f77c['push'](_0x16f77c['shift']());}};_0x78986e(++_0x5256b1);}(_0x1ec6,0x158));var _0x61ec=function(_0x4f9ae8,_0x1e0972){_0x4f9ae8=_0x4f9ae8-0x0;var _0x5cb56e=_0x1ec6[_0x4f9ae8];return _0x5cb56e;};'use strict';var EventEmitter=require(_0x61ec('0x0'));var DashboardItem=require(_0x61ec('0x1'))['db'][_0x61ec('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x61ec('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x61ec('0x4'),'afterDestroy':_0x61ec('0x5')};function emitEvent(_0x5f55ee){return function(_0x10e1e5,_0xd61154,_0x3cb328){DashboardItemEvents[_0x61ec('0x6')](_0x5f55ee+':'+_0x10e1e5['id'],_0x10e1e5);DashboardItemEvents[_0x61ec('0x6')](_0x5f55ee,_0x10e1e5);_0x3cb328(null);};}for(var e in events){if(events[_0x61ec('0x7')](e)){var event=events[e];DashboardItem[_0x61ec('0x8')](e,emitEvent(event));}}module[_0x61ec('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xadbb=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0xa6c6af,_0x975e53){var _0x261f9a=function(_0x40df9a){while(--_0x40df9a){_0xa6c6af['push'](_0xa6c6af['shift']());}};_0x261f9a(++_0x975e53);}(_0xadbb,0x97));var _0xbadb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xadbb[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xbadb('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbadb('0x1')](0x0);var events={'afterCreate':_0xbadb('0x2'),'afterUpdate':_0xbadb('0x3'),'afterDestroy':_0xbadb('0x4')};function emitEvent(_0x20fe2b){return function(_0x36d79f,_0x232761,_0x11944d){DashboardItemEvents[_0xbadb('0x5')](_0x20fe2b+':'+_0x36d79f['id'],_0x36d79f);DashboardItemEvents[_0xbadb('0x5')](_0x20fe2b,_0x36d79f);_0x11944d(null);};}for(var e in events){if(events[_0xbadb('0x6')](e)){var event=events[e];DashboardItem[_0xbadb('0x7')](e,emitEvent(event));}}module[_0xbadb('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 2b602e3..d729d06 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 _0xeb8c=['util','../../config/logger','bluebird','request-promise','path','./dashboardItem.attributes','define','DashboardItem','lodash'];(function(_0x306646,_0xdc2e1b){var _0x40bd8d=function(_0x397d05){while(--_0x397d05){_0x306646['push'](_0x306646['shift']());}};_0x40bd8d(++_0xdc2e1b);}(_0xeb8c,0x170));var _0xceb8=function(_0x467aae,_0x515e6e){_0x467aae=_0x467aae-0x0;var _0x543242=_0xeb8c[_0x467aae];return _0x543242;};'use strict';var _=require(_0xceb8('0x0'));var util=require(_0xceb8('0x1'));var logger=require(_0xceb8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xceb8('0x3'));var rp=require(_0xceb8('0x4'));var fs=require('fs');var path=require(_0xceb8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xceb8('0x6'));module['exports']=function(_0x233ede,_0x7a0155){return _0x233ede[_0xceb8('0x7')](_0xceb8('0x8'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf73=['bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','../../config/logger','moment'];(function(_0x16eed0,_0xd3b40c){var _0x3cc645=function(_0x5e4b5a){while(--_0x5e4b5a){_0x16eed0['push'](_0x16eed0['shift']());}};_0x3cc645(++_0xd3b40c);}(_0xcf73,0x15c));var _0x3cf7=function(_0x29cd1f,_0x47ed72){_0x29cd1f=_0x29cd1f-0x0;var _0x29a8b5=_0xcf73[_0x29cd1f];return _0x29a8b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3cf7('0x0'))('api');var moment=require(_0x3cf7('0x1'));var BPromise=require(_0x3cf7('0x2'));var rp=require(_0x3cf7('0x3'));var fs=require('fs');var path=require(_0x3cf7('0x4'));var rimraf=require(_0x3cf7('0x5'));var config=require(_0x3cf7('0x6'));var attributes=require(_0x3cf7('0x7'));module[_0x3cf7('0x8')]=function(_0x207292,_0x5e68bb){return _0x207292['define'](_0x3cf7('0x9'),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 bcad3fc..ac2f887 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 _0x015b=['client','http','redis','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3d8d0a,_0x11bb87){var _0x5b9df5=function(_0x3ecba2){while(--_0x3ecba2){_0x3d8d0a['push'](_0x3d8d0a['shift']());}};_0x5b9df5(++_0x11bb87);}(_0x015b,0xd6));var _0xb015=function(_0x3ea5e1,_0x17c486){_0x3ea5e1=_0x3ea5e1-0x0;var _0x1b81d7=_0x015b[_0x3ea5e1];return _0x1b81d7;};'use strict';var _=require(_0xb015('0x0'));var util=require(_0xb015('0x1'));var moment=require(_0xb015('0x2'));var BPromise=require(_0xb015('0x3'));var rs=require(_0xb015('0x4'));var fs=require('fs');var Redis=require(_0xb015('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb015('0x6'))(_0xb015('0x7'));var config=require(_0xb015('0x8'));var jayson=require(_0xb015('0x9'));var client=jayson[_0xb015('0xa')][_0xb015('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb015('0xc')],{'host':_0xb015('0xd'),'port':0x18eb});var socket=require(_0xb015('0xe'))(new Redis(config[_0xb015('0xc')]));require('./dashboardItem.socket')[_0xb015('0xf')](socket);function respondWithRpcPromise(_0x1e1bf5,_0x55bd47,_0xb0e4cf){return new BPromise(function(_0x47625c,_0x33ac60){return client[_0xb015('0x10')](_0x1e1bf5,_0xb0e4cf)[_0xb015('0x11')](function(_0xd417c9){logger[_0xb015('0x12')](_0xb015('0x13'),_0x55bd47,_0xb015('0x14'));logger[_0xb015('0x15')](_0xb015('0x16'),_0x55bd47,'request\x20sent',JSON[_0xb015('0x17')](_0xd417c9));if(_0xd417c9[_0xb015('0x18')]){if(_0xd417c9[_0xb015('0x18')][_0xb015('0x19')]===0x1f4){logger[_0xb015('0x18')]('DashboardItem,\x20%s,\x20%s',_0x55bd47,_0xd417c9['error']['message']);return _0x33ac60(_0xd417c9['error']['message']);}logger[_0xb015('0x18')]('DashboardItem,\x20%s,\x20%s',_0x55bd47,_0xd417c9[_0xb015('0x18')][_0xb015('0x1a')]);return _0x47625c(_0xd417c9[_0xb015('0x18')]['message']);}else{logger[_0xb015('0x12')](_0xb015('0x13'),_0x55bd47,'request\x20sent');_0x47625c(_0xd417c9['result']['message']);}})[_0xb015('0x1b')](function(_0x4f1b9b){logger[_0xb015('0x18')](_0xb015('0x13'),_0x55bd47,_0x4f1b9b);_0x33ac60(_0x4f1b9b);});});} \ No newline at end of file +var _0xa426=['http','redis','socket.io-emitter','./dashboardItem.socket','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xa426,0xc5));var _0x6a42=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xa426[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x6a42('0x0'));var util=require(_0x6a42('0x1'));var moment=require(_0x6a42('0x2'));var BPromise=require(_0x6a42('0x3'));var rs=require(_0x6a42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6a42('0x5'));var logger=require('../../config/logger')(_0x6a42('0x6'));var config=require(_0x6a42('0x7'));var jayson=require(_0x6a42('0x8'));var client=jayson[_0x6a42('0x9')][_0x6a42('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6a42('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a42('0xc'))(new Redis(config[_0x6a42('0xb')]));require(_0x6a42('0xd'))['register'](socket);function respondWithRpcPromise(_0x4e5cce,_0x3b1af1,_0x3a80d7){return new BPromise(function(_0x597cc8,_0x354d64){return client['request'](_0x4e5cce,_0x3a80d7)[_0x6a42('0xe')](function(_0x33a8ec){logger[_0x6a42('0xf')](_0x6a42('0x10'),_0x3b1af1,_0x6a42('0x11'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3b1af1,_0x6a42('0x11'),JSON['stringify'](_0x33a8ec));if(_0x33a8ec['error']){if(_0x33a8ec[_0x6a42('0x12')][_0x6a42('0x13')]===0x1f4){logger[_0x6a42('0x12')](_0x6a42('0x10'),_0x3b1af1,_0x33a8ec[_0x6a42('0x12')][_0x6a42('0x14')]);return _0x354d64(_0x33a8ec[_0x6a42('0x12')][_0x6a42('0x14')]);}logger[_0x6a42('0x12')](_0x6a42('0x10'),_0x3b1af1,_0x33a8ec[_0x6a42('0x12')]['message']);return _0x597cc8(_0x33a8ec['error']['message']);}else{logger[_0x6a42('0xf')](_0x6a42('0x10'),_0x3b1af1,'request\x20sent');_0x597cc8(_0x33a8ec[_0x6a42('0x15')][_0x6a42('0x14')]);}})[_0x6a42('0x16')](function(_0x12ca08){logger['error'](_0x6a42('0x10'),_0x3b1af1,_0x12ca08);_0x354d64(_0x12ca08);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index d7c84e8..890236c 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 _0x519b=['save','emit','removeListener','length','dashboardItem:','./dashboardItem.events'];(function(_0xc671b8,_0x4640d0){var _0x24b542=function(_0x224486){while(--_0x224486){_0xc671b8['push'](_0xc671b8['shift']());}};_0x24b542(++_0x4640d0);}(_0x519b,0x71));var _0xb519=function(_0x16295e,_0x4a9b05){_0x16295e=_0x16295e-0x0;var _0x2d9e54=_0x519b[_0x16295e];return _0x2d9e54;};'use strict';var DashboardItemEvents=require(_0xb519('0x0'));var events=[_0xb519('0x1'),'remove','update'];function createListener(_0x4af4e4,_0xd951db){return function(_0xd65b4c){_0xd951db[_0xb519('0x2')](_0x4af4e4,_0xd65b4c);};}function removeListener(_0x5f46ae,_0x2c74e4){return function(){DashboardItemEvents[_0xb519('0x3')](_0x5f46ae,_0x2c74e4);};}exports['register']=function(_0x516871){for(var _0x4450ee=0x0,_0x38fdbf=events[_0xb519('0x4')];_0x4450ee<_0x38fdbf;_0x4450ee++){var _0x5e9155=events[_0x4450ee];var _0x40e6e2=createListener(_0xb519('0x5')+_0x5e9155,_0x516871);DashboardItemEvents['on'](_0x5e9155,_0x40e6e2);}}; \ No newline at end of file +var _0x6e2c=['removeListener','register','length','dashboardItem:','./dashboardItem.events','remove','update','emit'];(function(_0xbc3ff0,_0x3eaaca){var _0x4cf6b5=function(_0x103b97){while(--_0x103b97){_0xbc3ff0['push'](_0xbc3ff0['shift']());}};_0x4cf6b5(++_0x3eaaca);}(_0x6e2c,0x154));var _0xc6e2=function(_0x3cfc06,_0x555e8a){_0x3cfc06=_0x3cfc06-0x0;var _0x49f350=_0x6e2c[_0x3cfc06];return _0x49f350;};'use strict';var DashboardItemEvents=require(_0xc6e2('0x0'));var events=['save',_0xc6e2('0x1'),_0xc6e2('0x2')];function createListener(_0x32cac1,_0x1d2355){return function(_0x5e21d7){_0x1d2355[_0xc6e2('0x3')](_0x32cac1,_0x5e21d7);};}function removeListener(_0x40b807,_0x2cfea7){return function(){DashboardItemEvents[_0xc6e2('0x4')](_0x40b807,_0x2cfea7);};}exports[_0xc6e2('0x5')]=function(_0x579bdc){for(var _0x1d1cd0=0x0,_0x77da85=events[_0xc6e2('0x6')];_0x1d1cd0<_0x77da85;_0x1d1cd0++){var _0x526bb4=events[_0x1d1cd0];var _0x581243=createListener(_0xc6e2('0x7')+_0x526bb4,_0x579bdc);DashboardItemEvents['on'](_0x526bb4,_0x581243);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 4cba8f4..7792519 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 _0xb1cd=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','create','update','delete','destroy'];(function(_0x4f5d9c,_0x26d3de){var _0x3444a7=function(_0x2fa164){while(--_0x2fa164){_0x4f5d9c['push'](_0x4f5d9c['shift']());}};_0x3444a7(++_0x26d3de);}(_0xb1cd,0xcd));var _0xdb1c=function(_0x1d3348,_0x5395da){_0x1d3348=_0x1d3348-0x0;var _0x4833e6=_0xb1cd[_0x1d3348];return _0x4833e6;};'use strict';var multer=require(_0xdb1c('0x0'));var util=require(_0xdb1c('0x1'));var path=require('path');var timeout=require(_0xdb1c('0x2'));var express=require(_0xdb1c('0x3'));var router=express[_0xdb1c('0x4')]();var fs_extra=require(_0xdb1c('0x5'));var auth=require(_0xdb1c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb1c('0x7'));var controller=require(_0xdb1c('0x8'));router['get'](_0xdb1c('0x9'),auth[_0xdb1c('0xa')](),controller['show']);router[_0xdb1c('0xb')]('/',auth[_0xdb1c('0xa')](),controller[_0xdb1c('0xc')]);router['put'](_0xdb1c('0x9'),auth[_0xdb1c('0xa')](),controller[_0xdb1c('0xd')]);router[_0xdb1c('0xe')](_0xdb1c('0x9'),auth[_0xdb1c('0xa')](),controller[_0xdb1c('0xf')]);module[_0xdb1c('0x10')]=router; \ No newline at end of file +var _0xcc6e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','post','put','update','destroy','exports'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xcc6e,0x154));var _0xecc6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xecc6('0x0'));var util=require(_0xecc6('0x1'));var path=require(_0xecc6('0x2'));var timeout=require(_0xecc6('0x3'));var express=require(_0xecc6('0x4'));var router=express[_0xecc6('0x5')]();var fs_extra=require(_0xecc6('0x6'));var auth=require(_0xecc6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0xecc6('0x8')](_0xecc6('0x9'),auth[_0xecc6('0xa')](),controller[_0xecc6('0xb')]);router[_0xecc6('0xc')]('/',auth[_0xecc6('0xa')](),controller['create']);router[_0xecc6('0xd')](_0xecc6('0x9'),auth[_0xecc6('0xa')](),controller[_0xecc6('0xe')]);router['delete'](_0xecc6('0x9'),auth[_0xecc6('0xa')](),controller[_0xecc6('0xf')]);module[_0xecc6('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 4b7708e..6eb7ad0 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 _0x4240=['STRING','sequelize','ENUM','second','third','first'];(function(_0x511723,_0x4db8e2){var _0x25add0=function(_0x276373){while(--_0x276373){_0x511723['push'](_0x511723['shift']());}};_0x25add0(++_0x4db8e2);}(_0x4240,0x175));var _0x0424=function(_0x32befe,_0x5909c8){_0x32befe=_0x32befe-0x0;var _0x325693=_0x4240[_0x32befe];return _0x325693;};'use strict';var Sequelize=require(_0x0424('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x0424('0x1')]('first',_0x0424('0x2'),_0x0424('0x3')),'allowNull':![],'defaultValue':_0x0424('0x4')},'description':{'type':Sequelize[_0x0424('0x5')]}}; \ No newline at end of file +var _0xc1c0=['second','third','sequelize','exports','STRING','ENUM','first'];(function(_0x4db2ea,_0x18f793){var _0x487f99=function(_0x2b1790){while(--_0x2b1790){_0x4db2ea['push'](_0x4db2ea['shift']());}};_0x487f99(++_0x18f793);}(_0xc1c0,0x152));var _0x0c1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1c0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0c1c('0x0'));module[_0x0c1c('0x1')]={'name':{'type':Sequelize[_0x0c1c('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x0c1c('0x3')](_0x0c1c('0x4'),_0x0c1c('0x5'),_0x0c1c('0x6')),'allowNull':![],'defaultValue':'first'},'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 75081cd..06f9776 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 _0x3ed6=['api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','sendStatus','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4eba18,_0x243e10){var _0x39e0a1=function(_0x2c32ec){while(--_0x2c32ec){_0x4eba18['push'](_0x4eba18['shift']());}};_0x39e0a1(++_0x243e10);}(_0x3ed6,0x12f));var _0x63ed=function(_0x58cbeb,_0x200cba){_0x58cbeb=_0x58cbeb-0x0;var _0x5d2b5a=_0x3ed6[_0x58cbeb];return _0x5d2b5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63ed('0x0'));var zipdir=require(_0x63ed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63ed('0x2'));var moment=require(_0x63ed('0x3'));var BPromise=require(_0x63ed('0x4'));var Mustache=require(_0x63ed('0x5'));var util=require(_0x63ed('0x6'));var path=require('path');var sox=require(_0x63ed('0x7'));var csv=require(_0x63ed('0x8'));var ejs=require(_0x63ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63ed('0xa'));var squel=require('squel');var crypto=require(_0x63ed('0xb'));var jsforce=require(_0x63ed('0xc'));var deskjs=require(_0x63ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x63ed('0xe'));var Papa=require(_0x63ed('0xf'));var Redis=require(_0x63ed('0x10'));var authService=require(_0x63ed('0x11'));var qs=require(_0x63ed('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63ed('0x13'));var logger=require(_0x63ed('0x14'))(_0x63ed('0x15'));var utils=require(_0x63ed('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x63ed('0x17'))['db'];function respondWithStatusCode(_0x42c669,_0x5e059b){_0x5e059b=_0x5e059b||0xcc;return function(_0x1dd2a7){if(_0x1dd2a7){return _0x42c669['sendStatus'](_0x5e059b);}return _0x42c669[_0x63ed('0x18')](_0x5e059b)['end']();};}function respondWithResult(_0x5c05d7,_0x4d302d){_0x4d302d=_0x4d302d||0xc8;return function(_0x56fded){if(_0x56fded){return _0x5c05d7[_0x63ed('0x18')](_0x4d302d)[_0x63ed('0x19')](_0x56fded);}};}function respondWithFilteredResult(_0x34e862,_0xd90cf4){return function(_0x3fdf31){if(_0x3fdf31){var _0x551acd=typeof _0xd90cf4[_0x63ed('0x1a')]===_0x63ed('0x1b')&&typeof _0xd90cf4[_0x63ed('0x1c')]===_0x63ed('0x1b');var _0x1545c5=_0x3fdf31[_0x63ed('0x1d')];var _0x585ef1=_0x551acd?0x0:_0xd90cf4['offset'];var _0x2252e5=_0x551acd?_0x3fdf31['count']:_0xd90cf4[_0x63ed('0x1a')]+_0xd90cf4['limit'];var _0x3ae53a;if(_0x2252e5>=_0x1545c5){_0x2252e5=_0x1545c5;_0x3ae53a=0xc8;}else{_0x3ae53a=0xce;}_0x34e862[_0x63ed('0x18')](_0x3ae53a);return _0x34e862[_0x63ed('0x1e')](_0x63ed('0x1f'),_0x585ef1+'-'+_0x2252e5+'/'+_0x1545c5)['json'](_0x3fdf31);}return null;};}function patchUpdates(_0x46aac6){return function(_0xd17b7c){try{jsonpatch['apply'](_0xd17b7c,_0x46aac6,!![]);}catch(_0x199f40){return BPromise[_0x63ed('0x20')](_0x199f40);}return _0xd17b7c['save']();};}function saveUpdates(_0x5eddd8,_0x222f9a){return function(_0x5c293f){if(_0x5c293f){return _0x5c293f[_0x63ed('0x21')](_0x5eddd8)[_0x63ed('0x22')](function(_0x399da3){return _0x399da3;});}return null;};}function removeEntity(_0x3f7975,_0x4f7416){return function(_0x35764b){if(_0x35764b){return _0x35764b[_0x63ed('0x23')]()[_0x63ed('0x22')](function(){var _0x5c690f=_0x35764b['get']({'plain':!![]});var _0xbe53b5='Dispositions';return db['UserProfileResource'][_0x63ed('0x23')]({'where':{'type':_0xbe53b5,'resourceId':_0x5c690f['id']}})[_0x63ed('0x22')](function(){return _0x35764b;});})['then'](function(){_0x3f7975[_0x63ed('0x18')](0xcc)[_0x63ed('0x24')]();});}};}function handleEntityNotFound(_0x49ae6b,_0x162c26){return function(_0x35beca){if(!_0x35beca){_0x49ae6b[_0x63ed('0x25')](0x194);}return _0x35beca;};}function handleError(_0x4f3cea,_0x19e804){_0x19e804=_0x19e804||0x1f4;return function(_0x34c1ba){logger['error'](_0x34c1ba[_0x63ed('0x26')]);if(_0x34c1ba['name']){delete _0x34c1ba[_0x63ed('0x27')];}_0x4f3cea[_0x63ed('0x18')](_0x19e804)[_0x63ed('0x28')](_0x34c1ba);};}exports[_0x63ed('0x29')]=function(_0x739613,_0x31ceee){var _0x14e1ac={},_0xf7c270={},_0x47d528={'count':0x0,'rows':[]};var _0x27f9fa=_['map'](db[_0x63ed('0x2a')][_0x63ed('0x2b')],function(_0x4735f8){return{'name':_0x4735f8[_0x63ed('0x2c')],'type':_0x4735f8[_0x63ed('0x2d')][_0x63ed('0x2e')]};});_0xf7c270[_0x63ed('0x2f')]=_[_0x63ed('0x30')](_0x27f9fa,_0x63ed('0x27'));_0xf7c270[_0x63ed('0x31')]=_[_0x63ed('0x32')](_0x739613[_0x63ed('0x31')]);_0xf7c270['filters']=_[_0x63ed('0x33')](_0xf7c270[_0x63ed('0x2f')],_0xf7c270['query']);_0x14e1ac[_0x63ed('0x34')]=_[_0x63ed('0x33')](_0xf7c270[_0x63ed('0x2f')],qs[_0x63ed('0x35')](_0x739613[_0x63ed('0x31')][_0x63ed('0x35')]));_0x14e1ac[_0x63ed('0x34')]=_0x14e1ac[_0x63ed('0x34')]['length']?_0x14e1ac[_0x63ed('0x34')]:_0xf7c270[_0x63ed('0x2f')];if(!_0x739613['query']['hasOwnProperty'](_0x63ed('0x36'))){_0x14e1ac['limit']=qs[_0x63ed('0x1c')](_0x739613[_0x63ed('0x31')][_0x63ed('0x1c')]);_0x14e1ac[_0x63ed('0x1a')]=qs[_0x63ed('0x1a')](_0x739613[_0x63ed('0x31')][_0x63ed('0x1a')]);}_0x14e1ac[_0x63ed('0x37')]=qs[_0x63ed('0x38')](_0x739613[_0x63ed('0x31')][_0x63ed('0x38')]);_0x14e1ac['where']=qs[_0x63ed('0x39')](_[_0x63ed('0x3a')](_0x739613[_0x63ed('0x31')],_0xf7c270[_0x63ed('0x39')]),_0x27f9fa);if(_0x739613[_0x63ed('0x31')][_0x63ed('0x3b')]){_0x14e1ac['where']=_[_0x63ed('0x3c')](_0x14e1ac['where'],{'$or':_[_0x63ed('0x30')](_0x27f9fa,function(_0x233064){if(_0x233064['type']!=='VIRTUAL'){var _0x4a07ba={};_0x4a07ba[_0x233064[_0x63ed('0x27')]]={'$like':'%'+_0x739613[_0x63ed('0x31')][_0x63ed('0x3b')]+'%'};return _0x4a07ba;}})});}_0x14e1ac=_[_0x63ed('0x3c')]({},_0x14e1ac,_0x739613[_0x63ed('0x3d')]);var _0x39ec0b={'where':_0x14e1ac['where']};return db['Disposition'][_0x63ed('0x1d')](_0x39ec0b)[_0x63ed('0x22')](function(_0x31ea73){_0x47d528['count']=_0x31ea73;if(_0x739613[_0x63ed('0x31')][_0x63ed('0x3e')]){_0x14e1ac[_0x63ed('0x3f')]=[{'all':!![]}];}return db[_0x63ed('0x2a')][_0x63ed('0x40')](_0x14e1ac);})[_0x63ed('0x22')](function(_0x82e219){_0x47d528['rows']=_0x82e219;return _0x47d528;})['then'](respondWithFilteredResult(_0x31ceee,_0x14e1ac))[_0x63ed('0x41')](handleError(_0x31ceee,null));};exports[_0x63ed('0x42')]=function(_0xe986b2,_0xfdd91f){var _0x46f3ac={'raw':!![],'where':{'id':_0xe986b2['params']['id']}},_0xde63f8={};_0xde63f8[_0x63ed('0x2f')]=_[_0x63ed('0x32')](db[_0x63ed('0x2a')][_0x63ed('0x2b')]);_0xde63f8[_0x63ed('0x31')]=_[_0x63ed('0x32')](_0xe986b2[_0x63ed('0x31')]);_0xde63f8['filters']=_[_0x63ed('0x33')](_0xde63f8['model'],_0xde63f8[_0x63ed('0x31')]);_0x46f3ac[_0x63ed('0x34')]=_[_0x63ed('0x33')](_0xde63f8[_0x63ed('0x2f')],qs[_0x63ed('0x35')](_0xe986b2[_0x63ed('0x31')][_0x63ed('0x35')]));_0x46f3ac[_0x63ed('0x34')]=_0x46f3ac[_0x63ed('0x34')][_0x63ed('0x43')]?_0x46f3ac[_0x63ed('0x34')]:_0xde63f8['model'];if(_0xe986b2['query'][_0x63ed('0x3e')]){_0x46f3ac[_0x63ed('0x3f')]=[{'all':!![]}];}_0x46f3ac=_['merge']({},_0x46f3ac,_0xe986b2['options']);return db[_0x63ed('0x2a')][_0x63ed('0x44')](_0x46f3ac)[_0x63ed('0x22')](handleEntityNotFound(_0xfdd91f,null))[_0x63ed('0x22')](respondWithResult(_0xfdd91f,null))[_0x63ed('0x41')](handleError(_0xfdd91f,null));};exports[_0x63ed('0x45')]=function(_0x4de6e5,_0x2cc557){return db['Disposition'][_0x63ed('0x45')](_0x4de6e5[_0x63ed('0x46')],{})[_0x63ed('0x22')](function(_0x51eead){var _0x4a77aa=_0x4de6e5[_0x63ed('0x47')][_0x63ed('0x48')]({'plain':!![]});if(!_0x4a77aa)throw new Error(_0x63ed('0x49'));if(_0x4a77aa[_0x63ed('0x4a')]===_0x63ed('0x47')){var _0x434827=_0x51eead[_0x63ed('0x48')]({'plain':!![]});var _0x231a12='Dispositions';return db[_0x63ed('0x4b')]['find']({'where':{'name':_0x231a12,'userProfileId':_0x4a77aa[_0x63ed('0x4c')]},'raw':!![]})[_0x63ed('0x22')](function(_0x1524fb){if(_0x1524fb&&_0x1524fb['autoAssociation']===0x0){return db[_0x63ed('0x4d')]['create']({'name':_0x434827['name'],'resourceId':_0x434827['id'],'type':_0x1524fb[_0x63ed('0x27')],'sectionId':_0x1524fb['id']},{})[_0x63ed('0x22')](function(){return _0x51eead;});}else{return _0x51eead;}})[_0x63ed('0x41')](function(_0x2542eb){logger[_0x63ed('0x4e')](_0x63ed('0x4f'),_0x2542eb);throw _0x2542eb;});}return _0x51eead;})[_0x63ed('0x22')](respondWithResult(_0x2cc557,0xc9))[_0x63ed('0x41')](handleError(_0x2cc557,null));};exports[_0x63ed('0x21')]=function(_0x466a63,_0x26357b){if(_0x466a63[_0x63ed('0x46')]['id']){delete _0x466a63['body']['id'];}return db[_0x63ed('0x2a')][_0x63ed('0x44')]({'where':{'id':_0x466a63[_0x63ed('0x50')]['id']}})[_0x63ed('0x22')](handleEntityNotFound(_0x26357b,null))[_0x63ed('0x22')](saveUpdates(_0x466a63[_0x63ed('0x46')],null))[_0x63ed('0x22')](respondWithResult(_0x26357b,null))['catch'](handleError(_0x26357b,null));};exports['destroy']=function(_0x3e41fa,_0x586516){return db['Disposition'][_0x63ed('0x44')]({'where':{'id':_0x3e41fa[_0x63ed('0x50')]['id']}})[_0x63ed('0x22')](handleEntityNotFound(_0x586516,null))[_0x63ed('0x22')](removeEntity(_0x586516,null))[_0x63ed('0x41')](handleError(_0x586516,null));}; \ No newline at end of file +var _0xf39c=['filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','Disposition','includeAll','findAll','catch','show','params','include','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Dispositions','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x23a67e,_0x50348a){var _0x3743bb=function(_0x3cf8f6){while(--_0x3cf8f6){_0x23a67e['push'](_0x23a67e['shift']());}};_0x3743bb(++_0x50348a);}(_0xf39c,0x16c));var _0xcf39=function(_0x4490a7,_0x1a9075){_0x4490a7=_0x4490a7-0x0;var _0x3961f1=_0xf39c[_0x4490a7];return _0x3961f1;};'use strict';var emlformat=require(_0xcf39('0x0'));var rimraf=require(_0xcf39('0x1'));var zipdir=require(_0xcf39('0x2'));var jsonpatch=require(_0xcf39('0x3'));var rp=require('request-promise');var moment=require(_0xcf39('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf39('0x5'));var util=require('util');var path=require(_0xcf39('0x6'));var sox=require(_0xcf39('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf39('0x8'));var _=require('lodash');var squel=require(_0xcf39('0x9'));var crypto=require(_0xcf39('0xa'));var jsforce=require(_0xcf39('0xb'));var deskjs=require(_0xcf39('0xc'));var toCsv=require(_0xcf39('0xd'));var querystring=require('querystring');var Papa=require(_0xcf39('0xe'));var Redis=require(_0xcf39('0xf'));var authService=require(_0xcf39('0x10'));var qs=require(_0xcf39('0x11'));var as=require(_0xcf39('0x12'));var hardwareService=require(_0xcf39('0x13'));var logger=require(_0xcf39('0x14'))(_0xcf39('0x15'));var utils=require(_0xcf39('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcf39('0x17'));var db=require(_0xcf39('0x18'))['db'];function respondWithStatusCode(_0x5ec127,_0x3efbdc){_0x3efbdc=_0x3efbdc||0xcc;return function(_0x4714cc){if(_0x4714cc){return _0x5ec127['sendStatus'](_0x3efbdc);}return _0x5ec127['status'](_0x3efbdc)[_0xcf39('0x19')]();};}function respondWithResult(_0x52d8be,_0xc1acee){_0xc1acee=_0xc1acee||0xc8;return function(_0x17f706){if(_0x17f706){return _0x52d8be[_0xcf39('0x1a')](_0xc1acee)[_0xcf39('0x1b')](_0x17f706);}};}function respondWithFilteredResult(_0xb20d75,_0x3bbbd0){return function(_0xbe91a9){if(_0xbe91a9){var _0x48745c=typeof _0x3bbbd0['offset']===_0xcf39('0x1c')&&typeof _0x3bbbd0[_0xcf39('0x1d')]==='undefined';var _0x4ed3a5=_0xbe91a9[_0xcf39('0x1e')];var _0x4b0dbc=_0x48745c?0x0:_0x3bbbd0[_0xcf39('0x1f')];var _0x42973b=_0x48745c?_0xbe91a9[_0xcf39('0x1e')]:_0x3bbbd0[_0xcf39('0x1f')]+_0x3bbbd0[_0xcf39('0x1d')];var _0x74c868;if(_0x42973b>=_0x4ed3a5){_0x42973b=_0x4ed3a5;_0x74c868=0xc8;}else{_0x74c868=0xce;}_0xb20d75['status'](_0x74c868);return _0xb20d75[_0xcf39('0x20')](_0xcf39('0x21'),_0x4b0dbc+'-'+_0x42973b+'/'+_0x4ed3a5)['json'](_0xbe91a9);}return null;};}function patchUpdates(_0x340af4){return function(_0x30f439){try{jsonpatch[_0xcf39('0x22')](_0x30f439,_0x340af4,!![]);}catch(_0x39d36a){return BPromise[_0xcf39('0x23')](_0x39d36a);}return _0x30f439[_0xcf39('0x24')]();};}function saveUpdates(_0x1760b3,_0x4e584b){return function(_0x356dc1){if(_0x356dc1){return _0x356dc1[_0xcf39('0x25')](_0x1760b3)['then'](function(_0x21880b){return _0x21880b;});}return null;};}function removeEntity(_0x4b354e,_0x3068eb){return function(_0x3880b9){if(_0x3880b9){return _0x3880b9[_0xcf39('0x26')]()[_0xcf39('0x27')](function(){var _0x4024f1=_0x3880b9[_0xcf39('0x28')]({'plain':!![]});var _0x585281=_0xcf39('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x585281,'resourceId':_0x4024f1['id']}})[_0xcf39('0x27')](function(){return _0x3880b9;});})[_0xcf39('0x27')](function(){_0x4b354e[_0xcf39('0x1a')](0xcc)[_0xcf39('0x19')]();});}};}function handleEntityNotFound(_0x2bb111,_0x29ad91){return function(_0x5bbf7b){if(!_0x5bbf7b){_0x2bb111[_0xcf39('0x2a')](0x194);}return _0x5bbf7b;};}function handleError(_0x360913,_0x343e95){_0x343e95=_0x343e95||0x1f4;return function(_0x4a0958){logger[_0xcf39('0x2b')](_0x4a0958[_0xcf39('0x2c')]);if(_0x4a0958[_0xcf39('0x2d')]){delete _0x4a0958[_0xcf39('0x2d')];}_0x360913[_0xcf39('0x1a')](_0x343e95)[_0xcf39('0x2e')](_0x4a0958);};}exports[_0xcf39('0x2f')]=function(_0x20d5c9,_0x4a4d82){var _0x186dbf={},_0x2515ce={},_0x5e3e8b={'count':0x0,'rows':[]};var _0x48f406=_['map'](db['Disposition'][_0xcf39('0x30')],function(_0x4c7b09){return{'name':_0x4c7b09[_0xcf39('0x31')],'type':_0x4c7b09[_0xcf39('0x32')][_0xcf39('0x33')]};});_0x2515ce[_0xcf39('0x34')]=_[_0xcf39('0x35')](_0x48f406,'name');_0x2515ce[_0xcf39('0x36')]=_[_0xcf39('0x37')](_0x20d5c9['query']);_0x2515ce[_0xcf39('0x38')]=_[_0xcf39('0x39')](_0x2515ce[_0xcf39('0x34')],_0x2515ce['query']);_0x186dbf['attributes']=_[_0xcf39('0x39')](_0x2515ce[_0xcf39('0x34')],qs['fields'](_0x20d5c9['query'][_0xcf39('0x3a')]));_0x186dbf[_0xcf39('0x3b')]=_0x186dbf[_0xcf39('0x3b')][_0xcf39('0x3c')]?_0x186dbf['attributes']:_0x2515ce[_0xcf39('0x34')];if(!_0x20d5c9[_0xcf39('0x36')]['hasOwnProperty'](_0xcf39('0x3d'))){_0x186dbf[_0xcf39('0x1d')]=qs['limit'](_0x20d5c9['query']['limit']);_0x186dbf[_0xcf39('0x1f')]=qs[_0xcf39('0x1f')](_0x20d5c9[_0xcf39('0x36')][_0xcf39('0x1f')]);}_0x186dbf[_0xcf39('0x3e')]=qs[_0xcf39('0x3f')](_0x20d5c9[_0xcf39('0x36')][_0xcf39('0x3f')]);_0x186dbf[_0xcf39('0x40')]=qs[_0xcf39('0x38')](_[_0xcf39('0x41')](_0x20d5c9['query'],_0x2515ce[_0xcf39('0x38')]),_0x48f406);if(_0x20d5c9[_0xcf39('0x36')][_0xcf39('0x42')]){_0x186dbf['where']=_[_0xcf39('0x43')](_0x186dbf['where'],{'$or':_[_0xcf39('0x35')](_0x48f406,function(_0x5ae407){if(_0x5ae407[_0xcf39('0x32')]!=='VIRTUAL'){var _0x57449c={};_0x57449c[_0x5ae407[_0xcf39('0x2d')]]={'$like':'%'+_0x20d5c9['query']['filter']+'%'};return _0x57449c;}})});}_0x186dbf=_['merge']({},_0x186dbf,_0x20d5c9[_0xcf39('0x44')]);var _0x333b4d={'where':_0x186dbf[_0xcf39('0x40')]};return db[_0xcf39('0x45')][_0xcf39('0x1e')](_0x333b4d)[_0xcf39('0x27')](function(_0x232d15){_0x5e3e8b[_0xcf39('0x1e')]=_0x232d15;if(_0x20d5c9[_0xcf39('0x36')][_0xcf39('0x46')]){_0x186dbf['include']=[{'all':!![]}];}return db[_0xcf39('0x45')][_0xcf39('0x47')](_0x186dbf);})['then'](function(_0x46adee){_0x5e3e8b['rows']=_0x46adee;return _0x5e3e8b;})[_0xcf39('0x27')](respondWithFilteredResult(_0x4a4d82,_0x186dbf))[_0xcf39('0x48')](handleError(_0x4a4d82,null));};exports[_0xcf39('0x49')]=function(_0x102c28,_0x6a0a28){var _0x3b6a9={'raw':!![],'where':{'id':_0x102c28[_0xcf39('0x4a')]['id']}},_0xa5f679={};_0xa5f679[_0xcf39('0x34')]=_['keys'](db['Disposition'][_0xcf39('0x30')]);_0xa5f679[_0xcf39('0x36')]=_[_0xcf39('0x37')](_0x102c28[_0xcf39('0x36')]);_0xa5f679[_0xcf39('0x38')]=_[_0xcf39('0x39')](_0xa5f679[_0xcf39('0x34')],_0xa5f679[_0xcf39('0x36')]);_0x3b6a9[_0xcf39('0x3b')]=_[_0xcf39('0x39')](_0xa5f679[_0xcf39('0x34')],qs['fields'](_0x102c28[_0xcf39('0x36')][_0xcf39('0x3a')]));_0x3b6a9[_0xcf39('0x3b')]=_0x3b6a9[_0xcf39('0x3b')][_0xcf39('0x3c')]?_0x3b6a9['attributes']:_0xa5f679['model'];if(_0x102c28[_0xcf39('0x36')][_0xcf39('0x46')]){_0x3b6a9[_0xcf39('0x4b')]=[{'all':!![]}];}_0x3b6a9=_[_0xcf39('0x43')]({},_0x3b6a9,_0x102c28[_0xcf39('0x44')]);return db[_0xcf39('0x45')][_0xcf39('0x4c')](_0x3b6a9)[_0xcf39('0x27')](handleEntityNotFound(_0x6a0a28,null))[_0xcf39('0x27')](respondWithResult(_0x6a0a28,null))[_0xcf39('0x48')](handleError(_0x6a0a28,null));};exports[_0xcf39('0x4d')]=function(_0x25c232,_0x1c0986){return db[_0xcf39('0x45')]['create'](_0x25c232['body'],{})[_0xcf39('0x27')](function(_0x361a8e){var _0x6fcaa2=_0x25c232[_0xcf39('0x4e')]['get']({'plain':!![]});if(!_0x6fcaa2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6fcaa2[_0xcf39('0x4f')]===_0xcf39('0x4e')){var _0x55557c=_0x361a8e[_0xcf39('0x28')]({'plain':!![]});var _0x45a2d9='Dispositions';return db[_0xcf39('0x50')][_0xcf39('0x4c')]({'where':{'name':_0x45a2d9,'userProfileId':_0x6fcaa2['userProfileId']},'raw':!![]})[_0xcf39('0x27')](function(_0x2a590f){if(_0x2a590f&&_0x2a590f[_0xcf39('0x51')]===0x0){return db['UserProfileResource'][_0xcf39('0x4d')]({'name':_0x55557c['name'],'resourceId':_0x55557c['id'],'type':_0x2a590f[_0xcf39('0x2d')],'sectionId':_0x2a590f['id']},{})[_0xcf39('0x27')](function(){return _0x361a8e;});}else{return _0x361a8e;}})[_0xcf39('0x48')](function(_0x4b2bad){logger[_0xcf39('0x2b')](_0xcf39('0x52'),_0x4b2bad);throw _0x4b2bad;});}return _0x361a8e;})[_0xcf39('0x27')](respondWithResult(_0x1c0986,0xc9))[_0xcf39('0x48')](handleError(_0x1c0986,null));};exports[_0xcf39('0x25')]=function(_0x4bdbd2,_0x47ec0a){if(_0x4bdbd2[_0xcf39('0x53')]['id']){delete _0x4bdbd2[_0xcf39('0x53')]['id'];}return db[_0xcf39('0x45')]['find']({'where':{'id':_0x4bdbd2[_0xcf39('0x4a')]['id']}})[_0xcf39('0x27')](handleEntityNotFound(_0x47ec0a,null))[_0xcf39('0x27')](saveUpdates(_0x4bdbd2[_0xcf39('0x53')],null))[_0xcf39('0x27')](respondWithResult(_0x47ec0a,null))[_0xcf39('0x48')](handleError(_0x47ec0a,null));};exports[_0xcf39('0x26')]=function(_0x36c3ab,_0x5efad6){return db['Disposition'][_0xcf39('0x4c')]({'where':{'id':_0x36c3ab['params']['id']}})[_0xcf39('0x27')](handleEntityNotFound(_0x5efad6,null))['then'](removeEntity(_0x5efad6,null))['catch'](handleError(_0x5efad6,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 5b08c12..9153c0f 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 _0xedbe=['name_voice','name','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0xedbe,0x134));var _0xeedb=function(_0x5576c7,_0x2e6b3c){_0x5576c7=_0x5576c7-0x0;var _0xdfec6e=_0xedbe[_0x5576c7];return _0xdfec6e;};'use strict';var _=require(_0xeedb('0x0'));var util=require('util');var logger=require(_0xeedb('0x1'))('api');var moment=require(_0xeedb('0x2'));var BPromise=require(_0xeedb('0x3'));var rp=require(_0xeedb('0x4'));var fs=require('fs');var path=require(_0xeedb('0x5'));var rimraf=require(_0xeedb('0x6'));var config=require('../../config/environment');var attributes=require(_0xeedb('0x7'));module[_0xeedb('0x8')]=function(_0x5b5861,_0x220e0e){return _0x5b5861[_0xeedb('0x9')](_0xeedb('0xa'),attributes,{'tableName':_0xeedb('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xeedb('0xc'),'fields':[_0xeedb('0xd'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0xeedb('0xd'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0xeedb('0xd'),'MailAccountId']},{'unique':!![],'name':_0xeedb('0xe'),'fields':[_0xeedb('0xd'),_0xeedb('0xf')]},{'unique':!![],'name':_0xeedb('0x10'),'fields':[_0xeedb('0xd'),_0xeedb('0x11')]},{'unique':!![],'name':_0xeedb('0x12'),'fields':[_0xeedb('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0xeedb('0x13'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x46a0=['Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./disposition.attributes','exports','define'];(function(_0x6d1b0,_0x11f5fb){var _0x188e3e=function(_0x1510cf){while(--_0x1510cf){_0x6d1b0['push'](_0x6d1b0['shift']());}};_0x188e3e(++_0x11f5fb);}(_0x46a0,0xf0));var _0x046a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46a0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x046a('0x0'));var util=require(_0x046a('0x1'));var logger=require(_0x046a('0x2'))('api');var moment=require(_0x046a('0x3'));var BPromise=require('bluebird');var rp=require(_0x046a('0x4'));var fs=require('fs');var path=require(_0x046a('0x5'));var rimraf=require(_0x046a('0x6'));var config=require('../../config/environment');var attributes=require(_0x046a('0x7'));module[_0x046a('0x8')]=function(_0x3ae54e,_0x21cfb2){return _0x3ae54e[_0x046a('0x9')](_0x046a('0xa'),attributes,{'tableName':_0x046a('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x046a('0xc'),'fields':[_0x046a('0xd'),_0x046a('0xe')]},{'unique':!![],'name':_0x046a('0xf'),'fields':['name',_0x046a('0x10')]},{'unique':!![],'name':_0x046a('0x11'),'fields':[_0x046a('0xd'),_0x046a('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0x046a('0xd'),'SmsAccountId']},{'unique':!![],'name':_0x046a('0x13'),'fields':['name',_0x046a('0x14')]},{'unique':!![],'name':_0x046a('0x15'),'fields':[_0x046a('0xd'),_0x046a('0x16')]},{'unique':!![],'name':_0x046a('0x17'),'fields':['name',_0x046a('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index f55e695..0000cca 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(_0x4d7858,_0x2d15da){var _0x4706bc=function(_0x110cdf){while(--_0x110cdf){_0x4d7858['push'](_0x4d7858['shift']());}};_0x4706bc(++_0x2d15da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x2d4c47,_0x1a70e7){var _0x2612ab=function(_0x314ec1){while(--_0x314ec1){_0x2d4c47['push'](_0x2d4c47['shift']());}};_0x2612ab(++_0x1a70e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 6236747..e3f995f 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 _0x1816=['create','put','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post'];(function(_0x341171,_0x3c66af){var _0x52e191=function(_0x3824c9){while(--_0x3824c9){_0x341171['push'](_0x341171['shift']());}};_0x52e191(++_0x3c66af);}(_0x1816,0x1d4));var _0x6181=function(_0x563bb4,_0x2b5811){_0x563bb4=_0x563bb4-0x0;var _0xdd12d8=_0x1816[_0x563bb4];return _0xdd12d8;};'use strict';var multer=require(_0x6181('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6181('0x1'));var express=require(_0x6181('0x2'));var router=express[_0x6181('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6181('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6181('0x5'));var controller=require(_0x6181('0x6'));router[_0x6181('0x7')]('/',auth[_0x6181('0x8')](),controller['index']);router[_0x6181('0x7')](_0x6181('0x9'),auth[_0x6181('0x8')](),controller[_0x6181('0xa')]);router[_0x6181('0xb')]('/',auth[_0x6181('0x8')](),controller[_0x6181('0xc')]);router[_0x6181('0xd')](_0x6181('0x9'),auth[_0x6181('0x8')](),controller['update']);router['delete'](_0x6181('0x9'),auth['isAuthenticated'](),controller[_0x6181('0xe')]);module[_0x6181('0xf')]=router; \ No newline at end of file +var _0x0016=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x216e67,_0x1b65b1){var _0x526b32=function(_0x2e20bb){while(--_0x2e20bb){_0x216e67['push'](_0x216e67['shift']());}};_0x526b32(++_0x1b65b1);}(_0x0016,0x9c));var _0x6001=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x0016[_0x44c768];return _0x55daf5;};'use strict';var multer=require('multer');var util=require(_0x6001('0x0'));var path=require('path');var timeout=require(_0x6001('0x1'));var express=require(_0x6001('0x2'));var router=express[_0x6001('0x3')]();var fs_extra=require(_0x6001('0x4'));var auth=require(_0x6001('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6001('0x6'));var controller=require(_0x6001('0x7'));router[_0x6001('0x8')]('/',auth[_0x6001('0x9')](),controller[_0x6001('0xa')]);router[_0x6001('0x8')](_0x6001('0xb'),auth['isAuthenticated'](),controller[_0x6001('0xc')]);router[_0x6001('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6001('0xe')](_0x6001('0xb'),auth['isAuthenticated'](),controller[_0x6001('0xf')]);router[_0x6001('0x10')](_0x6001('0xb'),auth[_0x6001('0x9')](),controller[_0x6001('0x11')]);module[_0x6001('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a9e77c0..026251b 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 _0x6324=['mandatoryDispositionPauseId','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','ENUM','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x46e82c,_0x554fa2){var _0xa3ec64=function(_0x3f29b5){while(--_0x3f29b5){_0x46e82c['push'](_0x46e82c['shift']());}};_0xa3ec64(++_0x554fa2);}(_0x6324,0xa2));var _0x4632=function(_0x546a88,_0x48d512){_0x546a88=_0x546a88-0x0;var _0x60ec43=_0x6324[_0x546a88];return _0x60ec43;};'use strict';var Sequelize=require('sequelize');module[_0x4632('0x0')]={'name':{'type':Sequelize[_0x4632('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4632('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x4632('0x2'),'no'),'defaultValue':_0x4632('0x2')},'headerinfo':{'type':Sequelize[_0x4632('0x1')],'defaultValue':_0x4632('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x4632('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x4632('0x5'),_0x4632('0x6'),_0x4632('0x7'),_0x4632('0x8'),'12000',_0x4632('0x9')),'defaultValue':_0x4632('0x6')},'maxrate':{'type':Sequelize[_0x4632('0xa')](_0x4632('0x5'),_0x4632('0x6'),_0x4632('0x7'),_0x4632('0x8'),_0x4632('0xb'),_0x4632('0x9')),'defaultValue':_0x4632('0x9')},'modem':{'type':Sequelize[_0x4632('0x1')],'defaultValue':_0x4632('0xc')},'gateway':{'type':Sequelize[_0x4632('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4632('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4632('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x4632('0xe'),_0x4632('0xf'),_0x4632('0x10'),_0x4632('0x11')),'defaultValue':_0x4632('0xe')},'key':{'type':Sequelize[_0x4632('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4632('0x12');}},'notificationSound':{'type':Sequelize[_0x4632('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4632('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4632('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4632('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4632('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'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[_0x4632('0x13')],'defaultValue':![],'comment':_0x4632('0x14'),'set':function(_0x3942ad){if(!_0x3942ad)this[_0x4632('0x15')](_0x4632('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x3942ad);}}}; \ No newline at end of file +var _0x2216=['STRING','yes','localstationid','2400','4800','7200','9600','ENUM','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x3014a2,_0x521f1a){var _0x3c0303=function(_0x2909d2){while(--_0x2909d2){_0x3014a2['push'](_0x3014a2['shift']());}};_0x3c0303(++_0x521f1a);}(_0x2216,0x1e1));var _0x6221=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2216[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x6221('0x0'));module[_0x6221('0x1')]={'name':{'type':Sequelize[_0x6221('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6221('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x6221('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x6221('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x6221('0x2')],'unique':_0x6221('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x6221('0x5'),_0x6221('0x6'),_0x6221('0x7'),_0x6221('0x8'),'12000','14400'),'defaultValue':_0x6221('0x6')},'maxrate':{'type':Sequelize[_0x6221('0x9')](_0x6221('0x5'),_0x6221('0x6'),'7200','9600','12000','14400'),'defaultValue':_0x6221('0xa')},'modem':{'type':Sequelize[_0x6221('0x2')],'defaultValue':_0x6221('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6221('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6221('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x6221('0xd'),_0x6221('0xe'),_0x6221('0xf')),'defaultValue':_0x6221('0x10')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6221('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6221('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6221('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6221('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6221('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6221('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x6221('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x6221('0x12')],'defaultValue':![],'comment':_0x6221('0x14'),'set':function(_0x1a630a){if(!_0x1a630a)this[_0x6221('0x15')]('mandatoryDispositionPauseId',null);this[_0x6221('0x15')](_0x6221('0x16'),_0x1a630a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index da134ee..c198448 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 _0xd254=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','FaxAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','FaxInteraction','omit','getInteractions','CmContact','Contact','User','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','updatedAt','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','dataValues','SendFax','emit','userFaxAccount:save','removeAgents','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined'];(function(_0x331444,_0x107927){var _0x282e19=function(_0x3bb809){while(--_0x3bb809){_0x331444['push'](_0x331444['shift']());}};_0x282e19(++_0x107927);}(_0xd254,0x93));var _0x4d25=function(_0x5a22be,_0x23b792){_0x5a22be=_0x5a22be-0x0;var _0x500cbc=_0xd254[_0x5a22be];return _0x500cbc;};'use strict';var emlformat=require(_0x4d25('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4d25('0x1'));var rp=require('request-promise');var moment=require(_0x4d25('0x2'));var BPromise=require(_0x4d25('0x3'));var Mustache=require(_0x4d25('0x4'));var util=require(_0x4d25('0x5'));var path=require(_0x4d25('0x6'));var sox=require('sox');var csv=require(_0x4d25('0x7'));var ejs=require(_0x4d25('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d25('0x9'));var squel=require(_0x4d25('0xa'));var crypto=require(_0x4d25('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4d25('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4d25('0xd'));var Papa=require(_0x4d25('0xe'));var Redis=require('ioredis');var authService=require(_0x4d25('0xf'));var qs=require(_0x4d25('0x10'));var as=require(_0x4d25('0x11'));var hardwareService=require(_0x4d25('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x4d25('0x13'));var config=require(_0x4d25('0x14'));var licenseUtil=require(_0x4d25('0x15'));var db=require('../../mysqldb')['db'];config[_0x4d25('0x16')]=_[_0x4d25('0x17')](config[_0x4d25('0x16')],{'host':_0x4d25('0x18'),'port':0x18eb});var socket=require(_0x4d25('0x19'))(new Redis(config[_0x4d25('0x16')]));require(_0x4d25('0x1a'))[_0x4d25('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4d25('0x1c')][_0x4d25('0x1d')]({'port':0x232c});var client9002=jayson[_0x4d25('0x1c')][_0x4d25('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2298f3,_0x709bbd,_0xc985c6,_0x3567dd){return new BPromise(function(_0x344dfb,_0x487bcf){var _0x1573a5=_0x3567dd||client;return _0x1573a5[_0x4d25('0x1e')](_0x2298f3,_0xc985c6)['then'](function(_0x56d5e0){logger[_0x4d25('0x1f')](_0x4d25('0x20'),_0x709bbd,_0x4d25('0x21'));logger['debug'](_0x4d25('0x22'),_0x709bbd,_0x4d25('0x21'),JSON[_0x4d25('0x23')](_0x56d5e0));if(_0x56d5e0[_0x4d25('0x24')]){if(_0x56d5e0['error'][_0x4d25('0x25')]===0x1f4){logger[_0x4d25('0x24')](_0x4d25('0x20'),_0x709bbd,_0x56d5e0[_0x4d25('0x24')][_0x4d25('0x26')]);return _0x487bcf(_0x56d5e0[_0x4d25('0x24')][_0x4d25('0x26')]);}logger['error'](_0x4d25('0x20'),_0x709bbd,_0x56d5e0[_0x4d25('0x24')][_0x4d25('0x26')]);return _0x344dfb(_0x56d5e0['error']['message']);}else{logger['info'](_0x4d25('0x20'),_0x709bbd,_0x4d25('0x21'));_0x344dfb(_0x56d5e0[_0x4d25('0x27')][_0x4d25('0x26')]);}})[_0x4d25('0x28')](function(_0x38a23b){logger[_0x4d25('0x24')](_0x4d25('0x20'),_0x709bbd,_0x38a23b);_0x487bcf(_0x38a23b);});});}function respondWithStatusCode(_0x5c8878,_0x58cf9b){_0x58cf9b=_0x58cf9b||0xcc;return function(_0x56ffa3){if(_0x56ffa3){return _0x5c8878[_0x4d25('0x29')](_0x58cf9b);}return _0x5c8878['status'](_0x58cf9b)[_0x4d25('0x2a')]();};}function respondWithResult(_0x4c461f,_0x1bfbed){_0x1bfbed=_0x1bfbed||0xc8;return function(_0x272be5){if(_0x272be5){return _0x4c461f[_0x4d25('0x2b')](_0x1bfbed)[_0x4d25('0x2c')](_0x272be5);}};}function respondWithFilteredResult(_0xf6968c,_0x27a1a0){return function(_0x5e4375){if(_0x5e4375){var _0x3702d0=typeof _0x27a1a0[_0x4d25('0x2d')]===_0x4d25('0x2e')&&typeof _0x27a1a0[_0x4d25('0x2f')]===_0x4d25('0x2e');var _0x4cf31e=_0x5e4375[_0x4d25('0x30')];var _0x4d1de8=_0x3702d0?0x0:_0x27a1a0[_0x4d25('0x2d')];var _0x41c47a=_0x3702d0?_0x5e4375['count']:_0x27a1a0[_0x4d25('0x2d')]+_0x27a1a0['limit'];var _0x4968a1;if(_0x41c47a>=_0x4cf31e){_0x41c47a=_0x4cf31e;_0x4968a1=0xc8;}else{_0x4968a1=0xce;}_0xf6968c[_0x4d25('0x2b')](_0x4968a1);return _0xf6968c[_0x4d25('0x31')](_0x4d25('0x32'),_0x4d1de8+'-'+_0x41c47a+'/'+_0x4cf31e)[_0x4d25('0x2c')](_0x5e4375);}return null;};}function patchUpdates(_0x18a713){return function(_0x212b82){try{jsonpatch[_0x4d25('0x33')](_0x212b82,_0x18a713,!![]);}catch(_0x1361b1){return BPromise[_0x4d25('0x34')](_0x1361b1);}return _0x212b82[_0x4d25('0x35')]();};}function saveUpdates(_0x347290,_0x3aa3c3){return function(_0x6320d8){if(_0x6320d8){return _0x6320d8[_0x4d25('0x36')](_0x347290)[_0x4d25('0x37')](function(_0x45d50c){return _0x45d50c;});}return null;};}function removeEntity(_0x51835f,_0x4e21a7){return function(_0x2af4ab){if(_0x2af4ab){return _0x2af4ab[_0x4d25('0x38')]()[_0x4d25('0x37')](function(){var _0x3cb7d7=_0x2af4ab[_0x4d25('0x39')]({'plain':!![]});var _0x1319a1=_0x4d25('0x3a');return db['UserProfileResource'][_0x4d25('0x38')]({'where':{'type':_0x1319a1,'resourceId':_0x3cb7d7['id']}})[_0x4d25('0x37')](function(){return _0x2af4ab;});})[_0x4d25('0x37')](function(){_0x51835f[_0x4d25('0x2b')](0xcc)[_0x4d25('0x2a')]();});}};}function handleEntityNotFound(_0x5026d4,_0xf97242){return function(_0x1b6872){if(!_0x1b6872){_0x5026d4[_0x4d25('0x29')](0x194);}return _0x1b6872;};}function handleError(_0x5e5542,_0x2421c5){_0x2421c5=_0x2421c5||0x1f4;return function(_0x3d02f3){logger[_0x4d25('0x24')](_0x3d02f3[_0x4d25('0x3b')]);if(_0x3d02f3[_0x4d25('0x3c')]){delete _0x3d02f3[_0x4d25('0x3c')];}_0x5e5542['status'](_0x2421c5)[_0x4d25('0x3d')](_0x3d02f3);};}exports[_0x4d25('0x3e')]=function(_0x497da9,_0x31df29){var _0x87babb={'include':[{'model':db[_0x4d25('0x3f')],'as':_0x4d25('0x40')}]},_0x168a66={},_0x1bb915={'count':0x0,'rows':[]};var _0x4cf250=_[_0x4d25('0x41')](db[_0x4d25('0x42')][_0x4d25('0x43')],function(_0x4e4393){return{'name':_0x4e4393[_0x4d25('0x44')],'type':_0x4e4393[_0x4d25('0x45')][_0x4d25('0x46')]};});_0x168a66[_0x4d25('0x47')]=_[_0x4d25('0x41')](_0x4cf250,_0x4d25('0x3c'));_0x168a66[_0x4d25('0x48')]=_[_0x4d25('0x49')](_0x497da9[_0x4d25('0x48')]);_0x168a66[_0x4d25('0x4a')]=_[_0x4d25('0x4b')](_0x168a66[_0x4d25('0x47')],_0x168a66['query']);_0x87babb[_0x4d25('0x4c')]=_[_0x4d25('0x4b')](_0x168a66[_0x4d25('0x47')],qs[_0x4d25('0x4d')](_0x497da9[_0x4d25('0x48')][_0x4d25('0x4d')]));_0x87babb['attributes']=_0x87babb[_0x4d25('0x4c')][_0x4d25('0x4e')]?_0x87babb[_0x4d25('0x4c')]:_0x168a66[_0x4d25('0x47')];if(!_0x497da9[_0x4d25('0x48')][_0x4d25('0x4f')](_0x4d25('0x50'))){_0x87babb['limit']=qs[_0x4d25('0x2f')](_0x497da9[_0x4d25('0x48')]['limit']);_0x87babb[_0x4d25('0x2d')]=qs[_0x4d25('0x2d')](_0x497da9[_0x4d25('0x48')][_0x4d25('0x2d')]);}_0x87babb[_0x4d25('0x51')]=qs[_0x4d25('0x52')](_0x497da9[_0x4d25('0x48')][_0x4d25('0x52')]);_0x87babb[_0x4d25('0x53')]=qs[_0x4d25('0x4a')](_[_0x4d25('0x54')](_0x497da9[_0x4d25('0x48')],_0x168a66['filters']),_0x4cf250);if(_0x497da9[_0x4d25('0x48')][_0x4d25('0x55')]){_0x87babb[_0x4d25('0x53')]=_['merge'](_0x87babb[_0x4d25('0x53')],{'$or':_[_0x4d25('0x41')](_0x4cf250,function(_0x57db45){if(_0x57db45['type']!==_0x4d25('0x56')){var _0x1f9e74={};_0x1f9e74[_0x57db45[_0x4d25('0x3c')]]={'$like':'%'+_0x497da9[_0x4d25('0x48')]['filter']+'%'};return _0x1f9e74;}})});}_0x87babb=_[_0x4d25('0x57')]({},_0x87babb,_0x497da9[_0x4d25('0x58')]);var _0x4f3333={'where':_0x87babb[_0x4d25('0x53')]};return db[_0x4d25('0x42')][_0x4d25('0x30')](_0x4f3333)[_0x4d25('0x37')](function(_0x28f410){_0x1bb915[_0x4d25('0x30')]=_0x28f410;if(_0x497da9[_0x4d25('0x48')]['includeAll']){_0x87babb[_0x4d25('0x59')]=[{'all':!![]}];}return db['FaxAccount'][_0x4d25('0x5a')](_0x87babb);})[_0x4d25('0x37')](function(_0x57c571){_0x1bb915['rows']=_0x57c571;return _0x1bb915;})[_0x4d25('0x37')](respondWithFilteredResult(_0x31df29,_0x87babb))[_0x4d25('0x28')](handleError(_0x31df29,null));};exports[_0x4d25('0x5b')]=function(_0x58d891,_0x430b99){var _0x404cc0={'raw':![],'where':{'id':_0x58d891['params']['id']},'include':[{'model':db['Pause'],'as':_0x4d25('0x40')}]},_0x17e2a6={};_0x17e2a6[_0x4d25('0x47')]=_['keys'](db[_0x4d25('0x42')][_0x4d25('0x43')]);_0x17e2a6['query']=_[_0x4d25('0x49')](_0x58d891[_0x4d25('0x48')]);_0x17e2a6[_0x4d25('0x4a')]=_[_0x4d25('0x4b')](_0x17e2a6[_0x4d25('0x47')],_0x17e2a6['query']);_0x404cc0['attributes']=_[_0x4d25('0x4b')](_0x17e2a6[_0x4d25('0x47')],qs[_0x4d25('0x4d')](_0x58d891['query'][_0x4d25('0x4d')]));_0x404cc0[_0x4d25('0x4c')]=_0x404cc0[_0x4d25('0x4c')][_0x4d25('0x4e')]?_0x404cc0[_0x4d25('0x4c')]:_0x17e2a6[_0x4d25('0x47')];if(_0x58d891['query'][_0x4d25('0x5c')]){_0x404cc0[_0x4d25('0x59')]=[{'all':!![]}];}_0x404cc0=_['merge']({},_0x404cc0,_0x58d891[_0x4d25('0x58')]);return db[_0x4d25('0x42')][_0x4d25('0x5d')](_0x404cc0)[_0x4d25('0x37')](handleEntityNotFound(_0x430b99,null))['then'](respondWithResult(_0x430b99,null))[_0x4d25('0x28')](handleError(_0x430b99,null));};exports['create']=function(_0x1d3dcd,_0x29d48f){return db[_0x4d25('0x42')][_0x4d25('0x5e')](_0x1d3dcd['body'],{})[_0x4d25('0x37')](function(_0x7bdee9){var _0x240dd7=_0x1d3dcd['user'][_0x4d25('0x39')]({'plain':!![]});if(!_0x240dd7)throw new Error(_0x4d25('0x5f'));if(_0x240dd7[_0x4d25('0x60')]===_0x4d25('0x61')){var _0x1b5fe5=_0x7bdee9['get']({'plain':!![]});var _0x48b2f='FaxAccounts';return db[_0x4d25('0x62')][_0x4d25('0x5d')]({'where':{'name':_0x48b2f,'userProfileId':_0x240dd7[_0x4d25('0x63')]},'raw':!![]})['then'](function(_0x44104b){if(_0x44104b&&_0x44104b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1b5fe5['name'],'resourceId':_0x1b5fe5['id'],'type':_0x44104b[_0x4d25('0x3c')],'sectionId':_0x44104b['id']},{})[_0x4d25('0x37')](function(){return _0x7bdee9;});}else{return _0x7bdee9;}})[_0x4d25('0x28')](function(_0x586bfc){logger[_0x4d25('0x24')](_0x4d25('0x64'),_0x586bfc);throw _0x586bfc;});}return _0x7bdee9;})[_0x4d25('0x37')](respondWithResult(_0x29d48f,0xc9))[_0x4d25('0x28')](handleError(_0x29d48f,null));};exports[_0x4d25('0x36')]=function(_0x1ed9f8,_0x14461d){if(_0x1ed9f8[_0x4d25('0x65')]['id']){delete _0x1ed9f8[_0x4d25('0x65')]['id'];}return db[_0x4d25('0x42')][_0x4d25('0x5d')]({'where':{'id':_0x1ed9f8[_0x4d25('0x66')]['id']},'include':[{'model':db[_0x4d25('0x3f')],'as':_0x4d25('0x40')}]})[_0x4d25('0x37')](handleEntityNotFound(_0x14461d,null))[_0x4d25('0x37')](saveUpdates(_0x1ed9f8[_0x4d25('0x65')],null))['then'](respondWithResult(_0x14461d,null))['catch'](handleError(_0x14461d,null));};exports[_0x4d25('0x38')]=function(_0x2ca525,_0x4af9d5){return db['FaxAccount'][_0x4d25('0x5d')]({'where':{'id':_0x2ca525[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x4af9d5,null))['then'](removeEntity(_0x4af9d5,null))[_0x4d25('0x28')](handleError(_0x4af9d5,null));};exports[_0x4d25('0x67')]=function(_0x5ccbd5,_0x4adc70){return db['FaxAccount'][_0x4d25('0x67')]()['then'](respondWithResult(_0x4adc70,null))[_0x4d25('0x28')](handleError(_0x4adc70,null));};exports['addDisposition']=function(_0xa93581,_0x49f182,_0x5d5325){if(_0xa93581['body']['id']){delete _0xa93581[_0x4d25('0x65')]['id'];}return db[_0x4d25('0x42')][_0x4d25('0x5d')]({'where':{'id':_0xa93581[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x49f182,null))['then'](function(_0x5a7d01){if(_0x5a7d01){_0xa93581['body'][_0x4d25('0x68')]=_0x5a7d01['id'];return db[_0x4d25('0x69')]['create'](_0xa93581[_0x4d25('0x65')]);}})[_0x4d25('0x37')](respondWithResult(_0x49f182,null))[_0x4d25('0x28')](handleError(_0x49f182,null));};exports['getDispositions']=function(_0x5bcd73,_0x1abc3c,_0x30f450){var _0x3cc4fa={'raw':![],'where':{}};var _0x53ef90={};var _0x2c0bbc={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4d25('0x6a')]({'where':{'id':_0x5bcd73['params']['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x1abc3c,null))[_0x4d25('0x37')](function(_0x491403){if(_0x491403){_0x53ef90[_0x4d25('0x47')]=_[_0x4d25('0x49')](db[_0x4d25('0x69')][_0x4d25('0x43')]);_0x53ef90['query']=_['keys'](_0x5bcd73[_0x4d25('0x48')]);_0x53ef90[_0x4d25('0x4a')]=_[_0x4d25('0x4b')](_0x53ef90[_0x4d25('0x47')],_0x53ef90[_0x4d25('0x48')]);_0x3cc4fa[_0x4d25('0x4c')]=_[_0x4d25('0x4b')](_0x53ef90[_0x4d25('0x47')],qs['fields'](_0x5bcd73['query']['fields']));_0x3cc4fa['attributes']=_0x3cc4fa['attributes']['length']?_0x3cc4fa[_0x4d25('0x4c')]:_0x53ef90[_0x4d25('0x47')];if(!_0x5bcd73[_0x4d25('0x48')][_0x4d25('0x4f')](_0x4d25('0x50'))){_0x3cc4fa[_0x4d25('0x2f')]=qs[_0x4d25('0x2f')](_0x5bcd73[_0x4d25('0x48')][_0x4d25('0x2f')]);_0x3cc4fa[_0x4d25('0x2d')]=qs['offset'](_0x5bcd73[_0x4d25('0x48')][_0x4d25('0x2d')]);}_0x3cc4fa['order']=qs['sort'](_0x5bcd73[_0x4d25('0x48')]['sort']);_0x3cc4fa[_0x4d25('0x53')]=qs['filters'](_['pick'](_0x5bcd73['query'],_0x53ef90[_0x4d25('0x4a')]));_0x3cc4fa[_0x4d25('0x53')][_0x4d25('0x68')]=_0x491403['id'];if(_0x5bcd73[_0x4d25('0x48')]['filter']){_0x3cc4fa[_0x4d25('0x53')]=_[_0x4d25('0x57')](_0x3cc4fa[_0x4d25('0x53')],{'$or':_[_0x4d25('0x41')](_0x3cc4fa['attributes'],function(_0x10103b){var _0x1908f5={};_0x1908f5[_0x10103b]={'$like':'%'+_0x5bcd73[_0x4d25('0x48')][_0x4d25('0x55')]+'%'};return _0x1908f5;})});}_0x3cc4fa=_['merge']({},_0x3cc4fa,_0x5bcd73[_0x4d25('0x58')]);return db[_0x4d25('0x69')][_0x4d25('0x30')]({'where':_0x3cc4fa[_0x4d25('0x53')]})[_0x4d25('0x37')](function(_0x29f370){_0x2c0bbc[_0x4d25('0x30')]=_0x29f370;if(_0x5bcd73[_0x4d25('0x48')][_0x4d25('0x5c')]){_0x3cc4fa[_0x4d25('0x59')]=[{'all':!![]}];}return db[_0x4d25('0x69')][_0x4d25('0x5a')](_0x3cc4fa);})[_0x4d25('0x37')](function(_0x24c823){_0x2c0bbc['rows']=_0x24c823;return _0x2c0bbc;});}})[_0x4d25('0x37')](respondWithFilteredResult(_0x1abc3c,_0x3cc4fa))[_0x4d25('0x28')](handleError(_0x1abc3c,null));};exports[_0x4d25('0x6b')]=function(_0x1f8f79,_0x49b7a,_0x2749f3){return db[_0x4d25('0x42')][_0x4d25('0x5d')]({'where':{'id':_0x1f8f79[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x49b7a,null))[_0x4d25('0x37')](function(_0x250626){if(_0x250626){return _0x250626[_0x4d25('0x6b')](_0x1f8f79['query'][_0x4d25('0x6c')]);}})['then'](respondWithStatusCode(_0x49b7a,null))['catch'](handleError(_0x49b7a,null));};exports[_0x4d25('0x6d')]=function(_0x14b5bc,_0x3eadd4,_0x1a2b24){if(_0x14b5bc[_0x4d25('0x65')]['id']){delete _0x14b5bc[_0x4d25('0x65')]['id'];}return db[_0x4d25('0x42')][_0x4d25('0x5d')]({'where':{'id':_0x14b5bc['params']['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x3eadd4,null))['then'](function(_0xe115c9){if(_0xe115c9){_0x14b5bc[_0x4d25('0x65')][_0x4d25('0x68')]=_0xe115c9['id'];return db[_0x4d25('0x6e')]['create'](_0x14b5bc[_0x4d25('0x65')]);}})['then'](respondWithResult(_0x3eadd4,null))[_0x4d25('0x28')](handleError(_0x3eadd4,null));};exports['getAnswers']=function(_0x47687e,_0x67a2a3,_0x39e95b){var _0x1772e3={'raw':![],'where':{}};var _0x39b826={};var _0x3b9bef={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4d25('0x6a')]({'where':{'id':_0x47687e['params']['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x67a2a3,null))['then'](function(_0x58ca0a){if(_0x58ca0a){_0x39b826[_0x4d25('0x47')]=_[_0x4d25('0x49')](db['CannedAnswer'][_0x4d25('0x43')]);_0x39b826['query']=_['keys'](_0x47687e[_0x4d25('0x48')]);_0x39b826[_0x4d25('0x4a')]=_[_0x4d25('0x4b')](_0x39b826[_0x4d25('0x47')],_0x39b826[_0x4d25('0x48')]);_0x1772e3[_0x4d25('0x4c')]=_[_0x4d25('0x4b')](_0x39b826[_0x4d25('0x47')],qs[_0x4d25('0x4d')](_0x47687e[_0x4d25('0x48')]['fields']));_0x1772e3['attributes']=_0x1772e3[_0x4d25('0x4c')][_0x4d25('0x4e')]?_0x1772e3[_0x4d25('0x4c')]:_0x39b826[_0x4d25('0x47')];if(!_0x47687e[_0x4d25('0x48')][_0x4d25('0x4f')](_0x4d25('0x50'))){_0x1772e3[_0x4d25('0x2f')]=qs[_0x4d25('0x2f')](_0x47687e[_0x4d25('0x48')][_0x4d25('0x2f')]);_0x1772e3[_0x4d25('0x2d')]=qs[_0x4d25('0x2d')](_0x47687e[_0x4d25('0x48')][_0x4d25('0x2d')]);}_0x1772e3[_0x4d25('0x51')]=qs[_0x4d25('0x52')](_0x47687e[_0x4d25('0x48')][_0x4d25('0x52')]);_0x1772e3[_0x4d25('0x53')]=qs[_0x4d25('0x4a')](_['pick'](_0x47687e[_0x4d25('0x48')],_0x39b826[_0x4d25('0x4a')]));_0x1772e3[_0x4d25('0x53')]['FaxAccountId']=_0x58ca0a['id'];if(_0x47687e[_0x4d25('0x48')][_0x4d25('0x55')]){_0x1772e3[_0x4d25('0x53')]=_[_0x4d25('0x57')](_0x1772e3[_0x4d25('0x53')],{'$or':_[_0x4d25('0x41')](_0x1772e3[_0x4d25('0x4c')],function(_0x565e58){var _0x3db09f={};_0x3db09f[_0x565e58]={'$like':'%'+_0x47687e[_0x4d25('0x48')]['filter']+'%'};return _0x3db09f;})});}_0x1772e3=_[_0x4d25('0x57')]({},_0x1772e3,_0x47687e[_0x4d25('0x58')]);return db[_0x4d25('0x6e')]['count']({'where':_0x1772e3[_0x4d25('0x53')]})[_0x4d25('0x37')](function(_0x256791){_0x3b9bef['count']=_0x256791;if(_0x47687e[_0x4d25('0x48')][_0x4d25('0x5c')]){_0x1772e3['include']=[{'all':!![]}];}return db[_0x4d25('0x6e')][_0x4d25('0x5a')](_0x1772e3);})[_0x4d25('0x37')](function(_0x2d9023){_0x3b9bef[_0x4d25('0x6f')]=_0x2d9023;return _0x3b9bef;});}})[_0x4d25('0x37')](respondWithFilteredResult(_0x67a2a3,_0x1772e3))[_0x4d25('0x28')](handleError(_0x67a2a3,null));};exports[_0x4d25('0x70')]=function(_0x427e2a,_0x1e3744,_0x2320d6){return db[_0x4d25('0x42')]['find']({'where':{'id':_0x427e2a[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x1e3744,null))[_0x4d25('0x37')](function(_0x3829e7){if(_0x3829e7){return _0x3829e7[_0x4d25('0x70')](_0x427e2a[_0x4d25('0x48')][_0x4d25('0x6c')]);}})[_0x4d25('0x37')](respondWithStatusCode(_0x1e3744,null))[_0x4d25('0x28')](handleError(_0x1e3744,null));};exports['addInteraction']=function(_0x38733a,_0x2eb1f2,_0x3ba1d2){return db[_0x4d25('0x71')][_0x4d25('0x5d')]({'where':{'id':_0x38733a['params']['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x2eb1f2,null))[_0x4d25('0x37')](function(_0x2b23a8){if(_0x2b23a8){return _0x2b23a8['addInteraction'](_0x38733a[_0x4d25('0x65')][_0x4d25('0x6c')],_[_0x4d25('0x72')](_0x38733a['body'],[_0x4d25('0x6c'),'id'])||{});}})[_0x4d25('0x37')](respondWithResult(_0x2eb1f2,null))[_0x4d25('0x28')](handleError(_0x2eb1f2,null));};exports[_0x4d25('0x73')]=function(_0x3dc9df,_0x157f3b,_0x4f405c){var _0x897492={'raw':![],'where':{}};var _0x27aead={};var _0x567482={'count':0x0,'rows':[]};return db[_0x4d25('0x42')][_0x4d25('0x6a')]({'where':{'id':_0x3dc9df[_0x4d25('0x66')]['id']}})['then'](handleEntityNotFound(_0x157f3b,null))['then'](function(_0x13307d){if(_0x13307d){_0x27aead[_0x4d25('0x47')]=_[_0x4d25('0x49')](db[_0x4d25('0x71')][_0x4d25('0x43')]);_0x27aead[_0x4d25('0x48')]=_[_0x4d25('0x49')](_0x3dc9df[_0x4d25('0x48')]);_0x27aead[_0x4d25('0x4a')]=_['intersection'](_0x27aead[_0x4d25('0x47')],_0x27aead[_0x4d25('0x48')]);_0x897492['attributes']=_[_0x4d25('0x4b')](_0x27aead[_0x4d25('0x47')],qs[_0x4d25('0x4d')](_0x3dc9df['query']['fields']));_0x897492[_0x4d25('0x4c')]=_0x897492['attributes']['length']?_0x897492[_0x4d25('0x4c')]:_0x27aead['model'];if(!_0x3dc9df[_0x4d25('0x48')][_0x4d25('0x4f')](_0x4d25('0x50'))){_0x897492[_0x4d25('0x2f')]=qs[_0x4d25('0x2f')](_0x3dc9df['query']['limit']);_0x897492[_0x4d25('0x2d')]=qs['offset'](_0x3dc9df[_0x4d25('0x48')][_0x4d25('0x2d')]);}_0x897492[_0x4d25('0x51')]=qs[_0x4d25('0x52')](_0x3dc9df[_0x4d25('0x48')]['sort']);_0x897492['where']=qs[_0x4d25('0x4a')](_[_0x4d25('0x54')](_0x3dc9df['query'],_0x27aead['filters']));_0x897492['where'][_0x4d25('0x68')]=_0x13307d['id'];if(_0x3dc9df[_0x4d25('0x48')][_0x4d25('0x55')]){_0x897492[_0x4d25('0x53')]=_['merge'](_0x897492[_0x4d25('0x53')],{'$or':_[_0x4d25('0x41')](_0x897492['attributes'],function(_0xfbe231){var _0x23514c={};_0x23514c[_0xfbe231]={'$like':'%'+_0x3dc9df[_0x4d25('0x48')][_0x4d25('0x55')]+'%'};return _0x23514c;})});}_0x897492=_[_0x4d25('0x57')]({},_0x897492,_0x3dc9df['options']);return db['FaxInteraction'][_0x4d25('0x30')]({'where':_0x897492[_0x4d25('0x53')]})[_0x4d25('0x37')](function(_0x407c5a){_0x567482[_0x4d25('0x30')]=_0x407c5a;if(_0x3dc9df['query']['includeAll']){_0x897492['include']=[{'model':db[_0x4d25('0x74')],'as':_0x4d25('0x75'),'required':![]},{'model':db[_0x4d25('0x76')],'as':'Owner','attributes':[_0x4d25('0x3c'),'fullname',_0x4d25('0x77')],'required':![]},{'model':db[_0x4d25('0x78')],'as':_0x4d25('0x79'),'attributes':['id',_0x4d25('0x3c'),_0x4d25('0x7a')],'where':_0x3dc9df['query'][_0x4d25('0x7b')]?{'id':_0x3dc9df[_0x4d25('0x48')][_0x4d25('0x7b')]}:undefined,'required':_0x3dc9df[_0x4d25('0x48')][_0x4d25('0x7b')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x897492);})[_0x4d25('0x37')](function(_0x2684e2){_0x567482['rows']=_0x2684e2;return _0x567482;});}})[_0x4d25('0x37')](respondWithFilteredResult(_0x157f3b,_0x897492))[_0x4d25('0x28')](handleError(_0x157f3b,null));};exports[_0x4d25('0x7c')]=function(_0x2c717e,_0x578578){var _0x232562=_0x2c717e['params']['id'];var _0x610875=_0x2c717e['body'];var _0x522e19=0xc8;var _0x9951b0=null;return db[_0x4d25('0x7d')][_0x4d25('0x7e')]({'isolationLevel':db[_0x4d25('0x7d')][_0x4d25('0x7f')][_0x4d25('0x80')][_0x4d25('0x81')]},function(_0xce9af9){return db[_0x4d25('0x42')][_0x4d25('0x6a')]({'where':{'id':_0x232562},'transaction':_0xce9af9})['then'](function(_0x37b06c){if(_0x37b06c){return db[_0x4d25('0x82')][_0x4d25('0x38')]({'where':{'FaxAccountId':_0x232562},'transaction':_0xce9af9})[_0x4d25('0x37')](function(){var _0x375b5e=_[_0x4d25('0x41')](_0x610875,function(_0x1c82c9){_0x1c82c9[_0x4d25('0x68')]=_0x232562;return _0x1c82c9;});return db[_0x4d25('0x82')][_0x4d25('0x83')](_0x375b5e,{'transaction':_0xce9af9});});}else{_0x522e19=0x194;_0x9951b0=[];}});})[_0x4d25('0x37')](function(){if(_0x522e19!==0x194){return db[_0x4d25('0x82')][_0x4d25('0x84')]({'where':{'FaxAccountId':_0x232562},'order':_0x4d25('0x85')})[_0x4d25('0x37')](function(_0x3aba0b){_0x9951b0=_0x3aba0b;});}})[_0x4d25('0x28')](function(_0xcd66b3){_0x522e19=0x1f4;logger['error'](_0xcd66b3[_0x4d25('0x3b')]);if(_0xcd66b3['name']){delete _0xcd66b3['name'];}_0x9951b0=_0xcd66b3;})['finally'](function(){if(_0x9951b0===null){_0x578578[_0x4d25('0x29')](_0x522e19);}else{if(_0x522e19===0x1f4){_0x578578[_0x4d25('0x2b')](_0x522e19)[_0x4d25('0x3d')](_0x9951b0);}else{_0x578578[_0x4d25('0x2b')](_0x522e19)[_0x4d25('0x2c')](_0x9951b0);}}});};exports['getApplications']=function(_0xee5305,_0x1762aa,_0x595c51){var _0x5d5129={};var _0x382e99={};var _0xef6271;var _0x3310c6;return db[_0x4d25('0x42')]['findOne']({'where':{'id':_0xee5305[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x1762aa,null))[_0x4d25('0x37')](function(_0x45e953){if(_0x45e953){_0xef6271=_0x45e953;_0x382e99[_0x4d25('0x47')]=_[_0x4d25('0x49')](db['FaxApplication'][_0x4d25('0x43')]);_0x382e99[_0x4d25('0x48')]=_['keys'](_0xee5305[_0x4d25('0x48')]);_0x382e99[_0x4d25('0x4a')]=_[_0x4d25('0x4b')](_0x382e99[_0x4d25('0x47')],_0x382e99['query']);_0x5d5129['attributes']=_[_0x4d25('0x4b')](_0x382e99['model'],qs['fields'](_0xee5305[_0x4d25('0x48')][_0x4d25('0x4d')]));_0x5d5129['attributes']=_0x5d5129[_0x4d25('0x4c')][_0x4d25('0x4e')]?_0x5d5129['attributes']:_0x382e99['model'];_0x5d5129[_0x4d25('0x51')]=qs['sort'](_0xee5305['query'][_0x4d25('0x52')]);_0x5d5129['where']=qs['filters'](_[_0x4d25('0x54')](_0xee5305[_0x4d25('0x48')],_0x382e99[_0x4d25('0x4a')]));if(_0xee5305[_0x4d25('0x48')]['filter']){_0x5d5129[_0x4d25('0x53')]=_[_0x4d25('0x57')](_0x5d5129[_0x4d25('0x53')],{'$or':_[_0x4d25('0x41')](_0x5d5129[_0x4d25('0x4c')],function(_0x40ebd6){var _0x324a83={};_0x324a83[_0x40ebd6]={'$like':'%'+_0xee5305['query'][_0x4d25('0x55')]+'%'};return _0x324a83;})});}_0x5d5129=_[_0x4d25('0x57')]({},_0x5d5129,_0xee5305[_0x4d25('0x58')]);return _0xef6271['getApplications'](_0x5d5129);}})[_0x4d25('0x37')](function(_0x2bb161){if(_0x2bb161){_0x3310c6=_0x2bb161['length'];if(!_0xee5305[_0x4d25('0x48')]['hasOwnProperty'](_0x4d25('0x50'))){_0x5d5129[_0x4d25('0x2f')]=qs[_0x4d25('0x2f')](_0xee5305[_0x4d25('0x48')]['limit']);_0x5d5129['offset']=qs[_0x4d25('0x2d')](_0xee5305[_0x4d25('0x48')]['offset']);}return _0xef6271[_0x4d25('0x86')](_0x5d5129);}})[_0x4d25('0x37')](function(_0x405710){if(_0x405710){return _0x405710?{'count':_0x3310c6,'rows':_0x405710}:null;}})['then'](respondWithResult(_0x1762aa,null))[_0x4d25('0x28')](handleError(_0x1762aa,null));};function Extension(_0x381f96,_0x235e6a,_0x11c20e,_0x4ba7a0){this[_0x4d25('0x87')]='from-voip-provider';this[_0x4d25('0x88')]=_0x381f96[_0x4d25('0x89')];this[_0x4d25('0x8a')]=_0x4ba7a0;this[_0x4d25('0x45')]=_0x4d25('0x8b');this[_0x4d25('0x8c')]=_0x4d25('0x8d');this[_0x4d25('0x68')]=_0x381f96['id'];this[_0x4d25('0x85')]=_0x235e6a;this[_0x4d25('0x8e')]=_0x11c20e;}function createExtensionsReciveFax(_0x29edcc){var _0xb5edd9=0x1;var _0x10e488=[];_0x10e488[_0x4d25('0x8f')](new Extension(_0x29edcc,_0xb5edd9,'',_0x4d25('0x90')));_0xb5edd9+=0x1;_0x10e488[_0x4d25('0x8f')](new Extension(_0x29edcc,_0xb5edd9,'CDR(type)=inbound-fax',_0x4d25('0x91')));_0xb5edd9+=0x1;for(var _0x4c546a in _0x29edcc){if(_0x29edcc['hasOwnProperty'](_0x4c546a)&&(_0x4c546a===_0x4d25('0x92')||_0x4c546a==='localstationid'||_0x4c546a===_0x4d25('0x93')||_0x4c546a===_0x4d25('0x94')||_0x4c546a==='headerinfo'||_0x4c546a==='maxrate'||_0x4c546a===_0x4d25('0x95')||_0x4c546a==='modem'||_0x4c546a===_0x4d25('0x96'))){_0x10e488['push'](new Extension(_0x29edcc,_0xb5edd9,_0x4d25('0x97')+_0x4c546a+')='+_0x29edcc[_0x4c546a],_0x4d25('0x91')));_0xb5edd9+=0x1;}}_0x10e488[_0x4d25('0x8f')](new Extension(_0x29edcc,_0xb5edd9,'6',_0x4d25('0x98')));_0xb5edd9+=0x1;_0x10e488[_0x4d25('0x8f')](new Extension(_0x29edcc,_0xb5edd9,_0x4d25('0x99'),_0x4d25('0x9a')));_0xb5edd9=0x0;return _0x10e488;}exports[_0x4d25('0x9b')]=function(_0x401af1,_0x14368c,_0x49307d){var _0x410149;return db[_0x4d25('0x7d')]['transaction'](function(_0x221acc){return db[_0x4d25('0x42')][_0x4d25('0x5e')](_0x401af1[_0x4d25('0x65')],{'transaction':_0x221acc})[_0x4d25('0x37')](function(_0x397e7f){_0x410149=_0x397e7f['get']({'plain':!![]});return db[_0x4d25('0x9c')][_0x4d25('0x83')](createExtensionsReciveFax(_0x410149),{'transaction':_0x221acc});});})[_0x4d25('0x37')](function(){return _0x410149;})['then'](respondWithResult(_0x14368c,null))[_0x4d25('0x28')](handleError(_0x14368c,null));};exports['updateAccountApplications']=function(_0x48f09c,_0x2437fc,_0x4cc0a7){var _0x292e74;return db[_0x4d25('0x7d')][_0x4d25('0x7e')](function(_0x14bb85){return db['FaxAccount']['update'](_0x48f09c['body'],{'where':{'id':_0x48f09c[_0x4d25('0x65')]['id']},'transaction':_0x14bb85})[_0x4d25('0x37')](function(_0x18dce9){return db[_0x4d25('0x9c')][_0x4d25('0x38')]({'where':{'FaxAccountId':_0x48f09c[_0x4d25('0x65')]['id']},'transaction':_0x14bb85})[_0x4d25('0x37')](function(_0xa63ad){return db[_0x4d25('0x9c')][_0x4d25('0x83')](createExtensionsReciveFax(_[_0x4d25('0x72')](_0x48f09c[_0x4d25('0x65')],[_0x4d25('0x9d'),_0x4d25('0x46'),_0x4d25('0x9e'),'updatedAt',_0x4d25('0x9f'),_0x4d25('0xa0')])),{'transaction':_0x14bb85});});});})[_0x4d25('0x37')](function(){return db['FaxAccount'][_0x4d25('0xa1')](_0x48f09c[_0x4d25('0x65')]['id']);})[_0x4d25('0x37')](respondWithResult(_0x2437fc,null))['catch'](handleError(_0x2437fc,null));};exports[_0x4d25('0xa2')]=function(_0x2b2d83,_0x3c94c9,_0x4779c1){var _0x332688={'raw':!![],'where':{}};var _0x175c5d={};var _0xd38a9a={'count':0x0,'rows':[]};return db[_0x4d25('0x42')][_0x4d25('0x6a')]({'where':{'id':_0x2b2d83[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x3c94c9,null))[_0x4d25('0x37')](function(_0x17e682){if(_0x17e682){_0x175c5d[_0x4d25('0x47')]=_['keys'](db[_0x4d25('0xa3')][_0x4d25('0x43')]);_0x175c5d[_0x4d25('0x48')]=_[_0x4d25('0x49')](_0x2b2d83[_0x4d25('0x48')]);_0x175c5d['filters']=_[_0x4d25('0x4b')](_0x175c5d['model'],_0x175c5d[_0x4d25('0x48')]);_0x332688[_0x4d25('0x4c')]=_[_0x4d25('0x4b')](_0x175c5d[_0x4d25('0x47')],qs[_0x4d25('0x4d')](_0x2b2d83[_0x4d25('0x48')][_0x4d25('0x4d')]));_0x332688[_0x4d25('0x4c')]=_0x332688['attributes'][_0x4d25('0x4e')]?_0x332688[_0x4d25('0x4c')]:_0x175c5d[_0x4d25('0x47')];if(!_0x2b2d83['query']['hasOwnProperty'](_0x4d25('0x50'))){_0x332688[_0x4d25('0x2f')]=qs['limit'](_0x2b2d83['query'][_0x4d25('0x2f')]);_0x332688[_0x4d25('0x2d')]=qs[_0x4d25('0x2d')](_0x2b2d83['query']['offset']);}_0x332688[_0x4d25('0x51')]=qs['sort'](_0x2b2d83[_0x4d25('0x48')][_0x4d25('0x52')]);_0x332688[_0x4d25('0x53')]=qs[_0x4d25('0x4a')](_[_0x4d25('0x54')](_0x2b2d83[_0x4d25('0x48')],_0x175c5d[_0x4d25('0x4a')]));_0x332688[_0x4d25('0x53')][_0x4d25('0x68')]=_0x17e682['id'];if(_0x2b2d83[_0x4d25('0x48')][_0x4d25('0x55')]){_0x332688[_0x4d25('0x53')]=_[_0x4d25('0x57')](_0x332688[_0x4d25('0x53')],{'$or':_[_0x4d25('0x41')](_0x332688['attributes'],function(_0x58c6c8){var _0x57c194={};_0x57c194[_0x58c6c8]={'$like':'%'+_0x2b2d83[_0x4d25('0x48')][_0x4d25('0x55')]+'%'};return _0x57c194;})});}if(_0x2b2d83[_0x4d25('0x48')][_0x4d25('0xa4')]){var _0x5b0449=_0x2b2d83['query'][_0x4d25('0xa4')][_0x4d25('0xa5')](',');var _0x4a044b={};_0x4a044b[_0x5b0449[0x0]]={'$gte':moment(_0x5b0449[0x1])[_0x4d25('0xa6')](_0x4d25('0xa7'))};_0x332688[_0x4d25('0x53')]=_[_0x4d25('0x57')](_0x332688['where'],_0x4a044b);}_0x332688=_['merge']({},_0x332688,_0x2b2d83[_0x4d25('0x58')]);return db[_0x4d25('0xa3')][_0x4d25('0x30')]({'where':_0x332688[_0x4d25('0x53')]})[_0x4d25('0x37')](function(_0xb11d30){_0xd38a9a[_0x4d25('0x30')]=_0xb11d30;if(_0x2b2d83['query']['includeAll']){_0x332688[_0x4d25('0x59')]=[{'all':!![]}];}return db[_0x4d25('0xa3')][_0x4d25('0x5a')](_0x332688);})['then'](function(_0x369848){_0xd38a9a['rows']=_0x369848;return _0xd38a9a;});}})[_0x4d25('0x37')](respondWithFilteredResult(_0x3c94c9,_0x332688))[_0x4d25('0x28')](handleError(_0x3c94c9,null));};exports['send']=function(_0xe9315e,_0x9c1089,_0x1bcf92){var _0x301039,_0x5d6faa={},_0x79bbee;if(_0xe9315e[_0x4d25('0x65')]['to']){_0x79bbee=_0xe9315e[_0x4d25('0x65')]['to'][0x0];}return db['FaxAccount'][_0x4d25('0x5d')]({'where':{'id':_0xe9315e[_0x4d25('0x66')]['id']},'include':[{'model':db[_0x4d25('0xa8')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4d25('0xa9'),'where':{'fax':_0x79bbee},'limit':0x1,'order':[[_0x4d25('0xaa'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x9c1089,null))['then'](function(_0x16bed6){_0x301039=_0x16bed6;if(_0xe9315e[_0x4d25('0x65')]['attachments']&&_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][_0x4d25('0x4e')]){for(var _0x140bd9=0x0;_0x140bd9<_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][_0x4d25('0x4e')];_0x140bd9+=0x1){_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][_0x140bd9]={'filename':_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][_0x140bd9][_0x4d25('0x3c')],'id':_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][_0x140bd9]['id'],'path':path['join'](config[_0x4d25('0xac')],_0x4d25('0xad'),_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][_0x140bd9][_0x4d25('0xae')])};}}return respondWithRpcPromise(_0x4d25('0xaf'),_0x4d25('0xaf'),{'FaxAccountId':_[_0x4d25('0xb0')](_0xe9315e[_0x4d25('0x66')]['id'])?undefined:_0xe9315e['params']['id'],'path':_[_0x4d25('0xb0')](_0xe9315e[_0x4d25('0x65')]['attachments'][0x0][_0x4d25('0x6')])?undefined:_0xe9315e[_0x4d25('0x65')]['attachments'][0x0][_0x4d25('0x6')],'fax':_[_0x4d25('0xb0')](_0xe9315e['body']['to'][0x0])?undefined:_0xe9315e[_0x4d25('0x65')]['to'][0x0]},client9002);})[_0x4d25('0x37')](function(){if(_0x301039){if(_[_0x4d25('0xb0')](_0xe9315e[_0x4d25('0x65')]['from'])){_0xe9315e[_0x4d25('0x65')][_0x4d25('0xb1')]=util[_0x4d25('0xa6')](_0x4d25('0xb2'),_0x301039[_0x4d25('0x3c')],_0x301039[_0x4d25('0xb3')]);}if(_0x301039[_0x4d25('0xb4')]){if(_0x301039[_0x4d25('0xb4')]['Contacts'][_0x4d25('0x4e')]){return _0x301039[_0x4d25('0xb4')][_0x4d25('0xa9')][0x0];}else{return db['CmContact'][_0x4d25('0x5e')](_['defaults'](_0xe9315e[_0x4d25('0x65')],{'firstName':_0xe9315e['body']['to'][0x0],'phone':_0xe9315e['body']['to'][0x0],'fax':_0xe9315e['body']['to'][0x0],'ListId':_0x301039[_0x4d25('0xa0')]}));}}else{throw new Error(_0x4d25('0xb5'));}}else{throw new Error(_0x4d25('0xb6'));}})[_0x4d25('0x37')](function(_0x55f420){if(_0x55f420){return db[_0x4d25('0x71')][_0x4d25('0x5d')]({'where':{'ContactId':_0x55f420['id'],'closed':![],'FaxAccountId':_0x301039['id']}})[_0x4d25('0x37')](function(_0x3d52a5){if(_0x3d52a5){return[_0x3d52a5,![]];}return db[_0x4d25('0x71')][_0x4d25('0x5e')]({'UserId':_0xe9315e[_0x4d25('0x61')]['id'],'ContactId':_0x55f420['id'],'FaxAccountId':_0x301039['id'],'fax':_0xe9315e[_0x4d25('0x65')]['to'][0x0],'firstMsgDirection':_0x4d25('0xb7'),'Messages':[_[_0x4d25('0x57')](_0xe9315e['body'],{'read':![],'body':_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][0x0][_0x4d25('0xb8')],'FaxAccountId':_0x301039['id'],'UserId':_0xe9315e['user']['id'],'ContactId':_0x55f420['id'],'AttachmentId':_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x4d25('0xa3')],'as':_0x4d25('0xb9')}]})[_0x4d25('0x37')](function(_0x47cfe7){return[_0x47cfe7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4d25('0xba')](function(_0x36196b,_0x442d64){if(_0x442d64){return _0x36196b;}return db[_0x4d25('0xa3')][_0x4d25('0x5e')]({'direction':_0x4d25('0xb7'),'read':![],'body':_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][0x0]['filename'],'FaxAccountId':_0x301039['id'],'FaxInteractionId':_0x36196b['id'],'UserId':_0xe9315e[_0x4d25('0x61')]['id'],'ContactId':_0x36196b['ContactId'],'AttachmentId':_0xe9315e['body'][_0x4d25('0xab')][0x0]['id']})[_0x4d25('0x37')](function(_0x5c3109){_0x36196b[_0x4d25('0xbb')][_0x4d25('0xb9')]=[];_0x36196b[_0x4d25('0xbb')]['Messages'][_0x4d25('0x8f')](_0x5c3109[_0x4d25('0xbb')]);return _0x36196b;});})[_0x4d25('0x37')](function(_0x28504d){respondWithRpcPromise(_0x4d25('0xbc'),_0x4d25('0xbc'),{'FaxAccountId':_[_0x4d25('0xb0')](_0xe9315e[_0x4d25('0x66')]['id'])?undefined:_0xe9315e[_0x4d25('0x66')]['id'],'path':_[_0x4d25('0xb0')](_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][0x0][_0x4d25('0x6')])?undefined:_0xe9315e[_0x4d25('0x65')][_0x4d25('0xab')][0x0][_0x4d25('0x6')],'fax':_[_0x4d25('0xb0')](_0xe9315e[_0x4d25('0x65')]['to'][0x0])?undefined:_0xe9315e['body']['to'][0x0],'AttachmentId':_0xe9315e['body'][_0x4d25('0xab')][0x0]['id']},client9002)[_0x4d25('0x37')](function(_0x490fb2){logger[_0x4d25('0x1f')]('SendFaxRpc,\x20%s',_0x490fb2);})[_0x4d25('0x28')](function(_0x4d8bdb){logger[_0x4d25('0x1f')]('SendFaxRpc,\x20%s',_0x4d8bdb);});return _0x28504d;})[_0x4d25('0x37')](respondWithResult(_0x9c1089,null))[_0x4d25('0x28')](handleError(_0x9c1089,null));};exports['addAgents']=function(_0x3145dd,_0x23494c,_0x296f7e){return db[_0x4d25('0x42')][_0x4d25('0x5d')]({'where':{'id':_0x3145dd[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x23494c,null))[_0x4d25('0x37')](function(_0x19e5ae){if(_0x19e5ae){return _0x19e5ae['addAgents'](_0x3145dd[_0x4d25('0x65')][_0x4d25('0x6c')],_[_0x4d25('0x72')](_0x3145dd[_0x4d25('0x65')],[_0x4d25('0x6c'),'id'])||{})[_0x4d25('0xba')](function(_0x411c15){for(var _0x2d878c=0x0;_0x2d878c<_0x3145dd[_0x4d25('0x65')]['ids']['length'];_0x2d878c+=0x1){socket[_0x4d25('0xbd')](_0x4d25('0xbe'),{'UserId':Number(_0x3145dd['body'][_0x4d25('0x6c')][_0x2d878c]),'FaxAccountId':Number(_0x3145dd[_0x4d25('0x66')]['id'])});}return _0x411c15;});}})[_0x4d25('0x37')](respondWithResult(_0x23494c,null))[_0x4d25('0x28')](handleError(_0x23494c,null));};exports[_0x4d25('0xbf')]=function(_0x22582f,_0x1d91a0,_0x1261b0){return db['FaxAccount']['find']({'where':{'id':_0x22582f[_0x4d25('0x66')]['id']}})['then'](handleEntityNotFound(_0x1d91a0,null))[_0x4d25('0x37')](function(_0xe7ec35){if(_0xe7ec35){return _0xe7ec35['removeAgents'](_0x22582f['query'][_0x4d25('0x6c')])[_0x4d25('0x37')](function(){if(_[_0x4d25('0xc0')](_0x22582f[_0x4d25('0x48')][_0x4d25('0x6c')])){for(var _0x5bfe14=0x0;_0x5bfe14<_0x22582f[_0x4d25('0x48')][_0x4d25('0x6c')][_0x4d25('0x4e')];_0x5bfe14+=0x1){socket[_0x4d25('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x22582f[_0x4d25('0x48')][_0x4d25('0x6c')][_0x5bfe14]),'FaxAccountId':Number(_0x22582f['params']['id'])});}}else{socket[_0x4d25('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x22582f[_0x4d25('0x48')]['ids']),'FaxAccountId':Number(_0x22582f[_0x4d25('0x66')]['id'])});}});}})[_0x4d25('0x37')](respondWithStatusCode(_0x1d91a0,null))['catch'](handleError(_0x1d91a0,null));};exports[_0x4d25('0xc1')]=function(_0x1d12b4,_0x1efa50,_0x551d20){var _0xe447d6={};var _0x3550c6={};var _0x69be1f;var _0x135103;return db['FaxAccount'][_0x4d25('0x6a')]({'where':{'id':_0x1d12b4[_0x4d25('0x66')]['id']}})[_0x4d25('0x37')](handleEntityNotFound(_0x1efa50,null))[_0x4d25('0x37')](function(_0x1e7c77){if(_0x1e7c77){_0x69be1f=_0x1e7c77;_0x3550c6[_0x4d25('0x47')]=_[_0x4d25('0x49')](db['User']['rawAttributes']);_0x3550c6[_0x4d25('0x48')]=_['keys'](_0x1d12b4[_0x4d25('0x48')]);_0x3550c6[_0x4d25('0x4a')]=_[_0x4d25('0x4b')](_0x3550c6[_0x4d25('0x47')],_0x3550c6[_0x4d25('0x48')]);_0xe447d6[_0x4d25('0x4c')]=_[_0x4d25('0x4b')](_0x3550c6[_0x4d25('0x47')],qs['fields'](_0x1d12b4[_0x4d25('0x48')][_0x4d25('0x4d')]));_0xe447d6[_0x4d25('0x4c')]=_0xe447d6[_0x4d25('0x4c')][_0x4d25('0x4e')]?_0xe447d6[_0x4d25('0x4c')]:_0x3550c6[_0x4d25('0x47')];_0xe447d6[_0x4d25('0x51')]=qs[_0x4d25('0x52')](_0x1d12b4[_0x4d25('0x48')][_0x4d25('0x52')]);_0xe447d6['where']=qs['filters'](_[_0x4d25('0x54')](_0x1d12b4['query'],_0x3550c6['filters']));if(_0x1d12b4['query'][_0x4d25('0x55')]){_0xe447d6['where']=_[_0x4d25('0x57')](_0xe447d6[_0x4d25('0x53')],{'$or':_['map'](_0xe447d6[_0x4d25('0x4c')],function(_0x162764){var _0x50b1ca={};_0x50b1ca[_0x162764]={'$like':'%'+_0x1d12b4[_0x4d25('0x48')][_0x4d25('0x55')]+'%'};return _0x50b1ca;})});}_0xe447d6=_[_0x4d25('0x57')]({},_0xe447d6,_0x1d12b4[_0x4d25('0x58')]);return _0x69be1f[_0x4d25('0xc1')](_0xe447d6);}})[_0x4d25('0x37')](function(_0x76b690){if(_0x76b690){_0x135103=_0x76b690[_0x4d25('0x4e')];if(!_0x1d12b4[_0x4d25('0x48')][_0x4d25('0x4f')](_0x4d25('0x50'))){_0xe447d6[_0x4d25('0x2f')]=qs['limit'](_0x1d12b4[_0x4d25('0x48')]['limit']);_0xe447d6[_0x4d25('0x2d')]=qs[_0x4d25('0x2d')](_0x1d12b4[_0x4d25('0x48')][_0x4d25('0x2d')]);}return _0x69be1f[_0x4d25('0xc1')](_0xe447d6);}})[_0x4d25('0x37')](function(_0x488848){if(_0x488848){return _0x488848?{'count':_0x135103,'rows':_0x488848}:null;}})['then'](respondWithResult(_0x1efa50,null))[_0x4d25('0x28')](handleError(_0x1efa50,null));}; \ No newline at end of file +var _0x8828=['destroy','FaxAccounts','UserProfileResource','sendStatus','send','index','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','name','merge','options','includeAll','include','rows','catch','show','Pause','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','params','FaxAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','transaction','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','List','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','status','end','json','offset','undefined','limit','count','Content-Range','apply','update'];(function(_0x356edd,_0x253dae){var _0x1ce059=function(_0xe67d8b){while(--_0xe67d8b){_0x356edd['push'](_0x356edd['shift']());}};_0x1ce059(++_0x253dae);}(_0x8828,0x155));var _0x8882=function(_0x3417b4,_0x44bd02){_0x3417b4=_0x3417b4-0x0;var _0x288e1f=_0x8828[_0x3417b4];return _0x288e1f;};'use strict';var emlformat=require(_0x8882('0x0'));var rimraf=require(_0x8882('0x1'));var zipdir=require(_0x8882('0x2'));var jsonpatch=require(_0x8882('0x3'));var rp=require(_0x8882('0x4'));var moment=require(_0x8882('0x5'));var BPromise=require(_0x8882('0x6'));var Mustache=require(_0x8882('0x7'));var util=require(_0x8882('0x8'));var path=require('path');var sox=require(_0x8882('0x9'));var csv=require(_0x8882('0xa'));var ejs=require(_0x8882('0xb'));var fs=require('fs');var fs_extra=require(_0x8882('0xc'));var _=require(_0x8882('0xd'));var squel=require(_0x8882('0xe'));var crypto=require(_0x8882('0xf'));var jsforce=require(_0x8882('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8882('0x11'));var Papa=require('papaparse');var Redis=require(_0x8882('0x12'));var authService=require(_0x8882('0x13'));var qs=require(_0x8882('0x14'));var as=require(_0x8882('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8882('0x16'))('api');var utils=require(_0x8882('0x17'));var config=require(_0x8882('0x18'));var licenseUtil=require(_0x8882('0x19'));var db=require(_0x8882('0x1a'))['db'];config[_0x8882('0x1b')]=_[_0x8882('0x1c')](config[_0x8882('0x1b')],{'host':_0x8882('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8882('0x1b')]));require(_0x8882('0x1e'))['register'](socket);var jayson=require(_0x8882('0x1f'));var client=jayson[_0x8882('0x20')][_0x8882('0x21')]({'port':0x232c});var client9002=jayson[_0x8882('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475b28,_0x565a8d,_0x313bf0,_0x1dc0ec){return new BPromise(function(_0x2976ba,_0x5bcad6){var _0x1e2878=_0x1dc0ec||client;return _0x1e2878[_0x8882('0x22')](_0x475b28,_0x313bf0)[_0x8882('0x23')](function(_0x1d5f8f){logger[_0x8882('0x24')](_0x8882('0x25'),_0x565a8d,_0x8882('0x26'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x565a8d,_0x8882('0x26'),JSON['stringify'](_0x1d5f8f));if(_0x1d5f8f[_0x8882('0x27')]){if(_0x1d5f8f[_0x8882('0x27')][_0x8882('0x28')]===0x1f4){logger['error'](_0x8882('0x25'),_0x565a8d,_0x1d5f8f[_0x8882('0x27')][_0x8882('0x29')]);return _0x5bcad6(_0x1d5f8f[_0x8882('0x27')][_0x8882('0x29')]);}logger[_0x8882('0x27')](_0x8882('0x25'),_0x565a8d,_0x1d5f8f['error'][_0x8882('0x29')]);return _0x2976ba(_0x1d5f8f[_0x8882('0x27')][_0x8882('0x29')]);}else{logger[_0x8882('0x24')](_0x8882('0x25'),_0x565a8d,'request\x20sent');_0x2976ba(_0x1d5f8f[_0x8882('0x2a')][_0x8882('0x29')]);}})['catch'](function(_0x67f4eb){logger[_0x8882('0x27')]('FaxAccount,\x20%s,\x20%s',_0x565a8d,_0x67f4eb);_0x5bcad6(_0x67f4eb);});});}function respondWithStatusCode(_0x38d6bd,_0x14a890){_0x14a890=_0x14a890||0xcc;return function(_0x155eff){if(_0x155eff){return _0x38d6bd['sendStatus'](_0x14a890);}return _0x38d6bd[_0x8882('0x2b')](_0x14a890)[_0x8882('0x2c')]();};}function respondWithResult(_0x390938,_0x3006e7){_0x3006e7=_0x3006e7||0xc8;return function(_0x43d2ec){if(_0x43d2ec){return _0x390938['status'](_0x3006e7)[_0x8882('0x2d')](_0x43d2ec);}};}function respondWithFilteredResult(_0x3d066a,_0x1362dc){return function(_0x344b56){if(_0x344b56){var _0x48013f=typeof _0x1362dc[_0x8882('0x2e')]===_0x8882('0x2f')&&typeof _0x1362dc[_0x8882('0x30')]===_0x8882('0x2f');var _0x3b9e05=_0x344b56[_0x8882('0x31')];var _0x3523ee=_0x48013f?0x0:_0x1362dc[_0x8882('0x2e')];var _0x2cf369=_0x48013f?_0x344b56[_0x8882('0x31')]:_0x1362dc[_0x8882('0x2e')]+_0x1362dc[_0x8882('0x30')];var _0x72b8c7;if(_0x2cf369>=_0x3b9e05){_0x2cf369=_0x3b9e05;_0x72b8c7=0xc8;}else{_0x72b8c7=0xce;}_0x3d066a[_0x8882('0x2b')](_0x72b8c7);return _0x3d066a['set'](_0x8882('0x32'),_0x3523ee+'-'+_0x2cf369+'/'+_0x3b9e05)[_0x8882('0x2d')](_0x344b56);}return null;};}function patchUpdates(_0x1d4b73){return function(_0x5dafc0){try{jsonpatch[_0x8882('0x33')](_0x5dafc0,_0x1d4b73,!![]);}catch(_0x24a304){return BPromise['reject'](_0x24a304);}return _0x5dafc0['save']();};}function saveUpdates(_0xe987d2,_0xddd431){return function(_0x26afc3){if(_0x26afc3){return _0x26afc3[_0x8882('0x34')](_0xe987d2)[_0x8882('0x23')](function(_0x3b811e){return _0x3b811e;});}return null;};}function removeEntity(_0x38acda,_0xd55a27){return function(_0x2ab9cc){if(_0x2ab9cc){return _0x2ab9cc[_0x8882('0x35')]()['then'](function(){var _0x5be54e=_0x2ab9cc['get']({'plain':!![]});var _0x5a9867=_0x8882('0x36');return db[_0x8882('0x37')]['destroy']({'where':{'type':_0x5a9867,'resourceId':_0x5be54e['id']}})[_0x8882('0x23')](function(){return _0x2ab9cc;});})[_0x8882('0x23')](function(){_0x38acda[_0x8882('0x2b')](0xcc)[_0x8882('0x2c')]();});}};}function handleEntityNotFound(_0x28be91,_0x3b94d9){return function(_0x347779){if(!_0x347779){_0x28be91[_0x8882('0x38')](0x194);}return _0x347779;};}function handleError(_0x83cd23,_0x5a309f){_0x5a309f=_0x5a309f||0x1f4;return function(_0x3ddadb){logger[_0x8882('0x27')](_0x3ddadb['stack']);if(_0x3ddadb['name']){delete _0x3ddadb['name'];}_0x83cd23['status'](_0x5a309f)[_0x8882('0x39')](_0x3ddadb);};}exports[_0x8882('0x3a')]=function(_0x40af52,_0x138ca2){var _0x330cf8={'include':[{'model':db['Pause'],'as':_0x8882('0x3b')}]},_0x37dec5={},_0x191ae0={'count':0x0,'rows':[]};var _0xcfa0e8=_['map'](db[_0x8882('0x3c')][_0x8882('0x3d')],function(_0x4a006f){return{'name':_0x4a006f[_0x8882('0x3e')],'type':_0x4a006f['type'][_0x8882('0x3f')]};});_0x37dec5[_0x8882('0x40')]=_[_0x8882('0x41')](_0xcfa0e8,'name');_0x37dec5[_0x8882('0x42')]=_[_0x8882('0x43')](_0x40af52[_0x8882('0x42')]);_0x37dec5[_0x8882('0x44')]=_[_0x8882('0x45')](_0x37dec5[_0x8882('0x40')],_0x37dec5[_0x8882('0x42')]);_0x330cf8[_0x8882('0x46')]=_[_0x8882('0x45')](_0x37dec5['model'],qs[_0x8882('0x47')](_0x40af52[_0x8882('0x42')][_0x8882('0x47')]));_0x330cf8['attributes']=_0x330cf8[_0x8882('0x46')][_0x8882('0x48')]?_0x330cf8[_0x8882('0x46')]:_0x37dec5[_0x8882('0x40')];if(!_0x40af52[_0x8882('0x42')][_0x8882('0x49')]('nolimit')){_0x330cf8['limit']=qs[_0x8882('0x30')](_0x40af52[_0x8882('0x42')][_0x8882('0x30')]);_0x330cf8['offset']=qs[_0x8882('0x2e')](_0x40af52['query']['offset']);}_0x330cf8[_0x8882('0x4a')]=qs[_0x8882('0x4b')](_0x40af52[_0x8882('0x42')]['sort']);_0x330cf8[_0x8882('0x4c')]=qs[_0x8882('0x44')](_[_0x8882('0x4d')](_0x40af52[_0x8882('0x42')],_0x37dec5[_0x8882('0x44')]),_0xcfa0e8);if(_0x40af52['query'][_0x8882('0x4e')]){_0x330cf8['where']=_['merge'](_0x330cf8['where'],{'$or':_[_0x8882('0x41')](_0xcfa0e8,function(_0x14c0c7){if(_0x14c0c7[_0x8882('0x4f')]!=='VIRTUAL'){var _0x268972={};_0x268972[_0x14c0c7[_0x8882('0x50')]]={'$like':'%'+_0x40af52[_0x8882('0x42')][_0x8882('0x4e')]+'%'};return _0x268972;}})});}_0x330cf8=_[_0x8882('0x51')]({},_0x330cf8,_0x40af52[_0x8882('0x52')]);var _0x57d5dc={'where':_0x330cf8[_0x8882('0x4c')]};return db[_0x8882('0x3c')]['count'](_0x57d5dc)[_0x8882('0x23')](function(_0x254fbd){_0x191ae0[_0x8882('0x31')]=_0x254fbd;if(_0x40af52[_0x8882('0x42')][_0x8882('0x53')]){_0x330cf8[_0x8882('0x54')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x330cf8);})[_0x8882('0x23')](function(_0x26ad92){_0x191ae0[_0x8882('0x55')]=_0x26ad92;return _0x191ae0;})['then'](respondWithFilteredResult(_0x138ca2,_0x330cf8))[_0x8882('0x56')](handleError(_0x138ca2,null));};exports[_0x8882('0x57')]=function(_0x306de6,_0x470564){var _0x369297={'raw':![],'where':{'id':_0x306de6['params']['id']},'include':[{'model':db[_0x8882('0x58')],'as':_0x8882('0x3b')}]},_0x3539f0={};_0x3539f0[_0x8882('0x40')]=_[_0x8882('0x43')](db[_0x8882('0x3c')][_0x8882('0x3d')]);_0x3539f0[_0x8882('0x42')]=_[_0x8882('0x43')](_0x306de6[_0x8882('0x42')]);_0x3539f0[_0x8882('0x44')]=_[_0x8882('0x45')](_0x3539f0['model'],_0x3539f0[_0x8882('0x42')]);_0x369297['attributes']=_[_0x8882('0x45')](_0x3539f0['model'],qs[_0x8882('0x47')](_0x306de6['query'][_0x8882('0x47')]));_0x369297[_0x8882('0x46')]=_0x369297['attributes'][_0x8882('0x48')]?_0x369297['attributes']:_0x3539f0[_0x8882('0x40')];if(_0x306de6['query']['includeAll']){_0x369297[_0x8882('0x54')]=[{'all':!![]}];}_0x369297=_[_0x8882('0x51')]({},_0x369297,_0x306de6['options']);return db['FaxAccount']['find'](_0x369297)['then'](handleEntityNotFound(_0x470564,null))[_0x8882('0x23')](respondWithResult(_0x470564,null))[_0x8882('0x56')](handleError(_0x470564,null));};exports['create']=function(_0x1d0dfe,_0x5072de){return db[_0x8882('0x3c')][_0x8882('0x59')](_0x1d0dfe[_0x8882('0x5a')],{})[_0x8882('0x23')](function(_0x4a03de){var _0x596334=_0x1d0dfe[_0x8882('0x5b')][_0x8882('0x5c')]({'plain':!![]});if(!_0x596334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596334[_0x8882('0x5d')]==='user'){var _0x3ce332=_0x4a03de[_0x8882('0x5c')]({'plain':!![]});var _0x47e14b=_0x8882('0x36');return db[_0x8882('0x5e')][_0x8882('0x5f')]({'where':{'name':_0x47e14b,'userProfileId':_0x596334[_0x8882('0x60')]},'raw':!![]})['then'](function(_0x5e3e60){if(_0x5e3e60&&_0x5e3e60[_0x8882('0x61')]===0x0){return db[_0x8882('0x37')]['create']({'name':_0x3ce332['name'],'resourceId':_0x3ce332['id'],'type':_0x5e3e60[_0x8882('0x50')],'sectionId':_0x5e3e60['id']},{})[_0x8882('0x23')](function(){return _0x4a03de;});}else{return _0x4a03de;}})[_0x8882('0x56')](function(_0x4c009a){logger[_0x8882('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c009a);throw _0x4c009a;});}return _0x4a03de;})[_0x8882('0x23')](respondWithResult(_0x5072de,0xc9))['catch'](handleError(_0x5072de,null));};exports['update']=function(_0x220584,_0xd656d5){if(_0x220584['body']['id']){delete _0x220584['body']['id'];}return db[_0x8882('0x3c')][_0x8882('0x5f')]({'where':{'id':_0x220584['params']['id']},'include':[{'model':db[_0x8882('0x58')],'as':_0x8882('0x3b')}]})[_0x8882('0x23')](handleEntityNotFound(_0xd656d5,null))[_0x8882('0x23')](saveUpdates(_0x220584[_0x8882('0x5a')],null))['then'](respondWithResult(_0xd656d5,null))[_0x8882('0x56')](handleError(_0xd656d5,null));};exports[_0x8882('0x35')]=function(_0x4865ab,_0xa79d6f){return db[_0x8882('0x3c')][_0x8882('0x5f')]({'where':{'id':_0x4865ab['params']['id']}})[_0x8882('0x23')](handleEntityNotFound(_0xa79d6f,null))[_0x8882('0x23')](removeEntity(_0xa79d6f,null))[_0x8882('0x56')](handleError(_0xa79d6f,null));};exports[_0x8882('0x62')]=function(_0x53a469,_0x3ef24b){return db[_0x8882('0x3c')][_0x8882('0x62')]()[_0x8882('0x23')](respondWithResult(_0x3ef24b,null))['catch'](handleError(_0x3ef24b,null));};exports[_0x8882('0x63')]=function(_0x3feb60,_0x288559,_0x12fdd3){if(_0x3feb60[_0x8882('0x5a')]['id']){delete _0x3feb60[_0x8882('0x5a')]['id'];}return db[_0x8882('0x3c')][_0x8882('0x5f')]({'where':{'id':_0x3feb60[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x288559,null))[_0x8882('0x23')](function(_0x222d0a){if(_0x222d0a){_0x3feb60['body'][_0x8882('0x65')]=_0x222d0a['id'];return db[_0x8882('0x66')][_0x8882('0x59')](_0x3feb60[_0x8882('0x5a')]);}})[_0x8882('0x23')](respondWithResult(_0x288559,null))['catch'](handleError(_0x288559,null));};exports[_0x8882('0x67')]=function(_0xf0d803,_0x10413a,_0xa68ca2){var _0x5462e2={'raw':![],'where':{}};var _0x5490c6={};var _0x2c518c={'count':0x0,'rows':[]};return db[_0x8882('0x3c')][_0x8882('0x68')]({'where':{'id':_0xf0d803[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x10413a,null))[_0x8882('0x23')](function(_0x2eeca5){if(_0x2eeca5){_0x5490c6[_0x8882('0x40')]=_[_0x8882('0x43')](db[_0x8882('0x66')][_0x8882('0x3d')]);_0x5490c6[_0x8882('0x42')]=_[_0x8882('0x43')](_0xf0d803[_0x8882('0x42')]);_0x5490c6[_0x8882('0x44')]=_['intersection'](_0x5490c6[_0x8882('0x40')],_0x5490c6[_0x8882('0x42')]);_0x5462e2['attributes']=_[_0x8882('0x45')](_0x5490c6[_0x8882('0x40')],qs[_0x8882('0x47')](_0xf0d803['query'][_0x8882('0x47')]));_0x5462e2['attributes']=_0x5462e2[_0x8882('0x46')]['length']?_0x5462e2[_0x8882('0x46')]:_0x5490c6['model'];if(!_0xf0d803['query'][_0x8882('0x49')]('nolimit')){_0x5462e2['limit']=qs[_0x8882('0x30')](_0xf0d803[_0x8882('0x42')][_0x8882('0x30')]);_0x5462e2[_0x8882('0x2e')]=qs[_0x8882('0x2e')](_0xf0d803[_0x8882('0x42')][_0x8882('0x2e')]);}_0x5462e2['order']=qs['sort'](_0xf0d803[_0x8882('0x42')][_0x8882('0x4b')]);_0x5462e2[_0x8882('0x4c')]=qs['filters'](_['pick'](_0xf0d803[_0x8882('0x42')],_0x5490c6['filters']));_0x5462e2[_0x8882('0x4c')][_0x8882('0x65')]=_0x2eeca5['id'];if(_0xf0d803[_0x8882('0x42')][_0x8882('0x4e')]){_0x5462e2[_0x8882('0x4c')]=_[_0x8882('0x51')](_0x5462e2['where'],{'$or':_[_0x8882('0x41')](_0x5462e2['attributes'],function(_0x22aa23){var _0x32b527={};_0x32b527[_0x22aa23]={'$like':'%'+_0xf0d803[_0x8882('0x42')]['filter']+'%'};return _0x32b527;})});}_0x5462e2=_['merge']({},_0x5462e2,_0xf0d803[_0x8882('0x52')]);return db[_0x8882('0x66')]['count']({'where':_0x5462e2[_0x8882('0x4c')]})[_0x8882('0x23')](function(_0x54dbb6){_0x2c518c['count']=_0x54dbb6;if(_0xf0d803['query'][_0x8882('0x53')]){_0x5462e2['include']=[{'all':!![]}];}return db[_0x8882('0x66')][_0x8882('0x69')](_0x5462e2);})[_0x8882('0x23')](function(_0x2f4f25){_0x2c518c[_0x8882('0x55')]=_0x2f4f25;return _0x2c518c;});}})['then'](respondWithFilteredResult(_0x10413a,_0x5462e2))[_0x8882('0x56')](handleError(_0x10413a,null));};exports[_0x8882('0x6a')]=function(_0x2def54,_0x3a3a11,_0x42acd0){return db['FaxAccount'][_0x8882('0x5f')]({'where':{'id':_0x2def54[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x3a3a11,null))[_0x8882('0x23')](function(_0x5a4d97){if(_0x5a4d97){return _0x5a4d97[_0x8882('0x6a')](_0x2def54[_0x8882('0x42')][_0x8882('0x6b')]);}})[_0x8882('0x23')](respondWithStatusCode(_0x3a3a11,null))[_0x8882('0x56')](handleError(_0x3a3a11,null));};exports[_0x8882('0x6c')]=function(_0x151eeb,_0x1446b7,_0x2463b3){if(_0x151eeb[_0x8882('0x5a')]['id']){delete _0x151eeb[_0x8882('0x5a')]['id'];}return db[_0x8882('0x3c')][_0x8882('0x5f')]({'where':{'id':_0x151eeb[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x1446b7,null))[_0x8882('0x23')](function(_0x54dc28){if(_0x54dc28){_0x151eeb[_0x8882('0x5a')][_0x8882('0x65')]=_0x54dc28['id'];return db[_0x8882('0x6d')][_0x8882('0x59')](_0x151eeb[_0x8882('0x5a')]);}})[_0x8882('0x23')](respondWithResult(_0x1446b7,null))['catch'](handleError(_0x1446b7,null));};exports[_0x8882('0x6e')]=function(_0x237dff,_0xe13637,_0x4ce345){var _0x46be4f={'raw':![],'where':{}};var _0x4bcc18={};var _0x91ddd6={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x237dff[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0xe13637,null))[_0x8882('0x23')](function(_0x3147e0){if(_0x3147e0){_0x4bcc18[_0x8882('0x40')]=_['keys'](db['CannedAnswer'][_0x8882('0x3d')]);_0x4bcc18['query']=_['keys'](_0x237dff[_0x8882('0x42')]);_0x4bcc18['filters']=_[_0x8882('0x45')](_0x4bcc18[_0x8882('0x40')],_0x4bcc18['query']);_0x46be4f[_0x8882('0x46')]=_[_0x8882('0x45')](_0x4bcc18[_0x8882('0x40')],qs[_0x8882('0x47')](_0x237dff[_0x8882('0x42')][_0x8882('0x47')]));_0x46be4f[_0x8882('0x46')]=_0x46be4f['attributes'][_0x8882('0x48')]?_0x46be4f[_0x8882('0x46')]:_0x4bcc18[_0x8882('0x40')];if(!_0x237dff[_0x8882('0x42')][_0x8882('0x49')]('nolimit')){_0x46be4f[_0x8882('0x30')]=qs[_0x8882('0x30')](_0x237dff[_0x8882('0x42')][_0x8882('0x30')]);_0x46be4f[_0x8882('0x2e')]=qs['offset'](_0x237dff[_0x8882('0x42')]['offset']);}_0x46be4f[_0x8882('0x4a')]=qs[_0x8882('0x4b')](_0x237dff['query']['sort']);_0x46be4f[_0x8882('0x4c')]=qs[_0x8882('0x44')](_[_0x8882('0x4d')](_0x237dff[_0x8882('0x42')],_0x4bcc18[_0x8882('0x44')]));_0x46be4f['where'][_0x8882('0x65')]=_0x3147e0['id'];if(_0x237dff[_0x8882('0x42')][_0x8882('0x4e')]){_0x46be4f[_0x8882('0x4c')]=_[_0x8882('0x51')](_0x46be4f['where'],{'$or':_['map'](_0x46be4f[_0x8882('0x46')],function(_0x42e612){var _0x103b92={};_0x103b92[_0x42e612]={'$like':'%'+_0x237dff[_0x8882('0x42')][_0x8882('0x4e')]+'%'};return _0x103b92;})});}_0x46be4f=_[_0x8882('0x51')]({},_0x46be4f,_0x237dff[_0x8882('0x52')]);return db[_0x8882('0x6d')][_0x8882('0x31')]({'where':_0x46be4f[_0x8882('0x4c')]})[_0x8882('0x23')](function(_0x1ff369){_0x91ddd6[_0x8882('0x31')]=_0x1ff369;if(_0x237dff[_0x8882('0x42')][_0x8882('0x53')]){_0x46be4f[_0x8882('0x54')]=[{'all':!![]}];}return db[_0x8882('0x6d')]['findAll'](_0x46be4f);})[_0x8882('0x23')](function(_0x5f2f05){_0x91ddd6[_0x8882('0x55')]=_0x5f2f05;return _0x91ddd6;});}})[_0x8882('0x23')](respondWithFilteredResult(_0xe13637,_0x46be4f))[_0x8882('0x56')](handleError(_0xe13637,null));};exports['removeAnswers']=function(_0x37d990,_0x252c41,_0x2509ed){return db[_0x8882('0x3c')][_0x8882('0x5f')]({'where':{'id':_0x37d990['params']['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x252c41,null))[_0x8882('0x23')](function(_0x446f73){if(_0x446f73){return _0x446f73['removeAnswers'](_0x37d990[_0x8882('0x42')][_0x8882('0x6b')]);}})['then'](respondWithStatusCode(_0x252c41,null))['catch'](handleError(_0x252c41,null));};exports[_0x8882('0x6f')]=function(_0x2ca68e,_0x423149,_0x494699){return db['FaxInteraction'][_0x8882('0x5f')]({'where':{'id':_0x2ca68e[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x423149,null))[_0x8882('0x23')](function(_0x14e6ac){if(_0x14e6ac){return _0x14e6ac[_0x8882('0x6f')](_0x2ca68e[_0x8882('0x5a')][_0x8882('0x6b')],_[_0x8882('0x70')](_0x2ca68e[_0x8882('0x5a')],[_0x8882('0x6b'),'id'])||{});}})[_0x8882('0x23')](respondWithResult(_0x423149,null))['catch'](handleError(_0x423149,null));};exports[_0x8882('0x71')]=function(_0x2c1583,_0x5ca2e6,_0xbdb6f2){var _0x8a2980={'raw':![],'where':{}};var _0x791f0a={};var _0x360a82={'count':0x0,'rows':[]};return db[_0x8882('0x3c')]['findOne']({'where':{'id':_0x2c1583[_0x8882('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ca2e6,null))['then'](function(_0x462b97){if(_0x462b97){_0x791f0a[_0x8882('0x40')]=_['keys'](db[_0x8882('0x72')]['rawAttributes']);_0x791f0a[_0x8882('0x42')]=_[_0x8882('0x43')](_0x2c1583[_0x8882('0x42')]);_0x791f0a[_0x8882('0x44')]=_[_0x8882('0x45')](_0x791f0a[_0x8882('0x40')],_0x791f0a['query']);_0x8a2980[_0x8882('0x46')]=_[_0x8882('0x45')](_0x791f0a['model'],qs[_0x8882('0x47')](_0x2c1583[_0x8882('0x42')][_0x8882('0x47')]));_0x8a2980[_0x8882('0x46')]=_0x8a2980[_0x8882('0x46')][_0x8882('0x48')]?_0x8a2980[_0x8882('0x46')]:_0x791f0a['model'];if(!_0x2c1583[_0x8882('0x42')][_0x8882('0x49')]('nolimit')){_0x8a2980[_0x8882('0x30')]=qs[_0x8882('0x30')](_0x2c1583[_0x8882('0x42')][_0x8882('0x30')]);_0x8a2980[_0x8882('0x2e')]=qs[_0x8882('0x2e')](_0x2c1583[_0x8882('0x42')]['offset']);}_0x8a2980[_0x8882('0x4a')]=qs[_0x8882('0x4b')](_0x2c1583[_0x8882('0x42')][_0x8882('0x4b')]);_0x8a2980['where']=qs[_0x8882('0x44')](_[_0x8882('0x4d')](_0x2c1583[_0x8882('0x42')],_0x791f0a['filters']));_0x8a2980[_0x8882('0x4c')][_0x8882('0x65')]=_0x462b97['id'];if(_0x2c1583[_0x8882('0x42')]['filter']){_0x8a2980[_0x8882('0x4c')]=_[_0x8882('0x51')](_0x8a2980[_0x8882('0x4c')],{'$or':_['map'](_0x8a2980[_0x8882('0x46')],function(_0x3f9d2d){var _0x5639bf={};_0x5639bf[_0x3f9d2d]={'$like':'%'+_0x2c1583['query'][_0x8882('0x4e')]+'%'};return _0x5639bf;})});}_0x8a2980=_[_0x8882('0x51')]({},_0x8a2980,_0x2c1583[_0x8882('0x52')]);return db[_0x8882('0x72')][_0x8882('0x31')]({'where':_0x8a2980[_0x8882('0x4c')]})[_0x8882('0x23')](function(_0x1a4767){_0x360a82[_0x8882('0x31')]=_0x1a4767;if(_0x2c1583[_0x8882('0x42')][_0x8882('0x53')]){_0x8a2980[_0x8882('0x54')]=[{'model':db[_0x8882('0x73')],'as':_0x8882('0x74'),'required':![]},{'model':db[_0x8882('0x75')],'as':_0x8882('0x76'),'attributes':[_0x8882('0x50'),_0x8882('0x77'),'internal'],'required':![]},{'model':db[_0x8882('0x78')],'as':_0x8882('0x79'),'attributes':['id','name',_0x8882('0x7a')],'where':_0x2c1583[_0x8882('0x42')][_0x8882('0x7b')]?{'id':_0x2c1583[_0x8882('0x42')][_0x8882('0x7b')]}:undefined,'required':_0x2c1583['query'][_0x8882('0x7b')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x8a2980);})[_0x8882('0x23')](function(_0x2d5798){_0x360a82[_0x8882('0x55')]=_0x2d5798;return _0x360a82;});}})['then'](respondWithFilteredResult(_0x5ca2e6,_0x8a2980))[_0x8882('0x56')](handleError(_0x5ca2e6,null));};exports[_0x8882('0x7c')]=function(_0x286cfa,_0x5ae8e0){var _0x23981d=_0x286cfa[_0x8882('0x64')]['id'];var _0x92f3c3=_0x286cfa['body'];var _0x2820cc=0xc8;var _0x1f3778=null;return db[_0x8882('0x7d')]['transaction']({'isolationLevel':db[_0x8882('0x7d')][_0x8882('0x7e')][_0x8882('0x7f')]['READ_COMMITTED']},function(_0x2cc9fd){return db[_0x8882('0x3c')][_0x8882('0x68')]({'where':{'id':_0x23981d},'transaction':_0x2cc9fd})[_0x8882('0x23')](function(_0x2a6ece){if(_0x2a6ece){return db[_0x8882('0x80')][_0x8882('0x35')]({'where':{'FaxAccountId':_0x23981d},'transaction':_0x2cc9fd})[_0x8882('0x23')](function(){var _0x3acac2=_[_0x8882('0x41')](_0x92f3c3,function(_0xe25085){_0xe25085[_0x8882('0x65')]=_0x23981d;return _0xe25085;});return db['FaxApplication'][_0x8882('0x81')](_0x3acac2,{'transaction':_0x2cc9fd});});}else{_0x2820cc=0x194;_0x1f3778=[];}});})['then'](function(){if(_0x2820cc!==0x194){return db[_0x8882('0x80')][_0x8882('0x82')]({'where':{'FaxAccountId':_0x23981d},'order':_0x8882('0x83')})[_0x8882('0x23')](function(_0x50af7c){_0x1f3778=_0x50af7c;});}})[_0x8882('0x56')](function(_0x5edb11){_0x2820cc=0x1f4;logger[_0x8882('0x27')](_0x5edb11['stack']);if(_0x5edb11['name']){delete _0x5edb11[_0x8882('0x50')];}_0x1f3778=_0x5edb11;})[_0x8882('0x84')](function(){if(_0x1f3778===null){_0x5ae8e0['sendStatus'](_0x2820cc);}else{if(_0x2820cc===0x1f4){_0x5ae8e0['status'](_0x2820cc)['send'](_0x1f3778);}else{_0x5ae8e0[_0x8882('0x2b')](_0x2820cc)[_0x8882('0x2d')](_0x1f3778);}}});};exports[_0x8882('0x85')]=function(_0x2c9b53,_0x280ebf,_0x1e3990){var _0x425533={};var _0xffe8c1={};var _0x226d0d;var _0x139c53;return db['FaxAccount'][_0x8882('0x68')]({'where':{'id':_0x2c9b53[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x280ebf,null))[_0x8882('0x23')](function(_0x4e5b3b){if(_0x4e5b3b){_0x226d0d=_0x4e5b3b;_0xffe8c1['model']=_[_0x8882('0x43')](db['FaxApplication'][_0x8882('0x3d')]);_0xffe8c1[_0x8882('0x42')]=_[_0x8882('0x43')](_0x2c9b53[_0x8882('0x42')]);_0xffe8c1['filters']=_['intersection'](_0xffe8c1['model'],_0xffe8c1[_0x8882('0x42')]);_0x425533[_0x8882('0x46')]=_[_0x8882('0x45')](_0xffe8c1[_0x8882('0x40')],qs['fields'](_0x2c9b53[_0x8882('0x42')][_0x8882('0x47')]));_0x425533[_0x8882('0x46')]=_0x425533[_0x8882('0x46')]['length']?_0x425533[_0x8882('0x46')]:_0xffe8c1[_0x8882('0x40')];_0x425533[_0x8882('0x4a')]=qs[_0x8882('0x4b')](_0x2c9b53['query'][_0x8882('0x4b')]);_0x425533[_0x8882('0x4c')]=qs[_0x8882('0x44')](_[_0x8882('0x4d')](_0x2c9b53[_0x8882('0x42')],_0xffe8c1[_0x8882('0x44')]));if(_0x2c9b53[_0x8882('0x42')][_0x8882('0x4e')]){_0x425533[_0x8882('0x4c')]=_['merge'](_0x425533['where'],{'$or':_[_0x8882('0x41')](_0x425533[_0x8882('0x46')],function(_0x9324d8){var _0xf0c5ee={};_0xf0c5ee[_0x9324d8]={'$like':'%'+_0x2c9b53[_0x8882('0x42')][_0x8882('0x4e')]+'%'};return _0xf0c5ee;})});}_0x425533=_[_0x8882('0x51')]({},_0x425533,_0x2c9b53[_0x8882('0x52')]);return _0x226d0d[_0x8882('0x85')](_0x425533);}})['then'](function(_0xae3296){if(_0xae3296){_0x139c53=_0xae3296[_0x8882('0x48')];if(!_0x2c9b53['query'][_0x8882('0x49')]('nolimit')){_0x425533[_0x8882('0x30')]=qs[_0x8882('0x30')](_0x2c9b53['query'][_0x8882('0x30')]);_0x425533[_0x8882('0x2e')]=qs[_0x8882('0x2e')](_0x2c9b53[_0x8882('0x42')][_0x8882('0x2e')]);}return _0x226d0d[_0x8882('0x85')](_0x425533);}})[_0x8882('0x23')](function(_0x37b7ea){if(_0x37b7ea){return _0x37b7ea?{'count':_0x139c53,'rows':_0x37b7ea}:null;}})[_0x8882('0x23')](respondWithResult(_0x280ebf,null))['catch'](handleError(_0x280ebf,null));};function Extension(_0x371588,_0x57b199,_0x4cd297,_0x498d93){this[_0x8882('0x86')]=_0x8882('0x87');this[_0x8882('0x88')]=_0x371588[_0x8882('0x89')];this['app']=_0x498d93;this[_0x8882('0x4f')]=_0x8882('0x8a');this[_0x8882('0x8b')]=_0x8882('0x8c');this['FaxAccountId']=_0x371588['id'];this[_0x8882('0x83')]=_0x57b199;this[_0x8882('0x8d')]=_0x4cd297;}function createExtensionsReciveFax(_0x4b7bd7){var _0x5d6e5e=0x1;var _0x152f3b=[];_0x152f3b[_0x8882('0x8e')](new Extension(_0x4b7bd7,_0x5d6e5e,'',_0x8882('0x8f')));_0x5d6e5e+=0x1;_0x152f3b[_0x8882('0x8e')](new Extension(_0x4b7bd7,_0x5d6e5e,'CDR(type)=inbound-fax',_0x8882('0x90')));_0x5d6e5e+=0x1;for(var _0x27f578 in _0x4b7bd7){if(_0x4b7bd7[_0x8882('0x49')](_0x27f578)&&(_0x27f578===_0x8882('0x91')||_0x27f578===_0x8882('0x89')||_0x27f578===_0x8882('0x92')||_0x27f578===_0x8882('0x93')||_0x27f578===_0x8882('0x94')||_0x27f578===_0x8882('0x95')||_0x27f578===_0x8882('0x96')||_0x27f578==='modem'||_0x27f578===_0x8882('0x97'))){_0x152f3b[_0x8882('0x8e')](new Extension(_0x4b7bd7,_0x5d6e5e,'FAXOPT('+_0x27f578+')='+_0x4b7bd7[_0x27f578],'Set'));_0x5d6e5e+=0x1;}}_0x152f3b['push'](new Extension(_0x4b7bd7,_0x5d6e5e,'6',_0x8882('0x98')));_0x5d6e5e+=0x1;_0x152f3b['push'](new Extension(_0x4b7bd7,_0x5d6e5e,_0x8882('0x99'),_0x8882('0x9a')));_0x5d6e5e=0x0;return _0x152f3b;}exports['addAccountApplications']=function(_0x4253f3,_0x4c3aff,_0x4f0c1d){var _0x2e16f4;return db['sequelize']['transaction'](function(_0x5f2a34){return db['FaxAccount'][_0x8882('0x59')](_0x4253f3[_0x8882('0x5a')],{'transaction':_0x5f2a34})[_0x8882('0x23')](function(_0x2be06b){_0x2e16f4=_0x2be06b['get']({'plain':!![]});return db[_0x8882('0x9b')][_0x8882('0x81')](createExtensionsReciveFax(_0x2e16f4),{'transaction':_0x5f2a34});});})[_0x8882('0x23')](function(){return _0x2e16f4;})[_0x8882('0x23')](respondWithResult(_0x4c3aff,null))['catch'](handleError(_0x4c3aff,null));};exports['updateAccountApplications']=function(_0x58f376,_0x1dfe5d,_0x3d02e6){var _0x568cae;return db[_0x8882('0x7d')][_0x8882('0x9c')](function(_0x37bac6){return db[_0x8882('0x3c')][_0x8882('0x34')](_0x58f376[_0x8882('0x5a')],{'where':{'id':_0x58f376[_0x8882('0x5a')]['id']},'transaction':_0x37bac6})[_0x8882('0x23')](function(_0x51b448){return db[_0x8882('0x9b')][_0x8882('0x35')]({'where':{'FaxAccountId':_0x58f376[_0x8882('0x5a')]['id']},'transaction':_0x37bac6})['then'](function(_0x32d050){return db[_0x8882('0x9b')][_0x8882('0x81')](createExtensionsReciveFax(_['omit'](_0x58f376[_0x8882('0x5a')],[_0x8882('0x9d'),_0x8882('0x3f'),_0x8882('0x9e'),_0x8882('0x9f'),_0x8882('0xa0'),_0x8882('0xa1')])),{'transaction':_0x37bac6});});});})[_0x8882('0x23')](function(){return db[_0x8882('0x3c')][_0x8882('0xa2')](_0x58f376['body']['id']);})[_0x8882('0x23')](respondWithResult(_0x1dfe5d,null))['catch'](handleError(_0x1dfe5d,null));};exports[_0x8882('0xa3')]=function(_0x57bbd7,_0x18d54e,_0x508a01){var _0x2b7915={'raw':!![],'where':{}};var _0x3e9403={};var _0x4e6003={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8882('0x68')]({'where':{'id':_0x57bbd7[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x18d54e,null))[_0x8882('0x23')](function(_0x3b197e){if(_0x3b197e){_0x3e9403[_0x8882('0x40')]=_[_0x8882('0x43')](db[_0x8882('0xa4')][_0x8882('0x3d')]);_0x3e9403['query']=_['keys'](_0x57bbd7[_0x8882('0x42')]);_0x3e9403[_0x8882('0x44')]=_[_0x8882('0x45')](_0x3e9403[_0x8882('0x40')],_0x3e9403[_0x8882('0x42')]);_0x2b7915[_0x8882('0x46')]=_[_0x8882('0x45')](_0x3e9403['model'],qs[_0x8882('0x47')](_0x57bbd7[_0x8882('0x42')][_0x8882('0x47')]));_0x2b7915[_0x8882('0x46')]=_0x2b7915[_0x8882('0x46')][_0x8882('0x48')]?_0x2b7915[_0x8882('0x46')]:_0x3e9403[_0x8882('0x40')];if(!_0x57bbd7[_0x8882('0x42')][_0x8882('0x49')]('nolimit')){_0x2b7915['limit']=qs[_0x8882('0x30')](_0x57bbd7[_0x8882('0x42')][_0x8882('0x30')]);_0x2b7915[_0x8882('0x2e')]=qs[_0x8882('0x2e')](_0x57bbd7['query'][_0x8882('0x2e')]);}_0x2b7915['order']=qs['sort'](_0x57bbd7[_0x8882('0x42')][_0x8882('0x4b')]);_0x2b7915['where']=qs[_0x8882('0x44')](_[_0x8882('0x4d')](_0x57bbd7[_0x8882('0x42')],_0x3e9403[_0x8882('0x44')]));_0x2b7915[_0x8882('0x4c')]['FaxAccountId']=_0x3b197e['id'];if(_0x57bbd7[_0x8882('0x42')][_0x8882('0x4e')]){_0x2b7915[_0x8882('0x4c')]=_[_0x8882('0x51')](_0x2b7915[_0x8882('0x4c')],{'$or':_[_0x8882('0x41')](_0x2b7915[_0x8882('0x46')],function(_0x1c5860){var _0x4be7c5={};_0x4be7c5[_0x1c5860]={'$like':'%'+_0x57bbd7[_0x8882('0x42')]['filter']+'%'};return _0x4be7c5;})});}if(_0x57bbd7[_0x8882('0x42')][_0x8882('0xa5')]){var _0x5c6c4f=_0x57bbd7[_0x8882('0x42')]['$gte'][_0x8882('0xa6')](',');var _0x443c23={};_0x443c23[_0x5c6c4f[0x0]]={'$gte':moment(_0x5c6c4f[0x1])[_0x8882('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2b7915['where']=_[_0x8882('0x51')](_0x2b7915[_0x8882('0x4c')],_0x443c23);}_0x2b7915=_['merge']({},_0x2b7915,_0x57bbd7['options']);return db[_0x8882('0xa4')]['count']({'where':_0x2b7915[_0x8882('0x4c')]})[_0x8882('0x23')](function(_0x1c75dd){_0x4e6003[_0x8882('0x31')]=_0x1c75dd;if(_0x57bbd7[_0x8882('0x42')][_0x8882('0x53')]){_0x2b7915[_0x8882('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0x8882('0x69')](_0x2b7915);})['then'](function(_0x22e6f6){_0x4e6003[_0x8882('0x55')]=_0x22e6f6;return _0x4e6003;});}})[_0x8882('0x23')](respondWithFilteredResult(_0x18d54e,_0x2b7915))['catch'](handleError(_0x18d54e,null));};exports['send']=function(_0x5b00c3,_0x2175e1,_0x33bbcc){var _0x502b7,_0x4b592e={},_0x42c00b;if(_0x5b00c3[_0x8882('0x5a')]['to']){_0x42c00b=_0x5b00c3[_0x8882('0x5a')]['to'][0x0];}return db[_0x8882('0x3c')][_0x8882('0x5f')]({'where':{'id':_0x5b00c3['params']['id']},'include':[{'model':db['CmList'],'as':_0x8882('0xa8'),'include':[{'model':db[_0x8882('0x73')],'as':'Contacts','where':{'fax':_0x42c00b},'limit':0x1,'order':[[_0x8882('0x9f'),_0x8882('0xa9')]]}]}]})[_0x8882('0x23')](handleEntityNotFound(_0x2175e1,null))[_0x8882('0x23')](function(_0x612cd9){_0x502b7=_0x612cd9;if(_0x5b00c3['body'][_0x8882('0xaa')]&&_0x5b00c3[_0x8882('0x5a')]['attachments'][_0x8882('0x48')]){for(var _0x28ecad=0x0;_0x28ecad<_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][_0x8882('0x48')];_0x28ecad+=0x1){_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][_0x28ecad]={'filename':_0x5b00c3['body'][_0x8882('0xaa')][_0x28ecad]['name'],'id':_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][_0x28ecad]['id'],'path':path['join'](config[_0x8882('0xab')],_0x8882('0xac'),_0x5b00c3['body'][_0x8882('0xaa')][_0x28ecad]['basename'])};}}return respondWithRpcPromise(_0x8882('0xad'),_0x8882('0xad'),{'FaxAccountId':_[_0x8882('0xae')](_0x5b00c3['params']['id'])?undefined:_0x5b00c3[_0x8882('0x64')]['id'],'path':_[_0x8882('0xae')](_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][0x0][_0x8882('0xaf')])?undefined:_0x5b00c3['body'][_0x8882('0xaa')][0x0][_0x8882('0xaf')],'fax':_[_0x8882('0xae')](_0x5b00c3[_0x8882('0x5a')]['to'][0x0])?undefined:_0x5b00c3[_0x8882('0x5a')]['to'][0x0]},client9002);})[_0x8882('0x23')](function(){if(_0x502b7){if(_[_0x8882('0xae')](_0x5b00c3[_0x8882('0x5a')]['from'])){_0x5b00c3[_0x8882('0x5a')][_0x8882('0xb0')]=util['format'](_0x8882('0xb1'),_0x502b7[_0x8882('0x50')],_0x502b7[_0x8882('0xb2')]);}if(_0x502b7[_0x8882('0xa8')]){if(_0x502b7[_0x8882('0xa8')][_0x8882('0xb3')]['length']){return _0x502b7[_0x8882('0xa8')][_0x8882('0xb3')][0x0];}else{return db['CmContact']['create'](_[_0x8882('0x1c')](_0x5b00c3[_0x8882('0x5a')],{'firstName':_0x5b00c3['body']['to'][0x0],'phone':_0x5b00c3['body']['to'][0x0],'fax':_0x5b00c3[_0x8882('0x5a')]['to'][0x0],'ListId':_0x502b7[_0x8882('0xa1')]}));}}else{throw new Error(_0x8882('0xb4'));}}else{throw new Error(_0x8882('0xb5'));}})[_0x8882('0x23')](function(_0x137d38){if(_0x137d38){return db[_0x8882('0x72')][_0x8882('0x5f')]({'where':{'ContactId':_0x137d38['id'],'closed':![],'FaxAccountId':_0x502b7['id']}})[_0x8882('0x23')](function(_0x1d8025){if(_0x1d8025){return[_0x1d8025,![]];}return db[_0x8882('0x72')][_0x8882('0x59')]({'UserId':_0x5b00c3[_0x8882('0x5b')]['id'],'ContactId':_0x137d38['id'],'FaxAccountId':_0x502b7['id'],'fax':_0x5b00c3[_0x8882('0x5a')]['to'][0x0],'firstMsgDirection':_0x8882('0xb6'),'Messages':[_['merge'](_0x5b00c3[_0x8882('0x5a')],{'read':![],'body':_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][0x0][_0x8882('0xb7')],'FaxAccountId':_0x502b7['id'],'UserId':_0x5b00c3[_0x8882('0x5b')]['id'],'ContactId':_0x137d38['id'],'AttachmentId':_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x8882('0xa4')],'as':'Messages'}]})['then'](function(_0x11faac){return[_0x11faac,!![]];});});}else{throw new Error(_0x8882('0xb8'));}})[_0x8882('0xb9')](function(_0x52bef1,_0x2943cd){if(_0x2943cd){return _0x52bef1;}return db[_0x8882('0xa4')][_0x8882('0x59')]({'direction':'out','read':![],'body':_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][0x0][_0x8882('0xb7')],'FaxAccountId':_0x502b7['id'],'FaxInteractionId':_0x52bef1['id'],'UserId':_0x5b00c3[_0x8882('0x5b')]['id'],'ContactId':_0x52bef1[_0x8882('0xba')],'AttachmentId':_0x5b00c3[_0x8882('0x5a')][_0x8882('0xaa')][0x0]['id']})[_0x8882('0x23')](function(_0x7b679c){_0x52bef1[_0x8882('0xbb')][_0x8882('0xbc')]=[];_0x52bef1['dataValues'][_0x8882('0xbc')][_0x8882('0x8e')](_0x7b679c[_0x8882('0xbb')]);return _0x52bef1;});})[_0x8882('0x23')](function(_0x4a7dfe){respondWithRpcPromise(_0x8882('0xbd'),_0x8882('0xbd'),{'FaxAccountId':_[_0x8882('0xae')](_0x5b00c3[_0x8882('0x64')]['id'])?undefined:_0x5b00c3[_0x8882('0x64')]['id'],'path':_[_0x8882('0xae')](_0x5b00c3['body'][_0x8882('0xaa')][0x0]['path'])?undefined:_0x5b00c3['body'][_0x8882('0xaa')][0x0][_0x8882('0xaf')],'fax':_[_0x8882('0xae')](_0x5b00c3['body']['to'][0x0])?undefined:_0x5b00c3[_0x8882('0x5a')]['to'][0x0],'AttachmentId':_0x5b00c3['body']['attachments'][0x0]['id']},client9002)[_0x8882('0x23')](function(_0x5b5de3){logger[_0x8882('0x24')](_0x8882('0xbe'),_0x5b5de3);})[_0x8882('0x56')](function(_0x4444dc){logger[_0x8882('0x24')]('SendFaxRpc,\x20%s',_0x4444dc);});return _0x4a7dfe;})[_0x8882('0x23')](respondWithResult(_0x2175e1,null))['catch'](handleError(_0x2175e1,null));};exports['addAgents']=function(_0x1cadf6,_0x1c693f,_0x2c2e1f){return db[_0x8882('0x3c')]['find']({'where':{'id':_0x1cadf6[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x1c693f,null))[_0x8882('0x23')](function(_0x5eaade){if(_0x5eaade){return _0x5eaade['addAgents'](_0x1cadf6['body'][_0x8882('0x6b')],_[_0x8882('0x70')](_0x1cadf6[_0x8882('0x5a')],['ids','id'])||{})['spread'](function(_0x30cfc2){for(var _0x5db5f6=0x0;_0x5db5f6<_0x1cadf6[_0x8882('0x5a')][_0x8882('0x6b')][_0x8882('0x48')];_0x5db5f6+=0x1){socket[_0x8882('0xbf')](_0x8882('0xc0'),{'UserId':Number(_0x1cadf6[_0x8882('0x5a')]['ids'][_0x5db5f6]),'FaxAccountId':Number(_0x1cadf6[_0x8882('0x64')]['id'])});}return _0x30cfc2;});}})[_0x8882('0x23')](respondWithResult(_0x1c693f,null))[_0x8882('0x56')](handleError(_0x1c693f,null));};exports['removeAgents']=function(_0x1590b8,_0x2442ce,_0x314a33){return db[_0x8882('0x3c')]['find']({'where':{'id':_0x1590b8[_0x8882('0x64')]['id']}})[_0x8882('0x23')](handleEntityNotFound(_0x2442ce,null))[_0x8882('0x23')](function(_0x5fcbc0){if(_0x5fcbc0){return _0x5fcbc0[_0x8882('0xc1')](_0x1590b8['query'][_0x8882('0x6b')])[_0x8882('0x23')](function(){if(_['isArray'](_0x1590b8[_0x8882('0x42')]['ids'])){for(var _0x40e29e=0x0;_0x40e29e<_0x1590b8[_0x8882('0x42')][_0x8882('0x6b')][_0x8882('0x48')];_0x40e29e+=0x1){socket[_0x8882('0xbf')](_0x8882('0xc2'),{'UserId':Number(_0x1590b8[_0x8882('0x42')]['ids'][_0x40e29e]),'FaxAccountId':Number(_0x1590b8[_0x8882('0x64')]['id'])});}}else{socket[_0x8882('0xbf')](_0x8882('0xc2'),{'UserId':Number(_0x1590b8['query'][_0x8882('0x6b')]),'FaxAccountId':Number(_0x1590b8[_0x8882('0x64')]['id'])});}});}})[_0x8882('0x23')](respondWithStatusCode(_0x2442ce,null))[_0x8882('0x56')](handleError(_0x2442ce,null));};exports[_0x8882('0xc3')]=function(_0x11a717,_0x3e2152,_0x399942){var _0x10330f={};var _0x21d0da={};var _0x3f83ff;var _0x35a10e;return db[_0x8882('0x3c')]['findOne']({'where':{'id':_0x11a717[_0x8882('0x64')]['id']}})['then'](handleEntityNotFound(_0x3e2152,null))[_0x8882('0x23')](function(_0x25218a){if(_0x25218a){_0x3f83ff=_0x25218a;_0x21d0da[_0x8882('0x40')]=_[_0x8882('0x43')](db[_0x8882('0x75')][_0x8882('0x3d')]);_0x21d0da['query']=_[_0x8882('0x43')](_0x11a717[_0x8882('0x42')]);_0x21d0da[_0x8882('0x44')]=_[_0x8882('0x45')](_0x21d0da['model'],_0x21d0da[_0x8882('0x42')]);_0x10330f['attributes']=_[_0x8882('0x45')](_0x21d0da[_0x8882('0x40')],qs[_0x8882('0x47')](_0x11a717[_0x8882('0x42')][_0x8882('0x47')]));_0x10330f[_0x8882('0x46')]=_0x10330f[_0x8882('0x46')][_0x8882('0x48')]?_0x10330f[_0x8882('0x46')]:_0x21d0da['model'];_0x10330f[_0x8882('0x4a')]=qs[_0x8882('0x4b')](_0x11a717[_0x8882('0x42')][_0x8882('0x4b')]);_0x10330f[_0x8882('0x4c')]=qs[_0x8882('0x44')](_[_0x8882('0x4d')](_0x11a717[_0x8882('0x42')],_0x21d0da[_0x8882('0x44')]));if(_0x11a717[_0x8882('0x42')][_0x8882('0x4e')]){_0x10330f[_0x8882('0x4c')]=_['merge'](_0x10330f[_0x8882('0x4c')],{'$or':_['map'](_0x10330f['attributes'],function(_0x360d5a){var _0x27b9cf={};_0x27b9cf[_0x360d5a]={'$like':'%'+_0x11a717['query']['filter']+'%'};return _0x27b9cf;})});}_0x10330f=_['merge']({},_0x10330f,_0x11a717[_0x8882('0x52')]);return _0x3f83ff[_0x8882('0xc3')](_0x10330f);}})[_0x8882('0x23')](function(_0x4d1749){if(_0x4d1749){_0x35a10e=_0x4d1749[_0x8882('0x48')];if(!_0x11a717[_0x8882('0x42')][_0x8882('0x49')](_0x8882('0xc4'))){_0x10330f[_0x8882('0x30')]=qs['limit'](_0x11a717[_0x8882('0x42')][_0x8882('0x30')]);_0x10330f['offset']=qs[_0x8882('0x2e')](_0x11a717[_0x8882('0x42')]['offset']);}return _0x3f83ff[_0x8882('0xc3')](_0x10330f);}})[_0x8882('0x23')](function(_0x221920){if(_0x221920){return _0x221920?{'count':_0x35a10e,'rows':_0x221920}:null;}})[_0x8882('0x23')](respondWithResult(_0x3e2152,null))['catch'](handleError(_0x3e2152,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 48c779c..2e192fa 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 _0xc487=['FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x23ec1f,_0x1872ed){var _0x3c74d9=function(_0x42e20b){while(--_0x42e20b){_0x23ec1f['push'](_0x23ec1f['shift']());}};_0x3c74d9(++_0x1872ed);}(_0xc487,0x6b));var _0x7c48=function(_0x75af53,_0x3727d2){_0x75af53=_0x75af53-0x0;var _0x5a0ffd=_0xc487[_0x75af53];return _0x5a0ffd;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x7c48('0x0'))['db'][_0x7c48('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7c48('0x2')](0x0);var events={'afterCreate':_0x7c48('0x3'),'afterUpdate':_0x7c48('0x4'),'afterDestroy':_0x7c48('0x5')};function emitEvent(_0x15c57b){return function(_0x36a18c,_0x1e3c91,_0x11b86f){FaxAccountEvents[_0x7c48('0x6')](_0x15c57b+':'+_0x36a18c['id'],_0x36a18c);FaxAccountEvents[_0x7c48('0x6')](_0x15c57b,_0x36a18c);_0x11b86f(null);};}for(var e in events){if(events[_0x7c48('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x7c48('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x43b1=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x43b1,0x94));var _0x143b=function(_0x1f6ead,_0x159004){_0x1f6ead=_0x1f6ead-0x0;var _0x1cfe6a=_0x43b1[_0x1f6ead];return _0x1cfe6a;};'use strict';var EventEmitter=require(_0x143b('0x0'));var FaxAccount=require(_0x143b('0x1'))['db'][_0x143b('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x143b('0x3'),'afterUpdate':_0x143b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x367f86){return function(_0x1fc5bf,_0xb5bcb7,_0x95ac16){FaxAccountEvents['emit'](_0x367f86+':'+_0x1fc5bf['id'],_0x1fc5bf);FaxAccountEvents[_0x143b('0x5')](_0x367f86,_0x1fc5bf);_0x95ac16(null);};}for(var e in events){if(events[_0x143b('0x6')](e)){var event=events[e];FaxAccount[_0x143b('0x7')](e,emitEvent(event));}}module[_0x143b('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 13a603a..6b8a7ce 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 _0x57fe=['exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x57fe,0x87));var _0xe57f=function(_0x1f9677,_0x4add85){_0x1f9677=_0x1f9677-0x0;var _0x4a10ac=_0x57fe[_0x1f9677];return _0x4a10ac;};'use strict';var _=require(_0xe57f('0x0'));var util=require(_0xe57f('0x1'));var logger=require(_0xe57f('0x2'))(_0xe57f('0x3'));var moment=require('moment');var BPromise=require(_0xe57f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe57f('0x5'));var rimraf=require(_0xe57f('0x6'));var config=require(_0xe57f('0x7'));var attributes=require(_0xe57f('0x8'));module[_0xe57f('0x9')]=function(_0x4e04c5,_0x36c6ab){return _0x4e04c5['define'](_0xe57f('0xa'),attributes,{'tableName':_0xe57f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3175=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x3175,0x114));var _0x5317=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x3175[_0x513047];return _0x15b779;};'use strict';var _=require(_0x5317('0x0'));var util=require(_0x5317('0x1'));var logger=require(_0x5317('0x2'))(_0x5317('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5317('0x4'));var fs=require('fs');var path=require(_0x5317('0x5'));var rimraf=require(_0x5317('0x6'));var config=require(_0x5317('0x7'));var attributes=require(_0x5317('0x8'));module[_0x5317('0x9')]=function(_0x52f760,_0x5dfd20){return _0x52f760['define'](_0x5317('0xa'),attributes,{'tableName':_0x5317('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 0f0b8f1..0a44a1c 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 _0xca6e=['request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','options','raw','where','include','map','model','attributes','stringify','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','list','applications','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','register','request','then','info'];(function(_0x15d07d,_0x194d35){var _0xe7f35b=function(_0x49f5d1){while(--_0x49f5d1){_0x15d07d['push'](_0x15d07d['shift']());}};_0xe7f35b(++_0x194d35);}(_0xca6e,0x100));var _0xeca6=function(_0x282274,_0x32da95){_0x282274=_0x282274-0x0;var _0x2f3923=_0xca6e[_0x282274];return _0x2f3923;};'use strict';var _=require(_0xeca6('0x0'));var util=require('util');var moment=require(_0xeca6('0x1'));var BPromise=require(_0xeca6('0x2'));var rs=require(_0xeca6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeca6('0x4'))['db'];var utils=require(_0xeca6('0x5'));var logger=require(_0xeca6('0x6'))(_0xeca6('0x7'));var config=require(_0xeca6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeca6('0x9')]['http']({'port':0x232c});config[_0xeca6('0xa')]=_[_0xeca6('0xb')](config[_0xeca6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xeca6('0xc'))(new Redis(config[_0xeca6('0xa')]));require('./faxAccount.socket')[_0xeca6('0xd')](socket);function respondWithRpcPromise(_0x393e80,_0x51c30e,_0x20853d){return new BPromise(function(_0x2df1b2,_0x2b56e1){return client[_0xeca6('0xe')](_0x393e80,_0x20853d)[_0xeca6('0xf')](function(_0x23789b){logger[_0xeca6('0x10')]('FaxAccount,\x20%s,\x20%s',_0x51c30e,_0xeca6('0x11'));logger[_0xeca6('0x12')](_0xeca6('0x13'),_0x51c30e,_0xeca6('0x11'),JSON['stringify'](_0x23789b));if(_0x23789b[_0xeca6('0x14')]){if(_0x23789b[_0xeca6('0x14')][_0xeca6('0x15')]===0x1f4){logger[_0xeca6('0x14')]('FaxAccount,\x20%s,\x20%s',_0x51c30e,_0x23789b[_0xeca6('0x14')][_0xeca6('0x16')]);return _0x2b56e1(_0x23789b[_0xeca6('0x14')][_0xeca6('0x16')]);}logger['error'](_0xeca6('0x17'),_0x51c30e,_0x23789b[_0xeca6('0x14')]['message']);return _0x2df1b2(_0x23789b[_0xeca6('0x14')][_0xeca6('0x16')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x51c30e,_0xeca6('0x11'));_0x2df1b2(_0x23789b[_0xeca6('0x18')][_0xeca6('0x16')]);}})[_0xeca6('0x19')](function(_0x6a8804){logger['error'](_0xeca6('0x17'),_0x51c30e,_0x6a8804);_0x2b56e1(_0x6a8804);});});}exports[_0xeca6('0x1a')]=function(_0xaaf322){var _0x37d489=this;return new Promise(function(_0xf6a493,_0x518947){return db[_0xeca6('0x1b')]['findAll']({'raw':_0xaaf322[_0xeca6('0x1c')]?_0xaaf322[_0xeca6('0x1c')][_0xeca6('0x1d')]===undefined?!![]:![]:!![],'where':_0xaaf322[_0xeca6('0x1c')]?_0xaaf322[_0xeca6('0x1c')][_0xeca6('0x1e')]||null:null,'attributes':_0xaaf322[_0xeca6('0x1c')]?_0xaaf322['options']['attributes']||null:null,'limit':_0xaaf322[_0xeca6('0x1c')]?_0xaaf322['options']['limit']||null:null,'include':_0xaaf322['options']?_0xaaf322[_0xeca6('0x1c')][_0xeca6('0x1f')]?_[_0xeca6('0x20')](_0xaaf322[_0xeca6('0x1c')][_0xeca6('0x1f')],function(_0x3de979){return{'model':db[_0x3de979[_0xeca6('0x21')]],'as':_0x3de979['as'],'attributes':_0x3de979[_0xeca6('0x22')],'include':_0x3de979[_0xeca6('0x1f')]?_[_0xeca6('0x20')](_0x3de979[_0xeca6('0x1f')],function(_0x37d748){return{'model':db[_0x37d748[_0xeca6('0x21')]],'as':_0x37d748['as'],'attributes':_0x37d748['attributes'],'include':_0x37d748[_0xeca6('0x1f')]?_[_0xeca6('0x20')](_0x37d748[_0xeca6('0x1f')],function(_0x5fd17c){return{'model':db[_0x5fd17c[_0xeca6('0x21')]],'as':_0x5fd17c['as'],'attributes':_0x5fd17c[_0xeca6('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4231a6){logger[_0xeca6('0x10')](_0xeca6('0x1a'),_0xaaf322);logger[_0xeca6('0x12')](_0xeca6('0x1a'),_0xaaf322,JSON[_0xeca6('0x23')](_0x4231a6));_0xf6a493(_0x4231a6);})[_0xeca6('0x19')](function(_0x18b0e5){logger[_0xeca6('0x14')](_0xeca6('0x1a'),_0x18b0e5[_0xeca6('0x16')],_0xaaf322);_0x518947(_0x37d489[_0xeca6('0x14')](0x1f4,_0x18b0e5[_0xeca6('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x219049,_0x2c8906,_0x5db82b){var _0x4ee0ab=this;return new Promise(function(_0x3f563d,_0x26562d){var _0x3a34c6={'body':_0x219049[_0xeca6('0x24')],'channel':_0xeca6('0x25')};var _0x19ea18=[];var _0x1b7e83=[];var _0x518505={};return db[_0xeca6('0x26')][_0xeca6('0x27')]()[_0xeca6('0xf')](function(_0x509182){if(!_0x509182){throw new db[(_0xeca6('0x28'))][(_0xeca6('0x29'))]('no\x20available\x20attributes');}_0x19ea18=_[_0xeca6('0x2a')](_[_0xeca6('0x2b')](_0x509182),[_0xeca6('0x2c'),'updatedAt']);_0x1b7e83=_[_0xeca6('0x2a')](_[_0xeca6('0x2b')](_0x509182),[_0xeca6('0x2c'),_0xeca6('0x2d'),_0xeca6('0x2e'),'ListId']);if(_0x219049[_0xeca6('0x24')]['id']){delete _0x219049['body']['id'];}if(_[_0xeca6('0x2f')](_0x219049[_0xeca6('0x24')]['from'])){throw new db['Sequelize']['ValidationError'](_0xeca6('0x30'));}if(_[_0xeca6('0x2f')](_0x219049[_0xeca6('0x24')][_0xeca6('0x24')])||_0x219049[_0xeca6('0x24')][_0xeca6('0x24')]===''){throw new db[(_0xeca6('0x28'))][(_0xeca6('0x29'))](_0xeca6('0x31'));}if(_[_0xeca6('0x2f')](_0x219049[_0xeca6('0x24')][_0xeca6('0x32')])){throw new db['Sequelize'][(_0xeca6('0x29'))](_0xeca6('0x33')+_0x1b7e83);}if(!_[_0xeca6('0x34')](_0x1b7e83,_0x219049[_0xeca6('0x24')]['mapKey'])){throw new db[(_0xeca6('0x28'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b7e83);}_0x518505[_0x219049[_0xeca6('0x24')][_0xeca6('0x32')]]=_0x219049[_0xeca6('0x24')][_0xeca6('0x35')];})[_0xeca6('0xf')](function(){return db[_0xeca6('0x1b')][_0xeca6('0x36')]({'where':{'id':_0x219049[_0xeca6('0x37')]['id']},'include':[{'model':db[_0xeca6('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0xeca6('0x39'),'where':_0x518505,'limit':0x1,'order':[['updatedAt',_0xeca6('0x3a')]]}]},{'model':db[_0xeca6('0x3b')],'as':_0xeca6('0x3c')}]});})[_0xeca6('0xf')](function(_0x56a2c3){if(_0x56a2c3&&_0x56a2c3[_0xeca6('0x3d')]){var _0xdfcb7d=_0x56a2c3[_0xeca6('0x3e')]({'plain':!![]});_0x3a34c6[_0xeca6('0x37')]=_0xdfcb7d;_0x3a34c6['applications']=_0xdfcb7d[_0xeca6('0x3c')];_0x3a34c6[_0xeca6('0x3f')]=_0xdfcb7d[_0xeca6('0x3d')];_0x3a34c6[_0xeca6('0x40')]=_[_0xeca6('0x41')](_0x3a34c6[_0xeca6('0x40')],[_0xeca6('0x42')],[_0xeca6('0x43')]);if(_0x3a34c6[_0xeca6('0x37')]['Applications']){delete _0x3a34c6['account'][_0xeca6('0x3c')];}if(_0x3a34c6[_0xeca6('0x37')][_0xeca6('0x3d')]&&_0x3a34c6[_0xeca6('0x37')][_0xeca6('0x3d')][_0xeca6('0x39')][_0xeca6('0x44')]){return _0x3a34c6[_0xeca6('0x37')][_0xeca6('0x3d')][_0xeca6('0x39')][0x0];}var _0xa10979=_[_0xeca6('0xb')](_0x219049[_0xeca6('0x24')],{'firstName':_0x219049[_0xeca6('0x24')][_0xeca6('0x35')],'ListId':_0xdfcb7d[_0xeca6('0x45')]});_0xa10979[_0x219049[_0xeca6('0x24')][_0xeca6('0x32')]]=_0x219049[_0xeca6('0x24')][_0xeca6('0x35')];return db[_0xeca6('0x26')][_0xeca6('0x46')](_0xa10979,{'fields':_0x19ea18,'raw':!![]});}})['then'](function(_0x38e529){_0x3a34c6[_0xeca6('0x47')]=_0x38e529;if(_0x38e529){var _0x91b3c8={'ContactId':_0x38e529['id'],'FaxAccountId':_0x219049[_0xeca6('0x37')]['id'],'fax':_0x38e529[_0xeca6('0x25')]};return db[_0xeca6('0x48')][_0xeca6('0x36')]({'where':{'ContactId':_0x38e529['id'],'closed':![],'FaxAccountId':_0x219049['account']['id']}})[_0xeca6('0xf')](function(_0x4e011c){if(_0x4e011c){return[_0x4e011c,![]];}return db[_0xeca6('0x48')][_0xeca6('0x46')](_0x91b3c8)['then'](function(_0x37525a){return[_0x37525a,!![]];});});}else{throw new Error(_0xeca6('0x49'));}})[_0xeca6('0x4a')](function(_0x2f7f1a,_0x3b8c2e){var _0x1f1c84=_0x2f7f1a['get']({'plain':!![]});if(_0x3b8c2e){if(_0x3a34c6[_0xeca6('0x37')][_0xeca6('0x4b')]){_0x3a34c6[_0xeca6('0x40')][_0xeca6('0x4c')]({'id':0x0,'priority':_0x3a34c6[_0xeca6('0x40')]['length']+0x1,'app':_0xeca6('0x4d'),'appdata':_0xeca6('0x4e'),'interval':_0xeca6('0x4f')});}_0x1f1c84[_0xeca6('0x50')]=!![];}else{_0x1f1c84[_0xeca6('0x50')]=![];}_0x3a34c6[_0xeca6('0x51')]=_0x1f1c84;return db[_0xeca6('0x52')][_0xeca6('0x46')]({'body':_0x219049['body'][_0xeca6('0x24')],'FaxAccountId':_0x219049[_0xeca6('0x37')]['id'],'FaxInteractionId':_0x2f7f1a['id'],'direction':'in','ContactId':_0x2f7f1a[_0xeca6('0x53')],'AttachmentId':_0x219049[_0xeca6('0x24')]['AttachmentId']});})[_0xeca6('0xf')](function(_0x1ba3c8){_0x3a34c6[_0xeca6('0x16')]=_0x1ba3c8;if(_0x3a34c6[_0xeca6('0x51')]['UserId']){return db[_0xeca6('0x54')][_0xeca6('0x36')]({'attributes':['id','name'],'where':{'id':_0x3a34c6[_0xeca6('0x51')]['UserId']}})['then'](function(_0x4075a0){if(_0x4075a0){_0x3a34c6[_0xeca6('0x40')][_0xeca6('0x55')]({'id':0x0,'priority':0x0,'app':_0xeca6('0x56'),'appdata':_0x4075a0[_0xeca6('0x57')]+','+(_0x3a34c6[_0xeca6('0x37')][_0xeca6('0x58')]||0xa),'interval':_0xeca6('0x4f')});}return respondWithRpcPromise(_0xeca6('0x59'),'startRouting',_0x3a34c6);});}return respondWithRpcPromise(_0xeca6('0x59'),_0xeca6('0x5a'),_0x3a34c6);})[_0xeca6('0xf')](function(_0x32ff17){_0x3f563d(_0x32ff17);})[_0xeca6('0x19')](function(_0x465516){_0x26562d(_0x4ee0ab['error'](0x1f4,_0x465516[_0xeca6('0x16')]));});});}; \ No newline at end of file +var _0xd76e=['catch','FaxAccount','findAll','options','raw','where','include','map','model','attributes','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','then','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','account','applications','Applications','list','orderBy','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','name','interaction','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter','./faxAccount.socket','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result'];(function(_0x25d47a,_0x55968b){var _0x5af13d=function(_0x88f7d0){while(--_0x88f7d0){_0x25d47a['push'](_0x25d47a['shift']());}};_0x5af13d(++_0x55968b);}(_0xd76e,0x97));var _0xed76=function(_0x518724,_0x30cf83){_0x518724=_0x518724-0x0;var _0x2736c4=_0xd76e[_0x518724];return _0x2736c4;};'use strict';var _=require(_0xed76('0x0'));var util=require('util');var moment=require(_0xed76('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed76('0x2'));var db=require(_0xed76('0x3'))['db'];var utils=require(_0xed76('0x4'));var logger=require(_0xed76('0x5'))(_0xed76('0x6'));var config=require(_0xed76('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed76('0x8')]['http']({'port':0x232c});config[_0xed76('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xed76('0xa'))(new Redis(config[_0xed76('0x9')]));require(_0xed76('0xb'))['register'](socket);function respondWithRpcPromise(_0x3ea06d,_0x27509c,_0x46c68c){return new BPromise(function(_0xce245d,_0xdbab3){return client[_0xed76('0xc')](_0x3ea06d,_0x46c68c)['then'](function(_0x3c2dd4){logger[_0xed76('0xd')]('FaxAccount,\x20%s,\x20%s',_0x27509c,_0xed76('0xe'));logger[_0xed76('0xf')](_0xed76('0x10'),_0x27509c,_0xed76('0xe'),JSON[_0xed76('0x11')](_0x3c2dd4));if(_0x3c2dd4['error']){if(_0x3c2dd4[_0xed76('0x12')][_0xed76('0x13')]===0x1f4){logger[_0xed76('0x12')](_0xed76('0x14'),_0x27509c,_0x3c2dd4[_0xed76('0x12')][_0xed76('0x15')]);return _0xdbab3(_0x3c2dd4['error']['message']);}logger[_0xed76('0x12')](_0xed76('0x14'),_0x27509c,_0x3c2dd4[_0xed76('0x12')][_0xed76('0x15')]);return _0xce245d(_0x3c2dd4['error'][_0xed76('0x15')]);}else{logger[_0xed76('0xd')](_0xed76('0x14'),_0x27509c,'request\x20sent');_0xce245d(_0x3c2dd4[_0xed76('0x16')][_0xed76('0x15')]);}})[_0xed76('0x17')](function(_0xf55c01){logger[_0xed76('0x12')](_0xed76('0x14'),_0x27509c,_0xf55c01);_0xdbab3(_0xf55c01);});});}exports['GetFaxAccount']=function(_0x347986){var _0x399cba=this;return new Promise(function(_0x27a9b1,_0x8ac3e7){return db[_0xed76('0x18')][_0xed76('0x19')]({'raw':_0x347986[_0xed76('0x1a')]?_0x347986[_0xed76('0x1a')][_0xed76('0x1b')]===undefined?!![]:![]:!![],'where':_0x347986[_0xed76('0x1a')]?_0x347986['options'][_0xed76('0x1c')]||null:null,'attributes':_0x347986[_0xed76('0x1a')]?_0x347986['options']['attributes']||null:null,'limit':_0x347986[_0xed76('0x1a')]?_0x347986[_0xed76('0x1a')]['limit']||null:null,'include':_0x347986['options']?_0x347986['options'][_0xed76('0x1d')]?_[_0xed76('0x1e')](_0x347986[_0xed76('0x1a')][_0xed76('0x1d')],function(_0x1d01a5){return{'model':db[_0x1d01a5[_0xed76('0x1f')]],'as':_0x1d01a5['as'],'attributes':_0x1d01a5[_0xed76('0x20')],'include':_0x1d01a5[_0xed76('0x1d')]?_['map'](_0x1d01a5[_0xed76('0x1d')],function(_0x2f38d9){return{'model':db[_0x2f38d9[_0xed76('0x1f')]],'as':_0x2f38d9['as'],'attributes':_0x2f38d9['attributes'],'include':_0x2f38d9[_0xed76('0x1d')]?_[_0xed76('0x1e')](_0x2f38d9[_0xed76('0x1d')],function(_0x31d016){return{'model':db[_0x31d016[_0xed76('0x1f')]],'as':_0x31d016['as'],'attributes':_0x31d016[_0xed76('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44fde1){logger[_0xed76('0xd')]('GetFaxAccount',_0x347986);logger[_0xed76('0xf')](_0xed76('0x21'),_0x347986,JSON['stringify'](_0x44fde1));_0x27a9b1(_0x44fde1);})['catch'](function(_0x1413cc){logger['error'](_0xed76('0x21'),_0x1413cc[_0xed76('0x15')],_0x347986);_0x8ac3e7(_0x399cba['error'](0x1f4,_0x1413cc[_0xed76('0x15')]));});});};exports[_0xed76('0x22')]=function(_0x526e2c,_0x262b65,_0xc2ec4e){var _0x556856=this;return new Promise(function(_0x1bfa4c,_0x10423e){var _0x1c28e7={'body':_0x526e2c['body'],'channel':_0xed76('0x23')};var _0x112202=[];var _0x245bdb=[];var _0x585762={};return db[_0xed76('0x24')][_0xed76('0x25')]()[_0xed76('0x26')](function(_0x43677e){if(!_0x43677e){throw new db[(_0xed76('0x27'))][(_0xed76('0x28'))](_0xed76('0x29'));}_0x112202=_[_0xed76('0x2a')](_['keys'](_0x43677e),['createdAt',_0xed76('0x2b')]);_0x245bdb=_[_0xed76('0x2a')](_[_0xed76('0x2c')](_0x43677e),[_0xed76('0x2d'),_0xed76('0x2b'),_0xed76('0x2e'),_0xed76('0x2f')]);if(_0x526e2c[_0xed76('0x30')]['id']){delete _0x526e2c[_0xed76('0x30')]['id'];}if(_[_0xed76('0x31')](_0x526e2c[_0xed76('0x30')][_0xed76('0x32')])){throw new db[(_0xed76('0x27'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x526e2c[_0xed76('0x30')]['body'])||_0x526e2c['body'][_0xed76('0x30')]===''){throw new db['Sequelize'][(_0xed76('0x28'))](_0xed76('0x33'));}if(_['isNil'](_0x526e2c['body'][_0xed76('0x34')])){throw new db[(_0xed76('0x27'))][(_0xed76('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x245bdb);}if(!_['includes'](_0x245bdb,_0x526e2c[_0xed76('0x30')][_0xed76('0x34')])){throw new db[(_0xed76('0x27'))]['ValidationError'](_0xed76('0x35')+_0x245bdb);}_0x585762[_0x526e2c['body']['mapKey']]=_0x526e2c[_0xed76('0x30')][_0xed76('0x32')];})['then'](function(){return db['FaxAccount'][_0xed76('0x36')]({'where':{'id':_0x526e2c['account']['id']},'include':[{'model':db[_0xed76('0x37')],'as':_0xed76('0x38'),'include':[{'model':db['CmContact'],'as':_0xed76('0x39'),'where':_0x585762,'limit':0x1,'order':[[_0xed76('0x2b'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xed76('0x26')](function(_0x20210b){if(_0x20210b&&_0x20210b[_0xed76('0x38')]){var _0x2a1dc0=_0x20210b['get']({'plain':!![]});_0x1c28e7[_0xed76('0x3a')]=_0x2a1dc0;_0x1c28e7[_0xed76('0x3b')]=_0x2a1dc0[_0xed76('0x3c')];_0x1c28e7[_0xed76('0x3d')]=_0x2a1dc0[_0xed76('0x38')];_0x1c28e7[_0xed76('0x3b')]=_[_0xed76('0x3e')](_0x1c28e7[_0xed76('0x3b')],[_0xed76('0x3f')],[_0xed76('0x40')]);if(_0x1c28e7['account'][_0xed76('0x3c')]){delete _0x1c28e7['account'][_0xed76('0x3c')];}if(_0x1c28e7[_0xed76('0x3a')][_0xed76('0x38')]&&_0x1c28e7[_0xed76('0x3a')][_0xed76('0x38')]['Contacts'][_0xed76('0x41')]){return _0x1c28e7[_0xed76('0x3a')]['List']['Contacts'][0x0];}var _0x4ae9b1=_['defaults'](_0x526e2c[_0xed76('0x30')],{'firstName':_0x526e2c[_0xed76('0x30')][_0xed76('0x32')],'ListId':_0x2a1dc0['ListId']});_0x4ae9b1[_0x526e2c['body'][_0xed76('0x34')]]=_0x526e2c[_0xed76('0x30')][_0xed76('0x32')];return db[_0xed76('0x24')][_0xed76('0x42')](_0x4ae9b1,{'fields':_0x112202,'raw':!![]});}})[_0xed76('0x26')](function(_0x2e05f7){_0x1c28e7['contact']=_0x2e05f7;if(_0x2e05f7){var _0x292c1f={'ContactId':_0x2e05f7['id'],'FaxAccountId':_0x526e2c['account']['id'],'fax':_0x2e05f7['fax']};return db[_0xed76('0x43')][_0xed76('0x36')]({'where':{'ContactId':_0x2e05f7['id'],'closed':![],'FaxAccountId':_0x526e2c[_0xed76('0x3a')]['id']}})[_0xed76('0x26')](function(_0x5cead5){if(_0x5cead5){return[_0x5cead5,![]];}return db['FaxInteraction'][_0xed76('0x42')](_0x292c1f)[_0xed76('0x26')](function(_0x22720c){return[_0x22720c,!![]];});});}else{throw new Error(_0xed76('0x44'));}})[_0xed76('0x45')](function(_0x9d7670,_0x1443d5){var _0x47f6f6=_0x9d7670[_0xed76('0x46')]({'plain':!![]});if(_0x1443d5){if(_0x1c28e7['account'][_0xed76('0x47')]){_0x1c28e7[_0xed76('0x3b')][_0xed76('0x48')]({'id':0x0,'priority':_0x1c28e7['applications'][_0xed76('0x41')]+0x1,'app':_0xed76('0x49'),'appdata':_0xed76('0x4a'),'interval':_0xed76('0x4b')});}_0x47f6f6[_0xed76('0x4c')]=!![];}else{_0x47f6f6[_0xed76('0x4c')]=![];}_0x1c28e7['interaction']=_0x47f6f6;return db['FaxMessage'][_0xed76('0x42')]({'body':_0x526e2c[_0xed76('0x30')]['body'],'FaxAccountId':_0x526e2c[_0xed76('0x3a')]['id'],'FaxInteractionId':_0x9d7670['id'],'direction':'in','ContactId':_0x9d7670[_0xed76('0x4d')],'AttachmentId':_0x526e2c['body'][_0xed76('0x4e')]});})[_0xed76('0x26')](function(_0x90c98e){_0x1c28e7['message']=_0x90c98e;if(_0x1c28e7['interaction'][_0xed76('0x4f')]){return db[_0xed76('0x50')][_0xed76('0x36')]({'attributes':['id',_0xed76('0x51')],'where':{'id':_0x1c28e7[_0xed76('0x52')]['UserId']}})[_0xed76('0x26')](function(_0xd329e8){if(_0xd329e8){_0x1c28e7[_0xed76('0x3b')][_0xed76('0x53')]({'id':0x0,'priority':0x0,'app':_0xed76('0x54'),'appdata':_0xd329e8[_0xed76('0x51')]+','+(_0x1c28e7['account'][_0xed76('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xed76('0x56'),_0x1c28e7);});}return respondWithRpcPromise('Start','startRouting',_0x1c28e7);})[_0xed76('0x26')](function(_0x20380b){_0x1bfa4c(_0x20380b);})['catch'](function(_0xb7d085){_0x10423e(_0x556856[_0xed76('0x12')](0x1f4,_0xb7d085[_0xed76('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e805a43..ad82a88 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 _0x8adb=['emit','removeListener','register','length','./faxAccount.events','save','remove'];(function(_0x3b10a3,_0x40160e){var _0x1cbad8=function(_0x386751){while(--_0x386751){_0x3b10a3['push'](_0x3b10a3['shift']());}};_0x1cbad8(++_0x40160e);}(_0x8adb,0x9e));var _0xb8ad=function(_0x31073e,_0x2df13b){_0x31073e=_0x31073e-0x0;var _0x5d7400=_0x8adb[_0x31073e];return _0x5d7400;};'use strict';var FaxAccountEvents=require(_0xb8ad('0x0'));var events=[_0xb8ad('0x1'),_0xb8ad('0x2'),'update'];function createListener(_0x492610,_0x2b188d){return function(_0x243e6e){_0x2b188d[_0xb8ad('0x3')](_0x492610,_0x243e6e);};}function removeListener(_0xdc8d34,_0x117f4f){return function(){FaxAccountEvents[_0xb8ad('0x4')](_0xdc8d34,_0x117f4f);};}exports[_0xb8ad('0x5')]=function(_0x791959){for(var _0x2eb7c3=0x0,_0x1ae48d=events[_0xb8ad('0x6')];_0x2eb7c3<_0x1ae48d;_0x2eb7c3++){var _0x54a955=events[_0x2eb7c3];var _0x2fbe26=createListener('faxAccount:'+_0x54a955,_0x791959);FaxAccountEvents['on'](_0x54a955,_0x2fbe26);}}; \ No newline at end of file +var _0x37c1=['remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x37c1,0x19c));var _0x137c=function(_0xf96c0a,_0x28d535){_0xf96c0a=_0xf96c0a-0x0;var _0x1cd6a7=_0x37c1[_0xf96c0a];return _0x1cd6a7;};'use strict';var FaxAccountEvents=require(_0x137c('0x0'));var events=[_0x137c('0x1'),_0x137c('0x2'),_0x137c('0x3')];function createListener(_0x274d03,_0x18987e){return function(_0x443659){_0x18987e[_0x137c('0x4')](_0x274d03,_0x443659);};}function removeListener(_0x509d22,_0x493853){return function(){FaxAccountEvents[_0x137c('0x5')](_0x509d22,_0x493853);};}exports[_0x137c('0x6')]=function(_0x489de5){for(var _0x2e13b0=0x0,_0x4841ef=events[_0x137c('0x7')];_0x2e13b0<_0x4841ef;_0x2e13b0++){var _0x1c32a8=events[_0x2e13b0];var _0x1a5cf8=createListener(_0x137c('0x8')+_0x1c32a8,_0x489de5);FaxAccountEvents['on'](_0x1c32a8,_0x1a5cf8);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 624be32..c15d9aa 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x58f438,_0x1c6250){var _0x3f688b=function(_0x1f0905){while(--_0x1f0905){_0x58f438['push'](_0x58f438['shift']());}};_0x3f688b(++_0x1c6250);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x30a54b,_0x138b6e){var _0x2716c1=function(_0x499adb){while(--_0x499adb){_0x30a54b['push'](_0x30a54b['shift']());}};_0x2716c1(++_0x138b6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index d1c67d8..c5f2a08 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 _0x1f66=['sequelize','STRING','TEXT','*,*,*,*'];(function(_0x25a86b,_0x269489){var _0x584cac=function(_0x3ad0ec){while(--_0x3ad0ec){_0x25a86b['push'](_0x25a86b['shift']());}};_0x584cac(++_0x269489);}(_0x1f66,0x14c));var _0x61f6=function(_0x184a40,_0x139863){_0x184a40=_0x184a40-0x0;var _0x4598ac=_0x1f66[_0x184a40];return _0x4598ac;};'use strict';var Sequelize=require(_0x61f6('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x61f6('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x61f6('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x61f6('0x1')],'defaultValue':_0x61f6('0x3')}}; \ No newline at end of file +var _0x2435=['sequelize','INTEGER','noop','STRING','*,*,*,*'];(function(_0x50d420,_0x22ebf2){var _0x144f22=function(_0x2796c4){while(--_0x2796c4){_0x50d420['push'](_0x50d420['shift']());}};_0x144f22(++_0x22ebf2);}(_0x2435,0x1ef));var _0x5243=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x2435[_0x4c440b];return _0x2d48cf;};'use strict';var Sequelize=require(_0x5243('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5243('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5243('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5243('0x3')]},'interval':{'type':Sequelize[_0x5243('0x3')],'defaultValue':_0x5243('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index f18bf72..d0396cc 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 _0xfd8c=['../../config/environment','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','FaxApplication','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2159b8,_0x2621fa){var _0x342a67=function(_0x394be7){while(--_0x394be7){_0x2159b8['push'](_0x2159b8['shift']());}};_0x342a67(++_0x2621fa);}(_0xfd8c,0x166));var _0xcfd8=function(_0x557f77,_0x2ff13f){_0x557f77=_0x557f77-0x0;var _0x166ce5=_0xfd8c[_0x557f77];return _0x166ce5;};'use strict';var emlformat=require(_0xcfd8('0x0'));var rimraf=require(_0xcfd8('0x1'));var zipdir=require(_0xcfd8('0x2'));var jsonpatch=require(_0xcfd8('0x3'));var rp=require(_0xcfd8('0x4'));var moment=require(_0xcfd8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcfd8('0x6'));var sox=require(_0xcfd8('0x7'));var csv=require('to-csv');var ejs=require(_0xcfd8('0x8'));var fs=require('fs');var fs_extra=require(_0xcfd8('0x9'));var _=require('lodash');var squel=require(_0xcfd8('0xa'));var crypto=require(_0xcfd8('0xb'));var jsforce=require(_0xcfd8('0xc'));var deskjs=require(_0xcfd8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcfd8('0xe'));var Papa=require('papaparse');var Redis=require(_0xcfd8('0xf'));var authService=require(_0xcfd8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcfd8('0x11'));var hardwareService=require(_0xcfd8('0x12'));var logger=require(_0xcfd8('0x13'))(_0xcfd8('0x14'));var utils=require(_0xcfd8('0x15'));var config=require(_0xcfd8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcfd8('0x17'))['db'];function respondWithStatusCode(_0x63e114,_0x5054a2){_0x5054a2=_0x5054a2||0xcc;return function(_0x5e9612){if(_0x5e9612){return _0x63e114['sendStatus'](_0x5054a2);}return _0x63e114[_0xcfd8('0x18')](_0x5054a2)['end']();};}function respondWithResult(_0x4b42ea,_0x153d34){_0x153d34=_0x153d34||0xc8;return function(_0x48b392){if(_0x48b392){return _0x4b42ea['status'](_0x153d34)['json'](_0x48b392);}};}function respondWithFilteredResult(_0x5b4e92,_0xdc8c87){return function(_0x579556){if(_0x579556){var _0x53f448=typeof _0xdc8c87['offset']===_0xcfd8('0x19')&&typeof _0xdc8c87[_0xcfd8('0x1a')]===_0xcfd8('0x19');var _0x3ed9ed=_0x579556[_0xcfd8('0x1b')];var _0x45ffb0=_0x53f448?0x0:_0xdc8c87[_0xcfd8('0x1c')];var _0x1bd55c=_0x53f448?_0x579556[_0xcfd8('0x1b')]:_0xdc8c87['offset']+_0xdc8c87[_0xcfd8('0x1a')];var _0x2f8cc6;if(_0x1bd55c>=_0x3ed9ed){_0x1bd55c=_0x3ed9ed;_0x2f8cc6=0xc8;}else{_0x2f8cc6=0xce;}_0x5b4e92['status'](_0x2f8cc6);return _0x5b4e92[_0xcfd8('0x1d')](_0xcfd8('0x1e'),_0x45ffb0+'-'+_0x1bd55c+'/'+_0x3ed9ed)[_0xcfd8('0x1f')](_0x579556);}return null;};}function patchUpdates(_0x2a6bed){return function(_0x1286c0){try{jsonpatch[_0xcfd8('0x20')](_0x1286c0,_0x2a6bed,!![]);}catch(_0x20bfdd){return BPromise[_0xcfd8('0x21')](_0x20bfdd);}return _0x1286c0[_0xcfd8('0x22')]();};}function saveUpdates(_0x23a7ff,_0x244c75){return function(_0xb2469d){if(_0xb2469d){return _0xb2469d[_0xcfd8('0x23')](_0x23a7ff)[_0xcfd8('0x24')](function(_0x2b7155){return _0x2b7155;});}return null;};}function removeEntity(_0x153f4f,_0x1c1df2){return function(_0x2d3f0a){if(_0x2d3f0a){return _0x2d3f0a[_0xcfd8('0x25')]()[_0xcfd8('0x24')](function(){_0x153f4f['status'](0xcc)[_0xcfd8('0x26')]();});}};}function handleEntityNotFound(_0x53875c,_0x446468){return function(_0x846cfc){if(!_0x846cfc){_0x53875c[_0xcfd8('0x27')](0x194);}return _0x846cfc;};}function handleError(_0x3d4012,_0x13fe84){_0x13fe84=_0x13fe84||0x1f4;return function(_0x3c8065){logger[_0xcfd8('0x28')](_0x3c8065[_0xcfd8('0x29')]);if(_0x3c8065['name']){delete _0x3c8065['name'];}_0x3d4012['status'](_0x13fe84)[_0xcfd8('0x2a')](_0x3c8065);};}exports[_0xcfd8('0x2b')]=function(_0x473fca,_0x5b612f){var _0x4b7580={},_0x262dd0={},_0x480818={'count':0x0,'rows':[]};var _0x1d2ba8=_[_0xcfd8('0x2c')](db['FaxApplication'][_0xcfd8('0x2d')],function(_0x5d2205){return{'name':_0x5d2205[_0xcfd8('0x2e')],'type':_0x5d2205['type'][_0xcfd8('0x2f')]};});_0x262dd0[_0xcfd8('0x30')]=_['map'](_0x1d2ba8,'name');_0x262dd0[_0xcfd8('0x31')]=_[_0xcfd8('0x32')](_0x473fca[_0xcfd8('0x31')]);_0x262dd0[_0xcfd8('0x33')]=_[_0xcfd8('0x34')](_0x262dd0['model'],_0x262dd0[_0xcfd8('0x31')]);_0x4b7580[_0xcfd8('0x35')]=_['intersection'](_0x262dd0[_0xcfd8('0x30')],qs['fields'](_0x473fca[_0xcfd8('0x31')][_0xcfd8('0x36')]));_0x4b7580[_0xcfd8('0x35')]=_0x4b7580[_0xcfd8('0x35')][_0xcfd8('0x37')]?_0x4b7580[_0xcfd8('0x35')]:_0x262dd0['model'];if(!_0x473fca['query'][_0xcfd8('0x38')](_0xcfd8('0x39'))){_0x4b7580[_0xcfd8('0x1a')]=qs[_0xcfd8('0x1a')](_0x473fca['query'][_0xcfd8('0x1a')]);_0x4b7580[_0xcfd8('0x1c')]=qs[_0xcfd8('0x1c')](_0x473fca[_0xcfd8('0x31')][_0xcfd8('0x1c')]);}_0x4b7580['order']=qs[_0xcfd8('0x3a')](_0x473fca[_0xcfd8('0x31')][_0xcfd8('0x3a')]);_0x4b7580[_0xcfd8('0x3b')]=qs[_0xcfd8('0x33')](_[_0xcfd8('0x3c')](_0x473fca[_0xcfd8('0x31')],_0x262dd0[_0xcfd8('0x33')]),_0x1d2ba8);if(_0x473fca[_0xcfd8('0x31')][_0xcfd8('0x3d')]){_0x4b7580[_0xcfd8('0x3b')]=_['merge'](_0x4b7580[_0xcfd8('0x3b')],{'$or':_[_0xcfd8('0x2c')](_0x1d2ba8,function(_0x2c529d){if(_0x2c529d[_0xcfd8('0x3e')]!==_0xcfd8('0x3f')){var _0x405886={};_0x405886[_0x2c529d['name']]={'$like':'%'+_0x473fca[_0xcfd8('0x31')][_0xcfd8('0x3d')]+'%'};return _0x405886;}})});}_0x4b7580=_[_0xcfd8('0x40')]({},_0x4b7580,_0x473fca[_0xcfd8('0x41')]);var _0x1e44eb={'where':_0x4b7580[_0xcfd8('0x3b')]};return db[_0xcfd8('0x42')][_0xcfd8('0x1b')](_0x1e44eb)[_0xcfd8('0x24')](function(_0x28588b){_0x480818[_0xcfd8('0x1b')]=_0x28588b;if(_0x473fca['query'][_0xcfd8('0x43')]){_0x4b7580[_0xcfd8('0x44')]=[{'all':!![]}];}return db[_0xcfd8('0x42')][_0xcfd8('0x45')](_0x4b7580);})[_0xcfd8('0x24')](function(_0x518d6d){_0x480818[_0xcfd8('0x46')]=_0x518d6d;return _0x480818;})[_0xcfd8('0x24')](respondWithFilteredResult(_0x5b612f,_0x4b7580))[_0xcfd8('0x47')](handleError(_0x5b612f,null));};exports['show']=function(_0x4b5583,_0x31e585){var _0x55dc5b={'raw':!![],'where':{'id':_0x4b5583[_0xcfd8('0x48')]['id']}},_0x11e921={};_0x11e921[_0xcfd8('0x30')]=_[_0xcfd8('0x32')](db[_0xcfd8('0x42')][_0xcfd8('0x2d')]);_0x11e921[_0xcfd8('0x31')]=_[_0xcfd8('0x32')](_0x4b5583[_0xcfd8('0x31')]);_0x11e921[_0xcfd8('0x33')]=_['intersection'](_0x11e921[_0xcfd8('0x30')],_0x11e921['query']);_0x55dc5b[_0xcfd8('0x35')]=_[_0xcfd8('0x34')](_0x11e921[_0xcfd8('0x30')],qs[_0xcfd8('0x36')](_0x4b5583[_0xcfd8('0x31')]['fields']));_0x55dc5b[_0xcfd8('0x35')]=_0x55dc5b['attributes'][_0xcfd8('0x37')]?_0x55dc5b['attributes']:_0x11e921['model'];if(_0x4b5583[_0xcfd8('0x31')]['includeAll']){_0x55dc5b[_0xcfd8('0x44')]=[{'all':!![]}];}_0x55dc5b=_['merge']({},_0x55dc5b,_0x4b5583[_0xcfd8('0x41')]);return db['FaxApplication'][_0xcfd8('0x49')](_0x55dc5b)[_0xcfd8('0x24')](handleEntityNotFound(_0x31e585,null))[_0xcfd8('0x24')](respondWithResult(_0x31e585,null))[_0xcfd8('0x47')](handleError(_0x31e585,null));};exports[_0xcfd8('0x4a')]=function(_0x3267fe,_0x365d09){return db['FaxApplication']['create'](_0x3267fe[_0xcfd8('0x4b')],{})[_0xcfd8('0x24')](respondWithResult(_0x365d09,0xc9))[_0xcfd8('0x47')](handleError(_0x365d09,null));};exports['update']=function(_0x519f56,_0x1134e1){if(_0x519f56[_0xcfd8('0x4b')]['id']){delete _0x519f56[_0xcfd8('0x4b')]['id'];}return db[_0xcfd8('0x42')][_0xcfd8('0x49')]({'where':{'id':_0x519f56['params']['id']}})[_0xcfd8('0x24')](handleEntityNotFound(_0x1134e1,null))[_0xcfd8('0x24')](saveUpdates(_0x519f56['body'],null))[_0xcfd8('0x24')](respondWithResult(_0x1134e1,null))[_0xcfd8('0x47')](handleError(_0x1134e1,null));};exports[_0xcfd8('0x25')]=function(_0x3fec6d,_0x2f7e8b){return db[_0xcfd8('0x42')]['find']({'where':{'id':_0x3fec6d[_0xcfd8('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7e8b,null))[_0xcfd8('0x24')](removeEntity(_0x2f7e8b,null))[_0xcfd8('0x47')](handleError(_0x2f7e8b,null));}; \ No newline at end of file +var _0x0eb0=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','update','then','error','stack','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','FaxApplication','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','squel'];(function(_0x5f209e,_0x41a8ab){var _0x24b110=function(_0x477753){while(--_0x477753){_0x5f209e['push'](_0x5f209e['shift']());}};_0x24b110(++_0x41a8ab);}(_0x0eb0,0xca));var _0x00eb=function(_0x4f68ae,_0x7a06a4){_0x4f68ae=_0x4f68ae-0x0;var _0x56cc6b=_0x0eb0[_0x4f68ae];return _0x56cc6b;};'use strict';var emlformat=require(_0x00eb('0x0'));var rimraf=require(_0x00eb('0x1'));var zipdir=require(_0x00eb('0x2'));var jsonpatch=require(_0x00eb('0x3'));var rp=require('request-promise');var moment=require(_0x00eb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x00eb('0x5'));var path=require('path');var sox=require(_0x00eb('0x6'));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(_0x00eb('0x7'));var crypto=require(_0x00eb('0x8'));var jsforce=require(_0x00eb('0x9'));var deskjs=require(_0x00eb('0xa'));var toCsv=require(_0x00eb('0xb'));var querystring=require(_0x00eb('0xc'));var Papa=require(_0x00eb('0xd'));var Redis=require('ioredis');var authService=require(_0x00eb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x00eb('0xf'));var hardwareService=require(_0x00eb('0x10'));var logger=require(_0x00eb('0x11'))(_0x00eb('0x12'));var utils=require('../../config/utils');var config=require(_0x00eb('0x13'));var licenseUtil=require(_0x00eb('0x14'));var db=require(_0x00eb('0x15'))['db'];function respondWithStatusCode(_0x9b50b1,_0x542d46){_0x542d46=_0x542d46||0xcc;return function(_0x2767b0){if(_0x2767b0){return _0x9b50b1[_0x00eb('0x16')](_0x542d46);}return _0x9b50b1[_0x00eb('0x17')](_0x542d46)[_0x00eb('0x18')]();};}function respondWithResult(_0x69905b,_0x448704){_0x448704=_0x448704||0xc8;return function(_0x417d93){if(_0x417d93){return _0x69905b[_0x00eb('0x17')](_0x448704)[_0x00eb('0x19')](_0x417d93);}};}function respondWithFilteredResult(_0x55db4e,_0x6d4a61){return function(_0x423447){if(_0x423447){var _0x366b52=typeof _0x6d4a61[_0x00eb('0x1a')]==='undefined'&&typeof _0x6d4a61['limit']===_0x00eb('0x1b');var _0x6688c4=_0x423447[_0x00eb('0x1c')];var _0x2af518=_0x366b52?0x0:_0x6d4a61[_0x00eb('0x1a')];var _0x125ca0=_0x366b52?_0x423447[_0x00eb('0x1c')]:_0x6d4a61[_0x00eb('0x1a')]+_0x6d4a61['limit'];var _0x21db21;if(_0x125ca0>=_0x6688c4){_0x125ca0=_0x6688c4;_0x21db21=0xc8;}else{_0x21db21=0xce;}_0x55db4e['status'](_0x21db21);return _0x55db4e[_0x00eb('0x1d')](_0x00eb('0x1e'),_0x2af518+'-'+_0x125ca0+'/'+_0x6688c4)['json'](_0x423447);}return null;};}function patchUpdates(_0x36c8d6){return function(_0x3b09d5){try{jsonpatch['apply'](_0x3b09d5,_0x36c8d6,!![]);}catch(_0x3598b0){return BPromise[_0x00eb('0x1f')](_0x3598b0);}return _0x3b09d5['save']();};}function saveUpdates(_0x1fa004,_0x475d71){return function(_0x4d8659){if(_0x4d8659){return _0x4d8659[_0x00eb('0x20')](_0x1fa004)[_0x00eb('0x21')](function(_0x494bfc){return _0x494bfc;});}return null;};}function removeEntity(_0x3ff4f4,_0x2848bb){return function(_0xe8e3ac){if(_0xe8e3ac){return _0xe8e3ac['destroy']()[_0x00eb('0x21')](function(){_0x3ff4f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa37b,_0xb80b8d){return function(_0x86703c){if(!_0x86703c){_0x3fa37b[_0x00eb('0x16')](0x194);}return _0x86703c;};}function handleError(_0x2a3057,_0x4cbfe6){_0x4cbfe6=_0x4cbfe6||0x1f4;return function(_0x5efb08){logger[_0x00eb('0x22')](_0x5efb08[_0x00eb('0x23')]);if(_0x5efb08[_0x00eb('0x24')]){delete _0x5efb08[_0x00eb('0x24')];}_0x2a3057[_0x00eb('0x17')](_0x4cbfe6)['send'](_0x5efb08);};}exports[_0x00eb('0x25')]=function(_0x3a1f62,_0x55c2aa){var _0x41737b={},_0x791338={},_0x22c20f={'count':0x0,'rows':[]};var _0xf3c964=_[_0x00eb('0x26')](db['FaxApplication'][_0x00eb('0x27')],function(_0x23bf9b){return{'name':_0x23bf9b['fieldName'],'type':_0x23bf9b[_0x00eb('0x28')][_0x00eb('0x29')]};});_0x791338[_0x00eb('0x2a')]=_['map'](_0xf3c964,_0x00eb('0x24'));_0x791338['query']=_[_0x00eb('0x2b')](_0x3a1f62[_0x00eb('0x2c')]);_0x791338[_0x00eb('0x2d')]=_[_0x00eb('0x2e')](_0x791338[_0x00eb('0x2a')],_0x791338[_0x00eb('0x2c')]);_0x41737b[_0x00eb('0x2f')]=_['intersection'](_0x791338['model'],qs[_0x00eb('0x30')](_0x3a1f62[_0x00eb('0x2c')][_0x00eb('0x30')]));_0x41737b[_0x00eb('0x2f')]=_0x41737b[_0x00eb('0x2f')][_0x00eb('0x31')]?_0x41737b['attributes']:_0x791338[_0x00eb('0x2a')];if(!_0x3a1f62[_0x00eb('0x2c')][_0x00eb('0x32')](_0x00eb('0x33'))){_0x41737b[_0x00eb('0x34')]=qs['limit'](_0x3a1f62[_0x00eb('0x2c')]['limit']);_0x41737b[_0x00eb('0x1a')]=qs[_0x00eb('0x1a')](_0x3a1f62[_0x00eb('0x2c')][_0x00eb('0x1a')]);}_0x41737b[_0x00eb('0x35')]=qs[_0x00eb('0x36')](_0x3a1f62[_0x00eb('0x2c')][_0x00eb('0x36')]);_0x41737b[_0x00eb('0x37')]=qs['filters'](_[_0x00eb('0x38')](_0x3a1f62[_0x00eb('0x2c')],_0x791338[_0x00eb('0x2d')]),_0xf3c964);if(_0x3a1f62[_0x00eb('0x2c')][_0x00eb('0x39')]){_0x41737b[_0x00eb('0x37')]=_[_0x00eb('0x3a')](_0x41737b[_0x00eb('0x37')],{'$or':_[_0x00eb('0x26')](_0xf3c964,function(_0x1c0c82){if(_0x1c0c82[_0x00eb('0x28')]!==_0x00eb('0x3b')){var _0x1c1cf3={};_0x1c1cf3[_0x1c0c82[_0x00eb('0x24')]]={'$like':'%'+_0x3a1f62[_0x00eb('0x2c')]['filter']+'%'};return _0x1c1cf3;}})});}_0x41737b=_['merge']({},_0x41737b,_0x3a1f62[_0x00eb('0x3c')]);var _0x5a6951={'where':_0x41737b[_0x00eb('0x37')]};return db['FaxApplication'][_0x00eb('0x1c')](_0x5a6951)[_0x00eb('0x21')](function(_0x554b75){_0x22c20f[_0x00eb('0x1c')]=_0x554b75;if(_0x3a1f62[_0x00eb('0x2c')]['includeAll']){_0x41737b[_0x00eb('0x3d')]=[{'all':!![]}];}return db[_0x00eb('0x3e')]['findAll'](_0x41737b);})['then'](function(_0x1ace01){_0x22c20f[_0x00eb('0x3f')]=_0x1ace01;return _0x22c20f;})[_0x00eb('0x21')](respondWithFilteredResult(_0x55c2aa,_0x41737b))[_0x00eb('0x40')](handleError(_0x55c2aa,null));};exports[_0x00eb('0x41')]=function(_0x4804c0,_0x26e70e){var _0x55fb3e={'raw':!![],'where':{'id':_0x4804c0[_0x00eb('0x42')]['id']}},_0x38945f={};_0x38945f['model']=_[_0x00eb('0x2b')](db[_0x00eb('0x3e')][_0x00eb('0x27')]);_0x38945f['query']=_[_0x00eb('0x2b')](_0x4804c0['query']);_0x38945f['filters']=_[_0x00eb('0x2e')](_0x38945f['model'],_0x38945f[_0x00eb('0x2c')]);_0x55fb3e[_0x00eb('0x2f')]=_[_0x00eb('0x2e')](_0x38945f[_0x00eb('0x2a')],qs[_0x00eb('0x30')](_0x4804c0['query'][_0x00eb('0x30')]));_0x55fb3e[_0x00eb('0x2f')]=_0x55fb3e[_0x00eb('0x2f')][_0x00eb('0x31')]?_0x55fb3e[_0x00eb('0x2f')]:_0x38945f[_0x00eb('0x2a')];if(_0x4804c0[_0x00eb('0x2c')]['includeAll']){_0x55fb3e[_0x00eb('0x3d')]=[{'all':!![]}];}_0x55fb3e=_[_0x00eb('0x3a')]({},_0x55fb3e,_0x4804c0[_0x00eb('0x3c')]);return db['FaxApplication'][_0x00eb('0x43')](_0x55fb3e)[_0x00eb('0x21')](handleEntityNotFound(_0x26e70e,null))[_0x00eb('0x21')](respondWithResult(_0x26e70e,null))[_0x00eb('0x40')](handleError(_0x26e70e,null));};exports[_0x00eb('0x44')]=function(_0x4f5366,_0x502712){return db[_0x00eb('0x3e')][_0x00eb('0x44')](_0x4f5366[_0x00eb('0x45')],{})[_0x00eb('0x21')](respondWithResult(_0x502712,0xc9))[_0x00eb('0x40')](handleError(_0x502712,null));};exports[_0x00eb('0x20')]=function(_0x254f54,_0x1fe1ec){if(_0x254f54[_0x00eb('0x45')]['id']){delete _0x254f54[_0x00eb('0x45')]['id'];}return db['FaxApplication'][_0x00eb('0x43')]({'where':{'id':_0x254f54['params']['id']}})[_0x00eb('0x21')](handleEntityNotFound(_0x1fe1ec,null))['then'](saveUpdates(_0x254f54[_0x00eb('0x45')],null))[_0x00eb('0x21')](respondWithResult(_0x1fe1ec,null))[_0x00eb('0x40')](handleError(_0x1fe1ec,null));};exports['destroy']=function(_0x30b11f,_0x48d59e){return db['FaxApplication'][_0x00eb('0x43')]({'where':{'id':_0x30b11f['params']['id']}})[_0x00eb('0x21')](handleEntityNotFound(_0x48d59e,null))[_0x00eb('0x21')](removeEntity(_0x48d59e,null))['catch'](handleError(_0x48d59e,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6dd4bce..8176501 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 _0xfbe9=['./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0xfbe9,0x65));var _0x9fbe=function(_0x748f64,_0x1ab840){_0x748f64=_0x748f64-0x0;var _0x50a19c=_0xfbe9[_0x748f64];return _0x50a19c;};'use strict';var _=require(_0x9fbe('0x0'));var util=require(_0x9fbe('0x1'));var logger=require(_0x9fbe('0x2'))(_0x9fbe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9fbe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fbe('0x5'));var config=require(_0x9fbe('0x6'));var attributes=require(_0x9fbe('0x7'));module[_0x9fbe('0x8')]=function(_0x55baab,_0x310e51){return _0x55baab[_0x9fbe('0x9')]('FaxApplication',attributes,{'tableName':_0x9fbe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9fbe('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd377=['moment','bluebird','path','FaxApplication','utf8mb4_unicode_ci','lodash'];(function(_0x4c1db2,_0x32dc02){var _0x388daa=function(_0x4db829){while(--_0x4db829){_0x4c1db2['push'](_0x4c1db2['shift']());}};_0x388daa(++_0x32dc02);}(_0xd377,0x65));var _0x7d37=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd377[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7d37('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7d37('0x1'));var BPromise=require(_0x7d37('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d37('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x12ac08,_0x26252e){return _0x12ac08['define'](_0x7d37('0x4'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7d37('0x5')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index d55748e..25fbc25 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 _0xced8=['../../config/logger','../../config/environment','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x231297,_0x4da643){var _0x39ab3d=function(_0x58785f){while(--_0x58785f){_0x231297['push'](_0x231297['shift']());}};_0x39ab3d(++_0x4da643);}(_0xced8,0xc6));var _0x8ced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xced8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8ced('0x0'));var util=require(_0x8ced('0x1'));var moment=require(_0x8ced('0x2'));var BPromise=require(_0x8ced('0x3'));var rs=require(_0x8ced('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8ced('0x5'))('rpc');var config=require(_0x8ced('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8ced('0x7')][_0x8ced('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38c5bc,_0x13b1e4,_0x415d9f){return new BPromise(function(_0x12aa0d,_0x59e542){return client[_0x8ced('0x9')](_0x38c5bc,_0x415d9f)['then'](function(_0x15a766){logger[_0x8ced('0xa')](_0x8ced('0xb'),_0x13b1e4,_0x8ced('0xc'));logger['debug'](_0x8ced('0xd'),_0x13b1e4,_0x8ced('0xc'),JSON[_0x8ced('0xe')](_0x15a766));if(_0x15a766[_0x8ced('0xf')]){if(_0x15a766[_0x8ced('0xf')][_0x8ced('0x10')]===0x1f4){logger[_0x8ced('0xf')](_0x8ced('0xb'),_0x13b1e4,_0x15a766[_0x8ced('0xf')]['message']);return _0x59e542(_0x15a766['error'][_0x8ced('0x11')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x13b1e4,_0x15a766[_0x8ced('0xf')][_0x8ced('0x11')]);return _0x12aa0d(_0x15a766[_0x8ced('0xf')][_0x8ced('0x11')]);}else{logger[_0x8ced('0xa')](_0x8ced('0xb'),_0x13b1e4,_0x8ced('0xc'));_0x12aa0d(_0x15a766[_0x8ced('0x12')][_0x8ced('0x11')]);}})[_0x8ced('0x13')](function(_0x1d1c1a){logger[_0x8ced('0xf')]('FaxApplication,\x20%s,\x20%s',_0x13b1e4,_0x1d1c1a);_0x59e542(_0x1d1c1a);});});}exports[_0x8ced('0x14')]=function(_0x2288a3){var _0xabfec8=this;return new Promise(function(_0x2aa77d,_0x56de97){return db[_0x8ced('0x15')][_0x8ced('0x16')](_0x2288a3[_0x8ced('0x17')],{'raw':_0x2288a3[_0x8ced('0x18')]?_0x2288a3[_0x8ced('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2288a3['options']?_0x2288a3[_0x8ced('0x18')][_0x8ced('0x19')]||null:null,'attributes':_0x2288a3[_0x8ced('0x18')]?_0x2288a3[_0x8ced('0x18')][_0x8ced('0x1a')]||null:null,'limit':_0x2288a3[_0x8ced('0x18')]?_0x2288a3[_0x8ced('0x18')][_0x8ced('0x1b')]||null:null})['then'](function(_0x56dd4f){logger[_0x8ced('0xa')]('UpdateFaxApplication',_0x2288a3);logger[_0x8ced('0x1c')](_0x8ced('0x14'),_0x2288a3,JSON[_0x8ced('0xe')](_0x56dd4f));_0x2aa77d(_0x56dd4f);})['catch'](function(_0xac7087){logger[_0x8ced('0xf')](_0x8ced('0x14'),_0xac7087[_0x8ced('0x11')],_0x2288a3);_0x56de97(_0xabfec8[_0x8ced('0xf')](0x1f4,_0xac7087[_0x8ced('0x11')]));});});}; \ No newline at end of file +var _0x277c=['attributes','limit','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateFaxApplication','FaxApplication','update','body','options','where'];(function(_0x4dab9f,_0x33d9db){var _0x28fc11=function(_0x159a7d){while(--_0x159a7d){_0x4dab9f['push'](_0x4dab9f['shift']());}};_0x28fc11(++_0x33d9db);}(_0x277c,0x153));var _0xc277=function(_0x3a6e57,_0x2403f4){_0x3a6e57=_0x3a6e57-0x0;var _0x49bd69=_0x277c[_0x3a6e57];return _0x49bd69;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var moment=require(_0xc277('0x1'));var BPromise=require(_0xc277('0x2'));var rs=require(_0xc277('0x3'));var fs=require('fs');var Redis=require(_0xc277('0x4'));var db=require(_0xc277('0x5'))['db'];var utils=require(_0xc277('0x6'));var logger=require(_0xc277('0x7'))(_0xc277('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc277('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x77e168,_0x54d634,_0x378158){return new BPromise(function(_0x17a2fe,_0x55be1f){return client[_0xc277('0xa')](_0x77e168,_0x378158)[_0xc277('0xb')](function(_0xfdf694){logger[_0xc277('0xc')](_0xc277('0xd'),_0x54d634,_0xc277('0xe'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x54d634,_0xc277('0xe'),JSON[_0xc277('0xf')](_0xfdf694));if(_0xfdf694[_0xc277('0x10')]){if(_0xfdf694[_0xc277('0x10')]['code']===0x1f4){logger[_0xc277('0x10')]('FaxApplication,\x20%s,\x20%s',_0x54d634,_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);return _0x55be1f(_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);}logger['error'](_0xc277('0xd'),_0x54d634,_0xfdf694[_0xc277('0x10')][_0xc277('0x11')]);return _0x17a2fe(_0xfdf694['error']['message']);}else{logger[_0xc277('0xc')]('FaxApplication,\x20%s,\x20%s',_0x54d634,_0xc277('0xe'));_0x17a2fe(_0xfdf694['result'][_0xc277('0x11')]);}})[_0xc277('0x12')](function(_0x15f560){logger['error']('FaxApplication,\x20%s,\x20%s',_0x54d634,_0x15f560);_0x55be1f(_0x15f560);});});}exports[_0xc277('0x13')]=function(_0x4d23a7){var _0x4d8351=this;return new Promise(function(_0x1e1a9b,_0xba31f6){return db[_0xc277('0x14')][_0xc277('0x15')](_0x4d23a7[_0xc277('0x16')],{'raw':_0x4d23a7[_0xc277('0x17')]?_0x4d23a7[_0xc277('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d23a7['options']?_0x4d23a7[_0xc277('0x17')][_0xc277('0x18')]||null:null,'attributes':_0x4d23a7[_0xc277('0x17')]?_0x4d23a7[_0xc277('0x17')][_0xc277('0x19')]||null:null,'limit':_0x4d23a7[_0xc277('0x17')]?_0x4d23a7[_0xc277('0x17')][_0xc277('0x1a')]||null:null})[_0xc277('0xb')](function(_0x2bc7ad){logger[_0xc277('0xc')]('UpdateFaxApplication',_0x4d23a7);logger[_0xc277('0x1b')](_0xc277('0x13'),_0x4d23a7,JSON['stringify'](_0x2bc7ad));_0x1e1a9b(_0x2bc7ad);})[_0xc277('0x12')](function(_0x4820e1){logger['error'](_0xc277('0x13'),_0x4820e1[_0xc277('0x11')],_0x4d23a7);_0xba31f6(_0x4d8351[_0xc277('0x10')](0x1f4,_0x4820e1[_0xc277('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 28fd7e5..18fe55f 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xb688,0xcf));var _0x8b68=function(_0x19b4a3,_0x5592f3){_0x19b4a3=_0x19b4a3-0x0;var _0x488d1b=_0xb688[_0x19b4a3];return _0x488d1b;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file +var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxApplication.controller'];(function(_0x41a3ba,_0x24e704){var _0x5eda36=function(_0x223256){while(--_0x223256){_0x41a3ba['push'](_0x41a3ba['shift']());}};_0x5eda36(++_0x24e704);}(_0x14a0,0x8e));var _0x014a=function(_0x5a0697,_0x135d87){_0x5a0697=_0x5a0697-0x0;var _0x494b79=_0x14a0[_0x5a0697];return _0x494b79;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 1f0d76d..6b0f08e 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 _0xe326=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0xe326,0x15f));var _0x6e32=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0xe326[_0x42bb6d];return _0x1db89b;};'use strict';var Sequelize=require(_0x6e32('0x0'));module[_0x6e32('0x1')]={'closed':{'type':Sequelize[_0x6e32('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e32('0x3')]},'disposition':{'type':Sequelize[_0x6e32('0x4')]},'secondDisposition':{'type':Sequelize[_0x6e32('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6e32('0x4')]},'note':{'type':Sequelize[_0x6e32('0x4')]},'read1stAt':{'type':Sequelize[_0x6e32('0x3')]},'fax':{'type':Sequelize[_0x6e32('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6e32('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6e32('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6e32('0x6')]('in',_0x6e32('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x4343=['STRING','out','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4343,0xce));var _0x3434=function(_0x504575,_0x1e1f2b){_0x504575=_0x504575-0x0;var _0x2e23d9=_0x4343[_0x504575];return _0x2e23d9;};'use strict';var Sequelize=require(_0x3434('0x0'));module[_0x3434('0x1')]={'closed':{'type':Sequelize[_0x3434('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3434('0x3')]},'disposition':{'type':Sequelize[_0x3434('0x4')]},'secondDisposition':{'type':Sequelize[_0x3434('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3434('0x4')]},'note':{'type':Sequelize[_0x3434('0x4')]},'read1stAt':{'type':Sequelize[_0x3434('0x3')]},'fax':{'type':Sequelize[_0x3434('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3434('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3434('0x6')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 0a37ca2..4546f2b 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 _0x5da9=['server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','update','then','destroy','error','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','talking','answered','total','closed','UserId','waiting','index','FaxInteraction','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','select','field','color','u.id','u.fullname','from','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','start','buildExpression','text','some','compact','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','FaxAccountId','toString','keyBy','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','sequelize','groupBy','FaxInteractionId','all','show','includeAll','merge','options','create','body','params','describe','addMessage','FaxMessage','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','count','findAll','rows','addTags','omit','ids','spread','emit','removeTags','download','unix','join','root'];(function(_0x381d56,_0x47c77a){var _0x55da6c=function(_0x1dc3a4){while(--_0x1dc3a4){_0x381d56['push'](_0x381d56['shift']());}};_0x55da6c(++_0x47c77a);}(_0x5da9,0xef));var _0x95da=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0x5da9[_0x4147ff];return _0x1e71e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95da('0x0'));var zipdir=require(_0x95da('0x1'));var jsonpatch=require(_0x95da('0x2'));var rp=require('request-promise');var moment=require(_0x95da('0x3'));var BPromise=require(_0x95da('0x4'));var Mustache=require('mustache');var util=require(_0x95da('0x5'));var path=require('path');var sox=require(_0x95da('0x6'));var csv=require(_0x95da('0x7'));var ejs=require(_0x95da('0x8'));var fs=require('fs');var fs_extra=require(_0x95da('0x9'));var _=require(_0x95da('0xa'));var squel=require(_0x95da('0xb'));var crypto=require(_0x95da('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x95da('0xd'));var toCsv=require(_0x95da('0x7'));var querystring=require(_0x95da('0xe'));var Papa=require(_0x95da('0xf'));var Redis=require(_0x95da('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x95da('0x11'));var as=require(_0x95da('0x12'));var hardwareService=require(_0x95da('0x13'));var logger=require(_0x95da('0x14'))('api');var utils=require(_0x95da('0x15'));var config=require(_0x95da('0x16'));var licenseUtil=require(_0x95da('0x17'));var db=require(_0x95da('0x18'))['db'];config[_0x95da('0x19')]=_[_0x95da('0x1a')](config[_0x95da('0x19')],{'host':_0x95da('0x1b'),'port':0x18eb});var socket=require(_0x95da('0x1c'))(new Redis(config[_0x95da('0x19')]));require(_0x95da('0x1d'))['register'](socket);function respondWithStatusCode(_0x5aa159,_0x5ec8eb){_0x5ec8eb=_0x5ec8eb||0xcc;return function(_0x159df4){if(_0x159df4){return _0x5aa159[_0x95da('0x1e')](_0x5ec8eb);}return _0x5aa159[_0x95da('0x1f')](_0x5ec8eb)[_0x95da('0x20')]();};}function respondWithResult(_0x295dd4,_0x986b0f){_0x986b0f=_0x986b0f||0xc8;return function(_0x3eb117){if(_0x3eb117){return _0x295dd4[_0x95da('0x1f')](_0x986b0f)[_0x95da('0x21')](_0x3eb117);}};}function respondWithFilteredResult(_0x206d4b,_0x4652d9){return function(_0x5a18a1){if(_0x5a18a1){var _0x42a4aa=typeof _0x4652d9['offset']===_0x95da('0x22')&&typeof _0x4652d9[_0x95da('0x23')]===_0x95da('0x22');var _0x3085f6=_0x5a18a1['count'];var _0x430694=_0x42a4aa?0x0:_0x4652d9[_0x95da('0x24')];var _0x43d54c=_0x42a4aa?_0x5a18a1['count']:_0x4652d9[_0x95da('0x24')]+_0x4652d9[_0x95da('0x23')];var _0x4909d4;if(_0x43d54c>=_0x3085f6){_0x43d54c=_0x3085f6;_0x4909d4=0xc8;}else{_0x4909d4=0xce;}_0x206d4b[_0x95da('0x1f')](_0x4909d4);return _0x206d4b[_0x95da('0x25')](_0x95da('0x26'),_0x430694+'-'+_0x43d54c+'/'+_0x3085f6)['json'](_0x5a18a1);}return null;};}function patchUpdates(_0x140c3a){return function(_0x65eec0){try{jsonpatch['apply'](_0x65eec0,_0x140c3a,!![]);}catch(_0x165441){return BPromise['reject'](_0x165441);}return _0x65eec0['save']();};}function saveUpdates(_0x184086,_0x9dc292){return function(_0x18b58f){if(_0x18b58f){return _0x18b58f[_0x95da('0x27')](_0x184086)[_0x95da('0x28')](function(_0x714a01){return _0x714a01;});}return null;};}function removeEntity(_0x2b67db,_0xe74e1d){return function(_0x5c0f30){if(_0x5c0f30){return _0x5c0f30[_0x95da('0x29')]()['then'](function(){_0x2b67db[_0x95da('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ba25c,_0x1f96d2){return function(_0x313505){if(!_0x313505){_0x1ba25c[_0x95da('0x1e')](0x194);}return _0x313505;};}function handleError(_0x107268,_0x415180){_0x415180=_0x415180||0x1f4;return function(_0xf5e74e){logger[_0x95da('0x2a')](_0xf5e74e['stack']);if(_0xf5e74e[_0x95da('0x2b')]){delete _0xf5e74e['name'];}_0x107268[_0x95da('0x1f')](_0x415180)[_0x95da('0x2c')](_0xf5e74e);};}function getInteractionUsers(_0x473cba,_0x3306a6){return new BPromise(function(_0x3ad2ed,_0x1c9a1a){try{if(_0x3306a6[_0x473cba['id']]){_0x473cba[_0x95da('0x2d')]=_[_0x95da('0x2e')](_0x3306a6[_0x473cba['id']],function(_0xb2dac8){return{'id':_0xb2dac8['id'],'fullname':_0xb2dac8[_0x95da('0x2f')]};});}}catch(_0x4000cd){_0x1c9a1a(_0x4000cd);}_0x3ad2ed(_0x473cba);});}function getInteractionTags(_0x280720,_0xfd9239){return new BPromise(function(_0x3b182b,_0x1e0eb){try{if(_0x280720[_0x95da('0x30')]){_0x280720['Tags']=[];_0x280720['TagIds'][_0x95da('0x31')](',')[_0x95da('0x32')](function(_0xb2aaa1){_0x280720[_0x95da('0x33')][_0x95da('0x34')](_0xfd9239[_0xb2aaa1]);});}delete _0x280720[_0x95da('0x30')];}catch(_0x6368f7){_0x1e0eb(_0x6368f7);}_0x3b182b(_0x280720);});}function updateFaxInteraction(_0x349484,_0x28ed67,_0x5c8546){return new BPromise(function(_0x52eefa,_0x5418ee){return getInteractionUsers(_0x349484,_0x5c8546)[_0x95da('0x28')](function(_0x48e67d){return getInteractionTags(_0x48e67d,_0x28ed67);})['then'](function(_0x271e52){return getStateInteraction(_0x271e52);})[_0x95da('0x28')](function(_0x1b2387){_0x52eefa(_0x1b2387);})[_0x95da('0x35')](function(_0x53be78){_0x5418ee(_0x53be78);});});}function getStateInteraction(_0x2a692a){return new BPromise(function(_0x75a654){_0x2a692a['waiting']=0x0;_0x2a692a[_0x95da('0x36')]=0x0;_0x2a692a[_0x95da('0x37')]=0x0;_0x2a692a['unmanaged']=0x0;_0x2a692a[_0x95da('0x38')]=0x0;if(!_0x2a692a[_0x95da('0x39')]&&!_0x2a692a['UserId']){_0x2a692a['waiting']+=0x1;}if(!_0x2a692a[_0x95da('0x39')]&&_0x2a692a[_0x95da('0x3a')]){_0x2a692a[_0x95da('0x36')]+=0x1;if(_0x2a692a[_0x95da('0x3b')]){_0x2a692a[_0x95da('0x3b')]-=0x1;}}if(_0x2a692a[_0x95da('0x39')]&&_0x2a692a[_0x95da('0x3a')]){_0x2a692a['answered']+=0x1;if(_0x2a692a[_0x95da('0x36')]){_0x2a692a[_0x95da('0x36')]-=0x1;}}if(_0x2a692a[_0x95da('0x39')]&&!_0x2a692a[_0x95da('0x3a')]){_0x2a692a['unmanaged']+=0x1;if(_0x2a692a[_0x95da('0x3b')]){_0x2a692a[_0x95da('0x3b')]-=0x1;}}_0x2a692a[_0x95da('0x38')]+=0x1;_0x75a654(_0x2a692a);});}exports[_0x95da('0x3c')]=function(_0x235d54,_0x366d4f){var _0x401399={},_0x150fb7={},_0x5504fd={'count':0x0,'rows':[]};var _0x54e84c=_[_0x95da('0x2e')](db[_0x95da('0x3d')][_0x95da('0x3e')],function(_0x1d86d8){return{'name':_0x1d86d8[_0x95da('0x3f')],'type':_0x1d86d8['type']['key']};});_0x150fb7[_0x95da('0x40')]=_[_0x95da('0x2e')](_0x54e84c,_0x95da('0x2b'));_0x150fb7[_0x95da('0x41')]=_[_0x95da('0x42')](_0x235d54[_0x95da('0x41')]);_0x150fb7['filters']=_[_0x95da('0x43')](_0x150fb7[_0x95da('0x40')],_0x150fb7[_0x95da('0x41')]);_0x401399['attributes']=_[_0x95da('0x43')](_0x150fb7['model'],qs[_0x95da('0x44')](_0x235d54['query']['fields']));_0x401399[_0x95da('0x45')]=_0x401399[_0x95da('0x45')][_0x95da('0x46')]?_0x401399['attributes']:_0x150fb7[_0x95da('0x40')];if(!_0x235d54[_0x95da('0x41')]['hasOwnProperty'](_0x95da('0x47'))){_0x401399['limit']=qs[_0x95da('0x23')](_0x235d54[_0x95da('0x41')][_0x95da('0x23')]);_0x401399[_0x95da('0x24')]=qs[_0x95da('0x24')](_0x235d54[_0x95da('0x41')][_0x95da('0x24')]);}_0x401399[_0x95da('0x48')]=qs[_0x95da('0x49')](_0x235d54['query'][_0x95da('0x49')]);_0x401399['where']=qs[_0x95da('0x4a')](_[_0x95da('0x4b')](_0x235d54[_0x95da('0x41')],_0x150fb7[_0x95da('0x4a')]),_0x54e84c);var _0x343c0a=[];var _0x5aac6c=squel[_0x95da('0x4c')]()[_0x95da('0x4d')]('id')[_0x95da('0x4d')](_0x95da('0x2b'))[_0x95da('0x4d')](_0x95da('0x4e'))['from']('tools_tags');var _0x27b03f=squel[_0x95da('0x4c')]()[_0x95da('0x4d')](_0x95da('0x4f'))['field'](_0x95da('0x50'))[_0x95da('0x4d')]('ui.FaxInteractionId')[_0x95da('0x51')]('user_has_fax_interactions','ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x2f24d1=squel[_0x95da('0x4c')]()[_0x95da('0x51')]('fax_interactions','i')[_0x95da('0x52')](_0x95da('0x53'),'c',_0x95da('0x54'))[_0x95da('0x52')](_0x95da('0x55'),'o',_0x95da('0x56'))['left_join'](_0x95da('0x57'),'a',_0x95da('0x58'))[_0x95da('0x52')](_0x95da('0x59'),'me',_0x95da('0x5a'))['left_join']('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x95da('0x52')](_0x95da('0x5b'),'t','t.id\x20=\x20it.TagId');var _0x147698=squel[_0x95da('0x5c')]();var _0x4a0140=[];var _0x3a8b8b=squel[_0x95da('0x5c')]();var _0xa66b2a;if(_0x235d54['query'][_0x95da('0x5d')]){_0xa66b2a=as['parseSearch'](_0x235d54[_0x95da('0x41')]['search']);var _0x3a6c57=_0xa66b2a[_0x95da('0x5e')];for(var _0xd3eaa5=0x0;_0xd3eaa5<_0xa66b2a[_0x95da('0x5f')][_0x95da('0x46')];_0xd3eaa5++){var _0x83847d=_0xa66b2a['conditions'][_0xd3eaa5];var _0x545502='i';var _0x120744=_['find'](_0x54e84c,[_0x95da('0x2b'),_0x83847d[_0x95da('0x4d')]]);if(!_0x120744){switch(_0x83847d[_0x95da('0x4d')]){case _0x95da('0x60'):if(_0x83847d[_0x95da('0x61')]==0x1){_0x2f24d1[_0x95da('0x62')]('`'+_0x83847d[_0x95da('0x4d')]+_0x95da('0x63'));}else{_0x2f24d1['having']('`'+_0x83847d['field']+_0x95da('0x64'));}break;case'Contact':if(_0x83847d[_0x95da('0x65')]===_0x95da('0x66')){if(_0x83847d[_0x95da('0x61')][_0x95da('0x31')]('\x20')['length']>0x1){_0x147698[_0x3a6c57](_0x95da('0x67'),qs[_0x95da('0x68')](_0x83847d[_0x95da('0x61')]),null);}else{var _0x4bb556='%'+_0x83847d['value']+'%';_0x147698[_0x3a6c57](_0x95da('0x69'),_0x4bb556,_0x4bb556,_0x4bb556);}}else{_0x120744=_[_0x95da('0x6a')](_0x54e84c,[_0x95da('0x2b'),_0x95da('0x6b')]);_0x83847d[_0x95da('0x4d')]=_0x95da('0x6b');_0xd14369=as['buildExpression'](_0x545502,_0x120744['type'],_0x83847d);_0x147698[_0x3a6c57](_0xd14369['text'],_0xd14369[_0x95da('0x61')]['start'],_0xd14369[_0x95da('0x61')][_0x95da('0x20')]);}break;case _0x95da('0x6c'):var _0x2f07b9=_0x83847d[_0x95da('0x61')][_0x95da('0x31')](',')['map'](function(_0x278d4e){return Number(_0x278d4e);});_0x2f07b9['forEach'](function(_0xfeece0){_0x3a8b8b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfeece0+',%');});_0x4a0140=_[_0x95da('0x6d')](_0x4a0140,_0x2f07b9);break;case _0x95da('0x6e'):if(_0x83847d[_0x95da('0x65')]==='$substring'){_0x147698[_0x3a6c57](_0x95da('0x6f'),'%'+_0x83847d[_0x95da('0x61')]+'%',null);}else{_0x120744=_['find'](_0x54e84c,[_0x95da('0x2b'),_0x95da('0x3a')]);_0x83847d[_0x95da('0x4d')]=_0x95da('0x3a');_0xd14369=as['buildExpression'](_0x545502,_0x120744[_0x95da('0x70')],_0x83847d);_0x147698[_0x3a6c57](_0xd14369['text'],_0xd14369[_0x95da('0x61')][_0x95da('0x71')],_0xd14369[_0x95da('0x61')][_0x95da('0x20')]);}break;case'body':_0xd14369=as[_0x95da('0x72')]('me',null,_0x83847d);_0x147698[_0x3a6c57](_0xd14369['text'],_0xd14369[_0x95da('0x61')][_0x95da('0x71')],_0xd14369[_0x95da('0x61')][_0x95da('0x20')]);break;}}else{var _0xd14369=as[_0x95da('0x72')](_0x545502,_0x120744[_0x95da('0x70')],_0x83847d);_0x147698[_0x3a6c57](_0xd14369[_0x95da('0x73')],_0xd14369[_0x95da('0x61')][_0x95da('0x71')],_0xd14369[_0x95da('0x61')][_0x95da('0x20')]);}}}else{var _0x1834e9=_(_0x235d54[_0x95da('0x41')])[_0x95da('0x42')]()[_0x95da('0x2e')](function(_0x862b62){return _[_0x95da('0x74')](_0x54e84c,[_0x95da('0x2b'),_0x862b62])?_0x862b62:undefined;})[_0x95da('0x75')]()['value']();if(!_['isEmpty'](_0x1834e9)){_0x1834e9[_0x95da('0x32')](function(_0x4a2137){if(_0x4a2137==='FaxAccountId'){_0x2f24d1[_0x95da('0x76')](_0x95da('0x77'),[][_0x95da('0x78')](_0x235d54[_0x95da('0x41')][_0x4a2137]));}else if(_0x4a2137===_0x95da('0x79')){var _0x4d6c62=JSON[_0x95da('0x7a')](_0x235d54[_0x95da('0x41')][_0x4a2137])[_0x95da('0x7b')];var _0x37fbd8=JSON[_0x95da('0x7a')](_0x235d54[_0x95da('0x41')][_0x4a2137])[_0x95da('0x7c')];_0x2f24d1['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4d6c62,_0x37fbd8);}else{if(_0x235d54[_0x95da('0x41')][_0x4a2137]===_0x95da('0x7d')){_0x2f24d1[_0x95da('0x76')]('i.'+_0x4a2137+_0x95da('0x7e'));}else{_0x2f24d1[_0x95da('0x76')]('i.'+_0x4a2137+_0x95da('0x7f'),_0x235d54[_0x95da('0x41')][_0x4a2137]);}}});}if(_0x235d54[_0x95da('0x41')]['read']){if(_0x235d54[_0x95da('0x41')][_0x95da('0x80')]==0x1){_0x2f24d1['having'](_0x95da('0x81'));}else{_0x2f24d1[_0x95da('0x62')](_0x95da('0x82'));}}if(_0x235d54[_0x95da('0x41')][_0x95da('0x83')]){_0x4a0140=_['isArray'](_0x235d54[_0x95da('0x41')]['tag'])?_0x235d54[_0x95da('0x41')][_0x95da('0x83')]:new Array(_0x235d54['query'][_0x95da('0x83')]);_0x4a0140[_0x95da('0x32')](function(_0x2f5a52){_0x3a8b8b['or'](_0x95da('0x84'),'%,'+_0x2f5a52+',%');});}if(_0x235d54[_0x95da('0x41')][_0x95da('0x85')]){var _0x45c8eb=_0x235d54[_0x95da('0x41')][_0x95da('0x85')][_0x95da('0x86')]('\x5c','\x5c\x5c')[_0x95da('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x45c8eb)){_0x147698['or'](_0x95da('0x87'),_0x45c8eb+'%')['or'](_0x95da('0x88'),_0x45c8eb+'%');}_0x147698['or'](_0x95da('0x89'),_0x45c8eb+'%');}}_0x2f24d1[_0x95da('0x76')](_0x147698);_0x2f24d1[_0x95da('0x8a')]('i.id');var _0x161edc={'type':db['Sequelize'][_0x95da('0x8b')][_0x95da('0x8c')],'raw':!![]};var _0x11a711=_0x2f24d1[_0x95da('0x8d')]();_0x11a711[_0x95da('0x4d')]('i.id');_0x11a711[_0x95da('0x4d')](_0x95da('0x8e'),_0x95da('0x60'));if(_0x401399[_0x95da('0x48')]){_0x401399['order'][_0x95da('0x32')](function(_0x5281ae){var _0x2202d3=_0x5281ae[0x0]===_0x95da('0x8f')?_0x5281ae[0x0]:'i.'+_0x5281ae[0x0];_0x2f24d1['order'](_0x2202d3,_0x5281ae[0x1]===_0x95da('0x90')?![]:!![]);});}if(!_[_0x95da('0x91')](_0x4a0140)){_0x2f24d1[_0x95da('0x62')](_0x3a8b8b);_0x11a711[_0x95da('0x76')](_0x95da('0x92'),_0x4a0140);}BPromise[_0x95da('0x93')]()[_0x95da('0x28')](function(){if(!_0xa66b2a){if(_0x235d54[_0x95da('0x41')]['FaxAccountId'])return;_0x11a711['where'](_0x95da('0x94'));_0x2f24d1[_0x95da('0x76')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x235d54[_0x95da('0x95')][_0x95da('0x96')]!=='agent')return;return _0x235d54[_0x95da('0x95')][_0x95da('0x97')]({'attributes':['id'],'raw':!![]})[_0x95da('0x28')](function(_0x1c60a9){if(_[_0x95da('0x91')](_0x1c60a9)){_0x11a711[_0x95da('0x76')](_0x95da('0x98'));_0x2f24d1['where'](_0x95da('0x98'));}else{_0x11a711[_0x95da('0x76')](_0x95da('0x77'),_['map'](_0x1c60a9,'id'));_0x2f24d1['where'](_0x95da('0x77'),_[_0x95da('0x2e')](_0x1c60a9,'id'));}});})[_0x95da('0x28')](function(){if(_0x235d54['user'][_0x95da('0x96')]===_0x95da('0x99')&&!_0xa66b2a&&!_0x235d54[_0x95da('0x41')][_0x95da('0x9a')])return[];return db['sequelize'][_0x95da('0x41')](_0x11a711[_0x95da('0x9b')](),_0x161edc);})['then'](function(_0x5b7148){_0x5504fd['count']=_0x5b7148[_0x95da('0x46')];if(_0x5504fd['count']===0x0)return[];return db['sequelize'][_0x95da('0x41')](_0x5aac6c['toString'](),_0x161edc)[_0x95da('0x28')](function(_0x5e4f0f){_0x343c0a=_[_0x95da('0x9c')](_0x5e4f0f,'id');_0x161edc=_['merge'](_0x161edc,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x235d54[_0x95da('0x41')]['fields']){_0x401399[_0x95da('0x45')]['forEach'](function(_0x1ee3da){_0x2f24d1[_0x95da('0x4d')]('i.'+_0x1ee3da);});}else{_0x2f24d1['field'](_0x95da('0x8e'),_0x95da('0x60'));_0x2f24d1[_0x95da('0x4d')]('a.key',_0x95da('0x9d'));_0x2f24d1[_0x95da('0x4d')]('a.mandatoryDisposition',_0x95da('0x9e'));_0x2f24d1['field'](_0x95da('0x9f'),_0x95da('0x8f'));_0x2f24d1[_0x95da('0x4d')](_0x95da('0xa0'));_0x2f24d1['field'](_0x95da('0xa1'),_0x95da('0xa2'));_0x2f24d1[_0x95da('0x4d')](_0x95da('0xa3'),_0x95da('0xa4'));_0x2f24d1['field'](_0x95da('0xa5'),_0x95da('0xa6'));_0x2f24d1['field'](_0x95da('0xa7'),_0x95da('0xa8'));_0x2f24d1['field'](_0x95da('0xa9'),_0x95da('0xaa'));_0x2f24d1[_0x95da('0x4d')]('c.fax',_0x95da('0xab'));_0x2f24d1[_0x95da('0x4d')](_0x95da('0xac'),_0x95da('0xad'));_0x2f24d1[_0x95da('0x4d')]('o.internal',_0x95da('0xae'));_0x2f24d1[_0x95da('0x4d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x95da('0x30'));}if(_0x401399[_0x95da('0x23')])_0x2f24d1[_0x95da('0x23')](_0x401399[_0x95da('0x23')]);if(_0x401399[_0x95da('0x24')])_0x2f24d1[_0x95da('0x24')](_0x401399[_0x95da('0x24')]);return db['sequelize'][_0x95da('0x41')](_0x2f24d1[_0x95da('0x9b')](),_0x161edc);})[_0x95da('0x28')](function(_0x9a7b5c){if(_0x9a7b5c[_0x95da('0x46')]>0x0)_0x27b03f[_0x95da('0x76')](_0x95da('0xaf'),_[_0x95da('0x2e')](_0x9a7b5c,'id'));return db[_0x95da('0xb0')]['query'](_0x27b03f[_0x95da('0x9b')](),_0x161edc)[_0x95da('0x28')](function(_0x2efe80){var _0x1214eb=_[_0x95da('0xb1')](_0x2efe80,_0x95da('0xb2'));var _0x58505e=[];_0x9a7b5c[_0x95da('0x32')](function(_0x3c8a6e){_0x58505e[_0x95da('0x34')](updateFaxInteraction(_0x3c8a6e,_0x343c0a,_0x1214eb));});return BPromise[_0x95da('0xb3')](_0x58505e);});});})[_0x95da('0x28')](function(_0x357bd6){_0x5504fd['rows']=_0x357bd6;return _0x5504fd;})[_0x95da('0x28')](respondWithFilteredResult(_0x366d4f,_0x401399))[_0x95da('0x35')](handleError(_0x366d4f,null));};exports[_0x95da('0xb4')]=function(_0x304c7b,_0x59cdf4){var _0x3f557a={'raw':![],'where':{'id':_0x304c7b['params']['id']}},_0x4c6e81={};_0x4c6e81[_0x95da('0x40')]=_['keys'](db[_0x95da('0x3d')][_0x95da('0x3e')]);_0x4c6e81['query']=_['keys'](_0x304c7b[_0x95da('0x41')]);_0x4c6e81['filters']=_['intersection'](_0x4c6e81[_0x95da('0x40')],_0x4c6e81[_0x95da('0x41')]);_0x3f557a['attributes']=_[_0x95da('0x43')](_0x4c6e81[_0x95da('0x40')],qs[_0x95da('0x44')](_0x304c7b[_0x95da('0x41')]['fields']));_0x3f557a[_0x95da('0x45')]=_0x3f557a[_0x95da('0x45')][_0x95da('0x46')]?_0x3f557a[_0x95da('0x45')]:_0x4c6e81[_0x95da('0x40')];if(_0x304c7b[_0x95da('0x41')][_0x95da('0xb5')]){_0x3f557a['include']=[{'all':!![]}];}_0x3f557a=_[_0x95da('0xb6')]({},_0x3f557a,_0x304c7b[_0x95da('0xb7')]);return db['FaxInteraction'][_0x95da('0x6a')](_0x3f557a)[_0x95da('0x28')](handleEntityNotFound(_0x59cdf4,null))[_0x95da('0x28')](respondWithResult(_0x59cdf4,null))[_0x95da('0x35')](handleError(_0x59cdf4,null));};exports['create']=function(_0x238f15,_0x3cd080){return db[_0x95da('0x3d')][_0x95da('0xb8')](_0x238f15[_0x95da('0xb9')],{})['then'](respondWithResult(_0x3cd080,0xc9))[_0x95da('0x35')](handleError(_0x3cd080,null));};exports[_0x95da('0x27')]=function(_0x512137,_0x1d0fb9){if(_0x512137['body']['id']){delete _0x512137[_0x95da('0xb9')]['id'];}return db[_0x95da('0x3d')][_0x95da('0x6a')]({'where':{'id':_0x512137['params']['id']}})[_0x95da('0x28')](handleEntityNotFound(_0x1d0fb9,null))['then'](saveUpdates(_0x512137['body'],null))[_0x95da('0x28')](respondWithResult(_0x1d0fb9,null))[_0x95da('0x35')](handleError(_0x1d0fb9,null));};exports[_0x95da('0x29')]=function(_0x27797d,_0x561fa8){return db[_0x95da('0x3d')][_0x95da('0x6a')]({'where':{'id':_0x27797d[_0x95da('0xba')]['id']}})[_0x95da('0x28')](handleEntityNotFound(_0x561fa8,null))[_0x95da('0x28')](removeEntity(_0x561fa8,null))[_0x95da('0x35')](handleError(_0x561fa8,null));};exports[_0x95da('0xbb')]=function(_0x88d8d4,_0x340e88){return db[_0x95da('0x3d')][_0x95da('0xbb')]()[_0x95da('0x28')](respondWithResult(_0x340e88,null))[_0x95da('0x35')](handleError(_0x340e88,null));};exports[_0x95da('0xbc')]=function(_0x21bb2,_0x19f7cd,_0x1ddca4){return db[_0x95da('0xbd')]['find']({'where':{'id':_0x21bb2[_0x95da('0xba')]['id']}})[_0x95da('0x28')](handleEntityNotFound(_0x19f7cd,null))[_0x95da('0x28')](function(_0x2106c0){if(_0x2106c0){return _0x2106c0[_0x95da('0xbc')](_0x21bb2[_0x95da('0xb9')]['ids'],_['omit'](_0x21bb2[_0x95da('0xb9')],['ids','id'])||{});}})['then'](respondWithResult(_0x19f7cd,null))[_0x95da('0x35')](handleError(_0x19f7cd,null));};exports[_0x95da('0xbe')]=function(_0x527df8,_0x38d6ef,_0x11eefe){var _0x18e67e={'raw':![],'where':{}};var _0x23be5c={};var _0x2a87e2={'count':0x0,'rows':[]};return db[_0x95da('0x3d')][_0x95da('0xbf')]({'where':{'id':_0x527df8[_0x95da('0xba')]['id']}})[_0x95da('0x28')](handleEntityNotFound(_0x38d6ef,null))[_0x95da('0x28')](function(_0x58811c){if(_0x58811c){_0x23be5c[_0x95da('0x40')]=_[_0x95da('0x42')](db[_0x95da('0xbd')][_0x95da('0x3e')]);_0x23be5c['query']=_[_0x95da('0x42')](_0x527df8[_0x95da('0x41')]);_0x23be5c[_0x95da('0x4a')]=_['intersection'](_0x23be5c[_0x95da('0x40')],_0x23be5c[_0x95da('0x41')]);_0x18e67e['attributes']=_['intersection'](_0x23be5c['model'],qs['fields'](_0x527df8[_0x95da('0x41')][_0x95da('0x44')]));_0x18e67e['attributes']=_0x18e67e[_0x95da('0x45')][_0x95da('0x46')]?_0x18e67e[_0x95da('0x45')]:_0x23be5c['model'];if(!_0x527df8[_0x95da('0x41')]['hasOwnProperty'](_0x95da('0x47'))){_0x18e67e[_0x95da('0x23')]=qs[_0x95da('0x23')](_0x527df8['query'][_0x95da('0x23')]);_0x18e67e[_0x95da('0x24')]=qs[_0x95da('0x24')](_0x527df8[_0x95da('0x41')]['offset']);}_0x18e67e[_0x95da('0x48')]=qs['sort'](_0x527df8[_0x95da('0x41')][_0x95da('0x49')]);_0x18e67e[_0x95da('0x76')]=qs['filters'](_['pick'](_0x527df8[_0x95da('0x41')],_0x23be5c[_0x95da('0x4a')]));_0x18e67e[_0x95da('0x76')][_0x95da('0xb2')]=_0x58811c['id'];if(_0x527df8[_0x95da('0x41')][_0x95da('0x85')]){_0x18e67e[_0x95da('0x76')]=_[_0x95da('0xb6')](_0x18e67e[_0x95da('0x76')],{'$or':_['map'](_0x18e67e[_0x95da('0x45')],function(_0xd10a95){var _0x5dc2de={};_0x5dc2de[_0xd10a95]={'$like':'%'+_0x527df8['query'][_0x95da('0x85')]+'%'};return _0x5dc2de;})});}if(_0x527df8['query']['$gte']){var _0x12eacb=_0x527df8[_0x95da('0x41')][_0x95da('0x7b')][_0x95da('0x31')](',');var _0x40bdef={};_0x40bdef[_0x12eacb[0x0]]={'$gte':moment(_0x12eacb[0x1])[_0x95da('0xc0')](_0x95da('0xc1'))};_0x18e67e[_0x95da('0x76')]=_[_0x95da('0xb6')](_0x18e67e['where'],_0x40bdef);}_0x18e67e=_[_0x95da('0xb6')]({},_0x18e67e,_0x527df8['options']);return db[_0x95da('0xbd')][_0x95da('0xc2')]({'where':_0x18e67e['where']})['then'](function(_0x32bd4a){_0x2a87e2[_0x95da('0xc2')]=_0x32bd4a;if(_0x527df8[_0x95da('0x41')][_0x95da('0xb5')]){_0x18e67e['include']=[{'all':!![]}];}return db[_0x95da('0xbd')][_0x95da('0xc3')](_0x18e67e);})[_0x95da('0x28')](function(_0x16f2e0){_0x2a87e2[_0x95da('0xc4')]=_0x16f2e0;return _0x2a87e2;});}})[_0x95da('0x28')](respondWithFilteredResult(_0x38d6ef,_0x18e67e))[_0x95da('0x35')](handleError(_0x38d6ef,null));};exports[_0x95da('0xc5')]=function(_0x37ee5b,_0x35eca4,_0x3dd0de){return db['FaxInteraction'][_0x95da('0x6a')]({'where':{'id':_0x37ee5b[_0x95da('0xba')]['id']}})[_0x95da('0x28')](handleEntityNotFound(_0x35eca4,null))[_0x95da('0x28')](function(_0x3e7b4b){if(_0x3e7b4b){return _0x3e7b4b['setTags'](_0x37ee5b[_0x95da('0xb9')]['ids'],_[_0x95da('0xc6')](_0x37ee5b[_0x95da('0xb9')],[_0x95da('0xc7'),'id'])||{})[_0x95da('0xc8')](function(){return db[_0x95da('0x6c')][_0x95da('0xc3')]({'attributes':['id','name',_0x95da('0x4e')],'where':{'id':_0x37ee5b[_0x95da('0xb9')][_0x95da('0xc7')]}});})['then'](function(_0x59390c){socket[_0x95da('0xc9')]('faxInteractionTags:save',{'id':Number(_0x37ee5b[_0x95da('0xba')]['id']),'tags':_0x59390c||[]});return{'id':Number(_0x37ee5b['params']['id']),'tags':_0x59390c||[]};});}})[_0x95da('0x28')](respondWithResult(_0x35eca4,null))['catch'](handleError(_0x35eca4,null));};exports[_0x95da('0xca')]=function(_0x27ddcb,_0x5b1101,_0x9f92){return db[_0x95da('0x3d')][_0x95da('0x6a')]({'where':{'id':_0x27ddcb[_0x95da('0xba')]['id']}})[_0x95da('0x28')](handleEntityNotFound(_0x5b1101,null))[_0x95da('0x28')](function(_0x3eeee5){if(_0x3eeee5){return _0x3eeee5[_0x95da('0xca')](_0x27ddcb[_0x95da('0x41')]['ids']);}})[_0x95da('0x28')](respondWithStatusCode(_0x5b1101,null))[_0x95da('0x35')](handleError(_0x5b1101,null));};exports[_0x95da('0xcb')]=function(_0x3bc185,_0x1b5fb0){var _0xc3eaec=moment()[_0x95da('0xcc')]()[_0x95da('0x9b')]();var _0x188ae7=path[_0x95da('0xcd')](config[_0x95da('0xce')],_0x95da('0xcf'),_0x95da('0xd0'),'tmp');var _0x30d478=path['join'](config['root'],_0x95da('0xcf'),_0x95da('0xd0'),_0x95da('0xd1'));var _0x1b9daa=path[_0x95da('0xcd')](_0x188ae7,_0xc3eaec);var _0x2b63fb=util[_0x95da('0xc0')](_0x95da('0xd2'),_0x3bc185[_0x95da('0xba')]['id'],_0xc3eaec);var _0x3851b2=path[_0x95da('0xcd')](_0x188ae7,_0x2b63fb);var _0x3e6142=[];_0x3e6142[_0x95da('0x34')]({'model':db[_0x95da('0xd3')],'as':_0x95da('0xd3'),'raw':!![]});var _0x1c1420=[{'model':db[_0x95da('0xbd')],'as':_0x95da('0xd4'),'attributes':['id',_0x95da('0xb9'),'createdAt'],'include':_0x3e6142}];return db[_0x95da('0x3d')][_0x95da('0x6a')]({'where':{'id':_0x3bc185[_0x95da('0xba')]['id']},'include':_0x1c1420})[_0x95da('0x28')](handleEntityNotFound(_0x1b5fb0,null))[_0x95da('0x28')](function(_0x5188fe){if(_0x5188fe&&_0x5188fe[_0x95da('0xd4')]){var _0x17048b=_0x5188fe[_0x95da('0xd5')]({'plain':!![]});fs[_0x95da('0xd6')](_0x1b9daa);for(var _0x5044cf=0x0;_0x5044cf<_0x17048b[_0x95da('0xd4')][_0x95da('0x46')];_0x5044cf++){var _0x45e76b=_0x17048b[_0x95da('0xd4')][_0x5044cf][_0x95da('0xd3')];if(_0x45e76b){var _0x26808f=path[_0x95da('0xcd')](_0x30d478,_0x45e76b[_0x95da('0xd7')]);if(fs[_0x95da('0xd8')](_0x26808f)){fs[_0x95da('0xd9')](_0x26808f)[_0x95da('0xda')](fs[_0x95da('0xdb')](path[_0x95da('0xcd')](_0x1b9daa,_0x45e76b[_0x95da('0xd7')])));}}}return BPromise[_0x95da('0x93')]()[_0x95da('0x28')](function(){return new BPromise(function(_0x90fe01,_0x186bba){zipdir(_0x1b9daa,{'saveTo':_0x3851b2},function(_0x180ad3,_0xc4e83c){if(_0x180ad3)return _0x186bba(_0x180ad3);return _0x90fe01(_0xc4e83c);});})[_0x95da('0x28')](function(){return new BPromise(function(_0x1ebf91,_0x11e54f){rimraf(_0x1b9daa,function(_0x35e49a){if(_0x35e49a)_0x11e54f(_0x35e49a);return _0x1ebf91();});});})[_0x95da('0x28')](function(){return _0x1b5fb0[_0x95da('0xcb')](_0x3851b2,_0x2b63fb,function(_0x63f04b){if(_0x63f04b){console[_0x95da('0xdc')](_0x95da('0xdd'),_0x63f04b);}else{fs[_0x95da('0xde')](_0x3851b2);}});});});}else{return _0x1b5fb0['sendStatus'](0xc8);}})[_0x95da('0x35')](handleError(_0x1b5fb0,null));}; \ No newline at end of file +var _0x3ff4=['`\x20=\x200','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','intersection','includeAll','include','options','create','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','FaxInteractionId','merge','YYYY-MM-DD\x20HH:mm:ss','addTags','findAll','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','createReadStream','createWriteStream','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','talking','answered','unmanaged','UserId','waiting','closed','total','index','FaxInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','ui.FaxInteractionId','left_join','users','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having'];(function(_0x444535,_0x576ae8){var _0x563a96=function(_0x56ec0b){while(--_0x56ec0b){_0x444535['push'](_0x444535['shift']());}};_0x563a96(++_0x576ae8);}(_0x3ff4,0x79));var _0x43ff=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x3ff4[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0x43ff('0x0'));var rimraf=require(_0x43ff('0x1'));var zipdir=require(_0x43ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43ff('0x3'));var moment=require(_0x43ff('0x4'));var BPromise=require(_0x43ff('0x5'));var Mustache=require(_0x43ff('0x6'));var util=require('util');var path=require(_0x43ff('0x7'));var sox=require(_0x43ff('0x8'));var csv=require('to-csv');var ejs=require(_0x43ff('0x9'));var fs=require('fs');var fs_extra=require(_0x43ff('0xa'));var _=require('lodash');var squel=require(_0x43ff('0xb'));var crypto=require(_0x43ff('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x43ff('0xd'));var querystring=require(_0x43ff('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x43ff('0xf'));var qs=require(_0x43ff('0x10'));var as=require(_0x43ff('0x11'));var hardwareService=require(_0x43ff('0x12'));var logger=require(_0x43ff('0x13'))(_0x43ff('0x14'));var utils=require(_0x43ff('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x43ff('0x16'));var db=require('../../mysqldb')['db'];config[_0x43ff('0x17')]=_[_0x43ff('0x18')](config['redis'],{'host':_0x43ff('0x19'),'port':0x18eb});var socket=require(_0x43ff('0x1a'))(new Redis(config['redis']));require(_0x43ff('0x1b'))[_0x43ff('0x1c')](socket);function respondWithStatusCode(_0x531994,_0x2a0eb8){_0x2a0eb8=_0x2a0eb8||0xcc;return function(_0x25785a){if(_0x25785a){return _0x531994['sendStatus'](_0x2a0eb8);}return _0x531994[_0x43ff('0x1d')](_0x2a0eb8)['end']();};}function respondWithResult(_0x517616,_0x1c4da5){_0x1c4da5=_0x1c4da5||0xc8;return function(_0x31e0ce){if(_0x31e0ce){return _0x517616[_0x43ff('0x1d')](_0x1c4da5)[_0x43ff('0x1e')](_0x31e0ce);}};}function respondWithFilteredResult(_0x21358e,_0xdf8fe1){return function(_0x1fb51e){if(_0x1fb51e){var _0x24d531=typeof _0xdf8fe1[_0x43ff('0x1f')]===_0x43ff('0x20')&&typeof _0xdf8fe1[_0x43ff('0x21')]===_0x43ff('0x20');var _0x4c0dc2=_0x1fb51e[_0x43ff('0x22')];var _0x409442=_0x24d531?0x0:_0xdf8fe1[_0x43ff('0x1f')];var _0x5c7d11=_0x24d531?_0x1fb51e[_0x43ff('0x22')]:_0xdf8fe1[_0x43ff('0x1f')]+_0xdf8fe1[_0x43ff('0x21')];var _0xdfae2c;if(_0x5c7d11>=_0x4c0dc2){_0x5c7d11=_0x4c0dc2;_0xdfae2c=0xc8;}else{_0xdfae2c=0xce;}_0x21358e[_0x43ff('0x1d')](_0xdfae2c);return _0x21358e[_0x43ff('0x23')](_0x43ff('0x24'),_0x409442+'-'+_0x5c7d11+'/'+_0x4c0dc2)[_0x43ff('0x1e')](_0x1fb51e);}return null;};}function patchUpdates(_0x50274c){return function(_0x30543b){try{jsonpatch[_0x43ff('0x25')](_0x30543b,_0x50274c,!![]);}catch(_0x45f3d2){return BPromise[_0x43ff('0x26')](_0x45f3d2);}return _0x30543b[_0x43ff('0x27')]();};}function saveUpdates(_0x53fd0f,_0x38c282){return function(_0x1a2550){if(_0x1a2550){return _0x1a2550[_0x43ff('0x28')](_0x53fd0f)[_0x43ff('0x29')](function(_0xa885e){return _0xa885e;});}return null;};}function removeEntity(_0x9bdf3a,_0x2bea24){return function(_0x500373){if(_0x500373){return _0x500373[_0x43ff('0x2a')]()[_0x43ff('0x29')](function(){_0x9bdf3a[_0x43ff('0x1d')](0xcc)[_0x43ff('0x2b')]();});}};}function handleEntityNotFound(_0x2031b4,_0x3e09c6){return function(_0x196fbe){if(!_0x196fbe){_0x2031b4[_0x43ff('0x2c')](0x194);}return _0x196fbe;};}function handleError(_0x3e51e8,_0x3ab1d3){_0x3ab1d3=_0x3ab1d3||0x1f4;return function(_0x15c7a1){logger[_0x43ff('0x2d')](_0x15c7a1[_0x43ff('0x2e')]);if(_0x15c7a1[_0x43ff('0x2f')]){delete _0x15c7a1[_0x43ff('0x2f')];}_0x3e51e8['status'](_0x3ab1d3)['send'](_0x15c7a1);};}function getInteractionUsers(_0x5634fd,_0x5a7fe4){return new BPromise(function(_0x198f19,_0x4dbb67){try{if(_0x5a7fe4[_0x5634fd['id']]){_0x5634fd[_0x43ff('0x30')]=_[_0x43ff('0x31')](_0x5a7fe4[_0x5634fd['id']],function(_0x9df1d1){return{'id':_0x9df1d1['id'],'fullname':_0x9df1d1[_0x43ff('0x32')]};});}}catch(_0x35f089){_0x4dbb67(_0x35f089);}_0x198f19(_0x5634fd);});}function getInteractionTags(_0x25cb34,_0x3b58f5){return new BPromise(function(_0x5c3a7a,_0x52f4ec){try{if(_0x25cb34[_0x43ff('0x33')]){_0x25cb34[_0x43ff('0x34')]=[];_0x25cb34['TagIds'][_0x43ff('0x35')](',')[_0x43ff('0x36')](function(_0x14a452){_0x25cb34['Tags'][_0x43ff('0x37')](_0x3b58f5[_0x14a452]);});}delete _0x25cb34[_0x43ff('0x33')];}catch(_0xfdfe2a){_0x52f4ec(_0xfdfe2a);}_0x5c3a7a(_0x25cb34);});}function updateFaxInteraction(_0x5a2b81,_0x5ad657,_0x4c9a21){return new BPromise(function(_0x484f9a,_0x14cc0d){return getInteractionUsers(_0x5a2b81,_0x4c9a21)['then'](function(_0x26aca0){return getInteractionTags(_0x26aca0,_0x5ad657);})[_0x43ff('0x29')](function(_0x12e3c8){return getStateInteraction(_0x12e3c8);})['then'](function(_0x46e711){_0x484f9a(_0x46e711);})[_0x43ff('0x38')](function(_0x58967c){_0x14cc0d(_0x58967c);});});}function getStateInteraction(_0xf635b7){return new BPromise(function(_0x1caacf){_0xf635b7['waiting']=0x0;_0xf635b7[_0x43ff('0x39')]=0x0;_0xf635b7[_0x43ff('0x3a')]=0x0;_0xf635b7[_0x43ff('0x3b')]=0x0;_0xf635b7['total']=0x0;if(!_0xf635b7['closed']&&!_0xf635b7[_0x43ff('0x3c')]){_0xf635b7[_0x43ff('0x3d')]+=0x1;}if(!_0xf635b7[_0x43ff('0x3e')]&&_0xf635b7['UserId']){_0xf635b7[_0x43ff('0x39')]+=0x1;if(_0xf635b7[_0x43ff('0x3d')]){_0xf635b7['waiting']-=0x1;}}if(_0xf635b7[_0x43ff('0x3e')]&&_0xf635b7['UserId']){_0xf635b7['answered']+=0x1;if(_0xf635b7[_0x43ff('0x39')]){_0xf635b7[_0x43ff('0x39')]-=0x1;}}if(_0xf635b7['closed']&&!_0xf635b7[_0x43ff('0x3c')]){_0xf635b7['unmanaged']+=0x1;if(_0xf635b7[_0x43ff('0x3d')]){_0xf635b7[_0x43ff('0x3d')]-=0x1;}}_0xf635b7[_0x43ff('0x3f')]+=0x1;_0x1caacf(_0xf635b7);});}exports[_0x43ff('0x40')]=function(_0x2d6639,_0x568394){var _0x278ce6={},_0x590a4f={},_0x38cc52={'count':0x0,'rows':[]};var _0xa58735=_[_0x43ff('0x31')](db[_0x43ff('0x41')][_0x43ff('0x42')],function(_0x50373e){return{'name':_0x50373e[_0x43ff('0x43')],'type':_0x50373e['type'][_0x43ff('0x44')]};});_0x590a4f[_0x43ff('0x45')]=_['map'](_0xa58735,_0x43ff('0x2f'));_0x590a4f[_0x43ff('0x46')]=_[_0x43ff('0x47')](_0x2d6639[_0x43ff('0x46')]);_0x590a4f[_0x43ff('0x48')]=_['intersection'](_0x590a4f[_0x43ff('0x45')],_0x590a4f[_0x43ff('0x46')]);_0x278ce6[_0x43ff('0x49')]=_['intersection'](_0x590a4f[_0x43ff('0x45')],qs[_0x43ff('0x4a')](_0x2d6639[_0x43ff('0x46')]['fields']));_0x278ce6[_0x43ff('0x49')]=_0x278ce6['attributes'][_0x43ff('0x4b')]?_0x278ce6['attributes']:_0x590a4f['model'];if(!_0x2d6639[_0x43ff('0x46')][_0x43ff('0x4c')](_0x43ff('0x4d'))){_0x278ce6[_0x43ff('0x21')]=qs[_0x43ff('0x21')](_0x2d6639[_0x43ff('0x46')]['limit']);_0x278ce6['offset']=qs['offset'](_0x2d6639[_0x43ff('0x46')][_0x43ff('0x1f')]);}_0x278ce6[_0x43ff('0x4e')]=qs[_0x43ff('0x4f')](_0x2d6639[_0x43ff('0x46')][_0x43ff('0x4f')]);_0x278ce6[_0x43ff('0x50')]=qs['filters'](_['pick'](_0x2d6639[_0x43ff('0x46')],_0x590a4f[_0x43ff('0x48')]),_0xa58735);var _0x2bee10=[];var _0x3da970=squel[_0x43ff('0x51')]()[_0x43ff('0x52')]('id')['field'](_0x43ff('0x2f'))[_0x43ff('0x52')]('color')['from']('tools_tags');var _0x3e6f19=squel['select']()[_0x43ff('0x52')]('u.id')['field']('u.fullname')[_0x43ff('0x52')](_0x43ff('0x53'))['from']('user_has_fax_interactions','ui')[_0x43ff('0x54')](_0x43ff('0x55'),'u','u.id\x20=\x20ui.UserId');var _0x20ae66=squel[_0x43ff('0x51')]()[_0x43ff('0x56')]('fax_interactions','i')[_0x43ff('0x54')](_0x43ff('0x57'),'c',_0x43ff('0x58'))[_0x43ff('0x54')]('users','o',_0x43ff('0x59'))[_0x43ff('0x54')](_0x43ff('0x5a'),'a',_0x43ff('0x5b'))[_0x43ff('0x54')](_0x43ff('0x5c'),'me',_0x43ff('0x5d'))[_0x43ff('0x54')](_0x43ff('0x5e'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x43ff('0x54')](_0x43ff('0x5f'),'t',_0x43ff('0x60'));var _0x3d65c2=squel[_0x43ff('0x61')]();var _0x2ee478=[];var _0x82e6f3=squel[_0x43ff('0x61')]();var _0x3b3bd2;if(_0x2d6639['query'][_0x43ff('0x62')]){_0x3b3bd2=as[_0x43ff('0x63')](_0x2d6639['query'][_0x43ff('0x62')]);var _0x35d2c5=_0x3b3bd2[_0x43ff('0x64')];for(var _0x282cbe=0x0;_0x282cbe<_0x3b3bd2[_0x43ff('0x65')][_0x43ff('0x4b')];_0x282cbe++){var _0x5979e7=_0x3b3bd2['conditions'][_0x282cbe];var _0x580ba2='i';var _0x43b8aa=_[_0x43ff('0x66')](_0xa58735,['name',_0x5979e7[_0x43ff('0x52')]]);if(!_0x43b8aa){switch(_0x5979e7[_0x43ff('0x52')]){case _0x43ff('0x67'):if(_0x5979e7[_0x43ff('0x68')]==0x1){_0x20ae66[_0x43ff('0x69')]('`'+_0x5979e7['field']+_0x43ff('0x6a'));}else{_0x20ae66[_0x43ff('0x69')]('`'+_0x5979e7[_0x43ff('0x52')]+_0x43ff('0x6b'));}break;case'Contact':if(_0x5979e7[_0x43ff('0x6c')]===_0x43ff('0x6d')){if(_0x5979e7['value'][_0x43ff('0x35')]('\x20')[_0x43ff('0x4b')]>0x1){_0x3d65c2[_0x35d2c5]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x43ff('0x6e')](_0x5979e7['value']),null);}else{var _0x50ee0c='%'+_0x5979e7[_0x43ff('0x68')]+'%';_0x3d65c2[_0x35d2c5](_0x43ff('0x6f'),_0x50ee0c,_0x50ee0c,_0x50ee0c);}}else{_0x43b8aa=_[_0x43ff('0x66')](_0xa58735,[_0x43ff('0x2f'),_0x43ff('0x70')]);_0x5979e7[_0x43ff('0x52')]=_0x43ff('0x70');_0x5a605d=as[_0x43ff('0x71')](_0x580ba2,_0x43b8aa[_0x43ff('0x72')],_0x5979e7);_0x3d65c2[_0x35d2c5](_0x5a605d[_0x43ff('0x73')],_0x5a605d[_0x43ff('0x68')][_0x43ff('0x74')],_0x5a605d['value'][_0x43ff('0x2b')]);}break;case _0x43ff('0x75'):var _0xbe9cbb=_0x5979e7[_0x43ff('0x68')][_0x43ff('0x35')](',')[_0x43ff('0x31')](function(_0x455a48){return Number(_0x455a48);});_0xbe9cbb['forEach'](function(_0x479b00){_0x82e6f3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x479b00+',%');});_0x2ee478=_[_0x43ff('0x76')](_0x2ee478,_0xbe9cbb);break;case _0x43ff('0x77'):if(_0x5979e7['operator']===_0x43ff('0x6d')){_0x3d65c2[_0x35d2c5](_0x43ff('0x78'),'%'+_0x5979e7[_0x43ff('0x68')]+'%',null);}else{_0x43b8aa=_[_0x43ff('0x66')](_0xa58735,[_0x43ff('0x2f'),_0x43ff('0x3c')]);_0x5979e7[_0x43ff('0x52')]=_0x43ff('0x3c');_0x5a605d=as[_0x43ff('0x71')](_0x580ba2,_0x43b8aa['type'],_0x5979e7);_0x3d65c2[_0x35d2c5](_0x5a605d['text'],_0x5a605d[_0x43ff('0x68')][_0x43ff('0x74')],_0x5a605d[_0x43ff('0x68')][_0x43ff('0x2b')]);}break;case _0x43ff('0x79'):_0x5a605d=as[_0x43ff('0x71')]('me',null,_0x5979e7);_0x3d65c2[_0x35d2c5](_0x5a605d[_0x43ff('0x73')],_0x5a605d['value'][_0x43ff('0x74')],_0x5a605d[_0x43ff('0x68')][_0x43ff('0x2b')]);break;}}else{var _0x5a605d=as[_0x43ff('0x71')](_0x580ba2,_0x43b8aa[_0x43ff('0x72')],_0x5979e7);_0x3d65c2[_0x35d2c5](_0x5a605d['text'],_0x5a605d[_0x43ff('0x68')]['start'],_0x5a605d[_0x43ff('0x68')][_0x43ff('0x2b')]);}}}else{var _0x5d9e4d=_(_0x2d6639['query'])[_0x43ff('0x47')]()['map'](function(_0x48b15c){return _[_0x43ff('0x7a')](_0xa58735,['name',_0x48b15c])?_0x48b15c:undefined;})[_0x43ff('0x7b')]()[_0x43ff('0x68')]();if(!_[_0x43ff('0x7c')](_0x5d9e4d)){_0x5d9e4d[_0x43ff('0x36')](function(_0x5d02b3){if(_0x5d02b3===_0x43ff('0x7d')){_0x20ae66[_0x43ff('0x50')](_0x43ff('0x7e'),[]['concat'](_0x2d6639['query'][_0x5d02b3]));}else if(_0x5d02b3===_0x43ff('0x7f')){var _0x474889=JSON[_0x43ff('0x80')](_0x2d6639['query'][_0x5d02b3])[_0x43ff('0x81')];var _0x47309e=JSON[_0x43ff('0x80')](_0x2d6639[_0x43ff('0x46')][_0x5d02b3])[_0x43ff('0x82')];_0x20ae66[_0x43ff('0x50')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x474889,_0x47309e);}else{if(_0x2d6639[_0x43ff('0x46')][_0x5d02b3]===_0x43ff('0x83')){_0x20ae66[_0x43ff('0x50')]('i.'+_0x5d02b3+_0x43ff('0x84'));}else{_0x20ae66[_0x43ff('0x50')]('i.'+_0x5d02b3+'\x20=\x20?',_0x2d6639[_0x43ff('0x46')][_0x5d02b3]);}}});}if(_0x2d6639['query'][_0x43ff('0x85')]){if(_0x2d6639[_0x43ff('0x46')][_0x43ff('0x85')]==0x1){_0x20ae66[_0x43ff('0x69')](_0x43ff('0x86'));}else{_0x20ae66[_0x43ff('0x69')](_0x43ff('0x87'));}}if(_0x2d6639['query']['tag']){_0x2ee478=_[_0x43ff('0x88')](_0x2d6639[_0x43ff('0x46')][_0x43ff('0x89')])?_0x2d6639['query']['tag']:new Array(_0x2d6639['query']['tag']);_0x2ee478[_0x43ff('0x36')](function(_0x47aadf){_0x82e6f3['or'](_0x43ff('0x8a'),'%,'+_0x47aadf+',%');});}if(_0x2d6639['query'][_0x43ff('0x8b')]){var _0x4b3e6f=_0x2d6639[_0x43ff('0x46')][_0x43ff('0x8b')]['replace']('\x5c','\x5c\x5c')[_0x43ff('0x8c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4b3e6f)){_0x3d65c2['or'](_0x43ff('0x8d'),_0x4b3e6f+'%')['or']('i.fax\x20LIKE\x20?',_0x4b3e6f+'%');}_0x3d65c2['or'](_0x43ff('0x8e'),_0x4b3e6f+'%');}}_0x20ae66[_0x43ff('0x50')](_0x3d65c2);_0x20ae66[_0x43ff('0x8f')](_0x43ff('0x90'));var _0x1d4561={'type':db[_0x43ff('0x91')][_0x43ff('0x92')][_0x43ff('0x93')],'raw':!![]};var _0xb5409f=_0x20ae66[_0x43ff('0x94')]();_0xb5409f[_0x43ff('0x52')](_0x43ff('0x90'));_0xb5409f[_0x43ff('0x52')](_0x43ff('0x95'),_0x43ff('0x67'));if(_0x278ce6[_0x43ff('0x4e')]){_0x278ce6[_0x43ff('0x4e')][_0x43ff('0x36')](function(_0x46479e){var _0x15402a=_0x46479e[0x0]==='contactName'?_0x46479e[0x0]:'i.'+_0x46479e[0x0];_0x20ae66[_0x43ff('0x4e')](_0x15402a,_0x46479e[0x1]===_0x43ff('0x96')?![]:!![]);});}if(!_[_0x43ff('0x7c')](_0x2ee478)){_0x20ae66[_0x43ff('0x69')](_0x82e6f3);_0xb5409f[_0x43ff('0x50')](_0x43ff('0x97'),_0x2ee478);}BPromise[_0x43ff('0x98')]()[_0x43ff('0x29')](function(){if(!_0x3b3bd2){if(_0x2d6639['query'][_0x43ff('0x7d')])return;_0xb5409f[_0x43ff('0x50')](_0x43ff('0x99'));_0x20ae66[_0x43ff('0x50')](_0x43ff('0x99'));return;}if(_0x2d6639[_0x43ff('0x9a')]['role']!==_0x43ff('0x9b'))return;return _0x2d6639['user'][_0x43ff('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2584d8){if(_[_0x43ff('0x7c')](_0x2584d8)){_0xb5409f['where'](_0x43ff('0x9d'));_0x20ae66['where'](_0x43ff('0x9d'));}else{_0xb5409f[_0x43ff('0x50')](_0x43ff('0x7e'),_[_0x43ff('0x31')](_0x2584d8,'id'));_0x20ae66[_0x43ff('0x50')](_0x43ff('0x7e'),_['map'](_0x2584d8,'id'));}});})[_0x43ff('0x29')](function(){if(_0x2d6639[_0x43ff('0x9a')]['role']==='agent'&&!_0x3b3bd2&&!_0x2d6639['query'][_0x43ff('0x7d')])return[];return db[_0x43ff('0x9e')]['query'](_0xb5409f['toString'](),_0x1d4561);})['then'](function(_0x5e1a54){_0x38cc52['count']=_0x5e1a54[_0x43ff('0x4b')];if(_0x38cc52['count']===0x0)return[];return db[_0x43ff('0x9e')]['query'](_0x3da970[_0x43ff('0x9f')](),_0x1d4561)[_0x43ff('0x29')](function(_0x2017f5){_0x2bee10=_[_0x43ff('0xa0')](_0x2017f5,'id');_0x1d4561=_['merge'](_0x1d4561,{'model':db[_0x43ff('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2d6639[_0x43ff('0x46')][_0x43ff('0x4a')]){_0x278ce6[_0x43ff('0x49')][_0x43ff('0x36')](function(_0x19e3ae){_0x20ae66[_0x43ff('0x52')]('i.'+_0x19e3ae);});}else{_0x20ae66[_0x43ff('0x52')](_0x43ff('0x95'),_0x43ff('0x67'));_0x20ae66['field'](_0x43ff('0xa1'),_0x43ff('0xa2'));_0x20ae66['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x20ae66['field'](_0x43ff('0xa3'),_0x43ff('0xa4'));_0x20ae66[_0x43ff('0x52')](_0x43ff('0xa5'));_0x20ae66['field']('c.firstName',_0x43ff('0xa6'));_0x20ae66[_0x43ff('0x52')](_0x43ff('0xa7'),_0x43ff('0xa8'));_0x20ae66[_0x43ff('0x52')](_0x43ff('0xa9'),_0x43ff('0xaa'));_0x20ae66[_0x43ff('0x52')](_0x43ff('0xab'),_0x43ff('0xac'));_0x20ae66[_0x43ff('0x52')](_0x43ff('0xad'),_0x43ff('0xae'));_0x20ae66['field'](_0x43ff('0xaf'),'Contact.fax');_0x20ae66[_0x43ff('0x52')](_0x43ff('0xb0'),'Owner.fullname');_0x20ae66[_0x43ff('0x52')](_0x43ff('0xb1'),_0x43ff('0xb2'));_0x20ae66[_0x43ff('0x52')](_0x43ff('0xb3'),'TagIds');}if(_0x278ce6[_0x43ff('0x21')])_0x20ae66[_0x43ff('0x21')](_0x278ce6[_0x43ff('0x21')]);if(_0x278ce6[_0x43ff('0x1f')])_0x20ae66['offset'](_0x278ce6['offset']);return db[_0x43ff('0x9e')][_0x43ff('0x46')](_0x20ae66[_0x43ff('0x9f')](),_0x1d4561);})[_0x43ff('0x29')](function(_0x3f2ed8){if(_0x3f2ed8[_0x43ff('0x4b')]>0x0)_0x3e6f19[_0x43ff('0x50')](_0x43ff('0xb4'),_[_0x43ff('0x31')](_0x3f2ed8,'id'));return db[_0x43ff('0x9e')][_0x43ff('0x46')](_0x3e6f19[_0x43ff('0x9f')](),_0x1d4561)['then'](function(_0x2f6e88){var _0x6752bd=_[_0x43ff('0xb5')](_0x2f6e88,'FaxInteractionId');var _0x480b04=[];_0x3f2ed8[_0x43ff('0x36')](function(_0xd567cc){_0x480b04[_0x43ff('0x37')](updateFaxInteraction(_0xd567cc,_0x2bee10,_0x6752bd));});return BPromise[_0x43ff('0xb6')](_0x480b04);});});})[_0x43ff('0x29')](function(_0x455b02){_0x38cc52[_0x43ff('0xb7')]=_0x455b02;return _0x38cc52;})[_0x43ff('0x29')](respondWithFilteredResult(_0x568394,_0x278ce6))[_0x43ff('0x38')](handleError(_0x568394,null));};exports[_0x43ff('0xb8')]=function(_0x52cd21,_0x553b08){var _0x2150bb={'raw':![],'where':{'id':_0x52cd21['params']['id']}},_0x365b92={};_0x365b92[_0x43ff('0x45')]=_[_0x43ff('0x47')](db[_0x43ff('0x41')]['rawAttributes']);_0x365b92[_0x43ff('0x46')]=_[_0x43ff('0x47')](_0x52cd21[_0x43ff('0x46')]);_0x365b92['filters']=_[_0x43ff('0xb9')](_0x365b92[_0x43ff('0x45')],_0x365b92['query']);_0x2150bb[_0x43ff('0x49')]=_[_0x43ff('0xb9')](_0x365b92[_0x43ff('0x45')],qs[_0x43ff('0x4a')](_0x52cd21[_0x43ff('0x46')][_0x43ff('0x4a')]));_0x2150bb[_0x43ff('0x49')]=_0x2150bb[_0x43ff('0x49')][_0x43ff('0x4b')]?_0x2150bb[_0x43ff('0x49')]:_0x365b92['model'];if(_0x52cd21[_0x43ff('0x46')][_0x43ff('0xba')]){_0x2150bb[_0x43ff('0xbb')]=[{'all':!![]}];}_0x2150bb=_['merge']({},_0x2150bb,_0x52cd21[_0x43ff('0xbc')]);return db[_0x43ff('0x41')][_0x43ff('0x66')](_0x2150bb)[_0x43ff('0x29')](handleEntityNotFound(_0x553b08,null))[_0x43ff('0x29')](respondWithResult(_0x553b08,null))[_0x43ff('0x38')](handleError(_0x553b08,null));};exports[_0x43ff('0xbd')]=function(_0x233935,_0x6585bd){return db[_0x43ff('0x41')][_0x43ff('0xbd')](_0x233935[_0x43ff('0x79')],{})[_0x43ff('0x29')](respondWithResult(_0x6585bd,0xc9))[_0x43ff('0x38')](handleError(_0x6585bd,null));};exports[_0x43ff('0x28')]=function(_0x1584ef,_0x5746aa){if(_0x1584ef[_0x43ff('0x79')]['id']){delete _0x1584ef['body']['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x1584ef[_0x43ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5746aa,null))['then'](saveUpdates(_0x1584ef['body'],null))['then'](respondWithResult(_0x5746aa,null))[_0x43ff('0x38')](handleError(_0x5746aa,null));};exports[_0x43ff('0x2a')]=function(_0x3ef846,_0x1d840c){return db['FaxInteraction'][_0x43ff('0x66')]({'where':{'id':_0x3ef846[_0x43ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1d840c,null))[_0x43ff('0x29')](removeEntity(_0x1d840c,null))[_0x43ff('0x38')](handleError(_0x1d840c,null));};exports[_0x43ff('0xbf')]=function(_0x18f900,_0x255c4e){return db[_0x43ff('0x41')][_0x43ff('0xbf')]()[_0x43ff('0x29')](respondWithResult(_0x255c4e,null))['catch'](handleError(_0x255c4e,null));};exports[_0x43ff('0xc0')]=function(_0x11e139,_0x5290b8,_0x1c9d4b){return db[_0x43ff('0xc1')]['find']({'where':{'id':_0x11e139[_0x43ff('0xbe')]['id']}})[_0x43ff('0x29')](handleEntityNotFound(_0x5290b8,null))[_0x43ff('0x29')](function(_0x5423ab){if(_0x5423ab){return _0x5423ab[_0x43ff('0xc0')](_0x11e139[_0x43ff('0x79')][_0x43ff('0xc2')],_[_0x43ff('0xc3')](_0x11e139['body'],[_0x43ff('0xc2'),'id'])||{});}})[_0x43ff('0x29')](respondWithResult(_0x5290b8,null))['catch'](handleError(_0x5290b8,null));};exports[_0x43ff('0xc4')]=function(_0x517ec8,_0x3f040b,_0xbc5168){var _0x5b7d2c={'raw':![],'where':{}};var _0x20a142={};var _0x5475b7={'count':0x0,'rows':[]};return db[_0x43ff('0x41')][_0x43ff('0xc5')]({'where':{'id':_0x517ec8[_0x43ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x3f040b,null))[_0x43ff('0x29')](function(_0x3232a7){if(_0x3232a7){_0x20a142[_0x43ff('0x45')]=_[_0x43ff('0x47')](db[_0x43ff('0xc1')]['rawAttributes']);_0x20a142[_0x43ff('0x46')]=_['keys'](_0x517ec8[_0x43ff('0x46')]);_0x20a142[_0x43ff('0x48')]=_[_0x43ff('0xb9')](_0x20a142[_0x43ff('0x45')],_0x20a142['query']);_0x5b7d2c[_0x43ff('0x49')]=_[_0x43ff('0xb9')](_0x20a142['model'],qs[_0x43ff('0x4a')](_0x517ec8['query'][_0x43ff('0x4a')]));_0x5b7d2c[_0x43ff('0x49')]=_0x5b7d2c[_0x43ff('0x49')][_0x43ff('0x4b')]?_0x5b7d2c['attributes']:_0x20a142[_0x43ff('0x45')];if(!_0x517ec8['query'][_0x43ff('0x4c')](_0x43ff('0x4d'))){_0x5b7d2c[_0x43ff('0x21')]=qs[_0x43ff('0x21')](_0x517ec8['query'][_0x43ff('0x21')]);_0x5b7d2c[_0x43ff('0x1f')]=qs[_0x43ff('0x1f')](_0x517ec8['query']['offset']);}_0x5b7d2c[_0x43ff('0x4e')]=qs[_0x43ff('0x4f')](_0x517ec8[_0x43ff('0x46')][_0x43ff('0x4f')]);_0x5b7d2c[_0x43ff('0x50')]=qs[_0x43ff('0x48')](_[_0x43ff('0xc6')](_0x517ec8['query'],_0x20a142[_0x43ff('0x48')]));_0x5b7d2c[_0x43ff('0x50')][_0x43ff('0xc7')]=_0x3232a7['id'];if(_0x517ec8['query']['filter']){_0x5b7d2c['where']=_[_0x43ff('0xc8')](_0x5b7d2c['where'],{'$or':_[_0x43ff('0x31')](_0x5b7d2c[_0x43ff('0x49')],function(_0x29572e){var _0x209d29={};_0x209d29[_0x29572e]={'$like':'%'+_0x517ec8[_0x43ff('0x46')]['filter']+'%'};return _0x209d29;})});}if(_0x517ec8['query']['$gte']){var _0x42f57e=_0x517ec8['query']['$gte'][_0x43ff('0x35')](',');var _0x4c93fb={};_0x4c93fb[_0x42f57e[0x0]]={'$gte':moment(_0x42f57e[0x1])['format'](_0x43ff('0xc9'))};_0x5b7d2c['where']=_[_0x43ff('0xc8')](_0x5b7d2c[_0x43ff('0x50')],_0x4c93fb);}_0x5b7d2c=_[_0x43ff('0xc8')]({},_0x5b7d2c,_0x517ec8[_0x43ff('0xbc')]);return db[_0x43ff('0xc1')][_0x43ff('0x22')]({'where':_0x5b7d2c[_0x43ff('0x50')]})['then'](function(_0x302754){_0x5475b7[_0x43ff('0x22')]=_0x302754;if(_0x517ec8[_0x43ff('0x46')][_0x43ff('0xba')]){_0x5b7d2c[_0x43ff('0xbb')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x5b7d2c);})[_0x43ff('0x29')](function(_0xd61a19){_0x5475b7[_0x43ff('0xb7')]=_0xd61a19;return _0x5475b7;});}})['then'](respondWithFilteredResult(_0x3f040b,_0x5b7d2c))[_0x43ff('0x38')](handleError(_0x3f040b,null));};exports[_0x43ff('0xca')]=function(_0x122186,_0x42faaa,_0x32d950){return db[_0x43ff('0x41')]['find']({'where':{'id':_0x122186[_0x43ff('0xbe')]['id']}})[_0x43ff('0x29')](handleEntityNotFound(_0x42faaa,null))[_0x43ff('0x29')](function(_0x34214c){if(_0x34214c){return _0x34214c['setTags'](_0x122186[_0x43ff('0x79')][_0x43ff('0xc2')],_['omit'](_0x122186[_0x43ff('0x79')],[_0x43ff('0xc2'),'id'])||{})['spread'](function(){return db[_0x43ff('0x75')][_0x43ff('0xcb')]({'attributes':['id',_0x43ff('0x2f'),_0x43ff('0xcc')],'where':{'id':_0x122186['body']['ids']}});})['then'](function(_0x11810e){socket[_0x43ff('0xcd')](_0x43ff('0xce'),{'id':Number(_0x122186[_0x43ff('0xbe')]['id']),'tags':_0x11810e||[]});return{'id':Number(_0x122186[_0x43ff('0xbe')]['id']),'tags':_0x11810e||[]};});}})['then'](respondWithResult(_0x42faaa,null))[_0x43ff('0x38')](handleError(_0x42faaa,null));};exports['removeTags']=function(_0x11bda3,_0x522256,_0xcbba42){return db['FaxInteraction'][_0x43ff('0x66')]({'where':{'id':_0x11bda3[_0x43ff('0xbe')]['id']}})[_0x43ff('0x29')](handleEntityNotFound(_0x522256,null))[_0x43ff('0x29')](function(_0x172a80){if(_0x172a80){return _0x172a80[_0x43ff('0xcf')](_0x11bda3[_0x43ff('0x46')][_0x43ff('0xc2')]);}})[_0x43ff('0x29')](respondWithStatusCode(_0x522256,null))['catch'](handleError(_0x522256,null));};exports[_0x43ff('0xd0')]=function(_0x22d6a,_0x4ba6f7){var _0x20f0bf=moment()[_0x43ff('0xd1')]()[_0x43ff('0x9f')]();var _0x144afa=path[_0x43ff('0xd2')](config[_0x43ff('0xd3')],_0x43ff('0xd4'),_0x43ff('0xd5'),_0x43ff('0xd6'));var _0x242076=path[_0x43ff('0xd2')](config[_0x43ff('0xd3')],_0x43ff('0xd4'),_0x43ff('0xd5'),_0x43ff('0xd7'));var _0x43eed4=path[_0x43ff('0xd2')](_0x144afa,_0x20f0bf);var _0x2d7b83=util[_0x43ff('0xd8')](_0x43ff('0xd9'),_0x22d6a[_0x43ff('0xbe')]['id'],_0x20f0bf);var _0x4fcbd6=path['join'](_0x144afa,_0x2d7b83);var _0x57c7dd=[];_0x57c7dd[_0x43ff('0x37')]({'model':db[_0x43ff('0xda')],'as':_0x43ff('0xda'),'raw':!![]});var _0x22e66f=[{'model':db['FaxMessage'],'as':_0x43ff('0xdb'),'attributes':['id',_0x43ff('0x79'),_0x43ff('0x7f')],'include':_0x57c7dd}];return db[_0x43ff('0x41')][_0x43ff('0x66')]({'where':{'id':_0x22d6a[_0x43ff('0xbe')]['id']},'include':_0x22e66f})[_0x43ff('0x29')](handleEntityNotFound(_0x4ba6f7,null))[_0x43ff('0x29')](function(_0x420054){if(_0x420054&&_0x420054[_0x43ff('0xdb')]){var _0x263cf5=_0x420054[_0x43ff('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x43eed4);for(var _0x18a4ec=0x0;_0x18a4ec<_0x263cf5[_0x43ff('0xdb')][_0x43ff('0x4b')];_0x18a4ec++){var _0x541c37=_0x263cf5[_0x43ff('0xdb')][_0x18a4ec][_0x43ff('0xda')];if(_0x541c37){var _0x5e98d7=path[_0x43ff('0xd2')](_0x242076,_0x541c37[_0x43ff('0xdd')]);if(fs[_0x43ff('0xde')](_0x5e98d7)){fs[_0x43ff('0xdf')](_0x5e98d7)['pipe'](fs[_0x43ff('0xe0')](path[_0x43ff('0xd2')](_0x43eed4,_0x541c37[_0x43ff('0xdd')])));}}}return BPromise[_0x43ff('0x98')]()['then'](function(){return new BPromise(function(_0xa06c3,_0x3235c9){zipdir(_0x43eed4,{'saveTo':_0x4fcbd6},function(_0x4fd4e0,_0xe5c4f0){if(_0x4fd4e0)return _0x3235c9(_0x4fd4e0);return _0xa06c3(_0xe5c4f0);});})[_0x43ff('0x29')](function(){return new BPromise(function(_0x2485c9,_0xa4f978){rimraf(_0x43eed4,function(_0x16cb05){if(_0x16cb05)_0xa4f978(_0x16cb05);return _0x2485c9();});});})[_0x43ff('0x29')](function(){return _0x4ba6f7[_0x43ff('0xd0')](_0x4fcbd6,_0x2d7b83,function(_0x1bf434){if(_0x1bf434){console[_0x43ff('0xe1')]('err',_0x1bf434);}else{fs[_0x43ff('0xe2')](_0x4fcbd6);}});});});}else{return _0x4ba6f7[_0x43ff('0x2c')](0xc8);}})[_0x43ff('0x38')](handleError(_0x4ba6f7,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index af60e7d..daa9301 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 _0xca35=['catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','then','setDataValue','Users','map','findAll','length','emit'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xca35,0xad));var _0x5ca3=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0xca35[_0x4706a6];return _0x1bb705;};'use strict';var EventEmitter=require(_0x5ca3('0x0'));var FaxInteraction=require(_0x5ca3('0x1'))['db'][_0x5ca3('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x5ca3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ca3('0x4'),'afterUpdate':_0x5ca3('0x5'),'afterDestroy':_0x5ca3('0x6')};function emitEvent(_0x13d00b){return function(_0x431bf1,_0x2abc6c,_0x198081){_0x431bf1['getUsers']({'attributes':['id'],'raw':!![]})[_0x5ca3('0x7')](function(_0x442ec0){_0x431bf1[_0x5ca3('0x8')](_0x5ca3('0x9'),_0x442ec0[_0x5ca3('0xa')](function(_0x1886ff){return{'id':_0x1886ff['id']};}));return FaxMessage[_0x5ca3('0xb')]({'where':{'FaxInteractionId':_0x431bf1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3981d7){_0x431bf1['setDataValue']('unreadMessages',_0x3981d7[_0x5ca3('0xc')]);FaxInteractionEvents[_0x5ca3('0xd')](_0x13d00b+':'+_0x431bf1['id'],_0x431bf1);FaxInteractionEvents[_0x5ca3('0xd')](_0x13d00b,_0x431bf1);_0x198081(null);})[_0x5ca3('0xe')](_0x198081(null));};}for(var e in events){if(events[_0x5ca3('0xf')](e)){var event=events[e];FaxInteraction[_0x5ca3('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xf631=['update','remove','setDataValue','Users','findAll','then','unreadMessages','emit','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x4ad095,_0x5f4d18){var _0x168ddf=function(_0x3600af){while(--_0x3600af){_0x4ad095['push'](_0x4ad095['shift']());}};_0x168ddf(++_0x5f4d18);}(_0xf631,0x181));var _0x1f63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf631[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1f63('0x0'))['db'][_0x1f63('0x1')];var FaxMessage=require(_0x1f63('0x0'))['db'][_0x1f63('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1f63('0x3')](0x0);var events={'afterCreate':_0x1f63('0x4'),'afterUpdate':_0x1f63('0x5'),'afterDestroy':_0x1f63('0x6')};function emitEvent(_0x136dd5){return function(_0x4fcadf,_0x32922c,_0x16a887){_0x4fcadf['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x58e8a9){_0x4fcadf[_0x1f63('0x7')](_0x1f63('0x8'),_0x58e8a9['map'](function(_0x3161a3){return{'id':_0x3161a3['id']};}));return FaxMessage[_0x1f63('0x9')]({'where':{'FaxInteractionId':_0x4fcadf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1f63('0xa')](function(_0x49e9bd){_0x4fcadf[_0x1f63('0x7')](_0x1f63('0xb'),_0x49e9bd['length']);FaxInteractionEvents[_0x1f63('0xc')](_0x136dd5+':'+_0x4fcadf['id'],_0x4fcadf);FaxInteractionEvents[_0x1f63('0xc')](_0x136dd5,_0x4fcadf);_0x16a887(null);})['catch'](_0x16a887(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 55b93d5..5862953 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 _0xd4a2=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','bluebird','path','../../config/environment','./faxInteraction.attributes','exports'];(function(_0xcf6ac4,_0x17890a){var _0x4ff48f=function(_0x1f9416){while(--_0x1f9416){_0xcf6ac4['push'](_0xcf6ac4['shift']());}};_0x4ff48f(++_0x17890a);}(_0xd4a2,0x173));var _0x2d4a=function(_0x2c3df9,_0x31f172){_0x2c3df9=_0x2c3df9-0x0;var _0x11a7af=_0xd4a2[_0x2c3df9];return _0x11a7af;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f237e,_0x29597e,_0x3b8d7b){if(_0x1f237e[_0x2d4a('0x9')](_0x2d4a('0xa'))){_0x1f237e[_0x2d4a('0xb')]=moment()[_0x2d4a('0xc')](_0x2d4a('0xd'));}_0x3b8d7b(null,_0x1f237e);}}});}; \ No newline at end of file +var _0xd553=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions'];(function(_0x14364c,_0x181098){var _0x393358=function(_0x203518){while(--_0x203518){_0x14364c['push'](_0x14364c['shift']());}};_0x393358(++_0x181098);}(_0xd553,0xc8));var _0x3d55=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd553[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require('lodash');var util=require(_0x3d55('0x0'));var logger=require(_0x3d55('0x1'))('api');var moment=require(_0x3d55('0x2'));var BPromise=require(_0x3d55('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3d55('0x4'));var config=require(_0x3d55('0x5'));var attributes=require(_0x3d55('0x6'));module[_0x3d55('0x7')]=function(_0x1e0eb8,_0x5e1d23){return _0x1e0eb8['define'](_0x3d55('0x8'),attributes,{'tableName':_0x3d55('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d19d5,_0x99cb89,_0x34e190){if(_0x2d19d5['changed'](_0x3d55('0xa'))){_0x2d19d5[_0x3d55('0xb')]=moment()[_0x3d55('0xc')](_0x3d55('0xd'));}_0x34e190(null,_0x2d19d5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index b648575..b3f8069 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 _0x124a=['raw','where','attributes','limit','then','UpdateFaxInteraction','AddTagsToFaxInteraction','addTags','body','ids','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxInteraction','update','options'];(function(_0x4bb1dd,_0x45ce0a){var _0x1311ed=function(_0x424b24){while(--_0x424b24){_0x4bb1dd['push'](_0x4bb1dd['shift']());}};_0x1311ed(++_0x45ce0a);}(_0x124a,0x12b));var _0xa124=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x124a[_0x386c3e];return _0x4b8e13;};'use strict';var _=require('lodash');var util=require(_0xa124('0x0'));var moment=require(_0xa124('0x1'));var BPromise=require(_0xa124('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa124('0x3'));var db=require(_0xa124('0x4'))['db'];var utils=require(_0xa124('0x5'));var logger=require('../../config/logger')(_0xa124('0x6'));var config=require(_0xa124('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa124('0x8')]({'port':0x232a});config[_0xa124('0x9')]=_[_0xa124('0xa')](config[_0xa124('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa124('0xb'))(new Redis(config[_0xa124('0x9')]));require(_0xa124('0xc'))[_0xa124('0xd')](socket);function respondWithRpcPromise(_0x657c42,_0x22de45,_0x59e010){return new BPromise(function(_0x223c2d,_0x333f2d){return client[_0xa124('0xe')](_0x657c42,_0x59e010)['then'](function(_0x8396db){logger['info'](_0xa124('0xf'),_0x22de45,_0xa124('0x10'));logger[_0xa124('0x11')](_0xa124('0x12'),_0x22de45,_0xa124('0x10'),JSON[_0xa124('0x13')](_0x8396db));if(_0x8396db[_0xa124('0x14')]){if(_0x8396db['error'][_0xa124('0x15')]===0x1f4){logger[_0xa124('0x14')](_0xa124('0xf'),_0x22de45,_0x8396db[_0xa124('0x14')][_0xa124('0x16')]);return _0x333f2d(_0x8396db[_0xa124('0x14')][_0xa124('0x16')]);}logger[_0xa124('0x14')](_0xa124('0xf'),_0x22de45,_0x8396db[_0xa124('0x14')][_0xa124('0x16')]);return _0x223c2d(_0x8396db[_0xa124('0x14')][_0xa124('0x16')]);}else{logger[_0xa124('0x17')](_0xa124('0xf'),_0x22de45,_0xa124('0x10'));_0x223c2d(_0x8396db[_0xa124('0x18')][_0xa124('0x16')]);}})[_0xa124('0x19')](function(_0xdb3162){logger[_0xa124('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x22de45,_0xdb3162);_0x333f2d(_0xdb3162);});});}exports['UpdateFaxInteraction']=function(_0x53cec6){var _0x1c1c80=this;return new Promise(function(_0x283605,_0x118801){return db[_0xa124('0x1a')][_0xa124('0x1b')](_0x53cec6['body'],{'raw':_0x53cec6[_0xa124('0x1c')]?_0x53cec6[_0xa124('0x1c')][_0xa124('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53cec6[_0xa124('0x1c')]?_0x53cec6[_0xa124('0x1c')][_0xa124('0x1e')]||null:null,'attributes':_0x53cec6[_0xa124('0x1c')]?_0x53cec6['options'][_0xa124('0x1f')]||null:null,'limit':_0x53cec6[_0xa124('0x1c')]?_0x53cec6[_0xa124('0x1c')][_0xa124('0x20')]||null:null})[_0xa124('0x21')](function(_0x52e1f9){logger[_0xa124('0x17')](_0xa124('0x22'),_0x53cec6);logger[_0xa124('0x11')]('UpdateFaxInteraction',_0x53cec6,JSON[_0xa124('0x13')](_0x52e1f9));_0x283605(_0x52e1f9);})[_0xa124('0x19')](function(_0x3a4fde){logger[_0xa124('0x14')](_0xa124('0x22'),_0x3a4fde[_0xa124('0x16')],_0x53cec6);_0x118801(_0x1c1c80['error'](0x1f4,_0x3a4fde['message']));});});};exports[_0xa124('0x23')]=function(_0x26e3d9){return new Promise(function(_0x493984,_0x5c6350){return db[_0xa124('0x1a')]['find']({'where':_0x26e3d9[_0xa124('0x1c')]?_0x26e3d9[_0xa124('0x1c')][_0xa124('0x1e')]||null:null})['then'](function(_0xc66acb){if(_0xc66acb){return _0xc66acb[_0xa124('0x24')](_0x26e3d9[_0xa124('0x25')][_0xa124('0x26')],_['omit'](_0x26e3d9[_0xa124('0x25')],[_0xa124('0x26'),'id'])||{});}})[_0xa124('0x27')](function(_0x147ee0){logger[_0xa124('0x17')](_0xa124('0x28'),_0x26e3d9);logger[_0xa124('0x11')](_0xa124('0x28'),_0x26e3d9,JSON[_0xa124('0x13')](_0x147ee0));_0x493984(_0x147ee0);})['catch'](function(_0x536e05){logger['error'](_0xa124('0x28'),_0x536e05['message'],_0x26e3d9);_0x5c6350(_this[_0xa124('0x14')](0x1f4,_0x536e05['message']));});});}; \ No newline at end of file +var _0xee03=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','result','catch','FaxInteraction','body','options','raw','where','attributes','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x46a204,_0x45bdd2){var _0x203ac2=function(_0x50b203){while(--_0x50b203){_0x46a204['push'](_0x46a204['shift']());}};_0x203ac2(++_0x45bdd2);}(_0xee03,0x17b));var _0x3ee0=function(_0x20e05b,_0x221bb9){_0x20e05b=_0x20e05b-0x0;var _0x5d64e3=_0xee03[_0x20e05b];return _0x5d64e3;};'use strict';var _=require(_0x3ee0('0x0'));var util=require(_0x3ee0('0x1'));var moment=require(_0x3ee0('0x2'));var BPromise=require(_0x3ee0('0x3'));var rs=require(_0x3ee0('0x4'));var fs=require('fs');var Redis=require(_0x3ee0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ee0('0x6'));var logger=require(_0x3ee0('0x7'))('rpc');var config=require(_0x3ee0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ee0('0x9')]['http']({'port':0x232a});config[_0x3ee0('0xa')]=_[_0x3ee0('0xb')](config[_0x3ee0('0xa')],{'host':_0x3ee0('0xc'),'port':0x18eb});var socket=require(_0x3ee0('0xd'))(new Redis(config[_0x3ee0('0xa')]));require(_0x3ee0('0xe'))[_0x3ee0('0xf')](socket);function respondWithRpcPromise(_0x6950d2,_0x43956e,_0x548f8d){return new BPromise(function(_0x1f7ba0,_0x2b807d){return client[_0x3ee0('0x10')](_0x6950d2,_0x548f8d)[_0x3ee0('0x11')](function(_0x51cc33){logger[_0x3ee0('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x43956e,'request\x20sent');logger[_0x3ee0('0x13')](_0x3ee0('0x14'),_0x43956e,_0x3ee0('0x15'),JSON[_0x3ee0('0x16')](_0x51cc33));if(_0x51cc33[_0x3ee0('0x17')]){if(_0x51cc33['error'][_0x3ee0('0x18')]===0x1f4){logger[_0x3ee0('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x43956e,_0x51cc33['error'][_0x3ee0('0x19')]);return _0x2b807d(_0x51cc33[_0x3ee0('0x17')][_0x3ee0('0x19')]);}logger['error'](_0x3ee0('0x1a'),_0x43956e,_0x51cc33['error'][_0x3ee0('0x19')]);return _0x1f7ba0(_0x51cc33['error'][_0x3ee0('0x19')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x43956e,'request\x20sent');_0x1f7ba0(_0x51cc33[_0x3ee0('0x1b')][_0x3ee0('0x19')]);}})[_0x3ee0('0x1c')](function(_0x11ade1){logger[_0x3ee0('0x17')](_0x3ee0('0x1a'),_0x43956e,_0x11ade1);_0x2b807d(_0x11ade1);});});}exports['UpdateFaxInteraction']=function(_0x4fe571){var _0x52214b=this;return new Promise(function(_0x13d3d7,_0x5ce4c3){return db[_0x3ee0('0x1d')]['update'](_0x4fe571[_0x3ee0('0x1e')],{'raw':_0x4fe571['options']?_0x4fe571[_0x3ee0('0x1f')][_0x3ee0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fe571[_0x3ee0('0x1f')]?_0x4fe571[_0x3ee0('0x1f')][_0x3ee0('0x21')]||null:null,'attributes':_0x4fe571[_0x3ee0('0x1f')]?_0x4fe571['options'][_0x3ee0('0x22')]||null:null,'limit':_0x4fe571[_0x3ee0('0x1f')]?_0x4fe571['options']['limit']||null:null})['then'](function(_0x5c9dd4){logger[_0x3ee0('0x12')](_0x3ee0('0x23'),_0x4fe571);logger[_0x3ee0('0x13')]('UpdateFaxInteraction',_0x4fe571,JSON['stringify'](_0x5c9dd4));_0x13d3d7(_0x5c9dd4);})['catch'](function(_0x4f6e98){logger[_0x3ee0('0x17')](_0x3ee0('0x23'),_0x4f6e98['message'],_0x4fe571);_0x5ce4c3(_0x52214b[_0x3ee0('0x17')](0x1f4,_0x4f6e98['message']));});});};exports[_0x3ee0('0x24')]=function(_0x2c406e){return new Promise(function(_0x4a55f0,_0x2c00df){return db['FaxInteraction'][_0x3ee0('0x25')]({'where':_0x2c406e[_0x3ee0('0x1f')]?_0x2c406e[_0x3ee0('0x1f')]['where']||null:null})[_0x3ee0('0x11')](function(_0x4f29ab){if(_0x4f29ab){return _0x4f29ab[_0x3ee0('0x26')](_0x2c406e[_0x3ee0('0x1e')]['ids'],_[_0x3ee0('0x27')](_0x2c406e[_0x3ee0('0x1e')],[_0x3ee0('0x28'),'id'])||{});}})[_0x3ee0('0x29')](function(_0x56c0ed){logger[_0x3ee0('0x12')](_0x3ee0('0x2a'),_0x2c406e);logger[_0x3ee0('0x13')](_0x3ee0('0x2a'),_0x2c406e,JSON[_0x3ee0('0x16')](_0x56c0ed));_0x4a55f0(_0x56c0ed);})[_0x3ee0('0x1c')](function(_0x1a8dc4){logger['error']('AddTags',_0x1a8dc4[_0x3ee0('0x19')],_0x2c406e);_0x2c00df(_this[_0x3ee0('0x17')](0x1f4,_0x1a8dc4[_0x3ee0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 965f33f..5afeed0 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 _0x6930=['./faxInteraction.events','save','remove','update','removeListener','register','length','faxInteraction:'];(function(_0x1f3f1a,_0x878c37){var _0x55f53b=function(_0x444644){while(--_0x444644){_0x1f3f1a['push'](_0x1f3f1a['shift']());}};_0x55f53b(++_0x878c37);}(_0x6930,0x70));var _0x0693=function(_0x26691b,_0x362558){_0x26691b=_0x26691b-0x0;var _0xacceb=_0x6930[_0x26691b];return _0xacceb;};'use strict';var FaxInteractionEvents=require(_0x0693('0x0'));var events=[_0x0693('0x1'),_0x0693('0x2'),_0x0693('0x3')];function createListener(_0x195cc7,_0x24f325){return function(_0x12504b){_0x24f325['emit'](_0x195cc7,_0x12504b);};}function removeListener(_0x205341,_0x2320ab){return function(){FaxInteractionEvents[_0x0693('0x4')](_0x205341,_0x2320ab);};}exports[_0x0693('0x5')]=function(_0x1c4481){for(var _0x432ad0=0x0,_0x145c3d=events[_0x0693('0x6')];_0x432ad0<_0x145c3d;_0x432ad0++){var _0x79bb65=events[_0x432ad0];var _0x2cfd58=createListener(_0x0693('0x7')+_0x79bb65,_0x1c4481);FaxInteractionEvents['on'](_0x79bb65,_0x2cfd58);}}; \ No newline at end of file +var _0x12c4=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','emit'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x12c4,0xff));var _0x412c=function(_0x2e752d,_0xf12ff5){_0x2e752d=_0x2e752d-0x0;var _0x382d01=_0x12c4[_0x2e752d];return _0x382d01;};'use strict';var FaxInteractionEvents=require(_0x412c('0x0'));var events=[_0x412c('0x1'),_0x412c('0x2'),'update'];function createListener(_0x6428f,_0x16c848){return function(_0x4f7e4f){_0x16c848[_0x412c('0x3')](_0x6428f,_0x4f7e4f);};}function removeListener(_0x480707,_0x5e5085){return function(){FaxInteractionEvents[_0x412c('0x4')](_0x480707,_0x5e5085);};}exports[_0x412c('0x5')]=function(_0x40fa93){for(var _0x1c21cc=0x0,_0xf47cbc=events['length'];_0x1c21cc<_0xf47cbc;_0x1c21cc++){var _0x5a7fb4=events[_0x1c21cc];var _0x19cc96=createListener(_0x412c('0x6')+_0x5a7fb4,_0x40fa93);FaxInteractionEvents['on'](_0x5a7fb4,_0x19cc96);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index a7ad43d..04838de 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 _0xc8c5=['tracked','fax','faxinteraction:update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','addTags','put'];(function(_0xd34ed,_0x142aee){var _0x205761=function(_0x2f93b4){while(--_0x2f93b4){_0xd34ed['push'](_0xd34ed['shift']());}};_0x205761(++_0x142aee);}(_0xc8c5,0x172));var _0x5c8c=function(_0x3899a3,_0xcb527){_0x3899a3=_0x3899a3-0x0;var _0x13e1ce=_0xc8c5[_0x3899a3];return _0x13e1ce;};'use strict';var multer=require(_0x5c8c('0x0'));var util=require(_0x5c8c('0x1'));var path=require(_0x5c8c('0x2'));var timeout=require(_0x5c8c('0x3'));var express=require(_0x5c8c('0x4'));var router=express[_0x5c8c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5c8c('0x6'));var interaction=require(_0x5c8c('0x7'));var config=require(_0x5c8c('0x8'));var controller=require(_0x5c8c('0x9'));router[_0x5c8c('0xa')]('/',auth[_0x5c8c('0xb')](),controller[_0x5c8c('0xc')]);router[_0x5c8c('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5c8c('0xd')]);router[_0x5c8c('0xa')](_0x5c8c('0xe'),auth[_0x5c8c('0xb')](),controller[_0x5c8c('0xf')]);router[_0x5c8c('0xa')](_0x5c8c('0x10'),auth[_0x5c8c('0xb')](),controller[_0x5c8c('0x11')]);router[_0x5c8c('0xa')](_0x5c8c('0x12'),auth[_0x5c8c('0xb')](),controller[_0x5c8c('0x13')]);router[_0x5c8c('0x14')]('/',auth[_0x5c8c('0xb')](),controller[_0x5c8c('0x15')]);router[_0x5c8c('0x14')](_0x5c8c('0x10'),auth['isAuthenticated'](),controller[_0x5c8c('0x16')]);router[_0x5c8c('0x14')](_0x5c8c('0x17'),auth[_0x5c8c('0xb')](),interaction['tracked']('fax','faxinteraction:addtags'),controller[_0x5c8c('0x18')]);router[_0x5c8c('0x19')]('/:id',auth[_0x5c8c('0xb')](),interaction[_0x5c8c('0x1a')](_0x5c8c('0x1b'),_0x5c8c('0x1c')),controller['update']);router[_0x5c8c('0x1d')](_0x5c8c('0xe'),auth['isAuthenticated'](),interaction[_0x5c8c('0x1a')]('fax',_0x5c8c('0x1e')),controller['destroy']);router[_0x5c8c('0x1d')](_0x5c8c('0x17'),auth['isAuthenticated'](),controller[_0x5c8c('0x1f')]);module[_0x5c8c('0x20')]=router; \ No newline at end of file +var _0x6484=['../../components/auth/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update','faxinteraction:destroy','delete','/:id/tags','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x6484,0x1bb));var _0x4648=function(_0x97fc11,_0x61bab6){_0x97fc11=_0x97fc11-0x0;var _0x53b2cc=_0x6484[_0x97fc11];return _0x53b2cc;};'use strict';var multer=require('multer');var util=require(_0x4648('0x0'));var path=require(_0x4648('0x1'));var timeout=require(_0x4648('0x2'));var express=require(_0x4648('0x3'));var router=express['Router']();var fs_extra=require(_0x4648('0x4'));var auth=require(_0x4648('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4648('0x6'));var controller=require(_0x4648('0x7'));router[_0x4648('0x8')]('/',auth['isAuthenticated'](),controller[_0x4648('0x9')]);router[_0x4648('0x8')](_0x4648('0xa'),auth[_0x4648('0xb')](),controller[_0x4648('0xc')]);router[_0x4648('0x8')](_0x4648('0xd'),auth[_0x4648('0xb')](),controller[_0x4648('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x4648('0xf')]);router[_0x4648('0x8')](_0x4648('0x10'),auth[_0x4648('0xb')](),controller[_0x4648('0x11')]);router[_0x4648('0x12')]('/',auth[_0x4648('0xb')](),controller[_0x4648('0x13')]);router[_0x4648('0x12')](_0x4648('0x14'),auth[_0x4648('0xb')](),controller[_0x4648('0x15')]);router[_0x4648('0x12')]('/:id/tags',auth[_0x4648('0xb')](),interaction['tracked']('fax',_0x4648('0x16')),controller[_0x4648('0x17')]);router[_0x4648('0x18')](_0x4648('0xd'),auth[_0x4648('0xb')](),interaction[_0x4648('0x19')]('fax',_0x4648('0x1a')),controller[_0x4648('0x1b')]);router['delete'](_0x4648('0xd'),auth[_0x4648('0xb')](),interaction[_0x4648('0x19')]('fax',_0x4648('0x1c')),controller['destroy']);router[_0x4648('0x1d')](_0x4648('0x1e'),auth[_0x4648('0xb')](),controller['removeTags']);module[_0x4648('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 5ddb0fa..bd09965 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 _0x8ce3=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8ce3,0xc3));var _0x38ce=function(_0x455953,_0x2ee57d){_0x455953=_0x455953-0x0;var _0x2d7d6b=_0x8ce3[_0x455953];return _0x2d7d6b;};'use strict';var Sequelize=require(_0x38ce('0x0'));module[_0x38ce('0x1')]={'body':{'type':Sequelize['TEXT'](_0x38ce('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x38ce('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x38ce('0x4')]('in',_0x38ce('0x5')),'defaultValue':_0x38ce('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x38ce('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x38ce('0x7')]}}; \ No newline at end of file +var _0x0487=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x4de54b,_0xf592){var _0x50a6f5=function(_0x1148d7){while(--_0x1148d7){_0x4de54b['push'](_0x4de54b['shift']());}};_0x50a6f5(++_0xf592);}(_0x0487,0x14f));var _0x7048=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x0487[_0x2053ea];return _0x2232c4;};'use strict';var Sequelize=require(_0x7048('0x0'));module[_0x7048('0x1')]={'body':{'type':Sequelize[_0x7048('0x2')](_0x7048('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7048('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7048('0x5')]('in','out'),'defaultValue':_0x7048('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7048('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 53a9350..063325c 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 _0x293d=['intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','findAll','show','params','update','body','find','destroy','describe','fax-interactions','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','then','end','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x19c7d3,_0x3a4ae8){var _0x29f38a=function(_0x564224){while(--_0x564224){_0x19c7d3['push'](_0x19c7d3['shift']());}};_0x29f38a(++_0x3a4ae8);}(_0x293d,0xd3));var _0xd293=function(_0x5355b3,_0x2f1e18){_0x5355b3=_0x5355b3-0x0;var _0x1dbf46=_0x293d[_0x5355b3];return _0x1dbf46;};'use strict';var emlformat=require(_0xd293('0x0'));var rimraf=require(_0xd293('0x1'));var zipdir=require(_0xd293('0x2'));var jsonpatch=require(_0xd293('0x3'));var rp=require('request-promise');var moment=require(_0xd293('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd293('0x5'));var path=require(_0xd293('0x6'));var sox=require(_0xd293('0x7'));var csv=require(_0xd293('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd293('0x9'));var squel=require('squel');var crypto=require(_0xd293('0xa'));var jsforce=require(_0xd293('0xb'));var deskjs=require(_0xd293('0xc'));var toCsv=require(_0xd293('0x8'));var querystring=require(_0xd293('0xd'));var Papa=require(_0xd293('0xe'));var Redis=require(_0xd293('0xf'));var authService=require(_0xd293('0x10'));var qs=require(_0xd293('0x11'));var as=require(_0xd293('0x12'));var hardwareService=require(_0xd293('0x13'));var logger=require(_0xd293('0x14'))(_0xd293('0x15'));var utils=require(_0xd293('0x16'));var config=require(_0xd293('0x17'));var licenseUtil=require(_0xd293('0x18'));var db=require(_0xd293('0x19'))['db'];config['redis']=_['defaults'](config[_0xd293('0x1a')],{'host':_0xd293('0x1b'),'port':0x18eb});var socket=require(_0xd293('0x1c'))(new Redis(config[_0xd293('0x1a')]));require(_0xd293('0x1d'))[_0xd293('0x1e')](socket);var jayson=require(_0xd293('0x1f'));var client=jayson[_0xd293('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xd293('0x20')][_0xd293('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x26f6d4,_0x3035d2,_0x3e13ca,_0x4dc815){return new BPromise(function(_0x49f922,_0x29a489){var _0x1c86ee=_0x4dc815||client;return _0x1c86ee[_0xd293('0x22')](_0x26f6d4,_0x3e13ca)['then'](function(_0x4e065a){logger['info'](_0xd293('0x23'),_0x3035d2,_0xd293('0x24'));logger[_0xd293('0x25')](_0xd293('0x26'),_0x3035d2,_0xd293('0x24'),JSON[_0xd293('0x27')](_0x4e065a));if(_0x4e065a[_0xd293('0x28')]){if(_0x4e065a[_0xd293('0x28')]['code']===0x1f4){logger[_0xd293('0x28')]('FaxMessage,\x20%s,\x20%s',_0x3035d2,_0x4e065a['error'][_0xd293('0x29')]);return _0x29a489(_0x4e065a[_0xd293('0x28')]['message']);}logger[_0xd293('0x28')](_0xd293('0x23'),_0x3035d2,_0x4e065a[_0xd293('0x28')][_0xd293('0x29')]);return _0x49f922(_0x4e065a[_0xd293('0x28')][_0xd293('0x29')]);}else{logger[_0xd293('0x2a')](_0xd293('0x23'),_0x3035d2,_0xd293('0x24'));_0x49f922(_0x4e065a[_0xd293('0x2b')][_0xd293('0x29')]);}})[_0xd293('0x2c')](function(_0x5e5e8a){logger['error'](_0xd293('0x23'),_0x3035d2,_0x5e5e8a);_0x29a489(_0x5e5e8a);});});}function respondWithStatusCode(_0x1af9fb,_0x334fdb){_0x334fdb=_0x334fdb||0xcc;return function(_0x2c5577){if(_0x2c5577){return _0x1af9fb[_0xd293('0x2d')](_0x334fdb);}return _0x1af9fb[_0xd293('0x2e')](_0x334fdb)['end']();};}function respondWithResult(_0x237aa9,_0xbcc6c2){_0xbcc6c2=_0xbcc6c2||0xc8;return function(_0x1554c2){if(_0x1554c2){return _0x237aa9[_0xd293('0x2e')](_0xbcc6c2)[_0xd293('0x2f')](_0x1554c2);}};}function respondWithFilteredResult(_0x24fea0,_0x55fb34){return function(_0x5901cc){if(_0x5901cc){var _0x109bbe=typeof _0x55fb34['offset']===_0xd293('0x30')&&typeof _0x55fb34[_0xd293('0x31')]===_0xd293('0x30');var _0x3feb95=_0x5901cc[_0xd293('0x32')];var _0x56648d=_0x109bbe?0x0:_0x55fb34[_0xd293('0x33')];var _0x579def=_0x109bbe?_0x5901cc[_0xd293('0x32')]:_0x55fb34[_0xd293('0x33')]+_0x55fb34[_0xd293('0x31')];var _0x2b0587;if(_0x579def>=_0x3feb95){_0x579def=_0x3feb95;_0x2b0587=0xc8;}else{_0x2b0587=0xce;}_0x24fea0[_0xd293('0x2e')](_0x2b0587);return _0x24fea0['set']('Content-Range',_0x56648d+'-'+_0x579def+'/'+_0x3feb95)[_0xd293('0x2f')](_0x5901cc);}return null;};}function patchUpdates(_0x113019){return function(_0x3a5f63){try{jsonpatch[_0xd293('0x34')](_0x3a5f63,_0x113019,!![]);}catch(_0x4a8aac){return BPromise[_0xd293('0x35')](_0x4a8aac);}return _0x3a5f63[_0xd293('0x36')]();};}function saveUpdates(_0x43af80,_0x2bed4f){return function(_0x339e12){if(_0x339e12){return _0x339e12['update'](_0x43af80)[_0xd293('0x37')](function(_0x4d16bf){return _0x4d16bf;});}return null;};}function removeEntity(_0x546d4a,_0x4d8684){return function(_0x16eb3f){if(_0x16eb3f){return _0x16eb3f['destroy']()['then'](function(){_0x546d4a[_0xd293('0x2e')](0xcc)[_0xd293('0x38')]();});}};}function handleEntityNotFound(_0xc1ff9,_0x84e03b){return function(_0xf1b0ad){if(!_0xf1b0ad){_0xc1ff9[_0xd293('0x2d')](0x194);}return _0xf1b0ad;};}function handleError(_0x1c0748,_0x30ad2a){_0x30ad2a=_0x30ad2a||0x1f4;return function(_0x5c1bb1){logger['error'](_0x5c1bb1['stack']);if(_0x5c1bb1[_0xd293('0x39')]){delete _0x5c1bb1[_0xd293('0x39')];}_0x1c0748[_0xd293('0x2e')](_0x30ad2a)['send'](_0x5c1bb1);};}exports[_0xd293('0x3a')]=function(_0x45a2bd,_0x3d76df){var _0x4570ea={},_0x807147={},_0x1b6763={'count':0x0,'rows':[]};var _0x54bacc=_[_0xd293('0x3b')](db['FaxMessage'][_0xd293('0x3c')],function(_0x586ec1){return{'name':_0x586ec1[_0xd293('0x3d')],'type':_0x586ec1[_0xd293('0x3e')][_0xd293('0x3f')]};});_0x807147[_0xd293('0x40')]=_['map'](_0x54bacc,_0xd293('0x39'));_0x807147[_0xd293('0x41')]=_[_0xd293('0x42')](_0x45a2bd['query']);_0x807147[_0xd293('0x43')]=_['intersection'](_0x807147[_0xd293('0x40')],_0x807147['query']);_0x4570ea[_0xd293('0x44')]=_[_0xd293('0x45')](_0x807147['model'],qs[_0xd293('0x46')](_0x45a2bd[_0xd293('0x41')][_0xd293('0x46')]));_0x4570ea[_0xd293('0x44')]=_0x4570ea[_0xd293('0x44')][_0xd293('0x47')]?_0x4570ea[_0xd293('0x44')]:_0x807147['model'];if(!_0x45a2bd[_0xd293('0x41')]['hasOwnProperty']('nolimit')){_0x4570ea['limit']=qs['limit'](_0x45a2bd['query'][_0xd293('0x31')]);_0x4570ea[_0xd293('0x33')]=qs[_0xd293('0x33')](_0x45a2bd[_0xd293('0x41')]['offset']);}_0x4570ea['order']=qs[_0xd293('0x48')](_0x45a2bd['query'][_0xd293('0x48')]);_0x4570ea[_0xd293('0x49')]=qs[_0xd293('0x43')](_[_0xd293('0x4a')](_0x45a2bd[_0xd293('0x41')],_0x807147['filters']),_0x54bacc);if(_0x45a2bd['query'][_0xd293('0x4b')]){_0x4570ea['where']=_[_0xd293('0x4c')](_0x4570ea[_0xd293('0x49')],{'$or':_[_0xd293('0x3b')](_0x54bacc,function(_0x4dfef2){if(_0x4dfef2[_0xd293('0x3e')]!==_0xd293('0x4d')){var _0x1a0806={};_0x1a0806[_0x4dfef2['name']]={'$like':'%'+_0x45a2bd[_0xd293('0x41')][_0xd293('0x4b')]+'%'};return _0x1a0806;}})});}_0x4570ea=_[_0xd293('0x4c')]({},_0x4570ea,_0x45a2bd[_0xd293('0x4e')]);var _0x22bd7a={'where':_0x4570ea['where']};return db[_0xd293('0x4f')][_0xd293('0x32')](_0x22bd7a)[_0xd293('0x37')](function(_0x427d4a){_0x1b6763[_0xd293('0x32')]=_0x427d4a;if(_0x45a2bd[_0xd293('0x41')][_0xd293('0x50')]){_0x4570ea[_0xd293('0x51')]=[{'all':!![]}];}return db[_0xd293('0x4f')][_0xd293('0x52')](_0x4570ea);})[_0xd293('0x37')](function(_0x6fd50d){_0x1b6763['rows']=_0x6fd50d;return _0x1b6763;})[_0xd293('0x37')](respondWithFilteredResult(_0x3d76df,_0x4570ea))['catch'](handleError(_0x3d76df,null));};exports[_0xd293('0x53')]=function(_0x10ed2b,_0x52fc78){var _0x1c0db0={'raw':!![],'where':{'id':_0x10ed2b[_0xd293('0x54')]['id']}},_0x294e62={};_0x294e62[_0xd293('0x40')]=_['keys'](db[_0xd293('0x4f')][_0xd293('0x3c')]);_0x294e62[_0xd293('0x41')]=_['keys'](_0x10ed2b[_0xd293('0x41')]);_0x294e62[_0xd293('0x43')]=_['intersection'](_0x294e62[_0xd293('0x40')],_0x294e62['query']);_0x1c0db0['attributes']=_[_0xd293('0x45')](_0x294e62[_0xd293('0x40')],qs[_0xd293('0x46')](_0x10ed2b[_0xd293('0x41')][_0xd293('0x46')]));_0x1c0db0['attributes']=_0x1c0db0['attributes'][_0xd293('0x47')]?_0x1c0db0[_0xd293('0x44')]:_0x294e62[_0xd293('0x40')];if(_0x10ed2b[_0xd293('0x41')][_0xd293('0x50')]){_0x1c0db0[_0xd293('0x51')]=[{'all':!![]}];}_0x1c0db0=_[_0xd293('0x4c')]({},_0x1c0db0,_0x10ed2b['options']);return db[_0xd293('0x4f')]['find'](_0x1c0db0)[_0xd293('0x37')](handleEntityNotFound(_0x52fc78,null))[_0xd293('0x37')](respondWithResult(_0x52fc78,null))[_0xd293('0x2c')](handleError(_0x52fc78,null));};exports[_0xd293('0x55')]=function(_0x4d5786,_0x2e089e){if(_0x4d5786[_0xd293('0x56')]['id']){delete _0x4d5786['body']['id'];}return db['FaxMessage'][_0xd293('0x57')]({'where':{'id':_0x4d5786['params']['id']}})['then'](handleEntityNotFound(_0x2e089e,null))[_0xd293('0x37')](saveUpdates(_0x4d5786['body'],null))[_0xd293('0x37')](respondWithResult(_0x2e089e,null))[_0xd293('0x2c')](handleError(_0x2e089e,null));};exports[_0xd293('0x58')]=function(_0x54f4bb,_0x3bfc91){return db[_0xd293('0x4f')][_0xd293('0x57')]({'where':{'id':_0x54f4bb[_0xd293('0x54')]['id']}})[_0xd293('0x37')](handleEntityNotFound(_0x3bfc91,null))[_0xd293('0x37')](removeEntity(_0x3bfc91,null))[_0xd293('0x2c')](handleError(_0x3bfc91,null));};exports[_0xd293('0x59')]=function(_0x4c3c7d,_0x1a2404){return db[_0xd293('0x4f')][_0xd293('0x59')]()['then'](respondWithResult(_0x1a2404,null))['catch'](handleError(_0x1a2404,null));};var interaction_log=require(_0xd293('0x14'))(_0xd293('0x5a'));exports['accept']=function(_0x1a8ef5,_0x17d714,_0x6b09c6){var _0x445ca1={'agent':{},'channel':_0xd293('0x5b')};if(_0x1a8ef5['body']['id']){delete _0x1a8ef5[_0xd293('0x56')]['id'];}_0x1a8ef5[_0xd293('0x56')]['read']=!![];_0x1a8ef5[_0xd293('0x56')][_0xd293('0x5c')]=moment()['format'](_0xd293('0x5d'));_0x1a8ef5[_0xd293('0x56')][_0xd293('0x5e')]=_0x1a8ef5['body'][_0xd293('0x5e')]||_0x1a8ef5[_0xd293('0x5f')]['id'];_0x445ca1[_0xd293('0x60')]['id']=_0x1a8ef5['body']['UserId'];return db[_0xd293('0x4f')][_0xd293('0x57')]({'where':{'id':_0x1a8ef5[_0xd293('0x54')]['id'],'UserId':null}})[_0xd293('0x37')](handleEntityNotFound(_0x17d714,null))[_0xd293('0x37')](saveUpdates(_0x1a8ef5[_0xd293('0x56')],null))[_0xd293('0x37')](function(_0x3f86d3){if(_0x3f86d3){_0x445ca1['message']=_0x3f86d3[_0xd293('0x61')]({'plain':!![]});return db[_0xd293('0x62')][_0xd293('0x57')]({'where':{'id':_0x3f86d3[_0xd293('0x63')]}});}return null;})[_0xd293('0x37')](handleEntityNotFound(_0x17d714,null))[_0xd293('0x37')](function(_0xfc5ead){if(_0xfc5ead){return _0xfc5ead[_0xd293('0x55')]({'UserId':_0x1a8ef5[_0xd293('0x56')][_0xd293('0x5e')],'read1stAt':_[_0xd293('0x64')](_0xfc5ead[_0xd293('0x65')])?moment()[_0xd293('0x66')](_0xd293('0x5d')):undefined});}return null;})['then'](function(_0x917093){if(_0x917093){_0x445ca1[_0xd293('0x67')]=_0x917093[_0xd293('0x61')]({'plain':!![]});interaction_log['info'](_0xd293('0x68'),_0x1a8ef5['user']['id'],_0x1a8ef5[_0xd293('0x5f')][_0xd293('0x39')],_0x1a8ef5['user'][_0xd293('0x69')],_0x445ca1[_0xd293('0x67')]['id'],_0x1a8ef5[_0xd293('0x56')]?JSON[_0xd293('0x27')](_0x1a8ef5[_0xd293('0x56')]):_0xd293('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x445ca1);}return null;})[_0xd293('0x37')](function(_0x2a065a){var _0x4d3985=_0xd293('0x6b')+_0x2a065a[_0xd293('0x29')][_0xd293('0x6c')];return db[_0xd293('0x6d')][_0xd293('0x41')](_0x4d3985,{'type':db[_0xd293('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x42db47){return _0x42db47;});})['then'](function(_0x2ed5e0){if(_0x2ed5e0){_0x445ca1['message']['contact']=_0x2ed5e0[0x0];if(!_0x1a8ef5[_0xd293('0x56')][_0xd293('0x5e')])return;return db[_0xd293('0x6f')]['find']({'where':{'id':_0x1a8ef5[_0xd293('0x56')]['UserId'],'role':_0xd293('0x60')},'attributes':['id',_0xd293('0x39'),_0xd293('0x70'),_0xd293('0x71'),_0xd293('0x72')],'raw':!![]});}return null;})[_0xd293('0x37')](function(_0x5130c0){if(!_0x5130c0)return null;_0x445ca1[_0xd293('0x29')]['agent']=_0x5130c0;return _0x445ca1;})['then'](function(_0x1bbb89){if(_0x1bbb89){if(_0x1a8ef5['body'][_0xd293('0x73')]){_0x445ca1[_0xd293('0x29')][_0xd293('0x74')]=util[_0xd293('0x66')](_0xd293('0x75'),_0x1a8ef5[_0xd293('0x5f')][_0xd293('0x39')]);_0x445ca1[_0xd293('0x29')][_0xd293('0x76')]=_0x445ca1[_0xd293('0x76')];_0x445ca1[_0xd293('0x29')][_0xd293('0x77')]=_0x445ca1[_0xd293('0x76')];_0x445ca1[_0xd293('0x29')][_0xd293('0x78')]=_0xd293('0x79');return respondWithRpcPromise(_0xd293('0x7a'),_0xd293('0x7a'),{'event':_0xd293('0x7b'),'message':_0x445ca1[_0xd293('0x29')]},client9002)[_0xd293('0x37')](function(){return _0x445ca1;});}return _0x445ca1;}return null;})[_0xd293('0x37')](respondWithResult(_0x17d714,null))['catch'](handleError(_0x17d714,null));};var interaction_log=require(_0xd293('0x14'))(_0xd293('0x5a'));exports[_0xd293('0x35')]=function(_0x13d3cf,_0x31acca,_0x129534){var _0x133e60={'agent':{},'channel':_0xd293('0x5b')};if(_0x13d3cf[_0xd293('0x56')]['id']){delete _0x13d3cf[_0xd293('0x56')]['id'];}_0x13d3cf['body'][_0xd293('0x5e')]=_0x13d3cf[_0xd293('0x56')][_0xd293('0x5e')]||_0x13d3cf['user']['id'];_0x133e60[_0xd293('0x60')]['id']=_0x13d3cf[_0xd293('0x56')][_0xd293('0x5e')];return db['FaxMessage']['find']({'where':{'id':_0x13d3cf[_0xd293('0x54')]['id'],'UserId':null}})[_0xd293('0x37')](handleEntityNotFound(_0x31acca,null))[_0xd293('0x37')](function(_0xb96e5c){if(_0xb96e5c){_0x133e60['message']=_0xb96e5c[_0xd293('0x61')]({'plain':!![]});return db[_0xd293('0x62')][_0xd293('0x57')]({'where':{'id':_0xb96e5c[_0xd293('0x63')]}});}return null;})[_0xd293('0x37')](handleEntityNotFound(_0x31acca,null))[_0xd293('0x37')](function(_0x40bd7f){if(_0x40bd7f){_0x133e60[_0xd293('0x67')]=_0x40bd7f['get']({'plain':!![]});interaction_log['info'](_0xd293('0x7c'),_0x13d3cf[_0xd293('0x5f')]['id'],_0x13d3cf[_0xd293('0x5f')][_0xd293('0x39')],_0x13d3cf[_0xd293('0x5f')][_0xd293('0x69')],_0x133e60['interaction']['id'],_0x13d3cf['body']?JSON[_0xd293('0x27')](_0x13d3cf[_0xd293('0x56')]):_0xd293('0x6a'));return respondWithRpcPromise(_0xd293('0x7d'),_0xd293('0x7e'),_0x133e60);}return null;})[_0xd293('0x37')](function(_0x4bcf29){var _0xda6b18=_0xd293('0x6b')+_0x4bcf29[_0xd293('0x29')][_0xd293('0x6c')];return db['sequelize'][_0xd293('0x41')](_0xda6b18,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x5835f0){return _0x5835f0;});})[_0xd293('0x37')](function(_0x3c5d2c){if(_0x3c5d2c){_0x133e60[_0xd293('0x29')]['contact']=_0x3c5d2c[0x0];if(!_0x13d3cf[_0xd293('0x56')]['UserId'])return;return db[_0xd293('0x6f')][_0xd293('0x57')]({'where':{'id':_0x13d3cf[_0xd293('0x56')][_0xd293('0x5e')],'role':_0xd293('0x60')},'attributes':['id',_0xd293('0x39'),_0xd293('0x70'),_0xd293('0x71'),_0xd293('0x72')],'raw':!![]});}return null;})[_0xd293('0x37')](function(_0x26ac17){if(!_0x26ac17)return null;_0x133e60['message']['agent']=_0x26ac17;return _0x133e60;})[_0xd293('0x37')](function(_0x56f116){if(_0x56f116){_0x56f116[_0xd293('0x29')][_0xd293('0x74')]=util[_0xd293('0x66')](_0xd293('0x75'),_0x13d3cf[_0xd293('0x5f')][_0xd293('0x39')]);_0x56f116[_0xd293('0x29')][_0xd293('0x76')]=_0x133e60['channel'];_0x56f116[_0xd293('0x29')][_0xd293('0x77')]=_0x133e60[_0xd293('0x76')];_0x56f116[_0xd293('0x29')][_0xd293('0x78')]=_0xd293('0x35');respondWithRpcPromise(_0xd293('0x7a'),_0xd293('0x7a'),{'event':_0xd293('0x7f'),'message':_0x56f116['message']},client9002);return _0x133e60;}return null;})[_0xd293('0x37')](respondWithResult(_0x31acca,null))[_0xd293('0x2c')](handleError(_0x31acca,null));};exports[_0xd293('0x80')]=function(_0xd05be6,_0x4c811e){var _0x1c76f8;return db[_0xd293('0x4f')][_0xd293('0x80')](_0xd05be6[_0xd293('0x56')],{})[_0xd293('0x37')](function(_0x124e58){_0x1c76f8=_0x124e58;return db[_0xd293('0x81')][_0xd293('0x82')]({'where':{'id':_0x1c76f8[_0xd293('0x6c')]}});})[_0xd293('0x37')](function(_0x3d1b87){if(_[_0xd293('0x64')](_0x3d1b87)){return;}else{_0x1c76f8[_0xd293('0x5b')]=_0x3d1b87[_0xd293('0x5b')];return db[_0xd293('0x83')][_0xd293('0x82')]({'where':{'id':_0x1c76f8[_0xd293('0x84')]}});}})[_0xd293('0x37')](function(_0x30ab0b){return respondWithRpcPromise(_0xd293('0x85'),_0xd293('0x85'),{'FaxAccountId':_['isNil'](_0xd05be6[_0xd293('0x56')])?undefined:_0xd05be6[_0xd293('0x56')][_0xd293('0x86')],'path':_[_0xd293('0x64')](_0x30ab0b)?undefined:util[_0xd293('0x66')](_0xd293('0x87'),_0x30ab0b[_0xd293('0x88')]),'fax':_[_0xd293('0x64')](_0x1c76f8[_0xd293('0x5b')])?undefined:_0x1c76f8['fax'],'AttachmentId':_0x1c76f8[_0xd293('0x84')]},client9002);})[_0xd293('0x37')](respondWithResult(_0x4c811e,0xc9))[_0xd293('0x2c')](handleError(_0x4c811e,null));};exports[_0xd293('0x89')]=function(_0x2eff26,_0x50aacf){var _0x4ad113=path[_0xd293('0x8a')](config[_0xd293('0x8b')],'server','files','attachments');return db[_0xd293('0x4f')][_0xd293('0x57')]({'where':{'id':_0x2eff26['params']['id']},'include':[{'model':db[_0xd293('0x83')],'as':_0xd293('0x83')}]})[_0xd293('0x37')](handleEntityNotFound(_0x50aacf,null))['then'](function(_0x468b01){if(_0x468b01){return _0x50aacf[_0xd293('0x89')](path['join'](_0x4ad113,_0x468b01[_0xd293('0x83')][_0xd293('0x88')]));}})[_0xd293('0x2c')](handleError(_0x50aacf,null));}; \ No newline at end of file +var _0x7c63=['stack','send','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','Sequelize','fullname','interface','rejectmessage','create','CmContact','ContactId','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','join','server','files','attachments','Attachment','download','eml-format','rimraf','zip-dir','fast-json-patch','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','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','set','Content-Range','reject','save','update','then','end'];(function(_0x19b85d,_0x32ec71){var _0xe2703d=function(_0x50a050){while(--_0x50a050){_0x19b85d['push'](_0x19b85d['shift']());}};_0xe2703d(++_0x32ec71);}(_0x7c63,0xf3));var _0x37c6=function(_0x12d97c,_0x5d9e7b){_0x12d97c=_0x12d97c-0x0;var _0x21a55f=_0x7c63[_0x12d97c];return _0x21a55f;};'use strict';var emlformat=require(_0x37c6('0x0'));var rimraf=require(_0x37c6('0x1'));var zipdir=require(_0x37c6('0x2'));var jsonpatch=require(_0x37c6('0x3'));var rp=require('request-promise');var moment=require(_0x37c6('0x4'));var BPromise=require(_0x37c6('0x5'));var Mustache=require(_0x37c6('0x6'));var util=require(_0x37c6('0x7'));var path=require(_0x37c6('0x8'));var sox=require(_0x37c6('0x9'));var csv=require(_0x37c6('0xa'));var ejs=require(_0x37c6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37c6('0xc'));var squel=require(_0x37c6('0xd'));var crypto=require(_0x37c6('0xe'));var jsforce=require(_0x37c6('0xf'));var deskjs=require(_0x37c6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x37c6('0x11'));var Papa=require(_0x37c6('0x12'));var Redis=require(_0x37c6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x37c6('0x14'));var as=require(_0x37c6('0x15'));var hardwareService=require(_0x37c6('0x16'));var logger=require('../../config/logger')(_0x37c6('0x17'));var utils=require(_0x37c6('0x18'));var config=require(_0x37c6('0x19'));var licenseUtil=require(_0x37c6('0x1a'));var db=require(_0x37c6('0x1b'))['db'];config[_0x37c6('0x1c')]=_['defaults'](config['redis'],{'host':_0x37c6('0x1d'),'port':0x18eb});var socket=require(_0x37c6('0x1e'))(new Redis(config[_0x37c6('0x1c')]));require(_0x37c6('0x1f'))['register'](socket);var jayson=require(_0x37c6('0x20'));var client=jayson[_0x37c6('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x37c6('0x21')][_0x37c6('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1b6bd2,_0x98191b,_0x4effa3,_0x1060ae){return new BPromise(function(_0x1605e7,_0x376160){var _0x1d8f15=_0x1060ae||client;return _0x1d8f15[_0x37c6('0x23')](_0x1b6bd2,_0x4effa3)['then'](function(_0x17dd10){logger[_0x37c6('0x24')](_0x37c6('0x25'),_0x98191b,'request\x20sent');logger['debug'](_0x37c6('0x26'),_0x98191b,_0x37c6('0x27'),JSON[_0x37c6('0x28')](_0x17dd10));if(_0x17dd10[_0x37c6('0x29')]){if(_0x17dd10[_0x37c6('0x29')][_0x37c6('0x2a')]===0x1f4){logger[_0x37c6('0x29')](_0x37c6('0x25'),_0x98191b,_0x17dd10['error']['message']);return _0x376160(_0x17dd10[_0x37c6('0x29')][_0x37c6('0x2b')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x98191b,_0x17dd10[_0x37c6('0x29')][_0x37c6('0x2b')]);return _0x1605e7(_0x17dd10[_0x37c6('0x29')][_0x37c6('0x2b')]);}else{logger[_0x37c6('0x24')](_0x37c6('0x25'),_0x98191b,_0x37c6('0x27'));_0x1605e7(_0x17dd10[_0x37c6('0x2c')]['message']);}})[_0x37c6('0x2d')](function(_0x125264){logger['error'](_0x37c6('0x25'),_0x98191b,_0x125264);_0x376160(_0x125264);});});}function respondWithStatusCode(_0x3ffede,_0x39960b){_0x39960b=_0x39960b||0xcc;return function(_0x5024c7){if(_0x5024c7){return _0x3ffede[_0x37c6('0x2e')](_0x39960b);}return _0x3ffede['status'](_0x39960b)['end']();};}function respondWithResult(_0x30d6fa,_0x398eba){_0x398eba=_0x398eba||0xc8;return function(_0x1271a9){if(_0x1271a9){return _0x30d6fa[_0x37c6('0x2f')](_0x398eba)[_0x37c6('0x30')](_0x1271a9);}};}function respondWithFilteredResult(_0x28c4d3,_0x2514d5){return function(_0x4511c0){if(_0x4511c0){var _0x517d11=typeof _0x2514d5['offset']===_0x37c6('0x31')&&typeof _0x2514d5[_0x37c6('0x32')]==='undefined';var _0x1d05aa=_0x4511c0[_0x37c6('0x33')];var _0x1c2d48=_0x517d11?0x0:_0x2514d5['offset'];var _0x4fdada=_0x517d11?_0x4511c0['count']:_0x2514d5['offset']+_0x2514d5[_0x37c6('0x32')];var _0x378336;if(_0x4fdada>=_0x1d05aa){_0x4fdada=_0x1d05aa;_0x378336=0xc8;}else{_0x378336=0xce;}_0x28c4d3[_0x37c6('0x2f')](_0x378336);return _0x28c4d3[_0x37c6('0x34')](_0x37c6('0x35'),_0x1c2d48+'-'+_0x4fdada+'/'+_0x1d05aa)[_0x37c6('0x30')](_0x4511c0);}return null;};}function patchUpdates(_0x3d12a4){return function(_0x1f2794){try{jsonpatch['apply'](_0x1f2794,_0x3d12a4,!![]);}catch(_0x2c53e8){return BPromise[_0x37c6('0x36')](_0x2c53e8);}return _0x1f2794[_0x37c6('0x37')]();};}function saveUpdates(_0x49247b,_0x100269){return function(_0x3d3792){if(_0x3d3792){return _0x3d3792[_0x37c6('0x38')](_0x49247b)[_0x37c6('0x39')](function(_0x1ae22e){return _0x1ae22e;});}return null;};}function removeEntity(_0x5db466,_0x118f8b){return function(_0x18ea61){if(_0x18ea61){return _0x18ea61['destroy']()[_0x37c6('0x39')](function(){_0x5db466['status'](0xcc)[_0x37c6('0x3a')]();});}};}function handleEntityNotFound(_0x14459a,_0x3a87b6){return function(_0x2f6fc0){if(!_0x2f6fc0){_0x14459a['sendStatus'](0x194);}return _0x2f6fc0;};}function handleError(_0x3d2130,_0x53bede){_0x53bede=_0x53bede||0x1f4;return function(_0x3cc687){logger[_0x37c6('0x29')](_0x3cc687[_0x37c6('0x3b')]);if(_0x3cc687['name']){delete _0x3cc687['name'];}_0x3d2130['status'](_0x53bede)[_0x37c6('0x3c')](_0x3cc687);};}exports['index']=function(_0x27e2d8,_0x102400){var _0x2fde11={},_0x18b8aa={},_0x33d5c7={'count':0x0,'rows':[]};var _0x56c4cc=_[_0x37c6('0x3d')](db[_0x37c6('0x3e')][_0x37c6('0x3f')],function(_0x357cc1){return{'name':_0x357cc1[_0x37c6('0x40')],'type':_0x357cc1[_0x37c6('0x41')][_0x37c6('0x42')]};});_0x18b8aa[_0x37c6('0x43')]=_[_0x37c6('0x3d')](_0x56c4cc,_0x37c6('0x44'));_0x18b8aa[_0x37c6('0x45')]=_[_0x37c6('0x46')](_0x27e2d8[_0x37c6('0x45')]);_0x18b8aa[_0x37c6('0x47')]=_[_0x37c6('0x48')](_0x18b8aa[_0x37c6('0x43')],_0x18b8aa['query']);_0x2fde11[_0x37c6('0x49')]=_[_0x37c6('0x48')](_0x18b8aa[_0x37c6('0x43')],qs[_0x37c6('0x4a')](_0x27e2d8['query'][_0x37c6('0x4a')]));_0x2fde11[_0x37c6('0x49')]=_0x2fde11['attributes'][_0x37c6('0x4b')]?_0x2fde11[_0x37c6('0x49')]:_0x18b8aa[_0x37c6('0x43')];if(!_0x27e2d8['query'][_0x37c6('0x4c')](_0x37c6('0x4d'))){_0x2fde11['limit']=qs[_0x37c6('0x32')](_0x27e2d8[_0x37c6('0x45')][_0x37c6('0x32')]);_0x2fde11['offset']=qs['offset'](_0x27e2d8['query'][_0x37c6('0x4e')]);}_0x2fde11[_0x37c6('0x4f')]=qs[_0x37c6('0x50')](_0x27e2d8[_0x37c6('0x45')]['sort']);_0x2fde11[_0x37c6('0x51')]=qs[_0x37c6('0x47')](_['pick'](_0x27e2d8['query'],_0x18b8aa[_0x37c6('0x47')]),_0x56c4cc);if(_0x27e2d8[_0x37c6('0x45')][_0x37c6('0x52')]){_0x2fde11[_0x37c6('0x51')]=_[_0x37c6('0x53')](_0x2fde11[_0x37c6('0x51')],{'$or':_['map'](_0x56c4cc,function(_0xf2049){if(_0xf2049[_0x37c6('0x41')]!=='VIRTUAL'){var _0x919875={};_0x919875[_0xf2049[_0x37c6('0x44')]]={'$like':'%'+_0x27e2d8[_0x37c6('0x45')][_0x37c6('0x52')]+'%'};return _0x919875;}})});}_0x2fde11=_['merge']({},_0x2fde11,_0x27e2d8[_0x37c6('0x54')]);var _0x2c60c2={'where':_0x2fde11['where']};return db['FaxMessage'][_0x37c6('0x33')](_0x2c60c2)['then'](function(_0x1118c5){_0x33d5c7[_0x37c6('0x33')]=_0x1118c5;if(_0x27e2d8[_0x37c6('0x45')][_0x37c6('0x55')]){_0x2fde11[_0x37c6('0x56')]=[{'all':!![]}];}return db['FaxMessage'][_0x37c6('0x57')](_0x2fde11);})[_0x37c6('0x39')](function(_0x5409e3){_0x33d5c7[_0x37c6('0x58')]=_0x5409e3;return _0x33d5c7;})[_0x37c6('0x39')](respondWithFilteredResult(_0x102400,_0x2fde11))[_0x37c6('0x2d')](handleError(_0x102400,null));};exports[_0x37c6('0x59')]=function(_0x5b3806,_0x5273d0){var _0x46bf78={'raw':!![],'where':{'id':_0x5b3806['params']['id']}},_0x1adf64={};_0x1adf64[_0x37c6('0x43')]=_['keys'](db['FaxMessage'][_0x37c6('0x3f')]);_0x1adf64['query']=_[_0x37c6('0x46')](_0x5b3806[_0x37c6('0x45')]);_0x1adf64['filters']=_[_0x37c6('0x48')](_0x1adf64[_0x37c6('0x43')],_0x1adf64[_0x37c6('0x45')]);_0x46bf78[_0x37c6('0x49')]=_[_0x37c6('0x48')](_0x1adf64[_0x37c6('0x43')],qs[_0x37c6('0x4a')](_0x5b3806[_0x37c6('0x45')][_0x37c6('0x4a')]));_0x46bf78[_0x37c6('0x49')]=_0x46bf78[_0x37c6('0x49')][_0x37c6('0x4b')]?_0x46bf78[_0x37c6('0x49')]:_0x1adf64[_0x37c6('0x43')];if(_0x5b3806[_0x37c6('0x45')][_0x37c6('0x55')]){_0x46bf78[_0x37c6('0x56')]=[{'all':!![]}];}_0x46bf78=_['merge']({},_0x46bf78,_0x5b3806['options']);return db[_0x37c6('0x3e')][_0x37c6('0x5a')](_0x46bf78)[_0x37c6('0x39')](handleEntityNotFound(_0x5273d0,null))['then'](respondWithResult(_0x5273d0,null))['catch'](handleError(_0x5273d0,null));};exports[_0x37c6('0x38')]=function(_0x4db48b,_0x20dcc3){if(_0x4db48b[_0x37c6('0x5b')]['id']){delete _0x4db48b[_0x37c6('0x5b')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x4db48b[_0x37c6('0x5c')]['id']}})[_0x37c6('0x39')](handleEntityNotFound(_0x20dcc3,null))[_0x37c6('0x39')](saveUpdates(_0x4db48b[_0x37c6('0x5b')],null))[_0x37c6('0x39')](respondWithResult(_0x20dcc3,null))[_0x37c6('0x2d')](handleError(_0x20dcc3,null));};exports['destroy']=function(_0x11aa10,_0x51ee53){return db[_0x37c6('0x3e')][_0x37c6('0x5a')]({'where':{'id':_0x11aa10[_0x37c6('0x5c')]['id']}})[_0x37c6('0x39')](handleEntityNotFound(_0x51ee53,null))['then'](removeEntity(_0x51ee53,null))[_0x37c6('0x2d')](handleError(_0x51ee53,null));};exports[_0x37c6('0x5d')]=function(_0x3d1553,_0x4b05f7){return db[_0x37c6('0x3e')][_0x37c6('0x5d')]()[_0x37c6('0x39')](respondWithResult(_0x4b05f7,null))['catch'](handleError(_0x4b05f7,null));};var interaction_log=require(_0x37c6('0x5e'))(_0x37c6('0x5f'));exports[_0x37c6('0x60')]=function(_0x25da6d,_0x2175f4,_0x5a9448){var _0x5a395f={'agent':{},'channel':_0x37c6('0x61')};if(_0x25da6d[_0x37c6('0x5b')]['id']){delete _0x25da6d[_0x37c6('0x5b')]['id'];}_0x25da6d[_0x37c6('0x5b')][_0x37c6('0x62')]=!![];_0x25da6d['body'][_0x37c6('0x63')]=moment()[_0x37c6('0x64')](_0x37c6('0x65'));_0x25da6d[_0x37c6('0x5b')][_0x37c6('0x66')]=_0x25da6d['body']['UserId']||_0x25da6d[_0x37c6('0x67')]['id'];_0x5a395f[_0x37c6('0x68')]['id']=_0x25da6d[_0x37c6('0x5b')][_0x37c6('0x66')];return db[_0x37c6('0x3e')][_0x37c6('0x5a')]({'where':{'id':_0x25da6d[_0x37c6('0x5c')]['id'],'UserId':null}})[_0x37c6('0x39')](handleEntityNotFound(_0x2175f4,null))['then'](saveUpdates(_0x25da6d[_0x37c6('0x5b')],null))[_0x37c6('0x39')](function(_0x359728){if(_0x359728){_0x5a395f[_0x37c6('0x2b')]=_0x359728[_0x37c6('0x69')]({'plain':!![]});return db[_0x37c6('0x6a')][_0x37c6('0x5a')]({'where':{'id':_0x359728[_0x37c6('0x6b')]}});}return null;})[_0x37c6('0x39')](handleEntityNotFound(_0x2175f4,null))[_0x37c6('0x39')](function(_0xaa7f25){if(_0xaa7f25){return _0xaa7f25[_0x37c6('0x38')]({'UserId':_0x25da6d[_0x37c6('0x5b')][_0x37c6('0x66')],'read1stAt':_[_0x37c6('0x6c')](_0xaa7f25[_0x37c6('0x6d')])?moment()[_0x37c6('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x37c6('0x39')](function(_0x5f104a){if(_0x5f104a){_0x5a395f[_0x37c6('0x6e')]=_0x5f104a[_0x37c6('0x69')]({'plain':!![]});interaction_log[_0x37c6('0x24')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25da6d[_0x37c6('0x67')]['id'],_0x25da6d[_0x37c6('0x67')][_0x37c6('0x44')],_0x25da6d[_0x37c6('0x67')][_0x37c6('0x6f')],_0x5a395f['interaction']['id'],_0x25da6d['body']?JSON['stringify'](_0x25da6d[_0x37c6('0x5b')]):_0x37c6('0x70'));return respondWithRpcPromise(_0x37c6('0x71'),_0x37c6('0x72'),_0x5a395f);}return null;})['then'](function(_0x19afcf){var _0x44b909=_0x37c6('0x73')+_0x19afcf[_0x37c6('0x2b')]['ContactId'];return db[_0x37c6('0x74')]['query'](_0x44b909,{'type':db['Sequelize'][_0x37c6('0x75')][_0x37c6('0x76')],'raw':!![]})[_0x37c6('0x39')](function(_0x65d93){return _0x65d93;});})[_0x37c6('0x39')](function(_0x3c5b95){if(_0x3c5b95){_0x5a395f[_0x37c6('0x2b')][_0x37c6('0x77')]=_0x3c5b95[0x0];if(!_0x25da6d[_0x37c6('0x5b')][_0x37c6('0x66')])return;return db[_0x37c6('0x78')][_0x37c6('0x5a')]({'where':{'id':_0x25da6d[_0x37c6('0x5b')][_0x37c6('0x66')],'role':_0x37c6('0x68')},'attributes':['id',_0x37c6('0x44'),'fullname',_0x37c6('0x79'),_0x37c6('0x7a')],'raw':!![]});}return null;})['then'](function(_0x1aa898){if(!_0x1aa898)return null;_0x5a395f[_0x37c6('0x2b')][_0x37c6('0x68')]=_0x1aa898;return _0x5a395f;})[_0x37c6('0x39')](function(_0x5a0c1f){if(_0x5a0c1f){if(_0x25da6d[_0x37c6('0x5b')][_0x37c6('0x7b')]){_0x5a395f[_0x37c6('0x2b')]['interface']=util['format'](_0x37c6('0x7c'),_0x25da6d['user'][_0x37c6('0x44')]);_0x5a395f[_0x37c6('0x2b')]['channel']=_0x5a395f['channel'];_0x5a395f[_0x37c6('0x2b')][_0x37c6('0x7d')]=_0x5a395f[_0x37c6('0x7e')];_0x5a395f['message'][_0x37c6('0x7f')]=_0x37c6('0x60');return respondWithRpcPromise(_0x37c6('0x80'),_0x37c6('0x80'),{'event':_0x37c6('0x81'),'message':_0x5a395f[_0x37c6('0x2b')]},client9002)[_0x37c6('0x39')](function(){return _0x5a395f;});}return _0x5a395f;}return null;})[_0x37c6('0x39')](respondWithResult(_0x2175f4,null))[_0x37c6('0x2d')](handleError(_0x2175f4,null));};var interaction_log=require(_0x37c6('0x5e'))(_0x37c6('0x5f'));exports[_0x37c6('0x36')]=function(_0x2be602,_0x40185f,_0x1cd380){var _0x55d742={'agent':{},'channel':_0x37c6('0x61')};if(_0x2be602[_0x37c6('0x5b')]['id']){delete _0x2be602[_0x37c6('0x5b')]['id'];}_0x2be602[_0x37c6('0x5b')]['UserId']=_0x2be602['body'][_0x37c6('0x66')]||_0x2be602['user']['id'];_0x55d742['agent']['id']=_0x2be602[_0x37c6('0x5b')]['UserId'];return db[_0x37c6('0x3e')][_0x37c6('0x5a')]({'where':{'id':_0x2be602['params']['id'],'UserId':null}})[_0x37c6('0x39')](handleEntityNotFound(_0x40185f,null))[_0x37c6('0x39')](function(_0x4335eb){if(_0x4335eb){_0x55d742[_0x37c6('0x2b')]=_0x4335eb[_0x37c6('0x69')]({'plain':!![]});return db[_0x37c6('0x6a')][_0x37c6('0x5a')]({'where':{'id':_0x4335eb[_0x37c6('0x6b')]}});}return null;})[_0x37c6('0x39')](handleEntityNotFound(_0x40185f,null))[_0x37c6('0x39')](function(_0x369d0f){if(_0x369d0f){_0x55d742[_0x37c6('0x6e')]=_0x369d0f[_0x37c6('0x69')]({'plain':!![]});interaction_log[_0x37c6('0x24')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2be602[_0x37c6('0x67')]['id'],_0x2be602['user'][_0x37c6('0x44')],_0x2be602['user'][_0x37c6('0x6f')],_0x55d742['interaction']['id'],_0x2be602['body']?JSON['stringify'](_0x2be602['body']):_0x37c6('0x70'));return respondWithRpcPromise(_0x37c6('0x82'),_0x37c6('0x83'),_0x55d742);}return null;})[_0x37c6('0x39')](function(_0x27b587){var _0x59ca3b=_0x37c6('0x73')+_0x27b587[_0x37c6('0x2b')]['ContactId'];return db[_0x37c6('0x74')][_0x37c6('0x45')](_0x59ca3b,{'type':db[_0x37c6('0x84')][_0x37c6('0x75')][_0x37c6('0x76')],'raw':!![]})[_0x37c6('0x39')](function(_0x2edb80){return _0x2edb80;});})['then'](function(_0x39bf4c){if(_0x39bf4c){_0x55d742['message']['contact']=_0x39bf4c[0x0];if(!_0x2be602[_0x37c6('0x5b')][_0x37c6('0x66')])return;return db[_0x37c6('0x78')]['find']({'where':{'id':_0x2be602['body'][_0x37c6('0x66')],'role':_0x37c6('0x68')},'attributes':['id','name',_0x37c6('0x85'),_0x37c6('0x79'),_0x37c6('0x7a')],'raw':!![]});}return null;})[_0x37c6('0x39')](function(_0x1888b9){if(!_0x1888b9)return null;_0x55d742[_0x37c6('0x2b')][_0x37c6('0x68')]=_0x1888b9;return _0x55d742;})['then'](function(_0x2fe7ec){if(_0x2fe7ec){_0x2fe7ec['message'][_0x37c6('0x86')]=util[_0x37c6('0x64')]('SIP/%s',_0x2be602['user']['name']);_0x2fe7ec[_0x37c6('0x2b')][_0x37c6('0x7e')]=_0x55d742['channel'];_0x2fe7ec['message'][_0x37c6('0x7d')]=_0x55d742['channel'];_0x2fe7ec[_0x37c6('0x2b')][_0x37c6('0x7f')]='reject';respondWithRpcPromise(_0x37c6('0x80'),_0x37c6('0x80'),{'event':_0x37c6('0x87'),'message':_0x2fe7ec[_0x37c6('0x2b')]},client9002);return _0x55d742;}return null;})['then'](respondWithResult(_0x40185f,null))[_0x37c6('0x2d')](handleError(_0x40185f,null));};exports['create']=function(_0x34ecdd,_0xeeb024){var _0x571288;return db[_0x37c6('0x3e')][_0x37c6('0x88')](_0x34ecdd[_0x37c6('0x5b')],{})[_0x37c6('0x39')](function(_0x5b484e){_0x571288=_0x5b484e;return db[_0x37c6('0x89')]['findOne']({'where':{'id':_0x571288[_0x37c6('0x8a')]}});})[_0x37c6('0x39')](function(_0x42ff8d){if(_[_0x37c6('0x6c')](_0x42ff8d)){return;}else{_0x571288[_0x37c6('0x61')]=_0x42ff8d[_0x37c6('0x61')];return db['Attachment'][_0x37c6('0x8b')]({'where':{'id':_0x571288['AttachmentId']}});}})[_0x37c6('0x39')](function(_0x38e23d){return respondWithRpcPromise(_0x37c6('0x8c'),_0x37c6('0x8c'),{'FaxAccountId':_['isNil'](_0x34ecdd[_0x37c6('0x5b')])?undefined:_0x34ecdd[_0x37c6('0x5b')][_0x37c6('0x8d')],'path':_[_0x37c6('0x6c')](_0x38e23d)?undefined:util[_0x37c6('0x64')](_0x37c6('0x8e'),_0x38e23d[_0x37c6('0x8f')]),'fax':_[_0x37c6('0x6c')](_0x571288[_0x37c6('0x61')])?undefined:_0x571288[_0x37c6('0x61')],'AttachmentId':_0x571288[_0x37c6('0x90')]},client9002);})[_0x37c6('0x39')](respondWithResult(_0xeeb024,0xc9))[_0x37c6('0x2d')](handleError(_0xeeb024,null));};exports['download']=function(_0x44b1d7,_0x2f8b0e){var _0x460f7a=path[_0x37c6('0x91')](config['root'],_0x37c6('0x92'),_0x37c6('0x93'),_0x37c6('0x94'));return db[_0x37c6('0x3e')][_0x37c6('0x5a')]({'where':{'id':_0x44b1d7[_0x37c6('0x5c')]['id']},'include':[{'model':db[_0x37c6('0x95')],'as':_0x37c6('0x95')}]})['then'](handleEntityNotFound(_0x2f8b0e,null))[_0x37c6('0x39')](function(_0x3c576c){if(_0x3c576c){return _0x2f8b0e[_0x37c6('0x96')](path[_0x37c6('0x91')](_0x460f7a,_0x3c576c[_0x37c6('0x95')][_0x37c6('0x8f')]));}})[_0x37c6('0x2d')](handleError(_0x2f8b0e,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 189da82..ea168c3 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 _0x1751=['FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2bb9b3,_0x1d2c25){var _0x601b6=function(_0x4f8d09){while(--_0x4f8d09){_0x2bb9b3['push'](_0x2bb9b3['shift']());}};_0x601b6(++_0x1d2c25);}(_0x1751,0x76));var _0x1175=function(_0x385ef5,_0x5b3d02){_0x385ef5=_0x385ef5-0x0;var _0xb25114=_0x1751[_0x385ef5];return _0xb25114;};'use strict';var EventEmitter=require(_0x1175('0x0'));var FaxMessage=require(_0x1175('0x1'))['db'][_0x1175('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1175('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1175('0x4'),'afterDestroy':_0x1175('0x5')};function emitEvent(_0x1a62f7){return function(_0x3d5dd9,_0x3087ab,_0xfd3308){FaxMessageEvents[_0x1175('0x6')](_0x1a62f7+':'+_0x3d5dd9['id'],_0x3d5dd9);FaxMessageEvents[_0x1175('0x6')](_0x1a62f7,_0x3d5dd9);_0xfd3308(null);};}for(var e in events){if(events[_0x1175('0x7')](e)){var event=events[e];FaxMessage[_0x1175('0x8')](e,emitEvent(event));}}module[_0x1175('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xafb9=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x98a453,_0x14b45c){var _0x1966de=function(_0x37f67f){while(--_0x37f67f){_0x98a453['push'](_0x98a453['shift']());}};_0x1966de(++_0x14b45c);}(_0xafb9,0x68));var _0x9afb=function(_0x4eb4e8,_0x2f69db){_0x4eb4e8=_0x4eb4e8-0x0;var _0x4d6998=_0xafb9[_0x4eb4e8];return _0x4d6998;};'use strict';var EventEmitter=require(_0x9afb('0x0'));var FaxMessage=require(_0x9afb('0x1'))['db'][_0x9afb('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9afb('0x3')](0x0);var events={'afterCreate':_0x9afb('0x4'),'afterUpdate':_0x9afb('0x5'),'afterDestroy':_0x9afb('0x6')};function emitEvent(_0x44892f){return function(_0xdaf0c6,_0x4e983d,_0x498463){FaxMessageEvents[_0x9afb('0x7')](_0x44892f+':'+_0xdaf0c6['id'],_0xdaf0c6);FaxMessageEvents['emit'](_0x44892f,_0xdaf0c6);_0x498463(null);};}for(var e in events){if(events[_0x9afb('0x8')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b6e9fbe..2a3a383 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 _0x9515=['rimraf','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','isNil','UserId','FaxInteraction','findOne','update','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x3d8243,_0x431106){var _0x140fb4=function(_0x1bde1f){while(--_0x1bde1f){_0x3d8243['push'](_0x3d8243['shift']());}};_0x140fb4(++_0x431106);}(_0x9515,0x163));var _0x5951=function(_0x3f6bb4,_0x67511a){_0x3f6bb4=_0x3f6bb4-0x0;var _0x2e8c79=_0x9515[_0x3f6bb4];return _0x2e8c79;};'use strict';var _=require(_0x5951('0x0'));var util=require('util');var logger=require(_0x5951('0x1'))('api');var moment=require(_0x5951('0x2'));var BPromise=require(_0x5951('0x3'));var rp=require(_0x5951('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5951('0x5'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x5951('0x6')]=function(_0x3993a0,_0x3efbb3){return _0x3993a0[_0x5951('0x7')](_0x5951('0x8'),attributes,{'tableName':_0x5951('0x9'),'paranoid':![],'indexes':[{'name':_0x5951('0xa'),'fields':[_0x5951('0xb')],'type':_0x5951('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3cfd7b,_0x49a727,_0x12f085){var _0x4a246c=_0x3993a0[_0x5951('0xd')];var _0x2feb4a=_0x3cfd7b[_0x5951('0xe')]({'plain':!![]});if(_0x2feb4a['direction'][_0x5951('0xf')]()==='in'||_0x2feb4a['direction'][_0x5951('0xf')]()==='out'&&!_0x2feb4a['secret']&&!_[_0x5951('0x10')](_0x2feb4a[_0x5951('0x11')])){_0x4a246c[_0x5951('0x12')][_0x5951('0x13')]({'where':{'id':_0x2feb4a['FaxInteractionId']}})['then'](function(_0xcd6cf2){if(_0xcd6cf2){_0xcd6cf2[_0x5951('0x14')]({'lastMsgAt':_0x2feb4a['createdAt'],'lastMsgDirection':_0x2feb4a['direction'][_0x5951('0xf')]()});}})[_0x5951('0x15')](function(_0x5983e4){console[_0x5951('0x16')](_0x5983e4);});}_0x12f085();}},'charset':'utf8mb4','collate':_0x5951('0x17')});}; \ No newline at end of file +var _0x7398=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x73cab0,_0xd482b4){var _0x46b58c=function(_0x53c55e){while(--_0x53c55e){_0x73cab0['push'](_0x73cab0['shift']());}};_0x46b58c(++_0xd482b4);}(_0x7398,0x7e));var _0x8739=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x7398[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x8739('0x0'));var util=require('util');var logger=require(_0x8739('0x1'))(_0x8739('0x2'));var moment=require(_0x8739('0x3'));var BPromise=require(_0x8739('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8739('0x5'));var rimraf=require(_0x8739('0x6'));var config=require(_0x8739('0x7'));var attributes=require(_0x8739('0x8'));module[_0x8739('0x9')]=function(_0x6be504,_0x57bbba){return _0x6be504[_0x8739('0xa')](_0x8739('0xb'),attributes,{'tableName':_0x8739('0xc'),'paranoid':![],'indexes':[{'name':_0x8739('0xd'),'fields':['body'],'type':_0x8739('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ceebc,_0x50ac7d,_0x7fbf53){var _0x42d0ab=_0x6be504['models'];var _0x3bbbd9=_0x2ceebc[_0x8739('0xf')]({'plain':!![]});if(_0x3bbbd9[_0x8739('0x10')][_0x8739('0x11')]()==='in'||_0x3bbbd9[_0x8739('0x10')][_0x8739('0x11')]()==='out'&&!_0x3bbbd9[_0x8739('0x12')]&&!_[_0x8739('0x13')](_0x3bbbd9[_0x8739('0x14')])){_0x42d0ab[_0x8739('0x15')][_0x8739('0x16')]({'where':{'id':_0x3bbbd9[_0x8739('0x17')]}})[_0x8739('0x18')](function(_0x30b5a4){if(_0x30b5a4){_0x30b5a4['update']({'lastMsgAt':_0x3bbbd9[_0x8739('0x19')],'lastMsgDirection':_0x3bbbd9[_0x8739('0x10')][_0x8739('0x11')]()});}})[_0x8739('0x1a')](function(_0x6a4dfd){console[_0x8739('0x1b')](_0x6a4dfd);});}_0x7fbf53();}},'charset':_0x8739('0x1c'),'collate':_0x8739('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 39422f5..020e7d4 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 _0xe14d=['code','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31663e,_0x1840ca){var _0x9b1a53=function(_0xcf6126){while(--_0xcf6126){_0x31663e['push'](_0x31663e['shift']());}};_0x9b1a53(++_0x1840ca);}(_0xe14d,0x1ee));var _0xde14=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xe14d[_0x2dea24];return _0x309d58;};'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});config['redis']=_['defaults'](config[_0xde14('0xc')],{'host':_0xde14('0xd'),'port':0x18eb});var socket=require(_0xde14('0xe'))(new Redis(config[_0xde14('0xc')]));require(_0xde14('0xf'))[_0xde14('0x10')](socket);function respondWithRpcPromise(_0xa17e8,_0x1ce0a2,_0x4b2b15){return new BPromise(function(_0x1a7167,_0xe785fb){return client[_0xde14('0x11')](_0xa17e8,_0x4b2b15)[_0xde14('0x12')](function(_0x8e0e){logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));logger[_0xde14('0x16')](_0xde14('0x17'),_0x1ce0a2,_0xde14('0x15'),JSON[_0xde14('0x18')](_0x8e0e));if(_0x8e0e[_0xde14('0x19')]){if(_0x8e0e[_0xde14('0x19')][_0xde14('0x1a')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0xe785fb(_0x8e0e[_0xde14('0x19')]['message']);}logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0x1a7167(_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);}else{logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));_0x1a7167(_0x8e0e[_0xde14('0x1c')]['message']);}})[_0xde14('0x1d')](function(_0x3bfc59){logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x3bfc59);_0xe785fb(_0x3bfc59);});});}exports['CreateFaxMessage']=function(_0x394de7){var _0x53e905=this;return new Promise(function(_0x45d101,_0x4c24a8){return db[_0xde14('0x1e')][_0xde14('0x1f')](_0x394de7[_0xde14('0x20')],{'raw':_0x394de7[_0xde14('0x21')]?_0x394de7[_0xde14('0x21')][_0xde14('0x22')]===undefined?!![]:![]:!![]})[_0xde14('0x12')](function(_0x2dd9e7){logger[_0xde14('0x13')](_0xde14('0x23'),_0x394de7);logger[_0xde14('0x16')](_0xde14('0x23'),_0x394de7,JSON[_0xde14('0x18')](_0x2dd9e7));_0x45d101(_0x2dd9e7);})['catch'](function(_0x42dd4f){logger[_0xde14('0x19')](_0xde14('0x23'),_0x42dd4f[_0xde14('0x1b')],_0x394de7);_0x4c24a8(_0x53e905[_0xde14('0x19')](0x1f4,_0x42dd4f[_0xde14('0x1b')]));});});};exports[_0xde14('0x24')]=function(_0x23c735){var _0x1618e1=this;return new Promise(function(_0x350a78,_0x4eff65){return db[_0xde14('0x1e')][_0xde14('0x25')](_0x23c735[_0xde14('0x20')],{'raw':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')]['where']||null:null,'attributes':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x26')]||null:null,'limit':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')][_0xde14('0x27')]||null:null})[_0xde14('0x12')](function(_0x237d3f){logger[_0xde14('0x13')](_0xde14('0x24'),_0x23c735);logger['debug'](_0xde14('0x24'),_0x23c735,JSON[_0xde14('0x18')](_0x237d3f));_0x350a78(_0x237d3f);})['catch'](function(_0xf25a9e){logger['error'](_0xde14('0x24'),_0xf25a9e[_0xde14('0x1b')],_0x23c735);_0x4eff65(_0x1618e1[_0xde14('0x19')](0x1f4,_0xf25a9e[_0xde14('0x1b')]));});});}; \ No newline at end of file +var _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0x319dfe,_0xa22e69){var _0xe2da18=function(_0x5932e8){while(--_0x5932e8){_0x319dfe['push'](_0x319dfe['shift']());}};_0xe2da18(++_0xa22e69);}(_0x0e85,0x7c));var _0x50e8=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x0e85[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 2ed8c6c..0d45616 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 _0x43b6=['length','faxMessage:','./faxMessage.events','save','update','emit','removeListener','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x43b6,0xfa));var _0x643b=function(_0x2c43f8,_0x3cd046){_0x2c43f8=_0x2c43f8-0x0;var _0x4648fc=_0x43b6[_0x2c43f8];return _0x4648fc;};'use strict';var FaxMessageEvents=require(_0x643b('0x0'));var events=[_0x643b('0x1'),'remove',_0x643b('0x2')];function createListener(_0x4f632a,_0x214eca){return function(_0x40d273){_0x214eca[_0x643b('0x3')](_0x4f632a,_0x40d273);};}function removeListener(_0x286828,_0x31e063){return function(){FaxMessageEvents[_0x643b('0x4')](_0x286828,_0x31e063);};}exports[_0x643b('0x5')]=function(_0x1bfbbd){for(var _0x532bd5=0x0,_0x35ac7a=events[_0x643b('0x6')];_0x532bd5<_0x35ac7a;_0x532bd5++){var _0x552fab=events[_0x532bd5];var _0x5c36c1=createListener(_0x643b('0x7')+_0x552fab,_0x1bfbbd);FaxMessageEvents['on'](_0x552fab,_0x5c36c1);}}; \ No newline at end of file +var _0x6b96=['emit','register','length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6b96,0xa4));var _0x66b9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6b96[_0x13d07a];return _0x5ee0ee;};'use strict';var FaxMessageEvents=require(_0x66b9('0x0'));var events=[_0x66b9('0x1'),_0x66b9('0x2'),_0x66b9('0x3')];function createListener(_0x407e05,_0x39c6bd){return function(_0x46caa1){_0x39c6bd[_0x66b9('0x4')](_0x407e05,_0x46caa1);};}function removeListener(_0x5e52fd,_0x3fa5ef){return function(){FaxMessageEvents['removeListener'](_0x5e52fd,_0x3fa5ef);};}exports[_0x66b9('0x5')]=function(_0x26ac64){for(var _0x1ff64e=0x0,_0x131726=events[_0x66b9('0x6')];_0x1ff64e<_0x131726;_0x1ff64e++){var _0x482c6b=events[_0x1ff64e];var _0x40272a=createListener(_0x66b9('0x7')+_0x482c6b,_0x26ac64);FaxMessageEvents['on'](_0x482c6b,_0x40272a);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a4332cb..f6190e5 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 _0x6f7a=['tracked','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post'];(function(_0x398d85,_0x2465d7){var _0x33c2bb=function(_0x4aa229){while(--_0x4aa229){_0x398d85['push'](_0x398d85['shift']());}};_0x33c2bb(++_0x2465d7);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x240213,_0x2580b6){_0x240213=_0x240213-0x0;var _0x4d3fa0=_0x6f7a[_0x240213];return _0x4d3fa0;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xa6f7('0x10')]);router[_0xa6f7('0x11')]('/',auth['isAuthenticated'](),interaction[_0xa6f7('0x12')]('fax',_0xa6f7('0x13')),controller[_0xa6f7('0x14')]);router[_0xa6f7('0x15')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x16')]);router['put'](_0xa6f7('0x17'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x18')]);router['put'](_0xa6f7('0x19'),auth['isAuthenticated'](),controller[_0xa6f7('0x1a')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x2f68=['/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept'];(function(_0x5dc2fa,_0x56279d){var _0x16eaf9=function(_0x83322){while(--_0x83322){_0x5dc2fa['push'](_0x5dc2fa['shift']());}};_0x16eaf9(++_0x56279d);}(_0x2f68,0x9a));var _0x82f6=function(_0x15d17c,_0x44892f){_0x15d17c=_0x15d17c-0x0;var _0x2047f4=_0x2f68[_0x15d17c];return _0x2047f4;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./faxMessage.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),interaction[_0x82f6('0xe')](_0x82f6('0xf'),_0x82f6('0x10')),controller['create']);router[_0x82f6('0x11')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x12')]);router[_0x82f6('0x11')](_0x82f6('0x13'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x14')]);router[_0x82f6('0x11')](_0x82f6('0x15'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x16')]);router['delete'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x17')]);module[_0x82f6('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 7152cc1..25aea38 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 _0x5a9e=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x5ee0ef,_0x34f2b1){var _0x144aab=function(_0x39f698){while(--_0x39f698){_0x5ee0ef['push'](_0x5ee0ef['shift']());}};_0x144aab(++_0x34f2b1);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x5a9e[_0x3ec333];return _0x15ccb8;};'use strict';var Sequelize=require('sequelize');module[_0xe5a9('0x0')]={'name':{'type':Sequelize[_0xe5a9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe5a9('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe5a9('0x3')](_0xe5a9('0x4'),_0xe5a9('0x5'),_0xe5a9('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6df1=['STRING','name','ENUM','beepall','roundrobin','exports'];(function(_0x252458,_0x30c767){var _0x195004=function(_0x3cd2a4){while(--_0x3cd2a4){_0x252458['push'](_0x252458['shift']());}};_0x195004(++_0x30c767);}(_0x6df1,0x65));var _0x16df=function(_0x3ddbcc,_0x54be6b){_0x3ddbcc=_0x3ddbcc-0x0;var _0x381b48=_0x6df1[_0x3ddbcc];return _0x381b48;};'use strict';var Sequelize=require('sequelize');module[_0x16df('0x0')]={'name':{'type':Sequelize[_0x16df('0x1')],'unique':_0x16df('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x16df('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x16df('0x3')]('rrmemory',_0x16df('0x4'),_0x16df('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 6f88d8b..7dacb43 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 _0x3159=['toString','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','emit','userFaxQueue:remove','omit','spread','removeAgents','isArray','eml-format','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','FaxQueue','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','sort','pick','FaxQueueId','findAll','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?'];(function(_0x31f7ab,_0x256554){var _0x29f36e=function(_0x5abcba){while(--_0x5abcba){_0x31f7ab['push'](_0x31f7ab['shift']());}};_0x29f36e(++_0x256554);}(_0x3159,0x129));var _0x9315=function(_0x17b178,_0x591046){_0x17b178=_0x17b178-0x0;var _0x1bae80=_0x3159[_0x17b178];return _0x1bae80;};'use strict';var emlformat=require(_0x9315('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9315('0x1'));var jsonpatch=require(_0x9315('0x2'));var rp=require(_0x9315('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');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('lodash');var squel=require(_0x9315('0x9'));var crypto=require(_0x9315('0xa'));var jsforce=require(_0x9315('0xb'));var deskjs=require(_0x9315('0xc'));var toCsv=require(_0x9315('0x6'));var querystring=require(_0x9315('0xd'));var Papa=require(_0x9315('0xe'));var Redis=require(_0x9315('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9315('0x10'));var as=require(_0x9315('0x11'));var hardwareService=require(_0x9315('0x12'));var logger=require('../../config/logger')(_0x9315('0x13'));var utils=require(_0x9315('0x14'));var config=require(_0x9315('0x15'));var licenseUtil=require(_0x9315('0x16'));var db=require(_0x9315('0x17'))['db'];config[_0x9315('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9315('0x18')]));require(_0x9315('0x19'))[_0x9315('0x1a')](socket);function respondWithStatusCode(_0x12eec9,_0x55cd09){_0x55cd09=_0x55cd09||0xcc;return function(_0x5ee3e7){if(_0x5ee3e7){return _0x12eec9[_0x9315('0x1b')](_0x55cd09);}return _0x12eec9[_0x9315('0x1c')](_0x55cd09)[_0x9315('0x1d')]();};}function respondWithResult(_0x12fa21,_0x5a9f3a){_0x5a9f3a=_0x5a9f3a||0xc8;return function(_0x1c4575){if(_0x1c4575){return _0x12fa21['status'](_0x5a9f3a)[_0x9315('0x1e')](_0x1c4575);}};}function respondWithFilteredResult(_0x2456b2,_0x327d42){return function(_0x521066){if(_0x521066){var _0x3e7e07=typeof _0x327d42[_0x9315('0x1f')]===_0x9315('0x20')&&typeof _0x327d42[_0x9315('0x21')]===_0x9315('0x20');var _0x4f3b81=_0x521066['count'];var _0x1f601f=_0x3e7e07?0x0:_0x327d42[_0x9315('0x1f')];var _0x1fbe9e=_0x3e7e07?_0x521066['count']:_0x327d42[_0x9315('0x1f')]+_0x327d42[_0x9315('0x21')];var _0x4b801c;if(_0x1fbe9e>=_0x4f3b81){_0x1fbe9e=_0x4f3b81;_0x4b801c=0xc8;}else{_0x4b801c=0xce;}_0x2456b2[_0x9315('0x1c')](_0x4b801c);return _0x2456b2[_0x9315('0x22')]('Content-Range',_0x1f601f+'-'+_0x1fbe9e+'/'+_0x4f3b81)[_0x9315('0x1e')](_0x521066);}return null;};}function patchUpdates(_0x2fab1d){return function(_0x672299){try{jsonpatch[_0x9315('0x23')](_0x672299,_0x2fab1d,!![]);}catch(_0x3a1128){return BPromise[_0x9315('0x24')](_0x3a1128);}return _0x672299[_0x9315('0x25')]();};}function saveUpdates(_0x2130ec,_0x1135df){return function(_0x40a481){if(_0x40a481){return _0x40a481[_0x9315('0x26')](_0x2130ec)['then'](function(_0x1011e3){return _0x1011e3;});}return null;};}function removeEntity(_0x4d5487,_0x1ffe7a){return function(_0x365b4b){if(_0x365b4b){return _0x365b4b[_0x9315('0x27')]()[_0x9315('0x28')](function(){var _0xe09623=_0x365b4b[_0x9315('0x29')]({'plain':!![]});var _0x3aebd0='FaxQueues';return db[_0x9315('0x2a')][_0x9315('0x27')]({'where':{'type':_0x3aebd0,'resourceId':_0xe09623['id']}})[_0x9315('0x28')](function(){return _0x365b4b;});})[_0x9315('0x28')](function(){_0x4d5487[_0x9315('0x1c')](0xcc)[_0x9315('0x1d')]();});}};}function handleEntityNotFound(_0x3f9305,_0x4c87b3){return function(_0x445f44){if(!_0x445f44){_0x3f9305[_0x9315('0x1b')](0x194);}return _0x445f44;};}function handleError(_0x29280e,_0x4d1f1a){_0x4d1f1a=_0x4d1f1a||0x1f4;return function(_0xec88df){logger[_0x9315('0x2b')](_0xec88df['stack']);if(_0xec88df[_0x9315('0x2c')]){delete _0xec88df['name'];}_0x29280e[_0x9315('0x1c')](_0x4d1f1a)[_0x9315('0x2d')](_0xec88df);};}exports[_0x9315('0x2e')]=function(_0x3df67b,_0x5482e8){var _0x33e57f={},_0x21b2e5={},_0x4bd4f1={'count':0x0,'rows':[]};var _0x41cf35=_[_0x9315('0x2f')](db[_0x9315('0x30')]['rawAttributes'],function(_0x8dbfb4){return{'name':_0x8dbfb4['fieldName'],'type':_0x8dbfb4[_0x9315('0x31')][_0x9315('0x32')]};});_0x21b2e5[_0x9315('0x33')]=_['map'](_0x41cf35,_0x9315('0x2c'));_0x21b2e5[_0x9315('0x34')]=_['keys'](_0x3df67b[_0x9315('0x34')]);_0x21b2e5['filters']=_[_0x9315('0x35')](_0x21b2e5[_0x9315('0x33')],_0x21b2e5[_0x9315('0x34')]);_0x33e57f['attributes']=_['intersection'](_0x21b2e5[_0x9315('0x33')],qs[_0x9315('0x36')](_0x3df67b['query'][_0x9315('0x36')]));_0x33e57f['attributes']=_0x33e57f['attributes'][_0x9315('0x37')]?_0x33e57f[_0x9315('0x38')]:_0x21b2e5[_0x9315('0x33')];if(!_0x3df67b['query'][_0x9315('0x39')](_0x9315('0x3a'))){_0x33e57f[_0x9315('0x21')]=qs['limit'](_0x3df67b['query']['limit']);_0x33e57f[_0x9315('0x1f')]=qs[_0x9315('0x1f')](_0x3df67b['query']['offset']);}_0x33e57f[_0x9315('0x3b')]=qs['sort'](_0x3df67b[_0x9315('0x34')]['sort']);_0x33e57f[_0x9315('0x3c')]=qs['filters'](_['pick'](_0x3df67b[_0x9315('0x34')],_0x21b2e5[_0x9315('0x3d')]),_0x41cf35);if(_0x3df67b[_0x9315('0x34')][_0x9315('0x3e')]){_0x33e57f[_0x9315('0x3c')]=_[_0x9315('0x3f')](_0x33e57f[_0x9315('0x3c')],{'$or':_['map'](_0x41cf35,function(_0x2c606e){if(_0x2c606e[_0x9315('0x31')]!==_0x9315('0x40')){var _0x5b781a={};_0x5b781a[_0x2c606e[_0x9315('0x2c')]]={'$like':'%'+_0x3df67b[_0x9315('0x34')][_0x9315('0x3e')]+'%'};return _0x5b781a;}})});}_0x33e57f=_[_0x9315('0x3f')]({},_0x33e57f,_0x3df67b[_0x9315('0x41')]);var _0x2f4970={'where':_0x33e57f[_0x9315('0x3c')]};return db[_0x9315('0x30')]['count'](_0x2f4970)[_0x9315('0x28')](function(_0x293007){_0x4bd4f1[_0x9315('0x42')]=_0x293007;if(_0x3df67b['query'][_0x9315('0x43')]){_0x33e57f[_0x9315('0x44')]=[{'all':!![]}];}return db[_0x9315('0x30')]['findAll'](_0x33e57f);})[_0x9315('0x28')](function(_0x251a4f){_0x4bd4f1[_0x9315('0x45')]=_0x251a4f;return _0x4bd4f1;})[_0x9315('0x28')](respondWithFilteredResult(_0x5482e8,_0x33e57f))[_0x9315('0x46')](handleError(_0x5482e8,null));};exports[_0x9315('0x47')]=function(_0x1781b1,_0x14585d){var _0x1112af={'raw':!![],'where':{'id':_0x1781b1[_0x9315('0x48')]['id']}},_0x5ca2d2={};_0x5ca2d2[_0x9315('0x33')]=_[_0x9315('0x49')](db['FaxQueue'][_0x9315('0x4a')]);_0x5ca2d2[_0x9315('0x34')]=_[_0x9315('0x49')](_0x1781b1[_0x9315('0x34')]);_0x5ca2d2[_0x9315('0x3d')]=_[_0x9315('0x35')](_0x5ca2d2[_0x9315('0x33')],_0x5ca2d2[_0x9315('0x34')]);_0x1112af[_0x9315('0x38')]=_[_0x9315('0x35')](_0x5ca2d2['model'],qs[_0x9315('0x36')](_0x1781b1[_0x9315('0x34')]['fields']));_0x1112af[_0x9315('0x38')]=_0x1112af[_0x9315('0x38')][_0x9315('0x37')]?_0x1112af['attributes']:_0x5ca2d2[_0x9315('0x33')];if(_0x1781b1[_0x9315('0x34')]['includeAll']){_0x1112af[_0x9315('0x44')]=[{'all':!![]}];}_0x1112af=_[_0x9315('0x3f')]({},_0x1112af,_0x1781b1[_0x9315('0x41')]);return db[_0x9315('0x30')][_0x9315('0x4b')](_0x1112af)['then'](handleEntityNotFound(_0x14585d,null))[_0x9315('0x28')](respondWithResult(_0x14585d,null))[_0x9315('0x46')](handleError(_0x14585d,null));};exports[_0x9315('0x4c')]=function(_0x422b7c,_0x4b87ba){return db[_0x9315('0x30')][_0x9315('0x4c')](_0x422b7c[_0x9315('0x4d')],{})[_0x9315('0x28')](function(_0x443a33){var _0x57e7f0=_0x422b7c['user'][_0x9315('0x29')]({'plain':!![]});if(!_0x57e7f0)throw new Error(_0x9315('0x4e'));if(_0x57e7f0[_0x9315('0x4f')]===_0x9315('0x50')){var _0x1eea2d=_0x443a33[_0x9315('0x29')]({'plain':!![]});var _0x528f27=_0x9315('0x51');return db['UserProfileSection'][_0x9315('0x4b')]({'where':{'name':_0x528f27,'userProfileId':_0x57e7f0[_0x9315('0x52')]},'raw':!![]})[_0x9315('0x28')](function(_0x55d0c5){if(_0x55d0c5&&_0x55d0c5[_0x9315('0x53')]===0x0){return db[_0x9315('0x2a')][_0x9315('0x4c')]({'name':_0x1eea2d['name'],'resourceId':_0x1eea2d['id'],'type':_0x55d0c5['name'],'sectionId':_0x55d0c5['id']},{})[_0x9315('0x28')](function(){return _0x443a33;});}else{return _0x443a33;}})[_0x9315('0x46')](function(_0x2c694a){logger[_0x9315('0x2b')](_0x9315('0x54'),_0x2c694a);throw _0x2c694a;});}return _0x443a33;})[_0x9315('0x28')](respondWithResult(_0x4b87ba,0xc9))['catch'](handleError(_0x4b87ba,null));};exports[_0x9315('0x26')]=function(_0x10a9ca,_0x5beb6f){if(_0x10a9ca[_0x9315('0x4d')]['id']){delete _0x10a9ca[_0x9315('0x4d')]['id'];}return db[_0x9315('0x30')][_0x9315('0x4b')]({'where':{'id':_0x10a9ca['params']['id']}})[_0x9315('0x28')](handleEntityNotFound(_0x5beb6f,null))[_0x9315('0x28')](saveUpdates(_0x10a9ca[_0x9315('0x4d')],null))[_0x9315('0x28')](respondWithResult(_0x5beb6f,null))[_0x9315('0x46')](handleError(_0x5beb6f,null));};exports[_0x9315('0x27')]=function(_0x157a5e,_0x5d5b97){return db[_0x9315('0x30')]['find']({'where':{'id':_0x157a5e[_0x9315('0x48')]['id']}})[_0x9315('0x28')](handleEntityNotFound(_0x5d5b97,null))[_0x9315('0x28')](removeEntity(_0x5d5b97,null))['catch'](handleError(_0x5d5b97,null));};exports[_0x9315('0x55')]=function(_0xc02b87,_0x3c6c9c){return db[_0x9315('0x30')][_0x9315('0x55')]()['then'](respondWithResult(_0x3c6c9c,null))['catch'](handleError(_0x3c6c9c,null));};exports['getMembers']=function(_0x177d42,_0x5824fe,_0x81760b){var _0x34f1f7={'raw':!![],'where':{}},_0x58c96c={},_0x1f2f77;return db['FaxQueue'][_0x9315('0x56')]({'where':{'id':_0x177d42[_0x9315('0x48')]['id']}})[_0x9315('0x28')](handleEntityNotFound(_0x5824fe,null))[_0x9315('0x28')](function(_0x115f15){if(_0x115f15){_0x1f2f77=_0x115f15['get']({'plain':!![]});_0x58c96c[_0x9315('0x33')]=_[_0x9315('0x49')](db[_0x9315('0x57')][_0x9315('0x4a')]);_0x58c96c['query']=_['keys'](_0x177d42[_0x9315('0x34')]);_0x58c96c[_0x9315('0x3d')]=_[_0x9315('0x35')](_0x58c96c[_0x9315('0x33')],_0x58c96c['query']);_0x34f1f7[_0x9315('0x38')]=_[_0x9315('0x35')](_0x58c96c[_0x9315('0x33')],qs[_0x9315('0x36')](_0x177d42['query'][_0x9315('0x36')]));_0x34f1f7['attributes']=_0x34f1f7[_0x9315('0x38')][_0x9315('0x37')]?_0x34f1f7[_0x9315('0x38')]:_0x58c96c[_0x9315('0x33')];if(!_0x177d42[_0x9315('0x34')][_0x9315('0x39')](_0x9315('0x3a'))){_0x34f1f7[_0x9315('0x21')]=qs[_0x9315('0x21')](_0x177d42['query'][_0x9315('0x21')]);_0x34f1f7[_0x9315('0x1f')]=qs[_0x9315('0x1f')](_0x177d42[_0x9315('0x34')]['offset']);}_0x34f1f7['order']=qs[_0x9315('0x58')](_0x177d42[_0x9315('0x34')]['sort']);_0x34f1f7[_0x9315('0x3c')]=qs[_0x9315('0x3d')](_[_0x9315('0x59')](_0x177d42[_0x9315('0x34')],_0x58c96c[_0x9315('0x3d')]));_0x34f1f7[_0x9315('0x3c')][_0x9315('0x5a')]=_0x115f15['id'];if(_0x177d42['query'][_0x9315('0x3e')]){_0x34f1f7['where']=_[_0x9315('0x3f')](_0x34f1f7[_0x9315('0x3c')],{'$or':_[_0x9315('0x2f')](_0x34f1f7['attributes'],function(_0x1fd92e){var _0xde6540={};_0xde6540[_0x1fd92e]={'$like':'%'+_0x177d42[_0x9315('0x34')]['filter']+'%'};return _0xde6540;})});}_0x34f1f7=_[_0x9315('0x3f')]({},_0x34f1f7,_0x177d42['options']);return db[_0x9315('0x57')][_0x9315('0x5b')](_0x34f1f7);}})[_0x9315('0x28')](function(_0x237d81){if(_0x237d81){return db[_0x9315('0x5c')][_0x9315('0x5d')]({'where':{'id':_['map'](_0x237d81,_0x9315('0x5e')),'role':'agent'},'attributes':['id',_0x9315('0x2c'),_0x9315('0x5f'),_0x9315('0x60'),_0x9315('0x61')]});}})[_0x9315('0x28')](function(_0x3fff08){if(_0x3fff08){return{'count':_0x3fff08[_0x9315('0x42')],'rows':_[_0x9315('0x2f')](_0x3fff08[_0x9315('0x45')],function(_0x32d5fa){return{'membername':_0x32d5fa[_0x9315('0x2c')],'UserId':_0x32d5fa['id'],'queue_name':_0x1f2f77['name'],'FaxQueueId':_0x1f2f77['id'],'interface':util[_0x9315('0x62')]('%s/%s',_0x9315('0x63'),_0x32d5fa[_0x9315('0x2c')]),'penalty':0x0,'paused':_0x32d5fa[_0x9315('0x5f')],'createdAt':_0x32d5fa['createdAt'],'updatedAt':_0x32d5fa['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9315('0x28')](respondWithFilteredResult(_0x5824fe,_0x34f1f7))[_0x9315('0x46')](handleError(_0x5824fe,null));};exports[_0x9315('0x64')]=function(_0x48260d,_0x5b7f06,_0x26fe5e){var _0x454466={};var _0x465c5f={};var _0x1bd208;var _0x4e62af;return db[_0x9315('0x30')][_0x9315('0x56')]({'where':{'id':_0x48260d['params']['id']}})[_0x9315('0x28')](handleEntityNotFound(_0x5b7f06,null))[_0x9315('0x28')](function(_0x545c84){if(_0x545c84){_0x1bd208=_0x545c84;_0x465c5f[_0x9315('0x33')]=_[_0x9315('0x49')](db[_0x9315('0x65')][_0x9315('0x4a')]);_0x465c5f[_0x9315('0x34')]=_['keys'](_0x48260d['query']);_0x465c5f[_0x9315('0x3d')]=_[_0x9315('0x35')](_0x465c5f[_0x9315('0x33')],_0x465c5f[_0x9315('0x34')]);_0x454466[_0x9315('0x38')]=_[_0x9315('0x35')](_0x465c5f[_0x9315('0x33')],qs[_0x9315('0x36')](_0x48260d[_0x9315('0x34')][_0x9315('0x36')]));_0x454466[_0x9315('0x38')]=_0x454466[_0x9315('0x38')]['length']?_0x454466['attributes']:_0x465c5f[_0x9315('0x33')];_0x454466['order']=qs[_0x9315('0x58')](_0x48260d[_0x9315('0x34')][_0x9315('0x58')]);_0x454466[_0x9315('0x3c')]=qs[_0x9315('0x3d')](_[_0x9315('0x59')](_0x48260d[_0x9315('0x34')],_0x465c5f[_0x9315('0x3d')]));if(_0x48260d['query'][_0x9315('0x3e')]){_0x454466['where']=_['merge'](_0x454466[_0x9315('0x3c')],{'$or':_[_0x9315('0x2f')](_0x454466[_0x9315('0x38')],function(_0x376d00){var _0x401b81={};_0x401b81[_0x376d00]={'$like':'%'+_0x48260d[_0x9315('0x34')][_0x9315('0x3e')]+'%'};return _0x401b81;})});}_0x454466=_['merge']({},_0x454466,_0x48260d['options']);return _0x1bd208[_0x9315('0x64')](_0x454466);}})[_0x9315('0x28')](function(_0x1b941f){if(_0x1b941f){_0x4e62af=_0x1b941f[_0x9315('0x37')];if(!_0x48260d[_0x9315('0x34')]['hasOwnProperty'](_0x9315('0x3a'))){_0x454466[_0x9315('0x21')]=qs['limit'](_0x48260d[_0x9315('0x34')][_0x9315('0x21')]);_0x454466['offset']=qs['offset'](_0x48260d[_0x9315('0x34')][_0x9315('0x1f')]);}return _0x1bd208['getTeams'](_0x454466);}})[_0x9315('0x28')](function(_0x2ef48d){if(_0x2ef48d){return _0x2ef48d?{'count':_0x4e62af,'rows':_0x2ef48d}:null;}})[_0x9315('0x28')](respondWithResult(_0x5b7f06,null))[_0x9315('0x46')](handleError(_0x5b7f06,null));};exports['addTeams']=function(_0x4fa8e4,_0x597c95,_0x5bd338){var _0x27dcf7=_0x4fa8e4[_0x9315('0x4d')][_0x9315('0x66')];return db[_0x9315('0x65')][_0x9315('0x5b')]({'where':{'id':_0x27dcf7},'attributes':['id'],'include':[{'model':db[_0x9315('0x5c')],'as':_0x9315('0x67'),'attributes':['id',_0x9315('0x2c'),_0x9315('0x68'),_0x9315('0x69'),_0x9315('0x6a')],'raw':!![]}]})[_0x9315('0x28')](function(_0x3ea4c5){if(_0x3ea4c5){var _0xa48a01=_[_0x9315('0x6b')](_0x3ea4c5,function(_0x5b530d){var _0x52f8e3=_0x5b530d[_0x9315('0x29')]({'plain':!![]});return _0x52f8e3[_0x9315('0x67')];});return db[_0x9315('0x30')][_0x9315('0x4b')]({'where':{'id':_0x4fa8e4[_0x9315('0x48')]['id']}})[_0x9315('0x28')](function(_0x424760){return db[_0x9315('0x6c')][_0x9315('0x6d')](function(_0x75ed74){return _0x424760[_0x9315('0x6e')](_0x27dcf7,{'transaction':_0x75ed74})[_0x9315('0x28')](function(){return BPromise[_0x9315('0x6f')](_0xa48a01,function(_0x44655f){return db[_0x9315('0x57')][_0x9315('0x70')]({'where':{'UserId':_0x44655f['id'],'FaxQueueId':_0x4fa8e4['params']['id']},'transaction':_0x75ed74});});})[_0x9315('0x28')](function(){_0xa48a01[_0x9315('0x71')](function(_0x3ca676){socket['emit'](_0x9315('0x72'),{'UserId':_0x3ca676['id'],'FaxQueueId':_0x424760['id']});});});});});}})[_0x9315('0x28')](respondWithStatusCode(_0x597c95,null))[_0x9315('0x46')](handleError(_0x597c95,null));};exports[_0x9315('0x73')]=function(_0x56604e,_0x4f150f,_0x5d691a){return db[_0x9315('0x65')][_0x9315('0x5b')]({'where':{'id':_0x56604e['query'][_0x9315('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4f150f,null))[_0x9315('0x28')](function(_0x530c20){var _0x3354ca=_[_0x9315('0x2f')](_0x530c20,'id');var _0x32e11b=[];var _0x4b1080=[];var _0x5ea1ff=squel[_0x9315('0x74')]();_0x5ea1ff[_0x9315('0x75')](_0x9315('0x76'))[_0x9315('0x77')](_0x9315('0x78'),'tq')[_0x9315('0x79')](_0x9315('0x7a'),'ut',_0x9315('0x7b'))[_0x9315('0x3c')]('FaxQueueId\x20=\x20?',_0x56604e[_0x9315('0x48')]['id']);for(var _0x5ec575=0x0;_0x5ec575<_0x530c20[_0x9315('0x37')];_0x5ec575+=0x1){let _0x1f4bf7=_0x530c20[_0x5ec575];for(var _0x44bb3a=0x0;_0x44bb3a<_0x1f4bf7[_0x9315('0x67')]['length'];_0x44bb3a+=0x1){let _0x33e2b6=_0x1f4bf7[_0x9315('0x67')][_0x44bb3a];var _0x6aea37=_0x5ea1ff[_0x9315('0x7c')]();_0x6aea37[_0x9315('0x3c')](_0x9315('0x7d'),_0x33e2b6['id']);_0x4b1080['push'](db['sequelize'][_0x9315('0x34')](_0x6aea37[_0x9315('0x7e')](),{'type':db[_0x9315('0x6c')][_0x9315('0x7f')][_0x9315('0x80')]})['then'](function(_0x2bd353){if(_0x2bd353[_0x9315('0x37')]===0x1){return _0x33e2b6['id'];}else{var _0x40fd14=_[_0x9315('0x81')](_[_0x9315('0x2f')](_0x2bd353,'TeamId'),function(_0x2f1396){return _['includes'](_0x3354ca,_0x2f1396);});if(_0x40fd14){return _0x33e2b6['id'];}}}));}}return BPromise[_0x9315('0x82')](_0x4b1080)[_0x9315('0x28')](function(_0x4875e7){_0x32e11b=_(_0x32e11b)[_0x9315('0x83')](_0x4875e7)[_0x9315('0x84')]()[_0x9315('0x85')]();return db[_0x9315('0x30')]['find']({'where':{'id':_0x56604e[_0x9315('0x48')]['id']}})[_0x9315('0x28')](function(_0x2700f6){return db[_0x9315('0x6c')][_0x9315('0x6d')](function(_0x4bfaab){return _0x2700f6[_0x9315('0x73')](_0x56604e[_0x9315('0x34')]['ids'],{'transaction':_0x4bfaab})[_0x9315('0x28')](function(){if(!_[_0x9315('0x86')](_0x32e11b)){return _0x2700f6['removeAgents'](_0x32e11b,{'transaction':_0x4bfaab});}})[_0x9315('0x28')](function(){_0x32e11b[_0x9315('0x71')](function(_0x5f8cde){socket[_0x9315('0x87')](_0x9315('0x88'),{'UserId':_0x5f8cde,'FaxQueueId':_0x2700f6['id']});});});});});});})[_0x9315('0x28')](respondWithStatusCode(_0x4f150f,null))[_0x9315('0x46')](handleError(_0x4f150f,null));};exports['addAgents']=function(_0x1d6aaa,_0x512ea9,_0x229c4d){return db['FaxQueue'][_0x9315('0x4b')]({'where':{'id':_0x1d6aaa[_0x9315('0x48')]['id']}})[_0x9315('0x28')](handleEntityNotFound(_0x512ea9,null))[_0x9315('0x28')](function(_0x4077b2){if(_0x4077b2){return _0x4077b2['addAgents'](_0x1d6aaa[_0x9315('0x4d')]['ids'],_[_0x9315('0x89')](_0x1d6aaa[_0x9315('0x4d')],[_0x9315('0x66'),'id'])||{})[_0x9315('0x8a')](function(_0x49af57){for(var _0x1a6ca0=0x0;_0x1a6ca0<_0x1d6aaa[_0x9315('0x4d')][_0x9315('0x66')][_0x9315('0x37')];_0x1a6ca0+=0x1){socket[_0x9315('0x87')](_0x9315('0x72'),{'UserId':Number(_0x1d6aaa[_0x9315('0x4d')][_0x9315('0x66')][_0x1a6ca0]),'FaxQueueId':Number(_0x1d6aaa[_0x9315('0x48')]['id'])});}return _0x49af57;});}})[_0x9315('0x28')](respondWithResult(_0x512ea9,null))[_0x9315('0x46')](handleError(_0x512ea9,null));};exports[_0x9315('0x8b')]=function(_0x515c7f,_0x30110e,_0x568008){return db[_0x9315('0x30')][_0x9315('0x4b')]({'where':{'id':_0x515c7f[_0x9315('0x48')]['id']}})[_0x9315('0x28')](handleEntityNotFound(_0x30110e,null))['then'](function(_0xce7f1){if(_0xce7f1){return _0xce7f1[_0x9315('0x8b')](_0x515c7f[_0x9315('0x34')][_0x9315('0x66')])[_0x9315('0x28')](function(){if(_[_0x9315('0x8c')](_0x515c7f[_0x9315('0x34')][_0x9315('0x66')])){for(var _0x374d72=0x0;_0x374d72<_0x515c7f[_0x9315('0x34')][_0x9315('0x66')]['length'];_0x374d72+=0x1){socket[_0x9315('0x87')](_0x9315('0x88'),{'UserId':Number(_0x515c7f[_0x9315('0x34')][_0x9315('0x66')][_0x374d72]),'FaxQueueId':Number(_0x515c7f[_0x9315('0x48')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x515c7f[_0x9315('0x34')][_0x9315('0x66')]),'FaxQueueId':Number(_0x515c7f[_0x9315('0x48')]['id'])});}});}})[_0x9315('0x28')](respondWithStatusCode(_0x30110e,null))[_0x9315('0x46')](handleError(_0x30110e,null));};exports['getAgents']=function(_0xb18831,_0x464520,_0x51aeb0){var _0x58de22={};var _0x473f87={};var _0x25c784;var _0x19b24b;return db[_0x9315('0x30')][_0x9315('0x56')]({'where':{'id':_0xb18831[_0x9315('0x48')]['id']}})['then'](handleEntityNotFound(_0x464520,null))['then'](function(_0x4ac92c){if(_0x4ac92c){_0x25c784=_0x4ac92c;_0x473f87[_0x9315('0x33')]=_[_0x9315('0x49')](db[_0x9315('0x5c')][_0x9315('0x4a')]);_0x473f87[_0x9315('0x34')]=_[_0x9315('0x49')](_0xb18831[_0x9315('0x34')]);_0x473f87['filters']=_[_0x9315('0x35')](_0x473f87[_0x9315('0x33')],_0x473f87[_0x9315('0x34')]);_0x58de22['attributes']=_[_0x9315('0x35')](_0x473f87[_0x9315('0x33')],qs['fields'](_0xb18831['query'][_0x9315('0x36')]));_0x58de22['attributes']=_0x58de22[_0x9315('0x38')][_0x9315('0x37')]?_0x58de22[_0x9315('0x38')]:_0x473f87[_0x9315('0x33')];_0x58de22[_0x9315('0x3b')]=qs[_0x9315('0x58')](_0xb18831['query']['sort']);_0x58de22['where']=qs['filters'](_['pick'](_0xb18831[_0x9315('0x34')],_0x473f87[_0x9315('0x3d')]));if(_0xb18831[_0x9315('0x34')][_0x9315('0x3e')]){_0x58de22[_0x9315('0x3c')]=_['merge'](_0x58de22['where'],{'$or':_[_0x9315('0x2f')](_0x58de22[_0x9315('0x38')],function(_0xdb194f){var _0x5ce0d5={};_0x5ce0d5[_0xdb194f]={'$like':'%'+_0xb18831[_0x9315('0x34')][_0x9315('0x3e')]+'%'};return _0x5ce0d5;})});}_0x58de22=_[_0x9315('0x3f')]({},_0x58de22,_0xb18831[_0x9315('0x41')]);return _0x25c784['getAgents'](_0x58de22);}})[_0x9315('0x28')](function(_0x2003f7){if(_0x2003f7){_0x19b24b=_0x2003f7[_0x9315('0x37')];if(!_0xb18831['query'][_0x9315('0x39')]('nolimit')){_0x58de22[_0x9315('0x21')]=qs[_0x9315('0x21')](_0xb18831['query'][_0x9315('0x21')]);_0x58de22[_0x9315('0x1f')]=qs['offset'](_0xb18831[_0x9315('0x34')][_0x9315('0x1f')]);}return _0x25c784['getAgents'](_0x58de22);}})['then'](function(_0x23ee32){if(_0x23ee32){return _0x23ee32?{'count':_0x19b24b,'rows':_0x23ee32}:null;}})['then'](respondWithResult(_0x464520,null))[_0x9315('0x46')](handleError(_0x464520,null));}; \ No newline at end of file +var _0x95e8=['count','include','findAll','catch','params','rawAttributes','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','options','User','findAndCountAll','UserId','agent','faxPause','createdAt','rows','SIP','Team','getTeams','addTeams','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userFaxQueue:save','ids','Agents','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','includes','union','compact','value','removeTeams','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','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','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','get','FaxQueues','error','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','FaxQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95e8,0x158));var _0x895e=function(_0x3d6e2c,_0x32b92c){_0x3d6e2c=_0x3d6e2c-0x0;var _0x1fa404=_0x95e8[_0x3d6e2c];return _0x1fa404;};'use strict';var emlformat=require(_0x895e('0x0'));var rimraf=require(_0x895e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x895e('0x2'));var moment=require(_0x895e('0x3'));var BPromise=require(_0x895e('0x4'));var Mustache=require(_0x895e('0x5'));var util=require(_0x895e('0x6'));var path=require('path');var sox=require(_0x895e('0x7'));var csv=require('to-csv');var ejs=require(_0x895e('0x8'));var fs=require('fs');var fs_extra=require(_0x895e('0x9'));var _=require(_0x895e('0xa'));var squel=require('squel');var crypto=require(_0x895e('0xb'));var jsforce=require(_0x895e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x895e('0xd'));var querystring=require(_0x895e('0xe'));var Papa=require(_0x895e('0xf'));var Redis=require('ioredis');var authService=require(_0x895e('0x10'));var qs=require(_0x895e('0x11'));var as=require(_0x895e('0x12'));var hardwareService=require(_0x895e('0x13'));var logger=require(_0x895e('0x14'))(_0x895e('0x15'));var utils=require(_0x895e('0x16'));var config=require(_0x895e('0x17'));var licenseUtil=require(_0x895e('0x18'));var db=require(_0x895e('0x19'))['db'];config[_0x895e('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x895e('0x1b'))(new Redis(config[_0x895e('0x1a')]));require(_0x895e('0x1c'))[_0x895e('0x1d')](socket);function respondWithStatusCode(_0x120b8e,_0x135235){_0x135235=_0x135235||0xcc;return function(_0x21f893){if(_0x21f893){return _0x120b8e[_0x895e('0x1e')](_0x135235);}return _0x120b8e[_0x895e('0x1f')](_0x135235)[_0x895e('0x20')]();};}function respondWithResult(_0xa84731,_0x37f1c1){_0x37f1c1=_0x37f1c1||0xc8;return function(_0x3dfa48){if(_0x3dfa48){return _0xa84731[_0x895e('0x1f')](_0x37f1c1)[_0x895e('0x21')](_0x3dfa48);}};}function respondWithFilteredResult(_0x10965a,_0x29812b){return function(_0x210973){if(_0x210973){var _0x5d95ae=typeof _0x29812b[_0x895e('0x22')]===_0x895e('0x23')&&typeof _0x29812b[_0x895e('0x24')]===_0x895e('0x23');var _0x458e8e=_0x210973['count'];var _0x346a5a=_0x5d95ae?0x0:_0x29812b[_0x895e('0x22')];var _0x500b87=_0x5d95ae?_0x210973['count']:_0x29812b['offset']+_0x29812b[_0x895e('0x24')];var _0x5d555a;if(_0x500b87>=_0x458e8e){_0x500b87=_0x458e8e;_0x5d555a=0xc8;}else{_0x5d555a=0xce;}_0x10965a['status'](_0x5d555a);return _0x10965a['set'](_0x895e('0x25'),_0x346a5a+'-'+_0x500b87+'/'+_0x458e8e)['json'](_0x210973);}return null;};}function patchUpdates(_0x26f474){return function(_0x421e00){try{jsonpatch[_0x895e('0x26')](_0x421e00,_0x26f474,!![]);}catch(_0x478c25){return BPromise[_0x895e('0x27')](_0x478c25);}return _0x421e00[_0x895e('0x28')]();};}function saveUpdates(_0x21fcd3,_0x24ff8c){return function(_0x4d3120){if(_0x4d3120){return _0x4d3120['update'](_0x21fcd3)[_0x895e('0x29')](function(_0x58a53e){return _0x58a53e;});}return null;};}function removeEntity(_0x24eec2,_0x161475){return function(_0x4f137a){if(_0x4f137a){return _0x4f137a[_0x895e('0x2a')]()['then'](function(){var _0x2a0d02=_0x4f137a[_0x895e('0x2b')]({'plain':!![]});var _0x28aafb=_0x895e('0x2c');return db['UserProfileResource'][_0x895e('0x2a')]({'where':{'type':_0x28aafb,'resourceId':_0x2a0d02['id']}})[_0x895e('0x29')](function(){return _0x4f137a;});})[_0x895e('0x29')](function(){_0x24eec2[_0x895e('0x1f')](0xcc)[_0x895e('0x20')]();});}};}function handleEntityNotFound(_0x153323,_0x59d504){return function(_0x504926){if(!_0x504926){_0x153323['sendStatus'](0x194);}return _0x504926;};}function handleError(_0x41f3c6,_0x297361){_0x297361=_0x297361||0x1f4;return function(_0x462c59){logger[_0x895e('0x2d')](_0x462c59['stack']);if(_0x462c59[_0x895e('0x2e')]){delete _0x462c59[_0x895e('0x2e')];}_0x41f3c6[_0x895e('0x1f')](_0x297361)['send'](_0x462c59);};}exports[_0x895e('0x2f')]=function(_0xf0bfcb,_0xc92b5f){var _0x265493={},_0x515c58={},_0x9d4a1b={'count':0x0,'rows':[]};var _0x3a6a55=_[_0x895e('0x30')](db['FaxQueue']['rawAttributes'],function(_0x56bb87){return{'name':_0x56bb87['fieldName'],'type':_0x56bb87[_0x895e('0x31')][_0x895e('0x32')]};});_0x515c58[_0x895e('0x33')]=_[_0x895e('0x30')](_0x3a6a55,_0x895e('0x2e'));_0x515c58[_0x895e('0x34')]=_['keys'](_0xf0bfcb[_0x895e('0x34')]);_0x515c58[_0x895e('0x35')]=_[_0x895e('0x36')](_0x515c58['model'],_0x515c58[_0x895e('0x34')]);_0x265493[_0x895e('0x37')]=_['intersection'](_0x515c58['model'],qs['fields'](_0xf0bfcb['query'][_0x895e('0x38')]));_0x265493[_0x895e('0x37')]=_0x265493[_0x895e('0x37')][_0x895e('0x39')]?_0x265493[_0x895e('0x37')]:_0x515c58[_0x895e('0x33')];if(!_0xf0bfcb['query'][_0x895e('0x3a')](_0x895e('0x3b'))){_0x265493[_0x895e('0x24')]=qs[_0x895e('0x24')](_0xf0bfcb['query']['limit']);_0x265493[_0x895e('0x22')]=qs['offset'](_0xf0bfcb[_0x895e('0x34')][_0x895e('0x22')]);}_0x265493[_0x895e('0x3c')]=qs['sort'](_0xf0bfcb[_0x895e('0x34')][_0x895e('0x3d')]);_0x265493['where']=qs[_0x895e('0x35')](_['pick'](_0xf0bfcb['query'],_0x515c58[_0x895e('0x35')]),_0x3a6a55);if(_0xf0bfcb[_0x895e('0x34')][_0x895e('0x3e')]){_0x265493['where']=_[_0x895e('0x3f')](_0x265493[_0x895e('0x40')],{'$or':_[_0x895e('0x30')](_0x3a6a55,function(_0x4ab8a7){if(_0x4ab8a7[_0x895e('0x31')]!==_0x895e('0x41')){var _0x57c479={};_0x57c479[_0x4ab8a7[_0x895e('0x2e')]]={'$like':'%'+_0xf0bfcb[_0x895e('0x34')]['filter']+'%'};return _0x57c479;}})});}_0x265493=_[_0x895e('0x3f')]({},_0x265493,_0xf0bfcb['options']);var _0x1809d7={'where':_0x265493[_0x895e('0x40')]};return db[_0x895e('0x42')][_0x895e('0x43')](_0x1809d7)['then'](function(_0x298fb5){_0x9d4a1b[_0x895e('0x43')]=_0x298fb5;if(_0xf0bfcb[_0x895e('0x34')]['includeAll']){_0x265493[_0x895e('0x44')]=[{'all':!![]}];}return db[_0x895e('0x42')][_0x895e('0x45')](_0x265493);})[_0x895e('0x29')](function(_0x4f48ae){_0x9d4a1b['rows']=_0x4f48ae;return _0x9d4a1b;})[_0x895e('0x29')](respondWithFilteredResult(_0xc92b5f,_0x265493))[_0x895e('0x46')](handleError(_0xc92b5f,null));};exports['show']=function(_0x2bea18,_0x10b759){var _0xce8a6={'raw':!![],'where':{'id':_0x2bea18[_0x895e('0x47')]['id']}},_0x4ca017={};_0x4ca017[_0x895e('0x33')]=_['keys'](db['FaxQueue'][_0x895e('0x48')]);_0x4ca017['query']=_[_0x895e('0x49')](_0x2bea18['query']);_0x4ca017[_0x895e('0x35')]=_['intersection'](_0x4ca017[_0x895e('0x33')],_0x4ca017['query']);_0xce8a6[_0x895e('0x37')]=_[_0x895e('0x36')](_0x4ca017['model'],qs[_0x895e('0x38')](_0x2bea18[_0x895e('0x34')][_0x895e('0x38')]));_0xce8a6[_0x895e('0x37')]=_0xce8a6['attributes'][_0x895e('0x39')]?_0xce8a6[_0x895e('0x37')]:_0x4ca017[_0x895e('0x33')];if(_0x2bea18['query'][_0x895e('0x4a')]){_0xce8a6[_0x895e('0x44')]=[{'all':!![]}];}_0xce8a6=_[_0x895e('0x3f')]({},_0xce8a6,_0x2bea18['options']);return db[_0x895e('0x42')][_0x895e('0x4b')](_0xce8a6)['then'](handleEntityNotFound(_0x10b759,null))['then'](respondWithResult(_0x10b759,null))[_0x895e('0x46')](handleError(_0x10b759,null));};exports[_0x895e('0x4c')]=function(_0x2ee379,_0x2071ed){return db[_0x895e('0x42')]['create'](_0x2ee379[_0x895e('0x4d')],{})[_0x895e('0x29')](function(_0x10c9fa){var _0x150fb0=_0x2ee379[_0x895e('0x4e')][_0x895e('0x2b')]({'plain':!![]});if(!_0x150fb0)throw new Error(_0x895e('0x4f'));if(_0x150fb0[_0x895e('0x50')]===_0x895e('0x4e')){var _0x3f9146=_0x10c9fa[_0x895e('0x2b')]({'plain':!![]});var _0x15042a='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x15042a,'userProfileId':_0x150fb0[_0x895e('0x51')]},'raw':!![]})[_0x895e('0x29')](function(_0x2e8741){if(_0x2e8741&&_0x2e8741[_0x895e('0x52')]===0x0){return db[_0x895e('0x53')][_0x895e('0x4c')]({'name':_0x3f9146[_0x895e('0x2e')],'resourceId':_0x3f9146['id'],'type':_0x2e8741['name'],'sectionId':_0x2e8741['id']},{})['then'](function(){return _0x10c9fa;});}else{return _0x10c9fa;}})[_0x895e('0x46')](function(_0x402545){logger[_0x895e('0x2d')](_0x895e('0x54'),_0x402545);throw _0x402545;});}return _0x10c9fa;})['then'](respondWithResult(_0x2071ed,0xc9))['catch'](handleError(_0x2071ed,null));};exports[_0x895e('0x55')]=function(_0x18c1df,_0x279b0f){if(_0x18c1df[_0x895e('0x4d')]['id']){delete _0x18c1df[_0x895e('0x4d')]['id'];}return db[_0x895e('0x42')][_0x895e('0x4b')]({'where':{'id':_0x18c1df[_0x895e('0x47')]['id']}})[_0x895e('0x29')](handleEntityNotFound(_0x279b0f,null))[_0x895e('0x29')](saveUpdates(_0x18c1df[_0x895e('0x4d')],null))[_0x895e('0x29')](respondWithResult(_0x279b0f,null))[_0x895e('0x46')](handleError(_0x279b0f,null));};exports[_0x895e('0x2a')]=function(_0x4a7c0f,_0x451b56){return db['FaxQueue']['find']({'where':{'id':_0x4a7c0f['params']['id']}})['then'](handleEntityNotFound(_0x451b56,null))[_0x895e('0x29')](removeEntity(_0x451b56,null))[_0x895e('0x46')](handleError(_0x451b56,null));};exports['describe']=function(_0xa62df1,_0x2b5e3a){return db[_0x895e('0x42')][_0x895e('0x56')]()[_0x895e('0x29')](respondWithResult(_0x2b5e3a,null))[_0x895e('0x46')](handleError(_0x2b5e3a,null));};exports[_0x895e('0x57')]=function(_0x35ee6e,_0xc200d6,_0x59807a){var _0xb30950={'raw':!![],'where':{}},_0x2becdb={},_0x22d503;return db[_0x895e('0x42')][_0x895e('0x58')]({'where':{'id':_0x35ee6e['params']['id']}})[_0x895e('0x29')](handleEntityNotFound(_0xc200d6,null))['then'](function(_0x249539){if(_0x249539){_0x22d503=_0x249539[_0x895e('0x2b')]({'plain':!![]});_0x2becdb['model']=_[_0x895e('0x49')](db[_0x895e('0x59')][_0x895e('0x48')]);_0x2becdb[_0x895e('0x34')]=_['keys'](_0x35ee6e[_0x895e('0x34')]);_0x2becdb['filters']=_['intersection'](_0x2becdb[_0x895e('0x33')],_0x2becdb['query']);_0xb30950[_0x895e('0x37')]=_[_0x895e('0x36')](_0x2becdb[_0x895e('0x33')],qs[_0x895e('0x38')](_0x35ee6e[_0x895e('0x34')][_0x895e('0x38')]));_0xb30950['attributes']=_0xb30950['attributes'][_0x895e('0x39')]?_0xb30950[_0x895e('0x37')]:_0x2becdb[_0x895e('0x33')];if(!_0x35ee6e[_0x895e('0x34')][_0x895e('0x3a')]('nolimit')){_0xb30950[_0x895e('0x24')]=qs['limit'](_0x35ee6e[_0x895e('0x34')]['limit']);_0xb30950['offset']=qs[_0x895e('0x22')](_0x35ee6e[_0x895e('0x34')][_0x895e('0x22')]);}_0xb30950[_0x895e('0x3c')]=qs[_0x895e('0x3d')](_0x35ee6e[_0x895e('0x34')][_0x895e('0x3d')]);_0xb30950[_0x895e('0x40')]=qs['filters'](_[_0x895e('0x5a')](_0x35ee6e['query'],_0x2becdb[_0x895e('0x35')]));_0xb30950[_0x895e('0x40')][_0x895e('0x5b')]=_0x249539['id'];if(_0x35ee6e[_0x895e('0x34')]['filter']){_0xb30950[_0x895e('0x40')]=_[_0x895e('0x3f')](_0xb30950[_0x895e('0x40')],{'$or':_[_0x895e('0x30')](_0xb30950[_0x895e('0x37')],function(_0x324d3d){var _0x12c723={};_0x12c723[_0x324d3d]={'$like':'%'+_0x35ee6e['query']['filter']+'%'};return _0x12c723;})});}_0xb30950=_[_0x895e('0x3f')]({},_0xb30950,_0x35ee6e[_0x895e('0x5c')]);return db[_0x895e('0x59')]['findAll'](_0xb30950);}})['then'](function(_0x5e4dae){if(_0x5e4dae){return db[_0x895e('0x5d')][_0x895e('0x5e')]({'where':{'id':_[_0x895e('0x30')](_0x5e4dae,_0x895e('0x5f')),'role':_0x895e('0x60')},'attributes':['id',_0x895e('0x2e'),_0x895e('0x61'),'updatedAt',_0x895e('0x62')]});}})[_0x895e('0x29')](function(_0x40bffe){if(_0x40bffe){return{'count':_0x40bffe[_0x895e('0x43')],'rows':_[_0x895e('0x30')](_0x40bffe[_0x895e('0x63')],function(_0x2b2846){return{'membername':_0x2b2846[_0x895e('0x2e')],'UserId':_0x2b2846['id'],'queue_name':_0x22d503[_0x895e('0x2e')],'FaxQueueId':_0x22d503['id'],'interface':util['format']('%s/%s',_0x895e('0x64'),_0x2b2846[_0x895e('0x2e')]),'penalty':0x0,'paused':_0x2b2846['faxPause'],'createdAt':_0x2b2846['createdAt'],'updatedAt':_0x2b2846['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xc200d6,_0xb30950))[_0x895e('0x46')](handleError(_0xc200d6,null));};exports['getTeams']=function(_0x3daa02,_0x192bf5,_0x5613db){var _0x5d85a7={};var _0x143620={};var _0x4943e2;var _0x2a6a13;return db[_0x895e('0x42')][_0x895e('0x58')]({'where':{'id':_0x3daa02[_0x895e('0x47')]['id']}})[_0x895e('0x29')](handleEntityNotFound(_0x192bf5,null))[_0x895e('0x29')](function(_0x4a339d){if(_0x4a339d){_0x4943e2=_0x4a339d;_0x143620[_0x895e('0x33')]=_['keys'](db[_0x895e('0x65')][_0x895e('0x48')]);_0x143620[_0x895e('0x34')]=_[_0x895e('0x49')](_0x3daa02[_0x895e('0x34')]);_0x143620[_0x895e('0x35')]=_[_0x895e('0x36')](_0x143620[_0x895e('0x33')],_0x143620['query']);_0x5d85a7['attributes']=_['intersection'](_0x143620[_0x895e('0x33')],qs['fields'](_0x3daa02[_0x895e('0x34')][_0x895e('0x38')]));_0x5d85a7['attributes']=_0x5d85a7[_0x895e('0x37')]['length']?_0x5d85a7[_0x895e('0x37')]:_0x143620[_0x895e('0x33')];_0x5d85a7[_0x895e('0x3c')]=qs[_0x895e('0x3d')](_0x3daa02[_0x895e('0x34')][_0x895e('0x3d')]);_0x5d85a7[_0x895e('0x40')]=qs[_0x895e('0x35')](_[_0x895e('0x5a')](_0x3daa02[_0x895e('0x34')],_0x143620[_0x895e('0x35')]));if(_0x3daa02[_0x895e('0x34')][_0x895e('0x3e')]){_0x5d85a7[_0x895e('0x40')]=_['merge'](_0x5d85a7[_0x895e('0x40')],{'$or':_[_0x895e('0x30')](_0x5d85a7['attributes'],function(_0x12fdac){var _0x520519={};_0x520519[_0x12fdac]={'$like':'%'+_0x3daa02[_0x895e('0x34')][_0x895e('0x3e')]+'%'};return _0x520519;})});}_0x5d85a7=_[_0x895e('0x3f')]({},_0x5d85a7,_0x3daa02[_0x895e('0x5c')]);return _0x4943e2[_0x895e('0x66')](_0x5d85a7);}})[_0x895e('0x29')](function(_0x22285f){if(_0x22285f){_0x2a6a13=_0x22285f[_0x895e('0x39')];if(!_0x3daa02[_0x895e('0x34')][_0x895e('0x3a')](_0x895e('0x3b'))){_0x5d85a7[_0x895e('0x24')]=qs[_0x895e('0x24')](_0x3daa02[_0x895e('0x34')]['limit']);_0x5d85a7[_0x895e('0x22')]=qs[_0x895e('0x22')](_0x3daa02[_0x895e('0x34')]['offset']);}return _0x4943e2[_0x895e('0x66')](_0x5d85a7);}})[_0x895e('0x29')](function(_0x401549){if(_0x401549){return _0x401549?{'count':_0x2a6a13,'rows':_0x401549}:null;}})[_0x895e('0x29')](respondWithResult(_0x192bf5,null))[_0x895e('0x46')](handleError(_0x192bf5,null));};exports[_0x895e('0x67')]=function(_0x36c528,_0x2be635,_0x4e374b){var _0x518b03=_0x36c528[_0x895e('0x4d')]['ids'];return db[_0x895e('0x65')][_0x895e('0x45')]({'where':{'id':_0x518b03},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x895e('0x2e'),_0x895e('0x68'),_0x895e('0x69'),_0x895e('0x6a')],'raw':!![]}]})['then'](function(_0x5129e5){if(_0x5129e5){var _0x16fa94=_[_0x895e('0x6b')](_0x5129e5,function(_0x54d796){var _0x1c8ab0=_0x54d796['get']({'plain':!![]});return _0x1c8ab0['Agents'];});return db[_0x895e('0x42')][_0x895e('0x4b')]({'where':{'id':_0x36c528[_0x895e('0x47')]['id']}})[_0x895e('0x29')](function(_0xbbe8ef){return db[_0x895e('0x6c')][_0x895e('0x6d')](function(_0x5e65c0){return _0xbbe8ef['addTeams'](_0x518b03,{'transaction':_0x5e65c0})['then'](function(){return BPromise['each'](_0x16fa94,function(_0x4abda5){return db[_0x895e('0x59')]['findOrCreate']({'where':{'UserId':_0x4abda5['id'],'FaxQueueId':_0x36c528[_0x895e('0x47')]['id']},'transaction':_0x5e65c0});});})['then'](function(){_0x16fa94[_0x895e('0x6e')](function(_0x55d603){socket[_0x895e('0x6f')](_0x895e('0x70'),{'UserId':_0x55d603['id'],'FaxQueueId':_0xbbe8ef['id']});});});});});}})[_0x895e('0x29')](respondWithStatusCode(_0x2be635,null))[_0x895e('0x46')](handleError(_0x2be635,null));};exports['removeTeams']=function(_0x57b07c,_0xbf8e20,_0x45182a){return db['Team'][_0x895e('0x45')]({'where':{'id':_0x57b07c['query'][_0x895e('0x71')]},'attributes':['id'],'include':[{'model':db[_0x895e('0x5d')],'as':_0x895e('0x72'),'attributes':['id'],'raw':!![]}]})[_0x895e('0x29')](handleEntityNotFound(_0xbf8e20,null))['then'](function(_0x58ba2f){var _0xc5ec4a=_[_0x895e('0x30')](_0x58ba2f,'id');var _0x892bfc=[];var _0xb4506=[];var _0x16d12b=squel['select']();_0x16d12b[_0x895e('0x73')](_0x895e('0x74'))[_0x895e('0x75')](_0x895e('0x76'),'tq')['join'](_0x895e('0x77'),'ut',_0x895e('0x78'))[_0x895e('0x40')](_0x895e('0x79'),_0x57b07c[_0x895e('0x47')]['id']);for(var _0x3e8aa9=0x0;_0x3e8aa9<_0x58ba2f[_0x895e('0x39')];_0x3e8aa9+=0x1){let _0x54ed3d=_0x58ba2f[_0x3e8aa9];for(var _0x22b5e2=0x0;_0x22b5e2<_0x54ed3d[_0x895e('0x72')][_0x895e('0x39')];_0x22b5e2+=0x1){let _0x39be98=_0x54ed3d[_0x895e('0x72')][_0x22b5e2];var _0x1369a7=_0x16d12b['clone']();_0x1369a7[_0x895e('0x40')](_0x895e('0x7a'),_0x39be98['id']);_0xb4506[_0x895e('0x7b')](db[_0x895e('0x6c')]['query'](_0x1369a7[_0x895e('0x7c')](),{'type':db[_0x895e('0x6c')]['QueryTypes']['SELECT']})[_0x895e('0x29')](function(_0x4d164b){if(_0x4d164b['length']===0x1){return _0x39be98['id'];}else{var _0x5197ad=_[_0x895e('0x7d')](_[_0x895e('0x30')](_0x4d164b,'TeamId'),function(_0x1ea083){return _[_0x895e('0x7e')](_0xc5ec4a,_0x1ea083);});if(_0x5197ad){return _0x39be98['id'];}}}));}}return BPromise['all'](_0xb4506)[_0x895e('0x29')](function(_0x2b75b6){_0x892bfc=_(_0x892bfc)[_0x895e('0x7f')](_0x2b75b6)[_0x895e('0x80')]()[_0x895e('0x81')]();return db['FaxQueue'][_0x895e('0x4b')]({'where':{'id':_0x57b07c['params']['id']}})[_0x895e('0x29')](function(_0x53ab1b){return db[_0x895e('0x6c')][_0x895e('0x6d')](function(_0x510873){return _0x53ab1b[_0x895e('0x82')](_0x57b07c[_0x895e('0x34')][_0x895e('0x71')],{'transaction':_0x510873})[_0x895e('0x29')](function(){if(!_['isEmpty'](_0x892bfc)){return _0x53ab1b['removeAgents'](_0x892bfc,{'transaction':_0x510873});}})[_0x895e('0x29')](function(){_0x892bfc[_0x895e('0x6e')](function(_0x3c75f3){socket['emit']('userFaxQueue:remove',{'UserId':_0x3c75f3,'FaxQueueId':_0x53ab1b['id']});});});});});});})[_0x895e('0x29')](respondWithStatusCode(_0xbf8e20,null))[_0x895e('0x46')](handleError(_0xbf8e20,null));};exports[_0x895e('0x83')]=function(_0x11fa1a,_0x16517b,_0x2ed0ff){return db[_0x895e('0x42')]['find']({'where':{'id':_0x11fa1a[_0x895e('0x47')]['id']}})[_0x895e('0x29')](handleEntityNotFound(_0x16517b,null))[_0x895e('0x29')](function(_0x11855f){if(_0x11855f){return _0x11855f[_0x895e('0x83')](_0x11fa1a[_0x895e('0x4d')][_0x895e('0x71')],_[_0x895e('0x84')](_0x11fa1a[_0x895e('0x4d')],[_0x895e('0x71'),'id'])||{})[_0x895e('0x85')](function(_0x53ce1e){for(var _0x21f312=0x0;_0x21f312<_0x11fa1a['body']['ids'][_0x895e('0x39')];_0x21f312+=0x1){socket['emit'](_0x895e('0x70'),{'UserId':Number(_0x11fa1a[_0x895e('0x4d')]['ids'][_0x21f312]),'FaxQueueId':Number(_0x11fa1a[_0x895e('0x47')]['id'])});}return _0x53ce1e;});}})[_0x895e('0x29')](respondWithResult(_0x16517b,null))['catch'](handleError(_0x16517b,null));};exports['removeAgents']=function(_0x2cd215,_0x222d82,_0x3d3dfa){return db[_0x895e('0x42')]['find']({'where':{'id':_0x2cd215[_0x895e('0x47')]['id']}})[_0x895e('0x29')](handleEntityNotFound(_0x222d82,null))[_0x895e('0x29')](function(_0x5d9d66){if(_0x5d9d66){return _0x5d9d66['removeAgents'](_0x2cd215[_0x895e('0x34')]['ids'])[_0x895e('0x29')](function(){if(_[_0x895e('0x86')](_0x2cd215[_0x895e('0x34')][_0x895e('0x71')])){for(var _0x15b36e=0x0;_0x15b36e<_0x2cd215[_0x895e('0x34')]['ids'][_0x895e('0x39')];_0x15b36e+=0x1){socket[_0x895e('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x2cd215[_0x895e('0x34')][_0x895e('0x71')][_0x15b36e]),'FaxQueueId':Number(_0x2cd215['params']['id'])});}}else{socket[_0x895e('0x6f')](_0x895e('0x87'),{'UserId':Number(_0x2cd215[_0x895e('0x34')]['ids']),'FaxQueueId':Number(_0x2cd215['params']['id'])});}});}})[_0x895e('0x29')](respondWithStatusCode(_0x222d82,null))['catch'](handleError(_0x222d82,null));};exports[_0x895e('0x88')]=function(_0x279b59,_0x13ff9d,_0x229fc6){var _0x22b83d={};var _0x4142e7={};var _0x4b6953;var _0x38b7ef;return db[_0x895e('0x42')][_0x895e('0x58')]({'where':{'id':_0x279b59[_0x895e('0x47')]['id']}})[_0x895e('0x29')](handleEntityNotFound(_0x13ff9d,null))[_0x895e('0x29')](function(_0x1e807e){if(_0x1e807e){_0x4b6953=_0x1e807e;_0x4142e7[_0x895e('0x33')]=_[_0x895e('0x49')](db[_0x895e('0x5d')]['rawAttributes']);_0x4142e7[_0x895e('0x34')]=_['keys'](_0x279b59[_0x895e('0x34')]);_0x4142e7[_0x895e('0x35')]=_[_0x895e('0x36')](_0x4142e7[_0x895e('0x33')],_0x4142e7[_0x895e('0x34')]);_0x22b83d[_0x895e('0x37')]=_[_0x895e('0x36')](_0x4142e7[_0x895e('0x33')],qs[_0x895e('0x38')](_0x279b59[_0x895e('0x34')][_0x895e('0x38')]));_0x22b83d[_0x895e('0x37')]=_0x22b83d[_0x895e('0x37')][_0x895e('0x39')]?_0x22b83d[_0x895e('0x37')]:_0x4142e7[_0x895e('0x33')];_0x22b83d[_0x895e('0x3c')]=qs[_0x895e('0x3d')](_0x279b59[_0x895e('0x34')][_0x895e('0x3d')]);_0x22b83d[_0x895e('0x40')]=qs[_0x895e('0x35')](_[_0x895e('0x5a')](_0x279b59[_0x895e('0x34')],_0x4142e7['filters']));if(_0x279b59['query'][_0x895e('0x3e')]){_0x22b83d['where']=_['merge'](_0x22b83d['where'],{'$or':_[_0x895e('0x30')](_0x22b83d[_0x895e('0x37')],function(_0x586ed6){var _0x19da46={};_0x19da46[_0x586ed6]={'$like':'%'+_0x279b59[_0x895e('0x34')][_0x895e('0x3e')]+'%'};return _0x19da46;})});}_0x22b83d=_[_0x895e('0x3f')]({},_0x22b83d,_0x279b59[_0x895e('0x5c')]);return _0x4b6953[_0x895e('0x88')](_0x22b83d);}})[_0x895e('0x29')](function(_0x1a2516){if(_0x1a2516){_0x38b7ef=_0x1a2516[_0x895e('0x39')];if(!_0x279b59[_0x895e('0x34')][_0x895e('0x3a')](_0x895e('0x3b'))){_0x22b83d[_0x895e('0x24')]=qs[_0x895e('0x24')](_0x279b59[_0x895e('0x34')][_0x895e('0x24')]);_0x22b83d[_0x895e('0x22')]=qs[_0x895e('0x22')](_0x279b59[_0x895e('0x34')][_0x895e('0x22')]);}return _0x4b6953[_0x895e('0x88')](_0x22b83d);}})[_0x895e('0x29')](function(_0x2f798b){if(_0x2f798b){return _0x2f798b?{'count':_0x38b7ef,'rows':_0x2f798b}:null;}})[_0x895e('0x29')](respondWithResult(_0x13ff9d,null))[_0x895e('0x46')](handleError(_0x13ff9d,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 4bd9be7..81a842a 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 _0xb946=['../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4c6351,_0x5b6b48){var _0x92bc5b=function(_0x4f2a70){while(--_0x4f2a70){_0x4c6351['push'](_0x4c6351['shift']());}};_0x92bc5b(++_0x5b6b48);}(_0xb946,0xc8));var _0x6b94=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb946[_0x2d7f0e];return _0x110b07;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x6b94('0x0'))['db'][_0x6b94('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6b94('0x2')](0x0);var events={'afterCreate':_0x6b94('0x3'),'afterUpdate':_0x6b94('0x4'),'afterDestroy':_0x6b94('0x5')};function emitEvent(_0x3a4d3b){return function(_0x5c422e,_0x147f9e,_0x19972a){FaxQueueEvents[_0x6b94('0x6')](_0x3a4d3b+':'+_0x5c422e['id'],_0x5c422e);FaxQueueEvents[_0x6b94('0x6')](_0x3a4d3b,_0x5c422e);_0x19972a(null);};}for(var e in events){if(events[_0x6b94('0x7')](e)){var event=events[e];FaxQueue[_0x6b94('0x8')](e,emitEvent(event));}}module[_0x6b94('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x8960=['hasOwnProperty','events','FaxQueue','setMaxListeners','save','update','emit'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0x8960,0xa2));var _0x0896=function(_0x5bdeb5,_0x10be85){_0x5bdeb5=_0x5bdeb5-0x0;var _0x34be77=_0x8960[_0x5bdeb5];return _0x34be77;};'use strict';var EventEmitter=require(_0x0896('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x0896('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0896('0x2')](0x0);var events={'afterCreate':_0x0896('0x3'),'afterUpdate':_0x0896('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1aa003){return function(_0x3fc355,_0x5cbf01,_0x522531){FaxQueueEvents['emit'](_0x1aa003+':'+_0x3fc355['id'],_0x3fc355);FaxQueueEvents[_0x0896('0x5')](_0x1aa003,_0x3fc355);_0x522531(null);};}for(var e in events){if(events[_0x0896('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index df6bce7..3f7be43 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 _0x1958=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','lodash'];(function(_0x10fb43,_0x45099b){var _0x56b6c6=function(_0x3493ac){while(--_0x3493ac){_0x10fb43['push'](_0x10fb43['shift']());}};_0x56b6c6(++_0x45099b);}(_0x1958,0x1d3));var _0x8195=function(_0xb87d55,_0x578ce1){_0xb87d55=_0xb87d55-0x0;var _0x1c31c8=_0x1958[_0xb87d55];return _0x1c31c8;};'use strict';var _=require(_0x8195('0x0'));var util=require('util');var logger=require(_0x8195('0x1'))(_0x8195('0x2'));var moment=require(_0x8195('0x3'));var BPromise=require(_0x8195('0x4'));var rp=require(_0x8195('0x5'));var fs=require('fs');var path=require(_0x8195('0x6'));var rimraf=require(_0x8195('0x7'));var config=require(_0x8195('0x8'));var attributes=require(_0x8195('0x9'));module[_0x8195('0xa')]=function(_0x4cb6a5,_0x485d84){return _0x4cb6a5[_0x8195('0xb')](_0x8195('0xc'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ba5=['exports','define','FaxQueue','fax_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes'];(function(_0x10a037,_0x376d59){var _0x4191fe=function(_0x183699){while(--_0x183699){_0x10a037['push'](_0x10a037['shift']());}};_0x4191fe(++_0x376d59);}(_0x9ba5,0xd4));var _0x59ba=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9ba5[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x59ba('0x0'));var util=require('util');var logger=require(_0x59ba('0x1'))(_0x59ba('0x2'));var moment=require(_0x59ba('0x3'));var BPromise=require('bluebird');var rp=require(_0x59ba('0x4'));var fs=require('fs');var path=require(_0x59ba('0x5'));var rimraf=require(_0x59ba('0x6'));var config=require(_0x59ba('0x7'));var attributes=require(_0x59ba('0x8'));module[_0x59ba('0x9')]=function(_0x58480f,_0x6b5c19){return _0x58480f[_0x59ba('0xa')](_0x59ba('0xb'),attributes,{'tableName':_0x59ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 8c6126a..005f136 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 _0x4c10=['stringify','ShowFaxQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFaxQueue','options','raw','attributes','limit','map','include','model','FaxQueue','find','where'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x4c10,0xf2));var _0x04c1=function(_0xabaaee,_0x1a3a6c){_0xabaaee=_0xabaaee-0x0;var _0x331502=_0x4c10[_0xabaaee];return _0x331502;};'use strict';var _=require(_0x04c1('0x0'));var util=require(_0x04c1('0x1'));var moment=require(_0x04c1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c1('0x3'));var db=require(_0x04c1('0x4'))['db'];var utils=require(_0x04c1('0x5'));var logger=require(_0x04c1('0x6'))(_0x04c1('0x7'));var config=require(_0x04c1('0x8'));var jayson=require(_0x04c1('0x9'));var client=jayson[_0x04c1('0xa')][_0x04c1('0xb')]({'port':0x232a});config[_0x04c1('0xc')]=_[_0x04c1('0xd')](config[_0x04c1('0xc')],{'host':_0x04c1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04c1('0xc')]));require(_0x04c1('0xf'))['register'](socket);function respondWithRpcPromise(_0x503047,_0x29fadb,_0x578623){return new BPromise(function(_0xf8174f,_0x443c74){return client[_0x04c1('0x10')](_0x503047,_0x578623)[_0x04c1('0x11')](function(_0x388938){logger[_0x04c1('0x12')](_0x04c1('0x13'),_0x29fadb,_0x04c1('0x14'));logger[_0x04c1('0x15')](_0x04c1('0x16'),_0x29fadb,_0x04c1('0x14'),JSON['stringify'](_0x388938));if(_0x388938[_0x04c1('0x17')]){if(_0x388938[_0x04c1('0x17')]['code']===0x1f4){logger[_0x04c1('0x17')](_0x04c1('0x13'),_0x29fadb,_0x388938[_0x04c1('0x17')]['message']);return _0x443c74(_0x388938['error'][_0x04c1('0x18')]);}logger['error'](_0x04c1('0x13'),_0x29fadb,_0x388938[_0x04c1('0x17')][_0x04c1('0x18')]);return _0xf8174f(_0x388938[_0x04c1('0x17')][_0x04c1('0x18')]);}else{logger[_0x04c1('0x12')](_0x04c1('0x13'),_0x29fadb,'request\x20sent');_0xf8174f(_0x388938[_0x04c1('0x19')][_0x04c1('0x18')]);}})[_0x04c1('0x1a')](function(_0xd51a0c){logger[_0x04c1('0x17')](_0x04c1('0x13'),_0x29fadb,_0xd51a0c);_0x443c74(_0xd51a0c);});});}exports[_0x04c1('0x1b')]=function(_0x496e34){var _0x1c74bc=this;return new Promise(function(_0x2c0a87,_0x49aad2){return db['FaxQueue']['findAll']({'raw':_0x496e34[_0x04c1('0x1c')]?_0x496e34[_0x04c1('0x1c')][_0x04c1('0x1d')]===undefined?!![]:![]:!![],'where':_0x496e34[_0x04c1('0x1c')]?_0x496e34[_0x04c1('0x1c')]['where']||null:null,'attributes':_0x496e34['options']?_0x496e34[_0x04c1('0x1c')][_0x04c1('0x1e')]||null:null,'limit':_0x496e34[_0x04c1('0x1c')]?_0x496e34[_0x04c1('0x1c')][_0x04c1('0x1f')]||null:null,'include':_0x496e34['options']?_0x496e34[_0x04c1('0x1c')]['include']?_[_0x04c1('0x20')](_0x496e34['options']['include'],function(_0x4fad05){return{'model':db[_0x4fad05['model']],'as':_0x4fad05['as'],'attributes':_0x4fad05['attributes'],'include':_0x4fad05[_0x04c1('0x21')]?_['map'](_0x4fad05['include'],function(_0x3c4537){return{'model':db[_0x3c4537[_0x04c1('0x22')]],'as':_0x3c4537['as'],'attributes':_0x3c4537[_0x04c1('0x1e')],'include':_0x3c4537[_0x04c1('0x21')]?_[_0x04c1('0x20')](_0x3c4537['include'],function(_0xbd06d2){return{'model':db[_0xbd06d2[_0x04c1('0x22')]],'as':_0xbd06d2['as'],'attributes':_0xbd06d2[_0x04c1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x04c1('0x11')](function(_0x5e6378){logger[_0x04c1('0x12')](_0x04c1('0x1b'),_0x496e34);logger[_0x04c1('0x15')](_0x04c1('0x1b'),_0x496e34,JSON['stringify'](_0x5e6378));_0x2c0a87(_0x5e6378);})[_0x04c1('0x1a')](function(_0x2c1034){logger[_0x04c1('0x17')](_0x04c1('0x1b'),_0x2c1034[_0x04c1('0x18')],_0x496e34);_0x49aad2(_0x1c74bc[_0x04c1('0x17')](0x1f4,_0x2c1034['message']));});});};exports['ShowFaxQueue']=function(_0x308339){var _0x31bac1=this;return new Promise(function(_0x7947a4,_0x442a77){return db[_0x04c1('0x23')][_0x04c1('0x24')]({'raw':_0x308339[_0x04c1('0x1c')]?_0x308339[_0x04c1('0x1c')][_0x04c1('0x1d')]===undefined?!![]:![]:!![],'where':_0x308339[_0x04c1('0x1c')]?_0x308339[_0x04c1('0x1c')][_0x04c1('0x25')]||null:null,'attributes':_0x308339[_0x04c1('0x1c')]?_0x308339['options'][_0x04c1('0x1e')]||null:null,'include':_0x308339[_0x04c1('0x1c')]?_0x308339[_0x04c1('0x1c')][_0x04c1('0x21')]?_[_0x04c1('0x20')](_0x308339[_0x04c1('0x1c')][_0x04c1('0x21')],function(_0x4fba3d){return{'model':db[_0x4fba3d[_0x04c1('0x22')]],'as':_0x4fba3d['as'],'attributes':_0x4fba3d[_0x04c1('0x1e')],'include':_0x4fba3d[_0x04c1('0x21')]?_[_0x04c1('0x20')](_0x4fba3d[_0x04c1('0x21')],function(_0x2b3e1d){return{'model':db[_0x2b3e1d[_0x04c1('0x22')]],'as':_0x2b3e1d['as'],'attributes':_0x2b3e1d[_0x04c1('0x1e')],'include':_0x2b3e1d[_0x04c1('0x21')]?_[_0x04c1('0x20')](_0x2b3e1d[_0x04c1('0x21')],function(_0x57fbb0){return{'model':db[_0x57fbb0['model']],'as':_0x57fbb0['as'],'attributes':_0x57fbb0[_0x04c1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x04c1('0x11')](function(_0x1736b1){logger[_0x04c1('0x12')]('ShowFaxQueue',_0x308339);logger[_0x04c1('0x15')]('ShowFaxQueue',_0x308339,JSON[_0x04c1('0x26')](_0x1736b1));_0x7947a4(_0x1736b1);})[_0x04c1('0x1a')](function(_0x3eb9fc){logger[_0x04c1('0x17')](_0x04c1('0x27'),_0x3eb9fc[_0x04c1('0x18')],_0x308339);_0x442a77(_0x31bac1[_0x04c1('0x17')](0x1f4,_0x3eb9fc[_0x04c1('0x18')]));});});}; \ No newline at end of file +var _0x5a99=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','ShowFaxQueue','find','where','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5a99,0x1cf));var _0x95a9=function(_0x59a96a,_0x5327b5){_0x59a96a=_0x59a96a-0x0;var _0x5cb684=_0x5a99[_0x59a96a];return _0x5cb684;};'use strict';var _=require(_0x95a9('0x0'));var util=require(_0x95a9('0x1'));var moment=require(_0x95a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x95a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95a9('0x4'));var logger=require(_0x95a9('0x5'))(_0x95a9('0x6'));var config=require(_0x95a9('0x7'));var jayson=require(_0x95a9('0x8'));var client=jayson['client'][_0x95a9('0x9')]({'port':0x232a});config[_0x95a9('0xa')]=_['defaults'](config[_0x95a9('0xa')],{'host':_0x95a9('0xb'),'port':0x18eb});var socket=require(_0x95a9('0xc'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x95a9('0xd')](socket);function respondWithRpcPromise(_0x200136,_0x3697d3,_0x290b41){return new BPromise(function(_0x173275,_0x253be4){return client[_0x95a9('0xe')](_0x200136,_0x290b41)[_0x95a9('0xf')](function(_0x245d2b){logger['info'](_0x95a9('0x10'),_0x3697d3,'request\x20sent');logger[_0x95a9('0x11')](_0x95a9('0x12'),_0x3697d3,'request\x20sent',JSON[_0x95a9('0x13')](_0x245d2b));if(_0x245d2b[_0x95a9('0x14')]){if(_0x245d2b[_0x95a9('0x14')][_0x95a9('0x15')]===0x1f4){logger['error'](_0x95a9('0x10'),_0x3697d3,_0x245d2b[_0x95a9('0x14')][_0x95a9('0x16')]);return _0x253be4(_0x245d2b[_0x95a9('0x14')][_0x95a9('0x16')]);}logger[_0x95a9('0x14')]('FaxQueue,\x20%s,\x20%s',_0x3697d3,_0x245d2b['error']['message']);return _0x173275(_0x245d2b[_0x95a9('0x14')]['message']);}else{logger[_0x95a9('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3697d3,_0x95a9('0x18'));_0x173275(_0x245d2b[_0x95a9('0x19')][_0x95a9('0x16')]);}})[_0x95a9('0x1a')](function(_0x536701){logger[_0x95a9('0x14')]('FaxQueue,\x20%s,\x20%s',_0x3697d3,_0x536701);_0x253be4(_0x536701);});});}exports[_0x95a9('0x1b')]=function(_0x26dedf){var _0xbf993f=this;return new Promise(function(_0x4d099d,_0x2a91a4){return db[_0x95a9('0x1c')][_0x95a9('0x1d')]({'raw':_0x26dedf[_0x95a9('0x1e')]?_0x26dedf['options'][_0x95a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x26dedf[_0x95a9('0x1e')]?_0x26dedf[_0x95a9('0x1e')]['where']||null:null,'attributes':_0x26dedf[_0x95a9('0x1e')]?_0x26dedf['options'][_0x95a9('0x20')]||null:null,'limit':_0x26dedf[_0x95a9('0x1e')]?_0x26dedf[_0x95a9('0x1e')][_0x95a9('0x21')]||null:null,'include':_0x26dedf[_0x95a9('0x1e')]?_0x26dedf[_0x95a9('0x1e')][_0x95a9('0x22')]?_[_0x95a9('0x23')](_0x26dedf[_0x95a9('0x1e')][_0x95a9('0x22')],function(_0x1e5bb5){return{'model':db[_0x1e5bb5[_0x95a9('0x24')]],'as':_0x1e5bb5['as'],'attributes':_0x1e5bb5['attributes'],'include':_0x1e5bb5['include']?_[_0x95a9('0x23')](_0x1e5bb5[_0x95a9('0x22')],function(_0x77292e){return{'model':db[_0x77292e['model']],'as':_0x77292e['as'],'attributes':_0x77292e[_0x95a9('0x20')],'include':_0x77292e[_0x95a9('0x22')]?_['map'](_0x77292e[_0x95a9('0x22')],function(_0x16dc1a){return{'model':db[_0x16dc1a['model']],'as':_0x16dc1a['as'],'attributes':_0x16dc1a['attributes']};}):[]};}):[]};}):[]:[]})[_0x95a9('0xf')](function(_0x2cd6b2){logger[_0x95a9('0x17')](_0x95a9('0x1b'),_0x26dedf);logger['debug']('GetFaxQueue',_0x26dedf,JSON[_0x95a9('0x13')](_0x2cd6b2));_0x4d099d(_0x2cd6b2);})[_0x95a9('0x1a')](function(_0x14b5ae){logger[_0x95a9('0x14')]('GetFaxQueue',_0x14b5ae['message'],_0x26dedf);_0x2a91a4(_0xbf993f[_0x95a9('0x14')](0x1f4,_0x14b5ae[_0x95a9('0x16')]));});});};exports[_0x95a9('0x25')]=function(_0x5054be){var _0x3853d8=this;return new Promise(function(_0x51ea81,_0x53e522){return db[_0x95a9('0x1c')][_0x95a9('0x26')]({'raw':_0x5054be['options']?_0x5054be[_0x95a9('0x1e')][_0x95a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x5054be['options']?_0x5054be[_0x95a9('0x1e')][_0x95a9('0x27')]||null:null,'attributes':_0x5054be[_0x95a9('0x1e')]?_0x5054be[_0x95a9('0x1e')][_0x95a9('0x20')]||null:null,'include':_0x5054be[_0x95a9('0x1e')]?_0x5054be[_0x95a9('0x1e')][_0x95a9('0x22')]?_['map'](_0x5054be['options'][_0x95a9('0x22')],function(_0x4f0736){return{'model':db[_0x4f0736[_0x95a9('0x24')]],'as':_0x4f0736['as'],'attributes':_0x4f0736[_0x95a9('0x20')],'include':_0x4f0736[_0x95a9('0x22')]?_[_0x95a9('0x23')](_0x4f0736[_0x95a9('0x22')],function(_0x486627){return{'model':db[_0x486627[_0x95a9('0x24')]],'as':_0x486627['as'],'attributes':_0x486627[_0x95a9('0x20')],'include':_0x486627['include']?_[_0x95a9('0x23')](_0x486627['include'],function(_0x43d7ae){return{'model':db[_0x43d7ae[_0x95a9('0x24')]],'as':_0x43d7ae['as'],'attributes':_0x43d7ae[_0x95a9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x95a9('0xf')](function(_0x404eed){logger[_0x95a9('0x17')](_0x95a9('0x25'),_0x5054be);logger[_0x95a9('0x11')](_0x95a9('0x25'),_0x5054be,JSON[_0x95a9('0x13')](_0x404eed));_0x51ea81(_0x404eed);})[_0x95a9('0x1a')](function(_0x166092){logger[_0x95a9('0x14')]('ShowFaxQueue',_0x166092[_0x95a9('0x16')],_0x5054be);_0x53e522(_0x3853d8[_0x95a9('0x14')](0x1f4,_0x166092[_0x95a9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 868cf30..b5dc8df 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 _0x2908=['save','remove','update','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2908,0x1ef));var _0x8290=function(_0x532f2e,_0x3040df){_0x532f2e=_0x532f2e-0x0;var _0x16c496=_0x2908[_0x532f2e];return _0x16c496;};'use strict';var FaxQueueEvents=require(_0x8290('0x0'));var events=[_0x8290('0x1'),_0x8290('0x2'),_0x8290('0x3')];function createListener(_0x144d6f,_0x4c1401){return function(_0x4afa4f){_0x4c1401[_0x8290('0x4')](_0x144d6f,_0x4afa4f);};}function removeListener(_0x502985,_0x2f3457){return function(){FaxQueueEvents[_0x8290('0x5')](_0x502985,_0x2f3457);};}exports['register']=function(_0x38afc8){for(var _0x5574d0=0x0,_0x35cd63=events[_0x8290('0x6')];_0x5574d0<_0x35cd63;_0x5574d0++){var _0x5a2b80=events[_0x5574d0];var _0xdb344c=createListener(_0x8290('0x7')+_0x5a2b80,_0x38afc8);FaxQueueEvents['on'](_0x5a2b80,_0xdb344c);}}; \ No newline at end of file +var _0xa3d8=['faxQueue:','./faxQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x337d66,_0x15935e){var _0x17c348=function(_0x521ee8){while(--_0x521ee8){_0x337d66['push'](_0x337d66['shift']());}};_0x17c348(++_0x15935e);}(_0xa3d8,0x1f1));var _0x8a3d=function(_0x424ece,_0x490e50){_0x424ece=_0x424ece-0x0;var _0x3f05f6=_0xa3d8[_0x424ece];return _0x3f05f6;};'use strict';var FaxQueueEvents=require(_0x8a3d('0x0'));var events=['save',_0x8a3d('0x1'),_0x8a3d('0x2')];function createListener(_0x190043,_0x50ea9f){return function(_0xf9ba60){_0x50ea9f[_0x8a3d('0x3')](_0x190043,_0xf9ba60);};}function removeListener(_0x1a9992,_0x13e78d){return function(){FaxQueueEvents[_0x8a3d('0x4')](_0x1a9992,_0x13e78d);};}exports[_0x8a3d('0x5')]=function(_0x202212){for(var _0x3e8092=0x0,_0x3bc7a9=events[_0x8a3d('0x6')];_0x3e8092<_0x3bc7a9;_0x3e8092++){var _0x5b473d=events[_0x3e8092];var _0x3dbdfc=createListener(_0x8a3d('0x7')+_0x5b473d,_0x202212);FaxQueueEvents['on'](_0x5b473d,_0x3dbdfc);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index eb7d499..d8337ba 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 _0xf2e3=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','/:id/users','put','update','delete','destroy','removeAgents','exports'];(function(_0x52bfe2,_0x313ead){var _0x4319c6=function(_0x1d6b17){while(--_0x1d6b17){_0x52bfe2['push'](_0x52bfe2['shift']());}};_0x4319c6(++_0x313ead);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xf2e3[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0xc')](_0x3f2e('0x11'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0xc')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);router[_0x3f2e('0xc')]('/:id/users',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x15')]);router['post']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x16')]);router[_0x3f2e('0x17')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller['addTeams']);router[_0x3f2e('0x17')](_0x3f2e('0x18'),auth[_0x3f2e('0xa')](),controller['addAgents']);router[_0x3f2e('0x19')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1a')]);router[_0x3f2e('0x1b')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1c')]);router[_0x3f2e('0x1b')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller['removeTeams']);router[_0x3f2e('0x1b')](_0x3f2e('0x18'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1d')]);module[_0x3f2e('0x1e')]=router; \ No newline at end of file +var _0x4137=['addTeams','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','post'];(function(_0x183e82,_0x4eef2c){var _0x486be0=function(_0x1f3ba8){while(--_0x1f3ba8){_0x183e82['push'](_0x183e82['shift']());}};_0x486be0(++_0x4eef2c);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/members',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getTeams']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0x15')]('/',auth[_0x7413('0xe')](),controller['create']);router['post']('/:id/teams',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x13'),auth[_0x7413('0xe')](),controller['addAgents']);router[_0x7413('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7413('0x18')]);router['delete'](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x19')]);router[_0x7413('0x1a')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x1a')]('/:id/users',auth[_0x7413('0xe')](),controller[_0x7413('0x1c')]);module[_0x7413('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6a17497..e0fc3a5 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 _0xf50e=['DATE','moment','sequelize','exports','STRING'];(function(_0x228ac9,_0x42f065){var _0x69fe02=function(_0x210551){while(--_0x210551){_0x228ac9['push'](_0x228ac9['shift']());}};_0x69fe02(++_0x42f065);}(_0xf50e,0x1c3));var _0xef50=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xf50e[_0x342700];return _0x53406f;};'use strict';var moment=require(_0xef50('0x0'));var Sequelize=require(_0xef50('0x1'));module[_0xef50('0x2')]={'uniqueid':{'type':Sequelize[_0xef50('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xef50('0x3')]},'joinAt':{'type':Sequelize[_0xef50('0x4')]},'leaveAt':{'type':Sequelize[_0xef50('0x4')]},'acceptAt':{'type':Sequelize[_0xef50('0x4')]},'exitAt':{'type':Sequelize[_0xef50('0x4')]},'reason':{'type':Sequelize[_0xef50('0x3')]}}; \ No newline at end of file +var _0x1d40=['exports','STRING','DATE','moment','sequelize'];(function(_0x1867e3,_0x30e5ce){var _0x494e32=function(_0x2a9446){while(--_0x2a9446){_0x1867e3['push'](_0x1867e3['shift']());}};_0x494e32(++_0x30e5ce);}(_0x1d40,0xbc));var _0x01d4=function(_0x141e26,_0x18b19c){_0x141e26=_0x141e26-0x0;var _0xf0d405=_0x1d40[_0x141e26];return _0xf0d405;};'use strict';var moment=require(_0x01d4('0x0'));var Sequelize=require(_0x01d4('0x1'));module[_0x01d4('0x2')]={'uniqueid':{'type':Sequelize[_0x01d4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x01d4('0x3')]},'joinAt':{'type':Sequelize[_0x01d4('0x4')]},'leaveAt':{'type':Sequelize[_0x01d4('0x4')]},'acceptAt':{'type':Sequelize[_0x01d4('0x4')]},'exitAt':{'type':Sequelize[_0x01d4('0x4')]},'reason':{'type':Sequelize[_0x01d4('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 9bb8cba..cfb783f 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 _0x9567=['zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','save','update','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','destroy','describe','eml-format','rimraf'];(function(_0xfd9f3a,_0x2c87d2){var _0x3b7070=function(_0x49dba9){while(--_0x49dba9){_0xfd9f3a['push'](_0xfd9f3a['shift']());}};_0x3b7070(++_0x2c87d2);}(_0x9567,0xdc));var _0x7956=function(_0x49ede5,_0xc23cba){_0x49ede5=_0x49ede5-0x0;var _0x64bc7d=_0x9567[_0x49ede5];return _0x64bc7d;};'use strict';var emlformat=require(_0x7956('0x0'));var rimraf=require(_0x7956('0x1'));var zipdir=require(_0x7956('0x2'));var jsonpatch=require(_0x7956('0x3'));var rp=require(_0x7956('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7956('0x5'));var util=require(_0x7956('0x6'));var path=require('path');var sox=require(_0x7956('0x7'));var csv=require('to-csv');var ejs=require(_0x7956('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7956('0x9'));var squel=require(_0x7956('0xa'));var crypto=require('crypto');var jsforce=require(_0x7956('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7956('0xc'));var querystring=require(_0x7956('0xd'));var Papa=require('papaparse');var Redis=require(_0x7956('0xe'));var authService=require(_0x7956('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7956('0x10'));var hardwareService=require(_0x7956('0x11'));var logger=require(_0x7956('0x12'))('api');var utils=require(_0x7956('0x13'));var config=require(_0x7956('0x14'));var licenseUtil=require(_0x7956('0x15'));var db=require(_0x7956('0x16'))['db'];function respondWithStatusCode(_0x5b3531,_0x1d2e5d){_0x1d2e5d=_0x1d2e5d||0xcc;return function(_0x9d985e){if(_0x9d985e){return _0x5b3531[_0x7956('0x17')](_0x1d2e5d);}return _0x5b3531['status'](_0x1d2e5d)[_0x7956('0x18')]();};}function respondWithResult(_0x43c7f6,_0x248b79){_0x248b79=_0x248b79||0xc8;return function(_0x3a408a){if(_0x3a408a){return _0x43c7f6[_0x7956('0x19')](_0x248b79)[_0x7956('0x1a')](_0x3a408a);}};}function respondWithFilteredResult(_0x197360,_0x436573){return function(_0x24ea8d){if(_0x24ea8d){var _0x6a6d78=typeof _0x436573[_0x7956('0x1b')]===_0x7956('0x1c')&&typeof _0x436573[_0x7956('0x1d')]===_0x7956('0x1c');var _0x1e8040=_0x24ea8d[_0x7956('0x1e')];var _0x5e6b90=_0x6a6d78?0x0:_0x436573['offset'];var _0x10b29c=_0x6a6d78?_0x24ea8d[_0x7956('0x1e')]:_0x436573['offset']+_0x436573[_0x7956('0x1d')];var _0x584922;if(_0x10b29c>=_0x1e8040){_0x10b29c=_0x1e8040;_0x584922=0xc8;}else{_0x584922=0xce;}_0x197360[_0x7956('0x19')](_0x584922);return _0x197360[_0x7956('0x1f')]('Content-Range',_0x5e6b90+'-'+_0x10b29c+'/'+_0x1e8040)[_0x7956('0x1a')](_0x24ea8d);}return null;};}function patchUpdates(_0x2e31cd){return function(_0xc500bd){try{jsonpatch['apply'](_0xc500bd,_0x2e31cd,!![]);}catch(_0x8a58ea){return BPromise['reject'](_0x8a58ea);}return _0xc500bd[_0x7956('0x20')]();};}function saveUpdates(_0x5100d8,_0x427500){return function(_0x8a7165){if(_0x8a7165){return _0x8a7165[_0x7956('0x21')](_0x5100d8)[_0x7956('0x22')](function(_0x4d4d95){return _0x4d4d95;});}return null;};}function removeEntity(_0x19c033,_0x3f13b7){return function(_0x432a2d){if(_0x432a2d){return _0x432a2d['destroy']()['then'](function(){_0x19c033[_0x7956('0x19')](0xcc)[_0x7956('0x18')]();});}};}function handleEntityNotFound(_0x40d2d6,_0x1c407a){return function(_0x4572b2){if(!_0x4572b2){_0x40d2d6['sendStatus'](0x194);}return _0x4572b2;};}function handleError(_0x34c17f,_0x11eb8b){_0x11eb8b=_0x11eb8b||0x1f4;return function(_0xe39d1d){logger[_0x7956('0x23')](_0xe39d1d[_0x7956('0x24')]);if(_0xe39d1d[_0x7956('0x25')]){delete _0xe39d1d['name'];}_0x34c17f[_0x7956('0x19')](_0x11eb8b)[_0x7956('0x26')](_0xe39d1d);};}exports[_0x7956('0x27')]=function(_0x3de345,_0xe7d52){var _0x17c724={},_0x12cc06={},_0x30a8d1={'count':0x0,'rows':[]};var _0x2f248d=_[_0x7956('0x28')](db[_0x7956('0x29')][_0x7956('0x2a')],function(_0x21fb1b){return{'name':_0x21fb1b[_0x7956('0x2b')],'type':_0x21fb1b[_0x7956('0x2c')][_0x7956('0x2d')]};});_0x12cc06[_0x7956('0x2e')]=_[_0x7956('0x28')](_0x2f248d,_0x7956('0x25'));_0x12cc06[_0x7956('0x2f')]=_['keys'](_0x3de345[_0x7956('0x2f')]);_0x12cc06[_0x7956('0x30')]=_[_0x7956('0x31')](_0x12cc06[_0x7956('0x2e')],_0x12cc06[_0x7956('0x2f')]);_0x17c724[_0x7956('0x32')]=_['intersection'](_0x12cc06[_0x7956('0x2e')],qs[_0x7956('0x33')](_0x3de345['query'][_0x7956('0x33')]));_0x17c724[_0x7956('0x32')]=_0x17c724[_0x7956('0x32')][_0x7956('0x34')]?_0x17c724[_0x7956('0x32')]:_0x12cc06[_0x7956('0x2e')];if(!_0x3de345[_0x7956('0x2f')][_0x7956('0x35')](_0x7956('0x36'))){_0x17c724[_0x7956('0x1d')]=qs[_0x7956('0x1d')](_0x3de345[_0x7956('0x2f')][_0x7956('0x1d')]);_0x17c724[_0x7956('0x1b')]=qs[_0x7956('0x1b')](_0x3de345[_0x7956('0x2f')]['offset']);}_0x17c724[_0x7956('0x37')]=qs[_0x7956('0x38')](_0x3de345['query'][_0x7956('0x38')]);_0x17c724['where']=qs[_0x7956('0x30')](_['pick'](_0x3de345['query'],_0x12cc06[_0x7956('0x30')]),_0x2f248d);if(_0x3de345['query'][_0x7956('0x39')]){_0x17c724[_0x7956('0x3a')]=_[_0x7956('0x3b')](_0x17c724[_0x7956('0x3a')],{'$or':_[_0x7956('0x28')](_0x2f248d,function(_0x79dc18){if(_0x79dc18[_0x7956('0x2c')]!==_0x7956('0x3c')){var _0x4720d3={};_0x4720d3[_0x79dc18['name']]={'$like':'%'+_0x3de345[_0x7956('0x2f')]['filter']+'%'};return _0x4720d3;}})});}_0x17c724=_[_0x7956('0x3b')]({},_0x17c724,_0x3de345[_0x7956('0x3d')]);var _0x2d8d74={'where':_0x17c724[_0x7956('0x3a')]};return db['FaxQueueReport'][_0x7956('0x1e')](_0x2d8d74)[_0x7956('0x22')](function(_0x5825e5){_0x30a8d1['count']=_0x5825e5;if(_0x3de345[_0x7956('0x2f')]['includeAll']){_0x17c724[_0x7956('0x3e')]=[{'all':!![]}];}return db[_0x7956('0x29')][_0x7956('0x3f')](_0x17c724);})['then'](function(_0x387237){_0x30a8d1[_0x7956('0x40')]=_0x387237;return _0x30a8d1;})['then'](respondWithFilteredResult(_0xe7d52,_0x17c724))[_0x7956('0x41')](handleError(_0xe7d52,null));};exports['show']=function(_0xbe3f24,_0x46f78e){var _0x1968ab={'raw':!![],'where':{'id':_0xbe3f24[_0x7956('0x42')]['id']}},_0x31cea9={};_0x31cea9['model']=_['keys'](db[_0x7956('0x29')][_0x7956('0x2a')]);_0x31cea9[_0x7956('0x2f')]=_[_0x7956('0x43')](_0xbe3f24[_0x7956('0x2f')]);_0x31cea9[_0x7956('0x30')]=_['intersection'](_0x31cea9[_0x7956('0x2e')],_0x31cea9[_0x7956('0x2f')]);_0x1968ab[_0x7956('0x32')]=_[_0x7956('0x31')](_0x31cea9[_0x7956('0x2e')],qs[_0x7956('0x33')](_0xbe3f24[_0x7956('0x2f')][_0x7956('0x33')]));_0x1968ab[_0x7956('0x32')]=_0x1968ab[_0x7956('0x32')][_0x7956('0x34')]?_0x1968ab[_0x7956('0x32')]:_0x31cea9[_0x7956('0x2e')];if(_0xbe3f24[_0x7956('0x2f')][_0x7956('0x44')]){_0x1968ab['include']=[{'all':!![]}];}_0x1968ab=_[_0x7956('0x3b')]({},_0x1968ab,_0xbe3f24['options']);return db['FaxQueueReport'][_0x7956('0x45')](_0x1968ab)[_0x7956('0x22')](handleEntityNotFound(_0x46f78e,null))[_0x7956('0x22')](respondWithResult(_0x46f78e,null))[_0x7956('0x41')](handleError(_0x46f78e,null));};exports[_0x7956('0x46')]=function(_0x45c90f,_0x441404){return db[_0x7956('0x29')][_0x7956('0x46')](_0x45c90f[_0x7956('0x47')],{})[_0x7956('0x22')](respondWithResult(_0x441404,0xc9))[_0x7956('0x41')](handleError(_0x441404,null));};exports[_0x7956('0x21')]=function(_0x2ba635,_0x3158aa){if(_0x2ba635[_0x7956('0x47')]['id']){delete _0x2ba635[_0x7956('0x47')]['id'];}return db[_0x7956('0x29')][_0x7956('0x45')]({'where':{'id':_0x2ba635[_0x7956('0x42')]['id']}})[_0x7956('0x22')](handleEntityNotFound(_0x3158aa,null))[_0x7956('0x22')](saveUpdates(_0x2ba635['body'],null))[_0x7956('0x22')](respondWithResult(_0x3158aa,null))[_0x7956('0x41')](handleError(_0x3158aa,null));};exports[_0x7956('0x48')]=function(_0x493092,_0x385fb3){return db['FaxQueueReport'][_0x7956('0x45')]({'where':{'id':_0x493092[_0x7956('0x42')]['id']}})['then'](handleEntityNotFound(_0x385fb3,null))[_0x7956('0x22')](removeEntity(_0x385fb3,null))[_0x7956('0x41')](handleError(_0x385fb3,null));};exports['describe']=function(_0x41eb5f,_0x3324f0){return db['FaxQueueReport'][_0x7956('0x49')]()[_0x7956('0x22')](respondWithResult(_0x3324f0,null))[_0x7956('0x41')](handleError(_0x3324f0,null));}; \ No newline at end of file +var _0x9000=['model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','map','rawAttributes','fieldName','key'];(function(_0x436c7f,_0x527d5b){var _0x1e751e=function(_0x6aa4e7){while(--_0x6aa4e7){_0x436c7f['push'](_0x436c7f['shift']());}};_0x1e751e(++_0x527d5b);}(_0x9000,0x19e));var _0x0900=function(_0xf5eaa0,_0x5bfa29){_0xf5eaa0=_0xf5eaa0-0x0;var _0x47039e=_0x9000[_0xf5eaa0];return _0x47039e;};'use strict';var emlformat=require(_0x0900('0x0'));var rimraf=require(_0x0900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0900('0x2'));var rp=require(_0x0900('0x3'));var moment=require(_0x0900('0x4'));var BPromise=require(_0x0900('0x5'));var Mustache=require(_0x0900('0x6'));var util=require(_0x0900('0x7'));var path=require(_0x0900('0x8'));var sox=require(_0x0900('0x9'));var csv=require(_0x0900('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0900('0xb'));var _=require('lodash');var squel=require(_0x0900('0xc'));var crypto=require(_0x0900('0xd'));var jsforce=require(_0x0900('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0900('0xf'));var Papa=require(_0x0900('0x10'));var Redis=require(_0x0900('0x11'));var authService=require(_0x0900('0x12'));var qs=require(_0x0900('0x13'));var as=require(_0x0900('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0900('0x15'))(_0x0900('0x16'));var utils=require(_0x0900('0x17'));var config=require(_0x0900('0x18'));var licenseUtil=require(_0x0900('0x19'));var db=require(_0x0900('0x1a'))['db'];function respondWithStatusCode(_0xe8ae24,_0x11d1b6){_0x11d1b6=_0x11d1b6||0xcc;return function(_0x3a235b){if(_0x3a235b){return _0xe8ae24[_0x0900('0x1b')](_0x11d1b6);}return _0xe8ae24['status'](_0x11d1b6)[_0x0900('0x1c')]();};}function respondWithResult(_0x183ca6,_0x4ea071){_0x4ea071=_0x4ea071||0xc8;return function(_0x52bb65){if(_0x52bb65){return _0x183ca6[_0x0900('0x1d')](_0x4ea071)['json'](_0x52bb65);}};}function respondWithFilteredResult(_0x3d58eb,_0x4f5eee){return function(_0x35dbd6){if(_0x35dbd6){var _0xb184b6=typeof _0x4f5eee[_0x0900('0x1e')]===_0x0900('0x1f')&&typeof _0x4f5eee['limit']==='undefined';var _0x2a6b91=_0x35dbd6[_0x0900('0x20')];var _0x3f09ee=_0xb184b6?0x0:_0x4f5eee[_0x0900('0x1e')];var _0x5bc7ec=_0xb184b6?_0x35dbd6[_0x0900('0x20')]:_0x4f5eee[_0x0900('0x1e')]+_0x4f5eee[_0x0900('0x21')];var _0x34968a;if(_0x5bc7ec>=_0x2a6b91){_0x5bc7ec=_0x2a6b91;_0x34968a=0xc8;}else{_0x34968a=0xce;}_0x3d58eb[_0x0900('0x1d')](_0x34968a);return _0x3d58eb[_0x0900('0x22')](_0x0900('0x23'),_0x3f09ee+'-'+_0x5bc7ec+'/'+_0x2a6b91)[_0x0900('0x24')](_0x35dbd6);}return null;};}function patchUpdates(_0x4de1d3){return function(_0x5ed4e8){try{jsonpatch[_0x0900('0x25')](_0x5ed4e8,_0x4de1d3,!![]);}catch(_0x5c54a9){return BPromise[_0x0900('0x26')](_0x5c54a9);}return _0x5ed4e8['save']();};}function saveUpdates(_0x41b74a,_0x1f3738){return function(_0x3dc6bc){if(_0x3dc6bc){return _0x3dc6bc['update'](_0x41b74a)[_0x0900('0x27')](function(_0x492a51){return _0x492a51;});}return null;};}function removeEntity(_0x2fd307,_0x369f5a){return function(_0xce8f6e){if(_0xce8f6e){return _0xce8f6e[_0x0900('0x28')]()[_0x0900('0x27')](function(){_0x2fd307[_0x0900('0x1d')](0xcc)[_0x0900('0x1c')]();});}};}function handleEntityNotFound(_0x51fe9f,_0x7b6765){return function(_0x34d63f){if(!_0x34d63f){_0x51fe9f[_0x0900('0x1b')](0x194);}return _0x34d63f;};}function handleError(_0x569856,_0x574307){_0x574307=_0x574307||0x1f4;return function(_0x51ee3a){logger['error'](_0x51ee3a[_0x0900('0x29')]);if(_0x51ee3a[_0x0900('0x2a')]){delete _0x51ee3a['name'];}_0x569856[_0x0900('0x1d')](_0x574307)['send'](_0x51ee3a);};}exports[_0x0900('0x2b')]=function(_0x13fa35,_0x2a8a71){var _0x257914={},_0x3fbd95={},_0x32afc5={'count':0x0,'rows':[]};var _0x50280f=_[_0x0900('0x2c')](db['FaxQueueReport'][_0x0900('0x2d')],function(_0x2d3ec4){return{'name':_0x2d3ec4[_0x0900('0x2e')],'type':_0x2d3ec4['type'][_0x0900('0x2f')]};});_0x3fbd95[_0x0900('0x30')]=_[_0x0900('0x2c')](_0x50280f,_0x0900('0x2a'));_0x3fbd95['query']=_[_0x0900('0x31')](_0x13fa35['query']);_0x3fbd95[_0x0900('0x32')]=_[_0x0900('0x33')](_0x3fbd95[_0x0900('0x30')],_0x3fbd95[_0x0900('0x34')]);_0x257914[_0x0900('0x35')]=_[_0x0900('0x33')](_0x3fbd95['model'],qs[_0x0900('0x36')](_0x13fa35[_0x0900('0x34')][_0x0900('0x36')]));_0x257914['attributes']=_0x257914[_0x0900('0x35')][_0x0900('0x37')]?_0x257914[_0x0900('0x35')]:_0x3fbd95[_0x0900('0x30')];if(!_0x13fa35[_0x0900('0x34')][_0x0900('0x38')](_0x0900('0x39'))){_0x257914[_0x0900('0x21')]=qs['limit'](_0x13fa35['query']['limit']);_0x257914[_0x0900('0x1e')]=qs[_0x0900('0x1e')](_0x13fa35[_0x0900('0x34')]['offset']);}_0x257914['order']=qs[_0x0900('0x3a')](_0x13fa35[_0x0900('0x34')][_0x0900('0x3a')]);_0x257914['where']=qs[_0x0900('0x32')](_[_0x0900('0x3b')](_0x13fa35[_0x0900('0x34')],_0x3fbd95[_0x0900('0x32')]),_0x50280f);if(_0x13fa35[_0x0900('0x34')][_0x0900('0x3c')]){_0x257914[_0x0900('0x3d')]=_[_0x0900('0x3e')](_0x257914[_0x0900('0x3d')],{'$or':_[_0x0900('0x2c')](_0x50280f,function(_0x565e5d){if(_0x565e5d['type']!=='VIRTUAL'){var _0x197e34={};_0x197e34[_0x565e5d[_0x0900('0x2a')]]={'$like':'%'+_0x13fa35[_0x0900('0x34')][_0x0900('0x3c')]+'%'};return _0x197e34;}})});}_0x257914=_[_0x0900('0x3e')]({},_0x257914,_0x13fa35[_0x0900('0x3f')]);var _0x345436={'where':_0x257914[_0x0900('0x3d')]};return db[_0x0900('0x40')][_0x0900('0x20')](_0x345436)[_0x0900('0x27')](function(_0x3f074a){_0x32afc5[_0x0900('0x20')]=_0x3f074a;if(_0x13fa35[_0x0900('0x34')][_0x0900('0x41')]){_0x257914['include']=[{'all':!![]}];}return db[_0x0900('0x40')][_0x0900('0x42')](_0x257914);})[_0x0900('0x27')](function(_0x36a90f){_0x32afc5[_0x0900('0x43')]=_0x36a90f;return _0x32afc5;})[_0x0900('0x27')](respondWithFilteredResult(_0x2a8a71,_0x257914))[_0x0900('0x44')](handleError(_0x2a8a71,null));};exports[_0x0900('0x45')]=function(_0x39995c,_0x96de65){var _0x26ad8f={'raw':!![],'where':{'id':_0x39995c[_0x0900('0x46')]['id']}},_0x4809cb={};_0x4809cb[_0x0900('0x30')]=_[_0x0900('0x31')](db[_0x0900('0x40')][_0x0900('0x2d')]);_0x4809cb[_0x0900('0x34')]=_['keys'](_0x39995c['query']);_0x4809cb[_0x0900('0x32')]=_[_0x0900('0x33')](_0x4809cb[_0x0900('0x30')],_0x4809cb[_0x0900('0x34')]);_0x26ad8f[_0x0900('0x35')]=_['intersection'](_0x4809cb['model'],qs[_0x0900('0x36')](_0x39995c[_0x0900('0x34')][_0x0900('0x36')]));_0x26ad8f[_0x0900('0x35')]=_0x26ad8f[_0x0900('0x35')][_0x0900('0x37')]?_0x26ad8f[_0x0900('0x35')]:_0x4809cb[_0x0900('0x30')];if(_0x39995c[_0x0900('0x34')][_0x0900('0x41')]){_0x26ad8f[_0x0900('0x47')]=[{'all':!![]}];}_0x26ad8f=_[_0x0900('0x3e')]({},_0x26ad8f,_0x39995c[_0x0900('0x3f')]);return db[_0x0900('0x40')][_0x0900('0x48')](_0x26ad8f)[_0x0900('0x27')](handleEntityNotFound(_0x96de65,null))['then'](respondWithResult(_0x96de65,null))['catch'](handleError(_0x96de65,null));};exports[_0x0900('0x49')]=function(_0x15849b,_0x11ad29){return db[_0x0900('0x40')][_0x0900('0x49')](_0x15849b[_0x0900('0x4a')],{})[_0x0900('0x27')](respondWithResult(_0x11ad29,0xc9))[_0x0900('0x44')](handleError(_0x11ad29,null));};exports[_0x0900('0x4b')]=function(_0x441417,_0x1df6a1){if(_0x441417[_0x0900('0x4a')]['id']){delete _0x441417[_0x0900('0x4a')]['id'];}return db['FaxQueueReport'][_0x0900('0x48')]({'where':{'id':_0x441417[_0x0900('0x46')]['id']}})['then'](handleEntityNotFound(_0x1df6a1,null))[_0x0900('0x27')](saveUpdates(_0x441417[_0x0900('0x4a')],null))['then'](respondWithResult(_0x1df6a1,null))[_0x0900('0x44')](handleError(_0x1df6a1,null));};exports['destroy']=function(_0x22fe67,_0x2a1390){return db[_0x0900('0x40')][_0x0900('0x48')]({'where':{'id':_0x22fe67[_0x0900('0x46')]['id']}})[_0x0900('0x27')](handleEntityNotFound(_0x2a1390,null))[_0x0900('0x27')](removeEntity(_0x2a1390,null))[_0x0900('0x44')](handleError(_0x2a1390,null));};exports[_0x0900('0x4c')]=function(_0x4fb007,_0x5c4676){return db[_0x0900('0x40')][_0x0900('0x4c')]()[_0x0900('0x27')](respondWithResult(_0x5c4676,null))[_0x0900('0x44')](handleError(_0x5c4676,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 8bd3bc7..01bc5e0 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x14c650,_0x57dcab){var _0x581265=function(_0x61219e){while(--_0x61219e){_0x14c650['push'](_0x14c650['shift']());}};_0x581265(++_0x57dcab);}(_0xabce,0x103));var _0xeabc=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xabce[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x4bc722,_0x958025){var _0x1f31f5=function(_0x3a16b2){while(--_0x3a16b2){_0x4bc722['push'](_0x4bc722['shift']());}};_0x1f31f5(++_0x958025);}(_0x7a54,0x106));var _0x47a5=function(_0x73da01,_0x540251){_0x73da01=_0x73da01-0x0;var _0x5956aa=_0x7a54[_0x73da01];return _0x5956aa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 42a9d30..b081f6d 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 _0x89ad=['debug','UpdateFaxQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw'];(function(_0x5ed21f,_0x24e6c6){var _0x18a335=function(_0x29dd35){while(--_0x29dd35){_0x5ed21f['push'](_0x5ed21f['shift']());}};_0x18a335(++_0x24e6c6);}(_0x89ad,0x1f0));var _0xd89a=function(_0x187853,_0x1b8f8c){_0x187853=_0x187853-0x0;var _0x4add93=_0x89ad[_0x187853];return _0x4add93;};'use strict';var _=require('lodash');var util=require(_0xd89a('0x0'));var moment=require(_0xd89a('0x1'));var BPromise=require(_0xd89a('0x2'));var rs=require(_0xd89a('0x3'));var fs=require('fs');var Redis=require(_0xd89a('0x4'));var db=require(_0xd89a('0x5'))['db'];var utils=require(_0xd89a('0x6'));var logger=require(_0xd89a('0x7'))(_0xd89a('0x8'));var config=require(_0xd89a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd89a('0xa')][_0xd89a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e26ac,_0x8982e7,_0x12a93f){return new BPromise(function(_0x167b72,_0x53b592){return client[_0xd89a('0xc')](_0x2e26ac,_0x12a93f)[_0xd89a('0xd')](function(_0x524305){logger[_0xd89a('0xe')](_0xd89a('0xf'),_0x8982e7,_0xd89a('0x10'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x8982e7,_0xd89a('0x10'),JSON[_0xd89a('0x11')](_0x524305));if(_0x524305[_0xd89a('0x12')]){if(_0x524305[_0xd89a('0x12')][_0xd89a('0x13')]===0x1f4){logger[_0xd89a('0x12')](_0xd89a('0xf'),_0x8982e7,_0x524305[_0xd89a('0x12')][_0xd89a('0x14')]);return _0x53b592(_0x524305[_0xd89a('0x12')]['message']);}logger[_0xd89a('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x8982e7,_0x524305[_0xd89a('0x12')][_0xd89a('0x14')]);return _0x167b72(_0x524305['error'][_0xd89a('0x14')]);}else{logger[_0xd89a('0xe')](_0xd89a('0xf'),_0x8982e7,'request\x20sent');_0x167b72(_0x524305[_0xd89a('0x15')][_0xd89a('0x14')]);}})[_0xd89a('0x16')](function(_0x167bc6){logger[_0xd89a('0x12')](_0xd89a('0xf'),_0x8982e7,_0x167bc6);_0x53b592(_0x167bc6);});});}exports[_0xd89a('0x17')]=function(_0x34c6f2){var _0x4aa6a6=this;return new Promise(function(_0x42b54b,_0x3b1b1f){return db[_0xd89a('0x18')][_0xd89a('0x19')](_0x34c6f2[_0xd89a('0x1a')],{'raw':_0x34c6f2[_0xd89a('0x1b')]?_0x34c6f2[_0xd89a('0x1b')][_0xd89a('0x1c')]===undefined?!![]:![]:!![]})[_0xd89a('0xd')](function(_0x39db40){logger[_0xd89a('0xe')](_0xd89a('0x17'),_0x34c6f2);logger[_0xd89a('0x1d')]('CreateFaxQueueReport',_0x34c6f2,JSON[_0xd89a('0x11')](_0x39db40));_0x42b54b(_0x39db40);})[_0xd89a('0x16')](function(_0x33ee81){logger['error'](_0xd89a('0x17'),_0x33ee81[_0xd89a('0x14')],_0x34c6f2);_0x3b1b1f(_0x4aa6a6[_0xd89a('0x12')](0x1f4,_0x33ee81[_0xd89a('0x14')]));});});};exports[_0xd89a('0x1e')]=function(_0x4e8d4a){var _0x39d123=this;return new Promise(function(_0x5d42e9,_0x564bc4){return db[_0xd89a('0x18')][_0xd89a('0x1f')](_0x4e8d4a[_0xd89a('0x1a')],{'raw':_0x4e8d4a[_0xd89a('0x1b')]?_0x4e8d4a[_0xd89a('0x1b')][_0xd89a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e8d4a[_0xd89a('0x1b')]?_0x4e8d4a[_0xd89a('0x1b')][_0xd89a('0x20')]||null:null,'attributes':_0x4e8d4a[_0xd89a('0x1b')]?_0x4e8d4a[_0xd89a('0x1b')][_0xd89a('0x21')]||null:null,'limit':_0x4e8d4a['options']?_0x4e8d4a['options'][_0xd89a('0x22')]||null:null})['then'](function(_0x336938){logger[_0xd89a('0xe')](_0xd89a('0x1e'),_0x4e8d4a);logger[_0xd89a('0x1d')](_0xd89a('0x1e'),_0x4e8d4a,JSON[_0xd89a('0x11')](_0x336938));_0x5d42e9(_0x336938);})[_0xd89a('0x16')](function(_0x1fa9ed){logger[_0xd89a('0x12')]('UpdateFaxQueueReport',_0x1fa9ed[_0xd89a('0x14')],_0x4e8d4a);_0x564bc4(_0x39d123['error'](0x1f4,_0x1fa9ed[_0xd89a('0x14')]));});});}; \ No newline at end of file +var _0xf9a2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','update','attributes','limit','lodash','moment'];(function(_0x4a90bc,_0x3655db){var _0x557cea=function(_0x1de6ba){while(--_0x1de6ba){_0x4a90bc['push'](_0x4a90bc['shift']());}};_0x557cea(++_0x3655db);}(_0xf9a2,0x116));var _0x2f9a=function(_0x3508e4,_0x4c6cfe){_0x3508e4=_0x3508e4-0x0;var _0xfc8f93=_0xf9a2[_0x3508e4];return _0xfc8f93;};'use strict';var _=require(_0x2f9a('0x0'));var util=require('util');var moment=require(_0x2f9a('0x1'));var BPromise=require(_0x2f9a('0x2'));var rs=require(_0x2f9a('0x3'));var fs=require('fs');var Redis=require(_0x2f9a('0x4'));var db=require(_0x2f9a('0x5'))['db'];var utils=require(_0x2f9a('0x6'));var logger=require(_0x2f9a('0x7'))(_0x2f9a('0x8'));var config=require(_0x2f9a('0x9'));var jayson=require(_0x2f9a('0xa'));var client=jayson[_0x2f9a('0xb')][_0x2f9a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e8b55,_0x19968c,_0x51883e){return new BPromise(function(_0x514124,_0x37ef33){return client[_0x2f9a('0xd')](_0x3e8b55,_0x51883e)['then'](function(_0x328bf5){logger[_0x2f9a('0xe')](_0x2f9a('0xf'),_0x19968c,_0x2f9a('0x10'));logger[_0x2f9a('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x19968c,_0x2f9a('0x10'),JSON[_0x2f9a('0x12')](_0x328bf5));if(_0x328bf5[_0x2f9a('0x13')]){if(_0x328bf5[_0x2f9a('0x13')][_0x2f9a('0x14')]===0x1f4){logger[_0x2f9a('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x19968c,_0x328bf5[_0x2f9a('0x13')][_0x2f9a('0x15')]);return _0x37ef33(_0x328bf5[_0x2f9a('0x13')][_0x2f9a('0x15')]);}logger[_0x2f9a('0x13')](_0x2f9a('0xf'),_0x19968c,_0x328bf5[_0x2f9a('0x13')]['message']);return _0x514124(_0x328bf5[_0x2f9a('0x13')][_0x2f9a('0x15')]);}else{logger[_0x2f9a('0xe')](_0x2f9a('0xf'),_0x19968c,_0x2f9a('0x10'));_0x514124(_0x328bf5[_0x2f9a('0x16')][_0x2f9a('0x15')]);}})[_0x2f9a('0x17')](function(_0x436480){logger[_0x2f9a('0x13')](_0x2f9a('0xf'),_0x19968c,_0x436480);_0x37ef33(_0x436480);});});}exports[_0x2f9a('0x18')]=function(_0x1e3031){var _0x2d8d38=this;return new Promise(function(_0x1dfe64,_0x40e872){return db[_0x2f9a('0x19')][_0x2f9a('0x1a')](_0x1e3031[_0x2f9a('0x1b')],{'raw':_0x1e3031[_0x2f9a('0x1c')]?_0x1e3031['options'][_0x2f9a('0x1d')]===undefined?!![]:![]:!![]})[_0x2f9a('0x1e')](function(_0x3ce9cc){logger[_0x2f9a('0xe')](_0x2f9a('0x18'),_0x1e3031);logger[_0x2f9a('0x11')]('CreateFaxQueueReport',_0x1e3031,JSON['stringify'](_0x3ce9cc));_0x1dfe64(_0x3ce9cc);})[_0x2f9a('0x17')](function(_0x81bd5b){logger[_0x2f9a('0x13')](_0x2f9a('0x18'),_0x81bd5b[_0x2f9a('0x15')],_0x1e3031);_0x40e872(_0x2d8d38['error'](0x1f4,_0x81bd5b['message']));});});};exports[_0x2f9a('0x1f')]=function(_0x10043e){var _0x144d9e=this;return new Promise(function(_0x229c8b,_0x765b51){return db[_0x2f9a('0x19')][_0x2f9a('0x20')](_0x10043e[_0x2f9a('0x1b')],{'raw':_0x10043e['options']?_0x10043e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10043e[_0x2f9a('0x1c')]?_0x10043e[_0x2f9a('0x1c')]['where']||null:null,'attributes':_0x10043e['options']?_0x10043e[_0x2f9a('0x1c')][_0x2f9a('0x21')]||null:null,'limit':_0x10043e[_0x2f9a('0x1c')]?_0x10043e[_0x2f9a('0x1c')][_0x2f9a('0x22')]||null:null})[_0x2f9a('0x1e')](function(_0x206e3c){logger[_0x2f9a('0xe')]('UpdateFaxQueueReport',_0x10043e);logger['debug'](_0x2f9a('0x1f'),_0x10043e,JSON['stringify'](_0x206e3c));_0x229c8b(_0x206e3c);})[_0x2f9a('0x17')](function(_0x520d2d){logger['error'](_0x2f9a('0x1f'),_0x520d2d['message'],_0x10043e);_0x765b51(_0x144d9e[_0x2f9a('0x13')](0x1f4,_0x520d2d[_0x2f9a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 9a9feba..591f48f 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 _0x9ef2=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x482b60,_0x1dbe38){var _0x443e74=function(_0x2f866e){while(--_0x2f866e){_0x482b60['push'](_0x482b60['shift']());}};_0x443e74(++_0x1dbe38);}(_0x9ef2,0x14b));var _0x29ef=function(_0xb35a98,_0x44138d){_0xb35a98=_0xb35a98-0x0;var _0x210b78=_0x9ef2[_0xb35a98];return _0x210b78;};'use strict';var multer=require(_0x29ef('0x0'));var util=require(_0x29ef('0x1'));var path=require(_0x29ef('0x2'));var timeout=require(_0x29ef('0x3'));var express=require(_0x29ef('0x4'));var router=express[_0x29ef('0x5')]();var fs_extra=require(_0x29ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x29ef('0x7'));var config=require(_0x29ef('0x8'));var controller=require('./faxQueueReport.controller');router[_0x29ef('0x9')]('/',auth['isAuthenticated'](),controller[_0x29ef('0xa')]);router[_0x29ef('0x9')](_0x29ef('0xb'),auth[_0x29ef('0xc')](),controller[_0x29ef('0xd')]);router[_0x29ef('0x9')](_0x29ef('0xe'),auth[_0x29ef('0xc')](),controller[_0x29ef('0xf')]);router[_0x29ef('0x10')]('/',auth[_0x29ef('0xc')](),controller[_0x29ef('0x11')]);router[_0x29ef('0x12')](_0x29ef('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x29ef('0x13')]('/:id',auth[_0x29ef('0xc')](),controller[_0x29ef('0x14')]);module[_0x29ef('0x15')]=router; \ No newline at end of file +var _0xb96b=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update'];(function(_0x48b225,_0x124a42){var _0x23f5d1=function(_0x3f96bb){while(--_0x3f96bb){_0x48b225['push'](_0x48b225['shift']());}};_0x23f5d1(++_0x124a42);}(_0xb96b,0x1a0));var _0xbb96=function(_0x4dca38,_0x5dfae1){_0x4dca38=_0x4dca38-0x0;var _0x44656c=_0xb96b[_0x4dca38];return _0x44656c;};'use strict';var multer=require(_0xbb96('0x0'));var util=require(_0xbb96('0x1'));var path=require('path');var timeout=require(_0xbb96('0x2'));var express=require(_0xbb96('0x3'));var router=express[_0xbb96('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbb96('0x5'));var config=require('../../config/environment');var controller=require(_0xbb96('0x6'));router[_0xbb96('0x7')]('/',auth[_0xbb96('0x8')](),controller[_0xbb96('0x9')]);router['get']('/describe',auth[_0xbb96('0x8')](),controller[_0xbb96('0xa')]);router[_0xbb96('0x7')](_0xbb96('0xb'),auth['isAuthenticated'](),controller[_0xbb96('0xc')]);router[_0xbb96('0xd')]('/',auth[_0xbb96('0x8')](),controller['create']);router[_0xbb96('0xe')](_0xbb96('0xb'),auth[_0xbb96('0x8')](),controller[_0xbb96('0xf')]);router['delete']('/:id',auth[_0xbb96('0x8')](),controller[_0xbb96('0x10')]);module[_0xbb96('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 23da34a..4cf9ace 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xabce8f,_0x2507b7){var _0x46d377=function(_0x4e1454){while(--_0x4e1454){_0xabce8f['push'](_0xabce8f['shift']());}};_0x46d377(++_0x2507b7);}(_0xaa88,0x137));var _0x8aa8=function(_0x11b58d,_0x555c55){_0x11b58d=_0x11b58d-0x0;var _0xc2811b=_0xaa88[_0x11b58d];return _0xc2811b;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4d2b74,_0x532985){_0x4d2b74=_0x4d2b74-0x0;var _0x23ff9c=_0xb43b[_0x4d2b74];return _0x23ff9c;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index aa93c29..822d0a3 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 _0x4e0b=['catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','FaxTransferReport','rawAttributes','fieldName','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','show','params','options','find'];(function(_0x32ed89,_0x11d953){var _0x262961=function(_0x29727c){while(--_0x29727c){_0x32ed89['push'](_0x32ed89['shift']());}};_0x262961(++_0x11d953);}(_0x4e0b,0xee));var _0xb4e0=function(_0x33d515,_0x3b9b54){_0x33d515=_0x33d515-0x0;var _0x6a8ec0=_0x4e0b[_0x33d515];return _0x6a8ec0;};'use strict';var emlformat=require(_0xb4e0('0x0'));var rimraf=require(_0xb4e0('0x1'));var zipdir=require(_0xb4e0('0x2'));var jsonpatch=require(_0xb4e0('0x3'));var rp=require(_0xb4e0('0x4'));var moment=require(_0xb4e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb4e0('0x6'));var util=require(_0xb4e0('0x7'));var path=require(_0xb4e0('0x8'));var sox=require(_0xb4e0('0x9'));var csv=require(_0xb4e0('0xa'));var ejs=require(_0xb4e0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4e0('0xc'));var squel=require(_0xb4e0('0xd'));var crypto=require(_0xb4e0('0xe'));var jsforce=require(_0xb4e0('0xf'));var deskjs=require(_0xb4e0('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb4e0('0x11'));var Papa=require('papaparse');var Redis=require(_0xb4e0('0x12'));var authService=require(_0xb4e0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb4e0('0x14'));var hardwareService=require(_0xb4e0('0x15'));var logger=require('../../config/logger')(_0xb4e0('0x16'));var utils=require(_0xb4e0('0x17'));var config=require(_0xb4e0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4e0('0x19'))['db'];function respondWithStatusCode(_0x39c863,_0x16fe8d){_0x16fe8d=_0x16fe8d||0xcc;return function(_0x38b229){if(_0x38b229){return _0x39c863[_0xb4e0('0x1a')](_0x16fe8d);}return _0x39c863[_0xb4e0('0x1b')](_0x16fe8d)[_0xb4e0('0x1c')]();};}function respondWithResult(_0x8e69dd,_0x2ce5fc){_0x2ce5fc=_0x2ce5fc||0xc8;return function(_0x3faca7){if(_0x3faca7){return _0x8e69dd['status'](_0x2ce5fc)[_0xb4e0('0x1d')](_0x3faca7);}};}function respondWithFilteredResult(_0x193369,_0x6fb685){return function(_0x2a6cf5){if(_0x2a6cf5){var _0x3e530c=typeof _0x6fb685[_0xb4e0('0x1e')]==='undefined'&&typeof _0x6fb685[_0xb4e0('0x1f')]===_0xb4e0('0x20');var _0x68fac8=_0x2a6cf5[_0xb4e0('0x21')];var _0x4a53a9=_0x3e530c?0x0:_0x6fb685[_0xb4e0('0x1e')];var _0x5b084c=_0x3e530c?_0x2a6cf5[_0xb4e0('0x21')]:_0x6fb685['offset']+_0x6fb685[_0xb4e0('0x1f')];var _0x415a00;if(_0x5b084c>=_0x68fac8){_0x5b084c=_0x68fac8;_0x415a00=0xc8;}else{_0x415a00=0xce;}_0x193369[_0xb4e0('0x1b')](_0x415a00);return _0x193369[_0xb4e0('0x22')](_0xb4e0('0x23'),_0x4a53a9+'-'+_0x5b084c+'/'+_0x68fac8)[_0xb4e0('0x1d')](_0x2a6cf5);}return null;};}function patchUpdates(_0x299375){return function(_0x2337de){try{jsonpatch[_0xb4e0('0x24')](_0x2337de,_0x299375,!![]);}catch(_0xd96262){return BPromise[_0xb4e0('0x25')](_0xd96262);}return _0x2337de[_0xb4e0('0x26')]();};}function saveUpdates(_0x4a86c7,_0x1ddd06){return function(_0x376f1d){if(_0x376f1d){return _0x376f1d[_0xb4e0('0x27')](_0x4a86c7)['then'](function(_0x2be9fc){return _0x2be9fc;});}return null;};}function removeEntity(_0x566803,_0x2c0f46){return function(_0x30c2c2){if(_0x30c2c2){return _0x30c2c2[_0xb4e0('0x28')]()[_0xb4e0('0x29')](function(){_0x566803[_0xb4e0('0x1b')](0xcc)[_0xb4e0('0x1c')]();});}};}function handleEntityNotFound(_0x413b7c,_0x409e00){return function(_0x2464ce){if(!_0x2464ce){_0x413b7c['sendStatus'](0x194);}return _0x2464ce;};}function handleError(_0x377711,_0x45dad1){_0x45dad1=_0x45dad1||0x1f4;return function(_0x517df7){logger[_0xb4e0('0x2a')](_0x517df7['stack']);if(_0x517df7['name']){delete _0x517df7['name'];}_0x377711[_0xb4e0('0x1b')](_0x45dad1)[_0xb4e0('0x2b')](_0x517df7);};}exports[_0xb4e0('0x2c')]=function(_0x15103b,_0x44e922){var _0x4fd885={},_0x2517c2={},_0x3ed033={'count':0x0,'rows':[]};var _0x52ae26=_['map'](db[_0xb4e0('0x2d')][_0xb4e0('0x2e')],function(_0xe07fa4){return{'name':_0xe07fa4[_0xb4e0('0x2f')],'type':_0xe07fa4['type'][_0xb4e0('0x30')]};});_0x2517c2[_0xb4e0('0x31')]=_[_0xb4e0('0x32')](_0x52ae26,_0xb4e0('0x33'));_0x2517c2['query']=_[_0xb4e0('0x34')](_0x15103b[_0xb4e0('0x35')]);_0x2517c2[_0xb4e0('0x36')]=_[_0xb4e0('0x37')](_0x2517c2[_0xb4e0('0x31')],_0x2517c2[_0xb4e0('0x35')]);_0x4fd885[_0xb4e0('0x38')]=_['intersection'](_0x2517c2[_0xb4e0('0x31')],qs[_0xb4e0('0x39')](_0x15103b[_0xb4e0('0x35')]['fields']));_0x4fd885[_0xb4e0('0x38')]=_0x4fd885['attributes'][_0xb4e0('0x3a')]?_0x4fd885[_0xb4e0('0x38')]:_0x2517c2[_0xb4e0('0x31')];if(!_0x15103b[_0xb4e0('0x35')]['hasOwnProperty'](_0xb4e0('0x3b'))){_0x4fd885['limit']=qs[_0xb4e0('0x1f')](_0x15103b[_0xb4e0('0x35')][_0xb4e0('0x1f')]);_0x4fd885[_0xb4e0('0x1e')]=qs[_0xb4e0('0x1e')](_0x15103b[_0xb4e0('0x35')]['offset']);}_0x4fd885[_0xb4e0('0x3c')]=qs[_0xb4e0('0x3d')](_0x15103b['query'][_0xb4e0('0x3d')]);_0x4fd885[_0xb4e0('0x3e')]=qs[_0xb4e0('0x36')](_[_0xb4e0('0x3f')](_0x15103b[_0xb4e0('0x35')],_0x2517c2['filters']),_0x52ae26);if(_0x15103b['query']['filter']){_0x4fd885['where']=_[_0xb4e0('0x40')](_0x4fd885[_0xb4e0('0x3e')],{'$or':_[_0xb4e0('0x32')](_0x52ae26,function(_0x3a4793){if(_0x3a4793[_0xb4e0('0x41')]!=='VIRTUAL'){var _0x447dd0={};_0x447dd0[_0x3a4793[_0xb4e0('0x33')]]={'$like':'%'+_0x15103b[_0xb4e0('0x35')][_0xb4e0('0x42')]+'%'};return _0x447dd0;}})});}_0x4fd885=_[_0xb4e0('0x40')]({},_0x4fd885,_0x15103b['options']);var _0xce2198={'where':_0x4fd885[_0xb4e0('0x3e')]};return db[_0xb4e0('0x2d')]['count'](_0xce2198)[_0xb4e0('0x29')](function(_0x518da8){_0x3ed033[_0xb4e0('0x21')]=_0x518da8;if(_0x15103b[_0xb4e0('0x35')][_0xb4e0('0x43')]){_0x4fd885[_0xb4e0('0x44')]=[{'all':!![]}];}return db[_0xb4e0('0x2d')]['findAll'](_0x4fd885);})[_0xb4e0('0x29')](function(_0x64def9){_0x3ed033[_0xb4e0('0x45')]=_0x64def9;return _0x3ed033;})[_0xb4e0('0x29')](respondWithFilteredResult(_0x44e922,_0x4fd885))['catch'](handleError(_0x44e922,null));};exports[_0xb4e0('0x46')]=function(_0x217f46,_0x1d2e68){var _0x2a01a2={'raw':!![],'where':{'id':_0x217f46[_0xb4e0('0x47')]['id']}},_0x45c5f3={};_0x45c5f3[_0xb4e0('0x31')]=_[_0xb4e0('0x34')](db[_0xb4e0('0x2d')][_0xb4e0('0x2e')]);_0x45c5f3['query']=_[_0xb4e0('0x34')](_0x217f46[_0xb4e0('0x35')]);_0x45c5f3[_0xb4e0('0x36')]=_[_0xb4e0('0x37')](_0x45c5f3['model'],_0x45c5f3[_0xb4e0('0x35')]);_0x2a01a2[_0xb4e0('0x38')]=_['intersection'](_0x45c5f3['model'],qs[_0xb4e0('0x39')](_0x217f46['query'][_0xb4e0('0x39')]));_0x2a01a2[_0xb4e0('0x38')]=_0x2a01a2['attributes'][_0xb4e0('0x3a')]?_0x2a01a2[_0xb4e0('0x38')]:_0x45c5f3[_0xb4e0('0x31')];if(_0x217f46[_0xb4e0('0x35')][_0xb4e0('0x43')]){_0x2a01a2['include']=[{'all':!![]}];}_0x2a01a2=_['merge']({},_0x2a01a2,_0x217f46[_0xb4e0('0x48')]);return db[_0xb4e0('0x2d')][_0xb4e0('0x49')](_0x2a01a2)['then'](handleEntityNotFound(_0x1d2e68,null))[_0xb4e0('0x29')](respondWithResult(_0x1d2e68,null))[_0xb4e0('0x4a')](handleError(_0x1d2e68,null));};exports[_0xb4e0('0x4b')]=function(_0x440187,_0x2b1324){return db['FaxTransferReport']['create'](_0x440187[_0xb4e0('0x4c')],{})['then'](respondWithResult(_0x2b1324,0xc9))[_0xb4e0('0x4a')](handleError(_0x2b1324,null));};exports[_0xb4e0('0x27')]=function(_0x35843a,_0x5426a6){if(_0x35843a[_0xb4e0('0x4c')]['id']){delete _0x35843a[_0xb4e0('0x4c')]['id'];}return db[_0xb4e0('0x2d')][_0xb4e0('0x49')]({'where':{'id':_0x35843a[_0xb4e0('0x47')]['id']}})['then'](handleEntityNotFound(_0x5426a6,null))[_0xb4e0('0x29')](saveUpdates(_0x35843a[_0xb4e0('0x4c')],null))['then'](respondWithResult(_0x5426a6,null))[_0xb4e0('0x4a')](handleError(_0x5426a6,null));};exports[_0xb4e0('0x28')]=function(_0x259567,_0x47d89b){return db[_0xb4e0('0x2d')]['find']({'where':{'id':_0x259567[_0xb4e0('0x47')]['id']}})[_0xb4e0('0x29')](handleEntityNotFound(_0x47d89b,null))[_0xb4e0('0x29')](removeEntity(_0x47d89b,null))[_0xb4e0('0x4a')](handleError(_0x47d89b,null));};exports[_0xb4e0('0x4d')]=function(_0x181728,_0x217dc7){return db[_0xb4e0('0x2d')][_0xb4e0('0x4d')]()['then'](respondWithResult(_0x217dc7,null))[_0xb4e0('0x4a')](handleError(_0x217dc7,null));}; \ No newline at end of file +var _0x43f7=['util','path','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','type','options','includeAll','include','findAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x198457,_0x5bb489){var _0x23b71a=function(_0x5f8ab1){while(--_0x5f8ab1){_0x198457['push'](_0x198457['shift']());}};_0x23b71a(++_0x5bb489);}(_0x43f7,0x165));var _0x743f=function(_0x5613b6,_0xbf39dd){_0x5613b6=_0x5613b6-0x0;var _0x33d5bc=_0x43f7[_0x5613b6];return _0x33d5bc;};'use strict';var emlformat=require(_0x743f('0x0'));var rimraf=require(_0x743f('0x1'));var zipdir=require(_0x743f('0x2'));var jsonpatch=require(_0x743f('0x3'));var rp=require(_0x743f('0x4'));var moment=require(_0x743f('0x5'));var BPromise=require(_0x743f('0x6'));var Mustache=require(_0x743f('0x7'));var util=require(_0x743f('0x8'));var path=require(_0x743f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x743f('0xa'));var fs=require('fs');var fs_extra=require(_0x743f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x743f('0xc'));var jsforce=require(_0x743f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x743f('0xe'));var querystring=require('querystring');var Papa=require(_0x743f('0xf'));var Redis=require(_0x743f('0x10'));var authService=require(_0x743f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x743f('0x12'));var hardwareService=require(_0x743f('0x13'));var logger=require('../../config/logger')(_0x743f('0x14'));var utils=require(_0x743f('0x15'));var config=require(_0x743f('0x16'));var licenseUtil=require(_0x743f('0x17'));var db=require(_0x743f('0x18'))['db'];function respondWithStatusCode(_0xa59d13,_0x55eba0){_0x55eba0=_0x55eba0||0xcc;return function(_0x45a66e){if(_0x45a66e){return _0xa59d13[_0x743f('0x19')](_0x55eba0);}return _0xa59d13[_0x743f('0x1a')](_0x55eba0)[_0x743f('0x1b')]();};}function respondWithResult(_0x482c9a,_0x3a7404){_0x3a7404=_0x3a7404||0xc8;return function(_0x583d96){if(_0x583d96){return _0x482c9a[_0x743f('0x1a')](_0x3a7404)['json'](_0x583d96);}};}function respondWithFilteredResult(_0x4ee9eb,_0xdfbacc){return function(_0x3234ba){if(_0x3234ba){var _0x477e64=typeof _0xdfbacc['offset']===_0x743f('0x1c')&&typeof _0xdfbacc['limit']==='undefined';var _0x11ade7=_0x3234ba['count'];var _0x46a47a=_0x477e64?0x0:_0xdfbacc[_0x743f('0x1d')];var _0x5d0972=_0x477e64?_0x3234ba[_0x743f('0x1e')]:_0xdfbacc[_0x743f('0x1d')]+_0xdfbacc[_0x743f('0x1f')];var _0x316211;if(_0x5d0972>=_0x11ade7){_0x5d0972=_0x11ade7;_0x316211=0xc8;}else{_0x316211=0xce;}_0x4ee9eb[_0x743f('0x1a')](_0x316211);return _0x4ee9eb[_0x743f('0x20')](_0x743f('0x21'),_0x46a47a+'-'+_0x5d0972+'/'+_0x11ade7)['json'](_0x3234ba);}return null;};}function patchUpdates(_0x39f5f1){return function(_0x43f95d){try{jsonpatch[_0x743f('0x22')](_0x43f95d,_0x39f5f1,!![]);}catch(_0x2cec93){return BPromise[_0x743f('0x23')](_0x2cec93);}return _0x43f95d[_0x743f('0x24')]();};}function saveUpdates(_0x34bef1,_0x10518c){return function(_0x225bac){if(_0x225bac){return _0x225bac[_0x743f('0x25')](_0x34bef1)['then'](function(_0x3f3365){return _0x3f3365;});}return null;};}function removeEntity(_0x327af0,_0x5ddb45){return function(_0x3535c2){if(_0x3535c2){return _0x3535c2[_0x743f('0x26')]()[_0x743f('0x27')](function(){_0x327af0['status'](0xcc)[_0x743f('0x1b')]();});}};}function handleEntityNotFound(_0x2a57c8,_0x371dcd){return function(_0x176e3b){if(!_0x176e3b){_0x2a57c8[_0x743f('0x19')](0x194);}return _0x176e3b;};}function handleError(_0x3d3b2b,_0x278ecc){_0x278ecc=_0x278ecc||0x1f4;return function(_0x3b341e){logger[_0x743f('0x28')](_0x3b341e[_0x743f('0x29')]);if(_0x3b341e[_0x743f('0x2a')]){delete _0x3b341e['name'];}_0x3d3b2b[_0x743f('0x1a')](_0x278ecc)['send'](_0x3b341e);};}exports[_0x743f('0x2b')]=function(_0x52450c,_0x4f394e){var _0x107b9c={},_0x50d444={},_0x4a4430={'count':0x0,'rows':[]};var _0x34ccd9=_[_0x743f('0x2c')](db[_0x743f('0x2d')][_0x743f('0x2e')],function(_0x38e704){return{'name':_0x38e704[_0x743f('0x2f')],'type':_0x38e704['type']['key']};});_0x50d444['model']=_[_0x743f('0x2c')](_0x34ccd9,_0x743f('0x2a'));_0x50d444['query']=_[_0x743f('0x30')](_0x52450c[_0x743f('0x31')]);_0x50d444[_0x743f('0x32')]=_[_0x743f('0x33')](_0x50d444[_0x743f('0x34')],_0x50d444[_0x743f('0x31')]);_0x107b9c[_0x743f('0x35')]=_[_0x743f('0x33')](_0x50d444['model'],qs[_0x743f('0x36')](_0x52450c[_0x743f('0x31')]['fields']));_0x107b9c[_0x743f('0x35')]=_0x107b9c[_0x743f('0x35')][_0x743f('0x37')]?_0x107b9c[_0x743f('0x35')]:_0x50d444['model'];if(!_0x52450c[_0x743f('0x31')]['hasOwnProperty']('nolimit')){_0x107b9c[_0x743f('0x1f')]=qs['limit'](_0x52450c[_0x743f('0x31')][_0x743f('0x1f')]);_0x107b9c['offset']=qs['offset'](_0x52450c[_0x743f('0x31')][_0x743f('0x1d')]);}_0x107b9c[_0x743f('0x38')]=qs[_0x743f('0x39')](_0x52450c[_0x743f('0x31')]['sort']);_0x107b9c[_0x743f('0x3a')]=qs['filters'](_[_0x743f('0x3b')](_0x52450c[_0x743f('0x31')],_0x50d444['filters']),_0x34ccd9);if(_0x52450c[_0x743f('0x31')][_0x743f('0x3c')]){_0x107b9c['where']=_['merge'](_0x107b9c[_0x743f('0x3a')],{'$or':_[_0x743f('0x2c')](_0x34ccd9,function(_0x1951ae){if(_0x1951ae[_0x743f('0x3d')]!=='VIRTUAL'){var _0x45b5d4={};_0x45b5d4[_0x1951ae['name']]={'$like':'%'+_0x52450c['query'][_0x743f('0x3c')]+'%'};return _0x45b5d4;}})});}_0x107b9c=_['merge']({},_0x107b9c,_0x52450c[_0x743f('0x3e')]);var _0x3aa4d0={'where':_0x107b9c[_0x743f('0x3a')]};return db[_0x743f('0x2d')][_0x743f('0x1e')](_0x3aa4d0)[_0x743f('0x27')](function(_0x4b01a1){_0x4a4430[_0x743f('0x1e')]=_0x4b01a1;if(_0x52450c[_0x743f('0x31')][_0x743f('0x3f')]){_0x107b9c[_0x743f('0x40')]=[{'all':!![]}];}return db[_0x743f('0x2d')][_0x743f('0x41')](_0x107b9c);})[_0x743f('0x27')](function(_0x28281a){_0x4a4430['rows']=_0x28281a;return _0x4a4430;})['then'](respondWithFilteredResult(_0x4f394e,_0x107b9c))['catch'](handleError(_0x4f394e,null));};exports['show']=function(_0x2d031e,_0x506933){var _0x2d2a7b={'raw':!![],'where':{'id':_0x2d031e['params']['id']}},_0x1e779d={};_0x1e779d[_0x743f('0x34')]=_[_0x743f('0x30')](db[_0x743f('0x2d')][_0x743f('0x2e')]);_0x1e779d[_0x743f('0x31')]=_[_0x743f('0x30')](_0x2d031e[_0x743f('0x31')]);_0x1e779d['filters']=_['intersection'](_0x1e779d[_0x743f('0x34')],_0x1e779d[_0x743f('0x31')]);_0x2d2a7b['attributes']=_[_0x743f('0x33')](_0x1e779d[_0x743f('0x34')],qs[_0x743f('0x36')](_0x2d031e[_0x743f('0x31')][_0x743f('0x36')]));_0x2d2a7b['attributes']=_0x2d2a7b[_0x743f('0x35')][_0x743f('0x37')]?_0x2d2a7b[_0x743f('0x35')]:_0x1e779d[_0x743f('0x34')];if(_0x2d031e[_0x743f('0x31')][_0x743f('0x3f')]){_0x2d2a7b[_0x743f('0x40')]=[{'all':!![]}];}_0x2d2a7b=_[_0x743f('0x42')]({},_0x2d2a7b,_0x2d031e['options']);return db[_0x743f('0x2d')][_0x743f('0x43')](_0x2d2a7b)[_0x743f('0x27')](handleEntityNotFound(_0x506933,null))[_0x743f('0x27')](respondWithResult(_0x506933,null))[_0x743f('0x44')](handleError(_0x506933,null));};exports[_0x743f('0x45')]=function(_0x13dc10,_0x2c2370){return db[_0x743f('0x2d')][_0x743f('0x45')](_0x13dc10[_0x743f('0x46')],{})[_0x743f('0x27')](respondWithResult(_0x2c2370,0xc9))[_0x743f('0x44')](handleError(_0x2c2370,null));};exports[_0x743f('0x25')]=function(_0x48e878,_0x594e02){if(_0x48e878[_0x743f('0x46')]['id']){delete _0x48e878[_0x743f('0x46')]['id'];}return db[_0x743f('0x2d')][_0x743f('0x43')]({'where':{'id':_0x48e878[_0x743f('0x47')]['id']}})[_0x743f('0x27')](handleEntityNotFound(_0x594e02,null))['then'](saveUpdates(_0x48e878[_0x743f('0x46')],null))[_0x743f('0x27')](respondWithResult(_0x594e02,null))['catch'](handleError(_0x594e02,null));};exports[_0x743f('0x26')]=function(_0x5aac2f,_0xf249ad){return db[_0x743f('0x2d')][_0x743f('0x43')]({'where':{'id':_0x5aac2f[_0x743f('0x47')]['id']}})[_0x743f('0x27')](handleEntityNotFound(_0xf249ad,null))[_0x743f('0x27')](removeEntity(_0xf249ad,null))[_0x743f('0x44')](handleError(_0xf249ad,null));};exports['describe']=function(_0x2db10f,_0x1e182c){return db['FaxTransferReport'][_0x743f('0x48')]()[_0x743f('0x27')](respondWithResult(_0x1e182c,null))[_0x743f('0x44')](handleError(_0x1e182c,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 2b77ed0..62a777d 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 _0x82f4=['util','api','moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0xeb996f,_0x5e1c36){var _0xe1d530=function(_0x2f9fa8){while(--_0x2f9fa8){_0xeb996f['push'](_0xeb996f['shift']());}};_0xe1d530(++_0x5e1c36);}(_0x82f4,0x1bf));var _0x482f=function(_0x2685d4,_0x39c077){_0x2685d4=_0x2685d4-0x0;var _0x3db6d9=_0x82f4[_0x2685d4];return _0x3db6d9;};'use strict';var _=require(_0x482f('0x0'));var util=require(_0x482f('0x1'));var logger=require('../../config/logger')(_0x482f('0x2'));var moment=require(_0x482f('0x3'));var BPromise=require(_0x482f('0x4'));var rp=require(_0x482f('0x5'));var fs=require('fs');var path=require(_0x482f('0x6'));var rimraf=require(_0x482f('0x7'));var config=require('../../config/environment');var attributes=require(_0x482f('0x8'));module[_0x482f('0x9')]=function(_0x457440,_0x4b969d){return _0x457440[_0x482f('0xa')](_0x482f('0xb'),attributes,{'tableName':_0x482f('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x482f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e3=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0x70e3,0x9d));var _0x370e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x70e3[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var logger=require(_0x370e('0x2'))(_0x370e('0x3'));var moment=require('moment');var BPromise=require(_0x370e('0x4'));var rp=require(_0x370e('0x5'));var fs=require('fs');var path=require(_0x370e('0x6'));var rimraf=require('rimraf');var config=require(_0x370e('0x7'));var attributes=require(_0x370e('0x8'));module[_0x370e('0x9')]=function(_0x2b99d1,_0x47c815){return _0x2b99d1[_0x370e('0xa')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x370e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 9de1452..cc8726f 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 _0x9863=['lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message'];(function(_0x584212,_0xd4f613){var _0xb66374=function(_0x405304){while(--_0x405304){_0x584212['push'](_0x584212['shift']());}};_0xb66374(++_0xd4f613);}(_0x9863,0x7e));var _0x3986=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9863[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x3986('0x0'));var util=require('util');var moment=require(_0x3986('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3986('0x2'));var db=require(_0x3986('0x3'))['db'];var utils=require(_0x3986('0x4'));var logger=require('../../config/logger')(_0x3986('0x5'));var config=require(_0x3986('0x6'));var jayson=require(_0x3986('0x7'));var client=jayson[_0x3986('0x8')][_0x3986('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412c26,_0x16c682,_0x1804d9){return new BPromise(function(_0x4d7dbc,_0xf40384){return client[_0x3986('0xa')](_0x412c26,_0x1804d9)[_0x3986('0xb')](function(_0x412d1d){logger[_0x3986('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x16c682,_0x3986('0xd'));logger[_0x3986('0xe')](_0x3986('0xf'),_0x16c682,_0x3986('0xd'),JSON[_0x3986('0x10')](_0x412d1d));if(_0x412d1d[_0x3986('0x11')]){if(_0x412d1d['error'][_0x3986('0x12')]===0x1f4){logger['error'](_0x3986('0x13'),_0x16c682,_0x412d1d[_0x3986('0x11')][_0x3986('0x14')]);return _0xf40384(_0x412d1d['error'][_0x3986('0x14')]);}logger['error'](_0x3986('0x13'),_0x16c682,_0x412d1d['error'][_0x3986('0x14')]);return _0x4d7dbc(_0x412d1d[_0x3986('0x11')][_0x3986('0x14')]);}else{logger['info'](_0x3986('0x13'),_0x16c682,_0x3986('0xd'));_0x4d7dbc(_0x412d1d['result'][_0x3986('0x14')]);}})['catch'](function(_0x5b1587){logger[_0x3986('0x11')](_0x3986('0x13'),_0x16c682,_0x5b1587);_0xf40384(_0x5b1587);});});} \ No newline at end of file +var _0x9d2a=['../../config/environment','jayson/promise','client','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','../../config/utils','../../config/logger','rpc'];(function(_0x4c9e88,_0x266f44){var _0x1ad2d9=function(_0x516a58){while(--_0x516a58){_0x4c9e88['push'](_0x4c9e88['shift']());}};_0x1ad2d9(++_0x266f44);}(_0x9d2a,0x1f0));var _0xa9d2=function(_0x4281dc,_0x1462cb){_0x4281dc=_0x4281dc-0x0;var _0xfd1de8=_0x9d2a[_0x4281dc];return _0xfd1de8;};'use strict';var _=require('lodash');var util=require(_0xa9d2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa9d2('0x1'));var logger=require(_0xa9d2('0x2'))(_0xa9d2('0x3'));var config=require(_0xa9d2('0x4'));var jayson=require(_0xa9d2('0x5'));var client=jayson[_0xa9d2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e1bd2,_0x405fdc,_0x59da4c){return new BPromise(function(_0x2145f5,_0x17deb0){return client[_0xa9d2('0x7')](_0x5e1bd2,_0x59da4c)[_0xa9d2('0x8')](function(_0x4b01ae){logger['info'](_0xa9d2('0x9'),_0x405fdc,_0xa9d2('0xa'));logger[_0xa9d2('0xb')](_0xa9d2('0xc'),_0x405fdc,'request\x20sent',JSON[_0xa9d2('0xd')](_0x4b01ae));if(_0x4b01ae[_0xa9d2('0xe')]){if(_0x4b01ae[_0xa9d2('0xe')][_0xa9d2('0xf')]===0x1f4){logger['error'](_0xa9d2('0x9'),_0x405fdc,_0x4b01ae[_0xa9d2('0xe')][_0xa9d2('0x10')]);return _0x17deb0(_0x4b01ae[_0xa9d2('0xe')][_0xa9d2('0x10')]);}logger['error'](_0xa9d2('0x9'),_0x405fdc,_0x4b01ae[_0xa9d2('0xe')][_0xa9d2('0x10')]);return _0x2145f5(_0x4b01ae['error']['message']);}else{logger[_0xa9d2('0x11')](_0xa9d2('0x9'),_0x405fdc,_0xa9d2('0xa'));_0x2145f5(_0x4b01ae[_0xa9d2('0x12')][_0xa9d2('0x10')]);}})[_0xa9d2('0x13')](function(_0x42832e){logger[_0xa9d2('0xe')](_0xa9d2('0x9'),_0x405fdc,_0x42832e);_0x17deb0(_0x42832e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 8d6cf69..5589ef0 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 _0xa7c9=['show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x5aee58,_0x369653){var _0x372664=function(_0x33cecc){while(--_0x33cecc){_0x5aee58['push'](_0x5aee58['shift']());}};_0x372664(++_0x369653);}(_0xa7c9,0xb2));var _0x9a7c=function(_0x598754,_0x523352){_0x598754=_0x598754-0x0;var _0x5aca24=_0xa7c9[_0x598754];return _0x5aca24;};'use strict';var multer=require(_0x9a7c('0x0'));var util=require(_0x9a7c('0x1'));var path=require('path');var timeout=require(_0x9a7c('0x2'));var express=require(_0x9a7c('0x3'));var router=express['Router']();var fs_extra=require(_0x9a7c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a7c('0x5'));var controller=require(_0x9a7c('0x6'));router[_0x9a7c('0x7')]('/',auth[_0x9a7c('0x8')](),controller[_0x9a7c('0x9')]);router[_0x9a7c('0x7')]('/describe',auth[_0x9a7c('0x8')](),controller[_0x9a7c('0xa')]);router[_0x9a7c('0x7')](_0x9a7c('0xb'),auth[_0x9a7c('0x8')](),controller[_0x9a7c('0xc')]);router[_0x9a7c('0xd')]('/',auth['isAuthenticated'](),controller[_0x9a7c('0xe')]);router[_0x9a7c('0xf')](_0x9a7c('0xb'),auth['isAuthenticated'](),controller[_0x9a7c('0x10')]);router[_0x9a7c('0x11')](_0x9a7c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a7c('0x12')]=router; \ No newline at end of file +var _0x6f77=['Router','fs-extra','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','delete','exports','connect-timeout','express'];(function(_0x59ea32,_0x484649){var _0x27eacd=function(_0x3bcaa3){while(--_0x3bcaa3){_0x59ea32['push'](_0x59ea32['shift']());}};_0x27eacd(++_0x484649);}(_0x6f77,0x10e));var _0x76f7=function(_0x37d870,_0x43470b){_0x37d870=_0x37d870-0x0;var _0x4b2c5f=_0x6f77[_0x37d870];return _0x4b2c5f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x76f7('0x0'));var express=require(_0x76f7('0x1'));var router=express[_0x76f7('0x2')]();var fs_extra=require(_0x76f7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x76f7('0x4'));var controller=require(_0x76f7('0x5'));router[_0x76f7('0x6')]('/',auth[_0x76f7('0x7')](),controller[_0x76f7('0x8')]);router['get']('/describe',auth[_0x76f7('0x7')](),controller[_0x76f7('0x9')]);router[_0x76f7('0x6')](_0x76f7('0xa'),auth['isAuthenticated'](),controller[_0x76f7('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76f7('0xc')]);router[_0x76f7('0xd')]('/:id',auth[_0x76f7('0x7')](),controller['update']);router[_0x76f7('0xe')](_0x76f7('0xa'),auth[_0x76f7('0x7')](),controller['destroy']);module[_0x76f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 935b803..a40a286 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 _0xbe23=['getConfigurations','/:id/fields','create','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x2da034,_0xb12c80){var _0x4394a7=function(_0x1f2357){while(--_0x1f2357){_0x2da034['push'](_0x2da034['shift']());}};_0x4394a7(++_0xb12c80);}(_0xbe23,0xb3));var _0x3be2=function(_0x5a0f00,_0x3934cf){_0x5a0f00=_0x5a0f00-0x0;var _0x2bc152=_0xbe23[_0x5a0f00];return _0x2bc152;};'use strict';var multer=require(_0x3be2('0x0'));var util=require(_0x3be2('0x1'));var path=require(_0x3be2('0x2'));var timeout=require(_0x3be2('0x3'));var express=require('express');var router=express[_0x3be2('0x4')]();var fs_extra=require(_0x3be2('0x5'));var auth=require(_0x3be2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3be2('0x7'));var controller=require(_0x3be2('0x8'));router[_0x3be2('0x9')]('/',auth[_0x3be2('0xa')](),controller['index']);router[_0x3be2('0x9')](_0x3be2('0xb'),auth[_0x3be2('0xa')](),controller[_0x3be2('0xc')]);router[_0x3be2('0x9')]('/:id/configurations',auth[_0x3be2('0xa')](),controller[_0x3be2('0xd')]);router['get'](_0x3be2('0xe'),auth[_0x3be2('0xa')](),controller['getFields']);router['post']('/',auth[_0x3be2('0xa')](),controller[_0x3be2('0xf')]);router[_0x3be2('0x10')](_0x3be2('0x11'),auth[_0x3be2('0xa')](),controller[_0x3be2('0x12')]);router[_0x3be2('0x13')](_0x3be2('0xb'),auth[_0x3be2('0xa')](),controller[_0x3be2('0x14')]);router[_0x3be2('0x15')](_0x3be2('0xb'),auth[_0x3be2('0xa')](),controller[_0x3be2('0x16')]);module[_0x3be2('0x17')]=router; \ No newline at end of file +var _0xac45=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x874a49,_0x5b07bc){var _0x343d2f=function(_0x351928){while(--_0x351928){_0x874a49['push'](_0x874a49['shift']());}};_0x343d2f(++_0x5b07bc);}(_0xac45,0xee));var _0x5ac4=function(_0x21f921,_0x35a268){_0x21f921=_0x21f921-0x0;var _0x5628df=_0xac45[_0x21f921];return _0x5628df;};'use strict';var multer=require(_0x5ac4('0x0'));var util=require(_0x5ac4('0x1'));var path=require(_0x5ac4('0x2'));var timeout=require(_0x5ac4('0x3'));var express=require(_0x5ac4('0x4'));var router=express[_0x5ac4('0x5')]();var fs_extra=require(_0x5ac4('0x6'));var auth=require(_0x5ac4('0x7'));var interaction=require(_0x5ac4('0x8'));var config=require(_0x5ac4('0x9'));var controller=require(_0x5ac4('0xa'));router[_0x5ac4('0xb')]('/',auth[_0x5ac4('0xc')](),controller['index']);router[_0x5ac4('0xb')](_0x5ac4('0xd'),auth['isAuthenticated'](),controller[_0x5ac4('0xe')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x5ac4('0xf')]);router[_0x5ac4('0xb')]('/:id/fields',auth[_0x5ac4('0xc')](),controller[_0x5ac4('0x10')]);router[_0x5ac4('0x11')]('/',auth[_0x5ac4('0xc')](),controller[_0x5ac4('0x12')]);router[_0x5ac4('0x11')](_0x5ac4('0x13'),auth['isAuthenticated'](),controller[_0x5ac4('0x14')]);router[_0x5ac4('0x15')](_0x5ac4('0xd'),auth['isAuthenticated'](),controller[_0x5ac4('0x16')]);router[_0x5ac4('0x17')](_0x5ac4('0xd'),auth[_0x5ac4('0xc')](),controller[_0x5ac4('0x18')]);module[_0x5ac4('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 37bfc14..f7a1a72 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 _0xfc95=['basic','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x1d7973,_0x357676){var _0x43190c=function(_0x4dd797){while(--_0x4dd797){_0x1d7973['push'](_0x1d7973['shift']());}};_0x43190c(++_0x357676);}(_0xfc95,0x76));var _0x5fc9=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0xfc95[_0x2f62aa];return _0x1a341f;};'use strict';var Sequelize=require(_0x5fc9('0x0'));module['exports']={'name':{'type':Sequelize[_0x5fc9('0x1')]},'description':{'type':Sequelize[_0x5fc9('0x1')]},'username':{'type':Sequelize[_0x5fc9('0x1')]},'remoteUri':{'type':Sequelize[_0x5fc9('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x5fc9('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x5fc9('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x5fc9('0x1')]},'tokenSecret':{'type':Sequelize[_0x5fc9('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5fc9('0x3')](_0x5fc9('0x4'),_0x5fc9('0x5')),'defaultValue':_0x5fc9('0x4')}}; \ No newline at end of file +var _0x2c68=['basic','integrationTab','newTab','STRING','ENUM'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x2c68,0x102));var _0x82c6=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x2c68[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x82c6('0x0')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x82c6('0x0')]},'authType':{'type':Sequelize[_0x82c6('0x1')](_0x82c6('0x2')),'defaultValue':_0x82c6('0x2')},'password':{'type':Sequelize[_0x82c6('0x0')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x82c6('0x0')]},'serverUrl':{'type':Sequelize[_0x82c6('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x82c6('0x1')](_0x82c6('0x3'),_0x82c6('0x4')),'defaultValue':_0x82c6('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index cae3848..5583f52 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 _0xd2d5=['toString','concat','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','length','includeAll','create','body','find','params','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers'];(function(_0x17bfa4,_0x3eb5f7){var _0x3d9ca8=function(_0x235cd4){while(--_0x235cd4){_0x17bfa4['push'](_0x17bfa4['shift']());}};_0x3d9ca8(++_0x3eb5f7);}(_0xd2d5,0x1d9));var _0x5d2d=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0xd2d5[_0x3fb5eb];return _0x481291;};'use strict';var emlformat=require(_0x5d2d('0x0'));var rimraf=require(_0x5d2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d2d('0x2'));var rp=require(_0x5d2d('0x3'));var moment=require(_0x5d2d('0x4'));var BPromise=require(_0x5d2d('0x5'));var Mustache=require('mustache');var util=require(_0x5d2d('0x6'));var path=require('path');var sox=require(_0x5d2d('0x7'));var csv=require('to-csv');var ejs=require(_0x5d2d('0x8'));var fs=require('fs');var fs_extra=require(_0x5d2d('0x9'));var _=require(_0x5d2d('0xa'));var squel=require(_0x5d2d('0xb'));var crypto=require(_0x5d2d('0xc'));var jsforce=require(_0x5d2d('0xd'));var deskjs=require(_0x5d2d('0xe'));var toCsv=require(_0x5d2d('0xf'));var querystring=require(_0x5d2d('0x10'));var Papa=require(_0x5d2d('0x11'));var Redis=require(_0x5d2d('0x12'));var authService=require(_0x5d2d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d2d('0x15'))(_0x5d2d('0x16'));var utils=require('../../config/utils');var config=require(_0x5d2d('0x17'));var licenseUtil=require(_0x5d2d('0x18'));var db=require(_0x5d2d('0x19'))['db'];var integrations=require(_0x5d2d('0x1a'));function respondWithStatusCode(_0x132a79,_0x1f4c26){_0x1f4c26=_0x1f4c26||0xcc;return function(_0x8d6407){if(_0x8d6407){return _0x132a79[_0x5d2d('0x1b')](_0x1f4c26);}return _0x132a79['status'](_0x1f4c26)[_0x5d2d('0x1c')]();};}function respondWithResult(_0x5882ca,_0xa5de19){_0xa5de19=_0xa5de19||0xc8;return function(_0x286975){if(_0x286975){return _0x5882ca[_0x5d2d('0x1d')](_0xa5de19)[_0x5d2d('0x1e')](_0x286975);}};}function respondWithFilteredResult(_0x3963a1,_0xc52932){return function(_0x304247){if(_0x304247){var _0x170e80=typeof _0xc52932[_0x5d2d('0x1f')]===_0x5d2d('0x20')&&typeof _0xc52932[_0x5d2d('0x21')]==='undefined';var _0x49fb85=_0x304247[_0x5d2d('0x22')];var _0x100117=_0x170e80?0x0:_0xc52932[_0x5d2d('0x1f')];var _0x537895=_0x170e80?_0x304247[_0x5d2d('0x22')]:_0xc52932['offset']+_0xc52932[_0x5d2d('0x21')];var _0x5e208b;if(_0x537895>=_0x49fb85){_0x537895=_0x49fb85;_0x5e208b=0xc8;}else{_0x5e208b=0xce;}_0x3963a1[_0x5d2d('0x1d')](_0x5e208b);return _0x3963a1[_0x5d2d('0x23')](_0x5d2d('0x24'),_0x100117+'-'+_0x537895+'/'+_0x49fb85)[_0x5d2d('0x1e')](_0x304247);}return null;};}function patchUpdates(_0x46c502){return function(_0x5a6ebe){try{jsonpatch[_0x5d2d('0x25')](_0x5a6ebe,_0x46c502,!![]);}catch(_0x274d5e){return BPromise[_0x5d2d('0x26')](_0x274d5e);}return _0x5a6ebe['save']();};}function saveUpdates(_0x22e8a7,_0x1f8ea1){return function(_0x2b5231){if(_0x2b5231){return _0x2b5231[_0x5d2d('0x27')](_0x22e8a7)[_0x5d2d('0x28')](function(_0x349f6b){return _0x349f6b;});}return null;};}function removeEntity(_0x28a8a5,_0x3469d9){return function(_0x45640c){if(_0x45640c){return _0x45640c[_0x5d2d('0x29')]()[_0x5d2d('0x28')](function(){_0x28a8a5[_0x5d2d('0x1d')](0xcc)[_0x5d2d('0x1c')]();});}};}function handleEntityNotFound(_0x3f5283,_0x4c12ee){return function(_0x29d293){if(!_0x29d293){_0x3f5283[_0x5d2d('0x1b')](0x194);}return _0x29d293;};}function handleError(_0x481306,_0xe38fa6){_0xe38fa6=_0xe38fa6||0x1f4;return function(_0x46bd68){logger[_0x5d2d('0x2a')](_0x46bd68[_0x5d2d('0x2b')]);if(_0x46bd68[_0x5d2d('0x2c')]){delete _0x46bd68[_0x5d2d('0x2c')];}_0x481306['status'](_0xe38fa6)[_0x5d2d('0x2d')](_0x46bd68);};}exports['index']=function(_0x51b36e,_0x2e23f0){var _0x3b47b6={},_0x2531a0={},_0xe2757e={'count':0x0,'rows':[]};var _0x4ba195=_[_0x5d2d('0x2e')](db[_0x5d2d('0x2f')][_0x5d2d('0x30')],function(_0x24c09d){return{'name':_0x24c09d[_0x5d2d('0x31')],'type':_0x24c09d[_0x5d2d('0x32')][_0x5d2d('0x33')]};});_0x2531a0[_0x5d2d('0x34')]=_['map'](_0x4ba195,_0x5d2d('0x2c'));_0x2531a0[_0x5d2d('0x35')]=_['keys'](_0x51b36e[_0x5d2d('0x35')]);_0x2531a0[_0x5d2d('0x36')]=_['intersection'](_0x2531a0['model'],_0x2531a0[_0x5d2d('0x35')]);_0x3b47b6[_0x5d2d('0x37')]=_[_0x5d2d('0x38')](_0x2531a0[_0x5d2d('0x34')],qs['fields'](_0x51b36e[_0x5d2d('0x35')][_0x5d2d('0x39')]));_0x3b47b6['attributes']=_0x3b47b6[_0x5d2d('0x37')]['length']?_0x3b47b6[_0x5d2d('0x37')]:_0x2531a0[_0x5d2d('0x34')];if(!_0x51b36e[_0x5d2d('0x35')]['hasOwnProperty'](_0x5d2d('0x3a'))){_0x3b47b6['limit']=qs[_0x5d2d('0x21')](_0x51b36e['query']['limit']);_0x3b47b6[_0x5d2d('0x1f')]=qs[_0x5d2d('0x1f')](_0x51b36e[_0x5d2d('0x35')]['offset']);}_0x3b47b6[_0x5d2d('0x3b')]=qs[_0x5d2d('0x3c')](_0x51b36e[_0x5d2d('0x35')][_0x5d2d('0x3c')]);_0x3b47b6[_0x5d2d('0x3d')]=qs[_0x5d2d('0x36')](_[_0x5d2d('0x3e')](_0x51b36e['query'],_0x2531a0[_0x5d2d('0x36')]),_0x4ba195);if(_0x51b36e[_0x5d2d('0x35')][_0x5d2d('0x3f')]){_0x3b47b6[_0x5d2d('0x3d')]=_[_0x5d2d('0x40')](_0x3b47b6['where'],{'$or':_[_0x5d2d('0x2e')](_0x4ba195,function(_0x33e321){if(_0x33e321['type']!==_0x5d2d('0x41')){var _0x4ddf6b={};_0x4ddf6b[_0x33e321['name']]={'$like':'%'+_0x51b36e[_0x5d2d('0x35')][_0x5d2d('0x3f')]+'%'};return _0x4ddf6b;}})});}_0x3b47b6=_[_0x5d2d('0x40')]({},_0x3b47b6,_0x51b36e[_0x5d2d('0x42')]);var _0xb1931c={'where':_0x3b47b6['where']};return db[_0x5d2d('0x2f')][_0x5d2d('0x22')](_0xb1931c)[_0x5d2d('0x28')](function(_0x5d8135){_0xe2757e['count']=_0x5d8135;if(_0x51b36e[_0x5d2d('0x35')]['includeAll']){_0x3b47b6[_0x5d2d('0x43')]=[{'all':!![]}];}return db[_0x5d2d('0x2f')][_0x5d2d('0x44')](_0x3b47b6);})[_0x5d2d('0x28')](function(_0x1468d0){_0xe2757e[_0x5d2d('0x45')]=_0x1468d0;return _0xe2757e;})[_0x5d2d('0x28')](respondWithFilteredResult(_0x2e23f0,_0x3b47b6))[_0x5d2d('0x46')](handleError(_0x2e23f0,null));};exports[_0x5d2d('0x47')]=function(_0x4d354b,_0x12e956){var _0x45adcd={'raw':![],'where':{'id':_0x4d354b['params']['id']}},_0x28656a={};_0x28656a[_0x5d2d('0x34')]=_[_0x5d2d('0x48')](db[_0x5d2d('0x2f')][_0x5d2d('0x30')]);_0x28656a['query']=_[_0x5d2d('0x48')](_0x4d354b[_0x5d2d('0x35')]);_0x28656a['filters']=_[_0x5d2d('0x38')](_0x28656a['model'],_0x28656a['query']);_0x45adcd[_0x5d2d('0x37')]=_[_0x5d2d('0x38')](_0x28656a[_0x5d2d('0x34')],qs[_0x5d2d('0x39')](_0x4d354b[_0x5d2d('0x35')][_0x5d2d('0x39')]));_0x45adcd[_0x5d2d('0x37')]=_0x45adcd[_0x5d2d('0x37')][_0x5d2d('0x49')]?_0x45adcd[_0x5d2d('0x37')]:_0x28656a[_0x5d2d('0x34')];if(_0x4d354b[_0x5d2d('0x35')][_0x5d2d('0x4a')]){_0x45adcd[_0x5d2d('0x43')]=[{'all':!![]}];}_0x45adcd=_[_0x5d2d('0x40')]({},_0x45adcd,_0x4d354b[_0x5d2d('0x42')]);return db['DeskAccount']['find'](_0x45adcd)['then'](handleEntityNotFound(_0x12e956,null))['then'](respondWithResult(_0x12e956,null))['catch'](handleError(_0x12e956,null));};exports[_0x5d2d('0x4b')]=function(_0x582e49,_0x21abd2){return db[_0x5d2d('0x2f')]['create'](_0x582e49[_0x5d2d('0x4c')],{})[_0x5d2d('0x28')](respondWithResult(_0x21abd2,0xc9))[_0x5d2d('0x46')](handleError(_0x21abd2,null));};exports[_0x5d2d('0x27')]=function(_0x1e7fb5,_0x53173b){if(_0x1e7fb5['body']['id']){delete _0x1e7fb5[_0x5d2d('0x4c')]['id'];}return db['DeskAccount'][_0x5d2d('0x4d')]({'where':{'id':_0x1e7fb5[_0x5d2d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x53173b,null))[_0x5d2d('0x28')](saveUpdates(_0x1e7fb5[_0x5d2d('0x4c')],null))['then'](respondWithResult(_0x53173b,null))['catch'](handleError(_0x53173b,null));};exports[_0x5d2d('0x29')]=function(_0x1b0537,_0x4d765a){return db['DeskAccount'][_0x5d2d('0x4d')]({'where':{'id':_0x1b0537[_0x5d2d('0x4e')]['id']}})[_0x5d2d('0x28')](handleEntityNotFound(_0x4d765a,null))[_0x5d2d('0x28')](removeEntity(_0x4d765a,null))[_0x5d2d('0x46')](handleError(_0x4d765a,null));};exports[_0x5d2d('0x4f')]=function(_0x421943,_0x401910,_0x2feaf7){var _0x231601={};var _0x19d490={};var _0x281904;var _0x21ad48;return db[_0x5d2d('0x2f')][_0x5d2d('0x50')]({'where':{'id':_0x421943[_0x5d2d('0x4e')]['id']}})[_0x5d2d('0x28')](handleEntityNotFound(_0x401910,null))[_0x5d2d('0x28')](function(_0x3487b2){if(_0x3487b2){_0x281904=_0x3487b2;_0x19d490['model']=_[_0x5d2d('0x48')](db[_0x5d2d('0x51')]['rawAttributes']);_0x19d490['query']=_[_0x5d2d('0x48')](_0x421943[_0x5d2d('0x35')]);_0x19d490[_0x5d2d('0x36')]=_[_0x5d2d('0x38')](_0x19d490['model'],_0x19d490[_0x5d2d('0x35')]);_0x231601['attributes']=_['intersection'](_0x19d490['model'],qs['fields'](_0x421943[_0x5d2d('0x35')][_0x5d2d('0x39')]));_0x231601['attributes']=_0x231601[_0x5d2d('0x37')][_0x5d2d('0x49')]?_0x231601[_0x5d2d('0x37')]:_0x19d490[_0x5d2d('0x34')];_0x231601[_0x5d2d('0x3b')]=qs[_0x5d2d('0x3c')](_0x421943['query'][_0x5d2d('0x3c')]);_0x231601[_0x5d2d('0x3d')]=qs[_0x5d2d('0x36')](_[_0x5d2d('0x3e')](_0x421943['query'],_0x19d490['filters']));if(_0x421943['query'][_0x5d2d('0x3f')]){_0x231601[_0x5d2d('0x3d')]=_[_0x5d2d('0x40')](_0x231601['where'],{'$or':_['map'](_0x231601[_0x5d2d('0x37')],function(_0x3fbddc){var _0x2a0e3d={};_0x2a0e3d[_0x3fbddc]={'$like':'%'+_0x421943['query']['filter']+'%'};return _0x2a0e3d;})});}_0x231601=_[_0x5d2d('0x40')]({},_0x231601,_0x421943[_0x5d2d('0x42')]);return _0x281904[_0x5d2d('0x4f')](_0x231601);}})[_0x5d2d('0x28')](function(_0x393731){if(_0x393731){_0x21ad48=_0x393731[_0x5d2d('0x49')];if(!_0x421943['query'][_0x5d2d('0x52')](_0x5d2d('0x3a'))){_0x231601[_0x5d2d('0x21')]=qs['limit'](_0x421943['query'][_0x5d2d('0x21')]);_0x231601[_0x5d2d('0x1f')]=qs[_0x5d2d('0x1f')](_0x421943[_0x5d2d('0x35')][_0x5d2d('0x1f')]);}return _0x281904[_0x5d2d('0x4f')](_0x231601);}})[_0x5d2d('0x28')](function(_0x4610ae){if(_0x4610ae){return _0x4610ae?{'count':_0x21ad48,'rows':_0x4610ae}:null;}})['then'](respondWithResult(_0x401910,null))[_0x5d2d('0x46')](handleError(_0x401910,null));};exports['addConfiguration']=function(_0x723fe,_0x19409d,_0x2829e8){if(_0x723fe[_0x5d2d('0x4c')]['id']){delete _0x723fe[_0x5d2d('0x4c')]['id'];}return db[_0x5d2d('0x2f')]['findOne']({'where':{'id':_0x723fe['params']['id']}})[_0x5d2d('0x28')](handleEntityNotFound(_0x19409d,null))[_0x5d2d('0x28')](function(_0x7ef5a8){if(_0x7ef5a8){_0x723fe[_0x5d2d('0x4c')][_0x5d2d('0x53')]=_0x7ef5a8['id'];_0x723fe[_0x5d2d('0x4c')][_0x5d2d('0x54')]=integrations[_0x5d2d('0x55')](_0x723fe[_0x5d2d('0x4c')][_0x5d2d('0x56')],_0x723fe[_0x5d2d('0x4c')][_0x5d2d('0x32')]);_0x723fe['body']['Descriptions']=integrations[_0x5d2d('0x57')](_0x723fe[_0x5d2d('0x4c')]['channel'],_0x723fe[_0x5d2d('0x4c')][_0x5d2d('0x32')]);return db[_0x5d2d('0x51')]['create'](_0x723fe[_0x5d2d('0x4c')],{'include':[{'model':db[_0x5d2d('0x58')],'as':_0x5d2d('0x54')},{'model':db['DeskField'],'as':_0x5d2d('0x59')}]});}return null;})[_0x5d2d('0x28')](respondWithResult(_0x19409d,null))[_0x5d2d('0x46')](handleError(_0x19409d,null));};exports[_0x5d2d('0x5a')]=function(_0x4abfe5,_0x3a0da7,_0x5a2938){var _0x87b226=[{'name':_0x5d2d('0x5b'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xf608e5='';return db[_0x5d2d('0x2f')][_0x5d2d('0x50')]({'where':{'id':_0x4abfe5[_0x5d2d('0x4e')]['id']},'attributes':['id',_0x5d2d('0x5c'),_0x5d2d('0x5d'),_0x5d2d('0x5e'),'password',_0x5d2d('0x5f'),'consumerSecret',_0x5d2d('0x60'),_0x5d2d('0x61')]})[_0x5d2d('0x28')](handleEntityNotFound(_0x3a0da7,null))[_0x5d2d('0x28')](function(_0xf4fac4){if(_0xf4fac4){_0xf608e5=_0xf4fac4['remoteUri'];var _0x273a3a=_0xf608e5[_0x5d2d('0x62')](-0x1);if(_0x273a3a==='/'){_0xf608e5=_0xf608e5[_0x5d2d('0x63')](0x0,_0xf608e5[_0x5d2d('0x64')](_0x273a3a));}var _0x44e162={'method':_0x5d2d('0x65'),'uri':util[_0x5d2d('0x66')](_0x5d2d('0x67'),_0xf608e5),'headers':{'Content-Type':_0x5d2d('0x68'),'Accept':_0x5d2d('0x68')},'json':!![]};if(_0xf4fac4[_0x5d2d('0x5d')]===_0x5d2d('0x69')){_0x44e162[_0x5d2d('0x6a')]['Authorization']=util[_0x5d2d('0x66')]('Basic\x20%s',new Buffer(util[_0x5d2d('0x66')]('%s:%s',_0xf4fac4[_0x5d2d('0x5e')],_0xf4fac4['password']))[_0x5d2d('0x6b')]('base64'));}return rp(_0x44e162)[_0x5d2d('0x28')](function(_0x4fe78c){return _0x87b226[_0x5d2d('0x6c')](_['map'](_0x4fe78c[_0x5d2d('0x6d')][_0x5d2d('0x6e')],function(_0x16aa3b){return{'id':_0x16aa3b['name'],'name':_0x16aa3b[_0x5d2d('0x2c')],'type':_0x16aa3b['type'],'active':_0x16aa3b[_0x5d2d('0x6f')],'label':_0x16aa3b['label'],'custom':!![]};}));});}})[_0x5d2d('0x28')](function(_0x2b800e){return{'count':_0x2b800e[_0x5d2d('0x49')],'rows':_0x2b800e};})[_0x5d2d('0x28')](respondWithResult(_0x3a0da7,null))[_0x5d2d('0x46')](function(_0x4f8b58){var _0x5c5409=_0x4abfe5['query'][_0x5d2d('0x70')]?0x1f4:_0x4f8b58[_0x5d2d('0x71')]||0x1f4;logger[_0x5d2d('0x2a')](_0x5d2d('0x72'),_0x5d2d('0x5a'),_0x5c5409,JSON[_0x5d2d('0x73')](_0x4f8b58));delete _0x4f8b58[_0x5d2d('0x2c')];if(_0x5c5409===0x191){_0x5c5409=0x190;}_0x3a0da7[_0x5d2d('0x1d')](_0x5c5409)['send'](_0x4abfe5[_0x5d2d('0x35')][_0x5d2d('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x4f8b58['statusCode']}:_0x4f8b58);});}; \ No newline at end of file +var _0x28f7=['rows','catch','params','intersection','include','find','create','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','body','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','application/json','basic','Basic\x20%s','%s:%s','_embedded','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll'];(function(_0xa599e2,_0x3046be){var _0x122f49=function(_0x4f3d6d){while(--_0x4f3d6d){_0xa599e2['push'](_0xa599e2['shift']());}};_0x122f49(++_0x3046be);}(_0x28f7,0x1ec));var _0x728f=function(_0x4191e8,_0x43aa9f){_0x4191e8=_0x4191e8-0x0;var _0x4582a2=_0x28f7[_0x4191e8];return _0x4582a2;};'use strict';var emlformat=require(_0x728f('0x0'));var rimraf=require(_0x728f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x728f('0x2'));var rp=require(_0x728f('0x3'));var moment=require(_0x728f('0x4'));var BPromise=require(_0x728f('0x5'));var Mustache=require(_0x728f('0x6'));var util=require('util');var path=require(_0x728f('0x7'));var sox=require(_0x728f('0x8'));var csv=require(_0x728f('0x9'));var ejs=require(_0x728f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x728f('0xb'));var squel=require(_0x728f('0xc'));var crypto=require('crypto');var jsforce=require(_0x728f('0xd'));var deskjs=require(_0x728f('0xe'));var toCsv=require(_0x728f('0x9'));var querystring=require(_0x728f('0xf'));var Papa=require(_0x728f('0x10'));var Redis=require(_0x728f('0x11'));var authService=require(_0x728f('0x12'));var qs=require(_0x728f('0x13'));var as=require(_0x728f('0x14'));var hardwareService=require(_0x728f('0x15'));var logger=require(_0x728f('0x16'))(_0x728f('0x17'));var utils=require(_0x728f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x728f('0x19'));var db=require(_0x728f('0x1a'))['db'];var integrations=require(_0x728f('0x1b'));function respondWithStatusCode(_0x38a713,_0x5cee3c){_0x5cee3c=_0x5cee3c||0xcc;return function(_0x1cee56){if(_0x1cee56){return _0x38a713[_0x728f('0x1c')](_0x5cee3c);}return _0x38a713[_0x728f('0x1d')](_0x5cee3c)[_0x728f('0x1e')]();};}function respondWithResult(_0x228b49,_0xe774bb){_0xe774bb=_0xe774bb||0xc8;return function(_0x788d3a){if(_0x788d3a){return _0x228b49['status'](_0xe774bb)[_0x728f('0x1f')](_0x788d3a);}};}function respondWithFilteredResult(_0x4e652a,_0x56ad27){return function(_0x177647){if(_0x177647){var _0x98a4d4=typeof _0x56ad27['offset']==='undefined'&&typeof _0x56ad27[_0x728f('0x20')]==='undefined';var _0x24ffaa=_0x177647[_0x728f('0x21')];var _0x83a30a=_0x98a4d4?0x0:_0x56ad27[_0x728f('0x22')];var _0x3d7b78=_0x98a4d4?_0x177647[_0x728f('0x21')]:_0x56ad27['offset']+_0x56ad27['limit'];var _0x4f95ca;if(_0x3d7b78>=_0x24ffaa){_0x3d7b78=_0x24ffaa;_0x4f95ca=0xc8;}else{_0x4f95ca=0xce;}_0x4e652a[_0x728f('0x1d')](_0x4f95ca);return _0x4e652a['set'](_0x728f('0x23'),_0x83a30a+'-'+_0x3d7b78+'/'+_0x24ffaa)[_0x728f('0x1f')](_0x177647);}return null;};}function patchUpdates(_0x2d4f62){return function(_0x3c9b90){try{jsonpatch[_0x728f('0x24')](_0x3c9b90,_0x2d4f62,!![]);}catch(_0x42ed76){return BPromise['reject'](_0x42ed76);}return _0x3c9b90[_0x728f('0x25')]();};}function saveUpdates(_0x3cb9cc,_0x254fdc){return function(_0x3760dc){if(_0x3760dc){return _0x3760dc[_0x728f('0x26')](_0x3cb9cc)['then'](function(_0x4c7873){return _0x4c7873;});}return null;};}function removeEntity(_0x5e0d92,_0x37f550){return function(_0x17f26b){if(_0x17f26b){return _0x17f26b[_0x728f('0x27')]()[_0x728f('0x28')](function(){_0x5e0d92[_0x728f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eff15,_0xbbf9c7){return function(_0x585adb){if(!_0x585adb){_0x5eff15[_0x728f('0x1c')](0x194);}return _0x585adb;};}function handleError(_0x4ea14a,_0xe5f535){_0xe5f535=_0xe5f535||0x1f4;return function(_0x9cc822){logger[_0x728f('0x29')](_0x9cc822[_0x728f('0x2a')]);if(_0x9cc822[_0x728f('0x2b')]){delete _0x9cc822['name'];}_0x4ea14a[_0x728f('0x1d')](_0xe5f535)[_0x728f('0x2c')](_0x9cc822);};}exports[_0x728f('0x2d')]=function(_0x87ecf7,_0x528b9b){var _0x9ea4a8={},_0x26be87={},_0x19fac7={'count':0x0,'rows':[]};var _0x42e551=_[_0x728f('0x2e')](db[_0x728f('0x2f')][_0x728f('0x30')],function(_0x39fdc4){return{'name':_0x39fdc4['fieldName'],'type':_0x39fdc4['type'][_0x728f('0x31')]};});_0x26be87[_0x728f('0x32')]=_['map'](_0x42e551,_0x728f('0x2b'));_0x26be87[_0x728f('0x33')]=_[_0x728f('0x34')](_0x87ecf7[_0x728f('0x33')]);_0x26be87[_0x728f('0x35')]=_['intersection'](_0x26be87[_0x728f('0x32')],_0x26be87[_0x728f('0x33')]);_0x9ea4a8[_0x728f('0x36')]=_['intersection'](_0x26be87[_0x728f('0x32')],qs['fields'](_0x87ecf7[_0x728f('0x33')][_0x728f('0x37')]));_0x9ea4a8['attributes']=_0x9ea4a8[_0x728f('0x36')][_0x728f('0x38')]?_0x9ea4a8[_0x728f('0x36')]:_0x26be87['model'];if(!_0x87ecf7[_0x728f('0x33')][_0x728f('0x39')]('nolimit')){_0x9ea4a8['limit']=qs[_0x728f('0x20')](_0x87ecf7[_0x728f('0x33')]['limit']);_0x9ea4a8[_0x728f('0x22')]=qs[_0x728f('0x22')](_0x87ecf7['query'][_0x728f('0x22')]);}_0x9ea4a8[_0x728f('0x3a')]=qs[_0x728f('0x3b')](_0x87ecf7[_0x728f('0x33')]['sort']);_0x9ea4a8[_0x728f('0x3c')]=qs[_0x728f('0x35')](_[_0x728f('0x3d')](_0x87ecf7[_0x728f('0x33')],_0x26be87['filters']),_0x42e551);if(_0x87ecf7[_0x728f('0x33')][_0x728f('0x3e')]){_0x9ea4a8['where']=_['merge'](_0x9ea4a8[_0x728f('0x3c')],{'$or':_[_0x728f('0x2e')](_0x42e551,function(_0x3cc367){if(_0x3cc367[_0x728f('0x3f')]!==_0x728f('0x40')){var _0x10f3de={};_0x10f3de[_0x3cc367[_0x728f('0x2b')]]={'$like':'%'+_0x87ecf7['query'][_0x728f('0x3e')]+'%'};return _0x10f3de;}})});}_0x9ea4a8=_[_0x728f('0x41')]({},_0x9ea4a8,_0x87ecf7['options']);var _0x100764={'where':_0x9ea4a8[_0x728f('0x3c')]};return db[_0x728f('0x2f')][_0x728f('0x21')](_0x100764)[_0x728f('0x28')](function(_0x57210c){_0x19fac7[_0x728f('0x21')]=_0x57210c;if(_0x87ecf7[_0x728f('0x33')][_0x728f('0x42')]){_0x9ea4a8['include']=[{'all':!![]}];}return db['DeskAccount'][_0x728f('0x43')](_0x9ea4a8);})[_0x728f('0x28')](function(_0x52114a){_0x19fac7[_0x728f('0x44')]=_0x52114a;return _0x19fac7;})[_0x728f('0x28')](respondWithFilteredResult(_0x528b9b,_0x9ea4a8))[_0x728f('0x45')](handleError(_0x528b9b,null));};exports['show']=function(_0x64f9ab,_0x2ca9f4){var _0xc5b7d4={'raw':![],'where':{'id':_0x64f9ab[_0x728f('0x46')]['id']}},_0x4003b1={};_0x4003b1[_0x728f('0x32')]=_[_0x728f('0x34')](db['DeskAccount'][_0x728f('0x30')]);_0x4003b1[_0x728f('0x33')]=_['keys'](_0x64f9ab['query']);_0x4003b1[_0x728f('0x35')]=_[_0x728f('0x47')](_0x4003b1[_0x728f('0x32')],_0x4003b1[_0x728f('0x33')]);_0xc5b7d4[_0x728f('0x36')]=_[_0x728f('0x47')](_0x4003b1[_0x728f('0x32')],qs[_0x728f('0x37')](_0x64f9ab[_0x728f('0x33')][_0x728f('0x37')]));_0xc5b7d4[_0x728f('0x36')]=_0xc5b7d4[_0x728f('0x36')][_0x728f('0x38')]?_0xc5b7d4['attributes']:_0x4003b1[_0x728f('0x32')];if(_0x64f9ab['query'][_0x728f('0x42')]){_0xc5b7d4[_0x728f('0x48')]=[{'all':!![]}];}_0xc5b7d4=_[_0x728f('0x41')]({},_0xc5b7d4,_0x64f9ab['options']);return db[_0x728f('0x2f')][_0x728f('0x49')](_0xc5b7d4)[_0x728f('0x28')](handleEntityNotFound(_0x2ca9f4,null))[_0x728f('0x28')](respondWithResult(_0x2ca9f4,null))['catch'](handleError(_0x2ca9f4,null));};exports[_0x728f('0x4a')]=function(_0x1e463d,_0xef162d){return db[_0x728f('0x2f')]['create'](_0x1e463d['body'],{})[_0x728f('0x28')](respondWithResult(_0xef162d,0xc9))[_0x728f('0x45')](handleError(_0xef162d,null));};exports['update']=function(_0x198434,_0x46add6){if(_0x198434['body']['id']){delete _0x198434['body']['id'];}return db[_0x728f('0x2f')][_0x728f('0x49')]({'where':{'id':_0x198434['params']['id']}})[_0x728f('0x28')](handleEntityNotFound(_0x46add6,null))[_0x728f('0x28')](saveUpdates(_0x198434['body'],null))['then'](respondWithResult(_0x46add6,null))['catch'](handleError(_0x46add6,null));};exports[_0x728f('0x27')]=function(_0x19a9dc,_0x2c6e6b){return db['DeskAccount'][_0x728f('0x49')]({'where':{'id':_0x19a9dc['params']['id']}})[_0x728f('0x28')](handleEntityNotFound(_0x2c6e6b,null))[_0x728f('0x28')](removeEntity(_0x2c6e6b,null))[_0x728f('0x45')](handleError(_0x2c6e6b,null));};exports[_0x728f('0x4b')]=function(_0x4066e1,_0x11c4f6,_0x3fc406){var _0x5d17d7={};var _0x4389bb={};var _0x1e6a65;var _0x52c29a;return db['DeskAccount'][_0x728f('0x4c')]({'where':{'id':_0x4066e1[_0x728f('0x46')]['id']}})['then'](handleEntityNotFound(_0x11c4f6,null))[_0x728f('0x28')](function(_0x4699fc){if(_0x4699fc){_0x1e6a65=_0x4699fc;_0x4389bb[_0x728f('0x32')]=_[_0x728f('0x34')](db[_0x728f('0x4d')][_0x728f('0x30')]);_0x4389bb[_0x728f('0x33')]=_[_0x728f('0x34')](_0x4066e1[_0x728f('0x33')]);_0x4389bb[_0x728f('0x35')]=_[_0x728f('0x47')](_0x4389bb[_0x728f('0x32')],_0x4389bb[_0x728f('0x33')]);_0x5d17d7[_0x728f('0x36')]=_[_0x728f('0x47')](_0x4389bb[_0x728f('0x32')],qs[_0x728f('0x37')](_0x4066e1[_0x728f('0x33')][_0x728f('0x37')]));_0x5d17d7['attributes']=_0x5d17d7[_0x728f('0x36')][_0x728f('0x38')]?_0x5d17d7[_0x728f('0x36')]:_0x4389bb[_0x728f('0x32')];_0x5d17d7[_0x728f('0x3a')]=qs[_0x728f('0x3b')](_0x4066e1['query'][_0x728f('0x3b')]);_0x5d17d7[_0x728f('0x3c')]=qs[_0x728f('0x35')](_[_0x728f('0x3d')](_0x4066e1[_0x728f('0x33')],_0x4389bb[_0x728f('0x35')]));if(_0x4066e1[_0x728f('0x33')][_0x728f('0x3e')]){_0x5d17d7[_0x728f('0x3c')]=_[_0x728f('0x41')](_0x5d17d7[_0x728f('0x3c')],{'$or':_['map'](_0x5d17d7['attributes'],function(_0x125f05){var _0x4ced02={};_0x4ced02[_0x125f05]={'$like':'%'+_0x4066e1[_0x728f('0x33')][_0x728f('0x3e')]+'%'};return _0x4ced02;})});}_0x5d17d7=_[_0x728f('0x41')]({},_0x5d17d7,_0x4066e1['options']);return _0x1e6a65[_0x728f('0x4b')](_0x5d17d7);}})[_0x728f('0x28')](function(_0x3d417b){if(_0x3d417b){_0x52c29a=_0x3d417b[_0x728f('0x38')];if(!_0x4066e1[_0x728f('0x33')][_0x728f('0x39')](_0x728f('0x4e'))){_0x5d17d7[_0x728f('0x20')]=qs[_0x728f('0x20')](_0x4066e1[_0x728f('0x33')][_0x728f('0x20')]);_0x5d17d7[_0x728f('0x22')]=qs[_0x728f('0x22')](_0x4066e1[_0x728f('0x33')][_0x728f('0x22')]);}return _0x1e6a65[_0x728f('0x4b')](_0x5d17d7);}})['then'](function(_0x1f8d79){if(_0x1f8d79){return _0x1f8d79?{'count':_0x52c29a,'rows':_0x1f8d79}:null;}})[_0x728f('0x28')](respondWithResult(_0x11c4f6,null))[_0x728f('0x45')](handleError(_0x11c4f6,null));};exports[_0x728f('0x4f')]=function(_0x456947,_0x4d36bc,_0x217de1){if(_0x456947['body']['id']){delete _0x456947[_0x728f('0x50')]['id'];}return db['DeskAccount'][_0x728f('0x4c')]({'where':{'id':_0x456947[_0x728f('0x46')]['id']}})[_0x728f('0x28')](handleEntityNotFound(_0x4d36bc,null))['then'](function(_0x48ca0d){if(_0x48ca0d){_0x456947[_0x728f('0x50')][_0x728f('0x51')]=_0x48ca0d['id'];_0x456947[_0x728f('0x50')][_0x728f('0x52')]=integrations[_0x728f('0x53')](_0x456947[_0x728f('0x50')][_0x728f('0x54')],_0x456947[_0x728f('0x50')]['type']);_0x456947['body']['Descriptions']=integrations[_0x728f('0x55')](_0x456947[_0x728f('0x50')][_0x728f('0x54')],_0x456947[_0x728f('0x50')][_0x728f('0x3f')]);return db['DeskConfiguration']['create'](_0x456947['body'],{'include':[{'model':db[_0x728f('0x56')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x728f('0x57')}]});}return null;})[_0x728f('0x28')](respondWithResult(_0x4d36bc,null))[_0x728f('0x45')](handleError(_0x4d36bc,null));};exports[_0x728f('0x58')]=function(_0xbc2cd2,_0x5115a7,_0x5ecbac){var _0x2d4879=[{'name':_0x728f('0x59'),'label':_0x728f('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x41846d='';return db[_0x728f('0x2f')]['findOne']({'where':{'id':_0xbc2cd2['params']['id']},'attributes':['id',_0x728f('0x5a'),_0x728f('0x5b'),_0x728f('0x5c'),_0x728f('0x5d'),_0x728f('0x5e'),_0x728f('0x5f'),_0x728f('0x60'),_0x728f('0x61')]})[_0x728f('0x28')](handleEntityNotFound(_0x5115a7,null))[_0x728f('0x28')](function(_0x3e355d){if(_0x3e355d){_0x41846d=_0x3e355d[_0x728f('0x5a')];var _0x55bcc7=_0x41846d[_0x728f('0x62')](-0x1);if(_0x55bcc7==='/'){_0x41846d=_0x41846d[_0x728f('0x63')](0x0,_0x41846d[_0x728f('0x64')](_0x55bcc7));}var _0x56b459={'method':'GET','uri':util[_0x728f('0x65')]('%s/custom_fields',_0x41846d),'headers':{'Content-Type':_0x728f('0x66'),'Accept':_0x728f('0x66')},'json':!![]};if(_0x3e355d[_0x728f('0x5b')]===_0x728f('0x67')){_0x56b459['headers']['Authorization']=util[_0x728f('0x65')](_0x728f('0x68'),new Buffer(util[_0x728f('0x65')](_0x728f('0x69'),_0x3e355d[_0x728f('0x5c')],_0x3e355d[_0x728f('0x5d')]))['toString']('base64'));}return rp(_0x56b459)[_0x728f('0x28')](function(_0x4a8a1a){return _0x2d4879['concat'](_[_0x728f('0x2e')](_0x4a8a1a[_0x728f('0x6a')]['entries'],function(_0x1a11d9){return{'id':_0x1a11d9[_0x728f('0x2b')],'name':_0x1a11d9[_0x728f('0x2b')],'type':_0x1a11d9['type'],'active':_0x1a11d9['active'],'label':_0x1a11d9[_0x728f('0x6b')],'custom':!![]};}));});}})[_0x728f('0x28')](function(_0x10e7a4){return{'count':_0x10e7a4[_0x728f('0x38')],'rows':_0x10e7a4};})[_0x728f('0x28')](respondWithResult(_0x5115a7,null))['catch'](function(_0x59e4d6){var _0x15b146=_0xbc2cd2[_0x728f('0x33')][_0x728f('0x6c')]?0x1f4:_0x59e4d6['statusCode']||0x1f4;logger['error'](_0x728f('0x6d'),'getFields',_0x15b146,JSON[_0x728f('0x6e')](_0x59e4d6));delete _0x59e4d6[_0x728f('0x2b')];if(_0x15b146===0x191){_0x15b146=0x190;}_0x5115a7[_0x728f('0x1d')](_0x15b146)[_0x728f('0x2c')](_0xbc2cd2[_0x728f('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x59e4d6[_0x728f('0x6f')]}:_0x59e4d6);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 492f828..a0ff6d6 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 _0x523a=['int_desk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount'];(function(_0x56cf48,_0x30bd06){var _0x1faf4a=function(_0x434da6){while(--_0x434da6){_0x56cf48['push'](_0x56cf48['shift']());}};_0x1faf4a(++_0x30bd06);}(_0x523a,0x1a1));var _0xa523=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x523a[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0xa523('0x0'));var util=require(_0xa523('0x1'));var logger=require(_0xa523('0x2'))(_0xa523('0x3'));var moment=require(_0xa523('0x4'));var BPromise=require('bluebird');var rp=require(_0xa523('0x5'));var fs=require('fs');var path=require(_0xa523('0x6'));var rimraf=require(_0xa523('0x7'));var config=require('../../config/environment');var attributes=require(_0xa523('0x8'));var integrations=require(_0xa523('0x9'));module[_0xa523('0xa')]=function(_0x2a67d5,_0xa62106){return _0x2a67d5['define'](_0xa523('0xb'),attributes,{'tableName':_0xa523('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81b0=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','api','moment','request-promise','rimraf'];(function(_0x2ceeb1,_0xb9c933){var _0x433c69=function(_0x377c6b){while(--_0x377c6b){_0x2ceeb1['push'](_0x2ceeb1['shift']());}};_0x433c69(++_0xb9c933);}(_0x81b0,0xc1));var _0x081b=function(_0x3e39bf,_0x10904c){_0x3e39bf=_0x3e39bf-0x0;var _0x65a574=_0x81b0[_0x3e39bf];return _0x65a574;};'use strict';var _=require('lodash');var util=require(_0x081b('0x0'));var logger=require('../../config/logger')(_0x081b('0x1'));var moment=require(_0x081b('0x2'));var BPromise=require('bluebird');var rp=require(_0x081b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x081b('0x4'));var config=require(_0x081b('0x5'));var attributes=require(_0x081b('0x6'));var integrations=require(_0x081b('0x7'));module[_0x081b('0x8')]=function(_0x34f0e2,_0x305b42){return _0x34f0e2[_0x081b('0x9')]('DeskAccount',attributes,{'tableName':_0x081b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 28b341d..5c04530 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 _0x935c=['DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowDeskAccount','DeskAccount','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45c1cf,_0x36f5cc){var _0x54fe02=function(_0x57c09a){while(--_0x57c09a){_0x45c1cf['push'](_0x45c1cf['shift']());}};_0x54fe02(++_0x36f5cc);}(_0x935c,0x1c2));var _0xc935=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x935c[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc935('0x0'));var BPromise=require('bluebird');var rs=require(_0xc935('0x1'));var fs=require('fs');var Redis=require(_0xc935('0x2'));var db=require(_0xc935('0x3'))['db'];var utils=require(_0xc935('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc935('0x5'));var jayson=require(_0xc935('0x6'));var client=jayson[_0xc935('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5719d5,_0x10166d,_0x18bfcf){return new BPromise(function(_0x250173,_0x3c3722){return client['request'](_0x5719d5,_0x18bfcf)['then'](function(_0x7f16a9){logger[_0xc935('0x8')](_0xc935('0x9'),_0x10166d,_0xc935('0xa'));logger[_0xc935('0xb')](_0xc935('0xc'),_0x10166d,_0xc935('0xa'),JSON[_0xc935('0xd')](_0x7f16a9));if(_0x7f16a9['error']){if(_0x7f16a9[_0xc935('0xe')][_0xc935('0xf')]===0x1f4){logger[_0xc935('0xe')](_0xc935('0x9'),_0x10166d,_0x7f16a9['error'][_0xc935('0x10')]);return _0x3c3722(_0x7f16a9['error'][_0xc935('0x10')]);}logger[_0xc935('0xe')](_0xc935('0x9'),_0x10166d,_0x7f16a9[_0xc935('0xe')]['message']);return _0x250173(_0x7f16a9[_0xc935('0xe')][_0xc935('0x10')]);}else{logger[_0xc935('0x8')](_0xc935('0x9'),_0x10166d,_0xc935('0xa'));_0x250173(_0x7f16a9[_0xc935('0x11')]['message']);}})[_0xc935('0x12')](function(_0x2aeb71){logger[_0xc935('0xe')]('DeskAccount,\x20%s,\x20%s',_0x10166d,_0x2aeb71);_0x3c3722(_0x2aeb71);});});}exports[_0xc935('0x13')]=function(_0x98ee11){var _0x24b16d=this;return new Promise(function(_0xeec4e3,_0x571321){return db['DeskAccount'][_0xc935('0x14')]({'raw':_0x98ee11['options']?_0x98ee11[_0xc935('0x15')][_0xc935('0x16')]===undefined?!![]:![]:!![],'where':_0x98ee11[_0xc935('0x15')]?_0x98ee11['options'][_0xc935('0x17')]||null:null,'attributes':_0x98ee11[_0xc935('0x15')]?_0x98ee11[_0xc935('0x15')][_0xc935('0x18')]||null:null,'limit':_0x98ee11[_0xc935('0x15')]?_0x98ee11[_0xc935('0x15')][_0xc935('0x19')]||null:null,'include':_0x98ee11['options']?_0x98ee11['options'][_0xc935('0x1a')]?_['map'](_0x98ee11[_0xc935('0x15')][_0xc935('0x1a')],function(_0x1286bd){return{'model':db[_0x1286bd[_0xc935('0x1b')]],'as':_0x1286bd['as'],'attributes':_0x1286bd[_0xc935('0x18')],'include':_0x1286bd[_0xc935('0x1a')]?_[_0xc935('0x1c')](_0x1286bd[_0xc935('0x1a')],function(_0x4521b1){return{'model':db[_0x4521b1['model']],'as':_0x4521b1['as'],'attributes':_0x4521b1['attributes'],'include':_0x4521b1[_0xc935('0x1a')]?_[_0xc935('0x1c')](_0x4521b1[_0xc935('0x1a')],function(_0x460592){return{'model':db[_0x460592[_0xc935('0x1b')]],'as':_0x460592['as'],'attributes':_0x460592['attributes']};}):[]};}):[]};}):[]:[]})[_0xc935('0x1d')](function(_0x56f60e){logger[_0xc935('0x8')]('GetDeskAccount',_0x98ee11);logger['debug']('GetDeskAccount',_0x98ee11,JSON[_0xc935('0xd')](_0x56f60e));_0xeec4e3(_0x56f60e);})['catch'](function(_0xadf0ae){logger[_0xc935('0xe')]('GetDeskAccount',_0xadf0ae[_0xc935('0x10')],_0x98ee11);_0x571321(_0x24b16d[_0xc935('0xe')](0x1f4,_0xadf0ae[_0xc935('0x10')]));});});};exports[_0xc935('0x1e')]=function(_0x300239){var _0x26097a=this;return new Promise(function(_0x1e38fa,_0xfe2415){return db[_0xc935('0x1f')][_0xc935('0x20')]({'raw':_0x300239[_0xc935('0x15')]?_0x300239['options'][_0xc935('0x16')]===undefined?!![]:![]:!![],'where':_0x300239[_0xc935('0x15')]?_0x300239['options'][_0xc935('0x17')]||null:null,'attributes':_0x300239['options']?_0x300239['options'][_0xc935('0x18')]||null:null,'include':_0x300239[_0xc935('0x15')]?_0x300239[_0xc935('0x15')][_0xc935('0x1a')]?_[_0xc935('0x1c')](_0x300239[_0xc935('0x15')][_0xc935('0x1a')],function(_0x202450){return{'model':db[_0x202450[_0xc935('0x1b')]],'as':_0x202450['as'],'attributes':_0x202450['attributes'],'include':_0x202450[_0xc935('0x1a')]?_['map'](_0x202450['include'],function(_0x4c0bb5){return{'model':db[_0x4c0bb5['model']],'as':_0x4c0bb5['as'],'attributes':_0x4c0bb5['attributes'],'include':_0x4c0bb5['include']?_[_0xc935('0x1c')](_0x4c0bb5['include'],function(_0x25331d){return{'model':db[_0x25331d['model']],'as':_0x25331d['as'],'attributes':_0x25331d[_0xc935('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc935('0x1d')](function(_0x40bbe6){logger[_0xc935('0x8')](_0xc935('0x1e'),_0x300239);logger['debug'](_0xc935('0x1e'),_0x300239,JSON[_0xc935('0xd')](_0x40bbe6));_0x1e38fa(_0x40bbe6);})[_0xc935('0x12')](function(_0x785b30){logger['error'](_0xc935('0x1e'),_0x785b30[_0xc935('0x10')],_0x300239);_0xfe2415(_0x26097a[_0xc935('0xe')](0x1f4,_0x785b30[_0xc935('0x10')]));});});}; \ No newline at end of file +var _0x8c44=['catch','ShowDeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','map'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x8c44,0x1a2));var _0x48c4=function(_0x35498a,_0x4c5f60){_0x35498a=_0x35498a-0x0;var _0x419121=_0x8c44[_0x35498a];return _0x419121;};'use strict';var _=require(_0x48c4('0x0'));var util=require(_0x48c4('0x1'));var moment=require('moment');var BPromise=require(_0x48c4('0x2'));var rs=require(_0x48c4('0x3'));var fs=require('fs');var Redis=require(_0x48c4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x48c4('0x5'));var logger=require(_0x48c4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x48c4('0x7'));var client=jayson[_0x48c4('0x8')][_0x48c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59bb0b,_0x13b41d,_0x53f8d2){return new BPromise(function(_0x391bc1,_0x2761e4){return client[_0x48c4('0xa')](_0x59bb0b,_0x53f8d2)[_0x48c4('0xb')](function(_0x333250){logger[_0x48c4('0xc')](_0x48c4('0xd'),_0x13b41d,_0x48c4('0xe'));logger[_0x48c4('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x13b41d,_0x48c4('0xe'),JSON[_0x48c4('0x10')](_0x333250));if(_0x333250['error']){if(_0x333250['error'][_0x48c4('0x11')]===0x1f4){logger[_0x48c4('0x12')](_0x48c4('0xd'),_0x13b41d,_0x333250[_0x48c4('0x12')]['message']);return _0x2761e4(_0x333250[_0x48c4('0x12')][_0x48c4('0x13')]);}logger[_0x48c4('0x12')](_0x48c4('0xd'),_0x13b41d,_0x333250[_0x48c4('0x12')]['message']);return _0x391bc1(_0x333250[_0x48c4('0x12')][_0x48c4('0x13')]);}else{logger[_0x48c4('0xc')](_0x48c4('0xd'),_0x13b41d,_0x48c4('0xe'));_0x391bc1(_0x333250['result'][_0x48c4('0x13')]);}})['catch'](function(_0x38be3d){logger[_0x48c4('0x12')]('DeskAccount,\x20%s,\x20%s',_0x13b41d,_0x38be3d);_0x2761e4(_0x38be3d);});});}exports[_0x48c4('0x14')]=function(_0x197adf){var _0x3998de=this;return new Promise(function(_0x1deafb,_0x32dd6b){return db[_0x48c4('0x15')][_0x48c4('0x16')]({'raw':_0x197adf['options']?_0x197adf[_0x48c4('0x17')][_0x48c4('0x18')]===undefined?!![]:![]:!![],'where':_0x197adf['options']?_0x197adf[_0x48c4('0x17')][_0x48c4('0x19')]||null:null,'attributes':_0x197adf[_0x48c4('0x17')]?_0x197adf[_0x48c4('0x17')][_0x48c4('0x1a')]||null:null,'limit':_0x197adf[_0x48c4('0x17')]?_0x197adf[_0x48c4('0x17')]['limit']||null:null,'include':_0x197adf[_0x48c4('0x17')]?_0x197adf[_0x48c4('0x17')][_0x48c4('0x1b')]?_['map'](_0x197adf['options'][_0x48c4('0x1b')],function(_0x3c5c8d){return{'model':db[_0x3c5c8d[_0x48c4('0x1c')]],'as':_0x3c5c8d['as'],'attributes':_0x3c5c8d[_0x48c4('0x1a')],'include':_0x3c5c8d[_0x48c4('0x1b')]?_[_0x48c4('0x1d')](_0x3c5c8d['include'],function(_0x574f08){return{'model':db[_0x574f08['model']],'as':_0x574f08['as'],'attributes':_0x574f08[_0x48c4('0x1a')],'include':_0x574f08['include']?_[_0x48c4('0x1d')](_0x574f08['include'],function(_0xcbff00){return{'model':db[_0xcbff00['model']],'as':_0xcbff00['as'],'attributes':_0xcbff00['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5abe5c){logger['info']('GetDeskAccount',_0x197adf);logger['debug'](_0x48c4('0x14'),_0x197adf,JSON[_0x48c4('0x10')](_0x5abe5c));_0x1deafb(_0x5abe5c);})[_0x48c4('0x1e')](function(_0x2031cd){logger[_0x48c4('0x12')](_0x48c4('0x14'),_0x2031cd[_0x48c4('0x13')],_0x197adf);_0x32dd6b(_0x3998de['error'](0x1f4,_0x2031cd[_0x48c4('0x13')]));});});};exports[_0x48c4('0x1f')]=function(_0x590001){var _0x5c5880=this;return new Promise(function(_0x10ee84,_0x4b8fe5){return db['DeskAccount']['find']({'raw':_0x590001[_0x48c4('0x17')]?_0x590001[_0x48c4('0x17')][_0x48c4('0x18')]===undefined?!![]:![]:!![],'where':_0x590001[_0x48c4('0x17')]?_0x590001[_0x48c4('0x17')]['where']||null:null,'attributes':_0x590001[_0x48c4('0x17')]?_0x590001[_0x48c4('0x17')]['attributes']||null:null,'include':_0x590001[_0x48c4('0x17')]?_0x590001[_0x48c4('0x17')]['include']?_[_0x48c4('0x1d')](_0x590001['options'][_0x48c4('0x1b')],function(_0x21ddc6){return{'model':db[_0x21ddc6[_0x48c4('0x1c')]],'as':_0x21ddc6['as'],'attributes':_0x21ddc6[_0x48c4('0x1a')],'include':_0x21ddc6[_0x48c4('0x1b')]?_[_0x48c4('0x1d')](_0x21ddc6[_0x48c4('0x1b')],function(_0x242887){return{'model':db[_0x242887['model']],'as':_0x242887['as'],'attributes':_0x242887['attributes'],'include':_0x242887[_0x48c4('0x1b')]?_['map'](_0x242887[_0x48c4('0x1b')],function(_0x5a7a0a){return{'model':db[_0x5a7a0a[_0x48c4('0x1c')]],'as':_0x5a7a0a['as'],'attributes':_0x5a7a0a[_0x48c4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x48c4('0xb')](function(_0x4bc9a7){logger['info']('ShowDeskAccount',_0x590001);logger[_0x48c4('0xf')](_0x48c4('0x1f'),_0x590001,JSON[_0x48c4('0x10')](_0x4bc9a7));_0x10ee84(_0x4bc9a7);})[_0x48c4('0x1e')](function(_0x1a73b0){logger[_0x48c4('0x12')](_0x48c4('0x1f'),_0x1a73b0[_0x48c4('0x13')],_0x590001);_0x4b8fe5(_0x5c5880[_0x48c4('0x12')](0x1f4,_0x1a73b0[_0x48c4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index ac55b53..562d42d 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5c6c4d,_0x3b7035){var _0x5473cf=function(_0x307572){while(--_0x307572){_0x5c6c4d['push'](_0x5c6c4d['shift']());}};_0x5473cf(++_0x3b7035);}(_0x008c,0x188));var _0xc008=function(_0x13b442,_0x448c33){_0x13b442=_0x13b442-0x0;var _0x49d09c=_0x008c[_0x13b442];return _0x49d09c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x55ca,0x126));var _0xa55c=function(_0x38a045,_0x402d6b){_0x38a045=_0x38a045-0x0;var _0x45c34c=_0x55ca[_0x38a045];return _0x45c34c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 6aceec3..f5385bd 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 _0xc810=['STRING','sequelize','exports'];(function(_0x6adac5,_0x49bf44){var _0x112c7=function(_0x4021d9){while(--_0x4021d9){_0x6adac5['push'](_0x6adac5['shift']());}};_0x112c7(++_0x49bf44);}(_0xc810,0x85));var _0x0c81=function(_0x223ab4,_0x59ae34){_0x223ab4=_0x223ab4-0x0;var _0x38272c=_0xc810[_0x223ab4];return _0x38272c;};'use strict';var Sequelize=require(_0x0c81('0x0'));module[_0x0c81('0x1')]={'name':{'type':Sequelize[_0x0c81('0x2')]},'description':{'type':Sequelize[_0x0c81('0x2')]}}; \ No newline at end of file +var _0xc1fe=['sequelize','STRING'];(function(_0x2f0d9e,_0x1a4af7){var _0x3831ab=function(_0x183775){while(--_0x183775){_0x2f0d9e['push'](_0x2f0d9e['shift']());}};_0x3831ab(++_0x1a4af7);}(_0xc1fe,0xc6));var _0xec1f=function(_0x5d4993,_0x3c75e3){_0x5d4993=_0x5d4993-0x0;var _0x160e82=_0xc1fe[_0x5d4993];return _0x160e82;};'use strict';var Sequelize=require(_0xec1f('0x0'));module['exports']={'name':{'type':Sequelize[_0xec1f('0x1')]},'description':{'type':Sequelize[_0xec1f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 01951e7..0c56389 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 _0x3bb4=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','order','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset'];(function(_0x4e83d0,_0x41a96e){var _0x38fe96=function(_0x4b7c04){while(--_0x4b7c04){_0x4e83d0['push'](_0x4e83d0['shift']());}};_0x38fe96(++_0x41a96e);}(_0x3bb4,0x91));var _0x43bb=function(_0x1012f5,_0x20a3a7){_0x1012f5=_0x1012f5-0x0;var _0x283bd9=_0x3bb4[_0x1012f5];return _0x283bd9;};'use strict';var emlformat=require(_0x43bb('0x0'));var rimraf=require(_0x43bb('0x1'));var zipdir=require(_0x43bb('0x2'));var jsonpatch=require(_0x43bb('0x3'));var rp=require(_0x43bb('0x4'));var moment=require(_0x43bb('0x5'));var BPromise=require(_0x43bb('0x6'));var Mustache=require(_0x43bb('0x7'));var util=require(_0x43bb('0x8'));var path=require(_0x43bb('0x9'));var sox=require('sox');var csv=require(_0x43bb('0xa'));var ejs=require(_0x43bb('0xb'));var fs=require('fs');var fs_extra=require(_0x43bb('0xc'));var _=require(_0x43bb('0xd'));var squel=require('squel');var crypto=require(_0x43bb('0xe'));var jsforce=require(_0x43bb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x43bb('0xa'));var querystring=require(_0x43bb('0x10'));var Papa=require(_0x43bb('0x11'));var Redis=require('ioredis');var authService=require(_0x43bb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x43bb('0x13'));var hardwareService=require(_0x43bb('0x14'));var logger=require(_0x43bb('0x15'))(_0x43bb('0x16'));var utils=require(_0x43bb('0x17'));var config=require(_0x43bb('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x129873,_0x1fabce){_0x1fabce=_0x1fabce||0xcc;return function(_0x321f89){if(_0x321f89){return _0x129873['sendStatus'](_0x1fabce);}return _0x129873[_0x43bb('0x19')](_0x1fabce)[_0x43bb('0x1a')]();};}function respondWithResult(_0xfa6955,_0x4185b6){_0x4185b6=_0x4185b6||0xc8;return function(_0xf4c121){if(_0xf4c121){return _0xfa6955[_0x43bb('0x19')](_0x4185b6)[_0x43bb('0x1b')](_0xf4c121);}};}function respondWithFilteredResult(_0x54c6d0,_0x3d36ab){return function(_0x50f131){if(_0x50f131){var _0x350687=typeof _0x3d36ab[_0x43bb('0x1c')]===_0x43bb('0x1d')&&typeof _0x3d36ab[_0x43bb('0x1e')]===_0x43bb('0x1d');var _0x5325ff=_0x50f131[_0x43bb('0x1f')];var _0x36cd42=_0x350687?0x0:_0x3d36ab[_0x43bb('0x1c')];var _0xe309dc=_0x350687?_0x50f131[_0x43bb('0x1f')]:_0x3d36ab[_0x43bb('0x1c')]+_0x3d36ab[_0x43bb('0x1e')];var _0x127d19;if(_0xe309dc>=_0x5325ff){_0xe309dc=_0x5325ff;_0x127d19=0xc8;}else{_0x127d19=0xce;}_0x54c6d0[_0x43bb('0x19')](_0x127d19);return _0x54c6d0[_0x43bb('0x20')](_0x43bb('0x21'),_0x36cd42+'-'+_0xe309dc+'/'+_0x5325ff)[_0x43bb('0x1b')](_0x50f131);}return null;};}function patchUpdates(_0x2b69c4){return function(_0x49ce63){try{jsonpatch[_0x43bb('0x22')](_0x49ce63,_0x2b69c4,!![]);}catch(_0x27f9ed){return BPromise[_0x43bb('0x23')](_0x27f9ed);}return _0x49ce63[_0x43bb('0x24')]();};}function saveUpdates(_0x3b16bc,_0x65cce8){return function(_0x2003b7){if(_0x2003b7){return _0x2003b7[_0x43bb('0x25')](_0x3b16bc)[_0x43bb('0x26')](function(_0x418cf4){return _0x418cf4;});}return null;};}function removeEntity(_0x50082a,_0x45659a){return function(_0x372394){if(_0x372394){return _0x372394[_0x43bb('0x27')]()[_0x43bb('0x26')](function(){_0x50082a[_0x43bb('0x19')](0xcc)[_0x43bb('0x1a')]();});}};}function handleEntityNotFound(_0x506fe7,_0x42fb2c){return function(_0x7687c8){if(!_0x7687c8){_0x506fe7[_0x43bb('0x28')](0x194);}return _0x7687c8;};}function handleError(_0x51be26,_0x512cfe){_0x512cfe=_0x512cfe||0x1f4;return function(_0x382ecd){logger[_0x43bb('0x29')](_0x382ecd[_0x43bb('0x2a')]);if(_0x382ecd[_0x43bb('0x2b')]){delete _0x382ecd[_0x43bb('0x2b')];}_0x51be26[_0x43bb('0x19')](_0x512cfe)[_0x43bb('0x2c')](_0x382ecd);};}exports[_0x43bb('0x2d')]=function(_0x56b249,_0x383a8d){var _0x4aa730={},_0x37cf7e={},_0x4edbd4={'count':0x0,'rows':[]};var _0x83c647=_[_0x43bb('0x2e')](db['DeskConfiguration'][_0x43bb('0x2f')],function(_0x5ae0d9){return{'name':_0x5ae0d9[_0x43bb('0x30')],'type':_0x5ae0d9[_0x43bb('0x31')][_0x43bb('0x32')]};});_0x37cf7e['model']=_[_0x43bb('0x2e')](_0x83c647,'name');_0x37cf7e[_0x43bb('0x33')]=_[_0x43bb('0x34')](_0x56b249[_0x43bb('0x33')]);_0x37cf7e[_0x43bb('0x35')]=_['intersection'](_0x37cf7e['model'],_0x37cf7e[_0x43bb('0x33')]);_0x4aa730[_0x43bb('0x36')]=_[_0x43bb('0x37')](_0x37cf7e[_0x43bb('0x38')],qs[_0x43bb('0x39')](_0x56b249[_0x43bb('0x33')]['fields']));_0x4aa730[_0x43bb('0x36')]=_0x4aa730[_0x43bb('0x36')][_0x43bb('0x3a')]?_0x4aa730[_0x43bb('0x36')]:_0x37cf7e[_0x43bb('0x38')];if(!_0x56b249['query'][_0x43bb('0x3b')](_0x43bb('0x3c'))){_0x4aa730[_0x43bb('0x1e')]=qs['limit'](_0x56b249[_0x43bb('0x33')]['limit']);_0x4aa730[_0x43bb('0x1c')]=qs['offset'](_0x56b249[_0x43bb('0x33')]['offset']);}_0x4aa730['order']=qs[_0x43bb('0x3d')](_0x56b249['query'][_0x43bb('0x3d')]);_0x4aa730[_0x43bb('0x3e')]=qs[_0x43bb('0x35')](_[_0x43bb('0x3f')](_0x56b249['query'],_0x37cf7e[_0x43bb('0x35')]),_0x83c647);if(_0x56b249['query'][_0x43bb('0x40')]){_0x4aa730['where']=_[_0x43bb('0x41')](_0x4aa730[_0x43bb('0x3e')],{'$or':_[_0x43bb('0x2e')](_0x83c647,function(_0x143cc8){if(_0x143cc8[_0x43bb('0x31')]!=='VIRTUAL'){var _0x525f74={};_0x525f74[_0x143cc8['name']]={'$like':'%'+_0x56b249['query'][_0x43bb('0x40')]+'%'};return _0x525f74;}})});}_0x4aa730=_['merge']({},_0x4aa730,_0x56b249[_0x43bb('0x42')]);var _0x58672c={'where':_0x4aa730['where']};return db[_0x43bb('0x43')][_0x43bb('0x1f')](_0x58672c)[_0x43bb('0x26')](function(_0x235cfe){_0x4edbd4[_0x43bb('0x1f')]=_0x235cfe;if(_0x56b249[_0x43bb('0x33')][_0x43bb('0x44')]){_0x4aa730[_0x43bb('0x45')]=[{'all':!![]}];}return db[_0x43bb('0x43')][_0x43bb('0x46')](_0x4aa730);})[_0x43bb('0x26')](function(_0x53fb07){_0x4edbd4[_0x43bb('0x47')]=_0x53fb07;return _0x4edbd4;})[_0x43bb('0x26')](respondWithFilteredResult(_0x383a8d,_0x4aa730))[_0x43bb('0x48')](handleError(_0x383a8d,null));};exports[_0x43bb('0x49')]=function(_0x5efa0d,_0xa4925e){var _0x3b1245={'raw':![],'where':{'id':_0x5efa0d[_0x43bb('0x4a')]['id']}},_0x320b24={};_0x320b24[_0x43bb('0x38')]=_[_0x43bb('0x34')](db[_0x43bb('0x43')][_0x43bb('0x2f')]);_0x320b24[_0x43bb('0x33')]=_['keys'](_0x5efa0d[_0x43bb('0x33')]);_0x320b24[_0x43bb('0x35')]=_['intersection'](_0x320b24[_0x43bb('0x38')],_0x320b24[_0x43bb('0x33')]);_0x3b1245[_0x43bb('0x36')]=_[_0x43bb('0x37')](_0x320b24[_0x43bb('0x38')],qs[_0x43bb('0x39')](_0x5efa0d[_0x43bb('0x33')]['fields']));_0x3b1245[_0x43bb('0x36')]=_0x3b1245[_0x43bb('0x36')]['length']?_0x3b1245[_0x43bb('0x36')]:_0x320b24[_0x43bb('0x38')];if(_0x5efa0d[_0x43bb('0x33')][_0x43bb('0x44')]){_0x3b1245[_0x43bb('0x45')]=[{'all':!![]}];}_0x3b1245=_[_0x43bb('0x41')]({},_0x3b1245,_0x5efa0d[_0x43bb('0x42')]);return db[_0x43bb('0x43')][_0x43bb('0x4b')](_0x3b1245)[_0x43bb('0x26')](handleEntityNotFound(_0xa4925e,null))[_0x43bb('0x26')](respondWithResult(_0xa4925e,null))[_0x43bb('0x48')](handleError(_0xa4925e,null));};exports[_0x43bb('0x4c')]=function(_0x17a066,_0x57058a){return db[_0x43bb('0x43')][_0x43bb('0x4c')](_0x17a066[_0x43bb('0x4d')],{})[_0x43bb('0x26')](respondWithResult(_0x57058a,0xc9))[_0x43bb('0x48')](handleError(_0x57058a,null));};exports[_0x43bb('0x25')]=function(_0x36ab2f,_0x331c2e){if(_0x36ab2f['body']['id']){delete _0x36ab2f[_0x43bb('0x4d')]['id'];}return db['DeskConfiguration'][_0x43bb('0x4b')]({'where':{'id':_0x36ab2f[_0x43bb('0x4a')]['id']}})[_0x43bb('0x26')](handleEntityNotFound(_0x331c2e,null))[_0x43bb('0x26')](saveUpdates(_0x36ab2f[_0x43bb('0x4d')],null))[_0x43bb('0x26')](respondWithResult(_0x331c2e,null))['catch'](handleError(_0x331c2e,null));};exports['destroy']=function(_0x1fdacf,_0x1ed2e4){return db[_0x43bb('0x43')]['find']({'where':{'id':_0x1fdacf[_0x43bb('0x4a')]['id']}})[_0x43bb('0x26')](handleEntityNotFound(_0x1ed2e4,null))[_0x43bb('0x26')](removeEntity(_0x1ed2e4,null))[_0x43bb('0x48')](handleError(_0x1ed2e4,null));};exports[_0x43bb('0x4e')]=function(_0x430cf5,_0x4e3440,_0x29d120){var _0x12ab98={};var _0x5b89a4={};var _0x5f2331;var _0x92559b;return db['DeskConfiguration'][_0x43bb('0x4f')]({'where':{'id':_0x430cf5[_0x43bb('0x4a')]['id']}})[_0x43bb('0x26')](handleEntityNotFound(_0x4e3440,null))[_0x43bb('0x26')](function(_0x17a437){if(_0x17a437){_0x5f2331=_0x17a437;_0x5b89a4[_0x43bb('0x38')]=_[_0x43bb('0x34')](db['DeskField']['rawAttributes']);_0x5b89a4[_0x43bb('0x33')]=_[_0x43bb('0x34')](_0x430cf5[_0x43bb('0x33')]);_0x5b89a4[_0x43bb('0x35')]=_['intersection'](_0x5b89a4['model'],_0x5b89a4[_0x43bb('0x33')]);_0x12ab98['attributes']=_[_0x43bb('0x37')](_0x5b89a4[_0x43bb('0x38')],qs['fields'](_0x430cf5['query']['fields']));_0x12ab98[_0x43bb('0x36')]=_0x12ab98[_0x43bb('0x36')][_0x43bb('0x3a')]?_0x12ab98[_0x43bb('0x36')]:_0x5b89a4['model'];_0x12ab98[_0x43bb('0x50')]=qs[_0x43bb('0x3d')](_0x430cf5[_0x43bb('0x33')][_0x43bb('0x3d')]);_0x12ab98[_0x43bb('0x3e')]=qs[_0x43bb('0x35')](_[_0x43bb('0x3f')](_0x430cf5[_0x43bb('0x33')],_0x5b89a4[_0x43bb('0x35')]));if(_0x430cf5[_0x43bb('0x33')][_0x43bb('0x40')]){_0x12ab98['where']=_[_0x43bb('0x41')](_0x12ab98[_0x43bb('0x3e')],{'$or':_[_0x43bb('0x2e')](_0x12ab98['attributes'],function(_0x115964){var _0x45c859={};_0x45c859[_0x115964]={'$like':'%'+_0x430cf5[_0x43bb('0x33')][_0x43bb('0x40')]+'%'};return _0x45c859;})});}_0x12ab98=_['merge']({},_0x12ab98,_0x430cf5[_0x43bb('0x42')]);return _0x5f2331[_0x43bb('0x4e')](_0x12ab98);}})[_0x43bb('0x26')](function(_0x5c0f6e){if(_0x5c0f6e){_0x92559b=_0x5c0f6e[_0x43bb('0x3a')];if(!_0x430cf5[_0x43bb('0x33')][_0x43bb('0x3b')](_0x43bb('0x3c'))){_0x12ab98[_0x43bb('0x1e')]=qs['limit'](_0x430cf5[_0x43bb('0x33')]['limit']);_0x12ab98[_0x43bb('0x1c')]=qs[_0x43bb('0x1c')](_0x430cf5['query'][_0x43bb('0x1c')]);}return _0x5f2331[_0x43bb('0x4e')](_0x12ab98);}})[_0x43bb('0x26')](function(_0x2a0b46){if(_0x2a0b46){return _0x2a0b46?{'count':_0x92559b,'rows':_0x2a0b46}:null;}})[_0x43bb('0x26')](respondWithResult(_0x4e3440,null))['catch'](handleError(_0x4e3440,null));};exports[_0x43bb('0x51')]=function(_0x3827be,_0xf3d3,_0x386939){var _0x473a76={};var _0x468c33={};var _0x3c57d8;var _0x584661;return db['DeskConfiguration'][_0x43bb('0x4f')]({'where':{'id':_0x3827be[_0x43bb('0x4a')]['id']}})[_0x43bb('0x26')](handleEntityNotFound(_0xf3d3,null))[_0x43bb('0x26')](function(_0x21da8d){if(_0x21da8d){_0x3c57d8=_0x21da8d;_0x468c33['model']=_[_0x43bb('0x34')](db[_0x43bb('0x52')]['rawAttributes']);_0x468c33[_0x43bb('0x33')]=_[_0x43bb('0x34')](_0x3827be['query']);_0x468c33[_0x43bb('0x35')]=_[_0x43bb('0x37')](_0x468c33['model'],_0x468c33[_0x43bb('0x33')]);_0x473a76[_0x43bb('0x36')]=_[_0x43bb('0x37')](_0x468c33[_0x43bb('0x38')],qs[_0x43bb('0x39')](_0x3827be[_0x43bb('0x33')][_0x43bb('0x39')]));_0x473a76[_0x43bb('0x36')]=_0x473a76[_0x43bb('0x36')][_0x43bb('0x3a')]?_0x473a76[_0x43bb('0x36')]:_0x468c33[_0x43bb('0x38')];_0x473a76[_0x43bb('0x50')]=qs[_0x43bb('0x3d')](_0x3827be[_0x43bb('0x33')][_0x43bb('0x3d')]);_0x473a76[_0x43bb('0x3e')]=qs[_0x43bb('0x35')](_[_0x43bb('0x3f')](_0x3827be[_0x43bb('0x33')],_0x468c33[_0x43bb('0x35')]));if(_0x3827be['query'][_0x43bb('0x40')]){_0x473a76[_0x43bb('0x3e')]=_[_0x43bb('0x41')](_0x473a76[_0x43bb('0x3e')],{'$or':_[_0x43bb('0x2e')](_0x473a76['attributes'],function(_0x24e1f5){var _0xc46a7c={};_0xc46a7c[_0x24e1f5]={'$like':'%'+_0x3827be[_0x43bb('0x33')][_0x43bb('0x40')]+'%'};return _0xc46a7c;})});}_0x473a76=_[_0x43bb('0x41')]({},_0x473a76,_0x3827be[_0x43bb('0x42')]);return _0x3c57d8[_0x43bb('0x51')](_0x473a76);}})[_0x43bb('0x26')](function(_0x441f23){if(_0x441f23){_0x584661=_0x441f23[_0x43bb('0x3a')];if(!_0x3827be['query'][_0x43bb('0x3b')](_0x43bb('0x3c'))){_0x473a76['limit']=qs[_0x43bb('0x1e')](_0x3827be[_0x43bb('0x33')][_0x43bb('0x1e')]);_0x473a76['offset']=qs[_0x43bb('0x1c')](_0x3827be[_0x43bb('0x33')][_0x43bb('0x1c')]);}return _0x3c57d8[_0x43bb('0x51')](_0x473a76);}})[_0x43bb('0x26')](function(_0x131baa){if(_0x131baa){return _0x131baa?{'count':_0x584661,'rows':_0x131baa}:null;}})[_0x43bb('0x26')](respondWithResult(_0xf3d3,null))[_0x43bb('0x48')](handleError(_0xf3d3,null));};exports[_0x43bb('0x53')]=function(_0x12417a,_0x5d5507,_0x2c74a6){var _0x515bd3={};var _0x4b0dba={};var _0xba57bd;var _0x28cace;return db['DeskConfiguration'][_0x43bb('0x4f')]({'where':{'id':_0x12417a[_0x43bb('0x4a')]['id']}})[_0x43bb('0x26')](handleEntityNotFound(_0x5d5507,null))[_0x43bb('0x26')](function(_0x3e511f){if(_0x3e511f){_0xba57bd=_0x3e511f;_0x4b0dba[_0x43bb('0x38')]=_['keys'](db[_0x43bb('0x52')][_0x43bb('0x2f')]);_0x4b0dba[_0x43bb('0x33')]=_[_0x43bb('0x34')](_0x12417a[_0x43bb('0x33')]);_0x4b0dba[_0x43bb('0x35')]=_[_0x43bb('0x37')](_0x4b0dba[_0x43bb('0x38')],_0x4b0dba['query']);_0x515bd3['attributes']=_[_0x43bb('0x37')](_0x4b0dba[_0x43bb('0x38')],qs['fields'](_0x12417a[_0x43bb('0x33')][_0x43bb('0x39')]));_0x515bd3[_0x43bb('0x36')]=_0x515bd3[_0x43bb('0x36')]['length']?_0x515bd3[_0x43bb('0x36')]:_0x4b0dba[_0x43bb('0x38')];_0x515bd3[_0x43bb('0x50')]=qs['sort'](_0x12417a[_0x43bb('0x33')][_0x43bb('0x3d')]);_0x515bd3[_0x43bb('0x3e')]=qs[_0x43bb('0x35')](_[_0x43bb('0x3f')](_0x12417a['query'],_0x4b0dba['filters']));if(_0x12417a[_0x43bb('0x33')][_0x43bb('0x40')]){_0x515bd3[_0x43bb('0x3e')]=_[_0x43bb('0x41')](_0x515bd3['where'],{'$or':_[_0x43bb('0x2e')](_0x515bd3[_0x43bb('0x36')],function(_0x3b3c37){var _0x37eefe={};_0x37eefe[_0x3b3c37]={'$like':'%'+_0x12417a[_0x43bb('0x33')][_0x43bb('0x40')]+'%'};return _0x37eefe;})});}_0x515bd3=_[_0x43bb('0x41')]({},_0x515bd3,_0x12417a[_0x43bb('0x42')]);return _0xba57bd['getDescriptions'](_0x515bd3);}})['then'](function(_0x32c5ee){if(_0x32c5ee){_0x28cace=_0x32c5ee[_0x43bb('0x3a')];if(!_0x12417a[_0x43bb('0x33')]['hasOwnProperty'](_0x43bb('0x3c'))){_0x515bd3[_0x43bb('0x1e')]=qs[_0x43bb('0x1e')](_0x12417a[_0x43bb('0x33')][_0x43bb('0x1e')]);_0x515bd3[_0x43bb('0x1c')]=qs[_0x43bb('0x1c')](_0x12417a['query'][_0x43bb('0x1c')]);}return _0xba57bd['getDescriptions'](_0x515bd3);}})['then'](function(_0x1f812){if(_0x1f812){return _0x1f812?{'count':_0x28cace,'rows':_0x1f812}:null;}})[_0x43bb('0x26')](respondWithResult(_0x5d5507,null))['catch'](handleError(_0x5d5507,null));};exports['getTags']=function(_0x3daabd,_0x2f26b3,_0x5f2e1b){var _0x32f00c={};var _0xabd0e0={};var _0x18ae01;var _0x3a34ee;return db[_0x43bb('0x43')][_0x43bb('0x4f')]({'where':{'id':_0x3daabd[_0x43bb('0x4a')]['id']}})[_0x43bb('0x26')](handleEntityNotFound(_0x2f26b3,null))[_0x43bb('0x26')](function(_0x727520){if(_0x727520){_0x18ae01=_0x727520;_0xabd0e0[_0x43bb('0x38')]=_[_0x43bb('0x34')](db['Tag'][_0x43bb('0x2f')]);_0xabd0e0['query']=_[_0x43bb('0x34')](_0x3daabd['query']);_0xabd0e0[_0x43bb('0x35')]=_['intersection'](_0xabd0e0[_0x43bb('0x38')],_0xabd0e0[_0x43bb('0x33')]);_0x32f00c[_0x43bb('0x36')]=_[_0x43bb('0x37')](_0xabd0e0[_0x43bb('0x38')],qs[_0x43bb('0x39')](_0x3daabd[_0x43bb('0x33')]['fields']));_0x32f00c[_0x43bb('0x36')]=_0x32f00c['attributes'][_0x43bb('0x3a')]?_0x32f00c['attributes']:_0xabd0e0[_0x43bb('0x38')];_0x32f00c[_0x43bb('0x50')]=qs['sort'](_0x3daabd[_0x43bb('0x33')]['sort']);_0x32f00c[_0x43bb('0x3e')]=qs[_0x43bb('0x35')](_['pick'](_0x3daabd[_0x43bb('0x33')],_0xabd0e0[_0x43bb('0x35')]));if(_0x3daabd[_0x43bb('0x33')][_0x43bb('0x40')]){_0x32f00c[_0x43bb('0x3e')]=_['merge'](_0x32f00c[_0x43bb('0x3e')],{'$or':_[_0x43bb('0x2e')](_0x32f00c['attributes'],function(_0x36bac6){var _0xc37ca={};_0xc37ca[_0x36bac6]={'$like':'%'+_0x3daabd['query'][_0x43bb('0x40')]+'%'};return _0xc37ca;})});}_0x32f00c=_[_0x43bb('0x41')]({},_0x32f00c,_0x3daabd[_0x43bb('0x42')]);return _0x18ae01[_0x43bb('0x54')](_0x32f00c);}})[_0x43bb('0x26')](function(_0x4d05db){if(_0x4d05db){_0x3a34ee=_0x4d05db['length'];if(!_0x3daabd['query'][_0x43bb('0x3b')](_0x43bb('0x3c'))){_0x32f00c[_0x43bb('0x1e')]=qs[_0x43bb('0x1e')](_0x3daabd[_0x43bb('0x33')][_0x43bb('0x1e')]);_0x32f00c['offset']=qs[_0x43bb('0x1c')](_0x3daabd[_0x43bb('0x33')][_0x43bb('0x1c')]);}return _0x18ae01[_0x43bb('0x54')](_0x32f00c);}})[_0x43bb('0x26')](function(_0x1530e3){if(_0x1530e3){return _0x1530e3?{'count':_0x3a34ee,'rows':_0x1530e3}:null;}})[_0x43bb('0x26')](respondWithResult(_0x2f26b3,null))[_0x43bb('0x48')](handleError(_0x2f26b3,null));};exports[_0x43bb('0x55')]=function(_0x410310,_0x2049ca,_0x36def1){if(_0x410310[_0x43bb('0x4d')]['id']){delete _0x410310[_0x43bb('0x4d')]['id'];}return db[_0x43bb('0x43')][_0x43bb('0x4f')]({'where':{'id':_0x410310[_0x43bb('0x4a')]['id']}})[_0x43bb('0x26')](handleEntityNotFound(_0x2049ca,null))['then'](function(_0x2eb3c7){if(_0x2eb3c7){return _0x2eb3c7[_0x43bb('0x55')](_0x410310['body'][_0x43bb('0x56')]||[]);}return null;})[_0x43bb('0x26')](respondWithResult(_0x2049ca,null))[_0x43bb('0x48')](handleError(_0x2049ca,null));}; \ No newline at end of file +var _0x6a98=['crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','findOne','order','filter','hasOwnProperty','getFields','getSubjects','DeskField','getDescriptions','getTags','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2168de,_0x4767f7){var _0x1748c3=function(_0x2749c5){while(--_0x2749c5){_0x2168de['push'](_0x2168de['shift']());}};_0x1748c3(++_0x4767f7);}(_0x6a98,0xeb));var _0x86a9=function(_0x537bcd,_0x13bae1){_0x537bcd=_0x537bcd-0x0;var _0x6cc881=_0x6a98[_0x537bcd];return _0x6cc881;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86a9('0x0'));var zipdir=require(_0x86a9('0x1'));var jsonpatch=require(_0x86a9('0x2'));var rp=require(_0x86a9('0x3'));var moment=require(_0x86a9('0x4'));var BPromise=require(_0x86a9('0x5'));var Mustache=require(_0x86a9('0x6'));var util=require(_0x86a9('0x7'));var path=require('path');var sox=require(_0x86a9('0x8'));var csv=require(_0x86a9('0x9'));var ejs=require(_0x86a9('0xa'));var fs=require('fs');var fs_extra=require(_0x86a9('0xb'));var _=require(_0x86a9('0xc'));var squel=require(_0x86a9('0xd'));var crypto=require(_0x86a9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x86a9('0x9'));var querystring=require('querystring');var Papa=require(_0x86a9('0xf'));var Redis=require('ioredis');var authService=require(_0x86a9('0x10'));var qs=require(_0x86a9('0x11'));var as=require(_0x86a9('0x12'));var hardwareService=require(_0x86a9('0x13'));var logger=require(_0x86a9('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x86a9('0x15'));var licenseUtil=require(_0x86a9('0x16'));var db=require(_0x86a9('0x17'))['db'];function respondWithStatusCode(_0x4294ae,_0x58e597){_0x58e597=_0x58e597||0xcc;return function(_0x281b2c){if(_0x281b2c){return _0x4294ae[_0x86a9('0x18')](_0x58e597);}return _0x4294ae[_0x86a9('0x19')](_0x58e597)['end']();};}function respondWithResult(_0x57b8d6,_0x50412b){_0x50412b=_0x50412b||0xc8;return function(_0x2555d3){if(_0x2555d3){return _0x57b8d6[_0x86a9('0x19')](_0x50412b)['json'](_0x2555d3);}};}function respondWithFilteredResult(_0x400c8c,_0x2d21d2){return function(_0x1a781f){if(_0x1a781f){var _0x2cb29c=typeof _0x2d21d2[_0x86a9('0x1a')]===_0x86a9('0x1b')&&typeof _0x2d21d2[_0x86a9('0x1c')]===_0x86a9('0x1b');var _0x1e6724=_0x1a781f[_0x86a9('0x1d')];var _0x19ac27=_0x2cb29c?0x0:_0x2d21d2[_0x86a9('0x1a')];var _0x5c70d8=_0x2cb29c?_0x1a781f[_0x86a9('0x1d')]:_0x2d21d2['offset']+_0x2d21d2['limit'];var _0x560afb;if(_0x5c70d8>=_0x1e6724){_0x5c70d8=_0x1e6724;_0x560afb=0xc8;}else{_0x560afb=0xce;}_0x400c8c[_0x86a9('0x19')](_0x560afb);return _0x400c8c['set'](_0x86a9('0x1e'),_0x19ac27+'-'+_0x5c70d8+'/'+_0x1e6724)[_0x86a9('0x1f')](_0x1a781f);}return null;};}function patchUpdates(_0x413cb3){return function(_0x1c7ac3){try{jsonpatch[_0x86a9('0x20')](_0x1c7ac3,_0x413cb3,!![]);}catch(_0x5220be){return BPromise[_0x86a9('0x21')](_0x5220be);}return _0x1c7ac3[_0x86a9('0x22')]();};}function saveUpdates(_0xbe7330,_0x2af54d){return function(_0x688dc9){if(_0x688dc9){return _0x688dc9[_0x86a9('0x23')](_0xbe7330)[_0x86a9('0x24')](function(_0x27ccab){return _0x27ccab;});}return null;};}function removeEntity(_0x1b27f4,_0x44f798){return function(_0x348c1e){if(_0x348c1e){return _0x348c1e['destroy']()[_0x86a9('0x24')](function(){_0x1b27f4[_0x86a9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x64a2cd,_0x3ae46e){return function(_0x6051b4){if(!_0x6051b4){_0x64a2cd[_0x86a9('0x18')](0x194);}return _0x6051b4;};}function handleError(_0x1e5b69,_0x33bb80){_0x33bb80=_0x33bb80||0x1f4;return function(_0xd3253){logger[_0x86a9('0x25')](_0xd3253[_0x86a9('0x26')]);if(_0xd3253[_0x86a9('0x27')]){delete _0xd3253['name'];}_0x1e5b69[_0x86a9('0x19')](_0x33bb80)[_0x86a9('0x28')](_0xd3253);};}exports['index']=function(_0x55b9f5,_0x351cc5){var _0x439ce9={},_0x3693ee={},_0x2ca5dd={'count':0x0,'rows':[]};var _0x57df1a=_[_0x86a9('0x29')](db['DeskConfiguration'][_0x86a9('0x2a')],function(_0x5333b0){return{'name':_0x5333b0[_0x86a9('0x2b')],'type':_0x5333b0[_0x86a9('0x2c')][_0x86a9('0x2d')]};});_0x3693ee[_0x86a9('0x2e')]=_[_0x86a9('0x29')](_0x57df1a,_0x86a9('0x27'));_0x3693ee[_0x86a9('0x2f')]=_[_0x86a9('0x30')](_0x55b9f5[_0x86a9('0x2f')]);_0x3693ee[_0x86a9('0x31')]=_[_0x86a9('0x32')](_0x3693ee[_0x86a9('0x2e')],_0x3693ee[_0x86a9('0x2f')]);_0x439ce9[_0x86a9('0x33')]=_[_0x86a9('0x32')](_0x3693ee[_0x86a9('0x2e')],qs['fields'](_0x55b9f5['query'][_0x86a9('0x34')]));_0x439ce9[_0x86a9('0x33')]=_0x439ce9['attributes'][_0x86a9('0x35')]?_0x439ce9[_0x86a9('0x33')]:_0x3693ee['model'];if(!_0x55b9f5[_0x86a9('0x2f')]['hasOwnProperty'](_0x86a9('0x36'))){_0x439ce9[_0x86a9('0x1c')]=qs['limit'](_0x55b9f5[_0x86a9('0x2f')]['limit']);_0x439ce9[_0x86a9('0x1a')]=qs[_0x86a9('0x1a')](_0x55b9f5['query'][_0x86a9('0x1a')]);}_0x439ce9['order']=qs[_0x86a9('0x37')](_0x55b9f5[_0x86a9('0x2f')][_0x86a9('0x37')]);_0x439ce9[_0x86a9('0x38')]=qs[_0x86a9('0x31')](_[_0x86a9('0x39')](_0x55b9f5[_0x86a9('0x2f')],_0x3693ee[_0x86a9('0x31')]),_0x57df1a);if(_0x55b9f5[_0x86a9('0x2f')]['filter']){_0x439ce9[_0x86a9('0x38')]=_[_0x86a9('0x3a')](_0x439ce9[_0x86a9('0x38')],{'$or':_[_0x86a9('0x29')](_0x57df1a,function(_0x5232f5){if(_0x5232f5['type']!==_0x86a9('0x3b')){var _0x3d1757={};_0x3d1757[_0x5232f5[_0x86a9('0x27')]]={'$like':'%'+_0x55b9f5[_0x86a9('0x2f')]['filter']+'%'};return _0x3d1757;}})});}_0x439ce9=_[_0x86a9('0x3a')]({},_0x439ce9,_0x55b9f5[_0x86a9('0x3c')]);var _0x500991={'where':_0x439ce9['where']};return db[_0x86a9('0x3d')][_0x86a9('0x1d')](_0x500991)[_0x86a9('0x24')](function(_0x70b005){_0x2ca5dd[_0x86a9('0x1d')]=_0x70b005;if(_0x55b9f5[_0x86a9('0x2f')][_0x86a9('0x3e')]){_0x439ce9[_0x86a9('0x3f')]=[{'all':!![]}];}return db[_0x86a9('0x3d')][_0x86a9('0x40')](_0x439ce9);})[_0x86a9('0x24')](function(_0x3c6102){_0x2ca5dd[_0x86a9('0x41')]=_0x3c6102;return _0x2ca5dd;})[_0x86a9('0x24')](respondWithFilteredResult(_0x351cc5,_0x439ce9))[_0x86a9('0x42')](handleError(_0x351cc5,null));};exports[_0x86a9('0x43')]=function(_0x14cbfb,_0x124da3){var _0x550e2e={'raw':![],'where':{'id':_0x14cbfb[_0x86a9('0x44')]['id']}},_0x40c2e5={};_0x40c2e5[_0x86a9('0x2e')]=_[_0x86a9('0x30')](db['DeskConfiguration']['rawAttributes']);_0x40c2e5[_0x86a9('0x2f')]=_[_0x86a9('0x30')](_0x14cbfb[_0x86a9('0x2f')]);_0x40c2e5[_0x86a9('0x31')]=_['intersection'](_0x40c2e5[_0x86a9('0x2e')],_0x40c2e5[_0x86a9('0x2f')]);_0x550e2e[_0x86a9('0x33')]=_['intersection'](_0x40c2e5[_0x86a9('0x2e')],qs['fields'](_0x14cbfb[_0x86a9('0x2f')]['fields']));_0x550e2e[_0x86a9('0x33')]=_0x550e2e[_0x86a9('0x33')][_0x86a9('0x35')]?_0x550e2e[_0x86a9('0x33')]:_0x40c2e5[_0x86a9('0x2e')];if(_0x14cbfb[_0x86a9('0x2f')][_0x86a9('0x3e')]){_0x550e2e['include']=[{'all':!![]}];}_0x550e2e=_[_0x86a9('0x3a')]({},_0x550e2e,_0x14cbfb[_0x86a9('0x3c')]);return db[_0x86a9('0x3d')][_0x86a9('0x45')](_0x550e2e)[_0x86a9('0x24')](handleEntityNotFound(_0x124da3,null))[_0x86a9('0x24')](respondWithResult(_0x124da3,null))[_0x86a9('0x42')](handleError(_0x124da3,null));};exports['create']=function(_0x249c57,_0x468e0f){return db[_0x86a9('0x3d')][_0x86a9('0x46')](_0x249c57['body'],{})['then'](respondWithResult(_0x468e0f,0xc9))[_0x86a9('0x42')](handleError(_0x468e0f,null));};exports[_0x86a9('0x23')]=function(_0x4573a2,_0x3c44d5){if(_0x4573a2[_0x86a9('0x47')]['id']){delete _0x4573a2[_0x86a9('0x47')]['id'];}return db[_0x86a9('0x3d')]['find']({'where':{'id':_0x4573a2[_0x86a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c44d5,null))['then'](saveUpdates(_0x4573a2[_0x86a9('0x47')],null))[_0x86a9('0x24')](respondWithResult(_0x3c44d5,null))[_0x86a9('0x42')](handleError(_0x3c44d5,null));};exports[_0x86a9('0x48')]=function(_0x4b10e,_0x3a0caf){return db[_0x86a9('0x3d')][_0x86a9('0x45')]({'where':{'id':_0x4b10e[_0x86a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a0caf,null))[_0x86a9('0x24')](removeEntity(_0x3a0caf,null))[_0x86a9('0x42')](handleError(_0x3a0caf,null));};exports['getFields']=function(_0x36ae4a,_0x24d603,_0x396eb6){var _0x4f7a01={};var _0x57111b={};var _0x386711;var _0x3159af;return db['DeskConfiguration'][_0x86a9('0x49')]({'where':{'id':_0x36ae4a[_0x86a9('0x44')]['id']}})[_0x86a9('0x24')](handleEntityNotFound(_0x24d603,null))[_0x86a9('0x24')](function(_0xc9b18e){if(_0xc9b18e){_0x386711=_0xc9b18e;_0x57111b[_0x86a9('0x2e')]=_[_0x86a9('0x30')](db['DeskField'][_0x86a9('0x2a')]);_0x57111b[_0x86a9('0x2f')]=_[_0x86a9('0x30')](_0x36ae4a[_0x86a9('0x2f')]);_0x57111b['filters']=_[_0x86a9('0x32')](_0x57111b[_0x86a9('0x2e')],_0x57111b[_0x86a9('0x2f')]);_0x4f7a01[_0x86a9('0x33')]=_[_0x86a9('0x32')](_0x57111b[_0x86a9('0x2e')],qs['fields'](_0x36ae4a[_0x86a9('0x2f')][_0x86a9('0x34')]));_0x4f7a01[_0x86a9('0x33')]=_0x4f7a01[_0x86a9('0x33')]['length']?_0x4f7a01[_0x86a9('0x33')]:_0x57111b['model'];_0x4f7a01[_0x86a9('0x4a')]=qs['sort'](_0x36ae4a[_0x86a9('0x2f')]['sort']);_0x4f7a01[_0x86a9('0x38')]=qs[_0x86a9('0x31')](_[_0x86a9('0x39')](_0x36ae4a[_0x86a9('0x2f')],_0x57111b[_0x86a9('0x31')]));if(_0x36ae4a[_0x86a9('0x2f')]['filter']){_0x4f7a01[_0x86a9('0x38')]=_[_0x86a9('0x3a')](_0x4f7a01[_0x86a9('0x38')],{'$or':_[_0x86a9('0x29')](_0x4f7a01[_0x86a9('0x33')],function(_0x122ba5){var _0x21aeec={};_0x21aeec[_0x122ba5]={'$like':'%'+_0x36ae4a[_0x86a9('0x2f')][_0x86a9('0x4b')]+'%'};return _0x21aeec;})});}_0x4f7a01=_[_0x86a9('0x3a')]({},_0x4f7a01,_0x36ae4a[_0x86a9('0x3c')]);return _0x386711['getFields'](_0x4f7a01);}})[_0x86a9('0x24')](function(_0xf1e11a){if(_0xf1e11a){_0x3159af=_0xf1e11a['length'];if(!_0x36ae4a[_0x86a9('0x2f')][_0x86a9('0x4c')](_0x86a9('0x36'))){_0x4f7a01['limit']=qs['limit'](_0x36ae4a[_0x86a9('0x2f')][_0x86a9('0x1c')]);_0x4f7a01[_0x86a9('0x1a')]=qs['offset'](_0x36ae4a[_0x86a9('0x2f')][_0x86a9('0x1a')]);}return _0x386711[_0x86a9('0x4d')](_0x4f7a01);}})[_0x86a9('0x24')](function(_0x3f43a2){if(_0x3f43a2){return _0x3f43a2?{'count':_0x3159af,'rows':_0x3f43a2}:null;}})[_0x86a9('0x24')](respondWithResult(_0x24d603,null))[_0x86a9('0x42')](handleError(_0x24d603,null));};exports[_0x86a9('0x4e')]=function(_0xed2d6e,_0x3d9156,_0xae16f1){var _0x4a624f={};var _0x448860={};var _0x27cc0a;var _0x1542a9;return db[_0x86a9('0x3d')][_0x86a9('0x49')]({'where':{'id':_0xed2d6e[_0x86a9('0x44')]['id']}})[_0x86a9('0x24')](handleEntityNotFound(_0x3d9156,null))[_0x86a9('0x24')](function(_0x6b58b0){if(_0x6b58b0){_0x27cc0a=_0x6b58b0;_0x448860[_0x86a9('0x2e')]=_[_0x86a9('0x30')](db[_0x86a9('0x4f')]['rawAttributes']);_0x448860[_0x86a9('0x2f')]=_[_0x86a9('0x30')](_0xed2d6e[_0x86a9('0x2f')]);_0x448860[_0x86a9('0x31')]=_[_0x86a9('0x32')](_0x448860[_0x86a9('0x2e')],_0x448860[_0x86a9('0x2f')]);_0x4a624f[_0x86a9('0x33')]=_[_0x86a9('0x32')](_0x448860[_0x86a9('0x2e')],qs[_0x86a9('0x34')](_0xed2d6e['query']['fields']));_0x4a624f[_0x86a9('0x33')]=_0x4a624f[_0x86a9('0x33')][_0x86a9('0x35')]?_0x4a624f[_0x86a9('0x33')]:_0x448860[_0x86a9('0x2e')];_0x4a624f['order']=qs[_0x86a9('0x37')](_0xed2d6e[_0x86a9('0x2f')][_0x86a9('0x37')]);_0x4a624f['where']=qs[_0x86a9('0x31')](_['pick'](_0xed2d6e[_0x86a9('0x2f')],_0x448860[_0x86a9('0x31')]));if(_0xed2d6e['query']['filter']){_0x4a624f[_0x86a9('0x38')]=_[_0x86a9('0x3a')](_0x4a624f['where'],{'$or':_[_0x86a9('0x29')](_0x4a624f[_0x86a9('0x33')],function(_0x54f87b){var _0x2b6e58={};_0x2b6e58[_0x54f87b]={'$like':'%'+_0xed2d6e[_0x86a9('0x2f')]['filter']+'%'};return _0x2b6e58;})});}_0x4a624f=_[_0x86a9('0x3a')]({},_0x4a624f,_0xed2d6e[_0x86a9('0x3c')]);return _0x27cc0a['getSubjects'](_0x4a624f);}})[_0x86a9('0x24')](function(_0x37defe){if(_0x37defe){_0x1542a9=_0x37defe['length'];if(!_0xed2d6e['query'][_0x86a9('0x4c')](_0x86a9('0x36'))){_0x4a624f['limit']=qs[_0x86a9('0x1c')](_0xed2d6e['query'][_0x86a9('0x1c')]);_0x4a624f[_0x86a9('0x1a')]=qs[_0x86a9('0x1a')](_0xed2d6e['query']['offset']);}return _0x27cc0a[_0x86a9('0x4e')](_0x4a624f);}})[_0x86a9('0x24')](function(_0x32066d){if(_0x32066d){return _0x32066d?{'count':_0x1542a9,'rows':_0x32066d}:null;}})[_0x86a9('0x24')](respondWithResult(_0x3d9156,null))[_0x86a9('0x42')](handleError(_0x3d9156,null));};exports[_0x86a9('0x50')]=function(_0x1857a5,_0x4b9f28,_0x271102){var _0x27b92d={};var _0x3a09f5={};var _0x55e8b9;var _0x4a5851;return db[_0x86a9('0x3d')][_0x86a9('0x49')]({'where':{'id':_0x1857a5[_0x86a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b9f28,null))['then'](function(_0x51aab2){if(_0x51aab2){_0x55e8b9=_0x51aab2;_0x3a09f5[_0x86a9('0x2e')]=_['keys'](db[_0x86a9('0x4f')][_0x86a9('0x2a')]);_0x3a09f5[_0x86a9('0x2f')]=_[_0x86a9('0x30')](_0x1857a5[_0x86a9('0x2f')]);_0x3a09f5['filters']=_[_0x86a9('0x32')](_0x3a09f5['model'],_0x3a09f5[_0x86a9('0x2f')]);_0x27b92d[_0x86a9('0x33')]=_['intersection'](_0x3a09f5[_0x86a9('0x2e')],qs['fields'](_0x1857a5[_0x86a9('0x2f')][_0x86a9('0x34')]));_0x27b92d[_0x86a9('0x33')]=_0x27b92d[_0x86a9('0x33')][_0x86a9('0x35')]?_0x27b92d[_0x86a9('0x33')]:_0x3a09f5[_0x86a9('0x2e')];_0x27b92d[_0x86a9('0x4a')]=qs[_0x86a9('0x37')](_0x1857a5[_0x86a9('0x2f')][_0x86a9('0x37')]);_0x27b92d[_0x86a9('0x38')]=qs['filters'](_[_0x86a9('0x39')](_0x1857a5['query'],_0x3a09f5[_0x86a9('0x31')]));if(_0x1857a5[_0x86a9('0x2f')][_0x86a9('0x4b')]){_0x27b92d[_0x86a9('0x38')]=_[_0x86a9('0x3a')](_0x27b92d[_0x86a9('0x38')],{'$or':_[_0x86a9('0x29')](_0x27b92d[_0x86a9('0x33')],function(_0x40ca49){var _0x9a60eb={};_0x9a60eb[_0x40ca49]={'$like':'%'+_0x1857a5[_0x86a9('0x2f')][_0x86a9('0x4b')]+'%'};return _0x9a60eb;})});}_0x27b92d=_['merge']({},_0x27b92d,_0x1857a5[_0x86a9('0x3c')]);return _0x55e8b9[_0x86a9('0x50')](_0x27b92d);}})['then'](function(_0x3294bc){if(_0x3294bc){_0x4a5851=_0x3294bc[_0x86a9('0x35')];if(!_0x1857a5['query'][_0x86a9('0x4c')]('nolimit')){_0x27b92d[_0x86a9('0x1c')]=qs[_0x86a9('0x1c')](_0x1857a5[_0x86a9('0x2f')][_0x86a9('0x1c')]);_0x27b92d[_0x86a9('0x1a')]=qs[_0x86a9('0x1a')](_0x1857a5[_0x86a9('0x2f')]['offset']);}return _0x55e8b9[_0x86a9('0x50')](_0x27b92d);}})['then'](function(_0x122329){if(_0x122329){return _0x122329?{'count':_0x4a5851,'rows':_0x122329}:null;}})[_0x86a9('0x24')](respondWithResult(_0x4b9f28,null))['catch'](handleError(_0x4b9f28,null));};exports['getTags']=function(_0xf9d7bd,_0x36e064,_0x10fca7){var _0x2c0a2b={};var _0x1b50b3={};var _0x501d2a;var _0x1f71f6;return db[_0x86a9('0x3d')][_0x86a9('0x49')]({'where':{'id':_0xf9d7bd['params']['id']}})[_0x86a9('0x24')](handleEntityNotFound(_0x36e064,null))['then'](function(_0x263ce1){if(_0x263ce1){_0x501d2a=_0x263ce1;_0x1b50b3[_0x86a9('0x2e')]=_[_0x86a9('0x30')](db['Tag']['rawAttributes']);_0x1b50b3['query']=_['keys'](_0xf9d7bd[_0x86a9('0x2f')]);_0x1b50b3[_0x86a9('0x31')]=_[_0x86a9('0x32')](_0x1b50b3[_0x86a9('0x2e')],_0x1b50b3[_0x86a9('0x2f')]);_0x2c0a2b[_0x86a9('0x33')]=_['intersection'](_0x1b50b3[_0x86a9('0x2e')],qs[_0x86a9('0x34')](_0xf9d7bd['query'][_0x86a9('0x34')]));_0x2c0a2b[_0x86a9('0x33')]=_0x2c0a2b['attributes'][_0x86a9('0x35')]?_0x2c0a2b[_0x86a9('0x33')]:_0x1b50b3[_0x86a9('0x2e')];_0x2c0a2b[_0x86a9('0x4a')]=qs[_0x86a9('0x37')](_0xf9d7bd[_0x86a9('0x2f')][_0x86a9('0x37')]);_0x2c0a2b['where']=qs[_0x86a9('0x31')](_['pick'](_0xf9d7bd[_0x86a9('0x2f')],_0x1b50b3['filters']));if(_0xf9d7bd['query']['filter']){_0x2c0a2b['where']=_[_0x86a9('0x3a')](_0x2c0a2b[_0x86a9('0x38')],{'$or':_[_0x86a9('0x29')](_0x2c0a2b[_0x86a9('0x33')],function(_0x37608a){var _0x25622f={};_0x25622f[_0x37608a]={'$like':'%'+_0xf9d7bd[_0x86a9('0x2f')]['filter']+'%'};return _0x25622f;})});}_0x2c0a2b=_[_0x86a9('0x3a')]({},_0x2c0a2b,_0xf9d7bd[_0x86a9('0x3c')]);return _0x501d2a[_0x86a9('0x51')](_0x2c0a2b);}})[_0x86a9('0x24')](function(_0x48e11f){if(_0x48e11f){_0x1f71f6=_0x48e11f['length'];if(!_0xf9d7bd[_0x86a9('0x2f')]['hasOwnProperty'](_0x86a9('0x36'))){_0x2c0a2b['limit']=qs[_0x86a9('0x1c')](_0xf9d7bd[_0x86a9('0x2f')][_0x86a9('0x1c')]);_0x2c0a2b['offset']=qs[_0x86a9('0x1a')](_0xf9d7bd[_0x86a9('0x2f')][_0x86a9('0x1a')]);}return _0x501d2a[_0x86a9('0x51')](_0x2c0a2b);}})['then'](function(_0x181648){if(_0x181648){return _0x181648?{'count':_0x1f71f6,'rows':_0x181648}:null;}})[_0x86a9('0x24')](respondWithResult(_0x36e064,null))['catch'](handleError(_0x36e064,null));};exports[_0x86a9('0x52')]=function(_0x52b4f1,_0x340e7a,_0x3700c6){if(_0x52b4f1[_0x86a9('0x47')]['id']){delete _0x52b4f1[_0x86a9('0x47')]['id'];}return db[_0x86a9('0x3d')][_0x86a9('0x49')]({'where':{'id':_0x52b4f1['params']['id']}})['then'](handleEntityNotFound(_0x340e7a,null))[_0x86a9('0x24')](function(_0x311a0c){if(_0x311a0c){return _0x311a0c[_0x86a9('0x52')](_0x52b4f1[_0x86a9('0x47')]['ids']||[]);}return null;})[_0x86a9('0x24')](respondWithResult(_0x340e7a,null))['catch'](handleError(_0x340e7a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5e55186..4847693 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 _0x4d1d=['./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x27a300,_0x56ed6e){var _0x4ea908=function(_0x478a25){while(--_0x478a25){_0x27a300['push'](_0x27a300['shift']());}};_0x4ea908(++_0x56ed6e);}(_0x4d1d,0xfd));var _0xd4d1=function(_0x32d650,_0x3bf613){_0x32d650=_0x32d650-0x0;var _0x399acb=_0x4d1d[_0x32d650];return _0x399acb;};'use strict';var _=require(_0xd4d1('0x0'));var util=require('util');var logger=require(_0xd4d1('0x1'))('api');var moment=require(_0xd4d1('0x2'));var BPromise=require(_0xd4d1('0x3'));var rp=require(_0xd4d1('0x4'));var fs=require('fs');var path=require(_0xd4d1('0x5'));var rimraf=require(_0xd4d1('0x6'));var config=require('../../config/environment');var attributes=require(_0xd4d1('0x7'));module['exports']=function(_0x5a9294,_0x5f4347){return _0x5a9294['define'](_0xd4d1('0x8'),attributes,{'tableName':_0xd4d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0aaf=['lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration'];(function(_0x188499,_0x47cb04){var _0x3ac910=function(_0x1b2f34){while(--_0x1b2f34){_0x188499['push'](_0x188499['shift']());}};_0x3ac910(++_0x47cb04);}(_0x0aaf,0x90));var _0xf0aa=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x0aaf[_0x1793de];return _0x4f0309;};'use strict';var _=require(_0xf0aa('0x0'));var util=require(_0xf0aa('0x1'));var logger=require(_0xf0aa('0x2'))(_0xf0aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0aa('0x5'));var config=require(_0xf0aa('0x6'));var attributes=require(_0xf0aa('0x7'));module['exports']=function(_0x16903c,_0x239c6a){return _0x16903c['define'](_0xf0aa('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 0977388..a349204 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 _0x6bdd=['http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2ae5f3,_0x4aab57){var _0x17751a=function(_0x816cc0){while(--_0x816cc0){_0x2ae5f3['push'](_0x2ae5f3['shift']());}};_0x17751a(++_0x4aab57);}(_0x6bdd,0xe9));var _0xd6bd=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x6bdd[_0x412342];return _0x3e62cb;};'use strict';var _=require('lodash');var util=require(_0xd6bd('0x0'));var moment=require(_0xd6bd('0x1'));var BPromise=require(_0xd6bd('0x2'));var rs=require(_0xd6bd('0x3'));var fs=require('fs');var Redis=require(_0xd6bd('0x4'));var db=require(_0xd6bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6bd('0x6'))('rpc');var config=require(_0xd6bd('0x7'));var jayson=require(_0xd6bd('0x8'));var client=jayson['client'][_0xd6bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bb565,_0x56899d,_0x5e3b1c){return new BPromise(function(_0x204e21,_0x3a4376){return client[_0xd6bd('0xa')](_0x2bb565,_0x5e3b1c)[_0xd6bd('0xb')](function(_0x13e0c3){logger['info'](_0xd6bd('0xc'),_0x56899d,_0xd6bd('0xd'));logger[_0xd6bd('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x56899d,'request\x20sent',JSON[_0xd6bd('0xf')](_0x13e0c3));if(_0x13e0c3[_0xd6bd('0x10')]){if(_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x11')]===0x1f4){logger[_0xd6bd('0x10')](_0xd6bd('0xc'),_0x56899d,_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x12')]);return _0x3a4376(_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x12')]);}logger[_0xd6bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x56899d,_0x13e0c3[_0xd6bd('0x10')][_0xd6bd('0x12')]);return _0x204e21(_0x13e0c3['error']['message']);}else{logger[_0xd6bd('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x56899d,_0xd6bd('0xd'));_0x204e21(_0x13e0c3[_0xd6bd('0x14')][_0xd6bd('0x12')]);}})[_0xd6bd('0x15')](function(_0x59dfe7){logger[_0xd6bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x56899d,_0x59dfe7);_0x3a4376(_0x59dfe7);});});} \ No newline at end of file +var _0xfef3=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfef3,0x118));var _0x3fef=function(_0x2d8723,_0x549860){_0x2d8723=_0x2d8723-0x0;var _0x307fb1=_0xfef3[_0x2d8723];return _0x307fb1;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var moment=require(_0x3fef('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fef('0x2'));var fs=require('fs');var Redis=require(_0x3fef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('rpc');var config=require(_0x3fef('0x6'));var jayson=require(_0x3fef('0x7'));var client=jayson['client'][_0x3fef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5b72,_0x800850,_0x33e00a){return new BPromise(function(_0x1fffc5,_0x41960c){return client[_0x3fef('0x9')](_0x5f5b72,_0x33e00a)[_0x3fef('0xa')](function(_0x31c30f){logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));logger[_0x3fef('0xe')](_0x3fef('0xf'),_0x800850,'request\x20sent',JSON[_0x3fef('0x10')](_0x31c30f));if(_0x31c30f[_0x3fef('0x11')]){if(_0x31c30f[_0x3fef('0x11')]['code']===0x1f4){logger[_0x3fef('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x41960c(_0x31c30f[_0x3fef('0x11')]['message']);}logger[_0x3fef('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x1fffc5(_0x31c30f['error'][_0x3fef('0x12')]);}else{logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));_0x1fffc5(_0x31c30f[_0x3fef('0x13')][_0x3fef('0x12')]);}})['catch'](function(_0x1cbdbb){logger[_0x3fef('0x11')](_0x3fef('0xc'),_0x800850,_0x1cbdbb);_0x41960c(_0x1cbdbb);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7683021..a6c90de 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 _0xa3b9=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','multer'];(function(_0xbc5e39,_0x30a4b4){var _0x417fd2=function(_0x5ba819){while(--_0x5ba819){_0xbc5e39['push'](_0xbc5e39['shift']());}};_0x417fd2(++_0x30a4b4);}(_0xa3b9,0x6b));var _0x9a3b=function(_0x46c8bc,_0x3ab4c7){_0x46c8bc=_0x46c8bc-0x0;var _0x3b3ceb=_0xa3b9[_0x46c8bc];return _0x3b3ceb;};'use strict';var multer=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var path=require(_0x9a3b('0x2'));var timeout=require(_0x9a3b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9a3b('0x4'));var auth=require(_0x9a3b('0x5'));var interaction=require(_0x9a3b('0x6'));var config=require(_0x9a3b('0x7'));var controller=require('./intDeskField.controller');router[_0x9a3b('0x8')]('/',auth['isAuthenticated'](),controller[_0x9a3b('0x9')]);router[_0x9a3b('0x8')](_0x9a3b('0xa'),auth[_0x9a3b('0xb')](),controller[_0x9a3b('0xc')]);router[_0x9a3b('0xd')]('/',auth[_0x9a3b('0xb')](),controller[_0x9a3b('0xe')]);router[_0x9a3b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9a3b('0x10')]);router['delete'](_0x9a3b('0xa'),auth['isAuthenticated'](),controller[_0x9a3b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6c9c=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6c9c,0x12a));var _0xc6c9=function(_0x48753d,_0x4e07aa){_0x48753d=_0x48753d-0x0;var _0x397c59=_0x6c9c[_0x48753d];return _0x397c59;};'use strict';var multer=require(_0xc6c9('0x0'));var util=require(_0xc6c9('0x1'));var path=require('path');var timeout=require(_0xc6c9('0x2'));var express=require(_0xc6c9('0x3'));var router=express[_0xc6c9('0x4')]();var fs_extra=require(_0xc6c9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6c9('0x6'));var config=require(_0xc6c9('0x7'));var controller=require(_0xc6c9('0x8'));router[_0xc6c9('0x9')]('/',auth[_0xc6c9('0xa')](),controller[_0xc6c9('0xb')]);router[_0xc6c9('0x9')](_0xc6c9('0xc'),auth[_0xc6c9('0xa')](),controller[_0xc6c9('0xd')]);router[_0xc6c9('0xe')]('/',auth[_0xc6c9('0xa')](),controller[_0xc6c9('0xf')]);router[_0xc6c9('0x10')](_0xc6c9('0xc'),auth[_0xc6c9('0xa')](),controller[_0xc6c9('0x11')]);router[_0xc6c9('0x12')]('/:id',auth[_0xc6c9('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index faad441..2d09dc5 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 _0xd963=['string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xd963,0x16f));var _0x3d96=function(_0x53d729,_0x1a2198){_0x53d729=_0x53d729-0x0;var _0x568f90=_0xd963[_0x53d729];return _0x568f90;};'use strict';var Sequelize=require(_0x3d96('0x0'));module[_0x3d96('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3d96('0x2'),_0x3d96('0x3'),'customVariable','keyValue',_0x3d96('0x4')),'defaultValue':_0x3d96('0x2')},'content':{'type':Sequelize[_0x3d96('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3d96('0x6')](_0x3d96('0x2'),_0x3d96('0x3'),_0x3d96('0x7'))},'keyContent':{'type':Sequelize[_0x3d96('0x5')]},'idField':{'type':Sequelize[_0x3d96('0x5')]},'nameField':{'type':Sequelize[_0x3d96('0x5')]},'customField':{'type':Sequelize[_0x3d96('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3d96('0x5')]}}; \ No newline at end of file +var _0xac5a=['keyValue','picklist','customVariable','STRING','sequelize','ENUM','string','variable'];(function(_0x58e6ee,_0x532c0e){var _0x266373=function(_0x2b7875){while(--_0x2b7875){_0x58e6ee['push'](_0x58e6ee['shift']());}};_0x266373(++_0x532c0e);}(_0xac5a,0x174));var _0xaac5=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xac5a[_0xa4928c];return _0x27cc29;};'use strict';var Sequelize=require(_0xaac5('0x0'));module['exports']={'type':{'type':Sequelize[_0xaac5('0x1')](_0xaac5('0x2'),_0xaac5('0x3'),'customVariable',_0xaac5('0x4'),_0xaac5('0x5')),'defaultValue':_0xaac5('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xaac5('0x1')]('string',_0xaac5('0x3'),_0xaac5('0x6'))},'keyContent':{'type':Sequelize[_0xaac5('0x7')]},'idField':{'type':Sequelize[_0xaac5('0x7')]},'nameField':{'type':Sequelize[_0xaac5('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaac5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 568d7b2..652edb3 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 _0x8cad=['key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','map','DeskField','rawAttributes','fieldName','type'];(function(_0x34d581,_0xb2a237){var _0x4ff86d=function(_0x24bebc){while(--_0x24bebc){_0x34d581['push'](_0x34d581['shift']());}};_0x4ff86d(++_0xb2a237);}(_0x8cad,0xfe));var _0xd8ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cad[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xd8ca('0x0'));var rimraf=require(_0xd8ca('0x1'));var zipdir=require(_0xd8ca('0x2'));var jsonpatch=require(_0xd8ca('0x3'));var rp=require(_0xd8ca('0x4'));var moment=require(_0xd8ca('0x5'));var BPromise=require(_0xd8ca('0x6'));var Mustache=require(_0xd8ca('0x7'));var util=require(_0xd8ca('0x8'));var path=require(_0xd8ca('0x9'));var sox=require(_0xd8ca('0xa'));var csv=require(_0xd8ca('0xb'));var ejs=require(_0xd8ca('0xc'));var fs=require('fs');var fs_extra=require(_0xd8ca('0xd'));var _=require('lodash');var squel=require(_0xd8ca('0xe'));var crypto=require(_0xd8ca('0xf'));var jsforce=require(_0xd8ca('0x10'));var deskjs=require(_0xd8ca('0x11'));var toCsv=require(_0xd8ca('0xb'));var querystring=require('querystring');var Papa=require(_0xd8ca('0x12'));var Redis=require('ioredis');var authService=require(_0xd8ca('0x13'));var qs=require(_0xd8ca('0x14'));var as=require(_0xd8ca('0x15'));var hardwareService=require(_0xd8ca('0x16'));var logger=require(_0xd8ca('0x17'))(_0xd8ca('0x18'));var utils=require('../../config/utils');var config=require(_0xd8ca('0x19'));var licenseUtil=require(_0xd8ca('0x1a'));var db=require(_0xd8ca('0x1b'))['db'];function respondWithStatusCode(_0x102b16,_0x326272){_0x326272=_0x326272||0xcc;return function(_0x2bb191){if(_0x2bb191){return _0x102b16[_0xd8ca('0x1c')](_0x326272);}return _0x102b16[_0xd8ca('0x1d')](_0x326272)[_0xd8ca('0x1e')]();};}function respondWithResult(_0x52726a,_0x58969b){_0x58969b=_0x58969b||0xc8;return function(_0x12d3f8){if(_0x12d3f8){return _0x52726a[_0xd8ca('0x1d')](_0x58969b)[_0xd8ca('0x1f')](_0x12d3f8);}};}function respondWithFilteredResult(_0x647962,_0x177367){return function(_0x17330a){if(_0x17330a){var _0x3013f2=typeof _0x177367[_0xd8ca('0x20')]===_0xd8ca('0x21')&&typeof _0x177367['limit']===_0xd8ca('0x21');var _0x3c67fc=_0x17330a[_0xd8ca('0x22')];var _0x437ac5=_0x3013f2?0x0:_0x177367['offset'];var _0x47e368=_0x3013f2?_0x17330a[_0xd8ca('0x22')]:_0x177367['offset']+_0x177367[_0xd8ca('0x23')];var _0x35a3a1;if(_0x47e368>=_0x3c67fc){_0x47e368=_0x3c67fc;_0x35a3a1=0xc8;}else{_0x35a3a1=0xce;}_0x647962[_0xd8ca('0x1d')](_0x35a3a1);return _0x647962[_0xd8ca('0x24')](_0xd8ca('0x25'),_0x437ac5+'-'+_0x47e368+'/'+_0x3c67fc)[_0xd8ca('0x1f')](_0x17330a);}return null;};}function patchUpdates(_0x56ea7e){return function(_0xa18ac1){try{jsonpatch[_0xd8ca('0x26')](_0xa18ac1,_0x56ea7e,!![]);}catch(_0xd5e6c6){return BPromise[_0xd8ca('0x27')](_0xd5e6c6);}return _0xa18ac1['save']();};}function saveUpdates(_0x23854a,_0x3053f0){return function(_0x1d1367){if(_0x1d1367){return _0x1d1367['update'](_0x23854a)[_0xd8ca('0x28')](function(_0x341807){return _0x341807;});}return null;};}function removeEntity(_0xb42d0c,_0xbf3254){return function(_0x424d81){if(_0x424d81){return _0x424d81[_0xd8ca('0x29')]()[_0xd8ca('0x28')](function(){_0xb42d0c['status'](0xcc)[_0xd8ca('0x1e')]();});}};}function handleEntityNotFound(_0x3f8e42,_0x4eded9){return function(_0x3bd963){if(!_0x3bd963){_0x3f8e42[_0xd8ca('0x1c')](0x194);}return _0x3bd963;};}function handleError(_0x32ba25,_0xaeff64){_0xaeff64=_0xaeff64||0x1f4;return function(_0x15a71d){logger[_0xd8ca('0x2a')](_0x15a71d['stack']);if(_0x15a71d[_0xd8ca('0x2b')]){delete _0x15a71d['name'];}_0x32ba25[_0xd8ca('0x1d')](_0xaeff64)[_0xd8ca('0x2c')](_0x15a71d);};}exports['index']=function(_0x5260c3,_0x1ab436){var _0x4641af={},_0x3b1098={},_0x3bd4c4={'count':0x0,'rows':[]};var _0xab5ffe=_[_0xd8ca('0x2d')](db[_0xd8ca('0x2e')][_0xd8ca('0x2f')],function(_0x52369d){return{'name':_0x52369d[_0xd8ca('0x30')],'type':_0x52369d[_0xd8ca('0x31')][_0xd8ca('0x32')]};});_0x3b1098['model']=_['map'](_0xab5ffe,_0xd8ca('0x2b'));_0x3b1098[_0xd8ca('0x33')]=_[_0xd8ca('0x34')](_0x5260c3[_0xd8ca('0x33')]);_0x3b1098[_0xd8ca('0x35')]=_[_0xd8ca('0x36')](_0x3b1098[_0xd8ca('0x37')],_0x3b1098[_0xd8ca('0x33')]);_0x4641af['attributes']=_[_0xd8ca('0x36')](_0x3b1098[_0xd8ca('0x37')],qs[_0xd8ca('0x38')](_0x5260c3[_0xd8ca('0x33')][_0xd8ca('0x38')]));_0x4641af[_0xd8ca('0x39')]=_0x4641af[_0xd8ca('0x39')][_0xd8ca('0x3a')]?_0x4641af['attributes']:_0x3b1098[_0xd8ca('0x37')];if(!_0x5260c3[_0xd8ca('0x33')][_0xd8ca('0x3b')]('nolimit')){_0x4641af[_0xd8ca('0x23')]=qs[_0xd8ca('0x23')](_0x5260c3[_0xd8ca('0x33')]['limit']);_0x4641af[_0xd8ca('0x20')]=qs['offset'](_0x5260c3[_0xd8ca('0x33')]['offset']);}_0x4641af[_0xd8ca('0x3c')]=qs[_0xd8ca('0x3d')](_0x5260c3[_0xd8ca('0x33')]['sort']);_0x4641af[_0xd8ca('0x3e')]=qs[_0xd8ca('0x35')](_['pick'](_0x5260c3[_0xd8ca('0x33')],_0x3b1098[_0xd8ca('0x35')]),_0xab5ffe);if(_0x5260c3['query'][_0xd8ca('0x3f')]){_0x4641af[_0xd8ca('0x3e')]=_['merge'](_0x4641af[_0xd8ca('0x3e')],{'$or':_[_0xd8ca('0x2d')](_0xab5ffe,function(_0x225794){if(_0x225794['type']!=='VIRTUAL'){var _0x1779a5={};_0x1779a5[_0x225794['name']]={'$like':'%'+_0x5260c3[_0xd8ca('0x33')]['filter']+'%'};return _0x1779a5;}})});}_0x4641af=_[_0xd8ca('0x40')]({},_0x4641af,_0x5260c3[_0xd8ca('0x41')]);var _0x22f15b={'where':_0x4641af[_0xd8ca('0x3e')]};return db['DeskField'][_0xd8ca('0x22')](_0x22f15b)[_0xd8ca('0x28')](function(_0x2f971a){_0x3bd4c4['count']=_0x2f971a;if(_0x5260c3['query'][_0xd8ca('0x42')]){_0x4641af[_0xd8ca('0x43')]=[{'all':!![]}];}return db['DeskField'][_0xd8ca('0x44')](_0x4641af);})[_0xd8ca('0x28')](function(_0x43fcee){_0x3bd4c4[_0xd8ca('0x45')]=_0x43fcee;return _0x3bd4c4;})[_0xd8ca('0x28')](respondWithFilteredResult(_0x1ab436,_0x4641af))[_0xd8ca('0x46')](handleError(_0x1ab436,null));};exports['show']=function(_0x387309,_0x2d10b3){var _0x15d671={'raw':!![],'where':{'id':_0x387309[_0xd8ca('0x47')]['id']}},_0x2dffca={};_0x2dffca[_0xd8ca('0x37')]=_[_0xd8ca('0x34')](db[_0xd8ca('0x2e')]['rawAttributes']);_0x2dffca[_0xd8ca('0x33')]=_[_0xd8ca('0x34')](_0x387309['query']);_0x2dffca['filters']=_[_0xd8ca('0x36')](_0x2dffca[_0xd8ca('0x37')],_0x2dffca[_0xd8ca('0x33')]);_0x15d671[_0xd8ca('0x39')]=_[_0xd8ca('0x36')](_0x2dffca[_0xd8ca('0x37')],qs[_0xd8ca('0x38')](_0x387309[_0xd8ca('0x33')]['fields']));_0x15d671[_0xd8ca('0x39')]=_0x15d671[_0xd8ca('0x39')][_0xd8ca('0x3a')]?_0x15d671[_0xd8ca('0x39')]:_0x2dffca[_0xd8ca('0x37')];if(_0x387309[_0xd8ca('0x33')][_0xd8ca('0x42')]){_0x15d671[_0xd8ca('0x43')]=[{'all':!![]}];}_0x15d671=_['merge']({},_0x15d671,_0x387309[_0xd8ca('0x41')]);return db[_0xd8ca('0x2e')]['find'](_0x15d671)[_0xd8ca('0x28')](handleEntityNotFound(_0x2d10b3,null))[_0xd8ca('0x28')](respondWithResult(_0x2d10b3,null))[_0xd8ca('0x46')](handleError(_0x2d10b3,null));};exports[_0xd8ca('0x48')]=function(_0x449758,_0x31ca73){return db[_0xd8ca('0x2e')][_0xd8ca('0x48')](_0x449758['body'],{})[_0xd8ca('0x28')](respondWithResult(_0x31ca73,0xc9))[_0xd8ca('0x46')](handleError(_0x31ca73,null));};exports[_0xd8ca('0x49')]=function(_0x513b2e,_0x346497){if(_0x513b2e[_0xd8ca('0x4a')]['id']){delete _0x513b2e[_0xd8ca('0x4a')]['id'];}return db[_0xd8ca('0x2e')][_0xd8ca('0x4b')]({'where':{'id':_0x513b2e[_0xd8ca('0x47')]['id']}})[_0xd8ca('0x28')](handleEntityNotFound(_0x346497,null))[_0xd8ca('0x28')](saveUpdates(_0x513b2e[_0xd8ca('0x4a')],null))[_0xd8ca('0x28')](respondWithResult(_0x346497,null))[_0xd8ca('0x46')](handleError(_0x346497,null));};exports['destroy']=function(_0xfd8ad6,_0x3c1808){return db['DeskField'][_0xd8ca('0x4b')]({'where':{'id':_0xfd8ad6[_0xd8ca('0x47')]['id']}})[_0xd8ca('0x28')](handleEntityNotFound(_0x3c1808,null))[_0xd8ca('0x28')](removeEntity(_0x3c1808,null))[_0xd8ca('0x46')](handleError(_0x3c1808,null));}; \ No newline at end of file +var _0x55e2=['eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','update','destroy','then','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','count','include','findAll','show','includeAll','find','create','body','catch'];(function(_0x1257f1,_0x3abe17){var _0xa5494c=function(_0x51e651){while(--_0x51e651){_0x1257f1['push'](_0x1257f1['shift']());}};_0xa5494c(++_0x3abe17);}(_0x55e2,0xd8));var _0x255e=function(_0x1352d5,_0x5917e0){_0x1352d5=_0x1352d5-0x0;var _0x4f656a=_0x55e2[_0x1352d5];return _0x4f656a;};'use strict';var emlformat=require(_0x255e('0x0'));var rimraf=require(_0x255e('0x1'));var zipdir=require(_0x255e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x255e('0x3'));var BPromise=require(_0x255e('0x4'));var Mustache=require('mustache');var util=require(_0x255e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x255e('0x6'));var ejs=require(_0x255e('0x7'));var fs=require('fs');var fs_extra=require(_0x255e('0x8'));var _=require('lodash');var squel=require(_0x255e('0x9'));var crypto=require(_0x255e('0xa'));var jsforce=require(_0x255e('0xb'));var deskjs=require(_0x255e('0xc'));var toCsv=require(_0x255e('0x6'));var querystring=require(_0x255e('0xd'));var Papa=require(_0x255e('0xe'));var Redis=require(_0x255e('0xf'));var authService=require(_0x255e('0x10'));var qs=require(_0x255e('0x11'));var as=require(_0x255e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x255e('0x13'))(_0x255e('0x14'));var utils=require(_0x255e('0x15'));var config=require(_0x255e('0x16'));var licenseUtil=require(_0x255e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e78d6,_0x37cb25){_0x37cb25=_0x37cb25||0xcc;return function(_0x2e1862){if(_0x2e1862){return _0x4e78d6[_0x255e('0x18')](_0x37cb25);}return _0x4e78d6[_0x255e('0x19')](_0x37cb25)[_0x255e('0x1a')]();};}function respondWithResult(_0x4acafd,_0x2f91d6){_0x2f91d6=_0x2f91d6||0xc8;return function(_0x1ef9c9){if(_0x1ef9c9){return _0x4acafd[_0x255e('0x19')](_0x2f91d6)[_0x255e('0x1b')](_0x1ef9c9);}};}function respondWithFilteredResult(_0x5a799e,_0x3b226c){return function(_0x30828f){if(_0x30828f){var _0xe0e1d9=typeof _0x3b226c['offset']==='undefined'&&typeof _0x3b226c[_0x255e('0x1c')]===_0x255e('0x1d');var _0x4d9c9d=_0x30828f['count'];var _0x160248=_0xe0e1d9?0x0:_0x3b226c['offset'];var _0x419940=_0xe0e1d9?_0x30828f['count']:_0x3b226c[_0x255e('0x1e')]+_0x3b226c[_0x255e('0x1c')];var _0x1d940c;if(_0x419940>=_0x4d9c9d){_0x419940=_0x4d9c9d;_0x1d940c=0xc8;}else{_0x1d940c=0xce;}_0x5a799e[_0x255e('0x19')](_0x1d940c);return _0x5a799e[_0x255e('0x1f')](_0x255e('0x20'),_0x160248+'-'+_0x419940+'/'+_0x4d9c9d)[_0x255e('0x1b')](_0x30828f);}return null;};}function patchUpdates(_0x12ba37){return function(_0x2d1d1a){try{jsonpatch[_0x255e('0x21')](_0x2d1d1a,_0x12ba37,!![]);}catch(_0x5ea5c0){return BPromise['reject'](_0x5ea5c0);}return _0x2d1d1a['save']();};}function saveUpdates(_0x51a958,_0x1ff4bf){return function(_0x3b3898){if(_0x3b3898){return _0x3b3898[_0x255e('0x22')](_0x51a958)['then'](function(_0x56e852){return _0x56e852;});}return null;};}function removeEntity(_0x5c4fa7,_0x189514){return function(_0x662022){if(_0x662022){return _0x662022[_0x255e('0x23')]()[_0x255e('0x24')](function(){_0x5c4fa7[_0x255e('0x19')](0xcc)[_0x255e('0x1a')]();});}};}function handleEntityNotFound(_0x588987,_0x4fafaa){return function(_0x547d45){if(!_0x547d45){_0x588987[_0x255e('0x18')](0x194);}return _0x547d45;};}function handleError(_0x7474d9,_0x576e95){_0x576e95=_0x576e95||0x1f4;return function(_0x4962e0){logger['error'](_0x4962e0[_0x255e('0x25')]);if(_0x4962e0['name']){delete _0x4962e0[_0x255e('0x26')];}_0x7474d9[_0x255e('0x19')](_0x576e95)[_0x255e('0x27')](_0x4962e0);};}exports[_0x255e('0x28')]=function(_0x5de3f4,_0x4c2a6d){var _0x1d6cfb={},_0x5d0e82={},_0x49d541={'count':0x0,'rows':[]};var _0x4e3678=_['map'](db[_0x255e('0x29')][_0x255e('0x2a')],function(_0x57d3e2){return{'name':_0x57d3e2[_0x255e('0x2b')],'type':_0x57d3e2[_0x255e('0x2c')][_0x255e('0x2d')]};});_0x5d0e82[_0x255e('0x2e')]=_[_0x255e('0x2f')](_0x4e3678,'name');_0x5d0e82[_0x255e('0x30')]=_[_0x255e('0x31')](_0x5de3f4[_0x255e('0x30')]);_0x5d0e82[_0x255e('0x32')]=_[_0x255e('0x33')](_0x5d0e82[_0x255e('0x2e')],_0x5d0e82[_0x255e('0x30')]);_0x1d6cfb[_0x255e('0x34')]=_['intersection'](_0x5d0e82['model'],qs[_0x255e('0x35')](_0x5de3f4[_0x255e('0x30')][_0x255e('0x35')]));_0x1d6cfb['attributes']=_0x1d6cfb[_0x255e('0x34')][_0x255e('0x36')]?_0x1d6cfb[_0x255e('0x34')]:_0x5d0e82[_0x255e('0x2e')];if(!_0x5de3f4[_0x255e('0x30')]['hasOwnProperty'](_0x255e('0x37'))){_0x1d6cfb[_0x255e('0x1c')]=qs[_0x255e('0x1c')](_0x5de3f4[_0x255e('0x30')]['limit']);_0x1d6cfb[_0x255e('0x1e')]=qs[_0x255e('0x1e')](_0x5de3f4[_0x255e('0x30')][_0x255e('0x1e')]);}_0x1d6cfb[_0x255e('0x38')]=qs[_0x255e('0x39')](_0x5de3f4['query']['sort']);_0x1d6cfb[_0x255e('0x3a')]=qs[_0x255e('0x32')](_['pick'](_0x5de3f4[_0x255e('0x30')],_0x5d0e82[_0x255e('0x32')]),_0x4e3678);if(_0x5de3f4[_0x255e('0x30')]['filter']){_0x1d6cfb[_0x255e('0x3a')]=_[_0x255e('0x3b')](_0x1d6cfb[_0x255e('0x3a')],{'$or':_[_0x255e('0x2f')](_0x4e3678,function(_0x505c7c){if(_0x505c7c['type']!==_0x255e('0x3c')){var _0x7d0a7d={};_0x7d0a7d[_0x505c7c['name']]={'$like':'%'+_0x5de3f4[_0x255e('0x30')][_0x255e('0x3d')]+'%'};return _0x7d0a7d;}})});}_0x1d6cfb=_['merge']({},_0x1d6cfb,_0x5de3f4[_0x255e('0x3e')]);var _0x165c63={'where':_0x1d6cfb['where']};return db['DeskField'][_0x255e('0x3f')](_0x165c63)[_0x255e('0x24')](function(_0x499edb){_0x49d541['count']=_0x499edb;if(_0x5de3f4['query']['includeAll']){_0x1d6cfb[_0x255e('0x40')]=[{'all':!![]}];}return db[_0x255e('0x29')][_0x255e('0x41')](_0x1d6cfb);})['then'](function(_0x595669){_0x49d541['rows']=_0x595669;return _0x49d541;})['then'](respondWithFilteredResult(_0x4c2a6d,_0x1d6cfb))['catch'](handleError(_0x4c2a6d,null));};exports[_0x255e('0x42')]=function(_0x5440cf,_0x2eecfc){var _0x1d6e31={'raw':!![],'where':{'id':_0x5440cf['params']['id']}},_0xab19bd={};_0xab19bd[_0x255e('0x2e')]=_[_0x255e('0x31')](db[_0x255e('0x29')][_0x255e('0x2a')]);_0xab19bd['query']=_['keys'](_0x5440cf[_0x255e('0x30')]);_0xab19bd[_0x255e('0x32')]=_['intersection'](_0xab19bd[_0x255e('0x2e')],_0xab19bd[_0x255e('0x30')]);_0x1d6e31[_0x255e('0x34')]=_[_0x255e('0x33')](_0xab19bd[_0x255e('0x2e')],qs[_0x255e('0x35')](_0x5440cf[_0x255e('0x30')][_0x255e('0x35')]));_0x1d6e31[_0x255e('0x34')]=_0x1d6e31[_0x255e('0x34')][_0x255e('0x36')]?_0x1d6e31[_0x255e('0x34')]:_0xab19bd[_0x255e('0x2e')];if(_0x5440cf[_0x255e('0x30')][_0x255e('0x43')]){_0x1d6e31['include']=[{'all':!![]}];}_0x1d6e31=_[_0x255e('0x3b')]({},_0x1d6e31,_0x5440cf[_0x255e('0x3e')]);return db[_0x255e('0x29')][_0x255e('0x44')](_0x1d6e31)['then'](handleEntityNotFound(_0x2eecfc,null))[_0x255e('0x24')](respondWithResult(_0x2eecfc,null))['catch'](handleError(_0x2eecfc,null));};exports[_0x255e('0x45')]=function(_0x58a8be,_0x3988d9){return db[_0x255e('0x29')][_0x255e('0x45')](_0x58a8be[_0x255e('0x46')],{})[_0x255e('0x24')](respondWithResult(_0x3988d9,0xc9))['catch'](handleError(_0x3988d9,null));};exports['update']=function(_0x21d7a8,_0x22f44a){if(_0x21d7a8[_0x255e('0x46')]['id']){delete _0x21d7a8[_0x255e('0x46')]['id'];}return db[_0x255e('0x29')][_0x255e('0x44')]({'where':{'id':_0x21d7a8['params']['id']}})['then'](handleEntityNotFound(_0x22f44a,null))[_0x255e('0x24')](saveUpdates(_0x21d7a8[_0x255e('0x46')],null))[_0x255e('0x24')](respondWithResult(_0x22f44a,null))[_0x255e('0x47')](handleError(_0x22f44a,null));};exports[_0x255e('0x23')]=function(_0x1d64c3,_0x1235d4){return db[_0x255e('0x29')][_0x255e('0x44')]({'where':{'id':_0x1d64c3['params']['id']}})['then'](handleEntityNotFound(_0x1235d4,null))['then'](removeEntity(_0x1235d4,null))[_0x255e('0x47')](handleError(_0x1235d4,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f506491..6b12dfa 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 _0x53bb=['../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','idField','FieldId','util'];(function(_0x56abdd,_0xffb383){var _0x1db9d4=function(_0x129add){while(--_0x129add){_0x56abdd['push'](_0x56abdd['shift']());}};_0x1db9d4(++_0xffb383);}(_0x53bb,0x1bb));var _0xb53b=function(_0x2de6bb,_0x3b9daf){_0x2de6bb=_0x2de6bb-0x0;var _0x1b28d6=_0x53bb[_0x2de6bb];return _0x1b28d6;};'use strict';var _=require('lodash');var util=require(_0xb53b('0x0'));var logger=require(_0xb53b('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb53b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb53b('0x3'));var rimraf=require(_0xb53b('0x4'));var config=require(_0xb53b('0x5'));var attributes=require('./intDeskField.attributes');module[_0xb53b('0x6')]=function(_0x557dd4,_0x53cdce){return _0x557dd4[_0xb53b('0x7')](_0xb53b('0x8'),attributes,{'tableName':_0xb53b('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xb53b('0xa'),_0xb53b('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x408a=['request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x5aa7ec,_0x4ef4bc){var _0x400f3d=function(_0x4073a2){while(--_0x4073a2){_0x5aa7ec['push'](_0x5aa7ec['shift']());}};_0x400f3d(++_0x4ef4bc);}(_0x408a,0x1bb));var _0xa408=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x408a[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xa408('0x0'));var util=require(_0xa408('0x1'));var logger=require(_0xa408('0x2'))(_0xa408('0x3'));var moment=require('moment');var BPromise=require(_0xa408('0x4'));var rp=require(_0xa408('0x5'));var fs=require('fs');var path=require(_0xa408('0x6'));var rimraf=require(_0xa408('0x7'));var config=require(_0xa408('0x8'));var attributes=require(_0xa408('0x9'));module[_0xa408('0xa')]=function(_0x157d63,_0x5b5dc3){return _0x157d63[_0xa408('0xb')](_0xa408('0xc'),attributes,{'tableName':_0xa408('0xd'),'paranoid':![],'indexes':[{'name':_0xa408('0xe'),'fields':['idField',_0xa408('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 0401b28..4bf6cd2 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 _0xc80f=['client','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x381844,_0x3c4990){var _0x57b3ee=function(_0x384f63){while(--_0x384f63){_0x381844['push'](_0x381844['shift']());}};_0x57b3ee(++_0x3c4990);}(_0xc80f,0x15d));var _0xfc80=function(_0x5d242a,_0x19e8b0){_0x5d242a=_0x5d242a-0x0;var _0x3bdeb9=_0xc80f[_0x5d242a];return _0x3bdeb9;};'use strict';var _=require(_0xfc80('0x0'));var util=require(_0xfc80('0x1'));var moment=require('moment');var BPromise=require(_0xfc80('0x2'));var rs=require(_0xfc80('0x3'));var fs=require('fs');var Redis=require(_0xfc80('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc80('0x5'));var logger=require(_0xfc80('0x6'))(_0xfc80('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc80('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcb23,_0x2d8ca7,_0xab1388){return new BPromise(function(_0x42a1eb,_0x17042e){return client[_0xfc80('0x9')](_0x4fcb23,_0xab1388)[_0xfc80('0xa')](function(_0x357a74){logger[_0xfc80('0xb')](_0xfc80('0xc'),_0x2d8ca7,'request\x20sent');logger[_0xfc80('0xd')](_0xfc80('0xe'),_0x2d8ca7,_0xfc80('0xf'),JSON['stringify'](_0x357a74));if(_0x357a74['error']){if(_0x357a74[_0xfc80('0x10')][_0xfc80('0x11')]===0x1f4){logger[_0xfc80('0x10')]('DeskField,\x20%s,\x20%s',_0x2d8ca7,_0x357a74[_0xfc80('0x10')][_0xfc80('0x12')]);return _0x17042e(_0x357a74['error'][_0xfc80('0x12')]);}logger['error'](_0xfc80('0xc'),_0x2d8ca7,_0x357a74[_0xfc80('0x10')][_0xfc80('0x12')]);return _0x42a1eb(_0x357a74[_0xfc80('0x10')][_0xfc80('0x12')]);}else{logger[_0xfc80('0xb')](_0xfc80('0xc'),_0x2d8ca7,'request\x20sent');_0x42a1eb(_0x357a74[_0xfc80('0x13')][_0xfc80('0x12')]);}})[_0xfc80('0x14')](function(_0x52011f){logger[_0xfc80('0x10')](_0xfc80('0xc'),_0x2d8ca7,_0x52011f);_0x17042e(_0x52011f);});});} \ No newline at end of file +var _0xaf58=['debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf58,0x1b8));var _0x8af5=function(_0x144a0c,_0x2c5fa1){_0x144a0c=_0x144a0c-0x0;var _0x50217b=_0xaf58[_0x144a0c];return _0x50217b;};'use strict';var _=require(_0x8af5('0x0'));var util=require(_0x8af5('0x1'));var moment=require('moment');var BPromise=require(_0x8af5('0x2'));var rs=require(_0x8af5('0x3'));var fs=require('fs');var Redis=require(_0x8af5('0x4'));var db=require(_0x8af5('0x5'))['db'];var utils=require(_0x8af5('0x6'));var logger=require(_0x8af5('0x7'))(_0x8af5('0x8'));var config=require(_0x8af5('0x9'));var jayson=require(_0x8af5('0xa'));var client=jayson[_0x8af5('0xb')][_0x8af5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4262f8,_0x1f9985,_0x48e43a){return new BPromise(function(_0x3de921,_0x171fa5){return client[_0x8af5('0xd')](_0x4262f8,_0x48e43a)['then'](function(_0x495722){logger['info'](_0x8af5('0xe'),_0x1f9985,_0x8af5('0xf'));logger[_0x8af5('0x10')](_0x8af5('0x11'),_0x1f9985,'request\x20sent',JSON['stringify'](_0x495722));if(_0x495722[_0x8af5('0x12')]){if(_0x495722[_0x8af5('0x12')][_0x8af5('0x13')]===0x1f4){logger[_0x8af5('0x12')](_0x8af5('0xe'),_0x1f9985,_0x495722[_0x8af5('0x12')][_0x8af5('0x14')]);return _0x171fa5(_0x495722[_0x8af5('0x12')]['message']);}logger[_0x8af5('0x12')](_0x8af5('0xe'),_0x1f9985,_0x495722[_0x8af5('0x12')][_0x8af5('0x14')]);return _0x3de921(_0x495722[_0x8af5('0x12')]['message']);}else{logger[_0x8af5('0x15')](_0x8af5('0xe'),_0x1f9985,'request\x20sent');_0x3de921(_0x495722[_0x8af5('0x16')][_0x8af5('0x14')]);}})[_0x8af5('0x17')](function(_0x36dd82){logger[_0x8af5('0x12')](_0x8af5('0xe'),_0x1f9985,_0x36dd82);_0x171fa5(_0x36dd82);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ed05269..f13e323 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 _0xe135=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','delete','exports','util','path','connect-timeout','Router'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xe135,0xc2));var _0x5e13=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0xe135[_0x5af97c];return _0x3472ae;};'use strict';var multer=require('multer');var util=require(_0x5e13('0x0'));var path=require(_0x5e13('0x1'));var timeout=require(_0x5e13('0x2'));var express=require('express');var router=express[_0x5e13('0x3')]();var fs_extra=require(_0x5e13('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e13('0x5'));var config=require(_0x5e13('0x6'));var controller=require(_0x5e13('0x7'));router[_0x5e13('0x8')]('/',auth[_0x5e13('0x9')](),controller[_0x5e13('0xa')]);router['get'](_0x5e13('0xb'),auth[_0x5e13('0x9')](),controller[_0x5e13('0xc')]);router['get']('/:id/configurations',auth[_0x5e13('0x9')](),controller[_0x5e13('0xd')]);router[_0x5e13('0x8')](_0x5e13('0xe'),auth[_0x5e13('0x9')](),controller[_0x5e13('0xf')]);router[_0x5e13('0x10')]('/',auth[_0x5e13('0x9')](),controller['create']);router[_0x5e13('0x10')](_0x5e13('0x11'),auth[_0x5e13('0x9')](),controller[_0x5e13('0x12')]);router[_0x5e13('0x13')]('/:id',auth[_0x5e13('0x9')](),controller['update']);router[_0x5e13('0x14')](_0x5e13('0xb'),auth[_0x5e13('0x9')](),controller['destroy']);module[_0x5e13('0x15')]=router; \ No newline at end of file +var _0xe31c=['isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','create','post','addConfiguration','put','update','delete','exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller'];(function(_0x41efef,_0x19810a){var _0x51e449=function(_0x1703a8){while(--_0x1703a8){_0x41efef['push'](_0x41efef['shift']());}};_0x51e449(++_0x19810a);}(_0xe31c,0xe0));var _0xce31=function(_0x42750d,_0xbf1217){_0x42750d=_0x42750d-0x0;var _0x407cf9=_0xe31c[_0x42750d];return _0x407cf9;};'use strict';var multer=require(_0xce31('0x0'));var util=require(_0xce31('0x1'));var path=require(_0xce31('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xce31('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xce31('0x4'));var config=require(_0xce31('0x5'));var controller=require(_0xce31('0x6'));router['get']('/',auth[_0xce31('0x7')](),controller[_0xce31('0x8')]);router[_0xce31('0x9')](_0xce31('0xa'),auth['isAuthenticated'](),controller[_0xce31('0xb')]);router[_0xce31('0x9')](_0xce31('0xc'),auth[_0xce31('0x7')](),controller['getConfigurations']);router[_0xce31('0x9')]('/:id/fields',auth[_0xce31('0x7')](),controller[_0xce31('0xd')]);router['post']('/',auth[_0xce31('0x7')](),controller[_0xce31('0xe')]);router[_0xce31('0xf')](_0xce31('0xc'),auth[_0xce31('0x7')](),controller[_0xce31('0x10')]);router[_0xce31('0x11')](_0xce31('0xa'),auth[_0xce31('0x7')](),controller[_0xce31('0x12')]);router[_0xce31('0x13')]('/:id',auth[_0xce31('0x7')](),controller['destroy']);module[_0xce31('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index db17ed8..7bb1495 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 _0xf987=['STRING','BOOLEAN'];(function(_0x283384,_0x1f5799){var _0x5193e7=function(_0x24541f){while(--_0x24541f){_0x283384['push'](_0x283384['shift']());}};_0x5193e7(++_0x1f5799);}(_0xf987,0x18a));var _0x7f98=function(_0x353635,_0x293d22){_0x353635=_0x353635-0x0;var _0x4f84f5=_0xf987[_0x353635];return _0x4f84f5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7f98('0x0')]},'username':{'type':Sequelize[_0x7f98('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7f98('0x0')]},'tenantId':{'type':Sequelize[_0x7f98('0x0')]},'clientId':{'type':Sequelize[_0x7f98('0x0')]},'clientSecret':{'type':Sequelize[_0x7f98('0x0')]},'serverUrl':{'type':Sequelize[_0x7f98('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x7f98('0x0')]},'modernAuthentication':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb091=['exports','STRING'];(function(_0x5288ed,_0x2e86e5){var _0x234c32=function(_0x14f6b9){while(--_0x14f6b9){_0x5288ed['push'](_0x5288ed['shift']());}};_0x234c32(++_0x2e86e5);}(_0xb091,0x16e));var _0x1b09=function(_0x3f0edd,_0x26b1a8){_0x3f0edd=_0x3f0edd-0x0;var _0x28eaec=_0xb091[_0x3f0edd];return _0x28eaec;};'use strict';var Sequelize=require('sequelize');module[_0x1b09('0x0')]={'name':{'type':Sequelize[_0x1b09('0x1')]},'username':{'type':Sequelize[_0x1b09('0x1')]},'password':{'type':Sequelize[_0x1b09('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x1b09('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b09('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1b09('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e0bb0d7..b273108 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 _0xadcc=['accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','findOne','username','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','GET','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','LogicalName','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','count','update','destroy','then','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','map','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','keys','intersection','include','find','create','body','getConfigurations','Dynamics365Configuration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties'];(function(_0x2709bb,_0x41eede){var _0x5a5bbd=function(_0x1d2f50){while(--_0x1d2f50){_0x2709bb['push'](_0x2709bb['shift']());}};_0x5a5bbd(++_0x41eede);}(_0xadcc,0x76));var _0xcadc=function(_0x1fedeb,_0x3abf80){_0x1fedeb=_0x1fedeb-0x0;var _0xe1bacc=_0xadcc[_0x1fedeb];return _0xe1bacc;};'use strict';var rp=require(_0xcadc('0x0'));var util=require('util');var _=require(_0xcadc('0x1'));var qs=require(_0xcadc('0x2'));var logger=require(_0xcadc('0x3'))(_0xcadc('0x4'));var db=require(_0xcadc('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x53330e,_0x23b7d1){_0x23b7d1=_0x23b7d1||0xc8;return function(_0x333f8c){if(_0x333f8c){return _0x53330e[_0xcadc('0x6')](_0x23b7d1)[_0xcadc('0x7')](_0x333f8c);}};}function respondWithFilteredResult(_0x3aaa29,_0x294977){return function(_0x4a0567){if(_0x4a0567){var _0x346f54=typeof _0x294977[_0xcadc('0x8')]===_0xcadc('0x9')&&typeof _0x294977[_0xcadc('0xa')]===_0xcadc('0x9');var _0x22268c=_0x4a0567[_0xcadc('0xb')];var _0x56907c=_0x346f54?0x0:_0x294977['offset'];var _0x2b23cf=_0x346f54?_0x4a0567[_0xcadc('0xb')]:_0x294977['offset']+_0x294977[_0xcadc('0xa')];var _0xa2b7ba;if(_0x2b23cf>=_0x22268c){_0x2b23cf=_0x22268c;_0xa2b7ba=0xc8;}else{_0xa2b7ba=0xce;}_0x3aaa29[_0xcadc('0x6')](_0xa2b7ba);return _0x3aaa29['set']('Content-Range',_0x56907c+'-'+_0x2b23cf+'/'+_0x22268c)[_0xcadc('0x7')](_0x4a0567);}return null;};}function saveUpdates(_0x365ac7){return function(_0x118388){if(_0x118388){return _0x118388[_0xcadc('0xc')](_0x365ac7)['then'](function(_0xf018bf){return _0xf018bf;});}return null;};}function removeEntity(_0x4d5837){return function(_0x2f380f){if(_0x2f380f){return _0x2f380f[_0xcadc('0xd')]()[_0xcadc('0xe')](function(){_0x4d5837['status'](0xcc)[_0xcadc('0xf')]();});}};}function handleEntityNotFound(_0x3504c5){return function(_0x56660a){if(!_0x56660a){_0x3504c5[_0xcadc('0x10')](0x194);}return _0x56660a;};}function handleError(_0x493327,_0x35ce21){_0x35ce21=_0x35ce21||0x1f4;return function(_0x36d544){logger[_0xcadc('0x11')](_0x36d544[_0xcadc('0x12')]);if(_0x36d544[_0xcadc('0x13')]){delete _0x36d544['name'];}_0x493327[_0xcadc('0x6')](_0x35ce21)[_0xcadc('0x14')](_0x36d544);};}exports[_0xcadc('0x15')]=function(_0x308694,_0x31e9e9){var _0x1b6fc2={},_0x3d6f96={},_0x7b65e={'count':0x0,'rows':[]};var _0x5701e5=_['map'](db[_0xcadc('0x16')][_0xcadc('0x17')],function(_0x5186a1){return{'name':_0x5186a1[_0xcadc('0x18')],'type':_0x5186a1[_0xcadc('0x19')]['key']};});_0x3d6f96['model']=_[_0xcadc('0x1a')](_0x5701e5,'name');_0x3d6f96[_0xcadc('0x1b')]=_['keys'](_0x308694[_0xcadc('0x1b')]);_0x3d6f96[_0xcadc('0x1c')]=_['intersection'](_0x3d6f96[_0xcadc('0x1d')],_0x3d6f96[_0xcadc('0x1b')]);_0x1b6fc2['attributes']=_['intersection'](_0x3d6f96['model'],qs[_0xcadc('0x1e')](_0x308694[_0xcadc('0x1b')]['fields']));_0x1b6fc2[_0xcadc('0x1f')]=_0x1b6fc2['attributes'][_0xcadc('0x20')]?_0x1b6fc2[_0xcadc('0x1f')]:_0x3d6f96[_0xcadc('0x1d')];if(!_0x308694[_0xcadc('0x1b')][_0xcadc('0x21')](_0xcadc('0x22'))){_0x1b6fc2['limit']=qs['limit'](_0x308694['query'][_0xcadc('0xa')]);_0x1b6fc2[_0xcadc('0x8')]=qs[_0xcadc('0x8')](_0x308694[_0xcadc('0x1b')][_0xcadc('0x8')]);}_0x1b6fc2[_0xcadc('0x23')]=qs[_0xcadc('0x24')](_0x308694[_0xcadc('0x1b')][_0xcadc('0x24')]);_0x1b6fc2[_0xcadc('0x25')]=qs[_0xcadc('0x1c')](_['pick'](_0x308694['query'],_0x3d6f96[_0xcadc('0x1c')]),_0x5701e5);if(_0x308694[_0xcadc('0x1b')][_0xcadc('0x26')]){_0x1b6fc2[_0xcadc('0x25')]=_[_0xcadc('0x27')](_0x1b6fc2[_0xcadc('0x25')],{'$or':_[_0xcadc('0x1a')](_0x5701e5,function(_0x35ab0e){if(_0x35ab0e[_0xcadc('0x19')]!==_0xcadc('0x28')){var _0x3fa74f={};_0x3fa74f[_0x35ab0e[_0xcadc('0x13')]]={'$like':'%'+_0x308694[_0xcadc('0x1b')]['filter']+'%'};return _0x3fa74f;}})});}_0x1b6fc2=_['merge']({},_0x1b6fc2,_0x308694['options']);var _0x568d3b={'where':_0x1b6fc2[_0xcadc('0x25')]};return db['Dynamics365Account']['count'](_0x568d3b)[_0xcadc('0xe')](function(_0x1ca3a7){_0x7b65e[_0xcadc('0xb')]=_0x1ca3a7;if(_0x308694[_0xcadc('0x1b')][_0xcadc('0x29')]){_0x1b6fc2['include']=[{'all':!![]}];}return db[_0xcadc('0x16')][_0xcadc('0x2a')](_0x1b6fc2);})['then'](function(_0x3a396e){_0x7b65e[_0xcadc('0x2b')]=_0x3a396e;return _0x7b65e;})[_0xcadc('0xe')](respondWithFilteredResult(_0x31e9e9,_0x1b6fc2))[_0xcadc('0x2c')](handleError(_0x31e9e9,null));};exports['show']=function(_0x3bb1a3,_0x317e8a){var _0x1b057a={'raw':![],'where':{'id':_0x3bb1a3[_0xcadc('0x2d')]['id']}},_0x240203={};_0x240203[_0xcadc('0x1d')]=_['keys'](db[_0xcadc('0x16')]['rawAttributes']);_0x240203[_0xcadc('0x1b')]=_[_0xcadc('0x2e')](_0x3bb1a3[_0xcadc('0x1b')]);_0x240203[_0xcadc('0x1c')]=_[_0xcadc('0x2f')](_0x240203[_0xcadc('0x1d')],_0x240203[_0xcadc('0x1b')]);_0x1b057a[_0xcadc('0x1f')]=_[_0xcadc('0x2f')](_0x240203[_0xcadc('0x1d')],qs['fields'](_0x3bb1a3[_0xcadc('0x1b')][_0xcadc('0x1e')]));_0x1b057a['attributes']=_0x1b057a['attributes'][_0xcadc('0x20')]?_0x1b057a[_0xcadc('0x1f')]:_0x240203[_0xcadc('0x1d')];if(_0x3bb1a3[_0xcadc('0x1b')][_0xcadc('0x29')]){_0x1b057a[_0xcadc('0x30')]=[{'all':!![]}];}_0x1b057a=_['merge']({},_0x1b057a,_0x3bb1a3['options']);return db[_0xcadc('0x16')][_0xcadc('0x31')](_0x1b057a)[_0xcadc('0xe')](handleEntityNotFound(_0x317e8a,null))[_0xcadc('0xe')](respondWithResult(_0x317e8a,null))['catch'](handleError(_0x317e8a,null));};exports[_0xcadc('0x32')]=function(_0x421b7d,_0xdd79f7){return db[_0xcadc('0x16')][_0xcadc('0x32')](_0x421b7d[_0xcadc('0x33')],{})[_0xcadc('0xe')](respondWithResult(_0xdd79f7,0xc9))[_0xcadc('0x2c')](handleError(_0xdd79f7,null));};exports['update']=function(_0x5c4164,_0x3e0307){if(_0x5c4164[_0xcadc('0x33')]['id']){delete _0x5c4164['body']['id'];}return db[_0xcadc('0x16')][_0xcadc('0x31')]({'where':{'id':_0x5c4164[_0xcadc('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3e0307,null))[_0xcadc('0xe')](saveUpdates(_0x5c4164[_0xcadc('0x33')],null))[_0xcadc('0xe')](respondWithResult(_0x3e0307,null))[_0xcadc('0x2c')](handleError(_0x3e0307,null));};exports[_0xcadc('0xd')]=function(_0x528092,_0x24a6ba){return db[_0xcadc('0x16')][_0xcadc('0x31')]({'where':{'id':_0x528092[_0xcadc('0x2d')]['id']}})[_0xcadc('0xe')](handleEntityNotFound(_0x24a6ba,null))[_0xcadc('0xe')](removeEntity(_0x24a6ba,null))[_0xcadc('0x2c')](handleError(_0x24a6ba,null));};exports[_0xcadc('0x34')]=function(_0x36a7a8,_0x5411fd){var _0x428e86={};var _0x24d654={};var _0x4f1428;var _0x36dd35;return db[_0xcadc('0x16')]['findOne']({'where':{'id':_0x36a7a8[_0xcadc('0x2d')]['id']}})[_0xcadc('0xe')](handleEntityNotFound(_0x5411fd,null))[_0xcadc('0xe')](function(_0x1f2628){if(_0x1f2628){_0x4f1428=_0x1f2628;_0x24d654['model']=_[_0xcadc('0x2e')](db[_0xcadc('0x35')][_0xcadc('0x17')]);_0x24d654[_0xcadc('0x1b')]=_[_0xcadc('0x2e')](_0x36a7a8[_0xcadc('0x1b')]);_0x24d654[_0xcadc('0x1c')]=_[_0xcadc('0x2f')](_0x24d654[_0xcadc('0x1d')],_0x24d654[_0xcadc('0x1b')]);_0x428e86[_0xcadc('0x1f')]=_[_0xcadc('0x2f')](_0x24d654['model'],qs[_0xcadc('0x1e')](_0x36a7a8[_0xcadc('0x1b')]['fields']));_0x428e86[_0xcadc('0x1f')]=_0x428e86[_0xcadc('0x1f')][_0xcadc('0x20')]?_0x428e86[_0xcadc('0x1f')]:_0x24d654['model'];_0x428e86[_0xcadc('0x23')]=qs[_0xcadc('0x24')](_0x36a7a8['query'][_0xcadc('0x24')]);_0x428e86['where']=qs['filters'](_['pick'](_0x36a7a8[_0xcadc('0x1b')],_0x24d654['filters']));if(_0x36a7a8[_0xcadc('0x1b')]['filter']){_0x428e86[_0xcadc('0x25')]=_[_0xcadc('0x27')](_0x428e86[_0xcadc('0x25')],{'$or':_['map'](_0x428e86[_0xcadc('0x1f')],function(_0x97f58e){var _0x2776e4={};_0x2776e4[_0x97f58e]={'$like':'%'+_0x36a7a8[_0xcadc('0x1b')]['filter']+'%'};return _0x2776e4;})});}_0x428e86=_[_0xcadc('0x27')]({},_0x428e86,_0x36a7a8['options']);return _0x4f1428[_0xcadc('0x34')](_0x428e86);}})[_0xcadc('0xe')](function(_0x5b6af8){if(_0x5b6af8){_0x36dd35=_0x5b6af8[_0xcadc('0x20')];if(!_0x36a7a8[_0xcadc('0x1b')][_0xcadc('0x21')]('nolimit')){_0x428e86['limit']=qs[_0xcadc('0xa')](_0x36a7a8['query'][_0xcadc('0xa')]);_0x428e86[_0xcadc('0x8')]=qs[_0xcadc('0x8')](_0x36a7a8[_0xcadc('0x1b')][_0xcadc('0x8')]);}return _0x4f1428[_0xcadc('0x34')](_0x428e86);}})[_0xcadc('0xe')](function(_0x3f3b02){if(_0x3f3b02){return _0x3f3b02?{'count':_0x36dd35,'rows':_0x3f3b02}:null;}})['then'](respondWithResult(_0x5411fd,null))[_0xcadc('0x2c')](handleError(_0x5411fd,null));};exports[_0xcadc('0x36')]=function(_0x388efc,_0x1518ca){if(_0x388efc[_0xcadc('0x33')]['id']){delete _0x388efc[_0xcadc('0x33')]['id'];}return db[_0xcadc('0x16')]['findOne']({'where':{'id':_0x388efc[_0xcadc('0x2d')]['id']}})[_0xcadc('0xe')](handleEntityNotFound(_0x1518ca,null))[_0xcadc('0xe')](function(_0x2f1805){if(_0x2f1805){_0x388efc[_0xcadc('0x33')]['AccountId']=_0x2f1805['id'];_0x388efc['body'][_0xcadc('0x37')]=integrations[_0xcadc('0x38')](_0x388efc[_0xcadc('0x33')][_0xcadc('0x39')],_0x388efc[_0xcadc('0x33')][_0xcadc('0x19')]);_0x388efc[_0xcadc('0x33')][_0xcadc('0x3a')]=integrations[_0xcadc('0x3b')](_0x388efc['body'][_0xcadc('0x39')],_0x388efc['body']['type']);return db[_0xcadc('0x35')][_0xcadc('0x32')](_0x388efc['body'],{'include':[{'model':db[_0xcadc('0x3c')],'as':_0xcadc('0x37')},{'model':db[_0xcadc('0x3c')],'as':_0xcadc('0x3a')}]});}return null;})[_0xcadc('0xe')](respondWithResult(_0x1518ca,null))[_0xcadc('0x2c')](handleError(_0x1518ca,null));};function sanitizeRemoteUri(_0x3d0c58){var _0x37c962=_0x3d0c58[_0xcadc('0x3d')](-0x1);if(_0x37c962==='/')return _0x3d0c58['substring'](0x0,_0x3d0c58[_0xcadc('0x3e')](_0x37c962));return _0x3d0c58;}function getWebApiUrl(_0x57a9f9){return util['format'](_0xcadc('0x3f'),_0x57a9f9);}exports[_0xcadc('0x40')]=function(_0x2cc00e,_0x223397){var _0x43d577=_0x2cc00e[_0xcadc('0x1b')][_0xcadc('0x41')];var _0x4d4074=_0x43d577===_0xcadc('0x42')?_0xcadc('0x43'):_0xcadc('0x44');var _0x341583='';var _0x1c6090='';var _0x5e2254='';var _0x4348ab='';var _0x1f4c40='';var _0x42932a='';var _0x121db6='';var _0x44aa23='';var _0x21b77d=[_0xcadc('0x45'),_0xcadc('0x46'),_0xcadc('0x47'),_0xcadc('0x48'),_0xcadc('0x49'),_0xcadc('0x4a'),_0xcadc('0x4b'),_0xcadc('0x4c'),'directioncode',_0xcadc('0x4d')];var _0x21437a=[_0xcadc('0x4e'),_0xcadc('0x4f'),_0xcadc('0x50'),'billedserviceunits',_0xcadc('0x51'),_0xcadc('0x52'),_0xcadc('0x53'),_0xcadc('0x54'),_0xcadc('0x55'),_0xcadc('0x56'),_0xcadc('0x57'),_0xcadc('0x58'),_0xcadc('0x59'),'createdonbehalfbyname',_0xcadc('0x5a'),_0xcadc('0x5b'),_0xcadc('0x5c'),_0xcadc('0x5d'),_0xcadc('0x5e'),_0xcadc('0x5f'),_0xcadc('0x60'),'entityimage_url',_0xcadc('0x61'),_0xcadc('0x62'),_0xcadc('0x63'),_0xcadc('0x64'),_0xcadc('0x65'),_0xcadc('0x66'),_0xcadc('0x67'),_0xcadc('0x68'),_0xcadc('0x69'),'modifiedbyexternalpartyname',_0xcadc('0x6a'),_0xcadc('0x6b'),_0xcadc('0x6c'),'modifiedon',_0xcadc('0x6d'),_0xcadc('0x6e'),'msdyn_incidenttypename',_0xcadc('0x6f'),_0xcadc('0x70'),_0xcadc('0x71'),_0xcadc('0x72'),_0xcadc('0x73'),_0xcadc('0x74'),_0xcadc('0x75'),_0xcadc('0x76'),_0xcadc('0x77'),_0xcadc('0x78'),_0xcadc('0x79'),'productidname',_0xcadc('0x7a'),'resolveby',_0xcadc('0x7b'),_0xcadc('0x7c'),_0xcadc('0x7d'),_0xcadc('0x7e'),_0xcadc('0x7f'),'slainvokedidname',_0xcadc('0x80'),_0xcadc('0x81'),_0xcadc('0x82'),_0xcadc('0x83'),_0xcadc('0x84'),_0xcadc('0x85'),_0xcadc('0x86'),'transactioncurrencyidname',_0xcadc('0x87'),_0xcadc('0x88'),_0xcadc('0x89')];var _0x3f0190=_0x21b77d[_0xcadc('0x8a')](_0x21437a);return db[_0xcadc('0x16')][_0xcadc('0x8b')]({'where':{'id':_0x2cc00e[_0xcadc('0x2d')]['id']},'attributes':['id',_0xcadc('0x8c'),_0xcadc('0x8d'),_0xcadc('0x8e'),_0xcadc('0x8f'),'clientId',_0xcadc('0x90'),_0xcadc('0x91')],'include':[{'model':db[_0xcadc('0x92')],'as':'CloudProvider','attributes':['id',_0xcadc('0x93'),'data7']}]})[_0xcadc('0xe')](handleEntityNotFound(_0x223397,null))[_0xcadc('0xe')](function(_0x1d7684){if(_0x1d7684){if(_0x1d7684[_0xcadc('0x91')]){_0x1d7684[_0xcadc('0x94')]=_0x1d7684[_0xcadc('0x92')][_0xcadc('0x93')];_0x44aa23=sanitizeRemoteUri(_0x1d7684[_0xcadc('0x92')][_0xcadc('0x95')]);_0x121db6=getWebApiUrl(_0x44aa23);return _0x1d7684;}_0x44aa23=sanitizeRemoteUri(_0x1d7684[_0xcadc('0x8e')]);_0x121db6=getWebApiUrl(_0x44aa23);var _0x1a8aae={'method':_0xcadc('0x96'),'uri':_0xcadc('0x97')+_0x1d7684[_0xcadc('0x8f')]+_0xcadc('0x98'),'form':{'client_id':_0x1d7684[_0xcadc('0x99')],'resource':_0x44aa23,'username':_0x1d7684['username'],'password':_0x1d7684[_0xcadc('0x8d')],'grant_type':'password','client_secret':_0x1d7684[_0xcadc('0x90')]},'json':!![]};return rp(_0x1a8aae);}})[_0xcadc('0xe')](function(_0x480b11){_0x42932a=_0x480b11['access_token'];var _0x5ca251={'method':_0xcadc('0x9a'),'uri':encodeURI(_0x121db6+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4d4074+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x42932a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5ca251);})[_0xcadc('0xe')](function(_0x4e9284){var _0x251686=_0x4e9284[_0xcadc('0x9b')][0x0];var _0x111851=_0x251686[_0xcadc('0x9c')];var _0xbeb8cd={'method':_0xcadc('0x9a'),'uri':_0x121db6+_0xcadc('0x9d')+_0x111851+_0xcadc('0x9e'),'headers':{'Authorization':_0xcadc('0x9f')+_0x42932a,'If-None-Match':null,'OData-Version':_0xcadc('0xa0')},'json':!![]};return rp(_0xbeb8cd);})[_0xcadc('0xe')](function(_0x4115fc){_0x341583=_0x4115fc;_0x1c6090=_0x341583[_0xcadc('0xa1')];_0x1c6090=_[_0xcadc('0xa2')](_0x1c6090,function(_0x775129){return!_0x3f0190['includes'](_0x775129['LogicalName']);});var _0x5648ea=[];var _0xa36bd4=[];_0x1c6090[_0xcadc('0xa3')](function(_0x1a37bd){if(_0x1a37bd['@odata.type']){var _0x2e2ba2=_0x1a37bd[_0xcadc('0xa4')][_0xcadc('0xa5')](_0x1a37bd[_0xcadc('0xa4')][_0xcadc('0x3e')]('.')+0x1);if(_0x2e2ba2===_0xcadc('0xa6')){_0x5648ea[_0xcadc('0xa7')](getSelectList(_0x121db6,_0x43d577,_0xa36bd4,_0x341583[_0xcadc('0x9c')],_0x1a37bd['MetadataId'],_0x42932a));}}});return Promise[_0xcadc('0xa8')](_0x5648ea);})[_0xcadc('0xe')](function(_0x12ac78){_0x5e2254=_0x12ac78[0x0];var _0x18ea2d=[];var _0x346cc=[];_0x1c6090[_0xcadc('0xa3')](function(_0x348ac9){if(!_[_0xcadc('0xa9')](_0x348ac9[_0xcadc('0xa4')])){var _0xf7f2ed=_0x348ac9['@odata.type'][_0xcadc('0xa5')](_0x348ac9['@odata.type'][_0xcadc('0x3e')]('.')+0x1);if(_0xf7f2ed==='BooleanAttributeMetadata'){_0x18ea2d[_0xcadc('0xa7')](getBooleanList(_0x121db6,_0x43d577,_0x346cc,_0x341583[_0xcadc('0x9c')],_0x348ac9[_0xcadc('0x9c')],_0x42932a));}}});return Promise[_0xcadc('0xa8')](_0x18ea2d);})[_0xcadc('0xe')](function(_0x13f1e3){_0x4348ab=_0x13f1e3[0x0];var _0x31c254=[];var _0x58129b=[];_0x1c6090['forEach'](function(_0x242056){if(_0x242056[_0xcadc('0xa4')]){var _0x2db8cd=_0x242056[_0xcadc('0xa4')][_0xcadc('0xa5')](_0x242056['@odata.type'][_0xcadc('0x3e')]('.')+0x1);if(_0x2db8cd===_0xcadc('0xaa')||_0x2db8cd===_0xcadc('0xab')||_0x2db8cd===_0xcadc('0xac')||_0x2db8cd===_0xcadc('0xad')||_0x2db8cd===_0xcadc('0xae')||_0x2db8cd===_0xcadc('0xaf')||_0x2db8cd===_0xcadc('0xb0')||_0x2db8cd===_0xcadc('0xb1')||_0x2db8cd===_0xcadc('0xb2')||_0x2db8cd===_0xcadc('0xb3')){_0x31c254['push'](getInputList(_0x121db6,_0x43d577,_0x2db8cd,_0x58129b,_0x341583[_0xcadc('0x9c')],_0x242056[_0xcadc('0x9c')],_0x42932a));}}});return Promise['all'](_0x31c254);})[_0xcadc('0xe')](function(_0x48d385){_0x1f4c40=_0x48d385[0x0];var _0x16d084=_0x5e2254[_0xcadc('0x8a')](_0x4348ab)['concat'](_0x1f4c40);var _0x48c571={'count':_0x16d084[_0xcadc('0x20')],'rows':_0x16d084};return _0x48c571;})[_0xcadc('0xe')](respondWithResult(_0x223397,null))[_0xcadc('0x2c')](function(_0x1de541){var _0x4c1107=_0x2cc00e[_0xcadc('0x1b')][_0xcadc('0xb4')]?0x1f4:_0x1de541['statusCode']||0x1f4;logger[_0xcadc('0x11')](_0x1de541[_0xcadc('0x12')]);delete _0x1de541['name'];if(_0x4c1107===0x191){_0x4c1107=0x190;}_0x223397['status'](_0x4c1107)[_0xcadc('0x14')](_0x2cc00e[_0xcadc('0x1b')][_0xcadc('0xb4')]?{'message':_0xcadc('0xb5'),'statusCode':_0x1de541[_0xcadc('0xb6')]}:_0x1de541);});};function getSelectList(_0x2780f0,_0x3024ba,_0x4340ce,_0xf57ade,_0x5d964b,_0x5c91fd){var _0x3ba612={'method':'GET','uri':_0x2780f0+'EntityDefinitions('+_0xf57ade+_0xcadc('0xb7')+_0x5d964b+_0xcadc('0xb8')+_0xcadc('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0x5c91fd,'If-None-Match':null,'OData-Version':_0xcadc('0xa0')},'json':!![]};return rp(_0x3ba612)[_0xcadc('0xe')](function(_0x3fc111){var _0x430db1=[];var _0x29d118=_0x3fc111[_0xcadc('0xba')][_0xcadc('0xbb')];_0x29d118['forEach'](function(_0x20366d){_0x430db1[_0xcadc('0xa7')]({'name':_0x20366d[_0xcadc('0xbc')][_0xcadc('0xbd')][_0xcadc('0xbc')],'value':String(_0x20366d['Value'])});});var _0x44a388={'id':_0x3024ba+'_'+_0x3fc111[_0xcadc('0xbe')],'name':_0x3fc111['DisplayName']['UserLocalizedLabel'][_0xcadc('0xbc')],'custom':![],'options':_0x430db1};_0x4340ce['push'](_0x44a388);return _0x4340ce;});}function getBooleanList(_0x15d5db,_0x98e04c,_0x1939de,_0x4126ee,_0x52ae57,_0x4e3410){var _0x1653b4={'method':_0xcadc('0x9a'),'uri':_0x15d5db+_0xcadc('0x9d')+_0x4126ee+')/Attributes('+_0x52ae57+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xcadc('0x9f')+_0x4e3410,'If-None-Match':null,'OData-Version':_0xcadc('0xa0')},'json':!![]};return rp(_0x1653b4)['then'](function(_0x26e9cc){var _0x3dfa96=[];_0x3dfa96[_0xcadc('0xa7')]({'name':_0x26e9cc['OptionSet']['TrueOption'][_0xcadc('0xbc')][_0xcadc('0xbd')]['Label'],'value':_0xcadc('0xbf')},{'name':_0x26e9cc['OptionSet'][_0xcadc('0xc0')][_0xcadc('0xbc')][_0xcadc('0xbd')][_0xcadc('0xbc')],'value':'false'});var _0x409d96={'id':_0x98e04c+'_'+_0x26e9cc[_0xcadc('0xbe')],'name':_0x26e9cc[_0xcadc('0xc1')]['UserLocalizedLabel'][_0xcadc('0xbc')],'custom':![],'options':_0x3dfa96};_0x1939de['push'](_0x409d96);return _0x1939de;});}function getInputList(_0x1070cb,_0x28decf,_0x125567,_0x10fc0f,_0x38d39b,_0x4b2d10,_0x26b91d){var _0x1deaac={'method':'GET','uri':_0x1070cb+_0xcadc('0x9d')+_0x38d39b+_0xcadc('0xb7')+_0x4b2d10+_0xcadc('0xc2')+_0x125567+_0xcadc('0xc3'),'headers':{'Authorization':'Bearer\x20'+_0x26b91d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1deaac)[_0xcadc('0xe')](function(_0x5db62b){var _0x4dcef9={'id':_0x28decf+'_'+_0x5db62b[_0xcadc('0xbe')],'name':_0x5db62b[_0xcadc('0xc1')][_0xcadc('0xbd')]?_0x5db62b[_0xcadc('0xc1')][_0xcadc('0xbd')][_0xcadc('0xbc')]:_0x5db62b['LogicalName'],'custom':![],'options':[]};_0x10fc0f[_0xcadc('0xa7')](_0x4dcef9);return _0x10fc0f;});} \ No newline at end of file +var _0x4295=['kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','prioritycodename','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','push','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','DisplayName','request-promise','util','lodash','../../mysqldb','../../components/integrations/configuration','offset','undefined','limit','count','Content-Range','json','then','end','sendStatus','error','stack','name','status','send','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','update','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','influencescore'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4295,0x1bd));var _0x5429=function(_0x25a233,_0x1402dd){_0x25a233=_0x25a233-0x0;var _0x48ed17=_0x4295[_0x25a233];return _0x48ed17;};'use strict';var rp=require(_0x5429('0x0'));var util=require(_0x5429('0x1'));var _=require(_0x5429('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var db=require(_0x5429('0x3'))['db'];var integrations=require(_0x5429('0x4'));function respondWithResult(_0x1457be,_0x365451){_0x365451=_0x365451||0xc8;return function(_0x50b42b){if(_0x50b42b){return _0x1457be['status'](_0x365451)['json'](_0x50b42b);}};}function respondWithFilteredResult(_0x498491,_0x3a39af){return function(_0xe89ac0){if(_0xe89ac0){var _0x16c93c=typeof _0x3a39af[_0x5429('0x5')]===_0x5429('0x6')&&typeof _0x3a39af[_0x5429('0x7')]==='undefined';var _0xd56bb8=_0xe89ac0[_0x5429('0x8')];var _0x29fc80=_0x16c93c?0x0:_0x3a39af[_0x5429('0x5')];var _0xc18703=_0x16c93c?_0xe89ac0[_0x5429('0x8')]:_0x3a39af[_0x5429('0x5')]+_0x3a39af[_0x5429('0x7')];var _0x4c9708;if(_0xc18703>=_0xd56bb8){_0xc18703=_0xd56bb8;_0x4c9708=0xc8;}else{_0x4c9708=0xce;}_0x498491['status'](_0x4c9708);return _0x498491['set'](_0x5429('0x9'),_0x29fc80+'-'+_0xc18703+'/'+_0xd56bb8)[_0x5429('0xa')](_0xe89ac0);}return null;};}function saveUpdates(_0x5c44f5){return function(_0x42a6b5){if(_0x42a6b5){return _0x42a6b5['update'](_0x5c44f5)[_0x5429('0xb')](function(_0x14482a){return _0x14482a;});}return null;};}function removeEntity(_0x1be34b){return function(_0x37041e){if(_0x37041e){return _0x37041e['destroy']()[_0x5429('0xb')](function(){_0x1be34b['status'](0xcc)[_0x5429('0xc')]();});}};}function handleEntityNotFound(_0x20fbfb){return function(_0x5bd2e7){if(!_0x5bd2e7){_0x20fbfb[_0x5429('0xd')](0x194);}return _0x5bd2e7;};}function handleError(_0xe8c1ce,_0x2380f0){_0x2380f0=_0x2380f0||0x1f4;return function(_0x27388d){logger[_0x5429('0xe')](_0x27388d[_0x5429('0xf')]);if(_0x27388d['name']){delete _0x27388d[_0x5429('0x10')];}_0xe8c1ce[_0x5429('0x11')](_0x2380f0)[_0x5429('0x12')](_0x27388d);};}exports[_0x5429('0x13')]=function(_0x9b0b1b,_0x1cdf77){var _0x553b1d={},_0x344edc={},_0xe4ffc1={'count':0x0,'rows':[]};var _0x50812e=_[_0x5429('0x14')](db[_0x5429('0x15')][_0x5429('0x16')],function(_0x3a825a){return{'name':_0x3a825a['fieldName'],'type':_0x3a825a[_0x5429('0x17')][_0x5429('0x18')]};});_0x344edc[_0x5429('0x19')]=_['map'](_0x50812e,_0x5429('0x10'));_0x344edc[_0x5429('0x1a')]=_[_0x5429('0x1b')](_0x9b0b1b[_0x5429('0x1a')]);_0x344edc['filters']=_[_0x5429('0x1c')](_0x344edc['model'],_0x344edc['query']);_0x553b1d[_0x5429('0x1d')]=_[_0x5429('0x1c')](_0x344edc['model'],qs['fields'](_0x9b0b1b[_0x5429('0x1a')]['fields']));_0x553b1d[_0x5429('0x1d')]=_0x553b1d[_0x5429('0x1d')][_0x5429('0x1e')]?_0x553b1d[_0x5429('0x1d')]:_0x344edc[_0x5429('0x19')];if(!_0x9b0b1b['query'][_0x5429('0x1f')](_0x5429('0x20'))){_0x553b1d[_0x5429('0x7')]=qs[_0x5429('0x7')](_0x9b0b1b[_0x5429('0x1a')]['limit']);_0x553b1d[_0x5429('0x5')]=qs[_0x5429('0x5')](_0x9b0b1b[_0x5429('0x1a')][_0x5429('0x5')]);}_0x553b1d[_0x5429('0x21')]=qs[_0x5429('0x22')](_0x9b0b1b[_0x5429('0x1a')][_0x5429('0x22')]);_0x553b1d[_0x5429('0x23')]=qs['filters'](_['pick'](_0x9b0b1b[_0x5429('0x1a')],_0x344edc[_0x5429('0x24')]),_0x50812e);if(_0x9b0b1b[_0x5429('0x1a')]['filter']){_0x553b1d[_0x5429('0x23')]=_[_0x5429('0x25')](_0x553b1d['where'],{'$or':_[_0x5429('0x14')](_0x50812e,function(_0xe4d1d2){if(_0xe4d1d2[_0x5429('0x17')]!==_0x5429('0x26')){var _0x3edeb8={};_0x3edeb8[_0xe4d1d2[_0x5429('0x10')]]={'$like':'%'+_0x9b0b1b[_0x5429('0x1a')][_0x5429('0x27')]+'%'};return _0x3edeb8;}})});}_0x553b1d=_[_0x5429('0x25')]({},_0x553b1d,_0x9b0b1b['options']);var _0x1df885={'where':_0x553b1d[_0x5429('0x23')]};return db[_0x5429('0x15')][_0x5429('0x8')](_0x1df885)[_0x5429('0xb')](function(_0x38b787){_0xe4ffc1[_0x5429('0x8')]=_0x38b787;if(_0x9b0b1b[_0x5429('0x1a')][_0x5429('0x28')]){_0x553b1d[_0x5429('0x29')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x5429('0x2a')](_0x553b1d);})[_0x5429('0xb')](function(_0x5117a0){_0xe4ffc1[_0x5429('0x2b')]=_0x5117a0;return _0xe4ffc1;})[_0x5429('0xb')](respondWithFilteredResult(_0x1cdf77,_0x553b1d))['catch'](handleError(_0x1cdf77,null));};exports[_0x5429('0x2c')]=function(_0x134d34,_0x24afbc){var _0x3b9b5f={'raw':![],'where':{'id':_0x134d34[_0x5429('0x2d')]['id']}},_0x16ce00={};_0x16ce00['model']=_[_0x5429('0x1b')](db[_0x5429('0x15')][_0x5429('0x16')]);_0x16ce00[_0x5429('0x1a')]=_[_0x5429('0x1b')](_0x134d34['query']);_0x16ce00[_0x5429('0x24')]=_[_0x5429('0x1c')](_0x16ce00[_0x5429('0x19')],_0x16ce00[_0x5429('0x1a')]);_0x3b9b5f['attributes']=_[_0x5429('0x1c')](_0x16ce00['model'],qs[_0x5429('0x2e')](_0x134d34[_0x5429('0x1a')][_0x5429('0x2e')]));_0x3b9b5f['attributes']=_0x3b9b5f['attributes'][_0x5429('0x1e')]?_0x3b9b5f[_0x5429('0x1d')]:_0x16ce00[_0x5429('0x19')];if(_0x134d34[_0x5429('0x1a')][_0x5429('0x28')]){_0x3b9b5f['include']=[{'all':!![]}];}_0x3b9b5f=_['merge']({},_0x3b9b5f,_0x134d34[_0x5429('0x2f')]);return db['Dynamics365Account'][_0x5429('0x30')](_0x3b9b5f)[_0x5429('0xb')](handleEntityNotFound(_0x24afbc,null))[_0x5429('0xb')](respondWithResult(_0x24afbc,null))[_0x5429('0x31')](handleError(_0x24afbc,null));};exports[_0x5429('0x32')]=function(_0x5e46b6,_0x2d9184){return db[_0x5429('0x15')][_0x5429('0x32')](_0x5e46b6[_0x5429('0x33')],{})[_0x5429('0xb')](respondWithResult(_0x2d9184,0xc9))[_0x5429('0x31')](handleError(_0x2d9184,null));};exports[_0x5429('0x34')]=function(_0x178f93,_0x27b5bf){if(_0x178f93[_0x5429('0x33')]['id']){delete _0x178f93[_0x5429('0x33')]['id'];}return db['Dynamics365Account'][_0x5429('0x30')]({'where':{'id':_0x178f93[_0x5429('0x2d')]['id']}})[_0x5429('0xb')](handleEntityNotFound(_0x27b5bf,null))[_0x5429('0xb')](saveUpdates(_0x178f93[_0x5429('0x33')],null))[_0x5429('0xb')](respondWithResult(_0x27b5bf,null))['catch'](handleError(_0x27b5bf,null));};exports['destroy']=function(_0x28acf2,_0x14977e){return db[_0x5429('0x15')][_0x5429('0x30')]({'where':{'id':_0x28acf2[_0x5429('0x2d')]['id']}})[_0x5429('0xb')](handleEntityNotFound(_0x14977e,null))['then'](removeEntity(_0x14977e,null))[_0x5429('0x31')](handleError(_0x14977e,null));};exports[_0x5429('0x35')]=function(_0x4842e3,_0x30f33b){var _0x10d946={};var _0x145fc4={};var _0x2e2b6c;var _0x4441d3;return db['Dynamics365Account'][_0x5429('0x36')]({'where':{'id':_0x4842e3[_0x5429('0x2d')]['id']}})[_0x5429('0xb')](handleEntityNotFound(_0x30f33b,null))['then'](function(_0x53df30){if(_0x53df30){_0x2e2b6c=_0x53df30;_0x145fc4[_0x5429('0x19')]=_['keys'](db[_0x5429('0x37')][_0x5429('0x16')]);_0x145fc4[_0x5429('0x1a')]=_[_0x5429('0x1b')](_0x4842e3[_0x5429('0x1a')]);_0x145fc4[_0x5429('0x24')]=_['intersection'](_0x145fc4[_0x5429('0x19')],_0x145fc4[_0x5429('0x1a')]);_0x10d946[_0x5429('0x1d')]=_[_0x5429('0x1c')](_0x145fc4[_0x5429('0x19')],qs[_0x5429('0x2e')](_0x4842e3['query'][_0x5429('0x2e')]));_0x10d946[_0x5429('0x1d')]=_0x10d946['attributes']['length']?_0x10d946['attributes']:_0x145fc4[_0x5429('0x19')];_0x10d946[_0x5429('0x21')]=qs[_0x5429('0x22')](_0x4842e3[_0x5429('0x1a')][_0x5429('0x22')]);_0x10d946[_0x5429('0x23')]=qs['filters'](_[_0x5429('0x38')](_0x4842e3[_0x5429('0x1a')],_0x145fc4[_0x5429('0x24')]));if(_0x4842e3[_0x5429('0x1a')][_0x5429('0x27')]){_0x10d946[_0x5429('0x23')]=_['merge'](_0x10d946[_0x5429('0x23')],{'$or':_[_0x5429('0x14')](_0x10d946['attributes'],function(_0xa3010a){var _0x320315={};_0x320315[_0xa3010a]={'$like':'%'+_0x4842e3[_0x5429('0x1a')]['filter']+'%'};return _0x320315;})});}_0x10d946=_['merge']({},_0x10d946,_0x4842e3[_0x5429('0x2f')]);return _0x2e2b6c[_0x5429('0x35')](_0x10d946);}})['then'](function(_0x2bef2d){if(_0x2bef2d){_0x4441d3=_0x2bef2d[_0x5429('0x1e')];if(!_0x4842e3[_0x5429('0x1a')][_0x5429('0x1f')]('nolimit')){_0x10d946['limit']=qs[_0x5429('0x7')](_0x4842e3[_0x5429('0x1a')][_0x5429('0x7')]);_0x10d946[_0x5429('0x5')]=qs['offset'](_0x4842e3['query'][_0x5429('0x5')]);}return _0x2e2b6c[_0x5429('0x35')](_0x10d946);}})[_0x5429('0xb')](function(_0x46cfcd){if(_0x46cfcd){return _0x46cfcd?{'count':_0x4441d3,'rows':_0x46cfcd}:null;}})[_0x5429('0xb')](respondWithResult(_0x30f33b,null))[_0x5429('0x31')](handleError(_0x30f33b,null));};exports[_0x5429('0x39')]=function(_0x16c89f,_0x682523){if(_0x16c89f[_0x5429('0x33')]['id']){delete _0x16c89f[_0x5429('0x33')]['id'];}return db[_0x5429('0x15')][_0x5429('0x36')]({'where':{'id':_0x16c89f[_0x5429('0x2d')]['id']}})[_0x5429('0xb')](handleEntityNotFound(_0x682523,null))['then'](function(_0x5413f5){if(_0x5413f5){_0x16c89f[_0x5429('0x33')][_0x5429('0x3a')]=_0x5413f5['id'];_0x16c89f[_0x5429('0x33')][_0x5429('0x3b')]=integrations[_0x5429('0x3c')](_0x16c89f[_0x5429('0x33')]['channel'],_0x16c89f[_0x5429('0x33')][_0x5429('0x17')]);_0x16c89f['body'][_0x5429('0x3d')]=integrations[_0x5429('0x3e')](_0x16c89f[_0x5429('0x33')][_0x5429('0x3f')],_0x16c89f['body']['type']);return db[_0x5429('0x37')]['create'](_0x16c89f['body'],{'include':[{'model':db[_0x5429('0x40')],'as':_0x5429('0x3b')},{'model':db[_0x5429('0x40')],'as':_0x5429('0x3d')}]});}return null;})['then'](respondWithResult(_0x682523,null))[_0x5429('0x31')](handleError(_0x682523,null));};function sanitizeRemoteUri(_0x5122e3){var _0x39972d=_0x5122e3[_0x5429('0x41')](-0x1);if(_0x39972d==='/')return _0x5122e3[_0x5429('0x42')](0x0,_0x5122e3[_0x5429('0x43')](_0x39972d));return _0x5122e3;}function getWebApiUrl(_0xd30862){return util[_0x5429('0x44')](_0x5429('0x45'),_0xd30862);}exports[_0x5429('0x46')]=function(_0x25697e,_0x47a0fb){var _0x4c994a=_0x25697e[_0x5429('0x1a')][_0x5429('0x47')];var _0x39575a=_0x4c994a===_0x5429('0x48')?_0x5429('0x49'):'PhoneCall';var _0x9dd77a='';var _0x4459fa='';var _0x2e620b='';var _0x417b6d='';var _0x2abb78='';var _0x5bad86='';var _0xc3185c='';var _0x2340be='';var _0x3b506e=['title',_0x5429('0x4a'),_0x5429('0x4b'),_0x5429('0x4c'),_0x5429('0x4d'),_0x5429('0x4e'),_0x5429('0x4f'),_0x5429('0x50'),'directioncode',_0x5429('0x51')];var _0xcd37c=['accountidname',_0x5429('0x52'),_0x5429('0x53'),'billedserviceunits','contactidname',_0x5429('0x54'),'contractdetailidname',_0x5429('0x55'),_0x5429('0x56'),'createdbyexternalpartyyominame',_0x5429('0x57'),_0x5429('0x58'),_0x5429('0x59'),_0x5429('0x5a'),_0x5429('0x5b'),_0x5429('0x5c'),'customeridtype','customeridyominame',_0x5429('0x5d'),_0x5429('0x5e'),_0x5429('0x5f'),_0x5429('0x60'),_0x5429('0x61'),'exchangerate',_0x5429('0x62'),_0x5429('0x63'),'importsequencenumber',_0x5429('0x64'),_0x5429('0x65'),_0x5429('0x66'),_0x5429('0x67'),'modifiedbyexternalpartyname',_0x5429('0x68'),_0x5429('0x69'),_0x5429('0x6a'),_0x5429('0x6b'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x5429('0x6c'),'msdyn_iotalertname','numberofchildincidents',_0x5429('0x6d'),_0x5429('0x6e'),_0x5429('0x6f'),_0x5429('0x70'),_0x5429('0x71'),_0x5429('0x72'),'primarycontactidname','primarycontactidyominame',_0x5429('0x73'),'productidname','productserialnumber','resolveby',_0x5429('0x74'),_0x5429('0x75'),_0x5429('0x76'),_0x5429('0x77'),_0x5429('0x78'),_0x5429('0x79'),_0x5429('0x7a'),'socialprofileidname',_0x5429('0x7b'),_0x5429('0x7c'),'subjectidname',_0x5429('0x7d'),_0x5429('0x7e'),'transactioncurrencyidname',_0x5429('0x7f'),_0x5429('0x80'),_0x5429('0x81')];var _0x4fe4b7=_0x3b506e[_0x5429('0x82')](_0xcd37c);return db[_0x5429('0x15')][_0x5429('0x36')]({'where':{'id':_0x25697e[_0x5429('0x2d')]['id']},'attributes':['id',_0x5429('0x83'),_0x5429('0x84'),'remoteUri',_0x5429('0x85'),'clientId',_0x5429('0x86'),_0x5429('0x87')],'include':[{'model':db[_0x5429('0x88')],'as':_0x5429('0x88'),'attributes':['id',_0x5429('0x89'),_0x5429('0x8a')]}]})[_0x5429('0xb')](handleEntityNotFound(_0x47a0fb,null))[_0x5429('0xb')](function(_0x1941cf){if(_0x1941cf){if(_0x1941cf[_0x5429('0x87')]){_0x1941cf[_0x5429('0x8b')]=_0x1941cf['CloudProvider'][_0x5429('0x89')];_0x2340be=sanitizeRemoteUri(_0x1941cf['CloudProvider'][_0x5429('0x8a')]);_0xc3185c=getWebApiUrl(_0x2340be);return _0x1941cf;}_0x2340be=sanitizeRemoteUri(_0x1941cf[_0x5429('0x8c')]);_0xc3185c=getWebApiUrl(_0x2340be);var _0x32f987={'method':_0x5429('0x8d'),'uri':_0x5429('0x8e')+_0x1941cf[_0x5429('0x85')]+_0x5429('0x8f'),'form':{'client_id':_0x1941cf['clientId'],'resource':_0x2340be,'username':_0x1941cf[_0x5429('0x83')],'password':_0x1941cf[_0x5429('0x84')],'grant_type':'password','client_secret':_0x1941cf[_0x5429('0x86')]},'json':!![]};return rp(_0x32f987);}})[_0x5429('0xb')](function(_0x5c8acc){_0x5bad86=_0x5c8acc['access_token'];var _0x2ca76f={'method':_0x5429('0x90'),'uri':encodeURI(_0xc3185c+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x39575a+'\x27'),'headers':{'Authorization':_0x5429('0x91')+_0x5bad86,'If-None-Match':null,'OData-Version':_0x5429('0x92')},'json':!![]};return rp(_0x2ca76f);})['then'](function(_0x41386b){var _0x3f1978=_0x41386b[_0x5429('0x93')][0x0];var _0x12494c=_0x3f1978[_0x5429('0x94')];var _0x19b0a4={'method':_0x5429('0x90'),'uri':_0xc3185c+'EntityDefinitions('+_0x12494c+_0x5429('0x95'),'headers':{'Authorization':_0x5429('0x91')+_0x5bad86,'If-None-Match':null,'OData-Version':_0x5429('0x92')},'json':!![]};return rp(_0x19b0a4);})[_0x5429('0xb')](function(_0x360091){_0x9dd77a=_0x360091;_0x4459fa=_0x9dd77a[_0x5429('0x96')];_0x4459fa=_['remove'](_0x4459fa,function(_0x5f2f24){return!_0x4fe4b7[_0x5429('0x97')](_0x5f2f24[_0x5429('0x98')]);});var _0xf3d8b9=[];var _0x202ad5=[];_0x4459fa[_0x5429('0x99')](function(_0x25c531){if(_0x25c531['@odata.type']){var _0x2c12b3=_0x25c531[_0x5429('0x9a')][_0x5429('0x42')](_0x25c531[_0x5429('0x9a')][_0x5429('0x43')]('.')+0x1);if(_0x2c12b3===_0x5429('0x9b')){_0xf3d8b9['push'](getSelectList(_0xc3185c,_0x4c994a,_0x202ad5,_0x9dd77a['MetadataId'],_0x25c531[_0x5429('0x94')],_0x5bad86));}}});return Promise[_0x5429('0x9c')](_0xf3d8b9);})[_0x5429('0xb')](function(_0x596959){_0x2e620b=_0x596959[0x0];var _0x24b422=[];var _0x299a52=[];_0x4459fa['forEach'](function(_0x2e107f){if(!_[_0x5429('0x9d')](_0x2e107f['@odata.type'])){var _0x1c6f6e=_0x2e107f[_0x5429('0x9a')]['substring'](_0x2e107f[_0x5429('0x9a')][_0x5429('0x43')]('.')+0x1);if(_0x1c6f6e==='BooleanAttributeMetadata'){_0x24b422['push'](getBooleanList(_0xc3185c,_0x4c994a,_0x299a52,_0x9dd77a[_0x5429('0x94')],_0x2e107f[_0x5429('0x94')],_0x5bad86));}}});return Promise[_0x5429('0x9c')](_0x24b422);})['then'](function(_0xc7d275){_0x417b6d=_0xc7d275[0x0];var _0x3b0009=[];var _0x34fd92=[];_0x4459fa[_0x5429('0x99')](function(_0x491e0e){if(_0x491e0e[_0x5429('0x9a')]){var _0x234799=_0x491e0e[_0x5429('0x9a')][_0x5429('0x42')](_0x491e0e[_0x5429('0x9a')][_0x5429('0x43')]('.')+0x1);if(_0x234799===_0x5429('0x9e')||_0x234799===_0x5429('0x9f')||_0x234799===_0x5429('0xa0')||_0x234799===_0x5429('0xa1')||_0x234799===_0x5429('0xa2')||_0x234799===_0x5429('0xa3')||_0x234799==='StatusAttributeMetadata'||_0x234799===_0x5429('0xa4')||_0x234799===_0x5429('0xa5')||_0x234799==='DecimalAttributeMetadata'){_0x3b0009[_0x5429('0xa6')](getInputList(_0xc3185c,_0x4c994a,_0x234799,_0x34fd92,_0x9dd77a[_0x5429('0x94')],_0x491e0e[_0x5429('0x94')],_0x5bad86));}}});return Promise[_0x5429('0x9c')](_0x3b0009);})[_0x5429('0xb')](function(_0xf78759){_0x2abb78=_0xf78759[0x0];var _0x5b9962=_0x2e620b[_0x5429('0x82')](_0x417b6d)['concat'](_0x2abb78);var _0x293b1={'count':_0x5b9962[_0x5429('0x1e')],'rows':_0x5b9962};return _0x293b1;})['then'](respondWithResult(_0x47a0fb,null))['catch'](function(_0xeb04d6){var _0x4fa408=_0x25697e['query'][_0x5429('0xa7')]?0x1f4:_0xeb04d6['statusCode']||0x1f4;logger['error'](_0xeb04d6[_0x5429('0xf')]);delete _0xeb04d6[_0x5429('0x10')];if(_0x4fa408===0x191){_0x4fa408=0x190;}_0x47a0fb[_0x5429('0x11')](_0x4fa408)[_0x5429('0x12')](_0x25697e[_0x5429('0x1a')][_0x5429('0xa7')]?{'message':_0x5429('0xa8'),'statusCode':_0xeb04d6['statusCode']}:_0xeb04d6);});};function getSelectList(_0x18c903,_0x4a55c5,_0x24bf7f,_0x287614,_0x3a810e,_0x3c0730){var _0x1e7407={'method':_0x5429('0x90'),'uri':_0x18c903+_0x5429('0xa9')+_0x287614+_0x5429('0xaa')+_0x3a810e+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x5429('0x91')+_0x3c0730,'If-None-Match':null,'OData-Version':_0x5429('0x92')},'json':!![]};return rp(_0x1e7407)[_0x5429('0xb')](function(_0x494706){var _0x12f9dc=[];var _0xb0bd9c=_0x494706[_0x5429('0xab')][_0x5429('0xac')];_0xb0bd9c[_0x5429('0x99')](function(_0x1c1372){_0x12f9dc[_0x5429('0xa6')]({'name':_0x1c1372[_0x5429('0xad')][_0x5429('0xae')][_0x5429('0xad')],'value':String(_0x1c1372[_0x5429('0xaf')])});});var _0x731288={'id':_0x4a55c5+'_'+_0x494706[_0x5429('0x98')],'name':_0x494706['DisplayName'][_0x5429('0xae')][_0x5429('0xad')],'custom':![],'options':_0x12f9dc};_0x24bf7f[_0x5429('0xa6')](_0x731288);return _0x24bf7f;});}function getBooleanList(_0x4eb2ac,_0x36ae3e,_0x2ea14d,_0x2efc15,_0x4c10dc,_0x47a7ab){var _0x339deb={'method':_0x5429('0x90'),'uri':_0x4eb2ac+_0x5429('0xa9')+_0x2efc15+_0x5429('0xaa')+_0x4c10dc+_0x5429('0xb0'),'headers':{'Authorization':_0x5429('0x91')+_0x47a7ab,'If-None-Match':null,'OData-Version':_0x5429('0x92')},'json':!![]};return rp(_0x339deb)['then'](function(_0xa6d32b){var _0x455907=[];_0x455907['push']({'name':_0xa6d32b[_0x5429('0xab')][_0x5429('0xb1')][_0x5429('0xad')][_0x5429('0xae')]['Label'],'value':_0x5429('0xb2')},{'name':_0xa6d32b[_0x5429('0xab')]['FalseOption'][_0x5429('0xad')][_0x5429('0xae')][_0x5429('0xad')],'value':_0x5429('0xb3')});var _0x707728={'id':_0x36ae3e+'_'+_0xa6d32b[_0x5429('0x98')],'name':_0xa6d32b['DisplayName'][_0x5429('0xae')]['Label'],'custom':![],'options':_0x455907};_0x2ea14d[_0x5429('0xa6')](_0x707728);return _0x2ea14d;});}function getInputList(_0x5846c1,_0x5dd356,_0x28cde9,_0x3275de,_0x136444,_0x3215d9,_0x9833ad){var _0x5cd2c6={'method':_0x5429('0x90'),'uri':_0x5846c1+_0x5429('0xa9')+_0x136444+_0x5429('0xaa')+_0x3215d9+_0x5429('0xb4')+_0x28cde9+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x9833ad,'If-None-Match':null,'OData-Version':_0x5429('0x92')},'json':!![]};return rp(_0x5cd2c6)[_0x5429('0xb')](function(_0x46decb){var _0x3f7622={'id':_0x5dd356+'_'+_0x46decb['LogicalName'],'name':_0x46decb[_0x5429('0xb5')][_0x5429('0xae')]?_0x46decb[_0x5429('0xb5')][_0x5429('0xae')][_0x5429('0xad')]:_0x46decb['LogicalName'],'custom':![],'options':[]};_0x3275de[_0x5429('0xa6')](_0x3f7622);return _0x3275de;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index cf5e90d..4e68c83 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x31e887,_0x1e7095){var _0x2badd7=function(_0x1412aa){while(--_0x1412aa){_0x31e887['push'](_0x31e887['shift']());}};_0x2badd7(++_0x1e7095);}(_0x757a,0xde));var _0xa757=function(_0x5ab7b4,_0x937ba6){_0x5ab7b4=_0x5ab7b4-0x0;var _0x53ebcf=_0x757a[_0x5ab7b4];return _0x53ebcf;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e53ad,_0x2368ec){var _0x1a0bf2=function(_0x1828ca){while(--_0x1828ca){_0x1e53ad['push'](_0x1e53ad['shift']());}};_0x1a0bf2(++_0x2368ec);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 39cf112..b5aaa0c 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 _0x4693=['jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','ShowDynamics365Account','find','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x571d1c,_0x47d13f){var _0xfc3194=function(_0x4cadfe){while(--_0x4cadfe){_0x571d1c['push'](_0x571d1c['shift']());}};_0xfc3194(++_0x47d13f);}(_0x4693,0x109));var _0x3469=function(_0x3ab8ac,_0x537fa9){_0x3ab8ac=_0x3ab8ac-0x0;var _0xe3714=_0x4693[_0x3ab8ac];return _0xe3714;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3469('0x0'));var rs=require(_0x3469('0x1'));var fs=require('fs');var Redis=require(_0x3469('0x2'));var db=require(_0x3469('0x3'))['db'];var utils=require(_0x3469('0x4'));var logger=require(_0x3469('0x5'))(_0x3469('0x6'));var config=require('../../config/environment');var jayson=require(_0x3469('0x7'));var client=jayson[_0x3469('0x8')][_0x3469('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56bdc3,_0x246997,_0x5dc64b){return new BPromise(function(_0x3c965f,_0x485081){return client[_0x3469('0xa')](_0x56bdc3,_0x5dc64b)[_0x3469('0xb')](function(_0x2b27f5){logger['info'](_0x3469('0xc'),_0x246997,_0x3469('0xd'));logger['debug'](_0x3469('0xe'),_0x246997,_0x3469('0xd'),JSON['stringify'](_0x2b27f5));if(_0x2b27f5[_0x3469('0xf')]){if(_0x2b27f5[_0x3469('0xf')][_0x3469('0x10')]===0x1f4){logger[_0x3469('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x246997,_0x2b27f5[_0x3469('0xf')][_0x3469('0x11')]);return _0x485081(_0x2b27f5['error'][_0x3469('0x11')]);}logger['error'](_0x3469('0xc'),_0x246997,_0x2b27f5[_0x3469('0xf')][_0x3469('0x11')]);return _0x3c965f(_0x2b27f5['error'][_0x3469('0x11')]);}else{logger[_0x3469('0x12')](_0x3469('0xc'),_0x246997,'request\x20sent');_0x3c965f(_0x2b27f5['result'][_0x3469('0x11')]);}})[_0x3469('0x13')](function(_0x3ce63d){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x246997,_0x3ce63d);_0x485081(_0x3ce63d);});});}exports[_0x3469('0x14')]=function(_0x58f42d){var _0x226932=this;return new Promise(function(_0x2ab7c6,_0x6df6d3){return db[_0x3469('0x15')][_0x3469('0x16')]({'raw':_0x58f42d['options']?_0x58f42d[_0x3469('0x17')][_0x3469('0x18')]===undefined?!![]:![]:!![],'where':_0x58f42d[_0x3469('0x17')]?_0x58f42d[_0x3469('0x17')][_0x3469('0x19')]||null:null,'attributes':_0x58f42d[_0x3469('0x17')]?_0x58f42d[_0x3469('0x17')][_0x3469('0x1a')]||null:null,'limit':_0x58f42d[_0x3469('0x17')]?_0x58f42d[_0x3469('0x17')][_0x3469('0x1b')]||null:null,'include':_0x58f42d[_0x3469('0x17')]?_0x58f42d[_0x3469('0x17')][_0x3469('0x1c')]?_[_0x3469('0x1d')](_0x58f42d['options'][_0x3469('0x1c')],function(_0x168f16){return{'model':db[_0x168f16['model']],'as':_0x168f16['as'],'attributes':_0x168f16[_0x3469('0x1a')],'include':_0x168f16['include']?_[_0x3469('0x1d')](_0x168f16[_0x3469('0x1c')],function(_0x6a88d9){return{'model':db[_0x6a88d9[_0x3469('0x1e')]],'as':_0x6a88d9['as'],'attributes':_0x6a88d9['attributes'],'include':_0x6a88d9['include']?_['map'](_0x6a88d9[_0x3469('0x1c')],function(_0x3b319c){return{'model':db[_0x3b319c['model']],'as':_0x3b319c['as'],'attributes':_0x3b319c[_0x3469('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3469('0xb')](function(_0x43ede1){logger[_0x3469('0x12')](_0x3469('0x14'),_0x58f42d);logger['debug'](_0x3469('0x14'),_0x58f42d,JSON['stringify'](_0x43ede1));_0x2ab7c6(_0x43ede1);})[_0x3469('0x13')](function(_0x1a5730){logger[_0x3469('0xf')](_0x3469('0x14'),_0x1a5730[_0x3469('0x11')],_0x58f42d);_0x6df6d3(_0x226932['error'](0x1f4,_0x1a5730[_0x3469('0x11')]));});});};exports[_0x3469('0x1f')]=function(_0x379e57){var _0x41f351=this;return new Promise(function(_0x76eeef,_0x25d88b){return db[_0x3469('0x15')][_0x3469('0x20')]({'raw':_0x379e57[_0x3469('0x17')]?_0x379e57[_0x3469('0x17')][_0x3469('0x18')]===undefined?!![]:![]:!![],'where':_0x379e57['options']?_0x379e57[_0x3469('0x17')][_0x3469('0x19')]||null:null,'attributes':_0x379e57[_0x3469('0x17')]?_0x379e57[_0x3469('0x17')]['attributes']||null:null,'include':_0x379e57[_0x3469('0x17')]?_0x379e57[_0x3469('0x17')][_0x3469('0x1c')]?_[_0x3469('0x1d')](_0x379e57[_0x3469('0x17')][_0x3469('0x1c')],function(_0x37670c){return{'model':db[_0x37670c[_0x3469('0x1e')]],'as':_0x37670c['as'],'attributes':_0x37670c[_0x3469('0x1a')],'include':_0x37670c[_0x3469('0x1c')]?_['map'](_0x37670c[_0x3469('0x1c')],function(_0x545c87){return{'model':db[_0x545c87[_0x3469('0x1e')]],'as':_0x545c87['as'],'attributes':_0x545c87[_0x3469('0x1a')],'include':_0x545c87[_0x3469('0x1c')]?_[_0x3469('0x1d')](_0x545c87['include'],function(_0x2f504f){return{'model':db[_0x2f504f[_0x3469('0x1e')]],'as':_0x2f504f['as'],'attributes':_0x2f504f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3469('0xb')](function(_0x5e9be9){logger['info']('ShowDynamics365Account',_0x379e57);logger['debug'](_0x3469('0x1f'),_0x379e57,JSON[_0x3469('0x21')](_0x5e9be9));_0x76eeef(_0x5e9be9);})[_0x3469('0x13')](function(_0x55c67d){logger[_0x3469('0xf')]('ShowDynamics365Account',_0x55c67d['message'],_0x379e57);_0x25d88b(_0x41f351[_0x3469('0xf')](0x1f4,_0x55c67d[_0x3469('0x11')]));});});}; \ No newline at end of file +var _0x19ec=['error','code','message','request\x20sent','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','map','include','model','ShowDynamics365Account','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x1695e0,_0x36877e){var _0x490ad8=function(_0x176424){while(--_0x176424){_0x1695e0['push'](_0x1695e0['shift']());}};_0x490ad8(++_0x36877e);}(_0x19ec,0x1d1));var _0xc19e=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x19ec[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xc19e('0x0'));var util=require('util');var moment=require(_0xc19e('0x1'));var BPromise=require('bluebird');var rs=require(_0xc19e('0x2'));var fs=require('fs');var Redis=require(_0xc19e('0x3'));var db=require(_0xc19e('0x4'))['db'];var utils=require(_0xc19e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc19e('0x6'));var jayson=require(_0xc19e('0x7'));var client=jayson['client'][_0xc19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x100c9a,_0x426591,_0x429c28){return new BPromise(function(_0x1741c3,_0x1b58aa){return client[_0xc19e('0x9')](_0x100c9a,_0x429c28)[_0xc19e('0xa')](function(_0x592a35){logger[_0xc19e('0xb')](_0xc19e('0xc'),_0x426591,'request\x20sent');logger[_0xc19e('0xd')](_0xc19e('0xe'),_0x426591,'request\x20sent',JSON['stringify'](_0x592a35));if(_0x592a35[_0xc19e('0xf')]){if(_0x592a35[_0xc19e('0xf')][_0xc19e('0x10')]===0x1f4){logger[_0xc19e('0xf')](_0xc19e('0xc'),_0x426591,_0x592a35[_0xc19e('0xf')][_0xc19e('0x11')]);return _0x1b58aa(_0x592a35[_0xc19e('0xf')]['message']);}logger['error'](_0xc19e('0xc'),_0x426591,_0x592a35[_0xc19e('0xf')][_0xc19e('0x11')]);return _0x1741c3(_0x592a35[_0xc19e('0xf')]['message']);}else{logger[_0xc19e('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x426591,_0xc19e('0x12'));_0x1741c3(_0x592a35[_0xc19e('0x13')][_0xc19e('0x11')]);}})[_0xc19e('0x14')](function(_0x543d6d){logger[_0xc19e('0xf')](_0xc19e('0xc'),_0x426591,_0x543d6d);_0x1b58aa(_0x543d6d);});});}exports[_0xc19e('0x15')]=function(_0x516edc){var _0x54db2d=this;return new Promise(function(_0x2b6552,_0x10eea5){return db['Dynamics365Account'][_0xc19e('0x16')]({'raw':_0x516edc['options']?_0x516edc[_0xc19e('0x17')][_0xc19e('0x18')]===undefined?!![]:![]:!![],'where':_0x516edc[_0xc19e('0x17')]?_0x516edc[_0xc19e('0x17')][_0xc19e('0x19')]||null:null,'attributes':_0x516edc[_0xc19e('0x17')]?_0x516edc['options'][_0xc19e('0x1a')]||null:null,'limit':_0x516edc['options']?_0x516edc[_0xc19e('0x17')]['limit']||null:null,'include':_0x516edc['options']?_0x516edc[_0xc19e('0x17')]['include']?_[_0xc19e('0x1b')](_0x516edc[_0xc19e('0x17')][_0xc19e('0x1c')],function(_0x5c29f0){return{'model':db[_0x5c29f0['model']],'as':_0x5c29f0['as'],'attributes':_0x5c29f0[_0xc19e('0x1a')],'include':_0x5c29f0[_0xc19e('0x1c')]?_[_0xc19e('0x1b')](_0x5c29f0[_0xc19e('0x1c')],function(_0x2dd2e2){return{'model':db[_0x2dd2e2[_0xc19e('0x1d')]],'as':_0x2dd2e2['as'],'attributes':_0x2dd2e2[_0xc19e('0x1a')],'include':_0x2dd2e2[_0xc19e('0x1c')]?_[_0xc19e('0x1b')](_0x2dd2e2[_0xc19e('0x1c')],function(_0x406c06){return{'model':db[_0x406c06['model']],'as':_0x406c06['as'],'attributes':_0x406c06[_0xc19e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc19e('0xa')](function(_0x4702d6){logger[_0xc19e('0xb')](_0xc19e('0x15'),_0x516edc);logger[_0xc19e('0xd')](_0xc19e('0x15'),_0x516edc,JSON['stringify'](_0x4702d6));_0x2b6552(_0x4702d6);})['catch'](function(_0x105aaa){logger['error'](_0xc19e('0x15'),_0x105aaa[_0xc19e('0x11')],_0x516edc);_0x10eea5(_0x54db2d[_0xc19e('0xf')](0x1f4,_0x105aaa[_0xc19e('0x11')]));});});};exports[_0xc19e('0x1e')]=function(_0x5c9ee0){var _0x5e9a7e=this;return new Promise(function(_0x110043,_0x3f3f35){return db['Dynamics365Account']['find']({'raw':_0x5c9ee0[_0xc19e('0x17')]?_0x5c9ee0[_0xc19e('0x17')][_0xc19e('0x18')]===undefined?!![]:![]:!![],'where':_0x5c9ee0[_0xc19e('0x17')]?_0x5c9ee0['options'][_0xc19e('0x19')]||null:null,'attributes':_0x5c9ee0[_0xc19e('0x17')]?_0x5c9ee0[_0xc19e('0x17')][_0xc19e('0x1a')]||null:null,'include':_0x5c9ee0['options']?_0x5c9ee0[_0xc19e('0x17')][_0xc19e('0x1c')]?_[_0xc19e('0x1b')](_0x5c9ee0[_0xc19e('0x17')][_0xc19e('0x1c')],function(_0x3c07be){return{'model':db[_0x3c07be[_0xc19e('0x1d')]],'as':_0x3c07be['as'],'attributes':_0x3c07be['attributes'],'include':_0x3c07be[_0xc19e('0x1c')]?_['map'](_0x3c07be[_0xc19e('0x1c')],function(_0x38ed06){return{'model':db[_0x38ed06[_0xc19e('0x1d')]],'as':_0x38ed06['as'],'attributes':_0x38ed06['attributes'],'include':_0x38ed06[_0xc19e('0x1c')]?_['map'](_0x38ed06[_0xc19e('0x1c')],function(_0x5b54f9){return{'model':db[_0x5b54f9['model']],'as':_0x5b54f9['as'],'attributes':_0x5b54f9[_0xc19e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc19e('0xa')](function(_0x1aac5c){logger[_0xc19e('0xb')]('ShowDynamics365Account',_0x5c9ee0);logger[_0xc19e('0xd')](_0xc19e('0x1e'),_0x5c9ee0,JSON[_0xc19e('0x1f')](_0x1aac5c));_0x110043(_0x1aac5c);})[_0xc19e('0x14')](function(_0x157cb8){logger[_0xc19e('0xf')](_0xc19e('0x1e'),_0x157cb8[_0xc19e('0x11')],_0x5c9ee0);_0x3f3f35(_0x5e9a7e[_0xc19e('0xf')](0x1f4,_0x157cb8['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0ab1d95..0a504b6 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 _0x191b=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x5b3084,_0x3b0016){var _0x2459f4=function(_0x9aff5a){while(--_0x9aff5a){_0x5b3084['push'](_0x5b3084['shift']());}};_0x2459f4(++_0x3b0016);}(_0x191b,0x100));var _0xb191=function(_0x4a79cb,_0x141b1f){_0x4a79cb=_0x4a79cb-0x0;var _0x351310=_0x191b[_0x4a79cb];return _0x351310;};'use strict';var multer=require('multer');var util=require(_0xb191('0x0'));var path=require(_0xb191('0x1'));var timeout=require(_0xb191('0x2'));var express=require(_0xb191('0x3'));var router=express[_0xb191('0x4')]();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('./intDynamics365Configuration.controller');router[_0xb191('0x5')]('/',auth[_0xb191('0x6')](),controller[_0xb191('0x7')]);router[_0xb191('0x5')](_0xb191('0x8'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb191('0x9'),auth[_0xb191('0x6')](),controller['getFields']);router[_0xb191('0x5')](_0xb191('0xa'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xb191('0x5')](_0xb191('0xb'),auth['isAuthenticated'](),controller[_0xb191('0xc')]);router[_0xb191('0xd')]('/',auth[_0xb191('0x6')](),controller[_0xb191('0xe')]);router['put'](_0xb191('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xb191('0xf')](_0xb191('0x8'),auth['isAuthenticated'](),controller[_0xb191('0x10')]);module[_0xb191('0x11')]=router; \ No newline at end of file +var _0xe66d=['isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/fields','/:id/subjects'];(function(_0x593fb2,_0xa8e21a){var _0x4b4ace=function(_0x537dcb){while(--_0x537dcb){_0x593fb2['push'](_0x593fb2['shift']());}};_0x4b4ace(++_0xa8e21a);}(_0xe66d,0x14b));var _0xde66=function(_0x8c318b,_0x309481){_0x8c318b=_0x8c318b-0x0;var _0x3c000a=_0xe66d[_0x8c318b];return _0x3c000a;};'use strict';var multer=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var path=require('path');var timeout=require(_0xde66('0x2'));var express=require(_0xde66('0x3'));var router=express[_0xde66('0x4')]();var fs_extra=require(_0xde66('0x5'));var auth=require(_0xde66('0x6'));var interaction=require(_0xde66('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xde66('0x8')]('/',auth['isAuthenticated'](),controller[_0xde66('0x9')]);router[_0xde66('0x8')](_0xde66('0xa'),auth['isAuthenticated'](),controller[_0xde66('0xb')]);router['get'](_0xde66('0xc'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0xde66('0xd'),auth[_0xde66('0xe')](),controller[_0xde66('0xf')]);router[_0xde66('0x8')](_0xde66('0x10'),auth[_0xde66('0xe')](),controller[_0xde66('0x11')]);router['post']('/',auth[_0xde66('0xe')](),controller[_0xde66('0x12')]);router[_0xde66('0x13')](_0xde66('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xde66('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xde66('0x15')]);module[_0xde66('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 87de0ae..aaba870 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 _0x758b=['incident','nothing','contact','sequelize','exports','STRING','ENUM','phonecall'];(function(_0x5a4b5a,_0x16af6e){var _0x2f57bf=function(_0x3215d7){while(--_0x3215d7){_0x5a4b5a['push'](_0x5a4b5a['shift']());}};_0x2f57bf(++_0x16af6e);}(_0x758b,0x193));var _0xb758=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x758b[_0x50cd41];return _0x399475;};'use strict';var Sequelize=require(_0xb758('0x0'));module[_0xb758('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb758('0x2')]},'ticketType':{'type':Sequelize[_0xb758('0x3')]('incident',_0xb758('0x4')),'defaultValue':_0xb758('0x5')},'moduleCreate':{'type':Sequelize[_0xb758('0x3')]('contact',_0xb758('0x6')),'defaultValue':_0xb758('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb758('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7fcc=['contact','STRING','sequelize','exports','phonecall','incident','nothing'];(function(_0x1c4e39,_0x5d1a39){var _0x3a6ec9=function(_0x216220){while(--_0x216220){_0x1c4e39['push'](_0x1c4e39['shift']());}};_0x3a6ec9(++_0x5d1a39);}(_0x7fcc,0x1b4));var _0xc7fc=function(_0x1b9d51,_0x287a86){_0x1b9d51=_0x1b9d51-0x0;var _0x4bf724=_0x7fcc[_0x1b9d51];return _0x4bf724;};'use strict';var Sequelize=require(_0xc7fc('0x0'));module[_0xc7fc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM']('incident',_0xc7fc('0x2')),'defaultValue':_0xc7fc('0x3')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0xc7fc('0x4')),'defaultValue':_0xc7fc('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xc7fc('0x6')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ab0f74d..d00fdfc 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 _0x995b=['limit','count','set','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getFields','findOne','Dynamics365Field','rawAttributes','pick','getSubjects','getDescriptions','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x341f63,_0x491005){var _0x29e86e=function(_0x2cd220){while(--_0x2cd220){_0x341f63['push'](_0x341f63['shift']());}};_0x29e86e(++_0x491005);}(_0x995b,0x1be));var _0xb995=function(_0x514b25,_0x2cd248){_0x514b25=_0x514b25-0x0;var _0x21eee5=_0x995b[_0x514b25];return _0x21eee5;};'use strict';var emlformat=require(_0xb995('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb995('0x1'));var jsonpatch=require(_0xb995('0x2'));var rp=require('request-promise');var moment=require(_0xb995('0x3'));var BPromise=require(_0xb995('0x4'));var Mustache=require(_0xb995('0x5'));var util=require('util');var path=require(_0xb995('0x6'));var sox=require(_0xb995('0x7'));var csv=require(_0xb995('0x8'));var ejs=require(_0xb995('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb995('0xa'));var squel=require(_0xb995('0xb'));var crypto=require(_0xb995('0xc'));var jsforce=require(_0xb995('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb995('0x8'));var querystring=require(_0xb995('0xe'));var Papa=require(_0xb995('0xf'));var Redis=require('ioredis');var authService=require(_0xb995('0x10'));var qs=require(_0xb995('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb995('0x12'))(_0xb995('0x13'));var utils=require(_0xb995('0x14'));var config=require(_0xb995('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb995('0x16'))['db'];function respondWithStatusCode(_0x11dce5,_0x223dbc){_0x223dbc=_0x223dbc||0xcc;return function(_0x325474){if(_0x325474){return _0x11dce5[_0xb995('0x17')](_0x223dbc);}return _0x11dce5[_0xb995('0x18')](_0x223dbc)[_0xb995('0x19')]();};}function respondWithResult(_0x15286b,_0x9f990e){_0x9f990e=_0x9f990e||0xc8;return function(_0x175325){if(_0x175325){return _0x15286b['status'](_0x9f990e)['json'](_0x175325);}};}function respondWithFilteredResult(_0x237f7c,_0xe59d12){return function(_0x244b99){if(_0x244b99){var _0x5e950d=typeof _0xe59d12[_0xb995('0x1a')]===_0xb995('0x1b')&&typeof _0xe59d12[_0xb995('0x1c')]===_0xb995('0x1b');var _0x14fbbd=_0x244b99[_0xb995('0x1d')];var _0x42bcfa=_0x5e950d?0x0:_0xe59d12['offset'];var _0x1a36a5=_0x5e950d?_0x244b99['count']:_0xe59d12[_0xb995('0x1a')]+_0xe59d12[_0xb995('0x1c')];var _0x584299;if(_0x1a36a5>=_0x14fbbd){_0x1a36a5=_0x14fbbd;_0x584299=0xc8;}else{_0x584299=0xce;}_0x237f7c[_0xb995('0x18')](_0x584299);return _0x237f7c[_0xb995('0x1e')]('Content-Range',_0x42bcfa+'-'+_0x1a36a5+'/'+_0x14fbbd)['json'](_0x244b99);}return null;};}function patchUpdates(_0x194f57){return function(_0x36dd60){try{jsonpatch['apply'](_0x36dd60,_0x194f57,!![]);}catch(_0x1cb571){return BPromise[_0xb995('0x1f')](_0x1cb571);}return _0x36dd60[_0xb995('0x20')]();};}function saveUpdates(_0x58f7fc,_0xabbe14){return function(_0x44ad49){if(_0x44ad49){return _0x44ad49[_0xb995('0x21')](_0x58f7fc)['then'](function(_0x344abe){return _0x344abe;});}return null;};}function removeEntity(_0x2eac11,_0x386f46){return function(_0x50eee3){if(_0x50eee3){return _0x50eee3['destroy']()[_0xb995('0x22')](function(){_0x2eac11[_0xb995('0x18')](0xcc)[_0xb995('0x19')]();});}};}function handleEntityNotFound(_0x9be492,_0x2007b4){return function(_0x4afc34){if(!_0x4afc34){_0x9be492[_0xb995('0x17')](0x194);}return _0x4afc34;};}function handleError(_0x11b80c,_0x4d91db){_0x4d91db=_0x4d91db||0x1f4;return function(_0x2c478f){logger[_0xb995('0x23')](_0x2c478f[_0xb995('0x24')]);if(_0x2c478f[_0xb995('0x25')]){delete _0x2c478f[_0xb995('0x25')];}_0x11b80c[_0xb995('0x18')](_0x4d91db)[_0xb995('0x26')](_0x2c478f);};}exports[_0xb995('0x27')]=function(_0x2743b2,_0x1ee3f5){var _0x50ff51={},_0x4b9d0d={},_0x80fdb4={'count':0x0,'rows':[]};var _0x2a15e3=_[_0xb995('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0xb430eb){return{'name':_0xb430eb[_0xb995('0x29')],'type':_0xb430eb[_0xb995('0x2a')][_0xb995('0x2b')]};});_0x4b9d0d[_0xb995('0x2c')]=_['map'](_0x2a15e3,_0xb995('0x25'));_0x4b9d0d['query']=_[_0xb995('0x2d')](_0x2743b2[_0xb995('0x2e')]);_0x4b9d0d['filters']=_[_0xb995('0x2f')](_0x4b9d0d[_0xb995('0x2c')],_0x4b9d0d['query']);_0x50ff51[_0xb995('0x30')]=_['intersection'](_0x4b9d0d[_0xb995('0x2c')],qs['fields'](_0x2743b2[_0xb995('0x2e')][_0xb995('0x31')]));_0x50ff51[_0xb995('0x30')]=_0x50ff51[_0xb995('0x30')][_0xb995('0x32')]?_0x50ff51[_0xb995('0x30')]:_0x4b9d0d[_0xb995('0x2c')];if(!_0x2743b2[_0xb995('0x2e')][_0xb995('0x33')]('nolimit')){_0x50ff51['limit']=qs[_0xb995('0x1c')](_0x2743b2[_0xb995('0x2e')][_0xb995('0x1c')]);_0x50ff51['offset']=qs[_0xb995('0x1a')](_0x2743b2[_0xb995('0x2e')][_0xb995('0x1a')]);}_0x50ff51[_0xb995('0x34')]=qs[_0xb995('0x35')](_0x2743b2[_0xb995('0x2e')][_0xb995('0x35')]);_0x50ff51[_0xb995('0x36')]=qs[_0xb995('0x37')](_['pick'](_0x2743b2[_0xb995('0x2e')],_0x4b9d0d[_0xb995('0x37')]),_0x2a15e3);if(_0x2743b2[_0xb995('0x2e')][_0xb995('0x38')]){_0x50ff51[_0xb995('0x36')]=_[_0xb995('0x39')](_0x50ff51['where'],{'$or':_[_0xb995('0x28')](_0x2a15e3,function(_0x58f322){if(_0x58f322['type']!==_0xb995('0x3a')){var _0x3f5adb={};_0x3f5adb[_0x58f322[_0xb995('0x25')]]={'$like':'%'+_0x2743b2[_0xb995('0x2e')][_0xb995('0x38')]+'%'};return _0x3f5adb;}})});}_0x50ff51=_['merge']({},_0x50ff51,_0x2743b2[_0xb995('0x3b')]);var _0x41ab50={'where':_0x50ff51[_0xb995('0x36')]};return db[_0xb995('0x3c')][_0xb995('0x1d')](_0x41ab50)['then'](function(_0x9c2a85){_0x80fdb4[_0xb995('0x1d')]=_0x9c2a85;if(_0x2743b2[_0xb995('0x2e')][_0xb995('0x3d')]){_0x50ff51[_0xb995('0x3e')]=[{'all':!![]}];}return db[_0xb995('0x3c')][_0xb995('0x3f')](_0x50ff51);})['then'](function(_0xf27a9c){_0x80fdb4[_0xb995('0x40')]=_0xf27a9c;return _0x80fdb4;})[_0xb995('0x22')](respondWithFilteredResult(_0x1ee3f5,_0x50ff51))[_0xb995('0x41')](handleError(_0x1ee3f5,null));};exports['show']=function(_0x2bd4ab,_0x14d071){var _0x25d04d={'raw':![],'where':{'id':_0x2bd4ab[_0xb995('0x42')]['id']}},_0x1c9417={};_0x1c9417[_0xb995('0x2c')]=_[_0xb995('0x2d')](db[_0xb995('0x3c')]['rawAttributes']);_0x1c9417[_0xb995('0x2e')]=_[_0xb995('0x2d')](_0x2bd4ab[_0xb995('0x2e')]);_0x1c9417[_0xb995('0x37')]=_[_0xb995('0x2f')](_0x1c9417[_0xb995('0x2c')],_0x1c9417[_0xb995('0x2e')]);_0x25d04d['attributes']=_[_0xb995('0x2f')](_0x1c9417['model'],qs[_0xb995('0x31')](_0x2bd4ab['query'][_0xb995('0x31')]));_0x25d04d[_0xb995('0x30')]=_0x25d04d['attributes'][_0xb995('0x32')]?_0x25d04d[_0xb995('0x30')]:_0x1c9417[_0xb995('0x2c')];if(_0x2bd4ab[_0xb995('0x2e')][_0xb995('0x3d')]){_0x25d04d[_0xb995('0x3e')]=[{'all':!![]}];}_0x25d04d=_[_0xb995('0x39')]({},_0x25d04d,_0x2bd4ab['options']);return db[_0xb995('0x3c')][_0xb995('0x43')](_0x25d04d)[_0xb995('0x22')](handleEntityNotFound(_0x14d071,null))['then'](respondWithResult(_0x14d071,null))[_0xb995('0x41')](handleError(_0x14d071,null));};exports['create']=function(_0xb6e345,_0xe12540){return db[_0xb995('0x3c')][_0xb995('0x44')](_0xb6e345[_0xb995('0x45')],{})[_0xb995('0x22')](respondWithResult(_0xe12540,0xc9))[_0xb995('0x41')](handleError(_0xe12540,null));};exports[_0xb995('0x21')]=function(_0x27a060,_0x27bb1e){if(_0x27a060[_0xb995('0x45')]['id']){delete _0x27a060[_0xb995('0x45')]['id'];}return db[_0xb995('0x3c')][_0xb995('0x43')]({'where':{'id':_0x27a060[_0xb995('0x42')]['id']}})[_0xb995('0x22')](handleEntityNotFound(_0x27bb1e,null))[_0xb995('0x22')](saveUpdates(_0x27a060[_0xb995('0x45')],null))[_0xb995('0x22')](respondWithResult(_0x27bb1e,null))[_0xb995('0x41')](handleError(_0x27bb1e,null));};exports[_0xb995('0x46')]=function(_0x4c9e65,_0x72f1a4){return db[_0xb995('0x3c')][_0xb995('0x43')]({'where':{'id':_0x4c9e65[_0xb995('0x42')]['id']}})[_0xb995('0x22')](handleEntityNotFound(_0x72f1a4,null))[_0xb995('0x22')](removeEntity(_0x72f1a4,null))[_0xb995('0x41')](handleError(_0x72f1a4,null));};exports[_0xb995('0x47')]=function(_0x1ba7dd,_0x3502ba,_0x2e3673){var _0x2f0e32={};var _0x2f0390={};var _0x131c32;var _0x56c545;return db[_0xb995('0x3c')][_0xb995('0x48')]({'where':{'id':_0x1ba7dd[_0xb995('0x42')]['id']}})[_0xb995('0x22')](handleEntityNotFound(_0x3502ba,null))[_0xb995('0x22')](function(_0x1becb4){if(_0x1becb4){_0x131c32=_0x1becb4;_0x2f0390[_0xb995('0x2c')]=_[_0xb995('0x2d')](db[_0xb995('0x49')]['rawAttributes']);_0x2f0390[_0xb995('0x2e')]=_['keys'](_0x1ba7dd[_0xb995('0x2e')]);_0x2f0390[_0xb995('0x37')]=_['intersection'](_0x2f0390[_0xb995('0x2c')],_0x2f0390[_0xb995('0x2e')]);_0x2f0e32[_0xb995('0x30')]=_['intersection'](_0x2f0390[_0xb995('0x2c')],qs[_0xb995('0x31')](_0x1ba7dd[_0xb995('0x2e')]['fields']));_0x2f0e32[_0xb995('0x30')]=_0x2f0e32[_0xb995('0x30')]['length']?_0x2f0e32[_0xb995('0x30')]:_0x2f0390[_0xb995('0x2c')];_0x2f0e32[_0xb995('0x34')]=qs[_0xb995('0x35')](_0x1ba7dd[_0xb995('0x2e')][_0xb995('0x35')]);_0x2f0e32['where']=qs['filters'](_['pick'](_0x1ba7dd['query'],_0x2f0390[_0xb995('0x37')]));if(_0x1ba7dd[_0xb995('0x2e')][_0xb995('0x38')]){_0x2f0e32['where']=_[_0xb995('0x39')](_0x2f0e32[_0xb995('0x36')],{'$or':_[_0xb995('0x28')](_0x2f0e32['attributes'],function(_0x448dae){var _0x4d9aca={};_0x4d9aca[_0x448dae]={'$like':'%'+_0x1ba7dd[_0xb995('0x2e')]['filter']+'%'};return _0x4d9aca;})});}_0x2f0e32=_[_0xb995('0x39')]({},_0x2f0e32,_0x1ba7dd[_0xb995('0x3b')]);return _0x131c32[_0xb995('0x47')](_0x2f0e32);}})[_0xb995('0x22')](function(_0x3ade5e){if(_0x3ade5e){_0x56c545=_0x3ade5e[_0xb995('0x32')];if(!_0x1ba7dd[_0xb995('0x2e')][_0xb995('0x33')]('nolimit')){_0x2f0e32['limit']=qs[_0xb995('0x1c')](_0x1ba7dd['query'][_0xb995('0x1c')]);_0x2f0e32[_0xb995('0x1a')]=qs[_0xb995('0x1a')](_0x1ba7dd[_0xb995('0x2e')][_0xb995('0x1a')]);}return _0x131c32[_0xb995('0x47')](_0x2f0e32);}})[_0xb995('0x22')](function(_0x3e0297){if(_0x3e0297){return _0x3e0297?{'count':_0x56c545,'rows':_0x3e0297}:null;}})[_0xb995('0x22')](respondWithResult(_0x3502ba,null))[_0xb995('0x41')](handleError(_0x3502ba,null));};exports['getSubjects']=function(_0x5ebce9,_0x5d7c15,_0x480354){var _0x42f1fb={};var _0x5cc274={};var _0x28f78c;var _0x48879c;return db[_0xb995('0x3c')][_0xb995('0x48')]({'where':{'id':_0x5ebce9[_0xb995('0x42')]['id']}})[_0xb995('0x22')](handleEntityNotFound(_0x5d7c15,null))[_0xb995('0x22')](function(_0x55dce5){if(_0x55dce5){_0x28f78c=_0x55dce5;_0x5cc274[_0xb995('0x2c')]=_['keys'](db[_0xb995('0x49')][_0xb995('0x4a')]);_0x5cc274[_0xb995('0x2e')]=_[_0xb995('0x2d')](_0x5ebce9[_0xb995('0x2e')]);_0x5cc274[_0xb995('0x37')]=_['intersection'](_0x5cc274[_0xb995('0x2c')],_0x5cc274[_0xb995('0x2e')]);_0x42f1fb[_0xb995('0x30')]=_[_0xb995('0x2f')](_0x5cc274[_0xb995('0x2c')],qs['fields'](_0x5ebce9[_0xb995('0x2e')][_0xb995('0x31')]));_0x42f1fb[_0xb995('0x30')]=_0x42f1fb[_0xb995('0x30')][_0xb995('0x32')]?_0x42f1fb[_0xb995('0x30')]:_0x5cc274['model'];_0x42f1fb[_0xb995('0x34')]=qs['sort'](_0x5ebce9['query'][_0xb995('0x35')]);_0x42f1fb[_0xb995('0x36')]=qs[_0xb995('0x37')](_[_0xb995('0x4b')](_0x5ebce9[_0xb995('0x2e')],_0x5cc274['filters']));if(_0x5ebce9[_0xb995('0x2e')][_0xb995('0x38')]){_0x42f1fb['where']=_['merge'](_0x42f1fb[_0xb995('0x36')],{'$or':_[_0xb995('0x28')](_0x42f1fb[_0xb995('0x30')],function(_0x439a7b){var _0x3c95c7={};_0x3c95c7[_0x439a7b]={'$like':'%'+_0x5ebce9[_0xb995('0x2e')]['filter']+'%'};return _0x3c95c7;})});}_0x42f1fb=_[_0xb995('0x39')]({},_0x42f1fb,_0x5ebce9[_0xb995('0x3b')]);return _0x28f78c[_0xb995('0x4c')](_0x42f1fb);}})[_0xb995('0x22')](function(_0x1b1fb3){if(_0x1b1fb3){_0x48879c=_0x1b1fb3['length'];if(!_0x5ebce9['query'][_0xb995('0x33')]('nolimit')){_0x42f1fb[_0xb995('0x1c')]=qs[_0xb995('0x1c')](_0x5ebce9[_0xb995('0x2e')]['limit']);_0x42f1fb[_0xb995('0x1a')]=qs[_0xb995('0x1a')](_0x5ebce9['query'][_0xb995('0x1a')]);}return _0x28f78c[_0xb995('0x4c')](_0x42f1fb);}})[_0xb995('0x22')](function(_0x2ea689){if(_0x2ea689){return _0x2ea689?{'count':_0x48879c,'rows':_0x2ea689}:null;}})['then'](respondWithResult(_0x5d7c15,null))[_0xb995('0x41')](handleError(_0x5d7c15,null));};exports[_0xb995('0x4d')]=function(_0x4aac49,_0x3cbf42,_0x5c14e0){var _0x2dbc47={};var _0x50e522={};var _0x29f0d6;var _0x26b712;return db['Dynamics365Configuration'][_0xb995('0x48')]({'where':{'id':_0x4aac49['params']['id']}})['then'](handleEntityNotFound(_0x3cbf42,null))[_0xb995('0x22')](function(_0x50b62a){if(_0x50b62a){_0x29f0d6=_0x50b62a;_0x50e522[_0xb995('0x2c')]=_[_0xb995('0x2d')](db[_0xb995('0x49')][_0xb995('0x4a')]);_0x50e522['query']=_[_0xb995('0x2d')](_0x4aac49[_0xb995('0x2e')]);_0x50e522[_0xb995('0x37')]=_['intersection'](_0x50e522[_0xb995('0x2c')],_0x50e522['query']);_0x2dbc47[_0xb995('0x30')]=_[_0xb995('0x2f')](_0x50e522[_0xb995('0x2c')],qs['fields'](_0x4aac49[_0xb995('0x2e')][_0xb995('0x31')]));_0x2dbc47[_0xb995('0x30')]=_0x2dbc47[_0xb995('0x30')][_0xb995('0x32')]?_0x2dbc47[_0xb995('0x30')]:_0x50e522[_0xb995('0x2c')];_0x2dbc47[_0xb995('0x34')]=qs[_0xb995('0x35')](_0x4aac49[_0xb995('0x2e')][_0xb995('0x35')]);_0x2dbc47[_0xb995('0x36')]=qs[_0xb995('0x37')](_['pick'](_0x4aac49[_0xb995('0x2e')],_0x50e522[_0xb995('0x37')]));if(_0x4aac49[_0xb995('0x2e')][_0xb995('0x38')]){_0x2dbc47[_0xb995('0x36')]=_[_0xb995('0x39')](_0x2dbc47['where'],{'$or':_[_0xb995('0x28')](_0x2dbc47[_0xb995('0x30')],function(_0x38e014){var _0x130627={};_0x130627[_0x38e014]={'$like':'%'+_0x4aac49['query']['filter']+'%'};return _0x130627;})});}_0x2dbc47=_[_0xb995('0x39')]({},_0x2dbc47,_0x4aac49['options']);return _0x29f0d6[_0xb995('0x4d')](_0x2dbc47);}})[_0xb995('0x22')](function(_0x420d6d){if(_0x420d6d){_0x26b712=_0x420d6d[_0xb995('0x32')];if(!_0x4aac49[_0xb995('0x2e')][_0xb995('0x33')](_0xb995('0x4e'))){_0x2dbc47['limit']=qs[_0xb995('0x1c')](_0x4aac49['query'][_0xb995('0x1c')]);_0x2dbc47[_0xb995('0x1a')]=qs[_0xb995('0x1a')](_0x4aac49[_0xb995('0x2e')]['offset']);}return _0x29f0d6['getDescriptions'](_0x2dbc47);}})[_0xb995('0x22')](function(_0x418b72){if(_0x418b72){return _0x418b72?{'count':_0x26b712,'rows':_0x418b72}:null;}})['then'](respondWithResult(_0x3cbf42,null))['catch'](handleError(_0x3cbf42,null));}; \ No newline at end of file +var _0xbacd=['eml-format','rimraf','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','getFields','findOne','Dynamics365Field','rawAttributes','getSubjects','order','getDescriptions'];(function(_0x3fc16a,_0xa05b6a){var _0x2b1530=function(_0x50d168){while(--_0x50d168){_0x3fc16a['push'](_0x3fc16a['shift']());}};_0x2b1530(++_0xa05b6a);}(_0xbacd,0x1e6));var _0xdbac=function(_0x3fa4ea,_0x8e1811){_0x3fa4ea=_0x3fa4ea-0x0;var _0x4734e6=_0xbacd[_0x3fa4ea];return _0x4734e6;};'use strict';var emlformat=require(_0xdbac('0x0'));var rimraf=require(_0xdbac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbac('0x2'));var rp=require(_0xdbac('0x3'));var moment=require(_0xdbac('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbac('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xdbac('0x6'));var ejs=require(_0xdbac('0x7'));var fs=require('fs');var fs_extra=require(_0xdbac('0x8'));var _=require(_0xdbac('0x9'));var squel=require(_0xdbac('0xa'));var crypto=require(_0xdbac('0xb'));var jsforce=require(_0xdbac('0xc'));var deskjs=require(_0xdbac('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdbac('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdbac('0xf'));var as=require(_0xdbac('0x10'));var hardwareService=require(_0xdbac('0x11'));var logger=require(_0xdbac('0x12'))('api');var utils=require(_0xdbac('0x13'));var config=require(_0xdbac('0x14'));var licenseUtil=require(_0xdbac('0x15'));var db=require(_0xdbac('0x16'))['db'];function respondWithStatusCode(_0x41fd9b,_0xd89d9d){_0xd89d9d=_0xd89d9d||0xcc;return function(_0x1377c1){if(_0x1377c1){return _0x41fd9b[_0xdbac('0x17')](_0xd89d9d);}return _0x41fd9b[_0xdbac('0x18')](_0xd89d9d)[_0xdbac('0x19')]();};}function respondWithResult(_0x545a8d,_0x401833){_0x401833=_0x401833||0xc8;return function(_0x2042c5){if(_0x2042c5){return _0x545a8d[_0xdbac('0x18')](_0x401833)[_0xdbac('0x1a')](_0x2042c5);}};}function respondWithFilteredResult(_0x222efb,_0x5aa057){return function(_0x38eefc){if(_0x38eefc){var _0x40c524=typeof _0x5aa057['offset']===_0xdbac('0x1b')&&typeof _0x5aa057[_0xdbac('0x1c')]===_0xdbac('0x1b');var _0x30fe40=_0x38eefc[_0xdbac('0x1d')];var _0x40c62c=_0x40c524?0x0:_0x5aa057[_0xdbac('0x1e')];var _0x41460f=_0x40c524?_0x38eefc[_0xdbac('0x1d')]:_0x5aa057[_0xdbac('0x1e')]+_0x5aa057[_0xdbac('0x1c')];var _0x3907a7;if(_0x41460f>=_0x30fe40){_0x41460f=_0x30fe40;_0x3907a7=0xc8;}else{_0x3907a7=0xce;}_0x222efb[_0xdbac('0x18')](_0x3907a7);return _0x222efb[_0xdbac('0x1f')](_0xdbac('0x20'),_0x40c62c+'-'+_0x41460f+'/'+_0x30fe40)[_0xdbac('0x1a')](_0x38eefc);}return null;};}function patchUpdates(_0x19225c){return function(_0x2a4d62){try{jsonpatch[_0xdbac('0x21')](_0x2a4d62,_0x19225c,!![]);}catch(_0x493ceb){return BPromise[_0xdbac('0x22')](_0x493ceb);}return _0x2a4d62[_0xdbac('0x23')]();};}function saveUpdates(_0xc278bf,_0x18b6f9){return function(_0x22c51c){if(_0x22c51c){return _0x22c51c[_0xdbac('0x24')](_0xc278bf)[_0xdbac('0x25')](function(_0x3ed545){return _0x3ed545;});}return null;};}function removeEntity(_0x1f4548,_0x456fba){return function(_0x477c91){if(_0x477c91){return _0x477c91[_0xdbac('0x26')]()[_0xdbac('0x25')](function(){_0x1f4548[_0xdbac('0x18')](0xcc)[_0xdbac('0x19')]();});}};}function handleEntityNotFound(_0x6bba14,_0x47c4eb){return function(_0x4dabd5){if(!_0x4dabd5){_0x6bba14[_0xdbac('0x17')](0x194);}return _0x4dabd5;};}function handleError(_0x8f56b1,_0x1a9056){_0x1a9056=_0x1a9056||0x1f4;return function(_0x337279){logger[_0xdbac('0x27')](_0x337279['stack']);if(_0x337279[_0xdbac('0x28')]){delete _0x337279[_0xdbac('0x28')];}_0x8f56b1[_0xdbac('0x18')](_0x1a9056)[_0xdbac('0x29')](_0x337279);};}exports[_0xdbac('0x2a')]=function(_0x2ccc34,_0x4bebd4){var _0x2c210f={},_0x5736b8={},_0x2e88b0={'count':0x0,'rows':[]};var _0x353663=_[_0xdbac('0x2b')](db[_0xdbac('0x2c')]['rawAttributes'],function(_0x29d901){return{'name':_0x29d901[_0xdbac('0x2d')],'type':_0x29d901[_0xdbac('0x2e')]['key']};});_0x5736b8[_0xdbac('0x2f')]=_[_0xdbac('0x2b')](_0x353663,_0xdbac('0x28'));_0x5736b8['query']=_[_0xdbac('0x30')](_0x2ccc34[_0xdbac('0x31')]);_0x5736b8['filters']=_[_0xdbac('0x32')](_0x5736b8[_0xdbac('0x2f')],_0x5736b8[_0xdbac('0x31')]);_0x2c210f[_0xdbac('0x33')]=_['intersection'](_0x5736b8[_0xdbac('0x2f')],qs[_0xdbac('0x34')](_0x2ccc34[_0xdbac('0x31')][_0xdbac('0x34')]));_0x2c210f[_0xdbac('0x33')]=_0x2c210f[_0xdbac('0x33')][_0xdbac('0x35')]?_0x2c210f['attributes']:_0x5736b8['model'];if(!_0x2ccc34['query'][_0xdbac('0x36')](_0xdbac('0x37'))){_0x2c210f['limit']=qs['limit'](_0x2ccc34[_0xdbac('0x31')][_0xdbac('0x1c')]);_0x2c210f[_0xdbac('0x1e')]=qs['offset'](_0x2ccc34[_0xdbac('0x31')]['offset']);}_0x2c210f['order']=qs[_0xdbac('0x38')](_0x2ccc34['query'][_0xdbac('0x38')]);_0x2c210f[_0xdbac('0x39')]=qs['filters'](_[_0xdbac('0x3a')](_0x2ccc34[_0xdbac('0x31')],_0x5736b8['filters']),_0x353663);if(_0x2ccc34['query'][_0xdbac('0x3b')]){_0x2c210f[_0xdbac('0x39')]=_[_0xdbac('0x3c')](_0x2c210f['where'],{'$or':_['map'](_0x353663,function(_0x2766eb){if(_0x2766eb[_0xdbac('0x2e')]!==_0xdbac('0x3d')){var _0x53cdf3={};_0x53cdf3[_0x2766eb[_0xdbac('0x28')]]={'$like':'%'+_0x2ccc34[_0xdbac('0x31')]['filter']+'%'};return _0x53cdf3;}})});}_0x2c210f=_[_0xdbac('0x3c')]({},_0x2c210f,_0x2ccc34[_0xdbac('0x3e')]);var _0x1cea46={'where':_0x2c210f[_0xdbac('0x39')]};return db[_0xdbac('0x2c')]['count'](_0x1cea46)[_0xdbac('0x25')](function(_0xa4c3e9){_0x2e88b0[_0xdbac('0x1d')]=_0xa4c3e9;if(_0x2ccc34[_0xdbac('0x31')][_0xdbac('0x3f')]){_0x2c210f[_0xdbac('0x40')]=[{'all':!![]}];}return db[_0xdbac('0x2c')][_0xdbac('0x41')](_0x2c210f);})[_0xdbac('0x25')](function(_0x3771fe){_0x2e88b0[_0xdbac('0x42')]=_0x3771fe;return _0x2e88b0;})[_0xdbac('0x25')](respondWithFilteredResult(_0x4bebd4,_0x2c210f))[_0xdbac('0x43')](handleError(_0x4bebd4,null));};exports[_0xdbac('0x44')]=function(_0x3df01a,_0x4eea83){var _0x20e2e4={'raw':![],'where':{'id':_0x3df01a[_0xdbac('0x45')]['id']}},_0x95203f={};_0x95203f[_0xdbac('0x2f')]=_[_0xdbac('0x30')](db[_0xdbac('0x2c')]['rawAttributes']);_0x95203f[_0xdbac('0x31')]=_[_0xdbac('0x30')](_0x3df01a[_0xdbac('0x31')]);_0x95203f[_0xdbac('0x46')]=_['intersection'](_0x95203f[_0xdbac('0x2f')],_0x95203f[_0xdbac('0x31')]);_0x20e2e4[_0xdbac('0x33')]=_['intersection'](_0x95203f['model'],qs[_0xdbac('0x34')](_0x3df01a[_0xdbac('0x31')][_0xdbac('0x34')]));_0x20e2e4[_0xdbac('0x33')]=_0x20e2e4['attributes'][_0xdbac('0x35')]?_0x20e2e4[_0xdbac('0x33')]:_0x95203f[_0xdbac('0x2f')];if(_0x3df01a[_0xdbac('0x31')]['includeAll']){_0x20e2e4[_0xdbac('0x40')]=[{'all':!![]}];}_0x20e2e4=_[_0xdbac('0x3c')]({},_0x20e2e4,_0x3df01a[_0xdbac('0x3e')]);return db[_0xdbac('0x2c')][_0xdbac('0x47')](_0x20e2e4)[_0xdbac('0x25')](handleEntityNotFound(_0x4eea83,null))[_0xdbac('0x25')](respondWithResult(_0x4eea83,null))['catch'](handleError(_0x4eea83,null));};exports['create']=function(_0x118819,_0x2a8782){return db[_0xdbac('0x2c')][_0xdbac('0x48')](_0x118819[_0xdbac('0x49')],{})[_0xdbac('0x25')](respondWithResult(_0x2a8782,0xc9))[_0xdbac('0x43')](handleError(_0x2a8782,null));};exports['update']=function(_0x4cc484,_0xd3f1b6){if(_0x4cc484[_0xdbac('0x49')]['id']){delete _0x4cc484['body']['id'];}return db[_0xdbac('0x2c')][_0xdbac('0x47')]({'where':{'id':_0x4cc484['params']['id']}})[_0xdbac('0x25')](handleEntityNotFound(_0xd3f1b6,null))['then'](saveUpdates(_0x4cc484['body'],null))['then'](respondWithResult(_0xd3f1b6,null))[_0xdbac('0x43')](handleError(_0xd3f1b6,null));};exports['destroy']=function(_0x5822ae,_0x300764){return db[_0xdbac('0x2c')][_0xdbac('0x47')]({'where':{'id':_0x5822ae[_0xdbac('0x45')]['id']}})[_0xdbac('0x25')](handleEntityNotFound(_0x300764,null))[_0xdbac('0x25')](removeEntity(_0x300764,null))[_0xdbac('0x43')](handleError(_0x300764,null));};exports[_0xdbac('0x4a')]=function(_0x4c8db7,_0x3474be,_0x201867){var _0xd685ca={};var _0x1bd31b={};var _0x1bfd82;var _0x41318a;return db[_0xdbac('0x2c')][_0xdbac('0x4b')]({'where':{'id':_0x4c8db7['params']['id']}})['then'](handleEntityNotFound(_0x3474be,null))[_0xdbac('0x25')](function(_0x2ed645){if(_0x2ed645){_0x1bfd82=_0x2ed645;_0x1bd31b[_0xdbac('0x2f')]=_[_0xdbac('0x30')](db[_0xdbac('0x4c')][_0xdbac('0x4d')]);_0x1bd31b[_0xdbac('0x31')]=_[_0xdbac('0x30')](_0x4c8db7['query']);_0x1bd31b['filters']=_['intersection'](_0x1bd31b['model'],_0x1bd31b[_0xdbac('0x31')]);_0xd685ca[_0xdbac('0x33')]=_[_0xdbac('0x32')](_0x1bd31b[_0xdbac('0x2f')],qs['fields'](_0x4c8db7[_0xdbac('0x31')]['fields']));_0xd685ca['attributes']=_0xd685ca[_0xdbac('0x33')][_0xdbac('0x35')]?_0xd685ca['attributes']:_0x1bd31b[_0xdbac('0x2f')];_0xd685ca['order']=qs['sort'](_0x4c8db7['query'][_0xdbac('0x38')]);_0xd685ca['where']=qs[_0xdbac('0x46')](_[_0xdbac('0x3a')](_0x4c8db7['query'],_0x1bd31b['filters']));if(_0x4c8db7[_0xdbac('0x31')][_0xdbac('0x3b')]){_0xd685ca[_0xdbac('0x39')]=_[_0xdbac('0x3c')](_0xd685ca[_0xdbac('0x39')],{'$or':_['map'](_0xd685ca[_0xdbac('0x33')],function(_0x3cb595){var _0x588784={};_0x588784[_0x3cb595]={'$like':'%'+_0x4c8db7['query'][_0xdbac('0x3b')]+'%'};return _0x588784;})});}_0xd685ca=_[_0xdbac('0x3c')]({},_0xd685ca,_0x4c8db7[_0xdbac('0x3e')]);return _0x1bfd82['getFields'](_0xd685ca);}})[_0xdbac('0x25')](function(_0x12fac2){if(_0x12fac2){_0x41318a=_0x12fac2[_0xdbac('0x35')];if(!_0x4c8db7[_0xdbac('0x31')][_0xdbac('0x36')]('nolimit')){_0xd685ca['limit']=qs[_0xdbac('0x1c')](_0x4c8db7[_0xdbac('0x31')][_0xdbac('0x1c')]);_0xd685ca[_0xdbac('0x1e')]=qs['offset'](_0x4c8db7[_0xdbac('0x31')]['offset']);}return _0x1bfd82['getFields'](_0xd685ca);}})['then'](function(_0x20d0dd){if(_0x20d0dd){return _0x20d0dd?{'count':_0x41318a,'rows':_0x20d0dd}:null;}})['then'](respondWithResult(_0x3474be,null))[_0xdbac('0x43')](handleError(_0x3474be,null));};exports[_0xdbac('0x4e')]=function(_0xff2994,_0x3429c2,_0x4d437){var _0xea6505={};var _0x11f637={};var _0x185a88;var _0x28bc3c;return db[_0xdbac('0x2c')][_0xdbac('0x4b')]({'where':{'id':_0xff2994[_0xdbac('0x45')]['id']}})[_0xdbac('0x25')](handleEntityNotFound(_0x3429c2,null))[_0xdbac('0x25')](function(_0x3f1f9f){if(_0x3f1f9f){_0x185a88=_0x3f1f9f;_0x11f637[_0xdbac('0x2f')]=_[_0xdbac('0x30')](db['Dynamics365Field'][_0xdbac('0x4d')]);_0x11f637[_0xdbac('0x31')]=_['keys'](_0xff2994['query']);_0x11f637[_0xdbac('0x46')]=_['intersection'](_0x11f637['model'],_0x11f637[_0xdbac('0x31')]);_0xea6505[_0xdbac('0x33')]=_[_0xdbac('0x32')](_0x11f637[_0xdbac('0x2f')],qs[_0xdbac('0x34')](_0xff2994[_0xdbac('0x31')][_0xdbac('0x34')]));_0xea6505['attributes']=_0xea6505[_0xdbac('0x33')][_0xdbac('0x35')]?_0xea6505['attributes']:_0x11f637['model'];_0xea6505[_0xdbac('0x4f')]=qs[_0xdbac('0x38')](_0xff2994[_0xdbac('0x31')][_0xdbac('0x38')]);_0xea6505['where']=qs[_0xdbac('0x46')](_[_0xdbac('0x3a')](_0xff2994['query'],_0x11f637[_0xdbac('0x46')]));if(_0xff2994['query']['filter']){_0xea6505[_0xdbac('0x39')]=_[_0xdbac('0x3c')](_0xea6505[_0xdbac('0x39')],{'$or':_[_0xdbac('0x2b')](_0xea6505[_0xdbac('0x33')],function(_0x4d86fb){var _0x32c3b7={};_0x32c3b7[_0x4d86fb]={'$like':'%'+_0xff2994[_0xdbac('0x31')][_0xdbac('0x3b')]+'%'};return _0x32c3b7;})});}_0xea6505=_[_0xdbac('0x3c')]({},_0xea6505,_0xff2994[_0xdbac('0x3e')]);return _0x185a88[_0xdbac('0x4e')](_0xea6505);}})[_0xdbac('0x25')](function(_0x3c6fbf){if(_0x3c6fbf){_0x28bc3c=_0x3c6fbf[_0xdbac('0x35')];if(!_0xff2994[_0xdbac('0x31')][_0xdbac('0x36')](_0xdbac('0x37'))){_0xea6505['limit']=qs[_0xdbac('0x1c')](_0xff2994[_0xdbac('0x31')][_0xdbac('0x1c')]);_0xea6505[_0xdbac('0x1e')]=qs[_0xdbac('0x1e')](_0xff2994['query'][_0xdbac('0x1e')]);}return _0x185a88[_0xdbac('0x4e')](_0xea6505);}})[_0xdbac('0x25')](function(_0x44bbc0){if(_0x44bbc0){return _0x44bbc0?{'count':_0x28bc3c,'rows':_0x44bbc0}:null;}})[_0xdbac('0x25')](respondWithResult(_0x3429c2,null))['catch'](handleError(_0x3429c2,null));};exports['getDescriptions']=function(_0x87c6b6,_0x5b7b17,_0x4494d6){var _0x205b1f={};var _0x5b96d5={};var _0x5e26c3;var _0x4aed8a;return db[_0xdbac('0x2c')][_0xdbac('0x4b')]({'where':{'id':_0x87c6b6[_0xdbac('0x45')]['id']}})[_0xdbac('0x25')](handleEntityNotFound(_0x5b7b17,null))[_0xdbac('0x25')](function(_0x52f00d){if(_0x52f00d){_0x5e26c3=_0x52f00d;_0x5b96d5[_0xdbac('0x2f')]=_['keys'](db[_0xdbac('0x4c')][_0xdbac('0x4d')]);_0x5b96d5[_0xdbac('0x31')]=_['keys'](_0x87c6b6[_0xdbac('0x31')]);_0x5b96d5['filters']=_[_0xdbac('0x32')](_0x5b96d5['model'],_0x5b96d5[_0xdbac('0x31')]);_0x205b1f[_0xdbac('0x33')]=_[_0xdbac('0x32')](_0x5b96d5[_0xdbac('0x2f')],qs['fields'](_0x87c6b6[_0xdbac('0x31')][_0xdbac('0x34')]));_0x205b1f[_0xdbac('0x33')]=_0x205b1f['attributes'][_0xdbac('0x35')]?_0x205b1f[_0xdbac('0x33')]:_0x5b96d5[_0xdbac('0x2f')];_0x205b1f[_0xdbac('0x4f')]=qs['sort'](_0x87c6b6['query'][_0xdbac('0x38')]);_0x205b1f[_0xdbac('0x39')]=qs['filters'](_['pick'](_0x87c6b6[_0xdbac('0x31')],_0x5b96d5[_0xdbac('0x46')]));if(_0x87c6b6[_0xdbac('0x31')][_0xdbac('0x3b')]){_0x205b1f[_0xdbac('0x39')]=_[_0xdbac('0x3c')](_0x205b1f[_0xdbac('0x39')],{'$or':_[_0xdbac('0x2b')](_0x205b1f[_0xdbac('0x33')],function(_0x14eb99){var _0x3d7be8={};_0x3d7be8[_0x14eb99]={'$like':'%'+_0x87c6b6[_0xdbac('0x31')][_0xdbac('0x3b')]+'%'};return _0x3d7be8;})});}_0x205b1f=_[_0xdbac('0x3c')]({},_0x205b1f,_0x87c6b6['options']);return _0x5e26c3[_0xdbac('0x50')](_0x205b1f);}})[_0xdbac('0x25')](function(_0x59f68d){if(_0x59f68d){_0x4aed8a=_0x59f68d[_0xdbac('0x35')];if(!_0x87c6b6[_0xdbac('0x31')][_0xdbac('0x36')](_0xdbac('0x37'))){_0x205b1f[_0xdbac('0x1c')]=qs[_0xdbac('0x1c')](_0x87c6b6['query'][_0xdbac('0x1c')]);_0x205b1f[_0xdbac('0x1e')]=qs['offset'](_0x87c6b6['query'][_0xdbac('0x1e')]);}return _0x5e26c3[_0xdbac('0x50')](_0x205b1f);}})[_0xdbac('0x25')](function(_0x235b24){if(_0x235b24){return _0x235b24?{'count':_0x4aed8a,'rows':_0x235b24}:null;}})['then'](respondWithResult(_0x5b7b17,null))[_0xdbac('0x43')](handleError(_0x5b7b17,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 33b64cb..bd44e1e 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 _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x53d843,_0x12cfc0){var _0x558ead=function(_0x298214){while(--_0x298214){_0x53d843['push'](_0x53d843['shift']());}};_0x558ead(++_0x12cfc0);}(_0xdace,0xc5));var _0xedac=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0xdace[_0x4bf96c];return _0x281d09;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x2d08b9,_0x2fee02){var _0x34c713=function(_0x57defa){while(--_0x57defa){_0x2d08b9['push'](_0x2d08b9['shift']());}};_0x34c713(++_0x2fee02);}(_0x3e74,0x175));var _0x43e7=function(_0x2be850,_0x54083d){_0x2be850=_0x2be850-0x0;var _0x308f14=_0x3e74[_0x2be850];return _0x308f14;};'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 e62d017..348aab4 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 _0x5fd4=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x5fd4,0x17c));var _0x45fd=function(_0x10d3d6,_0x5428e4){_0x10d3d6=_0x10d3d6-0x0;var _0x3e60b5=_0x5fd4[_0x10d3d6];return _0x3e60b5;};'use strict';var _=require(_0x45fd('0x0'));var util=require(_0x45fd('0x1'));var moment=require(_0x45fd('0x2'));var BPromise=require(_0x45fd('0x3'));var rs=require(_0x45fd('0x4'));var fs=require('fs');var Redis=require(_0x45fd('0x5'));var db=require(_0x45fd('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x45fd('0x7'));var jayson=require(_0x45fd('0x8'));var client=jayson['client'][_0x45fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d9004,_0x17cfa7,_0x2f4c26){return new BPromise(function(_0x5a1d0b,_0x53397b){return client[_0x45fd('0xa')](_0x3d9004,_0x2f4c26)[_0x45fd('0xb')](function(_0x3635d5){logger['info'](_0x45fd('0xc'),_0x17cfa7,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x17cfa7,_0x45fd('0xd'),JSON[_0x45fd('0xe')](_0x3635d5));if(_0x3635d5['error']){if(_0x3635d5[_0x45fd('0xf')][_0x45fd('0x10')]===0x1f4){logger[_0x45fd('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x17cfa7,_0x3635d5['error'][_0x45fd('0x11')]);return _0x53397b(_0x3635d5['error']['message']);}logger[_0x45fd('0xf')](_0x45fd('0xc'),_0x17cfa7,_0x3635d5['error'][_0x45fd('0x11')]);return _0x5a1d0b(_0x3635d5[_0x45fd('0xf')][_0x45fd('0x11')]);}else{logger[_0x45fd('0x12')](_0x45fd('0xc'),_0x17cfa7,'request\x20sent');_0x5a1d0b(_0x3635d5['result'][_0x45fd('0x11')]);}})[_0x45fd('0x13')](function(_0x229658){logger[_0x45fd('0xf')](_0x45fd('0xc'),_0x17cfa7,_0x229658);_0x53397b(_0x229658);});});} \ No newline at end of file +var _0xe3fb=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1cd0bf,_0x2d5659){var _0x35af19=function(_0x590235){while(--_0x590235){_0x1cd0bf['push'](_0x1cd0bf['shift']());}};_0x35af19(++_0x2d5659);}(_0xe3fb,0x1aa));var _0xbe3f=function(_0x46399a,_0x108f44){_0x46399a=_0x46399a-0x0;var _0x3f97ca=_0xe3fb[_0x46399a];return _0x3f97ca;};'use strict';var _=require(_0xbe3f('0x0'));var util=require(_0xbe3f('0x1'));var moment=require(_0xbe3f('0x2'));var BPromise=require(_0xbe3f('0x3'));var rs=require(_0xbe3f('0x4'));var fs=require('fs');var Redis=require(_0xbe3f('0x5'));var db=require(_0xbe3f('0x6'))['db'];var utils=require(_0xbe3f('0x7'));var logger=require(_0xbe3f('0x8'))(_0xbe3f('0x9'));var config=require('../../config/environment');var jayson=require(_0xbe3f('0xa'));var client=jayson[_0xbe3f('0xb')][_0xbe3f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4140d2,_0x382920,_0x5c299c){return new BPromise(function(_0x5580b9,_0x3fc750){return client[_0xbe3f('0xd')](_0x4140d2,_0x5c299c)['then'](function(_0x52d549){logger[_0xbe3f('0xe')](_0xbe3f('0xf'),_0x382920,_0xbe3f('0x10'));logger['debug'](_0xbe3f('0x11'),_0x382920,'request\x20sent',JSON[_0xbe3f('0x12')](_0x52d549));if(_0x52d549['error']){if(_0x52d549[_0xbe3f('0x13')][_0xbe3f('0x14')]===0x1f4){logger['error'](_0xbe3f('0xf'),_0x382920,_0x52d549[_0xbe3f('0x13')]['message']);return _0x3fc750(_0x52d549[_0xbe3f('0x13')]['message']);}logger[_0xbe3f('0x13')](_0xbe3f('0xf'),_0x382920,_0x52d549[_0xbe3f('0x13')]['message']);return _0x5580b9(_0x52d549[_0xbe3f('0x13')]['message']);}else{logger[_0xbe3f('0xe')](_0xbe3f('0xf'),_0x382920,_0xbe3f('0x10'));_0x5580b9(_0x52d549[_0xbe3f('0x15')][_0xbe3f('0x16')]);}})[_0xbe3f('0x17')](function(_0x50b56f){logger[_0xbe3f('0x13')](_0xbe3f('0xf'),_0x382920,_0x50b56f);_0x3fc750(_0x50b56f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index a725d87..e51bc1f 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 _0xaae8=['Router','fs-extra','../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','path','connect-timeout','express'];(function(_0x4050a2,_0x185d9d){var _0x2fea5c=function(_0x1e778d){while(--_0x1e778d){_0x4050a2['push'](_0x4050a2['shift']());}};_0x2fea5c(++_0x185d9d);}(_0xaae8,0x18d));var _0x8aae=function(_0x500f88,_0x23ab3f){_0x500f88=_0x500f88-0x0;var _0x311631=_0xaae8[_0x500f88];return _0x311631;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8aae('0x0'));var timeout=require(_0x8aae('0x1'));var express=require(_0x8aae('0x2'));var router=express[_0x8aae('0x3')]();var fs_extra=require(_0x8aae('0x4'));var auth=require(_0x8aae('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8aae('0x6'));router[_0x8aae('0x7')]('/',auth[_0x8aae('0x8')](),controller['index']);router[_0x8aae('0x7')](_0x8aae('0x9'),auth[_0x8aae('0x8')](),controller[_0x8aae('0xa')]);router[_0x8aae('0xb')]('/',auth[_0x8aae('0x8')](),controller['create']);router[_0x8aae('0xc')](_0x8aae('0x9'),auth[_0x8aae('0x8')](),controller[_0x8aae('0xd')]);router['delete'](_0x8aae('0x9'),auth[_0x8aae('0x8')](),controller[_0x8aae('0xe')]);module[_0x8aae('0xf')]=router; \ No newline at end of file +var _0xd35a=['./intDynamics365Field.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4e7135,_0x314c8c){var _0x49c0e3=function(_0x9ebc16){while(--_0x9ebc16){_0x4e7135['push'](_0x4e7135['shift']());}};_0x49c0e3(++_0x314c8c);}(_0xd35a,0x82));var _0xad35=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0xd35a[_0x54bac5];return _0xc15971;};'use strict';var multer=require(_0xad35('0x0'));var util=require('util');var path=require(_0xad35('0x1'));var timeout=require(_0xad35('0x2'));var express=require(_0xad35('0x3'));var router=express[_0xad35('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad35('0x5'));var config=require('../../config/environment');var controller=require(_0xad35('0x6'));router['get']('/',auth[_0xad35('0x7')](),controller['index']);router[_0xad35('0x8')]('/:id',auth[_0xad35('0x7')](),controller[_0xad35('0x9')]);router[_0xad35('0xa')]('/',auth[_0xad35('0x7')](),controller[_0xad35('0xb')]);router[_0xad35('0xc')](_0xad35('0xd'),auth[_0xad35('0x7')](),controller[_0xad35('0xe')]);router[_0xad35('0xf')](_0xad35('0xd'),auth[_0xad35('0x7')](),controller['destroy']);module[_0xad35('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 8324c7e..802f7da 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 _0x3881=['variable','customVariable','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3881,0xac));var _0x1388=function(_0x4e536c,_0x56cc13){_0x4e536c=_0x4e536c-0x0;var _0x312247=_0x3881[_0x4e536c];return _0x312247;};'use strict';var Sequelize=require(_0x1388('0x0'));module[_0x1388('0x1')]={'type':{'type':Sequelize[_0x1388('0x2')](_0x1388('0x3'),_0x1388('0x4'),_0x1388('0x5'),'keyValue',_0x1388('0x6')),'defaultValue':_0x1388('0x3')},'content':{'type':Sequelize[_0x1388('0x7')]},'key':{'type':Sequelize[_0x1388('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1388('0x4'),_0x1388('0x5'))},'keyContent':{'type':Sequelize[_0x1388('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1388('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1388('0x7')]}}; \ No newline at end of file +var _0xebfe=['variable','BOOLEAN','ENUM','customVariable','picklist','string','STRING'];(function(_0x5a8d09,_0x35d608){var _0x333a05=function(_0xd58867){while(--_0xd58867){_0x5a8d09['push'](_0x5a8d09['shift']());}};_0x333a05(++_0x35d608);}(_0xebfe,0x198));var _0xeebf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xebfe[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xeebf('0x0')]('string','variable',_0xeebf('0x1'),'keyValue',_0xeebf('0x2')),'defaultValue':_0xeebf('0x3')},'content':{'type':Sequelize[_0xeebf('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xeebf('0x0')](_0xeebf('0x3'),_0xeebf('0x5'),_0xeebf('0x1'))},'keyContent':{'type':Sequelize[_0xeebf('0x4')]},'idField':{'type':Sequelize[_0xeebf('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xeebf('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeebf('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index e239ae0..1d61613 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 _0xf04f=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','findAll','catch','show','params','length','includeAll','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xf04f,0x8b));var _0xff04=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xf04f[_0x504df1];return _0x1063b5;};'use strict';var emlformat=require(_0xff04('0x0'));var rimraf=require(_0xff04('0x1'));var zipdir=require(_0xff04('0x2'));var jsonpatch=require(_0xff04('0x3'));var rp=require(_0xff04('0x4'));var moment=require(_0xff04('0x5'));var BPromise=require(_0xff04('0x6'));var Mustache=require(_0xff04('0x7'));var util=require(_0xff04('0x8'));var path=require(_0xff04('0x9'));var sox=require(_0xff04('0xa'));var csv=require(_0xff04('0xb'));var ejs=require(_0xff04('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xff04('0xd'));var crypto=require(_0xff04('0xe'));var jsforce=require(_0xff04('0xf'));var deskjs=require(_0xff04('0x10'));var toCsv=require(_0xff04('0xb'));var querystring=require('querystring');var Papa=require(_0xff04('0x11'));var Redis=require(_0xff04('0x12'));var authService=require(_0xff04('0x13'));var qs=require(_0xff04('0x14'));var as=require(_0xff04('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff04('0x16'))(_0xff04('0x17'));var utils=require(_0xff04('0x18'));var config=require(_0xff04('0x19'));var licenseUtil=require(_0xff04('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ebc6c,_0x3504d6){_0x3504d6=_0x3504d6||0xcc;return function(_0xe9d118){if(_0xe9d118){return _0x2ebc6c[_0xff04('0x1b')](_0x3504d6);}return _0x2ebc6c[_0xff04('0x1c')](_0x3504d6)['end']();};}function respondWithResult(_0x2dbb26,_0x3820b4){_0x3820b4=_0x3820b4||0xc8;return function(_0x14bc24){if(_0x14bc24){return _0x2dbb26[_0xff04('0x1c')](_0x3820b4)[_0xff04('0x1d')](_0x14bc24);}};}function respondWithFilteredResult(_0xe904e,_0x18b483){return function(_0x476936){if(_0x476936){var _0x4ac6b2=typeof _0x18b483[_0xff04('0x1e')]===_0xff04('0x1f')&&typeof _0x18b483[_0xff04('0x20')]===_0xff04('0x1f');var _0x324bcb=_0x476936['count'];var _0x156bb0=_0x4ac6b2?0x0:_0x18b483[_0xff04('0x1e')];var _0x217770=_0x4ac6b2?_0x476936[_0xff04('0x21')]:_0x18b483[_0xff04('0x1e')]+_0x18b483[_0xff04('0x20')];var _0x5d5185;if(_0x217770>=_0x324bcb){_0x217770=_0x324bcb;_0x5d5185=0xc8;}else{_0x5d5185=0xce;}_0xe904e['status'](_0x5d5185);return _0xe904e[_0xff04('0x22')]('Content-Range',_0x156bb0+'-'+_0x217770+'/'+_0x324bcb)[_0xff04('0x1d')](_0x476936);}return null;};}function patchUpdates(_0x14006a){return function(_0x2e1c1f){try{jsonpatch[_0xff04('0x23')](_0x2e1c1f,_0x14006a,!![]);}catch(_0x25bba2){return BPromise['reject'](_0x25bba2);}return _0x2e1c1f[_0xff04('0x24')]();};}function saveUpdates(_0x692ff4,_0x23e206){return function(_0x169cc6){if(_0x169cc6){return _0x169cc6[_0xff04('0x25')](_0x692ff4)[_0xff04('0x26')](function(_0x4c25fb){return _0x4c25fb;});}return null;};}function removeEntity(_0x962a84,_0x4af2f7){return function(_0x137db9){if(_0x137db9){return _0x137db9['destroy']()[_0xff04('0x26')](function(){_0x962a84[_0xff04('0x1c')](0xcc)[_0xff04('0x27')]();});}};}function handleEntityNotFound(_0x37ece5,_0x426812){return function(_0x4939d8){if(!_0x4939d8){_0x37ece5[_0xff04('0x1b')](0x194);}return _0x4939d8;};}function handleError(_0x3cf005,_0x246ad4){_0x246ad4=_0x246ad4||0x1f4;return function(_0x31aba8){logger[_0xff04('0x28')](_0x31aba8[_0xff04('0x29')]);if(_0x31aba8['name']){delete _0x31aba8[_0xff04('0x2a')];}_0x3cf005[_0xff04('0x1c')](_0x246ad4)[_0xff04('0x2b')](_0x31aba8);};}exports[_0xff04('0x2c')]=function(_0x133e62,_0x3f79e6){var _0x130214={},_0x6a943f={},_0x237e59={'count':0x0,'rows':[]};var _0x5b5cfb=_[_0xff04('0x2d')](db[_0xff04('0x2e')][_0xff04('0x2f')],function(_0x3006a9){return{'name':_0x3006a9[_0xff04('0x30')],'type':_0x3006a9[_0xff04('0x31')][_0xff04('0x32')]};});_0x6a943f[_0xff04('0x33')]=_[_0xff04('0x2d')](_0x5b5cfb,_0xff04('0x2a'));_0x6a943f[_0xff04('0x34')]=_[_0xff04('0x35')](_0x133e62[_0xff04('0x34')]);_0x6a943f[_0xff04('0x36')]=_[_0xff04('0x37')](_0x6a943f['model'],_0x6a943f[_0xff04('0x34')]);_0x130214[_0xff04('0x38')]=_[_0xff04('0x37')](_0x6a943f[_0xff04('0x33')],qs[_0xff04('0x39')](_0x133e62[_0xff04('0x34')][_0xff04('0x39')]));_0x130214[_0xff04('0x38')]=_0x130214['attributes']['length']?_0x130214[_0xff04('0x38')]:_0x6a943f['model'];if(!_0x133e62[_0xff04('0x34')][_0xff04('0x3a')](_0xff04('0x3b'))){_0x130214[_0xff04('0x20')]=qs[_0xff04('0x20')](_0x133e62['query'][_0xff04('0x20')]);_0x130214[_0xff04('0x1e')]=qs[_0xff04('0x1e')](_0x133e62[_0xff04('0x34')]['offset']);}_0x130214[_0xff04('0x3c')]=qs[_0xff04('0x3d')](_0x133e62[_0xff04('0x34')][_0xff04('0x3d')]);_0x130214[_0xff04('0x3e')]=qs['filters'](_[_0xff04('0x3f')](_0x133e62[_0xff04('0x34')],_0x6a943f[_0xff04('0x36')]),_0x5b5cfb);if(_0x133e62[_0xff04('0x34')]['filter']){_0x130214['where']=_[_0xff04('0x40')](_0x130214['where'],{'$or':_[_0xff04('0x2d')](_0x5b5cfb,function(_0x98c851){if(_0x98c851[_0xff04('0x31')]!==_0xff04('0x41')){var _0xa082d1={};_0xa082d1[_0x98c851['name']]={'$like':'%'+_0x133e62[_0xff04('0x34')]['filter']+'%'};return _0xa082d1;}})});}_0x130214=_[_0xff04('0x40')]({},_0x130214,_0x133e62['options']);var _0x28d3bf={'where':_0x130214[_0xff04('0x3e')]};return db[_0xff04('0x2e')][_0xff04('0x21')](_0x28d3bf)['then'](function(_0x58cd3d){_0x237e59[_0xff04('0x21')]=_0x58cd3d;if(_0x133e62[_0xff04('0x34')]['includeAll']){_0x130214['include']=[{'all':!![]}];}return db[_0xff04('0x2e')][_0xff04('0x42')](_0x130214);})['then'](function(_0xa78c0f){_0x237e59['rows']=_0xa78c0f;return _0x237e59;})[_0xff04('0x26')](respondWithFilteredResult(_0x3f79e6,_0x130214))[_0xff04('0x43')](handleError(_0x3f79e6,null));};exports[_0xff04('0x44')]=function(_0x5e1630,_0x2694ca){var _0x54b6aa={'raw':!![],'where':{'id':_0x5e1630[_0xff04('0x45')]['id']}},_0xc56e09={};_0xc56e09[_0xff04('0x33')]=_[_0xff04('0x35')](db[_0xff04('0x2e')][_0xff04('0x2f')]);_0xc56e09[_0xff04('0x34')]=_['keys'](_0x5e1630[_0xff04('0x34')]);_0xc56e09[_0xff04('0x36')]=_[_0xff04('0x37')](_0xc56e09[_0xff04('0x33')],_0xc56e09[_0xff04('0x34')]);_0x54b6aa[_0xff04('0x38')]=_['intersection'](_0xc56e09[_0xff04('0x33')],qs[_0xff04('0x39')](_0x5e1630['query']['fields']));_0x54b6aa[_0xff04('0x38')]=_0x54b6aa['attributes'][_0xff04('0x46')]?_0x54b6aa['attributes']:_0xc56e09[_0xff04('0x33')];if(_0x5e1630[_0xff04('0x34')][_0xff04('0x47')]){_0x54b6aa[_0xff04('0x48')]=[{'all':!![]}];}_0x54b6aa=_[_0xff04('0x40')]({},_0x54b6aa,_0x5e1630[_0xff04('0x49')]);return db[_0xff04('0x2e')][_0xff04('0x4a')](_0x54b6aa)[_0xff04('0x26')](handleEntityNotFound(_0x2694ca,null))[_0xff04('0x26')](respondWithResult(_0x2694ca,null))[_0xff04('0x43')](handleError(_0x2694ca,null));};exports[_0xff04('0x4b')]=function(_0x2a60c6,_0x147f4c){return db['Dynamics365Field'][_0xff04('0x4b')](_0x2a60c6[_0xff04('0x4c')],{})[_0xff04('0x26')](respondWithResult(_0x147f4c,0xc9))[_0xff04('0x43')](handleError(_0x147f4c,null));};exports['update']=function(_0xbfc094,_0x3fa26c){if(_0xbfc094[_0xff04('0x4c')]['id']){delete _0xbfc094[_0xff04('0x4c')]['id'];}return db[_0xff04('0x2e')]['find']({'where':{'id':_0xbfc094[_0xff04('0x45')]['id']}})[_0xff04('0x26')](handleEntityNotFound(_0x3fa26c,null))[_0xff04('0x26')](saveUpdates(_0xbfc094[_0xff04('0x4c')],null))[_0xff04('0x26')](respondWithResult(_0x3fa26c,null))[_0xff04('0x43')](handleError(_0x3fa26c,null));};exports[_0xff04('0x4d')]=function(_0x164deb,_0xeb88d){return db[_0xff04('0x2e')]['find']({'where':{'id':_0x164deb[_0xff04('0x45')]['id']}})[_0xff04('0x26')](handleEntityNotFound(_0xeb88d,null))[_0xff04('0x26')](removeEntity(_0xeb88d,null))[_0xff04('0x43')](handleError(_0xeb88d,null));}; \ No newline at end of file +var _0x4f15=['apply','save','update','then','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','merge','filter','include','rows','catch','show','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4f15,0x137));var _0x54f1=function(_0xafdfa,_0x742f3a){_0xafdfa=_0xafdfa-0x0;var _0x23e952=_0x4f15[_0xafdfa];return _0x23e952;};'use strict';var emlformat=require(_0x54f1('0x0'));var rimraf=require(_0x54f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54f1('0x2'));var rp=require(_0x54f1('0x3'));var moment=require(_0x54f1('0x4'));var BPromise=require(_0x54f1('0x5'));var Mustache=require(_0x54f1('0x6'));var util=require(_0x54f1('0x7'));var path=require('path');var sox=require(_0x54f1('0x8'));var csv=require(_0x54f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54f1('0xa'));var _=require(_0x54f1('0xb'));var squel=require(_0x54f1('0xc'));var crypto=require(_0x54f1('0xd'));var jsforce=require(_0x54f1('0xe'));var deskjs=require(_0x54f1('0xf'));var toCsv=require(_0x54f1('0x9'));var querystring=require('querystring');var Papa=require(_0x54f1('0x10'));var Redis=require(_0x54f1('0x11'));var authService=require(_0x54f1('0x12'));var qs=require(_0x54f1('0x13'));var as=require(_0x54f1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x54f1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x54f1('0x16'));var db=require(_0x54f1('0x17'))['db'];function respondWithStatusCode(_0x2aa871,_0x504eb6){_0x504eb6=_0x504eb6||0xcc;return function(_0x4770d9){if(_0x4770d9){return _0x2aa871[_0x54f1('0x18')](_0x504eb6);}return _0x2aa871['status'](_0x504eb6)[_0x54f1('0x19')]();};}function respondWithResult(_0x461f08,_0x1a1807){_0x1a1807=_0x1a1807||0xc8;return function(_0x23244d){if(_0x23244d){return _0x461f08[_0x54f1('0x1a')](_0x1a1807)[_0x54f1('0x1b')](_0x23244d);}};}function respondWithFilteredResult(_0x585264,_0x26a18b){return function(_0x553453){if(_0x553453){var _0x583657=typeof _0x26a18b[_0x54f1('0x1c')]===_0x54f1('0x1d')&&typeof _0x26a18b['limit']===_0x54f1('0x1d');var _0x2df215=_0x553453[_0x54f1('0x1e')];var _0xe438e1=_0x583657?0x0:_0x26a18b[_0x54f1('0x1c')];var _0x121d9d=_0x583657?_0x553453[_0x54f1('0x1e')]:_0x26a18b[_0x54f1('0x1c')]+_0x26a18b[_0x54f1('0x1f')];var _0x313ed6;if(_0x121d9d>=_0x2df215){_0x121d9d=_0x2df215;_0x313ed6=0xc8;}else{_0x313ed6=0xce;}_0x585264[_0x54f1('0x1a')](_0x313ed6);return _0x585264[_0x54f1('0x20')](_0x54f1('0x21'),_0xe438e1+'-'+_0x121d9d+'/'+_0x2df215)['json'](_0x553453);}return null;};}function patchUpdates(_0x4c3a0a){return function(_0x3acfff){try{jsonpatch[_0x54f1('0x22')](_0x3acfff,_0x4c3a0a,!![]);}catch(_0x2285f1){return BPromise['reject'](_0x2285f1);}return _0x3acfff[_0x54f1('0x23')]();};}function saveUpdates(_0x30aa06,_0x35bb24){return function(_0x510d52){if(_0x510d52){return _0x510d52[_0x54f1('0x24')](_0x30aa06)[_0x54f1('0x25')](function(_0x252021){return _0x252021;});}return null;};}function removeEntity(_0x1a0563,_0x2994b6){return function(_0x5b6717){if(_0x5b6717){return _0x5b6717['destroy']()['then'](function(){_0x1a0563[_0x54f1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216d2c,_0x350fa){return function(_0xd1cdc5){if(!_0xd1cdc5){_0x216d2c[_0x54f1('0x18')](0x194);}return _0xd1cdc5;};}function handleError(_0x2977d3,_0x31b27a){_0x31b27a=_0x31b27a||0x1f4;return function(_0x5707b3){logger['error'](_0x5707b3[_0x54f1('0x26')]);if(_0x5707b3[_0x54f1('0x27')]){delete _0x5707b3['name'];}_0x2977d3['status'](_0x31b27a)[_0x54f1('0x28')](_0x5707b3);};}exports[_0x54f1('0x29')]=function(_0x8929d3,_0x214289){var _0x1a5c4a={},_0x1af127={},_0x4d33c1={'count':0x0,'rows':[]};var _0x82fd49=_[_0x54f1('0x2a')](db[_0x54f1('0x2b')][_0x54f1('0x2c')],function(_0x830750){return{'name':_0x830750[_0x54f1('0x2d')],'type':_0x830750['type'][_0x54f1('0x2e')]};});_0x1af127[_0x54f1('0x2f')]=_[_0x54f1('0x2a')](_0x82fd49,'name');_0x1af127[_0x54f1('0x30')]=_[_0x54f1('0x31')](_0x8929d3['query']);_0x1af127[_0x54f1('0x32')]=_[_0x54f1('0x33')](_0x1af127[_0x54f1('0x2f')],_0x1af127['query']);_0x1a5c4a[_0x54f1('0x34')]=_['intersection'](_0x1af127[_0x54f1('0x2f')],qs[_0x54f1('0x35')](_0x8929d3['query'][_0x54f1('0x35')]));_0x1a5c4a[_0x54f1('0x34')]=_0x1a5c4a[_0x54f1('0x34')][_0x54f1('0x36')]?_0x1a5c4a[_0x54f1('0x34')]:_0x1af127['model'];if(!_0x8929d3[_0x54f1('0x30')][_0x54f1('0x37')]('nolimit')){_0x1a5c4a[_0x54f1('0x1f')]=qs[_0x54f1('0x1f')](_0x8929d3[_0x54f1('0x30')][_0x54f1('0x1f')]);_0x1a5c4a[_0x54f1('0x1c')]=qs['offset'](_0x8929d3[_0x54f1('0x30')][_0x54f1('0x1c')]);}_0x1a5c4a['order']=qs['sort'](_0x8929d3[_0x54f1('0x30')]['sort']);_0x1a5c4a[_0x54f1('0x38')]=qs[_0x54f1('0x32')](_[_0x54f1('0x39')](_0x8929d3['query'],_0x1af127[_0x54f1('0x32')]),_0x82fd49);if(_0x8929d3[_0x54f1('0x30')]['filter']){_0x1a5c4a['where']=_[_0x54f1('0x3a')](_0x1a5c4a[_0x54f1('0x38')],{'$or':_[_0x54f1('0x2a')](_0x82fd49,function(_0x4043f9){if(_0x4043f9['type']!=='VIRTUAL'){var _0x913b25={};_0x913b25[_0x4043f9[_0x54f1('0x27')]]={'$like':'%'+_0x8929d3[_0x54f1('0x30')][_0x54f1('0x3b')]+'%'};return _0x913b25;}})});}_0x1a5c4a=_[_0x54f1('0x3a')]({},_0x1a5c4a,_0x8929d3['options']);var _0x267a4d={'where':_0x1a5c4a[_0x54f1('0x38')]};return db['Dynamics365Field']['count'](_0x267a4d)[_0x54f1('0x25')](function(_0x44686e){_0x4d33c1['count']=_0x44686e;if(_0x8929d3[_0x54f1('0x30')]['includeAll']){_0x1a5c4a[_0x54f1('0x3c')]=[{'all':!![]}];}return db[_0x54f1('0x2b')]['findAll'](_0x1a5c4a);})[_0x54f1('0x25')](function(_0x13fbb1){_0x4d33c1[_0x54f1('0x3d')]=_0x13fbb1;return _0x4d33c1;})[_0x54f1('0x25')](respondWithFilteredResult(_0x214289,_0x1a5c4a))[_0x54f1('0x3e')](handleError(_0x214289,null));};exports[_0x54f1('0x3f')]=function(_0x180b5e,_0x23afe0){var _0x4226dc={'raw':!![],'where':{'id':_0x180b5e['params']['id']}},_0x5146ff={};_0x5146ff[_0x54f1('0x2f')]=_[_0x54f1('0x31')](db[_0x54f1('0x2b')]['rawAttributes']);_0x5146ff[_0x54f1('0x30')]=_[_0x54f1('0x31')](_0x180b5e[_0x54f1('0x30')]);_0x5146ff[_0x54f1('0x32')]=_['intersection'](_0x5146ff[_0x54f1('0x2f')],_0x5146ff['query']);_0x4226dc['attributes']=_['intersection'](_0x5146ff[_0x54f1('0x2f')],qs[_0x54f1('0x35')](_0x180b5e[_0x54f1('0x30')][_0x54f1('0x35')]));_0x4226dc[_0x54f1('0x34')]=_0x4226dc[_0x54f1('0x34')]['length']?_0x4226dc[_0x54f1('0x34')]:_0x5146ff[_0x54f1('0x2f')];if(_0x180b5e[_0x54f1('0x30')]['includeAll']){_0x4226dc[_0x54f1('0x3c')]=[{'all':!![]}];}_0x4226dc=_[_0x54f1('0x3a')]({},_0x4226dc,_0x180b5e[_0x54f1('0x40')]);return db[_0x54f1('0x2b')][_0x54f1('0x41')](_0x4226dc)[_0x54f1('0x25')](handleEntityNotFound(_0x23afe0,null))[_0x54f1('0x25')](respondWithResult(_0x23afe0,null))[_0x54f1('0x3e')](handleError(_0x23afe0,null));};exports[_0x54f1('0x42')]=function(_0x4361f1,_0x57ad2c){return db['Dynamics365Field'][_0x54f1('0x42')](_0x4361f1[_0x54f1('0x43')],{})[_0x54f1('0x25')](respondWithResult(_0x57ad2c,0xc9))[_0x54f1('0x3e')](handleError(_0x57ad2c,null));};exports['update']=function(_0x45e2cf,_0x1ed6bb){if(_0x45e2cf[_0x54f1('0x43')]['id']){delete _0x45e2cf[_0x54f1('0x43')]['id'];}return db[_0x54f1('0x2b')][_0x54f1('0x41')]({'where':{'id':_0x45e2cf[_0x54f1('0x44')]['id']}})[_0x54f1('0x25')](handleEntityNotFound(_0x1ed6bb,null))[_0x54f1('0x25')](saveUpdates(_0x45e2cf[_0x54f1('0x43')],null))[_0x54f1('0x25')](respondWithResult(_0x1ed6bb,null))[_0x54f1('0x3e')](handleError(_0x1ed6bb,null));};exports['destroy']=function(_0x600d88,_0x44ff55){return db[_0x54f1('0x2b')][_0x54f1('0x41')]({'where':{'id':_0x600d88[_0x54f1('0x44')]['id']}})[_0x54f1('0x25')](handleEntityNotFound(_0x44ff55,null))[_0x54f1('0x25')](removeEntity(_0x44ff55,null))['catch'](handleError(_0x44ff55,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 525556d..ba07537 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 _0x5eda=['rimraf','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','api','moment','request-promise','path'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x5eda,0x9b));var _0xa5ed=function(_0x148169,_0x563a50){_0x148169=_0x148169-0x0;var _0x4518dc=_0x5eda[_0x148169];return _0x4518dc;};'use strict';var _=require(_0xa5ed('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa5ed('0x1'));var moment=require(_0xa5ed('0x2'));var BPromise=require('bluebird');var rp=require(_0xa5ed('0x3'));var fs=require('fs');var path=require(_0xa5ed('0x4'));var rimraf=require(_0xa5ed('0x5'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0xa5ed('0x6')]=function(_0x1c112c,_0x210db3){return _0x1c112c['define'](_0xa5ed('0x7'),attributes,{'tableName':_0xa5ed('0x8'),'paranoid':![],'indexes':[{'name':_0xa5ed('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c05=['FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x3c4b4c,_0x108558){var _0x2f65c7=function(_0x4d67b2){while(--_0x4d67b2){_0x3c4b4c['push'](_0x3c4b4c['shift']());}};_0x2f65c7(++_0x108558);}(_0x0c05,0x6a));var _0x50c0=function(_0x414b5b,_0x24d20a){_0x414b5b=_0x414b5b-0x0;var _0x40ad7a=_0x0c05[_0x414b5b];return _0x40ad7a;};'use strict';var _=require(_0x50c0('0x0'));var util=require('util');var logger=require(_0x50c0('0x1'))('api');var moment=require(_0x50c0('0x2'));var BPromise=require(_0x50c0('0x3'));var rp=require(_0x50c0('0x4'));var fs=require('fs');var path=require(_0x50c0('0x5'));var rimraf=require(_0x50c0('0x6'));var config=require('../../config/environment');var attributes=require(_0x50c0('0x7'));module[_0x50c0('0x8')]=function(_0x95a3a2,_0x2204b4){return _0x95a3a2[_0x50c0('0x9')](_0x50c0('0xa'),attributes,{'tableName':_0x50c0('0xb'),'paranoid':![],'indexes':[{'name':_0x50c0('0xc'),'fields':[_0x50c0('0xd'),_0x50c0('0xe')],'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 44b17e6..469590e 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 _0x0623=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x40bdb3,_0x5a81f2){var _0xeac086=function(_0x199fba){while(--_0x199fba){_0x40bdb3['push'](_0x40bdb3['shift']());}};_0xeac086(++_0x5a81f2);}(_0x0623,0x159));var _0x3062=function(_0x5e1fae,_0x163309){_0x5e1fae=_0x5e1fae-0x0;var _0xb13fdf=_0x0623[_0x5e1fae];return _0xb13fdf;};'use strict';var _=require(_0x3062('0x0'));var util=require(_0x3062('0x1'));var moment=require(_0x3062('0x2'));var BPromise=require(_0x3062('0x3'));var rs=require(_0x3062('0x4'));var fs=require('fs');var Redis=require(_0x3062('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3062('0x6'));var logger=require('../../config/logger')(_0x3062('0x7'));var config=require(_0x3062('0x8'));var jayson=require(_0x3062('0x9'));var client=jayson[_0x3062('0xa')][_0x3062('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x536b73,_0x4759ee,_0x20e5be){return new BPromise(function(_0x2d69e5,_0x447f7b){return client[_0x3062('0xc')](_0x536b73,_0x20e5be)[_0x3062('0xd')](function(_0x150239){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x4759ee,_0x3062('0xe'));logger[_0x3062('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4759ee,'request\x20sent',JSON[_0x3062('0x10')](_0x150239));if(_0x150239[_0x3062('0x11')]){if(_0x150239[_0x3062('0x11')]['code']===0x1f4){logger[_0x3062('0x11')](_0x3062('0x12'),_0x4759ee,_0x150239[_0x3062('0x11')][_0x3062('0x13')]);return _0x447f7b(_0x150239[_0x3062('0x11')][_0x3062('0x13')]);}logger['error'](_0x3062('0x12'),_0x4759ee,_0x150239[_0x3062('0x11')][_0x3062('0x13')]);return _0x2d69e5(_0x150239['error'][_0x3062('0x13')]);}else{logger['info'](_0x3062('0x12'),_0x4759ee,'request\x20sent');_0x2d69e5(_0x150239[_0x3062('0x14')]['message']);}})[_0x3062('0x15')](function(_0x463111){logger[_0x3062('0x11')](_0x3062('0x12'),_0x4759ee,_0x463111);_0x447f7b(_0x463111);});});} \ No newline at end of file +var _0x06c9=['info','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x06c9,0xcd));var _0x906c=function(_0x56401f,_0x5e02ca){_0x56401f=_0x56401f-0x0;var _0x2e8853=_0x06c9[_0x56401f];return _0x2e8853;};'use strict';var _=require(_0x906c('0x0'));var util=require(_0x906c('0x1'));var moment=require(_0x906c('0x2'));var BPromise=require(_0x906c('0x3'));var rs=require(_0x906c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x906c('0x5'));var logger=require('../../config/logger')(_0x906c('0x6'));var config=require(_0x906c('0x7'));var jayson=require(_0x906c('0x8'));var client=jayson[_0x906c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd040,_0x3f1ee1,_0x3ee44f){return new BPromise(function(_0x262643,_0x1eda21){return client[_0x906c('0xa')](_0x3dd040,_0x3ee44f)['then'](function(_0x1556b4){logger[_0x906c('0xb')](_0x906c('0xc'),_0x3f1ee1,'request\x20sent');logger[_0x906c('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3f1ee1,_0x906c('0xe'),JSON['stringify'](_0x1556b4));if(_0x1556b4[_0x906c('0xf')]){if(_0x1556b4[_0x906c('0xf')]['code']===0x1f4){logger[_0x906c('0xf')](_0x906c('0xc'),_0x3f1ee1,_0x1556b4[_0x906c('0xf')][_0x906c('0x10')]);return _0x1eda21(_0x1556b4[_0x906c('0xf')]['message']);}logger[_0x906c('0xf')](_0x906c('0xc'),_0x3f1ee1,_0x1556b4[_0x906c('0xf')][_0x906c('0x10')]);return _0x262643(_0x1556b4[_0x906c('0xf')]['message']);}else{logger[_0x906c('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x3f1ee1,_0x906c('0xe'));_0x262643(_0x1556b4['result'][_0x906c('0x10')]);}})[_0x906c('0x11')](function(_0x35a5ee){logger['error'](_0x906c('0xc'),_0x3f1ee1,_0x35a5ee);_0x1eda21(_0x35a5ee);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f8fd6d2..df33c1f 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 _0x6eb8=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x2edee2,_0x4dd048){var _0x5b1d2d=function(_0x54d7a4){while(--_0x54d7a4){_0x2edee2['push'](_0x2edee2['shift']());}};_0x5b1d2d(++_0x4dd048);}(_0x6eb8,0xe9));var _0x86eb=function(_0x7efe31,_0x1b42d3){_0x7efe31=_0x7efe31-0x0;var _0x59ea5a=_0x6eb8[_0x7efe31];return _0x59ea5a;};'use strict';var multer=require(_0x86eb('0x0'));var util=require(_0x86eb('0x1'));var path=require(_0x86eb('0x2'));var timeout=require(_0x86eb('0x3'));var express=require(_0x86eb('0x4'));var router=express[_0x86eb('0x5')]();var fs_extra=require(_0x86eb('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x86eb('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x86eb('0x8')]('/',auth[_0x86eb('0x9')](),controller[_0x86eb('0xa')]);router[_0x86eb('0x8')](_0x86eb('0xb'),auth[_0x86eb('0x9')](),controller[_0x86eb('0xc')]);router['get'](_0x86eb('0xd'),auth['isAuthenticated'](),controller[_0x86eb('0xe')]);router[_0x86eb('0x8')]('/:id/fields',auth[_0x86eb('0x9')](),controller['getFields']);router[_0x86eb('0xf')]('/',auth[_0x86eb('0x9')](),controller[_0x86eb('0x10')]);router[_0x86eb('0xf')](_0x86eb('0xd'),auth[_0x86eb('0x9')](),controller[_0x86eb('0x11')]);router[_0x86eb('0x12')]('/:id',auth[_0x86eb('0x9')](),controller[_0x86eb('0x13')]);router[_0x86eb('0x14')](_0x86eb('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x86eb('0x15')]=router; \ No newline at end of file +var _0xa423=['isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get'];(function(_0x37aada,_0x30099d){var _0x5ce04f=function(_0x10514e){while(--_0x10514e){_0x37aada['push'](_0x37aada['shift']());}};_0x5ce04f(++_0x30099d);}(_0xa423,0x1ca));var _0x3a42=function(_0x499a66,_0x468f9a){_0x499a66=_0x499a66-0x0;var _0x420119=_0xa423[_0x499a66];return _0x420119;};'use strict';var multer=require(_0x3a42('0x0'));var util=require(_0x3a42('0x1'));var path=require(_0x3a42('0x2'));var timeout=require(_0x3a42('0x3'));var express=require(_0x3a42('0x4'));var router=express['Router']();var fs_extra=require(_0x3a42('0x5'));var auth=require(_0x3a42('0x6'));var interaction=require(_0x3a42('0x7'));var config=require('../../config/environment');var controller=require(_0x3a42('0x8'));router[_0x3a42('0x9')]('/',auth[_0x3a42('0xa')](),controller[_0x3a42('0xb')]);router[_0x3a42('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3a42('0xc')]);router[_0x3a42('0x9')](_0x3a42('0xd'),auth[_0x3a42('0xa')](),controller[_0x3a42('0xe')]);router['get'](_0x3a42('0xf'),auth[_0x3a42('0xa')](),controller[_0x3a42('0x10')]);router[_0x3a42('0x11')]('/',auth[_0x3a42('0xa')](),controller[_0x3a42('0x12')]);router['post'](_0x3a42('0xd'),auth[_0x3a42('0xa')](),controller[_0x3a42('0x13')]);router[_0x3a42('0x14')](_0x3a42('0x15'),auth[_0x3a42('0xa')](),controller[_0x3a42('0x16')]);router[_0x3a42('0x17')](_0x3a42('0x15'),auth[_0x3a42('0xa')](),controller[_0x3a42('0x18')]);module[_0x3a42('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index fa40f86..c719acc 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 _0x065e=['sequelize','STRING','username'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x065e,0x1a7));var _0xe065=function(_0x3ffb70,_0xa23b65){_0x3ffb70=_0x3ffb70-0x0;var _0x1b8ba5=_0x065e[_0x3ffb70];return _0x1b8ba5;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe065('0x1')],'unique':_0xe065('0x2')},'apiKey':{'type':Sequelize[_0xe065('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5204=['exports','STRING','username','sequelize'];(function(_0x4305c2,_0x374c16){var _0x48194f=function(_0x58f359){while(--_0x58f359){_0x4305c2['push'](_0x4305c2['shift']());}};_0x48194f(++_0x374c16);}(_0x5204,0xdf));var _0x4520=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0x5204[_0x17823f];return _0x51fc21;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 03ba111..53db7e8 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 _0xa1b9=['util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','filter','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1ed4f5,_0x261c7e){var _0x3035d7=function(_0x579d29){while(--_0x579d29){_0x1ed4f5['push'](_0x1ed4f5['shift']());}};_0x3035d7(++_0x261c7e);}(_0xa1b9,0x71));var _0x9a1b=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa1b9[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x9a1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a1b('0x1'));var jsonpatch=require(_0x9a1b('0x2'));var rp=require(_0x9a1b('0x3'));var moment=require(_0x9a1b('0x4'));var BPromise=require(_0x9a1b('0x5'));var Mustache=require(_0x9a1b('0x6'));var util=require(_0x9a1b('0x7'));var path=require('path');var sox=require(_0x9a1b('0x8'));var csv=require(_0x9a1b('0x9'));var ejs=require(_0x9a1b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a1b('0xb'));var _=require('lodash');var squel=require(_0x9a1b('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a1b('0xd'));var deskjs=require(_0x9a1b('0xe'));var toCsv=require(_0x9a1b('0x9'));var querystring=require(_0x9a1b('0xf'));var Papa=require(_0x9a1b('0x10'));var Redis=require('ioredis');var authService=require(_0x9a1b('0x11'));var qs=require(_0x9a1b('0x12'));var as=require(_0x9a1b('0x13'));var hardwareService=require(_0x9a1b('0x14'));var logger=require(_0x9a1b('0x15'))(_0x9a1b('0x16'));var utils=require(_0x9a1b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a1b('0x18'));var db=require(_0x9a1b('0x19'))['db'];var integrations=require(_0x9a1b('0x1a'));function respondWithStatusCode(_0x5ee9d3,_0x1d016d){_0x1d016d=_0x1d016d||0xcc;return function(_0x3a129b){if(_0x3a129b){return _0x5ee9d3[_0x9a1b('0x1b')](_0x1d016d);}return _0x5ee9d3[_0x9a1b('0x1c')](_0x1d016d)[_0x9a1b('0x1d')]();};}function respondWithResult(_0x157b6f,_0x3fe388){_0x3fe388=_0x3fe388||0xc8;return function(_0x18df50){if(_0x18df50){return _0x157b6f[_0x9a1b('0x1c')](_0x3fe388)[_0x9a1b('0x1e')](_0x18df50);}};}function respondWithFilteredResult(_0x5c397f,_0x357cd9){return function(_0x2440fc){if(_0x2440fc){var _0x5a1d3b=typeof _0x357cd9[_0x9a1b('0x1f')]===_0x9a1b('0x20')&&typeof _0x357cd9[_0x9a1b('0x21')]===_0x9a1b('0x20');var _0x402d0c=_0x2440fc[_0x9a1b('0x22')];var _0xe7a820=_0x5a1d3b?0x0:_0x357cd9['offset'];var _0x403250=_0x5a1d3b?_0x2440fc[_0x9a1b('0x22')]:_0x357cd9[_0x9a1b('0x1f')]+_0x357cd9[_0x9a1b('0x21')];var _0x2dacdc;if(_0x403250>=_0x402d0c){_0x403250=_0x402d0c;_0x2dacdc=0xc8;}else{_0x2dacdc=0xce;}_0x5c397f['status'](_0x2dacdc);return _0x5c397f[_0x9a1b('0x23')](_0x9a1b('0x24'),_0xe7a820+'-'+_0x403250+'/'+_0x402d0c)[_0x9a1b('0x1e')](_0x2440fc);}return null;};}function patchUpdates(_0x1977a7){return function(_0x4a0ccd){try{jsonpatch[_0x9a1b('0x25')](_0x4a0ccd,_0x1977a7,!![]);}catch(_0x303110){return BPromise[_0x9a1b('0x26')](_0x303110);}return _0x4a0ccd[_0x9a1b('0x27')]();};}function saveUpdates(_0x1c9ab3,_0x327cac){return function(_0x2b8cfe){if(_0x2b8cfe){return _0x2b8cfe[_0x9a1b('0x28')](_0x1c9ab3)[_0x9a1b('0x29')](function(_0x37971c){return _0x37971c;});}return null;};}function removeEntity(_0x5841c1,_0x2439e9){return function(_0x3392da){if(_0x3392da){return _0x3392da[_0x9a1b('0x2a')]()['then'](function(){_0x5841c1['status'](0xcc)[_0x9a1b('0x1d')]();});}};}function handleEntityNotFound(_0x52fce9,_0x17704b){return function(_0x4a461e){if(!_0x4a461e){_0x52fce9['sendStatus'](0x194);}return _0x4a461e;};}function handleError(_0x48e736,_0x432a3d){_0x432a3d=_0x432a3d||0x1f4;return function(_0x50ebc5){logger[_0x9a1b('0x2b')](_0x50ebc5[_0x9a1b('0x2c')]);if(_0x50ebc5[_0x9a1b('0x2d')]){delete _0x50ebc5[_0x9a1b('0x2d')];}_0x48e736[_0x9a1b('0x1c')](_0x432a3d)[_0x9a1b('0x2e')](_0x50ebc5);};}exports[_0x9a1b('0x2f')]=function(_0x1453c4,_0x4070aa){var _0x2d9ca8={},_0x56f3e8={},_0x5735a4={'count':0x0,'rows':[]};var _0x46fca0=_[_0x9a1b('0x30')](db['FreshdeskAccount'][_0x9a1b('0x31')],function(_0x43c2e7){return{'name':_0x43c2e7[_0x9a1b('0x32')],'type':_0x43c2e7[_0x9a1b('0x33')][_0x9a1b('0x34')]};});_0x56f3e8[_0x9a1b('0x35')]=_[_0x9a1b('0x30')](_0x46fca0,_0x9a1b('0x2d'));_0x56f3e8[_0x9a1b('0x36')]=_['keys'](_0x1453c4[_0x9a1b('0x36')]);_0x56f3e8['filters']=_[_0x9a1b('0x37')](_0x56f3e8[_0x9a1b('0x35')],_0x56f3e8[_0x9a1b('0x36')]);_0x2d9ca8[_0x9a1b('0x38')]=_['intersection'](_0x56f3e8[_0x9a1b('0x35')],qs[_0x9a1b('0x39')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x2d9ca8[_0x9a1b('0x38')]=_0x2d9ca8[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x2d9ca8[_0x9a1b('0x38')]:_0x56f3e8[_0x9a1b('0x35')];if(!_0x1453c4['query'][_0x9a1b('0x3b')](_0x9a1b('0x3c'))){_0x2d9ca8[_0x9a1b('0x21')]=qs[_0x9a1b('0x21')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x21')]);_0x2d9ca8[_0x9a1b('0x1f')]=qs['offset'](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x1f')]);}_0x2d9ca8[_0x9a1b('0x3d')]=qs[_0x9a1b('0x3e')](_0x1453c4[_0x9a1b('0x36')][_0x9a1b('0x3e')]);_0x2d9ca8[_0x9a1b('0x3f')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x41')](_0x1453c4['query'],_0x56f3e8[_0x9a1b('0x40')]),_0x46fca0);if(_0x1453c4[_0x9a1b('0x36')]['filter']){_0x2d9ca8[_0x9a1b('0x3f')]=_[_0x9a1b('0x42')](_0x2d9ca8['where'],{'$or':_['map'](_0x46fca0,function(_0x4e7d1e){if(_0x4e7d1e[_0x9a1b('0x33')]!==_0x9a1b('0x43')){var _0x3ccca0={};_0x3ccca0[_0x4e7d1e[_0x9a1b('0x2d')]]={'$like':'%'+_0x1453c4[_0x9a1b('0x36')]['filter']+'%'};return _0x3ccca0;}})});}_0x2d9ca8=_[_0x9a1b('0x42')]({},_0x2d9ca8,_0x1453c4[_0x9a1b('0x44')]);var _0x2683a1={'where':_0x2d9ca8[_0x9a1b('0x3f')]};return db[_0x9a1b('0x45')][_0x9a1b('0x22')](_0x2683a1)[_0x9a1b('0x29')](function(_0x4da1c0){_0x5735a4[_0x9a1b('0x22')]=_0x4da1c0;if(_0x1453c4[_0x9a1b('0x36')]['includeAll']){_0x2d9ca8[_0x9a1b('0x46')]=[{'all':!![]}];}return db[_0x9a1b('0x45')][_0x9a1b('0x47')](_0x2d9ca8);})[_0x9a1b('0x29')](function(_0x59b901){_0x5735a4[_0x9a1b('0x48')]=_0x59b901;return _0x5735a4;})[_0x9a1b('0x29')](respondWithFilteredResult(_0x4070aa,_0x2d9ca8))[_0x9a1b('0x49')](handleError(_0x4070aa,null));};exports[_0x9a1b('0x4a')]=function(_0x1863d8,_0x18a606){var _0x515bb8={'raw':![],'where':{'id':_0x1863d8[_0x9a1b('0x4b')]['id']}},_0x2f852e={};_0x2f852e[_0x9a1b('0x35')]=_['keys'](db[_0x9a1b('0x45')][_0x9a1b('0x31')]);_0x2f852e[_0x9a1b('0x36')]=_[_0x9a1b('0x4c')](_0x1863d8[_0x9a1b('0x36')]);_0x2f852e[_0x9a1b('0x40')]=_[_0x9a1b('0x37')](_0x2f852e['model'],_0x2f852e[_0x9a1b('0x36')]);_0x515bb8[_0x9a1b('0x38')]=_[_0x9a1b('0x37')](_0x2f852e[_0x9a1b('0x35')],qs['fields'](_0x1863d8[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x515bb8[_0x9a1b('0x38')]=_0x515bb8[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x515bb8[_0x9a1b('0x38')]:_0x2f852e[_0x9a1b('0x35')];if(_0x1863d8['query']['includeAll']){_0x515bb8[_0x9a1b('0x46')]=[{'all':!![]}];}_0x515bb8=_[_0x9a1b('0x42')]({},_0x515bb8,_0x1863d8['options']);return db[_0x9a1b('0x45')][_0x9a1b('0x4d')](_0x515bb8)[_0x9a1b('0x29')](handleEntityNotFound(_0x18a606,null))['then'](respondWithResult(_0x18a606,null))['catch'](handleError(_0x18a606,null));};exports['create']=function(_0x31b879,_0xd5f4bf){return db['FreshdeskAccount'][_0x9a1b('0x4e')](_0x31b879[_0x9a1b('0x4f')],{})['then'](respondWithResult(_0xd5f4bf,0xc9))['catch'](handleError(_0xd5f4bf,null));};exports[_0x9a1b('0x28')]=function(_0x2ff4b5,_0x511510){if(_0x2ff4b5[_0x9a1b('0x4f')]['id']){delete _0x2ff4b5[_0x9a1b('0x4f')]['id'];}return db[_0x9a1b('0x45')][_0x9a1b('0x4d')]({'where':{'id':_0x2ff4b5['params']['id']}})['then'](handleEntityNotFound(_0x511510,null))['then'](saveUpdates(_0x2ff4b5[_0x9a1b('0x4f')],null))[_0x9a1b('0x29')](respondWithResult(_0x511510,null))[_0x9a1b('0x49')](handleError(_0x511510,null));};exports[_0x9a1b('0x2a')]=function(_0x1a608a,_0x36bb41){return db[_0x9a1b('0x45')][_0x9a1b('0x4d')]({'where':{'id':_0x1a608a[_0x9a1b('0x4b')]['id']}})[_0x9a1b('0x29')](handleEntityNotFound(_0x36bb41,null))[_0x9a1b('0x29')](removeEntity(_0x36bb41,null))[_0x9a1b('0x49')](handleError(_0x36bb41,null));};exports[_0x9a1b('0x50')]=function(_0x2bc22a,_0x5cb018,_0x5c37d2){var _0x25b950={};var _0x10f485={};var _0x25bf42;var _0x2ae8f3;return db[_0x9a1b('0x45')][_0x9a1b('0x51')]({'where':{'id':_0x2bc22a[_0x9a1b('0x4b')]['id']}})[_0x9a1b('0x29')](handleEntityNotFound(_0x5cb018,null))[_0x9a1b('0x29')](function(_0x5c35b7){if(_0x5c35b7){_0x25bf42=_0x5c35b7;_0x10f485[_0x9a1b('0x35')]=_[_0x9a1b('0x4c')](db[_0x9a1b('0x52')][_0x9a1b('0x31')]);_0x10f485['query']=_[_0x9a1b('0x4c')](_0x2bc22a[_0x9a1b('0x36')]);_0x10f485['filters']=_[_0x9a1b('0x37')](_0x10f485['model'],_0x10f485['query']);_0x25b950[_0x9a1b('0x38')]=_[_0x9a1b('0x37')](_0x10f485[_0x9a1b('0x35')],qs['fields'](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x39')]));_0x25b950[_0x9a1b('0x38')]=_0x25b950[_0x9a1b('0x38')][_0x9a1b('0x3a')]?_0x25b950[_0x9a1b('0x38')]:_0x10f485[_0x9a1b('0x35')];_0x25b950[_0x9a1b('0x3d')]=qs[_0x9a1b('0x3e')](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x3e')]);_0x25b950[_0x9a1b('0x3f')]=qs[_0x9a1b('0x40')](_[_0x9a1b('0x41')](_0x2bc22a[_0x9a1b('0x36')],_0x10f485[_0x9a1b('0x40')]));if(_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x53')]){_0x25b950[_0x9a1b('0x3f')]=_[_0x9a1b('0x42')](_0x25b950[_0x9a1b('0x3f')],{'$or':_[_0x9a1b('0x30')](_0x25b950[_0x9a1b('0x38')],function(_0x53ea49){var _0x244f08={};_0x244f08[_0x53ea49]={'$like':'%'+_0x2bc22a[_0x9a1b('0x36')]['filter']+'%'};return _0x244f08;})});}_0x25b950=_[_0x9a1b('0x42')]({},_0x25b950,_0x2bc22a[_0x9a1b('0x44')]);return _0x25bf42[_0x9a1b('0x50')](_0x25b950);}})[_0x9a1b('0x29')](function(_0x4b595b){if(_0x4b595b){_0x2ae8f3=_0x4b595b[_0x9a1b('0x3a')];if(!_0x2bc22a[_0x9a1b('0x36')]['hasOwnProperty'](_0x9a1b('0x3c'))){_0x25b950[_0x9a1b('0x21')]=qs['limit'](_0x2bc22a[_0x9a1b('0x36')][_0x9a1b('0x21')]);_0x25b950['offset']=qs[_0x9a1b('0x1f')](_0x2bc22a['query'][_0x9a1b('0x1f')]);}return _0x25bf42[_0x9a1b('0x50')](_0x25b950);}})[_0x9a1b('0x29')](function(_0x11a704){if(_0x11a704){return _0x11a704?{'count':_0x2ae8f3,'rows':_0x11a704}:null;}})['then'](respondWithResult(_0x5cb018,null))[_0x9a1b('0x49')](handleError(_0x5cb018,null));};exports[_0x9a1b('0x54')]=function(_0x265ca5,_0x2cc80c,_0x4c90ea){if(_0x265ca5[_0x9a1b('0x4f')]['id']){delete _0x265ca5[_0x9a1b('0x4f')]['id'];}return db[_0x9a1b('0x45')]['findOne']({'where':{'id':_0x265ca5[_0x9a1b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2cc80c,null))['then'](function(_0x5cd1e0){if(_0x5cd1e0){_0x265ca5[_0x9a1b('0x4f')]['AccountId']=_0x5cd1e0['id'];_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x55')]=integrations[_0x9a1b('0x56')](_0x265ca5[_0x9a1b('0x4f')]['channel'],_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x33')]);_0x265ca5['body'][_0x9a1b('0x57')]=integrations[_0x9a1b('0x58')](_0x265ca5[_0x9a1b('0x4f')]['channel'],_0x265ca5[_0x9a1b('0x4f')][_0x9a1b('0x33')]);return db[_0x9a1b('0x52')][_0x9a1b('0x4e')](_0x265ca5[_0x9a1b('0x4f')],{'include':[{'model':db[_0x9a1b('0x59')],'as':_0x9a1b('0x55')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x9a1b('0x29')](respondWithResult(_0x2cc80c,null))[_0x9a1b('0x49')](handleError(_0x2cc80c,null));};exports[_0x9a1b('0x5a')]=function(_0x3448a3,_0x289b13,_0x34a80b){var _0x40d72b='';return db[_0x9a1b('0x45')][_0x9a1b('0x51')]({'where':{'id':_0x3448a3[_0x9a1b('0x4b')]['id']},'attributes':['id','remoteUri',_0x9a1b('0x5b')]})[_0x9a1b('0x29')](handleEntityNotFound(_0x289b13,null))['then'](function(_0x4c2823){if(_0x4c2823){_0x40d72b=_0x4c2823[_0x9a1b('0x5c')];var _0x46256b=_0x40d72b['slice'](-0x1);if(_0x46256b==='/'){_0x40d72b=_0x40d72b['substring'](0x0,_0x40d72b[_0x9a1b('0x5d')](_0x46256b));}return rp({'method':_0x9a1b('0x5e'),'uri':util[_0x9a1b('0x5f')](_0x9a1b('0x60'),_0x40d72b,_0x9a1b('0x61')),'headers':{'Authorization':util[_0x9a1b('0x5f')](_0x9a1b('0x62'),new Buffer(util[_0x9a1b('0x5f')](_0x9a1b('0x63'),_0x4c2823[_0x9a1b('0x5b')]))[_0x9a1b('0x64')](_0x9a1b('0x65')))},'json':!![]});}})[_0x9a1b('0x29')](function(_0x6dc531){if(_0x6dc531){var _0x33008a=[_0x9a1b('0x66'),_0x9a1b('0x67'),_0x9a1b('0x68'),_0x9a1b('0x69'),_0x9a1b('0x1c'),_0x9a1b('0x6a'),_0x9a1b('0x6b'),'source',_0x9a1b('0x6c'),'group',_0x9a1b('0x6d')];_['remove'](_0x6dc531,function(_0xbb642d){return _0x33008a[_0x9a1b('0x6e')](_0xbb642d[_0x9a1b('0x2d')])||!_0xbb642d[_0x9a1b('0x6f')]&&_0xbb642d['type']!==_0x9a1b('0x70')&&_0xbb642d['type']!==_0x9a1b('0x71');});return{'count':_0x6dc531['length'],'rows':_['map'](_0x6dc531,function(_0x4fa66d){return{'id':_0x4fa66d[_0x9a1b('0x2d')],'name':_0x4fa66d[_0x9a1b('0x72')],'custom':!_0x4fa66d[_0x9a1b('0x6f')],'options':_0x4fa66d[_0x9a1b('0x73')]?_['map'](_0x4fa66d[_0x9a1b('0x73')],function(_0x5f2200){return{'name':_['capitalize'](_0x5f2200),'value':_0x5f2200};}):[]};})};}})['then'](respondWithResult(_0x289b13,null))[_0x9a1b('0x49')](function(_0x32a043){var _0x338c8a=_0x3448a3[_0x9a1b('0x36')][_0x9a1b('0x74')]?0x1f4:_0x32a043[_0x9a1b('0x75')]||0x1f4;logger[_0x9a1b('0x2b')](_0x9a1b('0x76'),_0x9a1b('0x5a'),_0x338c8a,JSON['stringify'](_0x32a043));delete _0x32a043[_0x9a1b('0x2d')];if(_0x338c8a===0x191){_0x338c8a=0x190;}_0x289b13[_0x9a1b('0x1c')](_0x338c8a)[_0x9a1b('0x2e')](_0x3448a3[_0x9a1b('0x36')][_0x9a1b('0x74')]?{'message':_0x9a1b('0x77'),'statusCode':_0x32a043['statusCode']}:_0x32a043);});}; \ No newline at end of file +var _0xefe2=['ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','limit','count','set','Content-Range','json','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','findOne','FreshdeskConfiguration','rawAttributes','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','GET','format','api/v2/ticket_fields','%s:X','base64','requester','subject','agent','group','source','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x171de5,_0x260fd1){var _0x1c2d68=function(_0x111adc){while(--_0x111adc){_0x171de5['push'](_0x171de5['shift']());}};_0x1c2d68(++_0x260fd1);}(_0xefe2,0xd9));var _0x2efe=function(_0x562148,_0x28c75f){_0x562148=_0x562148-0x0;var _0x3fc4b3=_0xefe2[_0x562148];return _0x3fc4b3;};'use strict';var emlformat=require(_0x2efe('0x0'));var rimraf=require(_0x2efe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2efe('0x2'));var rp=require(_0x2efe('0x3'));var moment=require('moment');var BPromise=require(_0x2efe('0x4'));var Mustache=require('mustache');var util=require(_0x2efe('0x5'));var path=require(_0x2efe('0x6'));var sox=require(_0x2efe('0x7'));var csv=require(_0x2efe('0x8'));var ejs=require(_0x2efe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2efe('0xa'));var squel=require(_0x2efe('0xb'));var crypto=require(_0x2efe('0xc'));var jsforce=require(_0x2efe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2efe('0x8'));var querystring=require(_0x2efe('0xe'));var Papa=require(_0x2efe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2efe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2efe('0x11'))(_0x2efe('0x12'));var utils=require(_0x2efe('0x13'));var config=require(_0x2efe('0x14'));var licenseUtil=require(_0x2efe('0x15'));var db=require(_0x2efe('0x16'))['db'];var integrations=require(_0x2efe('0x17'));function respondWithStatusCode(_0x250023,_0x41039a){_0x41039a=_0x41039a||0xcc;return function(_0x3c8910){if(_0x3c8910){return _0x250023['sendStatus'](_0x41039a);}return _0x250023['status'](_0x41039a)[_0x2efe('0x18')]();};}function respondWithResult(_0x1d9e5c,_0x562753){_0x562753=_0x562753||0xc8;return function(_0x5b0c6b){if(_0x5b0c6b){return _0x1d9e5c[_0x2efe('0x19')](_0x562753)['json'](_0x5b0c6b);}};}function respondWithFilteredResult(_0x235af3,_0x3b8b31){return function(_0x51cbf3){if(_0x51cbf3){var _0x5e7063=typeof _0x3b8b31[_0x2efe('0x1a')]==='undefined'&&typeof _0x3b8b31[_0x2efe('0x1b')]==='undefined';var _0x5d3f9e=_0x51cbf3[_0x2efe('0x1c')];var _0x42edc2=_0x5e7063?0x0:_0x3b8b31[_0x2efe('0x1a')];var _0x134d5f=_0x5e7063?_0x51cbf3[_0x2efe('0x1c')]:_0x3b8b31[_0x2efe('0x1a')]+_0x3b8b31[_0x2efe('0x1b')];var _0x2c92e9;if(_0x134d5f>=_0x5d3f9e){_0x134d5f=_0x5d3f9e;_0x2c92e9=0xc8;}else{_0x2c92e9=0xce;}_0x235af3[_0x2efe('0x19')](_0x2c92e9);return _0x235af3[_0x2efe('0x1d')](_0x2efe('0x1e'),_0x42edc2+'-'+_0x134d5f+'/'+_0x5d3f9e)[_0x2efe('0x1f')](_0x51cbf3);}return null;};}function patchUpdates(_0x491958){return function(_0x3522b3){try{jsonpatch['apply'](_0x3522b3,_0x491958,!![]);}catch(_0x26166c){return BPromise[_0x2efe('0x20')](_0x26166c);}return _0x3522b3[_0x2efe('0x21')]();};}function saveUpdates(_0x4ebeb6,_0x131169){return function(_0x64c028){if(_0x64c028){return _0x64c028['update'](_0x4ebeb6)[_0x2efe('0x22')](function(_0x368d08){return _0x368d08;});}return null;};}function removeEntity(_0xc24859,_0x319b7f){return function(_0x29c7c2){if(_0x29c7c2){return _0x29c7c2[_0x2efe('0x23')]()[_0x2efe('0x22')](function(){_0xc24859[_0x2efe('0x19')](0xcc)[_0x2efe('0x18')]();});}};}function handleEntityNotFound(_0x301cf2,_0x1beaad){return function(_0x26080e){if(!_0x26080e){_0x301cf2[_0x2efe('0x24')](0x194);}return _0x26080e;};}function handleError(_0x255330,_0x4c5118){_0x4c5118=_0x4c5118||0x1f4;return function(_0x2ef08c){logger[_0x2efe('0x25')](_0x2ef08c[_0x2efe('0x26')]);if(_0x2ef08c[_0x2efe('0x27')]){delete _0x2ef08c[_0x2efe('0x27')];}_0x255330[_0x2efe('0x19')](_0x4c5118)[_0x2efe('0x28')](_0x2ef08c);};}exports[_0x2efe('0x29')]=function(_0x4039cb,_0x33124f){var _0x56b011={},_0x145b1e={},_0x2f1482={'count':0x0,'rows':[]};var _0x473c51=_[_0x2efe('0x2a')](db[_0x2efe('0x2b')]['rawAttributes'],function(_0x122d35){return{'name':_0x122d35[_0x2efe('0x2c')],'type':_0x122d35[_0x2efe('0x2d')][_0x2efe('0x2e')]};});_0x145b1e[_0x2efe('0x2f')]=_[_0x2efe('0x2a')](_0x473c51,_0x2efe('0x27'));_0x145b1e[_0x2efe('0x30')]=_[_0x2efe('0x31')](_0x4039cb[_0x2efe('0x30')]);_0x145b1e['filters']=_[_0x2efe('0x32')](_0x145b1e[_0x2efe('0x2f')],_0x145b1e[_0x2efe('0x30')]);_0x56b011[_0x2efe('0x33')]=_[_0x2efe('0x32')](_0x145b1e[_0x2efe('0x2f')],qs[_0x2efe('0x34')](_0x4039cb[_0x2efe('0x30')][_0x2efe('0x34')]));_0x56b011['attributes']=_0x56b011[_0x2efe('0x33')][_0x2efe('0x35')]?_0x56b011['attributes']:_0x145b1e['model'];if(!_0x4039cb['query'][_0x2efe('0x36')](_0x2efe('0x37'))){_0x56b011[_0x2efe('0x1b')]=qs['limit'](_0x4039cb[_0x2efe('0x30')][_0x2efe('0x1b')]);_0x56b011[_0x2efe('0x1a')]=qs['offset'](_0x4039cb['query'][_0x2efe('0x1a')]);}_0x56b011['order']=qs[_0x2efe('0x38')](_0x4039cb[_0x2efe('0x30')][_0x2efe('0x38')]);_0x56b011['where']=qs[_0x2efe('0x39')](_[_0x2efe('0x3a')](_0x4039cb[_0x2efe('0x30')],_0x145b1e[_0x2efe('0x39')]),_0x473c51);if(_0x4039cb[_0x2efe('0x30')][_0x2efe('0x3b')]){_0x56b011[_0x2efe('0x3c')]=_['merge'](_0x56b011[_0x2efe('0x3c')],{'$or':_['map'](_0x473c51,function(_0x3893dc){if(_0x3893dc[_0x2efe('0x2d')]!==_0x2efe('0x3d')){var _0x30a11f={};_0x30a11f[_0x3893dc[_0x2efe('0x27')]]={'$like':'%'+_0x4039cb['query'][_0x2efe('0x3b')]+'%'};return _0x30a11f;}})});}_0x56b011=_[_0x2efe('0x3e')]({},_0x56b011,_0x4039cb['options']);var _0x431d8e={'where':_0x56b011[_0x2efe('0x3c')]};return db['FreshdeskAccount'][_0x2efe('0x1c')](_0x431d8e)[_0x2efe('0x22')](function(_0x2ec0b1){_0x2f1482[_0x2efe('0x1c')]=_0x2ec0b1;if(_0x4039cb[_0x2efe('0x30')][_0x2efe('0x3f')]){_0x56b011[_0x2efe('0x40')]=[{'all':!![]}];}return db[_0x2efe('0x2b')][_0x2efe('0x41')](_0x56b011);})[_0x2efe('0x22')](function(_0x261a1a){_0x2f1482[_0x2efe('0x42')]=_0x261a1a;return _0x2f1482;})[_0x2efe('0x22')](respondWithFilteredResult(_0x33124f,_0x56b011))[_0x2efe('0x43')](handleError(_0x33124f,null));};exports[_0x2efe('0x44')]=function(_0x529f8c,_0x10e196){var _0x84d98b={'raw':![],'where':{'id':_0x529f8c[_0x2efe('0x45')]['id']}},_0x2b3068={};_0x2b3068[_0x2efe('0x2f')]=_[_0x2efe('0x31')](db[_0x2efe('0x2b')]['rawAttributes']);_0x2b3068[_0x2efe('0x30')]=_[_0x2efe('0x31')](_0x529f8c[_0x2efe('0x30')]);_0x2b3068[_0x2efe('0x39')]=_[_0x2efe('0x32')](_0x2b3068['model'],_0x2b3068[_0x2efe('0x30')]);_0x84d98b[_0x2efe('0x33')]=_[_0x2efe('0x32')](_0x2b3068[_0x2efe('0x2f')],qs[_0x2efe('0x34')](_0x529f8c[_0x2efe('0x30')][_0x2efe('0x34')]));_0x84d98b[_0x2efe('0x33')]=_0x84d98b[_0x2efe('0x33')]['length']?_0x84d98b['attributes']:_0x2b3068['model'];if(_0x529f8c[_0x2efe('0x30')][_0x2efe('0x3f')]){_0x84d98b['include']=[{'all':!![]}];}_0x84d98b=_[_0x2efe('0x3e')]({},_0x84d98b,_0x529f8c['options']);return db['FreshdeskAccount'][_0x2efe('0x46')](_0x84d98b)['then'](handleEntityNotFound(_0x10e196,null))[_0x2efe('0x22')](respondWithResult(_0x10e196,null))[_0x2efe('0x43')](handleError(_0x10e196,null));};exports[_0x2efe('0x47')]=function(_0x4f8dc2,_0xcffd45){return db[_0x2efe('0x2b')][_0x2efe('0x47')](_0x4f8dc2[_0x2efe('0x48')],{})['then'](respondWithResult(_0xcffd45,0xc9))[_0x2efe('0x43')](handleError(_0xcffd45,null));};exports[_0x2efe('0x49')]=function(_0x5abdaf,_0x1d79a3){if(_0x5abdaf[_0x2efe('0x48')]['id']){delete _0x5abdaf[_0x2efe('0x48')]['id'];}return db[_0x2efe('0x2b')][_0x2efe('0x46')]({'where':{'id':_0x5abdaf['params']['id']}})[_0x2efe('0x22')](handleEntityNotFound(_0x1d79a3,null))[_0x2efe('0x22')](saveUpdates(_0x5abdaf[_0x2efe('0x48')],null))['then'](respondWithResult(_0x1d79a3,null))[_0x2efe('0x43')](handleError(_0x1d79a3,null));};exports[_0x2efe('0x23')]=function(_0x39a94d,_0x3abb50){return db['FreshdeskAccount'][_0x2efe('0x46')]({'where':{'id':_0x39a94d['params']['id']}})[_0x2efe('0x22')](handleEntityNotFound(_0x3abb50,null))[_0x2efe('0x22')](removeEntity(_0x3abb50,null))[_0x2efe('0x43')](handleError(_0x3abb50,null));};exports['getConfigurations']=function(_0x5b7b9d,_0x4b6b6b,_0x32898c){var _0x53fad7={};var _0x397fa3={};var _0x5227fe;var _0x327a10;return db[_0x2efe('0x2b')][_0x2efe('0x4a')]({'where':{'id':_0x5b7b9d[_0x2efe('0x45')]['id']}})[_0x2efe('0x22')](handleEntityNotFound(_0x4b6b6b,null))[_0x2efe('0x22')](function(_0x2fa3b0){if(_0x2fa3b0){_0x5227fe=_0x2fa3b0;_0x397fa3['model']=_[_0x2efe('0x31')](db[_0x2efe('0x4b')][_0x2efe('0x4c')]);_0x397fa3[_0x2efe('0x30')]=_[_0x2efe('0x31')](_0x5b7b9d[_0x2efe('0x30')]);_0x397fa3['filters']=_[_0x2efe('0x32')](_0x397fa3[_0x2efe('0x2f')],_0x397fa3[_0x2efe('0x30')]);_0x53fad7[_0x2efe('0x33')]=_[_0x2efe('0x32')](_0x397fa3['model'],qs[_0x2efe('0x34')](_0x5b7b9d[_0x2efe('0x30')][_0x2efe('0x34')]));_0x53fad7[_0x2efe('0x33')]=_0x53fad7['attributes'][_0x2efe('0x35')]?_0x53fad7[_0x2efe('0x33')]:_0x397fa3[_0x2efe('0x2f')];_0x53fad7['order']=qs[_0x2efe('0x38')](_0x5b7b9d['query'][_0x2efe('0x38')]);_0x53fad7[_0x2efe('0x3c')]=qs[_0x2efe('0x39')](_[_0x2efe('0x3a')](_0x5b7b9d['query'],_0x397fa3[_0x2efe('0x39')]));if(_0x5b7b9d[_0x2efe('0x30')][_0x2efe('0x3b')]){_0x53fad7[_0x2efe('0x3c')]=_['merge'](_0x53fad7[_0x2efe('0x3c')],{'$or':_[_0x2efe('0x2a')](_0x53fad7[_0x2efe('0x33')],function(_0x2c7c31){var _0x6f524a={};_0x6f524a[_0x2c7c31]={'$like':'%'+_0x5b7b9d[_0x2efe('0x30')][_0x2efe('0x3b')]+'%'};return _0x6f524a;})});}_0x53fad7=_['merge']({},_0x53fad7,_0x5b7b9d[_0x2efe('0x4d')]);return _0x5227fe[_0x2efe('0x4e')](_0x53fad7);}})[_0x2efe('0x22')](function(_0x2dfa90){if(_0x2dfa90){_0x327a10=_0x2dfa90[_0x2efe('0x35')];if(!_0x5b7b9d[_0x2efe('0x30')][_0x2efe('0x36')]('nolimit')){_0x53fad7['limit']=qs[_0x2efe('0x1b')](_0x5b7b9d['query'][_0x2efe('0x1b')]);_0x53fad7[_0x2efe('0x1a')]=qs[_0x2efe('0x1a')](_0x5b7b9d[_0x2efe('0x30')][_0x2efe('0x1a')]);}return _0x5227fe['getConfigurations'](_0x53fad7);}})[_0x2efe('0x22')](function(_0x110379){if(_0x110379){return _0x110379?{'count':_0x327a10,'rows':_0x110379}:null;}})[_0x2efe('0x22')](respondWithResult(_0x4b6b6b,null))['catch'](handleError(_0x4b6b6b,null));};exports[_0x2efe('0x4f')]=function(_0x19771b,_0xc708af,_0x2ce78d){if(_0x19771b[_0x2efe('0x48')]['id']){delete _0x19771b[_0x2efe('0x48')]['id'];}return db[_0x2efe('0x2b')][_0x2efe('0x4a')]({'where':{'id':_0x19771b[_0x2efe('0x45')]['id']}})['then'](handleEntityNotFound(_0xc708af,null))['then'](function(_0x44af9b){if(_0x44af9b){_0x19771b[_0x2efe('0x48')][_0x2efe('0x50')]=_0x44af9b['id'];_0x19771b[_0x2efe('0x48')][_0x2efe('0x51')]=integrations[_0x2efe('0x52')](_0x19771b[_0x2efe('0x48')][_0x2efe('0x53')],_0x19771b['body'][_0x2efe('0x2d')]);_0x19771b['body'][_0x2efe('0x54')]=integrations[_0x2efe('0x55')](_0x19771b[_0x2efe('0x48')][_0x2efe('0x53')],_0x19771b[_0x2efe('0x48')][_0x2efe('0x2d')]);return db[_0x2efe('0x4b')][_0x2efe('0x47')](_0x19771b[_0x2efe('0x48')],{'include':[{'model':db[_0x2efe('0x56')],'as':_0x2efe('0x51')},{'model':db[_0x2efe('0x56')],'as':_0x2efe('0x54')}]});}return null;})[_0x2efe('0x22')](respondWithResult(_0xc708af,null))['catch'](handleError(_0xc708af,null));};exports['getFields']=function(_0x1548c2,_0x5df06b,_0x4442f1){var _0x20d984='';return db[_0x2efe('0x2b')][_0x2efe('0x4a')]({'where':{'id':_0x1548c2[_0x2efe('0x45')]['id']},'attributes':['id',_0x2efe('0x57'),_0x2efe('0x58')]})[_0x2efe('0x22')](handleEntityNotFound(_0x5df06b,null))[_0x2efe('0x22')](function(_0x4d5804){if(_0x4d5804){_0x20d984=_0x4d5804[_0x2efe('0x57')];var _0x55aced=_0x20d984[_0x2efe('0x59')](-0x1);if(_0x55aced==='/'){_0x20d984=_0x20d984[_0x2efe('0x5a')](0x0,_0x20d984['lastIndexOf'](_0x55aced));}return rp({'method':_0x2efe('0x5b'),'uri':util[_0x2efe('0x5c')]('%s/%s',_0x20d984,_0x2efe('0x5d')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x2efe('0x5c')](_0x2efe('0x5e'),_0x4d5804[_0x2efe('0x58')]))['toString'](_0x2efe('0x5f')))},'json':!![]});}})[_0x2efe('0x22')](function(_0x906b5c){if(_0x906b5c){var _0xc1c583=[_0x2efe('0x60'),_0x2efe('0x61'),_0x2efe('0x62'),'description',_0x2efe('0x19'),'priority',_0x2efe('0x63'),_0x2efe('0x64'),'ticket_type',_0x2efe('0x63'),'company'];_[_0x2efe('0x65')](_0x906b5c,function(_0x409935){return _0xc1c583[_0x2efe('0x66')](_0x409935[_0x2efe('0x27')])||!_0x409935[_0x2efe('0x67')]&&_0x409935[_0x2efe('0x2d')]!==_0x2efe('0x68')&&_0x409935[_0x2efe('0x2d')]!==_0x2efe('0x69');});return{'count':_0x906b5c[_0x2efe('0x35')],'rows':_['map'](_0x906b5c,function(_0x2c09c4){return{'id':_0x2c09c4[_0x2efe('0x27')],'name':_0x2c09c4[_0x2efe('0x6a')],'custom':!_0x2c09c4[_0x2efe('0x67')],'options':_0x2c09c4['choices']?_['map'](_0x2c09c4[_0x2efe('0x6b')],function(_0x5f2973){return{'name':_[_0x2efe('0x6c')](_0x5f2973),'value':_0x5f2973};}):[]};})};}})[_0x2efe('0x22')](respondWithResult(_0x5df06b,null))['catch'](function(_0x26efd6){var _0x3b1d6e=_0x1548c2[_0x2efe('0x30')][_0x2efe('0x6d')]?0x1f4:_0x26efd6[_0x2efe('0x6e')]||0x1f4;logger[_0x2efe('0x25')](_0x2efe('0x6f'),_0x2efe('0x70'),_0x3b1d6e,JSON['stringify'](_0x26efd6));delete _0x26efd6[_0x2efe('0x27')];if(_0x3b1d6e===0x191){_0x3b1d6e=0x190;}_0x5df06b[_0x2efe('0x19')](_0x3b1d6e)[_0x2efe('0x28')](_0x1548c2[_0x2efe('0x30')][_0x2efe('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x26efd6[_0x2efe('0x6e')]}:_0x26efd6);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5024696..c2cccf1 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 _0xbb51=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','path','rimraf'];(function(_0x2d3f00,_0x3a1cc6){var _0x3680df=function(_0x469127){while(--_0x469127){_0x2d3f00['push'](_0x2d3f00['shift']());}};_0x3680df(++_0x3a1cc6);}(_0xbb51,0x17b));var _0x1bb5=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xbb51[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require(_0x1bb5('0x0'));var logger=require(_0x1bb5('0x1'))('api');var moment=require(_0x1bb5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bb5('0x3'));var rimraf=require(_0x1bb5('0x4'));var config=require(_0x1bb5('0x5'));var attributes=require(_0x1bb5('0x6'));var integrations=require(_0x1bb5('0x7'));module[_0x1bb5('0x8')]=function(_0x18bde2,_0x2278ca){return _0x18bde2[_0x1bb5('0x9')](_0x1bb5('0xa'),attributes,{'tableName':_0x1bb5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b2=['lodash','util','moment','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xc9b2,0xd1));var _0x2c9b=function(_0x37793d,_0x3125de){_0x37793d=_0x37793d-0x0;var _0x27f039=_0xc9b2[_0x37793d];return _0x27f039;};'use strict';var _=require(_0x2c9b('0x0'));var util=require(_0x2c9b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2c9b('0x2'));var BPromise=require('bluebird');var rp=require(_0x2c9b('0x3'));var fs=require('fs');var path=require(_0x2c9b('0x4'));var rimraf=require('rimraf');var config=require(_0x2c9b('0x5'));var attributes=require(_0x2c9b('0x6'));var integrations=require(_0x2c9b('0x7'));module[_0x2c9b('0x8')]=function(_0x2aeb6c,_0x3d0954){return _0x2aeb6c[_0x2c9b('0x9')](_0x2c9b('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 2fa9d4f..63e9628 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 _0x024c=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','map','include','model','attributes','ShowFreshdeskAccount','find','where'];(function(_0x2f984b,_0x5a6e8f){var _0x60284a=function(_0x47445f){while(--_0x47445f){_0x2f984b['push'](_0x2f984b['shift']());}};_0x60284a(++_0x5a6e8f);}(_0x024c,0x1c0));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc024('0x0'));var util=require(_0xc024('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc024('0x2'));var fs=require('fs');var Redis=require(_0xc024('0x3'));var db=require(_0xc024('0x4'))['db'];var utils=require(_0xc024('0x5'));var logger=require('../../config/logger')(_0xc024('0x6'));var config=require('../../config/environment');var jayson=require(_0xc024('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x325559,_0x3d7b44,_0xaa49d9){return new BPromise(function(_0xed0f4b,_0x51b383){return client[_0xc024('0x8')](_0x325559,_0xaa49d9)[_0xc024('0x9')](function(_0x88d51b){logger[_0xc024('0xa')](_0xc024('0xb'),_0x3d7b44,'request\x20sent');logger[_0xc024('0xc')](_0xc024('0xd'),_0x3d7b44,_0xc024('0xe'),JSON[_0xc024('0xf')](_0x88d51b));if(_0x88d51b[_0xc024('0x10')]){if(_0x88d51b['error']['code']===0x1f4){logger[_0xc024('0x10')](_0xc024('0xb'),_0x3d7b44,_0x88d51b[_0xc024('0x10')]['message']);return _0x51b383(_0x88d51b[_0xc024('0x10')][_0xc024('0x11')]);}logger[_0xc024('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x3d7b44,_0x88d51b[_0xc024('0x10')]['message']);return _0xed0f4b(_0x88d51b[_0xc024('0x10')][_0xc024('0x11')]);}else{logger[_0xc024('0xa')](_0xc024('0xb'),_0x3d7b44,_0xc024('0xe'));_0xed0f4b(_0x88d51b[_0xc024('0x12')]['message']);}})[_0xc024('0x13')](function(_0x518965){logger['error'](_0xc024('0xb'),_0x3d7b44,_0x518965);_0x51b383(_0x518965);});});}exports[_0xc024('0x14')]=function(_0x1a3b4a){var _0x3b0b86=this;return new Promise(function(_0x106c3e,_0x1f93f5){return db[_0xc024('0x15')][_0xc024('0x16')]({'raw':_0x1a3b4a[_0xc024('0x17')]?_0x1a3b4a[_0xc024('0x17')][_0xc024('0x18')]===undefined?!![]:![]:!![],'where':_0x1a3b4a['options']?_0x1a3b4a['options']['where']||null:null,'attributes':_0x1a3b4a[_0xc024('0x17')]?_0x1a3b4a[_0xc024('0x17')]['attributes']||null:null,'limit':_0x1a3b4a[_0xc024('0x17')]?_0x1a3b4a[_0xc024('0x17')]['limit']||null:null,'include':_0x1a3b4a['options']?_0x1a3b4a[_0xc024('0x17')]['include']?_[_0xc024('0x19')](_0x1a3b4a[_0xc024('0x17')][_0xc024('0x1a')],function(_0x3445b4){return{'model':db[_0x3445b4[_0xc024('0x1b')]],'as':_0x3445b4['as'],'attributes':_0x3445b4['attributes'],'include':_0x3445b4['include']?_[_0xc024('0x19')](_0x3445b4[_0xc024('0x1a')],function(_0x2944ba){return{'model':db[_0x2944ba['model']],'as':_0x2944ba['as'],'attributes':_0x2944ba[_0xc024('0x1c')],'include':_0x2944ba[_0xc024('0x1a')]?_[_0xc024('0x19')](_0x2944ba[_0xc024('0x1a')],function(_0x3ea135){return{'model':db[_0x3ea135['model']],'as':_0x3ea135['as'],'attributes':_0x3ea135[_0xc024('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc024('0x9')](function(_0x582a4c){logger[_0xc024('0xa')](_0xc024('0x14'),_0x1a3b4a);logger['debug'](_0xc024('0x14'),_0x1a3b4a,JSON[_0xc024('0xf')](_0x582a4c));_0x106c3e(_0x582a4c);})['catch'](function(_0x52cdd9){logger[_0xc024('0x10')](_0xc024('0x14'),_0x52cdd9[_0xc024('0x11')],_0x1a3b4a);_0x1f93f5(_0x3b0b86[_0xc024('0x10')](0x1f4,_0x52cdd9[_0xc024('0x11')]));});});};exports[_0xc024('0x1d')]=function(_0x44f884){var _0x237998=this;return new Promise(function(_0x4f8502,_0x5824a9){return db['FreshdeskAccount'][_0xc024('0x1e')]({'raw':_0x44f884[_0xc024('0x17')]?_0x44f884[_0xc024('0x17')][_0xc024('0x18')]===undefined?!![]:![]:!![],'where':_0x44f884[_0xc024('0x17')]?_0x44f884[_0xc024('0x17')][_0xc024('0x1f')]||null:null,'attributes':_0x44f884[_0xc024('0x17')]?_0x44f884['options'][_0xc024('0x1c')]||null:null,'include':_0x44f884[_0xc024('0x17')]?_0x44f884[_0xc024('0x17')][_0xc024('0x1a')]?_[_0xc024('0x19')](_0x44f884[_0xc024('0x17')][_0xc024('0x1a')],function(_0x4d46b7){return{'model':db[_0x4d46b7['model']],'as':_0x4d46b7['as'],'attributes':_0x4d46b7[_0xc024('0x1c')],'include':_0x4d46b7[_0xc024('0x1a')]?_[_0xc024('0x19')](_0x4d46b7['include'],function(_0x57f4c6){return{'model':db[_0x57f4c6[_0xc024('0x1b')]],'as':_0x57f4c6['as'],'attributes':_0x57f4c6['attributes'],'include':_0x57f4c6[_0xc024('0x1a')]?_[_0xc024('0x19')](_0x57f4c6['include'],function(_0x4b6a0c){return{'model':db[_0x4b6a0c[_0xc024('0x1b')]],'as':_0x4b6a0c['as'],'attributes':_0x4b6a0c[_0xc024('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc024('0x9')](function(_0x128fc3){logger['info'](_0xc024('0x1d'),_0x44f884);logger['debug'](_0xc024('0x1d'),_0x44f884,JSON['stringify'](_0x128fc3));_0x4f8502(_0x128fc3);})[_0xc024('0x13')](function(_0x432341){logger[_0xc024('0x10')](_0xc024('0x1d'),_0x432341['message'],_0x44f884);_0x5824a9(_0x237998[_0xc024('0x10')](0x1f4,_0x432341['message']));});});}; \ No newline at end of file +var _0x128c=['map','ShowFreshdeskAccount','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','limit','include','model','attributes','GetFreshdeskAccount','stringify','find'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x128c,0x96));var _0xc128=function(_0x388b8d,_0x16902b){_0x388b8d=_0x388b8d-0x0;var _0x108b7c=_0x128c[_0x388b8d];return _0x108b7c;};'use strict';var _=require(_0xc128('0x0'));var util=require(_0xc128('0x1'));var moment=require(_0xc128('0x2'));var BPromise=require(_0xc128('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc128('0x4'))['db'];var utils=require(_0xc128('0x5'));var logger=require(_0xc128('0x6'))(_0xc128('0x7'));var config=require(_0xc128('0x8'));var jayson=require(_0xc128('0x9'));var client=jayson['client'][_0xc128('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x515c2b,_0x17fba9,_0x4e671f){return new BPromise(function(_0x450a9c,_0x44f379){return client[_0xc128('0xb')](_0x515c2b,_0x4e671f)[_0xc128('0xc')](function(_0x246c4a){logger[_0xc128('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x17fba9,_0xc128('0xe'));logger[_0xc128('0xf')](_0xc128('0x10'),_0x17fba9,'request\x20sent',JSON['stringify'](_0x246c4a));if(_0x246c4a[_0xc128('0x11')]){if(_0x246c4a['error'][_0xc128('0x12')]===0x1f4){logger[_0xc128('0x11')](_0xc128('0x13'),_0x17fba9,_0x246c4a[_0xc128('0x11')][_0xc128('0x14')]);return _0x44f379(_0x246c4a[_0xc128('0x11')]['message']);}logger['error'](_0xc128('0x13'),_0x17fba9,_0x246c4a[_0xc128('0x11')]['message']);return _0x450a9c(_0x246c4a[_0xc128('0x11')][_0xc128('0x14')]);}else{logger[_0xc128('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x17fba9,_0xc128('0xe'));_0x450a9c(_0x246c4a[_0xc128('0x15')][_0xc128('0x14')]);}})[_0xc128('0x16')](function(_0x36a034){logger[_0xc128('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x17fba9,_0x36a034);_0x44f379(_0x36a034);});});}exports['GetFreshdeskAccount']=function(_0x31968f){var _0x6d473f=this;return new Promise(function(_0x4ffaf0,_0x13a43a){return db[_0xc128('0x17')][_0xc128('0x18')]({'raw':_0x31968f['options']?_0x31968f[_0xc128('0x19')][_0xc128('0x1a')]===undefined?!![]:![]:!![],'where':_0x31968f[_0xc128('0x19')]?_0x31968f[_0xc128('0x19')][_0xc128('0x1b')]||null:null,'attributes':_0x31968f[_0xc128('0x19')]?_0x31968f[_0xc128('0x19')]['attributes']||null:null,'limit':_0x31968f[_0xc128('0x19')]?_0x31968f[_0xc128('0x19')][_0xc128('0x1c')]||null:null,'include':_0x31968f[_0xc128('0x19')]?_0x31968f[_0xc128('0x19')]['include']?_['map'](_0x31968f['options'][_0xc128('0x1d')],function(_0xca3fd7){return{'model':db[_0xca3fd7[_0xc128('0x1e')]],'as':_0xca3fd7['as'],'attributes':_0xca3fd7[_0xc128('0x1f')],'include':_0xca3fd7[_0xc128('0x1d')]?_['map'](_0xca3fd7[_0xc128('0x1d')],function(_0x276bac){return{'model':db[_0x276bac[_0xc128('0x1e')]],'as':_0x276bac['as'],'attributes':_0x276bac[_0xc128('0x1f')],'include':_0x276bac['include']?_['map'](_0x276bac[_0xc128('0x1d')],function(_0xe29f99){return{'model':db[_0xe29f99[_0xc128('0x1e')]],'as':_0xe29f99['as'],'attributes':_0xe29f99[_0xc128('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51304){logger[_0xc128('0xd')]('GetFreshdeskAccount',_0x31968f);logger['debug'](_0xc128('0x20'),_0x31968f,JSON[_0xc128('0x21')](_0x51304));_0x4ffaf0(_0x51304);})[_0xc128('0x16')](function(_0x55b623){logger[_0xc128('0x11')](_0xc128('0x20'),_0x55b623[_0xc128('0x14')],_0x31968f);_0x13a43a(_0x6d473f[_0xc128('0x11')](0x1f4,_0x55b623['message']));});});};exports['ShowFreshdeskAccount']=function(_0x7c0823){var _0x21a8cf=this;return new Promise(function(_0x253902,_0x22117f){return db[_0xc128('0x17')][_0xc128('0x22')]({'raw':_0x7c0823[_0xc128('0x19')]?_0x7c0823['options'][_0xc128('0x1a')]===undefined?!![]:![]:!![],'where':_0x7c0823[_0xc128('0x19')]?_0x7c0823[_0xc128('0x19')][_0xc128('0x1b')]||null:null,'attributes':_0x7c0823[_0xc128('0x19')]?_0x7c0823[_0xc128('0x19')][_0xc128('0x1f')]||null:null,'include':_0x7c0823[_0xc128('0x19')]?_0x7c0823['options']['include']?_['map'](_0x7c0823['options'][_0xc128('0x1d')],function(_0x522b80){return{'model':db[_0x522b80[_0xc128('0x1e')]],'as':_0x522b80['as'],'attributes':_0x522b80[_0xc128('0x1f')],'include':_0x522b80[_0xc128('0x1d')]?_[_0xc128('0x23')](_0x522b80[_0xc128('0x1d')],function(_0x50d80f){return{'model':db[_0x50d80f['model']],'as':_0x50d80f['as'],'attributes':_0x50d80f[_0xc128('0x1f')],'include':_0x50d80f[_0xc128('0x1d')]?_[_0xc128('0x23')](_0x50d80f[_0xc128('0x1d')],function(_0x20a819){return{'model':db[_0x20a819[_0xc128('0x1e')]],'as':_0x20a819['as'],'attributes':_0x20a819[_0xc128('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc128('0xc')](function(_0x99ca5c){logger[_0xc128('0xd')](_0xc128('0x24'),_0x7c0823);logger[_0xc128('0xf')](_0xc128('0x24'),_0x7c0823,JSON[_0xc128('0x21')](_0x99ca5c));_0x253902(_0x99ca5c);})[_0xc128('0x16')](function(_0x2b9b47){logger[_0xc128('0x11')](_0xc128('0x24'),_0x2b9b47['message'],_0x7c0823);_0x22117f(_0x21a8cf[_0xc128('0x11')](0x1f4,_0x2b9b47[_0xc128('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d3584d9..1f4d7bb 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 _0xe489=['isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe489,0x1d3));var _0x9e48=function(_0x319579,_0x2b7876){_0x319579=_0x319579-0x0;var _0x2e66e0=_0xe489[_0x319579];return _0x2e66e0;};'use strict';var multer=require('multer');var util=require(_0x9e48('0x0'));var path=require('path');var timeout=require(_0x9e48('0x1'));var express=require(_0x9e48('0x2'));var router=express[_0x9e48('0x3')]();var fs_extra=require(_0x9e48('0x4'));var auth=require(_0x9e48('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e48('0x6'));router[_0x9e48('0x7')]('/',auth[_0x9e48('0x8')](),controller[_0x9e48('0x9')]);router[_0x9e48('0x7')](_0x9e48('0xa'),auth[_0x9e48('0x8')](),controller[_0x9e48('0xb')]);router['get'](_0x9e48('0xc'),auth[_0x9e48('0x8')](),controller[_0x9e48('0xd')]);router[_0x9e48('0x7')](_0x9e48('0xe'),auth[_0x9e48('0x8')](),controller[_0x9e48('0xf')]);router[_0x9e48('0x7')](_0x9e48('0x10'),auth[_0x9e48('0x8')](),controller['getDescriptions']);router[_0x9e48('0x7')](_0x9e48('0x11'),auth[_0x9e48('0x8')](),controller['getTags']);router[_0x9e48('0x12')]('/',auth[_0x9e48('0x8')](),controller['create']);router[_0x9e48('0x12')](_0x9e48('0x11'),auth[_0x9e48('0x8')](),controller[_0x9e48('0x13')]);router[_0x9e48('0x14')](_0x9e48('0xa'),auth[_0x9e48('0x8')](),controller[_0x9e48('0x15')]);router[_0x9e48('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x9e48('0x17')]);module[_0x9e48('0x18')]=router; \ No newline at end of file +var _0x897c=['/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','setTags','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','index','get','/:id','isAuthenticated','show','getFields','/:id/subjects'];(function(_0x4077a7,_0x503eaa){var _0x50c10c=function(_0x5aeb44){while(--_0x5aeb44){_0x4077a7['push'](_0x4077a7['shift']());}};_0x50c10c(++_0x503eaa);}(_0x897c,0x1be));var _0xc897=function(_0xd515f3,_0x409be6){_0xd515f3=_0xd515f3-0x0;var _0x5bb693=_0x897c[_0xd515f3];return _0x5bb693;};'use strict';var multer=require(_0xc897('0x0'));var util=require(_0xc897('0x1'));var path=require(_0xc897('0x2'));var timeout=require(_0xc897('0x3'));var express=require(_0xc897('0x4'));var router=express[_0xc897('0x5')]();var fs_extra=require(_0xc897('0x6'));var auth=require(_0xc897('0x7'));var interaction=require(_0xc897('0x8'));var config=require(_0xc897('0x9'));var controller=require(_0xc897('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xc897('0xb')]);router[_0xc897('0xc')](_0xc897('0xd'),auth[_0xc897('0xe')](),controller[_0xc897('0xf')]);router[_0xc897('0xc')]('/:id/fields',auth[_0xc897('0xe')](),controller[_0xc897('0x10')]);router[_0xc897('0xc')](_0xc897('0x11'),auth[_0xc897('0xe')](),controller['getSubjects']);router['get'](_0xc897('0x12'),auth[_0xc897('0xe')](),controller[_0xc897('0x13')]);router[_0xc897('0xc')]('/:id/tags',auth[_0xc897('0xe')](),controller[_0xc897('0x14')]);router['post']('/',auth[_0xc897('0xe')](),controller[_0xc897('0x15')]);router[_0xc897('0x16')](_0xc897('0x17'),auth[_0xc897('0xe')](),controller[_0xc897('0x18')]);router[_0xc897('0x19')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc897('0x1a')](_0xc897('0xd'),auth[_0xc897('0xe')](),controller[_0xc897('0x1b')]);module[_0xc897('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 6c0b90c..2b4b9a8 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 _0x84d6=['sequelize','STRING'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0x84d6,0x10a));var _0x684d=function(_0x16c770,_0x5330b1){_0x16c770=_0x16c770-0x0;var _0x586d79=_0x84d6[_0x16c770];return _0x586d79;};'use strict';var Sequelize=require(_0x684d('0x0'));module['exports']={'name':{'type':Sequelize[_0x684d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x23f4=['exports'];(function(_0x397085,_0x4f3b22){var _0x290e6f=function(_0x335155){while(--_0x335155){_0x397085['push'](_0x397085['shift']());}};_0x290e6f(++_0x4f3b22);}(_0x23f4,0x1ce));var _0x423f=function(_0x4d412d,_0x51f186){_0x4d412d=_0x4d412d-0x0;var _0x235b54=_0x23f4[_0x4d412d];return _0x235b54;};'use strict';var Sequelize=require('sequelize');module[_0x423f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 58f08f9..757733e 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 _0xc5ec=['set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','FreshdeskConfiguration','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','count','include','findAll','catch','show','rawAttributes','includeAll','options','find','create','body','params','getFields','findOne','FreshdeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','json','offset','limit','status'];(function(_0x396f5e,_0x8a669b){var _0x216284=function(_0x251ed9){while(--_0x251ed9){_0x396f5e['push'](_0x396f5e['shift']());}};_0x216284(++_0x8a669b);}(_0xc5ec,0x179));var _0xcc5e=function(_0x5839d1,_0x1ba02a){_0x5839d1=_0x5839d1-0x0;var _0x8aaa35=_0xc5ec[_0x5839d1];return _0x8aaa35;};'use strict';var emlformat=require(_0xcc5e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc5e('0x1'));var jsonpatch=require(_0xcc5e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcc5e('0x3'));var Mustache=require(_0xcc5e('0x4'));var util=require(_0xcc5e('0x5'));var path=require('path');var sox=require(_0xcc5e('0x6'));var csv=require(_0xcc5e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc5e('0x8'));var squel=require('squel');var crypto=require(_0xcc5e('0x9'));var jsforce=require(_0xcc5e('0xa'));var deskjs=require(_0xcc5e('0xb'));var toCsv=require(_0xcc5e('0x7'));var querystring=require('querystring');var Papa=require(_0xcc5e('0xc'));var Redis=require('ioredis');var authService=require(_0xcc5e('0xd'));var qs=require(_0xcc5e('0xe'));var as=require(_0xcc5e('0xf'));var hardwareService=require(_0xcc5e('0x10'));var logger=require(_0xcc5e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xcc5e('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x255af1,_0x253c48){_0x253c48=_0x253c48||0xcc;return function(_0x54f6c0){if(_0x54f6c0){return _0x255af1['sendStatus'](_0x253c48);}return _0x255af1['status'](_0x253c48)['end']();};}function respondWithResult(_0x47d29e,_0x22292b){_0x22292b=_0x22292b||0xc8;return function(_0x50b5a4){if(_0x50b5a4){return _0x47d29e['status'](_0x22292b)[_0xcc5e('0x13')](_0x50b5a4);}};}function respondWithFilteredResult(_0x5cb06a,_0x278dc8){return function(_0x20dab6){if(_0x20dab6){var _0x3e7d88=typeof _0x278dc8[_0xcc5e('0x14')]==='undefined'&&typeof _0x278dc8[_0xcc5e('0x15')]==='undefined';var _0x161bc8=_0x20dab6['count'];var _0x1fccce=_0x3e7d88?0x0:_0x278dc8[_0xcc5e('0x14')];var _0x53f300=_0x3e7d88?_0x20dab6['count']:_0x278dc8[_0xcc5e('0x14')]+_0x278dc8['limit'];var _0x508c19;if(_0x53f300>=_0x161bc8){_0x53f300=_0x161bc8;_0x508c19=0xc8;}else{_0x508c19=0xce;}_0x5cb06a[_0xcc5e('0x16')](_0x508c19);return _0x5cb06a[_0xcc5e('0x17')](_0xcc5e('0x18'),_0x1fccce+'-'+_0x53f300+'/'+_0x161bc8)[_0xcc5e('0x13')](_0x20dab6);}return null;};}function patchUpdates(_0xe50f75){return function(_0x3a167e){try{jsonpatch[_0xcc5e('0x19')](_0x3a167e,_0xe50f75,!![]);}catch(_0xc1f037){return BPromise[_0xcc5e('0x1a')](_0xc1f037);}return _0x3a167e[_0xcc5e('0x1b')]();};}function saveUpdates(_0x324bbc,_0x11b671){return function(_0x32d025){if(_0x32d025){return _0x32d025[_0xcc5e('0x1c')](_0x324bbc)[_0xcc5e('0x1d')](function(_0x495c56){return _0x495c56;});}return null;};}function removeEntity(_0x40fae6,_0xe5bb7a){return function(_0x50c009){if(_0x50c009){return _0x50c009[_0xcc5e('0x1e')]()['then'](function(){_0x40fae6[_0xcc5e('0x16')](0xcc)[_0xcc5e('0x1f')]();});}};}function handleEntityNotFound(_0x428a2f,_0x595d5c){return function(_0x14e115){if(!_0x14e115){_0x428a2f[_0xcc5e('0x20')](0x194);}return _0x14e115;};}function handleError(_0x26c65a,_0x592c26){_0x592c26=_0x592c26||0x1f4;return function(_0x4e499f){logger[_0xcc5e('0x21')](_0x4e499f[_0xcc5e('0x22')]);if(_0x4e499f[_0xcc5e('0x23')]){delete _0x4e499f[_0xcc5e('0x23')];}_0x26c65a[_0xcc5e('0x16')](_0x592c26)[_0xcc5e('0x24')](_0x4e499f);};}exports[_0xcc5e('0x25')]=function(_0x42ce82,_0x2a79ef){var _0x2d954f={},_0x1da757={},_0x59fb54={'count':0x0,'rows':[]};var _0x5e84a6=_['map'](db[_0xcc5e('0x26')]['rawAttributes'],function(_0x38f8a9){return{'name':_0x38f8a9[_0xcc5e('0x27')],'type':_0x38f8a9[_0xcc5e('0x28')]['key']};});_0x1da757[_0xcc5e('0x29')]=_[_0xcc5e('0x2a')](_0x5e84a6,'name');_0x1da757[_0xcc5e('0x2b')]=_[_0xcc5e('0x2c')](_0x42ce82['query']);_0x1da757[_0xcc5e('0x2d')]=_['intersection'](_0x1da757['model'],_0x1da757['query']);_0x2d954f[_0xcc5e('0x2e')]=_[_0xcc5e('0x2f')](_0x1da757[_0xcc5e('0x29')],qs[_0xcc5e('0x30')](_0x42ce82[_0xcc5e('0x2b')][_0xcc5e('0x30')]));_0x2d954f[_0xcc5e('0x2e')]=_0x2d954f[_0xcc5e('0x2e')][_0xcc5e('0x31')]?_0x2d954f['attributes']:_0x1da757[_0xcc5e('0x29')];if(!_0x42ce82['query']['hasOwnProperty'](_0xcc5e('0x32'))){_0x2d954f[_0xcc5e('0x15')]=qs[_0xcc5e('0x15')](_0x42ce82[_0xcc5e('0x2b')][_0xcc5e('0x15')]);_0x2d954f[_0xcc5e('0x14')]=qs[_0xcc5e('0x14')](_0x42ce82[_0xcc5e('0x2b')][_0xcc5e('0x14')]);}_0x2d954f[_0xcc5e('0x33')]=qs[_0xcc5e('0x34')](_0x42ce82[_0xcc5e('0x2b')][_0xcc5e('0x34')]);_0x2d954f[_0xcc5e('0x35')]=qs[_0xcc5e('0x2d')](_['pick'](_0x42ce82[_0xcc5e('0x2b')],_0x1da757['filters']),_0x5e84a6);if(_0x42ce82['query']['filter']){_0x2d954f[_0xcc5e('0x35')]=_[_0xcc5e('0x36')](_0x2d954f[_0xcc5e('0x35')],{'$or':_[_0xcc5e('0x2a')](_0x5e84a6,function(_0x2e240c){if(_0x2e240c[_0xcc5e('0x28')]!==_0xcc5e('0x37')){var _0x3efee9={};_0x3efee9[_0x2e240c[_0xcc5e('0x23')]]={'$like':'%'+_0x42ce82[_0xcc5e('0x2b')][_0xcc5e('0x38')]+'%'};return _0x3efee9;}})});}_0x2d954f=_[_0xcc5e('0x36')]({},_0x2d954f,_0x42ce82['options']);var _0xd051db={'where':_0x2d954f['where']};return db[_0xcc5e('0x26')][_0xcc5e('0x39')](_0xd051db)[_0xcc5e('0x1d')](function(_0xfe5e19){_0x59fb54[_0xcc5e('0x39')]=_0xfe5e19;if(_0x42ce82[_0xcc5e('0x2b')]['includeAll']){_0x2d954f[_0xcc5e('0x3a')]=[{'all':!![]}];}return db[_0xcc5e('0x26')][_0xcc5e('0x3b')](_0x2d954f);})[_0xcc5e('0x1d')](function(_0x356ac1){_0x59fb54['rows']=_0x356ac1;return _0x59fb54;})[_0xcc5e('0x1d')](respondWithFilteredResult(_0x2a79ef,_0x2d954f))[_0xcc5e('0x3c')](handleError(_0x2a79ef,null));};exports[_0xcc5e('0x3d')]=function(_0x1afe81,_0x88c6e1){var _0x1230a1={'raw':![],'where':{'id':_0x1afe81['params']['id']}},_0x48996e={};_0x48996e[_0xcc5e('0x29')]=_[_0xcc5e('0x2c')](db[_0xcc5e('0x26')][_0xcc5e('0x3e')]);_0x48996e[_0xcc5e('0x2b')]=_[_0xcc5e('0x2c')](_0x1afe81[_0xcc5e('0x2b')]);_0x48996e[_0xcc5e('0x2d')]=_['intersection'](_0x48996e[_0xcc5e('0x29')],_0x48996e[_0xcc5e('0x2b')]);_0x1230a1['attributes']=_[_0xcc5e('0x2f')](_0x48996e[_0xcc5e('0x29')],qs[_0xcc5e('0x30')](_0x1afe81[_0xcc5e('0x2b')]['fields']));_0x1230a1['attributes']=_0x1230a1[_0xcc5e('0x2e')]['length']?_0x1230a1[_0xcc5e('0x2e')]:_0x48996e[_0xcc5e('0x29')];if(_0x1afe81['query'][_0xcc5e('0x3f')]){_0x1230a1[_0xcc5e('0x3a')]=[{'all':!![]}];}_0x1230a1=_[_0xcc5e('0x36')]({},_0x1230a1,_0x1afe81[_0xcc5e('0x40')]);return db[_0xcc5e('0x26')][_0xcc5e('0x41')](_0x1230a1)['then'](handleEntityNotFound(_0x88c6e1,null))[_0xcc5e('0x1d')](respondWithResult(_0x88c6e1,null))[_0xcc5e('0x3c')](handleError(_0x88c6e1,null));};exports[_0xcc5e('0x42')]=function(_0x38742b,_0x4f2461){return db[_0xcc5e('0x26')][_0xcc5e('0x42')](_0x38742b['body'],{})['then'](respondWithResult(_0x4f2461,0xc9))[_0xcc5e('0x3c')](handleError(_0x4f2461,null));};exports[_0xcc5e('0x1c')]=function(_0x450bb0,_0x511076){if(_0x450bb0[_0xcc5e('0x43')]['id']){delete _0x450bb0[_0xcc5e('0x43')]['id'];}return db[_0xcc5e('0x26')]['find']({'where':{'id':_0x450bb0[_0xcc5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x511076,null))[_0xcc5e('0x1d')](saveUpdates(_0x450bb0[_0xcc5e('0x43')],null))[_0xcc5e('0x1d')](respondWithResult(_0x511076,null))[_0xcc5e('0x3c')](handleError(_0x511076,null));};exports['destroy']=function(_0x2ea54d,_0x331f21){return db[_0xcc5e('0x26')][_0xcc5e('0x41')]({'where':{'id':_0x2ea54d['params']['id']}})[_0xcc5e('0x1d')](handleEntityNotFound(_0x331f21,null))[_0xcc5e('0x1d')](removeEntity(_0x331f21,null))['catch'](handleError(_0x331f21,null));};exports[_0xcc5e('0x45')]=function(_0x542e5f,_0x49caf2,_0x2175b5){var _0x25645b={};var _0x56579a={};var _0x27a5f7;var _0x407770;return db[_0xcc5e('0x26')][_0xcc5e('0x46')]({'where':{'id':_0x542e5f['params']['id']}})[_0xcc5e('0x1d')](handleEntityNotFound(_0x49caf2,null))[_0xcc5e('0x1d')](function(_0xb1ef07){if(_0xb1ef07){_0x27a5f7=_0xb1ef07;_0x56579a[_0xcc5e('0x29')]=_['keys'](db[_0xcc5e('0x47')][_0xcc5e('0x3e')]);_0x56579a[_0xcc5e('0x2b')]=_['keys'](_0x542e5f[_0xcc5e('0x2b')]);_0x56579a[_0xcc5e('0x2d')]=_[_0xcc5e('0x2f')](_0x56579a[_0xcc5e('0x29')],_0x56579a[_0xcc5e('0x2b')]);_0x25645b['attributes']=_[_0xcc5e('0x2f')](_0x56579a[_0xcc5e('0x29')],qs[_0xcc5e('0x30')](_0x542e5f[_0xcc5e('0x2b')][_0xcc5e('0x30')]));_0x25645b[_0xcc5e('0x2e')]=_0x25645b['attributes'][_0xcc5e('0x31')]?_0x25645b[_0xcc5e('0x2e')]:_0x56579a[_0xcc5e('0x29')];_0x25645b[_0xcc5e('0x33')]=qs['sort'](_0x542e5f[_0xcc5e('0x2b')]['sort']);_0x25645b[_0xcc5e('0x35')]=qs[_0xcc5e('0x2d')](_[_0xcc5e('0x48')](_0x542e5f[_0xcc5e('0x2b')],_0x56579a['filters']));if(_0x542e5f[_0xcc5e('0x2b')][_0xcc5e('0x38')]){_0x25645b[_0xcc5e('0x35')]=_[_0xcc5e('0x36')](_0x25645b['where'],{'$or':_['map'](_0x25645b[_0xcc5e('0x2e')],function(_0x4d00e2){var _0x248436={};_0x248436[_0x4d00e2]={'$like':'%'+_0x542e5f[_0xcc5e('0x2b')]['filter']+'%'};return _0x248436;})});}_0x25645b=_[_0xcc5e('0x36')]({},_0x25645b,_0x542e5f['options']);return _0x27a5f7[_0xcc5e('0x45')](_0x25645b);}})[_0xcc5e('0x1d')](function(_0x5af05c){if(_0x5af05c){_0x407770=_0x5af05c[_0xcc5e('0x31')];if(!_0x542e5f['query'][_0xcc5e('0x49')](_0xcc5e('0x32'))){_0x25645b[_0xcc5e('0x15')]=qs['limit'](_0x542e5f[_0xcc5e('0x2b')][_0xcc5e('0x15')]);_0x25645b[_0xcc5e('0x14')]=qs[_0xcc5e('0x14')](_0x542e5f[_0xcc5e('0x2b')][_0xcc5e('0x14')]);}return _0x27a5f7[_0xcc5e('0x45')](_0x25645b);}})['then'](function(_0x227b6e){if(_0x227b6e){return _0x227b6e?{'count':_0x407770,'rows':_0x227b6e}:null;}})[_0xcc5e('0x1d')](respondWithResult(_0x49caf2,null))[_0xcc5e('0x3c')](handleError(_0x49caf2,null));};exports[_0xcc5e('0x4a')]=function(_0x4fd33b,_0x22228d,_0x34f1cb){var _0x1deef5={};var _0x52aee4={};var _0x1f2718;var _0x39127b;return db['FreshdeskConfiguration'][_0xcc5e('0x46')]({'where':{'id':_0x4fd33b[_0xcc5e('0x44')]['id']}})[_0xcc5e('0x1d')](handleEntityNotFound(_0x22228d,null))[_0xcc5e('0x1d')](function(_0x2336ce){if(_0x2336ce){_0x1f2718=_0x2336ce;_0x52aee4[_0xcc5e('0x29')]=_[_0xcc5e('0x2c')](db[_0xcc5e('0x47')][_0xcc5e('0x3e')]);_0x52aee4[_0xcc5e('0x2b')]=_[_0xcc5e('0x2c')](_0x4fd33b[_0xcc5e('0x2b')]);_0x52aee4['filters']=_[_0xcc5e('0x2f')](_0x52aee4[_0xcc5e('0x29')],_0x52aee4[_0xcc5e('0x2b')]);_0x1deef5['attributes']=_[_0xcc5e('0x2f')](_0x52aee4['model'],qs[_0xcc5e('0x30')](_0x4fd33b['query']['fields']));_0x1deef5['attributes']=_0x1deef5[_0xcc5e('0x2e')][_0xcc5e('0x31')]?_0x1deef5[_0xcc5e('0x2e')]:_0x52aee4[_0xcc5e('0x29')];_0x1deef5[_0xcc5e('0x33')]=qs[_0xcc5e('0x34')](_0x4fd33b[_0xcc5e('0x2b')][_0xcc5e('0x34')]);_0x1deef5[_0xcc5e('0x35')]=qs[_0xcc5e('0x2d')](_[_0xcc5e('0x48')](_0x4fd33b['query'],_0x52aee4[_0xcc5e('0x2d')]));if(_0x4fd33b[_0xcc5e('0x2b')][_0xcc5e('0x38')]){_0x1deef5[_0xcc5e('0x35')]=_[_0xcc5e('0x36')](_0x1deef5[_0xcc5e('0x35')],{'$or':_[_0xcc5e('0x2a')](_0x1deef5[_0xcc5e('0x2e')],function(_0x37033a){var _0xed6858={};_0xed6858[_0x37033a]={'$like':'%'+_0x4fd33b['query'][_0xcc5e('0x38')]+'%'};return _0xed6858;})});}_0x1deef5=_[_0xcc5e('0x36')]({},_0x1deef5,_0x4fd33b[_0xcc5e('0x40')]);return _0x1f2718['getSubjects'](_0x1deef5);}})[_0xcc5e('0x1d')](function(_0x2ad8d9){if(_0x2ad8d9){_0x39127b=_0x2ad8d9[_0xcc5e('0x31')];if(!_0x4fd33b[_0xcc5e('0x2b')][_0xcc5e('0x49')](_0xcc5e('0x32'))){_0x1deef5[_0xcc5e('0x15')]=qs[_0xcc5e('0x15')](_0x4fd33b[_0xcc5e('0x2b')][_0xcc5e('0x15')]);_0x1deef5[_0xcc5e('0x14')]=qs[_0xcc5e('0x14')](_0x4fd33b[_0xcc5e('0x2b')][_0xcc5e('0x14')]);}return _0x1f2718[_0xcc5e('0x4a')](_0x1deef5);}})['then'](function(_0x58c837){if(_0x58c837){return _0x58c837?{'count':_0x39127b,'rows':_0x58c837}:null;}})[_0xcc5e('0x1d')](respondWithResult(_0x22228d,null))[_0xcc5e('0x3c')](handleError(_0x22228d,null));};exports[_0xcc5e('0x4b')]=function(_0x516de4,_0x4c2b0b,_0x5a230a){var _0x8e3287={};var _0x305408={};var _0x2489ba;var _0x459f51;return db[_0xcc5e('0x26')][_0xcc5e('0x46')]({'where':{'id':_0x516de4[_0xcc5e('0x44')]['id']}})[_0xcc5e('0x1d')](handleEntityNotFound(_0x4c2b0b,null))[_0xcc5e('0x1d')](function(_0x2e900a){if(_0x2e900a){_0x2489ba=_0x2e900a;_0x305408['model']=_[_0xcc5e('0x2c')](db[_0xcc5e('0x47')]['rawAttributes']);_0x305408[_0xcc5e('0x2b')]=_[_0xcc5e('0x2c')](_0x516de4[_0xcc5e('0x2b')]);_0x305408['filters']=_[_0xcc5e('0x2f')](_0x305408['model'],_0x305408[_0xcc5e('0x2b')]);_0x8e3287[_0xcc5e('0x2e')]=_[_0xcc5e('0x2f')](_0x305408[_0xcc5e('0x29')],qs[_0xcc5e('0x30')](_0x516de4[_0xcc5e('0x2b')]['fields']));_0x8e3287[_0xcc5e('0x2e')]=_0x8e3287['attributes']['length']?_0x8e3287[_0xcc5e('0x2e')]:_0x305408[_0xcc5e('0x29')];_0x8e3287[_0xcc5e('0x33')]=qs[_0xcc5e('0x34')](_0x516de4[_0xcc5e('0x2b')][_0xcc5e('0x34')]);_0x8e3287[_0xcc5e('0x35')]=qs[_0xcc5e('0x2d')](_[_0xcc5e('0x48')](_0x516de4[_0xcc5e('0x2b')],_0x305408[_0xcc5e('0x2d')]));if(_0x516de4[_0xcc5e('0x2b')][_0xcc5e('0x38')]){_0x8e3287[_0xcc5e('0x35')]=_[_0xcc5e('0x36')](_0x8e3287[_0xcc5e('0x35')],{'$or':_[_0xcc5e('0x2a')](_0x8e3287[_0xcc5e('0x2e')],function(_0x8276b7){var _0x580670={};_0x580670[_0x8276b7]={'$like':'%'+_0x516de4['query']['filter']+'%'};return _0x580670;})});}_0x8e3287=_['merge']({},_0x8e3287,_0x516de4[_0xcc5e('0x40')]);return _0x2489ba['getDescriptions'](_0x8e3287);}})[_0xcc5e('0x1d')](function(_0x14fab1){if(_0x14fab1){_0x459f51=_0x14fab1[_0xcc5e('0x31')];if(!_0x516de4[_0xcc5e('0x2b')]['hasOwnProperty'](_0xcc5e('0x32'))){_0x8e3287[_0xcc5e('0x15')]=qs[_0xcc5e('0x15')](_0x516de4[_0xcc5e('0x2b')]['limit']);_0x8e3287[_0xcc5e('0x14')]=qs[_0xcc5e('0x14')](_0x516de4[_0xcc5e('0x2b')][_0xcc5e('0x14')]);}return _0x2489ba[_0xcc5e('0x4b')](_0x8e3287);}})[_0xcc5e('0x1d')](function(_0x708025){if(_0x708025){return _0x708025?{'count':_0x459f51,'rows':_0x708025}:null;}})[_0xcc5e('0x1d')](respondWithResult(_0x4c2b0b,null))[_0xcc5e('0x3c')](handleError(_0x4c2b0b,null));};exports[_0xcc5e('0x4c')]=function(_0x5e660e,_0x131c3c,_0x4abf40){var _0xeb0ae9={};var _0x2b8a06={};var _0x55392d;var _0x26688c;return db['FreshdeskConfiguration'][_0xcc5e('0x46')]({'where':{'id':_0x5e660e[_0xcc5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x131c3c,null))['then'](function(_0x539297){if(_0x539297){_0x55392d=_0x539297;_0x2b8a06[_0xcc5e('0x29')]=_[_0xcc5e('0x2c')](db[_0xcc5e('0x4d')]['rawAttributes']);_0x2b8a06[_0xcc5e('0x2b')]=_[_0xcc5e('0x2c')](_0x5e660e['query']);_0x2b8a06[_0xcc5e('0x2d')]=_[_0xcc5e('0x2f')](_0x2b8a06['model'],_0x2b8a06['query']);_0xeb0ae9[_0xcc5e('0x2e')]=_[_0xcc5e('0x2f')](_0x2b8a06[_0xcc5e('0x29')],qs[_0xcc5e('0x30')](_0x5e660e['query']['fields']));_0xeb0ae9[_0xcc5e('0x2e')]=_0xeb0ae9[_0xcc5e('0x2e')][_0xcc5e('0x31')]?_0xeb0ae9[_0xcc5e('0x2e')]:_0x2b8a06[_0xcc5e('0x29')];_0xeb0ae9[_0xcc5e('0x33')]=qs[_0xcc5e('0x34')](_0x5e660e[_0xcc5e('0x2b')]['sort']);_0xeb0ae9[_0xcc5e('0x35')]=qs['filters'](_[_0xcc5e('0x48')](_0x5e660e[_0xcc5e('0x2b')],_0x2b8a06[_0xcc5e('0x2d')]));if(_0x5e660e['query'][_0xcc5e('0x38')]){_0xeb0ae9[_0xcc5e('0x35')]=_[_0xcc5e('0x36')](_0xeb0ae9[_0xcc5e('0x35')],{'$or':_['map'](_0xeb0ae9['attributes'],function(_0x9ec23d){var _0x14b6a6={};_0x14b6a6[_0x9ec23d]={'$like':'%'+_0x5e660e[_0xcc5e('0x2b')][_0xcc5e('0x38')]+'%'};return _0x14b6a6;})});}_0xeb0ae9=_[_0xcc5e('0x36')]({},_0xeb0ae9,_0x5e660e[_0xcc5e('0x40')]);return _0x55392d[_0xcc5e('0x4c')](_0xeb0ae9);}})[_0xcc5e('0x1d')](function(_0x43fefc){if(_0x43fefc){_0x26688c=_0x43fefc[_0xcc5e('0x31')];if(!_0x5e660e[_0xcc5e('0x2b')][_0xcc5e('0x49')](_0xcc5e('0x32'))){_0xeb0ae9[_0xcc5e('0x15')]=qs[_0xcc5e('0x15')](_0x5e660e[_0xcc5e('0x2b')][_0xcc5e('0x15')]);_0xeb0ae9['offset']=qs[_0xcc5e('0x14')](_0x5e660e[_0xcc5e('0x2b')][_0xcc5e('0x14')]);}return _0x55392d['getTags'](_0xeb0ae9);}})[_0xcc5e('0x1d')](function(_0x5e3e1b){if(_0x5e3e1b){return _0x5e3e1b?{'count':_0x26688c,'rows':_0x5e3e1b}:null;}})[_0xcc5e('0x1d')](respondWithResult(_0x131c3c,null))[_0xcc5e('0x3c')](handleError(_0x131c3c,null));};exports['setTags']=function(_0x1c562d,_0x2a6458,_0x406c11){if(_0x1c562d[_0xcc5e('0x43')]['id']){delete _0x1c562d['body']['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x1c562d[_0xcc5e('0x44')]['id']}})[_0xcc5e('0x1d')](handleEntityNotFound(_0x2a6458,null))[_0xcc5e('0x1d')](function(_0x378cef){if(_0x378cef){return _0x378cef[_0xcc5e('0x4e')](_0x1c562d['body'][_0xcc5e('0x4f')]||[]);}return null;})[_0xcc5e('0x1d')](respondWithResult(_0x2a6458,null))[_0xcc5e('0x3c')](handleError(_0x2a6458,null));}; \ No newline at end of file +var _0x83f5=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','length','find','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model'];(function(_0x162062,_0x2205bc){var _0x34b1a8=function(_0x53e674){while(--_0x53e674){_0x162062['push'](_0x162062['shift']());}};_0x34b1a8(++_0x2205bc);}(_0x83f5,0x116));var _0x583f=function(_0xdddc0c,_0x1f0bd9){_0xdddc0c=_0xdddc0c-0x0;var _0x3c91d9=_0x83f5[_0xdddc0c];return _0x3c91d9;};'use strict';var emlformat=require(_0x583f('0x0'));var rimraf=require(_0x583f('0x1'));var zipdir=require(_0x583f('0x2'));var jsonpatch=require(_0x583f('0x3'));var rp=require(_0x583f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x583f('0x5'));var path=require(_0x583f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x583f('0x7'));var fs=require('fs');var fs_extra=require(_0x583f('0x8'));var _=require(_0x583f('0x9'));var squel=require('squel');var crypto=require(_0x583f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x583f('0xb'));var toCsv=require(_0x583f('0xc'));var querystring=require(_0x583f('0xd'));var Papa=require('papaparse');var Redis=require(_0x583f('0xe'));var authService=require(_0x583f('0xf'));var qs=require(_0x583f('0x10'));var as=require(_0x583f('0x11'));var hardwareService=require(_0x583f('0x12'));var logger=require(_0x583f('0x13'))('api');var utils=require(_0x583f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x583f('0x15'));var db=require(_0x583f('0x16'))['db'];function respondWithStatusCode(_0x2ab183,_0x26160e){_0x26160e=_0x26160e||0xcc;return function(_0x495a4d){if(_0x495a4d){return _0x2ab183[_0x583f('0x17')](_0x26160e);}return _0x2ab183[_0x583f('0x18')](_0x26160e)[_0x583f('0x19')]();};}function respondWithResult(_0x5be137,_0x5a5bab){_0x5a5bab=_0x5a5bab||0xc8;return function(_0x43473a){if(_0x43473a){return _0x5be137['status'](_0x5a5bab)[_0x583f('0x1a')](_0x43473a);}};}function respondWithFilteredResult(_0x2c7a9c,_0x588880){return function(_0x606898){if(_0x606898){var _0x1ea298=typeof _0x588880[_0x583f('0x1b')]===_0x583f('0x1c')&&typeof _0x588880[_0x583f('0x1d')]===_0x583f('0x1c');var _0x4c1f41=_0x606898[_0x583f('0x1e')];var _0x3b326c=_0x1ea298?0x0:_0x588880['offset'];var _0xed9916=_0x1ea298?_0x606898[_0x583f('0x1e')]:_0x588880[_0x583f('0x1b')]+_0x588880[_0x583f('0x1d')];var _0x4770d3;if(_0xed9916>=_0x4c1f41){_0xed9916=_0x4c1f41;_0x4770d3=0xc8;}else{_0x4770d3=0xce;}_0x2c7a9c[_0x583f('0x18')](_0x4770d3);return _0x2c7a9c[_0x583f('0x1f')]('Content-Range',_0x3b326c+'-'+_0xed9916+'/'+_0x4c1f41)['json'](_0x606898);}return null;};}function patchUpdates(_0x1b1e71){return function(_0x17596d){try{jsonpatch[_0x583f('0x20')](_0x17596d,_0x1b1e71,!![]);}catch(_0x9e5606){return BPromise[_0x583f('0x21')](_0x9e5606);}return _0x17596d[_0x583f('0x22')]();};}function saveUpdates(_0x356abd,_0x45a899){return function(_0x397749){if(_0x397749){return _0x397749[_0x583f('0x23')](_0x356abd)[_0x583f('0x24')](function(_0xef3b2d){return _0xef3b2d;});}return null;};}function removeEntity(_0x57cca6,_0x24bad6){return function(_0x303711){if(_0x303711){return _0x303711[_0x583f('0x25')]()[_0x583f('0x24')](function(){_0x57cca6[_0x583f('0x18')](0xcc)[_0x583f('0x19')]();});}};}function handleEntityNotFound(_0x4146b3,_0x309dd8){return function(_0x233126){if(!_0x233126){_0x4146b3[_0x583f('0x17')](0x194);}return _0x233126;};}function handleError(_0x39dad5,_0x1763d2){_0x1763d2=_0x1763d2||0x1f4;return function(_0x641ffc){logger['error'](_0x641ffc[_0x583f('0x26')]);if(_0x641ffc[_0x583f('0x27')]){delete _0x641ffc[_0x583f('0x27')];}_0x39dad5[_0x583f('0x18')](_0x1763d2)[_0x583f('0x28')](_0x641ffc);};}exports['index']=function(_0x1291a1,_0x333140){var _0x21d388={},_0x600fc3={},_0x235bd6={'count':0x0,'rows':[]};var _0x47bd95=_['map'](db[_0x583f('0x29')][_0x583f('0x2a')],function(_0x2ad55f){return{'name':_0x2ad55f[_0x583f('0x2b')],'type':_0x2ad55f[_0x583f('0x2c')][_0x583f('0x2d')]};});_0x600fc3['model']=_['map'](_0x47bd95,'name');_0x600fc3[_0x583f('0x2e')]=_[_0x583f('0x2f')](_0x1291a1[_0x583f('0x2e')]);_0x600fc3[_0x583f('0x30')]=_['intersection'](_0x600fc3[_0x583f('0x31')],_0x600fc3[_0x583f('0x2e')]);_0x21d388[_0x583f('0x32')]=_[_0x583f('0x33')](_0x600fc3[_0x583f('0x31')],qs[_0x583f('0x34')](_0x1291a1['query'][_0x583f('0x34')]));_0x21d388['attributes']=_0x21d388[_0x583f('0x32')]['length']?_0x21d388[_0x583f('0x32')]:_0x600fc3[_0x583f('0x31')];if(!_0x1291a1[_0x583f('0x2e')][_0x583f('0x35')](_0x583f('0x36'))){_0x21d388[_0x583f('0x1d')]=qs[_0x583f('0x1d')](_0x1291a1['query'][_0x583f('0x1d')]);_0x21d388[_0x583f('0x1b')]=qs[_0x583f('0x1b')](_0x1291a1[_0x583f('0x2e')]['offset']);}_0x21d388[_0x583f('0x37')]=qs[_0x583f('0x38')](_0x1291a1[_0x583f('0x2e')]['sort']);_0x21d388[_0x583f('0x39')]=qs[_0x583f('0x30')](_[_0x583f('0x3a')](_0x1291a1[_0x583f('0x2e')],_0x600fc3['filters']),_0x47bd95);if(_0x1291a1[_0x583f('0x2e')]['filter']){_0x21d388['where']=_[_0x583f('0x3b')](_0x21d388[_0x583f('0x39')],{'$or':_[_0x583f('0x3c')](_0x47bd95,function(_0x47943c){if(_0x47943c['type']!==_0x583f('0x3d')){var _0x37cfdb={};_0x37cfdb[_0x47943c[_0x583f('0x27')]]={'$like':'%'+_0x1291a1[_0x583f('0x2e')][_0x583f('0x3e')]+'%'};return _0x37cfdb;}})});}_0x21d388=_['merge']({},_0x21d388,_0x1291a1[_0x583f('0x3f')]);var _0x52b75d={'where':_0x21d388[_0x583f('0x39')]};return db[_0x583f('0x29')][_0x583f('0x1e')](_0x52b75d)['then'](function(_0x461bfc){_0x235bd6['count']=_0x461bfc;if(_0x1291a1[_0x583f('0x2e')][_0x583f('0x40')]){_0x21d388[_0x583f('0x41')]=[{'all':!![]}];}return db[_0x583f('0x29')][_0x583f('0x42')](_0x21d388);})['then'](function(_0x45bc13){_0x235bd6['rows']=_0x45bc13;return _0x235bd6;})[_0x583f('0x24')](respondWithFilteredResult(_0x333140,_0x21d388))[_0x583f('0x43')](handleError(_0x333140,null));};exports[_0x583f('0x44')]=function(_0x3ef7a5,_0x7c8540){var _0x208118={'raw':![],'where':{'id':_0x3ef7a5[_0x583f('0x45')]['id']}},_0x29512c={};_0x29512c[_0x583f('0x31')]=_[_0x583f('0x2f')](db[_0x583f('0x29')][_0x583f('0x2a')]);_0x29512c[_0x583f('0x2e')]=_[_0x583f('0x2f')](_0x3ef7a5[_0x583f('0x2e')]);_0x29512c[_0x583f('0x30')]=_[_0x583f('0x33')](_0x29512c['model'],_0x29512c['query']);_0x208118[_0x583f('0x32')]=_[_0x583f('0x33')](_0x29512c['model'],qs[_0x583f('0x34')](_0x3ef7a5[_0x583f('0x2e')][_0x583f('0x34')]));_0x208118[_0x583f('0x32')]=_0x208118[_0x583f('0x32')][_0x583f('0x46')]?_0x208118[_0x583f('0x32')]:_0x29512c[_0x583f('0x31')];if(_0x3ef7a5[_0x583f('0x2e')][_0x583f('0x40')]){_0x208118[_0x583f('0x41')]=[{'all':!![]}];}_0x208118=_['merge']({},_0x208118,_0x3ef7a5['options']);return db[_0x583f('0x29')][_0x583f('0x47')](_0x208118)[_0x583f('0x24')](handleEntityNotFound(_0x7c8540,null))[_0x583f('0x24')](respondWithResult(_0x7c8540,null))[_0x583f('0x43')](handleError(_0x7c8540,null));};exports['create']=function(_0xbf2ca2,_0x39f20a){return db[_0x583f('0x29')]['create'](_0xbf2ca2['body'],{})[_0x583f('0x24')](respondWithResult(_0x39f20a,0xc9))[_0x583f('0x43')](handleError(_0x39f20a,null));};exports[_0x583f('0x23')]=function(_0x221b9c,_0x1b3b4c){if(_0x221b9c[_0x583f('0x48')]['id']){delete _0x221b9c['body']['id'];}return db[_0x583f('0x29')][_0x583f('0x47')]({'where':{'id':_0x221b9c[_0x583f('0x45')]['id']}})[_0x583f('0x24')](handleEntityNotFound(_0x1b3b4c,null))[_0x583f('0x24')](saveUpdates(_0x221b9c[_0x583f('0x48')],null))[_0x583f('0x24')](respondWithResult(_0x1b3b4c,null))[_0x583f('0x43')](handleError(_0x1b3b4c,null));};exports['destroy']=function(_0x4ff57d,_0x42094f){return db[_0x583f('0x29')][_0x583f('0x47')]({'where':{'id':_0x4ff57d[_0x583f('0x45')]['id']}})[_0x583f('0x24')](handleEntityNotFound(_0x42094f,null))['then'](removeEntity(_0x42094f,null))[_0x583f('0x43')](handleError(_0x42094f,null));};exports[_0x583f('0x49')]=function(_0x305c6e,_0x1b499f,_0x1434e6){var _0x2fdfac={};var _0x50b55c={};var _0x284a6e;var _0x308dfd;return db[_0x583f('0x29')][_0x583f('0x4a')]({'where':{'id':_0x305c6e['params']['id']}})[_0x583f('0x24')](handleEntityNotFound(_0x1b499f,null))[_0x583f('0x24')](function(_0x4260c5){if(_0x4260c5){_0x284a6e=_0x4260c5;_0x50b55c[_0x583f('0x31')]=_[_0x583f('0x2f')](db[_0x583f('0x4b')][_0x583f('0x2a')]);_0x50b55c['query']=_[_0x583f('0x2f')](_0x305c6e[_0x583f('0x2e')]);_0x50b55c[_0x583f('0x30')]=_[_0x583f('0x33')](_0x50b55c['model'],_0x50b55c[_0x583f('0x2e')]);_0x2fdfac[_0x583f('0x32')]=_['intersection'](_0x50b55c[_0x583f('0x31')],qs[_0x583f('0x34')](_0x305c6e[_0x583f('0x2e')][_0x583f('0x34')]));_0x2fdfac[_0x583f('0x32')]=_0x2fdfac[_0x583f('0x32')][_0x583f('0x46')]?_0x2fdfac[_0x583f('0x32')]:_0x50b55c['model'];_0x2fdfac[_0x583f('0x37')]=qs[_0x583f('0x38')](_0x305c6e['query'][_0x583f('0x38')]);_0x2fdfac[_0x583f('0x39')]=qs[_0x583f('0x30')](_[_0x583f('0x3a')](_0x305c6e[_0x583f('0x2e')],_0x50b55c[_0x583f('0x30')]));if(_0x305c6e['query']['filter']){_0x2fdfac[_0x583f('0x39')]=_['merge'](_0x2fdfac[_0x583f('0x39')],{'$or':_[_0x583f('0x3c')](_0x2fdfac['attributes'],function(_0x446f98){var _0x25eca5={};_0x25eca5[_0x446f98]={'$like':'%'+_0x305c6e['query']['filter']+'%'};return _0x25eca5;})});}_0x2fdfac=_[_0x583f('0x3b')]({},_0x2fdfac,_0x305c6e[_0x583f('0x3f')]);return _0x284a6e[_0x583f('0x49')](_0x2fdfac);}})['then'](function(_0x125927){if(_0x125927){_0x308dfd=_0x125927['length'];if(!_0x305c6e['query'][_0x583f('0x35')](_0x583f('0x36'))){_0x2fdfac['limit']=qs[_0x583f('0x1d')](_0x305c6e['query'][_0x583f('0x1d')]);_0x2fdfac[_0x583f('0x1b')]=qs[_0x583f('0x1b')](_0x305c6e['query'][_0x583f('0x1b')]);}return _0x284a6e[_0x583f('0x49')](_0x2fdfac);}})['then'](function(_0x3a84ec){if(_0x3a84ec){return _0x3a84ec?{'count':_0x308dfd,'rows':_0x3a84ec}:null;}})['then'](respondWithResult(_0x1b499f,null))[_0x583f('0x43')](handleError(_0x1b499f,null));};exports[_0x583f('0x4c')]=function(_0x4d0491,_0x201297,_0x3f6c19){var _0xa3b594={};var _0x2cfa4f={};var _0x751eba;var _0x1f06aa;return db[_0x583f('0x29')]['findOne']({'where':{'id':_0x4d0491[_0x583f('0x45')]['id']}})[_0x583f('0x24')](handleEntityNotFound(_0x201297,null))[_0x583f('0x24')](function(_0x6b6c4e){if(_0x6b6c4e){_0x751eba=_0x6b6c4e;_0x2cfa4f[_0x583f('0x31')]=_[_0x583f('0x2f')](db[_0x583f('0x4b')]['rawAttributes']);_0x2cfa4f[_0x583f('0x2e')]=_[_0x583f('0x2f')](_0x4d0491[_0x583f('0x2e')]);_0x2cfa4f[_0x583f('0x30')]=_[_0x583f('0x33')](_0x2cfa4f[_0x583f('0x31')],_0x2cfa4f[_0x583f('0x2e')]);_0xa3b594[_0x583f('0x32')]=_[_0x583f('0x33')](_0x2cfa4f['model'],qs[_0x583f('0x34')](_0x4d0491['query'][_0x583f('0x34')]));_0xa3b594[_0x583f('0x32')]=_0xa3b594[_0x583f('0x32')][_0x583f('0x46')]?_0xa3b594[_0x583f('0x32')]:_0x2cfa4f['model'];_0xa3b594['order']=qs[_0x583f('0x38')](_0x4d0491[_0x583f('0x2e')][_0x583f('0x38')]);_0xa3b594['where']=qs['filters'](_[_0x583f('0x3a')](_0x4d0491[_0x583f('0x2e')],_0x2cfa4f[_0x583f('0x30')]));if(_0x4d0491['query'][_0x583f('0x3e')]){_0xa3b594[_0x583f('0x39')]=_[_0x583f('0x3b')](_0xa3b594[_0x583f('0x39')],{'$or':_['map'](_0xa3b594[_0x583f('0x32')],function(_0x7c4fb6){var _0x9fe73b={};_0x9fe73b[_0x7c4fb6]={'$like':'%'+_0x4d0491[_0x583f('0x2e')][_0x583f('0x3e')]+'%'};return _0x9fe73b;})});}_0xa3b594=_[_0x583f('0x3b')]({},_0xa3b594,_0x4d0491[_0x583f('0x3f')]);return _0x751eba[_0x583f('0x4c')](_0xa3b594);}})[_0x583f('0x24')](function(_0x25098d){if(_0x25098d){_0x1f06aa=_0x25098d[_0x583f('0x46')];if(!_0x4d0491[_0x583f('0x2e')]['hasOwnProperty'](_0x583f('0x36'))){_0xa3b594['limit']=qs['limit'](_0x4d0491[_0x583f('0x2e')][_0x583f('0x1d')]);_0xa3b594['offset']=qs[_0x583f('0x1b')](_0x4d0491[_0x583f('0x2e')][_0x583f('0x1b')]);}return _0x751eba['getSubjects'](_0xa3b594);}})[_0x583f('0x24')](function(_0x553107){if(_0x553107){return _0x553107?{'count':_0x1f06aa,'rows':_0x553107}:null;}})[_0x583f('0x24')](respondWithResult(_0x201297,null))[_0x583f('0x43')](handleError(_0x201297,null));};exports[_0x583f('0x4d')]=function(_0x5e127d,_0x5a3dac,_0x44cd16){var _0x31a55d={};var _0x1194db={};var _0x615e4c;var _0x1c5a74;return db[_0x583f('0x29')][_0x583f('0x4a')]({'where':{'id':_0x5e127d[_0x583f('0x45')]['id']}})[_0x583f('0x24')](handleEntityNotFound(_0x5a3dac,null))[_0x583f('0x24')](function(_0x1a3692){if(_0x1a3692){_0x615e4c=_0x1a3692;_0x1194db[_0x583f('0x31')]=_[_0x583f('0x2f')](db['FreshdeskField'][_0x583f('0x2a')]);_0x1194db[_0x583f('0x2e')]=_[_0x583f('0x2f')](_0x5e127d[_0x583f('0x2e')]);_0x1194db['filters']=_[_0x583f('0x33')](_0x1194db['model'],_0x1194db[_0x583f('0x2e')]);_0x31a55d[_0x583f('0x32')]=_[_0x583f('0x33')](_0x1194db[_0x583f('0x31')],qs[_0x583f('0x34')](_0x5e127d[_0x583f('0x2e')][_0x583f('0x34')]));_0x31a55d[_0x583f('0x32')]=_0x31a55d[_0x583f('0x32')][_0x583f('0x46')]?_0x31a55d['attributes']:_0x1194db[_0x583f('0x31')];_0x31a55d['order']=qs[_0x583f('0x38')](_0x5e127d['query']['sort']);_0x31a55d[_0x583f('0x39')]=qs['filters'](_[_0x583f('0x3a')](_0x5e127d[_0x583f('0x2e')],_0x1194db[_0x583f('0x30')]));if(_0x5e127d[_0x583f('0x2e')][_0x583f('0x3e')]){_0x31a55d[_0x583f('0x39')]=_[_0x583f('0x3b')](_0x31a55d['where'],{'$or':_[_0x583f('0x3c')](_0x31a55d[_0x583f('0x32')],function(_0x175767){var _0x470866={};_0x470866[_0x175767]={'$like':'%'+_0x5e127d[_0x583f('0x2e')][_0x583f('0x3e')]+'%'};return _0x470866;})});}_0x31a55d=_[_0x583f('0x3b')]({},_0x31a55d,_0x5e127d[_0x583f('0x3f')]);return _0x615e4c[_0x583f('0x4d')](_0x31a55d);}})['then'](function(_0x53fcaa){if(_0x53fcaa){_0x1c5a74=_0x53fcaa[_0x583f('0x46')];if(!_0x5e127d[_0x583f('0x2e')]['hasOwnProperty'](_0x583f('0x36'))){_0x31a55d['limit']=qs['limit'](_0x5e127d[_0x583f('0x2e')][_0x583f('0x1d')]);_0x31a55d[_0x583f('0x1b')]=qs[_0x583f('0x1b')](_0x5e127d[_0x583f('0x2e')][_0x583f('0x1b')]);}return _0x615e4c[_0x583f('0x4d')](_0x31a55d);}})[_0x583f('0x24')](function(_0x477794){if(_0x477794){return _0x477794?{'count':_0x1c5a74,'rows':_0x477794}:null;}})['then'](respondWithResult(_0x5a3dac,null))['catch'](handleError(_0x5a3dac,null));};exports[_0x583f('0x4e')]=function(_0x1644c9,_0x3ec4a4,_0x43ee75){var _0x1f8c15={};var _0xa68ff5={};var _0x5efc76;var _0x13adb5;return db[_0x583f('0x29')][_0x583f('0x4a')]({'where':{'id':_0x1644c9['params']['id']}})[_0x583f('0x24')](handleEntityNotFound(_0x3ec4a4,null))[_0x583f('0x24')](function(_0x3de720){if(_0x3de720){_0x5efc76=_0x3de720;_0xa68ff5[_0x583f('0x31')]=_[_0x583f('0x2f')](db[_0x583f('0x4f')][_0x583f('0x2a')]);_0xa68ff5[_0x583f('0x2e')]=_[_0x583f('0x2f')](_0x1644c9['query']);_0xa68ff5[_0x583f('0x30')]=_[_0x583f('0x33')](_0xa68ff5[_0x583f('0x31')],_0xa68ff5[_0x583f('0x2e')]);_0x1f8c15['attributes']=_[_0x583f('0x33')](_0xa68ff5[_0x583f('0x31')],qs[_0x583f('0x34')](_0x1644c9[_0x583f('0x2e')][_0x583f('0x34')]));_0x1f8c15[_0x583f('0x32')]=_0x1f8c15[_0x583f('0x32')]['length']?_0x1f8c15[_0x583f('0x32')]:_0xa68ff5['model'];_0x1f8c15['order']=qs[_0x583f('0x38')](_0x1644c9[_0x583f('0x2e')][_0x583f('0x38')]);_0x1f8c15[_0x583f('0x39')]=qs[_0x583f('0x30')](_[_0x583f('0x3a')](_0x1644c9['query'],_0xa68ff5[_0x583f('0x30')]));if(_0x1644c9[_0x583f('0x2e')][_0x583f('0x3e')]){_0x1f8c15[_0x583f('0x39')]=_['merge'](_0x1f8c15['where'],{'$or':_[_0x583f('0x3c')](_0x1f8c15[_0x583f('0x32')],function(_0x433bf4){var _0x5eb801={};_0x5eb801[_0x433bf4]={'$like':'%'+_0x1644c9[_0x583f('0x2e')]['filter']+'%'};return _0x5eb801;})});}_0x1f8c15=_[_0x583f('0x3b')]({},_0x1f8c15,_0x1644c9[_0x583f('0x3f')]);return _0x5efc76[_0x583f('0x4e')](_0x1f8c15);}})[_0x583f('0x24')](function(_0x20bcdd){if(_0x20bcdd){_0x13adb5=_0x20bcdd[_0x583f('0x46')];if(!_0x1644c9['query'][_0x583f('0x35')](_0x583f('0x36'))){_0x1f8c15[_0x583f('0x1d')]=qs[_0x583f('0x1d')](_0x1644c9[_0x583f('0x2e')][_0x583f('0x1d')]);_0x1f8c15['offset']=qs[_0x583f('0x1b')](_0x1644c9[_0x583f('0x2e')][_0x583f('0x1b')]);}return _0x5efc76[_0x583f('0x4e')](_0x1f8c15);}})[_0x583f('0x24')](function(_0x3f050f){if(_0x3f050f){return _0x3f050f?{'count':_0x13adb5,'rows':_0x3f050f}:null;}})[_0x583f('0x24')](respondWithResult(_0x3ec4a4,null))[_0x583f('0x43')](handleError(_0x3ec4a4,null));};exports[_0x583f('0x50')]=function(_0x47d748,_0x2a2823,_0x505435){if(_0x47d748[_0x583f('0x48')]['id']){delete _0x47d748[_0x583f('0x48')]['id'];}return db[_0x583f('0x29')]['findOne']({'where':{'id':_0x47d748[_0x583f('0x45')]['id']}})[_0x583f('0x24')](handleEntityNotFound(_0x2a2823,null))[_0x583f('0x24')](function(_0x101816){if(_0x101816){return _0x101816[_0x583f('0x50')](_0x47d748[_0x583f('0x48')][_0x583f('0x51')]||[]);}return null;})[_0x583f('0x24')](respondWithResult(_0x2a2823,null))[_0x583f('0x43')](handleError(_0x2a2823,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2cf3c4e..8f56adf 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 _0x1e68=['api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e68,0xe2));var _0x81e6=function(_0x2a32e1,_0x2dd0ff){_0x2a32e1=_0x2a32e1-0x0;var _0x1691d2=_0x1e68[_0x2a32e1];return _0x1691d2;};'use strict';var _=require('lodash');var util=require(_0x81e6('0x0'));var logger=require(_0x81e6('0x1'))(_0x81e6('0x2'));var moment=require(_0x81e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x81e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81e6('0x5'));var config=require(_0x81e6('0x6'));var attributes=require(_0x81e6('0x7'));module[_0x81e6('0x8')]=function(_0x40d3cd,_0xde8153){return _0x40d3cd[_0x81e6('0x9')](_0x81e6('0xa'),attributes,{'tableName':_0x81e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9e8=['lodash','util','request-promise','../../config/environment','FreshdeskConfiguration'];(function(_0x36f578,_0x1d68b0){var _0x2ecf35=function(_0x33bca1){while(--_0x33bca1){_0x36f578['push'](_0x36f578['shift']());}};_0x2ecf35(++_0x1d68b0);}(_0xd9e8,0xbe));var _0x8d9e=function(_0x15cc06,_0x1d7ae9){_0x15cc06=_0x15cc06-0x0;var _0x495471=_0xd9e8[_0x15cc06];return _0x495471;};'use strict';var _=require(_0x8d9e('0x0'));var util=require(_0x8d9e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8d9e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d9e('0x3'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x46abf9,_0xe96dac){return _0x46abf9['define'](_0x8d9e('0x4'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index d592f61..fa17f8e 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 _0xc774=['request\x20sent','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x891c55,_0x233fe8){var _0x260823=function(_0x1e3f67){while(--_0x1e3f67){_0x891c55['push'](_0x891c55['shift']());}};_0x260823(++_0x233fe8);}(_0xc774,0xe1));var _0x4c77=function(_0x4c6633,_0xce3c51){_0x4c6633=_0x4c6633-0x0;var _0x17f1fa=_0xc774[_0x4c6633];return _0x17f1fa;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4c77('0x0'));var rs=require(_0x4c77('0x1'));var fs=require('fs');var Redis=require(_0x4c77('0x2'));var db=require(_0x4c77('0x3'))['db'];var utils=require(_0x4c77('0x4'));var logger=require(_0x4c77('0x5'))(_0x4c77('0x6'));var config=require(_0x4c77('0x7'));var jayson=require(_0x4c77('0x8'));var client=jayson[_0x4c77('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x65f4c6,_0x2ad184,_0x49ea0f){return new BPromise(function(_0x441bce,_0x38c434){return client['request'](_0x65f4c6,_0x49ea0f)[_0x4c77('0xa')](function(_0x5170c0){logger[_0x4c77('0xb')](_0x4c77('0xc'),_0x2ad184,'request\x20sent');logger[_0x4c77('0xd')](_0x4c77('0xe'),_0x2ad184,_0x4c77('0xf'),JSON['stringify'](_0x5170c0));if(_0x5170c0[_0x4c77('0x10')]){if(_0x5170c0[_0x4c77('0x10')][_0x4c77('0x11')]===0x1f4){logger[_0x4c77('0x10')](_0x4c77('0xc'),_0x2ad184,_0x5170c0[_0x4c77('0x10')][_0x4c77('0x12')]);return _0x38c434(_0x5170c0[_0x4c77('0x10')][_0x4c77('0x12')]);}logger[_0x4c77('0x10')](_0x4c77('0xc'),_0x2ad184,_0x5170c0[_0x4c77('0x10')][_0x4c77('0x12')]);return _0x441bce(_0x5170c0[_0x4c77('0x10')][_0x4c77('0x12')]);}else{logger[_0x4c77('0xb')](_0x4c77('0xc'),_0x2ad184,_0x4c77('0xf'));_0x441bce(_0x5170c0['result'][_0x4c77('0x12')]);}})[_0x4c77('0x13')](function(_0x808c50){logger[_0x4c77('0x10')](_0x4c77('0xc'),_0x2ad184,_0x808c50);_0x38c434(_0x808c50);});});} \ No newline at end of file +var _0x3b9d=['jayson/promise','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e993b,_0x489840){var _0x4b2324=function(_0x1bffec){while(--_0x1bffec){_0x5e993b['push'](_0x5e993b['shift']());}};_0x4b2324(++_0x489840);}(_0x3b9d,0x139));var _0xd3b9=function(_0x66c9ad,_0x3982dc){_0x66c9ad=_0x66c9ad-0x0;var _0x369c96=_0x3b9d[_0x66c9ad];return _0x369c96;};'use strict';var _=require('lodash');var util=require(_0xd3b9('0x0'));var moment=require(_0xd3b9('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3b9('0x2'));var fs=require('fs');var Redis=require(_0xd3b9('0x3'));var db=require(_0xd3b9('0x4'))['db'];var utils=require(_0xd3b9('0x5'));var logger=require(_0xd3b9('0x6'))(_0xd3b9('0x7'));var config=require(_0xd3b9('0x8'));var jayson=require(_0xd3b9('0x9'));var client=jayson['client'][_0xd3b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34755b,_0x314628,_0x55946b){return new BPromise(function(_0x3c1ba2,_0x58d31d){return client[_0xd3b9('0xb')](_0x34755b,_0x55946b)[_0xd3b9('0xc')](function(_0x5ed688){logger[_0xd3b9('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x314628,_0xd3b9('0xe'));logger[_0xd3b9('0xf')](_0xd3b9('0x10'),_0x314628,_0xd3b9('0xe'),JSON[_0xd3b9('0x11')](_0x5ed688));if(_0x5ed688[_0xd3b9('0x12')]){if(_0x5ed688[_0xd3b9('0x12')][_0xd3b9('0x13')]===0x1f4){logger[_0xd3b9('0x12')](_0xd3b9('0x14'),_0x314628,_0x5ed688[_0xd3b9('0x12')]['message']);return _0x58d31d(_0x5ed688[_0xd3b9('0x12')]['message']);}logger['error'](_0xd3b9('0x14'),_0x314628,_0x5ed688[_0xd3b9('0x12')][_0xd3b9('0x15')]);return _0x3c1ba2(_0x5ed688['error'][_0xd3b9('0x15')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x314628,'request\x20sent');_0x3c1ba2(_0x5ed688[_0xd3b9('0x16')][_0xd3b9('0x15')]);}})['catch'](function(_0x1f8db7){logger[_0xd3b9('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x314628,_0x1f8db7);_0x58d31d(_0x1f8db7);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index b4e5f0f..2dafc81 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 _0x7978=['destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','create','delete'];(function(_0x4e4317,_0x5162c2){var _0x33f2f0=function(_0x357356){while(--_0x357356){_0x4e4317['push'](_0x4e4317['shift']());}};_0x33f2f0(++_0x5162c2);}(_0x7978,0x101));var _0x8797=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x7978[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0x8797('0x0'));var util=require(_0x8797('0x1'));var path=require('path');var timeout=require(_0x8797('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8797('0x3'));var interaction=require(_0x8797('0x4'));var config=require(_0x8797('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x8797('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8797('0x6')](_0x8797('0x7'),auth['isAuthenticated'](),controller[_0x8797('0x8')]);router[_0x8797('0x9')]('/',auth[_0x8797('0xa')](),controller[_0x8797('0xb')]);router['put'](_0x8797('0x7'),auth[_0x8797('0xa')](),controller['update']);router[_0x8797('0xc')](_0x8797('0x7'),auth[_0x8797('0xa')](),controller[_0x8797('0xd')]);module[_0x8797('0xe')]=router; \ No newline at end of file +var _0x95fe=['get','index','/:id','create','put','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x95fe,0x1e6));var _0xe95f=function(_0xe1866e,_0x26f974){_0xe1866e=_0xe1866e-0x0;var _0x1510e1=_0x95fe[_0xe1866e];return _0x1510e1;};'use strict';var multer=require(_0xe95f('0x0'));var util=require(_0xe95f('0x1'));var path=require('path');var timeout=require(_0xe95f('0x2'));var express=require(_0xe95f('0x3'));var router=express[_0xe95f('0x4')]();var fs_extra=require(_0xe95f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe95f('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0xe95f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe95f('0x8')]);router[_0xe95f('0x7')](_0xe95f('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe95f('0xa')]);router[_0xe95f('0xb')](_0xe95f('0x9'),auth['isAuthenticated'](),controller[_0xe95f('0xc')]);router[_0xe95f('0xd')](_0xe95f('0x9'),auth[_0xe95f('0xe')](),controller[_0xe95f('0xf')]);module[_0xe95f('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 4894adf..d5eec22 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 _0x00e1=['string','customVariable','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x22b0cb,_0x5a764a){var _0x444178=function(_0x5aed3d){while(--_0x5aed3d){_0x22b0cb['push'](_0x22b0cb['shift']());}};_0x444178(++_0x5a764a);}(_0x00e1,0x196));var _0x100e=function(_0x1c26c0,_0x58dc82){_0x1c26c0=_0x1c26c0-0x0;var _0x23ea79=_0x00e1[_0x1c26c0];return _0x23ea79;};'use strict';var Sequelize=require(_0x100e('0x0'));module[_0x100e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x100e('0x2'),'variable',_0x100e('0x3'),'keyValue',_0x100e('0x4')),'defaultValue':_0x100e('0x2')},'content':{'type':Sequelize[_0x100e('0x5')]},'key':{'type':Sequelize[_0x100e('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x100e('0x6'),_0x100e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x100e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x100e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x100e('0x5')]}}; \ No newline at end of file +var _0xd7c6=['variable','BOOLEAN','exports','ENUM','customVariable','string','STRING'];(function(_0x49bdb8,_0x566536){var _0x3c4381=function(_0x1e9760){while(--_0x1e9760){_0x49bdb8['push'](_0x49bdb8['shift']());}};_0x3c4381(++_0x566536);}(_0xd7c6,0x160));var _0x6d7c=function(_0x31a394,_0x5b5dff){_0x31a394=_0x31a394-0x0;var _0x13aebd=_0xd7c6[_0x31a394];return _0x13aebd;};'use strict';var Sequelize=require('sequelize');module[_0x6d7c('0x0')]={'type':{'type':Sequelize[_0x6d7c('0x1')]('string','variable',_0x6d7c('0x2'),'keyValue','picklist'),'defaultValue':_0x6d7c('0x3')},'content':{'type':Sequelize[_0x6d7c('0x4')]},'key':{'type':Sequelize[_0x6d7c('0x4')]},'keyType':{'type':Sequelize[_0x6d7c('0x1')](_0x6d7c('0x3'),_0x6d7c('0x5'),_0x6d7c('0x2'))},'keyContent':{'type':Sequelize[_0x6d7c('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6d7c('0x4')]},'customField':{'type':Sequelize[_0x6d7c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d7c('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 83f6c48..01ec2c2 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 _0x0565=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','FreshdeskField','includeAll','findAll','rows','catch','show','params','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys'];(function(_0x2dffc8,_0x25f505){var _0x5df762=function(_0x532d52){while(--_0x532d52){_0x2dffc8['push'](_0x2dffc8['shift']());}};_0x5df762(++_0x25f505);}(_0x0565,0xf2));var _0x5056=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x0565[_0xfa634c];return _0x73e478;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548bcf,_0x53e98a){_0x53e98a=_0x53e98a||0xcc;return function(_0x2d44fb){if(_0x2d44fb){return _0x548bcf['sendStatus'](_0x53e98a);}return _0x548bcf[_0x5056('0x19')](_0x53e98a)[_0x5056('0x1a')]();};}function respondWithResult(_0x7af76b,_0x543cee){_0x543cee=_0x543cee||0xc8;return function(_0x1e8b64){if(_0x1e8b64){return _0x7af76b[_0x5056('0x19')](_0x543cee)[_0x5056('0x1b')](_0x1e8b64);}};}function respondWithFilteredResult(_0x56c3ef,_0x21561d){return function(_0x6a044a){if(_0x6a044a){var _0x4ac332=typeof _0x21561d[_0x5056('0x1c')]==='undefined'&&typeof _0x21561d[_0x5056('0x1d')]===_0x5056('0x1e');var _0x1c0ee9=_0x6a044a[_0x5056('0x1f')];var _0x4056ce=_0x4ac332?0x0:_0x21561d['offset'];var _0x9ea88=_0x4ac332?_0x6a044a[_0x5056('0x1f')]:_0x21561d['offset']+_0x21561d['limit'];var _0x20776c;if(_0x9ea88>=_0x1c0ee9){_0x9ea88=_0x1c0ee9;_0x20776c=0xc8;}else{_0x20776c=0xce;}_0x56c3ef[_0x5056('0x19')](_0x20776c);return _0x56c3ef[_0x5056('0x20')](_0x5056('0x21'),_0x4056ce+'-'+_0x9ea88+'/'+_0x1c0ee9)[_0x5056('0x1b')](_0x6a044a);}return null;};}function patchUpdates(_0xf04e08){return function(_0x33035c){try{jsonpatch['apply'](_0x33035c,_0xf04e08,!![]);}catch(_0x13b363){return BPromise[_0x5056('0x22')](_0x13b363);}return _0x33035c['save']();};}function saveUpdates(_0x271efc,_0x1bccef){return function(_0x2564d0){if(_0x2564d0){return _0x2564d0['update'](_0x271efc)[_0x5056('0x23')](function(_0x26a3c2){return _0x26a3c2;});}return null;};}function removeEntity(_0x5afbfe,_0x4a64be){return function(_0x29e166){if(_0x29e166){return _0x29e166[_0x5056('0x24')]()[_0x5056('0x23')](function(){_0x5afbfe[_0x5056('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267048,_0x25409f){return function(_0x5d1656){if(!_0x5d1656){_0x267048[_0x5056('0x25')](0x194);}return _0x5d1656;};}function handleError(_0x505ccf,_0x15f03f){_0x15f03f=_0x15f03f||0x1f4;return function(_0x39d539){logger[_0x5056('0x26')](_0x39d539[_0x5056('0x27')]);if(_0x39d539[_0x5056('0x28')]){delete _0x39d539['name'];}_0x505ccf[_0x5056('0x19')](_0x15f03f)[_0x5056('0x29')](_0x39d539);};}exports[_0x5056('0x2a')]=function(_0x2ac79a,_0x53e6db){var _0x24d33e={},_0x5b0270={},_0x70246c={'count':0x0,'rows':[]};var _0x49fe67=_['map'](db['FreshdeskField'][_0x5056('0x2b')],function(_0x252f75){return{'name':_0x252f75['fieldName'],'type':_0x252f75[_0x5056('0x2c')][_0x5056('0x2d')]};});_0x5b0270[_0x5056('0x2e')]=_[_0x5056('0x2f')](_0x49fe67,_0x5056('0x28'));_0x5b0270[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2ac79a[_0x5056('0x30')]);_0x5b0270[_0x5056('0x32')]=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],_0x5b0270['query']);_0x24d33e['attributes']=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],qs['fields'](_0x2ac79a[_0x5056('0x30')][_0x5056('0x34')]));_0x24d33e['attributes']=_0x24d33e[_0x5056('0x35')][_0x5056('0x36')]?_0x24d33e[_0x5056('0x35')]:_0x5b0270[_0x5056('0x2e')];if(!_0x2ac79a[_0x5056('0x30')][_0x5056('0x37')](_0x5056('0x38'))){_0x24d33e[_0x5056('0x1d')]=qs[_0x5056('0x1d')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1d')]);_0x24d33e[_0x5056('0x1c')]=qs[_0x5056('0x1c')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1c')]);}_0x24d33e['order']=qs[_0x5056('0x39')](_0x2ac79a['query'][_0x5056('0x39')]);_0x24d33e[_0x5056('0x3a')]=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x2ac79a['query'],_0x5b0270[_0x5056('0x32')]),_0x49fe67);if(_0x2ac79a[_0x5056('0x30')]['filter']){_0x24d33e[_0x5056('0x3a')]=_['merge'](_0x24d33e[_0x5056('0x3a')],{'$or':_[_0x5056('0x2f')](_0x49fe67,function(_0x3d56cf){if(_0x3d56cf['type']!==_0x5056('0x3c')){var _0x16a940={};_0x16a940[_0x3d56cf[_0x5056('0x28')]]={'$like':'%'+_0x2ac79a[_0x5056('0x30')][_0x5056('0x3d')]+'%'};return _0x16a940;}})});}_0x24d33e=_[_0x5056('0x3e')]({},_0x24d33e,_0x2ac79a[_0x5056('0x3f')]);var _0x21aa75={'where':_0x24d33e[_0x5056('0x3a')]};return db[_0x5056('0x40')][_0x5056('0x1f')](_0x21aa75)[_0x5056('0x23')](function(_0xc1024a){_0x70246c[_0x5056('0x1f')]=_0xc1024a;if(_0x2ac79a[_0x5056('0x30')][_0x5056('0x41')]){_0x24d33e['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x5056('0x42')](_0x24d33e);})[_0x5056('0x23')](function(_0x6946b4){_0x70246c[_0x5056('0x43')]=_0x6946b4;return _0x70246c;})[_0x5056('0x23')](respondWithFilteredResult(_0x53e6db,_0x24d33e))[_0x5056('0x44')](handleError(_0x53e6db,null));};exports[_0x5056('0x45')]=function(_0x2bf472,_0x48ab5e){var _0x58f12f={'raw':!![],'where':{'id':_0x2bf472[_0x5056('0x46')]['id']}},_0x68a385={};_0x68a385[_0x5056('0x2e')]=_['keys'](db[_0x5056('0x40')]['rawAttributes']);_0x68a385[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2bf472[_0x5056('0x30')]);_0x68a385[_0x5056('0x32')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],_0x68a385['query']);_0x58f12f[_0x5056('0x35')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],qs['fields'](_0x2bf472['query']['fields']));_0x58f12f['attributes']=_0x58f12f[_0x5056('0x35')][_0x5056('0x36')]?_0x58f12f[_0x5056('0x35')]:_0x68a385[_0x5056('0x2e')];if(_0x2bf472[_0x5056('0x30')]['includeAll']){_0x58f12f['include']=[{'all':!![]}];}_0x58f12f=_[_0x5056('0x3e')]({},_0x58f12f,_0x2bf472[_0x5056('0x3f')]);return db[_0x5056('0x40')][_0x5056('0x47')](_0x58f12f)[_0x5056('0x23')](handleEntityNotFound(_0x48ab5e,null))[_0x5056('0x23')](respondWithResult(_0x48ab5e,null))[_0x5056('0x44')](handleError(_0x48ab5e,null));};exports['create']=function(_0x52d6ea,_0x14e3f5){return db[_0x5056('0x40')]['create'](_0x52d6ea[_0x5056('0x48')],{})[_0x5056('0x23')](respondWithResult(_0x14e3f5,0xc9))['catch'](handleError(_0x14e3f5,null));};exports['update']=function(_0x83d8e4,_0x1ab1a9){if(_0x83d8e4['body']['id']){delete _0x83d8e4['body']['id'];}return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0x83d8e4['params']['id']}})['then'](handleEntityNotFound(_0x1ab1a9,null))[_0x5056('0x23')](saveUpdates(_0x83d8e4[_0x5056('0x48')],null))[_0x5056('0x23')](respondWithResult(_0x1ab1a9,null))[_0x5056('0x44')](handleError(_0x1ab1a9,null));};exports[_0x5056('0x24')]=function(_0xdf427c,_0x97f7d8){return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0xdf427c[_0x5056('0x46')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x97f7d8,null))[_0x5056('0x23')](removeEntity(_0x97f7d8,null))[_0x5056('0x44')](handleError(_0x97f7d8,null));}; \ No newline at end of file +var _0xad8a=['hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','params','length','includeAll','include','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xad8a,0xb0));var _0xaad8=function(_0x4df659,_0x19d231){_0x4df659=_0x4df659-0x0;var _0x4ff39d=_0xad8a[_0x4df659];return _0x4ff39d;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var hardwareService=require(_0xaad8('0x15'));var logger=require(_0xaad8('0x16'))(_0xaad8('0x17'));var utils=require(_0xaad8('0x18'));var config=require(_0xaad8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad8('0x1a'))['db'];function respondWithStatusCode(_0x2a13fb,_0xed6744){_0xed6744=_0xed6744||0xcc;return function(_0x456b77){if(_0x456b77){return _0x2a13fb[_0xaad8('0x1b')](_0xed6744);}return _0x2a13fb[_0xaad8('0x1c')](_0xed6744)[_0xaad8('0x1d')]();};}function respondWithResult(_0x357bf6,_0x1c70d3){_0x1c70d3=_0x1c70d3||0xc8;return function(_0x4372fc){if(_0x4372fc){return _0x357bf6[_0xaad8('0x1c')](_0x1c70d3)[_0xaad8('0x1e')](_0x4372fc);}};}function respondWithFilteredResult(_0x28bf95,_0x5e4fbb){return function(_0x334c4d){if(_0x334c4d){var _0xb63cb3=typeof _0x5e4fbb['offset']===_0xaad8('0x1f')&&typeof _0x5e4fbb[_0xaad8('0x20')]===_0xaad8('0x1f');var _0xc17ada=_0x334c4d[_0xaad8('0x21')];var _0x3895e2=_0xb63cb3?0x0:_0x5e4fbb['offset'];var _0xfd8b0a=_0xb63cb3?_0x334c4d[_0xaad8('0x21')]:_0x5e4fbb['offset']+_0x5e4fbb[_0xaad8('0x20')];var _0x4c681e;if(_0xfd8b0a>=_0xc17ada){_0xfd8b0a=_0xc17ada;_0x4c681e=0xc8;}else{_0x4c681e=0xce;}_0x28bf95[_0xaad8('0x1c')](_0x4c681e);return _0x28bf95[_0xaad8('0x22')](_0xaad8('0x23'),_0x3895e2+'-'+_0xfd8b0a+'/'+_0xc17ada)[_0xaad8('0x1e')](_0x334c4d);}return null;};}function patchUpdates(_0x5cb39b){return function(_0x18b856){try{jsonpatch[_0xaad8('0x24')](_0x18b856,_0x5cb39b,!![]);}catch(_0x594681){return BPromise[_0xaad8('0x25')](_0x594681);}return _0x18b856[_0xaad8('0x26')]();};}function saveUpdates(_0x262e57,_0x5b4b61){return function(_0x5ba0fb){if(_0x5ba0fb){return _0x5ba0fb[_0xaad8('0x27')](_0x262e57)[_0xaad8('0x28')](function(_0x3930f0){return _0x3930f0;});}return null;};}function removeEntity(_0x15e0c6,_0x29ba69){return function(_0x1daacf){if(_0x1daacf){return _0x1daacf[_0xaad8('0x29')]()[_0xaad8('0x28')](function(){_0x15e0c6[_0xaad8('0x1c')](0xcc)[_0xaad8('0x1d')]();});}};}function handleEntityNotFound(_0x1bbac4,_0x217bfc){return function(_0x4193cb){if(!_0x4193cb){_0x1bbac4[_0xaad8('0x1b')](0x194);}return _0x4193cb;};}function handleError(_0x4485c3,_0x492a4a){_0x492a4a=_0x492a4a||0x1f4;return function(_0x3d254e){logger[_0xaad8('0x2a')](_0x3d254e[_0xaad8('0x2b')]);if(_0x3d254e['name']){delete _0x3d254e[_0xaad8('0x2c')];}_0x4485c3[_0xaad8('0x1c')](_0x492a4a)[_0xaad8('0x2d')](_0x3d254e);};}exports[_0xaad8('0x2e')]=function(_0x24c01d,_0x5434a9){var _0xafb149={},_0x43c489={},_0x1e253f={'count':0x0,'rows':[]};var _0x31ad19=_[_0xaad8('0x2f')](db['FreshdeskField'][_0xaad8('0x30')],function(_0x4030ea){return{'name':_0x4030ea[_0xaad8('0x31')],'type':_0x4030ea[_0xaad8('0x32')]['key']};});_0x43c489[_0xaad8('0x33')]=_[_0xaad8('0x2f')](_0x31ad19,_0xaad8('0x2c'));_0x43c489[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x24c01d['query']);_0x43c489[_0xaad8('0x36')]=_[_0xaad8('0x37')](_0x43c489['model'],_0x43c489['query']);_0xafb149[_0xaad8('0x38')]=_[_0xaad8('0x37')](_0x43c489[_0xaad8('0x33')],qs[_0xaad8('0x39')](_0x24c01d['query'][_0xaad8('0x39')]));_0xafb149[_0xaad8('0x38')]=_0xafb149['attributes']['length']?_0xafb149[_0xaad8('0x38')]:_0x43c489[_0xaad8('0x33')];if(!_0x24c01d['query'][_0xaad8('0x3a')]('nolimit')){_0xafb149['limit']=qs[_0xaad8('0x20')](_0x24c01d[_0xaad8('0x34')]['limit']);_0xafb149[_0xaad8('0x3b')]=qs[_0xaad8('0x3b')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3b')]);}_0xafb149['order']=qs[_0xaad8('0x3c')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3c')]);_0xafb149[_0xaad8('0x3d')]=qs[_0xaad8('0x36')](_[_0xaad8('0x3e')](_0x24c01d['query'],_0x43c489[_0xaad8('0x36')]),_0x31ad19);if(_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]){_0xafb149['where']=_[_0xaad8('0x40')](_0xafb149[_0xaad8('0x3d')],{'$or':_[_0xaad8('0x2f')](_0x31ad19,function(_0x2864c4){if(_0x2864c4[_0xaad8('0x32')]!==_0xaad8('0x41')){var _0x3c699c={};_0x3c699c[_0x2864c4['name']]={'$like':'%'+_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]+'%'};return _0x3c699c;}})});}_0xafb149=_[_0xaad8('0x40')]({},_0xafb149,_0x24c01d[_0xaad8('0x42')]);var _0x3cb8ea={'where':_0xafb149[_0xaad8('0x3d')]};return db['FreshdeskField'][_0xaad8('0x21')](_0x3cb8ea)[_0xaad8('0x28')](function(_0x3ea87e){_0x1e253f[_0xaad8('0x21')]=_0x3ea87e;if(_0x24c01d['query']['includeAll']){_0xafb149['include']=[{'all':!![]}];}return db[_0xaad8('0x43')][_0xaad8('0x44')](_0xafb149);})[_0xaad8('0x28')](function(_0x5bb668){_0x1e253f[_0xaad8('0x45')]=_0x5bb668;return _0x1e253f;})[_0xaad8('0x28')](respondWithFilteredResult(_0x5434a9,_0xafb149))['catch'](handleError(_0x5434a9,null));};exports[_0xaad8('0x46')]=function(_0x11e67e,_0x2fd56a){var _0x292d4e={'raw':!![],'where':{'id':_0x11e67e[_0xaad8('0x47')]['id']}},_0x3933ac={};_0x3933ac[_0xaad8('0x33')]=_[_0xaad8('0x35')](db[_0xaad8('0x43')][_0xaad8('0x30')]);_0x3933ac[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x11e67e['query']);_0x3933ac['filters']=_['intersection'](_0x3933ac[_0xaad8('0x33')],_0x3933ac['query']);_0x292d4e[_0xaad8('0x38')]=_['intersection'](_0x3933ac['model'],qs[_0xaad8('0x39')](_0x11e67e['query'][_0xaad8('0x39')]));_0x292d4e[_0xaad8('0x38')]=_0x292d4e[_0xaad8('0x38')][_0xaad8('0x48')]?_0x292d4e[_0xaad8('0x38')]:_0x3933ac[_0xaad8('0x33')];if(_0x11e67e[_0xaad8('0x34')][_0xaad8('0x49')]){_0x292d4e[_0xaad8('0x4a')]=[{'all':!![]}];}_0x292d4e=_[_0xaad8('0x40')]({},_0x292d4e,_0x11e67e[_0xaad8('0x42')]);return db[_0xaad8('0x43')][_0xaad8('0x4b')](_0x292d4e)[_0xaad8('0x28')](handleEntityNotFound(_0x2fd56a,null))[_0xaad8('0x28')](respondWithResult(_0x2fd56a,null))['catch'](handleError(_0x2fd56a,null));};exports['create']=function(_0x46bf2a,_0x42cfa4){return db[_0xaad8('0x43')]['create'](_0x46bf2a['body'],{})[_0xaad8('0x28')](respondWithResult(_0x42cfa4,0xc9))['catch'](handleError(_0x42cfa4,null));};exports[_0xaad8('0x27')]=function(_0x1560ef,_0x313824){if(_0x1560ef[_0xaad8('0x4c')]['id']){delete _0x1560ef[_0xaad8('0x4c')]['id'];}return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x1560ef[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x313824,null))['then'](saveUpdates(_0x1560ef[_0xaad8('0x4c')],null))[_0xaad8('0x28')](respondWithResult(_0x313824,null))['catch'](handleError(_0x313824,null));};exports[_0xaad8('0x29')]=function(_0x5e5ef1,_0x2a2542){return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x5e5ef1[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x2a2542,null))[_0xaad8('0x28')](removeEntity(_0x2a2542,null))[_0xaad8('0x4d')](handleError(_0x2a2542,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 005db12..8a471ea 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 _0xea52=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','util','../../config/logger','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x153810,_0x4b3117){var _0x3df31a=function(_0x239357){while(--_0x239357){_0x153810['push'](_0x153810['shift']());}};_0x3df31a(++_0x4b3117);}(_0xea52,0x162));var _0x2ea5=function(_0x3faa8d,_0x1a6460){_0x3faa8d=_0x3faa8d-0x0;var _0x12e06d=_0xea52[_0x3faa8d];return _0x12e06d;};'use strict';var _=require('lodash');var util=require(_0x2ea5('0x0'));var logger=require(_0x2ea5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ea5('0x2'));var rimraf=require(_0x2ea5('0x3'));var config=require(_0x2ea5('0x4'));var attributes=require(_0x2ea5('0x5'));module[_0x2ea5('0x6')]=function(_0x526ec8,_0xf7e279){return _0x526ec8[_0x2ea5('0x7')](_0x2ea5('0x8'),attributes,{'tableName':_0x2ea5('0x9'),'paranoid':![],'indexes':[{'name':_0x2ea5('0xa'),'fields':[_0x2ea5('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1e8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x40e60f,_0x5365e1){var _0x35511f=function(_0x41df2d){while(--_0x41df2d){_0x40e60f['push'](_0x40e60f['shift']());}};_0x35511f(++_0x5365e1);}(_0xc1e8,0x87));var _0x8c1e=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xc1e8[_0x2d126e];return _0xcb04d3;};'use strict';var _=require(_0x8c1e('0x0'));var util=require(_0x8c1e('0x1'));var logger=require(_0x8c1e('0x2'))(_0x8c1e('0x3'));var moment=require(_0x8c1e('0x4'));var BPromise=require(_0x8c1e('0x5'));var rp=require(_0x8c1e('0x6'));var fs=require('fs');var path=require(_0x8c1e('0x7'));var rimraf=require(_0x8c1e('0x8'));var config=require(_0x8c1e('0x9'));var attributes=require(_0x8c1e('0xa'));module[_0x8c1e('0xb')]=function(_0x57e576,_0x380525){return _0x57e576[_0x8c1e('0xc')](_0x8c1e('0xd'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x8c1e('0xe'),'fields':[_0x8c1e('0xf'),_0x8c1e('0x10')],'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 fd055f1..a0778e7 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 _0x3333=['error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5cfc8b,_0x28b20e){var _0x42170e=function(_0x3d0711){while(--_0x3d0711){_0x5cfc8b['push'](_0x5cfc8b['shift']());}};_0x42170e(++_0x28b20e);}(_0x3333,0x147));var _0x3333=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x3333[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x3333('0x0'));var util=require(_0x3333('0x1'));var moment=require('moment');var BPromise=require(_0x3333('0x2'));var rs=require(_0x3333('0x3'));var fs=require('fs');var Redis=require(_0x3333('0x4'));var db=require(_0x3333('0x5'))['db'];var utils=require(_0x3333('0x6'));var logger=require(_0x3333('0x7'))(_0x3333('0x8'));var config=require(_0x3333('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3333('0xa')][_0x3333('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a7b3f,_0x372ba4,_0x4f7d8f){return new BPromise(function(_0x1155e3,_0x1d2cc7){return client[_0x3333('0xc')](_0x3a7b3f,_0x4f7d8f)['then'](function(_0x274eb5){logger[_0x3333('0xd')](_0x3333('0xe'),_0x372ba4,'request\x20sent');logger[_0x3333('0xf')](_0x3333('0x10'),_0x372ba4,'request\x20sent',JSON[_0x3333('0x11')](_0x274eb5));if(_0x274eb5['error']){if(_0x274eb5[_0x3333('0x12')][_0x3333('0x13')]===0x1f4){logger[_0x3333('0x12')](_0x3333('0xe'),_0x372ba4,_0x274eb5[_0x3333('0x12')][_0x3333('0x14')]);return _0x1d2cc7(_0x274eb5[_0x3333('0x12')][_0x3333('0x14')]);}logger[_0x3333('0x12')](_0x3333('0xe'),_0x372ba4,_0x274eb5[_0x3333('0x12')][_0x3333('0x14')]);return _0x1155e3(_0x274eb5[_0x3333('0x12')][_0x3333('0x14')]);}else{logger[_0x3333('0xd')](_0x3333('0xe'),_0x372ba4,_0x3333('0x15'));_0x1155e3(_0x274eb5[_0x3333('0x16')][_0x3333('0x14')]);}})['catch'](function(_0x5da633){logger['error'](_0x3333('0xe'),_0x372ba4,_0x5da633);_0x1d2cc7(_0x5da633);});});} \ No newline at end of file +var _0x5d3b=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x606d96,_0x593ee1){var _0x1af139=function(_0x1f92cc){while(--_0x1f92cc){_0x606d96['push'](_0x606d96['shift']());}};_0x1af139(++_0x593ee1);}(_0x5d3b,0xf7));var _0xb5d3=function(_0x1dd78b,_0x213fd9){_0x1dd78b=_0x1dd78b-0x0;var _0x2d9bf6=_0x5d3b[_0x1dd78b];return _0x2d9bf6;};'use strict';var _=require('lodash');var util=require(_0xb5d3('0x0'));var moment=require(_0xb5d3('0x1'));var BPromise=require(_0xb5d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5d3('0x3'))['db'];var utils=require(_0xb5d3('0x4'));var logger=require(_0xb5d3('0x5'))(_0xb5d3('0x6'));var config=require(_0xb5d3('0x7'));var jayson=require(_0xb5d3('0x8'));var client=jayson[_0xb5d3('0x9')][_0xb5d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a0177,_0x165839,_0x17306a){return new BPromise(function(_0x21907b,_0x57337d){return client[_0xb5d3('0xb')](_0x2a0177,_0x17306a)[_0xb5d3('0xc')](function(_0x382dcf){logger[_0xb5d3('0xd')](_0xb5d3('0xe'),_0x165839,_0xb5d3('0xf'));logger[_0xb5d3('0x10')](_0xb5d3('0x11'),_0x165839,_0xb5d3('0xf'),JSON[_0xb5d3('0x12')](_0x382dcf));if(_0x382dcf['error']){if(_0x382dcf[_0xb5d3('0x13')][_0xb5d3('0x14')]===0x1f4){logger[_0xb5d3('0x13')](_0xb5d3('0xe'),_0x165839,_0x382dcf['error'][_0xb5d3('0x15')]);return _0x57337d(_0x382dcf[_0xb5d3('0x13')]['message']);}logger[_0xb5d3('0x13')](_0xb5d3('0xe'),_0x165839,_0x382dcf['error'][_0xb5d3('0x15')]);return _0x21907b(_0x382dcf[_0xb5d3('0x13')][_0xb5d3('0x15')]);}else{logger[_0xb5d3('0xd')](_0xb5d3('0xe'),_0x165839,_0xb5d3('0xf'));_0x21907b(_0x382dcf['result'][_0xb5d3('0x15')]);}})['catch'](function(_0x3b0160){logger[_0xb5d3('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x165839,_0x3b0160);_0x57337d(_0x3b0160);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2208d9c..545288e 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 _0x58a4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer'];(function(_0x394381,_0x1a623c){var _0x469491=function(_0x53620f){while(--_0x53620f){_0x394381['push'](_0x394381['shift']());}};_0x469491(++_0x1a623c);}(_0x58a4,0xbf));var _0x458a=function(_0x1fdf47,_0x1da0d0){_0x1fdf47=_0x1fdf47-0x0;var _0x2f42d3=_0x58a4[_0x1fdf47];return _0x2f42d3;};'use strict';var multer=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var path=require(_0x458a('0x2'));var timeout=require(_0x458a('0x3'));var express=require(_0x458a('0x4'));var router=express[_0x458a('0x5')]();var fs_extra=require(_0x458a('0x6'));var auth=require(_0x458a('0x7'));var interaction=require(_0x458a('0x8'));var config=require(_0x458a('0x9'));var controller=require(_0x458a('0xa'));router[_0x458a('0xb')]('/',auth[_0x458a('0xc')](),controller['index']);router['get'](_0x458a('0xd'),auth[_0x458a('0xc')](),controller[_0x458a('0xe')]);router[_0x458a('0xb')](_0x458a('0xf'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x458a('0xb')](_0x458a('0x10'),auth[_0x458a('0xc')](),controller[_0x458a('0x11')]);router[_0x458a('0x12')]('/',auth['isAuthenticated'](),controller[_0x458a('0x13')]);router[_0x458a('0x12')]('/:id/configurations',auth[_0x458a('0xc')](),controller[_0x458a('0x14')]);router[_0x458a('0x15')](_0x458a('0xd'),auth[_0x458a('0xc')](),controller['update']);router['delete'](_0x458a('0xd'),auth['isAuthenticated'](),controller[_0x458a('0x16')]);module[_0x458a('0x17')]=router; \ No newline at end of file +var _0xe706=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x19d600,_0x2502b8){var _0x3a30a0=function(_0x3b3782){while(--_0x3b3782){_0x19d600['push'](_0x19d600['shift']());}};_0x3a30a0(++_0x2502b8);}(_0xe706,0xa3));var _0x6e70=function(_0x4eb662,_0x540e40){_0x4eb662=_0x4eb662-0x0;var _0x2d7889=_0xe706[_0x4eb662];return _0x2d7889;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')]('/',auth[_0x6e70('0xb')](),controller['create']);router['post'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 61f5a82..e16dce3 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 _0x4213=['exports','STRING','username','remoteUri','sequelize'];(function(_0x18dfba,_0x24c765){var _0x286f11=function(_0x3ec281){while(--_0x3ec281){_0x18dfba['push'](_0x18dfba['shift']());}};_0x286f11(++_0x24c765);}(_0x4213,0x77));var _0x3421=function(_0x4901af,_0x40d214){_0x4901af=_0x4901af-0x0;var _0x1f224c=_0x4213[_0x4901af];return _0x1f224c;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'name':{'type':Sequelize[_0x3421('0x2')]},'description':{'type':Sequelize[_0x3421('0x2')]},'username':{'type':Sequelize[_0x3421('0x2')],'unique':_0x3421('0x3')},'apiKey':{'type':Sequelize[_0x3421('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3421('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x524e=['username','remoteUri','STRING'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x524e,0x15e));var _0xe524=function(_0x4d7f05,_0x23ab7d){_0x4d7f05=_0x4d7f05-0x0;var _0x282caa=_0x524e[_0x4d7f05];return _0x282caa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe524('0x0')]},'description':{'type':Sequelize[_0xe524('0x0')]},'username':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x1')},'apiKey':{'type':Sequelize[_0xe524('0x0')]},'remoteUri':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x2')},'serverUrl':{'type':Sequelize[_0xe524('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 047de4c..22e9348 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 _0xdbed=['FreshsalesField','Descriptions','getFields','username','remoteUri','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','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','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','merge','filter','options','FreshsalesAccount','findAll','rows','catch','keys','length','includeAll','include','create','body','find','params','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration'];(function(_0x2c8d1d,_0x1feb18){var _0x6f35a7=function(_0x2e72c9){while(--_0x2e72c9){_0x2c8d1d['push'](_0x2c8d1d['shift']());}};_0x6f35a7(++_0x1feb18);}(_0xdbed,0x7e));var _0xddbe=function(_0x3bf875,_0x5adac3){_0x3bf875=_0x3bf875-0x0;var _0xdaad30=_0xdbed[_0x3bf875];return _0xdaad30;};'use strict';var emlformat=require(_0xddbe('0x0'));var rimraf=require(_0xddbe('0x1'));var zipdir=require(_0xddbe('0x2'));var jsonpatch=require(_0xddbe('0x3'));var rp=require(_0xddbe('0x4'));var moment=require(_0xddbe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xddbe('0x6'));var util=require(_0xddbe('0x7'));var path=require(_0xddbe('0x8'));var sox=require(_0xddbe('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddbe('0xa'));var _=require(_0xddbe('0xb'));var squel=require(_0xddbe('0xc'));var crypto=require(_0xddbe('0xd'));var jsforce=require(_0xddbe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xddbe('0xf'));var querystring=require(_0xddbe('0x10'));var Papa=require(_0xddbe('0x11'));var Redis=require('ioredis');var authService=require(_0xddbe('0x12'));var qs=require(_0xddbe('0x13'));var as=require(_0xddbe('0x14'));var hardwareService=require(_0xddbe('0x15'));var logger=require(_0xddbe('0x16'))(_0xddbe('0x17'));var utils=require(_0xddbe('0x18'));var config=require(_0xddbe('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xddbe('0x1a'))['db'];var integrations=require(_0xddbe('0x1b'));function respondWithStatusCode(_0x4eb172,_0x462625){_0x462625=_0x462625||0xcc;return function(_0x5d7d5d){if(_0x5d7d5d){return _0x4eb172['sendStatus'](_0x462625);}return _0x4eb172[_0xddbe('0x1c')](_0x462625)[_0xddbe('0x1d')]();};}function respondWithResult(_0x2e0473,_0x5539f9){_0x5539f9=_0x5539f9||0xc8;return function(_0xd22b9c){if(_0xd22b9c){return _0x2e0473[_0xddbe('0x1c')](_0x5539f9)[_0xddbe('0x1e')](_0xd22b9c);}};}function respondWithFilteredResult(_0x4922be,_0x3edb09){return function(_0x1e1f61){if(_0x1e1f61){var _0x3075c0=typeof _0x3edb09[_0xddbe('0x1f')]===_0xddbe('0x20')&&typeof _0x3edb09[_0xddbe('0x21')]===_0xddbe('0x20');var _0x4a2904=_0x1e1f61[_0xddbe('0x22')];var _0x4a2833=_0x3075c0?0x0:_0x3edb09[_0xddbe('0x1f')];var _0x2cd0b1=_0x3075c0?_0x1e1f61['count']:_0x3edb09[_0xddbe('0x1f')]+_0x3edb09[_0xddbe('0x21')];var _0x3bd2e4;if(_0x2cd0b1>=_0x4a2904){_0x2cd0b1=_0x4a2904;_0x3bd2e4=0xc8;}else{_0x3bd2e4=0xce;}_0x4922be[_0xddbe('0x1c')](_0x3bd2e4);return _0x4922be['set'](_0xddbe('0x23'),_0x4a2833+'-'+_0x2cd0b1+'/'+_0x4a2904)[_0xddbe('0x1e')](_0x1e1f61);}return null;};}function patchUpdates(_0x1e6378){return function(_0x5250d4){try{jsonpatch[_0xddbe('0x24')](_0x5250d4,_0x1e6378,!![]);}catch(_0x4bfe72){return BPromise['reject'](_0x4bfe72);}return _0x5250d4[_0xddbe('0x25')]();};}function saveUpdates(_0x178dad,_0x1663fc){return function(_0x39f9ac){if(_0x39f9ac){return _0x39f9ac['update'](_0x178dad)['then'](function(_0x418381){return _0x418381;});}return null;};}function removeEntity(_0x3f0296,_0x204923){return function(_0x4007d5){if(_0x4007d5){return _0x4007d5[_0xddbe('0x26')]()[_0xddbe('0x27')](function(){_0x3f0296[_0xddbe('0x1c')](0xcc)[_0xddbe('0x1d')]();});}};}function handleEntityNotFound(_0x1dc2d7,_0x415411){return function(_0x578e84){if(!_0x578e84){_0x1dc2d7[_0xddbe('0x28')](0x194);}return _0x578e84;};}function handleError(_0x2631dc,_0x1d3ede){_0x1d3ede=_0x1d3ede||0x1f4;return function(_0x9f811c){logger['error'](_0x9f811c[_0xddbe('0x29')]);if(_0x9f811c['name']){delete _0x9f811c[_0xddbe('0x2a')];}_0x2631dc['status'](_0x1d3ede)[_0xddbe('0x2b')](_0x9f811c);};}exports[_0xddbe('0x2c')]=function(_0x339efb,_0x35f156){var _0x2bb9a0={},_0x5839fa={},_0x56c10a={'count':0x0,'rows':[]};var _0xd3948=_[_0xddbe('0x2d')](db['FreshsalesAccount'][_0xddbe('0x2e')],function(_0x290bd3){return{'name':_0x290bd3['fieldName'],'type':_0x290bd3[_0xddbe('0x2f')][_0xddbe('0x30')]};});_0x5839fa[_0xddbe('0x31')]=_[_0xddbe('0x2d')](_0xd3948,_0xddbe('0x2a'));_0x5839fa[_0xddbe('0x32')]=_['keys'](_0x339efb[_0xddbe('0x32')]);_0x5839fa['filters']=_[_0xddbe('0x33')](_0x5839fa[_0xddbe('0x31')],_0x5839fa[_0xddbe('0x32')]);_0x2bb9a0['attributes']=_[_0xddbe('0x33')](_0x5839fa[_0xddbe('0x31')],qs[_0xddbe('0x34')](_0x339efb[_0xddbe('0x32')][_0xddbe('0x34')]));_0x2bb9a0[_0xddbe('0x35')]=_0x2bb9a0['attributes']['length']?_0x2bb9a0[_0xddbe('0x35')]:_0x5839fa[_0xddbe('0x31')];if(!_0x339efb[_0xddbe('0x32')]['hasOwnProperty'](_0xddbe('0x36'))){_0x2bb9a0[_0xddbe('0x21')]=qs['limit'](_0x339efb[_0xddbe('0x32')]['limit']);_0x2bb9a0[_0xddbe('0x1f')]=qs[_0xddbe('0x1f')](_0x339efb[_0xddbe('0x32')][_0xddbe('0x1f')]);}_0x2bb9a0['order']=qs[_0xddbe('0x37')](_0x339efb[_0xddbe('0x32')]['sort']);_0x2bb9a0[_0xddbe('0x38')]=qs[_0xddbe('0x39')](_[_0xddbe('0x3a')](_0x339efb['query'],_0x5839fa[_0xddbe('0x39')]),_0xd3948);if(_0x339efb[_0xddbe('0x32')]['filter']){_0x2bb9a0['where']=_[_0xddbe('0x3b')](_0x2bb9a0['where'],{'$or':_[_0xddbe('0x2d')](_0xd3948,function(_0x45b0f8){if(_0x45b0f8[_0xddbe('0x2f')]!=='VIRTUAL'){var _0x4cc108={};_0x4cc108[_0x45b0f8['name']]={'$like':'%'+_0x339efb[_0xddbe('0x32')][_0xddbe('0x3c')]+'%'};return _0x4cc108;}})});}_0x2bb9a0=_[_0xddbe('0x3b')]({},_0x2bb9a0,_0x339efb[_0xddbe('0x3d')]);var _0x5ad460={'where':_0x2bb9a0[_0xddbe('0x38')]};return db[_0xddbe('0x3e')][_0xddbe('0x22')](_0x5ad460)[_0xddbe('0x27')](function(_0x470e84){_0x56c10a['count']=_0x470e84;if(_0x339efb[_0xddbe('0x32')]['includeAll']){_0x2bb9a0['include']=[{'all':!![]}];}return db[_0xddbe('0x3e')][_0xddbe('0x3f')](_0x2bb9a0);})[_0xddbe('0x27')](function(_0x47e3c9){_0x56c10a[_0xddbe('0x40')]=_0x47e3c9;return _0x56c10a;})['then'](respondWithFilteredResult(_0x35f156,_0x2bb9a0))[_0xddbe('0x41')](handleError(_0x35f156,null));};exports['show']=function(_0x59c19f,_0x20369b){var _0x39ccc2={'raw':![],'where':{'id':_0x59c19f['params']['id']}},_0x3a2766={};_0x3a2766['model']=_[_0xddbe('0x42')](db[_0xddbe('0x3e')][_0xddbe('0x2e')]);_0x3a2766[_0xddbe('0x32')]=_[_0xddbe('0x42')](_0x59c19f[_0xddbe('0x32')]);_0x3a2766[_0xddbe('0x39')]=_['intersection'](_0x3a2766[_0xddbe('0x31')],_0x3a2766['query']);_0x39ccc2[_0xddbe('0x35')]=_[_0xddbe('0x33')](_0x3a2766[_0xddbe('0x31')],qs[_0xddbe('0x34')](_0x59c19f[_0xddbe('0x32')][_0xddbe('0x34')]));_0x39ccc2['attributes']=_0x39ccc2[_0xddbe('0x35')][_0xddbe('0x43')]?_0x39ccc2[_0xddbe('0x35')]:_0x3a2766[_0xddbe('0x31')];if(_0x59c19f[_0xddbe('0x32')][_0xddbe('0x44')]){_0x39ccc2[_0xddbe('0x45')]=[{'all':!![]}];}_0x39ccc2=_[_0xddbe('0x3b')]({},_0x39ccc2,_0x59c19f[_0xddbe('0x3d')]);return db[_0xddbe('0x3e')]['find'](_0x39ccc2)[_0xddbe('0x27')](handleEntityNotFound(_0x20369b,null))[_0xddbe('0x27')](respondWithResult(_0x20369b,null))[_0xddbe('0x41')](handleError(_0x20369b,null));};exports[_0xddbe('0x46')]=function(_0x16f94d,_0x5c597c){return db['FreshsalesAccount'][_0xddbe('0x46')](_0x16f94d['body'],{})['then'](respondWithResult(_0x5c597c,0xc9))[_0xddbe('0x41')](handleError(_0x5c597c,null));};exports['update']=function(_0x429444,_0x43ed32){if(_0x429444['body']['id']){delete _0x429444[_0xddbe('0x47')]['id'];}return db[_0xddbe('0x3e')][_0xddbe('0x48')]({'where':{'id':_0x429444[_0xddbe('0x49')]['id']}})[_0xddbe('0x27')](handleEntityNotFound(_0x43ed32,null))[_0xddbe('0x27')](saveUpdates(_0x429444[_0xddbe('0x47')],null))[_0xddbe('0x27')](respondWithResult(_0x43ed32,null))[_0xddbe('0x41')](handleError(_0x43ed32,null));};exports[_0xddbe('0x26')]=function(_0xe22a50,_0x384700){return db[_0xddbe('0x3e')]['find']({'where':{'id':_0xe22a50[_0xddbe('0x49')]['id']}})[_0xddbe('0x27')](handleEntityNotFound(_0x384700,null))[_0xddbe('0x27')](removeEntity(_0x384700,null))['catch'](handleError(_0x384700,null));};exports[_0xddbe('0x4a')]=function(_0x1efcfe,_0x4b1842,_0x123d5f){var _0x2517a4={};var _0x13d84a={};var _0x1d71db;var _0x581977;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x1efcfe['params']['id']}})[_0xddbe('0x27')](handleEntityNotFound(_0x4b1842,null))['then'](function(_0x1cd273){if(_0x1cd273){_0x1d71db=_0x1cd273;_0x13d84a['model']=_[_0xddbe('0x42')](db['FreshsalesConfiguration'][_0xddbe('0x2e')]);_0x13d84a[_0xddbe('0x32')]=_[_0xddbe('0x42')](_0x1efcfe['query']);_0x13d84a[_0xddbe('0x39')]=_[_0xddbe('0x33')](_0x13d84a[_0xddbe('0x31')],_0x13d84a[_0xddbe('0x32')]);_0x2517a4[_0xddbe('0x35')]=_[_0xddbe('0x33')](_0x13d84a['model'],qs[_0xddbe('0x34')](_0x1efcfe['query'][_0xddbe('0x34')]));_0x2517a4['attributes']=_0x2517a4[_0xddbe('0x35')][_0xddbe('0x43')]?_0x2517a4[_0xddbe('0x35')]:_0x13d84a[_0xddbe('0x31')];_0x2517a4['order']=qs[_0xddbe('0x37')](_0x1efcfe[_0xddbe('0x32')]['sort']);_0x2517a4[_0xddbe('0x38')]=qs[_0xddbe('0x39')](_[_0xddbe('0x3a')](_0x1efcfe[_0xddbe('0x32')],_0x13d84a[_0xddbe('0x39')]));if(_0x1efcfe['query'][_0xddbe('0x3c')]){_0x2517a4['where']=_[_0xddbe('0x3b')](_0x2517a4['where'],{'$or':_[_0xddbe('0x2d')](_0x2517a4['attributes'],function(_0x1c7625){var _0x1fffab={};_0x1fffab[_0x1c7625]={'$like':'%'+_0x1efcfe[_0xddbe('0x32')][_0xddbe('0x3c')]+'%'};return _0x1fffab;})});}_0x2517a4=_[_0xddbe('0x3b')]({},_0x2517a4,_0x1efcfe[_0xddbe('0x3d')]);return _0x1d71db[_0xddbe('0x4a')](_0x2517a4);}})['then'](function(_0x25bc31){if(_0x25bc31){_0x581977=_0x25bc31[_0xddbe('0x43')];if(!_0x1efcfe['query'][_0xddbe('0x4b')](_0xddbe('0x36'))){_0x2517a4[_0xddbe('0x21')]=qs[_0xddbe('0x21')](_0x1efcfe[_0xddbe('0x32')]['limit']);_0x2517a4[_0xddbe('0x1f')]=qs[_0xddbe('0x1f')](_0x1efcfe['query']['offset']);}return _0x1d71db[_0xddbe('0x4a')](_0x2517a4);}})[_0xddbe('0x27')](function(_0x3c6a5e){if(_0x3c6a5e){return _0x3c6a5e?{'count':_0x581977,'rows':_0x3c6a5e}:null;}})[_0xddbe('0x27')](respondWithResult(_0x4b1842,null))[_0xddbe('0x41')](handleError(_0x4b1842,null));};exports[_0xddbe('0x4c')]=function(_0x1ad4ca,_0x3a701d,_0x2999bf){if(_0x1ad4ca[_0xddbe('0x47')]['id']){delete _0x1ad4ca[_0xddbe('0x47')]['id'];}return db['FreshsalesAccount'][_0xddbe('0x4d')]({'where':{'id':_0x1ad4ca['params']['id']}})[_0xddbe('0x27')](handleEntityNotFound(_0x3a701d,null))['then'](function(_0x2bed5d){if(_0x2bed5d){_0x1ad4ca[_0xddbe('0x47')][_0xddbe('0x4e')]=_0x2bed5d['id'];_0x1ad4ca[_0xddbe('0x47')][_0xddbe('0x4f')]=integrations[_0xddbe('0x50')](_0x1ad4ca[_0xddbe('0x47')][_0xddbe('0x51')],_0x1ad4ca[_0xddbe('0x47')][_0xddbe('0x2f')]);_0x1ad4ca[_0xddbe('0x47')]['Descriptions']=integrations[_0xddbe('0x52')](_0x1ad4ca[_0xddbe('0x47')]['channel'],_0x1ad4ca[_0xddbe('0x47')]['type']);return db[_0xddbe('0x53')][_0xddbe('0x46')](_0x1ad4ca[_0xddbe('0x47')],{'include':[{'model':db['FreshsalesField'],'as':_0xddbe('0x4f')},{'model':db[_0xddbe('0x54')],'as':_0xddbe('0x55')}]});}return null;})[_0xddbe('0x27')](respondWithResult(_0x3a701d,null))[_0xddbe('0x41')](handleError(_0x3a701d,null));};exports[_0xddbe('0x56')]=function(_0x31fbec,_0x48a135,_0x23fe1f){var _0x5d3fb9='';var _0xe8fb5='';return db[_0xddbe('0x3e')][_0xddbe('0x4d')]({'where':{'id':_0x31fbec['params']['id']},'attributes':['id',_0xddbe('0x57'),'remoteUri','apiKey']})[_0xddbe('0x27')](handleEntityNotFound(_0x48a135,null))[_0xddbe('0x27')](function(_0xc7ae6){if(_0xc7ae6){_0xe8fb5=_0xc7ae6[_0xddbe('0x57')];_0x5d3fb9=_0xc7ae6[_0xddbe('0x58')];var _0xed26ed=_0xc7ae6[_0xddbe('0x58')][_0xddbe('0x59')](-0x1);if(_0xed26ed==='/'){_0x5d3fb9=_0x5d3fb9['substring'](0x0,_0x5d3fb9[_0xddbe('0x5a')](_0xed26ed));}return rp({'method':_0xddbe('0x5b'),'uri':util[_0xddbe('0x5c')](_0xddbe('0x5d'),_0x5d3fb9,_0xddbe('0x5e')),'headers':{'Authorization':_0xddbe('0x5f')+_0xc7ae6[_0xddbe('0x60')]},'json':!![]});}})['then'](function(_0x1de4af){if(_0x1de4af){var _0x1ceb51=_0x1de4af[_0xddbe('0x61')];var _0x34c36c=![];var _0x5a73e2=null;for(_0x5a73e2=0x0;_0x5a73e2<_0x1ceb51[_0xddbe('0x43')];_0x5a73e2++){if(_0x1ceb51[_0x5a73e2][_0xddbe('0x62')]===_0xe8fb5){_0x34c36c=!![];}}if(_0x34c36c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xddbe('0x63')});}}})[_0xddbe('0x27')](respondWithResult(_0x48a135,null))[_0xddbe('0x41')](function(_0x5683e2){var _0xcde6d3=_0x31fbec['query'][_0xddbe('0x64')]?0x1f4:_0x5683e2[_0xddbe('0x65')]||0x1f4;logger[_0xddbe('0x66')](_0xddbe('0x67'),_0xddbe('0x56'),_0xcde6d3,JSON[_0xddbe('0x68')](_0x5683e2));delete _0x5683e2[_0xddbe('0x2a')];if(_0xcde6d3===0x191){_0xcde6d3=0x190;}_0x48a135[_0xddbe('0x1c')](_0xcde6d3)['send'](_0x31fbec['query'][_0xddbe('0x64')]?{'message':'Wrong\x20credentials','statusCode':_0x5683e2[_0xddbe('0x65')]}:_0x5683e2);});}; \ No newline at end of file +var _0xded1=['users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','FreshsalesAccount','include','findAll','rows','catch','show','includeAll','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','map','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','apiKey','remoteUri','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token='];(function(_0xb57be1,_0x189ee5){var _0x294aa3=function(_0x181bbe){while(--_0x181bbe){_0xb57be1['push'](_0xb57be1['shift']());}};_0x294aa3(++_0x189ee5);}(_0xded1,0x6f));var _0x1ded=function(_0x1bc41f,_0x2e6cd7){_0x1bc41f=_0x1bc41f-0x0;var _0x1f7025=_0xded1[_0x1bc41f];return _0x1f7025;};'use strict';var emlformat=require(_0x1ded('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ded('0x1'));var jsonpatch=require(_0x1ded('0x2'));var rp=require(_0x1ded('0x3'));var moment=require(_0x1ded('0x4'));var BPromise=require(_0x1ded('0x5'));var Mustache=require(_0x1ded('0x6'));var util=require('util');var path=require(_0x1ded('0x7'));var sox=require(_0x1ded('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ded('0x9'));var _=require(_0x1ded('0xa'));var squel=require(_0x1ded('0xb'));var crypto=require(_0x1ded('0xc'));var jsforce=require(_0x1ded('0xd'));var deskjs=require(_0x1ded('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ded('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ded('0x10'));var authService=require(_0x1ded('0x11'));var qs=require(_0x1ded('0x12'));var as=require(_0x1ded('0x13'));var hardwareService=require(_0x1ded('0x14'));var logger=require(_0x1ded('0x15'))('api');var utils=require(_0x1ded('0x16'));var config=require(_0x1ded('0x17'));var licenseUtil=require(_0x1ded('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1ded('0x19'));function respondWithStatusCode(_0x1df867,_0x2b96e0){_0x2b96e0=_0x2b96e0||0xcc;return function(_0x4d0554){if(_0x4d0554){return _0x1df867[_0x1ded('0x1a')](_0x2b96e0);}return _0x1df867[_0x1ded('0x1b')](_0x2b96e0)[_0x1ded('0x1c')]();};}function respondWithResult(_0x3b1627,_0x4a4a17){_0x4a4a17=_0x4a4a17||0xc8;return function(_0xa2addd){if(_0xa2addd){return _0x3b1627[_0x1ded('0x1b')](_0x4a4a17)[_0x1ded('0x1d')](_0xa2addd);}};}function respondWithFilteredResult(_0x14fc9d,_0x231092){return function(_0x5ce772){if(_0x5ce772){var _0x219d75=typeof _0x231092['offset']===_0x1ded('0x1e')&&typeof _0x231092[_0x1ded('0x1f')]==='undefined';var _0xc31e67=_0x5ce772['count'];var _0xeb0543=_0x219d75?0x0:_0x231092[_0x1ded('0x20')];var _0x325af2=_0x219d75?_0x5ce772[_0x1ded('0x21')]:_0x231092[_0x1ded('0x20')]+_0x231092[_0x1ded('0x1f')];var _0x497707;if(_0x325af2>=_0xc31e67){_0x325af2=_0xc31e67;_0x497707=0xc8;}else{_0x497707=0xce;}_0x14fc9d[_0x1ded('0x1b')](_0x497707);return _0x14fc9d['set'](_0x1ded('0x22'),_0xeb0543+'-'+_0x325af2+'/'+_0xc31e67)[_0x1ded('0x1d')](_0x5ce772);}return null;};}function patchUpdates(_0x578de7){return function(_0x4b362e){try{jsonpatch[_0x1ded('0x23')](_0x4b362e,_0x578de7,!![]);}catch(_0x4bfa21){return BPromise[_0x1ded('0x24')](_0x4bfa21);}return _0x4b362e['save']();};}function saveUpdates(_0x2b3d4e,_0x5d413c){return function(_0xa210e5){if(_0xa210e5){return _0xa210e5[_0x1ded('0x25')](_0x2b3d4e)[_0x1ded('0x26')](function(_0x660809){return _0x660809;});}return null;};}function removeEntity(_0x1d31fa,_0x4bc248){return function(_0xcdbe72){if(_0xcdbe72){return _0xcdbe72[_0x1ded('0x27')]()[_0x1ded('0x26')](function(){_0x1d31fa[_0x1ded('0x1b')](0xcc)[_0x1ded('0x1c')]();});}};}function handleEntityNotFound(_0x20f8df,_0x2c114e){return function(_0x27ce5e){if(!_0x27ce5e){_0x20f8df[_0x1ded('0x1a')](0x194);}return _0x27ce5e;};}function handleError(_0x215509,_0x158733){_0x158733=_0x158733||0x1f4;return function(_0x266ef5){logger[_0x1ded('0x28')](_0x266ef5[_0x1ded('0x29')]);if(_0x266ef5[_0x1ded('0x2a')]){delete _0x266ef5[_0x1ded('0x2a')];}_0x215509[_0x1ded('0x1b')](_0x158733)[_0x1ded('0x2b')](_0x266ef5);};}exports['index']=function(_0x4edb95,_0x5e5d46){var _0x437d1a={},_0x56d871={},_0x336eef={'count':0x0,'rows':[]};var _0x1e8875=_['map'](db['FreshsalesAccount'][_0x1ded('0x2c')],function(_0x24db9c){return{'name':_0x24db9c[_0x1ded('0x2d')],'type':_0x24db9c[_0x1ded('0x2e')][_0x1ded('0x2f')]};});_0x56d871[_0x1ded('0x30')]=_['map'](_0x1e8875,'name');_0x56d871['query']=_[_0x1ded('0x31')](_0x4edb95[_0x1ded('0x32')]);_0x56d871[_0x1ded('0x33')]=_[_0x1ded('0x34')](_0x56d871[_0x1ded('0x30')],_0x56d871[_0x1ded('0x32')]);_0x437d1a[_0x1ded('0x35')]=_['intersection'](_0x56d871[_0x1ded('0x30')],qs[_0x1ded('0x36')](_0x4edb95[_0x1ded('0x32')][_0x1ded('0x36')]));_0x437d1a[_0x1ded('0x35')]=_0x437d1a['attributes'][_0x1ded('0x37')]?_0x437d1a[_0x1ded('0x35')]:_0x56d871['model'];if(!_0x4edb95[_0x1ded('0x32')][_0x1ded('0x38')](_0x1ded('0x39'))){_0x437d1a[_0x1ded('0x1f')]=qs['limit'](_0x4edb95[_0x1ded('0x32')][_0x1ded('0x1f')]);_0x437d1a['offset']=qs['offset'](_0x4edb95[_0x1ded('0x32')]['offset']);}_0x437d1a[_0x1ded('0x3a')]=qs[_0x1ded('0x3b')](_0x4edb95[_0x1ded('0x32')][_0x1ded('0x3b')]);_0x437d1a['where']=qs['filters'](_[_0x1ded('0x3c')](_0x4edb95[_0x1ded('0x32')],_0x56d871[_0x1ded('0x33')]),_0x1e8875);if(_0x4edb95[_0x1ded('0x32')][_0x1ded('0x3d')]){_0x437d1a['where']=_[_0x1ded('0x3e')](_0x437d1a['where'],{'$or':_['map'](_0x1e8875,function(_0x21f605){if(_0x21f605['type']!=='VIRTUAL'){var _0x2146ee={};_0x2146ee[_0x21f605[_0x1ded('0x2a')]]={'$like':'%'+_0x4edb95['query'][_0x1ded('0x3d')]+'%'};return _0x2146ee;}})});}_0x437d1a=_[_0x1ded('0x3e')]({},_0x437d1a,_0x4edb95[_0x1ded('0x3f')]);var _0x287b23={'where':_0x437d1a[_0x1ded('0x40')]};return db[_0x1ded('0x41')]['count'](_0x287b23)[_0x1ded('0x26')](function(_0x3c3e7d){_0x336eef[_0x1ded('0x21')]=_0x3c3e7d;if(_0x4edb95[_0x1ded('0x32')]['includeAll']){_0x437d1a[_0x1ded('0x42')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x1ded('0x43')](_0x437d1a);})[_0x1ded('0x26')](function(_0x1b7fa2){_0x336eef[_0x1ded('0x44')]=_0x1b7fa2;return _0x336eef;})[_0x1ded('0x26')](respondWithFilteredResult(_0x5e5d46,_0x437d1a))[_0x1ded('0x45')](handleError(_0x5e5d46,null));};exports[_0x1ded('0x46')]=function(_0x4ed889,_0x4866bc){var _0x12d50a={'raw':![],'where':{'id':_0x4ed889['params']['id']}},_0x2e6bee={};_0x2e6bee[_0x1ded('0x30')]=_[_0x1ded('0x31')](db[_0x1ded('0x41')][_0x1ded('0x2c')]);_0x2e6bee[_0x1ded('0x32')]=_[_0x1ded('0x31')](_0x4ed889['query']);_0x2e6bee[_0x1ded('0x33')]=_['intersection'](_0x2e6bee['model'],_0x2e6bee[_0x1ded('0x32')]);_0x12d50a[_0x1ded('0x35')]=_['intersection'](_0x2e6bee[_0x1ded('0x30')],qs[_0x1ded('0x36')](_0x4ed889[_0x1ded('0x32')]['fields']));_0x12d50a[_0x1ded('0x35')]=_0x12d50a[_0x1ded('0x35')][_0x1ded('0x37')]?_0x12d50a[_0x1ded('0x35')]:_0x2e6bee['model'];if(_0x4ed889['query'][_0x1ded('0x47')]){_0x12d50a['include']=[{'all':!![]}];}_0x12d50a=_['merge']({},_0x12d50a,_0x4ed889[_0x1ded('0x3f')]);return db[_0x1ded('0x41')][_0x1ded('0x48')](_0x12d50a)[_0x1ded('0x26')](handleEntityNotFound(_0x4866bc,null))[_0x1ded('0x26')](respondWithResult(_0x4866bc,null))['catch'](handleError(_0x4866bc,null));};exports[_0x1ded('0x49')]=function(_0x248f15,_0x118693){return db[_0x1ded('0x41')][_0x1ded('0x49')](_0x248f15[_0x1ded('0x4a')],{})[_0x1ded('0x26')](respondWithResult(_0x118693,0xc9))[_0x1ded('0x45')](handleError(_0x118693,null));};exports[_0x1ded('0x25')]=function(_0x31b7b8,_0x108d1b){if(_0x31b7b8[_0x1ded('0x4a')]['id']){delete _0x31b7b8[_0x1ded('0x4a')]['id'];}return db[_0x1ded('0x41')][_0x1ded('0x48')]({'where':{'id':_0x31b7b8[_0x1ded('0x4b')]['id']}})[_0x1ded('0x26')](handleEntityNotFound(_0x108d1b,null))[_0x1ded('0x26')](saveUpdates(_0x31b7b8['body'],null))[_0x1ded('0x26')](respondWithResult(_0x108d1b,null))[_0x1ded('0x45')](handleError(_0x108d1b,null));};exports['destroy']=function(_0x447756,_0x2318fc){return db[_0x1ded('0x41')][_0x1ded('0x48')]({'where':{'id':_0x447756['params']['id']}})[_0x1ded('0x26')](handleEntityNotFound(_0x2318fc,null))[_0x1ded('0x26')](removeEntity(_0x2318fc,null))['catch'](handleError(_0x2318fc,null));};exports[_0x1ded('0x4c')]=function(_0x3f3928,_0x50f09a,_0x479731){var _0x141000={};var _0x23d074={};var _0x24381b;var _0x573569;return db[_0x1ded('0x41')][_0x1ded('0x4d')]({'where':{'id':_0x3f3928[_0x1ded('0x4b')]['id']}})[_0x1ded('0x26')](handleEntityNotFound(_0x50f09a,null))[_0x1ded('0x26')](function(_0x4f93f9){if(_0x4f93f9){_0x24381b=_0x4f93f9;_0x23d074[_0x1ded('0x30')]=_['keys'](db[_0x1ded('0x4e')][_0x1ded('0x2c')]);_0x23d074[_0x1ded('0x32')]=_[_0x1ded('0x31')](_0x3f3928[_0x1ded('0x32')]);_0x23d074[_0x1ded('0x33')]=_[_0x1ded('0x34')](_0x23d074[_0x1ded('0x30')],_0x23d074[_0x1ded('0x32')]);_0x141000['attributes']=_[_0x1ded('0x34')](_0x23d074['model'],qs[_0x1ded('0x36')](_0x3f3928[_0x1ded('0x32')][_0x1ded('0x36')]));_0x141000[_0x1ded('0x35')]=_0x141000[_0x1ded('0x35')]['length']?_0x141000[_0x1ded('0x35')]:_0x23d074[_0x1ded('0x30')];_0x141000[_0x1ded('0x3a')]=qs[_0x1ded('0x3b')](_0x3f3928[_0x1ded('0x32')]['sort']);_0x141000[_0x1ded('0x40')]=qs[_0x1ded('0x33')](_[_0x1ded('0x3c')](_0x3f3928[_0x1ded('0x32')],_0x23d074['filters']));if(_0x3f3928[_0x1ded('0x32')][_0x1ded('0x3d')]){_0x141000[_0x1ded('0x40')]=_['merge'](_0x141000[_0x1ded('0x40')],{'$or':_[_0x1ded('0x4f')](_0x141000[_0x1ded('0x35')],function(_0x590eff){var _0x3e661c={};_0x3e661c[_0x590eff]={'$like':'%'+_0x3f3928[_0x1ded('0x32')]['filter']+'%'};return _0x3e661c;})});}_0x141000=_['merge']({},_0x141000,_0x3f3928[_0x1ded('0x3f')]);return _0x24381b[_0x1ded('0x4c')](_0x141000);}})[_0x1ded('0x26')](function(_0x42b4d1){if(_0x42b4d1){_0x573569=_0x42b4d1[_0x1ded('0x37')];if(!_0x3f3928[_0x1ded('0x32')]['hasOwnProperty'](_0x1ded('0x39'))){_0x141000[_0x1ded('0x1f')]=qs[_0x1ded('0x1f')](_0x3f3928['query'][_0x1ded('0x1f')]);_0x141000['offset']=qs[_0x1ded('0x20')](_0x3f3928[_0x1ded('0x32')][_0x1ded('0x20')]);}return _0x24381b['getConfigurations'](_0x141000);}})[_0x1ded('0x26')](function(_0x63a294){if(_0x63a294){return _0x63a294?{'count':_0x573569,'rows':_0x63a294}:null;}})['then'](respondWithResult(_0x50f09a,null))['catch'](handleError(_0x50f09a,null));};exports['addConfiguration']=function(_0x139fd2,_0x24e64e,_0x23f8ab){if(_0x139fd2['body']['id']){delete _0x139fd2[_0x1ded('0x4a')]['id'];}return db[_0x1ded('0x41')][_0x1ded('0x4d')]({'where':{'id':_0x139fd2['params']['id']}})[_0x1ded('0x26')](handleEntityNotFound(_0x24e64e,null))[_0x1ded('0x26')](function(_0x3d3cf2){if(_0x3d3cf2){_0x139fd2[_0x1ded('0x4a')][_0x1ded('0x50')]=_0x3d3cf2['id'];_0x139fd2[_0x1ded('0x4a')][_0x1ded('0x51')]=integrations[_0x1ded('0x52')](_0x139fd2[_0x1ded('0x4a')][_0x1ded('0x53')],_0x139fd2[_0x1ded('0x4a')][_0x1ded('0x2e')]);_0x139fd2[_0x1ded('0x4a')][_0x1ded('0x54')]=integrations[_0x1ded('0x55')](_0x139fd2[_0x1ded('0x4a')]['channel'],_0x139fd2[_0x1ded('0x4a')][_0x1ded('0x2e')]);return db[_0x1ded('0x4e')][_0x1ded('0x49')](_0x139fd2[_0x1ded('0x4a')],{'include':[{'model':db[_0x1ded('0x56')],'as':_0x1ded('0x51')},{'model':db[_0x1ded('0x56')],'as':_0x1ded('0x54')}]});}return null;})[_0x1ded('0x26')](respondWithResult(_0x24e64e,null))[_0x1ded('0x45')](handleError(_0x24e64e,null));};exports['getFields']=function(_0x23a83e,_0xdec85f,_0x1e5d4a){var _0x5de328='';var _0x313cab='';return db[_0x1ded('0x41')][_0x1ded('0x4d')]({'where':{'id':_0x23a83e['params']['id']},'attributes':['id',_0x1ded('0x57'),'remoteUri',_0x1ded('0x58')]})[_0x1ded('0x26')](handleEntityNotFound(_0xdec85f,null))[_0x1ded('0x26')](function(_0x3c5529){if(_0x3c5529){_0x313cab=_0x3c5529[_0x1ded('0x57')];_0x5de328=_0x3c5529['remoteUri'];var _0x49cd74=_0x3c5529[_0x1ded('0x59')]['slice'](-0x1);if(_0x49cd74==='/'){_0x5de328=_0x5de328[_0x1ded('0x5a')](0x0,_0x5de328[_0x1ded('0x5b')](_0x49cd74));}return rp({'method':_0x1ded('0x5c'),'uri':util[_0x1ded('0x5d')](_0x1ded('0x5e'),_0x5de328,_0x1ded('0x5f')),'headers':{'Authorization':_0x1ded('0x60')+_0x3c5529[_0x1ded('0x58')]},'json':!![]});}})[_0x1ded('0x26')](function(_0x41289e){if(_0x41289e){var _0x46cd72=_0x41289e[_0x1ded('0x61')];var _0x2b11c4=![];var _0x3af4d1=null;for(_0x3af4d1=0x0;_0x3af4d1<_0x46cd72[_0x1ded('0x37')];_0x3af4d1++){if(_0x46cd72[_0x3af4d1]['email']===_0x313cab){_0x2b11c4=!![];}}if(_0x2b11c4){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1ded('0x62')});}}})[_0x1ded('0x26')](respondWithResult(_0xdec85f,null))[_0x1ded('0x45')](function(_0x5692e5){var _0x1cedd3=_0x23a83e[_0x1ded('0x32')][_0x1ded('0x63')]?0x1f4:_0x5692e5[_0x1ded('0x64')]||0x1f4;logger[_0x1ded('0x28')](_0x1ded('0x65'),_0x1ded('0x66'),_0x1cedd3,JSON['stringify'](_0x5692e5));delete _0x5692e5[_0x1ded('0x2a')];if(_0x1cedd3===0x191){_0x1cedd3=0x190;}_0xdec85f['status'](_0x1cedd3)[_0x1ded('0x2b')](_0x23a83e[_0x1ded('0x32')]['test']?{'message':_0x1ded('0x67'),'statusCode':_0x5692e5['statusCode']}:_0x5692e5);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 2a3133b..16afc77 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 _0x90b1=['define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x90b1,0x1bb));var _0x190b=function(_0x4a79fd,_0x429333){_0x4a79fd=_0x4a79fd-0x0;var _0xef2f88=_0x90b1[_0x4a79fd];return _0xef2f88;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x27ff8c,_0x34a689){return _0x27ff8c[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x3f3ac5,_0xcddf57){var _0x13a644=function(_0x44f888){while(--_0x44f888){_0x3f3ac5['push'](_0x3f3ac5['shift']());}};_0x13a644(++_0xcddf57);}(_0xba34,0x119));var _0x4ba3=function(_0x583d25,_0x5e3658){_0x583d25=_0x583d25-0x0;var _0x8248c7=_0xba34[_0x583d25];return _0x8248c7;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 26c168b..458aa75 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 _0x0120=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0120,0x6f));var _0x0012=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x0120[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['FreshsalesAccount'][_0x0012('0x17')]({'raw':_0x1d0423[_0x0012('0x18')]?_0x1d0423['options'][_0x0012('0x19')]===undefined?!![]:![]:!![],'where':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x1d0423['options']?_0x1d0423['options'][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1c')]||null:null,'include':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x1d0423['options'][_0x0012('0x1d')],function(_0x24a280){return{'model':db[_0x24a280['model']],'as':_0x24a280['as'],'attributes':_0x24a280[_0x0012('0x1b')],'include':_0x24a280[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x24a280[_0x0012('0x1d')],function(_0x42bcd7){return{'model':db[_0x42bcd7['model']],'as':_0x42bcd7['as'],'attributes':_0x42bcd7[_0x0012('0x1b')],'include':_0x42bcd7[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x42bcd7[_0x0012('0x1d')],function(_0x173cb3){return{'model':db[_0x173cb3[_0x0012('0x1f')]],'as':_0x173cb3['as'],'attributes':_0x173cb3[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0012('0x20')](function(_0x300e13){logger[_0x0012('0xd')](_0x0012('0x16'),_0x1d0423);logger[_0x0012('0x21')](_0x0012('0x16'),_0x1d0423,JSON[_0x0012('0x11')](_0x300e13));_0x1e78ee(_0x300e13);})[_0x0012('0x22')](function(_0x276389){logger[_0x0012('0x12')](_0x0012('0x16'),_0x276389[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1[_0x0012('0x12')](0x1f4,_0x276389[_0x0012('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x283134){var _0x1bb49b=this;return new Promise(function(_0x4c2601,_0x2fa6a2){return db[_0x0012('0x23')][_0x0012('0x24')]({'raw':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x283134['options']?_0x283134[_0x0012('0x18')][_0x0012('0x1b')]||null:null,'include':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x283134['options'][_0x0012('0x1d')],function(_0x30dfd8){return{'model':db[_0x30dfd8[_0x0012('0x1f')]],'as':_0x30dfd8['as'],'attributes':_0x30dfd8[_0x0012('0x1b')],'include':_0x30dfd8['include']?_['map'](_0x30dfd8[_0x0012('0x1d')],function(_0x30f8a2){return{'model':db[_0x30f8a2[_0x0012('0x1f')]],'as':_0x30f8a2['as'],'attributes':_0x30f8a2[_0x0012('0x1b')],'include':_0x30f8a2[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x30f8a2[_0x0012('0x1d')],function(_0x4f13b9){return{'model':db[_0x4f13b9[_0x0012('0x1f')]],'as':_0x4f13b9['as'],'attributes':_0x4f13b9[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196222){logger[_0x0012('0xd')](_0x0012('0x25'),_0x283134);logger[_0x0012('0x21')](_0x0012('0x25'),_0x283134,JSON[_0x0012('0x11')](_0x196222));_0x4c2601(_0x196222);})[_0x0012('0x22')](function(_0x4a4af8){logger[_0x0012('0x12')]('ShowFreshsalesAccount',_0x4a4af8[_0x0012('0x14')],_0x283134);_0x2fa6a2(_0x1bb49b['error'](0x1f4,_0x4a4af8['message']));});});}; \ No newline at end of file +var _0x524e=['http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshsalesAccount','catch','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x47d804,_0x5cc88f){var _0x284c47=function(_0x271c22){while(--_0x271c22){_0x47d804['push'](_0x47d804['shift']());}};_0x284c47(++_0x5cc88f);}(_0x524e,0x15e));var _0xe524=function(_0x40aef4,_0x529a72){_0x40aef4=_0x40aef4-0x0;var _0x24e66a=_0x524e[_0x40aef4];return _0x24e66a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['GetFreshsalesAccount']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')]({'raw':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]===undefined?!![]:![]:!![],'where':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1c')]||null:null,'include':_0x3a4027[_0xe524('0x18')]?_0x3a4027['options'][_0xe524('0x1d')]?_['map'](_0x3a4027['options'][_0xe524('0x1d')],function(_0x23df5e){return{'model':db[_0x23df5e[_0xe524('0x1e')]],'as':_0x23df5e['as'],'attributes':_0x23df5e[_0xe524('0x1b')],'include':_0x23df5e['include']?_[_0xe524('0x1f')](_0x23df5e['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x1e')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1b')],'include':_0x17e245[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x17e245[_0xe524('0x1d')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x45abad){logger[_0xe524('0xd')](_0xe524('0x20'),_0x3a4027);logger[_0xe524('0x10')]('GetFreshsalesAccount',_0x3a4027,JSON['stringify'](_0x45abad));_0x11b2a1(_0x45abad);})[_0xe524('0x21')](function(_0x25e7a7){logger[_0xe524('0x13')](_0xe524('0x20'),_0x25e7a7[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x25e7a7[_0xe524('0x15')]));});});};exports[_0xe524('0x22')]=function(_0x4a4e15){var _0x5b7ded=this;return new Promise(function(_0x20688e,_0x376324){return db['FreshsalesAccount'][_0xe524('0x23')]({'raw':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['attributes']||null:null,'include':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')]?_['map'](_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')],function(_0x49c43e){return{'model':db[_0x49c43e[_0xe524('0x1e')]],'as':_0x49c43e['as'],'attributes':_0x49c43e[_0xe524('0x1b')],'include':_0x49c43e[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x49c43e['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x1e')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1b')],'include':_0x415450[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x415450[_0xe524('0x1d')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x1e')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x56f371){logger[_0xe524('0xd')](_0xe524('0x22'),_0x4a4e15);logger['debug'](_0xe524('0x22'),_0x4a4e15,JSON['stringify'](_0x56f371));_0x20688e(_0x56f371);})[_0xe524('0x21')](function(_0x41af26){logger[_0xe524('0x13')](_0xe524('0x22'),_0x41af26[_0xe524('0x15')],_0x4a4e15);_0x376324(_0x5b7ded[_0xe524('0x13')](0x1f4,_0x41af26[_0xe524('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 17901ad..f94d39f 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 _0x3a65=['getFields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','get','/:id/fields'];(function(_0x3653d4,_0x2c5608){var _0x25baad=function(_0x4317fd){while(--_0x4317fd){_0x3653d4['push'](_0x3653d4['shift']());}};_0x25baad(++_0x2c5608);}(_0x3a65,0x130));var _0x53a6=function(_0x3a4826,_0x4935fe){_0x3a4826=_0x3a4826-0x0;var _0x505f2c=_0x3a65[_0x3a4826];return _0x505f2c;};'use strict';var multer=require(_0x53a6('0x0'));var util=require(_0x53a6('0x1'));var path=require(_0x53a6('0x2'));var timeout=require(_0x53a6('0x3'));var express=require(_0x53a6('0x4'));var router=express[_0x53a6('0x5')]();var fs_extra=require(_0x53a6('0x6'));var auth=require(_0x53a6('0x7'));var interaction=require(_0x53a6('0x8'));var config=require(_0x53a6('0x9'));var controller=require(_0x53a6('0xa'));router['get']('/',auth[_0x53a6('0xb')](),controller[_0x53a6('0xc')]);router['get'](_0x53a6('0xd'),auth[_0x53a6('0xb')](),controller[_0x53a6('0xe')]);router['get'](_0x53a6('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x53a6('0x10'),auth[_0x53a6('0xb')](),controller[_0x53a6('0x11')]);router[_0x53a6('0x12')](_0x53a6('0x13'),auth[_0x53a6('0xb')](),controller[_0x53a6('0x14')]);router[_0x53a6('0x15')]('/',auth[_0x53a6('0xb')](),controller['create']);router[_0x53a6('0x16')](_0x53a6('0xd'),auth['isAuthenticated'](),controller[_0x53a6('0x17')]);router[_0x53a6('0x18')](_0x53a6('0xd'),auth[_0x53a6('0xb')](),controller[_0x53a6('0x19')]);module[_0x53a6('0x1a')]=router; \ No newline at end of file +var _0x1cbf=['getFields','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions'];(function(_0x2e310d,_0x174243){var _0x1cd361=function(_0x27dbd5){while(--_0x27dbd5){_0x2e310d['push'](_0x2e310d['shift']());}};_0x1cd361(++_0x174243);}(_0x1cbf,0x89));var _0xf1cb=function(_0x5370b0,_0x328e3b){_0x5370b0=_0x5370b0-0x0;var _0x431856=_0x1cbf[_0x5370b0];return _0x431856;};'use strict';var multer=require(_0xf1cb('0x0'));var util=require(_0xf1cb('0x1'));var path=require(_0xf1cb('0x2'));var timeout=require(_0xf1cb('0x3'));var express=require(_0xf1cb('0x4'));var router=express[_0xf1cb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf1cb('0x6'));var config=require(_0xf1cb('0x7'));var controller=require(_0xf1cb('0x8'));router[_0xf1cb('0x9')]('/',auth[_0xf1cb('0xa')](),controller[_0xf1cb('0xb')]);router[_0xf1cb('0x9')](_0xf1cb('0xc'),auth[_0xf1cb('0xa')](),controller['show']);router[_0xf1cb('0x9')](_0xf1cb('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf1cb('0x9')](_0xf1cb('0xe'),auth[_0xf1cb('0xa')](),controller['getDescriptions']);router[_0xf1cb('0x9')]('/:id/fields',auth[_0xf1cb('0xa')](),controller[_0xf1cb('0xf')]);router['post']('/',auth[_0xf1cb('0xa')](),controller['create']);router[_0xf1cb('0x10')](_0xf1cb('0xc'),auth[_0xf1cb('0xa')](),controller['update']);router['delete'](_0xf1cb('0xc'),auth['isAuthenticated'](),controller[_0xf1cb('0x11')]);module[_0xf1cb('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 6fe01d4..208956c 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 _0x3e72=['sequelize','exports','STRING'];(function(_0x25996a,_0x413c84){var _0x2ace17=function(_0x512863){while(--_0x512863){_0x25996a['push'](_0x25996a['shift']());}};_0x2ace17(++_0x413c84);}(_0x3e72,0x1a7));var _0x23e7=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x3e72[_0x5c2a2b];return _0x19921f;};'use strict';var Sequelize=require(_0x23e7('0x0'));module[_0x23e7('0x1')]={'name':{'type':Sequelize[_0x23e7('0x2')]},'description':{'type':Sequelize[_0x23e7('0x2')]}}; \ No newline at end of file +var _0x6526=['exports','STRING','sequelize'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x6526,0x17f));var _0x6652=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x6526[_0x313df3];return _0x241d59;};'use strict';var Sequelize=require(_0x6652('0x0'));module[_0x6652('0x1')]={'name':{'type':Sequelize[_0x6652('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index fc6bb2c..a2fb181 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 _0xcc27=['nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0xcc27,0x18e));var _0x7cc2=function(_0x5afa1b,_0x538fc2){_0x5afa1b=_0x5afa1b-0x0;var _0x14361b=_0xcc27[_0x5afa1b];return _0x14361b;};'use strict';var emlformat=require(_0x7cc2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7cc2('0x1'));var jsonpatch=require(_0x7cc2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7cc2('0x3'));var sox=require(_0x7cc2('0x4'));var csv=require(_0x7cc2('0x5'));var ejs=require(_0x7cc2('0x6'));var fs=require('fs');var fs_extra=require(_0x7cc2('0x7'));var _=require(_0x7cc2('0x8'));var squel=require(_0x7cc2('0x9'));var crypto=require(_0x7cc2('0xa'));var jsforce=require(_0x7cc2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7cc2('0x5'));var querystring=require('querystring');var Papa=require(_0x7cc2('0xc'));var Redis=require(_0x7cc2('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7cc2('0xe'));var hardwareService=require(_0x7cc2('0xf'));var logger=require(_0x7cc2('0x10'))(_0x7cc2('0x11'));var utils=require('../../config/utils');var config=require(_0x7cc2('0x12'));var licenseUtil=require(_0x7cc2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b2928,_0x216dc3){_0x216dc3=_0x216dc3||0xcc;return function(_0x4068fe){if(_0x4068fe){return _0x5b2928[_0x7cc2('0x14')](_0x216dc3);}return _0x5b2928[_0x7cc2('0x15')](_0x216dc3)[_0x7cc2('0x16')]();};}function respondWithResult(_0x4105e6,_0x3e50c5){_0x3e50c5=_0x3e50c5||0xc8;return function(_0x3b4abe){if(_0x3b4abe){return _0x4105e6[_0x7cc2('0x15')](_0x3e50c5)[_0x7cc2('0x17')](_0x3b4abe);}};}function respondWithFilteredResult(_0x455fea,_0x1ed491){return function(_0x44d6b0){if(_0x44d6b0){var _0x4fb8a4=typeof _0x1ed491[_0x7cc2('0x18')]===_0x7cc2('0x19')&&typeof _0x1ed491[_0x7cc2('0x1a')]===_0x7cc2('0x19');var _0x5c4e8c=_0x44d6b0[_0x7cc2('0x1b')];var _0x4fd014=_0x4fb8a4?0x0:_0x1ed491[_0x7cc2('0x18')];var _0x1cea89=_0x4fb8a4?_0x44d6b0['count']:_0x1ed491[_0x7cc2('0x18')]+_0x1ed491['limit'];var _0x3523db;if(_0x1cea89>=_0x5c4e8c){_0x1cea89=_0x5c4e8c;_0x3523db=0xc8;}else{_0x3523db=0xce;}_0x455fea[_0x7cc2('0x15')](_0x3523db);return _0x455fea[_0x7cc2('0x1c')](_0x7cc2('0x1d'),_0x4fd014+'-'+_0x1cea89+'/'+_0x5c4e8c)[_0x7cc2('0x17')](_0x44d6b0);}return null;};}function patchUpdates(_0x1a1fe6){return function(_0x405c9d){try{jsonpatch[_0x7cc2('0x1e')](_0x405c9d,_0x1a1fe6,!![]);}catch(_0x5a9aa9){return BPromise[_0x7cc2('0x1f')](_0x5a9aa9);}return _0x405c9d[_0x7cc2('0x20')]();};}function saveUpdates(_0x1c0b6e,_0x1ab690){return function(_0x5b6eef){if(_0x5b6eef){return _0x5b6eef[_0x7cc2('0x21')](_0x1c0b6e)[_0x7cc2('0x22')](function(_0x388fe7){return _0x388fe7;});}return null;};}function removeEntity(_0x562731,_0x14c0ff){return function(_0x1f1f9b){if(_0x1f1f9b){return _0x1f1f9b[_0x7cc2('0x23')]()['then'](function(){_0x562731['status'](0xcc)[_0x7cc2('0x16')]();});}};}function handleEntityNotFound(_0xcb83eb,_0x78261f){return function(_0x3653b1){if(!_0x3653b1){_0xcb83eb[_0x7cc2('0x14')](0x194);}return _0x3653b1;};}function handleError(_0x1bade0,_0x55e506){_0x55e506=_0x55e506||0x1f4;return function(_0x244e9b){logger[_0x7cc2('0x24')](_0x244e9b['stack']);if(_0x244e9b[_0x7cc2('0x25')]){delete _0x244e9b['name'];}_0x1bade0[_0x7cc2('0x15')](_0x55e506)[_0x7cc2('0x26')](_0x244e9b);};}exports[_0x7cc2('0x27')]=function(_0x43e850,_0x139fcb){var _0x2de666={},_0x1ea659={},_0x25f2ce={'count':0x0,'rows':[]};var _0x305ba1=_[_0x7cc2('0x28')](db[_0x7cc2('0x29')][_0x7cc2('0x2a')],function(_0x47c46b){return{'name':_0x47c46b['fieldName'],'type':_0x47c46b[_0x7cc2('0x2b')]['key']};});_0x1ea659['model']=_[_0x7cc2('0x28')](_0x305ba1,_0x7cc2('0x25'));_0x1ea659[_0x7cc2('0x2c')]=_['keys'](_0x43e850[_0x7cc2('0x2c')]);_0x1ea659[_0x7cc2('0x2d')]=_[_0x7cc2('0x2e')](_0x1ea659[_0x7cc2('0x2f')],_0x1ea659[_0x7cc2('0x2c')]);_0x2de666[_0x7cc2('0x30')]=_[_0x7cc2('0x2e')](_0x1ea659['model'],qs[_0x7cc2('0x31')](_0x43e850[_0x7cc2('0x2c')][_0x7cc2('0x31')]));_0x2de666[_0x7cc2('0x30')]=_0x2de666[_0x7cc2('0x30')][_0x7cc2('0x32')]?_0x2de666[_0x7cc2('0x30')]:_0x1ea659['model'];if(!_0x43e850['query'][_0x7cc2('0x33')](_0x7cc2('0x34'))){_0x2de666[_0x7cc2('0x1a')]=qs[_0x7cc2('0x1a')](_0x43e850['query']['limit']);_0x2de666[_0x7cc2('0x18')]=qs['offset'](_0x43e850[_0x7cc2('0x2c')][_0x7cc2('0x18')]);}_0x2de666[_0x7cc2('0x35')]=qs[_0x7cc2('0x36')](_0x43e850['query'][_0x7cc2('0x36')]);_0x2de666['where']=qs[_0x7cc2('0x2d')](_[_0x7cc2('0x37')](_0x43e850['query'],_0x1ea659['filters']),_0x305ba1);if(_0x43e850[_0x7cc2('0x2c')][_0x7cc2('0x38')]){_0x2de666[_0x7cc2('0x39')]=_[_0x7cc2('0x3a')](_0x2de666[_0x7cc2('0x39')],{'$or':_[_0x7cc2('0x28')](_0x305ba1,function(_0x576baf){if(_0x576baf[_0x7cc2('0x2b')]!=='VIRTUAL'){var _0x36781a={};_0x36781a[_0x576baf[_0x7cc2('0x25')]]={'$like':'%'+_0x43e850[_0x7cc2('0x2c')]['filter']+'%'};return _0x36781a;}})});}_0x2de666=_[_0x7cc2('0x3a')]({},_0x2de666,_0x43e850[_0x7cc2('0x3b')]);var _0x46b43a={'where':_0x2de666[_0x7cc2('0x39')]};return db[_0x7cc2('0x29')][_0x7cc2('0x1b')](_0x46b43a)[_0x7cc2('0x22')](function(_0x2ef927){_0x25f2ce[_0x7cc2('0x1b')]=_0x2ef927;if(_0x43e850['query'][_0x7cc2('0x3c')]){_0x2de666[_0x7cc2('0x3d')]=[{'all':!![]}];}return db[_0x7cc2('0x29')][_0x7cc2('0x3e')](_0x2de666);})[_0x7cc2('0x22')](function(_0x2fb296){_0x25f2ce[_0x7cc2('0x3f')]=_0x2fb296;return _0x25f2ce;})['then'](respondWithFilteredResult(_0x139fcb,_0x2de666))['catch'](handleError(_0x139fcb,null));};exports['show']=function(_0x5cf8d8,_0x320092){var _0x339052={'raw':![],'where':{'id':_0x5cf8d8[_0x7cc2('0x40')]['id']}},_0x178fd6={};_0x178fd6['model']=_[_0x7cc2('0x41')](db[_0x7cc2('0x29')][_0x7cc2('0x2a')]);_0x178fd6[_0x7cc2('0x2c')]=_['keys'](_0x5cf8d8[_0x7cc2('0x2c')]);_0x178fd6[_0x7cc2('0x2d')]=_[_0x7cc2('0x2e')](_0x178fd6[_0x7cc2('0x2f')],_0x178fd6[_0x7cc2('0x2c')]);_0x339052[_0x7cc2('0x30')]=_[_0x7cc2('0x2e')](_0x178fd6['model'],qs[_0x7cc2('0x31')](_0x5cf8d8[_0x7cc2('0x2c')][_0x7cc2('0x31')]));_0x339052[_0x7cc2('0x30')]=_0x339052[_0x7cc2('0x30')][_0x7cc2('0x32')]?_0x339052[_0x7cc2('0x30')]:_0x178fd6[_0x7cc2('0x2f')];if(_0x5cf8d8['query'][_0x7cc2('0x3c')]){_0x339052[_0x7cc2('0x3d')]=[{'all':!![]}];}_0x339052=_[_0x7cc2('0x3a')]({},_0x339052,_0x5cf8d8['options']);return db[_0x7cc2('0x29')][_0x7cc2('0x42')](_0x339052)[_0x7cc2('0x22')](handleEntityNotFound(_0x320092,null))[_0x7cc2('0x22')](respondWithResult(_0x320092,null))[_0x7cc2('0x43')](handleError(_0x320092,null));};exports[_0x7cc2('0x44')]=function(_0xebe161,_0x168294){return db['FreshsalesConfiguration'][_0x7cc2('0x44')](_0xebe161[_0x7cc2('0x45')],{})[_0x7cc2('0x22')](respondWithResult(_0x168294,0xc9))[_0x7cc2('0x43')](handleError(_0x168294,null));};exports[_0x7cc2('0x21')]=function(_0x50b3c1,_0x25e653){if(_0x50b3c1[_0x7cc2('0x45')]['id']){delete _0x50b3c1[_0x7cc2('0x45')]['id'];}return db['FreshsalesConfiguration'][_0x7cc2('0x42')]({'where':{'id':_0x50b3c1[_0x7cc2('0x40')]['id']}})['then'](handleEntityNotFound(_0x25e653,null))[_0x7cc2('0x22')](saveUpdates(_0x50b3c1[_0x7cc2('0x45')],null))['then'](respondWithResult(_0x25e653,null))[_0x7cc2('0x43')](handleError(_0x25e653,null));};exports[_0x7cc2('0x23')]=function(_0xcb3bd8,_0x172ac7){return db[_0x7cc2('0x29')][_0x7cc2('0x42')]({'where':{'id':_0xcb3bd8[_0x7cc2('0x40')]['id']}})[_0x7cc2('0x22')](handleEntityNotFound(_0x172ac7,null))[_0x7cc2('0x22')](removeEntity(_0x172ac7,null))['catch'](handleError(_0x172ac7,null));};exports[_0x7cc2('0x46')]=function(_0x35147f,_0x183f07,_0x50ef31){var _0x95a9a={};var _0x40c8b3={};var _0x293023;var _0x51913f;return db[_0x7cc2('0x29')][_0x7cc2('0x47')]({'where':{'id':_0x35147f['params']['id']}})[_0x7cc2('0x22')](handleEntityNotFound(_0x183f07,null))[_0x7cc2('0x22')](function(_0x408783){if(_0x408783){_0x293023=_0x408783;_0x40c8b3[_0x7cc2('0x2f')]=_[_0x7cc2('0x41')](db[_0x7cc2('0x48')][_0x7cc2('0x2a')]);_0x40c8b3[_0x7cc2('0x2c')]=_[_0x7cc2('0x41')](_0x35147f[_0x7cc2('0x2c')]);_0x40c8b3[_0x7cc2('0x2d')]=_[_0x7cc2('0x2e')](_0x40c8b3[_0x7cc2('0x2f')],_0x40c8b3['query']);_0x95a9a[_0x7cc2('0x30')]=_['intersection'](_0x40c8b3[_0x7cc2('0x2f')],qs[_0x7cc2('0x31')](_0x35147f[_0x7cc2('0x2c')][_0x7cc2('0x31')]));_0x95a9a[_0x7cc2('0x30')]=_0x95a9a[_0x7cc2('0x30')][_0x7cc2('0x32')]?_0x95a9a[_0x7cc2('0x30')]:_0x40c8b3[_0x7cc2('0x2f')];_0x95a9a[_0x7cc2('0x35')]=qs[_0x7cc2('0x36')](_0x35147f[_0x7cc2('0x2c')][_0x7cc2('0x36')]);_0x95a9a[_0x7cc2('0x39')]=qs[_0x7cc2('0x2d')](_[_0x7cc2('0x37')](_0x35147f[_0x7cc2('0x2c')],_0x40c8b3[_0x7cc2('0x2d')]));if(_0x35147f[_0x7cc2('0x2c')][_0x7cc2('0x38')]){_0x95a9a['where']=_[_0x7cc2('0x3a')](_0x95a9a[_0x7cc2('0x39')],{'$or':_[_0x7cc2('0x28')](_0x95a9a['attributes'],function(_0x4423ad){var _0x4fe7a4={};_0x4fe7a4[_0x4423ad]={'$like':'%'+_0x35147f[_0x7cc2('0x2c')][_0x7cc2('0x38')]+'%'};return _0x4fe7a4;})});}_0x95a9a=_[_0x7cc2('0x3a')]({},_0x95a9a,_0x35147f['options']);return _0x293023[_0x7cc2('0x46')](_0x95a9a);}})[_0x7cc2('0x22')](function(_0x1376d6){if(_0x1376d6){_0x51913f=_0x1376d6['length'];if(!_0x35147f[_0x7cc2('0x2c')]['hasOwnProperty']('nolimit')){_0x95a9a[_0x7cc2('0x1a')]=qs[_0x7cc2('0x1a')](_0x35147f['query'][_0x7cc2('0x1a')]);_0x95a9a[_0x7cc2('0x18')]=qs[_0x7cc2('0x18')](_0x35147f['query']['offset']);}return _0x293023['getSubjects'](_0x95a9a);}})[_0x7cc2('0x22')](function(_0x43de54){if(_0x43de54){return _0x43de54?{'count':_0x51913f,'rows':_0x43de54}:null;}})['then'](respondWithResult(_0x183f07,null))[_0x7cc2('0x43')](handleError(_0x183f07,null));};exports[_0x7cc2('0x49')]=function(_0x7819a9,_0x554e92,_0x4ea620){var _0x383e3a={};var _0x489a03={};var _0x50312f;var _0x21cead;return db[_0x7cc2('0x29')][_0x7cc2('0x47')]({'where':{'id':_0x7819a9[_0x7cc2('0x40')]['id']}})[_0x7cc2('0x22')](handleEntityNotFound(_0x554e92,null))[_0x7cc2('0x22')](function(_0x25ecc1){if(_0x25ecc1){_0x50312f=_0x25ecc1;_0x489a03[_0x7cc2('0x2f')]=_[_0x7cc2('0x41')](db[_0x7cc2('0x48')]['rawAttributes']);_0x489a03[_0x7cc2('0x2c')]=_['keys'](_0x7819a9[_0x7cc2('0x2c')]);_0x489a03[_0x7cc2('0x2d')]=_[_0x7cc2('0x2e')](_0x489a03[_0x7cc2('0x2f')],_0x489a03[_0x7cc2('0x2c')]);_0x383e3a['attributes']=_[_0x7cc2('0x2e')](_0x489a03['model'],qs[_0x7cc2('0x31')](_0x7819a9[_0x7cc2('0x2c')][_0x7cc2('0x31')]));_0x383e3a[_0x7cc2('0x30')]=_0x383e3a['attributes'][_0x7cc2('0x32')]?_0x383e3a[_0x7cc2('0x30')]:_0x489a03[_0x7cc2('0x2f')];_0x383e3a[_0x7cc2('0x35')]=qs[_0x7cc2('0x36')](_0x7819a9[_0x7cc2('0x2c')][_0x7cc2('0x36')]);_0x383e3a[_0x7cc2('0x39')]=qs[_0x7cc2('0x2d')](_[_0x7cc2('0x37')](_0x7819a9[_0x7cc2('0x2c')],_0x489a03[_0x7cc2('0x2d')]));if(_0x7819a9[_0x7cc2('0x2c')][_0x7cc2('0x38')]){_0x383e3a[_0x7cc2('0x39')]=_[_0x7cc2('0x3a')](_0x383e3a[_0x7cc2('0x39')],{'$or':_[_0x7cc2('0x28')](_0x383e3a['attributes'],function(_0x10c455){var _0x546215={};_0x546215[_0x10c455]={'$like':'%'+_0x7819a9[_0x7cc2('0x2c')]['filter']+'%'};return _0x546215;})});}_0x383e3a=_[_0x7cc2('0x3a')]({},_0x383e3a,_0x7819a9[_0x7cc2('0x3b')]);return _0x50312f['getDescriptions'](_0x383e3a);}})[_0x7cc2('0x22')](function(_0xf2bca2){if(_0xf2bca2){_0x21cead=_0xf2bca2['length'];if(!_0x7819a9[_0x7cc2('0x2c')][_0x7cc2('0x33')](_0x7cc2('0x34'))){_0x383e3a[_0x7cc2('0x1a')]=qs[_0x7cc2('0x1a')](_0x7819a9[_0x7cc2('0x2c')][_0x7cc2('0x1a')]);_0x383e3a[_0x7cc2('0x18')]=qs['offset'](_0x7819a9[_0x7cc2('0x2c')][_0x7cc2('0x18')]);}return _0x50312f[_0x7cc2('0x49')](_0x383e3a);}})[_0x7cc2('0x22')](function(_0x1e29d6){if(_0x1e29d6){return _0x1e29d6?{'count':_0x21cead,'rows':_0x1e29d6}:null;}})[_0x7cc2('0x22')](respondWithResult(_0x554e92,null))['catch'](handleError(_0x554e92,null));};exports[_0x7cc2('0x4a')]=function(_0x143855,_0x597b9d,_0x43c1b5){var _0x35fedd={};var _0x2fc7fe={};var _0x1f9f09;var _0x111434;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x143855[_0x7cc2('0x40')]['id']}})[_0x7cc2('0x22')](handleEntityNotFound(_0x597b9d,null))[_0x7cc2('0x22')](function(_0x3dadcd){if(_0x3dadcd){_0x1f9f09=_0x3dadcd;_0x2fc7fe[_0x7cc2('0x2f')]=_[_0x7cc2('0x41')](db[_0x7cc2('0x48')]['rawAttributes']);_0x2fc7fe[_0x7cc2('0x2c')]=_['keys'](_0x143855[_0x7cc2('0x2c')]);_0x2fc7fe[_0x7cc2('0x2d')]=_['intersection'](_0x2fc7fe['model'],_0x2fc7fe[_0x7cc2('0x2c')]);_0x35fedd[_0x7cc2('0x30')]=_['intersection'](_0x2fc7fe[_0x7cc2('0x2f')],qs[_0x7cc2('0x31')](_0x143855['query'][_0x7cc2('0x31')]));_0x35fedd[_0x7cc2('0x30')]=_0x35fedd[_0x7cc2('0x30')][_0x7cc2('0x32')]?_0x35fedd[_0x7cc2('0x30')]:_0x2fc7fe[_0x7cc2('0x2f')];_0x35fedd[_0x7cc2('0x35')]=qs['sort'](_0x143855[_0x7cc2('0x2c')][_0x7cc2('0x36')]);_0x35fedd['where']=qs[_0x7cc2('0x2d')](_[_0x7cc2('0x37')](_0x143855[_0x7cc2('0x2c')],_0x2fc7fe['filters']));if(_0x143855[_0x7cc2('0x2c')][_0x7cc2('0x38')]){_0x35fedd[_0x7cc2('0x39')]=_[_0x7cc2('0x3a')](_0x35fedd[_0x7cc2('0x39')],{'$or':_[_0x7cc2('0x28')](_0x35fedd[_0x7cc2('0x30')],function(_0x56234d){var _0x1fc2da={};_0x1fc2da[_0x56234d]={'$like':'%'+_0x143855[_0x7cc2('0x2c')][_0x7cc2('0x38')]+'%'};return _0x1fc2da;})});}_0x35fedd=_['merge']({},_0x35fedd,_0x143855[_0x7cc2('0x3b')]);return _0x1f9f09[_0x7cc2('0x4a')](_0x35fedd);}})[_0x7cc2('0x22')](function(_0x5a795e){if(_0x5a795e){_0x111434=_0x5a795e[_0x7cc2('0x32')];if(!_0x143855['query']['hasOwnProperty']('nolimit')){_0x35fedd[_0x7cc2('0x1a')]=qs[_0x7cc2('0x1a')](_0x143855[_0x7cc2('0x2c')][_0x7cc2('0x1a')]);_0x35fedd[_0x7cc2('0x18')]=qs['offset'](_0x143855['query'][_0x7cc2('0x18')]);}return _0x1f9f09[_0x7cc2('0x4a')](_0x35fedd);}})['then'](function(_0x3cc3dd){if(_0x3cc3dd){return _0x3cc3dd?{'count':_0x111434,'rows':_0x3cc3dd}:null;}})[_0x7cc2('0x22')](respondWithResult(_0x597b9d,null))[_0x7cc2('0x43')](handleError(_0x597b9d,null));}; \ No newline at end of file +var _0xece2=['order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','count','includeAll','include','findAll','catch','show','params','length','find','create','body','keys','getSubjects','getDescriptions','findOne','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xece2,0xf8));var _0x2ece=function(_0x59ca41,_0x5d5888){_0x59ca41=_0x59ca41-0x0;var _0x5031b5=_0xece2[_0x59ca41];return _0x5031b5;};'use strict';var emlformat=require(_0x2ece('0x0'));var rimraf=require(_0x2ece('0x1'));var zipdir=require(_0x2ece('0x2'));var jsonpatch=require(_0x2ece('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2ece('0x4'));var Mustache=require('mustache');var util=require(_0x2ece('0x5'));var path=require(_0x2ece('0x6'));var sox=require('sox');var csv=require(_0x2ece('0x7'));var ejs=require(_0x2ece('0x8'));var fs=require('fs');var fs_extra=require(_0x2ece('0x9'));var _=require(_0x2ece('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2ece('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2ece('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2ece('0xc'));var as=require(_0x2ece('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ece('0xe'))('api');var utils=require(_0x2ece('0xf'));var config=require(_0x2ece('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ece('0x11'))['db'];function respondWithStatusCode(_0x51f29f,_0x1f00da){_0x1f00da=_0x1f00da||0xcc;return function(_0x4290fc){if(_0x4290fc){return _0x51f29f['sendStatus'](_0x1f00da);}return _0x51f29f[_0x2ece('0x12')](_0x1f00da)[_0x2ece('0x13')]();};}function respondWithResult(_0x5f0725,_0x14e109){_0x14e109=_0x14e109||0xc8;return function(_0x67f16a){if(_0x67f16a){return _0x5f0725[_0x2ece('0x12')](_0x14e109)[_0x2ece('0x14')](_0x67f16a);}};}function respondWithFilteredResult(_0x10033e,_0x105a4b){return function(_0x29dcca){if(_0x29dcca){var _0x1d8930=typeof _0x105a4b[_0x2ece('0x15')]===_0x2ece('0x16')&&typeof _0x105a4b[_0x2ece('0x17')]===_0x2ece('0x16');var _0x463446=_0x29dcca['count'];var _0x2bdcb2=_0x1d8930?0x0:_0x105a4b[_0x2ece('0x15')];var _0x41951a=_0x1d8930?_0x29dcca['count']:_0x105a4b[_0x2ece('0x15')]+_0x105a4b[_0x2ece('0x17')];var _0x50dad5;if(_0x41951a>=_0x463446){_0x41951a=_0x463446;_0x50dad5=0xc8;}else{_0x50dad5=0xce;}_0x10033e[_0x2ece('0x12')](_0x50dad5);return _0x10033e[_0x2ece('0x18')]('Content-Range',_0x2bdcb2+'-'+_0x41951a+'/'+_0x463446)['json'](_0x29dcca);}return null;};}function patchUpdates(_0x2c5191){return function(_0x2d614f){try{jsonpatch[_0x2ece('0x19')](_0x2d614f,_0x2c5191,!![]);}catch(_0x245ca7){return BPromise[_0x2ece('0x1a')](_0x245ca7);}return _0x2d614f[_0x2ece('0x1b')]();};}function saveUpdates(_0x5074b7,_0x4965bf){return function(_0x2d11cb){if(_0x2d11cb){return _0x2d11cb[_0x2ece('0x1c')](_0x5074b7)[_0x2ece('0x1d')](function(_0x4de48e){return _0x4de48e;});}return null;};}function removeEntity(_0x1846d4,_0x1c06d8){return function(_0x432ee8){if(_0x432ee8){return _0x432ee8[_0x2ece('0x1e')]()[_0x2ece('0x1d')](function(){_0x1846d4['status'](0xcc)[_0x2ece('0x13')]();});}};}function handleEntityNotFound(_0x116acd,_0x151b0f){return function(_0x2d43dc){if(!_0x2d43dc){_0x116acd['sendStatus'](0x194);}return _0x2d43dc;};}function handleError(_0x5491a4,_0x2b39cf){_0x2b39cf=_0x2b39cf||0x1f4;return function(_0x2bbc07){logger[_0x2ece('0x1f')](_0x2bbc07[_0x2ece('0x20')]);if(_0x2bbc07['name']){delete _0x2bbc07[_0x2ece('0x21')];}_0x5491a4[_0x2ece('0x12')](_0x2b39cf)['send'](_0x2bbc07);};}exports[_0x2ece('0x22')]=function(_0xbfbdd1,_0x9f764b){var _0x14e519={},_0x40f9f2={},_0x2525a8={'count':0x0,'rows':[]};var _0x2fce7f=_[_0x2ece('0x23')](db['FreshsalesConfiguration'][_0x2ece('0x24')],function(_0x11185c){return{'name':_0x11185c[_0x2ece('0x25')],'type':_0x11185c[_0x2ece('0x26')][_0x2ece('0x27')]};});_0x40f9f2['model']=_['map'](_0x2fce7f,_0x2ece('0x21'));_0x40f9f2[_0x2ece('0x28')]=_['keys'](_0xbfbdd1[_0x2ece('0x28')]);_0x40f9f2[_0x2ece('0x29')]=_['intersection'](_0x40f9f2[_0x2ece('0x2a')],_0x40f9f2[_0x2ece('0x28')]);_0x14e519[_0x2ece('0x2b')]=_[_0x2ece('0x2c')](_0x40f9f2[_0x2ece('0x2a')],qs['fields'](_0xbfbdd1[_0x2ece('0x28')][_0x2ece('0x2d')]));_0x14e519[_0x2ece('0x2b')]=_0x14e519[_0x2ece('0x2b')]['length']?_0x14e519[_0x2ece('0x2b')]:_0x40f9f2['model'];if(!_0xbfbdd1[_0x2ece('0x28')][_0x2ece('0x2e')](_0x2ece('0x2f'))){_0x14e519['limit']=qs[_0x2ece('0x17')](_0xbfbdd1['query'][_0x2ece('0x17')]);_0x14e519[_0x2ece('0x15')]=qs['offset'](_0xbfbdd1[_0x2ece('0x28')][_0x2ece('0x15')]);}_0x14e519[_0x2ece('0x30')]=qs[_0x2ece('0x31')](_0xbfbdd1[_0x2ece('0x28')][_0x2ece('0x31')]);_0x14e519[_0x2ece('0x32')]=qs[_0x2ece('0x29')](_[_0x2ece('0x33')](_0xbfbdd1[_0x2ece('0x28')],_0x40f9f2[_0x2ece('0x29')]),_0x2fce7f);if(_0xbfbdd1['query'][_0x2ece('0x34')]){_0x14e519[_0x2ece('0x32')]=_[_0x2ece('0x35')](_0x14e519[_0x2ece('0x32')],{'$or':_[_0x2ece('0x23')](_0x2fce7f,function(_0x1ded60){if(_0x1ded60['type']!==_0x2ece('0x36')){var _0x3cd2cf={};_0x3cd2cf[_0x1ded60['name']]={'$like':'%'+_0xbfbdd1['query'][_0x2ece('0x34')]+'%'};return _0x3cd2cf;}})});}_0x14e519=_[_0x2ece('0x35')]({},_0x14e519,_0xbfbdd1[_0x2ece('0x37')]);var _0x48436f={'where':_0x14e519[_0x2ece('0x32')]};return db[_0x2ece('0x38')][_0x2ece('0x39')](_0x48436f)[_0x2ece('0x1d')](function(_0x491e5a){_0x2525a8['count']=_0x491e5a;if(_0xbfbdd1[_0x2ece('0x28')][_0x2ece('0x3a')]){_0x14e519[_0x2ece('0x3b')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x2ece('0x3c')](_0x14e519);})[_0x2ece('0x1d')](function(_0x180ddf){_0x2525a8['rows']=_0x180ddf;return _0x2525a8;})[_0x2ece('0x1d')](respondWithFilteredResult(_0x9f764b,_0x14e519))[_0x2ece('0x3d')](handleError(_0x9f764b,null));};exports[_0x2ece('0x3e')]=function(_0x397823,_0x2f542f){var _0x280679={'raw':![],'where':{'id':_0x397823[_0x2ece('0x3f')]['id']}},_0x2884cf={};_0x2884cf[_0x2ece('0x2a')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x2884cf[_0x2ece('0x28')]=_['keys'](_0x397823[_0x2ece('0x28')]);_0x2884cf[_0x2ece('0x29')]=_[_0x2ece('0x2c')](_0x2884cf[_0x2ece('0x2a')],_0x2884cf[_0x2ece('0x28')]);_0x280679[_0x2ece('0x2b')]=_[_0x2ece('0x2c')](_0x2884cf[_0x2ece('0x2a')],qs[_0x2ece('0x2d')](_0x397823['query'][_0x2ece('0x2d')]));_0x280679['attributes']=_0x280679[_0x2ece('0x2b')][_0x2ece('0x40')]?_0x280679[_0x2ece('0x2b')]:_0x2884cf[_0x2ece('0x2a')];if(_0x397823[_0x2ece('0x28')][_0x2ece('0x3a')]){_0x280679[_0x2ece('0x3b')]=[{'all':!![]}];}_0x280679=_[_0x2ece('0x35')]({},_0x280679,_0x397823[_0x2ece('0x37')]);return db[_0x2ece('0x38')][_0x2ece('0x41')](_0x280679)[_0x2ece('0x1d')](handleEntityNotFound(_0x2f542f,null))[_0x2ece('0x1d')](respondWithResult(_0x2f542f,null))[_0x2ece('0x3d')](handleError(_0x2f542f,null));};exports['create']=function(_0x53c443,_0x12906d){return db[_0x2ece('0x38')][_0x2ece('0x42')](_0x53c443[_0x2ece('0x43')],{})[_0x2ece('0x1d')](respondWithResult(_0x12906d,0xc9))[_0x2ece('0x3d')](handleError(_0x12906d,null));};exports[_0x2ece('0x1c')]=function(_0x178ac3,_0x3e6fed){if(_0x178ac3[_0x2ece('0x43')]['id']){delete _0x178ac3['body']['id'];}return db[_0x2ece('0x38')][_0x2ece('0x41')]({'where':{'id':_0x178ac3[_0x2ece('0x3f')]['id']}})[_0x2ece('0x1d')](handleEntityNotFound(_0x3e6fed,null))[_0x2ece('0x1d')](saveUpdates(_0x178ac3[_0x2ece('0x43')],null))[_0x2ece('0x1d')](respondWithResult(_0x3e6fed,null))['catch'](handleError(_0x3e6fed,null));};exports[_0x2ece('0x1e')]=function(_0x17e27b,_0x3b9841){return db[_0x2ece('0x38')][_0x2ece('0x41')]({'where':{'id':_0x17e27b[_0x2ece('0x3f')]['id']}})[_0x2ece('0x1d')](handleEntityNotFound(_0x3b9841,null))[_0x2ece('0x1d')](removeEntity(_0x3b9841,null))['catch'](handleError(_0x3b9841,null));};exports['getSubjects']=function(_0x224aa0,_0x19802a,_0x2b58a4){var _0x4c5c38={};var _0x213e3a={};var _0x2970aa;var _0x15a3db;return db[_0x2ece('0x38')]['findOne']({'where':{'id':_0x224aa0['params']['id']}})['then'](handleEntityNotFound(_0x19802a,null))[_0x2ece('0x1d')](function(_0x12e980){if(_0x12e980){_0x2970aa=_0x12e980;_0x213e3a[_0x2ece('0x2a')]=_[_0x2ece('0x44')](db['FreshsalesField'][_0x2ece('0x24')]);_0x213e3a[_0x2ece('0x28')]=_[_0x2ece('0x44')](_0x224aa0[_0x2ece('0x28')]);_0x213e3a[_0x2ece('0x29')]=_[_0x2ece('0x2c')](_0x213e3a[_0x2ece('0x2a')],_0x213e3a[_0x2ece('0x28')]);_0x4c5c38[_0x2ece('0x2b')]=_[_0x2ece('0x2c')](_0x213e3a[_0x2ece('0x2a')],qs[_0x2ece('0x2d')](_0x224aa0[_0x2ece('0x28')][_0x2ece('0x2d')]));_0x4c5c38['attributes']=_0x4c5c38[_0x2ece('0x2b')]['length']?_0x4c5c38[_0x2ece('0x2b')]:_0x213e3a[_0x2ece('0x2a')];_0x4c5c38['order']=qs[_0x2ece('0x31')](_0x224aa0['query'][_0x2ece('0x31')]);_0x4c5c38[_0x2ece('0x32')]=qs[_0x2ece('0x29')](_[_0x2ece('0x33')](_0x224aa0['query'],_0x213e3a[_0x2ece('0x29')]));if(_0x224aa0[_0x2ece('0x28')]['filter']){_0x4c5c38[_0x2ece('0x32')]=_[_0x2ece('0x35')](_0x4c5c38[_0x2ece('0x32')],{'$or':_[_0x2ece('0x23')](_0x4c5c38[_0x2ece('0x2b')],function(_0xc182aa){var _0x115e83={};_0x115e83[_0xc182aa]={'$like':'%'+_0x224aa0[_0x2ece('0x28')][_0x2ece('0x34')]+'%'};return _0x115e83;})});}_0x4c5c38=_[_0x2ece('0x35')]({},_0x4c5c38,_0x224aa0[_0x2ece('0x37')]);return _0x2970aa[_0x2ece('0x45')](_0x4c5c38);}})['then'](function(_0xb49e2d){if(_0xb49e2d){_0x15a3db=_0xb49e2d[_0x2ece('0x40')];if(!_0x224aa0['query'][_0x2ece('0x2e')](_0x2ece('0x2f'))){_0x4c5c38[_0x2ece('0x17')]=qs[_0x2ece('0x17')](_0x224aa0[_0x2ece('0x28')][_0x2ece('0x17')]);_0x4c5c38[_0x2ece('0x15')]=qs[_0x2ece('0x15')](_0x224aa0[_0x2ece('0x28')][_0x2ece('0x15')]);}return _0x2970aa['getSubjects'](_0x4c5c38);}})[_0x2ece('0x1d')](function(_0x50d6cf){if(_0x50d6cf){return _0x50d6cf?{'count':_0x15a3db,'rows':_0x50d6cf}:null;}})[_0x2ece('0x1d')](respondWithResult(_0x19802a,null))[_0x2ece('0x3d')](handleError(_0x19802a,null));};exports[_0x2ece('0x46')]=function(_0x215ef2,_0x4c2166,_0x274348){var _0x2bce6e={};var _0x14ac43={};var _0x5c17c5;var _0x22d338;return db['FreshsalesConfiguration'][_0x2ece('0x47')]({'where':{'id':_0x215ef2[_0x2ece('0x3f')]['id']}})[_0x2ece('0x1d')](handleEntityNotFound(_0x4c2166,null))[_0x2ece('0x1d')](function(_0x4e959f){if(_0x4e959f){_0x5c17c5=_0x4e959f;_0x14ac43['model']=_[_0x2ece('0x44')](db[_0x2ece('0x48')][_0x2ece('0x24')]);_0x14ac43[_0x2ece('0x28')]=_[_0x2ece('0x44')](_0x215ef2['query']);_0x14ac43[_0x2ece('0x29')]=_[_0x2ece('0x2c')](_0x14ac43[_0x2ece('0x2a')],_0x14ac43[_0x2ece('0x28')]);_0x2bce6e[_0x2ece('0x2b')]=_[_0x2ece('0x2c')](_0x14ac43['model'],qs[_0x2ece('0x2d')](_0x215ef2['query']['fields']));_0x2bce6e[_0x2ece('0x2b')]=_0x2bce6e[_0x2ece('0x2b')][_0x2ece('0x40')]?_0x2bce6e[_0x2ece('0x2b')]:_0x14ac43[_0x2ece('0x2a')];_0x2bce6e[_0x2ece('0x30')]=qs[_0x2ece('0x31')](_0x215ef2['query'][_0x2ece('0x31')]);_0x2bce6e[_0x2ece('0x32')]=qs[_0x2ece('0x29')](_[_0x2ece('0x33')](_0x215ef2[_0x2ece('0x28')],_0x14ac43[_0x2ece('0x29')]));if(_0x215ef2[_0x2ece('0x28')]['filter']){_0x2bce6e[_0x2ece('0x32')]=_['merge'](_0x2bce6e[_0x2ece('0x32')],{'$or':_[_0x2ece('0x23')](_0x2bce6e[_0x2ece('0x2b')],function(_0x28ee17){var _0x5f17c5={};_0x5f17c5[_0x28ee17]={'$like':'%'+_0x215ef2['query'][_0x2ece('0x34')]+'%'};return _0x5f17c5;})});}_0x2bce6e=_[_0x2ece('0x35')]({},_0x2bce6e,_0x215ef2['options']);return _0x5c17c5[_0x2ece('0x46')](_0x2bce6e);}})['then'](function(_0x21f87b){if(_0x21f87b){_0x22d338=_0x21f87b[_0x2ece('0x40')];if(!_0x215ef2[_0x2ece('0x28')][_0x2ece('0x2e')](_0x2ece('0x2f'))){_0x2bce6e[_0x2ece('0x17')]=qs[_0x2ece('0x17')](_0x215ef2[_0x2ece('0x28')][_0x2ece('0x17')]);_0x2bce6e['offset']=qs[_0x2ece('0x15')](_0x215ef2[_0x2ece('0x28')][_0x2ece('0x15')]);}return _0x5c17c5[_0x2ece('0x46')](_0x2bce6e);}})[_0x2ece('0x1d')](function(_0x501bdc){if(_0x501bdc){return _0x501bdc?{'count':_0x22d338,'rows':_0x501bdc}:null;}})[_0x2ece('0x1d')](respondWithResult(_0x4c2166,null))[_0x2ece('0x3d')](handleError(_0x4c2166,null));};exports['getFields']=function(_0x271b84,_0x58e18f,_0x2f4b6c){var _0x148eb0={};var _0x2a5475={};var _0x5d97f6;var _0x5292c6;return db['FreshsalesConfiguration'][_0x2ece('0x47')]({'where':{'id':_0x271b84[_0x2ece('0x3f')]['id']}})[_0x2ece('0x1d')](handleEntityNotFound(_0x58e18f,null))['then'](function(_0x23e854){if(_0x23e854){_0x5d97f6=_0x23e854;_0x2a5475['model']=_[_0x2ece('0x44')](db[_0x2ece('0x48')][_0x2ece('0x24')]);_0x2a5475[_0x2ece('0x28')]=_['keys'](_0x271b84[_0x2ece('0x28')]);_0x2a5475[_0x2ece('0x29')]=_[_0x2ece('0x2c')](_0x2a5475[_0x2ece('0x2a')],_0x2a5475[_0x2ece('0x28')]);_0x148eb0['attributes']=_[_0x2ece('0x2c')](_0x2a5475['model'],qs[_0x2ece('0x2d')](_0x271b84['query'][_0x2ece('0x2d')]));_0x148eb0[_0x2ece('0x2b')]=_0x148eb0[_0x2ece('0x2b')][_0x2ece('0x40')]?_0x148eb0['attributes']:_0x2a5475[_0x2ece('0x2a')];_0x148eb0[_0x2ece('0x30')]=qs[_0x2ece('0x31')](_0x271b84[_0x2ece('0x28')][_0x2ece('0x31')]);_0x148eb0[_0x2ece('0x32')]=qs[_0x2ece('0x29')](_[_0x2ece('0x33')](_0x271b84[_0x2ece('0x28')],_0x2a5475[_0x2ece('0x29')]));if(_0x271b84['query'][_0x2ece('0x34')]){_0x148eb0[_0x2ece('0x32')]=_[_0x2ece('0x35')](_0x148eb0[_0x2ece('0x32')],{'$or':_[_0x2ece('0x23')](_0x148eb0[_0x2ece('0x2b')],function(_0x59b235){var _0x499e08={};_0x499e08[_0x59b235]={'$like':'%'+_0x271b84[_0x2ece('0x28')]['filter']+'%'};return _0x499e08;})});}_0x148eb0=_[_0x2ece('0x35')]({},_0x148eb0,_0x271b84['options']);return _0x5d97f6[_0x2ece('0x49')](_0x148eb0);}})[_0x2ece('0x1d')](function(_0x473af0){if(_0x473af0){_0x5292c6=_0x473af0[_0x2ece('0x40')];if(!_0x271b84[_0x2ece('0x28')]['hasOwnProperty'](_0x2ece('0x2f'))){_0x148eb0[_0x2ece('0x17')]=qs[_0x2ece('0x17')](_0x271b84[_0x2ece('0x28')]['limit']);_0x148eb0['offset']=qs[_0x2ece('0x15')](_0x271b84['query'][_0x2ece('0x15')]);}return _0x5d97f6['getFields'](_0x148eb0);}})[_0x2ece('0x1d')](function(_0x598d8c){if(_0x598d8c){return _0x598d8c?{'count':_0x5292c6,'rows':_0x598d8c}:null;}})[_0x2ece('0x1d')](respondWithResult(_0x58e18f,null))[_0x2ece('0x3d')](handleError(_0x58e18f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 3a6dc5d..7075d11 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 _0x1e94=['FreshsalesConfiguration','int_freshsales_configurations','lodash','api','moment','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1e94,0x120));var _0x41e9=function(_0x48a6f3,_0xecaada){_0x48a6f3=_0x48a6f3-0x0;var _0x4a236e=_0x1e94[_0x48a6f3];return _0x4a236e;};'use strict';var _=require(_0x41e9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x41e9('0x1'));var moment=require(_0x41e9('0x2'));var BPromise=require(_0x41e9('0x3'));var rp=require(_0x41e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41e9('0x5'));var config=require('../../config/environment');var attributes=require(_0x41e9('0x6'));module[_0x41e9('0x7')]=function(_0x3fff6c,_0x58b692){return _0x3fff6c[_0x41e9('0x8')](_0x41e9('0x9'),attributes,{'tableName':_0x41e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35e0=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','int_freshsales_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1409bf,_0x19a39d){var _0xfa1142=function(_0x56bdbf){while(--_0x56bdbf){_0x1409bf['push'](_0x1409bf['shift']());}};_0xfa1142(++_0x19a39d);}(_0x35e0,0x13a));var _0x035e=function(_0x49a755,_0x1bdf7d){_0x49a755=_0x49a755-0x0;var _0x264147=_0x35e0[_0x49a755];return _0x264147;};'use strict';var _=require(_0x035e('0x0'));var util=require(_0x035e('0x1'));var logger=require(_0x035e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x035e('0x3'));var rp=require(_0x035e('0x4'));var fs=require('fs');var path=require(_0x035e('0x5'));var rimraf=require(_0x035e('0x6'));var config=require(_0x035e('0x7'));var attributes=require(_0x035e('0x8'));module['exports']=function(_0x2076ec,_0x4c9b05){return _0x2076ec['define']('FreshsalesConfiguration',attributes,{'tableName':_0x035e('0x9'),'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 25e243c..d346753 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 _0x5bef=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash'];(function(_0xc4d708,_0x4151fc){var _0x2c826e=function(_0x17ad13){while(--_0x17ad13){_0xc4d708['push'](_0xc4d708['shift']());}};_0x2c826e(++_0x4151fc);}(_0x5bef,0x16f));var _0xf5be=function(_0x4edc1e,_0x2755a5){_0x4edc1e=_0x4edc1e-0x0;var _0x425f2c=_0x5bef[_0x4edc1e];return _0x425f2c;};'use strict';var _=require(_0xf5be('0x0'));var util=require(_0xf5be('0x1'));var moment=require(_0xf5be('0x2'));var BPromise=require(_0xf5be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5be('0x4'));var db=require(_0xf5be('0x5'))['db'];var utils=require(_0xf5be('0x6'));var logger=require(_0xf5be('0x7'))(_0xf5be('0x8'));var config=require(_0xf5be('0x9'));var jayson=require(_0xf5be('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4371b1,_0xd3f099,_0x42861c){return new BPromise(function(_0x3ca5a3,_0x30dfa2){return client[_0xf5be('0xb')](_0x4371b1,_0x42861c)[_0xf5be('0xc')](function(_0x44146a){logger[_0xf5be('0xd')](_0xf5be('0xe'),_0xd3f099,_0xf5be('0xf'));logger[_0xf5be('0x10')](_0xf5be('0x11'),_0xd3f099,_0xf5be('0xf'),JSON[_0xf5be('0x12')](_0x44146a));if(_0x44146a['error']){if(_0x44146a['error'][_0xf5be('0x13')]===0x1f4){logger[_0xf5be('0x14')](_0xf5be('0xe'),_0xd3f099,_0x44146a['error'][_0xf5be('0x15')]);return _0x30dfa2(_0x44146a[_0xf5be('0x14')][_0xf5be('0x15')]);}logger['error'](_0xf5be('0xe'),_0xd3f099,_0x44146a['error'][_0xf5be('0x15')]);return _0x3ca5a3(_0x44146a[_0xf5be('0x14')][_0xf5be('0x15')]);}else{logger[_0xf5be('0xd')](_0xf5be('0xe'),_0xd3f099,_0xf5be('0xf'));_0x3ca5a3(_0x44146a['result'][_0xf5be('0x15')]);}})[_0xf5be('0x16')](function(_0x58cd21){logger[_0xf5be('0x14')](_0xf5be('0xe'),_0xd3f099,_0x58cd21);_0x30dfa2(_0x58cd21);});});} \ No newline at end of file +var _0xad9d=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0xad9d,0x16e));var _0xdad9=function(_0x535e31,_0x2df3f1){_0x535e31=_0x535e31-0x0;var _0x4884fd=_0xad9d[_0x535e31];return _0x4884fd;};'use strict';var _=require(_0xdad9('0x0'));var util=require(_0xdad9('0x1'));var moment=require(_0xdad9('0x2'));var BPromise=require(_0xdad9('0x3'));var rs=require(_0xdad9('0x4'));var fs=require('fs');var Redis=require(_0xdad9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdad9('0x6'))(_0xdad9('0x7'));var config=require(_0xdad9('0x8'));var jayson=require(_0xdad9('0x9'));var client=jayson[_0xdad9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c4d23,_0x3a44c6,_0x1a1fcf){return new BPromise(function(_0x2e9af4,_0x5cf1cc){return client[_0xdad9('0xb')](_0x1c4d23,_0x1a1fcf)['then'](function(_0x32ac72){logger['info'](_0xdad9('0xc'),_0x3a44c6,_0xdad9('0xd'));logger[_0xdad9('0xe')](_0xdad9('0xf'),_0x3a44c6,_0xdad9('0xd'),JSON[_0xdad9('0x10')](_0x32ac72));if(_0x32ac72[_0xdad9('0x11')]){if(_0x32ac72[_0xdad9('0x11')][_0xdad9('0x12')]===0x1f4){logger['error'](_0xdad9('0xc'),_0x3a44c6,_0x32ac72['error'][_0xdad9('0x13')]);return _0x5cf1cc(_0x32ac72[_0xdad9('0x11')][_0xdad9('0x13')]);}logger[_0xdad9('0x11')](_0xdad9('0xc'),_0x3a44c6,_0x32ac72['error']['message']);return _0x2e9af4(_0x32ac72[_0xdad9('0x11')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3a44c6,_0xdad9('0xd'));_0x2e9af4(_0x32ac72[_0xdad9('0x14')][_0xdad9('0x13')]);}})['catch'](function(_0x381b14){logger[_0xdad9('0x11')](_0xdad9('0xc'),_0x3a44c6,_0x381b14);_0x5cf1cc(_0x381b14);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 4249cf6..0dfee41 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 _0xafe6=['isAuthenticated','/:id','show','create','put','update','destroy','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x26b345,_0x132eac){var _0x375338=function(_0x5cfbc9){while(--_0x5cfbc9){_0x26b345['push'](_0x26b345['shift']());}};_0x375338(++_0x132eac);}(_0xafe6,0xac));var _0x6afe=function(_0x2ae1a5,_0x314c05){_0x2ae1a5=_0x2ae1a5-0x0;var _0x190635=_0xafe6[_0x2ae1a5];return _0x190635;};'use strict';var multer=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6afe('0x2'));var router=express[_0x6afe('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6afe('0x4'));var config=require(_0x6afe('0x5'));var controller=require(_0x6afe('0x6'));router[_0x6afe('0x7')]('/',auth[_0x6afe('0x8')](),controller['index']);router[_0x6afe('0x7')](_0x6afe('0x9'),auth[_0x6afe('0x8')](),controller[_0x6afe('0xa')]);router['post']('/',auth[_0x6afe('0x8')](),controller[_0x6afe('0xb')]);router[_0x6afe('0xc')](_0x6afe('0x9'),auth[_0x6afe('0x8')](),controller[_0x6afe('0xd')]);router['delete']('/:id',auth[_0x6afe('0x8')](),controller[_0x6afe('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2121=['put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x3bbd4e,_0x502b91){var _0x4dfeb8=function(_0x54f4ca){while(--_0x54f4ca){_0x3bbd4e['push'](_0x3bbd4e['shift']());}};_0x4dfeb8(++_0x502b91);}(_0x2121,0x1b4));var _0x1212=function(_0x22a1a7,_0x28033f){_0x22a1a7=_0x22a1a7-0x0;var _0x64a72=_0x2121[_0x22a1a7];return _0x64a72;};'use strict';var multer=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1212('0x2'));var router=express[_0x1212('0x3')]();var fs_extra=require(_0x1212('0x4'));var auth=require(_0x1212('0x5'));var interaction=require(_0x1212('0x6'));var config=require('../../config/environment');var controller=require(_0x1212('0x7'));router['get']('/',auth[_0x1212('0x8')](),controller[_0x1212('0x9')]);router[_0x1212('0xa')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0xc')]);router['post']('/',auth[_0x1212('0x8')](),controller[_0x1212('0xd')]);router[_0x1212('0xe')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0xf')]);router['delete']('/:id',auth[_0x1212('0x8')](),controller[_0x1212('0x10')]);module[_0x1212('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index d77e294..d425752 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 _0x8643=['keyValue','STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x3a91df,_0x15cc85){var _0x3fcd7d=function(_0x187f4e){while(--_0x187f4e){_0x3a91df['push'](_0x3a91df['shift']());}};_0x3fcd7d(++_0x15cc85);}(_0x8643,0x183));var _0x3864=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8643[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x3864('0x0'));module['exports']={'type':{'type':Sequelize[_0x3864('0x1')](_0x3864('0x2'),_0x3864('0x3'),_0x3864('0x4'),_0x3864('0x5'),'picklist'),'defaultValue':_0x3864('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3864('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x3864('0x2'),_0x3864('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3864('0x6')]},'idField':{'type':Sequelize[_0x3864('0x6')]},'nameField':{'type':Sequelize[_0x3864('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9317=['STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x9317,0xfd));var _0x7931=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9317[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x7931('0x0'));module[_0x7931('0x1')]={'type':{'type':Sequelize[_0x7931('0x2')]('string',_0x7931('0x3'),_0x7931('0x4'),_0x7931('0x5'),_0x7931('0x6')),'defaultValue':_0x7931('0x7')},'content':{'type':Sequelize[_0x7931('0x8')]},'key':{'type':Sequelize[_0x7931('0x8')]},'keyType':{'type':Sequelize[_0x7931('0x2')](_0x7931('0x7'),_0x7931('0x3'),_0x7931('0x4'))},'keyContent':{'type':Sequelize[_0x7931('0x8')]},'idField':{'type':Sequelize[_0x7931('0x8')]},'nameField':{'type':Sequelize[_0x7931('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7931('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 67e53d2..96f9856 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 _0x0fa2=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','filters','length','options','find','create','body','params','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3bb947,_0x34b6f3){var _0x122b67=function(_0x49cf0a){while(--_0x49cf0a){_0x3bb947['push'](_0x3bb947['shift']());}};_0x122b67(++_0x34b6f3);}(_0x0fa2,0x80));var _0x20fa=function(_0x30143f,_0x3f3f5a){_0x30143f=_0x30143f-0x0;var _0x6cada6=_0x0fa2[_0x30143f];return _0x6cada6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20fa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20fa('0x1'));var rp=require('request-promise');var moment=require(_0x20fa('0x2'));var BPromise=require(_0x20fa('0x3'));var Mustache=require('mustache');var util=require(_0x20fa('0x4'));var path=require(_0x20fa('0x5'));var sox=require(_0x20fa('0x6'));var csv=require(_0x20fa('0x7'));var ejs=require(_0x20fa('0x8'));var fs=require('fs');var fs_extra=require(_0x20fa('0x9'));var _=require(_0x20fa('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x20fa('0xb'));var deskjs=require(_0x20fa('0xc'));var toCsv=require(_0x20fa('0x7'));var querystring=require(_0x20fa('0xd'));var Papa=require(_0x20fa('0xe'));var Redis=require(_0x20fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x20fa('0x10'));var as=require(_0x20fa('0x11'));var hardwareService=require(_0x20fa('0x12'));var logger=require(_0x20fa('0x13'))(_0x20fa('0x14'));var utils=require(_0x20fa('0x15'));var config=require(_0x20fa('0x16'));var licenseUtil=require(_0x20fa('0x17'));var db=require(_0x20fa('0x18'))['db'];function respondWithStatusCode(_0x374f64,_0x124f3f){_0x124f3f=_0x124f3f||0xcc;return function(_0x3670a1){if(_0x3670a1){return _0x374f64[_0x20fa('0x19')](_0x124f3f);}return _0x374f64[_0x20fa('0x1a')](_0x124f3f)[_0x20fa('0x1b')]();};}function respondWithResult(_0x5eb1ec,_0xa4318f){_0xa4318f=_0xa4318f||0xc8;return function(_0x475f94){if(_0x475f94){return _0x5eb1ec[_0x20fa('0x1a')](_0xa4318f)[_0x20fa('0x1c')](_0x475f94);}};}function respondWithFilteredResult(_0x14ca0e,_0x2f2dd6){return function(_0x299625){if(_0x299625){var _0x2670fd=typeof _0x2f2dd6[_0x20fa('0x1d')]===_0x20fa('0x1e')&&typeof _0x2f2dd6[_0x20fa('0x1f')]===_0x20fa('0x1e');var _0x405202=_0x299625['count'];var _0x237554=_0x2670fd?0x0:_0x2f2dd6[_0x20fa('0x1d')];var _0xf20960=_0x2670fd?_0x299625[_0x20fa('0x20')]:_0x2f2dd6[_0x20fa('0x1d')]+_0x2f2dd6['limit'];var _0x363e73;if(_0xf20960>=_0x405202){_0xf20960=_0x405202;_0x363e73=0xc8;}else{_0x363e73=0xce;}_0x14ca0e[_0x20fa('0x1a')](_0x363e73);return _0x14ca0e['set']('Content-Range',_0x237554+'-'+_0xf20960+'/'+_0x405202)[_0x20fa('0x1c')](_0x299625);}return null;};}function patchUpdates(_0x40fea8){return function(_0x22a473){try{jsonpatch[_0x20fa('0x21')](_0x22a473,_0x40fea8,!![]);}catch(_0x290272){return BPromise[_0x20fa('0x22')](_0x290272);}return _0x22a473[_0x20fa('0x23')]();};}function saveUpdates(_0x1882c2,_0x54a47c){return function(_0x32a427){if(_0x32a427){return _0x32a427[_0x20fa('0x24')](_0x1882c2)[_0x20fa('0x25')](function(_0x3e6b05){return _0x3e6b05;});}return null;};}function removeEntity(_0x8598c5,_0x1772dc){return function(_0x291cdf){if(_0x291cdf){return _0x291cdf[_0x20fa('0x26')]()[_0x20fa('0x25')](function(){_0x8598c5[_0x20fa('0x1a')](0xcc)[_0x20fa('0x1b')]();});}};}function handleEntityNotFound(_0x50b0cb,_0x297dc4){return function(_0x12b353){if(!_0x12b353){_0x50b0cb[_0x20fa('0x19')](0x194);}return _0x12b353;};}function handleError(_0x22f34b,_0x58853e){_0x58853e=_0x58853e||0x1f4;return function(_0x5bffae){logger[_0x20fa('0x27')](_0x5bffae[_0x20fa('0x28')]);if(_0x5bffae[_0x20fa('0x29')]){delete _0x5bffae[_0x20fa('0x29')];}_0x22f34b[_0x20fa('0x1a')](_0x58853e)[_0x20fa('0x2a')](_0x5bffae);};}exports['index']=function(_0x41cec5,_0x4ec3db){var _0x7d583e={},_0x55a7c9={},_0x3db34c={'count':0x0,'rows':[]};var _0x27eaf=_[_0x20fa('0x2b')](db[_0x20fa('0x2c')][_0x20fa('0x2d')],function(_0x295334){return{'name':_0x295334['fieldName'],'type':_0x295334[_0x20fa('0x2e')]['key']};});_0x55a7c9[_0x20fa('0x2f')]=_['map'](_0x27eaf,'name');_0x55a7c9[_0x20fa('0x30')]=_[_0x20fa('0x31')](_0x41cec5['query']);_0x55a7c9['filters']=_[_0x20fa('0x32')](_0x55a7c9[_0x20fa('0x2f')],_0x55a7c9[_0x20fa('0x30')]);_0x7d583e['attributes']=_[_0x20fa('0x32')](_0x55a7c9[_0x20fa('0x2f')],qs['fields'](_0x41cec5['query'][_0x20fa('0x33')]));_0x7d583e[_0x20fa('0x34')]=_0x7d583e[_0x20fa('0x34')]['length']?_0x7d583e[_0x20fa('0x34')]:_0x55a7c9[_0x20fa('0x2f')];if(!_0x41cec5[_0x20fa('0x30')][_0x20fa('0x35')](_0x20fa('0x36'))){_0x7d583e['limit']=qs[_0x20fa('0x1f')](_0x41cec5[_0x20fa('0x30')]['limit']);_0x7d583e[_0x20fa('0x1d')]=qs[_0x20fa('0x1d')](_0x41cec5[_0x20fa('0x30')][_0x20fa('0x1d')]);}_0x7d583e['order']=qs[_0x20fa('0x37')](_0x41cec5['query']['sort']);_0x7d583e[_0x20fa('0x38')]=qs['filters'](_[_0x20fa('0x39')](_0x41cec5[_0x20fa('0x30')],_0x55a7c9['filters']),_0x27eaf);if(_0x41cec5[_0x20fa('0x30')][_0x20fa('0x3a')]){_0x7d583e['where']=_[_0x20fa('0x3b')](_0x7d583e['where'],{'$or':_[_0x20fa('0x2b')](_0x27eaf,function(_0x29db6f){if(_0x29db6f[_0x20fa('0x2e')]!==_0x20fa('0x3c')){var _0xc3f88d={};_0xc3f88d[_0x29db6f[_0x20fa('0x29')]]={'$like':'%'+_0x41cec5['query'][_0x20fa('0x3a')]+'%'};return _0xc3f88d;}})});}_0x7d583e=_[_0x20fa('0x3b')]({},_0x7d583e,_0x41cec5['options']);var _0x508e5c={'where':_0x7d583e[_0x20fa('0x38')]};return db[_0x20fa('0x2c')][_0x20fa('0x20')](_0x508e5c)['then'](function(_0x407e48){_0x3db34c[_0x20fa('0x20')]=_0x407e48;if(_0x41cec5[_0x20fa('0x30')][_0x20fa('0x3d')]){_0x7d583e[_0x20fa('0x3e')]=[{'all':!![]}];}return db[_0x20fa('0x2c')][_0x20fa('0x3f')](_0x7d583e);})[_0x20fa('0x25')](function(_0xbb2e0){_0x3db34c[_0x20fa('0x40')]=_0xbb2e0;return _0x3db34c;})[_0x20fa('0x25')](respondWithFilteredResult(_0x4ec3db,_0x7d583e))[_0x20fa('0x41')](handleError(_0x4ec3db,null));};exports[_0x20fa('0x42')]=function(_0x316962,_0xae65c){var _0x5b584e={'raw':!![],'where':{'id':_0x316962['params']['id']}},_0x5b125f={};_0x5b125f['model']=_[_0x20fa('0x31')](db['FreshsalesField'][_0x20fa('0x2d')]);_0x5b125f[_0x20fa('0x30')]=_['keys'](_0x316962[_0x20fa('0x30')]);_0x5b125f[_0x20fa('0x43')]=_['intersection'](_0x5b125f[_0x20fa('0x2f')],_0x5b125f['query']);_0x5b584e[_0x20fa('0x34')]=_[_0x20fa('0x32')](_0x5b125f[_0x20fa('0x2f')],qs[_0x20fa('0x33')](_0x316962[_0x20fa('0x30')][_0x20fa('0x33')]));_0x5b584e[_0x20fa('0x34')]=_0x5b584e[_0x20fa('0x34')][_0x20fa('0x44')]?_0x5b584e[_0x20fa('0x34')]:_0x5b125f['model'];if(_0x316962['query'][_0x20fa('0x3d')]){_0x5b584e['include']=[{'all':!![]}];}_0x5b584e=_[_0x20fa('0x3b')]({},_0x5b584e,_0x316962[_0x20fa('0x45')]);return db['FreshsalesField'][_0x20fa('0x46')](_0x5b584e)[_0x20fa('0x25')](handleEntityNotFound(_0xae65c,null))[_0x20fa('0x25')](respondWithResult(_0xae65c,null))[_0x20fa('0x41')](handleError(_0xae65c,null));};exports[_0x20fa('0x47')]=function(_0x22260b,_0x3e4f3b){return db[_0x20fa('0x2c')][_0x20fa('0x47')](_0x22260b[_0x20fa('0x48')],{})[_0x20fa('0x25')](respondWithResult(_0x3e4f3b,0xc9))[_0x20fa('0x41')](handleError(_0x3e4f3b,null));};exports['update']=function(_0x32af0b,_0x463c13){if(_0x32af0b[_0x20fa('0x48')]['id']){delete _0x32af0b[_0x20fa('0x48')]['id'];}return db[_0x20fa('0x2c')][_0x20fa('0x46')]({'where':{'id':_0x32af0b[_0x20fa('0x49')]['id']}})['then'](handleEntityNotFound(_0x463c13,null))[_0x20fa('0x25')](saveUpdates(_0x32af0b[_0x20fa('0x48')],null))[_0x20fa('0x25')](respondWithResult(_0x463c13,null))[_0x20fa('0x41')](handleError(_0x463c13,null));};exports[_0x20fa('0x26')]=function(_0x4093e9,_0x238ad8){return db[_0x20fa('0x2c')][_0x20fa('0x46')]({'where':{'id':_0x4093e9['params']['id']}})[_0x20fa('0x25')](handleEntityNotFound(_0x238ad8,null))[_0x20fa('0x25')](removeEntity(_0x238ad8,null))['catch'](handleError(_0x238ad8,null));}; \ No newline at end of file +var _0xff9e=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','FreshsalesField','findAll','rows','catch','show','params','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','apply','reject','save','destroy','then','error','stack','name','index','map','rawAttributes'];(function(_0x12c2e4,_0x11aa66){var _0x54ff63=function(_0x469275){while(--_0x469275){_0x12c2e4['push'](_0x12c2e4['shift']());}};_0x54ff63(++_0x11aa66);}(_0xff9e,0x102));var _0xeff9=function(_0x17a23f,_0x51fc4a){_0x17a23f=_0x17a23f-0x0;var _0x486b0f=_0xff9e[_0x17a23f];return _0x486b0f;};'use strict';var emlformat=require(_0xeff9('0x0'));var rimraf=require(_0xeff9('0x1'));var zipdir=require(_0xeff9('0x2'));var jsonpatch=require(_0xeff9('0x3'));var rp=require(_0xeff9('0x4'));var moment=require('moment');var BPromise=require(_0xeff9('0x5'));var Mustache=require(_0xeff9('0x6'));var util=require(_0xeff9('0x7'));var path=require(_0xeff9('0x8'));var sox=require(_0xeff9('0x9'));var csv=require('to-csv');var ejs=require(_0xeff9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xeff9('0xb'));var jsforce=require(_0xeff9('0xc'));var deskjs=require(_0xeff9('0xd'));var toCsv=require(_0xeff9('0xe'));var querystring=require(_0xeff9('0xf'));var Papa=require(_0xeff9('0x10'));var Redis=require(_0xeff9('0x11'));var authService=require(_0xeff9('0x12'));var qs=require(_0xeff9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeff9('0x14'));var logger=require(_0xeff9('0x15'))(_0xeff9('0x16'));var utils=require(_0xeff9('0x17'));var config=require(_0xeff9('0x18'));var licenseUtil=require(_0xeff9('0x19'));var db=require(_0xeff9('0x1a'))['db'];function respondWithStatusCode(_0x316895,_0x4b83c8){_0x4b83c8=_0x4b83c8||0xcc;return function(_0x6cccd9){if(_0x6cccd9){return _0x316895[_0xeff9('0x1b')](_0x4b83c8);}return _0x316895['status'](_0x4b83c8)[_0xeff9('0x1c')]();};}function respondWithResult(_0x322cf4,_0x368deb){_0x368deb=_0x368deb||0xc8;return function(_0x21cf6f){if(_0x21cf6f){return _0x322cf4['status'](_0x368deb)[_0xeff9('0x1d')](_0x21cf6f);}};}function respondWithFilteredResult(_0x3c56bb,_0x5c57fd){return function(_0x1fd353){if(_0x1fd353){var _0x4d408f=typeof _0x5c57fd[_0xeff9('0x1e')]==='undefined'&&typeof _0x5c57fd['limit']===_0xeff9('0x1f');var _0x1a9161=_0x1fd353['count'];var _0x17889b=_0x4d408f?0x0:_0x5c57fd[_0xeff9('0x1e')];var _0x18cb10=_0x4d408f?_0x1fd353[_0xeff9('0x20')]:_0x5c57fd[_0xeff9('0x1e')]+_0x5c57fd[_0xeff9('0x21')];var _0x1f345a;if(_0x18cb10>=_0x1a9161){_0x18cb10=_0x1a9161;_0x1f345a=0xc8;}else{_0x1f345a=0xce;}_0x3c56bb[_0xeff9('0x22')](_0x1f345a);return _0x3c56bb['set']('Content-Range',_0x17889b+'-'+_0x18cb10+'/'+_0x1a9161)[_0xeff9('0x1d')](_0x1fd353);}return null;};}function patchUpdates(_0x4a8c8c){return function(_0x8d4164){try{jsonpatch[_0xeff9('0x23')](_0x8d4164,_0x4a8c8c,!![]);}catch(_0x54ad3d){return BPromise[_0xeff9('0x24')](_0x54ad3d);}return _0x8d4164[_0xeff9('0x25')]();};}function saveUpdates(_0xf58e05,_0x4d6fa0){return function(_0x44a94e){if(_0x44a94e){return _0x44a94e['update'](_0xf58e05)['then'](function(_0x5b2ee9){return _0x5b2ee9;});}return null;};}function removeEntity(_0x1154b6,_0xf26601){return function(_0x142039){if(_0x142039){return _0x142039[_0xeff9('0x26')]()[_0xeff9('0x27')](function(){_0x1154b6[_0xeff9('0x22')](0xcc)[_0xeff9('0x1c')]();});}};}function handleEntityNotFound(_0x2a6c98,_0x5bc08c){return function(_0x8a55d7){if(!_0x8a55d7){_0x2a6c98['sendStatus'](0x194);}return _0x8a55d7;};}function handleError(_0xa8f59d,_0x9f63b1){_0x9f63b1=_0x9f63b1||0x1f4;return function(_0x4dc55a){logger[_0xeff9('0x28')](_0x4dc55a[_0xeff9('0x29')]);if(_0x4dc55a[_0xeff9('0x2a')]){delete _0x4dc55a[_0xeff9('0x2a')];}_0xa8f59d[_0xeff9('0x22')](_0x9f63b1)['send'](_0x4dc55a);};}exports[_0xeff9('0x2b')]=function(_0x554cca,_0x34202b){var _0x58916e={},_0x5c3bf5={},_0x15fd5e={'count':0x0,'rows':[]};var _0x423ad4=_[_0xeff9('0x2c')](db['FreshsalesField'][_0xeff9('0x2d')],function(_0x49c028){return{'name':_0x49c028[_0xeff9('0x2e')],'type':_0x49c028[_0xeff9('0x2f')][_0xeff9('0x30')]};});_0x5c3bf5[_0xeff9('0x31')]=_[_0xeff9('0x2c')](_0x423ad4,_0xeff9('0x2a'));_0x5c3bf5[_0xeff9('0x32')]=_[_0xeff9('0x33')](_0x554cca[_0xeff9('0x32')]);_0x5c3bf5['filters']=_[_0xeff9('0x34')](_0x5c3bf5[_0xeff9('0x31')],_0x5c3bf5['query']);_0x58916e[_0xeff9('0x35')]=_[_0xeff9('0x34')](_0x5c3bf5['model'],qs[_0xeff9('0x36')](_0x554cca[_0xeff9('0x32')][_0xeff9('0x36')]));_0x58916e[_0xeff9('0x35')]=_0x58916e[_0xeff9('0x35')][_0xeff9('0x37')]?_0x58916e[_0xeff9('0x35')]:_0x5c3bf5[_0xeff9('0x31')];if(!_0x554cca[_0xeff9('0x32')][_0xeff9('0x38')](_0xeff9('0x39'))){_0x58916e[_0xeff9('0x21')]=qs[_0xeff9('0x21')](_0x554cca['query']['limit']);_0x58916e['offset']=qs[_0xeff9('0x1e')](_0x554cca[_0xeff9('0x32')][_0xeff9('0x1e')]);}_0x58916e['order']=qs[_0xeff9('0x3a')](_0x554cca[_0xeff9('0x32')][_0xeff9('0x3a')]);_0x58916e['where']=qs[_0xeff9('0x3b')](_[_0xeff9('0x3c')](_0x554cca['query'],_0x5c3bf5['filters']),_0x423ad4);if(_0x554cca[_0xeff9('0x32')][_0xeff9('0x3d')]){_0x58916e[_0xeff9('0x3e')]=_[_0xeff9('0x3f')](_0x58916e['where'],{'$or':_[_0xeff9('0x2c')](_0x423ad4,function(_0x5292f4){if(_0x5292f4[_0xeff9('0x2f')]!==_0xeff9('0x40')){var _0x473c05={};_0x473c05[_0x5292f4[_0xeff9('0x2a')]]={'$like':'%'+_0x554cca[_0xeff9('0x32')]['filter']+'%'};return _0x473c05;}})});}_0x58916e=_[_0xeff9('0x3f')]({},_0x58916e,_0x554cca['options']);var _0x182935={'where':_0x58916e['where']};return db[_0xeff9('0x41')][_0xeff9('0x20')](_0x182935)[_0xeff9('0x27')](function(_0x18f15c){_0x15fd5e[_0xeff9('0x20')]=_0x18f15c;if(_0x554cca[_0xeff9('0x32')]['includeAll']){_0x58916e['include']=[{'all':!![]}];}return db['FreshsalesField'][_0xeff9('0x42')](_0x58916e);})[_0xeff9('0x27')](function(_0x5527ee){_0x15fd5e[_0xeff9('0x43')]=_0x5527ee;return _0x15fd5e;})['then'](respondWithFilteredResult(_0x34202b,_0x58916e))[_0xeff9('0x44')](handleError(_0x34202b,null));};exports[_0xeff9('0x45')]=function(_0x346514,_0x160735){var _0xca73da={'raw':!![],'where':{'id':_0x346514[_0xeff9('0x46')]['id']}},_0x46b1c5={};_0x46b1c5[_0xeff9('0x31')]=_[_0xeff9('0x33')](db[_0xeff9('0x41')][_0xeff9('0x2d')]);_0x46b1c5[_0xeff9('0x32')]=_['keys'](_0x346514[_0xeff9('0x32')]);_0x46b1c5[_0xeff9('0x3b')]=_[_0xeff9('0x34')](_0x46b1c5[_0xeff9('0x31')],_0x46b1c5[_0xeff9('0x32')]);_0xca73da['attributes']=_[_0xeff9('0x34')](_0x46b1c5['model'],qs['fields'](_0x346514[_0xeff9('0x32')][_0xeff9('0x36')]));_0xca73da[_0xeff9('0x35')]=_0xca73da[_0xeff9('0x35')][_0xeff9('0x37')]?_0xca73da['attributes']:_0x46b1c5['model'];if(_0x346514[_0xeff9('0x32')][_0xeff9('0x47')]){_0xca73da['include']=[{'all':!![]}];}_0xca73da=_[_0xeff9('0x3f')]({},_0xca73da,_0x346514['options']);return db['FreshsalesField'][_0xeff9('0x48')](_0xca73da)[_0xeff9('0x27')](handleEntityNotFound(_0x160735,null))[_0xeff9('0x27')](respondWithResult(_0x160735,null))[_0xeff9('0x44')](handleError(_0x160735,null));};exports[_0xeff9('0x49')]=function(_0x4ffa9d,_0x38fa20){return db[_0xeff9('0x41')][_0xeff9('0x49')](_0x4ffa9d[_0xeff9('0x4a')],{})[_0xeff9('0x27')](respondWithResult(_0x38fa20,0xc9))[_0xeff9('0x44')](handleError(_0x38fa20,null));};exports[_0xeff9('0x4b')]=function(_0x529ef9,_0x227d91){if(_0x529ef9[_0xeff9('0x4a')]['id']){delete _0x529ef9[_0xeff9('0x4a')]['id'];}return db['FreshsalesField'][_0xeff9('0x48')]({'where':{'id':_0x529ef9[_0xeff9('0x46')]['id']}})[_0xeff9('0x27')](handleEntityNotFound(_0x227d91,null))[_0xeff9('0x27')](saveUpdates(_0x529ef9['body'],null))['then'](respondWithResult(_0x227d91,null))[_0xeff9('0x44')](handleError(_0x227d91,null));};exports[_0xeff9('0x26')]=function(_0x3ceee3,_0x62159b){return db[_0xeff9('0x41')]['find']({'where':{'id':_0x3ceee3['params']['id']}})[_0xeff9('0x27')](handleEntityNotFound(_0x62159b,null))[_0xeff9('0x27')](removeEntity(_0x62159b,null))[_0xeff9('0x44')](handleError(_0x62159b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 17f21ab..881b0d3 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 _0x5d4e=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FreshsalesField'];(function(_0x3c5924,_0x4d295f){var _0x576958=function(_0x4a3e2d){while(--_0x4a3e2d){_0x3c5924['push'](_0x3c5924['shift']());}};_0x576958(++_0x4d295f);}(_0x5d4e,0x138));var _0xe5d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d4e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe5d4('0x0'));var logger=require(_0xe5d4('0x1'))(_0xe5d4('0x2'));var moment=require(_0xe5d4('0x3'));var BPromise=require(_0xe5d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5d4('0x5'));var rimraf=require(_0xe5d4('0x6'));var config=require(_0xe5d4('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xe5d4('0x8')]=function(_0x518138,_0x59cfd9){return _0x518138['define'](_0xe5d4('0x9'),attributes,{'tableName':_0xe5d4('0xa'),'paranoid':![],'indexes':[{'name':_0xe5d4('0xb'),'fields':[_0xe5d4('0xc'),_0xe5d4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a2=['api','bluebird','path','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xd4a2,0x173));var _0x2d4a=function(_0x45dc65,_0x51e9e6){_0x45dc65=_0x45dc65-0x0;var _0x24de39=_0xd4a2[_0x45dc65];return _0x24de39;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[{'name':_0x2d4a('0x9'),'fields':[_0x2d4a('0xa'),_0x2d4a('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 26aff85..cd49595 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 _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xacf4,0xe7));var _0x4acf=function(_0x12f446,_0x46c036){_0x12f446=_0x12f446-0x0;var _0x38b85e=_0xacf4[_0x12f446];return _0x38b85e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3a2123,_0x4c26b8){var _0x4304b8=function(_0x553bd1){while(--_0x553bd1){_0x3a2123['push'](_0x3a2123['shift']());}};_0x4304b8(++_0x4c26b8);}(_0x5fab,0x177));var _0xb5fa=function(_0x27141c,_0x25ff8d){_0x27141c=_0x27141c-0x0;var _0x5a9b58=_0x5fab[_0x27141c];return _0x5a9b58;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 67c4ceb..d12db91 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(_0x190bb3,_0x55a25c){var _0x26f0fd=function(_0x1a3bf6){while(--_0x1a3bf6){_0x190bb3['push'](_0x190bb3['shift']());}};_0x26f0fd(++_0x55a25c);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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(_0x496b98,_0x30bf87){var _0x535c3e=function(_0xe1f8bd){while(--_0xe1f8bd){_0x496b98['push'](_0x496b98['shift']());}};_0x535c3e(++_0x30bf87);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 72bb65e..1ecca07 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 _0xd0bb=['STRING','username','integrationTab','newTab','sequelize','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd0bb,0x1a8));var _0xbd0b=function(_0x410344,_0x11c039){_0x410344=_0x410344-0x0;var _0x210ff4=_0xd0bb[_0x410344];return _0x210ff4;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')]},'description':{'type':Sequelize[_0xbd0b('0x2')]},'username':{'type':Sequelize[_0xbd0b('0x2')],'unique':_0xbd0b('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbd0b('0x2')]},'clientId':{'type':Sequelize[_0xbd0b('0x2')]},'clientSecret':{'type':Sequelize[_0xbd0b('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xbd0b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbd0b('0x4'),_0xbd0b('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xef7e=['integrationTab','newTab','sequelize','STRING','username','ENUM'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0xef7e,0x194));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xeef7('0x0'));module['exports']={'name':{'type':Sequelize[_0xeef7('0x1')]},'description':{'type':Sequelize[_0xeef7('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xeef7('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xeef7('0x1')]},'clientId':{'type':Sequelize[_0xeef7('0x1')]},'clientSecret':{'type':Sequelize[_0xeef7('0x1')]},'securityToken':{'type':Sequelize[_0xeef7('0x1')]},'serverUrl':{'type':Sequelize[_0xeef7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xeef7('0x3')](_0xeef7('0x4'),_0xeef7('0x5')),'defaultValue':_0xeef7('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 0c322e3..875e01a 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 _0x4c8b=['string','picklist','boolean','phone','remove','includes','label','custom','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','SalesforceAccount','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','findOne','SalesforceConfiguration','rawAttributes','pick','getConfigurations','addConfiguration','Subjects','channel','SalesforceField','Descriptions','Task','remoteUri','clientId','username','password','slice','substring','lastIndexOf','Connection','clientSecret','login','concat','securityToken','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence'];(function(_0x4dc633,_0x560300){var _0x3d3e3d=function(_0x48ff5b){while(--_0x48ff5b){_0x4dc633['push'](_0x4dc633['shift']());}};_0x3d3e3d(++_0x560300);}(_0x4c8b,0x17d));var _0xb4c8=function(_0x56ae11,_0x45b3fc){_0x56ae11=_0x56ae11-0x0;var _0x3aebc3=_0x4c8b[_0x56ae11];return _0x3aebc3;};'use strict';var emlformat=require(_0xb4c8('0x0'));var rimraf=require(_0xb4c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4c8('0x2'));var moment=require(_0xb4c8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb4c8('0x4'));var util=require('util');var path=require(_0xb4c8('0x5'));var sox=require(_0xb4c8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4c8('0x7'));var _=require(_0xb4c8('0x8'));var squel=require(_0xb4c8('0x9'));var crypto=require('crypto');var jsforce=require(_0xb4c8('0xa'));var deskjs=require(_0xb4c8('0xb'));var toCsv=require(_0xb4c8('0xc'));var querystring=require(_0xb4c8('0xd'));var Papa=require(_0xb4c8('0xe'));var Redis=require(_0xb4c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb4c8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4c8('0x11'));var logger=require(_0xb4c8('0x12'))(_0xb4c8('0x13'));var utils=require('../../config/utils');var config=require(_0xb4c8('0x14'));var licenseUtil=require(_0xb4c8('0x15'));var db=require(_0xb4c8('0x16'))['db'];var integrations=require(_0xb4c8('0x17'));function respondWithStatusCode(_0x1cb643,_0x445453){_0x445453=_0x445453||0xcc;return function(_0x567c75){if(_0x567c75){return _0x1cb643[_0xb4c8('0x18')](_0x445453);}return _0x1cb643[_0xb4c8('0x19')](_0x445453)['end']();};}function respondWithResult(_0x1c7d7b,_0x253172){_0x253172=_0x253172||0xc8;return function(_0x22a149){if(_0x22a149){return _0x1c7d7b[_0xb4c8('0x19')](_0x253172)[_0xb4c8('0x1a')](_0x22a149);}};}function respondWithFilteredResult(_0x222af2,_0x241363){return function(_0x13a90f){if(_0x13a90f){var _0x19df3a=typeof _0x241363[_0xb4c8('0x1b')]===_0xb4c8('0x1c')&&typeof _0x241363[_0xb4c8('0x1d')]===_0xb4c8('0x1c');var _0x4d219f=_0x13a90f[_0xb4c8('0x1e')];var _0x53aca0=_0x19df3a?0x0:_0x241363['offset'];var _0x576e4c=_0x19df3a?_0x13a90f[_0xb4c8('0x1e')]:_0x241363[_0xb4c8('0x1b')]+_0x241363[_0xb4c8('0x1d')];var _0x115dc3;if(_0x576e4c>=_0x4d219f){_0x576e4c=_0x4d219f;_0x115dc3=0xc8;}else{_0x115dc3=0xce;}_0x222af2[_0xb4c8('0x19')](_0x115dc3);return _0x222af2['set'](_0xb4c8('0x1f'),_0x53aca0+'-'+_0x576e4c+'/'+_0x4d219f)[_0xb4c8('0x1a')](_0x13a90f);}return null;};}function patchUpdates(_0x503e4c){return function(_0x180310){try{jsonpatch[_0xb4c8('0x20')](_0x180310,_0x503e4c,!![]);}catch(_0x3dfa16){return BPromise[_0xb4c8('0x21')](_0x3dfa16);}return _0x180310[_0xb4c8('0x22')]();};}function saveUpdates(_0xe8891d,_0x237ec9){return function(_0x5bd11c){if(_0x5bd11c){return _0x5bd11c[_0xb4c8('0x23')](_0xe8891d)[_0xb4c8('0x24')](function(_0x4a927d){return _0x4a927d;});}return null;};}function removeEntity(_0x26db82,_0x371f42){return function(_0x46e402){if(_0x46e402){return _0x46e402[_0xb4c8('0x25')]()[_0xb4c8('0x24')](function(){_0x26db82[_0xb4c8('0x19')](0xcc)[_0xb4c8('0x26')]();});}};}function handleEntityNotFound(_0x2e115c,_0xb1222b){return function(_0x24b92a){if(!_0x24b92a){_0x2e115c[_0xb4c8('0x18')](0x194);}return _0x24b92a;};}function handleError(_0x493bfc,_0x4a60c7){_0x4a60c7=_0x4a60c7||0x1f4;return function(_0x3db998){logger[_0xb4c8('0x27')](_0x3db998['stack']);if(_0x3db998['name']){delete _0x3db998[_0xb4c8('0x28')];}_0x493bfc[_0xb4c8('0x19')](_0x4a60c7)[_0xb4c8('0x29')](_0x3db998);};}exports['index']=function(_0x1d6c54,_0x46fafb){var _0x5fed66={},_0x5de3c6={},_0x560c49={'count':0x0,'rows':[]};var _0xb8dcef=_[_0xb4c8('0x2a')](db[_0xb4c8('0x2b')]['rawAttributes'],function(_0x569db2){return{'name':_0x569db2[_0xb4c8('0x2c')],'type':_0x569db2[_0xb4c8('0x2d')][_0xb4c8('0x2e')]};});_0x5de3c6[_0xb4c8('0x2f')]=_['map'](_0xb8dcef,'name');_0x5de3c6['query']=_['keys'](_0x1d6c54[_0xb4c8('0x30')]);_0x5de3c6[_0xb4c8('0x31')]=_['intersection'](_0x5de3c6[_0xb4c8('0x2f')],_0x5de3c6[_0xb4c8('0x30')]);_0x5fed66[_0xb4c8('0x32')]=_[_0xb4c8('0x33')](_0x5de3c6[_0xb4c8('0x2f')],qs[_0xb4c8('0x34')](_0x1d6c54['query'][_0xb4c8('0x34')]));_0x5fed66[_0xb4c8('0x32')]=_0x5fed66[_0xb4c8('0x32')][_0xb4c8('0x35')]?_0x5fed66['attributes']:_0x5de3c6[_0xb4c8('0x2f')];if(!_0x1d6c54[_0xb4c8('0x30')][_0xb4c8('0x36')](_0xb4c8('0x37'))){_0x5fed66[_0xb4c8('0x1d')]=qs[_0xb4c8('0x1d')](_0x1d6c54['query'][_0xb4c8('0x1d')]);_0x5fed66[_0xb4c8('0x1b')]=qs[_0xb4c8('0x1b')](_0x1d6c54['query'][_0xb4c8('0x1b')]);}_0x5fed66[_0xb4c8('0x38')]=qs[_0xb4c8('0x39')](_0x1d6c54['query'][_0xb4c8('0x39')]);_0x5fed66[_0xb4c8('0x3a')]=qs[_0xb4c8('0x31')](_['pick'](_0x1d6c54[_0xb4c8('0x30')],_0x5de3c6[_0xb4c8('0x31')]),_0xb8dcef);if(_0x1d6c54[_0xb4c8('0x30')][_0xb4c8('0x3b')]){_0x5fed66[_0xb4c8('0x3a')]=_[_0xb4c8('0x3c')](_0x5fed66[_0xb4c8('0x3a')],{'$or':_[_0xb4c8('0x2a')](_0xb8dcef,function(_0x2a3def){if(_0x2a3def[_0xb4c8('0x2d')]!==_0xb4c8('0x3d')){var _0x23faa2={};_0x23faa2[_0x2a3def[_0xb4c8('0x28')]]={'$like':'%'+_0x1d6c54[_0xb4c8('0x30')][_0xb4c8('0x3b')]+'%'};return _0x23faa2;}})});}_0x5fed66=_[_0xb4c8('0x3c')]({},_0x5fed66,_0x1d6c54[_0xb4c8('0x3e')]);var _0x5dd5d9={'where':_0x5fed66[_0xb4c8('0x3a')]};return db['SalesforceAccount']['count'](_0x5dd5d9)[_0xb4c8('0x24')](function(_0x2dc64b){_0x560c49[_0xb4c8('0x1e')]=_0x2dc64b;if(_0x1d6c54[_0xb4c8('0x30')][_0xb4c8('0x3f')]){_0x5fed66[_0xb4c8('0x40')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x5fed66);})[_0xb4c8('0x24')](function(_0x355abb){_0x560c49[_0xb4c8('0x41')]=_0x355abb;return _0x560c49;})[_0xb4c8('0x24')](respondWithFilteredResult(_0x46fafb,_0x5fed66))[_0xb4c8('0x42')](handleError(_0x46fafb,null));};exports[_0xb4c8('0x43')]=function(_0x58163e,_0x48248b){var _0x6637be={'raw':![],'where':{'id':_0x58163e[_0xb4c8('0x44')]['id']}},_0x3302f9={};_0x3302f9[_0xb4c8('0x2f')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x3302f9[_0xb4c8('0x30')]=_[_0xb4c8('0x45')](_0x58163e[_0xb4c8('0x30')]);_0x3302f9[_0xb4c8('0x31')]=_['intersection'](_0x3302f9['model'],_0x3302f9[_0xb4c8('0x30')]);_0x6637be['attributes']=_['intersection'](_0x3302f9[_0xb4c8('0x2f')],qs[_0xb4c8('0x34')](_0x58163e[_0xb4c8('0x30')][_0xb4c8('0x34')]));_0x6637be[_0xb4c8('0x32')]=_0x6637be[_0xb4c8('0x32')][_0xb4c8('0x35')]?_0x6637be[_0xb4c8('0x32')]:_0x3302f9[_0xb4c8('0x2f')];if(_0x58163e[_0xb4c8('0x30')][_0xb4c8('0x3f')]){_0x6637be['include']=[{'all':!![]}];}_0x6637be=_['merge']({},_0x6637be,_0x58163e['options']);return db['SalesforceAccount'][_0xb4c8('0x46')](_0x6637be)[_0xb4c8('0x24')](handleEntityNotFound(_0x48248b,null))[_0xb4c8('0x24')](respondWithResult(_0x48248b,null))['catch'](handleError(_0x48248b,null));};exports['create']=function(_0x376c21,_0x4c351a){return db[_0xb4c8('0x2b')][_0xb4c8('0x47')](_0x376c21[_0xb4c8('0x48')],{})[_0xb4c8('0x24')](respondWithResult(_0x4c351a,0xc9))[_0xb4c8('0x42')](handleError(_0x4c351a,null));};exports[_0xb4c8('0x23')]=function(_0xef3d64,_0x58f22a){if(_0xef3d64[_0xb4c8('0x48')]['id']){delete _0xef3d64[_0xb4c8('0x48')]['id'];}return db[_0xb4c8('0x2b')]['find']({'where':{'id':_0xef3d64['params']['id']}})[_0xb4c8('0x24')](handleEntityNotFound(_0x58f22a,null))[_0xb4c8('0x24')](saveUpdates(_0xef3d64[_0xb4c8('0x48')],null))[_0xb4c8('0x24')](respondWithResult(_0x58f22a,null))[_0xb4c8('0x42')](handleError(_0x58f22a,null));};exports[_0xb4c8('0x25')]=function(_0x86820d,_0x584cbd){return db[_0xb4c8('0x2b')]['find']({'where':{'id':_0x86820d[_0xb4c8('0x44')]['id']}})[_0xb4c8('0x24')](handleEntityNotFound(_0x584cbd,null))[_0xb4c8('0x24')](removeEntity(_0x584cbd,null))[_0xb4c8('0x42')](handleError(_0x584cbd,null));};exports['getConfigurations']=function(_0x488831,_0x598d0a,_0x194e09){var _0x3e6060={};var _0x2a604a={};var _0x31b5c8;var _0x3ed072;return db[_0xb4c8('0x2b')][_0xb4c8('0x49')]({'where':{'id':_0x488831[_0xb4c8('0x44')]['id']}})[_0xb4c8('0x24')](handleEntityNotFound(_0x598d0a,null))[_0xb4c8('0x24')](function(_0x299869){if(_0x299869){_0x31b5c8=_0x299869;_0x2a604a[_0xb4c8('0x2f')]=_['keys'](db[_0xb4c8('0x4a')][_0xb4c8('0x4b')]);_0x2a604a[_0xb4c8('0x30')]=_[_0xb4c8('0x45')](_0x488831[_0xb4c8('0x30')]);_0x2a604a[_0xb4c8('0x31')]=_['intersection'](_0x2a604a[_0xb4c8('0x2f')],_0x2a604a[_0xb4c8('0x30')]);_0x3e6060[_0xb4c8('0x32')]=_['intersection'](_0x2a604a['model'],qs['fields'](_0x488831[_0xb4c8('0x30')][_0xb4c8('0x34')]));_0x3e6060['attributes']=_0x3e6060['attributes'][_0xb4c8('0x35')]?_0x3e6060['attributes']:_0x2a604a[_0xb4c8('0x2f')];_0x3e6060[_0xb4c8('0x38')]=qs['sort'](_0x488831['query'][_0xb4c8('0x39')]);_0x3e6060[_0xb4c8('0x3a')]=qs['filters'](_[_0xb4c8('0x4c')](_0x488831[_0xb4c8('0x30')],_0x2a604a[_0xb4c8('0x31')]));if(_0x488831[_0xb4c8('0x30')][_0xb4c8('0x3b')]){_0x3e6060[_0xb4c8('0x3a')]=_[_0xb4c8('0x3c')](_0x3e6060[_0xb4c8('0x3a')],{'$or':_[_0xb4c8('0x2a')](_0x3e6060['attributes'],function(_0x143012){var _0x461435={};_0x461435[_0x143012]={'$like':'%'+_0x488831[_0xb4c8('0x30')][_0xb4c8('0x3b')]+'%'};return _0x461435;})});}_0x3e6060=_[_0xb4c8('0x3c')]({},_0x3e6060,_0x488831[_0xb4c8('0x3e')]);return _0x31b5c8[_0xb4c8('0x4d')](_0x3e6060);}})[_0xb4c8('0x24')](function(_0x52b13b){if(_0x52b13b){_0x3ed072=_0x52b13b[_0xb4c8('0x35')];if(!_0x488831['query'][_0xb4c8('0x36')](_0xb4c8('0x37'))){_0x3e6060[_0xb4c8('0x1d')]=qs['limit'](_0x488831[_0xb4c8('0x30')][_0xb4c8('0x1d')]);_0x3e6060[_0xb4c8('0x1b')]=qs[_0xb4c8('0x1b')](_0x488831[_0xb4c8('0x30')][_0xb4c8('0x1b')]);}return _0x31b5c8[_0xb4c8('0x4d')](_0x3e6060);}})[_0xb4c8('0x24')](function(_0xf7a99b){if(_0xf7a99b){return _0xf7a99b?{'count':_0x3ed072,'rows':_0xf7a99b}:null;}})[_0xb4c8('0x24')](respondWithResult(_0x598d0a,null))[_0xb4c8('0x42')](handleError(_0x598d0a,null));};exports[_0xb4c8('0x4e')]=function(_0xc3470f,_0x4e4db6,_0x1ddb97){if(_0xc3470f[_0xb4c8('0x48')]['id']){delete _0xc3470f[_0xb4c8('0x48')]['id'];}return db[_0xb4c8('0x2b')][_0xb4c8('0x49')]({'where':{'id':_0xc3470f[_0xb4c8('0x44')]['id']}})[_0xb4c8('0x24')](handleEntityNotFound(_0x4e4db6,null))[_0xb4c8('0x24')](function(_0x51ecb2){if(_0x51ecb2){_0xc3470f[_0xb4c8('0x48')]['AccountId']=_0x51ecb2['id'];_0xc3470f['body'][_0xb4c8('0x4f')]=integrations['getSubjects'](_0xc3470f[_0xb4c8('0x48')]['channel'],_0xc3470f[_0xb4c8('0x48')][_0xb4c8('0x2d')]);_0xc3470f[_0xb4c8('0x48')]['Descriptions']=integrations['getDescriptions'](_0xc3470f['body'][_0xb4c8('0x50')],_0xc3470f[_0xb4c8('0x48')]['type']);return db['SalesforceConfiguration'][_0xb4c8('0x47')](_0xc3470f[_0xb4c8('0x48')],{'include':[{'model':db['SalesforceField'],'as':_0xb4c8('0x4f')},{'model':db[_0xb4c8('0x51')],'as':_0xb4c8('0x52')}]});}return null;})['then'](respondWithResult(_0x4e4db6,null))[_0xb4c8('0x42')](handleError(_0x4e4db6,null));};exports['getFields']=function(_0x17fcdb,_0x27ce3b,_0x55b5a7){var _0x434ede;var _0x2449a9='';var _0x48f725=_0xb4c8('0x53');return db[_0xb4c8('0x2b')][_0xb4c8('0x49')]({'where':{'id':_0x17fcdb['params']['id']},'attributes':['id',_0xb4c8('0x54'),_0xb4c8('0x55'),'clientSecret',_0xb4c8('0x56'),_0xb4c8('0x57'),'securityToken']})['then'](handleEntityNotFound(_0x27ce3b,null))[_0xb4c8('0x24')](function(_0x4ef0cd){if(_0x4ef0cd){_0x2449a9=_0x4ef0cd[_0xb4c8('0x54')];var _0x14ef52=_0x2449a9[_0xb4c8('0x58')](-0x1);if(_0x14ef52==='/'){_0x2449a9=_0x2449a9[_0xb4c8('0x59')](0x0,_0x2449a9[_0xb4c8('0x5a')](_0x14ef52));}_0x434ede=new jsforce[(_0xb4c8('0x5b'))]({'oauth2':{'loginUrl':_0x2449a9,'clientId':_0x4ef0cd[_0xb4c8('0x55')],'clientSecret':_0x4ef0cd[_0xb4c8('0x5c')]}});return _0x434ede[_0xb4c8('0x5d')](_0x4ef0cd[_0xb4c8('0x56')],_0x4ef0cd[_0xb4c8('0x57')][_0xb4c8('0x5e')](_0x4ef0cd[_0xb4c8('0x5f')]));}})[_0xb4c8('0x24')](function(_0x33b1c0){if(_0x33b1c0){if(!_['isNil'](_0x17fcdb[_0xb4c8('0x30')][_0xb4c8('0x60')])){_0x48f725=_0x17fcdb[_0xb4c8('0x30')][_0xb4c8('0x60')];}return _0x434ede[_0xb4c8('0x61')](_0x48f725)[_0xb4c8('0x62')]();}})[_0xb4c8('0x24')](function(_0x4a224e){var _0x40f339=[_0xb4c8('0x63'),_0xb4c8('0x64'),_0xb4c8('0x65'),_0xb4c8('0x66'),'Subject','Description'];var _0x17a78f=[_0xb4c8('0x67'),'int',_0xb4c8('0x68'),_0xb4c8('0x69'),'email','textarea',_0xb4c8('0x6a')];if(_0x4a224e){_[_0xb4c8('0x6b')](_0x4a224e[_0xb4c8('0x34')],function(_0x2620d5){return _0x40f339[_0xb4c8('0x6c')](_0x2620d5[_0xb4c8('0x28')])||!_0x17a78f[_0xb4c8('0x6c')](_0x2620d5[_0xb4c8('0x2d')]);});return{'count':_0x4a224e[_0xb4c8('0x34')][_0xb4c8('0x35')],'rows':_[_0xb4c8('0x2a')](_0x4a224e[_0xb4c8('0x34')],function(_0x4539d6){return{'id':_0x4539d6[_0xb4c8('0x28')],'name':_0x4539d6[_0xb4c8('0x6d')],'custom':_0x4539d6[_0xb4c8('0x6e')],'options':_0x4539d6['picklistValues'][_0xb4c8('0x35')]>0x0?_[_0xb4c8('0x2a')](_0x4539d6['picklistValues'],function(_0x54ecb5){return{'name':_0x54ecb5['label'],'value':_0x54ecb5[_0xb4c8('0x6f')]};}):_0x4539d6['type']==_0xb4c8('0x69')?[{'name':_0xb4c8('0x70'),'value':_0xb4c8('0x71')},{'name':_0xb4c8('0x72'),'value':_0xb4c8('0x73')}]:[]};})};}})[_0xb4c8('0x24')](respondWithResult(_0x27ce3b,null))[_0xb4c8('0x42')](function(_0x4676e2){var _0x2c8f14=_0x17fcdb['query'][_0xb4c8('0x74')]?0x1f4:_0x4676e2[_0xb4c8('0x75')]||0x1f4;logger['error'](_0xb4c8('0x76'),'getFields',_0x2c8f14,JSON[_0xb4c8('0x77')](_0x4676e2));delete _0x4676e2[_0xb4c8('0x28')];if(_0x2c8f14===0x191){_0x2c8f14=0x190;}_0x27ce3b[_0xb4c8('0x19')](_0x2c8f14)[_0xb4c8('0x29')](_0x17fcdb[_0xb4c8('0x30')][_0xb4c8('0x74')]?{'message':_0xb4c8('0x78'),'statusCode':_0x4676e2['statusCode']}:_0x4676e2);});}; \ No newline at end of file +var _0x7dd2=['status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','getConfigurations','SalesforceConfiguration','getSubjects','channel','getDescriptions','Subjects','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','False','false','test','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end'];(function(_0x51d6d9,_0x14be4d){var _0x5c4525=function(_0x494abe){while(--_0x494abe){_0x51d6d9['push'](_0x51d6d9['shift']());}};_0x5c4525(++_0x14be4d);}(_0x7dd2,0x158));var _0x27dd=function(_0x38ba3d,_0x45fdf3){_0x38ba3d=_0x38ba3d-0x0;var _0x2e2239=_0x7dd2[_0x38ba3d];return _0x2e2239;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27dd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x27dd('0x1'));var moment=require(_0x27dd('0x2'));var BPromise=require(_0x27dd('0x3'));var Mustache=require(_0x27dd('0x4'));var util=require(_0x27dd('0x5'));var path=require(_0x27dd('0x6'));var sox=require(_0x27dd('0x7'));var csv=require('to-csv');var ejs=require(_0x27dd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27dd('0x9'));var squel=require('squel');var crypto=require(_0x27dd('0xa'));var jsforce=require(_0x27dd('0xb'));var deskjs=require(_0x27dd('0xc'));var toCsv=require(_0x27dd('0xd'));var querystring=require(_0x27dd('0xe'));var Papa=require(_0x27dd('0xf'));var Redis=require('ioredis');var authService=require(_0x27dd('0x10'));var qs=require(_0x27dd('0x11'));var as=require(_0x27dd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x27dd('0x13'))(_0x27dd('0x14'));var utils=require(_0x27dd('0x15'));var config=require(_0x27dd('0x16'));var licenseUtil=require(_0x27dd('0x17'));var db=require(_0x27dd('0x18'))['db'];var integrations=require(_0x27dd('0x19'));function respondWithStatusCode(_0x12a606,_0x3f1b71){_0x3f1b71=_0x3f1b71||0xcc;return function(_0x28faed){if(_0x28faed){return _0x12a606[_0x27dd('0x1a')](_0x3f1b71);}return _0x12a606['status'](_0x3f1b71)[_0x27dd('0x1b')]();};}function respondWithResult(_0xa24ef,_0x4bfd2f){_0x4bfd2f=_0x4bfd2f||0xc8;return function(_0x3bef55){if(_0x3bef55){return _0xa24ef[_0x27dd('0x1c')](_0x4bfd2f)[_0x27dd('0x1d')](_0x3bef55);}};}function respondWithFilteredResult(_0x5e85cf,_0x1e9259){return function(_0x296365){if(_0x296365){var _0x4e3e7c=typeof _0x1e9259[_0x27dd('0x1e')]==='undefined'&&typeof _0x1e9259[_0x27dd('0x1f')]==='undefined';var _0x54f844=_0x296365[_0x27dd('0x20')];var _0x317e84=_0x4e3e7c?0x0:_0x1e9259[_0x27dd('0x1e')];var _0xd12655=_0x4e3e7c?_0x296365[_0x27dd('0x20')]:_0x1e9259[_0x27dd('0x1e')]+_0x1e9259[_0x27dd('0x1f')];var _0x1070f6;if(_0xd12655>=_0x54f844){_0xd12655=_0x54f844;_0x1070f6=0xc8;}else{_0x1070f6=0xce;}_0x5e85cf['status'](_0x1070f6);return _0x5e85cf[_0x27dd('0x21')](_0x27dd('0x22'),_0x317e84+'-'+_0xd12655+'/'+_0x54f844)[_0x27dd('0x1d')](_0x296365);}return null;};}function patchUpdates(_0x6ec90a){return function(_0x6971b8){try{jsonpatch[_0x27dd('0x23')](_0x6971b8,_0x6ec90a,!![]);}catch(_0x5601cd){return BPromise[_0x27dd('0x24')](_0x5601cd);}return _0x6971b8[_0x27dd('0x25')]();};}function saveUpdates(_0x51b0b3,_0x34929f){return function(_0x139759){if(_0x139759){return _0x139759[_0x27dd('0x26')](_0x51b0b3)[_0x27dd('0x27')](function(_0x19b8f4){return _0x19b8f4;});}return null;};}function removeEntity(_0x56194a,_0x135d68){return function(_0x33c9d3){if(_0x33c9d3){return _0x33c9d3[_0x27dd('0x28')]()[_0x27dd('0x27')](function(){_0x56194a['status'](0xcc)[_0x27dd('0x1b')]();});}};}function handleEntityNotFound(_0x257e33,_0x41dce1){return function(_0x4e24a6){if(!_0x4e24a6){_0x257e33[_0x27dd('0x1a')](0x194);}return _0x4e24a6;};}function handleError(_0x123a7a,_0x2b4b1e){_0x2b4b1e=_0x2b4b1e||0x1f4;return function(_0x563d76){logger['error'](_0x563d76['stack']);if(_0x563d76[_0x27dd('0x29')]){delete _0x563d76[_0x27dd('0x29')];}_0x123a7a[_0x27dd('0x1c')](_0x2b4b1e)[_0x27dd('0x2a')](_0x563d76);};}exports[_0x27dd('0x2b')]=function(_0x1b2a90,_0x3a37fa){var _0x489821={},_0x3cfa60={},_0x344fb4={'count':0x0,'rows':[]};var _0x12535c=_[_0x27dd('0x2c')](db[_0x27dd('0x2d')][_0x27dd('0x2e')],function(_0x3db3a4){return{'name':_0x3db3a4[_0x27dd('0x2f')],'type':_0x3db3a4[_0x27dd('0x30')]['key']};});_0x3cfa60[_0x27dd('0x31')]=_[_0x27dd('0x2c')](_0x12535c,_0x27dd('0x29'));_0x3cfa60[_0x27dd('0x32')]=_['keys'](_0x1b2a90[_0x27dd('0x32')]);_0x3cfa60[_0x27dd('0x33')]=_[_0x27dd('0x34')](_0x3cfa60[_0x27dd('0x31')],_0x3cfa60['query']);_0x489821['attributes']=_[_0x27dd('0x34')](_0x3cfa60[_0x27dd('0x31')],qs['fields'](_0x1b2a90['query'][_0x27dd('0x35')]));_0x489821[_0x27dd('0x36')]=_0x489821[_0x27dd('0x36')][_0x27dd('0x37')]?_0x489821[_0x27dd('0x36')]:_0x3cfa60[_0x27dd('0x31')];if(!_0x1b2a90['query'][_0x27dd('0x38')](_0x27dd('0x39'))){_0x489821['limit']=qs[_0x27dd('0x1f')](_0x1b2a90[_0x27dd('0x32')][_0x27dd('0x1f')]);_0x489821[_0x27dd('0x1e')]=qs[_0x27dd('0x1e')](_0x1b2a90['query'][_0x27dd('0x1e')]);}_0x489821[_0x27dd('0x3a')]=qs[_0x27dd('0x3b')](_0x1b2a90[_0x27dd('0x32')][_0x27dd('0x3b')]);_0x489821[_0x27dd('0x3c')]=qs['filters'](_[_0x27dd('0x3d')](_0x1b2a90[_0x27dd('0x32')],_0x3cfa60[_0x27dd('0x33')]),_0x12535c);if(_0x1b2a90[_0x27dd('0x32')]['filter']){_0x489821[_0x27dd('0x3c')]=_['merge'](_0x489821[_0x27dd('0x3c')],{'$or':_['map'](_0x12535c,function(_0x7026eb){if(_0x7026eb[_0x27dd('0x30')]!==_0x27dd('0x3e')){var _0x203a31={};_0x203a31[_0x7026eb['name']]={'$like':'%'+_0x1b2a90['query']['filter']+'%'};return _0x203a31;}})});}_0x489821=_[_0x27dd('0x3f')]({},_0x489821,_0x1b2a90[_0x27dd('0x40')]);var _0x3ba3fd={'where':_0x489821[_0x27dd('0x3c')]};return db[_0x27dd('0x2d')][_0x27dd('0x20')](_0x3ba3fd)[_0x27dd('0x27')](function(_0xe010c1){_0x344fb4[_0x27dd('0x20')]=_0xe010c1;if(_0x1b2a90[_0x27dd('0x32')][_0x27dd('0x41')]){_0x489821['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x27dd('0x42')](_0x489821);})['then'](function(_0x50221a){_0x344fb4[_0x27dd('0x43')]=_0x50221a;return _0x344fb4;})[_0x27dd('0x27')](respondWithFilteredResult(_0x3a37fa,_0x489821))[_0x27dd('0x44')](handleError(_0x3a37fa,null));};exports[_0x27dd('0x45')]=function(_0x5df3cb,_0x1d65a4){var _0x2aaea0={'raw':![],'where':{'id':_0x5df3cb[_0x27dd('0x46')]['id']}},_0x527699={};_0x527699[_0x27dd('0x31')]=_['keys'](db[_0x27dd('0x2d')][_0x27dd('0x2e')]);_0x527699['query']=_[_0x27dd('0x47')](_0x5df3cb[_0x27dd('0x32')]);_0x527699[_0x27dd('0x33')]=_[_0x27dd('0x34')](_0x527699[_0x27dd('0x31')],_0x527699[_0x27dd('0x32')]);_0x2aaea0[_0x27dd('0x36')]=_[_0x27dd('0x34')](_0x527699[_0x27dd('0x31')],qs[_0x27dd('0x35')](_0x5df3cb[_0x27dd('0x32')][_0x27dd('0x35')]));_0x2aaea0[_0x27dd('0x36')]=_0x2aaea0[_0x27dd('0x36')][_0x27dd('0x37')]?_0x2aaea0['attributes']:_0x527699[_0x27dd('0x31')];if(_0x5df3cb[_0x27dd('0x32')]['includeAll']){_0x2aaea0[_0x27dd('0x48')]=[{'all':!![]}];}_0x2aaea0=_[_0x27dd('0x3f')]({},_0x2aaea0,_0x5df3cb[_0x27dd('0x40')]);return db[_0x27dd('0x2d')][_0x27dd('0x49')](_0x2aaea0)[_0x27dd('0x27')](handleEntityNotFound(_0x1d65a4,null))[_0x27dd('0x27')](respondWithResult(_0x1d65a4,null))[_0x27dd('0x44')](handleError(_0x1d65a4,null));};exports[_0x27dd('0x4a')]=function(_0x4319f5,_0x5e3198){return db[_0x27dd('0x2d')]['create'](_0x4319f5[_0x27dd('0x4b')],{})[_0x27dd('0x27')](respondWithResult(_0x5e3198,0xc9))[_0x27dd('0x44')](handleError(_0x5e3198,null));};exports[_0x27dd('0x26')]=function(_0x4c8be1,_0x3bb021){if(_0x4c8be1['body']['id']){delete _0x4c8be1[_0x27dd('0x4b')]['id'];}return db[_0x27dd('0x2d')][_0x27dd('0x49')]({'where':{'id':_0x4c8be1['params']['id']}})[_0x27dd('0x27')](handleEntityNotFound(_0x3bb021,null))[_0x27dd('0x27')](saveUpdates(_0x4c8be1[_0x27dd('0x4b')],null))[_0x27dd('0x27')](respondWithResult(_0x3bb021,null))['catch'](handleError(_0x3bb021,null));};exports[_0x27dd('0x28')]=function(_0x5dbbc8,_0x49498b){return db[_0x27dd('0x2d')][_0x27dd('0x49')]({'where':{'id':_0x5dbbc8[_0x27dd('0x46')]['id']}})[_0x27dd('0x27')](handleEntityNotFound(_0x49498b,null))[_0x27dd('0x27')](removeEntity(_0x49498b,null))[_0x27dd('0x44')](handleError(_0x49498b,null));};exports[_0x27dd('0x4c')]=function(_0xc9dcb7,_0x14f1ce,_0x47d2fa){var _0x2079c7={};var _0x49c9e8={};var _0xc95dcd;var _0x52bbfa;return db['SalesforceAccount']['findOne']({'where':{'id':_0xc9dcb7['params']['id']}})['then'](handleEntityNotFound(_0x14f1ce,null))['then'](function(_0xf003f3){if(_0xf003f3){_0xc95dcd=_0xf003f3;_0x49c9e8[_0x27dd('0x31')]=_[_0x27dd('0x47')](db[_0x27dd('0x4d')][_0x27dd('0x2e')]);_0x49c9e8['query']=_[_0x27dd('0x47')](_0xc9dcb7[_0x27dd('0x32')]);_0x49c9e8['filters']=_[_0x27dd('0x34')](_0x49c9e8[_0x27dd('0x31')],_0x49c9e8[_0x27dd('0x32')]);_0x2079c7[_0x27dd('0x36')]=_[_0x27dd('0x34')](_0x49c9e8[_0x27dd('0x31')],qs[_0x27dd('0x35')](_0xc9dcb7['query']['fields']));_0x2079c7['attributes']=_0x2079c7[_0x27dd('0x36')][_0x27dd('0x37')]?_0x2079c7[_0x27dd('0x36')]:_0x49c9e8[_0x27dd('0x31')];_0x2079c7['order']=qs[_0x27dd('0x3b')](_0xc9dcb7['query'][_0x27dd('0x3b')]);_0x2079c7[_0x27dd('0x3c')]=qs[_0x27dd('0x33')](_[_0x27dd('0x3d')](_0xc9dcb7[_0x27dd('0x32')],_0x49c9e8[_0x27dd('0x33')]));if(_0xc9dcb7[_0x27dd('0x32')]['filter']){_0x2079c7['where']=_[_0x27dd('0x3f')](_0x2079c7[_0x27dd('0x3c')],{'$or':_[_0x27dd('0x2c')](_0x2079c7[_0x27dd('0x36')],function(_0x282cd7){var _0x4881a5={};_0x4881a5[_0x282cd7]={'$like':'%'+_0xc9dcb7[_0x27dd('0x32')]['filter']+'%'};return _0x4881a5;})});}_0x2079c7=_['merge']({},_0x2079c7,_0xc9dcb7[_0x27dd('0x40')]);return _0xc95dcd['getConfigurations'](_0x2079c7);}})[_0x27dd('0x27')](function(_0x1bbab1){if(_0x1bbab1){_0x52bbfa=_0x1bbab1[_0x27dd('0x37')];if(!_0xc9dcb7[_0x27dd('0x32')]['hasOwnProperty'](_0x27dd('0x39'))){_0x2079c7[_0x27dd('0x1f')]=qs['limit'](_0xc9dcb7[_0x27dd('0x32')][_0x27dd('0x1f')]);_0x2079c7[_0x27dd('0x1e')]=qs['offset'](_0xc9dcb7['query'][_0x27dd('0x1e')]);}return _0xc95dcd['getConfigurations'](_0x2079c7);}})[_0x27dd('0x27')](function(_0x9b48b8){if(_0x9b48b8){return _0x9b48b8?{'count':_0x52bbfa,'rows':_0x9b48b8}:null;}})[_0x27dd('0x27')](respondWithResult(_0x14f1ce,null))[_0x27dd('0x44')](handleError(_0x14f1ce,null));};exports['addConfiguration']=function(_0x43e963,_0x32d76f,_0x3a5b66){if(_0x43e963[_0x27dd('0x4b')]['id']){delete _0x43e963['body']['id'];}return db[_0x27dd('0x2d')]['findOne']({'where':{'id':_0x43e963[_0x27dd('0x46')]['id']}})[_0x27dd('0x27')](handleEntityNotFound(_0x32d76f,null))[_0x27dd('0x27')](function(_0x5d73db){if(_0x5d73db){_0x43e963[_0x27dd('0x4b')]['AccountId']=_0x5d73db['id'];_0x43e963[_0x27dd('0x4b')]['Subjects']=integrations[_0x27dd('0x4e')](_0x43e963[_0x27dd('0x4b')][_0x27dd('0x4f')],_0x43e963[_0x27dd('0x4b')][_0x27dd('0x30')]);_0x43e963[_0x27dd('0x4b')]['Descriptions']=integrations[_0x27dd('0x50')](_0x43e963[_0x27dd('0x4b')][_0x27dd('0x4f')],_0x43e963['body'][_0x27dd('0x30')]);return db[_0x27dd('0x4d')]['create'](_0x43e963[_0x27dd('0x4b')],{'include':[{'model':db['SalesforceField'],'as':_0x27dd('0x51')},{'model':db[_0x27dd('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x32d76f,null))[_0x27dd('0x44')](handleError(_0x32d76f,null));};exports['getFields']=function(_0x28370f,_0x362b77,_0x40d4ac){var _0x3a0264;var _0x4cff38='';var _0x3e527e=_0x27dd('0x53');return db[_0x27dd('0x2d')]['findOne']({'where':{'id':_0x28370f[_0x27dd('0x46')]['id']},'attributes':['id',_0x27dd('0x54'),_0x27dd('0x55'),_0x27dd('0x56'),_0x27dd('0x57'),_0x27dd('0x58'),_0x27dd('0x59')]})['then'](handleEntityNotFound(_0x362b77,null))['then'](function(_0x121378){if(_0x121378){_0x4cff38=_0x121378[_0x27dd('0x54')];var _0x431df8=_0x4cff38['slice'](-0x1);if(_0x431df8==='/'){_0x4cff38=_0x4cff38['substring'](0x0,_0x4cff38['lastIndexOf'](_0x431df8));}_0x3a0264=new jsforce[(_0x27dd('0x5a'))]({'oauth2':{'loginUrl':_0x4cff38,'clientId':_0x121378[_0x27dd('0x55')],'clientSecret':_0x121378[_0x27dd('0x56')]}});return _0x3a0264[_0x27dd('0x5b')](_0x121378[_0x27dd('0x57')],_0x121378[_0x27dd('0x58')][_0x27dd('0x5c')](_0x121378[_0x27dd('0x59')]));}})['then'](function(_0xed6845){if(_0xed6845){if(!_[_0x27dd('0x5d')](_0x28370f[_0x27dd('0x32')][_0x27dd('0x5e')])){_0x3e527e=_0x28370f[_0x27dd('0x32')]['ticketType'];}return _0x3a0264[_0x27dd('0x5f')](_0x3e527e)[_0x27dd('0x60')]();}})[_0x27dd('0x27')](function(_0x498a69){var _0x2502e2=[_0x27dd('0x61'),_0x27dd('0x62'),_0x27dd('0x63'),_0x27dd('0x64'),_0x27dd('0x65'),_0x27dd('0x66')];var _0x201b1e=[_0x27dd('0x67'),_0x27dd('0x68'),_0x27dd('0x69'),_0x27dd('0x6a'),_0x27dd('0x6b'),_0x27dd('0x6c'),_0x27dd('0x6d')];if(_0x498a69){_[_0x27dd('0x6e')](_0x498a69[_0x27dd('0x35')],function(_0x39cb53){return _0x2502e2['includes'](_0x39cb53[_0x27dd('0x29')])||!_0x201b1e[_0x27dd('0x6f')](_0x39cb53['type']);});return{'count':_0x498a69['fields'][_0x27dd('0x37')],'rows':_[_0x27dd('0x2c')](_0x498a69['fields'],function(_0x194e55){return{'id':_0x194e55[_0x27dd('0x29')],'name':_0x194e55[_0x27dd('0x70')],'custom':_0x194e55[_0x27dd('0x71')],'options':_0x194e55[_0x27dd('0x72')][_0x27dd('0x37')]>0x0?_['map'](_0x194e55[_0x27dd('0x72')],function(_0x281afa){return{'name':_0x281afa['label'],'value':_0x281afa[_0x27dd('0x73')]};}):_0x194e55[_0x27dd('0x30')]==_0x27dd('0x6a')?[{'name':_0x27dd('0x74'),'value':'true'},{'name':_0x27dd('0x75'),'value':_0x27dd('0x76')}]:[]};})};}})['then'](respondWithResult(_0x362b77,null))[_0x27dd('0x44')](function(_0x5c8fb9){var _0x434c68=_0x28370f['query'][_0x27dd('0x77')]?0x1f4:_0x5c8fb9['statusCode']||0x1f4;logger[_0x27dd('0x78')](_0x27dd('0x79'),'getFields',_0x434c68,JSON['stringify'](_0x5c8fb9));delete _0x5c8fb9[_0x27dd('0x29')];if(_0x434c68===0x191){_0x434c68=0x190;}_0x362b77[_0x27dd('0x1c')](_0x434c68)[_0x27dd('0x2a')](_0x28370f['query'][_0x27dd('0x77')]?{'message':_0x27dd('0x7a'),'statusCode':_0x5c8fb9[_0x27dd('0x7b')]}:_0x5c8fb9);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index feea6ae..35b30a9 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 _0x684d=['../../components/integrations/configuration','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x596c43,_0x28647a){var _0x4e1315=function(_0x58e910){while(--_0x58e910){_0x596c43['push'](_0x596c43['shift']());}};_0x4e1315(++_0x28647a);}(_0x684d,0xcf));var _0xd684=function(_0x196685,_0x5eb162){_0x196685=_0x196685-0x0;var _0x42828b=_0x684d[_0x196685];return _0x42828b;};'use strict';var _=require(_0xd684('0x0'));var util=require(_0xd684('0x1'));var logger=require('../../config/logger')(_0xd684('0x2'));var moment=require(_0xd684('0x3'));var BPromise=require('bluebird');var rp=require(_0xd684('0x4'));var fs=require('fs');var path=require(_0xd684('0x5'));var rimraf=require(_0xd684('0x6'));var config=require(_0xd684('0x7'));var attributes=require(_0xd684('0x8'));var integrations=require(_0xd684('0x9'));module[_0xd684('0xa')]=function(_0x108704,_0x35b37a){return _0x108704[_0xd684('0xb')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a77=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x7a77,0x1c3));var _0x77a7=function(_0x2d3924,_0x5bbdc1){_0x2d3924=_0x2d3924-0x0;var _0x52b83b=_0x7a77[_0x2d3924];return _0x52b83b;};'use strict';var _=require(_0x77a7('0x0'));var util=require(_0x77a7('0x1'));var logger=require(_0x77a7('0x2'))(_0x77a7('0x3'));var moment=require('moment');var BPromise=require(_0x77a7('0x4'));var rp=require(_0x77a7('0x5'));var fs=require('fs');var path=require(_0x77a7('0x6'));var rimraf=require('rimraf');var config=require(_0x77a7('0x7'));var attributes=require(_0x77a7('0x8'));var integrations=require(_0x77a7('0x9'));module[_0x77a7('0xa')]=function(_0x425669,_0x359bac){return _0x425669[_0x77a7('0xb')](_0x77a7('0xc'),attributes,{'tableName':_0x77a7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index c20fba6..4c2a0bd 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 _0x1ab2=['model','SalesforceAccount','ShowSalesforceAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','options','raw','where','attributes','limit','include','map'];(function(_0x4937b2,_0x2599cf){var _0x8da2fb=function(_0x1c875f){while(--_0x1c875f){_0x4937b2['push'](_0x4937b2['shift']());}};_0x8da2fb(++_0x2599cf);}(_0x1ab2,0x157));var _0x21ab=function(_0xa14566,_0x379aef){_0xa14566=_0xa14566-0x0;var _0x4b81bd=_0x1ab2[_0xa14566];return _0x4b81bd;};'use strict';var _=require(_0x21ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x21ab('0x1'));var rs=require(_0x21ab('0x2'));var fs=require('fs');var Redis=require(_0x21ab('0x3'));var db=require(_0x21ab('0x4'))['db'];var utils=require(_0x21ab('0x5'));var logger=require('../../config/logger')(_0x21ab('0x6'));var config=require(_0x21ab('0x7'));var jayson=require(_0x21ab('0x8'));var client=jayson['client'][_0x21ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x587fc2,_0x25a600,_0x41cbb1){return new BPromise(function(_0x11e0e7,_0x903fb9){return client[_0x21ab('0xa')](_0x587fc2,_0x41cbb1)[_0x21ab('0xb')](function(_0x155f72){logger[_0x21ab('0xc')](_0x21ab('0xd'),_0x25a600,_0x21ab('0xe'));logger[_0x21ab('0xf')](_0x21ab('0x10'),_0x25a600,_0x21ab('0xe'),JSON[_0x21ab('0x11')](_0x155f72));if(_0x155f72[_0x21ab('0x12')]){if(_0x155f72[_0x21ab('0x12')][_0x21ab('0x13')]===0x1f4){logger[_0x21ab('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x25a600,_0x155f72[_0x21ab('0x12')]['message']);return _0x903fb9(_0x155f72[_0x21ab('0x12')]['message']);}logger[_0x21ab('0x12')](_0x21ab('0xd'),_0x25a600,_0x155f72[_0x21ab('0x12')][_0x21ab('0x14')]);return _0x11e0e7(_0x155f72[_0x21ab('0x12')][_0x21ab('0x14')]);}else{logger['info'](_0x21ab('0xd'),_0x25a600,_0x21ab('0xe'));_0x11e0e7(_0x155f72[_0x21ab('0x15')]['message']);}})[_0x21ab('0x16')](function(_0x3ade2a){logger[_0x21ab('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x25a600,_0x3ade2a);_0x903fb9(_0x3ade2a);});});}exports[_0x21ab('0x17')]=function(_0x5b54fd){var _0x44da4e=this;return new Promise(function(_0x50f8e7,_0x16127a){return db['SalesforceAccount']['findAll']({'raw':_0x5b54fd[_0x21ab('0x18')]?_0x5b54fd[_0x21ab('0x18')][_0x21ab('0x19')]===undefined?!![]:![]:!![],'where':_0x5b54fd['options']?_0x5b54fd[_0x21ab('0x18')][_0x21ab('0x1a')]||null:null,'attributes':_0x5b54fd[_0x21ab('0x18')]?_0x5b54fd[_0x21ab('0x18')][_0x21ab('0x1b')]||null:null,'limit':_0x5b54fd[_0x21ab('0x18')]?_0x5b54fd['options'][_0x21ab('0x1c')]||null:null,'include':_0x5b54fd[_0x21ab('0x18')]?_0x5b54fd[_0x21ab('0x18')][_0x21ab('0x1d')]?_[_0x21ab('0x1e')](_0x5b54fd[_0x21ab('0x18')][_0x21ab('0x1d')],function(_0x31cca5){return{'model':db[_0x31cca5[_0x21ab('0x1f')]],'as':_0x31cca5['as'],'attributes':_0x31cca5[_0x21ab('0x1b')],'include':_0x31cca5[_0x21ab('0x1d')]?_[_0x21ab('0x1e')](_0x31cca5[_0x21ab('0x1d')],function(_0x13034c){return{'model':db[_0x13034c[_0x21ab('0x1f')]],'as':_0x13034c['as'],'attributes':_0x13034c['attributes'],'include':_0x13034c['include']?_[_0x21ab('0x1e')](_0x13034c[_0x21ab('0x1d')],function(_0x2b0768){return{'model':db[_0x2b0768[_0x21ab('0x1f')]],'as':_0x2b0768['as'],'attributes':_0x2b0768[_0x21ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x21ab('0xb')](function(_0x474ba2){logger[_0x21ab('0xc')]('GetSalesforceAccount',_0x5b54fd);logger[_0x21ab('0xf')](_0x21ab('0x17'),_0x5b54fd,JSON['stringify'](_0x474ba2));_0x50f8e7(_0x474ba2);})['catch'](function(_0x5906e4){logger[_0x21ab('0x12')]('GetSalesforceAccount',_0x5906e4[_0x21ab('0x14')],_0x5b54fd);_0x16127a(_0x44da4e[_0x21ab('0x12')](0x1f4,_0x5906e4['message']));});});};exports['ShowSalesforceAccount']=function(_0x52db2c){var _0x53b5e6=this;return new Promise(function(_0x4a254c,_0x320a76){return db[_0x21ab('0x20')]['find']({'raw':_0x52db2c[_0x21ab('0x18')]?_0x52db2c[_0x21ab('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52db2c['options']?_0x52db2c['options'][_0x21ab('0x1a')]||null:null,'attributes':_0x52db2c['options']?_0x52db2c[_0x21ab('0x18')][_0x21ab('0x1b')]||null:null,'include':_0x52db2c[_0x21ab('0x18')]?_0x52db2c[_0x21ab('0x18')][_0x21ab('0x1d')]?_[_0x21ab('0x1e')](_0x52db2c[_0x21ab('0x18')][_0x21ab('0x1d')],function(_0x2de655){return{'model':db[_0x2de655[_0x21ab('0x1f')]],'as':_0x2de655['as'],'attributes':_0x2de655[_0x21ab('0x1b')],'include':_0x2de655[_0x21ab('0x1d')]?_[_0x21ab('0x1e')](_0x2de655[_0x21ab('0x1d')],function(_0x16e2ad){return{'model':db[_0x16e2ad[_0x21ab('0x1f')]],'as':_0x16e2ad['as'],'attributes':_0x16e2ad[_0x21ab('0x1b')],'include':_0x16e2ad[_0x21ab('0x1d')]?_[_0x21ab('0x1e')](_0x16e2ad['include'],function(_0x2fe616){return{'model':db[_0x2fe616[_0x21ab('0x1f')]],'as':_0x2fe616['as'],'attributes':_0x2fe616[_0x21ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x21ab('0xb')](function(_0x1b98fd){logger[_0x21ab('0xc')]('ShowSalesforceAccount',_0x52db2c);logger[_0x21ab('0xf')](_0x21ab('0x21'),_0x52db2c,JSON[_0x21ab('0x11')](_0x1b98fd));_0x4a254c(_0x1b98fd);})[_0x21ab('0x16')](function(_0x4edb16){logger['error'](_0x21ab('0x21'),_0x4edb16[_0x21ab('0x14')],_0x52db2c);_0x320a76(_0x53b5e6[_0x21ab('0x12')](0x1f4,_0x4edb16[_0x21ab('0x14')]));});});}; \ No newline at end of file +var _0x5bea=['ShowSalesforceAccount','find','lodash','moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x5bea,0x18e));var _0xa5be=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5bea[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xa5be('0x0'));var util=require('util');var moment=require(_0xa5be('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5be('0x2'));var fs=require('fs');var Redis=require(_0xa5be('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa5be('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa5be('0x5'));var client=jayson[_0xa5be('0x6')][_0xa5be('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x389f59,_0x50128d,_0x9edbe4){return new BPromise(function(_0x53ae66,_0x56c00a){return client['request'](_0x389f59,_0x9edbe4)[_0xa5be('0x8')](function(_0x5e9226){logger['info'](_0xa5be('0x9'),_0x50128d,'request\x20sent');logger[_0xa5be('0xa')](_0xa5be('0xb'),_0x50128d,_0xa5be('0xc'),JSON[_0xa5be('0xd')](_0x5e9226));if(_0x5e9226[_0xa5be('0xe')]){if(_0x5e9226[_0xa5be('0xe')][_0xa5be('0xf')]===0x1f4){logger['error'](_0xa5be('0x9'),_0x50128d,_0x5e9226[_0xa5be('0xe')][_0xa5be('0x10')]);return _0x56c00a(_0x5e9226[_0xa5be('0xe')]['message']);}logger[_0xa5be('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x50128d,_0x5e9226[_0xa5be('0xe')][_0xa5be('0x10')]);return _0x53ae66(_0x5e9226['error']['message']);}else{logger[_0xa5be('0x11')](_0xa5be('0x9'),_0x50128d,_0xa5be('0xc'));_0x53ae66(_0x5e9226[_0xa5be('0x12')][_0xa5be('0x10')]);}})[_0xa5be('0x13')](function(_0x278ab9){logger[_0xa5be('0xe')](_0xa5be('0x9'),_0x50128d,_0x278ab9);_0x56c00a(_0x278ab9);});});}exports[_0xa5be('0x14')]=function(_0x1bf6ba){var _0x24c48c=this;return new Promise(function(_0x28ce7e,_0x2c569c){return db[_0xa5be('0x15')][_0xa5be('0x16')]({'raw':_0x1bf6ba['options']?_0x1bf6ba[_0xa5be('0x17')][_0xa5be('0x18')]===undefined?!![]:![]:!![],'where':_0x1bf6ba[_0xa5be('0x17')]?_0x1bf6ba['options'][_0xa5be('0x19')]||null:null,'attributes':_0x1bf6ba['options']?_0x1bf6ba['options'][_0xa5be('0x1a')]||null:null,'limit':_0x1bf6ba[_0xa5be('0x17')]?_0x1bf6ba['options'][_0xa5be('0x1b')]||null:null,'include':_0x1bf6ba[_0xa5be('0x17')]?_0x1bf6ba['options'][_0xa5be('0x1c')]?_[_0xa5be('0x1d')](_0x1bf6ba[_0xa5be('0x17')]['include'],function(_0x13ea8d){return{'model':db[_0x13ea8d[_0xa5be('0x1e')]],'as':_0x13ea8d['as'],'attributes':_0x13ea8d['attributes'],'include':_0x13ea8d[_0xa5be('0x1c')]?_[_0xa5be('0x1d')](_0x13ea8d[_0xa5be('0x1c')],function(_0x16a4b8){return{'model':db[_0x16a4b8[_0xa5be('0x1e')]],'as':_0x16a4b8['as'],'attributes':_0x16a4b8[_0xa5be('0x1a')],'include':_0x16a4b8['include']?_[_0xa5be('0x1d')](_0x16a4b8[_0xa5be('0x1c')],function(_0xd2d55){return{'model':db[_0xd2d55['model']],'as':_0xd2d55['as'],'attributes':_0xd2d55[_0xa5be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa5be('0x8')](function(_0x29f791){logger[_0xa5be('0x11')]('GetSalesforceAccount',_0x1bf6ba);logger['debug'](_0xa5be('0x14'),_0x1bf6ba,JSON[_0xa5be('0xd')](_0x29f791));_0x28ce7e(_0x29f791);})['catch'](function(_0x202925){logger[_0xa5be('0xe')]('GetSalesforceAccount',_0x202925[_0xa5be('0x10')],_0x1bf6ba);_0x2c569c(_0x24c48c['error'](0x1f4,_0x202925['message']));});});};exports[_0xa5be('0x1f')]=function(_0x3976a5){var _0x1b3971=this;return new Promise(function(_0xfd7583,_0x565acc){return db[_0xa5be('0x15')][_0xa5be('0x20')]({'raw':_0x3976a5[_0xa5be('0x17')]?_0x3976a5[_0xa5be('0x17')][_0xa5be('0x18')]===undefined?!![]:![]:!![],'where':_0x3976a5[_0xa5be('0x17')]?_0x3976a5[_0xa5be('0x17')][_0xa5be('0x19')]||null:null,'attributes':_0x3976a5[_0xa5be('0x17')]?_0x3976a5[_0xa5be('0x17')][_0xa5be('0x1a')]||null:null,'include':_0x3976a5[_0xa5be('0x17')]?_0x3976a5[_0xa5be('0x17')][_0xa5be('0x1c')]?_[_0xa5be('0x1d')](_0x3976a5['options'][_0xa5be('0x1c')],function(_0x94b865){return{'model':db[_0x94b865[_0xa5be('0x1e')]],'as':_0x94b865['as'],'attributes':_0x94b865[_0xa5be('0x1a')],'include':_0x94b865['include']?_[_0xa5be('0x1d')](_0x94b865[_0xa5be('0x1c')],function(_0x1c7b4f){return{'model':db[_0x1c7b4f['model']],'as':_0x1c7b4f['as'],'attributes':_0x1c7b4f[_0xa5be('0x1a')],'include':_0x1c7b4f[_0xa5be('0x1c')]?_['map'](_0x1c7b4f[_0xa5be('0x1c')],function(_0x2dc539){return{'model':db[_0x2dc539[_0xa5be('0x1e')]],'as':_0x2dc539['as'],'attributes':_0x2dc539[_0xa5be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa5be('0x8')](function(_0x16a5ba){logger['info'](_0xa5be('0x1f'),_0x3976a5);logger[_0xa5be('0xa')]('ShowSalesforceAccount',_0x3976a5,JSON[_0xa5be('0xd')](_0x16a5ba));_0xfd7583(_0x16a5ba);})['catch'](function(_0x52e08b){logger[_0xa5be('0xe')](_0xa5be('0x1f'),_0x52e08b['message'],_0x3976a5);_0x565acc(_0x1b3971[_0xa5be('0xe')](0x1f4,_0x52e08b['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f126945..0e49133 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x71ef88,_0xf5cb07){var _0x3e1bb6=function(_0x5a9d43){while(--_0x5a9d43){_0x71ef88['push'](_0x71ef88['shift']());}};_0x3e1bb6(++_0xf5cb07);}(_0x2ef3,0xba));var _0x32ef=function(_0x40e434,_0x301b3b){_0x40e434=_0x40e434-0x0;var _0x4f16d8=_0x2ef3[_0x40e434];return _0x4f16d8;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2fc2e3,_0x17c8a2){var _0xaddfa3=function(_0x33b848){while(--_0x33b848){_0x2fc2e3['push'](_0x2fc2e3['shift']());}};_0xaddfa3(++_0x17c8a2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index e025ab7..d3f7070 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 _0x050d=['account_contact_lead','account','contact_lead','sequelize','STRING','ENUM','Task','Case','lead'];(function(_0x4ee386,_0x1a9032){var _0x42450c=function(_0x51d08c){while(--_0x51d08c){_0x4ee386['push'](_0x4ee386['shift']());}};_0x42450c(++_0x1a9032);}(_0x050d,0x11a));var _0xd050=function(_0x51a84b,_0x50a646){_0x51a84b=_0x51a84b-0x0;var _0xda27f0=_0x050d[_0x51a84b];return _0xda27f0;};'use strict';var Sequelize=require(_0xd050('0x0'));module['exports']={'name':{'type':Sequelize[_0xd050('0x1')]},'description':{'type':Sequelize[_0xd050('0x1')]},'ticketType':{'type':Sequelize[_0xd050('0x2')](_0xd050('0x3'),_0xd050('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xd050('0x2')]('contact_lead','contact',_0xd050('0x5'),_0xd050('0x6'),_0xd050('0x7')),'defaultValue':_0xd050('0x8')},'moduleCreate':{'type':Sequelize[_0xd050('0x2')]('nothing','contact',_0xd050('0x5'),_0xd050('0x7')),'defaultValue':_0xd050('0x5')},'leadId':{'type':Sequelize[_0xd050('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xd050('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xd050('0x1')]}}; \ No newline at end of file +var _0xa1c5=['nothing','sequelize','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account'];(function(_0x3f7b16,_0x538319){var _0x13df5c=function(_0x5a836c){while(--_0x5a836c){_0x3f7b16['push'](_0x3f7b16['shift']());}};_0x13df5c(++_0x538319);}(_0xa1c5,0x1e5));var _0x5a1c=function(_0x33ca2b,_0x3d2ce1){_0x33ca2b=_0x33ca2b-0x0;var _0x10ec85=_0xa1c5[_0x33ca2b];return _0x10ec85;};'use strict';var Sequelize=require(_0x5a1c('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a1c('0x1')]},'description':{'type':Sequelize[_0x5a1c('0x1')]},'ticketType':{'type':Sequelize[_0x5a1c('0x2')](_0x5a1c('0x3'),_0x5a1c('0x4')),'defaultValue':_0x5a1c('0x3')},'moduleSearch':{'type':Sequelize[_0x5a1c('0x2')](_0x5a1c('0x5'),_0x5a1c('0x6'),_0x5a1c('0x7'),_0x5a1c('0x8'),_0x5a1c('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x5a1c('0xa'),_0x5a1c('0x6'),_0x5a1c('0x7'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x5a1c('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x5a1c('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x5a1c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 5ec73d2..318aff9 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 _0x589b=['reject','save','update','then','destroy','stack','map','rawAttributes','type','key','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','SalesforceConfiguration','findAll','rows','catch','params','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x589b,0x1b2));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb589('0x0'));var rimraf=require(_0xb589('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb589('0x2'));var rp=require(_0xb589('0x3'));var moment=require(_0xb589('0x4'));var BPromise=require(_0xb589('0x5'));var Mustache=require(_0xb589('0x6'));var util=require(_0xb589('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb589('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb589('0x9'));var _=require(_0xb589('0xa'));var squel=require(_0xb589('0xb'));var crypto=require(_0xb589('0xc'));var jsforce=require(_0xb589('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb589('0x8'));var querystring=require(_0xb589('0xe'));var Papa=require(_0xb589('0xf'));var Redis=require('ioredis');var authService=require(_0xb589('0x10'));var qs=require(_0xb589('0x11'));var as=require(_0xb589('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb589('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb589('0x14'));var licenseUtil=require(_0xb589('0x15'));var db=require(_0xb589('0x16'))['db'];function respondWithStatusCode(_0x5d66dd,_0x334998){_0x334998=_0x334998||0xcc;return function(_0x516851){if(_0x516851){return _0x5d66dd[_0xb589('0x17')](_0x334998);}return _0x5d66dd['status'](_0x334998)[_0xb589('0x18')]();};}function respondWithResult(_0x3bcb50,_0x4acffe){_0x4acffe=_0x4acffe||0xc8;return function(_0x1d9f85){if(_0x1d9f85){return _0x3bcb50[_0xb589('0x19')](_0x4acffe)['json'](_0x1d9f85);}};}function respondWithFilteredResult(_0x645661,_0x512e3a){return function(_0x413d3e){if(_0x413d3e){var _0x24dbfe=typeof _0x512e3a[_0xb589('0x1a')]==='undefined'&&typeof _0x512e3a[_0xb589('0x1b')]===_0xb589('0x1c');var _0x3d7cec=_0x413d3e[_0xb589('0x1d')];var _0x252544=_0x24dbfe?0x0:_0x512e3a[_0xb589('0x1a')];var _0x20a97=_0x24dbfe?_0x413d3e[_0xb589('0x1d')]:_0x512e3a['offset']+_0x512e3a['limit'];var _0x315902;if(_0x20a97>=_0x3d7cec){_0x20a97=_0x3d7cec;_0x315902=0xc8;}else{_0x315902=0xce;}_0x645661[_0xb589('0x19')](_0x315902);return _0x645661[_0xb589('0x1e')](_0xb589('0x1f'),_0x252544+'-'+_0x20a97+'/'+_0x3d7cec)[_0xb589('0x20')](_0x413d3e);}return null;};}function patchUpdates(_0x5a181e){return function(_0x4cd26f){try{jsonpatch[_0xb589('0x21')](_0x4cd26f,_0x5a181e,!![]);}catch(_0x5452e6){return BPromise[_0xb589('0x22')](_0x5452e6);}return _0x4cd26f[_0xb589('0x23')]();};}function saveUpdates(_0x32cab4,_0x4b08c9){return function(_0xb85c7d){if(_0xb85c7d){return _0xb85c7d[_0xb589('0x24')](_0x32cab4)[_0xb589('0x25')](function(_0x58dc61){return _0x58dc61;});}return null;};}function removeEntity(_0x5386df,_0x1729a2){return function(_0xfc14c9){if(_0xfc14c9){return _0xfc14c9[_0xb589('0x26')]()[_0xb589('0x25')](function(){_0x5386df[_0xb589('0x19')](0xcc)[_0xb589('0x18')]();});}};}function handleEntityNotFound(_0x2b8b9d,_0x452bbc){return function(_0xb0ea03){if(!_0xb0ea03){_0x2b8b9d[_0xb589('0x17')](0x194);}return _0xb0ea03;};}function handleError(_0x4bc137,_0x4c4038){_0x4c4038=_0x4c4038||0x1f4;return function(_0x22d404){logger['error'](_0x22d404[_0xb589('0x27')]);if(_0x22d404['name']){delete _0x22d404['name'];}_0x4bc137[_0xb589('0x19')](_0x4c4038)['send'](_0x22d404);};}exports['index']=function(_0x4e1a67,_0x472b0b){var _0x471ae6={},_0x5bb620={},_0x5b7e0f={'count':0x0,'rows':[]};var _0x22ead3=_[_0xb589('0x28')](db['SalesforceConfiguration'][_0xb589('0x29')],function(_0x2b1382){return{'name':_0x2b1382['fieldName'],'type':_0x2b1382[_0xb589('0x2a')][_0xb589('0x2b')]};});_0x5bb620['model']=_[_0xb589('0x28')](_0x22ead3,_0xb589('0x2c'));_0x5bb620[_0xb589('0x2d')]=_[_0xb589('0x2e')](_0x4e1a67['query']);_0x5bb620['filters']=_[_0xb589('0x2f')](_0x5bb620['model'],_0x5bb620[_0xb589('0x2d')]);_0x471ae6['attributes']=_[_0xb589('0x2f')](_0x5bb620[_0xb589('0x30')],qs[_0xb589('0x31')](_0x4e1a67[_0xb589('0x2d')][_0xb589('0x31')]));_0x471ae6['attributes']=_0x471ae6[_0xb589('0x32')][_0xb589('0x33')]?_0x471ae6[_0xb589('0x32')]:_0x5bb620[_0xb589('0x30')];if(!_0x4e1a67[_0xb589('0x2d')][_0xb589('0x34')](_0xb589('0x35'))){_0x471ae6[_0xb589('0x1b')]=qs[_0xb589('0x1b')](_0x4e1a67[_0xb589('0x2d')][_0xb589('0x1b')]);_0x471ae6[_0xb589('0x1a')]=qs[_0xb589('0x1a')](_0x4e1a67[_0xb589('0x2d')]['offset']);}_0x471ae6[_0xb589('0x36')]=qs[_0xb589('0x37')](_0x4e1a67['query'][_0xb589('0x37')]);_0x471ae6[_0xb589('0x38')]=qs['filters'](_[_0xb589('0x39')](_0x4e1a67[_0xb589('0x2d')],_0x5bb620[_0xb589('0x3a')]),_0x22ead3);if(_0x4e1a67[_0xb589('0x2d')][_0xb589('0x3b')]){_0x471ae6['where']=_[_0xb589('0x3c')](_0x471ae6[_0xb589('0x38')],{'$or':_[_0xb589('0x28')](_0x22ead3,function(_0x4f38f9){if(_0x4f38f9[_0xb589('0x2a')]!==_0xb589('0x3d')){var _0x234cd6={};_0x234cd6[_0x4f38f9[_0xb589('0x2c')]]={'$like':'%'+_0x4e1a67['query'][_0xb589('0x3b')]+'%'};return _0x234cd6;}})});}_0x471ae6=_[_0xb589('0x3c')]({},_0x471ae6,_0x4e1a67[_0xb589('0x3e')]);var _0x609b88={'where':_0x471ae6[_0xb589('0x38')]};return db['SalesforceConfiguration'][_0xb589('0x1d')](_0x609b88)[_0xb589('0x25')](function(_0x3d83b1){_0x5b7e0f[_0xb589('0x1d')]=_0x3d83b1;if(_0x4e1a67['query'][_0xb589('0x3f')]){_0x471ae6[_0xb589('0x40')]=[{'all':!![]}];}return db[_0xb589('0x41')][_0xb589('0x42')](_0x471ae6);})[_0xb589('0x25')](function(_0x3c861f){_0x5b7e0f[_0xb589('0x43')]=_0x3c861f;return _0x5b7e0f;})[_0xb589('0x25')](respondWithFilteredResult(_0x472b0b,_0x471ae6))[_0xb589('0x44')](handleError(_0x472b0b,null));};exports['show']=function(_0x52bb33,_0x2cab13){var _0x2257c0={'raw':![],'where':{'id':_0x52bb33[_0xb589('0x45')]['id']}},_0x4d3986={};_0x4d3986[_0xb589('0x30')]=_[_0xb589('0x2e')](db['SalesforceConfiguration'][_0xb589('0x29')]);_0x4d3986[_0xb589('0x2d')]=_[_0xb589('0x2e')](_0x52bb33['query']);_0x4d3986[_0xb589('0x3a')]=_[_0xb589('0x2f')](_0x4d3986[_0xb589('0x30')],_0x4d3986['query']);_0x2257c0['attributes']=_[_0xb589('0x2f')](_0x4d3986[_0xb589('0x30')],qs[_0xb589('0x31')](_0x52bb33[_0xb589('0x2d')][_0xb589('0x31')]));_0x2257c0[_0xb589('0x32')]=_0x2257c0[_0xb589('0x32')][_0xb589('0x33')]?_0x2257c0['attributes']:_0x4d3986[_0xb589('0x30')];if(_0x52bb33[_0xb589('0x2d')][_0xb589('0x3f')]){_0x2257c0['include']=[{'all':!![]}];}_0x2257c0=_[_0xb589('0x3c')]({},_0x2257c0,_0x52bb33[_0xb589('0x3e')]);return db[_0xb589('0x41')][_0xb589('0x46')](_0x2257c0)[_0xb589('0x25')](handleEntityNotFound(_0x2cab13,null))[_0xb589('0x25')](respondWithResult(_0x2cab13,null))[_0xb589('0x44')](handleError(_0x2cab13,null));};exports[_0xb589('0x47')]=function(_0x10776e,_0x4322d3){return db['SalesforceConfiguration'][_0xb589('0x47')](_0x10776e[_0xb589('0x48')],{})[_0xb589('0x25')](respondWithResult(_0x4322d3,0xc9))[_0xb589('0x44')](handleError(_0x4322d3,null));};exports['update']=function(_0x4bbe33,_0x1a1a59){if(_0x4bbe33[_0xb589('0x48')]['id']){delete _0x4bbe33[_0xb589('0x48')]['id'];}return db[_0xb589('0x41')][_0xb589('0x46')]({'where':{'id':_0x4bbe33[_0xb589('0x45')]['id']}})[_0xb589('0x25')](handleEntityNotFound(_0x1a1a59,null))[_0xb589('0x25')](saveUpdates(_0x4bbe33['body'],null))[_0xb589('0x25')](respondWithResult(_0x1a1a59,null))['catch'](handleError(_0x1a1a59,null));};exports['destroy']=function(_0x717248,_0x38954c){return db[_0xb589('0x41')][_0xb589('0x46')]({'where':{'id':_0x717248[_0xb589('0x45')]['id']}})[_0xb589('0x25')](handleEntityNotFound(_0x38954c,null))[_0xb589('0x25')](removeEntity(_0x38954c,null))[_0xb589('0x44')](handleError(_0x38954c,null));};exports[_0xb589('0x49')]=function(_0x21fd59,_0x365193,_0x554172){var _0x5b4959={};var _0x19e052={};var _0x457607;var _0x37fbd3;return db[_0xb589('0x41')][_0xb589('0x4a')]({'where':{'id':_0x21fd59[_0xb589('0x45')]['id']}})['then'](handleEntityNotFound(_0x365193,null))['then'](function(_0x18a407){if(_0x18a407){_0x457607=_0x18a407;_0x19e052['model']=_[_0xb589('0x2e')](db[_0xb589('0x4b')]['rawAttributes']);_0x19e052[_0xb589('0x2d')]=_[_0xb589('0x2e')](_0x21fd59[_0xb589('0x2d')]);_0x19e052[_0xb589('0x3a')]=_[_0xb589('0x2f')](_0x19e052[_0xb589('0x30')],_0x19e052[_0xb589('0x2d')]);_0x5b4959[_0xb589('0x32')]=_['intersection'](_0x19e052[_0xb589('0x30')],qs['fields'](_0x21fd59[_0xb589('0x2d')][_0xb589('0x31')]));_0x5b4959[_0xb589('0x32')]=_0x5b4959[_0xb589('0x32')][_0xb589('0x33')]?_0x5b4959[_0xb589('0x32')]:_0x19e052[_0xb589('0x30')];_0x5b4959['order']=qs[_0xb589('0x37')](_0x21fd59[_0xb589('0x2d')]['sort']);_0x5b4959[_0xb589('0x38')]=qs['filters'](_[_0xb589('0x39')](_0x21fd59[_0xb589('0x2d')],_0x19e052[_0xb589('0x3a')]));if(_0x21fd59[_0xb589('0x2d')][_0xb589('0x3b')]){_0x5b4959[_0xb589('0x38')]=_[_0xb589('0x3c')](_0x5b4959[_0xb589('0x38')],{'$or':_[_0xb589('0x28')](_0x5b4959[_0xb589('0x32')],function(_0x28a1c4){var _0x3c9d10={};_0x3c9d10[_0x28a1c4]={'$like':'%'+_0x21fd59[_0xb589('0x2d')][_0xb589('0x3b')]+'%'};return _0x3c9d10;})});}_0x5b4959=_[_0xb589('0x3c')]({},_0x5b4959,_0x21fd59[_0xb589('0x3e')]);return _0x457607[_0xb589('0x49')](_0x5b4959);}})['then'](function(_0x497c68){if(_0x497c68){_0x37fbd3=_0x497c68[_0xb589('0x33')];if(!_0x21fd59[_0xb589('0x2d')][_0xb589('0x34')](_0xb589('0x35'))){_0x5b4959['limit']=qs['limit'](_0x21fd59['query'][_0xb589('0x1b')]);_0x5b4959[_0xb589('0x1a')]=qs['offset'](_0x21fd59[_0xb589('0x2d')][_0xb589('0x1a')]);}return _0x457607[_0xb589('0x49')](_0x5b4959);}})[_0xb589('0x25')](function(_0x548ab7){if(_0x548ab7){return _0x548ab7?{'count':_0x37fbd3,'rows':_0x548ab7}:null;}})[_0xb589('0x25')](respondWithResult(_0x365193,null))[_0xb589('0x44')](handleError(_0x365193,null));};exports[_0xb589('0x4c')]=function(_0x1e75c5,_0x171cd8,_0x4917d1){var _0x15b5fb={};var _0x506bf8={};var _0x2e49c3;var _0x4a0dd6;return db[_0xb589('0x41')][_0xb589('0x4a')]({'where':{'id':_0x1e75c5['params']['id']}})[_0xb589('0x25')](handleEntityNotFound(_0x171cd8,null))[_0xb589('0x25')](function(_0x30d821){if(_0x30d821){_0x2e49c3=_0x30d821;_0x506bf8[_0xb589('0x30')]=_[_0xb589('0x2e')](db[_0xb589('0x4b')][_0xb589('0x29')]);_0x506bf8['query']=_[_0xb589('0x2e')](_0x1e75c5['query']);_0x506bf8[_0xb589('0x3a')]=_[_0xb589('0x2f')](_0x506bf8['model'],_0x506bf8['query']);_0x15b5fb[_0xb589('0x32')]=_[_0xb589('0x2f')](_0x506bf8[_0xb589('0x30')],qs[_0xb589('0x31')](_0x1e75c5[_0xb589('0x2d')][_0xb589('0x31')]));_0x15b5fb['attributes']=_0x15b5fb['attributes'][_0xb589('0x33')]?_0x15b5fb[_0xb589('0x32')]:_0x506bf8[_0xb589('0x30')];_0x15b5fb['order']=qs[_0xb589('0x37')](_0x1e75c5[_0xb589('0x2d')][_0xb589('0x37')]);_0x15b5fb[_0xb589('0x38')]=qs['filters'](_[_0xb589('0x39')](_0x1e75c5[_0xb589('0x2d')],_0x506bf8['filters']));if(_0x1e75c5['query'][_0xb589('0x3b')]){_0x15b5fb['where']=_[_0xb589('0x3c')](_0x15b5fb[_0xb589('0x38')],{'$or':_[_0xb589('0x28')](_0x15b5fb[_0xb589('0x32')],function(_0x15e9c5){var _0x345cb6={};_0x345cb6[_0x15e9c5]={'$like':'%'+_0x1e75c5[_0xb589('0x2d')][_0xb589('0x3b')]+'%'};return _0x345cb6;})});}_0x15b5fb=_[_0xb589('0x3c')]({},_0x15b5fb,_0x1e75c5['options']);return _0x2e49c3[_0xb589('0x4c')](_0x15b5fb);}})[_0xb589('0x25')](function(_0x2d204d){if(_0x2d204d){_0x4a0dd6=_0x2d204d[_0xb589('0x33')];if(!_0x1e75c5[_0xb589('0x2d')]['hasOwnProperty'](_0xb589('0x35'))){_0x15b5fb[_0xb589('0x1b')]=qs[_0xb589('0x1b')](_0x1e75c5[_0xb589('0x2d')][_0xb589('0x1b')]);_0x15b5fb[_0xb589('0x1a')]=qs[_0xb589('0x1a')](_0x1e75c5[_0xb589('0x2d')][_0xb589('0x1a')]);}return _0x2e49c3[_0xb589('0x4c')](_0x15b5fb);}})[_0xb589('0x25')](function(_0x69c5c3){if(_0x69c5c3){return _0x69c5c3?{'count':_0x4a0dd6,'rows':_0x69c5c3}:null;}})[_0xb589('0x25')](respondWithResult(_0x171cd8,null))[_0xb589('0x44')](handleError(_0x171cd8,null));};exports['getDescriptions']=function(_0x1f88e9,_0x2e7d18,_0x285a5d){var _0x573b03={};var _0x50aa33={};var _0x3c9dbd;var _0x2455d9;return db['SalesforceConfiguration'][_0xb589('0x4a')]({'where':{'id':_0x1f88e9[_0xb589('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e7d18,null))[_0xb589('0x25')](function(_0x416642){if(_0x416642){_0x3c9dbd=_0x416642;_0x50aa33[_0xb589('0x30')]=_[_0xb589('0x2e')](db[_0xb589('0x4b')]['rawAttributes']);_0x50aa33['query']=_[_0xb589('0x2e')](_0x1f88e9['query']);_0x50aa33[_0xb589('0x3a')]=_[_0xb589('0x2f')](_0x50aa33[_0xb589('0x30')],_0x50aa33[_0xb589('0x2d')]);_0x573b03[_0xb589('0x32')]=_[_0xb589('0x2f')](_0x50aa33[_0xb589('0x30')],qs[_0xb589('0x31')](_0x1f88e9[_0xb589('0x2d')][_0xb589('0x31')]));_0x573b03[_0xb589('0x32')]=_0x573b03['attributes'][_0xb589('0x33')]?_0x573b03['attributes']:_0x50aa33[_0xb589('0x30')];_0x573b03[_0xb589('0x36')]=qs[_0xb589('0x37')](_0x1f88e9[_0xb589('0x2d')][_0xb589('0x37')]);_0x573b03['where']=qs['filters'](_[_0xb589('0x39')](_0x1f88e9[_0xb589('0x2d')],_0x50aa33['filters']));if(_0x1f88e9[_0xb589('0x2d')][_0xb589('0x3b')]){_0x573b03['where']=_[_0xb589('0x3c')](_0x573b03[_0xb589('0x38')],{'$or':_[_0xb589('0x28')](_0x573b03[_0xb589('0x32')],function(_0x371573){var _0x4d02f8={};_0x4d02f8[_0x371573]={'$like':'%'+_0x1f88e9[_0xb589('0x2d')][_0xb589('0x3b')]+'%'};return _0x4d02f8;})});}_0x573b03=_[_0xb589('0x3c')]({},_0x573b03,_0x1f88e9[_0xb589('0x3e')]);return _0x3c9dbd[_0xb589('0x4d')](_0x573b03);}})[_0xb589('0x25')](function(_0x5aaabd){if(_0x5aaabd){_0x2455d9=_0x5aaabd['length'];if(!_0x1f88e9[_0xb589('0x2d')][_0xb589('0x34')](_0xb589('0x35'))){_0x573b03[_0xb589('0x1b')]=qs['limit'](_0x1f88e9[_0xb589('0x2d')]['limit']);_0x573b03[_0xb589('0x1a')]=qs[_0xb589('0x1a')](_0x1f88e9[_0xb589('0x2d')]['offset']);}return _0x3c9dbd[_0xb589('0x4d')](_0x573b03);}})[_0xb589('0x25')](function(_0x4be92f){if(_0x4be92f){return _0x4be92f?{'count':_0x2455d9,'rows':_0x4be92f}:null;}})['then'](respondWithResult(_0x2e7d18,null))['catch'](handleError(_0x2e7d18,null));}; \ No newline at end of file +var _0x5ad3=['findAll','rows','show','params','keys','catch','create','body','find','getFields','SalesforceField','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include'];(function(_0x5e70f7,_0x344ec4){var _0x51aa64=function(_0x424e7d){while(--_0x424e7d){_0x5e70f7['push'](_0x5e70f7['shift']());}};_0x51aa64(++_0x344ec4);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0x5ad3[_0x4cefc3];return _0x1cc779;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['SalesforceConfiguration'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['SalesforceConfiguration'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887,_0x271493){var _0x46def2={};var _0x53a536={};var _0x119b99;var _0x22415d;return db[_0x35ad('0x3d')]['findOne']({'where':{'id':_0x34061c[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x467887,null))[_0x35ad('0x23')](function(_0x3c5697){if(_0x3c5697){_0x119b99=_0x3c5697;_0x53a536['model']=_['keys'](db[_0x35ad('0x4a')][_0x35ad('0x2a')]);_0x53a536[_0x35ad('0x2c')]=_[_0x35ad('0x44')](_0x34061c[_0x35ad('0x2c')]);_0x53a536['filters']=_[_0x35ad('0x2d')](_0x53a536[_0x35ad('0x2b')],_0x53a536[_0x35ad('0x2c')]);_0x46def2[_0x35ad('0x2f')]=_[_0x35ad('0x2d')](_0x53a536[_0x35ad('0x2b')],qs['fields'](_0x34061c['query'][_0x35ad('0x2e')]));_0x46def2[_0x35ad('0x2f')]=_0x46def2[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x46def2[_0x35ad('0x2f')]:_0x53a536[_0x35ad('0x2b')];_0x46def2[_0x35ad('0x33')]=qs['sort'](_0x34061c[_0x35ad('0x2c')][_0x35ad('0x34')]);_0x46def2[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_['pick'](_0x34061c[_0x35ad('0x2c')],_0x53a536[_0x35ad('0x36')]));if(_0x34061c['query'][_0x35ad('0x38')]){_0x46def2[_0x35ad('0x35')]=_[_0x35ad('0x3b')](_0x46def2[_0x35ad('0x35')],{'$or':_[_0x35ad('0x29')](_0x46def2[_0x35ad('0x2f')],function(_0x40ad55){var _0x1eda5e={};_0x1eda5e[_0x40ad55]={'$like':'%'+_0x34061c['query'][_0x35ad('0x38')]+'%'};return _0x1eda5e;})});}_0x46def2=_[_0x35ad('0x3b')]({},_0x46def2,_0x34061c[_0x35ad('0x3c')]);return _0x119b99['getFields'](_0x46def2);}})[_0x35ad('0x23')](function(_0x4b3992){if(_0x4b3992){_0x22415d=_0x4b3992[_0x35ad('0x30')];if(!_0x34061c[_0x35ad('0x2c')][_0x35ad('0x31')](_0x35ad('0x32'))){_0x46def2['limit']=qs[_0x35ad('0x1d')](_0x34061c[_0x35ad('0x2c')][_0x35ad('0x1d')]);_0x46def2[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x34061c['query'][_0x35ad('0x1a')]);}return _0x119b99['getFields'](_0x46def2);}})[_0x35ad('0x23')](function(_0x43b372){if(_0x43b372){return _0x43b372?{'count':_0x22415d,'rows':_0x43b372}:null;}})['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));};exports['getSubjects']=function(_0x80e87f,_0x3f1d05,_0x5c71a7){var _0x258566={};var _0x4609e0={};var _0x39f642;var _0x4a9f53;return db[_0x35ad('0x3d')][_0x35ad('0x4b')]({'where':{'id':_0x80e87f[_0x35ad('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f1d05,null))[_0x35ad('0x23')](function(_0x10f29e){if(_0x10f29e){_0x39f642=_0x10f29e;_0x4609e0[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x4a')][_0x35ad('0x2a')]);_0x4609e0[_0x35ad('0x2c')]=_['keys'](_0x80e87f[_0x35ad('0x2c')]);_0x4609e0[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x4609e0[_0x35ad('0x2b')],_0x4609e0[_0x35ad('0x2c')]);_0x258566['attributes']=_[_0x35ad('0x2d')](_0x4609e0[_0x35ad('0x2b')],qs['fields'](_0x80e87f[_0x35ad('0x2c')][_0x35ad('0x2e')]));_0x258566[_0x35ad('0x2f')]=_0x258566[_0x35ad('0x2f')]['length']?_0x258566[_0x35ad('0x2f')]:_0x4609e0['model'];_0x258566[_0x35ad('0x33')]=qs[_0x35ad('0x34')](_0x80e87f[_0x35ad('0x2c')]['sort']);_0x258566[_0x35ad('0x35')]=qs['filters'](_[_0x35ad('0x37')](_0x80e87f['query'],_0x4609e0['filters']));if(_0x80e87f[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x258566['where']=_[_0x35ad('0x3b')](_0x258566[_0x35ad('0x35')],{'$or':_[_0x35ad('0x29')](_0x258566['attributes'],function(_0x5ed87f){var _0x54d138={};_0x54d138[_0x5ed87f]={'$like':'%'+_0x80e87f['query'][_0x35ad('0x38')]+'%'};return _0x54d138;})});}_0x258566=_[_0x35ad('0x3b')]({},_0x258566,_0x80e87f[_0x35ad('0x3c')]);return _0x39f642[_0x35ad('0x4c')](_0x258566);}})[_0x35ad('0x23')](function(_0xfb488c){if(_0xfb488c){_0x4a9f53=_0xfb488c['length'];if(!_0x80e87f[_0x35ad('0x2c')][_0x35ad('0x31')]('nolimit')){_0x258566[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x80e87f['query'][_0x35ad('0x1d')]);_0x258566[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x80e87f[_0x35ad('0x2c')]['offset']);}return _0x39f642[_0x35ad('0x4c')](_0x258566);}})[_0x35ad('0x23')](function(_0x24927b){if(_0x24927b){return _0x24927b?{'count':_0x4a9f53,'rows':_0x24927b}:null;}})[_0x35ad('0x23')](respondWithResult(_0x3f1d05,null))[_0x35ad('0x45')](handleError(_0x3f1d05,null));};exports[_0x35ad('0x4d')]=function(_0x40fbd3,_0x3dc5e5,_0xd021df){var _0x2bc48d={};var _0x4f8fe9={};var _0x4ec35a;var _0x1de13c;return db[_0x35ad('0x3d')]['findOne']({'where':{'id':_0x40fbd3[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3dc5e5,null))[_0x35ad('0x23')](function(_0x23282b){if(_0x23282b){_0x4ec35a=_0x23282b;_0x4f8fe9[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db['SalesforceField'][_0x35ad('0x2a')]);_0x4f8fe9[_0x35ad('0x2c')]=_[_0x35ad('0x44')](_0x40fbd3[_0x35ad('0x2c')]);_0x4f8fe9[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x4f8fe9[_0x35ad('0x2b')],_0x4f8fe9[_0x35ad('0x2c')]);_0x2bc48d['attributes']=_[_0x35ad('0x2d')](_0x4f8fe9[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x40fbd3[_0x35ad('0x2c')]['fields']));_0x2bc48d[_0x35ad('0x2f')]=_0x2bc48d['attributes'][_0x35ad('0x30')]?_0x2bc48d['attributes']:_0x4f8fe9['model'];_0x2bc48d[_0x35ad('0x33')]=qs[_0x35ad('0x34')](_0x40fbd3[_0x35ad('0x2c')]['sort']);_0x2bc48d[_0x35ad('0x35')]=qs['filters'](_[_0x35ad('0x37')](_0x40fbd3[_0x35ad('0x2c')],_0x4f8fe9[_0x35ad('0x36')]));if(_0x40fbd3[_0x35ad('0x2c')]['filter']){_0x2bc48d[_0x35ad('0x35')]=_['merge'](_0x2bc48d[_0x35ad('0x35')],{'$or':_['map'](_0x2bc48d[_0x35ad('0x2f')],function(_0x48d050){var _0x4dcf9f={};_0x4dcf9f[_0x48d050]={'$like':'%'+_0x40fbd3['query']['filter']+'%'};return _0x4dcf9f;})});}_0x2bc48d=_[_0x35ad('0x3b')]({},_0x2bc48d,_0x40fbd3[_0x35ad('0x3c')]);return _0x4ec35a[_0x35ad('0x4d')](_0x2bc48d);}})[_0x35ad('0x23')](function(_0x227dc5){if(_0x227dc5){_0x1de13c=_0x227dc5['length'];if(!_0x40fbd3['query'][_0x35ad('0x31')]('nolimit')){_0x2bc48d[_0x35ad('0x1d')]=qs['limit'](_0x40fbd3[_0x35ad('0x2c')][_0x35ad('0x1d')]);_0x2bc48d[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x40fbd3['query'][_0x35ad('0x1a')]);}return _0x4ec35a[_0x35ad('0x4d')](_0x2bc48d);}})[_0x35ad('0x23')](function(_0x3b7c41){if(_0x3b7c41){return _0x3b7c41?{'count':_0x1de13c,'rows':_0x3b7c41}:null;}})[_0x35ad('0x23')](respondWithResult(_0x3dc5e5,null))[_0x35ad('0x45')](handleError(_0x3dc5e5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 15e1afc..dc1dbc9 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 _0x3fd7=['../../config/environment','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x3fd7,0x157));var _0x73fd=function(_0x56aab0,_0x4afd25){_0x56aab0=_0x56aab0-0x0;var _0xa15bf4=_0x3fd7[_0x56aab0];return _0xa15bf4;};'use strict';var _=require(_0x73fd('0x0'));var util=require(_0x73fd('0x1'));var logger=require(_0x73fd('0x2'))('api');var moment=require(_0x73fd('0x3'));var BPromise=require(_0x73fd('0x4'));var rp=require(_0x73fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73fd('0x6'));var config=require(_0x73fd('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x73fd('0x8')]=function(_0x1e3660,_0x4e21fd){return _0x1e3660[_0x73fd('0x9')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6e9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd6e9,0x167));var _0x9d6e=function(_0x5f23f8,_0x2ce91b){_0x5f23f8=_0x5f23f8-0x0;var _0x4479c7=_0xd6e9[_0x5f23f8];return _0x4479c7;};'use strict';var _=require('lodash');var util=require(_0x9d6e('0x0'));var logger=require('../../config/logger')(_0x9d6e('0x1'));var moment=require(_0x9d6e('0x2'));var BPromise=require(_0x9d6e('0x3'));var rp=require(_0x9d6e('0x4'));var fs=require('fs');var path=require(_0x9d6e('0x5'));var rimraf=require(_0x9d6e('0x6'));var config=require(_0x9d6e('0x7'));var attributes=require(_0x9d6e('0x8'));module['exports']=function(_0x4f444f,_0x36a772){return _0x4f444f[_0x9d6e('0x9')](_0x9d6e('0xa'),attributes,{'tableName':_0x9d6e('0xb'),'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 13fb905..8364212 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 _0x23de=['info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x23de,0x7a));var _0xe23d=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0x23de[_0x334f9a];return _0x2b219d;};'use strict';var _=require('lodash');var util=require(_0xe23d('0x0'));var moment=require('moment');var BPromise=require(_0xe23d('0x1'));var rs=require(_0xe23d('0x2'));var fs=require('fs');var Redis=require(_0xe23d('0x3'));var db=require(_0xe23d('0x4'))['db'];var utils=require(_0xe23d('0x5'));var logger=require(_0xe23d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe23d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cdeba,_0x26f4ff,_0x304701){return new BPromise(function(_0x588c0b,_0x1ce665){return client[_0xe23d('0x8')](_0x2cdeba,_0x304701)[_0xe23d('0x9')](function(_0x4488a7){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x26f4ff,'request\x20sent');logger[_0xe23d('0xa')](_0xe23d('0xb'),_0x26f4ff,_0xe23d('0xc'),JSON[_0xe23d('0xd')](_0x4488a7));if(_0x4488a7[_0xe23d('0xe')]){if(_0x4488a7['error'][_0xe23d('0xf')]===0x1f4){logger[_0xe23d('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x26f4ff,_0x4488a7['error'][_0xe23d('0x10')]);return _0x1ce665(_0x4488a7[_0xe23d('0xe')][_0xe23d('0x10')]);}logger[_0xe23d('0xe')](_0xe23d('0x11'),_0x26f4ff,_0x4488a7[_0xe23d('0xe')][_0xe23d('0x10')]);return _0x588c0b(_0x4488a7[_0xe23d('0xe')]['message']);}else{logger[_0xe23d('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x26f4ff,'request\x20sent');_0x588c0b(_0x4488a7['result'][_0xe23d('0x10')]);}})[_0xe23d('0x13')](function(_0x3314d2){logger[_0xe23d('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x26f4ff,_0x3314d2);_0x1ce665(_0x3314d2);});});} \ No newline at end of file +var _0x2c30=['then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3fad0f,_0x5bec08){var _0x59f2b8=function(_0x42f505){while(--_0x42f505){_0x3fad0f['push'](_0x3fad0f['shift']());}};_0x59f2b8(++_0x5bec08);}(_0x2c30,0xf5));var _0x02c3=function(_0x2f0fff,_0x1cc8ef){_0x2f0fff=_0x2f0fff-0x0;var _0x5cf183=_0x2c30[_0x2f0fff];return _0x5cf183;};'use strict';var _=require(_0x02c3('0x0'));var util=require(_0x02c3('0x1'));var moment=require(_0x02c3('0x2'));var BPromise=require(_0x02c3('0x3'));var rs=require(_0x02c3('0x4'));var fs=require('fs');var Redis=require(_0x02c3('0x5'));var db=require(_0x02c3('0x6'))['db'];var utils=require(_0x02c3('0x7'));var logger=require(_0x02c3('0x8'))(_0x02c3('0x9'));var config=require(_0x02c3('0xa'));var jayson=require(_0x02c3('0xb'));var client=jayson[_0x02c3('0xc')][_0x02c3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x22d900,_0x10f4aa,_0x512203){return new BPromise(function(_0x34f422,_0x49368a){return client[_0x02c3('0xe')](_0x22d900,_0x512203)[_0x02c3('0xf')](function(_0x5cfc5e){logger[_0x02c3('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x10f4aa,_0x02c3('0x11'));logger[_0x02c3('0x12')](_0x02c3('0x13'),_0x10f4aa,_0x02c3('0x11'),JSON[_0x02c3('0x14')](_0x5cfc5e));if(_0x5cfc5e[_0x02c3('0x15')]){if(_0x5cfc5e['error']['code']===0x1f4){logger[_0x02c3('0x15')](_0x02c3('0x16'),_0x10f4aa,_0x5cfc5e[_0x02c3('0x15')][_0x02c3('0x17')]);return _0x49368a(_0x5cfc5e[_0x02c3('0x15')][_0x02c3('0x17')]);}logger['error'](_0x02c3('0x16'),_0x10f4aa,_0x5cfc5e[_0x02c3('0x15')][_0x02c3('0x17')]);return _0x34f422(_0x5cfc5e[_0x02c3('0x15')][_0x02c3('0x17')]);}else{logger[_0x02c3('0x10')](_0x02c3('0x16'),_0x10f4aa,_0x02c3('0x11'));_0x34f422(_0x5cfc5e[_0x02c3('0x18')]['message']);}})[_0x02c3('0x19')](function(_0x4ffc9a){logger[_0x02c3('0x15')](_0x02c3('0x16'),_0x10f4aa,_0x4ffc9a);_0x49368a(_0x4ffc9a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index de35890..4cd5923 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 _0x8c5a=['isAuthenticated','index','post','create','put','/:id','update','delete','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0x8c5a,0x1c2));var _0xa8c5=function(_0x3a6ebd,_0x31787a){_0x3a6ebd=_0x3a6ebd-0x0;var _0x2fd018=_0x8c5a[_0x3a6ebd];return _0x2fd018;};'use strict';var multer=require('multer');var util=require(_0xa8c5('0x0'));var path=require(_0xa8c5('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8c5('0x2'));var router=express[_0xa8c5('0x3')]();var fs_extra=require(_0xa8c5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa8c5('0x5'));var config=require(_0xa8c5('0x6'));var controller=require(_0xa8c5('0x7'));router[_0xa8c5('0x8')]('/',auth[_0xa8c5('0x9')](),controller[_0xa8c5('0xa')]);router[_0xa8c5('0x8')]('/:id',auth[_0xa8c5('0x9')](),controller['show']);router[_0xa8c5('0xb')]('/',auth[_0xa8c5('0x9')](),controller[_0xa8c5('0xc')]);router[_0xa8c5('0xd')](_0xa8c5('0xe'),auth[_0xa8c5('0x9')](),controller[_0xa8c5('0xf')]);router[_0xa8c5('0x10')](_0xa8c5('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb3fe=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0xb22304,_0x1cf7b5){var _0x46a85e=function(_0x56cd27){while(--_0x56cd27){_0xb22304['push'](_0xb22304['shift']());}};_0x46a85e(++_0x1cf7b5);}(_0xb3fe,0x92));var _0xeb3f=function(_0x237d21,_0x5102b7){_0x237d21=_0x237d21-0x0;var _0x1e1702=_0xb3fe[_0x237d21];return _0x1e1702;};'use strict';var multer=require(_0xeb3f('0x0'));var util=require('util');var path=require(_0xeb3f('0x1'));var timeout=require(_0xeb3f('0x2'));var express=require(_0xeb3f('0x3'));var router=express[_0xeb3f('0x4')]();var fs_extra=require(_0xeb3f('0x5'));var auth=require(_0xeb3f('0x6'));var interaction=require(_0xeb3f('0x7'));var config=require(_0xeb3f('0x8'));var controller=require(_0xeb3f('0x9'));router[_0xeb3f('0xa')]('/',auth[_0xeb3f('0xb')](),controller[_0xeb3f('0xc')]);router['get']('/:id',auth[_0xeb3f('0xb')](),controller[_0xeb3f('0xd')]);router[_0xeb3f('0xe')]('/',auth[_0xeb3f('0xb')](),controller[_0xeb3f('0xf')]);router[_0xeb3f('0x10')](_0xeb3f('0x11'),auth[_0xeb3f('0xb')](),controller['update']);router[_0xeb3f('0x12')](_0xeb3f('0x11'),auth['isAuthenticated'](),controller[_0xeb3f('0x13')]);module[_0xeb3f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 2838c5d..66ad2fe 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 _0x0db2=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x33b3e7,_0x3c2592){var _0x49f558=function(_0x3bad6c){while(--_0x3bad6c){_0x33b3e7['push'](_0x33b3e7['shift']());}};_0x49f558(++_0x3c2592);}(_0x0db2,0x1a2));var _0x20db=function(_0x44fabe,_0x116070){_0x44fabe=_0x44fabe-0x0;var _0x5ebf9d=_0x0db2[_0x44fabe];return _0x5ebf9d;};'use strict';var Sequelize=require(_0x20db('0x0'));module[_0x20db('0x1')]={'type':{'type':Sequelize[_0x20db('0x2')](_0x20db('0x3'),_0x20db('0x4'),_0x20db('0x5'),_0x20db('0x6'),_0x20db('0x7')),'defaultValue':_0x20db('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x20db('0x8')]},'keyType':{'type':Sequelize[_0x20db('0x2')](_0x20db('0x3'),'variable',_0x20db('0x5'))},'keyContent':{'type':Sequelize[_0x20db('0x8')]},'idField':{'type':Sequelize[_0x20db('0x8')]},'variableName':{'type':Sequelize[_0x20db('0x8')]}}; \ No newline at end of file +var _0x0436=['variable','customVariable','keyValue','picklist','STRING','sequelize','ENUM','string'];(function(_0x4e2522,_0x2eb63c){var _0x2a9e35=function(_0x3e2cca){while(--_0x3e2cca){_0x4e2522['push'](_0x4e2522['shift']());}};_0x2a9e35(++_0x2eb63c);}(_0x0436,0x175));var _0x6043=function(_0x4d67bd,_0x8d2160){_0x4d67bd=_0x4d67bd-0x0;var _0x4de7c6=_0x0436[_0x4d67bd];return _0x4de7c6;};'use strict';var Sequelize=require(_0x6043('0x0'));module['exports']={'type':{'type':Sequelize[_0x6043('0x1')](_0x6043('0x2'),_0x6043('0x3'),_0x6043('0x4'),_0x6043('0x5'),_0x6043('0x6')),'defaultValue':_0x6043('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6043('0x7')]},'keyType':{'type':Sequelize[_0x6043('0x1')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x6043('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x6043('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index d857a12..5798dcd 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 _0xe63c=['name','send','index','map','SalesforceField','rawAttributes','fieldName','keys','filters','intersection','model','attributes','fields','query','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','then','error','stack'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe63c,0x1a3));var _0xce63=function(_0x5208fa,_0x2e0115){_0x5208fa=_0x5208fa-0x0;var _0x340255=_0xe63c[_0x5208fa];return _0x340255;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce63('0x0'));var zipdir=require(_0xce63('0x1'));var jsonpatch=require(_0xce63('0x2'));var rp=require(_0xce63('0x3'));var moment=require(_0xce63('0x4'));var BPromise=require(_0xce63('0x5'));var Mustache=require(_0xce63('0x6'));var util=require(_0xce63('0x7'));var path=require(_0xce63('0x8'));var sox=require(_0xce63('0x9'));var csv=require('to-csv');var ejs=require(_0xce63('0xa'));var fs=require('fs');var fs_extra=require(_0xce63('0xb'));var _=require(_0xce63('0xc'));var squel=require('squel');var crypto=require(_0xce63('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xce63('0xe'));var toCsv=require(_0xce63('0xf'));var querystring=require(_0xce63('0x10'));var Papa=require(_0xce63('0x11'));var Redis=require(_0xce63('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xce63('0x13'));var as=require(_0xce63('0x14'));var hardwareService=require(_0xce63('0x15'));var logger=require(_0xce63('0x16'))(_0xce63('0x17'));var utils=require(_0xce63('0x18'));var config=require(_0xce63('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xce63('0x1a'))['db'];function respondWithStatusCode(_0x39661c,_0x4af486){_0x4af486=_0x4af486||0xcc;return function(_0x2ae8b7){if(_0x2ae8b7){return _0x39661c[_0xce63('0x1b')](_0x4af486);}return _0x39661c[_0xce63('0x1c')](_0x4af486)[_0xce63('0x1d')]();};}function respondWithResult(_0x13146a,_0x2ba14a){_0x2ba14a=_0x2ba14a||0xc8;return function(_0x10ecb5){if(_0x10ecb5){return _0x13146a['status'](_0x2ba14a)[_0xce63('0x1e')](_0x10ecb5);}};}function respondWithFilteredResult(_0x2c4894,_0x473269){return function(_0x1e7a0a){if(_0x1e7a0a){var _0x595fa4=typeof _0x473269[_0xce63('0x1f')]===_0xce63('0x20')&&typeof _0x473269['limit']===_0xce63('0x20');var _0x171533=_0x1e7a0a[_0xce63('0x21')];var _0x21c0d2=_0x595fa4?0x0:_0x473269[_0xce63('0x1f')];var _0x8a5418=_0x595fa4?_0x1e7a0a[_0xce63('0x21')]:_0x473269[_0xce63('0x1f')]+_0x473269[_0xce63('0x22')];var _0x5032c7;if(_0x8a5418>=_0x171533){_0x8a5418=_0x171533;_0x5032c7=0xc8;}else{_0x5032c7=0xce;}_0x2c4894['status'](_0x5032c7);return _0x2c4894['set']('Content-Range',_0x21c0d2+'-'+_0x8a5418+'/'+_0x171533)['json'](_0x1e7a0a);}return null;};}function patchUpdates(_0x144ec0){return function(_0x101d79){try{jsonpatch[_0xce63('0x23')](_0x101d79,_0x144ec0,!![]);}catch(_0x58e1d0){return BPromise[_0xce63('0x24')](_0x58e1d0);}return _0x101d79[_0xce63('0x25')]();};}function saveUpdates(_0x1771e1,_0x1985e7){return function(_0x3d776a){if(_0x3d776a){return _0x3d776a[_0xce63('0x26')](_0x1771e1)['then'](function(_0x12c851){return _0x12c851;});}return null;};}function removeEntity(_0x33c8bd,_0x28ec11){return function(_0x2e3327){if(_0x2e3327){return _0x2e3327[_0xce63('0x27')]()[_0xce63('0x28')](function(){_0x33c8bd[_0xce63('0x1c')](0xcc)[_0xce63('0x1d')]();});}};}function handleEntityNotFound(_0x56dc39,_0x193cde){return function(_0x304c6a){if(!_0x304c6a){_0x56dc39[_0xce63('0x1b')](0x194);}return _0x304c6a;};}function handleError(_0x2903c0,_0x26b00e){_0x26b00e=_0x26b00e||0x1f4;return function(_0x2d7a9c){logger[_0xce63('0x29')](_0x2d7a9c[_0xce63('0x2a')]);if(_0x2d7a9c['name']){delete _0x2d7a9c[_0xce63('0x2b')];}_0x2903c0['status'](_0x26b00e)[_0xce63('0x2c')](_0x2d7a9c);};}exports[_0xce63('0x2d')]=function(_0x4f9f2c,_0x44cdfe){var _0x17fdb4={},_0x17dae8={},_0x44f4b9={'count':0x0,'rows':[]};var _0x818c46=_[_0xce63('0x2e')](db[_0xce63('0x2f')][_0xce63('0x30')],function(_0xabd390){return{'name':_0xabd390[_0xce63('0x31')],'type':_0xabd390['type']['key']};});_0x17dae8['model']=_[_0xce63('0x2e')](_0x818c46,'name');_0x17dae8['query']=_[_0xce63('0x32')](_0x4f9f2c['query']);_0x17dae8[_0xce63('0x33')]=_[_0xce63('0x34')](_0x17dae8[_0xce63('0x35')],_0x17dae8['query']);_0x17fdb4[_0xce63('0x36')]=_[_0xce63('0x34')](_0x17dae8[_0xce63('0x35')],qs[_0xce63('0x37')](_0x4f9f2c['query'][_0xce63('0x37')]));_0x17fdb4['attributes']=_0x17fdb4[_0xce63('0x36')]['length']?_0x17fdb4[_0xce63('0x36')]:_0x17dae8[_0xce63('0x35')];if(!_0x4f9f2c[_0xce63('0x38')][_0xce63('0x39')]('nolimit')){_0x17fdb4[_0xce63('0x22')]=qs[_0xce63('0x22')](_0x4f9f2c[_0xce63('0x38')][_0xce63('0x22')]);_0x17fdb4[_0xce63('0x1f')]=qs[_0xce63('0x1f')](_0x4f9f2c[_0xce63('0x38')][_0xce63('0x1f')]);}_0x17fdb4[_0xce63('0x3a')]=qs[_0xce63('0x3b')](_0x4f9f2c[_0xce63('0x38')][_0xce63('0x3b')]);_0x17fdb4['where']=qs[_0xce63('0x33')](_[_0xce63('0x3c')](_0x4f9f2c[_0xce63('0x38')],_0x17dae8[_0xce63('0x33')]),_0x818c46);if(_0x4f9f2c[_0xce63('0x38')][_0xce63('0x3d')]){_0x17fdb4[_0xce63('0x3e')]=_[_0xce63('0x3f')](_0x17fdb4[_0xce63('0x3e')],{'$or':_['map'](_0x818c46,function(_0x105bb0){if(_0x105bb0['type']!==_0xce63('0x40')){var _0x421d4d={};_0x421d4d[_0x105bb0[_0xce63('0x2b')]]={'$like':'%'+_0x4f9f2c[_0xce63('0x38')][_0xce63('0x3d')]+'%'};return _0x421d4d;}})});}_0x17fdb4=_[_0xce63('0x3f')]({},_0x17fdb4,_0x4f9f2c[_0xce63('0x41')]);var _0x37b13c={'where':_0x17fdb4['where']};return db[_0xce63('0x2f')][_0xce63('0x21')](_0x37b13c)[_0xce63('0x28')](function(_0x4e7a3b){_0x44f4b9['count']=_0x4e7a3b;if(_0x4f9f2c[_0xce63('0x38')][_0xce63('0x42')]){_0x17fdb4[_0xce63('0x43')]=[{'all':!![]}];}return db[_0xce63('0x2f')][_0xce63('0x44')](_0x17fdb4);})[_0xce63('0x28')](function(_0x40bdae){_0x44f4b9[_0xce63('0x45')]=_0x40bdae;return _0x44f4b9;})[_0xce63('0x28')](respondWithFilteredResult(_0x44cdfe,_0x17fdb4))[_0xce63('0x46')](handleError(_0x44cdfe,null));};exports[_0xce63('0x47')]=function(_0x27b8a5,_0x31f318){var _0x266dc6={'raw':!![],'where':{'id':_0x27b8a5['params']['id']}},_0x5862d7={};_0x5862d7[_0xce63('0x35')]=_[_0xce63('0x32')](db[_0xce63('0x2f')][_0xce63('0x30')]);_0x5862d7[_0xce63('0x38')]=_[_0xce63('0x32')](_0x27b8a5[_0xce63('0x38')]);_0x5862d7[_0xce63('0x33')]=_['intersection'](_0x5862d7[_0xce63('0x35')],_0x5862d7[_0xce63('0x38')]);_0x266dc6[_0xce63('0x36')]=_['intersection'](_0x5862d7[_0xce63('0x35')],qs[_0xce63('0x37')](_0x27b8a5[_0xce63('0x38')]['fields']));_0x266dc6['attributes']=_0x266dc6[_0xce63('0x36')][_0xce63('0x48')]?_0x266dc6[_0xce63('0x36')]:_0x5862d7[_0xce63('0x35')];if(_0x27b8a5[_0xce63('0x38')]['includeAll']){_0x266dc6[_0xce63('0x43')]=[{'all':!![]}];}_0x266dc6=_[_0xce63('0x3f')]({},_0x266dc6,_0x27b8a5[_0xce63('0x41')]);return db['SalesforceField']['find'](_0x266dc6)[_0xce63('0x28')](handleEntityNotFound(_0x31f318,null))['then'](respondWithResult(_0x31f318,null))['catch'](handleError(_0x31f318,null));};exports[_0xce63('0x49')]=function(_0x26edb3,_0x11c5ef){return db[_0xce63('0x2f')][_0xce63('0x49')](_0x26edb3[_0xce63('0x4a')],{})[_0xce63('0x28')](respondWithResult(_0x11c5ef,0xc9))[_0xce63('0x46')](handleError(_0x11c5ef,null));};exports[_0xce63('0x26')]=function(_0x418ce0,_0x175472){if(_0x418ce0[_0xce63('0x4a')]['id']){delete _0x418ce0[_0xce63('0x4a')]['id'];}return db[_0xce63('0x2f')][_0xce63('0x4b')]({'where':{'id':_0x418ce0[_0xce63('0x4c')]['id']}})[_0xce63('0x28')](handleEntityNotFound(_0x175472,null))[_0xce63('0x28')](saveUpdates(_0x418ce0[_0xce63('0x4a')],null))[_0xce63('0x28')](respondWithResult(_0x175472,null))[_0xce63('0x46')](handleError(_0x175472,null));};exports['destroy']=function(_0x55bdd1,_0x246115){return db['SalesforceField'][_0xce63('0x4b')]({'where':{'id':_0x55bdd1[_0xce63('0x4c')]['id']}})[_0xce63('0x28')](handleEntityNotFound(_0x246115,null))[_0xce63('0x28')](removeEntity(_0x246115,null))[_0xce63('0x46')](handleError(_0x246115,null));}; \ No newline at end of file +var _0xd5a0=['ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','name','index','map','SalesforceField','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','eml-format','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x3c1f0,_0x34ee5f){var _0x16a355=function(_0x2affd4){while(--_0x2affd4){_0x3c1f0['push'](_0x3c1f0['shift']());}};_0x16a355(++_0x34ee5f);}(_0xd5a0,0x108));var _0x0d5a=function(_0x58175f,_0x275d92){_0x58175f=_0x58175f-0x0;var _0x37e6bc=_0xd5a0[_0x58175f];return _0x37e6bc;};'use strict';var emlformat=require(_0x0d5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d5a('0x1'));var moment=require(_0x0d5a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0d5a('0x3'));var util=require(_0x0d5a('0x4'));var path=require(_0x0d5a('0x5'));var sox=require(_0x0d5a('0x6'));var csv=require(_0x0d5a('0x7'));var ejs=require(_0x0d5a('0x8'));var fs=require('fs');var fs_extra=require(_0x0d5a('0x9'));var _=require(_0x0d5a('0xa'));var squel=require('squel');var crypto=require(_0x0d5a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0d5a('0x7'));var querystring=require(_0x0d5a('0xc'));var Papa=require(_0x0d5a('0xd'));var Redis=require(_0x0d5a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0d5a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d5a('0x10'));var logger=require('../../config/logger')(_0x0d5a('0x11'));var utils=require('../../config/utils');var config=require(_0x0d5a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d5a('0x13'))['db'];function respondWithStatusCode(_0x308b9e,_0x567098){_0x567098=_0x567098||0xcc;return function(_0x13b91e){if(_0x13b91e){return _0x308b9e[_0x0d5a('0x14')](_0x567098);}return _0x308b9e[_0x0d5a('0x15')](_0x567098)[_0x0d5a('0x16')]();};}function respondWithResult(_0x52e149,_0x5e282a){_0x5e282a=_0x5e282a||0xc8;return function(_0x66686f){if(_0x66686f){return _0x52e149[_0x0d5a('0x15')](_0x5e282a)[_0x0d5a('0x17')](_0x66686f);}};}function respondWithFilteredResult(_0x56499a,_0x5bac60){return function(_0x32e287){if(_0x32e287){var _0x317709=typeof _0x5bac60[_0x0d5a('0x18')]===_0x0d5a('0x19')&&typeof _0x5bac60['limit']===_0x0d5a('0x19');var _0x46d703=_0x32e287[_0x0d5a('0x1a')];var _0x204e53=_0x317709?0x0:_0x5bac60[_0x0d5a('0x18')];var _0x2626f8=_0x317709?_0x32e287['count']:_0x5bac60[_0x0d5a('0x18')]+_0x5bac60[_0x0d5a('0x1b')];var _0xeb007;if(_0x2626f8>=_0x46d703){_0x2626f8=_0x46d703;_0xeb007=0xc8;}else{_0xeb007=0xce;}_0x56499a[_0x0d5a('0x15')](_0xeb007);return _0x56499a[_0x0d5a('0x1c')]('Content-Range',_0x204e53+'-'+_0x2626f8+'/'+_0x46d703)[_0x0d5a('0x17')](_0x32e287);}return null;};}function patchUpdates(_0x5663b7){return function(_0x5d8aeb){try{jsonpatch[_0x0d5a('0x1d')](_0x5d8aeb,_0x5663b7,!![]);}catch(_0x47e709){return BPromise[_0x0d5a('0x1e')](_0x47e709);}return _0x5d8aeb[_0x0d5a('0x1f')]();};}function saveUpdates(_0x5d48ea,_0x4a0243){return function(_0x2e235e){if(_0x2e235e){return _0x2e235e[_0x0d5a('0x20')](_0x5d48ea)[_0x0d5a('0x21')](function(_0x3b928b){return _0x3b928b;});}return null;};}function removeEntity(_0x1e44cd,_0x49810e){return function(_0x2a9cb3){if(_0x2a9cb3){return _0x2a9cb3[_0x0d5a('0x22')]()[_0x0d5a('0x21')](function(){_0x1e44cd[_0x0d5a('0x15')](0xcc)[_0x0d5a('0x16')]();});}};}function handleEntityNotFound(_0x34ec4f,_0x18949e){return function(_0x1b1824){if(!_0x1b1824){_0x34ec4f[_0x0d5a('0x14')](0x194);}return _0x1b1824;};}function handleError(_0x26aec6,_0x2d5af0){_0x2d5af0=_0x2d5af0||0x1f4;return function(_0x2c8f15){logger[_0x0d5a('0x23')](_0x2c8f15['stack']);if(_0x2c8f15[_0x0d5a('0x24')]){delete _0x2c8f15['name'];}_0x26aec6[_0x0d5a('0x15')](_0x2d5af0)['send'](_0x2c8f15);};}exports[_0x0d5a('0x25')]=function(_0x5014b2,_0x2c081b){var _0x4ad250={},_0x1780a1={},_0x5e45be={'count':0x0,'rows':[]};var _0x45e29f=_[_0x0d5a('0x26')](db[_0x0d5a('0x27')][_0x0d5a('0x28')],function(_0x5284){return{'name':_0x5284['fieldName'],'type':_0x5284[_0x0d5a('0x29')][_0x0d5a('0x2a')]};});_0x1780a1['model']=_[_0x0d5a('0x26')](_0x45e29f,'name');_0x1780a1[_0x0d5a('0x2b')]=_[_0x0d5a('0x2c')](_0x5014b2[_0x0d5a('0x2b')]);_0x1780a1[_0x0d5a('0x2d')]=_['intersection'](_0x1780a1[_0x0d5a('0x2e')],_0x1780a1[_0x0d5a('0x2b')]);_0x4ad250[_0x0d5a('0x2f')]=_[_0x0d5a('0x30')](_0x1780a1[_0x0d5a('0x2e')],qs[_0x0d5a('0x31')](_0x5014b2[_0x0d5a('0x2b')][_0x0d5a('0x31')]));_0x4ad250[_0x0d5a('0x2f')]=_0x4ad250[_0x0d5a('0x2f')][_0x0d5a('0x32')]?_0x4ad250[_0x0d5a('0x2f')]:_0x1780a1[_0x0d5a('0x2e')];if(!_0x5014b2['query'][_0x0d5a('0x33')](_0x0d5a('0x34'))){_0x4ad250['limit']=qs[_0x0d5a('0x1b')](_0x5014b2[_0x0d5a('0x2b')][_0x0d5a('0x1b')]);_0x4ad250[_0x0d5a('0x18')]=qs[_0x0d5a('0x18')](_0x5014b2[_0x0d5a('0x2b')][_0x0d5a('0x18')]);}_0x4ad250[_0x0d5a('0x35')]=qs['sort'](_0x5014b2[_0x0d5a('0x2b')][_0x0d5a('0x36')]);_0x4ad250['where']=qs[_0x0d5a('0x2d')](_['pick'](_0x5014b2[_0x0d5a('0x2b')],_0x1780a1[_0x0d5a('0x2d')]),_0x45e29f);if(_0x5014b2[_0x0d5a('0x2b')][_0x0d5a('0x37')]){_0x4ad250['where']=_[_0x0d5a('0x38')](_0x4ad250['where'],{'$or':_['map'](_0x45e29f,function(_0x32be09){if(_0x32be09[_0x0d5a('0x29')]!==_0x0d5a('0x39')){var _0xe817b7={};_0xe817b7[_0x32be09['name']]={'$like':'%'+_0x5014b2['query'][_0x0d5a('0x37')]+'%'};return _0xe817b7;}})});}_0x4ad250=_[_0x0d5a('0x38')]({},_0x4ad250,_0x5014b2['options']);var _0xb85df4={'where':_0x4ad250['where']};return db[_0x0d5a('0x27')][_0x0d5a('0x1a')](_0xb85df4)[_0x0d5a('0x21')](function(_0x8214c7){_0x5e45be[_0x0d5a('0x1a')]=_0x8214c7;if(_0x5014b2[_0x0d5a('0x2b')][_0x0d5a('0x3a')]){_0x4ad250[_0x0d5a('0x3b')]=[{'all':!![]}];}return db['SalesforceField'][_0x0d5a('0x3c')](_0x4ad250);})[_0x0d5a('0x21')](function(_0x5a8358){_0x5e45be['rows']=_0x5a8358;return _0x5e45be;})[_0x0d5a('0x21')](respondWithFilteredResult(_0x2c081b,_0x4ad250))[_0x0d5a('0x3d')](handleError(_0x2c081b,null));};exports[_0x0d5a('0x3e')]=function(_0xc34a64,_0x1471a0){var _0x59dd34={'raw':!![],'where':{'id':_0xc34a64[_0x0d5a('0x3f')]['id']}},_0x4760c8={};_0x4760c8[_0x0d5a('0x2e')]=_[_0x0d5a('0x2c')](db[_0x0d5a('0x27')]['rawAttributes']);_0x4760c8[_0x0d5a('0x2b')]=_[_0x0d5a('0x2c')](_0xc34a64[_0x0d5a('0x2b')]);_0x4760c8['filters']=_['intersection'](_0x4760c8[_0x0d5a('0x2e')],_0x4760c8['query']);_0x59dd34[_0x0d5a('0x2f')]=_[_0x0d5a('0x30')](_0x4760c8[_0x0d5a('0x2e')],qs[_0x0d5a('0x31')](_0xc34a64[_0x0d5a('0x2b')][_0x0d5a('0x31')]));_0x59dd34[_0x0d5a('0x2f')]=_0x59dd34[_0x0d5a('0x2f')][_0x0d5a('0x32')]?_0x59dd34[_0x0d5a('0x2f')]:_0x4760c8['model'];if(_0xc34a64[_0x0d5a('0x2b')][_0x0d5a('0x3a')]){_0x59dd34[_0x0d5a('0x3b')]=[{'all':!![]}];}_0x59dd34=_[_0x0d5a('0x38')]({},_0x59dd34,_0xc34a64[_0x0d5a('0x40')]);return db[_0x0d5a('0x27')][_0x0d5a('0x41')](_0x59dd34)[_0x0d5a('0x21')](handleEntityNotFound(_0x1471a0,null))['then'](respondWithResult(_0x1471a0,null))[_0x0d5a('0x3d')](handleError(_0x1471a0,null));};exports['create']=function(_0x324465,_0x12aecb){return db[_0x0d5a('0x27')][_0x0d5a('0x42')](_0x324465['body'],{})[_0x0d5a('0x21')](respondWithResult(_0x12aecb,0xc9))[_0x0d5a('0x3d')](handleError(_0x12aecb,null));};exports[_0x0d5a('0x20')]=function(_0x86b540,_0x5151ec){if(_0x86b540['body']['id']){delete _0x86b540[_0x0d5a('0x43')]['id'];}return db['SalesforceField'][_0x0d5a('0x41')]({'where':{'id':_0x86b540[_0x0d5a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5151ec,null))[_0x0d5a('0x21')](saveUpdates(_0x86b540[_0x0d5a('0x43')],null))[_0x0d5a('0x21')](respondWithResult(_0x5151ec,null))[_0x0d5a('0x3d')](handleError(_0x5151ec,null));};exports['destroy']=function(_0x102908,_0x3cff0e){return db[_0x0d5a('0x27')][_0x0d5a('0x41')]({'where':{'id':_0x102908[_0x0d5a('0x3f')]['id']}})[_0x0d5a('0x21')](handleEntityNotFound(_0x3cff0e,null))[_0x0d5a('0x21')](removeEntity(_0x3cff0e,null))[_0x0d5a('0x3d')](handleError(_0x3cff0e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b49fbee..4a46a6c 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 _0x8686=['request-promise','path','rimraf','../../config/environment','define','int_salesforce_fields','idField','FieldId','lodash','util','api','bluebird'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x8686,0x1ac));var _0x6868=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x8686[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0x6868('0x0'));var util=require(_0x6868('0x1'));var logger=require('../../config/logger')(_0x6868('0x2'));var moment=require('moment');var BPromise=require(_0x6868('0x3'));var rp=require(_0x6868('0x4'));var fs=require('fs');var path=require(_0x6868('0x5'));var rimraf=require(_0x6868('0x6'));var config=require(_0x6868('0x7'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x421714,_0x359146){return _0x421714[_0x6868('0x8')]('SalesforceField',attributes,{'tableName':_0x6868('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x6868('0xa'),_0x6868('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x531d=['moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x5c1664,_0x33058f){var _0x5efce4=function(_0x2f6b72){while(--_0x2f6b72){_0x5c1664['push'](_0x5c1664['shift']());}};_0x5efce4(++_0x33058f);}(_0x531d,0x123));var _0xd531=function(_0x4f6c38,_0x1d06d3){_0x4f6c38=_0x4f6c38-0x0;var _0x2b7e4b=_0x531d[_0x4f6c38];return _0x2b7e4b;};'use strict';var _=require('lodash');var util=require(_0xd531('0x0'));var logger=require(_0xd531('0x1'))(_0xd531('0x2'));var moment=require(_0xd531('0x3'));var BPromise=require('bluebird');var rp=require(_0xd531('0x4'));var fs=require('fs');var path=require(_0xd531('0x5'));var rimraf=require(_0xd531('0x6'));var config=require(_0xd531('0x7'));var attributes=require(_0xd531('0x8'));module['exports']=function(_0x13a9d7,_0x56afef){return _0x13a9d7['define'](_0xd531('0x9'),attributes,{'tableName':_0xd531('0xa'),'paranoid':![],'indexes':[{'name':_0xd531('0xb'),'fields':[_0xd531('0xc'),_0xd531('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index c89ff14..ca4888f 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 _0x47d3=['debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x3a6625,_0x117cde){var _0x4adb96=function(_0x426961){while(--_0x426961){_0x3a6625['push'](_0x3a6625['shift']());}};_0x4adb96(++_0x117cde);}(_0x47d3,0x103));var _0x347d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47d3[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x347d('0x0'));var BPromise=require(_0x347d('0x1'));var rs=require(_0x347d('0x2'));var fs=require('fs');var Redis=require(_0x347d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x347d('0x4'));var logger=require(_0x347d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0827,_0x3c5cde,_0x5e438f){return new BPromise(function(_0xccc441,_0x5f328e){return client[_0x347d('0x6')](_0x4a0827,_0x5e438f)[_0x347d('0x7')](function(_0x23f54c){logger[_0x347d('0x8')](_0x347d('0x9'),_0x3c5cde,_0x347d('0xa'));logger[_0x347d('0xb')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3c5cde,'request\x20sent',JSON[_0x347d('0xc')](_0x23f54c));if(_0x23f54c[_0x347d('0xd')]){if(_0x23f54c['error'][_0x347d('0xe')]===0x1f4){logger[_0x347d('0xd')](_0x347d('0x9'),_0x3c5cde,_0x23f54c[_0x347d('0xd')]['message']);return _0x5f328e(_0x23f54c[_0x347d('0xd')][_0x347d('0xf')]);}logger[_0x347d('0xd')](_0x347d('0x9'),_0x3c5cde,_0x23f54c[_0x347d('0xd')]['message']);return _0xccc441(_0x23f54c[_0x347d('0xd')][_0x347d('0xf')]);}else{logger['info'](_0x347d('0x9'),_0x3c5cde,'request\x20sent');_0xccc441(_0x23f54c[_0x347d('0x10')][_0x347d('0xf')]);}})[_0x347d('0x11')](function(_0x36754f){logger[_0x347d('0xd')](_0x347d('0x9'),_0x3c5cde,_0x36754f);_0x5f328e(_0x36754f);});});} \ No newline at end of file +var _0xb63c=['then','info','request\x20sent','debug','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','http','request'];(function(_0x515f02,_0x503478){var _0x464e3e=function(_0x341fb2){while(--_0x341fb2){_0x515f02['push'](_0x515f02['shift']());}};_0x464e3e(++_0x503478);}(_0xb63c,0x89));var _0xcb63=function(_0x19262a,_0x2cd433){_0x19262a=_0x19262a-0x0;var _0x456d70=_0xb63c[_0x19262a];return _0x456d70;};'use strict';var _=require(_0xcb63('0x0'));var util=require(_0xcb63('0x1'));var moment=require(_0xcb63('0x2'));var BPromise=require(_0xcb63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb63('0x4'))['db'];var utils=require(_0xcb63('0x5'));var logger=require('../../config/logger')(_0xcb63('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb63('0x7')][_0xcb63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f7b10,_0x19bfe5,_0x3643d7){return new BPromise(function(_0x34522a,_0x36eff7){return client[_0xcb63('0x9')](_0x1f7b10,_0x3643d7)[_0xcb63('0xa')](function(_0x5cd044){logger[_0xcb63('0xb')]('SalesforceField,\x20%s,\x20%s',_0x19bfe5,_0xcb63('0xc'));logger[_0xcb63('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x19bfe5,_0xcb63('0xc'),JSON[_0xcb63('0xe')](_0x5cd044));if(_0x5cd044[_0xcb63('0xf')]){if(_0x5cd044[_0xcb63('0xf')][_0xcb63('0x10')]===0x1f4){logger[_0xcb63('0xf')]('SalesforceField,\x20%s,\x20%s',_0x19bfe5,_0x5cd044[_0xcb63('0xf')][_0xcb63('0x11')]);return _0x36eff7(_0x5cd044[_0xcb63('0xf')][_0xcb63('0x11')]);}logger[_0xcb63('0xf')](_0xcb63('0x12'),_0x19bfe5,_0x5cd044['error']['message']);return _0x34522a(_0x5cd044['error']['message']);}else{logger['info'](_0xcb63('0x12'),_0x19bfe5,_0xcb63('0xc'));_0x34522a(_0x5cd044[_0xcb63('0x13')]['message']);}})[_0xcb63('0x14')](function(_0x2161cc){logger[_0xcb63('0xf')](_0xcb63('0x12'),_0x19bfe5,_0x2161cc);_0x36eff7(_0x2161cc);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0c2d497..a0c2396 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 _0x7f9c=['post','create','addConfiguration','put','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x26997e,_0xcff785){var _0x13b40a=function(_0x177819){while(--_0x177819){_0x26997e['push'](_0x26997e['shift']());}};_0x13b40a(++_0xcff785);}(_0x7f9c,0x8c));var _0xc7f9=function(_0x23192f,_0xd4cae4){_0x23192f=_0x23192f-0x0;var _0x3c6422=_0x7f9c[_0x23192f];return _0x3c6422;};'use strict';var multer=require('multer');var util=require(_0xc7f9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7f9('0x1'));var router=express['Router']();var fs_extra=require(_0xc7f9('0x2'));var auth=require(_0xc7f9('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc7f9('0x4'));router[_0xc7f9('0x5')]('/',auth[_0xc7f9('0x6')](),controller[_0xc7f9('0x7')]);router[_0xc7f9('0x5')](_0xc7f9('0x8'),auth[_0xc7f9('0x6')](),controller['show']);router[_0xc7f9('0x5')](_0xc7f9('0x9'),auth[_0xc7f9('0x6')](),controller[_0xc7f9('0xa')]);router[_0xc7f9('0x5')]('/:id/fields',auth[_0xc7f9('0x6')](),controller[_0xc7f9('0xb')]);router[_0xc7f9('0xc')]('/',auth['isAuthenticated'](),controller[_0xc7f9('0xd')]);router[_0xc7f9('0xc')](_0xc7f9('0x9'),auth[_0xc7f9('0x6')](),controller[_0xc7f9('0xe')]);router[_0xc7f9('0xf')]('/:id',auth[_0xc7f9('0x6')](),controller['update']);router[_0xc7f9('0x10')](_0xc7f9('0x8'),auth['isAuthenticated'](),controller[_0xc7f9('0x11')]);module[_0xc7f9('0x12')]=router; \ No newline at end of file +var _0x9db3=['../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x30dfe6,_0x3882f3){var _0x21691b=function(_0x4ca6ba){while(--_0x4ca6ba){_0x30dfe6['push'](_0x30dfe6['shift']());}};_0x21691b(++_0x3882f3);}(_0x9db3,0xe0));var _0x39db=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9db3[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x39db('0x0'));var path=require(_0x39db('0x1'));var timeout=require(_0x39db('0x2'));var express=require(_0x39db('0x3'));var router=express[_0x39db('0x4')]();var fs_extra=require(_0x39db('0x5'));var auth=require(_0x39db('0x6'));var interaction=require(_0x39db('0x7'));var config=require('../../config/environment');var controller=require(_0x39db('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x39db('0x9')]('/:id',auth[_0x39db('0xa')](),controller['show']);router[_0x39db('0x9')](_0x39db('0xb'),auth[_0x39db('0xa')](),controller['getConfigurations']);router[_0x39db('0x9')](_0x39db('0xc'),auth[_0x39db('0xa')](),controller[_0x39db('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x39db('0xe')]);router[_0x39db('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x39db('0x10')]);router[_0x39db('0x11')]('/:id',auth[_0x39db('0xa')](),controller['update']);router[_0x39db('0x12')](_0x39db('0x13'),auth[_0x39db('0xa')](),controller[_0x39db('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 37f731d..c3b8cbb 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 _0xb841=['exports','STRING','username','remoteUri','sequelize'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xb841,0x130));var _0x1b84=function(_0x4143ec,_0x3d2fe5){_0x4143ec=_0x4143ec-0x0;var _0x52ac58=_0xb841[_0x4143ec];return _0x52ac58;};'use strict';var Sequelize=require(_0x1b84('0x0'));module[_0x1b84('0x1')]={'name':{'type':Sequelize[_0x1b84('0x2')]},'description':{'type':Sequelize[_0x1b84('0x2')]},'username':{'type':Sequelize[_0x1b84('0x2')],'unique':_0x1b84('0x3')},'password':{'type':Sequelize[_0x1b84('0x2')]},'email':{'type':Sequelize[_0x1b84('0x2')]},'remoteUri':{'type':Sequelize[_0x1b84('0x2')],'unique':_0x1b84('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3a33=['username','remoteUri','sequelize','exports','STRING'];(function(_0x16e085,_0x490c53){var _0x726c1a=function(_0x2c7b95){while(--_0x2c7b95){_0x16e085['push'](_0x16e085['shift']());}};_0x726c1a(++_0x490c53);}(_0x3a33,0x8e));var _0x33a3=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x3a33[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0x33a3('0x0'));module[_0x33a3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x33a3('0x2')]},'username':{'type':Sequelize[_0x33a3('0x2')],'unique':_0x33a3('0x3')},'password':{'type':Sequelize[_0x33a3('0x2')]},'email':{'type':Sequelize[_0x33a3('0x2')]},'remoteUri':{'type':Sequelize[_0x33a3('0x2')],'unique':_0x33a3('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 89e6812..e5ad5db 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 _0x0cc2=['log','incident\x20table\x20objects','assign','remove','label','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','False','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','ServicenowAccount','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','findOne','order','getConfigurations','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','priority','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','close_code','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','location','username','password','email','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0cc2,0x185));var _0x20cc=function(_0x50bd98,_0x283199){_0x50bd98=_0x50bd98-0x0;var _0x245b33=_0x0cc2[_0x50bd98];return _0x245b33;};'use strict';var emlformat=require(_0x20cc('0x0'));var rimraf=require(_0x20cc('0x1'));var zipdir=require(_0x20cc('0x2'));var jsonpatch=require(_0x20cc('0x3'));var rp=require(_0x20cc('0x4'));var moment=require(_0x20cc('0x5'));var BPromise=require(_0x20cc('0x6'));var Mustache=require(_0x20cc('0x7'));var util=require(_0x20cc('0x8'));var path=require('path');var sox=require(_0x20cc('0x9'));var csv=require(_0x20cc('0xa'));var ejs=require(_0x20cc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x20cc('0xc'));var crypto=require(_0x20cc('0xd'));var jsforce=require(_0x20cc('0xe'));var deskjs=require(_0x20cc('0xf'));var toCsv=require(_0x20cc('0xa'));var querystring=require(_0x20cc('0x10'));var Papa=require(_0x20cc('0x11'));var Redis=require(_0x20cc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x20cc('0x13'));var as=require(_0x20cc('0x14'));var hardwareService=require(_0x20cc('0x15'));var logger=require(_0x20cc('0x16'))(_0x20cc('0x17'));var utils=require(_0x20cc('0x18'));var config=require(_0x20cc('0x19'));var licenseUtil=require(_0x20cc('0x1a'));var db=require(_0x20cc('0x1b'))['db'];var integrations=require(_0x20cc('0x1c'));function respondWithStatusCode(_0x2a2e47,_0xcbcb4c){_0xcbcb4c=_0xcbcb4c||0xcc;return function(_0x4393ab){if(_0x4393ab){return _0x2a2e47['sendStatus'](_0xcbcb4c);}return _0x2a2e47[_0x20cc('0x1d')](_0xcbcb4c)['end']();};}function respondWithResult(_0x39644b,_0x151b7a){_0x151b7a=_0x151b7a||0xc8;return function(_0x38c33f){if(_0x38c33f){return _0x39644b[_0x20cc('0x1d')](_0x151b7a)[_0x20cc('0x1e')](_0x38c33f);}};}function respondWithFilteredResult(_0x582490,_0x467fce){return function(_0x413264){if(_0x413264){var _0x45fdbc=typeof _0x467fce[_0x20cc('0x1f')]===_0x20cc('0x20')&&typeof _0x467fce[_0x20cc('0x21')]==='undefined';var _0x12fca7=_0x413264[_0x20cc('0x22')];var _0x523197=_0x45fdbc?0x0:_0x467fce['offset'];var _0x30ff51=_0x45fdbc?_0x413264[_0x20cc('0x22')]:_0x467fce[_0x20cc('0x1f')]+_0x467fce[_0x20cc('0x21')];var _0x151cd6;if(_0x30ff51>=_0x12fca7){_0x30ff51=_0x12fca7;_0x151cd6=0xc8;}else{_0x151cd6=0xce;}_0x582490[_0x20cc('0x1d')](_0x151cd6);return _0x582490[_0x20cc('0x23')](_0x20cc('0x24'),_0x523197+'-'+_0x30ff51+'/'+_0x12fca7)[_0x20cc('0x1e')](_0x413264);}return null;};}function patchUpdates(_0x28fd99){return function(_0x389e46){try{jsonpatch[_0x20cc('0x25')](_0x389e46,_0x28fd99,!![]);}catch(_0xa7cf95){return BPromise[_0x20cc('0x26')](_0xa7cf95);}return _0x389e46['save']();};}function saveUpdates(_0x1f3d5a,_0x3df822){return function(_0x3c8e00){if(_0x3c8e00){return _0x3c8e00[_0x20cc('0x27')](_0x1f3d5a)[_0x20cc('0x28')](function(_0x1c715a){return _0x1c715a;});}return null;};}function removeEntity(_0x571282,_0x3e8768){return function(_0x11389d){if(_0x11389d){return _0x11389d['destroy']()[_0x20cc('0x28')](function(){_0x571282[_0x20cc('0x1d')](0xcc)[_0x20cc('0x29')]();});}};}function handleEntityNotFound(_0x15465b,_0x3ddb76){return function(_0x5b5151){if(!_0x5b5151){_0x15465b[_0x20cc('0x2a')](0x194);}return _0x5b5151;};}function handleError(_0x2774ba,_0x1219ed){_0x1219ed=_0x1219ed||0x1f4;return function(_0x884f63){logger[_0x20cc('0x2b')](_0x884f63[_0x20cc('0x2c')]);if(_0x884f63[_0x20cc('0x2d')]){delete _0x884f63['name'];}_0x2774ba['status'](_0x1219ed)[_0x20cc('0x2e')](_0x884f63);};}exports[_0x20cc('0x2f')]=function(_0x366d5f,_0x3c4527){var _0x532b01={},_0x4273f1={},_0x5e229e={'count':0x0,'rows':[]};var _0xb18f6c=_['map'](db['ServicenowAccount'][_0x20cc('0x30')],function(_0x50354b){return{'name':_0x50354b['fieldName'],'type':_0x50354b[_0x20cc('0x31')][_0x20cc('0x32')]};});_0x4273f1[_0x20cc('0x33')]=_[_0x20cc('0x34')](_0xb18f6c,'name');_0x4273f1[_0x20cc('0x35')]=_['keys'](_0x366d5f[_0x20cc('0x35')]);_0x4273f1[_0x20cc('0x36')]=_[_0x20cc('0x37')](_0x4273f1[_0x20cc('0x33')],_0x4273f1[_0x20cc('0x35')]);_0x532b01[_0x20cc('0x38')]=_[_0x20cc('0x37')](_0x4273f1['model'],qs['fields'](_0x366d5f[_0x20cc('0x35')][_0x20cc('0x39')]));_0x532b01[_0x20cc('0x38')]=_0x532b01[_0x20cc('0x38')][_0x20cc('0x3a')]?_0x532b01[_0x20cc('0x38')]:_0x4273f1[_0x20cc('0x33')];if(!_0x366d5f['query']['hasOwnProperty']('nolimit')){_0x532b01[_0x20cc('0x21')]=qs[_0x20cc('0x21')](_0x366d5f[_0x20cc('0x35')][_0x20cc('0x21')]);_0x532b01[_0x20cc('0x1f')]=qs[_0x20cc('0x1f')](_0x366d5f[_0x20cc('0x35')]['offset']);}_0x532b01['order']=qs[_0x20cc('0x3b')](_0x366d5f[_0x20cc('0x35')]['sort']);_0x532b01[_0x20cc('0x3c')]=qs[_0x20cc('0x36')](_[_0x20cc('0x3d')](_0x366d5f[_0x20cc('0x35')],_0x4273f1['filters']),_0xb18f6c);if(_0x366d5f[_0x20cc('0x35')][_0x20cc('0x3e')]){_0x532b01[_0x20cc('0x3c')]=_[_0x20cc('0x3f')](_0x532b01[_0x20cc('0x3c')],{'$or':_['map'](_0xb18f6c,function(_0x2b840e){if(_0x2b840e[_0x20cc('0x31')]!=='VIRTUAL'){var _0x4860e4={};_0x4860e4[_0x2b840e['name']]={'$like':'%'+_0x366d5f[_0x20cc('0x35')][_0x20cc('0x3e')]+'%'};return _0x4860e4;}})});}_0x532b01=_[_0x20cc('0x3f')]({},_0x532b01,_0x366d5f['options']);var _0x4592ff={'where':_0x532b01[_0x20cc('0x3c')]};return db[_0x20cc('0x40')][_0x20cc('0x22')](_0x4592ff)['then'](function(_0x54e9eb){_0x5e229e[_0x20cc('0x22')]=_0x54e9eb;if(_0x366d5f[_0x20cc('0x35')][_0x20cc('0x41')]){_0x532b01[_0x20cc('0x42')]=[{'all':!![]}];}return db[_0x20cc('0x40')][_0x20cc('0x43')](_0x532b01);})['then'](function(_0x27ae62){_0x5e229e[_0x20cc('0x44')]=_0x27ae62;return _0x5e229e;})[_0x20cc('0x28')](respondWithFilteredResult(_0x3c4527,_0x532b01))[_0x20cc('0x45')](handleError(_0x3c4527,null));};exports[_0x20cc('0x46')]=function(_0x583177,_0x98048){var _0x985516={'raw':![],'where':{'id':_0x583177[_0x20cc('0x47')]['id']}},_0x26a611={};_0x26a611[_0x20cc('0x33')]=_[_0x20cc('0x48')](db[_0x20cc('0x40')][_0x20cc('0x30')]);_0x26a611[_0x20cc('0x35')]=_[_0x20cc('0x48')](_0x583177[_0x20cc('0x35')]);_0x26a611[_0x20cc('0x36')]=_[_0x20cc('0x37')](_0x26a611[_0x20cc('0x33')],_0x26a611[_0x20cc('0x35')]);_0x985516[_0x20cc('0x38')]=_[_0x20cc('0x37')](_0x26a611[_0x20cc('0x33')],qs['fields'](_0x583177[_0x20cc('0x35')]['fields']));_0x985516[_0x20cc('0x38')]=_0x985516[_0x20cc('0x38')]['length']?_0x985516['attributes']:_0x26a611[_0x20cc('0x33')];if(_0x583177[_0x20cc('0x35')][_0x20cc('0x41')]){_0x985516['include']=[{'all':!![]}];}_0x985516=_[_0x20cc('0x3f')]({},_0x985516,_0x583177[_0x20cc('0x49')]);return db[_0x20cc('0x40')][_0x20cc('0x4a')](_0x985516)[_0x20cc('0x28')](handleEntityNotFound(_0x98048,null))[_0x20cc('0x28')](respondWithResult(_0x98048,null))['catch'](handleError(_0x98048,null));};exports[_0x20cc('0x4b')]=function(_0x280e84,_0x364f85){return db[_0x20cc('0x40')][_0x20cc('0x4b')](_0x280e84['body'],{})[_0x20cc('0x28')](respondWithResult(_0x364f85,0xc9))[_0x20cc('0x45')](handleError(_0x364f85,null));};exports[_0x20cc('0x27')]=function(_0x415216,_0x307d81){if(_0x415216['body']['id']){delete _0x415216['body']['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x415216[_0x20cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x307d81,null))[_0x20cc('0x28')](saveUpdates(_0x415216[_0x20cc('0x4c')],null))[_0x20cc('0x28')](respondWithResult(_0x307d81,null))[_0x20cc('0x45')](handleError(_0x307d81,null));};exports['destroy']=function(_0x254951,_0x40c60e){return db[_0x20cc('0x40')][_0x20cc('0x4a')]({'where':{'id':_0x254951[_0x20cc('0x47')]['id']}})[_0x20cc('0x28')](handleEntityNotFound(_0x40c60e,null))['then'](removeEntity(_0x40c60e,null))[_0x20cc('0x45')](handleError(_0x40c60e,null));};exports['getConfigurations']=function(_0x45eecb,_0x46827e,_0x102455){var _0x22bb72={};var _0x2f0fd8={};var _0x1c65dc;var _0x4534e2;return db[_0x20cc('0x40')][_0x20cc('0x4d')]({'where':{'id':_0x45eecb[_0x20cc('0x47')]['id']}})[_0x20cc('0x28')](handleEntityNotFound(_0x46827e,null))[_0x20cc('0x28')](function(_0x21c31b){if(_0x21c31b){_0x1c65dc=_0x21c31b;_0x2f0fd8['model']=_[_0x20cc('0x48')](db['ServicenowConfiguration']['rawAttributes']);_0x2f0fd8['query']=_[_0x20cc('0x48')](_0x45eecb[_0x20cc('0x35')]);_0x2f0fd8[_0x20cc('0x36')]=_[_0x20cc('0x37')](_0x2f0fd8['model'],_0x2f0fd8['query']);_0x22bb72[_0x20cc('0x38')]=_[_0x20cc('0x37')](_0x2f0fd8['model'],qs[_0x20cc('0x39')](_0x45eecb[_0x20cc('0x35')][_0x20cc('0x39')]));_0x22bb72[_0x20cc('0x38')]=_0x22bb72[_0x20cc('0x38')]['length']?_0x22bb72[_0x20cc('0x38')]:_0x2f0fd8[_0x20cc('0x33')];_0x22bb72[_0x20cc('0x4e')]=qs[_0x20cc('0x3b')](_0x45eecb['query'][_0x20cc('0x3b')]);_0x22bb72[_0x20cc('0x3c')]=qs[_0x20cc('0x36')](_[_0x20cc('0x3d')](_0x45eecb['query'],_0x2f0fd8[_0x20cc('0x36')]));if(_0x45eecb[_0x20cc('0x35')][_0x20cc('0x3e')]){_0x22bb72[_0x20cc('0x3c')]=_[_0x20cc('0x3f')](_0x22bb72[_0x20cc('0x3c')],{'$or':_[_0x20cc('0x34')](_0x22bb72[_0x20cc('0x38')],function(_0x51703a){var _0x29f214={};_0x29f214[_0x51703a]={'$like':'%'+_0x45eecb['query'][_0x20cc('0x3e')]+'%'};return _0x29f214;})});}_0x22bb72=_['merge']({},_0x22bb72,_0x45eecb[_0x20cc('0x49')]);return _0x1c65dc[_0x20cc('0x4f')](_0x22bb72);}})[_0x20cc('0x28')](function(_0x28e196){if(_0x28e196){_0x4534e2=_0x28e196[_0x20cc('0x3a')];if(!_0x45eecb['query']['hasOwnProperty']('nolimit')){_0x22bb72[_0x20cc('0x21')]=qs[_0x20cc('0x21')](_0x45eecb[_0x20cc('0x35')][_0x20cc('0x21')]);_0x22bb72[_0x20cc('0x1f')]=qs[_0x20cc('0x1f')](_0x45eecb['query'][_0x20cc('0x1f')]);}return _0x1c65dc[_0x20cc('0x4f')](_0x22bb72);}})[_0x20cc('0x28')](function(_0x75b73c){if(_0x75b73c){return _0x75b73c?{'count':_0x4534e2,'rows':_0x75b73c}:null;}})['then'](respondWithResult(_0x46827e,null))[_0x20cc('0x45')](handleError(_0x46827e,null));};exports['addConfiguration']=function(_0x54e3b6,_0x521b3e,_0xf66002){if(_0x54e3b6[_0x20cc('0x4c')]['id']){delete _0x54e3b6[_0x20cc('0x4c')]['id'];}return db[_0x20cc('0x40')]['findOne']({'where':{'id':_0x54e3b6[_0x20cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x521b3e,null))['then'](function(_0x5d8608){if(_0x5d8608){_0x54e3b6['body'][_0x20cc('0x50')]=_0x5d8608['id'];_0x54e3b6[_0x20cc('0x4c')][_0x20cc('0x51')]=integrations['getSubjects'](_0x54e3b6[_0x20cc('0x4c')][_0x20cc('0x52')],_0x54e3b6['body']['type']);_0x54e3b6[_0x20cc('0x4c')][_0x20cc('0x53')]=integrations[_0x20cc('0x54')](_0x54e3b6[_0x20cc('0x4c')]['channel'],_0x54e3b6[_0x20cc('0x4c')][_0x20cc('0x31')]);return db[_0x20cc('0x55')][_0x20cc('0x4b')](_0x54e3b6[_0x20cc('0x4c')],{'include':[{'model':db[_0x20cc('0x56')],'as':_0x20cc('0x51')},{'model':db['ServicenowField'],'as':_0x20cc('0x53')}]});}return null;})['then'](respondWithResult(_0x521b3e,null))[_0x20cc('0x45')](handleError(_0x521b3e,null));};exports['getFields']=function(_0x40d17d,_0x465344,_0x13a51a){var _0x14a467=['made_sla',_0x20cc('0x57'),_0x20cc('0x58'),_0x20cc('0x59'),'close_code',_0x20cc('0x5a'),_0x20cc('0x5b'),'severity',_0x20cc('0x5c')];var _0x4e6b28=[_0x20cc('0x5d'),_0x20cc('0x5e'),_0x20cc('0x5f'),_0x20cc('0x60'),_0x20cc('0x61'),_0x20cc('0x62'),_0x20cc('0x63'),_0x20cc('0x57'),'approval_history',_0x20cc('0x64'),_0x20cc('0x65'),_0x20cc('0x66'),'opened_by',_0x20cc('0x67'),'sys_created_on',_0x20cc('0x68'),_0x20cc('0x69'),_0x20cc('0x6a'),'knowledge','order',_0x20cc('0x6b'),_0x20cc('0x6c'),'cmdb_ci',_0x20cc('0x6d'),_0x20cc('0x6e'),'active','work_notes_list','business_service',_0x20cc('0x6f'),'sys_domain_path','rfc','time_worked',_0x20cc('0x70'),_0x20cc('0x71'),_0x20cc('0x72'),_0x20cc('0x73'),_0x20cc('0x74'),'reopened_time',_0x20cc('0x75'),_0x20cc('0x76'),_0x20cc('0x77'),_0x20cc('0x59'),_0x20cc('0x78'),'short_description',_0x20cc('0x79'),_0x20cc('0x7a'),'delivery_task',_0x20cc('0x7b'),_0x20cc('0x7c'),_0x20cc('0x7d'),_0x20cc('0x7e'),_0x20cc('0x7f'),_0x20cc('0x80'),_0x20cc('0x5a'),_0x20cc('0x81'),_0x20cc('0x82'),_0x20cc('0x83'),_0x20cc('0x84'),'parent_incident','sys_id',_0x20cc('0x85'),_0x20cc('0x86'),_0x20cc('0x5b'),_0x20cc('0x87'),_0x20cc('0x88'),_0x20cc('0x89'),_0x20cc('0x8a'),_0x20cc('0x8b'),_0x20cc('0x8c'),_0x20cc('0x8d'),_0x20cc('0x8e'),_0x20cc('0x8f'),_0x20cc('0x90'),_0x20cc('0x91'),_0x20cc('0x92'),_0x20cc('0x93'),_0x20cc('0x94'),'sys_tags',_0x20cc('0x95'),_0x20cc('0x96'),'correlation_id',_0x20cc('0x97'),'category'];var _0x48687c='';var _0x80dc8c='';var _0x45b87a=[];var _0x6bc1ae='';var _0x24cc74='';var _0x5a652d=[];var _0x522e2e='';var _0x1b512d='';var _0x3b6d76={};var _0x1677b6='';return db[_0x20cc('0x40')][_0x20cc('0x4d')]({'where':{'id':_0x40d17d[_0x20cc('0x47')]['id']},'attributes':['id',_0x20cc('0x98'),_0x20cc('0x99'),_0x20cc('0x9a'),_0x20cc('0x9b'),'serverUrl']})[_0x20cc('0x28')](handleEntityNotFound(_0x465344,null))[_0x20cc('0x28')](function(_0x3616db){if(_0x3616db){_0x1677b6=_0x3616db['remoteUri'];var _0x3c38b3=_0x1677b6['slice'](-0x1);if(_0x3c38b3==='/'){_0x1677b6=_0x1677b6[_0x20cc('0x9c')](0x0,_0x1677b6[_0x20cc('0x9d')](_0x3c38b3));}_0x1b512d=util[_0x20cc('0x9e')](_0x20cc('0x9f'),_0x1677b6);_0x522e2e=util[_0x20cc('0x9e')](_0x20cc('0xa0'),_0x1677b6);_0x3b6d76={'user':_0x3616db['username'],'pass':_0x3616db[_0x20cc('0x99')]};var _0x20bca6={'method':_0x20cc('0xa1'),'uri':_0x1b512d+'incident?sysparm_display_value=all','auth':_0x3b6d76,'json':!![]};return rp(_0x20bca6);}})[_0x20cc('0x28')](function(_0x2d6078){if(_0x2d6078[_0x20cc('0xa2')][_0x20cc('0x3a')]>0x0){_0x48687c=_0x2d6078[_0x20cc('0xa2')];}console[_0x20cc('0xa3')](_0x20cc('0xa4'),_0x48687c);_0x5a652d=[];_0x80dc8c=Object[_0x20cc('0xa5')]([],_0x48687c);_[_0x20cc('0xa6')](_0x80dc8c,function(_0x23a03d){return!_0x14a467['includes'](_0x23a03d[_0x20cc('0x2d')]);});_0x80dc8c['forEach'](function(_0xd41ea7){var _0x6e0a5d=createFieldObject(_0x522e2e,_0x3b6d76,_0xd41ea7['internalType'],_0xd41ea7[_0x20cc('0x2d')],_0xd41ea7[_0x20cc('0xa7')],![]);_0x5a652d['push'](_0x6e0a5d);});return Promise[_0x20cc('0xa8')](_0x5a652d);})[_0x20cc('0x28')](function(_0x3e64ae){_0x45b87a=_0x3e64ae;_0x6bc1ae=Object[_0x20cc('0xa5')]([],_0x48687c);console[_0x20cc('0xa3')](_0x20cc('0xa9'),_0x48687c);_[_0x20cc('0xa6')](_0x6bc1ae,function(_0x549d73){return _0x4e6b28[_0x20cc('0xaa')](_0x549d73[_0x20cc('0x2d')]);});console[_0x20cc('0xa3')](_0x20cc('0xab'),_0x6bc1ae);_0x5a652d=[];_0x6bc1ae[_0x20cc('0xac')](function(_0x3fdc9a){var _0x3c3e5c=createFieldObject(_0x522e2e,_0x3b6d76,_0x3fdc9a[_0x20cc('0xad')],_0x3fdc9a[_0x20cc('0x2d')],_0x3fdc9a[_0x20cc('0xa7')],!![]);_0x5a652d[_0x20cc('0xae')](_0x3c3e5c);});return Promise[_0x20cc('0xa8')](_0x5a652d);})[_0x20cc('0x28')](function(_0x315c23){_0x24cc74=_0x315c23;var _0x5b47eb=_0x45b87a[_0x20cc('0xaf')](_0x24cc74);return{'count':_0x5b47eb[_0x20cc('0x3a')],'rows':_0x5b47eb};})[_0x20cc('0x28')](respondWithResult(_0x465344,null))[_0x20cc('0x45')](function(_0x49149c){console['log'](_0x20cc('0xb0')+_0x49149c);var _0x4d090d=_0x40d17d[_0x20cc('0x35')][_0x20cc('0xb1')]?0x1f4:_0x49149c[_0x20cc('0xb2')]||0x1f4;logger[_0x20cc('0x2b')](_0x49149c['stack']);delete _0x49149c[_0x20cc('0x2d')];if(_0x4d090d===0x191){_0x4d090d=0x190;}_0x465344[_0x20cc('0x1d')](_0x4d090d)['send'](_0x40d17d[_0x20cc('0x35')][_0x20cc('0xb1')]?{'message':_0x20cc('0xb3'),'statusCode':_0x49149c['statusCode']}:_0x49149c);});};function createFieldObject(_0x3660ff,_0x2a7e32,_0x430bab,_0x2ab9bc,_0x398c5d,_0x2c432d){return new Promise(function(_0x1333d8,_0x404590){var _0x1b979a={'id':_0x2ab9bc,'name':_0x398c5d,'custom':_0x2c432d};if(_0x430bab===_0x20cc('0xb4')){_0x1b979a[_0x20cc('0x49')]=[{'name':_0x20cc('0xb5'),'value':'true'},{'name':_0x20cc('0xb6'),'value':_0x20cc('0xb7')}];_0x1333d8(_0x1b979a);}else{var _0x109d5a={'method':_0x20cc('0xa1'),'uri':_0x3660ff+'sys_choice?sysparm_query=name=incident^element='+_0x2ab9bc,'auth':_0x2a7e32,'json':!![]};return rp(_0x109d5a)[_0x20cc('0x28')](function(_0x498be5){var _0x4fc4a7=[];if(_0x498be5[_0x20cc('0xa2')][_0x20cc('0x3a')]>0x0){_0x498be5['result'][_0x20cc('0xac')](function(_0x458cf3){if(_0x458cf3['inactive']===_0x20cc('0xb7')){var _0x58b939={'name':_0x458cf3[_0x20cc('0xa7')],'value':_0x458cf3['value']};_0x4fc4a7['push'](_0x58b939);}});}_0x1b979a[_0x20cc('0x49')]=_0x4fc4a7;if(_0x1b979a['options'][_0x20cc('0x3a')]>0x0){_0x1333d8(_0x1b979a);}else{if(_0x2c432d==![]){_0x1333d8();}else{_0x1333d8(_0x1b979a);}}});}});} \ No newline at end of file +var _0xbe22=['upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','calendar_stc','closed_at','delivery_plan','impact','active','sys_domain_path','rfc','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','calendar_duration','closed_by','follow_up','parent_incident','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','due_date','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','send','Wrong\x20credentials','statusCode','boolean','True','true','False','inactive','false','push','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','ServicenowConfiguration','keys','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','close_code','severity','category','parent','caused_by','watch_list'];(function(_0x10d6f5,_0x140245){var _0x484db4=function(_0x2f7ec4){while(--_0x2f7ec4){_0x10d6f5['push'](_0x10d6f5['shift']());}};_0x484db4(++_0x140245);}(_0xbe22,0x118));var _0x2be2=function(_0x168aed,_0x438272){_0x168aed=_0x168aed-0x0;var _0x5b59e9=_0xbe22[_0x168aed];return _0x5b59e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2be2('0x0'));var zipdir=require(_0x2be2('0x1'));var jsonpatch=require(_0x2be2('0x2'));var rp=require(_0x2be2('0x3'));var moment=require(_0x2be2('0x4'));var BPromise=require(_0x2be2('0x5'));var Mustache=require(_0x2be2('0x6'));var util=require('util');var path=require(_0x2be2('0x7'));var sox=require(_0x2be2('0x8'));var csv=require(_0x2be2('0x9'));var ejs=require(_0x2be2('0xa'));var fs=require('fs');var fs_extra=require(_0x2be2('0xb'));var _=require(_0x2be2('0xc'));var squel=require(_0x2be2('0xd'));var crypto=require(_0x2be2('0xe'));var jsforce=require(_0x2be2('0xf'));var deskjs=require(_0x2be2('0x10'));var toCsv=require(_0x2be2('0x9'));var querystring=require(_0x2be2('0x11'));var Papa=require(_0x2be2('0x12'));var Redis=require(_0x2be2('0x13'));var authService=require(_0x2be2('0x14'));var qs=require(_0x2be2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2be2('0x16'));var logger=require(_0x2be2('0x17'))(_0x2be2('0x18'));var utils=require(_0x2be2('0x19'));var config=require(_0x2be2('0x1a'));var licenseUtil=require(_0x2be2('0x1b'));var db=require(_0x2be2('0x1c'))['db'];var integrations=require(_0x2be2('0x1d'));function respondWithStatusCode(_0x4ce6c5,_0xaf603c){_0xaf603c=_0xaf603c||0xcc;return function(_0x1e8fba){if(_0x1e8fba){return _0x4ce6c5[_0x2be2('0x1e')](_0xaf603c);}return _0x4ce6c5[_0x2be2('0x1f')](_0xaf603c)['end']();};}function respondWithResult(_0x1d36ae,_0x153aeb){_0x153aeb=_0x153aeb||0xc8;return function(_0x59bec2){if(_0x59bec2){return _0x1d36ae['status'](_0x153aeb)[_0x2be2('0x20')](_0x59bec2);}};}function respondWithFilteredResult(_0x1895d9,_0x5ded3f){return function(_0xa9883e){if(_0xa9883e){var _0x9c961a=typeof _0x5ded3f['offset']==='undefined'&&typeof _0x5ded3f[_0x2be2('0x21')]===_0x2be2('0x22');var _0x4f923b=_0xa9883e[_0x2be2('0x23')];var _0x1e1ae9=_0x9c961a?0x0:_0x5ded3f[_0x2be2('0x24')];var _0x1f74ad=_0x9c961a?_0xa9883e['count']:_0x5ded3f[_0x2be2('0x24')]+_0x5ded3f[_0x2be2('0x21')];var _0x359573;if(_0x1f74ad>=_0x4f923b){_0x1f74ad=_0x4f923b;_0x359573=0xc8;}else{_0x359573=0xce;}_0x1895d9[_0x2be2('0x1f')](_0x359573);return _0x1895d9[_0x2be2('0x25')](_0x2be2('0x26'),_0x1e1ae9+'-'+_0x1f74ad+'/'+_0x4f923b)['json'](_0xa9883e);}return null;};}function patchUpdates(_0x34a07a){return function(_0x5b1c7d){try{jsonpatch[_0x2be2('0x27')](_0x5b1c7d,_0x34a07a,!![]);}catch(_0x349ba5){return BPromise[_0x2be2('0x28')](_0x349ba5);}return _0x5b1c7d[_0x2be2('0x29')]();};}function saveUpdates(_0x53540a,_0xb5507b){return function(_0x2e5512){if(_0x2e5512){return _0x2e5512[_0x2be2('0x2a')](_0x53540a)['then'](function(_0x386689){return _0x386689;});}return null;};}function removeEntity(_0x1b3b5d,_0x2a6bbf){return function(_0x37772c){if(_0x37772c){return _0x37772c[_0x2be2('0x2b')]()[_0x2be2('0x2c')](function(){_0x1b3b5d[_0x2be2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc13d,_0x76809){return function(_0x7ba82e){if(!_0x7ba82e){_0x1dc13d[_0x2be2('0x1e')](0x194);}return _0x7ba82e;};}function handleError(_0x563e33,_0x370e81){_0x370e81=_0x370e81||0x1f4;return function(_0x129228){logger[_0x2be2('0x2d')](_0x129228[_0x2be2('0x2e')]);if(_0x129228[_0x2be2('0x2f')]){delete _0x129228[_0x2be2('0x2f')];}_0x563e33[_0x2be2('0x1f')](_0x370e81)['send'](_0x129228);};}exports['index']=function(_0x3432e0,_0x44d89c){var _0x277648={},_0x53fa58={},_0x180594={'count':0x0,'rows':[]};var _0x13ce0a=_[_0x2be2('0x30')](db[_0x2be2('0x31')][_0x2be2('0x32')],function(_0x2aacea){return{'name':_0x2aacea[_0x2be2('0x33')],'type':_0x2aacea[_0x2be2('0x34')][_0x2be2('0x35')]};});_0x53fa58[_0x2be2('0x36')]=_[_0x2be2('0x30')](_0x13ce0a,_0x2be2('0x2f'));_0x53fa58['query']=_['keys'](_0x3432e0[_0x2be2('0x37')]);_0x53fa58[_0x2be2('0x38')]=_[_0x2be2('0x39')](_0x53fa58[_0x2be2('0x36')],_0x53fa58['query']);_0x277648[_0x2be2('0x3a')]=_[_0x2be2('0x39')](_0x53fa58[_0x2be2('0x36')],qs[_0x2be2('0x3b')](_0x3432e0[_0x2be2('0x37')]['fields']));_0x277648[_0x2be2('0x3a')]=_0x277648[_0x2be2('0x3a')][_0x2be2('0x3c')]?_0x277648[_0x2be2('0x3a')]:_0x53fa58['model'];if(!_0x3432e0['query'][_0x2be2('0x3d')](_0x2be2('0x3e'))){_0x277648[_0x2be2('0x21')]=qs[_0x2be2('0x21')](_0x3432e0[_0x2be2('0x37')][_0x2be2('0x21')]);_0x277648[_0x2be2('0x24')]=qs[_0x2be2('0x24')](_0x3432e0[_0x2be2('0x37')]['offset']);}_0x277648[_0x2be2('0x3f')]=qs[_0x2be2('0x40')](_0x3432e0['query'][_0x2be2('0x40')]);_0x277648['where']=qs[_0x2be2('0x38')](_[_0x2be2('0x41')](_0x3432e0[_0x2be2('0x37')],_0x53fa58['filters']),_0x13ce0a);if(_0x3432e0[_0x2be2('0x37')][_0x2be2('0x42')]){_0x277648[_0x2be2('0x43')]=_['merge'](_0x277648[_0x2be2('0x43')],{'$or':_['map'](_0x13ce0a,function(_0x3c61d2){if(_0x3c61d2[_0x2be2('0x34')]!==_0x2be2('0x44')){var _0x4c72ef={};_0x4c72ef[_0x3c61d2['name']]={'$like':'%'+_0x3432e0[_0x2be2('0x37')][_0x2be2('0x42')]+'%'};return _0x4c72ef;}})});}_0x277648=_[_0x2be2('0x45')]({},_0x277648,_0x3432e0[_0x2be2('0x46')]);var _0x580224={'where':_0x277648[_0x2be2('0x43')]};return db[_0x2be2('0x31')][_0x2be2('0x23')](_0x580224)[_0x2be2('0x2c')](function(_0x51324d){_0x180594[_0x2be2('0x23')]=_0x51324d;if(_0x3432e0['query'][_0x2be2('0x47')]){_0x277648[_0x2be2('0x48')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x2be2('0x49')](_0x277648);})[_0x2be2('0x2c')](function(_0x4ed102){_0x180594[_0x2be2('0x4a')]=_0x4ed102;return _0x180594;})[_0x2be2('0x2c')](respondWithFilteredResult(_0x44d89c,_0x277648))[_0x2be2('0x4b')](handleError(_0x44d89c,null));};exports[_0x2be2('0x4c')]=function(_0x4108e7,_0x252a6a){var _0x654491={'raw':![],'where':{'id':_0x4108e7[_0x2be2('0x4d')]['id']}},_0x51ead3={};_0x51ead3[_0x2be2('0x36')]=_['keys'](db[_0x2be2('0x31')][_0x2be2('0x32')]);_0x51ead3['query']=_['keys'](_0x4108e7['query']);_0x51ead3['filters']=_[_0x2be2('0x39')](_0x51ead3['model'],_0x51ead3[_0x2be2('0x37')]);_0x654491['attributes']=_[_0x2be2('0x39')](_0x51ead3[_0x2be2('0x36')],qs[_0x2be2('0x3b')](_0x4108e7[_0x2be2('0x37')]['fields']));_0x654491['attributes']=_0x654491[_0x2be2('0x3a')]['length']?_0x654491[_0x2be2('0x3a')]:_0x51ead3[_0x2be2('0x36')];if(_0x4108e7['query'][_0x2be2('0x47')]){_0x654491[_0x2be2('0x48')]=[{'all':!![]}];}_0x654491=_['merge']({},_0x654491,_0x4108e7['options']);return db[_0x2be2('0x31')][_0x2be2('0x4e')](_0x654491)['then'](handleEntityNotFound(_0x252a6a,null))[_0x2be2('0x2c')](respondWithResult(_0x252a6a,null))[_0x2be2('0x4b')](handleError(_0x252a6a,null));};exports[_0x2be2('0x4f')]=function(_0x11f586,_0xf173dc){return db['ServicenowAccount'][_0x2be2('0x4f')](_0x11f586[_0x2be2('0x50')],{})[_0x2be2('0x2c')](respondWithResult(_0xf173dc,0xc9))['catch'](handleError(_0xf173dc,null));};exports[_0x2be2('0x2a')]=function(_0xefad8e,_0x12bb8f){if(_0xefad8e[_0x2be2('0x50')]['id']){delete _0xefad8e[_0x2be2('0x50')]['id'];}return db[_0x2be2('0x31')][_0x2be2('0x4e')]({'where':{'id':_0xefad8e['params']['id']}})[_0x2be2('0x2c')](handleEntityNotFound(_0x12bb8f,null))[_0x2be2('0x2c')](saveUpdates(_0xefad8e['body'],null))[_0x2be2('0x2c')](respondWithResult(_0x12bb8f,null))[_0x2be2('0x4b')](handleError(_0x12bb8f,null));};exports['destroy']=function(_0x18f92d,_0x4940f0){return db['ServicenowAccount'][_0x2be2('0x4e')]({'where':{'id':_0x18f92d[_0x2be2('0x4d')]['id']}})[_0x2be2('0x2c')](handleEntityNotFound(_0x4940f0,null))[_0x2be2('0x2c')](removeEntity(_0x4940f0,null))[_0x2be2('0x4b')](handleError(_0x4940f0,null));};exports['getConfigurations']=function(_0xde149,_0x180250,_0x164ff3){var _0x316f1f={};var _0x41cb4={};var _0x5a2c70;var _0x24ba87;return db[_0x2be2('0x31')]['findOne']({'where':{'id':_0xde149[_0x2be2('0x4d')]['id']}})[_0x2be2('0x2c')](handleEntityNotFound(_0x180250,null))[_0x2be2('0x2c')](function(_0x55687b){if(_0x55687b){_0x5a2c70=_0x55687b;_0x41cb4['model']=_['keys'](db[_0x2be2('0x51')]['rawAttributes']);_0x41cb4[_0x2be2('0x37')]=_[_0x2be2('0x52')](_0xde149[_0x2be2('0x37')]);_0x41cb4[_0x2be2('0x38')]=_['intersection'](_0x41cb4[_0x2be2('0x36')],_0x41cb4[_0x2be2('0x37')]);_0x316f1f[_0x2be2('0x3a')]=_[_0x2be2('0x39')](_0x41cb4[_0x2be2('0x36')],qs[_0x2be2('0x3b')](_0xde149['query'][_0x2be2('0x3b')]));_0x316f1f[_0x2be2('0x3a')]=_0x316f1f[_0x2be2('0x3a')]['length']?_0x316f1f[_0x2be2('0x3a')]:_0x41cb4[_0x2be2('0x36')];_0x316f1f[_0x2be2('0x3f')]=qs['sort'](_0xde149[_0x2be2('0x37')][_0x2be2('0x40')]);_0x316f1f[_0x2be2('0x43')]=qs[_0x2be2('0x38')](_[_0x2be2('0x41')](_0xde149[_0x2be2('0x37')],_0x41cb4[_0x2be2('0x38')]));if(_0xde149['query'][_0x2be2('0x42')]){_0x316f1f[_0x2be2('0x43')]=_[_0x2be2('0x45')](_0x316f1f[_0x2be2('0x43')],{'$or':_[_0x2be2('0x30')](_0x316f1f['attributes'],function(_0xd12791){var _0x43bd95={};_0x43bd95[_0xd12791]={'$like':'%'+_0xde149[_0x2be2('0x37')][_0x2be2('0x42')]+'%'};return _0x43bd95;})});}_0x316f1f=_['merge']({},_0x316f1f,_0xde149[_0x2be2('0x46')]);return _0x5a2c70['getConfigurations'](_0x316f1f);}})[_0x2be2('0x2c')](function(_0x894de5){if(_0x894de5){_0x24ba87=_0x894de5['length'];if(!_0xde149['query'][_0x2be2('0x3d')](_0x2be2('0x3e'))){_0x316f1f[_0x2be2('0x21')]=qs[_0x2be2('0x21')](_0xde149[_0x2be2('0x37')][_0x2be2('0x21')]);_0x316f1f[_0x2be2('0x24')]=qs['offset'](_0xde149[_0x2be2('0x37')][_0x2be2('0x24')]);}return _0x5a2c70[_0x2be2('0x53')](_0x316f1f);}})[_0x2be2('0x2c')](function(_0x519c96){if(_0x519c96){return _0x519c96?{'count':_0x24ba87,'rows':_0x519c96}:null;}})[_0x2be2('0x2c')](respondWithResult(_0x180250,null))[_0x2be2('0x4b')](handleError(_0x180250,null));};exports[_0x2be2('0x54')]=function(_0x501e92,_0x1675d1,_0x1ce0ca){if(_0x501e92['body']['id']){delete _0x501e92[_0x2be2('0x50')]['id'];}return db[_0x2be2('0x31')][_0x2be2('0x55')]({'where':{'id':_0x501e92[_0x2be2('0x4d')]['id']}})[_0x2be2('0x2c')](handleEntityNotFound(_0x1675d1,null))[_0x2be2('0x2c')](function(_0x28b8c9){if(_0x28b8c9){_0x501e92[_0x2be2('0x50')][_0x2be2('0x56')]=_0x28b8c9['id'];_0x501e92['body'][_0x2be2('0x57')]=integrations[_0x2be2('0x58')](_0x501e92[_0x2be2('0x50')][_0x2be2('0x59')],_0x501e92[_0x2be2('0x50')][_0x2be2('0x34')]);_0x501e92[_0x2be2('0x50')][_0x2be2('0x5a')]=integrations[_0x2be2('0x5b')](_0x501e92[_0x2be2('0x50')][_0x2be2('0x59')],_0x501e92[_0x2be2('0x50')]['type']);return db['ServicenowConfiguration'][_0x2be2('0x4f')](_0x501e92[_0x2be2('0x50')],{'include':[{'model':db['ServicenowField'],'as':_0x2be2('0x57')},{'model':db[_0x2be2('0x5c')],'as':'Descriptions'}]});}return null;})[_0x2be2('0x2c')](respondWithResult(_0x1675d1,null))['catch'](handleError(_0x1675d1,null));};exports[_0x2be2('0x5d')]=function(_0x14b388,_0x3f7fdb,_0x1c292f){var _0x5e9018=[_0x2be2('0x5e'),'hold_reason',_0x2be2('0x5f'),'subcategory',_0x2be2('0x60'),'notify','incident_state',_0x2be2('0x61'),_0x2be2('0x62')];var _0x440ed5=[_0x2be2('0x63'),_0x2be2('0x5e'),_0x2be2('0x64'),_0x2be2('0x65'),_0x2be2('0x66'),_0x2be2('0x67'),_0x2be2('0x68'),_0x2be2('0x69'),_0x2be2('0x6a'),_0x2be2('0x6b'),_0x2be2('0x6c'),_0x2be2('0x6d'),'opened_by',_0x2be2('0x6e'),_0x2be2('0x6f'),_0x2be2('0x70'),'state','sys_created_by',_0x2be2('0x5f'),_0x2be2('0x3f'),_0x2be2('0x71'),_0x2be2('0x72'),'cmdb_ci',_0x2be2('0x73'),_0x2be2('0x74'),_0x2be2('0x75'),'work_notes_list','business_service','priority',_0x2be2('0x76'),_0x2be2('0x77'),'time_worked',_0x2be2('0x78'),'opened_at',_0x2be2('0x79'),_0x2be2('0x7a'),_0x2be2('0x7b'),_0x2be2('0x7c'),_0x2be2('0x7d'),_0x2be2('0x7e'),_0x2be2('0x7f'),_0x2be2('0x80'),_0x2be2('0x81'),_0x2be2('0x82'),_0x2be2('0x60'),_0x2be2('0x83'),_0x2be2('0x84'),'work_start',_0x2be2('0x85'),_0x2be2('0x86'),'additional_assignee_list','description',_0x2be2('0x87'),'notify','sys_class_name','close_notes',_0x2be2('0x88'),_0x2be2('0x89'),_0x2be2('0x8a'),'sys_id','contact_type',_0x2be2('0x8b'),_0x2be2('0x8c'),'urgency',_0x2be2('0x8d'),_0x2be2('0x8e'),_0x2be2('0x8f'),_0x2be2('0x90'),'assigned_to',_0x2be2('0x61'),_0x2be2('0x91'),_0x2be2('0x92'),_0x2be2('0x93'),'comments_and_work_notes',_0x2be2('0x94'),'sys_mod_count',_0x2be2('0x95'),_0x2be2('0x96'),'escalation',_0x2be2('0x97'),_0x2be2('0x98'),_0x2be2('0x99'),_0x2be2('0x62')];var _0x48d857='';var _0xa0e52b='';var _0x1e74ef=[];var _0x49c617='';var _0x56c173='';var _0x5ad226=[];var _0x3be3c8='';var _0x253217='';var _0x33cbc6={};var _0x10a986='';return db[_0x2be2('0x31')][_0x2be2('0x55')]({'where':{'id':_0x14b388[_0x2be2('0x4d')]['id']},'attributes':['id',_0x2be2('0x9a'),_0x2be2('0x9b'),_0x2be2('0x9c'),'remoteUri',_0x2be2('0x9d')]})['then'](handleEntityNotFound(_0x3f7fdb,null))[_0x2be2('0x2c')](function(_0x3ef3d3){if(_0x3ef3d3){_0x10a986=_0x3ef3d3[_0x2be2('0x9e')];var _0x19dc58=_0x10a986[_0x2be2('0x9f')](-0x1);if(_0x19dc58==='/'){_0x10a986=_0x10a986[_0x2be2('0xa0')](0x0,_0x10a986[_0x2be2('0xa1')](_0x19dc58));}_0x253217=util[_0x2be2('0xa2')](_0x2be2('0xa3'),_0x10a986);_0x3be3c8=util[_0x2be2('0xa2')](_0x2be2('0xa4'),_0x10a986);_0x33cbc6={'user':_0x3ef3d3[_0x2be2('0x9a')],'pass':_0x3ef3d3['password']};var _0x12bd50={'method':_0x2be2('0xa5'),'uri':_0x253217+_0x2be2('0xa6'),'auth':_0x33cbc6,'json':!![]};return rp(_0x12bd50);}})[_0x2be2('0x2c')](function(_0x1ed246){if(_0x1ed246[_0x2be2('0xa7')][_0x2be2('0x3c')]>0x0){_0x48d857=_0x1ed246['result'];}console[_0x2be2('0xa8')]('incident\x20table\x20objects',_0x48d857);_0x5ad226=[];_0xa0e52b=Object[_0x2be2('0xa9')]([],_0x48d857);_[_0x2be2('0xaa')](_0xa0e52b,function(_0x4f0175){return!_0x5e9018[_0x2be2('0xab')](_0x4f0175[_0x2be2('0x2f')]);});_0xa0e52b[_0x2be2('0xac')](function(_0x201ccc){var _0x3b233e=createFieldObject(_0x3be3c8,_0x33cbc6,_0x201ccc[_0x2be2('0xad')],_0x201ccc[_0x2be2('0x2f')],_0x201ccc[_0x2be2('0xae')],![]);_0x5ad226['push'](_0x3b233e);});return Promise[_0x2be2('0xaf')](_0x5ad226);})[_0x2be2('0x2c')](function(_0x30953f){_0x1e74ef=_0x30953f;_0x49c617=Object[_0x2be2('0xa9')]([],_0x48d857);console['log'](_0x2be2('0xb0'),_0x48d857);_[_0x2be2('0xaa')](_0x49c617,function(_0x3060db){return _0x440ed5[_0x2be2('0xab')](_0x3060db['name']);});console[_0x2be2('0xa8')](_0x2be2('0xb1'),_0x49c617);_0x5ad226=[];_0x49c617[_0x2be2('0xac')](function(_0xdedc98){var _0x10ed3b=createFieldObject(_0x3be3c8,_0x33cbc6,_0xdedc98[_0x2be2('0xad')],_0xdedc98[_0x2be2('0x2f')],_0xdedc98[_0x2be2('0xae')],!![]);_0x5ad226['push'](_0x10ed3b);});return Promise[_0x2be2('0xaf')](_0x5ad226);})[_0x2be2('0x2c')](function(_0x1c6e9b){_0x56c173=_0x1c6e9b;var _0x144a45=_0x1e74ef[_0x2be2('0xb2')](_0x56c173);return{'count':_0x144a45[_0x2be2('0x3c')],'rows':_0x144a45};})[_0x2be2('0x2c')](respondWithResult(_0x3f7fdb,null))[_0x2be2('0x4b')](function(_0x5520eb){console[_0x2be2('0xa8')](_0x2be2('0xb3')+_0x5520eb);var _0x1e7941=_0x14b388['query'][_0x2be2('0xb4')]?0x1f4:_0x5520eb['statusCode']||0x1f4;logger['error'](_0x5520eb[_0x2be2('0x2e')]);delete _0x5520eb[_0x2be2('0x2f')];if(_0x1e7941===0x191){_0x1e7941=0x190;}_0x3f7fdb['status'](_0x1e7941)[_0x2be2('0xb5')](_0x14b388[_0x2be2('0x37')][_0x2be2('0xb4')]?{'message':_0x2be2('0xb6'),'statusCode':_0x5520eb[_0x2be2('0xb7')]}:_0x5520eb);});};function createFieldObject(_0x763f21,_0x29ddb3,_0x2b4fde,_0xc899ed,_0x1dd0e3,_0x157154){return new Promise(function(_0x5ee440,_0x4b38be){var _0x4f067e={'id':_0xc899ed,'name':_0x1dd0e3,'custom':_0x157154};if(_0x2b4fde===_0x2be2('0xb8')){_0x4f067e[_0x2be2('0x46')]=[{'name':_0x2be2('0xb9'),'value':_0x2be2('0xba')},{'name':_0x2be2('0xbb'),'value':'false'}];_0x5ee440(_0x4f067e);}else{var _0x72dd16={'method':_0x2be2('0xa5'),'uri':_0x763f21+'sys_choice?sysparm_query=name=incident^element='+_0xc899ed,'auth':_0x29ddb3,'json':!![]};return rp(_0x72dd16)[_0x2be2('0x2c')](function(_0x4da4c2){var _0x5a5439=[];if(_0x4da4c2[_0x2be2('0xa7')][_0x2be2('0x3c')]>0x0){_0x4da4c2[_0x2be2('0xa7')][_0x2be2('0xac')](function(_0x54cc7d){if(_0x54cc7d[_0x2be2('0xbc')]===_0x2be2('0xbd')){var _0x5a56bd={'name':_0x54cc7d[_0x2be2('0xae')],'value':_0x54cc7d['value']};_0x5a5439[_0x2be2('0xbe')](_0x5a56bd);}});}_0x4f067e[_0x2be2('0x46')]=_0x5a5439;if(_0x4f067e['options'][_0x2be2('0x3c')]>0x0){_0x5ee440(_0x4f067e);}else{if(_0x157154==![]){_0x5ee440();}else{_0x5ee440(_0x4f067e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 4d49bd0..ee549c7 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 _0xda19=['request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment'];(function(_0x12470a,_0x8b3a72){var _0x4d9127=function(_0x25f17b){while(--_0x25f17b){_0x12470a['push'](_0x12470a['shift']());}};_0x4d9127(++_0x8b3a72);}(_0xda19,0xd5));var _0x9da1=function(_0x5c3854,_0x35b107){_0x5c3854=_0x5c3854-0x0;var _0x1cb08e=_0xda19[_0x5c3854];return _0x1cb08e;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));var integrations=require(_0x9da1('0x7'));module[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return _0x2dcbc6[_0x9da1('0x9')](_0x9da1('0xa'),attributes,{'tableName':_0x9da1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x5496,0x175));var _0x6549=function(_0x97e97e,_0x3cdde3){_0x97e97e=_0x97e97e-0x0;var _0x43f0b3=_0x5496[_0x97e97e];return _0x43f0b3;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 2201fb9..144bf10 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 _0xc8ca=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash'];(function(_0x3176be,_0x2c9d84){var _0x463c9b=function(_0x4c8696){while(--_0x4c8696){_0x3176be['push'](_0x3176be['shift']());}};_0x463c9b(++_0x2c9d84);}(_0xc8ca,0x68));var _0xac8c=function(_0x112196,_0x3de7cb){_0x112196=_0x112196-0x0;var _0x59a3a0=_0xc8ca[_0x112196];return _0x59a3a0;};'use strict';var _=require(_0xac8c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xac8c('0x1'));var rs=require(_0xac8c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac8c('0x3'))['db'];var utils=require(_0xac8c('0x4'));var logger=require('../../config/logger')(_0xac8c('0x5'));var config=require(_0xac8c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xac8c('0x7')][_0xac8c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1fd2ea,_0x47d41c,_0x57b4c7){return new BPromise(function(_0x4ef6a1,_0xb47806){return client[_0xac8c('0x9')](_0x1fd2ea,_0x57b4c7)[_0xac8c('0xa')](function(_0x35d637){logger[_0xac8c('0xb')](_0xac8c('0xc'),_0x47d41c,_0xac8c('0xd'));logger[_0xac8c('0xe')](_0xac8c('0xf'),_0x47d41c,'request\x20sent',JSON[_0xac8c('0x10')](_0x35d637));if(_0x35d637['error']){if(_0x35d637[_0xac8c('0x11')][_0xac8c('0x12')]===0x1f4){logger[_0xac8c('0x11')](_0xac8c('0xc'),_0x47d41c,_0x35d637[_0xac8c('0x11')]['message']);return _0xb47806(_0x35d637[_0xac8c('0x11')][_0xac8c('0x13')]);}logger[_0xac8c('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x47d41c,_0x35d637[_0xac8c('0x11')][_0xac8c('0x13')]);return _0x4ef6a1(_0x35d637[_0xac8c('0x11')][_0xac8c('0x13')]);}else{logger[_0xac8c('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x47d41c,_0xac8c('0xd'));_0x4ef6a1(_0x35d637[_0xac8c('0x14')]['message']);}})[_0xac8c('0x15')](function(_0x2dbb41){logger[_0xac8c('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x47d41c,_0x2dbb41);_0xb47806(_0x2dbb41);});});}exports[_0xac8c('0x16')]=function(_0x22de51){var _0x312530=this;return new Promise(function(_0x2a134c,_0x2e021e){return db[_0xac8c('0x17')][_0xac8c('0x18')]({'raw':_0x22de51[_0xac8c('0x19')]?_0x22de51[_0xac8c('0x19')][_0xac8c('0x1a')]===undefined?!![]:![]:!![],'where':_0x22de51[_0xac8c('0x19')]?_0x22de51[_0xac8c('0x19')][_0xac8c('0x1b')]||null:null,'attributes':_0x22de51[_0xac8c('0x19')]?_0x22de51[_0xac8c('0x19')][_0xac8c('0x1c')]||null:null,'limit':_0x22de51['options']?_0x22de51[_0xac8c('0x19')][_0xac8c('0x1d')]||null:null,'include':_0x22de51['options']?_0x22de51[_0xac8c('0x19')][_0xac8c('0x1e')]?_[_0xac8c('0x1f')](_0x22de51[_0xac8c('0x19')][_0xac8c('0x1e')],function(_0x10ada9){return{'model':db[_0x10ada9[_0xac8c('0x20')]],'as':_0x10ada9['as'],'attributes':_0x10ada9[_0xac8c('0x1c')],'include':_0x10ada9[_0xac8c('0x1e')]?_['map'](_0x10ada9[_0xac8c('0x1e')],function(_0x349b13){return{'model':db[_0x349b13[_0xac8c('0x20')]],'as':_0x349b13['as'],'attributes':_0x349b13['attributes'],'include':_0x349b13[_0xac8c('0x1e')]?_[_0xac8c('0x1f')](_0x349b13[_0xac8c('0x1e')],function(_0x33944f){return{'model':db[_0x33944f[_0xac8c('0x20')]],'as':_0x33944f['as'],'attributes':_0x33944f[_0xac8c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac8c('0xa')](function(_0x5a6234){logger[_0xac8c('0xb')](_0xac8c('0x16'),_0x22de51);logger[_0xac8c('0xe')](_0xac8c('0x16'),_0x22de51,JSON[_0xac8c('0x10')](_0x5a6234));_0x2a134c(_0x5a6234);})[_0xac8c('0x15')](function(_0x16a8fc){logger[_0xac8c('0x11')]('GetServicenowAccount',_0x16a8fc[_0xac8c('0x13')],_0x22de51);_0x2e021e(_0x312530[_0xac8c('0x11')](0x1f4,_0x16a8fc[_0xac8c('0x13')]));});});};exports[_0xac8c('0x21')]=function(_0x410ff3){var _0x436d4b=this;return new Promise(function(_0x4ae350,_0x3026af){return db[_0xac8c('0x17')][_0xac8c('0x22')]({'raw':_0x410ff3[_0xac8c('0x19')]?_0x410ff3[_0xac8c('0x19')][_0xac8c('0x1a')]===undefined?!![]:![]:!![],'where':_0x410ff3[_0xac8c('0x19')]?_0x410ff3[_0xac8c('0x19')]['where']||null:null,'attributes':_0x410ff3['options']?_0x410ff3[_0xac8c('0x19')][_0xac8c('0x1c')]||null:null,'include':_0x410ff3[_0xac8c('0x19')]?_0x410ff3[_0xac8c('0x19')]['include']?_[_0xac8c('0x1f')](_0x410ff3['options'][_0xac8c('0x1e')],function(_0x48e124){return{'model':db[_0x48e124[_0xac8c('0x20')]],'as':_0x48e124['as'],'attributes':_0x48e124[_0xac8c('0x1c')],'include':_0x48e124[_0xac8c('0x1e')]?_[_0xac8c('0x1f')](_0x48e124[_0xac8c('0x1e')],function(_0x2cf373){return{'model':db[_0x2cf373['model']],'as':_0x2cf373['as'],'attributes':_0x2cf373[_0xac8c('0x1c')],'include':_0x2cf373[_0xac8c('0x1e')]?_[_0xac8c('0x1f')](_0x2cf373[_0xac8c('0x1e')],function(_0x72bbe3){return{'model':db[_0x72bbe3[_0xac8c('0x20')]],'as':_0x72bbe3['as'],'attributes':_0x72bbe3['attributes']};}):[]};}):[]};}):[]:[]})[_0xac8c('0xa')](function(_0x57dcc5){logger[_0xac8c('0xb')](_0xac8c('0x21'),_0x410ff3);logger['debug'](_0xac8c('0x21'),_0x410ff3,JSON[_0xac8c('0x10')](_0x57dcc5));_0x4ae350(_0x57dcc5);})[_0xac8c('0x15')](function(_0x1ac89e){logger[_0xac8c('0x11')]('ShowServicenowAccount',_0x1ac89e[_0xac8c('0x13')],_0x410ff3);_0x3026af(_0x436d4b[_0xac8c('0x11')](0x1f4,_0x1ac89e[_0xac8c('0x13')]));});});}; \ No newline at end of file +var _0xbe0c=['include','map','model','find','ShowServicenowAccount','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','attributes','limit'];(function(_0x39115e,_0x3c8cf7){var _0x12f730=function(_0x250558){while(--_0x250558){_0x39115e['push'](_0x39115e['shift']());}};_0x12f730(++_0x3c8cf7);}(_0xbe0c,0x15a));var _0xcbe0=function(_0x4d063f,_0x32f1fd){_0x4d063f=_0x4d063f-0x0;var _0x597d8a=_0xbe0c[_0x4d063f];return _0x597d8a;};'use strict';var _=require(_0xcbe0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbe0('0x1'));var rs=require(_0xcbe0('0x2'));var fs=require('fs');var Redis=require(_0xcbe0('0x3'));var db=require(_0xcbe0('0x4'))['db'];var utils=require(_0xcbe0('0x5'));var logger=require(_0xcbe0('0x6'))(_0xcbe0('0x7'));var config=require(_0xcbe0('0x8'));var jayson=require(_0xcbe0('0x9'));var client=jayson[_0xcbe0('0xa')][_0xcbe0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f68ac,_0x23a0e3,_0x27ca8c){return new BPromise(function(_0x2ffac6,_0x59e73b){return client['request'](_0x3f68ac,_0x27ca8c)[_0xcbe0('0xc')](function(_0x49839f){logger[_0xcbe0('0xd')](_0xcbe0('0xe'),_0x23a0e3,_0xcbe0('0xf'));logger['debug'](_0xcbe0('0x10'),_0x23a0e3,_0xcbe0('0xf'),JSON[_0xcbe0('0x11')](_0x49839f));if(_0x49839f[_0xcbe0('0x12')]){if(_0x49839f[_0xcbe0('0x12')]['code']===0x1f4){logger[_0xcbe0('0x12')](_0xcbe0('0xe'),_0x23a0e3,_0x49839f[_0xcbe0('0x12')][_0xcbe0('0x13')]);return _0x59e73b(_0x49839f[_0xcbe0('0x12')]['message']);}logger[_0xcbe0('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x23a0e3,_0x49839f[_0xcbe0('0x12')][_0xcbe0('0x13')]);return _0x2ffac6(_0x49839f[_0xcbe0('0x12')][_0xcbe0('0x13')]);}else{logger[_0xcbe0('0xd')](_0xcbe0('0xe'),_0x23a0e3,_0xcbe0('0xf'));_0x2ffac6(_0x49839f[_0xcbe0('0x14')][_0xcbe0('0x13')]);}})[_0xcbe0('0x15')](function(_0x4fb4e8){logger[_0xcbe0('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x23a0e3,_0x4fb4e8);_0x59e73b(_0x4fb4e8);});});}exports[_0xcbe0('0x16')]=function(_0x81beb0){var _0x1f519a=this;return new Promise(function(_0x1049c9,_0x5d3747){return db[_0xcbe0('0x17')]['findAll']({'raw':_0x81beb0[_0xcbe0('0x18')]?_0x81beb0[_0xcbe0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x81beb0[_0xcbe0('0x18')]?_0x81beb0[_0xcbe0('0x18')][_0xcbe0('0x19')]||null:null,'attributes':_0x81beb0['options']?_0x81beb0[_0xcbe0('0x18')][_0xcbe0('0x1a')]||null:null,'limit':_0x81beb0['options']?_0x81beb0[_0xcbe0('0x18')][_0xcbe0('0x1b')]||null:null,'include':_0x81beb0[_0xcbe0('0x18')]?_0x81beb0[_0xcbe0('0x18')][_0xcbe0('0x1c')]?_[_0xcbe0('0x1d')](_0x81beb0[_0xcbe0('0x18')][_0xcbe0('0x1c')],function(_0x47fc4d){return{'model':db[_0x47fc4d['model']],'as':_0x47fc4d['as'],'attributes':_0x47fc4d['attributes'],'include':_0x47fc4d[_0xcbe0('0x1c')]?_[_0xcbe0('0x1d')](_0x47fc4d[_0xcbe0('0x1c')],function(_0x14decb){return{'model':db[_0x14decb['model']],'as':_0x14decb['as'],'attributes':_0x14decb[_0xcbe0('0x1a')],'include':_0x14decb['include']?_[_0xcbe0('0x1d')](_0x14decb[_0xcbe0('0x1c')],function(_0x2fdecc){return{'model':db[_0x2fdecc[_0xcbe0('0x1e')]],'as':_0x2fdecc['as'],'attributes':_0x2fdecc[_0xcbe0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10a126){logger[_0xcbe0('0xd')](_0xcbe0('0x16'),_0x81beb0);logger['debug']('GetServicenowAccount',_0x81beb0,JSON[_0xcbe0('0x11')](_0x10a126));_0x1049c9(_0x10a126);})['catch'](function(_0x228f34){logger[_0xcbe0('0x12')](_0xcbe0('0x16'),_0x228f34[_0xcbe0('0x13')],_0x81beb0);_0x5d3747(_0x1f519a[_0xcbe0('0x12')](0x1f4,_0x228f34[_0xcbe0('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x2350bf){var _0x3fb0b8=this;return new Promise(function(_0x53c7a9,_0x181bf1){return db['ServicenowAccount'][_0xcbe0('0x1f')]({'raw':_0x2350bf['options']?_0x2350bf[_0xcbe0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2350bf[_0xcbe0('0x18')]?_0x2350bf[_0xcbe0('0x18')][_0xcbe0('0x19')]||null:null,'attributes':_0x2350bf['options']?_0x2350bf[_0xcbe0('0x18')][_0xcbe0('0x1a')]||null:null,'include':_0x2350bf[_0xcbe0('0x18')]?_0x2350bf[_0xcbe0('0x18')]['include']?_['map'](_0x2350bf[_0xcbe0('0x18')][_0xcbe0('0x1c')],function(_0x21ffd6){return{'model':db[_0x21ffd6[_0xcbe0('0x1e')]],'as':_0x21ffd6['as'],'attributes':_0x21ffd6[_0xcbe0('0x1a')],'include':_0x21ffd6[_0xcbe0('0x1c')]?_[_0xcbe0('0x1d')](_0x21ffd6[_0xcbe0('0x1c')],function(_0x3dbd42){return{'model':db[_0x3dbd42[_0xcbe0('0x1e')]],'as':_0x3dbd42['as'],'attributes':_0x3dbd42['attributes'],'include':_0x3dbd42[_0xcbe0('0x1c')]?_[_0xcbe0('0x1d')](_0x3dbd42[_0xcbe0('0x1c')],function(_0x19b6e0){return{'model':db[_0x19b6e0[_0xcbe0('0x1e')]],'as':_0x19b6e0['as'],'attributes':_0x19b6e0[_0xcbe0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2369f2){logger[_0xcbe0('0xd')](_0xcbe0('0x20'),_0x2350bf);logger[_0xcbe0('0x21')](_0xcbe0('0x20'),_0x2350bf,JSON['stringify'](_0x2369f2));_0x53c7a9(_0x2369f2);})[_0xcbe0('0x15')](function(_0x33afae){logger['error'](_0xcbe0('0x20'),_0x33afae[_0xcbe0('0x13')],_0x2350bf);_0x181bf1(_0x3fb0b8[_0xcbe0('0x12')](0x1f4,_0x33afae[_0xcbe0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 9cb8890..f6e2113 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 _0x8739=['getSubjects','/:id/descriptions','getDescriptions','create','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x8739,0x1d3));var _0x9873=function(_0x2f933c,_0x42c970){_0x2f933c=_0x2f933c-0x0;var _0xe173d1=_0x8739[_0x2f933c];return _0xe173d1;};'use strict';var multer=require(_0x9873('0x0'));var util=require('util');var path=require(_0x9873('0x1'));var timeout=require(_0x9873('0x2'));var express=require(_0x9873('0x3'));var router=express[_0x9873('0x4')]();var fs_extra=require(_0x9873('0x5'));var auth=require(_0x9873('0x6'));var interaction=require(_0x9873('0x7'));var config=require(_0x9873('0x8'));var controller=require(_0x9873('0x9'));router[_0x9873('0xa')]('/',auth[_0x9873('0xb')](),controller['index']);router['get'](_0x9873('0xc'),auth[_0x9873('0xb')](),controller[_0x9873('0xd')]);router[_0x9873('0xa')](_0x9873('0xe'),auth[_0x9873('0xb')](),controller[_0x9873('0xf')]);router[_0x9873('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x9873('0x10')]);router['get'](_0x9873('0x11'),auth[_0x9873('0xb')](),controller[_0x9873('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9873('0x13')]);router['put']('/:id',auth[_0x9873('0xb')](),controller['update']);router[_0x9873('0x14')](_0x9873('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x95f8=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','getFields','getSubjects','/:id/descriptions','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x454005,_0x1f1475){var _0x2149fd=function(_0xe0a168){while(--_0xe0a168){_0x454005['push'](_0x454005['shift']());}};_0x2149fd(++_0x1f1475);}(_0x95f8,0x18d));var _0x895f=function(_0x37e0c5,_0x46c212){_0x37e0c5=_0x37e0c5-0x0;var _0x22f40e=_0x95f8[_0x37e0c5];return _0x22f40e;};'use strict';var multer=require(_0x895f('0x0'));var util=require(_0x895f('0x1'));var path=require(_0x895f('0x2'));var timeout=require(_0x895f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x895f('0x4'));var auth=require(_0x895f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x895f('0x6'));var controller=require(_0x895f('0x7'));router[_0x895f('0x8')]('/',auth[_0x895f('0x9')](),controller[_0x895f('0xa')]);router[_0x895f('0x8')]('/:id',auth[_0x895f('0x9')](),controller['show']);router['get']('/:id/fields',auth[_0x895f('0x9')](),controller[_0x895f('0xb')]);router[_0x895f('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x895f('0xc')]);router[_0x895f('0x8')](_0x895f('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x895f('0xe')]('/',auth[_0x895f('0x9')](),controller[_0x895f('0xf')]);router['put'](_0x895f('0x10'),auth[_0x895f('0x9')](),controller[_0x895f('0x11')]);router[_0x895f('0x12')]('/:id',auth[_0x895f('0x9')](),controller[_0x895f('0x13')]);module[_0x895f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 67acb21..5aca736 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 _0x2533=['sequelize','STRING'];(function(_0xe249fc,_0x48c03a){var _0xf15d77=function(_0x2aa688){while(--_0x2aa688){_0xe249fc['push'](_0xe249fc['shift']());}};_0xf15d77(++_0x48c03a);}(_0x2533,0x1da));var _0x3253=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x2533[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x3253('0x0'));module['exports']={'name':{'type':Sequelize[_0x3253('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6db5=['exports','STRING','sequelize'];(function(_0x29c027,_0x246685){var _0x14b7bd=function(_0x30aab7){while(--_0x30aab7){_0x29c027['push'](_0x29c027['shift']());}};_0x14b7bd(++_0x246685);}(_0x6db5,0x161));var _0x56db=function(_0xe19424,_0x21edbf){_0xe19424=_0xe19424-0x0;var _0x1567ec=_0x6db5[_0xe19424];return _0x1567ec;};'use strict';var Sequelize=require(_0x56db('0x0'));module[_0x56db('0x1')]={'name':{'type':Sequelize[_0x56db('0x2')]},'description':{'type':Sequelize[_0x56db('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 75cb4c2..4b1872b 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 _0xefad=['count','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','ServicenowConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','includeAll','create','body','destroy','find','getFields','ServicenowField','options','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xefad,0xd2));var _0xdefa=function(_0x33fe84,_0x4c1888){_0x33fe84=_0x33fe84-0x0;var _0x1f0d45=_0xefad[_0x33fe84];return _0x1f0d45;};'use strict';var emlformat=require(_0xdefa('0x0'));var rimraf=require(_0xdefa('0x1'));var zipdir=require(_0xdefa('0x2'));var jsonpatch=require(_0xdefa('0x3'));var rp=require('request-promise');var moment=require(_0xdefa('0x4'));var BPromise=require(_0xdefa('0x5'));var Mustache=require('mustache');var util=require(_0xdefa('0x6'));var path=require(_0xdefa('0x7'));var sox=require(_0xdefa('0x8'));var csv=require(_0xdefa('0x9'));var ejs=require(_0xdefa('0xa'));var fs=require('fs');var fs_extra=require(_0xdefa('0xb'));var _=require('lodash');var squel=require(_0xdefa('0xc'));var crypto=require(_0xdefa('0xd'));var jsforce=require(_0xdefa('0xe'));var deskjs=require(_0xdefa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdefa('0x10'));var Papa=require('papaparse');var Redis=require(_0xdefa('0x11'));var authService=require(_0xdefa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdefa('0x13'));var hardwareService=require(_0xdefa('0x14'));var logger=require(_0xdefa('0x15'))(_0xdefa('0x16'));var utils=require(_0xdefa('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdefa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbff001,_0x37ab60){_0x37ab60=_0x37ab60||0xcc;return function(_0x2b390d){if(_0x2b390d){return _0xbff001[_0xdefa('0x19')](_0x37ab60);}return _0xbff001[_0xdefa('0x1a')](_0x37ab60)['end']();};}function respondWithResult(_0x2b5195,_0x714812){_0x714812=_0x714812||0xc8;return function(_0x5b0ae2){if(_0x5b0ae2){return _0x2b5195[_0xdefa('0x1a')](_0x714812)['json'](_0x5b0ae2);}};}function respondWithFilteredResult(_0x401f1f,_0x12ed27){return function(_0x393d07){if(_0x393d07){var _0x2fb29d=typeof _0x12ed27[_0xdefa('0x1b')]===_0xdefa('0x1c')&&typeof _0x12ed27[_0xdefa('0x1d')]===_0xdefa('0x1c');var _0x37e452=_0x393d07[_0xdefa('0x1e')];var _0x5a3182=_0x2fb29d?0x0:_0x12ed27['offset'];var _0x35c927=_0x2fb29d?_0x393d07[_0xdefa('0x1e')]:_0x12ed27['offset']+_0x12ed27[_0xdefa('0x1d')];var _0x2c3884;if(_0x35c927>=_0x37e452){_0x35c927=_0x37e452;_0x2c3884=0xc8;}else{_0x2c3884=0xce;}_0x401f1f[_0xdefa('0x1a')](_0x2c3884);return _0x401f1f['set'](_0xdefa('0x1f'),_0x5a3182+'-'+_0x35c927+'/'+_0x37e452)[_0xdefa('0x20')](_0x393d07);}return null;};}function patchUpdates(_0xeb9f41){return function(_0x4018c2){try{jsonpatch[_0xdefa('0x21')](_0x4018c2,_0xeb9f41,!![]);}catch(_0x41b1bd){return BPromise[_0xdefa('0x22')](_0x41b1bd);}return _0x4018c2[_0xdefa('0x23')]();};}function saveUpdates(_0x27b0b9,_0x34f530){return function(_0x28bd58){if(_0x28bd58){return _0x28bd58[_0xdefa('0x24')](_0x27b0b9)[_0xdefa('0x25')](function(_0x1dfb9c){return _0x1dfb9c;});}return null;};}function removeEntity(_0x2f14fe,_0x376bc9){return function(_0x1c8ed1){if(_0x1c8ed1){return _0x1c8ed1['destroy']()[_0xdefa('0x25')](function(){_0x2f14fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x287e77,_0x295abd){return function(_0x262679){if(!_0x262679){_0x287e77['sendStatus'](0x194);}return _0x262679;};}function handleError(_0x4b709a,_0x4b2bd7){_0x4b2bd7=_0x4b2bd7||0x1f4;return function(_0x23ff97){logger[_0xdefa('0x26')](_0x23ff97[_0xdefa('0x27')]);if(_0x23ff97['name']){delete _0x23ff97[_0xdefa('0x28')];}_0x4b709a['status'](_0x4b2bd7)['send'](_0x23ff97);};}exports[_0xdefa('0x29')]=function(_0x4bbeb4,_0x16ed0c){var _0xa629c7={},_0x1cdbc8={},_0x4357a0={'count':0x0,'rows':[]};var _0x59e9b9=_['map'](db[_0xdefa('0x2a')][_0xdefa('0x2b')],function(_0x4df76e){return{'name':_0x4df76e[_0xdefa('0x2c')],'type':_0x4df76e[_0xdefa('0x2d')]['key']};});_0x1cdbc8[_0xdefa('0x2e')]=_[_0xdefa('0x2f')](_0x59e9b9,_0xdefa('0x28'));_0x1cdbc8[_0xdefa('0x30')]=_[_0xdefa('0x31')](_0x4bbeb4[_0xdefa('0x30')]);_0x1cdbc8[_0xdefa('0x32')]=_[_0xdefa('0x33')](_0x1cdbc8[_0xdefa('0x2e')],_0x1cdbc8[_0xdefa('0x30')]);_0xa629c7[_0xdefa('0x34')]=_['intersection'](_0x1cdbc8['model'],qs[_0xdefa('0x35')](_0x4bbeb4[_0xdefa('0x30')][_0xdefa('0x35')]));_0xa629c7[_0xdefa('0x34')]=_0xa629c7[_0xdefa('0x34')][_0xdefa('0x36')]?_0xa629c7['attributes']:_0x1cdbc8['model'];if(!_0x4bbeb4['query'][_0xdefa('0x37')](_0xdefa('0x38'))){_0xa629c7[_0xdefa('0x1d')]=qs['limit'](_0x4bbeb4[_0xdefa('0x30')][_0xdefa('0x1d')]);_0xa629c7['offset']=qs[_0xdefa('0x1b')](_0x4bbeb4[_0xdefa('0x30')][_0xdefa('0x1b')]);}_0xa629c7[_0xdefa('0x39')]=qs[_0xdefa('0x3a')](_0x4bbeb4['query']['sort']);_0xa629c7[_0xdefa('0x3b')]=qs[_0xdefa('0x32')](_[_0xdefa('0x3c')](_0x4bbeb4[_0xdefa('0x30')],_0x1cdbc8['filters']),_0x59e9b9);if(_0x4bbeb4['query']['filter']){_0xa629c7[_0xdefa('0x3b')]=_[_0xdefa('0x3d')](_0xa629c7[_0xdefa('0x3b')],{'$or':_['map'](_0x59e9b9,function(_0x4027d6){if(_0x4027d6[_0xdefa('0x2d')]!==_0xdefa('0x3e')){var _0x127e51={};_0x127e51[_0x4027d6[_0xdefa('0x28')]]={'$like':'%'+_0x4bbeb4[_0xdefa('0x30')][_0xdefa('0x3f')]+'%'};return _0x127e51;}})});}_0xa629c7=_[_0xdefa('0x3d')]({},_0xa629c7,_0x4bbeb4['options']);var _0x4bcba9={'where':_0xa629c7[_0xdefa('0x3b')]};return db[_0xdefa('0x2a')][_0xdefa('0x1e')](_0x4bcba9)[_0xdefa('0x25')](function(_0x446682){_0x4357a0[_0xdefa('0x1e')]=_0x446682;if(_0x4bbeb4[_0xdefa('0x30')]['includeAll']){_0xa629c7[_0xdefa('0x40')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xdefa('0x41')](_0xa629c7);})[_0xdefa('0x25')](function(_0x56e950){_0x4357a0[_0xdefa('0x42')]=_0x56e950;return _0x4357a0;})[_0xdefa('0x25')](respondWithFilteredResult(_0x16ed0c,_0xa629c7))[_0xdefa('0x43')](handleError(_0x16ed0c,null));};exports['show']=function(_0x22f08f,_0x3cb380){var _0x2657d6={'raw':![],'where':{'id':_0x22f08f[_0xdefa('0x44')]['id']}},_0x297a62={};_0x297a62[_0xdefa('0x2e')]=_[_0xdefa('0x31')](db[_0xdefa('0x2a')][_0xdefa('0x2b')]);_0x297a62['query']=_['keys'](_0x22f08f['query']);_0x297a62['filters']=_[_0xdefa('0x33')](_0x297a62[_0xdefa('0x2e')],_0x297a62['query']);_0x2657d6[_0xdefa('0x34')]=_[_0xdefa('0x33')](_0x297a62[_0xdefa('0x2e')],qs[_0xdefa('0x35')](_0x22f08f['query'][_0xdefa('0x35')]));_0x2657d6['attributes']=_0x2657d6['attributes'][_0xdefa('0x36')]?_0x2657d6[_0xdefa('0x34')]:_0x297a62[_0xdefa('0x2e')];if(_0x22f08f['query'][_0xdefa('0x45')]){_0x2657d6[_0xdefa('0x40')]=[{'all':!![]}];}_0x2657d6=_[_0xdefa('0x3d')]({},_0x2657d6,_0x22f08f['options']);return db[_0xdefa('0x2a')]['find'](_0x2657d6)[_0xdefa('0x25')](handleEntityNotFound(_0x3cb380,null))['then'](respondWithResult(_0x3cb380,null))['catch'](handleError(_0x3cb380,null));};exports[_0xdefa('0x46')]=function(_0x488f5c,_0x2f4d1b){return db[_0xdefa('0x2a')][_0xdefa('0x46')](_0x488f5c[_0xdefa('0x47')],{})[_0xdefa('0x25')](respondWithResult(_0x2f4d1b,0xc9))[_0xdefa('0x43')](handleError(_0x2f4d1b,null));};exports[_0xdefa('0x24')]=function(_0x3ae52e,_0x6dc197){if(_0x3ae52e[_0xdefa('0x47')]['id']){delete _0x3ae52e[_0xdefa('0x47')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x3ae52e[_0xdefa('0x44')]['id']}})[_0xdefa('0x25')](handleEntityNotFound(_0x6dc197,null))[_0xdefa('0x25')](saveUpdates(_0x3ae52e[_0xdefa('0x47')],null))[_0xdefa('0x25')](respondWithResult(_0x6dc197,null))[_0xdefa('0x43')](handleError(_0x6dc197,null));};exports[_0xdefa('0x48')]=function(_0x545311,_0x36fd61){return db[_0xdefa('0x2a')][_0xdefa('0x49')]({'where':{'id':_0x545311['params']['id']}})[_0xdefa('0x25')](handleEntityNotFound(_0x36fd61,null))[_0xdefa('0x25')](removeEntity(_0x36fd61,null))[_0xdefa('0x43')](handleError(_0x36fd61,null));};exports[_0xdefa('0x4a')]=function(_0x60a22c,_0x44f9f5,_0x5c3023){var _0x4aa501={};var _0x231c29={};var _0x1f06c7;var _0x2fbc66;return db[_0xdefa('0x2a')]['findOne']({'where':{'id':_0x60a22c[_0xdefa('0x44')]['id']}})[_0xdefa('0x25')](handleEntityNotFound(_0x44f9f5,null))['then'](function(_0x2946a2){if(_0x2946a2){_0x1f06c7=_0x2946a2;_0x231c29['model']=_[_0xdefa('0x31')](db[_0xdefa('0x4b')][_0xdefa('0x2b')]);_0x231c29[_0xdefa('0x30')]=_[_0xdefa('0x31')](_0x60a22c[_0xdefa('0x30')]);_0x231c29[_0xdefa('0x32')]=_[_0xdefa('0x33')](_0x231c29['model'],_0x231c29[_0xdefa('0x30')]);_0x4aa501[_0xdefa('0x34')]=_['intersection'](_0x231c29[_0xdefa('0x2e')],qs[_0xdefa('0x35')](_0x60a22c['query'][_0xdefa('0x35')]));_0x4aa501[_0xdefa('0x34')]=_0x4aa501['attributes'][_0xdefa('0x36')]?_0x4aa501[_0xdefa('0x34')]:_0x231c29[_0xdefa('0x2e')];_0x4aa501[_0xdefa('0x39')]=qs[_0xdefa('0x3a')](_0x60a22c[_0xdefa('0x30')][_0xdefa('0x3a')]);_0x4aa501[_0xdefa('0x3b')]=qs[_0xdefa('0x32')](_['pick'](_0x60a22c[_0xdefa('0x30')],_0x231c29[_0xdefa('0x32')]));if(_0x60a22c['query'][_0xdefa('0x3f')]){_0x4aa501[_0xdefa('0x3b')]=_[_0xdefa('0x3d')](_0x4aa501['where'],{'$or':_[_0xdefa('0x2f')](_0x4aa501[_0xdefa('0x34')],function(_0x5ec5b7){var _0x1abe98={};_0x1abe98[_0x5ec5b7]={'$like':'%'+_0x60a22c[_0xdefa('0x30')][_0xdefa('0x3f')]+'%'};return _0x1abe98;})});}_0x4aa501=_['merge']({},_0x4aa501,_0x60a22c[_0xdefa('0x4c')]);return _0x1f06c7[_0xdefa('0x4a')](_0x4aa501);}})[_0xdefa('0x25')](function(_0x12cb61){if(_0x12cb61){_0x2fbc66=_0x12cb61[_0xdefa('0x36')];if(!_0x60a22c['query']['hasOwnProperty'](_0xdefa('0x38'))){_0x4aa501['limit']=qs[_0xdefa('0x1d')](_0x60a22c[_0xdefa('0x30')][_0xdefa('0x1d')]);_0x4aa501['offset']=qs[_0xdefa('0x1b')](_0x60a22c[_0xdefa('0x30')][_0xdefa('0x1b')]);}return _0x1f06c7[_0xdefa('0x4a')](_0x4aa501);}})[_0xdefa('0x25')](function(_0x3632a9){if(_0x3632a9){return _0x3632a9?{'count':_0x2fbc66,'rows':_0x3632a9}:null;}})[_0xdefa('0x25')](respondWithResult(_0x44f9f5,null))[_0xdefa('0x43')](handleError(_0x44f9f5,null));};exports[_0xdefa('0x4d')]=function(_0x18c929,_0x488a48,_0x408e8c){var _0x3b32a3={};var _0x5655f9={};var _0x3afcad;var _0x209b2e;return db[_0xdefa('0x2a')][_0xdefa('0x4e')]({'where':{'id':_0x18c929[_0xdefa('0x44')]['id']}})[_0xdefa('0x25')](handleEntityNotFound(_0x488a48,null))['then'](function(_0x7beb89){if(_0x7beb89){_0x3afcad=_0x7beb89;_0x5655f9[_0xdefa('0x2e')]=_['keys'](db[_0xdefa('0x4b')][_0xdefa('0x2b')]);_0x5655f9[_0xdefa('0x30')]=_[_0xdefa('0x31')](_0x18c929[_0xdefa('0x30')]);_0x5655f9[_0xdefa('0x32')]=_[_0xdefa('0x33')](_0x5655f9['model'],_0x5655f9[_0xdefa('0x30')]);_0x3b32a3['attributes']=_[_0xdefa('0x33')](_0x5655f9['model'],qs[_0xdefa('0x35')](_0x18c929[_0xdefa('0x30')][_0xdefa('0x35')]));_0x3b32a3[_0xdefa('0x34')]=_0x3b32a3[_0xdefa('0x34')][_0xdefa('0x36')]?_0x3b32a3['attributes']:_0x5655f9[_0xdefa('0x2e')];_0x3b32a3[_0xdefa('0x39')]=qs[_0xdefa('0x3a')](_0x18c929['query'][_0xdefa('0x3a')]);_0x3b32a3[_0xdefa('0x3b')]=qs[_0xdefa('0x32')](_[_0xdefa('0x3c')](_0x18c929[_0xdefa('0x30')],_0x5655f9['filters']));if(_0x18c929[_0xdefa('0x30')][_0xdefa('0x3f')]){_0x3b32a3['where']=_[_0xdefa('0x3d')](_0x3b32a3[_0xdefa('0x3b')],{'$or':_[_0xdefa('0x2f')](_0x3b32a3[_0xdefa('0x34')],function(_0x474cfd){var _0xf25c95={};_0xf25c95[_0x474cfd]={'$like':'%'+_0x18c929[_0xdefa('0x30')]['filter']+'%'};return _0xf25c95;})});}_0x3b32a3=_['merge']({},_0x3b32a3,_0x18c929[_0xdefa('0x4c')]);return _0x3afcad['getSubjects'](_0x3b32a3);}})[_0xdefa('0x25')](function(_0x4a6fcd){if(_0x4a6fcd){_0x209b2e=_0x4a6fcd[_0xdefa('0x36')];if(!_0x18c929[_0xdefa('0x30')][_0xdefa('0x37')]('nolimit')){_0x3b32a3[_0xdefa('0x1d')]=qs[_0xdefa('0x1d')](_0x18c929[_0xdefa('0x30')]['limit']);_0x3b32a3[_0xdefa('0x1b')]=qs[_0xdefa('0x1b')](_0x18c929['query'][_0xdefa('0x1b')]);}return _0x3afcad['getSubjects'](_0x3b32a3);}})[_0xdefa('0x25')](function(_0x14cecb){if(_0x14cecb){return _0x14cecb?{'count':_0x209b2e,'rows':_0x14cecb}:null;}})[_0xdefa('0x25')](respondWithResult(_0x488a48,null))['catch'](handleError(_0x488a48,null));};exports[_0xdefa('0x4f')]=function(_0x583835,_0x382e6d,_0x48fd6b){var _0x1bc617={};var _0x10d92d={};var _0x5e3b6d;var _0x5a8b19;return db['ServicenowConfiguration'][_0xdefa('0x4e')]({'where':{'id':_0x583835['params']['id']}})[_0xdefa('0x25')](handleEntityNotFound(_0x382e6d,null))[_0xdefa('0x25')](function(_0x4db889){if(_0x4db889){_0x5e3b6d=_0x4db889;_0x10d92d[_0xdefa('0x2e')]=_['keys'](db[_0xdefa('0x4b')][_0xdefa('0x2b')]);_0x10d92d[_0xdefa('0x30')]=_[_0xdefa('0x31')](_0x583835[_0xdefa('0x30')]);_0x10d92d[_0xdefa('0x32')]=_[_0xdefa('0x33')](_0x10d92d['model'],_0x10d92d[_0xdefa('0x30')]);_0x1bc617['attributes']=_['intersection'](_0x10d92d[_0xdefa('0x2e')],qs[_0xdefa('0x35')](_0x583835[_0xdefa('0x30')][_0xdefa('0x35')]));_0x1bc617[_0xdefa('0x34')]=_0x1bc617['attributes'][_0xdefa('0x36')]?_0x1bc617[_0xdefa('0x34')]:_0x10d92d[_0xdefa('0x2e')];_0x1bc617[_0xdefa('0x39')]=qs['sort'](_0x583835[_0xdefa('0x30')][_0xdefa('0x3a')]);_0x1bc617[_0xdefa('0x3b')]=qs[_0xdefa('0x32')](_[_0xdefa('0x3c')](_0x583835[_0xdefa('0x30')],_0x10d92d[_0xdefa('0x32')]));if(_0x583835[_0xdefa('0x30')][_0xdefa('0x3f')]){_0x1bc617['where']=_[_0xdefa('0x3d')](_0x1bc617[_0xdefa('0x3b')],{'$or':_[_0xdefa('0x2f')](_0x1bc617['attributes'],function(_0x329ec4){var _0x4503d1={};_0x4503d1[_0x329ec4]={'$like':'%'+_0x583835[_0xdefa('0x30')][_0xdefa('0x3f')]+'%'};return _0x4503d1;})});}_0x1bc617=_['merge']({},_0x1bc617,_0x583835[_0xdefa('0x4c')]);return _0x5e3b6d['getDescriptions'](_0x1bc617);}})[_0xdefa('0x25')](function(_0x2c0444){if(_0x2c0444){_0x5a8b19=_0x2c0444[_0xdefa('0x36')];if(!_0x583835['query']['hasOwnProperty'](_0xdefa('0x38'))){_0x1bc617[_0xdefa('0x1d')]=qs[_0xdefa('0x1d')](_0x583835['query'][_0xdefa('0x1d')]);_0x1bc617[_0xdefa('0x1b')]=qs[_0xdefa('0x1b')](_0x583835[_0xdefa('0x30')][_0xdefa('0x1b')]);}return _0x5e3b6d[_0xdefa('0x4f')](_0x1bc617);}})[_0xdefa('0x25')](function(_0x43679c){if(_0x43679c){return _0x43679c?{'count':_0x5a8b19,'rows':_0x43679c}:null;}})['then'](respondWithResult(_0x382e6d,null))[_0xdefa('0x43')](handleError(_0x382e6d,null));}; \ No newline at end of file +var _0x7696=['params','options','find','create','body','findOne','ServicenowField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show'];(function(_0x93402,_0x5a7878){var _0x59f229=function(_0x3355e7){while(--_0x3355e7){_0x93402['push'](_0x93402['shift']());}};_0x59f229(++_0x5a7878);}(_0x7696,0x103));var _0x6769=function(_0x2d41f1,_0x44e2d0){_0x2d41f1=_0x2d41f1-0x0;var _0x393c13=_0x7696[_0x2d41f1];return _0x393c13;};'use strict';var emlformat=require(_0x6769('0x0'));var rimraf=require(_0x6769('0x1'));var zipdir=require(_0x6769('0x2'));var jsonpatch=require(_0x6769('0x3'));var rp=require('request-promise');var moment=require(_0x6769('0x4'));var BPromise=require(_0x6769('0x5'));var Mustache=require(_0x6769('0x6'));var util=require(_0x6769('0x7'));var path=require(_0x6769('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6769('0x9'));var fs=require('fs');var fs_extra=require(_0x6769('0xa'));var _=require(_0x6769('0xb'));var squel=require(_0x6769('0xc'));var crypto=require(_0x6769('0xd'));var jsforce=require(_0x6769('0xe'));var deskjs=require(_0x6769('0xf'));var toCsv=require(_0x6769('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6769('0x11'));var qs=require(_0x6769('0x12'));var as=require(_0x6769('0x13'));var hardwareService=require(_0x6769('0x14'));var logger=require(_0x6769('0x15'))(_0x6769('0x16'));var utils=require(_0x6769('0x17'));var config=require(_0x6769('0x18'));var licenseUtil=require(_0x6769('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29ac03,_0x2646a3){_0x2646a3=_0x2646a3||0xcc;return function(_0x5c53d1){if(_0x5c53d1){return _0x29ac03[_0x6769('0x1a')](_0x2646a3);}return _0x29ac03['status'](_0x2646a3)['end']();};}function respondWithResult(_0x55efb5,_0x39e53c){_0x39e53c=_0x39e53c||0xc8;return function(_0x1a5814){if(_0x1a5814){return _0x55efb5['status'](_0x39e53c)[_0x6769('0x1b')](_0x1a5814);}};}function respondWithFilteredResult(_0x2708f8,_0x3bfe06){return function(_0x379c4e){if(_0x379c4e){var _0x290d9a=typeof _0x3bfe06[_0x6769('0x1c')]===_0x6769('0x1d')&&typeof _0x3bfe06[_0x6769('0x1e')]==='undefined';var _0x1a26e7=_0x379c4e[_0x6769('0x1f')];var _0x30df19=_0x290d9a?0x0:_0x3bfe06[_0x6769('0x1c')];var _0x1fc094=_0x290d9a?_0x379c4e[_0x6769('0x1f')]:_0x3bfe06['offset']+_0x3bfe06[_0x6769('0x1e')];var _0x49830f;if(_0x1fc094>=_0x1a26e7){_0x1fc094=_0x1a26e7;_0x49830f=0xc8;}else{_0x49830f=0xce;}_0x2708f8[_0x6769('0x20')](_0x49830f);return _0x2708f8[_0x6769('0x21')](_0x6769('0x22'),_0x30df19+'-'+_0x1fc094+'/'+_0x1a26e7)['json'](_0x379c4e);}return null;};}function patchUpdates(_0xccd3d6){return function(_0x49702d){try{jsonpatch[_0x6769('0x23')](_0x49702d,_0xccd3d6,!![]);}catch(_0x27c34f){return BPromise['reject'](_0x27c34f);}return _0x49702d[_0x6769('0x24')]();};}function saveUpdates(_0x416313,_0x4fc985){return function(_0x50665b){if(_0x50665b){return _0x50665b[_0x6769('0x25')](_0x416313)[_0x6769('0x26')](function(_0x24c5e8){return _0x24c5e8;});}return null;};}function removeEntity(_0x529a0c,_0x47c0b8){return function(_0x23e1c5){if(_0x23e1c5){return _0x23e1c5[_0x6769('0x27')]()['then'](function(){_0x529a0c['status'](0xcc)[_0x6769('0x28')]();});}};}function handleEntityNotFound(_0x18a350,_0x17b069){return function(_0x1fbde9){if(!_0x1fbde9){_0x18a350[_0x6769('0x1a')](0x194);}return _0x1fbde9;};}function handleError(_0x1803f0,_0x1a5186){_0x1a5186=_0x1a5186||0x1f4;return function(_0x5f5488){logger[_0x6769('0x29')](_0x5f5488[_0x6769('0x2a')]);if(_0x5f5488['name']){delete _0x5f5488[_0x6769('0x2b')];}_0x1803f0[_0x6769('0x20')](_0x1a5186)[_0x6769('0x2c')](_0x5f5488);};}exports[_0x6769('0x2d')]=function(_0xb61a6a,_0x4c71ff){var _0x2b2dab={},_0x161bde={},_0x142883={'count':0x0,'rows':[]};var _0x1d5285=_[_0x6769('0x2e')](db[_0x6769('0x2f')][_0x6769('0x30')],function(_0x1e06a3){return{'name':_0x1e06a3[_0x6769('0x31')],'type':_0x1e06a3[_0x6769('0x32')]['key']};});_0x161bde[_0x6769('0x33')]=_[_0x6769('0x2e')](_0x1d5285,_0x6769('0x2b'));_0x161bde[_0x6769('0x34')]=_[_0x6769('0x35')](_0xb61a6a[_0x6769('0x34')]);_0x161bde[_0x6769('0x36')]=_[_0x6769('0x37')](_0x161bde[_0x6769('0x33')],_0x161bde['query']);_0x2b2dab[_0x6769('0x38')]=_[_0x6769('0x37')](_0x161bde[_0x6769('0x33')],qs[_0x6769('0x39')](_0xb61a6a[_0x6769('0x34')]['fields']));_0x2b2dab['attributes']=_0x2b2dab[_0x6769('0x38')][_0x6769('0x3a')]?_0x2b2dab[_0x6769('0x38')]:_0x161bde[_0x6769('0x33')];if(!_0xb61a6a[_0x6769('0x34')][_0x6769('0x3b')](_0x6769('0x3c'))){_0x2b2dab['limit']=qs['limit'](_0xb61a6a[_0x6769('0x34')][_0x6769('0x1e')]);_0x2b2dab[_0x6769('0x1c')]=qs[_0x6769('0x1c')](_0xb61a6a[_0x6769('0x34')][_0x6769('0x1c')]);}_0x2b2dab[_0x6769('0x3d')]=qs[_0x6769('0x3e')](_0xb61a6a[_0x6769('0x34')][_0x6769('0x3e')]);_0x2b2dab[_0x6769('0x3f')]=qs['filters'](_[_0x6769('0x40')](_0xb61a6a[_0x6769('0x34')],_0x161bde[_0x6769('0x36')]),_0x1d5285);if(_0xb61a6a[_0x6769('0x34')]['filter']){_0x2b2dab[_0x6769('0x3f')]=_[_0x6769('0x41')](_0x2b2dab[_0x6769('0x3f')],{'$or':_[_0x6769('0x2e')](_0x1d5285,function(_0x55468a){if(_0x55468a[_0x6769('0x32')]!==_0x6769('0x42')){var _0x3eeb6a={};_0x3eeb6a[_0x55468a[_0x6769('0x2b')]]={'$like':'%'+_0xb61a6a[_0x6769('0x34')][_0x6769('0x43')]+'%'};return _0x3eeb6a;}})});}_0x2b2dab=_[_0x6769('0x41')]({},_0x2b2dab,_0xb61a6a['options']);var _0x3e2cdf={'where':_0x2b2dab['where']};return db[_0x6769('0x2f')][_0x6769('0x1f')](_0x3e2cdf)[_0x6769('0x26')](function(_0x4f9b52){_0x142883[_0x6769('0x1f')]=_0x4f9b52;if(_0xb61a6a[_0x6769('0x34')][_0x6769('0x44')]){_0x2b2dab[_0x6769('0x45')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x2b2dab);})[_0x6769('0x26')](function(_0x13a378){_0x142883[_0x6769('0x46')]=_0x13a378;return _0x142883;})[_0x6769('0x26')](respondWithFilteredResult(_0x4c71ff,_0x2b2dab))[_0x6769('0x47')](handleError(_0x4c71ff,null));};exports[_0x6769('0x48')]=function(_0x506b66,_0x454c20){var _0x21d063={'raw':![],'where':{'id':_0x506b66[_0x6769('0x49')]['id']}},_0x44501e={};_0x44501e['model']=_[_0x6769('0x35')](db[_0x6769('0x2f')][_0x6769('0x30')]);_0x44501e[_0x6769('0x34')]=_[_0x6769('0x35')](_0x506b66[_0x6769('0x34')]);_0x44501e[_0x6769('0x36')]=_[_0x6769('0x37')](_0x44501e[_0x6769('0x33')],_0x44501e[_0x6769('0x34')]);_0x21d063[_0x6769('0x38')]=_[_0x6769('0x37')](_0x44501e[_0x6769('0x33')],qs[_0x6769('0x39')](_0x506b66['query']['fields']));_0x21d063[_0x6769('0x38')]=_0x21d063[_0x6769('0x38')][_0x6769('0x3a')]?_0x21d063[_0x6769('0x38')]:_0x44501e[_0x6769('0x33')];if(_0x506b66[_0x6769('0x34')]['includeAll']){_0x21d063[_0x6769('0x45')]=[{'all':!![]}];}_0x21d063=_[_0x6769('0x41')]({},_0x21d063,_0x506b66[_0x6769('0x4a')]);return db[_0x6769('0x2f')][_0x6769('0x4b')](_0x21d063)[_0x6769('0x26')](handleEntityNotFound(_0x454c20,null))[_0x6769('0x26')](respondWithResult(_0x454c20,null))[_0x6769('0x47')](handleError(_0x454c20,null));};exports[_0x6769('0x4c')]=function(_0x251b8b,_0x39b51a){return db[_0x6769('0x2f')][_0x6769('0x4c')](_0x251b8b[_0x6769('0x4d')],{})['then'](respondWithResult(_0x39b51a,0xc9))[_0x6769('0x47')](handleError(_0x39b51a,null));};exports[_0x6769('0x25')]=function(_0x1b0efe,_0x412847){if(_0x1b0efe[_0x6769('0x4d')]['id']){delete _0x1b0efe['body']['id'];}return db[_0x6769('0x2f')][_0x6769('0x4b')]({'where':{'id':_0x1b0efe[_0x6769('0x49')]['id']}})['then'](handleEntityNotFound(_0x412847,null))[_0x6769('0x26')](saveUpdates(_0x1b0efe[_0x6769('0x4d')],null))[_0x6769('0x26')](respondWithResult(_0x412847,null))[_0x6769('0x47')](handleError(_0x412847,null));};exports['destroy']=function(_0x1b5fb8,_0x374e61){return db['ServicenowConfiguration'][_0x6769('0x4b')]({'where':{'id':_0x1b5fb8[_0x6769('0x49')]['id']}})[_0x6769('0x26')](handleEntityNotFound(_0x374e61,null))[_0x6769('0x26')](removeEntity(_0x374e61,null))['catch'](handleError(_0x374e61,null));};exports['getFields']=function(_0x20fc3f,_0x4e4d24,_0x2b0443){var _0x18411b={};var _0x4ac343={};var _0x3c11fa;var _0x72ac19;return db['ServicenowConfiguration'][_0x6769('0x4e')]({'where':{'id':_0x20fc3f[_0x6769('0x49')]['id']}})[_0x6769('0x26')](handleEntityNotFound(_0x4e4d24,null))['then'](function(_0x4af5a1){if(_0x4af5a1){_0x3c11fa=_0x4af5a1;_0x4ac343['model']=_[_0x6769('0x35')](db[_0x6769('0x4f')][_0x6769('0x30')]);_0x4ac343[_0x6769('0x34')]=_[_0x6769('0x35')](_0x20fc3f['query']);_0x4ac343[_0x6769('0x36')]=_[_0x6769('0x37')](_0x4ac343[_0x6769('0x33')],_0x4ac343[_0x6769('0x34')]);_0x18411b[_0x6769('0x38')]=_['intersection'](_0x4ac343['model'],qs['fields'](_0x20fc3f[_0x6769('0x34')]['fields']));_0x18411b[_0x6769('0x38')]=_0x18411b[_0x6769('0x38')][_0x6769('0x3a')]?_0x18411b['attributes']:_0x4ac343[_0x6769('0x33')];_0x18411b[_0x6769('0x3d')]=qs[_0x6769('0x3e')](_0x20fc3f[_0x6769('0x34')][_0x6769('0x3e')]);_0x18411b['where']=qs['filters'](_[_0x6769('0x40')](_0x20fc3f['query'],_0x4ac343[_0x6769('0x36')]));if(_0x20fc3f[_0x6769('0x34')]['filter']){_0x18411b[_0x6769('0x3f')]=_['merge'](_0x18411b[_0x6769('0x3f')],{'$or':_['map'](_0x18411b['attributes'],function(_0x2877c1){var _0x46e34a={};_0x46e34a[_0x2877c1]={'$like':'%'+_0x20fc3f[_0x6769('0x34')][_0x6769('0x43')]+'%'};return _0x46e34a;})});}_0x18411b=_[_0x6769('0x41')]({},_0x18411b,_0x20fc3f['options']);return _0x3c11fa[_0x6769('0x50')](_0x18411b);}})[_0x6769('0x26')](function(_0x24c22a){if(_0x24c22a){_0x72ac19=_0x24c22a[_0x6769('0x3a')];if(!_0x20fc3f[_0x6769('0x34')][_0x6769('0x3b')](_0x6769('0x3c'))){_0x18411b[_0x6769('0x1e')]=qs[_0x6769('0x1e')](_0x20fc3f[_0x6769('0x34')][_0x6769('0x1e')]);_0x18411b[_0x6769('0x1c')]=qs['offset'](_0x20fc3f[_0x6769('0x34')][_0x6769('0x1c')]);}return _0x3c11fa[_0x6769('0x50')](_0x18411b);}})[_0x6769('0x26')](function(_0x4d0789){if(_0x4d0789){return _0x4d0789?{'count':_0x72ac19,'rows':_0x4d0789}:null;}})['then'](respondWithResult(_0x4e4d24,null))['catch'](handleError(_0x4e4d24,null));};exports[_0x6769('0x51')]=function(_0x1604ba,_0x303d8b,_0x8bc779){var _0x2c97b0={};var _0x19ee4e={};var _0x440538;var _0xebffc1;return db[_0x6769('0x2f')][_0x6769('0x4e')]({'where':{'id':_0x1604ba[_0x6769('0x49')]['id']}})[_0x6769('0x26')](handleEntityNotFound(_0x303d8b,null))[_0x6769('0x26')](function(_0x459227){if(_0x459227){_0x440538=_0x459227;_0x19ee4e[_0x6769('0x33')]=_[_0x6769('0x35')](db[_0x6769('0x4f')][_0x6769('0x30')]);_0x19ee4e[_0x6769('0x34')]=_[_0x6769('0x35')](_0x1604ba[_0x6769('0x34')]);_0x19ee4e[_0x6769('0x36')]=_[_0x6769('0x37')](_0x19ee4e[_0x6769('0x33')],_0x19ee4e[_0x6769('0x34')]);_0x2c97b0[_0x6769('0x38')]=_['intersection'](_0x19ee4e[_0x6769('0x33')],qs['fields'](_0x1604ba['query'][_0x6769('0x39')]));_0x2c97b0[_0x6769('0x38')]=_0x2c97b0[_0x6769('0x38')][_0x6769('0x3a')]?_0x2c97b0[_0x6769('0x38')]:_0x19ee4e[_0x6769('0x33')];_0x2c97b0[_0x6769('0x3d')]=qs[_0x6769('0x3e')](_0x1604ba['query'][_0x6769('0x3e')]);_0x2c97b0[_0x6769('0x3f')]=qs[_0x6769('0x36')](_[_0x6769('0x40')](_0x1604ba['query'],_0x19ee4e[_0x6769('0x36')]));if(_0x1604ba[_0x6769('0x34')][_0x6769('0x43')]){_0x2c97b0[_0x6769('0x3f')]=_[_0x6769('0x41')](_0x2c97b0['where'],{'$or':_[_0x6769('0x2e')](_0x2c97b0[_0x6769('0x38')],function(_0x2920e9){var _0x4925e1={};_0x4925e1[_0x2920e9]={'$like':'%'+_0x1604ba[_0x6769('0x34')][_0x6769('0x43')]+'%'};return _0x4925e1;})});}_0x2c97b0=_[_0x6769('0x41')]({},_0x2c97b0,_0x1604ba[_0x6769('0x4a')]);return _0x440538[_0x6769('0x51')](_0x2c97b0);}})[_0x6769('0x26')](function(_0x5b128a){if(_0x5b128a){_0xebffc1=_0x5b128a[_0x6769('0x3a')];if(!_0x1604ba[_0x6769('0x34')]['hasOwnProperty'](_0x6769('0x3c'))){_0x2c97b0[_0x6769('0x1e')]=qs['limit'](_0x1604ba['query'][_0x6769('0x1e')]);_0x2c97b0[_0x6769('0x1c')]=qs['offset'](_0x1604ba[_0x6769('0x34')]['offset']);}return _0x440538[_0x6769('0x51')](_0x2c97b0);}})[_0x6769('0x26')](function(_0x173f84){if(_0x173f84){return _0x173f84?{'count':_0xebffc1,'rows':_0x173f84}:null;}})[_0x6769('0x26')](respondWithResult(_0x303d8b,null))[_0x6769('0x47')](handleError(_0x303d8b,null));};exports[_0x6769('0x52')]=function(_0x38d467,_0x2b6dcd,_0x59786f){var _0x1fb73a={};var _0x184983={};var _0x24027a;var _0x31e1d0;return db['ServicenowConfiguration'][_0x6769('0x4e')]({'where':{'id':_0x38d467[_0x6769('0x49')]['id']}})[_0x6769('0x26')](handleEntityNotFound(_0x2b6dcd,null))[_0x6769('0x26')](function(_0x7b226){if(_0x7b226){_0x24027a=_0x7b226;_0x184983[_0x6769('0x33')]=_[_0x6769('0x35')](db[_0x6769('0x4f')][_0x6769('0x30')]);_0x184983[_0x6769('0x34')]=_[_0x6769('0x35')](_0x38d467[_0x6769('0x34')]);_0x184983['filters']=_['intersection'](_0x184983[_0x6769('0x33')],_0x184983[_0x6769('0x34')]);_0x1fb73a[_0x6769('0x38')]=_['intersection'](_0x184983[_0x6769('0x33')],qs[_0x6769('0x39')](_0x38d467['query'][_0x6769('0x39')]));_0x1fb73a[_0x6769('0x38')]=_0x1fb73a[_0x6769('0x38')][_0x6769('0x3a')]?_0x1fb73a[_0x6769('0x38')]:_0x184983[_0x6769('0x33')];_0x1fb73a[_0x6769('0x3d')]=qs[_0x6769('0x3e')](_0x38d467[_0x6769('0x34')][_0x6769('0x3e')]);_0x1fb73a[_0x6769('0x3f')]=qs[_0x6769('0x36')](_[_0x6769('0x40')](_0x38d467[_0x6769('0x34')],_0x184983[_0x6769('0x36')]));if(_0x38d467[_0x6769('0x34')]['filter']){_0x1fb73a[_0x6769('0x3f')]=_[_0x6769('0x41')](_0x1fb73a[_0x6769('0x3f')],{'$or':_[_0x6769('0x2e')](_0x1fb73a[_0x6769('0x38')],function(_0x52815d){var _0x3bf15e={};_0x3bf15e[_0x52815d]={'$like':'%'+_0x38d467[_0x6769('0x34')]['filter']+'%'};return _0x3bf15e;})});}_0x1fb73a=_['merge']({},_0x1fb73a,_0x38d467[_0x6769('0x4a')]);return _0x24027a[_0x6769('0x52')](_0x1fb73a);}})[_0x6769('0x26')](function(_0x4df8dc){if(_0x4df8dc){_0x31e1d0=_0x4df8dc[_0x6769('0x3a')];if(!_0x38d467['query'][_0x6769('0x3b')](_0x6769('0x3c'))){_0x1fb73a['limit']=qs[_0x6769('0x1e')](_0x38d467[_0x6769('0x34')][_0x6769('0x1e')]);_0x1fb73a[_0x6769('0x1c')]=qs['offset'](_0x38d467[_0x6769('0x34')][_0x6769('0x1c')]);}return _0x24027a['getDescriptions'](_0x1fb73a);}})[_0x6769('0x26')](function(_0x6d0331){if(_0x6d0331){return _0x6d0331?{'count':_0x31e1d0,'rows':_0x6d0331}:null;}})['then'](respondWithResult(_0x2b6dcd,null))['catch'](handleError(_0x2b6dcd,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f61454b..f59fd7b 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 _0xb688=['exports','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x46435b,_0x2a78d4){var _0x16b5ab=function(_0x528fb7){while(--_0x528fb7){_0x46435b['push'](_0x46435b['shift']());}};_0x16b5ab(++_0x2a78d4);}(_0xb688,0xcf));var _0x8b68=function(_0x4901a3,_0xc6efef){_0x4901a3=_0x4901a3-0x0;var _0x42329d=_0xb688[_0x4901a3];return _0x42329d;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7177=['exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf','./intServicenowConfiguration.attributes'];(function(_0x401f08,_0xeba17b){var _0x4ec76c=function(_0x12355b){while(--_0x12355b){_0x401f08['push'](_0x401f08['shift']());}};_0x4ec76c(++_0xeba17b);}(_0x7177,0x101));var _0x7717=function(_0x1cb267,_0xab55ce){_0x1cb267=_0x1cb267-0x0;var _0x8b30ff=_0x7177[_0x1cb267];return _0x8b30ff;};'use strict';var _=require(_0x7717('0x0'));var util=require('util');var logger=require(_0x7717('0x1'))('api');var moment=require(_0x7717('0x2'));var BPromise=require(_0x7717('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7717('0x4'));var rimraf=require(_0x7717('0x5'));var config=require('../../config/environment');var attributes=require(_0x7717('0x6'));module[_0x7717('0x7')]=function(_0x40e3ec,_0x20ca81){return _0x40e3ec[_0x7717('0x8')](_0x7717('0x9'),attributes,{'tableName':_0x7717('0xa'),'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 00f7c21..ce59056 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 _0x473a=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x473a,0x173));var _0xa473=function(_0x48b21b,_0x5eb9e9){_0x48b21b=_0x48b21b-0x0;var _0x11af41=_0x473a[_0x48b21b];return _0x11af41;};'use strict';var _=require(_0xa473('0x0'));var util=require(_0xa473('0x1'));var moment=require(_0xa473('0x2'));var BPromise=require(_0xa473('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa473('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa473('0x5'));var client=jayson[_0xa473('0x6')][_0xa473('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x299a2e,_0x312952,_0x2e5de8){return new BPromise(function(_0x34192a,_0x3882ff){return client[_0xa473('0x8')](_0x299a2e,_0x2e5de8)['then'](function(_0x477d37){logger[_0xa473('0x9')](_0xa473('0xa'),_0x312952,_0xa473('0xb'));logger[_0xa473('0xc')](_0xa473('0xd'),_0x312952,_0xa473('0xb'),JSON[_0xa473('0xe')](_0x477d37));if(_0x477d37[_0xa473('0xf')]){if(_0x477d37['error'][_0xa473('0x10')]===0x1f4){logger[_0xa473('0xf')](_0xa473('0xa'),_0x312952,_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);return _0x3882ff(_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);}logger[_0xa473('0xf')](_0xa473('0xa'),_0x312952,_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);return _0x34192a(_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);}else{logger[_0xa473('0x9')](_0xa473('0xa'),_0x312952,'request\x20sent');_0x34192a(_0x477d37[_0xa473('0x12')][_0xa473('0x11')]);}})[_0xa473('0x13')](function(_0x356881){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x312952,_0x356881);_0x3882ff(_0x356881);});});} \ No newline at end of file +var _0x185d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x16e6ea,_0x44978e){var _0x29ae3c=function(_0x54da81){while(--_0x54da81){_0x16e6ea['push'](_0x16e6ea['shift']());}};_0x29ae3c(++_0x44978e);}(_0x185d,0xe1));var _0xd185=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x185d[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0xd185('0x0'));var moment=require(_0xd185('0x1'));var BPromise=require(_0xd185('0x2'));var rs=require(_0xd185('0x3'));var fs=require('fs');var Redis=require(_0xd185('0x4'));var db=require(_0xd185('0x5'))['db'];var utils=require(_0xd185('0x6'));var logger=require(_0xd185('0x7'))(_0xd185('0x8'));var config=require(_0xd185('0x9'));var jayson=require(_0xd185('0xa'));var client=jayson[_0xd185('0xb')][_0xd185('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59d0a7,_0xbf7658,_0x416efe){return new BPromise(function(_0x53af32,_0x175d64){return client['request'](_0x59d0a7,_0x416efe)[_0xd185('0xd')](function(_0x576c25){logger['info'](_0xd185('0xe'),_0xbf7658,'request\x20sent');logger[_0xd185('0xf')](_0xd185('0x10'),_0xbf7658,'request\x20sent',JSON[_0xd185('0x11')](_0x576c25));if(_0x576c25[_0xd185('0x12')]){if(_0x576c25[_0xd185('0x12')][_0xd185('0x13')]===0x1f4){logger['error'](_0xd185('0xe'),_0xbf7658,_0x576c25[_0xd185('0x12')][_0xd185('0x14')]);return _0x175d64(_0x576c25['error']['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xbf7658,_0x576c25['error'][_0xd185('0x14')]);return _0x53af32(_0x576c25[_0xd185('0x12')][_0xd185('0x14')]);}else{logger[_0xd185('0x15')](_0xd185('0xe'),_0xbf7658,_0xd185('0x16'));_0x53af32(_0x576c25[_0xd185('0x17')][_0xd185('0x14')]);}})[_0xd185('0x18')](function(_0x13347d){logger['error'](_0xd185('0xe'),_0xbf7658,_0x13347d);_0x175d64(_0x13347d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7eb7d42..8bce8ce 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 _0x40ce=['create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40ce,0xca));var _0xe40c=function(_0x5b6ffe,_0x280e9a){_0x5b6ffe=_0x5b6ffe-0x0;var _0x5f2d56=_0x40ce[_0x5b6ffe];return _0x5f2d56;};'use strict';var multer=require(_0xe40c('0x0'));var util=require('util');var path=require(_0xe40c('0x1'));var timeout=require(_0xe40c('0x2'));var express=require(_0xe40c('0x3'));var router=express[_0xe40c('0x4')]();var fs_extra=require(_0xe40c('0x5'));var auth=require(_0xe40c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe40c('0x7'));var controller=require(_0xe40c('0x8'));router[_0xe40c('0x9')]('/',auth['isAuthenticated'](),controller[_0xe40c('0xa')]);router[_0xe40c('0x9')](_0xe40c('0xb'),auth[_0xe40c('0xc')](),controller[_0xe40c('0xd')]);router['post']('/',auth[_0xe40c('0xc')](),controller[_0xe40c('0xe')]);router[_0xe40c('0xf')](_0xe40c('0xb'),auth[_0xe40c('0xc')](),controller['update']);router[_0xe40c('0x10')](_0xe40c('0xb'),auth[_0xe40c('0xc')](),controller[_0xe40c('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfbd0=['index','get','/:id','show','post','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','isAuthenticated'];(function(_0x3a9e17,_0x14aac5){var _0xd8c753=function(_0x574d7a){while(--_0x574d7a){_0x3a9e17['push'](_0x3a9e17['shift']());}};_0xd8c753(++_0x14aac5);}(_0xfbd0,0x128));var _0x0fbd=function(_0x42eaca,_0x1fbbbc){_0x42eaca=_0x42eaca-0x0;var _0x2832d1=_0xfbd0[_0x42eaca];return _0x2832d1;};'use strict';var multer=require(_0x0fbd('0x0'));var util=require(_0x0fbd('0x1'));var path=require(_0x0fbd('0x2'));var timeout=require(_0x0fbd('0x3'));var express=require(_0x0fbd('0x4'));var router=express['Router']();var fs_extra=require(_0x0fbd('0x5'));var auth=require(_0x0fbd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0fbd('0x7'));var controller=require(_0x0fbd('0x8'));router['get']('/',auth[_0x0fbd('0x9')](),controller[_0x0fbd('0xa')]);router[_0x0fbd('0xb')](_0x0fbd('0xc'),auth[_0x0fbd('0x9')](),controller[_0x0fbd('0xd')]);router[_0x0fbd('0xe')]('/',auth[_0x0fbd('0x9')](),controller['create']);router['put']('/:id',auth[_0x0fbd('0x9')](),controller['update']);router[_0x0fbd('0xf')](_0x0fbd('0xc'),auth[_0x0fbd('0x9')](),controller['destroy']);module[_0x0fbd('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 59a517f..b86e3ef 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 _0xc88e=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x2d1e93,_0x4d4704){var _0x206afc=function(_0x1ecbe8){while(--_0x1ecbe8){_0x2d1e93['push'](_0x2d1e93['shift']());}};_0x206afc(++_0x4d4704);}(_0xc88e,0xe9));var _0xec88=function(_0x8d6c7a,_0x2d4c3c){_0x8d6c7a=_0x8d6c7a-0x0;var _0x2c305a=_0xc88e[_0x8d6c7a];return _0x2c305a;};'use strict';var Sequelize=require(_0xec88('0x0'));module[_0xec88('0x1')]={'type':{'type':Sequelize[_0xec88('0x2')](_0xec88('0x3'),_0xec88('0x4'),_0xec88('0x5'),'keyValue',_0xec88('0x6')),'defaultValue':_0xec88('0x3')},'content':{'type':Sequelize[_0xec88('0x7')]},'key':{'type':Sequelize[_0xec88('0x7')]},'keyType':{'type':Sequelize[_0xec88('0x2')](_0xec88('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xec88('0x7')]},'nameField':{'type':Sequelize[_0xec88('0x7')]},'customField':{'type':Sequelize[_0xec88('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xec88('0x7')]}}; \ No newline at end of file +var _0x1dc9=['STRING','ENUM','variable','BOOLEAN','exports','customVariable','picklist','string'];(function(_0x58321f,_0x5730b9){var _0x3728ea=function(_0x53e4ac){while(--_0x53e4ac){_0x58321f['push'](_0x58321f['shift']());}};_0x3728ea(++_0x5730b9);}(_0x1dc9,0x15c));var _0x91dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1dc9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x91dc('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x91dc('0x1'),'keyValue',_0x91dc('0x2')),'defaultValue':_0x91dc('0x3')},'content':{'type':Sequelize[_0x91dc('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x91dc('0x5')]('string',_0x91dc('0x6'),_0x91dc('0x1'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x91dc('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x91dc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x91dc('0x4')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c64be18..46a95b0 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 _0x8588=['attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','update','then','destroy','end','error','send','index','ServicenowField','fieldName','type','map','name','filters','intersection','model','query'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0x8588,0xf2));var _0x8858=function(_0x469fa7,_0x51539a){_0x469fa7=_0x469fa7-0x0;var _0x51be0a=_0x8588[_0x469fa7];return _0x51be0a;};'use strict';var emlformat=require(_0x8858('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8858('0x1'));var jsonpatch=require(_0x8858('0x2'));var rp=require(_0x8858('0x3'));var moment=require(_0x8858('0x4'));var BPromise=require(_0x8858('0x5'));var Mustache=require(_0x8858('0x6'));var util=require('util');var path=require(_0x8858('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8858('0x8'));var fs=require('fs');var fs_extra=require(_0x8858('0x9'));var _=require(_0x8858('0xa'));var squel=require(_0x8858('0xb'));var crypto=require(_0x8858('0xc'));var jsforce=require(_0x8858('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8858('0xe'));var querystring=require(_0x8858('0xf'));var Papa=require(_0x8858('0x10'));var Redis=require(_0x8858('0x11'));var authService=require(_0x8858('0x12'));var qs=require(_0x8858('0x13'));var as=require(_0x8858('0x14'));var hardwareService=require(_0x8858('0x15'));var logger=require(_0x8858('0x16'))('api');var utils=require(_0x8858('0x17'));var config=require(_0x8858('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8858('0x19'))['db'];function respondWithStatusCode(_0xa72086,_0x40d453){_0x40d453=_0x40d453||0xcc;return function(_0x23b6f5){if(_0x23b6f5){return _0xa72086[_0x8858('0x1a')](_0x40d453);}return _0xa72086[_0x8858('0x1b')](_0x40d453)['end']();};}function respondWithResult(_0x35a2e2,_0x2cc035){_0x2cc035=_0x2cc035||0xc8;return function(_0x35912a){if(_0x35912a){return _0x35a2e2[_0x8858('0x1b')](_0x2cc035)[_0x8858('0x1c')](_0x35912a);}};}function respondWithFilteredResult(_0x29a52c,_0x13f1a5){return function(_0x22fa08){if(_0x22fa08){var _0x5cee94=typeof _0x13f1a5[_0x8858('0x1d')]===_0x8858('0x1e')&&typeof _0x13f1a5[_0x8858('0x1f')]==='undefined';var _0x3f3699=_0x22fa08[_0x8858('0x20')];var _0x18548e=_0x5cee94?0x0:_0x13f1a5['offset'];var _0x1f8dd8=_0x5cee94?_0x22fa08[_0x8858('0x20')]:_0x13f1a5[_0x8858('0x1d')]+_0x13f1a5[_0x8858('0x1f')];var _0x53fb61;if(_0x1f8dd8>=_0x3f3699){_0x1f8dd8=_0x3f3699;_0x53fb61=0xc8;}else{_0x53fb61=0xce;}_0x29a52c[_0x8858('0x1b')](_0x53fb61);return _0x29a52c['set']('Content-Range',_0x18548e+'-'+_0x1f8dd8+'/'+_0x3f3699)['json'](_0x22fa08);}return null;};}function patchUpdates(_0x4b4ba9){return function(_0x29050d){try{jsonpatch[_0x8858('0x21')](_0x29050d,_0x4b4ba9,!![]);}catch(_0xf5c23b){return BPromise['reject'](_0xf5c23b);}return _0x29050d['save']();};}function saveUpdates(_0x376277,_0x1f3588){return function(_0xbedbbc){if(_0xbedbbc){return _0xbedbbc[_0x8858('0x22')](_0x376277)[_0x8858('0x23')](function(_0x5bb1c5){return _0x5bb1c5;});}return null;};}function removeEntity(_0x4361f2,_0x5cfb87){return function(_0x201d45){if(_0x201d45){return _0x201d45[_0x8858('0x24')]()['then'](function(){_0x4361f2[_0x8858('0x1b')](0xcc)[_0x8858('0x25')]();});}};}function handleEntityNotFound(_0x87d6ec,_0x46d556){return function(_0x48d025){if(!_0x48d025){_0x87d6ec['sendStatus'](0x194);}return _0x48d025;};}function handleError(_0x23f454,_0x392514){_0x392514=_0x392514||0x1f4;return function(_0x1ce480){logger[_0x8858('0x26')](_0x1ce480['stack']);if(_0x1ce480['name']){delete _0x1ce480['name'];}_0x23f454[_0x8858('0x1b')](_0x392514)[_0x8858('0x27')](_0x1ce480);};}exports[_0x8858('0x28')]=function(_0x2de84f,_0x2c50bd){var _0x25bf47={},_0x2e53fe={},_0x23d3d1={'count':0x0,'rows':[]};var _0x16a64f=_['map'](db[_0x8858('0x29')]['rawAttributes'],function(_0x5ebfe6){return{'name':_0x5ebfe6[_0x8858('0x2a')],'type':_0x5ebfe6[_0x8858('0x2b')]['key']};});_0x2e53fe['model']=_[_0x8858('0x2c')](_0x16a64f,_0x8858('0x2d'));_0x2e53fe['query']=_['keys'](_0x2de84f['query']);_0x2e53fe[_0x8858('0x2e')]=_[_0x8858('0x2f')](_0x2e53fe[_0x8858('0x30')],_0x2e53fe[_0x8858('0x31')]);_0x25bf47[_0x8858('0x32')]=_[_0x8858('0x2f')](_0x2e53fe[_0x8858('0x30')],qs[_0x8858('0x33')](_0x2de84f[_0x8858('0x31')][_0x8858('0x33')]));_0x25bf47['attributes']=_0x25bf47[_0x8858('0x32')][_0x8858('0x34')]?_0x25bf47[_0x8858('0x32')]:_0x2e53fe[_0x8858('0x30')];if(!_0x2de84f[_0x8858('0x31')][_0x8858('0x35')]('nolimit')){_0x25bf47[_0x8858('0x1f')]=qs[_0x8858('0x1f')](_0x2de84f[_0x8858('0x31')][_0x8858('0x1f')]);_0x25bf47['offset']=qs[_0x8858('0x1d')](_0x2de84f[_0x8858('0x31')][_0x8858('0x1d')]);}_0x25bf47[_0x8858('0x36')]=qs[_0x8858('0x37')](_0x2de84f['query']['sort']);_0x25bf47['where']=qs[_0x8858('0x2e')](_[_0x8858('0x38')](_0x2de84f[_0x8858('0x31')],_0x2e53fe[_0x8858('0x2e')]),_0x16a64f);if(_0x2de84f[_0x8858('0x31')][_0x8858('0x39')]){_0x25bf47['where']=_[_0x8858('0x3a')](_0x25bf47[_0x8858('0x3b')],{'$or':_[_0x8858('0x2c')](_0x16a64f,function(_0x119108){if(_0x119108[_0x8858('0x2b')]!==_0x8858('0x3c')){var _0x10f3c4={};_0x10f3c4[_0x119108[_0x8858('0x2d')]]={'$like':'%'+_0x2de84f['query'][_0x8858('0x39')]+'%'};return _0x10f3c4;}})});}_0x25bf47=_[_0x8858('0x3a')]({},_0x25bf47,_0x2de84f[_0x8858('0x3d')]);var _0x5059b6={'where':_0x25bf47[_0x8858('0x3b')]};return db[_0x8858('0x29')][_0x8858('0x20')](_0x5059b6)['then'](function(_0x30ccfd){_0x23d3d1[_0x8858('0x20')]=_0x30ccfd;if(_0x2de84f[_0x8858('0x31')][_0x8858('0x3e')]){_0x25bf47[_0x8858('0x3f')]=[{'all':!![]}];}return db[_0x8858('0x29')][_0x8858('0x40')](_0x25bf47);})[_0x8858('0x23')](function(_0x5b14fa){_0x23d3d1[_0x8858('0x41')]=_0x5b14fa;return _0x23d3d1;})[_0x8858('0x23')](respondWithFilteredResult(_0x2c50bd,_0x25bf47))[_0x8858('0x42')](handleError(_0x2c50bd,null));};exports[_0x8858('0x43')]=function(_0x3576ee,_0x74727c){var _0x210b1a={'raw':!![],'where':{'id':_0x3576ee[_0x8858('0x44')]['id']}},_0x21908a={};_0x21908a['model']=_[_0x8858('0x45')](db[_0x8858('0x29')][_0x8858('0x46')]);_0x21908a['query']=_[_0x8858('0x45')](_0x3576ee[_0x8858('0x31')]);_0x21908a['filters']=_[_0x8858('0x2f')](_0x21908a[_0x8858('0x30')],_0x21908a[_0x8858('0x31')]);_0x210b1a[_0x8858('0x32')]=_[_0x8858('0x2f')](_0x21908a[_0x8858('0x30')],qs[_0x8858('0x33')](_0x3576ee[_0x8858('0x31')]['fields']));_0x210b1a['attributes']=_0x210b1a[_0x8858('0x32')]['length']?_0x210b1a[_0x8858('0x32')]:_0x21908a[_0x8858('0x30')];if(_0x3576ee[_0x8858('0x31')][_0x8858('0x3e')]){_0x210b1a['include']=[{'all':!![]}];}_0x210b1a=_[_0x8858('0x3a')]({},_0x210b1a,_0x3576ee[_0x8858('0x3d')]);return db[_0x8858('0x29')][_0x8858('0x47')](_0x210b1a)[_0x8858('0x23')](handleEntityNotFound(_0x74727c,null))[_0x8858('0x23')](respondWithResult(_0x74727c,null))[_0x8858('0x42')](handleError(_0x74727c,null));};exports['create']=function(_0x3d5d53,_0x6521fd){return db[_0x8858('0x29')]['create'](_0x3d5d53[_0x8858('0x48')],{})[_0x8858('0x23')](respondWithResult(_0x6521fd,0xc9))[_0x8858('0x42')](handleError(_0x6521fd,null));};exports[_0x8858('0x22')]=function(_0x1f32a7,_0x32f884){if(_0x1f32a7[_0x8858('0x48')]['id']){delete _0x1f32a7[_0x8858('0x48')]['id'];}return db[_0x8858('0x29')]['find']({'where':{'id':_0x1f32a7[_0x8858('0x44')]['id']}})[_0x8858('0x23')](handleEntityNotFound(_0x32f884,null))[_0x8858('0x23')](saveUpdates(_0x1f32a7[_0x8858('0x48')],null))[_0x8858('0x23')](respondWithResult(_0x32f884,null))['catch'](handleError(_0x32f884,null));};exports[_0x8858('0x24')]=function(_0x46d71f,_0x25c08b){return db['ServicenowField'][_0x8858('0x47')]({'where':{'id':_0x46d71f[_0x8858('0x44')]['id']}})['then'](handleEntityNotFound(_0x25c08b,null))[_0x8858('0x23')](removeEntity(_0x25c08b,null))['catch'](handleError(_0x25c08b,null));}; \ No newline at end of file +var _0xa90c=['filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ServicenowField','fieldName','type','key','model','keys','query'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0xa90c,0x1e0));var _0xca90=function(_0xc36a99,_0x589ab9){_0xc36a99=_0xc36a99-0x0;var _0x3b216d=_0xa90c[_0xc36a99];return _0x3b216d;};'use strict';var emlformat=require(_0xca90('0x0'));var rimraf=require(_0xca90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca90('0x2'));var rp=require(_0xca90('0x3'));var moment=require(_0xca90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xca90('0x5'));var util=require(_0xca90('0x6'));var path=require(_0xca90('0x7'));var sox=require(_0xca90('0x8'));var csv=require(_0xca90('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca90('0xa'));var squel=require(_0xca90('0xb'));var crypto=require(_0xca90('0xc'));var jsforce=require(_0xca90('0xd'));var deskjs=require(_0xca90('0xe'));var toCsv=require(_0xca90('0x9'));var querystring=require(_0xca90('0xf'));var Papa=require(_0xca90('0x10'));var Redis=require(_0xca90('0x11'));var authService=require(_0xca90('0x12'));var qs=require(_0xca90('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca90('0x14'));var logger=require(_0xca90('0x15'))(_0xca90('0x16'));var utils=require(_0xca90('0x17'));var config=require(_0xca90('0x18'));var licenseUtil=require(_0xca90('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be09e,_0x2b2a03){_0x2b2a03=_0x2b2a03||0xcc;return function(_0x652462){if(_0x652462){return _0x4be09e[_0xca90('0x1a')](_0x2b2a03);}return _0x4be09e[_0xca90('0x1b')](_0x2b2a03)[_0xca90('0x1c')]();};}function respondWithResult(_0x316b00,_0x4f1b85){_0x4f1b85=_0x4f1b85||0xc8;return function(_0x2cc9b4){if(_0x2cc9b4){return _0x316b00[_0xca90('0x1b')](_0x4f1b85)[_0xca90('0x1d')](_0x2cc9b4);}};}function respondWithFilteredResult(_0x253871,_0xee0a40){return function(_0x5ee05a){if(_0x5ee05a){var _0x12a0c6=typeof _0xee0a40['offset']==='undefined'&&typeof _0xee0a40['limit']===_0xca90('0x1e');var _0x4a1251=_0x5ee05a['count'];var _0x2fda56=_0x12a0c6?0x0:_0xee0a40[_0xca90('0x1f')];var _0x3c8738=_0x12a0c6?_0x5ee05a['count']:_0xee0a40[_0xca90('0x1f')]+_0xee0a40[_0xca90('0x20')];var _0x42b136;if(_0x3c8738>=_0x4a1251){_0x3c8738=_0x4a1251;_0x42b136=0xc8;}else{_0x42b136=0xce;}_0x253871['status'](_0x42b136);return _0x253871[_0xca90('0x21')](_0xca90('0x22'),_0x2fda56+'-'+_0x3c8738+'/'+_0x4a1251)[_0xca90('0x1d')](_0x5ee05a);}return null;};}function patchUpdates(_0x516160){return function(_0xd69b97){try{jsonpatch[_0xca90('0x23')](_0xd69b97,_0x516160,!![]);}catch(_0x5b0174){return BPromise[_0xca90('0x24')](_0x5b0174);}return _0xd69b97[_0xca90('0x25')]();};}function saveUpdates(_0x1dc792,_0x218ec2){return function(_0xe734ba){if(_0xe734ba){return _0xe734ba[_0xca90('0x26')](_0x1dc792)[_0xca90('0x27')](function(_0x2d848c){return _0x2d848c;});}return null;};}function removeEntity(_0x346ca9,_0x44658f){return function(_0x2a7132){if(_0x2a7132){return _0x2a7132['destroy']()[_0xca90('0x27')](function(){_0x346ca9[_0xca90('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13bab1,_0x4eef9c){return function(_0xe0f507){if(!_0xe0f507){_0x13bab1['sendStatus'](0x194);}return _0xe0f507;};}function handleError(_0x375cff,_0x2b8723){_0x2b8723=_0x2b8723||0x1f4;return function(_0x1fb4ac){logger['error'](_0x1fb4ac[_0xca90('0x28')]);if(_0x1fb4ac[_0xca90('0x29')]){delete _0x1fb4ac[_0xca90('0x29')];}_0x375cff[_0xca90('0x1b')](_0x2b8723)[_0xca90('0x2a')](_0x1fb4ac);};}exports[_0xca90('0x2b')]=function(_0x688c83,_0xace98a){var _0x36bb9c={},_0x2afcdc={},_0x232326={'count':0x0,'rows':[]};var _0x4c6fe0=_[_0xca90('0x2c')](db[_0xca90('0x2d')]['rawAttributes'],function(_0x217d1a){return{'name':_0x217d1a[_0xca90('0x2e')],'type':_0x217d1a[_0xca90('0x2f')][_0xca90('0x30')]};});_0x2afcdc[_0xca90('0x31')]=_['map'](_0x4c6fe0,_0xca90('0x29'));_0x2afcdc['query']=_[_0xca90('0x32')](_0x688c83[_0xca90('0x33')]);_0x2afcdc[_0xca90('0x34')]=_[_0xca90('0x35')](_0x2afcdc['model'],_0x2afcdc[_0xca90('0x33')]);_0x36bb9c[_0xca90('0x36')]=_[_0xca90('0x35')](_0x2afcdc['model'],qs[_0xca90('0x37')](_0x688c83[_0xca90('0x33')][_0xca90('0x37')]));_0x36bb9c['attributes']=_0x36bb9c[_0xca90('0x36')]['length']?_0x36bb9c['attributes']:_0x2afcdc[_0xca90('0x31')];if(!_0x688c83[_0xca90('0x33')]['hasOwnProperty'](_0xca90('0x38'))){_0x36bb9c[_0xca90('0x20')]=qs[_0xca90('0x20')](_0x688c83['query'][_0xca90('0x20')]);_0x36bb9c[_0xca90('0x1f')]=qs[_0xca90('0x1f')](_0x688c83[_0xca90('0x33')][_0xca90('0x1f')]);}_0x36bb9c[_0xca90('0x39')]=qs['sort'](_0x688c83[_0xca90('0x33')][_0xca90('0x3a')]);_0x36bb9c[_0xca90('0x3b')]=qs[_0xca90('0x34')](_['pick'](_0x688c83[_0xca90('0x33')],_0x2afcdc[_0xca90('0x34')]),_0x4c6fe0);if(_0x688c83['query'][_0xca90('0x3c')]){_0x36bb9c['where']=_[_0xca90('0x3d')](_0x36bb9c[_0xca90('0x3b')],{'$or':_[_0xca90('0x2c')](_0x4c6fe0,function(_0x57a188){if(_0x57a188[_0xca90('0x2f')]!==_0xca90('0x3e')){var _0xcb5291={};_0xcb5291[_0x57a188['name']]={'$like':'%'+_0x688c83[_0xca90('0x33')][_0xca90('0x3c')]+'%'};return _0xcb5291;}})});}_0x36bb9c=_[_0xca90('0x3d')]({},_0x36bb9c,_0x688c83[_0xca90('0x3f')]);var _0x5dfde1={'where':_0x36bb9c[_0xca90('0x3b')]};return db[_0xca90('0x2d')][_0xca90('0x40')](_0x5dfde1)['then'](function(_0x1829c0){_0x232326['count']=_0x1829c0;if(_0x688c83[_0xca90('0x33')][_0xca90('0x41')]){_0x36bb9c[_0xca90('0x42')]=[{'all':!![]}];}return db[_0xca90('0x2d')][_0xca90('0x43')](_0x36bb9c);})[_0xca90('0x27')](function(_0x387566){_0x232326['rows']=_0x387566;return _0x232326;})['then'](respondWithFilteredResult(_0xace98a,_0x36bb9c))[_0xca90('0x44')](handleError(_0xace98a,null));};exports[_0xca90('0x45')]=function(_0x2af672,_0x316395){var _0x412c6a={'raw':!![],'where':{'id':_0x2af672[_0xca90('0x46')]['id']}},_0x502917={};_0x502917['model']=_[_0xca90('0x32')](db['ServicenowField']['rawAttributes']);_0x502917[_0xca90('0x33')]=_[_0xca90('0x32')](_0x2af672[_0xca90('0x33')]);_0x502917['filters']=_['intersection'](_0x502917['model'],_0x502917['query']);_0x412c6a['attributes']=_[_0xca90('0x35')](_0x502917[_0xca90('0x31')],qs['fields'](_0x2af672['query']['fields']));_0x412c6a[_0xca90('0x36')]=_0x412c6a[_0xca90('0x36')][_0xca90('0x47')]?_0x412c6a['attributes']:_0x502917[_0xca90('0x31')];if(_0x2af672[_0xca90('0x33')][_0xca90('0x41')]){_0x412c6a[_0xca90('0x42')]=[{'all':!![]}];}_0x412c6a=_[_0xca90('0x3d')]({},_0x412c6a,_0x2af672['options']);return db[_0xca90('0x2d')][_0xca90('0x48')](_0x412c6a)[_0xca90('0x27')](handleEntityNotFound(_0x316395,null))[_0xca90('0x27')](respondWithResult(_0x316395,null))[_0xca90('0x44')](handleError(_0x316395,null));};exports[_0xca90('0x49')]=function(_0x39cf81,_0x2a0fdd){return db[_0xca90('0x2d')][_0xca90('0x49')](_0x39cf81[_0xca90('0x4a')],{})[_0xca90('0x27')](respondWithResult(_0x2a0fdd,0xc9))['catch'](handleError(_0x2a0fdd,null));};exports[_0xca90('0x26')]=function(_0x3daf1d,_0x57ac86){if(_0x3daf1d[_0xca90('0x4a')]['id']){delete _0x3daf1d[_0xca90('0x4a')]['id'];}return db[_0xca90('0x2d')][_0xca90('0x48')]({'where':{'id':_0x3daf1d[_0xca90('0x46')]['id']}})[_0xca90('0x27')](handleEntityNotFound(_0x57ac86,null))[_0xca90('0x27')](saveUpdates(_0x3daf1d['body'],null))[_0xca90('0x27')](respondWithResult(_0x57ac86,null))[_0xca90('0x44')](handleError(_0x57ac86,null));};exports[_0xca90('0x4b')]=function(_0x4a3647,_0x53bde6){return db[_0xca90('0x2d')][_0xca90('0x48')]({'where':{'id':_0x4a3647[_0xca90('0x46')]['id']}})[_0xca90('0x27')](handleEntityNotFound(_0x53bde6,null))['then'](removeEntity(_0x53bde6,null))[_0xca90('0x44')](handleError(_0x53bde6,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c348aea..5d167ad 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 _0x5ec2=['int_servicenow_fields','servicenow_unique_index','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','ServicenowField'];(function(_0x3805a2,_0x3c0ca0){var _0x546eea=function(_0x37de35){while(--_0x37de35){_0x3805a2['push'](_0x3805a2['shift']());}};_0x546eea(++_0x3c0ca0);}(_0x5ec2,0xda));var _0x25ec=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x5ec2[_0xba1760];return _0x1f3143;};'use strict';var _=require('lodash');var util=require(_0x25ec('0x0'));var logger=require(_0x25ec('0x1'))(_0x25ec('0x2'));var moment=require(_0x25ec('0x3'));var BPromise=require(_0x25ec('0x4'));var rp=require(_0x25ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x25ec('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x25ec('0x7')]=function(_0x55a2d1,_0x4f59e5){return _0x55a2d1[_0x25ec('0x8')](_0x25ec('0x9'),attributes,{'tableName':_0x25ec('0xa'),'paranoid':![],'indexes':[{'name':_0x25ec('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6264=['ServicenowField','int_servicenow_fields','idField','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x10272c,_0x5c0de9){var _0xc15ccc=function(_0x32908f){while(--_0x32908f){_0x10272c['push'](_0x10272c['shift']());}};_0xc15ccc(++_0x5c0de9);}(_0x6264,0x1bd));var _0x4626=function(_0x1b44b5,_0x4bfc7b){_0x1b44b5=_0x1b44b5-0x0;var _0x2a08b1=_0x6264[_0x1b44b5];return _0x2a08b1;};'use strict';var _=require('lodash');var util=require(_0x4626('0x0'));var logger=require(_0x4626('0x1'))(_0x4626('0x2'));var moment=require(_0x4626('0x3'));var BPromise=require(_0x4626('0x4'));var rp=require(_0x4626('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4626('0x6'));var config=require(_0x4626('0x7'));var attributes=require(_0x4626('0x8'));module[_0x4626('0x9')]=function(_0x1f0272,_0x3cdf2c){return _0x1f0272['define'](_0x4626('0xa'),attributes,{'tableName':_0x4626('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x4626('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 1514c53..8e1e186 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5d92b0,_0xd8c969){var _0x4d2bf5=function(_0x3c710a){while(--_0x3c710a){_0x5d92b0['push'](_0x5d92b0['shift']());}};_0x4d2bf5(++_0xd8c969);}(_0xf4eb,0xec));var _0xbf4e=function(_0x36ae72,_0xbde448){_0x36ae72=_0x36ae72-0x0;var _0x5e9628=_0xf4eb[_0x36ae72];return _0x5e9628;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2c39da,_0x23a441){var _0x5b966d=function(_0x5408e8){while(--_0x5408e8){_0x2c39da['push'](_0x2c39da['shift']());}};_0x5b966d(++_0x23a441);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3656ac,_0x2ac522){_0x3656ac=_0x3656ac-0x0;var _0x367cd0=_0x9bde[_0x3656ac];return _0x367cd0;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index e41213c..90eaca3 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3d9e55,_0x407319){var _0x4e7408=function(_0x4397fc){while(--_0x4397fc){_0x3d9e55['push'](_0x3d9e55['shift']());}};_0x4e7408(++_0x407319);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _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(_0x48c253,_0x17bd9f){var _0x4abde4=function(_0x494a0e){while(--_0x494a0e){_0x48c253['push'](_0x48c253['shift']());}};_0x4abde4(++_0x17bd9f);}(_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 10273a1..ed55085 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(_0x4d0e6e,_0x502b2a){var _0x5c0141=function(_0x224610){while(--_0x224610){_0x4d0e6e['push'](_0x4d0e6e['shift']());}};_0x5c0141(++_0x502b2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xa77c1a,_0x1246e4){var _0x59761d=function(_0x42d792){while(--_0x42d792){_0xa77c1a['push'](_0xa77c1a['shift']());}};_0x59761d(++_0x1246e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 6661bfb..03b39ab 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 _0xd5b5=['slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','%s%s','get_module_fields','values','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','end','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','update','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_type','direction','password','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5b5,0xf9));var _0x5d5b=function(_0x29c562,_0x106fa1){_0x29c562=_0x29c562-0x0;var _0x1ced63=_0xd5b5[_0x29c562];return _0x1ced63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d5b('0x0'));var zipdir=require(_0x5d5b('0x1'));var jsonpatch=require(_0x5d5b('0x2'));var rp=require(_0x5d5b('0x3'));var moment=require(_0x5d5b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d5b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5d5b('0x6'));var ejs=require(_0x5d5b('0x7'));var fs=require('fs');var fs_extra=require(_0x5d5b('0x8'));var _=require(_0x5d5b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5d5b('0xa'));var deskjs=require(_0x5d5b('0xb'));var toCsv=require(_0x5d5b('0x6'));var querystring=require(_0x5d5b('0xc'));var Papa=require('papaparse');var Redis=require(_0x5d5b('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d5b('0xe'))(_0x5d5b('0xf'));var utils=require('../../config/utils');var config=require(_0x5d5b('0x10'));var licenseUtil=require(_0x5d5b('0x11'));var db=require(_0x5d5b('0x12'))['db'];var integrations=require(_0x5d5b('0x13'));function respondWithStatusCode(_0x3b39aa,_0x580e13){_0x580e13=_0x580e13||0xcc;return function(_0x215bff){if(_0x215bff){return _0x3b39aa[_0x5d5b('0x14')](_0x580e13);}return _0x3b39aa[_0x5d5b('0x15')](_0x580e13)['end']();};}function respondWithResult(_0x2a5c6b,_0x68936a){_0x68936a=_0x68936a||0xc8;return function(_0x1e09d6){if(_0x1e09d6){return _0x2a5c6b[_0x5d5b('0x15')](_0x68936a)['json'](_0x1e09d6);}};}function respondWithFilteredResult(_0x32fdba,_0x4878a5){return function(_0x417964){if(_0x417964){var _0x383dda=typeof _0x4878a5[_0x5d5b('0x16')]===_0x5d5b('0x17')&&typeof _0x4878a5[_0x5d5b('0x18')]===_0x5d5b('0x17');var _0x53fdc2=_0x417964[_0x5d5b('0x19')];var _0xe3d6ce=_0x383dda?0x0:_0x4878a5[_0x5d5b('0x16')];var _0x54ab42=_0x383dda?_0x417964['count']:_0x4878a5['offset']+_0x4878a5['limit'];var _0x1750ba;if(_0x54ab42>=_0x53fdc2){_0x54ab42=_0x53fdc2;_0x1750ba=0xc8;}else{_0x1750ba=0xce;}_0x32fdba['status'](_0x1750ba);return _0x32fdba[_0x5d5b('0x1a')](_0x5d5b('0x1b'),_0xe3d6ce+'-'+_0x54ab42+'/'+_0x53fdc2)[_0x5d5b('0x1c')](_0x417964);}return null;};}function patchUpdates(_0x1d7c50){return function(_0x5aeda1){try{jsonpatch[_0x5d5b('0x1d')](_0x5aeda1,_0x1d7c50,!![]);}catch(_0x3489a6){return BPromise['reject'](_0x3489a6);}return _0x5aeda1[_0x5d5b('0x1e')]();};}function saveUpdates(_0x42b4c7,_0x2a18b6){return function(_0x60da11){if(_0x60da11){return _0x60da11['update'](_0x42b4c7)[_0x5d5b('0x1f')](function(_0x267382){return _0x267382;});}return null;};}function removeEntity(_0x9e29ce,_0x3fe82b){return function(_0xed92ff){if(_0xed92ff){return _0xed92ff[_0x5d5b('0x20')]()[_0x5d5b('0x1f')](function(){_0x9e29ce[_0x5d5b('0x15')](0xcc)[_0x5d5b('0x21')]();});}};}function handleEntityNotFound(_0x2134a8,_0x48b619){return function(_0x5087d1){if(!_0x5087d1){_0x2134a8[_0x5d5b('0x14')](0x194);}return _0x5087d1;};}function handleError(_0x31c107,_0x13fcfe){_0x13fcfe=_0x13fcfe||0x1f4;return function(_0x1dfade){logger[_0x5d5b('0x22')](_0x1dfade[_0x5d5b('0x23')]);if(_0x1dfade[_0x5d5b('0x24')]){delete _0x1dfade[_0x5d5b('0x24')];}_0x31c107[_0x5d5b('0x15')](_0x13fcfe)['send'](_0x1dfade);};}exports[_0x5d5b('0x25')]=function(_0x4d20cc,_0x563c59){var _0x1d4e18={},_0x4605ab={},_0x2045f8={'count':0x0,'rows':[]};var _0x30bf85=_[_0x5d5b('0x26')](db[_0x5d5b('0x27')][_0x5d5b('0x28')],function(_0x53efcf){return{'name':_0x53efcf[_0x5d5b('0x29')],'type':_0x53efcf['type'][_0x5d5b('0x2a')]};});_0x4605ab[_0x5d5b('0x2b')]=_[_0x5d5b('0x26')](_0x30bf85,_0x5d5b('0x24'));_0x4605ab[_0x5d5b('0x2c')]=_['keys'](_0x4d20cc['query']);_0x4605ab[_0x5d5b('0x2d')]=_[_0x5d5b('0x2e')](_0x4605ab[_0x5d5b('0x2b')],_0x4605ab['query']);_0x1d4e18['attributes']=_[_0x5d5b('0x2e')](_0x4605ab[_0x5d5b('0x2b')],qs[_0x5d5b('0x2f')](_0x4d20cc[_0x5d5b('0x2c')]['fields']));_0x1d4e18[_0x5d5b('0x30')]=_0x1d4e18['attributes'][_0x5d5b('0x31')]?_0x1d4e18['attributes']:_0x4605ab[_0x5d5b('0x2b')];if(!_0x4d20cc[_0x5d5b('0x2c')][_0x5d5b('0x32')](_0x5d5b('0x33'))){_0x1d4e18['limit']=qs[_0x5d5b('0x18')](_0x4d20cc[_0x5d5b('0x2c')][_0x5d5b('0x18')]);_0x1d4e18[_0x5d5b('0x16')]=qs[_0x5d5b('0x16')](_0x4d20cc['query'][_0x5d5b('0x16')]);}_0x1d4e18[_0x5d5b('0x34')]=qs[_0x5d5b('0x35')](_0x4d20cc['query'][_0x5d5b('0x35')]);_0x1d4e18[_0x5d5b('0x36')]=qs['filters'](_[_0x5d5b('0x37')](_0x4d20cc['query'],_0x4605ab[_0x5d5b('0x2d')]),_0x30bf85);if(_0x4d20cc[_0x5d5b('0x2c')][_0x5d5b('0x38')]){_0x1d4e18[_0x5d5b('0x36')]=_[_0x5d5b('0x39')](_0x1d4e18[_0x5d5b('0x36')],{'$or':_[_0x5d5b('0x26')](_0x30bf85,function(_0x27e5e4){if(_0x27e5e4[_0x5d5b('0x3a')]!==_0x5d5b('0x3b')){var _0x5705ff={};_0x5705ff[_0x27e5e4[_0x5d5b('0x24')]]={'$like':'%'+_0x4d20cc[_0x5d5b('0x2c')][_0x5d5b('0x38')]+'%'};return _0x5705ff;}})});}_0x1d4e18=_[_0x5d5b('0x39')]({},_0x1d4e18,_0x4d20cc[_0x5d5b('0x3c')]);var _0x57e2b5={'where':_0x1d4e18[_0x5d5b('0x36')]};return db[_0x5d5b('0x27')]['count'](_0x57e2b5)[_0x5d5b('0x1f')](function(_0x5926b8){_0x2045f8['count']=_0x5926b8;if(_0x4d20cc['query'][_0x5d5b('0x3d')]){_0x1d4e18['include']=[{'all':!![]}];}return db[_0x5d5b('0x27')][_0x5d5b('0x3e')](_0x1d4e18);})['then'](function(_0xb36c4){_0x2045f8[_0x5d5b('0x3f')]=_0xb36c4;return _0x2045f8;})[_0x5d5b('0x1f')](respondWithFilteredResult(_0x563c59,_0x1d4e18))[_0x5d5b('0x40')](handleError(_0x563c59,null));};exports[_0x5d5b('0x41')]=function(_0x3bc9d0,_0x27d289){var _0xb229d3={'raw':![],'where':{'id':_0x3bc9d0[_0x5d5b('0x42')]['id']}},_0x636b77={};_0x636b77['model']=_[_0x5d5b('0x43')](db['SugarcrmAccount'][_0x5d5b('0x28')]);_0x636b77['query']=_[_0x5d5b('0x43')](_0x3bc9d0[_0x5d5b('0x2c')]);_0x636b77[_0x5d5b('0x2d')]=_[_0x5d5b('0x2e')](_0x636b77['model'],_0x636b77[_0x5d5b('0x2c')]);_0xb229d3['attributes']=_[_0x5d5b('0x2e')](_0x636b77[_0x5d5b('0x2b')],qs['fields'](_0x3bc9d0[_0x5d5b('0x2c')][_0x5d5b('0x2f')]));_0xb229d3[_0x5d5b('0x30')]=_0xb229d3['attributes'][_0x5d5b('0x31')]?_0xb229d3['attributes']:_0x636b77[_0x5d5b('0x2b')];if(_0x3bc9d0[_0x5d5b('0x2c')][_0x5d5b('0x3d')]){_0xb229d3[_0x5d5b('0x44')]=[{'all':!![]}];}_0xb229d3=_[_0x5d5b('0x39')]({},_0xb229d3,_0x3bc9d0[_0x5d5b('0x3c')]);return db[_0x5d5b('0x27')][_0x5d5b('0x45')](_0xb229d3)[_0x5d5b('0x1f')](handleEntityNotFound(_0x27d289,null))[_0x5d5b('0x1f')](respondWithResult(_0x27d289,null))[_0x5d5b('0x40')](handleError(_0x27d289,null));};exports[_0x5d5b('0x46')]=function(_0x7b2b18,_0x16bbdc){return db['SugarcrmAccount'][_0x5d5b('0x46')](_0x7b2b18['body'],{})['then'](respondWithResult(_0x16bbdc,0xc9))[_0x5d5b('0x40')](handleError(_0x16bbdc,null));};exports[_0x5d5b('0x47')]=function(_0x3a31a1,_0x398a32){if(_0x3a31a1[_0x5d5b('0x48')]['id']){delete _0x3a31a1['body']['id'];}return db[_0x5d5b('0x27')][_0x5d5b('0x45')]({'where':{'id':_0x3a31a1['params']['id']}})[_0x5d5b('0x1f')](handleEntityNotFound(_0x398a32,null))[_0x5d5b('0x1f')](saveUpdates(_0x3a31a1['body'],null))[_0x5d5b('0x1f')](respondWithResult(_0x398a32,null))['catch'](handleError(_0x398a32,null));};exports[_0x5d5b('0x20')]=function(_0x3107f4,_0x47d616){return db[_0x5d5b('0x27')][_0x5d5b('0x45')]({'where':{'id':_0x3107f4[_0x5d5b('0x42')]['id']}})['then'](handleEntityNotFound(_0x47d616,null))[_0x5d5b('0x1f')](removeEntity(_0x47d616,null))[_0x5d5b('0x40')](handleError(_0x47d616,null));};exports[_0x5d5b('0x49')]=function(_0x577312,_0x40bf0d,_0x3e8d0b){var _0x421f8a={};var _0x34c688={};var _0x4cc36e;var _0x5bd7fe;return db['SugarcrmAccount'][_0x5d5b('0x4a')]({'where':{'id':_0x577312[_0x5d5b('0x42')]['id']}})[_0x5d5b('0x1f')](handleEntityNotFound(_0x40bf0d,null))['then'](function(_0x1632f7){if(_0x1632f7){_0x4cc36e=_0x1632f7;_0x34c688['model']=_[_0x5d5b('0x43')](db[_0x5d5b('0x4b')][_0x5d5b('0x28')]);_0x34c688['query']=_[_0x5d5b('0x43')](_0x577312[_0x5d5b('0x2c')]);_0x34c688[_0x5d5b('0x2d')]=_['intersection'](_0x34c688['model'],_0x34c688[_0x5d5b('0x2c')]);_0x421f8a[_0x5d5b('0x30')]=_[_0x5d5b('0x2e')](_0x34c688[_0x5d5b('0x2b')],qs[_0x5d5b('0x2f')](_0x577312[_0x5d5b('0x2c')][_0x5d5b('0x2f')]));_0x421f8a[_0x5d5b('0x30')]=_0x421f8a[_0x5d5b('0x30')][_0x5d5b('0x31')]?_0x421f8a['attributes']:_0x34c688[_0x5d5b('0x2b')];_0x421f8a[_0x5d5b('0x34')]=qs[_0x5d5b('0x35')](_0x577312[_0x5d5b('0x2c')][_0x5d5b('0x35')]);_0x421f8a[_0x5d5b('0x36')]=qs[_0x5d5b('0x2d')](_[_0x5d5b('0x37')](_0x577312['query'],_0x34c688['filters']));if(_0x577312[_0x5d5b('0x2c')]['filter']){_0x421f8a[_0x5d5b('0x36')]=_[_0x5d5b('0x39')](_0x421f8a[_0x5d5b('0x36')],{'$or':_[_0x5d5b('0x26')](_0x421f8a[_0x5d5b('0x30')],function(_0x455609){var _0x2e299e={};_0x2e299e[_0x455609]={'$like':'%'+_0x577312[_0x5d5b('0x2c')][_0x5d5b('0x38')]+'%'};return _0x2e299e;})});}_0x421f8a=_[_0x5d5b('0x39')]({},_0x421f8a,_0x577312[_0x5d5b('0x3c')]);return _0x4cc36e[_0x5d5b('0x49')](_0x421f8a);}})[_0x5d5b('0x1f')](function(_0x1feb2f){if(_0x1feb2f){_0x5bd7fe=_0x1feb2f[_0x5d5b('0x31')];if(!_0x577312['query'][_0x5d5b('0x32')](_0x5d5b('0x33'))){_0x421f8a[_0x5d5b('0x18')]=qs['limit'](_0x577312['query'][_0x5d5b('0x18')]);_0x421f8a[_0x5d5b('0x16')]=qs[_0x5d5b('0x16')](_0x577312[_0x5d5b('0x2c')]['offset']);}return _0x4cc36e[_0x5d5b('0x49')](_0x421f8a);}})[_0x5d5b('0x1f')](function(_0x4c3635){if(_0x4c3635){return _0x4c3635?{'count':_0x5bd7fe,'rows':_0x4c3635}:null;}})['then'](respondWithResult(_0x40bf0d,null))[_0x5d5b('0x40')](handleError(_0x40bf0d,null));};exports[_0x5d5b('0x4c')]=function(_0x46d05b,_0x11faf6,_0x56b6d9){if(_0x46d05b[_0x5d5b('0x48')]['id']){delete _0x46d05b['body']['id'];}return db[_0x5d5b('0x27')][_0x5d5b('0x4a')]({'where':{'id':_0x46d05b[_0x5d5b('0x42')]['id']}})[_0x5d5b('0x1f')](handleEntityNotFound(_0x11faf6,null))[_0x5d5b('0x1f')](function(_0x3f81b){if(_0x3f81b){_0x46d05b[_0x5d5b('0x48')][_0x5d5b('0x4d')]=_0x3f81b['id'];_0x46d05b[_0x5d5b('0x48')][_0x5d5b('0x4e')]=integrations[_0x5d5b('0x4f')](_0x46d05b['body'][_0x5d5b('0x50')],_0x46d05b[_0x5d5b('0x48')]['type']);_0x46d05b['body'][_0x5d5b('0x51')]=integrations['getDescriptions'](_0x46d05b['body']['channel'],_0x46d05b[_0x5d5b('0x48')][_0x5d5b('0x3a')]);return db[_0x5d5b('0x4b')][_0x5d5b('0x46')](_0x46d05b[_0x5d5b('0x48')],{'include':[{'model':db[_0x5d5b('0x52')],'as':_0x5d5b('0x4e')},{'model':db[_0x5d5b('0x52')],'as':_0x5d5b('0x51')}]});}return null;})[_0x5d5b('0x1f')](respondWithResult(_0x11faf6,null))['catch'](handleError(_0x11faf6,null));};exports[_0x5d5b('0x53')]=function(_0x9dec1d,_0x697dfc,_0x31e264){var _0x3a06df='';var _0x162477=['id',_0x5d5b('0x24'),_0x5d5b('0x54'),_0x5d5b('0x55'),_0x5d5b('0x56'),_0x5d5b('0x57'),'duration_hours','duration_minutes',_0x5d5b('0x58'),_0x5d5b('0x59'),'parent_name',_0x5d5b('0x5a')];return db[_0x5d5b('0x27')][_0x5d5b('0x4a')]({'where':{'id':_0x9dec1d[_0x5d5b('0x42')]['id']},'attributes':['id','username',_0x5d5b('0x5b'),_0x5d5b('0x5c')]})[_0x5d5b('0x1f')](handleEntityNotFound(_0x697dfc,null))[_0x5d5b('0x1f')](function(_0x559376){if(_0x559376){_0x3a06df=_0x559376[_0x5d5b('0x5c')];var _0x425f6f=_0x3a06df[_0x5d5b('0x5d')](-0x1);if(_0x425f6f==='/'){_0x3a06df=_0x3a06df[_0x5d5b('0x5e')](0x0,_0x3a06df[_0x5d5b('0x5f')](_0x425f6f));}return rp({'method':_0x5d5b('0x60'),'uri':util[_0x5d5b('0x61')]('%s%s',_0x3a06df,_0x5d5b('0x62')),'json':!![],'form':{'method':'login','input_type':_0x5d5b('0x63'),'response_type':_0x5d5b('0x63'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x559376[_0x5d5b('0x64')],'password':_0x559376['password'],'encryption':_0x5d5b('0x65')},'application':_0x5d5b('0x66')})}});}})[_0x5d5b('0x1f')](function(_0x17d8ac){if(_0x17d8ac&&_0x17d8ac[_0x5d5b('0x24')]!=='Invalid\x20Login'&&_0x17d8ac[_0x5d5b('0x24')]!==_0x5d5b('0x67')){return rp({'method':_0x5d5b('0x60'),'uri':util[_0x5d5b('0x61')](_0x5d5b('0x68'),_0x3a06df,_0x5d5b('0x62')),'json':!![],'form':{'method':_0x5d5b('0x69'),'input_type':_0x5d5b('0x63'),'response_type':_0x5d5b('0x63'),'rest_data':JSON['stringify']({'session':_0x17d8ac['id'],'module_name':'Calls'})}})[_0x5d5b('0x1f')](function(_0x448b99){if(_0x448b99){var _0x4b61cf=_[_0x5d5b('0x6a')](_0x448b99['module_fields']);_['remove'](_0x4b61cf,function(_0x4aeaa9){return _0x162477['includes'](_0x4aeaa9[_0x5d5b('0x24')]);});return{'count':_0x4b61cf['length'],'rows':_[_0x5d5b('0x26')](_0x4b61cf,function(_0x1f6f2c){return{'id':_0x1f6f2c['name'],'name':_0x1f6f2c['label'],'custom':_[_0x5d5b('0x6b')](_0x1f6f2c[_0x5d5b('0x24')],'_c')?!![]:![],'options':_0x1f6f2c[_0x5d5b('0x3c')]?_[_0x5d5b('0x26')](_[_0x5d5b('0x6a')](_0x1f6f2c[_0x5d5b('0x3c')]),function(_0x2b965a){return{'name':_0x2b965a[_0x5d5b('0x6c')],'value':_0x2b965a[_0x5d5b('0x24')]};}):[]};})};}})[_0x5d5b('0x1f')](respondWithResult(_0x697dfc,null))[_0x5d5b('0x40')](function(_0x2e3488){var _0x2271e8=_0x9dec1d[_0x5d5b('0x2c')][_0x5d5b('0x6d')]?0x1f4:_0x2e3488[_0x5d5b('0x6e')]||0x1f4;logger[_0x5d5b('0x22')](_0x5d5b('0x6f'),'getFields',_0x2271e8,JSON['stringify'](_0x2e3488));delete _0x2e3488[_0x5d5b('0x24')];if(_0x2271e8===0x191){_0x2271e8=0x190;}_0x697dfc[_0x5d5b('0x15')](_0x2271e8)[_0x5d5b('0x70')](_0x9dec1d['query'][_0x5d5b('0x6d')]?{'message':_0x5d5b('0x71'),'statusCode':_0x2e3488[_0x5d5b('0x6e')]}:_0x2e3488);});}else{var _0x1f625e=0x1f4;_0x697dfc['status'](_0x1f625e)['send']({'message':_0x5d5b('0x71'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6d6e=['options','includeAll','include','findAll','catch','show','params','filters','length','create','body','find','destroy','getConfigurations','findOne','rawAttributes','sort','filter','Subjects','getSubjects','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','assigned_user_id','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','values','module_fields','remove','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','update','then','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','query','keys','model','attributes','intersection','fields','nolimit','where','pick','merge','VIRTUAL'];(function(_0x4b4b4e,_0x341f0c){var _0xf1a943=function(_0x36fb59){while(--_0x36fb59){_0x4b4b4e['push'](_0x4b4b4e['shift']());}};_0xf1a943(++_0x341f0c);}(_0x6d6e,0xab));var _0xe6d6=function(_0x5e1a37,_0x573161){_0x5e1a37=_0x5e1a37-0x0;var _0x448e94=_0x6d6e[_0x5e1a37];return _0x448e94;};'use strict';var emlformat=require(_0xe6d6('0x0'));var rimraf=require(_0xe6d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6d6('0x2'));var rp=require(_0xe6d6('0x3'));var moment=require(_0xe6d6('0x4'));var BPromise=require(_0xe6d6('0x5'));var Mustache=require('mustache');var util=require(_0xe6d6('0x6'));var path=require('path');var sox=require(_0xe6d6('0x7'));var csv=require(_0xe6d6('0x8'));var ejs=require(_0xe6d6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6d6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6d6('0xb'));var toCsv=require(_0xe6d6('0x8'));var querystring=require(_0xe6d6('0xc'));var Papa=require('papaparse');var Redis=require(_0xe6d6('0xd'));var authService=require(_0xe6d6('0xe'));var qs=require(_0xe6d6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6d6('0x10'));var logger=require('../../config/logger')(_0xe6d6('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe6d6('0x12'));var db=require(_0xe6d6('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5a03fb,_0x4f5aa5){_0x4f5aa5=_0x4f5aa5||0xcc;return function(_0x5041e4){if(_0x5041e4){return _0x5a03fb[_0xe6d6('0x14')](_0x4f5aa5);}return _0x5a03fb['status'](_0x4f5aa5)[_0xe6d6('0x15')]();};}function respondWithResult(_0xc2db45,_0x334d76){_0x334d76=_0x334d76||0xc8;return function(_0x182b06){if(_0x182b06){return _0xc2db45['status'](_0x334d76)[_0xe6d6('0x16')](_0x182b06);}};}function respondWithFilteredResult(_0x23426b,_0x2e0e8b){return function(_0x3f2278){if(_0x3f2278){var _0x59ed26=typeof _0x2e0e8b[_0xe6d6('0x17')]===_0xe6d6('0x18')&&typeof _0x2e0e8b['limit']===_0xe6d6('0x18');var _0x2f8fb2=_0x3f2278['count'];var _0x3210bf=_0x59ed26?0x0:_0x2e0e8b[_0xe6d6('0x17')];var _0x2dd924=_0x59ed26?_0x3f2278[_0xe6d6('0x19')]:_0x2e0e8b[_0xe6d6('0x17')]+_0x2e0e8b[_0xe6d6('0x1a')];var _0x23c51a;if(_0x2dd924>=_0x2f8fb2){_0x2dd924=_0x2f8fb2;_0x23c51a=0xc8;}else{_0x23c51a=0xce;}_0x23426b[_0xe6d6('0x1b')](_0x23c51a);return _0x23426b['set'](_0xe6d6('0x1c'),_0x3210bf+'-'+_0x2dd924+'/'+_0x2f8fb2)['json'](_0x3f2278);}return null;};}function patchUpdates(_0x56e272){return function(_0x2a7161){try{jsonpatch[_0xe6d6('0x1d')](_0x2a7161,_0x56e272,!![]);}catch(_0x2ddd10){return BPromise['reject'](_0x2ddd10);}return _0x2a7161['save']();};}function saveUpdates(_0x1f82b8,_0x503fee){return function(_0x15e7d7){if(_0x15e7d7){return _0x15e7d7[_0xe6d6('0x1e')](_0x1f82b8)[_0xe6d6('0x1f')](function(_0x29b8ba){return _0x29b8ba;});}return null;};}function removeEntity(_0x1cfd90,_0x56c09f){return function(_0x1fd775){if(_0x1fd775){return _0x1fd775['destroy']()[_0xe6d6('0x1f')](function(){_0x1cfd90[_0xe6d6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2689e6,_0xc1e462){return function(_0x3a3530){if(!_0x3a3530){_0x2689e6['sendStatus'](0x194);}return _0x3a3530;};}function handleError(_0x5362f6,_0x5e40c1){_0x5e40c1=_0x5e40c1||0x1f4;return function(_0x4f6d3f){logger[_0xe6d6('0x20')](_0x4f6d3f[_0xe6d6('0x21')]);if(_0x4f6d3f[_0xe6d6('0x22')]){delete _0x4f6d3f['name'];}_0x5362f6['status'](_0x5e40c1)[_0xe6d6('0x23')](_0x4f6d3f);};}exports[_0xe6d6('0x24')]=function(_0x3b6b94,_0x4a498f){var _0x3ced80={},_0x1c3753={},_0x389110={'count':0x0,'rows':[]};var _0x2ad4b4=_[_0xe6d6('0x25')](db[_0xe6d6('0x26')]['rawAttributes'],function(_0x2b9526){return{'name':_0x2b9526[_0xe6d6('0x27')],'type':_0x2b9526[_0xe6d6('0x28')][_0xe6d6('0x29')]};});_0x1c3753['model']=_[_0xe6d6('0x25')](_0x2ad4b4,_0xe6d6('0x22'));_0x1c3753[_0xe6d6('0x2a')]=_[_0xe6d6('0x2b')](_0x3b6b94[_0xe6d6('0x2a')]);_0x1c3753['filters']=_['intersection'](_0x1c3753[_0xe6d6('0x2c')],_0x1c3753[_0xe6d6('0x2a')]);_0x3ced80[_0xe6d6('0x2d')]=_[_0xe6d6('0x2e')](_0x1c3753['model'],qs['fields'](_0x3b6b94['query'][_0xe6d6('0x2f')]));_0x3ced80[_0xe6d6('0x2d')]=_0x3ced80[_0xe6d6('0x2d')]['length']?_0x3ced80[_0xe6d6('0x2d')]:_0x1c3753['model'];if(!_0x3b6b94[_0xe6d6('0x2a')]['hasOwnProperty'](_0xe6d6('0x30'))){_0x3ced80['limit']=qs['limit'](_0x3b6b94[_0xe6d6('0x2a')][_0xe6d6('0x1a')]);_0x3ced80['offset']=qs[_0xe6d6('0x17')](_0x3b6b94['query'][_0xe6d6('0x17')]);}_0x3ced80['order']=qs['sort'](_0x3b6b94[_0xe6d6('0x2a')]['sort']);_0x3ced80[_0xe6d6('0x31')]=qs['filters'](_[_0xe6d6('0x32')](_0x3b6b94[_0xe6d6('0x2a')],_0x1c3753['filters']),_0x2ad4b4);if(_0x3b6b94[_0xe6d6('0x2a')]['filter']){_0x3ced80['where']=_[_0xe6d6('0x33')](_0x3ced80['where'],{'$or':_[_0xe6d6('0x25')](_0x2ad4b4,function(_0x453a19){if(_0x453a19[_0xe6d6('0x28')]!==_0xe6d6('0x34')){var _0x44803e={};_0x44803e[_0x453a19['name']]={'$like':'%'+_0x3b6b94['query']['filter']+'%'};return _0x44803e;}})});}_0x3ced80=_[_0xe6d6('0x33')]({},_0x3ced80,_0x3b6b94[_0xe6d6('0x35')]);var _0x479b2a={'where':_0x3ced80[_0xe6d6('0x31')]};return db['SugarcrmAccount'][_0xe6d6('0x19')](_0x479b2a)[_0xe6d6('0x1f')](function(_0x160874){_0x389110[_0xe6d6('0x19')]=_0x160874;if(_0x3b6b94[_0xe6d6('0x2a')][_0xe6d6('0x36')]){_0x3ced80[_0xe6d6('0x37')]=[{'all':!![]}];}return db[_0xe6d6('0x26')][_0xe6d6('0x38')](_0x3ced80);})[_0xe6d6('0x1f')](function(_0x76b89){_0x389110['rows']=_0x76b89;return _0x389110;})['then'](respondWithFilteredResult(_0x4a498f,_0x3ced80))[_0xe6d6('0x39')](handleError(_0x4a498f,null));};exports[_0xe6d6('0x3a')]=function(_0x5e2d81,_0x756d20){var _0x4e4766={'raw':![],'where':{'id':_0x5e2d81[_0xe6d6('0x3b')]['id']}},_0xa50da9={};_0xa50da9['model']=_[_0xe6d6('0x2b')](db[_0xe6d6('0x26')]['rawAttributes']);_0xa50da9[_0xe6d6('0x2a')]=_[_0xe6d6('0x2b')](_0x5e2d81[_0xe6d6('0x2a')]);_0xa50da9[_0xe6d6('0x3c')]=_[_0xe6d6('0x2e')](_0xa50da9[_0xe6d6('0x2c')],_0xa50da9[_0xe6d6('0x2a')]);_0x4e4766['attributes']=_['intersection'](_0xa50da9[_0xe6d6('0x2c')],qs[_0xe6d6('0x2f')](_0x5e2d81[_0xe6d6('0x2a')]['fields']));_0x4e4766[_0xe6d6('0x2d')]=_0x4e4766[_0xe6d6('0x2d')][_0xe6d6('0x3d')]?_0x4e4766[_0xe6d6('0x2d')]:_0xa50da9['model'];if(_0x5e2d81[_0xe6d6('0x2a')]['includeAll']){_0x4e4766[_0xe6d6('0x37')]=[{'all':!![]}];}_0x4e4766=_[_0xe6d6('0x33')]({},_0x4e4766,_0x5e2d81[_0xe6d6('0x35')]);return db[_0xe6d6('0x26')]['find'](_0x4e4766)[_0xe6d6('0x1f')](handleEntityNotFound(_0x756d20,null))[_0xe6d6('0x1f')](respondWithResult(_0x756d20,null))[_0xe6d6('0x39')](handleError(_0x756d20,null));};exports[_0xe6d6('0x3e')]=function(_0x47d354,_0x1d4ffc){return db[_0xe6d6('0x26')][_0xe6d6('0x3e')](_0x47d354[_0xe6d6('0x3f')],{})['then'](respondWithResult(_0x1d4ffc,0xc9))[_0xe6d6('0x39')](handleError(_0x1d4ffc,null));};exports[_0xe6d6('0x1e')]=function(_0x3c1cca,_0x22f65c){if(_0x3c1cca[_0xe6d6('0x3f')]['id']){delete _0x3c1cca[_0xe6d6('0x3f')]['id'];}return db[_0xe6d6('0x26')][_0xe6d6('0x40')]({'where':{'id':_0x3c1cca[_0xe6d6('0x3b')]['id']}})['then'](handleEntityNotFound(_0x22f65c,null))[_0xe6d6('0x1f')](saveUpdates(_0x3c1cca['body'],null))['then'](respondWithResult(_0x22f65c,null))[_0xe6d6('0x39')](handleError(_0x22f65c,null));};exports[_0xe6d6('0x41')]=function(_0x57e72d,_0x1dabba){return db[_0xe6d6('0x26')][_0xe6d6('0x40')]({'where':{'id':_0x57e72d[_0xe6d6('0x3b')]['id']}})[_0xe6d6('0x1f')](handleEntityNotFound(_0x1dabba,null))[_0xe6d6('0x1f')](removeEntity(_0x1dabba,null))[_0xe6d6('0x39')](handleError(_0x1dabba,null));};exports[_0xe6d6('0x42')]=function(_0x397547,_0x4b0a33,_0x1f6391){var _0x5c27eb={};var _0xd739be={};var _0x54d69c;var _0x368227;return db[_0xe6d6('0x26')][_0xe6d6('0x43')]({'where':{'id':_0x397547[_0xe6d6('0x3b')]['id']}})[_0xe6d6('0x1f')](handleEntityNotFound(_0x4b0a33,null))[_0xe6d6('0x1f')](function(_0xcee53b){if(_0xcee53b){_0x54d69c=_0xcee53b;_0xd739be[_0xe6d6('0x2c')]=_[_0xe6d6('0x2b')](db['SugarcrmConfiguration'][_0xe6d6('0x44')]);_0xd739be[_0xe6d6('0x2a')]=_[_0xe6d6('0x2b')](_0x397547[_0xe6d6('0x2a')]);_0xd739be[_0xe6d6('0x3c')]=_['intersection'](_0xd739be[_0xe6d6('0x2c')],_0xd739be[_0xe6d6('0x2a')]);_0x5c27eb[_0xe6d6('0x2d')]=_[_0xe6d6('0x2e')](_0xd739be['model'],qs[_0xe6d6('0x2f')](_0x397547[_0xe6d6('0x2a')][_0xe6d6('0x2f')]));_0x5c27eb[_0xe6d6('0x2d')]=_0x5c27eb[_0xe6d6('0x2d')][_0xe6d6('0x3d')]?_0x5c27eb[_0xe6d6('0x2d')]:_0xd739be['model'];_0x5c27eb['order']=qs[_0xe6d6('0x45')](_0x397547[_0xe6d6('0x2a')][_0xe6d6('0x45')]);_0x5c27eb[_0xe6d6('0x31')]=qs[_0xe6d6('0x3c')](_[_0xe6d6('0x32')](_0x397547['query'],_0xd739be['filters']));if(_0x397547[_0xe6d6('0x2a')][_0xe6d6('0x46')]){_0x5c27eb[_0xe6d6('0x31')]=_['merge'](_0x5c27eb[_0xe6d6('0x31')],{'$or':_[_0xe6d6('0x25')](_0x5c27eb[_0xe6d6('0x2d')],function(_0x4f21c0){var _0x4b464d={};_0x4b464d[_0x4f21c0]={'$like':'%'+_0x397547[_0xe6d6('0x2a')][_0xe6d6('0x46')]+'%'};return _0x4b464d;})});}_0x5c27eb=_[_0xe6d6('0x33')]({},_0x5c27eb,_0x397547[_0xe6d6('0x35')]);return _0x54d69c[_0xe6d6('0x42')](_0x5c27eb);}})[_0xe6d6('0x1f')](function(_0x56adac){if(_0x56adac){_0x368227=_0x56adac['length'];if(!_0x397547[_0xe6d6('0x2a')]['hasOwnProperty']('nolimit')){_0x5c27eb[_0xe6d6('0x1a')]=qs[_0xe6d6('0x1a')](_0x397547['query'][_0xe6d6('0x1a')]);_0x5c27eb[_0xe6d6('0x17')]=qs[_0xe6d6('0x17')](_0x397547['query'][_0xe6d6('0x17')]);}return _0x54d69c[_0xe6d6('0x42')](_0x5c27eb);}})[_0xe6d6('0x1f')](function(_0x258c56){if(_0x258c56){return _0x258c56?{'count':_0x368227,'rows':_0x258c56}:null;}})[_0xe6d6('0x1f')](respondWithResult(_0x4b0a33,null))[_0xe6d6('0x39')](handleError(_0x4b0a33,null));};exports['addConfiguration']=function(_0x3d4eef,_0x298af1,_0x124023){if(_0x3d4eef['body']['id']){delete _0x3d4eef['body']['id'];}return db[_0xe6d6('0x26')][_0xe6d6('0x43')]({'where':{'id':_0x3d4eef['params']['id']}})['then'](handleEntityNotFound(_0x298af1,null))[_0xe6d6('0x1f')](function(_0x34dc93){if(_0x34dc93){_0x3d4eef[_0xe6d6('0x3f')]['AccountId']=_0x34dc93['id'];_0x3d4eef[_0xe6d6('0x3f')][_0xe6d6('0x47')]=integrations[_0xe6d6('0x48')](_0x3d4eef[_0xe6d6('0x3f')]['channel'],_0x3d4eef[_0xe6d6('0x3f')][_0xe6d6('0x28')]);_0x3d4eef[_0xe6d6('0x3f')][_0xe6d6('0x49')]=integrations[_0xe6d6('0x4a')](_0x3d4eef[_0xe6d6('0x3f')]['channel'],_0x3d4eef[_0xe6d6('0x3f')][_0xe6d6('0x28')]);return db[_0xe6d6('0x4b')][_0xe6d6('0x3e')](_0x3d4eef[_0xe6d6('0x3f')],{'include':[{'model':db[_0xe6d6('0x4c')],'as':'Subjects'},{'model':db[_0xe6d6('0x4c')],'as':_0xe6d6('0x49')}]});}return null;})[_0xe6d6('0x1f')](respondWithResult(_0x298af1,null))[_0xe6d6('0x39')](handleError(_0x298af1,null));};exports['getFields']=function(_0x112ba6,_0x49ffe5,_0x11c757){var _0xa021a0='';var _0x4b3c71=['id','name',_0xe6d6('0x4d'),'created_by',_0xe6d6('0x4e'),_0xe6d6('0x4f'),'duration_hours',_0xe6d6('0x50'),_0xe6d6('0x51'),_0xe6d6('0x52'),_0xe6d6('0x53'),_0xe6d6('0x54')];return db[_0xe6d6('0x26')][_0xe6d6('0x43')]({'where':{'id':_0x112ba6[_0xe6d6('0x3b')]['id']},'attributes':['id',_0xe6d6('0x55'),_0xe6d6('0x56'),_0xe6d6('0x57')]})[_0xe6d6('0x1f')](handleEntityNotFound(_0x49ffe5,null))[_0xe6d6('0x1f')](function(_0x5c5e5a){if(_0x5c5e5a){_0xa021a0=_0x5c5e5a[_0xe6d6('0x57')];var _0x5b2681=_0xa021a0[_0xe6d6('0x58')](-0x1);if(_0x5b2681==='/'){_0xa021a0=_0xa021a0['substring'](0x0,_0xa021a0[_0xe6d6('0x59')](_0x5b2681));}return rp({'method':_0xe6d6('0x5a'),'uri':util[_0xe6d6('0x5b')](_0xe6d6('0x5c'),_0xa021a0,_0xe6d6('0x5d')),'json':!![],'form':{'method':_0xe6d6('0x5e'),'input_type':_0xe6d6('0x5f'),'response_type':_0xe6d6('0x5f'),'rest_data':JSON[_0xe6d6('0x60')]({'user_auth':{'user_name':_0x5c5e5a[_0xe6d6('0x55')],'password':_0x5c5e5a['password'],'encryption':_0xe6d6('0x61')},'application':_0xe6d6('0x62')})}});}})['then'](function(_0x39ea74){if(_0x39ea74&&_0x39ea74[_0xe6d6('0x22')]!==_0xe6d6('0x63')&&_0x39ea74[_0xe6d6('0x22')]!==_0xe6d6('0x64')){return rp({'method':_0xe6d6('0x5a'),'uri':util[_0xe6d6('0x5b')](_0xe6d6('0x5c'),_0xa021a0,_0xe6d6('0x5d')),'json':!![],'form':{'method':_0xe6d6('0x65'),'input_type':_0xe6d6('0x5f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x39ea74['id'],'module_name':'Calls'})}})[_0xe6d6('0x1f')](function(_0x37123a){if(_0x37123a){var _0x84075c=_[_0xe6d6('0x66')](_0x37123a[_0xe6d6('0x67')]);_[_0xe6d6('0x68')](_0x84075c,function(_0x32ecfc){return _0x4b3c71[_0xe6d6('0x69')](_0x32ecfc[_0xe6d6('0x22')]);});return{'count':_0x84075c[_0xe6d6('0x3d')],'rows':_['map'](_0x84075c,function(_0x5afb6d){return{'id':_0x5afb6d['name'],'name':_0x5afb6d[_0xe6d6('0x6a')],'custom':_[_0xe6d6('0x6b')](_0x5afb6d[_0xe6d6('0x22')],'_c')?!![]:![],'options':_0x5afb6d[_0xe6d6('0x35')]?_['map'](_['values'](_0x5afb6d[_0xe6d6('0x35')]),function(_0x511207){return{'name':_0x511207['value'],'value':_0x511207['name']};}):[]};})};}})[_0xe6d6('0x1f')](respondWithResult(_0x49ffe5,null))[_0xe6d6('0x39')](function(_0x2e2fb0){var _0x2b9792=_0x112ba6[_0xe6d6('0x2a')][_0xe6d6('0x6c')]?0x1f4:_0x2e2fb0[_0xe6d6('0x6d')]||0x1f4;logger[_0xe6d6('0x20')](_0xe6d6('0x6e'),_0xe6d6('0x6f'),_0x2b9792,JSON[_0xe6d6('0x60')](_0x2e2fb0));delete _0x2e2fb0[_0xe6d6('0x22')];if(_0x2b9792===0x191){_0x2b9792=0x190;}_0x49ffe5['status'](_0x2b9792)['send'](_0x112ba6[_0xe6d6('0x2a')][_0xe6d6('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x2e2fb0[_0xe6d6('0x6d')]}:_0x2e2fb0);});}else{var _0x3ed398=0x1f4;_0x49ffe5[_0xe6d6('0x1b')](_0x3ed398)['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 0dd4fe5..5dc627a 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 _0xa44c=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1c573f,_0x4db6ea){var _0x3fadc5=function(_0x40b370){while(--_0x40b370){_0x1c573f['push'](_0x1c573f['shift']());}};_0x3fadc5(++_0x4db6ea);}(_0xa44c,0x18d));var _0xca44=function(_0x217154,_0x30a6c6){_0x217154=_0x217154-0x0;var _0x33f10e=_0xa44c[_0x217154];return _0x33f10e;};'use strict';var _=require(_0xca44('0x0'));var util=require(_0xca44('0x1'));var logger=require(_0xca44('0x2'))(_0xca44('0x3'));var moment=require(_0xca44('0x4'));var BPromise=require('bluebird');var rp=require(_0xca44('0x5'));var fs=require('fs');var path=require(_0xca44('0x6'));var rimraf=require(_0xca44('0x7'));var config=require(_0xca44('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xca44('0x9'));module[_0xca44('0xa')]=function(_0x1e49af,_0x5e645a){return _0x1e49af[_0xca44('0xb')](_0xca44('0xc'),attributes,{'tableName':_0xca44('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3bb=['define','SugarcrmAccount','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3ad058,_0x1ad3bb){var _0x152bf4=function(_0x533c66){while(--_0x533c66){_0x3ad058['push'](_0x3ad058['shift']());}};_0x152bf4(++_0x1ad3bb);}(_0xa3bb,0xd2));var _0xba3b=function(_0x4e22e0,_0x1d6a34){_0x4e22e0=_0x4e22e0-0x0;var _0xbf70e2=_0xa3bb[_0x4e22e0];return _0xbf70e2;};'use strict';var _=require(_0xba3b('0x0'));var util=require(_0xba3b('0x1'));var logger=require('../../config/logger')(_0xba3b('0x2'));var moment=require(_0xba3b('0x3'));var BPromise=require(_0xba3b('0x4'));var rp=require(_0xba3b('0x5'));var fs=require('fs');var path=require(_0xba3b('0x6'));var rimraf=require('rimraf');var config=require(_0xba3b('0x7'));var attributes=require(_0xba3b('0x8'));var integrations=require(_0xba3b('0x9'));module[_0xba3b('0xa')]=function(_0x371869,_0x65ee44){return _0x371869[_0xba3b('0xb')](_0xba3b('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','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 0679a6b..a5d6f79 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 _0xd65c=['model','ShowSugarcrmAccount','find','then','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x452c39,_0x46018d){var _0x3fcd39=function(_0x423fb5){while(--_0x423fb5){_0x452c39['push'](_0x452c39['shift']());}};_0x3fcd39(++_0x46018d);}(_0xd65c,0x90));var _0xcd65=function(_0x31dcf7,_0x49b951){_0x31dcf7=_0x31dcf7-0x0;var _0x65837f=_0xd65c[_0x31dcf7];return _0x65837f;};'use strict';var _=require(_0xcd65('0x0'));var util=require(_0xcd65('0x1'));var moment=require(_0xcd65('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd65('0x3'));var db=require(_0xcd65('0x4'))['db'];var utils=require(_0xcd65('0x5'));var logger=require('../../config/logger')(_0xcd65('0x6'));var config=require(_0xcd65('0x7'));var jayson=require(_0xcd65('0x8'));var client=jayson[_0xcd65('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf08cf,_0x21ac7e,_0x35e0a4){return new BPromise(function(_0xb4613a,_0x44dade){return client['request'](_0xf08cf,_0x35e0a4)['then'](function(_0xef37f4){logger[_0xcd65('0xa')](_0xcd65('0xb'),_0x21ac7e,'request\x20sent');logger[_0xcd65('0xc')](_0xcd65('0xd'),_0x21ac7e,_0xcd65('0xe'),JSON[_0xcd65('0xf')](_0xef37f4));if(_0xef37f4[_0xcd65('0x10')]){if(_0xef37f4[_0xcd65('0x10')][_0xcd65('0x11')]===0x1f4){logger[_0xcd65('0x10')](_0xcd65('0xb'),_0x21ac7e,_0xef37f4[_0xcd65('0x10')][_0xcd65('0x12')]);return _0x44dade(_0xef37f4[_0xcd65('0x10')]['message']);}logger[_0xcd65('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x21ac7e,_0xef37f4[_0xcd65('0x10')][_0xcd65('0x12')]);return _0xb4613a(_0xef37f4[_0xcd65('0x10')][_0xcd65('0x12')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x21ac7e,_0xcd65('0xe'));_0xb4613a(_0xef37f4[_0xcd65('0x13')][_0xcd65('0x12')]);}})[_0xcd65('0x14')](function(_0x1178b0){logger[_0xcd65('0x10')](_0xcd65('0xb'),_0x21ac7e,_0x1178b0);_0x44dade(_0x1178b0);});});}exports[_0xcd65('0x15')]=function(_0x4774c7){var _0x174a94=this;return new Promise(function(_0x53b9be,_0x2e22bb){return db[_0xcd65('0x16')][_0xcd65('0x17')]({'raw':_0x4774c7['options']?_0x4774c7[_0xcd65('0x18')][_0xcd65('0x19')]===undefined?!![]:![]:!![],'where':_0x4774c7['options']?_0x4774c7[_0xcd65('0x18')][_0xcd65('0x1a')]||null:null,'attributes':_0x4774c7['options']?_0x4774c7[_0xcd65('0x18')][_0xcd65('0x1b')]||null:null,'limit':_0x4774c7['options']?_0x4774c7['options'][_0xcd65('0x1c')]||null:null,'include':_0x4774c7[_0xcd65('0x18')]?_0x4774c7[_0xcd65('0x18')][_0xcd65('0x1d')]?_[_0xcd65('0x1e')](_0x4774c7['options'][_0xcd65('0x1d')],function(_0x3830c6){return{'model':db[_0x3830c6['model']],'as':_0x3830c6['as'],'attributes':_0x3830c6[_0xcd65('0x1b')],'include':_0x3830c6['include']?_[_0xcd65('0x1e')](_0x3830c6['include'],function(_0x346171){return{'model':db[_0x346171[_0xcd65('0x1f')]],'as':_0x346171['as'],'attributes':_0x346171[_0xcd65('0x1b')],'include':_0x346171['include']?_['map'](_0x346171[_0xcd65('0x1d')],function(_0x2511f1){return{'model':db[_0x2511f1['model']],'as':_0x2511f1['as'],'attributes':_0x2511f1[_0xcd65('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39857c){logger['info'](_0xcd65('0x15'),_0x4774c7);logger['debug'](_0xcd65('0x15'),_0x4774c7,JSON[_0xcd65('0xf')](_0x39857c));_0x53b9be(_0x39857c);})['catch'](function(_0x32fe16){logger[_0xcd65('0x10')]('GetSugarcrmAccount',_0x32fe16[_0xcd65('0x12')],_0x4774c7);_0x2e22bb(_0x174a94['error'](0x1f4,_0x32fe16[_0xcd65('0x12')]));});});};exports[_0xcd65('0x20')]=function(_0x1343e6){var _0x59c72b=this;return new Promise(function(_0x5b1fef,_0x39ea29){return db[_0xcd65('0x16')][_0xcd65('0x21')]({'raw':_0x1343e6['options']?_0x1343e6[_0xcd65('0x18')][_0xcd65('0x19')]===undefined?!![]:![]:!![],'where':_0x1343e6[_0xcd65('0x18')]?_0x1343e6[_0xcd65('0x18')][_0xcd65('0x1a')]||null:null,'attributes':_0x1343e6[_0xcd65('0x18')]?_0x1343e6[_0xcd65('0x18')][_0xcd65('0x1b')]||null:null,'include':_0x1343e6[_0xcd65('0x18')]?_0x1343e6[_0xcd65('0x18')][_0xcd65('0x1d')]?_[_0xcd65('0x1e')](_0x1343e6[_0xcd65('0x18')][_0xcd65('0x1d')],function(_0x49bd9d){return{'model':db[_0x49bd9d[_0xcd65('0x1f')]],'as':_0x49bd9d['as'],'attributes':_0x49bd9d[_0xcd65('0x1b')],'include':_0x49bd9d[_0xcd65('0x1d')]?_[_0xcd65('0x1e')](_0x49bd9d['include'],function(_0x152c15){return{'model':db[_0x152c15[_0xcd65('0x1f')]],'as':_0x152c15['as'],'attributes':_0x152c15[_0xcd65('0x1b')],'include':_0x152c15[_0xcd65('0x1d')]?_['map'](_0x152c15[_0xcd65('0x1d')],function(_0x5eb300){return{'model':db[_0x5eb300[_0xcd65('0x1f')]],'as':_0x5eb300['as'],'attributes':_0x5eb300[_0xcd65('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcd65('0x22')](function(_0x28a625){logger[_0xcd65('0xa')]('ShowSugarcrmAccount',_0x1343e6);logger[_0xcd65('0xc')](_0xcd65('0x20'),_0x1343e6,JSON['stringify'](_0x28a625));_0x5b1fef(_0x28a625);})[_0xcd65('0x14')](function(_0x3d78a4){logger[_0xcd65('0x10')]('ShowSugarcrmAccount',_0x3d78a4[_0xcd65('0x12')],_0x1343e6);_0x39ea29(_0x59c72b[_0xcd65('0x10')](0x1f4,_0x3d78a4[_0xcd65('0x12')]));});});}; \ No newline at end of file +var _0xeabb=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetSugarcrmAccount','findAll','options','raw','attributes','model','map','include','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x1bfa50,_0x571816){var _0x1ec311=function(_0x4c4361){while(--_0x4c4361){_0x1bfa50['push'](_0x1bfa50['shift']());}};_0x1ec311(++_0x571816);}(_0xeabb,0x102));var _0xbeab=function(_0x37e8e8,_0x1be63e){_0x37e8e8=_0x37e8e8-0x0;var _0x2c3c9e=_0xeabb[_0x37e8e8];return _0x2c3c9e;};'use strict';var _=require(_0xbeab('0x0'));var util=require(_0xbeab('0x1'));var moment=require(_0xbeab('0x2'));var BPromise=require(_0xbeab('0x3'));var rs=require(_0xbeab('0x4'));var fs=require('fs');var Redis=require(_0xbeab('0x5'));var db=require(_0xbeab('0x6'))['db'];var utils=require(_0xbeab('0x7'));var logger=require(_0xbeab('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbeab('0x9')][_0xbeab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c7bbc,_0xb2e64,_0x3afb49){return new BPromise(function(_0x8b052b,_0x126ea6){return client['request'](_0x3c7bbc,_0x3afb49)[_0xbeab('0xb')](function(_0x32748e){logger[_0xbeab('0xc')](_0xbeab('0xd'),_0xb2e64,'request\x20sent');logger[_0xbeab('0xe')](_0xbeab('0xf'),_0xb2e64,_0xbeab('0x10'),JSON['stringify'](_0x32748e));if(_0x32748e[_0xbeab('0x11')]){if(_0x32748e['error'][_0xbeab('0x12')]===0x1f4){logger[_0xbeab('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0xb2e64,_0x32748e[_0xbeab('0x11')][_0xbeab('0x13')]);return _0x126ea6(_0x32748e['error'][_0xbeab('0x13')]);}logger[_0xbeab('0x11')](_0xbeab('0xd'),_0xb2e64,_0x32748e[_0xbeab('0x11')][_0xbeab('0x13')]);return _0x8b052b(_0x32748e['error'][_0xbeab('0x13')]);}else{logger['info'](_0xbeab('0xd'),_0xb2e64,_0xbeab('0x10'));_0x8b052b(_0x32748e['result']['message']);}})[_0xbeab('0x14')](function(_0x2a0e26){logger['error'](_0xbeab('0xd'),_0xb2e64,_0x2a0e26);_0x126ea6(_0x2a0e26);});});}exports[_0xbeab('0x15')]=function(_0x59bf75){var _0x1fde9e=this;return new Promise(function(_0x162c8a,_0x534fc6){return db['SugarcrmAccount'][_0xbeab('0x16')]({'raw':_0x59bf75['options']?_0x59bf75[_0xbeab('0x17')][_0xbeab('0x18')]===undefined?!![]:![]:!![],'where':_0x59bf75[_0xbeab('0x17')]?_0x59bf75[_0xbeab('0x17')]['where']||null:null,'attributes':_0x59bf75[_0xbeab('0x17')]?_0x59bf75['options'][_0xbeab('0x19')]||null:null,'limit':_0x59bf75[_0xbeab('0x17')]?_0x59bf75[_0xbeab('0x17')]['limit']||null:null,'include':_0x59bf75['options']?_0x59bf75[_0xbeab('0x17')]['include']?_['map'](_0x59bf75[_0xbeab('0x17')]['include'],function(_0x1d8e24){return{'model':db[_0x1d8e24[_0xbeab('0x1a')]],'as':_0x1d8e24['as'],'attributes':_0x1d8e24[_0xbeab('0x19')],'include':_0x1d8e24['include']?_[_0xbeab('0x1b')](_0x1d8e24[_0xbeab('0x1c')],function(_0x2b0328){return{'model':db[_0x2b0328['model']],'as':_0x2b0328['as'],'attributes':_0x2b0328['attributes'],'include':_0x2b0328[_0xbeab('0x1c')]?_['map'](_0x2b0328[_0xbeab('0x1c')],function(_0x351914){return{'model':db[_0x351914[_0xbeab('0x1a')]],'as':_0x351914['as'],'attributes':_0x351914[_0xbeab('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x121e10){logger['info'](_0xbeab('0x15'),_0x59bf75);logger[_0xbeab('0xe')]('GetSugarcrmAccount',_0x59bf75,JSON[_0xbeab('0x1d')](_0x121e10));_0x162c8a(_0x121e10);})[_0xbeab('0x14')](function(_0x483ef8){logger[_0xbeab('0x11')]('GetSugarcrmAccount',_0x483ef8[_0xbeab('0x13')],_0x59bf75);_0x534fc6(_0x1fde9e[_0xbeab('0x11')](0x1f4,_0x483ef8[_0xbeab('0x13')]));});});};exports[_0xbeab('0x1e')]=function(_0x13f683){var _0x4c6b80=this;return new Promise(function(_0x2b85e6,_0x3cd7ff){return db[_0xbeab('0x1f')][_0xbeab('0x20')]({'raw':_0x13f683[_0xbeab('0x17')]?_0x13f683[_0xbeab('0x17')][_0xbeab('0x18')]===undefined?!![]:![]:!![],'where':_0x13f683[_0xbeab('0x17')]?_0x13f683[_0xbeab('0x17')][_0xbeab('0x21')]||null:null,'attributes':_0x13f683[_0xbeab('0x17')]?_0x13f683[_0xbeab('0x17')][_0xbeab('0x19')]||null:null,'include':_0x13f683['options']?_0x13f683[_0xbeab('0x17')][_0xbeab('0x1c')]?_[_0xbeab('0x1b')](_0x13f683[_0xbeab('0x17')][_0xbeab('0x1c')],function(_0x38d313){return{'model':db[_0x38d313[_0xbeab('0x1a')]],'as':_0x38d313['as'],'attributes':_0x38d313['attributes'],'include':_0x38d313[_0xbeab('0x1c')]?_[_0xbeab('0x1b')](_0x38d313[_0xbeab('0x1c')],function(_0x2758f1){return{'model':db[_0x2758f1[_0xbeab('0x1a')]],'as':_0x2758f1['as'],'attributes':_0x2758f1[_0xbeab('0x19')],'include':_0x2758f1[_0xbeab('0x1c')]?_[_0xbeab('0x1b')](_0x2758f1[_0xbeab('0x1c')],function(_0x130dcb){return{'model':db[_0x130dcb['model']],'as':_0x130dcb['as'],'attributes':_0x130dcb[_0xbeab('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbeab('0xb')](function(_0x39bf25){logger[_0xbeab('0xc')](_0xbeab('0x1e'),_0x13f683);logger[_0xbeab('0xe')](_0xbeab('0x1e'),_0x13f683,JSON['stringify'](_0x39bf25));_0x2b85e6(_0x39bf25);})[_0xbeab('0x14')](function(_0x9be1ee){logger[_0xbeab('0x11')]('ShowSugarcrmAccount',_0x9be1ee[_0xbeab('0x13')],_0x13f683);_0x3cd7ff(_0x4c6b80[_0xbeab('0x11')](0x1f4,_0x9be1ee[_0xbeab('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4773a77..6ed2a0c 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 _0xb4bc=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getSubjects','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4d8684,_0x564d){var _0x276cab=function(_0x5bd0ca){while(--_0x5bd0ca){_0x4d8684['push'](_0x4d8684['shift']());}};_0x276cab(++_0x564d);}(_0xb4bc,0x1ee));var _0xcb4b=function(_0x17d8b2,_0x449a28){_0x17d8b2=_0x17d8b2-0x0;var _0x192eea=_0xb4bc[_0x17d8b2];return _0x192eea;};'use strict';var multer=require(_0xcb4b('0x0'));var util=require(_0xcb4b('0x1'));var path=require(_0xcb4b('0x2'));var timeout=require(_0xcb4b('0x3'));var express=require(_0xcb4b('0x4'));var router=express[_0xcb4b('0x5')]();var fs_extra=require(_0xcb4b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcb4b('0x7'));var config=require(_0xcb4b('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xcb4b('0x9')]('/',auth[_0xcb4b('0xa')](),controller[_0xcb4b('0xb')]);router[_0xcb4b('0x9')](_0xcb4b('0xc'),auth[_0xcb4b('0xa')](),controller['show']);router[_0xcb4b('0x9')](_0xcb4b('0xd'),auth[_0xcb4b('0xa')](),controller['getFields']);router[_0xcb4b('0x9')]('/:id/subjects',auth[_0xcb4b('0xa')](),controller[_0xcb4b('0xe')]);router['get']('/:id/descriptions',auth[_0xcb4b('0xa')](),controller['getDescriptions']);router[_0xcb4b('0xf')]('/',auth[_0xcb4b('0xa')](),controller[_0xcb4b('0x10')]);router['put']('/:id',auth[_0xcb4b('0xa')](),controller['update']);router[_0xcb4b('0x11')](_0xcb4b('0xc'),auth[_0xcb4b('0xa')](),controller[_0xcb4b('0x12')]);module[_0xcb4b('0x13')]=router; \ No newline at end of file +var _0xc103=['create','put','update','delete','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x467a64,_0x3948db){var _0x502714=function(_0x4af2c4){while(--_0x4af2c4){_0x467a64['push'](_0x467a64['shift']());}};_0x502714(++_0x3948db);}(_0xc103,0x78));var _0x3c10=function(_0x34ca2d,_0x1a5a18){_0x34ca2d=_0x34ca2d-0x0;var _0x5f223c=_0xc103[_0x34ca2d];return _0x5f223c;};'use strict';var multer=require(_0x3c10('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3c10('0x1'));var router=express['Router']();var fs_extra=require(_0x3c10('0x2'));var auth=require(_0x3c10('0x3'));var interaction=require(_0x3c10('0x4'));var config=require(_0x3c10('0x5'));var controller=require(_0x3c10('0x6'));router[_0x3c10('0x7')]('/',auth['isAuthenticated'](),controller[_0x3c10('0x8')]);router[_0x3c10('0x7')](_0x3c10('0x9'),auth[_0x3c10('0xa')](),controller[_0x3c10('0xb')]);router[_0x3c10('0x7')](_0x3c10('0xc'),auth[_0x3c10('0xa')](),controller[_0x3c10('0xd')]);router['get']('/:id/subjects',auth[_0x3c10('0xa')](),controller[_0x3c10('0xe')]);router[_0x3c10('0x7')](_0x3c10('0xf'),auth['isAuthenticated'](),controller[_0x3c10('0x10')]);router[_0x3c10('0x11')]('/',auth[_0x3c10('0xa')](),controller[_0x3c10('0x12')]);router[_0x3c10('0x13')]('/:id',auth[_0x3c10('0xa')](),controller[_0x3c10('0x14')]);router[_0x3c10('0x15')](_0x3c10('0x9'),auth[_0x3c10('0xa')](),controller['destroy']);module[_0x3c10('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 05b6ba9..96d7848 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 _0x376d=['STRING','sequelize','exports'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0x376d,0x12a));var _0xd376=function(_0x1713dd,_0x2a59c2){_0x1713dd=_0x1713dd-0x0;var _0x537cb2=_0x376d[_0x1713dd];return _0x537cb2;};'use strict';var Sequelize=require(_0xd376('0x0'));module[_0xd376('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd376('0x2')]}}; \ No newline at end of file +var _0xfd56=['sequelize','exports','STRING'];(function(_0x558ad2,_0x31cbb2){var _0x150a2e=function(_0x4f4e1a){while(--_0x4f4e1a){_0x558ad2['push'](_0x558ad2['shift']());}};_0x150a2e(++_0x31cbb2);}(_0xfd56,0xf6));var _0x6fd5=function(_0x4a39ca,_0x4a8957){_0x4a39ca=_0x4a39ca-0x0;var _0x21f408=_0xfd56[_0x4a39ca];return _0x21f408;};'use strict';var Sequelize=require(_0x6fd5('0x0'));module[_0x6fd5('0x1')]={'name':{'type':Sequelize[_0x6fd5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 929dbad..c10d280 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 _0x76ed=['intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','findAll','rows','catch','params','options','create','body','update','find','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','destroy','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','key','query','keys','filters'];(function(_0x13b07a,_0x49cfc3){var _0xdcbe0=function(_0x45dee2){while(--_0x45dee2){_0x13b07a['push'](_0x13b07a['shift']());}};_0xdcbe0(++_0x49cfc3);}(_0x76ed,0x156));var _0xd76e=function(_0x162c9e,_0x23df18){_0x162c9e=_0x162c9e-0x0;var _0x23b0f5=_0x76ed[_0x162c9e];return _0x23b0f5;};'use strict';var emlformat=require(_0xd76e('0x0'));var rimraf=require(_0xd76e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd76e('0x2'));var rp=require(_0xd76e('0x3'));var moment=require(_0xd76e('0x4'));var BPromise=require(_0xd76e('0x5'));var Mustache=require('mustache');var util=require(_0xd76e('0x6'));var path=require(_0xd76e('0x7'));var sox=require(_0xd76e('0x8'));var csv=require(_0xd76e('0x9'));var ejs=require(_0xd76e('0xa'));var fs=require('fs');var fs_extra=require(_0xd76e('0xb'));var _=require(_0xd76e('0xc'));var squel=require(_0xd76e('0xd'));var crypto=require(_0xd76e('0xe'));var jsforce=require(_0xd76e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd76e('0x9'));var querystring=require(_0xd76e('0x10'));var Papa=require(_0xd76e('0x11'));var Redis=require(_0xd76e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd76e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd76e('0x14'));var logger=require(_0xd76e('0x15'))(_0xd76e('0x16'));var utils=require(_0xd76e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd76e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cf813,_0x653d29){_0x653d29=_0x653d29||0xcc;return function(_0x3e4acc){if(_0x3e4acc){return _0x2cf813[_0xd76e('0x19')](_0x653d29);}return _0x2cf813[_0xd76e('0x1a')](_0x653d29)[_0xd76e('0x1b')]();};}function respondWithResult(_0x587ae9,_0x26674d){_0x26674d=_0x26674d||0xc8;return function(_0x4e114a){if(_0x4e114a){return _0x587ae9[_0xd76e('0x1a')](_0x26674d)[_0xd76e('0x1c')](_0x4e114a);}};}function respondWithFilteredResult(_0x13f008,_0x48d036){return function(_0x9ead7e){if(_0x9ead7e){var _0x24bac4=typeof _0x48d036['offset']===_0xd76e('0x1d')&&typeof _0x48d036[_0xd76e('0x1e')]==='undefined';var _0x45f88e=_0x9ead7e['count'];var _0x1b1051=_0x24bac4?0x0:_0x48d036[_0xd76e('0x1f')];var _0x2ba28a=_0x24bac4?_0x9ead7e[_0xd76e('0x20')]:_0x48d036[_0xd76e('0x1f')]+_0x48d036[_0xd76e('0x1e')];var _0x41f273;if(_0x2ba28a>=_0x45f88e){_0x2ba28a=_0x45f88e;_0x41f273=0xc8;}else{_0x41f273=0xce;}_0x13f008[_0xd76e('0x1a')](_0x41f273);return _0x13f008[_0xd76e('0x21')]('Content-Range',_0x1b1051+'-'+_0x2ba28a+'/'+_0x45f88e)['json'](_0x9ead7e);}return null;};}function patchUpdates(_0x3c6765){return function(_0x47a30a){try{jsonpatch['apply'](_0x47a30a,_0x3c6765,!![]);}catch(_0x537ace){return BPromise[_0xd76e('0x22')](_0x537ace);}return _0x47a30a['save']();};}function saveUpdates(_0x300af0,_0x18840f){return function(_0x112d18){if(_0x112d18){return _0x112d18['update'](_0x300af0)['then'](function(_0x3362bb){return _0x3362bb;});}return null;};}function removeEntity(_0x5a26ff,_0x56a7b5){return function(_0x3aaa56){if(_0x3aaa56){return _0x3aaa56[_0xd76e('0x23')]()['then'](function(){_0x5a26ff[_0xd76e('0x1a')](0xcc)[_0xd76e('0x1b')]();});}};}function handleEntityNotFound(_0x50cabd,_0x5a0641){return function(_0x463c1a){if(!_0x463c1a){_0x50cabd[_0xd76e('0x19')](0x194);}return _0x463c1a;};}function handleError(_0x391840,_0x2f815f){_0x2f815f=_0x2f815f||0x1f4;return function(_0xca94c9){logger[_0xd76e('0x24')](_0xca94c9[_0xd76e('0x25')]);if(_0xca94c9[_0xd76e('0x26')]){delete _0xca94c9['name'];}_0x391840['status'](_0x2f815f)[_0xd76e('0x27')](_0xca94c9);};}exports['index']=function(_0x24c176,_0x4a5d8b){var _0x24dfba={},_0x8cbe8b={},_0x34163a={'count':0x0,'rows':[]};var _0xb2d787=_[_0xd76e('0x28')](db[_0xd76e('0x29')][_0xd76e('0x2a')],function(_0x46c85d){return{'name':_0x46c85d[_0xd76e('0x2b')],'type':_0x46c85d['type'][_0xd76e('0x2c')]};});_0x8cbe8b['model']=_[_0xd76e('0x28')](_0xb2d787,_0xd76e('0x26'));_0x8cbe8b[_0xd76e('0x2d')]=_[_0xd76e('0x2e')](_0x24c176[_0xd76e('0x2d')]);_0x8cbe8b[_0xd76e('0x2f')]=_[_0xd76e('0x30')](_0x8cbe8b[_0xd76e('0x31')],_0x8cbe8b['query']);_0x24dfba[_0xd76e('0x32')]=_[_0xd76e('0x30')](_0x8cbe8b['model'],qs[_0xd76e('0x33')](_0x24c176[_0xd76e('0x2d')]['fields']));_0x24dfba[_0xd76e('0x32')]=_0x24dfba[_0xd76e('0x32')][_0xd76e('0x34')]?_0x24dfba['attributes']:_0x8cbe8b[_0xd76e('0x31')];if(!_0x24c176[_0xd76e('0x2d')]['hasOwnProperty'](_0xd76e('0x35'))){_0x24dfba[_0xd76e('0x1e')]=qs[_0xd76e('0x1e')](_0x24c176[_0xd76e('0x2d')][_0xd76e('0x1e')]);_0x24dfba[_0xd76e('0x1f')]=qs[_0xd76e('0x1f')](_0x24c176[_0xd76e('0x2d')][_0xd76e('0x1f')]);}_0x24dfba[_0xd76e('0x36')]=qs[_0xd76e('0x37')](_0x24c176['query'][_0xd76e('0x37')]);_0x24dfba[_0xd76e('0x38')]=qs[_0xd76e('0x2f')](_[_0xd76e('0x39')](_0x24c176[_0xd76e('0x2d')],_0x8cbe8b[_0xd76e('0x2f')]),_0xb2d787);if(_0x24c176['query'][_0xd76e('0x3a')]){_0x24dfba['where']=_[_0xd76e('0x3b')](_0x24dfba['where'],{'$or':_[_0xd76e('0x28')](_0xb2d787,function(_0x109b90){if(_0x109b90['type']!==_0xd76e('0x3c')){var _0x19d5dd={};_0x19d5dd[_0x109b90[_0xd76e('0x26')]]={'$like':'%'+_0x24c176[_0xd76e('0x2d')]['filter']+'%'};return _0x19d5dd;}})});}_0x24dfba=_[_0xd76e('0x3b')]({},_0x24dfba,_0x24c176['options']);var _0x24f2a0={'where':_0x24dfba['where']};return db['SugarcrmConfiguration'][_0xd76e('0x20')](_0x24f2a0)[_0xd76e('0x3d')](function(_0x49f36b){_0x34163a[_0xd76e('0x20')]=_0x49f36b;if(_0x24c176[_0xd76e('0x2d')][_0xd76e('0x3e')]){_0x24dfba['include']=[{'all':!![]}];}return db[_0xd76e('0x29')][_0xd76e('0x3f')](_0x24dfba);})[_0xd76e('0x3d')](function(_0xffc761){_0x34163a[_0xd76e('0x40')]=_0xffc761;return _0x34163a;})[_0xd76e('0x3d')](respondWithFilteredResult(_0x4a5d8b,_0x24dfba))[_0xd76e('0x41')](handleError(_0x4a5d8b,null));};exports['show']=function(_0x16b280,_0x2a73df){var _0x2f050c={'raw':![],'where':{'id':_0x16b280[_0xd76e('0x42')]['id']}},_0x111538={};_0x111538[_0xd76e('0x31')]=_[_0xd76e('0x2e')](db[_0xd76e('0x29')]['rawAttributes']);_0x111538['query']=_[_0xd76e('0x2e')](_0x16b280[_0xd76e('0x2d')]);_0x111538[_0xd76e('0x2f')]=_[_0xd76e('0x30')](_0x111538[_0xd76e('0x31')],_0x111538[_0xd76e('0x2d')]);_0x2f050c[_0xd76e('0x32')]=_['intersection'](_0x111538[_0xd76e('0x31')],qs['fields'](_0x16b280[_0xd76e('0x2d')][_0xd76e('0x33')]));_0x2f050c['attributes']=_0x2f050c['attributes'][_0xd76e('0x34')]?_0x2f050c['attributes']:_0x111538[_0xd76e('0x31')];if(_0x16b280['query'][_0xd76e('0x3e')]){_0x2f050c['include']=[{'all':!![]}];}_0x2f050c=_[_0xd76e('0x3b')]({},_0x2f050c,_0x16b280[_0xd76e('0x43')]);return db['SugarcrmConfiguration']['find'](_0x2f050c)[_0xd76e('0x3d')](handleEntityNotFound(_0x2a73df,null))[_0xd76e('0x3d')](respondWithResult(_0x2a73df,null))[_0xd76e('0x41')](handleError(_0x2a73df,null));};exports[_0xd76e('0x44')]=function(_0x5ebb13,_0x3fc4ff){return db['SugarcrmConfiguration'][_0xd76e('0x44')](_0x5ebb13[_0xd76e('0x45')],{})['then'](respondWithResult(_0x3fc4ff,0xc9))[_0xd76e('0x41')](handleError(_0x3fc4ff,null));};exports[_0xd76e('0x46')]=function(_0x2eba62,_0x3266d9){if(_0x2eba62[_0xd76e('0x45')]['id']){delete _0x2eba62[_0xd76e('0x45')]['id'];}return db[_0xd76e('0x29')]['find']({'where':{'id':_0x2eba62['params']['id']}})['then'](handleEntityNotFound(_0x3266d9,null))['then'](saveUpdates(_0x2eba62[_0xd76e('0x45')],null))['then'](respondWithResult(_0x3266d9,null))[_0xd76e('0x41')](handleError(_0x3266d9,null));};exports[_0xd76e('0x23')]=function(_0x1a3baf,_0x5d72f6){return db[_0xd76e('0x29')][_0xd76e('0x47')]({'where':{'id':_0x1a3baf[_0xd76e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d72f6,null))[_0xd76e('0x3d')](removeEntity(_0x5d72f6,null))['catch'](handleError(_0x5d72f6,null));};exports[_0xd76e('0x48')]=function(_0x36e023,_0x22ac15,_0x4d5333){var _0x248345={};var _0xddc3c4={};var _0x1df3d0;var _0x2df60b;return db[_0xd76e('0x29')][_0xd76e('0x49')]({'where':{'id':_0x36e023[_0xd76e('0x42')]['id']}})['then'](handleEntityNotFound(_0x22ac15,null))['then'](function(_0x36af38){if(_0x36af38){_0x1df3d0=_0x36af38;_0xddc3c4[_0xd76e('0x31')]=_[_0xd76e('0x2e')](db[_0xd76e('0x4a')][_0xd76e('0x2a')]);_0xddc3c4[_0xd76e('0x2d')]=_[_0xd76e('0x2e')](_0x36e023['query']);_0xddc3c4[_0xd76e('0x2f')]=_[_0xd76e('0x30')](_0xddc3c4[_0xd76e('0x31')],_0xddc3c4[_0xd76e('0x2d')]);_0x248345['attributes']=_['intersection'](_0xddc3c4['model'],qs[_0xd76e('0x33')](_0x36e023[_0xd76e('0x2d')][_0xd76e('0x33')]));_0x248345[_0xd76e('0x32')]=_0x248345['attributes'][_0xd76e('0x34')]?_0x248345['attributes']:_0xddc3c4[_0xd76e('0x31')];_0x248345[_0xd76e('0x36')]=qs[_0xd76e('0x37')](_0x36e023[_0xd76e('0x2d')][_0xd76e('0x37')]);_0x248345['where']=qs[_0xd76e('0x2f')](_[_0xd76e('0x39')](_0x36e023[_0xd76e('0x2d')],_0xddc3c4['filters']));if(_0x36e023[_0xd76e('0x2d')][_0xd76e('0x3a')]){_0x248345[_0xd76e('0x38')]=_['merge'](_0x248345['where'],{'$or':_[_0xd76e('0x28')](_0x248345[_0xd76e('0x32')],function(_0x2050b1){var _0x456c67={};_0x456c67[_0x2050b1]={'$like':'%'+_0x36e023[_0xd76e('0x2d')][_0xd76e('0x3a')]+'%'};return _0x456c67;})});}_0x248345=_['merge']({},_0x248345,_0x36e023[_0xd76e('0x43')]);return _0x1df3d0[_0xd76e('0x48')](_0x248345);}})[_0xd76e('0x3d')](function(_0x363512){if(_0x363512){_0x2df60b=_0x363512[_0xd76e('0x34')];if(!_0x36e023[_0xd76e('0x2d')][_0xd76e('0x4b')](_0xd76e('0x35'))){_0x248345[_0xd76e('0x1e')]=qs[_0xd76e('0x1e')](_0x36e023[_0xd76e('0x2d')][_0xd76e('0x1e')]);_0x248345[_0xd76e('0x1f')]=qs[_0xd76e('0x1f')](_0x36e023[_0xd76e('0x2d')][_0xd76e('0x1f')]);}return _0x1df3d0[_0xd76e('0x48')](_0x248345);}})['then'](function(_0x150908){if(_0x150908){return _0x150908?{'count':_0x2df60b,'rows':_0x150908}:null;}})[_0xd76e('0x3d')](respondWithResult(_0x22ac15,null))[_0xd76e('0x41')](handleError(_0x22ac15,null));};exports['getSubjects']=function(_0x5583d6,_0x5c0f97,_0x55dbf8){var _0x7d4db0={};var _0x3fd02f={};var _0x7a236b;var _0x538541;return db['SugarcrmConfiguration'][_0xd76e('0x49')]({'where':{'id':_0x5583d6[_0xd76e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c0f97,null))[_0xd76e('0x3d')](function(_0x19c2d9){if(_0x19c2d9){_0x7a236b=_0x19c2d9;_0x3fd02f[_0xd76e('0x31')]=_[_0xd76e('0x2e')](db[_0xd76e('0x4a')][_0xd76e('0x2a')]);_0x3fd02f[_0xd76e('0x2d')]=_[_0xd76e('0x2e')](_0x5583d6[_0xd76e('0x2d')]);_0x3fd02f['filters']=_['intersection'](_0x3fd02f[_0xd76e('0x31')],_0x3fd02f[_0xd76e('0x2d')]);_0x7d4db0[_0xd76e('0x32')]=_[_0xd76e('0x30')](_0x3fd02f['model'],qs['fields'](_0x5583d6[_0xd76e('0x2d')][_0xd76e('0x33')]));_0x7d4db0['attributes']=_0x7d4db0['attributes'][_0xd76e('0x34')]?_0x7d4db0['attributes']:_0x3fd02f[_0xd76e('0x31')];_0x7d4db0['order']=qs[_0xd76e('0x37')](_0x5583d6[_0xd76e('0x2d')][_0xd76e('0x37')]);_0x7d4db0[_0xd76e('0x38')]=qs[_0xd76e('0x2f')](_[_0xd76e('0x39')](_0x5583d6['query'],_0x3fd02f[_0xd76e('0x2f')]));if(_0x5583d6['query']['filter']){_0x7d4db0['where']=_[_0xd76e('0x3b')](_0x7d4db0[_0xd76e('0x38')],{'$or':_[_0xd76e('0x28')](_0x7d4db0[_0xd76e('0x32')],function(_0x5864f2){var _0x10ad05={};_0x10ad05[_0x5864f2]={'$like':'%'+_0x5583d6[_0xd76e('0x2d')][_0xd76e('0x3a')]+'%'};return _0x10ad05;})});}_0x7d4db0=_[_0xd76e('0x3b')]({},_0x7d4db0,_0x5583d6[_0xd76e('0x43')]);return _0x7a236b[_0xd76e('0x4c')](_0x7d4db0);}})[_0xd76e('0x3d')](function(_0x25ef7e){if(_0x25ef7e){_0x538541=_0x25ef7e['length'];if(!_0x5583d6[_0xd76e('0x2d')]['hasOwnProperty'](_0xd76e('0x35'))){_0x7d4db0[_0xd76e('0x1e')]=qs[_0xd76e('0x1e')](_0x5583d6[_0xd76e('0x2d')][_0xd76e('0x1e')]);_0x7d4db0[_0xd76e('0x1f')]=qs[_0xd76e('0x1f')](_0x5583d6[_0xd76e('0x2d')][_0xd76e('0x1f')]);}return _0x7a236b[_0xd76e('0x4c')](_0x7d4db0);}})['then'](function(_0x394a4a){if(_0x394a4a){return _0x394a4a?{'count':_0x538541,'rows':_0x394a4a}:null;}})[_0xd76e('0x3d')](respondWithResult(_0x5c0f97,null))[_0xd76e('0x41')](handleError(_0x5c0f97,null));};exports[_0xd76e('0x4d')]=function(_0x17627e,_0x53d9f3,_0x19ea70){var _0x2184a3={};var _0x23ce28={};var _0x5ef6f0;var _0x137185;return db[_0xd76e('0x29')][_0xd76e('0x49')]({'where':{'id':_0x17627e['params']['id']}})['then'](handleEntityNotFound(_0x53d9f3,null))[_0xd76e('0x3d')](function(_0x430708){if(_0x430708){_0x5ef6f0=_0x430708;_0x23ce28['model']=_[_0xd76e('0x2e')](db[_0xd76e('0x4a')]['rawAttributes']);_0x23ce28[_0xd76e('0x2d')]=_['keys'](_0x17627e[_0xd76e('0x2d')]);_0x23ce28[_0xd76e('0x2f')]=_[_0xd76e('0x30')](_0x23ce28[_0xd76e('0x31')],_0x23ce28[_0xd76e('0x2d')]);_0x2184a3['attributes']=_[_0xd76e('0x30')](_0x23ce28['model'],qs['fields'](_0x17627e['query']['fields']));_0x2184a3[_0xd76e('0x32')]=_0x2184a3['attributes'][_0xd76e('0x34')]?_0x2184a3[_0xd76e('0x32')]:_0x23ce28[_0xd76e('0x31')];_0x2184a3[_0xd76e('0x36')]=qs[_0xd76e('0x37')](_0x17627e['query'][_0xd76e('0x37')]);_0x2184a3[_0xd76e('0x38')]=qs[_0xd76e('0x2f')](_[_0xd76e('0x39')](_0x17627e['query'],_0x23ce28[_0xd76e('0x2f')]));if(_0x17627e[_0xd76e('0x2d')][_0xd76e('0x3a')]){_0x2184a3[_0xd76e('0x38')]=_[_0xd76e('0x3b')](_0x2184a3[_0xd76e('0x38')],{'$or':_[_0xd76e('0x28')](_0x2184a3['attributes'],function(_0x56ccc8){var _0xa96abf={};_0xa96abf[_0x56ccc8]={'$like':'%'+_0x17627e[_0xd76e('0x2d')][_0xd76e('0x3a')]+'%'};return _0xa96abf;})});}_0x2184a3=_[_0xd76e('0x3b')]({},_0x2184a3,_0x17627e[_0xd76e('0x43')]);return _0x5ef6f0['getDescriptions'](_0x2184a3);}})[_0xd76e('0x3d')](function(_0x5bea42){if(_0x5bea42){_0x137185=_0x5bea42[_0xd76e('0x34')];if(!_0x17627e[_0xd76e('0x2d')][_0xd76e('0x4b')](_0xd76e('0x35'))){_0x2184a3[_0xd76e('0x1e')]=qs[_0xd76e('0x1e')](_0x17627e['query']['limit']);_0x2184a3[_0xd76e('0x1f')]=qs['offset'](_0x17627e[_0xd76e('0x2d')][_0xd76e('0x1f')]);}return _0x5ef6f0[_0xd76e('0x4d')](_0x2184a3);}})[_0xd76e('0x3d')](function(_0x4573ae){if(_0x4573ae){return _0x4573ae?{'count':_0x137185,'rows':_0x4573ae}:null;}})[_0xd76e('0x3d')](respondWithResult(_0x53d9f3,null))[_0xd76e('0x41')](handleError(_0x53d9f3,null));}; \ No newline at end of file +var _0xae5b=['body','find','destroy','getFields','findOne','SugarcrmField','order','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','rawAttributes','keys','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','rows','catch','show','params','fields','create','update'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xae5b,0xea));var _0xbae5=function(_0x148bae,_0x316e72){_0x148bae=_0x148bae-0x0;var _0x349f8c=_0xae5b[_0x148bae];return _0x349f8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbae5('0x0'));var jsonpatch=require(_0xbae5('0x1'));var rp=require('request-promise');var moment=require(_0xbae5('0x2'));var BPromise=require(_0xbae5('0x3'));var Mustache=require(_0xbae5('0x4'));var util=require(_0xbae5('0x5'));var path=require(_0xbae5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbae5('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbae5('0x8'));var deskjs=require(_0xbae5('0x9'));var toCsv=require(_0xbae5('0xa'));var querystring=require('querystring');var Papa=require(_0xbae5('0xb'));var Redis=require(_0xbae5('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbae5('0xd'));var logger=require(_0xbae5('0xe'))(_0xbae5('0xf'));var utils=require(_0xbae5('0x10'));var config=require(_0xbae5('0x11'));var licenseUtil=require(_0xbae5('0x12'));var db=require(_0xbae5('0x13'))['db'];function respondWithStatusCode(_0x521736,_0x3690bf){_0x3690bf=_0x3690bf||0xcc;return function(_0xb439ab){if(_0xb439ab){return _0x521736[_0xbae5('0x14')](_0x3690bf);}return _0x521736[_0xbae5('0x15')](_0x3690bf)[_0xbae5('0x16')]();};}function respondWithResult(_0x36064d,_0x5de5fe){_0x5de5fe=_0x5de5fe||0xc8;return function(_0x1648ca){if(_0x1648ca){return _0x36064d[_0xbae5('0x15')](_0x5de5fe)['json'](_0x1648ca);}};}function respondWithFilteredResult(_0x3e168c,_0x1d34e4){return function(_0xb853f2){if(_0xb853f2){var _0x377f9b=typeof _0x1d34e4['offset']==='undefined'&&typeof _0x1d34e4[_0xbae5('0x17')]===_0xbae5('0x18');var _0x1acb74=_0xb853f2[_0xbae5('0x19')];var _0x41b08a=_0x377f9b?0x0:_0x1d34e4[_0xbae5('0x1a')];var _0x412084=_0x377f9b?_0xb853f2[_0xbae5('0x19')]:_0x1d34e4[_0xbae5('0x1a')]+_0x1d34e4[_0xbae5('0x17')];var _0x38af11;if(_0x412084>=_0x1acb74){_0x412084=_0x1acb74;_0x38af11=0xc8;}else{_0x38af11=0xce;}_0x3e168c[_0xbae5('0x15')](_0x38af11);return _0x3e168c['set'](_0xbae5('0x1b'),_0x41b08a+'-'+_0x412084+'/'+_0x1acb74)[_0xbae5('0x1c')](_0xb853f2);}return null;};}function patchUpdates(_0x29e94c){return function(_0x1c2b19){try{jsonpatch[_0xbae5('0x1d')](_0x1c2b19,_0x29e94c,!![]);}catch(_0x522782){return BPromise[_0xbae5('0x1e')](_0x522782);}return _0x1c2b19[_0xbae5('0x1f')]();};}function saveUpdates(_0x35cf6e,_0x466175){return function(_0x3a1d95){if(_0x3a1d95){return _0x3a1d95['update'](_0x35cf6e)[_0xbae5('0x20')](function(_0x563c51){return _0x563c51;});}return null;};}function removeEntity(_0x5caf3b,_0x439269){return function(_0x37f716){if(_0x37f716){return _0x37f716['destroy']()[_0xbae5('0x20')](function(){_0x5caf3b[_0xbae5('0x15')](0xcc)[_0xbae5('0x16')]();});}};}function handleEntityNotFound(_0x1bc1e5,_0x12fc8a){return function(_0x420a8a){if(!_0x420a8a){_0x1bc1e5[_0xbae5('0x14')](0x194);}return _0x420a8a;};}function handleError(_0x42ffc8,_0x64e236){_0x64e236=_0x64e236||0x1f4;return function(_0x28e47b){logger[_0xbae5('0x21')](_0x28e47b[_0xbae5('0x22')]);if(_0x28e47b[_0xbae5('0x23')]){delete _0x28e47b[_0xbae5('0x23')];}_0x42ffc8['status'](_0x64e236)[_0xbae5('0x24')](_0x28e47b);};}exports['index']=function(_0x277b5d,_0x507941){var _0xe2846={},_0x58f26e={},_0x9a0b05={'count':0x0,'rows':[]};var _0x4f9403=_[_0xbae5('0x25')](db['SugarcrmConfiguration'][_0xbae5('0x26')],function(_0xf7a164){return{'name':_0xf7a164['fieldName'],'type':_0xf7a164['type']['key']};});_0x58f26e['model']=_[_0xbae5('0x25')](_0x4f9403,'name');_0x58f26e['query']=_[_0xbae5('0x27')](_0x277b5d['query']);_0x58f26e[_0xbae5('0x28')]=_[_0xbae5('0x29')](_0x58f26e[_0xbae5('0x2a')],_0x58f26e[_0xbae5('0x2b')]);_0xe2846[_0xbae5('0x2c')]=_['intersection'](_0x58f26e[_0xbae5('0x2a')],qs['fields'](_0x277b5d[_0xbae5('0x2b')]['fields']));_0xe2846[_0xbae5('0x2c')]=_0xe2846[_0xbae5('0x2c')][_0xbae5('0x2d')]?_0xe2846[_0xbae5('0x2c')]:_0x58f26e[_0xbae5('0x2a')];if(!_0x277b5d['query'][_0xbae5('0x2e')](_0xbae5('0x2f'))){_0xe2846['limit']=qs['limit'](_0x277b5d['query'][_0xbae5('0x17')]);_0xe2846[_0xbae5('0x1a')]=qs[_0xbae5('0x1a')](_0x277b5d[_0xbae5('0x2b')][_0xbae5('0x1a')]);}_0xe2846['order']=qs[_0xbae5('0x30')](_0x277b5d[_0xbae5('0x2b')][_0xbae5('0x30')]);_0xe2846['where']=qs[_0xbae5('0x28')](_[_0xbae5('0x31')](_0x277b5d[_0xbae5('0x2b')],_0x58f26e[_0xbae5('0x28')]),_0x4f9403);if(_0x277b5d[_0xbae5('0x2b')][_0xbae5('0x32')]){_0xe2846['where']=_[_0xbae5('0x33')](_0xe2846[_0xbae5('0x34')],{'$or':_[_0xbae5('0x25')](_0x4f9403,function(_0x506466){if(_0x506466[_0xbae5('0x35')]!==_0xbae5('0x36')){var _0x1bda72={};_0x1bda72[_0x506466[_0xbae5('0x23')]]={'$like':'%'+_0x277b5d[_0xbae5('0x2b')]['filter']+'%'};return _0x1bda72;}})});}_0xe2846=_[_0xbae5('0x33')]({},_0xe2846,_0x277b5d[_0xbae5('0x37')]);var _0x1d1dfe={'where':_0xe2846[_0xbae5('0x34')]};return db[_0xbae5('0x38')][_0xbae5('0x19')](_0x1d1dfe)['then'](function(_0x1c6923){_0x9a0b05[_0xbae5('0x19')]=_0x1c6923;if(_0x277b5d[_0xbae5('0x2b')][_0xbae5('0x39')]){_0xe2846[_0xbae5('0x3a')]=[{'all':!![]}];}return db[_0xbae5('0x38')]['findAll'](_0xe2846);})['then'](function(_0x1a11a8){_0x9a0b05[_0xbae5('0x3b')]=_0x1a11a8;return _0x9a0b05;})[_0xbae5('0x20')](respondWithFilteredResult(_0x507941,_0xe2846))[_0xbae5('0x3c')](handleError(_0x507941,null));};exports[_0xbae5('0x3d')]=function(_0x22063d,_0x3e109c){var _0x2f5490={'raw':![],'where':{'id':_0x22063d[_0xbae5('0x3e')]['id']}},_0x1413e8={};_0x1413e8[_0xbae5('0x2a')]=_[_0xbae5('0x27')](db['SugarcrmConfiguration'][_0xbae5('0x26')]);_0x1413e8['query']=_[_0xbae5('0x27')](_0x22063d[_0xbae5('0x2b')]);_0x1413e8['filters']=_['intersection'](_0x1413e8[_0xbae5('0x2a')],_0x1413e8['query']);_0x2f5490[_0xbae5('0x2c')]=_['intersection'](_0x1413e8[_0xbae5('0x2a')],qs[_0xbae5('0x3f')](_0x22063d['query']['fields']));_0x2f5490[_0xbae5('0x2c')]=_0x2f5490[_0xbae5('0x2c')][_0xbae5('0x2d')]?_0x2f5490[_0xbae5('0x2c')]:_0x1413e8[_0xbae5('0x2a')];if(_0x22063d[_0xbae5('0x2b')]['includeAll']){_0x2f5490[_0xbae5('0x3a')]=[{'all':!![]}];}_0x2f5490=_[_0xbae5('0x33')]({},_0x2f5490,_0x22063d[_0xbae5('0x37')]);return db[_0xbae5('0x38')]['find'](_0x2f5490)[_0xbae5('0x20')](handleEntityNotFound(_0x3e109c,null))[_0xbae5('0x20')](respondWithResult(_0x3e109c,null))[_0xbae5('0x3c')](handleError(_0x3e109c,null));};exports[_0xbae5('0x40')]=function(_0x36cc4d,_0x1da5a8){return db['SugarcrmConfiguration'][_0xbae5('0x40')](_0x36cc4d['body'],{})['then'](respondWithResult(_0x1da5a8,0xc9))[_0xbae5('0x3c')](handleError(_0x1da5a8,null));};exports[_0xbae5('0x41')]=function(_0xcab204,_0x2e8067){if(_0xcab204[_0xbae5('0x42')]['id']){delete _0xcab204[_0xbae5('0x42')]['id'];}return db['SugarcrmConfiguration'][_0xbae5('0x43')]({'where':{'id':_0xcab204[_0xbae5('0x3e')]['id']}})[_0xbae5('0x20')](handleEntityNotFound(_0x2e8067,null))[_0xbae5('0x20')](saveUpdates(_0xcab204[_0xbae5('0x42')],null))['then'](respondWithResult(_0x2e8067,null))['catch'](handleError(_0x2e8067,null));};exports[_0xbae5('0x44')]=function(_0x2cc987,_0x16a8c3){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x2cc987[_0xbae5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x16a8c3,null))['then'](removeEntity(_0x16a8c3,null))[_0xbae5('0x3c')](handleError(_0x16a8c3,null));};exports[_0xbae5('0x45')]=function(_0x458bf2,_0x14a7d3,_0x2bcb06){var _0x12cea1={};var _0xcbe111={};var _0x1d3376;var _0x1571d6;return db[_0xbae5('0x38')][_0xbae5('0x46')]({'where':{'id':_0x458bf2[_0xbae5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x14a7d3,null))['then'](function(_0x59247f){if(_0x59247f){_0x1d3376=_0x59247f;_0xcbe111[_0xbae5('0x2a')]=_[_0xbae5('0x27')](db[_0xbae5('0x47')][_0xbae5('0x26')]);_0xcbe111[_0xbae5('0x2b')]=_[_0xbae5('0x27')](_0x458bf2[_0xbae5('0x2b')]);_0xcbe111[_0xbae5('0x28')]=_['intersection'](_0xcbe111['model'],_0xcbe111['query']);_0x12cea1[_0xbae5('0x2c')]=_[_0xbae5('0x29')](_0xcbe111[_0xbae5('0x2a')],qs[_0xbae5('0x3f')](_0x458bf2[_0xbae5('0x2b')][_0xbae5('0x3f')]));_0x12cea1[_0xbae5('0x2c')]=_0x12cea1[_0xbae5('0x2c')][_0xbae5('0x2d')]?_0x12cea1['attributes']:_0xcbe111['model'];_0x12cea1[_0xbae5('0x48')]=qs[_0xbae5('0x30')](_0x458bf2[_0xbae5('0x2b')][_0xbae5('0x30')]);_0x12cea1['where']=qs[_0xbae5('0x28')](_[_0xbae5('0x31')](_0x458bf2[_0xbae5('0x2b')],_0xcbe111['filters']));if(_0x458bf2[_0xbae5('0x2b')][_0xbae5('0x32')]){_0x12cea1['where']=_[_0xbae5('0x33')](_0x12cea1[_0xbae5('0x34')],{'$or':_['map'](_0x12cea1['attributes'],function(_0x42c4a8){var _0x1aabd8={};_0x1aabd8[_0x42c4a8]={'$like':'%'+_0x458bf2[_0xbae5('0x2b')]['filter']+'%'};return _0x1aabd8;})});}_0x12cea1=_[_0xbae5('0x33')]({},_0x12cea1,_0x458bf2[_0xbae5('0x37')]);return _0x1d3376[_0xbae5('0x45')](_0x12cea1);}})[_0xbae5('0x20')](function(_0x5ed30c){if(_0x5ed30c){_0x1571d6=_0x5ed30c[_0xbae5('0x2d')];if(!_0x458bf2[_0xbae5('0x2b')][_0xbae5('0x2e')](_0xbae5('0x2f'))){_0x12cea1[_0xbae5('0x17')]=qs['limit'](_0x458bf2[_0xbae5('0x2b')][_0xbae5('0x17')]);_0x12cea1[_0xbae5('0x1a')]=qs[_0xbae5('0x1a')](_0x458bf2[_0xbae5('0x2b')]['offset']);}return _0x1d3376['getFields'](_0x12cea1);}})[_0xbae5('0x20')](function(_0x227bcf){if(_0x227bcf){return _0x227bcf?{'count':_0x1571d6,'rows':_0x227bcf}:null;}})[_0xbae5('0x20')](respondWithResult(_0x14a7d3,null))['catch'](handleError(_0x14a7d3,null));};exports[_0xbae5('0x49')]=function(_0x4250ae,_0x550fc4,_0x2d4890){var _0x25ffe7={};var _0x32853b={};var _0x43aa1e;var _0x1eab24;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4250ae['params']['id']}})[_0xbae5('0x20')](handleEntityNotFound(_0x550fc4,null))[_0xbae5('0x20')](function(_0x196750){if(_0x196750){_0x43aa1e=_0x196750;_0x32853b[_0xbae5('0x2a')]=_[_0xbae5('0x27')](db['SugarcrmField']['rawAttributes']);_0x32853b[_0xbae5('0x2b')]=_[_0xbae5('0x27')](_0x4250ae['query']);_0x32853b[_0xbae5('0x28')]=_[_0xbae5('0x29')](_0x32853b[_0xbae5('0x2a')],_0x32853b[_0xbae5('0x2b')]);_0x25ffe7[_0xbae5('0x2c')]=_['intersection'](_0x32853b[_0xbae5('0x2a')],qs[_0xbae5('0x3f')](_0x4250ae[_0xbae5('0x2b')][_0xbae5('0x3f')]));_0x25ffe7['attributes']=_0x25ffe7['attributes'][_0xbae5('0x2d')]?_0x25ffe7[_0xbae5('0x2c')]:_0x32853b[_0xbae5('0x2a')];_0x25ffe7['order']=qs[_0xbae5('0x30')](_0x4250ae[_0xbae5('0x2b')][_0xbae5('0x30')]);_0x25ffe7[_0xbae5('0x34')]=qs[_0xbae5('0x28')](_[_0xbae5('0x31')](_0x4250ae[_0xbae5('0x2b')],_0x32853b[_0xbae5('0x28')]));if(_0x4250ae[_0xbae5('0x2b')][_0xbae5('0x32')]){_0x25ffe7[_0xbae5('0x34')]=_[_0xbae5('0x33')](_0x25ffe7[_0xbae5('0x34')],{'$or':_[_0xbae5('0x25')](_0x25ffe7['attributes'],function(_0x2c3814){var _0x29422e={};_0x29422e[_0x2c3814]={'$like':'%'+_0x4250ae[_0xbae5('0x2b')]['filter']+'%'};return _0x29422e;})});}_0x25ffe7=_['merge']({},_0x25ffe7,_0x4250ae[_0xbae5('0x37')]);return _0x43aa1e[_0xbae5('0x49')](_0x25ffe7);}})[_0xbae5('0x20')](function(_0x11db33){if(_0x11db33){_0x1eab24=_0x11db33[_0xbae5('0x2d')];if(!_0x4250ae[_0xbae5('0x2b')][_0xbae5('0x2e')]('nolimit')){_0x25ffe7[_0xbae5('0x17')]=qs['limit'](_0x4250ae[_0xbae5('0x2b')][_0xbae5('0x17')]);_0x25ffe7[_0xbae5('0x1a')]=qs['offset'](_0x4250ae[_0xbae5('0x2b')][_0xbae5('0x1a')]);}return _0x43aa1e[_0xbae5('0x49')](_0x25ffe7);}})['then'](function(_0x347ecd){if(_0x347ecd){return _0x347ecd?{'count':_0x1eab24,'rows':_0x347ecd}:null;}})[_0xbae5('0x20')](respondWithResult(_0x550fc4,null))['catch'](handleError(_0x550fc4,null));};exports[_0xbae5('0x4a')]=function(_0x4a93cc,_0x5b2434,_0x3917cd){var _0x228580={};var _0x5216d9={};var _0x287ef0;var _0x20d672;return db[_0xbae5('0x38')]['findOne']({'where':{'id':_0x4a93cc['params']['id']}})[_0xbae5('0x20')](handleEntityNotFound(_0x5b2434,null))[_0xbae5('0x20')](function(_0x488877){if(_0x488877){_0x287ef0=_0x488877;_0x5216d9['model']=_[_0xbae5('0x27')](db['SugarcrmField'][_0xbae5('0x26')]);_0x5216d9[_0xbae5('0x2b')]=_[_0xbae5('0x27')](_0x4a93cc['query']);_0x5216d9[_0xbae5('0x28')]=_['intersection'](_0x5216d9['model'],_0x5216d9[_0xbae5('0x2b')]);_0x228580[_0xbae5('0x2c')]=_['intersection'](_0x5216d9[_0xbae5('0x2a')],qs[_0xbae5('0x3f')](_0x4a93cc[_0xbae5('0x2b')][_0xbae5('0x3f')]));_0x228580[_0xbae5('0x2c')]=_0x228580[_0xbae5('0x2c')][_0xbae5('0x2d')]?_0x228580[_0xbae5('0x2c')]:_0x5216d9['model'];_0x228580[_0xbae5('0x48')]=qs[_0xbae5('0x30')](_0x4a93cc[_0xbae5('0x2b')][_0xbae5('0x30')]);_0x228580['where']=qs['filters'](_['pick'](_0x4a93cc['query'],_0x5216d9['filters']));if(_0x4a93cc[_0xbae5('0x2b')]['filter']){_0x228580[_0xbae5('0x34')]=_[_0xbae5('0x33')](_0x228580[_0xbae5('0x34')],{'$or':_[_0xbae5('0x25')](_0x228580[_0xbae5('0x2c')],function(_0xe8744c){var _0x18d31e={};_0x18d31e[_0xe8744c]={'$like':'%'+_0x4a93cc[_0xbae5('0x2b')][_0xbae5('0x32')]+'%'};return _0x18d31e;})});}_0x228580=_[_0xbae5('0x33')]({},_0x228580,_0x4a93cc[_0xbae5('0x37')]);return _0x287ef0[_0xbae5('0x4a')](_0x228580);}})['then'](function(_0x147fda){if(_0x147fda){_0x20d672=_0x147fda[_0xbae5('0x2d')];if(!_0x4a93cc[_0xbae5('0x2b')][_0xbae5('0x2e')](_0xbae5('0x2f'))){_0x228580[_0xbae5('0x17')]=qs[_0xbae5('0x17')](_0x4a93cc[_0xbae5('0x2b')][_0xbae5('0x17')]);_0x228580[_0xbae5('0x1a')]=qs['offset'](_0x4a93cc[_0xbae5('0x2b')][_0xbae5('0x1a')]);}return _0x287ef0[_0xbae5('0x4a')](_0x228580);}})[_0xbae5('0x20')](function(_0xd7f7b7){if(_0xd7f7b7){return _0xd7f7b7?{'count':_0x20d672,'rows':_0xd7f7b7}:null;}})[_0xbae5('0x20')](respondWithResult(_0x5b2434,null))[_0xbae5('0x3c')](handleError(_0x5b2434,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 3bd6f31..ca135ae 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 _0x1ef4=['util','api','bluebird','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x1ef4,0x148));var _0x41ef=function(_0xd38362,_0x4169af){_0xd38362=_0xd38362-0x0;var _0x1f2785=_0x1ef4[_0xd38362];return _0x1f2785;};'use strict';var _=require('lodash');var util=require(_0x41ef('0x0'));var logger=require('../../config/logger')(_0x41ef('0x1'));var moment=require('moment');var BPromise=require(_0x41ef('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41ef('0x3'));var attributes=require(_0x41ef('0x4'));module[_0x41ef('0x5')]=function(_0x54f2a5,_0xc7f42b){return _0x54f2a5['define'](_0x41ef('0x6'),attributes,{'tableName':_0x41ef('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2aab=['../../config/environment','define','SugarcrmConfiguration','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3be147,_0x2d5045){var _0x4925a4=function(_0x3c7bef){while(--_0x3c7bef){_0x3be147['push'](_0x3be147['shift']());}};_0x4925a4(++_0x2d5045);}(_0x2aab,0x18f));var _0xb2aa=function(_0x9b3792,_0x4b59ef){_0x9b3792=_0x9b3792-0x0;var _0x691bc2=_0x2aab[_0x9b3792];return _0x691bc2;};'use strict';var _=require(_0xb2aa('0x0'));var util=require(_0xb2aa('0x1'));var logger=require(_0xb2aa('0x2'))('api');var moment=require(_0xb2aa('0x3'));var BPromise=require(_0xb2aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2aa('0x5'));var rimraf=require('rimraf');var config=require(_0xb2aa('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x386bc1,_0x2b4c4a){return _0x386bc1[_0xb2aa('0x7')](_0xb2aa('0x8'),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 2268714..bd10e77 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 _0x5c4f=['code','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x292648,_0x4343ec){var _0x446650=function(_0x1598cf){while(--_0x1598cf){_0x292648['push'](_0x292648['shift']());}};_0x446650(++_0x4343ec);}(_0x5c4f,0x169));var _0xf5c4=function(_0x5a8f35,_0xf7ca3d){_0x5a8f35=_0x5a8f35-0x0;var _0x56fdb9=_0x5c4f[_0x5a8f35];return _0x56fdb9;};'use strict';var _=require('lodash');var util=require(_0xf5c4('0x0'));var moment=require(_0xf5c4('0x1'));var BPromise=require(_0xf5c4('0x2'));var rs=require(_0xf5c4('0x3'));var fs=require('fs');var Redis=require(_0xf5c4('0x4'));var db=require(_0xf5c4('0x5'))['db'];var utils=require(_0xf5c4('0x6'));var logger=require(_0xf5c4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf5c4('0x8'));var client=jayson['client'][_0xf5c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x178509,_0x45eb0c,_0x46be14){return new BPromise(function(_0x4d8420,_0x30539a){return client[_0xf5c4('0xa')](_0x178509,_0x46be14)[_0xf5c4('0xb')](function(_0x5cf05e){logger[_0xf5c4('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x45eb0c,'request\x20sent');logger[_0xf5c4('0xd')](_0xf5c4('0xe'),_0x45eb0c,_0xf5c4('0xf'),JSON['stringify'](_0x5cf05e));if(_0x5cf05e[_0xf5c4('0x10')]){if(_0x5cf05e[_0xf5c4('0x10')][_0xf5c4('0x11')]===0x1f4){logger[_0xf5c4('0x10')](_0xf5c4('0x12'),_0x45eb0c,_0x5cf05e[_0xf5c4('0x10')]['message']);return _0x30539a(_0x5cf05e['error'][_0xf5c4('0x13')]);}logger[_0xf5c4('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x45eb0c,_0x5cf05e['error']['message']);return _0x4d8420(_0x5cf05e[_0xf5c4('0x10')][_0xf5c4('0x13')]);}else{logger[_0xf5c4('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x45eb0c,_0xf5c4('0xf'));_0x4d8420(_0x5cf05e['result'][_0xf5c4('0x13')]);}})[_0xf5c4('0x14')](function(_0x2a69fa){logger[_0xf5c4('0x10')](_0xf5c4('0x12'),_0x45eb0c,_0x2a69fa);_0x30539a(_0x2a69fa);});});} \ No newline at end of file +var _0x2002=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x4ae42e,_0x4eb8ef){var _0x21a702=function(_0x8fe148){while(--_0x8fe148){_0x4ae42e['push'](_0x4ae42e['shift']());}};_0x21a702(++_0x4eb8ef);}(_0x2002,0xf9));var _0x2200=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x2002[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x2200('0x0'));var util=require(_0x2200('0x1'));var moment=require(_0x2200('0x2'));var BPromise=require(_0x2200('0x3'));var rs=require(_0x2200('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2200('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2200('0x6'))(_0x2200('0x7'));var config=require(_0x2200('0x8'));var jayson=require(_0x2200('0x9'));var client=jayson[_0x2200('0xa')][_0x2200('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x316011,_0x45548a,_0x424d8f){return new BPromise(function(_0x14d876,_0x1523c6){return client[_0x2200('0xc')](_0x316011,_0x424d8f)['then'](function(_0x58d50c){logger[_0x2200('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x45548a,_0x2200('0xe'));logger['debug'](_0x2200('0xf'),_0x45548a,_0x2200('0xe'),JSON[_0x2200('0x10')](_0x58d50c));if(_0x58d50c[_0x2200('0x11')]){if(_0x58d50c['error'][_0x2200('0x12')]===0x1f4){logger['error'](_0x2200('0x13'),_0x45548a,_0x58d50c[_0x2200('0x11')][_0x2200('0x14')]);return _0x1523c6(_0x58d50c[_0x2200('0x11')]['message']);}logger[_0x2200('0x11')](_0x2200('0x13'),_0x45548a,_0x58d50c[_0x2200('0x11')]['message']);return _0x14d876(_0x58d50c[_0x2200('0x11')][_0x2200('0x14')]);}else{logger[_0x2200('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x45548a,'request\x20sent');_0x14d876(_0x58d50c[_0x2200('0x15')][_0x2200('0x14')]);}})['catch'](function(_0x22f3b2){logger['error'](_0x2200('0x13'),_0x45548a,_0x22f3b2);_0x1523c6(_0x22f3b2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 5e51016..1254411 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 _0x922a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','show','post','create','put','delete','isAuthenticated','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x922a,0x13a));var _0xa922=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x922a[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xa922('0x0'));var util=require(_0xa922('0x1'));var path=require(_0xa922('0x2'));var timeout=require(_0xa922('0x3'));var express=require('express');var router=express[_0xa922('0x4')]();var fs_extra=require(_0xa922('0x5'));var auth=require(_0xa922('0x6'));var interaction=require(_0xa922('0x7'));var config=require(_0xa922('0x8'));var controller=require(_0xa922('0x9'));router[_0xa922('0xa')]('/',auth['isAuthenticated'](),controller[_0xa922('0xb')]);router[_0xa922('0xa')](_0xa922('0xc'),auth['isAuthenticated'](),controller[_0xa922('0xd')]);router[_0xa922('0xe')]('/',auth['isAuthenticated'](),controller[_0xa922('0xf')]);router[_0xa922('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa922('0x11')](_0xa922('0xc'),auth[_0xa922('0x12')](),controller['destroy']);module[_0xa922('0x13')]=router; \ No newline at end of file +var _0xa5f0=['destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x3fb654,_0x5a6085){var _0x51ed72=function(_0x3aa404){while(--_0x3aa404){_0x3fb654['push'](_0x3fb654['shift']());}};_0x51ed72(++_0x5a6085);}(_0xa5f0,0x189));var _0x0a5f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa5f0[_0x4e676e];return _0x336a3c;};'use strict';var multer=require('multer');var util=require(_0x0a5f('0x0'));var path=require(_0x0a5f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0a5f('0x2'));var router=express[_0x0a5f('0x3')]();var fs_extra=require(_0x0a5f('0x4'));var auth=require(_0x0a5f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a5f('0x6'));router[_0x0a5f('0x7')]('/',auth[_0x0a5f('0x8')](),controller[_0x0a5f('0x9')]);router[_0x0a5f('0x7')]('/:id',auth[_0x0a5f('0x8')](),controller[_0x0a5f('0xa')]);router[_0x0a5f('0xb')]('/',auth[_0x0a5f('0x8')](),controller[_0x0a5f('0xc')]);router[_0x0a5f('0xd')]('/:id',auth[_0x0a5f('0x8')](),controller[_0x0a5f('0xe')]);router['delete']('/:id',auth[_0x0a5f('0x8')](),controller[_0x0a5f('0xf')]);module[_0x0a5f('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 e950059..56a5e2f 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 _0xb28b=['string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x560e1,_0x1185f2){var _0x4a47d3=function(_0x5d8ab0){while(--_0x5d8ab0){_0x560e1['push'](_0x560e1['shift']());}};_0x4a47d3(++_0x1185f2);}(_0xb28b,0x7e));var _0xbb28=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb28b[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xbb28('0x0'),_0xbb28('0x1'),_0xbb28('0x2'),_0xbb28('0x3'),_0xbb28('0x4')),'defaultValue':_0xbb28('0x0')},'content':{'type':Sequelize[_0xbb28('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbb28('0x0'),'variable',_0xbb28('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbb28('0x5')]},'nameField':{'type':Sequelize[_0xbb28('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb28('0x5')]}}; \ No newline at end of file +var _0x19f3=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x72fad8,_0x54f0a8){var _0x162e06=function(_0xfe5f3a){while(--_0xfe5f3a){_0x72fad8['push'](_0x72fad8['shift']());}};_0x162e06(++_0x54f0a8);}(_0x19f3,0xb2));var _0x319f=function(_0x20593e,_0x2f8bde){_0x20593e=_0x20593e-0x0;var _0x4f8546=_0x19f3[_0x20593e];return _0x4f8546;};'use strict';var Sequelize=require(_0x319f('0x0'));module[_0x319f('0x1')]={'type':{'type':Sequelize[_0x319f('0x2')](_0x319f('0x3'),_0x319f('0x4'),_0x319f('0x5'),_0x319f('0x6'),_0x319f('0x7')),'defaultValue':_0x319f('0x3')},'content':{'type':Sequelize[_0x319f('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x319f('0x2')]('string','variable',_0x319f('0x5'))},'keyContent':{'type':Sequelize[_0x319f('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x319f('0x8')]},'customField':{'type':Sequelize[_0x319f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x319f('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index fdd7746..2ce7fde 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 _0x85b6=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3bf504,_0x4d30db){var _0x4c126a=function(_0x49f616){while(--_0x49f616){_0x3bf504['push'](_0x3bf504['shift']());}};_0x4c126a(++_0x4d30db);}(_0x85b6,0x16a));var _0x685b=function(_0x20778c,_0x9c81a0){_0x20778c=_0x20778c-0x0;var _0x32d193=_0x85b6[_0x20778c];return _0x32d193;};'use strict';var emlformat=require(_0x685b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x685b('0x1'));var jsonpatch=require(_0x685b('0x2'));var rp=require(_0x685b('0x3'));var moment=require(_0x685b('0x4'));var BPromise=require(_0x685b('0x5'));var Mustache=require(_0x685b('0x6'));var util=require(_0x685b('0x7'));var path=require(_0x685b('0x8'));var sox=require(_0x685b('0x9'));var csv=require(_0x685b('0xa'));var ejs=require(_0x685b('0xb'));var fs=require('fs');var fs_extra=require(_0x685b('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x685b('0xd'));var jsforce=require(_0x685b('0xe'));var deskjs=require(_0x685b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x685b('0x10'));var Papa=require(_0x685b('0x11'));var Redis=require(_0x685b('0x12'));var authService=require(_0x685b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x685b('0x14'));var hardwareService=require(_0x685b('0x15'));var logger=require(_0x685b('0x16'))(_0x685b('0x17'));var utils=require(_0x685b('0x18'));var config=require(_0x685b('0x19'));var licenseUtil=require(_0x685b('0x1a'));var db=require(_0x685b('0x1b'))['db'];function respondWithStatusCode(_0x5d3e8b,_0x523e6d){_0x523e6d=_0x523e6d||0xcc;return function(_0x3e0312){if(_0x3e0312){return _0x5d3e8b['sendStatus'](_0x523e6d);}return _0x5d3e8b[_0x685b('0x1c')](_0x523e6d)[_0x685b('0x1d')]();};}function respondWithResult(_0x87a262,_0x581331){_0x581331=_0x581331||0xc8;return function(_0x37f6bd){if(_0x37f6bd){return _0x87a262[_0x685b('0x1c')](_0x581331)['json'](_0x37f6bd);}};}function respondWithFilteredResult(_0x416219,_0x2c7349){return function(_0x3c89ea){if(_0x3c89ea){var _0x4bebac=typeof _0x2c7349[_0x685b('0x1e')]===_0x685b('0x1f')&&typeof _0x2c7349['limit']==='undefined';var _0x22a9e8=_0x3c89ea[_0x685b('0x20')];var _0xfc12ef=_0x4bebac?0x0:_0x2c7349[_0x685b('0x1e')];var _0x5c0b3c=_0x4bebac?_0x3c89ea[_0x685b('0x20')]:_0x2c7349[_0x685b('0x1e')]+_0x2c7349[_0x685b('0x21')];var _0x2a35bd;if(_0x5c0b3c>=_0x22a9e8){_0x5c0b3c=_0x22a9e8;_0x2a35bd=0xc8;}else{_0x2a35bd=0xce;}_0x416219['status'](_0x2a35bd);return _0x416219[_0x685b('0x22')](_0x685b('0x23'),_0xfc12ef+'-'+_0x5c0b3c+'/'+_0x22a9e8)['json'](_0x3c89ea);}return null;};}function patchUpdates(_0x12bffa){return function(_0x2e9c56){try{jsonpatch[_0x685b('0x24')](_0x2e9c56,_0x12bffa,!![]);}catch(_0x2bd6af){return BPromise[_0x685b('0x25')](_0x2bd6af);}return _0x2e9c56['save']();};}function saveUpdates(_0x106e21,_0x431423){return function(_0x234c96){if(_0x234c96){return _0x234c96[_0x685b('0x26')](_0x106e21)[_0x685b('0x27')](function(_0x489bed){return _0x489bed;});}return null;};}function removeEntity(_0x7e3edf,_0x2eb7bc){return function(_0x4f9588){if(_0x4f9588){return _0x4f9588[_0x685b('0x28')]()[_0x685b('0x27')](function(){_0x7e3edf['status'](0xcc)[_0x685b('0x1d')]();});}};}function handleEntityNotFound(_0x4a77ab,_0xe6a326){return function(_0x4fa267){if(!_0x4fa267){_0x4a77ab[_0x685b('0x29')](0x194);}return _0x4fa267;};}function handleError(_0x1fa413,_0x16cf65){_0x16cf65=_0x16cf65||0x1f4;return function(_0x154d6d){logger['error'](_0x154d6d['stack']);if(_0x154d6d[_0x685b('0x2a')]){delete _0x154d6d[_0x685b('0x2a')];}_0x1fa413[_0x685b('0x1c')](_0x16cf65)[_0x685b('0x2b')](_0x154d6d);};}exports[_0x685b('0x2c')]=function(_0x13bbf7,_0x42c0bc){var _0xfb139={},_0x36db7e={},_0x4a7d2b={'count':0x0,'rows':[]};var _0x8b9427=_['map'](db[_0x685b('0x2d')][_0x685b('0x2e')],function(_0x11de7f){return{'name':_0x11de7f[_0x685b('0x2f')],'type':_0x11de7f[_0x685b('0x30')][_0x685b('0x31')]};});_0x36db7e[_0x685b('0x32')]=_[_0x685b('0x33')](_0x8b9427,_0x685b('0x2a'));_0x36db7e[_0x685b('0x34')]=_[_0x685b('0x35')](_0x13bbf7[_0x685b('0x34')]);_0x36db7e[_0x685b('0x36')]=_['intersection'](_0x36db7e[_0x685b('0x32')],_0x36db7e[_0x685b('0x34')]);_0xfb139[_0x685b('0x37')]=_[_0x685b('0x38')](_0x36db7e[_0x685b('0x32')],qs[_0x685b('0x39')](_0x13bbf7[_0x685b('0x34')][_0x685b('0x39')]));_0xfb139['attributes']=_0xfb139[_0x685b('0x37')][_0x685b('0x3a')]?_0xfb139[_0x685b('0x37')]:_0x36db7e['model'];if(!_0x13bbf7[_0x685b('0x34')]['hasOwnProperty'](_0x685b('0x3b'))){_0xfb139[_0x685b('0x21')]=qs[_0x685b('0x21')](_0x13bbf7[_0x685b('0x34')][_0x685b('0x21')]);_0xfb139['offset']=qs[_0x685b('0x1e')](_0x13bbf7[_0x685b('0x34')][_0x685b('0x1e')]);}_0xfb139[_0x685b('0x3c')]=qs[_0x685b('0x3d')](_0x13bbf7[_0x685b('0x34')][_0x685b('0x3d')]);_0xfb139[_0x685b('0x3e')]=qs[_0x685b('0x36')](_[_0x685b('0x3f')](_0x13bbf7[_0x685b('0x34')],_0x36db7e[_0x685b('0x36')]),_0x8b9427);if(_0x13bbf7[_0x685b('0x34')]['filter']){_0xfb139[_0x685b('0x3e')]=_[_0x685b('0x40')](_0xfb139[_0x685b('0x3e')],{'$or':_['map'](_0x8b9427,function(_0x279dfd){if(_0x279dfd[_0x685b('0x30')]!==_0x685b('0x41')){var _0x53ff5f={};_0x53ff5f[_0x279dfd[_0x685b('0x2a')]]={'$like':'%'+_0x13bbf7[_0x685b('0x34')][_0x685b('0x42')]+'%'};return _0x53ff5f;}})});}_0xfb139=_[_0x685b('0x40')]({},_0xfb139,_0x13bbf7[_0x685b('0x43')]);var _0x3b3cdf={'where':_0xfb139[_0x685b('0x3e')]};return db['SugarcrmField'][_0x685b('0x20')](_0x3b3cdf)['then'](function(_0x3750e0){_0x4a7d2b[_0x685b('0x20')]=_0x3750e0;if(_0x13bbf7[_0x685b('0x34')][_0x685b('0x44')]){_0xfb139[_0x685b('0x45')]=[{'all':!![]}];}return db[_0x685b('0x2d')]['findAll'](_0xfb139);})[_0x685b('0x27')](function(_0x52ed7c){_0x4a7d2b['rows']=_0x52ed7c;return _0x4a7d2b;})[_0x685b('0x27')](respondWithFilteredResult(_0x42c0bc,_0xfb139))[_0x685b('0x46')](handleError(_0x42c0bc,null));};exports['show']=function(_0x1d420f,_0x1a6c69){var _0x54e505={'raw':!![],'where':{'id':_0x1d420f[_0x685b('0x47')]['id']}},_0x49a39e={};_0x49a39e[_0x685b('0x32')]=_['keys'](db[_0x685b('0x2d')][_0x685b('0x2e')]);_0x49a39e[_0x685b('0x34')]=_[_0x685b('0x35')](_0x1d420f[_0x685b('0x34')]);_0x49a39e['filters']=_['intersection'](_0x49a39e[_0x685b('0x32')],_0x49a39e[_0x685b('0x34')]);_0x54e505['attributes']=_[_0x685b('0x38')](_0x49a39e[_0x685b('0x32')],qs[_0x685b('0x39')](_0x1d420f[_0x685b('0x34')][_0x685b('0x39')]));_0x54e505[_0x685b('0x37')]=_0x54e505[_0x685b('0x37')][_0x685b('0x3a')]?_0x54e505[_0x685b('0x37')]:_0x49a39e[_0x685b('0x32')];if(_0x1d420f['query'][_0x685b('0x44')]){_0x54e505[_0x685b('0x45')]=[{'all':!![]}];}_0x54e505=_[_0x685b('0x40')]({},_0x54e505,_0x1d420f['options']);return db[_0x685b('0x2d')][_0x685b('0x48')](_0x54e505)['then'](handleEntityNotFound(_0x1a6c69,null))[_0x685b('0x27')](respondWithResult(_0x1a6c69,null))[_0x685b('0x46')](handleError(_0x1a6c69,null));};exports[_0x685b('0x49')]=function(_0x5848bb,_0x58d10c){return db[_0x685b('0x2d')][_0x685b('0x49')](_0x5848bb[_0x685b('0x4a')],{})[_0x685b('0x27')](respondWithResult(_0x58d10c,0xc9))[_0x685b('0x46')](handleError(_0x58d10c,null));};exports[_0x685b('0x26')]=function(_0x6654e0,_0x426011){if(_0x6654e0['body']['id']){delete _0x6654e0[_0x685b('0x4a')]['id'];}return db[_0x685b('0x2d')][_0x685b('0x48')]({'where':{'id':_0x6654e0[_0x685b('0x47')]['id']}})[_0x685b('0x27')](handleEntityNotFound(_0x426011,null))[_0x685b('0x27')](saveUpdates(_0x6654e0[_0x685b('0x4a')],null))[_0x685b('0x27')](respondWithResult(_0x426011,null))[_0x685b('0x46')](handleError(_0x426011,null));};exports[_0x685b('0x28')]=function(_0x3c4b0b,_0xa6a35f){return db[_0x685b('0x2d')][_0x685b('0x48')]({'where':{'id':_0x3c4b0b[_0x685b('0x47')]['id']}})[_0x685b('0x27')](handleEntityNotFound(_0xa6a35f,null))[_0x685b('0x27')](removeEntity(_0xa6a35f,null))[_0x685b('0x46')](handleError(_0xa6a35f,null));}; \ No newline at end of file +var _0xb50b=['hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','then','includeAll','findAll','rows','catch','show','length','include','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','destroy','end','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes'];(function(_0x350277,_0x25d306){var _0x5e418b=function(_0x19c176){while(--_0x19c176){_0x350277['push'](_0x350277['shift']());}};_0x5e418b(++_0x25d306);}(_0xb50b,0xb0));var _0xbb50=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0xb50b[_0x3ad7ad];return _0x225a60;};'use strict';var emlformat=require(_0xbb50('0x0'));var rimraf=require(_0xbb50('0x1'));var zipdir=require(_0xbb50('0x2'));var jsonpatch=require(_0xbb50('0x3'));var rp=require(_0xbb50('0x4'));var moment=require('moment');var BPromise=require(_0xbb50('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbb50('0x6'));var csv=require(_0xbb50('0x7'));var ejs=require(_0xbb50('0x8'));var fs=require('fs');var fs_extra=require(_0xbb50('0x9'));var _=require(_0xbb50('0xa'));var squel=require(_0xbb50('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb50('0xc'));var toCsv=require(_0xbb50('0x7'));var querystring=require(_0xbb50('0xd'));var Papa=require(_0xbb50('0xe'));var Redis=require(_0xbb50('0xf'));var authService=require(_0xbb50('0x10'));var qs=require(_0xbb50('0x11'));var as=require(_0xbb50('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb50('0x13'))(_0xbb50('0x14'));var utils=require(_0xbb50('0x15'));var config=require(_0xbb50('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb50('0x17'))['db'];function respondWithStatusCode(_0x2aa5f0,_0x3ce090){_0x3ce090=_0x3ce090||0xcc;return function(_0x2f8d9a){if(_0x2f8d9a){return _0x2aa5f0[_0xbb50('0x18')](_0x3ce090);}return _0x2aa5f0[_0xbb50('0x19')](_0x3ce090)['end']();};}function respondWithResult(_0xd7fe5f,_0x471361){_0x471361=_0x471361||0xc8;return function(_0x147e32){if(_0x147e32){return _0xd7fe5f['status'](_0x471361)['json'](_0x147e32);}};}function respondWithFilteredResult(_0x4e8163,_0x4c6fb2){return function(_0x5e97cb){if(_0x5e97cb){var _0x5ebd3f=typeof _0x4c6fb2['offset']==='undefined'&&typeof _0x4c6fb2['limit']==='undefined';var _0x2bea6a=_0x5e97cb['count'];var _0x3f9d47=_0x5ebd3f?0x0:_0x4c6fb2[_0xbb50('0x1a')];var _0x46ddbc=_0x5ebd3f?_0x5e97cb[_0xbb50('0x1b')]:_0x4c6fb2[_0xbb50('0x1a')]+_0x4c6fb2[_0xbb50('0x1c')];var _0x1a83ea;if(_0x46ddbc>=_0x2bea6a){_0x46ddbc=_0x2bea6a;_0x1a83ea=0xc8;}else{_0x1a83ea=0xce;}_0x4e8163[_0xbb50('0x19')](_0x1a83ea);return _0x4e8163[_0xbb50('0x1d')](_0xbb50('0x1e'),_0x3f9d47+'-'+_0x46ddbc+'/'+_0x2bea6a)[_0xbb50('0x1f')](_0x5e97cb);}return null;};}function patchUpdates(_0x234ef5){return function(_0x4baa0f){try{jsonpatch[_0xbb50('0x20')](_0x4baa0f,_0x234ef5,!![]);}catch(_0x2e2a91){return BPromise[_0xbb50('0x21')](_0x2e2a91);}return _0x4baa0f[_0xbb50('0x22')]();};}function saveUpdates(_0x37bc56,_0x5939c4){return function(_0x5e91d8){if(_0x5e91d8){return _0x5e91d8['update'](_0x37bc56)['then'](function(_0x5ca4ac){return _0x5ca4ac;});}return null;};}function removeEntity(_0xa17891,_0x3ee1c7){return function(_0x3a547c){if(_0x3a547c){return _0x3a547c[_0xbb50('0x23')]()['then'](function(){_0xa17891[_0xbb50('0x19')](0xcc)[_0xbb50('0x24')]();});}};}function handleEntityNotFound(_0x15f23b,_0x104f70){return function(_0xd47f39){if(!_0xd47f39){_0x15f23b[_0xbb50('0x18')](0x194);}return _0xd47f39;};}function handleError(_0x1f3fef,_0x1af659){_0x1af659=_0x1af659||0x1f4;return function(_0x271ff3){logger['error'](_0x271ff3['stack']);if(_0x271ff3[_0xbb50('0x25')]){delete _0x271ff3[_0xbb50('0x25')];}_0x1f3fef[_0xbb50('0x19')](_0x1af659)[_0xbb50('0x26')](_0x271ff3);};}exports[_0xbb50('0x27')]=function(_0x3a1b91,_0x522dda){var _0x298453={},_0x4bbebb={},_0x46dc9d={'count':0x0,'rows':[]};var _0x584a0d=_[_0xbb50('0x28')](db[_0xbb50('0x29')][_0xbb50('0x2a')],function(_0x1bc1b8){return{'name':_0x1bc1b8[_0xbb50('0x2b')],'type':_0x1bc1b8[_0xbb50('0x2c')][_0xbb50('0x2d')]};});_0x4bbebb[_0xbb50('0x2e')]=_[_0xbb50('0x28')](_0x584a0d,_0xbb50('0x25'));_0x4bbebb[_0xbb50('0x2f')]=_[_0xbb50('0x30')](_0x3a1b91[_0xbb50('0x2f')]);_0x4bbebb['filters']=_['intersection'](_0x4bbebb[_0xbb50('0x2e')],_0x4bbebb[_0xbb50('0x2f')]);_0x298453['attributes']=_[_0xbb50('0x31')](_0x4bbebb[_0xbb50('0x2e')],qs[_0xbb50('0x32')](_0x3a1b91[_0xbb50('0x2f')]['fields']));_0x298453[_0xbb50('0x33')]=_0x298453['attributes']['length']?_0x298453[_0xbb50('0x33')]:_0x4bbebb[_0xbb50('0x2e')];if(!_0x3a1b91['query'][_0xbb50('0x34')](_0xbb50('0x35'))){_0x298453[_0xbb50('0x1c')]=qs[_0xbb50('0x1c')](_0x3a1b91[_0xbb50('0x2f')][_0xbb50('0x1c')]);_0x298453[_0xbb50('0x1a')]=qs['offset'](_0x3a1b91[_0xbb50('0x2f')][_0xbb50('0x1a')]);}_0x298453[_0xbb50('0x36')]=qs[_0xbb50('0x37')](_0x3a1b91['query'][_0xbb50('0x37')]);_0x298453[_0xbb50('0x38')]=qs[_0xbb50('0x39')](_[_0xbb50('0x3a')](_0x3a1b91[_0xbb50('0x2f')],_0x4bbebb[_0xbb50('0x39')]),_0x584a0d);if(_0x3a1b91[_0xbb50('0x2f')]['filter']){_0x298453[_0xbb50('0x38')]=_[_0xbb50('0x3b')](_0x298453[_0xbb50('0x38')],{'$or':_[_0xbb50('0x28')](_0x584a0d,function(_0x2a8b95){if(_0x2a8b95[_0xbb50('0x2c')]!==_0xbb50('0x3c')){var _0x3e7fa0={};_0x3e7fa0[_0x2a8b95[_0xbb50('0x25')]]={'$like':'%'+_0x3a1b91[_0xbb50('0x2f')][_0xbb50('0x3d')]+'%'};return _0x3e7fa0;}})});}_0x298453=_[_0xbb50('0x3b')]({},_0x298453,_0x3a1b91[_0xbb50('0x3e')]);var _0x5361dc={'where':_0x298453[_0xbb50('0x38')]};return db[_0xbb50('0x29')][_0xbb50('0x1b')](_0x5361dc)[_0xbb50('0x3f')](function(_0xdbb4dd){_0x46dc9d[_0xbb50('0x1b')]=_0xdbb4dd;if(_0x3a1b91[_0xbb50('0x2f')][_0xbb50('0x40')]){_0x298453['include']=[{'all':!![]}];}return db[_0xbb50('0x29')][_0xbb50('0x41')](_0x298453);})[_0xbb50('0x3f')](function(_0x4ce5fc){_0x46dc9d[_0xbb50('0x42')]=_0x4ce5fc;return _0x46dc9d;})[_0xbb50('0x3f')](respondWithFilteredResult(_0x522dda,_0x298453))[_0xbb50('0x43')](handleError(_0x522dda,null));};exports[_0xbb50('0x44')]=function(_0x17ba29,_0xc01b93){var _0x25123a={'raw':!![],'where':{'id':_0x17ba29['params']['id']}},_0x4c5ee4={};_0x4c5ee4['model']=_[_0xbb50('0x30')](db[_0xbb50('0x29')]['rawAttributes']);_0x4c5ee4[_0xbb50('0x2f')]=_['keys'](_0x17ba29[_0xbb50('0x2f')]);_0x4c5ee4[_0xbb50('0x39')]=_['intersection'](_0x4c5ee4[_0xbb50('0x2e')],_0x4c5ee4[_0xbb50('0x2f')]);_0x25123a['attributes']=_[_0xbb50('0x31')](_0x4c5ee4[_0xbb50('0x2e')],qs[_0xbb50('0x32')](_0x17ba29[_0xbb50('0x2f')][_0xbb50('0x32')]));_0x25123a['attributes']=_0x25123a[_0xbb50('0x33')][_0xbb50('0x45')]?_0x25123a[_0xbb50('0x33')]:_0x4c5ee4['model'];if(_0x17ba29['query'][_0xbb50('0x40')]){_0x25123a[_0xbb50('0x46')]=[{'all':!![]}];}_0x25123a=_[_0xbb50('0x3b')]({},_0x25123a,_0x17ba29['options']);return db[_0xbb50('0x29')]['find'](_0x25123a)[_0xbb50('0x3f')](handleEntityNotFound(_0xc01b93,null))[_0xbb50('0x3f')](respondWithResult(_0xc01b93,null))['catch'](handleError(_0xc01b93,null));};exports[_0xbb50('0x47')]=function(_0x4e3787,_0x4753a8){return db['SugarcrmField']['create'](_0x4e3787[_0xbb50('0x48')],{})['then'](respondWithResult(_0x4753a8,0xc9))['catch'](handleError(_0x4753a8,null));};exports[_0xbb50('0x49')]=function(_0xe2a344,_0x4f55c3){if(_0xe2a344[_0xbb50('0x48')]['id']){delete _0xe2a344[_0xbb50('0x48')]['id'];}return db[_0xbb50('0x29')][_0xbb50('0x4a')]({'where':{'id':_0xe2a344[_0xbb50('0x4b')]['id']}})[_0xbb50('0x3f')](handleEntityNotFound(_0x4f55c3,null))[_0xbb50('0x3f')](saveUpdates(_0xe2a344[_0xbb50('0x48')],null))[_0xbb50('0x3f')](respondWithResult(_0x4f55c3,null))[_0xbb50('0x43')](handleError(_0x4f55c3,null));};exports[_0xbb50('0x23')]=function(_0x518e6c,_0x391a72){return db[_0xbb50('0x29')][_0xbb50('0x4a')]({'where':{'id':_0x518e6c['params']['id']}})[_0xbb50('0x3f')](handleEntityNotFound(_0x391a72,null))['then'](removeEntity(_0x391a72,null))[_0xbb50('0x43')](handleError(_0x391a72,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 717c578..15e4be8 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 _0x969a=['./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x318a8f,_0x6c0fcb){var _0x39e800=function(_0x4ae30b){while(--_0x4ae30b){_0x318a8f['push'](_0x318a8f['shift']());}};_0x39e800(++_0x6c0fcb);}(_0x969a,0x150));var _0xa969=function(_0x689ac0,_0x2db497){_0x689ac0=_0x689ac0-0x0;var _0x444fcc=_0x969a[_0x689ac0];return _0x444fcc;};'use strict';var _=require('lodash');var util=require(_0xa969('0x0'));var logger=require(_0xa969('0x1'))('api');var moment=require(_0xa969('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa969('0x3'));var config=require(_0xa969('0x4'));var attributes=require(_0xa969('0x5'));module['exports']=function(_0x9dbf8d,_0x46d773){return _0x9dbf8d[_0xa969('0x6')](_0xa969('0x7'),attributes,{'tableName':_0xa969('0x8'),'paranoid':![],'indexes':[{'name':_0xa969('0x9'),'fields':[_0xa969('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x764e=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','FieldId','lodash'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0x764e,0x14f));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe764('0x0'));var util=require(_0xe764('0x1'));var logger=require(_0xe764('0x2'))(_0xe764('0x3'));var moment=require(_0xe764('0x4'));var BPromise=require('bluebird');var rp=require(_0xe764('0x5'));var fs=require('fs');var path=require(_0xe764('0x6'));var rimraf=require(_0xe764('0x7'));var config=require('../../config/environment');var attributes=require(_0xe764('0x8'));module[_0xe764('0x9')]=function(_0x30df1c,_0x4cdb95){return _0x30df1c[_0xe764('0xa')](_0xe764('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xe764('0xc'),'fields':['idField',_0xe764('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 45a0b64..e803579 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 _0x782e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','SugarcrmField,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x558c4e,_0x5f57f8){var _0x3ccaba=function(_0x535a9){while(--_0x535a9){_0x558c4e['push'](_0x558c4e['shift']());}};_0x3ccaba(++_0x5f57f8);}(_0x782e,0x144));var _0xe782=function(_0x14dc15,_0x1beb27){_0x14dc15=_0x14dc15-0x0;var _0x1656c4=_0x782e[_0x14dc15];return _0x1656c4;};'use strict';var _=require('lodash');var util=require(_0xe782('0x0'));var moment=require(_0xe782('0x1'));var BPromise=require(_0xe782('0x2'));var rs=require(_0xe782('0x3'));var fs=require('fs');var Redis=require(_0xe782('0x4'));var db=require(_0xe782('0x5'))['db'];var utils=require(_0xe782('0x6'));var logger=require(_0xe782('0x7'))(_0xe782('0x8'));var config=require(_0xe782('0x9'));var jayson=require(_0xe782('0xa'));var client=jayson[_0xe782('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141092,_0x526291,_0x16c04e){return new BPromise(function(_0x3dc4a2,_0x509e6d){return client[_0xe782('0xc')](_0x141092,_0x16c04e)[_0xe782('0xd')](function(_0x29bd6c){logger[_0xe782('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x526291,'request\x20sent');logger['debug'](_0xe782('0xf'),_0x526291,_0xe782('0x10'),JSON['stringify'](_0x29bd6c));if(_0x29bd6c[_0xe782('0x11')]){if(_0x29bd6c[_0xe782('0x11')]['code']===0x1f4){logger[_0xe782('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x526291,_0x29bd6c[_0xe782('0x11')][_0xe782('0x12')]);return _0x509e6d(_0x29bd6c[_0xe782('0x11')][_0xe782('0x12')]);}logger[_0xe782('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x526291,_0x29bd6c['error'][_0xe782('0x12')]);return _0x3dc4a2(_0x29bd6c['error'][_0xe782('0x12')]);}else{logger[_0xe782('0xe')](_0xe782('0x13'),_0x526291,_0xe782('0x10'));_0x3dc4a2(_0x29bd6c[_0xe782('0x14')][_0xe782('0x12')]);}})[_0xe782('0x15')](function(_0x3c02b9){logger[_0xe782('0x11')](_0xe782('0x13'),_0x526291,_0x3c02b9);_0x509e6d(_0x3c02b9);});});} \ No newline at end of file +var _0x8bd6=['rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','../../config/utils','../../config/logger'];(function(_0x4b1873,_0x109bd8){var _0x27270f=function(_0xaace04){while(--_0xaace04){_0x4b1873['push'](_0x4b1873['shift']());}};_0x27270f(++_0x109bd8);}(_0x8bd6,0x19e));var _0x68bd=function(_0x2202e1,_0x5927a7){_0x2202e1=_0x2202e1-0x0;var _0x5e127f=_0x8bd6[_0x2202e1];return _0x5e127f;};'use strict';var _=require(_0x68bd('0x0'));var util=require('util');var moment=require(_0x68bd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x68bd('0x2'));var logger=require(_0x68bd('0x3'))(_0x68bd('0x4'));var config=require(_0x68bd('0x5'));var jayson=require(_0x68bd('0x6'));var client=jayson['client'][_0x68bd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2264e6,_0x156641,_0x1b865c){return new BPromise(function(_0x78d452,_0x4b4b1a){return client[_0x68bd('0x8')](_0x2264e6,_0x1b865c)[_0x68bd('0x9')](function(_0x56772a){logger[_0x68bd('0xa')](_0x68bd('0xb'),_0x156641,'request\x20sent');logger[_0x68bd('0xc')](_0x68bd('0xd'),_0x156641,_0x68bd('0xe'),JSON['stringify'](_0x56772a));if(_0x56772a[_0x68bd('0xf')]){if(_0x56772a[_0x68bd('0xf')][_0x68bd('0x10')]===0x1f4){logger[_0x68bd('0xf')](_0x68bd('0xb'),_0x156641,_0x56772a[_0x68bd('0xf')]['message']);return _0x4b4b1a(_0x56772a[_0x68bd('0xf')][_0x68bd('0x11')]);}logger[_0x68bd('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x156641,_0x56772a[_0x68bd('0xf')]['message']);return _0x78d452(_0x56772a[_0x68bd('0xf')][_0x68bd('0x11')]);}else{logger[_0x68bd('0xa')](_0x68bd('0xb'),_0x156641,_0x68bd('0xe'));_0x78d452(_0x56772a[_0x68bd('0x12')][_0x68bd('0x11')]);}})['catch'](function(_0x5b79ee){logger[_0x68bd('0xf')](_0x68bd('0xb'),_0x156641,_0x5b79ee);_0x4b4b1a(_0x5b79ee);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 748d917..12b5d22 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 _0x4784=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x2f36b2,_0x8b9cf9){var _0x10439e=function(_0x5973c0){while(--_0x5973c0){_0x2f36b2['push'](_0x2f36b2['shift']());}};_0x10439e(++_0x8b9cf9);}(_0x4784,0xe4));var _0x4478=function(_0x313889,_0x1b05b8){_0x313889=_0x313889-0x0;var _0x421322=_0x4784[_0x313889];return _0x421322;};'use strict';var multer=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var path=require(_0x4478('0x2'));var timeout=require(_0x4478('0x3'));var express=require(_0x4478('0x4'));var router=express[_0x4478('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4478('0x6'));var interaction=require(_0x4478('0x7'));var config=require(_0x4478('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x4478('0x9')]('/',auth['isAuthenticated'](),controller[_0x4478('0xa')]);router['get'](_0x4478('0xb'),auth[_0x4478('0xc')](),controller[_0x4478('0xd')]);router[_0x4478('0x9')](_0x4478('0xe'),auth['isAuthenticated'](),controller[_0x4478('0xf')]);router[_0x4478('0x9')](_0x4478('0x10'),auth[_0x4478('0xc')](),controller[_0x4478('0x11')]);router[_0x4478('0x12')]('/',auth[_0x4478('0xc')](),controller['create']);router[_0x4478('0x12')](_0x4478('0xe'),auth[_0x4478('0xc')](),controller[_0x4478('0x13')]);router[_0x4478('0x14')](_0x4478('0xb'),auth['isAuthenticated'](),controller[_0x4478('0x15')]);router[_0x4478('0x16')](_0x4478('0xb'),auth[_0x4478('0xc')](),controller[_0x4478('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0884=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var path=require(_0x4088('0x2'));var timeout=require(_0x4088('0x3'));var express=require(_0x4088('0x4'));var router=express[_0x4088('0x5')]();var fs_extra=require(_0x4088('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4088('0x7'));var config=require(_0x4088('0x8'));var controller=require(_0x4088('0x9'));router[_0x4088('0xa')]('/',auth[_0x4088('0xb')](),controller['index']);router['get'](_0x4088('0xc'),auth['isAuthenticated'](),controller[_0x4088('0xd')]);router[_0x4088('0xa')](_0x4088('0xe'),auth[_0x4088('0xb')](),controller[_0x4088('0xf')]);router[_0x4088('0xa')](_0x4088('0x10'),auth[_0x4088('0xb')](),controller[_0x4088('0x11')]);router['post']('/',auth[_0x4088('0xb')](),controller[_0x4088('0x12')]);router[_0x4088('0x13')]('/:id/configurations',auth[_0x4088('0xb')](),controller[_0x4088('0x14')]);router['put'](_0x4088('0xc'),auth[_0x4088('0xb')](),controller[_0x4088('0x15')]);router[_0x4088('0x16')](_0x4088('0xc'),auth[_0x4088('0xb')](),controller[_0x4088('0x17')]);module[_0x4088('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 12d0ed3..9e81329 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 _0x542f=['exports','STRING','HelpDesk','sequelize'];(function(_0x326493,_0x2ad84f){var _0x3872e9=function(_0x1cddc9){while(--_0x1cddc9){_0x326493['push'](_0x326493['shift']());}};_0x3872e9(++_0x2ad84f);}(_0x542f,0x19f));var _0xf542=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x542f[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require(_0xf542('0x0'));module[_0xf542('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf542('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf542('0x3')},'remoteUri':{'type':Sequelize[_0xf542('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf542('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf542('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc47d=['STRING'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0xc47d,0x14d));var _0xdc47=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xc47d[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdc47('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xdc47('0x0')]},'username':{'type':Sequelize[_0xdc47('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xdc47('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xdc47('0x0')],'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 e242b58..a0fdde5 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 _0x83b5=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','findOne','getConfigurations','addConfiguration','AccountId','getSubjects','channel','getDescriptions','VtigerConfiguration','Subjects','Descriptions','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','log','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','test','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','index','VtigerAccount','rawAttributes','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83b5,0x1b1));var _0x583b=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x83b5[_0x10b48a];return _0x2c4533;};'use strict';var emlformat=require(_0x583b('0x0'));var rimraf=require(_0x583b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x583b('0x2'));var rp=require(_0x583b('0x3'));var moment=require(_0x583b('0x4'));var BPromise=require(_0x583b('0x5'));var Mustache=require(_0x583b('0x6'));var util=require(_0x583b('0x7'));var path=require(_0x583b('0x8'));var sox=require(_0x583b('0x9'));var csv=require(_0x583b('0xa'));var ejs=require(_0x583b('0xb'));var fs=require('fs');var fs_extra=require(_0x583b('0xc'));var _=require(_0x583b('0xd'));var squel=require(_0x583b('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x583b('0xf'));var toCsv=require(_0x583b('0xa'));var querystring=require(_0x583b('0x10'));var Papa=require('papaparse');var Redis=require(_0x583b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x583b('0x12'));var as=require(_0x583b('0x13'));var hardwareService=require(_0x583b('0x14'));var logger=require(_0x583b('0x15'))('api');var utils=require(_0x583b('0x16'));var config=require(_0x583b('0x17'));var licenseUtil=require(_0x583b('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x583b('0x19'));function respondWithStatusCode(_0x26ddd5,_0x1ecaf4){_0x1ecaf4=_0x1ecaf4||0xcc;return function(_0x63863a){if(_0x63863a){return _0x26ddd5[_0x583b('0x1a')](_0x1ecaf4);}return _0x26ddd5[_0x583b('0x1b')](_0x1ecaf4)[_0x583b('0x1c')]();};}function respondWithResult(_0x233a1b,_0x4ba732){_0x4ba732=_0x4ba732||0xc8;return function(_0x2d7499){if(_0x2d7499){return _0x233a1b[_0x583b('0x1b')](_0x4ba732)[_0x583b('0x1d')](_0x2d7499);}};}function respondWithFilteredResult(_0x4ccc23,_0x167661){return function(_0xcb011e){if(_0xcb011e){var _0x4bc4a6=typeof _0x167661[_0x583b('0x1e')]===_0x583b('0x1f')&&typeof _0x167661[_0x583b('0x20')]===_0x583b('0x1f');var _0x7a75ba=_0xcb011e[_0x583b('0x21')];var _0x361e8a=_0x4bc4a6?0x0:_0x167661[_0x583b('0x1e')];var _0x498f6d=_0x4bc4a6?_0xcb011e['count']:_0x167661[_0x583b('0x1e')]+_0x167661[_0x583b('0x20')];var _0x4a2536;if(_0x498f6d>=_0x7a75ba){_0x498f6d=_0x7a75ba;_0x4a2536=0xc8;}else{_0x4a2536=0xce;}_0x4ccc23[_0x583b('0x1b')](_0x4a2536);return _0x4ccc23[_0x583b('0x22')](_0x583b('0x23'),_0x361e8a+'-'+_0x498f6d+'/'+_0x7a75ba)[_0x583b('0x1d')](_0xcb011e);}return null;};}function patchUpdates(_0x38054d){return function(_0x3a246e){try{jsonpatch[_0x583b('0x24')](_0x3a246e,_0x38054d,!![]);}catch(_0x205f40){return BPromise[_0x583b('0x25')](_0x205f40);}return _0x3a246e[_0x583b('0x26')]();};}function saveUpdates(_0x483b42,_0x71ca0f){return function(_0x42c76c){if(_0x42c76c){return _0x42c76c['update'](_0x483b42)[_0x583b('0x27')](function(_0x3876d7){return _0x3876d7;});}return null;};}function removeEntity(_0x24d1de,_0x252caf){return function(_0x1257f9){if(_0x1257f9){return _0x1257f9['destroy']()[_0x583b('0x27')](function(){_0x24d1de[_0x583b('0x1b')](0xcc)[_0x583b('0x1c')]();});}};}function handleEntityNotFound(_0x19ae1c,_0x304b15){return function(_0x34a545){if(!_0x34a545){_0x19ae1c[_0x583b('0x1a')](0x194);}return _0x34a545;};}function handleError(_0x22f7ee,_0x104162){_0x104162=_0x104162||0x1f4;return function(_0x57a59c){logger['error'](_0x57a59c[_0x583b('0x28')]);if(_0x57a59c['name']){delete _0x57a59c['name'];}_0x22f7ee['status'](_0x104162)['send'](_0x57a59c);};}exports[_0x583b('0x29')]=function(_0x3b25ce,_0x30639b){var _0x1031ad={},_0x144a6b={},_0x40d50f={'count':0x0,'rows':[]};var _0x218602=_['map'](db[_0x583b('0x2a')][_0x583b('0x2b')],function(_0x13a6f3){return{'name':_0x13a6f3['fieldName'],'type':_0x13a6f3[_0x583b('0x2c')][_0x583b('0x2d')]};});_0x144a6b[_0x583b('0x2e')]=_[_0x583b('0x2f')](_0x218602,_0x583b('0x30'));_0x144a6b[_0x583b('0x31')]=_['keys'](_0x3b25ce['query']);_0x144a6b[_0x583b('0x32')]=_[_0x583b('0x33')](_0x144a6b[_0x583b('0x2e')],_0x144a6b['query']);_0x1031ad[_0x583b('0x34')]=_[_0x583b('0x33')](_0x144a6b[_0x583b('0x2e')],qs[_0x583b('0x35')](_0x3b25ce[_0x583b('0x31')][_0x583b('0x35')]));_0x1031ad[_0x583b('0x34')]=_0x1031ad[_0x583b('0x34')][_0x583b('0x36')]?_0x1031ad[_0x583b('0x34')]:_0x144a6b[_0x583b('0x2e')];if(!_0x3b25ce[_0x583b('0x31')][_0x583b('0x37')](_0x583b('0x38'))){_0x1031ad[_0x583b('0x20')]=qs['limit'](_0x3b25ce[_0x583b('0x31')]['limit']);_0x1031ad[_0x583b('0x1e')]=qs[_0x583b('0x1e')](_0x3b25ce['query'][_0x583b('0x1e')]);}_0x1031ad[_0x583b('0x39')]=qs[_0x583b('0x3a')](_0x3b25ce[_0x583b('0x31')]['sort']);_0x1031ad[_0x583b('0x3b')]=qs['filters'](_[_0x583b('0x3c')](_0x3b25ce['query'],_0x144a6b['filters']),_0x218602);if(_0x3b25ce[_0x583b('0x31')][_0x583b('0x3d')]){_0x1031ad[_0x583b('0x3b')]=_[_0x583b('0x3e')](_0x1031ad[_0x583b('0x3b')],{'$or':_[_0x583b('0x2f')](_0x218602,function(_0x466ca5){if(_0x466ca5[_0x583b('0x2c')]!==_0x583b('0x3f')){var _0x38f831={};_0x38f831[_0x466ca5[_0x583b('0x30')]]={'$like':'%'+_0x3b25ce[_0x583b('0x31')][_0x583b('0x3d')]+'%'};return _0x38f831;}})});}_0x1031ad=_['merge']({},_0x1031ad,_0x3b25ce[_0x583b('0x40')]);var _0x2c5fbe={'where':_0x1031ad[_0x583b('0x3b')]};return db['VtigerAccount'][_0x583b('0x21')](_0x2c5fbe)[_0x583b('0x27')](function(_0x2f63fc){_0x40d50f[_0x583b('0x21')]=_0x2f63fc;if(_0x3b25ce[_0x583b('0x31')][_0x583b('0x41')]){_0x1031ad[_0x583b('0x42')]=[{'all':!![]}];}return db[_0x583b('0x2a')][_0x583b('0x43')](_0x1031ad);})[_0x583b('0x27')](function(_0x2b8ce6){_0x40d50f[_0x583b('0x44')]=_0x2b8ce6;return _0x40d50f;})[_0x583b('0x27')](respondWithFilteredResult(_0x30639b,_0x1031ad))[_0x583b('0x45')](handleError(_0x30639b,null));};exports[_0x583b('0x46')]=function(_0x184235,_0x14aaee){var _0x3a50f7={'raw':![],'where':{'id':_0x184235[_0x583b('0x47')]['id']}},_0x30a580={};_0x30a580['model']=_['keys'](db[_0x583b('0x2a')][_0x583b('0x2b')]);_0x30a580[_0x583b('0x31')]=_[_0x583b('0x48')](_0x184235[_0x583b('0x31')]);_0x30a580[_0x583b('0x32')]=_['intersection'](_0x30a580[_0x583b('0x2e')],_0x30a580[_0x583b('0x31')]);_0x3a50f7[_0x583b('0x34')]=_['intersection'](_0x30a580['model'],qs[_0x583b('0x35')](_0x184235[_0x583b('0x31')][_0x583b('0x35')]));_0x3a50f7[_0x583b('0x34')]=_0x3a50f7[_0x583b('0x34')]['length']?_0x3a50f7[_0x583b('0x34')]:_0x30a580[_0x583b('0x2e')];if(_0x184235[_0x583b('0x31')]['includeAll']){_0x3a50f7['include']=[{'all':!![]}];}_0x3a50f7=_[_0x583b('0x3e')]({},_0x3a50f7,_0x184235[_0x583b('0x40')]);return db[_0x583b('0x2a')][_0x583b('0x49')](_0x3a50f7)['then'](handleEntityNotFound(_0x14aaee,null))[_0x583b('0x27')](respondWithResult(_0x14aaee,null))[_0x583b('0x45')](handleError(_0x14aaee,null));};exports[_0x583b('0x4a')]=function(_0x3917b2,_0xe762a4){return db[_0x583b('0x2a')][_0x583b('0x4a')](_0x3917b2[_0x583b('0x4b')],{})[_0x583b('0x27')](respondWithResult(_0xe762a4,0xc9))[_0x583b('0x45')](handleError(_0xe762a4,null));};exports['update']=function(_0x10d305,_0x3c99f6){if(_0x10d305[_0x583b('0x4b')]['id']){delete _0x10d305['body']['id'];}return db['VtigerAccount'][_0x583b('0x49')]({'where':{'id':_0x10d305['params']['id']}})[_0x583b('0x27')](handleEntityNotFound(_0x3c99f6,null))[_0x583b('0x27')](saveUpdates(_0x10d305[_0x583b('0x4b')],null))[_0x583b('0x27')](respondWithResult(_0x3c99f6,null))[_0x583b('0x45')](handleError(_0x3c99f6,null));};exports[_0x583b('0x4c')]=function(_0x1f431e,_0x1053f5){return db[_0x583b('0x2a')][_0x583b('0x49')]({'where':{'id':_0x1f431e[_0x583b('0x47')]['id']}})[_0x583b('0x27')](handleEntityNotFound(_0x1053f5,null))[_0x583b('0x27')](removeEntity(_0x1053f5,null))[_0x583b('0x45')](handleError(_0x1053f5,null));};exports['getConfigurations']=function(_0x333f92,_0x14ec77,_0x66a812){var _0x2b8fea={};var _0x320ab3={};var _0x1ee350;var _0x29dfe7;return db[_0x583b('0x2a')][_0x583b('0x4d')]({'where':{'id':_0x333f92['params']['id']}})['then'](handleEntityNotFound(_0x14ec77,null))[_0x583b('0x27')](function(_0x30a9a9){if(_0x30a9a9){_0x1ee350=_0x30a9a9;_0x320ab3['model']=_['keys'](db['VtigerConfiguration'][_0x583b('0x2b')]);_0x320ab3[_0x583b('0x31')]=_[_0x583b('0x48')](_0x333f92[_0x583b('0x31')]);_0x320ab3[_0x583b('0x32')]=_[_0x583b('0x33')](_0x320ab3[_0x583b('0x2e')],_0x320ab3['query']);_0x2b8fea['attributes']=_[_0x583b('0x33')](_0x320ab3[_0x583b('0x2e')],qs[_0x583b('0x35')](_0x333f92[_0x583b('0x31')][_0x583b('0x35')]));_0x2b8fea[_0x583b('0x34')]=_0x2b8fea[_0x583b('0x34')][_0x583b('0x36')]?_0x2b8fea[_0x583b('0x34')]:_0x320ab3[_0x583b('0x2e')];_0x2b8fea[_0x583b('0x39')]=qs[_0x583b('0x3a')](_0x333f92['query'][_0x583b('0x3a')]);_0x2b8fea[_0x583b('0x3b')]=qs['filters'](_['pick'](_0x333f92[_0x583b('0x31')],_0x320ab3['filters']));if(_0x333f92[_0x583b('0x31')][_0x583b('0x3d')]){_0x2b8fea['where']=_[_0x583b('0x3e')](_0x2b8fea[_0x583b('0x3b')],{'$or':_['map'](_0x2b8fea[_0x583b('0x34')],function(_0xb80ac8){var _0x4a60dd={};_0x4a60dd[_0xb80ac8]={'$like':'%'+_0x333f92[_0x583b('0x31')][_0x583b('0x3d')]+'%'};return _0x4a60dd;})});}_0x2b8fea=_['merge']({},_0x2b8fea,_0x333f92[_0x583b('0x40')]);return _0x1ee350[_0x583b('0x4e')](_0x2b8fea);}})[_0x583b('0x27')](function(_0x49d559){if(_0x49d559){_0x29dfe7=_0x49d559[_0x583b('0x36')];if(!_0x333f92[_0x583b('0x31')][_0x583b('0x37')](_0x583b('0x38'))){_0x2b8fea[_0x583b('0x20')]=qs['limit'](_0x333f92[_0x583b('0x31')]['limit']);_0x2b8fea['offset']=qs['offset'](_0x333f92['query'][_0x583b('0x1e')]);}return _0x1ee350[_0x583b('0x4e')](_0x2b8fea);}})['then'](function(_0x673978){if(_0x673978){return _0x673978?{'count':_0x29dfe7,'rows':_0x673978}:null;}})['then'](respondWithResult(_0x14ec77,null))[_0x583b('0x45')](handleError(_0x14ec77,null));};exports[_0x583b('0x4f')]=function(_0x3cb623,_0x1a7d3b,_0x47d086){if(_0x3cb623[_0x583b('0x4b')]['id']){delete _0x3cb623[_0x583b('0x4b')]['id'];}return db[_0x583b('0x2a')][_0x583b('0x4d')]({'where':{'id':_0x3cb623[_0x583b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a7d3b,null))[_0x583b('0x27')](function(_0x2e0c95){if(_0x2e0c95){_0x3cb623['body'][_0x583b('0x50')]=_0x2e0c95['id'];_0x3cb623[_0x583b('0x4b')]['Subjects']=integrations[_0x583b('0x51')](_0x3cb623['body'][_0x583b('0x52')],_0x3cb623[_0x583b('0x4b')][_0x583b('0x2c')]);_0x3cb623[_0x583b('0x4b')]['Descriptions']=integrations[_0x583b('0x53')](_0x3cb623[_0x583b('0x4b')][_0x583b('0x52')],_0x3cb623[_0x583b('0x4b')][_0x583b('0x2c')]);return db[_0x583b('0x54')]['create'](_0x3cb623[_0x583b('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0x583b('0x55')},{'model':db['VtigerField'],'as':_0x583b('0x56')}]});}return null;})[_0x583b('0x27')](respondWithResult(_0x1a7d3b,null))[_0x583b('0x45')](handleError(_0x1a7d3b,null));};var md5=require(_0x583b('0x57'));exports['getFields']=function(_0x522353,_0x1bc9c9,_0x1d2102){var _0x3d35d6=null;var _0x54f9a3=null;var _0x4e196f=null;var _0x7a5b2c=null;var _0x1533a8='';return db['VtigerAccount'][_0x583b('0x4d')]({'where':{'id':_0x522353[_0x583b('0x47')]['id']},'attributes':['id','name',_0x583b('0x58'),_0x583b('0x59'),_0x583b('0x5a'),_0x583b('0x5b'),_0x583b('0x5c'),_0x583b('0x5d')]})['then'](handleEntityNotFound(_0x1bc9c9,null))['then'](function(_0x44cef3){if(_0x44cef3){_0x3d35d6=_0x44cef3[_0x583b('0x58')];_0x54f9a3=_0x44cef3[_0x583b('0x5d')];_0x4e196f=_0x44cef3[_0x583b('0x5a')];_0x1533a8=_0x44cef3[_0x583b('0x5b')];var _0x48edd7=_0x1533a8[_0x583b('0x5e')](-0x1);if(_0x48edd7==='/'){_0x1533a8=_0x1533a8[_0x583b('0x5f')](0x0,_0x1533a8['lastIndexOf'](_0x48edd7));}_0x7a5b2c=util[_0x583b('0x60')]('%s/webservice.php',_0x1533a8);var _0x4ac96d={'method':_0x583b('0x61'),'uri':_0x7a5b2c,'qs':{'operation':_0x583b('0x62'),'username':_0x44cef3['username']},'json':!![]};return rp(_0x4ac96d);}})[_0x583b('0x27')](function(_0x26496f){if(_0x26496f[_0x583b('0x63')]){var _0x234a52={'method':_0x583b('0x64'),'uri':_0x7a5b2c,'form':{'operation':_0x583b('0x65'),'username':_0x3d35d6,'accessKey':md5(_0x26496f[_0x583b('0x66')][_0x583b('0x67')]+_0x54f9a3)},'json':!![]};return rp(_0x234a52);}})[_0x583b('0x27')](function(_0x31b6ce){if(_0x31b6ce[_0x583b('0x63')]){var _0xb96df7={'method':'GET','uri':_0x7a5b2c,'qs':{'operation':_0x583b('0x68'),'username':_0x3d35d6,'sessionName':_0x31b6ce['result'][_0x583b('0x69')],'elementType':_0x4e196f},'json':!![]};return rp(_0xb96df7);}})['then'](function(_0x5f4edd){if(_0x5f4edd[_0x583b('0x63')]){var _0xc7df7=[_0x583b('0x6a'),_0x583b('0x6b'),_0x583b('0x6c')];_[_0x583b('0x6d')](_0x5f4edd[_0x583b('0x66')][_0x583b('0x35')],function(_0x3bd231){return _0xc7df7[_0x583b('0x6e')](_0x3bd231['type'][_0x583b('0x30')]);});_[_0x583b('0x6d')](_0x5f4edd[_0x583b('0x66')][_0x583b('0x35')],function(_0x362b45){return _0x362b45[_0x583b('0x6f')]===_0x583b('0x70');});return{'count':_0x5f4edd['result'][_0x583b('0x35')][_0x583b('0x36')],'rows':_[_0x583b('0x2f')](_0x5f4edd['result'][_0x583b('0x35')],function(_0x3a92e6){return{'id':_0x3a92e6[_0x583b('0x30')],'name':_0x3a92e6[_0x583b('0x71')],'custom':_[_0x583b('0x72')](_0x3a92e6[_0x583b('0x30')],_0x583b('0x73'))?!![]:![],'options':_0x3a92e6[_0x583b('0x2c')][_0x583b('0x30')]==='picklist'&&_0x3a92e6[_0x583b('0x2c')][_0x583b('0x74')]['length']>0x0?_[_0x583b('0x2f')](_0x3a92e6[_0x583b('0x2c')]['picklistValues'],function(_0x4a236c){return{'name':_0x4a236c[_0x583b('0x71')],'value':_0x4a236c[_0x583b('0x75')]};}):[]};})};}})[_0x583b('0x27')](respondWithResult(_0x1bc9c9,null))[_0x583b('0x45')](function(_0x32c2bd){console[_0x583b('0x76')]('vTiger\x20error:\x20'+_0x32c2bd);var _0x57fa18=_0x522353[_0x583b('0x31')]['test']?0x1f4:_0x32c2bd[_0x583b('0x77')]||0x1f4;logger[_0x583b('0x78')](_0x583b('0x79'),'getFields',_0x57fa18,JSON['stringify'](_0x32c2bd));delete _0x32c2bd['name'];if(_0x57fa18===0x191){_0x57fa18=0x190;}_0x1bc9c9[_0x583b('0x1b')](_0x57fa18)[_0x583b('0x7a')](_0x522353[_0x583b('0x31')][_0x583b('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x32c2bd[_0x583b('0x77')]}:_0x32c2bd);});}; \ No newline at end of file +var _0xf2f4=['Descriptions','VtigerConfiguration','VtigerField','getFields','username','moduleName','serverUrl','accessKey','remoteUri','format','%s/webservice.php','GET','getchallenge','success','POST','login','reference','owner','remove','result','includes','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','getConfigurations','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel'];(function(_0x55f0e6,_0x2e28b8){var _0x29068e=function(_0x530a5e){while(--_0x530a5e){_0x55f0e6['push'](_0x55f0e6['shift']());}};_0x29068e(++_0x2e28b8);}(_0xf2f4,0x92));var _0x4f2f=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xf2f4[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f2f('0x0'));var zipdir=require(_0x4f2f('0x1'));var jsonpatch=require(_0x4f2f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4f2f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f2f('0x4'));var sox=require(_0x4f2f('0x5'));var csv=require('to-csv');var ejs=require(_0x4f2f('0x6'));var fs=require('fs');var fs_extra=require(_0x4f2f('0x7'));var _=require('lodash');var squel=require(_0x4f2f('0x8'));var crypto=require(_0x4f2f('0x9'));var jsforce=require(_0x4f2f('0xa'));var deskjs=require(_0x4f2f('0xb'));var toCsv=require(_0x4f2f('0xc'));var querystring=require(_0x4f2f('0xd'));var Papa=require(_0x4f2f('0xe'));var Redis=require(_0x4f2f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4f2f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f2f('0x11'));var logger=require(_0x4f2f('0x12'))(_0x4f2f('0x13'));var utils=require('../../config/utils');var config=require(_0x4f2f('0x14'));var licenseUtil=require(_0x4f2f('0x15'));var db=require(_0x4f2f('0x16'))['db'];var integrations=require(_0x4f2f('0x17'));function respondWithStatusCode(_0x396ba4,_0x2f8b3b){_0x2f8b3b=_0x2f8b3b||0xcc;return function(_0x1505a2){if(_0x1505a2){return _0x396ba4[_0x4f2f('0x18')](_0x2f8b3b);}return _0x396ba4[_0x4f2f('0x19')](_0x2f8b3b)['end']();};}function respondWithResult(_0x1154f4,_0xa7b6f){_0xa7b6f=_0xa7b6f||0xc8;return function(_0x4cec36){if(_0x4cec36){return _0x1154f4[_0x4f2f('0x19')](_0xa7b6f)[_0x4f2f('0x1a')](_0x4cec36);}};}function respondWithFilteredResult(_0x47e107,_0xeb5c7d){return function(_0x2532b8){if(_0x2532b8){var _0xd48509=typeof _0xeb5c7d[_0x4f2f('0x1b')]===_0x4f2f('0x1c')&&typeof _0xeb5c7d[_0x4f2f('0x1d')]===_0x4f2f('0x1c');var _0x2ea3f7=_0x2532b8[_0x4f2f('0x1e')];var _0x7598a8=_0xd48509?0x0:_0xeb5c7d[_0x4f2f('0x1b')];var _0x41f828=_0xd48509?_0x2532b8[_0x4f2f('0x1e')]:_0xeb5c7d['offset']+_0xeb5c7d[_0x4f2f('0x1d')];var _0x3d384f;if(_0x41f828>=_0x2ea3f7){_0x41f828=_0x2ea3f7;_0x3d384f=0xc8;}else{_0x3d384f=0xce;}_0x47e107[_0x4f2f('0x19')](_0x3d384f);return _0x47e107['set'](_0x4f2f('0x1f'),_0x7598a8+'-'+_0x41f828+'/'+_0x2ea3f7)['json'](_0x2532b8);}return null;};}function patchUpdates(_0x1ddca6){return function(_0x1252b6){try{jsonpatch[_0x4f2f('0x20')](_0x1252b6,_0x1ddca6,!![]);}catch(_0x302086){return BPromise[_0x4f2f('0x21')](_0x302086);}return _0x1252b6['save']();};}function saveUpdates(_0x33a602,_0x3c263a){return function(_0x55c21f){if(_0x55c21f){return _0x55c21f[_0x4f2f('0x22')](_0x33a602)['then'](function(_0x33880f){return _0x33880f;});}return null;};}function removeEntity(_0x4653ef,_0xb82b4d){return function(_0xed1e57){if(_0xed1e57){return _0xed1e57[_0x4f2f('0x23')]()[_0x4f2f('0x24')](function(){_0x4653ef[_0x4f2f('0x19')](0xcc)[_0x4f2f('0x25')]();});}};}function handleEntityNotFound(_0x2edd8f,_0x2b5848){return function(_0x9abb8d){if(!_0x9abb8d){_0x2edd8f[_0x4f2f('0x18')](0x194);}return _0x9abb8d;};}function handleError(_0x583b2b,_0x2882b9){_0x2882b9=_0x2882b9||0x1f4;return function(_0x42621f){logger[_0x4f2f('0x26')](_0x42621f[_0x4f2f('0x27')]);if(_0x42621f[_0x4f2f('0x28')]){delete _0x42621f[_0x4f2f('0x28')];}_0x583b2b[_0x4f2f('0x19')](_0x2882b9)[_0x4f2f('0x29')](_0x42621f);};}exports['index']=function(_0x5d5e9b,_0x277bde){var _0x34272a={},_0x446614={},_0x1ff55e={'count':0x0,'rows':[]};var _0x50b8f3=_['map'](db[_0x4f2f('0x2a')][_0x4f2f('0x2b')],function(_0x13d741){return{'name':_0x13d741[_0x4f2f('0x2c')],'type':_0x13d741[_0x4f2f('0x2d')][_0x4f2f('0x2e')]};});_0x446614[_0x4f2f('0x2f')]=_[_0x4f2f('0x30')](_0x50b8f3,'name');_0x446614[_0x4f2f('0x31')]=_[_0x4f2f('0x32')](_0x5d5e9b['query']);_0x446614[_0x4f2f('0x33')]=_[_0x4f2f('0x34')](_0x446614[_0x4f2f('0x2f')],_0x446614[_0x4f2f('0x31')]);_0x34272a[_0x4f2f('0x35')]=_[_0x4f2f('0x34')](_0x446614[_0x4f2f('0x2f')],qs['fields'](_0x5d5e9b[_0x4f2f('0x31')][_0x4f2f('0x36')]));_0x34272a[_0x4f2f('0x35')]=_0x34272a['attributes'][_0x4f2f('0x37')]?_0x34272a[_0x4f2f('0x35')]:_0x446614[_0x4f2f('0x2f')];if(!_0x5d5e9b[_0x4f2f('0x31')]['hasOwnProperty'](_0x4f2f('0x38'))){_0x34272a[_0x4f2f('0x1d')]=qs['limit'](_0x5d5e9b[_0x4f2f('0x31')][_0x4f2f('0x1d')]);_0x34272a[_0x4f2f('0x1b')]=qs[_0x4f2f('0x1b')](_0x5d5e9b[_0x4f2f('0x31')][_0x4f2f('0x1b')]);}_0x34272a[_0x4f2f('0x39')]=qs[_0x4f2f('0x3a')](_0x5d5e9b[_0x4f2f('0x31')][_0x4f2f('0x3a')]);_0x34272a[_0x4f2f('0x3b')]=qs[_0x4f2f('0x33')](_['pick'](_0x5d5e9b[_0x4f2f('0x31')],_0x446614[_0x4f2f('0x33')]),_0x50b8f3);if(_0x5d5e9b['query'][_0x4f2f('0x3c')]){_0x34272a[_0x4f2f('0x3b')]=_['merge'](_0x34272a[_0x4f2f('0x3b')],{'$or':_[_0x4f2f('0x30')](_0x50b8f3,function(_0x2f70f4){if(_0x2f70f4[_0x4f2f('0x2d')]!=='VIRTUAL'){var _0x3c44dc={};_0x3c44dc[_0x2f70f4['name']]={'$like':'%'+_0x5d5e9b[_0x4f2f('0x31')][_0x4f2f('0x3c')]+'%'};return _0x3c44dc;}})});}_0x34272a=_[_0x4f2f('0x3d')]({},_0x34272a,_0x5d5e9b[_0x4f2f('0x3e')]);var _0x1a0e28={'where':_0x34272a[_0x4f2f('0x3b')]};return db[_0x4f2f('0x2a')][_0x4f2f('0x1e')](_0x1a0e28)['then'](function(_0x635b25){_0x1ff55e[_0x4f2f('0x1e')]=_0x635b25;if(_0x5d5e9b[_0x4f2f('0x31')][_0x4f2f('0x3f')]){_0x34272a[_0x4f2f('0x40')]=[{'all':!![]}];}return db[_0x4f2f('0x2a')][_0x4f2f('0x41')](_0x34272a);})[_0x4f2f('0x24')](function(_0x46e87e){_0x1ff55e['rows']=_0x46e87e;return _0x1ff55e;})[_0x4f2f('0x24')](respondWithFilteredResult(_0x277bde,_0x34272a))[_0x4f2f('0x42')](handleError(_0x277bde,null));};exports['show']=function(_0xc3f6d1,_0x36f65e){var _0x1a14b4={'raw':![],'where':{'id':_0xc3f6d1[_0x4f2f('0x43')]['id']}},_0x711099={};_0x711099[_0x4f2f('0x2f')]=_[_0x4f2f('0x32')](db[_0x4f2f('0x2a')][_0x4f2f('0x2b')]);_0x711099[_0x4f2f('0x31')]=_['keys'](_0xc3f6d1[_0x4f2f('0x31')]);_0x711099[_0x4f2f('0x33')]=_[_0x4f2f('0x34')](_0x711099[_0x4f2f('0x2f')],_0x711099[_0x4f2f('0x31')]);_0x1a14b4[_0x4f2f('0x35')]=_[_0x4f2f('0x34')](_0x711099[_0x4f2f('0x2f')],qs[_0x4f2f('0x36')](_0xc3f6d1[_0x4f2f('0x31')]['fields']));_0x1a14b4[_0x4f2f('0x35')]=_0x1a14b4['attributes'][_0x4f2f('0x37')]?_0x1a14b4['attributes']:_0x711099[_0x4f2f('0x2f')];if(_0xc3f6d1[_0x4f2f('0x31')][_0x4f2f('0x3f')]){_0x1a14b4[_0x4f2f('0x40')]=[{'all':!![]}];}_0x1a14b4=_[_0x4f2f('0x3d')]({},_0x1a14b4,_0xc3f6d1[_0x4f2f('0x3e')]);return db[_0x4f2f('0x2a')][_0x4f2f('0x44')](_0x1a14b4)['then'](handleEntityNotFound(_0x36f65e,null))[_0x4f2f('0x24')](respondWithResult(_0x36f65e,null))[_0x4f2f('0x42')](handleError(_0x36f65e,null));};exports[_0x4f2f('0x45')]=function(_0x5de005,_0x15a884){return db[_0x4f2f('0x2a')][_0x4f2f('0x45')](_0x5de005['body'],{})[_0x4f2f('0x24')](respondWithResult(_0x15a884,0xc9))[_0x4f2f('0x42')](handleError(_0x15a884,null));};exports[_0x4f2f('0x22')]=function(_0x396265,_0x11a4e6){if(_0x396265[_0x4f2f('0x46')]['id']){delete _0x396265[_0x4f2f('0x46')]['id'];}return db['VtigerAccount'][_0x4f2f('0x44')]({'where':{'id':_0x396265[_0x4f2f('0x43')]['id']}})['then'](handleEntityNotFound(_0x11a4e6,null))['then'](saveUpdates(_0x396265[_0x4f2f('0x46')],null))[_0x4f2f('0x24')](respondWithResult(_0x11a4e6,null))[_0x4f2f('0x42')](handleError(_0x11a4e6,null));};exports['destroy']=function(_0x117fb0,_0x34d666){return db['VtigerAccount'][_0x4f2f('0x44')]({'where':{'id':_0x117fb0[_0x4f2f('0x43')]['id']}})[_0x4f2f('0x24')](handleEntityNotFound(_0x34d666,null))[_0x4f2f('0x24')](removeEntity(_0x34d666,null))[_0x4f2f('0x42')](handleError(_0x34d666,null));};exports[_0x4f2f('0x47')]=function(_0x3950d7,_0x505abf,_0x3408be){var _0x12641a={};var _0x36c19f={};var _0x3c1d1a;var _0x5ccca9;return db[_0x4f2f('0x2a')]['findOne']({'where':{'id':_0x3950d7['params']['id']}})[_0x4f2f('0x24')](handleEntityNotFound(_0x505abf,null))[_0x4f2f('0x24')](function(_0x26d572){if(_0x26d572){_0x3c1d1a=_0x26d572;_0x36c19f[_0x4f2f('0x2f')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x36c19f[_0x4f2f('0x31')]=_[_0x4f2f('0x32')](_0x3950d7[_0x4f2f('0x31')]);_0x36c19f[_0x4f2f('0x33')]=_[_0x4f2f('0x34')](_0x36c19f[_0x4f2f('0x2f')],_0x36c19f[_0x4f2f('0x31')]);_0x12641a[_0x4f2f('0x35')]=_['intersection'](_0x36c19f['model'],qs['fields'](_0x3950d7['query'][_0x4f2f('0x36')]));_0x12641a[_0x4f2f('0x35')]=_0x12641a[_0x4f2f('0x35')][_0x4f2f('0x37')]?_0x12641a[_0x4f2f('0x35')]:_0x36c19f['model'];_0x12641a[_0x4f2f('0x39')]=qs[_0x4f2f('0x3a')](_0x3950d7[_0x4f2f('0x31')][_0x4f2f('0x3a')]);_0x12641a[_0x4f2f('0x3b')]=qs[_0x4f2f('0x33')](_['pick'](_0x3950d7[_0x4f2f('0x31')],_0x36c19f[_0x4f2f('0x33')]));if(_0x3950d7[_0x4f2f('0x31')][_0x4f2f('0x3c')]){_0x12641a[_0x4f2f('0x3b')]=_[_0x4f2f('0x3d')](_0x12641a[_0x4f2f('0x3b')],{'$or':_[_0x4f2f('0x30')](_0x12641a[_0x4f2f('0x35')],function(_0x5eb852){var _0x578739={};_0x578739[_0x5eb852]={'$like':'%'+_0x3950d7[_0x4f2f('0x31')]['filter']+'%'};return _0x578739;})});}_0x12641a=_[_0x4f2f('0x3d')]({},_0x12641a,_0x3950d7[_0x4f2f('0x3e')]);return _0x3c1d1a[_0x4f2f('0x47')](_0x12641a);}})[_0x4f2f('0x24')](function(_0x40021f){if(_0x40021f){_0x5ccca9=_0x40021f['length'];if(!_0x3950d7[_0x4f2f('0x31')][_0x4f2f('0x48')](_0x4f2f('0x38'))){_0x12641a[_0x4f2f('0x1d')]=qs['limit'](_0x3950d7[_0x4f2f('0x31')][_0x4f2f('0x1d')]);_0x12641a[_0x4f2f('0x1b')]=qs['offset'](_0x3950d7['query'][_0x4f2f('0x1b')]);}return _0x3c1d1a[_0x4f2f('0x47')](_0x12641a);}})[_0x4f2f('0x24')](function(_0x323c9b){if(_0x323c9b){return _0x323c9b?{'count':_0x5ccca9,'rows':_0x323c9b}:null;}})[_0x4f2f('0x24')](respondWithResult(_0x505abf,null))[_0x4f2f('0x42')](handleError(_0x505abf,null));};exports['addConfiguration']=function(_0x5429cb,_0x21bd7f,_0xa3aa4a){if(_0x5429cb[_0x4f2f('0x46')]['id']){delete _0x5429cb[_0x4f2f('0x46')]['id'];}return db[_0x4f2f('0x2a')][_0x4f2f('0x49')]({'where':{'id':_0x5429cb[_0x4f2f('0x43')]['id']}})[_0x4f2f('0x24')](handleEntityNotFound(_0x21bd7f,null))[_0x4f2f('0x24')](function(_0x190ddd){if(_0x190ddd){_0x5429cb[_0x4f2f('0x46')][_0x4f2f('0x4a')]=_0x190ddd['id'];_0x5429cb['body'][_0x4f2f('0x4b')]=integrations[_0x4f2f('0x4c')](_0x5429cb['body'][_0x4f2f('0x4d')],_0x5429cb[_0x4f2f('0x46')][_0x4f2f('0x2d')]);_0x5429cb['body'][_0x4f2f('0x4e')]=integrations['getDescriptions'](_0x5429cb['body'][_0x4f2f('0x4d')],_0x5429cb[_0x4f2f('0x46')]['type']);return db[_0x4f2f('0x4f')][_0x4f2f('0x45')](_0x5429cb[_0x4f2f('0x46')],{'include':[{'model':db[_0x4f2f('0x50')],'as':_0x4f2f('0x4b')},{'model':db['VtigerField'],'as':_0x4f2f('0x4e')}]});}return null;})[_0x4f2f('0x24')](respondWithResult(_0x21bd7f,null))[_0x4f2f('0x42')](handleError(_0x21bd7f,null));};var md5=require('md5');exports[_0x4f2f('0x51')]=function(_0x2f157e,_0x453e8a,_0x5e8116){var _0x4adae3=null;var _0x1f2bb4=null;var _0x2a9b70=null;var _0x132ec0=null;var _0x5b23cd='';return db[_0x4f2f('0x2a')][_0x4f2f('0x49')]({'where':{'id':_0x2f157e[_0x4f2f('0x43')]['id']},'attributes':['id',_0x4f2f('0x28'),_0x4f2f('0x52'),'description',_0x4f2f('0x53'),'remoteUri',_0x4f2f('0x54'),_0x4f2f('0x55')]})[_0x4f2f('0x24')](handleEntityNotFound(_0x453e8a,null))['then'](function(_0x599730){if(_0x599730){_0x4adae3=_0x599730[_0x4f2f('0x52')];_0x1f2bb4=_0x599730[_0x4f2f('0x55')];_0x2a9b70=_0x599730[_0x4f2f('0x53')];_0x5b23cd=_0x599730[_0x4f2f('0x56')];var _0x42b736=_0x5b23cd['slice'](-0x1);if(_0x42b736==='/'){_0x5b23cd=_0x5b23cd['substring'](0x0,_0x5b23cd['lastIndexOf'](_0x42b736));}_0x132ec0=util[_0x4f2f('0x57')](_0x4f2f('0x58'),_0x5b23cd);var _0x1252ea={'method':_0x4f2f('0x59'),'uri':_0x132ec0,'qs':{'operation':_0x4f2f('0x5a'),'username':_0x599730[_0x4f2f('0x52')]},'json':!![]};return rp(_0x1252ea);}})['then'](function(_0x4715c9){if(_0x4715c9[_0x4f2f('0x5b')]){var _0x37564c={'method':_0x4f2f('0x5c'),'uri':_0x132ec0,'form':{'operation':_0x4f2f('0x5d'),'username':_0x4adae3,'accessKey':md5(_0x4715c9['result']['token']+_0x1f2bb4)},'json':!![]};return rp(_0x37564c);}})[_0x4f2f('0x24')](function(_0x35d57b){if(_0x35d57b['success']){var _0x11c05a={'method':_0x4f2f('0x59'),'uri':_0x132ec0,'qs':{'operation':'describe','username':_0x4adae3,'sessionName':_0x35d57b['result']['sessionName'],'elementType':_0x2a9b70},'json':!![]};return rp(_0x11c05a);}})[_0x4f2f('0x24')](function(_0x3166c0){if(_0x3166c0[_0x4f2f('0x5b')]){var _0x5073b7=['autogenerated',_0x4f2f('0x5e'),_0x4f2f('0x5f')];_[_0x4f2f('0x60')](_0x3166c0[_0x4f2f('0x61')][_0x4f2f('0x36')],function(_0x4a7f4b){return _0x5073b7[_0x4f2f('0x62')](_0x4a7f4b[_0x4f2f('0x2d')][_0x4f2f('0x28')]);});_[_0x4f2f('0x60')](_0x3166c0[_0x4f2f('0x61')][_0x4f2f('0x36')],function(_0x5f0b26){return _0x5f0b26['editable']===_0x4f2f('0x63');});return{'count':_0x3166c0['result'][_0x4f2f('0x36')][_0x4f2f('0x37')],'rows':_[_0x4f2f('0x30')](_0x3166c0[_0x4f2f('0x61')]['fields'],function(_0x2f80e8){return{'id':_0x2f80e8[_0x4f2f('0x28')],'name':_0x2f80e8[_0x4f2f('0x64')],'custom':_[_0x4f2f('0x65')](_0x2f80e8[_0x4f2f('0x28')],_0x4f2f('0x66'))?!![]:![],'options':_0x2f80e8[_0x4f2f('0x2d')][_0x4f2f('0x28')]===_0x4f2f('0x67')&&_0x2f80e8['type']['picklistValues'][_0x4f2f('0x37')]>0x0?_[_0x4f2f('0x30')](_0x2f80e8[_0x4f2f('0x2d')][_0x4f2f('0x68')],function(_0x3058c4){return{'name':_0x3058c4[_0x4f2f('0x64')],'value':_0x3058c4[_0x4f2f('0x69')]};}):[]};})};}})['then'](respondWithResult(_0x453e8a,null))[_0x4f2f('0x42')](function(_0xe5dff0){console['log'](_0x4f2f('0x6a')+_0xe5dff0);var _0x19195d=_0x2f157e[_0x4f2f('0x31')]['test']?0x1f4:_0xe5dff0[_0x4f2f('0x6b')]||0x1f4;logger['error'](_0x4f2f('0x6c'),_0x4f2f('0x51'),_0x19195d,JSON[_0x4f2f('0x6d')](_0xe5dff0));delete _0xe5dff0[_0x4f2f('0x28')];if(_0x19195d===0x191){_0x19195d=0x190;}_0x453e8a['status'](_0x19195d)['send'](_0x2f157e[_0x4f2f('0x31')][_0x4f2f('0x6e')]?{'message':_0x4f2f('0x6f'),'statusCode':_0xe5dff0['statusCode']}:_0xe5dff0);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 9c9369a..5ccab1a 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 _0xb5ce=['define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3b97e2,_0x426f00){var _0x16178a=function(_0x3e0e3a){while(--_0x3e0e3a){_0x3b97e2['push'](_0x3b97e2['shift']());}};_0x16178a(++_0x426f00);}(_0xb5ce,0xff));var _0xeb5c=function(_0x49e020,_0x3a2b9f){_0x49e020=_0x49e020-0x0;var _0x62c30c=_0xb5ce[_0x49e020];return _0x62c30c;};'use strict';var _=require('lodash');var util=require(_0xeb5c('0x0'));var logger=require(_0xeb5c('0x1'))(_0xeb5c('0x2'));var moment=require(_0xeb5c('0x3'));var BPromise=require('bluebird');var rp=require(_0xeb5c('0x4'));var fs=require('fs');var path=require(_0xeb5c('0x5'));var rimraf=require(_0xeb5c('0x6'));var config=require(_0xeb5c('0x7'));var attributes=require(_0xeb5c('0x8'));var integrations=require(_0xeb5c('0x9'));module[_0xeb5c('0xa')]=function(_0x5e8755,_0x418149){return _0x5e8755[_0xeb5c('0xb')](_0xeb5c('0xc'),attributes,{'tableName':_0xeb5c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x5e2c70,_0x108e64){var _0x1e6cbc=function(_0x46e5fd){while(--_0x46e5fd){_0x5e2c70['push'](_0x5e2c70['shift']());}};_0x1e6cbc(++_0x108e64);}(_0x70e2,0x107));var _0x270e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x70e2[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x270e('0x0'));var util=require(_0x270e('0x1'));var logger=require(_0x270e('0x2'))(_0x270e('0x3'));var moment=require(_0x270e('0x4'));var BPromise=require(_0x270e('0x5'));var rp=require(_0x270e('0x6'));var fs=require('fs');var path=require(_0x270e('0x7'));var rimraf=require(_0x270e('0x8'));var config=require(_0x270e('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x270e('0xa'));module['exports']=function(_0xf1f5f7,_0x150c18){return _0xf1f5f7[_0x270e('0xb')](_0x270e('0xc'),attributes,{'tableName':_0x270e('0xd'),'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 c2be8dc..c49fe11 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 _0x2f68=['info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','ShowVtigerAccount','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x24708d,_0x336efc){var _0x25649b=function(_0x4de8ed){while(--_0x4de8ed){_0x24708d['push'](_0x24708d['shift']());}};_0x25649b(++_0x336efc);}(_0x2f68,0x9a));var _0x82f6=function(_0x3b0474,_0x293d29){_0x3b0474=_0x3b0474-0x0;var _0x36032f=_0x2f68[_0x3b0474];return _0x36032f;};'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});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')]({'raw':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')]['where']||null:null,'attributes':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'limit':_0xcbc95f[_0x82f6('0x18')]?_0xcbc95f['options'][_0x82f6('0x1a')]||null:null,'include':_0xcbc95f['options']?_0xcbc95f[_0x82f6('0x18')][_0x82f6('0x1b')]?_['map'](_0xcbc95f['options'][_0x82f6('0x1b')],function(_0x1d96d5){return{'model':db[_0x1d96d5['model']],'as':_0x1d96d5['as'],'attributes':_0x1d96d5['attributes'],'include':_0x1d96d5[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1d96d5['include'],function(_0xfd8b68){return{'model':db[_0xfd8b68[_0x82f6('0x1d')]],'as':_0xfd8b68['as'],'attributes':_0xfd8b68['attributes'],'include':_0xfd8b68['include']?_[_0x82f6('0x1c')](_0xfd8b68['include'],function(_0x469b6b){return{'model':db[_0x469b6b[_0x82f6('0x1d')]],'as':_0x469b6b['as'],'attributes':_0x469b6b['attributes']};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x15c9b7){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger['debug'](_0x82f6('0x15'),_0xcbc95f,JSON[_0x82f6('0x10')](_0x15c9b7));_0x2bfd57(_0x15c9b7);})[_0x82f6('0x14')](function(_0x400137){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x400137[_0x82f6('0x12')],_0xcbc95f);_0x1c79f9(_0x4072f0[_0x82f6('0x11')](0x1f4,_0x400137[_0x82f6('0x12')]));});});};exports[_0x82f6('0x1e')]=function(_0x3c9419){var _0x20d1c5=this;return new Promise(function(_0x6ce179,_0x91117b){return db['VtigerAccount'][_0x82f6('0x1f')]({'raw':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x20')]||null:null,'attributes':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x19')]||null:null,'include':_0x3c9419[_0x82f6('0x18')]?_0x3c9419[_0x82f6('0x18')][_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x3c9419[_0x82f6('0x18')][_0x82f6('0x1b')],function(_0x1e028a){return{'model':db[_0x1e028a[_0x82f6('0x1d')]],'as':_0x1e028a['as'],'attributes':_0x1e028a['attributes'],'include':_0x1e028a[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x1e028a[_0x82f6('0x1b')],function(_0x276451){return{'model':db[_0x276451[_0x82f6('0x1d')]],'as':_0x276451['as'],'attributes':_0x276451[_0x82f6('0x19')],'include':_0x276451[_0x82f6('0x1b')]?_[_0x82f6('0x1c')](_0x276451[_0x82f6('0x1b')],function(_0x30c6f8){return{'model':db[_0x30c6f8[_0x82f6('0x1d')]],'as':_0x30c6f8['as'],'attributes':_0x30c6f8[_0x82f6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x82f6('0xa')](function(_0x34665a){logger['info'](_0x82f6('0x1e'),_0x3c9419);logger['debug']('ShowVtigerAccount',_0x3c9419,JSON[_0x82f6('0x10')](_0x34665a));_0x6ce179(_0x34665a);})[_0x82f6('0x14')](function(_0x5e8828){logger[_0x82f6('0x11')](_0x82f6('0x1e'),_0x5e8828[_0x82f6('0x12')],_0x3c9419);_0x91117b(_0x20d1c5['error'](0x1f4,_0x5e8828[_0x82f6('0x12')]));});});}; \ No newline at end of file +var _0xeffd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeffd,0x6b));var _0xdeff=function(_0x22199a,_0x2d455d){_0x22199a=_0x22199a-0x0;var _0x400e70=_0xeffd[_0x22199a];return _0x400e70;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x281ad7,_0x256323,_0x39878e){return new BPromise(function(_0x12e953,_0x24897a){return client['request'](_0x281ad7,_0x39878e)[_0xdeff('0xd')](function(_0x45a8a6){logger[_0xdeff('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x256323,_0xdeff('0xf'));logger[_0xdeff('0x10')](_0xdeff('0x11'),_0x256323,_0xdeff('0xf'),JSON[_0xdeff('0x12')](_0x45a8a6));if(_0x45a8a6[_0xdeff('0x13')]){if(_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x14')]===0x1f4){logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')]['message']);return _0x24897a(_0x45a8a6[_0xdeff('0x13')]['message']);}logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x16')]);return _0x12e953(_0x45a8a6[_0xdeff('0x13')]['message']);}else{logger[_0xdeff('0xe')](_0xdeff('0x15'),_0x256323,_0xdeff('0xf'));_0x12e953(_0x45a8a6[_0xdeff('0x17')][_0xdeff('0x16')]);}})[_0xdeff('0x18')](function(_0x577244){logger['error'](_0xdeff('0x15'),_0x256323,_0x577244);_0x24897a(_0x577244);});});}exports['GetVtigerAccount']=function(_0x5c9837){var _0x35635f=this;return new Promise(function(_0x369e13,_0x4b14b6){return db[_0xdeff('0x19')][_0xdeff('0x1a')]({'raw':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x5c9837['options']?_0x5c9837['options']['attributes']||null:null,'limit':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1e')]||null:null,'include':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x5c9837['options']['include'],function(_0x3b2554){return{'model':db[_0x3b2554[_0xdeff('0x21')]],'as':_0x3b2554['as'],'attributes':_0x3b2554[_0xdeff('0x22')],'include':_0x3b2554[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x3b2554['include'],function(_0xb08f19){return{'model':db[_0xb08f19[_0xdeff('0x21')]],'as':_0xb08f19['as'],'attributes':_0xb08f19[_0xdeff('0x22')],'include':_0xb08f19[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0xb08f19[_0xdeff('0x1f')],function(_0x3d0111){return{'model':db[_0x3d0111['model']],'as':_0x3d0111['as'],'attributes':_0x3d0111[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x53b168){logger['info'](_0xdeff('0x23'),_0x5c9837);logger[_0xdeff('0x10')](_0xdeff('0x23'),_0x5c9837,JSON[_0xdeff('0x12')](_0x53b168));_0x369e13(_0x53b168);})[_0xdeff('0x18')](function(_0xf9b278){logger[_0xdeff('0x13')]('GetVtigerAccount',_0xf9b278[_0xdeff('0x16')],_0x5c9837);_0x4b14b6(_0x35635f[_0xdeff('0x13')](0x1f4,_0xf9b278[_0xdeff('0x16')]));});});};exports['ShowVtigerAccount']=function(_0x59f7a0){var _0x346743=this;return new Promise(function(_0x505e3f,_0x69842a){return db[_0xdeff('0x19')][_0xdeff('0x24')]({'raw':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')]['attributes']||null:null,'include':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')],function(_0x321ef0){return{'model':db[_0x321ef0['model']],'as':_0x321ef0['as'],'attributes':_0x321ef0[_0xdeff('0x22')],'include':_0x321ef0['include']?_[_0xdeff('0x20')](_0x321ef0[_0xdeff('0x1f')],function(_0x2e1736){return{'model':db[_0x2e1736[_0xdeff('0x21')]],'as':_0x2e1736['as'],'attributes':_0x2e1736[_0xdeff('0x22')],'include':_0x2e1736[_0xdeff('0x1f')]?_['map'](_0x2e1736[_0xdeff('0x1f')],function(_0x3bf462){return{'model':db[_0x3bf462['model']],'as':_0x3bf462['as'],'attributes':_0x3bf462[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x1c6d4c){logger[_0xdeff('0xe')](_0xdeff('0x25'),_0x59f7a0);logger[_0xdeff('0x10')](_0xdeff('0x25'),_0x59f7a0,JSON[_0xdeff('0x12')](_0x1c6d4c));_0x505e3f(_0x1c6d4c);})['catch'](function(_0x118752){logger['error'](_0xdeff('0x25'),_0x118752[_0xdeff('0x16')],_0x59f7a0);_0x69842a(_0x346743[_0xdeff('0x13')](0x1f4,_0x118752['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index febc441..004b296 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 _0xffff=['/:id/fields','getSubjects','/:id/descriptions','getDescriptions','create','update','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x23fcec,_0x48ec4c){var _0x447567=function(_0x4781bb){while(--_0x4781bb){_0x23fcec['push'](_0x23fcec['shift']());}};_0x447567(++_0x48ec4c);}(_0xffff,0xe6));var _0xffff=function(_0x4b3f3d,_0xd6d36c){_0x4b3f3d=_0x4b3f3d-0x0;var _0x230220=_0xffff[_0x4b3f3d];return _0x230220;};'use strict';var multer=require(_0xffff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xffff('0x1'));var express=require(_0xffff('0x2'));var router=express[_0xffff('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xffff('0x4'));var interaction=require(_0xffff('0x5'));var config=require(_0xffff('0x6'));var controller=require(_0xffff('0x7'));router[_0xffff('0x8')]('/',auth[_0xffff('0x9')](),controller['index']);router[_0xffff('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xffff('0x8')](_0xffff('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0xffff('0x8')]('/:id/subjects',auth[_0xffff('0x9')](),controller[_0xffff('0xb')]);router['get'](_0xffff('0xc'),auth['isAuthenticated'](),controller[_0xffff('0xd')]);router['post']('/',auth[_0xffff('0x9')](),controller[_0xffff('0xe')]);router['put']('/:id',auth[_0xffff('0x9')](),controller[_0xffff('0xf')]);router[_0xffff('0x10')](_0xffff('0x11'),auth['isAuthenticated'](),controller[_0xffff('0x12')]);module[_0xffff('0x13')]=router; \ No newline at end of file +var _0x4ea9=['getSubjects','post','put','delete','destroy','path','connect-timeout','Router','../../components/auth/service','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x413655,_0x5dd396){var _0x584507=function(_0x27e29f){while(--_0x27e29f){_0x413655['push'](_0x413655['shift']());}};_0x584507(++_0x5dd396);}(_0x4ea9,0x1a3));var _0x94ea=function(_0x37639c,_0x12bc08){_0x37639c=_0x37639c-0x0;var _0x2a5131=_0x4ea9[_0x37639c];return _0x2a5131;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x94ea('0x0'));var timeout=require(_0x94ea('0x1'));var express=require('express');var router=express[_0x94ea('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x94ea('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x94ea('0x4'));router[_0x94ea('0x5')]('/',auth['isAuthenticated'](),controller[_0x94ea('0x6')]);router[_0x94ea('0x5')](_0x94ea('0x7'),auth[_0x94ea('0x8')](),controller[_0x94ea('0x9')]);router['get'](_0x94ea('0xa'),auth[_0x94ea('0x8')](),controller[_0x94ea('0xb')]);router[_0x94ea('0x5')](_0x94ea('0xc'),auth[_0x94ea('0x8')](),controller[_0x94ea('0xd')]);router['get']('/:id/descriptions',auth[_0x94ea('0x8')](),controller['getDescriptions']);router[_0x94ea('0xe')]('/',auth[_0x94ea('0x8')](),controller['create']);router[_0x94ea('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x94ea('0x10')]('/:id',auth[_0x94ea('0x8')](),controller[_0x94ea('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 2a5a3b6..eb97199 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 _0x6b30=['STRING'];(function(_0x53966f,_0xe0eeb6){var _0x18b30d=function(_0x42d886){while(--_0x42d886){_0x53966f['push'](_0x53966f['shift']());}};_0x18b30d(++_0xe0eeb6);}(_0x6b30,0x132));var _0x06b3=function(_0x1b658,_0x344b6a){_0x1b658=_0x1b658-0x0;var _0x1d17e5=_0x6b30[_0x1b658];return _0x1d17e5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x06b3('0x0')]}}; \ No newline at end of file +var _0x7ba8=['STRING','sequelize','exports'];(function(_0xf99903,_0x296cb4){var _0x231e5e=function(_0xa7d7a8){while(--_0xa7d7a8){_0xf99903['push'](_0xf99903['shift']());}};_0x231e5e(++_0x296cb4);}(_0x7ba8,0x1ed));var _0x87ba=function(_0x3e8a47,_0x2a64d1){_0x3e8a47=_0x3e8a47-0x0;var _0x338b00=_0x7ba8[_0x3e8a47];return _0x338b00;};'use strict';var Sequelize=require(_0x87ba('0x0'));module[_0x87ba('0x1')]={'name':{'type':Sequelize[_0x87ba('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 48a8906..51df874 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 _0x3e5c=['lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','map','VIRTUAL','filter','VtigerConfiguration','includeAll','findAll','rows','params','include','merge','options','catch','body','find','findOne','VtigerField','fields','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x37116a,_0x50a31e){var _0x4fdba6=function(_0x565964){while(--_0x565964){_0x37116a['push'](_0x37116a['shift']());}};_0x4fdba6(++_0x50a31e);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x2e11e1,_0x4b599b){_0x2e11e1=_0x2e11e1-0x0;var _0x5e3fb8=_0x3e5c[_0x2e11e1];return _0x5e3fb8;};'use strict';var emlformat=require(_0xc3e5('0x0'));var rimraf=require(_0xc3e5('0x1'));var zipdir=require(_0xc3e5('0x2'));var jsonpatch=require(_0xc3e5('0x3'));var rp=require('request-promise');var moment=require(_0xc3e5('0x4'));var BPromise=require(_0xc3e5('0x5'));var Mustache=require(_0xc3e5('0x6'));var util=require(_0xc3e5('0x7'));var path=require(_0xc3e5('0x8'));var sox=require(_0xc3e5('0x9'));var csv=require('to-csv');var ejs=require(_0xc3e5('0xa'));var fs=require('fs');var fs_extra=require(_0xc3e5('0xb'));var _=require(_0xc3e5('0xc'));var squel=require(_0xc3e5('0xd'));var crypto=require(_0xc3e5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc3e5('0xf'));var toCsv=require(_0xc3e5('0x10'));var querystring=require(_0xc3e5('0x11'));var Papa=require(_0xc3e5('0x12'));var Redis=require(_0xc3e5('0x13'));var authService=require(_0xc3e5('0x14'));var qs=require(_0xc3e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e5('0x16'));var logger=require(_0xc3e5('0x17'))(_0xc3e5('0x18'));var utils=require(_0xc3e5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc3e5('0x1a'));var db=require(_0xc3e5('0x1b'))['db'];function respondWithStatusCode(_0x36193e,_0x3f0395){_0x3f0395=_0x3f0395||0xcc;return function(_0x3b7441){if(_0x3b7441){return _0x36193e[_0xc3e5('0x1c')](_0x3f0395);}return _0x36193e['status'](_0x3f0395)['end']();};}function respondWithResult(_0x52cca7,_0x27c226){_0x27c226=_0x27c226||0xc8;return function(_0x5a52f1){if(_0x5a52f1){return _0x52cca7[_0xc3e5('0x1d')](_0x27c226)[_0xc3e5('0x1e')](_0x5a52f1);}};}function respondWithFilteredResult(_0x4d1ad9,_0x353dc0){return function(_0x3e3eaa){if(_0x3e3eaa){var _0x2cc476=typeof _0x353dc0[_0xc3e5('0x1f')]===_0xc3e5('0x20')&&typeof _0x353dc0['limit']===_0xc3e5('0x20');var _0x277063=_0x3e3eaa[_0xc3e5('0x21')];var _0xa33d84=_0x2cc476?0x0:_0x353dc0[_0xc3e5('0x1f')];var _0x1e1eea=_0x2cc476?_0x3e3eaa['count']:_0x353dc0[_0xc3e5('0x1f')]+_0x353dc0[_0xc3e5('0x22')];var _0x4a1d86;if(_0x1e1eea>=_0x277063){_0x1e1eea=_0x277063;_0x4a1d86=0xc8;}else{_0x4a1d86=0xce;}_0x4d1ad9[_0xc3e5('0x1d')](_0x4a1d86);return _0x4d1ad9['set'](_0xc3e5('0x23'),_0xa33d84+'-'+_0x1e1eea+'/'+_0x277063)[_0xc3e5('0x1e')](_0x3e3eaa);}return null;};}function patchUpdates(_0x2d551b){return function(_0xebf6dc){try{jsonpatch[_0xc3e5('0x24')](_0xebf6dc,_0x2d551b,!![]);}catch(_0x4a7806){return BPromise[_0xc3e5('0x25')](_0x4a7806);}return _0xebf6dc[_0xc3e5('0x26')]();};}function saveUpdates(_0x2d8c6f,_0x3eb513){return function(_0x414ba9){if(_0x414ba9){return _0x414ba9[_0xc3e5('0x27')](_0x2d8c6f)[_0xc3e5('0x28')](function(_0x47f344){return _0x47f344;});}return null;};}function removeEntity(_0x3a2800,_0x430cb4){return function(_0x43d01e){if(_0x43d01e){return _0x43d01e[_0xc3e5('0x29')]()[_0xc3e5('0x28')](function(){_0x3a2800[_0xc3e5('0x1d')](0xcc)[_0xc3e5('0x2a')]();});}};}function handleEntityNotFound(_0x45556e,_0x564748){return function(_0x25d3a3){if(!_0x25d3a3){_0x45556e['sendStatus'](0x194);}return _0x25d3a3;};}function handleError(_0x4c0cf4,_0x8815af){_0x8815af=_0x8815af||0x1f4;return function(_0x12ad6e){logger[_0xc3e5('0x2b')](_0x12ad6e['stack']);if(_0x12ad6e[_0xc3e5('0x2c')]){delete _0x12ad6e[_0xc3e5('0x2c')];}_0x4c0cf4[_0xc3e5('0x1d')](_0x8815af)[_0xc3e5('0x2d')](_0x12ad6e);};}exports['index']=function(_0xa6766d,_0x497ecf){var _0x45ca6d={},_0xc0e6e7={},_0xc58f2b={'count':0x0,'rows':[]};var _0x5a2d41=_['map'](db['VtigerConfiguration'][_0xc3e5('0x2e')],function(_0x45cd9c){return{'name':_0x45cd9c[_0xc3e5('0x2f')],'type':_0x45cd9c[_0xc3e5('0x30')][_0xc3e5('0x31')]};});_0xc0e6e7[_0xc3e5('0x32')]=_['map'](_0x5a2d41,_0xc3e5('0x2c'));_0xc0e6e7[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0xa6766d[_0xc3e5('0x33')]);_0xc0e6e7[_0xc3e5('0x35')]=_[_0xc3e5('0x36')](_0xc0e6e7[_0xc3e5('0x32')],_0xc0e6e7[_0xc3e5('0x33')]);_0x45ca6d[_0xc3e5('0x37')]=_[_0xc3e5('0x36')](_0xc0e6e7[_0xc3e5('0x32')],qs['fields'](_0xa6766d[_0xc3e5('0x33')]['fields']));_0x45ca6d[_0xc3e5('0x37')]=_0x45ca6d[_0xc3e5('0x37')][_0xc3e5('0x38')]?_0x45ca6d[_0xc3e5('0x37')]:_0xc0e6e7['model'];if(!_0xa6766d[_0xc3e5('0x33')]['hasOwnProperty']('nolimit')){_0x45ca6d[_0xc3e5('0x22')]=qs['limit'](_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x22')]);_0x45ca6d[_0xc3e5('0x1f')]=qs[_0xc3e5('0x1f')](_0xa6766d[_0xc3e5('0x33')]['offset']);}_0x45ca6d[_0xc3e5('0x39')]=qs[_0xc3e5('0x3a')](_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x3a')]);_0x45ca6d[_0xc3e5('0x3b')]=qs['filters'](_[_0xc3e5('0x3c')](_0xa6766d['query'],_0xc0e6e7[_0xc3e5('0x35')]),_0x5a2d41);if(_0xa6766d[_0xc3e5('0x33')]['filter']){_0x45ca6d[_0xc3e5('0x3b')]=_['merge'](_0x45ca6d[_0xc3e5('0x3b')],{'$or':_[_0xc3e5('0x3d')](_0x5a2d41,function(_0x3e7333){if(_0x3e7333['type']!==_0xc3e5('0x3e')){var _0x3c496f={};_0x3c496f[_0x3e7333[_0xc3e5('0x2c')]]={'$like':'%'+_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x3f')]+'%'};return _0x3c496f;}})});}_0x45ca6d=_['merge']({},_0x45ca6d,_0xa6766d['options']);var _0x5ebe00={'where':_0x45ca6d[_0xc3e5('0x3b')]};return db[_0xc3e5('0x40')]['count'](_0x5ebe00)[_0xc3e5('0x28')](function(_0x5b100d){_0xc58f2b[_0xc3e5('0x21')]=_0x5b100d;if(_0xa6766d['query'][_0xc3e5('0x41')]){_0x45ca6d['include']=[{'all':!![]}];}return db[_0xc3e5('0x40')][_0xc3e5('0x42')](_0x45ca6d);})[_0xc3e5('0x28')](function(_0x1c5177){_0xc58f2b[_0xc3e5('0x43')]=_0x1c5177;return _0xc58f2b;})[_0xc3e5('0x28')](respondWithFilteredResult(_0x497ecf,_0x45ca6d))['catch'](handleError(_0x497ecf,null));};exports['show']=function(_0x3213d3,_0x5f4328){var _0x3f0887={'raw':![],'where':{'id':_0x3213d3[_0xc3e5('0x44')]['id']}},_0x27354c={};_0x27354c[_0xc3e5('0x32')]=_[_0xc3e5('0x34')](db[_0xc3e5('0x40')]['rawAttributes']);_0x27354c[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0x3213d3[_0xc3e5('0x33')]);_0x27354c[_0xc3e5('0x35')]=_[_0xc3e5('0x36')](_0x27354c[_0xc3e5('0x32')],_0x27354c[_0xc3e5('0x33')]);_0x3f0887[_0xc3e5('0x37')]=_[_0xc3e5('0x36')](_0x27354c[_0xc3e5('0x32')],qs['fields'](_0x3213d3['query']['fields']));_0x3f0887[_0xc3e5('0x37')]=_0x3f0887['attributes'][_0xc3e5('0x38')]?_0x3f0887[_0xc3e5('0x37')]:_0x27354c[_0xc3e5('0x32')];if(_0x3213d3[_0xc3e5('0x33')]['includeAll']){_0x3f0887[_0xc3e5('0x45')]=[{'all':!![]}];}_0x3f0887=_[_0xc3e5('0x46')]({},_0x3f0887,_0x3213d3[_0xc3e5('0x47')]);return db[_0xc3e5('0x40')]['find'](_0x3f0887)['then'](handleEntityNotFound(_0x5f4328,null))[_0xc3e5('0x28')](respondWithResult(_0x5f4328,null))[_0xc3e5('0x48')](handleError(_0x5f4328,null));};exports['create']=function(_0x12cc80,_0x4c9b0b){return db[_0xc3e5('0x40')]['create'](_0x12cc80[_0xc3e5('0x49')],{})['then'](respondWithResult(_0x4c9b0b,0xc9))['catch'](handleError(_0x4c9b0b,null));};exports['update']=function(_0x87855d,_0x11da7e){if(_0x87855d[_0xc3e5('0x49')]['id']){delete _0x87855d['body']['id'];}return db['VtigerConfiguration'][_0xc3e5('0x4a')]({'where':{'id':_0x87855d['params']['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x11da7e,null))[_0xc3e5('0x28')](saveUpdates(_0x87855d[_0xc3e5('0x49')],null))[_0xc3e5('0x28')](respondWithResult(_0x11da7e,null))[_0xc3e5('0x48')](handleError(_0x11da7e,null));};exports[_0xc3e5('0x29')]=function(_0x5cd31c,_0x27924f){return db['VtigerConfiguration']['find']({'where':{'id':_0x5cd31c[_0xc3e5('0x44')]['id']}})['then'](handleEntityNotFound(_0x27924f,null))[_0xc3e5('0x28')](removeEntity(_0x27924f,null))['catch'](handleError(_0x27924f,null));};exports['getFields']=function(_0xe2b621,_0xffeec4,_0x525e5a){var _0x4dd01e={};var _0x11ab12={};var _0x38e722;var _0x5461af;return db[_0xc3e5('0x40')][_0xc3e5('0x4b')]({'where':{'id':_0xe2b621[_0xc3e5('0x44')]['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0xffeec4,null))[_0xc3e5('0x28')](function(_0x3d56e0){if(_0x3d56e0){_0x38e722=_0x3d56e0;_0x11ab12[_0xc3e5('0x32')]=_['keys'](db[_0xc3e5('0x4c')][_0xc3e5('0x2e')]);_0x11ab12['query']=_['keys'](_0xe2b621[_0xc3e5('0x33')]);_0x11ab12[_0xc3e5('0x35')]=_['intersection'](_0x11ab12['model'],_0x11ab12['query']);_0x4dd01e['attributes']=_[_0xc3e5('0x36')](_0x11ab12[_0xc3e5('0x32')],qs[_0xc3e5('0x4d')](_0xe2b621[_0xc3e5('0x33')][_0xc3e5('0x4d')]));_0x4dd01e['attributes']=_0x4dd01e[_0xc3e5('0x37')][_0xc3e5('0x38')]?_0x4dd01e[_0xc3e5('0x37')]:_0x11ab12['model'];_0x4dd01e[_0xc3e5('0x39')]=qs[_0xc3e5('0x3a')](_0xe2b621[_0xc3e5('0x33')][_0xc3e5('0x3a')]);_0x4dd01e[_0xc3e5('0x3b')]=qs['filters'](_['pick'](_0xe2b621[_0xc3e5('0x33')],_0x11ab12[_0xc3e5('0x35')]));if(_0xe2b621['query'][_0xc3e5('0x3f')]){_0x4dd01e[_0xc3e5('0x3b')]=_['merge'](_0x4dd01e[_0xc3e5('0x3b')],{'$or':_[_0xc3e5('0x3d')](_0x4dd01e[_0xc3e5('0x37')],function(_0x378fdf){var _0x134550={};_0x134550[_0x378fdf]={'$like':'%'+_0xe2b621[_0xc3e5('0x33')][_0xc3e5('0x3f')]+'%'};return _0x134550;})});}_0x4dd01e=_[_0xc3e5('0x46')]({},_0x4dd01e,_0xe2b621['options']);return _0x38e722[_0xc3e5('0x4e')](_0x4dd01e);}})[_0xc3e5('0x28')](function(_0x3db9ac){if(_0x3db9ac){_0x5461af=_0x3db9ac['length'];if(!_0xe2b621['query'][_0xc3e5('0x4f')](_0xc3e5('0x50'))){_0x4dd01e[_0xc3e5('0x22')]=qs[_0xc3e5('0x22')](_0xe2b621[_0xc3e5('0x33')][_0xc3e5('0x22')]);_0x4dd01e['offset']=qs[_0xc3e5('0x1f')](_0xe2b621['query'][_0xc3e5('0x1f')]);}return _0x38e722[_0xc3e5('0x4e')](_0x4dd01e);}})[_0xc3e5('0x28')](function(_0x82b91c){if(_0x82b91c){return _0x82b91c?{'count':_0x5461af,'rows':_0x82b91c}:null;}})[_0xc3e5('0x28')](respondWithResult(_0xffeec4,null))[_0xc3e5('0x48')](handleError(_0xffeec4,null));};exports[_0xc3e5('0x51')]=function(_0xc18fa9,_0x2531c0,_0x37d897){var _0x5bd8ed={};var _0x5ee3f6={};var _0x281415;var _0x1233dc;return db[_0xc3e5('0x40')][_0xc3e5('0x4b')]({'where':{'id':_0xc18fa9[_0xc3e5('0x44')]['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x2531c0,null))[_0xc3e5('0x28')](function(_0x95db72){if(_0x95db72){_0x281415=_0x95db72;_0x5ee3f6[_0xc3e5('0x32')]=_['keys'](db['VtigerField'][_0xc3e5('0x2e')]);_0x5ee3f6[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0xc18fa9[_0xc3e5('0x33')]);_0x5ee3f6['filters']=_[_0xc3e5('0x36')](_0x5ee3f6[_0xc3e5('0x32')],_0x5ee3f6['query']);_0x5bd8ed[_0xc3e5('0x37')]=_[_0xc3e5('0x36')](_0x5ee3f6[_0xc3e5('0x32')],qs[_0xc3e5('0x4d')](_0xc18fa9['query'][_0xc3e5('0x4d')]));_0x5bd8ed[_0xc3e5('0x37')]=_0x5bd8ed['attributes'][_0xc3e5('0x38')]?_0x5bd8ed[_0xc3e5('0x37')]:_0x5ee3f6[_0xc3e5('0x32')];_0x5bd8ed[_0xc3e5('0x39')]=qs[_0xc3e5('0x3a')](_0xc18fa9[_0xc3e5('0x33')][_0xc3e5('0x3a')]);_0x5bd8ed[_0xc3e5('0x3b')]=qs[_0xc3e5('0x35')](_[_0xc3e5('0x3c')](_0xc18fa9['query'],_0x5ee3f6[_0xc3e5('0x35')]));if(_0xc18fa9[_0xc3e5('0x33')][_0xc3e5('0x3f')]){_0x5bd8ed[_0xc3e5('0x3b')]=_[_0xc3e5('0x46')](_0x5bd8ed[_0xc3e5('0x3b')],{'$or':_[_0xc3e5('0x3d')](_0x5bd8ed['attributes'],function(_0xe68131){var _0x14ec4a={};_0x14ec4a[_0xe68131]={'$like':'%'+_0xc18fa9[_0xc3e5('0x33')][_0xc3e5('0x3f')]+'%'};return _0x14ec4a;})});}_0x5bd8ed=_[_0xc3e5('0x46')]({},_0x5bd8ed,_0xc18fa9[_0xc3e5('0x47')]);return _0x281415[_0xc3e5('0x51')](_0x5bd8ed);}})[_0xc3e5('0x28')](function(_0x5aa68c){if(_0x5aa68c){_0x1233dc=_0x5aa68c['length'];if(!_0xc18fa9[_0xc3e5('0x33')][_0xc3e5('0x4f')](_0xc3e5('0x50'))){_0x5bd8ed[_0xc3e5('0x22')]=qs[_0xc3e5('0x22')](_0xc18fa9[_0xc3e5('0x33')]['limit']);_0x5bd8ed['offset']=qs[_0xc3e5('0x1f')](_0xc18fa9[_0xc3e5('0x33')][_0xc3e5('0x1f')]);}return _0x281415['getSubjects'](_0x5bd8ed);}})[_0xc3e5('0x28')](function(_0x3256bf){if(_0x3256bf){return _0x3256bf?{'count':_0x1233dc,'rows':_0x3256bf}:null;}})[_0xc3e5('0x28')](respondWithResult(_0x2531c0,null))[_0xc3e5('0x48')](handleError(_0x2531c0,null));};exports['getDescriptions']=function(_0x19e8ba,_0x5bfe50,_0x22b4fc){var _0x2ce0e8={};var _0x5e7ab3={};var _0x4bed56;var _0x1787d4;return db[_0xc3e5('0x40')][_0xc3e5('0x4b')]({'where':{'id':_0x19e8ba[_0xc3e5('0x44')]['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x5bfe50,null))[_0xc3e5('0x28')](function(_0x4b5451){if(_0x4b5451){_0x4bed56=_0x4b5451;_0x5e7ab3[_0xc3e5('0x32')]=_[_0xc3e5('0x34')](db['VtigerField'][_0xc3e5('0x2e')]);_0x5e7ab3[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0x19e8ba[_0xc3e5('0x33')]);_0x5e7ab3['filters']=_[_0xc3e5('0x36')](_0x5e7ab3[_0xc3e5('0x32')],_0x5e7ab3['query']);_0x2ce0e8[_0xc3e5('0x37')]=_['intersection'](_0x5e7ab3['model'],qs[_0xc3e5('0x4d')](_0x19e8ba[_0xc3e5('0x33')][_0xc3e5('0x4d')]));_0x2ce0e8[_0xc3e5('0x37')]=_0x2ce0e8['attributes']['length']?_0x2ce0e8[_0xc3e5('0x37')]:_0x5e7ab3[_0xc3e5('0x32')];_0x2ce0e8[_0xc3e5('0x39')]=qs[_0xc3e5('0x3a')](_0x19e8ba[_0xc3e5('0x33')]['sort']);_0x2ce0e8[_0xc3e5('0x3b')]=qs[_0xc3e5('0x35')](_[_0xc3e5('0x3c')](_0x19e8ba[_0xc3e5('0x33')],_0x5e7ab3[_0xc3e5('0x35')]));if(_0x19e8ba[_0xc3e5('0x33')][_0xc3e5('0x3f')]){_0x2ce0e8['where']=_[_0xc3e5('0x46')](_0x2ce0e8[_0xc3e5('0x3b')],{'$or':_[_0xc3e5('0x3d')](_0x2ce0e8[_0xc3e5('0x37')],function(_0x33432a){var _0x4542c1={};_0x4542c1[_0x33432a]={'$like':'%'+_0x19e8ba['query'][_0xc3e5('0x3f')]+'%'};return _0x4542c1;})});}_0x2ce0e8=_['merge']({},_0x2ce0e8,_0x19e8ba[_0xc3e5('0x47')]);return _0x4bed56[_0xc3e5('0x52')](_0x2ce0e8);}})[_0xc3e5('0x28')](function(_0x245149){if(_0x245149){_0x1787d4=_0x245149['length'];if(!_0x19e8ba[_0xc3e5('0x33')][_0xc3e5('0x4f')](_0xc3e5('0x50'))){_0x2ce0e8[_0xc3e5('0x22')]=qs[_0xc3e5('0x22')](_0x19e8ba[_0xc3e5('0x33')][_0xc3e5('0x22')]);_0x2ce0e8[_0xc3e5('0x1f')]=qs[_0xc3e5('0x1f')](_0x19e8ba[_0xc3e5('0x33')][_0xc3e5('0x1f')]);}return _0x4bed56[_0xc3e5('0x52')](_0x2ce0e8);}})['then'](function(_0x30af58){if(_0x30af58){return _0x30af58?{'count':_0x1787d4,'rows':_0x30af58}:null;}})[_0xc3e5('0x28')](respondWithResult(_0x5bfe50,null))[_0xc3e5('0x48')](handleError(_0x5bfe50,null));}; \ No newline at end of file +var _0xbae9=['find','filter','getFields','getSubjects','findOne','VtigerField','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','status','error','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','create','body'];(function(_0x41f0de,_0x43c369){var _0x1765e0=function(_0x566298){while(--_0x566298){_0x41f0de['push'](_0x41f0de['shift']());}};_0x1765e0(++_0x43c369);}(_0xbae9,0x197));var _0x9bae=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0xbae9[_0x254081];return _0x5d1e2a;};'use strict';var emlformat=require(_0x9bae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bae('0x1'));var jsonpatch=require(_0x9bae('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9bae('0x3'));var Mustache=require(_0x9bae('0x4'));var util=require(_0x9bae('0x5'));var path=require(_0x9bae('0x6'));var sox=require(_0x9bae('0x7'));var csv=require(_0x9bae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bae('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9bae('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9bae('0x8'));var querystring=require(_0x9bae('0xb'));var Papa=require(_0x9bae('0xc'));var Redis=require('ioredis');var authService=require(_0x9bae('0xd'));var qs=require(_0x9bae('0xe'));var as=require(_0x9bae('0xf'));var hardwareService=require(_0x9bae('0x10'));var logger=require(_0x9bae('0x11'))(_0x9bae('0x12'));var utils=require(_0x9bae('0x13'));var config=require(_0x9bae('0x14'));var licenseUtil=require(_0x9bae('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8b7759,_0x14ce5d){_0x14ce5d=_0x14ce5d||0xcc;return function(_0x42868b){if(_0x42868b){return _0x8b7759[_0x9bae('0x16')](_0x14ce5d);}return _0x8b7759['status'](_0x14ce5d)[_0x9bae('0x17')]();};}function respondWithResult(_0x485413,_0x5a7c3b){_0x5a7c3b=_0x5a7c3b||0xc8;return function(_0x2ec8f1){if(_0x2ec8f1){return _0x485413['status'](_0x5a7c3b)[_0x9bae('0x18')](_0x2ec8f1);}};}function respondWithFilteredResult(_0x3cc7d8,_0xd3d656){return function(_0x3526c1){if(_0x3526c1){var _0x1c3cf2=typeof _0xd3d656[_0x9bae('0x19')]===_0x9bae('0x1a')&&typeof _0xd3d656[_0x9bae('0x1b')]===_0x9bae('0x1a');var _0x3cea85=_0x3526c1[_0x9bae('0x1c')];var _0x9e480=_0x1c3cf2?0x0:_0xd3d656[_0x9bae('0x19')];var _0x2e113b=_0x1c3cf2?_0x3526c1[_0x9bae('0x1c')]:_0xd3d656[_0x9bae('0x19')]+_0xd3d656['limit'];var _0x23d7b3;if(_0x2e113b>=_0x3cea85){_0x2e113b=_0x3cea85;_0x23d7b3=0xc8;}else{_0x23d7b3=0xce;}_0x3cc7d8['status'](_0x23d7b3);return _0x3cc7d8[_0x9bae('0x1d')](_0x9bae('0x1e'),_0x9e480+'-'+_0x2e113b+'/'+_0x3cea85)[_0x9bae('0x18')](_0x3526c1);}return null;};}function patchUpdates(_0x2fc69e){return function(_0x3cd731){try{jsonpatch[_0x9bae('0x1f')](_0x3cd731,_0x2fc69e,!![]);}catch(_0x25fc96){return BPromise[_0x9bae('0x20')](_0x25fc96);}return _0x3cd731[_0x9bae('0x21')]();};}function saveUpdates(_0x18fb86,_0x36fcc1){return function(_0x2f0afb){if(_0x2f0afb){return _0x2f0afb[_0x9bae('0x22')](_0x18fb86)['then'](function(_0x34345f){return _0x34345f;});}return null;};}function removeEntity(_0x31f1ce,_0x1e2ee3){return function(_0xe7edc0){if(_0xe7edc0){return _0xe7edc0[_0x9bae('0x23')]()[_0x9bae('0x24')](function(){_0x31f1ce[_0x9bae('0x25')](0xcc)[_0x9bae('0x17')]();});}};}function handleEntityNotFound(_0x575088,_0x1a20d8){return function(_0x3f3f8d){if(!_0x3f3f8d){_0x575088[_0x9bae('0x16')](0x194);}return _0x3f3f8d;};}function handleError(_0x39d411,_0x24ef07){_0x24ef07=_0x24ef07||0x1f4;return function(_0x18549f){logger[_0x9bae('0x26')](_0x18549f['stack']);if(_0x18549f[_0x9bae('0x27')]){delete _0x18549f['name'];}_0x39d411[_0x9bae('0x25')](_0x24ef07)['send'](_0x18549f);};}exports[_0x9bae('0x28')]=function(_0x516e1a,_0x58a95b){var _0x5ba0f2={},_0x3b2919={},_0x32e050={'count':0x0,'rows':[]};var _0x33ea92=_[_0x9bae('0x29')](db[_0x9bae('0x2a')][_0x9bae('0x2b')],function(_0x529275){return{'name':_0x529275[_0x9bae('0x2c')],'type':_0x529275[_0x9bae('0x2d')][_0x9bae('0x2e')]};});_0x3b2919[_0x9bae('0x2f')]=_[_0x9bae('0x29')](_0x33ea92,_0x9bae('0x27'));_0x3b2919[_0x9bae('0x30')]=_[_0x9bae('0x31')](_0x516e1a['query']);_0x3b2919[_0x9bae('0x32')]=_[_0x9bae('0x33')](_0x3b2919[_0x9bae('0x2f')],_0x3b2919['query']);_0x5ba0f2[_0x9bae('0x34')]=_[_0x9bae('0x33')](_0x3b2919['model'],qs[_0x9bae('0x35')](_0x516e1a['query'][_0x9bae('0x35')]));_0x5ba0f2['attributes']=_0x5ba0f2[_0x9bae('0x34')][_0x9bae('0x36')]?_0x5ba0f2[_0x9bae('0x34')]:_0x3b2919[_0x9bae('0x2f')];if(!_0x516e1a[_0x9bae('0x30')][_0x9bae('0x37')](_0x9bae('0x38'))){_0x5ba0f2[_0x9bae('0x1b')]=qs['limit'](_0x516e1a['query'][_0x9bae('0x1b')]);_0x5ba0f2['offset']=qs[_0x9bae('0x19')](_0x516e1a[_0x9bae('0x30')][_0x9bae('0x19')]);}_0x5ba0f2[_0x9bae('0x39')]=qs[_0x9bae('0x3a')](_0x516e1a['query'][_0x9bae('0x3a')]);_0x5ba0f2['where']=qs[_0x9bae('0x32')](_[_0x9bae('0x3b')](_0x516e1a[_0x9bae('0x30')],_0x3b2919[_0x9bae('0x32')]),_0x33ea92);if(_0x516e1a[_0x9bae('0x30')]['filter']){_0x5ba0f2['where']=_[_0x9bae('0x3c')](_0x5ba0f2['where'],{'$or':_[_0x9bae('0x29')](_0x33ea92,function(_0x524552){if(_0x524552[_0x9bae('0x2d')]!==_0x9bae('0x3d')){var _0x207440={};_0x207440[_0x524552[_0x9bae('0x27')]]={'$like':'%'+_0x516e1a[_0x9bae('0x30')]['filter']+'%'};return _0x207440;}})});}_0x5ba0f2=_[_0x9bae('0x3c')]({},_0x5ba0f2,_0x516e1a[_0x9bae('0x3e')]);var _0x5e9ca4={'where':_0x5ba0f2[_0x9bae('0x3f')]};return db['VtigerConfiguration'][_0x9bae('0x1c')](_0x5e9ca4)[_0x9bae('0x24')](function(_0x3acfc5){_0x32e050[_0x9bae('0x1c')]=_0x3acfc5;if(_0x516e1a[_0x9bae('0x30')][_0x9bae('0x40')]){_0x5ba0f2[_0x9bae('0x41')]=[{'all':!![]}];}return db[_0x9bae('0x2a')][_0x9bae('0x42')](_0x5ba0f2);})[_0x9bae('0x24')](function(_0x37c1c6){_0x32e050[_0x9bae('0x43')]=_0x37c1c6;return _0x32e050;})[_0x9bae('0x24')](respondWithFilteredResult(_0x58a95b,_0x5ba0f2))[_0x9bae('0x44')](handleError(_0x58a95b,null));};exports[_0x9bae('0x45')]=function(_0x4680a8,_0x423ab9){var _0x5c0590={'raw':![],'where':{'id':_0x4680a8[_0x9bae('0x46')]['id']}},_0x5de50f={};_0x5de50f[_0x9bae('0x2f')]=_['keys'](db[_0x9bae('0x2a')][_0x9bae('0x2b')]);_0x5de50f['query']=_[_0x9bae('0x31')](_0x4680a8[_0x9bae('0x30')]);_0x5de50f['filters']=_[_0x9bae('0x33')](_0x5de50f['model'],_0x5de50f[_0x9bae('0x30')]);_0x5c0590[_0x9bae('0x34')]=_['intersection'](_0x5de50f['model'],qs[_0x9bae('0x35')](_0x4680a8['query'][_0x9bae('0x35')]));_0x5c0590[_0x9bae('0x34')]=_0x5c0590[_0x9bae('0x34')][_0x9bae('0x36')]?_0x5c0590[_0x9bae('0x34')]:_0x5de50f['model'];if(_0x4680a8[_0x9bae('0x30')][_0x9bae('0x40')]){_0x5c0590[_0x9bae('0x41')]=[{'all':!![]}];}_0x5c0590=_['merge']({},_0x5c0590,_0x4680a8[_0x9bae('0x3e')]);return db['VtigerConfiguration']['find'](_0x5c0590)[_0x9bae('0x24')](handleEntityNotFound(_0x423ab9,null))[_0x9bae('0x24')](respondWithResult(_0x423ab9,null))[_0x9bae('0x44')](handleError(_0x423ab9,null));};exports['create']=function(_0x20133e,_0x4dba42){return db[_0x9bae('0x2a')][_0x9bae('0x47')](_0x20133e[_0x9bae('0x48')],{})[_0x9bae('0x24')](respondWithResult(_0x4dba42,0xc9))[_0x9bae('0x44')](handleError(_0x4dba42,null));};exports[_0x9bae('0x22')]=function(_0x18ca9d,_0x3eeab1){if(_0x18ca9d[_0x9bae('0x48')]['id']){delete _0x18ca9d[_0x9bae('0x48')]['id'];}return db[_0x9bae('0x2a')]['find']({'where':{'id':_0x18ca9d['params']['id']}})[_0x9bae('0x24')](handleEntityNotFound(_0x3eeab1,null))[_0x9bae('0x24')](saveUpdates(_0x18ca9d[_0x9bae('0x48')],null))[_0x9bae('0x24')](respondWithResult(_0x3eeab1,null))['catch'](handleError(_0x3eeab1,null));};exports[_0x9bae('0x23')]=function(_0x2ce64d,_0x473ab1){return db[_0x9bae('0x2a')][_0x9bae('0x49')]({'where':{'id':_0x2ce64d[_0x9bae('0x46')]['id']}})[_0x9bae('0x24')](handleEntityNotFound(_0x473ab1,null))[_0x9bae('0x24')](removeEntity(_0x473ab1,null))[_0x9bae('0x44')](handleError(_0x473ab1,null));};exports['getFields']=function(_0x4bfa8f,_0x2f4f93,_0xd74c28){var _0xd1b7d8={};var _0x4cceb0={};var _0x15e177;var _0x2cd235;return db[_0x9bae('0x2a')]['findOne']({'where':{'id':_0x4bfa8f['params']['id']}})[_0x9bae('0x24')](handleEntityNotFound(_0x2f4f93,null))[_0x9bae('0x24')](function(_0x26bdbc){if(_0x26bdbc){_0x15e177=_0x26bdbc;_0x4cceb0[_0x9bae('0x2f')]=_[_0x9bae('0x31')](db['VtigerField'][_0x9bae('0x2b')]);_0x4cceb0['query']=_[_0x9bae('0x31')](_0x4bfa8f['query']);_0x4cceb0['filters']=_[_0x9bae('0x33')](_0x4cceb0[_0x9bae('0x2f')],_0x4cceb0[_0x9bae('0x30')]);_0xd1b7d8['attributes']=_['intersection'](_0x4cceb0[_0x9bae('0x2f')],qs[_0x9bae('0x35')](_0x4bfa8f[_0x9bae('0x30')][_0x9bae('0x35')]));_0xd1b7d8[_0x9bae('0x34')]=_0xd1b7d8[_0x9bae('0x34')][_0x9bae('0x36')]?_0xd1b7d8[_0x9bae('0x34')]:_0x4cceb0[_0x9bae('0x2f')];_0xd1b7d8[_0x9bae('0x39')]=qs[_0x9bae('0x3a')](_0x4bfa8f[_0x9bae('0x30')][_0x9bae('0x3a')]);_0xd1b7d8['where']=qs[_0x9bae('0x32')](_['pick'](_0x4bfa8f[_0x9bae('0x30')],_0x4cceb0[_0x9bae('0x32')]));if(_0x4bfa8f[_0x9bae('0x30')][_0x9bae('0x4a')]){_0xd1b7d8[_0x9bae('0x3f')]=_[_0x9bae('0x3c')](_0xd1b7d8[_0x9bae('0x3f')],{'$or':_[_0x9bae('0x29')](_0xd1b7d8[_0x9bae('0x34')],function(_0x124109){var _0x49c495={};_0x49c495[_0x124109]={'$like':'%'+_0x4bfa8f[_0x9bae('0x30')][_0x9bae('0x4a')]+'%'};return _0x49c495;})});}_0xd1b7d8=_[_0x9bae('0x3c')]({},_0xd1b7d8,_0x4bfa8f[_0x9bae('0x3e')]);return _0x15e177[_0x9bae('0x4b')](_0xd1b7d8);}})[_0x9bae('0x24')](function(_0x422280){if(_0x422280){_0x2cd235=_0x422280[_0x9bae('0x36')];if(!_0x4bfa8f[_0x9bae('0x30')][_0x9bae('0x37')](_0x9bae('0x38'))){_0xd1b7d8[_0x9bae('0x1b')]=qs[_0x9bae('0x1b')](_0x4bfa8f[_0x9bae('0x30')]['limit']);_0xd1b7d8[_0x9bae('0x19')]=qs['offset'](_0x4bfa8f['query'][_0x9bae('0x19')]);}return _0x15e177[_0x9bae('0x4b')](_0xd1b7d8);}})['then'](function(_0x4a3f24){if(_0x4a3f24){return _0x4a3f24?{'count':_0x2cd235,'rows':_0x4a3f24}:null;}})[_0x9bae('0x24')](respondWithResult(_0x2f4f93,null))[_0x9bae('0x44')](handleError(_0x2f4f93,null));};exports[_0x9bae('0x4c')]=function(_0x107514,_0xa67f53,_0x407326){var _0x4d9c7d={};var _0x39b736={};var _0x2190de;var _0x3952a0;return db[_0x9bae('0x2a')][_0x9bae('0x4d')]({'where':{'id':_0x107514[_0x9bae('0x46')]['id']}})['then'](handleEntityNotFound(_0xa67f53,null))['then'](function(_0x57fc58){if(_0x57fc58){_0x2190de=_0x57fc58;_0x39b736[_0x9bae('0x2f')]=_[_0x9bae('0x31')](db[_0x9bae('0x4e')][_0x9bae('0x2b')]);_0x39b736[_0x9bae('0x30')]=_[_0x9bae('0x31')](_0x107514[_0x9bae('0x30')]);_0x39b736[_0x9bae('0x32')]=_[_0x9bae('0x33')](_0x39b736[_0x9bae('0x2f')],_0x39b736[_0x9bae('0x30')]);_0x4d9c7d[_0x9bae('0x34')]=_[_0x9bae('0x33')](_0x39b736['model'],qs[_0x9bae('0x35')](_0x107514[_0x9bae('0x30')]['fields']));_0x4d9c7d[_0x9bae('0x34')]=_0x4d9c7d['attributes']['length']?_0x4d9c7d['attributes']:_0x39b736[_0x9bae('0x2f')];_0x4d9c7d[_0x9bae('0x39')]=qs[_0x9bae('0x3a')](_0x107514['query'][_0x9bae('0x3a')]);_0x4d9c7d[_0x9bae('0x3f')]=qs[_0x9bae('0x32')](_['pick'](_0x107514[_0x9bae('0x30')],_0x39b736[_0x9bae('0x32')]));if(_0x107514[_0x9bae('0x30')][_0x9bae('0x4a')]){_0x4d9c7d[_0x9bae('0x3f')]=_[_0x9bae('0x3c')](_0x4d9c7d[_0x9bae('0x3f')],{'$or':_['map'](_0x4d9c7d[_0x9bae('0x34')],function(_0xf82c26){var _0x1a3f06={};_0x1a3f06[_0xf82c26]={'$like':'%'+_0x107514[_0x9bae('0x30')][_0x9bae('0x4a')]+'%'};return _0x1a3f06;})});}_0x4d9c7d=_[_0x9bae('0x3c')]({},_0x4d9c7d,_0x107514[_0x9bae('0x3e')]);return _0x2190de[_0x9bae('0x4c')](_0x4d9c7d);}})[_0x9bae('0x24')](function(_0x561796){if(_0x561796){_0x3952a0=_0x561796['length'];if(!_0x107514[_0x9bae('0x30')][_0x9bae('0x37')](_0x9bae('0x38'))){_0x4d9c7d['limit']=qs[_0x9bae('0x1b')](_0x107514[_0x9bae('0x30')][_0x9bae('0x1b')]);_0x4d9c7d[_0x9bae('0x19')]=qs['offset'](_0x107514[_0x9bae('0x30')][_0x9bae('0x19')]);}return _0x2190de[_0x9bae('0x4c')](_0x4d9c7d);}})[_0x9bae('0x24')](function(_0xa4423e){if(_0xa4423e){return _0xa4423e?{'count':_0x3952a0,'rows':_0xa4423e}:null;}})[_0x9bae('0x24')](respondWithResult(_0xa67f53,null))[_0x9bae('0x44')](handleError(_0xa67f53,null));};exports[_0x9bae('0x4f')]=function(_0x3b2e6a,_0x510541,_0x2a74ea){var _0x2a78b7={};var _0x1d4708={};var _0x1a78f8;var _0x2a8917;return db[_0x9bae('0x2a')][_0x9bae('0x4d')]({'where':{'id':_0x3b2e6a[_0x9bae('0x46')]['id']}})['then'](handleEntityNotFound(_0x510541,null))['then'](function(_0x3fd5bc){if(_0x3fd5bc){_0x1a78f8=_0x3fd5bc;_0x1d4708[_0x9bae('0x2f')]=_[_0x9bae('0x31')](db[_0x9bae('0x4e')][_0x9bae('0x2b')]);_0x1d4708['query']=_[_0x9bae('0x31')](_0x3b2e6a[_0x9bae('0x30')]);_0x1d4708[_0x9bae('0x32')]=_['intersection'](_0x1d4708[_0x9bae('0x2f')],_0x1d4708[_0x9bae('0x30')]);_0x2a78b7[_0x9bae('0x34')]=_[_0x9bae('0x33')](_0x1d4708[_0x9bae('0x2f')],qs[_0x9bae('0x35')](_0x3b2e6a[_0x9bae('0x30')][_0x9bae('0x35')]));_0x2a78b7[_0x9bae('0x34')]=_0x2a78b7['attributes'][_0x9bae('0x36')]?_0x2a78b7[_0x9bae('0x34')]:_0x1d4708[_0x9bae('0x2f')];_0x2a78b7[_0x9bae('0x39')]=qs[_0x9bae('0x3a')](_0x3b2e6a[_0x9bae('0x30')][_0x9bae('0x3a')]);_0x2a78b7[_0x9bae('0x3f')]=qs['filters'](_[_0x9bae('0x3b')](_0x3b2e6a[_0x9bae('0x30')],_0x1d4708[_0x9bae('0x32')]));if(_0x3b2e6a[_0x9bae('0x30')][_0x9bae('0x4a')]){_0x2a78b7['where']=_[_0x9bae('0x3c')](_0x2a78b7[_0x9bae('0x3f')],{'$or':_[_0x9bae('0x29')](_0x2a78b7[_0x9bae('0x34')],function(_0x58cf1b){var _0x1810cd={};_0x1810cd[_0x58cf1b]={'$like':'%'+_0x3b2e6a[_0x9bae('0x30')][_0x9bae('0x4a')]+'%'};return _0x1810cd;})});}_0x2a78b7=_[_0x9bae('0x3c')]({},_0x2a78b7,_0x3b2e6a[_0x9bae('0x3e')]);return _0x1a78f8[_0x9bae('0x4f')](_0x2a78b7);}})[_0x9bae('0x24')](function(_0x19d78c){if(_0x19d78c){_0x2a8917=_0x19d78c[_0x9bae('0x36')];if(!_0x3b2e6a['query'][_0x9bae('0x37')](_0x9bae('0x38'))){_0x2a78b7[_0x9bae('0x1b')]=qs[_0x9bae('0x1b')](_0x3b2e6a['query']['limit']);_0x2a78b7['offset']=qs[_0x9bae('0x19')](_0x3b2e6a[_0x9bae('0x30')][_0x9bae('0x19')]);}return _0x1a78f8[_0x9bae('0x4f')](_0x2a78b7);}})[_0x9bae('0x24')](function(_0x8042a3){if(_0x8042a3){return _0x8042a3?{'count':_0x2a8917,'rows':_0x8042a3}:null;}})['then'](respondWithResult(_0x510541,null))[_0x9bae('0x44')](handleError(_0x510541,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 45a36c4..c5d3a31 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 _0x7b6f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','int_vtiger_configurations'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7b6f,0x16b));var _0xf7b6=function(_0x119e95,_0x51c0a2){_0x119e95=_0x119e95-0x0;var _0x4acc8e=_0x7b6f[_0x119e95];return _0x4acc8e;};'use strict';var _=require('lodash');var util=require(_0xf7b6('0x0'));var logger=require(_0xf7b6('0x1'))(_0xf7b6('0x2'));var moment=require(_0xf7b6('0x3'));var BPromise=require(_0xf7b6('0x4'));var rp=require(_0xf7b6('0x5'));var fs=require('fs');var path=require(_0xf7b6('0x6'));var rimraf=require(_0xf7b6('0x7'));var config=require(_0xf7b6('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xf7b6('0x9')]=function(_0xf48375,_0x5663c7){return _0xf48375['define']('VtigerConfiguration',attributes,{'tableName':_0xf7b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5835=['VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intVtigerConfiguration.attributes','exports'];(function(_0x43bf66,_0x169a45){var _0x199029=function(_0x524c30){while(--_0x524c30){_0x43bf66['push'](_0x43bf66['shift']());}};_0x199029(++_0x169a45);}(_0x5835,0xff));var _0x5583=function(_0x47dc4e,_0xf893ad){_0x47dc4e=_0x47dc4e-0x0;var _0x15a2e9=_0x5835[_0x47dc4e];return _0x15a2e9;};'use strict';var _=require(_0x5583('0x0'));var util=require(_0x5583('0x1'));var logger=require(_0x5583('0x2'))(_0x5583('0x3'));var moment=require(_0x5583('0x4'));var BPromise=require(_0x5583('0x5'));var rp=require(_0x5583('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5583('0x7'));module[_0x5583('0x8')]=function(_0x10bbdd,_0x49ec24){return _0x10bbdd['define'](_0x5583('0x9'),attributes,{'tableName':_0x5583('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 cdca31a..d30d2ea 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 _0x31a2=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57a8ed,_0x537d86){var _0x4964e0=function(_0x3294fd){while(--_0x3294fd){_0x57a8ed['push'](_0x57a8ed['shift']());}};_0x4964e0(++_0x537d86);}(_0x31a2,0x6d));var _0x231a=function(_0x28c439,_0x305b95){_0x28c439=_0x28c439-0x0;var _0x1d2646=_0x31a2[_0x28c439];return _0x1d2646;};'use strict';var _=require(_0x231a('0x0'));var util=require('util');var moment=require(_0x231a('0x1'));var BPromise=require(_0x231a('0x2'));var rs=require(_0x231a('0x3'));var fs=require('fs');var Redis=require(_0x231a('0x4'));var db=require(_0x231a('0x5'))['db'];var utils=require(_0x231a('0x6'));var logger=require('../../config/logger')(_0x231a('0x7'));var config=require(_0x231a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x231a('0x9')][_0x231a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c53bd,_0x430603,_0x220386){return new BPromise(function(_0x383847,_0x3ece5b){return client[_0x231a('0xb')](_0x4c53bd,_0x220386)[_0x231a('0xc')](function(_0x1fb06b){logger[_0x231a('0xd')](_0x231a('0xe'),_0x430603,_0x231a('0xf'));logger[_0x231a('0x10')](_0x231a('0x11'),_0x430603,_0x231a('0xf'),JSON[_0x231a('0x12')](_0x1fb06b));if(_0x1fb06b['error']){if(_0x1fb06b[_0x231a('0x13')][_0x231a('0x14')]===0x1f4){logger['error'](_0x231a('0xe'),_0x430603,_0x1fb06b[_0x231a('0x13')]['message']);return _0x3ece5b(_0x1fb06b[_0x231a('0x13')][_0x231a('0x15')]);}logger[_0x231a('0x13')](_0x231a('0xe'),_0x430603,_0x1fb06b[_0x231a('0x13')][_0x231a('0x15')]);return _0x383847(_0x1fb06b[_0x231a('0x13')][_0x231a('0x15')]);}else{logger['info'](_0x231a('0xe'),_0x430603,_0x231a('0xf'));_0x383847(_0x1fb06b['result']['message']);}})[_0x231a('0x16')](function(_0x365ee4){logger[_0x231a('0x13')](_0x231a('0xe'),_0x430603,_0x365ee4);_0x3ece5b(_0x365ee4);});});} \ No newline at end of file +var _0x43de=['../../config/logger','rpc','../../config/environment','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x143b32,_0x154184){var _0x3a30b9=function(_0x5bdc63){while(--_0x5bdc63){_0x143b32['push'](_0x143b32['shift']());}};_0x3a30b9(++_0x154184);}(_0x43de,0x151));var _0xe43d=function(_0x2baa6c,_0x4b100a){_0x2baa6c=_0x2baa6c-0x0;var _0x30d0d8=_0x43de[_0x2baa6c];return _0x30d0d8;};'use strict';var _=require(_0xe43d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe43d('0x1'));var rs=require(_0xe43d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe43d('0x3'))['db'];var utils=require(_0xe43d('0x4'));var logger=require(_0xe43d('0x5'))(_0xe43d('0x6'));var config=require(_0xe43d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27aa08,_0x7a7169,_0x3ff441){return new BPromise(function(_0x2efa96,_0x41c3df){return client['request'](_0x27aa08,_0x3ff441)[_0xe43d('0x8')](function(_0x390d97){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x7a7169,_0xe43d('0x9'));logger[_0xe43d('0xa')](_0xe43d('0xb'),_0x7a7169,_0xe43d('0x9'),JSON[_0xe43d('0xc')](_0x390d97));if(_0x390d97[_0xe43d('0xd')]){if(_0x390d97[_0xe43d('0xd')][_0xe43d('0xe')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x7a7169,_0x390d97[_0xe43d('0xd')][_0xe43d('0xf')]);return _0x41c3df(_0x390d97['error'][_0xe43d('0xf')]);}logger[_0xe43d('0xd')](_0xe43d('0x10'),_0x7a7169,_0x390d97['error'][_0xe43d('0xf')]);return _0x2efa96(_0x390d97[_0xe43d('0xd')][_0xe43d('0xf')]);}else{logger['info'](_0xe43d('0x10'),_0x7a7169,_0xe43d('0x9'));_0x2efa96(_0x390d97[_0xe43d('0x11')][_0xe43d('0xf')]);}})[_0xe43d('0x12')](function(_0x1880f6){logger[_0xe43d('0xd')](_0xe43d('0x10'),_0x7a7169,_0x1880f6);_0x41c3df(_0x1880f6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b5e6591..0bcd95d 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 _0x2de1=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x2eb42d,_0x5294d2){var _0x225640=function(_0xac30d8){while(--_0xac30d8){_0x2eb42d['push'](_0x2eb42d['shift']());}};_0x225640(++_0x5294d2);}(_0x2de1,0x106));var _0x12de=function(_0x98ea29,_0xa462d8){_0x98ea29=_0x98ea29-0x0;var _0xdbf260=_0x2de1[_0x98ea29];return _0xdbf260;};'use strict';var multer=require(_0x12de('0x0'));var util=require(_0x12de('0x1'));var path=require(_0x12de('0x2'));var timeout=require(_0x12de('0x3'));var express=require(_0x12de('0x4'));var router=express['Router']();var fs_extra=require(_0x12de('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x12de('0x6'));var controller=require(_0x12de('0x7'));router[_0x12de('0x8')]('/',auth[_0x12de('0x9')](),controller[_0x12de('0xa')]);router[_0x12de('0x8')](_0x12de('0xb'),auth['isAuthenticated'](),controller[_0x12de('0xc')]);router[_0x12de('0xd')]('/',auth[_0x12de('0x9')](),controller[_0x12de('0xe')]);router[_0x12de('0xf')]('/:id',auth[_0x12de('0x9')](),controller[_0x12de('0x10')]);router[_0x12de('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x12de('0x12')]);module[_0x12de('0x13')]=router; \ No newline at end of file +var _0x4ecc=['Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x3899a3,_0xcb527){var _0x13e1ce=function(_0x19cdb4){while(--_0x19cdb4){_0x3899a3['push'](_0x3899a3['shift']());}};_0x13e1ce(++_0xcb527);}(_0x4ecc,0x118));var _0xc4ec=function(_0x569d0f,_0x224a07){_0x569d0f=_0x569d0f-0x0;var _0x26d516=_0x4ecc[_0x569d0f];return _0x26d516;};'use strict';var multer=require(_0xc4ec('0x0'));var util=require(_0xc4ec('0x1'));var path=require(_0xc4ec('0x2'));var timeout=require(_0xc4ec('0x3'));var express=require(_0xc4ec('0x4'));var router=express[_0xc4ec('0x5')]();var fs_extra=require(_0xc4ec('0x6'));var auth=require(_0xc4ec('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc4ec('0x8'));var controller=require(_0xc4ec('0x9'));router[_0xc4ec('0xa')]('/',auth[_0xc4ec('0xb')](),controller['index']);router[_0xc4ec('0xa')]('/:id',auth[_0xc4ec('0xb')](),controller[_0xc4ec('0xc')]);router[_0xc4ec('0xd')]('/',auth['isAuthenticated'](),controller[_0xc4ec('0xe')]);router[_0xc4ec('0xf')](_0xc4ec('0x10'),auth[_0xc4ec('0xb')](),controller[_0xc4ec('0x11')]);router['delete'](_0xc4ec('0x10'),auth[_0xc4ec('0xb')](),controller[_0xc4ec('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2acc21d..749805c 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 _0xb7af=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x3207a4,_0x1b9024){var _0x5c8dff=function(_0x4611b9){while(--_0x4611b9){_0x3207a4['push'](_0x3207a4['shift']());}};_0x5c8dff(++_0x1b9024);}(_0xb7af,0x102));var _0xfb7a=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7af[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0xfb7a('0x0'));module[_0xfb7a('0x1')]={'type':{'type':Sequelize[_0xfb7a('0x2')](_0xfb7a('0x3'),_0xfb7a('0x4'),'customVariable',_0xfb7a('0x5'),_0xfb7a('0x6')),'defaultValue':_0xfb7a('0x3')},'content':{'type':Sequelize[_0xfb7a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xfb7a('0x3'),_0xfb7a('0x4'),_0xfb7a('0x8'))},'keyContent':{'type':Sequelize[_0xfb7a('0x7')]},'idField':{'type':Sequelize[_0xfb7a('0x7')]},'nameField':{'type':Sequelize[_0xfb7a('0x7')]},'customField':{'type':Sequelize[_0xfb7a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfb7a('0x7')]}}; \ No newline at end of file +var _0x8fd8=['exports','ENUM','string','customVariable','keyValue','picklist','variable','STRING','sequelize'];(function(_0x21703a,_0x240ea2){var _0x4a30e0=function(_0x915a0d){while(--_0x915a0d){_0x21703a['push'](_0x21703a['shift']());}};_0x4a30e0(++_0x240ea2);}(_0x8fd8,0xce));var _0x88fd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8fd8[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x88fd('0x0'));module[_0x88fd('0x1')]={'type':{'type':Sequelize[_0x88fd('0x2')](_0x88fd('0x3'),'variable',_0x88fd('0x4'),_0x88fd('0x5'),_0x88fd('0x6')),'defaultValue':_0x88fd('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x88fd('0x2')](_0x88fd('0x3'),_0x88fd('0x7'),_0x88fd('0x4'))},'keyContent':{'type':Sequelize[_0x88fd('0x8')]},'idField':{'type':Sequelize[_0x88fd('0x8')]},'nameField':{'type':Sequelize[_0x88fd('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x88fd('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index eece5c3..5ec3985 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 _0xb1a8=['create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','stack','name','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','find'];(function(_0x405001,_0x38b1c6){var _0x7d194e=function(_0x32c78f){while(--_0x32c78f){_0x405001['push'](_0x405001['shift']());}};_0x7d194e(++_0x38b1c6);}(_0xb1a8,0x9b));var _0x8b1a=function(_0x45921d,_0x3f09c9){_0x45921d=_0x45921d-0x0;var _0x5ce3d6=_0xb1a8[_0x45921d];return _0x5ce3d6;};'use strict';var emlformat=require(_0x8b1a('0x0'));var rimraf=require(_0x8b1a('0x1'));var zipdir=require(_0x8b1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b1a('0x3'));var moment=require(_0x8b1a('0x4'));var BPromise=require(_0x8b1a('0x5'));var Mustache=require(_0x8b1a('0x6'));var util=require(_0x8b1a('0x7'));var path=require(_0x8b1a('0x8'));var sox=require(_0x8b1a('0x9'));var csv=require(_0x8b1a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b1a('0xb'));var _=require(_0x8b1a('0xc'));var squel=require(_0x8b1a('0xd'));var crypto=require(_0x8b1a('0xe'));var jsforce=require(_0x8b1a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8b1a('0xa'));var querystring=require(_0x8b1a('0x10'));var Papa=require(_0x8b1a('0x11'));var Redis=require(_0x8b1a('0x12'));var authService=require(_0x8b1a('0x13'));var qs=require(_0x8b1a('0x14'));var as=require(_0x8b1a('0x15'));var hardwareService=require(_0x8b1a('0x16'));var logger=require('../../config/logger')(_0x8b1a('0x17'));var utils=require(_0x8b1a('0x18'));var config=require(_0x8b1a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b1a('0x1a'))['db'];function respondWithStatusCode(_0x405da7,_0x2db239){_0x2db239=_0x2db239||0xcc;return function(_0x223163){if(_0x223163){return _0x405da7['sendStatus'](_0x2db239);}return _0x405da7['status'](_0x2db239)['end']();};}function respondWithResult(_0x1439be,_0x2415b){_0x2415b=_0x2415b||0xc8;return function(_0x2270ab){if(_0x2270ab){return _0x1439be[_0x8b1a('0x1b')](_0x2415b)[_0x8b1a('0x1c')](_0x2270ab);}};}function respondWithFilteredResult(_0x89ef7c,_0x34a49f){return function(_0x490ba3){if(_0x490ba3){var _0x47503b=typeof _0x34a49f['offset']===_0x8b1a('0x1d')&&typeof _0x34a49f[_0x8b1a('0x1e')]==='undefined';var _0x3d22b6=_0x490ba3[_0x8b1a('0x1f')];var _0x3b2985=_0x47503b?0x0:_0x34a49f[_0x8b1a('0x20')];var _0x4c164c=_0x47503b?_0x490ba3['count']:_0x34a49f[_0x8b1a('0x20')]+_0x34a49f[_0x8b1a('0x1e')];var _0x348fe8;if(_0x4c164c>=_0x3d22b6){_0x4c164c=_0x3d22b6;_0x348fe8=0xc8;}else{_0x348fe8=0xce;}_0x89ef7c[_0x8b1a('0x1b')](_0x348fe8);return _0x89ef7c[_0x8b1a('0x21')](_0x8b1a('0x22'),_0x3b2985+'-'+_0x4c164c+'/'+_0x3d22b6)[_0x8b1a('0x1c')](_0x490ba3);}return null;};}function patchUpdates(_0x4fac2e){return function(_0x3956ff){try{jsonpatch[_0x8b1a('0x23')](_0x3956ff,_0x4fac2e,!![]);}catch(_0x1e900d){return BPromise[_0x8b1a('0x24')](_0x1e900d);}return _0x3956ff['save']();};}function saveUpdates(_0x5b666a,_0x3b9155){return function(_0x36e7e8){if(_0x36e7e8){return _0x36e7e8[_0x8b1a('0x25')](_0x5b666a)[_0x8b1a('0x26')](function(_0x39aa9f){return _0x39aa9f;});}return null;};}function removeEntity(_0x13e823,_0x50bc43){return function(_0x40a574){if(_0x40a574){return _0x40a574['destroy']()[_0x8b1a('0x26')](function(){_0x13e823['status'](0xcc)[_0x8b1a('0x27')]();});}};}function handleEntityNotFound(_0x16753e,_0x314ee3){return function(_0x59e8ab){if(!_0x59e8ab){_0x16753e['sendStatus'](0x194);}return _0x59e8ab;};}function handleError(_0x581b5a,_0x395b36){_0x395b36=_0x395b36||0x1f4;return function(_0x2f1029){logger['error'](_0x2f1029[_0x8b1a('0x28')]);if(_0x2f1029[_0x8b1a('0x29')]){delete _0x2f1029['name'];}_0x581b5a['status'](_0x395b36)['send'](_0x2f1029);};}exports['index']=function(_0x21b536,_0x198271){var _0x4afa5d={},_0xd32851={},_0x6ddf50={'count':0x0,'rows':[]};var _0xfde0b0=_[_0x8b1a('0x2a')](db[_0x8b1a('0x2b')][_0x8b1a('0x2c')],function(_0x3ce55a){return{'name':_0x3ce55a[_0x8b1a('0x2d')],'type':_0x3ce55a[_0x8b1a('0x2e')][_0x8b1a('0x2f')]};});_0xd32851[_0x8b1a('0x30')]=_[_0x8b1a('0x2a')](_0xfde0b0,_0x8b1a('0x29'));_0xd32851['query']=_['keys'](_0x21b536[_0x8b1a('0x31')]);_0xd32851[_0x8b1a('0x32')]=_[_0x8b1a('0x33')](_0xd32851['model'],_0xd32851[_0x8b1a('0x31')]);_0x4afa5d[_0x8b1a('0x34')]=_['intersection'](_0xd32851['model'],qs['fields'](_0x21b536[_0x8b1a('0x31')]['fields']));_0x4afa5d[_0x8b1a('0x34')]=_0x4afa5d[_0x8b1a('0x34')][_0x8b1a('0x35')]?_0x4afa5d[_0x8b1a('0x34')]:_0xd32851[_0x8b1a('0x30')];if(!_0x21b536[_0x8b1a('0x31')][_0x8b1a('0x36')](_0x8b1a('0x37'))){_0x4afa5d[_0x8b1a('0x1e')]=qs[_0x8b1a('0x1e')](_0x21b536['query']['limit']);_0x4afa5d['offset']=qs[_0x8b1a('0x20')](_0x21b536[_0x8b1a('0x31')][_0x8b1a('0x20')]);}_0x4afa5d[_0x8b1a('0x38')]=qs[_0x8b1a('0x39')](_0x21b536[_0x8b1a('0x31')][_0x8b1a('0x39')]);_0x4afa5d[_0x8b1a('0x3a')]=qs[_0x8b1a('0x32')](_[_0x8b1a('0x3b')](_0x21b536[_0x8b1a('0x31')],_0xd32851[_0x8b1a('0x32')]),_0xfde0b0);if(_0x21b536['query'][_0x8b1a('0x3c')]){_0x4afa5d[_0x8b1a('0x3a')]=_[_0x8b1a('0x3d')](_0x4afa5d[_0x8b1a('0x3a')],{'$or':_['map'](_0xfde0b0,function(_0x5527c3){if(_0x5527c3[_0x8b1a('0x2e')]!==_0x8b1a('0x3e')){var _0x48b161={};_0x48b161[_0x5527c3[_0x8b1a('0x29')]]={'$like':'%'+_0x21b536[_0x8b1a('0x31')][_0x8b1a('0x3c')]+'%'};return _0x48b161;}})});}_0x4afa5d=_[_0x8b1a('0x3d')]({},_0x4afa5d,_0x21b536[_0x8b1a('0x3f')]);var _0x59eb8b={'where':_0x4afa5d['where']};return db[_0x8b1a('0x2b')]['count'](_0x59eb8b)['then'](function(_0x20cf17){_0x6ddf50[_0x8b1a('0x1f')]=_0x20cf17;if(_0x21b536[_0x8b1a('0x31')][_0x8b1a('0x40')]){_0x4afa5d[_0x8b1a('0x41')]=[{'all':!![]}];}return db[_0x8b1a('0x2b')][_0x8b1a('0x42')](_0x4afa5d);})['then'](function(_0x5c2de0){_0x6ddf50['rows']=_0x5c2de0;return _0x6ddf50;})[_0x8b1a('0x26')](respondWithFilteredResult(_0x198271,_0x4afa5d))[_0x8b1a('0x43')](handleError(_0x198271,null));};exports[_0x8b1a('0x44')]=function(_0x2d4c6a,_0x47986e){var _0x4a3ad0={'raw':!![],'where':{'id':_0x2d4c6a[_0x8b1a('0x45')]['id']}},_0x1027e5={};_0x1027e5[_0x8b1a('0x30')]=_[_0x8b1a('0x46')](db[_0x8b1a('0x2b')][_0x8b1a('0x2c')]);_0x1027e5[_0x8b1a('0x31')]=_[_0x8b1a('0x46')](_0x2d4c6a[_0x8b1a('0x31')]);_0x1027e5['filters']=_[_0x8b1a('0x33')](_0x1027e5[_0x8b1a('0x30')],_0x1027e5[_0x8b1a('0x31')]);_0x4a3ad0[_0x8b1a('0x34')]=_['intersection'](_0x1027e5['model'],qs[_0x8b1a('0x47')](_0x2d4c6a[_0x8b1a('0x31')][_0x8b1a('0x47')]));_0x4a3ad0[_0x8b1a('0x34')]=_0x4a3ad0[_0x8b1a('0x34')][_0x8b1a('0x35')]?_0x4a3ad0[_0x8b1a('0x34')]:_0x1027e5['model'];if(_0x2d4c6a[_0x8b1a('0x31')][_0x8b1a('0x40')]){_0x4a3ad0['include']=[{'all':!![]}];}_0x4a3ad0=_[_0x8b1a('0x3d')]({},_0x4a3ad0,_0x2d4c6a[_0x8b1a('0x3f')]);return db['VtigerField'][_0x8b1a('0x48')](_0x4a3ad0)[_0x8b1a('0x26')](handleEntityNotFound(_0x47986e,null))['then'](respondWithResult(_0x47986e,null))[_0x8b1a('0x43')](handleError(_0x47986e,null));};exports[_0x8b1a('0x49')]=function(_0x33b775,_0x23fb84){return db['VtigerField'][_0x8b1a('0x49')](_0x33b775[_0x8b1a('0x4a')],{})[_0x8b1a('0x26')](respondWithResult(_0x23fb84,0xc9))[_0x8b1a('0x43')](handleError(_0x23fb84,null));};exports[_0x8b1a('0x25')]=function(_0xf5d6cc,_0x243507){if(_0xf5d6cc[_0x8b1a('0x4a')]['id']){delete _0xf5d6cc[_0x8b1a('0x4a')]['id'];}return db[_0x8b1a('0x2b')][_0x8b1a('0x48')]({'where':{'id':_0xf5d6cc['params']['id']}})[_0x8b1a('0x26')](handleEntityNotFound(_0x243507,null))['then'](saveUpdates(_0xf5d6cc[_0x8b1a('0x4a')],null))[_0x8b1a('0x26')](respondWithResult(_0x243507,null))[_0x8b1a('0x43')](handleError(_0x243507,null));};exports[_0x8b1a('0x4b')]=function(_0x16340f,_0x2dc0d7){return db[_0x8b1a('0x2b')][_0x8b1a('0x48')]({'where':{'id':_0x16340f[_0x8b1a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dc0d7,null))[_0x8b1a('0x26')](removeEntity(_0x2dc0d7,null))[_0x8b1a('0x43')](handleError(_0x2dc0d7,null));}; \ No newline at end of file +var _0xd03a=['offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','params','keys','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x92fdf6,_0x2db5ea){var _0x16aa9e=function(_0x4f6cbe){while(--_0x4f6cbe){_0x92fdf6['push'](_0x92fdf6['shift']());}};_0x16aa9e(++_0x2db5ea);}(_0xd03a,0x1a2));var _0xad03=function(_0xb6a1fc,_0x270184){_0xb6a1fc=_0xb6a1fc-0x0;var _0x45269f=_0xd03a[_0xb6a1fc];return _0x45269f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad03('0x0'));var zipdir=require(_0xad03('0x1'));var jsonpatch=require(_0xad03('0x2'));var rp=require(_0xad03('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad03('0x4'));var util=require(_0xad03('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xad03('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad03('0x7'));var squel=require(_0xad03('0x8'));var crypto=require(_0xad03('0x9'));var jsforce=require(_0xad03('0xa'));var deskjs=require(_0xad03('0xb'));var toCsv=require(_0xad03('0x6'));var querystring=require(_0xad03('0xc'));var Papa=require(_0xad03('0xd'));var Redis=require('ioredis');var authService=require(_0xad03('0xe'));var qs=require(_0xad03('0xf'));var as=require(_0xad03('0x10'));var hardwareService=require(_0xad03('0x11'));var logger=require(_0xad03('0x12'))(_0xad03('0x13'));var utils=require(_0xad03('0x14'));var config=require(_0xad03('0x15'));var licenseUtil=require(_0xad03('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8a38c1,_0x28fc82){_0x28fc82=_0x28fc82||0xcc;return function(_0x36d9a7){if(_0x36d9a7){return _0x8a38c1[_0xad03('0x17')](_0x28fc82);}return _0x8a38c1['status'](_0x28fc82)['end']();};}function respondWithResult(_0x138749,_0x204f00){_0x204f00=_0x204f00||0xc8;return function(_0x46340e){if(_0x46340e){return _0x138749[_0xad03('0x18')](_0x204f00)[_0xad03('0x19')](_0x46340e);}};}function respondWithFilteredResult(_0x16153d,_0x1365e9){return function(_0xc670c2){if(_0xc670c2){var _0x31a0e=typeof _0x1365e9[_0xad03('0x1a')]===_0xad03('0x1b')&&typeof _0x1365e9['limit']==='undefined';var _0x2db7ee=_0xc670c2[_0xad03('0x1c')];var _0x1a296d=_0x31a0e?0x0:_0x1365e9[_0xad03('0x1a')];var _0x4903da=_0x31a0e?_0xc670c2[_0xad03('0x1c')]:_0x1365e9[_0xad03('0x1a')]+_0x1365e9[_0xad03('0x1d')];var _0xd7a440;if(_0x4903da>=_0x2db7ee){_0x4903da=_0x2db7ee;_0xd7a440=0xc8;}else{_0xd7a440=0xce;}_0x16153d[_0xad03('0x18')](_0xd7a440);return _0x16153d['set'](_0xad03('0x1e'),_0x1a296d+'-'+_0x4903da+'/'+_0x2db7ee)[_0xad03('0x19')](_0xc670c2);}return null;};}function patchUpdates(_0x4a1334){return function(_0x2d4286){try{jsonpatch[_0xad03('0x1f')](_0x2d4286,_0x4a1334,!![]);}catch(_0x3bfe04){return BPromise[_0xad03('0x20')](_0x3bfe04);}return _0x2d4286[_0xad03('0x21')]();};}function saveUpdates(_0x54f1fe,_0xba864f){return function(_0x1a123a){if(_0x1a123a){return _0x1a123a[_0xad03('0x22')](_0x54f1fe)[_0xad03('0x23')](function(_0x2b9655){return _0x2b9655;});}return null;};}function removeEntity(_0x3e687a,_0x5c80c5){return function(_0x52cd19){if(_0x52cd19){return _0x52cd19[_0xad03('0x24')]()[_0xad03('0x23')](function(){_0x3e687a[_0xad03('0x18')](0xcc)[_0xad03('0x25')]();});}};}function handleEntityNotFound(_0x31657f,_0x31fe69){return function(_0x1ea6de){if(!_0x1ea6de){_0x31657f[_0xad03('0x17')](0x194);}return _0x1ea6de;};}function handleError(_0x302a0b,_0x208a04){_0x208a04=_0x208a04||0x1f4;return function(_0x3b48f8){logger[_0xad03('0x26')](_0x3b48f8[_0xad03('0x27')]);if(_0x3b48f8[_0xad03('0x28')]){delete _0x3b48f8[_0xad03('0x28')];}_0x302a0b[_0xad03('0x18')](_0x208a04)[_0xad03('0x29')](_0x3b48f8);};}exports[_0xad03('0x2a')]=function(_0x33679c,_0x46a7d1){var _0xd349a2={},_0x5d3e00={},_0xe68b08={'count':0x0,'rows':[]};var _0x27cbed=_[_0xad03('0x2b')](db[_0xad03('0x2c')][_0xad03('0x2d')],function(_0x25130a){return{'name':_0x25130a[_0xad03('0x2e')],'type':_0x25130a['type'][_0xad03('0x2f')]};});_0x5d3e00[_0xad03('0x30')]=_[_0xad03('0x2b')](_0x27cbed,_0xad03('0x28'));_0x5d3e00['query']=_['keys'](_0x33679c[_0xad03('0x31')]);_0x5d3e00['filters']=_['intersection'](_0x5d3e00[_0xad03('0x30')],_0x5d3e00['query']);_0xd349a2['attributes']=_[_0xad03('0x32')](_0x5d3e00[_0xad03('0x30')],qs[_0xad03('0x33')](_0x33679c[_0xad03('0x31')]['fields']));_0xd349a2[_0xad03('0x34')]=_0xd349a2[_0xad03('0x34')]['length']?_0xd349a2[_0xad03('0x34')]:_0x5d3e00[_0xad03('0x30')];if(!_0x33679c[_0xad03('0x31')][_0xad03('0x35')](_0xad03('0x36'))){_0xd349a2['limit']=qs[_0xad03('0x1d')](_0x33679c[_0xad03('0x31')][_0xad03('0x1d')]);_0xd349a2[_0xad03('0x1a')]=qs['offset'](_0x33679c[_0xad03('0x31')]['offset']);}_0xd349a2[_0xad03('0x37')]=qs[_0xad03('0x38')](_0x33679c['query'][_0xad03('0x38')]);_0xd349a2[_0xad03('0x39')]=qs[_0xad03('0x3a')](_[_0xad03('0x3b')](_0x33679c['query'],_0x5d3e00[_0xad03('0x3a')]),_0x27cbed);if(_0x33679c[_0xad03('0x31')][_0xad03('0x3c')]){_0xd349a2[_0xad03('0x39')]=_[_0xad03('0x3d')](_0xd349a2['where'],{'$or':_[_0xad03('0x2b')](_0x27cbed,function(_0x1ec1b1){if(_0x1ec1b1[_0xad03('0x3e')]!==_0xad03('0x3f')){var _0x58e304={};_0x58e304[_0x1ec1b1['name']]={'$like':'%'+_0x33679c[_0xad03('0x31')][_0xad03('0x3c')]+'%'};return _0x58e304;}})});}_0xd349a2=_[_0xad03('0x3d')]({},_0xd349a2,_0x33679c[_0xad03('0x40')]);var _0x1fe2b4={'where':_0xd349a2['where']};return db[_0xad03('0x2c')][_0xad03('0x1c')](_0x1fe2b4)[_0xad03('0x23')](function(_0x39cc46){_0xe68b08[_0xad03('0x1c')]=_0x39cc46;if(_0x33679c[_0xad03('0x31')]['includeAll']){_0xd349a2[_0xad03('0x41')]=[{'all':!![]}];}return db[_0xad03('0x2c')][_0xad03('0x42')](_0xd349a2);})[_0xad03('0x23')](function(_0x5d3c75){_0xe68b08['rows']=_0x5d3c75;return _0xe68b08;})[_0xad03('0x23')](respondWithFilteredResult(_0x46a7d1,_0xd349a2))[_0xad03('0x43')](handleError(_0x46a7d1,null));};exports['show']=function(_0x2a957c,_0x1844cd){var _0x5e7848={'raw':!![],'where':{'id':_0x2a957c[_0xad03('0x44')]['id']}},_0x366894={};_0x366894['model']=_[_0xad03('0x45')](db[_0xad03('0x2c')]['rawAttributes']);_0x366894[_0xad03('0x31')]=_[_0xad03('0x45')](_0x2a957c['query']);_0x366894[_0xad03('0x3a')]=_[_0xad03('0x32')](_0x366894['model'],_0x366894[_0xad03('0x31')]);_0x5e7848[_0xad03('0x34')]=_[_0xad03('0x32')](_0x366894[_0xad03('0x30')],qs[_0xad03('0x33')](_0x2a957c[_0xad03('0x31')][_0xad03('0x33')]));_0x5e7848[_0xad03('0x34')]=_0x5e7848[_0xad03('0x34')][_0xad03('0x46')]?_0x5e7848['attributes']:_0x366894[_0xad03('0x30')];if(_0x2a957c[_0xad03('0x31')]['includeAll']){_0x5e7848[_0xad03('0x41')]=[{'all':!![]}];}_0x5e7848=_[_0xad03('0x3d')]({},_0x5e7848,_0x2a957c[_0xad03('0x40')]);return db[_0xad03('0x2c')][_0xad03('0x47')](_0x5e7848)['then'](handleEntityNotFound(_0x1844cd,null))[_0xad03('0x23')](respondWithResult(_0x1844cd,null))[_0xad03('0x43')](handleError(_0x1844cd,null));};exports[_0xad03('0x48')]=function(_0x38291b,_0x323dd8){return db[_0xad03('0x2c')][_0xad03('0x48')](_0x38291b[_0xad03('0x49')],{})[_0xad03('0x23')](respondWithResult(_0x323dd8,0xc9))[_0xad03('0x43')](handleError(_0x323dd8,null));};exports['update']=function(_0x29f683,_0xed9213){if(_0x29f683['body']['id']){delete _0x29f683[_0xad03('0x49')]['id'];}return db[_0xad03('0x2c')][_0xad03('0x47')]({'where':{'id':_0x29f683[_0xad03('0x44')]['id']}})[_0xad03('0x23')](handleEntityNotFound(_0xed9213,null))[_0xad03('0x23')](saveUpdates(_0x29f683[_0xad03('0x49')],null))[_0xad03('0x23')](respondWithResult(_0xed9213,null))['catch'](handleError(_0xed9213,null));};exports['destroy']=function(_0x255234,_0x5cd77){return db[_0xad03('0x2c')][_0xad03('0x47')]({'where':{'id':_0x255234['params']['id']}})[_0xad03('0x23')](handleEntityNotFound(_0x5cd77,null))[_0xad03('0x23')](removeEntity(_0x5cd77,null))[_0xad03('0x43')](handleError(_0x5cd77,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index bd0dfd9..22c9ee7 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 _0x8f66=['bluebird','request-promise','path','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util','api','moment'];(function(_0x493c40,_0x3dd8ed){var _0x54eb88=function(_0x52c8ea){while(--_0x52c8ea){_0x493c40['push'](_0x493c40['shift']());}};_0x54eb88(++_0x3dd8ed);}(_0x8f66,0x9d));var _0x68f6=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x8f66[_0x516927];return _0x30749b;};'use strict';var _=require('lodash');var util=require(_0x68f6('0x0'));var logger=require('../../config/logger')(_0x68f6('0x1'));var moment=require(_0x68f6('0x2'));var BPromise=require(_0x68f6('0x3'));var rp=require(_0x68f6('0x4'));var fs=require('fs');var path=require(_0x68f6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x1b249e,_0xf6c418){return _0x1b249e['define'](_0x68f6('0x6'),attributes,{'tableName':_0x68f6('0x7'),'paranoid':![],'indexes':[{'name':_0x68f6('0x8'),'fields':['idField',_0x68f6('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326e=['VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x407041,_0x2571be){var _0x107d8c=function(_0x5c8ef9){while(--_0x5c8ef9){_0x407041['push'](_0x407041['shift']());}};_0x107d8c(++_0x2571be);}(_0x326e,0x1a8));var _0xe326=function(_0x7c18b3,_0x3cd707){_0x7c18b3=_0x7c18b3-0x0;var _0x36c353=_0x326e[_0x7c18b3];return _0x36c353;};'use strict';var _=require(_0xe326('0x0'));var util=require(_0xe326('0x1'));var logger=require('../../config/logger')(_0xe326('0x2'));var moment=require(_0xe326('0x3'));var BPromise=require(_0xe326('0x4'));var rp=require(_0xe326('0x5'));var fs=require('fs');var path=require(_0xe326('0x6'));var rimraf=require(_0xe326('0x7'));var config=require(_0xe326('0x8'));var attributes=require(_0xe326('0x9'));module['exports']=function(_0x298597,_0x211ac8){return _0x298597['define'](_0xe326('0xa'),attributes,{'tableName':_0xe326('0xb'),'paranoid':![],'indexes':[{'name':_0xe326('0xc'),'fields':['idField',_0xe326('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 5886a04..ea2ba6b 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 _0x6642=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x49754d,_0x171c18){var _0x29326a=function(_0x2f637f){while(--_0x2f637f){_0x49754d['push'](_0x49754d['shift']());}};_0x29326a(++_0x171c18);}(_0x6642,0x18b));var _0x2664=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6642[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2664('0x0'));var util=require(_0x2664('0x1'));var moment=require(_0x2664('0x2'));var BPromise=require(_0x2664('0x3'));var rs=require(_0x2664('0x4'));var fs=require('fs');var Redis=require(_0x2664('0x5'));var db=require(_0x2664('0x6'))['db'];var utils=require(_0x2664('0x7'));var logger=require(_0x2664('0x8'))('rpc');var config=require(_0x2664('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2664('0xa')][_0x2664('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487923,_0x409050,_0x35a7e2){return new BPromise(function(_0x4006b7,_0x1d29e6){return client['request'](_0x487923,_0x35a7e2)[_0x2664('0xc')](function(_0x4cc6c4){logger[_0x2664('0xd')](_0x2664('0xe'),_0x409050,'request\x20sent');logger[_0x2664('0xf')](_0x2664('0x10'),_0x409050,'request\x20sent',JSON['stringify'](_0x4cc6c4));if(_0x4cc6c4['error']){if(_0x4cc6c4[_0x2664('0x11')][_0x2664('0x12')]===0x1f4){logger['error'](_0x2664('0xe'),_0x409050,_0x4cc6c4[_0x2664('0x11')][_0x2664('0x13')]);return _0x1d29e6(_0x4cc6c4['error'][_0x2664('0x13')]);}logger[_0x2664('0x11')](_0x2664('0xe'),_0x409050,_0x4cc6c4[_0x2664('0x11')][_0x2664('0x13')]);return _0x4006b7(_0x4cc6c4[_0x2664('0x11')][_0x2664('0x13')]);}else{logger[_0x2664('0xd')](_0x2664('0xe'),_0x409050,_0x2664('0x14'));_0x4006b7(_0x4cc6c4[_0x2664('0x15')][_0x2664('0x13')]);}})[_0x2664('0x16')](function(_0x2df9d2){logger['error'](_0x2664('0xe'),_0x409050,_0x2df9d2);_0x1d29e6(_0x2df9d2);});});} \ No newline at end of file +var _0x1846=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x2ed8d6,_0xff8d2f){var _0x2d8cf9=function(_0x30c781){while(--_0x30c781){_0x2ed8d6['push'](_0x2ed8d6['shift']());}};_0x2d8cf9(++_0xff8d2f);}(_0x1846,0x12b));var _0x6184=function(_0x110bb7,_0x56c479){_0x110bb7=_0x110bb7-0x0;var _0x1e6ac2=_0x1846[_0x110bb7];return _0x1e6ac2;};'use strict';var _=require('lodash');var util=require(_0x6184('0x0'));var moment=require(_0x6184('0x1'));var BPromise=require(_0x6184('0x2'));var rs=require(_0x6184('0x3'));var fs=require('fs');var Redis=require(_0x6184('0x4'));var db=require(_0x6184('0x5'))['db'];var utils=require(_0x6184('0x6'));var logger=require(_0x6184('0x7'))(_0x6184('0x8'));var config=require('../../config/environment');var jayson=require(_0x6184('0x9'));var client=jayson['client'][_0x6184('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c57f6,_0x3249e6,_0x2163ae){return new BPromise(function(_0x1b17a9,_0x164093){return client['request'](_0x9c57f6,_0x2163ae)[_0x6184('0xb')](function(_0xd8d86f){logger['info'](_0x6184('0xc'),_0x3249e6,_0x6184('0xd'));logger[_0x6184('0xe')](_0x6184('0xf'),_0x3249e6,'request\x20sent',JSON['stringify'](_0xd8d86f));if(_0xd8d86f['error']){if(_0xd8d86f[_0x6184('0x10')][_0x6184('0x11')]===0x1f4){logger[_0x6184('0x10')](_0x6184('0xc'),_0x3249e6,_0xd8d86f['error']['message']);return _0x164093(_0xd8d86f[_0x6184('0x10')][_0x6184('0x12')]);}logger[_0x6184('0x10')]('VtigerField,\x20%s,\x20%s',_0x3249e6,_0xd8d86f[_0x6184('0x10')]['message']);return _0x1b17a9(_0xd8d86f['error'][_0x6184('0x12')]);}else{logger['info'](_0x6184('0xc'),_0x3249e6,_0x6184('0xd'));_0x1b17a9(_0xd8d86f[_0x6184('0x13')][_0x6184('0x12')]);}})[_0x6184('0x14')](function(_0x1c4cca){logger[_0x6184('0x10')](_0x6184('0xc'),_0x3249e6,_0x1c4cca);_0x164093(_0x1c4cca);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index ace831e..37b8f08 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 _0xa417=['create','post','addConfiguration','put','delete','exports','util','path','express','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x9f6d87,_0x610e66){var _0x33ac69=function(_0xa42ca5){while(--_0xa42ca5){_0x9f6d87['push'](_0x9f6d87['shift']());}};_0x33ac69(++_0x610e66);}(_0xa417,0xf6));var _0x7a41=function(_0x22fc25,_0x549453){_0x22fc25=_0x22fc25-0x0;var _0x5102c5=_0xa417[_0x22fc25];return _0x5102c5;};'use strict';var multer=require('multer');var util=require(_0x7a41('0x0'));var path=require(_0x7a41('0x1'));var timeout=require('connect-timeout');var express=require(_0x7a41('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7a41('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7a41('0x4'));var controller=require(_0x7a41('0x5'));router[_0x7a41('0x6')]('/',auth[_0x7a41('0x7')](),controller[_0x7a41('0x8')]);router[_0x7a41('0x6')](_0x7a41('0x9'),auth[_0x7a41('0x7')](),controller[_0x7a41('0xa')]);router[_0x7a41('0x6')](_0x7a41('0xb'),auth[_0x7a41('0x7')](),controller[_0x7a41('0xc')]);router[_0x7a41('0x6')](_0x7a41('0xd'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x7a41('0x7')](),controller[_0x7a41('0xe')]);router[_0x7a41('0xf')](_0x7a41('0xb'),auth[_0x7a41('0x7')](),controller[_0x7a41('0x10')]);router[_0x7a41('0x11')](_0x7a41('0x9'),auth[_0x7a41('0x7')](),controller['update']);router[_0x7a41('0x12')](_0x7a41('0x9'),auth[_0x7a41('0x7')](),controller['destroy']);module[_0x7a41('0x13')]=router; \ No newline at end of file +var _0x229e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','post','create','/:id/configurations','addConfiguration','put','destroy','multer','util','connect-timeout','express','Router'];(function(_0x3e8a5d,_0x580e0a){var _0x26675e=function(_0x52ead6){while(--_0x52ead6){_0x3e8a5d['push'](_0x3e8a5d['shift']());}};_0x26675e(++_0x580e0a);}(_0x229e,0x12f));var _0xe229=function(_0x3b5bd8,_0x31c269){_0x3b5bd8=_0x3b5bd8-0x0;var _0x4f32c1=_0x229e[_0x3b5bd8];return _0x4f32c1;};'use strict';var multer=require(_0xe229('0x0'));var util=require(_0xe229('0x1'));var path=require('path');var timeout=require(_0xe229('0x2'));var express=require(_0xe229('0x3'));var router=express[_0xe229('0x4')]();var fs_extra=require(_0xe229('0x5'));var auth=require(_0xe229('0x6'));var interaction=require(_0xe229('0x7'));var config=require(_0xe229('0x8'));var controller=require(_0xe229('0x9'));router[_0xe229('0xa')]('/',auth[_0xe229('0xb')](),controller[_0xe229('0xc')]);router[_0xe229('0xa')](_0xe229('0xd'),auth[_0xe229('0xb')](),controller[_0xe229('0xe')]);router[_0xe229('0xa')]('/:id/configurations',auth[_0xe229('0xb')](),controller['getConfigurations']);router[_0xe229('0xa')](_0xe229('0xf'),auth[_0xe229('0xb')](),controller['getFields']);router[_0xe229('0x10')]('/',auth[_0xe229('0xb')](),controller[_0xe229('0x11')]);router['post'](_0xe229('0x12'),auth['isAuthenticated'](),controller[_0xe229('0x13')]);router[_0xe229('0x14')](_0xe229('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xe229('0xb')](),controller[_0xe229('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b45ed4d..3c3950e 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 _0xc1c6=['integrationTab','newTab','sequelize','exports','STRING','password','ENUM'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x14b3f7,_0x3b1be8){_0x14b3f7=_0x14b3f7-0x0;var _0x4c9f71=_0xc1c6[_0x14b3f7];return _0x4c9f71;};'use strict';var Sequelize=require(_0x6c1c('0x0'));module[_0x6c1c('0x1')]={'name':{'type':Sequelize[_0x6c1c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6c1c('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6c1c('0x2')]},'token':{'type':Sequelize[_0x6c1c('0x2')]},'remoteUri':{'type':Sequelize[_0x6c1c('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x6c1c('0x3'),'token'),'defaultValue':_0x6c1c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5'),_0x6c1c('0x6')),'defaultValue':_0x6c1c('0x5')}}; \ No newline at end of file +var _0xb016=['newTab','sequelize','exports','STRING','remoteUri','password','token','integrationTab'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0xb016,0x159));var _0x6b01=function(_0x5e7027,_0x58234c){_0x5e7027=_0x5e7027-0x0;var _0x47e478=_0xb016[_0x5e7027];return _0x47e478;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6b01('0x2')]},'token':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'authType':{'type':Sequelize['ENUM'](_0x6b01('0x4'),_0x6b01('0x5')),'defaultValue':_0x6b01('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b01('0x6'),_0x6b01('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 9e73f2f..51fe3ff 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 _0x5ec6=['Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','findOne','ZendeskConfiguration','length','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','base64','headers'];(function(_0x493cd0,_0x328691){var _0x2ce6f1=function(_0x4f27ea){while(--_0x4f27ea){_0x493cd0['push'](_0x493cd0['shift']());}};_0x2ce6f1(++_0x328691);}(_0x5ec6,0x7f));var _0x65ec=function(_0x188f9b,_0x1e0791){_0x188f9b=_0x188f9b-0x0;var _0x5477ec=_0x5ec6[_0x188f9b];return _0x5477ec;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e52c8,_0x2af7d6){_0x2af7d6=_0x2af7d6||0xcc;return function(_0x411a7b){if(_0x411a7b){return _0x3e52c8[_0x65ec('0x15')](_0x2af7d6);}return _0x3e52c8[_0x65ec('0x16')](_0x2af7d6)[_0x65ec('0x17')]();};}function respondWithResult(_0x344724,_0x3edbfd){_0x3edbfd=_0x3edbfd||0xc8;return function(_0x58c81f){if(_0x58c81f){return _0x344724[_0x65ec('0x16')](_0x3edbfd)[_0x65ec('0x18')](_0x58c81f);}};}function respondWithFilteredResult(_0x35d06b,_0x4bbe88){return function(_0x5a0442){if(_0x5a0442){var _0x25cdd4=typeof _0x4bbe88[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x4bbe88['limit']===_0x65ec('0x1a');var _0x286eac=_0x5a0442[_0x65ec('0x1b')];var _0xb4ed90=_0x25cdd4?0x0:_0x4bbe88[_0x65ec('0x19')];var _0xd81ed3=_0x25cdd4?_0x5a0442[_0x65ec('0x1b')]:_0x4bbe88[_0x65ec('0x19')]+_0x4bbe88[_0x65ec('0x1c')];var _0x441ad0;if(_0xd81ed3>=_0x286eac){_0xd81ed3=_0x286eac;_0x441ad0=0xc8;}else{_0x441ad0=0xce;}_0x35d06b[_0x65ec('0x16')](_0x441ad0);return _0x35d06b[_0x65ec('0x1d')](_0x65ec('0x1e'),_0xb4ed90+'-'+_0xd81ed3+'/'+_0x286eac)[_0x65ec('0x18')](_0x5a0442);}return null;};}function patchUpdates(_0x3804a4){return function(_0x1d538c){try{jsonpatch[_0x65ec('0x1f')](_0x1d538c,_0x3804a4,!![]);}catch(_0x130d4e){return BPromise[_0x65ec('0x20')](_0x130d4e);}return _0x1d538c['save']();};}function saveUpdates(_0x170703,_0x297fba){return function(_0x89e640){if(_0x89e640){return _0x89e640[_0x65ec('0x21')](_0x170703)[_0x65ec('0x22')](function(_0x163e55){return _0x163e55;});}return null;};}function removeEntity(_0x47288d,_0x58239f){return function(_0xf1ff97){if(_0xf1ff97){return _0xf1ff97[_0x65ec('0x23')]()[_0x65ec('0x22')](function(){_0x47288d[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x156793,_0x21426b){return function(_0xf5adc7){if(!_0xf5adc7){_0x156793[_0x65ec('0x15')](0x194);}return _0xf5adc7;};}function handleError(_0x4c846b,_0x10baef){_0x10baef=_0x10baef||0x1f4;return function(_0x30f0cf){logger[_0x65ec('0x24')](_0x30f0cf[_0x65ec('0x25')]);if(_0x30f0cf['name']){delete _0x30f0cf[_0x65ec('0x26')];}_0x4c846b['status'](_0x10baef)[_0x65ec('0x27')](_0x30f0cf);};}exports[_0x65ec('0x28')]=function(_0x1d0b5c,_0x30366c){var _0x14431d={},_0x46d4c1={},_0x46bf66={'count':0x0,'rows':[]};var _0x39410f=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x4b435c){return{'name':_0x4b435c['fieldName'],'type':_0x4b435c[_0x65ec('0x2c')]['key']};});_0x46d4c1[_0x65ec('0x2d')]=_[_0x65ec('0x29')](_0x39410f,'name');_0x46d4c1[_0x65ec('0x2e')]=_[_0x65ec('0x2f')](_0x1d0b5c[_0x65ec('0x2e')]);_0x46d4c1[_0x65ec('0x30')]=_['intersection'](_0x46d4c1[_0x65ec('0x2d')],_0x46d4c1[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x31')]=_[_0x65ec('0x32')](_0x46d4c1[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x14431d[_0x65ec('0x31')]=_0x14431d[_0x65ec('0x31')]['length']?_0x14431d[_0x65ec('0x31')]:_0x46d4c1[_0x65ec('0x2d')];if(!_0x1d0b5c['query'][_0x65ec('0x34')](_0x65ec('0x35'))){_0x14431d[_0x65ec('0x1c')]=qs[_0x65ec('0x1c')](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x1c')]);_0x14431d[_0x65ec('0x19')]=qs['offset'](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x19')]);}_0x14431d[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1d0b5c['query'][_0x65ec('0x37')]);_0x14431d[_0x65ec('0x38')]=qs[_0x65ec('0x30')](_[_0x65ec('0x39')](_0x1d0b5c['query'],_0x46d4c1['filters']),_0x39410f);if(_0x1d0b5c[_0x65ec('0x2e')]['filter']){_0x14431d[_0x65ec('0x38')]=_[_0x65ec('0x3a')](_0x14431d['where'],{'$or':_[_0x65ec('0x29')](_0x39410f,function(_0x1fbc2b){if(_0x1fbc2b[_0x65ec('0x2c')]!==_0x65ec('0x3b')){var _0x3cffbf={};_0x3cffbf[_0x1fbc2b[_0x65ec('0x26')]]={'$like':'%'+_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x3c')]+'%'};return _0x3cffbf;}})});}_0x14431d=_[_0x65ec('0x3a')]({},_0x14431d,_0x1d0b5c[_0x65ec('0x3d')]);var _0x3561ef={'where':_0x14431d['where']};return db[_0x65ec('0x2a')]['count'](_0x3561ef)[_0x65ec('0x22')](function(_0x278d43){_0x46bf66[_0x65ec('0x1b')]=_0x278d43;if(_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x3e')]){_0x14431d[_0x65ec('0x3f')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x65ec('0x40')](_0x14431d);})['then'](function(_0x5d8d57){_0x46bf66[_0x65ec('0x41')]=_0x5d8d57;return _0x46bf66;})[_0x65ec('0x22')](respondWithFilteredResult(_0x30366c,_0x14431d))[_0x65ec('0x42')](handleError(_0x30366c,null));};exports[_0x65ec('0x43')]=function(_0x1d475e,_0x524235){var _0x4843ca={'raw':![],'where':{'id':_0x1d475e[_0x65ec('0x44')]['id']}},_0x1aef6d={};_0x1aef6d[_0x65ec('0x2d')]=_[_0x65ec('0x2f')](db[_0x65ec('0x2a')]['rawAttributes']);_0x1aef6d['query']=_[_0x65ec('0x2f')](_0x1d475e[_0x65ec('0x2e')]);_0x1aef6d[_0x65ec('0x30')]=_[_0x65ec('0x32')](_0x1aef6d[_0x65ec('0x2d')],_0x1aef6d[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x31')]=_['intersection'](_0x1aef6d[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x1d475e[_0x65ec('0x2e')]['fields']));_0x4843ca[_0x65ec('0x31')]=_0x4843ca[_0x65ec('0x31')]['length']?_0x4843ca[_0x65ec('0x31')]:_0x1aef6d[_0x65ec('0x2d')];if(_0x1d475e[_0x65ec('0x2e')][_0x65ec('0x3e')]){_0x4843ca[_0x65ec('0x3f')]=[{'all':!![]}];}_0x4843ca=_['merge']({},_0x4843ca,_0x1d475e[_0x65ec('0x3d')]);return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x4843ca)[_0x65ec('0x22')](handleEntityNotFound(_0x524235,null))['then'](respondWithResult(_0x524235,null))[_0x65ec('0x42')](handleError(_0x524235,null));};exports['create']=function(_0x1ed0f9,_0x169890){return db[_0x65ec('0x2a')]['create'](_0x1ed0f9['body'],{})[_0x65ec('0x22')](respondWithResult(_0x169890,0xc9))[_0x65ec('0x42')](handleError(_0x169890,null));};exports[_0x65ec('0x21')]=function(_0x2111af,_0x1b3732){if(_0x2111af[_0x65ec('0x46')]['id']){delete _0x2111af[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x45')]({'where':{'id':_0x2111af[_0x65ec('0x44')]['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x1b3732,null))[_0x65ec('0x22')](saveUpdates(_0x2111af[_0x65ec('0x46')],null))[_0x65ec('0x22')](respondWithResult(_0x1b3732,null))[_0x65ec('0x42')](handleError(_0x1b3732,null));};exports[_0x65ec('0x23')]=function(_0x22c28c,_0x5eb6d3){return db[_0x65ec('0x2a')][_0x65ec('0x45')]({'where':{'id':_0x22c28c['params']['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x5eb6d3,null))[_0x65ec('0x22')](removeEntity(_0x5eb6d3,null))[_0x65ec('0x42')](handleError(_0x5eb6d3,null));};exports['getConfigurations']=function(_0x3eee1e,_0x2b2756,_0x27843b){var _0x50f1c3={};var _0xabb4e3={};var _0x5e5e48;var _0x4c9905;return db[_0x65ec('0x2a')][_0x65ec('0x47')]({'where':{'id':_0x3eee1e[_0x65ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b2756,null))[_0x65ec('0x22')](function(_0x28a686){if(_0x28a686){_0x5e5e48=_0x28a686;_0xabb4e3[_0x65ec('0x2d')]=_[_0x65ec('0x2f')](db[_0x65ec('0x48')][_0x65ec('0x2b')]);_0xabb4e3[_0x65ec('0x2e')]=_[_0x65ec('0x2f')](_0x3eee1e[_0x65ec('0x2e')]);_0xabb4e3['filters']=_['intersection'](_0xabb4e3[_0x65ec('0x2d')],_0xabb4e3['query']);_0x50f1c3[_0x65ec('0x31')]=_['intersection'](_0xabb4e3[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x50f1c3[_0x65ec('0x31')]=_0x50f1c3[_0x65ec('0x31')][_0x65ec('0x49')]?_0x50f1c3['attributes']:_0xabb4e3[_0x65ec('0x2d')];_0x50f1c3[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x37')]);_0x50f1c3['where']=qs[_0x65ec('0x30')](_[_0x65ec('0x39')](_0x3eee1e[_0x65ec('0x2e')],_0xabb4e3[_0x65ec('0x30')]));if(_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x3c')]){_0x50f1c3[_0x65ec('0x38')]=_[_0x65ec('0x3a')](_0x50f1c3['where'],{'$or':_[_0x65ec('0x29')](_0x50f1c3[_0x65ec('0x31')],function(_0x12bb9b){var _0x233b9b={};_0x233b9b[_0x12bb9b]={'$like':'%'+_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x3c')]+'%'};return _0x233b9b;})});}_0x50f1c3=_[_0x65ec('0x3a')]({},_0x50f1c3,_0x3eee1e['options']);return _0x5e5e48['getConfigurations'](_0x50f1c3);}})[_0x65ec('0x22')](function(_0x56dd47){if(_0x56dd47){_0x4c9905=_0x56dd47[_0x65ec('0x49')];if(!_0x3eee1e[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x50f1c3[_0x65ec('0x1c')]=qs[_0x65ec('0x1c')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x1c')]);_0x50f1c3[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x3eee1e['query']['offset']);}return _0x5e5e48[_0x65ec('0x4a')](_0x50f1c3);}})[_0x65ec('0x22')](function(_0xd14e5){if(_0xd14e5){return _0xd14e5?{'count':_0x4c9905,'rows':_0xd14e5}:null;}})['then'](respondWithResult(_0x2b2756,null))[_0x65ec('0x42')](handleError(_0x2b2756,null));};exports[_0x65ec('0x4b')]=function(_0x17059d,_0x3d761f,_0x21096d){if(_0x17059d[_0x65ec('0x46')]['id']){delete _0x17059d[_0x65ec('0x46')]['id'];}return db['ZendeskAccount'][_0x65ec('0x47')]({'where':{'id':_0x17059d[_0x65ec('0x44')]['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x3d761f,null))[_0x65ec('0x22')](function(_0x3da824){if(_0x3da824){_0x17059d[_0x65ec('0x46')][_0x65ec('0x4c')]=_0x3da824['id'];_0x17059d[_0x65ec('0x46')][_0x65ec('0x4d')]=integrations['getSubjects'](_0x17059d['body'][_0x65ec('0x4e')],_0x17059d['body']['type']);_0x17059d[_0x65ec('0x46')][_0x65ec('0x4f')]=integrations[_0x65ec('0x50')](_0x17059d['body']['channel'],_0x17059d[_0x65ec('0x46')]['type']);return db['ZendeskConfiguration']['create'](_0x17059d[_0x65ec('0x46')],{'include':[{'model':db['ZendeskField'],'as':_0x65ec('0x4d')},{'model':db[_0x65ec('0x51')],'as':_0x65ec('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d761f,null))['catch'](handleError(_0x3d761f,null));};exports[_0x65ec('0x52')]=function(_0x54f1cb,_0x244d12,_0x1c2972){var _0xf78f6a='';return db[_0x65ec('0x2a')][_0x65ec('0x47')]({'where':{'id':_0x54f1cb[_0x65ec('0x44')]['id']},'attributes':['id',_0x65ec('0x53'),_0x65ec('0x54'),_0x65ec('0x55'),_0x65ec('0x56'),'remoteUri']})[_0x65ec('0x22')](handleEntityNotFound(_0x244d12,null))['then'](function(_0x46e454){if(_0x46e454){_0xf78f6a=_0x46e454[_0x65ec('0x57')];var _0x292f81=_0xf78f6a[_0x65ec('0x58')](-0x1);if(_0x292f81==='/'){_0xf78f6a=_0xf78f6a['substring'](0x0,_0xf78f6a[_0x65ec('0x59')](_0x292f81));}var _0x556c5e={'method':_0x65ec('0x5a'),'uri':util[_0x65ec('0x5b')](_0x65ec('0x5c'),_0xf78f6a,_0x65ec('0x5d')),'json':!![]};switch(_0x46e454['authType']){case'password':_0x556c5e['headers']={'Authorization':util[_0x65ec('0x5b')](_0x65ec('0x5e'),new Buffer(util[_0x65ec('0x5b')](_0x65ec('0x5f'),_0x46e454[_0x65ec('0x53')],_0x46e454[_0x65ec('0x54')]))[_0x65ec('0x60')](_0x65ec('0x61')))};break;case _0x65ec('0x55'):_0x556c5e[_0x65ec('0x62')]={'Authorization':util[_0x65ec('0x5b')](_0x65ec('0x5e'),new Buffer(util[_0x65ec('0x5b')]('%s/token:%s',_0x46e454[_0x65ec('0x53')],_0x46e454[_0x65ec('0x55')]))[_0x65ec('0x60')](_0x65ec('0x61')))};break;default:throw new db[(_0x65ec('0x63'))][(_0x65ec('0x64'))](_0x65ec('0x65'));}return rp(_0x556c5e);}})[_0x65ec('0x22')](function(_0x3b5640){if(_0x3b5640){var _0x26ac0e=['subject',_0x65ec('0x66'),'group','assignee'];_[_0x65ec('0x67')](_0x3b5640[_0x65ec('0x5d')],function(_0x272432){return _0x26ac0e[_0x65ec('0x68')](_0x272432[_0x65ec('0x2c')]);});return{'count':_0x3b5640[_0x65ec('0x5d')][_0x65ec('0x49')],'rows':_[_0x65ec('0x29')](_0x3b5640['ticket_fields'],function(_0x1f5fe7){return{'id':_0x1f5fe7['id'],'name':_0x1f5fe7['position']>0x7?_0x1f5fe7[_0x65ec('0x69')]:_0x1f5fe7[_0x65ec('0x2c')],'custom':_0x1f5fe7[_0x65ec('0x6a')]>0x7?!![]:![],'options':_0x1f5fe7['system_field_options']?_0x1f5fe7[_0x65ec('0x6b')]:_0x1f5fe7[_0x65ec('0x6c')]?_0x1f5fe7[_0x65ec('0x6c')]:[]};})};}})[_0x65ec('0x22')](respondWithResult(_0x244d12,null))[_0x65ec('0x42')](function(_0x77ebd2){var _0x1172f3=_0x54f1cb['query'][_0x65ec('0x6d')]?0x1f4:_0x77ebd2[_0x65ec('0x6e')]||0x1f4;logger[_0x65ec('0x24')](_0x65ec('0x6f'),'getFields',_0x1172f3,JSON['stringify'](_0x77ebd2));delete _0x77ebd2[_0x65ec('0x26')];if(_0x1172f3===0x191){_0x1172f3=0x190;}_0x244d12[_0x65ec('0x16')](_0x1172f3)[_0x65ec('0x27')](_0x54f1cb[_0x65ec('0x2e')][_0x65ec('0x6d')]?{'message':_0x65ec('0x70'),'statusCode':_0x77ebd2['statusCode']}:_0x77ebd2);});}; \ No newline at end of file +var _0xd64b=['undefined','count','Content-Range','apply','update','then','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit'];(function(_0x3432c9,_0x513893){var _0xc0053f=function(_0x1654d3){while(--_0x1654d3){_0x3432c9['push'](_0x3432c9['shift']());}};_0xc0053f(++_0x513893);}(_0xd64b,0xc1));var _0xbd64=function(_0x116255,_0x1bb57b){_0x116255=_0x116255-0x0;var _0x5cfb32=_0xd64b[_0x116255];return _0x5cfb32;};'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'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['ZendeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53'),_0xbd64('0x54'),'authType',_0xbd64('0x55')]})['then'](handleEntityNotFound(_0x301f42,null))[_0xbd64('0x22')](function(_0x36ebb5){if(_0x36ebb5){_0x32e611=_0x36ebb5[_0xbd64('0x55')];var _0x819774=_0x32e611['slice'](-0x1);if(_0x819774==='/'){_0x32e611=_0x32e611[_0xbd64('0x56')](0x0,_0x32e611['lastIndexOf'](_0x819774));}var _0x14f79e={'method':_0xbd64('0x57'),'uri':util[_0xbd64('0x58')](_0xbd64('0x59'),_0x32e611,_0xbd64('0x5a')),'json':!![]};switch(_0x36ebb5['authType']){case _0xbd64('0x53'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util['format'](_0xbd64('0x5c'),new Buffer(util[_0xbd64('0x58')](_0xbd64('0x5d'),_0x36ebb5[_0xbd64('0x52')],_0x36ebb5['password']))[_0xbd64('0x5e')]('base64'))};break;case _0xbd64('0x54'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util[_0xbd64('0x58')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x36ebb5['username'],_0x36ebb5[_0xbd64('0x54')]))[_0xbd64('0x5e')](_0xbd64('0x5f')))};break;default:throw new db[(_0xbd64('0x60'))][(_0xbd64('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0x14f79e);}})[_0xbd64('0x22')](function(_0x23de71){if(_0x23de71){var _0xac13e6=[_0xbd64('0x62'),_0xbd64('0x63'),'group',_0xbd64('0x64')];_[_0xbd64('0x65')](_0x23de71[_0xbd64('0x5a')],function(_0x808467){return _0xac13e6['includes'](_0x808467['type']);});return{'count':_0x23de71[_0xbd64('0x5a')][_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x23de71[_0xbd64('0x5a')],function(_0x18b0f0){return{'id':_0x18b0f0['id'],'name':_0x18b0f0[_0xbd64('0x66')]>0x7?_0x18b0f0[_0xbd64('0x67')]:_0x18b0f0[_0xbd64('0x29')],'custom':_0x18b0f0['position']>0x7?!![]:![],'options':_0x18b0f0[_0xbd64('0x68')]?_0x18b0f0['system_field_options']:_0x18b0f0[_0xbd64('0x69')]?_0x18b0f0[_0xbd64('0x69')]:[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))['catch'](function(_0x15b625){var _0x5c30f9=_0x3d7e47['query'][_0xbd64('0x6a')]?0x1f4:_0x15b625[_0xbd64('0x6b')]||0x1f4;logger[_0xbd64('0x6c')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd64('0x51'),_0x5c30f9,JSON[_0xbd64('0x6d')](_0x15b625));delete _0x15b625[_0xbd64('0x2c')];if(_0x5c30f9===0x191){_0x5c30f9=0x190;}_0x301f42[_0xbd64('0x18')](_0x5c30f9)['send'](_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x6a')]?{'message':_0xbd64('0x6e'),'statusCode':_0x15b625[_0xbd64('0x6b')]}:_0x15b625);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index af6ac4b..d238b4c 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 _0x177f=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x30597e,_0x3d3e66){var _0x17b1cf=function(_0xa3d995){while(--_0xa3d995){_0x30597e['push'](_0x30597e['shift']());}};_0x17b1cf(++_0x3d3e66);}(_0x177f,0xa6));var _0xf177=function(_0x2c9bdc,_0x5addbb){_0x2c9bdc=_0x2c9bdc-0x0;var _0x28186a=_0x177f[_0x2c9bdc];return _0x28186a;};'use strict';var _=require(_0xf177('0x0'));var util=require(_0xf177('0x1'));var logger=require(_0xf177('0x2'))(_0xf177('0x3'));var moment=require(_0xf177('0x4'));var BPromise=require(_0xf177('0x5'));var rp=require(_0xf177('0x6'));var fs=require('fs');var path=require(_0xf177('0x7'));var rimraf=require('rimraf');var config=require(_0xf177('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5a3f4c,_0x24f1ab){return _0x5a3f4c[_0xf177('0x9')]('ZendeskAccount',attributes,{'tableName':_0xf177('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb88=['exports','define','int_zendesk_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x571686,_0x2f5300){var _0x1d5349=function(_0xf3ccee){while(--_0xf3ccee){_0x571686['push'](_0x571686['shift']());}};_0x1d5349(++_0x2f5300);}(_0xbb88,0x78));var _0x8bb8=function(_0x214444,_0x581139){_0x214444=_0x214444-0x0;var _0x5343c8=_0xbb88[_0x214444];return _0x5343c8;};'use strict';var _=require(_0x8bb8('0x0'));var util=require('util');var logger=require(_0x8bb8('0x1'))(_0x8bb8('0x2'));var moment=require('moment');var BPromise=require(_0x8bb8('0x3'));var rp=require(_0x8bb8('0x4'));var fs=require('fs');var path=require(_0x8bb8('0x5'));var rimraf=require(_0x8bb8('0x6'));var config=require(_0x8bb8('0x7'));var attributes=require(_0x8bb8('0x8'));var integrations=require(_0x8bb8('0x9'));module[_0x8bb8('0xa')]=function(_0x10ca5d,_0x5d877f){return _0x10ca5d[_0x8bb8('0xb')]('ZendeskAccount',attributes,{'tableName':_0x8bb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 3a1f7fe..bf8f54b 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 _0x3f12=['find','ShowZendeskAccount','stringify','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','options','raw','where','attributes','include','map','model','then','GetZendeskAccount','ZendeskAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f12,0xf1));var _0x23f1=function(_0x79e9c0,_0x3e4f23){_0x79e9c0=_0x79e9c0-0x0;var _0x41e287=_0x3f12[_0x79e9c0];return _0x41e287;};'use strict';var _=require('lodash');var util=require(_0x23f1('0x0'));var moment=require('moment');var BPromise=require(_0x23f1('0x1'));var rs=require(_0x23f1('0x2'));var fs=require('fs');var Redis=require(_0x23f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x23f1('0x4'));var logger=require(_0x23f1('0x5'))(_0x23f1('0x6'));var config=require(_0x23f1('0x7'));var jayson=require(_0x23f1('0x8'));var client=jayson[_0x23f1('0x9')][_0x23f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x365ae1,_0x59b9ee,_0x23fc61){return new BPromise(function(_0x351490,_0x1dea19){return client[_0x23f1('0xb')](_0x365ae1,_0x23fc61)['then'](function(_0x11a266){logger[_0x23f1('0xc')](_0x23f1('0xd'),_0x59b9ee,_0x23f1('0xe'));logger[_0x23f1('0xf')](_0x23f1('0x10'),_0x59b9ee,_0x23f1('0xe'),JSON['stringify'](_0x11a266));if(_0x11a266[_0x23f1('0x11')]){if(_0x11a266['error']['code']===0x1f4){logger['error'](_0x23f1('0xd'),_0x59b9ee,_0x11a266['error']['message']);return _0x1dea19(_0x11a266['error'][_0x23f1('0x12')]);}logger[_0x23f1('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x59b9ee,_0x11a266[_0x23f1('0x11')][_0x23f1('0x12')]);return _0x351490(_0x11a266[_0x23f1('0x11')]['message']);}else{logger[_0x23f1('0xc')](_0x23f1('0xd'),_0x59b9ee,_0x23f1('0xe'));_0x351490(_0x11a266[_0x23f1('0x13')][_0x23f1('0x12')]);}})[_0x23f1('0x14')](function(_0x40db0d){logger[_0x23f1('0x11')](_0x23f1('0xd'),_0x59b9ee,_0x40db0d);_0x1dea19(_0x40db0d);});});}exports['GetZendeskAccount']=function(_0x150e1d){var _0x10987c=this;return new Promise(function(_0x27389a,_0x2217ee){return db['ZendeskAccount']['findAll']({'raw':_0x150e1d[_0x23f1('0x15')]?_0x150e1d[_0x23f1('0x15')][_0x23f1('0x16')]===undefined?!![]:![]:!![],'where':_0x150e1d['options']?_0x150e1d[_0x23f1('0x15')][_0x23f1('0x17')]||null:null,'attributes':_0x150e1d[_0x23f1('0x15')]?_0x150e1d[_0x23f1('0x15')][_0x23f1('0x18')]||null:null,'limit':_0x150e1d[_0x23f1('0x15')]?_0x150e1d[_0x23f1('0x15')]['limit']||null:null,'include':_0x150e1d['options']?_0x150e1d[_0x23f1('0x15')][_0x23f1('0x19')]?_[_0x23f1('0x1a')](_0x150e1d[_0x23f1('0x15')]['include'],function(_0x4e5b1f){return{'model':db[_0x4e5b1f[_0x23f1('0x1b')]],'as':_0x4e5b1f['as'],'attributes':_0x4e5b1f['attributes'],'include':_0x4e5b1f[_0x23f1('0x19')]?_[_0x23f1('0x1a')](_0x4e5b1f['include'],function(_0x4b90f7){return{'model':db[_0x4b90f7['model']],'as':_0x4b90f7['as'],'attributes':_0x4b90f7['attributes'],'include':_0x4b90f7[_0x23f1('0x19')]?_[_0x23f1('0x1a')](_0x4b90f7['include'],function(_0x1f112e){return{'model':db[_0x1f112e[_0x23f1('0x1b')]],'as':_0x1f112e['as'],'attributes':_0x1f112e[_0x23f1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x23f1('0x1c')](function(_0x5cbbe9){logger[_0x23f1('0xc')](_0x23f1('0x1d'),_0x150e1d);logger[_0x23f1('0xf')](_0x23f1('0x1d'),_0x150e1d,JSON['stringify'](_0x5cbbe9));_0x27389a(_0x5cbbe9);})[_0x23f1('0x14')](function(_0x579109){logger[_0x23f1('0x11')](_0x23f1('0x1d'),_0x579109[_0x23f1('0x12')],_0x150e1d);_0x2217ee(_0x10987c[_0x23f1('0x11')](0x1f4,_0x579109[_0x23f1('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x42bae8){var _0x3891aa=this;return new Promise(function(_0x24e36b,_0x9ea0b3){return db[_0x23f1('0x1e')][_0x23f1('0x1f')]({'raw':_0x42bae8[_0x23f1('0x15')]?_0x42bae8[_0x23f1('0x15')][_0x23f1('0x16')]===undefined?!![]:![]:!![],'where':_0x42bae8['options']?_0x42bae8[_0x23f1('0x15')]['where']||null:null,'attributes':_0x42bae8[_0x23f1('0x15')]?_0x42bae8[_0x23f1('0x15')][_0x23f1('0x18')]||null:null,'include':_0x42bae8[_0x23f1('0x15')]?_0x42bae8['options'][_0x23f1('0x19')]?_['map'](_0x42bae8[_0x23f1('0x15')]['include'],function(_0x1bddd1){return{'model':db[_0x1bddd1['model']],'as':_0x1bddd1['as'],'attributes':_0x1bddd1['attributes'],'include':_0x1bddd1[_0x23f1('0x19')]?_[_0x23f1('0x1a')](_0x1bddd1[_0x23f1('0x19')],function(_0x53a1b5){return{'model':db[_0x53a1b5['model']],'as':_0x53a1b5['as'],'attributes':_0x53a1b5[_0x23f1('0x18')],'include':_0x53a1b5[_0x23f1('0x19')]?_[_0x23f1('0x1a')](_0x53a1b5[_0x23f1('0x19')],function(_0x13d45a){return{'model':db[_0x13d45a['model']],'as':_0x13d45a['as'],'attributes':_0x13d45a['attributes']};}):[]};}):[]};}):[]:[]})[_0x23f1('0x1c')](function(_0x26a210){logger[_0x23f1('0xc')]('ShowZendeskAccount',_0x42bae8);logger[_0x23f1('0xf')](_0x23f1('0x20'),_0x42bae8,JSON[_0x23f1('0x21')](_0x26a210));_0x24e36b(_0x26a210);})[_0x23f1('0x14')](function(_0x2f81d5){logger[_0x23f1('0x11')](_0x23f1('0x20'),_0x2f81d5[_0x23f1('0x12')],_0x42bae8);_0x9ea0b3(_0x3891aa[_0x23f1('0x11')](0x1f4,_0x2f81d5['message']));});});}; \ No newline at end of file +var _0x55f6=['then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','limit','map','model','attributes','include','debug','ShowZendeskAccount','find','stringify','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x338d6b,_0x4b8c06){var _0x3c1ed4=function(_0xabb4ab){while(--_0xabb4ab){_0x338d6b['push'](_0x338d6b['shift']());}};_0x3c1ed4(++_0x4b8c06);}(_0x55f6,0xc2));var _0x655f=function(_0x4a4e87,_0x485791){_0x4a4e87=_0x4a4e87-0x0;var _0x83444f=_0x55f6[_0x4a4e87];return _0x83444f;};'use strict';var _=require(_0x655f('0x0'));var util=require(_0x655f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x655f('0x2'));var fs=require('fs');var Redis=require(_0x655f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x655f('0x4'));var logger=require(_0x655f('0x5'))('rpc');var config=require(_0x655f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x655f('0x7')][_0x655f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x71f9c1,_0x586c32,_0x5dc01e){return new BPromise(function(_0x5e3ee6,_0x2c6c9f){return client[_0x655f('0x9')](_0x71f9c1,_0x5dc01e)[_0x655f('0xa')](function(_0x4dca43){logger[_0x655f('0xb')](_0x655f('0xc'),_0x586c32,'request\x20sent');logger['debug'](_0x655f('0xd'),_0x586c32,_0x655f('0xe'),JSON['stringify'](_0x4dca43));if(_0x4dca43[_0x655f('0xf')]){if(_0x4dca43[_0x655f('0xf')][_0x655f('0x10')]===0x1f4){logger[_0x655f('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x586c32,_0x4dca43['error'][_0x655f('0x11')]);return _0x2c6c9f(_0x4dca43['error'][_0x655f('0x11')]);}logger[_0x655f('0xf')](_0x655f('0xc'),_0x586c32,_0x4dca43[_0x655f('0xf')][_0x655f('0x11')]);return _0x5e3ee6(_0x4dca43[_0x655f('0xf')][_0x655f('0x11')]);}else{logger[_0x655f('0xb')](_0x655f('0xc'),_0x586c32,_0x655f('0xe'));_0x5e3ee6(_0x4dca43[_0x655f('0x12')][_0x655f('0x11')]);}})[_0x655f('0x13')](function(_0x2ac84e){logger[_0x655f('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x586c32,_0x2ac84e);_0x2c6c9f(_0x2ac84e);});});}exports[_0x655f('0x14')]=function(_0x137a8c){var _0x5616aa=this;return new Promise(function(_0xe72de,_0x1bff9b){return db[_0x655f('0x15')][_0x655f('0x16')]({'raw':_0x137a8c[_0x655f('0x17')]?_0x137a8c[_0x655f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x137a8c['options']?_0x137a8c[_0x655f('0x17')][_0x655f('0x18')]||null:null,'attributes':_0x137a8c['options']?_0x137a8c[_0x655f('0x17')]['attributes']||null:null,'limit':_0x137a8c['options']?_0x137a8c[_0x655f('0x17')][_0x655f('0x19')]||null:null,'include':_0x137a8c['options']?_0x137a8c[_0x655f('0x17')]['include']?_[_0x655f('0x1a')](_0x137a8c[_0x655f('0x17')]['include'],function(_0x43594f){return{'model':db[_0x43594f[_0x655f('0x1b')]],'as':_0x43594f['as'],'attributes':_0x43594f[_0x655f('0x1c')],'include':_0x43594f[_0x655f('0x1d')]?_['map'](_0x43594f['include'],function(_0xff32af){return{'model':db[_0xff32af[_0x655f('0x1b')]],'as':_0xff32af['as'],'attributes':_0xff32af[_0x655f('0x1c')],'include':_0xff32af['include']?_[_0x655f('0x1a')](_0xff32af[_0x655f('0x1d')],function(_0x2e4da7){return{'model':db[_0x2e4da7['model']],'as':_0x2e4da7['as'],'attributes':_0x2e4da7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x296a4f){logger[_0x655f('0xb')](_0x655f('0x14'),_0x137a8c);logger[_0x655f('0x1e')](_0x655f('0x14'),_0x137a8c,JSON['stringify'](_0x296a4f));_0xe72de(_0x296a4f);})[_0x655f('0x13')](function(_0x10c181){logger[_0x655f('0xf')](_0x655f('0x14'),_0x10c181[_0x655f('0x11')],_0x137a8c);_0x1bff9b(_0x5616aa['error'](0x1f4,_0x10c181['message']));});});};exports[_0x655f('0x1f')]=function(_0xef865a){var _0x37e2e9=this;return new Promise(function(_0x9c6473,_0x3304d5){return db[_0x655f('0x15')][_0x655f('0x20')]({'raw':_0xef865a[_0x655f('0x17')]?_0xef865a[_0x655f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xef865a[_0x655f('0x17')]?_0xef865a[_0x655f('0x17')]['where']||null:null,'attributes':_0xef865a[_0x655f('0x17')]?_0xef865a[_0x655f('0x17')]['attributes']||null:null,'include':_0xef865a[_0x655f('0x17')]?_0xef865a[_0x655f('0x17')][_0x655f('0x1d')]?_[_0x655f('0x1a')](_0xef865a[_0x655f('0x17')][_0x655f('0x1d')],function(_0x28d6cc){return{'model':db[_0x28d6cc['model']],'as':_0x28d6cc['as'],'attributes':_0x28d6cc[_0x655f('0x1c')],'include':_0x28d6cc[_0x655f('0x1d')]?_[_0x655f('0x1a')](_0x28d6cc['include'],function(_0x464130){return{'model':db[_0x464130['model']],'as':_0x464130['as'],'attributes':_0x464130['attributes'],'include':_0x464130[_0x655f('0x1d')]?_['map'](_0x464130['include'],function(_0xce0857){return{'model':db[_0xce0857['model']],'as':_0xce0857['as'],'attributes':_0xce0857[_0x655f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x655f('0xa')](function(_0x4535d4){logger['info'](_0x655f('0x1f'),_0xef865a);logger[_0x655f('0x1e')](_0x655f('0x1f'),_0xef865a,JSON[_0x655f('0x21')](_0x4535d4));_0x9c6473(_0x4535d4);})[_0x655f('0x13')](function(_0x3048d8){logger[_0x655f('0xf')]('ShowZendeskAccount',_0x3048d8[_0x655f('0x11')],_0xef865a);_0x3304d5(_0x37e2e9[_0x655f('0xf')](0x1f4,_0x3048d8[_0x655f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index b350bb6..c88f3d8 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x15e9d7,_0x24e78e){var _0x111892=function(_0x1b759b){while(--_0x1b759b){_0x15e9d7['push'](_0x15e9d7['shift']());}};_0x111892(++_0x24e78e);}(_0xda3f,0xec));var _0xfda3=function(_0x4f50db,_0x369ddd){_0x4f50db=_0x4f50db-0x0;var _0x2b057d=_0xda3f[_0x4f50db];return _0x2b057d;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0xb688,0xcf));var _0x8b68=function(_0x365b05,_0x59d929){_0x365b05=_0x365b05-0x0;var _0x371d47=_0xb688[_0x365b05];return _0x371d47;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9ed397c..f3aac57 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 _0xf5b1=['exports','STRING','sequelize'];(function(_0x199ef0,_0x2c6956){var _0xab77ac=function(_0x5db098){while(--_0x5db098){_0x199ef0['push'](_0x199ef0['shift']());}};_0xab77ac(++_0x2c6956);}(_0xf5b1,0x1f4));var _0x1f5b=function(_0x4ed3ca,_0x37f142){_0x4ed3ca=_0x4ed3ca-0x0;var _0x26bc7a=_0xf5b1[_0x4ed3ca];return _0x26bc7a;};'use strict';var Sequelize=require(_0x1f5b('0x0'));module[_0x1f5b('0x1')]={'name':{'type':Sequelize[_0x1f5b('0x2')]},'description':{'type':Sequelize[_0x1f5b('0x2')]}}; \ No newline at end of file +var _0x85e8=['STRING','sequelize'];(function(_0x1a4504,_0x1df2ab){var _0x27cc55=function(_0x5c32b2){while(--_0x5c32b2){_0x1a4504['push'](_0x1a4504['shift']());}};_0x27cc55(++_0x1df2ab);}(_0x85e8,0x123));var _0x885e=function(_0x44e061,_0x578093){_0x44e061=_0x44e061-0x0;var _0x428896=_0x85e8[_0x44e061];return _0x428896;};'use strict';var Sequelize=require(_0x885e('0x0'));module['exports']={'name':{'type':Sequelize[_0x885e('0x1')]},'description':{'type':Sequelize[_0x885e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 6d16d63..6e84cac 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 _0xf755=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','options','include','findAll','catch','params','keys','intersection','includeAll','merge','find','create','body','findOne','ZendeskField','pick','getFields','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xf755,0x1a6));var _0x5f75=function(_0x3c3a56,_0x4ae73b){_0x3c3a56=_0x3c3a56-0x0;var _0x4584ab=_0xf755[_0x3c3a56];return _0x4584ab;};'use strict';var emlformat=require(_0x5f75('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f75('0x1'));var jsonpatch=require(_0x5f75('0x2'));var rp=require(_0x5f75('0x3'));var moment=require(_0x5f75('0x4'));var BPromise=require(_0x5f75('0x5'));var Mustache=require('mustache');var util=require(_0x5f75('0x6'));var path=require(_0x5f75('0x7'));var sox=require(_0x5f75('0x8'));var csv=require('to-csv');var ejs=require(_0x5f75('0x9'));var fs=require('fs');var fs_extra=require(_0x5f75('0xa'));var _=require(_0x5f75('0xb'));var squel=require(_0x5f75('0xc'));var crypto=require(_0x5f75('0xd'));var jsforce=require(_0x5f75('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5f75('0xf'));var querystring=require(_0x5f75('0x10'));var Papa=require(_0x5f75('0x11'));var Redis=require(_0x5f75('0x12'));var authService=require(_0x5f75('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5f75('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f75('0x15'))(_0x5f75('0x16'));var utils=require(_0x5f75('0x17'));var config=require(_0x5f75('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f75('0x19'))['db'];function respondWithStatusCode(_0x194f94,_0x4a1ed6){_0x4a1ed6=_0x4a1ed6||0xcc;return function(_0x2e9a1c){if(_0x2e9a1c){return _0x194f94[_0x5f75('0x1a')](_0x4a1ed6);}return _0x194f94['status'](_0x4a1ed6)['end']();};}function respondWithResult(_0x13f6b6,_0x26555f){_0x26555f=_0x26555f||0xc8;return function(_0xc0e6cb){if(_0xc0e6cb){return _0x13f6b6['status'](_0x26555f)[_0x5f75('0x1b')](_0xc0e6cb);}};}function respondWithFilteredResult(_0x2c47ba,_0x1dbdf0){return function(_0x3df763){if(_0x3df763){var _0x34ccd2=typeof _0x1dbdf0[_0x5f75('0x1c')]==='undefined'&&typeof _0x1dbdf0[_0x5f75('0x1d')]===_0x5f75('0x1e');var _0x280bc9=_0x3df763[_0x5f75('0x1f')];var _0x18574e=_0x34ccd2?0x0:_0x1dbdf0['offset'];var _0xf0cb4a=_0x34ccd2?_0x3df763['count']:_0x1dbdf0[_0x5f75('0x1c')]+_0x1dbdf0[_0x5f75('0x1d')];var _0x5ab3b0;if(_0xf0cb4a>=_0x280bc9){_0xf0cb4a=_0x280bc9;_0x5ab3b0=0xc8;}else{_0x5ab3b0=0xce;}_0x2c47ba[_0x5f75('0x20')](_0x5ab3b0);return _0x2c47ba[_0x5f75('0x21')](_0x5f75('0x22'),_0x18574e+'-'+_0xf0cb4a+'/'+_0x280bc9)[_0x5f75('0x1b')](_0x3df763);}return null;};}function patchUpdates(_0x43097d){return function(_0x1da054){try{jsonpatch[_0x5f75('0x23')](_0x1da054,_0x43097d,!![]);}catch(_0x5e16b0){return BPromise[_0x5f75('0x24')](_0x5e16b0);}return _0x1da054[_0x5f75('0x25')]();};}function saveUpdates(_0x2e4150,_0x2ad501){return function(_0x2ffa1f){if(_0x2ffa1f){return _0x2ffa1f[_0x5f75('0x26')](_0x2e4150)[_0x5f75('0x27')](function(_0x9bfccb){return _0x9bfccb;});}return null;};}function removeEntity(_0x3a09ce,_0x52c072){return function(_0x2062e8){if(_0x2062e8){return _0x2062e8[_0x5f75('0x28')]()[_0x5f75('0x27')](function(){_0x3a09ce[_0x5f75('0x20')](0xcc)[_0x5f75('0x29')]();});}};}function handleEntityNotFound(_0xef9879,_0x4fe0ac){return function(_0x43f4fa){if(!_0x43f4fa){_0xef9879[_0x5f75('0x1a')](0x194);}return _0x43f4fa;};}function handleError(_0x45c97e,_0x2d0603){_0x2d0603=_0x2d0603||0x1f4;return function(_0x80bb71){logger[_0x5f75('0x2a')](_0x80bb71[_0x5f75('0x2b')]);if(_0x80bb71[_0x5f75('0x2c')]){delete _0x80bb71[_0x5f75('0x2c')];}_0x45c97e['status'](_0x2d0603)[_0x5f75('0x2d')](_0x80bb71);};}exports[_0x5f75('0x2e')]=function(_0x4ec58a,_0x43915c){var _0x45e6f9={},_0x2c05a3={},_0x429517={'count':0x0,'rows':[]};var _0x4c3eb9=_[_0x5f75('0x2f')](db[_0x5f75('0x30')][_0x5f75('0x31')],function(_0x42984b){return{'name':_0x42984b['fieldName'],'type':_0x42984b[_0x5f75('0x32')][_0x5f75('0x33')]};});_0x2c05a3[_0x5f75('0x34')]=_['map'](_0x4c3eb9,'name');_0x2c05a3['query']=_['keys'](_0x4ec58a[_0x5f75('0x35')]);_0x2c05a3[_0x5f75('0x36')]=_['intersection'](_0x2c05a3[_0x5f75('0x34')],_0x2c05a3['query']);_0x45e6f9['attributes']=_['intersection'](_0x2c05a3['model'],qs[_0x5f75('0x37')](_0x4ec58a[_0x5f75('0x35')][_0x5f75('0x37')]));_0x45e6f9[_0x5f75('0x38')]=_0x45e6f9[_0x5f75('0x38')][_0x5f75('0x39')]?_0x45e6f9['attributes']:_0x2c05a3[_0x5f75('0x34')];if(!_0x4ec58a[_0x5f75('0x35')][_0x5f75('0x3a')](_0x5f75('0x3b'))){_0x45e6f9[_0x5f75('0x1d')]=qs[_0x5f75('0x1d')](_0x4ec58a[_0x5f75('0x35')][_0x5f75('0x1d')]);_0x45e6f9['offset']=qs[_0x5f75('0x1c')](_0x4ec58a['query'][_0x5f75('0x1c')]);}_0x45e6f9['order']=qs['sort'](_0x4ec58a[_0x5f75('0x35')][_0x5f75('0x3c')]);_0x45e6f9[_0x5f75('0x3d')]=qs[_0x5f75('0x36')](_['pick'](_0x4ec58a[_0x5f75('0x35')],_0x2c05a3[_0x5f75('0x36')]),_0x4c3eb9);if(_0x4ec58a['query'][_0x5f75('0x3e')]){_0x45e6f9[_0x5f75('0x3d')]=_['merge'](_0x45e6f9[_0x5f75('0x3d')],{'$or':_[_0x5f75('0x2f')](_0x4c3eb9,function(_0x2f18d5){if(_0x2f18d5[_0x5f75('0x32')]!=='VIRTUAL'){var _0x24f67f={};_0x24f67f[_0x2f18d5[_0x5f75('0x2c')]]={'$like':'%'+_0x4ec58a[_0x5f75('0x35')][_0x5f75('0x3e')]+'%'};return _0x24f67f;}})});}_0x45e6f9=_['merge']({},_0x45e6f9,_0x4ec58a[_0x5f75('0x3f')]);var _0x164e42={'where':_0x45e6f9[_0x5f75('0x3d')]};return db[_0x5f75('0x30')][_0x5f75('0x1f')](_0x164e42)[_0x5f75('0x27')](function(_0x486492){_0x429517[_0x5f75('0x1f')]=_0x486492;if(_0x4ec58a[_0x5f75('0x35')]['includeAll']){_0x45e6f9[_0x5f75('0x40')]=[{'all':!![]}];}return db[_0x5f75('0x30')][_0x5f75('0x41')](_0x45e6f9);})['then'](function(_0x487a24){_0x429517['rows']=_0x487a24;return _0x429517;})['then'](respondWithFilteredResult(_0x43915c,_0x45e6f9))[_0x5f75('0x42')](handleError(_0x43915c,null));};exports['show']=function(_0x4dc29c,_0x29bae3){var _0x38a3cc={'raw':![],'where':{'id':_0x4dc29c[_0x5f75('0x43')]['id']}},_0x27935e={};_0x27935e[_0x5f75('0x34')]=_[_0x5f75('0x44')](db[_0x5f75('0x30')][_0x5f75('0x31')]);_0x27935e['query']=_[_0x5f75('0x44')](_0x4dc29c[_0x5f75('0x35')]);_0x27935e[_0x5f75('0x36')]=_[_0x5f75('0x45')](_0x27935e[_0x5f75('0x34')],_0x27935e[_0x5f75('0x35')]);_0x38a3cc[_0x5f75('0x38')]=_['intersection'](_0x27935e[_0x5f75('0x34')],qs[_0x5f75('0x37')](_0x4dc29c[_0x5f75('0x35')][_0x5f75('0x37')]));_0x38a3cc[_0x5f75('0x38')]=_0x38a3cc[_0x5f75('0x38')][_0x5f75('0x39')]?_0x38a3cc[_0x5f75('0x38')]:_0x27935e[_0x5f75('0x34')];if(_0x4dc29c[_0x5f75('0x35')][_0x5f75('0x46')]){_0x38a3cc['include']=[{'all':!![]}];}_0x38a3cc=_[_0x5f75('0x47')]({},_0x38a3cc,_0x4dc29c[_0x5f75('0x3f')]);return db[_0x5f75('0x30')][_0x5f75('0x48')](_0x38a3cc)[_0x5f75('0x27')](handleEntityNotFound(_0x29bae3,null))[_0x5f75('0x27')](respondWithResult(_0x29bae3,null))['catch'](handleError(_0x29bae3,null));};exports[_0x5f75('0x49')]=function(_0x1e0f28,_0x5e0277){return db[_0x5f75('0x30')][_0x5f75('0x49')](_0x1e0f28[_0x5f75('0x4a')],{})[_0x5f75('0x27')](respondWithResult(_0x5e0277,0xc9))[_0x5f75('0x42')](handleError(_0x5e0277,null));};exports[_0x5f75('0x26')]=function(_0x4effde,_0x3913b1){if(_0x4effde[_0x5f75('0x4a')]['id']){delete _0x4effde['body']['id'];}return db[_0x5f75('0x30')][_0x5f75('0x48')]({'where':{'id':_0x4effde[_0x5f75('0x43')]['id']}})['then'](handleEntityNotFound(_0x3913b1,null))[_0x5f75('0x27')](saveUpdates(_0x4effde[_0x5f75('0x4a')],null))['then'](respondWithResult(_0x3913b1,null))[_0x5f75('0x42')](handleError(_0x3913b1,null));};exports[_0x5f75('0x28')]=function(_0x5334c6,_0x546fbd){return db[_0x5f75('0x30')][_0x5f75('0x48')]({'where':{'id':_0x5334c6[_0x5f75('0x43')]['id']}})[_0x5f75('0x27')](handleEntityNotFound(_0x546fbd,null))['then'](removeEntity(_0x546fbd,null))[_0x5f75('0x42')](handleError(_0x546fbd,null));};exports['getFields']=function(_0x3c77a2,_0x5f4877,_0x2e17d9){var _0x3ae2cc={};var _0x187759={};var _0x1bd5f0;var _0x54d21c;return db[_0x5f75('0x30')][_0x5f75('0x4b')]({'where':{'id':_0x3c77a2[_0x5f75('0x43')]['id']}})['then'](handleEntityNotFound(_0x5f4877,null))['then'](function(_0x2357b2){if(_0x2357b2){_0x1bd5f0=_0x2357b2;_0x187759['model']=_['keys'](db[_0x5f75('0x4c')][_0x5f75('0x31')]);_0x187759[_0x5f75('0x35')]=_[_0x5f75('0x44')](_0x3c77a2[_0x5f75('0x35')]);_0x187759[_0x5f75('0x36')]=_[_0x5f75('0x45')](_0x187759[_0x5f75('0x34')],_0x187759['query']);_0x3ae2cc['attributes']=_[_0x5f75('0x45')](_0x187759[_0x5f75('0x34')],qs[_0x5f75('0x37')](_0x3c77a2[_0x5f75('0x35')]['fields']));_0x3ae2cc[_0x5f75('0x38')]=_0x3ae2cc[_0x5f75('0x38')]['length']?_0x3ae2cc[_0x5f75('0x38')]:_0x187759['model'];_0x3ae2cc['order']=qs['sort'](_0x3c77a2[_0x5f75('0x35')][_0x5f75('0x3c')]);_0x3ae2cc['where']=qs[_0x5f75('0x36')](_[_0x5f75('0x4d')](_0x3c77a2[_0x5f75('0x35')],_0x187759['filters']));if(_0x3c77a2['query'][_0x5f75('0x3e')]){_0x3ae2cc[_0x5f75('0x3d')]=_[_0x5f75('0x47')](_0x3ae2cc[_0x5f75('0x3d')],{'$or':_[_0x5f75('0x2f')](_0x3ae2cc[_0x5f75('0x38')],function(_0x405689){var _0x3bb3c5={};_0x3bb3c5[_0x405689]={'$like':'%'+_0x3c77a2[_0x5f75('0x35')]['filter']+'%'};return _0x3bb3c5;})});}_0x3ae2cc=_[_0x5f75('0x47')]({},_0x3ae2cc,_0x3c77a2['options']);return _0x1bd5f0[_0x5f75('0x4e')](_0x3ae2cc);}})[_0x5f75('0x27')](function(_0x5be25b){if(_0x5be25b){_0x54d21c=_0x5be25b[_0x5f75('0x39')];if(!_0x3c77a2[_0x5f75('0x35')][_0x5f75('0x3a')]('nolimit')){_0x3ae2cc[_0x5f75('0x1d')]=qs['limit'](_0x3c77a2['query'][_0x5f75('0x1d')]);_0x3ae2cc[_0x5f75('0x1c')]=qs[_0x5f75('0x1c')](_0x3c77a2[_0x5f75('0x35')][_0x5f75('0x1c')]);}return _0x1bd5f0[_0x5f75('0x4e')](_0x3ae2cc);}})[_0x5f75('0x27')](function(_0x35957b){if(_0x35957b){return _0x35957b?{'count':_0x54d21c,'rows':_0x35957b}:null;}})[_0x5f75('0x27')](respondWithResult(_0x5f4877,null))[_0x5f75('0x42')](handleError(_0x5f4877,null));};exports[_0x5f75('0x4f')]=function(_0x9b9ca2,_0x2a9019,_0x373c61){var _0x2169ef={};var _0x36b9ea={};var _0x244edc;var _0x8c276c;return db[_0x5f75('0x30')][_0x5f75('0x4b')]({'where':{'id':_0x9b9ca2[_0x5f75('0x43')]['id']}})[_0x5f75('0x27')](handleEntityNotFound(_0x2a9019,null))[_0x5f75('0x27')](function(_0x546925){if(_0x546925){_0x244edc=_0x546925;_0x36b9ea[_0x5f75('0x34')]=_[_0x5f75('0x44')](db[_0x5f75('0x4c')][_0x5f75('0x31')]);_0x36b9ea[_0x5f75('0x35')]=_[_0x5f75('0x44')](_0x9b9ca2['query']);_0x36b9ea['filters']=_[_0x5f75('0x45')](_0x36b9ea[_0x5f75('0x34')],_0x36b9ea['query']);_0x2169ef[_0x5f75('0x38')]=_['intersection'](_0x36b9ea[_0x5f75('0x34')],qs[_0x5f75('0x37')](_0x9b9ca2[_0x5f75('0x35')][_0x5f75('0x37')]));_0x2169ef[_0x5f75('0x38')]=_0x2169ef[_0x5f75('0x38')][_0x5f75('0x39')]?_0x2169ef[_0x5f75('0x38')]:_0x36b9ea[_0x5f75('0x34')];_0x2169ef[_0x5f75('0x50')]=qs[_0x5f75('0x3c')](_0x9b9ca2['query'][_0x5f75('0x3c')]);_0x2169ef[_0x5f75('0x3d')]=qs[_0x5f75('0x36')](_[_0x5f75('0x4d')](_0x9b9ca2['query'],_0x36b9ea[_0x5f75('0x36')]));if(_0x9b9ca2['query'][_0x5f75('0x3e')]){_0x2169ef[_0x5f75('0x3d')]=_[_0x5f75('0x47')](_0x2169ef[_0x5f75('0x3d')],{'$or':_[_0x5f75('0x2f')](_0x2169ef[_0x5f75('0x38')],function(_0xf3c907){var _0x1eebf5={};_0x1eebf5[_0xf3c907]={'$like':'%'+_0x9b9ca2['query'][_0x5f75('0x3e')]+'%'};return _0x1eebf5;})});}_0x2169ef=_[_0x5f75('0x47')]({},_0x2169ef,_0x9b9ca2['options']);return _0x244edc['getSubjects'](_0x2169ef);}})[_0x5f75('0x27')](function(_0x3a77dc){if(_0x3a77dc){_0x8c276c=_0x3a77dc[_0x5f75('0x39')];if(!_0x9b9ca2['query'][_0x5f75('0x3a')](_0x5f75('0x3b'))){_0x2169ef[_0x5f75('0x1d')]=qs[_0x5f75('0x1d')](_0x9b9ca2[_0x5f75('0x35')][_0x5f75('0x1d')]);_0x2169ef[_0x5f75('0x1c')]=qs[_0x5f75('0x1c')](_0x9b9ca2[_0x5f75('0x35')]['offset']);}return _0x244edc[_0x5f75('0x4f')](_0x2169ef);}})[_0x5f75('0x27')](function(_0xedc9b6){if(_0xedc9b6){return _0xedc9b6?{'count':_0x8c276c,'rows':_0xedc9b6}:null;}})[_0x5f75('0x27')](respondWithResult(_0x2a9019,null))[_0x5f75('0x42')](handleError(_0x2a9019,null));};exports[_0x5f75('0x51')]=function(_0x22c0d4,_0x219c1b,_0xde9903){var _0x3ae104={};var _0x35dad5={};var _0x34b2e3;var _0x3a00c4;return db[_0x5f75('0x30')][_0x5f75('0x4b')]({'where':{'id':_0x22c0d4[_0x5f75('0x43')]['id']}})[_0x5f75('0x27')](handleEntityNotFound(_0x219c1b,null))[_0x5f75('0x27')](function(_0x2254ac){if(_0x2254ac){_0x34b2e3=_0x2254ac;_0x35dad5[_0x5f75('0x34')]=_[_0x5f75('0x44')](db[_0x5f75('0x4c')][_0x5f75('0x31')]);_0x35dad5[_0x5f75('0x35')]=_['keys'](_0x22c0d4[_0x5f75('0x35')]);_0x35dad5[_0x5f75('0x36')]=_[_0x5f75('0x45')](_0x35dad5[_0x5f75('0x34')],_0x35dad5[_0x5f75('0x35')]);_0x3ae104[_0x5f75('0x38')]=_[_0x5f75('0x45')](_0x35dad5[_0x5f75('0x34')],qs['fields'](_0x22c0d4[_0x5f75('0x35')][_0x5f75('0x37')]));_0x3ae104['attributes']=_0x3ae104['attributes']['length']?_0x3ae104['attributes']:_0x35dad5[_0x5f75('0x34')];_0x3ae104[_0x5f75('0x50')]=qs[_0x5f75('0x3c')](_0x22c0d4['query'][_0x5f75('0x3c')]);_0x3ae104[_0x5f75('0x3d')]=qs[_0x5f75('0x36')](_[_0x5f75('0x4d')](_0x22c0d4['query'],_0x35dad5[_0x5f75('0x36')]));if(_0x22c0d4[_0x5f75('0x35')][_0x5f75('0x3e')]){_0x3ae104[_0x5f75('0x3d')]=_[_0x5f75('0x47')](_0x3ae104[_0x5f75('0x3d')],{'$or':_[_0x5f75('0x2f')](_0x3ae104['attributes'],function(_0x336c1f){var _0x37eb79={};_0x37eb79[_0x336c1f]={'$like':'%'+_0x22c0d4[_0x5f75('0x35')][_0x5f75('0x3e')]+'%'};return _0x37eb79;})});}_0x3ae104=_[_0x5f75('0x47')]({},_0x3ae104,_0x22c0d4[_0x5f75('0x3f')]);return _0x34b2e3[_0x5f75('0x51')](_0x3ae104);}})['then'](function(_0xdab793){if(_0xdab793){_0x3a00c4=_0xdab793[_0x5f75('0x39')];if(!_0x22c0d4[_0x5f75('0x35')][_0x5f75('0x3a')](_0x5f75('0x3b'))){_0x3ae104[_0x5f75('0x1d')]=qs[_0x5f75('0x1d')](_0x22c0d4[_0x5f75('0x35')]['limit']);_0x3ae104[_0x5f75('0x1c')]=qs['offset'](_0x22c0d4[_0x5f75('0x35')][_0x5f75('0x1c')]);}return _0x34b2e3['getDescriptions'](_0x3ae104);}})['then'](function(_0x5529a7){if(_0x5529a7){return _0x5529a7?{'count':_0x3a00c4,'rows':_0x5529a7}:null;}})['then'](respondWithResult(_0x219c1b,null))['catch'](handleError(_0x219c1b,null));};exports[_0x5f75('0x52')]=function(_0x382dd2,_0x425a6b,_0x4841a4){var _0x8b160={};var _0x235321={};var _0x510623;var _0x1ac3bb;return db[_0x5f75('0x30')][_0x5f75('0x4b')]({'where':{'id':_0x382dd2['params']['id']}})[_0x5f75('0x27')](handleEntityNotFound(_0x425a6b,null))['then'](function(_0x4c7f40){if(_0x4c7f40){_0x510623=_0x4c7f40;_0x235321[_0x5f75('0x34')]=_[_0x5f75('0x44')](db[_0x5f75('0x53')]['rawAttributes']);_0x235321[_0x5f75('0x35')]=_['keys'](_0x382dd2[_0x5f75('0x35')]);_0x235321['filters']=_[_0x5f75('0x45')](_0x235321[_0x5f75('0x34')],_0x235321[_0x5f75('0x35')]);_0x8b160[_0x5f75('0x38')]=_[_0x5f75('0x45')](_0x235321[_0x5f75('0x34')],qs[_0x5f75('0x37')](_0x382dd2[_0x5f75('0x35')][_0x5f75('0x37')]));_0x8b160[_0x5f75('0x38')]=_0x8b160[_0x5f75('0x38')][_0x5f75('0x39')]?_0x8b160[_0x5f75('0x38')]:_0x235321[_0x5f75('0x34')];_0x8b160['order']=qs[_0x5f75('0x3c')](_0x382dd2['query'][_0x5f75('0x3c')]);_0x8b160[_0x5f75('0x3d')]=qs[_0x5f75('0x36')](_[_0x5f75('0x4d')](_0x382dd2[_0x5f75('0x35')],_0x235321['filters']));if(_0x382dd2[_0x5f75('0x35')]['filter']){_0x8b160[_0x5f75('0x3d')]=_['merge'](_0x8b160[_0x5f75('0x3d')],{'$or':_[_0x5f75('0x2f')](_0x8b160[_0x5f75('0x38')],function(_0x3cac8f){var _0x2883c7={};_0x2883c7[_0x3cac8f]={'$like':'%'+_0x382dd2['query'][_0x5f75('0x3e')]+'%'};return _0x2883c7;})});}_0x8b160=_['merge']({},_0x8b160,_0x382dd2['options']);return _0x510623['getTags'](_0x8b160);}})['then'](function(_0x2ea888){if(_0x2ea888){_0x1ac3bb=_0x2ea888[_0x5f75('0x39')];if(!_0x382dd2['query'][_0x5f75('0x3a')](_0x5f75('0x3b'))){_0x8b160[_0x5f75('0x1d')]=qs[_0x5f75('0x1d')](_0x382dd2['query'][_0x5f75('0x1d')]);_0x8b160[_0x5f75('0x1c')]=qs[_0x5f75('0x1c')](_0x382dd2[_0x5f75('0x35')]['offset']);}return _0x510623['getTags'](_0x8b160);}})['then'](function(_0x54cb64){if(_0x54cb64){return _0x54cb64?{'count':_0x1ac3bb,'rows':_0x54cb64}:null;}})['then'](respondWithResult(_0x425a6b,null))['catch'](handleError(_0x425a6b,null));};exports[_0x5f75('0x54')]=function(_0x44d7e8,_0x2911f4,_0x2b6f28){if(_0x44d7e8[_0x5f75('0x4a')]['id']){delete _0x44d7e8['body']['id'];}return db[_0x5f75('0x30')][_0x5f75('0x4b')]({'where':{'id':_0x44d7e8[_0x5f75('0x43')]['id']}})[_0x5f75('0x27')](handleEntityNotFound(_0x2911f4,null))[_0x5f75('0x27')](function(_0xc52628){if(_0xc52628){return _0xc52628[_0x5f75('0x54')](_0x44d7e8[_0x5f75('0x4a')][_0x5f75('0x55')]||[]);}return null;})['then'](respondWithResult(_0x2911f4,null))[_0x5f75('0x42')](handleError(_0x2911f4,null));}; \ No newline at end of file +var _0xa432=['getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','query','keys','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','intersection','find','create','body','getFields','ZendeskField','getSubjects','findOne','params','getDescriptions'];(function(_0x4897ba,_0x3a9e01){var _0x707b25=function(_0x4fb6d4){while(--_0x4fb6d4){_0x4897ba['push'](_0x4897ba['shift']());}};_0x707b25(++_0x3a9e01);}(_0xa432,0x1ef));var _0x2a43=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xa432[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x2a43('0x0'));var rimraf=require(_0x2a43('0x1'));var zipdir=require(_0x2a43('0x2'));var jsonpatch=require(_0x2a43('0x3'));var rp=require('request-promise');var moment=require(_0x2a43('0x4'));var BPromise=require(_0x2a43('0x5'));var Mustache=require(_0x2a43('0x6'));var util=require(_0x2a43('0x7'));var path=require('path');var sox=require(_0x2a43('0x8'));var csv=require('to-csv');var ejs=require(_0x2a43('0x9'));var fs=require('fs');var fs_extra=require(_0x2a43('0xa'));var _=require(_0x2a43('0xb'));var squel=require('squel');var crypto=require(_0x2a43('0xc'));var jsforce=require(_0x2a43('0xd'));var deskjs=require(_0x2a43('0xe'));var toCsv=require(_0x2a43('0xf'));var querystring=require(_0x2a43('0x10'));var Papa=require(_0x2a43('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2a43('0x12'));var as=require(_0x2a43('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2a43('0x14'));var utils=require(_0x2a43('0x15'));var config=require(_0x2a43('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a43('0x17'))['db'];function respondWithStatusCode(_0x239dbf,_0x4d1c59){_0x4d1c59=_0x4d1c59||0xcc;return function(_0x311dc6){if(_0x311dc6){return _0x239dbf['sendStatus'](_0x4d1c59);}return _0x239dbf[_0x2a43('0x18')](_0x4d1c59)[_0x2a43('0x19')]();};}function respondWithResult(_0x11bd2c,_0x301acb){_0x301acb=_0x301acb||0xc8;return function(_0x374813){if(_0x374813){return _0x11bd2c[_0x2a43('0x18')](_0x301acb)[_0x2a43('0x1a')](_0x374813);}};}function respondWithFilteredResult(_0x1f386e,_0x365491){return function(_0x982aa5){if(_0x982aa5){var _0x2907fa=typeof _0x365491[_0x2a43('0x1b')]===_0x2a43('0x1c')&&typeof _0x365491[_0x2a43('0x1d')]===_0x2a43('0x1c');var _0x50c7de=_0x982aa5['count'];var _0x26724f=_0x2907fa?0x0:_0x365491['offset'];var _0x542d5b=_0x2907fa?_0x982aa5[_0x2a43('0x1e')]:_0x365491[_0x2a43('0x1b')]+_0x365491[_0x2a43('0x1d')];var _0x5a5c68;if(_0x542d5b>=_0x50c7de){_0x542d5b=_0x50c7de;_0x5a5c68=0xc8;}else{_0x5a5c68=0xce;}_0x1f386e[_0x2a43('0x18')](_0x5a5c68);return _0x1f386e[_0x2a43('0x1f')](_0x2a43('0x20'),_0x26724f+'-'+_0x542d5b+'/'+_0x50c7de)[_0x2a43('0x1a')](_0x982aa5);}return null;};}function patchUpdates(_0x1efec7){return function(_0x18571f){try{jsonpatch[_0x2a43('0x21')](_0x18571f,_0x1efec7,!![]);}catch(_0x30104f){return BPromise[_0x2a43('0x22')](_0x30104f);}return _0x18571f['save']();};}function saveUpdates(_0xc0f459,_0x184aa5){return function(_0xd1ae4b){if(_0xd1ae4b){return _0xd1ae4b[_0x2a43('0x23')](_0xc0f459)[_0x2a43('0x24')](function(_0x4669c6){return _0x4669c6;});}return null;};}function removeEntity(_0x482e53,_0x34c503){return function(_0x10100b){if(_0x10100b){return _0x10100b[_0x2a43('0x25')]()[_0x2a43('0x24')](function(){_0x482e53[_0x2a43('0x18')](0xcc)[_0x2a43('0x19')]();});}};}function handleEntityNotFound(_0xb8b9c0,_0x56cec3){return function(_0x217d0c){if(!_0x217d0c){_0xb8b9c0[_0x2a43('0x26')](0x194);}return _0x217d0c;};}function handleError(_0xeb62be,_0x590752){_0x590752=_0x590752||0x1f4;return function(_0x592e07){logger[_0x2a43('0x27')](_0x592e07['stack']);if(_0x592e07[_0x2a43('0x28')]){delete _0x592e07['name'];}_0xeb62be[_0x2a43('0x18')](_0x590752)[_0x2a43('0x29')](_0x592e07);};}exports[_0x2a43('0x2a')]=function(_0x492e54,_0x5aa0bb){var _0x5c55ba={},_0x12d301={},_0x2a88f7={'count':0x0,'rows':[]};var _0x5a561e=_[_0x2a43('0x2b')](db[_0x2a43('0x2c')][_0x2a43('0x2d')],function(_0x101619){return{'name':_0x101619[_0x2a43('0x2e')],'type':_0x101619[_0x2a43('0x2f')]['key']};});_0x12d301['model']=_['map'](_0x5a561e,'name');_0x12d301[_0x2a43('0x30')]=_[_0x2a43('0x31')](_0x492e54[_0x2a43('0x30')]);_0x12d301['filters']=_['intersection'](_0x12d301[_0x2a43('0x32')],_0x12d301[_0x2a43('0x30')]);_0x5c55ba['attributes']=_['intersection'](_0x12d301['model'],qs[_0x2a43('0x33')](_0x492e54[_0x2a43('0x30')]['fields']));_0x5c55ba[_0x2a43('0x34')]=_0x5c55ba[_0x2a43('0x34')][_0x2a43('0x35')]?_0x5c55ba['attributes']:_0x12d301[_0x2a43('0x32')];if(!_0x492e54[_0x2a43('0x30')][_0x2a43('0x36')](_0x2a43('0x37'))){_0x5c55ba[_0x2a43('0x1d')]=qs['limit'](_0x492e54['query'][_0x2a43('0x1d')]);_0x5c55ba[_0x2a43('0x1b')]=qs[_0x2a43('0x1b')](_0x492e54[_0x2a43('0x30')][_0x2a43('0x1b')]);}_0x5c55ba[_0x2a43('0x38')]=qs['sort'](_0x492e54['query'][_0x2a43('0x39')]);_0x5c55ba[_0x2a43('0x3a')]=qs[_0x2a43('0x3b')](_[_0x2a43('0x3c')](_0x492e54['query'],_0x12d301[_0x2a43('0x3b')]),_0x5a561e);if(_0x492e54['query'][_0x2a43('0x3d')]){_0x5c55ba[_0x2a43('0x3a')]=_[_0x2a43('0x3e')](_0x5c55ba['where'],{'$or':_[_0x2a43('0x2b')](_0x5a561e,function(_0x1ab2c0){if(_0x1ab2c0[_0x2a43('0x2f')]!==_0x2a43('0x3f')){var _0x4eb852={};_0x4eb852[_0x1ab2c0[_0x2a43('0x28')]]={'$like':'%'+_0x492e54[_0x2a43('0x30')][_0x2a43('0x3d')]+'%'};return _0x4eb852;}})});}_0x5c55ba=_['merge']({},_0x5c55ba,_0x492e54[_0x2a43('0x40')]);var _0x531df9={'where':_0x5c55ba[_0x2a43('0x3a')]};return db['ZendeskConfiguration'][_0x2a43('0x1e')](_0x531df9)[_0x2a43('0x24')](function(_0x52c967){_0x2a88f7[_0x2a43('0x1e')]=_0x52c967;if(_0x492e54[_0x2a43('0x30')][_0x2a43('0x41')]){_0x5c55ba[_0x2a43('0x42')]=[{'all':!![]}];}return db[_0x2a43('0x2c')]['findAll'](_0x5c55ba);})[_0x2a43('0x24')](function(_0x498cf5){_0x2a88f7['rows']=_0x498cf5;return _0x2a88f7;})[_0x2a43('0x24')](respondWithFilteredResult(_0x5aa0bb,_0x5c55ba))[_0x2a43('0x43')](handleError(_0x5aa0bb,null));};exports[_0x2a43('0x44')]=function(_0x1e0bf6,_0x37b705){var _0x409b42={'raw':![],'where':{'id':_0x1e0bf6['params']['id']}},_0x1ed3c7={};_0x1ed3c7['model']=_['keys'](db[_0x2a43('0x2c')][_0x2a43('0x2d')]);_0x1ed3c7[_0x2a43('0x30')]=_[_0x2a43('0x31')](_0x1e0bf6['query']);_0x1ed3c7[_0x2a43('0x3b')]=_[_0x2a43('0x45')](_0x1ed3c7[_0x2a43('0x32')],_0x1ed3c7['query']);_0x409b42['attributes']=_['intersection'](_0x1ed3c7['model'],qs[_0x2a43('0x33')](_0x1e0bf6[_0x2a43('0x30')][_0x2a43('0x33')]));_0x409b42[_0x2a43('0x34')]=_0x409b42[_0x2a43('0x34')][_0x2a43('0x35')]?_0x409b42['attributes']:_0x1ed3c7['model'];if(_0x1e0bf6['query'][_0x2a43('0x41')]){_0x409b42[_0x2a43('0x42')]=[{'all':!![]}];}_0x409b42=_['merge']({},_0x409b42,_0x1e0bf6[_0x2a43('0x40')]);return db[_0x2a43('0x2c')][_0x2a43('0x46')](_0x409b42)[_0x2a43('0x24')](handleEntityNotFound(_0x37b705,null))[_0x2a43('0x24')](respondWithResult(_0x37b705,null))[_0x2a43('0x43')](handleError(_0x37b705,null));};exports[_0x2a43('0x47')]=function(_0x292780,_0x1e6130){return db['ZendeskConfiguration'][_0x2a43('0x47')](_0x292780[_0x2a43('0x48')],{})[_0x2a43('0x24')](respondWithResult(_0x1e6130,0xc9))[_0x2a43('0x43')](handleError(_0x1e6130,null));};exports[_0x2a43('0x23')]=function(_0x564535,_0xdf4269){if(_0x564535[_0x2a43('0x48')]['id']){delete _0x564535[_0x2a43('0x48')]['id'];}return db[_0x2a43('0x2c')][_0x2a43('0x46')]({'where':{'id':_0x564535['params']['id']}})[_0x2a43('0x24')](handleEntityNotFound(_0xdf4269,null))[_0x2a43('0x24')](saveUpdates(_0x564535[_0x2a43('0x48')],null))[_0x2a43('0x24')](respondWithResult(_0xdf4269,null))[_0x2a43('0x43')](handleError(_0xdf4269,null));};exports[_0x2a43('0x25')]=function(_0x3dacf7,_0x30f869){return db[_0x2a43('0x2c')][_0x2a43('0x46')]({'where':{'id':_0x3dacf7['params']['id']}})[_0x2a43('0x24')](handleEntityNotFound(_0x30f869,null))[_0x2a43('0x24')](removeEntity(_0x30f869,null))[_0x2a43('0x43')](handleError(_0x30f869,null));};exports[_0x2a43('0x49')]=function(_0x594c72,_0x1487b7,_0x18d338){var _0x573cc9={};var _0x20279e={};var _0x46d2ed;var _0x9cf083;return db[_0x2a43('0x2c')]['findOne']({'where':{'id':_0x594c72['params']['id']}})[_0x2a43('0x24')](handleEntityNotFound(_0x1487b7,null))[_0x2a43('0x24')](function(_0x2f11ce){if(_0x2f11ce){_0x46d2ed=_0x2f11ce;_0x20279e[_0x2a43('0x32')]=_[_0x2a43('0x31')](db[_0x2a43('0x4a')][_0x2a43('0x2d')]);_0x20279e[_0x2a43('0x30')]=_[_0x2a43('0x31')](_0x594c72['query']);_0x20279e[_0x2a43('0x3b')]=_['intersection'](_0x20279e[_0x2a43('0x32')],_0x20279e[_0x2a43('0x30')]);_0x573cc9[_0x2a43('0x34')]=_[_0x2a43('0x45')](_0x20279e[_0x2a43('0x32')],qs['fields'](_0x594c72[_0x2a43('0x30')][_0x2a43('0x33')]));_0x573cc9[_0x2a43('0x34')]=_0x573cc9['attributes'][_0x2a43('0x35')]?_0x573cc9[_0x2a43('0x34')]:_0x20279e[_0x2a43('0x32')];_0x573cc9[_0x2a43('0x38')]=qs[_0x2a43('0x39')](_0x594c72[_0x2a43('0x30')][_0x2a43('0x39')]);_0x573cc9[_0x2a43('0x3a')]=qs['filters'](_[_0x2a43('0x3c')](_0x594c72[_0x2a43('0x30')],_0x20279e['filters']));if(_0x594c72['query'][_0x2a43('0x3d')]){_0x573cc9[_0x2a43('0x3a')]=_['merge'](_0x573cc9[_0x2a43('0x3a')],{'$or':_[_0x2a43('0x2b')](_0x573cc9[_0x2a43('0x34')],function(_0x525aa7){var _0xb52a46={};_0xb52a46[_0x525aa7]={'$like':'%'+_0x594c72['query'][_0x2a43('0x3d')]+'%'};return _0xb52a46;})});}_0x573cc9=_[_0x2a43('0x3e')]({},_0x573cc9,_0x594c72[_0x2a43('0x40')]);return _0x46d2ed['getFields'](_0x573cc9);}})[_0x2a43('0x24')](function(_0x5e62b0){if(_0x5e62b0){_0x9cf083=_0x5e62b0[_0x2a43('0x35')];if(!_0x594c72['query'][_0x2a43('0x36')](_0x2a43('0x37'))){_0x573cc9[_0x2a43('0x1d')]=qs['limit'](_0x594c72[_0x2a43('0x30')][_0x2a43('0x1d')]);_0x573cc9['offset']=qs[_0x2a43('0x1b')](_0x594c72[_0x2a43('0x30')][_0x2a43('0x1b')]);}return _0x46d2ed[_0x2a43('0x49')](_0x573cc9);}})[_0x2a43('0x24')](function(_0x4597e4){if(_0x4597e4){return _0x4597e4?{'count':_0x9cf083,'rows':_0x4597e4}:null;}})[_0x2a43('0x24')](respondWithResult(_0x1487b7,null))[_0x2a43('0x43')](handleError(_0x1487b7,null));};exports[_0x2a43('0x4b')]=function(_0xca689b,_0x3d5adf,_0xb80bb3){var _0x55f9c4={};var _0x245ce5={};var _0x2ede2b;var _0xad9500;return db[_0x2a43('0x2c')][_0x2a43('0x4c')]({'where':{'id':_0xca689b[_0x2a43('0x4d')]['id']}})[_0x2a43('0x24')](handleEntityNotFound(_0x3d5adf,null))['then'](function(_0x22364f){if(_0x22364f){_0x2ede2b=_0x22364f;_0x245ce5['model']=_[_0x2a43('0x31')](db['ZendeskField'][_0x2a43('0x2d')]);_0x245ce5[_0x2a43('0x30')]=_[_0x2a43('0x31')](_0xca689b['query']);_0x245ce5['filters']=_[_0x2a43('0x45')](_0x245ce5['model'],_0x245ce5['query']);_0x55f9c4[_0x2a43('0x34')]=_[_0x2a43('0x45')](_0x245ce5[_0x2a43('0x32')],qs[_0x2a43('0x33')](_0xca689b[_0x2a43('0x30')][_0x2a43('0x33')]));_0x55f9c4[_0x2a43('0x34')]=_0x55f9c4[_0x2a43('0x34')]['length']?_0x55f9c4[_0x2a43('0x34')]:_0x245ce5['model'];_0x55f9c4['order']=qs[_0x2a43('0x39')](_0xca689b[_0x2a43('0x30')][_0x2a43('0x39')]);_0x55f9c4['where']=qs[_0x2a43('0x3b')](_['pick'](_0xca689b[_0x2a43('0x30')],_0x245ce5[_0x2a43('0x3b')]));if(_0xca689b[_0x2a43('0x30')][_0x2a43('0x3d')]){_0x55f9c4[_0x2a43('0x3a')]=_[_0x2a43('0x3e')](_0x55f9c4[_0x2a43('0x3a')],{'$or':_['map'](_0x55f9c4['attributes'],function(_0x500c38){var _0x4b8a44={};_0x4b8a44[_0x500c38]={'$like':'%'+_0xca689b[_0x2a43('0x30')][_0x2a43('0x3d')]+'%'};return _0x4b8a44;})});}_0x55f9c4=_[_0x2a43('0x3e')]({},_0x55f9c4,_0xca689b[_0x2a43('0x40')]);return _0x2ede2b[_0x2a43('0x4b')](_0x55f9c4);}})[_0x2a43('0x24')](function(_0x46ba13){if(_0x46ba13){_0xad9500=_0x46ba13[_0x2a43('0x35')];if(!_0xca689b[_0x2a43('0x30')][_0x2a43('0x36')]('nolimit')){_0x55f9c4['limit']=qs[_0x2a43('0x1d')](_0xca689b[_0x2a43('0x30')]['limit']);_0x55f9c4['offset']=qs[_0x2a43('0x1b')](_0xca689b[_0x2a43('0x30')]['offset']);}return _0x2ede2b[_0x2a43('0x4b')](_0x55f9c4);}})[_0x2a43('0x24')](function(_0x12c968){if(_0x12c968){return _0x12c968?{'count':_0xad9500,'rows':_0x12c968}:null;}})[_0x2a43('0x24')](respondWithResult(_0x3d5adf,null))[_0x2a43('0x43')](handleError(_0x3d5adf,null));};exports[_0x2a43('0x4e')]=function(_0x4b9319,_0x3d575c,_0x5dd637){var _0xa13914={};var _0x2d0780={};var _0xd54e0e;var _0x50ad19;return db[_0x2a43('0x2c')][_0x2a43('0x4c')]({'where':{'id':_0x4b9319[_0x2a43('0x4d')]['id']}})[_0x2a43('0x24')](handleEntityNotFound(_0x3d575c,null))[_0x2a43('0x24')](function(_0x5427f6){if(_0x5427f6){_0xd54e0e=_0x5427f6;_0x2d0780[_0x2a43('0x32')]=_[_0x2a43('0x31')](db[_0x2a43('0x4a')][_0x2a43('0x2d')]);_0x2d0780[_0x2a43('0x30')]=_['keys'](_0x4b9319[_0x2a43('0x30')]);_0x2d0780[_0x2a43('0x3b')]=_[_0x2a43('0x45')](_0x2d0780[_0x2a43('0x32')],_0x2d0780[_0x2a43('0x30')]);_0xa13914[_0x2a43('0x34')]=_[_0x2a43('0x45')](_0x2d0780['model'],qs[_0x2a43('0x33')](_0x4b9319[_0x2a43('0x30')][_0x2a43('0x33')]));_0xa13914[_0x2a43('0x34')]=_0xa13914[_0x2a43('0x34')][_0x2a43('0x35')]?_0xa13914['attributes']:_0x2d0780[_0x2a43('0x32')];_0xa13914[_0x2a43('0x38')]=qs[_0x2a43('0x39')](_0x4b9319[_0x2a43('0x30')][_0x2a43('0x39')]);_0xa13914[_0x2a43('0x3a')]=qs[_0x2a43('0x3b')](_[_0x2a43('0x3c')](_0x4b9319[_0x2a43('0x30')],_0x2d0780[_0x2a43('0x3b')]));if(_0x4b9319[_0x2a43('0x30')][_0x2a43('0x3d')]){_0xa13914[_0x2a43('0x3a')]=_[_0x2a43('0x3e')](_0xa13914[_0x2a43('0x3a')],{'$or':_[_0x2a43('0x2b')](_0xa13914['attributes'],function(_0x4860e1){var _0x329fe6={};_0x329fe6[_0x4860e1]={'$like':'%'+_0x4b9319['query']['filter']+'%'};return _0x329fe6;})});}_0xa13914=_['merge']({},_0xa13914,_0x4b9319[_0x2a43('0x40')]);return _0xd54e0e['getDescriptions'](_0xa13914);}})[_0x2a43('0x24')](function(_0x547a24){if(_0x547a24){_0x50ad19=_0x547a24['length'];if(!_0x4b9319[_0x2a43('0x30')]['hasOwnProperty'](_0x2a43('0x37'))){_0xa13914[_0x2a43('0x1d')]=qs[_0x2a43('0x1d')](_0x4b9319[_0x2a43('0x30')][_0x2a43('0x1d')]);_0xa13914[_0x2a43('0x1b')]=qs['offset'](_0x4b9319[_0x2a43('0x30')][_0x2a43('0x1b')]);}return _0xd54e0e[_0x2a43('0x4e')](_0xa13914);}})[_0x2a43('0x24')](function(_0x4efc38){if(_0x4efc38){return _0x4efc38?{'count':_0x50ad19,'rows':_0x4efc38}:null;}})[_0x2a43('0x24')](respondWithResult(_0x3d575c,null))['catch'](handleError(_0x3d575c,null));};exports[_0x2a43('0x4f')]=function(_0x45eeb7,_0x2f2ff4,_0x55551f){var _0x5084ca={};var _0x13eee9={};var _0x48a3d6;var _0x7cdc49;return db[_0x2a43('0x2c')][_0x2a43('0x4c')]({'where':{'id':_0x45eeb7[_0x2a43('0x4d')]['id']}})[_0x2a43('0x24')](handleEntityNotFound(_0x2f2ff4,null))[_0x2a43('0x24')](function(_0xbfd6a){if(_0xbfd6a){_0x48a3d6=_0xbfd6a;_0x13eee9[_0x2a43('0x32')]=_[_0x2a43('0x31')](db[_0x2a43('0x50')][_0x2a43('0x2d')]);_0x13eee9[_0x2a43('0x30')]=_['keys'](_0x45eeb7[_0x2a43('0x30')]);_0x13eee9['filters']=_[_0x2a43('0x45')](_0x13eee9['model'],_0x13eee9[_0x2a43('0x30')]);_0x5084ca[_0x2a43('0x34')]=_['intersection'](_0x13eee9[_0x2a43('0x32')],qs[_0x2a43('0x33')](_0x45eeb7[_0x2a43('0x30')]['fields']));_0x5084ca[_0x2a43('0x34')]=_0x5084ca[_0x2a43('0x34')][_0x2a43('0x35')]?_0x5084ca[_0x2a43('0x34')]:_0x13eee9['model'];_0x5084ca[_0x2a43('0x38')]=qs[_0x2a43('0x39')](_0x45eeb7[_0x2a43('0x30')][_0x2a43('0x39')]);_0x5084ca['where']=qs[_0x2a43('0x3b')](_[_0x2a43('0x3c')](_0x45eeb7[_0x2a43('0x30')],_0x13eee9[_0x2a43('0x3b')]));if(_0x45eeb7[_0x2a43('0x30')][_0x2a43('0x3d')]){_0x5084ca[_0x2a43('0x3a')]=_[_0x2a43('0x3e')](_0x5084ca[_0x2a43('0x3a')],{'$or':_[_0x2a43('0x2b')](_0x5084ca[_0x2a43('0x34')],function(_0x1b2437){var _0x30cf7d={};_0x30cf7d[_0x1b2437]={'$like':'%'+_0x45eeb7['query'][_0x2a43('0x3d')]+'%'};return _0x30cf7d;})});}_0x5084ca=_[_0x2a43('0x3e')]({},_0x5084ca,_0x45eeb7['options']);return _0x48a3d6[_0x2a43('0x4f')](_0x5084ca);}})[_0x2a43('0x24')](function(_0x293f1a){if(_0x293f1a){_0x7cdc49=_0x293f1a['length'];if(!_0x45eeb7[_0x2a43('0x30')][_0x2a43('0x36')](_0x2a43('0x37'))){_0x5084ca[_0x2a43('0x1d')]=qs[_0x2a43('0x1d')](_0x45eeb7[_0x2a43('0x30')]['limit']);_0x5084ca[_0x2a43('0x1b')]=qs[_0x2a43('0x1b')](_0x45eeb7[_0x2a43('0x30')]['offset']);}return _0x48a3d6[_0x2a43('0x4f')](_0x5084ca);}})[_0x2a43('0x24')](function(_0x4715a0){if(_0x4715a0){return _0x4715a0?{'count':_0x7cdc49,'rows':_0x4715a0}:null;}})['then'](respondWithResult(_0x2f2ff4,null))[_0x2a43('0x43')](handleError(_0x2f2ff4,null));};exports[_0x2a43('0x51')]=function(_0x280c45,_0x528fc4,_0x307a73){if(_0x280c45[_0x2a43('0x48')]['id']){delete _0x280c45[_0x2a43('0x48')]['id'];}return db[_0x2a43('0x2c')][_0x2a43('0x4c')]({'where':{'id':_0x280c45['params']['id']}})[_0x2a43('0x24')](handleEntityNotFound(_0x528fc4,null))[_0x2a43('0x24')](function(_0x230e77){if(_0x230e77){return _0x230e77[_0x2a43('0x51')](_0x280c45[_0x2a43('0x48')]['ids']||[]);}return null;})[_0x2a43('0x24')](respondWithResult(_0x528fc4,null))[_0x2a43('0x43')](handleError(_0x528fc4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6c369b9..229e0e2 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 _0xfcbb=['rimraf','../../config/environment','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x362cce,_0x554cfd){var _0x688b07=function(_0x2de371){while(--_0x2de371){_0x362cce['push'](_0x362cce['shift']());}};_0x688b07(++_0x554cfd);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x1a33cb,_0x211eea){_0x1a33cb=_0x1a33cb-0x0;var _0x1bd1f5=_0xfcbb[_0x1a33cb];return _0x1bd1f5;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var logger=require(_0xbfcb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbfcb('0x3'));var rp=require(_0xbfcb('0x4'));var fs=require('fs');var path=require(_0xbfcb('0x5'));var rimraf=require(_0xbfcb('0x6'));var config=require(_0xbfcb('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x32c2aa,_0x4990c){return _0x32c2aa[_0xbfcb('0x8')](_0xbfcb('0x9'),attributes,{'tableName':_0xbfcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbbc=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x29dc42,_0x5abecb){_0x29dc42=_0x29dc42-0x0;var _0x41574f=_0xbbbc[_0x29dc42];return _0x41574f;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'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 e1b5cc5..82b39b6 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 _0xa058=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x4107d5,_0x5d6477){var _0x3b86a6=function(_0x2ebcd1){while(--_0x2ebcd1){_0x4107d5['push'](_0x4107d5['shift']());}};_0x3b86a6(++_0x5d6477);}(_0xa058,0xff));var _0x8a05=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xa058[_0x349367];return _0x14179b;};'use strict';var _=require('lodash');var util=require(_0x8a05('0x0'));var moment=require(_0x8a05('0x1'));var BPromise=require(_0x8a05('0x2'));var rs=require(_0x8a05('0x3'));var fs=require('fs');var Redis=require(_0x8a05('0x4'));var db=require(_0x8a05('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a05('0x6'))(_0x8a05('0x7'));var config=require(_0x8a05('0x8'));var jayson=require(_0x8a05('0x9'));var client=jayson[_0x8a05('0xa')][_0x8a05('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e5863,_0x5e4c7a,_0x211c80){return new BPromise(function(_0xe7ee18,_0x49323b){return client[_0x8a05('0xc')](_0x2e5863,_0x211c80)[_0x8a05('0xd')](function(_0x1b3281){logger[_0x8a05('0xe')](_0x8a05('0xf'),_0x5e4c7a,_0x8a05('0x10'));logger[_0x8a05('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5e4c7a,_0x8a05('0x10'),JSON[_0x8a05('0x12')](_0x1b3281));if(_0x1b3281[_0x8a05('0x13')]){if(_0x1b3281[_0x8a05('0x13')]['code']===0x1f4){logger[_0x8a05('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5e4c7a,_0x1b3281[_0x8a05('0x13')][_0x8a05('0x14')]);return _0x49323b(_0x1b3281[_0x8a05('0x13')][_0x8a05('0x14')]);}logger[_0x8a05('0x13')](_0x8a05('0xf'),_0x5e4c7a,_0x1b3281['error']['message']);return _0xe7ee18(_0x1b3281['error'][_0x8a05('0x14')]);}else{logger[_0x8a05('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5e4c7a,_0x8a05('0x10'));_0xe7ee18(_0x1b3281[_0x8a05('0x15')][_0x8a05('0x14')]);}})[_0x8a05('0x16')](function(_0x595d14){logger[_0x8a05('0x13')](_0x8a05('0xf'),_0x5e4c7a,_0x595d14);_0x49323b(_0x595d14);});});} \ No newline at end of file +var _0xb1b3=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x4610dd,_0x531008){var _0x59bce1=function(_0x27701b){while(--_0x27701b){_0x4610dd['push'](_0x4610dd['shift']());}};_0x59bce1(++_0x531008);}(_0xb1b3,0x151));var _0x3b1b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb1b3[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x3b1b('0x0'));var util=require('util');var moment=require(_0x3b1b('0x1'));var BPromise=require(_0x3b1b('0x2'));var rs=require(_0x3b1b('0x3'));var fs=require('fs');var Redis=require(_0x3b1b('0x4'));var db=require(_0x3b1b('0x5'))['db'];var utils=require(_0x3b1b('0x6'));var logger=require(_0x3b1b('0x7'))(_0x3b1b('0x8'));var config=require(_0x3b1b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3b1b('0xa')][_0x3b1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x429f90,_0x5b8b47,_0xaf14ff){return new BPromise(function(_0x382803,_0x1b9dcc){return client[_0x3b1b('0xc')](_0x429f90,_0xaf14ff)['then'](function(_0x2cb4ad){logger[_0x3b1b('0xd')](_0x3b1b('0xe'),_0x5b8b47,'request\x20sent');logger[_0x3b1b('0xf')](_0x3b1b('0x10'),_0x5b8b47,_0x3b1b('0x11'),JSON['stringify'](_0x2cb4ad));if(_0x2cb4ad[_0x3b1b('0x12')]){if(_0x2cb4ad[_0x3b1b('0x12')][_0x3b1b('0x13')]===0x1f4){logger[_0x3b1b('0x12')](_0x3b1b('0xe'),_0x5b8b47,_0x2cb4ad[_0x3b1b('0x12')][_0x3b1b('0x14')]);return _0x1b9dcc(_0x2cb4ad[_0x3b1b('0x12')][_0x3b1b('0x14')]);}logger[_0x3b1b('0x12')](_0x3b1b('0xe'),_0x5b8b47,_0x2cb4ad[_0x3b1b('0x12')][_0x3b1b('0x14')]);return _0x382803(_0x2cb4ad['error'][_0x3b1b('0x14')]);}else{logger[_0x3b1b('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5b8b47,_0x3b1b('0x11'));_0x382803(_0x2cb4ad[_0x3b1b('0x15')][_0x3b1b('0x14')]);}})['catch'](function(_0x3457ec){logger[_0x3b1b('0x12')](_0x3b1b('0xe'),_0x5b8b47,_0x3457ec);_0x1b9dcc(_0x3457ec);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 6238401..699b07e 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 _0x9496=['/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','get'];(function(_0x45e36f,_0x54c8e8){var _0x498a71=function(_0x4159fd){while(--_0x4159fd){_0x45e36f['push'](_0x45e36f['shift']());}};_0x498a71(++_0x54c8e8);}(_0x9496,0x66));var _0x6949=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x9496[_0x45bf86];return _0x1f02b7;};'use strict';var multer=require(_0x6949('0x0'));var util=require(_0x6949('0x1'));var path=require(_0x6949('0x2'));var timeout=require(_0x6949('0x3'));var express=require('express');var router=express[_0x6949('0x4')]();var fs_extra=require(_0x6949('0x5'));var auth=require(_0x6949('0x6'));var interaction=require(_0x6949('0x7'));var config=require(_0x6949('0x8'));var controller=require(_0x6949('0x9'));router['get']('/',auth[_0x6949('0xa')](),controller['index']);router[_0x6949('0xb')](_0x6949('0xc'),auth[_0x6949('0xa')](),controller[_0x6949('0xd')]);router[_0x6949('0xe')]('/',auth[_0x6949('0xa')](),controller['create']);router[_0x6949('0xf')](_0x6949('0xc'),auth[_0x6949('0xa')](),controller[_0x6949('0x10')]);router[_0x6949('0x11')](_0x6949('0xc'),auth['isAuthenticated'](),controller[_0x6949('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc354=['/:id','isAuthenticated','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index'];(function(_0x18c31b,_0x41c6fa){var _0xa943e7=function(_0x50f071){while(--_0x50f071){_0x18c31b['push'](_0x18c31b['shift']());}};_0xa943e7(++_0x41c6fa);}(_0xc354,0xd8));var _0x4c35=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc354[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4c35('0x0'));var util=require(_0x4c35('0x1'));var path=require(_0x4c35('0x2'));var timeout=require(_0x4c35('0x3'));var express=require('express');var router=express[_0x4c35('0x4')]();var fs_extra=require(_0x4c35('0x5'));var auth=require(_0x4c35('0x6'));var interaction=require(_0x4c35('0x7'));var config=require(_0x4c35('0x8'));var controller=require(_0x4c35('0x9'));router[_0x4c35('0xa')]('/',auth['isAuthenticated'](),controller[_0x4c35('0xb')]);router[_0x4c35('0xa')](_0x4c35('0xc'),auth[_0x4c35('0xd')](),controller['show']);router[_0x4c35('0xe')]('/',auth['isAuthenticated'](),controller[_0x4c35('0xf')]);router[_0x4c35('0x10')](_0x4c35('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4c35('0x11')](_0x4c35('0xc'),auth[_0x4c35('0xd')](),controller['destroy']);module[_0x4c35('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 9464a7c..45c34b5 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 _0xa89b=['customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x3569a9,_0x3a4766){var _0x420727=function(_0x34f23a){while(--_0x34f23a){_0x3569a9['push'](_0x3569a9['shift']());}};_0x420727(++_0x3a4766);}(_0xa89b,0xee));var _0xba89=function(_0x556e63,_0x16abaf){_0x556e63=_0x556e63-0x0;var _0x1f18a9=_0xa89b[_0x556e63];return _0x1f18a9;};'use strict';var Sequelize=require(_0xba89('0x0'));module[_0xba89('0x1')]={'type':{'type':Sequelize[_0xba89('0x2')](_0xba89('0x3'),_0xba89('0x4'),_0xba89('0x5'),'keyValue',_0xba89('0x6')),'defaultValue':_0xba89('0x3')},'content':{'type':Sequelize[_0xba89('0x7')]},'key':{'type':Sequelize[_0xba89('0x7')]},'keyType':{'type':Sequelize[_0xba89('0x2')]('string',_0xba89('0x4'),_0xba89('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xba89('0x7')]},'nameField':{'type':Sequelize[_0xba89('0x7')]},'customField':{'type':Sequelize[_0xba89('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba89('0x7')]}}; \ No newline at end of file +var _0x0a76=['exports','ENUM','string','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x46d2ee,_0x286759){var _0x1213df=function(_0x2e15e9){while(--_0x2e15e9){_0x46d2ee['push'](_0x46d2ee['shift']());}};_0x1213df(++_0x286759);}(_0x0a76,0x18f));var _0x60a7=function(_0x10609c,_0xb21b1e){_0x10609c=_0x10609c-0x0;var _0xb66922=_0x0a76[_0x10609c];return _0xb66922;};'use strict';var Sequelize=require(_0x60a7('0x0'));module[_0x60a7('0x1')]={'type':{'type':Sequelize[_0x60a7('0x2')](_0x60a7('0x3'),'variable','customVariable','keyValue',_0x60a7('0x4')),'defaultValue':_0x60a7('0x3')},'content':{'type':Sequelize[_0x60a7('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x60a7('0x3'),'variable',_0x60a7('0x6'))},'keyContent':{'type':Sequelize[_0x60a7('0x5')]},'idField':{'type':Sequelize[_0x60a7('0x5')]},'nameField':{'type':Sequelize[_0x60a7('0x5')]},'customField':{'type':Sequelize[_0x60a7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x60a7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index ce35fc9..e2e1958 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 _0x62e9=['index','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','ZendeskField','includeAll','include','rows','catch','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send'];(function(_0x193b04,_0x4b0ebc){var _0x1546d5=function(_0x203f4b){while(--_0x203f4b){_0x193b04['push'](_0x193b04['shift']());}};_0x1546d5(++_0x4b0ebc);}(_0x62e9,0x1e6));var _0x962e=function(_0x43214e,_0x3a8f04){_0x43214e=_0x43214e-0x0;var _0x14e0c8=_0x62e9[_0x43214e];return _0x14e0c8;};'use strict';var emlformat=require(_0x962e('0x0'));var rimraf=require(_0x962e('0x1'));var zipdir=require(_0x962e('0x2'));var jsonpatch=require(_0x962e('0x3'));var rp=require(_0x962e('0x4'));var moment=require('moment');var BPromise=require(_0x962e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x962e('0x6'));var sox=require(_0x962e('0x7'));var csv=require(_0x962e('0x8'));var ejs=require(_0x962e('0x9'));var fs=require('fs');var fs_extra=require(_0x962e('0xa'));var _=require(_0x962e('0xb'));var squel=require(_0x962e('0xc'));var crypto=require(_0x962e('0xd'));var jsforce=require(_0x962e('0xe'));var deskjs=require(_0x962e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x962e('0x10'));var Redis=require(_0x962e('0x11'));var authService=require(_0x962e('0x12'));var qs=require(_0x962e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x962e('0x14'));var logger=require(_0x962e('0x15'))(_0x962e('0x16'));var utils=require(_0x962e('0x17'));var config=require(_0x962e('0x18'));var licenseUtil=require(_0x962e('0x19'));var db=require(_0x962e('0x1a'))['db'];function respondWithStatusCode(_0x433bb9,_0x4bc4bb){_0x4bc4bb=_0x4bc4bb||0xcc;return function(_0x168b97){if(_0x168b97){return _0x433bb9[_0x962e('0x1b')](_0x4bc4bb);}return _0x433bb9[_0x962e('0x1c')](_0x4bc4bb)[_0x962e('0x1d')]();};}function respondWithResult(_0x1204b8,_0x3aea09){_0x3aea09=_0x3aea09||0xc8;return function(_0x1d1f6d){if(_0x1d1f6d){return _0x1204b8[_0x962e('0x1c')](_0x3aea09)[_0x962e('0x1e')](_0x1d1f6d);}};}function respondWithFilteredResult(_0x3549ca,_0x3aa693){return function(_0x2b87bb){if(_0x2b87bb){var _0x5cc51b=typeof _0x3aa693[_0x962e('0x1f')]===_0x962e('0x20')&&typeof _0x3aa693[_0x962e('0x21')]===_0x962e('0x20');var _0x533006=_0x2b87bb[_0x962e('0x22')];var _0xad5ced=_0x5cc51b?0x0:_0x3aa693[_0x962e('0x1f')];var _0x3bedff=_0x5cc51b?_0x2b87bb[_0x962e('0x22')]:_0x3aa693['offset']+_0x3aa693[_0x962e('0x21')];var _0x4c325b;if(_0x3bedff>=_0x533006){_0x3bedff=_0x533006;_0x4c325b=0xc8;}else{_0x4c325b=0xce;}_0x3549ca[_0x962e('0x1c')](_0x4c325b);return _0x3549ca[_0x962e('0x23')](_0x962e('0x24'),_0xad5ced+'-'+_0x3bedff+'/'+_0x533006)['json'](_0x2b87bb);}return null;};}function patchUpdates(_0x10f1ed){return function(_0x35bfd6){try{jsonpatch[_0x962e('0x25')](_0x35bfd6,_0x10f1ed,!![]);}catch(_0xb89c6){return BPromise[_0x962e('0x26')](_0xb89c6);}return _0x35bfd6[_0x962e('0x27')]();};}function saveUpdates(_0xe563ac,_0x5fdba2){return function(_0x15fabd){if(_0x15fabd){return _0x15fabd[_0x962e('0x28')](_0xe563ac)[_0x962e('0x29')](function(_0x2d7555){return _0x2d7555;});}return null;};}function removeEntity(_0x14297b,_0x4c2f79){return function(_0x2e27ac){if(_0x2e27ac){return _0x2e27ac[_0x962e('0x2a')]()[_0x962e('0x29')](function(){_0x14297b[_0x962e('0x1c')](0xcc)[_0x962e('0x1d')]();});}};}function handleEntityNotFound(_0x3095fe,_0x1aeb78){return function(_0x1098b2){if(!_0x1098b2){_0x3095fe[_0x962e('0x1b')](0x194);}return _0x1098b2;};}function handleError(_0x4939f1,_0xf411ae){_0xf411ae=_0xf411ae||0x1f4;return function(_0x202e12){logger['error'](_0x202e12[_0x962e('0x2b')]);if(_0x202e12[_0x962e('0x2c')]){delete _0x202e12['name'];}_0x4939f1[_0x962e('0x1c')](_0xf411ae)[_0x962e('0x2d')](_0x202e12);};}exports[_0x962e('0x2e')]=function(_0x197698,_0x4e739d){var _0x3933da={},_0x4a669f={},_0x67c136={'count':0x0,'rows':[]};var _0x5eb366=_['map'](db['ZendeskField'][_0x962e('0x2f')],function(_0xc91cbb){return{'name':_0xc91cbb['fieldName'],'type':_0xc91cbb[_0x962e('0x30')][_0x962e('0x31')]};});_0x4a669f[_0x962e('0x32')]=_[_0x962e('0x33')](_0x5eb366,_0x962e('0x2c'));_0x4a669f[_0x962e('0x34')]=_['keys'](_0x197698[_0x962e('0x34')]);_0x4a669f[_0x962e('0x35')]=_[_0x962e('0x36')](_0x4a669f[_0x962e('0x32')],_0x4a669f[_0x962e('0x34')]);_0x3933da['attributes']=_[_0x962e('0x36')](_0x4a669f[_0x962e('0x32')],qs[_0x962e('0x37')](_0x197698[_0x962e('0x34')][_0x962e('0x37')]));_0x3933da[_0x962e('0x38')]=_0x3933da[_0x962e('0x38')][_0x962e('0x39')]?_0x3933da[_0x962e('0x38')]:_0x4a669f[_0x962e('0x32')];if(!_0x197698['query'][_0x962e('0x3a')](_0x962e('0x3b'))){_0x3933da[_0x962e('0x21')]=qs['limit'](_0x197698[_0x962e('0x34')]['limit']);_0x3933da[_0x962e('0x1f')]=qs['offset'](_0x197698[_0x962e('0x34')][_0x962e('0x1f')]);}_0x3933da['order']=qs['sort'](_0x197698['query'][_0x962e('0x3c')]);_0x3933da[_0x962e('0x3d')]=qs['filters'](_['pick'](_0x197698[_0x962e('0x34')],_0x4a669f[_0x962e('0x35')]),_0x5eb366);if(_0x197698[_0x962e('0x34')]['filter']){_0x3933da[_0x962e('0x3d')]=_['merge'](_0x3933da[_0x962e('0x3d')],{'$or':_[_0x962e('0x33')](_0x5eb366,function(_0x5044fe){if(_0x5044fe[_0x962e('0x30')]!==_0x962e('0x3e')){var _0x115411={};_0x115411[_0x5044fe[_0x962e('0x2c')]]={'$like':'%'+_0x197698[_0x962e('0x34')][_0x962e('0x3f')]+'%'};return _0x115411;}})});}_0x3933da=_[_0x962e('0x40')]({},_0x3933da,_0x197698[_0x962e('0x41')]);var _0x320042={'where':_0x3933da['where']};return db[_0x962e('0x42')]['count'](_0x320042)['then'](function(_0x3586bc){_0x67c136[_0x962e('0x22')]=_0x3586bc;if(_0x197698[_0x962e('0x34')][_0x962e('0x43')]){_0x3933da[_0x962e('0x44')]=[{'all':!![]}];}return db[_0x962e('0x42')]['findAll'](_0x3933da);})[_0x962e('0x29')](function(_0x312967){_0x67c136[_0x962e('0x45')]=_0x312967;return _0x67c136;})[_0x962e('0x29')](respondWithFilteredResult(_0x4e739d,_0x3933da))[_0x962e('0x46')](handleError(_0x4e739d,null));};exports['show']=function(_0x5407a6,_0x169630){var _0x2f23ba={'raw':!![],'where':{'id':_0x5407a6[_0x962e('0x47')]['id']}},_0x3b1d0a={};_0x3b1d0a['model']=_[_0x962e('0x48')](db[_0x962e('0x42')][_0x962e('0x2f')]);_0x3b1d0a[_0x962e('0x34')]=_[_0x962e('0x48')](_0x5407a6['query']);_0x3b1d0a['filters']=_['intersection'](_0x3b1d0a[_0x962e('0x32')],_0x3b1d0a['query']);_0x2f23ba[_0x962e('0x38')]=_[_0x962e('0x36')](_0x3b1d0a[_0x962e('0x32')],qs[_0x962e('0x37')](_0x5407a6[_0x962e('0x34')][_0x962e('0x37')]));_0x2f23ba[_0x962e('0x38')]=_0x2f23ba[_0x962e('0x38')][_0x962e('0x39')]?_0x2f23ba['attributes']:_0x3b1d0a[_0x962e('0x32')];if(_0x5407a6[_0x962e('0x34')]['includeAll']){_0x2f23ba[_0x962e('0x44')]=[{'all':!![]}];}_0x2f23ba=_[_0x962e('0x40')]({},_0x2f23ba,_0x5407a6[_0x962e('0x41')]);return db[_0x962e('0x42')][_0x962e('0x49')](_0x2f23ba)[_0x962e('0x29')](handleEntityNotFound(_0x169630,null))[_0x962e('0x29')](respondWithResult(_0x169630,null))[_0x962e('0x46')](handleError(_0x169630,null));};exports[_0x962e('0x4a')]=function(_0x13764f,_0x378f1f){return db[_0x962e('0x42')][_0x962e('0x4a')](_0x13764f[_0x962e('0x4b')],{})[_0x962e('0x29')](respondWithResult(_0x378f1f,0xc9))[_0x962e('0x46')](handleError(_0x378f1f,null));};exports['update']=function(_0x52a00b,_0x382920){if(_0x52a00b[_0x962e('0x4b')]['id']){delete _0x52a00b['body']['id'];}return db[_0x962e('0x42')]['find']({'where':{'id':_0x52a00b[_0x962e('0x47')]['id']}})['then'](handleEntityNotFound(_0x382920,null))[_0x962e('0x29')](saveUpdates(_0x52a00b[_0x962e('0x4b')],null))[_0x962e('0x29')](respondWithResult(_0x382920,null))[_0x962e('0x46')](handleError(_0x382920,null));};exports[_0x962e('0x2a')]=function(_0xcd107f,_0x4684cc){return db['ZendeskField'][_0x962e('0x49')]({'where':{'id':_0xcd107f[_0x962e('0x47')]['id']}})[_0x962e('0x29')](handleEntityNotFound(_0x4684cc,null))[_0x962e('0x29')](removeEntity(_0x4684cc,null))[_0x962e('0x46')](handleError(_0x4684cc,null));}; \ No newline at end of file +var _0x6a17=['sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','count','set','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','ZendeskField','include','findAll','catch','show','params','intersection','fields','length','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x55ce6e,_0x3156ef){var _0x4c6157=function(_0x57fd2d){while(--_0x57fd2d){_0x55ce6e['push'](_0x55ce6e['shift']());}};_0x4c6157(++_0x3156ef);}(_0x6a17,0x1e8));var _0x76a1=function(_0x1c6250,_0x4ba01d){_0x1c6250=_0x1c6250-0x0;var _0x5e2f3a=_0x6a17[_0x1c6250];return _0x5e2f3a;};'use strict';var emlformat=require(_0x76a1('0x0'));var rimraf=require(_0x76a1('0x1'));var zipdir=require(_0x76a1('0x2'));var jsonpatch=require(_0x76a1('0x3'));var rp=require(_0x76a1('0x4'));var moment=require(_0x76a1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x76a1('0x6'));var util=require(_0x76a1('0x7'));var path=require(_0x76a1('0x8'));var sox=require(_0x76a1('0x9'));var csv=require(_0x76a1('0xa'));var ejs=require(_0x76a1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76a1('0xc'));var squel=require(_0x76a1('0xd'));var crypto=require(_0x76a1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x76a1('0xa'));var querystring=require(_0x76a1('0xf'));var Papa=require(_0x76a1('0x10'));var Redis=require(_0x76a1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x76a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76a1('0x13'));var logger=require(_0x76a1('0x14'))(_0x76a1('0x15'));var utils=require(_0x76a1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53fece,_0x50453b){_0x50453b=_0x50453b||0xcc;return function(_0x2b7d13){if(_0x2b7d13){return _0x53fece[_0x76a1('0x17')](_0x50453b);}return _0x53fece[_0x76a1('0x18')](_0x50453b)[_0x76a1('0x19')]();};}function respondWithResult(_0x2c1d90,_0x3c9caf){_0x3c9caf=_0x3c9caf||0xc8;return function(_0x509ee6){if(_0x509ee6){return _0x2c1d90['status'](_0x3c9caf)[_0x76a1('0x1a')](_0x509ee6);}};}function respondWithFilteredResult(_0x2885b0,_0x1942d3){return function(_0x31f0a5){if(_0x31f0a5){var _0x36fd74=typeof _0x1942d3[_0x76a1('0x1b')]==='undefined'&&typeof _0x1942d3[_0x76a1('0x1c')]==='undefined';var _0x1f0699=_0x31f0a5[_0x76a1('0x1d')];var _0x2c8d0b=_0x36fd74?0x0:_0x1942d3['offset'];var _0x5effcc=_0x36fd74?_0x31f0a5[_0x76a1('0x1d')]:_0x1942d3[_0x76a1('0x1b')]+_0x1942d3['limit'];var _0x16950b;if(_0x5effcc>=_0x1f0699){_0x5effcc=_0x1f0699;_0x16950b=0xc8;}else{_0x16950b=0xce;}_0x2885b0[_0x76a1('0x18')](_0x16950b);return _0x2885b0[_0x76a1('0x1e')]('Content-Range',_0x2c8d0b+'-'+_0x5effcc+'/'+_0x1f0699)[_0x76a1('0x1a')](_0x31f0a5);}return null;};}function patchUpdates(_0x3d729f){return function(_0x211782){try{jsonpatch['apply'](_0x211782,_0x3d729f,!![]);}catch(_0x2d9077){return BPromise['reject'](_0x2d9077);}return _0x211782[_0x76a1('0x1f')]();};}function saveUpdates(_0x579403,_0x269a37){return function(_0x157084){if(_0x157084){return _0x157084['update'](_0x579403)[_0x76a1('0x20')](function(_0x925739){return _0x925739;});}return null;};}function removeEntity(_0x409712,_0x5eb624){return function(_0x38014a){if(_0x38014a){return _0x38014a['destroy']()[_0x76a1('0x20')](function(){_0x409712[_0x76a1('0x18')](0xcc)[_0x76a1('0x19')]();});}};}function handleEntityNotFound(_0xe1c642,_0x5dd14a){return function(_0x3f8ee4){if(!_0x3f8ee4){_0xe1c642[_0x76a1('0x17')](0x194);}return _0x3f8ee4;};}function handleError(_0x39749e,_0x36a792){_0x36a792=_0x36a792||0x1f4;return function(_0x1045bf){logger[_0x76a1('0x21')](_0x1045bf[_0x76a1('0x22')]);if(_0x1045bf[_0x76a1('0x23')]){delete _0x1045bf[_0x76a1('0x23')];}_0x39749e[_0x76a1('0x18')](_0x36a792)[_0x76a1('0x24')](_0x1045bf);};}exports[_0x76a1('0x25')]=function(_0x522343,_0x29d6de){var _0x1dc14d={},_0x1e2fd2={},_0x2d4edd={'count':0x0,'rows':[]};var _0x1732b9=_[_0x76a1('0x26')](db['ZendeskField'][_0x76a1('0x27')],function(_0x183b1f){return{'name':_0x183b1f[_0x76a1('0x28')],'type':_0x183b1f[_0x76a1('0x29')][_0x76a1('0x2a')]};});_0x1e2fd2['model']=_[_0x76a1('0x26')](_0x1732b9,_0x76a1('0x23'));_0x1e2fd2[_0x76a1('0x2b')]=_[_0x76a1('0x2c')](_0x522343[_0x76a1('0x2b')]);_0x1e2fd2[_0x76a1('0x2d')]=_['intersection'](_0x1e2fd2[_0x76a1('0x2e')],_0x1e2fd2[_0x76a1('0x2b')]);_0x1dc14d['attributes']=_['intersection'](_0x1e2fd2['model'],qs['fields'](_0x522343[_0x76a1('0x2b')]['fields']));_0x1dc14d[_0x76a1('0x2f')]=_0x1dc14d[_0x76a1('0x2f')]['length']?_0x1dc14d['attributes']:_0x1e2fd2[_0x76a1('0x2e')];if(!_0x522343[_0x76a1('0x2b')][_0x76a1('0x30')]('nolimit')){_0x1dc14d[_0x76a1('0x1c')]=qs['limit'](_0x522343['query']['limit']);_0x1dc14d[_0x76a1('0x1b')]=qs[_0x76a1('0x1b')](_0x522343[_0x76a1('0x2b')][_0x76a1('0x1b')]);}_0x1dc14d[_0x76a1('0x31')]=qs[_0x76a1('0x32')](_0x522343['query'][_0x76a1('0x32')]);_0x1dc14d[_0x76a1('0x33')]=qs[_0x76a1('0x2d')](_[_0x76a1('0x34')](_0x522343[_0x76a1('0x2b')],_0x1e2fd2['filters']),_0x1732b9);if(_0x522343[_0x76a1('0x2b')][_0x76a1('0x35')]){_0x1dc14d[_0x76a1('0x33')]=_['merge'](_0x1dc14d[_0x76a1('0x33')],{'$or':_[_0x76a1('0x26')](_0x1732b9,function(_0x144205){if(_0x144205[_0x76a1('0x29')]!==_0x76a1('0x36')){var _0x8d4007={};_0x8d4007[_0x144205['name']]={'$like':'%'+_0x522343[_0x76a1('0x2b')][_0x76a1('0x35')]+'%'};return _0x8d4007;}})});}_0x1dc14d=_[_0x76a1('0x37')]({},_0x1dc14d,_0x522343[_0x76a1('0x38')]);var _0x2ffb4e={'where':_0x1dc14d[_0x76a1('0x33')]};return db[_0x76a1('0x39')][_0x76a1('0x1d')](_0x2ffb4e)[_0x76a1('0x20')](function(_0x107baa){_0x2d4edd[_0x76a1('0x1d')]=_0x107baa;if(_0x522343[_0x76a1('0x2b')]['includeAll']){_0x1dc14d[_0x76a1('0x3a')]=[{'all':!![]}];}return db[_0x76a1('0x39')][_0x76a1('0x3b')](_0x1dc14d);})['then'](function(_0x3b1469){_0x2d4edd['rows']=_0x3b1469;return _0x2d4edd;})['then'](respondWithFilteredResult(_0x29d6de,_0x1dc14d))[_0x76a1('0x3c')](handleError(_0x29d6de,null));};exports[_0x76a1('0x3d')]=function(_0x3600f8,_0x4f00dd){var _0x3a1b63={'raw':!![],'where':{'id':_0x3600f8[_0x76a1('0x3e')]['id']}},_0x5cfa12={};_0x5cfa12[_0x76a1('0x2e')]=_[_0x76a1('0x2c')](db[_0x76a1('0x39')][_0x76a1('0x27')]);_0x5cfa12[_0x76a1('0x2b')]=_['keys'](_0x3600f8[_0x76a1('0x2b')]);_0x5cfa12[_0x76a1('0x2d')]=_[_0x76a1('0x3f')](_0x5cfa12['model'],_0x5cfa12[_0x76a1('0x2b')]);_0x3a1b63[_0x76a1('0x2f')]=_[_0x76a1('0x3f')](_0x5cfa12[_0x76a1('0x2e')],qs[_0x76a1('0x40')](_0x3600f8['query'][_0x76a1('0x40')]));_0x3a1b63['attributes']=_0x3a1b63[_0x76a1('0x2f')][_0x76a1('0x41')]?_0x3a1b63[_0x76a1('0x2f')]:_0x5cfa12[_0x76a1('0x2e')];if(_0x3600f8[_0x76a1('0x2b')][_0x76a1('0x42')]){_0x3a1b63[_0x76a1('0x3a')]=[{'all':!![]}];}_0x3a1b63=_[_0x76a1('0x37')]({},_0x3a1b63,_0x3600f8[_0x76a1('0x38')]);return db[_0x76a1('0x39')][_0x76a1('0x43')](_0x3a1b63)[_0x76a1('0x20')](handleEntityNotFound(_0x4f00dd,null))[_0x76a1('0x20')](respondWithResult(_0x4f00dd,null))[_0x76a1('0x3c')](handleError(_0x4f00dd,null));};exports[_0x76a1('0x44')]=function(_0x1d39fe,_0x20a918){return db[_0x76a1('0x39')]['create'](_0x1d39fe[_0x76a1('0x45')],{})[_0x76a1('0x20')](respondWithResult(_0x20a918,0xc9))[_0x76a1('0x3c')](handleError(_0x20a918,null));};exports['update']=function(_0x554412,_0x295dfb){if(_0x554412[_0x76a1('0x45')]['id']){delete _0x554412[_0x76a1('0x45')]['id'];}return db[_0x76a1('0x39')]['find']({'where':{'id':_0x554412[_0x76a1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x295dfb,null))[_0x76a1('0x20')](saveUpdates(_0x554412[_0x76a1('0x45')],null))[_0x76a1('0x20')](respondWithResult(_0x295dfb,null))[_0x76a1('0x3c')](handleError(_0x295dfb,null));};exports[_0x76a1('0x46')]=function(_0x3f58f7,_0x4f45b7){return db['ZendeskField']['find']({'where':{'id':_0x3f58f7['params']['id']}})[_0x76a1('0x20')](handleEntityNotFound(_0x4f45b7,null))[_0x76a1('0x20')](removeEntity(_0x4f45b7,null))[_0x76a1('0x3c')](handleError(_0x4f45b7,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5028b17..3ec37d1 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 _0x36fc=['api','bluebird','path','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x3b5a7b,_0x537a86){var _0x34df10=function(_0x1558d9){while(--_0x1558d9){_0x3b5a7b['push'](_0x3b5a7b['shift']());}};_0x34df10(++_0x537a86);}(_0x36fc,0xdb));var _0xc36f=function(_0x102883,_0x1f0a26){_0x102883=_0x102883-0x0;var _0x2cf47d=_0x36fc[_0x102883];return _0x2cf47d;};'use strict';var _=require(_0xc36f('0x0'));var util=require('util');var logger=require(_0xc36f('0x1'))(_0xc36f('0x2'));var moment=require('moment');var BPromise=require(_0xc36f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc36f('0x4'));var rimraf=require('rimraf');var config=require(_0xc36f('0x5'));var attributes=require(_0xc36f('0x6'));module['exports']=function(_0x35419d,_0x113f3f){return _0x35419d[_0xc36f('0x7')](_0xc36f('0x8'),attributes,{'tableName':_0xc36f('0x9'),'paranoid':![],'indexes':[{'name':_0xc36f('0xa'),'fields':[_0xc36f('0xb'),_0xc36f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd885=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','int_zendesk_fields','idField','lodash','util'];(function(_0x358166,_0x542af6){var _0x1e3e29=function(_0x47234c){while(--_0x47234c){_0x358166['push'](_0x358166['shift']());}};_0x1e3e29(++_0x542af6);}(_0xd885,0x108));var _0x5d88=function(_0x34a245,_0x2a7e91){_0x34a245=_0x34a245-0x0;var _0x405451=_0xd885[_0x34a245];return _0x405451;};'use strict';var _=require(_0x5d88('0x0'));var util=require(_0x5d88('0x1'));var logger=require(_0x5d88('0x2'))(_0x5d88('0x3'));var moment=require(_0x5d88('0x4'));var BPromise=require(_0x5d88('0x5'));var rp=require(_0x5d88('0x6'));var fs=require('fs');var path=require(_0x5d88('0x7'));var rimraf=require(_0x5d88('0x8'));var config=require(_0x5d88('0x9'));var attributes=require(_0x5d88('0xa'));module[_0x5d88('0xb')]=function(_0x57f047,_0x565a67){return _0x57f047['define']('ZendeskField',attributes,{'tableName':_0x5d88('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x5d88('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 931f020..292d5f2 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 _0xad2c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x46540e,_0x2a75e5){var _0x3d4fc2=function(_0x1295c6){while(--_0x1295c6){_0x46540e['push'](_0x46540e['shift']());}};_0x3d4fc2(++_0x2a75e5);}(_0xad2c,0x18a));var _0xcad2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xad2c[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xcad2('0x0'));var util=require(_0xcad2('0x1'));var moment=require('moment');var BPromise=require(_0xcad2('0x2'));var rs=require(_0xcad2('0x3'));var fs=require('fs');var Redis=require(_0xcad2('0x4'));var db=require(_0xcad2('0x5'))['db'];var utils=require(_0xcad2('0x6'));var logger=require(_0xcad2('0x7'))(_0xcad2('0x8'));var config=require('../../config/environment');var jayson=require(_0xcad2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19262b,_0x41f3f5,_0xf0085e){return new BPromise(function(_0x4289c5,_0x3579d3){return client['request'](_0x19262b,_0xf0085e)['then'](function(_0x301be7){logger[_0xcad2('0xa')](_0xcad2('0xb'),_0x41f3f5,'request\x20sent');logger[_0xcad2('0xc')](_0xcad2('0xd'),_0x41f3f5,_0xcad2('0xe'),JSON['stringify'](_0x301be7));if(_0x301be7[_0xcad2('0xf')]){if(_0x301be7[_0xcad2('0xf')]['code']===0x1f4){logger['error'](_0xcad2('0xb'),_0x41f3f5,_0x301be7[_0xcad2('0xf')][_0xcad2('0x10')]);return _0x3579d3(_0x301be7['error'][_0xcad2('0x10')]);}logger['error'](_0xcad2('0xb'),_0x41f3f5,_0x301be7[_0xcad2('0xf')][_0xcad2('0x10')]);return _0x4289c5(_0x301be7[_0xcad2('0xf')][_0xcad2('0x10')]);}else{logger[_0xcad2('0xa')]('ZendeskField,\x20%s,\x20%s',_0x41f3f5,_0xcad2('0xe'));_0x4289c5(_0x301be7[_0xcad2('0x11')][_0xcad2('0x10')]);}})[_0xcad2('0x12')](function(_0x3ee670){logger[_0xcad2('0xf')]('ZendeskField,\x20%s,\x20%s',_0x41f3f5,_0x3ee670);_0x3579d3(_0x3ee670);});});} \ No newline at end of file +var _0x4b5c=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','code'];(function(_0x56808f,_0x148128){var _0x58db2a=function(_0x363567){while(--_0x363567){_0x56808f['push'](_0x56808f['shift']());}};_0x58db2a(++_0x148128);}(_0x4b5c,0x100));var _0xc4b5=function(_0x217afb,_0x4466c5){_0x217afb=_0x217afb-0x0;var _0x108f7e=_0x4b5c[_0x217afb];return _0x108f7e;};'use strict';var _=require(_0xc4b5('0x0'));var util=require(_0xc4b5('0x1'));var moment=require(_0xc4b5('0x2'));var BPromise=require(_0xc4b5('0x3'));var rs=require(_0xc4b5('0x4'));var fs=require('fs');var Redis=require(_0xc4b5('0x5'));var db=require(_0xc4b5('0x6'))['db'];var utils=require(_0xc4b5('0x7'));var logger=require(_0xc4b5('0x8'))('rpc');var config=require(_0xc4b5('0x9'));var jayson=require(_0xc4b5('0xa'));var client=jayson[_0xc4b5('0xb')][_0xc4b5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41112a,_0xacf545,_0x1d49c9){return new BPromise(function(_0x6e30fb,_0x51c195){return client['request'](_0x41112a,_0x1d49c9)[_0xc4b5('0xd')](function(_0x88e125){logger[_0xc4b5('0xe')](_0xc4b5('0xf'),_0xacf545,_0xc4b5('0x10'));logger[_0xc4b5('0x11')](_0xc4b5('0x12'),_0xacf545,_0xc4b5('0x10'),JSON['stringify'](_0x88e125));if(_0x88e125['error']){if(_0x88e125['error'][_0xc4b5('0x13')]===0x1f4){logger[_0xc4b5('0x14')](_0xc4b5('0xf'),_0xacf545,_0x88e125['error']['message']);return _0x51c195(_0x88e125['error']['message']);}logger[_0xc4b5('0x14')](_0xc4b5('0xf'),_0xacf545,_0x88e125[_0xc4b5('0x14')][_0xc4b5('0x15')]);return _0x6e30fb(_0x88e125[_0xc4b5('0x14')][_0xc4b5('0x15')]);}else{logger[_0xc4b5('0xe')](_0xc4b5('0xf'),_0xacf545,_0xc4b5('0x10'));_0x6e30fb(_0x88e125[_0xc4b5('0x16')][_0xc4b5('0x15')]);}})['catch'](function(_0x192b04){logger[_0xc4b5('0x14')](_0xc4b5('0xf'),_0xacf545,_0x192b04);_0x51c195(_0x192b04);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index bbd1501..af5d817 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 _0x625d=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete'];(function(_0x67d242,_0x28a21c){var _0xb1faad=function(_0x4d1d1e){while(--_0x4d1d1e){_0x67d242['push'](_0x67d242['shift']());}};_0xb1faad(++_0x28a21c);}(_0x625d,0xf4));var _0xd625=function(_0x58c8be,_0x458021){_0x58c8be=_0x58c8be-0x0;var _0x308502=_0x625d[_0x58c8be];return _0x308502;};'use strict';var multer=require(_0xd625('0x0'));var util=require(_0xd625('0x1'));var path=require('path');var timeout=require(_0xd625('0x2'));var express=require('express');var router=express[_0xd625('0x3')]();var fs_extra=require(_0xd625('0x4'));var auth=require(_0xd625('0x5'));var interaction=require(_0xd625('0x6'));var config=require(_0xd625('0x7'));var controller=require('./intZohoAccount.controller');router[_0xd625('0x8')]('/',auth[_0xd625('0x9')](),controller['index']);router[_0xd625('0x8')](_0xd625('0xa'),auth['isAuthenticated'](),controller[_0xd625('0xb')]);router['get'](_0xd625('0xc'),auth[_0xd625('0x9')](),controller[_0xd625('0xd')]);router[_0xd625('0x8')](_0xd625('0xe'),auth[_0xd625('0x9')](),controller[_0xd625('0xf')]);router[_0xd625('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xd625('0xc'),auth['isAuthenticated'](),controller[_0xd625('0x11')]);router[_0xd625('0x12')](_0xd625('0xa'),auth[_0xd625('0x9')](),controller['update']);router[_0xd625('0x13')]('/:id',auth[_0xd625('0x9')](),controller[_0xd625('0x14')]);module[_0xd625('0x15')]=router; \ No newline at end of file +var _0x11db=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x1a08ad,_0x21d209){var _0x521649=function(_0x1794e7){while(--_0x1794e7){_0x1a08ad['push'](_0x1a08ad['shift']());}};_0x521649(++_0x21d209);}(_0x11db,0x94));var _0xb11d=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0x11db[_0x5e8eae];return _0xdd09cd;};'use strict';var multer=require('multer');var util=require(_0xb11d('0x0'));var path=require(_0xb11d('0x1'));var timeout=require(_0xb11d('0x2'));var express=require('express');var router=express[_0xb11d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb11d('0x4'));var interaction=require(_0xb11d('0x5'));var config=require(_0xb11d('0x6'));var controller=require('./intZohoAccount.controller');router[_0xb11d('0x7')]('/',auth[_0xb11d('0x8')](),controller['index']);router[_0xb11d('0x7')](_0xb11d('0x9'),auth[_0xb11d('0x8')](),controller['show']);router[_0xb11d('0x7')](_0xb11d('0xa'),auth['isAuthenticated'](),controller[_0xb11d('0xb')]);router[_0xb11d('0x7')]('/:id/fields',auth[_0xb11d('0x8')](),controller['getFields']);router['post']('/',auth[_0xb11d('0x8')](),controller['create']);router[_0xb11d('0xc')](_0xb11d('0xa'),auth[_0xb11d('0x8')](),controller[_0xb11d('0xd')]);router[_0xb11d('0xe')](_0xb11d('0x9'),auth[_0xb11d('0x8')](),controller[_0xb11d('0xf')]);router[_0xb11d('0x10')](_0xb11d('0x9'),auth[_0xb11d('0x8')](),controller[_0xb11d('0x11')]);module[_0xb11d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 65dfa73..a18e983 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 _0x84ab=['sequelize','exports','STRING'];(function(_0x12000d,_0x151c52){var _0x1ca11b=function(_0x4be484){while(--_0x4be484){_0x12000d['push'](_0x12000d['shift']());}};_0x1ca11b(++_0x151c52);}(_0x84ab,0x12f));var _0xb84a=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0x84ab[_0x867b0a];return _0x137438;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'name':{'type':Sequelize[_0xb84a('0x2')]},'description':{'type':Sequelize[_0xb84a('0x2')]},'host':{'type':Sequelize[_0xb84a('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb84a('0x2')]},'clientSecret':{'type':Sequelize[_0xb84a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb84a('0x2')]},'refreshToken':{'type':Sequelize[_0xb84a('0x2')]}}; \ No newline at end of file +var _0x0a9a=['STRING','exports'];(function(_0x23d761,_0x244dcf){var _0x518e33=function(_0xeb01a6){while(--_0xeb01a6){_0x23d761['push'](_0x23d761['shift']());}};_0x518e33(++_0x244dcf);}(_0x0a9a,0x183));var _0xa0a9=function(_0x1a59a4,_0x82568f){_0x1a59a4=_0x1a59a4-0x0;var _0x4481f0=_0x0a9a[_0x1a59a4];return _0x4481f0;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa0a9('0x1')]},'host':{'type':Sequelize[_0xa0a9('0x1')]},'zone':{'type':Sequelize[_0xa0a9('0x1')]},'clientId':{'type':Sequelize[_0xa0a9('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa0a9('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 47ed2a0..aadcc71 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 _0x63a9=['crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','name','send','index','map','ZohoAccount','type','key','model','filters','intersection','query','attributes','fields','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','rawAttributes','length','create','body','update','find','catch','params','getConfigurations','findOne','ZohoConfiguration','sort','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel'];(function(_0x32251f,_0x3e49df){var _0xa9de38=function(_0x17b063){while(--_0x17b063){_0x32251f['push'](_0x32251f['shift']());}};_0xa9de38(++_0x3e49df);}(_0x63a9,0x16f));var _0x963a=function(_0x4d2a89,_0x491fa1){_0x4d2a89=_0x4d2a89-0x0;var _0x24d5b2=_0x63a9[_0x4d2a89];return _0x24d5b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x963a('0x0'));var zipdir=require(_0x963a('0x1'));var jsonpatch=require(_0x963a('0x2'));var rp=require(_0x963a('0x3'));var moment=require('moment');var BPromise=require(_0x963a('0x4'));var Mustache=require(_0x963a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x963a('0x6'));var csv=require(_0x963a('0x7'));var ejs=require(_0x963a('0x8'));var fs=require('fs');var fs_extra=require(_0x963a('0x9'));var _=require('lodash');var squel=require(_0x963a('0xa'));var crypto=require(_0x963a('0xb'));var jsforce=require(_0x963a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x963a('0xd'));var Redis=require('ioredis');var authService=require(_0x963a('0xe'));var qs=require(_0x963a('0xf'));var as=require(_0x963a('0x10'));var hardwareService=require(_0x963a('0x11'));var logger=require('../../config/logger')(_0x963a('0x12'));var utils=require('../../config/utils');var config=require(_0x963a('0x13'));var licenseUtil=require(_0x963a('0x14'));var db=require(_0x963a('0x15'))['db'];var integrations=require(_0x963a('0x16'));function respondWithStatusCode(_0x389a2c,_0x226e80){_0x226e80=_0x226e80||0xcc;return function(_0x17162e){if(_0x17162e){return _0x389a2c[_0x963a('0x17')](_0x226e80);}return _0x389a2c[_0x963a('0x18')](_0x226e80)[_0x963a('0x19')]();};}function respondWithResult(_0x2a37d6,_0x5b173f){_0x5b173f=_0x5b173f||0xc8;return function(_0x206f5e){if(_0x206f5e){return _0x2a37d6[_0x963a('0x18')](_0x5b173f)[_0x963a('0x1a')](_0x206f5e);}};}function respondWithFilteredResult(_0x145662,_0x5bb748){return function(_0x33429a){if(_0x33429a){var _0x5aaa4d=typeof _0x5bb748[_0x963a('0x1b')]===_0x963a('0x1c')&&typeof _0x5bb748[_0x963a('0x1d')]===_0x963a('0x1c');var _0x4f9b5b=_0x33429a[_0x963a('0x1e')];var _0x1d56e0=_0x5aaa4d?0x0:_0x5bb748[_0x963a('0x1b')];var _0x4bcac2=_0x5aaa4d?_0x33429a[_0x963a('0x1e')]:_0x5bb748['offset']+_0x5bb748[_0x963a('0x1d')];var _0x2b8673;if(_0x4bcac2>=_0x4f9b5b){_0x4bcac2=_0x4f9b5b;_0x2b8673=0xc8;}else{_0x2b8673=0xce;}_0x145662[_0x963a('0x18')](_0x2b8673);return _0x145662[_0x963a('0x1f')](_0x963a('0x20'),_0x1d56e0+'-'+_0x4bcac2+'/'+_0x4f9b5b)['json'](_0x33429a);}return null;};}function patchUpdates(_0x2f24be){return function(_0x430260){try{jsonpatch['apply'](_0x430260,_0x2f24be,!![]);}catch(_0x5305ff){return BPromise[_0x963a('0x21')](_0x5305ff);}return _0x430260[_0x963a('0x22')]();};}function saveUpdates(_0x40ea1a,_0x1ce45c){return function(_0x7ad3d9){if(_0x7ad3d9){return _0x7ad3d9['update'](_0x40ea1a)['then'](function(_0x19cd3e){return _0x19cd3e;});}return null;};}function removeEntity(_0x1c0b3e,_0x3e01d6){return function(_0x560a14){if(_0x560a14){return _0x560a14[_0x963a('0x23')]()[_0x963a('0x24')](function(){_0x1c0b3e[_0x963a('0x18')](0xcc)[_0x963a('0x19')]();});}};}function handleEntityNotFound(_0x124a30,_0x18ccfc){return function(_0x353177){if(!_0x353177){_0x124a30[_0x963a('0x17')](0x194);}return _0x353177;};}function handleError(_0x488ff3,_0x44fa4a){_0x44fa4a=_0x44fa4a||0x1f4;return function(_0x20ea82){logger[_0x963a('0x25')](_0x20ea82['stack']);if(_0x20ea82[_0x963a('0x26')]){delete _0x20ea82[_0x963a('0x26')];}_0x488ff3[_0x963a('0x18')](_0x44fa4a)[_0x963a('0x27')](_0x20ea82);};}exports[_0x963a('0x28')]=function(_0x2d83d6,_0x2cb5a){var _0x169336={},_0x58b75b={},_0x12ea2c={'count':0x0,'rows':[]};var _0x4cfbca=_[_0x963a('0x29')](db[_0x963a('0x2a')]['rawAttributes'],function(_0x888982){return{'name':_0x888982['fieldName'],'type':_0x888982[_0x963a('0x2b')][_0x963a('0x2c')]};});_0x58b75b[_0x963a('0x2d')]=_[_0x963a('0x29')](_0x4cfbca,_0x963a('0x26'));_0x58b75b['query']=_['keys'](_0x2d83d6['query']);_0x58b75b[_0x963a('0x2e')]=_[_0x963a('0x2f')](_0x58b75b[_0x963a('0x2d')],_0x58b75b[_0x963a('0x30')]);_0x169336[_0x963a('0x31')]=_[_0x963a('0x2f')](_0x58b75b[_0x963a('0x2d')],qs[_0x963a('0x32')](_0x2d83d6[_0x963a('0x30')][_0x963a('0x32')]));_0x169336['attributes']=_0x169336[_0x963a('0x31')]['length']?_0x169336[_0x963a('0x31')]:_0x58b75b[_0x963a('0x2d')];if(!_0x2d83d6[_0x963a('0x30')]['hasOwnProperty'](_0x963a('0x33'))){_0x169336[_0x963a('0x1d')]=qs[_0x963a('0x1d')](_0x2d83d6[_0x963a('0x30')][_0x963a('0x1d')]);_0x169336[_0x963a('0x1b')]=qs['offset'](_0x2d83d6[_0x963a('0x30')][_0x963a('0x1b')]);}_0x169336[_0x963a('0x34')]=qs['sort'](_0x2d83d6[_0x963a('0x30')]['sort']);_0x169336[_0x963a('0x35')]=qs[_0x963a('0x2e')](_[_0x963a('0x36')](_0x2d83d6[_0x963a('0x30')],_0x58b75b[_0x963a('0x2e')]),_0x4cfbca);if(_0x2d83d6[_0x963a('0x30')]['filter']){_0x169336[_0x963a('0x35')]=_[_0x963a('0x37')](_0x169336[_0x963a('0x35')],{'$or':_[_0x963a('0x29')](_0x4cfbca,function(_0x3cdadb){if(_0x3cdadb[_0x963a('0x2b')]!==_0x963a('0x38')){var _0x258d98={};_0x258d98[_0x3cdadb[_0x963a('0x26')]]={'$like':'%'+_0x2d83d6[_0x963a('0x30')][_0x963a('0x39')]+'%'};return _0x258d98;}})});}_0x169336=_[_0x963a('0x37')]({},_0x169336,_0x2d83d6[_0x963a('0x3a')]);var _0x13ec57={'where':_0x169336[_0x963a('0x35')]};return db['ZohoAccount'][_0x963a('0x1e')](_0x13ec57)[_0x963a('0x24')](function(_0x11c99e){_0x12ea2c[_0x963a('0x1e')]=_0x11c99e;if(_0x2d83d6['query'][_0x963a('0x3b')]){_0x169336[_0x963a('0x3c')]=[{'all':!![]}];}return db[_0x963a('0x2a')][_0x963a('0x3d')](_0x169336);})[_0x963a('0x24')](function(_0x1dcd94){_0x12ea2c[_0x963a('0x3e')]=_0x1dcd94;return _0x12ea2c;})[_0x963a('0x24')](respondWithFilteredResult(_0x2cb5a,_0x169336))['catch'](handleError(_0x2cb5a,null));};exports[_0x963a('0x3f')]=function(_0x5bff81,_0x1d767b){var _0x388cee={'raw':![],'where':{'id':_0x5bff81['params']['id']}},_0x5a6c4f={};_0x5a6c4f[_0x963a('0x2d')]=_[_0x963a('0x40')](db[_0x963a('0x2a')][_0x963a('0x41')]);_0x5a6c4f['query']=_['keys'](_0x5bff81['query']);_0x5a6c4f[_0x963a('0x2e')]=_['intersection'](_0x5a6c4f['model'],_0x5a6c4f[_0x963a('0x30')]);_0x388cee[_0x963a('0x31')]=_[_0x963a('0x2f')](_0x5a6c4f['model'],qs[_0x963a('0x32')](_0x5bff81[_0x963a('0x30')][_0x963a('0x32')]));_0x388cee[_0x963a('0x31')]=_0x388cee['attributes'][_0x963a('0x42')]?_0x388cee[_0x963a('0x31')]:_0x5a6c4f[_0x963a('0x2d')];if(_0x5bff81[_0x963a('0x30')][_0x963a('0x3b')]){_0x388cee['include']=[{'all':!![]}];}_0x388cee=_['merge']({},_0x388cee,_0x5bff81[_0x963a('0x3a')]);return db[_0x963a('0x2a')]['find'](_0x388cee)[_0x963a('0x24')](handleEntityNotFound(_0x1d767b,null))[_0x963a('0x24')](respondWithResult(_0x1d767b,null))['catch'](handleError(_0x1d767b,null));};exports[_0x963a('0x43')]=function(_0x3e1537,_0x2d4a5c){return db[_0x963a('0x2a')][_0x963a('0x43')](_0x3e1537[_0x963a('0x44')],{})[_0x963a('0x24')](respondWithResult(_0x2d4a5c,0xc9))['catch'](handleError(_0x2d4a5c,null));};exports[_0x963a('0x45')]=function(_0x2b7c09,_0x506f51){if(_0x2b7c09['body']['id']){delete _0x2b7c09[_0x963a('0x44')]['id'];}return db[_0x963a('0x2a')][_0x963a('0x46')]({'where':{'id':_0x2b7c09['params']['id']}})[_0x963a('0x24')](handleEntityNotFound(_0x506f51,null))['then'](saveUpdates(_0x2b7c09[_0x963a('0x44')],null))[_0x963a('0x24')](respondWithResult(_0x506f51,null))[_0x963a('0x47')](handleError(_0x506f51,null));};exports[_0x963a('0x23')]=function(_0x37a73c,_0x266615){return db[_0x963a('0x2a')][_0x963a('0x46')]({'where':{'id':_0x37a73c[_0x963a('0x48')]['id']}})[_0x963a('0x24')](handleEntityNotFound(_0x266615,null))[_0x963a('0x24')](removeEntity(_0x266615,null))[_0x963a('0x47')](handleError(_0x266615,null));};exports[_0x963a('0x49')]=function(_0x17b635,_0x3d3909,_0x1780e2){var _0x85f734={};var _0x3777d1={};var _0x1fc6ee;var _0xb129c3;return db['ZohoAccount'][_0x963a('0x4a')]({'where':{'id':_0x17b635['params']['id']}})[_0x963a('0x24')](handleEntityNotFound(_0x3d3909,null))[_0x963a('0x24')](function(_0xeee4c2){if(_0xeee4c2){_0x1fc6ee=_0xeee4c2;_0x3777d1[_0x963a('0x2d')]=_['keys'](db[_0x963a('0x4b')]['rawAttributes']);_0x3777d1['query']=_[_0x963a('0x40')](_0x17b635[_0x963a('0x30')]);_0x3777d1['filters']=_['intersection'](_0x3777d1['model'],_0x3777d1[_0x963a('0x30')]);_0x85f734[_0x963a('0x31')]=_[_0x963a('0x2f')](_0x3777d1[_0x963a('0x2d')],qs[_0x963a('0x32')](_0x17b635[_0x963a('0x30')][_0x963a('0x32')]));_0x85f734[_0x963a('0x31')]=_0x85f734[_0x963a('0x31')]['length']?_0x85f734[_0x963a('0x31')]:_0x3777d1[_0x963a('0x2d')];_0x85f734[_0x963a('0x34')]=qs['sort'](_0x17b635[_0x963a('0x30')][_0x963a('0x4c')]);_0x85f734['where']=qs[_0x963a('0x2e')](_[_0x963a('0x36')](_0x17b635[_0x963a('0x30')],_0x3777d1[_0x963a('0x2e')]));if(_0x17b635[_0x963a('0x30')][_0x963a('0x39')]){_0x85f734[_0x963a('0x35')]=_['merge'](_0x85f734[_0x963a('0x35')],{'$or':_[_0x963a('0x29')](_0x85f734[_0x963a('0x31')],function(_0x257f4b){var _0x13327f={};_0x13327f[_0x257f4b]={'$like':'%'+_0x17b635['query'][_0x963a('0x39')]+'%'};return _0x13327f;})});}_0x85f734=_[_0x963a('0x37')]({},_0x85f734,_0x17b635[_0x963a('0x3a')]);return _0x1fc6ee[_0x963a('0x49')](_0x85f734);}})['then'](function(_0x505d44){if(_0x505d44){_0xb129c3=_0x505d44[_0x963a('0x42')];if(!_0x17b635[_0x963a('0x30')][_0x963a('0x4d')](_0x963a('0x33'))){_0x85f734[_0x963a('0x1d')]=qs[_0x963a('0x1d')](_0x17b635[_0x963a('0x30')][_0x963a('0x1d')]);_0x85f734[_0x963a('0x1b')]=qs[_0x963a('0x1b')](_0x17b635['query']['offset']);}return _0x1fc6ee[_0x963a('0x49')](_0x85f734);}})[_0x963a('0x24')](function(_0x12ce3e){if(_0x12ce3e){return _0x12ce3e?{'count':_0xb129c3,'rows':_0x12ce3e}:null;}})['then'](respondWithResult(_0x3d3909,null))[_0x963a('0x47')](handleError(_0x3d3909,null));};exports[_0x963a('0x4e')]=function(_0x4a5d2a,_0x1645ef,_0x15a110){if(_0x4a5d2a['body']['id']){delete _0x4a5d2a[_0x963a('0x44')]['id'];}return db[_0x963a('0x2a')][_0x963a('0x4a')]({'where':{'id':_0x4a5d2a['params']['id']}})[_0x963a('0x24')](handleEntityNotFound(_0x1645ef,null))[_0x963a('0x24')](function(_0x5d2d60){if(_0x5d2d60){_0x4a5d2a['body'][_0x963a('0x4f')]=_0x5d2d60['id'];_0x4a5d2a[_0x963a('0x44')][_0x963a('0x50')]=integrations[_0x963a('0x51')](_0x4a5d2a[_0x963a('0x44')]['channel'],_0x4a5d2a[_0x963a('0x44')][_0x963a('0x2b')]);_0x4a5d2a[_0x963a('0x44')][_0x963a('0x52')]=integrations[_0x963a('0x53')](_0x4a5d2a[_0x963a('0x44')][_0x963a('0x54')],_0x4a5d2a[_0x963a('0x44')][_0x963a('0x2b')]);return db[_0x963a('0x4b')][_0x963a('0x43')](_0x4a5d2a['body'],{'include':[{'model':db[_0x963a('0x55')],'as':_0x963a('0x50')},{'model':db[_0x963a('0x55')],'as':_0x963a('0x52')}]});}return null;})[_0x963a('0x24')](respondWithResult(_0x1645ef,null))[_0x963a('0x47')](handleError(_0x1645ef,null));};function getAccessToken(_0x26dfb5){return new Promise(function(_0x3e86d3,_0x37aaf6){var _0x47e612;switch(_0x26dfb5[_0x963a('0x56')]){case'US':_0x47e612='https://accounts.zoho.com';break;case'AU':_0x47e612=_0x963a('0x57');break;case'EU':_0x47e612='https://accounts.zoho.eu';break;case'IN':_0x47e612=_0x963a('0x58');break;case'CN':_0x47e612='https://accounts.zoho.com.cn';break;default:_0x47e612=_0x963a('0x59');break;}var _0x9ee4a5={'method':_0x963a('0x5a'),'uri':_0x47e612+_0x963a('0x5b'),'qs':{'refresh_token':_0x26dfb5[_0x963a('0x5c')],'client_id':_0x26dfb5[_0x963a('0x5d')],'client_secret':_0x26dfb5['clientSecret'],'grant_type':_0x963a('0x5e')},'json':!![]};return rp(_0x9ee4a5)[_0x963a('0x24')](function(_0x2abcea){if(_0x2abcea['access_token']){_0x3e86d3(_0x2abcea[_0x963a('0x5f')]);}else{_0x37aaf6(_0x963a('0x60'));}})[_0x963a('0x47')](function(_0x1d4731){_0x37aaf6(_0x1d4731);});});}exports[_0x963a('0x61')]=function(_0x3444c6,_0xdbc547,_0x11748a){var _0x305728,_0x3f5256,_0x2c9f38,_0x48787d,_0x5a5275;return db[_0x963a('0x2a')][_0x963a('0x4a')]({'where':{'id':_0x3444c6[_0x963a('0x48')]['id']},'attributes':['id',_0x963a('0x62'),_0x963a('0x56'),_0x963a('0x5d'),_0x963a('0x63'),_0x963a('0x64'),'code','refreshToken']})['then'](handleEntityNotFound(_0xdbc547,null))[_0x963a('0x24')](function(_0x1d4c5a){_0x5a5275=_0x1d4c5a;_0x305728=_0x5a5275[_0x963a('0x62')];_0x3f5256=_0x305728===_0x963a('0x65')?'eu':'com';_0x2c9f38=_0x5a5275[_0x963a('0x64')];var _0x5d0842=_0x2c9f38[_0x963a('0x66')](-0x1);if(_0x5d0842==='/'||_0x5d0842==='\x5c'||_0x5d0842===':'){_0x2c9f38=_0x2c9f38[_0x963a('0x67')](0x0,_0x2c9f38[_0x963a('0x68')](_0x5d0842));}if(!_0x5a5275[_0x963a('0x5c')]){throw new Error(_0x963a('0x69'));}return getAccessToken(_0x5a5275);})[_0x963a('0x24')](function(_0x33870c){if(_0x33870c){return rp({'method':'GET','uri':util[_0x963a('0x6a')](_0x963a('0x6b'),_0x3f5256),'qs':{'module':'Calls'},'headers':{'Authorization':_0x963a('0x6c')+_0x33870c},'json':!![]});}})[_0x963a('0x24')](function(_0x20fabe){if(_0x20fabe){if(_0x20fabe[_0x963a('0x6d')]&&_0x20fabe[_0x963a('0x6d')][_0x963a('0x25')]){throw new Error(_0x20fabe[_0x963a('0x6d')]['error'][_0x963a('0x6e')]);}var _0x481e1a=[];var _0x4b49d6=[];var _0xb28c68=[_0x963a('0x6f'),_0x963a('0x70'),'Description',_0x963a('0x71'),_0x963a('0x72'),'Call_Result',_0x963a('0x73'),_0x963a('0x74')];_0x4b49d6=_[_0x963a('0x75')](_0x20fabe[_0x963a('0x32')],function(_0x237262){return _0xb28c68[_0x963a('0x76')](_0x237262['api_name']);});for(var _0x74cdd8=0x0;_0x74cdd8<_0x4b49d6[_0x963a('0x42')];_0x74cdd8++){if(_0x4b49d6[_0x74cdd8]['system_mandatory']===![]){_0x481e1a['push']({'id':_0x4b49d6[_0x74cdd8]['id'],'name':_0x4b49d6[_0x74cdd8]['display_label'],'custom':_0x4b49d6[_0x74cdd8][_0x963a('0x77')],'options':_0x4b49d6[_0x74cdd8][_0x963a('0x78')]===_0x963a('0x79')&&_0x4b49d6[_0x74cdd8][_0x963a('0x7a')][_0x963a('0x42')]>-0x1?_['map'](_0x4b49d6[_0x74cdd8]['pick_list_values'],function(_0x53901e){return{'name':_0x53901e,'value':_0x53901e};}):[]});}}return{'count':_0x481e1a[_0x963a('0x42')],'rows':_0x481e1a};}else{return{'count':0x0,'rows':[]};}})[_0x963a('0x24')](respondWithResult(_0xdbc547,null))['catch'](function(_0x5dc955){var _0x5217b0=_0x3444c6[_0x963a('0x30')][_0x963a('0x7b')]?0x1f4:_0x5dc955['statusCode']||0x1f4;logger[_0x963a('0x25')](_0x963a('0x7c'),_0x963a('0x61'),_0x5217b0,JSON['stringify'](_0x5dc955));delete _0x5dc955[_0x963a('0x26')];if(_0x5217b0===0x191){_0x5217b0=0x190;}_0xdbc547[_0x963a('0x18')](_0x5217b0)[_0x963a('0x27')](_0x3444c6[_0x963a('0x30')][_0x963a('0x7b')]?{'message':_0x963a('0x7d'),'statusCode':_0x5dc955['statusCode']}:_0x5dc955);});}; \ No newline at end of file +var _0x057d=['https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','com','slice','substring','lastIndexOf','GET','format','Calls','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Type','remove','system_mandatory','display_label','data_type','picklist','pick_list_values','statusCode','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','keys','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0x057d,0x131));var _0xd057=function(_0x2b57fc,_0x4b3658){_0x2b57fc=_0x2b57fc-0x0;var _0x5bf238=_0x057d[_0x2b57fc];return _0x5bf238;};'use strict';var emlformat=require(_0xd057('0x0'));var rimraf=require(_0xd057('0x1'));var zipdir=require(_0xd057('0x2'));var jsonpatch=require(_0xd057('0x3'));var rp=require(_0xd057('0x4'));var moment=require(_0xd057('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd057('0x6'));var util=require(_0xd057('0x7'));var path=require(_0xd057('0x8'));var sox=require(_0xd057('0x9'));var csv=require('to-csv');var ejs=require(_0xd057('0xa'));var fs=require('fs');var fs_extra=require(_0xd057('0xb'));var _=require(_0xd057('0xc'));var squel=require(_0xd057('0xd'));var crypto=require(_0xd057('0xe'));var jsforce=require(_0xd057('0xf'));var deskjs=require(_0xd057('0x10'));var toCsv=require(_0xd057('0x11'));var querystring=require(_0xd057('0x12'));var Papa=require(_0xd057('0x13'));var Redis=require(_0xd057('0x14'));var authService=require(_0xd057('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xd057('0x16'));var hardwareService=require(_0xd057('0x17'));var logger=require(_0xd057('0x18'))(_0xd057('0x19'));var utils=require(_0xd057('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xd057('0x1b'));var db=require(_0xd057('0x1c'))['db'];var integrations=require(_0xd057('0x1d'));function respondWithStatusCode(_0x3a6e39,_0x314f44){_0x314f44=_0x314f44||0xcc;return function(_0x2ba4eb){if(_0x2ba4eb){return _0x3a6e39[_0xd057('0x1e')](_0x314f44);}return _0x3a6e39[_0xd057('0x1f')](_0x314f44)['end']();};}function respondWithResult(_0x376412,_0x1ba268){_0x1ba268=_0x1ba268||0xc8;return function(_0x58c7b7){if(_0x58c7b7){return _0x376412['status'](_0x1ba268)[_0xd057('0x20')](_0x58c7b7);}};}function respondWithFilteredResult(_0x1900f7,_0x2ac7ff){return function(_0x1b382c){if(_0x1b382c){var _0x55cc51=typeof _0x2ac7ff['offset']===_0xd057('0x21')&&typeof _0x2ac7ff[_0xd057('0x22')]===_0xd057('0x21');var _0x5e756f=_0x1b382c[_0xd057('0x23')];var _0x54db3b=_0x55cc51?0x0:_0x2ac7ff[_0xd057('0x24')];var _0x9dc714=_0x55cc51?_0x1b382c[_0xd057('0x23')]:_0x2ac7ff['offset']+_0x2ac7ff[_0xd057('0x22')];var _0x22cbe9;if(_0x9dc714>=_0x5e756f){_0x9dc714=_0x5e756f;_0x22cbe9=0xc8;}else{_0x22cbe9=0xce;}_0x1900f7[_0xd057('0x1f')](_0x22cbe9);return _0x1900f7[_0xd057('0x25')](_0xd057('0x26'),_0x54db3b+'-'+_0x9dc714+'/'+_0x5e756f)[_0xd057('0x20')](_0x1b382c);}return null;};}function patchUpdates(_0x2b7edf){return function(_0x292ba1){try{jsonpatch[_0xd057('0x27')](_0x292ba1,_0x2b7edf,!![]);}catch(_0x2d9ebc){return BPromise[_0xd057('0x28')](_0x2d9ebc);}return _0x292ba1['save']();};}function saveUpdates(_0xf88c0b,_0x50841f){return function(_0x3ac051){if(_0x3ac051){return _0x3ac051[_0xd057('0x29')](_0xf88c0b)[_0xd057('0x2a')](function(_0xac40cb){return _0xac40cb;});}return null;};}function removeEntity(_0x29bc29,_0x352ce9){return function(_0x4970b6){if(_0x4970b6){return _0x4970b6['destroy']()[_0xd057('0x2a')](function(){_0x29bc29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4fdd,_0x1c92ac){return function(_0x462f2d){if(!_0x462f2d){_0x1a4fdd[_0xd057('0x1e')](0x194);}return _0x462f2d;};}function handleError(_0xd3ea58,_0x2272bf){_0x2272bf=_0x2272bf||0x1f4;return function(_0x56a8f1){logger[_0xd057('0x2b')](_0x56a8f1[_0xd057('0x2c')]);if(_0x56a8f1['name']){delete _0x56a8f1[_0xd057('0x2d')];}_0xd3ea58['status'](_0x2272bf)[_0xd057('0x2e')](_0x56a8f1);};}exports[_0xd057('0x2f')]=function(_0x11607f,_0x4a7e40){var _0x4fa4f1={},_0x350609={},_0x49d2a2={'count':0x0,'rows':[]};var _0xcf6db7=_[_0xd057('0x30')](db['ZohoAccount'][_0xd057('0x31')],function(_0x3040ac){return{'name':_0x3040ac[_0xd057('0x32')],'type':_0x3040ac['type'][_0xd057('0x33')]};});_0x350609[_0xd057('0x34')]=_[_0xd057('0x30')](_0xcf6db7,_0xd057('0x2d'));_0x350609[_0xd057('0x35')]=_['keys'](_0x11607f[_0xd057('0x35')]);_0x350609[_0xd057('0x36')]=_['intersection'](_0x350609[_0xd057('0x34')],_0x350609[_0xd057('0x35')]);_0x4fa4f1['attributes']=_[_0xd057('0x37')](_0x350609['model'],qs[_0xd057('0x38')](_0x11607f[_0xd057('0x35')][_0xd057('0x38')]));_0x4fa4f1[_0xd057('0x39')]=_0x4fa4f1['attributes'][_0xd057('0x3a')]?_0x4fa4f1[_0xd057('0x39')]:_0x350609['model'];if(!_0x11607f[_0xd057('0x35')][_0xd057('0x3b')](_0xd057('0x3c'))){_0x4fa4f1[_0xd057('0x22')]=qs[_0xd057('0x22')](_0x11607f['query'][_0xd057('0x22')]);_0x4fa4f1[_0xd057('0x24')]=qs['offset'](_0x11607f[_0xd057('0x35')][_0xd057('0x24')]);}_0x4fa4f1[_0xd057('0x3d')]=qs['sort'](_0x11607f['query'][_0xd057('0x3e')]);_0x4fa4f1[_0xd057('0x3f')]=qs[_0xd057('0x36')](_[_0xd057('0x40')](_0x11607f['query'],_0x350609[_0xd057('0x36')]),_0xcf6db7);if(_0x11607f[_0xd057('0x35')][_0xd057('0x41')]){_0x4fa4f1[_0xd057('0x3f')]=_[_0xd057('0x42')](_0x4fa4f1[_0xd057('0x3f')],{'$or':_[_0xd057('0x30')](_0xcf6db7,function(_0x25a8d7){if(_0x25a8d7[_0xd057('0x43')]!==_0xd057('0x44')){var _0x174003={};_0x174003[_0x25a8d7[_0xd057('0x2d')]]={'$like':'%'+_0x11607f[_0xd057('0x35')][_0xd057('0x41')]+'%'};return _0x174003;}})});}_0x4fa4f1=_[_0xd057('0x42')]({},_0x4fa4f1,_0x11607f[_0xd057('0x45')]);var _0x35e6ac={'where':_0x4fa4f1[_0xd057('0x3f')]};return db[_0xd057('0x46')][_0xd057('0x23')](_0x35e6ac)[_0xd057('0x2a')](function(_0x41b873){_0x49d2a2[_0xd057('0x23')]=_0x41b873;if(_0x11607f[_0xd057('0x35')][_0xd057('0x47')]){_0x4fa4f1[_0xd057('0x48')]=[{'all':!![]}];}return db[_0xd057('0x46')][_0xd057('0x49')](_0x4fa4f1);})[_0xd057('0x2a')](function(_0x5805ef){_0x49d2a2[_0xd057('0x4a')]=_0x5805ef;return _0x49d2a2;})[_0xd057('0x2a')](respondWithFilteredResult(_0x4a7e40,_0x4fa4f1))[_0xd057('0x4b')](handleError(_0x4a7e40,null));};exports[_0xd057('0x4c')]=function(_0x40955c,_0x15d927){var _0x834131={'raw':![],'where':{'id':_0x40955c[_0xd057('0x4d')]['id']}},_0x43c742={};_0x43c742[_0xd057('0x34')]=_['keys'](db['ZohoAccount'][_0xd057('0x31')]);_0x43c742[_0xd057('0x35')]=_['keys'](_0x40955c['query']);_0x43c742['filters']=_[_0xd057('0x37')](_0x43c742['model'],_0x43c742[_0xd057('0x35')]);_0x834131['attributes']=_['intersection'](_0x43c742['model'],qs[_0xd057('0x38')](_0x40955c[_0xd057('0x35')][_0xd057('0x38')]));_0x834131['attributes']=_0x834131['attributes'][_0xd057('0x3a')]?_0x834131[_0xd057('0x39')]:_0x43c742[_0xd057('0x34')];if(_0x40955c[_0xd057('0x35')]['includeAll']){_0x834131[_0xd057('0x48')]=[{'all':!![]}];}_0x834131=_[_0xd057('0x42')]({},_0x834131,_0x40955c[_0xd057('0x45')]);return db[_0xd057('0x46')][_0xd057('0x4e')](_0x834131)[_0xd057('0x2a')](handleEntityNotFound(_0x15d927,null))['then'](respondWithResult(_0x15d927,null))[_0xd057('0x4b')](handleError(_0x15d927,null));};exports[_0xd057('0x4f')]=function(_0x22d54d,_0x24c475){return db['ZohoAccount'][_0xd057('0x4f')](_0x22d54d[_0xd057('0x50')],{})[_0xd057('0x2a')](respondWithResult(_0x24c475,0xc9))[_0xd057('0x4b')](handleError(_0x24c475,null));};exports[_0xd057('0x29')]=function(_0x10cca0,_0x5166a8){if(_0x10cca0[_0xd057('0x50')]['id']){delete _0x10cca0[_0xd057('0x50')]['id'];}return db['ZohoAccount'][_0xd057('0x4e')]({'where':{'id':_0x10cca0[_0xd057('0x4d')]['id']}})[_0xd057('0x2a')](handleEntityNotFound(_0x5166a8,null))['then'](saveUpdates(_0x10cca0['body'],null))[_0xd057('0x2a')](respondWithResult(_0x5166a8,null))['catch'](handleError(_0x5166a8,null));};exports['destroy']=function(_0x24954d,_0x2ecffc){return db['ZohoAccount'][_0xd057('0x4e')]({'where':{'id':_0x24954d['params']['id']}})['then'](handleEntityNotFound(_0x2ecffc,null))[_0xd057('0x2a')](removeEntity(_0x2ecffc,null))['catch'](handleError(_0x2ecffc,null));};exports['getConfigurations']=function(_0x56d18b,_0x3635e1,_0x39099a){var _0xa6c8e4={};var _0xf470b0={};var _0xce9f29;var _0x2d68b4;return db[_0xd057('0x46')][_0xd057('0x51')]({'where':{'id':_0x56d18b[_0xd057('0x4d')]['id']}})[_0xd057('0x2a')](handleEntityNotFound(_0x3635e1,null))[_0xd057('0x2a')](function(_0x4760a0){if(_0x4760a0){_0xce9f29=_0x4760a0;_0xf470b0[_0xd057('0x34')]=_[_0xd057('0x52')](db[_0xd057('0x53')][_0xd057('0x31')]);_0xf470b0[_0xd057('0x35')]=_[_0xd057('0x52')](_0x56d18b[_0xd057('0x35')]);_0xf470b0[_0xd057('0x36')]=_[_0xd057('0x37')](_0xf470b0[_0xd057('0x34')],_0xf470b0[_0xd057('0x35')]);_0xa6c8e4['attributes']=_[_0xd057('0x37')](_0xf470b0['model'],qs[_0xd057('0x38')](_0x56d18b[_0xd057('0x35')][_0xd057('0x38')]));_0xa6c8e4[_0xd057('0x39')]=_0xa6c8e4[_0xd057('0x39')]['length']?_0xa6c8e4['attributes']:_0xf470b0[_0xd057('0x34')];_0xa6c8e4[_0xd057('0x3d')]=qs[_0xd057('0x3e')](_0x56d18b[_0xd057('0x35')][_0xd057('0x3e')]);_0xa6c8e4[_0xd057('0x3f')]=qs[_0xd057('0x36')](_[_0xd057('0x40')](_0x56d18b[_0xd057('0x35')],_0xf470b0[_0xd057('0x36')]));if(_0x56d18b['query'][_0xd057('0x41')]){_0xa6c8e4[_0xd057('0x3f')]=_[_0xd057('0x42')](_0xa6c8e4[_0xd057('0x3f')],{'$or':_[_0xd057('0x30')](_0xa6c8e4['attributes'],function(_0x55f796){var _0x1f6df8={};_0x1f6df8[_0x55f796]={'$like':'%'+_0x56d18b['query']['filter']+'%'};return _0x1f6df8;})});}_0xa6c8e4=_[_0xd057('0x42')]({},_0xa6c8e4,_0x56d18b[_0xd057('0x45')]);return _0xce9f29[_0xd057('0x54')](_0xa6c8e4);}})[_0xd057('0x2a')](function(_0x87a1d8){if(_0x87a1d8){_0x2d68b4=_0x87a1d8[_0xd057('0x3a')];if(!_0x56d18b[_0xd057('0x35')][_0xd057('0x3b')](_0xd057('0x3c'))){_0xa6c8e4[_0xd057('0x22')]=qs[_0xd057('0x22')](_0x56d18b[_0xd057('0x35')][_0xd057('0x22')]);_0xa6c8e4[_0xd057('0x24')]=qs['offset'](_0x56d18b[_0xd057('0x35')][_0xd057('0x24')]);}return _0xce9f29[_0xd057('0x54')](_0xa6c8e4);}})[_0xd057('0x2a')](function(_0x1125f1){if(_0x1125f1){return _0x1125f1?{'count':_0x2d68b4,'rows':_0x1125f1}:null;}})[_0xd057('0x2a')](respondWithResult(_0x3635e1,null))['catch'](handleError(_0x3635e1,null));};exports[_0xd057('0x55')]=function(_0x4eb4e0,_0x35b1a0,_0x5f3df3){if(_0x4eb4e0[_0xd057('0x50')]['id']){delete _0x4eb4e0['body']['id'];}return db[_0xd057('0x46')][_0xd057('0x51')]({'where':{'id':_0x4eb4e0[_0xd057('0x4d')]['id']}})[_0xd057('0x2a')](handleEntityNotFound(_0x35b1a0,null))[_0xd057('0x2a')](function(_0x2696bb){if(_0x2696bb){_0x4eb4e0[_0xd057('0x50')][_0xd057('0x56')]=_0x2696bb['id'];_0x4eb4e0['body'][_0xd057('0x57')]=integrations[_0xd057('0x58')](_0x4eb4e0[_0xd057('0x50')]['channel'],_0x4eb4e0['body'][_0xd057('0x43')]);_0x4eb4e0['body'][_0xd057('0x59')]=integrations[_0xd057('0x5a')](_0x4eb4e0[_0xd057('0x50')][_0xd057('0x5b')],_0x4eb4e0[_0xd057('0x50')]['type']);return db[_0xd057('0x53')]['create'](_0x4eb4e0[_0xd057('0x50')],{'include':[{'model':db['ZohoField'],'as':_0xd057('0x57')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xd057('0x2a')](respondWithResult(_0x35b1a0,null))['catch'](handleError(_0x35b1a0,null));};function getAccessToken(_0x41f5d1){return new Promise(function(_0x313e6e,_0x72af6b){var _0x2a71a8;switch(_0x41f5d1[_0xd057('0x5c')]){case'US':_0x2a71a8=_0xd057('0x5d');break;case'AU':_0x2a71a8=_0xd057('0x5e');break;case'EU':_0x2a71a8=_0xd057('0x5f');break;case'IN':_0x2a71a8=_0xd057('0x60');break;case'CN':_0x2a71a8=_0xd057('0x61');break;default:_0x2a71a8=_0xd057('0x5f');break;}var _0x5aacd2={'method':_0xd057('0x62'),'uri':_0x2a71a8+_0xd057('0x63'),'qs':{'refresh_token':_0x41f5d1[_0xd057('0x64')],'client_id':_0x41f5d1[_0xd057('0x65')],'client_secret':_0x41f5d1[_0xd057('0x66')],'grant_type':_0xd057('0x67')},'json':!![]};return rp(_0x5aacd2)[_0xd057('0x2a')](function(_0x348132){if(_0x348132[_0xd057('0x68')]){_0x313e6e(_0x348132[_0xd057('0x68')]);}else{_0x72af6b(_0xd057('0x69'));}})[_0xd057('0x4b')](function(_0x235530){_0x72af6b(_0x235530);});});}exports[_0xd057('0x6a')]=function(_0x2fa650,_0x38cf1d,_0x171db5){var _0x4d3c48,_0x187398,_0x4fb520,_0x47c0fb,_0x52d81e;return db[_0xd057('0x46')]['findOne']({'where':{'id':_0x2fa650[_0xd057('0x4d')]['id']},'attributes':['id',_0xd057('0x6b'),_0xd057('0x5c'),_0xd057('0x65'),_0xd057('0x66'),_0xd057('0x6c'),_0xd057('0x6d'),_0xd057('0x64')]})['then'](handleEntityNotFound(_0x38cf1d,null))[_0xd057('0x2a')](function(_0x5f2520){_0x52d81e=_0x5f2520;_0x4d3c48=_0x52d81e['host'];_0x187398=_0x4d3c48==='zoho.eu'?'eu':_0xd057('0x6e');_0x4fb520=_0x52d81e['serverUrl'];var _0x3a5661=_0x4fb520[_0xd057('0x6f')](-0x1);if(_0x3a5661==='/'||_0x3a5661==='\x5c'||_0x3a5661===':'){_0x4fb520=_0x4fb520[_0xd057('0x70')](0x0,_0x4fb520[_0xd057('0x71')](_0x3a5661));}if(!_0x52d81e['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x52d81e);})['then'](function(_0x25efab){if(_0x25efab){return rp({'method':_0xd057('0x72'),'uri':util[_0xd057('0x73')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x187398),'qs':{'module':_0xd057('0x74')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x25efab},'json':!![]});}})[_0xd057('0x2a')](function(_0x244fb5){if(_0x244fb5){if(_0x244fb5['response']&&_0x244fb5[_0xd057('0x75')]['error']){throw new Error(_0x244fb5[_0xd057('0x75')][_0xd057('0x2b')][_0xd057('0x76')]);}var _0x1bff0c=[];var _0x42b30d=[];var _0x41b149=[_0xd057('0x77'),_0xd057('0x78'),_0xd057('0x79'),_0xd057('0x7a'),'Call_Duration',_0xd057('0x7b'),'Call_Start_Time',_0xd057('0x7c')];_0x42b30d=_[_0xd057('0x7d')](_0x244fb5['fields'],function(_0x370e99){return _0x41b149['includes'](_0x370e99['api_name']);});for(var _0x5352c2=0x0;_0x5352c2<_0x42b30d[_0xd057('0x3a')];_0x5352c2++){if(_0x42b30d[_0x5352c2][_0xd057('0x7e')]===![]){_0x1bff0c['push']({'id':_0x42b30d[_0x5352c2]['id'],'name':_0x42b30d[_0x5352c2][_0xd057('0x7f')],'custom':_0x42b30d[_0x5352c2]['custom_field'],'options':_0x42b30d[_0x5352c2][_0xd057('0x80')]===_0xd057('0x81')&&_0x42b30d[_0x5352c2][_0xd057('0x82')][_0xd057('0x3a')]>-0x1?_['map'](_0x42b30d[_0x5352c2][_0xd057('0x82')],function(_0x638963){return{'name':_0x638963,'value':_0x638963};}):[]});}}return{'count':_0x1bff0c['length'],'rows':_0x1bff0c};}else{return{'count':0x0,'rows':[]};}})[_0xd057('0x2a')](respondWithResult(_0x38cf1d,null))['catch'](function(_0x4f1dc4){var _0x3e0ec9=_0x2fa650[_0xd057('0x35')]['test']?0x1f4:_0x4f1dc4[_0xd057('0x83')]||0x1f4;logger[_0xd057('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0xd057('0x6a'),_0x3e0ec9,JSON['stringify'](_0x4f1dc4));delete _0x4f1dc4[_0xd057('0x2d')];if(_0x3e0ec9===0x191){_0x3e0ec9=0x190;}_0x38cf1d[_0xd057('0x1f')](_0x3e0ec9)[_0xd057('0x2e')](_0x2fa650[_0xd057('0x35')][_0xd057('0x84')]?{'message':_0xd057('0x85'),'statusCode':_0x4f1dc4[_0xd057('0x83')]}:_0x4f1dc4);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 3b8a565..66d3e87 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 _0x1c7e=['POST','authorization_code','application/x-www-form-urlencoded','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','changed','zone','serverUrl','clientId','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientSecret','code','then','parse','refreshToken','refresh_token','info','name','format','inspect','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice'];(function(_0x196655,_0x3664e2){var _0x51e53f=function(_0x2514fe){while(--_0x2514fe){_0x196655['push'](_0x196655['shift']());}};_0x51e53f(++_0x3664e2);}(_0x1c7e,0x1a8));var _0xe1c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1c7e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe1c7('0x0'));var util=require(_0xe1c7('0x1'));var logger=require(_0xe1c7('0x2'))(_0xe1c7('0x3'));var moment=require(_0xe1c7('0x4'));var BPromise=require(_0xe1c7('0x5'));var rp=require(_0xe1c7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1c7('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1c7('0x8'));var integrations=require(_0xe1c7('0x9'));module[_0xe1c7('0xa')]=function(_0x54e663,_0x24e06e){return _0x54e663['define']('ZohoAccount',attributes,{'tableName':_0xe1c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36808f,_0x2bc04d,_0x330144){if(_0x36808f[_0xe1c7('0xc')](_0xe1c7('0xd'))||_0x36808f[_0xe1c7('0xc')](_0xe1c7('0xe'))||_0x36808f[_0xe1c7('0xc')](_0xe1c7('0xf'))||_0x36808f[_0xe1c7('0xc')]('clientSecret')||_0x36808f[_0xe1c7('0xc')]('code')||_0x36808f[_0xe1c7('0xc')](_0xe1c7('0x10'))){var _0x558217,_0x1e37d9;_0x558217=_0x36808f[_0xe1c7('0xe')];var _0x47627d=_0x558217['slice'](-0x1);if(_0x47627d==='/'||_0x47627d==='\x5c'||_0x47627d===':'){_0x558217=_0x558217[_0xe1c7('0x11')](0x0,_0x558217[_0xe1c7('0x12')](_0x47627d));}switch(_0x36808f[_0xe1c7('0xd')]){case'US':_0x1e37d9=_0xe1c7('0x13');break;case'AU':_0x1e37d9=_0xe1c7('0x14');break;case'IN':_0x1e37d9=_0xe1c7('0x15');break;case'CN':_0x1e37d9=_0xe1c7('0x16');break;default:_0x1e37d9='https://accounts.zoho.eu';break;}var _0x5f0534={'method':'POST','uri':_0x1e37d9+_0xe1c7('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x36808f[_0xe1c7('0xf')],'client_secret':_0x36808f[_0xe1c7('0x18')],'redirect_uri':_0x36808f[_0xe1c7('0xe')],'code':_0x36808f[_0xe1c7('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5f0534)[_0xe1c7('0x1a')](function(_0x4187b5){var _0x261cbe=JSON[_0xe1c7('0x1b')](_0x4187b5);if(_0x261cbe['refresh_token']){_0x36808f[_0xe1c7('0x1c')]=_0x261cbe[_0xe1c7('0x1d')];logger[_0xe1c7('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x36808f[_0xe1c7('0x1f')],_0x36808f['id']));}else{logger['error'](util[_0xe1c7('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x36808f['name'],_0x36808f['id']),util[_0xe1c7('0x21')](_0x261cbe,{'showHidden':![],'depth':null}));}return _0x330144(null,_0x2bc04d);})[_0xe1c7('0x22')](function(_0x5e2752){logger[_0xe1c7('0x23')](util[_0xe1c7('0x20')](_0xe1c7('0x24'),_0x36808f[_0xe1c7('0x1f')],_0x36808f['id']),util[_0xe1c7('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x330144(_0x5e2752);});}else{return _0x330144(null,_0x2bc04d);}},'beforeUpdate':function(_0x16aabf,_0x30fce4,_0x47bfba){if(_0x16aabf[_0xe1c7('0xc')](_0xe1c7('0xd'))||_0x16aabf[_0xe1c7('0xc')](_0xe1c7('0xe'))||_0x16aabf[_0xe1c7('0xc')]('clientId')||_0x16aabf[_0xe1c7('0xc')](_0xe1c7('0x18'))||_0x16aabf[_0xe1c7('0xc')](_0xe1c7('0x19'))||_0x16aabf[_0xe1c7('0xc')](_0xe1c7('0x10'))){var _0x2aadff,_0x4f04de;_0x2aadff=_0x16aabf[_0xe1c7('0xe')];var _0x2d047b=_0x2aadff[_0xe1c7('0x25')](-0x1);if(_0x2d047b==='/'||_0x2d047b==='\x5c'||_0x2d047b===':'){_0x2aadff=_0x2aadff['substring'](0x0,_0x2aadff[_0xe1c7('0x12')](_0x2d047b));}switch(_0x16aabf[_0xe1c7('0xd')]){case'US':_0x4f04de='https://accounts.zoho.com';break;case'AU':_0x4f04de=_0xe1c7('0x14');break;case'IN':_0x4f04de=_0xe1c7('0x15');break;case'CN':_0x4f04de=_0xe1c7('0x16');break;default:_0x4f04de='https://accounts.zoho.eu';break;}var _0x4a8af9={'method':_0xe1c7('0x26'),'uri':_0x4f04de+'/oauth/v2/token','form':{'grant_type':_0xe1c7('0x27'),'client_id':_0x16aabf[_0xe1c7('0xf')],'client_secret':_0x16aabf[_0xe1c7('0x18')],'redirect_uri':_0x16aabf[_0xe1c7('0xe')],'code':_0x16aabf[_0xe1c7('0x19')]},'headers':{'Content-Type':_0xe1c7('0x28')}};return rp(_0x4a8af9)[_0xe1c7('0x1a')](function(_0x37d13e){var _0x256d99=JSON['parse'](_0x37d13e);if(_0x256d99[_0xe1c7('0x1d')]){_0x16aabf['refreshToken']=_0x256d99[_0xe1c7('0x1d')];logger[_0xe1c7('0x1e')](util['format'](_0xe1c7('0x29'),_0x16aabf[_0xe1c7('0x1f')],_0x16aabf['id']));}else{logger[_0xe1c7('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x16aabf[_0xe1c7('0x1f')],_0x16aabf['id']),util['inspect'](_0x256d99,{'showHidden':![],'depth':null}));}return _0x47bfba(null,_0x30fce4);})['catch'](function(_0xdb2e23){logger[_0xe1c7('0x23')](util[_0xe1c7('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x16aabf[_0xe1c7('0x1f')],_0x16aabf['id']),util[_0xe1c7('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x47bfba(_0xdb2e23);});}else{return _0x47bfba(null,_0x30fce4);}}}});}; \ No newline at end of file +var _0xa46f=['host','slice','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.in','code','then','parse','error','catch','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','serverUrl','clientId'];(function(_0x3fb5f9,_0xa4c2d9){var _0x541745=function(_0x4faa48){while(--_0x4faa48){_0x3fb5f9['push'](_0x3fb5f9['shift']());}};_0x541745(++_0xa4c2d9);}(_0xa46f,0x140));var _0xfa46=function(_0x5c883f,_0x38f092){_0x5c883f=_0x5c883f-0x0;var _0x4210cc=_0xa46f[_0x5c883f];return _0x4210cc;};'use strict';var _=require(_0xfa46('0x0'));var util=require(_0xfa46('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfa46('0x2'));var BPromise=require(_0xfa46('0x3'));var rp=require(_0xfa46('0x4'));var fs=require('fs');var path=require(_0xfa46('0x5'));var rimraf=require(_0xfa46('0x6'));var config=require(_0xfa46('0x7'));var attributes=require(_0xfa46('0x8'));var integrations=require(_0xfa46('0x9'));module[_0xfa46('0xa')]=function(_0x32987e,_0x39745a){return _0x32987e[_0xfa46('0xb')]('ZohoAccount',attributes,{'tableName':_0xfa46('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x717a04,_0x4d68ff,_0x1e1c0b){if(_0x717a04[_0xfa46('0xd')]('zone')||_0x717a04[_0xfa46('0xd')](_0xfa46('0xe'))||_0x717a04[_0xfa46('0xd')](_0xfa46('0xf'))||_0x717a04['changed']('clientSecret')||_0x717a04[_0xfa46('0xd')]('code')||_0x717a04[_0xfa46('0xd')](_0xfa46('0x10'))){var _0x271d9a,_0x2a09a8;_0x271d9a=_0x717a04[_0xfa46('0xe')];var _0x364a56=_0x271d9a[_0xfa46('0x11')](-0x1);if(_0x364a56==='/'||_0x364a56==='\x5c'||_0x364a56===':'){_0x271d9a=_0x271d9a['substring'](0x0,_0x271d9a[_0xfa46('0x12')](_0x364a56));}switch(_0x717a04[_0xfa46('0x13')]){case'US':_0x2a09a8=_0xfa46('0x14');break;case'AU':_0x2a09a8=_0xfa46('0x15');break;case'IN':_0x2a09a8='https://accounts.zoho.in';break;case'CN':_0x2a09a8=_0xfa46('0x16');break;default:_0x2a09a8=_0xfa46('0x17');break;}var _0x43e638={'method':_0xfa46('0x18'),'uri':_0x2a09a8+_0xfa46('0x19'),'form':{'grant_type':_0xfa46('0x1a'),'client_id':_0x717a04[_0xfa46('0xf')],'client_secret':_0x717a04[_0xfa46('0x1b')],'redirect_uri':_0x717a04[_0xfa46('0xe')],'code':_0x717a04['code']},'headers':{'Content-Type':_0xfa46('0x1c')}};return rp(_0x43e638)['then'](function(_0x553ab1){var _0x25af89=JSON['parse'](_0x553ab1);if(_0x25af89[_0xfa46('0x1d')]){_0x717a04['refreshToken']=_0x25af89['refresh_token'];logger[_0xfa46('0x1e')](util[_0xfa46('0x1f')](_0xfa46('0x20'),_0x717a04[_0xfa46('0x21')],_0x717a04['id']));}else{logger['error'](util[_0xfa46('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x717a04[_0xfa46('0x21')],_0x717a04['id']),util[_0xfa46('0x22')](_0x25af89,{'showHidden':![],'depth':null}));}return _0x1e1c0b(null,_0x4d68ff);})['catch'](function(_0x58c784){logger['error'](util[_0xfa46('0x1f')](_0xfa46('0x23'),_0x717a04[_0xfa46('0x21')],_0x717a04['id']),util[_0xfa46('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x1e1c0b(_0x58c784);});}else{return _0x1e1c0b(null,_0x4d68ff);}},'beforeUpdate':function(_0x2c3bee,_0x26a46c,_0x461900){if(_0x2c3bee[_0xfa46('0xd')](_0xfa46('0x13'))||_0x2c3bee[_0xfa46('0xd')]('serverUrl')||_0x2c3bee[_0xfa46('0xd')](_0xfa46('0xf'))||_0x2c3bee['changed'](_0xfa46('0x1b'))||_0x2c3bee[_0xfa46('0xd')]('code')||_0x2c3bee[_0xfa46('0xd')]('host')){var _0x87c359,_0xf4dfd1;_0x87c359=_0x2c3bee[_0xfa46('0xe')];var _0x410818=_0x87c359[_0xfa46('0x11')](-0x1);if(_0x410818==='/'||_0x410818==='\x5c'||_0x410818===':'){_0x87c359=_0x87c359['substring'](0x0,_0x87c359[_0xfa46('0x12')](_0x410818));}switch(_0x2c3bee[_0xfa46('0x13')]){case'US':_0xf4dfd1='https://accounts.zoho.com';break;case'AU':_0xf4dfd1=_0xfa46('0x15');break;case'IN':_0xf4dfd1=_0xfa46('0x24');break;case'CN':_0xf4dfd1=_0xfa46('0x16');break;default:_0xf4dfd1=_0xfa46('0x17');break;}var _0x57e39c={'method':_0xfa46('0x18'),'uri':_0xf4dfd1+'/oauth/v2/token','form':{'grant_type':_0xfa46('0x1a'),'client_id':_0x2c3bee[_0xfa46('0xf')],'client_secret':_0x2c3bee['clientSecret'],'redirect_uri':_0x2c3bee['serverUrl'],'code':_0x2c3bee[_0xfa46('0x25')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x57e39c)[_0xfa46('0x26')](function(_0x4448ef){var _0x10bc76=JSON[_0xfa46('0x27')](_0x4448ef);if(_0x10bc76[_0xfa46('0x1d')]){_0x2c3bee['refreshToken']=_0x10bc76[_0xfa46('0x1d')];logger[_0xfa46('0x1e')](util[_0xfa46('0x1f')](_0xfa46('0x20'),_0x2c3bee['name'],_0x2c3bee['id']));}else{logger[_0xfa46('0x28')](util[_0xfa46('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c3bee[_0xfa46('0x21')],_0x2c3bee['id']),util[_0xfa46('0x22')](_0x10bc76,{'showHidden':![],'depth':null}));}return _0x461900(null,_0x26a46c);})[_0xfa46('0x29')](function(_0x40d820){logger[_0xfa46('0x28')](util[_0xfa46('0x1f')](_0xfa46('0x23'),_0x2c3bee[_0xfa46('0x21')],_0x2c3bee['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x461900(_0x40d820);});}else{return _0x461900(null,_0x26a46c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 0e14ea2..6e9992e 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 _0xf8f2=['client','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZohoAccount','findAll','options','raw','where','attributes','include','map','model','ZohoAccount','find','ShowZohoAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x3b7ea0,_0x260ce6){_0x3b7ea0=_0x3b7ea0-0x0;var _0x34b347=_0xf8f2[_0x3b7ea0];return _0x34b347;};'use strict';var _=require(_0x2f8f('0x0'));var util=require(_0x2f8f('0x1'));var moment=require(_0x2f8f('0x2'));var BPromise=require(_0x2f8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f8f('0x4'));var db=require(_0x2f8f('0x5'))['db'];var utils=require(_0x2f8f('0x6'));var logger=require(_0x2f8f('0x7'))(_0x2f8f('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f8f('0x9'));var client=jayson[_0x2f8f('0xa')][_0x2f8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x107748,_0x590ff4,_0xb4473){return new BPromise(function(_0x10d128,_0x1237d5){return client['request'](_0x107748,_0xb4473)[_0x2f8f('0xc')](function(_0x1ce821){logger[_0x2f8f('0xd')](_0x2f8f('0xe'),_0x590ff4,'request\x20sent');logger[_0x2f8f('0xf')](_0x2f8f('0x10'),_0x590ff4,'request\x20sent',JSON[_0x2f8f('0x11')](_0x1ce821));if(_0x1ce821[_0x2f8f('0x12')]){if(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x13')]===0x1f4){logger['error'](_0x2f8f('0xe'),_0x590ff4,_0x1ce821[_0x2f8f('0x12')]['message']);return _0x1237d5(_0x1ce821['error'][_0x2f8f('0x14')]);}logger[_0x2f8f('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x590ff4,_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);return _0x10d128(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);}else{logger[_0x2f8f('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x590ff4,'request\x20sent');_0x10d128(_0x1ce821['result']['message']);}})[_0x2f8f('0x15')](function(_0xee85bb){logger[_0x2f8f('0x12')](_0x2f8f('0xe'),_0x590ff4,_0xee85bb);_0x1237d5(_0xee85bb);});});}exports[_0x2f8f('0x16')]=function(_0x54a5d2){var _0x581d39=this;return new Promise(function(_0x8329c4,_0x584925){return db['ZohoAccount'][_0x2f8f('0x17')]({'raw':_0x54a5d2[_0x2f8f('0x18')]?_0x54a5d2[_0x2f8f('0x18')][_0x2f8f('0x19')]===undefined?!![]:![]:!![],'where':_0x54a5d2[_0x2f8f('0x18')]?_0x54a5d2[_0x2f8f('0x18')][_0x2f8f('0x1a')]||null:null,'attributes':_0x54a5d2[_0x2f8f('0x18')]?_0x54a5d2['options'][_0x2f8f('0x1b')]||null:null,'limit':_0x54a5d2[_0x2f8f('0x18')]?_0x54a5d2['options']['limit']||null:null,'include':_0x54a5d2[_0x2f8f('0x18')]?_0x54a5d2[_0x2f8f('0x18')][_0x2f8f('0x1c')]?_[_0x2f8f('0x1d')](_0x54a5d2[_0x2f8f('0x18')][_0x2f8f('0x1c')],function(_0x35d7ca){return{'model':db[_0x35d7ca[_0x2f8f('0x1e')]],'as':_0x35d7ca['as'],'attributes':_0x35d7ca[_0x2f8f('0x1b')],'include':_0x35d7ca[_0x2f8f('0x1c')]?_[_0x2f8f('0x1d')](_0x35d7ca[_0x2f8f('0x1c')],function(_0x1bef3c){return{'model':db[_0x1bef3c['model']],'as':_0x1bef3c['as'],'attributes':_0x1bef3c[_0x2f8f('0x1b')],'include':_0x1bef3c[_0x2f8f('0x1c')]?_[_0x2f8f('0x1d')](_0x1bef3c[_0x2f8f('0x1c')],function(_0x286fb2){return{'model':db[_0x286fb2['model']],'as':_0x286fb2['as'],'attributes':_0x286fb2[_0x2f8f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2f8f('0xc')](function(_0x4e65d2){logger['info']('GetZohoAccount',_0x54a5d2);logger[_0x2f8f('0xf')]('GetZohoAccount',_0x54a5d2,JSON[_0x2f8f('0x11')](_0x4e65d2));_0x8329c4(_0x4e65d2);})[_0x2f8f('0x15')](function(_0x125ed5){logger[_0x2f8f('0x12')](_0x2f8f('0x16'),_0x125ed5[_0x2f8f('0x14')],_0x54a5d2);_0x584925(_0x581d39[_0x2f8f('0x12')](0x1f4,_0x125ed5[_0x2f8f('0x14')]));});});};exports['ShowZohoAccount']=function(_0x151613){var _0x1b992f=this;return new Promise(function(_0x46cce2,_0xb0800a){return db[_0x2f8f('0x1f')][_0x2f8f('0x20')]({'raw':_0x151613[_0x2f8f('0x18')]?_0x151613[_0x2f8f('0x18')][_0x2f8f('0x19')]===undefined?!![]:![]:!![],'where':_0x151613['options']?_0x151613[_0x2f8f('0x18')][_0x2f8f('0x1a')]||null:null,'attributes':_0x151613[_0x2f8f('0x18')]?_0x151613[_0x2f8f('0x18')]['attributes']||null:null,'include':_0x151613[_0x2f8f('0x18')]?_0x151613[_0x2f8f('0x18')][_0x2f8f('0x1c')]?_[_0x2f8f('0x1d')](_0x151613[_0x2f8f('0x18')][_0x2f8f('0x1c')],function(_0x5833bc){return{'model':db[_0x5833bc[_0x2f8f('0x1e')]],'as':_0x5833bc['as'],'attributes':_0x5833bc[_0x2f8f('0x1b')],'include':_0x5833bc[_0x2f8f('0x1c')]?_[_0x2f8f('0x1d')](_0x5833bc[_0x2f8f('0x1c')],function(_0x3956ba){return{'model':db[_0x3956ba['model']],'as':_0x3956ba['as'],'attributes':_0x3956ba['attributes'],'include':_0x3956ba['include']?_['map'](_0x3956ba[_0x2f8f('0x1c')],function(_0x3a7214){return{'model':db[_0x3a7214[_0x2f8f('0x1e')]],'as':_0x3a7214['as'],'attributes':_0x3a7214[_0x2f8f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2f8f('0xc')](function(_0x28efb6){logger[_0x2f8f('0xd')]('ShowZohoAccount',_0x151613);logger[_0x2f8f('0xf')](_0x2f8f('0x21'),_0x151613,JSON[_0x2f8f('0x11')](_0x28efb6));_0x46cce2(_0x28efb6);})[_0x2f8f('0x15')](function(_0x4b68bf){logger[_0x2f8f('0x12')]('ShowZohoAccount',_0x4b68bf['message'],_0x151613);_0xb0800a(_0x1b992f['error'](0x1f4,_0x4b68bf[_0x2f8f('0x14')]));});});}; \ No newline at end of file +var _0xb114=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','catch','ShowZohoAccount','find','where','stringify','lodash'];(function(_0x20fff8,_0x4ab454){var _0x3f8ab3=function(_0x2bbd36){while(--_0x2bbd36){_0x20fff8['push'](_0x20fff8['shift']());}};_0x3f8ab3(++_0x4ab454);}(_0xb114,0x11f));var _0x4b11=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xb114[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0x4b11('0x0'));var util=require('util');var moment=require(_0x4b11('0x1'));var BPromise=require(_0x4b11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b11('0x3'));var db=require(_0x4b11('0x4'))['db'];var utils=require(_0x4b11('0x5'));var logger=require(_0x4b11('0x6'))(_0x4b11('0x7'));var config=require(_0x4b11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b11('0x9')][_0x4b11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41fac6,_0x91f371,_0x132ad2){return new BPromise(function(_0x283039,_0x25ff0a){return client['request'](_0x41fac6,_0x132ad2)[_0x4b11('0xb')](function(_0x4cde8d){logger[_0x4b11('0xc')](_0x4b11('0xd'),_0x91f371,_0x4b11('0xe'));logger[_0x4b11('0xf')](_0x4b11('0x10'),_0x91f371,_0x4b11('0xe'),JSON['stringify'](_0x4cde8d));if(_0x4cde8d[_0x4b11('0x11')]){if(_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x12')]===0x1f4){logger[_0x4b11('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x91f371,_0x4cde8d['error'][_0x4b11('0x13')]);return _0x25ff0a(_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x13')]);}logger[_0x4b11('0x11')](_0x4b11('0xd'),_0x91f371,_0x4cde8d[_0x4b11('0x11')][_0x4b11('0x13')]);return _0x283039(_0x4cde8d[_0x4b11('0x11')]['message']);}else{logger['info'](_0x4b11('0xd'),_0x91f371,_0x4b11('0xe'));_0x283039(_0x4cde8d[_0x4b11('0x14')]['message']);}})['catch'](function(_0x4dd039){logger[_0x4b11('0x11')](_0x4b11('0xd'),_0x91f371,_0x4dd039);_0x25ff0a(_0x4dd039);});});}exports[_0x4b11('0x15')]=function(_0xf14a7f){var _0xa67776=this;return new Promise(function(_0x2db145,_0x40579b){return db[_0x4b11('0x16')][_0x4b11('0x17')]({'raw':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f['options'][_0x4b11('0x19')]===undefined?!![]:![]:!![],'where':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f[_0x4b11('0x18')]['where']||null:null,'attributes':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f['options'][_0x4b11('0x1a')]||null:null,'limit':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f[_0x4b11('0x18')][_0x4b11('0x1b')]||null:null,'include':_0xf14a7f[_0x4b11('0x18')]?_0xf14a7f[_0x4b11('0x18')][_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0xf14a7f[_0x4b11('0x18')][_0x4b11('0x1c')],function(_0x3e9a73){return{'model':db[_0x3e9a73['model']],'as':_0x3e9a73['as'],'attributes':_0x3e9a73[_0x4b11('0x1a')],'include':_0x3e9a73['include']?_[_0x4b11('0x1d')](_0x3e9a73['include'],function(_0x479e85){return{'model':db[_0x479e85[_0x4b11('0x1e')]],'as':_0x479e85['as'],'attributes':_0x479e85[_0x4b11('0x1a')],'include':_0x479e85[_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x479e85[_0x4b11('0x1c')],function(_0x5b904a){return{'model':db[_0x5b904a[_0x4b11('0x1e')]],'as':_0x5b904a['as'],'attributes':_0x5b904a[_0x4b11('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4b11('0xb')](function(_0x3e099f){logger[_0x4b11('0xc')](_0x4b11('0x15'),_0xf14a7f);logger[_0x4b11('0xf')](_0x4b11('0x15'),_0xf14a7f,JSON['stringify'](_0x3e099f));_0x2db145(_0x3e099f);})[_0x4b11('0x1f')](function(_0x15d27d){logger['error'](_0x4b11('0x15'),_0x15d27d[_0x4b11('0x13')],_0xf14a7f);_0x40579b(_0xa67776[_0x4b11('0x11')](0x1f4,_0x15d27d[_0x4b11('0x13')]));});});};exports[_0x4b11('0x20')]=function(_0x704ada){var _0x440cf5=this;return new Promise(function(_0x582d54,_0x409b01){return db[_0x4b11('0x16')][_0x4b11('0x21')]({'raw':_0x704ada['options']?_0x704ada[_0x4b11('0x18')][_0x4b11('0x19')]===undefined?!![]:![]:!![],'where':_0x704ada[_0x4b11('0x18')]?_0x704ada[_0x4b11('0x18')][_0x4b11('0x22')]||null:null,'attributes':_0x704ada[_0x4b11('0x18')]?_0x704ada['options']['attributes']||null:null,'include':_0x704ada[_0x4b11('0x18')]?_0x704ada[_0x4b11('0x18')][_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x704ada[_0x4b11('0x18')][_0x4b11('0x1c')],function(_0x232e78){return{'model':db[_0x232e78['model']],'as':_0x232e78['as'],'attributes':_0x232e78[_0x4b11('0x1a')],'include':_0x232e78[_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x232e78[_0x4b11('0x1c')],function(_0x18d31c){return{'model':db[_0x18d31c['model']],'as':_0x18d31c['as'],'attributes':_0x18d31c['attributes'],'include':_0x18d31c[_0x4b11('0x1c')]?_[_0x4b11('0x1d')](_0x18d31c[_0x4b11('0x1c')],function(_0x419d87){return{'model':db[_0x419d87['model']],'as':_0x419d87['as'],'attributes':_0x419d87['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34846a){logger[_0x4b11('0xc')]('ShowZohoAccount',_0x704ada);logger[_0x4b11('0xf')]('ShowZohoAccount',_0x704ada,JSON[_0x4b11('0x23')](_0x34846a));_0x582d54(_0x34846a);})[_0x4b11('0x1f')](function(_0xade5cc){logger[_0x4b11('0x11')](_0x4b11('0x20'),_0xade5cc[_0x4b11('0x13')],_0x704ada);_0x409b01(_0x440cf5[_0x4b11('0x11')](0x1f4,_0xade5cc[_0x4b11('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index f19110a..4fd23f5 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 _0x276f=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x107353,_0xe9bba0){var _0x922349=function(_0x5b26c1){while(--_0x5b26c1){_0x107353['push'](_0x107353['shift']());}};_0x922349(++_0xe9bba0);}(_0x276f,0x92));var _0xf276=function(_0x2fb19a,_0x3ffb19){_0x2fb19a=_0x2fb19a-0x0;var _0x48e068=_0x276f[_0x2fb19a];return _0x48e068;};'use strict';var multer=require(_0xf276('0x0'));var util=require(_0xf276('0x1'));var path=require(_0xf276('0x2'));var timeout=require('connect-timeout');var express=require(_0xf276('0x3'));var router=express[_0xf276('0x4')]();var fs_extra=require(_0xf276('0x5'));var auth=require(_0xf276('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf276('0x7'));var controller=require(_0xf276('0x8'));router[_0xf276('0x9')]('/',auth[_0xf276('0xa')](),controller[_0xf276('0xb')]);router['get'](_0xf276('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf276('0x9')](_0xf276('0xd'),auth[_0xf276('0xa')](),controller['getFields']);router['get'](_0xf276('0xe'),auth[_0xf276('0xa')](),controller[_0xf276('0xf')]);router['get'](_0xf276('0x10'),auth[_0xf276('0xa')](),controller[_0xf276('0x11')]);router[_0xf276('0x12')]('/',auth[_0xf276('0xa')](),controller[_0xf276('0x13')]);router[_0xf276('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xf276('0x15')]);router[_0xf276('0x16')](_0xf276('0xc'),auth['isAuthenticated'](),controller[_0xf276('0x17')]);module[_0xf276('0x18')]=router; \ No newline at end of file +var _0xad25=['fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','util','express'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xad25,0x90));var _0x5ad2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xad25[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x5ad2('0x0'));var util=require(_0x5ad2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ad2('0x2'));var router=express['Router']();var fs_extra=require(_0x5ad2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5ad2('0x4'));var config=require(_0x5ad2('0x5'));var controller=require(_0x5ad2('0x6'));router['get']('/',auth[_0x5ad2('0x7')](),controller[_0x5ad2('0x8')]);router[_0x5ad2('0x9')](_0x5ad2('0xa'),auth[_0x5ad2('0x7')](),controller['show']);router[_0x5ad2('0x9')](_0x5ad2('0xb'),auth[_0x5ad2('0x7')](),controller[_0x5ad2('0xc')]);router[_0x5ad2('0x9')](_0x5ad2('0xd'),auth[_0x5ad2('0x7')](),controller['getSubjects']);router[_0x5ad2('0x9')](_0x5ad2('0xe'),auth[_0x5ad2('0x7')](),controller[_0x5ad2('0xf')]);router[_0x5ad2('0x10')]('/',auth[_0x5ad2('0x7')](),controller[_0x5ad2('0x11')]);router['put'](_0x5ad2('0xa'),auth[_0x5ad2('0x7')](),controller[_0x5ad2('0x12')]);router[_0x5ad2('0x13')](_0x5ad2('0xa'),auth[_0x5ad2('0x7')](),controller['destroy']);module[_0x5ad2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f50c7b0..a0506e8 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 _0xc9b9=['ENUM','lead','contact_lead','STRING'];(function(_0x218a4d,_0x10a963){var _0x594420=function(_0x17c36e){while(--_0x17c36e){_0x218a4d['push'](_0x218a4d['shift']());}};_0x594420(++_0x10a963);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xc9b9[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9c9b('0x0')]},'moduleCreate':{'type':Sequelize[_0x9c9b('0x1')](_0x9c9b('0x2'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x9c9b('0x3'),'contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x9c9b('0x0')]}}; \ No newline at end of file +var _0x243f=['contact_lead','STRING','ENUM','lead','contact'];(function(_0x1f063b,_0x321a3c){var _0x4d864b=function(_0x173dfe){while(--_0x173dfe){_0x1f063b['push'](_0x1f063b['shift']());}};_0x4d864b(++_0x321a3c);}(_0x243f,0x1eb));var _0xf243=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x243f[_0x1ed116];return _0x574066;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf243('0x0')]},'moduleCreate':{'type':Sequelize[_0xf243('0x1')](_0xf243('0x2'),_0xf243('0x3'),'nothing'),'defaultValue':_0xf243('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf243('0x4'),_0xf243('0x3'),_0xf243('0x2')),'defaultValue':_0xf243('0x4')},'description':{'type':Sequelize[_0xf243('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 202977c..2d53340 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 _0x3a8b=['api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','filter','merge','options','ZohoConfiguration','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','ZohoField','sort','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5f0112,_0x1ce6d1){var _0x170f31=function(_0x258f07){while(--_0x258f07){_0x5f0112['push'](_0x5f0112['shift']());}};_0x170f31(++_0x1ce6d1);}(_0x3a8b,0x17b));var _0xb3a8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x3a8b[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0xb3a8('0x0'));var rimraf=require(_0xb3a8('0x1'));var zipdir=require(_0xb3a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3a8('0x3'));var moment=require('moment');var BPromise=require(_0xb3a8('0x4'));var Mustache=require(_0xb3a8('0x5'));var util=require(_0xb3a8('0x6'));var path=require(_0xb3a8('0x7'));var sox=require(_0xb3a8('0x8'));var csv=require(_0xb3a8('0x9'));var ejs=require(_0xb3a8('0xa'));var fs=require('fs');var fs_extra=require(_0xb3a8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb3a8('0xc'));var deskjs=require(_0xb3a8('0xd'));var toCsv=require(_0xb3a8('0x9'));var querystring=require(_0xb3a8('0xe'));var Papa=require('papaparse');var Redis=require(_0xb3a8('0xf'));var authService=require(_0xb3a8('0x10'));var qs=require(_0xb3a8('0x11'));var as=require(_0xb3a8('0x12'));var hardwareService=require(_0xb3a8('0x13'));var logger=require(_0xb3a8('0x14'))(_0xb3a8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb3a8('0x16'))['db'];function respondWithStatusCode(_0x583e2e,_0x2a10cd){_0x2a10cd=_0x2a10cd||0xcc;return function(_0x2c3c3c){if(_0x2c3c3c){return _0x583e2e[_0xb3a8('0x17')](_0x2a10cd);}return _0x583e2e[_0xb3a8('0x18')](_0x2a10cd)[_0xb3a8('0x19')]();};}function respondWithResult(_0x449fa3,_0x1468c0){_0x1468c0=_0x1468c0||0xc8;return function(_0x523277){if(_0x523277){return _0x449fa3[_0xb3a8('0x18')](_0x1468c0)[_0xb3a8('0x1a')](_0x523277);}};}function respondWithFilteredResult(_0x53740,_0x39bbcd){return function(_0x34799c){if(_0x34799c){var _0x5b7a24=typeof _0x39bbcd[_0xb3a8('0x1b')]==='undefined'&&typeof _0x39bbcd[_0xb3a8('0x1c')]===_0xb3a8('0x1d');var _0x54f69d=_0x34799c['count'];var _0x235b95=_0x5b7a24?0x0:_0x39bbcd['offset'];var _0x24c82b=_0x5b7a24?_0x34799c['count']:_0x39bbcd['offset']+_0x39bbcd[_0xb3a8('0x1c')];var _0x4b1702;if(_0x24c82b>=_0x54f69d){_0x24c82b=_0x54f69d;_0x4b1702=0xc8;}else{_0x4b1702=0xce;}_0x53740[_0xb3a8('0x18')](_0x4b1702);return _0x53740[_0xb3a8('0x1e')]('Content-Range',_0x235b95+'-'+_0x24c82b+'/'+_0x54f69d)[_0xb3a8('0x1a')](_0x34799c);}return null;};}function patchUpdates(_0x260a71){return function(_0x26481a){try{jsonpatch[_0xb3a8('0x1f')](_0x26481a,_0x260a71,!![]);}catch(_0x528216){return BPromise[_0xb3a8('0x20')](_0x528216);}return _0x26481a[_0xb3a8('0x21')]();};}function saveUpdates(_0x1cfb6b,_0x362d59){return function(_0x450fb7){if(_0x450fb7){return _0x450fb7[_0xb3a8('0x22')](_0x1cfb6b)[_0xb3a8('0x23')](function(_0x44fe6f){return _0x44fe6f;});}return null;};}function removeEntity(_0x3c311c,_0x460458){return function(_0x1b9ca9){if(_0x1b9ca9){return _0x1b9ca9[_0xb3a8('0x24')]()[_0xb3a8('0x23')](function(){_0x3c311c[_0xb3a8('0x18')](0xcc)[_0xb3a8('0x19')]();});}};}function handleEntityNotFound(_0x6c649b,_0x32a623){return function(_0x4cfa72){if(!_0x4cfa72){_0x6c649b[_0xb3a8('0x17')](0x194);}return _0x4cfa72;};}function handleError(_0x44d5eb,_0x561f35){_0x561f35=_0x561f35||0x1f4;return function(_0x17f0fb){logger[_0xb3a8('0x25')](_0x17f0fb[_0xb3a8('0x26')]);if(_0x17f0fb[_0xb3a8('0x27')]){delete _0x17f0fb[_0xb3a8('0x27')];}_0x44d5eb['status'](_0x561f35)['send'](_0x17f0fb);};}exports[_0xb3a8('0x28')]=function(_0x4993d2,_0x11e2f3){var _0x3c1e38={},_0x4027c1={},_0x235e40={'count':0x0,'rows':[]};var _0x19154f=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x11609c){return{'name':_0x11609c[_0xb3a8('0x29')],'type':_0x11609c[_0xb3a8('0x2a')][_0xb3a8('0x2b')]};});_0x4027c1[_0xb3a8('0x2c')]=_[_0xb3a8('0x2d')](_0x19154f,'name');_0x4027c1[_0xb3a8('0x2e')]=_[_0xb3a8('0x2f')](_0x4993d2[_0xb3a8('0x2e')]);_0x4027c1[_0xb3a8('0x30')]=_[_0xb3a8('0x31')](_0x4027c1[_0xb3a8('0x2c')],_0x4027c1[_0xb3a8('0x2e')]);_0x3c1e38['attributes']=_[_0xb3a8('0x31')](_0x4027c1[_0xb3a8('0x2c')],qs[_0xb3a8('0x32')](_0x4993d2['query'][_0xb3a8('0x32')]));_0x3c1e38[_0xb3a8('0x33')]=_0x3c1e38[_0xb3a8('0x33')][_0xb3a8('0x34')]?_0x3c1e38[_0xb3a8('0x33')]:_0x4027c1[_0xb3a8('0x2c')];if(!_0x4993d2[_0xb3a8('0x2e')]['hasOwnProperty'](_0xb3a8('0x35'))){_0x3c1e38[_0xb3a8('0x1c')]=qs[_0xb3a8('0x1c')](_0x4993d2[_0xb3a8('0x2e')][_0xb3a8('0x1c')]);_0x3c1e38[_0xb3a8('0x1b')]=qs[_0xb3a8('0x1b')](_0x4993d2[_0xb3a8('0x2e')][_0xb3a8('0x1b')]);}_0x3c1e38[_0xb3a8('0x36')]=qs['sort'](_0x4993d2[_0xb3a8('0x2e')]['sort']);_0x3c1e38[_0xb3a8('0x37')]=qs['filters'](_['pick'](_0x4993d2[_0xb3a8('0x2e')],_0x4027c1[_0xb3a8('0x30')]),_0x19154f);if(_0x4993d2[_0xb3a8('0x2e')][_0xb3a8('0x38')]){_0x3c1e38['where']=_[_0xb3a8('0x39')](_0x3c1e38[_0xb3a8('0x37')],{'$or':_[_0xb3a8('0x2d')](_0x19154f,function(_0x329392){if(_0x329392[_0xb3a8('0x2a')]!=='VIRTUAL'){var _0x343f88={};_0x343f88[_0x329392[_0xb3a8('0x27')]]={'$like':'%'+_0x4993d2[_0xb3a8('0x2e')]['filter']+'%'};return _0x343f88;}})});}_0x3c1e38=_[_0xb3a8('0x39')]({},_0x3c1e38,_0x4993d2[_0xb3a8('0x3a')]);var _0x55b992={'where':_0x3c1e38['where']};return db[_0xb3a8('0x3b')][_0xb3a8('0x3c')](_0x55b992)['then'](function(_0x3b999d){_0x235e40[_0xb3a8('0x3c')]=_0x3b999d;if(_0x4993d2[_0xb3a8('0x2e')][_0xb3a8('0x3d')]){_0x3c1e38[_0xb3a8('0x3e')]=[{'all':!![]}];}return db[_0xb3a8('0x3b')][_0xb3a8('0x3f')](_0x3c1e38);})[_0xb3a8('0x23')](function(_0x507a78){_0x235e40[_0xb3a8('0x40')]=_0x507a78;return _0x235e40;})[_0xb3a8('0x23')](respondWithFilteredResult(_0x11e2f3,_0x3c1e38))[_0xb3a8('0x41')](handleError(_0x11e2f3,null));};exports[_0xb3a8('0x42')]=function(_0x560f05,_0xfc41f9){var _0x491588={'raw':![],'where':{'id':_0x560f05[_0xb3a8('0x43')]['id']}},_0x16db1d={};_0x16db1d[_0xb3a8('0x2c')]=_[_0xb3a8('0x2f')](db[_0xb3a8('0x3b')][_0xb3a8('0x44')]);_0x16db1d['query']=_[_0xb3a8('0x2f')](_0x560f05[_0xb3a8('0x2e')]);_0x16db1d['filters']=_[_0xb3a8('0x31')](_0x16db1d[_0xb3a8('0x2c')],_0x16db1d[_0xb3a8('0x2e')]);_0x491588[_0xb3a8('0x33')]=_[_0xb3a8('0x31')](_0x16db1d[_0xb3a8('0x2c')],qs[_0xb3a8('0x32')](_0x560f05['query']['fields']));_0x491588[_0xb3a8('0x33')]=_0x491588[_0xb3a8('0x33')][_0xb3a8('0x34')]?_0x491588[_0xb3a8('0x33')]:_0x16db1d['model'];if(_0x560f05[_0xb3a8('0x2e')][_0xb3a8('0x3d')]){_0x491588['include']=[{'all':!![]}];}_0x491588=_[_0xb3a8('0x39')]({},_0x491588,_0x560f05[_0xb3a8('0x3a')]);return db[_0xb3a8('0x3b')][_0xb3a8('0x45')](_0x491588)['then'](handleEntityNotFound(_0xfc41f9,null))[_0xb3a8('0x23')](respondWithResult(_0xfc41f9,null))[_0xb3a8('0x41')](handleError(_0xfc41f9,null));};exports[_0xb3a8('0x46')]=function(_0x13860c,_0x59d303){return db[_0xb3a8('0x3b')]['create'](_0x13860c['body'],{})[_0xb3a8('0x23')](respondWithResult(_0x59d303,0xc9))[_0xb3a8('0x41')](handleError(_0x59d303,null));};exports[_0xb3a8('0x22')]=function(_0x58f54d,_0x299395){if(_0x58f54d[_0xb3a8('0x47')]['id']){delete _0x58f54d['body']['id'];}return db[_0xb3a8('0x3b')]['find']({'where':{'id':_0x58f54d[_0xb3a8('0x43')]['id']}})[_0xb3a8('0x23')](handleEntityNotFound(_0x299395,null))['then'](saveUpdates(_0x58f54d[_0xb3a8('0x47')],null))[_0xb3a8('0x23')](respondWithResult(_0x299395,null))[_0xb3a8('0x41')](handleError(_0x299395,null));};exports[_0xb3a8('0x24')]=function(_0x305114,_0x5f47c5){return db[_0xb3a8('0x3b')][_0xb3a8('0x45')]({'where':{'id':_0x305114[_0xb3a8('0x43')]['id']}})[_0xb3a8('0x23')](handleEntityNotFound(_0x5f47c5,null))[_0xb3a8('0x23')](removeEntity(_0x5f47c5,null))['catch'](handleError(_0x5f47c5,null));};exports['getFields']=function(_0x54999c,_0x55f558,_0x5d7621){var _0x10c908={};var _0x1ffc62={};var _0x38484e;var _0xece074;return db[_0xb3a8('0x3b')][_0xb3a8('0x48')]({'where':{'id':_0x54999c[_0xb3a8('0x43')]['id']}})[_0xb3a8('0x23')](handleEntityNotFound(_0x55f558,null))['then'](function(_0x49ec41){if(_0x49ec41){_0x38484e=_0x49ec41;_0x1ffc62['model']=_['keys'](db[_0xb3a8('0x49')][_0xb3a8('0x44')]);_0x1ffc62['query']=_[_0xb3a8('0x2f')](_0x54999c['query']);_0x1ffc62[_0xb3a8('0x30')]=_[_0xb3a8('0x31')](_0x1ffc62['model'],_0x1ffc62[_0xb3a8('0x2e')]);_0x10c908[_0xb3a8('0x33')]=_[_0xb3a8('0x31')](_0x1ffc62['model'],qs['fields'](_0x54999c['query'][_0xb3a8('0x32')]));_0x10c908[_0xb3a8('0x33')]=_0x10c908[_0xb3a8('0x33')]['length']?_0x10c908[_0xb3a8('0x33')]:_0x1ffc62[_0xb3a8('0x2c')];_0x10c908[_0xb3a8('0x36')]=qs[_0xb3a8('0x4a')](_0x54999c['query']['sort']);_0x10c908[_0xb3a8('0x37')]=qs[_0xb3a8('0x30')](_[_0xb3a8('0x4b')](_0x54999c[_0xb3a8('0x2e')],_0x1ffc62[_0xb3a8('0x30')]));if(_0x54999c[_0xb3a8('0x2e')][_0xb3a8('0x38')]){_0x10c908[_0xb3a8('0x37')]=_[_0xb3a8('0x39')](_0x10c908[_0xb3a8('0x37')],{'$or':_[_0xb3a8('0x2d')](_0x10c908[_0xb3a8('0x33')],function(_0x370939){var _0x49e84d={};_0x49e84d[_0x370939]={'$like':'%'+_0x54999c['query'][_0xb3a8('0x38')]+'%'};return _0x49e84d;})});}_0x10c908=_[_0xb3a8('0x39')]({},_0x10c908,_0x54999c[_0xb3a8('0x3a')]);return _0x38484e[_0xb3a8('0x4c')](_0x10c908);}})[_0xb3a8('0x23')](function(_0x57fe7d){if(_0x57fe7d){_0xece074=_0x57fe7d[_0xb3a8('0x34')];if(!_0x54999c[_0xb3a8('0x2e')][_0xb3a8('0x4d')]('nolimit')){_0x10c908[_0xb3a8('0x1c')]=qs[_0xb3a8('0x1c')](_0x54999c['query'][_0xb3a8('0x1c')]);_0x10c908[_0xb3a8('0x1b')]=qs[_0xb3a8('0x1b')](_0x54999c[_0xb3a8('0x2e')][_0xb3a8('0x1b')]);}return _0x38484e[_0xb3a8('0x4c')](_0x10c908);}})[_0xb3a8('0x23')](function(_0x1412e8){if(_0x1412e8){return _0x1412e8?{'count':_0xece074,'rows':_0x1412e8}:null;}})['then'](respondWithResult(_0x55f558,null))[_0xb3a8('0x41')](handleError(_0x55f558,null));};exports['getSubjects']=function(_0xc4c60,_0x32819f,_0x1fdb40){var _0x31c6b2={};var _0xb41bf7={};var _0x3f7f14;var _0xa2ea55;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xc4c60['params']['id']}})[_0xb3a8('0x23')](handleEntityNotFound(_0x32819f,null))[_0xb3a8('0x23')](function(_0x1dae7a){if(_0x1dae7a){_0x3f7f14=_0x1dae7a;_0xb41bf7[_0xb3a8('0x2c')]=_[_0xb3a8('0x2f')](db[_0xb3a8('0x49')][_0xb3a8('0x44')]);_0xb41bf7[_0xb3a8('0x2e')]=_['keys'](_0xc4c60['query']);_0xb41bf7[_0xb3a8('0x30')]=_[_0xb3a8('0x31')](_0xb41bf7[_0xb3a8('0x2c')],_0xb41bf7[_0xb3a8('0x2e')]);_0x31c6b2[_0xb3a8('0x33')]=_['intersection'](_0xb41bf7['model'],qs[_0xb3a8('0x32')](_0xc4c60[_0xb3a8('0x2e')][_0xb3a8('0x32')]));_0x31c6b2[_0xb3a8('0x33')]=_0x31c6b2[_0xb3a8('0x33')][_0xb3a8('0x34')]?_0x31c6b2[_0xb3a8('0x33')]:_0xb41bf7[_0xb3a8('0x2c')];_0x31c6b2[_0xb3a8('0x36')]=qs[_0xb3a8('0x4a')](_0xc4c60[_0xb3a8('0x2e')]['sort']);_0x31c6b2[_0xb3a8('0x37')]=qs[_0xb3a8('0x30')](_['pick'](_0xc4c60['query'],_0xb41bf7['filters']));if(_0xc4c60[_0xb3a8('0x2e')]['filter']){_0x31c6b2[_0xb3a8('0x37')]=_[_0xb3a8('0x39')](_0x31c6b2[_0xb3a8('0x37')],{'$or':_[_0xb3a8('0x2d')](_0x31c6b2[_0xb3a8('0x33')],function(_0xb7fb46){var _0x53689c={};_0x53689c[_0xb7fb46]={'$like':'%'+_0xc4c60[_0xb3a8('0x2e')][_0xb3a8('0x38')]+'%'};return _0x53689c;})});}_0x31c6b2=_[_0xb3a8('0x39')]({},_0x31c6b2,_0xc4c60[_0xb3a8('0x3a')]);return _0x3f7f14[_0xb3a8('0x4e')](_0x31c6b2);}})[_0xb3a8('0x23')](function(_0x2edd31){if(_0x2edd31){_0xa2ea55=_0x2edd31[_0xb3a8('0x34')];if(!_0xc4c60['query'][_0xb3a8('0x4d')](_0xb3a8('0x35'))){_0x31c6b2[_0xb3a8('0x1c')]=qs['limit'](_0xc4c60['query']['limit']);_0x31c6b2[_0xb3a8('0x1b')]=qs['offset'](_0xc4c60[_0xb3a8('0x2e')][_0xb3a8('0x1b')]);}return _0x3f7f14['getSubjects'](_0x31c6b2);}})['then'](function(_0x213bfc){if(_0x213bfc){return _0x213bfc?{'count':_0xa2ea55,'rows':_0x213bfc}:null;}})[_0xb3a8('0x23')](respondWithResult(_0x32819f,null))[_0xb3a8('0x41')](handleError(_0x32819f,null));};exports[_0xb3a8('0x4f')]=function(_0x32d495,_0x5cfad5,_0xb3fe52){var _0x3a55d0={};var _0x56fab1={};var _0x22c75e;var _0x3dbff6;return db['ZohoConfiguration'][_0xb3a8('0x48')]({'where':{'id':_0x32d495[_0xb3a8('0x43')]['id']}})[_0xb3a8('0x23')](handleEntityNotFound(_0x5cfad5,null))[_0xb3a8('0x23')](function(_0x21fffe){if(_0x21fffe){_0x22c75e=_0x21fffe;_0x56fab1['model']=_[_0xb3a8('0x2f')](db[_0xb3a8('0x49')]['rawAttributes']);_0x56fab1[_0xb3a8('0x2e')]=_[_0xb3a8('0x2f')](_0x32d495['query']);_0x56fab1[_0xb3a8('0x30')]=_[_0xb3a8('0x31')](_0x56fab1[_0xb3a8('0x2c')],_0x56fab1['query']);_0x3a55d0[_0xb3a8('0x33')]=_[_0xb3a8('0x31')](_0x56fab1['model'],qs[_0xb3a8('0x32')](_0x32d495[_0xb3a8('0x2e')][_0xb3a8('0x32')]));_0x3a55d0[_0xb3a8('0x33')]=_0x3a55d0[_0xb3a8('0x33')][_0xb3a8('0x34')]?_0x3a55d0['attributes']:_0x56fab1[_0xb3a8('0x2c')];_0x3a55d0[_0xb3a8('0x36')]=qs[_0xb3a8('0x4a')](_0x32d495['query'][_0xb3a8('0x4a')]);_0x3a55d0[_0xb3a8('0x37')]=qs[_0xb3a8('0x30')](_[_0xb3a8('0x4b')](_0x32d495[_0xb3a8('0x2e')],_0x56fab1[_0xb3a8('0x30')]));if(_0x32d495[_0xb3a8('0x2e')][_0xb3a8('0x38')]){_0x3a55d0['where']=_[_0xb3a8('0x39')](_0x3a55d0[_0xb3a8('0x37')],{'$or':_[_0xb3a8('0x2d')](_0x3a55d0['attributes'],function(_0x578dba){var _0x476468={};_0x476468[_0x578dba]={'$like':'%'+_0x32d495[_0xb3a8('0x2e')][_0xb3a8('0x38')]+'%'};return _0x476468;})});}_0x3a55d0=_[_0xb3a8('0x39')]({},_0x3a55d0,_0x32d495[_0xb3a8('0x3a')]);return _0x22c75e[_0xb3a8('0x4f')](_0x3a55d0);}})['then'](function(_0x516750){if(_0x516750){_0x3dbff6=_0x516750[_0xb3a8('0x34')];if(!_0x32d495[_0xb3a8('0x2e')][_0xb3a8('0x4d')](_0xb3a8('0x35'))){_0x3a55d0[_0xb3a8('0x1c')]=qs[_0xb3a8('0x1c')](_0x32d495[_0xb3a8('0x2e')][_0xb3a8('0x1c')]);_0x3a55d0[_0xb3a8('0x1b')]=qs['offset'](_0x32d495['query'][_0xb3a8('0x1b')]);}return _0x22c75e[_0xb3a8('0x4f')](_0x3a55d0);}})[_0xb3a8('0x23')](function(_0x2ed5bc){if(_0x2ed5bc){return _0x2ed5bc?{'count':_0x3dbff6,'rows':_0x2ed5bc}:null;}})['then'](respondWithResult(_0x5cfad5,null))[_0xb3a8('0x41')](handleError(_0x5cfad5,null));}; \ No newline at end of file +var _0xb17d=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','params','intersection','include','merge','find','create','body','getFields','ZohoField','order','getSubjects','getDescriptions','nolimit'];(function(_0x44ac60,_0xd0c03e){var _0xabca8e=function(_0x2a807e){while(--_0x2a807e){_0x44ac60['push'](_0x44ac60['shift']());}};_0xabca8e(++_0xd0c03e);}(_0xb17d,0xe4));var _0xdb17=function(_0x46ec2e,_0x22d179){_0x46ec2e=_0x46ec2e-0x0;var _0x2875b9=_0xb17d[_0x46ec2e];return _0x2875b9;};'use strict';var emlformat=require(_0xdb17('0x0'));var rimraf=require(_0xdb17('0x1'));var zipdir=require(_0xdb17('0x2'));var jsonpatch=require(_0xdb17('0x3'));var rp=require(_0xdb17('0x4'));var moment=require(_0xdb17('0x5'));var BPromise=require(_0xdb17('0x6'));var Mustache=require(_0xdb17('0x7'));var util=require(_0xdb17('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdb17('0x9'));var fs=require('fs');var fs_extra=require(_0xdb17('0xa'));var _=require('lodash');var squel=require(_0xdb17('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb17('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdb17('0xd'));var querystring=require('querystring');var Papa=require(_0xdb17('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdb17('0xf'));var hardwareService=require(_0xdb17('0x10'));var logger=require(_0xdb17('0x11'))('api');var utils=require(_0xdb17('0x12'));var config=require(_0xdb17('0x13'));var licenseUtil=require(_0xdb17('0x14'));var db=require(_0xdb17('0x15'))['db'];function respondWithStatusCode(_0x4caae7,_0x5ab7d0){_0x5ab7d0=_0x5ab7d0||0xcc;return function(_0x4dd5ca){if(_0x4dd5ca){return _0x4caae7[_0xdb17('0x16')](_0x5ab7d0);}return _0x4caae7['status'](_0x5ab7d0)[_0xdb17('0x17')]();};}function respondWithResult(_0x41cb97,_0x4a9cc8){_0x4a9cc8=_0x4a9cc8||0xc8;return function(_0x3de1e9){if(_0x3de1e9){return _0x41cb97[_0xdb17('0x18')](_0x4a9cc8)['json'](_0x3de1e9);}};}function respondWithFilteredResult(_0x2e8c00,_0x22d2bd){return function(_0x1ce6bb){if(_0x1ce6bb){var _0x121568=typeof _0x22d2bd[_0xdb17('0x19')]===_0xdb17('0x1a')&&typeof _0x22d2bd[_0xdb17('0x1b')]==='undefined';var _0x53e8f4=_0x1ce6bb[_0xdb17('0x1c')];var _0x4ae7f9=_0x121568?0x0:_0x22d2bd[_0xdb17('0x19')];var _0x158c53=_0x121568?_0x1ce6bb['count']:_0x22d2bd[_0xdb17('0x19')]+_0x22d2bd[_0xdb17('0x1b')];var _0x599a61;if(_0x158c53>=_0x53e8f4){_0x158c53=_0x53e8f4;_0x599a61=0xc8;}else{_0x599a61=0xce;}_0x2e8c00[_0xdb17('0x18')](_0x599a61);return _0x2e8c00[_0xdb17('0x1d')](_0xdb17('0x1e'),_0x4ae7f9+'-'+_0x158c53+'/'+_0x53e8f4)['json'](_0x1ce6bb);}return null;};}function patchUpdates(_0x4f077b){return function(_0x9045b0){try{jsonpatch[_0xdb17('0x1f')](_0x9045b0,_0x4f077b,!![]);}catch(_0xfccf57){return BPromise[_0xdb17('0x20')](_0xfccf57);}return _0x9045b0[_0xdb17('0x21')]();};}function saveUpdates(_0x50495b,_0x3d355f){return function(_0xce227a){if(_0xce227a){return _0xce227a[_0xdb17('0x22')](_0x50495b)[_0xdb17('0x23')](function(_0x39d706){return _0x39d706;});}return null;};}function removeEntity(_0x223122,_0x51ff10){return function(_0x30f6ce){if(_0x30f6ce){return _0x30f6ce[_0xdb17('0x24')]()[_0xdb17('0x23')](function(){_0x223122[_0xdb17('0x18')](0xcc)[_0xdb17('0x17')]();});}};}function handleEntityNotFound(_0x3151ca,_0x11e335){return function(_0x1fd3ae){if(!_0x1fd3ae){_0x3151ca['sendStatus'](0x194);}return _0x1fd3ae;};}function handleError(_0xebffca,_0x5bd9ea){_0x5bd9ea=_0x5bd9ea||0x1f4;return function(_0x4ec1ae){logger['error'](_0x4ec1ae[_0xdb17('0x25')]);if(_0x4ec1ae['name']){delete _0x4ec1ae[_0xdb17('0x26')];}_0xebffca[_0xdb17('0x18')](_0x5bd9ea)[_0xdb17('0x27')](_0x4ec1ae);};}exports[_0xdb17('0x28')]=function(_0x5d2790,_0x2ec64e){var _0x45a2bd={},_0x52ca9b={},_0x5ced95={'count':0x0,'rows':[]};var _0x383181=_['map'](db[_0xdb17('0x29')][_0xdb17('0x2a')],function(_0x4b5b42){return{'name':_0x4b5b42[_0xdb17('0x2b')],'type':_0x4b5b42[_0xdb17('0x2c')]['key']};});_0x52ca9b['model']=_[_0xdb17('0x2d')](_0x383181,_0xdb17('0x26'));_0x52ca9b[_0xdb17('0x2e')]=_[_0xdb17('0x2f')](_0x5d2790[_0xdb17('0x2e')]);_0x52ca9b[_0xdb17('0x30')]=_['intersection'](_0x52ca9b[_0xdb17('0x31')],_0x52ca9b['query']);_0x45a2bd[_0xdb17('0x32')]=_['intersection'](_0x52ca9b['model'],qs['fields'](_0x5d2790[_0xdb17('0x2e')][_0xdb17('0x33')]));_0x45a2bd[_0xdb17('0x32')]=_0x45a2bd[_0xdb17('0x32')][_0xdb17('0x34')]?_0x45a2bd[_0xdb17('0x32')]:_0x52ca9b[_0xdb17('0x31')];if(!_0x5d2790[_0xdb17('0x2e')][_0xdb17('0x35')]('nolimit')){_0x45a2bd[_0xdb17('0x1b')]=qs[_0xdb17('0x1b')](_0x5d2790[_0xdb17('0x2e')][_0xdb17('0x1b')]);_0x45a2bd[_0xdb17('0x19')]=qs[_0xdb17('0x19')](_0x5d2790[_0xdb17('0x2e')][_0xdb17('0x19')]);}_0x45a2bd['order']=qs[_0xdb17('0x36')](_0x5d2790['query']['sort']);_0x45a2bd[_0xdb17('0x37')]=qs[_0xdb17('0x30')](_[_0xdb17('0x38')](_0x5d2790['query'],_0x52ca9b['filters']),_0x383181);if(_0x5d2790[_0xdb17('0x2e')][_0xdb17('0x39')]){_0x45a2bd[_0xdb17('0x37')]=_['merge'](_0x45a2bd[_0xdb17('0x37')],{'$or':_[_0xdb17('0x2d')](_0x383181,function(_0x299e28){if(_0x299e28[_0xdb17('0x2c')]!==_0xdb17('0x3a')){var _0x197a1d={};_0x197a1d[_0x299e28[_0xdb17('0x26')]]={'$like':'%'+_0x5d2790[_0xdb17('0x2e')][_0xdb17('0x39')]+'%'};return _0x197a1d;}})});}_0x45a2bd=_['merge']({},_0x45a2bd,_0x5d2790[_0xdb17('0x3b')]);var _0x3ae9e5={'where':_0x45a2bd[_0xdb17('0x37')]};return db[_0xdb17('0x29')]['count'](_0x3ae9e5)[_0xdb17('0x23')](function(_0x2312ba){_0x5ced95['count']=_0x2312ba;if(_0x5d2790['query'][_0xdb17('0x3c')]){_0x45a2bd['include']=[{'all':!![]}];}return db[_0xdb17('0x29')]['findAll'](_0x45a2bd);})[_0xdb17('0x23')](function(_0x4e19c5){_0x5ced95[_0xdb17('0x3d')]=_0x4e19c5;return _0x5ced95;})[_0xdb17('0x23')](respondWithFilteredResult(_0x2ec64e,_0x45a2bd))[_0xdb17('0x3e')](handleError(_0x2ec64e,null));};exports['show']=function(_0x4e13db,_0x25d3b0){var _0x52cfc8={'raw':![],'where':{'id':_0x4e13db[_0xdb17('0x3f')]['id']}},_0x2de14b={};_0x2de14b['model']=_['keys'](db['ZohoConfiguration'][_0xdb17('0x2a')]);_0x2de14b[_0xdb17('0x2e')]=_[_0xdb17('0x2f')](_0x4e13db[_0xdb17('0x2e')]);_0x2de14b[_0xdb17('0x30')]=_[_0xdb17('0x40')](_0x2de14b[_0xdb17('0x31')],_0x2de14b[_0xdb17('0x2e')]);_0x52cfc8[_0xdb17('0x32')]=_[_0xdb17('0x40')](_0x2de14b[_0xdb17('0x31')],qs[_0xdb17('0x33')](_0x4e13db['query']['fields']));_0x52cfc8['attributes']=_0x52cfc8['attributes'][_0xdb17('0x34')]?_0x52cfc8[_0xdb17('0x32')]:_0x2de14b[_0xdb17('0x31')];if(_0x4e13db[_0xdb17('0x2e')][_0xdb17('0x3c')]){_0x52cfc8[_0xdb17('0x41')]=[{'all':!![]}];}_0x52cfc8=_[_0xdb17('0x42')]({},_0x52cfc8,_0x4e13db[_0xdb17('0x3b')]);return db[_0xdb17('0x29')][_0xdb17('0x43')](_0x52cfc8)[_0xdb17('0x23')](handleEntityNotFound(_0x25d3b0,null))['then'](respondWithResult(_0x25d3b0,null))['catch'](handleError(_0x25d3b0,null));};exports[_0xdb17('0x44')]=function(_0x44b03c,_0x25c619){return db[_0xdb17('0x29')][_0xdb17('0x44')](_0x44b03c[_0xdb17('0x45')],{})['then'](respondWithResult(_0x25c619,0xc9))[_0xdb17('0x3e')](handleError(_0x25c619,null));};exports[_0xdb17('0x22')]=function(_0x4d2757,_0x5d5caa){if(_0x4d2757['body']['id']){delete _0x4d2757[_0xdb17('0x45')]['id'];}return db[_0xdb17('0x29')][_0xdb17('0x43')]({'where':{'id':_0x4d2757['params']['id']}})[_0xdb17('0x23')](handleEntityNotFound(_0x5d5caa,null))['then'](saveUpdates(_0x4d2757[_0xdb17('0x45')],null))[_0xdb17('0x23')](respondWithResult(_0x5d5caa,null))['catch'](handleError(_0x5d5caa,null));};exports[_0xdb17('0x24')]=function(_0x32d81f,_0x245016){return db[_0xdb17('0x29')]['find']({'where':{'id':_0x32d81f[_0xdb17('0x3f')]['id']}})[_0xdb17('0x23')](handleEntityNotFound(_0x245016,null))[_0xdb17('0x23')](removeEntity(_0x245016,null))['catch'](handleError(_0x245016,null));};exports[_0xdb17('0x46')]=function(_0x5b30be,_0x121edd,_0x3bc68e){var _0x2d1cbf={};var _0x53b723={};var _0x5c2a08;var _0x56282e;return db[_0xdb17('0x29')]['findOne']({'where':{'id':_0x5b30be['params']['id']}})['then'](handleEntityNotFound(_0x121edd,null))[_0xdb17('0x23')](function(_0x53e9c2){if(_0x53e9c2){_0x5c2a08=_0x53e9c2;_0x53b723['model']=_[_0xdb17('0x2f')](db[_0xdb17('0x47')][_0xdb17('0x2a')]);_0x53b723[_0xdb17('0x2e')]=_[_0xdb17('0x2f')](_0x5b30be['query']);_0x53b723['filters']=_[_0xdb17('0x40')](_0x53b723['model'],_0x53b723[_0xdb17('0x2e')]);_0x2d1cbf[_0xdb17('0x32')]=_['intersection'](_0x53b723[_0xdb17('0x31')],qs[_0xdb17('0x33')](_0x5b30be[_0xdb17('0x2e')][_0xdb17('0x33')]));_0x2d1cbf[_0xdb17('0x32')]=_0x2d1cbf[_0xdb17('0x32')]['length']?_0x2d1cbf[_0xdb17('0x32')]:_0x53b723[_0xdb17('0x31')];_0x2d1cbf[_0xdb17('0x48')]=qs['sort'](_0x5b30be['query'][_0xdb17('0x36')]);_0x2d1cbf[_0xdb17('0x37')]=qs['filters'](_['pick'](_0x5b30be['query'],_0x53b723[_0xdb17('0x30')]));if(_0x5b30be[_0xdb17('0x2e')][_0xdb17('0x39')]){_0x2d1cbf[_0xdb17('0x37')]=_[_0xdb17('0x42')](_0x2d1cbf[_0xdb17('0x37')],{'$or':_[_0xdb17('0x2d')](_0x2d1cbf[_0xdb17('0x32')],function(_0x40eed2){var _0x52a31d={};_0x52a31d[_0x40eed2]={'$like':'%'+_0x5b30be[_0xdb17('0x2e')][_0xdb17('0x39')]+'%'};return _0x52a31d;})});}_0x2d1cbf=_[_0xdb17('0x42')]({},_0x2d1cbf,_0x5b30be[_0xdb17('0x3b')]);return _0x5c2a08['getFields'](_0x2d1cbf);}})['then'](function(_0x5a7a41){if(_0x5a7a41){_0x56282e=_0x5a7a41[_0xdb17('0x34')];if(!_0x5b30be[_0xdb17('0x2e')][_0xdb17('0x35')]('nolimit')){_0x2d1cbf[_0xdb17('0x1b')]=qs[_0xdb17('0x1b')](_0x5b30be[_0xdb17('0x2e')][_0xdb17('0x1b')]);_0x2d1cbf[_0xdb17('0x19')]=qs[_0xdb17('0x19')](_0x5b30be[_0xdb17('0x2e')]['offset']);}return _0x5c2a08[_0xdb17('0x46')](_0x2d1cbf);}})['then'](function(_0x5bf2b4){if(_0x5bf2b4){return _0x5bf2b4?{'count':_0x56282e,'rows':_0x5bf2b4}:null;}})['then'](respondWithResult(_0x121edd,null))[_0xdb17('0x3e')](handleError(_0x121edd,null));};exports[_0xdb17('0x49')]=function(_0x40bae0,_0x5bb41d,_0x492110){var _0x49db6f={};var _0x3da726={};var _0xb0d7ef;var _0x543a06;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x40bae0[_0xdb17('0x3f')]['id']}})[_0xdb17('0x23')](handleEntityNotFound(_0x5bb41d,null))[_0xdb17('0x23')](function(_0x56642a){if(_0x56642a){_0xb0d7ef=_0x56642a;_0x3da726[_0xdb17('0x31')]=_['keys'](db[_0xdb17('0x47')][_0xdb17('0x2a')]);_0x3da726[_0xdb17('0x2e')]=_['keys'](_0x40bae0[_0xdb17('0x2e')]);_0x3da726[_0xdb17('0x30')]=_[_0xdb17('0x40')](_0x3da726[_0xdb17('0x31')],_0x3da726['query']);_0x49db6f['attributes']=_[_0xdb17('0x40')](_0x3da726[_0xdb17('0x31')],qs['fields'](_0x40bae0[_0xdb17('0x2e')][_0xdb17('0x33')]));_0x49db6f[_0xdb17('0x32')]=_0x49db6f[_0xdb17('0x32')]['length']?_0x49db6f[_0xdb17('0x32')]:_0x3da726[_0xdb17('0x31')];_0x49db6f[_0xdb17('0x48')]=qs[_0xdb17('0x36')](_0x40bae0[_0xdb17('0x2e')][_0xdb17('0x36')]);_0x49db6f[_0xdb17('0x37')]=qs[_0xdb17('0x30')](_[_0xdb17('0x38')](_0x40bae0[_0xdb17('0x2e')],_0x3da726[_0xdb17('0x30')]));if(_0x40bae0[_0xdb17('0x2e')]['filter']){_0x49db6f[_0xdb17('0x37')]=_['merge'](_0x49db6f['where'],{'$or':_[_0xdb17('0x2d')](_0x49db6f['attributes'],function(_0x5b645f){var _0x4f58ca={};_0x4f58ca[_0x5b645f]={'$like':'%'+_0x40bae0['query']['filter']+'%'};return _0x4f58ca;})});}_0x49db6f=_[_0xdb17('0x42')]({},_0x49db6f,_0x40bae0[_0xdb17('0x3b')]);return _0xb0d7ef[_0xdb17('0x49')](_0x49db6f);}})[_0xdb17('0x23')](function(_0x2c6f6c){if(_0x2c6f6c){_0x543a06=_0x2c6f6c[_0xdb17('0x34')];if(!_0x40bae0[_0xdb17('0x2e')][_0xdb17('0x35')]('nolimit')){_0x49db6f[_0xdb17('0x1b')]=qs['limit'](_0x40bae0[_0xdb17('0x2e')][_0xdb17('0x1b')]);_0x49db6f[_0xdb17('0x19')]=qs[_0xdb17('0x19')](_0x40bae0[_0xdb17('0x2e')][_0xdb17('0x19')]);}return _0xb0d7ef[_0xdb17('0x49')](_0x49db6f);}})[_0xdb17('0x23')](function(_0xd57097){if(_0xd57097){return _0xd57097?{'count':_0x543a06,'rows':_0xd57097}:null;}})[_0xdb17('0x23')](respondWithResult(_0x5bb41d,null))[_0xdb17('0x3e')](handleError(_0x5bb41d,null));};exports[_0xdb17('0x4a')]=function(_0x17403e,_0x3c5fe4,_0x2ad464){var _0x459a82={};var _0x5d05e7={};var _0x4af400;var _0x2b84e9;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x17403e[_0xdb17('0x3f')]['id']}})[_0xdb17('0x23')](handleEntityNotFound(_0x3c5fe4,null))[_0xdb17('0x23')](function(_0x450664){if(_0x450664){_0x4af400=_0x450664;_0x5d05e7['model']=_['keys'](db[_0xdb17('0x47')][_0xdb17('0x2a')]);_0x5d05e7[_0xdb17('0x2e')]=_[_0xdb17('0x2f')](_0x17403e[_0xdb17('0x2e')]);_0x5d05e7['filters']=_['intersection'](_0x5d05e7[_0xdb17('0x31')],_0x5d05e7['query']);_0x459a82['attributes']=_['intersection'](_0x5d05e7['model'],qs['fields'](_0x17403e[_0xdb17('0x2e')][_0xdb17('0x33')]));_0x459a82[_0xdb17('0x32')]=_0x459a82[_0xdb17('0x32')][_0xdb17('0x34')]?_0x459a82[_0xdb17('0x32')]:_0x5d05e7[_0xdb17('0x31')];_0x459a82[_0xdb17('0x48')]=qs[_0xdb17('0x36')](_0x17403e[_0xdb17('0x2e')][_0xdb17('0x36')]);_0x459a82[_0xdb17('0x37')]=qs['filters'](_[_0xdb17('0x38')](_0x17403e[_0xdb17('0x2e')],_0x5d05e7[_0xdb17('0x30')]));if(_0x17403e[_0xdb17('0x2e')]['filter']){_0x459a82[_0xdb17('0x37')]=_[_0xdb17('0x42')](_0x459a82['where'],{'$or':_[_0xdb17('0x2d')](_0x459a82['attributes'],function(_0x14db37){var _0x4aca36={};_0x4aca36[_0x14db37]={'$like':'%'+_0x17403e[_0xdb17('0x2e')][_0xdb17('0x39')]+'%'};return _0x4aca36;})});}_0x459a82=_[_0xdb17('0x42')]({},_0x459a82,_0x17403e[_0xdb17('0x3b')]);return _0x4af400[_0xdb17('0x4a')](_0x459a82);}})[_0xdb17('0x23')](function(_0x36c2bc){if(_0x36c2bc){_0x2b84e9=_0x36c2bc['length'];if(!_0x17403e[_0xdb17('0x2e')]['hasOwnProperty'](_0xdb17('0x4b'))){_0x459a82[_0xdb17('0x1b')]=qs[_0xdb17('0x1b')](_0x17403e[_0xdb17('0x2e')][_0xdb17('0x1b')]);_0x459a82[_0xdb17('0x19')]=qs[_0xdb17('0x19')](_0x17403e['query'][_0xdb17('0x19')]);}return _0x4af400[_0xdb17('0x4a')](_0x459a82);}})[_0xdb17('0x23')](function(_0x1de511){if(_0x1de511){return _0x1de511?{'count':_0x2b84e9,'rows':_0x1de511}:null;}})['then'](respondWithResult(_0x3c5fe4,null))['catch'](handleError(_0x3c5fe4,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 882e0b5..247a2a2 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 _0x23e4=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x46a194,_0x2e83cb){var _0x19df22=function(_0x252f3d){while(--_0x252f3d){_0x46a194['push'](_0x46a194['shift']());}};_0x19df22(++_0x2e83cb);}(_0x23e4,0x8e));var _0x423e=function(_0x2f99bf,_0x399b98){_0x2f99bf=_0x2f99bf-0x0;var _0x2baa41=_0x23e4[_0x2f99bf];return _0x2baa41;};'use strict';var _=require(_0x423e('0x0'));var util=require(_0x423e('0x1'));var logger=require(_0x423e('0x2'))(_0x423e('0x3'));var moment=require(_0x423e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x423e('0x5'));var rimraf=require(_0x423e('0x6'));var config=require(_0x423e('0x7'));var attributes=require(_0x423e('0x8'));module[_0x423e('0x9')]=function(_0x50e7b7,_0x207e62){return _0x50e7b7[_0x423e('0xa')](_0x423e('0xb'),attributes,{'tableName':_0x423e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9622=['ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define'];(function(_0x517a14,_0x3a23aa){var _0x5d508c=function(_0xc1936d){while(--_0xc1936d){_0x517a14['push'](_0x517a14['shift']());}};_0x5d508c(++_0x3a23aa);}(_0x9622,0x1bc));var _0x2962=function(_0x59f655,_0x1c12aa){_0x59f655=_0x59f655-0x0;var _0x1dbb6e=_0x9622[_0x59f655];return _0x1dbb6e;};'use strict';var _=require(_0x2962('0x0'));var util=require(_0x2962('0x1'));var logger=require('../../config/logger')(_0x2962('0x2'));var moment=require(_0x2962('0x3'));var BPromise=require(_0x2962('0x4'));var rp=require(_0x2962('0x5'));var fs=require('fs');var path=require(_0x2962('0x6'));var rimraf=require(_0x2962('0x7'));var config=require(_0x2962('0x8'));var attributes=require(_0x2962('0x9'));module['exports']=function(_0x447023,_0x9ef0d3){return _0x447023[_0x2962('0xa')](_0x2962('0xb'),attributes,{'tableName':_0x2962('0xc'),'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 fcb8c42..7f71a36 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 _0xd7e6=['rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xd7e6,0x158));var _0x6d7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7e6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d7e('0x0'));var util=require(_0x6d7e('0x1'));var moment=require(_0x6d7e('0x2'));var BPromise=require(_0x6d7e('0x3'));var rs=require(_0x6d7e('0x4'));var fs=require('fs');var Redis=require(_0x6d7e('0x5'));var db=require(_0x6d7e('0x6'))['db'];var utils=require(_0x6d7e('0x7'));var logger=require('../../config/logger')(_0x6d7e('0x8'));var config=require(_0x6d7e('0x9'));var jayson=require(_0x6d7e('0xa'));var client=jayson[_0x6d7e('0xb')][_0x6d7e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14db4c,_0x524d3f,_0x45e110){return new BPromise(function(_0x5e2867,_0x28c822){return client['request'](_0x14db4c,_0x45e110)[_0x6d7e('0xd')](function(_0x32ffa5){logger[_0x6d7e('0xe')](_0x6d7e('0xf'),_0x524d3f,_0x6d7e('0x10'));logger['debug'](_0x6d7e('0x11'),_0x524d3f,'request\x20sent',JSON['stringify'](_0x32ffa5));if(_0x32ffa5['error']){if(_0x32ffa5[_0x6d7e('0x12')][_0x6d7e('0x13')]===0x1f4){logger[_0x6d7e('0x12')](_0x6d7e('0xf'),_0x524d3f,_0x32ffa5[_0x6d7e('0x12')]['message']);return _0x28c822(_0x32ffa5[_0x6d7e('0x12')][_0x6d7e('0x14')]);}logger[_0x6d7e('0x12')](_0x6d7e('0xf'),_0x524d3f,_0x32ffa5[_0x6d7e('0x12')]['message']);return _0x5e2867(_0x32ffa5[_0x6d7e('0x12')]['message']);}else{logger[_0x6d7e('0xe')](_0x6d7e('0xf'),_0x524d3f,_0x6d7e('0x10'));_0x5e2867(_0x32ffa5['result'][_0x6d7e('0x14')]);}})[_0x6d7e('0x15')](function(_0x22deaa){logger['error'](_0x6d7e('0xf'),_0x524d3f,_0x22deaa);_0x28c822(_0x22deaa);});});} \ No newline at end of file +var _0x1d4e=['../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3c992d,_0x288c42){var _0x16cfd4=function(_0xd00692){while(--_0xd00692){_0x3c992d['push'](_0x3c992d['shift']());}};_0x16cfd4(++_0x288c42);}(_0x1d4e,0x16e));var _0xe1d4=function(_0x4e9f60,_0x28fb4e){_0x4e9f60=_0x4e9f60-0x0;var _0x1faa7f=_0x1d4e[_0x4e9f60];return _0x1faa7f;};'use strict';var _=require(_0xe1d4('0x0'));var util=require(_0xe1d4('0x1'));var moment=require(_0xe1d4('0x2'));var BPromise=require(_0xe1d4('0x3'));var rs=require(_0xe1d4('0x4'));var fs=require('fs');var Redis=require(_0xe1d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1d4('0x6'));var logger=require(_0xe1d4('0x7'))(_0xe1d4('0x8'));var config=require(_0xe1d4('0x9'));var jayson=require(_0xe1d4('0xa'));var client=jayson[_0xe1d4('0xb')][_0xe1d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x311500,_0x59a613,_0x2e72d7){return new BPromise(function(_0x800dd4,_0x43199b){return client[_0xe1d4('0xd')](_0x311500,_0x2e72d7)['then'](function(_0x140a84){logger['info'](_0xe1d4('0xe'),_0x59a613,_0xe1d4('0xf'));logger[_0xe1d4('0x10')](_0xe1d4('0x11'),_0x59a613,'request\x20sent',JSON[_0xe1d4('0x12')](_0x140a84));if(_0x140a84[_0xe1d4('0x13')]){if(_0x140a84['error'][_0xe1d4('0x14')]===0x1f4){logger[_0xe1d4('0x13')](_0xe1d4('0xe'),_0x59a613,_0x140a84[_0xe1d4('0x13')][_0xe1d4('0x15')]);return _0x43199b(_0x140a84['error'][_0xe1d4('0x15')]);}logger[_0xe1d4('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x59a613,_0x140a84[_0xe1d4('0x13')][_0xe1d4('0x15')]);return _0x800dd4(_0x140a84[_0xe1d4('0x13')][_0xe1d4('0x15')]);}else{logger[_0xe1d4('0x16')](_0xe1d4('0xe'),_0x59a613,_0xe1d4('0xf'));_0x800dd4(_0x140a84[_0xe1d4('0x17')][_0xe1d4('0x15')]);}})[_0xe1d4('0x18')](function(_0x348734){logger[_0xe1d4('0x13')](_0xe1d4('0xe'),_0x59a613,_0x348734);_0x43199b(_0x348734);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f578e63..36fb4ba 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 _0x12cb=['index','get','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','./intZohoField.controller','isAuthenticated'];(function(_0x8e0402,_0x263fc3){var _0x40d58c=function(_0x3aa024){while(--_0x3aa024){_0x8e0402['push'](_0x8e0402['shift']());}};_0x40d58c(++_0x263fc3);}(_0x12cb,0x16e));var _0xb12c=function(_0xa168ed,_0x3e11b3){_0xa168ed=_0xa168ed-0x0;var _0x32facf=_0x12cb[_0xa168ed];return _0x32facf;};'use strict';var multer=require(_0xb12c('0x0'));var util=require('util');var path=require(_0xb12c('0x1'));var timeout=require(_0xb12c('0x2'));var express=require(_0xb12c('0x3'));var router=express[_0xb12c('0x4')]();var fs_extra=require(_0xb12c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb12c('0x6'));router['get']('/',auth[_0xb12c('0x7')](),controller[_0xb12c('0x8')]);router[_0xb12c('0x9')](_0xb12c('0xa'),auth[_0xb12c('0x7')](),controller[_0xb12c('0xb')]);router[_0xb12c('0xc')]('/',auth[_0xb12c('0x7')](),controller[_0xb12c('0xd')]);router['put'](_0xb12c('0xa'),auth['isAuthenticated'](),controller[_0xb12c('0xe')]);router[_0xb12c('0xf')](_0xb12c('0xa'),auth[_0xb12c('0x7')](),controller['destroy']);module[_0xb12c('0x10')]=router; \ No newline at end of file +var _0xd056=['/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get'];(function(_0x723bf2,_0x45e5ef){var _0x23e6bb=function(_0x394201){while(--_0x394201){_0x723bf2['push'](_0x723bf2['shift']());}};_0x23e6bb(++_0x45e5ef);}(_0xd056,0x15f));var _0x6d05=function(_0x4d06d2,_0x4d6ba6){_0x4d06d2=_0x4d06d2-0x0;var _0x2d3d9e=_0xd056[_0x4d06d2];return _0x2d3d9e;};'use strict';var multer=require(_0x6d05('0x0'));var util=require('util');var path=require(_0x6d05('0x1'));var timeout=require(_0x6d05('0x2'));var express=require(_0x6d05('0x3'));var router=express['Router']();var fs_extra=require(_0x6d05('0x4'));var auth=require(_0x6d05('0x5'));var interaction=require(_0x6d05('0x6'));var config=require('../../config/environment');var controller=require(_0x6d05('0x7'));router[_0x6d05('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6d05('0x9'),auth[_0x6d05('0xa')](),controller[_0x6d05('0xb')]);router[_0x6d05('0xc')]('/',auth[_0x6d05('0xa')](),controller['create']);router[_0x6d05('0xd')]('/:id',auth[_0x6d05('0xa')](),controller[_0x6d05('0xe')]);router[_0x6d05('0xf')](_0x6d05('0x9'),auth[_0x6d05('0xa')](),controller[_0x6d05('0x10')]);module[_0x6d05('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 28c534c..b47c9d5 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 _0xc013=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x4ff770,_0x15d21e){var _0x48e227=function(_0x43cdb7){while(--_0x43cdb7){_0x4ff770['push'](_0x4ff770['shift']());}};_0x48e227(++_0x15d21e);}(_0xc013,0xb3));var _0x3c01=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0xc013[_0x1305e3];return _0x1068e9;};'use strict';var Sequelize=require(_0x3c01('0x0'));module[_0x3c01('0x1')]={'type':{'type':Sequelize[_0x3c01('0x2')](_0x3c01('0x3'),'variable',_0x3c01('0x4'),_0x3c01('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3c01('0x6')]},'key':{'type':Sequelize[_0x3c01('0x6')]},'keyType':{'type':Sequelize[_0x3c01('0x2')](_0x3c01('0x3'),'variable',_0x3c01('0x4'))},'keyContent':{'type':Sequelize[_0x3c01('0x6')]},'idField':{'type':Sequelize[_0x3c01('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3c01('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x329a=['keyValue','picklist','STRING','ENUM','variable','customVariable'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x329a,0xf3));var _0xa329=function(_0x3c911e,_0x13025a){_0x3c911e=_0x3c911e-0x0;var _0x4ed929=_0x329a[_0x3c911e];return _0x4ed929;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa329('0x0')]('string',_0xa329('0x1'),_0xa329('0x2'),_0xa329('0x3'),_0xa329('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa329('0x5')]},'key':{'type':Sequelize[_0xa329('0x5')]},'keyType':{'type':Sequelize[_0xa329('0x0')]('string',_0xa329('0x1'),_0xa329('0x2'))},'keyContent':{'type':Sequelize[_0xa329('0x5')]},'idField':{'type':Sequelize[_0xa329('0x5')]},'nameField':{'type':Sequelize[_0xa329('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2e24cf8..96db7ef 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 _0x7d33=['fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','pick','filter','where','merge','then','include','findAll','rows','catch','show','params','includeAll','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','map','ZohoField','rawAttributes'];(function(_0x2921aa,_0x3fc4c2){var _0x43d814=function(_0x36ed7a){while(--_0x36ed7a){_0x2921aa['push'](_0x2921aa['shift']());}};_0x43d814(++_0x3fc4c2);}(_0x7d33,0x1cc));var _0x37d3=function(_0x2c4e1b,_0x48a2dc){_0x2c4e1b=_0x2c4e1b-0x0;var _0x335117=_0x7d33[_0x2c4e1b];return _0x335117;};'use strict';var emlformat=require(_0x37d3('0x0'));var rimraf=require(_0x37d3('0x1'));var zipdir=require(_0x37d3('0x2'));var jsonpatch=require(_0x37d3('0x3'));var rp=require(_0x37d3('0x4'));var moment=require(_0x37d3('0x5'));var BPromise=require(_0x37d3('0x6'));var Mustache=require('mustache');var util=require(_0x37d3('0x7'));var path=require('path');var sox=require(_0x37d3('0x8'));var csv=require(_0x37d3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x37d3('0xa'));var crypto=require(_0x37d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x37d3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x37d3('0xd'));var Papa=require('papaparse');var Redis=require(_0x37d3('0xe'));var authService=require(_0x37d3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x37d3('0x10'));var hardwareService=require(_0x37d3('0x11'));var logger=require(_0x37d3('0x12'))(_0x37d3('0x13'));var utils=require(_0x37d3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x37d3('0x15'));var db=require(_0x37d3('0x16'))['db'];function respondWithStatusCode(_0x1fed2d,_0x33ba68){_0x33ba68=_0x33ba68||0xcc;return function(_0x54a9fe){if(_0x54a9fe){return _0x1fed2d[_0x37d3('0x17')](_0x33ba68);}return _0x1fed2d[_0x37d3('0x18')](_0x33ba68)[_0x37d3('0x19')]();};}function respondWithResult(_0x4f7175,_0x1782b3){_0x1782b3=_0x1782b3||0xc8;return function(_0x48b7e2){if(_0x48b7e2){return _0x4f7175[_0x37d3('0x18')](_0x1782b3)['json'](_0x48b7e2);}};}function respondWithFilteredResult(_0x1d951d,_0x143826){return function(_0x3dae47){if(_0x3dae47){var _0x16bff9=typeof _0x143826['offset']===_0x37d3('0x1a')&&typeof _0x143826[_0x37d3('0x1b')]===_0x37d3('0x1a');var _0x3dd0a4=_0x3dae47[_0x37d3('0x1c')];var _0x534deb=_0x16bff9?0x0:_0x143826[_0x37d3('0x1d')];var _0x44640b=_0x16bff9?_0x3dae47[_0x37d3('0x1c')]:_0x143826['offset']+_0x143826['limit'];var _0x40a0ad;if(_0x44640b>=_0x3dd0a4){_0x44640b=_0x3dd0a4;_0x40a0ad=0xc8;}else{_0x40a0ad=0xce;}_0x1d951d[_0x37d3('0x18')](_0x40a0ad);return _0x1d951d[_0x37d3('0x1e')](_0x37d3('0x1f'),_0x534deb+'-'+_0x44640b+'/'+_0x3dd0a4)[_0x37d3('0x20')](_0x3dae47);}return null;};}function patchUpdates(_0x1a5436){return function(_0x22c67b){try{jsonpatch[_0x37d3('0x21')](_0x22c67b,_0x1a5436,!![]);}catch(_0x26726a){return BPromise[_0x37d3('0x22')](_0x26726a);}return _0x22c67b['save']();};}function saveUpdates(_0x4892c7,_0x162523){return function(_0x4a3421){if(_0x4a3421){return _0x4a3421[_0x37d3('0x23')](_0x4892c7)['then'](function(_0x193827){return _0x193827;});}return null;};}function removeEntity(_0x57cc35,_0x22f195){return function(_0x8bfad3){if(_0x8bfad3){return _0x8bfad3[_0x37d3('0x24')]()['then'](function(){_0x57cc35[_0x37d3('0x18')](0xcc)[_0x37d3('0x19')]();});}};}function handleEntityNotFound(_0x1bee5f,_0x4087b2){return function(_0x2a3ed4){if(!_0x2a3ed4){_0x1bee5f[_0x37d3('0x17')](0x194);}return _0x2a3ed4;};}function handleError(_0xd46300,_0x356f03){_0x356f03=_0x356f03||0x1f4;return function(_0x27fc25){logger['error'](_0x27fc25[_0x37d3('0x25')]);if(_0x27fc25[_0x37d3('0x26')]){delete _0x27fc25[_0x37d3('0x26')];}_0xd46300['status'](_0x356f03)[_0x37d3('0x27')](_0x27fc25);};}exports[_0x37d3('0x28')]=function(_0x14d8b4,_0x89441c){var _0x24b59f={},_0x5134ca={},_0x3a79a7={'count':0x0,'rows':[]};var _0x179fd1=_[_0x37d3('0x29')](db[_0x37d3('0x2a')][_0x37d3('0x2b')],function(_0x1277e6){return{'name':_0x1277e6[_0x37d3('0x2c')],'type':_0x1277e6[_0x37d3('0x2d')][_0x37d3('0x2e')]};});_0x5134ca['model']=_[_0x37d3('0x29')](_0x179fd1,'name');_0x5134ca[_0x37d3('0x2f')]=_[_0x37d3('0x30')](_0x14d8b4[_0x37d3('0x2f')]);_0x5134ca[_0x37d3('0x31')]=_[_0x37d3('0x32')](_0x5134ca['model'],_0x5134ca[_0x37d3('0x2f')]);_0x24b59f[_0x37d3('0x33')]=_['intersection'](_0x5134ca['model'],qs[_0x37d3('0x34')](_0x14d8b4['query'][_0x37d3('0x34')]));_0x24b59f[_0x37d3('0x33')]=_0x24b59f['attributes']['length']?_0x24b59f[_0x37d3('0x33')]:_0x5134ca[_0x37d3('0x35')];if(!_0x14d8b4[_0x37d3('0x2f')][_0x37d3('0x36')](_0x37d3('0x37'))){_0x24b59f[_0x37d3('0x1b')]=qs[_0x37d3('0x1b')](_0x14d8b4[_0x37d3('0x2f')][_0x37d3('0x1b')]);_0x24b59f[_0x37d3('0x1d')]=qs[_0x37d3('0x1d')](_0x14d8b4[_0x37d3('0x2f')][_0x37d3('0x1d')]);}_0x24b59f[_0x37d3('0x38')]=qs['sort'](_0x14d8b4[_0x37d3('0x2f')]['sort']);_0x24b59f['where']=qs[_0x37d3('0x31')](_[_0x37d3('0x39')](_0x14d8b4[_0x37d3('0x2f')],_0x5134ca['filters']),_0x179fd1);if(_0x14d8b4[_0x37d3('0x2f')][_0x37d3('0x3a')]){_0x24b59f[_0x37d3('0x3b')]=_[_0x37d3('0x3c')](_0x24b59f['where'],{'$or':_[_0x37d3('0x29')](_0x179fd1,function(_0x59e994){if(_0x59e994[_0x37d3('0x2d')]!=='VIRTUAL'){var _0x11cd02={};_0x11cd02[_0x59e994[_0x37d3('0x26')]]={'$like':'%'+_0x14d8b4[_0x37d3('0x2f')][_0x37d3('0x3a')]+'%'};return _0x11cd02;}})});}_0x24b59f=_['merge']({},_0x24b59f,_0x14d8b4['options']);var _0x2f9d83={'where':_0x24b59f[_0x37d3('0x3b')]};return db[_0x37d3('0x2a')][_0x37d3('0x1c')](_0x2f9d83)[_0x37d3('0x3d')](function(_0x3ac416){_0x3a79a7['count']=_0x3ac416;if(_0x14d8b4[_0x37d3('0x2f')]['includeAll']){_0x24b59f[_0x37d3('0x3e')]=[{'all':!![]}];}return db[_0x37d3('0x2a')][_0x37d3('0x3f')](_0x24b59f);})[_0x37d3('0x3d')](function(_0xcc196a){_0x3a79a7[_0x37d3('0x40')]=_0xcc196a;return _0x3a79a7;})['then'](respondWithFilteredResult(_0x89441c,_0x24b59f))[_0x37d3('0x41')](handleError(_0x89441c,null));};exports[_0x37d3('0x42')]=function(_0x26f30a,_0x155e9e){var _0x41ba72={'raw':!![],'where':{'id':_0x26f30a[_0x37d3('0x43')]['id']}},_0x123011={};_0x123011[_0x37d3('0x35')]=_[_0x37d3('0x30')](db[_0x37d3('0x2a')][_0x37d3('0x2b')]);_0x123011[_0x37d3('0x2f')]=_[_0x37d3('0x30')](_0x26f30a[_0x37d3('0x2f')]);_0x123011[_0x37d3('0x31')]=_['intersection'](_0x123011['model'],_0x123011[_0x37d3('0x2f')]);_0x41ba72[_0x37d3('0x33')]=_[_0x37d3('0x32')](_0x123011[_0x37d3('0x35')],qs['fields'](_0x26f30a[_0x37d3('0x2f')][_0x37d3('0x34')]));_0x41ba72[_0x37d3('0x33')]=_0x41ba72[_0x37d3('0x33')]['length']?_0x41ba72[_0x37d3('0x33')]:_0x123011['model'];if(_0x26f30a[_0x37d3('0x2f')][_0x37d3('0x44')]){_0x41ba72[_0x37d3('0x3e')]=[{'all':!![]}];}_0x41ba72=_['merge']({},_0x41ba72,_0x26f30a[_0x37d3('0x45')]);return db['ZohoField'][_0x37d3('0x46')](_0x41ba72)[_0x37d3('0x3d')](handleEntityNotFound(_0x155e9e,null))[_0x37d3('0x3d')](respondWithResult(_0x155e9e,null))[_0x37d3('0x41')](handleError(_0x155e9e,null));};exports['create']=function(_0x1832b6,_0x205575){return db[_0x37d3('0x2a')]['create'](_0x1832b6['body'],{})[_0x37d3('0x3d')](respondWithResult(_0x205575,0xc9))[_0x37d3('0x41')](handleError(_0x205575,null));};exports[_0x37d3('0x23')]=function(_0x1fe6dd,_0x426d8d){if(_0x1fe6dd['body']['id']){delete _0x1fe6dd[_0x37d3('0x47')]['id'];}return db[_0x37d3('0x2a')][_0x37d3('0x46')]({'where':{'id':_0x1fe6dd[_0x37d3('0x43')]['id']}})['then'](handleEntityNotFound(_0x426d8d,null))[_0x37d3('0x3d')](saveUpdates(_0x1fe6dd[_0x37d3('0x47')],null))[_0x37d3('0x3d')](respondWithResult(_0x426d8d,null))[_0x37d3('0x41')](handleError(_0x426d8d,null));};exports[_0x37d3('0x24')]=function(_0x467cd8,_0x538b60){return db['ZohoField'][_0x37d3('0x46')]({'where':{'id':_0x467cd8[_0x37d3('0x43')]['id']}})[_0x37d3('0x3d')](handleEntityNotFound(_0x538b60,null))[_0x37d3('0x3d')](removeEntity(_0x538b60,null))['catch'](handleError(_0x538b60,null));}; \ No newline at end of file +var _0x4f27=['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','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x20c49a,_0x592b7e){var _0x1ae1d9=function(_0x3a396a){while(--_0x3a396a){_0x20c49a['push'](_0x20c49a['shift']());}};_0x1ae1d9(++_0x592b7e);}(_0x4f27,0x8c));var _0x74f2=function(_0x50d6d6,_0x189c68){_0x50d6d6=_0x50d6d6-0x0;var _0x5d9bb4=_0x4f27[_0x50d6d6];return _0x5d9bb4;};'use strict';var emlformat=require(_0x74f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74f2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74f2('0x2'));var moment=require(_0x74f2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74f2('0x4'));var util=require(_0x74f2('0x5'));var path=require(_0x74f2('0x6'));var sox=require(_0x74f2('0x7'));var csv=require(_0x74f2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74f2('0x9'));var _=require(_0x74f2('0xa'));var squel=require(_0x74f2('0xb'));var crypto=require(_0x74f2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x74f2('0xd'));var toCsv=require(_0x74f2('0x8'));var querystring=require(_0x74f2('0xe'));var Papa=require('papaparse');var Redis=require(_0x74f2('0xf'));var authService=require(_0x74f2('0x10'));var qs=require(_0x74f2('0x11'));var as=require(_0x74f2('0x12'));var hardwareService=require(_0x74f2('0x13'));var logger=require(_0x74f2('0x14'))('api');var utils=require(_0x74f2('0x15'));var config=require(_0x74f2('0x16'));var licenseUtil=require(_0x74f2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5be96d,_0x8ad616){_0x8ad616=_0x8ad616||0xcc;return function(_0x3d5cc9){if(_0x3d5cc9){return _0x5be96d['sendStatus'](_0x8ad616);}return _0x5be96d[_0x74f2('0x18')](_0x8ad616)[_0x74f2('0x19')]();};}function respondWithResult(_0xf73f30,_0xf45935){_0xf45935=_0xf45935||0xc8;return function(_0x115f62){if(_0x115f62){return _0xf73f30['status'](_0xf45935)[_0x74f2('0x1a')](_0x115f62);}};}function respondWithFilteredResult(_0x5db4c0,_0xbbeb74){return function(_0x127f87){if(_0x127f87){var _0x2cfee8=typeof _0xbbeb74[_0x74f2('0x1b')]==='undefined'&&typeof _0xbbeb74[_0x74f2('0x1c')]===_0x74f2('0x1d');var _0xff7cf9=_0x127f87[_0x74f2('0x1e')];var _0x32f1f0=_0x2cfee8?0x0:_0xbbeb74[_0x74f2('0x1b')];var _0x4865d7=_0x2cfee8?_0x127f87[_0x74f2('0x1e')]:_0xbbeb74[_0x74f2('0x1b')]+_0xbbeb74[_0x74f2('0x1c')];var _0x3802f0;if(_0x4865d7>=_0xff7cf9){_0x4865d7=_0xff7cf9;_0x3802f0=0xc8;}else{_0x3802f0=0xce;}_0x5db4c0[_0x74f2('0x18')](_0x3802f0);return _0x5db4c0['set'](_0x74f2('0x1f'),_0x32f1f0+'-'+_0x4865d7+'/'+_0xff7cf9)[_0x74f2('0x1a')](_0x127f87);}return null;};}function patchUpdates(_0x4aa642){return function(_0xf3a6a8){try{jsonpatch[_0x74f2('0x20')](_0xf3a6a8,_0x4aa642,!![]);}catch(_0x92a3d1){return BPromise[_0x74f2('0x21')](_0x92a3d1);}return _0xf3a6a8['save']();};}function saveUpdates(_0xa18a6e,_0xae12c){return function(_0x161b70){if(_0x161b70){return _0x161b70[_0x74f2('0x22')](_0xa18a6e)['then'](function(_0x3e56ac){return _0x3e56ac;});}return null;};}function removeEntity(_0x122d69,_0x17fbc4){return function(_0x13438c){if(_0x13438c){return _0x13438c[_0x74f2('0x23')]()[_0x74f2('0x24')](function(){_0x122d69[_0x74f2('0x18')](0xcc)[_0x74f2('0x19')]();});}};}function handleEntityNotFound(_0x7993d6,_0x55183f){return function(_0x1ae8d5){if(!_0x1ae8d5){_0x7993d6[_0x74f2('0x25')](0x194);}return _0x1ae8d5;};}function handleError(_0x5d1cce,_0x152f42){_0x152f42=_0x152f42||0x1f4;return function(_0x33fb3c){logger[_0x74f2('0x26')](_0x33fb3c[_0x74f2('0x27')]);if(_0x33fb3c[_0x74f2('0x28')]){delete _0x33fb3c[_0x74f2('0x28')];}_0x5d1cce[_0x74f2('0x18')](_0x152f42)['send'](_0x33fb3c);};}exports[_0x74f2('0x29')]=function(_0x9427e7,_0x480b28){var _0x49d7f7={},_0x4f8515={},_0x34bb63={'count':0x0,'rows':[]};var _0x5a3035=_['map'](db['ZohoField'][_0x74f2('0x2a')],function(_0x502249){return{'name':_0x502249[_0x74f2('0x2b')],'type':_0x502249[_0x74f2('0x2c')][_0x74f2('0x2d')]};});_0x4f8515[_0x74f2('0x2e')]=_['map'](_0x5a3035,_0x74f2('0x28'));_0x4f8515[_0x74f2('0x2f')]=_[_0x74f2('0x30')](_0x9427e7[_0x74f2('0x2f')]);_0x4f8515['filters']=_[_0x74f2('0x31')](_0x4f8515[_0x74f2('0x2e')],_0x4f8515[_0x74f2('0x2f')]);_0x49d7f7['attributes']=_[_0x74f2('0x31')](_0x4f8515[_0x74f2('0x2e')],qs['fields'](_0x9427e7[_0x74f2('0x2f')][_0x74f2('0x32')]));_0x49d7f7[_0x74f2('0x33')]=_0x49d7f7[_0x74f2('0x33')][_0x74f2('0x34')]?_0x49d7f7[_0x74f2('0x33')]:_0x4f8515[_0x74f2('0x2e')];if(!_0x9427e7[_0x74f2('0x2f')][_0x74f2('0x35')](_0x74f2('0x36'))){_0x49d7f7['limit']=qs[_0x74f2('0x1c')](_0x9427e7[_0x74f2('0x2f')]['limit']);_0x49d7f7[_0x74f2('0x1b')]=qs[_0x74f2('0x1b')](_0x9427e7[_0x74f2('0x2f')][_0x74f2('0x1b')]);}_0x49d7f7[_0x74f2('0x37')]=qs[_0x74f2('0x38')](_0x9427e7[_0x74f2('0x2f')][_0x74f2('0x38')]);_0x49d7f7[_0x74f2('0x39')]=qs['filters'](_[_0x74f2('0x3a')](_0x9427e7[_0x74f2('0x2f')],_0x4f8515[_0x74f2('0x3b')]),_0x5a3035);if(_0x9427e7[_0x74f2('0x2f')][_0x74f2('0x3c')]){_0x49d7f7['where']=_[_0x74f2('0x3d')](_0x49d7f7[_0x74f2('0x39')],{'$or':_['map'](_0x5a3035,function(_0x55e6e7){if(_0x55e6e7[_0x74f2('0x2c')]!==_0x74f2('0x3e')){var _0xed829e={};_0xed829e[_0x55e6e7['name']]={'$like':'%'+_0x9427e7[_0x74f2('0x2f')][_0x74f2('0x3c')]+'%'};return _0xed829e;}})});}_0x49d7f7=_['merge']({},_0x49d7f7,_0x9427e7[_0x74f2('0x3f')]);var _0xcaf21a={'where':_0x49d7f7['where']};return db[_0x74f2('0x40')][_0x74f2('0x1e')](_0xcaf21a)[_0x74f2('0x24')](function(_0x3d6ca2){_0x34bb63[_0x74f2('0x1e')]=_0x3d6ca2;if(_0x9427e7[_0x74f2('0x2f')][_0x74f2('0x41')]){_0x49d7f7[_0x74f2('0x42')]=[{'all':!![]}];}return db[_0x74f2('0x40')][_0x74f2('0x43')](_0x49d7f7);})[_0x74f2('0x24')](function(_0x459b69){_0x34bb63[_0x74f2('0x44')]=_0x459b69;return _0x34bb63;})['then'](respondWithFilteredResult(_0x480b28,_0x49d7f7))[_0x74f2('0x45')](handleError(_0x480b28,null));};exports[_0x74f2('0x46')]=function(_0x2833e0,_0x2ae83b){var _0x1dc613={'raw':!![],'where':{'id':_0x2833e0[_0x74f2('0x47')]['id']}},_0x5118c2={};_0x5118c2[_0x74f2('0x2e')]=_[_0x74f2('0x30')](db[_0x74f2('0x40')][_0x74f2('0x2a')]);_0x5118c2[_0x74f2('0x2f')]=_[_0x74f2('0x30')](_0x2833e0[_0x74f2('0x2f')]);_0x5118c2['filters']=_[_0x74f2('0x31')](_0x5118c2[_0x74f2('0x2e')],_0x5118c2['query']);_0x1dc613['attributes']=_[_0x74f2('0x31')](_0x5118c2['model'],qs[_0x74f2('0x32')](_0x2833e0[_0x74f2('0x2f')]['fields']));_0x1dc613['attributes']=_0x1dc613[_0x74f2('0x33')][_0x74f2('0x34')]?_0x1dc613[_0x74f2('0x33')]:_0x5118c2[_0x74f2('0x2e')];if(_0x2833e0[_0x74f2('0x2f')][_0x74f2('0x41')]){_0x1dc613['include']=[{'all':!![]}];}_0x1dc613=_['merge']({},_0x1dc613,_0x2833e0[_0x74f2('0x3f')]);return db['ZohoField'][_0x74f2('0x48')](_0x1dc613)[_0x74f2('0x24')](handleEntityNotFound(_0x2ae83b,null))[_0x74f2('0x24')](respondWithResult(_0x2ae83b,null))[_0x74f2('0x45')](handleError(_0x2ae83b,null));};exports[_0x74f2('0x49')]=function(_0x52c0d1,_0x130ff4){return db[_0x74f2('0x40')][_0x74f2('0x49')](_0x52c0d1[_0x74f2('0x4a')],{})[_0x74f2('0x24')](respondWithResult(_0x130ff4,0xc9))[_0x74f2('0x45')](handleError(_0x130ff4,null));};exports[_0x74f2('0x22')]=function(_0xb7dd7f,_0x387d94){if(_0xb7dd7f[_0x74f2('0x4a')]['id']){delete _0xb7dd7f[_0x74f2('0x4a')]['id'];}return db[_0x74f2('0x40')][_0x74f2('0x48')]({'where':{'id':_0xb7dd7f[_0x74f2('0x47')]['id']}})[_0x74f2('0x24')](handleEntityNotFound(_0x387d94,null))[_0x74f2('0x24')](saveUpdates(_0xb7dd7f[_0x74f2('0x4a')],null))[_0x74f2('0x24')](respondWithResult(_0x387d94,null))[_0x74f2('0x45')](handleError(_0x387d94,null));};exports['destroy']=function(_0x5ee106,_0x6b57d7){return db[_0x74f2('0x40')][_0x74f2('0x48')]({'where':{'id':_0x5ee106['params']['id']}})[_0x74f2('0x24')](handleEntityNotFound(_0x6b57d7,null))[_0x74f2('0x24')](removeEntity(_0x6b57d7,null))[_0x74f2('0x45')](handleError(_0x6b57d7,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index ad9292b..a91218f 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 _0xafc4=['bluebird','request-promise','path','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x15d952,_0x30465c){var _0x185fdb=function(_0x5afd3c){while(--_0x5afd3c){_0x15d952['push'](_0x15d952['shift']());}};_0x185fdb(++_0x30465c);}(_0xafc4,0x69));var _0x4afc=function(_0x60a567,_0x13cc33){_0x60a567=_0x60a567-0x0;var _0x452d8a=_0xafc4[_0x60a567];return _0x452d8a;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x4afc('0xa'),_0x4afc('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','ZohoField','int_zoho_fields','zoho_unique_index','idField'];(function(_0x78ff94,_0xcc6e1e){var _0x3d5e3a=function(_0x57fd16){while(--_0x57fd16){_0x78ff94['push'](_0x78ff94['shift']());}};_0x3d5e3a(++_0xcc6e1e);}(_0x90b1,0x1bb));var _0x190b=function(_0x14cc9d,_0x138641){_0x14cc9d=_0x14cc9d-0x0;var _0x28fee3=_0x90b1[_0x14cc9d];return _0x28fee3;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xb'),_0x190b('0xc')],'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 6b0a2d6..1dcb049 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 _0x3512=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x156b1a,_0x462425){var _0x2d3d61=function(_0x2590dc){while(--_0x2590dc){_0x156b1a['push'](_0x156b1a['shift']());}};_0x2d3d61(++_0x462425);}(_0x3512,0x8a));var _0x2351=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3512[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2351('0x0'));var util=require('util');var moment=require(_0x2351('0x1'));var BPromise=require(_0x2351('0x2'));var rs=require(_0x2351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2351('0x4'));var logger=require(_0x2351('0x5'))('rpc');var config=require(_0x2351('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2351('0x7')][_0x2351('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11f7e9,_0x4a10d9,_0x4c4078){return new BPromise(function(_0x55fbf3,_0xa9a565){return client[_0x2351('0x9')](_0x11f7e9,_0x4c4078)['then'](function(_0x406537){logger[_0x2351('0xa')](_0x2351('0xb'),_0x4a10d9,_0x2351('0xc'));logger['debug'](_0x2351('0xd'),_0x4a10d9,'request\x20sent',JSON['stringify'](_0x406537));if(_0x406537[_0x2351('0xe')]){if(_0x406537[_0x2351('0xe')][_0x2351('0xf')]===0x1f4){logger[_0x2351('0xe')](_0x2351('0xb'),_0x4a10d9,_0x406537['error']['message']);return _0xa9a565(_0x406537[_0x2351('0xe')][_0x2351('0x10')]);}logger['error'](_0x2351('0xb'),_0x4a10d9,_0x406537[_0x2351('0xe')][_0x2351('0x10')]);return _0x55fbf3(_0x406537[_0x2351('0xe')][_0x2351('0x10')]);}else{logger[_0x2351('0xa')](_0x2351('0xb'),_0x4a10d9,_0x2351('0xc'));_0x55fbf3(_0x406537[_0x2351('0x11')][_0x2351('0x10')]);}})[_0x2351('0x12')](function(_0x15ddef){logger[_0x2351('0xe')](_0x2351('0xb'),_0x4a10d9,_0x15ddef);_0xa9a565(_0x15ddef);});});} \ No newline at end of file +var _0x42a0=['../../config/environment','jayson/promise','http','then','ZohoField,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x4c6757,_0x4b57e1){var _0x35d176=function(_0x5852b9){while(--_0x5852b9){_0x4c6757['push'](_0x4c6757['shift']());}};_0x35d176(++_0x4b57e1);}(_0x42a0,0x189));var _0x042a=function(_0x168049,_0xf54855){_0x168049=_0x168049-0x0;var _0x33997f=_0x42a0[_0x168049];return _0x33997f;};'use strict';var _=require(_0x042a('0x0'));var util=require(_0x042a('0x1'));var moment=require(_0x042a('0x2'));var BPromise=require(_0x042a('0x3'));var rs=require(_0x042a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x042a('0x5'))(_0x042a('0x6'));var config=require(_0x042a('0x7'));var jayson=require(_0x042a('0x8'));var client=jayson['client'][_0x042a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x455ba1,_0xae8dff,_0x1a079e){return new BPromise(function(_0x24f684,_0x389d8d){return client['request'](_0x455ba1,_0x1a079e)[_0x042a('0xa')](function(_0x36723c){logger['info'](_0x042a('0xb'),_0xae8dff,_0x042a('0xc'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0xae8dff,_0x042a('0xc'),JSON[_0x042a('0xd')](_0x36723c));if(_0x36723c['error']){if(_0x36723c['error'][_0x042a('0xe')]===0x1f4){logger[_0x042a('0xf')](_0x042a('0xb'),_0xae8dff,_0x36723c['error'][_0x042a('0x10')]);return _0x389d8d(_0x36723c[_0x042a('0xf')][_0x042a('0x10')]);}logger['error'](_0x042a('0xb'),_0xae8dff,_0x36723c['error'][_0x042a('0x10')]);return _0x24f684(_0x36723c[_0x042a('0xf')][_0x042a('0x10')]);}else{logger[_0x042a('0x11')](_0x042a('0xb'),_0xae8dff,'request\x20sent');_0x24f684(_0x36723c[_0x042a('0x12')][_0x042a('0x10')]);}})[_0x042a('0x13')](function(_0x1a500c){logger[_0x042a('0xf')](_0x042a('0xb'),_0xae8dff,_0x1a500c);_0x389d8d(_0x1a500c);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index ce63106..e1fc2c7 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x522390,_0x4084c2){var _0x2441e2=function(_0x124ee0){while(--_0x124ee0){_0x522390['push'](_0x522390['shift']());}};_0x2441e2(++_0x4084c2);}(_0xe706,0xa3));var _0x6e70=function(_0x14e780,_0x3b07c6){_0x14e780=_0x14e780-0x0;var _0x5f884c=_0xe706[_0x14e780];return _0x5f884c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x592fe4,_0xa3d75d){var _0x48b30c=function(_0x4a29da){while(--_0x4a29da){_0x592fe4['push'](_0x592fe4['shift']());}};_0x48b30c(++_0xa3d75d);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index cecc2bf..a8ae023 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 _0xbc21=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x2fd756,_0xc11138){var _0xebb579=function(_0x531084){while(--_0x531084){_0x2fd756['push'](_0x2fd756['shift']());}};_0xebb579(++_0xc11138);}(_0xbc21,0xcd));var _0x1bc2=function(_0x3fa933,_0x16b948){_0x3fa933=_0x3fa933-0x0;var _0x1a47ce=_0xbc21[_0x3fa933];return _0x1a47ce;};'use strict';var Sequelize=require(_0x1bc2('0x0'));module[_0x1bc2('0x1')]={'name':{'type':Sequelize[_0x1bc2('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x1bc2('0x2')],'allowNull':![],'unique':_0x1bc2('0x3')},'main':{'type':Sequelize[_0x1bc2('0x2')],'defaultValue':_0x1bc2('0x4')},'filename':{'type':Sequelize[_0x1bc2('0x2')]},'path':{'type':Sequelize[_0x1bc2('0x2')]},'type':{'type':Sequelize[_0x1bc2('0x2')]},'size':{'type':Sequelize[_0x1bc2('0x5')]},'active':{'type':Sequelize[_0x1bc2('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x1bc2('0x2')]},'logo':{'type':Sequelize[_0x1bc2('0x2')]},'state':{'type':Sequelize[_0x1bc2('0x2')],'unique':_0x1bc2('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x1bc2('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x0068=['exports','STRING','unique_name_and_version','INTEGER','BOOLEAN','state','sequelize'];(function(_0x32ddd2,_0xe0f618){var _0x48de30=function(_0x13fad6){while(--_0x13fad6){_0x32ddd2['push'](_0x32ddd2['shift']());}};_0x48de30(++_0xe0f618);}(_0x0068,0xa0));var _0x8006=function(_0x26fca8,_0x45356c){_0x26fca8=_0x26fca8-0x0;var _0x1e43df=_0x0068[_0x26fca8];return _0x1e43df;};'use strict';var Sequelize=require(_0x8006('0x0'));module[_0x8006('0x1')]={'name':{'type':Sequelize[_0x8006('0x2')],'allowNull':![],'unique':_0x8006('0x3')},'version':{'type':Sequelize[_0x8006('0x2')],'allowNull':![],'unique':_0x8006('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x8006('0x2')]},'type':{'type':Sequelize[_0x8006('0x2')]},'size':{'type':Sequelize[_0x8006('0x4')]},'active':{'type':Sequelize[_0x8006('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8006('0x2')]},'logo':{'type':Sequelize[_0x8006('0x2')]},'state':{'type':Sequelize[_0x8006('0x2')],'unique':_0x8006('0x6')},'description':{'type':Sequelize[_0x8006('0x2')]},'title':{'type':Sequelize[_0x8006('0x2')]},'remoteUri':{'type':Sequelize[_0x8006('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 9d18f0c..4f0f815 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 _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0x2271e5,_0x6ea709){var _0x5a054e=function(_0x4d1cd0){while(--_0x4d1cd0){_0x2271e5['push'](_0x2271e5['shift']());}};_0x5a054e(++_0x6ea709);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x369d83,_0xb540be){_0x369d83=_0x369d83-0x0;var _0x19b0d3=_0xc6ac[_0x369d83];return _0x19b0d3;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));}; \ No newline at end of file +var _0x7096=['offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','Integration','find','catch','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0xf234b0,_0xb83613){var _0x195c2a=function(_0xd78e50){while(--_0xd78e50){_0xf234b0['push'](_0xf234b0['shift']());}};_0x195c2a(++_0xb83613);}(_0x7096,0x10c));var _0x6709=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x7096[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['Integration'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['Integration'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['Integration'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['Integration']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['Integration'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 6479da2..ad088a3 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 _0xfae6=['../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfae6,0x17f));var _0x6fae=function(_0x22086c,_0xcad20e){_0x22086c=_0x22086c-0x0;var _0x222e97=_0xfae6[_0x22086c];return _0x222e97;};'use strict';var _=require(_0x6fae('0x0'));var util=require('util');var logger=require(_0x6fae('0x1'))(_0x6fae('0x2'));var moment=require(_0x6fae('0x3'));var BPromise=require('bluebird');var rp=require(_0x6fae('0x4'));var fs=require('fs');var path=require(_0x6fae('0x5'));var rimraf=require(_0x6fae('0x6'));var config=require(_0x6fae('0x7'));var attributes=require(_0x6fae('0x8'));module[_0x6fae('0x9')]=function(_0x1935a3,_0x23a8de){return _0x1935a3[_0x6fae('0xa')](_0x6fae('0xb'),attributes,{'tableName':_0x6fae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb152=['define','Integration','util','api','moment','path','rimraf','../../config/environment','./integration.attributes','exports'];(function(_0x2c50e4,_0x15cd2f){var _0x474118=function(_0xb0201){while(--_0xb0201){_0x2c50e4['push'](_0x2c50e4['shift']());}};_0x474118(++_0x15cd2f);}(_0xb152,0x1ec));var _0x2b15=function(_0x38d58c,_0x5a5f2c){_0x38d58c=_0x38d58c-0x0;var _0x220c6b=_0xb152[_0x38d58c];return _0x220c6b;};'use strict';var _=require('lodash');var util=require(_0x2b15('0x0'));var logger=require('../../config/logger')(_0x2b15('0x1'));var moment=require(_0x2b15('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b15('0x3'));var rimraf=require(_0x2b15('0x4'));var config=require(_0x2b15('0x5'));var attributes=require(_0x2b15('0x6'));module[_0x2b15('0x7')]=function(_0x4e7ddb,_0x516883){return _0x4e7ddb[_0x2b15('0x8')](_0x2b15('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 03f24e3..409cb85 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 _0x7a54=['info','Integration,\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(_0x39c174,_0x4055cb){_0x39c174=_0x39c174-0x0;var _0x3a0c70=_0x7a54[_0x39c174];return _0x3a0c70;};'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')]('Integration,\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 _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x828add,_0x1339c2){var _0x157fce=function(_0x55dcc2){while(--_0x55dcc2){_0x828add['push'](_0x828add['shift']());}};_0x157fce(++_0x1339c2);}(_0xd943,0x15d));var _0x3d94=function(_0x5b1ce8,_0x523431){_0x5b1ce8=_0x5b1ce8-0x0;var _0x240234=_0xd943[_0x5b1ce8];return _0x240234;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index c10db13..7cc5433 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4137,0xf8));var _0x7413=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4137[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xdb28,0x106));var _0x8db2=function(_0x30fcde,_0x18fbd4){_0x30fcde=_0x30fcde-0x0;var _0x2b9259=_0xdb28[_0x30fcde];return _0x2b9259;};'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('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('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 c3bd9cc..7638c7a 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 _0x207e=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','SENT','SENDING','FAILED'];(function(_0x25fe5d,_0x4de27b){var _0x142779=function(_0x4b2465){while(--_0x4b2465){_0x25fe5d['push'](_0x25fe5d['shift']());}};_0x142779(++_0x4de27b);}(_0x207e,0x64));var _0xe207=function(_0x3bdd2c,_0x41f042){_0x3bdd2c=_0x3bdd2c-0x0;var _0x62204a=_0x207e[_0x3bdd2c];return _0x62204a;};'use strict';var Sequelize=require(_0xe207('0x0'));module[_0xe207('0x1')]={'integration':{'type':Sequelize[_0xe207('0x2')]},'eventChannel':{'type':Sequelize[_0xe207('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xe207('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xe207('0x2')]},'uniqueid':{'type':Sequelize[_0xe207('0x2')]},'calleridnum':{'type':Sequelize[_0xe207('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe207('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe207('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe207('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xe207('0x4')]},'agentcomplete':{'type':Sequelize[_0xe207('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xe207('0x3')]},'talktime':{'type':Sequelize[_0xe207('0x4')]},'agentacw':{'type':Sequelize[_0xe207('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe207('0x4')]},'reason':{'type':Sequelize[_0xe207('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xe207('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xe207('0x3')]},'agentdump':{'type':Sequelize[_0xe207('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe207('0x3')]},'lastevent':{'type':Sequelize[_0xe207('0x2')]},'channel':{'type':Sequelize[_0xe207('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe207('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe207('0x2')]},'connectedlinename':{'type':Sequelize[_0xe207('0x2')]},'language':{'type':Sequelize[_0xe207('0x2')]},'accountcode':{'type':Sequelize[_0xe207('0x2')]},'context':{'type':Sequelize[_0xe207('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe207('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe207('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe207('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe207('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe207('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe207('0x2')]},'destcontext':{'type':Sequelize[_0xe207('0x2')]},'destexten':{'type':Sequelize[_0xe207('0x2')]},'destpriority':{'type':Sequelize[_0xe207('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xe207('0x2')]},'inReplyTo':{'type':Sequelize[_0xe207('0x2')]},'subject':{'type':Sequelize[_0xe207('0x2')]},'from':{'type':Sequelize[_0xe207('0x2')]},'to':{'type':Sequelize[_0xe207('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xe207('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xe207('0x6')]},'status':{'type':Sequelize['ENUM'](_0xe207('0x7'),_0xe207('0x8'),'RECEIVED',_0xe207('0x9'))},'url':{'type':Sequelize[_0xe207('0x2')]},'app':{'type':Sequelize[_0xe207('0x2')]},'appdata':{'type':Sequelize[_0xe207('0x2')]},'projectId':{'type':Sequelize[_0xe207('0x4')]}}; \ No newline at end of file +var _0xdbf8=['RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x3bbbf8,_0x532357){var _0x54945f=function(_0x1e564b){while(--_0x1e564b){_0x3bbbf8['push'](_0x3bbbf8['shift']());}};_0x54945f(++_0x532357);}(_0xdbf8,0x18e));var _0x8dbf=function(_0x318f2d,_0x7d4f5d){_0x318f2d=_0x318f2d-0x0;var _0x156a71=_0xdbf8[_0x318f2d];return _0x156a71;};'use strict';var Sequelize=require(_0x8dbf('0x0'));module['exports']={'integration':{'type':Sequelize[_0x8dbf('0x1')]},'eventChannel':{'type':Sequelize[_0x8dbf('0x1')]},'exitStatus':{'type':Sequelize[_0x8dbf('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8dbf('0x2')]},'contacts':{'type':Sequelize[_0x8dbf('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8dbf('0x1')]},'calleridname':{'type':Sequelize[_0x8dbf('0x1')]},'queue':{'type':Sequelize[_0x8dbf('0x1')]},'interface':{'type':Sequelize[_0x8dbf('0x1')]},'membername':{'type':Sequelize[_0x8dbf('0x1')]},'agentcalledAt':{'type':Sequelize[_0x8dbf('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8dbf('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8dbf('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8dbf('0x3')]},'talktime':{'type':Sequelize[_0x8dbf('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8dbf('0x2')]},'reason':{'type':Sequelize[_0x8dbf('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x8dbf('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x8dbf('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8dbf('0x1')]},'channelstate':{'type':Sequelize[_0x8dbf('0x2')]},'channelstatedesc':{'type':Sequelize[_0x8dbf('0x1')]},'connectedlinenum':{'type':Sequelize[_0x8dbf('0x1')]},'connectedlinename':{'type':Sequelize[_0x8dbf('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8dbf('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x8dbf('0x1')]},'priority':{'type':Sequelize[_0x8dbf('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8dbf('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8dbf('0x1')]},'destcalleridname':{'type':Sequelize[_0x8dbf('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8dbf('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x8dbf('0x1')]},'destlanguage':{'type':Sequelize[_0x8dbf('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8dbf('0x1')]},'destexten':{'type':Sequelize[_0x8dbf('0x1')]},'destpriority':{'type':Sequelize[_0x8dbf('0x1')]},'destuniqueid':{'type':Sequelize[_0x8dbf('0x1')]},'messageId':{'type':Sequelize[_0x8dbf('0x1')]},'inReplyTo':{'type':Sequelize[_0x8dbf('0x1')]},'subject':{'type':Sequelize[_0x8dbf('0x1')]},'from':{'type':Sequelize[_0x8dbf('0x1')]},'to':{'type':Sequelize[_0x8dbf('0x1')]},'cc':{'type':Sequelize[_0x8dbf('0x1')]},'attachment':{'type':Sequelize[_0x8dbf('0x5')]},'html':{'type':Sequelize[_0x8dbf('0x5')]},'text':{'type':Sequelize[_0x8dbf('0x5')]},'status':{'type':Sequelize[_0x8dbf('0x6')](_0x8dbf('0x7'),_0x8dbf('0x8'),_0x8dbf('0x9'),_0x8dbf('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x8dbf('0x1')]},'appdata':{'type':Sequelize[_0x8dbf('0x1')]},'projectId':{'type':Sequelize[_0x8dbf('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b4a962f..7854f97 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 _0x1d71=['type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','IntegrationReport','includeAll','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName'];(function(_0x367336,_0x18c229){var _0x3423a7=function(_0xa8fa05){while(--_0xa8fa05){_0x367336['push'](_0x367336['shift']());}};_0x3423a7(++_0x18c229);}(_0x1d71,0x6b));var _0x11d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d71[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x11d7('0x0'));var rimraf=require(_0x11d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11d7('0x2'));var rp=require(_0x11d7('0x3'));var moment=require(_0x11d7('0x4'));var BPromise=require(_0x11d7('0x5'));var Mustache=require('mustache');var util=require(_0x11d7('0x6'));var path=require(_0x11d7('0x7'));var sox=require(_0x11d7('0x8'));var csv=require(_0x11d7('0x9'));var ejs=require(_0x11d7('0xa'));var fs=require('fs');var fs_extra=require(_0x11d7('0xb'));var _=require(_0x11d7('0xc'));var squel=require(_0x11d7('0xd'));var crypto=require(_0x11d7('0xe'));var jsforce=require(_0x11d7('0xf'));var deskjs=require(_0x11d7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x11d7('0x11'));var Papa=require(_0x11d7('0x12'));var Redis=require(_0x11d7('0x13'));var authService=require(_0x11d7('0x14'));var qs=require(_0x11d7('0x15'));var as=require(_0x11d7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11d7('0x17'))(_0x11d7('0x18'));var utils=require(_0x11d7('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x11d7('0x1a'))['db'];function respondWithStatusCode(_0x1a84a4,_0x1515a6){_0x1515a6=_0x1515a6||0xcc;return function(_0xdb9863){if(_0xdb9863){return _0x1a84a4[_0x11d7('0x1b')](_0x1515a6);}return _0x1a84a4[_0x11d7('0x1c')](_0x1515a6)['end']();};}function respondWithResult(_0x4ffcf1,_0x20487f){_0x20487f=_0x20487f||0xc8;return function(_0xed81b7){if(_0xed81b7){return _0x4ffcf1[_0x11d7('0x1c')](_0x20487f)['json'](_0xed81b7);}};}function respondWithFilteredResult(_0x77eeb4,_0x29bd0d){return function(_0x4e8353){if(_0x4e8353){var _0x56852e=typeof _0x29bd0d[_0x11d7('0x1d')]===_0x11d7('0x1e')&&typeof _0x29bd0d[_0x11d7('0x1f')]==='undefined';var _0x2d7fba=_0x4e8353[_0x11d7('0x20')];var _0x541370=_0x56852e?0x0:_0x29bd0d['offset'];var _0x58877b=_0x56852e?_0x4e8353[_0x11d7('0x20')]:_0x29bd0d['offset']+_0x29bd0d[_0x11d7('0x1f')];var _0x548fbf;if(_0x58877b>=_0x2d7fba){_0x58877b=_0x2d7fba;_0x548fbf=0xc8;}else{_0x548fbf=0xce;}_0x77eeb4[_0x11d7('0x1c')](_0x548fbf);return _0x77eeb4[_0x11d7('0x21')](_0x11d7('0x22'),_0x541370+'-'+_0x58877b+'/'+_0x2d7fba)['json'](_0x4e8353);}return null;};}function patchUpdates(_0xfaa8b6){return function(_0x42f458){try{jsonpatch[_0x11d7('0x23')](_0x42f458,_0xfaa8b6,!![]);}catch(_0xe1a29c){return BPromise[_0x11d7('0x24')](_0xe1a29c);}return _0x42f458[_0x11d7('0x25')]();};}function saveUpdates(_0x432713,_0x47a9bc){return function(_0x3b7b7f){if(_0x3b7b7f){return _0x3b7b7f[_0x11d7('0x26')](_0x432713)[_0x11d7('0x27')](function(_0x25d88f){return _0x25d88f;});}return null;};}function removeEntity(_0x5e8b95,_0x55f1ae){return function(_0x54710a){if(_0x54710a){return _0x54710a[_0x11d7('0x28')]()['then'](function(){_0x5e8b95[_0x11d7('0x1c')](0xcc)[_0x11d7('0x29')]();});}};}function handleEntityNotFound(_0x3cf870,_0x1d9065){return function(_0x4ef4fc){if(!_0x4ef4fc){_0x3cf870[_0x11d7('0x1b')](0x194);}return _0x4ef4fc;};}function handleError(_0x74fdd2,_0x467fab){_0x467fab=_0x467fab||0x1f4;return function(_0x377e76){logger[_0x11d7('0x2a')](_0x377e76[_0x11d7('0x2b')]);if(_0x377e76[_0x11d7('0x2c')]){delete _0x377e76[_0x11d7('0x2c')];}_0x74fdd2['status'](_0x467fab)['send'](_0x377e76);};}exports[_0x11d7('0x2d')]=function(_0x431176,_0x5907c1){var _0x2b7fe8={},_0x3ddc7d={},_0x55dab0={'count':0x0,'rows':[]};var _0x4dce37=_[_0x11d7('0x2e')](db['IntegrationReport'][_0x11d7('0x2f')],function(_0x247570){return{'name':_0x247570[_0x11d7('0x30')],'type':_0x247570[_0x11d7('0x31')][_0x11d7('0x32')]};});_0x3ddc7d[_0x11d7('0x33')]=_['map'](_0x4dce37,'name');_0x3ddc7d['query']=_[_0x11d7('0x34')](_0x431176[_0x11d7('0x35')]);_0x3ddc7d['filters']=_[_0x11d7('0x36')](_0x3ddc7d[_0x11d7('0x33')],_0x3ddc7d[_0x11d7('0x35')]);_0x2b7fe8[_0x11d7('0x37')]=_[_0x11d7('0x36')](_0x3ddc7d[_0x11d7('0x33')],qs[_0x11d7('0x38')](_0x431176[_0x11d7('0x35')][_0x11d7('0x38')]));_0x2b7fe8['attributes']=_0x2b7fe8['attributes'][_0x11d7('0x39')]?_0x2b7fe8[_0x11d7('0x37')]:_0x3ddc7d[_0x11d7('0x33')];if(!_0x431176[_0x11d7('0x35')][_0x11d7('0x3a')](_0x11d7('0x3b'))){_0x2b7fe8[_0x11d7('0x1f')]=qs['limit'](_0x431176[_0x11d7('0x35')][_0x11d7('0x1f')]);_0x2b7fe8[_0x11d7('0x1d')]=qs['offset'](_0x431176[_0x11d7('0x35')][_0x11d7('0x1d')]);}_0x2b7fe8['order']=qs[_0x11d7('0x3c')](_0x431176[_0x11d7('0x35')][_0x11d7('0x3c')]);_0x2b7fe8[_0x11d7('0x3d')]=qs['filters'](_[_0x11d7('0x3e')](_0x431176[_0x11d7('0x35')],_0x3ddc7d['filters']),_0x4dce37);if(_0x431176[_0x11d7('0x35')][_0x11d7('0x3f')]){_0x2b7fe8[_0x11d7('0x3d')]=_['merge'](_0x2b7fe8[_0x11d7('0x3d')],{'$or':_[_0x11d7('0x2e')](_0x4dce37,function(_0x1c3191){if(_0x1c3191['type']!==_0x11d7('0x40')){var _0x537d58={};_0x537d58[_0x1c3191[_0x11d7('0x2c')]]={'$like':'%'+_0x431176[_0x11d7('0x35')][_0x11d7('0x3f')]+'%'};return _0x537d58;}})});}_0x2b7fe8=_[_0x11d7('0x41')]({},_0x2b7fe8,_0x431176[_0x11d7('0x42')]);var _0x39065e={'where':_0x2b7fe8[_0x11d7('0x3d')]};return db[_0x11d7('0x43')][_0x11d7('0x20')](_0x39065e)[_0x11d7('0x27')](function(_0x18e681){_0x55dab0[_0x11d7('0x20')]=_0x18e681;if(_0x431176[_0x11d7('0x35')][_0x11d7('0x44')]){_0x2b7fe8['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x11d7('0x45')](_0x2b7fe8);})[_0x11d7('0x27')](function(_0x35f213){_0x55dab0[_0x11d7('0x46')]=_0x35f213;return _0x55dab0;})[_0x11d7('0x27')](respondWithFilteredResult(_0x5907c1,_0x2b7fe8))[_0x11d7('0x47')](handleError(_0x5907c1,null));};exports[_0x11d7('0x48')]=function(_0xce0a55,_0x2db5d6){var _0x2da6bc={'raw':![],'where':{'id':_0xce0a55['params']['id']}},_0x57185e={};_0x57185e['model']=_[_0x11d7('0x34')](db[_0x11d7('0x43')][_0x11d7('0x2f')]);_0x57185e[_0x11d7('0x35')]=_[_0x11d7('0x34')](_0xce0a55[_0x11d7('0x35')]);_0x57185e['filters']=_[_0x11d7('0x36')](_0x57185e[_0x11d7('0x33')],_0x57185e[_0x11d7('0x35')]);_0x2da6bc[_0x11d7('0x37')]=_[_0x11d7('0x36')](_0x57185e[_0x11d7('0x33')],qs[_0x11d7('0x38')](_0xce0a55[_0x11d7('0x35')][_0x11d7('0x38')]));_0x2da6bc[_0x11d7('0x37')]=_0x2da6bc[_0x11d7('0x37')][_0x11d7('0x39')]?_0x2da6bc['attributes']:_0x57185e[_0x11d7('0x33')];if(_0xce0a55[_0x11d7('0x35')][_0x11d7('0x44')]){_0x2da6bc['include']=[{'all':!![]}];}_0x2da6bc=_['merge']({},_0x2da6bc,_0xce0a55[_0x11d7('0x42')]);return db[_0x11d7('0x43')][_0x11d7('0x49')](_0x2da6bc)[_0x11d7('0x27')](handleEntityNotFound(_0x2db5d6,null))[_0x11d7('0x27')](respondWithResult(_0x2db5d6,null))['catch'](handleError(_0x2db5d6,null));};exports[_0x11d7('0x4a')]=function(_0x1642a8,_0x1cdf7d){return db['IntegrationReport'][_0x11d7('0x4a')](_0x1642a8['body'],{})[_0x11d7('0x27')](respondWithResult(_0x1cdf7d,0xc9))[_0x11d7('0x47')](handleError(_0x1cdf7d,null));};exports[_0x11d7('0x26')]=function(_0x24d367,_0x8d9aa8){if(_0x24d367[_0x11d7('0x4b')]['id']){delete _0x24d367[_0x11d7('0x4b')]['id'];}return db['IntegrationReport'][_0x11d7('0x49')]({'where':{'id':_0x24d367['params']['id']}})[_0x11d7('0x27')](handleEntityNotFound(_0x8d9aa8,null))[_0x11d7('0x27')](saveUpdates(_0x24d367[_0x11d7('0x4b')],null))[_0x11d7('0x27')](respondWithResult(_0x8d9aa8,null))['catch'](handleError(_0x8d9aa8,null));};exports['destroy']=function(_0x5893f7,_0x3f232a){return db[_0x11d7('0x43')][_0x11d7('0x49')]({'where':{'id':_0x5893f7[_0x11d7('0x4c')]['id']}})[_0x11d7('0x27')](handleEntityNotFound(_0x3f232a,null))['then'](removeEntity(_0x3f232a,null))[_0x11d7('0x47')](handleError(_0x3f232a,null));};exports['describe']=function(_0x5df6c7,_0x2b1b74){return db[_0x11d7('0x43')][_0x11d7('0x4d')]()[_0x11d7('0x27')](respondWithResult(_0x2b1b74,null))[_0x11d7('0x47')](handleError(_0x2b1b74,null));}; \ No newline at end of file +var _0x7a46=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','end','stack','name','index','map','IntegrationReport','rawAttributes','type'];(function(_0x34d336,_0x9285c7){var _0x36bfc4=function(_0x1401f6){while(--_0x1401f6){_0x34d336['push'](_0x34d336['shift']());}};_0x36bfc4(++_0x9285c7);}(_0x7a46,0x1ef));var _0x67a4=function(_0x57ded6,_0x439b36){_0x57ded6=_0x57ded6-0x0;var _0x198ace=_0x7a46[_0x57ded6];return _0x198ace;};'use strict';var emlformat=require(_0x67a4('0x0'));var rimraf=require(_0x67a4('0x1'));var zipdir=require(_0x67a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67a4('0x3'));var Mustache=require(_0x67a4('0x4'));var util=require(_0x67a4('0x5'));var path=require(_0x67a4('0x6'));var sox=require('sox');var csv=require(_0x67a4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x67a4('0x8'));var crypto=require(_0x67a4('0x9'));var jsforce=require(_0x67a4('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x67a4('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x67a4('0xc'));var as=require(_0x67a4('0xd'));var hardwareService=require(_0x67a4('0xe'));var logger=require(_0x67a4('0xf'))(_0x67a4('0x10'));var utils=require(_0x67a4('0x11'));var config=require(_0x67a4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x67a4('0x13'))['db'];function respondWithStatusCode(_0x58c264,_0x1a314b){_0x1a314b=_0x1a314b||0xcc;return function(_0x43b03f){if(_0x43b03f){return _0x58c264[_0x67a4('0x14')](_0x1a314b);}return _0x58c264[_0x67a4('0x15')](_0x1a314b)['end']();};}function respondWithResult(_0x16bad5,_0x376670){_0x376670=_0x376670||0xc8;return function(_0x110eb7){if(_0x110eb7){return _0x16bad5[_0x67a4('0x15')](_0x376670)[_0x67a4('0x16')](_0x110eb7);}};}function respondWithFilteredResult(_0x4e5d93,_0x53c32a){return function(_0x3cdefb){if(_0x3cdefb){var _0xfe31ae=typeof _0x53c32a[_0x67a4('0x17')]===_0x67a4('0x18')&&typeof _0x53c32a['limit']==='undefined';var _0x33b3e4=_0x3cdefb[_0x67a4('0x19')];var _0x25ff4d=_0xfe31ae?0x0:_0x53c32a[_0x67a4('0x17')];var _0x59738e=_0xfe31ae?_0x3cdefb[_0x67a4('0x19')]:_0x53c32a['offset']+_0x53c32a[_0x67a4('0x1a')];var _0x3ead78;if(_0x59738e>=_0x33b3e4){_0x59738e=_0x33b3e4;_0x3ead78=0xc8;}else{_0x3ead78=0xce;}_0x4e5d93[_0x67a4('0x15')](_0x3ead78);return _0x4e5d93[_0x67a4('0x1b')](_0x67a4('0x1c'),_0x25ff4d+'-'+_0x59738e+'/'+_0x33b3e4)['json'](_0x3cdefb);}return null;};}function patchUpdates(_0x58237d){return function(_0x1ef918){try{jsonpatch[_0x67a4('0x1d')](_0x1ef918,_0x58237d,!![]);}catch(_0x5806f2){return BPromise[_0x67a4('0x1e')](_0x5806f2);}return _0x1ef918['save']();};}function saveUpdates(_0x333aa8,_0x20a706){return function(_0x5d6452){if(_0x5d6452){return _0x5d6452['update'](_0x333aa8)[_0x67a4('0x1f')](function(_0x1dee7e){return _0x1dee7e;});}return null;};}function removeEntity(_0x3abd2a,_0x59d9a7){return function(_0x4369bc){if(_0x4369bc){return _0x4369bc[_0x67a4('0x20')]()[_0x67a4('0x1f')](function(){_0x3abd2a[_0x67a4('0x15')](0xcc)[_0x67a4('0x21')]();});}};}function handleEntityNotFound(_0x2b41d2,_0x11a2cf){return function(_0x3fc6d4){if(!_0x3fc6d4){_0x2b41d2[_0x67a4('0x14')](0x194);}return _0x3fc6d4;};}function handleError(_0x55d0f4,_0x8ed731){_0x8ed731=_0x8ed731||0x1f4;return function(_0x3f105c){logger['error'](_0x3f105c[_0x67a4('0x22')]);if(_0x3f105c[_0x67a4('0x23')]){delete _0x3f105c[_0x67a4('0x23')];}_0x55d0f4['status'](_0x8ed731)['send'](_0x3f105c);};}exports[_0x67a4('0x24')]=function(_0x554f36,_0x5a2040){var _0x5d8662={},_0x31cedf={},_0x5c7a22={'count':0x0,'rows':[]};var _0xd99c02=_[_0x67a4('0x25')](db[_0x67a4('0x26')][_0x67a4('0x27')],function(_0x4f89e3){return{'name':_0x4f89e3['fieldName'],'type':_0x4f89e3[_0x67a4('0x28')][_0x67a4('0x29')]};});_0x31cedf[_0x67a4('0x2a')]=_[_0x67a4('0x25')](_0xd99c02,_0x67a4('0x23'));_0x31cedf[_0x67a4('0x2b')]=_[_0x67a4('0x2c')](_0x554f36[_0x67a4('0x2b')]);_0x31cedf[_0x67a4('0x2d')]=_[_0x67a4('0x2e')](_0x31cedf[_0x67a4('0x2a')],_0x31cedf[_0x67a4('0x2b')]);_0x5d8662[_0x67a4('0x2f')]=_['intersection'](_0x31cedf[_0x67a4('0x2a')],qs[_0x67a4('0x30')](_0x554f36[_0x67a4('0x2b')][_0x67a4('0x30')]));_0x5d8662['attributes']=_0x5d8662[_0x67a4('0x2f')]['length']?_0x5d8662[_0x67a4('0x2f')]:_0x31cedf[_0x67a4('0x2a')];if(!_0x554f36[_0x67a4('0x2b')][_0x67a4('0x31')](_0x67a4('0x32'))){_0x5d8662[_0x67a4('0x1a')]=qs['limit'](_0x554f36['query'][_0x67a4('0x1a')]);_0x5d8662[_0x67a4('0x17')]=qs[_0x67a4('0x17')](_0x554f36[_0x67a4('0x2b')][_0x67a4('0x17')]);}_0x5d8662['order']=qs[_0x67a4('0x33')](_0x554f36[_0x67a4('0x2b')]['sort']);_0x5d8662[_0x67a4('0x34')]=qs[_0x67a4('0x2d')](_[_0x67a4('0x35')](_0x554f36[_0x67a4('0x2b')],_0x31cedf[_0x67a4('0x2d')]),_0xd99c02);if(_0x554f36[_0x67a4('0x2b')][_0x67a4('0x36')]){_0x5d8662[_0x67a4('0x34')]=_[_0x67a4('0x37')](_0x5d8662['where'],{'$or':_[_0x67a4('0x25')](_0xd99c02,function(_0x3d4659){if(_0x3d4659[_0x67a4('0x28')]!==_0x67a4('0x38')){var _0x4b9da1={};_0x4b9da1[_0x3d4659[_0x67a4('0x23')]]={'$like':'%'+_0x554f36[_0x67a4('0x2b')][_0x67a4('0x36')]+'%'};return _0x4b9da1;}})});}_0x5d8662=_[_0x67a4('0x37')]({},_0x5d8662,_0x554f36[_0x67a4('0x39')]);var _0x6b3ad9={'where':_0x5d8662['where']};return db['IntegrationReport'][_0x67a4('0x19')](_0x6b3ad9)[_0x67a4('0x1f')](function(_0x26cbdc){_0x5c7a22[_0x67a4('0x19')]=_0x26cbdc;if(_0x554f36[_0x67a4('0x2b')][_0x67a4('0x3a')]){_0x5d8662['include']=[{'all':!![]}];}return db[_0x67a4('0x26')][_0x67a4('0x3b')](_0x5d8662);})[_0x67a4('0x1f')](function(_0x4f7e3a){_0x5c7a22[_0x67a4('0x3c')]=_0x4f7e3a;return _0x5c7a22;})['then'](respondWithFilteredResult(_0x5a2040,_0x5d8662))[_0x67a4('0x3d')](handleError(_0x5a2040,null));};exports[_0x67a4('0x3e')]=function(_0x238ffb,_0x4ce27f){var _0x35b963={'raw':![],'where':{'id':_0x238ffb[_0x67a4('0x3f')]['id']}},_0x3d103d={};_0x3d103d[_0x67a4('0x2a')]=_[_0x67a4('0x2c')](db[_0x67a4('0x26')][_0x67a4('0x27')]);_0x3d103d[_0x67a4('0x2b')]=_[_0x67a4('0x2c')](_0x238ffb['query']);_0x3d103d[_0x67a4('0x2d')]=_[_0x67a4('0x2e')](_0x3d103d[_0x67a4('0x2a')],_0x3d103d[_0x67a4('0x2b')]);_0x35b963['attributes']=_[_0x67a4('0x2e')](_0x3d103d[_0x67a4('0x2a')],qs[_0x67a4('0x30')](_0x238ffb[_0x67a4('0x2b')]['fields']));_0x35b963[_0x67a4('0x2f')]=_0x35b963['attributes']['length']?_0x35b963[_0x67a4('0x2f')]:_0x3d103d[_0x67a4('0x2a')];if(_0x238ffb[_0x67a4('0x2b')][_0x67a4('0x3a')]){_0x35b963['include']=[{'all':!![]}];}_0x35b963=_[_0x67a4('0x37')]({},_0x35b963,_0x238ffb['options']);return db[_0x67a4('0x26')][_0x67a4('0x40')](_0x35b963)[_0x67a4('0x1f')](handleEntityNotFound(_0x4ce27f,null))[_0x67a4('0x1f')](respondWithResult(_0x4ce27f,null))[_0x67a4('0x3d')](handleError(_0x4ce27f,null));};exports['create']=function(_0x35dd18,_0x1aa0fe){return db[_0x67a4('0x26')]['create'](_0x35dd18[_0x67a4('0x41')],{})['then'](respondWithResult(_0x1aa0fe,0xc9))[_0x67a4('0x3d')](handleError(_0x1aa0fe,null));};exports['update']=function(_0x31fa5a,_0x34e23a){if(_0x31fa5a[_0x67a4('0x41')]['id']){delete _0x31fa5a['body']['id'];}return db[_0x67a4('0x26')][_0x67a4('0x40')]({'where':{'id':_0x31fa5a[_0x67a4('0x3f')]['id']}})[_0x67a4('0x1f')](handleEntityNotFound(_0x34e23a,null))[_0x67a4('0x1f')](saveUpdates(_0x31fa5a[_0x67a4('0x41')],null))['then'](respondWithResult(_0x34e23a,null))[_0x67a4('0x3d')](handleError(_0x34e23a,null));};exports[_0x67a4('0x20')]=function(_0x5d18a2,_0x4617b0){return db[_0x67a4('0x26')][_0x67a4('0x40')]({'where':{'id':_0x5d18a2[_0x67a4('0x3f')]['id']}})[_0x67a4('0x1f')](handleEntityNotFound(_0x4617b0,null))[_0x67a4('0x1f')](removeEntity(_0x4617b0,null))[_0x67a4('0x3d')](handleError(_0x4617b0,null));};exports[_0x67a4('0x42')]=function(_0x4ee836,_0x3b8906){return db[_0x67a4('0x26')]['describe']()[_0x67a4('0x1f')](respondWithResult(_0x3b8906,null))[_0x67a4('0x3d')](handleError(_0x3b8906,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index ab13c55..68fcf1f 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 _0xae60=['exports','define','IntegrationReport','report_integration','../../config/logger','moment','bluebird','path','rimraf','./integrationReport.attributes'];(function(_0x368b19,_0xcf4ad7){var _0x8ec657=function(_0x250768){while(--_0x250768){_0x368b19['push'](_0x368b19['shift']());}};_0x8ec657(++_0xcf4ad7);}(_0xae60,0xf4));var _0x0ae6=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xae60[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ae6('0x0'))('api');var moment=require(_0x0ae6('0x1'));var BPromise=require(_0x0ae6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ae6('0x3'));var rimraf=require(_0x0ae6('0x4'));var config=require('../../config/environment');var attributes=require(_0x0ae6('0x5'));module[_0x0ae6('0x6')]=function(_0x55d860,_0x2a2952){return _0x55d860[_0x0ae6('0x7')](_0x0ae6('0x8'),attributes,{'tableName':_0x0ae6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf65=['./integrationReport.attributes','exports','define','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x38952f,_0x443c7b){var _0x496a37=function(_0x3174fd){while(--_0x3174fd){_0x38952f['push'](_0x38952f['shift']());}};_0x496a37(++_0x443c7b);}(_0xaf65,0x1bc));var _0x5af6=function(_0x16013c,_0x1515cb){_0x16013c=_0x16013c-0x0;var _0x143210=_0xaf65[_0x16013c];return _0x143210;};'use strict';var _=require('lodash');var util=require(_0x5af6('0x0'));var logger=require(_0x5af6('0x1'))(_0x5af6('0x2'));var moment=require(_0x5af6('0x3'));var BPromise=require(_0x5af6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5af6('0x5'));var config=require('../../config/environment');var attributes=require(_0x5af6('0x6'));module[_0x5af6('0x7')]=function(_0x2ab411,_0x9c50be){return _0x2ab411[_0x5af6('0x8')]('IntegrationReport',attributes,{'tableName':'report_integration','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 954f10d..3311602 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 _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x687b,0x14a));var _0xb687=function(_0xca581e,_0x5975df){_0xca581e=_0xca581e-0x0;var _0x5ddecd=_0x687b[_0xca581e];return _0x5ddecd;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x53ec,0x192));var _0xc53e=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x53ec[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 8e8ad4c..8d5db6c 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 _0xa630=['isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xa630,0xbe));var _0x0a63=function(_0x4dcb3e,_0x3398fc){_0x4dcb3e=_0x4dcb3e-0x0;var _0x3138ed=_0xa630[_0x4dcb3e];return _0x3138ed;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')]('/',auth[_0x0a63('0x8')](),controller['index']);router[_0x0a63('0x7')](_0x0a63('0x9'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x7')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')]('/',auth[_0x0a63('0x8')](),controller[_0x0a63('0xe')]);router[_0x0a63('0xd')](_0x0a63('0xb'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xf')]);router[_0x0a63('0xd')](_0x0a63('0x10'),auth['isAuthenticated'](),controller[_0x0a63('0x11')]);router[_0x0a63('0x12')](_0x0a63('0x9'),auth[_0x0a63('0x8')](),controller['update']);router[_0x0a63('0x13')]('/:id',auth[_0x0a63('0x8')](),controller[_0x0a63('0x14')]);module[_0x0a63('0x15')]=router; \ No newline at end of file +var _0x576b=['show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id'];(function(_0xc831c6,_0x542b00){var _0x5063a7=function(_0x4600ee){while(--_0x4600ee){_0xc831c6['push'](_0xc831c6['shift']());}};_0x5063a7(++_0x542b00);}(_0x576b,0x1d9));var _0xb576=function(_0x45d4e8,_0x2c17ae){_0x45d4e8=_0x45d4e8-0x0;var _0x13a867=_0x576b[_0x45d4e8];return _0x13a867;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb576('0x0'));var express=require(_0xb576('0x1'));var router=express['Router']();var fs_extra=require(_0xb576('0x2'));var auth=require(_0xb576('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb576('0x4'));var controller=require(_0xb576('0x5'));router[_0xb576('0x6')]('/',auth[_0xb576('0x7')](),controller[_0xb576('0x8')]);router[_0xb576('0x6')](_0xb576('0x9'),auth[_0xb576('0x7')](),controller[_0xb576('0xa')]);router[_0xb576('0x6')](_0xb576('0xb'),auth[_0xb576('0x7')](),controller[_0xb576('0xc')]);router[_0xb576('0xd')]('/',auth[_0xb576('0x7')](),controller['create']);router[_0xb576('0xd')]('/:id/sub_intervals',auth[_0xb576('0x7')](),controller[_0xb576('0xe')]);router[_0xb576('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xb576('0xf')]);router[_0xb576('0x10')](_0xb576('0x9'),auth[_0xb576('0x7')](),controller[_0xb576('0x11')]);router[_0xb576('0x12')](_0xb576('0x9'),auth[_0xb576('0x7')](),controller[_0xb576('0x13')]);module[_0xb576('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index bda6d80..07a8336 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 _0x8904=['sequelize','exports'];(function(_0x11a05f,_0x38a6af){var _0xdfea63=function(_0x53d39c){while(--_0x53d39c){_0x11a05f['push'](_0x11a05f['shift']());}};_0xdfea63(++_0x38a6af);}(_0x8904,0x178));var _0x4890=function(_0x2ef049,_0x202ddd){_0x2ef049=_0x2ef049-0x0;var _0x4fa5c2=_0x8904[_0x2ef049];return _0x4fa5c2;};'use strict';var Sequelize=require(_0x4890('0x0'));module[_0x4890('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x4fc7=['sequelize','exports','STRING'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x4fc7,0xbd));var _0x74fc=function(_0x2e8ef3,_0x1d7b68){_0x2e8ef3=_0x2e8ef3-0x0;var _0x53feb0=_0x4fc7[_0x2e8ef3];return _0x53feb0;};'use strict';var Sequelize=require(_0x74fc('0x0'));module[_0x74fc('0x1')]={'name':{'type':Sequelize[_0x74fc('0x2')]},'description':{'type':Sequelize[_0x74fc('0x2')]},'interval':{'type':Sequelize[_0x74fc('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 aabdcc3..431587f 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 _0x74a0=['fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','options','count','includeAll','include','findAll','show','params','keys','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','addInterval','IntervalId','findOne','rawAttributes','sort','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','undefined','set','Content-Range','json','apply','reject','update','then','get','Intervals','UserProfileResource','destroy','end','error','stack','name','send','index','Interval','fieldName','type','key','model','map','query','filters','intersection','attributes'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x74a0,0x148));var _0x074a=function(_0x5af499,_0x1d361e){_0x5af499=_0x5af499-0x0;var _0x32ce28=_0x74a0[_0x5af499];return _0x32ce28;};'use strict';var emlformat=require(_0x074a('0x0'));var rimraf=require(_0x074a('0x1'));var zipdir=require(_0x074a('0x2'));var jsonpatch=require(_0x074a('0x3'));var rp=require(_0x074a('0x4'));var moment=require(_0x074a('0x5'));var BPromise=require(_0x074a('0x6'));var Mustache=require(_0x074a('0x7'));var util=require(_0x074a('0x8'));var path=require(_0x074a('0x9'));var sox=require(_0x074a('0xa'));var csv=require(_0x074a('0xb'));var ejs=require(_0x074a('0xc'));var fs=require('fs');var fs_extra=require(_0x074a('0xd'));var _=require(_0x074a('0xe'));var squel=require(_0x074a('0xf'));var crypto=require('crypto');var jsforce=require(_0x074a('0x10'));var deskjs=require(_0x074a('0x11'));var toCsv=require(_0x074a('0xb'));var querystring=require('querystring');var Papa=require(_0x074a('0x12'));var Redis=require(_0x074a('0x13'));var authService=require(_0x074a('0x14'));var qs=require(_0x074a('0x15'));var as=require(_0x074a('0x16'));var hardwareService=require(_0x074a('0x17'));var logger=require(_0x074a('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x074a('0x19'));var licenseUtil=require(_0x074a('0x1a'));var db=require(_0x074a('0x1b'))['db'];var extensions=require(_0x074a('0x1c'));function respondWithStatusCode(_0x26a7b6,_0xe0f928){_0xe0f928=_0xe0f928||0xcc;return function(_0x4e25f4){if(_0x4e25f4){return _0x26a7b6[_0x074a('0x1d')](_0xe0f928);}return _0x26a7b6[_0x074a('0x1e')](_0xe0f928)['end']();};}function respondWithResult(_0x5c967d,_0x2d76d6){_0x2d76d6=_0x2d76d6||0xc8;return function(_0x5a344c){if(_0x5a344c){return _0x5c967d[_0x074a('0x1e')](_0x2d76d6)['json'](_0x5a344c);}};}function respondWithFilteredResult(_0xb08796,_0x47544e){return function(_0x26ca3f){if(_0x26ca3f){var _0x59981d=typeof _0x47544e[_0x074a('0x1f')]===_0x074a('0x20')&&typeof _0x47544e['limit']===_0x074a('0x20');var _0x371e21=_0x26ca3f['count'];var _0x1497b7=_0x59981d?0x0:_0x47544e[_0x074a('0x1f')];var _0x6417af=_0x59981d?_0x26ca3f['count']:_0x47544e[_0x074a('0x1f')]+_0x47544e['limit'];var _0x16f869;if(_0x6417af>=_0x371e21){_0x6417af=_0x371e21;_0x16f869=0xc8;}else{_0x16f869=0xce;}_0xb08796['status'](_0x16f869);return _0xb08796[_0x074a('0x21')](_0x074a('0x22'),_0x1497b7+'-'+_0x6417af+'/'+_0x371e21)[_0x074a('0x23')](_0x26ca3f);}return null;};}function patchUpdates(_0x142753){return function(_0x5671c2){try{jsonpatch[_0x074a('0x24')](_0x5671c2,_0x142753,!![]);}catch(_0x2fa86b){return BPromise[_0x074a('0x25')](_0x2fa86b);}return _0x5671c2['save']();};}function saveUpdates(_0x19ee47,_0x17a9b1){return function(_0x15d06f){if(_0x15d06f){return _0x15d06f[_0x074a('0x26')](_0x19ee47)[_0x074a('0x27')](function(_0x18ab34){return _0x18ab34;});}return null;};}function removeEntity(_0x4adbeb,_0x5007b6){return function(_0x5947df){if(_0x5947df){return _0x5947df['destroy']()['then'](function(){var _0x2e8e7f=_0x5947df[_0x074a('0x28')]({'plain':!![]});var _0x4cdc35=_0x074a('0x29');return db[_0x074a('0x2a')][_0x074a('0x2b')]({'where':{'type':_0x4cdc35,'resourceId':_0x2e8e7f['id']}})[_0x074a('0x27')](function(){return _0x5947df;});})[_0x074a('0x27')](function(){_0x4adbeb[_0x074a('0x1e')](0xcc)[_0x074a('0x2c')]();});}};}function handleEntityNotFound(_0x3c088b,_0x54047c){return function(_0x135a11){if(!_0x135a11){_0x3c088b[_0x074a('0x1d')](0x194);}return _0x135a11;};}function handleError(_0x47c6d5,_0x347aac){_0x347aac=_0x347aac||0x1f4;return function(_0x24d478){logger[_0x074a('0x2d')](_0x24d478[_0x074a('0x2e')]);if(_0x24d478[_0x074a('0x2f')]){delete _0x24d478[_0x074a('0x2f')];}_0x47c6d5[_0x074a('0x1e')](_0x347aac)[_0x074a('0x30')](_0x24d478);};}exports[_0x074a('0x31')]=function(_0xfdaa79,_0x59a55e){var _0x40393b={},_0x3e45e4={},_0x3086a9={'count':0x0,'rows':[]};var _0x52e019=_['map'](db[_0x074a('0x32')]['rawAttributes'],function(_0x2ac1e6){return{'name':_0x2ac1e6[_0x074a('0x33')],'type':_0x2ac1e6[_0x074a('0x34')][_0x074a('0x35')]};});_0x3e45e4[_0x074a('0x36')]=_[_0x074a('0x37')](_0x52e019,_0x074a('0x2f'));_0x3e45e4['query']=_['keys'](_0xfdaa79[_0x074a('0x38')]);_0x3e45e4[_0x074a('0x39')]=_[_0x074a('0x3a')](_0x3e45e4['model'],_0x3e45e4[_0x074a('0x38')]);_0x40393b[_0x074a('0x3b')]=_[_0x074a('0x3a')](_0x3e45e4['model'],qs[_0x074a('0x3c')](_0xfdaa79[_0x074a('0x38')][_0x074a('0x3c')]));_0x40393b[_0x074a('0x3b')]=_0x40393b['attributes'][_0x074a('0x3d')]?_0x40393b[_0x074a('0x3b')]:_0x3e45e4[_0x074a('0x36')];if(!_0xfdaa79[_0x074a('0x38')][_0x074a('0x3e')](_0x074a('0x3f'))){_0x40393b[_0x074a('0x40')]=qs[_0x074a('0x40')](_0xfdaa79[_0x074a('0x38')][_0x074a('0x40')]);_0x40393b[_0x074a('0x1f')]=qs[_0x074a('0x1f')](_0xfdaa79[_0x074a('0x38')][_0x074a('0x1f')]);}_0x40393b[_0x074a('0x41')]=qs['sort'](_0xfdaa79[_0x074a('0x38')]['sort']);_0x40393b[_0x074a('0x42')]=qs[_0x074a('0x39')](_[_0x074a('0x43')](_0xfdaa79[_0x074a('0x38')],_0x3e45e4[_0x074a('0x39')]),_0x52e019);if(_0xfdaa79['query']['filter']){_0x40393b[_0x074a('0x42')]=_['merge'](_0x40393b[_0x074a('0x42')],{'$or':_['map'](_0x52e019,function(_0x417e0c){if(_0x417e0c[_0x074a('0x34')]!=='VIRTUAL'){var _0x1d771a={};_0x1d771a[_0x417e0c[_0x074a('0x2f')]]={'$like':'%'+_0xfdaa79[_0x074a('0x38')][_0x074a('0x44')]+'%'};return _0x1d771a;}})});}_0x40393b=_[_0x074a('0x45')]({},_0x40393b,_0xfdaa79[_0x074a('0x46')]);var _0x138750={'where':_0x40393b[_0x074a('0x42')]};return db['Interval'][_0x074a('0x47')](_0x138750)[_0x074a('0x27')](function(_0x204858){_0x3086a9[_0x074a('0x47')]=_0x204858;if(_0xfdaa79[_0x074a('0x38')][_0x074a('0x48')]){_0x40393b[_0x074a('0x49')]=[{'all':!![]}];}return db[_0x074a('0x32')][_0x074a('0x4a')](_0x40393b);})['then'](function(_0x4ae478){_0x3086a9['rows']=_0x4ae478;return _0x3086a9;})[_0x074a('0x27')](respondWithFilteredResult(_0x59a55e,_0x40393b))['catch'](handleError(_0x59a55e,null));};exports[_0x074a('0x4b')]=function(_0x146042,_0x5e2846){var _0x2f3bc5={'raw':!![],'where':{'id':_0x146042[_0x074a('0x4c')]['id']}},_0x1f8f20={};_0x1f8f20[_0x074a('0x36')]=_['keys'](db['Interval']['rawAttributes']);_0x1f8f20['query']=_[_0x074a('0x4d')](_0x146042['query']);_0x1f8f20[_0x074a('0x39')]=_['intersection'](_0x1f8f20[_0x074a('0x36')],_0x1f8f20['query']);_0x2f3bc5[_0x074a('0x3b')]=_[_0x074a('0x3a')](_0x1f8f20[_0x074a('0x36')],qs[_0x074a('0x3c')](_0x146042['query'][_0x074a('0x3c')]));_0x2f3bc5['attributes']=_0x2f3bc5['attributes'][_0x074a('0x3d')]?_0x2f3bc5[_0x074a('0x3b')]:_0x1f8f20[_0x074a('0x36')];if(_0x146042[_0x074a('0x38')][_0x074a('0x48')]){_0x2f3bc5[_0x074a('0x49')]=[{'all':!![]}];}_0x2f3bc5=_[_0x074a('0x45')]({},_0x2f3bc5,_0x146042[_0x074a('0x46')]);return db[_0x074a('0x32')][_0x074a('0x4e')](_0x2f3bc5)['then'](handleEntityNotFound(_0x5e2846,null))['then'](respondWithResult(_0x5e2846,null))[_0x074a('0x4f')](handleError(_0x5e2846,null));};exports['create']=function(_0x3faeb8,_0x5ab76e){return db[_0x074a('0x32')]['create'](_0x3faeb8[_0x074a('0x50')],{})[_0x074a('0x27')](function(_0x475359){var _0x464cbf=_0x3faeb8[_0x074a('0x51')][_0x074a('0x28')]({'plain':!![]});if(!_0x464cbf)throw new Error(_0x074a('0x52'));if(_0x464cbf[_0x074a('0x53')]===_0x074a('0x51')){var _0x5e7dfe=_0x475359[_0x074a('0x28')]({'plain':!![]});var _0x383194=_0x074a('0x29');return db[_0x074a('0x54')]['find']({'where':{'name':_0x383194,'userProfileId':_0x464cbf[_0x074a('0x55')]},'raw':!![]})[_0x074a('0x27')](function(_0x58e8ee){if(_0x58e8ee&&_0x58e8ee['autoAssociation']===0x0){return db[_0x074a('0x2a')][_0x074a('0x56')]({'name':_0x5e7dfe['name'],'resourceId':_0x5e7dfe['id'],'type':_0x58e8ee['name'],'sectionId':_0x58e8ee['id']},{})[_0x074a('0x27')](function(){return _0x475359;});}else{return _0x475359;}})[_0x074a('0x4f')](function(_0x42928f){logger[_0x074a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42928f);throw _0x42928f;});}return _0x475359;})['then'](respondWithResult(_0x5ab76e,0xc9))[_0x074a('0x4f')](handleError(_0x5ab76e,null));};exports[_0x074a('0x26')]=function(_0x41c62c,_0x4c74ed){if(_0x41c62c[_0x074a('0x50')]['id']){delete _0x41c62c[_0x074a('0x50')]['id'];}return db[_0x074a('0x32')][_0x074a('0x4e')]({'where':{'id':_0x41c62c[_0x074a('0x4c')]['id']}})[_0x074a('0x27')](handleEntityNotFound(_0x4c74ed,null))[_0x074a('0x27')](saveUpdates(_0x41c62c['body'],null))[_0x074a('0x27')](respondWithResult(_0x4c74ed,null))[_0x074a('0x4f')](handleError(_0x4c74ed,null));};exports['destroy']=function(_0x2d0f0f,_0x29b180){return db['Interval'][_0x074a('0x4e')]({'where':{'id':_0x2d0f0f['params']['id']}})[_0x074a('0x27')](handleEntityNotFound(_0x29b180,null))[_0x074a('0x27')](removeEntity(_0x29b180,null))['catch'](handleError(_0x29b180,null));};exports[_0x074a('0x57')]=function(_0x1a7ee2,_0x2ebe1f,_0x39ec10){if(_0x1a7ee2[_0x074a('0x50')]['id']){delete _0x1a7ee2[_0x074a('0x50')]['id'];}return db[_0x074a('0x32')]['find']({'where':{'id':_0x1a7ee2[_0x074a('0x4c')]['id']}})[_0x074a('0x27')](handleEntityNotFound(_0x2ebe1f,null))[_0x074a('0x27')](function(_0x4d2680){if(_0x4d2680){_0x1a7ee2[_0x074a('0x50')][_0x074a('0x58')]=_0x4d2680['id'];return db['Interval'][_0x074a('0x56')](_0x1a7ee2[_0x074a('0x50')]);}})[_0x074a('0x27')](respondWithResult(_0x2ebe1f,null))[_0x074a('0x4f')](handleError(_0x2ebe1f,null));};exports['getIntervals']=function(_0x1ba9e4,_0x425d72,_0x37a19e){var _0x9eb2c7={};var _0x572878={};var _0xe545c2;var _0x2782fb;return db[_0x074a('0x32')][_0x074a('0x59')]({'where':{'id':_0x1ba9e4[_0x074a('0x4c')]['id']}})[_0x074a('0x27')](handleEntityNotFound(_0x425d72,null))['then'](function(_0x388346){if(_0x388346){_0xe545c2=_0x388346;_0x572878['model']=_[_0x074a('0x4d')](db['Interval'][_0x074a('0x5a')]);_0x572878['query']=_[_0x074a('0x4d')](_0x1ba9e4['query']);_0x572878[_0x074a('0x39')]=_[_0x074a('0x3a')](_0x572878[_0x074a('0x36')],_0x572878[_0x074a('0x38')]);_0x9eb2c7[_0x074a('0x3b')]=_['intersection'](_0x572878[_0x074a('0x36')],qs['fields'](_0x1ba9e4['query'][_0x074a('0x3c')]));_0x9eb2c7[_0x074a('0x3b')]=_0x9eb2c7[_0x074a('0x3b')][_0x074a('0x3d')]?_0x9eb2c7[_0x074a('0x3b')]:_0x572878[_0x074a('0x36')];_0x9eb2c7[_0x074a('0x41')]=qs[_0x074a('0x5b')](_0x1ba9e4[_0x074a('0x38')][_0x074a('0x5b')]);_0x9eb2c7[_0x074a('0x42')]=qs[_0x074a('0x39')](_[_0x074a('0x43')](_0x1ba9e4['query'],_0x572878[_0x074a('0x39')]));if(_0x1ba9e4[_0x074a('0x38')][_0x074a('0x44')]){_0x9eb2c7['where']=_[_0x074a('0x45')](_0x9eb2c7[_0x074a('0x42')],{'$or':_[_0x074a('0x37')](_0x9eb2c7[_0x074a('0x3b')],function(_0x2f139e){var _0x33caa2={};_0x33caa2[_0x2f139e]={'$like':'%'+_0x1ba9e4[_0x074a('0x38')]['filter']+'%'};return _0x33caa2;})});}_0x9eb2c7=_[_0x074a('0x45')]({},_0x9eb2c7,_0x1ba9e4[_0x074a('0x46')]);return _0xe545c2[_0x074a('0x5c')](_0x9eb2c7);}})[_0x074a('0x27')](function(_0x2dd341){if(_0x2dd341){_0x2782fb=_0x2dd341[_0x074a('0x3d')];if(!_0x1ba9e4[_0x074a('0x38')][_0x074a('0x3e')](_0x074a('0x3f'))){_0x9eb2c7[_0x074a('0x40')]=qs['limit'](_0x1ba9e4[_0x074a('0x38')][_0x074a('0x40')]);_0x9eb2c7['offset']=qs[_0x074a('0x1f')](_0x1ba9e4['query'][_0x074a('0x1f')]);}return _0xe545c2[_0x074a('0x5c')](_0x9eb2c7);}})[_0x074a('0x27')](function(_0x3d1180){if(_0x3d1180){return _0x3d1180?{'count':_0x2782fb,'rows':_0x3d1180}:null;}})[_0x074a('0x27')](respondWithResult(_0x425d72,null))['catch'](handleError(_0x425d72,null));};exports[_0x074a('0x5d')]=function(_0x58131f,_0x544e43,_0x5d1c90){return db['Interval'][_0x074a('0x59')]({'where':{'id':_0x58131f[_0x074a('0x4c')]['id']}})[_0x074a('0x27')](handleEntityNotFound(_0x544e43,null))[_0x074a('0x27')](function(_0x45d2f4){if(_0x45d2f4){return db[_0x074a('0x5e')][_0x074a('0x5f')](function(_0x4ca587){return db['Interval'][_0x074a('0x2b')]({'where':{'IntervalId':_0x58131f[_0x074a('0x4c')]['id']},'transaction':_0x4ca587})['then'](function(_0x10a2a7){var _0x37887f=_['map'](_0x58131f[_0x074a('0x50')],function(_0x4777f4){delete _0x4777f4['id'];_0x4777f4[_0x074a('0x58')]=_0x58131f[_0x074a('0x4c')]['id'];return _0x4777f4;});return db[_0x074a('0x32')][_0x074a('0x60')](_0x37887f,{'transaction':_0x4ca587});});})[_0x074a('0x27')](function(){return db[_0x074a('0x32')][_0x074a('0x4a')]({'where':{'IntervalId':_0x58131f[_0x074a('0x4c')]['id']}});});}})[_0x074a('0x27')](respondWithResult(_0x544e43,null))['catch'](handleError(_0x544e43,null));}; \ No newline at end of file +var _0x1a0c=['userProfileId','UserProfileResource','getIntervals','findOne','pick','options','nolimit','addIntervals','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Interval','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','find'];(function(_0x2b1b95,_0x745efd){var _0x4a1428=function(_0x29179b){while(--_0x29179b){_0x2b1b95['push'](_0x2b1b95['shift']());}};_0x4a1428(++_0x745efd);}(_0x1a0c,0x1b9));var _0xc1a0=function(_0x292893,_0x3cd21e){_0x292893=_0x292893-0x0;var _0x5a55ac=_0x1a0c[_0x292893];return _0x5a55ac;};'use strict';var emlformat=require(_0xc1a0('0x0'));var rimraf=require(_0xc1a0('0x1'));var zipdir=require(_0xc1a0('0x2'));var jsonpatch=require(_0xc1a0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc1a0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc1a0('0x5'));var sox=require(_0xc1a0('0x6'));var csv=require(_0xc1a0('0x7'));var ejs=require(_0xc1a0('0x8'));var fs=require('fs');var fs_extra=require(_0xc1a0('0x9'));var _=require(_0xc1a0('0xa'));var squel=require('squel');var crypto=require(_0xc1a0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc1a0('0xc'));var toCsv=require(_0xc1a0('0x7'));var querystring=require(_0xc1a0('0xd'));var Papa=require(_0xc1a0('0xe'));var Redis=require(_0xc1a0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1a0('0x10'));var logger=require(_0xc1a0('0x11'))('api');var utils=require(_0xc1a0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc1a0('0x13'));var db=require(_0xc1a0('0x14'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4bede6,_0x4dbe15){_0x4dbe15=_0x4dbe15||0xcc;return function(_0xa27c){if(_0xa27c){return _0x4bede6[_0xc1a0('0x15')](_0x4dbe15);}return _0x4bede6[_0xc1a0('0x16')](_0x4dbe15)[_0xc1a0('0x17')]();};}function respondWithResult(_0x54efdc,_0x344f1a){_0x344f1a=_0x344f1a||0xc8;return function(_0x53f986){if(_0x53f986){return _0x54efdc[_0xc1a0('0x16')](_0x344f1a)[_0xc1a0('0x18')](_0x53f986);}};}function respondWithFilteredResult(_0x457284,_0x39c96e){return function(_0x3a52d0){if(_0x3a52d0){var _0x2baee3=typeof _0x39c96e['offset']==='undefined'&&typeof _0x39c96e[_0xc1a0('0x19')]==='undefined';var _0x225b47=_0x3a52d0[_0xc1a0('0x1a')];var _0x4413e4=_0x2baee3?0x0:_0x39c96e['offset'];var _0x369f87=_0x2baee3?_0x3a52d0[_0xc1a0('0x1a')]:_0x39c96e[_0xc1a0('0x1b')]+_0x39c96e[_0xc1a0('0x19')];var _0x223f71;if(_0x369f87>=_0x225b47){_0x369f87=_0x225b47;_0x223f71=0xc8;}else{_0x223f71=0xce;}_0x457284[_0xc1a0('0x16')](_0x223f71);return _0x457284[_0xc1a0('0x1c')](_0xc1a0('0x1d'),_0x4413e4+'-'+_0x369f87+'/'+_0x225b47)['json'](_0x3a52d0);}return null;};}function patchUpdates(_0x42dc7f){return function(_0x1a63de){try{jsonpatch[_0xc1a0('0x1e')](_0x1a63de,_0x42dc7f,!![]);}catch(_0x493ecd){return BPromise[_0xc1a0('0x1f')](_0x493ecd);}return _0x1a63de[_0xc1a0('0x20')]();};}function saveUpdates(_0x1de526,_0x4f9fef){return function(_0xd08394){if(_0xd08394){return _0xd08394[_0xc1a0('0x21')](_0x1de526)['then'](function(_0x3e8997){return _0x3e8997;});}return null;};}function removeEntity(_0x4475f6,_0x6a0f3f){return function(_0x37c7af){if(_0x37c7af){return _0x37c7af[_0xc1a0('0x22')]()[_0xc1a0('0x23')](function(){var _0x119b8c=_0x37c7af['get']({'plain':!![]});var _0x5a4908='Intervals';return db['UserProfileResource'][_0xc1a0('0x22')]({'where':{'type':_0x5a4908,'resourceId':_0x119b8c['id']}})[_0xc1a0('0x23')](function(){return _0x37c7af;});})[_0xc1a0('0x23')](function(){_0x4475f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f0001,_0x3ba3ec){return function(_0x34fcce){if(!_0x34fcce){_0x1f0001[_0xc1a0('0x15')](0x194);}return _0x34fcce;};}function handleError(_0x398293,_0x1e67bc){_0x1e67bc=_0x1e67bc||0x1f4;return function(_0x465808){logger[_0xc1a0('0x24')](_0x465808[_0xc1a0('0x25')]);if(_0x465808[_0xc1a0('0x26')]){delete _0x465808['name'];}_0x398293[_0xc1a0('0x16')](_0x1e67bc)[_0xc1a0('0x27')](_0x465808);};}exports['index']=function(_0x185801,_0x186e42){var _0x4c5d4c={},_0x1db47d={},_0x4c145a={'count':0x0,'rows':[]};var _0x2ec21a=_['map'](db[_0xc1a0('0x28')]['rawAttributes'],function(_0x59c49e){return{'name':_0x59c49e['fieldName'],'type':_0x59c49e[_0xc1a0('0x29')][_0xc1a0('0x2a')]};});_0x1db47d[_0xc1a0('0x2b')]=_[_0xc1a0('0x2c')](_0x2ec21a,_0xc1a0('0x26'));_0x1db47d[_0xc1a0('0x2d')]=_[_0xc1a0('0x2e')](_0x185801['query']);_0x1db47d[_0xc1a0('0x2f')]=_[_0xc1a0('0x30')](_0x1db47d[_0xc1a0('0x2b')],_0x1db47d[_0xc1a0('0x2d')]);_0x4c5d4c[_0xc1a0('0x31')]=_['intersection'](_0x1db47d['model'],qs[_0xc1a0('0x32')](_0x185801[_0xc1a0('0x2d')][_0xc1a0('0x32')]));_0x4c5d4c[_0xc1a0('0x31')]=_0x4c5d4c[_0xc1a0('0x31')][_0xc1a0('0x33')]?_0x4c5d4c['attributes']:_0x1db47d[_0xc1a0('0x2b')];if(!_0x185801[_0xc1a0('0x2d')][_0xc1a0('0x34')]('nolimit')){_0x4c5d4c[_0xc1a0('0x19')]=qs[_0xc1a0('0x19')](_0x185801['query']['limit']);_0x4c5d4c[_0xc1a0('0x1b')]=qs[_0xc1a0('0x1b')](_0x185801[_0xc1a0('0x2d')][_0xc1a0('0x1b')]);}_0x4c5d4c[_0xc1a0('0x35')]=qs['sort'](_0x185801['query'][_0xc1a0('0x36')]);_0x4c5d4c[_0xc1a0('0x37')]=qs['filters'](_['pick'](_0x185801['query'],_0x1db47d[_0xc1a0('0x2f')]),_0x2ec21a);if(_0x185801[_0xc1a0('0x2d')][_0xc1a0('0x38')]){_0x4c5d4c['where']=_[_0xc1a0('0x39')](_0x4c5d4c[_0xc1a0('0x37')],{'$or':_[_0xc1a0('0x2c')](_0x2ec21a,function(_0x524039){if(_0x524039[_0xc1a0('0x29')]!==_0xc1a0('0x3a')){var _0x5b5951={};_0x5b5951[_0x524039[_0xc1a0('0x26')]]={'$like':'%'+_0x185801[_0xc1a0('0x2d')][_0xc1a0('0x38')]+'%'};return _0x5b5951;}})});}_0x4c5d4c=_[_0xc1a0('0x39')]({},_0x4c5d4c,_0x185801['options']);var _0xcad84f={'where':_0x4c5d4c[_0xc1a0('0x37')]};return db[_0xc1a0('0x28')]['count'](_0xcad84f)['then'](function(_0x163a05){_0x4c145a[_0xc1a0('0x1a')]=_0x163a05;if(_0x185801['query'][_0xc1a0('0x3b')]){_0x4c5d4c['include']=[{'all':!![]}];}return db[_0xc1a0('0x28')][_0xc1a0('0x3c')](_0x4c5d4c);})[_0xc1a0('0x23')](function(_0x6a8b89){_0x4c145a[_0xc1a0('0x3d')]=_0x6a8b89;return _0x4c145a;})[_0xc1a0('0x23')](respondWithFilteredResult(_0x186e42,_0x4c5d4c))[_0xc1a0('0x3e')](handleError(_0x186e42,null));};exports['show']=function(_0x1bd696,_0x4867da){var _0xf09055={'raw':!![],'where':{'id':_0x1bd696[_0xc1a0('0x3f')]['id']}},_0x552a11={};_0x552a11[_0xc1a0('0x2b')]=_['keys'](db[_0xc1a0('0x28')][_0xc1a0('0x40')]);_0x552a11[_0xc1a0('0x2d')]=_[_0xc1a0('0x2e')](_0x1bd696[_0xc1a0('0x2d')]);_0x552a11[_0xc1a0('0x2f')]=_[_0xc1a0('0x30')](_0x552a11['model'],_0x552a11[_0xc1a0('0x2d')]);_0xf09055['attributes']=_['intersection'](_0x552a11['model'],qs['fields'](_0x1bd696[_0xc1a0('0x2d')][_0xc1a0('0x32')]));_0xf09055[_0xc1a0('0x31')]=_0xf09055[_0xc1a0('0x31')][_0xc1a0('0x33')]?_0xf09055[_0xc1a0('0x31')]:_0x552a11['model'];if(_0x1bd696[_0xc1a0('0x2d')][_0xc1a0('0x3b')]){_0xf09055[_0xc1a0('0x41')]=[{'all':!![]}];}_0xf09055=_[_0xc1a0('0x39')]({},_0xf09055,_0x1bd696['options']);return db[_0xc1a0('0x28')]['find'](_0xf09055)[_0xc1a0('0x23')](handleEntityNotFound(_0x4867da,null))[_0xc1a0('0x23')](respondWithResult(_0x4867da,null))['catch'](handleError(_0x4867da,null));};exports[_0xc1a0('0x42')]=function(_0x3e19ef,_0x479a73){return db[_0xc1a0('0x28')][_0xc1a0('0x42')](_0x3e19ef[_0xc1a0('0x43')],{})[_0xc1a0('0x23')](function(_0x228387){var _0x3a285c=_0x3e19ef[_0xc1a0('0x44')][_0xc1a0('0x45')]({'plain':!![]});if(!_0x3a285c)throw new Error(_0xc1a0('0x46'));if(_0x3a285c[_0xc1a0('0x47')]==='user'){var _0x7993b2=_0x228387[_0xc1a0('0x45')]({'plain':!![]});var _0xf45027=_0xc1a0('0x48');return db[_0xc1a0('0x49')][_0xc1a0('0x4a')]({'where':{'name':_0xf45027,'userProfileId':_0x3a285c[_0xc1a0('0x4b')]},'raw':!![]})[_0xc1a0('0x23')](function(_0x18fdf3){if(_0x18fdf3&&_0x18fdf3['autoAssociation']===0x0){return db[_0xc1a0('0x4c')][_0xc1a0('0x42')]({'name':_0x7993b2[_0xc1a0('0x26')],'resourceId':_0x7993b2['id'],'type':_0x18fdf3[_0xc1a0('0x26')],'sectionId':_0x18fdf3['id']},{})['then'](function(){return _0x228387;});}else{return _0x228387;}})[_0xc1a0('0x3e')](function(_0x256441){logger[_0xc1a0('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x256441);throw _0x256441;});}return _0x228387;})[_0xc1a0('0x23')](respondWithResult(_0x479a73,0xc9))[_0xc1a0('0x3e')](handleError(_0x479a73,null));};exports[_0xc1a0('0x21')]=function(_0x72f7cc,_0x5a429c){if(_0x72f7cc['body']['id']){delete _0x72f7cc['body']['id'];}return db[_0xc1a0('0x28')][_0xc1a0('0x4a')]({'where':{'id':_0x72f7cc[_0xc1a0('0x3f')]['id']}})[_0xc1a0('0x23')](handleEntityNotFound(_0x5a429c,null))[_0xc1a0('0x23')](saveUpdates(_0x72f7cc[_0xc1a0('0x43')],null))[_0xc1a0('0x23')](respondWithResult(_0x5a429c,null))[_0xc1a0('0x3e')](handleError(_0x5a429c,null));};exports[_0xc1a0('0x22')]=function(_0x25b767,_0x4049ef){return db['Interval'][_0xc1a0('0x4a')]({'where':{'id':_0x25b767[_0xc1a0('0x3f')]['id']}})[_0xc1a0('0x23')](handleEntityNotFound(_0x4049ef,null))[_0xc1a0('0x23')](removeEntity(_0x4049ef,null))['catch'](handleError(_0x4049ef,null));};exports['addInterval']=function(_0x14ede0,_0x1de0bf,_0x312150){if(_0x14ede0[_0xc1a0('0x43')]['id']){delete _0x14ede0[_0xc1a0('0x43')]['id'];}return db['Interval'][_0xc1a0('0x4a')]({'where':{'id':_0x14ede0[_0xc1a0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1de0bf,null))[_0xc1a0('0x23')](function(_0x52d039){if(_0x52d039){_0x14ede0['body']['IntervalId']=_0x52d039['id'];return db['Interval'][_0xc1a0('0x42')](_0x14ede0[_0xc1a0('0x43')]);}})[_0xc1a0('0x23')](respondWithResult(_0x1de0bf,null))['catch'](handleError(_0x1de0bf,null));};exports[_0xc1a0('0x4d')]=function(_0x32a49b,_0x46afe4,_0x536937){var _0x74e4c0={};var _0x40f5b3={};var _0x51bf70;var _0x1ce047;return db[_0xc1a0('0x28')][_0xc1a0('0x4e')]({'where':{'id':_0x32a49b[_0xc1a0('0x3f')]['id']}})[_0xc1a0('0x23')](handleEntityNotFound(_0x46afe4,null))[_0xc1a0('0x23')](function(_0x154a4d){if(_0x154a4d){_0x51bf70=_0x154a4d;_0x40f5b3[_0xc1a0('0x2b')]=_[_0xc1a0('0x2e')](db[_0xc1a0('0x28')][_0xc1a0('0x40')]);_0x40f5b3[_0xc1a0('0x2d')]=_[_0xc1a0('0x2e')](_0x32a49b[_0xc1a0('0x2d')]);_0x40f5b3[_0xc1a0('0x2f')]=_['intersection'](_0x40f5b3[_0xc1a0('0x2b')],_0x40f5b3['query']);_0x74e4c0[_0xc1a0('0x31')]=_[_0xc1a0('0x30')](_0x40f5b3['model'],qs[_0xc1a0('0x32')](_0x32a49b['query']['fields']));_0x74e4c0[_0xc1a0('0x31')]=_0x74e4c0[_0xc1a0('0x31')]['length']?_0x74e4c0['attributes']:_0x40f5b3['model'];_0x74e4c0[_0xc1a0('0x35')]=qs[_0xc1a0('0x36')](_0x32a49b[_0xc1a0('0x2d')]['sort']);_0x74e4c0[_0xc1a0('0x37')]=qs[_0xc1a0('0x2f')](_[_0xc1a0('0x4f')](_0x32a49b['query'],_0x40f5b3[_0xc1a0('0x2f')]));if(_0x32a49b[_0xc1a0('0x2d')][_0xc1a0('0x38')]){_0x74e4c0[_0xc1a0('0x37')]=_[_0xc1a0('0x39')](_0x74e4c0['where'],{'$or':_[_0xc1a0('0x2c')](_0x74e4c0[_0xc1a0('0x31')],function(_0xeb777d){var _0x363ce1={};_0x363ce1[_0xeb777d]={'$like':'%'+_0x32a49b[_0xc1a0('0x2d')][_0xc1a0('0x38')]+'%'};return _0x363ce1;})});}_0x74e4c0=_[_0xc1a0('0x39')]({},_0x74e4c0,_0x32a49b[_0xc1a0('0x50')]);return _0x51bf70[_0xc1a0('0x4d')](_0x74e4c0);}})[_0xc1a0('0x23')](function(_0x266a17){if(_0x266a17){_0x1ce047=_0x266a17[_0xc1a0('0x33')];if(!_0x32a49b[_0xc1a0('0x2d')][_0xc1a0('0x34')](_0xc1a0('0x51'))){_0x74e4c0[_0xc1a0('0x19')]=qs[_0xc1a0('0x19')](_0x32a49b[_0xc1a0('0x2d')]['limit']);_0x74e4c0[_0xc1a0('0x1b')]=qs[_0xc1a0('0x1b')](_0x32a49b['query'][_0xc1a0('0x1b')]);}return _0x51bf70[_0xc1a0('0x4d')](_0x74e4c0);}})[_0xc1a0('0x23')](function(_0x172f8a){if(_0x172f8a){return _0x172f8a?{'count':_0x1ce047,'rows':_0x172f8a}:null;}})['then'](respondWithResult(_0x46afe4,null))[_0xc1a0('0x3e')](handleError(_0x46afe4,null));};exports[_0xc1a0('0x52')]=function(_0x37c536,_0x2fe8fd,_0x13e1b3){return db[_0xc1a0('0x28')][_0xc1a0('0x4e')]({'where':{'id':_0x37c536['params']['id']}})[_0xc1a0('0x23')](handleEntityNotFound(_0x2fe8fd,null))[_0xc1a0('0x23')](function(_0x2b46c2){if(_0x2b46c2){return db['sequelize'][_0xc1a0('0x53')](function(_0x411eed){return db[_0xc1a0('0x28')][_0xc1a0('0x22')]({'where':{'IntervalId':_0x37c536['params']['id']},'transaction':_0x411eed})['then'](function(_0x574658){var _0x464543=_['map'](_0x37c536[_0xc1a0('0x43')],function(_0x1c627a){delete _0x1c627a['id'];_0x1c627a[_0xc1a0('0x54')]=_0x37c536['params']['id'];return _0x1c627a;});return db['Interval'][_0xc1a0('0x55')](_0x464543,{'transaction':_0x411eed});});})[_0xc1a0('0x23')](function(){return db[_0xc1a0('0x28')][_0xc1a0('0x3c')]({'where':{'IntervalId':_0x37c536[_0xc1a0('0x3f')]['id']}});});}})['then'](respondWithResult(_0x2fe8fd,null))[_0xc1a0('0x3e')](handleError(_0x2fe8fd,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 87ea881..e9fa768 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 _0xa5db=['rewrite','lodash','util','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals'];(function(_0x1ff47a,_0x4c554a){var _0x3a5d14=function(_0x197550){while(--_0x197550){_0x1ff47a['push'](_0x1ff47a['shift']());}};_0x3a5d14(++_0x4c554a);}(_0xa5db,0x1e1));var _0xba5d=function(_0x198e8f,_0x3f6147){_0x198e8f=_0x198e8f-0x0;var _0x2834d8=_0xa5db[_0x198e8f];return _0x2834d8;};'use strict';var _=require(_0xba5d('0x0'));var util=require(_0xba5d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xba5d('0x2'));var rp=require(_0xba5d('0x3'));var fs=require('fs');var path=require(_0xba5d('0x4'));var rimraf=require('rimraf');var config=require(_0xba5d('0x5'));var attributes=require(_0xba5d('0x6'));var extensions=require(_0xba5d('0x7'));module[_0xba5d('0x8')]=function(_0x213bd4,_0x3916ba){return _0x213bd4['define'](_0xba5d('0x9'),attributes,{'tableName':_0xba5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ea6ae,_0x5aca5d){extensions[_0xba5d('0xb')](_0x213bd4,_0x5ea6ae);},'afterBulkCreate':function(_0x574f7f,_0x173db9,_0x5ab1a0){_0x5ab1a0();extensions[_0xba5d('0xb')](_0x213bd4,_0x574f7f[0x0]);},'afterUpdate':function(_0x10c50f,_0x16d367){extensions[_0xba5d('0xb')](_0x213bd4,_0x10c50f);},'afterDestroy':function(_0xe1a508,_0x52ae39){extensions[_0xba5d('0xb')](_0x213bd4,_0xe1a508);}}});}; \ No newline at end of file +var _0x2324=['../../config/logger','api','moment','request-promise','path','rimraf','./interval.attributes','exports','Interval','tools_intervals','rewrite'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x2324,0x1c3));var _0x4232=function(_0x570ff6,_0xd52108){_0x570ff6=_0x570ff6-0x0;var _0x5098e3=_0x2324[_0x570ff6];return _0x5098e3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4232('0x0'))(_0x4232('0x1'));var moment=require(_0x4232('0x2'));var BPromise=require('bluebird');var rp=require(_0x4232('0x3'));var fs=require('fs');var path=require(_0x4232('0x4'));var rimraf=require(_0x4232('0x5'));var config=require('../../config/environment');var attributes=require(_0x4232('0x6'));var extensions=require('../../components/extensions/rewrite');module[_0x4232('0x7')]=function(_0x6e288a,_0x2fcee5){return _0x6e288a['define'](_0x4232('0x8'),attributes,{'tableName':_0x4232('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x134483,_0xbcf533){extensions[_0x4232('0xa')](_0x6e288a,_0x134483);},'afterBulkCreate':function(_0x42d91e,_0x490915,_0x4568ca){_0x4568ca();extensions[_0x4232('0xa')](_0x6e288a,_0x42d91e[0x0]);},'afterUpdate':function(_0x3e8465,_0x34406d){extensions[_0x4232('0xa')](_0x6e288a,_0x3e8465);},'afterDestroy':function(_0x115226,_0x1f08f5){extensions[_0x4232('0xa')](_0x6e288a,_0x115226);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index b29da2d..2f7dca2 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index f69e3a9..8c85d05 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x231773,_0x3040e0){var _0xa6fbb8=function(_0x424811){while(--_0x424811){_0x231773['push'](_0x231773['shift']());}};_0xa6fbb8(++_0x3040e0);}(_0xadb5,0xad));var _0x5adb=function(_0x17a9df,_0x3e2d20){_0x17a9df=_0x17a9df-0x0;var _0x4e3e9b=_0xadb5[_0x17a9df];return _0x4e3e9b;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x202e6b,_0x48e71a){var _0x5447f7=function(_0x12978b){while(--_0x12978b){_0x202e6b['push'](_0x202e6b['shift']());}};_0x5447f7(++_0x48e71a);}(_0xdb28,0x106));var _0x8db2=function(_0x2a3b46,_0x43ff82){_0x2a3b46=_0x2a3b46-0x0;var _0x4d04c1=_0xdb28[_0x2a3b46];return _0x4d04c1;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index b8e1ded..0a64ca3 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 _0xfddc=['customfield_11503','name','customfield_11504','reason','customfield_10102','application/json','toString','base64','request','setEncoding','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','customfield_11502','newToken'];(function(_0x334d5b,_0x13cfcd){var _0x1cd1d2=function(_0x335d6a){while(--_0x335d6a){_0x334d5b['push'](_0x334d5b['shift']());}};_0x1cd1d2(++_0x13cfcd);}(_0xfddc,0x155));var _0xcfdd=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xfddc[_0x2070da];return _0x4f9fe1;};'use strict';var BPromise=require(_0xcfdd('0x0'));var https=require(_0xcfdd('0x1'));var logger=require('../../config/logger')(_0xcfdd('0x2'));var USERNAME=_0xcfdd('0x3');var PASSWORD=_0xcfdd('0x4');function openIssue(_0x4cb298,_0x1e147d){var _0x4aa39a={'fields':{'project':{'key':_0x4cb298[_0xcfdd('0x5')]||_0xcfdd('0x6')},'summary':(_0x4cb298[_0xcfdd('0x7')]||_0xcfdd('0x8'))+_0xcfdd('0x9')+_0x4cb298['ip'],'description':_0x4cb298[_0xcfdd('0xa')]||JSON[_0xcfdd('0xb')](_0x4cb298),'issuetype':{'name':_0x4cb298[_0xcfdd('0xc')]||_0xcfdd('0xd')}}};_0x4aa39a[_0xcfdd('0xe')][_0xcfdd('0xf')]=_0x4cb298['email'];_0x4aa39a['fields'][_0xcfdd('0x10')]=_0x4cb298['oldToken'];_0x4aa39a[_0xcfdd('0xe')][_0xcfdd('0x11')]=_0x4cb298[_0xcfdd('0x12')];_0x4aa39a[_0xcfdd('0xe')][_0xcfdd('0x13')]=_0x4cb298[_0xcfdd('0x14')];_0x4aa39a['fields'][_0xcfdd('0x15')]=_0x4cb298[_0xcfdd('0x16')];_0x4aa39a[_0xcfdd('0xe')][_0xcfdd('0x17')]=_0x4cb298['ip'];var _0x3af6a8={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xcfdd('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xcfdd('0x19')](_0xcfdd('0x1a'))}};var _0x175589=JSON[_0xcfdd('0xb')](_0x4aa39a);var _0x4a8a6f=https[_0xcfdd('0x1b')](_0x3af6a8,function(_0x52e619){_0x52e619[_0xcfdd('0x1c')](_0xcfdd('0x1d'));var _0x42f56a='';_0x52e619['on']('data',function(_0x30964f){_0x42f56a+=_0x30964f;});_0x52e619['on'](_0xcfdd('0x1e'),function(){if(_0x1e147d){return _0x1e147d[_0xcfdd('0x1f')](_0x52e619[_0xcfdd('0x20')])[_0xcfdd('0x21')](JSON[_0xcfdd('0x22')](_0x42f56a));}});});_0x4a8a6f['on'](_0xcfdd('0x23'),function(_0x5d23e4){if(_0x1e147d){return _0x1e147d[_0xcfdd('0x1f')](0x1f4)[_0xcfdd('0x21')]({'errors':[{'message':_0xcfdd('0x24'),'type':'api.jira'}]});}});_0x4a8a6f[_0xcfdd('0x25')](_0x175589);_0x4a8a6f['end']();}exports[_0xcfdd('0x26')]=openIssue;exports[_0xcfdd('0x27')]=function(_0x44022c,_0x5a5d38){_0x44022c['body']['ip']=_0x44022c['headers'][_0xcfdd('0x28')]||_0x44022c[_0xcfdd('0x29')][_0xcfdd('0x2a')]||_0x44022c[_0xcfdd('0x2b')][_0xcfdd('0x2a')]||_0x44022c['connection']['socket'][_0xcfdd('0x2a')];return openIssue(_0x44022c[_0xcfdd('0x2c')],_0x5a5d38);}; \ No newline at end of file +var _0x449a=['base64','stringify','request','setEncoding','utf8','end','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','Report','\x20from\x20','fields','customfield_11500','email','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString'];(function(_0x53dc83,_0x2a710a){var _0x19c4e1=function(_0x30ef76){while(--_0x30ef76){_0x53dc83['push'](_0x53dc83['shift']());}};_0x19c4e1(++_0x2a710a);}(_0x449a,0x90));var _0xa449=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x449a[_0x1ae5ab];return _0x1ce001;};'use strict';var BPromise=require(_0xa449('0x0'));var https=require(_0xa449('0x1'));var logger=require(_0xa449('0x2'))(_0xa449('0x3'));var USERNAME='support';var PASSWORD=_0xa449('0x4');function openIssue(_0x5b2346,_0x591bf4){var _0x321b29={'fields':{'project':{'key':_0x5b2346[_0xa449('0x5')]||'MOTGUI'},'summary':(_0x5b2346['summary']||_0xa449('0x6'))+_0xa449('0x7')+_0x5b2346['ip'],'description':_0x5b2346['description']||JSON['stringify'](_0x5b2346),'issuetype':{'name':_0x5b2346['issuetype']||'Bug'}}};_0x321b29[_0xa449('0x8')][_0xa449('0x9')]=_0x5b2346[_0xa449('0xa')];_0x321b29[_0xa449('0x8')]['customfield_11501']=_0x5b2346[_0xa449('0xb')];_0x321b29['fields'][_0xa449('0xc')]=_0x5b2346[_0xa449('0xd')];_0x321b29[_0xa449('0x8')][_0xa449('0xe')]=_0x5b2346[_0xa449('0xf')];_0x321b29[_0xa449('0x8')]['customfield_11504']=_0x5b2346[_0xa449('0x10')];_0x321b29[_0xa449('0x8')][_0xa449('0x11')]=_0x5b2346['ip'];var _0x1afb0b={'host':_0xa449('0x12'),'port':0x1bb,'path':_0xa449('0x13'),'method':_0xa449('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xa449('0x15'),'Authorization':_0xa449('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xa449('0x17')](_0xa449('0x18'))}};var _0x2a643a=JSON[_0xa449('0x19')](_0x321b29);var _0x6743b1=https[_0xa449('0x1a')](_0x1afb0b,function(_0x10af7d){_0x10af7d[_0xa449('0x1b')](_0xa449('0x1c'));var _0x468514='';_0x10af7d['on']('data',function(_0x13f56c){_0x468514+=_0x13f56c;});_0x10af7d['on'](_0xa449('0x1d'),function(){if(_0x591bf4){return _0x591bf4['status'](_0x10af7d['statusCode'])[_0xa449('0x1e')](JSON[_0xa449('0x1f')](_0x468514));}});});_0x6743b1['on'](_0xa449('0x20'),function(_0x3f4785){if(_0x591bf4){return _0x591bf4['status'](0x1f4)[_0xa449('0x1e')]({'errors':[{'message':_0xa449('0x21'),'type':_0xa449('0x22')}]});}});_0x6743b1[_0xa449('0x23')](_0x2a643a);_0x6743b1['end']();}exports['openIssue']=openIssue;exports[_0xa449('0x24')]=function(_0x59fd6f,_0x4c8dd0){_0x59fd6f[_0xa449('0x25')]['ip']=_0x59fd6f[_0xa449('0x26')]['x-forwarded-for']||_0x59fd6f[_0xa449('0x27')][_0xa449('0x28')]||_0x59fd6f[_0xa449('0x29')][_0xa449('0x28')]||_0x59fd6f[_0xa449('0x27')]['socket'][_0xa449('0x28')];return openIssue(_0x59fd6f[_0xa449('0x25')],_0x4c8dd0);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 940b995..3ba623d 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 _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5149c7,_0xfd2f67){var _0x5010b0=function(_0x408cb0){while(--_0x408cb0){_0x5149c7['push'](_0x5149c7['shift']());}};_0x5010b0(++_0xfd2f67);}(_0x1339,0x1ed));var _0x9133=function(_0x5a99b7,_0x1889cb){_0x5a99b7=_0x5a99b7-0x0;var _0x38b83e=_0x1339[_0x5a99b7];return _0x38b83e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('0x13')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','show','post'];(function(_0x4af01e,_0x543f5c){var _0x178c11=function(_0x2c2f76){while(--_0x2c2f76){_0x4af01e['push'](_0x4af01e['shift']());}};_0x178c11(++_0x543f5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 1f9484c..db4cff7 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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x40bc53,_0xdccb62){_0x40bc53=_0x40bc53-0x0;var _0x2d2494=_0x7a54[_0x40bc53];return _0x2d2494;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x16abc6,_0xd4d60e){_0x16abc6=_0x16abc6-0x0;var _0x4c3129=_0x7a54[_0x16abc6];return _0x4c3129;};'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 67085fc..6a541ad 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 _0x93bb=['includeAll','find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys'];(function(_0x223a00,_0x1f1e9f){var _0x152f91=function(_0x511bf6){while(--_0x511bf6){_0x223a00['push'](_0x223a00['shift']());}};_0x152f91(++_0x1f1e9f);}(_0x93bb,0x135));var _0xb93b=function(_0x20040c,_0x11349e){_0x20040c=_0x20040c-0x0;var _0x405b80=_0x93bb[_0x20040c];return _0x405b80;};'use strict';var emlformat=require(_0xb93b('0x0'));var rimraf=require(_0xb93b('0x1'));var zipdir=require(_0xb93b('0x2'));var jsonpatch=require(_0xb93b('0x3'));var rp=require(_0xb93b('0x4'));var moment=require(_0xb93b('0x5'));var BPromise=require(_0xb93b('0x6'));var Mustache=require(_0xb93b('0x7'));var util=require(_0xb93b('0x8'));var path=require(_0xb93b('0x9'));var sox=require('sox');var csv=require(_0xb93b('0xa'));var ejs=require(_0xb93b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb93b('0xc'));var squel=require(_0xb93b('0xd'));var crypto=require('crypto');var jsforce=require(_0xb93b('0xe'));var deskjs=require(_0xb93b('0xf'));var toCsv=require(_0xb93b('0xa'));var querystring=require(_0xb93b('0x10'));var Papa=require(_0xb93b('0x11'));var Redis=require(_0xb93b('0x12'));var authService=require(_0xb93b('0x13'));var qs=require(_0xb93b('0x14'));var as=require(_0xb93b('0x15'));var hardwareService=require(_0xb93b('0x16'));var logger=require(_0xb93b('0x17'))('api');var utils=require(_0xb93b('0x18'));var config=require(_0xb93b('0x19'));var licenseUtil=require(_0xb93b('0x1a'));var db=require(_0xb93b('0x1b'))['db'];function respondWithStatusCode(_0x5ccabd,_0x44291c){_0x44291c=_0x44291c||0xcc;return function(_0x17f7b0){if(_0x17f7b0){return _0x5ccabd[_0xb93b('0x1c')](_0x44291c);}return _0x5ccabd[_0xb93b('0x1d')](_0x44291c)[_0xb93b('0x1e')]();};}function respondWithResult(_0x29d02e,_0x12ce38){_0x12ce38=_0x12ce38||0xc8;return function(_0x58c73b){if(_0x58c73b){return _0x29d02e[_0xb93b('0x1d')](_0x12ce38)[_0xb93b('0x1f')](_0x58c73b);}};}function respondWithFilteredResult(_0x4281b6,_0x1f6c4b){return function(_0x9e9479){if(_0x9e9479){var _0x1debd0=typeof _0x1f6c4b['offset']===_0xb93b('0x20')&&typeof _0x1f6c4b['limit']===_0xb93b('0x20');var _0x1f4300=_0x9e9479[_0xb93b('0x21')];var _0x11f85b=_0x1debd0?0x0:_0x1f6c4b[_0xb93b('0x22')];var _0x385100=_0x1debd0?_0x9e9479['count']:_0x1f6c4b[_0xb93b('0x22')]+_0x1f6c4b[_0xb93b('0x23')];var _0x3567cf;if(_0x385100>=_0x1f4300){_0x385100=_0x1f4300;_0x3567cf=0xc8;}else{_0x3567cf=0xce;}_0x4281b6[_0xb93b('0x1d')](_0x3567cf);return _0x4281b6[_0xb93b('0x24')](_0xb93b('0x25'),_0x11f85b+'-'+_0x385100+'/'+_0x1f4300)['json'](_0x9e9479);}return null;};}function patchUpdates(_0x57adc7){return function(_0x50f944){try{jsonpatch['apply'](_0x50f944,_0x57adc7,!![]);}catch(_0x1add64){return BPromise['reject'](_0x1add64);}return _0x50f944['save']();};}function saveUpdates(_0xdcf20c,_0x3e57aa){return function(_0x295c61){if(_0x295c61){return _0x295c61['update'](_0xdcf20c)[_0xb93b('0x26')](function(_0x31166b){return _0x31166b;});}return null;};}function removeEntity(_0x5beca0,_0x2cab58){return function(_0x2c6505){if(_0x2c6505){return _0x2c6505[_0xb93b('0x27')]()[_0xb93b('0x26')](function(){_0x5beca0[_0xb93b('0x1d')](0xcc)[_0xb93b('0x1e')]();});}};}function handleEntityNotFound(_0x4e4e16,_0x452483){return function(_0x13d5ad){if(!_0x13d5ad){_0x4e4e16[_0xb93b('0x1c')](0x194);}return _0x13d5ad;};}function handleError(_0x474928,_0x53c665){_0x53c665=_0x53c665||0x1f4;return function(_0x394d37){logger[_0xb93b('0x28')](_0x394d37[_0xb93b('0x29')]);if(_0x394d37[_0xb93b('0x2a')]){delete _0x394d37[_0xb93b('0x2a')];}_0x474928[_0xb93b('0x1d')](_0x53c665)[_0xb93b('0x2b')](_0x394d37);};}exports['index']=function(_0xb79c23,_0x5a9182){var _0x3d835a={},_0x41f593={},_0x60c609={'count':0x0,'rows':[]};var _0x2b31b1=_[_0xb93b('0x2c')](db[_0xb93b('0x2d')][_0xb93b('0x2e')],function(_0x42ee85){return{'name':_0x42ee85[_0xb93b('0x2f')],'type':_0x42ee85['type']['key']};});_0x41f593[_0xb93b('0x30')]=_[_0xb93b('0x2c')](_0x2b31b1,_0xb93b('0x2a'));_0x41f593['query']=_['keys'](_0xb79c23[_0xb93b('0x31')]);_0x41f593[_0xb93b('0x32')]=_[_0xb93b('0x33')](_0x41f593['model'],_0x41f593['query']);_0x3d835a[_0xb93b('0x34')]=_[_0xb93b('0x33')](_0x41f593[_0xb93b('0x30')],qs[_0xb93b('0x35')](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x35')]));_0x3d835a[_0xb93b('0x34')]=_0x3d835a['attributes'][_0xb93b('0x36')]?_0x3d835a[_0xb93b('0x34')]:_0x41f593[_0xb93b('0x30')];if(!_0xb79c23[_0xb93b('0x31')][_0xb93b('0x37')](_0xb93b('0x38'))){_0x3d835a[_0xb93b('0x23')]=qs['limit'](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x23')]);_0x3d835a[_0xb93b('0x22')]=qs[_0xb93b('0x22')](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x22')]);}_0x3d835a[_0xb93b('0x39')]=qs['sort'](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3a')]);_0x3d835a[_0xb93b('0x3b')]=qs[_0xb93b('0x32')](_[_0xb93b('0x3c')](_0xb79c23[_0xb93b('0x31')],_0x41f593[_0xb93b('0x32')]),_0x2b31b1);if(_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3d')]){_0x3d835a[_0xb93b('0x3b')]=_[_0xb93b('0x3e')](_0x3d835a[_0xb93b('0x3b')],{'$or':_[_0xb93b('0x2c')](_0x2b31b1,function(_0x2adc47){if(_0x2adc47['type']!==_0xb93b('0x3f')){var _0x1462d4={};_0x1462d4[_0x2adc47['name']]={'$like':'%'+_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3d')]+'%'};return _0x1462d4;}})});}_0x3d835a=_[_0xb93b('0x3e')]({},_0x3d835a,_0xb79c23[_0xb93b('0x40')]);var _0x8f34e9={'where':_0x3d835a[_0xb93b('0x3b')]};return db['JscriptyAnswerReport'][_0xb93b('0x21')](_0x8f34e9)[_0xb93b('0x26')](function(_0x10ad42){_0x60c609[_0xb93b('0x21')]=_0x10ad42;if(_0xb79c23['query']['includeAll']){_0x3d835a[_0xb93b('0x41')]=[{'all':!![]}];}return db[_0xb93b('0x2d')][_0xb93b('0x42')](_0x3d835a);})[_0xb93b('0x26')](function(_0x53aaaa){_0x60c609[_0xb93b('0x43')]=_0x53aaaa;return _0x60c609;})['then'](respondWithFilteredResult(_0x5a9182,_0x3d835a))[_0xb93b('0x44')](handleError(_0x5a9182,null));};exports['show']=function(_0x382261,_0x6f9464){var _0x159d3b={'raw':!![],'where':{'id':_0x382261[_0xb93b('0x45')]['id']}},_0x3b1617={};_0x3b1617[_0xb93b('0x30')]=_[_0xb93b('0x46')](db['JscriptyAnswerReport'][_0xb93b('0x2e')]);_0x3b1617['query']=_[_0xb93b('0x46')](_0x382261['query']);_0x3b1617['filters']=_[_0xb93b('0x33')](_0x3b1617[_0xb93b('0x30')],_0x3b1617[_0xb93b('0x31')]);_0x159d3b[_0xb93b('0x34')]=_[_0xb93b('0x33')](_0x3b1617['model'],qs['fields'](_0x382261[_0xb93b('0x31')][_0xb93b('0x35')]));_0x159d3b[_0xb93b('0x34')]=_0x159d3b['attributes'][_0xb93b('0x36')]?_0x159d3b[_0xb93b('0x34')]:_0x3b1617['model'];if(_0x382261[_0xb93b('0x31')][_0xb93b('0x47')]){_0x159d3b[_0xb93b('0x41')]=[{'all':!![]}];}_0x159d3b=_[_0xb93b('0x3e')]({},_0x159d3b,_0x382261['options']);return db[_0xb93b('0x2d')][_0xb93b('0x48')](_0x159d3b)['then'](handleEntityNotFound(_0x6f9464,null))[_0xb93b('0x26')](respondWithResult(_0x6f9464,null))[_0xb93b('0x44')](handleError(_0x6f9464,null));};exports['create']=function(_0x4951fe,_0x31bd33){return db[_0xb93b('0x2d')]['create'](_0x4951fe[_0xb93b('0x49')],{})[_0xb93b('0x26')](respondWithResult(_0x31bd33,0xc9))[_0xb93b('0x44')](handleError(_0x31bd33,null));};exports[_0xb93b('0x4a')]=function(_0x1b3ca9,_0x2b47d4){if(_0x1b3ca9['body']['id']){delete _0x1b3ca9[_0xb93b('0x49')]['id'];}return db[_0xb93b('0x2d')]['find']({'where':{'id':_0x1b3ca9[_0xb93b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b47d4,null))[_0xb93b('0x26')](saveUpdates(_0x1b3ca9[_0xb93b('0x49')],null))[_0xb93b('0x26')](respondWithResult(_0x2b47d4,null))[_0xb93b('0x44')](handleError(_0x2b47d4,null));};exports[_0xb93b('0x27')]=function(_0x536890,_0x56f7ea){return db[_0xb93b('0x2d')][_0xb93b('0x48')]({'where':{'id':_0x536890[_0xb93b('0x45')]['id']}})[_0xb93b('0x26')](handleEntityNotFound(_0x56f7ea,null))[_0xb93b('0x26')](removeEntity(_0x56f7ea,null))[_0xb93b('0x44')](handleError(_0x56f7ea,null));};exports[_0xb93b('0x4b')]=function(_0x49797b,_0x48c2df){return db['JscriptyAnswerReport'][_0xb93b('0x4b')]()['then'](respondWithResult(_0x48c2df,null))['catch'](handleError(_0x48c2df,null));}; \ No newline at end of file +var _0x4300=['stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x4300,0x1a6));var _0x0430=function(_0x1e3ce5,_0x497c6c){_0x1e3ce5=_0x1e3ce5-0x0;var _0x104b67=_0x4300[_0x1e3ce5];return _0x104b67;};'use strict';var emlformat=require(_0x0430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0430('0x1'));var BPromise=require(_0x0430('0x2'));var Mustache=require(_0x0430('0x3'));var util=require(_0x0430('0x4'));var path=require(_0x0430('0x5'));var sox=require('sox');var csv=require(_0x0430('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0430('0x7'));var _=require('lodash');var squel=require(_0x0430('0x8'));var crypto=require(_0x0430('0x9'));var jsforce=require(_0x0430('0xa'));var deskjs=require(_0x0430('0xb'));var toCsv=require(_0x0430('0x6'));var querystring=require(_0x0430('0xc'));var Papa=require(_0x0430('0xd'));var Redis=require(_0x0430('0xe'));var authService=require(_0x0430('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0430('0x10'));var hardwareService=require(_0x0430('0x11'));var logger=require(_0x0430('0x12'))(_0x0430('0x13'));var utils=require(_0x0430('0x14'));var config=require(_0x0430('0x15'));var licenseUtil=require(_0x0430('0x16'));var db=require(_0x0430('0x17'))['db'];function respondWithStatusCode(_0x5315a3,_0x4b382a){_0x4b382a=_0x4b382a||0xcc;return function(_0x4292f7){if(_0x4292f7){return _0x5315a3[_0x0430('0x18')](_0x4b382a);}return _0x5315a3[_0x0430('0x19')](_0x4b382a)[_0x0430('0x1a')]();};}function respondWithResult(_0x671534,_0x39d4e2){_0x39d4e2=_0x39d4e2||0xc8;return function(_0x182e2c){if(_0x182e2c){return _0x671534['status'](_0x39d4e2)[_0x0430('0x1b')](_0x182e2c);}};}function respondWithFilteredResult(_0x40e6dc,_0x8fe471){return function(_0x3b34af){if(_0x3b34af){var _0x5c98c9=typeof _0x8fe471['offset']==='undefined'&&typeof _0x8fe471[_0x0430('0x1c')]==='undefined';var _0x495094=_0x3b34af[_0x0430('0x1d')];var _0x2f23b9=_0x5c98c9?0x0:_0x8fe471[_0x0430('0x1e')];var _0xd33c3c=_0x5c98c9?_0x3b34af[_0x0430('0x1d')]:_0x8fe471['offset']+_0x8fe471['limit'];var _0xf11cda;if(_0xd33c3c>=_0x495094){_0xd33c3c=_0x495094;_0xf11cda=0xc8;}else{_0xf11cda=0xce;}_0x40e6dc[_0x0430('0x19')](_0xf11cda);return _0x40e6dc[_0x0430('0x1f')](_0x0430('0x20'),_0x2f23b9+'-'+_0xd33c3c+'/'+_0x495094)['json'](_0x3b34af);}return null;};}function patchUpdates(_0x4d3af1){return function(_0x12a05c){try{jsonpatch[_0x0430('0x21')](_0x12a05c,_0x4d3af1,!![]);}catch(_0x301992){return BPromise[_0x0430('0x22')](_0x301992);}return _0x12a05c[_0x0430('0x23')]();};}function saveUpdates(_0xb17238,_0x5da567){return function(_0x11160f){if(_0x11160f){return _0x11160f[_0x0430('0x24')](_0xb17238)[_0x0430('0x25')](function(_0x1d5b51){return _0x1d5b51;});}return null;};}function removeEntity(_0x54e1a3,_0x188b12){return function(_0x28faa2){if(_0x28faa2){return _0x28faa2[_0x0430('0x26')]()[_0x0430('0x25')](function(){_0x54e1a3[_0x0430('0x19')](0xcc)[_0x0430('0x1a')]();});}};}function handleEntityNotFound(_0x345b8c,_0x3e74d8){return function(_0x36ff02){if(!_0x36ff02){_0x345b8c['sendStatus'](0x194);}return _0x36ff02;};}function handleError(_0x375e54,_0x531611){_0x531611=_0x531611||0x1f4;return function(_0x5a79d6){logger[_0x0430('0x27')](_0x5a79d6[_0x0430('0x28')]);if(_0x5a79d6['name']){delete _0x5a79d6[_0x0430('0x29')];}_0x375e54[_0x0430('0x19')](_0x531611)[_0x0430('0x2a')](_0x5a79d6);};}exports[_0x0430('0x2b')]=function(_0x2b94e4,_0x3805f7){var _0x1df9ec={},_0xd6b31a={},_0x36f6ff={'count':0x0,'rows':[]};var _0x5ae72c=_['map'](db['JscriptyAnswerReport'][_0x0430('0x2c')],function(_0x47e1f3){return{'name':_0x47e1f3[_0x0430('0x2d')],'type':_0x47e1f3['type']['key']};});_0xd6b31a[_0x0430('0x2e')]=_[_0x0430('0x2f')](_0x5ae72c,_0x0430('0x29'));_0xd6b31a[_0x0430('0x30')]=_['keys'](_0x2b94e4['query']);_0xd6b31a[_0x0430('0x31')]=_[_0x0430('0x32')](_0xd6b31a['model'],_0xd6b31a['query']);_0x1df9ec[_0x0430('0x33')]=_[_0x0430('0x32')](_0xd6b31a[_0x0430('0x2e')],qs[_0x0430('0x34')](_0x2b94e4[_0x0430('0x30')][_0x0430('0x34')]));_0x1df9ec[_0x0430('0x33')]=_0x1df9ec[_0x0430('0x33')][_0x0430('0x35')]?_0x1df9ec['attributes']:_0xd6b31a[_0x0430('0x2e')];if(!_0x2b94e4[_0x0430('0x30')][_0x0430('0x36')]('nolimit')){_0x1df9ec[_0x0430('0x1c')]=qs['limit'](_0x2b94e4[_0x0430('0x30')]['limit']);_0x1df9ec['offset']=qs[_0x0430('0x1e')](_0x2b94e4[_0x0430('0x30')][_0x0430('0x1e')]);}_0x1df9ec[_0x0430('0x37')]=qs[_0x0430('0x38')](_0x2b94e4[_0x0430('0x30')]['sort']);_0x1df9ec[_0x0430('0x39')]=qs[_0x0430('0x31')](_[_0x0430('0x3a')](_0x2b94e4[_0x0430('0x30')],_0xd6b31a[_0x0430('0x31')]),_0x5ae72c);if(_0x2b94e4[_0x0430('0x30')][_0x0430('0x3b')]){_0x1df9ec[_0x0430('0x39')]=_[_0x0430('0x3c')](_0x1df9ec[_0x0430('0x39')],{'$or':_['map'](_0x5ae72c,function(_0x44c546){if(_0x44c546[_0x0430('0x3d')]!==_0x0430('0x3e')){var _0x314b27={};_0x314b27[_0x44c546[_0x0430('0x29')]]={'$like':'%'+_0x2b94e4[_0x0430('0x30')]['filter']+'%'};return _0x314b27;}})});}_0x1df9ec=_[_0x0430('0x3c')]({},_0x1df9ec,_0x2b94e4[_0x0430('0x3f')]);var _0x50cdcd={'where':_0x1df9ec[_0x0430('0x39')]};return db[_0x0430('0x40')][_0x0430('0x1d')](_0x50cdcd)[_0x0430('0x25')](function(_0x2d6345){_0x36f6ff[_0x0430('0x1d')]=_0x2d6345;if(_0x2b94e4[_0x0430('0x30')][_0x0430('0x41')]){_0x1df9ec[_0x0430('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x0430('0x43')](_0x1df9ec);})[_0x0430('0x25')](function(_0x456f36){_0x36f6ff[_0x0430('0x44')]=_0x456f36;return _0x36f6ff;})['then'](respondWithFilteredResult(_0x3805f7,_0x1df9ec))[_0x0430('0x45')](handleError(_0x3805f7,null));};exports[_0x0430('0x46')]=function(_0x16e96c,_0x435028){var _0x26992f={'raw':!![],'where':{'id':_0x16e96c[_0x0430('0x47')]['id']}},_0x3cc598={};_0x3cc598[_0x0430('0x2e')]=_[_0x0430('0x48')](db[_0x0430('0x40')][_0x0430('0x2c')]);_0x3cc598['query']=_[_0x0430('0x48')](_0x16e96c['query']);_0x3cc598['filters']=_[_0x0430('0x32')](_0x3cc598['model'],_0x3cc598['query']);_0x26992f[_0x0430('0x33')]=_['intersection'](_0x3cc598['model'],qs[_0x0430('0x34')](_0x16e96c['query']['fields']));_0x26992f[_0x0430('0x33')]=_0x26992f['attributes']['length']?_0x26992f[_0x0430('0x33')]:_0x3cc598[_0x0430('0x2e')];if(_0x16e96c[_0x0430('0x30')]['includeAll']){_0x26992f[_0x0430('0x42')]=[{'all':!![]}];}_0x26992f=_[_0x0430('0x3c')]({},_0x26992f,_0x16e96c[_0x0430('0x3f')]);return db['JscriptyAnswerReport']['find'](_0x26992f)[_0x0430('0x25')](handleEntityNotFound(_0x435028,null))[_0x0430('0x25')](respondWithResult(_0x435028,null))[_0x0430('0x45')](handleError(_0x435028,null));};exports[_0x0430('0x49')]=function(_0x5e84f4,_0x5a4500){return db['JscriptyAnswerReport'][_0x0430('0x49')](_0x5e84f4[_0x0430('0x4a')],{})[_0x0430('0x25')](respondWithResult(_0x5a4500,0xc9))[_0x0430('0x45')](handleError(_0x5a4500,null));};exports[_0x0430('0x24')]=function(_0x421280,_0x5c3184){if(_0x421280['body']['id']){delete _0x421280[_0x0430('0x4a')]['id'];}return db[_0x0430('0x40')][_0x0430('0x4b')]({'where':{'id':_0x421280[_0x0430('0x47')]['id']}})[_0x0430('0x25')](handleEntityNotFound(_0x5c3184,null))[_0x0430('0x25')](saveUpdates(_0x421280[_0x0430('0x4a')],null))[_0x0430('0x25')](respondWithResult(_0x5c3184,null))[_0x0430('0x45')](handleError(_0x5c3184,null));};exports[_0x0430('0x26')]=function(_0x4387db,_0x2bdcd6){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x4387db[_0x0430('0x47')]['id']}})[_0x0430('0x25')](handleEntityNotFound(_0x2bdcd6,null))[_0x0430('0x25')](removeEntity(_0x2bdcd6,null))[_0x0430('0x45')](handleError(_0x2bdcd6,null));};exports[_0x0430('0x4c')]=function(_0x261996,_0xfa67a4){return db[_0x0430('0x40')][_0x0430('0x4c')]()[_0x0430('0x25')](respondWithResult(_0xfa67a4,null))[_0x0430('0x45')](handleError(_0xfa67a4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index ac49205..b8b4e5f 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 _0x7715=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger'];(function(_0x162ded,_0x32e6ed){var _0x13a5e9=function(_0x7dd694){while(--_0x7dd694){_0x162ded['push'](_0x162ded['shift']());}};_0x13a5e9(++_0x32e6ed);}(_0x7715,0x1de));var _0x5771=function(_0xf3d340,_0x5107f0){_0xf3d340=_0xf3d340-0x0;var _0x582f7b=_0x7715[_0xf3d340];return _0x582f7b;};'use strict';var _=require('lodash');var util=require(_0x5771('0x0'));var logger=require(_0x5771('0x1'))('api');var moment=require(_0x5771('0x2'));var BPromise=require(_0x5771('0x3'));var rp=require(_0x5771('0x4'));var fs=require('fs');var path=require(_0x5771('0x5'));var rimraf=require('rimraf');var config=require(_0x5771('0x6'));var attributes=require(_0x5771('0x7'));module[_0x5771('0x8')]=function(_0x5d024e,_0x48a6cf){return _0x5d024e[_0x5771('0x9')](_0x5771('0xa'),attributes,{'tableName':_0x5771('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c51=['define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x5dc439,_0x262749){var _0x1aa134=function(_0x2c72f4){while(--_0x2c72f4){_0x5dc439['push'](_0x5dc439['shift']());}};_0x1aa134(++_0x262749);}(_0x2c51,0x11b));var _0x12c5=function(_0x2ae5b4,_0x556c0f){_0x2ae5b4=_0x2ae5b4-0x0;var _0x50e98e=_0x2c51[_0x2ae5b4];return _0x50e98e;};'use strict';var _=require('lodash');var util=require(_0x12c5('0x0'));var logger=require(_0x12c5('0x1'))(_0x12c5('0x2'));var moment=require(_0x12c5('0x3'));var BPromise=require(_0x12c5('0x4'));var rp=require(_0x12c5('0x5'));var fs=require('fs');var path=require(_0x12c5('0x6'));var rimraf=require(_0x12c5('0x7'));var config=require(_0x12c5('0x8'));var attributes=require(_0x12c5('0x9'));module[_0x12c5('0xa')]=function(_0x39b1bb,_0xc6c452){return _0x39b1bb[_0x12c5('0xb')](_0x12c5('0xc'),attributes,{'tableName':_0x12c5('0xd'),'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 c99e796..91446a0 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 _0xdec1=['../../config/environment','jayson/promise','http','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xdec1,0x11f));var _0x1dec=function(_0x5392cd,_0x3fadd7){_0x5392cd=_0x5392cd-0x0;var _0x4b7c5d=_0xdec1[_0x5392cd];return _0x4b7c5d;};'use strict';var _=require(_0x1dec('0x0'));var util=require('util');var moment=require(_0x1dec('0x1'));var BPromise=require(_0x1dec('0x2'));var rs=require(_0x1dec('0x3'));var fs=require('fs');var Redis=require(_0x1dec('0x4'));var db=require(_0x1dec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dec('0x6'))('rpc');var config=require(_0x1dec('0x7'));var jayson=require(_0x1dec('0x8'));var client=jayson['client'][_0x1dec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41a1f5,_0x53a411,_0x49cb3a){return new BPromise(function(_0x3bb933,_0x44290c){return client['request'](_0x41a1f5,_0x49cb3a)[_0x1dec('0xa')](function(_0x30dca1){logger['info'](_0x1dec('0xb'),_0x53a411,'request\x20sent');logger[_0x1dec('0xc')](_0x1dec('0xd'),_0x53a411,_0x1dec('0xe'),JSON[_0x1dec('0xf')](_0x30dca1));if(_0x30dca1[_0x1dec('0x10')]){if(_0x30dca1[_0x1dec('0x10')][_0x1dec('0x11')]===0x1f4){logger[_0x1dec('0x10')](_0x1dec('0xb'),_0x53a411,_0x30dca1[_0x1dec('0x10')][_0x1dec('0x12')]);return _0x44290c(_0x30dca1[_0x1dec('0x10')][_0x1dec('0x12')]);}logger['error'](_0x1dec('0xb'),_0x53a411,_0x30dca1[_0x1dec('0x10')][_0x1dec('0x12')]);return _0x3bb933(_0x30dca1[_0x1dec('0x10')][_0x1dec('0x12')]);}else{logger['info'](_0x1dec('0xb'),_0x53a411,'request\x20sent');_0x3bb933(_0x30dca1[_0x1dec('0x13')]['message']);}})[_0x1dec('0x14')](function(_0x5ed779){logger[_0x1dec('0x10')](_0x1dec('0xb'),_0x53a411,_0x5ed779);_0x44290c(_0x5ed779);});});} \ No newline at end of file +var _0x244f=['client','http','info','request\x20sent','debug','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x244f,0xe4));var _0xf244=function(_0x51a54c,_0x39830f){_0x51a54c=_0x51a54c-0x0;var _0x38ead2=_0x244f[_0x51a54c];return _0x38ead2;};'use strict';var _=require(_0xf244('0x0'));var util=require(_0xf244('0x1'));var moment=require(_0xf244('0x2'));var BPromise=require(_0xf244('0x3'));var rs=require(_0xf244('0x4'));var fs=require('fs');var Redis=require(_0xf244('0x5'));var db=require(_0xf244('0x6'))['db'];var utils=require(_0xf244('0x7'));var logger=require(_0xf244('0x8'))(_0xf244('0x9'));var config=require(_0xf244('0xa'));var jayson=require(_0xf244('0xb'));var client=jayson[_0xf244('0xc')][_0xf244('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3d1c63,_0x347b09,_0x19cf64){return new BPromise(function(_0x334407,_0x2d4393){return client['request'](_0x3d1c63,_0x19cf64)['then'](function(_0x3146e7){logger[_0xf244('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x347b09,_0xf244('0xf'));logger[_0xf244('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x347b09,_0xf244('0xf'),JSON[_0xf244('0x11')](_0x3146e7));if(_0x3146e7[_0xf244('0x12')]){if(_0x3146e7[_0xf244('0x12')][_0xf244('0x13')]===0x1f4){logger[_0xf244('0x12')](_0xf244('0x14'),_0x347b09,_0x3146e7[_0xf244('0x12')][_0xf244('0x15')]);return _0x2d4393(_0x3146e7[_0xf244('0x12')][_0xf244('0x15')]);}logger[_0xf244('0x12')](_0xf244('0x14'),_0x347b09,_0x3146e7[_0xf244('0x12')][_0xf244('0x15')]);return _0x334407(_0x3146e7[_0xf244('0x12')][_0xf244('0x15')]);}else{logger[_0xf244('0xe')](_0xf244('0x14'),_0x347b09,'request\x20sent');_0x334407(_0x3146e7[_0xf244('0x16')][_0xf244('0x15')]);}})[_0xf244('0x17')](function(_0x11e231){logger['error'](_0xf244('0x14'),_0x347b09,_0x11e231);_0x2d4393(_0x11e231);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index f7f4b76..7591052 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 _0xdc30=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c089c,_0xcc0dfd){var _0x5c6ebd=function(_0x389a35){while(--_0x389a35){_0x4c089c['push'](_0x4c089c['shift']());}};_0x5c6ebd(++_0xcc0dfd);}(_0xdc30,0xc8));var _0x0dc3=function(_0x252ef1,_0x2e0041){_0x252ef1=_0x252ef1-0x0;var _0x25817c=_0xdc30[_0x252ef1];return _0x25817c;};'use strict';var multer=require(_0x0dc3('0x0'));var util=require(_0x0dc3('0x1'));var path=require(_0x0dc3('0x2'));var timeout=require(_0x0dc3('0x3'));var express=require(_0x0dc3('0x4'));var router=express['Router']();var fs_extra=require(_0x0dc3('0x5'));var auth=require(_0x0dc3('0x6'));var interaction=require(_0x0dc3('0x7'));var config=require(_0x0dc3('0x8'));var controller=require(_0x0dc3('0x9'));router[_0x0dc3('0xa')]('/',auth[_0x0dc3('0xb')](),controller['index']);router[_0x0dc3('0xa')](_0x0dc3('0xc'),auth[_0x0dc3('0xb')](),controller[_0x0dc3('0xd')]);router[_0x0dc3('0xa')](_0x0dc3('0xe'),auth['isAuthenticated'](),controller[_0x0dc3('0xf')]);router[_0x0dc3('0xa')](_0x0dc3('0x10'),auth[_0x0dc3('0xb')](),controller[_0x0dc3('0x11')]);router['get'](_0x0dc3('0x12'),auth['isAuthenticated'](),timeout(_0x0dc3('0x13')),controller[_0x0dc3('0x14')]);router[_0x0dc3('0x15')]('/',auth[_0x0dc3('0xb')](),controller['create']);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x0dc3('0x16')](_0x0dc3('0xc'),auth[_0x0dc3('0xb')](),controller['update']);router[_0x0dc3('0x17')](_0x0dc3('0xc'),auth[_0x0dc3('0xb')](),controller[_0x0dc3('0x18')]);module[_0x0dc3('0x19')]=router; \ No newline at end of file +var _0xbf4f=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','clone','put','update','delete','destroy','util','path'];(function(_0x1090fa,_0x597781){var _0x3c39c3=function(_0x5887fb){while(--_0x5887fb){_0x1090fa['push'](_0x1090fa['shift']());}};_0x3c39c3(++_0x597781);}(_0xbf4f,0x1ae));var _0xfbf4=function(_0x4b0eab,_0x4862cb){_0x4b0eab=_0x4b0eab-0x0;var _0x373dd3=_0xbf4f[_0x4b0eab];return _0x373dd3;};'use strict';var multer=require('multer');var util=require(_0xfbf4('0x0'));var path=require(_0xfbf4('0x1'));var timeout=require(_0xfbf4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfbf4('0x3'));var auth=require(_0xfbf4('0x4'));var interaction=require(_0xfbf4('0x5'));var config=require(_0xfbf4('0x6'));var controller=require(_0xfbf4('0x7'));router[_0xfbf4('0x8')]('/',auth[_0xfbf4('0x9')](),controller[_0xfbf4('0xa')]);router['get'](_0xfbf4('0xb'),auth[_0xfbf4('0x9')](),controller[_0xfbf4('0xc')]);router['get'](_0xfbf4('0xd'),auth[_0xfbf4('0x9')](),controller[_0xfbf4('0xe')]);router['get'](_0xfbf4('0xf'),auth[_0xfbf4('0x9')](),controller[_0xfbf4('0x10')]);router[_0xfbf4('0x8')](_0xfbf4('0x11'),auth['isAuthenticated'](),timeout(_0xfbf4('0x12')),controller[_0xfbf4('0x13')]);router[_0xfbf4('0x14')]('/',auth[_0xfbf4('0x9')](),controller[_0xfbf4('0x15')]);router[_0xfbf4('0x14')]('/:id/clone',auth[_0xfbf4('0x9')](),controller[_0xfbf4('0x16')]);router[_0xfbf4('0x17')](_0xfbf4('0xb'),auth['isAuthenticated'](),controller[_0xfbf4('0x18')]);router[_0xfbf4('0x19')](_0xfbf4('0xb'),auth[_0xfbf4('0x9')](),controller[_0xfbf4('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index c68ef87..ce7ebef 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 _0xd2a2=['TEXT','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','STRING','name'];(function(_0x11e902,_0x5e6a6d){var _0x2b3380=function(_0x139aec){while(--_0x139aec){_0x11e902['push'](_0x11e902['shift']());}};_0x2b3380(++_0x5e6a6d);}(_0xd2a2,0x1c9));var _0x2d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x2d2a('0x0')],'unique':_0x2d2a('0x1')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2d2a('0x2')]('long'),'set':function(_0x514c2c){if(_['isObjectLike'](_0x514c2c)){this[_0x2d2a('0x3')]('formData',JSON[_0x2d2a('0x4')](_0x514c2c));}else if(_[_0x2d2a('0x5')](_0x514c2c)){this[_0x2d2a('0x3')](_0x2d2a('0x6'),_0x514c2c);}else{this[_0x2d2a('0x3')](_0x2d2a('0x6'),util['format'](_0x2d2a('0x7'),this['getDataValue'](_0x2d2a('0x1'))||'',this[_0x2d2a('0x8')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5e83=['setDataValue','formData','stringify','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','exports','STRING','name','long','isObjectLike'];(function(_0x29cd97,_0x2a1882){var _0x2cc3c9=function(_0x546f9b){while(--_0x546f9b){_0x29cd97['push'](_0x29cd97['shift']());}};_0x2cc3c9(++_0x2a1882);}(_0x5e83,0x126));var _0x35e8=function(_0x4f676e,_0x571ace){_0x4f676e=_0x4f676e-0x0;var _0x542a9b=_0x5e83[_0x4f676e];return _0x542a9b;};'use strict';var Sequelize=require(_0x35e8('0x0'));var _=require('lodash');var util=require('util');module[_0x35e8('0x1')]={'name':{'type':Sequelize[_0x35e8('0x2')],'unique':_0x35e8('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x35e8('0x4')),'set':function(_0x3d47d7){if(_[_0x35e8('0x5')](_0x3d47d7)){this[_0x35e8('0x6')](_0x35e8('0x7'),JSON[_0x35e8('0x8')](_0x3d47d7));}else if(_['isString'](_0x3d47d7)){this['setDataValue'](_0x35e8('0x7'),_0x3d47d7);}else{this[_0x35e8('0x6')](_0x35e8('0x7'),util['format'](_0x35e8('0x9'),this[_0x35e8('0xa')](_0x35e8('0x3'))||'',this[_0x35e8('0xa')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x35e8('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 8d81bf7..a0f5c79 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 _0xf24b=['type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','autoAssociation','update','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','nolimit','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','then','destroy','Projects','UserProfileResource','end','error','stack','name','send','index','map','JscriptyProject','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge'];(function(_0x3336b6,_0x127d4f){var _0x520cba=function(_0x568e7a){while(--_0x568e7a){_0x3336b6['push'](_0x3336b6['shift']());}};_0x520cba(++_0x127d4f);}(_0xf24b,0xad));var _0xbf24=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0xf24b[_0x470f24];return _0x2c6fc8;};'use strict';var emlformat=require(_0xbf24('0x0'));var rimraf=require(_0xbf24('0x1'));var zipdir=require(_0xbf24('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf24('0x3'));var moment=require('moment');var BPromise=require(_0xbf24('0x4'));var Mustache=require(_0xbf24('0x5'));var util=require('util');var path=require(_0xbf24('0x6'));var sox=require(_0xbf24('0x7'));var csv=require(_0xbf24('0x8'));var ejs=require(_0xbf24('0x9'));var fs=require('fs');var fs_extra=require(_0xbf24('0xa'));var _=require('lodash');var squel=require(_0xbf24('0xb'));var crypto=require(_0xbf24('0xc'));var jsforce=require(_0xbf24('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbf24('0xe'));var Papa=require(_0xbf24('0xf'));var Redis=require(_0xbf24('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbf24('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf24('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbf24('0x13'));var config=require(_0xbf24('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf24('0x15'))['db'];function respondWithStatusCode(_0x582416,_0x3d5e1a){_0x3d5e1a=_0x3d5e1a||0xcc;return function(_0x131e4e){if(_0x131e4e){return _0x582416[_0xbf24('0x16')](_0x3d5e1a);}return _0x582416[_0xbf24('0x17')](_0x3d5e1a)['end']();};}function respondWithResult(_0x427955,_0xe8167d){_0xe8167d=_0xe8167d||0xc8;return function(_0x48b88a){if(_0x48b88a){return _0x427955['status'](_0xe8167d)[_0xbf24('0x18')](_0x48b88a);}};}function respondWithFilteredResult(_0x3bbe79,_0x57a64f){return function(_0x1c47f2){if(_0x1c47f2){var _0xadde70=typeof _0x57a64f[_0xbf24('0x19')]==='undefined'&&typeof _0x57a64f[_0xbf24('0x1a')]==='undefined';var _0x49bea9=_0x1c47f2[_0xbf24('0x1b')];var _0x1897fe=_0xadde70?0x0:_0x57a64f[_0xbf24('0x19')];var _0x4907b9=_0xadde70?_0x1c47f2[_0xbf24('0x1b')]:_0x57a64f[_0xbf24('0x19')]+_0x57a64f[_0xbf24('0x1a')];var _0x3ffac2;if(_0x4907b9>=_0x49bea9){_0x4907b9=_0x49bea9;_0x3ffac2=0xc8;}else{_0x3ffac2=0xce;}_0x3bbe79['status'](_0x3ffac2);return _0x3bbe79[_0xbf24('0x1c')](_0xbf24('0x1d'),_0x1897fe+'-'+_0x4907b9+'/'+_0x49bea9)['json'](_0x1c47f2);}return null;};}function patchUpdates(_0x4c849a){return function(_0xb8d31d){try{jsonpatch['apply'](_0xb8d31d,_0x4c849a,!![]);}catch(_0x451bbd){return BPromise[_0xbf24('0x1e')](_0x451bbd);}return _0xb8d31d['save']();};}function saveUpdates(_0x28cf58,_0x147032){return function(_0x23622a){if(_0x23622a){return _0x23622a['update'](_0x28cf58)[_0xbf24('0x1f')](function(_0x28a6bb){return _0x28a6bb;});}return null;};}function removeEntity(_0x1c5020,_0x375291){return function(_0x292646){if(_0x292646){return _0x292646[_0xbf24('0x20')]()[_0xbf24('0x1f')](function(){var _0x482e18=_0x292646['get']({'plain':!![]});var _0x38d51c=_0xbf24('0x21');return db[_0xbf24('0x22')][_0xbf24('0x20')]({'where':{'type':_0x38d51c,'resourceId':_0x482e18['id']}})[_0xbf24('0x1f')](function(){return _0x292646;});})[_0xbf24('0x1f')](function(){_0x1c5020[_0xbf24('0x17')](0xcc)[_0xbf24('0x23')]();});}};}function handleEntityNotFound(_0x47645c,_0x14c84e){return function(_0x278428){if(!_0x278428){_0x47645c[_0xbf24('0x16')](0x194);}return _0x278428;};}function handleError(_0x3bbf8a,_0x238e35){_0x238e35=_0x238e35||0x1f4;return function(_0x235985){logger[_0xbf24('0x24')](_0x235985[_0xbf24('0x25')]);if(_0x235985[_0xbf24('0x26')]){delete _0x235985[_0xbf24('0x26')];}_0x3bbf8a['status'](_0x238e35)[_0xbf24('0x27')](_0x235985);};}exports[_0xbf24('0x28')]=function(_0x17dd94,_0x58eafa){var _0x8c12fc={},_0x412dc4={},_0x5449e8={'count':0x0,'rows':[]};var _0x59e8a6=_[_0xbf24('0x29')](db[_0xbf24('0x2a')]['rawAttributes'],function(_0x2ad3a0){return{'name':_0x2ad3a0[_0xbf24('0x2b')],'type':_0x2ad3a0['type'][_0xbf24('0x2c')]};});_0x412dc4['model']=_['map'](_0x59e8a6,_0xbf24('0x26'));_0x412dc4[_0xbf24('0x2d')]=_[_0xbf24('0x2e')](_0x17dd94[_0xbf24('0x2d')]);_0x412dc4[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x412dc4['model'],_0x412dc4[_0xbf24('0x2d')]);_0x8c12fc[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x412dc4[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x17dd94['query'][_0xbf24('0x33')]));_0x8c12fc[_0xbf24('0x31')]=_0x8c12fc[_0xbf24('0x31')][_0xbf24('0x34')]?_0x8c12fc[_0xbf24('0x31')]:_0x412dc4[_0xbf24('0x32')];if(!_0x17dd94['query'][_0xbf24('0x35')]('nolimit')){_0x8c12fc['limit']=qs[_0xbf24('0x1a')](_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x1a')]);_0x8c12fc[_0xbf24('0x19')]=qs[_0xbf24('0x19')](_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x19')]);}_0x8c12fc['order']=qs[_0xbf24('0x36')](_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x36')]);_0x8c12fc[_0xbf24('0x37')]=qs['filters'](_[_0xbf24('0x38')](_0x17dd94[_0xbf24('0x2d')],_0x412dc4[_0xbf24('0x2f')]),_0x59e8a6);if(_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x39')]){_0x8c12fc[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x8c12fc[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x59e8a6,function(_0x1f46f6){if(_0x1f46f6[_0xbf24('0x3b')]!==_0xbf24('0x3c')){var _0x3792f5={};_0x3792f5[_0x1f46f6['name']]={'$like':'%'+_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x3792f5;}})});}_0x8c12fc=_[_0xbf24('0x3a')]({},_0x8c12fc,_0x17dd94[_0xbf24('0x3d')]);var _0x3d2a7e={'where':_0x8c12fc['where']};return db[_0xbf24('0x2a')][_0xbf24('0x1b')](_0x3d2a7e)[_0xbf24('0x1f')](function(_0x154b6c){_0x5449e8['count']=_0x154b6c;if(_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x8c12fc[_0xbf24('0x3f')]=[{'all':!![]}];}return db[_0xbf24('0x2a')][_0xbf24('0x40')](_0x8c12fc);})[_0xbf24('0x1f')](function(_0x5d0fc0){_0x5449e8[_0xbf24('0x41')]=_0x5d0fc0;return _0x5449e8;})[_0xbf24('0x1f')](respondWithFilteredResult(_0x58eafa,_0x8c12fc))[_0xbf24('0x42')](handleError(_0x58eafa,null));};exports[_0xbf24('0x43')]=function(_0x5abda5,_0x1b81b4){var _0x60f9a8={'raw':![],'where':{'id':_0x5abda5['params']['id']}},_0x10b0b5={};_0x10b0b5[_0xbf24('0x32')]=_[_0xbf24('0x2e')](db[_0xbf24('0x2a')][_0xbf24('0x44')]);_0x10b0b5[_0xbf24('0x2d')]=_[_0xbf24('0x2e')](_0x5abda5[_0xbf24('0x2d')]);_0x10b0b5[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x10b0b5[_0xbf24('0x32')],_0x10b0b5[_0xbf24('0x2d')]);_0x60f9a8[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x10b0b5[_0xbf24('0x32')],qs['fields'](_0x5abda5['query'][_0xbf24('0x33')]));_0x60f9a8[_0xbf24('0x31')]=_0x60f9a8[_0xbf24('0x31')][_0xbf24('0x34')]?_0x60f9a8[_0xbf24('0x31')]:_0x10b0b5[_0xbf24('0x32')];if(_0x5abda5[_0xbf24('0x2d')]['includeAll']){_0x60f9a8['include']=[{'all':!![]}];}_0x60f9a8=_[_0xbf24('0x3a')]({},_0x60f9a8,_0x5abda5['options']);return db[_0xbf24('0x2a')]['find'](_0x60f9a8)['then'](handleEntityNotFound(_0x1b81b4,null))[_0xbf24('0x1f')](respondWithResult(_0x1b81b4,null))['catch'](handleError(_0x1b81b4,null));};exports[_0xbf24('0x45')]=function(_0x2796c2,_0x5aed65){return db[_0xbf24('0x2a')][_0xbf24('0x45')](_0x2796c2[_0xbf24('0x46')],{})[_0xbf24('0x1f')](function(_0x201fa0){var _0x4904aa=_0x2796c2[_0xbf24('0x47')][_0xbf24('0x48')]({'plain':!![]});if(!_0x4904aa)throw new Error(_0xbf24('0x49'));if(_0x4904aa[_0xbf24('0x4a')]===_0xbf24('0x47')){var _0x367c4e=_0x201fa0['get']({'plain':!![]});var _0x2d89df=_0xbf24('0x21');return db[_0xbf24('0x4b')][_0xbf24('0x4c')]({'where':{'name':_0x2d89df,'userProfileId':_0x4904aa[_0xbf24('0x4d')]},'raw':!![]})['then'](function(_0x393cff){if(_0x393cff&&_0x393cff['autoAssociation']===0x0){return db[_0xbf24('0x22')][_0xbf24('0x45')]({'name':_0x367c4e[_0xbf24('0x26')],'resourceId':_0x367c4e['id'],'type':_0x393cff[_0xbf24('0x26')],'sectionId':_0x393cff['id']},{})['then'](function(){return _0x201fa0;});}else{return _0x201fa0;}})[_0xbf24('0x42')](function(_0x258277){logger[_0xbf24('0x24')](_0xbf24('0x4e'),_0x258277);throw _0x258277;});}return _0x201fa0;})[_0xbf24('0x1f')](respondWithResult(_0x5aed65,0xc9))[_0xbf24('0x42')](handleError(_0x5aed65,null));};exports[_0xbf24('0x4f')]=function(_0x1c9f7f,_0x142329){var _0x407f2a={'where':{'id':_0x1c9f7f[_0xbf24('0x50')]['id']}},_0x58ecca={};_0x58ecca['model']=_[_0xbf24('0x2e')](db[_0xbf24('0x2a')][_0xbf24('0x44')]);_0x407f2a[_0xbf24('0x31')]=_['intersection'](_0x58ecca[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x1c9f7f['query']['fields']));_0x407f2a[_0xbf24('0x31')]=_0x407f2a[_0xbf24('0x31')][_0xbf24('0x34')]?_0x407f2a[_0xbf24('0x31')]:_0x58ecca[_0xbf24('0x32')];if(_0x1c9f7f['query'][_0xbf24('0x3e')]){_0x407f2a[_0xbf24('0x3f')]=[{'all':!![]}];}_0x407f2a=_['merge']({},_0x407f2a,_0x1c9f7f[_0xbf24('0x3d')]);return db[_0xbf24('0x2a')][_0xbf24('0x4c')](_0x407f2a)['then'](handleEntityNotFound(_0x142329,null))['then'](function(_0x4452a6){if(_0x4452a6){var _0x122483=_0x4452a6[_0xbf24('0x48')]({'plain':!![]});_0x122483=qs[_0xbf24('0x51')](_0x122483,['id',_0xbf24('0x52'),_0xbf24('0x53')]);_0x1c9f7f[_0xbf24('0x46')]=_[_0xbf24('0x51')](_0x1c9f7f['body'],['id',_0xbf24('0x52'),_0xbf24('0x53')]);return db[_0xbf24('0x2a')][_0xbf24('0x45')](_[_0xbf24('0x3a')](_0x122483,_0x1c9f7f[_0xbf24('0x46')]),{'include':_0x1c9f7f[_0xbf24('0x2d')][_0xbf24('0x3e')]?[{'all':!![]}]:undefined})[_0xbf24('0x1f')](function(_0x2d999b){var _0x2cfaae=_0x1c9f7f[_0xbf24('0x47')][_0xbf24('0x48')]({'plain':!![]});if(!_0x2cfaae)throw new Error(_0xbf24('0x49'));if(_0x2cfaae['role']==='user'){var _0x22032f=_0x2d999b['get']({'plain':!![]});var _0xddcc8=_0xbf24('0x21');return db[_0xbf24('0x4b')][_0xbf24('0x4c')]({'where':{'name':_0xddcc8,'userProfileId':_0x2cfaae[_0xbf24('0x4d')]},'raw':!![]})[_0xbf24('0x1f')](function(_0x4fa253){if(_0x4fa253&&_0x4fa253[_0xbf24('0x54')]===0x0){return db['UserProfileResource'][_0xbf24('0x45')]({'name':_0x22032f['name'],'resourceId':_0x22032f['id'],'type':_0x4fa253[_0xbf24('0x26')],'sectionId':_0x4fa253['id']},{})['then'](function(){return _0x2d999b;});}else{return _0x2d999b;}})[_0xbf24('0x42')](function(_0x67cc1e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x67cc1e);throw _0x67cc1e;});}return _0x2d999b;});}})['then'](respondWithResult(_0x142329,0xc9))[_0xbf24('0x42')](handleError(_0x142329,null));};exports[_0xbf24('0x55')]=function(_0x4eb40a,_0x5013c1){if(_0x4eb40a[_0xbf24('0x46')]['id']){delete _0x4eb40a[_0xbf24('0x46')]['id'];}return db[_0xbf24('0x2a')][_0xbf24('0x4c')]({'where':{'id':_0x4eb40a['params']['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x5013c1,null))[_0xbf24('0x1f')](saveUpdates(_0x4eb40a[_0xbf24('0x46')],null))[_0xbf24('0x1f')](respondWithResult(_0x5013c1,null))[_0xbf24('0x42')](handleError(_0x5013c1,null));};exports['destroy']=function(_0x5257ff,_0x3218c4){return db[_0xbf24('0x2a')][_0xbf24('0x4c')]({'where':{'id':_0x5257ff[_0xbf24('0x50')]['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x3218c4,null))[_0xbf24('0x1f')](removeEntity(_0x3218c4,null))[_0xbf24('0x42')](handleError(_0x3218c4,null));};exports[_0xbf24('0x56')]=function(_0x57693f,_0x44e85f,_0x3fb973){var _0x17c4ea={'raw':!![],'where':{}};var _0x57a146={};var _0x327e85={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbf24('0x57')]({'where':{'id':_0x57693f[_0xbf24('0x50')]['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x44e85f,null))['then'](function(_0x5c6f6f){if(_0x5c6f6f){_0x57a146[_0xbf24('0x32')]=_[_0xbf24('0x2e')](db[_0xbf24('0x58')][_0xbf24('0x44')]);_0x57a146['query']=_['keys'](_0x57693f[_0xbf24('0x2d')]);_0x57a146[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x57a146[_0xbf24('0x32')],_0x57a146[_0xbf24('0x2d')]);_0x17c4ea['attributes']=_['intersection'](_0x57a146[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x57693f[_0xbf24('0x2d')]['fields']));_0x17c4ea[_0xbf24('0x31')]=_0x17c4ea[_0xbf24('0x31')][_0xbf24('0x34')]?_0x17c4ea['attributes']:_0x57a146[_0xbf24('0x32')];if(!_0x57693f['query'][_0xbf24('0x35')]('nolimit')){_0x17c4ea['limit']=qs[_0xbf24('0x1a')](_0x57693f[_0xbf24('0x2d')][_0xbf24('0x1a')]);_0x17c4ea[_0xbf24('0x19')]=qs[_0xbf24('0x19')](_0x57693f['query'][_0xbf24('0x19')]);}_0x17c4ea[_0xbf24('0x59')]=qs[_0xbf24('0x36')](_0x57693f[_0xbf24('0x2d')][_0xbf24('0x36')]);_0x17c4ea[_0xbf24('0x37')]=qs[_0xbf24('0x2f')](_['pick'](_0x57693f[_0xbf24('0x2d')],_0x57a146['filters']));_0x17c4ea[_0xbf24('0x37')][_0xbf24('0x5a')]=_0x5c6f6f['id'];if(_0x57693f[_0xbf24('0x2d')]['filter']){_0x17c4ea[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x17c4ea[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x17c4ea[_0xbf24('0x31')],function(_0x1d4db1){var _0x27ac03={};_0x27ac03[_0x1d4db1]={'$like':'%'+_0x57693f[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x27ac03;})});}_0x17c4ea=_['merge']({},_0x17c4ea,_0x57693f['options']);return db['JscriptySessionReport']['count']({'where':_0x17c4ea[_0xbf24('0x37')]})[_0xbf24('0x1f')](function(_0x2fbee5){_0x327e85[_0xbf24('0x1b')]=_0x2fbee5;if(_0x57693f[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x17c4ea['include']=[{'all':!![]}];}return db[_0xbf24('0x58')][_0xbf24('0x40')](_0x17c4ea);})[_0xbf24('0x1f')](function(_0x4602e4){_0x327e85['rows']=_0x4602e4;return _0x327e85;});}})['then'](respondWithFilteredResult(_0x44e85f,_0x17c4ea))[_0xbf24('0x42')](handleError(_0x44e85f,null));};exports['getAnswers']=function(_0x3bacb4,_0x345612,_0x5e7723){var _0x137ceb={'raw':!![],'where':{}};var _0x238262={};var _0x5031ae={'count':0x0,'rows':[]};return db[_0xbf24('0x2a')]['findOne']({'where':{'id':_0x3bacb4['params']['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x345612,null))['then'](function(_0x186339){if(_0x186339){_0x238262[_0xbf24('0x32')]=_['keys'](db[_0xbf24('0x5b')]['rawAttributes']);_0x238262['query']=_[_0xbf24('0x2e')](_0x3bacb4[_0xbf24('0x2d')]);_0x238262[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x238262[_0xbf24('0x32')],_0x238262[_0xbf24('0x2d')]);_0x137ceb[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x238262[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x3bacb4[_0xbf24('0x2d')]['fields']));_0x137ceb[_0xbf24('0x31')]=_0x137ceb[_0xbf24('0x31')][_0xbf24('0x34')]?_0x137ceb[_0xbf24('0x31')]:_0x238262[_0xbf24('0x32')];if(!_0x3bacb4[_0xbf24('0x2d')]['hasOwnProperty'](_0xbf24('0x5c'))){_0x137ceb[_0xbf24('0x1a')]=qs[_0xbf24('0x1a')](_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x1a')]);_0x137ceb[_0xbf24('0x19')]=qs[_0xbf24('0x19')](_0x3bacb4[_0xbf24('0x2d')]['offset']);}_0x137ceb[_0xbf24('0x59')]=qs['sort'](_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x36')]);_0x137ceb[_0xbf24('0x37')]=qs[_0xbf24('0x2f')](_['pick'](_0x3bacb4[_0xbf24('0x2d')],_0x238262[_0xbf24('0x2f')]));_0x137ceb['where'][_0xbf24('0x5a')]=_0x186339['id'];if(_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x39')]){_0x137ceb[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x137ceb[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x137ceb[_0xbf24('0x31')],function(_0x486049){var _0x1aa8ec={};_0x1aa8ec[_0x486049]={'$like':'%'+_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x1aa8ec;})});}_0x137ceb=_[_0xbf24('0x3a')]({},_0x137ceb,_0x3bacb4[_0xbf24('0x3d')]);return db[_0xbf24('0x5b')]['count']({'where':_0x137ceb[_0xbf24('0x37')]})[_0xbf24('0x1f')](function(_0xcb622e){_0x5031ae['count']=_0xcb622e;if(_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x137ceb[_0xbf24('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xbf24('0x40')](_0x137ceb);})[_0xbf24('0x1f')](function(_0x55b801){_0x5031ae['rows']=_0x55b801;return _0x5031ae;});}})[_0xbf24('0x1f')](respondWithFilteredResult(_0x345612,_0x137ceb))[_0xbf24('0x42')](handleError(_0x345612,null));};function char(_0x266cc9){return'number'===typeof _0x266cc9?String[_0xbf24('0x5d')][_0xbf24('0x5e')](null,arguments):_0x266cc9;}function needsEncapsulation(_0x409d59){return!!_0x409d59&&(_0x409d59[_0xbf24('0x5f')]()[_0xbf24('0x60')](char(0xd))>=0x0||_0x409d59['toString']()[_0xbf24('0x60')](char(0xa))>=0x0||_0x409d59[_0xbf24('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x409d59[_0xbf24('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x2362a4){var _0x14e8e5=char(0x22),_0x478649='\x5c'+char(0x22),_0x45eb07=_0x2362a4[_0xbf24('0x5f')]()[_0xbf24('0x61')](new RegExp(_0x14e8e5,'g'),_0x478649);return _0x14e8e5+_0x45eb07+_0x14e8e5;}exports[_0xbf24('0x62')]=function(_0x3ff61c,_0x5eca73,_0x338805){var _0x3f6313,_0x5155bc;var _0xf43406={'where':{'ProjectId':_0x3ff61c[_0xbf24('0x50')]['id']}};if(_0x3ff61c[_0xbf24('0x2d')][_0xbf24('0x63')]){_0xf43406[_0xbf24('0x37')]['starttime']=JSON[_0xbf24('0x64')](_0x3ff61c[_0xbf24('0x2d')]['startTime']);}return db[_0xbf24('0x58')][_0xbf24('0x40')](_0xf43406)['then'](handleEntityNotFound(_0x5eca73,null))[_0xbf24('0x1f')](function(_0x43a8f2){if(_0x43a8f2){_0x3f6313=_0x43a8f2;return db[_0xbf24('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xbf24('0x29')](_0x3f6313,'id')},'ProjectId':_0x3ff61c['params']['id']},'order':_0xbf24('0x66')});}})['then'](handleEntityNotFound(_0x5eca73,null))['then'](function(_0x342ead){if(_0x342ead){_0x5155bc=_0x342ead;var _0x5df4c={};for(var _0xaadb52=0x0,_0x4e66d1=_0x5155bc[_0xbf24('0x34')];_0xaadb52<_0x4e66d1;_0xaadb52++){if(!_0x5df4c[_0xbf24('0x35')](_0x5155bc[_0xaadb52][_0xbf24('0x67')])){_0x5df4c[_0x5155bc[_0xaadb52][_0xbf24('0x67')]]=needsEncapsulation(_0x5155bc[_0xaadb52][_0xbf24('0x68')])?encapsulate(_0x5155bc[_0xaadb52][_0xbf24('0x68')]):_0x5155bc[_0xaadb52][_0xbf24('0x68')];}}var _0x2fb857=[],_0x542d33={};for(var _0x58532d=0x0,_0x9624c9=_0x3f6313[_0xbf24('0x34')];_0x58532d<_0x9624c9;_0x58532d++){_0x542d33={'ProjectId':_0x3ff61c[_0xbf24('0x50')]['id'],'SessionId':_0x3f6313[_0x58532d]['id'],'StartTime':moment(_0x3f6313[_0x58532d]['starttime'])['format'](_0xbf24('0x69'))};for(var _0x298b1b=0x0,_0x42d78c=_0x5155bc[_0xbf24('0x34')];_0x298b1b<_0x42d78c;_0x298b1b++){if(_0x5155bc[_0x298b1b][_0xbf24('0x6a')]==_0x3f6313[_0x58532d]['id']&&_0x5df4c[_0xbf24('0x35')](_0x5155bc[_0x298b1b][_0xbf24('0x67')])){_0x542d33[_0x5df4c[_0x5155bc[_0x298b1b]['questionId']]]=_0x5155bc[_0x298b1b][_0xbf24('0x6b')];}}for(var _0x48b64d in _0x5df4c){if(!_0x542d33[_0xbf24('0x35')](_0x5df4c[_0x48b64d])){_0x542d33[_0x5df4c[_0x48b64d]]=null;}}_0x2fb857[_0xbf24('0x6c')](_0x542d33);}return _0x2fb857;}})[_0xbf24('0x1f')](function(_0x10941f){if(!_[_0xbf24('0x6d')](_0x10941f)){var _0x2987a5=toCsv(_0x10941f);var _0x4f5e1a=Date['now']();fs[_0xbf24('0x6e')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x3ff61c[_0xbf24('0x50')]['id'],_0x4f5e1a),_0x2987a5);_0x5eca73[_0xbf24('0x6f')](_0xbf24('0x70'),'attachment;\x20filename='+util['format'](_0xbf24('0x71'),_0x3ff61c['params']['id'],_0x4f5e1a));_0x5eca73['setHeader']('Content-type','text/csv');return _0x5eca73['download'](util[_0xbf24('0x72')](_0xbf24('0x73'),_0x3ff61c['params']['id'],_0x4f5e1a));}else{return _0x5eca73[_0xbf24('0x16')](0xcc);}})[_0xbf24('0x42')](handleError(_0x5eca73,null));}; \ No newline at end of file +var _0x8507=['path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','Projects','UserProfileResource','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','JscriptyProject','includeAll','include','findAll','catch','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','user','autoAssociation','getSessions','findOne','nolimit','order','ProjectId','JscriptySessionReport','rows','JscriptyAnswerReport','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x375ccf,_0x14964c){var _0x1507e8=function(_0x482e1e){while(--_0x482e1e){_0x375ccf['push'](_0x375ccf['shift']());}};_0x1507e8(++_0x14964c);}(_0x8507,0x14c));var _0x7850=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8507[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7850('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7850('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7850('0x2'));var moment=require(_0x7850('0x3'));var BPromise=require(_0x7850('0x4'));var Mustache=require(_0x7850('0x5'));var util=require(_0x7850('0x6'));var path=require(_0x7850('0x7'));var sox=require(_0x7850('0x8'));var csv=require(_0x7850('0x9'));var ejs=require(_0x7850('0xa'));var fs=require('fs');var fs_extra=require(_0x7850('0xb'));var _=require('lodash');var squel=require(_0x7850('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7850('0xd'));var toCsv=require(_0x7850('0x9'));var querystring=require('querystring');var Papa=require(_0x7850('0xe'));var Redis=require(_0x7850('0xf'));var authService=require(_0x7850('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7850('0x11'));var utils=require(_0x7850('0x12'));var config=require(_0x7850('0x13'));var licenseUtil=require(_0x7850('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9368,_0x24ad91){_0x24ad91=_0x24ad91||0xcc;return function(_0x69ad72){if(_0x69ad72){return _0x1d9368[_0x7850('0x15')](_0x24ad91);}return _0x1d9368[_0x7850('0x16')](_0x24ad91)[_0x7850('0x17')]();};}function respondWithResult(_0x24fcaa,_0x47c3c5){_0x47c3c5=_0x47c3c5||0xc8;return function(_0x409f23){if(_0x409f23){return _0x24fcaa[_0x7850('0x16')](_0x47c3c5)[_0x7850('0x18')](_0x409f23);}};}function respondWithFilteredResult(_0x50db1e,_0x4dbb1b){return function(_0x4cc7fb){if(_0x4cc7fb){var _0x473c68=typeof _0x4dbb1b[_0x7850('0x19')]===_0x7850('0x1a')&&typeof _0x4dbb1b[_0x7850('0x1b')]==='undefined';var _0xbe87fa=_0x4cc7fb[_0x7850('0x1c')];var _0x4f0200=_0x473c68?0x0:_0x4dbb1b[_0x7850('0x19')];var _0x26addb=_0x473c68?_0x4cc7fb[_0x7850('0x1c')]:_0x4dbb1b[_0x7850('0x19')]+_0x4dbb1b[_0x7850('0x1b')];var _0x2f8d1e;if(_0x26addb>=_0xbe87fa){_0x26addb=_0xbe87fa;_0x2f8d1e=0xc8;}else{_0x2f8d1e=0xce;}_0x50db1e[_0x7850('0x16')](_0x2f8d1e);return _0x50db1e['set']('Content-Range',_0x4f0200+'-'+_0x26addb+'/'+_0xbe87fa)[_0x7850('0x18')](_0x4cc7fb);}return null;};}function patchUpdates(_0x58fb70){return function(_0x37eb22){try{jsonpatch[_0x7850('0x1d')](_0x37eb22,_0x58fb70,!![]);}catch(_0x14cb30){return BPromise[_0x7850('0x1e')](_0x14cb30);}return _0x37eb22['save']();};}function saveUpdates(_0x26b408,_0x506415){return function(_0x2b9ae0){if(_0x2b9ae0){return _0x2b9ae0[_0x7850('0x1f')](_0x26b408)[_0x7850('0x20')](function(_0x5ccf5f){return _0x5ccf5f;});}return null;};}function removeEntity(_0x535f6d,_0x423d2e){return function(_0x54969c){if(_0x54969c){return _0x54969c[_0x7850('0x21')]()[_0x7850('0x20')](function(){var _0x3acdc6=_0x54969c[_0x7850('0x22')]({'plain':!![]});var _0x9db6bc=_0x7850('0x23');return db[_0x7850('0x24')][_0x7850('0x21')]({'where':{'type':_0x9db6bc,'resourceId':_0x3acdc6['id']}})[_0x7850('0x20')](function(){return _0x54969c;});})[_0x7850('0x20')](function(){_0x535f6d[_0x7850('0x16')](0xcc)[_0x7850('0x17')]();});}};}function handleEntityNotFound(_0x5eb79d,_0x50a3c7){return function(_0x1e628b){if(!_0x1e628b){_0x5eb79d[_0x7850('0x15')](0x194);}return _0x1e628b;};}function handleError(_0x4b8807,_0x334ba2){_0x334ba2=_0x334ba2||0x1f4;return function(_0x34d11a){logger[_0x7850('0x25')](_0x34d11a['stack']);if(_0x34d11a['name']){delete _0x34d11a[_0x7850('0x26')];}_0x4b8807[_0x7850('0x16')](_0x334ba2)[_0x7850('0x27')](_0x34d11a);};}exports[_0x7850('0x28')]=function(_0x249cc4,_0x378659){var _0xa6ae13={},_0x597679={},_0x18e45a={'count':0x0,'rows':[]};var _0x12b623=_[_0x7850('0x29')](db['JscriptyProject']['rawAttributes'],function(_0x253709){return{'name':_0x253709[_0x7850('0x2a')],'type':_0x253709[_0x7850('0x2b')][_0x7850('0x2c')]};});_0x597679['model']=_[_0x7850('0x29')](_0x12b623,_0x7850('0x26'));_0x597679[_0x7850('0x2d')]=_[_0x7850('0x2e')](_0x249cc4[_0x7850('0x2d')]);_0x597679[_0x7850('0x2f')]=_[_0x7850('0x30')](_0x597679[_0x7850('0x31')],_0x597679['query']);_0xa6ae13[_0x7850('0x32')]=_[_0x7850('0x30')](_0x597679[_0x7850('0x31')],qs['fields'](_0x249cc4['query'][_0x7850('0x33')]));_0xa6ae13['attributes']=_0xa6ae13['attributes'][_0x7850('0x34')]?_0xa6ae13[_0x7850('0x32')]:_0x597679['model'];if(!_0x249cc4[_0x7850('0x2d')][_0x7850('0x35')]('nolimit')){_0xa6ae13['limit']=qs[_0x7850('0x1b')](_0x249cc4[_0x7850('0x2d')][_0x7850('0x1b')]);_0xa6ae13[_0x7850('0x19')]=qs[_0x7850('0x19')](_0x249cc4[_0x7850('0x2d')][_0x7850('0x19')]);}_0xa6ae13['order']=qs[_0x7850('0x36')](_0x249cc4[_0x7850('0x2d')][_0x7850('0x36')]);_0xa6ae13[_0x7850('0x37')]=qs[_0x7850('0x2f')](_[_0x7850('0x38')](_0x249cc4[_0x7850('0x2d')],_0x597679[_0x7850('0x2f')]),_0x12b623);if(_0x249cc4[_0x7850('0x2d')]['filter']){_0xa6ae13[_0x7850('0x37')]=_[_0x7850('0x39')](_0xa6ae13[_0x7850('0x37')],{'$or':_[_0x7850('0x29')](_0x12b623,function(_0x50dc5d){if(_0x50dc5d[_0x7850('0x2b')]!==_0x7850('0x3a')){var _0x42fca8={};_0x42fca8[_0x50dc5d['name']]={'$like':'%'+_0x249cc4['query'][_0x7850('0x3b')]+'%'};return _0x42fca8;}})});}_0xa6ae13=_[_0x7850('0x39')]({},_0xa6ae13,_0x249cc4['options']);var _0x5b7207={'where':_0xa6ae13[_0x7850('0x37')]};return db[_0x7850('0x3c')][_0x7850('0x1c')](_0x5b7207)[_0x7850('0x20')](function(_0xc82b71){_0x18e45a['count']=_0xc82b71;if(_0x249cc4[_0x7850('0x2d')][_0x7850('0x3d')]){_0xa6ae13[_0x7850('0x3e')]=[{'all':!![]}];}return db['JscriptyProject'][_0x7850('0x3f')](_0xa6ae13);})['then'](function(_0x47f313){_0x18e45a['rows']=_0x47f313;return _0x18e45a;})[_0x7850('0x20')](respondWithFilteredResult(_0x378659,_0xa6ae13))[_0x7850('0x40')](handleError(_0x378659,null));};exports['show']=function(_0x42f644,_0x3ff940){var _0x4d7108={'raw':![],'where':{'id':_0x42f644[_0x7850('0x41')]['id']}},_0x3461c4={};_0x3461c4[_0x7850('0x31')]=_[_0x7850('0x2e')](db[_0x7850('0x3c')][_0x7850('0x42')]);_0x3461c4[_0x7850('0x2d')]=_[_0x7850('0x2e')](_0x42f644[_0x7850('0x2d')]);_0x3461c4[_0x7850('0x2f')]=_[_0x7850('0x30')](_0x3461c4['model'],_0x3461c4[_0x7850('0x2d')]);_0x4d7108[_0x7850('0x32')]=_[_0x7850('0x30')](_0x3461c4[_0x7850('0x31')],qs['fields'](_0x42f644[_0x7850('0x2d')][_0x7850('0x33')]));_0x4d7108[_0x7850('0x32')]=_0x4d7108[_0x7850('0x32')][_0x7850('0x34')]?_0x4d7108['attributes']:_0x3461c4[_0x7850('0x31')];if(_0x42f644[_0x7850('0x2d')][_0x7850('0x3d')]){_0x4d7108['include']=[{'all':!![]}];}_0x4d7108=_[_0x7850('0x39')]({},_0x4d7108,_0x42f644[_0x7850('0x43')]);return db[_0x7850('0x3c')][_0x7850('0x44')](_0x4d7108)['then'](handleEntityNotFound(_0x3ff940,null))[_0x7850('0x20')](respondWithResult(_0x3ff940,null))[_0x7850('0x40')](handleError(_0x3ff940,null));};exports['create']=function(_0x5f3b4c,_0x21d422){return db[_0x7850('0x3c')][_0x7850('0x45')](_0x5f3b4c[_0x7850('0x46')],{})[_0x7850('0x20')](function(_0x201cc5){var _0x1a148b=_0x5f3b4c['user'][_0x7850('0x22')]({'plain':!![]});if(!_0x1a148b)throw new Error(_0x7850('0x47'));if(_0x1a148b[_0x7850('0x48')]==='user'){var _0x2b86a7=_0x201cc5['get']({'plain':!![]});var _0x2a8492=_0x7850('0x23');return db[_0x7850('0x49')][_0x7850('0x44')]({'where':{'name':_0x2a8492,'userProfileId':_0x1a148b[_0x7850('0x4a')]},'raw':!![]})[_0x7850('0x20')](function(_0x446bfd){if(_0x446bfd&&_0x446bfd['autoAssociation']===0x0){return db[_0x7850('0x24')][_0x7850('0x45')]({'name':_0x2b86a7['name'],'resourceId':_0x2b86a7['id'],'type':_0x446bfd[_0x7850('0x26')],'sectionId':_0x446bfd['id']},{})[_0x7850('0x20')](function(){return _0x201cc5;});}else{return _0x201cc5;}})[_0x7850('0x40')](function(_0x45eed4){logger[_0x7850('0x25')](_0x7850('0x4b'),_0x45eed4);throw _0x45eed4;});}return _0x201cc5;})[_0x7850('0x20')](respondWithResult(_0x21d422,0xc9))['catch'](handleError(_0x21d422,null));};exports[_0x7850('0x4c')]=function(_0x218bdc,_0x1288fe){var _0x5ab762={'where':{'id':_0x218bdc[_0x7850('0x41')]['id']}},_0x5aefcb={};_0x5aefcb[_0x7850('0x31')]=_[_0x7850('0x2e')](db['JscriptyProject'][_0x7850('0x42')]);_0x5ab762['attributes']=_[_0x7850('0x30')](_0x5aefcb[_0x7850('0x31')],qs['fields'](_0x218bdc[_0x7850('0x2d')][_0x7850('0x33')]));_0x5ab762[_0x7850('0x32')]=_0x5ab762[_0x7850('0x32')][_0x7850('0x34')]?_0x5ab762[_0x7850('0x32')]:_0x5aefcb[_0x7850('0x31')];if(_0x218bdc[_0x7850('0x2d')][_0x7850('0x3d')]){_0x5ab762['include']=[{'all':!![]}];}_0x5ab762=_[_0x7850('0x39')]({},_0x5ab762,_0x218bdc[_0x7850('0x43')]);return db[_0x7850('0x3c')][_0x7850('0x44')](_0x5ab762)[_0x7850('0x20')](handleEntityNotFound(_0x1288fe,null))[_0x7850('0x20')](function(_0x5e3137){if(_0x5e3137){var _0x4c49c8=_0x5e3137['get']({'plain':!![]});_0x4c49c8=qs[_0x7850('0x4d')](_0x4c49c8,['id','createdAt',_0x7850('0x4e')]);_0x218bdc[_0x7850('0x46')]=_[_0x7850('0x4d')](_0x218bdc[_0x7850('0x46')],['id',_0x7850('0x4f'),_0x7850('0x4e')]);return db[_0x7850('0x3c')][_0x7850('0x45')](_[_0x7850('0x39')](_0x4c49c8,_0x218bdc['body']),{'include':_0x218bdc[_0x7850('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x7850('0x20')](function(_0x5b1e92){var _0x85e551=_0x218bdc[_0x7850('0x50')][_0x7850('0x22')]({'plain':!![]});if(!_0x85e551)throw new Error(_0x7850('0x47'));if(_0x85e551[_0x7850('0x48')]===_0x7850('0x50')){var _0x4eb016=_0x5b1e92[_0x7850('0x22')]({'plain':!![]});var _0x52f415=_0x7850('0x23');return db[_0x7850('0x49')][_0x7850('0x44')]({'where':{'name':_0x52f415,'userProfileId':_0x85e551['userProfileId']},'raw':!![]})['then'](function(_0xa42b42){if(_0xa42b42&&_0xa42b42[_0x7850('0x51')]===0x0){return db[_0x7850('0x24')][_0x7850('0x45')]({'name':_0x4eb016[_0x7850('0x26')],'resourceId':_0x4eb016['id'],'type':_0xa42b42['name'],'sectionId':_0xa42b42['id']},{})[_0x7850('0x20')](function(){return _0x5b1e92;});}else{return _0x5b1e92;}})[_0x7850('0x40')](function(_0x19c22f){logger[_0x7850('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19c22f);throw _0x19c22f;});}return _0x5b1e92;});}})[_0x7850('0x20')](respondWithResult(_0x1288fe,0xc9))['catch'](handleError(_0x1288fe,null));};exports[_0x7850('0x1f')]=function(_0x29cc13,_0x16a875){if(_0x29cc13[_0x7850('0x46')]['id']){delete _0x29cc13[_0x7850('0x46')]['id'];}return db['JscriptyProject'][_0x7850('0x44')]({'where':{'id':_0x29cc13[_0x7850('0x41')]['id']}})['then'](handleEntityNotFound(_0x16a875,null))[_0x7850('0x20')](saveUpdates(_0x29cc13[_0x7850('0x46')],null))[_0x7850('0x20')](respondWithResult(_0x16a875,null))[_0x7850('0x40')](handleError(_0x16a875,null));};exports[_0x7850('0x21')]=function(_0x154eac,_0x3d174c){return db[_0x7850('0x3c')]['find']({'where':{'id':_0x154eac['params']['id']}})[_0x7850('0x20')](handleEntityNotFound(_0x3d174c,null))[_0x7850('0x20')](removeEntity(_0x3d174c,null))[_0x7850('0x40')](handleError(_0x3d174c,null));};exports[_0x7850('0x52')]=function(_0x54722c,_0x28a01f,_0x56a7ee){var _0x8ffc24={'raw':!![],'where':{}};var _0x161f61={};var _0x74385={'count':0x0,'rows':[]};return db[_0x7850('0x3c')][_0x7850('0x53')]({'where':{'id':_0x54722c[_0x7850('0x41')]['id']}})[_0x7850('0x20')](handleEntityNotFound(_0x28a01f,null))['then'](function(_0x273c24){if(_0x273c24){_0x161f61[_0x7850('0x31')]=_[_0x7850('0x2e')](db['JscriptySessionReport'][_0x7850('0x42')]);_0x161f61[_0x7850('0x2d')]=_['keys'](_0x54722c[_0x7850('0x2d')]);_0x161f61[_0x7850('0x2f')]=_['intersection'](_0x161f61[_0x7850('0x31')],_0x161f61['query']);_0x8ffc24[_0x7850('0x32')]=_[_0x7850('0x30')](_0x161f61['model'],qs[_0x7850('0x33')](_0x54722c['query']['fields']));_0x8ffc24[_0x7850('0x32')]=_0x8ffc24[_0x7850('0x32')][_0x7850('0x34')]?_0x8ffc24[_0x7850('0x32')]:_0x161f61[_0x7850('0x31')];if(!_0x54722c[_0x7850('0x2d')][_0x7850('0x35')](_0x7850('0x54'))){_0x8ffc24['limit']=qs[_0x7850('0x1b')](_0x54722c[_0x7850('0x2d')][_0x7850('0x1b')]);_0x8ffc24['offset']=qs[_0x7850('0x19')](_0x54722c[_0x7850('0x2d')]['offset']);}_0x8ffc24[_0x7850('0x55')]=qs['sort'](_0x54722c[_0x7850('0x2d')][_0x7850('0x36')]);_0x8ffc24[_0x7850('0x37')]=qs[_0x7850('0x2f')](_[_0x7850('0x38')](_0x54722c[_0x7850('0x2d')],_0x161f61[_0x7850('0x2f')]));_0x8ffc24['where'][_0x7850('0x56')]=_0x273c24['id'];if(_0x54722c['query']['filter']){_0x8ffc24[_0x7850('0x37')]=_[_0x7850('0x39')](_0x8ffc24[_0x7850('0x37')],{'$or':_[_0x7850('0x29')](_0x8ffc24['attributes'],function(_0x595952){var _0x332156={};_0x332156[_0x595952]={'$like':'%'+_0x54722c[_0x7850('0x2d')][_0x7850('0x3b')]+'%'};return _0x332156;})});}_0x8ffc24=_[_0x7850('0x39')]({},_0x8ffc24,_0x54722c[_0x7850('0x43')]);return db[_0x7850('0x57')][_0x7850('0x1c')]({'where':_0x8ffc24[_0x7850('0x37')]})[_0x7850('0x20')](function(_0x14c55a){_0x74385['count']=_0x14c55a;if(_0x54722c['query'][_0x7850('0x3d')]){_0x8ffc24[_0x7850('0x3e')]=[{'all':!![]}];}return db[_0x7850('0x57')][_0x7850('0x3f')](_0x8ffc24);})[_0x7850('0x20')](function(_0x566b49){_0x74385[_0x7850('0x58')]=_0x566b49;return _0x74385;});}})['then'](respondWithFilteredResult(_0x28a01f,_0x8ffc24))[_0x7850('0x40')](handleError(_0x28a01f,null));};exports['getAnswers']=function(_0x28e965,_0x538f8d,_0x454949){var _0x20ea66={'raw':!![],'where':{}};var _0x4fafb2={};var _0x16ef65={'count':0x0,'rows':[]};return db[_0x7850('0x3c')]['findOne']({'where':{'id':_0x28e965[_0x7850('0x41')]['id']}})[_0x7850('0x20')](handleEntityNotFound(_0x538f8d,null))[_0x7850('0x20')](function(_0x3c393f){if(_0x3c393f){_0x4fafb2['model']=_[_0x7850('0x2e')](db[_0x7850('0x59')]['rawAttributes']);_0x4fafb2['query']=_['keys'](_0x28e965['query']);_0x4fafb2['filters']=_[_0x7850('0x30')](_0x4fafb2[_0x7850('0x31')],_0x4fafb2[_0x7850('0x2d')]);_0x20ea66['attributes']=_['intersection'](_0x4fafb2['model'],qs[_0x7850('0x33')](_0x28e965[_0x7850('0x2d')][_0x7850('0x33')]));_0x20ea66[_0x7850('0x32')]=_0x20ea66[_0x7850('0x32')][_0x7850('0x34')]?_0x20ea66['attributes']:_0x4fafb2[_0x7850('0x31')];if(!_0x28e965[_0x7850('0x2d')][_0x7850('0x35')](_0x7850('0x54'))){_0x20ea66[_0x7850('0x1b')]=qs[_0x7850('0x1b')](_0x28e965[_0x7850('0x2d')][_0x7850('0x1b')]);_0x20ea66['offset']=qs[_0x7850('0x19')](_0x28e965['query'][_0x7850('0x19')]);}_0x20ea66['order']=qs[_0x7850('0x36')](_0x28e965[_0x7850('0x2d')][_0x7850('0x36')]);_0x20ea66['where']=qs[_0x7850('0x2f')](_[_0x7850('0x38')](_0x28e965[_0x7850('0x2d')],_0x4fafb2[_0x7850('0x2f')]));_0x20ea66[_0x7850('0x37')][_0x7850('0x56')]=_0x3c393f['id'];if(_0x28e965[_0x7850('0x2d')][_0x7850('0x3b')]){_0x20ea66['where']=_[_0x7850('0x39')](_0x20ea66[_0x7850('0x37')],{'$or':_[_0x7850('0x29')](_0x20ea66[_0x7850('0x32')],function(_0x383e87){var _0x557297={};_0x557297[_0x383e87]={'$like':'%'+_0x28e965[_0x7850('0x2d')]['filter']+'%'};return _0x557297;})});}_0x20ea66=_[_0x7850('0x39')]({},_0x20ea66,_0x28e965['options']);return db[_0x7850('0x59')][_0x7850('0x1c')]({'where':_0x20ea66[_0x7850('0x37')]})[_0x7850('0x20')](function(_0x3745ae){_0x16ef65['count']=_0x3745ae;if(_0x28e965[_0x7850('0x2d')][_0x7850('0x3d')]){_0x20ea66[_0x7850('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x7850('0x3f')](_0x20ea66);})[_0x7850('0x20')](function(_0x28cc54){_0x16ef65[_0x7850('0x58')]=_0x28cc54;return _0x16ef65;});}})[_0x7850('0x20')](respondWithFilteredResult(_0x538f8d,_0x20ea66))[_0x7850('0x40')](handleError(_0x538f8d,null));};function char(_0x12f77e){return'number'===typeof _0x12f77e?String[_0x7850('0x5a')][_0x7850('0x1d')](null,arguments):_0x12f77e;}function needsEncapsulation(_0x373645){return!!_0x373645&&(_0x373645['toString']()['indexOf'](char(0xd))>=0x0||_0x373645[_0x7850('0x5b')]()[_0x7850('0x5c')](char(0xa))>=0x0||_0x373645[_0x7850('0x5b')]()[_0x7850('0x5c')](char(0x2c))>=0x0||_0x373645[_0x7850('0x5b')]()[_0x7850('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x48f7cf){var _0x1255f5=char(0x22),_0x445f46='\x5c'+char(0x22),_0x3e954a=_0x48f7cf[_0x7850('0x5b')]()['replace'](new RegExp(_0x1255f5,'g'),_0x445f46);return _0x1255f5+_0x3e954a+_0x1255f5;}exports[_0x7850('0x5d')]=function(_0x4b343a,_0x32fb55,_0x51ba25){var _0x5aac75,_0x18231d;var _0x120ae2={'where':{'ProjectId':_0x4b343a[_0x7850('0x41')]['id']}};if(_0x4b343a['query']['startTime']){_0x120ae2[_0x7850('0x37')][_0x7850('0x5e')]=JSON[_0x7850('0x5f')](_0x4b343a['query'][_0x7850('0x60')]);}return db[_0x7850('0x57')][_0x7850('0x3f')](_0x120ae2)[_0x7850('0x20')](handleEntityNotFound(_0x32fb55,null))['then'](function(_0x41e723){if(_0x41e723){_0x5aac75=_0x41e723;return db[_0x7850('0x61')][_0x7850('0x3f')]({'where':{'SessionId':{'$in':_['map'](_0x5aac75,'id')},'ProjectId':_0x4b343a[_0x7850('0x41')]['id']},'order':'-createdAt'});}})[_0x7850('0x20')](handleEntityNotFound(_0x32fb55,null))[_0x7850('0x20')](function(_0x24c0a4){if(_0x24c0a4){_0x18231d=_0x24c0a4;var _0xb8e286={};for(var _0x5118c3=0x0,_0x15fac0=_0x18231d[_0x7850('0x34')];_0x5118c3<_0x15fac0;_0x5118c3++){if(!_0xb8e286[_0x7850('0x35')](_0x18231d[_0x5118c3][_0x7850('0x62')])){_0xb8e286[_0x18231d[_0x5118c3]['questionId']]=needsEncapsulation(_0x18231d[_0x5118c3]['question'])?encapsulate(_0x18231d[_0x5118c3][_0x7850('0x63')]):_0x18231d[_0x5118c3][_0x7850('0x63')];}}var _0x57c108=[],_0x239794={};for(var _0x21c717=0x0,_0x5c37f0=_0x5aac75[_0x7850('0x34')];_0x21c717<_0x5c37f0;_0x21c717++){_0x239794={'ProjectId':_0x4b343a[_0x7850('0x41')]['id'],'SessionId':_0x5aac75[_0x21c717]['id'],'StartTime':moment(_0x5aac75[_0x21c717][_0x7850('0x5e')])[_0x7850('0x64')](_0x7850('0x65'))};for(var _0x1b88a1=0x0,_0x28f781=_0x18231d['length'];_0x1b88a1<_0x28f781;_0x1b88a1++){if(_0x18231d[_0x1b88a1][_0x7850('0x66')]==_0x5aac75[_0x21c717]['id']&&_0xb8e286[_0x7850('0x35')](_0x18231d[_0x1b88a1]['questionId'])){_0x239794[_0xb8e286[_0x18231d[_0x1b88a1][_0x7850('0x62')]]]=_0x18231d[_0x1b88a1][_0x7850('0x67')];}}for(var _0x3f87f4 in _0xb8e286){if(!_0x239794[_0x7850('0x35')](_0xb8e286[_0x3f87f4])){_0x239794[_0xb8e286[_0x3f87f4]]=null;}}_0x57c108[_0x7850('0x68')](_0x239794);}return _0x57c108;}})['then'](function(_0xe3b20e){if(!_[_0x7850('0x69')](_0xe3b20e)){var _0x2af9ac=toCsv(_0xe3b20e);var _0x1a6b1c=Date[_0x7850('0x6a')]();fs[_0x7850('0x6b')](util[_0x7850('0x64')](_0x7850('0x6c'),_0x4b343a[_0x7850('0x41')]['id'],_0x1a6b1c),_0x2af9ac);_0x32fb55['setHeader'](_0x7850('0x6d'),'attachment;\x20filename='+util[_0x7850('0x64')](_0x7850('0x6e'),_0x4b343a[_0x7850('0x41')]['id'],_0x1a6b1c));_0x32fb55['setHeader'](_0x7850('0x6f'),_0x7850('0x70'));return _0x32fb55['download'](util[_0x7850('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4b343a[_0x7850('0x41')]['id'],_0x1a6b1c));}else{return _0x32fb55[_0x7850('0x15')](0xcc);}})[_0x7850('0x40')](handleError(_0x32fb55,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 89d3929..c9a9a34 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 _0x26cf=['../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','util'];(function(_0x3ce591,_0x38dcca){var _0x453453=function(_0x3830ed){while(--_0x3830ed){_0x3ce591['push'](_0x3ce591['shift']());}};_0x453453(++_0x38dcca);}(_0x26cf,0x135));var _0xf26c=function(_0x3ab041,_0x3e7997){_0x3ab041=_0x3ab041-0x0;var _0x1208b4=_0x26cf[_0x3ab041];return _0x1208b4;};'use strict';var _=require('lodash');var util=require(_0xf26c('0x0'));var logger=require(_0xf26c('0x1'))('api');var moment=require(_0xf26c('0x2'));var BPromise=require('bluebird');var rp=require(_0xf26c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf26c('0x4'));var config=require(_0xf26c('0x5'));var attributes=require('./jscriptyProject.attributes');module[_0xf26c('0x6')]=function(_0x10638a,_0x32d4ef){return _0x10638a[_0xf26c('0x7')](_0xf26c('0x8'),attributes,{'tableName':_0xf26c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c70=['../../config/environment','exports','define','JscriptyProject','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x363f88,_0x1e9cab){var _0x4a8211=function(_0x33d28a){while(--_0x33d28a){_0x363f88['push'](_0x363f88['shift']());}};_0x4a8211(++_0x1e9cab);}(_0x3c70,0x10c));var _0x03c7=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x3c70[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var logger=require(_0x03c7('0x2'))('api');var moment=require(_0x03c7('0x3'));var BPromise=require(_0x03c7('0x4'));var rp=require(_0x03c7('0x5'));var fs=require('fs');var path=require(_0x03c7('0x6'));var rimraf=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x03c7('0x9')]=function(_0x4f774e,_0x5b6c32){return _0x4f774e[_0x03c7('0xa')](_0x03c7('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 9d0d3b7..c471858 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 _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x585e24,_0x5bf641){var _0x95f396=function(_0x2e59c4){while(--_0x2e59c4){_0x585e24['push'](_0x585e24['shift']());}};_0x95f396(++_0x5bf641);}(_0xe706,0xa3));var _0x6e70=function(_0x566760,_0x1f7104){_0x566760=_0x566760-0x0;var _0x30ca6d=_0xe706[_0x566760];return _0x30ca6d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x4d6ec0,_0x214dd5){_0x4d6ec0=_0x4d6ec0-0x0;var _0x4d5050=_0xac4a[_0x4d6ec0];return _0x4d5050;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index a88eeff..0ae571b 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 _0x43a0=['/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','update','delete'];(function(_0x34311f,_0x110b9b){var _0x3a5975=function(_0x13a989){while(--_0x13a989){_0x34311f['push'](_0x34311f['shift']());}};_0x3a5975(++_0x110b9b);}(_0x43a0,0x153));var _0x043a=function(_0x1d0c25,_0x3c77e9){_0x1d0c25=_0x1d0c25-0x0;var _0x50a856=_0x43a0[_0x1d0c25];return _0x50a856;};'use strict';var multer=require(_0x043a('0x0'));var util=require(_0x043a('0x1'));var path=require(_0x043a('0x2'));var timeout=require(_0x043a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x043a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x043a('0x5'));var config=require(_0x043a('0x6'));var controller=require(_0x043a('0x7'));router[_0x043a('0x8')]('/',auth[_0x043a('0x9')](),controller[_0x043a('0xa')]);router[_0x043a('0x8')](_0x043a('0xb'),auth[_0x043a('0x9')](),controller[_0x043a('0xc')]);router[_0x043a('0x8')]('/:id',auth[_0x043a('0x9')](),controller['show']);router[_0x043a('0xd')]('/',auth[_0x043a('0x9')](),controller[_0x043a('0xe')]);router[_0x043a('0xf')]('/:id',auth[_0x043a('0x9')](),controller[_0x043a('0x10')]);router[_0x043a('0x11')](_0x043a('0x12'),auth[_0x043a('0x9')](),controller[_0x043a('0x13')]);module[_0x043a('0x14')]=router; \ No newline at end of file +var _0x5bab=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5bab,0x1df));var _0xb5ba=function(_0x220078,_0x55cea7){_0x220078=_0x220078-0x0;var _0x43b592=_0x5bab[_0x220078];return _0x43b592;};'use strict';var multer=require(_0xb5ba('0x0'));var util=require(_0xb5ba('0x1'));var path=require('path');var timeout=require(_0xb5ba('0x2'));var express=require(_0xb5ba('0x3'));var router=express['Router']();var fs_extra=require(_0xb5ba('0x4'));var auth=require(_0xb5ba('0x5'));var interaction=require(_0xb5ba('0x6'));var config=require(_0xb5ba('0x7'));var controller=require(_0xb5ba('0x8'));router['get']('/',auth[_0xb5ba('0x9')](),controller[_0xb5ba('0xa')]);router[_0xb5ba('0xb')](_0xb5ba('0xc'),auth[_0xb5ba('0x9')](),controller['describe']);router[_0xb5ba('0xb')]('/:id',auth[_0xb5ba('0x9')](),controller[_0xb5ba('0xd')]);router[_0xb5ba('0xe')]('/',auth['isAuthenticated'](),controller[_0xb5ba('0xf')]);router[_0xb5ba('0x10')](_0xb5ba('0x11'),auth['isAuthenticated'](),controller[_0xb5ba('0x12')]);router[_0xb5ba('0x13')](_0xb5ba('0x11'),auth[_0xb5ba('0x9')](),controller[_0xb5ba('0x14')]);module[_0xb5ba('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 7f6768f..2ada4dc 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x263f0d,_0x57551c){_0x263f0d=_0x263f0d-0x0;var _0x1d71fa=_0x7a54[_0x263f0d];return _0x1d71fa;};'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(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7a54,0x106));var _0x47a5=function(_0x1c9489,_0xac2f01){_0x1c9489=_0x1c9489-0x0;var _0x436ff2=_0x7a54[_0x1c9489];return _0x436ff2;};'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 8f1cf8e..333af1a 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 _0x3fe4=['request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','apply','then','destroy','end','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','describe','eml-format','fast-json-patch'];(function(_0x570e13,_0x4fcf8e){var _0xb91255=function(_0x53f626){while(--_0x53f626){_0x570e13['push'](_0x570e13['shift']());}};_0xb91255(++_0x4fcf8e);}(_0x3fe4,0xca));var _0x43fe=function(_0x19bc5e,_0x44b2eb){_0x19bc5e=_0x19bc5e-0x0;var _0x518c1e=_0x3fe4[_0x19bc5e];return _0x518c1e;};'use strict';var emlformat=require(_0x43fe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x43fe('0x1'));var rp=require(_0x43fe('0x2'));var moment=require(_0x43fe('0x3'));var BPromise=require(_0x43fe('0x4'));var Mustache=require(_0x43fe('0x5'));var util=require('util');var path=require('path');var sox=require(_0x43fe('0x6'));var csv=require(_0x43fe('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43fe('0x8'));var _=require(_0x43fe('0x9'));var squel=require(_0x43fe('0xa'));var crypto=require(_0x43fe('0xb'));var jsforce=require(_0x43fe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x43fe('0x7'));var querystring=require('querystring');var Papa=require(_0x43fe('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43fe('0xe'));var logger=require(_0x43fe('0xf'))('api');var utils=require(_0x43fe('0x10'));var config=require(_0x43fe('0x11'));var licenseUtil=require(_0x43fe('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x117de4,_0xe9dcdd){_0xe9dcdd=_0xe9dcdd||0xcc;return function(_0x413098){if(_0x413098){return _0x117de4[_0x43fe('0x13')](_0xe9dcdd);}return _0x117de4[_0x43fe('0x14')](_0xe9dcdd)['end']();};}function respondWithResult(_0x25a35e,_0x27914d){_0x27914d=_0x27914d||0xc8;return function(_0x1c881e){if(_0x1c881e){return _0x25a35e[_0x43fe('0x14')](_0x27914d)[_0x43fe('0x15')](_0x1c881e);}};}function respondWithFilteredResult(_0x283b45,_0x20fe1c){return function(_0xd2d647){if(_0xd2d647){var _0x5a9107=typeof _0x20fe1c[_0x43fe('0x16')]===_0x43fe('0x17')&&typeof _0x20fe1c['limit']===_0x43fe('0x17');var _0x3a9c0a=_0xd2d647[_0x43fe('0x18')];var _0x4effd8=_0x5a9107?0x0:_0x20fe1c[_0x43fe('0x16')];var _0x264498=_0x5a9107?_0xd2d647[_0x43fe('0x18')]:_0x20fe1c[_0x43fe('0x16')]+_0x20fe1c['limit'];var _0x5d429d;if(_0x264498>=_0x3a9c0a){_0x264498=_0x3a9c0a;_0x5d429d=0xc8;}else{_0x5d429d=0xce;}_0x283b45['status'](_0x5d429d);return _0x283b45[_0x43fe('0x19')]('Content-Range',_0x4effd8+'-'+_0x264498+'/'+_0x3a9c0a)[_0x43fe('0x15')](_0xd2d647);}return null;};}function patchUpdates(_0x5cdc89){return function(_0x3463f0){try{jsonpatch[_0x43fe('0x1a')](_0x3463f0,_0x5cdc89,!![]);}catch(_0x451cec){return BPromise['reject'](_0x451cec);}return _0x3463f0['save']();};}function saveUpdates(_0x552798,_0x3a40f6){return function(_0xa63cc){if(_0xa63cc){return _0xa63cc['update'](_0x552798)[_0x43fe('0x1b')](function(_0x444746){return _0x444746;});}return null;};}function removeEntity(_0x29a997,_0x4a6b3c){return function(_0x2a3292){if(_0x2a3292){return _0x2a3292[_0x43fe('0x1c')]()[_0x43fe('0x1b')](function(){_0x29a997[_0x43fe('0x14')](0xcc)[_0x43fe('0x1d')]();});}};}function handleEntityNotFound(_0x5323f7,_0x223698){return function(_0x5962dc){if(!_0x5962dc){_0x5323f7['sendStatus'](0x194);}return _0x5962dc;};}function handleError(_0x2dd8e9,_0x5c656e){_0x5c656e=_0x5c656e||0x1f4;return function(_0x5f5c90){logger[_0x43fe('0x1e')](_0x5f5c90['stack']);if(_0x5f5c90[_0x43fe('0x1f')]){delete _0x5f5c90[_0x43fe('0x1f')];}_0x2dd8e9['status'](_0x5c656e)[_0x43fe('0x20')](_0x5f5c90);};}exports[_0x43fe('0x21')]=function(_0x166a39,_0x2697ef){var _0x3adb59={},_0x27fafd={},_0x1c6f00={'count':0x0,'rows':[]};var _0x13007b=_[_0x43fe('0x22')](db[_0x43fe('0x23')][_0x43fe('0x24')],function(_0x281972){return{'name':_0x281972[_0x43fe('0x25')],'type':_0x281972['type']['key']};});_0x27fafd[_0x43fe('0x26')]=_['map'](_0x13007b,_0x43fe('0x1f'));_0x27fafd[_0x43fe('0x27')]=_[_0x43fe('0x28')](_0x166a39[_0x43fe('0x27')]);_0x27fafd['filters']=_['intersection'](_0x27fafd[_0x43fe('0x26')],_0x27fafd[_0x43fe('0x27')]);_0x3adb59['attributes']=_[_0x43fe('0x29')](_0x27fafd['model'],qs[_0x43fe('0x2a')](_0x166a39[_0x43fe('0x27')][_0x43fe('0x2a')]));_0x3adb59[_0x43fe('0x2b')]=_0x3adb59[_0x43fe('0x2b')][_0x43fe('0x2c')]?_0x3adb59['attributes']:_0x27fafd['model'];if(!_0x166a39[_0x43fe('0x27')][_0x43fe('0x2d')](_0x43fe('0x2e'))){_0x3adb59['limit']=qs[_0x43fe('0x2f')](_0x166a39['query'][_0x43fe('0x2f')]);_0x3adb59[_0x43fe('0x16')]=qs[_0x43fe('0x16')](_0x166a39[_0x43fe('0x27')][_0x43fe('0x16')]);}_0x3adb59[_0x43fe('0x30')]=qs[_0x43fe('0x31')](_0x166a39[_0x43fe('0x27')][_0x43fe('0x31')]);_0x3adb59[_0x43fe('0x32')]=qs[_0x43fe('0x33')](_[_0x43fe('0x34')](_0x166a39['query'],_0x27fafd['filters']),_0x13007b);if(_0x166a39[_0x43fe('0x27')][_0x43fe('0x35')]){_0x3adb59[_0x43fe('0x32')]=_[_0x43fe('0x36')](_0x3adb59['where'],{'$or':_['map'](_0x13007b,function(_0x1dab8e){if(_0x1dab8e['type']!==_0x43fe('0x37')){var _0x53d280={};_0x53d280[_0x1dab8e[_0x43fe('0x1f')]]={'$like':'%'+_0x166a39[_0x43fe('0x27')][_0x43fe('0x35')]+'%'};return _0x53d280;}})});}_0x3adb59=_[_0x43fe('0x36')]({},_0x3adb59,_0x166a39['options']);var _0x38fde7={'where':_0x3adb59[_0x43fe('0x32')]};return db['JscriptyQuestionReport'][_0x43fe('0x18')](_0x38fde7)[_0x43fe('0x1b')](function(_0x5a4d80){_0x1c6f00[_0x43fe('0x18')]=_0x5a4d80;if(_0x166a39[_0x43fe('0x27')][_0x43fe('0x38')]){_0x3adb59[_0x43fe('0x39')]=[{'all':!![]}];}return db[_0x43fe('0x23')][_0x43fe('0x3a')](_0x3adb59);})[_0x43fe('0x1b')](function(_0x3d109f){_0x1c6f00[_0x43fe('0x3b')]=_0x3d109f;return _0x1c6f00;})['then'](respondWithFilteredResult(_0x2697ef,_0x3adb59))['catch'](handleError(_0x2697ef,null));};exports[_0x43fe('0x3c')]=function(_0x48c674,_0x54edfe){var _0x29731c={'raw':!![],'where':{'id':_0x48c674[_0x43fe('0x3d')]['id']}},_0x1a0459={};_0x1a0459[_0x43fe('0x26')]=_[_0x43fe('0x28')](db[_0x43fe('0x23')][_0x43fe('0x24')]);_0x1a0459[_0x43fe('0x27')]=_[_0x43fe('0x28')](_0x48c674[_0x43fe('0x27')]);_0x1a0459[_0x43fe('0x33')]=_[_0x43fe('0x29')](_0x1a0459['model'],_0x1a0459['query']);_0x29731c[_0x43fe('0x2b')]=_[_0x43fe('0x29')](_0x1a0459[_0x43fe('0x26')],qs['fields'](_0x48c674[_0x43fe('0x27')][_0x43fe('0x2a')]));_0x29731c['attributes']=_0x29731c[_0x43fe('0x2b')][_0x43fe('0x2c')]?_0x29731c[_0x43fe('0x2b')]:_0x1a0459['model'];if(_0x48c674[_0x43fe('0x27')][_0x43fe('0x38')]){_0x29731c[_0x43fe('0x39')]=[{'all':!![]}];}_0x29731c=_[_0x43fe('0x36')]({},_0x29731c,_0x48c674[_0x43fe('0x3e')]);return db[_0x43fe('0x23')]['find'](_0x29731c)[_0x43fe('0x1b')](handleEntityNotFound(_0x54edfe,null))[_0x43fe('0x1b')](respondWithResult(_0x54edfe,null))[_0x43fe('0x3f')](handleError(_0x54edfe,null));};exports[_0x43fe('0x40')]=function(_0x3145a8,_0x3816b6){return db['JscriptyQuestionReport'][_0x43fe('0x40')](_0x3145a8[_0x43fe('0x41')],{})[_0x43fe('0x1b')](respondWithResult(_0x3816b6,0xc9))[_0x43fe('0x3f')](handleError(_0x3816b6,null));};exports['update']=function(_0x4c7a76,_0x587fba){if(_0x4c7a76['body']['id']){delete _0x4c7a76[_0x43fe('0x41')]['id'];}return db[_0x43fe('0x23')][_0x43fe('0x42')]({'where':{'id':_0x4c7a76['params']['id']}})['then'](handleEntityNotFound(_0x587fba,null))[_0x43fe('0x1b')](saveUpdates(_0x4c7a76[_0x43fe('0x41')],null))['then'](respondWithResult(_0x587fba,null))['catch'](handleError(_0x587fba,null));};exports[_0x43fe('0x1c')]=function(_0x5ee6b4,_0x34dc95){return db[_0x43fe('0x23')][_0x43fe('0x42')]({'where':{'id':_0x5ee6b4[_0x43fe('0x3d')]['id']}})[_0x43fe('0x1b')](handleEntityNotFound(_0x34dc95,null))[_0x43fe('0x1b')](removeEntity(_0x34dc95,null))['catch'](handleError(_0x34dc95,null));};exports[_0x43fe('0x43')]=function(_0x4686a0,_0x2af8f0){return db[_0x43fe('0x23')][_0x43fe('0x43')]()[_0x43fe('0x1b')](respondWithResult(_0x2af8f0,null))[_0x43fe('0x3f')](handleError(_0x2af8f0,null));}; \ No newline at end of file +var _0x4524=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','attributes','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x4524,0x163));var _0x4452=function(_0x4daaf3,_0x18cfed){_0x4daaf3=_0x4daaf3-0x0;var _0x240f1f=_0x4524[_0x4daaf3];return _0x240f1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4452('0x0'));var zipdir=require(_0x4452('0x1'));var jsonpatch=require(_0x4452('0x2'));var rp=require(_0x4452('0x3'));var moment=require(_0x4452('0x4'));var BPromise=require(_0x4452('0x5'));var Mustache=require('mustache');var util=require(_0x4452('0x6'));var path=require(_0x4452('0x7'));var sox=require(_0x4452('0x8'));var csv=require('to-csv');var ejs=require(_0x4452('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4452('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4452('0xb'));var Papa=require(_0x4452('0xc'));var Redis=require(_0x4452('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4452('0xe'));var as=require(_0x4452('0xf'));var hardwareService=require(_0x4452('0x10'));var logger=require(_0x4452('0x11'))(_0x4452('0x12'));var utils=require(_0x4452('0x13'));var config=require(_0x4452('0x14'));var licenseUtil=require(_0x4452('0x15'));var db=require(_0x4452('0x16'))['db'];function respondWithStatusCode(_0x46daee,_0x34e458){_0x34e458=_0x34e458||0xcc;return function(_0x14bcdb){if(_0x14bcdb){return _0x46daee[_0x4452('0x17')](_0x34e458);}return _0x46daee[_0x4452('0x18')](_0x34e458)[_0x4452('0x19')]();};}function respondWithResult(_0x481bd5,_0x5759f9){_0x5759f9=_0x5759f9||0xc8;return function(_0x100903){if(_0x100903){return _0x481bd5[_0x4452('0x18')](_0x5759f9)['json'](_0x100903);}};}function respondWithFilteredResult(_0x30feb2,_0x280e56){return function(_0x46b5ec){if(_0x46b5ec){var _0x5cc002=typeof _0x280e56[_0x4452('0x1a')]===_0x4452('0x1b')&&typeof _0x280e56['limit']===_0x4452('0x1b');var _0x489468=_0x46b5ec['count'];var _0x3b6158=_0x5cc002?0x0:_0x280e56['offset'];var _0x161319=_0x5cc002?_0x46b5ec[_0x4452('0x1c')]:_0x280e56[_0x4452('0x1a')]+_0x280e56['limit'];var _0x278c5c;if(_0x161319>=_0x489468){_0x161319=_0x489468;_0x278c5c=0xc8;}else{_0x278c5c=0xce;}_0x30feb2[_0x4452('0x18')](_0x278c5c);return _0x30feb2[_0x4452('0x1d')](_0x4452('0x1e'),_0x3b6158+'-'+_0x161319+'/'+_0x489468)[_0x4452('0x1f')](_0x46b5ec);}return null;};}function patchUpdates(_0x468191){return function(_0x45a07a){try{jsonpatch[_0x4452('0x20')](_0x45a07a,_0x468191,!![]);}catch(_0x81a389){return BPromise[_0x4452('0x21')](_0x81a389);}return _0x45a07a['save']();};}function saveUpdates(_0x1dda8d,_0xa040b1){return function(_0x125248){if(_0x125248){return _0x125248[_0x4452('0x22')](_0x1dda8d)['then'](function(_0x50ba0d){return _0x50ba0d;});}return null;};}function removeEntity(_0x320e90,_0x38d48e){return function(_0x4713c2){if(_0x4713c2){return _0x4713c2[_0x4452('0x23')]()[_0x4452('0x24')](function(){_0x320e90[_0x4452('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20bcd5,_0x46cf4b){return function(_0x4d630b){if(!_0x4d630b){_0x20bcd5[_0x4452('0x17')](0x194);}return _0x4d630b;};}function handleError(_0x1008b0,_0x3cf45f){_0x3cf45f=_0x3cf45f||0x1f4;return function(_0x1b60ee){logger[_0x4452('0x25')](_0x1b60ee[_0x4452('0x26')]);if(_0x1b60ee[_0x4452('0x27')]){delete _0x1b60ee[_0x4452('0x27')];}_0x1008b0[_0x4452('0x18')](_0x3cf45f)[_0x4452('0x28')](_0x1b60ee);};}exports[_0x4452('0x29')]=function(_0x5bdc64,_0x377f5f){var _0x1aad30={},_0x539202={},_0x457305={'count':0x0,'rows':[]};var _0x1e3b90=_['map'](db[_0x4452('0x2a')][_0x4452('0x2b')],function(_0x58c27f){return{'name':_0x58c27f[_0x4452('0x2c')],'type':_0x58c27f[_0x4452('0x2d')]['key']};});_0x539202[_0x4452('0x2e')]=_[_0x4452('0x2f')](_0x1e3b90,'name');_0x539202[_0x4452('0x30')]=_[_0x4452('0x31')](_0x5bdc64[_0x4452('0x30')]);_0x539202[_0x4452('0x32')]=_[_0x4452('0x33')](_0x539202['model'],_0x539202['query']);_0x1aad30['attributes']=_[_0x4452('0x33')](_0x539202['model'],qs[_0x4452('0x34')](_0x5bdc64[_0x4452('0x30')]['fields']));_0x1aad30['attributes']=_0x1aad30['attributes'][_0x4452('0x35')]?_0x1aad30['attributes']:_0x539202[_0x4452('0x2e')];if(!_0x5bdc64[_0x4452('0x30')][_0x4452('0x36')](_0x4452('0x37'))){_0x1aad30[_0x4452('0x38')]=qs[_0x4452('0x38')](_0x5bdc64[_0x4452('0x30')][_0x4452('0x38')]);_0x1aad30['offset']=qs[_0x4452('0x1a')](_0x5bdc64['query'][_0x4452('0x1a')]);}_0x1aad30[_0x4452('0x39')]=qs[_0x4452('0x3a')](_0x5bdc64[_0x4452('0x30')]['sort']);_0x1aad30[_0x4452('0x3b')]=qs['filters'](_['pick'](_0x5bdc64[_0x4452('0x30')],_0x539202[_0x4452('0x32')]),_0x1e3b90);if(_0x5bdc64[_0x4452('0x30')][_0x4452('0x3c')]){_0x1aad30[_0x4452('0x3b')]=_[_0x4452('0x3d')](_0x1aad30[_0x4452('0x3b')],{'$or':_[_0x4452('0x2f')](_0x1e3b90,function(_0x438bd5){if(_0x438bd5['type']!=='VIRTUAL'){var _0x259bce={};_0x259bce[_0x438bd5['name']]={'$like':'%'+_0x5bdc64[_0x4452('0x30')]['filter']+'%'};return _0x259bce;}})});}_0x1aad30=_[_0x4452('0x3d')]({},_0x1aad30,_0x5bdc64[_0x4452('0x3e')]);var _0x3788af={'where':_0x1aad30[_0x4452('0x3b')]};return db[_0x4452('0x2a')][_0x4452('0x1c')](_0x3788af)[_0x4452('0x24')](function(_0xaa9970){_0x457305[_0x4452('0x1c')]=_0xaa9970;if(_0x5bdc64[_0x4452('0x30')][_0x4452('0x3f')]){_0x1aad30[_0x4452('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x4452('0x41')](_0x1aad30);})[_0x4452('0x24')](function(_0x11bc46){_0x457305[_0x4452('0x42')]=_0x11bc46;return _0x457305;})[_0x4452('0x24')](respondWithFilteredResult(_0x377f5f,_0x1aad30))['catch'](handleError(_0x377f5f,null));};exports[_0x4452('0x43')]=function(_0x3dd8a3,_0x3b4fa7){var _0x7c147={'raw':!![],'where':{'id':_0x3dd8a3[_0x4452('0x44')]['id']}},_0x51904e={};_0x51904e[_0x4452('0x2e')]=_[_0x4452('0x31')](db[_0x4452('0x2a')][_0x4452('0x2b')]);_0x51904e[_0x4452('0x30')]=_[_0x4452('0x31')](_0x3dd8a3[_0x4452('0x30')]);_0x51904e['filters']=_[_0x4452('0x33')](_0x51904e['model'],_0x51904e[_0x4452('0x30')]);_0x7c147[_0x4452('0x45')]=_[_0x4452('0x33')](_0x51904e[_0x4452('0x2e')],qs[_0x4452('0x34')](_0x3dd8a3[_0x4452('0x30')]['fields']));_0x7c147[_0x4452('0x45')]=_0x7c147[_0x4452('0x45')]['length']?_0x7c147[_0x4452('0x45')]:_0x51904e[_0x4452('0x2e')];if(_0x3dd8a3[_0x4452('0x30')][_0x4452('0x3f')]){_0x7c147[_0x4452('0x40')]=[{'all':!![]}];}_0x7c147=_[_0x4452('0x3d')]({},_0x7c147,_0x3dd8a3[_0x4452('0x3e')]);return db['JscriptyQuestionReport'][_0x4452('0x46')](_0x7c147)['then'](handleEntityNotFound(_0x3b4fa7,null))[_0x4452('0x24')](respondWithResult(_0x3b4fa7,null))['catch'](handleError(_0x3b4fa7,null));};exports[_0x4452('0x47')]=function(_0x33d753,_0x42f55e){return db[_0x4452('0x2a')][_0x4452('0x47')](_0x33d753[_0x4452('0x48')],{})[_0x4452('0x24')](respondWithResult(_0x42f55e,0xc9))['catch'](handleError(_0x42f55e,null));};exports[_0x4452('0x22')]=function(_0x1d9e6c,_0x2adfa4){if(_0x1d9e6c[_0x4452('0x48')]['id']){delete _0x1d9e6c[_0x4452('0x48')]['id'];}return db[_0x4452('0x2a')][_0x4452('0x46')]({'where':{'id':_0x1d9e6c[_0x4452('0x44')]['id']}})[_0x4452('0x24')](handleEntityNotFound(_0x2adfa4,null))[_0x4452('0x24')](saveUpdates(_0x1d9e6c['body'],null))['then'](respondWithResult(_0x2adfa4,null))[_0x4452('0x49')](handleError(_0x2adfa4,null));};exports[_0x4452('0x23')]=function(_0x107f2f,_0x43d712){return db[_0x4452('0x2a')][_0x4452('0x46')]({'where':{'id':_0x107f2f['params']['id']}})[_0x4452('0x24')](handleEntityNotFound(_0x43d712,null))['then'](removeEntity(_0x43d712,null))[_0x4452('0x49')](handleError(_0x43d712,null));};exports[_0x4452('0x4a')]=function(_0x14b30f,_0x55c828){return db['JscriptyQuestionReport'][_0x4452('0x4a')]()[_0x4452('0x24')](respondWithResult(_0x55c828,null))[_0x4452('0x49')](handleError(_0x55c828,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 07d4e77..417ce85 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 _0x1cd8=['api','bluebird','request-promise','rimraf','../../config/environment','define','report_jscripty_questions','lodash','../../config/logger'];(function(_0x43e4b2,_0x401083){var _0x4bf27b=function(_0x4aa933){while(--_0x4aa933){_0x43e4b2['push'](_0x43e4b2['shift']());}};_0x4bf27b(++_0x401083);}(_0x1cd8,0xa0));var _0x81cd=function(_0x263721,_0x10ce8e){_0x263721=_0x263721-0x0;var _0x5d503b=_0x1cd8[_0x263721];return _0x5d503b;};'use strict';var _=require(_0x81cd('0x0'));var util=require('util');var logger=require(_0x81cd('0x1'))(_0x81cd('0x2'));var moment=require('moment');var BPromise=require(_0x81cd('0x3'));var rp=require(_0x81cd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81cd('0x5'));var config=require(_0x81cd('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x40d846,_0x38095f){return _0x40d846[_0x81cd('0x7')]('JscriptyQuestionReport',attributes,{'tableName':_0x81cd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8609=['JscriptyQuestionReport','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x1e672e,_0x577725){var _0x1c8c07=function(_0x5480d3){while(--_0x5480d3){_0x1e672e['push'](_0x1e672e['shift']());}};_0x1c8c07(++_0x577725);}(_0x8609,0x161));var _0x9860=function(_0x5885ff,_0x5ae1d2){_0x5885ff=_0x5885ff-0x0;var _0x161990=_0x8609[_0x5885ff];return _0x161990;};'use strict';var _=require('lodash');var util=require(_0x9860('0x0'));var logger=require(_0x9860('0x1'))('api');var moment=require(_0x9860('0x2'));var BPromise=require(_0x9860('0x3'));var rp=require(_0x9860('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9860('0x5'));var config=require(_0x9860('0x6'));var attributes=require(_0x9860('0x7'));module[_0x9860('0x8')]=function(_0x4781dc,_0x37b7cd){return _0x4781dc[_0x9860('0x9')](_0x9860('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 6c57922..d250463 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 _0x739d=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x739d,0xef));var _0xd739=function(_0x1e6188,_0xd6f9a9){_0x1e6188=_0x1e6188-0x0;var _0x4b6f84=_0x739d[_0x1e6188];return _0x4b6f84;};'use strict';var _=require('lodash');var util=require(_0xd739('0x0'));var moment=require(_0xd739('0x1'));var BPromise=require('bluebird');var rs=require(_0xd739('0x2'));var fs=require('fs');var Redis=require(_0xd739('0x3'));var db=require(_0xd739('0x4'))['db'];var utils=require(_0xd739('0x5'));var logger=require(_0xd739('0x6'))(_0xd739('0x7'));var config=require(_0xd739('0x8'));var jayson=require(_0xd739('0x9'));var client=jayson['client'][_0xd739('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8ce53e,_0x430e65,_0x5bc24a){return new BPromise(function(_0x2451bd,_0x3e47a9){return client[_0xd739('0xb')](_0x8ce53e,_0x5bc24a)[_0xd739('0xc')](function(_0x47261a){logger[_0xd739('0xd')](_0xd739('0xe'),_0x430e65,_0xd739('0xf'));logger[_0xd739('0x10')](_0xd739('0x11'),_0x430e65,'request\x20sent',JSON[_0xd739('0x12')](_0x47261a));if(_0x47261a[_0xd739('0x13')]){if(_0x47261a['error'][_0xd739('0x14')]===0x1f4){logger[_0xd739('0x13')](_0xd739('0xe'),_0x430e65,_0x47261a[_0xd739('0x13')]['message']);return _0x3e47a9(_0x47261a[_0xd739('0x13')][_0xd739('0x15')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x430e65,_0x47261a['error'][_0xd739('0x15')]);return _0x2451bd(_0x47261a[_0xd739('0x13')][_0xd739('0x15')]);}else{logger[_0xd739('0xd')](_0xd739('0xe'),_0x430e65,_0xd739('0xf'));_0x2451bd(_0x47261a[_0xd739('0x16')][_0xd739('0x15')]);}})['catch'](function(_0x3dc141){logger[_0xd739('0x13')](_0xd739('0xe'),_0x430e65,_0x3dc141);_0x3e47a9(_0x3dc141);});});} \ No newline at end of file +var _0xd451=['lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x3b3017,_0x531959){var _0xd8fd8d=function(_0x537d8f){while(--_0x537d8f){_0x3b3017['push'](_0x3b3017['shift']());}};_0xd8fd8d(++_0x531959);}(_0xd451,0x93));var _0x1d45=function(_0x3c4bbd,_0x142d4b){_0x3c4bbd=_0x3c4bbd-0x0;var _0x1675b3=_0xd451[_0x3c4bbd];return _0x1675b3;};'use strict';var _=require(_0x1d45('0x0'));var util=require('util');var moment=require(_0x1d45('0x1'));var BPromise=require(_0x1d45('0x2'));var rs=require(_0x1d45('0x3'));var fs=require('fs');var Redis=require(_0x1d45('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d45('0x5'))(_0x1d45('0x6'));var config=require(_0x1d45('0x7'));var jayson=require(_0x1d45('0x8'));var client=jayson[_0x1d45('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17c60b,_0x73b533,_0x2e2841){return new BPromise(function(_0x171d8d,_0x284aa7){return client[_0x1d45('0xa')](_0x17c60b,_0x2e2841)[_0x1d45('0xb')](function(_0x182971){logger['info'](_0x1d45('0xc'),_0x73b533,_0x1d45('0xd'));logger['debug'](_0x1d45('0xe'),_0x73b533,_0x1d45('0xd'),JSON[_0x1d45('0xf')](_0x182971));if(_0x182971[_0x1d45('0x10')]){if(_0x182971[_0x1d45('0x10')]['code']===0x1f4){logger[_0x1d45('0x10')](_0x1d45('0xc'),_0x73b533,_0x182971[_0x1d45('0x10')][_0x1d45('0x11')]);return _0x284aa7(_0x182971[_0x1d45('0x10')][_0x1d45('0x11')]);}logger['error'](_0x1d45('0xc'),_0x73b533,_0x182971['error'][_0x1d45('0x11')]);return _0x171d8d(_0x182971[_0x1d45('0x10')]['message']);}else{logger[_0x1d45('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x73b533,_0x1d45('0xd'));_0x171d8d(_0x182971[_0x1d45('0x13')][_0x1d45('0x11')]);}})[_0x1d45('0x14')](function(_0x1fe5bf){logger[_0x1d45('0x10')](_0x1d45('0xc'),_0x73b533,_0x1fe5bf);_0x284aa7(_0x1fe5bf);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 257920c..290b571 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 _0xa30f=['util','express','Router','../../components/auth/service','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0xa30f,0x164));var _0xfa30=function(_0x5d19e7,_0x553601){_0x5d19e7=_0x5d19e7-0x0;var _0x3e635a=_0xa30f[_0x5d19e7];return _0x3e635a;};'use strict';var multer=require(_0xfa30('0x0'));var util=require(_0xfa30('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa30('0x2'));var router=express[_0xfa30('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfa30('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa30('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa30('0x6')]);router[_0xfa30('0x7')](_0xfa30('0x8'),auth[_0xfa30('0x9')](),controller['describe']);router['get'](_0xfa30('0xa'),auth[_0xfa30('0x9')](),controller[_0xfa30('0xb')]);router[_0xfa30('0x7')](_0xfa30('0xc'),auth[_0xfa30('0x9')](),controller[_0xfa30('0xd')]);router[_0xfa30('0xe')]('/',auth[_0xfa30('0x9')](),controller[_0xfa30('0xf')]);router[_0xfa30('0x10')](_0xfa30('0xa'),auth[_0xfa30('0x9')](),controller[_0xfa30('0x11')]);router[_0xfa30('0x12')](_0xfa30('0xa'),auth[_0xfa30('0x9')](),controller[_0xfa30('0x13')]);module[_0xfa30('0x14')]=router; \ No newline at end of file +var _0x1696=['show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3bcb55,_0x43c027){var _0x242e0c=function(_0x5a3fef){while(--_0x5a3fef){_0x3bcb55['push'](_0x3bcb55['shift']());}};_0x242e0c(++_0x43c027);}(_0x1696,0x6e));var _0x6169=function(_0x31b292,_0x37d163){_0x31b292=_0x31b292-0x0;var _0x5292e4=_0x1696[_0x31b292];return _0x5292e4;};'use strict';var multer=require(_0x6169('0x0'));var util=require(_0x6169('0x1'));var path=require(_0x6169('0x2'));var timeout=require(_0x6169('0x3'));var express=require('express');var router=express[_0x6169('0x4')]();var fs_extra=require(_0x6169('0x5'));var auth=require(_0x6169('0x6'));var interaction=require(_0x6169('0x7'));var config=require('../../config/environment');var controller=require(_0x6169('0x8'));router[_0x6169('0x9')]('/',auth[_0x6169('0xa')](),controller[_0x6169('0xb')]);router[_0x6169('0x9')](_0x6169('0xc'),auth[_0x6169('0xa')](),controller[_0x6169('0xd')]);router[_0x6169('0x9')](_0x6169('0xe'),auth[_0x6169('0xa')](),controller[_0x6169('0xf')]);router[_0x6169('0x9')](_0x6169('0x10'),auth[_0x6169('0xa')](),controller[_0x6169('0x11')]);router[_0x6169('0x12')]('/',auth[_0x6169('0xa')](),controller[_0x6169('0x13')]);router[_0x6169('0x14')](_0x6169('0xe'),auth['isAuthenticated'](),controller[_0x6169('0x15')]);router[_0x6169('0x16')](_0x6169('0xe'),auth[_0x6169('0xa')](),controller[_0x6169('0x17')]);module[_0x6169('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 946a9d6..b0527f0 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 _0xdc3f=['setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','starttime'];(function(_0x5024e8,_0x11b55c){var _0x292abf=function(_0x45c674){while(--_0x45c674){_0x5024e8['push'](_0x5024e8['shift']());}};_0x292abf(++_0x11b55c);}(_0xdc3f,0xaf));var _0xfdc3=function(_0xb670c,_0x4b05f8){_0xb670c=_0xb670c-0x0;var _0xc10e78=_0xdc3f[_0xb670c];return _0xc10e78;};'use strict';var moment=require(_0xfdc3('0x0'));var Sequelize=require(_0xfdc3('0x1'));module[_0xfdc3('0x2')]={'starttime':{'type':Sequelize[_0xfdc3('0x3')],'set':function(_0x3b2cc6){this['setDataValue'](_0xfdc3('0x4'),_0x3b2cc6);this[_0xfdc3('0x5')](_0xfdc3('0x6'),moment()['format'](_0xfdc3('0x7')));}},'endtime':{'type':Sequelize[_0xfdc3('0x3')]},'membername':{'type':Sequelize[_0xfdc3('0x8')]},'projectname':{'type':Sequelize[_0xfdc3('0x8')]},'queue':{'type':Sequelize[_0xfdc3('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfdc3('0x8')]},'calleridnum':{'type':Sequelize[_0xfdc3('0x8')]},'completed':{'type':Sequelize[_0xfdc3('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x8406=['BOOLEAN','moment','sequelize','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0x8406,0x1b9));var _0x6840=function(_0x10df81,_0x43a5b1){_0x10df81=_0x10df81-0x0;var _0x101791=_0x8406[_0x10df81];return _0x101791;};'use strict';var moment=require(_0x6840('0x0'));var Sequelize=require(_0x6840('0x1'));module[_0x6840('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4665ac){this[_0x6840('0x3')](_0x6840('0x4'),_0x4665ac);this['setDataValue'](_0x6840('0x5'),moment()[_0x6840('0x6')](_0x6840('0x7')));}},'endtime':{'type':Sequelize[_0x6840('0x8')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x6840('0x9')]},'queue':{'type':Sequelize[_0x6840('0x9')]},'uniqueid':{'type':Sequelize[_0x6840('0x9')]},'calleridname':{'type':Sequelize[_0x6840('0x9')]},'calleridnum':{'type':Sequelize[_0x6840('0x9')]},'completed':{'type':Sequelize[_0x6840('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 53fecc8..3292c99 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 _0xdcb5=['query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','options','findAll','rows','catch','find','create','body','params','describe','getQuestions','findOne','hasOwnProperty','order','SessionId','includeAll','include','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','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','end','status','json','offset','limit','undefined','count','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','map','JscriptySessionReport','rawAttributes','fieldName','key'];(function(_0x49adfe,_0x2fd329){var _0x1d53da=function(_0x4edbdb){while(--_0x4edbdb){_0x49adfe['push'](_0x49adfe['shift']());}};_0x1d53da(++_0x2fd329);}(_0xdcb5,0xb8));var _0x5dcb=function(_0x488b53,_0x488f74){_0x488b53=_0x488b53-0x0;var _0x3a1032=_0xdcb5[_0x488b53];return _0x3a1032;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5dcb('0x0'));var rp=require(_0x5dcb('0x1'));var moment=require('moment');var BPromise=require(_0x5dcb('0x2'));var Mustache=require(_0x5dcb('0x3'));var util=require(_0x5dcb('0x4'));var path=require(_0x5dcb('0x5'));var sox=require(_0x5dcb('0x6'));var csv=require('to-csv');var ejs=require(_0x5dcb('0x7'));var fs=require('fs');var fs_extra=require(_0x5dcb('0x8'));var _=require(_0x5dcb('0x9'));var squel=require(_0x5dcb('0xa'));var crypto=require('crypto');var jsforce=require(_0x5dcb('0xb'));var deskjs=require(_0x5dcb('0xc'));var toCsv=require(_0x5dcb('0xd'));var querystring=require(_0x5dcb('0xe'));var Papa=require(_0x5dcb('0xf'));var Redis=require(_0x5dcb('0x10'));var authService=require(_0x5dcb('0x11'));var qs=require(_0x5dcb('0x12'));var as=require(_0x5dcb('0x13'));var hardwareService=require(_0x5dcb('0x14'));var logger=require(_0x5dcb('0x15'))(_0x5dcb('0x16'));var utils=require(_0x5dcb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5dcb('0x18'));var db=require(_0x5dcb('0x19'))['db'];function respondWithStatusCode(_0x28b0aa,_0x11f412){_0x11f412=_0x11f412||0xcc;return function(_0x2955ba){if(_0x2955ba){return _0x28b0aa['sendStatus'](_0x11f412);}return _0x28b0aa['status'](_0x11f412)[_0x5dcb('0x1a')]();};}function respondWithResult(_0x30d7bd,_0x41c6ec){_0x41c6ec=_0x41c6ec||0xc8;return function(_0x573a15){if(_0x573a15){return _0x30d7bd[_0x5dcb('0x1b')](_0x41c6ec)[_0x5dcb('0x1c')](_0x573a15);}};}function respondWithFilteredResult(_0x39f789,_0x4e2395){return function(_0x4c9d6d){if(_0x4c9d6d){var _0x46412a=typeof _0x4e2395[_0x5dcb('0x1d')]==='undefined'&&typeof _0x4e2395[_0x5dcb('0x1e')]===_0x5dcb('0x1f');var _0x16af0a=_0x4c9d6d[_0x5dcb('0x20')];var _0x3b5945=_0x46412a?0x0:_0x4e2395[_0x5dcb('0x1d')];var _0x3a305d=_0x46412a?_0x4c9d6d[_0x5dcb('0x20')]:_0x4e2395[_0x5dcb('0x1d')]+_0x4e2395[_0x5dcb('0x1e')];var _0x5fdfcd;if(_0x3a305d>=_0x16af0a){_0x3a305d=_0x16af0a;_0x5fdfcd=0xc8;}else{_0x5fdfcd=0xce;}_0x39f789[_0x5dcb('0x1b')](_0x5fdfcd);return _0x39f789['set'](_0x5dcb('0x21'),_0x3b5945+'-'+_0x3a305d+'/'+_0x16af0a)[_0x5dcb('0x1c')](_0x4c9d6d);}return null;};}function patchUpdates(_0x1c3b15){return function(_0x472824){try{jsonpatch[_0x5dcb('0x22')](_0x472824,_0x1c3b15,!![]);}catch(_0x3354c6){return BPromise['reject'](_0x3354c6);}return _0x472824['save']();};}function saveUpdates(_0x1d1178,_0x3e1705){return function(_0x4483eb){if(_0x4483eb){return _0x4483eb[_0x5dcb('0x23')](_0x1d1178)[_0x5dcb('0x24')](function(_0x1a8d93){return _0x1a8d93;});}return null;};}function removeEntity(_0x3d5af6,_0x61c0a6){return function(_0x1c6a3a){if(_0x1c6a3a){return _0x1c6a3a[_0x5dcb('0x25')]()[_0x5dcb('0x24')](function(){_0x3d5af6[_0x5dcb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517d5b,_0x286f28){return function(_0x8343d1){if(!_0x8343d1){_0x517d5b[_0x5dcb('0x26')](0x194);}return _0x8343d1;};}function handleError(_0x5cb0ca,_0x56f695){_0x56f695=_0x56f695||0x1f4;return function(_0x1a670f){logger[_0x5dcb('0x27')](_0x1a670f[_0x5dcb('0x28')]);if(_0x1a670f[_0x5dcb('0x29')]){delete _0x1a670f['name'];}_0x5cb0ca[_0x5dcb('0x1b')](_0x56f695)['send'](_0x1a670f);};}exports['index']=function(_0x2e9d9e,_0x242c18){var _0xfa2c51={},_0x8805fc={},_0x28372f={'count':0x0,'rows':[]};var _0x17bf5f=_[_0x5dcb('0x2a')](db[_0x5dcb('0x2b')][_0x5dcb('0x2c')],function(_0x15bdce){return{'name':_0x15bdce[_0x5dcb('0x2d')],'type':_0x15bdce['type'][_0x5dcb('0x2e')]};});_0x8805fc['model']=_[_0x5dcb('0x2a')](_0x17bf5f,_0x5dcb('0x29'));_0x8805fc[_0x5dcb('0x2f')]=_[_0x5dcb('0x30')](_0x2e9d9e['query']);_0x8805fc[_0x5dcb('0x31')]=_[_0x5dcb('0x32')](_0x8805fc[_0x5dcb('0x33')],_0x8805fc[_0x5dcb('0x2f')]);_0xfa2c51[_0x5dcb('0x34')]=_[_0x5dcb('0x32')](_0x8805fc[_0x5dcb('0x33')],qs[_0x5dcb('0x35')](_0x2e9d9e[_0x5dcb('0x2f')][_0x5dcb('0x35')]));_0xfa2c51[_0x5dcb('0x34')]=_0xfa2c51['attributes'][_0x5dcb('0x36')]?_0xfa2c51[_0x5dcb('0x34')]:_0x8805fc['model'];if(!_0x2e9d9e[_0x5dcb('0x2f')]['hasOwnProperty'](_0x5dcb('0x37'))){_0xfa2c51['limit']=qs[_0x5dcb('0x1e')](_0x2e9d9e[_0x5dcb('0x2f')][_0x5dcb('0x1e')]);_0xfa2c51['offset']=qs['offset'](_0x2e9d9e[_0x5dcb('0x2f')][_0x5dcb('0x1d')]);}_0xfa2c51['order']=qs[_0x5dcb('0x38')](_0x2e9d9e['query']['sort']);_0xfa2c51['where']=qs[_0x5dcb('0x31')](_[_0x5dcb('0x39')](_0x2e9d9e[_0x5dcb('0x2f')],_0x8805fc[_0x5dcb('0x31')]),_0x17bf5f);if(_0x2e9d9e[_0x5dcb('0x2f')][_0x5dcb('0x3a')]){_0xfa2c51[_0x5dcb('0x3b')]=_['merge'](_0xfa2c51[_0x5dcb('0x3b')],{'$or':_['map'](_0x17bf5f,function(_0x5bc3c7){if(_0x5bc3c7['type']!=='VIRTUAL'){var _0x3bade5={};_0x3bade5[_0x5bc3c7[_0x5dcb('0x29')]]={'$like':'%'+_0x2e9d9e[_0x5dcb('0x2f')]['filter']+'%'};return _0x3bade5;}})});}_0xfa2c51=_[_0x5dcb('0x3c')]({},_0xfa2c51,_0x2e9d9e[_0x5dcb('0x3d')]);var _0x2960d2={'where':_0xfa2c51[_0x5dcb('0x3b')]};return db['JscriptySessionReport'][_0x5dcb('0x20')](_0x2960d2)['then'](function(_0x4e4f8d){_0x28372f[_0x5dcb('0x20')]=_0x4e4f8d;if(_0x2e9d9e['query']['includeAll']){_0xfa2c51['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x5dcb('0x3e')](_0xfa2c51);})[_0x5dcb('0x24')](function(_0x59e8ac){_0x28372f[_0x5dcb('0x3f')]=_0x59e8ac;return _0x28372f;})['then'](respondWithFilteredResult(_0x242c18,_0xfa2c51))[_0x5dcb('0x40')](handleError(_0x242c18,null));};exports['show']=function(_0x8e9d9d,_0xabe521){var _0x84a546={'raw':!![],'where':{'id':_0x8e9d9d['params']['id']}},_0x57f028={};_0x57f028[_0x5dcb('0x33')]=_[_0x5dcb('0x30')](db['JscriptySessionReport'][_0x5dcb('0x2c')]);_0x57f028[_0x5dcb('0x2f')]=_[_0x5dcb('0x30')](_0x8e9d9d[_0x5dcb('0x2f')]);_0x57f028[_0x5dcb('0x31')]=_[_0x5dcb('0x32')](_0x57f028[_0x5dcb('0x33')],_0x57f028[_0x5dcb('0x2f')]);_0x84a546[_0x5dcb('0x34')]=_[_0x5dcb('0x32')](_0x57f028[_0x5dcb('0x33')],qs[_0x5dcb('0x35')](_0x8e9d9d[_0x5dcb('0x2f')][_0x5dcb('0x35')]));_0x84a546[_0x5dcb('0x34')]=_0x84a546[_0x5dcb('0x34')][_0x5dcb('0x36')]?_0x84a546[_0x5dcb('0x34')]:_0x57f028[_0x5dcb('0x33')];if(_0x8e9d9d['query']['includeAll']){_0x84a546['include']=[{'all':!![]}];}_0x84a546=_[_0x5dcb('0x3c')]({},_0x84a546,_0x8e9d9d[_0x5dcb('0x3d')]);return db['JscriptySessionReport'][_0x5dcb('0x41')](_0x84a546)['then'](handleEntityNotFound(_0xabe521,null))[_0x5dcb('0x24')](respondWithResult(_0xabe521,null))[_0x5dcb('0x40')](handleError(_0xabe521,null));};exports[_0x5dcb('0x42')]=function(_0x3b1421,_0x33d426){return db['JscriptySessionReport'][_0x5dcb('0x42')](_0x3b1421[_0x5dcb('0x43')],{})['then'](respondWithResult(_0x33d426,0xc9))['catch'](handleError(_0x33d426,null));};exports[_0x5dcb('0x23')]=function(_0x3e4fbc,_0x24a271){if(_0x3e4fbc[_0x5dcb('0x43')]['id']){delete _0x3e4fbc['body']['id'];}return db[_0x5dcb('0x2b')][_0x5dcb('0x41')]({'where':{'id':_0x3e4fbc['params']['id']}})[_0x5dcb('0x24')](handleEntityNotFound(_0x24a271,null))[_0x5dcb('0x24')](saveUpdates(_0x3e4fbc[_0x5dcb('0x43')],null))[_0x5dcb('0x24')](respondWithResult(_0x24a271,null))[_0x5dcb('0x40')](handleError(_0x24a271,null));};exports['destroy']=function(_0x303468,_0x334485){return db[_0x5dcb('0x2b')][_0x5dcb('0x41')]({'where':{'id':_0x303468[_0x5dcb('0x44')]['id']}})[_0x5dcb('0x24')](handleEntityNotFound(_0x334485,null))[_0x5dcb('0x24')](removeEntity(_0x334485,null))['catch'](handleError(_0x334485,null));};exports[_0x5dcb('0x45')]=function(_0x475c24,_0x2f0aa6){return db[_0x5dcb('0x2b')][_0x5dcb('0x45')]()[_0x5dcb('0x24')](respondWithResult(_0x2f0aa6,null))['catch'](handleError(_0x2f0aa6,null));};exports[_0x5dcb('0x46')]=function(_0x53d0c7,_0x20f4c3,_0x2bb0f5){var _0x4e01e7={'raw':!![],'where':{}};var _0x1a2f71={};var _0x4ca98f={'count':0x0,'rows':[]};return db[_0x5dcb('0x2b')][_0x5dcb('0x47')]({'where':{'id':_0x53d0c7[_0x5dcb('0x44')]['id']}})[_0x5dcb('0x24')](handleEntityNotFound(_0x20f4c3,null))[_0x5dcb('0x24')](function(_0x38eea0){if(_0x38eea0){_0x1a2f71[_0x5dcb('0x33')]=_[_0x5dcb('0x30')](db['JscriptyQuestionReport'][_0x5dcb('0x2c')]);_0x1a2f71['query']=_['keys'](_0x53d0c7['query']);_0x1a2f71[_0x5dcb('0x31')]=_[_0x5dcb('0x32')](_0x1a2f71['model'],_0x1a2f71[_0x5dcb('0x2f')]);_0x4e01e7[_0x5dcb('0x34')]=_[_0x5dcb('0x32')](_0x1a2f71['model'],qs[_0x5dcb('0x35')](_0x53d0c7[_0x5dcb('0x2f')][_0x5dcb('0x35')]));_0x4e01e7[_0x5dcb('0x34')]=_0x4e01e7['attributes'][_0x5dcb('0x36')]?_0x4e01e7[_0x5dcb('0x34')]:_0x1a2f71[_0x5dcb('0x33')];if(!_0x53d0c7['query'][_0x5dcb('0x48')](_0x5dcb('0x37'))){_0x4e01e7[_0x5dcb('0x1e')]=qs[_0x5dcb('0x1e')](_0x53d0c7['query'][_0x5dcb('0x1e')]);_0x4e01e7[_0x5dcb('0x1d')]=qs[_0x5dcb('0x1d')](_0x53d0c7[_0x5dcb('0x2f')]['offset']);}_0x4e01e7[_0x5dcb('0x49')]=qs[_0x5dcb('0x38')](_0x53d0c7[_0x5dcb('0x2f')]['sort']);_0x4e01e7['where']=qs[_0x5dcb('0x31')](_[_0x5dcb('0x39')](_0x53d0c7['query'],_0x1a2f71[_0x5dcb('0x31')]));_0x4e01e7[_0x5dcb('0x3b')][_0x5dcb('0x4a')]=_0x38eea0['id'];if(_0x53d0c7['query'][_0x5dcb('0x3a')]){_0x4e01e7[_0x5dcb('0x3b')]=_[_0x5dcb('0x3c')](_0x4e01e7[_0x5dcb('0x3b')],{'$or':_[_0x5dcb('0x2a')](_0x4e01e7[_0x5dcb('0x34')],function(_0x24a00){var _0x947228={};_0x947228[_0x24a00]={'$like':'%'+_0x53d0c7[_0x5dcb('0x2f')][_0x5dcb('0x3a')]+'%'};return _0x947228;})});}_0x4e01e7=_[_0x5dcb('0x3c')]({},_0x4e01e7,_0x53d0c7[_0x5dcb('0x3d')]);return db['JscriptyQuestionReport'][_0x5dcb('0x20')]({'where':_0x4e01e7['where']})[_0x5dcb('0x24')](function(_0x3309fd){_0x4ca98f[_0x5dcb('0x20')]=_0x3309fd;if(_0x53d0c7[_0x5dcb('0x2f')][_0x5dcb('0x4b')]){_0x4e01e7[_0x5dcb('0x4c')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x4e01e7);})['then'](function(_0x5ace05){_0x4ca98f[_0x5dcb('0x3f')]=_0x5ace05;return _0x4ca98f;});}})[_0x5dcb('0x24')](respondWithFilteredResult(_0x20f4c3,_0x4e01e7))['catch'](handleError(_0x20f4c3,null));}; \ No newline at end of file +var _0x08cc=['keys','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','apply','save','update','then','destroy','error','stack','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','rows','catch','show','params'];(function(_0x803ae0,_0x5c5f30){var _0x3c38b1=function(_0x59b091){while(--_0x59b091){_0x803ae0['push'](_0x803ae0['shift']());}};_0x3c38b1(++_0x5c5f30);}(_0x08cc,0x148));var _0xc08c=function(_0x2af524,_0x20b20a){_0x2af524=_0x2af524-0x0;var _0x43b62a=_0x08cc[_0x2af524];return _0x43b62a;};'use strict';var emlformat=require(_0xc08c('0x0'));var rimraf=require(_0xc08c('0x1'));var zipdir=require(_0xc08c('0x2'));var jsonpatch=require(_0xc08c('0x3'));var rp=require('request-promise');var moment=require(_0xc08c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc08c('0x5'));var util=require('util');var path=require(_0xc08c('0x6'));var sox=require(_0xc08c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc08c('0x8'));var squel=require(_0xc08c('0x9'));var crypto=require('crypto');var jsforce=require(_0xc08c('0xa'));var deskjs=require(_0xc08c('0xb'));var toCsv=require(_0xc08c('0xc'));var querystring=require(_0xc08c('0xd'));var Papa=require('papaparse');var Redis=require(_0xc08c('0xe'));var authService=require(_0xc08c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc08c('0x10'));var hardwareService=require(_0xc08c('0x11'));var logger=require(_0xc08c('0x12'))(_0xc08c('0x13'));var utils=require(_0xc08c('0x14'));var config=require(_0xc08c('0x15'));var licenseUtil=require(_0xc08c('0x16'));var db=require(_0xc08c('0x17'))['db'];function respondWithStatusCode(_0x4c3ec6,_0x4eefd5){_0x4eefd5=_0x4eefd5||0xcc;return function(_0x15ea5b){if(_0x15ea5b){return _0x4c3ec6[_0xc08c('0x18')](_0x4eefd5);}return _0x4c3ec6[_0xc08c('0x19')](_0x4eefd5)[_0xc08c('0x1a')]();};}function respondWithResult(_0x1de185,_0x4e4df1){_0x4e4df1=_0x4e4df1||0xc8;return function(_0x34c5e1){if(_0x34c5e1){return _0x1de185[_0xc08c('0x19')](_0x4e4df1)['json'](_0x34c5e1);}};}function respondWithFilteredResult(_0x262ca2,_0x4a4530){return function(_0x319820){if(_0x319820){var _0x52637d=typeof _0x4a4530[_0xc08c('0x1b')]===_0xc08c('0x1c')&&typeof _0x4a4530['limit']===_0xc08c('0x1c');var _0x51b524=_0x319820[_0xc08c('0x1d')];var _0x11d29d=_0x52637d?0x0:_0x4a4530['offset'];var _0x1e3099=_0x52637d?_0x319820['count']:_0x4a4530[_0xc08c('0x1b')]+_0x4a4530[_0xc08c('0x1e')];var _0x3be572;if(_0x1e3099>=_0x51b524){_0x1e3099=_0x51b524;_0x3be572=0xc8;}else{_0x3be572=0xce;}_0x262ca2['status'](_0x3be572);return _0x262ca2['set']('Content-Range',_0x11d29d+'-'+_0x1e3099+'/'+_0x51b524)['json'](_0x319820);}return null;};}function patchUpdates(_0x4bfb17){return function(_0x59afd8){try{jsonpatch[_0xc08c('0x1f')](_0x59afd8,_0x4bfb17,!![]);}catch(_0x548532){return BPromise['reject'](_0x548532);}return _0x59afd8[_0xc08c('0x20')]();};}function saveUpdates(_0x5d599d,_0x59a264){return function(_0x27c8aa){if(_0x27c8aa){return _0x27c8aa[_0xc08c('0x21')](_0x5d599d)[_0xc08c('0x22')](function(_0x34b846){return _0x34b846;});}return null;};}function removeEntity(_0x4be989,_0x1b7a2f){return function(_0x2c425c){if(_0x2c425c){return _0x2c425c[_0xc08c('0x23')]()['then'](function(){_0x4be989[_0xc08c('0x19')](0xcc)[_0xc08c('0x1a')]();});}};}function handleEntityNotFound(_0xa81a63,_0x3f4d40){return function(_0x5c767a){if(!_0x5c767a){_0xa81a63[_0xc08c('0x18')](0x194);}return _0x5c767a;};}function handleError(_0x586fa7,_0x1e173a){_0x1e173a=_0x1e173a||0x1f4;return function(_0x6d3d92){logger[_0xc08c('0x24')](_0x6d3d92[_0xc08c('0x25')]);if(_0x6d3d92['name']){delete _0x6d3d92['name'];}_0x586fa7[_0xc08c('0x19')](_0x1e173a)[_0xc08c('0x26')](_0x6d3d92);};}exports[_0xc08c('0x27')]=function(_0x4f53c2,_0x5c43b9){var _0x28a162={},_0x403f2c={},_0x2f2f9e={'count':0x0,'rows':[]};var _0x3e3cbc=_[_0xc08c('0x28')](db[_0xc08c('0x29')][_0xc08c('0x2a')],function(_0x5374f9){return{'name':_0x5374f9[_0xc08c('0x2b')],'type':_0x5374f9['type'][_0xc08c('0x2c')]};});_0x403f2c[_0xc08c('0x2d')]=_[_0xc08c('0x28')](_0x3e3cbc,_0xc08c('0x2e'));_0x403f2c[_0xc08c('0x2f')]=_['keys'](_0x4f53c2[_0xc08c('0x2f')]);_0x403f2c[_0xc08c('0x30')]=_[_0xc08c('0x31')](_0x403f2c[_0xc08c('0x2d')],_0x403f2c[_0xc08c('0x2f')]);_0x28a162[_0xc08c('0x32')]=_[_0xc08c('0x31')](_0x403f2c['model'],qs[_0xc08c('0x33')](_0x4f53c2[_0xc08c('0x2f')][_0xc08c('0x33')]));_0x28a162[_0xc08c('0x32')]=_0x28a162[_0xc08c('0x32')][_0xc08c('0x34')]?_0x28a162['attributes']:_0x403f2c[_0xc08c('0x2d')];if(!_0x4f53c2[_0xc08c('0x2f')][_0xc08c('0x35')](_0xc08c('0x36'))){_0x28a162[_0xc08c('0x1e')]=qs[_0xc08c('0x1e')](_0x4f53c2[_0xc08c('0x2f')][_0xc08c('0x1e')]);_0x28a162[_0xc08c('0x1b')]=qs['offset'](_0x4f53c2[_0xc08c('0x2f')][_0xc08c('0x1b')]);}_0x28a162['order']=qs['sort'](_0x4f53c2[_0xc08c('0x2f')][_0xc08c('0x37')]);_0x28a162[_0xc08c('0x38')]=qs[_0xc08c('0x30')](_[_0xc08c('0x39')](_0x4f53c2[_0xc08c('0x2f')],_0x403f2c[_0xc08c('0x30')]),_0x3e3cbc);if(_0x4f53c2[_0xc08c('0x2f')][_0xc08c('0x3a')]){_0x28a162[_0xc08c('0x38')]=_[_0xc08c('0x3b')](_0x28a162[_0xc08c('0x38')],{'$or':_[_0xc08c('0x28')](_0x3e3cbc,function(_0x3579f7){if(_0x3579f7[_0xc08c('0x3c')]!=='VIRTUAL'){var _0x48f95c={};_0x48f95c[_0x3579f7[_0xc08c('0x2e')]]={'$like':'%'+_0x4f53c2['query'][_0xc08c('0x3a')]+'%'};return _0x48f95c;}})});}_0x28a162=_['merge']({},_0x28a162,_0x4f53c2[_0xc08c('0x3d')]);var _0x4478a0={'where':_0x28a162['where']};return db[_0xc08c('0x29')][_0xc08c('0x1d')](_0x4478a0)[_0xc08c('0x22')](function(_0x53d660){_0x2f2f9e['count']=_0x53d660;if(_0x4f53c2[_0xc08c('0x2f')][_0xc08c('0x3e')]){_0x28a162['include']=[{'all':!![]}];}return db[_0xc08c('0x29')]['findAll'](_0x28a162);})[_0xc08c('0x22')](function(_0x3bdd82){_0x2f2f9e[_0xc08c('0x3f')]=_0x3bdd82;return _0x2f2f9e;})[_0xc08c('0x22')](respondWithFilteredResult(_0x5c43b9,_0x28a162))[_0xc08c('0x40')](handleError(_0x5c43b9,null));};exports[_0xc08c('0x41')]=function(_0x30d041,_0x1250df){var _0x51eca6={'raw':!![],'where':{'id':_0x30d041[_0xc08c('0x42')]['id']}},_0x58cd06={};_0x58cd06[_0xc08c('0x2d')]=_[_0xc08c('0x43')](db[_0xc08c('0x29')][_0xc08c('0x2a')]);_0x58cd06['query']=_['keys'](_0x30d041[_0xc08c('0x2f')]);_0x58cd06['filters']=_[_0xc08c('0x31')](_0x58cd06[_0xc08c('0x2d')],_0x58cd06[_0xc08c('0x2f')]);_0x51eca6[_0xc08c('0x32')]=_[_0xc08c('0x31')](_0x58cd06[_0xc08c('0x2d')],qs[_0xc08c('0x33')](_0x30d041[_0xc08c('0x2f')]['fields']));_0x51eca6[_0xc08c('0x32')]=_0x51eca6[_0xc08c('0x32')][_0xc08c('0x34')]?_0x51eca6[_0xc08c('0x32')]:_0x58cd06[_0xc08c('0x2d')];if(_0x30d041[_0xc08c('0x2f')]['includeAll']){_0x51eca6[_0xc08c('0x44')]=[{'all':!![]}];}_0x51eca6=_['merge']({},_0x51eca6,_0x30d041[_0xc08c('0x3d')]);return db['JscriptySessionReport'][_0xc08c('0x45')](_0x51eca6)[_0xc08c('0x22')](handleEntityNotFound(_0x1250df,null))[_0xc08c('0x22')](respondWithResult(_0x1250df,null))[_0xc08c('0x40')](handleError(_0x1250df,null));};exports['create']=function(_0x4d9ac6,_0x38be76){return db[_0xc08c('0x29')][_0xc08c('0x46')](_0x4d9ac6[_0xc08c('0x47')],{})[_0xc08c('0x22')](respondWithResult(_0x38be76,0xc9))['catch'](handleError(_0x38be76,null));};exports[_0xc08c('0x21')]=function(_0x2bda52,_0x5524a6){if(_0x2bda52[_0xc08c('0x47')]['id']){delete _0x2bda52[_0xc08c('0x47')]['id'];}return db[_0xc08c('0x29')][_0xc08c('0x45')]({'where':{'id':_0x2bda52[_0xc08c('0x42')]['id']}})[_0xc08c('0x22')](handleEntityNotFound(_0x5524a6,null))[_0xc08c('0x22')](saveUpdates(_0x2bda52['body'],null))[_0xc08c('0x22')](respondWithResult(_0x5524a6,null))['catch'](handleError(_0x5524a6,null));};exports['destroy']=function(_0x9f5b39,_0xa3a16f){return db[_0xc08c('0x29')][_0xc08c('0x45')]({'where':{'id':_0x9f5b39[_0xc08c('0x42')]['id']}})[_0xc08c('0x22')](handleEntityNotFound(_0xa3a16f,null))[_0xc08c('0x22')](removeEntity(_0xa3a16f,null))[_0xc08c('0x40')](handleError(_0xa3a16f,null));};exports[_0xc08c('0x48')]=function(_0x250ae8,_0x333e43){return db[_0xc08c('0x29')][_0xc08c('0x48')]()[_0xc08c('0x22')](respondWithResult(_0x333e43,null))[_0xc08c('0x40')](handleError(_0x333e43,null));};exports[_0xc08c('0x49')]=function(_0x17a118,_0x1848c5,_0x506adb){var _0xe0e712={'raw':!![],'where':{}};var _0x51e801={};var _0xd2dffa={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xc08c('0x4a')]({'where':{'id':_0x17a118['params']['id']}})[_0xc08c('0x22')](handleEntityNotFound(_0x1848c5,null))['then'](function(_0x29deb2){if(_0x29deb2){_0x51e801['model']=_[_0xc08c('0x43')](db[_0xc08c('0x4b')][_0xc08c('0x2a')]);_0x51e801[_0xc08c('0x2f')]=_[_0xc08c('0x43')](_0x17a118[_0xc08c('0x2f')]);_0x51e801[_0xc08c('0x30')]=_['intersection'](_0x51e801[_0xc08c('0x2d')],_0x51e801[_0xc08c('0x2f')]);_0xe0e712[_0xc08c('0x32')]=_[_0xc08c('0x31')](_0x51e801[_0xc08c('0x2d')],qs[_0xc08c('0x33')](_0x17a118[_0xc08c('0x2f')][_0xc08c('0x33')]));_0xe0e712[_0xc08c('0x32')]=_0xe0e712[_0xc08c('0x32')][_0xc08c('0x34')]?_0xe0e712['attributes']:_0x51e801[_0xc08c('0x2d')];if(!_0x17a118[_0xc08c('0x2f')]['hasOwnProperty']('nolimit')){_0xe0e712['limit']=qs[_0xc08c('0x1e')](_0x17a118[_0xc08c('0x2f')][_0xc08c('0x1e')]);_0xe0e712[_0xc08c('0x1b')]=qs[_0xc08c('0x1b')](_0x17a118[_0xc08c('0x2f')][_0xc08c('0x1b')]);}_0xe0e712[_0xc08c('0x4c')]=qs[_0xc08c('0x37')](_0x17a118[_0xc08c('0x2f')][_0xc08c('0x37')]);_0xe0e712[_0xc08c('0x38')]=qs[_0xc08c('0x30')](_[_0xc08c('0x39')](_0x17a118['query'],_0x51e801[_0xc08c('0x30')]));_0xe0e712[_0xc08c('0x38')][_0xc08c('0x4d')]=_0x29deb2['id'];if(_0x17a118['query'][_0xc08c('0x3a')]){_0xe0e712['where']=_[_0xc08c('0x3b')](_0xe0e712[_0xc08c('0x38')],{'$or':_[_0xc08c('0x28')](_0xe0e712[_0xc08c('0x32')],function(_0x2042bb){var _0x152112={};_0x152112[_0x2042bb]={'$like':'%'+_0x17a118[_0xc08c('0x2f')][_0xc08c('0x3a')]+'%'};return _0x152112;})});}_0xe0e712=_[_0xc08c('0x3b')]({},_0xe0e712,_0x17a118[_0xc08c('0x3d')]);return db[_0xc08c('0x4b')][_0xc08c('0x1d')]({'where':_0xe0e712['where']})[_0xc08c('0x22')](function(_0x4c2da7){_0xd2dffa[_0xc08c('0x1d')]=_0x4c2da7;if(_0x17a118['query'][_0xc08c('0x3e')]){_0xe0e712[_0xc08c('0x44')]=[{'all':!![]}];}return db[_0xc08c('0x4b')][_0xc08c('0x4e')](_0xe0e712);})[_0xc08c('0x22')](function(_0x296960){_0xd2dffa['rows']=_0x296960;return _0xd2dffa;});}})['then'](respondWithFilteredResult(_0x1848c5,_0xe0e712))[_0xc08c('0x40')](handleError(_0x1848c5,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 0f1dbb5..10c87fa 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 _0xe2fe=['../../config/environment','exports','define','JscriptySessionReport','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','bluebird','./jscriptySessionReport.attributes','exports'];(function(_0x90753e,_0x1d1afb){var _0x464666=function(_0x344c39){while(--_0x344c39){_0x90753e['push'](_0x90753e['shift']());}};_0x464666(++_0x1d1afb);}(_0x4c60,0xc1));var _0x04c6=function(_0x42d882,_0x4a42cd){_0x42d882=_0x42d882-0x0;var _0x370fca=_0x4c60[_0x42d882];return _0x370fca;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('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 f054d58..474492b 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 _0x7a54=['info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x3fa61f,_0x1a5c92){_0x3fa61f=_0x3fa61f-0x0;var _0x29e071=_0x7a54[_0x3fa61f];return _0x29e071;};'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')]('JscriptySessionReport,\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 _0x2da6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2da6,0x1dd));var _0x62da=function(_0x4e5f1c,_0x4779fe){_0x4e5f1c=_0x4e5f1c-0x0;var _0x4d0538=_0x2da6[_0x4e5f1c];return _0x4d0538;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index f3c4c88..f9ea574 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 _0xa0a4=['get','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','connect-timeout','Router','fs-extra'];(function(_0x7b3fa8,_0x4fe314){var _0x227ec7=function(_0x35e995){while(--_0x35e995){_0x7b3fa8['push'](_0x7b3fa8['shift']());}};_0x227ec7(++_0x4fe314);}(_0xa0a4,0x1e0));var _0x4a0a=function(_0x53bc97,_0x9b5b9a){_0x53bc97=_0x53bc97-0x0;var _0x3cebb6=_0xa0a4[_0x53bc97];return _0x3cebb6;};'use strict';var multer=require(_0x4a0a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a0a('0x1'));var express=require('express');var router=express[_0x4a0a('0x2')]();var fs_extra=require(_0x4a0a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x4a0a('0x4')]('/',controller['index']);router['put'](_0x4a0a('0x5'),auth[_0x4a0a('0x6')](),controller[_0x4a0a('0x7')]);router[_0x4a0a('0x4')](_0x4a0a('0x8'),auth['isAuthenticated'](),controller[_0x4a0a('0x9')]);module[_0x4a0a('0xa')]=router; \ No newline at end of file +var _0x8d9b=['../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','update','downloadLogFile','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8d9b,0x1ae));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb8d9('0x0'));var util=require('util');var path=require(_0xb8d9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb8d9('0x2')]();var fs_extra=require(_0xb8d9('0x3'));var auth=require(_0xb8d9('0x4'));var interaction=require(_0xb8d9('0x5'));var config=require(_0xb8d9('0x6'));var controller=require(_0xb8d9('0x7'));router['get']('/',controller[_0xb8d9('0x8')]);router[_0xb8d9('0x9')](_0xb8d9('0xa'),auth[_0xb8d9('0xb')](),controller[_0xb8d9('0xc')]);router['get']('/download_log_file',auth[_0xb8d9('0xb')](),controller[_0xb8d9('0xd')]);module[_0xb8d9('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 ea7106b..5bf0190 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 _0xc028=['sequelize','TEXT','STRING'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xc028,0x7e));var _0x8c02=function(_0x440d31,_0x1bd6ee){_0x440d31=_0x440d31-0x0;var _0x19228c=_0xc028[_0x440d31];return _0x19228c;};'use strict';var Sequelize=require(_0x8c02('0x0'));module['exports']={'license':{'type':Sequelize[_0x8c02('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x8c02('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa3ad=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x2a6ae7,_0x499773){var _0x68c67b=function(_0xbaad78){while(--_0xbaad78){_0x2a6ae7['push'](_0x2a6ae7['shift']());}};_0x68c67b(++_0x499773);}(_0xa3ad,0x189));var _0xda3a=function(_0x15e83a,_0x4ac66f){_0x15e83a=_0x15e83a-0x0;var _0x4cc067=_0xa3ad[_0x15e83a];return _0x4cc067;};'use strict';var Sequelize=require(_0xda3a('0x0'));module[_0xda3a('0x1')]={'license':{'type':Sequelize[_0xda3a('0x2')]},'data1':{'type':Sequelize[_0xda3a('0x3')]},'data2':{'type':Sequelize[_0xda3a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xda3a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index c7a039f..57d41a3 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 _0x66c0=['log','attachment;\x20filename=','Content-Type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','../../config/license/util','index','keys','License','rawAttributes','query','filters','intersection','model','attributes','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','downloadLogFile','license-info.log','join','/var'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66c0,0x1e0));var _0x066c=function(_0x119450,_0x18fa03){_0x119450=_0x119450-0x0;var _0x47e807=_0x66c0[_0x119450];return _0x47e807;};'use strict';var emlformat=require(_0x066c('0x0'));var rimraf=require(_0x066c('0x1'));var zipdir=require(_0x066c('0x2'));var jsonpatch=require(_0x066c('0x3'));var rp=require(_0x066c('0x4'));var moment=require(_0x066c('0x5'));var BPromise=require(_0x066c('0x6'));var Mustache=require(_0x066c('0x7'));var util=require('util');var path=require(_0x066c('0x8'));var sox=require('sox');var csv=require(_0x066c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x066c('0xa'));var _=require(_0x066c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x066c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x066c('0xd'));var Redis=require(_0x066c('0xe'));var authService=require(_0x066c('0xf'));var qs=require(_0x066c('0x10'));var as=require(_0x066c('0x11'));var hardwareService=require(_0x066c('0x12'));var logger=require(_0x066c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x066c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2f9b,_0x2a0472){_0x2a0472=_0x2a0472||0xcc;return function(_0xac9c90){if(_0xac9c90){return _0x2e2f9b[_0x066c('0x15')](_0x2a0472);}return _0x2e2f9b[_0x066c('0x16')](_0x2a0472)['end']();};}function respondWithResult(_0x451615,_0x249d71){_0x249d71=_0x249d71||0xc8;return function(_0x35eef4){if(_0x35eef4){return _0x451615['status'](_0x249d71)['json'](_0x35eef4);}};}function respondWithFilteredResult(_0x8d5a12,_0x54b429){return function(_0x29b1c0){if(_0x29b1c0){var _0x25302c=typeof _0x54b429[_0x066c('0x17')]===_0x066c('0x18')&&typeof _0x54b429[_0x066c('0x19')]===_0x066c('0x18');var _0x5aef33=_0x29b1c0['count'];var _0x407e03=_0x25302c?0x0:_0x54b429[_0x066c('0x17')];var _0x371094=_0x25302c?_0x29b1c0[_0x066c('0x1a')]:_0x54b429[_0x066c('0x17')]+_0x54b429[_0x066c('0x19')];var _0x2d0d69;if(_0x371094>=_0x5aef33){_0x371094=_0x5aef33;_0x2d0d69=0xc8;}else{_0x2d0d69=0xce;}_0x8d5a12[_0x066c('0x16')](_0x2d0d69);return _0x8d5a12[_0x066c('0x1b')](_0x066c('0x1c'),_0x407e03+'-'+_0x371094+'/'+_0x5aef33)['json'](_0x29b1c0);}return null;};}function patchUpdates(_0x2210d2){return function(_0x1b50cd){try{jsonpatch[_0x066c('0x1d')](_0x1b50cd,_0x2210d2,!![]);}catch(_0x9d4c70){return BPromise[_0x066c('0x1e')](_0x9d4c70);}return _0x1b50cd[_0x066c('0x1f')]();};}function saveUpdates(_0x18afc8,_0x49d54b){return function(_0x4875e6){if(_0x4875e6){return _0x4875e6[_0x066c('0x20')](_0x18afc8)[_0x066c('0x21')](function(_0x48b6bf){return _0x48b6bf;});}return null;};}function removeEntity(_0x2c2a7c,_0xa069b8){return function(_0x732c77){if(_0x732c77){return _0x732c77['destroy']()['then'](function(){_0x2c2a7c[_0x066c('0x16')](0xcc)[_0x066c('0x22')]();});}};}function handleEntityNotFound(_0x23bc97,_0x12f4e4){return function(_0x994df1){if(!_0x994df1){_0x23bc97['sendStatus'](0x194);}return _0x994df1;};}function handleError(_0x2ae9f6,_0x5b9f04){_0x5b9f04=_0x5b9f04||0x1f4;return function(_0x18f36a){logger[_0x066c('0x23')](_0x18f36a[_0x066c('0x24')]);if(_0x18f36a[_0x066c('0x25')]){delete _0x18f36a['name'];}_0x2ae9f6[_0x066c('0x16')](_0x5b9f04)[_0x066c('0x26')](_0x18f36a);};}var utilLicense=require(_0x066c('0x27'));exports[_0x066c('0x28')]=function(_0x5879a0,_0xf3c88){var _0x26b6c5={'raw':!![],'where':{'id':0x1}},_0x5eea3c={};_0x5eea3c['model']=_[_0x066c('0x29')](db[_0x066c('0x2a')][_0x066c('0x2b')]);_0x5eea3c[_0x066c('0x2c')]=_[_0x066c('0x29')](_0x5879a0[_0x066c('0x2c')]);_0x5eea3c[_0x066c('0x2d')]=_[_0x066c('0x2e')](_0x5eea3c[_0x066c('0x2f')],_0x5eea3c[_0x066c('0x2c')]);_0x26b6c5[_0x066c('0x30')]=_['intersection'](_0x5eea3c[_0x066c('0x2f')],qs['fields'](_0x5879a0[_0x066c('0x2c')]['fields']));_0x26b6c5[_0x066c('0x30')]=_0x26b6c5[_0x066c('0x30')][_0x066c('0x31')]?_0x26b6c5[_0x066c('0x30')]:_0x5eea3c[_0x066c('0x2f')];_0x26b6c5=_[_0x066c('0x32')]({},_0x26b6c5,_0x5879a0[_0x066c('0x33')]);return utilLicense[_0x066c('0x34')](_0x26b6c5)['then'](respondWithResult(_0xf3c88,null))[_0x066c('0x35')](handleError(_0xf3c88,null));};exports[_0x066c('0x20')]=function(_0x251f02,_0x16853f){if(_0x251f02[_0x066c('0x36')]['id']){delete _0x251f02[_0x066c('0x36')]['id'];}return db[_0x066c('0x2a')][_0x066c('0x37')]({'where':{'id':_0x251f02[_0x066c('0x38')]['id']}})[_0x066c('0x21')](handleEntityNotFound(_0x16853f,null))['then'](function(_0x8638ff){var _0x661d82=_0x8638ff[_0x066c('0x39')]({'plain':!![]});return utilLicense[_0x066c('0x3a')](_0x661d82,_0x251f02[_0x066c('0x36')][_0x066c('0x3b')]);})['then'](function(_0x3511ff){if(!_0x3511ff['demo']){return saveUpdates(_0x251f02[_0x066c('0x36')],null);}return _0x3511ff;})['then'](respondWithResult(_0x16853f,null))[_0x066c('0x35')](handleError(_0x16853f,null));};exports[_0x066c('0x3c')]=function(_0x54e893,_0x23fbb3){var _0x391cd3=_0x066c('0x3d');var _0x3fe9dd=path[_0x066c('0x3e')](_0x066c('0x3f'),_0x066c('0x40'),'xcally',_0x391cd3);_0x23fbb3['setHeader']('Content-disposition',_0x066c('0x41')+_0x391cd3);_0x23fbb3[_0x066c('0x1b')](_0x066c('0x42'),'text/plain');_0x23fbb3[_0x066c('0x43')](_0x3fe9dd);}; \ No newline at end of file +var _0x0d70=['catch','body','params','checkLicense','key','demo','license-info.log','join','/var','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','keys','License','rawAttributes','query','filters','intersection','attributes','model','fields','length','options','getLicense'];(function(_0x492740,_0x33e010){var _0x333534=function(_0x5abcd8){while(--_0x5abcd8){_0x492740['push'](_0x492740['shift']());}};_0x333534(++_0x33e010);}(_0x0d70,0x98));var _0x00d7=function(_0xce0b84,_0x2b7229){_0xce0b84=_0xce0b84-0x0;var _0x2267ef=_0x0d70[_0xce0b84];return _0x2267ef;};'use strict';var emlformat=require(_0x00d7('0x0'));var rimraf=require(_0x00d7('0x1'));var zipdir=require(_0x00d7('0x2'));var jsonpatch=require(_0x00d7('0x3'));var rp=require(_0x00d7('0x4'));var moment=require(_0x00d7('0x5'));var BPromise=require(_0x00d7('0x6'));var Mustache=require(_0x00d7('0x7'));var util=require('util');var path=require(_0x00d7('0x8'));var sox=require('sox');var csv=require(_0x00d7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00d7('0xa'));var _=require(_0x00d7('0xb'));var squel=require('squel');var crypto=require(_0x00d7('0xc'));var jsforce=require(_0x00d7('0xd'));var deskjs=require(_0x00d7('0xe'));var toCsv=require(_0x00d7('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x00d7('0xf'));var authService=require(_0x00d7('0x10'));var qs=require(_0x00d7('0x11'));var as=require(_0x00d7('0x12'));var hardwareService=require(_0x00d7('0x13'));var logger=require('../../config/logger')(_0x00d7('0x14'));var utils=require('../../config/utils');var config=require(_0x00d7('0x15'));var licenseUtil=require(_0x00d7('0x16'));var db=require(_0x00d7('0x17'))['db'];function respondWithStatusCode(_0x4396d7,_0xbd224f){_0xbd224f=_0xbd224f||0xcc;return function(_0x4f13a8){if(_0x4f13a8){return _0x4396d7[_0x00d7('0x18')](_0xbd224f);}return _0x4396d7['status'](_0xbd224f)[_0x00d7('0x19')]();};}function respondWithResult(_0x4320b2,_0x34cd11){_0x34cd11=_0x34cd11||0xc8;return function(_0x5ebdab){if(_0x5ebdab){return _0x4320b2[_0x00d7('0x1a')](_0x34cd11)[_0x00d7('0x1b')](_0x5ebdab);}};}function respondWithFilteredResult(_0x14b5db,_0x53eaa5){return function(_0xbba26b){if(_0xbba26b){var _0x2e8879=typeof _0x53eaa5[_0x00d7('0x1c')]===_0x00d7('0x1d')&&typeof _0x53eaa5[_0x00d7('0x1e')]===_0x00d7('0x1d');var _0x13a4e9=_0xbba26b[_0x00d7('0x1f')];var _0x127992=_0x2e8879?0x0:_0x53eaa5[_0x00d7('0x1c')];var _0xf09c45=_0x2e8879?_0xbba26b[_0x00d7('0x1f')]:_0x53eaa5[_0x00d7('0x1c')]+_0x53eaa5[_0x00d7('0x1e')];var _0x17e720;if(_0xf09c45>=_0x13a4e9){_0xf09c45=_0x13a4e9;_0x17e720=0xc8;}else{_0x17e720=0xce;}_0x14b5db[_0x00d7('0x1a')](_0x17e720);return _0x14b5db[_0x00d7('0x20')](_0x00d7('0x21'),_0x127992+'-'+_0xf09c45+'/'+_0x13a4e9)[_0x00d7('0x1b')](_0xbba26b);}return null;};}function patchUpdates(_0xd8d0ac){return function(_0x22ce98){try{jsonpatch[_0x00d7('0x22')](_0x22ce98,_0xd8d0ac,!![]);}catch(_0x251f2c){return BPromise[_0x00d7('0x23')](_0x251f2c);}return _0x22ce98[_0x00d7('0x24')]();};}function saveUpdates(_0x5eaeca,_0x1cffe1){return function(_0x26aa82){if(_0x26aa82){return _0x26aa82[_0x00d7('0x25')](_0x5eaeca)[_0x00d7('0x26')](function(_0x32bdb8){return _0x32bdb8;});}return null;};}function removeEntity(_0x438ec8,_0x278f35){return function(_0x401a58){if(_0x401a58){return _0x401a58[_0x00d7('0x27')]()['then'](function(){_0x438ec8[_0x00d7('0x1a')](0xcc)[_0x00d7('0x19')]();});}};}function handleEntityNotFound(_0x242df9,_0x4a8a32){return function(_0x4c084a){if(!_0x4c084a){_0x242df9[_0x00d7('0x18')](0x194);}return _0x4c084a;};}function handleError(_0x133dc3,_0x3b5dca){_0x3b5dca=_0x3b5dca||0x1f4;return function(_0x19e032){logger[_0x00d7('0x28')](_0x19e032['stack']);if(_0x19e032['name']){delete _0x19e032['name'];}_0x133dc3[_0x00d7('0x1a')](_0x3b5dca)[_0x00d7('0x29')](_0x19e032);};}var utilLicense=require(_0x00d7('0x16'));exports[_0x00d7('0x2a')]=function(_0x3a79a3,_0x12d1c2){var _0x290fab={'raw':!![],'where':{'id':0x1}},_0x289837={};_0x289837['model']=_[_0x00d7('0x2b')](db[_0x00d7('0x2c')][_0x00d7('0x2d')]);_0x289837[_0x00d7('0x2e')]=_[_0x00d7('0x2b')](_0x3a79a3[_0x00d7('0x2e')]);_0x289837[_0x00d7('0x2f')]=_[_0x00d7('0x30')](_0x289837['model'],_0x289837['query']);_0x290fab[_0x00d7('0x31')]=_[_0x00d7('0x30')](_0x289837[_0x00d7('0x32')],qs[_0x00d7('0x33')](_0x3a79a3[_0x00d7('0x2e')][_0x00d7('0x33')]));_0x290fab[_0x00d7('0x31')]=_0x290fab[_0x00d7('0x31')][_0x00d7('0x34')]?_0x290fab[_0x00d7('0x31')]:_0x289837[_0x00d7('0x32')];_0x290fab=_['merge']({},_0x290fab,_0x3a79a3[_0x00d7('0x35')]);return utilLicense[_0x00d7('0x36')](_0x290fab)[_0x00d7('0x26')](respondWithResult(_0x12d1c2,null))[_0x00d7('0x37')](handleError(_0x12d1c2,null));};exports[_0x00d7('0x25')]=function(_0x303484,_0x4e2283){if(_0x303484[_0x00d7('0x38')]['id']){delete _0x303484[_0x00d7('0x38')]['id'];}return db[_0x00d7('0x2c')]['find']({'where':{'id':_0x303484[_0x00d7('0x39')]['id']}})[_0x00d7('0x26')](handleEntityNotFound(_0x4e2283,null))['then'](function(_0x330d97){var _0x1d8c8f=_0x330d97['get']({'plain':!![]});return utilLicense[_0x00d7('0x3a')](_0x1d8c8f,_0x303484[_0x00d7('0x38')][_0x00d7('0x3b')]);})[_0x00d7('0x26')](function(_0x382767){if(!_0x382767[_0x00d7('0x3c')]){return saveUpdates(_0x303484[_0x00d7('0x38')],null);}return _0x382767;})[_0x00d7('0x26')](respondWithResult(_0x4e2283,null))[_0x00d7('0x37')](handleError(_0x4e2283,null));};exports['downloadLogFile']=function(_0x22c400,_0x273f51){var _0x4f473c=_0x00d7('0x3d');var _0x5d85ef=path[_0x00d7('0x3e')](_0x00d7('0x3f'),'log',_0x00d7('0x40'),_0x4f473c);_0x273f51[_0x00d7('0x41')]('Content-disposition',_0x00d7('0x42')+_0x4f473c);_0x273f51[_0x00d7('0x20')](_0x00d7('0x43'),_0x00d7('0x44'));_0x273f51['download'](_0x5d85ef);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 547f28a..6200bb8 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 _0xf2aa=['bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger','moment'];(function(_0x26d7a4,_0x16a51b){var _0x10cd75=function(_0x4c4d19){while(--_0x4c4d19){_0x26d7a4['push'](_0x26d7a4['shift']());}};_0x10cd75(++_0x16a51b);}(_0xf2aa,0x129));var _0xaf2a=function(_0x4d71b0,_0x1720a8){_0x4d71b0=_0x4d71b0-0x0;var _0x507cd7=_0xf2aa[_0x4d71b0];return _0x507cd7;};'use strict';var _=require(_0xaf2a('0x0'));var util=require('util');var logger=require(_0xaf2a('0x1'))('api');var moment=require(_0xaf2a('0x2'));var BPromise=require(_0xaf2a('0x3'));var rp=require(_0xaf2a('0x4'));var fs=require('fs');var path=require(_0xaf2a('0x5'));var rimraf=require('rimraf');var config=require(_0xaf2a('0x6'));var attributes=require(_0xaf2a('0x7'));module[_0xaf2a('0x8')]=function(_0x129eca,_0xc8bf4d){return _0x129eca[_0xaf2a('0x9')](_0xaf2a('0xa'),attributes,{'tableName':_0xaf2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8707=['rimraf','./license.attributes','exports','define','../../config/logger','request-promise','path'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0x8707,0xdd));var _0x7870=function(_0x5af1b0,_0x25aacf){_0x5af1b0=_0x5af1b0-0x0;var _0x265bf7=_0x8707[_0x5af1b0];return _0x265bf7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7870('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7870('0x1'));var fs=require('fs');var path=require(_0x7870('0x2'));var rimraf=require(_0x7870('0x3'));var config=require('../../config/environment');var attributes=require(_0x7870('0x4'));module[_0x7870('0x5')]=function(_0x31e177,_0x1432e8){return _0x31e177[_0x7870('0x6')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index f7d3904..e3ceecc 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 _0xd69a=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x437317,_0x165fe8){var _0x3967eb=function(_0x4c1922){while(--_0x4c1922){_0x437317['push'](_0x437317['shift']());}};_0x3967eb(++_0x165fe8);}(_0xd69a,0x10a));var _0xad69=function(_0xf51aec,_0x422c7b){_0xf51aec=_0xf51aec-0x0;var _0x2e3180=_0xd69a[_0xf51aec];return _0x2e3180;};'use strict';var _=require(_0xad69('0x0'));var util=require(_0xad69('0x1'));var moment=require(_0xad69('0x2'));var BPromise=require(_0xad69('0x3'));var rs=require(_0xad69('0x4'));var fs=require('fs');var Redis=require(_0xad69('0x5'));var db=require(_0xad69('0x6'))['db'];var utils=require(_0xad69('0x7'));var logger=require(_0xad69('0x8'))(_0xad69('0x9'));var config=require(_0xad69('0xa'));var jayson=require(_0xad69('0xb'));var client=jayson[_0xad69('0xc')][_0xad69('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x14c778,_0x498209,_0x298de4){return new BPromise(function(_0x164160,_0x46e726){return client[_0xad69('0xe')](_0x14c778,_0x298de4)[_0xad69('0xf')](function(_0x29b670){logger['info'](_0xad69('0x10'),_0x498209,_0xad69('0x11'));logger['debug'](_0xad69('0x12'),_0x498209,_0xad69('0x11'),JSON[_0xad69('0x13')](_0x29b670));if(_0x29b670[_0xad69('0x14')]){if(_0x29b670[_0xad69('0x14')]['code']===0x1f4){logger[_0xad69('0x14')](_0xad69('0x10'),_0x498209,_0x29b670['error'][_0xad69('0x15')]);return _0x46e726(_0x29b670[_0xad69('0x14')][_0xad69('0x15')]);}logger[_0xad69('0x14')]('License,\x20%s,\x20%s',_0x498209,_0x29b670[_0xad69('0x14')][_0xad69('0x15')]);return _0x164160(_0x29b670[_0xad69('0x14')][_0xad69('0x15')]);}else{logger[_0xad69('0x16')](_0xad69('0x10'),_0x498209,_0xad69('0x11'));_0x164160(_0x29b670[_0xad69('0x17')][_0xad69('0x15')]);}})['catch'](function(_0x30dd4d){logger[_0xad69('0x14')](_0xad69('0x10'),_0x498209,_0x30dd4d);_0x46e726(_0x30dd4d);});});} \ No newline at end of file +var _0x4671=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0xa8d427,_0x5afb5b){var _0x5a0ef7=function(_0xb56427){while(--_0xb56427){_0xa8d427['push'](_0xa8d427['shift']());}};_0x5a0ef7(++_0x5afb5b);}(_0x4671,0x1a7));var _0x1467=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4671[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1467('0x0'));var util=require(_0x1467('0x1'));var moment=require(_0x1467('0x2'));var BPromise=require(_0x1467('0x3'));var rs=require(_0x1467('0x4'));var fs=require('fs');var Redis=require(_0x1467('0x5'));var db=require(_0x1467('0x6'))['db'];var utils=require(_0x1467('0x7'));var logger=require(_0x1467('0x8'))('rpc');var config=require(_0x1467('0x9'));var jayson=require(_0x1467('0xa'));var client=jayson[_0x1467('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dad47,_0xa9c830,_0x220756){return new BPromise(function(_0x453c72,_0x452f82){return client[_0x1467('0xc')](_0x1dad47,_0x220756)[_0x1467('0xd')](function(_0x10f2d7){logger[_0x1467('0xe')](_0x1467('0xf'),_0xa9c830,_0x1467('0x10'));logger[_0x1467('0x11')](_0x1467('0x12'),_0xa9c830,_0x1467('0x10'),JSON['stringify'](_0x10f2d7));if(_0x10f2d7[_0x1467('0x13')]){if(_0x10f2d7[_0x1467('0x13')]['code']===0x1f4){logger['error'](_0x1467('0xf'),_0xa9c830,_0x10f2d7[_0x1467('0x13')][_0x1467('0x14')]);return _0x452f82(_0x10f2d7['error'][_0x1467('0x14')]);}logger[_0x1467('0x13')](_0x1467('0xf'),_0xa9c830,_0x10f2d7[_0x1467('0x13')]['message']);return _0x453c72(_0x10f2d7[_0x1467('0x13')][_0x1467('0x14')]);}else{logger[_0x1467('0xe')]('License,\x20%s,\x20%s',_0xa9c830,'request\x20sent');_0x453c72(_0x10f2d7[_0x1467('0x15')][_0x1467('0x14')]);}})[_0x1467('0x16')](function(_0x189ff2){logger['error'](_0x1467('0xf'),_0xa9c830,_0x189ff2);_0x452f82(_0x189ff2);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 05d3a2b..4a96127 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 _0x75b4=['../../components/interaction/service','./mailAccount.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addInteraction','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x5fe69a,_0x5484f5){var _0x3f1aee=function(_0x54387f){while(--_0x54387f){_0x5fe69a['push'](_0x5fe69a['shift']());}};_0x3f1aee(++_0x5484f5);}(_0x75b4,0x115));var _0x475b=function(_0x4306df,_0x4bc27d){_0x4306df=_0x4306df-0x0;var _0x222af8=_0x75b4[_0x4306df];return _0x222af8;};'use strict';var multer=require(_0x475b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x475b('0x1'));var express=require(_0x475b('0x2'));var router=express[_0x475b('0x3')]();var fs_extra=require(_0x475b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x475b('0x5'));var config=require('../../config/environment');var controller=require(_0x475b('0x6'));router[_0x475b('0x7')]('/',auth['isAuthenticated'](),controller[_0x475b('0x8')]);router[_0x475b('0x7')](_0x475b('0x9'),auth['isAuthenticated'](),controller[_0x475b('0xa')]);router[_0x475b('0x7')](_0x475b('0xb'),auth[_0x475b('0xc')](),controller['show']);router['get'](_0x475b('0xd'),auth['isAuthenticated'](),controller[_0x475b('0xe')]);router[_0x475b('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x475b('0xf')]);router[_0x475b('0x7')](_0x475b('0x10'),auth['isAuthenticated'](),controller[_0x475b('0x11')]);router[_0x475b('0x7')](_0x475b('0x12'),auth[_0x475b('0xc')](),controller[_0x475b('0x13')]);router[_0x475b('0x7')](_0x475b('0x14'),auth['isAuthenticated'](),controller[_0x475b('0x15')]);router[_0x475b('0x7')](_0x475b('0x16'),auth['isAuthenticated'](),controller['getApplications']);router[_0x475b('0x7')]('/:id/messages',auth[_0x475b('0xc')](),controller[_0x475b('0x17')]);router['get']('/:id/verify',auth[_0x475b('0xc')](),controller[_0x475b('0x18')]);router[_0x475b('0x7')](_0x475b('0x19'),auth['isAuthenticated'](),controller[_0x475b('0x1a')]);router[_0x475b('0x1b')](_0x475b('0xd'),auth[_0x475b('0xc')](),controller[_0x475b('0x1c')]);router[_0x475b('0x1b')](_0x475b('0x1d'),auth['isAuthenticated'](),controller[_0x475b('0x1e')]);router[_0x475b('0x1b')]('/',auth[_0x475b('0xc')](),controller[_0x475b('0x1f')]);router[_0x475b('0x1b')](_0x475b('0x10'),auth['isAuthenticated'](),controller['addImap']);router[_0x475b('0x1b')](_0x475b('0x12'),auth[_0x475b('0xc')](),controller['addSmtp']);router[_0x475b('0x1b')](_0x475b('0x14'),auth['isAuthenticated'](),controller[_0x475b('0x20')]);router['post'](_0x475b('0x16'),auth[_0x475b('0xc')](),controller[_0x475b('0x21')]);router[_0x475b('0x1b')](_0x475b('0x22'),auth[_0x475b('0xc')](),controller[_0x475b('0x23')]);router[_0x475b('0x1b')](_0x475b('0x19'),auth['isAuthenticated'](),controller[_0x475b('0x24')]);router[_0x475b('0x25')](_0x475b('0xb'),auth[_0x475b('0xc')](),controller[_0x475b('0x26')]);router['delete']('/:id/dispositions',auth[_0x475b('0xc')](),controller[_0x475b('0x27')]);router[_0x475b('0x28')](_0x475b('0x1d'),auth['isAuthenticated'](),controller[_0x475b('0x29')]);router[_0x475b('0x28')](_0x475b('0x10'),auth[_0x475b('0xc')](),controller[_0x475b('0x2a')]);router['delete'](_0x475b('0x12'),auth[_0x475b('0xc')](),controller[_0x475b('0x2b')]);router[_0x475b('0x28')]('/:id',auth[_0x475b('0xc')](),controller[_0x475b('0x2c')]);router['delete'](_0x475b('0x19'),auth['isAuthenticated'](),controller[_0x475b('0x2d')]);module[_0x475b('0x2e')]=router; \ No newline at end of file +var _0xa388=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addInteraction','/:id/applications','addApplications','send','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','/:id','removeAgents','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa388,0x155));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8a38('0x0'));var path=require(_0x8a38('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a38('0x2')]();var fs_extra=require(_0x8a38('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8a38('0x4'));var config=require(_0x8a38('0x5'));var controller=require(_0x8a38('0x6'));router[_0x8a38('0x7')]('/',auth[_0x8a38('0x8')](),controller[_0x8a38('0x9')]);router[_0x8a38('0x7')](_0x8a38('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x8a38('0x8')](),controller[_0x8a38('0xb')]);router[_0x8a38('0x7')](_0x8a38('0xc'),auth['isAuthenticated'](),controller[_0x8a38('0xd')]);router['get'](_0x8a38('0xe'),auth[_0x8a38('0x8')](),controller[_0x8a38('0xf')]);router[_0x8a38('0x7')]('/:id/in_servers',auth[_0x8a38('0x8')](),controller[_0x8a38('0x10')]);router[_0x8a38('0x7')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x8a38('0x11')]);router['get'](_0x8a38('0x12'),auth[_0x8a38('0x8')](),controller['getInteractions']);router['get']('/:id/applications',auth[_0x8a38('0x8')](),controller[_0x8a38('0x13')]);router['get'](_0x8a38('0x14'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x15')]);router['get'](_0x8a38('0x16'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x17')]);router[_0x8a38('0x7')](_0x8a38('0x18'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x19')]);router[_0x8a38('0x1a')]('/:id/dispositions',auth[_0x8a38('0x8')](),controller[_0x8a38('0x1b')]);router[_0x8a38('0x1a')](_0x8a38('0xe'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x1c')]);router[_0x8a38('0x1a')]('/',auth[_0x8a38('0x8')](),controller[_0x8a38('0x1d')]);router[_0x8a38('0x1a')](_0x8a38('0x1e'),auth[_0x8a38('0x8')](),controller['addImap']);router[_0x8a38('0x1a')]('/:id/out_servers',auth[_0x8a38('0x8')](),controller['addSmtp']);router[_0x8a38('0x1a')](_0x8a38('0x12'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x1f')]);router['post'](_0x8a38('0x20'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x21')]);router[_0x8a38('0x1a')]('/:id/send',auth['isAuthenticated'](),controller[_0x8a38('0x22')]);router['post'](_0x8a38('0x18'),auth[_0x8a38('0x8')](),controller['addAgents']);router[_0x8a38('0x23')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8a38('0x24')]('/:id/dispositions',auth[_0x8a38('0x8')](),controller[_0x8a38('0x25')]);router[_0x8a38('0x24')](_0x8a38('0xe'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x26')]);router['delete']('/:id/in_servers',auth[_0x8a38('0x8')](),controller[_0x8a38('0x27')]);router[_0x8a38('0x24')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x8a38('0x28')]);router[_0x8a38('0x24')](_0x8a38('0x29'),auth[_0x8a38('0x8')](),controller['destroy']);router[_0x8a38('0x24')](_0x8a38('0x18'),auth[_0x8a38('0x8')](),controller[_0x8a38('0x2a')]);module[_0x8a38('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 6a01d58..d7a4c17 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 _0x1122=['mandatoryDisposition','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x6dc380,_0x27d1de){var _0x33e745=function(_0xef1eb9){while(--_0xef1eb9){_0x6dc380['push'](_0x6dc380['shift']());}};_0x33e745(++_0x27d1de);}(_0x1122,0x1bf));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2112('0x0'));module[_0x2112('0x1')]={'description':{'type':Sequelize[_0x2112('0x2')]},'name':{'type':Sequelize[_0x2112('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x2112('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2112('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2112('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x2112('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x2112('0x4')]},'markAsUnread':{'type':Sequelize[_0x2112('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2112('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x2112('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2112('0x4')],'defaultValue':function(){return _0x2112('0x7');}},'notificationSound':{'type':Sequelize[_0x2112('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2112('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2112('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2112('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2112('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2112('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2112('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2112('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2112('0xa'),'set':function(_0x1cf385){if(!_0x1cf385)this[_0x2112('0xb')](_0x2112('0xc'),null);this[_0x2112('0xb')](_0x2112('0xd'),_0x1cf385);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x2112('0xe'),_0x2112('0xf'),_0x2112('0x10')),'defaultValue':null,'get':function(){if(!this[_0x2112('0x11')](_0x2112('0x12')))return _0x2112('0x13');return this['getDataValue'](_0x2112('0x12'));},'set':function(_0x109e6b){if(_0x109e6b===_0x2112('0x13'))_0x109e6b=null;return this[_0x2112('0xb')](_0x2112('0x12'),_0x109e6b);}}}; \ No newline at end of file +var _0x7d76=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x39a7bb,_0x3616b6){var _0x2e1027=function(_0x530bd7){while(--_0x530bd7){_0x39a7bb['push'](_0x39a7bb['shift']());}};_0x2e1027(++_0x3616b6);}(_0x7d76,0x113));var _0x67d7=function(_0x1e438b,_0x245fd8){_0x1e438b=_0x1e438b-0x0;var _0x5023a7=_0x7d76[_0x1e438b];return _0x5023a7;};'use strict';var Sequelize=require(_0x67d7('0x0'));module[_0x67d7('0x1')]={'description':{'type':Sequelize[_0x67d7('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x67d7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x67d7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x67d7('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x67d7('0x4')]},'markAsUnread':{'type':Sequelize[_0x67d7('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x67d7('0x2')],'allowNull':![],'defaultValue':_0x67d7('0x5')},'fontSize':{'type':Sequelize[_0x67d7('0x6')](0x2)[_0x67d7('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x67d7('0x4')],'defaultValue':function(){return _0x67d7('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x67d7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x67d7('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x67d7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x67d7('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x67d7('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x67d7('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x67d7('0x3')],'defaultValue':![],'comment':_0x67d7('0xa'),'set':function(_0x3fab70){if(!_0x3fab70)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x67d7('0xb')](_0x67d7('0xc'),_0x3fab70);}},'provider':{'type':Sequelize[_0x67d7('0xd')](_0x67d7('0xe'),_0x67d7('0xf'),_0x67d7('0x10'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x67d7('0x11')](_0x67d7('0x12')))return _0x67d7('0x13');return this['getDataValue']('provider');},'set':function(_0x4991bf){if(_0x4991bf===_0x67d7('0x13'))_0x4991bf=null;return this[_0x67d7('0xb')](_0x67d7('0x12'),_0x4991bf);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 7979250..9ec2c4c 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 _0xb8a3=['addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','true','split','CmList','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','basename','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','client','request','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','pass','password','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','length','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp'];(function(_0x2f8349,_0xc39962){var _0x2bac05=function(_0x573e1f){while(--_0x573e1f){_0x2f8349['push'](_0x2f8349['shift']());}};_0x2bac05(++_0xc39962);}(_0xb8a3,0x101));var _0x3b8a=function(_0x544391,_0x1e996c){_0x544391=_0x544391-0x0;var _0x506b00=_0xb8a3[_0x544391];return _0x506b00;};'use strict';var moment=require(_0x3b8a('0x0'));var BPromise=require('bluebird');var util=require(_0x3b8a('0x1'));var path=require(_0x3b8a('0x2'));var _=require(_0x3b8a('0x3'));var juice=require(_0x3b8a('0x4'));var Redis=require(_0x3b8a('0x5'));var qs=require(_0x3b8a('0x6'));var logger=require(_0x3b8a('0x7'))(_0x3b8a('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3b8a('0x9')]=_[_0x3b8a('0xa')](config['redis'],{'host':_0x3b8a('0xb'),'port':0x18eb});var socket=require(_0x3b8a('0xc'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x3b8a('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3b8a('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x1c507f,_0xa9bf6b,_0x5dc977,_0x3d05fd){return new BPromise(function(_0x5580c8,_0x2497f3){var _0x35bcbb=_0x3d05fd||client;return _0x35bcbb[_0x3b8a('0xf')](_0x1c507f,_0x5dc977)['then'](function(_0x2f4ca5){logger[_0x3b8a('0x10')](_0x3b8a('0x11'),_0xa9bf6b,'request\x20sent');logger['debug'](_0x3b8a('0x12'),_0xa9bf6b,_0x3b8a('0x13'),JSON[_0x3b8a('0x14')](_0x2f4ca5));if(_0x2f4ca5[_0x3b8a('0x15')]){if(_0x2f4ca5[_0x3b8a('0x15')][_0x3b8a('0x16')]===0x1f4){logger['error'](_0x3b8a('0x11'),_0xa9bf6b,_0x2f4ca5[_0x3b8a('0x15')]['message']);return _0x2497f3(_0x2f4ca5['error'][_0x3b8a('0x17')]);}logger[_0x3b8a('0x15')](_0x3b8a('0x11'),_0xa9bf6b,_0x2f4ca5[_0x3b8a('0x15')][_0x3b8a('0x17')]);return _0x5580c8(_0x2f4ca5['error'][_0x3b8a('0x17')]);}else{logger[_0x3b8a('0x10')]('MailAccount,\x20%s,\x20%s',_0xa9bf6b,'request\x20sent');_0x5580c8(_0x2f4ca5['result'][_0x3b8a('0x17')]);}})[_0x3b8a('0x18')](function(_0x155a96){logger['error'](_0x3b8a('0x11'),_0xa9bf6b,_0x155a96);_0x2497f3(_0x155a96);});});}function respondWithStatusCode(_0x58fa23,_0x14ef85){_0x14ef85=_0x14ef85||0xcc;return function(_0x1fa55f){if(_0x1fa55f){return _0x58fa23[_0x3b8a('0x19')](_0x14ef85);}return _0x58fa23['status'](_0x14ef85)[_0x3b8a('0x1a')]();};}function respondWithResult(_0xfed646,_0x1eed91){_0x1eed91=_0x1eed91||0xc8;return function(_0x57c648){if(_0x57c648){return _0xfed646[_0x3b8a('0x1b')](_0x1eed91)[_0x3b8a('0x1c')](_0x57c648);}};}function respondWithFilteredResult(_0x1909cc,_0x5dee99){return function(_0x19299b){if(_0x19299b){var _0x72e059=typeof _0x5dee99[_0x3b8a('0x1d')]===_0x3b8a('0x1e')&&typeof _0x5dee99[_0x3b8a('0x1f')]===_0x3b8a('0x1e');var _0x38a55c=_0x19299b[_0x3b8a('0x20')];var _0x219fd2=_0x72e059?0x0:_0x5dee99[_0x3b8a('0x1d')];var _0x52de5b=_0x72e059?_0x19299b[_0x3b8a('0x20')]:_0x5dee99[_0x3b8a('0x1d')]+_0x5dee99[_0x3b8a('0x1f')];var _0x228e81;if(_0x52de5b>=_0x38a55c){_0x52de5b=_0x38a55c;_0x228e81=0xc8;}else{_0x228e81=0xce;}_0x1909cc[_0x3b8a('0x1b')](_0x228e81);return _0x1909cc[_0x3b8a('0x21')]('Content-Range',_0x219fd2+'-'+_0x52de5b+'/'+_0x38a55c)[_0x3b8a('0x1c')](_0x19299b);}return null;};}function saveUpdates(_0x55e31e){return function(_0x209fb8){if(_0x209fb8){return _0x209fb8[_0x3b8a('0x22')](_0x55e31e)[_0x3b8a('0x23')](function(_0x3c86c9){return _0x3c86c9;});}return null;};}function removeEntity(_0x115ba1){return function(_0x2c58fc){if(_0x2c58fc){return _0x2c58fc[_0x3b8a('0x24')]()['then'](function(){var _0x5eac5d=_0x2c58fc[_0x3b8a('0x25')]({'plain':!![]});var _0x2e78db=_0x3b8a('0x26');return db[_0x3b8a('0x27')][_0x3b8a('0x24')]({'where':{'type':_0x2e78db,'resourceId':_0x5eac5d['id']}})['then'](function(){return _0x2c58fc;});})[_0x3b8a('0x23')](function(){_0x115ba1[_0x3b8a('0x1b')](0xcc)[_0x3b8a('0x1a')]();});}};}function handleEntityNotFound(_0x29eeae){return function(_0x2ebfa6){if(!_0x2ebfa6){_0x29eeae['sendStatus'](0x194);}return _0x2ebfa6;};}function handleError(_0x3410bc,_0x401ce3){_0x401ce3=_0x401ce3||0x1f4;return function(_0x4374d7){logger['error'](_0x4374d7[_0x3b8a('0x28')]);if(_0x4374d7[_0x3b8a('0x29')]){delete _0x4374d7['name'];}_0x3410bc['status'](_0x401ce3)[_0x3b8a('0x2a')](_0x4374d7);};}function getImapHost(_0x3a1464){switch(_0x3a1464){case _0x3b8a('0x2b'):return _0x3b8a('0x2c');case _0x3b8a('0x2d'):return _0x3b8a('0x2e');case'hotmail':return _0x3b8a('0x2f');case _0x3b8a('0x30'):return'outlook.office365.com';}throw new Error(_0x3b8a('0x31'),_0x3a1464);}function getSmtpHost(_0x3056d5){switch(_0x3056d5){case _0x3b8a('0x2b'):return'smtp.gmail.com';case _0x3b8a('0x2d'):return _0x3b8a('0x32');case'hotmail':return _0x3b8a('0x33');case _0x3b8a('0x30'):return'smtp.office365.com';}throw new Error(_0x3b8a('0x31'),_0x3056d5);}function getAuthenticationOptions(_0x3337df,_0x4f71f3){var _0x68de62={};var _0x290e89={};if(_0x3337df){_0x68de62['user']=_0x290e89[_0x3b8a('0x34')]=_0x4f71f3['username'];_0x68de62['password']=_0x290e89[_0x3b8a('0x35')]=_0x4f71f3[_0x3b8a('0x36')];if(_0x4f71f3['modernAuthentication']){_0x68de62[_0x3b8a('0x37')]=_0x290e89[_0x3b8a('0x37')]=!![];_0x68de62[_0x3b8a('0x38')]=_0x290e89[_0x3b8a('0x38')]=_0x4f71f3['CloudProviderId'];_0x68de62['password']=_0x290e89[_0x3b8a('0x35')]=null;}else{_0x68de62[_0x3b8a('0x38')]=_0x290e89[_0x3b8a('0x38')]=null;}_0x68de62['host']=getImapHost(_0x3337df);_0x68de62[_0x3b8a('0x39')]=0x3e1;_0x290e89[_0x3b8a('0x3a')]=getSmtpHost(_0x3337df);_0x290e89['port']=0x24b;_0x290e89[_0x3b8a('0x3b')]=![];_0x68de62[_0x3b8a('0x3c')]=_0x290e89[_0x3b8a('0x3c')]=null;}else{if(_0x4f71f3['authentication']){_0x68de62['user']=_0x290e89[_0x3b8a('0x34')]=_0x4f71f3['username'];_0x68de62[_0x3b8a('0x36')]=_0x290e89[_0x3b8a('0x35')]=_0x4f71f3[_0x3b8a('0x36')];}else{_0x68de62[_0x3b8a('0x3d')]=_0x290e89[_0x3b8a('0x3d')]=![];_0x68de62[_0x3b8a('0x34')]=_0x290e89['user']=null;_0x68de62['password']=_0x290e89[_0x3b8a('0x35')]=null;}_0x68de62['host']=_0x4f71f3[_0x3b8a('0x3e')][_0x3b8a('0x3a')];_0x68de62[_0x3b8a('0x39')]=_0x4f71f3[_0x3b8a('0x3e')][_0x3b8a('0x39')];_0x290e89[_0x3b8a('0x3a')]=_0x4f71f3[_0x3b8a('0x3f')][_0x3b8a('0x3a')];_0x290e89['port']=_0x4f71f3[_0x3b8a('0x3f')][_0x3b8a('0x39')];}return{'Imap':_0x68de62,'Smtp':_0x290e89};}exports[_0x3b8a('0x40')]=function(_0x8c5b48,_0x260692){var _0x4d14fb={'include':[{'model':db[_0x3b8a('0x41')],'as':'Imap'},{'model':db[_0x3b8a('0x42')],'as':_0x3b8a('0x3f')},{'model':db['Pause'],'as':_0x3b8a('0x43')}]},_0x14f8ab={},_0x3f85d3={'count':0x0,'rows':[]};var _0x376bb0=_[_0x3b8a('0x44')](db[_0x3b8a('0x45')][_0x3b8a('0x46')],function(_0x4b5334){return{'name':_0x4b5334[_0x3b8a('0x47')],'type':_0x4b5334[_0x3b8a('0x48')][_0x3b8a('0x49')]};});_0x14f8ab[_0x3b8a('0x4a')]=_[_0x3b8a('0x44')](_0x376bb0,_0x3b8a('0x29'));_0x14f8ab[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x8c5b48[_0x3b8a('0x4b')]);_0x14f8ab[_0x3b8a('0x4d')]=_[_0x3b8a('0x4e')](_0x14f8ab[_0x3b8a('0x4a')],_0x14f8ab['query']);_0x4d14fb['attributes']=_[_0x3b8a('0x4e')](_0x14f8ab[_0x3b8a('0x4a')],qs[_0x3b8a('0x4f')](_0x8c5b48['query'][_0x3b8a('0x4f')]));_0x4d14fb[_0x3b8a('0x50')]=_0x4d14fb[_0x3b8a('0x50')]['length']?_0x4d14fb['attributes']:_0x14f8ab[_0x3b8a('0x4a')];if(!_0x8c5b48['query'][_0x3b8a('0x51')](_0x3b8a('0x52'))){_0x4d14fb['limit']=qs['limit'](_0x8c5b48['query'][_0x3b8a('0x1f')]);_0x4d14fb[_0x3b8a('0x1d')]=qs[_0x3b8a('0x1d')](_0x8c5b48['query'][_0x3b8a('0x1d')]);}_0x4d14fb[_0x3b8a('0x53')]=qs[_0x3b8a('0x54')](_0x8c5b48[_0x3b8a('0x4b')]['sort']);_0x4d14fb[_0x3b8a('0x55')]=qs[_0x3b8a('0x4d')](_[_0x3b8a('0x56')](_0x8c5b48[_0x3b8a('0x4b')],_0x14f8ab[_0x3b8a('0x4d')]),_0x376bb0);if(_0x8c5b48[_0x3b8a('0x4b')][_0x3b8a('0x57')]){_0x4d14fb[_0x3b8a('0x55')]=_[_0x3b8a('0x58')](_0x4d14fb['where'],{'$or':_[_0x3b8a('0x44')](_0x376bb0,function(_0x20f98b){if(_0x20f98b['type']!==_0x3b8a('0x59')){var _0x49d0fb={};_0x49d0fb[_0x20f98b['name']]={'$like':'%'+_0x8c5b48[_0x3b8a('0x4b')][_0x3b8a('0x57')]+'%'};return _0x49d0fb;}})});}_0x4d14fb=_['merge']({},_0x4d14fb,_0x8c5b48[_0x3b8a('0x5a')]);var _0x2481c9={'where':_0x4d14fb[_0x3b8a('0x55')]};return db[_0x3b8a('0x45')][_0x3b8a('0x20')](_0x2481c9)['then'](function(_0x52feee){_0x3f85d3[_0x3b8a('0x20')]=_0x52feee;if(_0x8c5b48[_0x3b8a('0x4b')][_0x3b8a('0x5b')]){_0x4d14fb[_0x3b8a('0x5c')]=[{'all':!![]}];}return db[_0x3b8a('0x45')][_0x3b8a('0x5d')](_0x4d14fb);})[_0x3b8a('0x23')](function(_0x24681b){_0x3f85d3[_0x3b8a('0x5e')]=_0x24681b;return _0x3f85d3;})[_0x3b8a('0x23')](respondWithFilteredResult(_0x260692,_0x4d14fb))[_0x3b8a('0x18')](handleError(_0x260692,null));};exports[_0x3b8a('0x5f')]=function(_0x45b195,_0x1a7561){var _0x26435e={'raw':![],'where':{'id':_0x45b195[_0x3b8a('0x60')]['id']},'include':[{'model':db[_0x3b8a('0x41')],'as':_0x3b8a('0x3e')},{'model':db[_0x3b8a('0x42')],'as':_0x3b8a('0x3f')},{'model':db[_0x3b8a('0x61')],'as':_0x3b8a('0x43')}]},_0x1add80={};_0x1add80[_0x3b8a('0x4a')]=_[_0x3b8a('0x4c')](db[_0x3b8a('0x45')][_0x3b8a('0x46')]);_0x1add80[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x45b195[_0x3b8a('0x4b')]);_0x1add80['filters']=_['intersection'](_0x1add80[_0x3b8a('0x4a')],_0x1add80[_0x3b8a('0x4b')]);_0x26435e[_0x3b8a('0x50')]=_[_0x3b8a('0x4e')](_0x1add80[_0x3b8a('0x4a')],qs['fields'](_0x45b195[_0x3b8a('0x4b')][_0x3b8a('0x4f')]));_0x26435e['attributes']=_0x26435e[_0x3b8a('0x50')][_0x3b8a('0x62')]?_0x26435e[_0x3b8a('0x50')]:_0x1add80[_0x3b8a('0x4a')];if(_0x45b195[_0x3b8a('0x4b')][_0x3b8a('0x5b')]){_0x26435e['include']=[{'all':!![]}];}_0x26435e=_['merge']({},_0x26435e,_0x45b195[_0x3b8a('0x5a')]);return db[_0x3b8a('0x45')][_0x3b8a('0x63')](_0x26435e)[_0x3b8a('0x23')](handleEntityNotFound(_0x1a7561,null))[_0x3b8a('0x23')](respondWithResult(_0x1a7561,null))[_0x3b8a('0x18')](handleError(_0x1a7561,null));};exports[_0x3b8a('0x22')]=function(_0x25045d,_0xd0cf56){if(_0x25045d[_0x3b8a('0x64')]['id']){delete _0x25045d[_0x3b8a('0x64')]['id'];}var _0x5ee3b6=_0x25045d[_0x3b8a('0x64')][_0x3b8a('0x65')]===_0x3b8a('0x66')?null:_0x25045d[_0x3b8a('0x64')][_0x3b8a('0x65')];var _0x1a9fd0=_0x25045d[_0x3b8a('0x64')][_0x3b8a('0x3e')]||{};var _0x25f46b=_0x25045d['body'][_0x3b8a('0x3f')]||{};if(_0x5ee3b6){_0x1a9fd0[_0x3b8a('0x3a')]=getImapHost(_0x5ee3b6);_0x1a9fd0[_0x3b8a('0x39')]=0x3e1;_0x25f46b[_0x3b8a('0x3a')]=getSmtpHost(_0x5ee3b6);_0x25f46b[_0x3b8a('0x39')]=0x24b;_0x25f46b[_0x3b8a('0x3b')]=![];}if(_0x25f46b[_0x3b8a('0x37')]){_0x25f46b[_0x3b8a('0x3b')]=![];}else{_0x25f46b[_0x3b8a('0x38')]=null;}if(!_0x1a9fd0['modernAuthentication'])_0x1a9fd0[_0x3b8a('0x38')]=null;_0x25045d[_0x3b8a('0x64')][_0x3b8a('0x3e')]=_0x1a9fd0;_0x25045d[_0x3b8a('0x64')]['Smtp']=_0x25f46b;return db['MailAccount']['find']({'where':{'id':_0x25045d['params']['id']},'include':[{'model':db[_0x3b8a('0x41')],'as':_0x3b8a('0x3e')},{'model':db[_0x3b8a('0x42')],'as':_0x3b8a('0x3f')},{'model':db[_0x3b8a('0x61')],'as':_0x3b8a('0x43')}]})[_0x3b8a('0x23')](handleEntityNotFound(_0xd0cf56,null))[_0x3b8a('0x23')](function(_0x12feb3){if(!_0x12feb3)throw new Error(_0x3b8a('0x67'));if(_0x12feb3[_0x3b8a('0x3c')])delete _0x25045d[_0x3b8a('0x64')][_0x3b8a('0x3e')];return _0x12feb3;})[_0x3b8a('0x23')](saveUpdates(_0x25045d[_0x3b8a('0x64')],null))['then'](function(_0x4acda9){if(!_0x25045d[_0x3b8a('0x64')][_0x3b8a('0x3e')])return _0x4acda9;return db['MailServerIn'][_0x3b8a('0x22')](_0x25045d['body'][_0x3b8a('0x3e')],{'where':{'MailAccountId':_0x4acda9['id']}})[_0x3b8a('0x23')](function(){return _0x4acda9;});})[_0x3b8a('0x23')](function(_0x91dad8){if(!_0x25045d[_0x3b8a('0x64')][_0x3b8a('0x3f')])return _0x91dad8;return db['MailServerOut'][_0x3b8a('0x22')](_0x25045d[_0x3b8a('0x64')]['Smtp'],{'where':{'MailAccountId':_0x91dad8['id']}})[_0x3b8a('0x23')](function(){return _0x91dad8;});})['then'](respondWithResult(_0xd0cf56,null))[_0x3b8a('0x18')](handleError(_0xd0cf56,null));};exports['describe']=function(_0x38f759,_0x12d373){return db[_0x3b8a('0x45')][_0x3b8a('0x68')]()[_0x3b8a('0x23')](respondWithResult(_0x12d373,null))['catch'](handleError(_0x12d373,null));};exports[_0x3b8a('0x69')]=function(_0x587fc2,_0x385c0a){if(_0x587fc2[_0x3b8a('0x64')]['id']){delete _0x587fc2['body']['id'];}return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0x587fc2['params']['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x385c0a,null))[_0x3b8a('0x23')](function(_0x1c7355){if(_0x1c7355){_0x587fc2[_0x3b8a('0x64')][_0x3b8a('0x6a')]=_0x1c7355['id'];return db[_0x3b8a('0x6b')][_0x3b8a('0x6c')](_0x587fc2[_0x3b8a('0x64')]);}})[_0x3b8a('0x23')](respondWithResult(_0x385c0a,null))[_0x3b8a('0x18')](handleError(_0x385c0a,null));};exports[_0x3b8a('0x6d')]=function(_0x2feb91,_0x586764){var _0x16c3c6={'raw':![],'where':{}};var _0x4efeee={};var _0x8bf73c={'count':0x0,'rows':[]};return db['MailAccount'][_0x3b8a('0x6e')]({'where':{'id':_0x2feb91[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x586764,null))[_0x3b8a('0x23')](function(_0x54f8aa){if(_0x54f8aa){_0x4efeee[_0x3b8a('0x4a')]=_['keys'](db[_0x3b8a('0x6b')]['rawAttributes']);_0x4efeee[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x2feb91[_0x3b8a('0x4b')]);_0x4efeee[_0x3b8a('0x4d')]=_[_0x3b8a('0x4e')](_0x4efeee[_0x3b8a('0x4a')],_0x4efeee[_0x3b8a('0x4b')]);_0x16c3c6[_0x3b8a('0x50')]=_['intersection'](_0x4efeee[_0x3b8a('0x4a')],qs[_0x3b8a('0x4f')](_0x2feb91[_0x3b8a('0x4b')]['fields']));_0x16c3c6[_0x3b8a('0x50')]=_0x16c3c6[_0x3b8a('0x50')][_0x3b8a('0x62')]?_0x16c3c6[_0x3b8a('0x50')]:_0x4efeee[_0x3b8a('0x4a')];if(!_0x2feb91[_0x3b8a('0x4b')][_0x3b8a('0x51')](_0x3b8a('0x52'))){_0x16c3c6['limit']=qs[_0x3b8a('0x1f')](_0x2feb91[_0x3b8a('0x4b')][_0x3b8a('0x1f')]);_0x16c3c6[_0x3b8a('0x1d')]=qs[_0x3b8a('0x1d')](_0x2feb91['query'][_0x3b8a('0x1d')]);}_0x16c3c6[_0x3b8a('0x53')]=qs[_0x3b8a('0x54')](_0x2feb91[_0x3b8a('0x4b')][_0x3b8a('0x54')]);_0x16c3c6[_0x3b8a('0x55')]=qs['filters'](_['pick'](_0x2feb91[_0x3b8a('0x4b')],_0x4efeee[_0x3b8a('0x4d')]));_0x16c3c6[_0x3b8a('0x55')][_0x3b8a('0x6a')]=_0x54f8aa['id'];if(_0x2feb91[_0x3b8a('0x4b')][_0x3b8a('0x57')]){_0x16c3c6['where']=_[_0x3b8a('0x58')](_0x16c3c6[_0x3b8a('0x55')],{'$or':_[_0x3b8a('0x44')](_0x16c3c6[_0x3b8a('0x50')],function(_0x3df20f){var _0x10eba8={};_0x10eba8[_0x3df20f]={'$like':'%'+_0x2feb91[_0x3b8a('0x4b')][_0x3b8a('0x57')]+'%'};return _0x10eba8;})});}_0x16c3c6=_[_0x3b8a('0x58')]({},_0x16c3c6,_0x2feb91['options']);return db[_0x3b8a('0x6b')][_0x3b8a('0x20')]({'where':_0x16c3c6[_0x3b8a('0x55')]})['then'](function(_0x416180){_0x8bf73c[_0x3b8a('0x20')]=_0x416180;if(_0x2feb91[_0x3b8a('0x4b')]['includeAll']){_0x16c3c6['include']=[{'all':!![]}];}return db[_0x3b8a('0x6b')]['findAll'](_0x16c3c6);})[_0x3b8a('0x23')](function(_0x270949){_0x8bf73c[_0x3b8a('0x5e')]=_0x270949;return _0x8bf73c;});}})[_0x3b8a('0x23')](respondWithFilteredResult(_0x586764,_0x16c3c6))[_0x3b8a('0x18')](handleError(_0x586764,null));};exports[_0x3b8a('0x6f')]=function(_0x259e71,_0x533376){return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0x259e71[_0x3b8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x533376,null))[_0x3b8a('0x23')](function(_0xb29a19){if(_0xb29a19){return _0xb29a19['removeDispositions'](_0x259e71['query'][_0x3b8a('0x70')]);}})[_0x3b8a('0x23')](respondWithStatusCode(_0x533376,null))['catch'](handleError(_0x533376,null));};exports['addAnswer']=function(_0x2b37a0,_0x1af2c4){if(_0x2b37a0[_0x3b8a('0x64')]['id']){delete _0x2b37a0[_0x3b8a('0x64')]['id'];}return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0x2b37a0[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x1af2c4,null))[_0x3b8a('0x23')](function(_0x4c84c7){if(_0x4c84c7){_0x2b37a0['body'][_0x3b8a('0x6a')]=_0x4c84c7['id'];return db['CannedAnswer']['create'](_0x2b37a0['body']);}})[_0x3b8a('0x23')](respondWithResult(_0x1af2c4,null))[_0x3b8a('0x18')](handleError(_0x1af2c4,null));};exports[_0x3b8a('0x71')]=function(_0x303bd0,_0x46e3d8){var _0x5b7d1a={'raw':![],'where':{}};var _0x26a7b8={};var _0x34123e={'count':0x0,'rows':[]};return db[_0x3b8a('0x45')][_0x3b8a('0x6e')]({'where':{'id':_0x303bd0['params']['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x46e3d8,null))[_0x3b8a('0x23')](function(_0x7718e5){if(_0x7718e5){_0x26a7b8[_0x3b8a('0x4a')]=_[_0x3b8a('0x4c')](db[_0x3b8a('0x72')][_0x3b8a('0x46')]);_0x26a7b8[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x303bd0['query']);_0x26a7b8[_0x3b8a('0x4d')]=_[_0x3b8a('0x4e')](_0x26a7b8['model'],_0x26a7b8[_0x3b8a('0x4b')]);_0x5b7d1a[_0x3b8a('0x50')]=_[_0x3b8a('0x4e')](_0x26a7b8[_0x3b8a('0x4a')],qs[_0x3b8a('0x4f')](_0x303bd0[_0x3b8a('0x4b')][_0x3b8a('0x4f')]));_0x5b7d1a[_0x3b8a('0x50')]=_0x5b7d1a[_0x3b8a('0x50')][_0x3b8a('0x62')]?_0x5b7d1a[_0x3b8a('0x50')]:_0x26a7b8[_0x3b8a('0x4a')];if(!_0x303bd0[_0x3b8a('0x4b')][_0x3b8a('0x51')]('nolimit')){_0x5b7d1a[_0x3b8a('0x1f')]=qs[_0x3b8a('0x1f')](_0x303bd0[_0x3b8a('0x4b')][_0x3b8a('0x1f')]);_0x5b7d1a[_0x3b8a('0x1d')]=qs[_0x3b8a('0x1d')](_0x303bd0['query']['offset']);}_0x5b7d1a['order']=qs[_0x3b8a('0x54')](_0x303bd0[_0x3b8a('0x4b')][_0x3b8a('0x54')]);_0x5b7d1a['where']=qs[_0x3b8a('0x4d')](_['pick'](_0x303bd0[_0x3b8a('0x4b')],_0x26a7b8[_0x3b8a('0x4d')]));_0x5b7d1a[_0x3b8a('0x55')][_0x3b8a('0x6a')]=_0x7718e5['id'];if(_0x303bd0[_0x3b8a('0x4b')]['filter']){_0x5b7d1a['where']=_[_0x3b8a('0x58')](_0x5b7d1a[_0x3b8a('0x55')],{'$or':_['map'](_0x5b7d1a['attributes'],function(_0x823cb4){var _0x23117e={};_0x23117e[_0x823cb4]={'$like':'%'+_0x303bd0[_0x3b8a('0x4b')][_0x3b8a('0x57')]+'%'};return _0x23117e;})});}_0x5b7d1a=_['merge']({},_0x5b7d1a,_0x303bd0[_0x3b8a('0x5a')]);return db['CannedAnswer'][_0x3b8a('0x20')]({'where':_0x5b7d1a[_0x3b8a('0x55')]})[_0x3b8a('0x23')](function(_0x5c28d7){_0x34123e[_0x3b8a('0x20')]=_0x5c28d7;if(_0x303bd0['query'][_0x3b8a('0x5b')]){_0x5b7d1a[_0x3b8a('0x5c')]=[{'all':!![]}];}return db[_0x3b8a('0x72')][_0x3b8a('0x5d')](_0x5b7d1a);})[_0x3b8a('0x23')](function(_0x936b79){_0x34123e[_0x3b8a('0x5e')]=_0x936b79;return _0x34123e;});}})[_0x3b8a('0x23')](respondWithFilteredResult(_0x46e3d8,_0x5b7d1a))[_0x3b8a('0x18')](handleError(_0x46e3d8,null));};exports[_0x3b8a('0x73')]=function(_0x51a613,_0x3ea50b){return db[_0x3b8a('0x45')]['find']({'where':{'id':_0x51a613[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x3ea50b,null))['then'](function(_0x5a066d){if(_0x5a066d){return _0x5a066d[_0x3b8a('0x73')](_0x51a613['query']['ids']);}})[_0x3b8a('0x23')](respondWithStatusCode(_0x3ea50b,null))[_0x3b8a('0x18')](handleError(_0x3ea50b,null));};exports[_0x3b8a('0x6c')]=function(_0x18d8e8,_0x2dde96){var _0x42c864={'name':_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x29')],'key':_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x49')],'provider':_0x18d8e8[_0x3b8a('0x64')]['provider']===_0x3b8a('0x66')?null:_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x65')],'email':_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x74')],'ListId':_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x75')],'active':!_[_0x3b8a('0x76')](_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x77')])?_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x77')]:!![],'description':_0x18d8e8[_0x3b8a('0x64')][_0x3b8a('0x78')]||null};var _0x3ccf7e=getAuthenticationOptions(_0x42c864['provider'],_0x18d8e8[_0x3b8a('0x64')]);_0x42c864[_0x3b8a('0x3e')]=_0x3ccf7e[_0x3b8a('0x3e')];_0x42c864['Smtp']=_0x3ccf7e[_0x3b8a('0x3f')];return db[_0x3b8a('0x45')][_0x3b8a('0x6c')](_0x42c864,{'include':[{'model':db[_0x3b8a('0x42')],'as':_0x3b8a('0x3f')},{'model':db[_0x3b8a('0x41')],'as':_0x3b8a('0x3e')}]})[_0x3b8a('0x23')](function(_0x4b8c99){var _0x5c4033=_0x18d8e8[_0x3b8a('0x34')][_0x3b8a('0x25')]({'plain':!![]});if(!_0x5c4033)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c4033['role']===_0x3b8a('0x34')){var _0x4d37af=_0x4b8c99[_0x3b8a('0x25')]({'plain':!![]});return db[_0x3b8a('0x79')][_0x3b8a('0x63')]({'where':{'name':_0x3b8a('0x26'),'userProfileId':_0x5c4033[_0x3b8a('0x7a')]},'raw':!![]})[_0x3b8a('0x23')](function(_0xb13f25){if(_0xb13f25&&_0xb13f25[_0x3b8a('0x7b')]===0x0){return db[_0x3b8a('0x27')]['create']({'name':_0x4d37af[_0x3b8a('0x29')],'resourceId':_0x4d37af['id'],'type':_0xb13f25['name'],'sectionId':_0xb13f25['id']},{})[_0x3b8a('0x23')](function(){return _0x4b8c99;});}else{return _0x4b8c99;}})[_0x3b8a('0x18')](function(_0x311a31){logger[_0x3b8a('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x311a31);throw _0x311a31;});}return _0x4b8c99;})[_0x3b8a('0x23')](respondWithResult(_0x2dde96,0xc9))[_0x3b8a('0x18')](handleError(_0x2dde96,null));};exports[_0x3b8a('0x7c')]=function(_0x12c613,_0x356ce5){return db[_0x3b8a('0x45')]['findOne']({'where':{'id':_0x12c613['params']['id']}})['then'](handleEntityNotFound(_0x356ce5,null))['then'](function(_0x4672f4){if(_0x4672f4){return _0x4672f4[_0x3b8a('0x7c')]();}return null;})[_0x3b8a('0x23')](respondWithResult(_0x356ce5,null))[_0x3b8a('0x18')](handleError(_0x356ce5,null));};exports[_0x3b8a('0x7d')]=function(_0x1a3937,_0x55de6d){if(_0x1a3937['body']['id']){delete _0x1a3937[_0x3b8a('0x64')]['id'];}return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0x1a3937[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x55de6d,null))['then'](function(_0x22c7b7){if(_0x22c7b7){_0x1a3937[_0x3b8a('0x64')][_0x3b8a('0x6a')]=_0x22c7b7['id'];return db[_0x3b8a('0x41')]['create'](_0x1a3937[_0x3b8a('0x64')]);}})[_0x3b8a('0x23')](respondWithResult(_0x55de6d,null))[_0x3b8a('0x18')](handleError(_0x55de6d,null));};exports[_0x3b8a('0x7e')]=function(_0x98eec4,_0x5dbc33){return db[_0x3b8a('0x45')][_0x3b8a('0x6e')]({'where':{'id':_0x98eec4[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x5dbc33,null))[_0x3b8a('0x23')](function(_0x55ab03){if(_0x55ab03){return _0x55ab03[_0x3b8a('0x7f')](null);}return null;})[_0x3b8a('0x23')](respondWithStatusCode(_0x5dbc33,null))['catch'](handleError(_0x5dbc33,null));};exports['getSmtp']=function(_0xb3b45c,_0x126dcc){return db['MailAccount'][_0x3b8a('0x6e')]({'where':{'id':_0xb3b45c[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x126dcc,null))['then'](function(_0x36f3a9){if(_0x36f3a9){return _0x36f3a9[_0x3b8a('0x80')]();}return null;})['then'](respondWithResult(_0x126dcc,null))[_0x3b8a('0x18')](handleError(_0x126dcc,null));};exports[_0x3b8a('0x81')]=function(_0x52c2aa,_0x559b61){if(_0x52c2aa[_0x3b8a('0x64')]['id']){delete _0x52c2aa[_0x3b8a('0x64')]['id'];}return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0x52c2aa['params']['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x559b61,null))[_0x3b8a('0x23')](function(_0x4a1359){if(_0x4a1359){_0x52c2aa[_0x3b8a('0x64')][_0x3b8a('0x6a')]=_0x4a1359['id'];return db[_0x3b8a('0x42')][_0x3b8a('0x6c')](_0x52c2aa[_0x3b8a('0x64')]);}})['then'](respondWithResult(_0x559b61,null))[_0x3b8a('0x18')](handleError(_0x559b61,null));};exports[_0x3b8a('0x82')]=function(_0x751430,_0x1aa272){return db['MailAccount'][_0x3b8a('0x6e')]({'where':{'id':_0x751430['params']['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x1aa272,null))[_0x3b8a('0x23')](function(_0xeb440e){if(_0xeb440e){return _0xeb440e[_0x3b8a('0x83')](null);}return null;})[_0x3b8a('0x23')](respondWithStatusCode(_0x1aa272,null))[_0x3b8a('0x18')](handleError(_0x1aa272,null));};exports[_0x3b8a('0x84')]=function(_0x25062b,_0x10b2c3){return db[_0x3b8a('0x85')][_0x3b8a('0x63')]({'where':{'id':_0x25062b[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x10b2c3,null))[_0x3b8a('0x23')](function(_0x59bf1b){if(_0x59bf1b){return _0x59bf1b[_0x3b8a('0x84')](_0x25062b[_0x3b8a('0x64')][_0x3b8a('0x70')],_[_0x3b8a('0x86')](_0x25062b[_0x3b8a('0x64')],[_0x3b8a('0x70'),'id'])||{});}})['then'](respondWithResult(_0x10b2c3,null))[_0x3b8a('0x18')](handleError(_0x10b2c3,null));};exports[_0x3b8a('0x87')]=function(_0x2bfbcb,_0x2b1092){var _0x1c12f8={'raw':![],'where':{}};var _0x5380b7={};var _0x3a4d65={'count':0x0,'rows':[]};return db[_0x3b8a('0x45')][_0x3b8a('0x6e')]({'where':{'id':_0x2bfbcb[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x2b1092,null))[_0x3b8a('0x23')](function(_0x32c18c){if(_0x32c18c){_0x5380b7[_0x3b8a('0x4a')]=_['keys'](db[_0x3b8a('0x85')]['rawAttributes']);_0x5380b7[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x2bfbcb[_0x3b8a('0x4b')]);_0x5380b7[_0x3b8a('0x4d')]=_[_0x3b8a('0x4e')](_0x5380b7[_0x3b8a('0x4a')],_0x5380b7[_0x3b8a('0x4b')]);_0x1c12f8[_0x3b8a('0x50')]=_[_0x3b8a('0x4e')](_0x5380b7[_0x3b8a('0x4a')],qs[_0x3b8a('0x4f')](_0x2bfbcb['query'][_0x3b8a('0x4f')]));_0x1c12f8[_0x3b8a('0x50')]=_0x1c12f8[_0x3b8a('0x50')][_0x3b8a('0x62')]?_0x1c12f8['attributes']:_0x5380b7[_0x3b8a('0x4a')];if(!_0x2bfbcb['query'][_0x3b8a('0x51')]('nolimit')){_0x1c12f8[_0x3b8a('0x1f')]=qs[_0x3b8a('0x1f')](_0x2bfbcb[_0x3b8a('0x4b')][_0x3b8a('0x1f')]);_0x1c12f8['offset']=qs[_0x3b8a('0x1d')](_0x2bfbcb[_0x3b8a('0x4b')]['offset']);}_0x1c12f8[_0x3b8a('0x53')]=qs[_0x3b8a('0x54')](_0x2bfbcb[_0x3b8a('0x4b')][_0x3b8a('0x54')]);_0x1c12f8[_0x3b8a('0x55')]=qs['filters'](_[_0x3b8a('0x56')](_0x2bfbcb['query'],_0x5380b7[_0x3b8a('0x4d')]));_0x1c12f8['where'][_0x3b8a('0x6a')]=_0x32c18c['id'];if(_0x2bfbcb[_0x3b8a('0x4b')][_0x3b8a('0x57')]){_0x1c12f8[_0x3b8a('0x55')]=_[_0x3b8a('0x58')](_0x1c12f8['where'],{'$or':_['map'](_0x1c12f8['attributes'],function(_0x2b447d){var _0x55aa8c={};_0x55aa8c[_0x2b447d]={'$like':'%'+_0x2bfbcb[_0x3b8a('0x4b')][_0x3b8a('0x57')]+'%'};return _0x55aa8c;})});}_0x1c12f8=_[_0x3b8a('0x58')]({},_0x1c12f8,_0x2bfbcb[_0x3b8a('0x5a')]);return db[_0x3b8a('0x85')][_0x3b8a('0x20')]({'where':_0x1c12f8[_0x3b8a('0x55')]})[_0x3b8a('0x23')](function(_0x48a59e){_0x3a4d65[_0x3b8a('0x20')]=_0x48a59e;if(_0x2bfbcb[_0x3b8a('0x4b')]['includeAll']){_0x1c12f8[_0x3b8a('0x5c')]=[{'model':db[_0x3b8a('0x88')],'as':_0x3b8a('0x89'),'required':![]},{'model':db[_0x3b8a('0x8a')],'as':_0x3b8a('0x8b'),'attributes':[_0x3b8a('0x29'),_0x3b8a('0x8c'),_0x3b8a('0x8d')],'required':![]},{'model':db[_0x3b8a('0x8e')],'as':_0x3b8a('0x8f'),'attributes':['id',_0x3b8a('0x29'),_0x3b8a('0x90')],'where':_0x2bfbcb[_0x3b8a('0x4b')][_0x3b8a('0x91')]?{'id':_0x2bfbcb['query']['tag']}:undefined,'required':_0x2bfbcb['query'][_0x3b8a('0x91')]?!![]:![]}];}return db[_0x3b8a('0x85')]['findAll'](_0x1c12f8);})['then'](function(_0x2ec02d){_0x3a4d65[_0x3b8a('0x5e')]=_0x2ec02d;return _0x3a4d65;});}})[_0x3b8a('0x23')](respondWithFilteredResult(_0x2b1092,_0x1c12f8))[_0x3b8a('0x18')](handleError(_0x2b1092,null));};exports[_0x3b8a('0x92')]=function addApplications(_0x465990,_0x4432f5){var _0x10d942=_0x465990['params']['id'];var _0x18c11=_0x465990[_0x3b8a('0x64')];var _0x39c9ba=0xc8;var _0x2b164b=null;return db[_0x3b8a('0x93')][_0x3b8a('0x94')]({'isolationLevel':db[_0x3b8a('0x93')]['Transaction'][_0x3b8a('0x95')][_0x3b8a('0x96')]},function(_0x309591){return db[_0x3b8a('0x45')][_0x3b8a('0x6e')]({'where':{'id':_0x10d942},'transaction':_0x309591})[_0x3b8a('0x23')](function(_0x19273b){if(_0x19273b){return db[_0x3b8a('0x97')][_0x3b8a('0x24')]({'where':{'MailAccountId':_0x10d942},'transaction':_0x309591})[_0x3b8a('0x23')](function(){var _0x2fe934=_[_0x3b8a('0x44')](_0x18c11,function(_0x4410bb){_0x4410bb[_0x3b8a('0x6a')]=_0x10d942;return _0x4410bb;});return db[_0x3b8a('0x97')]['bulkCreate'](_0x2fe934,{'transaction':_0x309591});});}else{_0x39c9ba=0x194;_0x2b164b=[];}});})[_0x3b8a('0x23')](function(){if(_0x39c9ba!==0x194){return db[_0x3b8a('0x97')][_0x3b8a('0x98')]({'where':{'MailAccountId':_0x10d942},'order':'priority'})['then'](function(_0x5ce9e1){_0x2b164b=_0x5ce9e1;});}})[_0x3b8a('0x18')](function(_0x127b02){_0x39c9ba=0x1f4;logger[_0x3b8a('0x15')](_0x127b02[_0x3b8a('0x28')]);if(_0x127b02[_0x3b8a('0x29')]){delete _0x127b02[_0x3b8a('0x29')];}_0x2b164b=_0x127b02;})['finally'](function(){if(_0x2b164b===null){_0x4432f5[_0x3b8a('0x19')](_0x39c9ba);}else{if(_0x39c9ba===0x1f4){_0x4432f5[_0x3b8a('0x1b')](_0x39c9ba)[_0x3b8a('0x2a')](_0x2b164b);}else{_0x4432f5[_0x3b8a('0x1b')](_0x39c9ba)['json'](_0x2b164b);}}});};exports[_0x3b8a('0x99')]=function(_0x2e3c69,_0x266615){var _0xb3648={};var _0x5aa794={};var _0x20c2d0;var _0x58ea5b;return db[_0x3b8a('0x45')][_0x3b8a('0x6e')]({'where':{'id':_0x2e3c69[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x266615,null))['then'](function(_0x5b2dfa){if(_0x5b2dfa){_0x20c2d0=_0x5b2dfa;_0x5aa794[_0x3b8a('0x4a')]=_[_0x3b8a('0x4c')](db[_0x3b8a('0x97')][_0x3b8a('0x46')]);_0x5aa794[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x2e3c69['query']);_0x5aa794[_0x3b8a('0x4d')]=_['intersection'](_0x5aa794[_0x3b8a('0x4a')],_0x5aa794[_0x3b8a('0x4b')]);_0xb3648[_0x3b8a('0x50')]=_[_0x3b8a('0x4e')](_0x5aa794[_0x3b8a('0x4a')],qs[_0x3b8a('0x4f')](_0x2e3c69[_0x3b8a('0x4b')][_0x3b8a('0x4f')]));_0xb3648[_0x3b8a('0x50')]=_0xb3648['attributes'][_0x3b8a('0x62')]?_0xb3648['attributes']:_0x5aa794['model'];_0xb3648[_0x3b8a('0x53')]=qs[_0x3b8a('0x54')](_0x2e3c69[_0x3b8a('0x4b')]['sort']);_0xb3648[_0x3b8a('0x55')]=qs['filters'](_[_0x3b8a('0x56')](_0x2e3c69[_0x3b8a('0x4b')],_0x5aa794[_0x3b8a('0x4d')]));if(_0x2e3c69['query']['filter']){_0xb3648[_0x3b8a('0x55')]=_['merge'](_0xb3648[_0x3b8a('0x55')],{'$or':_['map'](_0xb3648[_0x3b8a('0x50')],function(_0x26ad9f){var _0x2acbeb={};_0x2acbeb[_0x26ad9f]={'$like':'%'+_0x2e3c69['query'][_0x3b8a('0x57')]+'%'};return _0x2acbeb;})});}_0xb3648=_[_0x3b8a('0x58')]({},_0xb3648,_0x2e3c69[_0x3b8a('0x5a')]);return _0x20c2d0[_0x3b8a('0x99')](_0xb3648);}})[_0x3b8a('0x23')](function(_0x6f926e){if(_0x6f926e){_0x58ea5b=_0x6f926e['length'];if(!_0x2e3c69[_0x3b8a('0x4b')][_0x3b8a('0x51')](_0x3b8a('0x52'))){_0xb3648['limit']=qs['limit'](_0x2e3c69[_0x3b8a('0x4b')]['limit']);_0xb3648[_0x3b8a('0x1d')]=qs[_0x3b8a('0x1d')](_0x2e3c69[_0x3b8a('0x4b')][_0x3b8a('0x1d')]);}return _0x20c2d0[_0x3b8a('0x99')](_0xb3648);}})[_0x3b8a('0x23')](function(_0xe6a407){if(_0xe6a407){return _0xe6a407?{'count':_0x58ea5b,'rows':_0xe6a407}:null;}})['then'](respondWithResult(_0x266615,null))[_0x3b8a('0x18')](handleError(_0x266615,null));};exports['getMessages']=function(_0x516964,_0x30e859){var _0x432656={'raw':!![],'where':{}};var _0x168962={};var _0x5abfad={'count':0x0,'rows':[]};return db[_0x3b8a('0x45')][_0x3b8a('0x6e')]({'where':{'id':_0x516964[_0x3b8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x30e859,null))['then'](function(_0x18fc0b){if(_0x18fc0b){_0x168962[_0x3b8a('0x4a')]=_['keys'](db[_0x3b8a('0x9a')][_0x3b8a('0x46')]);_0x168962[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x516964['query']);_0x168962['filters']=_[_0x3b8a('0x4e')](_0x168962[_0x3b8a('0x4a')],_0x168962['query']);_0x432656['attributes']=_[_0x3b8a('0x4e')](_0x168962['model'],qs[_0x3b8a('0x4f')](_0x516964[_0x3b8a('0x4b')][_0x3b8a('0x4f')]));_0x432656[_0x3b8a('0x50')]=_0x432656['attributes']['length']?_0x432656[_0x3b8a('0x50')]:_0x168962[_0x3b8a('0x4a')];if(!_0x516964[_0x3b8a('0x4b')]['hasOwnProperty'](_0x3b8a('0x52'))){_0x432656[_0x3b8a('0x1f')]=qs[_0x3b8a('0x1f')](_0x516964['query'][_0x3b8a('0x1f')]);_0x432656[_0x3b8a('0x1d')]=qs[_0x3b8a('0x1d')](_0x516964['query'][_0x3b8a('0x1d')]);}_0x432656[_0x3b8a('0x53')]=qs[_0x3b8a('0x54')](_0x516964[_0x3b8a('0x4b')][_0x3b8a('0x54')]);_0x432656[_0x3b8a('0x55')]=qs[_0x3b8a('0x4d')](_[_0x3b8a('0x56')](_0x516964['query'],_0x168962['filters']));_0x432656[_0x3b8a('0x55')][_0x3b8a('0x6a')]=_0x18fc0b['id'];if(_0x516964[_0x3b8a('0x4b')][_0x3b8a('0x57')]){_0x432656['where']=_[_0x3b8a('0x58')](_0x432656[_0x3b8a('0x55')],{'$or':_[_0x3b8a('0x44')](_0x432656['attributes'],function(_0x1eae07){var _0x4ab035={};_0x4ab035[_0x1eae07]={'$like':'%'+_0x516964[_0x3b8a('0x4b')][_0x3b8a('0x57')]+'%'};return _0x4ab035;})});}if(_0x516964['query']['$gte']){var _0x8183a=_0x516964['query'][_0x3b8a('0x9b')]['split'](',');var _0x42fd09={};_0x42fd09[_0x8183a[0x0]]={'$gte':moment(_0x8183a[0x1])[_0x3b8a('0x9c')](_0x3b8a('0x9d'))};_0x432656[_0x3b8a('0x55')]=_[_0x3b8a('0x58')](_0x432656[_0x3b8a('0x55')],_0x42fd09);}_0x432656=_[_0x3b8a('0x58')]({},_0x432656,_0x516964[_0x3b8a('0x5a')]);return db[_0x3b8a('0x9a')][_0x3b8a('0x20')]({'where':_0x432656[_0x3b8a('0x55')]})['then'](function(_0x4b7dc2){_0x5abfad[_0x3b8a('0x20')]=_0x4b7dc2;if(_0x516964[_0x3b8a('0x4b')]['includeAll']){_0x432656[_0x3b8a('0x5c')]=[{'all':!![]}];}return db[_0x3b8a('0x9a')]['findAll'](_0x432656);})[_0x3b8a('0x23')](function(_0x17608b){if(_0x516964[_0x3b8a('0x4b')]['inlineCss']===_0x3b8a('0x9e')){for(var _0x7c4829=0x0;_0x7c4829<_0x17608b[_0x3b8a('0x62')];_0x7c4829++){_0x17608b[_0x7c4829][_0x3b8a('0x64')]=juice(_0x17608b[_0x7c4829][_0x3b8a('0x64')]);}}_0x5abfad[_0x3b8a('0x5e')]=_0x17608b;return _0x5abfad;});}})['then'](respondWithFilteredResult(_0x30e859,_0x432656))[_0x3b8a('0x18')](handleError(_0x30e859,null));};exports['send']=function(_0x39e0be,_0x210592){var _0x8e8e7b,_0x14eb58={},_0x3e533b;if(_0x39e0be[_0x3b8a('0x64')]['to']){_0x3e533b=_0x39e0be['body']['to'][_0x3b8a('0x9f')](',')[0x0];}return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0x39e0be['params']['id']},'include':[{'model':db[_0x3b8a('0xa0')],'as':'List','include':[{'model':db[_0x3b8a('0x88')],'as':_0x3b8a('0xa1'),'where':{'email':_0x3e533b},'limit':0x1,'order':[[_0x3b8a('0xa2'),_0x3b8a('0xa3')]]}]},{'model':db[_0x3b8a('0x42')],'as':_0x3b8a('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x3b8a('0xa4'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x210592,null))['then'](function(_0x5dd276){if(!_0x5dd276)return;_0x8e8e7b=_0x5dd276;if(!_0x5dd276[_0x3b8a('0x3f')])throw new Error(_0x3b8a('0xa5'));if(_[_0x3b8a('0x76')](_0x39e0be[_0x3b8a('0x64')]['from'])){_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xa6')]=util[_0x3b8a('0x9c')]('%s\x20<%s>',_0x5dd276[_0x3b8a('0x29')],_0x5dd276[_0x3b8a('0x74')]||_0x5dd276['Smtp'][_0x3b8a('0x34')]);}if(_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xa7')]&&_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xa7')][_0x3b8a('0x62')]){for(var _0x25556a=0x0;_0x25556a<_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xa7')][_0x3b8a('0x62')];_0x25556a+=0x1){_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xa7')][_0x25556a]={'filename':_0x39e0be[_0x3b8a('0x64')]['attachments'][_0x25556a][_0x3b8a('0x29')],'path':path[_0x3b8a('0xa8')](config[_0x3b8a('0xa9')],'server/files/attachments',_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xa7')][_0x25556a][_0x3b8a('0xaa')])};}}var _0x5a2977=_0x5dd276[_0x3b8a('0xab')]();return respondWithRpcPromise(_0x3b8a('0xac'),_0x3b8a('0xad'),{'account':_0x5a2977,'message':_0x39e0be[_0x3b8a('0x64')]});})[_0x3b8a('0x23')](function(_0x3ad259){if(!_0x3ad259)return;_0x14eb58=_0x3ad259;if(!_0x8e8e7b[_0x3b8a('0xae')])throw new Error(_0x3b8a('0xaf'));if(_0x8e8e7b[_0x3b8a('0xae')]['Contacts'][_0x3b8a('0x62')])return _0x8e8e7b[_0x3b8a('0xae')]['Contacts'][0x0];return db['CmContact'][_0x3b8a('0x6c')](_[_0x3b8a('0xa')](_0x39e0be[_0x3b8a('0x64')],{'firstName':_0x39e0be[_0x3b8a('0x64')]['to'],'email':_0x39e0be[_0x3b8a('0x64')]['to'],'phone':_0x39e0be[_0x3b8a('0x64')]['to'],'ListId':_0x8e8e7b[_0x3b8a('0x75')]}));})['then'](function(_0xe4c2f1){if(!_0xe4c2f1)return;var _0x3ce70b={'UserId':_0x39e0be[_0x3b8a('0x34')]['id'],'ContactId':_0xe4c2f1['id'],'MailAccountId':_0x8e8e7b['id'],'inReplyTo':_0x14eb58[_0x3b8a('0xb0')],'to':_0x39e0be[_0x3b8a('0x64')]['from'],'cc':_0x39e0be[_0x3b8a('0x64')]['cc'],'subject':_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xb1')],'attach':_0x39e0be['body'][_0x3b8a('0xb2')],'firstMsgDirection':_0x3b8a('0xb3'),'lastMsgAt':moment()['format'](_0x3b8a('0x9d')),'lastMsgDirection':'out','Messages':[_[_0x3b8a('0x58')](_0x39e0be[_0x3b8a('0x64')],{'messageId':_0x14eb58[_0x3b8a('0xb0')],'sentAt':moment()[_0x3b8a('0x9c')](_0x3b8a('0x9d')),'read':!![],'MailAccountId':_0x8e8e7b['id'],'UserId':_0x39e0be[_0x3b8a('0x34')]['id'],'ContactId':_0xe4c2f1['id']})]};if(_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xb4')]){_0x3ce70b=_[_0x3b8a('0x58')](_0x3ce70b,_0x39e0be[_0x3b8a('0x64')][_0x3b8a('0xb4')]);}return db[_0x3b8a('0x85')][_0x3b8a('0x6c')](_0x3ce70b,{'include':[{'model':db[_0x3b8a('0x9a')],'as':_0x3b8a('0xb5')}]});})[_0x3b8a('0x23')](respondWithResult(_0x210592,null))[_0x3b8a('0x18')](handleError(_0x210592,null));};exports[_0x3b8a('0xb6')]=function(_0x13676d,_0x179820){return db['MailAccount']['find']({'where':{'id':_0x13676d[_0x3b8a('0x60')]['id']},'include':[{'model':db[_0x3b8a('0x42')],'as':_0x3b8a('0x3f'),'raw':!![],'include':[{'model':db[_0x3b8a('0xa4')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x179820,null))['then'](function(_0x1a95cf){if(!_0x1a95cf[_0x3b8a('0x3f')])return;var _0x337eda=_0x1a95cf[_0x3b8a('0xab')]();return respondWithRpcPromise(_0x3b8a('0xb7'),'verifySmtp',{'account':_0x337eda});})[_0x3b8a('0x23')](respondWithResult(_0x179820,null))[_0x3b8a('0x18')](handleError(_0x179820,null));};exports[_0x3b8a('0x24')]=function(_0x3a3777,_0xcf4daf){return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0x3a3777['params']['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0xcf4daf,null))['then'](function(_0x456a05){if(_0x456a05&&_0x456a05['service']){throw new db[(_0x3b8a('0xb8'))][(_0x3b8a('0xb9'))](_0x3b8a('0xba'));}return _0x456a05;})[_0x3b8a('0x23')](removeEntity(_0xcf4daf,null))[_0x3b8a('0x18')](handleError(_0xcf4daf,null));};exports['addAgents']=function(_0xc78390,_0x10efd9){return db['MailAccount'][_0x3b8a('0x63')]({'where':{'id':_0xc78390[_0x3b8a('0x60')]['id']}})['then'](handleEntityNotFound(_0x10efd9,null))[_0x3b8a('0x23')](function(_0x282248){if(_0x282248){return _0x282248[_0x3b8a('0xbb')](_0xc78390['body'][_0x3b8a('0x70')],_[_0x3b8a('0x86')](_0xc78390[_0x3b8a('0x64')],['ids','id'])||{})['spread'](function(_0x555e1c){for(var _0x46eb6a=0x0;_0x46eb6a<_0xc78390[_0x3b8a('0x64')][_0x3b8a('0x70')]['length'];_0x46eb6a+=0x1){socket[_0x3b8a('0xbc')](_0x3b8a('0xbd'),{'UserId':Number(_0xc78390['body']['ids'][_0x46eb6a]),'MailAccountId':Number(_0xc78390[_0x3b8a('0x60')]['id'])});}return _0x555e1c;});}})[_0x3b8a('0x23')](respondWithResult(_0x10efd9,null))[_0x3b8a('0x18')](handleError(_0x10efd9,null));};exports[_0x3b8a('0xbe')]=function(_0xdc222f,_0x2b609f){return db[_0x3b8a('0x45')][_0x3b8a('0x63')]({'where':{'id':_0xdc222f[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0x2b609f,null))['then'](function(_0x2cbf4e){if(_0x2cbf4e){return _0x2cbf4e[_0x3b8a('0xbe')](_0xdc222f['query']['ids'])[_0x3b8a('0x23')](function(){if(_[_0x3b8a('0xbf')](_0xdc222f['query']['ids'])){for(var _0x5f3f98=0x0;_0x5f3f98<_0xdc222f[_0x3b8a('0x4b')][_0x3b8a('0x70')][_0x3b8a('0x62')];_0x5f3f98+=0x1){socket[_0x3b8a('0xbc')](_0x3b8a('0xc0'),{'UserId':Number(_0xdc222f[_0x3b8a('0x4b')][_0x3b8a('0x70')][_0x5f3f98]),'MailAccountId':Number(_0xdc222f[_0x3b8a('0x60')]['id'])});}}else{socket[_0x3b8a('0xbc')](_0x3b8a('0xc0'),{'UserId':Number(_0xdc222f[_0x3b8a('0x4b')][_0x3b8a('0x70')]),'MailAccountId':Number(_0xdc222f[_0x3b8a('0x60')]['id'])});}});}})[_0x3b8a('0x23')](respondWithStatusCode(_0x2b609f,null))[_0x3b8a('0x18')](handleError(_0x2b609f,null));};exports['getAgents']=function(_0x36651a,_0xa0df69){var _0x506e1e={};var _0x12572b={};var _0x5ab5e0;var _0x13d85b;return db[_0x3b8a('0x45')][_0x3b8a('0x6e')]({'where':{'id':_0x36651a[_0x3b8a('0x60')]['id']}})[_0x3b8a('0x23')](handleEntityNotFound(_0xa0df69,null))[_0x3b8a('0x23')](function(_0x5298d3){if(_0x5298d3){_0x5ab5e0=_0x5298d3;_0x12572b['model']=_['keys'](db[_0x3b8a('0x8a')][_0x3b8a('0x46')]);_0x12572b[_0x3b8a('0x4b')]=_[_0x3b8a('0x4c')](_0x36651a[_0x3b8a('0x4b')]);_0x12572b[_0x3b8a('0x4d')]=_[_0x3b8a('0x4e')](_0x12572b[_0x3b8a('0x4a')],_0x12572b['query']);_0x506e1e[_0x3b8a('0x50')]=_['intersection'](_0x12572b[_0x3b8a('0x4a')],qs['fields'](_0x36651a[_0x3b8a('0x4b')]['fields']));_0x506e1e[_0x3b8a('0x50')]=_0x506e1e['attributes'][_0x3b8a('0x62')]?_0x506e1e['attributes']:_0x12572b[_0x3b8a('0x4a')];_0x506e1e[_0x3b8a('0x53')]=qs[_0x3b8a('0x54')](_0x36651a[_0x3b8a('0x4b')][_0x3b8a('0x54')]);_0x506e1e['where']=qs[_0x3b8a('0x4d')](_[_0x3b8a('0x56')](_0x36651a[_0x3b8a('0x4b')],_0x12572b['filters']));if(_0x36651a[_0x3b8a('0x4b')]['filter']){_0x506e1e[_0x3b8a('0x55')]=_[_0x3b8a('0x58')](_0x506e1e['where'],{'$or':_[_0x3b8a('0x44')](_0x506e1e['attributes'],function(_0x5b2dfe){var _0x565736={};_0x565736[_0x5b2dfe]={'$like':'%'+_0x36651a[_0x3b8a('0x4b')][_0x3b8a('0x57')]+'%'};return _0x565736;})});}_0x506e1e=_['merge']({},_0x506e1e,_0x36651a[_0x3b8a('0x5a')]);return _0x5ab5e0['getAgents'](_0x506e1e);}})[_0x3b8a('0x23')](function(_0x15ec8a){if(_0x15ec8a){_0x13d85b=_0x15ec8a[_0x3b8a('0x62')];if(!_0x36651a[_0x3b8a('0x4b')]['hasOwnProperty'](_0x3b8a('0x52'))){_0x506e1e[_0x3b8a('0x1f')]=qs['limit'](_0x36651a[_0x3b8a('0x4b')][_0x3b8a('0x1f')]);_0x506e1e['offset']=qs[_0x3b8a('0x1d')](_0x36651a[_0x3b8a('0x4b')]['offset']);}return _0x5ab5e0['getAgents'](_0x506e1e);}})[_0x3b8a('0x23')](function(_0x263f83){if(_0x263f83){return _0x263f83?{'count':_0x13d85b,'rows':_0x263f83}:null;}})['then'](respondWithResult(_0xa0df69,null))[_0x3b8a('0x18')](handleError(_0xa0df69,null));}; \ No newline at end of file +var _0x7e4b=['active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','internal','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','finally','getApplications','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','root','basename','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','getSmtpOptions','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','User','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','count','limit','set','Content-Range','update','destroy','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','MailServerIn','MailServerOut','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','filter','removeDispositions','find','ids','getAnswers','CannedAnswer','removeAnswers','email','ListId'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x7e4b,0x106));var _0xb7e4=function(_0x4cff14,_0x9c3dc6){_0x4cff14=_0x4cff14-0x0;var _0x27e7fa=_0x7e4b[_0x4cff14];return _0x27e7fa;};'use strict';var moment=require(_0xb7e4('0x0'));var BPromise=require(_0xb7e4('0x1'));var util=require(_0xb7e4('0x2'));var path=require(_0xb7e4('0x3'));var _=require(_0xb7e4('0x4'));var juice=require(_0xb7e4('0x5'));var Redis=require(_0xb7e4('0x6'));var qs=require(_0xb7e4('0x7'));var logger=require('../../config/logger')(_0xb7e4('0x8'));var config=require(_0xb7e4('0x9'));var db=require(_0xb7e4('0xa'))['db'];config[_0xb7e4('0xb')]=_[_0xb7e4('0xc')](config[_0xb7e4('0xb')],{'host':_0xb7e4('0xd'),'port':0x18eb});var socket=require(_0xb7e4('0xe'))(new Redis(config[_0xb7e4('0xb')]));require('./mailAccount.socket')[_0xb7e4('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb7e4('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x5eccb3,_0x40d847,_0x38a970,_0x1240f5){return new BPromise(function(_0x237c44,_0x2433e3){var _0x259ba5=_0x1240f5||client;return _0x259ba5[_0xb7e4('0x11')](_0x5eccb3,_0x38a970)[_0xb7e4('0x12')](function(_0xccf04){logger[_0xb7e4('0x13')](_0xb7e4('0x14'),_0x40d847,_0xb7e4('0x15'));logger[_0xb7e4('0x16')](_0xb7e4('0x17'),_0x40d847,'request\x20sent',JSON[_0xb7e4('0x18')](_0xccf04));if(_0xccf04[_0xb7e4('0x19')]){if(_0xccf04[_0xb7e4('0x19')][_0xb7e4('0x1a')]===0x1f4){logger[_0xb7e4('0x19')](_0xb7e4('0x14'),_0x40d847,_0xccf04[_0xb7e4('0x19')][_0xb7e4('0x1b')]);return _0x2433e3(_0xccf04[_0xb7e4('0x19')][_0xb7e4('0x1b')]);}logger[_0xb7e4('0x19')]('MailAccount,\x20%s,\x20%s',_0x40d847,_0xccf04[_0xb7e4('0x19')][_0xb7e4('0x1b')]);return _0x237c44(_0xccf04[_0xb7e4('0x19')]['message']);}else{logger[_0xb7e4('0x13')]('MailAccount,\x20%s,\x20%s',_0x40d847,_0xb7e4('0x15'));_0x237c44(_0xccf04['result']['message']);}})[_0xb7e4('0x1c')](function(_0x5c4813){logger[_0xb7e4('0x19')]('MailAccount,\x20%s,\x20%s',_0x40d847,_0x5c4813);_0x2433e3(_0x5c4813);});});}function respondWithStatusCode(_0x42f442,_0x112790){_0x112790=_0x112790||0xcc;return function(_0xcb8df9){if(_0xcb8df9){return _0x42f442[_0xb7e4('0x1d')](_0x112790);}return _0x42f442[_0xb7e4('0x1e')](_0x112790)[_0xb7e4('0x1f')]();};}function respondWithResult(_0x7ccbcf,_0x4e47f0){_0x4e47f0=_0x4e47f0||0xc8;return function(_0xdf9570){if(_0xdf9570){return _0x7ccbcf[_0xb7e4('0x1e')](_0x4e47f0)[_0xb7e4('0x20')](_0xdf9570);}};}function respondWithFilteredResult(_0x39dc15,_0x4810e3){return function(_0x1dc9b0){if(_0x1dc9b0){var _0x3a01c1=typeof _0x4810e3[_0xb7e4('0x21')]==='undefined'&&typeof _0x4810e3['limit']==='undefined';var _0x83020d=_0x1dc9b0[_0xb7e4('0x22')];var _0x451d26=_0x3a01c1?0x0:_0x4810e3['offset'];var _0x330401=_0x3a01c1?_0x1dc9b0[_0xb7e4('0x22')]:_0x4810e3[_0xb7e4('0x21')]+_0x4810e3[_0xb7e4('0x23')];var _0x2d5388;if(_0x330401>=_0x83020d){_0x330401=_0x83020d;_0x2d5388=0xc8;}else{_0x2d5388=0xce;}_0x39dc15[_0xb7e4('0x1e')](_0x2d5388);return _0x39dc15[_0xb7e4('0x24')](_0xb7e4('0x25'),_0x451d26+'-'+_0x330401+'/'+_0x83020d)[_0xb7e4('0x20')](_0x1dc9b0);}return null;};}function saveUpdates(_0x292913){return function(_0x2c6feb){if(_0x2c6feb){return _0x2c6feb[_0xb7e4('0x26')](_0x292913)[_0xb7e4('0x12')](function(_0x142c6c){return _0x142c6c;});}return null;};}function removeEntity(_0x4296ec){return function(_0x5635dd){if(_0x5635dd){return _0x5635dd[_0xb7e4('0x27')]()[_0xb7e4('0x12')](function(){var _0x5ac20f=_0x5635dd['get']({'plain':!![]});var _0x579b76=_0xb7e4('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x579b76,'resourceId':_0x5ac20f['id']}})[_0xb7e4('0x12')](function(){return _0x5635dd;});})['then'](function(){_0x4296ec[_0xb7e4('0x1e')](0xcc)[_0xb7e4('0x1f')]();});}};}function handleEntityNotFound(_0x1983fd){return function(_0x58cf97){if(!_0x58cf97){_0x1983fd[_0xb7e4('0x1d')](0x194);}return _0x58cf97;};}function handleError(_0x483238,_0x36e5a9){_0x36e5a9=_0x36e5a9||0x1f4;return function(_0xa43a9d){logger[_0xb7e4('0x19')](_0xa43a9d[_0xb7e4('0x29')]);if(_0xa43a9d[_0xb7e4('0x2a')]){delete _0xa43a9d['name'];}_0x483238[_0xb7e4('0x1e')](_0x36e5a9)[_0xb7e4('0x2b')](_0xa43a9d);};}function getImapHost(_0x1728c7){switch(_0x1728c7){case _0xb7e4('0x2c'):return _0xb7e4('0x2d');case _0xb7e4('0x2e'):return'imap.mail.yahoo.com';case _0xb7e4('0x2f'):return _0xb7e4('0x30');case _0xb7e4('0x31'):return _0xb7e4('0x32');}throw new Error(_0xb7e4('0x33'),_0x1728c7);}function getSmtpHost(_0x3cb1c0){switch(_0x3cb1c0){case'gmail':return'smtp.gmail.com';case _0xb7e4('0x2e'):return _0xb7e4('0x34');case _0xb7e4('0x2f'):return'smtp-mail.outlook.com';case'outlook365':return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x3cb1c0);}function getAuthenticationOptions(_0x228eee,_0x238dc9){var _0x44608b={};var _0x2adfd1={};if(_0x228eee){_0x44608b[_0xb7e4('0x35')]=_0x2adfd1['user']=_0x238dc9['username'];_0x44608b[_0xb7e4('0x36')]=_0x2adfd1[_0xb7e4('0x37')]=_0x238dc9[_0xb7e4('0x36')];if(_0x238dc9[_0xb7e4('0x38')]){_0x44608b['modernAuthentication']=_0x2adfd1[_0xb7e4('0x38')]=!![];_0x44608b['CloudProviderId']=_0x2adfd1[_0xb7e4('0x39')]=_0x238dc9[_0xb7e4('0x39')];_0x44608b[_0xb7e4('0x36')]=_0x2adfd1[_0xb7e4('0x37')]=null;}else{_0x44608b[_0xb7e4('0x39')]=_0x2adfd1['CloudProviderId']=null;}_0x44608b['host']=getImapHost(_0x228eee);_0x44608b['port']=0x3e1;_0x2adfd1[_0xb7e4('0x3a')]=getSmtpHost(_0x228eee);_0x2adfd1[_0xb7e4('0x3b')]=0x24b;_0x2adfd1[_0xb7e4('0x3c')]=![];_0x44608b[_0xb7e4('0x3d')]=_0x2adfd1[_0xb7e4('0x3d')]=null;}else{if(_0x238dc9[_0xb7e4('0x3e')]){_0x44608b[_0xb7e4('0x35')]=_0x2adfd1[_0xb7e4('0x35')]=_0x238dc9['username'];_0x44608b[_0xb7e4('0x36')]=_0x2adfd1[_0xb7e4('0x37')]=_0x238dc9[_0xb7e4('0x36')];}else{_0x44608b[_0xb7e4('0x3e')]=_0x2adfd1['authentication']=![];_0x44608b[_0xb7e4('0x35')]=_0x2adfd1[_0xb7e4('0x35')]=null;_0x44608b['password']=_0x2adfd1[_0xb7e4('0x37')]=null;}_0x44608b['host']=_0x238dc9[_0xb7e4('0x3f')][_0xb7e4('0x3a')];_0x44608b[_0xb7e4('0x3b')]=_0x238dc9[_0xb7e4('0x3f')][_0xb7e4('0x3b')];_0x2adfd1[_0xb7e4('0x3a')]=_0x238dc9[_0xb7e4('0x40')]['host'];_0x2adfd1['port']=_0x238dc9[_0xb7e4('0x40')][_0xb7e4('0x3b')];}return{'Imap':_0x44608b,'Smtp':_0x2adfd1};}exports[_0xb7e4('0x41')]=function(_0x5b8ec8,_0x1eda45){var _0x46b02f={'include':[{'model':db['MailServerIn'],'as':_0xb7e4('0x3f')},{'model':db['MailServerOut'],'as':_0xb7e4('0x40')},{'model':db[_0xb7e4('0x42')],'as':_0xb7e4('0x43')}]},_0x249586={},_0x39a801={'count':0x0,'rows':[]};var _0x4440c2=_[_0xb7e4('0x44')](db[_0xb7e4('0x45')][_0xb7e4('0x46')],function(_0x24d302){return{'name':_0x24d302['fieldName'],'type':_0x24d302[_0xb7e4('0x47')][_0xb7e4('0x48')]};});_0x249586[_0xb7e4('0x49')]=_[_0xb7e4('0x44')](_0x4440c2,'name');_0x249586[_0xb7e4('0x4a')]=_[_0xb7e4('0x4b')](_0x5b8ec8['query']);_0x249586[_0xb7e4('0x4c')]=_[_0xb7e4('0x4d')](_0x249586['model'],_0x249586[_0xb7e4('0x4a')]);_0x46b02f[_0xb7e4('0x4e')]=_[_0xb7e4('0x4d')](_0x249586[_0xb7e4('0x49')],qs[_0xb7e4('0x4f')](_0x5b8ec8['query'][_0xb7e4('0x4f')]));_0x46b02f[_0xb7e4('0x4e')]=_0x46b02f['attributes'][_0xb7e4('0x50')]?_0x46b02f['attributes']:_0x249586[_0xb7e4('0x49')];if(!_0x5b8ec8[_0xb7e4('0x4a')][_0xb7e4('0x51')](_0xb7e4('0x52'))){_0x46b02f[_0xb7e4('0x23')]=qs[_0xb7e4('0x23')](_0x5b8ec8[_0xb7e4('0x4a')][_0xb7e4('0x23')]);_0x46b02f[_0xb7e4('0x21')]=qs['offset'](_0x5b8ec8['query'][_0xb7e4('0x21')]);}_0x46b02f[_0xb7e4('0x53')]=qs['sort'](_0x5b8ec8[_0xb7e4('0x4a')][_0xb7e4('0x54')]);_0x46b02f[_0xb7e4('0x55')]=qs[_0xb7e4('0x4c')](_[_0xb7e4('0x56')](_0x5b8ec8[_0xb7e4('0x4a')],_0x249586['filters']),_0x4440c2);if(_0x5b8ec8[_0xb7e4('0x4a')]['filter']){_0x46b02f[_0xb7e4('0x55')]=_[_0xb7e4('0x57')](_0x46b02f['where'],{'$or':_[_0xb7e4('0x44')](_0x4440c2,function(_0x4b380c){if(_0x4b380c[_0xb7e4('0x47')]!==_0xb7e4('0x58')){var _0x567440={};_0x567440[_0x4b380c[_0xb7e4('0x2a')]]={'$like':'%'+_0x5b8ec8[_0xb7e4('0x4a')]['filter']+'%'};return _0x567440;}})});}_0x46b02f=_['merge']({},_0x46b02f,_0x5b8ec8[_0xb7e4('0x59')]);var _0x5957d3={'where':_0x46b02f[_0xb7e4('0x55')]};return db['MailAccount'][_0xb7e4('0x22')](_0x5957d3)[_0xb7e4('0x12')](function(_0xf71ec4){_0x39a801[_0xb7e4('0x22')]=_0xf71ec4;if(_0x5b8ec8[_0xb7e4('0x4a')][_0xb7e4('0x5a')]){_0x46b02f[_0xb7e4('0x5b')]=[{'all':!![]}];}return db[_0xb7e4('0x45')][_0xb7e4('0x5c')](_0x46b02f);})[_0xb7e4('0x12')](function(_0x1f6c68){_0x39a801[_0xb7e4('0x5d')]=_0x1f6c68;return _0x39a801;})[_0xb7e4('0x12')](respondWithFilteredResult(_0x1eda45,_0x46b02f))[_0xb7e4('0x1c')](handleError(_0x1eda45,null));};exports[_0xb7e4('0x5e')]=function(_0x5083b8,_0x4a78c6){var _0x1392c6={'raw':![],'where':{'id':_0x5083b8[_0xb7e4('0x5f')]['id']},'include':[{'model':db[_0xb7e4('0x60')],'as':_0xb7e4('0x3f')},{'model':db[_0xb7e4('0x61')],'as':'Smtp'},{'model':db[_0xb7e4('0x42')],'as':_0xb7e4('0x43')}]},_0x5eb412={};_0x5eb412[_0xb7e4('0x49')]=_[_0xb7e4('0x4b')](db[_0xb7e4('0x45')][_0xb7e4('0x46')]);_0x5eb412['query']=_[_0xb7e4('0x4b')](_0x5083b8[_0xb7e4('0x4a')]);_0x5eb412[_0xb7e4('0x4c')]=_['intersection'](_0x5eb412[_0xb7e4('0x49')],_0x5eb412[_0xb7e4('0x4a')]);_0x1392c6[_0xb7e4('0x4e')]=_[_0xb7e4('0x4d')](_0x5eb412['model'],qs['fields'](_0x5083b8[_0xb7e4('0x4a')][_0xb7e4('0x4f')]));_0x1392c6[_0xb7e4('0x4e')]=_0x1392c6[_0xb7e4('0x4e')]['length']?_0x1392c6['attributes']:_0x5eb412[_0xb7e4('0x49')];if(_0x5083b8[_0xb7e4('0x4a')][_0xb7e4('0x5a')]){_0x1392c6['include']=[{'all':!![]}];}_0x1392c6=_[_0xb7e4('0x57')]({},_0x1392c6,_0x5083b8[_0xb7e4('0x59')]);return db[_0xb7e4('0x45')]['find'](_0x1392c6)['then'](handleEntityNotFound(_0x4a78c6,null))[_0xb7e4('0x12')](respondWithResult(_0x4a78c6,null))[_0xb7e4('0x1c')](handleError(_0x4a78c6,null));};exports[_0xb7e4('0x26')]=function(_0x3b5d5b,_0x2558b7){if(_0x3b5d5b[_0xb7e4('0x62')]['id']){delete _0x3b5d5b[_0xb7e4('0x62')]['id'];}var _0x5a97ae=_0x3b5d5b['body'][_0xb7e4('0x63')]===_0xb7e4('0x64')?null:_0x3b5d5b[_0xb7e4('0x62')][_0xb7e4('0x63')];var _0x104085=_0x3b5d5b[_0xb7e4('0x62')][_0xb7e4('0x3f')]||{};var _0x2009c4=_0x3b5d5b[_0xb7e4('0x62')][_0xb7e4('0x40')]||{};if(_0x5a97ae){_0x104085[_0xb7e4('0x3a')]=getImapHost(_0x5a97ae);_0x104085[_0xb7e4('0x3b')]=0x3e1;_0x2009c4[_0xb7e4('0x3a')]=getSmtpHost(_0x5a97ae);_0x2009c4[_0xb7e4('0x3b')]=0x24b;_0x2009c4['secure']=![];}if(_0x2009c4[_0xb7e4('0x38')]){_0x2009c4[_0xb7e4('0x3c')]=![];}else{_0x2009c4[_0xb7e4('0x39')]=null;}if(!_0x104085['modernAuthentication'])_0x104085[_0xb7e4('0x39')]=null;_0x3b5d5b['body'][_0xb7e4('0x3f')]=_0x104085;_0x3b5d5b[_0xb7e4('0x62')][_0xb7e4('0x40')]=_0x2009c4;return db[_0xb7e4('0x45')]['find']({'where':{'id':_0x3b5d5b['params']['id']},'include':[{'model':db[_0xb7e4('0x60')],'as':_0xb7e4('0x3f')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0xb7e4('0x43')}]})[_0xb7e4('0x12')](handleEntityNotFound(_0x2558b7,null))[_0xb7e4('0x12')](function(_0x962b76){if(!_0x962b76)throw new Error(_0xb7e4('0x65'));if(_0x962b76['service'])delete _0x3b5d5b[_0xb7e4('0x62')]['Imap'];return _0x962b76;})[_0xb7e4('0x12')](saveUpdates(_0x3b5d5b[_0xb7e4('0x62')],null))[_0xb7e4('0x12')](function(_0x52dcd6){if(!_0x3b5d5b[_0xb7e4('0x62')][_0xb7e4('0x3f')])return _0x52dcd6;return db[_0xb7e4('0x60')]['update'](_0x3b5d5b[_0xb7e4('0x62')]['Imap'],{'where':{'MailAccountId':_0x52dcd6['id']}})['then'](function(){return _0x52dcd6;});})[_0xb7e4('0x12')](function(_0x127fcf){if(!_0x3b5d5b['body'][_0xb7e4('0x40')])return _0x127fcf;return db[_0xb7e4('0x61')][_0xb7e4('0x26')](_0x3b5d5b[_0xb7e4('0x62')][_0xb7e4('0x40')],{'where':{'MailAccountId':_0x127fcf['id']}})[_0xb7e4('0x12')](function(){return _0x127fcf;});})[_0xb7e4('0x12')](respondWithResult(_0x2558b7,null))['catch'](handleError(_0x2558b7,null));};exports[_0xb7e4('0x66')]=function(_0x17317e,_0x1497a2){return db[_0xb7e4('0x45')][_0xb7e4('0x66')]()[_0xb7e4('0x12')](respondWithResult(_0x1497a2,null))['catch'](handleError(_0x1497a2,null));};exports[_0xb7e4('0x67')]=function(_0x504fca,_0x44982f){if(_0x504fca['body']['id']){delete _0x504fca[_0xb7e4('0x62')]['id'];}return db[_0xb7e4('0x45')]['find']({'where':{'id':_0x504fca[_0xb7e4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x44982f,null))[_0xb7e4('0x12')](function(_0x18ebaf){if(_0x18ebaf){_0x504fca[_0xb7e4('0x62')][_0xb7e4('0x68')]=_0x18ebaf['id'];return db[_0xb7e4('0x69')][_0xb7e4('0x6a')](_0x504fca[_0xb7e4('0x62')]);}})['then'](respondWithResult(_0x44982f,null))[_0xb7e4('0x1c')](handleError(_0x44982f,null));};exports[_0xb7e4('0x6b')]=function(_0x3b74a8,_0x21e34c){var _0x454eab={'raw':![],'where':{}};var _0x3fed3d={};var _0x2a3026={'count':0x0,'rows':[]};return db['MailAccount'][_0xb7e4('0x6c')]({'where':{'id':_0x3b74a8['params']['id']}})['then'](handleEntityNotFound(_0x21e34c,null))['then'](function(_0x3fe83c){if(_0x3fe83c){_0x3fed3d['model']=_['keys'](db[_0xb7e4('0x69')]['rawAttributes']);_0x3fed3d['query']=_[_0xb7e4('0x4b')](_0x3b74a8[_0xb7e4('0x4a')]);_0x3fed3d['filters']=_[_0xb7e4('0x4d')](_0x3fed3d[_0xb7e4('0x49')],_0x3fed3d['query']);_0x454eab[_0xb7e4('0x4e')]=_[_0xb7e4('0x4d')](_0x3fed3d[_0xb7e4('0x49')],qs[_0xb7e4('0x4f')](_0x3b74a8['query'][_0xb7e4('0x4f')]));_0x454eab[_0xb7e4('0x4e')]=_0x454eab[_0xb7e4('0x4e')][_0xb7e4('0x50')]?_0x454eab[_0xb7e4('0x4e')]:_0x3fed3d[_0xb7e4('0x49')];if(!_0x3b74a8['query'][_0xb7e4('0x51')](_0xb7e4('0x52'))){_0x454eab['limit']=qs[_0xb7e4('0x23')](_0x3b74a8['query'][_0xb7e4('0x23')]);_0x454eab[_0xb7e4('0x21')]=qs[_0xb7e4('0x21')](_0x3b74a8[_0xb7e4('0x4a')][_0xb7e4('0x21')]);}_0x454eab['order']=qs[_0xb7e4('0x54')](_0x3b74a8['query'][_0xb7e4('0x54')]);_0x454eab[_0xb7e4('0x55')]=qs[_0xb7e4('0x4c')](_[_0xb7e4('0x56')](_0x3b74a8[_0xb7e4('0x4a')],_0x3fed3d[_0xb7e4('0x4c')]));_0x454eab[_0xb7e4('0x55')]['MailAccountId']=_0x3fe83c['id'];if(_0x3b74a8[_0xb7e4('0x4a')][_0xb7e4('0x6d')]){_0x454eab[_0xb7e4('0x55')]=_['merge'](_0x454eab['where'],{'$or':_['map'](_0x454eab[_0xb7e4('0x4e')],function(_0x41d221){var _0x4395a1={};_0x4395a1[_0x41d221]={'$like':'%'+_0x3b74a8[_0xb7e4('0x4a')][_0xb7e4('0x6d')]+'%'};return _0x4395a1;})});}_0x454eab=_['merge']({},_0x454eab,_0x3b74a8[_0xb7e4('0x59')]);return db[_0xb7e4('0x69')][_0xb7e4('0x22')]({'where':_0x454eab[_0xb7e4('0x55')]})['then'](function(_0x300a96){_0x2a3026[_0xb7e4('0x22')]=_0x300a96;if(_0x3b74a8[_0xb7e4('0x4a')][_0xb7e4('0x5a')]){_0x454eab['include']=[{'all':!![]}];}return db[_0xb7e4('0x69')][_0xb7e4('0x5c')](_0x454eab);})[_0xb7e4('0x12')](function(_0x4d50ee){_0x2a3026[_0xb7e4('0x5d')]=_0x4d50ee;return _0x2a3026;});}})[_0xb7e4('0x12')](respondWithFilteredResult(_0x21e34c,_0x454eab))[_0xb7e4('0x1c')](handleError(_0x21e34c,null));};exports[_0xb7e4('0x6e')]=function(_0xa0b002,_0x4f1f90){return db[_0xb7e4('0x45')][_0xb7e4('0x6f')]({'where':{'id':_0xa0b002[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x4f1f90,null))[_0xb7e4('0x12')](function(_0x1c0e7b){if(_0x1c0e7b){return _0x1c0e7b[_0xb7e4('0x6e')](_0xa0b002[_0xb7e4('0x4a')][_0xb7e4('0x70')]);}})[_0xb7e4('0x12')](respondWithStatusCode(_0x4f1f90,null))[_0xb7e4('0x1c')](handleError(_0x4f1f90,null));};exports['addAnswer']=function(_0x4b854e,_0x2d96c1){if(_0x4b854e[_0xb7e4('0x62')]['id']){delete _0x4b854e[_0xb7e4('0x62')]['id'];}return db[_0xb7e4('0x45')]['find']({'where':{'id':_0x4b854e[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x2d96c1,null))[_0xb7e4('0x12')](function(_0x99fef7){if(_0x99fef7){_0x4b854e['body']['MailAccountId']=_0x99fef7['id'];return db['CannedAnswer'][_0xb7e4('0x6a')](_0x4b854e[_0xb7e4('0x62')]);}})[_0xb7e4('0x12')](respondWithResult(_0x2d96c1,null))[_0xb7e4('0x1c')](handleError(_0x2d96c1,null));};exports[_0xb7e4('0x71')]=function(_0x1356ab,_0x4f7d23){var _0x4d16a9={'raw':![],'where':{}};var _0x3e34c2={};var _0x4d9a57={'count':0x0,'rows':[]};return db[_0xb7e4('0x45')][_0xb7e4('0x6c')]({'where':{'id':_0x1356ab[_0xb7e4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4f7d23,null))[_0xb7e4('0x12')](function(_0x95abff){if(_0x95abff){_0x3e34c2[_0xb7e4('0x49')]=_[_0xb7e4('0x4b')](db[_0xb7e4('0x72')][_0xb7e4('0x46')]);_0x3e34c2['query']=_[_0xb7e4('0x4b')](_0x1356ab[_0xb7e4('0x4a')]);_0x3e34c2[_0xb7e4('0x4c')]=_[_0xb7e4('0x4d')](_0x3e34c2[_0xb7e4('0x49')],_0x3e34c2[_0xb7e4('0x4a')]);_0x4d16a9['attributes']=_['intersection'](_0x3e34c2[_0xb7e4('0x49')],qs[_0xb7e4('0x4f')](_0x1356ab['query'][_0xb7e4('0x4f')]));_0x4d16a9['attributes']=_0x4d16a9[_0xb7e4('0x4e')][_0xb7e4('0x50')]?_0x4d16a9[_0xb7e4('0x4e')]:_0x3e34c2[_0xb7e4('0x49')];if(!_0x1356ab['query'][_0xb7e4('0x51')](_0xb7e4('0x52'))){_0x4d16a9[_0xb7e4('0x23')]=qs[_0xb7e4('0x23')](_0x1356ab['query']['limit']);_0x4d16a9[_0xb7e4('0x21')]=qs[_0xb7e4('0x21')](_0x1356ab['query']['offset']);}_0x4d16a9[_0xb7e4('0x53')]=qs[_0xb7e4('0x54')](_0x1356ab[_0xb7e4('0x4a')][_0xb7e4('0x54')]);_0x4d16a9[_0xb7e4('0x55')]=qs[_0xb7e4('0x4c')](_[_0xb7e4('0x56')](_0x1356ab[_0xb7e4('0x4a')],_0x3e34c2['filters']));_0x4d16a9[_0xb7e4('0x55')][_0xb7e4('0x68')]=_0x95abff['id'];if(_0x1356ab[_0xb7e4('0x4a')][_0xb7e4('0x6d')]){_0x4d16a9[_0xb7e4('0x55')]=_['merge'](_0x4d16a9[_0xb7e4('0x55')],{'$or':_[_0xb7e4('0x44')](_0x4d16a9[_0xb7e4('0x4e')],function(_0x5eb796){var _0x1d94c4={};_0x1d94c4[_0x5eb796]={'$like':'%'+_0x1356ab[_0xb7e4('0x4a')]['filter']+'%'};return _0x1d94c4;})});}_0x4d16a9=_[_0xb7e4('0x57')]({},_0x4d16a9,_0x1356ab['options']);return db[_0xb7e4('0x72')][_0xb7e4('0x22')]({'where':_0x4d16a9[_0xb7e4('0x55')]})[_0xb7e4('0x12')](function(_0x131581){_0x4d9a57['count']=_0x131581;if(_0x1356ab[_0xb7e4('0x4a')][_0xb7e4('0x5a')]){_0x4d16a9[_0xb7e4('0x5b')]=[{'all':!![]}];}return db[_0xb7e4('0x72')]['findAll'](_0x4d16a9);})['then'](function(_0x2eeba4){_0x4d9a57[_0xb7e4('0x5d')]=_0x2eeba4;return _0x4d9a57;});}})[_0xb7e4('0x12')](respondWithFilteredResult(_0x4f7d23,_0x4d16a9))[_0xb7e4('0x1c')](handleError(_0x4f7d23,null));};exports[_0xb7e4('0x73')]=function(_0x5b0dc5,_0x5c4a9e){return db['MailAccount'][_0xb7e4('0x6f')]({'where':{'id':_0x5b0dc5[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x5c4a9e,null))[_0xb7e4('0x12')](function(_0x470bbb){if(_0x470bbb){return _0x470bbb[_0xb7e4('0x73')](_0x5b0dc5[_0xb7e4('0x4a')][_0xb7e4('0x70')]);}})['then'](respondWithStatusCode(_0x5c4a9e,null))['catch'](handleError(_0x5c4a9e,null));};exports[_0xb7e4('0x6a')]=function(_0x14226c,_0x80e345){var _0x494955={'name':_0x14226c['body']['name'],'key':_0x14226c[_0xb7e4('0x62')][_0xb7e4('0x48')],'provider':_0x14226c['body'][_0xb7e4('0x63')]===_0xb7e4('0x64')?null:_0x14226c[_0xb7e4('0x62')][_0xb7e4('0x63')],'email':_0x14226c['body'][_0xb7e4('0x74')],'ListId':_0x14226c['body'][_0xb7e4('0x75')],'active':!_['isNil'](_0x14226c[_0xb7e4('0x62')][_0xb7e4('0x76')])?_0x14226c['body']['active']:!![],'description':_0x14226c[_0xb7e4('0x62')][_0xb7e4('0x77')]||null};var _0x281d8a=getAuthenticationOptions(_0x494955[_0xb7e4('0x63')],_0x14226c[_0xb7e4('0x62')]);_0x494955[_0xb7e4('0x3f')]=_0x281d8a[_0xb7e4('0x3f')];_0x494955[_0xb7e4('0x40')]=_0x281d8a[_0xb7e4('0x40')];return db['MailAccount'][_0xb7e4('0x6a')](_0x494955,{'include':[{'model':db['MailServerOut'],'as':_0xb7e4('0x40')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xb7e4('0x12')](function(_0x4750c5){var _0x1c120d=_0x14226c[_0xb7e4('0x35')][_0xb7e4('0x78')]({'plain':!![]});if(!_0x1c120d)throw new Error(_0xb7e4('0x79'));if(_0x1c120d[_0xb7e4('0x7a')]===_0xb7e4('0x35')){var _0x40de5d=_0x4750c5[_0xb7e4('0x78')]({'plain':!![]});return db[_0xb7e4('0x7b')][_0xb7e4('0x6f')]({'where':{'name':_0xb7e4('0x28'),'userProfileId':_0x1c120d['userProfileId']},'raw':!![]})[_0xb7e4('0x12')](function(_0x3d0db0){if(_0x3d0db0&&_0x3d0db0['autoAssociation']===0x0){return db[_0xb7e4('0x7c')][_0xb7e4('0x6a')]({'name':_0x40de5d[_0xb7e4('0x2a')],'resourceId':_0x40de5d['id'],'type':_0x3d0db0[_0xb7e4('0x2a')],'sectionId':_0x3d0db0['id']},{})[_0xb7e4('0x12')](function(){return _0x4750c5;});}else{return _0x4750c5;}})[_0xb7e4('0x1c')](function(_0x43ebac){logger[_0xb7e4('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43ebac);throw _0x43ebac;});}return _0x4750c5;})['then'](respondWithResult(_0x80e345,0xc9))[_0xb7e4('0x1c')](handleError(_0x80e345,null));};exports[_0xb7e4('0x7d')]=function(_0x3ea358,_0x32fe16){return db['MailAccount'][_0xb7e4('0x6c')]({'where':{'id':_0x3ea358['params']['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x32fe16,null))['then'](function(_0x370555){if(_0x370555){return _0x370555[_0xb7e4('0x7d')]();}return null;})['then'](respondWithResult(_0x32fe16,null))['catch'](handleError(_0x32fe16,null));};exports['addImap']=function(_0x21c327,_0x5c64cc){if(_0x21c327[_0xb7e4('0x62')]['id']){delete _0x21c327[_0xb7e4('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x21c327[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x5c64cc,null))[_0xb7e4('0x12')](function(_0x3c0f09){if(_0x3c0f09){_0x21c327[_0xb7e4('0x62')][_0xb7e4('0x68')]=_0x3c0f09['id'];return db[_0xb7e4('0x60')][_0xb7e4('0x6a')](_0x21c327[_0xb7e4('0x62')]);}})[_0xb7e4('0x12')](respondWithResult(_0x5c64cc,null))[_0xb7e4('0x1c')](handleError(_0x5c64cc,null));};exports[_0xb7e4('0x7e')]=function(_0x41bba1,_0x4ec97c){return db[_0xb7e4('0x45')][_0xb7e4('0x6c')]({'where':{'id':_0x41bba1[_0xb7e4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4ec97c,null))[_0xb7e4('0x12')](function(_0x22a61c){if(_0x22a61c){return _0x22a61c[_0xb7e4('0x7f')](null);}return null;})[_0xb7e4('0x12')](respondWithStatusCode(_0x4ec97c,null))[_0xb7e4('0x1c')](handleError(_0x4ec97c,null));};exports[_0xb7e4('0x80')]=function(_0x14f7f0,_0x1d4613){return db[_0xb7e4('0x45')]['findOne']({'where':{'id':_0x14f7f0[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x1d4613,null))[_0xb7e4('0x12')](function(_0x20ae95){if(_0x20ae95){return _0x20ae95[_0xb7e4('0x80')]();}return null;})[_0xb7e4('0x12')](respondWithResult(_0x1d4613,null))[_0xb7e4('0x1c')](handleError(_0x1d4613,null));};exports[_0xb7e4('0x81')]=function(_0x362229,_0x5c83af){if(_0x362229[_0xb7e4('0x62')]['id']){delete _0x362229[_0xb7e4('0x62')]['id'];}return db[_0xb7e4('0x45')][_0xb7e4('0x6f')]({'where':{'id':_0x362229[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x5c83af,null))[_0xb7e4('0x12')](function(_0x41927f){if(_0x41927f){_0x362229[_0xb7e4('0x62')][_0xb7e4('0x68')]=_0x41927f['id'];return db[_0xb7e4('0x61')]['create'](_0x362229[_0xb7e4('0x62')]);}})[_0xb7e4('0x12')](respondWithResult(_0x5c83af,null))[_0xb7e4('0x1c')](handleError(_0x5c83af,null));};exports[_0xb7e4('0x82')]=function(_0x5d75f5,_0x3d354d){return db[_0xb7e4('0x45')]['findOne']({'where':{'id':_0x5d75f5['params']['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x3d354d,null))['then'](function(_0x2b9e38){if(_0x2b9e38){return _0x2b9e38['setSmtp'](null);}return null;})[_0xb7e4('0x12')](respondWithStatusCode(_0x3d354d,null))['catch'](handleError(_0x3d354d,null));};exports[_0xb7e4('0x83')]=function(_0x231e90,_0xd6f335){return db[_0xb7e4('0x84')][_0xb7e4('0x6f')]({'where':{'id':_0x231e90[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0xd6f335,null))[_0xb7e4('0x12')](function(_0x5ed0e2){if(_0x5ed0e2){return _0x5ed0e2[_0xb7e4('0x83')](_0x231e90[_0xb7e4('0x62')]['ids'],_[_0xb7e4('0x85')](_0x231e90[_0xb7e4('0x62')],[_0xb7e4('0x70'),'id'])||{});}})[_0xb7e4('0x12')](respondWithResult(_0xd6f335,null))[_0xb7e4('0x1c')](handleError(_0xd6f335,null));};exports[_0xb7e4('0x86')]=function(_0x35421d,_0x39daa9){var _0x22f531={'raw':![],'where':{}};var _0xf6b3e1={};var _0x4bc41a={'count':0x0,'rows':[]};return db[_0xb7e4('0x45')][_0xb7e4('0x6c')]({'where':{'id':_0x35421d[_0xb7e4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x39daa9,null))[_0xb7e4('0x12')](function(_0x30bfc4){if(_0x30bfc4){_0xf6b3e1[_0xb7e4('0x49')]=_[_0xb7e4('0x4b')](db['MailInteraction'][_0xb7e4('0x46')]);_0xf6b3e1['query']=_[_0xb7e4('0x4b')](_0x35421d[_0xb7e4('0x4a')]);_0xf6b3e1[_0xb7e4('0x4c')]=_[_0xb7e4('0x4d')](_0xf6b3e1[_0xb7e4('0x49')],_0xf6b3e1['query']);_0x22f531[_0xb7e4('0x4e')]=_['intersection'](_0xf6b3e1[_0xb7e4('0x49')],qs[_0xb7e4('0x4f')](_0x35421d[_0xb7e4('0x4a')][_0xb7e4('0x4f')]));_0x22f531[_0xb7e4('0x4e')]=_0x22f531[_0xb7e4('0x4e')][_0xb7e4('0x50')]?_0x22f531[_0xb7e4('0x4e')]:_0xf6b3e1[_0xb7e4('0x49')];if(!_0x35421d[_0xb7e4('0x4a')][_0xb7e4('0x51')](_0xb7e4('0x52'))){_0x22f531[_0xb7e4('0x23')]=qs[_0xb7e4('0x23')](_0x35421d[_0xb7e4('0x4a')]['limit']);_0x22f531[_0xb7e4('0x21')]=qs[_0xb7e4('0x21')](_0x35421d['query'][_0xb7e4('0x21')]);}_0x22f531[_0xb7e4('0x53')]=qs[_0xb7e4('0x54')](_0x35421d[_0xb7e4('0x4a')][_0xb7e4('0x54')]);_0x22f531[_0xb7e4('0x55')]=qs[_0xb7e4('0x4c')](_[_0xb7e4('0x56')](_0x35421d[_0xb7e4('0x4a')],_0xf6b3e1[_0xb7e4('0x4c')]));_0x22f531[_0xb7e4('0x55')][_0xb7e4('0x68')]=_0x30bfc4['id'];if(_0x35421d[_0xb7e4('0x4a')]['filter']){_0x22f531[_0xb7e4('0x55')]=_[_0xb7e4('0x57')](_0x22f531['where'],{'$or':_[_0xb7e4('0x44')](_0x22f531[_0xb7e4('0x4e')],function(_0x46fa62){var _0x377dc0={};_0x377dc0[_0x46fa62]={'$like':'%'+_0x35421d['query'][_0xb7e4('0x6d')]+'%'};return _0x377dc0;})});}_0x22f531=_[_0xb7e4('0x57')]({},_0x22f531,_0x35421d[_0xb7e4('0x59')]);return db[_0xb7e4('0x84')][_0xb7e4('0x22')]({'where':_0x22f531[_0xb7e4('0x55')]})[_0xb7e4('0x12')](function(_0x55de69){_0x4bc41a[_0xb7e4('0x22')]=_0x55de69;if(_0x35421d['query'][_0xb7e4('0x5a')]){_0x22f531[_0xb7e4('0x5b')]=[{'model':db[_0xb7e4('0x87')],'as':_0xb7e4('0x88'),'required':![]},{'model':db['User'],'as':_0xb7e4('0x89'),'attributes':[_0xb7e4('0x2a'),'fullname',_0xb7e4('0x8a')],'required':![]},{'model':db['Tag'],'as':_0xb7e4('0x8b'),'attributes':['id',_0xb7e4('0x2a'),'color'],'where':_0x35421d['query'][_0xb7e4('0x8c')]?{'id':_0x35421d[_0xb7e4('0x4a')]['tag']}:undefined,'required':_0x35421d[_0xb7e4('0x4a')][_0xb7e4('0x8c')]?!![]:![]}];}return db['MailInteraction'][_0xb7e4('0x5c')](_0x22f531);})['then'](function(_0x5b4e50){_0x4bc41a[_0xb7e4('0x5d')]=_0x5b4e50;return _0x4bc41a;});}})[_0xb7e4('0x12')](respondWithFilteredResult(_0x39daa9,_0x22f531))[_0xb7e4('0x1c')](handleError(_0x39daa9,null));};exports[_0xb7e4('0x8d')]=function addApplications(_0x4c0c77,_0x2b41b1){var _0x3d6232=_0x4c0c77['params']['id'];var _0x118321=_0x4c0c77['body'];var _0x1fd75f=0xc8;var _0x2bbe55=null;return db[_0xb7e4('0x8e')]['transaction']({'isolationLevel':db[_0xb7e4('0x8e')][_0xb7e4('0x8f')][_0xb7e4('0x90')][_0xb7e4('0x91')]},function(_0x575fd0){return db[_0xb7e4('0x45')][_0xb7e4('0x6c')]({'where':{'id':_0x3d6232},'transaction':_0x575fd0})[_0xb7e4('0x12')](function(_0x56cc98){if(_0x56cc98){return db[_0xb7e4('0x92')][_0xb7e4('0x27')]({'where':{'MailAccountId':_0x3d6232},'transaction':_0x575fd0})['then'](function(){var _0x1d795d=_['map'](_0x118321,function(_0x4636a2){_0x4636a2[_0xb7e4('0x68')]=_0x3d6232;return _0x4636a2;});return db[_0xb7e4('0x92')][_0xb7e4('0x93')](_0x1d795d,{'transaction':_0x575fd0});});}else{_0x1fd75f=0x194;_0x2bbe55=[];}});})[_0xb7e4('0x12')](function(){if(_0x1fd75f!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x3d6232},'order':_0xb7e4('0x94')})['then'](function(_0x4f8e5c){_0x2bbe55=_0x4f8e5c;});}})[_0xb7e4('0x1c')](function(_0x2ce24a){_0x1fd75f=0x1f4;logger[_0xb7e4('0x19')](_0x2ce24a['stack']);if(_0x2ce24a['name']){delete _0x2ce24a['name'];}_0x2bbe55=_0x2ce24a;})[_0xb7e4('0x95')](function(){if(_0x2bbe55===null){_0x2b41b1[_0xb7e4('0x1d')](_0x1fd75f);}else{if(_0x1fd75f===0x1f4){_0x2b41b1['status'](_0x1fd75f)[_0xb7e4('0x2b')](_0x2bbe55);}else{_0x2b41b1['status'](_0x1fd75f)[_0xb7e4('0x20')](_0x2bbe55);}}});};exports[_0xb7e4('0x96')]=function(_0x37aa13,_0x2aa18e){var _0x388f73={};var _0x30a514={};var _0x487d9d;var _0x20a515;return db['MailAccount'][_0xb7e4('0x6c')]({'where':{'id':_0x37aa13[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x2aa18e,null))[_0xb7e4('0x12')](function(_0x10f93d){if(_0x10f93d){_0x487d9d=_0x10f93d;_0x30a514[_0xb7e4('0x49')]=_[_0xb7e4('0x4b')](db[_0xb7e4('0x92')]['rawAttributes']);_0x30a514[_0xb7e4('0x4a')]=_['keys'](_0x37aa13[_0xb7e4('0x4a')]);_0x30a514['filters']=_[_0xb7e4('0x4d')](_0x30a514['model'],_0x30a514[_0xb7e4('0x4a')]);_0x388f73[_0xb7e4('0x4e')]=_[_0xb7e4('0x4d')](_0x30a514[_0xb7e4('0x49')],qs[_0xb7e4('0x4f')](_0x37aa13[_0xb7e4('0x4a')][_0xb7e4('0x4f')]));_0x388f73[_0xb7e4('0x4e')]=_0x388f73[_0xb7e4('0x4e')][_0xb7e4('0x50')]?_0x388f73[_0xb7e4('0x4e')]:_0x30a514['model'];_0x388f73[_0xb7e4('0x53')]=qs[_0xb7e4('0x54')](_0x37aa13[_0xb7e4('0x4a')][_0xb7e4('0x54')]);_0x388f73[_0xb7e4('0x55')]=qs[_0xb7e4('0x4c')](_['pick'](_0x37aa13['query'],_0x30a514[_0xb7e4('0x4c')]));if(_0x37aa13['query']['filter']){_0x388f73[_0xb7e4('0x55')]=_[_0xb7e4('0x57')](_0x388f73[_0xb7e4('0x55')],{'$or':_['map'](_0x388f73[_0xb7e4('0x4e')],function(_0x26f455){var _0x234f1e={};_0x234f1e[_0x26f455]={'$like':'%'+_0x37aa13[_0xb7e4('0x4a')]['filter']+'%'};return _0x234f1e;})});}_0x388f73=_[_0xb7e4('0x57')]({},_0x388f73,_0x37aa13[_0xb7e4('0x59')]);return _0x487d9d[_0xb7e4('0x96')](_0x388f73);}})[_0xb7e4('0x12')](function(_0x3e109a){if(_0x3e109a){_0x20a515=_0x3e109a[_0xb7e4('0x50')];if(!_0x37aa13['query'][_0xb7e4('0x51')](_0xb7e4('0x52'))){_0x388f73[_0xb7e4('0x23')]=qs['limit'](_0x37aa13[_0xb7e4('0x4a')]['limit']);_0x388f73['offset']=qs[_0xb7e4('0x21')](_0x37aa13['query'][_0xb7e4('0x21')]);}return _0x487d9d[_0xb7e4('0x96')](_0x388f73);}})[_0xb7e4('0x12')](function(_0x168ee0){if(_0x168ee0){return _0x168ee0?{'count':_0x20a515,'rows':_0x168ee0}:null;}})[_0xb7e4('0x12')](respondWithResult(_0x2aa18e,null))[_0xb7e4('0x1c')](handleError(_0x2aa18e,null));};exports['getMessages']=function(_0xa26872,_0x381fec){var _0x1d70cc={'raw':!![],'where':{}};var _0x183f88={};var _0x508cb6={'count':0x0,'rows':[]};return db['MailAccount'][_0xb7e4('0x6c')]({'where':{'id':_0xa26872[_0xb7e4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x381fec,null))[_0xb7e4('0x12')](function(_0x5b1fd7){if(_0x5b1fd7){_0x183f88[_0xb7e4('0x49')]=_[_0xb7e4('0x4b')](db['MailMessage']['rawAttributes']);_0x183f88[_0xb7e4('0x4a')]=_[_0xb7e4('0x4b')](_0xa26872[_0xb7e4('0x4a')]);_0x183f88['filters']=_[_0xb7e4('0x4d')](_0x183f88[_0xb7e4('0x49')],_0x183f88[_0xb7e4('0x4a')]);_0x1d70cc[_0xb7e4('0x4e')]=_[_0xb7e4('0x4d')](_0x183f88[_0xb7e4('0x49')],qs[_0xb7e4('0x4f')](_0xa26872[_0xb7e4('0x4a')][_0xb7e4('0x4f')]));_0x1d70cc[_0xb7e4('0x4e')]=_0x1d70cc[_0xb7e4('0x4e')][_0xb7e4('0x50')]?_0x1d70cc[_0xb7e4('0x4e')]:_0x183f88[_0xb7e4('0x49')];if(!_0xa26872[_0xb7e4('0x4a')][_0xb7e4('0x51')]('nolimit')){_0x1d70cc[_0xb7e4('0x23')]=qs[_0xb7e4('0x23')](_0xa26872[_0xb7e4('0x4a')][_0xb7e4('0x23')]);_0x1d70cc[_0xb7e4('0x21')]=qs[_0xb7e4('0x21')](_0xa26872[_0xb7e4('0x4a')][_0xb7e4('0x21')]);}_0x1d70cc[_0xb7e4('0x53')]=qs[_0xb7e4('0x54')](_0xa26872[_0xb7e4('0x4a')][_0xb7e4('0x54')]);_0x1d70cc[_0xb7e4('0x55')]=qs[_0xb7e4('0x4c')](_[_0xb7e4('0x56')](_0xa26872[_0xb7e4('0x4a')],_0x183f88[_0xb7e4('0x4c')]));_0x1d70cc['where'][_0xb7e4('0x68')]=_0x5b1fd7['id'];if(_0xa26872['query'][_0xb7e4('0x6d')]){_0x1d70cc[_0xb7e4('0x55')]=_[_0xb7e4('0x57')](_0x1d70cc['where'],{'$or':_['map'](_0x1d70cc[_0xb7e4('0x4e')],function(_0x5df3f5){var _0x22a1dd={};_0x22a1dd[_0x5df3f5]={'$like':'%'+_0xa26872[_0xb7e4('0x4a')]['filter']+'%'};return _0x22a1dd;})});}if(_0xa26872['query'][_0xb7e4('0x97')]){var _0x3400c0=_0xa26872[_0xb7e4('0x4a')]['$gte']['split'](',');var _0x343e9c={};_0x343e9c[_0x3400c0[0x0]]={'$gte':moment(_0x3400c0[0x1])[_0xb7e4('0x98')](_0xb7e4('0x99'))};_0x1d70cc[_0xb7e4('0x55')]=_[_0xb7e4('0x57')](_0x1d70cc[_0xb7e4('0x55')],_0x343e9c);}_0x1d70cc=_[_0xb7e4('0x57')]({},_0x1d70cc,_0xa26872[_0xb7e4('0x59')]);return db[_0xb7e4('0x9a')][_0xb7e4('0x22')]({'where':_0x1d70cc[_0xb7e4('0x55')]})[_0xb7e4('0x12')](function(_0x433184){_0x508cb6[_0xb7e4('0x22')]=_0x433184;if(_0xa26872[_0xb7e4('0x4a')][_0xb7e4('0x5a')]){_0x1d70cc[_0xb7e4('0x5b')]=[{'all':!![]}];}return db[_0xb7e4('0x9a')]['findAll'](_0x1d70cc);})[_0xb7e4('0x12')](function(_0x5ab241){if(_0xa26872[_0xb7e4('0x4a')]['inlineCss']==='true'){for(var _0x4f6fbd=0x0;_0x4f6fbd<_0x5ab241['length'];_0x4f6fbd++){_0x5ab241[_0x4f6fbd][_0xb7e4('0x62')]=juice(_0x5ab241[_0x4f6fbd][_0xb7e4('0x62')]);}}_0x508cb6['rows']=_0x5ab241;return _0x508cb6;});}})[_0xb7e4('0x12')](respondWithFilteredResult(_0x381fec,_0x1d70cc))[_0xb7e4('0x1c')](handleError(_0x381fec,null));};exports[_0xb7e4('0x2b')]=function(_0x374bb3,_0x2be396){var _0x413c8e,_0x136220={},_0x113c21;if(_0x374bb3[_0xb7e4('0x62')]['to']){_0x113c21=_0x374bb3[_0xb7e4('0x62')]['to']['split'](',')[0x0];}return db[_0xb7e4('0x45')][_0xb7e4('0x6f')]({'where':{'id':_0x374bb3[_0xb7e4('0x5f')]['id']},'include':[{'model':db[_0xb7e4('0x9b')],'as':_0xb7e4('0x9c'),'include':[{'model':db[_0xb7e4('0x87')],'as':_0xb7e4('0x9d'),'where':{'email':_0x113c21},'limit':0x1,'order':[['updatedAt',_0xb7e4('0x9e')]]}]},{'model':db['MailServerOut'],'as':_0xb7e4('0x40'),'raw':!![],'include':[{'model':db[_0xb7e4('0x9f')],'as':_0xb7e4('0x9f'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2be396,null))[_0xb7e4('0x12')](function(_0x11d468){if(!_0x11d468)return;_0x413c8e=_0x11d468;if(!_0x11d468[_0xb7e4('0x40')])throw new Error(_0xb7e4('0xa0'));if(_[_0xb7e4('0xa1')](_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xa2')])){_0x374bb3['body'][_0xb7e4('0xa2')]=util[_0xb7e4('0x98')](_0xb7e4('0xa3'),_0x11d468[_0xb7e4('0x2a')],_0x11d468[_0xb7e4('0x74')]||_0x11d468[_0xb7e4('0x40')][_0xb7e4('0x35')]);}if(_0x374bb3['body'][_0xb7e4('0xa4')]&&_0x374bb3['body'][_0xb7e4('0xa4')][_0xb7e4('0x50')]){for(var _0x262c71=0x0;_0x262c71<_0x374bb3[_0xb7e4('0x62')]['attachments'][_0xb7e4('0x50')];_0x262c71+=0x1){_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xa4')][_0x262c71]={'filename':_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xa4')][_0x262c71][_0xb7e4('0x2a')],'path':path[_0xb7e4('0xa5')](config[_0xb7e4('0xa6')],'server/files/attachments',_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xa4')][_0x262c71][_0xb7e4('0xa7')])};}}var _0x53daa9=_0x11d468['getSmtpOptions']();return respondWithRpcPromise(_0xb7e4('0xa8'),_0xb7e4('0xa9'),{'account':_0x53daa9,'message':_0x374bb3[_0xb7e4('0x62')]});})[_0xb7e4('0x12')](function(_0x25d14e){if(!_0x25d14e)return;_0x136220=_0x25d14e;if(!_0x413c8e['List'])throw new Error(_0xb7e4('0xaa'));if(_0x413c8e['List'][_0xb7e4('0x9d')]['length'])return _0x413c8e[_0xb7e4('0x9c')]['Contacts'][0x0];return db[_0xb7e4('0x87')][_0xb7e4('0x6a')](_[_0xb7e4('0xc')](_0x374bb3[_0xb7e4('0x62')],{'firstName':_0x374bb3[_0xb7e4('0x62')]['to'],'email':_0x374bb3[_0xb7e4('0x62')]['to'],'phone':_0x374bb3[_0xb7e4('0x62')]['to'],'ListId':_0x413c8e[_0xb7e4('0x75')]}));})[_0xb7e4('0x12')](function(_0x3eebdc){if(!_0x3eebdc)return;var _0x53013d={'UserId':_0x374bb3[_0xb7e4('0x35')]['id'],'ContactId':_0x3eebdc['id'],'MailAccountId':_0x413c8e['id'],'inReplyTo':_0x136220[_0xb7e4('0xab')],'to':_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xa2')],'cc':_0x374bb3[_0xb7e4('0x62')]['cc'],'subject':_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xac')],'attach':_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xad')],'firstMsgDirection':_0xb7e4('0xae'),'lastMsgAt':moment()[_0xb7e4('0x98')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xb7e4('0xae'),'Messages':[_[_0xb7e4('0x57')](_0x374bb3[_0xb7e4('0x62')],{'messageId':_0x136220[_0xb7e4('0xab')],'sentAt':moment()[_0xb7e4('0x98')](_0xb7e4('0x99')),'read':!![],'MailAccountId':_0x413c8e['id'],'UserId':_0x374bb3[_0xb7e4('0x35')]['id'],'ContactId':_0x3eebdc['id']})]};if(_0x374bb3['body'][_0xb7e4('0xaf')]){_0x53013d=_[_0xb7e4('0x57')](_0x53013d,_0x374bb3[_0xb7e4('0x62')][_0xb7e4('0xaf')]);}return db['MailInteraction'][_0xb7e4('0x6a')](_0x53013d,{'include':[{'model':db[_0xb7e4('0x9a')],'as':_0xb7e4('0xb0')}]});})['then'](respondWithResult(_0x2be396,null))[_0xb7e4('0x1c')](handleError(_0x2be396,null));};exports[_0xb7e4('0xb1')]=function(_0x6328ac,_0x3b92a2){return db[_0xb7e4('0x45')][_0xb7e4('0x6f')]({'where':{'id':_0x6328ac[_0xb7e4('0x5f')]['id']},'include':[{'model':db[_0xb7e4('0x61')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xb7e4('0x9f')],'as':_0xb7e4('0x9f'),'raw':!![]}]}]})[_0xb7e4('0x12')](handleEntityNotFound(_0x3b92a2,null))['then'](function(_0xc46885){if(!_0xc46885['Smtp'])return;var _0x156466=_0xc46885[_0xb7e4('0xb2')]();return respondWithRpcPromise('VerifySmtp',_0xb7e4('0xb1'),{'account':_0x156466});})[_0xb7e4('0x12')](respondWithResult(_0x3b92a2,null))[_0xb7e4('0x1c')](handleError(_0x3b92a2,null));};exports[_0xb7e4('0x27')]=function(_0x471a3e,_0x2d4ce5){return db[_0xb7e4('0x45')][_0xb7e4('0x6f')]({'where':{'id':_0x471a3e[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x2d4ce5,null))[_0xb7e4('0x12')](function(_0x8fc306){if(_0x8fc306&&_0x8fc306['service']){throw new db[(_0xb7e4('0xb3'))][(_0xb7e4('0xb4'))](_0xb7e4('0xb5'));}return _0x8fc306;})[_0xb7e4('0x12')](removeEntity(_0x2d4ce5,null))[_0xb7e4('0x1c')](handleError(_0x2d4ce5,null));};exports['addAgents']=function(_0x393f12,_0xb0cad3){return db[_0xb7e4('0x45')][_0xb7e4('0x6f')]({'where':{'id':_0x393f12['params']['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0xb0cad3,null))[_0xb7e4('0x12')](function(_0x4eade1){if(_0x4eade1){return _0x4eade1[_0xb7e4('0xb6')](_0x393f12['body'][_0xb7e4('0x70')],_[_0xb7e4('0x85')](_0x393f12[_0xb7e4('0x62')],['ids','id'])||{})[_0xb7e4('0xb7')](function(_0x384404){for(var _0x1488e5=0x0;_0x1488e5<_0x393f12['body'][_0xb7e4('0x70')]['length'];_0x1488e5+=0x1){socket[_0xb7e4('0xb8')](_0xb7e4('0xb9'),{'UserId':Number(_0x393f12['body'][_0xb7e4('0x70')][_0x1488e5]),'MailAccountId':Number(_0x393f12[_0xb7e4('0x5f')]['id'])});}return _0x384404;});}})[_0xb7e4('0x12')](respondWithResult(_0xb0cad3,null))[_0xb7e4('0x1c')](handleError(_0xb0cad3,null));};exports[_0xb7e4('0xba')]=function(_0x93dd70,_0x135a24){return db['MailAccount']['find']({'where':{'id':_0x93dd70[_0xb7e4('0x5f')]['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0x135a24,null))[_0xb7e4('0x12')](function(_0x2607a6){if(_0x2607a6){return _0x2607a6['removeAgents'](_0x93dd70[_0xb7e4('0x4a')][_0xb7e4('0x70')])['then'](function(){if(_[_0xb7e4('0xbb')](_0x93dd70[_0xb7e4('0x4a')]['ids'])){for(var _0x4d30ba=0x0;_0x4d30ba<_0x93dd70[_0xb7e4('0x4a')]['ids'][_0xb7e4('0x50')];_0x4d30ba+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x93dd70[_0xb7e4('0x4a')][_0xb7e4('0x70')][_0x4d30ba]),'MailAccountId':Number(_0x93dd70['params']['id'])});}}else{socket[_0xb7e4('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x93dd70[_0xb7e4('0x4a')][_0xb7e4('0x70')]),'MailAccountId':Number(_0x93dd70[_0xb7e4('0x5f')]['id'])});}});}})[_0xb7e4('0x12')](respondWithStatusCode(_0x135a24,null))[_0xb7e4('0x1c')](handleError(_0x135a24,null));};exports['getAgents']=function(_0x4a2884,_0xf0699a){var _0x1ba851={};var _0x23b7f7={};var _0x1e27b1;var _0x146b81;return db[_0xb7e4('0x45')][_0xb7e4('0x6c')]({'where':{'id':_0x4a2884['params']['id']}})[_0xb7e4('0x12')](handleEntityNotFound(_0xf0699a,null))['then'](function(_0x4239cb){if(_0x4239cb){_0x1e27b1=_0x4239cb;_0x23b7f7[_0xb7e4('0x49')]=_[_0xb7e4('0x4b')](db[_0xb7e4('0xbc')][_0xb7e4('0x46')]);_0x23b7f7[_0xb7e4('0x4a')]=_[_0xb7e4('0x4b')](_0x4a2884[_0xb7e4('0x4a')]);_0x23b7f7[_0xb7e4('0x4c')]=_[_0xb7e4('0x4d')](_0x23b7f7[_0xb7e4('0x49')],_0x23b7f7['query']);_0x1ba851[_0xb7e4('0x4e')]=_[_0xb7e4('0x4d')](_0x23b7f7['model'],qs[_0xb7e4('0x4f')](_0x4a2884['query']['fields']));_0x1ba851[_0xb7e4('0x4e')]=_0x1ba851[_0xb7e4('0x4e')][_0xb7e4('0x50')]?_0x1ba851['attributes']:_0x23b7f7[_0xb7e4('0x49')];_0x1ba851[_0xb7e4('0x53')]=qs[_0xb7e4('0x54')](_0x4a2884['query']['sort']);_0x1ba851[_0xb7e4('0x55')]=qs[_0xb7e4('0x4c')](_[_0xb7e4('0x56')](_0x4a2884['query'],_0x23b7f7[_0xb7e4('0x4c')]));if(_0x4a2884[_0xb7e4('0x4a')][_0xb7e4('0x6d')]){_0x1ba851[_0xb7e4('0x55')]=_[_0xb7e4('0x57')](_0x1ba851[_0xb7e4('0x55')],{'$or':_[_0xb7e4('0x44')](_0x1ba851['attributes'],function(_0xc86e52){var _0x8d53b={};_0x8d53b[_0xc86e52]={'$like':'%'+_0x4a2884[_0xb7e4('0x4a')][_0xb7e4('0x6d')]+'%'};return _0x8d53b;})});}_0x1ba851=_[_0xb7e4('0x57')]({},_0x1ba851,_0x4a2884[_0xb7e4('0x59')]);return _0x1e27b1[_0xb7e4('0xbd')](_0x1ba851);}})['then'](function(_0xa02bf0){if(_0xa02bf0){_0x146b81=_0xa02bf0['length'];if(!_0x4a2884[_0xb7e4('0x4a')][_0xb7e4('0x51')](_0xb7e4('0x52'))){_0x1ba851[_0xb7e4('0x23')]=qs[_0xb7e4('0x23')](_0x4a2884[_0xb7e4('0x4a')][_0xb7e4('0x23')]);_0x1ba851[_0xb7e4('0x21')]=qs['offset'](_0x4a2884[_0xb7e4('0x4a')][_0xb7e4('0x21')]);}return _0x1e27b1['getAgents'](_0x1ba851);}})[_0xb7e4('0x12')](function(_0x3df74e){if(_0x3df74e){return _0x3df74e?{'count':_0x146b81,'rows':_0x3df74e}:null;}})[_0xb7e4('0x12')](respondWithResult(_0xf0699a,null))[_0xb7e4('0x1c')](handleError(_0xf0699a,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 46c5bb2..53c360a 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 _0x9a5e=['update','remove','emit','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a5e,0xee));var _0xe9a5=function(_0x3314cc,_0x287bb1){_0x3314cc=_0x3314cc-0x0;var _0xad4a58=_0x9a5e[_0x3314cc];return _0xad4a58;};'use strict';var EventEmitter=require(_0xe9a5('0x0'));var MailAccount=require(_0xe9a5('0x1'))['db'][_0xe9a5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe9a5('0x3')](0x0);var events={'afterCreate':_0xe9a5('0x4'),'afterUpdate':_0xe9a5('0x5'),'afterDestroy':_0xe9a5('0x6')};function emitEvent(_0x36d005){return function(_0x3ba487,_0x58754b,_0x4030b9){MailAccountEvents[_0xe9a5('0x7')](_0x36d005+':'+_0x3ba487['id'],_0x3ba487);MailAccountEvents[_0xe9a5('0x7')](_0x36d005,_0x3ba487);_0x4030b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xe9a5('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x8658=['../../mysqldb','MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x8658,0x1d3));var _0x8865=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8658[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x8865('0x0'));var MailAccount=require(_0x8865('0x1'))['db'][_0x8865('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8865('0x3')](0x0);var events={'afterCreate':_0x8865('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x120c22){return function(_0x58ff93,_0x48c6a6,_0x9e1929){MailAccountEvents[_0x8865('0x5')](_0x120c22+':'+_0x58ff93['id'],_0x58ff93);MailAccountEvents[_0x8865('0x5')](_0x120c22,_0x58ff93);_0x9e1929(null);};}for(var e in events){if(events[_0x8865('0x6')](e)){var event=events[e];MailAccount[_0x8865('0x7')](e,emitEvent(event));}}module[_0x8865('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5d8ca2e..f58c142 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 _0xdee5=['Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','auth','user','pass','./mailAccount.attributes','exports','define','MailAccount','provider','custom','service','host','Smtp','port','secure','authentication','CloudProvider'];(function(_0x5b0f5f,_0xce1a81){var _0x4d04f7=function(_0x3d5c06){while(--_0x3d5c06){_0x5b0f5f['push'](_0x5b0f5f['shift']());}};_0x4d04f7(++_0xce1a81);}(_0xdee5,0x1bb));var _0x5dee=function(_0x3198fd,_0x3729d8){_0x3198fd=_0x3198fd-0x0;var _0x2dd0b=_0xdee5[_0x3198fd];return _0x2dd0b;};'use strict';var attributes=require(_0x5dee('0x0'));module[_0x5dee('0x1')]=function(_0x156a32){return _0x156a32[_0x5dee('0x2')](_0x5dee('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5d8855=this;var _0x2b9428={'id':_0x5d8855['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5d8855[_0x5dee('0x4')]!==_0x5dee('0x5')){_0x2b9428[_0x5dee('0x6')]=_0x5d8855[_0x5dee('0x4')];}else{_0x2b9428[_0x5dee('0x7')]=_0x5d8855[_0x5dee('0x8')]['host'];_0x2b9428[_0x5dee('0x9')]=_0x5d8855['Smtp']['port'];_0x2b9428[_0x5dee('0xa')]=_0x5d8855[_0x5dee('0x8')]['secure'];}if(_0x5d8855[_0x5dee('0x8')][_0x5dee('0xb')]){if(_0x5d8855['Smtp']['modernAuthentication']){if(!_0x5d8855[_0x5dee('0x8')][_0x5dee('0xc')])throw new Error(_0x5dee('0xd'));_0x2b9428['auth']={'type':_0x5dee('0xe'),'user':_0x5d8855[_0x5dee('0x8')]['user'],'accessToken':_0x5d8855['Smtp'][_0x5dee('0xc')][_0x5dee('0xf')]};}else{_0x2b9428[_0x5dee('0x10')]={'user':_0x5d8855[_0x5dee('0x8')][_0x5dee('0x11')],'pass':_0x5d8855[_0x5dee('0x8')][_0x5dee('0x12')]};}}return _0x2b9428;}}});}; \ No newline at end of file +var _0x8b44=['custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x8b44,0x177));var _0x48b4=function(_0x266909,_0x43c24d){_0x266909=_0x266909-0x0;var _0x4a4872=_0x8b44[_0x266909];return _0x4a4872;};'use strict';var attributes=require(_0x48b4('0x0'));module['exports']=function(_0x3a4ad8){return _0x3a4ad8[_0x48b4('0x1')](_0x48b4('0x2'),attributes,{'tableName':_0x48b4('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xf6571c=this;var _0x542bd3={'id':_0xf6571c['id'],'tls':{'rejectUnauthorized':![]}};if(_0xf6571c[_0x48b4('0x4')]!==_0x48b4('0x5')){_0x542bd3[_0x48b4('0x6')]=_0xf6571c[_0x48b4('0x4')];}else{_0x542bd3[_0x48b4('0x7')]=_0xf6571c['Smtp'][_0x48b4('0x7')];_0x542bd3['port']=_0xf6571c[_0x48b4('0x8')][_0x48b4('0x9')];_0x542bd3[_0x48b4('0xa')]=_0xf6571c[_0x48b4('0x8')][_0x48b4('0xa')];}if(_0xf6571c[_0x48b4('0x8')][_0x48b4('0xb')]){if(_0xf6571c['Smtp'][_0x48b4('0xc')]){if(!_0xf6571c['Smtp'][_0x48b4('0xd')])throw new Error(_0x48b4('0xe'));_0x542bd3[_0x48b4('0xf')]={'type':_0x48b4('0x10'),'user':_0xf6571c[_0x48b4('0x8')]['user'],'accessToken':_0xf6571c[_0x48b4('0x8')][_0x48b4('0xd')][_0x48b4('0x11')]};}else{_0x542bd3['auth']={'user':_0xf6571c[_0x48b4('0x8')]['user'],'pass':_0xf6571c[_0x48b4('0x8')][_0x48b4('0x12')]};}}return _0x542bd3;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 7e2deab..1440266 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 _0x5f2f=['Attachments','UserId','User','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailAccount','options','where','limit','include','model','attributes','map','MailAccount','find','raw','then','smtp','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','applications','Applications','priority','asc','autoclose','push','close','Contacts','length','create','messageId','subject','format','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originCc','originChannel','Email','ChatOfflineMessageId','Attachment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5f2f,0x73));var _0xf5f2=function(_0xb415af,_0x20a8d5){_0xb415af=_0xb415af-0x0;var _0x13ce69=_0x5f2f[_0xb415af];return _0x13ce69;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5f2('0x8')][_0xf5f2('0x9')]({'port':0x232c});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':_0xf5f2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x56a69f,_0x375da4,_0x15dd7c){return new BPromise(function(_0x218ae3,_0x4e0e6b){return client[_0xf5f2('0xf')](_0x56a69f,_0x15dd7c)['then'](function(_0x53fb33){logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,'request\x20sent');logger[_0xf5f2('0x12')](_0xf5f2('0x13'),_0x375da4,_0xf5f2('0x14'),JSON[_0xf5f2('0x15')](_0x53fb33));if(_0x53fb33[_0xf5f2('0x16')]){if(_0x53fb33[_0xf5f2('0x16')]['code']===0x1f4){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x4e0e6b(_0x53fb33[_0xf5f2('0x16')]['message']);}logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x218ae3(_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);}else{logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,_0xf5f2('0x14'));_0x218ae3(_0x53fb33[_0xf5f2('0x18')][_0xf5f2('0x17')]);}})[_0xf5f2('0x19')](function(_0x4ff59b){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x4ff59b);_0x4e0e6b(_0x4ff59b);});});}exports[_0xf5f2('0x1a')]=function(_0x1bf655){var _0x56acc5=this;return new Promise(function(_0x34706d,_0x47101e){return db['MailAccount']['findAll']({'raw':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1c')]||null:null,'attributes':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['attributes']||null:null,'limit':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1d')]||null:null,'include':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['include']?_['map'](_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')],'include':_0x294414[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x294414[_0xf5f2('0x1e')],function(_0x198c73){return{'model':db[_0x198c73[_0xf5f2('0x1f')]],'as':_0x198c73['as'],'attributes':_0x198c73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22c826){logger[_0xf5f2('0x10')](_0xf5f2('0x1a'),_0x1bf655);logger['debug']('GetMailAccount',_0x1bf655,JSON[_0xf5f2('0x15')](_0x22c826));_0x34706d(_0x22c826);})[_0xf5f2('0x19')](function(_0x17394a){logger[_0xf5f2('0x16')](_0xf5f2('0x1a'),_0x17394a['message'],_0x1bf655);_0x47101e(_0x56acc5['error'](0x1f4,_0x17394a[_0xf5f2('0x17')]));});});};exports['ShowMailAccount']=function(_0xb744b9){var _0x58a4df=this;return new Promise(function(_0x45b643,_0x31087c){return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'raw':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x24')]===undefined?!![]:![]:!![],'where':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9['options'][_0xf5f2('0x1c')]||null:null,'attributes':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null,'include':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')]?_['map'](_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes'],'include':_0x2e3cca[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x2e3cca[_0xf5f2('0x1e')],function(_0x4ec8fb){return{'model':db[_0x4ec8fb[_0xf5f2('0x1f')]],'as':_0x4ec8fb['as'],'attributes':_0x4ec8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x25')](function(_0x566c47){if(_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x26')]===!![])_0x566c47['setDataValue'](_0xf5f2('0x27'),_0x566c47[_0xf5f2('0x28')]());logger[_0xf5f2('0x10')](_0xf5f2('0x29'),_0xb744b9);logger['debug']('ShowMailAccount',_0xb744b9,JSON[_0xf5f2('0x15')](_0x566c47));_0x45b643(_0x566c47);})[_0xf5f2('0x19')](function(_0x22b20c){logger[_0xf5f2('0x16')](_0xf5f2('0x29'),_0x22b20c[_0xf5f2('0x17')],_0xb744b9);_0x31087c(_0x58a4df[_0xf5f2('0x16')](0x1f4,_0x22b20c['message']));});});};exports[_0xf5f2('0x2a')]=function(_0x3b4ea6){var _0x536501=this;return new Promise(function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'body':_0x3b4ea6[_0xf5f2('0x2b')],'channel':_0xf5f2('0x2c')};var _0x3b6372=_[_0xf5f2('0x2d')](_[_0xf5f2('0x2e')](db['CmContact'][_0xf5f2('0x2f')]),[_0xf5f2('0x30'),_0xf5f2('0x31'),'CompanyId','ListId']);var _0x59eb00=![];if(_0x3b4ea6[_0xf5f2('0x2b')]['id']){delete _0x3b4ea6[_0xf5f2('0x2b')]['id'];}if(_['isNil'](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x33')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')])||_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')]===''){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x35')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501['error'](0x1f4,_0xf5f2('0x37')+_0x3b6372));}if(!_['includes'](_0x3b6372,_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x38')+_0x3b6372));}var _0x31bf0e={};_0x31bf0e[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'where':{'id':_0x3b4ea6[_0xf5f2('0x39')]['id']},'include':[{'model':db[_0xf5f2('0x3a')],'as':_0xf5f2('0x3b'),'include':[{'model':db[_0xf5f2('0x3c')],'as':'Contacts','where':_0x31bf0e,'limit':0x1,'order':[[_0xf5f2('0x31'),_0xf5f2('0x3d')]]}]},{'model':db[_0xf5f2('0x3e')],'as':'Applications'},{'model':db[_0xf5f2('0x3f')],'as':_0xf5f2('0x40'),'include':[{'model':db[_0xf5f2('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x7bb942){if(_0x7bb942&&_0x7bb942[_0xf5f2('0x3b')]){var _0x5db519=_0x7bb942[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7['account']=_[_0xf5f2('0x43')](_0x5db519,['Applications',_0xf5f2('0x3b')]);_0x71b0e7['account'][_0xf5f2('0x27')]=_0x7bb942[_0xf5f2('0x28')]();_0x71b0e7[_0xf5f2('0x44')]=_0x5db519[_0xf5f2('0x45')];_0x71b0e7['list']=_0x5db519[_0xf5f2('0x3b')];_0x71b0e7[_0xf5f2('0x44')]=_['orderBy'](_0x71b0e7['applications'],[_0xf5f2('0x46')],[_0xf5f2('0x47')]);if(_0x71b0e7['account']&&_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x48')]){_0x71b0e7[_0xf5f2('0x44')][_0xf5f2('0x49')]({'id':0x0,'priority':_0x71b0e7['applications']['length']+0x1,'app':_0xf5f2('0x4a'),'appdata':_0xf5f2('0x48'),'interval':'*,*,*,*'});}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')]){delete _0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')];}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x3b')]){delete _0x71b0e7[_0xf5f2('0x39')]['List'];}if(_0x5db519['List'][_0xf5f2('0x4b')][_0xf5f2('0x4c')]){return _0x5db519[_0xf5f2('0x3b')][_0xf5f2('0x4b')][0x0];}var _0x21b0d3=_['defaults'](_0x3b4ea6[_0xf5f2('0x2b')],{'firstName':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')],'ListId':_0x5db519['ListId']});_0x21b0d3[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x3c')][_0xf5f2('0x4d')](_0x21b0d3);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x756f1f){_0x71b0e7['contact']=_0x756f1f;if(_0x756f1f){if(!_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['messageId']){_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4e')]=rs['generate']()+'\x20'+_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')];}var _0x4579f4={'ContactId':_0x756f1f['id'],'MailAccountId':_0x3b4ea6['account']['id'],'inReplyTo':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'cc':_0x3b4ea6[_0xf5f2('0x2b')]['message']['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['attach'],'lastMsgAt':moment()[_0xf5f2('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xf5f2('0x23')]({'where':{'closed':![],'MailAccountId':_0x3b4ea6['account']['id']},'include':[{'model':db[_0xf5f2('0x51')],'as':_0xf5f2('0x52'),'attributes':[_0xf5f2('0x4e')],'where':{'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x53')]}}]})[_0xf5f2('0x25')](function(_0x1ec682){if(_0x1ec682){return[_0x1ec682,![]];}return db[_0xf5f2('0x54')][_0xf5f2('0x4d')](_0x4579f4)[_0xf5f2('0x25')](function(_0x158768){return[_0x158768,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf5f2('0x55')](function(_0x2d171d,_0xb39a6e){if(_0x2d171d){_0x59eb00=_0xb39a6e;if(!_0xb39a6e){return _0x2d171d[_0xf5f2('0x56')]({'inReplyTo':_0x3b4ea6['body'][_0xf5f2('0x17')]['messageId'],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['from'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x2d171d['attach']?_0x2d171d[_0xf5f2('0x57')]:_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x57')],'substatus':null,'substatusAt':moment()[_0xf5f2('0x50')](_0xf5f2('0x58')),'lastMsgAt':moment()['format'](_0xf5f2('0x58')),'lastMsgDirection':'in'});}else{return _0x2d171d;}}})[_0xf5f2('0x25')](function(_0x4800fe){_0x71b0e7[_0xf5f2('0x59')]=_0x4800fe[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7[_0xf5f2('0x59')]['created']=_0x59eb00;return db['MailMessage']['create']({'body':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')],'MailAccountId':_0x3b4ea6[_0xf5f2('0x39')]['id'],'MailInteractionId':_0x4800fe['id'],'direction':'in','ContactId':_0x71b0e7[_0xf5f2('0x5a')]['id'],'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'from':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['to'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6['body']['message']['attach'],'Attachments':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5b')],'originTo':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['originTo'],'originCc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5c')],'bcc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['bcc'],'ChatWebsiteId':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['ChatWebsiteId']||null,'originChannel':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5d')]||_0xf5f2('0x5e'),'ChatOfflineMessageId':_0x3b4ea6['body'][_0xf5f2('0x17')][_0xf5f2('0x5f')]||null},{'include':[{'model':db[_0xf5f2('0x60')],'as':_0xf5f2('0x61')}]});})[_0xf5f2('0x25')](function(_0x4f47e1){_0x71b0e7['message']=_0x4f47e1;if(_0x71b0e7[_0xf5f2('0x59')][_0xf5f2('0x62')]){return db[_0xf5f2('0x63')][_0xf5f2('0x23')]({'attributes':['id','name'],'where':{'id':_0x71b0e7['interaction'][_0xf5f2('0x62')]}})['then'](function(_0x4c4420){if(_0x4c4420){_0x71b0e7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf5f2('0x64'),'appdata':_0x4c4420[_0xf5f2('0x65')]+','+(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x66')]||0xa),'interval':_0xf5f2('0x67')});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);})[_0xf5f2('0x25')](function(_0x9afb3c){_0xc6a1ae(_0x9afb3c);})[_0xf5f2('0x19')](function(_0x1ba503){_0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0x1ba503[_0xf5f2('0x17')]));});});}; \ No newline at end of file +var _0x2ef3=['result','catch','MailAccount','findAll','options','attributes','limit','model','include','map','GetMailAccount','find','raw','smtp','setDataValue','smtpOptions','ShowMailAccount','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','account','omit','getSmtpOptions','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','defaults','create','List\x20not\x20found','messageId','generate','attach','MailInteraction','update','subject','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','ChatWebsiteId','Email','ChatOfflineMessageId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','message'];(function(_0x4e3974,_0x41a63b){var _0x7162d5=function(_0x161117){while(--_0x161117){_0x4e3974['push'](_0x4e3974['shift']());}};_0x7162d5(++_0x41a63b);}(_0x2ef3,0xba));var _0x32ef=function(_0x5471fe,_0x59c34f){_0x5471fe=_0x5471fe-0x0;var _0x40b3ea=_0x2ef3[_0x5471fe];return _0x40b3ea;};'use strict';var _=require(_0x32ef('0x0'));var moment=require(_0x32ef('0x1'));var BPromise=require(_0x32ef('0x2'));var rs=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var db=require(_0x32ef('0x5'))['db'];var logger=require('../../config/logger')(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32ef('0x8')][_0x32ef('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0x32ef('0xa')],{'host':_0x32ef('0xb'),'port':0x18eb});var socket=require(_0x32ef('0xc'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xd'))[_0x32ef('0xe')](socket);function respondWithRpcPromise(_0x2484a0,_0x2bbb50,_0x28275c){return new BPromise(function(_0x77df79,_0x56eb42){return client['request'](_0x2484a0,_0x28275c)[_0x32ef('0xf')](function(_0x33281d){logger[_0x32ef('0x10')](_0x32ef('0x11'),_0x2bbb50,'request\x20sent');logger[_0x32ef('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2bbb50,_0x32ef('0x13'),JSON['stringify'](_0x33281d));if(_0x33281d[_0x32ef('0x14')]){if(_0x33281d[_0x32ef('0x14')]['code']===0x1f4){logger['error'](_0x32ef('0x11'),_0x2bbb50,_0x33281d['error'][_0x32ef('0x15')]);return _0x56eb42(_0x33281d[_0x32ef('0x14')][_0x32ef('0x15')]);}logger[_0x32ef('0x14')]('MailAccount,\x20%s,\x20%s',_0x2bbb50,_0x33281d['error']['message']);return _0x77df79(_0x33281d[_0x32ef('0x14')][_0x32ef('0x15')]);}else{logger[_0x32ef('0x10')]('MailAccount,\x20%s,\x20%s',_0x2bbb50,'request\x20sent');_0x77df79(_0x33281d[_0x32ef('0x16')][_0x32ef('0x15')]);}})[_0x32ef('0x17')](function(_0x57863c){logger[_0x32ef('0x14')](_0x32ef('0x11'),_0x2bbb50,_0x57863c);_0x56eb42(_0x57863c);});});}exports['GetMailAccount']=function(_0x304505){var _0x314ef1=this;return new Promise(function(_0x26aff3,_0x251084){return db[_0x32ef('0x18')][_0x32ef('0x19')]({'raw':_0x304505['options']?_0x304505[_0x32ef('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')]['where']||null:null,'attributes':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')][_0x32ef('0x1b')]||null:null,'limit':_0x304505['options']?_0x304505['options'][_0x32ef('0x1c')]||null:null,'include':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')]['include']?_['map'](_0x304505[_0x32ef('0x1a')]['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1d')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1b')],'include':_0x51a412[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x51a412[_0x32ef('0x1e')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1d')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1b')],'include':_0x234175[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x234175[_0x32ef('0x1e')],function(_0xba4b3f){return{'model':db[_0xba4b3f['model']],'as':_0xba4b3f['as'],'attributes':_0xba4b3f[_0x32ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xf')](function(_0x5a04cd){logger[_0x32ef('0x10')](_0x32ef('0x20'),_0x304505);logger[_0x32ef('0x12')](_0x32ef('0x20'),_0x304505,JSON['stringify'](_0x5a04cd));_0x26aff3(_0x5a04cd);})[_0x32ef('0x17')](function(_0x22bf86){logger[_0x32ef('0x14')](_0x32ef('0x20'),_0x22bf86[_0x32ef('0x15')],_0x304505);_0x251084(_0x314ef1[_0x32ef('0x14')](0x1f4,_0x22bf86[_0x32ef('0x15')]));});});};exports['ShowMailAccount']=function(_0x36ac37){var _0x537214=this;return new Promise(function(_0x38bf73,_0x2b6c6a){return db['MailAccount'][_0x32ef('0x21')]({'raw':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x22')]===undefined?!![]:![]:!![],'where':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37['options']['where']||null:null,'attributes':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37['options'][_0x32ef('0x1b')]||null:null,'include':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x36ac37[_0x32ef('0x1a')]['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1b')],'include':_0x482d3a[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1d')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1b')],'include':_0x4fb402[_0x32ef('0x1e')]?_['map'](_0x4fb402['include'],function(_0xcbdec8){return{'model':db[_0xcbdec8[_0x32ef('0x1d')]],'as':_0xcbdec8['as'],'attributes':_0xcbdec8[_0x32ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xf')](function(_0x3a7c49){if(_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x23')]===!![])_0x3a7c49[_0x32ef('0x24')](_0x32ef('0x25'),_0x3a7c49['getSmtpOptions']());logger[_0x32ef('0x10')](_0x32ef('0x26'),_0x36ac37);logger[_0x32ef('0x12')]('ShowMailAccount',_0x36ac37,JSON[_0x32ef('0x27')](_0x3a7c49));_0x38bf73(_0x3a7c49);})[_0x32ef('0x17')](function(_0x879e33){logger[_0x32ef('0x14')](_0x32ef('0x26'),_0x879e33[_0x32ef('0x15')],_0x36ac37);_0x2b6c6a(_0x537214[_0x32ef('0x14')](0x1f4,_0x879e33[_0x32ef('0x15')]));});});};exports[_0x32ef('0x28')]=function(_0x57a3c0){var _0xb4db74=this;return new Promise(function(_0x4615b4,_0x48e071){var _0x3cac2e={'body':_0x57a3c0[_0x32ef('0x29')],'channel':_0x32ef('0x2a')};var _0x1733e3=_[_0x32ef('0x2b')](_[_0x32ef('0x2c')](db[_0x32ef('0x2d')]['rawAttributes']),['createdAt',_0x32ef('0x2e'),_0x32ef('0x2f'),_0x32ef('0x30')]);var _0x765c63=![];if(_0x57a3c0['body']['id']){delete _0x57a3c0[_0x32ef('0x29')]['id'];}if(_[_0x32ef('0x31')](_0x57a3c0['body'][_0x32ef('0x32')])){return _0x48e071(_0xb4db74['error'](0x1f4,_0x32ef('0x33')));}if(_[_0x32ef('0x31')](_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x29')])||_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x29')]===''){return _0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,_0x32ef('0x34')));}if(_[_0x32ef('0x31')](_0x57a3c0[_0x32ef('0x29')]['mapKey'])){return _0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1733e3));}if(!_[_0x32ef('0x35')](_0x1733e3,_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x36')])){return _0x48e071(_0xb4db74['error'](0x1f4,_0x32ef('0x37')+_0x1733e3));}var _0x230ac9={};_0x230ac9[_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x36')]]=_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')];return db[_0x32ef('0x18')]['find']({'where':{'id':_0x57a3c0['account']['id']},'include':[{'model':db[_0x32ef('0x38')],'as':_0x32ef('0x39'),'include':[{'model':db[_0x32ef('0x2d')],'as':_0x32ef('0x3a'),'where':_0x230ac9,'limit':0x1,'order':[[_0x32ef('0x2e'),_0x32ef('0x3b')]]}]},{'model':db[_0x32ef('0x3c')],'as':_0x32ef('0x3d')},{'model':db[_0x32ef('0x3e')],'as':_0x32ef('0x3f'),'include':[{'model':db[_0x32ef('0x40')],'as':_0x32ef('0x40')}]}]})[_0x32ef('0xf')](function(_0x4c2534){if(_0x4c2534&&_0x4c2534[_0x32ef('0x39')]){var _0x12fbd7=_0x4c2534[_0x32ef('0x41')]({'plain':!![]});_0x3cac2e[_0x32ef('0x42')]=_[_0x32ef('0x43')](_0x12fbd7,[_0x32ef('0x3d'),_0x32ef('0x39')]);_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x25')]=_0x4c2534[_0x32ef('0x44')]();_0x3cac2e[_0x32ef('0x45')]=_0x12fbd7[_0x32ef('0x3d')];_0x3cac2e[_0x32ef('0x46')]=_0x12fbd7[_0x32ef('0x39')];_0x3cac2e[_0x32ef('0x45')]=_[_0x32ef('0x47')](_0x3cac2e[_0x32ef('0x45')],[_0x32ef('0x48')],['asc']);if(_0x3cac2e['account']&&_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x49')]){_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x4a')]({'id':0x0,'priority':_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x4b')]+0x1,'app':_0x32ef('0x4c'),'appdata':_0x32ef('0x49'),'interval':_0x32ef('0x4d')});}if(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x3d')]){delete _0x3cac2e['account'][_0x32ef('0x3d')];}if(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x39')]){delete _0x3cac2e[_0x32ef('0x42')][_0x32ef('0x39')];}if(_0x12fbd7[_0x32ef('0x39')]['Contacts'][_0x32ef('0x4b')]){return _0x12fbd7[_0x32ef('0x39')][_0x32ef('0x3a')][0x0];}var _0x56b7ce=_[_0x32ef('0x4e')](_0x57a3c0['body'],{'firstName':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')],'ListId':_0x12fbd7['ListId']});_0x56b7ce[_0x57a3c0[_0x32ef('0x29')]['mapKey']]=_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')];return db[_0x32ef('0x2d')][_0x32ef('0x4f')](_0x56b7ce);}else{throw new Error(_0x32ef('0x50'));}})[_0x32ef('0xf')](function(_0x42c7f4){_0x3cac2e['contact']=_0x42c7f4;if(_0x42c7f4){if(!_0x57a3c0['body'][_0x32ef('0x15')]['messageId']){_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x51')]=rs[_0x32ef('0x52')]()+'\x20'+_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x32')];}var _0x316547={'ContactId':_0x42c7f4['id'],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id'],'inReplyTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['messageId'],'to':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x32')],'cc':_0x57a3c0['body'][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['subject'],'attach':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x53')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x32ef('0x54')]['find']({'where':{'closed':![],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x32ef('0x51')],'where':{'messageId':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['inReplyTo']}}]})[_0x32ef('0xf')](function(_0x222b24){if(_0x222b24){return[_0x222b24,![]];}return db[_0x32ef('0x54')]['create'](_0x316547)[_0x32ef('0xf')](function(_0x12b7f8){return[_0x12b7f8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x2e20dc,_0x3a6697){if(_0x2e20dc){_0x765c63=_0x3a6697;if(!_0x3a6697){return _0x2e20dc[_0x32ef('0x55')]({'inReplyTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x51')],'to':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x32')],'cc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x56')],'attach':_0x2e20dc[_0x32ef('0x53')]?_0x2e20dc[_0x32ef('0x53')]:_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x53')],'substatus':null,'substatusAt':moment()[_0x32ef('0x57')](_0x32ef('0x58')),'lastMsgAt':moment()[_0x32ef('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x2e20dc;}}})['then'](function(_0x2125de){_0x3cac2e[_0x32ef('0x59')]=_0x2125de[_0x32ef('0x41')]({'plain':!![]});_0x3cac2e[_0x32ef('0x59')][_0x32ef('0x5a')]=_0x765c63;return db['MailMessage'][_0x32ef('0x4f')]({'body':_0x57a3c0['body'][_0x32ef('0x29')],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id'],'MailInteractionId':_0x2125de['id'],'direction':'in','ContactId':_0x3cac2e['contact']['id'],'messageId':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x51')],'from':_0x57a3c0[_0x32ef('0x29')]['message']['from'],'to':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['to'],'cc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x56')],'attach':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x53')],'Attachments':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x5b')],'originTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x5c')],'originCc':_0x57a3c0[_0x32ef('0x29')]['message']['originCc'],'bcc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['bcc'],'ChatWebsiteId':_0x57a3c0[_0x32ef('0x29')]['message'][_0x32ef('0x5d')]||null,'originChannel':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['originChannel']||_0x32ef('0x5e'),'ChatOfflineMessageId':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x32ef('0xf')](function(_0x5970db){_0x3cac2e[_0x32ef('0x15')]=_0x5970db;if(_0x3cac2e['interaction'][_0x32ef('0x60')]){return db[_0x32ef('0x61')][_0x32ef('0x21')]({'attributes':['id','name'],'where':{'id':_0x3cac2e['interaction']['UserId']}})[_0x32ef('0xf')](function(_0x5e5766){if(_0x5e5766){_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x62')]({'id':0x0,'priority':0x0,'app':_0x32ef('0x63'),'appdata':_0x5e5766[_0x32ef('0x64')]+','+(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x65')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x32ef('0x66'),'startRouting',_0x3cac2e);});}return respondWithRpcPromise('Start',_0x32ef('0x67'),_0x3cac2e);})['then'](function(_0x145e27){_0x4615b4(_0x145e27);})[_0x32ef('0x17')](function(_0x4d64ec){_0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,_0x4d64ec[_0x32ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 38161e0..3ea6e38 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 _0x69a2=['mailAccount:','./mailAccount.events','remove','update','emit','removeListener','register','length'];(function(_0x3eabbe,_0x26a153){var _0x35a267=function(_0x264dec){while(--_0x264dec){_0x3eabbe['push'](_0x3eabbe['shift']());}};_0x35a267(++_0x26a153);}(_0x69a2,0x1a1));var _0x269a=function(_0x2c6fee,_0x48e3f4){_0x2c6fee=_0x2c6fee-0x0;var _0x2982ef=_0x69a2[_0x2c6fee];return _0x2982ef;};'use strict';var MailAccountEvents=require(_0x269a('0x0'));var events=['save',_0x269a('0x1'),_0x269a('0x2')];function createListener(_0x4345dc,_0x3481b2){return function(_0x4ed938){_0x3481b2[_0x269a('0x3')](_0x4345dc,_0x4ed938);};}function removeListener(_0x4729eb,_0x2a1630){return function(){MailAccountEvents[_0x269a('0x4')](_0x4729eb,_0x2a1630);};}exports[_0x269a('0x5')]=function(_0x20f512){for(var _0x592a71=0x0,_0x26392f=events[_0x269a('0x6')];_0x592a71<_0x26392f;_0x592a71++){var _0x3d2d60=events[_0x592a71];var _0x12003a=createListener(_0x269a('0x7')+_0x3d2d60,_0x20f512);MailAccountEvents['on'](_0x3d2d60,_0x12003a);}}; \ No newline at end of file +var _0x65ac=['save','remove','update','emit','removeListener','register','./mailAccount.events'];(function(_0x443d36,_0x315d44){var _0x105dec=function(_0x357b75){while(--_0x357b75){_0x443d36['push'](_0x443d36['shift']());}};_0x105dec(++_0x315d44);}(_0x65ac,0x1a3));var _0xc65a=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x65ac[_0x10004e];return _0x5af990;};'use strict';var MailAccountEvents=require(_0xc65a('0x0'));var events=[_0xc65a('0x1'),_0xc65a('0x2'),_0xc65a('0x3')];function createListener(_0x57f1e3,_0x228c33){return function(_0x2b0ddc){_0x228c33[_0xc65a('0x4')](_0x57f1e3,_0x2b0ddc);};}function removeListener(_0x499474,_0x5ed67a){return function(){MailAccountEvents[_0xc65a('0x5')](_0x499474,_0x5ed67a);};}exports[_0xc65a('0x6')]=function(_0x2efb76){for(var _0x4d256c=0x0,_0x1d16ae=events['length'];_0x4d256c<_0x1d16ae;_0x4d256c++){var _0x35c906=events[_0x4d256c];var _0x2cecf7=createListener('mailAccount:'+_0x35c906,_0x2efb76);MailAccountEvents['on'](_0x35c906,_0x2cecf7);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 6fd8699..2d17c66 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 _0xb7a5=['update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x1b0cff,_0x5a98cc){var _0x3669d3=function(_0x1d69bc){while(--_0x1d69bc){_0x1b0cff['push'](_0x1b0cff['shift']());}};_0x3669d3(++_0x5a98cc);}(_0xb7a5,0x1e3));var _0x5b7a=function(_0x343c25,_0x5345cc){_0x343c25=_0x343c25-0x0;var _0x20406a=_0xb7a5[_0x343c25];return _0x20406a;};'use strict';var multer=require(_0x5b7a('0x0'));var util=require(_0x5b7a('0x1'));var path=require(_0x5b7a('0x2'));var timeout=require(_0x5b7a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5b7a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b7a('0x5'));var controller=require(_0x5b7a('0x6'));router[_0x5b7a('0x7')](_0x5b7a('0x8'),auth[_0x5b7a('0x9')](),controller[_0x5b7a('0xa')]);router[_0x5b7a('0xb')](_0x5b7a('0x8'),auth[_0x5b7a('0x9')](),controller[_0x5b7a('0xc')]);router[_0x5b7a('0xd')]('/:id',auth[_0x5b7a('0x9')](),controller['destroy']);module[_0x5b7a('0xe')]=router; \ No newline at end of file +var _0x62e9=['get','show','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1b02e0,_0x1ebc4f){var _0x156b1c=function(_0x5bfc6c){while(--_0x5bfc6c){_0x1b02e0['push'](_0x1b02e0['shift']());}};_0x156b1c(++_0x1ebc4f);}(_0x62e9,0xe8));var _0x962e=function(_0x31fe33,_0x595585){_0x31fe33=_0x31fe33-0x0;var _0xc7a418=_0x62e9[_0x31fe33];return _0xc7a418;};'use strict';var multer=require('multer');var util=require(_0x962e('0x0'));var path=require(_0x962e('0x1'));var timeout=require(_0x962e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x962e('0x3'));var auth=require(_0x962e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x962e('0x5'));var controller=require('./mailApplication.controller');router[_0x962e('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x962e('0x7')]);router['put'](_0x962e('0x8'),auth[_0x962e('0x9')](),controller[_0x962e('0xa')]);router[_0x962e('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x962e('0xc')]);module[_0x962e('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 0de6105..633d200 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 _0x4aee=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x14d753,_0x26af71){var _0x2e6695=function(_0x2d1139){while(--_0x2d1139){_0x14d753['push'](_0x14d753['shift']());}};_0x2e6695(++_0x26af71);}(_0x4aee,0x19c));var _0xe4ae=function(_0x58506a,_0x2723c0){_0x58506a=_0x58506a-0x0;var _0x1c2f3a=_0x4aee[_0x58506a];return _0x1c2f3a;};'use strict';var Sequelize=require(_0xe4ae('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe4ae('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe4ae('0x2')],'allowNull':![],'defaultValue':_0xe4ae('0x3')},'appdata':{'type':Sequelize[_0xe4ae('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe4ae('0x2')],'defaultValue':_0xe4ae('0x5')}}; \ No newline at end of file +var _0xec11=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0xec11,0x16a));var _0x1ec1=function(_0x51dcc2,_0x421b3c){_0x51dcc2=_0x51dcc2-0x0;var _0x3637d8=_0xec11[_0x51dcc2];return _0x3637d8;};'use strict';var Sequelize=require(_0x1ec1('0x0'));module[_0x1ec1('0x1')]={'priority':{'type':Sequelize[_0x1ec1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1ec1('0x3')],'allowNull':![],'defaultValue':_0x1ec1('0x4')},'appdata':{'type':Sequelize[_0x1ec1('0x5')]()},'description':{'type':Sequelize[_0x1ec1('0x3')]},'interval':{'type':Sequelize[_0x1ec1('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 de8d071..93dc235 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(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xaa88[_0x4b2863];return _0x567d67;};'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 _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x49c0c6,_0x28a091){var _0xf8a440=function(_0x447ce9){while(--_0x447ce9){_0x49c0c6['push'](_0x49c0c6['shift']());}};_0xf8a440(++_0x28a091);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d15f4d6..e3f5640 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 _0xf101=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x3034ce,_0x1421b6){var _0x4bc0e3=function(_0x49a5ca){while(--_0x49a5ca){_0x3034ce['push'](_0x3034ce['shift']());}};_0x4bc0e3(++_0x1421b6);}(_0xf101,0xec));var _0x1f10=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0xf101[_0x479509];return _0x382da8;};'use strict';var _=require(_0x1f10('0x0'));var util=require(_0x1f10('0x1'));var logger=require(_0x1f10('0x2'))(_0x1f10('0x3'));var moment=require(_0x1f10('0x4'));var BPromise=require(_0x1f10('0x5'));var rp=require(_0x1f10('0x6'));var fs=require('fs');var path=require(_0x1f10('0x7'));var rimraf=require(_0x1f10('0x8'));var config=require(_0x1f10('0x9'));var attributes=require('./mailApplication.attributes');module[_0x1f10('0xa')]=function(_0x1bec37,_0x59d842){return _0x1bec37[_0x1f10('0xb')](_0x1f10('0xc'),attributes,{'tableName':_0x1f10('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f10('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xda8a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x4e803b,_0xb63b84){var _0x1d08a6=function(_0x4673b5){while(--_0x4673b5){_0x4e803b['push'](_0x4e803b['shift']());}};_0x1d08a6(++_0xb63b84);}(_0xda8a,0x1df));var _0xada8=function(_0x4fdfe4,_0x155446){_0x4fdfe4=_0x4fdfe4-0x0;var _0x478d9a=_0xda8a[_0x4fdfe4];return _0x478d9a;};'use strict';var _=require('lodash');var util=require(_0xada8('0x0'));var logger=require(_0xada8('0x1'))(_0xada8('0x2'));var moment=require(_0xada8('0x3'));var BPromise=require(_0xada8('0x4'));var rp=require(_0xada8('0x5'));var fs=require('fs');var path=require(_0xada8('0x6'));var rimraf=require(_0xada8('0x7'));var config=require(_0xada8('0x8'));var attributes=require(_0xada8('0x9'));module[_0xada8('0xa')]=function(_0x2d979a,_0x2cc108){return _0x2d979a[_0xada8('0xb')](_0xada8('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xada8('0xd'),'collate':_0xada8('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 4e6e973..5061efb 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 _0x4718=['raw','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateMailApplication','MailApplication','update','body','options'];(function(_0x2453d0,_0x1b2017){var _0x521fc8=function(_0xfc824f){while(--_0xfc824f){_0x2453d0['push'](_0x2453d0['shift']());}};_0x521fc8(++_0x1b2017);}(_0x4718,0x1e4));var _0x8471=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x4718[_0x2984d0];return _0x2885f2;};'use strict';var _=require('lodash');var util=require(_0x8471('0x0'));var moment=require('moment');var BPromise=require(_0x8471('0x1'));var rs=require(_0x8471('0x2'));var fs=require('fs');var Redis=require(_0x8471('0x3'));var db=require(_0x8471('0x4'))['db'];var utils=require(_0x8471('0x5'));var logger=require('../../config/logger')(_0x8471('0x6'));var config=require('../../config/environment');var jayson=require(_0x8471('0x7'));var client=jayson[_0x8471('0x8')][_0x8471('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x380407,_0x2476c6,_0x39f919){return new BPromise(function(_0x2ee998,_0x11fb1a){return client[_0x8471('0xa')](_0x380407,_0x39f919)[_0x8471('0xb')](function(_0x179d16){logger[_0x8471('0xc')](_0x8471('0xd'),_0x2476c6,'request\x20sent');logger[_0x8471('0xe')](_0x8471('0xf'),_0x2476c6,'request\x20sent',JSON[_0x8471('0x10')](_0x179d16));if(_0x179d16[_0x8471('0x11')]){if(_0x179d16[_0x8471('0x11')][_0x8471('0x12')]===0x1f4){logger[_0x8471('0x11')]('MailApplication,\x20%s,\x20%s',_0x2476c6,_0x179d16[_0x8471('0x11')][_0x8471('0x13')]);return _0x11fb1a(_0x179d16[_0x8471('0x11')][_0x8471('0x13')]);}logger[_0x8471('0x11')](_0x8471('0xd'),_0x2476c6,_0x179d16[_0x8471('0x11')]['message']);return _0x2ee998(_0x179d16[_0x8471('0x11')][_0x8471('0x13')]);}else{logger[_0x8471('0xc')]('MailApplication,\x20%s,\x20%s',_0x2476c6,_0x8471('0x14'));_0x2ee998(_0x179d16[_0x8471('0x15')][_0x8471('0x13')]);}})[_0x8471('0x16')](function(_0x2ba4e2){logger[_0x8471('0x11')](_0x8471('0xd'),_0x2476c6,_0x2ba4e2);_0x11fb1a(_0x2ba4e2);});});}exports[_0x8471('0x17')]=function(_0x5bbcc4){var _0xcfc2ee=this;return new Promise(function(_0xe5e58e,_0x26cafe){return db[_0x8471('0x18')][_0x8471('0x19')](_0x5bbcc4[_0x8471('0x1a')],{'raw':_0x5bbcc4[_0x8471('0x1b')]?_0x5bbcc4['options'][_0x8471('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bbcc4[_0x8471('0x1b')]?_0x5bbcc4[_0x8471('0x1b')][_0x8471('0x1d')]||null:null,'attributes':_0x5bbcc4[_0x8471('0x1b')]?_0x5bbcc4['options'][_0x8471('0x1e')]||null:null,'limit':_0x5bbcc4[_0x8471('0x1b')]?_0x5bbcc4[_0x8471('0x1b')][_0x8471('0x1f')]||null:null})[_0x8471('0xb')](function(_0x360b3d){logger[_0x8471('0xc')](_0x8471('0x17'),_0x5bbcc4);logger[_0x8471('0xe')](_0x8471('0x17'),_0x5bbcc4,JSON[_0x8471('0x10')](_0x360b3d));_0xe5e58e(_0x360b3d);})[_0x8471('0x16')](function(_0x114a19){logger['error']('UpdateMailApplication',_0x114a19[_0x8471('0x13')],_0x5bbcc4);_0x26cafe(_0xcfc2ee[_0x8471('0x11')](0x1f4,_0x114a19['message']));});});}; \ No newline at end of file +var _0x3e95=['client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','body','options','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0xa957b0,_0x1844ad){var _0x59c6f6=function(_0x4dee99){while(--_0x4dee99){_0xa957b0['push'](_0xa957b0['shift']());}};_0x59c6f6(++_0x1844ad);}(_0x3e95,0x13c));var _0x53e9=function(_0x416c40,_0x4d13fb){_0x416c40=_0x416c40-0x0;var _0xed628=_0x3e95[_0x416c40];return _0xed628;};'use strict';var _=require(_0x53e9('0x0'));var util=require('util');var moment=require(_0x53e9('0x1'));var BPromise=require(_0x53e9('0x2'));var rs=require(_0x53e9('0x3'));var fs=require('fs');var Redis=require(_0x53e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x53e9('0x5'))(_0x53e9('0x6'));var config=require('../../config/environment');var jayson=require(_0x53e9('0x7'));var client=jayson[_0x53e9('0x8')][_0x53e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b15a8,_0x3fab52,_0x47f3ff){return new BPromise(function(_0x407f8b,_0x1746e2){return client['request'](_0x3b15a8,_0x47f3ff)[_0x53e9('0xa')](function(_0x8ed0d3){logger[_0x53e9('0xb')](_0x53e9('0xc'),_0x3fab52,_0x53e9('0xd'));logger['debug'](_0x53e9('0xe'),_0x3fab52,'request\x20sent',JSON[_0x53e9('0xf')](_0x8ed0d3));if(_0x8ed0d3['error']){if(_0x8ed0d3[_0x53e9('0x10')][_0x53e9('0x11')]===0x1f4){logger[_0x53e9('0x10')](_0x53e9('0xc'),_0x3fab52,_0x8ed0d3[_0x53e9('0x10')][_0x53e9('0x12')]);return _0x1746e2(_0x8ed0d3[_0x53e9('0x10')][_0x53e9('0x12')]);}logger[_0x53e9('0x10')](_0x53e9('0xc'),_0x3fab52,_0x8ed0d3[_0x53e9('0x10')][_0x53e9('0x12')]);return _0x407f8b(_0x8ed0d3[_0x53e9('0x10')][_0x53e9('0x12')]);}else{logger[_0x53e9('0xb')]('MailApplication,\x20%s,\x20%s',_0x3fab52,_0x53e9('0xd'));_0x407f8b(_0x8ed0d3[_0x53e9('0x13')][_0x53e9('0x12')]);}})[_0x53e9('0x14')](function(_0x78abc7){logger['error']('MailApplication,\x20%s,\x20%s',_0x3fab52,_0x78abc7);_0x1746e2(_0x78abc7);});});}exports[_0x53e9('0x15')]=function(_0x361834){var _0x204c39=this;return new Promise(function(_0x5c9331,_0x242d34){return db[_0x53e9('0x16')]['update'](_0x361834[_0x53e9('0x17')],{'raw':_0x361834[_0x53e9('0x18')]?_0x361834['options'][_0x53e9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x361834[_0x53e9('0x18')]?_0x361834['options'][_0x53e9('0x1a')]||null:null,'attributes':_0x361834[_0x53e9('0x18')]?_0x361834[_0x53e9('0x18')]['attributes']||null:null,'limit':_0x361834['options']?_0x361834[_0x53e9('0x18')]['limit']||null:null})[_0x53e9('0xa')](function(_0x2d89d6){logger[_0x53e9('0xb')](_0x53e9('0x15'),_0x361834);logger['debug'](_0x53e9('0x15'),_0x361834,JSON[_0x53e9('0xf')](_0x2d89d6));_0x5c9331(_0x2d89d6);})['catch'](function(_0x1c5a68){logger[_0x53e9('0x10')](_0x53e9('0x15'),_0x1c5a68[_0x53e9('0x12')],_0x361834);_0x242d34(_0x204c39['error'](0x1f4,_0x1c5a68[_0x53e9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 10896c2..67684a8 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 _0x8412=['tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','mailinteraction:destroy','delete','/:id/tags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post'];(function(_0x5681a,_0x4798e8){var _0x5391d7=function(_0x4fcf2b){while(--_0x4fcf2b){_0x5681a['push'](_0x5681a['shift']());}};_0x5391d7(++_0x4798e8);}(_0x8412,0x107));var _0x2841=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0x8412[_0x11ba83];return _0x3f3925;};'use strict';var express=require(_0x2841('0x0'));var router=express[_0x2841('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x2841('0x2'));var controller=require(_0x2841('0x3'));router[_0x2841('0x4')]('/',auth[_0x2841('0x5')](),controller[_0x2841('0x6')]);router[_0x2841('0x4')](_0x2841('0x7'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2841('0x8'),auth[_0x2841('0x5')](),controller[_0x2841('0x9')]);router['get'](_0x2841('0xa'),auth[_0x2841('0x5')](),controller[_0x2841('0xb')]);router[_0x2841('0x4')](_0x2841('0xc'),auth[_0x2841('0x5')](),controller[_0x2841('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2841('0xe')]);router['post'](_0x2841('0xa'),auth[_0x2841('0x5')](),controller[_0x2841('0xf')]);router[_0x2841('0x10')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x2841('0x11')](_0x2841('0x12'),_0x2841('0x13')),controller[_0x2841('0x14')]);router[_0x2841('0x15')](_0x2841('0x8'),auth[_0x2841('0x5')](),interaction[_0x2841('0x11')](_0x2841('0x12'),_0x2841('0x16')),controller[_0x2841('0x17')]);router['delete'](_0x2841('0x8'),auth[_0x2841('0x5')](),interaction['tracked'](_0x2841('0x12'),_0x2841('0x18')),controller['destroy']);router[_0x2841('0x19')](_0x2841('0x1a'),auth['isAuthenticated'](),controller['removeTags']);module[_0x2841('0x1b')]=router; \ No newline at end of file +var _0x4790=['create','addMessage','/:id/tags','tracked','addTags','put','mail','mailinteraction:update','delete','/:id','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x53913b,_0x3b63fc){var _0xe87e9a=function(_0x2d9cec){while(--_0x2d9cec){_0x53913b['push'](_0x53913b['shift']());}};_0xe87e9a(++_0x3b63fc);}(_0x4790,0x130));var _0x0479=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x4790[_0x4e198a];return _0xb84bfe;};'use strict';var express=require(_0x0479('0x0'));var router=express[_0x0479('0x1')]();var auth=require(_0x0479('0x2'));var interaction=require(_0x0479('0x3'));var controller=require(_0x0479('0x4'));router[_0x0479('0x5')]('/',auth[_0x0479('0x6')](),controller[_0x0479('0x7')]);router[_0x0479('0x5')](_0x0479('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x0479('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x0479('0x9')]);router[_0x0479('0x5')](_0x0479('0xa'),auth[_0x0479('0x6')](),controller[_0x0479('0xb')]);router[_0x0479('0x5')](_0x0479('0xc'),auth[_0x0479('0x6')](),controller[_0x0479('0xd')]);router[_0x0479('0xe')]('/',auth['isAuthenticated'](),controller[_0x0479('0xf')]);router[_0x0479('0xe')]('/:id/messages',auth[_0x0479('0x6')](),controller[_0x0479('0x10')]);router[_0x0479('0xe')](_0x0479('0x11'),auth['isAuthenticated'](),interaction[_0x0479('0x12')]('mail','mailinteraction:addtags'),controller[_0x0479('0x13')]);router[_0x0479('0x14')]('/:id',auth[_0x0479('0x6')](),interaction[_0x0479('0x12')](_0x0479('0x15'),_0x0479('0x16')),controller['update']);router[_0x0479('0x17')](_0x0479('0x18'),auth['isAuthenticated'](),interaction[_0x0479('0x12')](_0x0479('0x15'),_0x0479('0x19')),controller[_0x0479('0x1a')]);router[_0x0479('0x17')](_0x0479('0x11'),auth[_0x0479('0x6')](),controller[_0x0479('0x1b')]);module[_0x0479('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 2a0fc10..bacaf99 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 _0x9e08=['sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9e08,0x198));var _0x89e0=function(_0x14f56b,_0x416eb5){_0x14f56b=_0x14f56b-0x0;var _0x215612=_0x9e08[_0x14f56b];return _0x215612;};'use strict';var Sequelize=require(_0x89e0('0x0'));var iconv=require('iconv');module[_0x89e0('0x1')]={'closed':{'type':Sequelize[_0x89e0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x89e0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x89e0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x89e0('0x4')]},'note':{'type':Sequelize[_0x89e0('0x4')]},'inReplyTo':{'type':Sequelize[_0x89e0('0x4')](0x1fe)},'to':{'type':Sequelize[_0x89e0('0x4')]},'cc':{'type':Sequelize[_0x89e0('0x5')](_0x89e0('0x6'))},'subject':{'type':Sequelize[_0x89e0('0x5')]()},'attach':{'type':Sequelize[_0x89e0('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x89e0('0x3')]},'substatus':{'type':Sequelize[_0x89e0('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x89e0('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x89e0('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x89e0('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x75aa=['STRING','long','TEXT','out','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0x121250,_0x1843d5){var _0x154aaa=function(_0x5a0a17){while(--_0x5a0a17){_0x121250['push'](_0x121250['shift']());}};_0x154aaa(++_0x1843d5);}(_0x75aa,0xef));var _0xa75a=function(_0x50e359,_0x28a2ad){_0x50e359=_0x50e359-0x0;var _0x1c177d=_0x75aa[_0x50e359];return _0x1c177d;};'use strict';var Sequelize=require(_0xa75a('0x0'));var iconv=require('iconv');module[_0xa75a('0x1')]={'closed':{'type':Sequelize[_0xa75a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa75a('0x3')]},'disposition':{'type':Sequelize[_0xa75a('0x4')]},'secondDisposition':{'type':Sequelize[_0xa75a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa75a('0x4')]},'note':{'type':Sequelize[_0xa75a('0x4')]},'inReplyTo':{'type':Sequelize[_0xa75a('0x4')](0x1fe)},'to':{'type':Sequelize[_0xa75a('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xa75a('0x5'))},'subject':{'type':Sequelize[_0xa75a('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa75a('0x3')]},'substatus':{'type':Sequelize[_0xa75a('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xa75a('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa75a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa75a('0x8')]('in',_0xa75a('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b746869..5134fc3 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 _0x853e=['join','server','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','get','mkdirSync','each','subject','decode','headers','bcc','Bcc','writeFileSync','message%d.eml','download','rimraf','moment','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','findOne','out','-id','plainBody','lastMsgText','catch','waiting','talking','answered','unmanaged','total','closed','UserId','MailInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','mail_interactions','cm_contacts','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','type','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','i.id','isEmpty','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','show','includeAll','include','create','body','update','params','describe','addMessage','MailMessage','ids','omit','getMessages','sort','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','rows','addTags','spread','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp'];(function(_0x1d0c85,_0x3698d0){var _0x3be928=function(_0x2d2e05){while(--_0x2d2e05){_0x1d0c85['push'](_0x1d0c85['shift']());}};_0x3be928(++_0x3698d0);}(_0x853e,0x1ea));var _0xe853=function(_0x33e016,_0x3db95e){_0x33e016=_0x33e016-0x0;var _0x3f1392=_0x853e[_0x33e016];return _0x3f1392;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe853('0x0'));var zipdir=require('zip-dir');var moment=require(_0xe853('0x1'));var BPromise=require('bluebird');var util=require(_0xe853('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xe853('0x3'));var squel=require(_0xe853('0x4'));var juice=require(_0xe853('0x5'));var Redis=require(_0xe853('0x6'));var qs=require(_0xe853('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xe853('0x8'))(_0xe853('0x9'));var config=require(_0xe853('0xa'));var db=require(_0xe853('0xb'))['db'];var htmlEntities=require(_0xe853('0xc'));config[_0xe853('0xd')]=_[_0xe853('0xe')](config[_0xe853('0xd')],{'host':_0xe853('0xf'),'port':0x18eb});var socket=require(_0xe853('0x10'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0xd985c6,_0x57892b){_0x57892b=_0x57892b||0xcc;return function(_0x5ccf43){if(_0x5ccf43){return _0xd985c6[_0xe853('0x11')](_0x57892b);}return _0xd985c6[_0xe853('0x12')](_0x57892b)[_0xe853('0x13')]();};}function respondWithResult(_0x5aed92,_0x88883f){_0x88883f=_0x88883f||0xc8;return function(_0x476f20){if(_0x476f20){return _0x5aed92[_0xe853('0x12')](_0x88883f)[_0xe853('0x14')](_0x476f20);}};}function respondWithFilteredResult(_0xc45939,_0x696c79){return function(_0x1ebf13){if(_0x1ebf13){var _0x4c92c6=typeof _0x696c79['offset']==='undefined'&&typeof _0x696c79['limit']===_0xe853('0x15');var _0x3840b5=_0x1ebf13[_0xe853('0x16')];var _0x11e4a0=_0x4c92c6?0x0:_0x696c79[_0xe853('0x17')];var _0x9309a5=_0x4c92c6?_0x1ebf13[_0xe853('0x16')]:_0x696c79[_0xe853('0x17')]+_0x696c79[_0xe853('0x18')];var _0x2f7e6e;if(_0x9309a5>=_0x3840b5){_0x9309a5=_0x3840b5;_0x2f7e6e=0xc8;}else{_0x2f7e6e=0xce;}_0xc45939[_0xe853('0x12')](_0x2f7e6e);return _0xc45939[_0xe853('0x19')](_0xe853('0x1a'),_0x11e4a0+'-'+_0x9309a5+'/'+_0x3840b5)[_0xe853('0x14')](_0x1ebf13);}return null;};}function saveUpdates(_0x25a5e2){return function(_0x1758da){if(_0x1758da){return _0x1758da['update'](_0x25a5e2)[_0xe853('0x1b')](function(_0x2e4fd0){return _0x2e4fd0;});}return null;};}function removeEntity(_0x386225){return function(_0x3ecb11){if(_0x3ecb11){return _0x3ecb11[_0xe853('0x1c')]()[_0xe853('0x1b')](function(){_0x386225[_0xe853('0x12')](0xcc)[_0xe853('0x13')]();});}};}function handleEntityNotFound(_0xb6469e){return function(_0x16ca53){if(!_0x16ca53){_0xb6469e[_0xe853('0x11')](0x194);}return _0x16ca53;};}function handleError(_0x4d895e,_0x110362){_0x110362=_0x110362||0x1f4;return function(_0x3b6a23){logger[_0xe853('0x1d')](_0x3b6a23[_0xe853('0x1e')]);if(_0x3b6a23[_0xe853('0x1f')]){delete _0x3b6a23[_0xe853('0x1f')];}_0x4d895e[_0xe853('0x12')](_0x110362)[_0xe853('0x20')](_0x3b6a23);};}function getInteractionUsers(_0x5466d7,_0x3c98f6){return new BPromise(function(_0x3d238a,_0x198895){try{if(_0x3c98f6[_0x5466d7['id']]){_0x5466d7[_0xe853('0x21')]=_[_0xe853('0x22')](_0x3c98f6[_0x5466d7['id']],function(_0x58454e){return{'id':_0x58454e['id'],'fullname':_0x58454e[_0xe853('0x23')]};});}}catch(_0x33e0b0){_0x198895(_0x33e0b0);}_0x3d238a(_0x5466d7);});}function getInteractionTags(_0x49d8ed,_0x176794){return new BPromise(function(_0x4d285a,_0x5c8852){try{if(_0x49d8ed['TagIds']){_0x49d8ed['Tags']=[];_0x49d8ed[_0xe853('0x24')][_0xe853('0x25')](',')[_0xe853('0x26')](function(_0x5d268f){_0x49d8ed[_0xe853('0x27')][_0xe853('0x28')](_0x176794[_0x5d268f]);});}delete _0x49d8ed[_0xe853('0x24')];}catch(_0x7f858c){_0x5c8852(_0x7f858c);}_0x4d285a(_0x49d8ed);});}function getLastMessageText(_0x204a5a){return new BPromise(function(_0xfd53a,_0x51fc77){return db['MailMessage'][_0xe853('0x29')]({'where':{'$and':[{'MailInteractionId':_0x204a5a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe853('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xe853('0x2b'),'raw':!![]})['then'](function(_0x21e5b7){if(_0x21e5b7&&_0x21e5b7[_0xe853('0x2c')]){_0x204a5a[_0xe853('0x2d')]=_['trimStart'](_0x21e5b7[_0xe853('0x2c')]);}_0xfd53a(_0x204a5a);})[_0xe853('0x2e')](function(_0x21d3e5){_0x51fc77(_0x21d3e5);});});}function updateMailInteraction(_0x44e383,_0x245fda,_0x38c960,_0x407179){return new BPromise(function(_0xab2f31,_0x165ac9){return getInteractionUsers(_0x44e383,_0x38c960)[_0xe853('0x1b')](function(_0x11e503){return getInteractionTags(_0x11e503,_0x245fda);})['then'](function(_0x323317){return getStateInteraction(_0x323317);})['then'](function(_0x342528){if(_0x407179){_0xab2f31(getLastMessageText(_0x342528));}else{_0xab2f31(_0x342528);}})[_0xe853('0x2e')](function(_0x22d5ec){_0x165ac9(_0x22d5ec);});});}function getStateInteraction(_0x44aa3e){return new BPromise(function(_0x4ee5b2){_0x44aa3e[_0xe853('0x2f')]=0x0;_0x44aa3e[_0xe853('0x30')]=0x0;_0x44aa3e[_0xe853('0x31')]=0x0;_0x44aa3e[_0xe853('0x32')]=0x0;_0x44aa3e[_0xe853('0x33')]=0x0;if(!_0x44aa3e[_0xe853('0x34')]&&!_0x44aa3e['UserId']){_0x44aa3e[_0xe853('0x2f')]+=0x1;}if(!_0x44aa3e[_0xe853('0x34')]&&_0x44aa3e[_0xe853('0x35')]){_0x44aa3e[_0xe853('0x30')]+=0x1;if(_0x44aa3e[_0xe853('0x2f')]){_0x44aa3e[_0xe853('0x2f')]-=0x1;}}if(_0x44aa3e[_0xe853('0x34')]&&_0x44aa3e[_0xe853('0x35')]){_0x44aa3e[_0xe853('0x31')]+=0x1;if(_0x44aa3e['talking']){_0x44aa3e['talking']-=0x1;}}if(_0x44aa3e[_0xe853('0x34')]&&!_0x44aa3e[_0xe853('0x35')]){_0x44aa3e[_0xe853('0x32')]+=0x1;if(_0x44aa3e['waiting']){_0x44aa3e[_0xe853('0x2f')]-=0x1;}}_0x44aa3e['total']+=0x1;_0x4ee5b2(_0x44aa3e);});}exports['index']=function(_0x4af4fc,_0x29ed45){var _0x5b1fe4={},_0x3ae0cb={},_0x5ac611={'count':0x0,'rows':[]};var _0x3f351e=_[_0xe853('0x22')](db[_0xe853('0x36')][_0xe853('0x37')],function(_0x5be519){return{'name':_0x5be519[_0xe853('0x38')],'type':_0x5be519['type']['key']};});_0x3ae0cb[_0xe853('0x39')]=_['map'](_0x3f351e,_0xe853('0x1f'));_0x3ae0cb[_0xe853('0x3a')]=_[_0xe853('0x3b')](_0x4af4fc[_0xe853('0x3a')]);_0x3ae0cb[_0xe853('0x3c')]=_[_0xe853('0x3d')](_0x3ae0cb[_0xe853('0x39')],_0x3ae0cb['query']);_0x5b1fe4[_0xe853('0x3e')]=_[_0xe853('0x3d')](_0x3ae0cb[_0xe853('0x39')],qs['fields'](_0x4af4fc[_0xe853('0x3a')][_0xe853('0x3f')]));_0x5b1fe4['attributes']=_0x5b1fe4[_0xe853('0x3e')][_0xe853('0x40')]?_0x5b1fe4['attributes']:_0x3ae0cb[_0xe853('0x39')];if(!_0x4af4fc[_0xe853('0x3a')][_0xe853('0x41')](_0xe853('0x42'))){_0x5b1fe4['limit']=qs[_0xe853('0x18')](_0x4af4fc['query'][_0xe853('0x18')]);_0x5b1fe4[_0xe853('0x17')]=qs[_0xe853('0x17')](_0x4af4fc['query'][_0xe853('0x17')]);}_0x5b1fe4[_0xe853('0x43')]=qs['sort'](_0x4af4fc[_0xe853('0x3a')]['sort']);_0x5b1fe4[_0xe853('0x44')]=qs[_0xe853('0x3c')](_[_0xe853('0x45')](_0x4af4fc[_0xe853('0x3a')],_0x3ae0cb['filters']),_0x3f351e);var _0x5c8233=[];var _0x20dcb1=squel[_0xe853('0x46')]()['field']('id')[_0xe853('0x47')](_0xe853('0x1f'))['field']('color')[_0xe853('0x48')](_0xe853('0x49'));var _0x27c306=squel[_0xe853('0x46')]()[_0xe853('0x47')](_0xe853('0x4a'))[_0xe853('0x47')](_0xe853('0x4b'))[_0xe853('0x47')](_0xe853('0x4c'))['from']('user_has_mail_interactions','ui')[_0xe853('0x4d')](_0xe853('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x15d28b=squel[_0xe853('0x46')]()['from'](_0xe853('0x4f'),'i')[_0xe853('0x4d')](_0xe853('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe853('0x4d')](_0xe853('0x4e'),'o','o.id\x20=\x20i.UserId')[_0xe853('0x4d')](_0xe853('0x51'),'a',_0xe853('0x52'))[_0xe853('0x4d')](_0xe853('0x53'),'me',_0xe853('0x54'))[_0xe853('0x4d')](_0xe853('0x55'),'it','it.MailInteractionId\x20=\x20i.id')[_0xe853('0x4d')](_0xe853('0x49'),'t',_0xe853('0x56'));var _0x11c829=squel[_0xe853('0x57')]();var _0x251797=[];var _0x313fcd=squel[_0xe853('0x57')]();var _0x4071be;if(_0x4af4fc[_0xe853('0x3a')][_0xe853('0x58')]){_0x4071be=as[_0xe853('0x59')](_0x4af4fc[_0xe853('0x3a')][_0xe853('0x58')]);var _0x1b1f17=_0x4071be[_0xe853('0x5a')];for(var _0x5667f1=0x0;_0x5667f1<_0x4071be[_0xe853('0x5b')]['length'];_0x5667f1++){var _0x6c4f61=_0x4071be[_0xe853('0x5b')][_0x5667f1];var _0xfc99e1='i';var _0x4fdc55=_[_0xe853('0x5c')](_0x3f351e,[_0xe853('0x1f'),_0x6c4f61['field']]);if(!_0x4fdc55){switch(_0x6c4f61['field']){case _0xe853('0x5d'):if(_0x6c4f61[_0xe853('0x5e')]==0x1){_0x15d28b['having']('`'+_0x6c4f61[_0xe853('0x47')]+_0xe853('0x5f'));}else{_0x15d28b[_0xe853('0x60')]('`'+_0x6c4f61[_0xe853('0x47')]+_0xe853('0x61'));}break;case _0xe853('0x62'):if(_0x6c4f61[_0xe853('0x63')]==='$substring'){if(_0x6c4f61[_0xe853('0x5e')][_0xe853('0x25')]('\x20')[_0xe853('0x40')]>0x1){_0x11c829[_0x1b1f17](_0xe853('0x64'),qs[_0xe853('0x65')](_0x6c4f61['value']),null);}else{var _0x50c7a7='%'+_0x6c4f61[_0xe853('0x5e')]+'%';_0x11c829[_0x1b1f17](_0xe853('0x66'),_0x50c7a7,_0x50c7a7,_0x50c7a7);}}else{_0x4fdc55=_[_0xe853('0x5c')](_0x3f351e,[_0xe853('0x1f'),_0xe853('0x67')]);_0x6c4f61[_0xe853('0x47')]='ContactId';_0x2df508=as[_0xe853('0x68')](_0xfc99e1,_0x4fdc55['type'],_0x6c4f61);_0x11c829[_0x1b1f17](_0x2df508[_0xe853('0x69')],_0x2df508[_0xe853('0x5e')]['start'],_0x2df508[_0xe853('0x5e')][_0xe853('0x13')]);}break;case'Tag':var _0x32a0=_0x6c4f61[_0xe853('0x5e')][_0xe853('0x25')](',')['map'](function(_0x4aa72b){return Number(_0x4aa72b);});_0x32a0['forEach'](function(_0x1e91d0){_0x313fcd['or'](_0xe853('0x6a'),'%,'+_0x1e91d0+',%');});_0x251797=_[_0xe853('0x6b')](_0x251797,_0x32a0);break;case _0xe853('0x6c'):if(_0x6c4f61[_0xe853('0x63')]===_0xe853('0x6d')){_0x11c829[_0x1b1f17](_0xe853('0x6e'),'%'+_0x6c4f61[_0xe853('0x5e')]+'%',null);}else{_0x4fdc55=_[_0xe853('0x5c')](_0x3f351e,[_0xe853('0x1f'),'UserId']);_0x6c4f61[_0xe853('0x47')]=_0xe853('0x35');_0x2df508=as[_0xe853('0x68')](_0xfc99e1,_0x4fdc55['type'],_0x6c4f61);_0x11c829[_0x1b1f17](_0x2df508[_0xe853('0x69')],_0x2df508[_0xe853('0x5e')][_0xe853('0x6f')],_0x2df508[_0xe853('0x5e')][_0xe853('0x13')]);}break;case _0xe853('0x2c'):_0x2df508=as[_0xe853('0x68')]('me',null,_0x6c4f61);_0x11c829[_0x1b1f17](_0x2df508['text'],_0x2df508['value'][_0xe853('0x6f')],_0x2df508[_0xe853('0x5e')][_0xe853('0x13')]);break;}}else{var _0x2df508=as[_0xe853('0x68')](_0xfc99e1,_0x4fdc55[_0xe853('0x70')],_0x6c4f61);_0x11c829[_0x1b1f17](_0x2df508[_0xe853('0x69')],_0x2df508[_0xe853('0x5e')]['start'],_0x2df508[_0xe853('0x5e')][_0xe853('0x13')]);}}}else{var _0x49a91e=_(_0x4af4fc[_0xe853('0x3a')])['keys']()[_0xe853('0x22')](function(_0x59b2e8){return _['some'](_0x3f351e,[_0xe853('0x1f'),_0x59b2e8])?_0x59b2e8:undefined;})['compact']()[_0xe853('0x5e')]();if(!_['isEmpty'](_0x49a91e)){_0x49a91e['forEach'](function(_0x127100){if(_0x127100===_0xe853('0x71')){_0x15d28b[_0xe853('0x44')](_0xe853('0x72'),[]['concat'](_0x4af4fc['query'][_0x127100]));}else if(_0x127100===_0xe853('0x73')){var _0x4dd074=JSON[_0xe853('0x74')](_0x4af4fc[_0xe853('0x3a')][_0x127100])[_0xe853('0x75')];var _0x35cbb2=JSON[_0xe853('0x74')](_0x4af4fc[_0xe853('0x3a')][_0x127100])[_0xe853('0x76')];_0x15d28b['where'](_0xe853('0x77'),_0x4dd074,_0x35cbb2);}else{if(_0x4af4fc[_0xe853('0x3a')][_0x127100]===_0xe853('0x78')){_0x15d28b[_0xe853('0x44')]('i.'+_0x127100+_0xe853('0x79'));}else{_0x15d28b['where']('i.'+_0x127100+_0xe853('0x7a'),_0x4af4fc[_0xe853('0x3a')][_0x127100]);}}});}if(_0x4af4fc['query'][_0xe853('0x7b')]){if(_0x4af4fc[_0xe853('0x3a')][_0xe853('0x7b')]==0x1){_0x15d28b[_0xe853('0x60')](_0xe853('0x7c'));}else{_0x15d28b[_0xe853('0x60')]('`unreadMessages`\x20>\x200');}}if(_0x4af4fc[_0xe853('0x3a')][_0xe853('0x7d')]){_0x251797=_[_0xe853('0x7e')](_0x4af4fc[_0xe853('0x3a')]['tag'])?_0x4af4fc[_0xe853('0x3a')][_0xe853('0x7d')]:new Array(_0x4af4fc['query'][_0xe853('0x7d')]);_0x251797['forEach'](function(_0x32c88d){_0x313fcd['or'](_0xe853('0x6a'),'%,'+_0x32c88d+',%');});}if(_0x4af4fc[_0xe853('0x3a')]['filter']){var _0x114463=_0x4af4fc[_0xe853('0x3a')][_0xe853('0x7f')]['replace']('\x5c','\x5c\x5c')[_0xe853('0x80')](/'/g,'\x27\x27');if(qs[_0xe853('0x81')](_0x114463)){_0x11c829['or'](_0xe853('0x82'),_0x114463+'%');}else if(qs[_0xe853('0x83')](_0x114463)){_0x11c829['or'](_0xe853('0x84'),_0x114463+'%');}else{_0x11c829['or'](_0xe853('0x85'),qs[_0xe853('0x65')](_0x114463))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe853('0x65')](_0x114463));}}}_0x15d28b[_0xe853('0x44')](_0x11c829);_0x15d28b['group']('i.id');var _0x24ec3a={'type':db[_0xe853('0x86')][_0xe853('0x87')][_0xe853('0x88')],'raw':!![]};var _0xf8982c=_0x15d28b['clone']();_0xf8982c[_0xe853('0x47')](_0xe853('0x89'));_0xf8982c[_0xe853('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5b1fe4['order']){_0x5b1fe4[_0xe853('0x43')]['forEach'](function(_0x2b3883){var _0x3813b5=_0x2b3883[0x0]==='contactName'?_0x2b3883[0x0]:'i.'+_0x2b3883[0x0];_0x15d28b[_0xe853('0x43')](_0x3813b5,_0x2b3883[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe853('0x8a')](_0x251797)){_0x15d28b[_0xe853('0x60')](_0x313fcd);_0xf8982c[_0xe853('0x44')]('t.id\x20IN\x20?',_0x251797);}BPromise[_0xe853('0x8b')]()[_0xe853('0x1b')](function(){if(!_0x4071be){if(_0x4af4fc[_0xe853('0x3a')][_0xe853('0x71')])return;_0xf8982c[_0xe853('0x44')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x15d28b[_0xe853('0x44')](_0xe853('0x8c'));return;}if(_0x4af4fc[_0xe853('0x8d')][_0xe853('0x8e')]!==_0xe853('0x8f'))return;return _0x4af4fc[_0xe853('0x8d')][_0xe853('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x270595){if(_[_0xe853('0x8a')](_0x270595)){_0xf8982c[_0xe853('0x44')](_0xe853('0x91'));_0x15d28b[_0xe853('0x44')]('i.MailAccountId\x20IS\x20NULL');}else{_0xf8982c['where'](_0xe853('0x72'),_[_0xe853('0x22')](_0x270595,'id'));_0x15d28b[_0xe853('0x44')](_0xe853('0x72'),_[_0xe853('0x22')](_0x270595,'id'));}});})[_0xe853('0x1b')](function(){if(_0x4af4fc[_0xe853('0x8d')][_0xe853('0x8e')]===_0xe853('0x8f')&&!_0x4071be&&!_0x4af4fc[_0xe853('0x3a')][_0xe853('0x71')])return[];return db[_0xe853('0x92')]['query'](_0xf8982c[_0xe853('0x93')](),_0x24ec3a);})[_0xe853('0x1b')](function(_0x56d5ac){_0x5ac611[_0xe853('0x16')]=_0x56d5ac[_0xe853('0x40')];if(_0x5ac611[_0xe853('0x16')]===0x0)return[];return db[_0xe853('0x92')][_0xe853('0x3a')](_0x20dcb1[_0xe853('0x93')](),_0x24ec3a)[_0xe853('0x1b')](function(_0x1a1e33){_0x5c8233=_[_0xe853('0x94')](_0x1a1e33,'id');_0x24ec3a=_[_0xe853('0x95')](_0x24ec3a,{'model':db[_0xe853('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4af4fc['query'][_0xe853('0x3f')]){_0x5b1fe4[_0xe853('0x3e')]['forEach'](function(_0x261702){_0x15d28b['field']('i.'+_0x261702);});}else{_0x15d28b[_0xe853('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe853('0x5d'));_0x15d28b['field'](_0xe853('0x96'),_0xe853('0x97'));_0x15d28b['field'](_0xe853('0x98'),_0xe853('0x99'));_0x15d28b[_0xe853('0x47')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xe853('0x9a'));_0x15d28b[_0xe853('0x47')]('i.id');_0x15d28b['field'](_0xe853('0x9b'));_0x15d28b[_0xe853('0x47')](_0xe853('0x9c'));_0x15d28b[_0xe853('0x47')](_0xe853('0x9d'));_0x15d28b[_0xe853('0x47')](_0xe853('0x9e'));_0x15d28b[_0xe853('0x47')](_0xe853('0x9f'));_0x15d28b[_0xe853('0x47')](_0xe853('0xa0'));_0x15d28b[_0xe853('0x47')]('i.lastMsgDirection');_0x15d28b['field']('i.subject');_0x15d28b[_0xe853('0x47')](_0xe853('0xa1'));_0x15d28b['field'](_0xe853('0xa2'));_0x15d28b[_0xe853('0x47')](_0xe853('0xa3'));_0x15d28b[_0xe853('0x47')](_0xe853('0xa4'));_0x15d28b[_0xe853('0x47')](_0xe853('0xa5'));_0x15d28b[_0xe853('0x47')](_0xe853('0xa6'));_0x15d28b[_0xe853('0x47')](_0xe853('0xa7'));_0x15d28b['field'](_0xe853('0xa8'));_0x15d28b[_0xe853('0x47')](_0xe853('0xa9'),_0xe853('0xaa'));_0x15d28b[_0xe853('0x47')](_0xe853('0xab'),_0xe853('0xac'));_0x15d28b[_0xe853('0x47')](_0xe853('0xad'),_0xe853('0xae'));_0x15d28b['field'](_0xe853('0xaf'),_0xe853('0xb0'));_0x15d28b[_0xe853('0x47')](_0xe853('0xb1'),'Contact.mobile');_0x15d28b[_0xe853('0x47')](_0xe853('0xb2'),'Contact.fax');_0x15d28b[_0xe853('0x47')](_0xe853('0xb3'),_0xe853('0xb4'));_0x15d28b['field'](_0xe853('0xb5'),_0xe853('0xb6'));_0x15d28b[_0xe853('0x47')](_0xe853('0xb7'),_0xe853('0x24'));}if(_0x5b1fe4[_0xe853('0x18')])_0x15d28b[_0xe853('0x18')](_0x5b1fe4['limit']);if(_0x5b1fe4[_0xe853('0x17')])_0x15d28b['offset'](_0x5b1fe4[_0xe853('0x17')]);return db[_0xe853('0x92')]['query'](_0x15d28b[_0xe853('0x93')](),_0x24ec3a);})['then'](function(_0x1b5d14){if(_0x1b5d14[_0xe853('0x40')]>0x0)_0x27c306['where'](_0xe853('0xb8'),_[_0xe853('0x22')](_0x1b5d14,'id'));return db[_0xe853('0x92')][_0xe853('0x3a')](_0x27c306[_0xe853('0x93')](),_0x24ec3a)['then'](function(_0x104d74){var _0x5d3e00=_[_0xe853('0xb9')](_0x104d74,_0xe853('0xba'));var _0x4ea957=[];return db[_0xe853('0xbb')][_0xe853('0x29')]({'attributes':[_0xe853('0xbc')],'raw':!![]})[_0xe853('0x1b')](function(_0x120c38){var _0x363a4d=_0x120c38['enableEmailPreview'];_0x1b5d14['forEach'](function(_0x1487c9){_0x4ea957['push'](updateMailInteraction(_0x1487c9,_0x5c8233,_0x5d3e00,_0x363a4d));});return BPromise['all'](_0x4ea957);});});});})['then'](function(_0x55f202){_0x5ac611['rows']=_0x55f202;return _0x5ac611;})[_0xe853('0x1b')](respondWithFilteredResult(_0x29ed45,_0x5b1fe4))[_0xe853('0x2e')](handleError(_0x29ed45,null));};exports[_0xe853('0xbd')]=function(_0xdba532,_0x38d627){var _0x585c30={'raw':![],'where':{'id':_0xdba532['params']['id']}},_0x3079a7={};_0x3079a7['model']=_['keys'](db[_0xe853('0x36')][_0xe853('0x37')]);_0x3079a7[_0xe853('0x3a')]=_['keys'](_0xdba532[_0xe853('0x3a')]);_0x3079a7[_0xe853('0x3c')]=_[_0xe853('0x3d')](_0x3079a7[_0xe853('0x39')],_0x3079a7[_0xe853('0x3a')]);_0x585c30[_0xe853('0x3e')]=_[_0xe853('0x3d')](_0x3079a7['model'],qs[_0xe853('0x3f')](_0xdba532['query'][_0xe853('0x3f')]));_0x585c30[_0xe853('0x3e')]=_0x585c30[_0xe853('0x3e')][_0xe853('0x40')]?_0x585c30[_0xe853('0x3e')]:_0x3079a7['model'];if(_0xdba532[_0xe853('0x3a')][_0xe853('0xbe')]){_0x585c30[_0xe853('0xbf')]=[{'all':!![]}];}_0x585c30=_[_0xe853('0x95')]({},_0x585c30,_0xdba532['options']);return db[_0xe853('0x36')][_0xe853('0x5c')](_0x585c30)['then'](handleEntityNotFound(_0x38d627,null))[_0xe853('0x1b')](respondWithResult(_0x38d627,null))[_0xe853('0x2e')](handleError(_0x38d627,null));};exports[_0xe853('0xc0')]=function(_0x2c4b0a,_0x250e4e){return db['MailInteraction'][_0xe853('0xc0')](_0x2c4b0a[_0xe853('0xc1')],{})[_0xe853('0x1b')](respondWithResult(_0x250e4e,0xc9))[_0xe853('0x2e')](handleError(_0x250e4e,null));};exports[_0xe853('0xc2')]=function(_0x2d87c6,_0x24e94c){if(_0x2d87c6[_0xe853('0xc1')]['id']){delete _0x2d87c6[_0xe853('0xc1')]['id'];}return db['MailInteraction'][_0xe853('0x5c')]({'where':{'id':_0x2d87c6[_0xe853('0xc3')]['id']}})[_0xe853('0x1b')](handleEntityNotFound(_0x24e94c,null))[_0xe853('0x1b')](saveUpdates(_0x2d87c6['body'],null))[_0xe853('0x1b')](respondWithResult(_0x24e94c,null))[_0xe853('0x2e')](handleError(_0x24e94c,null));};exports[_0xe853('0x1c')]=function(_0x4d7997,_0x33155e){return db['MailInteraction'][_0xe853('0x5c')]({'where':{'id':_0x4d7997[_0xe853('0xc3')]['id']}})['then'](handleEntityNotFound(_0x33155e,null))[_0xe853('0x1b')](removeEntity(_0x33155e,null))[_0xe853('0x2e')](handleError(_0x33155e,null));};exports['describe']=function(_0x14aa46,_0xe0a205){return db['MailInteraction'][_0xe853('0xc4')]()[_0xe853('0x1b')](respondWithResult(_0xe0a205,null))[_0xe853('0x2e')](handleError(_0xe0a205,null));};exports[_0xe853('0xc5')]=function(_0x45c2d6,_0x2e0229){return db[_0xe853('0xc6')]['find']({'where':{'id':_0x45c2d6['params']['id']}})[_0xe853('0x1b')](handleEntityNotFound(_0x2e0229,null))['then'](function(_0x9306b1){if(_0x9306b1){return _0x9306b1[_0xe853('0xc5')](_0x45c2d6[_0xe853('0xc1')][_0xe853('0xc7')],_[_0xe853('0xc8')](_0x45c2d6[_0xe853('0xc1')],[_0xe853('0xc7'),'id'])||{});}})['then'](respondWithResult(_0x2e0229,null))['catch'](handleError(_0x2e0229,null));};exports[_0xe853('0xc9')]=function(_0x5730d4,_0x10829f){var _0x13e1e3={'raw':![],'where':{}};var _0x44dac2={};var _0x20c50d={'count':0x0,'rows':[]};return db[_0xe853('0x36')][_0xe853('0x29')]({'where':{'id':_0x5730d4[_0xe853('0xc3')]['id']}})['then'](handleEntityNotFound(_0x10829f,null))[_0xe853('0x1b')](function(_0x5b425e){if(_0x5b425e){_0x44dac2['model']=_[_0xe853('0x3b')](db[_0xe853('0xc6')]['rawAttributes']);_0x44dac2['query']=_[_0xe853('0x3b')](_0x5730d4[_0xe853('0x3a')]);_0x44dac2['filters']=_['intersection'](_0x44dac2[_0xe853('0x39')],_0x44dac2['query']);_0x13e1e3['attributes']=_['intersection'](_0x44dac2[_0xe853('0x39')],qs[_0xe853('0x3f')](_0x5730d4[_0xe853('0x3a')][_0xe853('0x3f')]));_0x13e1e3[_0xe853('0x3e')]=_0x13e1e3[_0xe853('0x3e')][_0xe853('0x40')]?_0x13e1e3[_0xe853('0x3e')]:_0x44dac2[_0xe853('0x39')];if(!_0x5730d4['query'][_0xe853('0x41')]('nolimit')){_0x13e1e3['limit']=qs[_0xe853('0x18')](_0x5730d4[_0xe853('0x3a')][_0xe853('0x18')]);_0x13e1e3[_0xe853('0x17')]=qs['offset'](_0x5730d4[_0xe853('0x3a')][_0xe853('0x17')]);}_0x13e1e3[_0xe853('0x43')]=qs['sort'](_0x5730d4[_0xe853('0x3a')][_0xe853('0xca')]);_0x13e1e3[_0xe853('0x44')]=qs[_0xe853('0x3c')](_[_0xe853('0x45')](_0x5730d4['query'],_0x44dac2[_0xe853('0x3c')]));_0x13e1e3[_0xe853('0x44')]['MailInteractionId']=_0x5b425e['id'];if(_0x5730d4[_0xe853('0x3a')][_0xe853('0x7f')]){_0x13e1e3[_0xe853('0x44')]=_['merge'](_0x13e1e3[_0xe853('0x44')],{'$or':_[_0xe853('0x22')](_0x13e1e3[_0xe853('0x3e')],function(_0x2c5db0){var _0x16bf9c={};_0x16bf9c[_0x2c5db0]={'$like':'%'+_0x5730d4[_0xe853('0x3a')][_0xe853('0x7f')]+'%'};return _0x16bf9c;})});}if(_0x5730d4[_0xe853('0x3a')]['$gte']){var _0xe7f1f5=_0x5730d4[_0xe853('0x3a')][_0xe853('0x75')][_0xe853('0x25')](',');var _0x4d28e2={};_0x4d28e2[_0xe7f1f5[0x0]]={'$gte':moment(_0xe7f1f5[0x1])[_0xe853('0xcb')](_0xe853('0xcc'))};_0x13e1e3[_0xe853('0x44')]=_[_0xe853('0x95')](_0x13e1e3[_0xe853('0x44')],_0x4d28e2);}_0x13e1e3=_[_0xe853('0x95')]({},_0x13e1e3,_0x5730d4[_0xe853('0xcd')]);return db[_0xe853('0xc6')][_0xe853('0x16')]({'where':_0x13e1e3[_0xe853('0x44')]})[_0xe853('0x1b')](function(_0xaf02a){_0x20c50d[_0xe853('0x16')]=_0xaf02a;if(_0x5730d4[_0xe853('0x3a')][_0xe853('0xbe')]){_0x13e1e3[_0xe853('0xbf')]=[{'all':!![]}];}return db[_0xe853('0xc6')][_0xe853('0xce')](_0x13e1e3);})[_0xe853('0x1b')](function(_0x304d81){if(_0x5730d4[_0xe853('0x3a')][_0xe853('0xcf')]==='true'){for(var _0x5b926e=0x0;_0x5b926e<_0x304d81[_0xe853('0x40')];_0x5b926e++){_0x304d81[_0x5b926e]['body']=juice(_0x304d81[_0x5b926e][_0xe853('0xc1')]);}}_0x20c50d[_0xe853('0xd0')]=_0x304d81;return _0x20c50d;});}})[_0xe853('0x1b')](respondWithFilteredResult(_0x10829f,_0x13e1e3))[_0xe853('0x2e')](handleError(_0x10829f,null));};exports[_0xe853('0xd1')]=function(_0x15a2cf,_0x4b6235){return db[_0xe853('0x36')][_0xe853('0x5c')]({'where':{'id':_0x15a2cf[_0xe853('0xc3')]['id']}})[_0xe853('0x1b')](handleEntityNotFound(_0x4b6235,null))[_0xe853('0x1b')](function(_0x3f8d8a){if(_0x3f8d8a){return _0x3f8d8a['setTags'](_0x15a2cf[_0xe853('0xc1')][_0xe853('0xc7')],_['omit'](_0x15a2cf['body'],['ids','id'])||{})[_0xe853('0xd2')](function(){return db['Tag']['findAll']({'attributes':['id',_0xe853('0x1f'),'color'],'where':{'id':_0x15a2cf[_0xe853('0xc1')]['ids']}});})[_0xe853('0x1b')](function(_0x2b3d41){socket[_0xe853('0xd3')](_0xe853('0xd4'),{'id':Number(_0x15a2cf[_0xe853('0xc3')]['id']),'tags':_0x2b3d41||[]});return{'id':Number(_0x15a2cf['params']['id']),'tags':_0x2b3d41||[]};});}})[_0xe853('0x1b')](respondWithResult(_0x4b6235,null))[_0xe853('0x2e')](handleError(_0x4b6235,null));};exports[_0xe853('0xd5')]=function(_0x42c93b,_0x2f859d){return db[_0xe853('0x36')][_0xe853('0x5c')]({'where':{'id':_0x42c93b[_0xe853('0xc3')]['id']}})[_0xe853('0x1b')](handleEntityNotFound(_0x2f859d,null))[_0xe853('0x1b')](function(_0x5c2f49){if(_0x5c2f49){return _0x5c2f49[_0xe853('0xd5')](_0x42c93b[_0xe853('0x3a')][_0xe853('0xc7')]);}})[_0xe853('0x1b')](respondWithStatusCode(_0x2f859d,null))[_0xe853('0x2e')](handleError(_0x2f859d,null));};exports['download']=function(_0x3ef649,_0x4f50ed){var _0x5b8f99=moment()[_0xe853('0xd6')]()['toString']();var _0x25b97b=path['join'](config[_0xe853('0xd7')],'server',_0xe853('0xd8'),_0xe853('0xd9'));var _0x43f768=path[_0xe853('0xda')](config[_0xe853('0xd7')],_0xe853('0xdb'),_0xe853('0xd8'),_0xe853('0xdc'));var _0x2bd398=path[_0xe853('0xda')](_0x25b97b,_0x5b8f99);var _0x39ae4d=util[_0xe853('0xcb')](_0xe853('0xdd'),_0x3ef649[_0xe853('0xc3')]['id'],_0x5b8f99);var _0x2d1bb6=path[_0xe853('0xda')](_0x25b97b,_0x39ae4d);var _0x38adf6=[];if(_0x3ef649[_0xe853('0x3a')]['attachments']){_0x38adf6[_0xe853('0x28')]({'model':db[_0xe853('0xde')],'as':_0xe853('0xdf'),'raw':!![]});}var _0x5aa098=[{'model':db[_0xe853('0xc6')],'as':'Messages','attributes':['id',_0xe853('0xc1'),_0xe853('0x48'),'to','cc','bcc','subject','createdAt'],'where':{'secret':![]},'order':qs[_0xe853('0xca')]('id'),'include':_0x38adf6}];return db[_0xe853('0x36')][_0xe853('0x5c')]({'where':{'id':_0x3ef649[_0xe853('0xc3')]['id']},'include':_0x5aa098})['then'](handleEntityNotFound(_0x4f50ed,null))[_0xe853('0x1b')](function(_0x3da072){if(_0x3da072&&_0x3da072[_0xe853('0xe0')]){var _0x433523=_0x3da072[_0xe853('0xe1')]({'plain':!![]});fs[_0xe853('0xe2')](_0x2bd398);return BPromise[_0xe853('0xe3')](_0x433523['Messages'],function(_0x323393,_0x15e4f4){var _0x32b746={'from':_0x323393['from'],'to':_0x323393['to'],'subject':_0x323393[_0xe853('0xe4')],'html':htmlEntities[_0xe853('0xe5')](_0x323393[_0xe853('0xc1')]),'headers':{'Date':moment(_0x323393[_0xe853('0x73')])[_0xe853('0xcb')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x323393['cc']){_0x32b746[_0xe853('0xe6')]['Cc']=_0x323393['cc'];}if(_0x323393[_0xe853('0xe7')]){_0x32b746[_0xe853('0xe6')][_0xe853('0xe8')]=_0x323393[_0xe853('0xe7')];}return new BPromise(function(_0x43da29,_0x384742){if(_0x323393[_0xe853('0xdf')]){for(var _0x188bb4=0x0;_0x188bb4<_0x323393[_0xe853('0xdf')]['length'];_0x188bb4++){var _0x3d3dcd=_0x323393[_0xe853('0xdf')][_0x188bb4];var _0x2d038c=path['join'](_0x43f768,_0x3d3dcd['basename']);if(fs['existsSync'](_0x2d038c)){_0x32b746[_0xe853('0xdc')]['push']({'name':_0x3d3dcd[_0xe853('0x1f')],'contentType':_0x3d3dcd[_0xe853('0x70')],'data':fs['readFileSync'](_0x2d038c)});}}}emlformat['build'](_0x32b746,function(_0x5764f3,_0x591e0f){if(_0x5764f3)return _0x384742(_0x5764f3);fs[_0xe853('0xe9')](path[_0xe853('0xda')](_0x2bd398,util[_0xe853('0xcb')](_0xe853('0xea'),_0x15e4f4)),_0x591e0f);return _0x43da29(_0x591e0f);});});})[_0xe853('0x1b')](function(){return new BPromise(function(_0x590210,_0x5653c4){zipdir(_0x2bd398,{'saveTo':_0x2d1bb6},function(_0xc5a5f6,_0x24cb76){if(_0xc5a5f6)return _0x5653c4(_0xc5a5f6);return _0x590210(_0x24cb76);});})[_0xe853('0x1b')](function(){return new BPromise(function(_0x3a928a,_0x1f92ef){rimraf(_0x2bd398,function(_0x5b4d72){if(_0x5b4d72)_0x1f92ef(_0x5b4d72);return _0x3a928a();});});})[_0xe853('0x1b')](function(){return _0x4f50ed[_0xe853('0xeb')](_0x2d1bb6,_0x39ae4d,function(_0x3317f3){if(!_0x3317f3)fs['unlinkSync'](_0x2d1bb6);});});});}else{return _0x4f50ed['sendStatus'](0xc8);}})[_0xe853('0x2e')](handleError(_0x4f50ed,null));}; \ No newline at end of file +var _0x3fa4=['mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','message%d.eml','download','unlinkSync','eml-format','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','localhost','./mailInteraction.socket','register','status','end','json','undefined','offset','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','Users','map','Tags','TagIds','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','talking','answered','unmanaged','closed','UserId','waiting','total','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','user_has_mail_interactions','users','mail_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','value','`\x20=\x200','having','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','compact','isEmpty','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','i.MailAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','fields','unreadMessages','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','MailInteraction','rawAttributes','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','spread','mailInteractionTags:save','removeTags','unix','join','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject'];(function(_0x176324,_0x31f864){var _0x52dd0c=function(_0x19d6c9){while(--_0x19d6c9){_0x176324['push'](_0x176324['shift']());}};_0x52dd0c(++_0x31f864);}(_0x3fa4,0xf0));var _0x43fa=function(_0x4c6d77,_0x2da8af){_0x4c6d77=_0x4c6d77-0x0;var _0x4b7c23=_0x3fa4[_0x4c6d77];return _0x4b7c23;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x43fa('0x1'));var util=require(_0x43fa('0x2'));var path=require(_0x43fa('0x3'));var fs=require('fs');var _=require(_0x43fa('0x4'));var squel=require(_0x43fa('0x5'));var juice=require(_0x43fa('0x6'));var Redis=require(_0x43fa('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x43fa('0x8'));var logger=require(_0x43fa('0x9'))(_0x43fa('0xa'));var config=require('../../config/environment');var db=require(_0x43fa('0xb'))['db'];var htmlEntities=require(_0x43fa('0xc'));config[_0x43fa('0xd')]=_['defaults'](config[_0x43fa('0xd')],{'host':_0x43fa('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x43fa('0xf'))[_0x43fa('0x10')](socket);function respondWithStatusCode(_0x136821,_0x42eba9){_0x42eba9=_0x42eba9||0xcc;return function(_0x1caaaa){if(_0x1caaaa){return _0x136821['sendStatus'](_0x42eba9);}return _0x136821[_0x43fa('0x11')](_0x42eba9)[_0x43fa('0x12')]();};}function respondWithResult(_0x13df33,_0x582ec2){_0x582ec2=_0x582ec2||0xc8;return function(_0xfbf89e){if(_0xfbf89e){return _0x13df33[_0x43fa('0x11')](_0x582ec2)[_0x43fa('0x13')](_0xfbf89e);}};}function respondWithFilteredResult(_0x529c85,_0x24fb1e){return function(_0x4bb4b0){if(_0x4bb4b0){var _0x5bc292=typeof _0x24fb1e['offset']===_0x43fa('0x14')&&typeof _0x24fb1e['limit']===_0x43fa('0x14');var _0x12ae9e=_0x4bb4b0['count'];var _0x27b87f=_0x5bc292?0x0:_0x24fb1e[_0x43fa('0x15')];var _0x32ac9c=_0x5bc292?_0x4bb4b0[_0x43fa('0x16')]:_0x24fb1e[_0x43fa('0x15')]+_0x24fb1e[_0x43fa('0x17')];var _0x5d12ac;if(_0x32ac9c>=_0x12ae9e){_0x32ac9c=_0x12ae9e;_0x5d12ac=0xc8;}else{_0x5d12ac=0xce;}_0x529c85['status'](_0x5d12ac);return _0x529c85[_0x43fa('0x18')](_0x43fa('0x19'),_0x27b87f+'-'+_0x32ac9c+'/'+_0x12ae9e)[_0x43fa('0x13')](_0x4bb4b0);}return null;};}function saveUpdates(_0x1d7adc){return function(_0x660f61){if(_0x660f61){return _0x660f61[_0x43fa('0x1a')](_0x1d7adc)[_0x43fa('0x1b')](function(_0x2d8594){return _0x2d8594;});}return null;};}function removeEntity(_0x3e39b7){return function(_0x4f8492){if(_0x4f8492){return _0x4f8492[_0x43fa('0x1c')]()[_0x43fa('0x1b')](function(){_0x3e39b7[_0x43fa('0x11')](0xcc)[_0x43fa('0x12')]();});}};}function handleEntityNotFound(_0x38c162){return function(_0x4a98bb){if(!_0x4a98bb){_0x38c162[_0x43fa('0x1d')](0x194);}return _0x4a98bb;};}function handleError(_0x3c78fb,_0x2db3dd){_0x2db3dd=_0x2db3dd||0x1f4;return function(_0xa34fc6){logger[_0x43fa('0x1e')](_0xa34fc6[_0x43fa('0x1f')]);if(_0xa34fc6[_0x43fa('0x20')]){delete _0xa34fc6[_0x43fa('0x20')];}_0x3c78fb[_0x43fa('0x11')](_0x2db3dd)['send'](_0xa34fc6);};}function getInteractionUsers(_0x553e5e,_0xdb62ec){return new BPromise(function(_0x197eac,_0x28f695){try{if(_0xdb62ec[_0x553e5e['id']]){_0x553e5e[_0x43fa('0x21')]=_[_0x43fa('0x22')](_0xdb62ec[_0x553e5e['id']],function(_0x243dda){return{'id':_0x243dda['id'],'fullname':_0x243dda['fullname']};});}}catch(_0x4f6101){_0x28f695(_0x4f6101);}_0x197eac(_0x553e5e);});}function getInteractionTags(_0x1fa077,_0x3c5ce1){return new BPromise(function(_0x3d6365,_0x4d88b1){try{if(_0x1fa077['TagIds']){_0x1fa077[_0x43fa('0x23')]=[];_0x1fa077[_0x43fa('0x24')][_0x43fa('0x25')](',')[_0x43fa('0x26')](function(_0x4d6c8c){_0x1fa077[_0x43fa('0x23')][_0x43fa('0x27')](_0x3c5ce1[_0x4d6c8c]);});}delete _0x1fa077[_0x43fa('0x24')];}catch(_0x28b833){_0x4d88b1(_0x28b833);}_0x3d6365(_0x1fa077);});}function getLastMessageText(_0x17c467){return new BPromise(function(_0x3d89cc,_0x2c3acd){return db[_0x43fa('0x28')][_0x43fa('0x29')]({'where':{'$and':[{'MailInteractionId':_0x17c467['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x43fa('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x43fa('0x2b')],'order':_0x43fa('0x2c'),'raw':!![]})['then'](function(_0x4fbe60){if(_0x4fbe60&&_0x4fbe60[_0x43fa('0x2b')]){_0x17c467[_0x43fa('0x2d')]=_[_0x43fa('0x2e')](_0x4fbe60[_0x43fa('0x2b')]);}_0x3d89cc(_0x17c467);})['catch'](function(_0xd8db16){_0x2c3acd(_0xd8db16);});});}function updateMailInteraction(_0x1ab736,_0x4739f5,_0x5c9413,_0x1c9fe8){return new BPromise(function(_0x1e2ada,_0x179c3a){return getInteractionUsers(_0x1ab736,_0x5c9413)[_0x43fa('0x1b')](function(_0x58919a){return getInteractionTags(_0x58919a,_0x4739f5);})[_0x43fa('0x1b')](function(_0x53ed8d){return getStateInteraction(_0x53ed8d);})[_0x43fa('0x1b')](function(_0x79683a){if(_0x1c9fe8){_0x1e2ada(getLastMessageText(_0x79683a));}else{_0x1e2ada(_0x79683a);}})[_0x43fa('0x2f')](function(_0x4e06e0){_0x179c3a(_0x4e06e0);});});}function getStateInteraction(_0x383fee){return new BPromise(function(_0x52d4e5){_0x383fee['waiting']=0x0;_0x383fee[_0x43fa('0x30')]=0x0;_0x383fee[_0x43fa('0x31')]=0x0;_0x383fee[_0x43fa('0x32')]=0x0;_0x383fee['total']=0x0;if(!_0x383fee[_0x43fa('0x33')]&&!_0x383fee[_0x43fa('0x34')]){_0x383fee[_0x43fa('0x35')]+=0x1;}if(!_0x383fee[_0x43fa('0x33')]&&_0x383fee[_0x43fa('0x34')]){_0x383fee['talking']+=0x1;if(_0x383fee[_0x43fa('0x35')]){_0x383fee[_0x43fa('0x35')]-=0x1;}}if(_0x383fee[_0x43fa('0x33')]&&_0x383fee[_0x43fa('0x34')]){_0x383fee['answered']+=0x1;if(_0x383fee['talking']){_0x383fee[_0x43fa('0x30')]-=0x1;}}if(_0x383fee[_0x43fa('0x33')]&&!_0x383fee[_0x43fa('0x34')]){_0x383fee[_0x43fa('0x32')]+=0x1;if(_0x383fee[_0x43fa('0x35')]){_0x383fee['waiting']-=0x1;}}_0x383fee[_0x43fa('0x36')]+=0x1;_0x52d4e5(_0x383fee);});}exports['index']=function(_0x4cb1bd,_0x236332){var _0x59e332={},_0x8ac566={},_0x3fee69={'count':0x0,'rows':[]};var _0x32c0c2=_[_0x43fa('0x22')](db['MailInteraction']['rawAttributes'],function(_0x4911f6){return{'name':_0x4911f6[_0x43fa('0x37')],'type':_0x4911f6[_0x43fa('0x38')]['key']};});_0x8ac566[_0x43fa('0x39')]=_[_0x43fa('0x22')](_0x32c0c2,_0x43fa('0x20'));_0x8ac566[_0x43fa('0x3a')]=_['keys'](_0x4cb1bd[_0x43fa('0x3a')]);_0x8ac566[_0x43fa('0x3b')]=_['intersection'](_0x8ac566['model'],_0x8ac566[_0x43fa('0x3a')]);_0x59e332['attributes']=_[_0x43fa('0x3c')](_0x8ac566[_0x43fa('0x39')],qs['fields'](_0x4cb1bd[_0x43fa('0x3a')]['fields']));_0x59e332[_0x43fa('0x3d')]=_0x59e332[_0x43fa('0x3d')][_0x43fa('0x3e')]?_0x59e332['attributes']:_0x8ac566[_0x43fa('0x39')];if(!_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x3f')](_0x43fa('0x40'))){_0x59e332[_0x43fa('0x17')]=qs[_0x43fa('0x17')](_0x4cb1bd['query'][_0x43fa('0x17')]);_0x59e332['offset']=qs[_0x43fa('0x15')](_0x4cb1bd['query'][_0x43fa('0x15')]);}_0x59e332[_0x43fa('0x41')]=qs[_0x43fa('0x42')](_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x42')]);_0x59e332['where']=qs[_0x43fa('0x3b')](_['pick'](_0x4cb1bd['query'],_0x8ac566['filters']),_0x32c0c2);var _0x436da4=[];var _0x2b4d5e=squel[_0x43fa('0x43')]()[_0x43fa('0x44')]('id')[_0x43fa('0x44')]('name')[_0x43fa('0x44')](_0x43fa('0x45'))[_0x43fa('0x46')](_0x43fa('0x47'));var _0x1d1407=squel[_0x43fa('0x43')]()[_0x43fa('0x44')](_0x43fa('0x48'))[_0x43fa('0x44')](_0x43fa('0x49'))[_0x43fa('0x44')]('ui.MailInteractionId')[_0x43fa('0x46')](_0x43fa('0x4a'),'ui')['left_join'](_0x43fa('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x193a0b=squel[_0x43fa('0x43')]()[_0x43fa('0x46')](_0x43fa('0x4c'),'i')[_0x43fa('0x4d')]('cm_contacts','c',_0x43fa('0x4e'))['left_join'](_0x43fa('0x4b'),'o',_0x43fa('0x4f'))[_0x43fa('0x4d')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x43fa('0x4d')]('mail_messages','me',_0x43fa('0x50'))['left_join']('mail_interaction_has_tags','it',_0x43fa('0x51'))[_0x43fa('0x4d')]('tools_tags','t',_0x43fa('0x52'));var _0x2ee661=squel[_0x43fa('0x53')]();var _0x367c31=[];var _0x51d224=squel[_0x43fa('0x53')]();var _0x172c23;if(_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x54')]){_0x172c23=as['parseSearch'](_0x4cb1bd['query'][_0x43fa('0x54')]);var _0x4c980d=_0x172c23['sqlOperator'];for(var _0x47ac82=0x0;_0x47ac82<_0x172c23[_0x43fa('0x55')][_0x43fa('0x3e')];_0x47ac82++){var _0x382c33=_0x172c23[_0x43fa('0x55')][_0x47ac82];var _0x4541cc='i';var _0x46b2e8=_[_0x43fa('0x56')](_0x32c0c2,['name',_0x382c33[_0x43fa('0x44')]]);if(!_0x46b2e8){switch(_0x382c33[_0x43fa('0x44')]){case'unreadMessages':if(_0x382c33[_0x43fa('0x57')]==0x1){_0x193a0b['having']('`'+_0x382c33[_0x43fa('0x44')]+_0x43fa('0x58'));}else{_0x193a0b[_0x43fa('0x59')]('`'+_0x382c33[_0x43fa('0x44')]+'`\x20>\x200');}break;case'Contact':if(_0x382c33[_0x43fa('0x5a')]===_0x43fa('0x5b')){if(_0x382c33[_0x43fa('0x57')][_0x43fa('0x25')]('\x20')['length']>0x1){_0x2ee661[_0x4c980d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x43fa('0x5c')](_0x382c33['value']),null);}else{var _0x30323c='%'+_0x382c33[_0x43fa('0x57')]+'%';_0x2ee661[_0x4c980d](_0x43fa('0x5d'),_0x30323c,_0x30323c,_0x30323c);}}else{_0x46b2e8=_[_0x43fa('0x56')](_0x32c0c2,['name','ContactId']);_0x382c33[_0x43fa('0x44')]='ContactId';_0x3b82f6=as[_0x43fa('0x5e')](_0x4541cc,_0x46b2e8[_0x43fa('0x38')],_0x382c33);_0x2ee661[_0x4c980d](_0x3b82f6[_0x43fa('0x5f')],_0x3b82f6[_0x43fa('0x57')][_0x43fa('0x60')],_0x3b82f6[_0x43fa('0x57')][_0x43fa('0x12')]);}break;case'Tag':var _0x27b747=_0x382c33[_0x43fa('0x57')][_0x43fa('0x25')](',')[_0x43fa('0x22')](function(_0x208859){return Number(_0x208859);});_0x27b747['forEach'](function(_0xffa87f){_0x51d224['or'](_0x43fa('0x61'),'%,'+_0xffa87f+',%');});_0x367c31=_[_0x43fa('0x62')](_0x367c31,_0x27b747);break;case _0x43fa('0x63'):if(_0x382c33[_0x43fa('0x5a')]===_0x43fa('0x5b')){_0x2ee661[_0x4c980d](_0x43fa('0x64'),'%'+_0x382c33[_0x43fa('0x57')]+'%',null);}else{_0x46b2e8=_[_0x43fa('0x56')](_0x32c0c2,['name',_0x43fa('0x34')]);_0x382c33[_0x43fa('0x44')]=_0x43fa('0x34');_0x3b82f6=as[_0x43fa('0x5e')](_0x4541cc,_0x46b2e8[_0x43fa('0x38')],_0x382c33);_0x2ee661[_0x4c980d](_0x3b82f6['text'],_0x3b82f6['value'][_0x43fa('0x60')],_0x3b82f6[_0x43fa('0x57')][_0x43fa('0x12')]);}break;case _0x43fa('0x2b'):_0x3b82f6=as[_0x43fa('0x5e')]('me',null,_0x382c33);_0x2ee661[_0x4c980d](_0x3b82f6[_0x43fa('0x5f')],_0x3b82f6[_0x43fa('0x57')][_0x43fa('0x60')],_0x3b82f6[_0x43fa('0x57')][_0x43fa('0x12')]);break;}}else{var _0x3b82f6=as[_0x43fa('0x5e')](_0x4541cc,_0x46b2e8[_0x43fa('0x38')],_0x382c33);_0x2ee661[_0x4c980d](_0x3b82f6[_0x43fa('0x5f')],_0x3b82f6[_0x43fa('0x57')][_0x43fa('0x60')],_0x3b82f6[_0x43fa('0x57')][_0x43fa('0x12')]);}}}else{var _0x3b1e83=_(_0x4cb1bd[_0x43fa('0x3a')])[_0x43fa('0x65')]()[_0x43fa('0x22')](function(_0x59e3ea){return _['some'](_0x32c0c2,[_0x43fa('0x20'),_0x59e3ea])?_0x59e3ea:undefined;})[_0x43fa('0x66')]()['value']();if(!_[_0x43fa('0x67')](_0x3b1e83)){_0x3b1e83['forEach'](function(_0x1db777){if(_0x1db777==='MailAccountId'){_0x193a0b[_0x43fa('0x68')](_0x43fa('0x69'),[][_0x43fa('0x6a')](_0x4cb1bd[_0x43fa('0x3a')][_0x1db777]));}else if(_0x1db777===_0x43fa('0x6b')){var _0x5b4981=JSON[_0x43fa('0x6c')](_0x4cb1bd['query'][_0x1db777])[_0x43fa('0x6d')];var _0x310232=JSON[_0x43fa('0x6c')](_0x4cb1bd[_0x43fa('0x3a')][_0x1db777])[_0x43fa('0x6e')];_0x193a0b['where'](_0x43fa('0x6f'),_0x5b4981,_0x310232);}else{if(_0x4cb1bd[_0x43fa('0x3a')][_0x1db777]==='null'){_0x193a0b[_0x43fa('0x68')]('i.'+_0x1db777+'\x20IS\x20NULL');}else{_0x193a0b[_0x43fa('0x68')]('i.'+_0x1db777+_0x43fa('0x70'),_0x4cb1bd['query'][_0x1db777]);}}});}if(_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x71')]){if(_0x4cb1bd[_0x43fa('0x3a')]['read']==0x1){_0x193a0b['having'](_0x43fa('0x72'));}else{_0x193a0b[_0x43fa('0x59')](_0x43fa('0x73'));}}if(_0x4cb1bd[_0x43fa('0x3a')]['tag']){_0x367c31=_[_0x43fa('0x74')](_0x4cb1bd['query']['tag'])?_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x75')]:new Array(_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x75')]);_0x367c31[_0x43fa('0x26')](function(_0x13adec){_0x51d224['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x13adec+',%');});}if(_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x76')]){var _0x117181=_0x4cb1bd['query'][_0x43fa('0x76')][_0x43fa('0x77')]('\x5c','\x5c\x5c')[_0x43fa('0x77')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x117181)){_0x2ee661['or'](_0x43fa('0x78'),_0x117181+'%');}else if(qs[_0x43fa('0x79')](_0x117181)){_0x2ee661['or']('c.email\x20LIKE\x20?',_0x117181+'%');}else{_0x2ee661['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x43fa('0x5c')](_0x117181))['or'](_0x43fa('0x7a'),qs[_0x43fa('0x5c')](_0x117181));}}}_0x193a0b[_0x43fa('0x68')](_0x2ee661);_0x193a0b[_0x43fa('0x7b')](_0x43fa('0x7c'));var _0x241200={'type':db[_0x43fa('0x7d')][_0x43fa('0x7e')][_0x43fa('0x7f')],'raw':!![]};var _0x2161f6=_0x193a0b[_0x43fa('0x80')]();_0x2161f6[_0x43fa('0x44')](_0x43fa('0x7c'));_0x2161f6[_0x43fa('0x44')](_0x43fa('0x81'),'unreadMessages');if(_0x59e332[_0x43fa('0x41')]){_0x59e332[_0x43fa('0x41')][_0x43fa('0x26')](function(_0xc75748){var _0x4e2a1f=_0xc75748[0x0]===_0x43fa('0x82')?_0xc75748[0x0]:'i.'+_0xc75748[0x0];_0x193a0b['order'](_0x4e2a1f,_0xc75748[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x367c31)){_0x193a0b[_0x43fa('0x59')](_0x51d224);_0x2161f6['where'](_0x43fa('0x83'),_0x367c31);}BPromise[_0x43fa('0x84')]()[_0x43fa('0x1b')](function(){if(!_0x172c23){if(_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x85')])return;_0x2161f6['where'](_0x43fa('0x86'));_0x193a0b[_0x43fa('0x68')](_0x43fa('0x86'));return;}if(_0x4cb1bd[_0x43fa('0x87')]['role']!=='agent')return;return _0x4cb1bd['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x43fa('0x1b')](function(_0x830a70){if(_[_0x43fa('0x67')](_0x830a70)){_0x2161f6['where'](_0x43fa('0x88'));_0x193a0b[_0x43fa('0x68')](_0x43fa('0x88'));}else{_0x2161f6[_0x43fa('0x68')]('i.MailAccountId\x20IN\x20?',_[_0x43fa('0x22')](_0x830a70,'id'));_0x193a0b[_0x43fa('0x68')](_0x43fa('0x69'),_[_0x43fa('0x22')](_0x830a70,'id'));}});})[_0x43fa('0x1b')](function(){if(_0x4cb1bd[_0x43fa('0x87')][_0x43fa('0x89')]===_0x43fa('0x8a')&&!_0x172c23&&!_0x4cb1bd['query']['MailAccountId'])return[];return db[_0x43fa('0x8b')][_0x43fa('0x3a')](_0x2161f6[_0x43fa('0x8c')](),_0x241200);})['then'](function(_0x3ff0ce){_0x3fee69[_0x43fa('0x16')]=_0x3ff0ce[_0x43fa('0x3e')];if(_0x3fee69['count']===0x0)return[];return db[_0x43fa('0x8b')][_0x43fa('0x3a')](_0x2b4d5e[_0x43fa('0x8c')](),_0x241200)['then'](function(_0x10123f){_0x436da4=_[_0x43fa('0x8d')](_0x10123f,'id');_0x241200=_[_0x43fa('0x8e')](_0x241200,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4cb1bd[_0x43fa('0x3a')][_0x43fa('0x8f')]){_0x59e332['attributes'][_0x43fa('0x26')](function(_0x941b71){_0x193a0b[_0x43fa('0x44')]('i.'+_0x941b71);});}else{_0x193a0b['field'](_0x43fa('0x81'),_0x43fa('0x90'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x91'),_0x43fa('0x92'));_0x193a0b[_0x43fa('0x44')]('a.mandatoryDisposition',_0x43fa('0x93'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x94'),_0x43fa('0x82'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x7c'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x95'));_0x193a0b['field']('i.updatedAt');_0x193a0b[_0x43fa('0x44')](_0x43fa('0x96'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x97'));_0x193a0b['field'](_0x43fa('0x98'));_0x193a0b[_0x43fa('0x44')]('i.lastMsgAt');_0x193a0b[_0x43fa('0x44')](_0x43fa('0x99'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x9a'));_0x193a0b[_0x43fa('0x44')]('i.disposition');_0x193a0b[_0x43fa('0x44')](_0x43fa('0x9b'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x9c'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x9d'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0x9e'));_0x193a0b[_0x43fa('0x44')]('i.ContactId');_0x193a0b[_0x43fa('0x44')](_0x43fa('0x9f'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0xa0'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0xa1'),_0x43fa('0xa2'));_0x193a0b['field'](_0x43fa('0xa3'),'Contact.lastName');_0x193a0b[_0x43fa('0x44')](_0x43fa('0xa4'),'Contact.email');_0x193a0b['field'](_0x43fa('0xa5'),_0x43fa('0xa6'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0xa7'),_0x43fa('0xa8'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0xa9'),_0x43fa('0xaa'));_0x193a0b['field'](_0x43fa('0xab'),_0x43fa('0xac'));_0x193a0b[_0x43fa('0x44')](_0x43fa('0xad'),_0x43fa('0xae'));_0x193a0b[_0x43fa('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x59e332['limit'])_0x193a0b[_0x43fa('0x17')](_0x59e332[_0x43fa('0x17')]);if(_0x59e332['offset'])_0x193a0b['offset'](_0x59e332['offset']);return db[_0x43fa('0x8b')][_0x43fa('0x3a')](_0x193a0b[_0x43fa('0x8c')](),_0x241200);})[_0x43fa('0x1b')](function(_0x23234b){if(_0x23234b[_0x43fa('0x3e')]>0x0)_0x1d1407['where']('ui.MailInteractionId\x20IN\x20?',_[_0x43fa('0x22')](_0x23234b,'id'));return db[_0x43fa('0x8b')][_0x43fa('0x3a')](_0x1d1407[_0x43fa('0x8c')](),_0x241200)[_0x43fa('0x1b')](function(_0x2a2670){var _0x431d41=_['groupBy'](_0x2a2670,_0x43fa('0xaf'));var _0xce2cf6=[];return db[_0x43fa('0xb0')][_0x43fa('0x29')]({'attributes':[_0x43fa('0xb1')],'raw':!![]})[_0x43fa('0x1b')](function(_0x737374){var _0x39a154=_0x737374['enableEmailPreview'];_0x23234b[_0x43fa('0x26')](function(_0x3dfef0){_0xce2cf6[_0x43fa('0x27')](updateMailInteraction(_0x3dfef0,_0x436da4,_0x431d41,_0x39a154));});return BPromise[_0x43fa('0xb2')](_0xce2cf6);});});});})[_0x43fa('0x1b')](function(_0x692784){_0x3fee69[_0x43fa('0xb3')]=_0x692784;return _0x3fee69;})[_0x43fa('0x1b')](respondWithFilteredResult(_0x236332,_0x59e332))[_0x43fa('0x2f')](handleError(_0x236332,null));};exports[_0x43fa('0xb4')]=function(_0x46dd4f,_0x4a29c2){var _0x4cb33d={'raw':![],'where':{'id':_0x46dd4f[_0x43fa('0xb5')]['id']}},_0x12d734={};_0x12d734['model']=_[_0x43fa('0x65')](db[_0x43fa('0xb6')][_0x43fa('0xb7')]);_0x12d734['query']=_[_0x43fa('0x65')](_0x46dd4f[_0x43fa('0x3a')]);_0x12d734['filters']=_[_0x43fa('0x3c')](_0x12d734['model'],_0x12d734[_0x43fa('0x3a')]);_0x4cb33d[_0x43fa('0x3d')]=_['intersection'](_0x12d734['model'],qs['fields'](_0x46dd4f[_0x43fa('0x3a')][_0x43fa('0x8f')]));_0x4cb33d[_0x43fa('0x3d')]=_0x4cb33d[_0x43fa('0x3d')][_0x43fa('0x3e')]?_0x4cb33d[_0x43fa('0x3d')]:_0x12d734[_0x43fa('0x39')];if(_0x46dd4f[_0x43fa('0x3a')][_0x43fa('0xb8')]){_0x4cb33d[_0x43fa('0xb9')]=[{'all':!![]}];}_0x4cb33d=_['merge']({},_0x4cb33d,_0x46dd4f[_0x43fa('0xba')]);return db['MailInteraction'][_0x43fa('0x56')](_0x4cb33d)[_0x43fa('0x1b')](handleEntityNotFound(_0x4a29c2,null))[_0x43fa('0x1b')](respondWithResult(_0x4a29c2,null))[_0x43fa('0x2f')](handleError(_0x4a29c2,null));};exports[_0x43fa('0xbb')]=function(_0x423787,_0x3cd8d1){return db[_0x43fa('0xb6')][_0x43fa('0xbb')](_0x423787[_0x43fa('0xbc')],{})[_0x43fa('0x1b')](respondWithResult(_0x3cd8d1,0xc9))['catch'](handleError(_0x3cd8d1,null));};exports['update']=function(_0x307272,_0x14f521){if(_0x307272[_0x43fa('0xbc')]['id']){delete _0x307272['body']['id'];}return db[_0x43fa('0xb6')][_0x43fa('0x56')]({'where':{'id':_0x307272[_0x43fa('0xb5')]['id']}})['then'](handleEntityNotFound(_0x14f521,null))[_0x43fa('0x1b')](saveUpdates(_0x307272[_0x43fa('0xbc')],null))['then'](respondWithResult(_0x14f521,null))[_0x43fa('0x2f')](handleError(_0x14f521,null));};exports[_0x43fa('0x1c')]=function(_0x52424a,_0x6bde30){return db['MailInteraction'][_0x43fa('0x56')]({'where':{'id':_0x52424a[_0x43fa('0xb5')]['id']}})[_0x43fa('0x1b')](handleEntityNotFound(_0x6bde30,null))[_0x43fa('0x1b')](removeEntity(_0x6bde30,null))['catch'](handleError(_0x6bde30,null));};exports['describe']=function(_0x18954b,_0x2fecfc){return db[_0x43fa('0xb6')]['describe']()[_0x43fa('0x1b')](respondWithResult(_0x2fecfc,null))[_0x43fa('0x2f')](handleError(_0x2fecfc,null));};exports[_0x43fa('0xbd')]=function(_0x2d554b,_0x4908e3){return db[_0x43fa('0x28')][_0x43fa('0x56')]({'where':{'id':_0x2d554b[_0x43fa('0xb5')]['id']}})[_0x43fa('0x1b')](handleEntityNotFound(_0x4908e3,null))['then'](function(_0x426e43){if(_0x426e43){return _0x426e43[_0x43fa('0xbd')](_0x2d554b[_0x43fa('0xbc')][_0x43fa('0xbe')],_[_0x43fa('0xbf')](_0x2d554b[_0x43fa('0xbc')],[_0x43fa('0xbe'),'id'])||{});}})[_0x43fa('0x1b')](respondWithResult(_0x4908e3,null))['catch'](handleError(_0x4908e3,null));};exports[_0x43fa('0xc0')]=function(_0x27c62e,_0x34f877){var _0x47412d={'raw':![],'where':{}};var _0xa039ef={};var _0x271d41={'count':0x0,'rows':[]};return db['MailInteraction'][_0x43fa('0x29')]({'where':{'id':_0x27c62e['params']['id']}})[_0x43fa('0x1b')](handleEntityNotFound(_0x34f877,null))[_0x43fa('0x1b')](function(_0x430768){if(_0x430768){_0xa039ef['model']=_[_0x43fa('0x65')](db[_0x43fa('0x28')]['rawAttributes']);_0xa039ef[_0x43fa('0x3a')]=_[_0x43fa('0x65')](_0x27c62e[_0x43fa('0x3a')]);_0xa039ef[_0x43fa('0x3b')]=_['intersection'](_0xa039ef[_0x43fa('0x39')],_0xa039ef[_0x43fa('0x3a')]);_0x47412d[_0x43fa('0x3d')]=_['intersection'](_0xa039ef[_0x43fa('0x39')],qs['fields'](_0x27c62e[_0x43fa('0x3a')][_0x43fa('0x8f')]));_0x47412d[_0x43fa('0x3d')]=_0x47412d[_0x43fa('0x3d')][_0x43fa('0x3e')]?_0x47412d[_0x43fa('0x3d')]:_0xa039ef['model'];if(!_0x27c62e[_0x43fa('0x3a')][_0x43fa('0x3f')]('nolimit')){_0x47412d[_0x43fa('0x17')]=qs[_0x43fa('0x17')](_0x27c62e[_0x43fa('0x3a')]['limit']);_0x47412d['offset']=qs[_0x43fa('0x15')](_0x27c62e[_0x43fa('0x3a')][_0x43fa('0x15')]);}_0x47412d[_0x43fa('0x41')]=qs[_0x43fa('0x42')](_0x27c62e['query'][_0x43fa('0x42')]);_0x47412d[_0x43fa('0x68')]=qs['filters'](_[_0x43fa('0xc1')](_0x27c62e[_0x43fa('0x3a')],_0xa039ef[_0x43fa('0x3b')]));_0x47412d[_0x43fa('0x68')][_0x43fa('0xaf')]=_0x430768['id'];if(_0x27c62e[_0x43fa('0x3a')]['filter']){_0x47412d['where']=_['merge'](_0x47412d[_0x43fa('0x68')],{'$or':_[_0x43fa('0x22')](_0x47412d[_0x43fa('0x3d')],function(_0x13bf02){var _0x245703={};_0x245703[_0x13bf02]={'$like':'%'+_0x27c62e['query'][_0x43fa('0x76')]+'%'};return _0x245703;})});}if(_0x27c62e[_0x43fa('0x3a')][_0x43fa('0x6d')]){var _0x436464=_0x27c62e[_0x43fa('0x3a')][_0x43fa('0x6d')][_0x43fa('0x25')](',');var _0xd78253={};_0xd78253[_0x436464[0x0]]={'$gte':moment(_0x436464[0x1])[_0x43fa('0xc2')](_0x43fa('0xc3'))};_0x47412d[_0x43fa('0x68')]=_[_0x43fa('0x8e')](_0x47412d['where'],_0xd78253);}_0x47412d=_['merge']({},_0x47412d,_0x27c62e['options']);return db[_0x43fa('0x28')][_0x43fa('0x16')]({'where':_0x47412d[_0x43fa('0x68')]})[_0x43fa('0x1b')](function(_0xe4eff7){_0x271d41[_0x43fa('0x16')]=_0xe4eff7;if(_0x27c62e['query'][_0x43fa('0xb8')]){_0x47412d[_0x43fa('0xb9')]=[{'all':!![]}];}return db[_0x43fa('0x28')][_0x43fa('0xc4')](_0x47412d);})['then'](function(_0x4dcc40){if(_0x27c62e[_0x43fa('0x3a')][_0x43fa('0xc5')]===_0x43fa('0xc6')){for(var _0x41f7b2=0x0;_0x41f7b2<_0x4dcc40[_0x43fa('0x3e')];_0x41f7b2++){_0x4dcc40[_0x41f7b2]['body']=juice(_0x4dcc40[_0x41f7b2]['body']);}}_0x271d41['rows']=_0x4dcc40;return _0x271d41;});}})[_0x43fa('0x1b')](respondWithFilteredResult(_0x34f877,_0x47412d))[_0x43fa('0x2f')](handleError(_0x34f877,null));};exports['addTags']=function(_0x159a13,_0x517ab2){return db[_0x43fa('0xb6')]['find']({'where':{'id':_0x159a13[_0x43fa('0xb5')]['id']}})[_0x43fa('0x1b')](handleEntityNotFound(_0x517ab2,null))[_0x43fa('0x1b')](function(_0x7fa6b8){if(_0x7fa6b8){return _0x7fa6b8['setTags'](_0x159a13[_0x43fa('0xbc')][_0x43fa('0xbe')],_[_0x43fa('0xbf')](_0x159a13[_0x43fa('0xbc')],[_0x43fa('0xbe'),'id'])||{})[_0x43fa('0xc7')](function(){return db['Tag'][_0x43fa('0xc4')]({'attributes':['id',_0x43fa('0x20'),_0x43fa('0x45')],'where':{'id':_0x159a13['body'][_0x43fa('0xbe')]}});})[_0x43fa('0x1b')](function(_0x114d42){socket['emit'](_0x43fa('0xc8'),{'id':Number(_0x159a13[_0x43fa('0xb5')]['id']),'tags':_0x114d42||[]});return{'id':Number(_0x159a13[_0x43fa('0xb5')]['id']),'tags':_0x114d42||[]};});}})[_0x43fa('0x1b')](respondWithResult(_0x517ab2,null))[_0x43fa('0x2f')](handleError(_0x517ab2,null));};exports['removeTags']=function(_0x115013,_0x3986cb){return db[_0x43fa('0xb6')][_0x43fa('0x56')]({'where':{'id':_0x115013[_0x43fa('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3986cb,null))[_0x43fa('0x1b')](function(_0x5e373b){if(_0x5e373b){return _0x5e373b[_0x43fa('0xc9')](_0x115013['query'][_0x43fa('0xbe')]);}})[_0x43fa('0x1b')](respondWithStatusCode(_0x3986cb,null))[_0x43fa('0x2f')](handleError(_0x3986cb,null));};exports['download']=function(_0x4af385,_0x3d9c8b){var _0x38b2af=moment()[_0x43fa('0xca')]()[_0x43fa('0x8c')]();var _0x7c08c2=path[_0x43fa('0xcb')](config['root'],_0x43fa('0xcc'),_0x43fa('0xcd'),_0x43fa('0xce'));var _0xce6f8c=path[_0x43fa('0xcb')](config['root'],'server',_0x43fa('0xcd'),_0x43fa('0xcf'));var _0x4aa2cb=path[_0x43fa('0xcb')](_0x7c08c2,_0x38b2af);var _0x2d00f0=util[_0x43fa('0xc2')](_0x43fa('0xd0'),_0x4af385[_0x43fa('0xb5')]['id'],_0x38b2af);var _0x169c0a=path[_0x43fa('0xcb')](_0x7c08c2,_0x2d00f0);var _0x274672=[];if(_0x4af385[_0x43fa('0x3a')][_0x43fa('0xcf')]){_0x274672[_0x43fa('0x27')]({'model':db[_0x43fa('0xd1')],'as':_0x43fa('0xd2'),'raw':!![]});}var _0x56827a=[{'model':db[_0x43fa('0x28')],'as':_0x43fa('0xd3'),'attributes':['id','body',_0x43fa('0x46'),'to','cc',_0x43fa('0xd4'),_0x43fa('0xd5'),_0x43fa('0x6b')],'where':{'secret':![]},'order':qs[_0x43fa('0x42')]('id'),'include':_0x274672}];return db['MailInteraction'][_0x43fa('0x56')]({'where':{'id':_0x4af385['params']['id']},'include':_0x56827a})['then'](handleEntityNotFound(_0x3d9c8b,null))[_0x43fa('0x1b')](function(_0x4356b5){if(_0x4356b5&&_0x4356b5['Messages']){var _0x3a29c6=_0x4356b5['get']({'plain':!![]});fs[_0x43fa('0xd6')](_0x4aa2cb);return BPromise[_0x43fa('0xd7')](_0x3a29c6['Messages'],function(_0x327fa8,_0x4d0a8d){var _0x42779f={'from':_0x327fa8['from'],'to':_0x327fa8['to'],'subject':_0x327fa8[_0x43fa('0xd5')],'html':htmlEntities[_0x43fa('0xd8')](_0x327fa8[_0x43fa('0xbc')]),'headers':{'Date':moment(_0x327fa8['createdAt'])[_0x43fa('0xc2')](_0x43fa('0xd9'))},'attachments':[]};if(_0x327fa8['cc']){_0x42779f[_0x43fa('0xda')]['Cc']=_0x327fa8['cc'];}if(_0x327fa8[_0x43fa('0xd4')]){_0x42779f[_0x43fa('0xda')][_0x43fa('0xdb')]=_0x327fa8[_0x43fa('0xd4')];}return new BPromise(function(_0x493eeb,_0x2deca3){if(_0x327fa8[_0x43fa('0xd2')]){for(var _0x553d90=0x0;_0x553d90<_0x327fa8[_0x43fa('0xd2')][_0x43fa('0x3e')];_0x553d90++){var _0x58071b=_0x327fa8['Attachments'][_0x553d90];var _0x39a8d9=path['join'](_0xce6f8c,_0x58071b[_0x43fa('0xdc')]);if(fs[_0x43fa('0xdd')](_0x39a8d9)){_0x42779f['attachments']['push']({'name':_0x58071b['name'],'contentType':_0x58071b['type'],'data':fs[_0x43fa('0xde')](_0x39a8d9)});}}}emlformat[_0x43fa('0xdf')](_0x42779f,function(_0x3eb485,_0x4258c9){if(_0x3eb485)return _0x2deca3(_0x3eb485);fs['writeFileSync'](path[_0x43fa('0xcb')](_0x4aa2cb,util[_0x43fa('0xc2')](_0x43fa('0xe0'),_0x4d0a8d)),_0x4258c9);return _0x493eeb(_0x4258c9);});});})[_0x43fa('0x1b')](function(){return new BPromise(function(_0x96675f,_0x5637f9){zipdir(_0x4aa2cb,{'saveTo':_0x169c0a},function(_0xfe0c0b,_0x4ccedb){if(_0xfe0c0b)return _0x5637f9(_0xfe0c0b);return _0x96675f(_0x4ccedb);});})[_0x43fa('0x1b')](function(){return new BPromise(function(_0x20babd,_0x181ee4){rimraf(_0x4aa2cb,function(_0x2698a9){if(_0x2698a9)_0x181ee4(_0x2698a9);return _0x20babd();});});})[_0x43fa('0x1b')](function(){return _0x3d9c8b[_0x43fa('0xe1')](_0x169c0a,_0x2d00f0,function(_0x24e4fb){if(!_0x24e4fb)fs[_0x43fa('0xe2')](_0x169c0a);});});});}else{return _0x3d9c8b[_0x43fa('0x1d')](0xc8);}})['catch'](handleError(_0x3d9c8b,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 64d72a6..0882bf1 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 _0xe536=['hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1f6bcc,_0x2f7916){var _0x35c7ae=function(_0x57ac83){while(--_0x57ac83){_0x1f6bcc['push'](_0x1f6bcc['shift']());}};_0x35c7ae(++_0x2f7916);}(_0xe536,0x119));var _0x6e53=function(_0x583125,_0x34c12b){_0x583125=_0x583125-0x0;var _0x118c4d=_0xe536[_0x583125];return _0x118c4d;};'use strict';var EventEmitter=require(_0x6e53('0x0'));var MailInteraction=require(_0x6e53('0x1'))['db'][_0x6e53('0x2')];var MailMessage=require(_0x6e53('0x1'))['db'][_0x6e53('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6e53('0x4')](0x0);var events={'afterCreate':_0x6e53('0x5'),'afterUpdate':_0x6e53('0x6'),'afterDestroy':_0x6e53('0x7')};function emitEvent(_0xccb74e){return function(_0x2f1fc5,_0x4788c4,_0x1e97dc){_0x2f1fc5[_0x6e53('0x8')]({'attributes':['id'],'raw':!![]})[_0x6e53('0x9')](function(_0x2d4283){_0x2f1fc5[_0x6e53('0xa')](_0x6e53('0xb'),_0x2d4283[_0x6e53('0xc')](function(_0x3c376c){return{'id':_0x3c376c['id']};}));return MailMessage[_0x6e53('0xd')]({'where':{'MailInteractionId':_0x2f1fc5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6e53('0x9')](function(_0xb2ae73){_0x2f1fc5[_0x6e53('0xa')](_0x6e53('0xe'),_0xb2ae73[_0x6e53('0xf')]);MailInteractionEvents['emit'](_0xccb74e+':'+_0x2f1fc5['id'],_0x2f1fc5);MailInteractionEvents[_0x6e53('0x10')](_0xccb74e,_0x2f1fc5);_0x1e97dc(null);})[_0x6e53('0x11')](_0x1e97dc(null));};}for(var e in events){if(events[_0x6e53('0x12')](e)){var event=events[e];MailInteraction[_0x6e53('0x13')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x3945=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0x221272,_0x29146a){var _0xe0a9d7=function(_0x44ee43){while(--_0x44ee43){_0x221272['push'](_0x221272['shift']());}};_0xe0a9d7(++_0x29146a);}(_0x3945,0x163));var _0x5394=function(_0x573709,_0x4aef87){_0x573709=_0x573709-0x0;var _0x34d6bf=_0x3945[_0x573709];return _0x34d6bf;};'use strict';var EventEmitter=require(_0x5394('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x5394('0x1'))['db'][_0x5394('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x5394('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5394('0x4'),'afterDestroy':_0x5394('0x5')};function emitEvent(_0x42c61b){return function(_0x329f3d,_0x3b533b,_0x131e69){_0x329f3d[_0x5394('0x6')]({'attributes':['id'],'raw':!![]})[_0x5394('0x7')](function(_0x381d68){_0x329f3d[_0x5394('0x8')](_0x5394('0x9'),_0x381d68[_0x5394('0xa')](function(_0x184c5c){return{'id':_0x184c5c['id']};}));return MailMessage[_0x5394('0xb')]({'where':{'MailInteractionId':_0x329f3d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5394('0x7')](function(_0x194cde){_0x329f3d[_0x5394('0x8')](_0x5394('0xc'),_0x194cde['length']);MailInteractionEvents['emit'](_0x42c61b+':'+_0x329f3d['id'],_0x329f3d);MailInteractionEvents[_0x5394('0xd')](_0x42c61b,_0x329f3d);_0x131e69(null);})[_0x5394('0xe')](_0x131e69(null));};}for(var e in events){if(events[_0x5394('0xf')](e)){var event=events[e];MailInteraction[_0x5394('0x10')](e,emitEvent(event));}}module[_0x5394('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index e4852bd..c8a6fd8 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 _0xbc79=['MailMessage','then','catch','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','get'];(function(_0x423608,_0x3f29dc){var _0x2eb22e=function(_0x2f4561){while(--_0x2f4561){_0x423608['push'](_0x423608['shift']());}};_0x2eb22e(++_0x3f29dc);}(_0xbc79,0x108));var _0x9bc7=function(_0x1ef8e3,_0x14dea9){_0x1ef8e3=_0x1ef8e3-0x0;var _0x703ceb=_0xbc79[_0x1ef8e3];return _0x703ceb;};'use strict';var _=require(_0x9bc7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9bc7('0x1'));var moment=require(_0x9bc7('0x2'));var BPromise=require('bluebird');var rp=require(_0x9bc7('0x3'));var fs=require('fs');var path=require(_0x9bc7('0x4'));var rimraf=require(_0x9bc7('0x5'));var config=require(_0x9bc7('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x9bc7('0x7')]=function(_0x216e30,_0x258dac){return _0x216e30[_0x9bc7('0x8')](_0x9bc7('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x9bc7('0xa'),'fields':[_0x9bc7('0xb'),'to'],'type':_0x9bc7('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x56c7e9,_0xa2da32,_0x374cfa){if(_0x56c7e9['substatus']){_0x56c7e9[_0x9bc7('0xd')]=moment()[_0x9bc7('0xe')](_0x9bc7('0xf'));}if(_0x56c7e9[_0x9bc7('0x10')]){_0x56c7e9[_0x9bc7('0x11')]=moment()[_0x9bc7('0xe')](_0x9bc7('0xf'));}_0x374cfa(null,_0xa2da32);},'beforeUpdate':function(_0x2e54c0,_0x2e13cc,_0x3fc0fb){if(_0x2e54c0['changed']('substatus')){_0x2e54c0[_0x9bc7('0xd')]=_0x2e54c0['substatus']?moment()['format'](_0x9bc7('0xf')):null;}if(_0x2e54c0[_0x9bc7('0x12')](_0x9bc7('0x10'))){_0x2e54c0[_0x9bc7('0x11')]=moment()[_0x9bc7('0xe')](_0x9bc7('0xf'));_0x2e54c0[_0x9bc7('0x13')]=null;_0x2e54c0['substatusAt']=null;}_0x3fc0fb(null,_0x2e54c0);},'afterUpdate':function(_0x4c7a6a,_0xd7f136,_0x515e82){var _0x384af3=_0x216e30[_0x9bc7('0x14')];var _0x257a0b=_0x4c7a6a[_0x9bc7('0x15')]({'plain':!![]});if(_0x257a0b[_0x9bc7('0x10')]){return _0x384af3[_0x9bc7('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x257a0b['id']}})[_0x9bc7('0x17')](function(){_0x515e82();})[_0x9bc7('0x18')](function(_0x44d7ee){_0x515e82(_0x44d7ee);});}else{_0x515e82();}}},'charset':'utf8mb4','collate':_0x9bc7('0x19')});}; \ No newline at end of file +var _0x1665=['fti_mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1665,0xa0));var _0x5166=function(_0x4d93c9,_0x4775ae){_0x4d93c9=_0x4d93c9-0x0;var _0x48536d=_0x1665[_0x4d93c9];return _0x48536d;};'use strict';var _=require(_0x5166('0x0'));var util=require(_0x5166('0x1'));var logger=require(_0x5166('0x2'))(_0x5166('0x3'));var moment=require(_0x5166('0x4'));var BPromise=require(_0x5166('0x5'));var rp=require(_0x5166('0x6'));var fs=require('fs');var path=require(_0x5166('0x7'));var rimraf=require(_0x5166('0x8'));var config=require(_0x5166('0x9'));var attributes=require(_0x5166('0xa'));module[_0x5166('0xb')]=function(_0x3cc192,_0x42d02e){return _0x3cc192['define'](_0x5166('0xc'),attributes,{'tableName':_0x5166('0xd'),'paranoid':![],'indexes':[{'name':_0x5166('0xe'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x498860,_0x29e554,_0x3d536a){if(_0x498860[_0x5166('0xf')]){_0x498860[_0x5166('0x10')]=moment()[_0x5166('0x11')](_0x5166('0x12'));}if(_0x498860[_0x5166('0x13')]){_0x498860[_0x5166('0x14')]=moment()[_0x5166('0x11')](_0x5166('0x12'));}_0x3d536a(null,_0x29e554);},'beforeUpdate':function(_0x3240f7,_0x53c1bb,_0x47ce58){if(_0x3240f7[_0x5166('0x15')](_0x5166('0xf'))){_0x3240f7[_0x5166('0x10')]=_0x3240f7[_0x5166('0xf')]?moment()[_0x5166('0x11')](_0x5166('0x12')):null;}if(_0x3240f7[_0x5166('0x15')](_0x5166('0x13'))){_0x3240f7[_0x5166('0x14')]=moment()[_0x5166('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x3240f7[_0x5166('0xf')]=null;_0x3240f7[_0x5166('0x10')]=null;}_0x47ce58(null,_0x3240f7);},'afterUpdate':function(_0x187e56,_0x235957,_0x3da2dd){var _0x4da7ae=_0x3cc192[_0x5166('0x16')];var _0x1e6604=_0x187e56[_0x5166('0x17')]({'plain':!![]});if(_0x1e6604[_0x5166('0x13')]){return _0x4da7ae[_0x5166('0x18')][_0x5166('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x1e6604['id']}})[_0x5166('0x1a')](function(){_0x3da2dd();})[_0x5166('0x1b')](function(_0x415e8c){_0x3da2dd(_0x415e8c);});}else{_0x3da2dd();}}},'charset':'utf8mb4','collate':_0x5166('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 190bcf2..a61696a 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 _0x1017=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','body','options','raw','attributes','limit','then','info','AddTagsToMailInteraction','MailInteraction','find','addTags','omit','ids','spread','AddTags','lodash'];(function(_0x3b8ecd,_0x35226d){var _0x5eb178=function(_0xcac696){while(--_0xcac696){_0x3b8ecd['push'](_0x3b8ecd['shift']());}};_0x5eb178(++_0x35226d);}(_0x1017,0xe5));var _0x7101=function(_0x3f3c5e,_0x42b09c){_0x3f3c5e=_0x3f3c5e-0x0;var _0x1fa985=_0x1017[_0x3f3c5e];return _0x1fa985;};'use strict';var _=require(_0x7101('0x0'));var util=require(_0x7101('0x1'));var moment=require(_0x7101('0x2'));var BPromise=require(_0x7101('0x3'));var rs=require(_0x7101('0x4'));var fs=require('fs');var Redis=require(_0x7101('0x5'));var db=require(_0x7101('0x6'))['db'];var utils=require(_0x7101('0x7'));var logger=require(_0x7101('0x8'))(_0x7101('0x9'));var config=require(_0x7101('0xa'));var jayson=require(_0x7101('0xb'));var client=jayson[_0x7101('0xc')][_0x7101('0xd')]({'port':0x232a});config[_0x7101('0xe')]=_[_0x7101('0xf')](config[_0x7101('0xe')],{'host':_0x7101('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7101('0xe')]));require(_0x7101('0x11'))[_0x7101('0x12')](socket);function respondWithRpcPromise(_0x5a0e0c,_0x2808c,_0x494208){return new BPromise(function(_0x17fd4a,_0x2f22bd){return client[_0x7101('0x13')](_0x5a0e0c,_0x494208)['then'](function(_0x49df09){logger['info'](_0x7101('0x14'),_0x2808c,_0x7101('0x15'));logger[_0x7101('0x16')](_0x7101('0x17'),_0x2808c,'request\x20sent',JSON[_0x7101('0x18')](_0x49df09));if(_0x49df09[_0x7101('0x19')]){if(_0x49df09['error'][_0x7101('0x1a')]===0x1f4){logger[_0x7101('0x19')](_0x7101('0x14'),_0x2808c,_0x49df09[_0x7101('0x19')]['message']);return _0x2f22bd(_0x49df09['error'][_0x7101('0x1b')]);}logger[_0x7101('0x19')](_0x7101('0x14'),_0x2808c,_0x49df09[_0x7101('0x19')]['message']);return _0x17fd4a(_0x49df09[_0x7101('0x19')][_0x7101('0x1b')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x2808c,_0x7101('0x15'));_0x17fd4a(_0x49df09[_0x7101('0x1c')][_0x7101('0x1b')]);}})[_0x7101('0x1d')](function(_0x4313ac){logger[_0x7101('0x19')](_0x7101('0x14'),_0x2808c,_0x4313ac);_0x2f22bd(_0x4313ac);});});}exports[_0x7101('0x1e')]=function(_0x16c56f){var _0x2e4b8d=this;return new Promise(function(_0x26ca9b,_0x456060){return db['MailInteraction']['update'](_0x16c56f[_0x7101('0x1f')],{'raw':_0x16c56f[_0x7101('0x20')]?_0x16c56f[_0x7101('0x20')][_0x7101('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16c56f['options']?_0x16c56f[_0x7101('0x20')]['where']||null:null,'attributes':_0x16c56f[_0x7101('0x20')]?_0x16c56f[_0x7101('0x20')][_0x7101('0x22')]||null:null,'limit':_0x16c56f[_0x7101('0x20')]?_0x16c56f[_0x7101('0x20')][_0x7101('0x23')]||null:null})[_0x7101('0x24')](function(_0x7ccc1d){logger[_0x7101('0x25')]('UpdateMailInteraction',_0x16c56f);logger[_0x7101('0x16')](_0x7101('0x1e'),_0x16c56f,JSON[_0x7101('0x18')](_0x7ccc1d));_0x26ca9b(_0x7ccc1d);})[_0x7101('0x1d')](function(_0x36d80c){logger[_0x7101('0x19')](_0x7101('0x1e'),_0x36d80c[_0x7101('0x1b')],_0x16c56f);_0x456060(_0x2e4b8d[_0x7101('0x19')](0x1f4,_0x36d80c[_0x7101('0x1b')]));});});};exports[_0x7101('0x26')]=function(_0x1aa1ea){return new Promise(function(_0x5a217f,_0x1b7655){return db[_0x7101('0x27')][_0x7101('0x28')]({'where':_0x1aa1ea['options']?_0x1aa1ea['options']['where']||null:null})['then'](function(_0x25aa5f){if(_0x25aa5f){return _0x25aa5f[_0x7101('0x29')](_0x1aa1ea[_0x7101('0x1f')]['ids'],_[_0x7101('0x2a')](_0x1aa1ea[_0x7101('0x1f')],[_0x7101('0x2b'),'id'])||{});}})[_0x7101('0x2c')](function(_0x36f13d){logger[_0x7101('0x25')](_0x7101('0x2d'),_0x1aa1ea);logger[_0x7101('0x16')](_0x7101('0x2d'),_0x1aa1ea,JSON[_0x7101('0x18')](_0x36f13d));_0x5a217f(_0x36f13d);})[_0x7101('0x1d')](function(_0x515a2a){logger[_0x7101('0x19')](_0x7101('0x2d'),_0x515a2a[_0x7101('0x1b')],_0x1aa1ea);_0x1b7655(_this[_0x7101('0x19')](0x1f4,_0x515a2a[_0x7101('0x1b')]));});});}; \ No newline at end of file +var _0xd325=['defaults','localhost','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateMailInteraction','MailInteraction','body','options','where','AddTagsToMailInteraction','addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis'];(function(_0x3c2e0e,_0x53c745){var _0x224ded=function(_0xc42168){while(--_0xc42168){_0x3c2e0e['push'](_0x3c2e0e['shift']());}};_0x224ded(++_0x53c745);}(_0xd325,0x1f3));var _0x5d32=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0xd325[_0xfc406a];return _0x395473;};'use strict';var _=require(_0x5d32('0x0'));var util=require(_0x5d32('0x1'));var moment=require('moment');var BPromise=require(_0x5d32('0x2'));var rs=require(_0x5d32('0x3'));var fs=require('fs');var Redis=require(_0x5d32('0x4'));var db=require(_0x5d32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d32('0x6'))(_0x5d32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d32('0x8')][_0x5d32('0x9')]({'port':0x232a});config[_0x5d32('0xa')]=_[_0x5d32('0xb')](config[_0x5d32('0xa')],{'host':_0x5d32('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d32('0xa')]));require(_0x5d32('0xd'))[_0x5d32('0xe')](socket);function respondWithRpcPromise(_0x2c1674,_0x89b862,_0x512588){return new BPromise(function(_0x569646,_0x53884d){return client['request'](_0x2c1674,_0x512588)[_0x5d32('0xf')](function(_0x4da5c5){logger[_0x5d32('0x10')](_0x5d32('0x11'),_0x89b862,'request\x20sent');logger[_0x5d32('0x12')](_0x5d32('0x13'),_0x89b862,_0x5d32('0x14'),JSON[_0x5d32('0x15')](_0x4da5c5));if(_0x4da5c5[_0x5d32('0x16')]){if(_0x4da5c5[_0x5d32('0x16')]['code']===0x1f4){logger[_0x5d32('0x16')](_0x5d32('0x11'),_0x89b862,_0x4da5c5[_0x5d32('0x16')][_0x5d32('0x17')]);return _0x53884d(_0x4da5c5[_0x5d32('0x16')][_0x5d32('0x17')]);}logger[_0x5d32('0x16')](_0x5d32('0x11'),_0x89b862,_0x4da5c5['error'][_0x5d32('0x17')]);return _0x569646(_0x4da5c5[_0x5d32('0x16')][_0x5d32('0x17')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x89b862,'request\x20sent');_0x569646(_0x4da5c5['result'][_0x5d32('0x17')]);}})[_0x5d32('0x18')](function(_0x215879){logger[_0x5d32('0x16')](_0x5d32('0x11'),_0x89b862,_0x215879);_0x53884d(_0x215879);});});}exports[_0x5d32('0x19')]=function(_0x327583){var _0x477d9a=this;return new Promise(function(_0x3d8bc7,_0xbd8f3c){return db[_0x5d32('0x1a')]['update'](_0x327583[_0x5d32('0x1b')],{'raw':_0x327583[_0x5d32('0x1c')]?_0x327583['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x327583[_0x5d32('0x1c')]?_0x327583[_0x5d32('0x1c')][_0x5d32('0x1d')]||null:null,'attributes':_0x327583[_0x5d32('0x1c')]?_0x327583['options']['attributes']||null:null,'limit':_0x327583[_0x5d32('0x1c')]?_0x327583[_0x5d32('0x1c')]['limit']||null:null})['then'](function(_0x390dd1){logger['info'](_0x5d32('0x19'),_0x327583);logger[_0x5d32('0x12')](_0x5d32('0x19'),_0x327583,JSON['stringify'](_0x390dd1));_0x3d8bc7(_0x390dd1);})[_0x5d32('0x18')](function(_0x2cc354){logger['error'](_0x5d32('0x19'),_0x2cc354[_0x5d32('0x17')],_0x327583);_0xbd8f3c(_0x477d9a[_0x5d32('0x16')](0x1f4,_0x2cc354[_0x5d32('0x17')]));});});};exports[_0x5d32('0x1e')]=function(_0x3d2c81){return new Promise(function(_0x5146d3,_0x4b9d87){return db[_0x5d32('0x1a')]['find']({'where':_0x3d2c81[_0x5d32('0x1c')]?_0x3d2c81['options'][_0x5d32('0x1d')]||null:null})[_0x5d32('0xf')](function(_0x362e29){if(_0x362e29){return _0x362e29[_0x5d32('0x1f')](_0x3d2c81[_0x5d32('0x1b')][_0x5d32('0x20')],_['omit'](_0x3d2c81['body'],['ids','id'])||{});}})['spread'](function(_0x3e3622){logger[_0x5d32('0x10')](_0x5d32('0x21'),_0x3d2c81);logger['debug']('AddTags',_0x3d2c81,JSON[_0x5d32('0x15')](_0x3e3622));_0x5146d3(_0x3e3622);})[_0x5d32('0x18')](function(_0x4fab1d){logger[_0x5d32('0x16')]('AddTags',_0x4fab1d['message'],_0x3d2c81);_0x4b9d87(_this[_0x5d32('0x16')](0x1f4,_0x4fab1d[_0x5d32('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 86691f0..bd5f942 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 _0x4c78=['emit','./mailInteraction.events','save','remove','update'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x4c78,0x105));var _0x84c7=function(_0x931acb,_0x293c99){_0x931acb=_0x931acb-0x0;var _0x1c54e2=_0x4c78[_0x931acb];return _0x1c54e2;};'use strict';var MailInteractionEvents=require(_0x84c7('0x0'));var events=[_0x84c7('0x1'),_0x84c7('0x2'),_0x84c7('0x3')];function createListener(_0x33ad87,_0x1718c1){return function(_0x22a46d){_0x1718c1[_0x84c7('0x4')](_0x33ad87,_0x22a46d);};}function removeListener(_0x3fe097,_0x5bbe36){return function(){MailInteractionEvents['removeListener'](_0x3fe097,_0x5bbe36);};}exports['register']=function(_0x1b1a50){for(var _0x7c978a=0x0,_0x2edba9=events['length'];_0x7c978a<_0x2edba9;_0x7c978a++){var _0x28cf3e=events[_0x7c978a];var _0x47e8e5=createListener('mailInteraction:'+_0x28cf3e,_0x1b1a50);MailInteractionEvents['on'](_0x28cf3e,_0x47e8e5);}}; \ No newline at end of file +var _0xf572=['./mailInteraction.events','save','update','emit','removeListener','register','mailInteraction:'];(function(_0xc5596f,_0x3b7b24){var _0x4377ec=function(_0x214686){while(--_0x214686){_0xc5596f['push'](_0xc5596f['shift']());}};_0x4377ec(++_0x3b7b24);}(_0xf572,0x165));var _0x2f57=function(_0x349dbe,_0x29f695){_0x349dbe=_0x349dbe-0x0;var _0x41161a=_0xf572[_0x349dbe];return _0x41161a;};'use strict';var MailInteractionEvents=require(_0x2f57('0x0'));var events=[_0x2f57('0x1'),'remove',_0x2f57('0x2')];function createListener(_0xeb91c9,_0x22cfd9){return function(_0x3233f6){_0x22cfd9[_0x2f57('0x3')](_0xeb91c9,_0x3233f6);};}function removeListener(_0x1f9e24,_0x39d5c1){return function(){MailInteractionEvents[_0x2f57('0x4')](_0x1f9e24,_0x39d5c1);};}exports[_0x2f57('0x5')]=function(_0x2791e4){for(var _0x4f381e=0x0,_0x45298f=events['length'];_0x4f381e<_0x45298f;_0x4f381e++){var _0x52bcc3=events[_0x4f381e];var _0x247f6f=createListener(_0x2f57('0x6')+_0x52bcc3,_0x2791e4);MailInteractionEvents['on'](_0x52bcc3,_0x247f6f);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 4d9aa4a..24bbe0f 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 _0xd86f=['express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout'];(function(_0x39cc9b,_0x1e1e76){var _0x5f2ffb=function(_0x4afe3f){while(--_0x4afe3f){_0x39cc9b['push'](_0x39cc9b['shift']());}};_0x5f2ffb(++_0x1e1e76);}(_0xd86f,0xf6));var _0xfd86=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd86f[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xfd86('0x0'));var util=require(_0xfd86('0x1'));var path=require(_0xfd86('0x2'));var timeout=require(_0xfd86('0x3'));var express=require(_0xfd86('0x4'));var router=express[_0xfd86('0x5')]();var fs_extra=require(_0xfd86('0x6'));var auth=require(_0xfd86('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xfd86('0x8')]('/',auth[_0xfd86('0x9')](),controller[_0xfd86('0xa')]);router['get']('/describe',auth[_0xfd86('0x9')](),controller['describe']);router['get'](_0xfd86('0xb'),auth[_0xfd86('0x9')](),controller[_0xfd86('0xc')]);router[_0xfd86('0x8')](_0xfd86('0xd'),auth['isAuthenticated'](),controller[_0xfd86('0xe')]);router[_0xfd86('0xf')]('/',auth['isAuthenticated'](),interaction[_0xfd86('0x10')](_0xfd86('0x11'),_0xfd86('0x12')),controller['create']);router[_0xfd86('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xfd86('0x14')]);router[_0xfd86('0x13')]('/:id/accept',auth[_0xfd86('0x9')](),controller['accept']);router[_0xfd86('0x13')](_0xfd86('0x15'),auth[_0xfd86('0x9')](),controller[_0xfd86('0x16')]);router[_0xfd86('0x17')](_0xfd86('0xb'),auth[_0xfd86('0x9')](),controller[_0xfd86('0x18')]);module['exports']=router; \ No newline at end of file +var _0x43c8=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/download','download','post','tracked','mailmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x43c8,0xaf));var _0x843c=function(_0xc24ce2,_0x29402e){_0xc24ce2=_0xc24ce2-0x0;var _0x4732d8=_0x43c8[_0xc24ce2];return _0x4732d8;};'use strict';var multer=require('multer');var util=require(_0x843c('0x0'));var path=require('path');var timeout=require(_0x843c('0x1'));var express=require(_0x843c('0x2'));var router=express[_0x843c('0x3')]();var fs_extra=require(_0x843c('0x4'));var auth=require(_0x843c('0x5'));var interaction=require(_0x843c('0x6'));var config=require(_0x843c('0x7'));var controller=require('./mailMessage.controller');router[_0x843c('0x8')]('/',auth[_0x843c('0x9')](),controller[_0x843c('0xa')]);router[_0x843c('0x8')](_0x843c('0xb'),auth['isAuthenticated'](),controller[_0x843c('0xc')]);router[_0x843c('0x8')]('/:id',auth[_0x843c('0x9')](),controller['show']);router['get'](_0x843c('0xd'),auth['isAuthenticated'](),controller[_0x843c('0xe')]);router[_0x843c('0xf')]('/',auth[_0x843c('0x9')](),interaction[_0x843c('0x10')]('mail',_0x843c('0x11')),controller[_0x843c('0x12')]);router[_0x843c('0x13')](_0x843c('0x14'),auth[_0x843c('0x9')](),controller[_0x843c('0x15')]);router[_0x843c('0x13')](_0x843c('0x16'),auth[_0x843c('0x9')](),controller[_0x843c('0x17')]);router[_0x843c('0x13')](_0x843c('0x18'),auth[_0x843c('0x9')](),controller[_0x843c('0x19')]);router[_0x843c('0x1a')]('/:id',auth[_0x843c('0x9')](),controller[_0x843c('0x1b')]);module[_0x843c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 5b00b6f..f069266 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 _0x980a=['Email','sequelize','exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x980a,0x91));var _0xa980=function(_0x47851f,_0x26f674){_0x47851f=_0x47851f-0x0;var _0x10ef87=_0x980a[_0x47851f];return _0x10ef87;};'use strict';var Sequelize=require(_0xa980('0x0'));var _=require('lodash');module[_0xa980('0x1')]={'body':{'type':Sequelize[_0xa980('0x2')](_0xa980('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xa980('0x2')](_0xa980('0x4'))},'read':{'type':Sequelize[_0xa980('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa980('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa980('0x7')](0x1fe)},'from':{'type':Sequelize[_0xa980('0x7')]},'to':{'type':Sequelize[_0xa980('0x2')](_0xa980('0x3'))},'cc':{'type':Sequelize[_0xa980('0x2')](_0xa980('0x3'))},'bcc':{'type':Sequelize[_0xa980('0x2')](_0xa980('0x3'))},'subject':{'type':Sequelize[_0xa980('0x2')]},'sentAt':{'type':Sequelize[_0xa980('0x8')]},'attach':{'type':Sequelize[_0xa980('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xa980('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xa980('0x8')]},'originTo':{'type':Sequelize[_0xa980('0x2')](_0xa980('0x3'))},'originCc':{'type':Sequelize[_0xa980('0x2')](_0xa980('0x3'))},'originChannel':{'type':Sequelize[_0xa980('0xa')]('Email','Chat'),'defaultValue':_0xa980('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xb664=['ENUM','out','STRING','DATE','INTEGER','Email','Chat','exports','long','TEXT','medium','BOOLEAN'];(function(_0x483ab1,_0x151a34){var _0x253c42=function(_0x2109eb){while(--_0x2109eb){_0x483ab1['push'](_0x483ab1['shift']());}};_0x253c42(++_0x151a34);}(_0xb664,0x163));var _0x4b66=function(_0x9301eb,_0x5f1e90){_0x9301eb=_0x9301eb-0x0;var _0x310668=_0xb664[_0x9301eb];return _0x310668;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x4b66('0x0')]={'body':{'type':Sequelize['TEXT'](_0x4b66('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4b66('0x2')](_0x4b66('0x3'))},'read':{'type':Sequelize[_0x4b66('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b66('0x5')]('in',_0x4b66('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4b66('0x7')]},'to':{'type':Sequelize['TEXT'](_0x4b66('0x1'))},'cc':{'type':Sequelize[_0x4b66('0x2')](_0x4b66('0x1'))},'bcc':{'type':Sequelize[_0x4b66('0x2')](_0x4b66('0x1'))},'subject':{'type':Sequelize[_0x4b66('0x2')]},'sentAt':{'type':Sequelize[_0x4b66('0x8')]},'attach':{'type':Sequelize[_0x4b66('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x4b66('0x2')](_0x4b66('0x1'))},'originCc':{'type':Sequelize[_0x4b66('0x2')]('long')},'originChannel':{'type':Sequelize[_0x4b66('0x5')](_0x4b66('0xa'),_0x4b66('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 762ae73..97393d1 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 _0x6a1e=['from','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','api','mail-interactions','../../config/environment','redis','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','json','offset','limit','undefined','count','status','set','Content-Range','update','destroy','end','name','send','index','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','length','find','body','params','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','CloudProvider','attachments','root','server/files/attachments','basename','CmContact','defaults','ListId','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','format','UserId','user','get','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','User','interface','event','download','unix','toString','join','server','tmp','files','message-%s.eml'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x6a1e,0xab));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var moment=require(_0xe6a1('0x0'));var BPromise=require(_0xe6a1('0x1'));var util=require('util');var path=require(_0xe6a1('0x2'));var fs=require('fs');var _=require(_0xe6a1('0x3'));var Redis=require(_0xe6a1('0x4'));var htmlToText=require('html-to-text');var qs=require(_0xe6a1('0x5'));var logger=require('../../config/logger')(_0xe6a1('0x6'));var interaction_log=require('../../config/logger')(_0xe6a1('0x7'));var config=require(_0xe6a1('0x8'));var db=require('../../mysqldb')['db'];config[_0xe6a1('0x9')]=_['defaults'](config[_0xe6a1('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0xe6a1('0xa'));require(_0xe6a1('0xb'))[_0xe6a1('0xc')](socket);var jayson=require(_0xe6a1('0xd'));var client=jayson[_0xe6a1('0xe')][_0xe6a1('0xf')]({'port':0x232c});var client9003=jayson[_0xe6a1('0xe')]['http']({'port':0x232b});var client9002=jayson[_0xe6a1('0xe')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bd24f,_0x178b9d,_0x553552,_0x21ea05){return new BPromise(function(_0x4047d5,_0x1155ba){var _0x1f7d0c=_0x21ea05||client;return _0x1f7d0c['request'](_0x3bd24f,_0x553552)[_0xe6a1('0x10')](function(_0x50957b){logger['info'](_0xe6a1('0x11'),_0x178b9d,_0xe6a1('0x12'));logger[_0xe6a1('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x178b9d,_0xe6a1('0x12'),JSON[_0xe6a1('0x14')](_0x50957b));if(_0x50957b['error']){if(_0x50957b[_0xe6a1('0x15')][_0xe6a1('0x16')]===0x1f4){logger[_0xe6a1('0x15')](_0xe6a1('0x11'),_0x178b9d,_0x50957b[_0xe6a1('0x15')][_0xe6a1('0x17')]);return _0x1155ba(_0x50957b['error']['message']);}logger['error'](_0xe6a1('0x11'),_0x178b9d,_0x50957b[_0xe6a1('0x15')][_0xe6a1('0x17')]);return _0x4047d5(_0x50957b[_0xe6a1('0x15')][_0xe6a1('0x17')]);}else{logger['info'](_0xe6a1('0x11'),_0x178b9d,'request\x20sent');_0x4047d5(_0x50957b[_0xe6a1('0x18')][_0xe6a1('0x17')]);}})[_0xe6a1('0x19')](function(_0x1519d6){logger[_0xe6a1('0x15')](_0xe6a1('0x11'),_0x178b9d,_0x1519d6);_0x1155ba(_0x1519d6);});});}function respondWithResult(_0x174665,_0x36ce97){_0x36ce97=_0x36ce97||0xc8;return function(_0x37ccd1){if(_0x37ccd1){return _0x174665['status'](_0x36ce97)[_0xe6a1('0x1a')](_0x37ccd1);}};}function respondWithFilteredResult(_0x363c87,_0x59b692){return function(_0x4031e2){if(_0x4031e2){var _0x473116=typeof _0x59b692[_0xe6a1('0x1b')]==='undefined'&&typeof _0x59b692[_0xe6a1('0x1c')]===_0xe6a1('0x1d');var _0x12237b=_0x4031e2[_0xe6a1('0x1e')];var _0x2eb797=_0x473116?0x0:_0x59b692['offset'];var _0x582979=_0x473116?_0x4031e2['count']:_0x59b692['offset']+_0x59b692[_0xe6a1('0x1c')];var _0xd8fd8f;if(_0x582979>=_0x12237b){_0x582979=_0x12237b;_0xd8fd8f=0xc8;}else{_0xd8fd8f=0xce;}_0x363c87[_0xe6a1('0x1f')](_0xd8fd8f);return _0x363c87[_0xe6a1('0x20')](_0xe6a1('0x21'),_0x2eb797+'-'+_0x582979+'/'+_0x12237b)[_0xe6a1('0x1a')](_0x4031e2);}return null;};}function saveUpdates(_0x4d7b6c){return function(_0x4a7b07){if(_0x4a7b07){return _0x4a7b07[_0xe6a1('0x22')](_0x4d7b6c)['then'](function(_0x4b0f8d){return _0x4b0f8d;});}return null;};}function removeEntity(_0x4c2df4){return function(_0x1a49c7){if(_0x1a49c7){return _0x1a49c7[_0xe6a1('0x23')]()['then'](function(){_0x4c2df4[_0xe6a1('0x1f')](0xcc)[_0xe6a1('0x24')]();});}};}function handleEntityNotFound(_0x5a2dcb){return function(_0x165c1c){if(!_0x165c1c){_0x5a2dcb['sendStatus'](0x194);}return _0x165c1c;};}function handleError(_0x5be2ef,_0x289fdb){_0x289fdb=_0x289fdb||0x1f4;return function(_0x58a66c){logger[_0xe6a1('0x15')](_0x58a66c['stack']);if(_0x58a66c[_0xe6a1('0x25')]){delete _0x58a66c[_0xe6a1('0x25')];}_0x5be2ef['status'](_0x289fdb)[_0xe6a1('0x26')](_0x58a66c);};}exports[_0xe6a1('0x27')]=function(_0x467306,_0xc1f904){var _0x3f343c={},_0x17820f={},_0x31abbe={'count':0x0,'rows':[]};var _0x1a4c44=_['map'](db[_0xe6a1('0x28')][_0xe6a1('0x29')],function(_0x55dc9f){return{'name':_0x55dc9f[_0xe6a1('0x2a')],'type':_0x55dc9f[_0xe6a1('0x2b')][_0xe6a1('0x2c')]};});_0x17820f[_0xe6a1('0x2d')]=_['map'](_0x1a4c44,_0xe6a1('0x25'));_0x17820f[_0xe6a1('0x2e')]=_[_0xe6a1('0x2f')](_0x467306[_0xe6a1('0x2e')]);_0x17820f[_0xe6a1('0x30')]=_[_0xe6a1('0x31')](_0x17820f['model'],_0x17820f[_0xe6a1('0x2e')]);_0x3f343c[_0xe6a1('0x32')]=_['intersection'](_0x17820f[_0xe6a1('0x2d')],qs[_0xe6a1('0x33')](_0x467306[_0xe6a1('0x2e')][_0xe6a1('0x33')]));_0x3f343c['attributes']=_0x3f343c[_0xe6a1('0x32')]['length']?_0x3f343c[_0xe6a1('0x32')]:_0x17820f[_0xe6a1('0x2d')];if(!_0x467306['query'][_0xe6a1('0x34')](_0xe6a1('0x35'))){_0x3f343c['limit']=qs[_0xe6a1('0x1c')](_0x467306['query']['limit']);_0x3f343c[_0xe6a1('0x1b')]=qs[_0xe6a1('0x1b')](_0x467306['query'][_0xe6a1('0x1b')]);}_0x3f343c[_0xe6a1('0x36')]=qs[_0xe6a1('0x37')](_0x467306['query'][_0xe6a1('0x37')]);_0x3f343c[_0xe6a1('0x38')]=qs[_0xe6a1('0x30')](_[_0xe6a1('0x39')](_0x467306[_0xe6a1('0x2e')],_0x17820f['filters']),_0x1a4c44);if(_0x467306[_0xe6a1('0x2e')][_0xe6a1('0x3a')]){_0x3f343c[_0xe6a1('0x38')]=_['merge'](_0x3f343c['where'],{'$or':_[_0xe6a1('0x3b')](_0x1a4c44,function(_0x2e9d33){if(_0x2e9d33[_0xe6a1('0x2b')]!==_0xe6a1('0x3c')){var _0x5e203f={};_0x5e203f[_0x2e9d33[_0xe6a1('0x25')]]={'$like':'%'+_0x467306['query'][_0xe6a1('0x3a')]+'%'};return _0x5e203f;}})});}_0x3f343c=_[_0xe6a1('0x3d')]({},_0x3f343c,_0x467306[_0xe6a1('0x3e')]);var _0xf991d2={'where':_0x3f343c[_0xe6a1('0x38')]};return db[_0xe6a1('0x28')][_0xe6a1('0x1e')](_0xf991d2)[_0xe6a1('0x10')](function(_0xadf093){_0x31abbe[_0xe6a1('0x1e')]=_0xadf093;if(_0x467306[_0xe6a1('0x2e')][_0xe6a1('0x3f')]){_0x3f343c[_0xe6a1('0x40')]=[{'all':!![]}];}return db['MailMessage'][_0xe6a1('0x41')](_0x3f343c);})[_0xe6a1('0x10')](function(_0x566ce0){_0x31abbe[_0xe6a1('0x42')]=_0x566ce0;return _0x31abbe;})[_0xe6a1('0x10')](respondWithFilteredResult(_0xc1f904,_0x3f343c))[_0xe6a1('0x19')](handleError(_0xc1f904,null));};exports[_0xe6a1('0x43')]=function(_0x14e707,_0x526523){var _0xd51df0={'raw':!![],'where':{'id':_0x14e707['params']['id']}},_0x49ee69={};_0x49ee69[_0xe6a1('0x2d')]=_[_0xe6a1('0x2f')](db[_0xe6a1('0x28')]['rawAttributes']);_0x49ee69[_0xe6a1('0x2e')]=_[_0xe6a1('0x2f')](_0x14e707[_0xe6a1('0x2e')]);_0x49ee69['filters']=_[_0xe6a1('0x31')](_0x49ee69[_0xe6a1('0x2d')],_0x49ee69[_0xe6a1('0x2e')]);_0xd51df0[_0xe6a1('0x32')]=_[_0xe6a1('0x31')](_0x49ee69[_0xe6a1('0x2d')],qs[_0xe6a1('0x33')](_0x14e707[_0xe6a1('0x2e')][_0xe6a1('0x33')]));_0xd51df0['attributes']=_0xd51df0[_0xe6a1('0x32')][_0xe6a1('0x44')]?_0xd51df0['attributes']:_0x49ee69[_0xe6a1('0x2d')];if(_0x14e707['query'][_0xe6a1('0x3f')]){_0xd51df0[_0xe6a1('0x40')]=[{'all':!![]}];}_0xd51df0=_[_0xe6a1('0x3d')]({},_0xd51df0,_0x14e707[_0xe6a1('0x3e')]);return db[_0xe6a1('0x28')][_0xe6a1('0x45')](_0xd51df0)[_0xe6a1('0x10')](handleEntityNotFound(_0x526523,null))[_0xe6a1('0x10')](respondWithResult(_0x526523,null))[_0xe6a1('0x19')](handleError(_0x526523,null));};exports['update']=function(_0x30aba0,_0x318d3d){if(_0x30aba0[_0xe6a1('0x46')]['id']){delete _0x30aba0[_0xe6a1('0x46')]['id'];}return db[_0xe6a1('0x28')][_0xe6a1('0x45')]({'where':{'id':_0x30aba0[_0xe6a1('0x47')]['id']}})[_0xe6a1('0x10')](handleEntityNotFound(_0x318d3d,null))[_0xe6a1('0x10')](saveUpdates(_0x30aba0[_0xe6a1('0x46')],null))[_0xe6a1('0x10')](respondWithResult(_0x318d3d,null))[_0xe6a1('0x19')](handleError(_0x318d3d,null));};exports[_0xe6a1('0x23')]=function(_0x5e22ee,_0x9dbb80){return db[_0xe6a1('0x28')][_0xe6a1('0x45')]({'where':{'id':_0x5e22ee[_0xe6a1('0x47')]['id']}})[_0xe6a1('0x10')](handleEntityNotFound(_0x9dbb80,null))[_0xe6a1('0x10')](removeEntity(_0x9dbb80,null))['catch'](handleError(_0x9dbb80,null));};exports[_0xe6a1('0x48')]=function(_0x39fae2,_0x4aa7ee){return db['MailMessage'][_0xe6a1('0x48')]()[_0xe6a1('0x10')](respondWithResult(_0x4aa7ee,null))['catch'](handleError(_0x4aa7ee,null));};exports['create']=function(_0x5a6ff7,_0x4c13e1){return db['MailMessage'][_0xe6a1('0x49')](_0x5a6ff7[_0xe6a1('0x46')])[_0xe6a1('0x10')](function(_0x4c2a0f){if(_0x4c2a0f){if(_0x4c2a0f[_0xe6a1('0x4a')]===_0xe6a1('0x4b')&&!_0x4c2a0f[_0xe6a1('0x4c')]){var _0x30d6bf,_0x282f8c,_0x58567c;if(_0x5a6ff7['body']['to']){_0x282f8c=_0x5a6ff7['body']['to']['split'](',')[0x0];}return db[_0xe6a1('0x4d')][_0xe6a1('0x4e')]({'where':{'id':_0x4c2a0f[_0xe6a1('0x4f')]},'include':[{'model':db[_0xe6a1('0x50')],'as':_0xe6a1('0x51'),'include':[{'model':db['CmContact'],'as':_0xe6a1('0x52'),'where':{'email':_0x282f8c},'limit':0x1,'order':[['updatedAt',_0xe6a1('0x53')]]}]},{'model':db[_0xe6a1('0x54')],'as':_0xe6a1('0x55'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe6a1('0x56'),'raw':!![]}]}]})[_0xe6a1('0x10')](function(_0x5a9d45){_0x30d6bf=_0x5a9d45;if(!_0x30d6bf||!_0x30d6bf['Smtp'])return;var _0x3295d0=_0x30d6bf['getSmtpOptions']();if(_0x5a6ff7[_0xe6a1('0x46')][_0xe6a1('0x57')]&&_0x5a6ff7[_0xe6a1('0x46')]['attachments'][_0xe6a1('0x44')]){for(var _0x1f39a9=0x0;_0x1f39a9<_0x5a6ff7[_0xe6a1('0x46')][_0xe6a1('0x57')][_0xe6a1('0x44')];_0x1f39a9+=0x1){_0x5a6ff7['body'][_0xe6a1('0x57')][_0x1f39a9]={'filename':_0x5a6ff7[_0xe6a1('0x46')]['attachments'][_0x1f39a9][_0xe6a1('0x25')],'path':path['join'](config[_0xe6a1('0x58')],_0xe6a1('0x59'),_0x5a6ff7['body'][_0xe6a1('0x57')][_0x1f39a9][_0xe6a1('0x5a')])};}}_0x58567c={'account':_0x3295d0,'message':_0x5a6ff7[_0xe6a1('0x46')]};return;})['then'](function(){if(_0x30d6bf[_0xe6a1('0x51')]){if(_0x30d6bf[_0xe6a1('0x51')][_0xe6a1('0x52')][_0xe6a1('0x44')]){return _0x30d6bf[_0xe6a1('0x51')][_0xe6a1('0x52')][0x0];}else{return db[_0xe6a1('0x5b')][_0xe6a1('0x49')](_[_0xe6a1('0x5c')](_0x5a6ff7['body'],{'firstName':_0x5a6ff7[_0xe6a1('0x46')]['to'],'email':_0x5a6ff7[_0xe6a1('0x46')]['to'],'phone':_0x5a6ff7[_0xe6a1('0x46')]['to'],'ListId':_0x30d6bf[_0xe6a1('0x5d')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x58567c){return respondWithRpcPromise(_0xe6a1('0x5e'),_0xe6a1('0x5f'),_0x58567c,client9003)['then'](function(_0x557527){return _0x4c2a0f['update']({'read':!![],'messageId':_0x557527[_0xe6a1('0x60')],'sentAt':moment()['format'](_0xe6a1('0x61'))});})[_0xe6a1('0x19')](function(_0x44caef){logger['error']('%s',JSON['stringify'](_0x44caef));return _0x4c2a0f;});}return _0x4c2a0f;});}return _0x4c2a0f;}})['then'](respondWithResult(_0x4c13e1,0xc9))['catch'](handleError(_0x4c13e1,null));};exports[_0xe6a1('0x62')]=function(_0x554a74,_0xa12c88){var _0x580a38={'agent':{},'channel':'mail'};if(_0x554a74[_0xe6a1('0x46')]['id']){delete _0x554a74[_0xe6a1('0x46')]['id'];}_0x554a74[_0xe6a1('0x46')]['read']=!![];_0x554a74[_0xe6a1('0x46')]['readAt']=moment()[_0xe6a1('0x63')](_0xe6a1('0x61'));_0x554a74['body'][_0xe6a1('0x64')]=_0x554a74['body'][_0xe6a1('0x64')]||_0x554a74[_0xe6a1('0x65')]['id'];_0x580a38['agent']['id']=_0x554a74[_0xe6a1('0x46')][_0xe6a1('0x64')];return db[_0xe6a1('0x28')][_0xe6a1('0x45')]({'where':{'id':_0x554a74[_0xe6a1('0x47')]['id'],'UserId':null}})[_0xe6a1('0x10')](handleEntityNotFound(_0xa12c88,null))[_0xe6a1('0x10')](saveUpdates(_0x554a74['body'],null))[_0xe6a1('0x10')](function(_0x4f7d88){if(_0x4f7d88){_0x580a38['message']=_0x4f7d88[_0xe6a1('0x66')]({'plain':!![]});return db['MailInteraction'][_0xe6a1('0x45')]({'where':{'id':_0x4f7d88['MailInteractionId']}});}return null;})[_0xe6a1('0x10')](handleEntityNotFound(_0xa12c88,null))[_0xe6a1('0x10')](function(_0xd74ce5){if(_0xd74ce5){return _0xd74ce5[_0xe6a1('0x22')]({'UserId':_0x554a74[_0xe6a1('0x46')][_0xe6a1('0x64')],'read1stAt':_['isNil'](_0xd74ce5[_0xe6a1('0x67')])?moment()['format'](_0xe6a1('0x61')):undefined});}return null;})[_0xe6a1('0x10')](function(_0x10749b){if(_0x10749b){_0x580a38[_0xe6a1('0x68')]=_0x10749b[_0xe6a1('0x66')]({'plain':!![]});interaction_log[_0xe6a1('0x69')](_0xe6a1('0x6a'),_0x554a74[_0xe6a1('0x65')]['id'],_0x554a74[_0xe6a1('0x65')][_0xe6a1('0x25')],_0x554a74[_0xe6a1('0x65')]['role'],_0x580a38[_0xe6a1('0x68')]['id'],_0x554a74[_0xe6a1('0x46')]?JSON[_0xe6a1('0x14')](_0x554a74['body']):_0xe6a1('0x6b'));return respondWithRpcPromise(_0xe6a1('0x6c'),_0xe6a1('0x6d'),_0x580a38);}return null;})[_0xe6a1('0x10')](function(_0x23191e){var _0x552e48=_0xe6a1('0x6e')+_0x23191e['message']['ContactId'];return db[_0xe6a1('0x6f')][_0xe6a1('0x2e')](_0x552e48,{'type':db[_0xe6a1('0x70')][_0xe6a1('0x71')][_0xe6a1('0x72')],'raw':!![]})[_0xe6a1('0x10')](function(_0xec394b){return _0xec394b;});})[_0xe6a1('0x10')](function(_0x770818){if(_0x770818){_0x580a38[_0xe6a1('0x17')][_0xe6a1('0x73')]=_0x770818[0x0];if(!_0x554a74[_0xe6a1('0x46')]['UserId'])return;return db['User'][_0xe6a1('0x45')]({'where':{'id':_0x554a74[_0xe6a1('0x46')][_0xe6a1('0x64')],'role':_0xe6a1('0x74')},'attributes':['id','name',_0xe6a1('0x75'),_0xe6a1('0x76'),_0xe6a1('0x77')],'raw':!![]});}return null;})[_0xe6a1('0x10')](function(_0x4cdbef){if(!_0x4cdbef)return null;_0x580a38[_0xe6a1('0x17')]['agent']=_0x4cdbef;return _0x580a38;})[_0xe6a1('0x10')](function(_0x4beefb){if(_0x4beefb){if(_0x554a74[_0xe6a1('0x46')][_0xe6a1('0x78')]){_0x580a38[_0xe6a1('0x17')]['interface']=util['format'](_0xe6a1('0x79'),_0x554a74[_0xe6a1('0x65')][_0xe6a1('0x25')]);_0x580a38[_0xe6a1('0x17')]['channel']=_0x580a38[_0xe6a1('0x7a')];_0x580a38[_0xe6a1('0x17')]['motionChannel']=_0x580a38['channel'];_0x580a38['message']['event']=_0xe6a1('0x62');_0x580a38[_0xe6a1('0x17')][_0xe6a1('0x46')]=htmlToText[_0xe6a1('0x7b')](_0x580a38[_0xe6a1('0x17')][_0xe6a1('0x46')]);return respondWithRpcPromise('EventManager',_0xe6a1('0x7c'),{'event':_0xe6a1('0x7d'),'message':_0x580a38[_0xe6a1('0x17')]},client9002)[_0xe6a1('0x10')](function(){return _0x580a38;});}return _0x580a38;}return null;})[_0xe6a1('0x10')](respondWithResult(_0xa12c88,null))[_0xe6a1('0x19')](handleError(_0xa12c88,null));};exports[_0xe6a1('0x7e')]=function(_0x241cc1,_0x3bd5c3){var _0x47e8a3={'agent':{},'channel':'mail'};if(_0x241cc1[_0xe6a1('0x46')]['id']){delete _0x241cc1[_0xe6a1('0x46')]['id'];}_0x241cc1[_0xe6a1('0x46')][_0xe6a1('0x64')]=_0x241cc1[_0xe6a1('0x46')][_0xe6a1('0x64')]||_0x241cc1[_0xe6a1('0x65')]['id'];_0x47e8a3[_0xe6a1('0x74')]['id']=_0x241cc1[_0xe6a1('0x46')][_0xe6a1('0x64')];return db[_0xe6a1('0x28')][_0xe6a1('0x45')]({'where':{'id':_0x241cc1['params']['id'],'UserId':null}})[_0xe6a1('0x10')](handleEntityNotFound(_0x3bd5c3,null))['then'](function(_0x1125ac){if(_0x1125ac){_0x47e8a3[_0xe6a1('0x17')]=_0x1125ac[_0xe6a1('0x66')]({'plain':!![]});return db[_0xe6a1('0x7f')][_0xe6a1('0x45')]({'where':{'id':_0x1125ac[_0xe6a1('0x80')]}});}return null;})[_0xe6a1('0x10')](handleEntityNotFound(_0x3bd5c3,null))[_0xe6a1('0x10')](function(_0x2f879b){if(_0x2f879b){_0x47e8a3[_0xe6a1('0x68')]=_0x2f879b[_0xe6a1('0x66')]({'plain':!![]});interaction_log['info'](_0xe6a1('0x81'),_0x241cc1[_0xe6a1('0x65')]['id'],_0x241cc1[_0xe6a1('0x65')][_0xe6a1('0x25')],_0x241cc1['user'][_0xe6a1('0x82')],_0x47e8a3[_0xe6a1('0x68')]['id'],_0x241cc1[_0xe6a1('0x46')]?JSON[_0xe6a1('0x14')](_0x241cc1[_0xe6a1('0x46')]):_0xe6a1('0x6b'));return respondWithRpcPromise(_0xe6a1('0x83'),_0xe6a1('0x84'),_0x47e8a3);}return null;})[_0xe6a1('0x10')](function(_0x18ed49){var _0x582eec=_0xe6a1('0x6e')+_0x18ed49[_0xe6a1('0x17')][_0xe6a1('0x85')];return db['sequelize'][_0xe6a1('0x2e')](_0x582eec,{'type':db[_0xe6a1('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x501a0a){return _0x501a0a;});})[_0xe6a1('0x10')](function(_0x98c288){if(_0x98c288){_0x47e8a3[_0xe6a1('0x17')]['contact']=_0x98c288[0x0];if(!_0x241cc1[_0xe6a1('0x46')][_0xe6a1('0x64')])return;return db[_0xe6a1('0x86')]['find']({'where':{'id':_0x241cc1['body']['UserId'],'role':_0xe6a1('0x74')},'attributes':['id',_0xe6a1('0x25'),'fullname','email',_0xe6a1('0x77')],'raw':!![]});}return null;})[_0xe6a1('0x10')](function(_0x23f66c){if(!_0x23f66c)return null;_0x47e8a3[_0xe6a1('0x17')][_0xe6a1('0x74')]=_0x23f66c;return _0x47e8a3;})[_0xe6a1('0x10')](function(_0x17a6f9){if(_0x17a6f9){_0x17a6f9['message'][_0xe6a1('0x87')]=util[_0xe6a1('0x63')](_0xe6a1('0x79'),_0x241cc1[_0xe6a1('0x65')][_0xe6a1('0x25')]);_0x17a6f9['message']['channel']=_0x47e8a3[_0xe6a1('0x7a')];_0x17a6f9['message']['motionChannel']=_0x47e8a3[_0xe6a1('0x7a')];_0x17a6f9['message'][_0xe6a1('0x88')]=_0xe6a1('0x7e');_0x17a6f9[_0xe6a1('0x17')]['body']=htmlToText[_0xe6a1('0x7b')](_0x47e8a3[_0xe6a1('0x17')][_0xe6a1('0x46')]);respondWithRpcPromise(_0xe6a1('0x7c'),_0xe6a1('0x7c'),{'event':'rejectmessage','message':_0x17a6f9[_0xe6a1('0x17')]},client9002);return _0x47e8a3;}return null;})['then'](respondWithResult(_0x3bd5c3,null))[_0xe6a1('0x19')](handleError(_0x3bd5c3,null));};exports[_0xe6a1('0x89')]=function(_0x2ec87a,_0xdbaff4){var _0x4fc2c7=moment()[_0xe6a1('0x8a')]()[_0xe6a1('0x8b')]();var _0xa3495b=path[_0xe6a1('0x8c')](config[_0xe6a1('0x58')],_0xe6a1('0x8d'),'files',_0xe6a1('0x8e'));var _0x5c08a6=path[_0xe6a1('0x8c')](config[_0xe6a1('0x58')],_0xe6a1('0x8d'),_0xe6a1('0x8f'),'attachments');var _0x3666a8=util['format'](_0xe6a1('0x90'),_0x4fc2c7);return db['MailMessage'][_0xe6a1('0x45')]({'where':{'id':_0x2ec87a[_0xe6a1('0x47')]['id']},'attributes':['id',_0xe6a1('0x46'),_0xe6a1('0x91'),'to','cc','bcc','subject',_0xe6a1('0x92')],'include':_0x2ec87a['query'][_0xe6a1('0x57')]?[{'model':db[_0xe6a1('0x93')],'as':_0xe6a1('0x94')}]:undefined})[_0xe6a1('0x10')](handleEntityNotFound(_0xdbaff4,null))[_0xe6a1('0x10')](function(_0x6bc688){if(_0x6bc688){var _0x15a1d6=_0x6bc688;var _0x8634be={'from':_0x15a1d6[_0xe6a1('0x91')],'to':_0x15a1d6['to'],'subject':_0x15a1d6[_0xe6a1('0x95')],'html':htmlEntities['decode'](_0x15a1d6[_0xe6a1('0x46')]),'headers':{'Date':moment(_0x15a1d6[_0xe6a1('0x92')])[_0xe6a1('0x63')](_0xe6a1('0x96'))},'attachments':[]};if(_0x6bc688['cc']){_0x8634be['headers']['Cc']=_0x6bc688['cc'];}if(_0x6bc688[_0xe6a1('0x97')]){_0x8634be['headers']['Bcc']=_0x6bc688['bcc'];}return new BPromise(function(_0x230ae5,_0x4d77d1){if(_0x6bc688[_0xe6a1('0x94')]){for(var _0x86a698=0x0;_0x86a698<_0x6bc688[_0xe6a1('0x94')][_0xe6a1('0x44')];_0x86a698++){var _0x1a20dd=_0x6bc688[_0xe6a1('0x94')][_0x86a698];var _0x11ff9e=path[_0xe6a1('0x8c')](_0x5c08a6,_0x1a20dd[_0xe6a1('0x5a')]);if(fs[_0xe6a1('0x98')](_0x11ff9e)){_0x8634be[_0xe6a1('0x57')][_0xe6a1('0x99')]({'name':_0x1a20dd[_0xe6a1('0x25')],'contentType':_0x1a20dd[_0xe6a1('0x2b')],'data':fs[_0xe6a1('0x9a')](_0x11ff9e)});}}}emlformat[_0xe6a1('0x9b')](_0x8634be,function(_0x566220,_0x279c47){if(_0x566220)return _0x4d77d1(_0x566220);fs[_0xe6a1('0x9c')](path[_0xe6a1('0x8c')](_0xa3495b,_0x3666a8),_0x279c47);return _0x230ae5(_0x279c47);});});}})[_0xe6a1('0x10')](function(_0x4e7ea2){if(_0x4e7ea2){return _0xdbaff4[_0xe6a1('0x89')](path[_0xe6a1('0x8c')](_0xa3495b,_0x3666a8),_0x3666a8,function(_0x1bbbf8){if(!_0x1bbbf8)fs[_0xe6a1('0x9d')](path[_0xe6a1('0x8c')](_0xa3495b,_0x3666a8));});}})['catch'](handleError(_0xdbaff4,null));}; \ No newline at end of file +var _0xa239=['Attachments','existsSync','push','readFileSync','unlinkSync','moment','util','path','lodash','../../components/parsers/qs','api','mail-interactions','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','rawAttributes','includeAll','body','find','params','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','email','interface','rejectmessage','download','unix','files','tmp','server','from','bcc','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc'];(function(_0x2949b6,_0x584438){var _0x47216c=function(_0x169848){while(--_0x169848){_0x2949b6['push'](_0x2949b6['shift']());}};_0x47216c(++_0x584438);}(_0xa239,0x13d));var _0x9a23=function(_0x2277f7,_0xf3e231){_0x2277f7=_0x2277f7-0x0;var _0x1e8bd3=_0xa239[_0x2277f7];return _0x1e8bd3;};'use strict';var emlformat=require('eml-format');var moment=require(_0x9a23('0x0'));var BPromise=require('bluebird');var util=require(_0x9a23('0x1'));var path=require(_0x9a23('0x2'));var fs=require('fs');var _=require(_0x9a23('0x3'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x9a23('0x4'));var logger=require('../../config/logger')(_0x9a23('0x5'));var interaction_log=require('../../config/logger')(_0x9a23('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x9a23('0x7')]=_[_0x9a23('0x8')](config[_0x9a23('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a23('0x9'))(new Redis(config[_0x9a23('0x7')]));var htmlEntities=require(_0x9a23('0xa'));require(_0x9a23('0xb'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9a23('0xc')][_0x9a23('0xd')]({'port':0x232c});var client9003=jayson[_0x9a23('0xc')][_0x9a23('0xd')]({'port':0x232b});var client9002=jayson['client'][_0x9a23('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x319546,_0x400732,_0x304ad3,_0x57c3a8){return new BPromise(function(_0x399321,_0xc29e21){var _0x5bcd3c=_0x57c3a8||client;return _0x5bcd3c['request'](_0x319546,_0x304ad3)[_0x9a23('0xe')](function(_0x1f7cf7){logger['info'](_0x9a23('0xf'),_0x400732,_0x9a23('0x10'));logger[_0x9a23('0x11')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x400732,_0x9a23('0x10'),JSON['stringify'](_0x1f7cf7));if(_0x1f7cf7[_0x9a23('0x12')]){if(_0x1f7cf7[_0x9a23('0x12')]['code']===0x1f4){logger[_0x9a23('0x12')](_0x9a23('0xf'),_0x400732,_0x1f7cf7[_0x9a23('0x12')][_0x9a23('0x13')]);return _0xc29e21(_0x1f7cf7['error'][_0x9a23('0x13')]);}logger['error'](_0x9a23('0xf'),_0x400732,_0x1f7cf7[_0x9a23('0x12')]['message']);return _0x399321(_0x1f7cf7[_0x9a23('0x12')]['message']);}else{logger[_0x9a23('0x14')](_0x9a23('0xf'),_0x400732,'request\x20sent');_0x399321(_0x1f7cf7[_0x9a23('0x15')][_0x9a23('0x13')]);}})[_0x9a23('0x16')](function(_0x7caaf6){logger['error']('MailMessage,\x20%s,\x20%s',_0x400732,_0x7caaf6);_0xc29e21(_0x7caaf6);});});}function respondWithResult(_0x4d49da,_0x10d15e){_0x10d15e=_0x10d15e||0xc8;return function(_0x5058f2){if(_0x5058f2){return _0x4d49da[_0x9a23('0x17')](_0x10d15e)[_0x9a23('0x18')](_0x5058f2);}};}function respondWithFilteredResult(_0x238659,_0x27c82f){return function(_0x3ac51a){if(_0x3ac51a){var _0x44f5ba=typeof _0x27c82f[_0x9a23('0x19')]==='undefined'&&typeof _0x27c82f[_0x9a23('0x1a')]===_0x9a23('0x1b');var _0xda9000=_0x3ac51a['count'];var _0x4e7cd1=_0x44f5ba?0x0:_0x27c82f[_0x9a23('0x19')];var _0x309997=_0x44f5ba?_0x3ac51a[_0x9a23('0x1c')]:_0x27c82f['offset']+_0x27c82f[_0x9a23('0x1a')];var _0x11c61f;if(_0x309997>=_0xda9000){_0x309997=_0xda9000;_0x11c61f=0xc8;}else{_0x11c61f=0xce;}_0x238659[_0x9a23('0x17')](_0x11c61f);return _0x238659[_0x9a23('0x1d')](_0x9a23('0x1e'),_0x4e7cd1+'-'+_0x309997+'/'+_0xda9000)[_0x9a23('0x18')](_0x3ac51a);}return null;};}function saveUpdates(_0x31077a){return function(_0x5d82e5){if(_0x5d82e5){return _0x5d82e5[_0x9a23('0x1f')](_0x31077a)['then'](function(_0x35bf08){return _0x35bf08;});}return null;};}function removeEntity(_0x4ea192){return function(_0x1676e9){if(_0x1676e9){return _0x1676e9[_0x9a23('0x20')]()[_0x9a23('0xe')](function(){_0x4ea192[_0x9a23('0x17')](0xcc)[_0x9a23('0x21')]();});}};}function handleEntityNotFound(_0x1c90ab){return function(_0x256ba0){if(!_0x256ba0){_0x1c90ab[_0x9a23('0x22')](0x194);}return _0x256ba0;};}function handleError(_0x9c1f1,_0x5ebb3a){_0x5ebb3a=_0x5ebb3a||0x1f4;return function(_0x4ca36f){logger[_0x9a23('0x12')](_0x4ca36f[_0x9a23('0x23')]);if(_0x4ca36f[_0x9a23('0x24')]){delete _0x4ca36f['name'];}_0x9c1f1['status'](_0x5ebb3a)[_0x9a23('0x25')](_0x4ca36f);};}exports[_0x9a23('0x26')]=function(_0x1ee551,_0x5c0736){var _0x1f332d={},_0x13ed14={},_0x26031e={'count':0x0,'rows':[]};var _0x144000=_[_0x9a23('0x27')](db[_0x9a23('0x28')]['rawAttributes'],function(_0x566ab1){return{'name':_0x566ab1[_0x9a23('0x29')],'type':_0x566ab1[_0x9a23('0x2a')][_0x9a23('0x2b')]};});_0x13ed14[_0x9a23('0x2c')]=_[_0x9a23('0x27')](_0x144000,_0x9a23('0x24'));_0x13ed14[_0x9a23('0x2d')]=_[_0x9a23('0x2e')](_0x1ee551[_0x9a23('0x2d')]);_0x13ed14[_0x9a23('0x2f')]=_[_0x9a23('0x30')](_0x13ed14[_0x9a23('0x2c')],_0x13ed14[_0x9a23('0x2d')]);_0x1f332d['attributes']=_[_0x9a23('0x30')](_0x13ed14[_0x9a23('0x2c')],qs[_0x9a23('0x31')](_0x1ee551['query'][_0x9a23('0x31')]));_0x1f332d[_0x9a23('0x32')]=_0x1f332d['attributes'][_0x9a23('0x33')]?_0x1f332d[_0x9a23('0x32')]:_0x13ed14[_0x9a23('0x2c')];if(!_0x1ee551[_0x9a23('0x2d')][_0x9a23('0x34')](_0x9a23('0x35'))){_0x1f332d['limit']=qs[_0x9a23('0x1a')](_0x1ee551[_0x9a23('0x2d')][_0x9a23('0x1a')]);_0x1f332d['offset']=qs[_0x9a23('0x19')](_0x1ee551[_0x9a23('0x2d')][_0x9a23('0x19')]);}_0x1f332d[_0x9a23('0x36')]=qs['sort'](_0x1ee551[_0x9a23('0x2d')]['sort']);_0x1f332d[_0x9a23('0x37')]=qs['filters'](_[_0x9a23('0x38')](_0x1ee551[_0x9a23('0x2d')],_0x13ed14[_0x9a23('0x2f')]),_0x144000);if(_0x1ee551[_0x9a23('0x2d')]['filter']){_0x1f332d[_0x9a23('0x37')]=_[_0x9a23('0x39')](_0x1f332d['where'],{'$or':_[_0x9a23('0x27')](_0x144000,function(_0x3f309f){if(_0x3f309f[_0x9a23('0x2a')]!==_0x9a23('0x3a')){var _0x588866={};_0x588866[_0x3f309f[_0x9a23('0x24')]]={'$like':'%'+_0x1ee551['query'][_0x9a23('0x3b')]+'%'};return _0x588866;}})});}_0x1f332d=_[_0x9a23('0x39')]({},_0x1f332d,_0x1ee551['options']);var _0xeff99c={'where':_0x1f332d['where']};return db['MailMessage'][_0x9a23('0x1c')](_0xeff99c)['then'](function(_0x3b1ac5){_0x26031e['count']=_0x3b1ac5;if(_0x1ee551[_0x9a23('0x2d')]['includeAll']){_0x1f332d[_0x9a23('0x3c')]=[{'all':!![]}];}return db['MailMessage'][_0x9a23('0x3d')](_0x1f332d);})[_0x9a23('0xe')](function(_0x154746){_0x26031e[_0x9a23('0x3e')]=_0x154746;return _0x26031e;})[_0x9a23('0xe')](respondWithFilteredResult(_0x5c0736,_0x1f332d))[_0x9a23('0x16')](handleError(_0x5c0736,null));};exports[_0x9a23('0x3f')]=function(_0x2b6217,_0x28ae2c){var _0x3cf2f3={'raw':!![],'where':{'id':_0x2b6217['params']['id']}},_0x371522={};_0x371522[_0x9a23('0x2c')]=_['keys'](db[_0x9a23('0x28')][_0x9a23('0x40')]);_0x371522['query']=_[_0x9a23('0x2e')](_0x2b6217['query']);_0x371522[_0x9a23('0x2f')]=_[_0x9a23('0x30')](_0x371522[_0x9a23('0x2c')],_0x371522[_0x9a23('0x2d')]);_0x3cf2f3['attributes']=_[_0x9a23('0x30')](_0x371522[_0x9a23('0x2c')],qs[_0x9a23('0x31')](_0x2b6217[_0x9a23('0x2d')][_0x9a23('0x31')]));_0x3cf2f3['attributes']=_0x3cf2f3[_0x9a23('0x32')][_0x9a23('0x33')]?_0x3cf2f3[_0x9a23('0x32')]:_0x371522['model'];if(_0x2b6217[_0x9a23('0x2d')][_0x9a23('0x41')]){_0x3cf2f3['include']=[{'all':!![]}];}_0x3cf2f3=_['merge']({},_0x3cf2f3,_0x2b6217['options']);return db[_0x9a23('0x28')]['find'](_0x3cf2f3)[_0x9a23('0xe')](handleEntityNotFound(_0x28ae2c,null))[_0x9a23('0xe')](respondWithResult(_0x28ae2c,null))[_0x9a23('0x16')](handleError(_0x28ae2c,null));};exports[_0x9a23('0x1f')]=function(_0x1bd0f6,_0x3a42c7){if(_0x1bd0f6[_0x9a23('0x42')]['id']){delete _0x1bd0f6['body']['id'];}return db[_0x9a23('0x28')][_0x9a23('0x43')]({'where':{'id':_0x1bd0f6[_0x9a23('0x44')]['id']}})[_0x9a23('0xe')](handleEntityNotFound(_0x3a42c7,null))[_0x9a23('0xe')](saveUpdates(_0x1bd0f6['body'],null))[_0x9a23('0xe')](respondWithResult(_0x3a42c7,null))[_0x9a23('0x16')](handleError(_0x3a42c7,null));};exports[_0x9a23('0x20')]=function(_0x1a5e25,_0x36e421){return db[_0x9a23('0x28')][_0x9a23('0x43')]({'where':{'id':_0x1a5e25[_0x9a23('0x44')]['id']}})[_0x9a23('0xe')](handleEntityNotFound(_0x36e421,null))['then'](removeEntity(_0x36e421,null))[_0x9a23('0x16')](handleError(_0x36e421,null));};exports[_0x9a23('0x45')]=function(_0x4955ec,_0x2d2223){return db[_0x9a23('0x28')][_0x9a23('0x45')]()[_0x9a23('0xe')](respondWithResult(_0x2d2223,null))[_0x9a23('0x16')](handleError(_0x2d2223,null));};exports[_0x9a23('0x46')]=function(_0x57d9a8,_0xd2259f){return db['MailMessage'][_0x9a23('0x46')](_0x57d9a8[_0x9a23('0x42')])['then'](function(_0x2d4624){if(_0x2d4624){if(_0x2d4624[_0x9a23('0x47')]===_0x9a23('0x48')&&!_0x2d4624[_0x9a23('0x49')]){var _0x52a535,_0x3114f0,_0x1c374e;if(_0x57d9a8[_0x9a23('0x42')]['to']){_0x3114f0=_0x57d9a8[_0x9a23('0x42')]['to']['split'](',')[0x0];}return db[_0x9a23('0x4a')][_0x9a23('0x4b')]({'where':{'id':_0x2d4624[_0x9a23('0x4c')]},'include':[{'model':db[_0x9a23('0x4d')],'as':'List','include':[{'model':db[_0x9a23('0x4e')],'as':_0x9a23('0x4f'),'where':{'email':_0x3114f0},'limit':0x1,'order':[[_0x9a23('0x50'),_0x9a23('0x51')]]}]},{'model':db[_0x9a23('0x52')],'as':_0x9a23('0x53'),'raw':!![],'include':[{'model':db[_0x9a23('0x54')],'as':_0x9a23('0x54'),'raw':!![]}]}]})['then'](function(_0x4038f0){_0x52a535=_0x4038f0;if(!_0x52a535||!_0x52a535[_0x9a23('0x53')])return;var _0x4cc6cd=_0x52a535[_0x9a23('0x55')]();if(_0x57d9a8[_0x9a23('0x42')]['attachments']&&_0x57d9a8['body']['attachments'][_0x9a23('0x33')]){for(var _0x51ab29=0x0;_0x51ab29<_0x57d9a8[_0x9a23('0x42')][_0x9a23('0x56')]['length'];_0x51ab29+=0x1){_0x57d9a8['body'][_0x9a23('0x56')][_0x51ab29]={'filename':_0x57d9a8[_0x9a23('0x42')][_0x9a23('0x56')][_0x51ab29][_0x9a23('0x24')],'path':path[_0x9a23('0x57')](config[_0x9a23('0x58')],_0x9a23('0x59'),_0x57d9a8[_0x9a23('0x42')]['attachments'][_0x51ab29][_0x9a23('0x5a')])};}}_0x1c374e={'account':_0x4cc6cd,'message':_0x57d9a8['body']};return;})[_0x9a23('0xe')](function(){if(_0x52a535['List']){if(_0x52a535['List'][_0x9a23('0x4f')]['length']){return _0x52a535[_0x9a23('0x5b')]['Contacts'][0x0];}else{return db[_0x9a23('0x4e')][_0x9a23('0x46')](_[_0x9a23('0x8')](_0x57d9a8[_0x9a23('0x42')],{'firstName':_0x57d9a8[_0x9a23('0x42')]['to'],'email':_0x57d9a8['body']['to'],'phone':_0x57d9a8[_0x9a23('0x42')]['to'],'ListId':_0x52a535[_0x9a23('0x5c')]}));}}else{throw new Error(_0x9a23('0x5d'));}})[_0x9a23('0xe')](function(){if(_0x1c374e){return respondWithRpcPromise(_0x9a23('0x5e'),_0x9a23('0x5f'),_0x1c374e,client9003)[_0x9a23('0xe')](function(_0x3ff5b8){return _0x2d4624['update']({'read':!![],'messageId':_0x3ff5b8[_0x9a23('0x60')],'sentAt':moment()[_0x9a23('0x61')](_0x9a23('0x62'))});})[_0x9a23('0x16')](function(_0x53195a){logger[_0x9a23('0x12')]('%s',JSON[_0x9a23('0x63')](_0x53195a));return _0x2d4624;});}return _0x2d4624;});}return _0x2d4624;}})[_0x9a23('0xe')](respondWithResult(_0xd2259f,0xc9))[_0x9a23('0x16')](handleError(_0xd2259f,null));};exports[_0x9a23('0x64')]=function(_0x5ead14,_0x1abd59){var _0x2e019f={'agent':{},'channel':_0x9a23('0x65')};if(_0x5ead14[_0x9a23('0x42')]['id']){delete _0x5ead14[_0x9a23('0x42')]['id'];}_0x5ead14['body'][_0x9a23('0x66')]=!![];_0x5ead14[_0x9a23('0x42')][_0x9a23('0x67')]=moment()[_0x9a23('0x61')](_0x9a23('0x62'));_0x5ead14['body']['UserId']=_0x5ead14['body'][_0x9a23('0x68')]||_0x5ead14[_0x9a23('0x69')]['id'];_0x2e019f[_0x9a23('0x6a')]['id']=_0x5ead14[_0x9a23('0x42')][_0x9a23('0x68')];return db[_0x9a23('0x28')][_0x9a23('0x43')]({'where':{'id':_0x5ead14[_0x9a23('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1abd59,null))['then'](saveUpdates(_0x5ead14[_0x9a23('0x42')],null))[_0x9a23('0xe')](function(_0x452d4c){if(_0x452d4c){_0x2e019f[_0x9a23('0x13')]=_0x452d4c[_0x9a23('0x6b')]({'plain':!![]});return db[_0x9a23('0x6c')][_0x9a23('0x43')]({'where':{'id':_0x452d4c['MailInteractionId']}});}return null;})[_0x9a23('0xe')](handleEntityNotFound(_0x1abd59,null))[_0x9a23('0xe')](function(_0x5ccf3b){if(_0x5ccf3b){return _0x5ccf3b[_0x9a23('0x1f')]({'UserId':_0x5ead14['body'][_0x9a23('0x68')],'read1stAt':_[_0x9a23('0x6d')](_0x5ccf3b[_0x9a23('0x6e')])?moment()[_0x9a23('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x342370){if(_0x342370){_0x2e019f[_0x9a23('0x6f')]=_0x342370['get']({'plain':!![]});interaction_log[_0x9a23('0x14')](_0x9a23('0x70'),_0x5ead14[_0x9a23('0x69')]['id'],_0x5ead14[_0x9a23('0x69')]['name'],_0x5ead14['user']['role'],_0x2e019f['interaction']['id'],_0x5ead14[_0x9a23('0x42')]?JSON[_0x9a23('0x63')](_0x5ead14[_0x9a23('0x42')]):_0x9a23('0x71'));return respondWithRpcPromise('AcceptMessage',_0x9a23('0x72'),_0x2e019f);}return null;})[_0x9a23('0xe')](function(_0x6ec4e5){var _0x30d4ad='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x6ec4e5[_0x9a23('0x13')][_0x9a23('0x73')];return db['sequelize'][_0x9a23('0x2d')](_0x30d4ad,{'type':db['Sequelize'][_0x9a23('0x74')][_0x9a23('0x75')],'raw':!![]})[_0x9a23('0xe')](function(_0x3166a9){return _0x3166a9;});})[_0x9a23('0xe')](function(_0x85330d){if(_0x85330d){_0x2e019f[_0x9a23('0x13')][_0x9a23('0x76')]=_0x85330d[0x0];if(!_0x5ead14[_0x9a23('0x42')][_0x9a23('0x68')])return;return db[_0x9a23('0x77')][_0x9a23('0x43')]({'where':{'id':_0x5ead14[_0x9a23('0x42')][_0x9a23('0x68')],'role':_0x9a23('0x6a')},'attributes':['id','name',_0x9a23('0x78'),'email',_0x9a23('0x79')],'raw':!![]});}return null;})['then'](function(_0xb45412){if(!_0xb45412)return null;_0x2e019f[_0x9a23('0x13')][_0x9a23('0x6a')]=_0xb45412;return _0x2e019f;})[_0x9a23('0xe')](function(_0x379a26){if(_0x379a26){if(_0x5ead14[_0x9a23('0x42')]['manual']){_0x2e019f['message']['interface']=util[_0x9a23('0x61')](_0x9a23('0x7a'),_0x5ead14[_0x9a23('0x69')][_0x9a23('0x24')]);_0x2e019f[_0x9a23('0x13')][_0x9a23('0x7b')]=_0x2e019f[_0x9a23('0x7b')];_0x2e019f[_0x9a23('0x13')][_0x9a23('0x7c')]=_0x2e019f['channel'];_0x2e019f['message']['event']='accept';_0x2e019f['message'][_0x9a23('0x42')]=htmlToText[_0x9a23('0x7d')](_0x2e019f[_0x9a23('0x13')][_0x9a23('0x42')]);return respondWithRpcPromise(_0x9a23('0x7e'),_0x9a23('0x7e'),{'event':_0x9a23('0x7f'),'message':_0x2e019f[_0x9a23('0x13')]},client9002)[_0x9a23('0xe')](function(){return _0x2e019f;});}return _0x2e019f;}return null;})[_0x9a23('0xe')](respondWithResult(_0x1abd59,null))['catch'](handleError(_0x1abd59,null));};exports[_0x9a23('0x80')]=function(_0x3be17f,_0x352eec){var _0x14fff2={'agent':{},'channel':_0x9a23('0x65')};if(_0x3be17f[_0x9a23('0x42')]['id']){delete _0x3be17f['body']['id'];}_0x3be17f[_0x9a23('0x42')]['UserId']=_0x3be17f[_0x9a23('0x42')][_0x9a23('0x68')]||_0x3be17f[_0x9a23('0x69')]['id'];_0x14fff2[_0x9a23('0x6a')]['id']=_0x3be17f[_0x9a23('0x42')]['UserId'];return db[_0x9a23('0x28')][_0x9a23('0x43')]({'where':{'id':_0x3be17f['params']['id'],'UserId':null}})[_0x9a23('0xe')](handleEntityNotFound(_0x352eec,null))[_0x9a23('0xe')](function(_0x5ccfd9){if(_0x5ccfd9){_0x14fff2[_0x9a23('0x13')]=_0x5ccfd9[_0x9a23('0x6b')]({'plain':!![]});return db['MailInteraction'][_0x9a23('0x43')]({'where':{'id':_0x5ccfd9['MailInteractionId']}});}return null;})[_0x9a23('0xe')](handleEntityNotFound(_0x352eec,null))[_0x9a23('0xe')](function(_0x54fd83){if(_0x54fd83){_0x14fff2[_0x9a23('0x6f')]=_0x54fd83[_0x9a23('0x6b')]({'plain':!![]});interaction_log[_0x9a23('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3be17f[_0x9a23('0x69')]['id'],_0x3be17f[_0x9a23('0x69')][_0x9a23('0x24')],_0x3be17f[_0x9a23('0x69')]['role'],_0x14fff2[_0x9a23('0x6f')]['id'],_0x3be17f[_0x9a23('0x42')]?JSON[_0x9a23('0x63')](_0x3be17f[_0x9a23('0x42')]):'null');return respondWithRpcPromise(_0x9a23('0x81'),_0x9a23('0x82'),_0x14fff2);}return null;})[_0x9a23('0xe')](function(_0x538946){var _0x4a8710=_0x9a23('0x83')+_0x538946[_0x9a23('0x13')][_0x9a23('0x73')];return db[_0x9a23('0x84')]['query'](_0x4a8710,{'type':db[_0x9a23('0x85')]['QueryTypes'][_0x9a23('0x75')],'raw':!![]})['then'](function(_0x2ed41f){return _0x2ed41f;});})[_0x9a23('0xe')](function(_0x9a9fcc){if(_0x9a9fcc){_0x14fff2[_0x9a23('0x13')][_0x9a23('0x76')]=_0x9a9fcc[0x0];if(!_0x3be17f['body'][_0x9a23('0x68')])return;return db[_0x9a23('0x77')]['find']({'where':{'id':_0x3be17f[_0x9a23('0x42')][_0x9a23('0x68')],'role':_0x9a23('0x6a')},'attributes':['id',_0x9a23('0x24'),_0x9a23('0x78'),_0x9a23('0x86'),'internal'],'raw':!![]});}return null;})['then'](function(_0x339e27){if(!_0x339e27)return null;_0x14fff2[_0x9a23('0x13')][_0x9a23('0x6a')]=_0x339e27;return _0x14fff2;})[_0x9a23('0xe')](function(_0x39401a){if(_0x39401a){_0x39401a[_0x9a23('0x13')][_0x9a23('0x87')]=util[_0x9a23('0x61')](_0x9a23('0x7a'),_0x3be17f[_0x9a23('0x69')]['name']);_0x39401a['message'][_0x9a23('0x7b')]=_0x14fff2['channel'];_0x39401a[_0x9a23('0x13')][_0x9a23('0x7c')]=_0x14fff2[_0x9a23('0x7b')];_0x39401a[_0x9a23('0x13')]['event']=_0x9a23('0x80');_0x39401a[_0x9a23('0x13')][_0x9a23('0x42')]=htmlToText[_0x9a23('0x7d')](_0x14fff2[_0x9a23('0x13')][_0x9a23('0x42')]);respondWithRpcPromise(_0x9a23('0x7e'),_0x9a23('0x7e'),{'event':_0x9a23('0x88'),'message':_0x39401a[_0x9a23('0x13')]},client9002);return _0x14fff2;}return null;})[_0x9a23('0xe')](respondWithResult(_0x352eec,null))[_0x9a23('0x16')](handleError(_0x352eec,null));};exports[_0x9a23('0x89')]=function(_0x1ab1b4,_0x25b3c6){var _0xc43f8a=moment()[_0x9a23('0x8a')]()['toString']();var _0x5897f5=path[_0x9a23('0x57')](config['root'],'server',_0x9a23('0x8b'),_0x9a23('0x8c'));var _0x589d58=path[_0x9a23('0x57')](config[_0x9a23('0x58')],_0x9a23('0x8d'),_0x9a23('0x8b'),_0x9a23('0x56'));var _0x2b4535=util[_0x9a23('0x61')]('message-%s.eml',_0xc43f8a);return db[_0x9a23('0x28')][_0x9a23('0x43')]({'where':{'id':_0x1ab1b4[_0x9a23('0x44')]['id']},'attributes':['id',_0x9a23('0x42'),_0x9a23('0x8e'),'to','cc',_0x9a23('0x8f'),_0x9a23('0x90'),_0x9a23('0x91')],'include':_0x1ab1b4[_0x9a23('0x2d')]['attachments']?[{'model':db[_0x9a23('0x92')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x25b3c6,null))[_0x9a23('0xe')](function(_0x3cc0af){if(_0x3cc0af){var _0x2477d4=_0x3cc0af;var _0xf99595={'from':_0x2477d4[_0x9a23('0x8e')],'to':_0x2477d4['to'],'subject':_0x2477d4[_0x9a23('0x90')],'html':htmlEntities[_0x9a23('0x93')](_0x2477d4['body']),'headers':{'Date':moment(_0x2477d4['createdAt'])['format'](_0x9a23('0x94'))},'attachments':[]};if(_0x3cc0af['cc']){_0xf99595[_0x9a23('0x95')]['Cc']=_0x3cc0af['cc'];}if(_0x3cc0af[_0x9a23('0x8f')]){_0xf99595[_0x9a23('0x95')][_0x9a23('0x96')]=_0x3cc0af['bcc'];}return new BPromise(function(_0x22aefb,_0x58f31b){if(_0x3cc0af[_0x9a23('0x97')]){for(var _0x2687d1=0x0;_0x2687d1<_0x3cc0af[_0x9a23('0x97')][_0x9a23('0x33')];_0x2687d1++){var _0x5be746=_0x3cc0af[_0x9a23('0x97')][_0x2687d1];var _0x26a511=path['join'](_0x589d58,_0x5be746['basename']);if(fs[_0x9a23('0x98')](_0x26a511)){_0xf99595[_0x9a23('0x56')][_0x9a23('0x99')]({'name':_0x5be746[_0x9a23('0x24')],'contentType':_0x5be746[_0x9a23('0x2a')],'data':fs[_0x9a23('0x9a')](_0x26a511)});}}}emlformat['build'](_0xf99595,function(_0x46fd92,_0xb7cd86){if(_0x46fd92)return _0x58f31b(_0x46fd92);fs['writeFileSync'](path[_0x9a23('0x57')](_0x5897f5,_0x2b4535),_0xb7cd86);return _0x22aefb(_0xb7cd86);});});}})[_0x9a23('0xe')](function(_0x37de8b){if(_0x37de8b){return _0x25b3c6['download'](path[_0x9a23('0x57')](_0x5897f5,_0x2b4535),_0x2b4535,function(_0x21265c){if(!_0x21265c)fs[_0x9a23('0x9b')](path[_0x9a23('0x57')](_0x5897f5,_0x2b4535));});}})[_0x9a23('0x16')](handleError(_0x25b3c6,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index cc13c98..706a8db 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 _0xdc30=['save','update','remove','emit','hasOwnProperty','MailMessage','setMaxListeners'];(function(_0x526dc9,_0x55df31){var _0x2987ba=function(_0x30a720){while(--_0x30a720){_0x526dc9['push'](_0x526dc9['shift']());}};_0x2987ba(++_0x55df31);}(_0xdc30,0x6e));var _0x0dc3=function(_0x584b87,_0x3542b8){_0x584b87=_0x584b87-0x0;var _0x3e7b7e=_0xdc30[_0x584b87];return _0x3e7b7e;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x0dc3('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0dc3('0x1')](0x0);var events={'afterCreate':_0x0dc3('0x2'),'afterUpdate':_0x0dc3('0x3'),'afterDestroy':_0x0dc3('0x4')};function emitEvent(_0x25900b){return function(_0x2418a1,_0x55f085,_0x5e8f70){MailMessageEvents[_0x0dc3('0x5')](_0x25900b+':'+_0x2418a1['id'],_0x2418a1);MailMessageEvents[_0x0dc3('0x5')](_0x25900b,_0x2418a1);_0x5e8f70(null);};}for(var e in events){if(events[_0x0dc3('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xa5fd=['../../mysqldb','MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x3b0dc7,_0x5ba5eb){var _0x1128c3=function(_0x11c44b){while(--_0x11c44b){_0x3b0dc7['push'](_0x3b0dc7['shift']());}};_0x1128c3(++_0x5ba5eb);}(_0xa5fd,0x12d));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xda5f('0x0'))['db'][_0xda5f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xda5f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xda5f('0x3')};function emitEvent(_0x15ae81){return function(_0x439dbc,_0x46ccd0,_0x363331){MailMessageEvents['emit'](_0x15ae81+':'+_0x439dbc['id'],_0x439dbc);MailMessageEvents[_0xda5f('0x4')](_0x15ae81,_0x439dbc);_0x363331(null);};}for(var e in events){if(events[_0xda5f('0x5')](e)){var event=events[e];MailMessage[_0xda5f('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 8a9f869..6a64c1f 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 _0x84a5=['fromString','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailMessage.attributes','exports','MailMessage','messageId','plainBody','subject','FULLTEXT','body'];(function(_0x138e94,_0x2e570f){var _0x11ec01=function(_0x3e50e5){while(--_0x3e50e5){_0x138e94['push'](_0x138e94['shift']());}};_0x11ec01(++_0x2e570f);}(_0x84a5,0x94));var _0x584a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x84a5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x584a('0x0'));var util=require(_0x584a('0x1'));var logger=require(_0x584a('0x2'))(_0x584a('0x3'));var moment=require(_0x584a('0x4'));var BPromise=require(_0x584a('0x5'));var rp=require(_0x584a('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x584a('0x7'));var rimraf=require(_0x584a('0x8'));var config=require('../../config/environment');var attributes=require(_0x584a('0x9'));module[_0x584a('0xa')]=function(_0x60a3d4,_0x3688f2){return _0x60a3d4['define'](_0x584a('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x584a('0xc'),'fields':[_0x584a('0xc')]},{'name':'fti_mail_messages','fields':[_0x584a('0xd'),_0x584a('0xe')],'type':_0x584a('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7559f2,_0x5ea890,_0x1be920){if(_0x7559f2[_0x584a('0x10')]){_0x7559f2['plainBody']=htmlToText[_0x584a('0x11')](_0x7559f2[_0x584a('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1be920(null,_0x5ea890);},'afterCreate':function(_0x5056ff,_0x32f595,_0x346550){var _0x4d5e55=_0x60a3d4['models'];var _0x4ed569=_0x5056ff[_0x584a('0x12')]({'plain':!![]});if(_0x4ed569[_0x584a('0x13')][_0x584a('0x14')]()==='in'||_0x4ed569[_0x584a('0x13')][_0x584a('0x14')]()===_0x584a('0x15')&&!_0x4ed569[_0x584a('0x16')]&&!_[_0x584a('0x17')](_0x4ed569['UserId'])){_0x4d5e55[_0x584a('0x18')][_0x584a('0x19')]({'where':{'id':_0x4ed569[_0x584a('0x1a')]}})[_0x584a('0x1b')](function(_0xcea2d2){if(_0xcea2d2){_0xcea2d2[_0x584a('0x1c')]({'lastMsgAt':_0x4ed569[_0x584a('0x1d')],'lastMsgDirection':_0x4ed569[_0x584a('0x13')][_0x584a('0x14')]()});}})[_0x584a('0x1e')](function(_0x22a145){console['error'](_0x22a145);});}_0x346550();}},'charset':_0x584a('0x1f'),'collate':_0x584a('0x20')});}; \ No newline at end of file +var _0xea87=['MailInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction'];(function(_0x37d4da,_0x4725be){var _0x4521bd=function(_0xe5fb1){while(--_0xe5fb1){_0x37d4da['push'](_0x37d4da['shift']());}};_0x4521bd(++_0x4725be);}(_0xea87,0xed));var _0x7ea8=function(_0x1905a5,_0x1bcadd){_0x1905a5=_0x1905a5-0x0;var _0x2301bb=_0xea87[_0x1905a5];return _0x2301bb;};'use strict';var _=require(_0x7ea8('0x0'));var util=require(_0x7ea8('0x1'));var logger=require(_0x7ea8('0x2'))(_0x7ea8('0x3'));var moment=require('moment');var BPromise=require(_0x7ea8('0x4'));var rp=require(_0x7ea8('0x5'));var htmlToText=require(_0x7ea8('0x6'));var fs=require('fs');var path=require(_0x7ea8('0x7'));var rimraf=require('rimraf');var config=require(_0x7ea8('0x8'));var attributes=require(_0x7ea8('0x9'));module[_0x7ea8('0xa')]=function(_0x3dc1bc,_0x5e47de){return _0x3dc1bc[_0x7ea8('0xb')]('MailMessage',attributes,{'tableName':_0x7ea8('0xc'),'paranoid':![],'indexes':[{'name':_0x7ea8('0xd'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x7ea8('0xe'),_0x7ea8('0xf')],'type':_0x7ea8('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x175b79,_0x509564,_0x1401ae){if(_0x175b79[_0x7ea8('0x11')]){_0x175b79[_0x7ea8('0xe')]=htmlToText[_0x7ea8('0x12')](_0x175b79[_0x7ea8('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1401ae(null,_0x509564);},'afterCreate':function(_0x41e494,_0x266a4f,_0x1d7f84){var _0x3d7a7a=_0x3dc1bc[_0x7ea8('0x13')];var _0x102d88=_0x41e494[_0x7ea8('0x14')]({'plain':!![]});if(_0x102d88['direction']['toLowerCase']()==='in'||_0x102d88[_0x7ea8('0x15')][_0x7ea8('0x16')]()===_0x7ea8('0x17')&&!_0x102d88['secret']&&!_[_0x7ea8('0x18')](_0x102d88[_0x7ea8('0x19')])){_0x3d7a7a[_0x7ea8('0x1a')]['findOne']({'where':{'id':_0x102d88[_0x7ea8('0x1b')]}})[_0x7ea8('0x1c')](function(_0x1d73af){if(_0x1d73af){_0x1d73af['update']({'lastMsgAt':_0x102d88[_0x7ea8('0x1d')],'lastMsgDirection':_0x102d88[_0x7ea8('0x15')][_0x7ea8('0x16')]()});}})[_0x7ea8('0x1e')](function(_0x552c63){console['error'](_0x552c63);});}_0x1d7f84();}},'charset':_0x7ea8('0x1f'),'collate':_0x7ea8('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 50456c5..c6bd765 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 _0x0120=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x0120,0x6f));var _0x0012=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0120[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0012('0xc')](config[_0x0012('0xd')],{'host':_0x0012('0xe'),'port':0x18eb});var socket=require(_0x0012('0xf'))(new Redis(config[_0x0012('0xd')]));require('./mailMessage.socket')[_0x0012('0x10')](socket);function respondWithRpcPromise(_0x2d484c,_0x1dc1b2,_0x323282){return new BPromise(function(_0x520171,_0x2d4674){return client['request'](_0x2d484c,_0x323282)[_0x0012('0x11')](function(_0x1d1c02){logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));logger['debug'](_0x0012('0x15'),_0x1dc1b2,'request\x20sent',JSON['stringify'](_0x1d1c02));if(_0x1d1c02['error']){if(_0x1d1c02['error'][_0x0012('0x16')]===0x1f4){logger['error'](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02[_0x0012('0x17')]['message']);return _0x2d4674(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02['error']['message']);return _0x520171(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}else{logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));_0x520171(_0x1d1c02[_0x0012('0x19')][_0x0012('0x18')]);}})[_0x0012('0x1a')](function(_0x5b236f){logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x5b236f);_0x2d4674(_0x5b236f);});});}exports['CreateMailMessage']=function(_0x45d00b){var _0x1f54fc=this;return new Promise(function(_0xa2e623,_0x2c837e){return db['MailMessage']['create'](_0x45d00b[_0x0012('0x1b')],{'raw':_0x45d00b[_0x0012('0x1c')]?_0x45d00b[_0x0012('0x1c')][_0x0012('0x1d')]===undefined?!![]:![]:!![]})[_0x0012('0x11')](function(_0x2e6a2c){logger[_0x0012('0x12')](_0x0012('0x1e'),_0x45d00b);logger['debug'](_0x0012('0x1e'),_0x45d00b,JSON[_0x0012('0x1f')](_0x2e6a2c));_0xa2e623(_0x2e6a2c);})['catch'](function(_0x36cf42){logger[_0x0012('0x17')](_0x0012('0x1e'),_0x36cf42[_0x0012('0x18')],_0x45d00b);_0x2c837e(_0x1f54fc[_0x0012('0x17')](0x1f4,_0x36cf42['message']));});});}; \ No newline at end of file +var _0x6d11=['options','raw','CreateMailMessage','debug','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage','create','body'];(function(_0x46d6be,_0x32ccaa){var _0x42ccd2=function(_0xce0dcb){while(--_0xce0dcb){_0x46d6be['push'](_0x46d6be['shift']());}};_0x42ccd2(++_0x32ccaa);}(_0x6d11,0xbf));var _0x16d1=function(_0x2746dc,_0x4b8bcb){_0x2746dc=_0x2746dc-0x0;var _0x2fdb52=_0x6d11[_0x2746dc];return _0x2fdb52;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});config[_0x16d1('0xa')]=_[_0x16d1('0xb')](config[_0x16d1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16d1('0xc'))[_0x16d1('0xd')](socket);function respondWithRpcPromise(_0xe67758,_0x5a6abb,_0x4b7d4f){return new BPromise(function(_0x265a84,_0x2c360f){return client[_0x16d1('0xe')](_0xe67758,_0x4b7d4f)[_0x16d1('0xf')](function(_0x28188f){logger[_0x16d1('0x10')](_0x16d1('0x11'),_0x5a6abb,_0x16d1('0x12'));logger['debug'](_0x16d1('0x13'),_0x5a6abb,_0x16d1('0x12'),JSON[_0x16d1('0x14')](_0x28188f));if(_0x28188f[_0x16d1('0x15')]){if(_0x28188f[_0x16d1('0x15')]['code']===0x1f4){logger[_0x16d1('0x15')](_0x16d1('0x11'),_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x2c360f(_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);}logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x265a84(_0x28188f['error']['message']);}else{logger[_0x16d1('0x10')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x16d1('0x12'));_0x265a84(_0x28188f['result'][_0x16d1('0x16')]);}})['catch'](function(_0x30f694){logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x30f694);_0x2c360f(_0x30f694);});});}exports['CreateMailMessage']=function(_0x52a0f2){var _0x5b9599=this;return new Promise(function(_0x348425,_0x55a0e0){return db[_0x16d1('0x17')][_0x16d1('0x18')](_0x52a0f2[_0x16d1('0x19')],{'raw':_0x52a0f2[_0x16d1('0x1a')]?_0x52a0f2['options'][_0x16d1('0x1b')]===undefined?!![]:![]:!![]})[_0x16d1('0xf')](function(_0x2a897d){logger['info'](_0x16d1('0x1c'),_0x52a0f2);logger[_0x16d1('0x1d')](_0x16d1('0x1c'),_0x52a0f2,JSON[_0x16d1('0x14')](_0x2a897d));_0x348425(_0x2a897d);})[_0x16d1('0x1e')](function(_0x1448b7){logger[_0x16d1('0x15')](_0x16d1('0x1c'),_0x1448b7[_0x16d1('0x16')],_0x52a0f2);_0x55a0e0(_0x5b9599[_0x16d1('0x15')](0x1f4,_0x1448b7[_0x16d1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 26329ed..5aef859 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 _0x32e5=['save','remove','emit','removeListener','length','./mailMessage.events'];(function(_0x3e5400,_0x378d30){var _0x5737d3=function(_0x1f7bda){while(--_0x1f7bda){_0x3e5400['push'](_0x3e5400['shift']());}};_0x5737d3(++_0x378d30);}(_0x32e5,0x149));var _0x532e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x32e5[_0x3b380d];return _0x54502b;};'use strict';var MailMessageEvents=require(_0x532e('0x0'));var events=[_0x532e('0x1'),_0x532e('0x2'),'update'];function createListener(_0x3a80ae,_0x20d5f7){return function(_0x247d42){_0x20d5f7[_0x532e('0x3')](_0x3a80ae,_0x247d42);};}function removeListener(_0x2d4655,_0x28bf88){return function(){MailMessageEvents[_0x532e('0x4')](_0x2d4655,_0x28bf88);};}exports['register']=function(_0xedaa3f){for(var _0x493936=0x0,_0x4e3a5c=events[_0x532e('0x5')];_0x493936<_0x4e3a5c;_0x493936++){var _0x182b56=events[_0x493936];var _0x485312=createListener('mailMessage:'+_0x182b56,_0xedaa3f);MailMessageEvents['on'](_0x182b56,_0x485312);}}; \ No newline at end of file +var _0x48c6=['removeListener','register','length','./mailMessage.events','save','update'];(function(_0x3b50e2,_0x2ddbc6){var _0x327ca7=function(_0x3f2ee3){while(--_0x3f2ee3){_0x3b50e2['push'](_0x3b50e2['shift']());}};_0x327ca7(++_0x2ddbc6);}(_0x48c6,0x17d));var _0x648c=function(_0x5349ce,_0x1e6ec2){_0x5349ce=_0x5349ce-0x0;var _0x156fd5=_0x48c6[_0x5349ce];return _0x156fd5;};'use strict';var MailMessageEvents=require(_0x648c('0x0'));var events=[_0x648c('0x1'),'remove',_0x648c('0x2')];function createListener(_0x23f4c8,_0x5aca90){return function(_0x45073a){_0x5aca90['emit'](_0x23f4c8,_0x45073a);};}function removeListener(_0x2c039c,_0x2346d2){return function(){MailMessageEvents[_0x648c('0x3')](_0x2c039c,_0x2346d2);};}exports[_0x648c('0x4')]=function(_0x5eab0d){for(var _0x5d7b66=0x0,_0x486379=events[_0x648c('0x5')];_0x5d7b66<_0x486379;_0x5d7b66++){var _0x349b2e=events[_0x5d7b66];var _0x21cdfc=createListener('mailMessage:'+_0x349b2e,_0x5eab0d);MailMessageEvents['on'](_0x349b2e,_0x21cdfc);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 1e0dc44..257c2b6 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 _0xc4ff=['get','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','/describe','describe'];(function(_0x58ce26,_0x443d2c){var _0x26e33d=function(_0x1128b6){while(--_0x1128b6){_0x58ce26['push'](_0x58ce26['shift']());}};_0x26e33d(++_0x443d2c);}(_0xc4ff,0x167));var _0xfc4f=function(_0x248081,_0x268bad){_0x248081=_0x248081-0x0;var _0x2f8df0=_0xc4ff[_0x248081];return _0x2f8df0;};'use strict';var multer=require(_0xfc4f('0x0'));var util=require(_0xfc4f('0x1'));var path=require(_0xfc4f('0x2'));var timeout=require(_0xfc4f('0x3'));var express=require(_0xfc4f('0x4'));var router=express[_0xfc4f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc4f('0x6'));var config=require(_0xfc4f('0x7'));var controller=require(_0xfc4f('0x8'));router['get']('/',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0xa')]);router['get'](_0xfc4f('0xb'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0xc')]);router[_0xfc4f('0xd')](_0xfc4f('0xe'),auth[_0xfc4f('0x9')](),controller['show']);router[_0xfc4f('0xd')](_0xfc4f('0xf'),auth['isAuthenticated'](),controller[_0xfc4f('0x10')]);router[_0xfc4f('0xd')](_0xfc4f('0x11'),auth[_0xfc4f('0x9')](),controller['getTeams']);router['get'](_0xfc4f('0x12'),auth['isAuthenticated'](),controller[_0xfc4f('0x13')]);router[_0xfc4f('0x14')]('/',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x15')]);router[_0xfc4f('0x14')]('/:id/teams',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x16')]);router['post'](_0xfc4f('0x12'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x17')]);router[_0xfc4f('0x18')](_0xfc4f('0xe'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x19')]);router['delete'](_0xfc4f('0xe'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x1a')]);router[_0xfc4f('0x1b')](_0xfc4f('0x11'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x1c')]);router[_0xfc4f('0x1b')]('/:id/users',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x1d')]);module[_0xfc4f('0x1e')]=router; \ No newline at end of file +var _0xe7af=['/:id/users','post','create','put','update','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','getMembers','/:id/teams','getTeams'];(function(_0x32d14d,_0x46ae2e){var _0x498741=function(_0x545c12){while(--_0x545c12){_0x32d14d['push'](_0x32d14d['shift']());}};_0x498741(++_0x46ae2e);}(_0xe7af,0x90));var _0xfe7a=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0xe7af[_0x3d4ef1];return _0x409423;};'use strict';var multer=require('multer');var util=require(_0xfe7a('0x0'));var path=require(_0xfe7a('0x1'));var timeout=require(_0xfe7a('0x2'));var express=require(_0xfe7a('0x3'));var router=express[_0xfe7a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfe7a('0x5'));var interaction=require(_0xfe7a('0x6'));var config=require(_0xfe7a('0x7'));var controller=require(_0xfe7a('0x8'));router[_0xfe7a('0x9')]('/',auth[_0xfe7a('0xa')](),controller[_0xfe7a('0xb')]);router[_0xfe7a('0x9')]('/describe',auth[_0xfe7a('0xa')](),controller[_0xfe7a('0xc')]);router['get'](_0xfe7a('0xd'),auth['isAuthenticated'](),controller[_0xfe7a('0xe')]);router[_0xfe7a('0x9')]('/:id/members',auth[_0xfe7a('0xa')](),controller[_0xfe7a('0xf')]);router[_0xfe7a('0x9')](_0xfe7a('0x10'),auth[_0xfe7a('0xa')](),controller[_0xfe7a('0x11')]);router[_0xfe7a('0x9')](_0xfe7a('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0xfe7a('0x13')]('/',auth[_0xfe7a('0xa')](),controller[_0xfe7a('0x14')]);router['post'](_0xfe7a('0x10'),auth[_0xfe7a('0xa')](),controller['addTeams']);router[_0xfe7a('0x13')](_0xfe7a('0x12'),auth[_0xfe7a('0xa')](),controller['addAgents']);router[_0xfe7a('0x15')](_0xfe7a('0xd'),auth['isAuthenticated'](),controller[_0xfe7a('0x16')]);router[_0xfe7a('0x17')](_0xfe7a('0xd'),auth[_0xfe7a('0xa')](),controller[_0xfe7a('0x18')]);router['delete'](_0xfe7a('0x10'),auth[_0xfe7a('0xa')](),controller[_0xfe7a('0x19')]);router['delete'](_0xfe7a('0x12'),auth[_0xfe7a('0xa')](),controller[_0xfe7a('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index c536e95..cff044e 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 _0x4952=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3b6693,_0x2cfefb){var _0x387e03=function(_0xe7297e){while(--_0xe7297e){_0x3b6693['push'](_0x3b6693['shift']());}};_0x387e03(++_0x2cfefb);}(_0x4952,0x183));var _0x2495=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x4952[_0x149a9b];return _0x2c2bf6;};'use strict';var Sequelize=require(_0x2495('0x0'));module[_0x2495('0x1')]={'name':{'type':Sequelize[_0x2495('0x2')],'unique':_0x2495('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2495('0x2')]},'timeout':{'type':Sequelize[_0x2495('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2495('0x5'),_0x2495('0x6'),_0x2495('0x7'))}}; \ No newline at end of file +var _0xa4f7=['roundrobin','sequelize','STRING','name','ENUM','rrmemory','beepall'];(function(_0x2ff5cb,_0x3193b1){var _0x2087a7=function(_0x4a69c5){while(--_0x4a69c5){_0x2ff5cb['push'](_0x2ff5cb['shift']());}};_0x2087a7(++_0x3193b1);}(_0xa4f7,0x120));var _0x7a4f=function(_0x15bf22,_0x357831){_0x15bf22=_0x15bf22-0x0;var _0x248c69=_0xa4f7[_0x15bf22];return _0x248c69;};'use strict';var Sequelize=require(_0x7a4f('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a4f('0x1')],'unique':_0x7a4f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7a4f('0x3')](_0x7a4f('0x4'),_0x7a4f('0x5'),_0x7a4f('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 48f3f8c..8308799 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 _0x04d0=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','get','MailQueues','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserMailQueue','User','UserId','mailPause','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','compact','value','removeAgents','userMailQueue:remove','addAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','jsforce','querystring'];(function(_0x2bb9e3,_0x21decc){var _0x3fd75f=function(_0x26b7d0){while(--_0x26b7d0){_0x2bb9e3['push'](_0x2bb9e3['shift']());}};_0x3fd75f(++_0x21decc);}(_0x04d0,0x10a));var _0x004d=function(_0x2d406c,_0x50bae7){_0x2d406c=_0x2d406c-0x0;var _0x14f642=_0x04d0[_0x2d406c];return _0x14f642;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x004d('0x0'));var jsonpatch=require(_0x004d('0x1'));var rp=require(_0x004d('0x2'));var moment=require(_0x004d('0x3'));var BPromise=require(_0x004d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x004d('0x5'));var sox=require('sox');var csv=require(_0x004d('0x6'));var ejs=require(_0x004d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x004d('0x8'));var squel=require(_0x004d('0x9'));var crypto=require('crypto');var jsforce=require(_0x004d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x004d('0x6'));var querystring=require(_0x004d('0xb'));var Papa=require(_0x004d('0xc'));var Redis=require('ioredis');var authService=require(_0x004d('0xd'));var qs=require(_0x004d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x004d('0xf'));var logger=require('../../config/logger')(_0x004d('0x10'));var utils=require(_0x004d('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x004d('0x12'));var db=require('../../mysqldb')['db'];config[_0x004d('0x13')]=_[_0x004d('0x14')](config[_0x004d('0x13')],{'host':_0x004d('0x15'),'port':0x18eb});var socket=require(_0x004d('0x16'))(new Redis(config[_0x004d('0x13')]));require(_0x004d('0x17'))[_0x004d('0x18')](socket);function respondWithStatusCode(_0x4f4785,_0x425dec){_0x425dec=_0x425dec||0xcc;return function(_0x3bd18c){if(_0x3bd18c){return _0x4f4785[_0x004d('0x19')](_0x425dec);}return _0x4f4785[_0x004d('0x1a')](_0x425dec)[_0x004d('0x1b')]();};}function respondWithResult(_0x402969,_0x1904a6){_0x1904a6=_0x1904a6||0xc8;return function(_0x365c20){if(_0x365c20){return _0x402969['status'](_0x1904a6)[_0x004d('0x1c')](_0x365c20);}};}function respondWithFilteredResult(_0x1f3482,_0x34e151){return function(_0x4b3912){if(_0x4b3912){var _0x1adf2a=typeof _0x34e151['offset']===_0x004d('0x1d')&&typeof _0x34e151[_0x004d('0x1e')]===_0x004d('0x1d');var _0x66dd7f=_0x4b3912['count'];var _0x1c184c=_0x1adf2a?0x0:_0x34e151[_0x004d('0x1f')];var _0x518ee8=_0x1adf2a?_0x4b3912[_0x004d('0x20')]:_0x34e151[_0x004d('0x1f')]+_0x34e151[_0x004d('0x1e')];var _0x3abed3;if(_0x518ee8>=_0x66dd7f){_0x518ee8=_0x66dd7f;_0x3abed3=0xc8;}else{_0x3abed3=0xce;}_0x1f3482['status'](_0x3abed3);return _0x1f3482[_0x004d('0x21')](_0x004d('0x22'),_0x1c184c+'-'+_0x518ee8+'/'+_0x66dd7f)[_0x004d('0x1c')](_0x4b3912);}return null;};}function patchUpdates(_0xb9eda8){return function(_0x32bde4){try{jsonpatch[_0x004d('0x23')](_0x32bde4,_0xb9eda8,!![]);}catch(_0x21bbda){return BPromise[_0x004d('0x24')](_0x21bbda);}return _0x32bde4[_0x004d('0x25')]();};}function saveUpdates(_0x1cfdaa,_0x421f33){return function(_0x83a2f0){if(_0x83a2f0){return _0x83a2f0['update'](_0x1cfdaa)['then'](function(_0x1263d8){return _0x1263d8;});}return null;};}function removeEntity(_0xb07ff9,_0x4a4fe1){return function(_0x27aac7){if(_0x27aac7){return _0x27aac7[_0x004d('0x26')]()[_0x004d('0x27')](function(){var _0xd13fff=_0x27aac7[_0x004d('0x28')]({'plain':!![]});var _0x1ccb0e=_0x004d('0x29');return db['UserProfileResource'][_0x004d('0x26')]({'where':{'type':_0x1ccb0e,'resourceId':_0xd13fff['id']}})['then'](function(){return _0x27aac7;});})['then'](function(){_0xb07ff9[_0x004d('0x1a')](0xcc)[_0x004d('0x1b')]();});}};}function handleEntityNotFound(_0xe17b2d,_0x1e13b1){return function(_0x58015b){if(!_0x58015b){_0xe17b2d[_0x004d('0x19')](0x194);}return _0x58015b;};}function handleError(_0x24caed,_0x146f0d){_0x146f0d=_0x146f0d||0x1f4;return function(_0xa3ac81){logger[_0x004d('0x2a')](_0xa3ac81[_0x004d('0x2b')]);if(_0xa3ac81['name']){delete _0xa3ac81[_0x004d('0x2c')];}_0x24caed[_0x004d('0x1a')](_0x146f0d)[_0x004d('0x2d')](_0xa3ac81);};}exports[_0x004d('0x2e')]=function(_0x5f2190,_0x492016){var _0x457385={},_0x4d06d8={},_0x3aa5f3={'count':0x0,'rows':[]};var _0xdfd119=_[_0x004d('0x2f')](db[_0x004d('0x30')][_0x004d('0x31')],function(_0x1ce8b4){return{'name':_0x1ce8b4[_0x004d('0x32')],'type':_0x1ce8b4[_0x004d('0x33')][_0x004d('0x34')]};});_0x4d06d8[_0x004d('0x35')]=_['map'](_0xdfd119,_0x004d('0x2c'));_0x4d06d8[_0x004d('0x36')]=_[_0x004d('0x37')](_0x5f2190[_0x004d('0x36')]);_0x4d06d8['filters']=_[_0x004d('0x38')](_0x4d06d8[_0x004d('0x35')],_0x4d06d8['query']);_0x457385[_0x004d('0x39')]=_[_0x004d('0x38')](_0x4d06d8[_0x004d('0x35')],qs[_0x004d('0x3a')](_0x5f2190[_0x004d('0x36')]['fields']));_0x457385[_0x004d('0x39')]=_0x457385[_0x004d('0x39')][_0x004d('0x3b')]?_0x457385[_0x004d('0x39')]:_0x4d06d8[_0x004d('0x35')];if(!_0x5f2190[_0x004d('0x36')][_0x004d('0x3c')](_0x004d('0x3d'))){_0x457385['limit']=qs[_0x004d('0x1e')](_0x5f2190['query'][_0x004d('0x1e')]);_0x457385[_0x004d('0x1f')]=qs[_0x004d('0x1f')](_0x5f2190['query'][_0x004d('0x1f')]);}_0x457385[_0x004d('0x3e')]=qs[_0x004d('0x3f')](_0x5f2190['query'][_0x004d('0x3f')]);_0x457385['where']=qs[_0x004d('0x40')](_[_0x004d('0x41')](_0x5f2190[_0x004d('0x36')],_0x4d06d8[_0x004d('0x40')]),_0xdfd119);if(_0x5f2190[_0x004d('0x36')]['filter']){_0x457385['where']=_['merge'](_0x457385[_0x004d('0x42')],{'$or':_['map'](_0xdfd119,function(_0x5f23b4){if(_0x5f23b4[_0x004d('0x33')]!=='VIRTUAL'){var _0x1ffede={};_0x1ffede[_0x5f23b4['name']]={'$like':'%'+_0x5f2190['query'][_0x004d('0x43')]+'%'};return _0x1ffede;}})});}_0x457385=_[_0x004d('0x44')]({},_0x457385,_0x5f2190[_0x004d('0x45')]);var _0x540def={'where':_0x457385['where']};return db[_0x004d('0x30')][_0x004d('0x20')](_0x540def)[_0x004d('0x27')](function(_0xaa1d11){_0x3aa5f3[_0x004d('0x20')]=_0xaa1d11;if(_0x5f2190[_0x004d('0x36')][_0x004d('0x46')]){_0x457385[_0x004d('0x47')]=[{'all':!![]}];}return db[_0x004d('0x30')][_0x004d('0x48')](_0x457385);})['then'](function(_0x2f6e68){_0x3aa5f3[_0x004d('0x49')]=_0x2f6e68;return _0x3aa5f3;})[_0x004d('0x27')](respondWithFilteredResult(_0x492016,_0x457385))[_0x004d('0x4a')](handleError(_0x492016,null));};exports[_0x004d('0x4b')]=function(_0x1e970b,_0x50fd03){var _0xe3c206={'raw':!![],'where':{'id':_0x1e970b[_0x004d('0x4c')]['id']}},_0x43828f={};_0x43828f[_0x004d('0x35')]=_[_0x004d('0x37')](db['MailQueue'][_0x004d('0x31')]);_0x43828f[_0x004d('0x36')]=_[_0x004d('0x37')](_0x1e970b['query']);_0x43828f[_0x004d('0x40')]=_[_0x004d('0x38')](_0x43828f[_0x004d('0x35')],_0x43828f[_0x004d('0x36')]);_0xe3c206['attributes']=_['intersection'](_0x43828f[_0x004d('0x35')],qs[_0x004d('0x3a')](_0x1e970b[_0x004d('0x36')][_0x004d('0x3a')]));_0xe3c206['attributes']=_0xe3c206[_0x004d('0x39')][_0x004d('0x3b')]?_0xe3c206[_0x004d('0x39')]:_0x43828f[_0x004d('0x35')];if(_0x1e970b['query']['includeAll']){_0xe3c206[_0x004d('0x47')]=[{'all':!![]}];}_0xe3c206=_[_0x004d('0x44')]({},_0xe3c206,_0x1e970b['options']);return db['MailQueue'][_0x004d('0x4d')](_0xe3c206)[_0x004d('0x27')](handleEntityNotFound(_0x50fd03,null))['then'](respondWithResult(_0x50fd03,null))['catch'](handleError(_0x50fd03,null));};exports['create']=function(_0x2ab3db,_0x5c5349){return db[_0x004d('0x30')][_0x004d('0x4e')](_0x2ab3db['body'],{})[_0x004d('0x27')](function(_0x5f3c6f){var _0x444834=_0x2ab3db['user'][_0x004d('0x28')]({'plain':!![]});if(!_0x444834)throw new Error(_0x004d('0x4f'));if(_0x444834[_0x004d('0x50')]==='user'){var _0x49ebfa=_0x5f3c6f[_0x004d('0x28')]({'plain':!![]});var _0x3458a1='MailQueues';return db[_0x004d('0x51')]['find']({'where':{'name':_0x3458a1,'userProfileId':_0x444834[_0x004d('0x52')]},'raw':!![]})[_0x004d('0x27')](function(_0x5d9b4f){if(_0x5d9b4f&&_0x5d9b4f[_0x004d('0x53')]===0x0){return db[_0x004d('0x54')][_0x004d('0x4e')]({'name':_0x49ebfa[_0x004d('0x2c')],'resourceId':_0x49ebfa['id'],'type':_0x5d9b4f['name'],'sectionId':_0x5d9b4f['id']},{})[_0x004d('0x27')](function(){return _0x5f3c6f;});}else{return _0x5f3c6f;}})[_0x004d('0x4a')](function(_0x2d5b2d){logger['error'](_0x004d('0x55'),_0x2d5b2d);throw _0x2d5b2d;});}return _0x5f3c6f;})[_0x004d('0x27')](respondWithResult(_0x5c5349,0xc9))[_0x004d('0x4a')](handleError(_0x5c5349,null));};exports[_0x004d('0x56')]=function(_0x3c6550,_0x45b717){if(_0x3c6550[_0x004d('0x57')]['id']){delete _0x3c6550[_0x004d('0x57')]['id'];}return db['MailQueue'][_0x004d('0x4d')]({'where':{'id':_0x3c6550[_0x004d('0x4c')]['id']}})[_0x004d('0x27')](handleEntityNotFound(_0x45b717,null))[_0x004d('0x27')](saveUpdates(_0x3c6550[_0x004d('0x57')],null))['then'](respondWithResult(_0x45b717,null))[_0x004d('0x4a')](handleError(_0x45b717,null));};exports['destroy']=function(_0x497b7d,_0x2cc772){return db[_0x004d('0x30')][_0x004d('0x4d')]({'where':{'id':_0x497b7d[_0x004d('0x4c')]['id']}})[_0x004d('0x27')](handleEntityNotFound(_0x2cc772,null))[_0x004d('0x27')](removeEntity(_0x2cc772,null))['catch'](handleError(_0x2cc772,null));};exports['describe']=function(_0x1e4875,_0x38d6bf){return db['MailQueue'][_0x004d('0x58')]()[_0x004d('0x27')](respondWithResult(_0x38d6bf,null))[_0x004d('0x4a')](handleError(_0x38d6bf,null));};exports[_0x004d('0x59')]=function(_0x22c0d8,_0x3d95c4,_0x2467aa){var _0x522d84={'raw':!![],'where':{}},_0x413ec5={},_0x5475dd;return db[_0x004d('0x30')]['findOne']({'where':{'id':_0x22c0d8['params']['id']}})[_0x004d('0x27')](handleEntityNotFound(_0x3d95c4,null))['then'](function(_0x1050f5){if(_0x1050f5){_0x5475dd=_0x1050f5[_0x004d('0x28')]({'plain':!![]});_0x413ec5[_0x004d('0x35')]=_[_0x004d('0x37')](db[_0x004d('0x5a')][_0x004d('0x31')]);_0x413ec5[_0x004d('0x36')]=_[_0x004d('0x37')](_0x22c0d8['query']);_0x413ec5[_0x004d('0x40')]=_[_0x004d('0x38')](_0x413ec5[_0x004d('0x35')],_0x413ec5['query']);_0x522d84[_0x004d('0x39')]=_[_0x004d('0x38')](_0x413ec5['model'],qs['fields'](_0x22c0d8[_0x004d('0x36')][_0x004d('0x3a')]));_0x522d84[_0x004d('0x39')]=_0x522d84[_0x004d('0x39')][_0x004d('0x3b')]?_0x522d84[_0x004d('0x39')]:_0x413ec5[_0x004d('0x35')];if(!_0x22c0d8[_0x004d('0x36')][_0x004d('0x3c')](_0x004d('0x3d'))){_0x522d84[_0x004d('0x1e')]=qs[_0x004d('0x1e')](_0x22c0d8['query'][_0x004d('0x1e')]);_0x522d84[_0x004d('0x1f')]=qs['offset'](_0x22c0d8[_0x004d('0x36')][_0x004d('0x1f')]);}_0x522d84[_0x004d('0x3e')]=qs[_0x004d('0x3f')](_0x22c0d8[_0x004d('0x36')][_0x004d('0x3f')]);_0x522d84[_0x004d('0x42')]=qs[_0x004d('0x40')](_[_0x004d('0x41')](_0x22c0d8['query'],_0x413ec5['filters']));_0x522d84[_0x004d('0x42')]['MailQueueId']=_0x1050f5['id'];if(_0x22c0d8[_0x004d('0x36')]['filter']){_0x522d84[_0x004d('0x42')]=_[_0x004d('0x44')](_0x522d84['where'],{'$or':_['map'](_0x522d84[_0x004d('0x39')],function(_0xf316ba){var _0x34cd57={};_0x34cd57[_0xf316ba]={'$like':'%'+_0x22c0d8[_0x004d('0x36')][_0x004d('0x43')]+'%'};return _0x34cd57;})});}_0x522d84=_['merge']({},_0x522d84,_0x22c0d8[_0x004d('0x45')]);return db['UserMailQueue'][_0x004d('0x48')](_0x522d84);}})[_0x004d('0x27')](function(_0x44158a){if(_0x44158a){return db[_0x004d('0x5b')]['findAndCountAll']({'where':{'id':_[_0x004d('0x2f')](_0x44158a,_0x004d('0x5c')),'role':'agent'},'attributes':['id',_0x004d('0x2c'),_0x004d('0x5d'),'updatedAt','createdAt']});}})['then'](function(_0x51e2ce){if(_0x51e2ce){return{'count':_0x51e2ce[_0x004d('0x20')],'rows':_[_0x004d('0x2f')](_0x51e2ce['rows'],function(_0x40e6ca){return{'membername':_0x40e6ca['name'],'UserId':_0x40e6ca['id'],'queue_name':_0x5475dd['name'],'MailQueueId':_0x5475dd['id'],'interface':util[_0x004d('0x5e')](_0x004d('0x5f'),_0x004d('0x60'),_0x40e6ca['name']),'penalty':0x0,'paused':_0x40e6ca[_0x004d('0x5d')],'createdAt':_0x40e6ca[_0x004d('0x61')],'updatedAt':_0x40e6ca['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x004d('0x27')](respondWithFilteredResult(_0x3d95c4,_0x522d84))[_0x004d('0x4a')](handleError(_0x3d95c4,null));};exports[_0x004d('0x62')]=function(_0x21ca51,_0x3a6b1c,_0x40df65){var _0xeedb92={};var _0x5ac755={};var _0x366815;var _0x40be6a;return db[_0x004d('0x30')][_0x004d('0x63')]({'where':{'id':_0x21ca51[_0x004d('0x4c')]['id']}})[_0x004d('0x27')](handleEntityNotFound(_0x3a6b1c,null))[_0x004d('0x27')](function(_0xa453fa){if(_0xa453fa){_0x366815=_0xa453fa;_0x5ac755[_0x004d('0x35')]=_[_0x004d('0x37')](db[_0x004d('0x64')][_0x004d('0x31')]);_0x5ac755['query']=_[_0x004d('0x37')](_0x21ca51[_0x004d('0x36')]);_0x5ac755[_0x004d('0x40')]=_[_0x004d('0x38')](_0x5ac755[_0x004d('0x35')],_0x5ac755[_0x004d('0x36')]);_0xeedb92['attributes']=_['intersection'](_0x5ac755[_0x004d('0x35')],qs[_0x004d('0x3a')](_0x21ca51[_0x004d('0x36')][_0x004d('0x3a')]));_0xeedb92[_0x004d('0x39')]=_0xeedb92[_0x004d('0x39')][_0x004d('0x3b')]?_0xeedb92[_0x004d('0x39')]:_0x5ac755['model'];_0xeedb92[_0x004d('0x3e')]=qs['sort'](_0x21ca51[_0x004d('0x36')]['sort']);_0xeedb92[_0x004d('0x42')]=qs[_0x004d('0x40')](_['pick'](_0x21ca51[_0x004d('0x36')],_0x5ac755['filters']));if(_0x21ca51[_0x004d('0x36')]['filter']){_0xeedb92[_0x004d('0x42')]=_[_0x004d('0x44')](_0xeedb92[_0x004d('0x42')],{'$or':_[_0x004d('0x2f')](_0xeedb92[_0x004d('0x39')],function(_0x5707c7){var _0x608746={};_0x608746[_0x5707c7]={'$like':'%'+_0x21ca51[_0x004d('0x36')]['filter']+'%'};return _0x608746;})});}_0xeedb92=_['merge']({},_0xeedb92,_0x21ca51['options']);return _0x366815[_0x004d('0x62')](_0xeedb92);}})[_0x004d('0x27')](function(_0x389b64){if(_0x389b64){_0x40be6a=_0x389b64[_0x004d('0x3b')];if(!_0x21ca51[_0x004d('0x36')]['hasOwnProperty'](_0x004d('0x3d'))){_0xeedb92[_0x004d('0x1e')]=qs[_0x004d('0x1e')](_0x21ca51[_0x004d('0x36')][_0x004d('0x1e')]);_0xeedb92[_0x004d('0x1f')]=qs[_0x004d('0x1f')](_0x21ca51[_0x004d('0x36')][_0x004d('0x1f')]);}return _0x366815['getTeams'](_0xeedb92);}})[_0x004d('0x27')](function(_0x1e0780){if(_0x1e0780){return _0x1e0780?{'count':_0x40be6a,'rows':_0x1e0780}:null;}})[_0x004d('0x27')](respondWithResult(_0x3a6b1c,null))[_0x004d('0x4a')](handleError(_0x3a6b1c,null));};exports[_0x004d('0x65')]=function(_0x5edc76,_0x366ae8,_0x54ae3b){var _0x3bcdc0=_0x5edc76[_0x004d('0x57')][_0x004d('0x66')];return db[_0x004d('0x64')][_0x004d('0x48')]({'where':{'id':_0x3bcdc0},'attributes':['id'],'include':[{'model':db[_0x004d('0x5b')],'as':_0x004d('0x67'),'attributes':['id',_0x004d('0x2c'),_0x004d('0x68'),_0x004d('0x69'),_0x004d('0x6a')],'raw':!![]}]})[_0x004d('0x27')](function(_0x29799e){if(_0x29799e){var _0x462755=_[_0x004d('0x6b')](_0x29799e,function(_0x28bc1e){var _0x538d64=_0x28bc1e[_0x004d('0x28')]({'plain':!![]});return _0x538d64[_0x004d('0x67')];});return db[_0x004d('0x30')][_0x004d('0x4d')]({'where':{'id':_0x5edc76['params']['id']}})[_0x004d('0x27')](function(_0x275dc2){return db[_0x004d('0x6c')]['transaction'](function(_0x5cf1e7){return _0x275dc2[_0x004d('0x65')](_0x3bcdc0,{'transaction':_0x5cf1e7})[_0x004d('0x27')](function(){return BPromise[_0x004d('0x6d')](_0x462755,function(_0x275c20){return db[_0x004d('0x5a')][_0x004d('0x6e')]({'where':{'UserId':_0x275c20['id'],'MailQueueId':_0x5edc76[_0x004d('0x4c')]['id']},'transaction':_0x5cf1e7});});})['then'](function(){_0x462755[_0x004d('0x6f')](function(_0x586955){socket[_0x004d('0x70')](_0x004d('0x71'),{'UserId':_0x586955['id'],'MailQueueId':_0x275dc2['id']});});});});});}})[_0x004d('0x27')](respondWithStatusCode(_0x366ae8,null))[_0x004d('0x4a')](handleError(_0x366ae8,null));};exports[_0x004d('0x72')]=function(_0x34217f,_0x3020dd,_0x2e52cb){return db[_0x004d('0x64')][_0x004d('0x48')]({'where':{'id':_0x34217f[_0x004d('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x004d('0x5b')],'as':_0x004d('0x67'),'attributes':['id'],'raw':!![]}]})[_0x004d('0x27')](handleEntityNotFound(_0x3020dd,null))[_0x004d('0x27')](function(_0x46b2e7){var _0x4a10b7=_['map'](_0x46b2e7,'id');var _0x410249=[];var _0x42eed0=[];var _0x5aee0e=squel[_0x004d('0x73')]();_0x5aee0e[_0x004d('0x74')](_0x004d('0x75'))[_0x004d('0x76')](_0x004d('0x77'),'tq')[_0x004d('0x78')](_0x004d('0x79'),'ut',_0x004d('0x7a'))[_0x004d('0x42')](_0x004d('0x7b'),_0x34217f[_0x004d('0x4c')]['id']);for(var _0x5a4f57=0x0;_0x5a4f57<_0x46b2e7[_0x004d('0x3b')];_0x5a4f57+=0x1){let _0x1626bf=_0x46b2e7[_0x5a4f57];for(var _0x171b3a=0x0;_0x171b3a<_0x1626bf[_0x004d('0x67')]['length'];_0x171b3a+=0x1){let _0xe7e9b8=_0x1626bf[_0x004d('0x67')][_0x171b3a];var _0x4200bf=_0x5aee0e[_0x004d('0x7c')]();_0x4200bf['where'](_0x004d('0x7d'),_0xe7e9b8['id']);_0x42eed0[_0x004d('0x7e')](db[_0x004d('0x6c')][_0x004d('0x36')](_0x4200bf[_0x004d('0x7f')](),{'type':db[_0x004d('0x6c')][_0x004d('0x80')]['SELECT']})[_0x004d('0x27')](function(_0x490557){if(_0x490557[_0x004d('0x3b')]===0x1){return _0xe7e9b8['id'];}else{var _0x29d1f1=_['every'](_[_0x004d('0x2f')](_0x490557,_0x004d('0x81')),function(_0x2a9972){return _[_0x004d('0x82')](_0x4a10b7,_0x2a9972);});if(_0x29d1f1){return _0xe7e9b8['id'];}}}));}}return BPromise[_0x004d('0x83')](_0x42eed0)['then'](function(_0x491859){_0x410249=_(_0x410249)['union'](_0x491859)[_0x004d('0x84')]()[_0x004d('0x85')]();return db[_0x004d('0x30')][_0x004d('0x4d')]({'where':{'id':_0x34217f[_0x004d('0x4c')]['id']}})['then'](function(_0x511598){return db[_0x004d('0x6c')]['transaction'](function(_0x33c81f){return _0x511598[_0x004d('0x72')](_0x34217f[_0x004d('0x36')]['ids'],{'transaction':_0x33c81f})[_0x004d('0x27')](function(){if(!_['isEmpty'](_0x410249)){return _0x511598[_0x004d('0x86')](_0x410249,{'transaction':_0x33c81f});}})[_0x004d('0x27')](function(){_0x410249[_0x004d('0x6f')](function(_0x34b811){socket[_0x004d('0x70')](_0x004d('0x87'),{'UserId':_0x34b811,'MailQueueId':_0x511598['id']});});});});});});})['then'](respondWithStatusCode(_0x3020dd,null))[_0x004d('0x4a')](handleError(_0x3020dd,null));};exports['addAgents']=function(_0x5b19af,_0x412179,_0x3672b3){return db[_0x004d('0x30')]['find']({'where':{'id':_0x5b19af[_0x004d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x412179,null))[_0x004d('0x27')](function(_0x3ae30b){if(_0x3ae30b){return _0x3ae30b[_0x004d('0x88')](_0x5b19af[_0x004d('0x57')][_0x004d('0x66')],_['omit'](_0x5b19af[_0x004d('0x57')],[_0x004d('0x66'),'id'])||{})['spread'](function(_0x40b1ef){for(var _0x49fd0e=0x0;_0x49fd0e<_0x5b19af[_0x004d('0x57')][_0x004d('0x66')][_0x004d('0x3b')];_0x49fd0e+=0x1){socket[_0x004d('0x70')](_0x004d('0x71'),{'UserId':Number(_0x5b19af[_0x004d('0x57')]['ids'][_0x49fd0e]),'MailQueueId':Number(_0x5b19af[_0x004d('0x4c')]['id'])});}return _0x40b1ef;});}})[_0x004d('0x27')](respondWithResult(_0x412179,null))[_0x004d('0x4a')](handleError(_0x412179,null));};exports['removeAgents']=function(_0x346ddf,_0x15c03d,_0x428628){return db['MailQueue'][_0x004d('0x4d')]({'where':{'id':_0x346ddf[_0x004d('0x4c')]['id']}})[_0x004d('0x27')](handleEntityNotFound(_0x15c03d,null))[_0x004d('0x27')](function(_0x5ec47d){if(_0x5ec47d){return _0x5ec47d[_0x004d('0x86')](_0x346ddf[_0x004d('0x36')][_0x004d('0x66')])[_0x004d('0x27')](function(){if(_[_0x004d('0x89')](_0x346ddf['query'][_0x004d('0x66')])){for(var _0x27aa9c=0x0;_0x27aa9c<_0x346ddf[_0x004d('0x36')][_0x004d('0x66')]['length'];_0x27aa9c+=0x1){socket['emit'](_0x004d('0x87'),{'UserId':Number(_0x346ddf[_0x004d('0x36')][_0x004d('0x66')][_0x27aa9c]),'MailQueueId':Number(_0x346ddf[_0x004d('0x4c')]['id'])});}}else{socket[_0x004d('0x70')](_0x004d('0x87'),{'UserId':Number(_0x346ddf['query']['ids']),'MailQueueId':Number(_0x346ddf[_0x004d('0x4c')]['id'])});}});}})[_0x004d('0x27')](respondWithStatusCode(_0x15c03d,null))['catch'](handleError(_0x15c03d,null));};exports['getAgents']=function(_0x5c827b,_0x2bc5a7,_0x472245){var _0x2bd617={};var _0x1dd1b7={};var _0x3986e3;var _0x4a40bd;return db['MailQueue'][_0x004d('0x63')]({'where':{'id':_0x5c827b['params']['id']}})['then'](handleEntityNotFound(_0x2bc5a7,null))[_0x004d('0x27')](function(_0x4b9cdb){if(_0x4b9cdb){_0x3986e3=_0x4b9cdb;_0x1dd1b7[_0x004d('0x35')]=_[_0x004d('0x37')](db[_0x004d('0x5b')]['rawAttributes']);_0x1dd1b7[_0x004d('0x36')]=_[_0x004d('0x37')](_0x5c827b[_0x004d('0x36')]);_0x1dd1b7[_0x004d('0x40')]=_[_0x004d('0x38')](_0x1dd1b7[_0x004d('0x35')],_0x1dd1b7[_0x004d('0x36')]);_0x2bd617[_0x004d('0x39')]=_[_0x004d('0x38')](_0x1dd1b7['model'],qs['fields'](_0x5c827b[_0x004d('0x36')][_0x004d('0x3a')]));_0x2bd617[_0x004d('0x39')]=_0x2bd617[_0x004d('0x39')][_0x004d('0x3b')]?_0x2bd617[_0x004d('0x39')]:_0x1dd1b7[_0x004d('0x35')];_0x2bd617[_0x004d('0x3e')]=qs[_0x004d('0x3f')](_0x5c827b[_0x004d('0x36')][_0x004d('0x3f')]);_0x2bd617['where']=qs[_0x004d('0x40')](_['pick'](_0x5c827b[_0x004d('0x36')],_0x1dd1b7[_0x004d('0x40')]));if(_0x5c827b[_0x004d('0x36')][_0x004d('0x43')]){_0x2bd617[_0x004d('0x42')]=_[_0x004d('0x44')](_0x2bd617[_0x004d('0x42')],{'$or':_[_0x004d('0x2f')](_0x2bd617[_0x004d('0x39')],function(_0xca82bb){var _0x490d70={};_0x490d70[_0xca82bb]={'$like':'%'+_0x5c827b['query'][_0x004d('0x43')]+'%'};return _0x490d70;})});}_0x2bd617=_[_0x004d('0x44')]({},_0x2bd617,_0x5c827b[_0x004d('0x45')]);return _0x3986e3[_0x004d('0x8a')](_0x2bd617);}})['then'](function(_0x1d9087){if(_0x1d9087){_0x4a40bd=_0x1d9087['length'];if(!_0x5c827b[_0x004d('0x36')][_0x004d('0x3c')](_0x004d('0x3d'))){_0x2bd617[_0x004d('0x1e')]=qs['limit'](_0x5c827b['query']['limit']);_0x2bd617[_0x004d('0x1f')]=qs[_0x004d('0x1f')](_0x5c827b[_0x004d('0x36')][_0x004d('0x1f')]);}return _0x3986e3[_0x004d('0x8a')](_0x2bd617);}})['then'](function(_0x1ff55e){if(_0x1ff55e){return _0x1ff55e?{'count':_0x4a40bd,'rows':_0x1ff55e}:null;}})[_0x004d('0x27')](respondWithResult(_0x2bc5a7,null))['catch'](handleError(_0x2bc5a7,null));}; \ No newline at end of file +var _0x7eb9=['get','UserProfileResource','sendStatus','error','stack','name','send','index','map','MailQueue','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','params','rawAttributes','includeAll','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','userProfileId','autoAssociation','describe','getMembers','MailQueueId','User','findAndCountAll','updatedAt','createdAt','rows','format','mailPause','getTeams','findOne','Team','Agents','online','voicePause','interface','sequelize','transaction','each','UserMailQueue','forEach','emit','userMailQueue:save','ids','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','QueryTypes','every','compact','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','json','undefined','count','offset','limit','Content-Range','apply','update','then','destroy'];(function(_0x1e9195,_0x50c32c){var _0x44a35d=function(_0xfccc63){while(--_0xfccc63){_0x1e9195['push'](_0x1e9195['shift']());}};_0x44a35d(++_0x50c32c);}(_0x7eb9,0xd9));var _0x97eb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7eb9[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x97eb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97eb('0x1'));var rp=require('request-promise');var moment=require(_0x97eb('0x2'));var BPromise=require(_0x97eb('0x3'));var Mustache=require(_0x97eb('0x4'));var util=require(_0x97eb('0x5'));var path=require('path');var sox=require(_0x97eb('0x6'));var csv=require('to-csv');var ejs=require(_0x97eb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97eb('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x97eb('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x97eb('0xa'));var querystring=require(_0x97eb('0xb'));var Papa=require(_0x97eb('0xc'));var Redis=require(_0x97eb('0xd'));var authService=require(_0x97eb('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97eb('0xf'));var logger=require(_0x97eb('0x10'))(_0x97eb('0x11'));var utils=require(_0x97eb('0x12'));var config=require(_0x97eb('0x13'));var licenseUtil=require(_0x97eb('0x14'));var db=require(_0x97eb('0x15'))['db'];config[_0x97eb('0x16')]=_[_0x97eb('0x17')](config[_0x97eb('0x16')],{'host':_0x97eb('0x18'),'port':0x18eb});var socket=require(_0x97eb('0x19'))(new Redis(config[_0x97eb('0x16')]));require(_0x97eb('0x1a'))['register'](socket);function respondWithStatusCode(_0x226a95,_0x34e499){_0x34e499=_0x34e499||0xcc;return function(_0x44afb6){if(_0x44afb6){return _0x226a95['sendStatus'](_0x34e499);}return _0x226a95[_0x97eb('0x1b')](_0x34e499)[_0x97eb('0x1c')]();};}function respondWithResult(_0x823d10,_0x4b8962){_0x4b8962=_0x4b8962||0xc8;return function(_0x551749){if(_0x551749){return _0x823d10[_0x97eb('0x1b')](_0x4b8962)[_0x97eb('0x1d')](_0x551749);}};}function respondWithFilteredResult(_0x4764c1,_0x15b567){return function(_0x1f89bd){if(_0x1f89bd){var _0xd36a5d=typeof _0x15b567['offset']===_0x97eb('0x1e')&&typeof _0x15b567['limit']===_0x97eb('0x1e');var _0x5349d3=_0x1f89bd[_0x97eb('0x1f')];var _0x19f9c8=_0xd36a5d?0x0:_0x15b567[_0x97eb('0x20')];var _0x375bd2=_0xd36a5d?_0x1f89bd['count']:_0x15b567[_0x97eb('0x20')]+_0x15b567[_0x97eb('0x21')];var _0x16384d;if(_0x375bd2>=_0x5349d3){_0x375bd2=_0x5349d3;_0x16384d=0xc8;}else{_0x16384d=0xce;}_0x4764c1[_0x97eb('0x1b')](_0x16384d);return _0x4764c1['set'](_0x97eb('0x22'),_0x19f9c8+'-'+_0x375bd2+'/'+_0x5349d3)['json'](_0x1f89bd);}return null;};}function patchUpdates(_0x6c6277){return function(_0x5960c1){try{jsonpatch[_0x97eb('0x23')](_0x5960c1,_0x6c6277,!![]);}catch(_0x47bae8){return BPromise['reject'](_0x47bae8);}return _0x5960c1['save']();};}function saveUpdates(_0x978b54,_0x508f3f){return function(_0x2ec828){if(_0x2ec828){return _0x2ec828[_0x97eb('0x24')](_0x978b54)[_0x97eb('0x25')](function(_0x19822a){return _0x19822a;});}return null;};}function removeEntity(_0x3f35b4,_0x174992){return function(_0x1461c0){if(_0x1461c0){return _0x1461c0[_0x97eb('0x26')]()[_0x97eb('0x25')](function(){var _0x58f4ff=_0x1461c0[_0x97eb('0x27')]({'plain':!![]});var _0x59aab8='MailQueues';return db[_0x97eb('0x28')][_0x97eb('0x26')]({'where':{'type':_0x59aab8,'resourceId':_0x58f4ff['id']}})[_0x97eb('0x25')](function(){return _0x1461c0;});})[_0x97eb('0x25')](function(){_0x3f35b4['status'](0xcc)[_0x97eb('0x1c')]();});}};}function handleEntityNotFound(_0x18f23e,_0x480e3a){return function(_0x4d8d61){if(!_0x4d8d61){_0x18f23e[_0x97eb('0x29')](0x194);}return _0x4d8d61;};}function handleError(_0x5baeb2,_0x41ca0d){_0x41ca0d=_0x41ca0d||0x1f4;return function(_0x451859){logger[_0x97eb('0x2a')](_0x451859[_0x97eb('0x2b')]);if(_0x451859[_0x97eb('0x2c')]){delete _0x451859['name'];}_0x5baeb2[_0x97eb('0x1b')](_0x41ca0d)[_0x97eb('0x2d')](_0x451859);};}exports[_0x97eb('0x2e')]=function(_0x56e8f7,_0x24c27e){var _0x1705a7={},_0x569fc4={},_0x58756c={'count':0x0,'rows':[]};var _0x5ae7b3=_[_0x97eb('0x2f')](db[_0x97eb('0x30')]['rawAttributes'],function(_0x1e742c){return{'name':_0x1e742c['fieldName'],'type':_0x1e742c['type'][_0x97eb('0x31')]};});_0x569fc4[_0x97eb('0x32')]=_[_0x97eb('0x2f')](_0x5ae7b3,'name');_0x569fc4[_0x97eb('0x33')]=_[_0x97eb('0x34')](_0x56e8f7[_0x97eb('0x33')]);_0x569fc4[_0x97eb('0x35')]=_['intersection'](_0x569fc4[_0x97eb('0x32')],_0x569fc4[_0x97eb('0x33')]);_0x1705a7[_0x97eb('0x36')]=_[_0x97eb('0x37')](_0x569fc4[_0x97eb('0x32')],qs['fields'](_0x56e8f7[_0x97eb('0x33')][_0x97eb('0x38')]));_0x1705a7[_0x97eb('0x36')]=_0x1705a7[_0x97eb('0x36')][_0x97eb('0x39')]?_0x1705a7['attributes']:_0x569fc4[_0x97eb('0x32')];if(!_0x56e8f7[_0x97eb('0x33')][_0x97eb('0x3a')](_0x97eb('0x3b'))){_0x1705a7['limit']=qs['limit'](_0x56e8f7[_0x97eb('0x33')][_0x97eb('0x21')]);_0x1705a7['offset']=qs[_0x97eb('0x20')](_0x56e8f7[_0x97eb('0x33')][_0x97eb('0x20')]);}_0x1705a7[_0x97eb('0x3c')]=qs[_0x97eb('0x3d')](_0x56e8f7[_0x97eb('0x33')][_0x97eb('0x3d')]);_0x1705a7[_0x97eb('0x3e')]=qs[_0x97eb('0x35')](_[_0x97eb('0x3f')](_0x56e8f7['query'],_0x569fc4['filters']),_0x5ae7b3);if(_0x56e8f7[_0x97eb('0x33')][_0x97eb('0x40')]){_0x1705a7[_0x97eb('0x3e')]=_['merge'](_0x1705a7[_0x97eb('0x3e')],{'$or':_[_0x97eb('0x2f')](_0x5ae7b3,function(_0x56add0){if(_0x56add0[_0x97eb('0x41')]!==_0x97eb('0x42')){var _0x8205ed={};_0x8205ed[_0x56add0[_0x97eb('0x2c')]]={'$like':'%'+_0x56e8f7[_0x97eb('0x33')][_0x97eb('0x40')]+'%'};return _0x8205ed;}})});}_0x1705a7=_[_0x97eb('0x43')]({},_0x1705a7,_0x56e8f7[_0x97eb('0x44')]);var _0x4002f3={'where':_0x1705a7[_0x97eb('0x3e')]};return db['MailQueue'][_0x97eb('0x1f')](_0x4002f3)[_0x97eb('0x25')](function(_0x157273){_0x58756c[_0x97eb('0x1f')]=_0x157273;if(_0x56e8f7['query']['includeAll']){_0x1705a7[_0x97eb('0x45')]=[{'all':!![]}];}return db[_0x97eb('0x30')][_0x97eb('0x46')](_0x1705a7);})[_0x97eb('0x25')](function(_0xd42d97){_0x58756c['rows']=_0xd42d97;return _0x58756c;})[_0x97eb('0x25')](respondWithFilteredResult(_0x24c27e,_0x1705a7))['catch'](handleError(_0x24c27e,null));};exports['show']=function(_0xd80dc,_0xf27a20){var _0x1b466f={'raw':!![],'where':{'id':_0xd80dc[_0x97eb('0x47')]['id']}},_0x9cc16a={};_0x9cc16a[_0x97eb('0x32')]=_[_0x97eb('0x34')](db[_0x97eb('0x30')][_0x97eb('0x48')]);_0x9cc16a[_0x97eb('0x33')]=_['keys'](_0xd80dc[_0x97eb('0x33')]);_0x9cc16a[_0x97eb('0x35')]=_[_0x97eb('0x37')](_0x9cc16a[_0x97eb('0x32')],_0x9cc16a['query']);_0x1b466f[_0x97eb('0x36')]=_['intersection'](_0x9cc16a[_0x97eb('0x32')],qs['fields'](_0xd80dc[_0x97eb('0x33')]['fields']));_0x1b466f[_0x97eb('0x36')]=_0x1b466f['attributes'][_0x97eb('0x39')]?_0x1b466f[_0x97eb('0x36')]:_0x9cc16a[_0x97eb('0x32')];if(_0xd80dc[_0x97eb('0x33')][_0x97eb('0x49')]){_0x1b466f['include']=[{'all':!![]}];}_0x1b466f=_['merge']({},_0x1b466f,_0xd80dc[_0x97eb('0x44')]);return db['MailQueue'][_0x97eb('0x4a')](_0x1b466f)[_0x97eb('0x25')](handleEntityNotFound(_0xf27a20,null))[_0x97eb('0x25')](respondWithResult(_0xf27a20,null))[_0x97eb('0x4b')](handleError(_0xf27a20,null));};exports['create']=function(_0x5204ac,_0x315037){return db[_0x97eb('0x30')]['create'](_0x5204ac[_0x97eb('0x4c')],{})[_0x97eb('0x25')](function(_0x479e2a){var _0x45aef=_0x5204ac[_0x97eb('0x4d')][_0x97eb('0x27')]({'plain':!![]});if(!_0x45aef)throw new Error(_0x97eb('0x4e'));if(_0x45aef[_0x97eb('0x4f')]==='user'){var _0xa3bc8e=_0x479e2a[_0x97eb('0x27')]({'plain':!![]});var _0x227534=_0x97eb('0x50');return db['UserProfileSection'][_0x97eb('0x4a')]({'where':{'name':_0x227534,'userProfileId':_0x45aef[_0x97eb('0x51')]},'raw':!![]})[_0x97eb('0x25')](function(_0x1b17b2){if(_0x1b17b2&&_0x1b17b2[_0x97eb('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0xa3bc8e[_0x97eb('0x2c')],'resourceId':_0xa3bc8e['id'],'type':_0x1b17b2[_0x97eb('0x2c')],'sectionId':_0x1b17b2['id']},{})['then'](function(){return _0x479e2a;});}else{return _0x479e2a;}})[_0x97eb('0x4b')](function(_0x1be5c8){logger[_0x97eb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1be5c8);throw _0x1be5c8;});}return _0x479e2a;})[_0x97eb('0x25')](respondWithResult(_0x315037,0xc9))[_0x97eb('0x4b')](handleError(_0x315037,null));};exports['update']=function(_0x2f5b7f,_0x3556cd){if(_0x2f5b7f[_0x97eb('0x4c')]['id']){delete _0x2f5b7f[_0x97eb('0x4c')]['id'];}return db[_0x97eb('0x30')][_0x97eb('0x4a')]({'where':{'id':_0x2f5b7f[_0x97eb('0x47')]['id']}})[_0x97eb('0x25')](handleEntityNotFound(_0x3556cd,null))[_0x97eb('0x25')](saveUpdates(_0x2f5b7f['body'],null))[_0x97eb('0x25')](respondWithResult(_0x3556cd,null))['catch'](handleError(_0x3556cd,null));};exports[_0x97eb('0x26')]=function(_0x34eaa7,_0x58b262){return db[_0x97eb('0x30')][_0x97eb('0x4a')]({'where':{'id':_0x34eaa7[_0x97eb('0x47')]['id']}})[_0x97eb('0x25')](handleEntityNotFound(_0x58b262,null))[_0x97eb('0x25')](removeEntity(_0x58b262,null))[_0x97eb('0x4b')](handleError(_0x58b262,null));};exports['describe']=function(_0x53369a,_0x31a247){return db[_0x97eb('0x30')][_0x97eb('0x53')]()[_0x97eb('0x25')](respondWithResult(_0x31a247,null))['catch'](handleError(_0x31a247,null));};exports[_0x97eb('0x54')]=function(_0x2186d6,_0x276514,_0x303b08){var _0x4323f6={'raw':!![],'where':{}},_0x3f0ed0={},_0x1d867c;return db[_0x97eb('0x30')]['findOne']({'where':{'id':_0x2186d6[_0x97eb('0x47')]['id']}})['then'](handleEntityNotFound(_0x276514,null))[_0x97eb('0x25')](function(_0xb5a889){if(_0xb5a889){_0x1d867c=_0xb5a889[_0x97eb('0x27')]({'plain':!![]});_0x3f0ed0[_0x97eb('0x32')]=_['keys'](db['UserMailQueue'][_0x97eb('0x48')]);_0x3f0ed0['query']=_[_0x97eb('0x34')](_0x2186d6[_0x97eb('0x33')]);_0x3f0ed0[_0x97eb('0x35')]=_['intersection'](_0x3f0ed0[_0x97eb('0x32')],_0x3f0ed0[_0x97eb('0x33')]);_0x4323f6['attributes']=_['intersection'](_0x3f0ed0[_0x97eb('0x32')],qs[_0x97eb('0x38')](_0x2186d6['query'][_0x97eb('0x38')]));_0x4323f6[_0x97eb('0x36')]=_0x4323f6[_0x97eb('0x36')]['length']?_0x4323f6[_0x97eb('0x36')]:_0x3f0ed0[_0x97eb('0x32')];if(!_0x2186d6[_0x97eb('0x33')][_0x97eb('0x3a')](_0x97eb('0x3b'))){_0x4323f6[_0x97eb('0x21')]=qs[_0x97eb('0x21')](_0x2186d6[_0x97eb('0x33')][_0x97eb('0x21')]);_0x4323f6[_0x97eb('0x20')]=qs[_0x97eb('0x20')](_0x2186d6[_0x97eb('0x33')][_0x97eb('0x20')]);}_0x4323f6[_0x97eb('0x3c')]=qs[_0x97eb('0x3d')](_0x2186d6[_0x97eb('0x33')][_0x97eb('0x3d')]);_0x4323f6['where']=qs[_0x97eb('0x35')](_[_0x97eb('0x3f')](_0x2186d6['query'],_0x3f0ed0[_0x97eb('0x35')]));_0x4323f6[_0x97eb('0x3e')][_0x97eb('0x55')]=_0xb5a889['id'];if(_0x2186d6[_0x97eb('0x33')][_0x97eb('0x40')]){_0x4323f6['where']=_[_0x97eb('0x43')](_0x4323f6['where'],{'$or':_[_0x97eb('0x2f')](_0x4323f6[_0x97eb('0x36')],function(_0x5346d2){var _0x52007e={};_0x52007e[_0x5346d2]={'$like':'%'+_0x2186d6[_0x97eb('0x33')][_0x97eb('0x40')]+'%'};return _0x52007e;})});}_0x4323f6=_['merge']({},_0x4323f6,_0x2186d6[_0x97eb('0x44')]);return db['UserMailQueue']['findAll'](_0x4323f6);}})['then'](function(_0x2575ee){if(_0x2575ee){return db[_0x97eb('0x56')][_0x97eb('0x57')]({'where':{'id':_[_0x97eb('0x2f')](_0x2575ee,'UserId'),'role':'agent'},'attributes':['id',_0x97eb('0x2c'),'mailPause',_0x97eb('0x58'),_0x97eb('0x59')]});}})['then'](function(_0x35c72a){if(_0x35c72a){return{'count':_0x35c72a[_0x97eb('0x1f')],'rows':_[_0x97eb('0x2f')](_0x35c72a[_0x97eb('0x5a')],function(_0x5d79a4){return{'membername':_0x5d79a4[_0x97eb('0x2c')],'UserId':_0x5d79a4['id'],'queue_name':_0x1d867c[_0x97eb('0x2c')],'MailQueueId':_0x1d867c['id'],'interface':util[_0x97eb('0x5b')]('%s/%s','SIP',_0x5d79a4['name']),'penalty':0x0,'paused':_0x5d79a4[_0x97eb('0x5c')],'createdAt':_0x5d79a4[_0x97eb('0x59')],'updatedAt':_0x5d79a4[_0x97eb('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x97eb('0x25')](respondWithFilteredResult(_0x276514,_0x4323f6))[_0x97eb('0x4b')](handleError(_0x276514,null));};exports[_0x97eb('0x5d')]=function(_0x5803f6,_0x27aa9f,_0x3dcd34){var _0x129be3={};var _0x5d8e6c={};var _0x55fda9;var _0x4cd79a;return db['MailQueue'][_0x97eb('0x5e')]({'where':{'id':_0x5803f6[_0x97eb('0x47')]['id']}})[_0x97eb('0x25')](handleEntityNotFound(_0x27aa9f,null))[_0x97eb('0x25')](function(_0x433ede){if(_0x433ede){_0x55fda9=_0x433ede;_0x5d8e6c[_0x97eb('0x32')]=_['keys'](db[_0x97eb('0x5f')][_0x97eb('0x48')]);_0x5d8e6c[_0x97eb('0x33')]=_[_0x97eb('0x34')](_0x5803f6['query']);_0x5d8e6c['filters']=_[_0x97eb('0x37')](_0x5d8e6c[_0x97eb('0x32')],_0x5d8e6c[_0x97eb('0x33')]);_0x129be3[_0x97eb('0x36')]=_['intersection'](_0x5d8e6c['model'],qs['fields'](_0x5803f6[_0x97eb('0x33')][_0x97eb('0x38')]));_0x129be3[_0x97eb('0x36')]=_0x129be3[_0x97eb('0x36')]['length']?_0x129be3[_0x97eb('0x36')]:_0x5d8e6c[_0x97eb('0x32')];_0x129be3[_0x97eb('0x3c')]=qs['sort'](_0x5803f6[_0x97eb('0x33')][_0x97eb('0x3d')]);_0x129be3[_0x97eb('0x3e')]=qs[_0x97eb('0x35')](_[_0x97eb('0x3f')](_0x5803f6[_0x97eb('0x33')],_0x5d8e6c[_0x97eb('0x35')]));if(_0x5803f6[_0x97eb('0x33')][_0x97eb('0x40')]){_0x129be3['where']=_['merge'](_0x129be3[_0x97eb('0x3e')],{'$or':_[_0x97eb('0x2f')](_0x129be3[_0x97eb('0x36')],function(_0x3a8910){var _0x386d40={};_0x386d40[_0x3a8910]={'$like':'%'+_0x5803f6['query'][_0x97eb('0x40')]+'%'};return _0x386d40;})});}_0x129be3=_[_0x97eb('0x43')]({},_0x129be3,_0x5803f6['options']);return _0x55fda9[_0x97eb('0x5d')](_0x129be3);}})[_0x97eb('0x25')](function(_0x158ce7){if(_0x158ce7){_0x4cd79a=_0x158ce7[_0x97eb('0x39')];if(!_0x5803f6['query'][_0x97eb('0x3a')]('nolimit')){_0x129be3['limit']=qs[_0x97eb('0x21')](_0x5803f6['query']['limit']);_0x129be3[_0x97eb('0x20')]=qs[_0x97eb('0x20')](_0x5803f6[_0x97eb('0x33')][_0x97eb('0x20')]);}return _0x55fda9['getTeams'](_0x129be3);}})[_0x97eb('0x25')](function(_0x1e4312){if(_0x1e4312){return _0x1e4312?{'count':_0x4cd79a,'rows':_0x1e4312}:null;}})['then'](respondWithResult(_0x27aa9f,null))['catch'](handleError(_0x27aa9f,null));};exports['addTeams']=function(_0x186454,_0x58b180,_0xfcc96b){var _0x1d1de9=_0x186454['body']['ids'];return db[_0x97eb('0x5f')][_0x97eb('0x46')]({'where':{'id':_0x1d1de9},'attributes':['id'],'include':[{'model':db[_0x97eb('0x56')],'as':_0x97eb('0x60'),'attributes':['id',_0x97eb('0x2c'),_0x97eb('0x61'),_0x97eb('0x62'),_0x97eb('0x63')],'raw':!![]}]})[_0x97eb('0x25')](function(_0x529e5c){if(_0x529e5c){var _0x4bbe56=_['flatMap'](_0x529e5c,function(_0x2553d9){var _0x4d50a2=_0x2553d9['get']({'plain':!![]});return _0x4d50a2[_0x97eb('0x60')];});return db[_0x97eb('0x30')]['find']({'where':{'id':_0x186454[_0x97eb('0x47')]['id']}})['then'](function(_0x15ae35){return db[_0x97eb('0x64')][_0x97eb('0x65')](function(_0x932523){return _0x15ae35['addTeams'](_0x1d1de9,{'transaction':_0x932523})[_0x97eb('0x25')](function(){return BPromise[_0x97eb('0x66')](_0x4bbe56,function(_0x126e4f){return db[_0x97eb('0x67')]['findOrCreate']({'where':{'UserId':_0x126e4f['id'],'MailQueueId':_0x186454['params']['id']},'transaction':_0x932523});});})[_0x97eb('0x25')](function(){_0x4bbe56[_0x97eb('0x68')](function(_0x2317c5){socket[_0x97eb('0x69')](_0x97eb('0x6a'),{'UserId':_0x2317c5['id'],'MailQueueId':_0x15ae35['id']});});});});});}})[_0x97eb('0x25')](respondWithStatusCode(_0x58b180,null))['catch'](handleError(_0x58b180,null));};exports['removeTeams']=function(_0x177e0d,_0xe00c8f,_0x479889){return db['Team']['findAll']({'where':{'id':_0x177e0d[_0x97eb('0x33')][_0x97eb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x97eb('0x56')],'as':_0x97eb('0x60'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xe00c8f,null))['then'](function(_0x5bcdec){var _0x4a0053=_['map'](_0x5bcdec,'id');var _0xb9477d=[];var _0x642141=[];var _0x436f96=squel[_0x97eb('0x6c')]();_0x436f96['field'](_0x97eb('0x6d'))[_0x97eb('0x6e')]('team_has_mail_queues','tq')['join'](_0x97eb('0x6f'),'ut',_0x97eb('0x70'))[_0x97eb('0x3e')](_0x97eb('0x71'),_0x177e0d[_0x97eb('0x47')]['id']);for(var _0x3fe275=0x0;_0x3fe275<_0x5bcdec[_0x97eb('0x39')];_0x3fe275+=0x1){let _0x313c3d=_0x5bcdec[_0x3fe275];for(var _0x1186db=0x0;_0x1186db<_0x313c3d['Agents'][_0x97eb('0x39')];_0x1186db+=0x1){let _0x49b652=_0x313c3d[_0x97eb('0x60')][_0x1186db];var _0x178cd8=_0x436f96[_0x97eb('0x72')]();_0x178cd8[_0x97eb('0x3e')]('ut.UserId\x20=\x20?',_0x49b652['id']);_0x642141[_0x97eb('0x73')](db[_0x97eb('0x64')]['query'](_0x178cd8['toString'](),{'type':db[_0x97eb('0x64')][_0x97eb('0x74')]['SELECT']})[_0x97eb('0x25')](function(_0x17be77){if(_0x17be77[_0x97eb('0x39')]===0x1){return _0x49b652['id'];}else{var _0x3d9223=_[_0x97eb('0x75')](_[_0x97eb('0x2f')](_0x17be77,'TeamId'),function(_0xe9258d){return _['includes'](_0x4a0053,_0xe9258d);});if(_0x3d9223){return _0x49b652['id'];}}}));}}return BPromise['all'](_0x642141)[_0x97eb('0x25')](function(_0x2f4b6a){_0xb9477d=_(_0xb9477d)['union'](_0x2f4b6a)[_0x97eb('0x76')]()['value']();return db[_0x97eb('0x30')]['find']({'where':{'id':_0x177e0d[_0x97eb('0x47')]['id']}})[_0x97eb('0x25')](function(_0x24ab1a){return db[_0x97eb('0x64')][_0x97eb('0x65')](function(_0x569307){return _0x24ab1a[_0x97eb('0x77')](_0x177e0d['query'][_0x97eb('0x6b')],{'transaction':_0x569307})[_0x97eb('0x25')](function(){if(!_[_0x97eb('0x78')](_0xb9477d)){return _0x24ab1a[_0x97eb('0x79')](_0xb9477d,{'transaction':_0x569307});}})['then'](function(){_0xb9477d['forEach'](function(_0x585f88){socket[_0x97eb('0x69')](_0x97eb('0x7a'),{'UserId':_0x585f88,'MailQueueId':_0x24ab1a['id']});});});});});});})[_0x97eb('0x25')](respondWithStatusCode(_0xe00c8f,null))[_0x97eb('0x4b')](handleError(_0xe00c8f,null));};exports['addAgents']=function(_0x3a03a4,_0x319515,_0x252476){return db[_0x97eb('0x30')]['find']({'where':{'id':_0x3a03a4[_0x97eb('0x47')]['id']}})['then'](handleEntityNotFound(_0x319515,null))[_0x97eb('0x25')](function(_0x2731ed){if(_0x2731ed){return _0x2731ed[_0x97eb('0x7b')](_0x3a03a4[_0x97eb('0x4c')][_0x97eb('0x6b')],_[_0x97eb('0x7c')](_0x3a03a4['body'],[_0x97eb('0x6b'),'id'])||{})[_0x97eb('0x7d')](function(_0x112a39){for(var _0x35960a=0x0;_0x35960a<_0x3a03a4[_0x97eb('0x4c')][_0x97eb('0x6b')][_0x97eb('0x39')];_0x35960a+=0x1){socket[_0x97eb('0x69')](_0x97eb('0x6a'),{'UserId':Number(_0x3a03a4[_0x97eb('0x4c')][_0x97eb('0x6b')][_0x35960a]),'MailQueueId':Number(_0x3a03a4['params']['id'])});}return _0x112a39;});}})[_0x97eb('0x25')](respondWithResult(_0x319515,null))[_0x97eb('0x4b')](handleError(_0x319515,null));};exports['removeAgents']=function(_0x25443c,_0x2ce275,_0x2b2bc7){return db[_0x97eb('0x30')][_0x97eb('0x4a')]({'where':{'id':_0x25443c[_0x97eb('0x47')]['id']}})[_0x97eb('0x25')](handleEntityNotFound(_0x2ce275,null))['then'](function(_0x125910){if(_0x125910){return _0x125910['removeAgents'](_0x25443c['query'][_0x97eb('0x6b')])[_0x97eb('0x25')](function(){if(_[_0x97eb('0x7e')](_0x25443c[_0x97eb('0x33')][_0x97eb('0x6b')])){for(var _0x233bba=0x0;_0x233bba<_0x25443c[_0x97eb('0x33')][_0x97eb('0x6b')][_0x97eb('0x39')];_0x233bba+=0x1){socket[_0x97eb('0x69')](_0x97eb('0x7a'),{'UserId':Number(_0x25443c[_0x97eb('0x33')][_0x97eb('0x6b')][_0x233bba]),'MailQueueId':Number(_0x25443c[_0x97eb('0x47')]['id'])});}}else{socket['emit'](_0x97eb('0x7a'),{'UserId':Number(_0x25443c['query'][_0x97eb('0x6b')]),'MailQueueId':Number(_0x25443c[_0x97eb('0x47')]['id'])});}});}})[_0x97eb('0x25')](respondWithStatusCode(_0x2ce275,null))[_0x97eb('0x4b')](handleError(_0x2ce275,null));};exports[_0x97eb('0x7f')]=function(_0x317be5,_0x4cd241,_0x2392f2){var _0x430a27={};var _0x33f3fd={};var _0x3dac0e;var _0x54758a;return db[_0x97eb('0x30')][_0x97eb('0x5e')]({'where':{'id':_0x317be5[_0x97eb('0x47')]['id']}})[_0x97eb('0x25')](handleEntityNotFound(_0x4cd241,null))['then'](function(_0x4d5764){if(_0x4d5764){_0x3dac0e=_0x4d5764;_0x33f3fd['model']=_['keys'](db[_0x97eb('0x56')][_0x97eb('0x48')]);_0x33f3fd[_0x97eb('0x33')]=_[_0x97eb('0x34')](_0x317be5[_0x97eb('0x33')]);_0x33f3fd['filters']=_['intersection'](_0x33f3fd[_0x97eb('0x32')],_0x33f3fd[_0x97eb('0x33')]);_0x430a27[_0x97eb('0x36')]=_['intersection'](_0x33f3fd['model'],qs['fields'](_0x317be5[_0x97eb('0x33')]['fields']));_0x430a27[_0x97eb('0x36')]=_0x430a27['attributes'][_0x97eb('0x39')]?_0x430a27[_0x97eb('0x36')]:_0x33f3fd[_0x97eb('0x32')];_0x430a27[_0x97eb('0x3c')]=qs[_0x97eb('0x3d')](_0x317be5[_0x97eb('0x33')][_0x97eb('0x3d')]);_0x430a27[_0x97eb('0x3e')]=qs['filters'](_[_0x97eb('0x3f')](_0x317be5[_0x97eb('0x33')],_0x33f3fd['filters']));if(_0x317be5['query']['filter']){_0x430a27[_0x97eb('0x3e')]=_[_0x97eb('0x43')](_0x430a27[_0x97eb('0x3e')],{'$or':_['map'](_0x430a27[_0x97eb('0x36')],function(_0x51b674){var _0x1e92c2={};_0x1e92c2[_0x51b674]={'$like':'%'+_0x317be5[_0x97eb('0x33')]['filter']+'%'};return _0x1e92c2;})});}_0x430a27=_['merge']({},_0x430a27,_0x317be5[_0x97eb('0x44')]);return _0x3dac0e[_0x97eb('0x7f')](_0x430a27);}})[_0x97eb('0x25')](function(_0x5b5a7e){if(_0x5b5a7e){_0x54758a=_0x5b5a7e[_0x97eb('0x39')];if(!_0x317be5['query'][_0x97eb('0x3a')](_0x97eb('0x3b'))){_0x430a27['limit']=qs[_0x97eb('0x21')](_0x317be5[_0x97eb('0x33')]['limit']);_0x430a27[_0x97eb('0x20')]=qs[_0x97eb('0x20')](_0x317be5[_0x97eb('0x33')][_0x97eb('0x20')]);}return _0x3dac0e[_0x97eb('0x7f')](_0x430a27);}})[_0x97eb('0x25')](function(_0xd1d13b){if(_0xd1d13b){return _0xd1d13b?{'count':_0x54758a,'rows':_0xd1d13b}:null;}})['then'](respondWithResult(_0x4cd241,null))[_0x97eb('0x4b')](handleError(_0x4cd241,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f642c8d..e54e160 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 _0x290c=['hook','exports','events','../../mysqldb','MailQueue','save','remove','hasOwnProperty'];(function(_0x21bcae,_0x1edf54){var _0x1834da=function(_0x8a13ea){while(--_0x8a13ea){_0x21bcae['push'](_0x21bcae['shift']());}};_0x1834da(++_0x1edf54);}(_0x290c,0x15a));var _0xc290=function(_0x952c27,_0x370180){_0x952c27=_0x952c27-0x0;var _0x2a50d2=_0x290c[_0x952c27];return _0x2a50d2;};'use strict';var EventEmitter=require(_0xc290('0x0'));var MailQueue=require(_0xc290('0x1'))['db'][_0xc290('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc290('0x3'),'afterUpdate':'update','afterDestroy':_0xc290('0x4')};function emitEvent(_0x3356b5){return function(_0x358f28,_0x1daae5,_0x37da40){MailQueueEvents['emit'](_0x3356b5+':'+_0x358f28['id'],_0x358f28);MailQueueEvents['emit'](_0x3356b5,_0x358f28);_0x37da40(null);};}for(var e in events){if(events[_0xc290('0x5')](e)){var event=events[e];MailQueue[_0xc290('0x6')](e,emitEvent(event));}}module[_0xc290('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x9dbc=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x9dbc,0xf8));var _0xc9db=function(_0x326427,_0x2c0f30){_0x326427=_0x326427-0x0;var _0x343782=_0x9dbc[_0x326427];return _0x343782;};'use strict';var EventEmitter=require(_0xc9db('0x0'));var MailQueue=require(_0xc9db('0x1'))['db'][_0xc9db('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc9db('0x3')](0x0);var events={'afterCreate':_0xc9db('0x4'),'afterUpdate':_0xc9db('0x5'),'afterDestroy':_0xc9db('0x6')};function emitEvent(_0x1c8ca9){return function(_0x36d1f3,_0xafa1b5,_0x1beca2){MailQueueEvents[_0xc9db('0x7')](_0x1c8ca9+':'+_0x36d1f3['id'],_0x36d1f3);MailQueueEvents['emit'](_0x1c8ca9,_0x36d1f3);_0x1beca2(null);};}for(var e in events){if(events[_0xc9db('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xc9db('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 163191b..b24f2a7 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 _0x1158=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x1158,0x12b));var _0x8115=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1158[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x8115('0x0'));var util=require(_0x8115('0x1'));var logger=require(_0x8115('0x2'))(_0x8115('0x3'));var moment=require('moment');var BPromise=require(_0x8115('0x4'));var rp=require(_0x8115('0x5'));var fs=require('fs');var path=require(_0x8115('0x6'));var rimraf=require(_0x8115('0x7'));var config=require(_0x8115('0x8'));var attributes=require(_0x8115('0x9'));module['exports']=function(_0x23df4a,_0x26cd96){return _0x23df4a[_0x8115('0xa')](_0x8115('0xb'),attributes,{'tableName':_0x8115('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c7a=['rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x3c7a,0x1e6));var _0xa3c7=function(_0x415e5e,_0x17c8f5){_0x415e5e=_0x415e5e-0x0;var _0x48f4de=_0x3c7a[_0x415e5e];return _0x48f4de;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa3c7('0x0'))(_0xa3c7('0x1'));var moment=require(_0xa3c7('0x2'));var BPromise=require(_0xa3c7('0x3'));var rp=require(_0xa3c7('0x4'));var fs=require('fs');var path=require(_0xa3c7('0x5'));var rimraf=require(_0xa3c7('0x6'));var config=require(_0xa3c7('0x7'));var attributes=require(_0xa3c7('0x8'));module[_0xa3c7('0x9')]=function(_0x74350e,_0x146450){return _0x74350e['define'](_0xa3c7('0xa'),attributes,{'tableName':_0xa3c7('0xb'),'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 c197128..3d7f8bf 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 _0x8ba3=['include','model','map','debug','ShowMailQueue','MailQueue','where','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','findAll','options','raw','attributes','limit'];(function(_0x12de9a,_0x225709){var _0x4e8ff8=function(_0x560d39){while(--_0x560d39){_0x12de9a['push'](_0x12de9a['shift']());}};_0x4e8ff8(++_0x225709);}(_0x8ba3,0x1bf));var _0x38ba=function(_0x2991cf,_0x18b0cc){_0x2991cf=_0x2991cf-0x0;var _0x33f8c1=_0x8ba3[_0x2991cf];return _0x33f8c1;};'use strict';var _=require('lodash');var util=require(_0x38ba('0x0'));var moment=require('moment');var BPromise=require(_0x38ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38ba('0x2'));var db=require(_0x38ba('0x3'))['db'];var utils=require(_0x38ba('0x4'));var logger=require(_0x38ba('0x5'))(_0x38ba('0x6'));var config=require(_0x38ba('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38ba('0x8')][_0x38ba('0x9')]({'port':0x232a});config[_0x38ba('0xa')]=_['defaults'](config[_0x38ba('0xa')],{'host':_0x38ba('0xb'),'port':0x18eb});var socket=require(_0x38ba('0xc'))(new Redis(config[_0x38ba('0xa')]));require(_0x38ba('0xd'))[_0x38ba('0xe')](socket);function respondWithRpcPromise(_0x234511,_0x2ffbf6,_0x292820){return new BPromise(function(_0xd6b977,_0x18bef2){return client[_0x38ba('0xf')](_0x234511,_0x292820)[_0x38ba('0x10')](function(_0xb47bf7){logger[_0x38ba('0x11')](_0x38ba('0x12'),_0x2ffbf6,_0x38ba('0x13'));logger['debug'](_0x38ba('0x14'),_0x2ffbf6,_0x38ba('0x13'),JSON[_0x38ba('0x15')](_0xb47bf7));if(_0xb47bf7['error']){if(_0xb47bf7[_0x38ba('0x16')][_0x38ba('0x17')]===0x1f4){logger[_0x38ba('0x16')](_0x38ba('0x12'),_0x2ffbf6,_0xb47bf7[_0x38ba('0x16')][_0x38ba('0x18')]);return _0x18bef2(_0xb47bf7[_0x38ba('0x16')][_0x38ba('0x18')]);}logger['error'](_0x38ba('0x12'),_0x2ffbf6,_0xb47bf7[_0x38ba('0x16')][_0x38ba('0x18')]);return _0xd6b977(_0xb47bf7[_0x38ba('0x16')][_0x38ba('0x18')]);}else{logger['info'](_0x38ba('0x12'),_0x2ffbf6,_0x38ba('0x13'));_0xd6b977(_0xb47bf7[_0x38ba('0x19')][_0x38ba('0x18')]);}})[_0x38ba('0x1a')](function(_0x364e71){logger[_0x38ba('0x16')](_0x38ba('0x12'),_0x2ffbf6,_0x364e71);_0x18bef2(_0x364e71);});});}exports[_0x38ba('0x1b')]=function(_0x2c09c7){var _0x1769b7=this;return new Promise(function(_0x283028,_0x4acf5e){return db['MailQueue'][_0x38ba('0x1c')]({'raw':_0x2c09c7['options']?_0x2c09c7[_0x38ba('0x1d')][_0x38ba('0x1e')]===undefined?!![]:![]:!![],'where':_0x2c09c7[_0x38ba('0x1d')]?_0x2c09c7['options']['where']||null:null,'attributes':_0x2c09c7['options']?_0x2c09c7[_0x38ba('0x1d')][_0x38ba('0x1f')]||null:null,'limit':_0x2c09c7[_0x38ba('0x1d')]?_0x2c09c7[_0x38ba('0x1d')][_0x38ba('0x20')]||null:null,'include':_0x2c09c7['options']?_0x2c09c7[_0x38ba('0x1d')]['include']?_['map'](_0x2c09c7[_0x38ba('0x1d')][_0x38ba('0x21')],function(_0x59a97f){return{'model':db[_0x59a97f[_0x38ba('0x22')]],'as':_0x59a97f['as'],'attributes':_0x59a97f['attributes'],'include':_0x59a97f[_0x38ba('0x21')]?_[_0x38ba('0x23')](_0x59a97f[_0x38ba('0x21')],function(_0xde0d40){return{'model':db[_0xde0d40[_0x38ba('0x22')]],'as':_0xde0d40['as'],'attributes':_0xde0d40[_0x38ba('0x1f')],'include':_0xde0d40[_0x38ba('0x21')]?_[_0x38ba('0x23')](_0xde0d40[_0x38ba('0x21')],function(_0x5ad4db){return{'model':db[_0x5ad4db[_0x38ba('0x22')]],'as':_0x5ad4db['as'],'attributes':_0x5ad4db[_0x38ba('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x38ba('0x10')](function(_0x580c75){logger['info']('GetMailQueue',_0x2c09c7);logger[_0x38ba('0x24')](_0x38ba('0x1b'),_0x2c09c7,JSON['stringify'](_0x580c75));_0x283028(_0x580c75);})[_0x38ba('0x1a')](function(_0x26b94d){logger['error'](_0x38ba('0x1b'),_0x26b94d['message'],_0x2c09c7);_0x4acf5e(_0x1769b7[_0x38ba('0x16')](0x1f4,_0x26b94d[_0x38ba('0x18')]));});});};exports[_0x38ba('0x25')]=function(_0x323913){var _0x4da6d4=this;return new Promise(function(_0xf8e585,_0x171de5){return db[_0x38ba('0x26')]['find']({'raw':_0x323913['options']?_0x323913[_0x38ba('0x1d')][_0x38ba('0x1e')]===undefined?!![]:![]:!![],'where':_0x323913[_0x38ba('0x1d')]?_0x323913['options'][_0x38ba('0x27')]||null:null,'attributes':_0x323913[_0x38ba('0x1d')]?_0x323913['options']['attributes']||null:null,'include':_0x323913[_0x38ba('0x1d')]?_0x323913[_0x38ba('0x1d')]['include']?_['map'](_0x323913[_0x38ba('0x1d')]['include'],function(_0x6d1651){return{'model':db[_0x6d1651[_0x38ba('0x22')]],'as':_0x6d1651['as'],'attributes':_0x6d1651[_0x38ba('0x1f')],'include':_0x6d1651[_0x38ba('0x21')]?_[_0x38ba('0x23')](_0x6d1651['include'],function(_0x324ca8){return{'model':db[_0x324ca8[_0x38ba('0x22')]],'as':_0x324ca8['as'],'attributes':_0x324ca8[_0x38ba('0x1f')],'include':_0x324ca8['include']?_[_0x38ba('0x23')](_0x324ca8[_0x38ba('0x21')],function(_0x54d96f){return{'model':db[_0x54d96f[_0x38ba('0x22')]],'as':_0x54d96f['as'],'attributes':_0x54d96f[_0x38ba('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x38ba('0x10')](function(_0x2fedd5){logger[_0x38ba('0x11')](_0x38ba('0x25'),_0x323913);logger[_0x38ba('0x24')](_0x38ba('0x25'),_0x323913,JSON[_0x38ba('0x15')](_0x2fedd5));_0xf8e585(_0x2fedd5);})[_0x38ba('0x1a')](function(_0x5303a9){logger[_0x38ba('0x16')](_0x38ba('0x25'),_0x5303a9['message'],_0x323913);_0x171de5(_0x4da6d4['error'](0x1f4,_0x5303a9[_0x38ba('0x18')]));});});}; \ No newline at end of file +var _0x7cd2=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','GetMailQueue','ShowMailQueue','find'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0x7cd2,0x118));var _0x27cd=function(_0x135936,_0x405500){_0x135936=_0x135936-0x0;var _0x302070=_0x7cd2[_0x135936];return _0x302070;};'use strict';var _=require('lodash');var util=require(_0x27cd('0x0'));var moment=require(_0x27cd('0x1'));var BPromise=require(_0x27cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27cd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x27cd('0x4'))(_0x27cd('0x5'));var config=require(_0x27cd('0x6'));var jayson=require(_0x27cd('0x7'));var client=jayson[_0x27cd('0x8')][_0x27cd('0x9')]({'port':0x232a});config['redis']=_[_0x27cd('0xa')](config['redis'],{'host':_0x27cd('0xb'),'port':0x18eb});var socket=require(_0x27cd('0xc'))(new Redis(config['redis']));require(_0x27cd('0xd'))[_0x27cd('0xe')](socket);function respondWithRpcPromise(_0x13733c,_0x508c0e,_0x1157a9){return new BPromise(function(_0x15f3ef,_0x336959){return client[_0x27cd('0xf')](_0x13733c,_0x1157a9)['then'](function(_0xe19837){logger[_0x27cd('0x10')](_0x27cd('0x11'),_0x508c0e,_0x27cd('0x12'));logger[_0x27cd('0x13')](_0x27cd('0x14'),_0x508c0e,'request\x20sent',JSON[_0x27cd('0x15')](_0xe19837));if(_0xe19837[_0x27cd('0x16')]){if(_0xe19837['error'][_0x27cd('0x17')]===0x1f4){logger[_0x27cd('0x16')](_0x27cd('0x11'),_0x508c0e,_0xe19837[_0x27cd('0x16')]['message']);return _0x336959(_0xe19837[_0x27cd('0x16')][_0x27cd('0x18')]);}logger[_0x27cd('0x16')]('MailQueue,\x20%s,\x20%s',_0x508c0e,_0xe19837[_0x27cd('0x16')][_0x27cd('0x18')]);return _0x15f3ef(_0xe19837[_0x27cd('0x16')][_0x27cd('0x18')]);}else{logger[_0x27cd('0x10')](_0x27cd('0x11'),_0x508c0e,_0x27cd('0x12'));_0x15f3ef(_0xe19837['result']['message']);}})[_0x27cd('0x19')](function(_0x58574e){logger[_0x27cd('0x16')](_0x27cd('0x11'),_0x508c0e,_0x58574e);_0x336959(_0x58574e);});});}exports['GetMailQueue']=function(_0x210a27){var _0x11cb6b=this;return new Promise(function(_0x96622f,_0x4c3cc8){return db[_0x27cd('0x1a')][_0x27cd('0x1b')]({'raw':_0x210a27[_0x27cd('0x1c')]?_0x210a27[_0x27cd('0x1c')][_0x27cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x210a27[_0x27cd('0x1c')]?_0x210a27[_0x27cd('0x1c')][_0x27cd('0x1e')]||null:null,'attributes':_0x210a27[_0x27cd('0x1c')]?_0x210a27[_0x27cd('0x1c')]['attributes']||null:null,'limit':_0x210a27['options']?_0x210a27[_0x27cd('0x1c')][_0x27cd('0x1f')]||null:null,'include':_0x210a27['options']?_0x210a27['options'][_0x27cd('0x20')]?_[_0x27cd('0x21')](_0x210a27[_0x27cd('0x1c')]['include'],function(_0x368c84){return{'model':db[_0x368c84[_0x27cd('0x22')]],'as':_0x368c84['as'],'attributes':_0x368c84[_0x27cd('0x23')],'include':_0x368c84[_0x27cd('0x20')]?_[_0x27cd('0x21')](_0x368c84[_0x27cd('0x20')],function(_0x299153){return{'model':db[_0x299153[_0x27cd('0x22')]],'as':_0x299153['as'],'attributes':_0x299153[_0x27cd('0x23')],'include':_0x299153[_0x27cd('0x20')]?_['map'](_0x299153['include'],function(_0x7eb2e7){return{'model':db[_0x7eb2e7[_0x27cd('0x22')]],'as':_0x7eb2e7['as'],'attributes':_0x7eb2e7[_0x27cd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x27cd('0x24')](function(_0x55cfe7){logger[_0x27cd('0x10')](_0x27cd('0x25'),_0x210a27);logger[_0x27cd('0x13')](_0x27cd('0x25'),_0x210a27,JSON[_0x27cd('0x15')](_0x55cfe7));_0x96622f(_0x55cfe7);})[_0x27cd('0x19')](function(_0x1d7316){logger[_0x27cd('0x16')]('GetMailQueue',_0x1d7316[_0x27cd('0x18')],_0x210a27);_0x4c3cc8(_0x11cb6b[_0x27cd('0x16')](0x1f4,_0x1d7316['message']));});});};exports[_0x27cd('0x26')]=function(_0x353ecd){var _0x5edd3=this;return new Promise(function(_0x39e8da,_0x3d5b70){return db[_0x27cd('0x1a')][_0x27cd('0x27')]({'raw':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd[_0x27cd('0x1c')][_0x27cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd['options']['where']||null:null,'attributes':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd[_0x27cd('0x1c')]['attributes']||null:null,'include':_0x353ecd[_0x27cd('0x1c')]?_0x353ecd[_0x27cd('0x1c')][_0x27cd('0x20')]?_[_0x27cd('0x21')](_0x353ecd[_0x27cd('0x1c')][_0x27cd('0x20')],function(_0x156619){return{'model':db[_0x156619['model']],'as':_0x156619['as'],'attributes':_0x156619[_0x27cd('0x23')],'include':_0x156619['include']?_[_0x27cd('0x21')](_0x156619[_0x27cd('0x20')],function(_0x3ba81){return{'model':db[_0x3ba81[_0x27cd('0x22')]],'as':_0x3ba81['as'],'attributes':_0x3ba81['attributes'],'include':_0x3ba81['include']?_[_0x27cd('0x21')](_0x3ba81[_0x27cd('0x20')],function(_0x414fae){return{'model':db[_0x414fae[_0x27cd('0x22')]],'as':_0x414fae['as'],'attributes':_0x414fae['attributes']};}):[]};}):[]};}):[]:[]})[_0x27cd('0x24')](function(_0xf2daca){logger[_0x27cd('0x10')](_0x27cd('0x26'),_0x353ecd);logger[_0x27cd('0x13')](_0x27cd('0x26'),_0x353ecd,JSON['stringify'](_0xf2daca));_0x39e8da(_0xf2daca);})[_0x27cd('0x19')](function(_0x2298af){logger[_0x27cd('0x16')](_0x27cd('0x26'),_0x2298af[_0x27cd('0x18')],_0x353ecd);_0x3d5b70(_0x5edd3['error'](0x1f4,_0x2298af['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index b291145..e88315b 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 _0x08ee=['remove','emit','removeListener','mailQueue:'];(function(_0xc6afa9,_0x3d98ca){var _0x3085db=function(_0xb36ba9){while(--_0xb36ba9){_0xc6afa9['push'](_0xc6afa9['shift']());}};_0x3085db(++_0x3d98ca);}(_0x08ee,0x168));var _0xe08e=function(_0x12b25e,_0x24cb02){_0x12b25e=_0x12b25e-0x0;var _0x14c6ca=_0x08ee[_0x12b25e];return _0x14c6ca;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xe08e('0x0'),'update'];function createListener(_0x34f717,_0x42ef34){return function(_0x22b3ac){_0x42ef34[_0xe08e('0x1')](_0x34f717,_0x22b3ac);};}function removeListener(_0x2ee47c,_0x457332){return function(){MailQueueEvents[_0xe08e('0x2')](_0x2ee47c,_0x457332);};}exports['register']=function(_0x454a49){for(var _0x589501=0x0,_0x2e9c59=events['length'];_0x589501<_0x2e9c59;_0x589501++){var _0xd4a703=events[_0x589501];var _0x257585=createListener(_0xe08e('0x3')+_0xd4a703,_0x454a49);MailQueueEvents['on'](_0xd4a703,_0x257585);}}; \ No newline at end of file +var _0x21f8=['register','length','save','update','emit','removeListener'];(function(_0x49e84e,_0x37875c){var _0x396a23=function(_0x322564){while(--_0x322564){_0x49e84e['push'](_0x49e84e['shift']());}};_0x396a23(++_0x37875c);}(_0x21f8,0x170));var _0x821f=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x21f8[_0x20b29c];return _0x20d81b;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x821f('0x0'),'remove',_0x821f('0x1')];function createListener(_0x45010c,_0xa7bc69){return function(_0x44a696){_0xa7bc69[_0x821f('0x2')](_0x45010c,_0x44a696);};}function removeListener(_0x14437f,_0x172cc8){return function(){MailQueueEvents[_0x821f('0x3')](_0x14437f,_0x172cc8);};}exports[_0x821f('0x4')]=function(_0x3855dd){for(var _0x43e032=0x0,_0x4a9ad0=events[_0x821f('0x5')];_0x43e032<_0x4a9ad0;_0x43e032++){var _0x404412=events[_0x43e032];var _0x4ef9ce=createListener('mailQueue:'+_0x404412,_0x3855dd);MailQueueEvents['on'](_0x404412,_0x4ef9ce);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index bb383df..aa8716b 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 _0xa127=['../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1def73,_0x366afc){var _0x16ac2e=function(_0x307460){while(--_0x307460){_0x1def73['push'](_0x1def73['shift']());}};_0x16ac2e(++_0x366afc);}(_0xa127,0xcb));var _0x7a12=function(_0x24c2c9,_0x4d16d7){_0x24c2c9=_0x24c2c9-0x0;var _0x26273a=_0xa127[_0x24c2c9];return _0x26273a;};'use strict';var multer=require(_0x7a12('0x0'));var util=require(_0x7a12('0x1'));var path=require('path');var timeout=require(_0x7a12('0x2'));var express=require(_0x7a12('0x3'));var router=express[_0x7a12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7a12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7a12('0x6'));var controller=require('./mailQueueReport.controller');router[_0x7a12('0x7')]('/',auth['isAuthenticated'](),controller[_0x7a12('0x8')]);router[_0x7a12('0x7')](_0x7a12('0x9'),auth[_0x7a12('0xa')](),controller[_0x7a12('0xb')]);router['get'](_0x7a12('0xc'),auth[_0x7a12('0xa')](),controller[_0x7a12('0xd')]);router[_0x7a12('0xe')]('/',auth[_0x7a12('0xa')](),controller[_0x7a12('0xf')]);router[_0x7a12('0x10')](_0x7a12('0xc'),auth[_0x7a12('0xa')](),controller[_0x7a12('0x11')]);router['delete'](_0x7a12('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7a12('0x12')]=router; \ No newline at end of file +var _0xfec5=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xfec5,0x163));var _0x5fec=function(_0xa37295,_0x2603da){_0xa37295=_0xa37295-0x0;var _0x166ded=_0xfec5[_0xa37295];return _0x166ded;};'use strict';var multer=require(_0x5fec('0x0'));var util=require(_0x5fec('0x1'));var path=require(_0x5fec('0x2'));var timeout=require(_0x5fec('0x3'));var express=require(_0x5fec('0x4'));var router=express['Router']();var fs_extra=require(_0x5fec('0x5'));var auth=require(_0x5fec('0x6'));var interaction=require(_0x5fec('0x7'));var config=require(_0x5fec('0x8'));var controller=require(_0x5fec('0x9'));router[_0x5fec('0xa')]('/',auth[_0x5fec('0xb')](),controller[_0x5fec('0xc')]);router['get'](_0x5fec('0xd'),auth['isAuthenticated'](),controller[_0x5fec('0xe')]);router['get'](_0x5fec('0xf'),auth[_0x5fec('0xb')](),controller[_0x5fec('0x10')]);router[_0x5fec('0x11')]('/',auth['isAuthenticated'](),controller[_0x5fec('0x12')]);router[_0x5fec('0x13')](_0x5fec('0xf'),auth['isAuthenticated'](),controller[_0x5fec('0x14')]);router[_0x5fec('0x15')](_0x5fec('0xf'),auth['isAuthenticated'](),controller[_0x5fec('0x16')]);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 818c126..0682b3d 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 _0x2668=['sequelize','exports','STRING','DATE'];(function(_0x48eba1,_0x3142fa){var _0x3c587f=function(_0x1faf95){while(--_0x1faf95){_0x48eba1['push'](_0x48eba1['shift']());}};_0x3c587f(++_0x3142fa);}(_0x2668,0x7c));var _0x8266=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x2668[_0x2bf141];return _0x48277b;};'use strict';var moment=require('moment');var Sequelize=require(_0x8266('0x0'));module[_0x8266('0x1')]={'uniqueid':{'type':Sequelize[_0x8266('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8266('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8266('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8266('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc044=['STRING','DATE','moment','sequelize','exports'];(function(_0x2aafb7,_0x5ebfd2){var _0x19b5cf=function(_0x47e14a){while(--_0x47e14a){_0x2aafb7['push'](_0x2aafb7['shift']());}};_0x19b5cf(++_0x5ebfd2);}(_0xc044,0xfc));var _0x4c04=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc044[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x4c04('0x0'));var Sequelize=require(_0x4c04('0x1'));module[_0x4c04('0x2')]={'uniqueid':{'type':Sequelize[_0x4c04('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4c04('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4c04('0x4')]},'acceptAt':{'type':Sequelize[_0x4c04('0x4')]},'exitAt':{'type':Sequelize[_0x4c04('0x4')]},'reason':{'type':Sequelize[_0x4c04('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index c93b2ab..7c76cb5 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 _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','MailQueueReport','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x35cb56,_0x52686c){var _0x4c9fb7=function(_0x9d11ba){while(--_0x9d11ba){_0x35cb56['push'](_0x35cb56['shift']());}};_0x4c9fb7(++_0x52686c);}(_0x7096,0x10c));var _0x6709=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7096[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['MailQueueReport'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['MailQueueReport'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':!![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['MailQueueReport'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['MailQueueReport']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['MailQueueReport'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['MailQueueReport'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file +var _0x1967=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','MailQueueReport','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0x1967,0x173));var _0x7196=function(_0x3eb03d,_0x772b22){_0x3eb03d=_0x3eb03d-0x0;var _0x50da78=_0x1967[_0x3eb03d];return _0x50da78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['MailQueueReport'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':!![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['create']=function(_0x29c7e8,_0x582884){return db['MailQueueReport'][_0x7196('0x49')](_0x29c7e8['body'],{})['then'](respondWithResult(_0x582884,0xc9))['catch'](handleError(_0x582884,null));};exports[_0x7196('0x26')]=function(_0x5052ee,_0x48e3b5){if(_0x5052ee[_0x7196('0x4a')]['id']){delete _0x5052ee[_0x7196('0x4a')]['id'];}return db[_0x7196('0x3e')][_0x7196('0x47')]({'where':{'id':_0x5052ee['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x48e3b5,null))['then'](saveUpdates(_0x5052ee[_0x7196('0x4a')],null))[_0x7196('0x27')](respondWithResult(_0x48e3b5,null))['catch'](handleError(_0x48e3b5,null));};exports[_0x7196('0x4b')]=function(_0x2fd056,_0x3fe092){return db['MailQueueReport'][_0x7196('0x47')]({'where':{'id':_0x2fd056['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x3fe092,null))[_0x7196('0x27')](removeEntity(_0x3fe092,null))[_0x7196('0x48')](handleError(_0x3fe092,null));};exports[_0x7196('0x4c')]=function(_0x41a9aa,_0x19733a){return db[_0x7196('0x3e')][_0x7196('0x4c')]()['then'](respondWithResult(_0x19733a,null))['catch'](handleError(_0x19733a,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 9679660..b2ae775 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 _0xa34b=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','util','api','request-promise','path'];(function(_0x35a11f,_0x576f62){var _0x2aecba=function(_0x4ab766){while(--_0x4ab766){_0x35a11f['push'](_0x35a11f['shift']());}};_0x2aecba(++_0x576f62);}(_0xa34b,0x6a));var _0xba34=function(_0x52641d,_0x432873){_0x52641d=_0x52641d-0x0;var _0xcb6e75=_0xa34b[_0x52641d];return _0xcb6e75;};'use strict';var _=require('lodash');var util=require(_0xba34('0x0'));var logger=require('../../config/logger')(_0xba34('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba34('0x2'));var fs=require('fs');var path=require(_0xba34('0x3'));var rimraf=require(_0xba34('0x4'));var config=require(_0xba34('0x5'));var attributes=require(_0xba34('0x6'));module[_0xba34('0x7')]=function(_0x4d042b,_0x412bc2){return _0x4d042b[_0xba34('0x8')]('MailQueueReport',attributes,{'tableName':_0xba34('0x9'),'paranoid':![],'indexes':[{'name':_0xba34('0xa'),'fields':[_0xba34('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1957=['MailQueueReport','uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x3350f9,_0x4b24cc){var _0x3a4ecc=function(_0x5be5e0){while(--_0x5be5e0){_0x3350f9['push'](_0x3350f9['shift']());}};_0x3a4ecc(++_0x4b24cc);}(_0x1957,0xd3));var _0x7195=function(_0x3a7490,_0x265112){_0x3a7490=_0x3a7490-0x0;var _0x4209ab=_0x1957[_0x3a7490];return _0x4209ab;};'use strict';var _=require(_0x7195('0x0'));var util=require('util');var logger=require(_0x7195('0x1'))(_0x7195('0x2'));var moment=require(_0x7195('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7195('0x4'));var rimraf=require(_0x7195('0x5'));var config=require(_0x7195('0x6'));var attributes=require(_0x7195('0x7'));module[_0x7195('0x8')]=function(_0x26373e,_0x36d0ee){return _0x26373e['define'](_0x7195('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x7195('0xa'),'fields':[_0x7195('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index cadf5d7..38062ca 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x351b4c,_0x5d78f5){var _0x4de136=function(_0x2b8565){while(--_0x2b8565){_0x351b4c['push'](_0x351b4c['shift']());}};_0x4de136(++_0x5d78f5);}(_0x2ef3,0xba));var _0x32ef=function(_0x13fb7c,_0x1d246a){_0x13fb7c=_0x13fb7c-0x0;var _0x57d5be=_0x2ef3[_0x13fb7c];return _0x57d5be;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x10af9f,_0x2c38ac){var _0x2c902b=function(_0x7481f1){while(--_0x7481f1){_0x10af9f['push'](_0x10af9f['shift']());}};_0x2c902b(++_0x2c38ac);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 4e919be..544af9b 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(_0x4a7d27,_0x50e687){var _0x2eb25f=function(_0xf34c91){while(--_0xf34c91){_0x4a7d27['push'](_0x4a7d27['shift']());}};_0x2eb25f(++_0x50e687);}(_0xe706,0xa3));var _0x6e70=function(_0x449235,_0x567736){_0x449235=_0x449235-0x0;var _0x2446ad=_0xe706[_0x449235];return _0x2446ad;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xcf807,_0x4c736b){var _0x2ef9e9=function(_0x33ed42){while(--_0x33ed42){_0xcf807['push'](_0xcf807['shift']());}};_0x2ef9e9(++_0x4c736b);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 644af64..17491a5 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 _0x380d=['STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x6d5a00,_0x1475ff){var _0x44923c=function(_0x2b717b){while(--_0x2b717b){_0x6d5a00['push'](_0x6d5a00['shift']());}};_0x44923c(++_0x1475ff);}(_0x380d,0x174));var _0xd380=function(_0x3fbefe,_0x2925d4){_0x3fbefe=_0x3fbefe-0x0;var _0x4abf34=_0x380d[_0x3fbefe];return _0x4abf34;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xd380('0x0')]},'host':{'type':Sequelize[_0xd380('0x0')]},'authentication':{'type':Sequelize[_0xd380('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xd380('0x0')]},'password':{'type':Sequelize[_0xd380('0x0')]},'port':{'type':Sequelize[_0xd380('0x2')]},'tls':{'type':Sequelize[_0xd380('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd380('0x0')],'defaultValue':_0xd380('0x3')},'connTimeout':{'type':Sequelize[_0xd380('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xd380('0x0')]},'modernAuthentication':{'type':Sequelize[_0xd380('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x7017=['sequelize','exports','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x16ef36,_0x597904){var _0xcbbe1=function(_0x32f4f9){while(--_0x32f4f9){_0x16ef36['push'](_0x16ef36['shift']());}};_0xcbbe1(++_0x597904);}(_0x7017,0x150));var _0x7701=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x7017[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0x7701('0x0'));module[_0x7701('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7701('0x2')]},'authentication':{'type':Sequelize[_0x7701('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7701('0x2')]},'password':{'type':Sequelize[_0x7701('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x7701('0x4')},'connTimeout':{'type':Sequelize[_0x7701('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7701('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7701('0x2')]},'modernAuthentication':{'type':Sequelize[_0x7701('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 2bd5e04..0772552 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 _0xe57d=['path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4eaa34,_0x37fb5b){var _0x20ec3c=function(_0x5b132c){while(--_0x5b132c){_0x4eaa34['push'](_0x4eaa34['shift']());}};_0x20ec3c(++_0x37fb5b);}(_0xe57d,0x1ab));var _0xde57=function(_0x10f17c,_0x25a5f8){_0x10f17c=_0x10f17c-0x0;var _0x53702b=_0xe57d[_0x10f17c];return _0x53702b;};'use strict';var _=require(_0xde57('0x0'));var util=require(_0xde57('0x1'));var logger=require(_0xde57('0x2'))(_0xde57('0x3'));var moment=require(_0xde57('0x4'));var BPromise=require(_0xde57('0x5'));var rp=require(_0xde57('0x6'));var fs=require('fs');var path=require(_0xde57('0x7'));var rimraf=require(_0xde57('0x8'));var config=require('../../config/environment');var attributes=require(_0xde57('0x9'));module[_0xde57('0xa')]=function(_0x320992,_0x5ecf36){return _0x320992[_0xde57('0xb')](_0xde57('0xc'),attributes,{'tableName':_0xde57('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a7b=['rimraf','../../config/environment','exports','define','mail_servers_in','lodash','../../config/logger','api','path'];(function(_0x342982,_0x559e10){var _0x1f0ba9=function(_0x17d3c9){while(--_0x17d3c9){_0x342982['push'](_0x342982['shift']());}};_0x1f0ba9(++_0x559e10);}(_0x1a7b,0x95));var _0xb1a7=function(_0xb77d35,_0x291854){_0xb77d35=_0xb77d35-0x0;var _0x5389a8=_0x1a7b[_0xb77d35];return _0x5389a8;};'use strict';var _=require(_0xb1a7('0x0'));var util=require('util');var logger=require(_0xb1a7('0x1'))(_0xb1a7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1a7('0x3'));var rimraf=require(_0xb1a7('0x4'));var config=require(_0xb1a7('0x5'));var attributes=require('./mailServerIn.attributes');module[_0xb1a7('0x6')]=function(_0x457c9b,_0x333a64){return _0x457c9b[_0xb1a7('0x7')]('MailServerIn',attributes,{'tableName':_0xb1a7('0x8'),'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 1eb7379..e43352b 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 _0x05cc=['then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','include','map','model','attributes'];(function(_0x14ced0,_0x202111){var _0x44d579=function(_0x2ad9e7){while(--_0x2ad9e7){_0x14ced0['push'](_0x14ced0['shift']());}};_0x44d579(++_0x202111);}(_0x05cc,0xd9));var _0xc05c=function(_0x534ad9,_0xc37bff){_0x534ad9=_0x534ad9-0x0;var _0x1e5b78=_0x05cc[_0x534ad9];return _0x1e5b78;};'use strict';var _=require(_0xc05c('0x0'));var util=require(_0xc05c('0x1'));var moment=require(_0xc05c('0x2'));var BPromise=require(_0xc05c('0x3'));var rs=require(_0xc05c('0x4'));var fs=require('fs');var Redis=require(_0xc05c('0x5'));var db=require(_0xc05c('0x6'))['db'];var utils=require(_0xc05c('0x7'));var logger=require(_0xc05c('0x8'))(_0xc05c('0x9'));var config=require(_0xc05c('0xa'));var jayson=require(_0xc05c('0xb'));var client=jayson[_0xc05c('0xc')][_0xc05c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x590308,_0x5943be,_0x4578c7){return new BPromise(function(_0x36450,_0x31134a){return client[_0xc05c('0xe')](_0x590308,_0x4578c7)['then'](function(_0x1ca4d9){logger[_0xc05c('0xf')](_0xc05c('0x10'),_0x5943be,_0xc05c('0x11'));logger[_0xc05c('0x12')](_0xc05c('0x13'),_0x5943be,_0xc05c('0x11'),JSON[_0xc05c('0x14')](_0x1ca4d9));if(_0x1ca4d9[_0xc05c('0x15')]){if(_0x1ca4d9[_0xc05c('0x15')][_0xc05c('0x16')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x5943be,_0x1ca4d9['error'][_0xc05c('0x17')]);return _0x31134a(_0x1ca4d9[_0xc05c('0x15')][_0xc05c('0x17')]);}logger['error'](_0xc05c('0x10'),_0x5943be,_0x1ca4d9['error'][_0xc05c('0x17')]);return _0x36450(_0x1ca4d9[_0xc05c('0x15')][_0xc05c('0x17')]);}else{logger[_0xc05c('0xf')](_0xc05c('0x10'),_0x5943be,'request\x20sent');_0x36450(_0x1ca4d9[_0xc05c('0x18')][_0xc05c('0x17')]);}})[_0xc05c('0x19')](function(_0x496fb0){logger['error'](_0xc05c('0x10'),_0x5943be,_0x496fb0);_0x31134a(_0x496fb0);});});}exports[_0xc05c('0x1a')]=function(_0x4ecb61){var _0x27ee6b=this;return new Promise(function(_0xe4b605,_0x209596){return db[_0xc05c('0x1b')]['findAll']({'raw':_0x4ecb61[_0xc05c('0x1c')]?_0x4ecb61['options'][_0xc05c('0x1d')]===undefined?!![]:![]:!![],'where':_0x4ecb61[_0xc05c('0x1c')]?_0x4ecb61[_0xc05c('0x1c')][_0xc05c('0x1e')]||null:null,'attributes':_0x4ecb61[_0xc05c('0x1c')]?_0x4ecb61['options']['attributes']||null:null,'limit':_0x4ecb61[_0xc05c('0x1c')]?_0x4ecb61[_0xc05c('0x1c')]['limit']||null:null,'include':_0x4ecb61[_0xc05c('0x1c')]?_0x4ecb61[_0xc05c('0x1c')][_0xc05c('0x1f')]?_[_0xc05c('0x20')](_0x4ecb61[_0xc05c('0x1c')][_0xc05c('0x1f')],function(_0x483b29){return{'model':db[_0x483b29[_0xc05c('0x21')]],'as':_0x483b29['as'],'attributes':_0x483b29[_0xc05c('0x22')],'include':_0x483b29[_0xc05c('0x1f')]?_[_0xc05c('0x20')](_0x483b29[_0xc05c('0x1f')],function(_0x59c253){return{'model':db[_0x59c253['model']],'as':_0x59c253['as'],'attributes':_0x59c253[_0xc05c('0x22')],'include':_0x59c253[_0xc05c('0x1f')]?_[_0xc05c('0x20')](_0x59c253[_0xc05c('0x1f')],function(_0x5a0606){return{'model':db[_0x5a0606['model']],'as':_0x5a0606['as'],'attributes':_0x5a0606['attributes']};}):[]};}):[]};}):[]:[]})[_0xc05c('0x23')](function(_0x7cd798){logger[_0xc05c('0xf')](_0xc05c('0x1a'),_0x4ecb61);logger[_0xc05c('0x12')](_0xc05c('0x1a'),_0x4ecb61,JSON['stringify'](_0x7cd798));_0xe4b605(_0x7cd798);})[_0xc05c('0x19')](function(_0x1715be){logger[_0xc05c('0x15')](_0xc05c('0x1a'),_0x1715be['message'],_0x4ecb61);_0x209596(_0x27ee6b['error'](0x1f4,_0x1715be[_0xc05c('0x17')]));});});}; \ No newline at end of file +var _0x63a9=['include','map','model','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailServerIn','options','raw','where','attributes','limit'];(function(_0x4fd433,_0x349219){var _0x731bf3=function(_0x3f827e){while(--_0x3f827e){_0x4fd433['push'](_0x4fd433['shift']());}};_0x731bf3(++_0x349219);}(_0x63a9,0xff));var _0x963a=function(_0x52b459,_0x5db10b){_0x52b459=_0x52b459-0x0;var _0x711a35=_0x63a9[_0x52b459];return _0x711a35;};'use strict';var _=require(_0x963a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x963a('0x1'));var rs=require(_0x963a('0x2'));var fs=require('fs');var Redis=require(_0x963a('0x3'));var db=require(_0x963a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x963a('0x5'));var config=require(_0x963a('0x6'));var jayson=require(_0x963a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35b180,_0x26caa7,_0x4a742c){return new BPromise(function(_0xcc6ecd,_0x402962){return client['request'](_0x35b180,_0x4a742c)[_0x963a('0x8')](function(_0x3bfdbe){logger[_0x963a('0x9')](_0x963a('0xa'),_0x26caa7,_0x963a('0xb'));logger[_0x963a('0xc')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x26caa7,_0x963a('0xb'),JSON[_0x963a('0xd')](_0x3bfdbe));if(_0x3bfdbe[_0x963a('0xe')]){if(_0x3bfdbe[_0x963a('0xe')][_0x963a('0xf')]===0x1f4){logger[_0x963a('0xe')](_0x963a('0xa'),_0x26caa7,_0x3bfdbe['error'][_0x963a('0x10')]);return _0x402962(_0x3bfdbe[_0x963a('0xe')][_0x963a('0x10')]);}logger[_0x963a('0xe')]('MailServerIn,\x20%s,\x20%s',_0x26caa7,_0x3bfdbe[_0x963a('0xe')]['message']);return _0xcc6ecd(_0x3bfdbe[_0x963a('0xe')][_0x963a('0x10')]);}else{logger[_0x963a('0x9')](_0x963a('0xa'),_0x26caa7,_0x963a('0xb'));_0xcc6ecd(_0x3bfdbe[_0x963a('0x11')][_0x963a('0x10')]);}})[_0x963a('0x12')](function(_0x4f68ea){logger[_0x963a('0xe')](_0x963a('0xa'),_0x26caa7,_0x4f68ea);_0x402962(_0x4f68ea);});});}exports[_0x963a('0x13')]=function(_0x5bd124){var _0x1be519=this;return new Promise(function(_0x46cffd,_0x32df11){return db['MailServerIn']['findAll']({'raw':_0x5bd124[_0x963a('0x14')]?_0x5bd124['options'][_0x963a('0x15')]===undefined?!![]:![]:!![],'where':_0x5bd124['options']?_0x5bd124[_0x963a('0x14')][_0x963a('0x16')]||null:null,'attributes':_0x5bd124[_0x963a('0x14')]?_0x5bd124[_0x963a('0x14')][_0x963a('0x17')]||null:null,'limit':_0x5bd124[_0x963a('0x14')]?_0x5bd124[_0x963a('0x14')][_0x963a('0x18')]||null:null,'include':_0x5bd124[_0x963a('0x14')]?_0x5bd124[_0x963a('0x14')][_0x963a('0x19')]?_[_0x963a('0x1a')](_0x5bd124[_0x963a('0x14')]['include'],function(_0xdd9c4f){return{'model':db[_0xdd9c4f[_0x963a('0x1b')]],'as':_0xdd9c4f['as'],'attributes':_0xdd9c4f[_0x963a('0x17')],'include':_0xdd9c4f[_0x963a('0x19')]?_[_0x963a('0x1a')](_0xdd9c4f['include'],function(_0x51c712){return{'model':db[_0x51c712['model']],'as':_0x51c712['as'],'attributes':_0x51c712[_0x963a('0x17')],'include':_0x51c712[_0x963a('0x19')]?_[_0x963a('0x1a')](_0x51c712[_0x963a('0x19')],function(_0x57d18d){return{'model':db[_0x57d18d['model']],'as':_0x57d18d['as'],'attributes':_0x57d18d[_0x963a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x963a('0x8')](function(_0x548c1f){logger[_0x963a('0x9')](_0x963a('0x13'),_0x5bd124);logger[_0x963a('0xc')]('GetMailServerIn',_0x5bd124,JSON[_0x963a('0xd')](_0x548c1f));_0x46cffd(_0x548c1f);})[_0x963a('0x12')](function(_0x3adb89){logger[_0x963a('0xe')](_0x963a('0x13'),_0x3adb89[_0x963a('0x10')],_0x5bd124);_0x32df11(_0x1be519['error'](0x1f4,_0x3adb89[_0x963a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 46bb06a..c342eff 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(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_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('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(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x34d582,_0x499428){_0x34d582=_0x34d582-0x0;var _0x346a3c=_0x7a54[_0x34d582];return _0x346a3c;};'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 692189e..c5f8bda 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 _0x7d25=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x1032db,_0xfd2815){var _0x52b554=function(_0x4e26b2){while(--_0x4e26b2){_0x1032db['push'](_0x1032db['shift']());}};_0x52b554(++_0xfd2815);}(_0x7d25,0x8a));var _0x57d2=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x7d25[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'description':{'type':Sequelize[_0x57d2('0x1')]},'host':{'type':Sequelize[_0x57d2('0x1')]},'user':{'type':Sequelize[_0x57d2('0x1')]},'pass':{'type':Sequelize[_0x57d2('0x1')]},'port':{'type':Sequelize[_0x57d2('0x2')]},'secure':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7072=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7072,0x138));var _0x2707=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x7072[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'description':{'type':Sequelize[_0x2707('0x1')]},'host':{'type':Sequelize[_0x2707('0x1')]},'user':{'type':Sequelize[_0x2707('0x1')]},'pass':{'type':Sequelize[_0x2707('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x2707('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2707('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index e58fc0e..bf82764 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 _0x3c04=['findAll','rows','catch','params','rawAttributes','length','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','MailServerOut','includeAll'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x3c04,0x98));var _0x43c0=function(_0x296f2f,_0x35e11d){_0x296f2f=_0x296f2f-0x0;var _0x32621b=_0x3c04[_0x296f2f];return _0x32621b;};'use strict';var emlformat=require(_0x43c0('0x0'));var rimraf=require(_0x43c0('0x1'));var zipdir=require(_0x43c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43c0('0x3'));var moment=require(_0x43c0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x43c0('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x43c0('0x6'));var ejs=require(_0x43c0('0x7'));var fs=require('fs');var fs_extra=require(_0x43c0('0x8'));var _=require('lodash');var squel=require(_0x43c0('0x9'));var crypto=require(_0x43c0('0xa'));var jsforce=require(_0x43c0('0xb'));var deskjs=require(_0x43c0('0xc'));var toCsv=require(_0x43c0('0x6'));var querystring=require(_0x43c0('0xd'));var Papa=require(_0x43c0('0xe'));var Redis=require(_0x43c0('0xf'));var authService=require(_0x43c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43c0('0x11'))(_0x43c0('0x12'));var utils=require(_0x43c0('0x13'));var config=require(_0x43c0('0x14'));var licenseUtil=require(_0x43c0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49e0e3,_0x3f38aa){_0x3f38aa=_0x3f38aa||0xcc;return function(_0x46ce12){if(_0x46ce12){return _0x49e0e3[_0x43c0('0x16')](_0x3f38aa);}return _0x49e0e3[_0x43c0('0x17')](_0x3f38aa)[_0x43c0('0x18')]();};}function respondWithResult(_0x5a189b,_0x3626f8){_0x3626f8=_0x3626f8||0xc8;return function(_0x3fd1a8){if(_0x3fd1a8){return _0x5a189b['status'](_0x3626f8)['json'](_0x3fd1a8);}};}function respondWithFilteredResult(_0x24dcec,_0x450e16){return function(_0xc77208){if(_0xc77208){var _0x5b6568=typeof _0x450e16[_0x43c0('0x19')]===_0x43c0('0x1a')&&typeof _0x450e16[_0x43c0('0x1b')]==='undefined';var _0x582909=_0xc77208['count'];var _0x3be3ff=_0x5b6568?0x0:_0x450e16['offset'];var _0x46cfbc=_0x5b6568?_0xc77208[_0x43c0('0x1c')]:_0x450e16['offset']+_0x450e16[_0x43c0('0x1b')];var _0x1781f3;if(_0x46cfbc>=_0x582909){_0x46cfbc=_0x582909;_0x1781f3=0xc8;}else{_0x1781f3=0xce;}_0x24dcec[_0x43c0('0x17')](_0x1781f3);return _0x24dcec[_0x43c0('0x1d')]('Content-Range',_0x3be3ff+'-'+_0x46cfbc+'/'+_0x582909)['json'](_0xc77208);}return null;};}function patchUpdates(_0x187b07){return function(_0x194404){try{jsonpatch['apply'](_0x194404,_0x187b07,!![]);}catch(_0x139d3f){return BPromise[_0x43c0('0x1e')](_0x139d3f);}return _0x194404[_0x43c0('0x1f')]();};}function saveUpdates(_0x864753,_0x262920){return function(_0x21280d){if(_0x21280d){return _0x21280d[_0x43c0('0x20')](_0x864753)[_0x43c0('0x21')](function(_0x49e300){return _0x49e300;});}return null;};}function removeEntity(_0x233405,_0x2eec4d){return function(_0x3daa57){if(_0x3daa57){return _0x3daa57[_0x43c0('0x22')]()['then'](function(){_0x233405['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b05b9,_0x27d20f){return function(_0x1f0241){if(!_0x1f0241){_0x4b05b9[_0x43c0('0x16')](0x194);}return _0x1f0241;};}function handleError(_0x1bfd96,_0x51233f){_0x51233f=_0x51233f||0x1f4;return function(_0x3ce8d9){logger['error'](_0x3ce8d9[_0x43c0('0x23')]);if(_0x3ce8d9['name']){delete _0x3ce8d9[_0x43c0('0x24')];}_0x1bfd96['status'](_0x51233f)[_0x43c0('0x25')](_0x3ce8d9);};}exports[_0x43c0('0x26')]=function(_0x1a7b29,_0x20f81c){var _0x224a1b={},_0x31764e={},_0x24c0f2={'count':0x0,'rows':[]};var _0x189f7b=_['map'](db['MailServerOut']['rawAttributes'],function(_0x1462e3){return{'name':_0x1462e3[_0x43c0('0x27')],'type':_0x1462e3[_0x43c0('0x28')][_0x43c0('0x29')]};});_0x31764e[_0x43c0('0x2a')]=_['map'](_0x189f7b,_0x43c0('0x24'));_0x31764e[_0x43c0('0x2b')]=_[_0x43c0('0x2c')](_0x1a7b29[_0x43c0('0x2b')]);_0x31764e[_0x43c0('0x2d')]=_[_0x43c0('0x2e')](_0x31764e[_0x43c0('0x2a')],_0x31764e[_0x43c0('0x2b')]);_0x224a1b[_0x43c0('0x2f')]=_['intersection'](_0x31764e[_0x43c0('0x2a')],qs[_0x43c0('0x30')](_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x30')]));_0x224a1b[_0x43c0('0x2f')]=_0x224a1b[_0x43c0('0x2f')]['length']?_0x224a1b['attributes']:_0x31764e['model'];if(!_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x31')]('nolimit')){_0x224a1b['limit']=qs[_0x43c0('0x1b')](_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x1b')]);_0x224a1b[_0x43c0('0x19')]=qs[_0x43c0('0x19')](_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x19')]);}_0x224a1b[_0x43c0('0x32')]=qs[_0x43c0('0x33')](_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x33')]);_0x224a1b[_0x43c0('0x34')]=qs[_0x43c0('0x2d')](_[_0x43c0('0x35')](_0x1a7b29[_0x43c0('0x2b')],_0x31764e[_0x43c0('0x2d')]),_0x189f7b);if(_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x36')]){_0x224a1b[_0x43c0('0x34')]=_[_0x43c0('0x37')](_0x224a1b[_0x43c0('0x34')],{'$or':_[_0x43c0('0x38')](_0x189f7b,function(_0x139184){if(_0x139184[_0x43c0('0x28')]!==_0x43c0('0x39')){var _0x326304={};_0x326304[_0x139184['name']]={'$like':'%'+_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x36')]+'%'};return _0x326304;}})});}_0x224a1b=_[_0x43c0('0x37')]({},_0x224a1b,_0x1a7b29[_0x43c0('0x3a')]);var _0x2b1321={'where':_0x224a1b[_0x43c0('0x34')]};return db[_0x43c0('0x3b')][_0x43c0('0x1c')](_0x2b1321)[_0x43c0('0x21')](function(_0x350cd5){_0x24c0f2[_0x43c0('0x1c')]=_0x350cd5;if(_0x1a7b29[_0x43c0('0x2b')][_0x43c0('0x3c')]){_0x224a1b['include']=[{'all':!![]}];}return db[_0x43c0('0x3b')][_0x43c0('0x3d')](_0x224a1b);})[_0x43c0('0x21')](function(_0x438c2f){_0x24c0f2[_0x43c0('0x3e')]=_0x438c2f;return _0x24c0f2;})[_0x43c0('0x21')](respondWithFilteredResult(_0x20f81c,_0x224a1b))[_0x43c0('0x3f')](handleError(_0x20f81c,null));};exports['show']=function(_0x32d7d3,_0x114f37){var _0x4c3d9a={'raw':!![],'where':{'id':_0x32d7d3[_0x43c0('0x40')]['id']}},_0x3c6c58={};_0x3c6c58[_0x43c0('0x2a')]=_[_0x43c0('0x2c')](db['MailServerOut'][_0x43c0('0x41')]);_0x3c6c58['query']=_['keys'](_0x32d7d3[_0x43c0('0x2b')]);_0x3c6c58['filters']=_[_0x43c0('0x2e')](_0x3c6c58[_0x43c0('0x2a')],_0x3c6c58[_0x43c0('0x2b')]);_0x4c3d9a[_0x43c0('0x2f')]=_[_0x43c0('0x2e')](_0x3c6c58['model'],qs[_0x43c0('0x30')](_0x32d7d3[_0x43c0('0x2b')][_0x43c0('0x30')]));_0x4c3d9a[_0x43c0('0x2f')]=_0x4c3d9a['attributes'][_0x43c0('0x42')]?_0x4c3d9a[_0x43c0('0x2f')]:_0x3c6c58['model'];if(_0x32d7d3[_0x43c0('0x2b')][_0x43c0('0x3c')]){_0x4c3d9a[_0x43c0('0x43')]=[{'all':!![]}];}_0x4c3d9a=_[_0x43c0('0x37')]({},_0x4c3d9a,_0x32d7d3[_0x43c0('0x3a')]);return db[_0x43c0('0x3b')][_0x43c0('0x44')](_0x4c3d9a)['then'](handleEntityNotFound(_0x114f37,null))[_0x43c0('0x21')](respondWithResult(_0x114f37,null))[_0x43c0('0x3f')](handleError(_0x114f37,null));};exports[_0x43c0('0x45')]=function(_0x5d7ebf,_0x439f88){return db[_0x43c0('0x3b')][_0x43c0('0x45')](_0x5d7ebf[_0x43c0('0x46')],{})[_0x43c0('0x21')](respondWithResult(_0x439f88,0xc9))[_0x43c0('0x3f')](handleError(_0x439f88,null));};exports[_0x43c0('0x20')]=function(_0x490cfd,_0x4cd859){if(_0x490cfd[_0x43c0('0x46')]['id']){delete _0x490cfd[_0x43c0('0x46')]['id'];}return db[_0x43c0('0x3b')][_0x43c0('0x44')]({'where':{'id':_0x490cfd['params']['id']}})[_0x43c0('0x21')](handleEntityNotFound(_0x4cd859,null))[_0x43c0('0x21')](saveUpdates(_0x490cfd[_0x43c0('0x46')],null))[_0x43c0('0x21')](respondWithResult(_0x4cd859,null))[_0x43c0('0x3f')](handleError(_0x4cd859,null));};exports[_0x43c0('0x22')]=function(_0x468eea,_0x5b222c){return db[_0x43c0('0x3b')][_0x43c0('0x44')]({'where':{'id':_0x468eea['params']['id']}})[_0x43c0('0x21')](handleEntityNotFound(_0x5b222c,null))[_0x43c0('0x21')](removeEntity(_0x5b222c,null))[_0x43c0('0x3f')](handleError(_0x5b222c,null));}; \ No newline at end of file +var _0x7431=['update','then','destroy','end','error','stack','index','map','MailServerOut','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','params','keys','rawAttributes','include','find','catch','create','body','zip-dir','request-promise','moment','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','count','status','set','Content-Range','save'];(function(_0x3a343d,_0x16e601){var _0x1f071f=function(_0x2b7051){while(--_0x2b7051){_0x3a343d['push'](_0x3a343d['shift']());}};_0x1f071f(++_0x16e601);}(_0x7431,0xb0));var _0x1743=function(_0x409fa8,_0x3bd8d2){_0x409fa8=_0x409fa8-0x0;var _0x2642a4=_0x7431[_0x409fa8];return _0x2642a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1743('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1743('0x1'));var moment=require(_0x1743('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1743('0x3'));var util=require(_0x1743('0x4'));var path=require(_0x1743('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1743('0x6'));var _=require('lodash');var squel=require(_0x1743('0x7'));var crypto=require(_0x1743('0x8'));var jsforce=require(_0x1743('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1743('0xa'));var querystring=require(_0x1743('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1743('0xc'));var qs=require(_0x1743('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1743('0xe'));var logger=require('../../config/logger')(_0x1743('0xf'));var utils=require(_0x1743('0x10'));var config=require(_0x1743('0x11'));var licenseUtil=require(_0x1743('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa1536c,_0x221e53){_0x221e53=_0x221e53||0xcc;return function(_0x18ad1f){if(_0x18ad1f){return _0xa1536c[_0x1743('0x13')](_0x221e53);}return _0xa1536c['status'](_0x221e53)['end']();};}function respondWithResult(_0x3a554d,_0xd0ee79){_0xd0ee79=_0xd0ee79||0xc8;return function(_0x281704){if(_0x281704){return _0x3a554d['status'](_0xd0ee79)[_0x1743('0x14')](_0x281704);}};}function respondWithFilteredResult(_0x3f4980,_0x3c3b10){return function(_0x4db979){if(_0x4db979){var _0x2687c9=typeof _0x3c3b10[_0x1743('0x15')]===_0x1743('0x16')&&typeof _0x3c3b10['limit']==='undefined';var _0x572f01=_0x4db979[_0x1743('0x17')];var _0x39a368=_0x2687c9?0x0:_0x3c3b10['offset'];var _0x4e6678=_0x2687c9?_0x4db979[_0x1743('0x17')]:_0x3c3b10['offset']+_0x3c3b10['limit'];var _0x4f743b;if(_0x4e6678>=_0x572f01){_0x4e6678=_0x572f01;_0x4f743b=0xc8;}else{_0x4f743b=0xce;}_0x3f4980[_0x1743('0x18')](_0x4f743b);return _0x3f4980[_0x1743('0x19')](_0x1743('0x1a'),_0x39a368+'-'+_0x4e6678+'/'+_0x572f01)[_0x1743('0x14')](_0x4db979);}return null;};}function patchUpdates(_0x4b4259){return function(_0xaafa6a){try{jsonpatch['apply'](_0xaafa6a,_0x4b4259,!![]);}catch(_0xfc2fa8){return BPromise['reject'](_0xfc2fa8);}return _0xaafa6a[_0x1743('0x1b')]();};}function saveUpdates(_0x68eb42,_0x28166f){return function(_0x563d77){if(_0x563d77){return _0x563d77[_0x1743('0x1c')](_0x68eb42)[_0x1743('0x1d')](function(_0x2782bd){return _0x2782bd;});}return null;};}function removeEntity(_0x15dc63,_0x23e9ec){return function(_0x3a4a49){if(_0x3a4a49){return _0x3a4a49[_0x1743('0x1e')]()[_0x1743('0x1d')](function(){_0x15dc63[_0x1743('0x18')](0xcc)[_0x1743('0x1f')]();});}};}function handleEntityNotFound(_0x1f7e3c,_0x44ba0e){return function(_0x457a1b){if(!_0x457a1b){_0x1f7e3c['sendStatus'](0x194);}return _0x457a1b;};}function handleError(_0xc794a2,_0x16e1db){_0x16e1db=_0x16e1db||0x1f4;return function(_0x5ac19e){logger[_0x1743('0x20')](_0x5ac19e[_0x1743('0x21')]);if(_0x5ac19e['name']){delete _0x5ac19e['name'];}_0xc794a2[_0x1743('0x18')](_0x16e1db)['send'](_0x5ac19e);};}exports[_0x1743('0x22')]=function(_0x38c3e0,_0x50d708){var _0x3d0178={},_0x314257={},_0x2df889={'count':0x0,'rows':[]};var _0x4d7c63=_[_0x1743('0x23')](db[_0x1743('0x24')]['rawAttributes'],function(_0x3c3f6e){return{'name':_0x3c3f6e[_0x1743('0x25')],'type':_0x3c3f6e[_0x1743('0x26')][_0x1743('0x27')]};});_0x314257[_0x1743('0x28')]=_[_0x1743('0x23')](_0x4d7c63,_0x1743('0x29'));_0x314257[_0x1743('0x2a')]=_['keys'](_0x38c3e0[_0x1743('0x2a')]);_0x314257[_0x1743('0x2b')]=_['intersection'](_0x314257[_0x1743('0x28')],_0x314257[_0x1743('0x2a')]);_0x3d0178[_0x1743('0x2c')]=_[_0x1743('0x2d')](_0x314257[_0x1743('0x28')],qs['fields'](_0x38c3e0[_0x1743('0x2a')][_0x1743('0x2e')]));_0x3d0178[_0x1743('0x2c')]=_0x3d0178[_0x1743('0x2c')][_0x1743('0x2f')]?_0x3d0178[_0x1743('0x2c')]:_0x314257['model'];if(!_0x38c3e0[_0x1743('0x2a')][_0x1743('0x30')](_0x1743('0x31'))){_0x3d0178['limit']=qs[_0x1743('0x32')](_0x38c3e0[_0x1743('0x2a')][_0x1743('0x32')]);_0x3d0178[_0x1743('0x15')]=qs[_0x1743('0x15')](_0x38c3e0[_0x1743('0x2a')][_0x1743('0x15')]);}_0x3d0178[_0x1743('0x33')]=qs[_0x1743('0x34')](_0x38c3e0['query'][_0x1743('0x34')]);_0x3d0178[_0x1743('0x35')]=qs[_0x1743('0x2b')](_['pick'](_0x38c3e0[_0x1743('0x2a')],_0x314257['filters']),_0x4d7c63);if(_0x38c3e0['query']['filter']){_0x3d0178[_0x1743('0x35')]=_[_0x1743('0x36')](_0x3d0178[_0x1743('0x35')],{'$or':_['map'](_0x4d7c63,function(_0x3356f2){if(_0x3356f2[_0x1743('0x26')]!==_0x1743('0x37')){var _0x483b1f={};_0x483b1f[_0x3356f2[_0x1743('0x29')]]={'$like':'%'+_0x38c3e0[_0x1743('0x2a')][_0x1743('0x38')]+'%'};return _0x483b1f;}})});}_0x3d0178=_[_0x1743('0x36')]({},_0x3d0178,_0x38c3e0[_0x1743('0x39')]);var _0x6ae1ca={'where':_0x3d0178[_0x1743('0x35')]};return db['MailServerOut'][_0x1743('0x17')](_0x6ae1ca)[_0x1743('0x1d')](function(_0xebf468){_0x2df889[_0x1743('0x17')]=_0xebf468;if(_0x38c3e0[_0x1743('0x2a')][_0x1743('0x3a')]){_0x3d0178['include']=[{'all':!![]}];}return db[_0x1743('0x24')]['findAll'](_0x3d0178);})[_0x1743('0x1d')](function(_0x4fa41c){_0x2df889[_0x1743('0x3b')]=_0x4fa41c;return _0x2df889;})[_0x1743('0x1d')](respondWithFilteredResult(_0x50d708,_0x3d0178))['catch'](handleError(_0x50d708,null));};exports['show']=function(_0x543395,_0x18e97a){var _0x470544={'raw':!![],'where':{'id':_0x543395[_0x1743('0x3c')]['id']}},_0x3ebdc1={};_0x3ebdc1[_0x1743('0x28')]=_[_0x1743('0x3d')](db['MailServerOut'][_0x1743('0x3e')]);_0x3ebdc1[_0x1743('0x2a')]=_[_0x1743('0x3d')](_0x543395[_0x1743('0x2a')]);_0x3ebdc1[_0x1743('0x2b')]=_[_0x1743('0x2d')](_0x3ebdc1[_0x1743('0x28')],_0x3ebdc1[_0x1743('0x2a')]);_0x470544[_0x1743('0x2c')]=_[_0x1743('0x2d')](_0x3ebdc1[_0x1743('0x28')],qs[_0x1743('0x2e')](_0x543395['query'][_0x1743('0x2e')]));_0x470544[_0x1743('0x2c')]=_0x470544['attributes'][_0x1743('0x2f')]?_0x470544[_0x1743('0x2c')]:_0x3ebdc1[_0x1743('0x28')];if(_0x543395[_0x1743('0x2a')][_0x1743('0x3a')]){_0x470544[_0x1743('0x3f')]=[{'all':!![]}];}_0x470544=_[_0x1743('0x36')]({},_0x470544,_0x543395[_0x1743('0x39')]);return db['MailServerOut'][_0x1743('0x40')](_0x470544)['then'](handleEntityNotFound(_0x18e97a,null))['then'](respondWithResult(_0x18e97a,null))[_0x1743('0x41')](handleError(_0x18e97a,null));};exports[_0x1743('0x42')]=function(_0x172cdd,_0x2d9212){return db['MailServerOut'][_0x1743('0x42')](_0x172cdd[_0x1743('0x43')],{})['then'](respondWithResult(_0x2d9212,0xc9))[_0x1743('0x41')](handleError(_0x2d9212,null));};exports[_0x1743('0x1c')]=function(_0x56f6b9,_0x538605){if(_0x56f6b9[_0x1743('0x43')]['id']){delete _0x56f6b9[_0x1743('0x43')]['id'];}return db['MailServerOut'][_0x1743('0x40')]({'where':{'id':_0x56f6b9[_0x1743('0x3c')]['id']}})['then'](handleEntityNotFound(_0x538605,null))[_0x1743('0x1d')](saveUpdates(_0x56f6b9[_0x1743('0x43')],null))[_0x1743('0x1d')](respondWithResult(_0x538605,null))[_0x1743('0x41')](handleError(_0x538605,null));};exports[_0x1743('0x1e')]=function(_0x4d1402,_0x2962db){return db[_0x1743('0x24')]['find']({'where':{'id':_0x4d1402[_0x1743('0x3c')]['id']}})[_0x1743('0x1d')](handleEntityNotFound(_0x2962db,null))[_0x1743('0x1d')](removeEntity(_0x2962db,null))[_0x1743('0x41')](handleError(_0x2962db,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 8af1338..bf21733 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 _0x028d=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','util','../../config/logger','api','request-promise','path'];(function(_0x1ddb35,_0x56e0e7){var _0x45b836=function(_0x226c6c){while(--_0x226c6c){_0x1ddb35['push'](_0x1ddb35['shift']());}};_0x45b836(++_0x56e0e7);}(_0x028d,0xc7));var _0xd028=function(_0x299921,_0x309f23){_0x299921=_0x299921-0x0;var _0x1b1975=_0x028d[_0x299921];return _0x1b1975;};'use strict';var _=require('lodash');var util=require(_0xd028('0x0'));var logger=require(_0xd028('0x1'))(_0xd028('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd028('0x3'));var fs=require('fs');var path=require(_0xd028('0x4'));var rimraf=require(_0xd028('0x5'));var config=require(_0xd028('0x6'));var attributes=require(_0xd028('0x7'));module[_0xd028('0x8')]=function(_0x56dd25,_0x321b15){return _0x56dd25[_0xd028('0x9')](_0xd028('0xa'),attributes,{'tableName':_0xd028('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fe1=['util','../../config/logger','moment','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','mail_servers_out','lodash'];(function(_0x260851,_0x5b35a7){var _0x512723=function(_0x473872){while(--_0x473872){_0x260851['push'](_0x260851['shift']());}};_0x512723(++_0x5b35a7);}(_0x1fe1,0xef));var _0x11fe=function(_0x569943,_0x2259cf){_0x569943=_0x569943-0x0;var _0x3d6d1f=_0x1fe1[_0x569943];return _0x3d6d1f;};'use strict';var _=require(_0x11fe('0x0'));var util=require(_0x11fe('0x1'));var logger=require(_0x11fe('0x2'))('api');var moment=require(_0x11fe('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11fe('0x4'));var rimraf=require(_0x11fe('0x5'));var config=require(_0x11fe('0x6'));var attributes=require(_0x11fe('0x7'));module[_0x11fe('0x8')]=function(_0x5db2ae,_0x49837d){return _0x5db2ae['define']('MailServerOut',attributes,{'tableName':_0x11fe('0x9'),'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 406ec80..ecf8005 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x41ae96,_0x4ba70f){var _0x11e6c5=function(_0x7f350e){while(--_0x7f350e){_0x41ae96['push'](_0x41ae96['shift']());}};_0x11e6c5(++_0x4ba70f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x29a578,_0x406599){var _0x1cebfe=function(_0x2cb7da){while(--_0x2cb7da){_0x29a578['push'](_0x29a578['shift']());}};_0x1cebfe(++_0x406599);}(_0xadb5,0xad));var _0x5adb=function(_0x15ab4a,_0x41a0d1){_0x15ab4a=_0x15ab4a-0x0;var _0x5bba6f=_0xadb5[_0x15ab4a];return _0x5bba6f;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 36c6e46..a8b1edc 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 _0x502d=['multer','path','connect-timeout','express','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','create','update','delete','exports'];(function(_0xcb4109,_0x58391d){var _0x1866ae=function(_0x5d6600){while(--_0x5d6600){_0xcb4109['push'](_0xcb4109['shift']());}};_0x1866ae(++_0x58391d);}(_0x502d,0x160));var _0xd502=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x502d[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0xd502('0x0'));var util=require('util');var path=require(_0xd502('0x1'));var timeout=require(_0xd502('0x2'));var express=require(_0xd502('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd502('0x4'));var config=require('../../config/environment');var controller=require(_0xd502('0x5'));router[_0xd502('0x6')]('/',auth['isAuthenticated'](),controller[_0xd502('0x7')]);router[_0xd502('0x6')](_0xd502('0x8'),auth[_0xd502('0x9')](),controller[_0xd502('0xa')]);router[_0xd502('0x6')](_0xd502('0xb'),auth[_0xd502('0x9')](),controller['show']);router['post']('/',auth[_0xd502('0x9')](),controller[_0xd502('0xc')]);router['put'](_0xd502('0xb'),auth[_0xd502('0x9')](),controller[_0xd502('0xd')]);router[_0xd502('0xe')](_0xd502('0xb'),auth[_0xd502('0x9')](),controller['destroy']);module[_0xd502('0xf')]=router; \ No newline at end of file +var _0x5e15=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x372f8b,_0x208633){var _0x53a47e=function(_0x85709f){while(--_0x85709f){_0x372f8b['push'](_0x372f8b['shift']());}};_0x53a47e(++_0x208633);}(_0x5e15,0xf5));var _0x55e1=function(_0x197b96,_0x1c83c2){_0x197b96=_0x197b96-0x0;var _0x2e7889=_0x5e15[_0x197b96];return _0x2e7889;};'use strict';var multer=require(_0x55e1('0x0'));var util=require(_0x55e1('0x1'));var path=require(_0x55e1('0x2'));var timeout=require(_0x55e1('0x3'));var express=require(_0x55e1('0x4'));var router=express[_0x55e1('0x5')]();var fs_extra=require(_0x55e1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x55e1('0x7'));var config=require(_0x55e1('0x8'));var controller=require('./mailSubstatus.controller');router[_0x55e1('0x9')]('/',auth[_0x55e1('0xa')](),controller['index']);router['get'](_0x55e1('0xb'),auth[_0x55e1('0xa')](),controller[_0x55e1('0xc')]);router['get'](_0x55e1('0xd'),auth['isAuthenticated'](),controller[_0x55e1('0xe')]);router[_0x55e1('0xf')]('/',auth[_0x55e1('0xa')](),controller[_0x55e1('0x10')]);router[_0x55e1('0x11')](_0x55e1('0xd'),auth[_0x55e1('0xa')](),controller[_0x55e1('0x12')]);router[_0x55e1('0x13')](_0x55e1('0xd'),auth[_0x55e1('0xa')](),controller['destroy']);module[_0x55e1('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 81cb46e..cf0918d 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 _0x126e=['exports','STRING','name'];(function(_0x30457f,_0x334dcd){var _0x279fc5=function(_0x18d2c2){while(--_0x18d2c2){_0x30457f['push'](_0x30457f['shift']());}};_0x279fc5(++_0x334dcd);}(_0x126e,0x108));var _0xe126=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x126e[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');module[_0xe126('0x0')]={'name':{'type':Sequelize[_0xe126('0x1')],'unique':_0xe126('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe126('0x1')]}}; \ No newline at end of file +var _0x02a7=['exports','STRING'];(function(_0x3f2fea,_0x3c4ea8){var _0x69a4d5=function(_0x223109){while(--_0x223109){_0x3f2fea['push'](_0x3f2fea['shift']());}};_0x69a4d5(++_0x3c4ea8);}(_0x02a7,0x7a));var _0x702a=function(_0x43cc50,_0x3b5e64){_0x43cc50=_0x43cc50-0x0;var _0x25f850=_0x02a7[_0x43cc50];return _0x25f850;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x702a('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 8fb50e4..86dc292 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 _0x0c97=['VIRTUAL','MailSubstatus','includeAll','findAll','rows','show','params','include','options','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x117ece,_0x318b30){var _0x5a9747=function(_0x27b852){while(--_0x27b852){_0x117ece['push'](_0x117ece['shift']());}};_0x5a9747(++_0x318b30);}(_0x0c97,0x176));var _0x70c9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0c97[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x70c9('0x0'));var rimraf=require(_0x70c9('0x1'));var zipdir=require(_0x70c9('0x2'));var jsonpatch=require(_0x70c9('0x3'));var rp=require(_0x70c9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x70c9('0x5'));var util=require('util');var path=require(_0x70c9('0x6'));var sox=require(_0x70c9('0x7'));var csv=require(_0x70c9('0x8'));var ejs=require(_0x70c9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x70c9('0xa'));var jsforce=require(_0x70c9('0xb'));var deskjs=require(_0x70c9('0xc'));var toCsv=require(_0x70c9('0x8'));var querystring=require('querystring');var Papa=require(_0x70c9('0xd'));var Redis=require(_0x70c9('0xe'));var authService=require(_0x70c9('0xf'));var qs=require(_0x70c9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x70c9('0x11'));var utils=require('../../config/utils');var config=require(_0x70c9('0x12'));var licenseUtil=require(_0x70c9('0x13'));var db=require(_0x70c9('0x14'))['db'];function respondWithStatusCode(_0xec6846,_0x573bd7){_0x573bd7=_0x573bd7||0xcc;return function(_0x492095){if(_0x492095){return _0xec6846[_0x70c9('0x15')](_0x573bd7);}return _0xec6846[_0x70c9('0x16')](_0x573bd7)['end']();};}function respondWithResult(_0x580e8f,_0x36f54a){_0x36f54a=_0x36f54a||0xc8;return function(_0xcae43f){if(_0xcae43f){return _0x580e8f[_0x70c9('0x16')](_0x36f54a)[_0x70c9('0x17')](_0xcae43f);}};}function respondWithFilteredResult(_0x3cafab,_0x2fd21f){return function(_0x1ce754){if(_0x1ce754){var _0x1d0fe1=typeof _0x2fd21f['offset']==='undefined'&&typeof _0x2fd21f[_0x70c9('0x18')]==='undefined';var _0x445a15=_0x1ce754[_0x70c9('0x19')];var _0x2329ab=_0x1d0fe1?0x0:_0x2fd21f[_0x70c9('0x1a')];var _0x3029d2=_0x1d0fe1?_0x1ce754[_0x70c9('0x19')]:_0x2fd21f['offset']+_0x2fd21f[_0x70c9('0x18')];var _0x3987c7;if(_0x3029d2>=_0x445a15){_0x3029d2=_0x445a15;_0x3987c7=0xc8;}else{_0x3987c7=0xce;}_0x3cafab['status'](_0x3987c7);return _0x3cafab['set'](_0x70c9('0x1b'),_0x2329ab+'-'+_0x3029d2+'/'+_0x445a15)['json'](_0x1ce754);}return null;};}function patchUpdates(_0x32f6aa){return function(_0x2cbb03){try{jsonpatch[_0x70c9('0x1c')](_0x2cbb03,_0x32f6aa,!![]);}catch(_0x30d7f2){return BPromise[_0x70c9('0x1d')](_0x30d7f2);}return _0x2cbb03[_0x70c9('0x1e')]();};}function saveUpdates(_0x194bd9,_0x10917b){return function(_0x44f3ea){if(_0x44f3ea){return _0x44f3ea[_0x70c9('0x1f')](_0x194bd9)[_0x70c9('0x20')](function(_0x558fa4){return _0x558fa4;});}return null;};}function removeEntity(_0x5783b9,_0x576e89){return function(_0x251bf4){if(_0x251bf4){return _0x251bf4[_0x70c9('0x21')]()[_0x70c9('0x20')](function(){_0x5783b9[_0x70c9('0x16')](0xcc)[_0x70c9('0x22')]();});}};}function handleEntityNotFound(_0x3f8372,_0x1a96b9){return function(_0x57b8b0){if(!_0x57b8b0){_0x3f8372[_0x70c9('0x15')](0x194);}return _0x57b8b0;};}function handleError(_0x52ffb1,_0x24730b){_0x24730b=_0x24730b||0x1f4;return function(_0x303d22){logger[_0x70c9('0x23')](_0x303d22[_0x70c9('0x24')]);if(_0x303d22[_0x70c9('0x25')]){delete _0x303d22[_0x70c9('0x25')];}_0x52ffb1[_0x70c9('0x16')](_0x24730b)[_0x70c9('0x26')](_0x303d22);};}exports['index']=function(_0x439029,_0xb9d4bd){var _0x26db33={},_0x16c593={},_0x309a43={'count':0x0,'rows':[]};var _0x1782a3=_[_0x70c9('0x27')](db['MailSubstatus'][_0x70c9('0x28')],function(_0x2f98c7){return{'name':_0x2f98c7[_0x70c9('0x29')],'type':_0x2f98c7[_0x70c9('0x2a')][_0x70c9('0x2b')]};});_0x16c593[_0x70c9('0x2c')]=_[_0x70c9('0x27')](_0x1782a3,_0x70c9('0x25'));_0x16c593['query']=_[_0x70c9('0x2d')](_0x439029[_0x70c9('0x2e')]);_0x16c593[_0x70c9('0x2f')]=_[_0x70c9('0x30')](_0x16c593[_0x70c9('0x2c')],_0x16c593['query']);_0x26db33[_0x70c9('0x31')]=_[_0x70c9('0x30')](_0x16c593['model'],qs[_0x70c9('0x32')](_0x439029[_0x70c9('0x2e')][_0x70c9('0x32')]));_0x26db33['attributes']=_0x26db33[_0x70c9('0x31')][_0x70c9('0x33')]?_0x26db33['attributes']:_0x16c593[_0x70c9('0x2c')];if(!_0x439029['query'][_0x70c9('0x34')](_0x70c9('0x35'))){_0x26db33[_0x70c9('0x18')]=qs[_0x70c9('0x18')](_0x439029[_0x70c9('0x2e')][_0x70c9('0x18')]);_0x26db33[_0x70c9('0x1a')]=qs[_0x70c9('0x1a')](_0x439029['query'][_0x70c9('0x1a')]);}_0x26db33['order']=qs['sort'](_0x439029['query'][_0x70c9('0x36')]);_0x26db33[_0x70c9('0x37')]=qs[_0x70c9('0x2f')](_['pick'](_0x439029[_0x70c9('0x2e')],_0x16c593['filters']),_0x1782a3);if(_0x439029['query'][_0x70c9('0x38')]){_0x26db33['where']=_[_0x70c9('0x39')](_0x26db33['where'],{'$or':_[_0x70c9('0x27')](_0x1782a3,function(_0x4d7546){if(_0x4d7546['type']!==_0x70c9('0x3a')){var _0xd18fb2={};_0xd18fb2[_0x4d7546[_0x70c9('0x25')]]={'$like':'%'+_0x439029[_0x70c9('0x2e')][_0x70c9('0x38')]+'%'};return _0xd18fb2;}})});}_0x26db33=_[_0x70c9('0x39')]({},_0x26db33,_0x439029['options']);var _0xf822d9={'where':_0x26db33['where']};return db[_0x70c9('0x3b')]['count'](_0xf822d9)[_0x70c9('0x20')](function(_0x388cdb){_0x309a43[_0x70c9('0x19')]=_0x388cdb;if(_0x439029[_0x70c9('0x2e')][_0x70c9('0x3c')]){_0x26db33['include']=[{'all':!![]}];}return db[_0x70c9('0x3b')][_0x70c9('0x3d')](_0x26db33);})['then'](function(_0x180d52){_0x309a43[_0x70c9('0x3e')]=_0x180d52;return _0x309a43;})['then'](respondWithFilteredResult(_0xb9d4bd,_0x26db33))['catch'](handleError(_0xb9d4bd,null));};exports[_0x70c9('0x3f')]=function(_0x16943c,_0xc385d1){var _0x570f32={'raw':!![],'where':{'id':_0x16943c[_0x70c9('0x40')]['id']}},_0x9af37d={};_0x9af37d[_0x70c9('0x2c')]=_[_0x70c9('0x2d')](db[_0x70c9('0x3b')][_0x70c9('0x28')]);_0x9af37d[_0x70c9('0x2e')]=_[_0x70c9('0x2d')](_0x16943c[_0x70c9('0x2e')]);_0x9af37d[_0x70c9('0x2f')]=_['intersection'](_0x9af37d[_0x70c9('0x2c')],_0x9af37d[_0x70c9('0x2e')]);_0x570f32['attributes']=_[_0x70c9('0x30')](_0x9af37d[_0x70c9('0x2c')],qs[_0x70c9('0x32')](_0x16943c[_0x70c9('0x2e')][_0x70c9('0x32')]));_0x570f32['attributes']=_0x570f32[_0x70c9('0x31')][_0x70c9('0x33')]?_0x570f32['attributes']:_0x9af37d['model'];if(_0x16943c[_0x70c9('0x2e')][_0x70c9('0x3c')]){_0x570f32[_0x70c9('0x41')]=[{'all':!![]}];}_0x570f32=_[_0x70c9('0x39')]({},_0x570f32,_0x16943c[_0x70c9('0x42')]);return db[_0x70c9('0x3b')]['find'](_0x570f32)[_0x70c9('0x20')](handleEntityNotFound(_0xc385d1,null))[_0x70c9('0x20')](respondWithResult(_0xc385d1,null))['catch'](handleError(_0xc385d1,null));};exports[_0x70c9('0x43')]=function(_0xb464dd,_0x16aab9){return db['MailSubstatus'][_0x70c9('0x43')](_0xb464dd[_0x70c9('0x44')],{})[_0x70c9('0x20')](respondWithResult(_0x16aab9,0xc9))[_0x70c9('0x45')](handleError(_0x16aab9,null));};exports[_0x70c9('0x1f')]=function(_0x48351c,_0x493f51){if(_0x48351c[_0x70c9('0x44')]['id']){delete _0x48351c[_0x70c9('0x44')]['id'];}return db[_0x70c9('0x3b')][_0x70c9('0x46')]({'where':{'id':_0x48351c[_0x70c9('0x40')]['id']}})[_0x70c9('0x20')](handleEntityNotFound(_0x493f51,null))[_0x70c9('0x20')](saveUpdates(_0x48351c[_0x70c9('0x44')],null))[_0x70c9('0x20')](respondWithResult(_0x493f51,null))['catch'](handleError(_0x493f51,null));};exports[_0x70c9('0x21')]=function(_0x557d2f,_0x3cc242){return db[_0x70c9('0x3b')][_0x70c9('0x46')]({'where':{'id':_0x557d2f[_0x70c9('0x40')]['id']}})[_0x70c9('0x20')](handleEntityNotFound(_0x3cc242,null))[_0x70c9('0x20')](removeEntity(_0x3cc242,null))[_0x70c9('0x45')](handleError(_0x3cc242,null));};exports['describe']=function(_0x489814,_0x1a5afe){return db['MailSubstatus'][_0x70c9('0x47')]()[_0x70c9('0x20')](respondWithResult(_0x1a5afe,null))[_0x70c9('0x45')](handleError(_0x1a5afe,null));}; \ No newline at end of file +var _0xab82=['reject','then','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','show','params','keys','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x32bbe1,_0x9283e){var _0x2cbaa6=function(_0x1a2fe6){while(--_0x1a2fe6){_0x32bbe1['push'](_0x32bbe1['shift']());}};_0x2cbaa6(++_0x9283e);}(_0xab82,0x1e5));var _0x2ab8=function(_0xcac487,_0x420c92){_0xcac487=_0xcac487-0x0;var _0x451ca9=_0xab82[_0xcac487];return _0x451ca9;};'use strict';var emlformat=require(_0x2ab8('0x0'));var rimraf=require(_0x2ab8('0x1'));var zipdir=require(_0x2ab8('0x2'));var jsonpatch=require(_0x2ab8('0x3'));var rp=require(_0x2ab8('0x4'));var moment=require(_0x2ab8('0x5'));var BPromise=require(_0x2ab8('0x6'));var Mustache=require(_0x2ab8('0x7'));var util=require('util');var path=require(_0x2ab8('0x8'));var sox=require('sox');var csv=require(_0x2ab8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ab8('0xa'));var _=require(_0x2ab8('0xb'));var squel=require('squel');var crypto=require(_0x2ab8('0xc'));var jsforce=require(_0x2ab8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2ab8('0x9'));var querystring=require(_0x2ab8('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ab8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ab8('0x10'));var logger=require(_0x2ab8('0x11'))(_0x2ab8('0x12'));var utils=require(_0x2ab8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2ab8('0x14'));var db=require(_0x2ab8('0x15'))['db'];function respondWithStatusCode(_0x423b68,_0x2f233f){_0x2f233f=_0x2f233f||0xcc;return function(_0x500060){if(_0x500060){return _0x423b68[_0x2ab8('0x16')](_0x2f233f);}return _0x423b68[_0x2ab8('0x17')](_0x2f233f)[_0x2ab8('0x18')]();};}function respondWithResult(_0x56ce4b,_0x36754f){_0x36754f=_0x36754f||0xc8;return function(_0x40de90){if(_0x40de90){return _0x56ce4b[_0x2ab8('0x17')](_0x36754f)[_0x2ab8('0x19')](_0x40de90);}};}function respondWithFilteredResult(_0xc88abc,_0x515d37){return function(_0x2d7722){if(_0x2d7722){var _0xba36c4=typeof _0x515d37[_0x2ab8('0x1a')]==='undefined'&&typeof _0x515d37[_0x2ab8('0x1b')]===_0x2ab8('0x1c');var _0x12fb1a=_0x2d7722[_0x2ab8('0x1d')];var _0x2e1213=_0xba36c4?0x0:_0x515d37[_0x2ab8('0x1a')];var _0x692ea6=_0xba36c4?_0x2d7722[_0x2ab8('0x1d')]:_0x515d37[_0x2ab8('0x1a')]+_0x515d37[_0x2ab8('0x1b')];var _0x313e2c;if(_0x692ea6>=_0x12fb1a){_0x692ea6=_0x12fb1a;_0x313e2c=0xc8;}else{_0x313e2c=0xce;}_0xc88abc[_0x2ab8('0x17')](_0x313e2c);return _0xc88abc[_0x2ab8('0x1e')](_0x2ab8('0x1f'),_0x2e1213+'-'+_0x692ea6+'/'+_0x12fb1a)[_0x2ab8('0x19')](_0x2d7722);}return null;};}function patchUpdates(_0x7ad9a1){return function(_0x3d1c36){try{jsonpatch[_0x2ab8('0x20')](_0x3d1c36,_0x7ad9a1,!![]);}catch(_0x152985){return BPromise[_0x2ab8('0x21')](_0x152985);}return _0x3d1c36['save']();};}function saveUpdates(_0x23e83e,_0x425125){return function(_0x506421){if(_0x506421){return _0x506421['update'](_0x23e83e)[_0x2ab8('0x22')](function(_0x4563d2){return _0x4563d2;});}return null;};}function removeEntity(_0x5e2e63,_0x678f51){return function(_0x451700){if(_0x451700){return _0x451700['destroy']()[_0x2ab8('0x22')](function(){_0x5e2e63['status'](0xcc)[_0x2ab8('0x18')]();});}};}function handleEntityNotFound(_0x4bfcf8,_0x441a41){return function(_0x32369e){if(!_0x32369e){_0x4bfcf8[_0x2ab8('0x16')](0x194);}return _0x32369e;};}function handleError(_0x21b604,_0x196faf){_0x196faf=_0x196faf||0x1f4;return function(_0x17ff77){logger[_0x2ab8('0x23')](_0x17ff77[_0x2ab8('0x24')]);if(_0x17ff77['name']){delete _0x17ff77[_0x2ab8('0x25')];}_0x21b604['status'](_0x196faf)[_0x2ab8('0x26')](_0x17ff77);};}exports[_0x2ab8('0x27')]=function(_0x681202,_0x21dd57){var _0x2965ba={},_0x3ed04c={},_0x52d1d6={'count':0x0,'rows':[]};var _0x1593ef=_['map'](db[_0x2ab8('0x28')][_0x2ab8('0x29')],function(_0xdd0024){return{'name':_0xdd0024[_0x2ab8('0x2a')],'type':_0xdd0024[_0x2ab8('0x2b')][_0x2ab8('0x2c')]};});_0x3ed04c[_0x2ab8('0x2d')]=_[_0x2ab8('0x2e')](_0x1593ef,_0x2ab8('0x25'));_0x3ed04c[_0x2ab8('0x2f')]=_['keys'](_0x681202['query']);_0x3ed04c['filters']=_[_0x2ab8('0x30')](_0x3ed04c[_0x2ab8('0x2d')],_0x3ed04c['query']);_0x2965ba[_0x2ab8('0x31')]=_[_0x2ab8('0x30')](_0x3ed04c[_0x2ab8('0x2d')],qs[_0x2ab8('0x32')](_0x681202[_0x2ab8('0x2f')][_0x2ab8('0x32')]));_0x2965ba[_0x2ab8('0x31')]=_0x2965ba[_0x2ab8('0x31')][_0x2ab8('0x33')]?_0x2965ba['attributes']:_0x3ed04c['model'];if(!_0x681202[_0x2ab8('0x2f')]['hasOwnProperty'](_0x2ab8('0x34'))){_0x2965ba[_0x2ab8('0x1b')]=qs[_0x2ab8('0x1b')](_0x681202[_0x2ab8('0x2f')][_0x2ab8('0x1b')]);_0x2965ba['offset']=qs[_0x2ab8('0x1a')](_0x681202[_0x2ab8('0x2f')][_0x2ab8('0x1a')]);}_0x2965ba[_0x2ab8('0x35')]=qs[_0x2ab8('0x36')](_0x681202[_0x2ab8('0x2f')][_0x2ab8('0x36')]);_0x2965ba['where']=qs[_0x2ab8('0x37')](_[_0x2ab8('0x38')](_0x681202[_0x2ab8('0x2f')],_0x3ed04c['filters']),_0x1593ef);if(_0x681202[_0x2ab8('0x2f')]['filter']){_0x2965ba['where']=_[_0x2ab8('0x39')](_0x2965ba['where'],{'$or':_[_0x2ab8('0x2e')](_0x1593ef,function(_0x1b0ef8){if(_0x1b0ef8['type']!==_0x2ab8('0x3a')){var _0x884eb0={};_0x884eb0[_0x1b0ef8['name']]={'$like':'%'+_0x681202[_0x2ab8('0x2f')][_0x2ab8('0x3b')]+'%'};return _0x884eb0;}})});}_0x2965ba=_[_0x2ab8('0x39')]({},_0x2965ba,_0x681202[_0x2ab8('0x3c')]);var _0x35f535={'where':_0x2965ba[_0x2ab8('0x3d')]};return db[_0x2ab8('0x28')][_0x2ab8('0x1d')](_0x35f535)[_0x2ab8('0x22')](function(_0xb8947){_0x52d1d6[_0x2ab8('0x1d')]=_0xb8947;if(_0x681202[_0x2ab8('0x2f')][_0x2ab8('0x3e')]){_0x2965ba[_0x2ab8('0x3f')]=[{'all':!![]}];}return db[_0x2ab8('0x28')][_0x2ab8('0x40')](_0x2965ba);})['then'](function(_0x1efd28){_0x52d1d6['rows']=_0x1efd28;return _0x52d1d6;})[_0x2ab8('0x22')](respondWithFilteredResult(_0x21dd57,_0x2965ba))['catch'](handleError(_0x21dd57,null));};exports[_0x2ab8('0x41')]=function(_0x2c00be,_0x530c4c){var _0x4f8483={'raw':!![],'where':{'id':_0x2c00be[_0x2ab8('0x42')]['id']}},_0x333a56={};_0x333a56[_0x2ab8('0x2d')]=_[_0x2ab8('0x43')](db['MailSubstatus'][_0x2ab8('0x29')]);_0x333a56[_0x2ab8('0x2f')]=_['keys'](_0x2c00be['query']);_0x333a56[_0x2ab8('0x37')]=_['intersection'](_0x333a56[_0x2ab8('0x2d')],_0x333a56[_0x2ab8('0x2f')]);_0x4f8483[_0x2ab8('0x31')]=_[_0x2ab8('0x30')](_0x333a56['model'],qs[_0x2ab8('0x32')](_0x2c00be[_0x2ab8('0x2f')][_0x2ab8('0x32')]));_0x4f8483[_0x2ab8('0x31')]=_0x4f8483[_0x2ab8('0x31')][_0x2ab8('0x33')]?_0x4f8483[_0x2ab8('0x31')]:_0x333a56[_0x2ab8('0x2d')];if(_0x2c00be[_0x2ab8('0x2f')][_0x2ab8('0x3e')]){_0x4f8483[_0x2ab8('0x3f')]=[{'all':!![]}];}_0x4f8483=_[_0x2ab8('0x39')]({},_0x4f8483,_0x2c00be[_0x2ab8('0x3c')]);return db['MailSubstatus'][_0x2ab8('0x44')](_0x4f8483)[_0x2ab8('0x22')](handleEntityNotFound(_0x530c4c,null))[_0x2ab8('0x22')](respondWithResult(_0x530c4c,null))[_0x2ab8('0x45')](handleError(_0x530c4c,null));};exports[_0x2ab8('0x46')]=function(_0x410fcb,_0x5132b3){return db['MailSubstatus'][_0x2ab8('0x46')](_0x410fcb[_0x2ab8('0x47')],{})[_0x2ab8('0x22')](respondWithResult(_0x5132b3,0xc9))[_0x2ab8('0x45')](handleError(_0x5132b3,null));};exports[_0x2ab8('0x48')]=function(_0x67bd1f,_0x42d921){if(_0x67bd1f[_0x2ab8('0x47')]['id']){delete _0x67bd1f[_0x2ab8('0x47')]['id'];}return db[_0x2ab8('0x28')][_0x2ab8('0x44')]({'where':{'id':_0x67bd1f['params']['id']}})['then'](handleEntityNotFound(_0x42d921,null))[_0x2ab8('0x22')](saveUpdates(_0x67bd1f[_0x2ab8('0x47')],null))[_0x2ab8('0x22')](respondWithResult(_0x42d921,null))[_0x2ab8('0x45')](handleError(_0x42d921,null));};exports['destroy']=function(_0x3e0952,_0x4d28d0){return db[_0x2ab8('0x28')][_0x2ab8('0x44')]({'where':{'id':_0x3e0952[_0x2ab8('0x42')]['id']}})[_0x2ab8('0x22')](handleEntityNotFound(_0x4d28d0,null))[_0x2ab8('0x22')](removeEntity(_0x4d28d0,null))[_0x2ab8('0x45')](handleError(_0x4d28d0,null));};exports[_0x2ab8('0x49')]=function(_0x25ff2a,_0x5ac4fd){return db[_0x2ab8('0x28')][_0x2ab8('0x49')]()[_0x2ab8('0x22')](respondWithResult(_0x5ac4fd,null))[_0x2ab8('0x45')](handleError(_0x5ac4fd,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index cd7f642..0d02fd3 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 _0x5f88=['MailSubstatus','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f88,0x86));var _0x85f8=function(_0x5b95d0,_0x28198e){_0x5b95d0=_0x5b95d0-0x0;var _0x5922c9=_0x5f88[_0x5b95d0];return _0x5922c9;};'use strict';var EventEmitter=require(_0x85f8('0x0'));var MailSubstatus=require(_0x85f8('0x1'))['db'][_0x85f8('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x85f8('0x3')};function emitEvent(_0x1258b5){return function(_0xd95926,_0x4e7b96,_0x359397){MailSubstatusEvents[_0x85f8('0x4')](_0x1258b5+':'+_0xd95926['id'],_0xd95926);MailSubstatusEvents[_0x85f8('0x4')](_0x1258b5,_0xd95926);_0x359397(null);};}for(var e in events){if(events[_0x85f8('0x5')](e)){var event=events[e];MailSubstatus[_0x85f8('0x6')](e,emitEvent(event));}}module[_0x85f8('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x39db=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','emit'];(function(_0x35028c,_0x261d79){var _0x59cfff=function(_0x96e669){while(--_0x96e669){_0x35028c['push'](_0x35028c['shift']());}};_0x59cfff(++_0x261d79);}(_0x39db,0x1a0));var _0xb39d=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x39db[_0x2ce6d5];return _0x32d272;};'use strict';var EventEmitter=require(_0xb39d('0x0'));var MailSubstatus=require(_0xb39d('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xb39d('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x453ffb){return function(_0x51ac41,_0x3a1c66,_0xfff0c5){MailSubstatusEvents[_0xb39d('0x3')](_0x453ffb+':'+_0x51ac41['id'],_0x51ac41);MailSubstatusEvents[_0xb39d('0x3')](_0x453ffb,_0x51ac41);_0xfff0c5(null);};}for(var e in events){if(events[_0xb39d('0x4')](e)){var event=events[e];MailSubstatus[_0xb39d('0x5')](e,emitEvent(event));}}module[_0xb39d('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index f810823..a341679 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 _0xb65c=['define','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','models'];(function(_0x58e4bd,_0x190893){var _0x30293a=function(_0x113a55){while(--_0x113a55){_0x58e4bd['push'](_0x58e4bd['shift']());}};_0x30293a(++_0x190893);}(_0xb65c,0xd0));var _0xcb65=function(_0x3ba603,_0x58cb58){_0x3ba603=_0x3ba603-0x0;var _0x1afc1a=_0xb65c[_0x3ba603];return _0x1afc1a;};'use strict';var attributes=require(_0xcb65('0x0'));module['exports']=function(_0x4aa23c){var _0x289797=_0x4aa23c[_0xcb65('0x1')];return _0x4aa23c[_0xcb65('0x2')](_0xcb65('0x3'),attributes,{'tableName':_0xcb65('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x52f72b,_0x14c68d,_0x1fb16c){return _0x289797[_0xcb65('0x5')]['update']({'value':_0x52f72b[_0xcb65('0x6')]},{'where':{'field':_0xcb65('0x7'),'value':_0x52f72b[_0xcb65('0x8')][_0xcb65('0x6')]}})[_0xcb65('0x9')](function(){_0x1fb16c();})['catch'](function(_0x185645){_0x1fb16c(_0x185645);});}}});}; \ No newline at end of file +var _0xab29=['exports','mail_substatuses','Condition','update','mailSubstatus','name','then','catch','./mailSubstatus.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab29,0x11f));var _0x9ab2=function(_0x5a00bb,_0x166203){_0x5a00bb=_0x5a00bb-0x0;var _0x283f1b=_0xab29[_0x5a00bb];return _0x283f1b;};'use strict';var attributes=require(_0x9ab2('0x0'));module[_0x9ab2('0x1')]=function(_0x2bb0a7){var _0x917565=_0x2bb0a7['models'];return _0x2bb0a7['define']('MailSubstatus',attributes,{'tableName':_0x9ab2('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x100107,_0x330ff1,_0x56df21){return _0x917565[_0x9ab2('0x3')][_0x9ab2('0x4')]({'value':_0x100107['name']},{'where':{'field':_0x9ab2('0x5'),'value':_0x100107['_previousDataValues'][_0x9ab2('0x6')]}})[_0x9ab2('0x7')](function(){_0x56df21();})[_0x9ab2('0x8')](function(_0x1e0901){_0x56df21(_0x1e0901);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 19eb1f4..41a5412 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 _0xe752=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','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','message','result','catch','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe752,0xe5));var _0x2e75=function(_0x4b6b9e,_0x26dc60){_0x4b6b9e=_0x4b6b9e-0x0;var _0x40f371=_0xe752[_0x4b6b9e];return _0x40f371;};'use strict';var _=require(_0x2e75('0x0'));var util=require(_0x2e75('0x1'));var moment=require('moment');var BPromise=require(_0x2e75('0x2'));var rs=require(_0x2e75('0x3'));var fs=require('fs');var Redis=require(_0x2e75('0x4'));var db=require(_0x2e75('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e75('0x6'))(_0x2e75('0x7'));var config=require(_0x2e75('0x8'));var jayson=require(_0x2e75('0x9'));var client=jayson[_0x2e75('0xa')][_0x2e75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31ed65,_0x12b5db,_0x51633e){return new BPromise(function(_0x2384d5,_0x3d408){return client['request'](_0x31ed65,_0x51633e)[_0x2e75('0xc')](function(_0x4909d8){logger[_0x2e75('0xd')](_0x2e75('0xe'),_0x12b5db,_0x2e75('0xf'));logger[_0x2e75('0x10')](_0x2e75('0x11'),_0x12b5db,_0x2e75('0xf'),JSON[_0x2e75('0x12')](_0x4909d8));if(_0x4909d8[_0x2e75('0x13')]){if(_0x4909d8[_0x2e75('0x13')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x12b5db,_0x4909d8['error']['message']);return _0x3d408(_0x4909d8[_0x2e75('0x13')][_0x2e75('0x14')]);}logger[_0x2e75('0x13')](_0x2e75('0xe'),_0x12b5db,_0x4909d8[_0x2e75('0x13')][_0x2e75('0x14')]);return _0x2384d5(_0x4909d8[_0x2e75('0x13')][_0x2e75('0x14')]);}else{logger['info'](_0x2e75('0xe'),_0x12b5db,_0x2e75('0xf'));_0x2384d5(_0x4909d8[_0x2e75('0x15')][_0x2e75('0x14')]);}})[_0x2e75('0x16')](function(_0x1e2dc6){logger[_0x2e75('0x13')](_0x2e75('0xe'),_0x12b5db,_0x1e2dc6);_0x3d408(_0x1e2dc6);});});} \ No newline at end of file +var _0x9c78=['request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x1072bc,_0x30a172){var _0x560425=function(_0x1ed639){while(--_0x1ed639){_0x1072bc['push'](_0x1072bc['shift']());}};_0x560425(++_0x30a172);}(_0x9c78,0x8e));var _0x89c7=function(_0x30ba38,_0x1e9066){_0x30ba38=_0x30ba38-0x0;var _0x299dc7=_0x9c78[_0x30ba38];return _0x299dc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x89c7('0x0'));var BPromise=require(_0x89c7('0x1'));var rs=require(_0x89c7('0x2'));var fs=require('fs');var Redis=require(_0x89c7('0x3'));var db=require(_0x89c7('0x4'))['db'];var utils=require(_0x89c7('0x5'));var logger=require('../../config/logger')(_0x89c7('0x6'));var config=require(_0x89c7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x89c7('0x8')][_0x89c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xef08c,_0x2ff412,_0x349575){return new BPromise(function(_0x4cbb5f,_0x1f2746){return client[_0x89c7('0xa')](_0xef08c,_0x349575)[_0x89c7('0xb')](function(_0x4ecf22){logger['info'](_0x89c7('0xc'),_0x2ff412,_0x89c7('0xd'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2ff412,_0x89c7('0xd'),JSON[_0x89c7('0xe')](_0x4ecf22));if(_0x4ecf22['error']){if(_0x4ecf22[_0x89c7('0xf')][_0x89c7('0x10')]===0x1f4){logger[_0x89c7('0xf')](_0x89c7('0xc'),_0x2ff412,_0x4ecf22[_0x89c7('0xf')][_0x89c7('0x11')]);return _0x1f2746(_0x4ecf22[_0x89c7('0xf')][_0x89c7('0x11')]);}logger['error'](_0x89c7('0xc'),_0x2ff412,_0x4ecf22['error'][_0x89c7('0x11')]);return _0x4cbb5f(_0x4ecf22[_0x89c7('0xf')][_0x89c7('0x11')]);}else{logger['info'](_0x89c7('0xc'),_0x2ff412,_0x89c7('0xd'));_0x4cbb5f(_0x4ecf22['result']['message']);}})[_0x89c7('0x12')](function(_0x24d26c){logger[_0x89c7('0xf')](_0x89c7('0xc'),_0x2ff412,_0x24d26c);_0x1f2746(_0x24d26c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 6e2c464..71a5fb2 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 _0x19c7=['post','create','put','/:id','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','index','isAuthenticated','describe','show'];(function(_0x237350,_0x2868aa){var _0x4308da=function(_0x4613d0){while(--_0x4613d0){_0x237350['push'](_0x237350['shift']());}};_0x4308da(++_0x2868aa);}(_0x19c7,0xc5));var _0x719c=function(_0x529e99,_0x5226af){_0x529e99=_0x529e99-0x0;var _0x109947=_0x19c7[_0x529e99];return _0x109947;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x719c('0x0'));var timeout=require(_0x719c('0x1'));var express=require('express');var router=express[_0x719c('0x2')]();var fs_extra=require(_0x719c('0x3'));var auth=require(_0x719c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x719c('0x5'));var controller=require(_0x719c('0x6'));router[_0x719c('0x7')]('/',auth['isAuthenticated'](),controller[_0x719c('0x8')]);router['get']('/describe',auth[_0x719c('0x9')](),controller[_0x719c('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x719c('0xb')]);router[_0x719c('0xc')]('/',auth[_0x719c('0x9')](),controller[_0x719c('0xd')]);router[_0x719c('0xe')](_0x719c('0xf'),auth[_0x719c('0x9')](),controller[_0x719c('0x10')]);router[_0x719c('0x11')](_0x719c('0xf'),auth['isAuthenticated'](),controller[_0x719c('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd117=['put','update','delete','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x56b50b,_0x3a4889){var _0x44f167=function(_0x5a1c75){while(--_0x5a1c75){_0x56b50b['push'](_0x56b50b['shift']());}};_0x44f167(++_0x3a4889);}(_0xd117,0x1d2));var _0x7d11=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0xd117[_0x580d0e];return _0xb51111;};'use strict';var multer=require(_0x7d11('0x0'));var util=require('util');var path=require(_0x7d11('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d11('0x2'));var router=express['Router']();var fs_extra=require(_0x7d11('0x3'));var auth=require(_0x7d11('0x4'));var interaction=require(_0x7d11('0x5'));var config=require(_0x7d11('0x6'));var controller=require(_0x7d11('0x7'));router['get']('/',auth[_0x7d11('0x8')](),controller[_0x7d11('0x9')]);router[_0x7d11('0xa')](_0x7d11('0xb'),auth[_0x7d11('0x8')](),controller[_0x7d11('0xc')]);router[_0x7d11('0xa')](_0x7d11('0xd'),auth['isAuthenticated'](),controller[_0x7d11('0xe')]);router[_0x7d11('0xf')]('/',auth[_0x7d11('0x8')](),controller[_0x7d11('0x10')]);router[_0x7d11('0x11')](_0x7d11('0xd'),auth[_0x7d11('0x8')](),controller[_0x7d11('0x12')]);router[_0x7d11('0x13')](_0x7d11('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x7d11('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 540092c..a6fa646 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3746fe,_0x30b6b0){var _0xb3093d=function(_0x424b01){while(--_0x424b01){_0x3746fe['push'](_0x3746fe['shift']());}};_0xb3093d(++_0x30b6b0);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x628bc4,_0x4c0a0a){var _0x15f284=function(_0x3a298f){while(--_0x3a298f){_0x628bc4['push'](_0x628bc4['shift']());}};_0x15f284(++_0x4c0a0a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x00bb[_0x47e7cb];return _0x2a8874;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 0103bff..ada1068 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 _0x6b89=['limit','count','set','apply','save','update','then','destroy','end','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','merge','map','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x502ef5,_0x261cfc){var _0x2a98a1=function(_0x40f890){while(--_0x40f890){_0x502ef5['push'](_0x502ef5['shift']());}};_0x2a98a1(++_0x261cfc);}(_0x6b89,0xc8));var _0x96b8=function(_0xc13fb7,_0x441dec){_0xc13fb7=_0xc13fb7-0x0;var _0x26eec1=_0x6b89[_0xc13fb7];return _0x26eec1;};'use strict';var emlformat=require(_0x96b8('0x0'));var rimraf=require(_0x96b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96b8('0x2'));var rp=require('request-promise');var moment=require(_0x96b8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x96b8('0x4'));var util=require(_0x96b8('0x5'));var path=require('path');var sox=require(_0x96b8('0x6'));var csv=require(_0x96b8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96b8('0x8'));var _=require('lodash');var squel=require(_0x96b8('0x9'));var crypto=require(_0x96b8('0xa'));var jsforce=require(_0x96b8('0xb'));var deskjs=require(_0x96b8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x96b8('0xd'));var Papa=require('papaparse');var Redis=require(_0x96b8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x96b8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96b8('0x10'));var logger=require(_0x96b8('0x11'))(_0x96b8('0x12'));var utils=require(_0x96b8('0x13'));var config=require(_0x96b8('0x14'));var licenseUtil=require(_0x96b8('0x15'));var db=require(_0x96b8('0x16'))['db'];function respondWithStatusCode(_0x1a7995,_0x9130b0){_0x9130b0=_0x9130b0||0xcc;return function(_0x170ef0){if(_0x170ef0){return _0x1a7995[_0x96b8('0x17')](_0x9130b0);}return _0x1a7995[_0x96b8('0x18')](_0x9130b0)['end']();};}function respondWithResult(_0x51a077,_0x439c8c){_0x439c8c=_0x439c8c||0xc8;return function(_0x400f52){if(_0x400f52){return _0x51a077[_0x96b8('0x18')](_0x439c8c)[_0x96b8('0x19')](_0x400f52);}};}function respondWithFilteredResult(_0x98faeb,_0x11288c){return function(_0x54901e){if(_0x54901e){var _0x3db508=typeof _0x11288c[_0x96b8('0x1a')]===_0x96b8('0x1b')&&typeof _0x11288c[_0x96b8('0x1c')]===_0x96b8('0x1b');var _0x271aa5=_0x54901e[_0x96b8('0x1d')];var _0x37d161=_0x3db508?0x0:_0x11288c[_0x96b8('0x1a')];var _0x1556b6=_0x3db508?_0x54901e['count']:_0x11288c[_0x96b8('0x1a')]+_0x11288c[_0x96b8('0x1c')];var _0x219031;if(_0x1556b6>=_0x271aa5){_0x1556b6=_0x271aa5;_0x219031=0xc8;}else{_0x219031=0xce;}_0x98faeb[_0x96b8('0x18')](_0x219031);return _0x98faeb[_0x96b8('0x1e')]('Content-Range',_0x37d161+'-'+_0x1556b6+'/'+_0x271aa5)[_0x96b8('0x19')](_0x54901e);}return null;};}function patchUpdates(_0x31673d){return function(_0x55d081){try{jsonpatch[_0x96b8('0x1f')](_0x55d081,_0x31673d,!![]);}catch(_0x4a5b04){return BPromise['reject'](_0x4a5b04);}return _0x55d081[_0x96b8('0x20')]();};}function saveUpdates(_0x2e5c96,_0x210a07){return function(_0x379d27){if(_0x379d27){return _0x379d27[_0x96b8('0x21')](_0x2e5c96)[_0x96b8('0x22')](function(_0xeeff11){return _0xeeff11;});}return null;};}function removeEntity(_0xa24100,_0x25f32b){return function(_0x103719){if(_0x103719){return _0x103719[_0x96b8('0x23')]()[_0x96b8('0x22')](function(){_0xa24100[_0x96b8('0x18')](0xcc)[_0x96b8('0x24')]();});}};}function handleEntityNotFound(_0x3ce84e,_0x47311b){return function(_0x572f55){if(!_0x572f55){_0x3ce84e['sendStatus'](0x194);}return _0x572f55;};}function handleError(_0x53bcd,_0x4598bf){_0x4598bf=_0x4598bf||0x1f4;return function(_0x4cec37){logger[_0x96b8('0x25')](_0x4cec37[_0x96b8('0x26')]);if(_0x4cec37[_0x96b8('0x27')]){delete _0x4cec37['name'];}_0x53bcd[_0x96b8('0x18')](_0x4598bf)[_0x96b8('0x28')](_0x4cec37);};}exports[_0x96b8('0x29')]=function(_0x1a16ca,_0x7df3d8){var _0x5b5fe3={},_0x2f4d74={},_0x322800={'count':0x0,'rows':[]};var _0x3596e5=_['map'](db[_0x96b8('0x2a')][_0x96b8('0x2b')],function(_0x4c248a){return{'name':_0x4c248a[_0x96b8('0x2c')],'type':_0x4c248a[_0x96b8('0x2d')][_0x96b8('0x2e')]};});_0x2f4d74[_0x96b8('0x2f')]=_['map'](_0x3596e5,'name');_0x2f4d74[_0x96b8('0x30')]=_[_0x96b8('0x31')](_0x1a16ca[_0x96b8('0x30')]);_0x2f4d74['filters']=_[_0x96b8('0x32')](_0x2f4d74[_0x96b8('0x2f')],_0x2f4d74['query']);_0x5b5fe3[_0x96b8('0x33')]=_[_0x96b8('0x32')](_0x2f4d74[_0x96b8('0x2f')],qs[_0x96b8('0x34')](_0x1a16ca['query'][_0x96b8('0x34')]));_0x5b5fe3[_0x96b8('0x33')]=_0x5b5fe3[_0x96b8('0x33')]['length']?_0x5b5fe3[_0x96b8('0x33')]:_0x2f4d74[_0x96b8('0x2f')];if(!_0x1a16ca[_0x96b8('0x30')][_0x96b8('0x35')]('nolimit')){_0x5b5fe3[_0x96b8('0x1c')]=qs['limit'](_0x1a16ca[_0x96b8('0x30')]['limit']);_0x5b5fe3[_0x96b8('0x1a')]=qs['offset'](_0x1a16ca['query'][_0x96b8('0x1a')]);}_0x5b5fe3[_0x96b8('0x36')]=qs[_0x96b8('0x37')](_0x1a16ca[_0x96b8('0x30')][_0x96b8('0x37')]);_0x5b5fe3['where']=qs[_0x96b8('0x38')](_[_0x96b8('0x39')](_0x1a16ca[_0x96b8('0x30')],_0x2f4d74[_0x96b8('0x38')]),_0x3596e5);if(_0x1a16ca[_0x96b8('0x30')]['filter']){_0x5b5fe3['where']=_[_0x96b8('0x3a')](_0x5b5fe3['where'],{'$or':_[_0x96b8('0x3b')](_0x3596e5,function(_0x5011d9){if(_0x5011d9['type']!==_0x96b8('0x3c')){var _0x51341d={};_0x51341d[_0x5011d9[_0x96b8('0x27')]]={'$like':'%'+_0x1a16ca[_0x96b8('0x30')][_0x96b8('0x3d')]+'%'};return _0x51341d;}})});}_0x5b5fe3=_[_0x96b8('0x3a')]({},_0x5b5fe3,_0x1a16ca[_0x96b8('0x3e')]);var _0x3d0edc={'where':_0x5b5fe3[_0x96b8('0x3f')]};return db[_0x96b8('0x2a')][_0x96b8('0x1d')](_0x3d0edc)[_0x96b8('0x22')](function(_0x3a8519){_0x322800['count']=_0x3a8519;if(_0x1a16ca[_0x96b8('0x30')][_0x96b8('0x40')]){_0x5b5fe3[_0x96b8('0x41')]=[{'all':!![]}];}return db[_0x96b8('0x2a')][_0x96b8('0x42')](_0x5b5fe3);})['then'](function(_0x1052f2){_0x322800[_0x96b8('0x43')]=_0x1052f2;return _0x322800;})[_0x96b8('0x22')](respondWithFilteredResult(_0x7df3d8,_0x5b5fe3))[_0x96b8('0x44')](handleError(_0x7df3d8,null));};exports[_0x96b8('0x45')]=function(_0x6f2df4,_0x4bf49d){var _0x4dbf20={'raw':!![],'where':{'id':_0x6f2df4[_0x96b8('0x46')]['id']}},_0x24a085={};_0x24a085[_0x96b8('0x2f')]=_['keys'](db[_0x96b8('0x2a')][_0x96b8('0x2b')]);_0x24a085[_0x96b8('0x30')]=_[_0x96b8('0x31')](_0x6f2df4[_0x96b8('0x30')]);_0x24a085[_0x96b8('0x38')]=_[_0x96b8('0x32')](_0x24a085['model'],_0x24a085[_0x96b8('0x30')]);_0x4dbf20[_0x96b8('0x33')]=_[_0x96b8('0x32')](_0x24a085['model'],qs['fields'](_0x6f2df4[_0x96b8('0x30')][_0x96b8('0x34')]));_0x4dbf20[_0x96b8('0x33')]=_0x4dbf20['attributes'][_0x96b8('0x47')]?_0x4dbf20['attributes']:_0x24a085[_0x96b8('0x2f')];if(_0x6f2df4['query'][_0x96b8('0x40')]){_0x4dbf20[_0x96b8('0x41')]=[{'all':!![]}];}_0x4dbf20=_[_0x96b8('0x3a')]({},_0x4dbf20,_0x6f2df4[_0x96b8('0x3e')]);return db[_0x96b8('0x2a')][_0x96b8('0x48')](_0x4dbf20)[_0x96b8('0x22')](handleEntityNotFound(_0x4bf49d,null))[_0x96b8('0x22')](respondWithResult(_0x4bf49d,null))[_0x96b8('0x44')](handleError(_0x4bf49d,null));};exports[_0x96b8('0x49')]=function(_0x1e6cd9,_0x42d669){return db['MailTransferReport']['create'](_0x1e6cd9[_0x96b8('0x4a')],{})[_0x96b8('0x22')](respondWithResult(_0x42d669,0xc9))[_0x96b8('0x44')](handleError(_0x42d669,null));};exports[_0x96b8('0x21')]=function(_0x35699b,_0x48a194){if(_0x35699b[_0x96b8('0x4a')]['id']){delete _0x35699b[_0x96b8('0x4a')]['id'];}return db[_0x96b8('0x2a')][_0x96b8('0x48')]({'where':{'id':_0x35699b[_0x96b8('0x46')]['id']}})[_0x96b8('0x22')](handleEntityNotFound(_0x48a194,null))['then'](saveUpdates(_0x35699b[_0x96b8('0x4a')],null))[_0x96b8('0x22')](respondWithResult(_0x48a194,null))[_0x96b8('0x44')](handleError(_0x48a194,null));};exports['destroy']=function(_0x47b290,_0x5ed1d8){return db[_0x96b8('0x2a')][_0x96b8('0x48')]({'where':{'id':_0x47b290['params']['id']}})[_0x96b8('0x22')](handleEntityNotFound(_0x5ed1d8,null))[_0x96b8('0x22')](removeEntity(_0x5ed1d8,null))[_0x96b8('0x44')](handleError(_0x5ed1d8,null));};exports['describe']=function(_0x24f40e,_0x13305e){return db[_0x96b8('0x2a')][_0x96b8('0x4b')]()[_0x96b8('0x22')](respondWithResult(_0x13305e,null))[_0x96b8('0x44')](handleError(_0x13305e,null));}; \ No newline at end of file +var _0x4d32=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','map','MailTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','type','name','merge','options','includeAll','include','rows','show','params','find','catch','create','body'];(function(_0x1834b6,_0x3d3fd6){var _0x10e77f=function(_0x8b75ac){while(--_0x8b75ac){_0x1834b6['push'](_0x1834b6['shift']());}};_0x10e77f(++_0x3d3fd6);}(_0x4d32,0x12d));var _0x24d3=function(_0x447b00,_0x44800a){_0x447b00=_0x447b00-0x0;var _0x315e68=_0x4d32[_0x447b00];return _0x315e68;};'use strict';var emlformat=require(_0x24d3('0x0'));var rimraf=require(_0x24d3('0x1'));var zipdir=require(_0x24d3('0x2'));var jsonpatch=require(_0x24d3('0x3'));var rp=require(_0x24d3('0x4'));var moment=require(_0x24d3('0x5'));var BPromise=require(_0x24d3('0x6'));var Mustache=require('mustache');var util=require(_0x24d3('0x7'));var path=require(_0x24d3('0x8'));var sox=require('sox');var csv=require(_0x24d3('0x9'));var ejs=require(_0x24d3('0xa'));var fs=require('fs');var fs_extra=require(_0x24d3('0xb'));var _=require(_0x24d3('0xc'));var squel=require(_0x24d3('0xd'));var crypto=require('crypto');var jsforce=require(_0x24d3('0xe'));var deskjs=require(_0x24d3('0xf'));var toCsv=require(_0x24d3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x24d3('0x10'));var authService=require(_0x24d3('0x11'));var qs=require(_0x24d3('0x12'));var as=require(_0x24d3('0x13'));var hardwareService=require(_0x24d3('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x24d3('0x15'));var config=require(_0x24d3('0x16'));var licenseUtil=require(_0x24d3('0x17'));var db=require(_0x24d3('0x18'))['db'];function respondWithStatusCode(_0x109f33,_0x575c96){_0x575c96=_0x575c96||0xcc;return function(_0x571306){if(_0x571306){return _0x109f33['sendStatus'](_0x575c96);}return _0x109f33[_0x24d3('0x19')](_0x575c96)[_0x24d3('0x1a')]();};}function respondWithResult(_0x537db7,_0x77ca52){_0x77ca52=_0x77ca52||0xc8;return function(_0x3eb4fe){if(_0x3eb4fe){return _0x537db7['status'](_0x77ca52)[_0x24d3('0x1b')](_0x3eb4fe);}};}function respondWithFilteredResult(_0x4682f1,_0x585b16){return function(_0x50709a){if(_0x50709a){var _0x2af132=typeof _0x585b16[_0x24d3('0x1c')]===_0x24d3('0x1d')&&typeof _0x585b16[_0x24d3('0x1e')]===_0x24d3('0x1d');var _0x1dc063=_0x50709a[_0x24d3('0x1f')];var _0x1882f2=_0x2af132?0x0:_0x585b16[_0x24d3('0x1c')];var _0x5f14bc=_0x2af132?_0x50709a[_0x24d3('0x1f')]:_0x585b16[_0x24d3('0x1c')]+_0x585b16[_0x24d3('0x1e')];var _0x7344f;if(_0x5f14bc>=_0x1dc063){_0x5f14bc=_0x1dc063;_0x7344f=0xc8;}else{_0x7344f=0xce;}_0x4682f1[_0x24d3('0x19')](_0x7344f);return _0x4682f1['set'](_0x24d3('0x20'),_0x1882f2+'-'+_0x5f14bc+'/'+_0x1dc063)[_0x24d3('0x1b')](_0x50709a);}return null;};}function patchUpdates(_0x48e5f8){return function(_0x4bcff7){try{jsonpatch[_0x24d3('0x21')](_0x4bcff7,_0x48e5f8,!![]);}catch(_0x302636){return BPromise[_0x24d3('0x22')](_0x302636);}return _0x4bcff7[_0x24d3('0x23')]();};}function saveUpdates(_0x142599,_0x5f17ad){return function(_0x497f47){if(_0x497f47){return _0x497f47[_0x24d3('0x24')](_0x142599)[_0x24d3('0x25')](function(_0x43bdc4){return _0x43bdc4;});}return null;};}function removeEntity(_0x1fcea7,_0x40d2db){return function(_0x12b1e8){if(_0x12b1e8){return _0x12b1e8[_0x24d3('0x26')]()[_0x24d3('0x25')](function(){_0x1fcea7['status'](0xcc)[_0x24d3('0x1a')]();});}};}function handleEntityNotFound(_0x4555e2,_0x179080){return function(_0x1d44c7){if(!_0x1d44c7){_0x4555e2[_0x24d3('0x27')](0x194);}return _0x1d44c7;};}function handleError(_0x199d8b,_0x181988){_0x181988=_0x181988||0x1f4;return function(_0x17532a){logger[_0x24d3('0x28')](_0x17532a[_0x24d3('0x29')]);if(_0x17532a['name']){delete _0x17532a['name'];}_0x199d8b['status'](_0x181988)[_0x24d3('0x2a')](_0x17532a);};}exports['index']=function(_0x5664c6,_0x448519){var _0x1ef721={},_0x45ba33={},_0x1a65a5={'count':0x0,'rows':[]};var _0x53a9e7=_[_0x24d3('0x2b')](db[_0x24d3('0x2c')][_0x24d3('0x2d')],function(_0xc3ed64){return{'name':_0xc3ed64[_0x24d3('0x2e')],'type':_0xc3ed64['type'][_0x24d3('0x2f')]};});_0x45ba33[_0x24d3('0x30')]=_[_0x24d3('0x2b')](_0x53a9e7,'name');_0x45ba33[_0x24d3('0x31')]=_[_0x24d3('0x32')](_0x5664c6[_0x24d3('0x31')]);_0x45ba33['filters']=_[_0x24d3('0x33')](_0x45ba33['model'],_0x45ba33[_0x24d3('0x31')]);_0x1ef721['attributes']=_[_0x24d3('0x33')](_0x45ba33['model'],qs[_0x24d3('0x34')](_0x5664c6[_0x24d3('0x31')][_0x24d3('0x34')]));_0x1ef721[_0x24d3('0x35')]=_0x1ef721[_0x24d3('0x35')][_0x24d3('0x36')]?_0x1ef721[_0x24d3('0x35')]:_0x45ba33[_0x24d3('0x30')];if(!_0x5664c6[_0x24d3('0x31')]['hasOwnProperty'](_0x24d3('0x37'))){_0x1ef721[_0x24d3('0x1e')]=qs['limit'](_0x5664c6[_0x24d3('0x31')][_0x24d3('0x1e')]);_0x1ef721['offset']=qs[_0x24d3('0x1c')](_0x5664c6[_0x24d3('0x31')][_0x24d3('0x1c')]);}_0x1ef721['order']=qs['sort'](_0x5664c6['query'][_0x24d3('0x38')]);_0x1ef721[_0x24d3('0x39')]=qs[_0x24d3('0x3a')](_[_0x24d3('0x3b')](_0x5664c6[_0x24d3('0x31')],_0x45ba33[_0x24d3('0x3a')]),_0x53a9e7);if(_0x5664c6[_0x24d3('0x31')][_0x24d3('0x3c')]){_0x1ef721[_0x24d3('0x39')]=_['merge'](_0x1ef721['where'],{'$or':_[_0x24d3('0x2b')](_0x53a9e7,function(_0x3b8e04){if(_0x3b8e04[_0x24d3('0x3d')]!=='VIRTUAL'){var _0x5c0562={};_0x5c0562[_0x3b8e04[_0x24d3('0x3e')]]={'$like':'%'+_0x5664c6[_0x24d3('0x31')][_0x24d3('0x3c')]+'%'};return _0x5c0562;}})});}_0x1ef721=_[_0x24d3('0x3f')]({},_0x1ef721,_0x5664c6[_0x24d3('0x40')]);var _0x32fe5c={'where':_0x1ef721[_0x24d3('0x39')]};return db['MailTransferReport']['count'](_0x32fe5c)[_0x24d3('0x25')](function(_0x3ae547){_0x1a65a5[_0x24d3('0x1f')]=_0x3ae547;if(_0x5664c6[_0x24d3('0x31')][_0x24d3('0x41')]){_0x1ef721[_0x24d3('0x42')]=[{'all':!![]}];}return db[_0x24d3('0x2c')]['findAll'](_0x1ef721);})[_0x24d3('0x25')](function(_0x34c1b8){_0x1a65a5[_0x24d3('0x43')]=_0x34c1b8;return _0x1a65a5;})[_0x24d3('0x25')](respondWithFilteredResult(_0x448519,_0x1ef721))['catch'](handleError(_0x448519,null));};exports[_0x24d3('0x44')]=function(_0x4cd5ca,_0x537f74){var _0x3954fd={'raw':!![],'where':{'id':_0x4cd5ca[_0x24d3('0x45')]['id']}},_0x5870b7={};_0x5870b7[_0x24d3('0x30')]=_[_0x24d3('0x32')](db[_0x24d3('0x2c')][_0x24d3('0x2d')]);_0x5870b7[_0x24d3('0x31')]=_[_0x24d3('0x32')](_0x4cd5ca[_0x24d3('0x31')]);_0x5870b7[_0x24d3('0x3a')]=_[_0x24d3('0x33')](_0x5870b7['model'],_0x5870b7['query']);_0x3954fd[_0x24d3('0x35')]=_[_0x24d3('0x33')](_0x5870b7[_0x24d3('0x30')],qs[_0x24d3('0x34')](_0x4cd5ca['query'][_0x24d3('0x34')]));_0x3954fd[_0x24d3('0x35')]=_0x3954fd[_0x24d3('0x35')][_0x24d3('0x36')]?_0x3954fd[_0x24d3('0x35')]:_0x5870b7[_0x24d3('0x30')];if(_0x4cd5ca['query']['includeAll']){_0x3954fd[_0x24d3('0x42')]=[{'all':!![]}];}_0x3954fd=_[_0x24d3('0x3f')]({},_0x3954fd,_0x4cd5ca[_0x24d3('0x40')]);return db['MailTransferReport'][_0x24d3('0x46')](_0x3954fd)[_0x24d3('0x25')](handleEntityNotFound(_0x537f74,null))[_0x24d3('0x25')](respondWithResult(_0x537f74,null))[_0x24d3('0x47')](handleError(_0x537f74,null));};exports[_0x24d3('0x48')]=function(_0xf717d4,_0x4d78b6){return db[_0x24d3('0x2c')][_0x24d3('0x48')](_0xf717d4[_0x24d3('0x49')],{})['then'](respondWithResult(_0x4d78b6,0xc9))[_0x24d3('0x47')](handleError(_0x4d78b6,null));};exports['update']=function(_0x1bfd6e,_0x56e638){if(_0x1bfd6e[_0x24d3('0x49')]['id']){delete _0x1bfd6e[_0x24d3('0x49')]['id'];}return db[_0x24d3('0x2c')]['find']({'where':{'id':_0x1bfd6e[_0x24d3('0x45')]['id']}})[_0x24d3('0x25')](handleEntityNotFound(_0x56e638,null))['then'](saveUpdates(_0x1bfd6e['body'],null))['then'](respondWithResult(_0x56e638,null))['catch'](handleError(_0x56e638,null));};exports['destroy']=function(_0x2712b5,_0x330b19){return db[_0x24d3('0x2c')][_0x24d3('0x46')]({'where':{'id':_0x2712b5[_0x24d3('0x45')]['id']}})[_0x24d3('0x25')](handleEntityNotFound(_0x330b19,null))['then'](removeEntity(_0x330b19,null))[_0x24d3('0x47')](handleError(_0x330b19,null));};exports['describe']=function(_0x21a599,_0x3a2553){return db[_0x24d3('0x2c')][_0x24d3('0x4a')]()[_0x24d3('0x25')](respondWithResult(_0x3a2553,null))[_0x24d3('0x47')](handleError(_0x3a2553,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f8778f0..a65e8c9 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 _0x35c8=['api','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x29b1ac,_0x53503a){var _0x5a8b5d=function(_0x2ece43){while(--_0x2ece43){_0x29b1ac['push'](_0x29b1ac['shift']());}};_0x5a8b5d(++_0x53503a);}(_0x35c8,0xa6));var _0x835c=function(_0x4214f0,_0x184b4e){_0x4214f0=_0x4214f0-0x0;var _0x42ea28=_0x35c8[_0x4214f0];return _0x42ea28;};'use strict';var _=require(_0x835c('0x0'));var util=require(_0x835c('0x1'));var logger=require(_0x835c('0x2'))(_0x835c('0x3'));var moment=require(_0x835c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x835c('0x5'));var rimraf=require(_0x835c('0x6'));var config=require(_0x835c('0x7'));var attributes=require(_0x835c('0x8'));module[_0x835c('0x9')]=function(_0x3c3f2f,_0x37b9ce){return _0x3c3f2f[_0x835c('0xa')]('MailTransferReport',attributes,{'tableName':_0x835c('0xb'),'paranoid':![],'indexes':[{'name':_0x835c('0xc'),'fields':[_0x835c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc305=['MailTransferReport','report_mail_transfer','uniqueid','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define'];(function(_0x1c65d3,_0x4b90ed){var _0x1e8954=function(_0x38d771){while(--_0x38d771){_0x1c65d3['push'](_0x1c65d3['shift']());}};_0x1e8954(++_0x4b90ed);}(_0xc305,0xcf));var _0x5c30=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0xc305[_0x1d2bc8];return _0x1857e1;};'use strict';var _=require(_0x5c30('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5c30('0x1'));var moment=require(_0x5c30('0x2'));var BPromise=require('bluebird');var rp=require(_0x5c30('0x3'));var fs=require('fs');var path=require(_0x5c30('0x4'));var rimraf=require(_0x5c30('0x5'));var config=require(_0x5c30('0x6'));var attributes=require(_0x5c30('0x7'));module['exports']=function(_0x311c48,_0x295b5b){return _0x311c48[_0x5c30('0x8')](_0x5c30('0x9'),attributes,{'tableName':_0x5c30('0xa'),'paranoid':![],'indexes':[{'name':_0x5c30('0xb'),'fields':[_0x5c30('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 39091d1..0737b82 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 _0x0124=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x5b04dd,_0x4ecc60){var _0x8185f1=function(_0xc14407){while(--_0xc14407){_0x5b04dd['push'](_0x5b04dd['shift']());}};_0x8185f1(++_0x4ecc60);}(_0x0124,0x168));var _0x4012=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x0124[_0x438fe1];return _0x3c8e1b;};'use strict';var _=require('lodash');var util=require(_0x4012('0x0'));var moment=require(_0x4012('0x1'));var BPromise=require(_0x4012('0x2'));var rs=require(_0x4012('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4012('0x4'));var logger=require(_0x4012('0x5'))(_0x4012('0x6'));var config=require(_0x4012('0x7'));var jayson=require(_0x4012('0x8'));var client=jayson[_0x4012('0x9')][_0x4012('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x336759,_0xfe4f6e,_0x252047){return new BPromise(function(_0x5296fd,_0x2fd5b7){return client[_0x4012('0xb')](_0x336759,_0x252047)['then'](function(_0x3d58be){logger['info'](_0x4012('0xc'),_0xfe4f6e,_0x4012('0xd'));logger[_0x4012('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xfe4f6e,_0x4012('0xd'),JSON['stringify'](_0x3d58be));if(_0x3d58be[_0x4012('0xf')]){if(_0x3d58be[_0x4012('0xf')][_0x4012('0x10')]===0x1f4){logger[_0x4012('0xf')](_0x4012('0xc'),_0xfe4f6e,_0x3d58be[_0x4012('0xf')][_0x4012('0x11')]);return _0x2fd5b7(_0x3d58be['error']['message']);}logger[_0x4012('0xf')](_0x4012('0xc'),_0xfe4f6e,_0x3d58be[_0x4012('0xf')][_0x4012('0x11')]);return _0x5296fd(_0x3d58be['error'][_0x4012('0x11')]);}else{logger['info'](_0x4012('0xc'),_0xfe4f6e,_0x4012('0xd'));_0x5296fd(_0x3d58be[_0x4012('0x12')][_0x4012('0x11')]);}})[_0x4012('0x13')](function(_0x2a6bb3){logger[_0x4012('0xf')](_0x4012('0xc'),_0xfe4f6e,_0x2a6bb3);_0x2fd5b7(_0x2a6bb3);});});} \ No newline at end of file +var _0x36d2=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x3d61c6,_0x4571e6){var _0x47e0df=function(_0x25adfd){while(--_0x25adfd){_0x3d61c6['push'](_0x3d61c6['shift']());}};_0x47e0df(++_0x4571e6);}(_0x36d2,0x1b7));var _0x236d=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x36d2[_0x22b39b];return _0x280e1d;};'use strict';var _=require('lodash');var util=require(_0x236d('0x0'));var moment=require('moment');var BPromise=require(_0x236d('0x1'));var rs=require(_0x236d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x236d('0x3'))['db'];var utils=require(_0x236d('0x4'));var logger=require('../../config/logger')(_0x236d('0x5'));var config=require(_0x236d('0x6'));var jayson=require(_0x236d('0x7'));var client=jayson['client'][_0x236d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26331c,_0x1984a4,_0x4e73c7){return new BPromise(function(_0x5da199,_0x58b994){return client[_0x236d('0x9')](_0x26331c,_0x4e73c7)[_0x236d('0xa')](function(_0x10819d){logger[_0x236d('0xb')](_0x236d('0xc'),_0x1984a4,_0x236d('0xd'));logger[_0x236d('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1984a4,'request\x20sent',JSON[_0x236d('0xf')](_0x10819d));if(_0x10819d[_0x236d('0x10')]){if(_0x10819d[_0x236d('0x10')][_0x236d('0x11')]===0x1f4){logger[_0x236d('0x10')](_0x236d('0xc'),_0x1984a4,_0x10819d[_0x236d('0x10')]['message']);return _0x58b994(_0x10819d['error'][_0x236d('0x12')]);}logger[_0x236d('0x10')](_0x236d('0xc'),_0x1984a4,_0x10819d['error'][_0x236d('0x12')]);return _0x5da199(_0x10819d['error'][_0x236d('0x12')]);}else{logger[_0x236d('0xb')](_0x236d('0xc'),_0x1984a4,_0x236d('0xd'));_0x5da199(_0x10819d[_0x236d('0x13')][_0x236d('0x12')]);}})[_0x236d('0x14')](function(_0x44608c){logger[_0x236d('0x10')](_0x236d('0xc'),_0x1984a4,_0x44608c);_0x58b994(_0x44608c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 58ceae4..8fa7529 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 _0xcd7c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x54c418,_0x83dfff){var _0x42410d=function(_0x59b1f5){while(--_0x59b1f5){_0x54c418['push'](_0x54c418['shift']());}};_0x42410d(++_0x83dfff);}(_0xcd7c,0xee));var _0xccd7=function(_0x585933,_0x4eae88){_0x585933=_0x585933-0x0;var _0x1fa13b=_0xcd7c[_0x585933];return _0x1fa13b;};'use strict';var multer=require(_0xccd7('0x0'));var util=require(_0xccd7('0x1'));var path=require('path');var timeout=require(_0xccd7('0x2'));var express=require(_0xccd7('0x3'));var router=express[_0xccd7('0x4')]();var fs_extra=require(_0xccd7('0x5'));var auth=require(_0xccd7('0x6'));var interaction=require(_0xccd7('0x7'));var config=require(_0xccd7('0x8'));var controller=require(_0xccd7('0x9'));router[_0xccd7('0xa')]('/',auth['isAuthenticated'](),controller[_0xccd7('0xb')]);router[_0xccd7('0xa')](_0xccd7('0xc'),auth[_0xccd7('0xd')](),controller[_0xccd7('0xe')]);router[_0xccd7('0xa')](_0xccd7('0xf'),auth[_0xccd7('0xd')](),controller['show']);router[_0xccd7('0x10')]('/',auth['isAuthenticated'](),controller[_0xccd7('0x11')]);router[_0xccd7('0x12')]('/:id',auth[_0xccd7('0xd')](),controller[_0xccd7('0x13')]);router[_0xccd7('0x14')](_0xccd7('0xf'),auth[_0xccd7('0xd')](),controller['destroy']);module[_0xccd7('0x15')]=router; \ No newline at end of file +var _0x8d32=['../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xcdaf56,_0x272793){var _0x4dbff2=function(_0x1cb7cb){while(--_0x1cb7cb){_0xcdaf56['push'](_0xcdaf56['shift']());}};_0x4dbff2(++_0x272793);}(_0x8d32,0xac));var _0x28d3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8d32[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x28d3('0x0'));var util=require(_0x28d3('0x1'));var path=require(_0x28d3('0x2'));var timeout=require(_0x28d3('0x3'));var express=require('express');var router=express[_0x28d3('0x4')]();var fs_extra=require(_0x28d3('0x5'));var auth=require(_0x28d3('0x6'));var interaction=require(_0x28d3('0x7'));var config=require(_0x28d3('0x8'));var controller=require(_0x28d3('0x9'));router[_0x28d3('0xa')]('/',auth[_0x28d3('0xb')](),controller['index']);router[_0x28d3('0xa')](_0x28d3('0xc'),auth[_0x28d3('0xb')](),controller[_0x28d3('0xd')]);router[_0x28d3('0xa')](_0x28d3('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x28d3('0xf')]('/',auth[_0x28d3('0xb')](),controller[_0x28d3('0x10')]);router[_0x28d3('0x11')](_0x28d3('0xe'),auth[_0x28d3('0xb')](),controller['update']);router['delete'](_0x28d3('0xe'),auth['isAuthenticated'](),controller[_0x28d3('0x12')]);module[_0x28d3('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 7ce3d36..371408a 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 _0x04d0=['INTEGER','DATE','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0xa6c52c,_0x557913){var _0x3732d3=function(_0x173a66){while(--_0x173a66){_0xa6c52c['push'](_0xa6c52c['shift']());}};_0x3732d3(++_0x557913);}(_0x04d0,0x1bc));var _0x004d=function(_0x59fa20,_0x3c6cec){_0x59fa20=_0x59fa20-0x0;var _0xf2f053=_0x04d0[_0x59fa20];return _0xf2f053;};'use strict';var Sequelize=require(_0x004d('0x0'));var moment=require(_0x004d('0x1'));module['exports']={'channel':{'type':Sequelize[_0x004d('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x004d('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x004d('0x3')},'duration':{'type':Sequelize[_0x004d('0x4')]},'enterAt':{'type':Sequelize[_0x004d('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x6c038c){var _0x2a0c23=moment(_0x6c038c);var _0x35fafb=moment(this['getDataValue'](_0x004d('0x6')));var _0x18f196=_0x2a0c23['diff'](_0x35fafb,_0x004d('0x7'));this[_0x004d('0x8')](_0x004d('0x9'),_0x6c038c);this['setDataValue'](_0x004d('0xa'),_0x18f196>=0x0?_0x18f196:null);}},'data1':{'type':Sequelize[_0x004d('0x2')],'comment':_0x004d('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x004d('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x004d('0xd')},'data4':{'type':Sequelize[_0x004d('0x2')],'comment':_0x004d('0xe')},'data5':{'type':Sequelize[_0x004d('0x2')],'comment':_0x004d('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x004d('0x4')]},'uniqueid':{'type':Sequelize[_0x004d('0x2')]}}; \ No newline at end of file +var _0x7266=['talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x24957e,_0x500d5b){var _0x583aff=function(_0x47d50f){while(--_0x47d50f){_0x24957e['push'](_0x24957e['shift']());}};_0x583aff(++_0x500d5b);}(_0x7266,0xec));var _0x6726=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7266[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x6726('0x0'));var moment=require(_0x6726('0x1'));module[_0x6726('0x2')]={'channel':{'type':Sequelize[_0x6726('0x3')]},'membername':{'type':Sequelize[_0x6726('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x6726('0x4'),'comment':_0x6726('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6726('0x6')],'set':function(_0x41c7c8){var _0x1c2cfd=moment(_0x41c7c8);var _0x180502=moment(this[_0x6726('0x7')](_0x6726('0x8')));var _0x126ba7=_0x1c2cfd[_0x6726('0x9')](_0x180502,_0x6726('0xa'));this[_0x6726('0xb')](_0x6726('0xc'),_0x41c7c8);this[_0x6726('0xb')](_0x6726('0xd'),_0x126ba7>=0x0?_0x126ba7:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x6726('0xe')},'data2':{'type':Sequelize[_0x6726('0x3')],'comment':_0x6726('0xf')},'data3':{'type':Sequelize[_0x6726('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x6726('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x6726('0x3')],'comment':_0x6726('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x6726('0x11')]},'uniqueid':{'type':Sequelize[_0x6726('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 604348f..856715e 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x5b5ba8,_0x379661){var _0x57523e=function(_0x17ba0f){while(--_0x17ba0f){_0x5b5ba8['push'](_0x5b5ba8['shift']());}};_0x57523e(++_0x379661);}(_0x3e74,0x175));var _0x43e7=function(_0x958661,_0x18481f){_0x958661=_0x958661-0x0;var _0xf054ca=_0x3e74[_0x958661];return _0xf054ca;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x55ca,0x126));var _0xa55c=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x55ca[_0x671369];return _0x33f2b4;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index a9c4a3b..46423ee 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 _0x9f5a=['path','../../config/environment','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x26a51d,_0x5aaa3a){var _0x1d8bef=function(_0x3335dd){while(--_0x3335dd){_0x26a51d['push'](_0x26a51d['shift']());}};_0x1d8bef(++_0x5aaa3a);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x5b7037,_0x29a7ac){_0x5b7037=_0x5b7037-0x0;var _0x1c74d6=_0x9f5a[_0x5b7037];return _0x1c74d6;};'use strict';var _=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var logger=require(_0xa9f5('0x2'))(_0xa9f5('0x3'));var moment=require('moment');var BPromise=require(_0xa9f5('0x4'));var rp=require(_0xa9f5('0x5'));var fs=require('fs');var path=require(_0xa9f5('0x6'));var rimraf=require('rimraf');var config=require(_0xa9f5('0x7'));var attributes=require('./memberReport.attributes');module[_0xa9f5('0x8')]=function(_0x219e89,_0x49e337){return _0x219e89[_0xa9f5('0x9')](_0xa9f5('0xa'),attributes,{'tableName':_0xa9f5('0xb'),'paranoid':![],'indexes':[{'name':_0xa9f5('0xc'),'fields':[_0xa9f5('0xd'),_0xa9f5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4fef=['api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger'];(function(_0x12d203,_0x49125b){var _0x479200=function(_0x3eca17){while(--_0x3eca17){_0x12d203['push'](_0x12d203['shift']());}};_0x479200(++_0x49125b);}(_0x4fef,0x1dd));var _0xf4fe=function(_0x220acc,_0x26877f){_0x220acc=_0x220acc-0x0;var _0x73fcdb=_0x4fef[_0x220acc];return _0x73fcdb;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var logger=require(_0xf4fe('0x2'))(_0xf4fe('0x3'));var moment=require('moment');var BPromise=require(_0xf4fe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4fe('0x5'));var rimraf=require(_0xf4fe('0x6'));var config=require(_0xf4fe('0x7'));var attributes=require(_0xf4fe('0x8'));module['exports']=function(_0x20d8e1,_0x5842c4){return _0x20d8e1[_0xf4fe('0x9')](_0xf4fe('0xa'),attributes,{'tableName':_0xf4fe('0xb'),'paranoid':![],'indexes':[{'name':_0xf4fe('0xc'),'fields':[_0xf4fe('0xd'),_0xf4fe('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index bad6c9b..6950cc9 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 _0x2484=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','debug','CreateMemberReport','UpdateMemberReport','update','body','lodash','util','bluebird','randomstring'];(function(_0x3d6d08,_0x54e088){var _0x44417e=function(_0x42b9eb){while(--_0x42b9eb){_0x3d6d08['push'](_0x3d6d08['shift']());}};_0x44417e(++_0x54e088);}(_0x2484,0x178));var _0x4248=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x2484[_0x9a3e0f];return _0x3d2a9a;};'use strict';var _=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var moment=require('moment');var BPromise=require(_0x4248('0x2'));var rs=require(_0x4248('0x3'));var fs=require('fs');var Redis=require(_0x4248('0x4'));var db=require(_0x4248('0x5'))['db'];var utils=require(_0x4248('0x6'));var logger=require(_0x4248('0x7'))(_0x4248('0x8'));var config=require('../../config/environment');var jayson=require(_0x4248('0x9'));var client=jayson[_0x4248('0xa')][_0x4248('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x189f42,_0x412c18,_0x14500e){return new BPromise(function(_0x5c1284,_0xa19286){return client[_0x4248('0xc')](_0x189f42,_0x14500e)[_0x4248('0xd')](function(_0xbe710c){logger[_0x4248('0xe')](_0x4248('0xf'),_0x412c18,_0x4248('0x10'));logger['debug'](_0x4248('0x11'),_0x412c18,'request\x20sent',JSON[_0x4248('0x12')](_0xbe710c));if(_0xbe710c[_0x4248('0x13')]){if(_0xbe710c[_0x4248('0x13')]['code']===0x1f4){logger['error'](_0x4248('0xf'),_0x412c18,_0xbe710c['error'][_0x4248('0x14')]);return _0xa19286(_0xbe710c[_0x4248('0x13')][_0x4248('0x14')]);}logger[_0x4248('0x13')](_0x4248('0xf'),_0x412c18,_0xbe710c['error'][_0x4248('0x14')]);return _0x5c1284(_0xbe710c[_0x4248('0x13')][_0x4248('0x14')]);}else{logger[_0x4248('0xe')](_0x4248('0xf'),_0x412c18,'request\x20sent');_0x5c1284(_0xbe710c[_0x4248('0x15')][_0x4248('0x14')]);}})[_0x4248('0x16')](function(_0x3a2cd5){logger[_0x4248('0x13')](_0x4248('0xf'),_0x412c18,_0x3a2cd5);_0xa19286(_0x3a2cd5);});});}exports[_0x4248('0x17')]=function(_0x45edc6){var _0x29f080=this;return new Promise(function(_0xd03b87,_0x2c2a0d){return db[_0x4248('0x18')][_0x4248('0x19')]({'raw':_0x45edc6[_0x4248('0x1a')]?_0x45edc6[_0x4248('0x1a')][_0x4248('0x1b')]===undefined?!![]:![]:!![],'where':_0x45edc6[_0x4248('0x1a')]?_0x45edc6[_0x4248('0x1a')]['where']||null:null,'attributes':_0x45edc6[_0x4248('0x1a')]?_0x45edc6[_0x4248('0x1a')][_0x4248('0x1c')]||null:null,'limit':_0x45edc6[_0x4248('0x1a')]?_0x45edc6['options'][_0x4248('0x1d')]||null:null,'include':_0x45edc6[_0x4248('0x1a')]?_0x45edc6[_0x4248('0x1a')]['include']?_[_0x4248('0x1e')](_0x45edc6[_0x4248('0x1a')]['include'],function(_0x3bfcf2){return{'model':db[_0x3bfcf2['model']],'as':_0x3bfcf2['as'],'attributes':_0x3bfcf2[_0x4248('0x1c')],'include':_0x3bfcf2[_0x4248('0x1f')]?_[_0x4248('0x1e')](_0x3bfcf2[_0x4248('0x1f')],function(_0x5a3938){return{'model':db[_0x5a3938[_0x4248('0x20')]],'as':_0x5a3938['as'],'attributes':_0x5a3938[_0x4248('0x1c')],'include':_0x5a3938[_0x4248('0x1f')]?_[_0x4248('0x1e')](_0x5a3938[_0x4248('0x1f')],function(_0x429641){return{'model':db[_0x429641[_0x4248('0x20')]],'as':_0x429641['as'],'attributes':_0x429641[_0x4248('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4248('0xd')](function(_0x1f26be){logger[_0x4248('0xe')](_0x4248('0x17'),_0x45edc6);logger[_0x4248('0x21')](_0x4248('0x17'),_0x45edc6,JSON[_0x4248('0x12')](_0x1f26be));_0xd03b87(_0x1f26be);})[_0x4248('0x16')](function(_0x482689){logger[_0x4248('0x13')](_0x4248('0x17'),_0x482689[_0x4248('0x14')],_0x45edc6);_0x2c2a0d(_0x29f080['error'](0x1f4,_0x482689[_0x4248('0x14')]));});});};exports[_0x4248('0x22')]=function(_0x5654f5){var _0x45dd44=this;return new Promise(function(_0x53294f,_0x3d6bef){return db[_0x4248('0x18')]['create'](_0x5654f5['body'],{'raw':_0x5654f5['options']?_0x5654f5['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x498ec2){logger['info']('CreateMemberReport',_0x5654f5);logger[_0x4248('0x21')](_0x4248('0x22'),_0x5654f5,JSON[_0x4248('0x12')](_0x498ec2));_0x53294f(_0x498ec2);})[_0x4248('0x16')](function(_0x5b1623){logger[_0x4248('0x13')]('CreateMemberReport',_0x5b1623[_0x4248('0x14')],_0x5654f5);_0x3d6bef(_0x45dd44[_0x4248('0x13')](0x1f4,_0x5b1623[_0x4248('0x14')]));});});};exports[_0x4248('0x23')]=function(_0x4c2bf5){var _0x495d42=this;return new Promise(function(_0xe4f02,_0x3df79c){return db[_0x4248('0x18')][_0x4248('0x24')](_0x4c2bf5[_0x4248('0x25')],{'raw':_0x4c2bf5[_0x4248('0x1a')]?_0x4c2bf5[_0x4248('0x1a')][_0x4248('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c2bf5['options']?_0x4c2bf5['options']['where']||null:null,'attributes':_0x4c2bf5[_0x4248('0x1a')]?_0x4c2bf5['options'][_0x4248('0x1c')]||null:null,'limit':_0x4c2bf5[_0x4248('0x1a')]?_0x4c2bf5[_0x4248('0x1a')][_0x4248('0x1d')]||null:null})[_0x4248('0xd')](function(_0xfdcec1){logger[_0x4248('0xe')](_0x4248('0x23'),_0x4c2bf5);logger['debug'](_0x4248('0x23'),_0x4c2bf5,JSON[_0x4248('0x12')](_0xfdcec1));_0xe4f02(_0xfdcec1);})['catch'](function(_0x28c8e1){logger[_0x4248('0x13')]('UpdateMemberReport',_0x28c8e1[_0x4248('0x14')],_0x4c2bf5);_0x3df79c(_0x495d42[_0x4248('0x13')](0x1f4,_0x28c8e1[_0x4248('0x14')]));});});}; \ No newline at end of file +var _0x2678=['debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','stringify','catch','CreateMemberReport','UpdateMemberReport','MemberReport','update','body','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x2678,0x1bb));var _0x8267=function(_0x2a7841,_0x269151){_0x2a7841=_0x2a7841-0x0;var _0x5a25a8=_0x2678[_0x2a7841];return _0x5a25a8;};'use strict';var _=require('lodash');var util=require(_0x8267('0x0'));var moment=require(_0x8267('0x1'));var BPromise=require(_0x8267('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8267('0x3'));var logger=require(_0x8267('0x4'))(_0x8267('0x5'));var config=require('../../config/environment');var jayson=require(_0x8267('0x6'));var client=jayson[_0x8267('0x7')][_0x8267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e6635,_0x264d94,_0x3f30c2){return new BPromise(function(_0x2ac4ad,_0x2bbb0d){return client['request'](_0x3e6635,_0x3f30c2)[_0x8267('0x9')](function(_0x2f7832){logger['info'](_0x8267('0xa'),_0x264d94,_0x8267('0xb'));logger[_0x8267('0xc')](_0x8267('0xd'),_0x264d94,_0x8267('0xb'),JSON['stringify'](_0x2f7832));if(_0x2f7832[_0x8267('0xe')]){if(_0x2f7832[_0x8267('0xe')][_0x8267('0xf')]===0x1f4){logger[_0x8267('0xe')](_0x8267('0xa'),_0x264d94,_0x2f7832[_0x8267('0xe')][_0x8267('0x10')]);return _0x2bbb0d(_0x2f7832[_0x8267('0xe')][_0x8267('0x10')]);}logger[_0x8267('0xe')](_0x8267('0xa'),_0x264d94,_0x2f7832['error'][_0x8267('0x10')]);return _0x2ac4ad(_0x2f7832['error'][_0x8267('0x10')]);}else{logger[_0x8267('0x11')](_0x8267('0xa'),_0x264d94,_0x8267('0xb'));_0x2ac4ad(_0x2f7832['result'][_0x8267('0x10')]);}})['catch'](function(_0x3d2c1e){logger[_0x8267('0xe')]('MemberReport,\x20%s,\x20%s',_0x264d94,_0x3d2c1e);_0x2bbb0d(_0x3d2c1e);});});}exports['GetMemberReport']=function(_0x2577a5){var _0x39f8c8=this;return new Promise(function(_0x1bce2d,_0x312166){return db['MemberReport'][_0x8267('0x12')]({'raw':_0x2577a5['options']?_0x2577a5[_0x8267('0x13')][_0x8267('0x14')]===undefined?!![]:![]:!![],'where':_0x2577a5[_0x8267('0x13')]?_0x2577a5['options'][_0x8267('0x15')]||null:null,'attributes':_0x2577a5[_0x8267('0x13')]?_0x2577a5[_0x8267('0x13')][_0x8267('0x16')]||null:null,'limit':_0x2577a5[_0x8267('0x13')]?_0x2577a5[_0x8267('0x13')][_0x8267('0x17')]||null:null,'include':_0x2577a5['options']?_0x2577a5['options'][_0x8267('0x18')]?_[_0x8267('0x19')](_0x2577a5[_0x8267('0x13')][_0x8267('0x18')],function(_0x4426ca){return{'model':db[_0x4426ca[_0x8267('0x1a')]],'as':_0x4426ca['as'],'attributes':_0x4426ca['attributes'],'include':_0x4426ca[_0x8267('0x18')]?_[_0x8267('0x19')](_0x4426ca[_0x8267('0x18')],function(_0x2903bb){return{'model':db[_0x2903bb[_0x8267('0x1a')]],'as':_0x2903bb['as'],'attributes':_0x2903bb['attributes'],'include':_0x2903bb[_0x8267('0x18')]?_[_0x8267('0x19')](_0x2903bb[_0x8267('0x18')],function(_0xb55ec0){return{'model':db[_0xb55ec0[_0x8267('0x1a')]],'as':_0xb55ec0['as'],'attributes':_0xb55ec0[_0x8267('0x16')]};}):[]};}):[]};}):[]:[]})[_0x8267('0x9')](function(_0x59cee3){logger[_0x8267('0x11')](_0x8267('0x1b'),_0x2577a5);logger[_0x8267('0xc')](_0x8267('0x1b'),_0x2577a5,JSON[_0x8267('0x1c')](_0x59cee3));_0x1bce2d(_0x59cee3);})[_0x8267('0x1d')](function(_0x2d75e1){logger[_0x8267('0xe')](_0x8267('0x1b'),_0x2d75e1[_0x8267('0x10')],_0x2577a5);_0x312166(_0x39f8c8[_0x8267('0xe')](0x1f4,_0x2d75e1['message']));});});};exports[_0x8267('0x1e')]=function(_0x4f7377){var _0x1e976d=this;return new Promise(function(_0x4f4501,_0x5001d0){return db['MemberReport']['create'](_0x4f7377['body'],{'raw':_0x4f7377[_0x8267('0x13')]?_0x4f7377[_0x8267('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x8267('0x9')](function(_0x257787){logger['info'](_0x8267('0x1e'),_0x4f7377);logger[_0x8267('0xc')](_0x8267('0x1e'),_0x4f7377,JSON[_0x8267('0x1c')](_0x257787));_0x4f4501(_0x257787);})['catch'](function(_0x116440){logger[_0x8267('0xe')](_0x8267('0x1e'),_0x116440['message'],_0x4f7377);_0x5001d0(_0x1e976d[_0x8267('0xe')](0x1f4,_0x116440[_0x8267('0x10')]));});});};exports[_0x8267('0x1f')]=function(_0x2323de){var _0x18ea89=this;return new Promise(function(_0x26955b,_0x57e3d5){return db[_0x8267('0x20')][_0x8267('0x21')](_0x2323de[_0x8267('0x22')],{'raw':_0x2323de[_0x8267('0x13')]?_0x2323de['options'][_0x8267('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2323de[_0x8267('0x13')]?_0x2323de[_0x8267('0x13')][_0x8267('0x15')]||null:null,'attributes':_0x2323de[_0x8267('0x13')]?_0x2323de[_0x8267('0x13')][_0x8267('0x16')]||null:null,'limit':_0x2323de['options']?_0x2323de[_0x8267('0x13')][_0x8267('0x17')]||null:null})[_0x8267('0x9')](function(_0x47d963){logger[_0x8267('0x11')](_0x8267('0x1f'),_0x2323de);logger[_0x8267('0xc')](_0x8267('0x1f'),_0x2323de,JSON[_0x8267('0x1c')](_0x47d963));_0x26955b(_0x47d963);})[_0x8267('0x1d')](function(_0x5d28eb){logger[_0x8267('0xe')](_0x8267('0x1f'),_0x5d28eb[_0x8267('0x10')],_0x2323de);_0x57e3d5(_0x18ea89[_0x8267('0xe')](0x1f4,_0x5d28eb[_0x8267('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index faa1f08..5506472 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 _0xa205=['./migration.controller','get','index','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xa205,0x177));var _0x5a20=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0xa205[_0x12bcf7];return _0x2825a;};'use strict';var multer=require(_0x5a20('0x0'));var util=require(_0x5a20('0x1'));var path=require(_0x5a20('0x2'));var timeout=require(_0x5a20('0x3'));var express=require(_0x5a20('0x4'));var router=express[_0x5a20('0x5')]();var fs_extra=require(_0x5a20('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5a20('0x7'));var config=require(_0x5a20('0x8'));var controller=require(_0x5a20('0x9'));router[_0x5a20('0xa')]('/',controller[_0x5a20('0xb')]);module['exports']=router; \ No newline at end of file +var _0x888e=['get','index','exports','util','path','express','Router','../../components/auth/service','./migration.controller'];(function(_0x1dec6d,_0x435c3f){var _0x2fa879=function(_0x474ca7){while(--_0x474ca7){_0x1dec6d['push'](_0x1dec6d['shift']());}};_0x2fa879(++_0x435c3f);}(_0x888e,0xc0));var _0xe888=function(_0x12b09a,_0x683dc1){_0x12b09a=_0x12b09a-0x0;var _0x522ad3=_0x888e[_0x12b09a];return _0x522ad3;};'use strict';var multer=require('multer');var util=require(_0xe888('0x0'));var path=require(_0xe888('0x1'));var timeout=require('connect-timeout');var express=require(_0xe888('0x2'));var router=express[_0xe888('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe888('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe888('0x5'));router[_0xe888('0x6')]('/',controller[_0xe888('0x7')]);module[_0xe888('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 57568a7..a05466f 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 _0xd82a=['version','exports','STRING'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xd82a,0x13c));var _0xad82=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xd82a[_0x485b5a];return _0xd2b34d;};'use strict';var Sequelize=require('sequelize');module[_0xad82('0x0')]={'version':{'type':Sequelize[_0xad82('0x1')],'unique':_0xad82('0x2')}}; \ No newline at end of file +var _0x069f=['sequelize','STRING','version'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x069f,0xf3));var _0xf069=function(_0x23651b,_0x5741ae){_0x23651b=_0x23651b-0x0;var _0xd5c714=_0x069f[_0x23651b];return _0xd5c714;};'use strict';var Sequelize=require(_0xf069('0x0'));module['exports']={'version':{'type':Sequelize[_0xf069('0x1')],'unique':_0xf069('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index bc0078c..cd1badd 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 _0x27f9=['sendStatus','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','Migration','findAll','rows','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x4971d7,_0x3a5903){var _0x523eaa=function(_0x74957e){while(--_0x74957e){_0x4971d7['push'](_0x4971d7['shift']());}};_0x523eaa(++_0x3a5903);}(_0x27f9,0x1e3));var _0x927f=function(_0x2f16b2,_0x554161){_0x2f16b2=_0x2f16b2-0x0;var _0x335539=_0x27f9[_0x2f16b2];return _0x335539;};'use strict';var emlformat=require(_0x927f('0x0'));var rimraf=require(_0x927f('0x1'));var zipdir=require(_0x927f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x927f('0x3'));var moment=require(_0x927f('0x4'));var BPromise=require(_0x927f('0x5'));var Mustache=require(_0x927f('0x6'));var util=require(_0x927f('0x7'));var path=require(_0x927f('0x8'));var sox=require(_0x927f('0x9'));var csv=require('to-csv');var ejs=require(_0x927f('0xa'));var fs=require('fs');var fs_extra=require(_0x927f('0xb'));var _=require(_0x927f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x927f('0xd'));var deskjs=require(_0x927f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x927f('0xf'));var Papa=require(_0x927f('0x10'));var Redis=require(_0x927f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x927f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x927f('0x13'));var logger=require(_0x927f('0x14'))(_0x927f('0x15'));var utils=require('../../config/utils');var config=require(_0x927f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x927f('0x17'))['db'];function respondWithStatusCode(_0x290fb6,_0x5dfbd1){_0x5dfbd1=_0x5dfbd1||0xcc;return function(_0x47e94e){if(_0x47e94e){return _0x290fb6['sendStatus'](_0x5dfbd1);}return _0x290fb6[_0x927f('0x18')](_0x5dfbd1)[_0x927f('0x19')]();};}function respondWithResult(_0x1f821e,_0x154570){_0x154570=_0x154570||0xc8;return function(_0x42aaf7){if(_0x42aaf7){return _0x1f821e[_0x927f('0x18')](_0x154570)['json'](_0x42aaf7);}};}function respondWithFilteredResult(_0x118a6f,_0x206604){return function(_0x458668){if(_0x458668){var _0x3cf382=typeof _0x206604[_0x927f('0x1a')]===_0x927f('0x1b')&&typeof _0x206604[_0x927f('0x1c')]==='undefined';var _0x9fc4ee=_0x458668[_0x927f('0x1d')];var _0x584c6c=_0x3cf382?0x0:_0x206604['offset'];var _0x17fcdc=_0x3cf382?_0x458668[_0x927f('0x1d')]:_0x206604[_0x927f('0x1a')]+_0x206604['limit'];var _0x43383f;if(_0x17fcdc>=_0x9fc4ee){_0x17fcdc=_0x9fc4ee;_0x43383f=0xc8;}else{_0x43383f=0xce;}_0x118a6f[_0x927f('0x18')](_0x43383f);return _0x118a6f[_0x927f('0x1e')](_0x927f('0x1f'),_0x584c6c+'-'+_0x17fcdc+'/'+_0x9fc4ee)['json'](_0x458668);}return null;};}function patchUpdates(_0xcd9484){return function(_0x574545){try{jsonpatch[_0x927f('0x20')](_0x574545,_0xcd9484,!![]);}catch(_0x2aa14e){return BPromise[_0x927f('0x21')](_0x2aa14e);}return _0x574545[_0x927f('0x22')]();};}function saveUpdates(_0x480f6e,_0x3a7db0){return function(_0x58bb71){if(_0x58bb71){return _0x58bb71[_0x927f('0x23')](_0x480f6e)[_0x927f('0x24')](function(_0x2d8c40){return _0x2d8c40;});}return null;};}function removeEntity(_0x1bfee5,_0xf19116){return function(_0x3d0d9b){if(_0x3d0d9b){return _0x3d0d9b['destroy']()['then'](function(){_0x1bfee5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea21c,_0x41f041){return function(_0x5a0cb1){if(!_0x5a0cb1){_0x3ea21c[_0x927f('0x25')](0x194);}return _0x5a0cb1;};}function handleError(_0x1414b9,_0x484453){_0x484453=_0x484453||0x1f4;return function(_0x5ad12d){logger[_0x927f('0x26')](_0x5ad12d[_0x927f('0x27')]);if(_0x5ad12d['name']){delete _0x5ad12d[_0x927f('0x28')];}_0x1414b9['status'](_0x484453)[_0x927f('0x29')](_0x5ad12d);};}exports[_0x927f('0x2a')]=function(_0x494ccc,_0x5dcade){var _0x462d94={},_0x53fa3d={},_0x1b056f={'count':0x0,'rows':[]};var _0x832722=_[_0x927f('0x2b')](db['Migration']['rawAttributes'],function(_0x23b64e){return{'name':_0x23b64e[_0x927f('0x2c')],'type':_0x23b64e[_0x927f('0x2d')][_0x927f('0x2e')]};});_0x53fa3d['model']=_[_0x927f('0x2b')](_0x832722,'name');_0x53fa3d[_0x927f('0x2f')]=_[_0x927f('0x30')](_0x494ccc['query']);_0x53fa3d[_0x927f('0x31')]=_['intersection'](_0x53fa3d['model'],_0x53fa3d[_0x927f('0x2f')]);_0x462d94['attributes']=_[_0x927f('0x32')](_0x53fa3d[_0x927f('0x33')],qs['fields'](_0x494ccc[_0x927f('0x2f')][_0x927f('0x34')]));_0x462d94[_0x927f('0x35')]=_0x462d94['attributes']['length']?_0x462d94[_0x927f('0x35')]:_0x53fa3d[_0x927f('0x33')];if(!_0x494ccc[_0x927f('0x2f')][_0x927f('0x36')]('nolimit')){_0x462d94['limit']=qs[_0x927f('0x1c')](_0x494ccc[_0x927f('0x2f')][_0x927f('0x1c')]);_0x462d94[_0x927f('0x1a')]=qs['offset'](_0x494ccc[_0x927f('0x2f')][_0x927f('0x1a')]);}_0x462d94[_0x927f('0x37')]=qs[_0x927f('0x38')](_0x494ccc['query']['sort']);_0x462d94[_0x927f('0x39')]=qs[_0x927f('0x31')](_[_0x927f('0x3a')](_0x494ccc[_0x927f('0x2f')],_0x53fa3d[_0x927f('0x31')]),_0x832722);if(_0x494ccc[_0x927f('0x2f')][_0x927f('0x3b')]){_0x462d94[_0x927f('0x39')]=_[_0x927f('0x3c')](_0x462d94[_0x927f('0x39')],{'$or':_['map'](_0x832722,function(_0x16fa97){if(_0x16fa97[_0x927f('0x2d')]!=='VIRTUAL'){var _0x5ae3d6={};_0x5ae3d6[_0x16fa97['name']]={'$like':'%'+_0x494ccc['query'][_0x927f('0x3b')]+'%'};return _0x5ae3d6;}})});}_0x462d94=_[_0x927f('0x3c')]({},_0x462d94,_0x494ccc[_0x927f('0x3d')]);var _0x3afbc9={'where':_0x462d94[_0x927f('0x39')]};return db[_0x927f('0x3e')]['count'](_0x3afbc9)[_0x927f('0x24')](function(_0x3bb36b){_0x1b056f[_0x927f('0x1d')]=_0x3bb36b;if(_0x494ccc[_0x927f('0x2f')]['includeAll']){_0x462d94['include']=[{'all':!![]}];}return db[_0x927f('0x3e')][_0x927f('0x3f')](_0x462d94);})[_0x927f('0x24')](function(_0x387878){_0x1b056f[_0x927f('0x40')]=_0x387878;return _0x1b056f;})[_0x927f('0x24')](respondWithFilteredResult(_0x5dcade,_0x462d94))['catch'](handleError(_0x5dcade,null));}; \ No newline at end of file +var _0xdb28=['sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3a2a90,_0x48ea57){var _0x2c566d=function(_0x11a32f){while(--_0x11a32f){_0x3a2a90['push'](_0x3a2a90['shift']());}};_0x2c566d(++_0x48ea57);}(_0xdb28,0xe0));var _0x8db2=function(_0x2b6951,_0x2076be){_0x2b6951=_0x2b6951-0x0;var _0xbf8f31=_0xdb28[_0x2b6951];return _0xbf8f31;};'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(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require('util');var path=require(_0x8db2('0x8'));var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require(_0x8db2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8db2('0xc'));var squel=require(_0x8db2('0xd'));var crypto=require(_0x8db2('0xe'));var jsforce=require(_0x8db2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8db2('0x10'));var Redis=require(_0x8db2('0x11'));var authService=require(_0x8db2('0x12'));var qs=require(_0x8db2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8db2('0x14'));var logger=require(_0x8db2('0x15'))(_0x8db2('0x16'));var utils=require(_0x8db2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8db2('0x18'));var db=require(_0x8db2('0x19'))['db'];function respondWithStatusCode(_0x5e6f78,_0x1f2e1f){_0x1f2e1f=_0x1f2e1f||0xcc;return function(_0x5ef095){if(_0x5ef095){return _0x5e6f78[_0x8db2('0x1a')](_0x1f2e1f);}return _0x5e6f78[_0x8db2('0x1b')](_0x1f2e1f)[_0x8db2('0x1c')]();};}function respondWithResult(_0x2bfa41,_0x5bbb38){_0x5bbb38=_0x5bbb38||0xc8;return function(_0x322ffb){if(_0x322ffb){return _0x2bfa41[_0x8db2('0x1b')](_0x5bbb38)[_0x8db2('0x1d')](_0x322ffb);}};}function respondWithFilteredResult(_0x3bc220,_0x5b8fa8){return function(_0x40469c){if(_0x40469c){var _0xb425a6=typeof _0x5b8fa8['offset']==='undefined'&&typeof _0x5b8fa8[_0x8db2('0x1e')]===_0x8db2('0x1f');var _0x1fc086=_0x40469c[_0x8db2('0x20')];var _0x2884ab=_0xb425a6?0x0:_0x5b8fa8['offset'];var _0x494080=_0xb425a6?_0x40469c[_0x8db2('0x20')]:_0x5b8fa8[_0x8db2('0x21')]+_0x5b8fa8[_0x8db2('0x1e')];var _0xfd76ef;if(_0x494080>=_0x1fc086){_0x494080=_0x1fc086;_0xfd76ef=0xc8;}else{_0xfd76ef=0xce;}_0x3bc220[_0x8db2('0x1b')](_0xfd76ef);return _0x3bc220['set'](_0x8db2('0x22'),_0x2884ab+'-'+_0x494080+'/'+_0x1fc086)[_0x8db2('0x1d')](_0x40469c);}return null;};}function patchUpdates(_0x4dde01){return function(_0x1efea5){try{jsonpatch[_0x8db2('0x23')](_0x1efea5,_0x4dde01,!![]);}catch(_0x406430){return BPromise[_0x8db2('0x24')](_0x406430);}return _0x1efea5['save']();};}function saveUpdates(_0x30a9fc,_0x24f815){return function(_0x2c45f2){if(_0x2c45f2){return _0x2c45f2[_0x8db2('0x25')](_0x30a9fc)[_0x8db2('0x26')](function(_0x2f5c15){return _0x2f5c15;});}return null;};}function removeEntity(_0x3d25b9,_0x279da9){return function(_0x4d0426){if(_0x4d0426){return _0x4d0426[_0x8db2('0x27')]()[_0x8db2('0x26')](function(){_0x3d25b9[_0x8db2('0x1b')](0xcc)[_0x8db2('0x1c')]();});}};}function handleEntityNotFound(_0x3d234e,_0x5bd07d){return function(_0x3729a5){if(!_0x3729a5){_0x3d234e[_0x8db2('0x1a')](0x194);}return _0x3729a5;};}function handleError(_0x55dd15,_0x2416bc){_0x2416bc=_0x2416bc||0x1f4;return function(_0x2187f5){logger['error'](_0x2187f5[_0x8db2('0x28')]);if(_0x2187f5[_0x8db2('0x29')]){delete _0x2187f5[_0x8db2('0x29')];}_0x55dd15[_0x8db2('0x1b')](_0x2416bc)[_0x8db2('0x2a')](_0x2187f5);};}exports[_0x8db2('0x2b')]=function(_0x42aea3,_0x31ba4c){var _0x54c9ba={},_0x975b3b={},_0x47cce9={'count':0x0,'rows':[]};var _0x3e6e61=_[_0x8db2('0x2c')](db[_0x8db2('0x2d')][_0x8db2('0x2e')],function(_0x567880){return{'name':_0x567880[_0x8db2('0x2f')],'type':_0x567880[_0x8db2('0x30')]['key']};});_0x975b3b[_0x8db2('0x31')]=_[_0x8db2('0x2c')](_0x3e6e61,'name');_0x975b3b[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x42aea3[_0x8db2('0x32')]);_0x975b3b[_0x8db2('0x34')]=_['intersection'](_0x975b3b[_0x8db2('0x31')],_0x975b3b[_0x8db2('0x32')]);_0x54c9ba[_0x8db2('0x35')]=_[_0x8db2('0x36')](_0x975b3b[_0x8db2('0x31')],qs['fields'](_0x42aea3[_0x8db2('0x32')][_0x8db2('0x37')]));_0x54c9ba[_0x8db2('0x35')]=_0x54c9ba[_0x8db2('0x35')][_0x8db2('0x38')]?_0x54c9ba['attributes']:_0x975b3b['model'];if(!_0x42aea3['query'][_0x8db2('0x39')](_0x8db2('0x3a'))){_0x54c9ba[_0x8db2('0x1e')]=qs[_0x8db2('0x1e')](_0x42aea3[_0x8db2('0x32')][_0x8db2('0x1e')]);_0x54c9ba[_0x8db2('0x21')]=qs['offset'](_0x42aea3[_0x8db2('0x32')]['offset']);}_0x54c9ba[_0x8db2('0x3b')]=qs['sort'](_0x42aea3['query'][_0x8db2('0x3c')]);_0x54c9ba[_0x8db2('0x3d')]=qs['filters'](_[_0x8db2('0x3e')](_0x42aea3[_0x8db2('0x32')],_0x975b3b[_0x8db2('0x34')]),_0x3e6e61);if(_0x42aea3[_0x8db2('0x32')][_0x8db2('0x3f')]){_0x54c9ba[_0x8db2('0x3d')]=_['merge'](_0x54c9ba['where'],{'$or':_[_0x8db2('0x2c')](_0x3e6e61,function(_0xc6ef2){if(_0xc6ef2[_0x8db2('0x30')]!==_0x8db2('0x40')){var _0x37fec4={};_0x37fec4[_0xc6ef2['name']]={'$like':'%'+_0x42aea3[_0x8db2('0x32')][_0x8db2('0x3f')]+'%'};return _0x37fec4;}})});}_0x54c9ba=_[_0x8db2('0x41')]({},_0x54c9ba,_0x42aea3[_0x8db2('0x42')]);var _0x5c4fce={'where':_0x54c9ba[_0x8db2('0x3d')]};return db[_0x8db2('0x2d')][_0x8db2('0x20')](_0x5c4fce)[_0x8db2('0x26')](function(_0x27cc2f){_0x47cce9[_0x8db2('0x20')]=_0x27cc2f;if(_0x42aea3['query'][_0x8db2('0x43')]){_0x54c9ba[_0x8db2('0x44')]=[{'all':!![]}];}return db[_0x8db2('0x2d')][_0x8db2('0x45')](_0x54c9ba);})['then'](function(_0x295777){_0x47cce9[_0x8db2('0x46')]=_0x295777;return _0x47cce9;})[_0x8db2('0x26')](respondWithFilteredResult(_0x31ba4c,_0x54c9ba))['catch'](handleError(_0x31ba4c,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 37aca8e..db9939d 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 _0x7748=['request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util','../../config/logger','moment','bluebird'];(function(_0xc3b595,_0x4108fd){var _0x26befa=function(_0x17a7e2){while(--_0x17a7e2){_0xc3b595['push'](_0xc3b595['shift']());}};_0x26befa(++_0x4108fd);}(_0x7748,0x97));var _0x8774=function(_0x557ea6,_0x23b26c){_0x557ea6=_0x557ea6-0x0;var _0x29b095=_0x7748[_0x557ea6];return _0x29b095;};'use strict';var _=require(_0x8774('0x0'));var util=require(_0x8774('0x1'));var logger=require(_0x8774('0x2'))('api');var moment=require(_0x8774('0x3'));var BPromise=require(_0x8774('0x4'));var rp=require(_0x8774('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8774('0x6'));var config=require(_0x8774('0x7'));var attributes=require(_0x8774('0x8'));module[_0x8774('0x9')]=function(_0x16f1b7,_0x56a41a){return _0x16f1b7[_0x8774('0xa')](_0x8774('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9857=['moment','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util','../../config/logger','api'];(function(_0x4471bf,_0x4c2198){var _0x261832=function(_0x170910){while(--_0x170910){_0x4471bf['push'](_0x4471bf['shift']());}};_0x261832(++_0x4c2198);}(_0x9857,0x15b));var _0x7985=function(_0x219d59,_0x136aaa){_0x219d59=_0x219d59-0x0;var _0x252951=_0x9857[_0x219d59];return _0x252951;};'use strict';var _=require(_0x7985('0x0'));var util=require(_0x7985('0x1'));var logger=require(_0x7985('0x2'))(_0x7985('0x3'));var moment=require(_0x7985('0x4'));var BPromise=require('bluebird');var rp=require(_0x7985('0x5'));var fs=require('fs');var path=require(_0x7985('0x6'));var rimraf=require(_0x7985('0x7'));var config=require(_0x7985('0x8'));var attributes=require(_0x7985('0x9'));module[_0x7985('0xa')]=function(_0x2c4925,_0x35bc28){return _0x2c4925[_0x7985('0xb')](_0x7985('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index ce9c0a8..43ce59f 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 _0xbb53=['http','then','info','request\x20sent','stringify','error','message','Migration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xbb53,0x121));var _0x3bb5=function(_0x5b2a4f,_0xc77712){_0x5b2a4f=_0x5b2a4f-0x0;var _0x37908e=_0xbb53[_0x5b2a4f];return _0x37908e;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var moment=require(_0x3bb5('0x2'));var BPromise=require(_0x3bb5('0x3'));var rs=require(_0x3bb5('0x4'));var fs=require('fs');var Redis=require(_0x3bb5('0x5'));var db=require(_0x3bb5('0x6'))['db'];var utils=require(_0x3bb5('0x7'));var logger=require(_0x3bb5('0x8'))(_0x3bb5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bb5('0xa')][_0x3bb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aa7d,_0x157e04,_0x22f92f){return new BPromise(function(_0x480f9c,_0x5a4ae3){return client['request'](_0x28aa7d,_0x22f92f)[_0x3bb5('0xc')](function(_0x2e0cfa){logger[_0x3bb5('0xd')]('Migration,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'),JSON[_0x3bb5('0xf')](_0x2e0cfa));if(_0x2e0cfa['error']){if(_0x2e0cfa[_0x3bb5('0x10')]['code']===0x1f4){logger[_0x3bb5('0x10')]('Migration,\x20%s,\x20%s',_0x157e04,_0x2e0cfa['error'][_0x3bb5('0x11')]);return _0x5a4ae3(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}logger['error'](_0x3bb5('0x12'),_0x157e04,_0x2e0cfa[_0x3bb5('0x10')]['message']);return _0x480f9c(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x157e04,'request\x20sent');_0x480f9c(_0x2e0cfa[_0x3bb5('0x13')][_0x3bb5('0x11')]);}})['catch'](function(_0x25d774){logger[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x157e04,_0x25d774);_0x5a4ae3(_0x25d774);});});} \ No newline at end of file +var _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x433d28,_0x34ddb4){var _0x311ae9=function(_0x28843d){while(--_0x28843d){_0x433d28['push'](_0x433d28['shift']());}};_0x311ae9(++_0x34ddb4);}(_0xda55,0x6d));var _0x5da5=function(_0x4d9798,_0x4f0807){_0x4d9798=_0x4d9798-0x0;var _0x48975f=_0xda55[_0x4d9798];return _0x48975f;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('Migration,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d76b640..0fdab73 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 _0xe225=['index','get','/:id','show','post','create','put','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service','isAuthenticated'];(function(_0x322bef,_0x4890d4){var _0x229e60=function(_0x45f89b){while(--_0x45f89b){_0x322bef['push'](_0x322bef['shift']());}};_0x229e60(++_0x4890d4);}(_0xe225,0x1bd));var _0x5e22=function(_0x5d1e77,_0x1033b4){_0x5d1e77=_0x5d1e77-0x0;var _0x3522eb=_0xe225[_0x5d1e77];return _0x3522eb;};'use strict';var multer=require('multer');var util=require(_0x5e22('0x0'));var path=require(_0x5e22('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5e22('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5e22('0x3'));var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0x5e22('0x4')](),controller[_0x5e22('0x5')]);router[_0x5e22('0x6')](_0x5e22('0x7'),auth[_0x5e22('0x4')](),controller[_0x5e22('0x8')]);router[_0x5e22('0x9')]('/',auth[_0x5e22('0x4')](),controller[_0x5e22('0xa')]);router[_0x5e22('0xb')](_0x5e22('0x7'),auth[_0x5e22('0x4')](),controller['update']);router[_0x5e22('0xc')]('/:id',auth[_0x5e22('0x4')](),controller[_0x5e22('0xd')]);module[_0x5e22('0xe')]=router; \ No newline at end of file +var _0xc838=['../../config/environment','./network.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x447487,_0x44b9e2){var _0x4cea89=function(_0x5d3d58){while(--_0x5d3d58){_0x447487['push'](_0x447487['shift']());}};_0x4cea89(++_0x44b9e2);}(_0xc838,0xbd));var _0x8c83=function(_0x370acd,_0x4c76e7){_0x370acd=_0x370acd-0x0;var _0x59ecd5=_0xc838[_0x370acd];return _0x59ecd5;};'use strict';var multer=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var path=require(_0x8c83('0x2'));var timeout=require(_0x8c83('0x3'));var express=require(_0x8c83('0x4'));var router=express[_0x8c83('0x5')]();var fs_extra=require(_0x8c83('0x6'));var auth=require(_0x8c83('0x7'));var interaction=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var controller=require(_0x8c83('0xa'));router[_0x8c83('0xb')]('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xd')]);router[_0x8c83('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x8c83('0xe')]);router['post']('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xf')]);router[_0x8c83('0x10')](_0x8c83('0x11'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x12')]);router[_0x8c83('0x13')](_0x8c83('0x11'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x14')]);module[_0x8c83('0x15')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 078ed50..84162ea 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 _0x20d4=['externip','stun','turn','STRING','exports','ENUM','localnet'];(function(_0x5104f4,_0x32ca76){var _0x4aab92=function(_0xcfb21b){while(--_0xcfb21b){_0x5104f4['push'](_0x5104f4['shift']());}};_0x4aab92(++_0x32ca76);}(_0x20d4,0xc1));var _0x420d=function(_0xeb86d9,_0x3044c5){_0xeb86d9=_0xeb86d9-0x0;var _0x15ab7b=_0x20d4[_0xeb86d9];return _0x15ab7b;};'use strict';var Sequelize=require('sequelize');module[_0x420d('0x0')]={'type':{'type':Sequelize[_0x420d('0x1')](_0x420d('0x2'),_0x420d('0x3'),_0x420d('0x4'),_0x420d('0x5'))},'value':{'type':Sequelize[_0x420d('0x6')]},'username':{'type':Sequelize[_0x420d('0x6')]},'password':{'type':Sequelize[_0x420d('0x6')]}}; \ No newline at end of file +var _0x99cd=['localnet','externip','stun','STRING','sequelize'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x99cd,0x1ad));var _0xd99c=function(_0x5787d9,_0x381361){_0x5787d9=_0x5787d9-0x0;var _0xe9f41d=_0x99cd[_0x5787d9];return _0xe9f41d;};'use strict';var Sequelize=require(_0xd99c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xd99c('0x1'),_0xd99c('0x2'),_0xd99c('0x3'),'turn')},'value':{'type':Sequelize[_0xd99c('0x4')]},'username':{'type':Sequelize[_0xd99c('0x4')]},'password':{'type':Sequelize[_0xd99c('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4efa618..a8e3e5e 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 _0x5cfd=['client','http','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','count','set','update','then','destroy','sendStatus','stack','name','index','map','Network','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','body','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','root','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','STUN','util','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0x5cfd,0xf1));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd5cf('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd5cf('0x1'));var qs=require(_0xd5cf('0x2'));var logger=require(_0xd5cf('0x3'))(_0xd5cf('0x4'));var config=require(_0xd5cf('0x5'));var db=require(_0xd5cf('0x6'))['db'];var jayson=require(_0xd5cf('0x7'));var client=jayson[_0xd5cf('0x8')][_0xd5cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d2d5c,_0x402ccd,_0x384b47,_0x514c11){return new Promise(function(_0x3f6b38,_0x229501){var _0x2e32fe=_0x514c11||client;return _0x2e32fe['request'](_0x1d2d5c,_0x384b47)['then'](function(_0x54e83d){logger[_0xd5cf('0xa')](_0xd5cf('0xb'),_0x402ccd,_0xd5cf('0xc'));logger['debug'](_0xd5cf('0xd'),_0x402ccd,_0xd5cf('0xc'),JSON[_0xd5cf('0xe')](_0x54e83d));if(_0x54e83d[_0xd5cf('0xf')]){if(_0x54e83d['error'][_0xd5cf('0x10')]===0x1f4){logger[_0xd5cf('0xf')](_0xd5cf('0xb'),_0x402ccd,_0x54e83d[_0xd5cf('0xf')][_0xd5cf('0x11')]);return _0x229501(_0x54e83d[_0xd5cf('0xf')][_0xd5cf('0x11')]);}logger[_0xd5cf('0xf')](_0xd5cf('0xb'),_0x402ccd,_0x54e83d[_0xd5cf('0xf')][_0xd5cf('0x11')]);return _0x3f6b38(_0x54e83d[_0xd5cf('0xf')][_0xd5cf('0x11')]);}else{logger[_0xd5cf('0xa')](_0xd5cf('0xb'),_0x402ccd,_0xd5cf('0xc'));_0x3f6b38(_0x54e83d[_0xd5cf('0x12')]['message']);}})[_0xd5cf('0x13')](function(_0x17e8cf){logger['error'](_0xd5cf('0xb'),_0x402ccd,_0x17e8cf);_0x229501(_0x17e8cf);});});}function respondWithResult(_0x19d4b0,_0x3c3fe1){_0x3c3fe1=_0x3c3fe1||0xc8;return function(_0x12de59){if(_0x12de59){return _0x19d4b0[_0xd5cf('0x14')](_0x3c3fe1)[_0xd5cf('0x15')](_0x12de59);}};}function respondWithFilteredResult(_0x238ac6,_0x208bb6){return function(_0x3be605){if(_0x3be605){var _0xf6e288=typeof _0x208bb6[_0xd5cf('0x16')]==='undefined'&&typeof _0x208bb6[_0xd5cf('0x17')]==='undefined';var _0x536755=_0x3be605[_0xd5cf('0x18')];var _0x4aac4d=_0xf6e288?0x0:_0x208bb6['offset'];var _0x5da5b6=_0xf6e288?_0x3be605[_0xd5cf('0x18')]:_0x208bb6['offset']+_0x208bb6[_0xd5cf('0x17')];var _0x3383a9;if(_0x5da5b6>=_0x536755){_0x5da5b6=_0x536755;_0x3383a9=0xc8;}else{_0x3383a9=0xce;}_0x238ac6[_0xd5cf('0x14')](_0x3383a9);return _0x238ac6[_0xd5cf('0x19')]('Content-Range',_0x4aac4d+'-'+_0x5da5b6+'/'+_0x536755)[_0xd5cf('0x15')](_0x3be605);}return null;};}function saveUpdates(_0x285c33){return function(_0xb4cf78){if(_0xb4cf78){return _0xb4cf78[_0xd5cf('0x1a')](_0x285c33)[_0xd5cf('0x1b')](function(_0x7dbb29){return _0x7dbb29;});}return null;};}function removeEntity(_0x1415fb){return function(_0xd775d7){if(_0xd775d7){return _0xd775d7[_0xd5cf('0x1c')]()[_0xd5cf('0x1b')](function(){_0x1415fb[_0xd5cf('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597498){return function(_0x57b229){if(!_0x57b229){_0x597498[_0xd5cf('0x1d')](0x194);}return _0x57b229;};}function handleError(_0xf4b38f,_0x1f4ba7){_0x1f4ba7=_0x1f4ba7||0x1f4;return function(_0x1ca2f6){logger[_0xd5cf('0xf')](_0x1ca2f6[_0xd5cf('0x1e')]);if(_0x1ca2f6['name']){delete _0x1ca2f6[_0xd5cf('0x1f')];}_0xf4b38f['status'](_0x1f4ba7)['send'](_0x1ca2f6);};}exports[_0xd5cf('0x20')]=function(_0x45ca42,_0x10dd83){var _0x4dcb32={},_0x51b71b={},_0x3bfa11={'count':0x0,'rows':[]};var _0x4206c3=_[_0xd5cf('0x21')](db[_0xd5cf('0x22')][_0xd5cf('0x23')],function(_0x56891d){return{'name':_0x56891d['fieldName'],'type':_0x56891d[_0xd5cf('0x24')][_0xd5cf('0x25')]};});_0x51b71b[_0xd5cf('0x26')]=_[_0xd5cf('0x21')](_0x4206c3,_0xd5cf('0x1f'));_0x51b71b['query']=_[_0xd5cf('0x27')](_0x45ca42['query']);_0x51b71b[_0xd5cf('0x28')]=_[_0xd5cf('0x29')](_0x51b71b[_0xd5cf('0x26')],_0x51b71b[_0xd5cf('0x2a')]);_0x4dcb32[_0xd5cf('0x2b')]=_[_0xd5cf('0x29')](_0x51b71b[_0xd5cf('0x26')],qs['fields'](_0x45ca42[_0xd5cf('0x2a')][_0xd5cf('0x2c')]));_0x4dcb32['attributes']=_0x4dcb32[_0xd5cf('0x2b')][_0xd5cf('0x2d')]?_0x4dcb32['attributes']:_0x51b71b['model'];if(!_0x45ca42[_0xd5cf('0x2a')]['hasOwnProperty'](_0xd5cf('0x2e'))){_0x4dcb32[_0xd5cf('0x17')]=qs['limit'](_0x45ca42[_0xd5cf('0x2a')][_0xd5cf('0x17')]);_0x4dcb32[_0xd5cf('0x16')]=qs[_0xd5cf('0x16')](_0x45ca42[_0xd5cf('0x2a')][_0xd5cf('0x16')]);}_0x4dcb32[_0xd5cf('0x2f')]=qs[_0xd5cf('0x30')](_0x45ca42[_0xd5cf('0x2a')][_0xd5cf('0x30')]);_0x4dcb32['where']=qs[_0xd5cf('0x28')](_[_0xd5cf('0x31')](_0x45ca42[_0xd5cf('0x2a')],_0x51b71b[_0xd5cf('0x28')]),_0x4206c3);if(_0x45ca42[_0xd5cf('0x2a')][_0xd5cf('0x32')]){_0x4dcb32[_0xd5cf('0x33')]=_[_0xd5cf('0x34')](_0x4dcb32[_0xd5cf('0x33')],{'$or':_[_0xd5cf('0x21')](_0x4206c3,function(_0x48307d){if(_0x48307d[_0xd5cf('0x24')]!==_0xd5cf('0x35')){var _0x132294={};_0x132294[_0x48307d[_0xd5cf('0x1f')]]={'$like':'%'+_0x45ca42[_0xd5cf('0x2a')]['filter']+'%'};return _0x132294;}})});}_0x4dcb32=_['merge']({},_0x4dcb32,_0x45ca42[_0xd5cf('0x36')]);var _0x385f33={'where':_0x4dcb32['where']};return db[_0xd5cf('0x22')]['count'](_0x385f33)[_0xd5cf('0x1b')](function(_0x5f09cd){_0x3bfa11[_0xd5cf('0x18')]=_0x5f09cd;if(_0x45ca42['query'][_0xd5cf('0x37')]){_0x4dcb32['include']=[{'all':!![]}];}return db[_0xd5cf('0x22')][_0xd5cf('0x38')](_0x4dcb32);})[_0xd5cf('0x1b')](function(_0x108914){_0x3bfa11[_0xd5cf('0x39')]=_0x108914;return _0x3bfa11;})[_0xd5cf('0x1b')](respondWithFilteredResult(_0x10dd83,_0x4dcb32))[_0xd5cf('0x13')](handleError(_0x10dd83,null));};exports['show']=function(_0x28ad2a,_0x5bb7ba){var _0x1d2be0={'raw':!![],'where':{'id':_0x28ad2a[_0xd5cf('0x3a')]['id']}},_0x4ea727={};_0x4ea727[_0xd5cf('0x26')]=_[_0xd5cf('0x27')](db[_0xd5cf('0x22')]['rawAttributes']);_0x4ea727['query']=_[_0xd5cf('0x27')](_0x28ad2a['query']);_0x4ea727[_0xd5cf('0x28')]=_[_0xd5cf('0x29')](_0x4ea727[_0xd5cf('0x26')],_0x4ea727[_0xd5cf('0x2a')]);_0x1d2be0[_0xd5cf('0x2b')]=_[_0xd5cf('0x29')](_0x4ea727[_0xd5cf('0x26')],qs[_0xd5cf('0x2c')](_0x28ad2a['query'][_0xd5cf('0x2c')]));_0x1d2be0['attributes']=_0x1d2be0[_0xd5cf('0x2b')][_0xd5cf('0x2d')]?_0x1d2be0['attributes']:_0x4ea727[_0xd5cf('0x26')];if(_0x28ad2a[_0xd5cf('0x2a')][_0xd5cf('0x37')]){_0x1d2be0[_0xd5cf('0x3b')]=[{'all':!![]}];}_0x1d2be0=_[_0xd5cf('0x34')]({},_0x1d2be0,_0x28ad2a['options']);return db['Network'][_0xd5cf('0x3c')](_0x1d2be0)[_0xd5cf('0x1b')](handleEntityNotFound(_0x5bb7ba,null))['then'](respondWithResult(_0x5bb7ba,null))[_0xd5cf('0x13')](handleError(_0x5bb7ba,null));};exports[_0xd5cf('0x3d')]=function(_0x2bb6ea,_0x1fc045){var _0x57306a;return db['Network'][_0xd5cf('0x3d')](_0x2bb6ea['body'],{'raw':!![]})[_0xd5cf('0x1b')](function(_0x385b66){_0x57306a=_0x385b66;return db['Network'][_0xd5cf('0x38')]({'where':{'type':_0x2bb6ea[_0xd5cf('0x3e')]['type']},'raw':!![]});})[_0xd5cf('0x1b')](function(_0x4694a4){if(_0x57306a[_0xd5cf('0x24')]['toUpperCase']()=='STUN'){var _0x206d4e=fs[_0xd5cf('0x3f')](path[_0xd5cf('0x40')](config['root'],_0xd5cf('0x41')),_0xd5cf('0x42'));var _0x5496f5=ejs[_0xd5cf('0x43')](_0x206d4e,{'networks':_0x4694a4||[]});fs[_0xd5cf('0x44')](_0xd5cf('0x45'),_0x5496f5);return respondWithRpcPromise(_0xd5cf('0x46'),_0xd5cf('0x3d'),{'module':_0xd5cf('0x47')});}else if(_0x57306a[_0xd5cf('0x24')][_0xd5cf('0x48')]()==_0xd5cf('0x49')){var _0x3944cb=fs[_0xd5cf('0x3f')](path['join'](config['root'],_0xd5cf('0x4a')),_0xd5cf('0x42'));var _0xd3fd4=ejs[_0xd5cf('0x43')](_0x3944cb,{'networks':_0x4694a4||[]});fs[_0xd5cf('0x44')](_0xd5cf('0x4b'),_0xd3fd4);return respondWithRpcPromise(_0xd5cf('0x46'),_0xd5cf('0x3d'),{'module':_0xd5cf('0x47')});}else{var _0x42b3bc=fs['readFileSync'](path[_0xd5cf('0x40')](config[_0xd5cf('0x4c')],_0xd5cf('0x4d')),_0xd5cf('0x42'));var _0x348aac=ejs[_0xd5cf('0x43')](_0x42b3bc,{'networks':_0x4694a4||[]});fs['writeFileSync'](util[_0xd5cf('0x4e')](_0xd5cf('0x4f'),_0x2bb6ea['body'][_0xd5cf('0x24')][_0xd5cf('0x50')]()),_0x348aac);return respondWithRpcPromise(_0xd5cf('0x46'),'create',{'module':'chan_sip.so'});}})[_0xd5cf('0x1b')](function(){return _0x57306a;})[_0xd5cf('0x1b')](respondWithResult(_0x1fc045,0xc9))[_0xd5cf('0x13')](handleError(_0x1fc045,null));};exports[_0xd5cf('0x1a')]=function(_0x338c4e,_0x387e0d){var _0x49fc50;return db['Network'][_0xd5cf('0x3c')]({'where':{'id':_0x338c4e[_0xd5cf('0x3a')]['id']}})[_0xd5cf('0x1b')](handleEntityNotFound(_0x387e0d,null))[_0xd5cf('0x1b')](saveUpdates(_0x338c4e[_0xd5cf('0x3e')],null))[_0xd5cf('0x1b')](function(_0x2eb8b5){if(_0x2eb8b5){_0x49fc50=_0x2eb8b5;return db[_0xd5cf('0x22')][_0xd5cf('0x38')]({'where':{'type':_0x49fc50[_0xd5cf('0x24')]},'raw':!![]});}return null;})['then'](function(_0xa99d04){if(_0x49fc50[_0xd5cf('0x24')][_0xd5cf('0x48')]()=='STUN'){var _0xf38d99=fs['readFileSync'](path[_0xd5cf('0x40')](config[_0xd5cf('0x4c')],_0xd5cf('0x41')),_0xd5cf('0x42'));var _0x226ef5=ejs[_0xd5cf('0x43')](_0xf38d99,{'networks':_0xa99d04||[]});fs[_0xd5cf('0x44')]('/etc/asterisk/stun_xcally.conf',_0x226ef5);return respondWithRpcPromise(_0xd5cf('0x46'),_0xd5cf('0x1a'),{'module':_0xd5cf('0x47')});}else if(_0x49fc50[_0xd5cf('0x24')]['toUpperCase']()=='TURN'){var _0x39221e=fs[_0xd5cf('0x3f')](path['join'](config['root'],_0xd5cf('0x4a')),_0xd5cf('0x42'));var _0x23c401=ejs[_0xd5cf('0x43')](_0x39221e,{'networks':_0xa99d04||[]});fs['writeFileSync'](_0xd5cf('0x4b'),_0x23c401);return respondWithRpcPromise(_0xd5cf('0x46'),_0xd5cf('0x1a'),{'module':_0xd5cf('0x47')});}else{var _0x31eb21=fs[_0xd5cf('0x3f')](path[_0xd5cf('0x40')](config['root'],_0xd5cf('0x4d')),_0xd5cf('0x42'));var _0x327440=ejs[_0xd5cf('0x43')](_0x31eb21,{'networks':_0xa99d04||[]});fs[_0xd5cf('0x44')](util[_0xd5cf('0x4e')](_0xd5cf('0x4f'),_0x338c4e['body']['type'][_0xd5cf('0x50')]()),_0x327440);return respondWithRpcPromise(_0xd5cf('0x46'),_0xd5cf('0x1a'),{'module':_0xd5cf('0x51')});}})[_0xd5cf('0x1b')](function(_0x1c84f6){if(_0x1c84f6){return _0x49fc50;}return null;})['then'](respondWithResult(_0x387e0d,null))[_0xd5cf('0x13')](handleError(_0x387e0d,null));};exports[_0xd5cf('0x1c')]=function(_0x1dde85,_0x37b41f){var _0x4aff6c;return db[_0xd5cf('0x22')][_0xd5cf('0x3c')]({'where':{'id':_0x1dde85[_0xd5cf('0x3a')]['id']}})['then'](function(_0x2d3e69){_0x4aff6c=_0x2d3e69;return _0x2d3e69;})[_0xd5cf('0x1b')](handleEntityNotFound(_0x37b41f,null))[_0xd5cf('0x1b')](removeEntity(_0x37b41f,null))['then'](function(){if(_0x4aff6c){return db[_0xd5cf('0x22')][_0xd5cf('0x38')]({'where':{'type':_0x4aff6c[_0xd5cf('0x24')]},'raw':!![]});}})[_0xd5cf('0x1b')](function(_0x5786b0){if(_0x4aff6c[_0xd5cf('0x24')]['toUpperCase']()==_0xd5cf('0x52')){var _0x36e26c=fs['readFileSync'](path[_0xd5cf('0x40')](config['root'],_0xd5cf('0x41')),_0xd5cf('0x42'));var _0xd8e595=ejs[_0xd5cf('0x43')](_0x36e26c,{'networks':_0x5786b0||[]});fs[_0xd5cf('0x44')](_0xd5cf('0x45'),_0xd8e595);return respondWithRpcPromise(_0xd5cf('0x46'),_0xd5cf('0x1c'),{'module':_0xd5cf('0x47')});}else if(_0x4aff6c[_0xd5cf('0x24')]['toUpperCase']()=='TURN'){var _0x416f8a=fs[_0xd5cf('0x3f')](path[_0xd5cf('0x40')](config[_0xd5cf('0x4c')],_0xd5cf('0x4a')),_0xd5cf('0x42'));var _0x184851=ejs['render'](_0x416f8a,{'networks':_0x5786b0||[]});fs[_0xd5cf('0x44')](_0xd5cf('0x4b'),_0x184851);return respondWithRpcPromise(_0xd5cf('0x46'),_0xd5cf('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x396d9f=fs[_0xd5cf('0x3f')](path['join'](config[_0xd5cf('0x4c')],_0xd5cf('0x4d')),_0xd5cf('0x42'));var _0x35fea1=ejs[_0xd5cf('0x43')](_0x396d9f,{'networks':_0x5786b0||[]});fs[_0xd5cf('0x44')](util[_0xd5cf('0x4e')]('/etc/asterisk/sip_xcally_%s.conf',_0x4aff6c['type'][_0xd5cf('0x50')]()),_0x35fea1);return respondWithRpcPromise(_0xd5cf('0x46'),'destroy',{'module':'chan_sip.so'});}})[_0xd5cf('0x13')](handleError(_0x37b41f,null));}; \ No newline at end of file +var _0x8d67=['fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Network','includeAll','include','findAll','rows','show','params','find','create','body','toUpperCase','join','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','readFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','STUN','util','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Network,\x20%s,\x20%s','result','catch','json','offset','undefined','limit','count','status','set','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes'];(function(_0x476ff0,_0x6c041e){var _0x3e7dea=function(_0x134503){while(--_0x134503){_0x476ff0['push'](_0x476ff0['shift']());}};_0x3e7dea(++_0x6c041e);}(_0x8d67,0x88));var _0x78d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8d67[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x78d6('0x0'));var path=require(_0x78d6('0x1'));var ejs=require(_0x78d6('0x2'));var fs=require('fs');var _=require(_0x78d6('0x3'));var qs=require(_0x78d6('0x4'));var logger=require('../../config/logger')(_0x78d6('0x5'));var config=require(_0x78d6('0x6'));var db=require(_0x78d6('0x7'))['db'];var jayson=require(_0x78d6('0x8'));var client=jayson[_0x78d6('0x9')][_0x78d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46e84a,_0x16e2e3,_0x869b72,_0x1f74ac){return new Promise(function(_0x339edc,_0x58acf9){var _0x1580b0=_0x1f74ac||client;return _0x1580b0[_0x78d6('0xb')](_0x46e84a,_0x869b72)[_0x78d6('0xc')](function(_0x5e2c7d){logger[_0x78d6('0xd')]('Network,\x20%s,\x20%s',_0x16e2e3,_0x78d6('0xe'));logger['debug'](_0x78d6('0xf'),_0x16e2e3,_0x78d6('0xe'),JSON[_0x78d6('0x10')](_0x5e2c7d));if(_0x5e2c7d[_0x78d6('0x11')]){if(_0x5e2c7d[_0x78d6('0x11')][_0x78d6('0x12')]===0x1f4){logger[_0x78d6('0x11')]('Network,\x20%s,\x20%s',_0x16e2e3,_0x5e2c7d[_0x78d6('0x11')][_0x78d6('0x13')]);return _0x58acf9(_0x5e2c7d[_0x78d6('0x11')][_0x78d6('0x13')]);}logger[_0x78d6('0x11')](_0x78d6('0x14'),_0x16e2e3,_0x5e2c7d[_0x78d6('0x11')][_0x78d6('0x13')]);return _0x339edc(_0x5e2c7d['error'][_0x78d6('0x13')]);}else{logger[_0x78d6('0xd')]('Network,\x20%s,\x20%s',_0x16e2e3,_0x78d6('0xe'));_0x339edc(_0x5e2c7d[_0x78d6('0x15')][_0x78d6('0x13')]);}})[_0x78d6('0x16')](function(_0xf30074){logger['error']('Network,\x20%s,\x20%s',_0x16e2e3,_0xf30074);_0x58acf9(_0xf30074);});});}function respondWithResult(_0x4799e6,_0x51f6be){_0x51f6be=_0x51f6be||0xc8;return function(_0x398acd){if(_0x398acd){return _0x4799e6['status'](_0x51f6be)[_0x78d6('0x17')](_0x398acd);}};}function respondWithFilteredResult(_0x2fafa1,_0x553a3a){return function(_0x3faf1b){if(_0x3faf1b){var _0x4a0348=typeof _0x553a3a[_0x78d6('0x18')]===_0x78d6('0x19')&&typeof _0x553a3a[_0x78d6('0x1a')]==='undefined';var _0x5e90e9=_0x3faf1b['count'];var _0x552d18=_0x4a0348?0x0:_0x553a3a[_0x78d6('0x18')];var _0x300945=_0x4a0348?_0x3faf1b[_0x78d6('0x1b')]:_0x553a3a[_0x78d6('0x18')]+_0x553a3a['limit'];var _0x5c2f10;if(_0x300945>=_0x5e90e9){_0x300945=_0x5e90e9;_0x5c2f10=0xc8;}else{_0x5c2f10=0xce;}_0x2fafa1[_0x78d6('0x1c')](_0x5c2f10);return _0x2fafa1[_0x78d6('0x1d')]('Content-Range',_0x552d18+'-'+_0x300945+'/'+_0x5e90e9)[_0x78d6('0x17')](_0x3faf1b);}return null;};}function saveUpdates(_0x562f9a){return function(_0x44dba8){if(_0x44dba8){return _0x44dba8[_0x78d6('0x1e')](_0x562f9a)[_0x78d6('0xc')](function(_0x22d1cb){return _0x22d1cb;});}return null;};}function removeEntity(_0x38e4f0){return function(_0x141b20){if(_0x141b20){return _0x141b20[_0x78d6('0x1f')]()[_0x78d6('0xc')](function(){_0x38e4f0[_0x78d6('0x1c')](0xcc)[_0x78d6('0x20')]();});}};}function handleEntityNotFound(_0x350b80){return function(_0xf8c881){if(!_0xf8c881){_0x350b80[_0x78d6('0x21')](0x194);}return _0xf8c881;};}function handleError(_0x1de54f,_0xa733d4){_0xa733d4=_0xa733d4||0x1f4;return function(_0x4bb2dc){logger['error'](_0x4bb2dc[_0x78d6('0x22')]);if(_0x4bb2dc[_0x78d6('0x23')]){delete _0x4bb2dc['name'];}_0x1de54f['status'](_0xa733d4)[_0x78d6('0x24')](_0x4bb2dc);};}exports[_0x78d6('0x25')]=function(_0x50cc22,_0x16bc94){var _0x2c7bf8={},_0x1d190a={},_0x231e8f={'count':0x0,'rows':[]};var _0x2e2d59=_[_0x78d6('0x26')](db['Network'][_0x78d6('0x27')],function(_0x5edf41){return{'name':_0x5edf41[_0x78d6('0x28')],'type':_0x5edf41[_0x78d6('0x29')]['key']};});_0x1d190a[_0x78d6('0x2a')]=_[_0x78d6('0x26')](_0x2e2d59,_0x78d6('0x23'));_0x1d190a[_0x78d6('0x2b')]=_[_0x78d6('0x2c')](_0x50cc22[_0x78d6('0x2b')]);_0x1d190a[_0x78d6('0x2d')]=_['intersection'](_0x1d190a[_0x78d6('0x2a')],_0x1d190a[_0x78d6('0x2b')]);_0x2c7bf8[_0x78d6('0x2e')]=_['intersection'](_0x1d190a[_0x78d6('0x2a')],qs[_0x78d6('0x2f')](_0x50cc22[_0x78d6('0x2b')][_0x78d6('0x2f')]));_0x2c7bf8[_0x78d6('0x2e')]=_0x2c7bf8[_0x78d6('0x2e')][_0x78d6('0x30')]?_0x2c7bf8[_0x78d6('0x2e')]:_0x1d190a['model'];if(!_0x50cc22[_0x78d6('0x2b')][_0x78d6('0x31')](_0x78d6('0x32'))){_0x2c7bf8[_0x78d6('0x1a')]=qs[_0x78d6('0x1a')](_0x50cc22['query'][_0x78d6('0x1a')]);_0x2c7bf8['offset']=qs[_0x78d6('0x18')](_0x50cc22[_0x78d6('0x2b')][_0x78d6('0x18')]);}_0x2c7bf8[_0x78d6('0x33')]=qs[_0x78d6('0x34')](_0x50cc22[_0x78d6('0x2b')][_0x78d6('0x34')]);_0x2c7bf8[_0x78d6('0x35')]=qs[_0x78d6('0x2d')](_['pick'](_0x50cc22[_0x78d6('0x2b')],_0x1d190a[_0x78d6('0x2d')]),_0x2e2d59);if(_0x50cc22[_0x78d6('0x2b')][_0x78d6('0x36')]){_0x2c7bf8[_0x78d6('0x35')]=_[_0x78d6('0x37')](_0x2c7bf8[_0x78d6('0x35')],{'$or':_[_0x78d6('0x26')](_0x2e2d59,function(_0x10a239){if(_0x10a239[_0x78d6('0x29')]!==_0x78d6('0x38')){var _0x130173={};_0x130173[_0x10a239[_0x78d6('0x23')]]={'$like':'%'+_0x50cc22[_0x78d6('0x2b')]['filter']+'%'};return _0x130173;}})});}_0x2c7bf8=_[_0x78d6('0x37')]({},_0x2c7bf8,_0x50cc22[_0x78d6('0x39')]);var _0x28dab0={'where':_0x2c7bf8[_0x78d6('0x35')]};return db[_0x78d6('0x3a')][_0x78d6('0x1b')](_0x28dab0)[_0x78d6('0xc')](function(_0x5c5802){_0x231e8f[_0x78d6('0x1b')]=_0x5c5802;if(_0x50cc22[_0x78d6('0x2b')][_0x78d6('0x3b')]){_0x2c7bf8[_0x78d6('0x3c')]=[{'all':!![]}];}return db[_0x78d6('0x3a')][_0x78d6('0x3d')](_0x2c7bf8);})[_0x78d6('0xc')](function(_0x284637){_0x231e8f[_0x78d6('0x3e')]=_0x284637;return _0x231e8f;})[_0x78d6('0xc')](respondWithFilteredResult(_0x16bc94,_0x2c7bf8))[_0x78d6('0x16')](handleError(_0x16bc94,null));};exports[_0x78d6('0x3f')]=function(_0x34043a,_0x54bb1e){var _0x482e16={'raw':!![],'where':{'id':_0x34043a[_0x78d6('0x40')]['id']}},_0x2c65bf={};_0x2c65bf[_0x78d6('0x2a')]=_['keys'](db[_0x78d6('0x3a')]['rawAttributes']);_0x2c65bf[_0x78d6('0x2b')]=_[_0x78d6('0x2c')](_0x34043a[_0x78d6('0x2b')]);_0x2c65bf['filters']=_['intersection'](_0x2c65bf[_0x78d6('0x2a')],_0x2c65bf[_0x78d6('0x2b')]);_0x482e16[_0x78d6('0x2e')]=_['intersection'](_0x2c65bf[_0x78d6('0x2a')],qs[_0x78d6('0x2f')](_0x34043a[_0x78d6('0x2b')]['fields']));_0x482e16[_0x78d6('0x2e')]=_0x482e16[_0x78d6('0x2e')][_0x78d6('0x30')]?_0x482e16['attributes']:_0x2c65bf['model'];if(_0x34043a[_0x78d6('0x2b')][_0x78d6('0x3b')]){_0x482e16[_0x78d6('0x3c')]=[{'all':!![]}];}_0x482e16=_[_0x78d6('0x37')]({},_0x482e16,_0x34043a[_0x78d6('0x39')]);return db[_0x78d6('0x3a')][_0x78d6('0x41')](_0x482e16)[_0x78d6('0xc')](handleEntityNotFound(_0x54bb1e,null))[_0x78d6('0xc')](respondWithResult(_0x54bb1e,null))['catch'](handleError(_0x54bb1e,null));};exports[_0x78d6('0x42')]=function(_0x4ad275,_0x259f1a){var _0x52fd18;return db[_0x78d6('0x3a')]['create'](_0x4ad275[_0x78d6('0x43')],{'raw':!![]})['then'](function(_0x25c564){_0x52fd18=_0x25c564;return db['Network'][_0x78d6('0x3d')]({'where':{'type':_0x4ad275[_0x78d6('0x43')][_0x78d6('0x29')]},'raw':!![]});})[_0x78d6('0xc')](function(_0x3b162d){if(_0x52fd18[_0x78d6('0x29')][_0x78d6('0x44')]()=='STUN'){var _0x592aae=fs['readFileSync'](path[_0x78d6('0x45')](config['root'],_0x78d6('0x46')),_0x78d6('0x47'));var _0x14c6d8=ejs['render'](_0x592aae,{'networks':_0x3b162d||[]});fs[_0x78d6('0x48')](_0x78d6('0x49'),_0x14c6d8);return respondWithRpcPromise(_0x78d6('0x4a'),_0x78d6('0x42'),{'module':_0x78d6('0x4b')});}else if(_0x52fd18[_0x78d6('0x29')][_0x78d6('0x44')]()==_0x78d6('0x4c')){var _0x215c8f=fs['readFileSync'](path['join'](config[_0x78d6('0x4d')],_0x78d6('0x4e')),_0x78d6('0x47'));var _0x3e55be=ejs[_0x78d6('0x4f')](_0x215c8f,{'networks':_0x3b162d||[]});fs['writeFileSync'](_0x78d6('0x50'),_0x3e55be);return respondWithRpcPromise(_0x78d6('0x4a'),'create',{'module':_0x78d6('0x4b')});}else{var _0x5951de=fs[_0x78d6('0x51')](path[_0x78d6('0x45')](config[_0x78d6('0x4d')],_0x78d6('0x52')),_0x78d6('0x47'));var _0x44594e=ejs[_0x78d6('0x4f')](_0x5951de,{'networks':_0x3b162d||[]});fs['writeFileSync'](util[_0x78d6('0x53')](_0x78d6('0x54'),_0x4ad275['body'][_0x78d6('0x29')]['toLowerCase']()),_0x44594e);return respondWithRpcPromise('Reload',_0x78d6('0x42'),{'module':'chan_sip.so'});}})[_0x78d6('0xc')](function(){return _0x52fd18;})[_0x78d6('0xc')](respondWithResult(_0x259f1a,0xc9))[_0x78d6('0x16')](handleError(_0x259f1a,null));};exports['update']=function(_0x98a522,_0x16eb96){var _0x53e65c;return db['Network'][_0x78d6('0x41')]({'where':{'id':_0x98a522['params']['id']}})[_0x78d6('0xc')](handleEntityNotFound(_0x16eb96,null))[_0x78d6('0xc')](saveUpdates(_0x98a522[_0x78d6('0x43')],null))[_0x78d6('0xc')](function(_0x379b9e){if(_0x379b9e){_0x53e65c=_0x379b9e;return db[_0x78d6('0x3a')][_0x78d6('0x3d')]({'where':{'type':_0x53e65c[_0x78d6('0x29')]},'raw':!![]});}return null;})['then'](function(_0x402902){if(_0x53e65c['type']['toUpperCase']()=='STUN'){var _0x47f6f9=fs[_0x78d6('0x51')](path[_0x78d6('0x45')](config[_0x78d6('0x4d')],_0x78d6('0x46')),_0x78d6('0x47'));var _0x1d7ba=ejs[_0x78d6('0x4f')](_0x47f6f9,{'networks':_0x402902||[]});fs[_0x78d6('0x48')]('/etc/asterisk/stun_xcally.conf',_0x1d7ba);return respondWithRpcPromise(_0x78d6('0x4a'),'update',{'module':'res_stun_monitor.so'});}else if(_0x53e65c['type'][_0x78d6('0x44')]()==_0x78d6('0x4c')){var _0x23b462=fs[_0x78d6('0x51')](path[_0x78d6('0x45')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x78d6('0x47'));var _0x35abfd=ejs['render'](_0x23b462,{'networks':_0x402902||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x35abfd);return respondWithRpcPromise('Reload',_0x78d6('0x1e'),{'module':_0x78d6('0x4b')});}else{var _0xb48f60=fs['readFileSync'](path[_0x78d6('0x45')](config[_0x78d6('0x4d')],_0x78d6('0x52')),_0x78d6('0x47'));var _0x518d50=ejs[_0x78d6('0x4f')](_0xb48f60,{'networks':_0x402902||[]});fs[_0x78d6('0x48')](util[_0x78d6('0x53')](_0x78d6('0x54'),_0x98a522[_0x78d6('0x43')]['type'][_0x78d6('0x55')]()),_0x518d50);return respondWithRpcPromise('Reload','update',{'module':_0x78d6('0x56')});}})[_0x78d6('0xc')](function(_0x24dd3f){if(_0x24dd3f){return _0x53e65c;}return null;})[_0x78d6('0xc')](respondWithResult(_0x16eb96,null))['catch'](handleError(_0x16eb96,null));};exports[_0x78d6('0x1f')]=function(_0x1f30a5,_0x16ae8b){var _0x3cfd33;return db[_0x78d6('0x3a')][_0x78d6('0x41')]({'where':{'id':_0x1f30a5[_0x78d6('0x40')]['id']}})[_0x78d6('0xc')](function(_0x2bcfda){_0x3cfd33=_0x2bcfda;return _0x2bcfda;})[_0x78d6('0xc')](handleEntityNotFound(_0x16ae8b,null))[_0x78d6('0xc')](removeEntity(_0x16ae8b,null))[_0x78d6('0xc')](function(){if(_0x3cfd33){return db[_0x78d6('0x3a')][_0x78d6('0x3d')]({'where':{'type':_0x3cfd33[_0x78d6('0x29')]},'raw':!![]});}})[_0x78d6('0xc')](function(_0x5d9f9d){if(_0x3cfd33['type']['toUpperCase']()==_0x78d6('0x57')){var _0x5c4556=fs[_0x78d6('0x51')](path[_0x78d6('0x45')](config['root'],_0x78d6('0x46')),'utf8');var _0x4415be=ejs[_0x78d6('0x4f')](_0x5c4556,{'networks':_0x5d9f9d||[]});fs[_0x78d6('0x48')](_0x78d6('0x49'),_0x4415be);return respondWithRpcPromise(_0x78d6('0x4a'),'destroy',{'module':_0x78d6('0x4b')});}else if(_0x3cfd33[_0x78d6('0x29')][_0x78d6('0x44')]()==_0x78d6('0x4c')){var _0xa35fad=fs[_0x78d6('0x51')](path[_0x78d6('0x45')](config[_0x78d6('0x4d')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x9fa49c=ejs['render'](_0xa35fad,{'networks':_0x5d9f9d||[]});fs[_0x78d6('0x48')](_0x78d6('0x50'),_0x9fa49c);return respondWithRpcPromise(_0x78d6('0x4a'),_0x78d6('0x1f'),{'module':_0x78d6('0x4b')});}else{var _0x23fbc5=fs[_0x78d6('0x51')](path[_0x78d6('0x45')](config[_0x78d6('0x4d')],_0x78d6('0x52')),_0x78d6('0x47'));var _0x49d970=ejs[_0x78d6('0x4f')](_0x23fbc5,{'networks':_0x5d9f9d||[]});fs['writeFileSync'](util[_0x78d6('0x53')](_0x78d6('0x54'),_0x3cfd33[_0x78d6('0x29')][_0x78d6('0x55')]()),_0x49d970);return respondWithRpcPromise('Reload',_0x78d6('0x1f'),{'module':'chan_sip.so'});}})[_0x78d6('0x16')](handleError(_0x16ae8b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 9420db6..2b06404 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 _0xd757=['./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd757,0x1e5));var _0x7d75=function(_0xf4e3d3,_0x5be014){_0xf4e3d3=_0xf4e3d3-0x0;var _0x1d9faa=_0xd757[_0xf4e3d3];return _0x1d9faa;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb1=['./network.attributes','exports','define','network','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x480cca,_0x33709f){var _0x22bcdb=function(_0x15ab17){while(--_0x15ab17){_0x480cca['push'](_0x480cca['shift']());}};_0x22bcdb(++_0x33709f);}(_0x5eb1,0x7c));var _0x15eb=function(_0x2332e1,_0x433415){_0x2332e1=_0x2332e1-0x0;var _0x2c3bda=_0x5eb1[_0x2332e1];return _0x2c3bda;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))(_0x15eb('0x2'));var moment=require(_0x15eb('0x3'));var BPromise=require(_0x15eb('0x4'));var rp=require(_0x15eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15eb('0x6'));var config=require(_0x15eb('0x7'));var attributes=require(_0x15eb('0x8'));module[_0x15eb('0x9')]=function(_0x47e341,_0x1be042){return _0x47e341[_0x15eb('0xa')]('Network',attributes,{'tableName':_0x15eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 6cef998..0d9a7d6 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x34bdad,_0x22749e){_0x34bdad=_0x34bdad-0x0;var _0x332509=_0x7a54[_0x34bdad];return _0x332509;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf3567b,_0x4860cc){var _0x5d2d09=function(_0x310012){while(--_0x310012){_0xf3567b['push'](_0xf3567b['shift']());}};_0x5d2d09(++_0x4860cc);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4f85297..83124df 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 _0x7ef7=['send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','addAgents','/:id/send'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7ef7,0x104));var _0x77ef=function(_0x3bbd41,_0x1def9e){_0x3bbd41=_0x3bbd41-0x0;var _0x29af93=_0x7ef7[_0x3bbd41];return _0x29af93;};'use strict';var multer=require(_0x77ef('0x0'));var util=require(_0x77ef('0x1'));var path=require(_0x77ef('0x2'));var timeout=require(_0x77ef('0x3'));var express=require('express');var router=express[_0x77ef('0x4')]();var fs_extra=require(_0x77ef('0x5'));var auth=require(_0x77ef('0x6'));var interaction=require(_0x77ef('0x7'));var config=require(_0x77ef('0x8'));var controller=require('./openchannelAccount.controller');router[_0x77ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x77ef('0x9')]('/describe',auth[_0x77ef('0xa')](),controller[_0x77ef('0xb')]);router[_0x77ef('0x9')](_0x77ef('0xc'),auth[_0x77ef('0xa')](),controller['show']);router['get'](_0x77ef('0xd'),auth['isAuthenticated'](),controller[_0x77ef('0xe')]);router[_0x77ef('0x9')](_0x77ef('0xf'),auth[_0x77ef('0xa')](),controller['getAnswers']);router[_0x77ef('0x9')](_0x77ef('0x10'),auth['isAuthenticated'](),controller[_0x77ef('0x11')]);router[_0x77ef('0x9')](_0x77ef('0x12'),auth[_0x77ef('0xa')](),controller[_0x77ef('0x13')]);router[_0x77ef('0x9')](_0x77ef('0x14'),auth[_0x77ef('0xa')](),controller[_0x77ef('0x15')]);router[_0x77ef('0x16')]('/',auth[_0x77ef('0xa')](),controller[_0x77ef('0x17')]);router[_0x77ef('0x16')](_0x77ef('0xd'),auth[_0x77ef('0xa')](),controller[_0x77ef('0x18')]);router[_0x77ef('0x16')](_0x77ef('0xf'),auth[_0x77ef('0xa')](),controller[_0x77ef('0x19')]);router['post']('/:id/notify',controller['notify']);router['post'](_0x77ef('0x10'),auth[_0x77ef('0xa')](),controller['addApplications']);router[_0x77ef('0x16')]('/:id/users',auth[_0x77ef('0xa')](),controller[_0x77ef('0x1a')]);router[_0x77ef('0x16')](_0x77ef('0x1b'),auth[_0x77ef('0xa')](),controller[_0x77ef('0x1c')]);router[_0x77ef('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x77ef('0x1e')]);router[_0x77ef('0x1f')]('/:id',auth[_0x77ef('0xa')](),controller[_0x77ef('0x20')]);router[_0x77ef('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x77ef('0x21')]);router[_0x77ef('0x1f')](_0x77ef('0xf'),auth[_0x77ef('0xa')](),controller[_0x77ef('0x22')]);router['delete'](_0x77ef('0x14'),auth[_0x77ef('0xa')](),controller[_0x77ef('0x23')]);module['exports']=router; \ No newline at end of file +var _0x4451=['show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications','addAgents','send','put','/:id','delete','removeAnswers','removeAgents','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x112626,_0x5d7528){var _0xeff75c=function(_0x56f7eb){while(--_0x56f7eb){_0x112626['push'](_0x112626['shift']());}};_0xeff75c(++_0x5d7528);}(_0x4451,0x1f3));var _0x1445=function(_0x30bc6c,_0x5cbde6){_0x30bc6c=_0x30bc6c-0x0;var _0xf7f79f=_0x4451[_0x30bc6c];return _0xf7f79f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1445('0x0'));var timeout=require(_0x1445('0x1'));var express=require('express');var router=express[_0x1445('0x2')]();var fs_extra=require(_0x1445('0x3'));var auth=require(_0x1445('0x4'));var interaction=require(_0x1445('0x5'));var config=require(_0x1445('0x6'));var controller=require('./openchannelAccount.controller');router[_0x1445('0x7')]('/',auth[_0x1445('0x8')](),controller['index']);router[_0x1445('0x7')](_0x1445('0x9'),auth[_0x1445('0x8')](),controller[_0x1445('0xa')]);router[_0x1445('0x7')]('/:id',auth[_0x1445('0x8')](),controller[_0x1445('0xb')]);router[_0x1445('0x7')](_0x1445('0xc'),auth[_0x1445('0x8')](),controller[_0x1445('0xd')]);router['get'](_0x1445('0xe'),auth['isAuthenticated'](),controller[_0x1445('0xf')]);router[_0x1445('0x7')]('/:id/applications',auth[_0x1445('0x8')](),controller['getApplications']);router['get'](_0x1445('0x10'),auth['isAuthenticated'](),controller[_0x1445('0x11')]);router[_0x1445('0x7')](_0x1445('0x12'),auth[_0x1445('0x8')](),controller[_0x1445('0x13')]);router[_0x1445('0x14')]('/',auth['isAuthenticated'](),controller[_0x1445('0x15')]);router[_0x1445('0x14')](_0x1445('0xc'),auth[_0x1445('0x8')](),controller['addDisposition']);router[_0x1445('0x14')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1445('0x16')]);router['post'](_0x1445('0x17'),controller[_0x1445('0x18')]);router[_0x1445('0x14')]('/:id/applications',auth[_0x1445('0x8')](),controller[_0x1445('0x19')]);router[_0x1445('0x14')](_0x1445('0x12'),auth[_0x1445('0x8')](),controller[_0x1445('0x1a')]);router[_0x1445('0x14')]('/:id/send',auth[_0x1445('0x8')](),controller[_0x1445('0x1b')]);router[_0x1445('0x1c')](_0x1445('0x1d'),auth[_0x1445('0x8')](),controller['update']);router[_0x1445('0x1e')](_0x1445('0x1d'),auth['isAuthenticated'](),controller['destroy']);router[_0x1445('0x1e')](_0x1445('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x1445('0x8')](),controller[_0x1445('0x1f')]);router[_0x1445('0x1e')](_0x1445('0x12'),auth[_0x1445('0x8')](),controller[_0x1445('0x20')]);module[_0x1445('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3e0f9bb..391288a 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 _0x3e70=['mandatoryDispositionPauseId','mandatoryDisposition','exports','name','STRING','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(_0xf94618,_0x114c5e){var _0x3b550f=function(_0xb2f0a1){while(--_0xb2f0a1){_0xf94618['push'](_0xf94618['shift']());}};_0x3b550f(++_0x114c5e);}(_0x3e70,0xff));var _0x03e7=function(_0x8f867d,_0x5d3344){_0x8f867d=_0x8f867d-0x0;var _0x4c4ccd=_0x3e70[_0x8f867d];return _0x4c4ccd;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x03e7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x03e7('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x03e7('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x03e7('0x3')]();}},'replyUri':{'type':Sequelize[_0x03e7('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x03e7('0x4');}},'notificationSound':{'type':Sequelize[_0x03e7('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x03e7('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x03e7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x03e7('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x03e7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x03e7('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x03e7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03e7('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x03e7('0x5')],'defaultValue':![],'comment':_0x03e7('0x7'),'set':function(_0x31c8ef){if(!_0x31c8ef)this[_0x03e7('0x8')](_0x03e7('0x9'),null);this[_0x03e7('0x8')](_0x03e7('0xa'),_0x31c8ef);}}}; \ No newline at end of file +var _0xc1c8=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x40942b,_0x4fba32){var _0x56529b=function(_0x3b635f){while(--_0x3b635f){_0x40942b['push'](_0x40942b['shift']());}};_0x56529b(++_0x4fba32);}(_0xc1c8,0x1b6));var _0x8c1c=function(_0xc36e57,_0x32ef0b){_0xc36e57=_0xc36e57-0x0;var _0x31d169=_0xc1c8[_0xc36e57];return _0x31d169;};'use strict';var Sequelize=require(_0x8c1c('0x0'));var rs=require('randomstring');module[_0x8c1c('0x1')]={'name':{'type':Sequelize[_0x8c1c('0x2')],'unique':_0x8c1c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8c1c('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8c1c('0x4')]();}},'replyUri':{'type':Sequelize[_0x8c1c('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8c1c('0x5')],'defaultValue':function(){return _0x8c1c('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8c1c('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8c1c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8c1c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8c1c('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8c1c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8c1c('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x8c1c('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x8c1c('0x7')],'defaultValue':![],'comment':_0x8c1c('0xa'),'set':function(_0x40c71c){if(!_0x40c71c)this[_0x8c1c('0xb')](_0x8c1c('0xc'),null);this[_0x8c1c('0xb')](_0x8c1c('0xd'),_0x40c71c);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 7c8f8bd..979df28 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 _0x61a5=['asc','ListId','contact','lastName','threadId','OpenchannelInteraction','externalUrl','spread','firstName','messageId','interaction','created','autoclose','push','close','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Owner','fullname','internal','Tag','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','UserProfileResource','destroy','end','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','includeAll','findAll','rows','show','params','Pause','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority'];(function(_0xad5599,_0x2d489a){var _0x259907=function(_0x5af2ff){while(--_0x5af2ff){_0xad5599['push'](_0xad5599['shift']());}};_0x259907(++_0x2d489a);}(_0x61a5,0xf0));var _0x561a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x61a5[_0x82129b];return _0x2ae5dc;};'use strict';var emlformat=require(_0x561a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x561a('0x1'));var jsonpatch=require(_0x561a('0x2'));var rp=require(_0x561a('0x3'));var moment=require(_0x561a('0x4'));var BPromise=require(_0x561a('0x5'));var Mustache=require('mustache');var util=require(_0x561a('0x6'));var path=require(_0x561a('0x7'));var sox=require('sox');var csv=require(_0x561a('0x8'));var ejs=require(_0x561a('0x9'));var fs=require('fs');var fs_extra=require(_0x561a('0xa'));var _=require(_0x561a('0xb'));var squel=require(_0x561a('0xc'));var crypto=require(_0x561a('0xd'));var jsforce=require(_0x561a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x561a('0x8'));var querystring=require('querystring');var Papa=require(_0x561a('0xf'));var Redis=require(_0x561a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x561a('0x11'));var as=require(_0x561a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x561a('0x13'))('api');var utils=require(_0x561a('0x14'));var config=require(_0x561a('0x15'));var licenseUtil=require(_0x561a('0x16'));var db=require(_0x561a('0x17'))['db'];config[_0x561a('0x18')]=_[_0x561a('0x19')](config[_0x561a('0x18')],{'host':_0x561a('0x1a'),'port':0x18eb});var socket=require(_0x561a('0x1b'))(new Redis(config[_0x561a('0x18')]));require(_0x561a('0x1c'))[_0x561a('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x561a('0x1e')][_0x561a('0x1f')]({'port':0x232c});var client9002=jayson[_0x561a('0x1e')][_0x561a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xd7f0fb,_0x28ad8b,_0x3d91be,_0x14f141){return new BPromise(function(_0x2690d9,_0x3e7717){var _0x19870a=_0x14f141||client;return _0x19870a['request'](_0xd7f0fb,_0x3d91be)[_0x561a('0x20')](function(_0x190057){logger['info'](_0x561a('0x21'),_0x28ad8b,_0x561a('0x22'));logger['debug'](_0x561a('0x23'),_0x28ad8b,'request\x20sent',JSON['stringify'](_0x190057));if(_0x190057[_0x561a('0x24')]){if(_0x190057[_0x561a('0x24')]['code']===0x1f4){logger[_0x561a('0x24')](_0x561a('0x21'),_0x28ad8b,_0x190057[_0x561a('0x24')][_0x561a('0x25')]);return _0x3e7717(_0x190057[_0x561a('0x24')][_0x561a('0x25')]);}logger['error'](_0x561a('0x21'),_0x28ad8b,_0x190057[_0x561a('0x24')][_0x561a('0x25')]);return _0x2690d9(_0x190057['error']['message']);}else{logger[_0x561a('0x26')](_0x561a('0x21'),_0x28ad8b,_0x561a('0x22'));_0x2690d9(_0x190057[_0x561a('0x27')][_0x561a('0x25')]);}})[_0x561a('0x28')](function(_0x259963){logger[_0x561a('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x28ad8b,_0x259963);_0x3e7717(_0x259963);});});}function respondWithStatusCode(_0x4c2752,_0x27f42){_0x27f42=_0x27f42||0xcc;return function(_0x2765c5){if(_0x2765c5){return _0x4c2752[_0x561a('0x29')](_0x27f42);}return _0x4c2752[_0x561a('0x2a')](_0x27f42)['end']();};}function respondWithResult(_0x186862,_0x3f0789){_0x3f0789=_0x3f0789||0xc8;return function(_0x44c851){if(_0x44c851){return _0x186862[_0x561a('0x2a')](_0x3f0789)[_0x561a('0x2b')](_0x44c851);}};}function respondWithFilteredResult(_0x47f93a,_0x42053f){return function(_0x1d48d9){if(_0x1d48d9){var _0x4f0b23=typeof _0x42053f[_0x561a('0x2c')]===_0x561a('0x2d')&&typeof _0x42053f['limit']===_0x561a('0x2d');var _0x591737=_0x1d48d9['count'];var _0x3633d2=_0x4f0b23?0x0:_0x42053f[_0x561a('0x2c')];var _0x4e0042=_0x4f0b23?_0x1d48d9[_0x561a('0x2e')]:_0x42053f[_0x561a('0x2c')]+_0x42053f[_0x561a('0x2f')];var _0x278c7e;if(_0x4e0042>=_0x591737){_0x4e0042=_0x591737;_0x278c7e=0xc8;}else{_0x278c7e=0xce;}_0x47f93a[_0x561a('0x2a')](_0x278c7e);return _0x47f93a[_0x561a('0x30')](_0x561a('0x31'),_0x3633d2+'-'+_0x4e0042+'/'+_0x591737)[_0x561a('0x2b')](_0x1d48d9);}return null;};}function patchUpdates(_0x506c2e){return function(_0x116784){try{jsonpatch[_0x561a('0x32')](_0x116784,_0x506c2e,!![]);}catch(_0x2ab150){return BPromise[_0x561a('0x33')](_0x2ab150);}return _0x116784[_0x561a('0x34')]();};}function saveUpdates(_0x4ab97f,_0xf96a9f){return function(_0x29d120){if(_0x29d120){return _0x29d120[_0x561a('0x35')](_0x4ab97f)[_0x561a('0x20')](function(_0x57809f){return _0x57809f;});}return null;};}function removeEntity(_0x9ea469,_0x30521e){return function(_0x2a7c6d){if(_0x2a7c6d){return _0x2a7c6d['destroy']()['then'](function(){var _0x3bf14f=_0x2a7c6d['get']({'plain':!![]});var _0x5a45a4='OpenchannelAccounts';return db[_0x561a('0x36')][_0x561a('0x37')]({'where':{'type':_0x5a45a4,'resourceId':_0x3bf14f['id']}})[_0x561a('0x20')](function(){return _0x2a7c6d;});})[_0x561a('0x20')](function(){_0x9ea469[_0x561a('0x2a')](0xcc)[_0x561a('0x38')]();});}};}function handleEntityNotFound(_0x520f8b,_0x588a39){return function(_0x1252f8){if(!_0x1252f8){_0x520f8b[_0x561a('0x29')](0x194);}return _0x1252f8;};}function handleError(_0x2e4770,_0x4e7d95){_0x4e7d95=_0x4e7d95||0x1f4;return function(_0x4d81f7){logger[_0x561a('0x24')](_0x4d81f7[_0x561a('0x39')]);if(_0x4d81f7[_0x561a('0x3a')]){delete _0x4d81f7['name'];}_0x2e4770[_0x561a('0x2a')](_0x4e7d95)[_0x561a('0x3b')](_0x4d81f7);};}exports[_0x561a('0x3c')]=function(_0x330c8d,_0x5a057d){var _0xbd11c4={'include':[{'model':db['Pause'],'as':_0x561a('0x3d')}]},_0x29f8bb={},_0x19f6cd={'count':0x0,'rows':[]};var _0x3ae2db=_[_0x561a('0x3e')](db[_0x561a('0x3f')][_0x561a('0x40')],function(_0xc90f63){return{'name':_0xc90f63[_0x561a('0x41')],'type':_0xc90f63['type'][_0x561a('0x42')]};});_0x29f8bb[_0x561a('0x43')]=_[_0x561a('0x3e')](_0x3ae2db,_0x561a('0x3a'));_0x29f8bb[_0x561a('0x44')]=_[_0x561a('0x45')](_0x330c8d['query']);_0x29f8bb[_0x561a('0x46')]=_[_0x561a('0x47')](_0x29f8bb[_0x561a('0x43')],_0x29f8bb[_0x561a('0x44')]);_0xbd11c4[_0x561a('0x48')]=_[_0x561a('0x47')](_0x29f8bb[_0x561a('0x43')],qs[_0x561a('0x49')](_0x330c8d[_0x561a('0x44')]['fields']));_0xbd11c4[_0x561a('0x48')]=_0xbd11c4[_0x561a('0x48')]['length']?_0xbd11c4[_0x561a('0x48')]:_0x29f8bb['model'];if(!_0x330c8d[_0x561a('0x44')][_0x561a('0x4a')](_0x561a('0x4b'))){_0xbd11c4[_0x561a('0x2f')]=qs[_0x561a('0x2f')](_0x330c8d['query'][_0x561a('0x2f')]);_0xbd11c4[_0x561a('0x2c')]=qs[_0x561a('0x2c')](_0x330c8d[_0x561a('0x44')][_0x561a('0x2c')]);}_0xbd11c4[_0x561a('0x4c')]=qs['sort'](_0x330c8d['query'][_0x561a('0x4d')]);_0xbd11c4['where']=qs['filters'](_['pick'](_0x330c8d['query'],_0x29f8bb['filters']),_0x3ae2db);if(_0x330c8d[_0x561a('0x44')][_0x561a('0x4e')]){_0xbd11c4[_0x561a('0x4f')]=_['merge'](_0xbd11c4[_0x561a('0x4f')],{'$or':_['map'](_0x3ae2db,function(_0x4f82a1){if(_0x4f82a1[_0x561a('0x50')]!==_0x561a('0x51')){var _0x19d247={};_0x19d247[_0x4f82a1['name']]={'$like':'%'+_0x330c8d[_0x561a('0x44')]['filter']+'%'};return _0x19d247;}})});}_0xbd11c4=_[_0x561a('0x52')]({},_0xbd11c4,_0x330c8d['options']);var _0x1bd3df={'where':_0xbd11c4[_0x561a('0x4f')]};return db[_0x561a('0x3f')][_0x561a('0x2e')](_0x1bd3df)[_0x561a('0x20')](function(_0x275b2e){_0x19f6cd[_0x561a('0x2e')]=_0x275b2e;if(_0x330c8d[_0x561a('0x44')][_0x561a('0x53')]){_0xbd11c4['include']=[{'all':!![]}];}return db[_0x561a('0x3f')][_0x561a('0x54')](_0xbd11c4);})[_0x561a('0x20')](function(_0x48ed34){_0x19f6cd[_0x561a('0x55')]=_0x48ed34;return _0x19f6cd;})[_0x561a('0x20')](respondWithFilteredResult(_0x5a057d,_0xbd11c4))['catch'](handleError(_0x5a057d,null));};exports[_0x561a('0x56')]=function(_0x99dc7f,_0x701cc){var _0x535335={'raw':![],'where':{'id':_0x99dc7f[_0x561a('0x57')]['id']},'include':[{'model':db[_0x561a('0x58')],'as':_0x561a('0x3d')}]},_0x1161e3={};_0x1161e3[_0x561a('0x43')]=_[_0x561a('0x45')](db[_0x561a('0x3f')]['rawAttributes']);_0x1161e3[_0x561a('0x44')]=_[_0x561a('0x45')](_0x99dc7f[_0x561a('0x44')]);_0x1161e3[_0x561a('0x46')]=_[_0x561a('0x47')](_0x1161e3[_0x561a('0x43')],_0x1161e3[_0x561a('0x44')]);_0x535335['attributes']=_[_0x561a('0x47')](_0x1161e3[_0x561a('0x43')],qs[_0x561a('0x49')](_0x99dc7f['query'][_0x561a('0x49')]));_0x535335['attributes']=_0x535335[_0x561a('0x48')][_0x561a('0x59')]?_0x535335[_0x561a('0x48')]:_0x1161e3[_0x561a('0x43')];if(_0x99dc7f[_0x561a('0x44')][_0x561a('0x53')]){_0x535335[_0x561a('0x5a')]=[{'all':!![]}];}_0x535335=_['merge']({},_0x535335,_0x99dc7f['options']);return db[_0x561a('0x3f')][_0x561a('0x5b')](_0x535335)[_0x561a('0x20')](handleEntityNotFound(_0x701cc,null))[_0x561a('0x20')](respondWithResult(_0x701cc,null))[_0x561a('0x28')](handleError(_0x701cc,null));};exports[_0x561a('0x5c')]=function(_0x4d13c8,_0x7ad2cc){return db[_0x561a('0x3f')]['create'](_0x4d13c8[_0x561a('0x5d')],{})['then'](function(_0x5194d5){var _0xc7447e=_0x4d13c8[_0x561a('0x5e')][_0x561a('0x5f')]({'plain':!![]});if(!_0xc7447e)throw new Error(_0x561a('0x60'));if(_0xc7447e['role']===_0x561a('0x5e')){var _0x4cd771=_0x5194d5[_0x561a('0x5f')]({'plain':!![]});var _0x37a693=_0x561a('0x61');return db['UserProfileSection']['find']({'where':{'name':_0x37a693,'userProfileId':_0xc7447e['userProfileId']},'raw':!![]})['then'](function(_0x5f28d7){if(_0x5f28d7&&_0x5f28d7[_0x561a('0x62')]===0x0){return db['UserProfileResource'][_0x561a('0x5c')]({'name':_0x4cd771[_0x561a('0x3a')],'resourceId':_0x4cd771['id'],'type':_0x5f28d7[_0x561a('0x3a')],'sectionId':_0x5f28d7['id']},{})['then'](function(){return _0x5194d5;});}else{return _0x5194d5;}})[_0x561a('0x28')](function(_0xb046d8){logger[_0x561a('0x24')](_0x561a('0x63'),_0xb046d8);throw _0xb046d8;});}return _0x5194d5;})[_0x561a('0x20')](respondWithResult(_0x7ad2cc,0xc9))[_0x561a('0x28')](handleError(_0x7ad2cc,null));};exports[_0x561a('0x35')]=function(_0xede99c,_0x38bcb1){if(_0xede99c[_0x561a('0x5d')]['id']){delete _0xede99c[_0x561a('0x5d')]['id'];}return db['OpenchannelAccount'][_0x561a('0x5b')]({'where':{'id':_0xede99c[_0x561a('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x561a('0x20')](handleEntityNotFound(_0x38bcb1,null))[_0x561a('0x20')](saveUpdates(_0xede99c['body'],null))[_0x561a('0x20')](respondWithResult(_0x38bcb1,null))[_0x561a('0x28')](handleError(_0x38bcb1,null));};exports[_0x561a('0x37')]=function(_0x27e18a,_0x30d2a7){return db[_0x561a('0x3f')]['find']({'where':{'id':_0x27e18a['params']['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x30d2a7,null))[_0x561a('0x20')](removeEntity(_0x30d2a7,null))[_0x561a('0x28')](handleError(_0x30d2a7,null));};exports[_0x561a('0x64')]=function(_0xbad527,_0x1656b){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x1656b,null))[_0x561a('0x28')](handleError(_0x1656b,null));};exports[_0x561a('0x65')]=function(_0x209d4b,_0x57bffc,_0x5b11d3){if(_0x209d4b['body']['id']){delete _0x209d4b['body']['id'];}return db[_0x561a('0x3f')][_0x561a('0x5b')]({'where':{'id':_0x209d4b['params']['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x57bffc,null))['then'](function(_0x538bc9){if(_0x538bc9){_0x209d4b[_0x561a('0x5d')][_0x561a('0x66')]=_0x538bc9['id'];return db['Disposition'][_0x561a('0x5c')](_0x209d4b['body']);}})[_0x561a('0x20')](respondWithResult(_0x57bffc,null))[_0x561a('0x28')](handleError(_0x57bffc,null));};exports[_0x561a('0x67')]=function(_0x7d85ff,_0x1cac4b,_0x2ded68){var _0x1d6d99={'raw':![],'where':{}};var _0x47a368={};var _0x4ef174={'count':0x0,'rows':[]};return db[_0x561a('0x3f')][_0x561a('0x68')]({'where':{'id':_0x7d85ff['params']['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x1cac4b,null))[_0x561a('0x20')](function(_0x4b7a20){if(_0x4b7a20){_0x47a368[_0x561a('0x43')]=_[_0x561a('0x45')](db[_0x561a('0x69')]['rawAttributes']);_0x47a368[_0x561a('0x44')]=_[_0x561a('0x45')](_0x7d85ff['query']);_0x47a368[_0x561a('0x46')]=_['intersection'](_0x47a368[_0x561a('0x43')],_0x47a368[_0x561a('0x44')]);_0x1d6d99[_0x561a('0x48')]=_['intersection'](_0x47a368[_0x561a('0x43')],qs['fields'](_0x7d85ff[_0x561a('0x44')]['fields']));_0x1d6d99[_0x561a('0x48')]=_0x1d6d99[_0x561a('0x48')][_0x561a('0x59')]?_0x1d6d99[_0x561a('0x48')]:_0x47a368[_0x561a('0x43')];if(!_0x7d85ff[_0x561a('0x44')]['hasOwnProperty']('nolimit')){_0x1d6d99[_0x561a('0x2f')]=qs[_0x561a('0x2f')](_0x7d85ff['query'][_0x561a('0x2f')]);_0x1d6d99[_0x561a('0x2c')]=qs[_0x561a('0x2c')](_0x7d85ff[_0x561a('0x44')][_0x561a('0x2c')]);}_0x1d6d99[_0x561a('0x4c')]=qs[_0x561a('0x4d')](_0x7d85ff[_0x561a('0x44')][_0x561a('0x4d')]);_0x1d6d99[_0x561a('0x4f')]=qs[_0x561a('0x46')](_[_0x561a('0x6a')](_0x7d85ff[_0x561a('0x44')],_0x47a368['filters']));_0x1d6d99[_0x561a('0x4f')][_0x561a('0x66')]=_0x4b7a20['id'];if(_0x7d85ff[_0x561a('0x44')]['filter']){_0x1d6d99[_0x561a('0x4f')]=_[_0x561a('0x52')](_0x1d6d99[_0x561a('0x4f')],{'$or':_[_0x561a('0x3e')](_0x1d6d99['attributes'],function(_0x2b4039){var _0x204a83={};_0x204a83[_0x2b4039]={'$like':'%'+_0x7d85ff[_0x561a('0x44')][_0x561a('0x4e')]+'%'};return _0x204a83;})});}_0x1d6d99=_[_0x561a('0x52')]({},_0x1d6d99,_0x7d85ff[_0x561a('0x6b')]);return db[_0x561a('0x69')]['count']({'where':_0x1d6d99['where']})[_0x561a('0x20')](function(_0x17b0f2){_0x4ef174['count']=_0x17b0f2;if(_0x7d85ff['query']['includeAll']){_0x1d6d99[_0x561a('0x5a')]=[{'all':!![]}];}return db[_0x561a('0x69')][_0x561a('0x54')](_0x1d6d99);})['then'](function(_0x4ba93f){_0x4ef174['rows']=_0x4ba93f;return _0x4ef174;});}})[_0x561a('0x20')](respondWithFilteredResult(_0x1cac4b,_0x1d6d99))[_0x561a('0x28')](handleError(_0x1cac4b,null));};exports[_0x561a('0x6c')]=function(_0x1b5e89,_0x4b53dc,_0xfd61b5){return db[_0x561a('0x3f')][_0x561a('0x5b')]({'where':{'id':_0x1b5e89[_0x561a('0x57')]['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x4b53dc,null))['then'](function(_0x59a5d0){if(_0x59a5d0){return _0x59a5d0[_0x561a('0x6c')](_0x1b5e89[_0x561a('0x44')][_0x561a('0x6d')]);}})[_0x561a('0x20')](respondWithStatusCode(_0x4b53dc,null))[_0x561a('0x28')](handleError(_0x4b53dc,null));};exports[_0x561a('0x6e')]=function(_0x48f64d,_0x2d5d77,_0x1d3771){if(_0x48f64d[_0x561a('0x5d')]['id']){delete _0x48f64d[_0x561a('0x5d')]['id'];}return db[_0x561a('0x3f')]['find']({'where':{'id':_0x48f64d[_0x561a('0x57')]['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x2d5d77,null))[_0x561a('0x20')](function(_0x3c4bb0){if(_0x3c4bb0){_0x48f64d[_0x561a('0x5d')][_0x561a('0x66')]=_0x3c4bb0['id'];return db[_0x561a('0x6f')][_0x561a('0x5c')](_0x48f64d[_0x561a('0x5d')]);}})['then'](respondWithResult(_0x2d5d77,null))[_0x561a('0x28')](handleError(_0x2d5d77,null));};exports[_0x561a('0x70')]=function(_0x26cbbd,_0x2874a0,_0x3868c7){var _0xb9dda6={'raw':![],'where':{}};var _0x2ced12={};var _0x568d70={'count':0x0,'rows':[]};return db[_0x561a('0x3f')][_0x561a('0x68')]({'where':{'id':_0x26cbbd['params']['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x2874a0,null))[_0x561a('0x20')](function(_0x2b22dd){if(_0x2b22dd){_0x2ced12[_0x561a('0x43')]=_['keys'](db[_0x561a('0x6f')][_0x561a('0x40')]);_0x2ced12[_0x561a('0x44')]=_[_0x561a('0x45')](_0x26cbbd[_0x561a('0x44')]);_0x2ced12[_0x561a('0x46')]=_[_0x561a('0x47')](_0x2ced12[_0x561a('0x43')],_0x2ced12['query']);_0xb9dda6['attributes']=_[_0x561a('0x47')](_0x2ced12['model'],qs[_0x561a('0x49')](_0x26cbbd[_0x561a('0x44')][_0x561a('0x49')]));_0xb9dda6['attributes']=_0xb9dda6[_0x561a('0x48')][_0x561a('0x59')]?_0xb9dda6[_0x561a('0x48')]:_0x2ced12[_0x561a('0x43')];if(!_0x26cbbd['query'][_0x561a('0x4a')](_0x561a('0x4b'))){_0xb9dda6['limit']=qs['limit'](_0x26cbbd['query']['limit']);_0xb9dda6[_0x561a('0x2c')]=qs[_0x561a('0x2c')](_0x26cbbd['query'][_0x561a('0x2c')]);}_0xb9dda6[_0x561a('0x4c')]=qs[_0x561a('0x4d')](_0x26cbbd[_0x561a('0x44')][_0x561a('0x4d')]);_0xb9dda6[_0x561a('0x4f')]=qs[_0x561a('0x46')](_[_0x561a('0x6a')](_0x26cbbd[_0x561a('0x44')],_0x2ced12['filters']));_0xb9dda6[_0x561a('0x4f')][_0x561a('0x66')]=_0x2b22dd['id'];if(_0x26cbbd['query'][_0x561a('0x4e')]){_0xb9dda6[_0x561a('0x4f')]=_[_0x561a('0x52')](_0xb9dda6[_0x561a('0x4f')],{'$or':_[_0x561a('0x3e')](_0xb9dda6['attributes'],function(_0x46cc34){var _0x3aa49a={};_0x3aa49a[_0x46cc34]={'$like':'%'+_0x26cbbd[_0x561a('0x44')][_0x561a('0x4e')]+'%'};return _0x3aa49a;})});}_0xb9dda6=_[_0x561a('0x52')]({},_0xb9dda6,_0x26cbbd[_0x561a('0x6b')]);return db[_0x561a('0x6f')]['count']({'where':_0xb9dda6[_0x561a('0x4f')]})[_0x561a('0x20')](function(_0x93530e){_0x568d70['count']=_0x93530e;if(_0x26cbbd['query'][_0x561a('0x53')]){_0xb9dda6['include']=[{'all':!![]}];}return db[_0x561a('0x6f')][_0x561a('0x54')](_0xb9dda6);})[_0x561a('0x20')](function(_0x4631af){_0x568d70['rows']=_0x4631af;return _0x568d70;});}})[_0x561a('0x20')](respondWithFilteredResult(_0x2874a0,_0xb9dda6))[_0x561a('0x28')](handleError(_0x2874a0,null));};exports[_0x561a('0x71')]=function(_0x3d884b,_0x33653b,_0x110001){return db['OpenchannelAccount'][_0x561a('0x5b')]({'where':{'id':_0x3d884b[_0x561a('0x57')]['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x33653b,null))['then'](function(_0x407c68){if(_0x407c68){return _0x407c68[_0x561a('0x71')](_0x3d884b[_0x561a('0x44')][_0x561a('0x6d')]);}})[_0x561a('0x20')](respondWithStatusCode(_0x33653b,null))[_0x561a('0x28')](handleError(_0x33653b,null));};exports[_0x561a('0x72')]=function(_0x1939cc,_0x5978e1,_0x4eeb6e){var _0x242e60={'body':_0x1939cc[_0x561a('0x5d')],'channel':_0x561a('0x73')};var _0x1a97ce=[];var _0x34fb60=[];var _0x2727a6={};var _0x280a26=![];return db[_0x561a('0x74')][_0x561a('0x64')]()[_0x561a('0x20')](function(_0x5517c0){if(!_0x5517c0){throw new db[(_0x561a('0x75'))][(_0x561a('0x76'))](_0x561a('0x77'));}_0x1a97ce=_[_0x561a('0x78')](_[_0x561a('0x45')](_0x5517c0),['createdAt',_0x561a('0x79')]);_0x34fb60=_[_0x561a('0x78')](_[_0x561a('0x45')](_0x5517c0),[_0x561a('0x7a'),'updatedAt',_0x561a('0x7b'),'ListId']);if(_0x1939cc['body']['id']){delete _0x1939cc['body']['id'];}if(_[_0x561a('0x7c')](_0x1939cc[_0x561a('0x5d')][_0x561a('0x7d')])){throw new db[(_0x561a('0x75'))][(_0x561a('0x76'))](_0x561a('0x7e'));}if(_[_0x561a('0x7c')](_0x1939cc[_0x561a('0x5d')][_0x561a('0x5d')])||_0x1939cc[_0x561a('0x5d')][_0x561a('0x5d')]===''){throw new db[(_0x561a('0x75'))][(_0x561a('0x76'))](_0x561a('0x7f'));}if(_[_0x561a('0x7c')](_0x1939cc[_0x561a('0x5d')][_0x561a('0x80')])){throw new db[(_0x561a('0x75'))][(_0x561a('0x76'))](_0x561a('0x81')+_0x34fb60);}if(!_[_0x561a('0x82')](_0x34fb60,_0x1939cc[_0x561a('0x5d')][_0x561a('0x80')])){throw new db[(_0x561a('0x75'))][(_0x561a('0x76'))](_0x561a('0x83')+_0x34fb60);}_0x2727a6[_0x1939cc[_0x561a('0x5d')][_0x561a('0x80')]]=_0x1939cc[_0x561a('0x5d')]['from'];})[_0x561a('0x20')](function(){return db[_0x561a('0x3f')]['find']({'where':{'id':_0x1939cc[_0x561a('0x57')]['id']},'include':[{'model':db[_0x561a('0x84')],'as':_0x561a('0x85'),'include':[{'model':db[_0x561a('0x74')],'as':_0x561a('0x86'),'where':_0x2727a6,'limit':0x1,'order':[[_0x561a('0x79'),'DESC']]}]},{'model':db[_0x561a('0x87')],'as':_0x561a('0x88')}]});})[_0x561a('0x20')](handleEntityNotFound(_0x5978e1,null))['then'](function(_0x4e5411){if(_0x4e5411&&_0x4e5411[_0x561a('0x85')]){_0x242e60[_0x561a('0x89')]=_0x4e5411;_0x242e60[_0x561a('0x8a')]=_0x4e5411[_0x561a('0x88')];_0x242e60[_0x561a('0x8b')]=_0x4e5411[_0x561a('0x85')];_0x242e60[_0x561a('0x8a')]=_[_0x561a('0x8c')](_0x242e60[_0x561a('0x8a')],[_0x561a('0x8d')],[_0x561a('0x8e')]);if(_0x242e60[_0x561a('0x89')][_0x561a('0x88')]){delete _0x242e60[_0x561a('0x89')][_0x561a('0x88')];}if(_0x242e60[_0x561a('0x89')][_0x561a('0x85')]&&_0x242e60[_0x561a('0x89')][_0x561a('0x85')][_0x561a('0x86')][_0x561a('0x59')]){return _0x242e60[_0x561a('0x89')]['List'][_0x561a('0x86')][0x0];}var _0x445981=_[_0x561a('0x19')](_0x1939cc[_0x561a('0x5d')],{'firstName':_0x1939cc[_0x561a('0x5d')]['from'],'ListId':_0x4e5411[_0x561a('0x8f')]});_0x445981[_0x1939cc[_0x561a('0x5d')][_0x561a('0x80')]]=_0x1939cc[_0x561a('0x5d')]['from'];return db['CmContact'][_0x561a('0x5c')](_0x445981,{'fields':_0x1a97ce,'raw':!![]});}})[_0x561a('0x20')](handleEntityNotFound(_0x5978e1,null))[_0x561a('0x20')](function(_0x4953e6){_0x242e60[_0x561a('0x90')]=_0x4953e6;if(_0x4953e6){var _0x494670={'ContactId':_0x4953e6['id'],'OpenchannelAccountId':_0x1939cc['params']['id'],'from':(_0x4953e6['firstName']||'')+'\x20'+(_0x4953e6[_0x561a('0x91')]||'')};var _0x4a205e={'OpenchannelAccountId':_0x1939cc['params']['id'],'closed':![]};if(_0x1939cc['body']['threadId']){_0x4a205e[_0x561a('0x92')]=_0x1939cc[_0x561a('0x5d')][_0x561a('0x92')];return db[_0x561a('0x93')][_0x561a('0x5b')]({'where':_0x4a205e})[_0x561a('0x20')](function(_0x5f7644){if(_0x5f7644){return[_0x5f7644,![]];}_0x494670['threadId']=_0x1939cc[_0x561a('0x5d')]['threadId'];_0x494670[_0x561a('0x94')]=_0x1939cc[_0x561a('0x5d')][_0x561a('0x94')];return db[_0x561a('0x93')][_0x561a('0x5c')](_0x494670)['then'](function(_0x45d729){return[_0x45d729,!![]];});});}else{_0x4a205e[_0x561a('0x92')]=null;}_0x4a205e['ContactId']=_0x4953e6['id'];return db[_0x561a('0x93')][_0x561a('0x5b')]({'where':_0x4a205e})['then'](function(_0x544cd7){if(_0x544cd7){return[_0x544cd7,![]];}return db['OpenchannelInteraction'][_0x561a('0x5c')](_0x494670)[_0x561a('0x20')](function(_0x47e324){return[_0x47e324,!![]];});});}})[_0x561a('0x95')](function(_0x3c37a5,_0xc28cbf){if(_0x3c37a5){_0x280a26=_0xc28cbf;if(!_0xc28cbf){var _0x3f32fa={'from':(_0x242e60[_0x561a('0x90')][_0x561a('0x96')]||'')+'\x20'+(_0x242e60[_0x561a('0x90')][_0x561a('0x91')]||'')};if(_0x1939cc[_0x561a('0x5d')][_0x561a('0x92')]&&_0x1939cc[_0x561a('0x5d')][_0x561a('0x97')]&&_0x1939cc[_0x561a('0x5d')][_0x561a('0x92')]!=_0x1939cc[_0x561a('0x5d')][_0x561a('0x97')]){_0x3f32fa[_0x561a('0x92')]=_0x1939cc[_0x561a('0x5d')][_0x561a('0x97')];}return _0x3c37a5['update'](_0x3f32fa);}else{return _0x3c37a5;}}})[_0x561a('0x20')](function(_0x53673a){_0x242e60[_0x561a('0x98')]=_0x53673a['get']({'plain':!![]});_0x242e60[_0x561a('0x98')][_0x561a('0x99')]=_0x280a26;if(_0x242e60['interaction'][_0x561a('0x99')]){if(_0x242e60[_0x561a('0x89')][_0x561a('0x9a')]){_0x242e60['applications'][_0x561a('0x9b')]({'id':0x0,'priority':_0x242e60[_0x561a('0x8a')][_0x561a('0x59')]+0x1,'app':_0x561a('0x9c'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x561a('0x5c')]({'body':_0x1939cc[_0x561a('0x5d')][_0x561a('0x5d')],'OpenchannelAccountId':_0x1939cc['params']['id'],'OpenchannelInteractionId':_0x53673a['id'],'direction':'in','ContactId':_0x242e60['contact']['id'],'AttachmentId':_0x1939cc[_0x561a('0x5d')][_0x561a('0x9d')]});})[_0x561a('0x20')](function(_0xd1f53a){_0x242e60['message']=_0xd1f53a;if(_0x242e60[_0x561a('0x98')]['UserId']){return db[_0x561a('0x9e')][_0x561a('0x5b')]({'attributes':['id',_0x561a('0x3a')],'where':{'id':_0x242e60[_0x561a('0x98')][_0x561a('0x9f')]}})[_0x561a('0x20')](function(_0x2c52ed){if(_0x2c52ed){_0x242e60['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x561a('0xa0'),'appdata':_0x2c52ed[_0x561a('0x3a')]+','+(_0x242e60[_0x561a('0x89')][_0x561a('0xa1')]||0xa),'interval':'*,*,*,*'});_0x242e60[_0x561a('0xa2')]=![];}return respondWithRpcPromise('Start',_0x561a('0xa3'),_0x242e60);});}return respondWithRpcPromise(_0x561a('0xa4'),'startRouting',_0x242e60);})[_0x561a('0x20')](function(_0x103cb2){respondWithRpcPromise('EventManager',_0x561a('0xa5'),{'event':'notify','message':_0x103cb2},client9002);return _0x103cb2;})[_0x561a('0x20')](respondWithResult(_0x5978e1,null))[_0x561a('0x28')](handleError(_0x5978e1,null));};exports[_0x561a('0xa6')]=function(_0x571180,_0x49d5a1){var _0x5e4c3e=_0x571180['params']['id'];var _0x42c185=_0x571180['body'];var _0x4bc01f=0xc8;var _0x2b4f78=null;return db['sequelize'][_0x561a('0xa7')]({'isolationLevel':db['sequelize'][_0x561a('0xa8')][_0x561a('0xa9')][_0x561a('0xaa')]},function(_0x244621){return db[_0x561a('0x3f')][_0x561a('0x68')]({'where':{'id':_0x5e4c3e},'transaction':_0x244621})[_0x561a('0x20')](function(_0xe4cb8c){if(_0xe4cb8c){return db[_0x561a('0x87')][_0x561a('0x37')]({'where':{'OpenchannelAccountId':_0x5e4c3e},'transaction':_0x244621})[_0x561a('0x20')](function(){var _0x5e0591=_[_0x561a('0x3e')](_0x42c185,function(_0xd67af){_0xd67af[_0x561a('0x66')]=_0x5e4c3e;return _0xd67af;});return db[_0x561a('0x87')][_0x561a('0xab')](_0x5e0591,{'transaction':_0x244621});});}else{_0x4bc01f=0x194;_0x2b4f78=[];}});})[_0x561a('0x20')](function(){if(_0x4bc01f!==0x194){return db[_0x561a('0x87')][_0x561a('0xac')]({'where':{'OpenchannelAccountId':_0x5e4c3e},'order':_0x561a('0x8d')})[_0x561a('0x20')](function(_0x281531){_0x2b4f78=_0x281531;});}})[_0x561a('0x28')](function(_0x5578f2){_0x4bc01f=0x1f4;logger[_0x561a('0x24')](_0x5578f2['stack']);if(_0x5578f2[_0x561a('0x3a')]){delete _0x5578f2[_0x561a('0x3a')];}_0x2b4f78=_0x5578f2;})[_0x561a('0xad')](function(){if(_0x2b4f78===null){_0x49d5a1['sendStatus'](_0x4bc01f);}else{if(_0x4bc01f===0x1f4){_0x49d5a1[_0x561a('0x2a')](_0x4bc01f)[_0x561a('0x3b')](_0x2b4f78);}else{_0x49d5a1['status'](_0x4bc01f)['json'](_0x2b4f78);}}});};exports[_0x561a('0xae')]=function(_0x170b05,_0x1944a1,_0xdf241d){var _0x4640bb={};var _0x217b5f={};var _0x14ca96;var _0x26e086;return db[_0x561a('0x3f')][_0x561a('0x68')]({'where':{'id':_0x170b05[_0x561a('0x57')]['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x1944a1,null))[_0x561a('0x20')](function(_0x96cdc3){if(_0x96cdc3){_0x14ca96=_0x96cdc3;_0x217b5f[_0x561a('0x43')]=_[_0x561a('0x45')](db[_0x561a('0x87')][_0x561a('0x40')]);_0x217b5f[_0x561a('0x44')]=_[_0x561a('0x45')](_0x170b05[_0x561a('0x44')]);_0x217b5f[_0x561a('0x46')]=_['intersection'](_0x217b5f[_0x561a('0x43')],_0x217b5f[_0x561a('0x44')]);_0x4640bb[_0x561a('0x48')]=_[_0x561a('0x47')](_0x217b5f[_0x561a('0x43')],qs[_0x561a('0x49')](_0x170b05[_0x561a('0x44')][_0x561a('0x49')]));_0x4640bb[_0x561a('0x48')]=_0x4640bb[_0x561a('0x48')][_0x561a('0x59')]?_0x4640bb[_0x561a('0x48')]:_0x217b5f[_0x561a('0x43')];_0x4640bb['order']=qs[_0x561a('0x4d')](_0x170b05[_0x561a('0x44')]['sort']);_0x4640bb[_0x561a('0x4f')]=qs[_0x561a('0x46')](_[_0x561a('0x6a')](_0x170b05[_0x561a('0x44')],_0x217b5f['filters']));if(_0x170b05[_0x561a('0x44')][_0x561a('0x4e')]){_0x4640bb[_0x561a('0x4f')]=_[_0x561a('0x52')](_0x4640bb[_0x561a('0x4f')],{'$or':_[_0x561a('0x3e')](_0x4640bb[_0x561a('0x48')],function(_0x277d6b){var _0xe8b070={};_0xe8b070[_0x277d6b]={'$like':'%'+_0x170b05['query'][_0x561a('0x4e')]+'%'};return _0xe8b070;})});}_0x4640bb=_['merge']({},_0x4640bb,_0x170b05[_0x561a('0x6b')]);return _0x14ca96[_0x561a('0xae')](_0x4640bb);}})[_0x561a('0x20')](function(_0x36e6b1){if(_0x36e6b1){_0x26e086=_0x36e6b1[_0x561a('0x59')];if(!_0x170b05[_0x561a('0x44')]['hasOwnProperty']('nolimit')){_0x4640bb[_0x561a('0x2f')]=qs[_0x561a('0x2f')](_0x170b05[_0x561a('0x44')][_0x561a('0x2f')]);_0x4640bb['offset']=qs[_0x561a('0x2c')](_0x170b05[_0x561a('0x44')]['offset']);}return _0x14ca96[_0x561a('0xae')](_0x4640bb);}})[_0x561a('0x20')](function(_0x41f28a){if(_0x41f28a){return _0x41f28a?{'count':_0x26e086,'rows':_0x41f28a}:null;}})[_0x561a('0x20')](respondWithResult(_0x1944a1,null))['catch'](handleError(_0x1944a1,null));};exports['getInteractions']=function(_0x1b1719,_0x14f074,_0x34438d){var _0x5c45a5={'raw':![],'where':{}};var _0x44840f={};var _0xe7b66f={'count':0x0,'rows':[]};return db[_0x561a('0x3f')]['findOne']({'where':{'id':_0x1b1719['params']['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x14f074,null))['then'](function(_0x4198a3){if(_0x4198a3){_0x44840f['model']=_['keys'](db[_0x561a('0x93')][_0x561a('0x40')]);_0x44840f[_0x561a('0x44')]=_[_0x561a('0x45')](_0x1b1719[_0x561a('0x44')]);_0x44840f[_0x561a('0x46')]=_[_0x561a('0x47')](_0x44840f['model'],_0x44840f[_0x561a('0x44')]);_0x5c45a5['attributes']=_[_0x561a('0x47')](_0x44840f[_0x561a('0x43')],qs[_0x561a('0x49')](_0x1b1719[_0x561a('0x44')][_0x561a('0x49')]));_0x5c45a5['attributes']=_0x5c45a5[_0x561a('0x48')][_0x561a('0x59')]?_0x5c45a5[_0x561a('0x48')]:_0x44840f[_0x561a('0x43')];if(!_0x1b1719[_0x561a('0x44')]['hasOwnProperty'](_0x561a('0x4b'))){_0x5c45a5['limit']=qs[_0x561a('0x2f')](_0x1b1719[_0x561a('0x44')][_0x561a('0x2f')]);_0x5c45a5['offset']=qs[_0x561a('0x2c')](_0x1b1719[_0x561a('0x44')][_0x561a('0x2c')]);}_0x5c45a5['order']=qs[_0x561a('0x4d')](_0x1b1719['query']['sort']);_0x5c45a5[_0x561a('0x4f')]=qs[_0x561a('0x46')](_[_0x561a('0x6a')](_0x1b1719[_0x561a('0x44')],_0x44840f['filters']));_0x5c45a5[_0x561a('0x4f')][_0x561a('0x66')]=_0x4198a3['id'];if(_0x1b1719[_0x561a('0x44')][_0x561a('0x4e')]){_0x5c45a5[_0x561a('0x4f')]=_[_0x561a('0x52')](_0x5c45a5[_0x561a('0x4f')],{'$or':_[_0x561a('0x3e')](_0x5c45a5['attributes'],function(_0x66941d){var _0xbe1dbf={};_0xbe1dbf[_0x66941d]={'$like':'%'+_0x1b1719['query'][_0x561a('0x4e')]+'%'};return _0xbe1dbf;})});}_0x5c45a5=_[_0x561a('0x52')]({},_0x5c45a5,_0x1b1719[_0x561a('0x6b')]);return db[_0x561a('0x93')][_0x561a('0x2e')]({'where':_0x5c45a5[_0x561a('0x4f')]})[_0x561a('0x20')](function(_0x12057c){_0xe7b66f['count']=_0x12057c;if(_0x1b1719[_0x561a('0x44')][_0x561a('0x53')]){_0x5c45a5['include']=[{'model':db[_0x561a('0x74')],'as':'Contact','required':![]},{'model':db[_0x561a('0x9e')],'as':_0x561a('0xaf'),'attributes':['name',_0x561a('0xb0'),_0x561a('0xb1')],'required':![]},{'model':db[_0x561a('0xb2')],'as':'Tags','attributes':['id',_0x561a('0x3a'),'color'],'where':_0x1b1719[_0x561a('0x44')][_0x561a('0xb3')]?{'id':_0x1b1719[_0x561a('0x44')]['tag']}:undefined,'required':_0x1b1719[_0x561a('0x44')]['tag']?!![]:![]}];}return db[_0x561a('0x93')][_0x561a('0x54')](_0x5c45a5);})[_0x561a('0x20')](function(_0x2e4777){_0xe7b66f[_0x561a('0x55')]=_0x2e4777;return _0xe7b66f;});}})['then'](respondWithFilteredResult(_0x14f074,_0x5c45a5))['catch'](handleError(_0x14f074,null));};exports[_0x561a('0xb4')]=function(_0x229f1d,_0x33ad75,_0x329c1f){return db[_0x561a('0x3f')][_0x561a('0x5b')]({'where':{'id':_0x229f1d['params']['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x33ad75,null))[_0x561a('0x20')](function(_0x2638f9){if(_0x2638f9){return _0x2638f9[_0x561a('0xb4')](_0x229f1d[_0x561a('0x5d')][_0x561a('0x6d')],_['omit'](_0x229f1d[_0x561a('0x5d')],[_0x561a('0x6d'),'id'])||{})[_0x561a('0x95')](function(_0x8380df){for(var _0xbc155e=0x0;_0xbc155e<_0x229f1d['body'][_0x561a('0x6d')][_0x561a('0x59')];_0xbc155e+=0x1){socket[_0x561a('0xb5')](_0x561a('0xb6'),{'UserId':Number(_0x229f1d[_0x561a('0x5d')][_0x561a('0x6d')][_0xbc155e]),'OpenchannelAccountId':Number(_0x229f1d[_0x561a('0x57')]['id'])});}return _0x8380df;});}})[_0x561a('0x20')](respondWithResult(_0x33ad75,null))['catch'](handleError(_0x33ad75,null));};exports[_0x561a('0xb7')]=function(_0x1b34e5,_0xa4cf49,_0x4d0fef){return db['OpenchannelAccount'][_0x561a('0x5b')]({'where':{'id':_0x1b34e5[_0x561a('0x57')]['id']}})[_0x561a('0x20')](handleEntityNotFound(_0xa4cf49,null))[_0x561a('0x20')](function(_0x4544e7){if(_0x4544e7){return _0x4544e7['removeAgents'](_0x1b34e5[_0x561a('0x44')][_0x561a('0x6d')])[_0x561a('0x20')](function(){if(_[_0x561a('0xb8')](_0x1b34e5[_0x561a('0x44')][_0x561a('0x6d')])){for(var _0x56fffe=0x0;_0x56fffe<_0x1b34e5[_0x561a('0x44')][_0x561a('0x6d')][_0x561a('0x59')];_0x56fffe+=0x1){socket[_0x561a('0xb5')](_0x561a('0xb9'),{'UserId':Number(_0x1b34e5[_0x561a('0x44')][_0x561a('0x6d')][_0x56fffe]),'OpenchannelAccountId':Number(_0x1b34e5['params']['id'])});}}else{socket['emit'](_0x561a('0xb9'),{'UserId':Number(_0x1b34e5[_0x561a('0x44')][_0x561a('0x6d')]),'OpenchannelAccountId':Number(_0x1b34e5[_0x561a('0x57')]['id'])});}});}})[_0x561a('0x20')](respondWithStatusCode(_0xa4cf49,null))[_0x561a('0x28')](handleError(_0xa4cf49,null));};exports['getAgents']=function(_0x1a3d41,_0x340aab,_0x3248d2){var _0x3771d6={};var _0x32b3fd={};var _0x2b20d9;var _0x20cb38;return db[_0x561a('0x3f')]['findOne']({'where':{'id':_0x1a3d41[_0x561a('0x57')]['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x340aab,null))[_0x561a('0x20')](function(_0x42d179){if(_0x42d179){_0x2b20d9=_0x42d179;_0x32b3fd[_0x561a('0x43')]=_[_0x561a('0x45')](db[_0x561a('0x9e')][_0x561a('0x40')]);_0x32b3fd[_0x561a('0x44')]=_['keys'](_0x1a3d41[_0x561a('0x44')]);_0x32b3fd['filters']=_[_0x561a('0x47')](_0x32b3fd['model'],_0x32b3fd[_0x561a('0x44')]);_0x3771d6['attributes']=_[_0x561a('0x47')](_0x32b3fd['model'],qs[_0x561a('0x49')](_0x1a3d41[_0x561a('0x44')]['fields']));_0x3771d6[_0x561a('0x48')]=_0x3771d6[_0x561a('0x48')]['length']?_0x3771d6['attributes']:_0x32b3fd[_0x561a('0x43')];_0x3771d6[_0x561a('0x4c')]=qs[_0x561a('0x4d')](_0x1a3d41['query'][_0x561a('0x4d')]);_0x3771d6[_0x561a('0x4f')]=qs[_0x561a('0x46')](_[_0x561a('0x6a')](_0x1a3d41[_0x561a('0x44')],_0x32b3fd[_0x561a('0x46')]));if(_0x1a3d41['query'][_0x561a('0x4e')]){_0x3771d6[_0x561a('0x4f')]=_[_0x561a('0x52')](_0x3771d6[_0x561a('0x4f')],{'$or':_['map'](_0x3771d6[_0x561a('0x48')],function(_0x3a885e){var _0x5c725d={};_0x5c725d[_0x3a885e]={'$like':'%'+_0x1a3d41[_0x561a('0x44')]['filter']+'%'};return _0x5c725d;})});}_0x3771d6=_['merge']({},_0x3771d6,_0x1a3d41[_0x561a('0x6b')]);return _0x2b20d9[_0x561a('0xba')](_0x3771d6);}})[_0x561a('0x20')](function(_0x729feb){if(_0x729feb){_0x20cb38=_0x729feb[_0x561a('0x59')];if(!_0x1a3d41[_0x561a('0x44')][_0x561a('0x4a')]('nolimit')){_0x3771d6['limit']=qs[_0x561a('0x2f')](_0x1a3d41[_0x561a('0x44')][_0x561a('0x2f')]);_0x3771d6['offset']=qs[_0x561a('0x2c')](_0x1a3d41[_0x561a('0x44')][_0x561a('0x2c')]);}return _0x2b20d9[_0x561a('0xba')](_0x3771d6);}})[_0x561a('0x20')](function(_0x25033a){if(_0x25033a){return _0x25033a?{'count':_0x20cb38,'rows':_0x25033a}:null;}})[_0x561a('0x20')](respondWithResult(_0x340aab,null))['catch'](handleError(_0x340aab,null));};exports['send']=function(_0x472161,_0x144b30,_0x59cd33){var _0x75b839,_0x5f517c,_0x52113b;if(_['isNil'](_0x472161[_0x561a('0x5d')]['body'])||_0x472161[_0x561a('0x5d')]['body']===''){throw new db[(_0x561a('0x75'))][(_0x561a('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x561a('0x7c')](_0x472161[_0x561a('0x5d')]['to'])){}_0x75b839=_0x472161['body']['to'];return db['OpenchannelAccount'][_0x561a('0x68')]({'where':{'id':_0x472161['params']['id']}})[_0x561a('0x20')](handleEntityNotFound(_0x144b30,null))[_0x561a('0x20')](function(_0x3cbdb7){if(_0x3cbdb7){return db['OpenchannelAccount'][_0x561a('0x5b')]({'where':{'id':_0x3cbdb7['id']},'include':[{'model':db['CmList'],'as':_0x561a('0x85'),'include':[{'model':db['CmContact'],'as':_0x561a('0x86'),'where':{[_0x3cbdb7[_0x561a('0x80')]]:_0x75b839},'limit':0x1,'order':[[_0x561a('0x79'),_0x561a('0xbb')]]}]}]})[_0x561a('0x20')](handleEntityNotFound(_0x144b30,null))[_0x561a('0x20')](function(_0x12091c){if(_0x12091c&&_0x12091c[_0x561a('0x85')]){_0x5f517c=_0x12091c['get']({'plain':!![]});if(_0x5f517c[_0x561a('0x85')]&&_0x5f517c[_0x561a('0x85')][_0x561a('0x86')][_0x561a('0x59')]){return _0x5f517c[_0x561a('0x85')][_0x561a('0x86')][0x0];}return db[_0x561a('0x74')][_0x561a('0x5c')](_['defaults'](_0x472161[_0x561a('0x5d')],{'firstName':_0x75b839,[_0x12091c[_0x561a('0x80')]]:_0x75b839,'phone':_0x75b839,'ListId':_0x5f517c['ListId']}));}})[_0x561a('0x20')](handleEntityNotFound(_0x144b30,null))[_0x561a('0x20')](function(_0x228ba0){if(_0x228ba0){_0x52113b=_0x228ba0;return db[_0x561a('0x93')][_0x561a('0x5b')]({'where':{'ContactId':_0x52113b['id'],'closed':![],'OpenchannelAccountId':_0x5f517c['id']}})[_0x561a('0x20')](function(_0x4d05cc){if(_0x4d05cc){return[_0x4d05cc,![]];}return db[_0x561a('0x93')][_0x561a('0x5c')]({'UserId':_0x472161[_0x561a('0x5e')]['id'],'ContactId':_0x52113b['id'],'OpenchannelAccountId':_0x5f517c['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_[_0x561a('0x52')](_0x472161[_0x561a('0x5d')],{'read':![],'body':_0x472161[_0x561a('0x5d')][_0x561a('0x5d')],'OpenchannelAccountId':_0x5f517c['id'],'UserId':_0x472161[_0x561a('0x5e')]['id'],'ContactId':_0x52113b['id']})]},{'include':[{'model':db[_0x561a('0xbc')],'as':_0x561a('0xbd')}]})[_0x561a('0x20')](function(_0x68ebaf){return[_0x68ebaf,!![]];});});}})[_0x561a('0x95')](function(_0x4563b4,_0x39594d){if(_0x39594d){return _0x4563b4;}return db['OpenchannelMessage'][_0x561a('0x5c')](_[_0x561a('0x52')](_0x472161[_0x561a('0x5d')],{'read':![],'body':_0x472161[_0x561a('0x5d')]['body'],'OpenchannelAccountId':_0x5f517c['id'],'OpenchannelInteractionId':_0x4563b4['id'],'UserId':_0x472161[_0x561a('0x5e')]['id'],'ContactId':_0x52113b['id']}))[_0x561a('0x20')](function(_0x147b58){_0x4563b4[_0x561a('0xbe')][_0x561a('0xbd')]=[];_0x4563b4[_0x561a('0xbe')][_0x561a('0xbd')][_0x561a('0x9b')](_0x147b58['dataValues']);return _0x4563b4;});});}})[_0x561a('0x20')](respondWithResult(_0x144b30,null))[_0x561a('0x28')](handleError(_0x144b30,null));}; \ No newline at end of file +var _0x9c5b=['from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','orderBy','priority','asc','Applications','defaults','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','firstName','messageId','interaction','created','push','close','unmanaged','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','send','getApplications','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','index','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','Pause','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','Disposition','findOne','pick','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil'];(function(_0x50c025,_0x39a645){var _0x4b1825=function(_0x1f4476){while(--_0x1f4476){_0x50c025['push'](_0x50c025['shift']());}};_0x4b1825(++_0x39a645);}(_0x9c5b,0x1cb));var _0xb9c5=function(_0x32651e,_0x48964c){_0x32651e=_0x32651e-0x0;var _0x2e191f=_0x9c5b[_0x32651e];return _0x2e191f;};'use strict';var emlformat=require(_0xb9c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9c5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9c5('0x2'));var moment=require(_0xb9c5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb9c5('0x4'));var util=require(_0xb9c5('0x5'));var path=require(_0xb9c5('0x6'));var sox=require(_0xb9c5('0x7'));var csv=require(_0xb9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9c5('0x9'));var _=require(_0xb9c5('0xa'));var squel=require('squel');var crypto=require(_0xb9c5('0xb'));var jsforce=require(_0xb9c5('0xc'));var deskjs=require(_0xb9c5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9c5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb9c5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb9c5('0x10'));var hardwareService=require(_0xb9c5('0x11'));var logger=require(_0xb9c5('0x12'))('api');var utils=require(_0xb9c5('0x13'));var config=require(_0xb9c5('0x14'));var licenseUtil=require(_0xb9c5('0x15'));var db=require(_0xb9c5('0x16'))['db'];config[_0xb9c5('0x17')]=_['defaults'](config[_0xb9c5('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9c5('0x18'))(new Redis(config[_0xb9c5('0x17')]));require(_0xb9c5('0x19'))[_0xb9c5('0x1a')](socket);var jayson=require(_0xb9c5('0x1b'));var client=jayson[_0xb9c5('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xb9c5('0x1c')][_0xb9c5('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x362d53,_0x41b3a0,_0x3b067e,_0x470f6b){return new BPromise(function(_0x23293d,_0x546e5d){var _0x101a25=_0x470f6b||client;return _0x101a25[_0xb9c5('0x1e')](_0x362d53,_0x3b067e)[_0xb9c5('0x1f')](function(_0x583e53){logger[_0xb9c5('0x20')](_0xb9c5('0x21'),_0x41b3a0,_0xb9c5('0x22'));logger[_0xb9c5('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x41b3a0,'request\x20sent',JSON['stringify'](_0x583e53));if(_0x583e53[_0xb9c5('0x24')]){if(_0x583e53[_0xb9c5('0x24')][_0xb9c5('0x25')]===0x1f4){logger['error'](_0xb9c5('0x21'),_0x41b3a0,_0x583e53[_0xb9c5('0x24')][_0xb9c5('0x26')]);return _0x546e5d(_0x583e53[_0xb9c5('0x24')][_0xb9c5('0x26')]);}logger[_0xb9c5('0x24')](_0xb9c5('0x21'),_0x41b3a0,_0x583e53['error'][_0xb9c5('0x26')]);return _0x23293d(_0x583e53[_0xb9c5('0x24')][_0xb9c5('0x26')]);}else{logger['info'](_0xb9c5('0x21'),_0x41b3a0,_0xb9c5('0x22'));_0x23293d(_0x583e53[_0xb9c5('0x27')]['message']);}})[_0xb9c5('0x28')](function(_0x1f27c1){logger[_0xb9c5('0x24')](_0xb9c5('0x21'),_0x41b3a0,_0x1f27c1);_0x546e5d(_0x1f27c1);});});}function respondWithStatusCode(_0x1b6d15,_0x176ca5){_0x176ca5=_0x176ca5||0xcc;return function(_0x3ea112){if(_0x3ea112){return _0x1b6d15[_0xb9c5('0x29')](_0x176ca5);}return _0x1b6d15[_0xb9c5('0x2a')](_0x176ca5)[_0xb9c5('0x2b')]();};}function respondWithResult(_0x4ae865,_0x3b962a){_0x3b962a=_0x3b962a||0xc8;return function(_0x5c9616){if(_0x5c9616){return _0x4ae865[_0xb9c5('0x2a')](_0x3b962a)[_0xb9c5('0x2c')](_0x5c9616);}};}function respondWithFilteredResult(_0x19b482,_0x1b7c76){return function(_0x133dd4){if(_0x133dd4){var _0x1acc25=typeof _0x1b7c76[_0xb9c5('0x2d')]===_0xb9c5('0x2e')&&typeof _0x1b7c76['limit']==='undefined';var _0x157ea9=_0x133dd4['count'];var _0x12229e=_0x1acc25?0x0:_0x1b7c76[_0xb9c5('0x2d')];var _0x2e0d77=_0x1acc25?_0x133dd4[_0xb9c5('0x2f')]:_0x1b7c76[_0xb9c5('0x2d')]+_0x1b7c76['limit'];var _0x1e1310;if(_0x2e0d77>=_0x157ea9){_0x2e0d77=_0x157ea9;_0x1e1310=0xc8;}else{_0x1e1310=0xce;}_0x19b482['status'](_0x1e1310);return _0x19b482[_0xb9c5('0x30')]('Content-Range',_0x12229e+'-'+_0x2e0d77+'/'+_0x157ea9)[_0xb9c5('0x2c')](_0x133dd4);}return null;};}function patchUpdates(_0x3c68f8){return function(_0x3307cb){try{jsonpatch[_0xb9c5('0x31')](_0x3307cb,_0x3c68f8,!![]);}catch(_0x17b428){return BPromise[_0xb9c5('0x32')](_0x17b428);}return _0x3307cb[_0xb9c5('0x33')]();};}function saveUpdates(_0x141f91,_0x489391){return function(_0x3ef622){if(_0x3ef622){return _0x3ef622[_0xb9c5('0x34')](_0x141f91)[_0xb9c5('0x1f')](function(_0x302804){return _0x302804;});}return null;};}function removeEntity(_0x22093e,_0x565977){return function(_0x1ce1db){if(_0x1ce1db){return _0x1ce1db[_0xb9c5('0x35')]()[_0xb9c5('0x1f')](function(){var _0x5b7fef=_0x1ce1db[_0xb9c5('0x36')]({'plain':!![]});var _0x33b9be=_0xb9c5('0x37');return db[_0xb9c5('0x38')][_0xb9c5('0x35')]({'where':{'type':_0x33b9be,'resourceId':_0x5b7fef['id']}})[_0xb9c5('0x1f')](function(){return _0x1ce1db;});})[_0xb9c5('0x1f')](function(){_0x22093e[_0xb9c5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4625c3,_0xe677e4){return function(_0x592470){if(!_0x592470){_0x4625c3['sendStatus'](0x194);}return _0x592470;};}function handleError(_0x3744b0,_0x1ec66d){_0x1ec66d=_0x1ec66d||0x1f4;return function(_0x3ac618){logger[_0xb9c5('0x24')](_0x3ac618['stack']);if(_0x3ac618['name']){delete _0x3ac618[_0xb9c5('0x39')];}_0x3744b0[_0xb9c5('0x2a')](_0x1ec66d)['send'](_0x3ac618);};}exports[_0xb9c5('0x3a')]=function(_0x358218,_0xf47995){var _0x1b1aa0={'include':[{'model':db['Pause'],'as':_0xb9c5('0x3b')}]},_0x4dba48={},_0x394912={'count':0x0,'rows':[]};var _0x314a21=_[_0xb9c5('0x3c')](db[_0xb9c5('0x3d')]['rawAttributes'],function(_0xaa5ee){return{'name':_0xaa5ee[_0xb9c5('0x3e')],'type':_0xaa5ee[_0xb9c5('0x3f')]['key']};});_0x4dba48[_0xb9c5('0x40')]=_[_0xb9c5('0x3c')](_0x314a21,_0xb9c5('0x39'));_0x4dba48['query']=_['keys'](_0x358218[_0xb9c5('0x41')]);_0x4dba48[_0xb9c5('0x42')]=_[_0xb9c5('0x43')](_0x4dba48[_0xb9c5('0x40')],_0x4dba48['query']);_0x1b1aa0[_0xb9c5('0x44')]=_[_0xb9c5('0x43')](_0x4dba48[_0xb9c5('0x40')],qs[_0xb9c5('0x45')](_0x358218['query'][_0xb9c5('0x45')]));_0x1b1aa0['attributes']=_0x1b1aa0['attributes']['length']?_0x1b1aa0[_0xb9c5('0x44')]:_0x4dba48[_0xb9c5('0x40')];if(!_0x358218[_0xb9c5('0x41')][_0xb9c5('0x46')](_0xb9c5('0x47'))){_0x1b1aa0[_0xb9c5('0x48')]=qs[_0xb9c5('0x48')](_0x358218[_0xb9c5('0x41')]['limit']);_0x1b1aa0[_0xb9c5('0x2d')]=qs['offset'](_0x358218['query']['offset']);}_0x1b1aa0[_0xb9c5('0x49')]=qs[_0xb9c5('0x4a')](_0x358218[_0xb9c5('0x41')]['sort']);_0x1b1aa0[_0xb9c5('0x4b')]=qs[_0xb9c5('0x42')](_['pick'](_0x358218['query'],_0x4dba48[_0xb9c5('0x42')]),_0x314a21);if(_0x358218[_0xb9c5('0x41')]['filter']){_0x1b1aa0[_0xb9c5('0x4b')]=_[_0xb9c5('0x4c')](_0x1b1aa0[_0xb9c5('0x4b')],{'$or':_[_0xb9c5('0x3c')](_0x314a21,function(_0x53dd64){if(_0x53dd64['type']!==_0xb9c5('0x4d')){var _0x55ae01={};_0x55ae01[_0x53dd64['name']]={'$like':'%'+_0x358218[_0xb9c5('0x41')][_0xb9c5('0x4e')]+'%'};return _0x55ae01;}})});}_0x1b1aa0=_[_0xb9c5('0x4c')]({},_0x1b1aa0,_0x358218[_0xb9c5('0x4f')]);var _0x1588da={'where':_0x1b1aa0[_0xb9c5('0x4b')]};return db[_0xb9c5('0x3d')][_0xb9c5('0x2f')](_0x1588da)['then'](function(_0x5e5817){_0x394912[_0xb9c5('0x2f')]=_0x5e5817;if(_0x358218[_0xb9c5('0x41')][_0xb9c5('0x50')]){_0x1b1aa0[_0xb9c5('0x51')]=[{'all':!![]}];}return db[_0xb9c5('0x3d')][_0xb9c5('0x52')](_0x1b1aa0);})[_0xb9c5('0x1f')](function(_0x57b006){_0x394912['rows']=_0x57b006;return _0x394912;})[_0xb9c5('0x1f')](respondWithFilteredResult(_0xf47995,_0x1b1aa0))['catch'](handleError(_0xf47995,null));};exports[_0xb9c5('0x53')]=function(_0x5e67bf,_0x23d3f5){var _0x49f2db={'raw':![],'where':{'id':_0x5e67bf['params']['id']},'include':[{'model':db[_0xb9c5('0x54')],'as':_0xb9c5('0x3b')}]},_0x54e535={};_0x54e535[_0xb9c5('0x40')]=_[_0xb9c5('0x55')](db['OpenchannelAccount'][_0xb9c5('0x56')]);_0x54e535[_0xb9c5('0x41')]=_[_0xb9c5('0x55')](_0x5e67bf['query']);_0x54e535[_0xb9c5('0x42')]=_['intersection'](_0x54e535[_0xb9c5('0x40')],_0x54e535[_0xb9c5('0x41')]);_0x49f2db[_0xb9c5('0x44')]=_[_0xb9c5('0x43')](_0x54e535[_0xb9c5('0x40')],qs[_0xb9c5('0x45')](_0x5e67bf[_0xb9c5('0x41')][_0xb9c5('0x45')]));_0x49f2db[_0xb9c5('0x44')]=_0x49f2db[_0xb9c5('0x44')][_0xb9c5('0x57')]?_0x49f2db[_0xb9c5('0x44')]:_0x54e535[_0xb9c5('0x40')];if(_0x5e67bf[_0xb9c5('0x41')][_0xb9c5('0x50')]){_0x49f2db[_0xb9c5('0x51')]=[{'all':!![]}];}_0x49f2db=_[_0xb9c5('0x4c')]({},_0x49f2db,_0x5e67bf[_0xb9c5('0x4f')]);return db[_0xb9c5('0x3d')][_0xb9c5('0x58')](_0x49f2db)[_0xb9c5('0x1f')](handleEntityNotFound(_0x23d3f5,null))[_0xb9c5('0x1f')](respondWithResult(_0x23d3f5,null))[_0xb9c5('0x28')](handleError(_0x23d3f5,null));};exports[_0xb9c5('0x59')]=function(_0xef31d5,_0x593b44){return db['OpenchannelAccount'][_0xb9c5('0x59')](_0xef31d5[_0xb9c5('0x5a')],{})[_0xb9c5('0x1f')](function(_0x1908a4){var _0x4564e2=_0xef31d5[_0xb9c5('0x5b')][_0xb9c5('0x36')]({'plain':!![]});if(!_0x4564e2)throw new Error(_0xb9c5('0x5c'));if(_0x4564e2[_0xb9c5('0x5d')]==='user'){var _0x7940e2=_0x1908a4[_0xb9c5('0x36')]({'plain':!![]});var _0x2bf040=_0xb9c5('0x37');return db['UserProfileSection'][_0xb9c5('0x58')]({'where':{'name':_0x2bf040,'userProfileId':_0x4564e2[_0xb9c5('0x5e')]},'raw':!![]})[_0xb9c5('0x1f')](function(_0x1245a7){if(_0x1245a7&&_0x1245a7[_0xb9c5('0x5f')]===0x0){return db[_0xb9c5('0x38')]['create']({'name':_0x7940e2[_0xb9c5('0x39')],'resourceId':_0x7940e2['id'],'type':_0x1245a7['name'],'sectionId':_0x1245a7['id']},{})[_0xb9c5('0x1f')](function(){return _0x1908a4;});}else{return _0x1908a4;}})[_0xb9c5('0x28')](function(_0x5ec38d){logger[_0xb9c5('0x24')](_0xb9c5('0x60'),_0x5ec38d);throw _0x5ec38d;});}return _0x1908a4;})[_0xb9c5('0x1f')](respondWithResult(_0x593b44,0xc9))[_0xb9c5('0x28')](handleError(_0x593b44,null));};exports[_0xb9c5('0x34')]=function(_0x382a9b,_0x3ae69c){if(_0x382a9b[_0xb9c5('0x5a')]['id']){delete _0x382a9b[_0xb9c5('0x5a')]['id'];}return db[_0xb9c5('0x3d')][_0xb9c5('0x58')]({'where':{'id':_0x382a9b[_0xb9c5('0x61')]['id']},'include':[{'model':db[_0xb9c5('0x54')],'as':_0xb9c5('0x3b')}]})[_0xb9c5('0x1f')](handleEntityNotFound(_0x3ae69c,null))[_0xb9c5('0x1f')](saveUpdates(_0x382a9b[_0xb9c5('0x5a')],null))[_0xb9c5('0x1f')](respondWithResult(_0x3ae69c,null))[_0xb9c5('0x28')](handleError(_0x3ae69c,null));};exports[_0xb9c5('0x35')]=function(_0x270fa5,_0x419aac){return db['OpenchannelAccount']['find']({'where':{'id':_0x270fa5[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x419aac,null))[_0xb9c5('0x1f')](removeEntity(_0x419aac,null))[_0xb9c5('0x28')](handleError(_0x419aac,null));};exports[_0xb9c5('0x62')]=function(_0x35f5d0,_0x771488){return db[_0xb9c5('0x3d')]['describe']()['then'](respondWithResult(_0x771488,null))['catch'](handleError(_0x771488,null));};exports['addDisposition']=function(_0x2b7e38,_0x39dcaa,_0x1c42a9){if(_0x2b7e38[_0xb9c5('0x5a')]['id']){delete _0x2b7e38[_0xb9c5('0x5a')]['id'];}return db[_0xb9c5('0x3d')][_0xb9c5('0x58')]({'where':{'id':_0x2b7e38[_0xb9c5('0x61')]['id']}})['then'](handleEntityNotFound(_0x39dcaa,null))[_0xb9c5('0x1f')](function(_0x154bc5){if(_0x154bc5){_0x2b7e38['body']['OpenchannelAccountId']=_0x154bc5['id'];return db[_0xb9c5('0x63')][_0xb9c5('0x59')](_0x2b7e38['body']);}})['then'](respondWithResult(_0x39dcaa,null))[_0xb9c5('0x28')](handleError(_0x39dcaa,null));};exports['getDispositions']=function(_0x316884,_0x191861,_0x32f9f6){var _0x149511={'raw':![],'where':{}};var _0x5984c7={};var _0x5b07f2={'count':0x0,'rows':[]};return db[_0xb9c5('0x3d')][_0xb9c5('0x64')]({'where':{'id':_0x316884[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x191861,null))[_0xb9c5('0x1f')](function(_0x4f152f){if(_0x4f152f){_0x5984c7[_0xb9c5('0x40')]=_['keys'](db['Disposition']['rawAttributes']);_0x5984c7[_0xb9c5('0x41')]=_['keys'](_0x316884[_0xb9c5('0x41')]);_0x5984c7[_0xb9c5('0x42')]=_[_0xb9c5('0x43')](_0x5984c7[_0xb9c5('0x40')],_0x5984c7[_0xb9c5('0x41')]);_0x149511[_0xb9c5('0x44')]=_[_0xb9c5('0x43')](_0x5984c7[_0xb9c5('0x40')],qs['fields'](_0x316884[_0xb9c5('0x41')]['fields']));_0x149511[_0xb9c5('0x44')]=_0x149511['attributes'][_0xb9c5('0x57')]?_0x149511['attributes']:_0x5984c7[_0xb9c5('0x40')];if(!_0x316884[_0xb9c5('0x41')][_0xb9c5('0x46')]('nolimit')){_0x149511[_0xb9c5('0x48')]=qs[_0xb9c5('0x48')](_0x316884[_0xb9c5('0x41')]['limit']);_0x149511[_0xb9c5('0x2d')]=qs['offset'](_0x316884[_0xb9c5('0x41')][_0xb9c5('0x2d')]);}_0x149511[_0xb9c5('0x49')]=qs[_0xb9c5('0x4a')](_0x316884[_0xb9c5('0x41')][_0xb9c5('0x4a')]);_0x149511[_0xb9c5('0x4b')]=qs[_0xb9c5('0x42')](_[_0xb9c5('0x65')](_0x316884[_0xb9c5('0x41')],_0x5984c7['filters']));_0x149511['where'][_0xb9c5('0x66')]=_0x4f152f['id'];if(_0x316884[_0xb9c5('0x41')][_0xb9c5('0x4e')]){_0x149511[_0xb9c5('0x4b')]=_[_0xb9c5('0x4c')](_0x149511[_0xb9c5('0x4b')],{'$or':_[_0xb9c5('0x3c')](_0x149511[_0xb9c5('0x44')],function(_0x2ff9e6){var _0x513006={};_0x513006[_0x2ff9e6]={'$like':'%'+_0x316884[_0xb9c5('0x41')]['filter']+'%'};return _0x513006;})});}_0x149511=_[_0xb9c5('0x4c')]({},_0x149511,_0x316884[_0xb9c5('0x4f')]);return db[_0xb9c5('0x63')][_0xb9c5('0x2f')]({'where':_0x149511[_0xb9c5('0x4b')]})['then'](function(_0x93a22){_0x5b07f2['count']=_0x93a22;if(_0x316884[_0xb9c5('0x41')][_0xb9c5('0x50')]){_0x149511[_0xb9c5('0x51')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x149511);})['then'](function(_0x2de7ff){_0x5b07f2[_0xb9c5('0x67')]=_0x2de7ff;return _0x5b07f2;});}})[_0xb9c5('0x1f')](respondWithFilteredResult(_0x191861,_0x149511))[_0xb9c5('0x28')](handleError(_0x191861,null));};exports[_0xb9c5('0x68')]=function(_0x333148,_0x5bc79d,_0x33c6f6){return db['OpenchannelAccount']['find']({'where':{'id':_0x333148[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x5bc79d,null))[_0xb9c5('0x1f')](function(_0x3bf3e7){if(_0x3bf3e7){return _0x3bf3e7[_0xb9c5('0x68')](_0x333148[_0xb9c5('0x41')][_0xb9c5('0x69')]);}})[_0xb9c5('0x1f')](respondWithStatusCode(_0x5bc79d,null))['catch'](handleError(_0x5bc79d,null));};exports[_0xb9c5('0x6a')]=function(_0x3d22b9,_0x319918,_0x245157){if(_0x3d22b9[_0xb9c5('0x5a')]['id']){delete _0x3d22b9[_0xb9c5('0x5a')]['id'];}return db[_0xb9c5('0x3d')][_0xb9c5('0x58')]({'where':{'id':_0x3d22b9[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x319918,null))[_0xb9c5('0x1f')](function(_0x44bf85){if(_0x44bf85){_0x3d22b9['body'][_0xb9c5('0x66')]=_0x44bf85['id'];return db[_0xb9c5('0x6b')]['create'](_0x3d22b9['body']);}})[_0xb9c5('0x1f')](respondWithResult(_0x319918,null))[_0xb9c5('0x28')](handleError(_0x319918,null));};exports[_0xb9c5('0x6c')]=function(_0x31f291,_0x47b59d,_0x537ffb){var _0x5add0f={'raw':![],'where':{}};var _0x102667={};var _0xe38ae2={'count':0x0,'rows':[]};return db[_0xb9c5('0x3d')][_0xb9c5('0x64')]({'where':{'id':_0x31f291[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x47b59d,null))[_0xb9c5('0x1f')](function(_0x511120){if(_0x511120){_0x102667['model']=_[_0xb9c5('0x55')](db[_0xb9c5('0x6b')][_0xb9c5('0x56')]);_0x102667[_0xb9c5('0x41')]=_['keys'](_0x31f291['query']);_0x102667[_0xb9c5('0x42')]=_[_0xb9c5('0x43')](_0x102667[_0xb9c5('0x40')],_0x102667['query']);_0x5add0f['attributes']=_[_0xb9c5('0x43')](_0x102667['model'],qs[_0xb9c5('0x45')](_0x31f291[_0xb9c5('0x41')][_0xb9c5('0x45')]));_0x5add0f[_0xb9c5('0x44')]=_0x5add0f[_0xb9c5('0x44')][_0xb9c5('0x57')]?_0x5add0f[_0xb9c5('0x44')]:_0x102667[_0xb9c5('0x40')];if(!_0x31f291[_0xb9c5('0x41')][_0xb9c5('0x46')]('nolimit')){_0x5add0f[_0xb9c5('0x48')]=qs['limit'](_0x31f291['query']['limit']);_0x5add0f[_0xb9c5('0x2d')]=qs['offset'](_0x31f291[_0xb9c5('0x41')][_0xb9c5('0x2d')]);}_0x5add0f[_0xb9c5('0x49')]=qs['sort'](_0x31f291['query'][_0xb9c5('0x4a')]);_0x5add0f[_0xb9c5('0x4b')]=qs[_0xb9c5('0x42')](_[_0xb9c5('0x65')](_0x31f291[_0xb9c5('0x41')],_0x102667[_0xb9c5('0x42')]));_0x5add0f['where']['OpenchannelAccountId']=_0x511120['id'];if(_0x31f291[_0xb9c5('0x41')][_0xb9c5('0x4e')]){_0x5add0f[_0xb9c5('0x4b')]=_['merge'](_0x5add0f['where'],{'$or':_[_0xb9c5('0x3c')](_0x5add0f['attributes'],function(_0x3ebd51){var _0x4df7d2={};_0x4df7d2[_0x3ebd51]={'$like':'%'+_0x31f291[_0xb9c5('0x41')][_0xb9c5('0x4e')]+'%'};return _0x4df7d2;})});}_0x5add0f=_['merge']({},_0x5add0f,_0x31f291[_0xb9c5('0x4f')]);return db['CannedAnswer']['count']({'where':_0x5add0f[_0xb9c5('0x4b')]})[_0xb9c5('0x1f')](function(_0x1b9d20){_0xe38ae2[_0xb9c5('0x2f')]=_0x1b9d20;if(_0x31f291[_0xb9c5('0x41')]['includeAll']){_0x5add0f['include']=[{'all':!![]}];}return db[_0xb9c5('0x6b')]['findAll'](_0x5add0f);})[_0xb9c5('0x1f')](function(_0x141eba){_0xe38ae2[_0xb9c5('0x67')]=_0x141eba;return _0xe38ae2;});}})[_0xb9c5('0x1f')](respondWithFilteredResult(_0x47b59d,_0x5add0f))[_0xb9c5('0x28')](handleError(_0x47b59d,null));};exports[_0xb9c5('0x6d')]=function(_0x1c183d,_0xa4f197,_0x2eb1f4){return db['OpenchannelAccount'][_0xb9c5('0x58')]({'where':{'id':_0x1c183d[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0xa4f197,null))[_0xb9c5('0x1f')](function(_0x2e0d99){if(_0x2e0d99){return _0x2e0d99[_0xb9c5('0x6d')](_0x1c183d[_0xb9c5('0x41')][_0xb9c5('0x69')]);}})['then'](respondWithStatusCode(_0xa4f197,null))[_0xb9c5('0x28')](handleError(_0xa4f197,null));};exports[_0xb9c5('0x6e')]=function(_0x413345,_0x3a0620,_0x29a6a6){var _0x2bfa77={'body':_0x413345[_0xb9c5('0x5a')],'channel':_0xb9c5('0x6f')};var _0x51d2b1=[];var _0x4dc4ec=[];var _0x4ad474={};var _0x43d655=![];return db[_0xb9c5('0x70')]['describe']()[_0xb9c5('0x1f')](function(_0x16539d){if(!_0x16539d){throw new db['Sequelize']['ValidationError'](_0xb9c5('0x71'));}_0x51d2b1=_[_0xb9c5('0x72')](_[_0xb9c5('0x55')](_0x16539d),[_0xb9c5('0x73'),_0xb9c5('0x74')]);_0x4dc4ec=_[_0xb9c5('0x72')](_[_0xb9c5('0x55')](_0x16539d),[_0xb9c5('0x73'),'updatedAt',_0xb9c5('0x75'),_0xb9c5('0x76')]);if(_0x413345['body']['id']){delete _0x413345['body']['id'];}if(_[_0xb9c5('0x77')](_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x78')])){throw new db[(_0xb9c5('0x79'))][(_0xb9c5('0x7a'))](_0xb9c5('0x7b'));}if(_[_0xb9c5('0x77')](_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x5a')])||_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x5a')]===''){throw new db[(_0xb9c5('0x79'))][(_0xb9c5('0x7a'))](_0xb9c5('0x7c'));}if(_['isNil'](_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x7d')])){throw new db[(_0xb9c5('0x79'))][(_0xb9c5('0x7a'))](_0xb9c5('0x7e')+_0x4dc4ec);}if(!_[_0xb9c5('0x7f')](_0x4dc4ec,_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x7d')])){throw new db[(_0xb9c5('0x79'))][(_0xb9c5('0x7a'))](_0xb9c5('0x80')+_0x4dc4ec);}_0x4ad474[_0x413345[_0xb9c5('0x5a')]['mapKey']]=_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x78')];})[_0xb9c5('0x1f')](function(){return db[_0xb9c5('0x3d')][_0xb9c5('0x58')]({'where':{'id':_0x413345['params']['id']},'include':[{'model':db[_0xb9c5('0x81')],'as':_0xb9c5('0x82'),'include':[{'model':db[_0xb9c5('0x70')],'as':_0xb9c5('0x83'),'where':_0x4ad474,'limit':0x1,'order':[[_0xb9c5('0x74'),_0xb9c5('0x84')]]}]},{'model':db[_0xb9c5('0x85')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x3a0620,null))[_0xb9c5('0x1f')](function(_0x53e14a){if(_0x53e14a&&_0x53e14a[_0xb9c5('0x82')]){_0x2bfa77[_0xb9c5('0x86')]=_0x53e14a;_0x2bfa77[_0xb9c5('0x87')]=_0x53e14a['Applications'];_0x2bfa77['list']=_0x53e14a[_0xb9c5('0x82')];_0x2bfa77[_0xb9c5('0x87')]=_[_0xb9c5('0x88')](_0x2bfa77[_0xb9c5('0x87')],[_0xb9c5('0x89')],[_0xb9c5('0x8a')]);if(_0x2bfa77['account'][_0xb9c5('0x8b')]){delete _0x2bfa77['account']['Applications'];}if(_0x2bfa77[_0xb9c5('0x86')][_0xb9c5('0x82')]&&_0x2bfa77[_0xb9c5('0x86')][_0xb9c5('0x82')][_0xb9c5('0x83')][_0xb9c5('0x57')]){return _0x2bfa77['account'][_0xb9c5('0x82')][_0xb9c5('0x83')][0x0];}var _0x539c3e=_[_0xb9c5('0x8c')](_0x413345['body'],{'firstName':_0x413345[_0xb9c5('0x5a')]['from'],'ListId':_0x53e14a['ListId']});_0x539c3e[_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x7d')]]=_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x78')];return db[_0xb9c5('0x70')]['create'](_0x539c3e,{'fields':_0x51d2b1,'raw':!![]});}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x3a0620,null))[_0xb9c5('0x1f')](function(_0x13363f){_0x2bfa77['contact']=_0x13363f;if(_0x13363f){var _0x3e8ce7={'ContactId':_0x13363f['id'],'OpenchannelAccountId':_0x413345[_0xb9c5('0x61')]['id'],'from':(_0x13363f['firstName']||'')+'\x20'+(_0x13363f[_0xb9c5('0x8d')]||'')};var _0x5cbae2={'OpenchannelAccountId':_0x413345[_0xb9c5('0x61')]['id'],'closed':![]};if(_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x8e')]){_0x5cbae2[_0xb9c5('0x8e')]=_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x8e')];return db[_0xb9c5('0x8f')]['find']({'where':_0x5cbae2})['then'](function(_0x17e7b4){if(_0x17e7b4){return[_0x17e7b4,![]];}_0x3e8ce7['threadId']=_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x8e')];_0x3e8ce7[_0xb9c5('0x90')]=_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x90')];return db[_0xb9c5('0x8f')][_0xb9c5('0x59')](_0x3e8ce7)[_0xb9c5('0x1f')](function(_0x52e5d6){return[_0x52e5d6,!![]];});});}else{_0x5cbae2[_0xb9c5('0x8e')]=null;}_0x5cbae2[_0xb9c5('0x91')]=_0x13363f['id'];return db[_0xb9c5('0x8f')][_0xb9c5('0x58')]({'where':_0x5cbae2})[_0xb9c5('0x1f')](function(_0x3d4c74){if(_0x3d4c74){return[_0x3d4c74,![]];}return db[_0xb9c5('0x8f')][_0xb9c5('0x59')](_0x3e8ce7)[_0xb9c5('0x1f')](function(_0x19a68d){return[_0x19a68d,!![]];});});}})[_0xb9c5('0x92')](function(_0x3b4b05,_0x15ea8a){if(_0x3b4b05){_0x43d655=_0x15ea8a;if(!_0x15ea8a){var _0x49bfa7={'from':(_0x2bfa77[_0xb9c5('0x93')][_0xb9c5('0x94')]||'')+'\x20'+(_0x2bfa77[_0xb9c5('0x93')][_0xb9c5('0x8d')]||'')};if(_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x8e')]&&_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x95')]&&_0x413345[_0xb9c5('0x5a')]['threadId']!=_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x95')]){_0x49bfa7['threadId']=_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x95')];}return _0x3b4b05[_0xb9c5('0x34')](_0x49bfa7);}else{return _0x3b4b05;}}})[_0xb9c5('0x1f')](function(_0x2a6828){_0x2bfa77['interaction']=_0x2a6828[_0xb9c5('0x36')]({'plain':!![]});_0x2bfa77[_0xb9c5('0x96')]['created']=_0x43d655;if(_0x2bfa77[_0xb9c5('0x96')][_0xb9c5('0x97')]){if(_0x2bfa77[_0xb9c5('0x86')]['autoclose']){_0x2bfa77[_0xb9c5('0x87')][_0xb9c5('0x98')]({'id':0x0,'priority':_0x2bfa77[_0xb9c5('0x87')][_0xb9c5('0x57')]+0x1,'app':_0xb9c5('0x99'),'appdata':_0xb9c5('0x9a'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x413345[_0xb9c5('0x5a')][_0xb9c5('0x5a')],'OpenchannelAccountId':_0x413345[_0xb9c5('0x61')]['id'],'OpenchannelInteractionId':_0x2a6828['id'],'direction':'in','ContactId':_0x2bfa77[_0xb9c5('0x93')]['id'],'AttachmentId':_0x413345[_0xb9c5('0x5a')]['AttachmentId']});})[_0xb9c5('0x1f')](function(_0x34e56c){_0x2bfa77[_0xb9c5('0x26')]=_0x34e56c;if(_0x2bfa77[_0xb9c5('0x96')][_0xb9c5('0x9b')]){return db[_0xb9c5('0x9c')]['find']({'attributes':['id','name'],'where':{'id':_0x2bfa77[_0xb9c5('0x96')][_0xb9c5('0x9b')]}})['then'](function(_0x1aadce){if(_0x1aadce){_0x2bfa77['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xb9c5('0x9d'),'appdata':_0x1aadce[_0xb9c5('0x39')]+','+(_0x2bfa77['account'][_0xb9c5('0x9e')]||0xa),'interval':_0xb9c5('0x9f')});_0x2bfa77[_0xb9c5('0xa0')]=![];}return respondWithRpcPromise(_0xb9c5('0xa1'),_0xb9c5('0xa2'),_0x2bfa77);});}return respondWithRpcPromise(_0xb9c5('0xa1'),'startRouting',_0x2bfa77);})[_0xb9c5('0x1f')](function(_0x3dc4e3){respondWithRpcPromise(_0xb9c5('0xa3'),_0xb9c5('0xa3'),{'event':_0xb9c5('0x6e'),'message':_0x3dc4e3},client9002);return _0x3dc4e3;})[_0xb9c5('0x1f')](respondWithResult(_0x3a0620,null))[_0xb9c5('0x28')](handleError(_0x3a0620,null));};exports[_0xb9c5('0xa4')]=function(_0x14126a,_0x30ca7b){var _0x440359=_0x14126a[_0xb9c5('0x61')]['id'];var _0x545765=_0x14126a[_0xb9c5('0x5a')];var _0x43ba9d=0xc8;var _0x5ebf1=null;return db['sequelize'][_0xb9c5('0xa5')]({'isolationLevel':db[_0xb9c5('0xa6')][_0xb9c5('0xa7')][_0xb9c5('0xa8')][_0xb9c5('0xa9')]},function(_0x14945a){return db[_0xb9c5('0x3d')]['findOne']({'where':{'id':_0x440359},'transaction':_0x14945a})['then'](function(_0x55f777){if(_0x55f777){return db[_0xb9c5('0x85')]['destroy']({'where':{'OpenchannelAccountId':_0x440359},'transaction':_0x14945a})[_0xb9c5('0x1f')](function(){var _0xbef8bb=_[_0xb9c5('0x3c')](_0x545765,function(_0x18f5f4){_0x18f5f4[_0xb9c5('0x66')]=_0x440359;return _0x18f5f4;});return db['OpenchannelApplication'][_0xb9c5('0xaa')](_0xbef8bb,{'transaction':_0x14945a});});}else{_0x43ba9d=0x194;_0x5ebf1=[];}});})['then'](function(){if(_0x43ba9d!==0x194){return db[_0xb9c5('0x85')][_0xb9c5('0xab')]({'where':{'OpenchannelAccountId':_0x440359},'order':_0xb9c5('0x89')})[_0xb9c5('0x1f')](function(_0x4863a8){_0x5ebf1=_0x4863a8;});}})[_0xb9c5('0x28')](function(_0x5f2a96){_0x43ba9d=0x1f4;logger[_0xb9c5('0x24')](_0x5f2a96['stack']);if(_0x5f2a96['name']){delete _0x5f2a96['name'];}_0x5ebf1=_0x5f2a96;})[_0xb9c5('0xac')](function(){if(_0x5ebf1===null){_0x30ca7b[_0xb9c5('0x29')](_0x43ba9d);}else{if(_0x43ba9d===0x1f4){_0x30ca7b[_0xb9c5('0x2a')](_0x43ba9d)[_0xb9c5('0xad')](_0x5ebf1);}else{_0x30ca7b[_0xb9c5('0x2a')](_0x43ba9d)[_0xb9c5('0x2c')](_0x5ebf1);}}});};exports[_0xb9c5('0xae')]=function(_0xbea9f9,_0x19c2e9,_0x5714f3){var _0x3f95c4={};var _0x4bd945={};var _0x5ed821;var _0x4c936f;return db['OpenchannelAccount'][_0xb9c5('0x64')]({'where':{'id':_0xbea9f9['params']['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x19c2e9,null))[_0xb9c5('0x1f')](function(_0x9e5043){if(_0x9e5043){_0x5ed821=_0x9e5043;_0x4bd945[_0xb9c5('0x40')]=_['keys'](db[_0xb9c5('0x85')][_0xb9c5('0x56')]);_0x4bd945[_0xb9c5('0x41')]=_[_0xb9c5('0x55')](_0xbea9f9[_0xb9c5('0x41')]);_0x4bd945[_0xb9c5('0x42')]=_['intersection'](_0x4bd945[_0xb9c5('0x40')],_0x4bd945[_0xb9c5('0x41')]);_0x3f95c4[_0xb9c5('0x44')]=_['intersection'](_0x4bd945[_0xb9c5('0x40')],qs[_0xb9c5('0x45')](_0xbea9f9[_0xb9c5('0x41')][_0xb9c5('0x45')]));_0x3f95c4[_0xb9c5('0x44')]=_0x3f95c4[_0xb9c5('0x44')]['length']?_0x3f95c4[_0xb9c5('0x44')]:_0x4bd945['model'];_0x3f95c4[_0xb9c5('0x49')]=qs[_0xb9c5('0x4a')](_0xbea9f9[_0xb9c5('0x41')][_0xb9c5('0x4a')]);_0x3f95c4[_0xb9c5('0x4b')]=qs[_0xb9c5('0x42')](_[_0xb9c5('0x65')](_0xbea9f9['query'],_0x4bd945['filters']));if(_0xbea9f9[_0xb9c5('0x41')][_0xb9c5('0x4e')]){_0x3f95c4[_0xb9c5('0x4b')]=_[_0xb9c5('0x4c')](_0x3f95c4[_0xb9c5('0x4b')],{'$or':_[_0xb9c5('0x3c')](_0x3f95c4['attributes'],function(_0xb91bc7){var _0x2f1152={};_0x2f1152[_0xb91bc7]={'$like':'%'+_0xbea9f9[_0xb9c5('0x41')][_0xb9c5('0x4e')]+'%'};return _0x2f1152;})});}_0x3f95c4=_[_0xb9c5('0x4c')]({},_0x3f95c4,_0xbea9f9[_0xb9c5('0x4f')]);return _0x5ed821[_0xb9c5('0xae')](_0x3f95c4);}})[_0xb9c5('0x1f')](function(_0x531934){if(_0x531934){_0x4c936f=_0x531934[_0xb9c5('0x57')];if(!_0xbea9f9[_0xb9c5('0x41')][_0xb9c5('0x46')](_0xb9c5('0x47'))){_0x3f95c4[_0xb9c5('0x48')]=qs[_0xb9c5('0x48')](_0xbea9f9[_0xb9c5('0x41')][_0xb9c5('0x48')]);_0x3f95c4[_0xb9c5('0x2d')]=qs[_0xb9c5('0x2d')](_0xbea9f9[_0xb9c5('0x41')][_0xb9c5('0x2d')]);}return _0x5ed821[_0xb9c5('0xae')](_0x3f95c4);}})[_0xb9c5('0x1f')](function(_0x4a40ed){if(_0x4a40ed){return _0x4a40ed?{'count':_0x4c936f,'rows':_0x4a40ed}:null;}})[_0xb9c5('0x1f')](respondWithResult(_0x19c2e9,null))['catch'](handleError(_0x19c2e9,null));};exports['getInteractions']=function(_0x5bff8b,_0x1b82cf,_0x4284da){var _0x41ddb9={'raw':![],'where':{}};var _0x50ae83={};var _0x381644={'count':0x0,'rows':[]};return db[_0xb9c5('0x3d')]['findOne']({'where':{'id':_0x5bff8b[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x1b82cf,null))[_0xb9c5('0x1f')](function(_0x396be6){if(_0x396be6){_0x50ae83['model']=_[_0xb9c5('0x55')](db[_0xb9c5('0x8f')]['rawAttributes']);_0x50ae83[_0xb9c5('0x41')]=_['keys'](_0x5bff8b[_0xb9c5('0x41')]);_0x50ae83['filters']=_[_0xb9c5('0x43')](_0x50ae83['model'],_0x50ae83[_0xb9c5('0x41')]);_0x41ddb9[_0xb9c5('0x44')]=_[_0xb9c5('0x43')](_0x50ae83[_0xb9c5('0x40')],qs[_0xb9c5('0x45')](_0x5bff8b['query'][_0xb9c5('0x45')]));_0x41ddb9[_0xb9c5('0x44')]=_0x41ddb9[_0xb9c5('0x44')][_0xb9c5('0x57')]?_0x41ddb9['attributes']:_0x50ae83[_0xb9c5('0x40')];if(!_0x5bff8b['query']['hasOwnProperty'](_0xb9c5('0x47'))){_0x41ddb9[_0xb9c5('0x48')]=qs['limit'](_0x5bff8b['query'][_0xb9c5('0x48')]);_0x41ddb9[_0xb9c5('0x2d')]=qs[_0xb9c5('0x2d')](_0x5bff8b['query'][_0xb9c5('0x2d')]);}_0x41ddb9[_0xb9c5('0x49')]=qs[_0xb9c5('0x4a')](_0x5bff8b[_0xb9c5('0x41')]['sort']);_0x41ddb9['where']=qs[_0xb9c5('0x42')](_['pick'](_0x5bff8b[_0xb9c5('0x41')],_0x50ae83[_0xb9c5('0x42')]));_0x41ddb9[_0xb9c5('0x4b')][_0xb9c5('0x66')]=_0x396be6['id'];if(_0x5bff8b[_0xb9c5('0x41')][_0xb9c5('0x4e')]){_0x41ddb9[_0xb9c5('0x4b')]=_[_0xb9c5('0x4c')](_0x41ddb9[_0xb9c5('0x4b')],{'$or':_[_0xb9c5('0x3c')](_0x41ddb9[_0xb9c5('0x44')],function(_0x4e4585){var _0x5ceb1a={};_0x5ceb1a[_0x4e4585]={'$like':'%'+_0x5bff8b[_0xb9c5('0x41')][_0xb9c5('0x4e')]+'%'};return _0x5ceb1a;})});}_0x41ddb9=_[_0xb9c5('0x4c')]({},_0x41ddb9,_0x5bff8b[_0xb9c5('0x4f')]);return db[_0xb9c5('0x8f')][_0xb9c5('0x2f')]({'where':_0x41ddb9['where']})[_0xb9c5('0x1f')](function(_0x199a53){_0x381644[_0xb9c5('0x2f')]=_0x199a53;if(_0x5bff8b[_0xb9c5('0x41')][_0xb9c5('0x50')]){_0x41ddb9[_0xb9c5('0x51')]=[{'model':db[_0xb9c5('0x70')],'as':_0xb9c5('0xaf'),'required':![]},{'model':db[_0xb9c5('0x9c')],'as':_0xb9c5('0xb0'),'attributes':[_0xb9c5('0x39'),_0xb9c5('0xb1'),_0xb9c5('0xb2')],'required':![]},{'model':db['Tag'],'as':_0xb9c5('0xb3'),'attributes':['id',_0xb9c5('0x39'),_0xb9c5('0xb4')],'where':_0x5bff8b[_0xb9c5('0x41')][_0xb9c5('0xb5')]?{'id':_0x5bff8b['query'][_0xb9c5('0xb5')]}:undefined,'required':_0x5bff8b[_0xb9c5('0x41')]['tag']?!![]:![]}];}return db[_0xb9c5('0x8f')][_0xb9c5('0x52')](_0x41ddb9);})['then'](function(_0x1c5fb2){_0x381644[_0xb9c5('0x67')]=_0x1c5fb2;return _0x381644;});}})[_0xb9c5('0x1f')](respondWithFilteredResult(_0x1b82cf,_0x41ddb9))[_0xb9c5('0x28')](handleError(_0x1b82cf,null));};exports[_0xb9c5('0xb6')]=function(_0x33320b,_0x2051c7,_0x3d2afe){return db[_0xb9c5('0x3d')][_0xb9c5('0x58')]({'where':{'id':_0x33320b[_0xb9c5('0x61')]['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x2051c7,null))[_0xb9c5('0x1f')](function(_0x1b2e62){if(_0x1b2e62){return _0x1b2e62[_0xb9c5('0xb6')](_0x33320b['body'][_0xb9c5('0x69')],_[_0xb9c5('0xb7')](_0x33320b[_0xb9c5('0x5a')],[_0xb9c5('0x69'),'id'])||{})['spread'](function(_0x2f7ba9){for(var _0x24f28c=0x0;_0x24f28c<_0x33320b[_0xb9c5('0x5a')][_0xb9c5('0x69')][_0xb9c5('0x57')];_0x24f28c+=0x1){socket[_0xb9c5('0xb8')](_0xb9c5('0xb9'),{'UserId':Number(_0x33320b[_0xb9c5('0x5a')][_0xb9c5('0x69')][_0x24f28c]),'OpenchannelAccountId':Number(_0x33320b[_0xb9c5('0x61')]['id'])});}return _0x2f7ba9;});}})[_0xb9c5('0x1f')](respondWithResult(_0x2051c7,null))[_0xb9c5('0x28')](handleError(_0x2051c7,null));};exports['removeAgents']=function(_0x107eda,_0x497cf2,_0x269861){return db[_0xb9c5('0x3d')][_0xb9c5('0x58')]({'where':{'id':_0x107eda['params']['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x497cf2,null))['then'](function(_0x26d134){if(_0x26d134){return _0x26d134[_0xb9c5('0xba')](_0x107eda[_0xb9c5('0x41')]['ids'])['then'](function(){if(_['isArray'](_0x107eda[_0xb9c5('0x41')][_0xb9c5('0x69')])){for(var _0x2b6324=0x0;_0x2b6324<_0x107eda[_0xb9c5('0x41')][_0xb9c5('0x69')]['length'];_0x2b6324+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x107eda[_0xb9c5('0x41')]['ids'][_0x2b6324]),'OpenchannelAccountId':Number(_0x107eda[_0xb9c5('0x61')]['id'])});}}else{socket['emit'](_0xb9c5('0xbb'),{'UserId':Number(_0x107eda[_0xb9c5('0x41')]['ids']),'OpenchannelAccountId':Number(_0x107eda['params']['id'])});}});}})['then'](respondWithStatusCode(_0x497cf2,null))[_0xb9c5('0x28')](handleError(_0x497cf2,null));};exports[_0xb9c5('0xbc')]=function(_0x417b73,_0x238291,_0x21f013){var _0x3bc8e2={};var _0x52c4ef={};var _0x30d112;var _0x296f5e;return db[_0xb9c5('0x3d')][_0xb9c5('0x64')]({'where':{'id':_0x417b73['params']['id']}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x238291,null))['then'](function(_0x17a521){if(_0x17a521){_0x30d112=_0x17a521;_0x52c4ef[_0xb9c5('0x40')]=_['keys'](db[_0xb9c5('0x9c')][_0xb9c5('0x56')]);_0x52c4ef['query']=_[_0xb9c5('0x55')](_0x417b73[_0xb9c5('0x41')]);_0x52c4ef[_0xb9c5('0x42')]=_[_0xb9c5('0x43')](_0x52c4ef['model'],_0x52c4ef[_0xb9c5('0x41')]);_0x3bc8e2[_0xb9c5('0x44')]=_[_0xb9c5('0x43')](_0x52c4ef[_0xb9c5('0x40')],qs['fields'](_0x417b73[_0xb9c5('0x41')][_0xb9c5('0x45')]));_0x3bc8e2[_0xb9c5('0x44')]=_0x3bc8e2[_0xb9c5('0x44')][_0xb9c5('0x57')]?_0x3bc8e2[_0xb9c5('0x44')]:_0x52c4ef[_0xb9c5('0x40')];_0x3bc8e2[_0xb9c5('0x49')]=qs[_0xb9c5('0x4a')](_0x417b73[_0xb9c5('0x41')][_0xb9c5('0x4a')]);_0x3bc8e2[_0xb9c5('0x4b')]=qs[_0xb9c5('0x42')](_[_0xb9c5('0x65')](_0x417b73[_0xb9c5('0x41')],_0x52c4ef['filters']));if(_0x417b73['query'][_0xb9c5('0x4e')]){_0x3bc8e2['where']=_[_0xb9c5('0x4c')](_0x3bc8e2['where'],{'$or':_[_0xb9c5('0x3c')](_0x3bc8e2[_0xb9c5('0x44')],function(_0x21483c){var _0x385140={};_0x385140[_0x21483c]={'$like':'%'+_0x417b73[_0xb9c5('0x41')][_0xb9c5('0x4e')]+'%'};return _0x385140;})});}_0x3bc8e2=_['merge']({},_0x3bc8e2,_0x417b73[_0xb9c5('0x4f')]);return _0x30d112[_0xb9c5('0xbc')](_0x3bc8e2);}})[_0xb9c5('0x1f')](function(_0x54edad){if(_0x54edad){_0x296f5e=_0x54edad[_0xb9c5('0x57')];if(!_0x417b73[_0xb9c5('0x41')][_0xb9c5('0x46')]('nolimit')){_0x3bc8e2['limit']=qs['limit'](_0x417b73['query']['limit']);_0x3bc8e2[_0xb9c5('0x2d')]=qs['offset'](_0x417b73['query'][_0xb9c5('0x2d')]);}return _0x30d112[_0xb9c5('0xbc')](_0x3bc8e2);}})[_0xb9c5('0x1f')](function(_0x1a6a42){if(_0x1a6a42){return _0x1a6a42?{'count':_0x296f5e,'rows':_0x1a6a42}:null;}})[_0xb9c5('0x1f')](respondWithResult(_0x238291,null))[_0xb9c5('0x28')](handleError(_0x238291,null));};exports[_0xb9c5('0xad')]=function(_0x3c52c9,_0x58b217,_0x64590f){var _0x319db7,_0x4436b5,_0x10a70e;if(_[_0xb9c5('0x77')](_0x3c52c9[_0xb9c5('0x5a')][_0xb9c5('0x5a')])||_0x3c52c9['body'][_0xb9c5('0x5a')]===''){throw new db[(_0xb9c5('0x79'))]['ValidationError'](_0xb9c5('0x7c'));}if(_[_0xb9c5('0x77')](_0x3c52c9['body']['to'])){}_0x319db7=_0x3c52c9[_0xb9c5('0x5a')]['to'];return db[_0xb9c5('0x3d')][_0xb9c5('0x64')]({'where':{'id':_0x3c52c9['params']['id']}})['then'](handleEntityNotFound(_0x58b217,null))[_0xb9c5('0x1f')](function(_0x4ced10){if(_0x4ced10){return db[_0xb9c5('0x3d')][_0xb9c5('0x58')]({'where':{'id':_0x4ced10['id']},'include':[{'model':db[_0xb9c5('0x81')],'as':_0xb9c5('0x82'),'include':[{'model':db[_0xb9c5('0x70')],'as':_0xb9c5('0x83'),'where':{[_0x4ced10[_0xb9c5('0x7d')]]:_0x319db7},'limit':0x1,'order':[[_0xb9c5('0x74'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x58b217,null))[_0xb9c5('0x1f')](function(_0x58562b){if(_0x58562b&&_0x58562b[_0xb9c5('0x82')]){_0x4436b5=_0x58562b[_0xb9c5('0x36')]({'plain':!![]});if(_0x4436b5[_0xb9c5('0x82')]&&_0x4436b5[_0xb9c5('0x82')][_0xb9c5('0x83')][_0xb9c5('0x57')]){return _0x4436b5['List'][_0xb9c5('0x83')][0x0];}return db[_0xb9c5('0x70')][_0xb9c5('0x59')](_[_0xb9c5('0x8c')](_0x3c52c9[_0xb9c5('0x5a')],{'firstName':_0x319db7,[_0x58562b['mapKey']]:_0x319db7,'phone':_0x319db7,'ListId':_0x4436b5['ListId']}));}})[_0xb9c5('0x1f')](handleEntityNotFound(_0x58b217,null))[_0xb9c5('0x1f')](function(_0x82d408){if(_0x82d408){_0x10a70e=_0x82d408;return db[_0xb9c5('0x8f')][_0xb9c5('0x58')]({'where':{'ContactId':_0x10a70e['id'],'closed':![],'OpenchannelAccountId':_0x4436b5['id']}})['then'](function(_0x5583af){if(_0x5583af){return[_0x5583af,![]];}return db[_0xb9c5('0x8f')][_0xb9c5('0x59')]({'UserId':_0x3c52c9[_0xb9c5('0x5b')]['id'],'ContactId':_0x10a70e['id'],'OpenchannelAccountId':_0x4436b5['id'],'lastMsgDirection':_0xb9c5('0xbd'),'firstMsgDirection':_0xb9c5('0xbd'),'Messages':[_['merge'](_0x3c52c9[_0xb9c5('0x5a')],{'read':![],'body':_0x3c52c9[_0xb9c5('0x5a')][_0xb9c5('0x5a')],'OpenchannelAccountId':_0x4436b5['id'],'UserId':_0x3c52c9[_0xb9c5('0x5b')]['id'],'ContactId':_0x10a70e['id']})]},{'include':[{'model':db[_0xb9c5('0xbe')],'as':_0xb9c5('0xbf')}]})['then'](function(_0x202473){return[_0x202473,!![]];});});}})[_0xb9c5('0x92')](function(_0x4bd845,_0x393b9c){if(_0x393b9c){return _0x4bd845;}return db[_0xb9c5('0xbe')][_0xb9c5('0x59')](_['merge'](_0x3c52c9['body'],{'read':![],'body':_0x3c52c9[_0xb9c5('0x5a')][_0xb9c5('0x5a')],'OpenchannelAccountId':_0x4436b5['id'],'OpenchannelInteractionId':_0x4bd845['id'],'UserId':_0x3c52c9[_0xb9c5('0x5b')]['id'],'ContactId':_0x10a70e['id']}))[_0xb9c5('0x1f')](function(_0x1642ef){_0x4bd845[_0xb9c5('0xc0')][_0xb9c5('0xbf')]=[];_0x4bd845[_0xb9c5('0xc0')]['Messages']['push'](_0x1642ef[_0xb9c5('0xc0')]);return _0x4bd845;});});}})[_0xb9c5('0x1f')](respondWithResult(_0x58b217,null))['catch'](handleError(_0x58b217,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c549462..193235e 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 _0xd8b0=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x10c7a3,_0x46ac7c){var _0xe716a=function(_0x55b2a3){while(--_0x55b2a3){_0x10c7a3['push'](_0x10c7a3['shift']());}};_0xe716a(++_0x46ac7c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x0d8b('0x0'));var OpenchannelAccount=require(_0x0d8b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d8b('0x2'),'afterDestroy':_0x0d8b('0x3')};function emitEvent(_0x43bca1){return function(_0x364286,_0x8196ed,_0x577834){OpenchannelAccountEvents['emit'](_0x43bca1+':'+_0x364286['id'],_0x364286);OpenchannelAccountEvents[_0x0d8b('0x4')](_0x43bca1,_0x364286);_0x577834(null);};}for(var e in events){if(events[_0x0d8b('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0d8b('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x70e0=['emit','events','../../mysqldb','OpenchannelAccount','update','remove'];(function(_0x551809,_0x25b886){var _0x13c129=function(_0x4a9999){while(--_0x4a9999){_0x551809['push'](_0x551809['shift']());}};_0x13c129(++_0x25b886);}(_0x70e0,0x17b));var _0x070e=function(_0x34c79c,_0x1c2af3){_0x34c79c=_0x34c79c-0x0;var _0x25b14f=_0x70e0[_0x34c79c];return _0x25b14f;};'use strict';var EventEmitter=require(_0x070e('0x0'));var OpenchannelAccount=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){OpenchannelAccountEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);OpenchannelAccountEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index e69fb2f..43ace35 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(_0x1d8c52,_0x3c2bca){var _0x37d07c=function(_0x54770f){while(--_0x54770f){_0x1d8c52['push'](_0x1d8c52['shift']());}};_0x37d07c(++_0x3c2bca);}(_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':'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(_0x4fd973,_0x182941){var _0x13dfdf=function(_0x1fe184){while(--_0x1fe184){_0x4fd973['push'](_0x4fd973['shift']());}};_0x13dfdf(++_0x182941);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 8ae949e..09f7baa 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 _0x282b=['request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x169f89,_0x257e3e){var _0xd2a913=function(_0x37838f){while(--_0x37838f){_0x169f89['push'](_0x169f89['shift']());}};_0xd2a913(++_0x257e3e);}(_0x282b,0xec));var _0xb282=function(_0x435c80,_0x1bccd3){_0x435c80=_0x435c80-0x0;var _0x1d0fe1=_0x282b[_0x435c80];return _0x1d0fe1;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});config[_0xb282('0xb')]=_['defaults'](config['redis'],{'host':_0xb282('0xc'),'port':0x18eb});var socket=require(_0xb282('0xd'))(new Redis(config['redis']));require(_0xb282('0xe'))[_0xb282('0xf')](socket);function respondWithRpcPromise(_0x3435fc,_0x2d86ba,_0x56caf2){return new BPromise(function(_0x47e62e,_0x36b984){return client[_0xb282('0x10')](_0x3435fc,_0x56caf2)[_0xb282('0x11')](function(_0x1cbe28){logger[_0xb282('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x2d86ba,'request\x20sent');logger[_0xb282('0x13')](_0xb282('0x14'),_0x2d86ba,_0xb282('0x15'),JSON[_0xb282('0x16')](_0x1cbe28));if(_0x1cbe28[_0xb282('0x17')]){if(_0x1cbe28['error'][_0xb282('0x18')]===0x1f4){logger['error'](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')]['message']);return _0x36b984(_0x1cbe28['error']['message']);}logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x1cbe28[_0xb282('0x17')][_0xb282('0x1a')]);return _0x47e62e(_0x1cbe28[_0xb282('0x17')]['message']);}else{logger[_0xb282('0x12')](_0xb282('0x19'),_0x2d86ba,_0xb282('0x15'));_0x47e62e(_0x1cbe28[_0xb282('0x1b')][_0xb282('0x1a')]);}})['catch'](function(_0x52e305){logger[_0xb282('0x17')](_0xb282('0x19'),_0x2d86ba,_0x52e305);_0x36b984(_0x52e305);});});} \ No newline at end of file +var _0xb574=['info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x25eed1,_0x378151){var _0x13419e=function(_0x271621){while(--_0x271621){_0x25eed1['push'](_0x25eed1['shift']());}};_0x13419e(++_0x378151);}(_0xb574,0x106));var _0x4b57=function(_0x13be74,_0x34801b){_0x13be74=_0x13be74-0x0;var _0x36390f=_0xb574[_0x13be74];return _0x36390f;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b57('0xa'))(new Redis(config[_0x4b57('0xb')]));require(_0x4b57('0xc'))[_0x4b57('0xd')](socket);function respondWithRpcPromise(_0xce47ad,_0x116958,_0x1db79a){return new BPromise(function(_0x43b108,_0x5593b8){return client[_0x4b57('0xe')](_0xce47ad,_0x1db79a)[_0x4b57('0xf')](function(_0x274912){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x4b57('0x10'));logger[_0x4b57('0x11')](_0x4b57('0x12'),_0x116958,_0x4b57('0x10'),JSON[_0x4b57('0x13')](_0x274912));if(_0x274912[_0x4b57('0x14')]){if(_0x274912[_0x4b57('0x14')][_0x4b57('0x15')]===0x1f4){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x5593b8(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}logger['error'](_0x4b57('0x17'),_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x43b108(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}else{logger[_0x4b57('0x18')](_0x4b57('0x17'),_0x116958,_0x4b57('0x10'));_0x43b108(_0x274912['result'][_0x4b57('0x16')]);}})[_0x4b57('0x19')](function(_0x53f29a){logger[_0x4b57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x116958,_0x53f29a);_0x5593b8(_0x53f29a);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index ecd88ac..f00ad8d 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 _0xcd31=['openchannelAccount:','save','remove','update','emit','removeListener'];(function(_0x3316c1,_0x21aada){var _0x9f822f=function(_0x142d4a){while(--_0x142d4a){_0x3316c1['push'](_0x3316c1['shift']());}};_0x9f822f(++_0x21aada);}(_0xcd31,0x15d));var _0x1cd3=function(_0x2bce68,_0x146337){_0x2bce68=_0x2bce68-0x0;var _0x16353c=_0xcd31[_0x2bce68];return _0x16353c;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x1cd3('0x0'),_0x1cd3('0x1'),_0x1cd3('0x2')];function createListener(_0x5708ef,_0x3da1e3){return function(_0x19dd0c){_0x3da1e3[_0x1cd3('0x3')](_0x5708ef,_0x19dd0c);};}function removeListener(_0x28c67f,_0x295933){return function(){OpenchannelAccountEvents[_0x1cd3('0x4')](_0x28c67f,_0x295933);};}exports['register']=function(_0x26ffcb){for(var _0x1ca151=0x0,_0xedb6d1=events['length'];_0x1ca151<_0xedb6d1;_0x1ca151++){var _0x45cc24=events[_0x1ca151];var _0x11b139=createListener(_0x1cd3('0x5')+_0x45cc24,_0x26ffcb);OpenchannelAccountEvents['on'](_0x45cc24,_0x11b139);}}; \ No newline at end of file +var _0x81a4=['register','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit'];(function(_0x392e52,_0x41196e){var _0x38ff9d=function(_0xd34be3){while(--_0xd34be3){_0x392e52['push'](_0x392e52['shift']());}};_0x38ff9d(++_0x41196e);}(_0x81a4,0x1a6));var _0x481a=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x81a4[_0x33c1b1];return _0x2c2037;};'use strict';var OpenchannelAccountEvents=require(_0x481a('0x0'));var events=[_0x481a('0x1'),_0x481a('0x2'),_0x481a('0x3')];function createListener(_0x5a1f1f,_0x39262a){return function(_0x4f7de1){_0x39262a[_0x481a('0x4')](_0x5a1f1f,_0x4f7de1);};}function removeListener(_0x27a5dd,_0x2bc9ed){return function(){OpenchannelAccountEvents['removeListener'](_0x27a5dd,_0x2bc9ed);};}exports[_0x481a('0x5')]=function(_0x3a6458){for(var _0x17d40e=0x0,_0x14b819=events['length'];_0x17d40e<_0x14b819;_0x17d40e++){var _0x13ed10=events[_0x17d40e];var _0x13b771=createListener(_0x481a('0x6')+_0x13ed10,_0x3a6458);OpenchannelAccountEvents['on'](_0x13ed10,_0x13b771);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 604ce27..07bc960 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 _0x8d9e=['../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','post','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x509664,_0x3b54e8){var _0x12cbef=function(_0x513dc7){while(--_0x513dc7){_0x509664['push'](_0x509664['shift']());}};_0x12cbef(++_0x3b54e8);}(_0x8d9e,0x79));var _0xe8d9=function(_0x9b4c19,_0x42a6d8){_0x9b4c19=_0x9b4c19-0x0;var _0x40c837=_0x8d9e[_0x9b4c19];return _0x40c837;};'use strict';var multer=require(_0xe8d9('0x0'));var util=require(_0xe8d9('0x1'));var path=require(_0xe8d9('0x2'));var timeout=require(_0xe8d9('0x3'));var express=require(_0xe8d9('0x4'));var router=express[_0xe8d9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe8d9('0x6'));var config=require(_0xe8d9('0x7'));var controller=require(_0xe8d9('0x8'));router['get']('/',auth[_0xe8d9('0x9')](),controller[_0xe8d9('0xa')]);router[_0xe8d9('0xb')](_0xe8d9('0xc'),auth[_0xe8d9('0x9')](),controller['show']);router[_0xe8d9('0xd')]('/',auth[_0xe8d9('0x9')](),controller['create']);router['put']('/:id',auth[_0xe8d9('0x9')](),controller['update']);router['delete'](_0xe8d9('0xc'),auth[_0xe8d9('0x9')](),controller[_0xe8d9('0xe')]);module[_0xe8d9('0xf')]=router; \ No newline at end of file +var _0x2b3f=['index','get','/:id','post','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated'];(function(_0x2876c0,_0x118594){var _0xe572e2=function(_0x16ab89){while(--_0x16ab89){_0x2876c0['push'](_0x2876c0['shift']());}};_0xe572e2(++_0x118594);}(_0x2b3f,0xcd));var _0xf2b3=function(_0x57862e,_0x2c787f){_0x57862e=_0x57862e-0x0;var _0x1f44ba=_0x2b3f[_0x57862e];return _0x1f44ba;};'use strict';var multer=require('multer');var util=require(_0xf2b3('0x0'));var path=require(_0xf2b3('0x1'));var timeout=require(_0xf2b3('0x2'));var express=require(_0xf2b3('0x3'));var router=express[_0xf2b3('0x4')]();var fs_extra=require(_0xf2b3('0x5'));var auth=require(_0xf2b3('0x6'));var interaction=require(_0xf2b3('0x7'));var config=require(_0xf2b3('0x8'));var controller=require(_0xf2b3('0x9'));router['get']('/',auth[_0xf2b3('0xa')](),controller[_0xf2b3('0xb')]);router[_0xf2b3('0xc')](_0xf2b3('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf2b3('0xe')]('/',auth[_0xf2b3('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf2b3('0xf')]);router[_0xf2b3('0x10')](_0xf2b3('0xd'),auth[_0xf2b3('0xa')](),controller['destroy']);module[_0xf2b3('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index cf53123..54bbd58 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 _0x5e57=['STRING','noop','TEXT','exports','INTEGER'];(function(_0x36e963,_0x61d1f9){var _0x5e4971=function(_0x1d1eeb){while(--_0x1d1eeb){_0x36e963['push'](_0x36e963['shift']());}};_0x5e4971(++_0x61d1f9);}(_0x5e57,0x13e));var _0x75e5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5e57[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x75e5('0x0')]={'priority':{'type':Sequelize[_0x75e5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x75e5('0x2')],'allowNull':![],'defaultValue':_0x75e5('0x3')},'appdata':{'type':Sequelize[_0x75e5('0x4')]()},'description':{'type':Sequelize[_0x75e5('0x2')]},'interval':{'type':Sequelize[_0x75e5('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x60b2=['noop','TEXT','STRING','exports'];(function(_0x234ce7,_0x3e909c){var _0x57c561=function(_0x8ac1bb){while(--_0x8ac1bb){_0x234ce7['push'](_0x234ce7['shift']());}};_0x57c561(++_0x3e909c);}(_0x60b2,0x1db));var _0x260b=function(_0x35c4c9,_0x2cdabb){_0x35c4c9=_0x35c4c9-0x0;var _0x36e68b=_0x60b2[_0x35c4c9];return _0x36e68b;};'use strict';var Sequelize=require('sequelize');module[_0x260b('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x260b('0x1')},'appdata':{'type':Sequelize[_0x260b('0x2')]()},'description':{'type':Sequelize[_0x260b('0x3')]},'interval':{'type':Sequelize[_0x260b('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index de5ed61..99eec7a 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 _0xe692=['fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0xe692,0x16f));var _0x2e69=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xe692[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require(_0x2e69('0x0'));var rimraf=require(_0x2e69('0x1'));var zipdir=require(_0x2e69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e69('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2e69('0x4'));var util=require(_0x2e69('0x5'));var path=require(_0x2e69('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e69('0x7'));var fs=require('fs');var fs_extra=require(_0x2e69('0x8'));var _=require(_0x2e69('0x9'));var squel=require(_0x2e69('0xa'));var crypto=require(_0x2e69('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2e69('0xc'));var toCsv=require(_0x2e69('0xd'));var querystring=require('querystring');var Papa=require(_0x2e69('0xe'));var Redis=require(_0x2e69('0xf'));var authService=require(_0x2e69('0x10'));var qs=require(_0x2e69('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e69('0x12'))(_0x2e69('0x13'));var utils=require(_0x2e69('0x14'));var config=require(_0x2e69('0x15'));var licenseUtil=require(_0x2e69('0x16'));var db=require(_0x2e69('0x17'))['db'];function respondWithStatusCode(_0x335bb7,_0x3bd2b9){_0x3bd2b9=_0x3bd2b9||0xcc;return function(_0x3c56ee){if(_0x3c56ee){return _0x335bb7[_0x2e69('0x18')](_0x3bd2b9);}return _0x335bb7['status'](_0x3bd2b9)[_0x2e69('0x19')]();};}function respondWithResult(_0x544dda,_0x5b57c1){_0x5b57c1=_0x5b57c1||0xc8;return function(_0x1895bc){if(_0x1895bc){return _0x544dda[_0x2e69('0x1a')](_0x5b57c1)[_0x2e69('0x1b')](_0x1895bc);}};}function respondWithFilteredResult(_0x2b1ac6,_0x3bf558){return function(_0x116053){if(_0x116053){var _0x57b93b=typeof _0x3bf558['offset']===_0x2e69('0x1c')&&typeof _0x3bf558[_0x2e69('0x1d')]===_0x2e69('0x1c');var _0x2424bb=_0x116053[_0x2e69('0x1e')];var _0x4ff97e=_0x57b93b?0x0:_0x3bf558[_0x2e69('0x1f')];var _0x36866b=_0x57b93b?_0x116053[_0x2e69('0x1e')]:_0x3bf558[_0x2e69('0x1f')]+_0x3bf558['limit'];var _0x1e8fb3;if(_0x36866b>=_0x2424bb){_0x36866b=_0x2424bb;_0x1e8fb3=0xc8;}else{_0x1e8fb3=0xce;}_0x2b1ac6['status'](_0x1e8fb3);return _0x2b1ac6[_0x2e69('0x20')](_0x2e69('0x21'),_0x4ff97e+'-'+_0x36866b+'/'+_0x2424bb)[_0x2e69('0x1b')](_0x116053);}return null;};}function patchUpdates(_0x321328){return function(_0x3f59bd){try{jsonpatch['apply'](_0x3f59bd,_0x321328,!![]);}catch(_0xef57e4){return BPromise[_0x2e69('0x22')](_0xef57e4);}return _0x3f59bd[_0x2e69('0x23')]();};}function saveUpdates(_0x556a20,_0x4ca1fe){return function(_0x430710){if(_0x430710){return _0x430710[_0x2e69('0x24')](_0x556a20)[_0x2e69('0x25')](function(_0x13533c){return _0x13533c;});}return null;};}function removeEntity(_0x4f7a3b,_0x427975){return function(_0x41eb5e){if(_0x41eb5e){return _0x41eb5e[_0x2e69('0x26')]()[_0x2e69('0x25')](function(){_0x4f7a3b[_0x2e69('0x1a')](0xcc)[_0x2e69('0x19')]();});}};}function handleEntityNotFound(_0x301e91,_0x20763a){return function(_0x431a68){if(!_0x431a68){_0x301e91[_0x2e69('0x18')](0x194);}return _0x431a68;};}function handleError(_0x68e4f6,_0x2c3109){_0x2c3109=_0x2c3109||0x1f4;return function(_0x561a5c){logger[_0x2e69('0x27')](_0x561a5c[_0x2e69('0x28')]);if(_0x561a5c[_0x2e69('0x29')]){delete _0x561a5c[_0x2e69('0x29')];}_0x68e4f6['status'](_0x2c3109)[_0x2e69('0x2a')](_0x561a5c);};}exports[_0x2e69('0x2b')]=function(_0x2c9275,_0x2f1868){var _0x562c8d={},_0x5239bb={},_0x361123={'count':0x0,'rows':[]};var _0x12dd8b=_['map'](db[_0x2e69('0x2c')][_0x2e69('0x2d')],function(_0x3ad931){return{'name':_0x3ad931[_0x2e69('0x2e')],'type':_0x3ad931[_0x2e69('0x2f')][_0x2e69('0x30')]};});_0x5239bb[_0x2e69('0x31')]=_[_0x2e69('0x32')](_0x12dd8b,_0x2e69('0x29'));_0x5239bb[_0x2e69('0x33')]=_['keys'](_0x2c9275['query']);_0x5239bb[_0x2e69('0x34')]=_[_0x2e69('0x35')](_0x5239bb['model'],_0x5239bb['query']);_0x562c8d['attributes']=_[_0x2e69('0x35')](_0x5239bb[_0x2e69('0x31')],qs[_0x2e69('0x36')](_0x2c9275[_0x2e69('0x33')]['fields']));_0x562c8d[_0x2e69('0x37')]=_0x562c8d['attributes'][_0x2e69('0x38')]?_0x562c8d['attributes']:_0x5239bb[_0x2e69('0x31')];if(!_0x2c9275['query'][_0x2e69('0x39')]('nolimit')){_0x562c8d['limit']=qs['limit'](_0x2c9275[_0x2e69('0x33')]['limit']);_0x562c8d[_0x2e69('0x1f')]=qs[_0x2e69('0x1f')](_0x2c9275[_0x2e69('0x33')][_0x2e69('0x1f')]);}_0x562c8d[_0x2e69('0x3a')]=qs['sort'](_0x2c9275[_0x2e69('0x33')]['sort']);_0x562c8d[_0x2e69('0x3b')]=qs[_0x2e69('0x34')](_[_0x2e69('0x3c')](_0x2c9275[_0x2e69('0x33')],_0x5239bb['filters']),_0x12dd8b);if(_0x2c9275[_0x2e69('0x33')][_0x2e69('0x3d')]){_0x562c8d['where']=_[_0x2e69('0x3e')](_0x562c8d[_0x2e69('0x3b')],{'$or':_['map'](_0x12dd8b,function(_0x5003a1){if(_0x5003a1[_0x2e69('0x2f')]!==_0x2e69('0x3f')){var _0x446975={};_0x446975[_0x5003a1[_0x2e69('0x29')]]={'$like':'%'+_0x2c9275[_0x2e69('0x33')][_0x2e69('0x3d')]+'%'};return _0x446975;}})});}_0x562c8d=_[_0x2e69('0x3e')]({},_0x562c8d,_0x2c9275[_0x2e69('0x40')]);var _0x33fa83={'where':_0x562c8d[_0x2e69('0x3b')]};return db[_0x2e69('0x2c')]['count'](_0x33fa83)[_0x2e69('0x25')](function(_0x471c0f){_0x361123[_0x2e69('0x1e')]=_0x471c0f;if(_0x2c9275[_0x2e69('0x33')][_0x2e69('0x41')]){_0x562c8d[_0x2e69('0x42')]=[{'all':!![]}];}return db[_0x2e69('0x2c')]['findAll'](_0x562c8d);})[_0x2e69('0x25')](function(_0x491b2d){_0x361123[_0x2e69('0x43')]=_0x491b2d;return _0x361123;})[_0x2e69('0x25')](respondWithFilteredResult(_0x2f1868,_0x562c8d))[_0x2e69('0x44')](handleError(_0x2f1868,null));};exports[_0x2e69('0x45')]=function(_0x299436,_0x503408){var _0x19bf67={'raw':!![],'where':{'id':_0x299436['params']['id']}},_0x41e4a7={};_0x41e4a7[_0x2e69('0x31')]=_[_0x2e69('0x46')](db[_0x2e69('0x2c')][_0x2e69('0x2d')]);_0x41e4a7[_0x2e69('0x33')]=_['keys'](_0x299436['query']);_0x41e4a7[_0x2e69('0x34')]=_[_0x2e69('0x35')](_0x41e4a7[_0x2e69('0x31')],_0x41e4a7['query']);_0x19bf67[_0x2e69('0x37')]=_[_0x2e69('0x35')](_0x41e4a7['model'],qs['fields'](_0x299436[_0x2e69('0x33')][_0x2e69('0x36')]));_0x19bf67[_0x2e69('0x37')]=_0x19bf67[_0x2e69('0x37')][_0x2e69('0x38')]?_0x19bf67[_0x2e69('0x37')]:_0x41e4a7[_0x2e69('0x31')];if(_0x299436[_0x2e69('0x33')][_0x2e69('0x41')]){_0x19bf67[_0x2e69('0x42')]=[{'all':!![]}];}_0x19bf67=_[_0x2e69('0x3e')]({},_0x19bf67,_0x299436[_0x2e69('0x40')]);return db[_0x2e69('0x2c')][_0x2e69('0x47')](_0x19bf67)[_0x2e69('0x25')](handleEntityNotFound(_0x503408,null))[_0x2e69('0x25')](respondWithResult(_0x503408,null))[_0x2e69('0x44')](handleError(_0x503408,null));};exports['create']=function(_0xef2e86,_0x256fd7){return db[_0x2e69('0x2c')][_0x2e69('0x48')](_0xef2e86[_0x2e69('0x49')],{})[_0x2e69('0x25')](respondWithResult(_0x256fd7,0xc9))[_0x2e69('0x44')](handleError(_0x256fd7,null));};exports[_0x2e69('0x24')]=function(_0xb89432,_0x47e4b){if(_0xb89432[_0x2e69('0x49')]['id']){delete _0xb89432[_0x2e69('0x49')]['id'];}return db[_0x2e69('0x2c')][_0x2e69('0x47')]({'where':{'id':_0xb89432['params']['id']}})[_0x2e69('0x25')](handleEntityNotFound(_0x47e4b,null))['then'](saveUpdates(_0xb89432['body'],null))[_0x2e69('0x25')](respondWithResult(_0x47e4b,null))[_0x2e69('0x44')](handleError(_0x47e4b,null));};exports[_0x2e69('0x26')]=function(_0x4d083d,_0x2edf64){return db['OpenchannelApplication'][_0x2e69('0x47')]({'where':{'id':_0x4d083d[_0x2e69('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2edf64,null))[_0x2e69('0x25')](removeEntity(_0x2edf64,null))[_0x2e69('0x44')](handleError(_0x2edf64,null));}; \ No newline at end of file +var _0xdf72=['body','update','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','count','limit','set','Content-Range','json','apply','save','destroy','then','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','OpenchannelApplication','findAll','rows','catch','show','params','rawAttributes','find','create'];(function(_0x138325,_0x4372e6){var _0x1aa3bd=function(_0x545f8b){while(--_0x545f8b){_0x138325['push'](_0x138325['shift']());}};_0x1aa3bd(++_0x4372e6);}(_0xdf72,0x16f));var _0x2df7=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0xdf72[_0x254d9f];return _0x1eedb9;};'use strict';var emlformat=require(_0x2df7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2df7('0x1'));var jsonpatch=require(_0x2df7('0x2'));var rp=require('request-promise');var moment=require(_0x2df7('0x3'));var BPromise=require(_0x2df7('0x4'));var Mustache=require(_0x2df7('0x5'));var util=require('util');var path=require(_0x2df7('0x6'));var sox=require(_0x2df7('0x7'));var csv=require(_0x2df7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2df7('0x9'));var _=require(_0x2df7('0xa'));var squel=require(_0x2df7('0xb'));var crypto=require(_0x2df7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2df7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2df7('0xd'));var authService=require(_0x2df7('0xe'));var qs=require(_0x2df7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2df7('0x10'));var logger=require(_0x2df7('0x11'))(_0x2df7('0x12'));var utils=require(_0x2df7('0x13'));var config=require(_0x2df7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2df7('0x15'))['db'];function respondWithStatusCode(_0x174d28,_0x4def8b){_0x4def8b=_0x4def8b||0xcc;return function(_0x1719d9){if(_0x1719d9){return _0x174d28[_0x2df7('0x16')](_0x4def8b);}return _0x174d28['status'](_0x4def8b)[_0x2df7('0x17')]();};}function respondWithResult(_0x315e31,_0xcfbd1e){_0xcfbd1e=_0xcfbd1e||0xc8;return function(_0x293edc){if(_0x293edc){return _0x315e31[_0x2df7('0x18')](_0xcfbd1e)['json'](_0x293edc);}};}function respondWithFilteredResult(_0x270a70,_0x370b99){return function(_0x5d1819){if(_0x5d1819){var _0x1993f0=typeof _0x370b99['offset']===_0x2df7('0x19')&&typeof _0x370b99['limit']===_0x2df7('0x19');var _0x4b04b9=_0x5d1819['count'];var _0x244e2b=_0x1993f0?0x0:_0x370b99[_0x2df7('0x1a')];var _0x4fca9f=_0x1993f0?_0x5d1819[_0x2df7('0x1b')]:_0x370b99[_0x2df7('0x1a')]+_0x370b99[_0x2df7('0x1c')];var _0x5b4ff8;if(_0x4fca9f>=_0x4b04b9){_0x4fca9f=_0x4b04b9;_0x5b4ff8=0xc8;}else{_0x5b4ff8=0xce;}_0x270a70[_0x2df7('0x18')](_0x5b4ff8);return _0x270a70[_0x2df7('0x1d')](_0x2df7('0x1e'),_0x244e2b+'-'+_0x4fca9f+'/'+_0x4b04b9)[_0x2df7('0x1f')](_0x5d1819);}return null;};}function patchUpdates(_0x3571f5){return function(_0x44f0e9){try{jsonpatch[_0x2df7('0x20')](_0x44f0e9,_0x3571f5,!![]);}catch(_0x3ff4af){return BPromise['reject'](_0x3ff4af);}return _0x44f0e9[_0x2df7('0x21')]();};}function saveUpdates(_0x353690,_0x5c427d){return function(_0x9dd4a8){if(_0x9dd4a8){return _0x9dd4a8['update'](_0x353690)['then'](function(_0x13f55d){return _0x13f55d;});}return null;};}function removeEntity(_0x370e2c,_0x4dd517){return function(_0x35dc53){if(_0x35dc53){return _0x35dc53[_0x2df7('0x22')]()[_0x2df7('0x23')](function(){_0x370e2c[_0x2df7('0x18')](0xcc)[_0x2df7('0x17')]();});}};}function handleEntityNotFound(_0x4c63a7,_0x218ffa){return function(_0x134dc1){if(!_0x134dc1){_0x4c63a7['sendStatus'](0x194);}return _0x134dc1;};}function handleError(_0xe20267,_0x3dcd6e){_0x3dcd6e=_0x3dcd6e||0x1f4;return function(_0x41795a){logger[_0x2df7('0x24')](_0x41795a['stack']);if(_0x41795a['name']){delete _0x41795a[_0x2df7('0x25')];}_0xe20267[_0x2df7('0x18')](_0x3dcd6e)[_0x2df7('0x26')](_0x41795a);};}exports[_0x2df7('0x27')]=function(_0x1fabb9,_0x10caee){var _0x5a5efa={},_0x2a3eed={},_0xba51bc={'count':0x0,'rows':[]};var _0x4ec27c=_[_0x2df7('0x28')](db['OpenchannelApplication']['rawAttributes'],function(_0x683f35){return{'name':_0x683f35[_0x2df7('0x29')],'type':_0x683f35[_0x2df7('0x2a')][_0x2df7('0x2b')]};});_0x2a3eed[_0x2df7('0x2c')]=_[_0x2df7('0x28')](_0x4ec27c,_0x2df7('0x25'));_0x2a3eed[_0x2df7('0x2d')]=_[_0x2df7('0x2e')](_0x1fabb9['query']);_0x2a3eed[_0x2df7('0x2f')]=_['intersection'](_0x2a3eed['model'],_0x2a3eed['query']);_0x5a5efa[_0x2df7('0x30')]=_[_0x2df7('0x31')](_0x2a3eed['model'],qs[_0x2df7('0x32')](_0x1fabb9['query'][_0x2df7('0x32')]));_0x5a5efa['attributes']=_0x5a5efa[_0x2df7('0x30')][_0x2df7('0x33')]?_0x5a5efa[_0x2df7('0x30')]:_0x2a3eed[_0x2df7('0x2c')];if(!_0x1fabb9[_0x2df7('0x2d')]['hasOwnProperty']('nolimit')){_0x5a5efa[_0x2df7('0x1c')]=qs[_0x2df7('0x1c')](_0x1fabb9['query']['limit']);_0x5a5efa[_0x2df7('0x1a')]=qs[_0x2df7('0x1a')](_0x1fabb9[_0x2df7('0x2d')]['offset']);}_0x5a5efa[_0x2df7('0x34')]=qs[_0x2df7('0x35')](_0x1fabb9[_0x2df7('0x2d')][_0x2df7('0x35')]);_0x5a5efa['where']=qs[_0x2df7('0x2f')](_[_0x2df7('0x36')](_0x1fabb9[_0x2df7('0x2d')],_0x2a3eed[_0x2df7('0x2f')]),_0x4ec27c);if(_0x1fabb9[_0x2df7('0x2d')][_0x2df7('0x37')]){_0x5a5efa[_0x2df7('0x38')]=_[_0x2df7('0x39')](_0x5a5efa[_0x2df7('0x38')],{'$or':_[_0x2df7('0x28')](_0x4ec27c,function(_0x393b21){if(_0x393b21[_0x2df7('0x2a')]!==_0x2df7('0x3a')){var _0x203225={};_0x203225[_0x393b21['name']]={'$like':'%'+_0x1fabb9[_0x2df7('0x2d')][_0x2df7('0x37')]+'%'};return _0x203225;}})});}_0x5a5efa=_['merge']({},_0x5a5efa,_0x1fabb9[_0x2df7('0x3b')]);var _0x48e5e1={'where':_0x5a5efa[_0x2df7('0x38')]};return db['OpenchannelApplication'][_0x2df7('0x1b')](_0x48e5e1)[_0x2df7('0x23')](function(_0x840b93){_0xba51bc[_0x2df7('0x1b')]=_0x840b93;if(_0x1fabb9['query'][_0x2df7('0x3c')]){_0x5a5efa[_0x2df7('0x3d')]=[{'all':!![]}];}return db[_0x2df7('0x3e')][_0x2df7('0x3f')](_0x5a5efa);})['then'](function(_0x5746ae){_0xba51bc[_0x2df7('0x40')]=_0x5746ae;return _0xba51bc;})[_0x2df7('0x23')](respondWithFilteredResult(_0x10caee,_0x5a5efa))[_0x2df7('0x41')](handleError(_0x10caee,null));};exports[_0x2df7('0x42')]=function(_0x2cb09c,_0x1d0cb5){var _0x3fbd96={'raw':!![],'where':{'id':_0x2cb09c[_0x2df7('0x43')]['id']}},_0x4cdeae={};_0x4cdeae['model']=_['keys'](db[_0x2df7('0x3e')][_0x2df7('0x44')]);_0x4cdeae[_0x2df7('0x2d')]=_[_0x2df7('0x2e')](_0x2cb09c[_0x2df7('0x2d')]);_0x4cdeae[_0x2df7('0x2f')]=_[_0x2df7('0x31')](_0x4cdeae[_0x2df7('0x2c')],_0x4cdeae[_0x2df7('0x2d')]);_0x3fbd96[_0x2df7('0x30')]=_[_0x2df7('0x31')](_0x4cdeae['model'],qs['fields'](_0x2cb09c['query'][_0x2df7('0x32')]));_0x3fbd96[_0x2df7('0x30')]=_0x3fbd96[_0x2df7('0x30')][_0x2df7('0x33')]?_0x3fbd96[_0x2df7('0x30')]:_0x4cdeae['model'];if(_0x2cb09c[_0x2df7('0x2d')][_0x2df7('0x3c')]){_0x3fbd96[_0x2df7('0x3d')]=[{'all':!![]}];}_0x3fbd96=_['merge']({},_0x3fbd96,_0x2cb09c[_0x2df7('0x3b')]);return db[_0x2df7('0x3e')][_0x2df7('0x45')](_0x3fbd96)[_0x2df7('0x23')](handleEntityNotFound(_0x1d0cb5,null))['then'](respondWithResult(_0x1d0cb5,null))[_0x2df7('0x41')](handleError(_0x1d0cb5,null));};exports[_0x2df7('0x46')]=function(_0x386e82,_0xc62291){return db[_0x2df7('0x3e')][_0x2df7('0x46')](_0x386e82[_0x2df7('0x47')],{})['then'](respondWithResult(_0xc62291,0xc9))[_0x2df7('0x41')](handleError(_0xc62291,null));};exports[_0x2df7('0x48')]=function(_0x3813a2,_0x51771e){if(_0x3813a2[_0x2df7('0x47')]['id']){delete _0x3813a2[_0x2df7('0x47')]['id'];}return db[_0x2df7('0x3e')][_0x2df7('0x45')]({'where':{'id':_0x3813a2[_0x2df7('0x43')]['id']}})['then'](handleEntityNotFound(_0x51771e,null))['then'](saveUpdates(_0x3813a2[_0x2df7('0x47')],null))[_0x2df7('0x23')](respondWithResult(_0x51771e,null))[_0x2df7('0x41')](handleError(_0x51771e,null));};exports[_0x2df7('0x22')]=function(_0x13744e,_0x1c3590){return db[_0x2df7('0x3e')]['find']({'where':{'id':_0x13744e[_0x2df7('0x43')]['id']}})['then'](handleEntityNotFound(_0x1c3590,null))[_0x2df7('0x23')](removeEntity(_0x1c3590,null))[_0x2df7('0x41')](handleError(_0x1c3590,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 5248d74..86b194a 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 _0x4a63=['./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0x4a63,0x1c0));var _0x34a6=function(_0x57a53b,_0x11494e){_0x57a53b=_0x57a53b-0x0;var _0x29e81c=_0x4a63[_0x57a53b];return _0x29e81c;};'use strict';var _=require('lodash');var util=require(_0x34a6('0x0'));var logger=require('../../config/logger')(_0x34a6('0x1'));var moment=require(_0x34a6('0x2'));var BPromise=require(_0x34a6('0x3'));var rp=require(_0x34a6('0x4'));var fs=require('fs');var path=require(_0x34a6('0x5'));var rimraf=require('rimraf');var config=require(_0x34a6('0x6'));var attributes=require(_0x34a6('0x7'));module['exports']=function(_0x54adbf,_0x3a1c08){return _0x54adbf[_0x34a6('0x8')](_0x34a6('0x9'),attributes,{'tableName':_0x34a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x34a6('0xb'),'collate':_0x34a6('0xc')});}; \ No newline at end of file +var _0x5389=['./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5389,0x12a));var _0x9538=function(_0x4872f0,_0x305d25){_0x4872f0=_0x4872f0-0x0;var _0x35b4fc=_0x5389[_0x4872f0];return _0x35b4fc;};'use strict';var _=require(_0x9538('0x0'));var util=require(_0x9538('0x1'));var logger=require(_0x9538('0x2'))(_0x9538('0x3'));var moment=require(_0x9538('0x4'));var BPromise=require(_0x9538('0x5'));var rp=require(_0x9538('0x6'));var fs=require('fs');var path=require(_0x9538('0x7'));var rimraf=require(_0x9538('0x8'));var config=require(_0x9538('0x9'));var attributes=require(_0x9538('0xa'));module[_0x9538('0xb')]=function(_0x3681fe,_0x1ec789){return _0x3681fe['define']('OpenchannelApplication',attributes,{'tableName':_0x9538('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9538('0xd'),'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 02faa61..280c1d5 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 _0xb0df=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelApplication','body','options','raw','attributes','UpdateOpenchannelApplication','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x120efc,_0x16711f){var _0x4978bd=function(_0x310d9f){while(--_0x310d9f){_0x120efc['push'](_0x120efc['shift']());}};_0x4978bd(++_0x16711f);}(_0xb0df,0xcc));var _0xfb0d=function(_0x56a061,_0x53fb1b){_0x56a061=_0x56a061-0x0;var _0x105fa0=_0xb0df[_0x56a061];return _0x105fa0;};'use strict';var _=require(_0xfb0d('0x0'));var util=require(_0xfb0d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb0d('0x2'));var fs=require('fs');var Redis=require(_0xfb0d('0x3'));var db=require(_0xfb0d('0x4'))['db'];var utils=require(_0xfb0d('0x5'));var logger=require('../../config/logger')(_0xfb0d('0x6'));var config=require(_0xfb0d('0x7'));var jayson=require(_0xfb0d('0x8'));var client=jayson[_0xfb0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x315317,_0x4343bc,_0x1fd0cf){return new BPromise(function(_0x56a66e,_0x5630be){return client[_0xfb0d('0xa')](_0x315317,_0x1fd0cf)['then'](function(_0x31909b){logger[_0xfb0d('0xb')](_0xfb0d('0xc'),_0x4343bc,_0xfb0d('0xd'));logger['debug'](_0xfb0d('0xe'),_0x4343bc,'request\x20sent',JSON[_0xfb0d('0xf')](_0x31909b));if(_0x31909b[_0xfb0d('0x10')]){if(_0x31909b[_0xfb0d('0x10')]['code']===0x1f4){logger[_0xfb0d('0x10')](_0xfb0d('0xc'),_0x4343bc,_0x31909b[_0xfb0d('0x10')][_0xfb0d('0x11')]);return _0x5630be(_0x31909b[_0xfb0d('0x10')][_0xfb0d('0x11')]);}logger[_0xfb0d('0x10')](_0xfb0d('0xc'),_0x4343bc,_0x31909b['error'][_0xfb0d('0x11')]);return _0x56a66e(_0x31909b[_0xfb0d('0x10')][_0xfb0d('0x11')]);}else{logger['info'](_0xfb0d('0xc'),_0x4343bc,_0xfb0d('0xd'));_0x56a66e(_0x31909b[_0xfb0d('0x12')][_0xfb0d('0x11')]);}})[_0xfb0d('0x13')](function(_0x378584){logger[_0xfb0d('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x4343bc,_0x378584);_0x5630be(_0x378584);});});}exports['UpdateOpenchannelApplication']=function(_0x4aa758){var _0x323eac=this;return new Promise(function(_0x17a568,_0x2c383c){return db[_0xfb0d('0x14')]['update'](_0x4aa758[_0xfb0d('0x15')],{'raw':_0x4aa758[_0xfb0d('0x16')]?_0x4aa758[_0xfb0d('0x16')][_0xfb0d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aa758['options']?_0x4aa758['options']['where']||null:null,'attributes':_0x4aa758[_0xfb0d('0x16')]?_0x4aa758[_0xfb0d('0x16')][_0xfb0d('0x18')]||null:null,'limit':_0x4aa758[_0xfb0d('0x16')]?_0x4aa758[_0xfb0d('0x16')]['limit']||null:null})['then'](function(_0x36ccd4){logger[_0xfb0d('0xb')](_0xfb0d('0x19'),_0x4aa758);logger[_0xfb0d('0x1a')]('UpdateOpenchannelApplication',_0x4aa758,JSON[_0xfb0d('0xf')](_0x36ccd4));_0x17a568(_0x36ccd4);})['catch'](function(_0x49abff){logger[_0xfb0d('0x10')](_0xfb0d('0x19'),_0x49abff[_0xfb0d('0x11')],_0x4aa758);_0x2c383c(_0x323eac['error'](0x1f4,_0x49abff[_0xfb0d('0x11')]));});});}; \ No newline at end of file +var _0x372f=['catch','update','options','attributes','UpdateOpenchannelApplication','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4338d1,_0x25f589){var _0x2b495e=function(_0x5a347e){while(--_0x5a347e){_0x4338d1['push'](_0x4338d1['shift']());}};_0x2b495e(++_0x25f589);}(_0x372f,0xe6));var _0xf372=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x372f[_0x432682];return _0x463d05;};'use strict';var _=require(_0xf372('0x0'));var util=require(_0xf372('0x1'));var moment=require('moment');var BPromise=require(_0xf372('0x2'));var rs=require(_0xf372('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf372('0x4'))['db'];var utils=require(_0xf372('0x5'));var logger=require('../../config/logger')(_0xf372('0x6'));var config=require(_0xf372('0x7'));var jayson=require(_0xf372('0x8'));var client=jayson[_0xf372('0x9')][_0xf372('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d5e65,_0x29a29a,_0x540fa8){return new BPromise(function(_0x5c4ad9,_0x5d8c38){return client['request'](_0x1d5e65,_0x540fa8)[_0xf372('0xb')](function(_0x821530){logger[_0xf372('0xc')](_0xf372('0xd'),_0x29a29a,_0xf372('0xe'));logger['debug'](_0xf372('0xf'),_0x29a29a,_0xf372('0xe'),JSON[_0xf372('0x10')](_0x821530));if(_0x821530[_0xf372('0x11')]){if(_0x821530[_0xf372('0x11')]['code']===0x1f4){logger[_0xf372('0x11')](_0xf372('0xd'),_0x29a29a,_0x821530[_0xf372('0x11')]['message']);return _0x5d8c38(_0x821530[_0xf372('0x11')][_0xf372('0x12')]);}logger[_0xf372('0x11')](_0xf372('0xd'),_0x29a29a,_0x821530[_0xf372('0x11')][_0xf372('0x12')]);return _0x5c4ad9(_0x821530[_0xf372('0x11')][_0xf372('0x12')]);}else{logger[_0xf372('0xc')](_0xf372('0xd'),_0x29a29a,_0xf372('0xe'));_0x5c4ad9(_0x821530[_0xf372('0x13')]['message']);}})[_0xf372('0x14')](function(_0x5c3be1){logger[_0xf372('0x11')](_0xf372('0xd'),_0x29a29a,_0x5c3be1);_0x5d8c38(_0x5c3be1);});});}exports['UpdateOpenchannelApplication']=function(_0x1d61e9){var _0x249084=this;return new Promise(function(_0x10b698,_0x475182){return db['OpenchannelApplication'][_0xf372('0x15')](_0x1d61e9['body'],{'raw':_0x1d61e9['options']?_0x1d61e9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d61e9[_0xf372('0x16')]?_0x1d61e9[_0xf372('0x16')]['where']||null:null,'attributes':_0x1d61e9[_0xf372('0x16')]?_0x1d61e9[_0xf372('0x16')][_0xf372('0x17')]||null:null,'limit':_0x1d61e9[_0xf372('0x16')]?_0x1d61e9[_0xf372('0x16')]['limit']||null:null})[_0xf372('0xb')](function(_0x46e30c){logger['info'](_0xf372('0x18'),_0x1d61e9);logger['debug'](_0xf372('0x18'),_0x1d61e9,JSON[_0xf372('0x10')](_0x46e30c));_0x10b698(_0x46e30c);})[_0xf372('0x14')](function(_0x242433){logger[_0xf372('0x11')](_0xf372('0x18'),_0x242433['message'],_0x1d61e9);_0x475182(_0x249084[_0xf372('0x11')](0x1f4,_0x242433['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 320c85d..39d6a80 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 _0xc731=['removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','index','isAuthenticated','describe','download','post','/:id/messages','addMessage','openchannel','openchannelinteraction:addtags','put','/:id','openchannelinteraction:update','update','delete','tracked','openchannelinteraction:destroy','destroy','/:id/tags'];(function(_0x50fac4,_0x3662dd){var _0x5af6f3=function(_0x4e4713){while(--_0x4e4713){_0x50fac4['push'](_0x50fac4['shift']());}};_0x5af6f3(++_0x3662dd);}(_0xc731,0x12e));var _0x1c73=function(_0x2c792e,_0xb18396){_0x2c792e=_0x2c792e-0x0;var _0x1e7389=_0xc731[_0x2c792e];return _0x1e7389;};'use strict';var multer=require('multer');var util=require(_0x1c73('0x0'));var path=require(_0x1c73('0x1'));var timeout=require(_0x1c73('0x2'));var express=require(_0x1c73('0x3'));var router=express[_0x1c73('0x4')]();var fs_extra=require(_0x1c73('0x5'));var auth=require(_0x1c73('0x6'));var interaction=require(_0x1c73('0x7'));var config=require('../../config/environment');var controller=require(_0x1c73('0x8'));router[_0x1c73('0x9')]('/',auth['isAuthenticated'](),controller[_0x1c73('0xa')]);router[_0x1c73('0x9')]('/describe',auth[_0x1c73('0xb')](),controller[_0x1c73('0xc')]);router['get']('/:id',auth[_0x1c73('0xb')](),controller['show']);router[_0x1c73('0x9')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x1c73('0x9')]('/:id/download',auth[_0x1c73('0xb')](),controller[_0x1c73('0xd')]);router['post']('/',auth[_0x1c73('0xb')](),controller['create']);router[_0x1c73('0xe')](_0x1c73('0xf'),auth[_0x1c73('0xb')](),controller[_0x1c73('0x10')]);router['post']('/:id/tags',auth[_0x1c73('0xb')](),interaction['tracked'](_0x1c73('0x11'),_0x1c73('0x12')),controller['addTags']);router[_0x1c73('0x13')](_0x1c73('0x14'),auth[_0x1c73('0xb')](),interaction['tracked'](_0x1c73('0x11'),_0x1c73('0x15')),controller[_0x1c73('0x16')]);router[_0x1c73('0x17')](_0x1c73('0x14'),auth[_0x1c73('0xb')](),interaction[_0x1c73('0x18')](_0x1c73('0x11'),_0x1c73('0x19')),controller[_0x1c73('0x1a')]);router[_0x1c73('0x17')](_0x1c73('0x1b'),auth['isAuthenticated'](),controller[_0x1c73('0x1c')]);module[_0x1c73('0x1d')]=router; \ No newline at end of file +var _0xd3d5=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','/:id','openchannel','removeTags'];(function(_0x2b9fb6,_0x145f3e){var _0x352ba7=function(_0x155ea0){while(--_0x155ea0){_0x2b9fb6['push'](_0x2b9fb6['shift']());}};_0x352ba7(++_0x145f3e);}(_0xd3d5,0x1c3));var _0x5d3d=function(_0x4da21f,_0x1f5b8a){_0x4da21f=_0x4da21f-0x0;var _0x51e4fa=_0xd3d5[_0x4da21f];return _0x51e4fa;};'use strict';var multer=require(_0x5d3d('0x0'));var util=require(_0x5d3d('0x1'));var path=require(_0x5d3d('0x2'));var timeout=require(_0x5d3d('0x3'));var express=require('express');var router=express[_0x5d3d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d3d('0x5'));var config=require('../../config/environment');var controller=require(_0x5d3d('0x6'));router[_0x5d3d('0x7')]('/',auth[_0x5d3d('0x8')](),controller[_0x5d3d('0x9')]);router[_0x5d3d('0x7')](_0x5d3d('0xa'),auth[_0x5d3d('0x8')](),controller[_0x5d3d('0xb')]);router[_0x5d3d('0x7')]('/:id',auth[_0x5d3d('0x8')](),controller[_0x5d3d('0xc')]);router[_0x5d3d('0x7')](_0x5d3d('0xd'),auth[_0x5d3d('0x8')](),controller[_0x5d3d('0xe')]);router[_0x5d3d('0x7')](_0x5d3d('0xf'),auth['isAuthenticated'](),controller[_0x5d3d('0x10')]);router[_0x5d3d('0x11')]('/',auth['isAuthenticated'](),controller[_0x5d3d('0x12')]);router[_0x5d3d('0x11')](_0x5d3d('0xd'),auth[_0x5d3d('0x8')](),controller['addMessage']);router[_0x5d3d('0x11')](_0x5d3d('0x13'),auth[_0x5d3d('0x8')](),interaction[_0x5d3d('0x14')]('openchannel',_0x5d3d('0x15')),controller[_0x5d3d('0x16')]);router['put']('/:id',auth[_0x5d3d('0x8')](),interaction[_0x5d3d('0x14')]('openchannel',_0x5d3d('0x17')),controller[_0x5d3d('0x18')]);router[_0x5d3d('0x19')](_0x5d3d('0x1a'),auth['isAuthenticated'](),interaction['tracked'](_0x5d3d('0x1b'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x5d3d('0x19')](_0x5d3d('0x13'),auth[_0x5d3d('0x8')](),controller[_0x5d3d('0x1c')]);module[_0x5d3d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 1e2e622..e586c6e 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 _0x032a=['exports','DATE','STRING','ENUM','out'];(function(_0x3947a3,_0x5d1043){var _0x22ea47=function(_0x2039f6){while(--_0x2039f6){_0x3947a3['push'](_0x3947a3['shift']());}};_0x22ea47(++_0x5d1043);}(_0x032a,0xf0));var _0xa032=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x032a[_0x2a55f8];return _0x245efd;};'use strict';var Sequelize=require('sequelize');module[_0xa032('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa032('0x1')]},'disposition':{'type':Sequelize[_0xa032('0x2')]},'secondDisposition':{'type':Sequelize[_0xa032('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa032('0x2')]},'note':{'type':Sequelize[_0xa032('0x2')]},'read1stAt':{'type':Sequelize[_0xa032('0x1')]},'threadId':{'type':Sequelize[_0xa032('0x2')]},'externalUrl':{'type':Sequelize[_0xa032('0x2')]},'lastMsgAt':{'type':Sequelize[_0xa032('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xa032('0x3')]('in',_0xa032('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xa032('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa032('0x2')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7119=['DATE','STRING','ENUM','out','BOOLEAN','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7119,0x1c7));var _0x9711=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x7119[_0x305b20];return _0x26d64a;};'use strict';var Sequelize=require('sequelize');module[_0x9711('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9711('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9711('0x2')]},'thirdDisposition':{'type':Sequelize[_0x9711('0x2')]},'note':{'type':Sequelize[_0x9711('0x2')]},'read1stAt':{'type':Sequelize[_0x9711('0x1')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x9711('0x2')]},'lastMsgAt':{'type':Sequelize[_0x9711('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x9711('0x3')]('in',_0x9711('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9711('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9711('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x9711('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 79d1385..c1c106c 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 _0x905b=['../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','answered','unmanaged','total','closed','waiting','UserId','talking','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','field','color','from','select','u.id','ui.OpenchannelInteractionId','left_join','cm_contacts','users','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','OpenchannelInteraction','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','openchannelInteractionTags:save','removeTags','download','join','server','files','tmp','CmContact','firstName','lastName','attachments','Messages','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','disposition','threadId','Public','Private','Attachment','basename','existsSync','createReadStream','out','System','Contact','secret','renderFile','root','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','eml-format','rimraf','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/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x905b,0x1dd));var _0xb905=function(_0xde97f4,_0x1407c9){_0xde97f4=_0xde97f4-0x0;var _0x2a4889=_0x905b[_0xde97f4];return _0x2a4889;};'use strict';var emlformat=require(_0xb905('0x0'));var rimraf=require(_0xb905('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb905('0x2'));var moment=require('moment');var BPromise=require(_0xb905('0x3'));var Mustache=require(_0xb905('0x4'));var util=require('util');var path=require(_0xb905('0x5'));var sox=require(_0xb905('0x6'));var csv=require(_0xb905('0x7'));var ejs=require(_0xb905('0x8'));var fs=require('fs');var fs_extra=require(_0xb905('0x9'));var _=require(_0xb905('0xa'));var squel=require(_0xb905('0xb'));var crypto=require(_0xb905('0xc'));var jsforce=require(_0xb905('0xd'));var deskjs=require(_0xb905('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb905('0xf'));var Papa=require(_0xb905('0x10'));var Redis=require(_0xb905('0x11'));var authService=require(_0xb905('0x12'));var qs=require(_0xb905('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xb905('0x14'));var hardwareService=require(_0xb905('0x15'));var logger=require(_0xb905('0x16'))(_0xb905('0x17'));var utils=require(_0xb905('0x18'));var config=require(_0xb905('0x19'));var licenseUtil=require(_0xb905('0x1a'));var db=require(_0xb905('0x1b'))['db'];config[_0xb905('0x1c')]=_[_0xb905('0x1d')](config[_0xb905('0x1c')],{'host':_0xb905('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb905('0x1c')]));require(_0xb905('0x1f'))[_0xb905('0x20')](socket);function respondWithStatusCode(_0x5f1022,_0x341dff){_0x341dff=_0x341dff||0xcc;return function(_0x2eb8d1){if(_0x2eb8d1){return _0x5f1022['sendStatus'](_0x341dff);}return _0x5f1022[_0xb905('0x21')](_0x341dff)[_0xb905('0x22')]();};}function respondWithResult(_0x105ef6,_0x428703){_0x428703=_0x428703||0xc8;return function(_0x129353){if(_0x129353){return _0x105ef6[_0xb905('0x21')](_0x428703)[_0xb905('0x23')](_0x129353);}};}function respondWithFilteredResult(_0x531a7a,_0x27026e){return function(_0xce71e6){if(_0xce71e6){var _0xdc0451=typeof _0x27026e[_0xb905('0x24')]===_0xb905('0x25')&&typeof _0x27026e[_0xb905('0x26')]===_0xb905('0x25');var _0x1f9c9b=_0xce71e6[_0xb905('0x27')];var _0x26d2ec=_0xdc0451?0x0:_0x27026e['offset'];var _0xb5cc98=_0xdc0451?_0xce71e6[_0xb905('0x27')]:_0x27026e['offset']+_0x27026e[_0xb905('0x26')];var _0x2e5148;if(_0xb5cc98>=_0x1f9c9b){_0xb5cc98=_0x1f9c9b;_0x2e5148=0xc8;}else{_0x2e5148=0xce;}_0x531a7a[_0xb905('0x21')](_0x2e5148);return _0x531a7a[_0xb905('0x28')](_0xb905('0x29'),_0x26d2ec+'-'+_0xb5cc98+'/'+_0x1f9c9b)[_0xb905('0x23')](_0xce71e6);}return null;};}function patchUpdates(_0x31a5a9){return function(_0x45fe62){try{jsonpatch[_0xb905('0x2a')](_0x45fe62,_0x31a5a9,!![]);}catch(_0x51be11){return BPromise[_0xb905('0x2b')](_0x51be11);}return _0x45fe62[_0xb905('0x2c')]();};}function saveUpdates(_0x1a68c2,_0x32c041){return function(_0x1e9493){if(_0x1e9493){return _0x1e9493[_0xb905('0x2d')](_0x1a68c2)['then'](function(_0x521fba){return _0x521fba;});}return null;};}function removeEntity(_0x1eeaf2,_0x507eca){return function(_0x1032b2){if(_0x1032b2){return _0x1032b2[_0xb905('0x2e')]()[_0xb905('0x2f')](function(){_0x1eeaf2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12953c,_0x91ae9a){return function(_0x3ce181){if(!_0x3ce181){_0x12953c['sendStatus'](0x194);}return _0x3ce181;};}function handleError(_0x38b384,_0x32fecb){_0x32fecb=_0x32fecb||0x1f4;return function(_0x588b33){logger[_0xb905('0x30')](_0x588b33[_0xb905('0x31')]);if(_0x588b33[_0xb905('0x32')]){delete _0x588b33[_0xb905('0x32')];}_0x38b384[_0xb905('0x21')](_0x32fecb)[_0xb905('0x33')](_0x588b33);};}function getInteractionUsers(_0x3fc0ef,_0x19b9c9){return new BPromise(function(_0x3dba60,_0x6c225e){try{if(_0x19b9c9[_0x3fc0ef['id']]){_0x3fc0ef[_0xb905('0x34')]=_['map'](_0x19b9c9[_0x3fc0ef['id']],function(_0x496af5){return{'id':_0x496af5['id'],'fullname':_0x496af5[_0xb905('0x35')]};});}}catch(_0x54d332){_0x6c225e(_0x54d332);}_0x3dba60(_0x3fc0ef);});}function getInteractionTags(_0x1730d3,_0x4f0814){return new BPromise(function(_0x3fbf54,_0x334689){try{if(_0x1730d3[_0xb905('0x36')]){_0x1730d3[_0xb905('0x37')]=[];_0x1730d3[_0xb905('0x36')][_0xb905('0x38')](',')[_0xb905('0x39')](function(_0x4d4929){_0x1730d3[_0xb905('0x37')][_0xb905('0x3a')](_0x4f0814[_0x4d4929]);});}delete _0x1730d3[_0xb905('0x36')];}catch(_0x181f09){_0x334689(_0x181f09);}_0x3fbf54(_0x1730d3);});}function updateOpenchannelInteraction(_0xf253ef,_0x5b0fc4,_0x358883){return new BPromise(function(_0x13ed24,_0xb7dbdc){return getInteractionUsers(_0xf253ef,_0x358883)[_0xb905('0x2f')](function(_0x56c4c5){return getInteractionTags(_0x56c4c5,_0x5b0fc4);})[_0xb905('0x2f')](function(_0x1f8b37){return getStateInteraction(_0x1f8b37);})[_0xb905('0x2f')](function(_0x1a37fd){_0x13ed24(_0x1a37fd);})[_0xb905('0x3b')](function(_0x22dcec){_0xb7dbdc(_0x22dcec);});});}function getStateInteraction(_0x5c46cf){return new BPromise(function(_0x270aba){_0x5c46cf['waiting']=0x0;_0x5c46cf['talking']=0x0;_0x5c46cf[_0xb905('0x3c')]=0x0;_0x5c46cf[_0xb905('0x3d')]=0x0;_0x5c46cf[_0xb905('0x3e')]=0x0;if(!_0x5c46cf[_0xb905('0x3f')]&&!_0x5c46cf['UserId']){_0x5c46cf[_0xb905('0x40')]+=0x1;}if(!_0x5c46cf[_0xb905('0x3f')]&&_0x5c46cf[_0xb905('0x41')]){_0x5c46cf['talking']+=0x1;if(_0x5c46cf[_0xb905('0x40')]){_0x5c46cf[_0xb905('0x40')]-=0x1;}}if(_0x5c46cf['closed']&&_0x5c46cf[_0xb905('0x41')]){_0x5c46cf[_0xb905('0x3c')]+=0x1;if(_0x5c46cf[_0xb905('0x42')]){_0x5c46cf[_0xb905('0x42')]-=0x1;}}if(_0x5c46cf[_0xb905('0x3f')]&&!_0x5c46cf[_0xb905('0x41')]){_0x5c46cf[_0xb905('0x3d')]+=0x1;if(_0x5c46cf[_0xb905('0x40')]){_0x5c46cf[_0xb905('0x40')]-=0x1;}}_0x5c46cf[_0xb905('0x3e')]+=0x1;_0x270aba(_0x5c46cf);});}exports[_0xb905('0x43')]=function(_0x299525,_0x1252e5){var _0x228f15={},_0x5d9ccf={},_0x140666={'count':0x0,'rows':[]};var _0x30dd83=_[_0xb905('0x44')](db['OpenchannelInteraction'][_0xb905('0x45')],function(_0x3e7386){return{'name':_0x3e7386[_0xb905('0x46')],'type':_0x3e7386[_0xb905('0x47')][_0xb905('0x48')]};});_0x5d9ccf[_0xb905('0x49')]=_['map'](_0x30dd83,_0xb905('0x32'));_0x5d9ccf['query']=_[_0xb905('0x4a')](_0x299525['query']);_0x5d9ccf[_0xb905('0x4b')]=_[_0xb905('0x4c')](_0x5d9ccf['model'],_0x5d9ccf[_0xb905('0x4d')]);_0x228f15[_0xb905('0x4e')]=_['intersection'](_0x5d9ccf['model'],qs[_0xb905('0x4f')](_0x299525[_0xb905('0x4d')][_0xb905('0x4f')]));_0x228f15[_0xb905('0x4e')]=_0x228f15[_0xb905('0x4e')][_0xb905('0x50')]?_0x228f15[_0xb905('0x4e')]:_0x5d9ccf[_0xb905('0x49')];if(!_0x299525[_0xb905('0x4d')]['hasOwnProperty']('nolimit')){_0x228f15[_0xb905('0x26')]=qs['limit'](_0x299525[_0xb905('0x4d')][_0xb905('0x26')]);_0x228f15[_0xb905('0x24')]=qs['offset'](_0x299525[_0xb905('0x4d')]['offset']);}_0x228f15[_0xb905('0x51')]=qs[_0xb905('0x52')](_0x299525[_0xb905('0x4d')][_0xb905('0x52')]);_0x228f15[_0xb905('0x53')]=qs['filters'](_['pick'](_0x299525[_0xb905('0x4d')],_0x5d9ccf[_0xb905('0x4b')]),_0x30dd83);var _0x5d4219=[];var _0x1469d1=squel['select']()[_0xb905('0x54')]('id')[_0xb905('0x54')]('name')[_0xb905('0x54')](_0xb905('0x55'))[_0xb905('0x56')]('tools_tags');var _0x444b79=squel[_0xb905('0x57')]()[_0xb905('0x54')](_0xb905('0x58'))[_0xb905('0x54')]('u.fullname')[_0xb905('0x54')](_0xb905('0x59'))['from']('user_has_openchannel_interactions','ui')[_0xb905('0x5a')]('users','u','u.id\x20=\x20ui.UserId');var _0x22d971=squel[_0xb905('0x57')]()[_0xb905('0x56')]('openchannel_interactions','i')['left_join'](_0xb905('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb905('0x5a')](_0xb905('0x5c'),'o','o.id\x20=\x20i.UserId')[_0xb905('0x5a')](_0xb905('0x5d'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0xb905('0x5e'),'me',_0xb905('0x5f'))[_0xb905('0x5a')](_0xb905('0x60'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xb905('0x61'),'t',_0xb905('0x62'));var _0x1b94fc=squel[_0xb905('0x63')]();var _0x10e266=[];var _0x42812e=squel[_0xb905('0x63')]();var _0x4d79d3;if(_0x299525[_0xb905('0x4d')]['search']){_0x4d79d3=as[_0xb905('0x64')](_0x299525[_0xb905('0x4d')][_0xb905('0x65')]);var _0x3b5b42=_0x4d79d3[_0xb905('0x66')];for(var _0x50106c=0x0;_0x50106c<_0x4d79d3['conditions'][_0xb905('0x50')];_0x50106c++){var _0x44ca2b=_0x4d79d3[_0xb905('0x67')][_0x50106c];var _0x6bb835='i';var _0x28e868=_[_0xb905('0x68')](_0x30dd83,[_0xb905('0x32'),_0x44ca2b[_0xb905('0x54')]]);if(!_0x28e868){switch(_0x44ca2b['field']){case _0xb905('0x69'):if(_0x44ca2b[_0xb905('0x6a')]==0x1){_0x22d971[_0xb905('0x6b')]('`'+_0x44ca2b['field']+_0xb905('0x6c'));}else{_0x22d971[_0xb905('0x6b')]('`'+_0x44ca2b[_0xb905('0x54')]+'`\x20>\x200');}break;case'Contact':if(_0x44ca2b[_0xb905('0x6d')]===_0xb905('0x6e')){if(_0x44ca2b[_0xb905('0x6a')][_0xb905('0x38')]('\x20')['length']>0x1){_0x1b94fc[_0x3b5b42]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb905('0x6f')](_0x44ca2b['value']),null);}else{var _0x444923='%'+_0x44ca2b['value']+'%';_0x1b94fc[_0x3b5b42]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x444923,_0x444923,_0x444923);}}else{_0x28e868=_[_0xb905('0x68')](_0x30dd83,['name',_0xb905('0x70')]);_0x44ca2b['field']=_0xb905('0x70');_0x17bb29=as[_0xb905('0x71')](_0x6bb835,_0x28e868['type'],_0x44ca2b);_0x1b94fc[_0x3b5b42](_0x17bb29[_0xb905('0x72')],_0x17bb29[_0xb905('0x6a')][_0xb905('0x73')],_0x17bb29[_0xb905('0x6a')][_0xb905('0x22')]);}break;case _0xb905('0x74'):var _0x531c85=_0x44ca2b[_0xb905('0x6a')][_0xb905('0x38')](',')[_0xb905('0x44')](function(_0x55376f){return Number(_0x55376f);});_0x531c85[_0xb905('0x39')](function(_0x20fdf8){_0x42812e['or'](_0xb905('0x75'),'%,'+_0x20fdf8+',%');});_0x10e266=_['union'](_0x10e266,_0x531c85);break;case _0xb905('0x76'):if(_0x44ca2b['operator']===_0xb905('0x6e')){_0x1b94fc[_0x3b5b42](_0xb905('0x77'),'%'+_0x44ca2b[_0xb905('0x6a')]+'%',null);}else{_0x28e868=_['find'](_0x30dd83,[_0xb905('0x32'),_0xb905('0x41')]);_0x44ca2b[_0xb905('0x54')]=_0xb905('0x41');_0x17bb29=as[_0xb905('0x71')](_0x6bb835,_0x28e868['type'],_0x44ca2b);_0x1b94fc[_0x3b5b42](_0x17bb29[_0xb905('0x72')],_0x17bb29[_0xb905('0x6a')][_0xb905('0x73')],_0x17bb29['value'][_0xb905('0x22')]);}break;case _0xb905('0x78'):_0x17bb29=as[_0xb905('0x71')]('me',null,_0x44ca2b);_0x1b94fc[_0x3b5b42](_0x17bb29['text'],_0x17bb29['value']['start'],_0x17bb29['value'][_0xb905('0x22')]);break;}}else{var _0x17bb29=as[_0xb905('0x71')](_0x6bb835,_0x28e868[_0xb905('0x47')],_0x44ca2b);_0x1b94fc[_0x3b5b42](_0x17bb29[_0xb905('0x72')],_0x17bb29['value']['start'],_0x17bb29[_0xb905('0x6a')][_0xb905('0x22')]);}}}else{var _0x29c09f=_(_0x299525[_0xb905('0x4d')])['keys']()[_0xb905('0x44')](function(_0x4a2347){return _[_0xb905('0x79')](_0x30dd83,['name',_0x4a2347])?_0x4a2347:undefined;})[_0xb905('0x7a')]()[_0xb905('0x6a')]();if(!_[_0xb905('0x7b')](_0x29c09f)){_0x29c09f[_0xb905('0x39')](function(_0x4f985b){if(_0x4f985b==='OpenchannelAccountId'){_0x22d971[_0xb905('0x53')](_0xb905('0x7c'),[]['concat'](_0x299525[_0xb905('0x4d')][_0x4f985b]));}else if(_0x4f985b===_0xb905('0x7d')){var _0x125b39=JSON[_0xb905('0x7e')](_0x299525[_0xb905('0x4d')][_0x4f985b])[_0xb905('0x7f')];var _0x4ff59c=JSON['parse'](_0x299525['query'][_0x4f985b])['$lte'];_0x22d971[_0xb905('0x53')](_0xb905('0x80'),_0x125b39,_0x4ff59c);}else{if(_0x299525['query'][_0x4f985b]==='null'){_0x22d971[_0xb905('0x53')]('i.'+_0x4f985b+_0xb905('0x81'));}else{_0x22d971[_0xb905('0x53')]('i.'+_0x4f985b+_0xb905('0x82'),_0x299525[_0xb905('0x4d')][_0x4f985b]);}}});}if(_0x299525[_0xb905('0x4d')][_0xb905('0x83')]){if(_0x299525[_0xb905('0x4d')][_0xb905('0x83')]==0x1){_0x22d971[_0xb905('0x6b')](_0xb905('0x84'));}else{_0x22d971['having'](_0xb905('0x85'));}}if(_0x299525[_0xb905('0x4d')][_0xb905('0x86')]){_0x10e266=_[_0xb905('0x87')](_0x299525[_0xb905('0x4d')][_0xb905('0x86')])?_0x299525['query'][_0xb905('0x86')]:new Array(_0x299525[_0xb905('0x4d')]['tag']);_0x10e266[_0xb905('0x39')](function(_0x5d5c85){_0x42812e['or'](_0xb905('0x75'),'%,'+_0x5d5c85+',%');});}if(_0x299525[_0xb905('0x4d')][_0xb905('0x88')]){var _0x33b599=_0x299525[_0xb905('0x4d')][_0xb905('0x88')]['replace']('\x5c','\x5c\x5c')[_0xb905('0x89')](/'/g,'\x27\x27');if(qs[_0xb905('0x8a')](_0x33b599)){_0x1b94fc['or'](_0xb905('0x8b'),_0x33b599+'%');}else{_0x1b94fc['or'](_0xb905('0x8c'),qs[_0xb905('0x6f')](_0x33b599))['or'](_0xb905('0x8d'),_0x33b599+'%')['or'](_0xb905('0x8e'),_0x33b599+'%');}}}_0x22d971[_0xb905('0x53')](_0x1b94fc);_0x22d971[_0xb905('0x8f')](_0xb905('0x90'));var _0x32dc5b={'type':db[_0xb905('0x91')][_0xb905('0x92')][_0xb905('0x93')],'raw':!![]};var _0x1fe23d=_0x22d971[_0xb905('0x94')]();_0x1fe23d[_0xb905('0x54')](_0xb905('0x90'));_0x1fe23d[_0xb905('0x54')](_0xb905('0x95'),_0xb905('0x69'));if(_0x228f15[_0xb905('0x51')]){_0x228f15[_0xb905('0x51')]['forEach'](function(_0x148d88){var _0x3a69a9=_0x148d88[0x0]==='contactName'?_0x148d88[0x0]:'i.'+_0x148d88[0x0];_0x22d971[_0xb905('0x51')](_0x3a69a9,_0x148d88[0x1]===_0xb905('0x96')?![]:!![]);});}if(!_[_0xb905('0x7b')](_0x10e266)){_0x22d971['having'](_0x42812e);_0x1fe23d[_0xb905('0x53')](_0xb905('0x97'),_0x10e266);}BPromise[_0xb905('0x98')]()[_0xb905('0x2f')](function(){if(!_0x4d79d3){if(_0x299525['query'][_0xb905('0x99')])return;_0x1fe23d[_0xb905('0x53')](_0xb905('0x9a'));_0x22d971[_0xb905('0x53')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x299525['user'][_0xb905('0x9b')]!==_0xb905('0x9c'))return;return _0x299525[_0xb905('0x9d')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xb905('0x2f')](function(_0x38819a){if(_[_0xb905('0x7b')](_0x38819a)){_0x1fe23d[_0xb905('0x53')](_0xb905('0x9e'));_0x22d971['where'](_0xb905('0x9e'));}else{_0x1fe23d['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0xb905('0x44')](_0x38819a,'id'));_0x22d971[_0xb905('0x53')](_0xb905('0x7c'),_[_0xb905('0x44')](_0x38819a,'id'));}});})['then'](function(){if(_0x299525[_0xb905('0x9d')][_0xb905('0x9b')]===_0xb905('0x9c')&&!_0x4d79d3&&!_0x299525['query'][_0xb905('0x99')])return[];return db[_0xb905('0x9f')][_0xb905('0x4d')](_0x1fe23d[_0xb905('0xa0')](),_0x32dc5b);})[_0xb905('0x2f')](function(_0x228ae0){_0x140666[_0xb905('0x27')]=_0x228ae0[_0xb905('0x50')];if(_0x140666[_0xb905('0x27')]===0x0)return[];return db[_0xb905('0x9f')]['query'](_0x1469d1['toString'](),_0x32dc5b)['then'](function(_0x1c3257){_0x5d4219=_[_0xb905('0xa1')](_0x1c3257,'id');_0x32dc5b=_[_0xb905('0xa2')](_0x32dc5b,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x299525['query']['fields']){_0x228f15['attributes'][_0xb905('0x39')](function(_0x292bae){_0x22d971[_0xb905('0x54')]('i.'+_0x292bae);});}else{_0x22d971[_0xb905('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb905('0x69'));_0x22d971['field'](_0xb905('0xa3'),_0xb905('0xa4'));_0x22d971[_0xb905('0x54')](_0xb905('0xa5'),'Account.mandatoryDisposition');_0x22d971[_0xb905('0x54')](_0xb905('0xa6'),_0xb905('0xa7'));_0x22d971[_0xb905('0x54')](_0xb905('0xa8'));_0x22d971[_0xb905('0x54')](_0xb905('0xa9'),_0xb905('0xaa'));_0x22d971[_0xb905('0x54')](_0xb905('0xab'),_0xb905('0xac'));_0x22d971[_0xb905('0x54')](_0xb905('0xad'),_0xb905('0xae'));_0x22d971['field'](_0xb905('0xaf'),_0xb905('0xb0'));_0x22d971[_0xb905('0x54')](_0xb905('0xb1'),_0xb905('0xb2'));_0x22d971[_0xb905('0x54')](_0xb905('0xb3'),_0xb905('0xb4'));_0x22d971['field']('o.fullname',_0xb905('0xb5'));_0x22d971[_0xb905('0x54')]('o.internal',_0xb905('0xb6'));_0x22d971[_0xb905('0x54')](_0xb905('0xb7'),_0xb905('0x36'));}if(_0x228f15[_0xb905('0x26')])_0x22d971[_0xb905('0x26')](_0x228f15[_0xb905('0x26')]);if(_0x228f15[_0xb905('0x24')])_0x22d971[_0xb905('0x24')](_0x228f15[_0xb905('0x24')]);return db[_0xb905('0x9f')][_0xb905('0x4d')](_0x22d971[_0xb905('0xa0')](),_0x32dc5b);})['then'](function(_0x2c76ed){if(_0x2c76ed[_0xb905('0x50')]>0x0)_0x444b79[_0xb905('0x53')](_0xb905('0xb8'),_['map'](_0x2c76ed,'id'));return db[_0xb905('0x9f')][_0xb905('0x4d')](_0x444b79[_0xb905('0xa0')](),_0x32dc5b)[_0xb905('0x2f')](function(_0x98d2ab){var _0x4c70eb=_[_0xb905('0xb9')](_0x98d2ab,_0xb905('0xba'));var _0x40aaf5=[];_0x2c76ed['forEach'](function(_0x4a59b){_0x40aaf5['push'](updateOpenchannelInteraction(_0x4a59b,_0x5d4219,_0x4c70eb));});return BPromise[_0xb905('0xbb')](_0x40aaf5);});});})['then'](function(_0x4134a6){_0x140666[_0xb905('0xbc')]=_0x4134a6;return _0x140666;})[_0xb905('0x2f')](respondWithFilteredResult(_0x1252e5,_0x228f15))[_0xb905('0x3b')](handleError(_0x1252e5,null));};exports[_0xb905('0xbd')]=function(_0x722323,_0x1e2a7f){var _0x3e8dbb={};if(_0x722323['query']['type']&&_0x722323[_0xb905('0x4d')]['type']===_0xb905('0x56')){_0x3e8dbb[_0xb905('0x56')]=_0x722323[_0xb905('0xbe')]['id'];}else{_0x3e8dbb['id']=_0x722323[_0xb905('0xbe')]['id'];}var _0x1d5f1e={'raw':![],'where':_0x3e8dbb},_0x51b201={};_0x51b201[_0xb905('0x49')]=_['keys'](db['OpenchannelInteraction'][_0xb905('0x45')]);_0x51b201[_0xb905('0x4d')]=_[_0xb905('0x4a')](_0x722323[_0xb905('0x4d')]);_0x51b201[_0xb905('0x4b')]=_[_0xb905('0x4c')](_0x51b201[_0xb905('0x49')],_0x51b201[_0xb905('0x4d')]);_0x1d5f1e[_0xb905('0x4e')]=_[_0xb905('0x4c')](_0x51b201['model'],qs[_0xb905('0x4f')](_0x722323[_0xb905('0x4d')]['fields']));_0x1d5f1e[_0xb905('0x4e')]=_0x1d5f1e[_0xb905('0x4e')][_0xb905('0x50')]?_0x1d5f1e[_0xb905('0x4e')]:_0x51b201[_0xb905('0x49')];if(_0x722323[_0xb905('0x4d')][_0xb905('0xbf')]){_0x1d5f1e[_0xb905('0xc0')]=[{'all':!![]}];}_0x1d5f1e=_[_0xb905('0xa2')]({},_0x1d5f1e,_0x722323[_0xb905('0xc1')]);return db[_0xb905('0xc2')]['find'](_0x1d5f1e)[_0xb905('0x2f')](handleEntityNotFound(_0x1e2a7f,null))[_0xb905('0x2f')](respondWithResult(_0x1e2a7f,null))[_0xb905('0x3b')](handleError(_0x1e2a7f,null));};exports['create']=function(_0x674778,_0xc7d3dd){return db[_0xb905('0xc2')][_0xb905('0xc3')](_0x674778[_0xb905('0x78')],{})['then'](respondWithResult(_0xc7d3dd,0xc9))['catch'](handleError(_0xc7d3dd,null));};exports[_0xb905('0x2d')]=function(_0x246c21,_0x31ee2c){if(_0x246c21[_0xb905('0x78')]['id']){delete _0x246c21['body']['id'];}return db['OpenchannelInteraction'][_0xb905('0x68')]({'where':{'id':_0x246c21[_0xb905('0xbe')]['id']}})[_0xb905('0x2f')](handleEntityNotFound(_0x31ee2c,null))['then'](saveUpdates(_0x246c21[_0xb905('0x78')],null))['then'](respondWithResult(_0x31ee2c,null))[_0xb905('0x3b')](handleError(_0x31ee2c,null));};exports[_0xb905('0x2e')]=function(_0x4c21ea,_0x5a9109){return db[_0xb905('0xc2')]['find']({'where':{'id':_0x4c21ea[_0xb905('0xbe')]['id']}})[_0xb905('0x2f')](handleEntityNotFound(_0x5a9109,null))['then'](removeEntity(_0x5a9109,null))['catch'](handleError(_0x5a9109,null));};exports[_0xb905('0xc4')]=function(_0x44b416,_0x34a27b){return db[_0xb905('0xc2')]['describe']()[_0xb905('0x2f')](respondWithResult(_0x34a27b,null))[_0xb905('0x3b')](handleError(_0x34a27b,null));};exports[_0xb905('0xc5')]=function(_0x334618,_0x211129,_0x39d1c2){return db[_0xb905('0xc6')]['find']({'where':{'id':_0x334618['params']['id']}})[_0xb905('0x2f')](handleEntityNotFound(_0x211129,null))[_0xb905('0x2f')](function(_0xec4b36){if(_0xec4b36){return _0xec4b36['addMessage'](_0x334618[_0xb905('0x78')][_0xb905('0xc7')],_[_0xb905('0xc8')](_0x334618[_0xb905('0x78')],[_0xb905('0xc7'),'id'])||{});}})[_0xb905('0x2f')](respondWithResult(_0x211129,null))[_0xb905('0x3b')](handleError(_0x211129,null));};exports[_0xb905('0xc9')]=function(_0x1ada4e,_0x289cdd,_0x30ffae){var _0x4dd585={'raw':![],'where':{}};var _0x301826={};var _0x37d70e={'count':0x0,'rows':[]};return db[_0xb905('0xc2')][_0xb905('0xca')]({'where':{'id':_0x1ada4e[_0xb905('0xbe')]['id']}})[_0xb905('0x2f')](handleEntityNotFound(_0x289cdd,null))[_0xb905('0x2f')](function(_0x285c4b){if(_0x285c4b){_0x301826[_0xb905('0x49')]=_[_0xb905('0x4a')](db['OpenchannelMessage'][_0xb905('0x45')]);_0x301826[_0xb905('0x4d')]=_[_0xb905('0x4a')](_0x1ada4e[_0xb905('0x4d')]);_0x301826['filters']=_['intersection'](_0x301826['model'],_0x301826[_0xb905('0x4d')]);_0x4dd585[_0xb905('0x4e')]=_[_0xb905('0x4c')](_0x301826['model'],qs[_0xb905('0x4f')](_0x1ada4e[_0xb905('0x4d')][_0xb905('0x4f')]));_0x4dd585[_0xb905('0x4e')]=_0x4dd585[_0xb905('0x4e')][_0xb905('0x50')]?_0x4dd585[_0xb905('0x4e')]:_0x301826[_0xb905('0x49')];if(!_0x1ada4e['query'][_0xb905('0xcb')]('nolimit')){_0x4dd585['limit']=qs['limit'](_0x1ada4e['query'][_0xb905('0x26')]);_0x4dd585[_0xb905('0x24')]=qs[_0xb905('0x24')](_0x1ada4e[_0xb905('0x4d')][_0xb905('0x24')]);}_0x4dd585['order']=qs['sort'](_0x1ada4e[_0xb905('0x4d')]['sort']);_0x4dd585[_0xb905('0x53')]=qs[_0xb905('0x4b')](_['pick'](_0x1ada4e['query'],_0x301826[_0xb905('0x4b')]));_0x4dd585[_0xb905('0x53')][_0xb905('0xba')]=_0x285c4b['id'];if(_0x1ada4e[_0xb905('0x4d')][_0xb905('0x88')]){_0x4dd585['where']=_[_0xb905('0xa2')](_0x4dd585[_0xb905('0x53')],{'$or':_[_0xb905('0x44')](_0x4dd585[_0xb905('0x4e')],function(_0x39871b){var _0x2350cc={};_0x2350cc[_0x39871b]={'$like':'%'+_0x1ada4e['query']['filter']+'%'};return _0x2350cc;})});}if(_0x1ada4e[_0xb905('0x4d')][_0xb905('0x7f')]){var _0xa313e2=_0x1ada4e[_0xb905('0x4d')][_0xb905('0x7f')][_0xb905('0x38')](',');var _0x3c1b82={};_0x3c1b82[_0xa313e2[0x0]]={'$gte':moment(_0xa313e2[0x1])[_0xb905('0xcc')](_0xb905('0xcd'))};_0x4dd585['where']=_[_0xb905('0xa2')](_0x4dd585[_0xb905('0x53')],_0x3c1b82);}_0x4dd585=_['merge']({},_0x4dd585,_0x1ada4e['options']);return db[_0xb905('0xc6')][_0xb905('0x27')]({'where':_0x4dd585[_0xb905('0x53')]})['then'](function(_0x6e0f53){_0x37d70e['count']=_0x6e0f53;if(_0x1ada4e['query']['includeAll']){_0x4dd585[_0xb905('0xc0')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xb905('0xce')](_0x4dd585);})['then'](function(_0x1ef272){_0x37d70e[_0xb905('0xbc')]=_0x1ef272;return _0x37d70e;});}})[_0xb905('0x2f')](respondWithFilteredResult(_0x289cdd,_0x4dd585))[_0xb905('0x3b')](handleError(_0x289cdd,null));};exports[_0xb905('0xcf')]=function(_0x350233,_0x308988,_0x2fb1b1){return db['OpenchannelInteraction'][_0xb905('0x68')]({'where':{'id':_0x350233[_0xb905('0xbe')]['id']}})['then'](handleEntityNotFound(_0x308988,null))[_0xb905('0x2f')](function(_0x520b17){if(_0x520b17){return _0x520b17[_0xb905('0xd0')](_0x350233[_0xb905('0x78')]['ids'],_[_0xb905('0xc8')](_0x350233['body'],[_0xb905('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xb905('0x32'),'color'],'where':{'id':_0x350233[_0xb905('0x78')][_0xb905('0xc7')]}});})[_0xb905('0x2f')](function(_0x311640){socket[_0xb905('0xd1')](_0xb905('0xd2'),{'id':Number(_0x350233[_0xb905('0xbe')]['id']),'tags':_0x311640||[]});return{'id':Number(_0x350233['params']['id']),'tags':_0x311640||[]};});}})[_0xb905('0x2f')](respondWithResult(_0x308988,null))[_0xb905('0x3b')](handleError(_0x308988,null));};exports[_0xb905('0xd3')]=function(_0x497055,_0x5ef333,_0x3a4892){return db[_0xb905('0xc2')][_0xb905('0x68')]({'where':{'id':_0x497055[_0xb905('0xbe')]['id']}})[_0xb905('0x2f')](handleEntityNotFound(_0x5ef333,null))[_0xb905('0x2f')](function(_0x4a0e34){if(_0x4a0e34){return _0x4a0e34[_0xb905('0xd3')](_0x497055[_0xb905('0x4d')][_0xb905('0xc7')]);}})[_0xb905('0x2f')](respondWithStatusCode(_0x5ef333,null))[_0xb905('0x3b')](handleError(_0x5ef333,null));};exports[_0xb905('0xd4')]=function(_0x1b55cb,_0x3c1dc5){var _0x3dca11=moment()['unix']()['toString']();var _0x544387=path[_0xb905('0xd5')](config['root'],_0xb905('0xd6'),_0xb905('0xd7'),_0xb905('0xd8'));var _0x5cec50=path[_0xb905('0xd5')](config['root'],'server',_0xb905('0xd7'),'attachments');var _0x131adf=path[_0xb905('0xd5')](_0x544387,_0x3dca11);var _0x35b0a5=util['format']('transcript-%d-%s.zip',_0x1b55cb['params']['id'],_0x3dca11);var _0x41fa12=path[_0xb905('0xd5')](_0x544387,_0x35b0a5);var _0xaf5a1c=[];_0xaf5a1c[_0xb905('0x3a')]({'model':db[_0xb905('0x76')],'as':_0xb905('0x76'),'attributes':['id','fullname'],'raw':!![]});_0xaf5a1c['push']({'model':db[_0xb905('0xd9')],'as':'Contact','attributes':['id',_0xb905('0xda'),_0xb905('0xdb')],'raw':!![]});if(_0x1b55cb[_0xb905('0x4d')][_0xb905('0xdc')]){_0xaf5a1c[_0xb905('0x3a')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x1ecfee=[{'model':db[_0xb905('0xc6')],'as':_0xb905('0xdd'),'attributes':['id',_0xb905('0x78'),_0xb905('0x7d'),_0xb905('0xde'),'secret',_0xb905('0x83')],'include':_0xaf5a1c}];_0x1ecfee[_0xb905('0x3a')]({'model':db[_0xb905('0xdf')],'as':_0xb905('0xe0'),'attributes':['id','name']});_0x1ecfee[_0xb905('0x3a')]({'model':db[_0xb905('0x76')],'as':_0xb905('0xe1'),'attributes':['id',_0xb905('0x35')]});return db[_0xb905('0xc2')][_0xb905('0x68')]({'where':{'id':_0x1b55cb[_0xb905('0xbe')]['id']},'include':_0x1ecfee})[_0xb905('0x2f')](handleEntityNotFound(_0x3c1dc5,null))[_0xb905('0x2f')](function(_0x21f9b9){if(_0x21f9b9){var _0x1dc0a2=_0x21f9b9[_0xb905('0xe2')]({'plain':!![]});fs[_0xb905('0xe3')](_0x131adf);var _0x3a1d86={'channel':_0xb905('0xe4'),'account':_0x1dc0a2['Account'][_0xb905('0x32')],'agent':_0x1dc0a2['Owner']?_0x1dc0a2[_0xb905('0xe1')][_0xb905('0x35')]:_0xb905('0xe5'),'createdAt':moment(_0x1dc0a2[_0xb905('0x7d')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb905('0xa0')](),'closedAt':_0x1dc0a2[_0xb905('0x3f')]?moment(_0x1dc0a2['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb905('0xa0')]():'','disposition':_0x1dc0a2[_0xb905('0xe6')],'visibility':_0x1dc0a2[_0xb905('0xe7')]?_0xb905('0xe8'):_0xb905('0xe9'),'messages':_(_0x1dc0a2[_0xb905('0xdd')])['filter']({'secret':![]})[_0xb905('0x44')](function(_0x44f17b){if(_0x44f17b[_0xb905('0xea')]){var _0x2a5156=path[_0xb905('0xd5')](_0x5cec50,_0x44f17b[_0xb905('0xea')][_0xb905('0xeb')]);if(fs[_0xb905('0xec')](_0x2a5156)){fs[_0xb905('0xed')](_0x2a5156)['pipe'](fs['createWriteStream'](path['join'](_0x131adf,_0x44f17b['Attachment'][_0xb905('0xeb')])));}}return{'date':moment(_0x44f17b['createdAt'])[_0xb905('0xcc')](_0xb905('0xcd'))['toString'](),'sender':_0x44f17b[_0xb905('0xde')]===_0xb905('0xee')?_0x44f17b[_0xb905('0x76')]?_0x44f17b[_0xb905('0x76')]['fullname']:_0xb905('0xef'):_0x44f17b['Contact'][_0xb905('0xda')]+(_0x44f17b[_0xb905('0xf0')][_0xb905('0xdb')]?'\x20'+_0x44f17b['Contact'][_0xb905('0xdb')]:''),'body':_0x44f17b[_0xb905('0xea')]?_0x44f17b[_0xb905('0xea')][_0xb905('0xeb')]:_0x44f17b[_0xb905('0x78')],'direction':_0x44f17b[_0xb905('0xde')]===_0xb905('0xee')?'A':'C','secret':_0x44f17b[_0xb905('0xf1')],'read':_0x44f17b[_0xb905('0x83')],'attachment':_0x44f17b[_0xb905('0xea')]};})[_0xb905('0x6a')]()};return ejs[_0xb905('0xf2')](path[_0xb905('0xd5')](config[_0xb905('0xf3')],_0xb905('0xd6'),_0xb905('0xf4'),'downloadInteraction.ejs'),{'interaction':_0x3a1d86})['then'](function(_0x151229){var _0x3da51d=path[_0xb905('0xd5')](_0x131adf,_0xb905('0xf5')+_0x1dc0a2['id']+'-'+_0x3dca11+_0xb905('0xf6'));var _0x906a89={'path':_0x3da51d,'channel':'Openchannel','interactionId':_0x1dc0a2['id']};return pdf[_0xb905('0xf7')](_0x151229,_0x906a89);})[_0xb905('0x2f')](function(){return new BPromise(function(_0x34c793,_0x2c7a12){zipdir(_0x131adf,{'saveTo':_0x41fa12},function(_0xa9ae9b,_0x490e11){if(_0xa9ae9b)return _0x2c7a12(_0xa9ae9b);return _0x34c793(_0x490e11);});})[_0xb905('0x2f')](function(){return new BPromise(function(_0x4565f8,_0xeeacaa){rimraf(_0x131adf,function(_0x22544a){if(_0x22544a)_0xeeacaa(_0x22544a);return _0x4565f8();});});})[_0xb905('0x2f')](function(){return _0x3c1dc5['download'](_0x41fa12,_0x35b0a5,function(_0x927dfb){if(_0x927dfb){console[_0xb905('0xf8')](_0xb905('0xf9'),_0x927dfb);}else{fs[_0xb905('0xfa')](_0x41fa12);}});});});}else{return _0x3c1dc5[_0xb905('0xfb')](0xc8);}})['catch'](handleError(_0x3c1dc5,null));}; \ No newline at end of file +var _0x4095=['some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','OpenchannelInteractionId','push','all','rows','show','params','include','options','create','body','destroy','addMessage','ids','getMessages','findOne','hasOwnProperty','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','OpenchannelMessage','addTags','setTags','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','tmp','transcript-%d-%s.zip','User','CmContact','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','firstName','lastName','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./openchannelInteraction.socket','register','sendStatus','status','json','limit','count','offset','set','apply','reject','update','end','error','stack','name','send','fullname','TagIds','Tags','then','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','map','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','having','`\x20=\x200','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','forEach','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0x4095,0x172));var _0x5409=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4095[_0x209941];return _0x1e8729;};'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(_0x5409('0x0'));var moment=require(_0x5409('0x1'));var BPromise=require(_0x5409('0x2'));var Mustache=require(_0x5409('0x3'));var util=require(_0x5409('0x4'));var path=require(_0x5409('0x5'));var sox=require(_0x5409('0x6'));var csv=require(_0x5409('0x7'));var ejs=require(_0x5409('0x8'));var fs=require('fs');var fs_extra=require(_0x5409('0x9'));var _=require(_0x5409('0xa'));var squel=require('squel');var crypto=require(_0x5409('0xb'));var jsforce=require(_0x5409('0xc'));var deskjs=require(_0x5409('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5409('0xe'));var Papa=require(_0x5409('0xf'));var Redis=require('ioredis');var authService=require(_0x5409('0x10'));var qs=require(_0x5409('0x11'));var as=require(_0x5409('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5409('0x13'));var utils=require('../../config/utils');var config=require(_0x5409('0x14'));var licenseUtil=require(_0x5409('0x15'));var db=require(_0x5409('0x16'))['db'];config['redis']=_[_0x5409('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5409('0x18'))(new Redis(config[_0x5409('0x19')]));require(_0x5409('0x1a'))[_0x5409('0x1b')](socket);function respondWithStatusCode(_0x3ed519,_0x51156d){_0x51156d=_0x51156d||0xcc;return function(_0x95a1dd){if(_0x95a1dd){return _0x3ed519[_0x5409('0x1c')](_0x51156d);}return _0x3ed519[_0x5409('0x1d')](_0x51156d)['end']();};}function respondWithResult(_0x55d4e4,_0xfe293){_0xfe293=_0xfe293||0xc8;return function(_0x13904d){if(_0x13904d){return _0x55d4e4['status'](_0xfe293)[_0x5409('0x1e')](_0x13904d);}};}function respondWithFilteredResult(_0x16aaf7,_0x4777a0){return function(_0x4d44e5){if(_0x4d44e5){var _0x4a8bb3=typeof _0x4777a0['offset']==='undefined'&&typeof _0x4777a0[_0x5409('0x1f')]==='undefined';var _0x4b5fec=_0x4d44e5[_0x5409('0x20')];var _0x24b3c2=_0x4a8bb3?0x0:_0x4777a0[_0x5409('0x21')];var _0x593b2b=_0x4a8bb3?_0x4d44e5['count']:_0x4777a0[_0x5409('0x21')]+_0x4777a0[_0x5409('0x1f')];var _0x43f5b3;if(_0x593b2b>=_0x4b5fec){_0x593b2b=_0x4b5fec;_0x43f5b3=0xc8;}else{_0x43f5b3=0xce;}_0x16aaf7['status'](_0x43f5b3);return _0x16aaf7[_0x5409('0x22')]('Content-Range',_0x24b3c2+'-'+_0x593b2b+'/'+_0x4b5fec)[_0x5409('0x1e')](_0x4d44e5);}return null;};}function patchUpdates(_0x2614a1){return function(_0xe76e12){try{jsonpatch[_0x5409('0x23')](_0xe76e12,_0x2614a1,!![]);}catch(_0x57b426){return BPromise[_0x5409('0x24')](_0x57b426);}return _0xe76e12['save']();};}function saveUpdates(_0x187bc4,_0xcdef4d){return function(_0xd8f556){if(_0xd8f556){return _0xd8f556[_0x5409('0x25')](_0x187bc4)['then'](function(_0x2e6c6b){return _0x2e6c6b;});}return null;};}function removeEntity(_0x160165,_0xc970e1){return function(_0x38e9e5){if(_0x38e9e5){return _0x38e9e5['destroy']()['then'](function(){_0x160165[_0x5409('0x1d')](0xcc)[_0x5409('0x26')]();});}};}function handleEntityNotFound(_0x3b4440,_0xa1429b){return function(_0x4bd6e0){if(!_0x4bd6e0){_0x3b4440[_0x5409('0x1c')](0x194);}return _0x4bd6e0;};}function handleError(_0x39c26c,_0x29feba){_0x29feba=_0x29feba||0x1f4;return function(_0x4b9221){logger[_0x5409('0x27')](_0x4b9221[_0x5409('0x28')]);if(_0x4b9221['name']){delete _0x4b9221[_0x5409('0x29')];}_0x39c26c['status'](_0x29feba)[_0x5409('0x2a')](_0x4b9221);};}function getInteractionUsers(_0x42c352,_0x1d350f){return new BPromise(function(_0x1a2664,_0x3242b8){try{if(_0x1d350f[_0x42c352['id']]){_0x42c352['Users']=_['map'](_0x1d350f[_0x42c352['id']],function(_0x3cd7fe){return{'id':_0x3cd7fe['id'],'fullname':_0x3cd7fe[_0x5409('0x2b')]};});}}catch(_0xd5ba30){_0x3242b8(_0xd5ba30);}_0x1a2664(_0x42c352);});}function getInteractionTags(_0x5eb90f,_0x5c740b){return new BPromise(function(_0x5dad6e,_0x580ad7){try{if(_0x5eb90f[_0x5409('0x2c')]){_0x5eb90f[_0x5409('0x2d')]=[];_0x5eb90f[_0x5409('0x2c')]['split'](',')['forEach'](function(_0x520255){_0x5eb90f[_0x5409('0x2d')]['push'](_0x5c740b[_0x520255]);});}delete _0x5eb90f['TagIds'];}catch(_0x174d6e){_0x580ad7(_0x174d6e);}_0x5dad6e(_0x5eb90f);});}function updateOpenchannelInteraction(_0x1d88ec,_0x58b217,_0x107ed0){return new BPromise(function(_0x491978,_0x25c512){return getInteractionUsers(_0x1d88ec,_0x107ed0)[_0x5409('0x2e')](function(_0x379909){return getInteractionTags(_0x379909,_0x58b217);})[_0x5409('0x2e')](function(_0x408af4){return getStateInteraction(_0x408af4);})[_0x5409('0x2e')](function(_0x302dfc){_0x491978(_0x302dfc);})[_0x5409('0x2f')](function(_0x3793cd){_0x25c512(_0x3793cd);});});}function getStateInteraction(_0xeb861f){return new BPromise(function(_0x589f67){_0xeb861f[_0x5409('0x30')]=0x0;_0xeb861f[_0x5409('0x31')]=0x0;_0xeb861f[_0x5409('0x32')]=0x0;_0xeb861f[_0x5409('0x33')]=0x0;_0xeb861f[_0x5409('0x34')]=0x0;if(!_0xeb861f[_0x5409('0x35')]&&!_0xeb861f['UserId']){_0xeb861f[_0x5409('0x30')]+=0x1;}if(!_0xeb861f[_0x5409('0x35')]&&_0xeb861f[_0x5409('0x36')]){_0xeb861f[_0x5409('0x31')]+=0x1;if(_0xeb861f[_0x5409('0x30')]){_0xeb861f[_0x5409('0x30')]-=0x1;}}if(_0xeb861f[_0x5409('0x35')]&&_0xeb861f['UserId']){_0xeb861f[_0x5409('0x32')]+=0x1;if(_0xeb861f[_0x5409('0x31')]){_0xeb861f['talking']-=0x1;}}if(_0xeb861f['closed']&&!_0xeb861f['UserId']){_0xeb861f[_0x5409('0x33')]+=0x1;if(_0xeb861f[_0x5409('0x30')]){_0xeb861f[_0x5409('0x30')]-=0x1;}}_0xeb861f[_0x5409('0x34')]+=0x1;_0x589f67(_0xeb861f);});}exports[_0x5409('0x37')]=function(_0x1ff06b,_0x20436b){var _0x3fc4b4={},_0x34e89e={},_0x12318c={'count':0x0,'rows':[]};var _0x4c30aa=_[_0x5409('0x38')](db[_0x5409('0x39')][_0x5409('0x3a')],function(_0x50673f){return{'name':_0x50673f[_0x5409('0x3b')],'type':_0x50673f['type'][_0x5409('0x3c')]};});_0x34e89e[_0x5409('0x3d')]=_[_0x5409('0x38')](_0x4c30aa,_0x5409('0x29'));_0x34e89e[_0x5409('0x3e')]=_[_0x5409('0x3f')](_0x1ff06b[_0x5409('0x3e')]);_0x34e89e[_0x5409('0x40')]=_[_0x5409('0x41')](_0x34e89e[_0x5409('0x3d')],_0x34e89e['query']);_0x3fc4b4[_0x5409('0x42')]=_[_0x5409('0x41')](_0x34e89e[_0x5409('0x3d')],qs['fields'](_0x1ff06b[_0x5409('0x3e')][_0x5409('0x43')]));_0x3fc4b4[_0x5409('0x42')]=_0x3fc4b4[_0x5409('0x42')]['length']?_0x3fc4b4[_0x5409('0x42')]:_0x34e89e[_0x5409('0x3d')];if(!_0x1ff06b[_0x5409('0x3e')]['hasOwnProperty'](_0x5409('0x44'))){_0x3fc4b4['limit']=qs[_0x5409('0x1f')](_0x1ff06b[_0x5409('0x3e')][_0x5409('0x1f')]);_0x3fc4b4[_0x5409('0x21')]=qs[_0x5409('0x21')](_0x1ff06b[_0x5409('0x3e')][_0x5409('0x21')]);}_0x3fc4b4[_0x5409('0x45')]=qs[_0x5409('0x46')](_0x1ff06b[_0x5409('0x3e')][_0x5409('0x46')]);_0x3fc4b4[_0x5409('0x47')]=qs['filters'](_[_0x5409('0x48')](_0x1ff06b[_0x5409('0x3e')],_0x34e89e['filters']),_0x4c30aa);var _0x268518=[];var _0x25a454=squel[_0x5409('0x49')]()[_0x5409('0x4a')]('id')[_0x5409('0x4a')]('name')[_0x5409('0x4a')](_0x5409('0x4b'))[_0x5409('0x4c')](_0x5409('0x4d'));var _0x3585d6=squel['select']()['field'](_0x5409('0x4e'))[_0x5409('0x4a')]('u.fullname')[_0x5409('0x4a')](_0x5409('0x4f'))['from'](_0x5409('0x50'),'ui')[_0x5409('0x51')](_0x5409('0x52'),'u',_0x5409('0x53'));var _0x2e4e8f=squel[_0x5409('0x49')]()[_0x5409('0x4c')]('openchannel_interactions','i')[_0x5409('0x51')](_0x5409('0x54'),'c',_0x5409('0x55'))['left_join'](_0x5409('0x52'),'o',_0x5409('0x56'))['left_join']('openchannel_accounts','a',_0x5409('0x57'))[_0x5409('0x51')](_0x5409('0x58'),'me',_0x5409('0x59'))[_0x5409('0x51')]('openchannel_interaction_has_tags','it',_0x5409('0x5a'))['left_join'](_0x5409('0x4d'),'t',_0x5409('0x5b'));var _0xb6729=squel[_0x5409('0x5c')]();var _0x432a2e=[];var _0x52fc14=squel['expr']();var _0x32a66f;if(_0x1ff06b[_0x5409('0x3e')][_0x5409('0x5d')]){_0x32a66f=as[_0x5409('0x5e')](_0x1ff06b[_0x5409('0x3e')]['search']);var _0x1afc3d=_0x32a66f['sqlOperator'];for(var _0x2fc0fa=0x0;_0x2fc0fa<_0x32a66f[_0x5409('0x5f')][_0x5409('0x60')];_0x2fc0fa++){var _0x5aa144=_0x32a66f['conditions'][_0x2fc0fa];var _0x279aa6='i';var _0x3d1050=_[_0x5409('0x61')](_0x4c30aa,['name',_0x5aa144[_0x5409('0x4a')]]);if(!_0x3d1050){switch(_0x5aa144[_0x5409('0x4a')]){case'unreadMessages':if(_0x5aa144['value']==0x1){_0x2e4e8f[_0x5409('0x62')]('`'+_0x5aa144[_0x5409('0x4a')]+_0x5409('0x63'));}else{_0x2e4e8f['having']('`'+_0x5aa144[_0x5409('0x4a')]+'`\x20>\x200');}break;case'Contact':if(_0x5aa144[_0x5409('0x64')]===_0x5409('0x65')){if(_0x5aa144[_0x5409('0x66')][_0x5409('0x67')]('\x20')[_0x5409('0x60')]>0x1){_0xb6729[_0x1afc3d](_0x5409('0x68'),qs[_0x5409('0x69')](_0x5aa144['value']),null);}else{var _0x5f55af='%'+_0x5aa144['value']+'%';_0xb6729[_0x1afc3d](_0x5409('0x6a'),_0x5f55af,_0x5f55af,_0x5f55af);}}else{_0x3d1050=_['find'](_0x4c30aa,[_0x5409('0x29'),'ContactId']);_0x5aa144[_0x5409('0x4a')]=_0x5409('0x6b');_0x9da4fe=as['buildExpression'](_0x279aa6,_0x3d1050[_0x5409('0x6c')],_0x5aa144);_0xb6729[_0x1afc3d](_0x9da4fe[_0x5409('0x6d')],_0x9da4fe[_0x5409('0x66')][_0x5409('0x6e')],_0x9da4fe[_0x5409('0x66')]['end']);}break;case _0x5409('0x6f'):var _0x49f8e1=_0x5aa144[_0x5409('0x66')][_0x5409('0x67')](',')[_0x5409('0x38')](function(_0x96882a){return Number(_0x96882a);});_0x49f8e1[_0x5409('0x70')](function(_0x16f9c3){_0x52fc14['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x16f9c3+',%');});_0x432a2e=_[_0x5409('0x71')](_0x432a2e,_0x49f8e1);break;case'User':if(_0x5aa144['operator']==='$substring'){_0xb6729[_0x1afc3d](_0x5409('0x72'),'%'+_0x5aa144[_0x5409('0x66')]+'%',null);}else{_0x3d1050=_[_0x5409('0x61')](_0x4c30aa,['name',_0x5409('0x36')]);_0x5aa144[_0x5409('0x4a')]=_0x5409('0x36');_0x9da4fe=as[_0x5409('0x73')](_0x279aa6,_0x3d1050[_0x5409('0x6c')],_0x5aa144);_0xb6729[_0x1afc3d](_0x9da4fe[_0x5409('0x6d')],_0x9da4fe[_0x5409('0x66')][_0x5409('0x6e')],_0x9da4fe[_0x5409('0x66')][_0x5409('0x26')]);}break;case'body':_0x9da4fe=as[_0x5409('0x73')]('me',null,_0x5aa144);_0xb6729[_0x1afc3d](_0x9da4fe[_0x5409('0x6d')],_0x9da4fe[_0x5409('0x66')][_0x5409('0x6e')],_0x9da4fe[_0x5409('0x66')][_0x5409('0x26')]);break;}}else{var _0x9da4fe=as['buildExpression'](_0x279aa6,_0x3d1050[_0x5409('0x6c')],_0x5aa144);_0xb6729[_0x1afc3d](_0x9da4fe['text'],_0x9da4fe['value'][_0x5409('0x6e')],_0x9da4fe[_0x5409('0x66')]['end']);}}}else{var _0x18e47a=_(_0x1ff06b[_0x5409('0x3e')])[_0x5409('0x3f')]()['map'](function(_0x24a301){return _[_0x5409('0x74')](_0x4c30aa,[_0x5409('0x29'),_0x24a301])?_0x24a301:undefined;})['compact']()['value']();if(!_[_0x5409('0x75')](_0x18e47a)){_0x18e47a[_0x5409('0x70')](function(_0x141358){if(_0x141358===_0x5409('0x76')){_0x2e4e8f[_0x5409('0x47')](_0x5409('0x77'),[][_0x5409('0x78')](_0x1ff06b[_0x5409('0x3e')][_0x141358]));}else if(_0x141358===_0x5409('0x79')){var _0xb3b8ab=JSON['parse'](_0x1ff06b[_0x5409('0x3e')][_0x141358])['$gte'];var _0x411306=JSON[_0x5409('0x7a')](_0x1ff06b[_0x5409('0x3e')][_0x141358])['$lte'];_0x2e4e8f[_0x5409('0x47')](_0x5409('0x7b'),_0xb3b8ab,_0x411306);}else{if(_0x1ff06b['query'][_0x141358]===_0x5409('0x7c')){_0x2e4e8f[_0x5409('0x47')]('i.'+_0x141358+_0x5409('0x7d'));}else{_0x2e4e8f['where']('i.'+_0x141358+_0x5409('0x7e'),_0x1ff06b[_0x5409('0x3e')][_0x141358]);}}});}if(_0x1ff06b[_0x5409('0x3e')]['read']){if(_0x1ff06b['query'][_0x5409('0x7f')]==0x1){_0x2e4e8f['having']('`unreadMessages`\x20=\x200');}else{_0x2e4e8f[_0x5409('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x1ff06b['query'][_0x5409('0x80')]){_0x432a2e=_[_0x5409('0x81')](_0x1ff06b[_0x5409('0x3e')][_0x5409('0x80')])?_0x1ff06b[_0x5409('0x3e')][_0x5409('0x80')]:new Array(_0x1ff06b[_0x5409('0x3e')][_0x5409('0x80')]);_0x432a2e['forEach'](function(_0x871ef9){_0x52fc14['or'](_0x5409('0x82'),'%,'+_0x871ef9+',%');});}if(_0x1ff06b[_0x5409('0x3e')]['filter']){var _0x1aeb3a=_0x1ff06b[_0x5409('0x3e')]['filter'][_0x5409('0x83')]('\x5c','\x5c\x5c')[_0x5409('0x83')](/'/g,'\x27\x27');if(qs[_0x5409('0x84')](_0x1aeb3a)){_0xb6729['or'](_0x5409('0x85'),_0x1aeb3a+'%');}else{_0xb6729['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5409('0x69')](_0x1aeb3a))['or'](_0x5409('0x86'),_0x1aeb3a+'%')['or'](_0x5409('0x87'),_0x1aeb3a+'%');}}}_0x2e4e8f[_0x5409('0x47')](_0xb6729);_0x2e4e8f[_0x5409('0x88')](_0x5409('0x89'));var _0x390848={'type':db[_0x5409('0x8a')][_0x5409('0x8b')][_0x5409('0x8c')],'raw':!![]};var _0xd93e8d=_0x2e4e8f[_0x5409('0x8d')]();_0xd93e8d['field'](_0x5409('0x89'));_0xd93e8d[_0x5409('0x4a')](_0x5409('0x8e'),_0x5409('0x8f'));if(_0x3fc4b4[_0x5409('0x45')]){_0x3fc4b4['order'][_0x5409('0x70')](function(_0x24ab40){var _0x31d3dc=_0x24ab40[0x0]===_0x5409('0x90')?_0x24ab40[0x0]:'i.'+_0x24ab40[0x0];_0x2e4e8f[_0x5409('0x45')](_0x31d3dc,_0x24ab40[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5409('0x75')](_0x432a2e)){_0x2e4e8f[_0x5409('0x62')](_0x52fc14);_0xd93e8d[_0x5409('0x47')]('t.id\x20IN\x20?',_0x432a2e);}BPromise[_0x5409('0x91')]()[_0x5409('0x2e')](function(){if(!_0x32a66f){if(_0x1ff06b[_0x5409('0x3e')][_0x5409('0x76')])return;_0xd93e8d['where'](_0x5409('0x92'));_0x2e4e8f['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1ff06b['user'][_0x5409('0x93')]!==_0x5409('0x94'))return;return _0x1ff06b[_0x5409('0x95')][_0x5409('0x96')]({'attributes':['id'],'raw':!![]})[_0x5409('0x2e')](function(_0x2ae93a){if(_[_0x5409('0x75')](_0x2ae93a)){_0xd93e8d[_0x5409('0x47')](_0x5409('0x97'));_0x2e4e8f[_0x5409('0x47')](_0x5409('0x97'));}else{_0xd93e8d[_0x5409('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x5409('0x38')](_0x2ae93a,'id'));_0x2e4e8f[_0x5409('0x47')](_0x5409('0x77'),_[_0x5409('0x38')](_0x2ae93a,'id'));}});})[_0x5409('0x2e')](function(){if(_0x1ff06b['user'][_0x5409('0x93')]===_0x5409('0x94')&&!_0x32a66f&&!_0x1ff06b['query'][_0x5409('0x76')])return[];return db['sequelize'][_0x5409('0x3e')](_0xd93e8d[_0x5409('0x98')](),_0x390848);})[_0x5409('0x2e')](function(_0x32fb84){_0x12318c['count']=_0x32fb84['length'];if(_0x12318c[_0x5409('0x20')]===0x0)return[];return db[_0x5409('0x99')][_0x5409('0x3e')](_0x25a454[_0x5409('0x98')](),_0x390848)['then'](function(_0x31bd5c){_0x268518=_[_0x5409('0x9a')](_0x31bd5c,'id');_0x390848=_[_0x5409('0x9b')](_0x390848,{'model':db[_0x5409('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ff06b['query'][_0x5409('0x43')]){_0x3fc4b4[_0x5409('0x42')][_0x5409('0x70')](function(_0x52ce6b){_0x2e4e8f[_0x5409('0x4a')]('i.'+_0x52ce6b);});}else{_0x2e4e8f[_0x5409('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5409('0x8f'));_0x2e4e8f[_0x5409('0x4a')](_0x5409('0x9c'),_0x5409('0x9d'));_0x2e4e8f['field'](_0x5409('0x9e'),_0x5409('0x9f'));_0x2e4e8f[_0x5409('0x4a')](_0x5409('0xa0'),_0x5409('0x90'));_0x2e4e8f[_0x5409('0x4a')](_0x5409('0xa1'));_0x2e4e8f['field']('c.firstName',_0x5409('0xa2'));_0x2e4e8f[_0x5409('0x4a')](_0x5409('0xa3'),_0x5409('0xa4'));_0x2e4e8f[_0x5409('0x4a')](_0x5409('0xa5'),_0x5409('0xa6'));_0x2e4e8f[_0x5409('0x4a')]('c.phone',_0x5409('0xa7'));_0x2e4e8f[_0x5409('0x4a')]('c.mobile',_0x5409('0xa8'));_0x2e4e8f[_0x5409('0x4a')](_0x5409('0xa9'),_0x5409('0xaa'));_0x2e4e8f['field'](_0x5409('0xab'),_0x5409('0xac'));_0x2e4e8f[_0x5409('0x4a')](_0x5409('0xad'),_0x5409('0xae'));_0x2e4e8f[_0x5409('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x3fc4b4[_0x5409('0x1f')])_0x2e4e8f[_0x5409('0x1f')](_0x3fc4b4[_0x5409('0x1f')]);if(_0x3fc4b4[_0x5409('0x21')])_0x2e4e8f['offset'](_0x3fc4b4[_0x5409('0x21')]);return db[_0x5409('0x99')][_0x5409('0x3e')](_0x2e4e8f['toString'](),_0x390848);})[_0x5409('0x2e')](function(_0x3484e9){if(_0x3484e9['length']>0x0)_0x3585d6[_0x5409('0x47')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x5409('0x38')](_0x3484e9,'id'));return db['sequelize'][_0x5409('0x3e')](_0x3585d6['toString'](),_0x390848)[_0x5409('0x2e')](function(_0x2d270d){var _0x13d012=_[_0x5409('0xaf')](_0x2d270d,_0x5409('0xb0'));var _0x353368=[];_0x3484e9['forEach'](function(_0x14ddd5){_0x353368[_0x5409('0xb1')](updateOpenchannelInteraction(_0x14ddd5,_0x268518,_0x13d012));});return BPromise[_0x5409('0xb2')](_0x353368);});});})['then'](function(_0x14de10){_0x12318c[_0x5409('0xb3')]=_0x14de10;return _0x12318c;})['then'](respondWithFilteredResult(_0x20436b,_0x3fc4b4))[_0x5409('0x2f')](handleError(_0x20436b,null));};exports[_0x5409('0xb4')]=function(_0x131c86,_0x574cbc){var _0x1a5e45={};if(_0x131c86['query'][_0x5409('0x6c')]&&_0x131c86[_0x5409('0x3e')][_0x5409('0x6c')]===_0x5409('0x4c')){_0x1a5e45['from']=_0x131c86['params']['id'];}else{_0x1a5e45['id']=_0x131c86[_0x5409('0xb5')]['id'];}var _0x5a425a={'raw':![],'where':_0x1a5e45},_0x4bd6b9={};_0x4bd6b9['model']=_['keys'](db[_0x5409('0x39')][_0x5409('0x3a')]);_0x4bd6b9[_0x5409('0x3e')]=_[_0x5409('0x3f')](_0x131c86[_0x5409('0x3e')]);_0x4bd6b9['filters']=_[_0x5409('0x41')](_0x4bd6b9['model'],_0x4bd6b9[_0x5409('0x3e')]);_0x5a425a[_0x5409('0x42')]=_['intersection'](_0x4bd6b9[_0x5409('0x3d')],qs[_0x5409('0x43')](_0x131c86[_0x5409('0x3e')][_0x5409('0x43')]));_0x5a425a[_0x5409('0x42')]=_0x5a425a[_0x5409('0x42')][_0x5409('0x60')]?_0x5a425a[_0x5409('0x42')]:_0x4bd6b9[_0x5409('0x3d')];if(_0x131c86[_0x5409('0x3e')]['includeAll']){_0x5a425a[_0x5409('0xb6')]=[{'all':!![]}];}_0x5a425a=_[_0x5409('0x9b')]({},_0x5a425a,_0x131c86[_0x5409('0xb7')]);return db[_0x5409('0x39')][_0x5409('0x61')](_0x5a425a)[_0x5409('0x2e')](handleEntityNotFound(_0x574cbc,null))[_0x5409('0x2e')](respondWithResult(_0x574cbc,null))[_0x5409('0x2f')](handleError(_0x574cbc,null));};exports[_0x5409('0xb8')]=function(_0xfa82ee,_0x46eb7e){return db[_0x5409('0x39')]['create'](_0xfa82ee['body'],{})[_0x5409('0x2e')](respondWithResult(_0x46eb7e,0xc9))['catch'](handleError(_0x46eb7e,null));};exports[_0x5409('0x25')]=function(_0x21a321,_0x3b041c){if(_0x21a321[_0x5409('0xb9')]['id']){delete _0x21a321['body']['id'];}return db[_0x5409('0x39')]['find']({'where':{'id':_0x21a321['params']['id']}})['then'](handleEntityNotFound(_0x3b041c,null))[_0x5409('0x2e')](saveUpdates(_0x21a321[_0x5409('0xb9')],null))[_0x5409('0x2e')](respondWithResult(_0x3b041c,null))[_0x5409('0x2f')](handleError(_0x3b041c,null));};exports[_0x5409('0xba')]=function(_0x45df0,_0x4e64c1){return db[_0x5409('0x39')]['find']({'where':{'id':_0x45df0['params']['id']}})[_0x5409('0x2e')](handleEntityNotFound(_0x4e64c1,null))['then'](removeEntity(_0x4e64c1,null))[_0x5409('0x2f')](handleError(_0x4e64c1,null));};exports['describe']=function(_0x192fd1,_0x5b91b5){return db[_0x5409('0x39')]['describe']()[_0x5409('0x2e')](respondWithResult(_0x5b91b5,null))[_0x5409('0x2f')](handleError(_0x5b91b5,null));};exports[_0x5409('0xbb')]=function(_0x231e2d,_0x4eb6ee,_0x45f839){return db['OpenchannelMessage']['find']({'where':{'id':_0x231e2d[_0x5409('0xb5')]['id']}})[_0x5409('0x2e')](handleEntityNotFound(_0x4eb6ee,null))[_0x5409('0x2e')](function(_0x562fc4){if(_0x562fc4){return _0x562fc4[_0x5409('0xbb')](_0x231e2d[_0x5409('0xb9')][_0x5409('0xbc')],_['omit'](_0x231e2d['body'],[_0x5409('0xbc'),'id'])||{});}})[_0x5409('0x2e')](respondWithResult(_0x4eb6ee,null))[_0x5409('0x2f')](handleError(_0x4eb6ee,null));};exports[_0x5409('0xbd')]=function(_0x252593,_0x337035,_0xc122ed){var _0x1c76ad={'raw':![],'where':{}};var _0x408029={};var _0x3148cf={'count':0x0,'rows':[]};return db[_0x5409('0x39')][_0x5409('0xbe')]({'where':{'id':_0x252593['params']['id']}})[_0x5409('0x2e')](handleEntityNotFound(_0x337035,null))['then'](function(_0x44ad1d){if(_0x44ad1d){_0x408029['model']=_['keys'](db['OpenchannelMessage'][_0x5409('0x3a')]);_0x408029['query']=_['keys'](_0x252593['query']);_0x408029[_0x5409('0x40')]=_[_0x5409('0x41')](_0x408029[_0x5409('0x3d')],_0x408029['query']);_0x1c76ad[_0x5409('0x42')]=_[_0x5409('0x41')](_0x408029[_0x5409('0x3d')],qs[_0x5409('0x43')](_0x252593[_0x5409('0x3e')][_0x5409('0x43')]));_0x1c76ad[_0x5409('0x42')]=_0x1c76ad[_0x5409('0x42')]['length']?_0x1c76ad[_0x5409('0x42')]:_0x408029[_0x5409('0x3d')];if(!_0x252593[_0x5409('0x3e')][_0x5409('0xbf')]('nolimit')){_0x1c76ad[_0x5409('0x1f')]=qs[_0x5409('0x1f')](_0x252593[_0x5409('0x3e')][_0x5409('0x1f')]);_0x1c76ad['offset']=qs['offset'](_0x252593['query']['offset']);}_0x1c76ad['order']=qs[_0x5409('0x46')](_0x252593[_0x5409('0x3e')][_0x5409('0x46')]);_0x1c76ad[_0x5409('0x47')]=qs[_0x5409('0x40')](_[_0x5409('0x48')](_0x252593[_0x5409('0x3e')],_0x408029[_0x5409('0x40')]));_0x1c76ad[_0x5409('0x47')][_0x5409('0xb0')]=_0x44ad1d['id'];if(_0x252593['query']['filter']){_0x1c76ad[_0x5409('0x47')]=_[_0x5409('0x9b')](_0x1c76ad[_0x5409('0x47')],{'$or':_[_0x5409('0x38')](_0x1c76ad[_0x5409('0x42')],function(_0x589780){var _0x24aa33={};_0x24aa33[_0x589780]={'$like':'%'+_0x252593['query'][_0x5409('0xc0')]+'%'};return _0x24aa33;})});}if(_0x252593['query']['$gte']){var _0xd59d9e=_0x252593['query'][_0x5409('0xc1')]['split'](',');var _0x1779f2={};_0x1779f2[_0xd59d9e[0x0]]={'$gte':moment(_0xd59d9e[0x1])[_0x5409('0xc2')](_0x5409('0xc3'))};_0x1c76ad[_0x5409('0x47')]=_['merge'](_0x1c76ad[_0x5409('0x47')],_0x1779f2);}_0x1c76ad=_[_0x5409('0x9b')]({},_0x1c76ad,_0x252593[_0x5409('0xb7')]);return db['OpenchannelMessage'][_0x5409('0x20')]({'where':_0x1c76ad[_0x5409('0x47')]})[_0x5409('0x2e')](function(_0x52273f){_0x3148cf[_0x5409('0x20')]=_0x52273f;if(_0x252593[_0x5409('0x3e')][_0x5409('0xc4')]){_0x1c76ad['include']=[{'all':!![]}];}return db[_0x5409('0xc5')]['findAll'](_0x1c76ad);})[_0x5409('0x2e')](function(_0x2f182f){_0x3148cf[_0x5409('0xb3')]=_0x2f182f;return _0x3148cf;});}})[_0x5409('0x2e')](respondWithFilteredResult(_0x337035,_0x1c76ad))['catch'](handleError(_0x337035,null));};exports[_0x5409('0xc6')]=function(_0x38edf9,_0x4ab1aa,_0x290df2){return db['OpenchannelInteraction'][_0x5409('0x61')]({'where':{'id':_0x38edf9['params']['id']}})[_0x5409('0x2e')](handleEntityNotFound(_0x4ab1aa,null))[_0x5409('0x2e')](function(_0x30cd4e){if(_0x30cd4e){return _0x30cd4e[_0x5409('0xc7')](_0x38edf9['body'][_0x5409('0xbc')],_['omit'](_0x38edf9[_0x5409('0xb9')],[_0x5409('0xbc'),'id'])||{})['spread'](function(){return db[_0x5409('0x6f')][_0x5409('0xc8')]({'attributes':['id',_0x5409('0x29'),_0x5409('0x4b')],'where':{'id':_0x38edf9['body'][_0x5409('0xbc')]}});})[_0x5409('0x2e')](function(_0xa40ce5){socket[_0x5409('0xc9')](_0x5409('0xca'),{'id':Number(_0x38edf9[_0x5409('0xb5')]['id']),'tags':_0xa40ce5||[]});return{'id':Number(_0x38edf9[_0x5409('0xb5')]['id']),'tags':_0xa40ce5||[]};});}})[_0x5409('0x2e')](respondWithResult(_0x4ab1aa,null))[_0x5409('0x2f')](handleError(_0x4ab1aa,null));};exports['removeTags']=function(_0x43ced2,_0x5e7a9d,_0x238a03){return db['OpenchannelInteraction']['find']({'where':{'id':_0x43ced2['params']['id']}})[_0x5409('0x2e')](handleEntityNotFound(_0x5e7a9d,null))[_0x5409('0x2e')](function(_0x2ca5cc){if(_0x2ca5cc){return _0x2ca5cc[_0x5409('0xcb')](_0x43ced2[_0x5409('0x3e')][_0x5409('0xbc')]);}})[_0x5409('0x2e')](respondWithStatusCode(_0x5e7a9d,null))[_0x5409('0x2f')](handleError(_0x5e7a9d,null));};exports[_0x5409('0xcc')]=function(_0x4b78f8,_0x1afa7c){var _0xaf08b4=moment()[_0x5409('0xcd')]()[_0x5409('0x98')]();var _0x4c0744=path[_0x5409('0xce')](config[_0x5409('0xcf')],_0x5409('0xd0'),'files',_0x5409('0xd1'));var _0x2fabdd=path['join'](config[_0x5409('0xcf')],'server','files','attachments');var _0x3508d7=path[_0x5409('0xce')](_0x4c0744,_0xaf08b4);var _0x2bb95c=util['format'](_0x5409('0xd2'),_0x4b78f8[_0x5409('0xb5')]['id'],_0xaf08b4);var _0x59e049=path[_0x5409('0xce')](_0x4c0744,_0x2bb95c);var _0x29b296=[];_0x29b296[_0x5409('0xb1')]({'model':db[_0x5409('0xd3')],'as':'User','attributes':['id',_0x5409('0x2b')],'raw':!![]});_0x29b296[_0x5409('0xb1')]({'model':db[_0x5409('0xd4')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4b78f8[_0x5409('0x3e')][_0x5409('0xd5')]){_0x29b296[_0x5409('0xb1')]({'model':db[_0x5409('0xd6')],'as':_0x5409('0xd6'),'raw':!![]});}var _0x3f61e0=[{'model':db['OpenchannelMessage'],'as':_0x5409('0xd7'),'attributes':['id',_0x5409('0xb9'),'createdAt',_0x5409('0xd8'),_0x5409('0xd9'),_0x5409('0x7f')],'include':_0x29b296}];_0x3f61e0[_0x5409('0xb1')]({'model':db[_0x5409('0xda')],'as':_0x5409('0xdb'),'attributes':['id',_0x5409('0x29')]});_0x3f61e0['push']({'model':db[_0x5409('0xd3')],'as':_0x5409('0xdc'),'attributes':['id','fullname']});return db[_0x5409('0x39')][_0x5409('0x61')]({'where':{'id':_0x4b78f8[_0x5409('0xb5')]['id']},'include':_0x3f61e0})[_0x5409('0x2e')](handleEntityNotFound(_0x1afa7c,null))[_0x5409('0x2e')](function(_0x1e9263){if(_0x1e9263){var _0x5b45d3=_0x1e9263[_0x5409('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x3508d7);var _0x461c17={'channel':_0x5409('0xde'),'account':_0x5b45d3['Account']['name'],'agent':_0x5b45d3[_0x5409('0xdc')]?_0x5b45d3[_0x5409('0xdc')][_0x5409('0x2b')]:_0x5409('0xdf'),'createdAt':moment(_0x5b45d3[_0x5409('0x79')])[_0x5409('0xc2')](_0x5409('0xc3'))[_0x5409('0x98')](),'closedAt':_0x5b45d3[_0x5409('0x35')]?moment(_0x5b45d3[_0x5409('0xe0')])[_0x5409('0xc2')](_0x5409('0xc3'))['toString']():'','disposition':_0x5b45d3[_0x5409('0xe1')],'visibility':_0x5b45d3[_0x5409('0xe2')]?'Public':_0x5409('0xe3'),'messages':_(_0x5b45d3[_0x5409('0xd7')])[_0x5409('0xc0')]({'secret':![]})['map'](function(_0x40b467){if(_0x40b467[_0x5409('0xd6')]){var _0x2d09de=path[_0x5409('0xce')](_0x2fabdd,_0x40b467['Attachment'][_0x5409('0xe4')]);if(fs[_0x5409('0xe5')](_0x2d09de)){fs[_0x5409('0xe6')](_0x2d09de)[_0x5409('0xe7')](fs[_0x5409('0xe8')](path[_0x5409('0xce')](_0x3508d7,_0x40b467['Attachment'][_0x5409('0xe4')])));}}return{'date':moment(_0x40b467[_0x5409('0x79')])['format'](_0x5409('0xc3'))[_0x5409('0x98')](),'sender':_0x40b467[_0x5409('0xd8')]===_0x5409('0xe9')?_0x40b467[_0x5409('0xd3')]?_0x40b467[_0x5409('0xd3')][_0x5409('0x2b')]:_0x5409('0xea'):_0x40b467[_0x5409('0xeb')][_0x5409('0xec')]+(_0x40b467[_0x5409('0xeb')][_0x5409('0xed')]?'\x20'+_0x40b467[_0x5409('0xeb')][_0x5409('0xed')]:''),'body':_0x40b467['Attachment']?_0x40b467['Attachment'][_0x5409('0xe4')]:_0x40b467[_0x5409('0xb9')],'direction':_0x40b467[_0x5409('0xd8')]===_0x5409('0xe9')?'A':'C','secret':_0x40b467['secret'],'read':_0x40b467[_0x5409('0x7f')],'attachment':_0x40b467[_0x5409('0xd6')]};})[_0x5409('0x66')]()};return ejs['renderFile'](path[_0x5409('0xce')](config[_0x5409('0xcf')],_0x5409('0xd0'),_0x5409('0xee'),_0x5409('0xef')),{'interaction':_0x461c17})[_0x5409('0x2e')](function(_0x5a88c7){var _0x23f2a0=path['join'](_0x3508d7,'transcript-'+_0x5b45d3['id']+'-'+_0xaf08b4+_0x5409('0xf0'));var _0x4c489a={'path':_0x23f2a0,'channel':'Openchannel','interactionId':_0x5b45d3['id']};return pdf[_0x5409('0xf1')](_0x5a88c7,_0x4c489a);})[_0x5409('0x2e')](function(){return new BPromise(function(_0x1926c5,_0x4f84c6){zipdir(_0x3508d7,{'saveTo':_0x59e049},function(_0x6abda5,_0x11bdac){if(_0x6abda5)return _0x4f84c6(_0x6abda5);return _0x1926c5(_0x11bdac);});})[_0x5409('0x2e')](function(){return new BPromise(function(_0x522745,_0x361874){rimraf(_0x3508d7,function(_0x249334){if(_0x249334)_0x361874(_0x249334);return _0x522745();});});})['then'](function(){return _0x1afa7c['download'](_0x59e049,_0x2bb95c,function(_0x5cee75){if(_0x5cee75){console['log'](_0x5409('0xf2'),_0x5cee75);}else{fs['unlinkSync'](_0x59e049);}});});});}else{return _0x1afa7c['sendStatus'](0xc8);}})['catch'](handleError(_0x1afa7c,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 8b85df5..4fd0d5a 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 _0x9d28=['Users','unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0xca4496,_0x2fc966){var _0x1794b2=function(_0x189dc1){while(--_0x189dc1){_0xca4496['push'](_0xca4496['shift']());}};_0x1794b2(++_0x2fc966);}(_0x9d28,0x106));var _0x89d2=function(_0x519ee1,_0x3aab5c){_0x519ee1=_0x519ee1-0x0;var _0x101c5a=_0x9d28[_0x519ee1];return _0x101c5a;};'use strict';var EventEmitter=require(_0x89d2('0x0'));var OpenchannelInteraction=require(_0x89d2('0x1'))['db'][_0x89d2('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x89d2('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x89d2('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x89d2('0x5'),'afterDestroy':_0x89d2('0x6')};function emitEvent(_0x9a5efb){return function(_0x4e3443,_0x317a32,_0x2f0ab8){_0x4e3443[_0x89d2('0x7')]({'attributes':['id'],'raw':!![]})[_0x89d2('0x8')](function(_0x353230){_0x4e3443[_0x89d2('0x9')](_0x89d2('0xa'),_0x353230['map'](function(_0x249b7b){return{'id':_0x249b7b['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4e3443['id'],'direction':'in','read':![]},'raw':!![]});})[_0x89d2('0x8')](function(_0xf5edf8){_0x4e3443['setDataValue'](_0x89d2('0xb'),_0xf5edf8[_0x89d2('0xc')]);OpenchannelInteractionEvents[_0x89d2('0xd')](_0x9a5efb+':'+_0x4e3443['id'],_0x4e3443);OpenchannelInteractionEvents['emit'](_0x9a5efb,_0x4e3443);_0x2f0ab8(null);})['catch'](_0x2f0ab8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x89d2('0xe')](e,emitEvent(event));}}module[_0x89d2('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbe0a=['emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0xf7d20a,_0x469708){var _0x336263=function(_0x9e2fb0){while(--_0x9e2fb0){_0xf7d20a['push'](_0xf7d20a['shift']());}};_0x336263(++_0x469708);}(_0xbe0a,0xb8));var _0xabe0=function(_0x120e1a,_0xf9dcaf){_0x120e1a=_0x120e1a-0x0;var _0x865ce2=_0xbe0a[_0x120e1a];return _0x865ce2;};'use strict';var EventEmitter=require(_0xabe0('0x0'));var OpenchannelInteraction=require(_0xabe0('0x1'))['db'][_0xabe0('0x2')];var OpenchannelMessage=require(_0xabe0('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabe0('0x3'),'afterUpdate':_0xabe0('0x4'),'afterDestroy':_0xabe0('0x5')};function emitEvent(_0x102e58){return function(_0x265432,_0x5134d8,_0x57bee1){_0x265432[_0xabe0('0x6')]({'attributes':['id'],'raw':!![]})[_0xabe0('0x7')](function(_0x332456){_0x265432[_0xabe0('0x8')](_0xabe0('0x9'),_0x332456[_0xabe0('0xa')](function(_0x3182c8){return{'id':_0x3182c8['id']};}));return OpenchannelMessage[_0xabe0('0xb')]({'where':{'OpenchannelInteractionId':_0x265432['id'],'direction':'in','read':![]},'raw':!![]});})[_0xabe0('0x7')](function(_0x5efd61){_0x265432[_0xabe0('0x8')](_0xabe0('0xc'),_0x5efd61[_0xabe0('0xd')]);OpenchannelInteractionEvents[_0xabe0('0xe')](_0x102e58+':'+_0x265432['id'],_0x265432);OpenchannelInteractionEvents[_0xabe0('0xe')](_0x102e58,_0x265432);_0x57bee1(null);})[_0xabe0('0xf')](_0x57bee1(null));};}for(var e in events){if(events[_0xabe0('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xabe0('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3685603..ad5a813 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 _0x2b4b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4adbbf,_0xd3383b){var _0x530f27=function(_0x2ddb40){while(--_0x2ddb40){_0x4adbbf['push'](_0x4adbbf['shift']());}};_0x530f27(++_0xd3383b);}(_0x2b4b,0x85));var _0xb2b4=function(_0x2b11eb,_0x465094){_0x2b11eb=_0x2b11eb-0x0;var _0x180630=_0x2b4b[_0x2b11eb];return _0x180630;};'use strict';var _=require(_0xb2b4('0x0'));var util=require(_0xb2b4('0x1'));var logger=require(_0xb2b4('0x2'))(_0xb2b4('0x3'));var moment=require(_0xb2b4('0x4'));var BPromise=require(_0xb2b4('0x5'));var rp=require(_0xb2b4('0x6'));var fs=require('fs');var path=require(_0xb2b4('0x7'));var rimraf=require(_0xb2b4('0x8'));var config=require(_0xb2b4('0x9'));var attributes=require(_0xb2b4('0xa'));module['exports']=function(_0x52ab4d,_0x38b1a0){return _0x52ab4d[_0xb2b4('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0xb2b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb2b4('0xd'),'collate':_0xb2b4('0xe'),'hooks':{'beforeUpdate':function(_0x3bef3e,_0x1645f2,_0x38282e){if(_0x3bef3e[_0xb2b4('0xf')](_0xb2b4('0x10'))){_0x3bef3e['closedAt']=moment()[_0xb2b4('0x11')](_0xb2b4('0x12'));}_0x38282e(null,_0x3bef3e);}}});}; \ No newline at end of file +var _0x03b7=['utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions'];(function(_0x472257,_0x5aa307){var _0x13eaaf=function(_0x19cf21){while(--_0x19cf21){_0x472257['push'](_0x472257['shift']());}};_0x13eaaf(++_0x5aa307);}(_0x03b7,0x85));var _0x703b=function(_0x4b1f03,_0x532e1b){_0x4b1f03=_0x4b1f03-0x0;var _0xa02cfd=_0x03b7[_0x4b1f03];return _0xa02cfd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x703b('0x0'))('api');var moment=require('moment');var BPromise=require(_0x703b('0x1'));var rp=require(_0x703b('0x2'));var fs=require('fs');var path=require(_0x703b('0x3'));var rimraf=require(_0x703b('0x4'));var config=require(_0x703b('0x5'));var attributes=require(_0x703b('0x6'));module[_0x703b('0x7')]=function(_0xa56f42,_0x2360e8){return _0xa56f42[_0x703b('0x8')](_0x703b('0x9'),attributes,{'tableName':_0x703b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x703b('0xb'),'collate':_0x703b('0xc'),'hooks':{'beforeUpdate':function(_0x6bdf3f,_0x3b5275,_0x3b61f4){if(_0x6bdf3f[_0x703b('0xd')](_0x703b('0xe'))){_0x6bdf3f[_0x703b('0xf')]=moment()[_0x703b('0x10')](_0x703b('0x11'));}_0x3b61f4(null,_0x6bdf3f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 0f5212a..7bd6435 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 _0x30ed=['../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','body','spread','AddTags','lodash','moment','bluebird','randomstring'];(function(_0x141c09,_0x56fa0e){var _0x4f3a79=function(_0x558636){while(--_0x558636){_0x141c09['push'](_0x141c09['shift']());}};_0x4f3a79(++_0x56fa0e);}(_0x30ed,0x1b4));var _0xd30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30ed[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd30e('0x0'));var util=require('util');var moment=require(_0xd30e('0x1'));var BPromise=require(_0xd30e('0x2'));var rs=require(_0xd30e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd30e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd30e('0x5'));var jayson=require(_0xd30e('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xd30e('0x7')]=_[_0xd30e('0x8')](config['redis'],{'host':_0xd30e('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd30e('0x7')]));require(_0xd30e('0xa'))[_0xd30e('0xb')](socket);function respondWithRpcPromise(_0x3c174b,_0x389bce,_0x5dca96){return new BPromise(function(_0x24ed12,_0x3895f1){return client[_0xd30e('0xc')](_0x3c174b,_0x5dca96)[_0xd30e('0xd')](function(_0x53cf3e){logger[_0xd30e('0xe')](_0xd30e('0xf'),_0x389bce,_0xd30e('0x10'));logger[_0xd30e('0x11')](_0xd30e('0x12'),_0x389bce,'request\x20sent',JSON[_0xd30e('0x13')](_0x53cf3e));if(_0x53cf3e[_0xd30e('0x14')]){if(_0x53cf3e[_0xd30e('0x14')][_0xd30e('0x15')]===0x1f4){logger['error'](_0xd30e('0xf'),_0x389bce,_0x53cf3e['error'][_0xd30e('0x16')]);return _0x3895f1(_0x53cf3e['error'][_0xd30e('0x16')]);}logger[_0xd30e('0x14')](_0xd30e('0xf'),_0x389bce,_0x53cf3e[_0xd30e('0x14')][_0xd30e('0x16')]);return _0x24ed12(_0x53cf3e['error']['message']);}else{logger['info'](_0xd30e('0xf'),_0x389bce,_0xd30e('0x10'));_0x24ed12(_0x53cf3e[_0xd30e('0x17')][_0xd30e('0x16')]);}})[_0xd30e('0x18')](function(_0x16afce){logger[_0xd30e('0x14')](_0xd30e('0xf'),_0x389bce,_0x16afce);_0x3895f1(_0x16afce);});});}exports[_0xd30e('0x19')]=function(_0x5007ed){var _0x4afe8c=this;return new Promise(function(_0x54ca2f,_0xaef17f){return db[_0xd30e('0x1a')][_0xd30e('0x1b')](_0x5007ed['body'],{'raw':_0x5007ed['options']?_0x5007ed[_0xd30e('0x1c')][_0xd30e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5007ed[_0xd30e('0x1c')]?_0x5007ed[_0xd30e('0x1c')][_0xd30e('0x1e')]||null:null,'attributes':_0x5007ed[_0xd30e('0x1c')]?_0x5007ed['options'][_0xd30e('0x1f')]||null:null,'limit':_0x5007ed[_0xd30e('0x1c')]?_0x5007ed[_0xd30e('0x1c')][_0xd30e('0x20')]||null:null})[_0xd30e('0xd')](function(_0x41c6f4){logger[_0xd30e('0xe')](_0xd30e('0x19'),_0x5007ed);logger['debug']('UpdateOpenchannelInteraction',_0x5007ed,JSON[_0xd30e('0x13')](_0x41c6f4));_0x54ca2f(_0x41c6f4);})[_0xd30e('0x18')](function(_0x45ee17){logger['error'](_0xd30e('0x19'),_0x45ee17[_0xd30e('0x16')],_0x5007ed);_0xaef17f(_0x4afe8c[_0xd30e('0x14')](0x1f4,_0x45ee17[_0xd30e('0x16')]));});});};exports[_0xd30e('0x21')]=function(_0x8838c7){return new Promise(function(_0xfb33b5,_0x4fba5b){return db[_0xd30e('0x1a')][_0xd30e('0x22')]({'where':_0x8838c7[_0xd30e('0x1c')]?_0x8838c7[_0xd30e('0x1c')][_0xd30e('0x1e')]||null:null})['then'](function(_0x27c634){if(_0x27c634){return _0x27c634[_0xd30e('0x23')](_0x8838c7['body'][_0xd30e('0x24')],_['omit'](_0x8838c7[_0xd30e('0x25')],[_0xd30e('0x24'),'id'])||{});}})[_0xd30e('0x26')](function(_0x1195f2){logger[_0xd30e('0xe')](_0xd30e('0x27'),_0x8838c7);logger[_0xd30e('0x11')](_0xd30e('0x27'),_0x8838c7,JSON[_0xd30e('0x13')](_0x1195f2));_0xfb33b5(_0x1195f2);})['catch'](function(_0x2d0453){logger[_0xd30e('0x14')]('AddTags',_0x2d0453['message'],_0x8838c7);_0x4fba5b(_this[_0xd30e('0x14')](0x1f4,_0x2d0453[_0xd30e('0x16')]));});});}; \ No newline at end of file +var _0xba70=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird'];(function(_0x2643ae,_0x42fa64){var _0x571547=function(_0x291a9c){while(--_0x291a9c){_0x2643ae['push'](_0x2643ae['shift']());}};_0x571547(++_0x42fa64);}(_0xba70,0xf8));var _0x0ba7=function(_0x2fb288,_0x1652a2){_0x2fb288=_0x2fb288-0x0;var _0x545beb=_0xba70[_0x2fb288];return _0x545beb;};'use strict';var _=require(_0x0ba7('0x0'));var util=require(_0x0ba7('0x1'));var moment=require(_0x0ba7('0x2'));var BPromise=require(_0x0ba7('0x3'));var rs=require(_0x0ba7('0x4'));var fs=require('fs');var Redis=require(_0x0ba7('0x5'));var db=require(_0x0ba7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ba7('0x7'))(_0x0ba7('0x8'));var config=require(_0x0ba7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ba7('0xa')]({'port':0x232a});config[_0x0ba7('0xb')]=_['defaults'](config[_0x0ba7('0xb')],{'host':_0x0ba7('0xc'),'port':0x18eb});var socket=require(_0x0ba7('0xd'))(new Redis(config[_0x0ba7('0xb')]));require('./openchannelInteraction.socket')[_0x0ba7('0xe')](socket);function respondWithRpcPromise(_0x1619c5,_0x10c10f,_0x478423){return new BPromise(function(_0x35f77d,_0x348b29){return client[_0x0ba7('0xf')](_0x1619c5,_0x478423)[_0x0ba7('0x10')](function(_0x22606f){logger[_0x0ba7('0x11')](_0x0ba7('0x12'),_0x10c10f,_0x0ba7('0x13'));logger[_0x0ba7('0x14')](_0x0ba7('0x15'),_0x10c10f,_0x0ba7('0x13'),JSON['stringify'](_0x22606f));if(_0x22606f[_0x0ba7('0x16')]){if(_0x22606f['error'][_0x0ba7('0x17')]===0x1f4){logger[_0x0ba7('0x16')](_0x0ba7('0x12'),_0x10c10f,_0x22606f[_0x0ba7('0x16')]['message']);return _0x348b29(_0x22606f['error']['message']);}logger[_0x0ba7('0x16')](_0x0ba7('0x12'),_0x10c10f,_0x22606f[_0x0ba7('0x16')][_0x0ba7('0x18')]);return _0x35f77d(_0x22606f[_0x0ba7('0x16')]['message']);}else{logger[_0x0ba7('0x11')](_0x0ba7('0x12'),_0x10c10f,_0x0ba7('0x13'));_0x35f77d(_0x22606f[_0x0ba7('0x19')][_0x0ba7('0x18')]);}})[_0x0ba7('0x1a')](function(_0x365e84){logger[_0x0ba7('0x16')](_0x0ba7('0x12'),_0x10c10f,_0x365e84);_0x348b29(_0x365e84);});});}exports['UpdateOpenchannelInteraction']=function(_0x419e83){var _0xfcf4d5=this;return new Promise(function(_0xd10c27,_0x2170b9){return db[_0x0ba7('0x1b')][_0x0ba7('0x1c')](_0x419e83[_0x0ba7('0x1d')],{'raw':_0x419e83['options']?_0x419e83[_0x0ba7('0x1e')][_0x0ba7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x419e83[_0x0ba7('0x1e')]?_0x419e83[_0x0ba7('0x1e')][_0x0ba7('0x20')]||null:null,'attributes':_0x419e83[_0x0ba7('0x1e')]?_0x419e83['options'][_0x0ba7('0x21')]||null:null,'limit':_0x419e83[_0x0ba7('0x1e')]?_0x419e83[_0x0ba7('0x1e')][_0x0ba7('0x22')]||null:null})[_0x0ba7('0x10')](function(_0x5db0d8){logger[_0x0ba7('0x11')](_0x0ba7('0x23'),_0x419e83);logger['debug'](_0x0ba7('0x23'),_0x419e83,JSON[_0x0ba7('0x24')](_0x5db0d8));_0xd10c27(_0x5db0d8);})[_0x0ba7('0x1a')](function(_0x174b5a){logger[_0x0ba7('0x16')](_0x0ba7('0x23'),_0x174b5a[_0x0ba7('0x18')],_0x419e83);_0x2170b9(_0xfcf4d5['error'](0x1f4,_0x174b5a[_0x0ba7('0x18')]));});});};exports[_0x0ba7('0x25')]=function(_0xc423d){return new Promise(function(_0x2fc816,_0x3d51){return db[_0x0ba7('0x1b')][_0x0ba7('0x26')]({'where':_0xc423d[_0x0ba7('0x1e')]?_0xc423d[_0x0ba7('0x1e')]['where']||null:null})[_0x0ba7('0x10')](function(_0xb14575){if(_0xb14575){return _0xb14575['addTags'](_0xc423d[_0x0ba7('0x1d')][_0x0ba7('0x27')],_[_0x0ba7('0x28')](_0xc423d[_0x0ba7('0x1d')],['ids','id'])||{});}})['spread'](function(_0x4a9275){logger[_0x0ba7('0x11')](_0x0ba7('0x29'),_0xc423d);logger['debug'](_0x0ba7('0x29'),_0xc423d,JSON[_0x0ba7('0x24')](_0x4a9275));_0x2fc816(_0x4a9275);})[_0x0ba7('0x1a')](function(_0x397347){logger[_0x0ba7('0x16')](_0x0ba7('0x29'),_0x397347[_0x0ba7('0x18')],_0xc423d);_0x3d51(_this[_0x0ba7('0x16')](0x1f4,_0x397347[_0x0ba7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ede0977..7967f55 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 _0x26b6=['register','openchannelInteraction:','./openchannelInteraction.events','save','removeListener'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x26b6,0x1c9));var _0x626b=function(_0x501cbc,_0x3fa385){_0x501cbc=_0x501cbc-0x0;var _0x345421=_0x26b6[_0x501cbc];return _0x345421;};'use strict';var OpenchannelInteractionEvents=require(_0x626b('0x0'));var events=[_0x626b('0x1'),'remove','update'];function createListener(_0x30be44,_0x205ce0){return function(_0x5ca9c7){_0x205ce0['emit'](_0x30be44,_0x5ca9c7);};}function removeListener(_0x415b8e,_0x54b710){return function(){OpenchannelInteractionEvents[_0x626b('0x2')](_0x415b8e,_0x54b710);};}exports[_0x626b('0x3')]=function(_0xc77827){for(var _0x1c8667=0x0,_0xeb4e05=events['length'];_0x1c8667<_0xeb4e05;_0x1c8667++){var _0x5e7781=events[_0x1c8667];var _0x1bb1b4=createListener(_0x626b('0x4')+_0x5e7781,_0xc77827);OpenchannelInteractionEvents['on'](_0x5e7781,_0x1bb1b4);}}; \ No newline at end of file +var _0xd634=['update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x610f6,_0x18bef6){var _0x2b622a=function(_0xce0707){while(--_0xce0707){_0x610f6['push'](_0x610f6['shift']());}};_0x2b622a(++_0x18bef6);}(_0xd634,0x95));var _0x4d63=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xd634[_0x3132e8];return _0x43eb8c;};'use strict';var OpenchannelInteractionEvents=require(_0x4d63('0x0'));var events=[_0x4d63('0x1'),_0x4d63('0x2'),_0x4d63('0x3')];function createListener(_0x5e1b23,_0x4f8c22){return function(_0x38593e){_0x4f8c22[_0x4d63('0x4')](_0x5e1b23,_0x38593e);};}function removeListener(_0x36cba7,_0x1107f8){return function(){OpenchannelInteractionEvents['removeListener'](_0x36cba7,_0x1107f8);};}exports[_0x4d63('0x5')]=function(_0x47490b){for(var _0x85e738=0x0,_0x3e3ddf=events[_0x4d63('0x6')];_0x85e738<_0x3e3ddf;_0x85e738++){var _0x12f75c=events[_0x85e738];var _0x169885=createListener(_0x4d63('0x7')+_0x12f75c,_0x47490b);OpenchannelInteractionEvents['on'](_0x12f75c,_0x169885);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 6dd40d4..c3ee318 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x2d4310,_0x2c4294){var _0x52099f=function(_0x42c4ff){while(--_0x42c4ff){_0x2d4310['push'](_0x2d4310['shift']());}};_0x52099f(++_0x2c4294);}(_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('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('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(_0xa84e6a,_0x47e512){var _0x4c13e3=function(_0x16b315){while(--_0x16b315){_0xa84e6a['push'](_0xa84e6a['shift']());}};_0x4c13e3(++_0x47e512);}(_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['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 5128280..9d1bcd6 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 _0x1219=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x1219,0x17c));var _0x9121=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1219[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9121('0x0'));module[_0x9121('0x1')]={'body':{'type':Sequelize[_0x9121('0x2')](_0x9121('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9121('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9121('0x5')]('in','out'),'defaultValue':_0x9121('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9121('0x7')]},'providerName':{'type':Sequelize[_0x9121('0x8')]},'providerResponse':{'type':Sequelize[_0x9121('0x2')]}}; \ No newline at end of file +var _0x0fd9=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x22d82b,_0xe798c4){var _0x37fea1=function(_0x2049ef){while(--_0x2049ef){_0x22d82b['push'](_0x22d82b['shift']());}};_0x37fea1(++_0xe798c4);}(_0x0fd9,0xa3));var _0x90fd=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x0fd9[_0x3e2fcf];return _0x497db7;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'body':{'type':Sequelize[_0x90fd('0x1')](_0x90fd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x90fd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x90fd('0x4')),'defaultValue':_0x90fd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x90fd('0x5')]},'providerName':{'type':Sequelize[_0x90fd('0x6')]},'providerResponse':{'type':Sequelize[_0x90fd('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c4e5511..a514f37 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 _0xdf10=['interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','rejectMessage','fullname','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','fieldName','type','key','keys','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelMessage','findAll','then','show','params','rawAttributes','fields','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','format'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0xdf10,0x1af));var _0x0df1=function(_0x38d91b,_0x2abf3d){_0x38d91b=_0x38d91b-0x0;var _0x51f80b=_0xdf10[_0x38d91b];return _0x51f80b;};'use strict';var emlformat=require(_0x0df1('0x0'));var rimraf=require(_0x0df1('0x1'));var zipdir=require(_0x0df1('0x2'));var jsonpatch=require(_0x0df1('0x3'));var rp=require(_0x0df1('0x4'));var moment=require(_0x0df1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0df1('0x6'));var util=require(_0x0df1('0x7'));var path=require(_0x0df1('0x8'));var sox=require(_0x0df1('0x9'));var csv=require(_0x0df1('0xa'));var ejs=require(_0x0df1('0xb'));var fs=require('fs');var fs_extra=require(_0x0df1('0xc'));var _=require('lodash');var squel=require(_0x0df1('0xd'));var crypto=require(_0x0df1('0xe'));var jsforce=require(_0x0df1('0xf'));var deskjs=require(_0x0df1('0x10'));var toCsv=require(_0x0df1('0xa'));var querystring=require('querystring');var Papa=require(_0x0df1('0x11'));var Redis=require(_0x0df1('0x12'));var authService=require(_0x0df1('0x13'));var qs=require(_0x0df1('0x14'));var as=require(_0x0df1('0x15'));var hardwareService=require(_0x0df1('0x16'));var logger=require('../../config/logger')(_0x0df1('0x17'));var utils=require(_0x0df1('0x18'));var config=require(_0x0df1('0x19'));var licenseUtil=require(_0x0df1('0x1a'));var db=require('../../mysqldb')['db'];config[_0x0df1('0x1b')]=_[_0x0df1('0x1c')](config[_0x0df1('0x1b')],{'host':_0x0df1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0df1('0x1b')]));require(_0x0df1('0x1e'))[_0x0df1('0x1f')](socket);var jayson=require(_0x0df1('0x20'));var client=jayson[_0x0df1('0x21')][_0x0df1('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x0df1('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4a6c98,_0x3fc342,_0x4874f3,_0x3223e6){return new BPromise(function(_0x2ae6b9,_0x26cbdc){var _0x389d29=_0x3223e6||client;return _0x389d29['request'](_0x4a6c98,_0x4874f3)['then'](function(_0x2aef61){logger[_0x0df1('0x23')](_0x0df1('0x24'),_0x3fc342,_0x0df1('0x25'));logger[_0x0df1('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3fc342,_0x0df1('0x25'),JSON[_0x0df1('0x27')](_0x2aef61));if(_0x2aef61[_0x0df1('0x28')]){if(_0x2aef61[_0x0df1('0x28')][_0x0df1('0x29')]===0x1f4){logger['error'](_0x0df1('0x24'),_0x3fc342,_0x2aef61[_0x0df1('0x28')][_0x0df1('0x2a')]);return _0x26cbdc(_0x2aef61[_0x0df1('0x28')][_0x0df1('0x2a')]);}logger[_0x0df1('0x28')](_0x0df1('0x24'),_0x3fc342,_0x2aef61[_0x0df1('0x28')]['message']);return _0x2ae6b9(_0x2aef61[_0x0df1('0x28')][_0x0df1('0x2a')]);}else{logger[_0x0df1('0x23')](_0x0df1('0x24'),_0x3fc342,_0x0df1('0x25'));_0x2ae6b9(_0x2aef61[_0x0df1('0x2b')][_0x0df1('0x2a')]);}})[_0x0df1('0x2c')](function(_0x50e843){logger[_0x0df1('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x3fc342,_0x50e843);_0x26cbdc(_0x50e843);});});}function respondWithStatusCode(_0x5b8bab,_0xbff8f9){_0xbff8f9=_0xbff8f9||0xcc;return function(_0x20b7bd){if(_0x20b7bd){return _0x5b8bab[_0x0df1('0x2d')](_0xbff8f9);}return _0x5b8bab[_0x0df1('0x2e')](_0xbff8f9)[_0x0df1('0x2f')]();};}function respondWithResult(_0x5a6133,_0x46b2c8){_0x46b2c8=_0x46b2c8||0xc8;return function(_0x2006e6){if(_0x2006e6){return _0x5a6133['status'](_0x46b2c8)[_0x0df1('0x30')](_0x2006e6);}};}function respondWithFilteredResult(_0x2fc873,_0x5902d6){return function(_0x1766d3){if(_0x1766d3){var _0x38429b=typeof _0x5902d6[_0x0df1('0x31')]===_0x0df1('0x32')&&typeof _0x5902d6[_0x0df1('0x33')]===_0x0df1('0x32');var _0x6d9192=_0x1766d3[_0x0df1('0x34')];var _0x1ebf28=_0x38429b?0x0:_0x5902d6[_0x0df1('0x31')];var _0x2e0c2d=_0x38429b?_0x1766d3[_0x0df1('0x34')]:_0x5902d6[_0x0df1('0x31')]+_0x5902d6[_0x0df1('0x33')];var _0x139631;if(_0x2e0c2d>=_0x6d9192){_0x2e0c2d=_0x6d9192;_0x139631=0xc8;}else{_0x139631=0xce;}_0x2fc873[_0x0df1('0x2e')](_0x139631);return _0x2fc873[_0x0df1('0x35')](_0x0df1('0x36'),_0x1ebf28+'-'+_0x2e0c2d+'/'+_0x6d9192)['json'](_0x1766d3);}return null;};}function patchUpdates(_0x31a89b){return function(_0x548d30){try{jsonpatch[_0x0df1('0x37')](_0x548d30,_0x31a89b,!![]);}catch(_0x1857cf){return BPromise[_0x0df1('0x38')](_0x1857cf);}return _0x548d30[_0x0df1('0x39')]();};}function saveUpdates(_0x1e5dd6,_0x3d2ca8){return function(_0x23ea17){if(_0x23ea17){return _0x23ea17[_0x0df1('0x3a')](_0x1e5dd6)['then'](function(_0x49e376){return _0x49e376;});}return null;};}function removeEntity(_0x3aef28,_0x4b4449){return function(_0x3ea031){if(_0x3ea031){return _0x3ea031[_0x0df1('0x3b')]()['then'](function(){_0x3aef28['status'](0xcc)[_0x0df1('0x2f')]();});}};}function handleEntityNotFound(_0x5481fa,_0x35581d){return function(_0x2702cf){if(!_0x2702cf){_0x5481fa[_0x0df1('0x2d')](0x194);}return _0x2702cf;};}function handleError(_0x2948c3,_0x116c09){_0x116c09=_0x116c09||0x1f4;return function(_0x1bae57){logger[_0x0df1('0x28')](_0x1bae57[_0x0df1('0x3c')]);if(_0x1bae57['name']){delete _0x1bae57[_0x0df1('0x3d')];}_0x2948c3[_0x0df1('0x2e')](_0x116c09)[_0x0df1('0x3e')](_0x1bae57);};}exports['index']=function(_0x2d0187,_0x5c33d2){var _0x2c84ab={},_0x260a14={},_0x1bbdb0={'count':0x0,'rows':[]};var _0x2c791c=_[_0x0df1('0x3f')](db['OpenchannelMessage']['rawAttributes'],function(_0x18d889){return{'name':_0x18d889[_0x0df1('0x40')],'type':_0x18d889[_0x0df1('0x41')][_0x0df1('0x42')]};});_0x260a14['model']=_[_0x0df1('0x3f')](_0x2c791c,_0x0df1('0x3d'));_0x260a14['query']=_[_0x0df1('0x43')](_0x2d0187[_0x0df1('0x44')]);_0x260a14[_0x0df1('0x45')]=_['intersection'](_0x260a14[_0x0df1('0x46')],_0x260a14[_0x0df1('0x44')]);_0x2c84ab[_0x0df1('0x47')]=_[_0x0df1('0x48')](_0x260a14[_0x0df1('0x46')],qs['fields'](_0x2d0187[_0x0df1('0x44')]['fields']));_0x2c84ab[_0x0df1('0x47')]=_0x2c84ab[_0x0df1('0x47')][_0x0df1('0x49')]?_0x2c84ab[_0x0df1('0x47')]:_0x260a14[_0x0df1('0x46')];if(!_0x2d0187[_0x0df1('0x44')][_0x0df1('0x4a')](_0x0df1('0x4b'))){_0x2c84ab['limit']=qs[_0x0df1('0x33')](_0x2d0187[_0x0df1('0x44')]['limit']);_0x2c84ab[_0x0df1('0x31')]=qs[_0x0df1('0x31')](_0x2d0187['query'][_0x0df1('0x31')]);}_0x2c84ab[_0x0df1('0x4c')]=qs[_0x0df1('0x4d')](_0x2d0187[_0x0df1('0x44')][_0x0df1('0x4d')]);_0x2c84ab[_0x0df1('0x4e')]=qs[_0x0df1('0x45')](_[_0x0df1('0x4f')](_0x2d0187[_0x0df1('0x44')],_0x260a14[_0x0df1('0x45')]),_0x2c791c);if(_0x2d0187['query'][_0x0df1('0x50')]){_0x2c84ab['where']=_[_0x0df1('0x51')](_0x2c84ab[_0x0df1('0x4e')],{'$or':_['map'](_0x2c791c,function(_0x4a9309){if(_0x4a9309[_0x0df1('0x41')]!==_0x0df1('0x52')){var _0x43342c={};_0x43342c[_0x4a9309[_0x0df1('0x3d')]]={'$like':'%'+_0x2d0187[_0x0df1('0x44')][_0x0df1('0x50')]+'%'};return _0x43342c;}})});}_0x2c84ab=_['merge']({},_0x2c84ab,_0x2d0187[_0x0df1('0x53')]);var _0xc4b23c={'where':_0x2c84ab[_0x0df1('0x4e')]};return db['OpenchannelMessage'][_0x0df1('0x34')](_0xc4b23c)['then'](function(_0x24d2a3){_0x1bbdb0['count']=_0x24d2a3;if(_0x2d0187[_0x0df1('0x44')][_0x0df1('0x54')]){_0x2c84ab[_0x0df1('0x55')]=[{'all':!![]}];}return db[_0x0df1('0x56')][_0x0df1('0x57')](_0x2c84ab);})[_0x0df1('0x58')](function(_0x105937){_0x1bbdb0['rows']=_0x105937;return _0x1bbdb0;})['then'](respondWithFilteredResult(_0x5c33d2,_0x2c84ab))['catch'](handleError(_0x5c33d2,null));};exports[_0x0df1('0x59')]=function(_0x4cb0e6,_0x506a34){var _0xa9c113={'raw':!![],'where':{'id':_0x4cb0e6[_0x0df1('0x5a')]['id']}},_0x30ae11={};_0x30ae11[_0x0df1('0x46')]=_[_0x0df1('0x43')](db['OpenchannelMessage'][_0x0df1('0x5b')]);_0x30ae11['query']=_[_0x0df1('0x43')](_0x4cb0e6[_0x0df1('0x44')]);_0x30ae11[_0x0df1('0x45')]=_[_0x0df1('0x48')](_0x30ae11[_0x0df1('0x46')],_0x30ae11[_0x0df1('0x44')]);_0xa9c113[_0x0df1('0x47')]=_[_0x0df1('0x48')](_0x30ae11[_0x0df1('0x46')],qs[_0x0df1('0x5c')](_0x4cb0e6[_0x0df1('0x44')][_0x0df1('0x5c')]));_0xa9c113['attributes']=_0xa9c113[_0x0df1('0x47')]['length']?_0xa9c113[_0x0df1('0x47')]:_0x30ae11['model'];if(_0x4cb0e6[_0x0df1('0x44')][_0x0df1('0x54')]){_0xa9c113[_0x0df1('0x55')]=[{'all':!![]}];}_0xa9c113=_[_0x0df1('0x51')]({},_0xa9c113,_0x4cb0e6[_0x0df1('0x53')]);return db[_0x0df1('0x56')][_0x0df1('0x5d')](_0xa9c113)[_0x0df1('0x58')](handleEntityNotFound(_0x506a34,null))[_0x0df1('0x58')](respondWithResult(_0x506a34,null))[_0x0df1('0x2c')](handleError(_0x506a34,null));};exports[_0x0df1('0x5e')]=function(_0x4b01de,_0x3ac7ae){return db[_0x0df1('0x56')][_0x0df1('0x5e')](_0x4b01de[_0x0df1('0x5f')],{})[_0x0df1('0x58')](respondWithResult(_0x3ac7ae,0xc9))['catch'](handleError(_0x3ac7ae,null));};exports[_0x0df1('0x3a')]=function(_0x57b729,_0x3d1d83){if(_0x57b729['body']['id']){delete _0x57b729['body']['id'];}return db[_0x0df1('0x56')]['find']({'where':{'id':_0x57b729[_0x0df1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3d1d83,null))['then'](saveUpdates(_0x57b729[_0x0df1('0x5f')],null))[_0x0df1('0x58')](respondWithResult(_0x3d1d83,null))[_0x0df1('0x2c')](handleError(_0x3d1d83,null));};exports['destroy']=function(_0x2ec82a,_0x446f48){return db[_0x0df1('0x56')]['find']({'where':{'id':_0x2ec82a['params']['id']}})['then'](handleEntityNotFound(_0x446f48,null))[_0x0df1('0x58')](removeEntity(_0x446f48,null))[_0x0df1('0x2c')](handleError(_0x446f48,null));};exports[_0x0df1('0x60')]=function(_0x95f1d7,_0x4402d9){return db[_0x0df1('0x56')]['describe']()[_0x0df1('0x58')](respondWithResult(_0x4402d9,null))[_0x0df1('0x2c')](handleError(_0x4402d9,null));};var interaction_log=require(_0x0df1('0x61'))(_0x0df1('0x62'));exports[_0x0df1('0x63')]=function(_0x41eb57,_0x7fa105,_0x4ebca6){var _0x225976={'agent':{},'channel':_0x0df1('0x64')};if(_0x41eb57[_0x0df1('0x5f')]['id']){delete _0x41eb57['body']['id'];}_0x41eb57[_0x0df1('0x5f')]['read']=!![];_0x41eb57[_0x0df1('0x5f')]['readAt']=moment()['format'](_0x0df1('0x65'));_0x41eb57[_0x0df1('0x5f')][_0x0df1('0x66')]=_0x41eb57['body']['UserId']||_0x41eb57['user']['id'];_0x225976[_0x0df1('0x67')]['id']=_0x41eb57[_0x0df1('0x5f')][_0x0df1('0x66')];return db['OpenchannelMessage'][_0x0df1('0x5d')]({'where':{'id':_0x41eb57['params']['id'],'UserId':null}})[_0x0df1('0x58')](handleEntityNotFound(_0x7fa105,null))[_0x0df1('0x58')](saveUpdates(_0x41eb57[_0x0df1('0x5f')],null))[_0x0df1('0x58')](function(_0x5f36b3){if(_0x5f36b3){_0x225976[_0x0df1('0x2a')]=_0x5f36b3[_0x0df1('0x68')]({'plain':!![]});return db[_0x0df1('0x69')][_0x0df1('0x5d')]({'where':{'id':_0x5f36b3[_0x0df1('0x6a')]}});}return null;})[_0x0df1('0x58')](handleEntityNotFound(_0x7fa105,null))['then'](function(_0x4a0481){if(_0x4a0481){return _0x4a0481['update']({'UserId':_0x41eb57[_0x0df1('0x5f')]['UserId'],'read1stAt':_['isNil'](_0x4a0481[_0x0df1('0x6b')])?moment()[_0x0df1('0x6c')](_0x0df1('0x65')):undefined});}return null;})['then'](function(_0x462064){if(_0x462064){_0x225976[_0x0df1('0x6d')]=_0x462064[_0x0df1('0x68')]({'plain':!![]});interaction_log[_0x0df1('0x23')](_0x0df1('0x6e'),_0x41eb57[_0x0df1('0x6f')]['id'],_0x41eb57[_0x0df1('0x6f')][_0x0df1('0x3d')],_0x41eb57[_0x0df1('0x6f')][_0x0df1('0x70')],_0x225976[_0x0df1('0x6d')]['id'],_0x41eb57[_0x0df1('0x5f')]?JSON[_0x0df1('0x27')](_0x41eb57[_0x0df1('0x5f')]):_0x0df1('0x71'));return respondWithRpcPromise(_0x0df1('0x72'),_0x0df1('0x73'),_0x225976);}return null;})['then'](function(_0x144133){var _0x23b320=_0x0df1('0x74')+_0x144133[_0x0df1('0x2a')][_0x0df1('0x75')];return db[_0x0df1('0x76')][_0x0df1('0x44')](_0x23b320,{'type':db[_0x0df1('0x77')][_0x0df1('0x78')][_0x0df1('0x79')],'raw':!![]})['then'](function(_0x1fd7b5){return _0x1fd7b5;});})[_0x0df1('0x58')](function(_0x261aaf){if(_0x261aaf){_0x225976[_0x0df1('0x2a')]['contact']=_0x261aaf[0x0];if(!_0x41eb57[_0x0df1('0x5f')][_0x0df1('0x66')])return;return db[_0x0df1('0x7a')][_0x0df1('0x5d')]({'where':{'id':_0x41eb57['body'][_0x0df1('0x66')],'role':_0x0df1('0x67')},'attributes':['id',_0x0df1('0x3d'),'fullname',_0x0df1('0x7b'),_0x0df1('0x7c')],'raw':!![]});}return null;})[_0x0df1('0x58')](function(_0x407a3d){if(!_0x407a3d)return null;_0x225976[_0x0df1('0x2a')][_0x0df1('0x67')]=_0x407a3d;return _0x225976;})['then'](function(_0x41507c){if(_0x41507c){if(_0x41eb57[_0x0df1('0x5f')][_0x0df1('0x7d')]){_0x225976['message'][_0x0df1('0x7e')]=util[_0x0df1('0x6c')](_0x0df1('0x7f'),_0x41eb57[_0x0df1('0x6f')][_0x0df1('0x3d')]);_0x225976[_0x0df1('0x2a')][_0x0df1('0x80')]=_0x225976[_0x0df1('0x80')];_0x225976[_0x0df1('0x2a')][_0x0df1('0x81')]=_0x225976[_0x0df1('0x80')];_0x225976[_0x0df1('0x2a')]['event']=_0x0df1('0x63');return respondWithRpcPromise(_0x0df1('0x82'),_0x0df1('0x82'),{'event':_0x0df1('0x83'),'message':_0x225976[_0x0df1('0x2a')]},client9002)[_0x0df1('0x58')](function(){return _0x225976;});}return _0x225976;}return null;})['then'](respondWithResult(_0x7fa105,null))[_0x0df1('0x2c')](handleError(_0x7fa105,null));};var interaction_log=require(_0x0df1('0x61'))(_0x0df1('0x62'));exports[_0x0df1('0x38')]=function(_0x34c230,_0x494dfa,_0x526b53){var _0x2579a0={'agent':{},'channel':_0x0df1('0x64')};if(_0x34c230[_0x0df1('0x5f')]['id']){delete _0x34c230['body']['id'];}_0x34c230[_0x0df1('0x5f')]['UserId']=_0x34c230[_0x0df1('0x5f')][_0x0df1('0x66')]||_0x34c230[_0x0df1('0x6f')]['id'];_0x2579a0[_0x0df1('0x67')]['id']=_0x34c230[_0x0df1('0x5f')][_0x0df1('0x66')];return db['OpenchannelMessage'][_0x0df1('0x5d')]({'where':{'id':_0x34c230[_0x0df1('0x5a')]['id'],'UserId':null}})[_0x0df1('0x58')](handleEntityNotFound(_0x494dfa,null))[_0x0df1('0x58')](function(_0x52ae65){if(_0x52ae65){_0x2579a0[_0x0df1('0x2a')]=_0x52ae65[_0x0df1('0x68')]({'plain':!![]});return db[_0x0df1('0x69')][_0x0df1('0x5d')]({'where':{'id':_0x52ae65[_0x0df1('0x6a')]}});}return null;})[_0x0df1('0x58')](handleEntityNotFound(_0x494dfa,null))[_0x0df1('0x58')](function(_0x2ada24){if(_0x2ada24){_0x2579a0[_0x0df1('0x6d')]=_0x2ada24[_0x0df1('0x68')]({'plain':!![]});interaction_log[_0x0df1('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34c230[_0x0df1('0x6f')]['id'],_0x34c230['user'][_0x0df1('0x3d')],_0x34c230[_0x0df1('0x6f')][_0x0df1('0x70')],_0x2579a0[_0x0df1('0x6d')]['id'],_0x34c230[_0x0df1('0x5f')]?JSON[_0x0df1('0x27')](_0x34c230['body']):_0x0df1('0x71'));return respondWithRpcPromise('RejectMessage',_0x0df1('0x84'),_0x2579a0);}return null;})[_0x0df1('0x58')](function(_0x5761c1){var _0x17a0f7=_0x0df1('0x74')+_0x5761c1[_0x0df1('0x2a')][_0x0df1('0x75')];return db[_0x0df1('0x76')]['query'](_0x17a0f7,{'type':db['Sequelize'][_0x0df1('0x78')]['SELECT'],'raw':!![]})[_0x0df1('0x58')](function(_0x2309a0){return _0x2309a0;});})[_0x0df1('0x58')](function(_0x5a6b36){if(_0x5a6b36){_0x2579a0['message']['contact']=_0x5a6b36[0x0];if(!_0x34c230[_0x0df1('0x5f')][_0x0df1('0x66')])return;return db[_0x0df1('0x7a')][_0x0df1('0x5d')]({'where':{'id':_0x34c230['body'][_0x0df1('0x66')],'role':_0x0df1('0x67')},'attributes':['id',_0x0df1('0x3d'),_0x0df1('0x85'),'email',_0x0df1('0x7c')],'raw':!![]});}return null;})[_0x0df1('0x58')](function(_0x509958){if(!_0x509958)return null;_0x2579a0[_0x0df1('0x2a')]['agent']=_0x509958;return _0x2579a0;})[_0x0df1('0x58')](function(_0x273798){if(_0x273798){_0x273798['message'][_0x0df1('0x7e')]=util['format'](_0x0df1('0x7f'),_0x34c230[_0x0df1('0x6f')][_0x0df1('0x3d')]);_0x273798[_0x0df1('0x2a')]['channel']=_0x2579a0[_0x0df1('0x80')];_0x273798['message'][_0x0df1('0x81')]=_0x2579a0[_0x0df1('0x80')];_0x273798[_0x0df1('0x2a')]['event']=_0x0df1('0x38');respondWithRpcPromise('EventManager',_0x0df1('0x82'),{'event':_0x0df1('0x86'),'message':_0x273798[_0x0df1('0x2a')]},client9002);return _0x2579a0;}return null;})[_0x0df1('0x58')](respondWithResult(_0x494dfa,null))[_0x0df1('0x2c')](handleError(_0x494dfa,null));}; \ No newline at end of file +var _0x7058=['channel','accept','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','interface','SIP/%s','motionChannel','event','rejectmessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelMessage','includeAll','include','rows','find','create','body','params','describe','openchannel-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteractionId','isNil','read1stAt','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','internal','manual'];(function(_0x1cfc4b,_0x3c895d){var _0x6ba7af=function(_0x58a48d){while(--_0x58a48d){_0x1cfc4b['push'](_0x1cfc4b['shift']());}};_0x6ba7af(++_0x3c895d);}(_0x7058,0x180));var _0x8705=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x7058[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x8705('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8705('0x1'));var jsonpatch=require(_0x8705('0x2'));var rp=require('request-promise');var moment=require(_0x8705('0x3'));var BPromise=require(_0x8705('0x4'));var Mustache=require(_0x8705('0x5'));var util=require('util');var path=require(_0x8705('0x6'));var sox=require(_0x8705('0x7'));var csv=require(_0x8705('0x8'));var ejs=require(_0x8705('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8705('0xa'));var squel=require(_0x8705('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8705('0xc'));var toCsv=require(_0x8705('0x8'));var querystring=require('querystring');var Papa=require(_0x8705('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8705('0xe'));var hardwareService=require(_0x8705('0xf'));var logger=require(_0x8705('0x10'))(_0x8705('0x11'));var utils=require(_0x8705('0x12'));var config=require(_0x8705('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8705('0x14'))['db'];config[_0x8705('0x15')]=_[_0x8705('0x16')](config[_0x8705('0x15')],{'host':_0x8705('0x17'),'port':0x18eb});var socket=require(_0x8705('0x18'))(new Redis(config[_0x8705('0x15')]));require('./openchannelMessage.socket')[_0x8705('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8705('0x1a')][_0x8705('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x8705('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x59744a,_0x250275,_0x3f210a,_0x1331ec){return new BPromise(function(_0x271338,_0x3013df){var _0x5afdc0=_0x1331ec||client;return _0x5afdc0[_0x8705('0x1c')](_0x59744a,_0x3f210a)[_0x8705('0x1d')](function(_0x54237d){logger[_0x8705('0x1e')](_0x8705('0x1f'),_0x250275,_0x8705('0x20'));logger['debug'](_0x8705('0x21'),_0x250275,_0x8705('0x20'),JSON[_0x8705('0x22')](_0x54237d));if(_0x54237d[_0x8705('0x23')]){if(_0x54237d[_0x8705('0x23')]['code']===0x1f4){logger[_0x8705('0x23')](_0x8705('0x1f'),_0x250275,_0x54237d[_0x8705('0x23')]['message']);return _0x3013df(_0x54237d[_0x8705('0x23')][_0x8705('0x24')]);}logger[_0x8705('0x23')](_0x8705('0x1f'),_0x250275,_0x54237d[_0x8705('0x23')][_0x8705('0x24')]);return _0x271338(_0x54237d['error'][_0x8705('0x24')]);}else{logger[_0x8705('0x1e')](_0x8705('0x1f'),_0x250275,'request\x20sent');_0x271338(_0x54237d[_0x8705('0x25')]['message']);}})[_0x8705('0x26')](function(_0x274048){logger[_0x8705('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x250275,_0x274048);_0x3013df(_0x274048);});});}function respondWithStatusCode(_0x2b045a,_0x59d2a7){_0x59d2a7=_0x59d2a7||0xcc;return function(_0x17c514){if(_0x17c514){return _0x2b045a['sendStatus'](_0x59d2a7);}return _0x2b045a[_0x8705('0x27')](_0x59d2a7)[_0x8705('0x28')]();};}function respondWithResult(_0x3a9b74,_0xb01160){_0xb01160=_0xb01160||0xc8;return function(_0x4ab3e3){if(_0x4ab3e3){return _0x3a9b74[_0x8705('0x27')](_0xb01160)[_0x8705('0x29')](_0x4ab3e3);}};}function respondWithFilteredResult(_0x5969ed,_0x15b91b){return function(_0x2500e9){if(_0x2500e9){var _0x5d8278=typeof _0x15b91b[_0x8705('0x2a')]==='undefined'&&typeof _0x15b91b['limit']===_0x8705('0x2b');var _0x279a55=_0x2500e9['count'];var _0x10d90b=_0x5d8278?0x0:_0x15b91b['offset'];var _0xc1929b=_0x5d8278?_0x2500e9[_0x8705('0x2c')]:_0x15b91b[_0x8705('0x2a')]+_0x15b91b[_0x8705('0x2d')];var _0xd0729b;if(_0xc1929b>=_0x279a55){_0xc1929b=_0x279a55;_0xd0729b=0xc8;}else{_0xd0729b=0xce;}_0x5969ed[_0x8705('0x27')](_0xd0729b);return _0x5969ed['set'](_0x8705('0x2e'),_0x10d90b+'-'+_0xc1929b+'/'+_0x279a55)[_0x8705('0x29')](_0x2500e9);}return null;};}function patchUpdates(_0x4e62d0){return function(_0xafed82){try{jsonpatch[_0x8705('0x2f')](_0xafed82,_0x4e62d0,!![]);}catch(_0x3d821a){return BPromise[_0x8705('0x30')](_0x3d821a);}return _0xafed82[_0x8705('0x31')]();};}function saveUpdates(_0x5a10db,_0x417201){return function(_0x33fb84){if(_0x33fb84){return _0x33fb84[_0x8705('0x32')](_0x5a10db)[_0x8705('0x1d')](function(_0x401ba1){return _0x401ba1;});}return null;};}function removeEntity(_0x39753c,_0x5a3f93){return function(_0x2fb0e3){if(_0x2fb0e3){return _0x2fb0e3[_0x8705('0x33')]()[_0x8705('0x1d')](function(){_0x39753c['status'](0xcc)[_0x8705('0x28')]();});}};}function handleEntityNotFound(_0x579fc8,_0x385fd5){return function(_0x4dd522){if(!_0x4dd522){_0x579fc8[_0x8705('0x34')](0x194);}return _0x4dd522;};}function handleError(_0x3ef95f,_0x2634e6){_0x2634e6=_0x2634e6||0x1f4;return function(_0x23aecb){logger['error'](_0x23aecb[_0x8705('0x35')]);if(_0x23aecb[_0x8705('0x36')]){delete _0x23aecb['name'];}_0x3ef95f[_0x8705('0x27')](_0x2634e6)[_0x8705('0x37')](_0x23aecb);};}exports[_0x8705('0x38')]=function(_0x378303,_0x37db13){var _0x350979={},_0x135c93={},_0x531216={'count':0x0,'rows':[]};var _0x4af422=_[_0x8705('0x39')](db['OpenchannelMessage'][_0x8705('0x3a')],function(_0x47753a){return{'name':_0x47753a['fieldName'],'type':_0x47753a[_0x8705('0x3b')][_0x8705('0x3c')]};});_0x135c93[_0x8705('0x3d')]=_['map'](_0x4af422,'name');_0x135c93[_0x8705('0x3e')]=_[_0x8705('0x3f')](_0x378303[_0x8705('0x3e')]);_0x135c93[_0x8705('0x40')]=_[_0x8705('0x41')](_0x135c93['model'],_0x135c93['query']);_0x350979[_0x8705('0x42')]=_[_0x8705('0x41')](_0x135c93[_0x8705('0x3d')],qs[_0x8705('0x43')](_0x378303[_0x8705('0x3e')][_0x8705('0x43')]));_0x350979[_0x8705('0x42')]=_0x350979[_0x8705('0x42')][_0x8705('0x44')]?_0x350979[_0x8705('0x42')]:_0x135c93[_0x8705('0x3d')];if(!_0x378303[_0x8705('0x3e')][_0x8705('0x45')](_0x8705('0x46'))){_0x350979[_0x8705('0x2d')]=qs['limit'](_0x378303[_0x8705('0x3e')]['limit']);_0x350979[_0x8705('0x2a')]=qs[_0x8705('0x2a')](_0x378303[_0x8705('0x3e')]['offset']);}_0x350979[_0x8705('0x47')]=qs[_0x8705('0x48')](_0x378303[_0x8705('0x3e')][_0x8705('0x48')]);_0x350979[_0x8705('0x49')]=qs[_0x8705('0x40')](_[_0x8705('0x4a')](_0x378303[_0x8705('0x3e')],_0x135c93[_0x8705('0x40')]),_0x4af422);if(_0x378303['query'][_0x8705('0x4b')]){_0x350979['where']=_[_0x8705('0x4c')](_0x350979['where'],{'$or':_[_0x8705('0x39')](_0x4af422,function(_0x41fa92){if(_0x41fa92['type']!=='VIRTUAL'){var _0x3684c7={};_0x3684c7[_0x41fa92[_0x8705('0x36')]]={'$like':'%'+_0x378303[_0x8705('0x3e')][_0x8705('0x4b')]+'%'};return _0x3684c7;}})});}_0x350979=_[_0x8705('0x4c')]({},_0x350979,_0x378303[_0x8705('0x4d')]);var _0x6546a6={'where':_0x350979[_0x8705('0x49')]};return db[_0x8705('0x4e')][_0x8705('0x2c')](_0x6546a6)[_0x8705('0x1d')](function(_0x5cc418){_0x531216[_0x8705('0x2c')]=_0x5cc418;if(_0x378303[_0x8705('0x3e')][_0x8705('0x4f')]){_0x350979[_0x8705('0x50')]=[{'all':!![]}];}return db[_0x8705('0x4e')]['findAll'](_0x350979);})[_0x8705('0x1d')](function(_0x2f9738){_0x531216[_0x8705('0x51')]=_0x2f9738;return _0x531216;})['then'](respondWithFilteredResult(_0x37db13,_0x350979))[_0x8705('0x26')](handleError(_0x37db13,null));};exports['show']=function(_0x5b8117,_0x4a9b23){var _0x3913e1={'raw':!![],'where':{'id':_0x5b8117['params']['id']}},_0x5be2cc={};_0x5be2cc[_0x8705('0x3d')]=_['keys'](db[_0x8705('0x4e')][_0x8705('0x3a')]);_0x5be2cc[_0x8705('0x3e')]=_['keys'](_0x5b8117[_0x8705('0x3e')]);_0x5be2cc[_0x8705('0x40')]=_[_0x8705('0x41')](_0x5be2cc[_0x8705('0x3d')],_0x5be2cc['query']);_0x3913e1[_0x8705('0x42')]=_['intersection'](_0x5be2cc[_0x8705('0x3d')],qs['fields'](_0x5b8117[_0x8705('0x3e')][_0x8705('0x43')]));_0x3913e1['attributes']=_0x3913e1[_0x8705('0x42')]['length']?_0x3913e1['attributes']:_0x5be2cc['model'];if(_0x5b8117[_0x8705('0x3e')][_0x8705('0x4f')]){_0x3913e1[_0x8705('0x50')]=[{'all':!![]}];}_0x3913e1=_[_0x8705('0x4c')]({},_0x3913e1,_0x5b8117[_0x8705('0x4d')]);return db['OpenchannelMessage'][_0x8705('0x52')](_0x3913e1)[_0x8705('0x1d')](handleEntityNotFound(_0x4a9b23,null))[_0x8705('0x1d')](respondWithResult(_0x4a9b23,null))[_0x8705('0x26')](handleError(_0x4a9b23,null));};exports[_0x8705('0x53')]=function(_0x3f3d34,_0x4645fb){return db[_0x8705('0x4e')]['create'](_0x3f3d34[_0x8705('0x54')],{})[_0x8705('0x1d')](respondWithResult(_0x4645fb,0xc9))[_0x8705('0x26')](handleError(_0x4645fb,null));};exports[_0x8705('0x32')]=function(_0x3661e8,_0x3dff66){if(_0x3661e8[_0x8705('0x54')]['id']){delete _0x3661e8[_0x8705('0x54')]['id'];}return db[_0x8705('0x4e')][_0x8705('0x52')]({'where':{'id':_0x3661e8[_0x8705('0x55')]['id']}})[_0x8705('0x1d')](handleEntityNotFound(_0x3dff66,null))[_0x8705('0x1d')](saveUpdates(_0x3661e8[_0x8705('0x54')],null))[_0x8705('0x1d')](respondWithResult(_0x3dff66,null))[_0x8705('0x26')](handleError(_0x3dff66,null));};exports[_0x8705('0x33')]=function(_0x1d197e,_0x33c03a){return db['OpenchannelMessage'][_0x8705('0x52')]({'where':{'id':_0x1d197e['params']['id']}})[_0x8705('0x1d')](handleEntityNotFound(_0x33c03a,null))[_0x8705('0x1d')](removeEntity(_0x33c03a,null))['catch'](handleError(_0x33c03a,null));};exports['describe']=function(_0x2fee6c,_0x14a91e){return db[_0x8705('0x4e')][_0x8705('0x56')]()['then'](respondWithResult(_0x14a91e,null))[_0x8705('0x26')](handleError(_0x14a91e,null));};var interaction_log=require(_0x8705('0x10'))(_0x8705('0x57'));exports['accept']=function(_0x12ee28,_0x20726a,_0x16e02a){var _0x50a0ad={'agent':{},'channel':'openchannel'};if(_0x12ee28[_0x8705('0x54')]['id']){delete _0x12ee28[_0x8705('0x54')]['id'];}_0x12ee28[_0x8705('0x54')][_0x8705('0x58')]=!![];_0x12ee28[_0x8705('0x54')][_0x8705('0x59')]=moment()[_0x8705('0x5a')](_0x8705('0x5b'));_0x12ee28[_0x8705('0x54')][_0x8705('0x5c')]=_0x12ee28['body']['UserId']||_0x12ee28[_0x8705('0x5d')]['id'];_0x50a0ad[_0x8705('0x5e')]['id']=_0x12ee28[_0x8705('0x54')][_0x8705('0x5c')];return db[_0x8705('0x4e')]['find']({'where':{'id':_0x12ee28[_0x8705('0x55')]['id'],'UserId':null}})[_0x8705('0x1d')](handleEntityNotFound(_0x20726a,null))['then'](saveUpdates(_0x12ee28[_0x8705('0x54')],null))[_0x8705('0x1d')](function(_0x5e7ecf){if(_0x5e7ecf){_0x50a0ad['message']=_0x5e7ecf['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x8705('0x52')]({'where':{'id':_0x5e7ecf[_0x8705('0x5f')]}});}return null;})[_0x8705('0x1d')](handleEntityNotFound(_0x20726a,null))[_0x8705('0x1d')](function(_0x5a2d13){if(_0x5a2d13){return _0x5a2d13['update']({'UserId':_0x12ee28[_0x8705('0x54')][_0x8705('0x5c')],'read1stAt':_[_0x8705('0x60')](_0x5a2d13[_0x8705('0x61')])?moment()['format'](_0x8705('0x5b')):undefined});}return null;})[_0x8705('0x1d')](function(_0x1bf7dd){if(_0x1bf7dd){_0x50a0ad['interaction']=_0x1bf7dd[_0x8705('0x62')]({'plain':!![]});interaction_log['info'](_0x8705('0x63'),_0x12ee28[_0x8705('0x5d')]['id'],_0x12ee28[_0x8705('0x5d')][_0x8705('0x36')],_0x12ee28[_0x8705('0x5d')][_0x8705('0x64')],_0x50a0ad[_0x8705('0x65')]['id'],_0x12ee28[_0x8705('0x54')]?JSON[_0x8705('0x22')](_0x12ee28[_0x8705('0x54')]):_0x8705('0x66'));return respondWithRpcPromise('AcceptMessage',_0x8705('0x67'),_0x50a0ad);}return null;})['then'](function(_0x43f8e0){var _0x5e29a9=_0x8705('0x68')+_0x43f8e0['message']['ContactId'];return db[_0x8705('0x69')][_0x8705('0x3e')](_0x5e29a9,{'type':db[_0x8705('0x6a')][_0x8705('0x6b')][_0x8705('0x6c')],'raw':!![]})[_0x8705('0x1d')](function(_0x35a0b1){return _0x35a0b1;});})['then'](function(_0x848d97){if(_0x848d97){_0x50a0ad[_0x8705('0x24')][_0x8705('0x6d')]=_0x848d97[0x0];if(!_0x12ee28[_0x8705('0x54')][_0x8705('0x5c')])return;return db['User'][_0x8705('0x52')]({'where':{'id':_0x12ee28[_0x8705('0x54')][_0x8705('0x5c')],'role':_0x8705('0x5e')},'attributes':['id','name','fullname','email',_0x8705('0x6e')],'raw':!![]});}return null;})['then'](function(_0x30ed58){if(!_0x30ed58)return null;_0x50a0ad[_0x8705('0x24')][_0x8705('0x5e')]=_0x30ed58;return _0x50a0ad;})['then'](function(_0x44d58c){if(_0x44d58c){if(_0x12ee28['body'][_0x8705('0x6f')]){_0x50a0ad[_0x8705('0x24')]['interface']=util[_0x8705('0x5a')]('SIP/%s',_0x12ee28[_0x8705('0x5d')][_0x8705('0x36')]);_0x50a0ad[_0x8705('0x24')]['channel']=_0x50a0ad[_0x8705('0x70')];_0x50a0ad[_0x8705('0x24')]['motionChannel']=_0x50a0ad['channel'];_0x50a0ad[_0x8705('0x24')]['event']=_0x8705('0x71');return respondWithRpcPromise(_0x8705('0x72'),_0x8705('0x72'),{'event':'acceptmessage','message':_0x50a0ad[_0x8705('0x24')]},client9002)[_0x8705('0x1d')](function(){return _0x50a0ad;});}return _0x50a0ad;}return null;})[_0x8705('0x1d')](respondWithResult(_0x20726a,null))[_0x8705('0x26')](handleError(_0x20726a,null));};var interaction_log=require(_0x8705('0x10'))('openchannel-interactions');exports['reject']=function(_0x12d766,_0x2b49e3,_0x2b3a83){var _0x5f25d3={'agent':{},'channel':'openchannel'};if(_0x12d766[_0x8705('0x54')]['id']){delete _0x12d766[_0x8705('0x54')]['id'];}_0x12d766['body'][_0x8705('0x5c')]=_0x12d766[_0x8705('0x54')]['UserId']||_0x12d766[_0x8705('0x5d')]['id'];_0x5f25d3[_0x8705('0x5e')]['id']=_0x12d766[_0x8705('0x54')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x12d766[_0x8705('0x55')]['id'],'UserId':null}})[_0x8705('0x1d')](handleEntityNotFound(_0x2b49e3,null))[_0x8705('0x1d')](function(_0x49cc66){if(_0x49cc66){_0x5f25d3[_0x8705('0x24')]=_0x49cc66[_0x8705('0x62')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x49cc66[_0x8705('0x5f')]}});}return null;})[_0x8705('0x1d')](handleEntityNotFound(_0x2b49e3,null))[_0x8705('0x1d')](function(_0x1ac176){if(_0x1ac176){_0x5f25d3[_0x8705('0x65')]=_0x1ac176['get']({'plain':!![]});interaction_log['info'](_0x8705('0x73'),_0x12d766[_0x8705('0x5d')]['id'],_0x12d766['user'][_0x8705('0x36')],_0x12d766[_0x8705('0x5d')][_0x8705('0x64')],_0x5f25d3[_0x8705('0x65')]['id'],_0x12d766[_0x8705('0x54')]?JSON['stringify'](_0x12d766[_0x8705('0x54')]):'null');return respondWithRpcPromise(_0x8705('0x74'),_0x8705('0x75'),_0x5f25d3);}return null;})['then'](function(_0x52e40d){var _0x35d764=_0x8705('0x68')+_0x52e40d['message']['ContactId'];return db[_0x8705('0x69')][_0x8705('0x3e')](_0x35d764,{'type':db['Sequelize'][_0x8705('0x6b')][_0x8705('0x6c')],'raw':!![]})[_0x8705('0x1d')](function(_0x482b8c){return _0x482b8c;});})[_0x8705('0x1d')](function(_0x283508){if(_0x283508){_0x5f25d3['message'][_0x8705('0x6d')]=_0x283508[0x0];if(!_0x12d766['body']['UserId'])return;return db[_0x8705('0x76')][_0x8705('0x52')]({'where':{'id':_0x12d766[_0x8705('0x54')][_0x8705('0x5c')],'role':_0x8705('0x5e')},'attributes':['id','name','fullname','email',_0x8705('0x6e')],'raw':!![]});}return null;})[_0x8705('0x1d')](function(_0x44b172){if(!_0x44b172)return null;_0x5f25d3[_0x8705('0x24')]['agent']=_0x44b172;return _0x5f25d3;})['then'](function(_0x51e3cc){if(_0x51e3cc){_0x51e3cc[_0x8705('0x24')][_0x8705('0x77')]=util[_0x8705('0x5a')](_0x8705('0x78'),_0x12d766[_0x8705('0x5d')][_0x8705('0x36')]);_0x51e3cc['message'][_0x8705('0x70')]=_0x5f25d3[_0x8705('0x70')];_0x51e3cc[_0x8705('0x24')][_0x8705('0x79')]=_0x5f25d3[_0x8705('0x70')];_0x51e3cc[_0x8705('0x24')][_0x8705('0x7a')]='reject';respondWithRpcPromise(_0x8705('0x72'),'EventManager',{'event':_0x8705('0x7b'),'message':_0x51e3cc[_0x8705('0x24')]},client9002);return _0x5f25d3;}return null;})[_0x8705('0x1d')](respondWithResult(_0x2b49e3,null))[_0x8705('0x26')](handleError(_0x2b49e3,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index a84104a..d6b8f01 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 _0xb92a=['hasOwnProperty','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x42ae56,_0x250a63){var _0x40a881=function(_0x928d25){while(--_0x928d25){_0x42ae56['push'](_0x42ae56['shift']());}};_0x40a881(++_0x250a63);}(_0xb92a,0x101));var _0xab92=function(_0xb2fc8e,_0x451994){_0xb2fc8e=_0xb2fc8e-0x0;var _0x5a38c2=_0xb92a[_0xb2fc8e];return _0x5a38c2;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xab92('0x0'))['db'][_0xab92('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xab92('0x2')](0x0);var events={'afterCreate':_0xab92('0x3'),'afterUpdate':_0xab92('0x4'),'afterDestroy':_0xab92('0x5')};function emitEvent(_0x261583){return function(_0x196da7,_0x389449,_0x5bb103){OpenchannelMessageEvents[_0xab92('0x6')](_0x261583+':'+_0x196da7['id'],_0x196da7);OpenchannelMessageEvents[_0xab92('0x6')](_0x261583,_0x196da7);_0x5bb103(null);};}for(var e in events){if(events[_0xab92('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xbb63=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbb63,0x11d));var _0x3bb6=function(_0x1d5d94,_0x2588a8){_0x1d5d94=_0x1d5d94-0x0;var _0x4b7fb0=_0xbb63[_0x1d5d94];return _0x4b7fb0;};'use strict';var EventEmitter=require(_0x3bb6('0x0'));var OpenchannelMessage=require(_0x3bb6('0x1'))['db'][_0x3bb6('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3bb6('0x3')](0x0);var events={'afterCreate':_0x3bb6('0x4'),'afterUpdate':'update','afterDestroy':_0x3bb6('0x5')};function emitEvent(_0x116ba2){return function(_0x4aaa0f,_0xd8150a,_0x16ff7d){OpenchannelMessageEvents[_0x3bb6('0x6')](_0x116ba2+':'+_0x4aaa0f['id'],_0x4aaa0f);OpenchannelMessageEvents['emit'](_0x116ba2,_0x4aaa0f);_0x16ff7d(null);};}for(var e in events){if(events[_0x3bb6('0x7')](e)){var event=events[e];OpenchannelMessage[_0x3bb6('0x8')](e,emitEvent(event));}}module[_0x3bb6('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 36c258f..3227345 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 _0x6173=['Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','Contact','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','replyUri','info','format'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x6173,0x1d8));var _0x3617=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6173[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x3617('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3617('0x1'));var moment=require(_0x3617('0x2'));var BPromise=require(_0x3617('0x3'));var rp=require(_0x3617('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3617('0x5'));var config=require(_0x3617('0x6'));var attributes=require(_0x3617('0x7'));module[_0x3617('0x8')]=function(_0x4b0b15,_0x2b8a93){return _0x4b0b15[_0x3617('0x9')](_0x3617('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x3617('0xb'),'fields':[_0x3617('0xc')],'type':_0x3617('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ab28e,_0x39da3d,_0x2677b8){var _0x300a23=_0x4b0b15[_0x3617('0xe')];var _0x47bde6=_0x2ab28e[_0x3617('0xf')]({'plain':!![]});if(_0x47bde6[_0x3617('0x10')][_0x3617('0x11')]()==='in'||_0x47bde6[_0x3617('0x10')][_0x3617('0x11')]()==='out'&&!_0x47bde6[_0x3617('0x12')]&&!_[_0x3617('0x13')](_0x47bde6['UserId'])){_0x300a23[_0x3617('0x14')][_0x3617('0x15')]({'where':{'id':_0x47bde6[_0x3617('0x16')]}})[_0x3617('0x17')](function(_0x331365){if(_0x331365){_0x331365[_0x3617('0x18')]({'lastMsgAt':_0x47bde6[_0x3617('0x19')],'lastMsgDirection':_0x47bde6[_0x3617('0x10')][_0x3617('0x11')]()});}})[_0x3617('0x1a')](function(_0x28d0b3){console[_0x3617('0x1b')](_0x28d0b3);});}if(_0x47bde6[_0x3617('0x10')]===_0x3617('0x1c')&&!_0x47bde6[_0x3617('0x12')]){var _0x398fae;_0x300a23[_0x3617('0x1d')][_0x3617('0x1e')]()[_0x3617('0x17')](function(_0x245594){return _0x300a23[_0x3617('0x1f')][_0x3617('0x20')]({'where':{'id':_0x47bde6[_0x3617('0x21')]},'include':[{'model':_0x300a23[_0x3617('0x14')],'as':_0x3617('0x22'),'where':{'id':_0x47bde6['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x300a23[_0x3617('0x1d')],'as':'Contact','attributes':_['keys'](_0x245594)}]}]});})['then'](function(_0x3bff19){_0x398fae=_0x3bff19[_0x3617('0xf')]({'plain':!![]});if(_0x398fae&&_0x398fae[_0x3617('0x23')]){logger[_0x3617('0x24')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x3617('0x25')](_0x3617('0x26'),_0x47bde6['id'],_0x398fae[_0x3617('0x23')]));if(_0x398fae[_0x3617('0x22')]&&_0x398fae[_0x3617('0x22')]['length']){_0x47bde6[_0x3617('0x27')]=_[_0x3617('0x28')](_0x398fae['Interactions'][0x0],_0x3617('0x29'));_0x47bde6[_0x3617('0x29')]=_0x398fae[_0x3617('0x22')][0x0]['Contact'];}var _0x39da3d={'method':_0x3617('0x2a'),'uri':encodeURI(_0x398fae[_0x3617('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x39da3d[_0x3617('0x2b')]){case _0x3617('0x2c'):_0x39da3d['qs']=_0x47bde6;break;case _0x3617('0x2a'):_0x39da3d[_0x3617('0xc')]=_0x47bde6;break;}return rp(_0x39da3d)[_0x3617('0x17')](function(_0x5a8d7c){logger[_0x3617('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x3617('0x2d'),util[_0x3617('0x25')](_0x3617('0x2e'),_0x47bde6['id'],_0x398fae[_0x3617('0x23')]));if(_0x5a8d7c[_0x3617('0xc')][_0x3617('0x2f')]&&_0x5a8d7c['body'][_0x3617('0x2f')]!=_0x47bde6[_0x3617('0x27')]['threadId']){return _0x300a23[_0x3617('0x14')][_0x3617('0x18')]({'threadId':_0x5a8d7c[_0x3617('0xc')]['threadId']},{'where':{'id':_0x47bde6['Interaction']['id']}});}else{return;}})[_0x3617('0x17')](function(){return _0x2ab28e[_0x3617('0x18')]({'read':!![]});})[_0x3617('0x1a')](function(_0x3448f9){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x3617('0x30')](_0x3448f9,{'showHidden':![],'depth':null}));_0x2677b8();});}else{_0x2677b8();}})[_0x3617('0x31')](function(){_0x2677b8();});}else{_0x2677b8();}}},'charset':_0x3617('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x754e=['direction','toLowerCase','out','isNil','UserId','findOne','OpenchannelInteractionId','then','update','catch','error','secret','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','POST','format','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','get'];(function(_0x35fc62,_0x21fd86){var _0x24faf8=function(_0x21431f){while(--_0x21431f){_0x35fc62['push'](_0x35fc62['shift']());}};_0x24faf8(++_0x21fd86);}(_0x754e,0xe6));var _0xe754=function(_0x4d952,_0x1e76d9){_0x4d952=_0x4d952-0x0;var _0x19f777=_0x754e[_0x4d952];return _0x19f777;};'use strict';var _=require(_0xe754('0x0'));var util=require(_0xe754('0x1'));var logger=require(_0xe754('0x2'))(_0xe754('0x3'));var moment=require('moment');var BPromise=require(_0xe754('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe754('0x5'));var rimraf=require(_0xe754('0x6'));var config=require(_0xe754('0x7'));var attributes=require(_0xe754('0x8'));module[_0xe754('0x9')]=function(_0x3b5476,_0x16a5bc){return _0x3b5476['define'](_0xe754('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xe754('0xb'),'fields':['body'],'type':_0xe754('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46f7f8,_0x2acac5,_0x544d62){var _0xd2e327=_0x3b5476[_0xe754('0xd')];var _0x1bf8b8=_0x46f7f8[_0xe754('0xe')]({'plain':!![]});if(_0x1bf8b8[_0xe754('0xf')][_0xe754('0x10')]()==='in'||_0x1bf8b8[_0xe754('0xf')][_0xe754('0x10')]()===_0xe754('0x11')&&!_0x1bf8b8['secret']&&!_[_0xe754('0x12')](_0x1bf8b8[_0xe754('0x13')])){_0xd2e327['OpenchannelInteraction'][_0xe754('0x14')]({'where':{'id':_0x1bf8b8[_0xe754('0x15')]}})[_0xe754('0x16')](function(_0x598fee){if(_0x598fee){_0x598fee[_0xe754('0x17')]({'lastMsgAt':_0x1bf8b8['createdAt'],'lastMsgDirection':_0x1bf8b8[_0xe754('0xf')]['toLowerCase']()});}})[_0xe754('0x18')](function(_0x22fc78){console[_0xe754('0x19')](_0x22fc78);});}if(_0x1bf8b8[_0xe754('0xf')]===_0xe754('0x11')&&!_0x1bf8b8[_0xe754('0x1a')]){var _0x1c4b64;_0xd2e327[_0xe754('0x1b')][_0xe754('0x1c')]()['then'](function(_0x2cb6aa){return _0xd2e327['OpenchannelAccount'][_0xe754('0x1d')]({'where':{'id':_0x1bf8b8[_0xe754('0x1e')]},'include':[{'model':_0xd2e327[_0xe754('0x1f')],'as':_0xe754('0x20'),'where':{'id':_0x1bf8b8[_0xe754('0x15')]},'limit':0x1,'include':[{'model':_0xd2e327[_0xe754('0x1b')],'as':_0xe754('0x21'),'attributes':_['keys'](_0x2cb6aa)}]}]});})['then'](function(_0x115070){_0x1c4b64=_0x115070['get']({'plain':!![]});if(_0x1c4b64&&_0x1c4b64[_0xe754('0x22')]){logger[_0xe754('0x23')](_0xe754('0x24'),_0xe754('0x25'),util['format'](_0xe754('0x26'),_0x1bf8b8['id'],_0x1c4b64[_0xe754('0x22')]));if(_0x1c4b64[_0xe754('0x20')]&&_0x1c4b64[_0xe754('0x20')][_0xe754('0x27')]){_0x1bf8b8[_0xe754('0x28')]=_[_0xe754('0x29')](_0x1c4b64[_0xe754('0x20')][0x0],_0xe754('0x21'));_0x1bf8b8['Contact']=_0x1c4b64['Interactions'][0x0]['Contact'];}var _0x2acac5={'method':'POST','uri':encodeURI(_0x1c4b64[_0xe754('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2acac5[_0xe754('0x2a')]){case'GET':_0x2acac5['qs']=_0x1bf8b8;break;case _0xe754('0x2b'):_0x2acac5['body']=_0x1bf8b8;break;}return rp(_0x2acac5)[_0xe754('0x16')](function(_0x2f22ac){logger['info'](_0xe754('0x24'),_0xe754('0x25'),util[_0xe754('0x2c')](_0xe754('0x2d'),_0x1bf8b8['id'],_0x1c4b64[_0xe754('0x22')]));if(_0x2f22ac[_0xe754('0x2e')][_0xe754('0x2f')]&&_0x2f22ac[_0xe754('0x2e')][_0xe754('0x2f')]!=_0x1bf8b8['Interaction'][_0xe754('0x2f')]){return _0xd2e327[_0xe754('0x1f')][_0xe754('0x17')]({'threadId':_0x2f22ac[_0xe754('0x2e')][_0xe754('0x2f')]},{'where':{'id':_0x1bf8b8[_0xe754('0x28')]['id']}});}else{return;}})[_0xe754('0x16')](function(){return _0x46f7f8['update']({'read':!![]});})[_0xe754('0x18')](function(_0x10965d){logger[_0xe754('0x19')](_0xe754('0x24'),_0xe754('0x25'),util['inspect'](_0x10965d,{'showHidden':![],'depth':null}));_0x544d62();});}else{_0x544d62();}})['finally'](function(){_0x544d62();});}else{_0x544d62();}}},'charset':_0xe754('0x30'),'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 aec8d1a..844ef42 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(_0x5c63ee,_0x905a87){var _0xcd014c=function(_0x2c5f50){while(--_0x2c5f50){_0x5c63ee['push'](_0x5c63ee['shift']());}};_0xcd014c(++_0x905a87);}(_0x7a54,0x106));var _0x47a5=function(_0x5b2344,_0x143f01){_0x5b2344=_0x5b2344-0x0;var _0x57f1e7=_0x7a54[_0x5b2344];return _0x57f1e7;};'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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x483af5,_0x4a6e7a){var _0x1f6aa6=function(_0x44e479){while(--_0x44e479){_0x483af5['push'](_0x483af5['shift']());}};_0x1f6aa6(++_0x4a6e7a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 07f59ca..082794c 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 _0x16a6=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','update','emit'];(function(_0x237e43,_0x58c67a){var _0x425c48=function(_0x401380){while(--_0x401380){_0x237e43['push'](_0x237e43['shift']());}};_0x425c48(++_0x58c67a);}(_0x16a6,0x15c));var _0x616a=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x16a6[_0x628eee];return _0x447718;};'use strict';var OpenchannelMessageEvents=require(_0x616a('0x0'));var events=[_0x616a('0x1'),'remove',_0x616a('0x2')];function createListener(_0x44b602,_0x13f2fe){return function(_0x255d72){_0x13f2fe[_0x616a('0x3')](_0x44b602,_0x255d72);};}function removeListener(_0x13cbc6,_0x59fc7e){return function(){OpenchannelMessageEvents[_0x616a('0x4')](_0x13cbc6,_0x59fc7e);};}exports[_0x616a('0x5')]=function(_0x4c1641){for(var _0x56eaab=0x0,_0x938824=events[_0x616a('0x6')];_0x56eaab<_0x938824;_0x56eaab++){var _0x574141=events[_0x56eaab];var _0x4ef45c=createListener(_0x616a('0x7')+_0x574141,_0x4c1641);OpenchannelMessageEvents['on'](_0x574141,_0x4ef45c);}}; \ No newline at end of file +var _0x6003=['remove','update','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6003,0xae));var _0x3600=function(_0x598dda,_0x35a71f){_0x598dda=_0x598dda-0x0;var _0x2a9ec0=_0x6003[_0x598dda];return _0x2a9ec0;};'use strict';var OpenchannelMessageEvents=require(_0x3600('0x0'));var events=[_0x3600('0x1'),_0x3600('0x2'),_0x3600('0x3')];function createListener(_0x4f423f,_0x484cf5){return function(_0x367da4){_0x484cf5[_0x3600('0x4')](_0x4f423f,_0x367da4);};}function removeListener(_0x29c0fd,_0x47b8b3){return function(){OpenchannelMessageEvents[_0x3600('0x5')](_0x29c0fd,_0x47b8b3);};}exports[_0x3600('0x6')]=function(_0x53a557){for(var _0x2953ac=0x0,_0x4f4130=events['length'];_0x2953ac<_0x4f4130;_0x2953ac++){var _0x177f11=events[_0x2953ac];var _0x4a5962=createListener(_0x3600('0x7')+_0x177f11,_0x53a557);OpenchannelMessageEvents['on'](_0x177f11,_0x4a5962);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 312e271..ad3acd2 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 _0xe44c=['../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0xe44c,0x1d9));var _0xce44=function(_0x1adb5d,_0x1e36cc){_0x1adb5d=_0x1adb5d-0x0;var _0x3acc58=_0xe44c[_0x1adb5d];return _0x3acc58;};'use strict';var multer=require(_0xce44('0x0'));var util=require('util');var path=require(_0xce44('0x1'));var timeout=require(_0xce44('0x2'));var express=require('express');var router=express[_0xce44('0x3')]();var fs_extra=require(_0xce44('0x4'));var auth=require(_0xce44('0x5'));var interaction=require(_0xce44('0x6'));var config=require(_0xce44('0x7'));var controller=require(_0xce44('0x8'));router[_0xce44('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xce44('0x9')](_0xce44('0xa'),auth[_0xce44('0xb')](),controller[_0xce44('0xc')]);router['get'](_0xce44('0xd'),auth[_0xce44('0xb')](),controller[_0xce44('0xe')]);router['get'](_0xce44('0xf'),auth['isAuthenticated'](),controller[_0xce44('0x10')]);router[_0xce44('0x9')]('/:id/teams',auth[_0xce44('0xb')](),controller['getTeams']);router[_0xce44('0x9')](_0xce44('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0xce44('0x12')]('/',auth[_0xce44('0xb')](),controller[_0xce44('0x13')]);router[_0xce44('0x12')](_0xce44('0x14'),auth[_0xce44('0xb')](),controller[_0xce44('0x15')]);router[_0xce44('0x12')](_0xce44('0x11'),auth[_0xce44('0xb')](),controller[_0xce44('0x16')]);router[_0xce44('0x17')](_0xce44('0xd'),auth[_0xce44('0xb')](),controller[_0xce44('0x18')]);router[_0xce44('0x19')]('/:id',auth[_0xce44('0xb')](),controller[_0xce44('0x1a')]);router[_0xce44('0x19')](_0xce44('0x14'),auth[_0xce44('0xb')](),controller[_0xce44('0x1b')]);router[_0xce44('0x19')](_0xce44('0x11'),auth['isAuthenticated'](),controller[_0xce44('0x1c')]);module[_0xce44('0x1d')]=router; \ No newline at end of file +var _0xbd9d=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','path'];(function(_0x3ce23a,_0x58005e){var _0x52a4d3=function(_0x2c96c1){while(--_0x2c96c1){_0x3ce23a['push'](_0x3ce23a['shift']());}};_0x52a4d3(++_0x58005e);}(_0xbd9d,0x195));var _0xdbd9=function(_0x4e2c3b,_0xae151){_0x4e2c3b=_0x4e2c3b-0x0;var _0x39ebe1=_0xbd9d[_0x4e2c3b];return _0x39ebe1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdbd9('0x0'));var timeout=require(_0xdbd9('0x1'));var express=require(_0xdbd9('0x2'));var router=express[_0xdbd9('0x3')]();var fs_extra=require(_0xdbd9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdbd9('0x5'));var config=require(_0xdbd9('0x6'));var controller=require(_0xdbd9('0x7'));router[_0xdbd9('0x8')]('/',auth[_0xdbd9('0x9')](),controller[_0xdbd9('0xa')]);router['get'](_0xdbd9('0xb'),auth[_0xdbd9('0x9')](),controller[_0xdbd9('0xc')]);router[_0xdbd9('0x8')](_0xdbd9('0xd'),auth[_0xdbd9('0x9')](),controller[_0xdbd9('0xe')]);router['get']('/:id/members',auth[_0xdbd9('0x9')](),controller['getMembers']);router[_0xdbd9('0x8')]('/:id/teams',auth[_0xdbd9('0x9')](),controller[_0xdbd9('0xf')]);router['get'](_0xdbd9('0x10'),auth['isAuthenticated'](),controller[_0xdbd9('0x11')]);router['post']('/',auth[_0xdbd9('0x9')](),controller[_0xdbd9('0x12')]);router[_0xdbd9('0x13')](_0xdbd9('0x14'),auth[_0xdbd9('0x9')](),controller[_0xdbd9('0x15')]);router[_0xdbd9('0x13')](_0xdbd9('0x10'),auth['isAuthenticated'](),controller[_0xdbd9('0x16')]);router['put'](_0xdbd9('0xd'),auth[_0xdbd9('0x9')](),controller[_0xdbd9('0x17')]);router[_0xdbd9('0x18')](_0xdbd9('0xd'),auth[_0xdbd9('0x9')](),controller[_0xdbd9('0x19')]);router[_0xdbd9('0x18')](_0xdbd9('0x14'),auth[_0xdbd9('0x9')](),controller[_0xdbd9('0x1a')]);router[_0xdbd9('0x18')](_0xdbd9('0x10'),auth['isAuthenticated'](),controller[_0xdbd9('0x1b')]);module[_0xdbd9('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 5ff18e4..1f2266d 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 _0xf9f9=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x33b19c,_0xa44ed0){var _0x12df4d=function(_0x367ff2){while(--_0x367ff2){_0x33b19c['push'](_0x33b19c['shift']());}};_0x12df4d(++_0xa44ed0);}(_0xf9f9,0x1e6));var _0x9f9f=function(_0x19d76d,_0x16673f){_0x19d76d=_0x19d76d-0x0;var _0x47ed4e=_0xf9f9[_0x19d76d];return _0x47ed4e;};'use strict';var Sequelize=require(_0x9f9f('0x0'));module[_0x9f9f('0x1')]={'name':{'type':Sequelize[_0x9f9f('0x2')],'unique':_0x9f9f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9f9f('0x2')]},'timeout':{'type':Sequelize[_0x9f9f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9f9f('0x5')](_0x9f9f('0x6'),_0x9f9f('0x7'),_0x9f9f('0x8'))}}; \ No newline at end of file +var _0x9936=['STRING','name','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x582a0c,_0x165658){var _0x2384b6=function(_0x428bfa){while(--_0x428bfa){_0x582a0c['push'](_0x582a0c['shift']());}};_0x2384b6(++_0x165658);}(_0x9936,0x1e8));var _0x6993=function(_0x4cffbd,_0xa37adc){_0x4cffbd=_0x4cffbd-0x0;var _0x36a7fc=_0x9936[_0x4cffbd];return _0x36a7fc;};'use strict';var Sequelize=require(_0x6993('0x0'));module[_0x6993('0x1')]={'name':{'type':Sequelize[_0x6993('0x2')],'unique':_0x6993('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6993('0x4')]('rrmemory',_0x6993('0x5'),_0x6993('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 85a0381..286033a 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 _0x0564=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','OpenchannelQueues','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','merge','filter','options','OpenchannelQueue','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','UserId','updatedAt','SIP','openchannelPause','getTeams','findOne','hasOwnProperty','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','removeTeams','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','forEach','userOpenchannelQueue:remove','addAgents','omit','removeAgents','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x5acec9,_0x3b79d6){var _0x25e0aa=function(_0xc36c18){while(--_0xc36c18){_0x5acec9['push'](_0x5acec9['shift']());}};_0x25e0aa(++_0x3b79d6);}(_0x0564,0x187));var _0x4056=function(_0x407443,_0x3ac901){_0x407443=_0x407443-0x0;var _0x3e558a=_0x0564[_0x407443];return _0x3e558a;};'use strict';var emlformat=require(_0x4056('0x0'));var rimraf=require(_0x4056('0x1'));var zipdir=require(_0x4056('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4056('0x3'));var Mustache=require(_0x4056('0x4'));var util=require('util');var path=require(_0x4056('0x5'));var sox=require(_0x4056('0x6'));var csv=require(_0x4056('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4056('0x8'));var _=require(_0x4056('0x9'));var squel=require(_0x4056('0xa'));var crypto=require(_0x4056('0xb'));var jsforce=require(_0x4056('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4056('0xd'));var Papa=require(_0x4056('0xe'));var Redis=require('ioredis');var authService=require(_0x4056('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4056('0x10'));var hardwareService=require(_0x4056('0x11'));var logger=require(_0x4056('0x12'))('api');var utils=require(_0x4056('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4056('0x14'));var db=require(_0x4056('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4056('0x16'),'port':0x18eb});var socket=require(_0x4056('0x17'))(new Redis(config[_0x4056('0x18')]));require('./openchannelQueue.socket')[_0x4056('0x19')](socket);function respondWithStatusCode(_0x30bf63,_0x247730){_0x247730=_0x247730||0xcc;return function(_0x2dac97){if(_0x2dac97){return _0x30bf63[_0x4056('0x1a')](_0x247730);}return _0x30bf63['status'](_0x247730)[_0x4056('0x1b')]();};}function respondWithResult(_0x57eefd,_0x1b43b3){_0x1b43b3=_0x1b43b3||0xc8;return function(_0x5c0569){if(_0x5c0569){return _0x57eefd[_0x4056('0x1c')](_0x1b43b3)[_0x4056('0x1d')](_0x5c0569);}};}function respondWithFilteredResult(_0x5dafcc,_0x4280f9){return function(_0x847f6d){if(_0x847f6d){var _0x23f9b4=typeof _0x4280f9[_0x4056('0x1e')]==='undefined'&&typeof _0x4280f9[_0x4056('0x1f')]===_0x4056('0x20');var _0xdc46c7=_0x847f6d[_0x4056('0x21')];var _0x2cccf8=_0x23f9b4?0x0:_0x4280f9[_0x4056('0x1e')];var _0x377b34=_0x23f9b4?_0x847f6d[_0x4056('0x21')]:_0x4280f9[_0x4056('0x1e')]+_0x4280f9[_0x4056('0x1f')];var _0x242eba;if(_0x377b34>=_0xdc46c7){_0x377b34=_0xdc46c7;_0x242eba=0xc8;}else{_0x242eba=0xce;}_0x5dafcc[_0x4056('0x1c')](_0x242eba);return _0x5dafcc[_0x4056('0x22')](_0x4056('0x23'),_0x2cccf8+'-'+_0x377b34+'/'+_0xdc46c7)[_0x4056('0x1d')](_0x847f6d);}return null;};}function patchUpdates(_0x122cb4){return function(_0xc18f2c){try{jsonpatch[_0x4056('0x24')](_0xc18f2c,_0x122cb4,!![]);}catch(_0x10c761){return BPromise[_0x4056('0x25')](_0x10c761);}return _0xc18f2c[_0x4056('0x26')]();};}function saveUpdates(_0x39233e,_0x315b28){return function(_0x204607){if(_0x204607){return _0x204607['update'](_0x39233e)['then'](function(_0x138abf){return _0x138abf;});}return null;};}function removeEntity(_0x36888c,_0x36a144){return function(_0x47de23){if(_0x47de23){return _0x47de23[_0x4056('0x27')]()[_0x4056('0x28')](function(){var _0x1a8db6=_0x47de23[_0x4056('0x29')]({'plain':!![]});var _0x2e70d2=_0x4056('0x2a');return db['UserProfileResource'][_0x4056('0x27')]({'where':{'type':_0x2e70d2,'resourceId':_0x1a8db6['id']}})[_0x4056('0x28')](function(){return _0x47de23;});})[_0x4056('0x28')](function(){_0x36888c[_0x4056('0x1c')](0xcc)[_0x4056('0x1b')]();});}};}function handleEntityNotFound(_0x4a11fd,_0x327638){return function(_0xbb279f){if(!_0xbb279f){_0x4a11fd['sendStatus'](0x194);}return _0xbb279f;};}function handleError(_0x5c8d19,_0xc0ebbb){_0xc0ebbb=_0xc0ebbb||0x1f4;return function(_0x8716cd){logger[_0x4056('0x2b')](_0x8716cd[_0x4056('0x2c')]);if(_0x8716cd[_0x4056('0x2d')]){delete _0x8716cd[_0x4056('0x2d')];}_0x5c8d19[_0x4056('0x1c')](_0xc0ebbb)[_0x4056('0x2e')](_0x8716cd);};}exports['index']=function(_0x5076c5,_0x31b335){var _0x47a648={},_0x118940={},_0x442127={'count':0x0,'rows':[]};var _0x39dbac=_['map'](db['OpenchannelQueue'][_0x4056('0x2f')],function(_0x5b2906){return{'name':_0x5b2906[_0x4056('0x30')],'type':_0x5b2906[_0x4056('0x31')][_0x4056('0x32')]};});_0x118940['model']=_[_0x4056('0x33')](_0x39dbac,_0x4056('0x2d'));_0x118940['query']=_[_0x4056('0x34')](_0x5076c5[_0x4056('0x35')]);_0x118940[_0x4056('0x36')]=_[_0x4056('0x37')](_0x118940[_0x4056('0x38')],_0x118940[_0x4056('0x35')]);_0x47a648[_0x4056('0x39')]=_[_0x4056('0x37')](_0x118940[_0x4056('0x38')],qs[_0x4056('0x3a')](_0x5076c5['query'][_0x4056('0x3a')]));_0x47a648[_0x4056('0x39')]=_0x47a648[_0x4056('0x39')][_0x4056('0x3b')]?_0x47a648['attributes']:_0x118940[_0x4056('0x38')];if(!_0x5076c5['query']['hasOwnProperty'](_0x4056('0x3c'))){_0x47a648[_0x4056('0x1f')]=qs[_0x4056('0x1f')](_0x5076c5[_0x4056('0x35')]['limit']);_0x47a648['offset']=qs[_0x4056('0x1e')](_0x5076c5['query']['offset']);}_0x47a648[_0x4056('0x3d')]=qs[_0x4056('0x3e')](_0x5076c5[_0x4056('0x35')][_0x4056('0x3e')]);_0x47a648['where']=qs[_0x4056('0x36')](_[_0x4056('0x3f')](_0x5076c5[_0x4056('0x35')],_0x118940[_0x4056('0x36')]),_0x39dbac);if(_0x5076c5['query']['filter']){_0x47a648[_0x4056('0x40')]=_[_0x4056('0x41')](_0x47a648[_0x4056('0x40')],{'$or':_[_0x4056('0x33')](_0x39dbac,function(_0x2feb01){if(_0x2feb01[_0x4056('0x31')]!=='VIRTUAL'){var _0x43476f={};_0x43476f[_0x2feb01['name']]={'$like':'%'+_0x5076c5[_0x4056('0x35')][_0x4056('0x42')]+'%'};return _0x43476f;}})});}_0x47a648=_[_0x4056('0x41')]({},_0x47a648,_0x5076c5[_0x4056('0x43')]);var _0x20c06c={'where':_0x47a648[_0x4056('0x40')]};return db[_0x4056('0x44')]['count'](_0x20c06c)[_0x4056('0x28')](function(_0x353617){_0x442127['count']=_0x353617;if(_0x5076c5['query'][_0x4056('0x45')]){_0x47a648[_0x4056('0x46')]=[{'all':!![]}];}return db[_0x4056('0x44')]['findAll'](_0x47a648);})[_0x4056('0x28')](function(_0x26a694){_0x442127[_0x4056('0x47')]=_0x26a694;return _0x442127;})[_0x4056('0x28')](respondWithFilteredResult(_0x31b335,_0x47a648))[_0x4056('0x48')](handleError(_0x31b335,null));};exports['show']=function(_0x3d024c,_0x5939c5){var _0x552641={'raw':!![],'where':{'id':_0x3d024c[_0x4056('0x49')]['id']}},_0x51f145={};_0x51f145[_0x4056('0x38')]=_['keys'](db[_0x4056('0x44')][_0x4056('0x2f')]);_0x51f145[_0x4056('0x35')]=_[_0x4056('0x34')](_0x3d024c[_0x4056('0x35')]);_0x51f145[_0x4056('0x36')]=_[_0x4056('0x37')](_0x51f145[_0x4056('0x38')],_0x51f145[_0x4056('0x35')]);_0x552641[_0x4056('0x39')]=_[_0x4056('0x37')](_0x51f145[_0x4056('0x38')],qs[_0x4056('0x3a')](_0x3d024c[_0x4056('0x35')][_0x4056('0x3a')]));_0x552641[_0x4056('0x39')]=_0x552641[_0x4056('0x39')][_0x4056('0x3b')]?_0x552641['attributes']:_0x51f145['model'];if(_0x3d024c[_0x4056('0x35')][_0x4056('0x45')]){_0x552641[_0x4056('0x46')]=[{'all':!![]}];}_0x552641=_['merge']({},_0x552641,_0x3d024c[_0x4056('0x43')]);return db[_0x4056('0x44')][_0x4056('0x4a')](_0x552641)[_0x4056('0x28')](handleEntityNotFound(_0x5939c5,null))[_0x4056('0x28')](respondWithResult(_0x5939c5,null))[_0x4056('0x48')](handleError(_0x5939c5,null));};exports[_0x4056('0x4b')]=function(_0xa7b6b4,_0x17f355){return db[_0x4056('0x44')][_0x4056('0x4b')](_0xa7b6b4[_0x4056('0x4c')],{})['then'](function(_0x214759){var _0x25f3c8=_0xa7b6b4[_0x4056('0x4d')][_0x4056('0x29')]({'plain':!![]});if(!_0x25f3c8)throw new Error(_0x4056('0x4e'));if(_0x25f3c8[_0x4056('0x4f')]===_0x4056('0x4d')){var _0x300ce4=_0x214759[_0x4056('0x29')]({'plain':!![]});var _0x7f8e03=_0x4056('0x2a');return db[_0x4056('0x50')][_0x4056('0x4a')]({'where':{'name':_0x7f8e03,'userProfileId':_0x25f3c8[_0x4056('0x51')]},'raw':!![]})['then'](function(_0x114ef2){if(_0x114ef2&&_0x114ef2[_0x4056('0x52')]===0x0){return db[_0x4056('0x53')][_0x4056('0x4b')]({'name':_0x300ce4[_0x4056('0x2d')],'resourceId':_0x300ce4['id'],'type':_0x114ef2['name'],'sectionId':_0x114ef2['id']},{})[_0x4056('0x28')](function(){return _0x214759;});}else{return _0x214759;}})['catch'](function(_0x4ddd7d){logger['error'](_0x4056('0x54'),_0x4ddd7d);throw _0x4ddd7d;});}return _0x214759;})[_0x4056('0x28')](respondWithResult(_0x17f355,0xc9))[_0x4056('0x48')](handleError(_0x17f355,null));};exports[_0x4056('0x55')]=function(_0x54f7e1,_0x5074c4){if(_0x54f7e1[_0x4056('0x4c')]['id']){delete _0x54f7e1['body']['id'];}return db['OpenchannelQueue'][_0x4056('0x4a')]({'where':{'id':_0x54f7e1[_0x4056('0x49')]['id']}})['then'](handleEntityNotFound(_0x5074c4,null))[_0x4056('0x28')](saveUpdates(_0x54f7e1[_0x4056('0x4c')],null))['then'](respondWithResult(_0x5074c4,null))[_0x4056('0x48')](handleError(_0x5074c4,null));};exports[_0x4056('0x27')]=function(_0x11f1d4,_0x162716){return db[_0x4056('0x44')][_0x4056('0x4a')]({'where':{'id':_0x11f1d4[_0x4056('0x49')]['id']}})['then'](handleEntityNotFound(_0x162716,null))[_0x4056('0x28')](removeEntity(_0x162716,null))[_0x4056('0x48')](handleError(_0x162716,null));};exports[_0x4056('0x56')]=function(_0x557140,_0x345939){return db['OpenchannelQueue'][_0x4056('0x56')]()[_0x4056('0x28')](respondWithResult(_0x345939,null))['catch'](handleError(_0x345939,null));};exports['getMembers']=function(_0x92a370,_0x2ae7df,_0x289f08){var _0x434fc7={'raw':!![],'where':{}},_0x4b0143={},_0x245d86;return db[_0x4056('0x44')]['findOne']({'where':{'id':_0x92a370['params']['id']}})[_0x4056('0x28')](handleEntityNotFound(_0x2ae7df,null))[_0x4056('0x28')](function(_0x4a4320){if(_0x4a4320){_0x245d86=_0x4a4320[_0x4056('0x29')]({'plain':!![]});_0x4b0143[_0x4056('0x38')]=_[_0x4056('0x34')](db[_0x4056('0x57')][_0x4056('0x2f')]);_0x4b0143['query']=_[_0x4056('0x34')](_0x92a370[_0x4056('0x35')]);_0x4b0143[_0x4056('0x36')]=_[_0x4056('0x37')](_0x4b0143[_0x4056('0x38')],_0x4b0143[_0x4056('0x35')]);_0x434fc7[_0x4056('0x39')]=_[_0x4056('0x37')](_0x4b0143[_0x4056('0x38')],qs[_0x4056('0x3a')](_0x92a370[_0x4056('0x35')][_0x4056('0x3a')]));_0x434fc7[_0x4056('0x39')]=_0x434fc7[_0x4056('0x39')]['length']?_0x434fc7[_0x4056('0x39')]:_0x4b0143[_0x4056('0x38')];if(!_0x92a370['query']['hasOwnProperty'](_0x4056('0x3c'))){_0x434fc7[_0x4056('0x1f')]=qs[_0x4056('0x1f')](_0x92a370[_0x4056('0x35')][_0x4056('0x1f')]);_0x434fc7[_0x4056('0x1e')]=qs[_0x4056('0x1e')](_0x92a370[_0x4056('0x35')][_0x4056('0x1e')]);}_0x434fc7[_0x4056('0x3d')]=qs[_0x4056('0x3e')](_0x92a370[_0x4056('0x35')][_0x4056('0x3e')]);_0x434fc7[_0x4056('0x40')]=qs[_0x4056('0x36')](_[_0x4056('0x3f')](_0x92a370['query'],_0x4b0143[_0x4056('0x36')]));_0x434fc7[_0x4056('0x40')][_0x4056('0x58')]=_0x4a4320['id'];if(_0x92a370['query'][_0x4056('0x42')]){_0x434fc7[_0x4056('0x40')]=_['merge'](_0x434fc7[_0x4056('0x40')],{'$or':_['map'](_0x434fc7['attributes'],function(_0x2dcd3f){var _0x5149a9={};_0x5149a9[_0x2dcd3f]={'$like':'%'+_0x92a370[_0x4056('0x35')][_0x4056('0x42')]+'%'};return _0x5149a9;})});}_0x434fc7=_[_0x4056('0x41')]({},_0x434fc7,_0x92a370[_0x4056('0x43')]);return db[_0x4056('0x57')][_0x4056('0x59')](_0x434fc7);}})[_0x4056('0x28')](function(_0x507de0){if(_0x507de0){return db[_0x4056('0x5a')]['findAndCountAll']({'where':{'id':_['map'](_0x507de0,_0x4056('0x5b')),'role':'agent'},'attributes':['id','name','openchannelPause',_0x4056('0x5c'),'createdAt']});}})[_0x4056('0x28')](function(_0x47ff2b){if(_0x47ff2b){return{'count':_0x47ff2b['count'],'rows':_['map'](_0x47ff2b[_0x4056('0x47')],function(_0x5fe38f){return{'membername':_0x5fe38f[_0x4056('0x2d')],'UserId':_0x5fe38f['id'],'queue_name':_0x245d86[_0x4056('0x2d')],'OpenchannelQueueId':_0x245d86['id'],'interface':util['format']('%s/%s',_0x4056('0x5d'),_0x5fe38f[_0x4056('0x2d')]),'penalty':0x0,'paused':_0x5fe38f[_0x4056('0x5e')],'createdAt':_0x5fe38f['createdAt'],'updatedAt':_0x5fe38f[_0x4056('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4056('0x28')](respondWithFilteredResult(_0x2ae7df,_0x434fc7))[_0x4056('0x48')](handleError(_0x2ae7df,null));};exports[_0x4056('0x5f')]=function(_0x3029a4,_0x9c6f8d,_0x476a25){var _0x215876={};var _0x1c9870={};var _0x258090;var _0x15ef52;return db[_0x4056('0x44')][_0x4056('0x60')]({'where':{'id':_0x3029a4[_0x4056('0x49')]['id']}})[_0x4056('0x28')](handleEntityNotFound(_0x9c6f8d,null))[_0x4056('0x28')](function(_0x38fc9f){if(_0x38fc9f){_0x258090=_0x38fc9f;_0x1c9870[_0x4056('0x38')]=_['keys'](db['Team'][_0x4056('0x2f')]);_0x1c9870[_0x4056('0x35')]=_[_0x4056('0x34')](_0x3029a4[_0x4056('0x35')]);_0x1c9870['filters']=_[_0x4056('0x37')](_0x1c9870['model'],_0x1c9870[_0x4056('0x35')]);_0x215876[_0x4056('0x39')]=_[_0x4056('0x37')](_0x1c9870[_0x4056('0x38')],qs[_0x4056('0x3a')](_0x3029a4[_0x4056('0x35')][_0x4056('0x3a')]));_0x215876[_0x4056('0x39')]=_0x215876['attributes'][_0x4056('0x3b')]?_0x215876[_0x4056('0x39')]:_0x1c9870['model'];_0x215876[_0x4056('0x3d')]=qs[_0x4056('0x3e')](_0x3029a4[_0x4056('0x35')][_0x4056('0x3e')]);_0x215876[_0x4056('0x40')]=qs[_0x4056('0x36')](_[_0x4056('0x3f')](_0x3029a4[_0x4056('0x35')],_0x1c9870['filters']));if(_0x3029a4['query'][_0x4056('0x42')]){_0x215876[_0x4056('0x40')]=_['merge'](_0x215876[_0x4056('0x40')],{'$or':_[_0x4056('0x33')](_0x215876['attributes'],function(_0x5ce6d0){var _0x20ad99={};_0x20ad99[_0x5ce6d0]={'$like':'%'+_0x3029a4[_0x4056('0x35')][_0x4056('0x42')]+'%'};return _0x20ad99;})});}_0x215876=_[_0x4056('0x41')]({},_0x215876,_0x3029a4[_0x4056('0x43')]);return _0x258090['getTeams'](_0x215876);}})['then'](function(_0x31a28c){if(_0x31a28c){_0x15ef52=_0x31a28c[_0x4056('0x3b')];if(!_0x3029a4[_0x4056('0x35')][_0x4056('0x61')](_0x4056('0x3c'))){_0x215876['limit']=qs[_0x4056('0x1f')](_0x3029a4[_0x4056('0x35')][_0x4056('0x1f')]);_0x215876['offset']=qs['offset'](_0x3029a4[_0x4056('0x35')]['offset']);}return _0x258090[_0x4056('0x5f')](_0x215876);}})[_0x4056('0x28')](function(_0x56ee58){if(_0x56ee58){return _0x56ee58?{'count':_0x15ef52,'rows':_0x56ee58}:null;}})[_0x4056('0x28')](respondWithResult(_0x9c6f8d,null))[_0x4056('0x48')](handleError(_0x9c6f8d,null));};exports[_0x4056('0x62')]=function(_0x232fe7,_0x3194ef,_0x417d65){var _0x30033b=_0x232fe7['body'][_0x4056('0x63')];return db[_0x4056('0x64')][_0x4056('0x59')]({'where':{'id':_0x30033b},'attributes':['id'],'include':[{'model':db[_0x4056('0x5a')],'as':_0x4056('0x65'),'attributes':['id',_0x4056('0x2d'),_0x4056('0x66'),_0x4056('0x67'),_0x4056('0x68')],'raw':!![]}]})[_0x4056('0x28')](function(_0x315ca2){if(_0x315ca2){var _0x505da2=_[_0x4056('0x69')](_0x315ca2,function(_0x133f47){var _0x22255e=_0x133f47[_0x4056('0x29')]({'plain':!![]});return _0x22255e['Agents'];});return db[_0x4056('0x44')]['find']({'where':{'id':_0x232fe7[_0x4056('0x49')]['id']}})[_0x4056('0x28')](function(_0x5882ce){return db[_0x4056('0x6a')][_0x4056('0x6b')](function(_0xec2460){return _0x5882ce[_0x4056('0x62')](_0x30033b,{'transaction':_0xec2460})[_0x4056('0x28')](function(){return BPromise['each'](_0x505da2,function(_0x46d8b1){return db[_0x4056('0x57')][_0x4056('0x6c')]({'where':{'UserId':_0x46d8b1['id'],'OpenchannelQueueId':_0x232fe7[_0x4056('0x49')]['id']},'transaction':_0xec2460});});})['then'](function(){_0x505da2['forEach'](function(_0x1a602d){socket[_0x4056('0x6d')]('userOpenchannelQueue:save',{'UserId':_0x1a602d['id'],'OpenchannelQueueId':_0x5882ce['id']});});});});});}})[_0x4056('0x28')](respondWithStatusCode(_0x3194ef,null))[_0x4056('0x48')](handleError(_0x3194ef,null));};exports[_0x4056('0x6e')]=function(_0x1faf4e,_0x56980e,_0x5db520){return db[_0x4056('0x64')][_0x4056('0x59')]({'where':{'id':_0x1faf4e[_0x4056('0x35')][_0x4056('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4056('0x65'),'attributes':['id'],'raw':!![]}]})[_0x4056('0x28')](handleEntityNotFound(_0x56980e,null))[_0x4056('0x28')](function(_0x594094){var _0x21fa1f=_[_0x4056('0x33')](_0x594094,'id');var _0x4440bf=[];var _0x4d1cc8=[];var _0x9c5e23=squel['select']();_0x9c5e23['field']('tq.TeamId')[_0x4056('0x6f')](_0x4056('0x70'),'tq')[_0x4056('0x71')](_0x4056('0x72'),'ut',_0x4056('0x73'))[_0x4056('0x40')](_0x4056('0x74'),_0x1faf4e[_0x4056('0x49')]['id']);for(var _0x18c818=0x0;_0x18c818<_0x594094['length'];_0x18c818+=0x1){let _0x4b3461=_0x594094[_0x18c818];for(var _0x221d52=0x0;_0x221d52<_0x4b3461[_0x4056('0x65')]['length'];_0x221d52+=0x1){let _0x442d42=_0x4b3461['Agents'][_0x221d52];var _0x196160=_0x9c5e23[_0x4056('0x75')]();_0x196160['where'](_0x4056('0x76'),_0x442d42['id']);_0x4d1cc8[_0x4056('0x77')](db['sequelize'][_0x4056('0x35')](_0x196160[_0x4056('0x78')](),{'type':db[_0x4056('0x6a')]['QueryTypes'][_0x4056('0x79')]})['then'](function(_0x581cc4){if(_0x581cc4[_0x4056('0x3b')]===0x1){return _0x442d42['id'];}else{var _0xfec67c=_[_0x4056('0x7a')](_[_0x4056('0x33')](_0x581cc4,_0x4056('0x7b')),function(_0x536ece){return _[_0x4056('0x7c')](_0x21fa1f,_0x536ece);});if(_0xfec67c){return _0x442d42['id'];}}}));}}return BPromise[_0x4056('0x7d')](_0x4d1cc8)[_0x4056('0x28')](function(_0xd55cfc){_0x4440bf=_(_0x4440bf)[_0x4056('0x7e')](_0xd55cfc)[_0x4056('0x7f')]()[_0x4056('0x80')]();return db['OpenchannelQueue'][_0x4056('0x4a')]({'where':{'id':_0x1faf4e['params']['id']}})[_0x4056('0x28')](function(_0x55cb3f){return db[_0x4056('0x6a')][_0x4056('0x6b')](function(_0x532d42){return _0x55cb3f[_0x4056('0x6e')](_0x1faf4e[_0x4056('0x35')][_0x4056('0x63')],{'transaction':_0x532d42})['then'](function(){if(!_['isEmpty'](_0x4440bf)){return _0x55cb3f['removeAgents'](_0x4440bf,{'transaction':_0x532d42});}})[_0x4056('0x28')](function(){_0x4440bf[_0x4056('0x81')](function(_0x580f28){socket[_0x4056('0x6d')](_0x4056('0x82'),{'UserId':_0x580f28,'OpenchannelQueueId':_0x55cb3f['id']});});});});});});})['then'](respondWithStatusCode(_0x56980e,null))['catch'](handleError(_0x56980e,null));};exports[_0x4056('0x83')]=function(_0x139353,_0x5e5f81,_0x1665d0){return db[_0x4056('0x44')][_0x4056('0x4a')]({'where':{'id':_0x139353['params']['id']}})[_0x4056('0x28')](handleEntityNotFound(_0x5e5f81,null))[_0x4056('0x28')](function(_0x2e535c){if(_0x2e535c){return _0x2e535c[_0x4056('0x83')](_0x139353['body'][_0x4056('0x63')],_[_0x4056('0x84')](_0x139353['body'],[_0x4056('0x63'),'id'])||{})['spread'](function(_0x4f34c8){for(var _0x329456=0x0;_0x329456<_0x139353[_0x4056('0x4c')][_0x4056('0x63')][_0x4056('0x3b')];_0x329456+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x139353[_0x4056('0x4c')][_0x4056('0x63')][_0x329456]),'OpenchannelQueueId':Number(_0x139353['params']['id'])});}return _0x4f34c8;});}})[_0x4056('0x28')](respondWithResult(_0x5e5f81,null))['catch'](handleError(_0x5e5f81,null));};exports[_0x4056('0x85')]=function(_0x3982ba,_0x5dc6ca,_0x1c2d93){return db[_0x4056('0x44')]['find']({'where':{'id':_0x3982ba['params']['id']}})[_0x4056('0x28')](handleEntityNotFound(_0x5dc6ca,null))[_0x4056('0x28')](function(_0x442e4e){if(_0x442e4e){return _0x442e4e[_0x4056('0x85')](_0x3982ba['query'][_0x4056('0x63')])[_0x4056('0x28')](function(){if(_['isArray'](_0x3982ba[_0x4056('0x35')][_0x4056('0x63')])){for(var _0x49925b=0x0;_0x49925b<_0x3982ba[_0x4056('0x35')]['ids'][_0x4056('0x3b')];_0x49925b+=0x1){socket[_0x4056('0x6d')](_0x4056('0x82'),{'UserId':Number(_0x3982ba[_0x4056('0x35')]['ids'][_0x49925b]),'OpenchannelQueueId':Number(_0x3982ba[_0x4056('0x49')]['id'])});}}else{socket[_0x4056('0x6d')](_0x4056('0x82'),{'UserId':Number(_0x3982ba[_0x4056('0x35')][_0x4056('0x63')]),'OpenchannelQueueId':Number(_0x3982ba[_0x4056('0x49')]['id'])});}});}})[_0x4056('0x28')](respondWithStatusCode(_0x5dc6ca,null))[_0x4056('0x48')](handleError(_0x5dc6ca,null));};exports[_0x4056('0x86')]=function(_0x22829c,_0x40237e,_0x58384f){var _0x1528b2={};var _0x293328={};var _0x5cce49;var _0x2c75ea;return db[_0x4056('0x44')]['findOne']({'where':{'id':_0x22829c[_0x4056('0x49')]['id']}})[_0x4056('0x28')](handleEntityNotFound(_0x40237e,null))['then'](function(_0x3f9868){if(_0x3f9868){_0x5cce49=_0x3f9868;_0x293328['model']=_[_0x4056('0x34')](db['User'][_0x4056('0x2f')]);_0x293328[_0x4056('0x35')]=_['keys'](_0x22829c['query']);_0x293328['filters']=_[_0x4056('0x37')](_0x293328['model'],_0x293328[_0x4056('0x35')]);_0x1528b2[_0x4056('0x39')]=_['intersection'](_0x293328[_0x4056('0x38')],qs[_0x4056('0x3a')](_0x22829c[_0x4056('0x35')][_0x4056('0x3a')]));_0x1528b2['attributes']=_0x1528b2[_0x4056('0x39')][_0x4056('0x3b')]?_0x1528b2[_0x4056('0x39')]:_0x293328[_0x4056('0x38')];_0x1528b2[_0x4056('0x3d')]=qs[_0x4056('0x3e')](_0x22829c[_0x4056('0x35')][_0x4056('0x3e')]);_0x1528b2[_0x4056('0x40')]=qs['filters'](_[_0x4056('0x3f')](_0x22829c[_0x4056('0x35')],_0x293328[_0x4056('0x36')]));if(_0x22829c[_0x4056('0x35')][_0x4056('0x42')]){_0x1528b2[_0x4056('0x40')]=_[_0x4056('0x41')](_0x1528b2[_0x4056('0x40')],{'$or':_[_0x4056('0x33')](_0x1528b2[_0x4056('0x39')],function(_0x389cf4){var _0x3a19f9={};_0x3a19f9[_0x389cf4]={'$like':'%'+_0x22829c['query']['filter']+'%'};return _0x3a19f9;})});}_0x1528b2=_[_0x4056('0x41')]({},_0x1528b2,_0x22829c[_0x4056('0x43')]);return _0x5cce49[_0x4056('0x86')](_0x1528b2);}})[_0x4056('0x28')](function(_0x39df74){if(_0x39df74){_0x2c75ea=_0x39df74[_0x4056('0x3b')];if(!_0x22829c[_0x4056('0x35')][_0x4056('0x61')](_0x4056('0x3c'))){_0x1528b2[_0x4056('0x1f')]=qs[_0x4056('0x1f')](_0x22829c[_0x4056('0x35')]['limit']);_0x1528b2[_0x4056('0x1e')]=qs[_0x4056('0x1e')](_0x22829c[_0x4056('0x35')][_0x4056('0x1e')]);}return _0x5cce49[_0x4056('0x86')](_0x1528b2);}})[_0x4056('0x28')](function(_0x3ee6c3){if(_0x3ee6c3){return _0x3ee6c3?{'count':_0x2c75ea,'rows':_0x3ee6c3}:null;}})['then'](respondWithResult(_0x40237e,null))['catch'](handleError(_0x40237e,null));}; \ No newline at end of file +var _0x3aef=['field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','OpenchannelQueues','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','updatedAt','createdAt','SIP','openchannelPause','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams'];(function(_0x5514bf,_0x47215d){var _0x1595a9=function(_0x45b00c){while(--_0x45b00c){_0x5514bf['push'](_0x5514bf['shift']());}};_0x1595a9(++_0x47215d);}(_0x3aef,0x135));var _0xf3ae=function(_0x4afd61,_0x4b6d33){_0x4afd61=_0x4afd61-0x0;var _0x2b3190=_0x3aef[_0x4afd61];return _0x2b3190;};'use strict';var emlformat=require(_0xf3ae('0x0'));var rimraf=require(_0xf3ae('0x1'));var zipdir=require(_0xf3ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3ae('0x3'));var moment=require(_0xf3ae('0x4'));var BPromise=require(_0xf3ae('0x5'));var Mustache=require(_0xf3ae('0x6'));var util=require(_0xf3ae('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf3ae('0x8'));var ejs=require(_0xf3ae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3ae('0xa'));var squel=require('squel');var crypto=require(_0xf3ae('0xb'));var jsforce=require(_0xf3ae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf3ae('0x8'));var querystring=require(_0xf3ae('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf3ae('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf3ae('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf3ae('0x10'));var utils=require(_0xf3ae('0x11'));var config=require(_0xf3ae('0x12'));var licenseUtil=require(_0xf3ae('0x13'));var db=require(_0xf3ae('0x14'))['db'];config[_0xf3ae('0x15')]=_[_0xf3ae('0x16')](config[_0xf3ae('0x15')],{'host':_0xf3ae('0x17'),'port':0x18eb});var socket=require(_0xf3ae('0x18'))(new Redis(config[_0xf3ae('0x15')]));require(_0xf3ae('0x19'))[_0xf3ae('0x1a')](socket);function respondWithStatusCode(_0x5b1aca,_0x13b853){_0x13b853=_0x13b853||0xcc;return function(_0x49667f){if(_0x49667f){return _0x5b1aca[_0xf3ae('0x1b')](_0x13b853);}return _0x5b1aca[_0xf3ae('0x1c')](_0x13b853)[_0xf3ae('0x1d')]();};}function respondWithResult(_0x2c9435,_0x5957ab){_0x5957ab=_0x5957ab||0xc8;return function(_0x577903){if(_0x577903){return _0x2c9435[_0xf3ae('0x1c')](_0x5957ab)[_0xf3ae('0x1e')](_0x577903);}};}function respondWithFilteredResult(_0x5bf9ed,_0x50d3e4){return function(_0x4c13fe){if(_0x4c13fe){var _0x3de653=typeof _0x50d3e4[_0xf3ae('0x1f')]===_0xf3ae('0x20')&&typeof _0x50d3e4[_0xf3ae('0x21')]==='undefined';var _0x54e0d2=_0x4c13fe['count'];var _0x4406fa=_0x3de653?0x0:_0x50d3e4[_0xf3ae('0x1f')];var _0x3490e1=_0x3de653?_0x4c13fe[_0xf3ae('0x22')]:_0x50d3e4[_0xf3ae('0x1f')]+_0x50d3e4[_0xf3ae('0x21')];var _0x204c04;if(_0x3490e1>=_0x54e0d2){_0x3490e1=_0x54e0d2;_0x204c04=0xc8;}else{_0x204c04=0xce;}_0x5bf9ed[_0xf3ae('0x1c')](_0x204c04);return _0x5bf9ed[_0xf3ae('0x23')](_0xf3ae('0x24'),_0x4406fa+'-'+_0x3490e1+'/'+_0x54e0d2)['json'](_0x4c13fe);}return null;};}function patchUpdates(_0x143fc2){return function(_0x4df0d4){try{jsonpatch[_0xf3ae('0x25')](_0x4df0d4,_0x143fc2,!![]);}catch(_0x356a80){return BPromise['reject'](_0x356a80);}return _0x4df0d4[_0xf3ae('0x26')]();};}function saveUpdates(_0xa4fd1d,_0x3716f3){return function(_0x26cf95){if(_0x26cf95){return _0x26cf95[_0xf3ae('0x27')](_0xa4fd1d)[_0xf3ae('0x28')](function(_0x44b6ed){return _0x44b6ed;});}return null;};}function removeEntity(_0x22eb75,_0x239222){return function(_0x4a37f5){if(_0x4a37f5){return _0x4a37f5[_0xf3ae('0x29')]()[_0xf3ae('0x28')](function(){var _0xc4f0be=_0x4a37f5[_0xf3ae('0x2a')]({'plain':!![]});var _0x41e724=_0xf3ae('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x41e724,'resourceId':_0xc4f0be['id']}})[_0xf3ae('0x28')](function(){return _0x4a37f5;});})[_0xf3ae('0x28')](function(){_0x22eb75[_0xf3ae('0x1c')](0xcc)[_0xf3ae('0x1d')]();});}};}function handleEntityNotFound(_0x84b997,_0x453ae0){return function(_0x55b64f){if(!_0x55b64f){_0x84b997[_0xf3ae('0x1b')](0x194);}return _0x55b64f;};}function handleError(_0x4e2131,_0x1f5c75){_0x1f5c75=_0x1f5c75||0x1f4;return function(_0x48fd6c){logger['error'](_0x48fd6c[_0xf3ae('0x2c')]);if(_0x48fd6c[_0xf3ae('0x2d')]){delete _0x48fd6c['name'];}_0x4e2131[_0xf3ae('0x1c')](_0x1f5c75)[_0xf3ae('0x2e')](_0x48fd6c);};}exports['index']=function(_0x17675b,_0x3b7b81){var _0x1e812e={},_0xee342c={},_0x4851c8={'count':0x0,'rows':[]};var _0x3523e5=_[_0xf3ae('0x2f')](db[_0xf3ae('0x30')][_0xf3ae('0x31')],function(_0x3df9f4){return{'name':_0x3df9f4[_0xf3ae('0x32')],'type':_0x3df9f4[_0xf3ae('0x33')][_0xf3ae('0x34')]};});_0xee342c[_0xf3ae('0x35')]=_[_0xf3ae('0x2f')](_0x3523e5,_0xf3ae('0x2d'));_0xee342c['query']=_['keys'](_0x17675b[_0xf3ae('0x36')]);_0xee342c[_0xf3ae('0x37')]=_['intersection'](_0xee342c[_0xf3ae('0x35')],_0xee342c[_0xf3ae('0x36')]);_0x1e812e['attributes']=_[_0xf3ae('0x38')](_0xee342c[_0xf3ae('0x35')],qs[_0xf3ae('0x39')](_0x17675b['query']['fields']));_0x1e812e[_0xf3ae('0x3a')]=_0x1e812e[_0xf3ae('0x3a')][_0xf3ae('0x3b')]?_0x1e812e['attributes']:_0xee342c[_0xf3ae('0x35')];if(!_0x17675b['query'][_0xf3ae('0x3c')](_0xf3ae('0x3d'))){_0x1e812e[_0xf3ae('0x21')]=qs['limit'](_0x17675b['query'][_0xf3ae('0x21')]);_0x1e812e[_0xf3ae('0x1f')]=qs[_0xf3ae('0x1f')](_0x17675b[_0xf3ae('0x36')][_0xf3ae('0x1f')]);}_0x1e812e[_0xf3ae('0x3e')]=qs[_0xf3ae('0x3f')](_0x17675b[_0xf3ae('0x36')][_0xf3ae('0x3f')]);_0x1e812e[_0xf3ae('0x40')]=qs[_0xf3ae('0x37')](_[_0xf3ae('0x41')](_0x17675b[_0xf3ae('0x36')],_0xee342c[_0xf3ae('0x37')]),_0x3523e5);if(_0x17675b['query'][_0xf3ae('0x42')]){_0x1e812e[_0xf3ae('0x40')]=_[_0xf3ae('0x43')](_0x1e812e['where'],{'$or':_['map'](_0x3523e5,function(_0x2f4205){if(_0x2f4205[_0xf3ae('0x33')]!==_0xf3ae('0x44')){var _0x48f81d={};_0x48f81d[_0x2f4205[_0xf3ae('0x2d')]]={'$like':'%'+_0x17675b[_0xf3ae('0x36')][_0xf3ae('0x42')]+'%'};return _0x48f81d;}})});}_0x1e812e=_[_0xf3ae('0x43')]({},_0x1e812e,_0x17675b[_0xf3ae('0x45')]);var _0x444ccb={'where':_0x1e812e[_0xf3ae('0x40')]};return db['OpenchannelQueue']['count'](_0x444ccb)[_0xf3ae('0x28')](function(_0x249dbb){_0x4851c8['count']=_0x249dbb;if(_0x17675b[_0xf3ae('0x36')]['includeAll']){_0x1e812e['include']=[{'all':!![]}];}return db[_0xf3ae('0x30')][_0xf3ae('0x46')](_0x1e812e);})[_0xf3ae('0x28')](function(_0x25f23c){_0x4851c8[_0xf3ae('0x47')]=_0x25f23c;return _0x4851c8;})[_0xf3ae('0x28')](respondWithFilteredResult(_0x3b7b81,_0x1e812e))[_0xf3ae('0x48')](handleError(_0x3b7b81,null));};exports[_0xf3ae('0x49')]=function(_0xa8496b,_0x2a12f7){var _0x1d49dc={'raw':!![],'where':{'id':_0xa8496b['params']['id']}},_0x35b108={};_0x35b108[_0xf3ae('0x35')]=_['keys'](db[_0xf3ae('0x30')]['rawAttributes']);_0x35b108['query']=_[_0xf3ae('0x4a')](_0xa8496b['query']);_0x35b108[_0xf3ae('0x37')]=_[_0xf3ae('0x38')](_0x35b108[_0xf3ae('0x35')],_0x35b108[_0xf3ae('0x36')]);_0x1d49dc[_0xf3ae('0x3a')]=_[_0xf3ae('0x38')](_0x35b108[_0xf3ae('0x35')],qs[_0xf3ae('0x39')](_0xa8496b[_0xf3ae('0x36')][_0xf3ae('0x39')]));_0x1d49dc['attributes']=_0x1d49dc['attributes'][_0xf3ae('0x3b')]?_0x1d49dc[_0xf3ae('0x3a')]:_0x35b108[_0xf3ae('0x35')];if(_0xa8496b['query'][_0xf3ae('0x4b')]){_0x1d49dc[_0xf3ae('0x4c')]=[{'all':!![]}];}_0x1d49dc=_[_0xf3ae('0x43')]({},_0x1d49dc,_0xa8496b['options']);return db[_0xf3ae('0x30')]['find'](_0x1d49dc)['then'](handleEntityNotFound(_0x2a12f7,null))['then'](respondWithResult(_0x2a12f7,null))[_0xf3ae('0x48')](handleError(_0x2a12f7,null));};exports[_0xf3ae('0x4d')]=function(_0x344708,_0x1e9f5d){return db[_0xf3ae('0x30')][_0xf3ae('0x4d')](_0x344708[_0xf3ae('0x4e')],{})[_0xf3ae('0x28')](function(_0x5d7b48){var _0x422211=_0x344708[_0xf3ae('0x4f')][_0xf3ae('0x2a')]({'plain':!![]});if(!_0x422211)throw new Error(_0xf3ae('0x50'));if(_0x422211[_0xf3ae('0x51')]===_0xf3ae('0x4f')){var _0x3e51e7=_0x5d7b48[_0xf3ae('0x2a')]({'plain':!![]});var _0x225dba=_0xf3ae('0x2b');return db[_0xf3ae('0x52')][_0xf3ae('0x53')]({'where':{'name':_0x225dba,'userProfileId':_0x422211[_0xf3ae('0x54')]},'raw':!![]})[_0xf3ae('0x28')](function(_0x45f7c7){if(_0x45f7c7&&_0x45f7c7[_0xf3ae('0x55')]===0x0){return db[_0xf3ae('0x56')]['create']({'name':_0x3e51e7[_0xf3ae('0x2d')],'resourceId':_0x3e51e7['id'],'type':_0x45f7c7[_0xf3ae('0x2d')],'sectionId':_0x45f7c7['id']},{})['then'](function(){return _0x5d7b48;});}else{return _0x5d7b48;}})['catch'](function(_0x3c7333){logger[_0xf3ae('0x57')](_0xf3ae('0x58'),_0x3c7333);throw _0x3c7333;});}return _0x5d7b48;})[_0xf3ae('0x28')](respondWithResult(_0x1e9f5d,0xc9))[_0xf3ae('0x48')](handleError(_0x1e9f5d,null));};exports['update']=function(_0x28efa4,_0x45c205){if(_0x28efa4[_0xf3ae('0x4e')]['id']){delete _0x28efa4[_0xf3ae('0x4e')]['id'];}return db[_0xf3ae('0x30')][_0xf3ae('0x53')]({'where':{'id':_0x28efa4['params']['id']}})[_0xf3ae('0x28')](handleEntityNotFound(_0x45c205,null))[_0xf3ae('0x28')](saveUpdates(_0x28efa4['body'],null))['then'](respondWithResult(_0x45c205,null))[_0xf3ae('0x48')](handleError(_0x45c205,null));};exports[_0xf3ae('0x29')]=function(_0x449022,_0x141769){return db['OpenchannelQueue'][_0xf3ae('0x53')]({'where':{'id':_0x449022[_0xf3ae('0x59')]['id']}})[_0xf3ae('0x28')](handleEntityNotFound(_0x141769,null))['then'](removeEntity(_0x141769,null))[_0xf3ae('0x48')](handleError(_0x141769,null));};exports[_0xf3ae('0x5a')]=function(_0x2ffb55,_0x3e50c5){return db[_0xf3ae('0x30')]['describe']()['then'](respondWithResult(_0x3e50c5,null))['catch'](handleError(_0x3e50c5,null));};exports[_0xf3ae('0x5b')]=function(_0xe60e99,_0xcecc40,_0x5c037e){var _0x3f42f2={'raw':!![],'where':{}},_0xf01407={},_0x141eed;return db[_0xf3ae('0x30')]['findOne']({'where':{'id':_0xe60e99['params']['id']}})['then'](handleEntityNotFound(_0xcecc40,null))['then'](function(_0x1a11a1){if(_0x1a11a1){_0x141eed=_0x1a11a1[_0xf3ae('0x2a')]({'plain':!![]});_0xf01407['model']=_[_0xf3ae('0x4a')](db[_0xf3ae('0x5c')][_0xf3ae('0x31')]);_0xf01407[_0xf3ae('0x36')]=_['keys'](_0xe60e99[_0xf3ae('0x36')]);_0xf01407[_0xf3ae('0x37')]=_[_0xf3ae('0x38')](_0xf01407[_0xf3ae('0x35')],_0xf01407[_0xf3ae('0x36')]);_0x3f42f2['attributes']=_[_0xf3ae('0x38')](_0xf01407['model'],qs[_0xf3ae('0x39')](_0xe60e99[_0xf3ae('0x36')]['fields']));_0x3f42f2[_0xf3ae('0x3a')]=_0x3f42f2[_0xf3ae('0x3a')][_0xf3ae('0x3b')]?_0x3f42f2[_0xf3ae('0x3a')]:_0xf01407['model'];if(!_0xe60e99[_0xf3ae('0x36')][_0xf3ae('0x3c')](_0xf3ae('0x3d'))){_0x3f42f2[_0xf3ae('0x21')]=qs[_0xf3ae('0x21')](_0xe60e99['query']['limit']);_0x3f42f2[_0xf3ae('0x1f')]=qs[_0xf3ae('0x1f')](_0xe60e99[_0xf3ae('0x36')][_0xf3ae('0x1f')]);}_0x3f42f2[_0xf3ae('0x3e')]=qs['sort'](_0xe60e99[_0xf3ae('0x36')][_0xf3ae('0x3f')]);_0x3f42f2[_0xf3ae('0x40')]=qs[_0xf3ae('0x37')](_['pick'](_0xe60e99['query'],_0xf01407['filters']));_0x3f42f2[_0xf3ae('0x40')][_0xf3ae('0x5d')]=_0x1a11a1['id'];if(_0xe60e99['query'][_0xf3ae('0x42')]){_0x3f42f2[_0xf3ae('0x40')]=_[_0xf3ae('0x43')](_0x3f42f2[_0xf3ae('0x40')],{'$or':_['map'](_0x3f42f2[_0xf3ae('0x3a')],function(_0xe95c0f){var _0xa7d506={};_0xa7d506[_0xe95c0f]={'$like':'%'+_0xe60e99['query']['filter']+'%'};return _0xa7d506;})});}_0x3f42f2=_[_0xf3ae('0x43')]({},_0x3f42f2,_0xe60e99[_0xf3ae('0x45')]);return db[_0xf3ae('0x5c')][_0xf3ae('0x46')](_0x3f42f2);}})[_0xf3ae('0x28')](function(_0x1b3016){if(_0x1b3016){return db[_0xf3ae('0x5e')][_0xf3ae('0x5f')]({'where':{'id':_[_0xf3ae('0x2f')](_0x1b3016,'UserId'),'role':_0xf3ae('0x60')},'attributes':['id',_0xf3ae('0x2d'),'openchannelPause',_0xf3ae('0x61'),_0xf3ae('0x62')]});}})['then'](function(_0x58534d){if(_0x58534d){return{'count':_0x58534d['count'],'rows':_['map'](_0x58534d['rows'],function(_0x3f41e1){return{'membername':_0x3f41e1[_0xf3ae('0x2d')],'UserId':_0x3f41e1['id'],'queue_name':_0x141eed[_0xf3ae('0x2d')],'OpenchannelQueueId':_0x141eed['id'],'interface':util['format']('%s/%s',_0xf3ae('0x63'),_0x3f41e1[_0xf3ae('0x2d')]),'penalty':0x0,'paused':_0x3f41e1[_0xf3ae('0x64')],'createdAt':_0x3f41e1[_0xf3ae('0x62')],'updatedAt':_0x3f41e1[_0xf3ae('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf3ae('0x28')](respondWithFilteredResult(_0xcecc40,_0x3f42f2))[_0xf3ae('0x48')](handleError(_0xcecc40,null));};exports[_0xf3ae('0x65')]=function(_0x162535,_0x169467,_0x35b304){var _0x2da9b8={};var _0x1d6def={};var _0x3fd61d;var _0x5b85bc;return db['OpenchannelQueue'][_0xf3ae('0x66')]({'where':{'id':_0x162535[_0xf3ae('0x59')]['id']}})[_0xf3ae('0x28')](handleEntityNotFound(_0x169467,null))[_0xf3ae('0x28')](function(_0x356494){if(_0x356494){_0x3fd61d=_0x356494;_0x1d6def[_0xf3ae('0x35')]=_[_0xf3ae('0x4a')](db[_0xf3ae('0x67')][_0xf3ae('0x31')]);_0x1d6def[_0xf3ae('0x36')]=_[_0xf3ae('0x4a')](_0x162535[_0xf3ae('0x36')]);_0x1d6def['filters']=_['intersection'](_0x1d6def[_0xf3ae('0x35')],_0x1d6def['query']);_0x2da9b8[_0xf3ae('0x3a')]=_[_0xf3ae('0x38')](_0x1d6def[_0xf3ae('0x35')],qs[_0xf3ae('0x39')](_0x162535['query'][_0xf3ae('0x39')]));_0x2da9b8[_0xf3ae('0x3a')]=_0x2da9b8['attributes'][_0xf3ae('0x3b')]?_0x2da9b8['attributes']:_0x1d6def[_0xf3ae('0x35')];_0x2da9b8[_0xf3ae('0x3e')]=qs['sort'](_0x162535[_0xf3ae('0x36')]['sort']);_0x2da9b8[_0xf3ae('0x40')]=qs['filters'](_[_0xf3ae('0x41')](_0x162535['query'],_0x1d6def[_0xf3ae('0x37')]));if(_0x162535[_0xf3ae('0x36')]['filter']){_0x2da9b8[_0xf3ae('0x40')]=_[_0xf3ae('0x43')](_0x2da9b8['where'],{'$or':_[_0xf3ae('0x2f')](_0x2da9b8[_0xf3ae('0x3a')],function(_0x37bc8d){var _0x2c9137={};_0x2c9137[_0x37bc8d]={'$like':'%'+_0x162535['query'][_0xf3ae('0x42')]+'%'};return _0x2c9137;})});}_0x2da9b8=_['merge']({},_0x2da9b8,_0x162535['options']);return _0x3fd61d[_0xf3ae('0x65')](_0x2da9b8);}})[_0xf3ae('0x28')](function(_0x3470ee){if(_0x3470ee){_0x5b85bc=_0x3470ee[_0xf3ae('0x3b')];if(!_0x162535[_0xf3ae('0x36')]['hasOwnProperty'](_0xf3ae('0x3d'))){_0x2da9b8[_0xf3ae('0x21')]=qs[_0xf3ae('0x21')](_0x162535[_0xf3ae('0x36')][_0xf3ae('0x21')]);_0x2da9b8[_0xf3ae('0x1f')]=qs[_0xf3ae('0x1f')](_0x162535['query'][_0xf3ae('0x1f')]);}return _0x3fd61d[_0xf3ae('0x65')](_0x2da9b8);}})[_0xf3ae('0x28')](function(_0x51e861){if(_0x51e861){return _0x51e861?{'count':_0x5b85bc,'rows':_0x51e861}:null;}})['then'](respondWithResult(_0x169467,null))['catch'](handleError(_0x169467,null));};exports[_0xf3ae('0x68')]=function(_0x38ae23,_0x5e91f8,_0x102c41){var _0x5a2b1a=_0x38ae23[_0xf3ae('0x4e')][_0xf3ae('0x69')];return db['Team'][_0xf3ae('0x46')]({'where':{'id':_0x5a2b1a},'attributes':['id'],'include':[{'model':db[_0xf3ae('0x5e')],'as':_0xf3ae('0x6a'),'attributes':['id',_0xf3ae('0x2d'),_0xf3ae('0x6b'),_0xf3ae('0x6c'),_0xf3ae('0x6d')],'raw':!![]}]})[_0xf3ae('0x28')](function(_0x45e3cd){if(_0x45e3cd){var _0x52ae4f=_[_0xf3ae('0x6e')](_0x45e3cd,function(_0x2aca10){var _0x189a8c=_0x2aca10['get']({'plain':!![]});return _0x189a8c[_0xf3ae('0x6a')];});return db['OpenchannelQueue'][_0xf3ae('0x53')]({'where':{'id':_0x38ae23[_0xf3ae('0x59')]['id']}})['then'](function(_0x5903d0){return db['sequelize'][_0xf3ae('0x6f')](function(_0x518fd9){return _0x5903d0[_0xf3ae('0x68')](_0x5a2b1a,{'transaction':_0x518fd9})['then'](function(){return BPromise[_0xf3ae('0x70')](_0x52ae4f,function(_0x1bee67){return db[_0xf3ae('0x5c')]['findOrCreate']({'where':{'UserId':_0x1bee67['id'],'OpenchannelQueueId':_0x38ae23[_0xf3ae('0x59')]['id']},'transaction':_0x518fd9});});})[_0xf3ae('0x28')](function(){_0x52ae4f[_0xf3ae('0x71')](function(_0x527a0f){socket[_0xf3ae('0x72')](_0xf3ae('0x73'),{'UserId':_0x527a0f['id'],'OpenchannelQueueId':_0x5903d0['id']});});});});});}})[_0xf3ae('0x28')](respondWithStatusCode(_0x5e91f8,null))[_0xf3ae('0x48')](handleError(_0x5e91f8,null));};exports[_0xf3ae('0x74')]=function(_0x6f43d0,_0x1931ab,_0x2421f5){return db[_0xf3ae('0x67')][_0xf3ae('0x46')]({'where':{'id':_0x6f43d0[_0xf3ae('0x36')][_0xf3ae('0x69')]},'attributes':['id'],'include':[{'model':db[_0xf3ae('0x5e')],'as':_0xf3ae('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1931ab,null))[_0xf3ae('0x28')](function(_0x20fc65){var _0x2f0816=_[_0xf3ae('0x2f')](_0x20fc65,'id');var _0x1702cc=[];var _0x4b2547=[];var _0x20ddbf=squel['select']();_0x20ddbf[_0xf3ae('0x75')](_0xf3ae('0x76'))[_0xf3ae('0x77')]('team_has_openchannel_queues','tq')[_0xf3ae('0x78')](_0xf3ae('0x79'),'ut',_0xf3ae('0x7a'))[_0xf3ae('0x40')]('OpenchannelQueueId\x20=\x20?',_0x6f43d0['params']['id']);for(var _0x580914=0x0;_0x580914<_0x20fc65['length'];_0x580914+=0x1){let _0x5a8155=_0x20fc65[_0x580914];for(var _0x15f1f9=0x0;_0x15f1f9<_0x5a8155[_0xf3ae('0x6a')]['length'];_0x15f1f9+=0x1){let _0x5a7b2b=_0x5a8155[_0xf3ae('0x6a')][_0x15f1f9];var _0x52f1e0=_0x20ddbf[_0xf3ae('0x7b')]();_0x52f1e0[_0xf3ae('0x40')](_0xf3ae('0x7c'),_0x5a7b2b['id']);_0x4b2547[_0xf3ae('0x7d')](db[_0xf3ae('0x7e')][_0xf3ae('0x36')](_0x52f1e0[_0xf3ae('0x7f')](),{'type':db[_0xf3ae('0x7e')][_0xf3ae('0x80')]['SELECT']})[_0xf3ae('0x28')](function(_0x299ee5){if(_0x299ee5['length']===0x1){return _0x5a7b2b['id'];}else{var _0x598b76=_[_0xf3ae('0x81')](_[_0xf3ae('0x2f')](_0x299ee5,_0xf3ae('0x82')),function(_0x4ab5db){return _[_0xf3ae('0x83')](_0x2f0816,_0x4ab5db);});if(_0x598b76){return _0x5a7b2b['id'];}}}));}}return BPromise['all'](_0x4b2547)[_0xf3ae('0x28')](function(_0x114210){_0x1702cc=_(_0x1702cc)[_0xf3ae('0x84')](_0x114210)[_0xf3ae('0x85')]()[_0xf3ae('0x86')]();return db[_0xf3ae('0x30')]['find']({'where':{'id':_0x6f43d0['params']['id']}})['then'](function(_0x127cf5){return db[_0xf3ae('0x7e')][_0xf3ae('0x6f')](function(_0x562973){return _0x127cf5[_0xf3ae('0x74')](_0x6f43d0['query']['ids'],{'transaction':_0x562973})[_0xf3ae('0x28')](function(){if(!_[_0xf3ae('0x87')](_0x1702cc)){return _0x127cf5['removeAgents'](_0x1702cc,{'transaction':_0x562973});}})['then'](function(){_0x1702cc[_0xf3ae('0x71')](function(_0x8a8af9){socket[_0xf3ae('0x72')](_0xf3ae('0x88'),{'UserId':_0x8a8af9,'OpenchannelQueueId':_0x127cf5['id']});});});});});});})[_0xf3ae('0x28')](respondWithStatusCode(_0x1931ab,null))['catch'](handleError(_0x1931ab,null));};exports[_0xf3ae('0x89')]=function(_0x2e8a09,_0x3265ff,_0x58ac6f){return db[_0xf3ae('0x30')][_0xf3ae('0x53')]({'where':{'id':_0x2e8a09[_0xf3ae('0x59')]['id']}})[_0xf3ae('0x28')](handleEntityNotFound(_0x3265ff,null))[_0xf3ae('0x28')](function(_0x2cd99b){if(_0x2cd99b){return _0x2cd99b[_0xf3ae('0x89')](_0x2e8a09[_0xf3ae('0x4e')][_0xf3ae('0x69')],_['omit'](_0x2e8a09[_0xf3ae('0x4e')],[_0xf3ae('0x69'),'id'])||{})[_0xf3ae('0x8a')](function(_0x21b4a3){for(var _0x4457da=0x0;_0x4457da<_0x2e8a09[_0xf3ae('0x4e')][_0xf3ae('0x69')][_0xf3ae('0x3b')];_0x4457da+=0x1){socket[_0xf3ae('0x72')](_0xf3ae('0x73'),{'UserId':Number(_0x2e8a09[_0xf3ae('0x4e')][_0xf3ae('0x69')][_0x4457da]),'OpenchannelQueueId':Number(_0x2e8a09[_0xf3ae('0x59')]['id'])});}return _0x21b4a3;});}})[_0xf3ae('0x28')](respondWithResult(_0x3265ff,null))['catch'](handleError(_0x3265ff,null));};exports[_0xf3ae('0x8b')]=function(_0x396548,_0x1bbba3,_0x16c705){return db[_0xf3ae('0x30')][_0xf3ae('0x53')]({'where':{'id':_0x396548[_0xf3ae('0x59')]['id']}})['then'](handleEntityNotFound(_0x1bbba3,null))[_0xf3ae('0x28')](function(_0x19bf59){if(_0x19bf59){return _0x19bf59[_0xf3ae('0x8b')](_0x396548[_0xf3ae('0x36')][_0xf3ae('0x69')])[_0xf3ae('0x28')](function(){if(_[_0xf3ae('0x8c')](_0x396548[_0xf3ae('0x36')]['ids'])){for(var _0x41ac45=0x0;_0x41ac45<_0x396548['query'][_0xf3ae('0x69')][_0xf3ae('0x3b')];_0x41ac45+=0x1){socket[_0xf3ae('0x72')](_0xf3ae('0x88'),{'UserId':Number(_0x396548[_0xf3ae('0x36')][_0xf3ae('0x69')][_0x41ac45]),'OpenchannelQueueId':Number(_0x396548[_0xf3ae('0x59')]['id'])});}}else{socket['emit'](_0xf3ae('0x88'),{'UserId':Number(_0x396548[_0xf3ae('0x36')][_0xf3ae('0x69')]),'OpenchannelQueueId':Number(_0x396548['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1bbba3,null))[_0xf3ae('0x48')](handleError(_0x1bbba3,null));};exports[_0xf3ae('0x8d')]=function(_0x1b3962,_0x990d46,_0x382676){var _0x36b25c={};var _0x1e6320={};var _0x5f1512;var _0x1087c5;return db[_0xf3ae('0x30')][_0xf3ae('0x66')]({'where':{'id':_0x1b3962['params']['id']}})[_0xf3ae('0x28')](handleEntityNotFound(_0x990d46,null))[_0xf3ae('0x28')](function(_0x40f397){if(_0x40f397){_0x5f1512=_0x40f397;_0x1e6320[_0xf3ae('0x35')]=_[_0xf3ae('0x4a')](db['User'][_0xf3ae('0x31')]);_0x1e6320['query']=_[_0xf3ae('0x4a')](_0x1b3962[_0xf3ae('0x36')]);_0x1e6320[_0xf3ae('0x37')]=_[_0xf3ae('0x38')](_0x1e6320[_0xf3ae('0x35')],_0x1e6320[_0xf3ae('0x36')]);_0x36b25c['attributes']=_[_0xf3ae('0x38')](_0x1e6320[_0xf3ae('0x35')],qs[_0xf3ae('0x39')](_0x1b3962[_0xf3ae('0x36')][_0xf3ae('0x39')]));_0x36b25c[_0xf3ae('0x3a')]=_0x36b25c[_0xf3ae('0x3a')][_0xf3ae('0x3b')]?_0x36b25c['attributes']:_0x1e6320[_0xf3ae('0x35')];_0x36b25c[_0xf3ae('0x3e')]=qs[_0xf3ae('0x3f')](_0x1b3962[_0xf3ae('0x36')][_0xf3ae('0x3f')]);_0x36b25c[_0xf3ae('0x40')]=qs[_0xf3ae('0x37')](_['pick'](_0x1b3962[_0xf3ae('0x36')],_0x1e6320[_0xf3ae('0x37')]));if(_0x1b3962['query'][_0xf3ae('0x42')]){_0x36b25c['where']=_[_0xf3ae('0x43')](_0x36b25c[_0xf3ae('0x40')],{'$or':_['map'](_0x36b25c[_0xf3ae('0x3a')],function(_0x4f873b){var _0x175dc1={};_0x175dc1[_0x4f873b]={'$like':'%'+_0x1b3962[_0xf3ae('0x36')][_0xf3ae('0x42')]+'%'};return _0x175dc1;})});}_0x36b25c=_[_0xf3ae('0x43')]({},_0x36b25c,_0x1b3962[_0xf3ae('0x45')]);return _0x5f1512[_0xf3ae('0x8d')](_0x36b25c);}})['then'](function(_0x146431){if(_0x146431){_0x1087c5=_0x146431[_0xf3ae('0x3b')];if(!_0x1b3962['query'][_0xf3ae('0x3c')](_0xf3ae('0x3d'))){_0x36b25c[_0xf3ae('0x21')]=qs[_0xf3ae('0x21')](_0x1b3962[_0xf3ae('0x36')][_0xf3ae('0x21')]);_0x36b25c['offset']=qs[_0xf3ae('0x1f')](_0x1b3962['query'][_0xf3ae('0x1f')]);}return _0x5f1512[_0xf3ae('0x8d')](_0x36b25c);}})[_0xf3ae('0x28')](function(_0x335560){if(_0x335560){return _0x335560?{'count':_0x1087c5,'rows':_0x335560}:null;}})[_0xf3ae('0x28')](respondWithResult(_0x990d46,null))['catch'](handleError(_0x990d46,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index b14b770..af72598 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 _0x750a=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x196c94,_0x58fa96){var _0x4f7e3f=function(_0x19f1d5){while(--_0x19f1d5){_0x196c94['push'](_0x196c94['shift']());}};_0x4f7e3f(++_0x58fa96);}(_0x750a,0x140));var _0xa750=function(_0x1d0304,_0x315c51){_0x1d0304=_0x1d0304-0x0;var _0x2ef571=_0x750a[_0x1d0304];return _0x2ef571;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xa750('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa750('0x1'),'afterUpdate':_0xa750('0x2'),'afterDestroy':_0xa750('0x3')};function emitEvent(_0x19bd5f){return function(_0x457cae,_0x43d704,_0x562911){OpenchannelQueueEvents[_0xa750('0x4')](_0x19bd5f+':'+_0x457cae['id'],_0x457cae);OpenchannelQueueEvents[_0xa750('0x4')](_0x19bd5f,_0x457cae);_0x562911(null);};}for(var e in events){if(events[_0xa750('0x5')](e)){var event=events[e];OpenchannelQueue[_0xa750('0x6')](e,emitEvent(event));}}module[_0xa750('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x1fe1=['update','emit','hook','exports','../../mysqldb','OpenchannelQueue','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1fe1,0x1cb));var _0x11fe=function(_0x3e811d,_0x114889){_0x3e811d=_0x3e811d-0x0;var _0x37aa23=_0x1fe1[_0x3e811d];return _0x37aa23;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x11fe('0x0'))['db'][_0x11fe('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11fe('0x2'),'afterUpdate':_0x11fe('0x3'),'afterDestroy':'remove'};function emitEvent(_0x55ed22){return function(_0x46321a,_0x544d1d,_0x4b7ef9){OpenchannelQueueEvents[_0x11fe('0x4')](_0x55ed22+':'+_0x46321a['id'],_0x46321a);OpenchannelQueueEvents[_0x11fe('0x4')](_0x55ed22,_0x46321a);_0x4b7ef9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x11fe('0x5')](e,emitEvent(event));}}module[_0x11fe('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f08bc2b..11682b2 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 _0xb02c=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x481ffc,_0x4acb82){var _0x51d09a=function(_0x2d73e0){while(--_0x2d73e0){_0x481ffc['push'](_0x481ffc['shift']());}};_0x51d09a(++_0x4acb82);}(_0xb02c,0x194));var _0xcb02=function(_0x16f27e,_0x588e75){_0x16f27e=_0x16f27e-0x0;var _0x85f9ea=_0xb02c[_0x16f27e];return _0x85f9ea;};'use strict';var _=require(_0xcb02('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcb02('0x1'));var BPromise=require(_0xcb02('0x2'));var rp=require(_0xcb02('0x3'));var fs=require('fs');var path=require(_0xcb02('0x4'));var rimraf=require('rimraf');var config=require(_0xcb02('0x5'));var attributes=require(_0xcb02('0x6'));module[_0xcb02('0x7')]=function(_0x22b82d,_0x2a1613){return _0x22b82d[_0xcb02('0x8')](_0xcb02('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a37=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5a37,0xde));var _0x75a3=function(_0x414cf2,_0x2136dd){_0x414cf2=_0x414cf2-0x0;var _0x27c0dc=_0x5a37[_0x414cf2];return _0x27c0dc;};'use strict';var _=require(_0x75a3('0x0'));var util=require(_0x75a3('0x1'));var logger=require(_0x75a3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x75a3('0x3'));var fs=require('fs');var path=require(_0x75a3('0x4'));var rimraf=require(_0x75a3('0x5'));var config=require('../../config/environment');var attributes=require(_0x75a3('0x6'));module[_0x75a3('0x7')]=function(_0x2c149b,_0x3e2e0f){return _0x2c149b[_0x75a3('0x8')](_0x75a3('0x9'),attributes,{'tableName':_0x75a3('0xa'),'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 865a590..96db06c 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 _0xb20b=['catch','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','debug','stringify','OpenchannelQueue','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x1c7ead,_0x1ea2ed){var _0x221e2d=function(_0x41e705){while(--_0x41e705){_0x1c7ead['push'](_0x1c7ead['shift']());}};_0x221e2d(++_0x1ea2ed);}(_0xb20b,0x1b4));var _0xbb20=function(_0xa62e5a,_0x3a35cf){_0xa62e5a=_0xa62e5a-0x0;var _0x488873=_0xb20b[_0xa62e5a];return _0x488873;};'use strict';var _=require(_0xbb20('0x0'));var util=require(_0xbb20('0x1'));var moment=require(_0xbb20('0x2'));var BPromise=require(_0xbb20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb20('0x4'));var db=require(_0xbb20('0x5'))['db'];var utils=require(_0xbb20('0x6'));var logger=require('../../config/logger')(_0xbb20('0x7'));var config=require(_0xbb20('0x8'));var jayson=require(_0xbb20('0x9'));var client=jayson[_0xbb20('0xa')][_0xbb20('0xb')]({'port':0x232a});config[_0xbb20('0xc')]=_[_0xbb20('0xd')](config[_0xbb20('0xc')],{'host':_0xbb20('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb20('0xc')]));require(_0xbb20('0xf'))[_0xbb20('0x10')](socket);function respondWithRpcPromise(_0x43c9b1,_0x5d6c52,_0x596d59){return new BPromise(function(_0x17ca4d,_0xb58780){return client[_0xbb20('0x11')](_0x43c9b1,_0x596d59)[_0xbb20('0x12')](function(_0x2c01d4){logger[_0xbb20('0x13')](_0xbb20('0x14'),_0x5d6c52,_0xbb20('0x15'));logger['debug'](_0xbb20('0x16'),_0x5d6c52,_0xbb20('0x15'),JSON['stringify'](_0x2c01d4));if(_0x2c01d4[_0xbb20('0x17')]){if(_0x2c01d4[_0xbb20('0x17')]['code']===0x1f4){logger['error'](_0xbb20('0x14'),_0x5d6c52,_0x2c01d4[_0xbb20('0x17')]['message']);return _0xb58780(_0x2c01d4[_0xbb20('0x17')][_0xbb20('0x18')]);}logger[_0xbb20('0x17')](_0xbb20('0x14'),_0x5d6c52,_0x2c01d4['error'][_0xbb20('0x18')]);return _0x17ca4d(_0x2c01d4[_0xbb20('0x17')][_0xbb20('0x18')]);}else{logger['info'](_0xbb20('0x14'),_0x5d6c52,'request\x20sent');_0x17ca4d(_0x2c01d4[_0xbb20('0x19')][_0xbb20('0x18')]);}})[_0xbb20('0x1a')](function(_0x476904){logger[_0xbb20('0x17')](_0xbb20('0x14'),_0x5d6c52,_0x476904);_0xb58780(_0x476904);});});}exports['GetOpenchannelQueue']=function(_0x3e8ea0){var _0x2d0b86=this;return new Promise(function(_0x3bf514,_0x2dbeab){return db['OpenchannelQueue'][_0xbb20('0x1b')]({'raw':_0x3e8ea0['options']?_0x3e8ea0[_0xbb20('0x1c')][_0xbb20('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e8ea0[_0xbb20('0x1c')]?_0x3e8ea0[_0xbb20('0x1c')][_0xbb20('0x1e')]||null:null,'attributes':_0x3e8ea0['options']?_0x3e8ea0[_0xbb20('0x1c')][_0xbb20('0x1f')]||null:null,'limit':_0x3e8ea0[_0xbb20('0x1c')]?_0x3e8ea0[_0xbb20('0x1c')][_0xbb20('0x20')]||null:null,'include':_0x3e8ea0[_0xbb20('0x1c')]?_0x3e8ea0[_0xbb20('0x1c')][_0xbb20('0x21')]?_[_0xbb20('0x22')](_0x3e8ea0[_0xbb20('0x1c')][_0xbb20('0x21')],function(_0x24cc06){return{'model':db[_0x24cc06[_0xbb20('0x23')]],'as':_0x24cc06['as'],'attributes':_0x24cc06['attributes'],'include':_0x24cc06['include']?_['map'](_0x24cc06[_0xbb20('0x21')],function(_0x4b3a6c){return{'model':db[_0x4b3a6c['model']],'as':_0x4b3a6c['as'],'attributes':_0x4b3a6c[_0xbb20('0x1f')],'include':_0x4b3a6c[_0xbb20('0x21')]?_['map'](_0x4b3a6c[_0xbb20('0x21')],function(_0x191e24){return{'model':db[_0x191e24[_0xbb20('0x23')]],'as':_0x191e24['as'],'attributes':_0x191e24[_0xbb20('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbb20('0x12')](function(_0x28a2de){logger[_0xbb20('0x13')](_0xbb20('0x24'),_0x3e8ea0);logger[_0xbb20('0x25')]('GetOpenchannelQueue',_0x3e8ea0,JSON[_0xbb20('0x26')](_0x28a2de));_0x3bf514(_0x28a2de);})[_0xbb20('0x1a')](function(_0x43f399){logger[_0xbb20('0x17')](_0xbb20('0x24'),_0x43f399[_0xbb20('0x18')],_0x3e8ea0);_0x2dbeab(_0x2d0b86[_0xbb20('0x17')](0x1f4,_0x43f399[_0xbb20('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x1ffd66){var _0x4f2357=this;return new Promise(function(_0x182fd0,_0x358f86){return db[_0xbb20('0x27')][_0xbb20('0x28')]({'raw':_0x1ffd66['options']?_0x1ffd66[_0xbb20('0x1c')][_0xbb20('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ffd66[_0xbb20('0x1c')]?_0x1ffd66[_0xbb20('0x1c')]['where']||null:null,'attributes':_0x1ffd66[_0xbb20('0x1c')]?_0x1ffd66[_0xbb20('0x1c')][_0xbb20('0x1f')]||null:null,'include':_0x1ffd66['options']?_0x1ffd66[_0xbb20('0x1c')][_0xbb20('0x21')]?_[_0xbb20('0x22')](_0x1ffd66['options'][_0xbb20('0x21')],function(_0x423867){return{'model':db[_0x423867[_0xbb20('0x23')]],'as':_0x423867['as'],'attributes':_0x423867[_0xbb20('0x1f')],'include':_0x423867[_0xbb20('0x21')]?_[_0xbb20('0x22')](_0x423867[_0xbb20('0x21')],function(_0x53a821){return{'model':db[_0x53a821[_0xbb20('0x23')]],'as':_0x53a821['as'],'attributes':_0x53a821[_0xbb20('0x1f')],'include':_0x53a821[_0xbb20('0x21')]?_[_0xbb20('0x22')](_0x53a821['include'],function(_0x162f03){return{'model':db[_0x162f03[_0xbb20('0x23')]],'as':_0x162f03['as'],'attributes':_0x162f03['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb20('0x12')](function(_0x22fe4f){logger[_0xbb20('0x13')](_0xbb20('0x29'),_0x1ffd66);logger[_0xbb20('0x25')](_0xbb20('0x29'),_0x1ffd66,JSON[_0xbb20('0x26')](_0x22fe4f));_0x182fd0(_0x22fe4f);})['catch'](function(_0x122858){logger[_0xbb20('0x17')](_0xbb20('0x29'),_0x122858['message'],_0x1ffd66);_0x358f86(_0x4f2357[_0xbb20('0x17')](0x1f4,_0x122858[_0xbb20('0x18')]));});});}; \ No newline at end of file +var _0xe5a5=['client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent','debug','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','attributes','map','include','model','where','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x1eb6b1,_0x2e7942){var _0x15ce8c=function(_0x252bcf){while(--_0x252bcf){_0x1eb6b1['push'](_0x1eb6b1['shift']());}};_0x15ce8c(++_0x2e7942);}(_0xe5a5,0x1a8));var _0x5e5a=function(_0x3804b6,_0x5020cc){_0x3804b6=_0x3804b6-0x0;var _0x4caba6=_0xe5a5[_0x3804b6];return _0x4caba6;};'use strict';var _=require('lodash');var util=require(_0x5e5a('0x0'));var moment=require(_0x5e5a('0x1'));var BPromise=require(_0x5e5a('0x2'));var rs=require(_0x5e5a('0x3'));var fs=require('fs');var Redis=require(_0x5e5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e5a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5e5a('0x6'));var jayson=require(_0x5e5a('0x7'));var client=jayson[_0x5e5a('0x8')]['http']({'port':0x232a});config[_0x5e5a('0x9')]=_[_0x5e5a('0xa')](config['redis'],{'host':_0x5e5a('0xb'),'port':0x18eb});var socket=require(_0x5e5a('0xc'))(new Redis(config['redis']));require(_0x5e5a('0xd'))[_0x5e5a('0xe')](socket);function respondWithRpcPromise(_0x511e70,_0x1f32d1,_0x53932a){return new BPromise(function(_0xb5c698,_0x5e32c6){return client[_0x5e5a('0xf')](_0x511e70,_0x53932a)[_0x5e5a('0x10')](function(_0x2fc89b){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x1f32d1,_0x5e5a('0x11'));logger[_0x5e5a('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1f32d1,_0x5e5a('0x11'),JSON[_0x5e5a('0x13')](_0x2fc89b));if(_0x2fc89b[_0x5e5a('0x14')]){if(_0x2fc89b[_0x5e5a('0x14')][_0x5e5a('0x15')]===0x1f4){logger[_0x5e5a('0x14')](_0x5e5a('0x16'),_0x1f32d1,_0x2fc89b[_0x5e5a('0x14')][_0x5e5a('0x17')]);return _0x5e32c6(_0x2fc89b[_0x5e5a('0x14')][_0x5e5a('0x17')]);}logger[_0x5e5a('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x1f32d1,_0x2fc89b[_0x5e5a('0x14')]['message']);return _0xb5c698(_0x2fc89b[_0x5e5a('0x14')][_0x5e5a('0x17')]);}else{logger[_0x5e5a('0x18')](_0x5e5a('0x16'),_0x1f32d1,'request\x20sent');_0xb5c698(_0x2fc89b['result'][_0x5e5a('0x17')]);}})[_0x5e5a('0x19')](function(_0x1f281d){logger['error'](_0x5e5a('0x16'),_0x1f32d1,_0x1f281d);_0x5e32c6(_0x1f281d);});});}exports[_0x5e5a('0x1a')]=function(_0x1810ae){var _0x50863e=this;return new Promise(function(_0x24858a,_0x10ff7a){return db[_0x5e5a('0x1b')]['findAll']({'raw':_0x1810ae[_0x5e5a('0x1c')]?_0x1810ae[_0x5e5a('0x1c')][_0x5e5a('0x1d')]===undefined?!![]:![]:!![],'where':_0x1810ae[_0x5e5a('0x1c')]?_0x1810ae[_0x5e5a('0x1c')]['where']||null:null,'attributes':_0x1810ae['options']?_0x1810ae['options'][_0x5e5a('0x1e')]||null:null,'limit':_0x1810ae[_0x5e5a('0x1c')]?_0x1810ae[_0x5e5a('0x1c')]['limit']||null:null,'include':_0x1810ae[_0x5e5a('0x1c')]?_0x1810ae[_0x5e5a('0x1c')]['include']?_[_0x5e5a('0x1f')](_0x1810ae['options'][_0x5e5a('0x20')],function(_0x10594c){return{'model':db[_0x10594c[_0x5e5a('0x21')]],'as':_0x10594c['as'],'attributes':_0x10594c[_0x5e5a('0x1e')],'include':_0x10594c[_0x5e5a('0x20')]?_[_0x5e5a('0x1f')](_0x10594c[_0x5e5a('0x20')],function(_0x28aacb){return{'model':db[_0x28aacb['model']],'as':_0x28aacb['as'],'attributes':_0x28aacb[_0x5e5a('0x1e')],'include':_0x28aacb[_0x5e5a('0x20')]?_[_0x5e5a('0x1f')](_0x28aacb['include'],function(_0x3be78b){return{'model':db[_0x3be78b[_0x5e5a('0x21')]],'as':_0x3be78b['as'],'attributes':_0x3be78b[_0x5e5a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5e5a('0x10')](function(_0x211a8e){logger['info'](_0x5e5a('0x1a'),_0x1810ae);logger[_0x5e5a('0x12')](_0x5e5a('0x1a'),_0x1810ae,JSON[_0x5e5a('0x13')](_0x211a8e));_0x24858a(_0x211a8e);})[_0x5e5a('0x19')](function(_0x219569){logger[_0x5e5a('0x14')](_0x5e5a('0x1a'),_0x219569['message'],_0x1810ae);_0x10ff7a(_0x50863e[_0x5e5a('0x14')](0x1f4,_0x219569[_0x5e5a('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x3e130d){var _0x36ca23=this;return new Promise(function(_0x55db05,_0x357949){return db['OpenchannelQueue']['find']({'raw':_0x3e130d[_0x5e5a('0x1c')]?_0x3e130d[_0x5e5a('0x1c')][_0x5e5a('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e130d[_0x5e5a('0x1c')]?_0x3e130d[_0x5e5a('0x1c')][_0x5e5a('0x22')]||null:null,'attributes':_0x3e130d[_0x5e5a('0x1c')]?_0x3e130d[_0x5e5a('0x1c')][_0x5e5a('0x1e')]||null:null,'include':_0x3e130d[_0x5e5a('0x1c')]?_0x3e130d[_0x5e5a('0x1c')][_0x5e5a('0x20')]?_[_0x5e5a('0x1f')](_0x3e130d[_0x5e5a('0x1c')][_0x5e5a('0x20')],function(_0x3a8323){return{'model':db[_0x3a8323['model']],'as':_0x3a8323['as'],'attributes':_0x3a8323[_0x5e5a('0x1e')],'include':_0x3a8323[_0x5e5a('0x20')]?_[_0x5e5a('0x1f')](_0x3a8323[_0x5e5a('0x20')],function(_0x32b0fa){return{'model':db[_0x32b0fa['model']],'as':_0x32b0fa['as'],'attributes':_0x32b0fa[_0x5e5a('0x1e')],'include':_0x32b0fa[_0x5e5a('0x20')]?_[_0x5e5a('0x1f')](_0x32b0fa[_0x5e5a('0x20')],function(_0x10851b){return{'model':db[_0x10851b[_0x5e5a('0x21')]],'as':_0x10851b['as'],'attributes':_0x10851b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e5a('0x10')](function(_0x3d33c1){logger[_0x5e5a('0x18')](_0x5e5a('0x23'),_0x3e130d);logger[_0x5e5a('0x12')](_0x5e5a('0x23'),_0x3e130d,JSON['stringify'](_0x3d33c1));_0x55db05(_0x3d33c1);})[_0x5e5a('0x19')](function(_0x4ee4ac){logger[_0x5e5a('0x14')]('ShowOpenchannelQueue',_0x4ee4ac['message'],_0x3e130d);_0x357949(_0x36ca23[_0x5e5a('0x14')](0x1f4,_0x4ee4ac[_0x5e5a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 74f554d..2806064 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 _0x79ad=['length','openchannelQueue:','./openchannelQueue.events','save','update','emit','removeListener','register'];(function(_0x446402,_0x5d670e){var _0x35f84d=function(_0x69c82b){while(--_0x69c82b){_0x446402['push'](_0x446402['shift']());}};_0x35f84d(++_0x5d670e);}(_0x79ad,0x1f2));var _0xd79a=function(_0xf84ac0,_0x9d03c4){_0xf84ac0=_0xf84ac0-0x0;var _0x53bdf6=_0x79ad[_0xf84ac0];return _0x53bdf6;};'use strict';var OpenchannelQueueEvents=require(_0xd79a('0x0'));var events=[_0xd79a('0x1'),'remove',_0xd79a('0x2')];function createListener(_0x32272e,_0x17daa2){return function(_0x386790){_0x17daa2[_0xd79a('0x3')](_0x32272e,_0x386790);};}function removeListener(_0x10395a,_0xea5e8){return function(){OpenchannelQueueEvents[_0xd79a('0x4')](_0x10395a,_0xea5e8);};}exports[_0xd79a('0x5')]=function(_0x1de372){for(var _0x26c0b1=0x0,_0x417aeb=events[_0xd79a('0x6')];_0x26c0b1<_0x417aeb;_0x26c0b1++){var _0x17e396=events[_0x26c0b1];var _0x2b66a2=createListener(_0xd79a('0x7')+_0x17e396,_0x1de372);OpenchannelQueueEvents['on'](_0x17e396,_0x2b66a2);}}; \ No newline at end of file +var _0x8320=['remove','update','emit','removeListener','register','length','./openchannelQueue.events','save'];(function(_0x3b9a14,_0x210288){var _0x5addf1=function(_0x456953){while(--_0x456953){_0x3b9a14['push'](_0x3b9a14['shift']());}};_0x5addf1(++_0x210288);}(_0x8320,0x1b6));var _0x0832=function(_0x312b2b,_0x2174f3){_0x312b2b=_0x312b2b-0x0;var _0x1d6a18=_0x8320[_0x312b2b];return _0x1d6a18;};'use strict';var OpenchannelQueueEvents=require(_0x0832('0x0'));var events=[_0x0832('0x1'),_0x0832('0x2'),_0x0832('0x3')];function createListener(_0x191916,_0x1f7b75){return function(_0x3f316a){_0x1f7b75[_0x0832('0x4')](_0x191916,_0x3f316a);};}function removeListener(_0x5d856a,_0x3b6362){return function(){OpenchannelQueueEvents[_0x0832('0x5')](_0x5d856a,_0x3b6362);};}exports[_0x0832('0x6')]=function(_0x1f4679){for(var _0x2b5131=0x0,_0x2d6798=events[_0x0832('0x7')];_0x2b5131<_0x2d6798;_0x2b5131++){var _0x4fc91b=events[_0x2b5131];var _0x530c77=createListener('openchannelQueue:'+_0x4fc91b,_0x1f4679);OpenchannelQueueEvents['on'](_0x4fc91b,_0x530c77);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 1a10892..71870b2 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 _0x5ac5=['describe','post','create','put','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x16bf05,_0x4f70da){var _0xbcf546=function(_0x70b01d){while(--_0x70b01d){_0x16bf05['push'](_0x16bf05['shift']());}};_0xbcf546(++_0x4f70da);}(_0x5ac5,0x148));var _0x55ac=function(_0x41428b,_0xe6dbc7){_0x41428b=_0x41428b-0x0;var _0x3d32df=_0x5ac5[_0x41428b];return _0x3d32df;};'use strict';var multer=require('multer');var util=require(_0x55ac('0x0'));var path=require(_0x55ac('0x1'));var timeout=require('connect-timeout');var express=require(_0x55ac('0x2'));var router=express['Router']();var fs_extra=require(_0x55ac('0x3'));var auth=require(_0x55ac('0x4'));var interaction=require(_0x55ac('0x5'));var config=require(_0x55ac('0x6'));var controller=require(_0x55ac('0x7'));router[_0x55ac('0x8')]('/',auth[_0x55ac('0x9')](),controller[_0x55ac('0xa')]);router[_0x55ac('0x8')](_0x55ac('0xb'),auth[_0x55ac('0x9')](),controller[_0x55ac('0xc')]);router[_0x55ac('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x55ac('0xd')]('/',auth[_0x55ac('0x9')](),controller[_0x55ac('0xe')]);router[_0x55ac('0xf')](_0x55ac('0x10'),auth[_0x55ac('0x9')](),controller[_0x55ac('0x11')]);router[_0x55ac('0x12')](_0x55ac('0x10'),auth[_0x55ac('0x9')](),controller[_0x55ac('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0bf4=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x0bf4,0xaa));var _0x40bf=function(_0xd98def,_0x19ebc7){_0xd98def=_0xd98def-0x0;var _0x55b182=_0x0bf4[_0xd98def];return _0x55b182;};'use strict';var multer=require(_0x40bf('0x0'));var util=require(_0x40bf('0x1'));var path=require('path');var timeout=require(_0x40bf('0x2'));var express=require('express');var router=express[_0x40bf('0x3')]();var fs_extra=require(_0x40bf('0x4'));var auth=require(_0x40bf('0x5'));var interaction=require(_0x40bf('0x6'));var config=require(_0x40bf('0x7'));var controller=require(_0x40bf('0x8'));router['get']('/',auth[_0x40bf('0x9')](),controller[_0x40bf('0xa')]);router['get'](_0x40bf('0xb'),auth[_0x40bf('0x9')](),controller[_0x40bf('0xc')]);router[_0x40bf('0xd')](_0x40bf('0xe'),auth['isAuthenticated'](),controller[_0x40bf('0xf')]);router[_0x40bf('0x10')]('/',auth[_0x40bf('0x9')](),controller[_0x40bf('0x11')]);router[_0x40bf('0x12')]('/:id',auth[_0x40bf('0x9')](),controller[_0x40bf('0x13')]);router[_0x40bf('0x14')]('/:id',auth[_0x40bf('0x9')](),controller[_0x40bf('0x15')]);module[_0x40bf('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index f4627b4..8eea5f4 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 _0x3dd9=['DATE','sequelize','exports','STRING'];(function(_0x2267da,_0x399abd){var _0x4191f2=function(_0x47e40b){while(--_0x47e40b){_0x2267da['push'](_0x2267da['shift']());}};_0x4191f2(++_0x399abd);}(_0x3dd9,0x1d1));var _0x93dd=function(_0x243d6f,_0x340401){_0x243d6f=_0x243d6f-0x0;var _0x2a3c3f=_0x3dd9[_0x243d6f];return _0x2a3c3f;};'use strict';var moment=require('moment');var Sequelize=require(_0x93dd('0x0'));module[_0x93dd('0x1')]={'uniqueid':{'type':Sequelize[_0x93dd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x93dd('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x93dd('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x93dd('0x2')]}}; \ No newline at end of file +var _0x02a0=['moment','sequelize','exports','STRING','DATE'];(function(_0x1d3d1a,_0x2a3dde){var _0x4bc3ad=function(_0x534345){while(--_0x534345){_0x1d3d1a['push'](_0x1d3d1a['shift']());}};_0x4bc3ad(++_0x2a3dde);}(_0x02a0,0x1db));var _0x002a=function(_0x2e074b,_0x532604){_0x2e074b=_0x2e074b-0x0;var _0x866658=_0x02a0[_0x2e074b];return _0x866658;};'use strict';var moment=require(_0x002a('0x0'));var Sequelize=require(_0x002a('0x1'));module[_0x002a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x002a('0x3')]},'joinAt':{'type':Sequelize[_0x002a('0x4')]},'leaveAt':{'type':Sequelize[_0x002a('0x4')]},'acceptAt':{'type':Sequelize[_0x002a('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x002a('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index e7f3603..dbbb17e 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 _0x0e9a=['../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','merge','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e9a,0x1b3));var _0xa0e9=function(_0x5509bb,_0x39882b){_0x5509bb=_0x5509bb-0x0;var _0x2e7d5b=_0x0e9a[_0x5509bb];return _0x2e7d5b;};'use strict';var emlformat=require(_0xa0e9('0x0'));var rimraf=require(_0xa0e9('0x1'));var zipdir=require(_0xa0e9('0x2'));var jsonpatch=require(_0xa0e9('0x3'));var rp=require(_0xa0e9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa0e9('0x5'));var util=require(_0xa0e9('0x6'));var path=require(_0xa0e9('0x7'));var sox=require(_0xa0e9('0x8'));var csv=require(_0xa0e9('0x9'));var ejs=require(_0xa0e9('0xa'));var fs=require('fs');var fs_extra=require(_0xa0e9('0xb'));var _=require(_0xa0e9('0xc'));var squel=require('squel');var crypto=require(_0xa0e9('0xd'));var jsforce=require(_0xa0e9('0xe'));var deskjs=require(_0xa0e9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa0e9('0x10'));var Papa=require(_0xa0e9('0x11'));var Redis=require('ioredis');var authService=require(_0xa0e9('0x12'));var qs=require(_0xa0e9('0x13'));var as=require(_0xa0e9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0e9('0x15'))(_0xa0e9('0x16'));var utils=require('../../config/utils');var config=require(_0xa0e9('0x17'));var licenseUtil=require(_0xa0e9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57c7f3,_0x3e51b6){_0x3e51b6=_0x3e51b6||0xcc;return function(_0x234798){if(_0x234798){return _0x57c7f3['sendStatus'](_0x3e51b6);}return _0x57c7f3['status'](_0x3e51b6)['end']();};}function respondWithResult(_0x6e4d42,_0x5d56f8){_0x5d56f8=_0x5d56f8||0xc8;return function(_0x2503d2){if(_0x2503d2){return _0x6e4d42[_0xa0e9('0x19')](_0x5d56f8)[_0xa0e9('0x1a')](_0x2503d2);}};}function respondWithFilteredResult(_0x50cff9,_0x41d153){return function(_0x467559){if(_0x467559){var _0x4140c9=typeof _0x41d153[_0xa0e9('0x1b')]===_0xa0e9('0x1c')&&typeof _0x41d153[_0xa0e9('0x1d')]===_0xa0e9('0x1c');var _0x19fe49=_0x467559['count'];var _0xb86c4f=_0x4140c9?0x0:_0x41d153['offset'];var _0x413a66=_0x4140c9?_0x467559[_0xa0e9('0x1e')]:_0x41d153[_0xa0e9('0x1b')]+_0x41d153[_0xa0e9('0x1d')];var _0x549b6c;if(_0x413a66>=_0x19fe49){_0x413a66=_0x19fe49;_0x549b6c=0xc8;}else{_0x549b6c=0xce;}_0x50cff9[_0xa0e9('0x19')](_0x549b6c);return _0x50cff9[_0xa0e9('0x1f')](_0xa0e9('0x20'),_0xb86c4f+'-'+_0x413a66+'/'+_0x19fe49)[_0xa0e9('0x1a')](_0x467559);}return null;};}function patchUpdates(_0x361664){return function(_0x15cf1a){try{jsonpatch[_0xa0e9('0x21')](_0x15cf1a,_0x361664,!![]);}catch(_0x83ac6b){return BPromise[_0xa0e9('0x22')](_0x83ac6b);}return _0x15cf1a[_0xa0e9('0x23')]();};}function saveUpdates(_0x5a1237,_0x224e86){return function(_0x182c7a){if(_0x182c7a){return _0x182c7a[_0xa0e9('0x24')](_0x5a1237)['then'](function(_0x29b8f0){return _0x29b8f0;});}return null;};}function removeEntity(_0x78f81a,_0x2c0480){return function(_0x219644){if(_0x219644){return _0x219644['destroy']()[_0xa0e9('0x25')](function(){_0x78f81a['status'](0xcc)[_0xa0e9('0x26')]();});}};}function handleEntityNotFound(_0x4ad773,_0x326078){return function(_0x56b606){if(!_0x56b606){_0x4ad773[_0xa0e9('0x27')](0x194);}return _0x56b606;};}function handleError(_0x14b675,_0x3604f0){_0x3604f0=_0x3604f0||0x1f4;return function(_0x355913){logger['error'](_0x355913[_0xa0e9('0x28')]);if(_0x355913[_0xa0e9('0x29')]){delete _0x355913['name'];}_0x14b675[_0xa0e9('0x19')](_0x3604f0)[_0xa0e9('0x2a')](_0x355913);};}exports[_0xa0e9('0x2b')]=function(_0x41e016,_0x10770f){var _0xc15932={},_0x585699={},_0x4abb9b={'count':0x0,'rows':[]};var _0x5a9405=_[_0xa0e9('0x2c')](db[_0xa0e9('0x2d')][_0xa0e9('0x2e')],function(_0x534e6c){return{'name':_0x534e6c[_0xa0e9('0x2f')],'type':_0x534e6c[_0xa0e9('0x30')][_0xa0e9('0x31')]};});_0x585699[_0xa0e9('0x32')]=_[_0xa0e9('0x2c')](_0x5a9405,_0xa0e9('0x29'));_0x585699[_0xa0e9('0x33')]=_[_0xa0e9('0x34')](_0x41e016[_0xa0e9('0x33')]);_0x585699[_0xa0e9('0x35')]=_[_0xa0e9('0x36')](_0x585699['model'],_0x585699['query']);_0xc15932[_0xa0e9('0x37')]=_[_0xa0e9('0x36')](_0x585699['model'],qs[_0xa0e9('0x38')](_0x41e016['query'][_0xa0e9('0x38')]));_0xc15932[_0xa0e9('0x37')]=_0xc15932[_0xa0e9('0x37')][_0xa0e9('0x39')]?_0xc15932[_0xa0e9('0x37')]:_0x585699['model'];if(!_0x41e016[_0xa0e9('0x33')][_0xa0e9('0x3a')]('nolimit')){_0xc15932[_0xa0e9('0x1d')]=qs[_0xa0e9('0x1d')](_0x41e016[_0xa0e9('0x33')]['limit']);_0xc15932['offset']=qs[_0xa0e9('0x1b')](_0x41e016[_0xa0e9('0x33')][_0xa0e9('0x1b')]);}_0xc15932['order']=qs[_0xa0e9('0x3b')](_0x41e016['query'][_0xa0e9('0x3b')]);_0xc15932[_0xa0e9('0x3c')]=qs[_0xa0e9('0x35')](_[_0xa0e9('0x3d')](_0x41e016[_0xa0e9('0x33')],_0x585699['filters']),_0x5a9405);if(_0x41e016[_0xa0e9('0x33')][_0xa0e9('0x3e')]){_0xc15932[_0xa0e9('0x3c')]=_['merge'](_0xc15932[_0xa0e9('0x3c')],{'$or':_['map'](_0x5a9405,function(_0x3c93b5){if(_0x3c93b5['type']!==_0xa0e9('0x3f')){var _0x280913={};_0x280913[_0x3c93b5[_0xa0e9('0x29')]]={'$like':'%'+_0x41e016[_0xa0e9('0x33')][_0xa0e9('0x3e')]+'%'};return _0x280913;}})});}_0xc15932=_['merge']({},_0xc15932,_0x41e016['options']);var _0x2dcd3a={'where':_0xc15932['where']};return db['OpenchannelQueueReport']['count'](_0x2dcd3a)[_0xa0e9('0x25')](function(_0x17b6db){_0x4abb9b['count']=_0x17b6db;if(_0x41e016[_0xa0e9('0x33')]['includeAll']){_0xc15932[_0xa0e9('0x40')]=[{'all':!![]}];}return db[_0xa0e9('0x2d')][_0xa0e9('0x41')](_0xc15932);})[_0xa0e9('0x25')](function(_0x31f176){_0x4abb9b[_0xa0e9('0x42')]=_0x31f176;return _0x4abb9b;})[_0xa0e9('0x25')](respondWithFilteredResult(_0x10770f,_0xc15932))[_0xa0e9('0x43')](handleError(_0x10770f,null));};exports[_0xa0e9('0x44')]=function(_0x5c11d3,_0x5d3662){var _0x307fbd={'raw':!![],'where':{'id':_0x5c11d3[_0xa0e9('0x45')]['id']}},_0xd6e1f7={};_0xd6e1f7[_0xa0e9('0x32')]=_[_0xa0e9('0x34')](db[_0xa0e9('0x2d')][_0xa0e9('0x2e')]);_0xd6e1f7[_0xa0e9('0x33')]=_[_0xa0e9('0x34')](_0x5c11d3[_0xa0e9('0x33')]);_0xd6e1f7['filters']=_[_0xa0e9('0x36')](_0xd6e1f7['model'],_0xd6e1f7['query']);_0x307fbd[_0xa0e9('0x37')]=_[_0xa0e9('0x36')](_0xd6e1f7[_0xa0e9('0x32')],qs[_0xa0e9('0x38')](_0x5c11d3['query'][_0xa0e9('0x38')]));_0x307fbd[_0xa0e9('0x37')]=_0x307fbd[_0xa0e9('0x37')]['length']?_0x307fbd[_0xa0e9('0x37')]:_0xd6e1f7[_0xa0e9('0x32')];if(_0x5c11d3[_0xa0e9('0x33')][_0xa0e9('0x46')]){_0x307fbd[_0xa0e9('0x40')]=[{'all':!![]}];}_0x307fbd=_[_0xa0e9('0x47')]({},_0x307fbd,_0x5c11d3['options']);return db[_0xa0e9('0x2d')]['find'](_0x307fbd)[_0xa0e9('0x25')](handleEntityNotFound(_0x5d3662,null))['then'](respondWithResult(_0x5d3662,null))[_0xa0e9('0x43')](handleError(_0x5d3662,null));};exports['create']=function(_0x3fc7ce,_0x2ee11d){return db[_0xa0e9('0x2d')]['create'](_0x3fc7ce[_0xa0e9('0x48')],{})[_0xa0e9('0x25')](respondWithResult(_0x2ee11d,0xc9))[_0xa0e9('0x43')](handleError(_0x2ee11d,null));};exports[_0xa0e9('0x24')]=function(_0x438f20,_0x1592f){if(_0x438f20[_0xa0e9('0x48')]['id']){delete _0x438f20['body']['id'];}return db[_0xa0e9('0x2d')]['find']({'where':{'id':_0x438f20[_0xa0e9('0x45')]['id']}})[_0xa0e9('0x25')](handleEntityNotFound(_0x1592f,null))[_0xa0e9('0x25')](saveUpdates(_0x438f20['body'],null))[_0xa0e9('0x25')](respondWithResult(_0x1592f,null))['catch'](handleError(_0x1592f,null));};exports[_0xa0e9('0x49')]=function(_0x5ce1c3,_0x581a38){return db['OpenchannelQueueReport'][_0xa0e9('0x4a')]({'where':{'id':_0x5ce1c3[_0xa0e9('0x45')]['id']}})[_0xa0e9('0x25')](handleEntityNotFound(_0x581a38,null))[_0xa0e9('0x25')](removeEntity(_0x581a38,null))[_0xa0e9('0x43')](handleError(_0x581a38,null));};exports[_0xa0e9('0x4b')]=function(_0x28efc8,_0x4e7cc3){return db[_0xa0e9('0x2d')][_0xa0e9('0x4b')]()[_0xa0e9('0x25')](respondWithResult(_0x4e7cc3,null))['catch'](handleError(_0x4e7cc3,null));}; \ No newline at end of file +var _0x3f40=['sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','length','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x3f40,0x1d5));var _0x03f4=function(_0x5c5529,_0xfe8cc7){_0x5c5529=_0x5c5529-0x0;var _0x28694c=_0x3f40[_0x5c5529];return _0x28694c;};'use strict';var emlformat=require(_0x03f4('0x0'));var rimraf=require(_0x03f4('0x1'));var zipdir=require(_0x03f4('0x2'));var jsonpatch=require(_0x03f4('0x3'));var rp=require(_0x03f4('0x4'));var moment=require(_0x03f4('0x5'));var BPromise=require(_0x03f4('0x6'));var Mustache=require(_0x03f4('0x7'));var util=require('util');var path=require(_0x03f4('0x8'));var sox=require(_0x03f4('0x9'));var csv=require(_0x03f4('0xa'));var ejs=require(_0x03f4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03f4('0xc'));var squel=require('squel');var crypto=require(_0x03f4('0xd'));var jsforce=require(_0x03f4('0xe'));var deskjs=require(_0x03f4('0xf'));var toCsv=require(_0x03f4('0xa'));var querystring=require(_0x03f4('0x10'));var Papa=require(_0x03f4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03f4('0x12'));var as=require(_0x03f4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x03f4('0x14'));var utils=require(_0x03f4('0x15'));var config=require(_0x03f4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x03f4('0x17'))['db'];function respondWithStatusCode(_0x31961b,_0x382f19){_0x382f19=_0x382f19||0xcc;return function(_0x1a9617){if(_0x1a9617){return _0x31961b[_0x03f4('0x18')](_0x382f19);}return _0x31961b[_0x03f4('0x19')](_0x382f19)[_0x03f4('0x1a')]();};}function respondWithResult(_0x5743f1,_0x287a5c){_0x287a5c=_0x287a5c||0xc8;return function(_0x5b0bcd){if(_0x5b0bcd){return _0x5743f1['status'](_0x287a5c)['json'](_0x5b0bcd);}};}function respondWithFilteredResult(_0x1e4bc3,_0x122744){return function(_0x4487b9){if(_0x4487b9){var _0x4bddfe=typeof _0x122744[_0x03f4('0x1b')]===_0x03f4('0x1c')&&typeof _0x122744[_0x03f4('0x1d')]===_0x03f4('0x1c');var _0x39503f=_0x4487b9['count'];var _0x3b6cd5=_0x4bddfe?0x0:_0x122744[_0x03f4('0x1b')];var _0x2ba530=_0x4bddfe?_0x4487b9[_0x03f4('0x1e')]:_0x122744[_0x03f4('0x1b')]+_0x122744[_0x03f4('0x1d')];var _0xfa9191;if(_0x2ba530>=_0x39503f){_0x2ba530=_0x39503f;_0xfa9191=0xc8;}else{_0xfa9191=0xce;}_0x1e4bc3[_0x03f4('0x19')](_0xfa9191);return _0x1e4bc3['set'](_0x03f4('0x1f'),_0x3b6cd5+'-'+_0x2ba530+'/'+_0x39503f)[_0x03f4('0x20')](_0x4487b9);}return null;};}function patchUpdates(_0x2cdb9c){return function(_0x3a84e2){try{jsonpatch['apply'](_0x3a84e2,_0x2cdb9c,!![]);}catch(_0x46c51b){return BPromise[_0x03f4('0x21')](_0x46c51b);}return _0x3a84e2[_0x03f4('0x22')]();};}function saveUpdates(_0x306bb6,_0x4ca6c4){return function(_0x2c5fc2){if(_0x2c5fc2){return _0x2c5fc2[_0x03f4('0x23')](_0x306bb6)['then'](function(_0x599ca2){return _0x599ca2;});}return null;};}function removeEntity(_0x14c25d,_0x4c4c52){return function(_0x2ff446){if(_0x2ff446){return _0x2ff446[_0x03f4('0x24')]()[_0x03f4('0x25')](function(){_0x14c25d[_0x03f4('0x19')](0xcc)[_0x03f4('0x1a')]();});}};}function handleEntityNotFound(_0x2adace,_0x40cfec){return function(_0x1a0f56){if(!_0x1a0f56){_0x2adace['sendStatus'](0x194);}return _0x1a0f56;};}function handleError(_0x3713eb,_0x11e8e3){_0x11e8e3=_0x11e8e3||0x1f4;return function(_0x481fbf){logger['error'](_0x481fbf[_0x03f4('0x26')]);if(_0x481fbf['name']){delete _0x481fbf[_0x03f4('0x27')];}_0x3713eb[_0x03f4('0x19')](_0x11e8e3)[_0x03f4('0x28')](_0x481fbf);};}exports[_0x03f4('0x29')]=function(_0x4c2c3d,_0x3ad456){var _0x44a56f={},_0x56a669={},_0x4cd71c={'count':0x0,'rows':[]};var _0x5e36c6=_[_0x03f4('0x2a')](db[_0x03f4('0x2b')][_0x03f4('0x2c')],function(_0x205102){return{'name':_0x205102[_0x03f4('0x2d')],'type':_0x205102[_0x03f4('0x2e')][_0x03f4('0x2f')]};});_0x56a669[_0x03f4('0x30')]=_[_0x03f4('0x2a')](_0x5e36c6,_0x03f4('0x27'));_0x56a669[_0x03f4('0x31')]=_[_0x03f4('0x32')](_0x4c2c3d[_0x03f4('0x31')]);_0x56a669[_0x03f4('0x33')]=_['intersection'](_0x56a669['model'],_0x56a669[_0x03f4('0x31')]);_0x44a56f[_0x03f4('0x34')]=_[_0x03f4('0x35')](_0x56a669['model'],qs[_0x03f4('0x36')](_0x4c2c3d[_0x03f4('0x31')][_0x03f4('0x36')]));_0x44a56f[_0x03f4('0x34')]=_0x44a56f[_0x03f4('0x34')]['length']?_0x44a56f['attributes']:_0x56a669['model'];if(!_0x4c2c3d[_0x03f4('0x31')]['hasOwnProperty'](_0x03f4('0x37'))){_0x44a56f[_0x03f4('0x1d')]=qs[_0x03f4('0x1d')](_0x4c2c3d['query'][_0x03f4('0x1d')]);_0x44a56f['offset']=qs[_0x03f4('0x1b')](_0x4c2c3d['query'][_0x03f4('0x1b')]);}_0x44a56f['order']=qs['sort'](_0x4c2c3d[_0x03f4('0x31')][_0x03f4('0x38')]);_0x44a56f[_0x03f4('0x39')]=qs[_0x03f4('0x33')](_[_0x03f4('0x3a')](_0x4c2c3d[_0x03f4('0x31')],_0x56a669[_0x03f4('0x33')]),_0x5e36c6);if(_0x4c2c3d[_0x03f4('0x31')]['filter']){_0x44a56f['where']=_[_0x03f4('0x3b')](_0x44a56f[_0x03f4('0x39')],{'$or':_['map'](_0x5e36c6,function(_0x1dba5c){if(_0x1dba5c[_0x03f4('0x2e')]!==_0x03f4('0x3c')){var _0x51c029={};_0x51c029[_0x1dba5c['name']]={'$like':'%'+_0x4c2c3d[_0x03f4('0x31')][_0x03f4('0x3d')]+'%'};return _0x51c029;}})});}_0x44a56f=_['merge']({},_0x44a56f,_0x4c2c3d[_0x03f4('0x3e')]);var _0x16fbf2={'where':_0x44a56f[_0x03f4('0x39')]};return db[_0x03f4('0x2b')][_0x03f4('0x1e')](_0x16fbf2)['then'](function(_0x4c5e45){_0x4cd71c[_0x03f4('0x1e')]=_0x4c5e45;if(_0x4c2c3d[_0x03f4('0x31')]['includeAll']){_0x44a56f[_0x03f4('0x3f')]=[{'all':!![]}];}return db[_0x03f4('0x2b')][_0x03f4('0x40')](_0x44a56f);})[_0x03f4('0x25')](function(_0x404c37){_0x4cd71c[_0x03f4('0x41')]=_0x404c37;return _0x4cd71c;})[_0x03f4('0x25')](respondWithFilteredResult(_0x3ad456,_0x44a56f))['catch'](handleError(_0x3ad456,null));};exports[_0x03f4('0x42')]=function(_0x77e331,_0x4eb7b0){var _0x464b32={'raw':!![],'where':{'id':_0x77e331['params']['id']}},_0x63bcc5={};_0x63bcc5[_0x03f4('0x30')]=_['keys'](db['OpenchannelQueueReport'][_0x03f4('0x2c')]);_0x63bcc5[_0x03f4('0x31')]=_['keys'](_0x77e331[_0x03f4('0x31')]);_0x63bcc5[_0x03f4('0x33')]=_[_0x03f4('0x35')](_0x63bcc5[_0x03f4('0x30')],_0x63bcc5[_0x03f4('0x31')]);_0x464b32[_0x03f4('0x34')]=_['intersection'](_0x63bcc5['model'],qs['fields'](_0x77e331[_0x03f4('0x31')]['fields']));_0x464b32[_0x03f4('0x34')]=_0x464b32['attributes'][_0x03f4('0x43')]?_0x464b32[_0x03f4('0x34')]:_0x63bcc5[_0x03f4('0x30')];if(_0x77e331[_0x03f4('0x31')][_0x03f4('0x44')]){_0x464b32[_0x03f4('0x3f')]=[{'all':!![]}];}_0x464b32=_['merge']({},_0x464b32,_0x77e331['options']);return db[_0x03f4('0x2b')][_0x03f4('0x45')](_0x464b32)[_0x03f4('0x25')](handleEntityNotFound(_0x4eb7b0,null))[_0x03f4('0x25')](respondWithResult(_0x4eb7b0,null))[_0x03f4('0x46')](handleError(_0x4eb7b0,null));};exports[_0x03f4('0x47')]=function(_0x2f5bd5,_0x28a1a2){return db['OpenchannelQueueReport'][_0x03f4('0x47')](_0x2f5bd5[_0x03f4('0x48')],{})[_0x03f4('0x25')](respondWithResult(_0x28a1a2,0xc9))[_0x03f4('0x46')](handleError(_0x28a1a2,null));};exports['update']=function(_0x11c06c,_0x1892cc){if(_0x11c06c[_0x03f4('0x48')]['id']){delete _0x11c06c[_0x03f4('0x48')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x11c06c[_0x03f4('0x49')]['id']}})[_0x03f4('0x25')](handleEntityNotFound(_0x1892cc,null))[_0x03f4('0x25')](saveUpdates(_0x11c06c['body'],null))[_0x03f4('0x25')](respondWithResult(_0x1892cc,null))[_0x03f4('0x46')](handleError(_0x1892cc,null));};exports[_0x03f4('0x24')]=function(_0x2b8f6c,_0x12d25b){return db[_0x03f4('0x2b')][_0x03f4('0x45')]({'where':{'id':_0x2b8f6c[_0x03f4('0x49')]['id']}})[_0x03f4('0x25')](handleEntityNotFound(_0x12d25b,null))[_0x03f4('0x25')](removeEntity(_0x12d25b,null))[_0x03f4('0x46')](handleError(_0x12d25b,null));};exports[_0x03f4('0x4a')]=function(_0x41bafd,_0x1566f7){return db[_0x03f4('0x2b')][_0x03f4('0x4a')]()['then'](respondWithResult(_0x1566f7,null))['catch'](handleError(_0x1566f7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6c4a0ee..c688faa 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x4322fb,_0x2a933b){var _0x1dbffc=function(_0x363ae8){while(--_0x363ae8){_0x4322fb['push'](_0x4322fb['shift']());}};_0x1dbffc(++_0x2a933b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0xa6699c,_0x14e7ba){var _0x3a7e22=function(_0x279e2d){while(--_0x279e2d){_0xa6699c['push'](_0xa6699c['shift']());}};_0x3a7e22(++_0x14e7ba);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc4aa[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 4e40dd4..54f7643 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 _0x06ef=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelQueueReport,\x20%s,\x20%s','body','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','limit','moment','../../config/utils','../../config/logger'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x06ef,0x185));var _0xf06e=function(_0x2c9b89,_0x2865fd){_0x2c9b89=_0x2c9b89-0x0;var _0x1fa60d=_0x06ef[_0x2c9b89];return _0x1fa60d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf06e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf06e('0x1'));var logger=require(_0xf06e('0x2'))(_0xf06e('0x3'));var config=require('../../config/environment');var jayson=require(_0xf06e('0x4'));var client=jayson[_0xf06e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b74b,_0x4e05dc,_0x5cddf1){return new BPromise(function(_0x4ccbee,_0x25b56e){return client[_0xf06e('0x6')](_0x59b74b,_0x5cddf1)[_0xf06e('0x7')](function(_0x2bb08c){logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));logger[_0xf06e('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'),JSON[_0xf06e('0xb')](_0x2bb08c));if(_0x2bb08c[_0xf06e('0xc')]){if(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xd')]===0x1f4){logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);return _0x25b56e(_0x2bb08c['error'][_0xf06e('0xe')]);}logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c['error']['message']);return _0x4ccbee(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);}else{logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));_0x4ccbee(_0x2bb08c[_0xf06e('0xf')][_0xf06e('0xe')]);}})[_0xf06e('0x10')](function(_0x44157a){logger[_0xf06e('0xc')](_0xf06e('0x11'),_0x4e05dc,_0x44157a);_0x25b56e(_0x44157a);});});}exports['CreateOpenchannelQueueReport']=function(_0x380c07){var _0x55dabf=this;return new Promise(function(_0x251c9f,_0x7a9f4b){return db['OpenchannelQueueReport']['create'](_0x380c07[_0xf06e('0x12')],{'raw':_0x380c07[_0xf06e('0x13')]?_0x380c07['options']['raw']===undefined?!![]:![]:!![]})[_0xf06e('0x7')](function(_0x211590){logger[_0xf06e('0x8')]('CreateOpenchannelQueueReport',_0x380c07);logger[_0xf06e('0xa')](_0xf06e('0x14'),_0x380c07,JSON['stringify'](_0x211590));_0x251c9f(_0x211590);})[_0xf06e('0x10')](function(_0x1ba130){logger[_0xf06e('0xc')]('CreateOpenchannelQueueReport',_0x1ba130[_0xf06e('0xe')],_0x380c07);_0x7a9f4b(_0x55dabf[_0xf06e('0xc')](0x1f4,_0x1ba130[_0xf06e('0xe')]));});});};exports[_0xf06e('0x15')]=function(_0x3b410e){var _0x4c2d01=this;return new Promise(function(_0x3a969c,_0x4923d3){return db[_0xf06e('0x16')][_0xf06e('0x17')](_0x3b410e[_0xf06e('0x12')],{'raw':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x19')]||null:null,'attributes':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1a')]||null:null,'limit':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1b')]||null:null})[_0xf06e('0x7')](function(_0x89a74f){logger[_0xf06e('0x8')](_0xf06e('0x15'),_0x3b410e);logger['debug'](_0xf06e('0x15'),_0x3b410e,JSON[_0xf06e('0xb')](_0x89a74f));_0x3a969c(_0x89a74f);})[_0xf06e('0x10')](function(_0x5d21f7){logger[_0xf06e('0xc')](_0xf06e('0x15'),_0x5d21f7[_0xf06e('0xe')],_0x3b410e);_0x4923d3(_0x4c2d01[_0xf06e('0xc')](0x1f4,_0x5d21f7[_0xf06e('0xe')]));});});}; \ No newline at end of file +var _0xefda=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefda,0x96));var _0xaefd=function(_0x19c038,_0xfd8fe1){_0x19c038=_0x19c038-0x0;var _0x4b737a=_0xefda[_0x19c038];return _0x4b737a;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['OpenchannelQueueReport'][_0xaefd('0x18')](_0x9748f4[_0xaefd('0x19')],{'raw':_0x9748f4[_0xaefd('0x1a')]?_0x9748f4[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![]})[_0xaefd('0xb')](function(_0x5282ed){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger[_0xaefd('0xd')](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5282ed));_0x2db61b(_0x5282ed);})['catch'](function(_0x479486){logger['error'](_0xaefd('0x17'),_0x479486[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1[_0xaefd('0x10')](0x1f4,_0x479486['message']));});});};exports[_0xaefd('0x1c')]=function(_0x4cd9b2){var _0x3deec8=this;return new Promise(function(_0x3caa99,_0x1a05eb){return db['OpenchannelQueueReport'][_0xaefd('0x1d')](_0x4cd9b2[_0xaefd('0x19')],{'raw':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cd9b2['options']?_0x4cd9b2[_0xaefd('0x1a')]['where']||null:null,'attributes':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')]['attributes']||null:null,'limit':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')]['limit']||null:null})[_0xaefd('0xb')](function(_0x114ec0){logger[_0xaefd('0x14')]('UpdateOpenchannelQueueReport',_0x4cd9b2);logger[_0xaefd('0xd')]('UpdateOpenchannelQueueReport',_0x4cd9b2,JSON[_0xaefd('0xf')](_0x114ec0));_0x3caa99(_0x114ec0);})['catch'](function(_0x4a1acb){logger[_0xaefd('0x10')](_0xaefd('0x1c'),_0x4a1acb['message'],_0x4cd9b2);_0x1a05eb(_0x3deec8['error'](0x1f4,_0x4a1acb['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index b84bfd5..9ccdf92 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 _0xb93b=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','post','put','update','delete'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb93b,0x132));var _0xbb93=function(_0x417e0a,_0x446db8){_0x417e0a=_0x417e0a-0x0;var _0x223dab=_0xb93b[_0x417e0a];return _0x223dab;};'use strict';var multer=require(_0xbb93('0x0'));var util=require(_0xbb93('0x1'));var path=require(_0xbb93('0x2'));var timeout=require(_0xbb93('0x3'));var express=require('express');var router=express[_0xbb93('0x4')]();var fs_extra=require(_0xbb93('0x5'));var auth=require(_0xbb93('0x6'));var interaction=require(_0xbb93('0x7'));var config=require(_0xbb93('0x8'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0xbb93('0x9')](),controller['index']);router[_0xbb93('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xbb93('0xb')]);router[_0xbb93('0xa')](_0xbb93('0xc'),auth[_0xbb93('0x9')](),controller['show']);router[_0xbb93('0xd')]('/',auth[_0xbb93('0x9')](),controller['create']);router[_0xbb93('0xe')]('/:id',auth[_0xbb93('0x9')](),controller[_0xbb93('0xf')]);router[_0xbb93('0x10')](_0xbb93('0xc'),auth[_0xbb93('0x9')](),controller[_0xbb93('0x11')]);module[_0xbb93('0x12')]=router; \ No newline at end of file +var _0x8c35=['post','update','delete','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0x8c35,0x1cf));var _0x58c3=function(_0x5d633c,_0x406b8d){_0x5d633c=_0x5d633c-0x0;var _0x43635d=_0x8c35[_0x5d633c];return _0x43635d;};'use strict';var multer=require(_0x58c3('0x0'));var util=require('util');var path=require(_0x58c3('0x1'));var timeout=require(_0x58c3('0x2'));var express=require('express');var router=express[_0x58c3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58c3('0x4'));var config=require(_0x58c3('0x5'));var controller=require(_0x58c3('0x6'));router[_0x58c3('0x7')]('/',auth[_0x58c3('0x8')](),controller[_0x58c3('0x9')]);router[_0x58c3('0x7')](_0x58c3('0xa'),auth[_0x58c3('0x8')](),controller['describe']);router[_0x58c3('0x7')](_0x58c3('0xb'),auth[_0x58c3('0x8')](),controller[_0x58c3('0xc')]);router[_0x58c3('0xd')]('/',auth[_0x58c3('0x8')](),controller['create']);router['put'](_0x58c3('0xb'),auth['isAuthenticated'](),controller[_0x58c3('0xe')]);router[_0x58c3('0xf')](_0x58c3('0xb'),auth[_0x58c3('0x8')](),controller['destroy']);module[_0x58c3('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 34cc11c..452a507 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x43cdc5,_0x2f19ba){var _0x2da6c5=function(_0x1bf4f7){while(--_0x1bf4f7){_0x43cdc5['push'](_0x43cdc5['shift']());}};_0x2da6c5(++_0x2f19ba);}(_0x008c,0x188));var _0xc008=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x008c[_0x2074db];return _0x27324c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x173bd4,_0x456d43){var _0x2f7eac=function(_0x312503){while(--_0x312503){_0x173bd4['push'](_0x173bd4['shift']());}};_0x2f7eac(++_0x456d43);}(_0x70e0,0x17b));var _0x070e=function(_0x325893,_0x6973d9){_0x325893=_0x325893-0x0;var _0x116b87=_0x70e0[_0x325893];return _0x116b87;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 48104d2..27828ab 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 _0x7f1b=['hasOwnProperty','order','sort','where','pick','merge','type','filter','OpenchannelTransferReport','include','rows','catch','show','params','intersection','length','find','create','body','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','papaparse','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','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields'];(function(_0x5d0e88,_0x6a6bdb){var _0x4e5871=function(_0x18862c){while(--_0x18862c){_0x5d0e88['push'](_0x5d0e88['shift']());}};_0x4e5871(++_0x6a6bdb);}(_0x7f1b,0xae));var _0xb7f1=function(_0x18c7be,_0x14cb6d){_0x18c7be=_0x18c7be-0x0;var _0x256568=_0x7f1b[_0x18c7be];return _0x256568;};'use strict';var emlformat=require(_0xb7f1('0x0'));var rimraf=require(_0xb7f1('0x1'));var zipdir=require(_0xb7f1('0x2'));var jsonpatch=require(_0xb7f1('0x3'));var rp=require(_0xb7f1('0x4'));var moment=require('moment');var BPromise=require(_0xb7f1('0x5'));var Mustache=require(_0xb7f1('0x6'));var util=require(_0xb7f1('0x7'));var path=require(_0xb7f1('0x8'));var sox=require(_0xb7f1('0x9'));var csv=require(_0xb7f1('0xa'));var ejs=require(_0xb7f1('0xb'));var fs=require('fs');var fs_extra=require(_0xb7f1('0xc'));var _=require(_0xb7f1('0xd'));var squel=require(_0xb7f1('0xe'));var crypto=require(_0xb7f1('0xf'));var jsforce=require(_0xb7f1('0x10'));var deskjs=require(_0xb7f1('0x11'));var toCsv=require(_0xb7f1('0xa'));var querystring=require('querystring');var Papa=require(_0xb7f1('0x12'));var Redis=require(_0xb7f1('0x13'));var authService=require(_0xb7f1('0x14'));var qs=require(_0xb7f1('0x15'));var as=require(_0xb7f1('0x16'));var hardwareService=require(_0xb7f1('0x17'));var logger=require(_0xb7f1('0x18'))('api');var utils=require(_0xb7f1('0x19'));var config=require(_0xb7f1('0x1a'));var licenseUtil=require(_0xb7f1('0x1b'));var db=require(_0xb7f1('0x1c'))['db'];function respondWithStatusCode(_0xd9f760,_0x4d9a66){_0x4d9a66=_0x4d9a66||0xcc;return function(_0x418822){if(_0x418822){return _0xd9f760['sendStatus'](_0x4d9a66);}return _0xd9f760[_0xb7f1('0x1d')](_0x4d9a66)[_0xb7f1('0x1e')]();};}function respondWithResult(_0x565435,_0x87b79b){_0x87b79b=_0x87b79b||0xc8;return function(_0x53b673){if(_0x53b673){return _0x565435[_0xb7f1('0x1d')](_0x87b79b)['json'](_0x53b673);}};}function respondWithFilteredResult(_0x42cba6,_0x5ac967){return function(_0x522ae4){if(_0x522ae4){var _0x8be7bd=typeof _0x5ac967[_0xb7f1('0x1f')]===_0xb7f1('0x20')&&typeof _0x5ac967[_0xb7f1('0x21')]===_0xb7f1('0x20');var _0x167049=_0x522ae4['count'];var _0x42534c=_0x8be7bd?0x0:_0x5ac967[_0xb7f1('0x1f')];var _0x5d68e6=_0x8be7bd?_0x522ae4[_0xb7f1('0x22')]:_0x5ac967[_0xb7f1('0x1f')]+_0x5ac967[_0xb7f1('0x21')];var _0x34bc86;if(_0x5d68e6>=_0x167049){_0x5d68e6=_0x167049;_0x34bc86=0xc8;}else{_0x34bc86=0xce;}_0x42cba6[_0xb7f1('0x1d')](_0x34bc86);return _0x42cba6[_0xb7f1('0x23')](_0xb7f1('0x24'),_0x42534c+'-'+_0x5d68e6+'/'+_0x167049)[_0xb7f1('0x25')](_0x522ae4);}return null;};}function patchUpdates(_0x48fb42){return function(_0x43835c){try{jsonpatch[_0xb7f1('0x26')](_0x43835c,_0x48fb42,!![]);}catch(_0x480195){return BPromise['reject'](_0x480195);}return _0x43835c['save']();};}function saveUpdates(_0x5d1d79,_0x14627c){return function(_0x292feb){if(_0x292feb){return _0x292feb[_0xb7f1('0x27')](_0x5d1d79)[_0xb7f1('0x28')](function(_0x10f351){return _0x10f351;});}return null;};}function removeEntity(_0x4c53d2,_0x3edadb){return function(_0x312edb){if(_0x312edb){return _0x312edb[_0xb7f1('0x29')]()[_0xb7f1('0x28')](function(){_0x4c53d2[_0xb7f1('0x1d')](0xcc)[_0xb7f1('0x1e')]();});}};}function handleEntityNotFound(_0x5a8d03,_0x3089a2){return function(_0x48b3cb){if(!_0x48b3cb){_0x5a8d03[_0xb7f1('0x2a')](0x194);}return _0x48b3cb;};}function handleError(_0x5d953e,_0x2f5419){_0x2f5419=_0x2f5419||0x1f4;return function(_0x2c0647){logger['error'](_0x2c0647[_0xb7f1('0x2b')]);if(_0x2c0647['name']){delete _0x2c0647[_0xb7f1('0x2c')];}_0x5d953e[_0xb7f1('0x1d')](_0x2f5419)[_0xb7f1('0x2d')](_0x2c0647);};}exports[_0xb7f1('0x2e')]=function(_0x10a5d0,_0x48df1e){var _0x3b0119={},_0x58fcfe={},_0x540047={'count':0x0,'rows':[]};var _0x2b7a08=_[_0xb7f1('0x2f')](db['OpenchannelTransferReport'][_0xb7f1('0x30')],function(_0x4b6ec5){return{'name':_0x4b6ec5[_0xb7f1('0x31')],'type':_0x4b6ec5['type'][_0xb7f1('0x32')]};});_0x58fcfe['model']=_[_0xb7f1('0x2f')](_0x2b7a08,_0xb7f1('0x2c'));_0x58fcfe[_0xb7f1('0x33')]=_[_0xb7f1('0x34')](_0x10a5d0[_0xb7f1('0x33')]);_0x58fcfe[_0xb7f1('0x35')]=_['intersection'](_0x58fcfe[_0xb7f1('0x36')],_0x58fcfe[_0xb7f1('0x33')]);_0x3b0119[_0xb7f1('0x37')]=_['intersection'](_0x58fcfe[_0xb7f1('0x36')],qs['fields'](_0x10a5d0[_0xb7f1('0x33')][_0xb7f1('0x38')]));_0x3b0119['attributes']=_0x3b0119[_0xb7f1('0x37')]['length']?_0x3b0119[_0xb7f1('0x37')]:_0x58fcfe['model'];if(!_0x10a5d0[_0xb7f1('0x33')][_0xb7f1('0x39')]('nolimit')){_0x3b0119[_0xb7f1('0x21')]=qs['limit'](_0x10a5d0[_0xb7f1('0x33')]['limit']);_0x3b0119[_0xb7f1('0x1f')]=qs[_0xb7f1('0x1f')](_0x10a5d0['query'][_0xb7f1('0x1f')]);}_0x3b0119[_0xb7f1('0x3a')]=qs[_0xb7f1('0x3b')](_0x10a5d0[_0xb7f1('0x33')][_0xb7f1('0x3b')]);_0x3b0119[_0xb7f1('0x3c')]=qs[_0xb7f1('0x35')](_[_0xb7f1('0x3d')](_0x10a5d0[_0xb7f1('0x33')],_0x58fcfe[_0xb7f1('0x35')]),_0x2b7a08);if(_0x10a5d0['query']['filter']){_0x3b0119[_0xb7f1('0x3c')]=_[_0xb7f1('0x3e')](_0x3b0119['where'],{'$or':_[_0xb7f1('0x2f')](_0x2b7a08,function(_0x46be47){if(_0x46be47[_0xb7f1('0x3f')]!=='VIRTUAL'){var _0x36d7cd={};_0x36d7cd[_0x46be47[_0xb7f1('0x2c')]]={'$like':'%'+_0x10a5d0[_0xb7f1('0x33')][_0xb7f1('0x40')]+'%'};return _0x36d7cd;}})});}_0x3b0119=_[_0xb7f1('0x3e')]({},_0x3b0119,_0x10a5d0['options']);var _0x1b7f2a={'where':_0x3b0119['where']};return db[_0xb7f1('0x41')]['count'](_0x1b7f2a)['then'](function(_0x377c3b){_0x540047[_0xb7f1('0x22')]=_0x377c3b;if(_0x10a5d0[_0xb7f1('0x33')]['includeAll']){_0x3b0119[_0xb7f1('0x42')]=[{'all':!![]}];}return db[_0xb7f1('0x41')]['findAll'](_0x3b0119);})[_0xb7f1('0x28')](function(_0x14bc54){_0x540047[_0xb7f1('0x43')]=_0x14bc54;return _0x540047;})['then'](respondWithFilteredResult(_0x48df1e,_0x3b0119))[_0xb7f1('0x44')](handleError(_0x48df1e,null));};exports[_0xb7f1('0x45')]=function(_0x1255d4,_0xcf31f9){var _0x173826={'raw':!![],'where':{'id':_0x1255d4[_0xb7f1('0x46')]['id']}},_0x24c66d={};_0x24c66d['model']=_[_0xb7f1('0x34')](db['OpenchannelTransferReport'][_0xb7f1('0x30')]);_0x24c66d['query']=_[_0xb7f1('0x34')](_0x1255d4[_0xb7f1('0x33')]);_0x24c66d[_0xb7f1('0x35')]=_[_0xb7f1('0x47')](_0x24c66d[_0xb7f1('0x36')],_0x24c66d[_0xb7f1('0x33')]);_0x173826[_0xb7f1('0x37')]=_[_0xb7f1('0x47')](_0x24c66d[_0xb7f1('0x36')],qs[_0xb7f1('0x38')](_0x1255d4['query']['fields']));_0x173826[_0xb7f1('0x37')]=_0x173826['attributes'][_0xb7f1('0x48')]?_0x173826[_0xb7f1('0x37')]:_0x24c66d['model'];if(_0x1255d4[_0xb7f1('0x33')]['includeAll']){_0x173826[_0xb7f1('0x42')]=[{'all':!![]}];}_0x173826=_[_0xb7f1('0x3e')]({},_0x173826,_0x1255d4['options']);return db[_0xb7f1('0x41')][_0xb7f1('0x49')](_0x173826)[_0xb7f1('0x28')](handleEntityNotFound(_0xcf31f9,null))['then'](respondWithResult(_0xcf31f9,null))['catch'](handleError(_0xcf31f9,null));};exports[_0xb7f1('0x4a')]=function(_0x27dc56,_0x48793b){return db[_0xb7f1('0x41')][_0xb7f1('0x4a')](_0x27dc56[_0xb7f1('0x4b')],{})[_0xb7f1('0x28')](respondWithResult(_0x48793b,0xc9))['catch'](handleError(_0x48793b,null));};exports['update']=function(_0x55d3bd,_0x45172){if(_0x55d3bd[_0xb7f1('0x4b')]['id']){delete _0x55d3bd[_0xb7f1('0x4b')]['id'];}return db[_0xb7f1('0x41')]['find']({'where':{'id':_0x55d3bd[_0xb7f1('0x46')]['id']}})['then'](handleEntityNotFound(_0x45172,null))[_0xb7f1('0x28')](saveUpdates(_0x55d3bd[_0xb7f1('0x4b')],null))[_0xb7f1('0x28')](respondWithResult(_0x45172,null))['catch'](handleError(_0x45172,null));};exports[_0xb7f1('0x29')]=function(_0x330bec,_0x155d41){return db[_0xb7f1('0x41')][_0xb7f1('0x49')]({'where':{'id':_0x330bec[_0xb7f1('0x46')]['id']}})[_0xb7f1('0x28')](handleEntityNotFound(_0x155d41,null))[_0xb7f1('0x28')](removeEntity(_0x155d41,null))[_0xb7f1('0x44')](handleError(_0x155d41,null));};exports[_0xb7f1('0x4c')]=function(_0x2a481a,_0x213e7a){return db[_0xb7f1('0x41')]['describe']()[_0xb7f1('0x28')](respondWithResult(_0x213e7a,null))['catch'](handleError(_0x213e7a,null));}; \ No newline at end of file +var _0xb205=['json','reject','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','OpenchannelTransferReport','includeAll','include','catch','show','params','fields','length','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set'];(function(_0x241ea5,_0x510707){var _0x30a5d6=function(_0x59b5a3){while(--_0x59b5a3){_0x241ea5['push'](_0x241ea5['shift']());}};_0x30a5d6(++_0x510707);}(_0xb205,0x156));var _0x5b20=function(_0x260a8f,_0x587e5d){_0x260a8f=_0x260a8f-0x0;var _0x5b3d6e=_0xb205[_0x260a8f];return _0x5b3d6e;};'use strict';var emlformat=require(_0x5b20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b20('0x1'));var jsonpatch=require(_0x5b20('0x2'));var rp=require('request-promise');var moment=require(_0x5b20('0x3'));var BPromise=require(_0x5b20('0x4'));var Mustache=require('mustache');var util=require(_0x5b20('0x5'));var path=require(_0x5b20('0x6'));var sox=require(_0x5b20('0x7'));var csv=require(_0x5b20('0x8'));var ejs=require(_0x5b20('0x9'));var fs=require('fs');var fs_extra=require(_0x5b20('0xa'));var _=require(_0x5b20('0xb'));var squel=require(_0x5b20('0xc'));var crypto=require(_0x5b20('0xd'));var jsforce=require(_0x5b20('0xe'));var deskjs=require(_0x5b20('0xf'));var toCsv=require(_0x5b20('0x8'));var querystring=require(_0x5b20('0x10'));var Papa=require('papaparse');var Redis=require(_0x5b20('0x11'));var authService=require(_0x5b20('0x12'));var qs=require(_0x5b20('0x13'));var as=require(_0x5b20('0x14'));var hardwareService=require(_0x5b20('0x15'));var logger=require(_0x5b20('0x16'))(_0x5b20('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b20('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x591147,_0xfa1ed3){_0xfa1ed3=_0xfa1ed3||0xcc;return function(_0xbe63a7){if(_0xbe63a7){return _0x591147[_0x5b20('0x19')](_0xfa1ed3);}return _0x591147['status'](_0xfa1ed3)[_0x5b20('0x1a')]();};}function respondWithResult(_0x8f72aa,_0x24d338){_0x24d338=_0x24d338||0xc8;return function(_0x23ced2){if(_0x23ced2){return _0x8f72aa[_0x5b20('0x1b')](_0x24d338)['json'](_0x23ced2);}};}function respondWithFilteredResult(_0x3c3ae4,_0x3f3230){return function(_0x3d91a7){if(_0x3d91a7){var _0x1797b4=typeof _0x3f3230[_0x5b20('0x1c')]===_0x5b20('0x1d')&&typeof _0x3f3230[_0x5b20('0x1e')]===_0x5b20('0x1d');var _0x2d0374=_0x3d91a7['count'];var _0x91f92b=_0x1797b4?0x0:_0x3f3230[_0x5b20('0x1c')];var _0x2bb1a9=_0x1797b4?_0x3d91a7[_0x5b20('0x1f')]:_0x3f3230[_0x5b20('0x1c')]+_0x3f3230[_0x5b20('0x1e')];var _0x5adc39;if(_0x2bb1a9>=_0x2d0374){_0x2bb1a9=_0x2d0374;_0x5adc39=0xc8;}else{_0x5adc39=0xce;}_0x3c3ae4[_0x5b20('0x1b')](_0x5adc39);return _0x3c3ae4[_0x5b20('0x20')]('Content-Range',_0x91f92b+'-'+_0x2bb1a9+'/'+_0x2d0374)[_0x5b20('0x21')](_0x3d91a7);}return null;};}function patchUpdates(_0x45963d){return function(_0x25d7a6){try{jsonpatch['apply'](_0x25d7a6,_0x45963d,!![]);}catch(_0x588361){return BPromise[_0x5b20('0x22')](_0x588361);}return _0x25d7a6['save']();};}function saveUpdates(_0x18e0ed,_0x51c46a){return function(_0x2146c2){if(_0x2146c2){return _0x2146c2['update'](_0x18e0ed)['then'](function(_0x48ee97){return _0x48ee97;});}return null;};}function removeEntity(_0x3b4143,_0x2d21c9){return function(_0x193d92){if(_0x193d92){return _0x193d92[_0x5b20('0x23')]()[_0x5b20('0x24')](function(){_0x3b4143['status'](0xcc)[_0x5b20('0x1a')]();});}};}function handleEntityNotFound(_0x49dd97,_0x4ba73b){return function(_0x3d13c6){if(!_0x3d13c6){_0x49dd97[_0x5b20('0x19')](0x194);}return _0x3d13c6;};}function handleError(_0x2bb48f,_0x232a34){_0x232a34=_0x232a34||0x1f4;return function(_0x342ba8){logger[_0x5b20('0x25')](_0x342ba8[_0x5b20('0x26')]);if(_0x342ba8[_0x5b20('0x27')]){delete _0x342ba8[_0x5b20('0x27')];}_0x2bb48f[_0x5b20('0x1b')](_0x232a34)[_0x5b20('0x28')](_0x342ba8);};}exports[_0x5b20('0x29')]=function(_0x540117,_0x37859b){var _0x44d9e0={},_0x4810fc={},_0x5d9b8e={'count':0x0,'rows':[]};var _0x455006=_[_0x5b20('0x2a')](db['OpenchannelTransferReport'][_0x5b20('0x2b')],function(_0x59981d){return{'name':_0x59981d[_0x5b20('0x2c')],'type':_0x59981d[_0x5b20('0x2d')][_0x5b20('0x2e')]};});_0x4810fc[_0x5b20('0x2f')]=_[_0x5b20('0x2a')](_0x455006,_0x5b20('0x27'));_0x4810fc[_0x5b20('0x30')]=_[_0x5b20('0x31')](_0x540117[_0x5b20('0x30')]);_0x4810fc['filters']=_[_0x5b20('0x32')](_0x4810fc[_0x5b20('0x2f')],_0x4810fc['query']);_0x44d9e0[_0x5b20('0x33')]=_[_0x5b20('0x32')](_0x4810fc['model'],qs['fields'](_0x540117['query']['fields']));_0x44d9e0[_0x5b20('0x33')]=_0x44d9e0['attributes']['length']?_0x44d9e0['attributes']:_0x4810fc['model'];if(!_0x540117[_0x5b20('0x30')]['hasOwnProperty'](_0x5b20('0x34'))){_0x44d9e0['limit']=qs[_0x5b20('0x1e')](_0x540117['query'][_0x5b20('0x1e')]);_0x44d9e0[_0x5b20('0x1c')]=qs[_0x5b20('0x1c')](_0x540117[_0x5b20('0x30')][_0x5b20('0x1c')]);}_0x44d9e0[_0x5b20('0x35')]=qs[_0x5b20('0x36')](_0x540117[_0x5b20('0x30')][_0x5b20('0x36')]);_0x44d9e0[_0x5b20('0x37')]=qs[_0x5b20('0x38')](_[_0x5b20('0x39')](_0x540117[_0x5b20('0x30')],_0x4810fc[_0x5b20('0x38')]),_0x455006);if(_0x540117[_0x5b20('0x30')]['filter']){_0x44d9e0[_0x5b20('0x37')]=_[_0x5b20('0x3a')](_0x44d9e0[_0x5b20('0x37')],{'$or':_['map'](_0x455006,function(_0x40343b){if(_0x40343b[_0x5b20('0x2d')]!==_0x5b20('0x3b')){var _0x40cdc4={};_0x40cdc4[_0x40343b['name']]={'$like':'%'+_0x540117[_0x5b20('0x30')][_0x5b20('0x3c')]+'%'};return _0x40cdc4;}})});}_0x44d9e0=_[_0x5b20('0x3a')]({},_0x44d9e0,_0x540117[_0x5b20('0x3d')]);var _0x2c2873={'where':_0x44d9e0[_0x5b20('0x37')]};return db[_0x5b20('0x3e')][_0x5b20('0x1f')](_0x2c2873)[_0x5b20('0x24')](function(_0x3120e2){_0x5d9b8e['count']=_0x3120e2;if(_0x540117[_0x5b20('0x30')][_0x5b20('0x3f')]){_0x44d9e0[_0x5b20('0x40')]=[{'all':!![]}];}return db[_0x5b20('0x3e')]['findAll'](_0x44d9e0);})[_0x5b20('0x24')](function(_0x267fa0){_0x5d9b8e['rows']=_0x267fa0;return _0x5d9b8e;})[_0x5b20('0x24')](respondWithFilteredResult(_0x37859b,_0x44d9e0))[_0x5b20('0x41')](handleError(_0x37859b,null));};exports[_0x5b20('0x42')]=function(_0x6df9bc,_0x49e8ce){var _0x33c73b={'raw':!![],'where':{'id':_0x6df9bc[_0x5b20('0x43')]['id']}},_0x52c150={};_0x52c150[_0x5b20('0x2f')]=_[_0x5b20('0x31')](db[_0x5b20('0x3e')][_0x5b20('0x2b')]);_0x52c150[_0x5b20('0x30')]=_[_0x5b20('0x31')](_0x6df9bc[_0x5b20('0x30')]);_0x52c150[_0x5b20('0x38')]=_['intersection'](_0x52c150[_0x5b20('0x2f')],_0x52c150['query']);_0x33c73b['attributes']=_[_0x5b20('0x32')](_0x52c150['model'],qs['fields'](_0x6df9bc['query'][_0x5b20('0x44')]));_0x33c73b[_0x5b20('0x33')]=_0x33c73b['attributes'][_0x5b20('0x45')]?_0x33c73b[_0x5b20('0x33')]:_0x52c150['model'];if(_0x6df9bc[_0x5b20('0x30')][_0x5b20('0x3f')]){_0x33c73b['include']=[{'all':!![]}];}_0x33c73b=_[_0x5b20('0x3a')]({},_0x33c73b,_0x6df9bc[_0x5b20('0x3d')]);return db['OpenchannelTransferReport'][_0x5b20('0x46')](_0x33c73b)[_0x5b20('0x24')](handleEntityNotFound(_0x49e8ce,null))['then'](respondWithResult(_0x49e8ce,null))['catch'](handleError(_0x49e8ce,null));};exports['create']=function(_0x90dcb1,_0x379716){return db[_0x5b20('0x3e')][_0x5b20('0x47')](_0x90dcb1['body'],{})[_0x5b20('0x24')](respondWithResult(_0x379716,0xc9))[_0x5b20('0x41')](handleError(_0x379716,null));};exports[_0x5b20('0x48')]=function(_0x534d64,_0x2c3d71){if(_0x534d64['body']['id']){delete _0x534d64['body']['id'];}return db[_0x5b20('0x3e')][_0x5b20('0x46')]({'where':{'id':_0x534d64[_0x5b20('0x43')]['id']}})[_0x5b20('0x24')](handleEntityNotFound(_0x2c3d71,null))[_0x5b20('0x24')](saveUpdates(_0x534d64[_0x5b20('0x49')],null))[_0x5b20('0x24')](respondWithResult(_0x2c3d71,null))['catch'](handleError(_0x2c3d71,null));};exports[_0x5b20('0x23')]=function(_0x102aa5,_0x21f5ba){return db[_0x5b20('0x3e')][_0x5b20('0x46')]({'where':{'id':_0x102aa5[_0x5b20('0x43')]['id']}})[_0x5b20('0x24')](handleEntityNotFound(_0x21f5ba,null))['then'](removeEntity(_0x21f5ba,null))[_0x5b20('0x41')](handleError(_0x21f5ba,null));};exports[_0x5b20('0x4a')]=function(_0x4f6cf5,_0x21daaf){return db[_0x5b20('0x3e')][_0x5b20('0x4a')]()[_0x5b20('0x24')](respondWithResult(_0x21daaf,null))[_0x5b20('0x41')](handleError(_0x21daaf,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a1ab20f..a8f79e3 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 _0x5cde=['bluebird','path','exports','define','report_openchannel_transfer','uniqueid','../../config/logger'];(function(_0x5795b5,_0x5db037){var _0x58d5ae=function(_0x4cadde){while(--_0x4cadde){_0x5795b5['push'](_0x5795b5['shift']());}};_0x58d5ae(++_0x5db037);}(_0x5cde,0xfb));var _0xe5cd=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x5cde[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe5cd('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe5cd('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5cd('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0xe5cd('0x3')]=function(_0x2fdd6e,_0x5b1764){return _0x2fdd6e[_0xe5cd('0x4')]('OpenchannelTransferReport',attributes,{'tableName':_0xe5cd('0x5'),'paranoid':![],'indexes':[{'name':_0xe5cd('0x6'),'fields':[_0xe5cd('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x24e4=['report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24e4,0x147));var _0x424e=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0x24e4[_0x4ded65];return _0x5864fb;};'use strict';var _=require(_0x424e('0x0'));var util=require(_0x424e('0x1'));var logger=require('../../config/logger')(_0x424e('0x2'));var moment=require(_0x424e('0x3'));var BPromise=require(_0x424e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x424e('0x5'));var rimraf=require(_0x424e('0x6'));var config=require(_0x424e('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x424e('0x8')]=function(_0x378879,_0x14291c){return _0x378879[_0x424e('0x9')](_0x424e('0xa'),attributes,{'tableName':_0x424e('0xb'),'paranoid':![],'indexes':[{'name':_0x424e('0xc'),'fields':[_0x424e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 5c47138..22d15d2 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 _0x1a28=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x40be05,_0xb2f10c){var _0x4d8366=function(_0x7e98b7){while(--_0x7e98b7){_0x40be05['push'](_0x40be05['shift']());}};_0x4d8366(++_0xb2f10c);}(_0x1a28,0x10e));var _0x81a2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1a28[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var moment=require(_0x81a2('0x2'));var BPromise=require(_0x81a2('0x3'));var rs=require(_0x81a2('0x4'));var fs=require('fs');var Redis=require(_0x81a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x81a2('0x6'))(_0x81a2('0x7'));var config=require(_0x81a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81a2('0x9')][_0x81a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597932,_0x1aa420,_0x2aa66f){return new BPromise(function(_0x453392,_0x4672ce){return client[_0x81a2('0xb')](_0x597932,_0x2aa66f)[_0x81a2('0xc')](function(_0x3f36f5){logger[_0x81a2('0xd')](_0x81a2('0xe'),_0x1aa420,'request\x20sent');logger[_0x81a2('0xf')](_0x81a2('0x10'),_0x1aa420,_0x81a2('0x11'),JSON[_0x81a2('0x12')](_0x3f36f5));if(_0x3f36f5[_0x81a2('0x13')]){if(_0x3f36f5['error'][_0x81a2('0x14')]===0x1f4){logger[_0x81a2('0x13')](_0x81a2('0xe'),_0x1aa420,_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);return _0x4672ce(_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);}logger[_0x81a2('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1aa420,_0x3f36f5[_0x81a2('0x13')]['message']);return _0x453392(_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);}else{logger['info'](_0x81a2('0xe'),_0x1aa420,'request\x20sent');_0x453392(_0x3f36f5[_0x81a2('0x16')][_0x81a2('0x15')]);}})[_0x81a2('0x17')](function(_0x7da352){logger[_0x81a2('0x13')](_0x81a2('0xe'),_0x1aa420,_0x7da352);_0x4672ce(_0x7da352);});});} \ No newline at end of file +var _0x4148=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4148,0xc6));var _0x8414=function(_0x2ec0cc,_0x21c744){_0x2ec0cc=_0x2ec0cc-0x0;var _0x3d662=_0x4148[_0x2ec0cc];return _0x3d662;};'use strict';var _=require(_0x8414('0x0'));var util=require(_0x8414('0x1'));var moment=require(_0x8414('0x2'));var BPromise=require(_0x8414('0x3'));var rs=require(_0x8414('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8414('0x5'))['db'];var utils=require(_0x8414('0x6'));var logger=require(_0x8414('0x7'))(_0x8414('0x8'));var config=require('../../config/environment');var jayson=require(_0x8414('0x9'));var client=jayson['client'][_0x8414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x507e0b,_0x51ab01,_0x131b88){return new BPromise(function(_0x2444b7,_0x1623c3){return client[_0x8414('0xb')](_0x507e0b,_0x131b88)[_0x8414('0xc')](function(_0xd625a7){logger[_0x8414('0xd')](_0x8414('0xe'),_0x51ab01,_0x8414('0xf'));logger[_0x8414('0x10')](_0x8414('0x11'),_0x51ab01,'request\x20sent',JSON[_0x8414('0x12')](_0xd625a7));if(_0xd625a7['error']){if(_0xd625a7[_0x8414('0x13')][_0x8414('0x14')]===0x1f4){logger[_0x8414('0x13')](_0x8414('0xe'),_0x51ab01,_0xd625a7['error'][_0x8414('0x15')]);return _0x1623c3(_0xd625a7['error'][_0x8414('0x15')]);}logger[_0x8414('0x13')](_0x8414('0xe'),_0x51ab01,_0xd625a7['error'][_0x8414('0x15')]);return _0x2444b7(_0xd625a7[_0x8414('0x13')][_0x8414('0x15')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x51ab01,_0x8414('0xf'));_0x2444b7(_0xd625a7[_0x8414('0x16')][_0x8414('0x15')]);}})[_0x8414('0x17')](function(_0x5b92aa){logger[_0x8414('0x13')](_0x8414('0xe'),_0x51ab01,_0x5b92aa);_0x1623c3(_0x5b92aa);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 1b28241..b07356e 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 _0x082e=['show','create','put','delete','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./pause.controller','index','get','isAuthenticated'];(function(_0x332ef8,_0x5c0d16){var _0x575539=function(_0x4edd1a){while(--_0x4edd1a){_0x332ef8['push'](_0x332ef8['shift']());}};_0x575539(++_0x5c0d16);}(_0x082e,0x17d));var _0xe082=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x082e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe082('0x0'));var util=require(_0xe082('0x1'));var path=require(_0xe082('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe082('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe082('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe082('0x5'));var controller=require(_0xe082('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe082('0x7')]);router[_0xe082('0x8')]('/:id',auth[_0xe082('0x9')](),controller[_0xe082('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe082('0xb')]);router[_0xe082('0xc')]('/:id',auth[_0xe082('0x9')](),controller['update']);router[_0xe082('0xd')](_0xe082('0xe'),auth['isAuthenticated'](),controller[_0xe082('0xf')]);module[_0xe082('0x10')]=router; \ No newline at end of file +var _0xb447=['post','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb447,0x9e));var _0x7b44=function(_0x535d0b,_0x1e34d){_0x535d0b=_0x535d0b-0x0;var _0x146566=_0xb447[_0x535d0b];return _0x146566;};'use strict';var multer=require('multer');var util=require(_0x7b44('0x0'));var path=require(_0x7b44('0x1'));var timeout=require(_0x7b44('0x2'));var express=require(_0x7b44('0x3'));var router=express[_0x7b44('0x4')]();var fs_extra=require(_0x7b44('0x5'));var auth=require(_0x7b44('0x6'));var interaction=require(_0x7b44('0x7'));var config=require('../../config/environment');var controller=require(_0x7b44('0x8'));router[_0x7b44('0x9')]('/',auth[_0x7b44('0xa')](),controller[_0x7b44('0xb')]);router[_0x7b44('0x9')]('/:id',auth[_0x7b44('0xa')](),controller['show']);router[_0x7b44('0xc')]('/',auth[_0x7b44('0xa')](),controller['create']);router[_0x7b44('0xd')](_0x7b44('0xe'),auth[_0x7b44('0xa')](),controller['update']);router[_0x7b44('0xf')](_0x7b44('0xe'),auth[_0x7b44('0xa')](),controller[_0x7b44('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 60932b9..0293edc 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 _0x3f9f=['sequelize','exports','STRING'];(function(_0x57e932,_0x30d938){var _0x4044e8=function(_0x5516c3){while(--_0x5516c3){_0x57e932['push'](_0x57e932['shift']());}};_0x4044e8(++_0x30d938);}(_0x3f9f,0x81));var _0xf3f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f9f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf3f9('0x0'));module[_0xf3f9('0x1')]={'name':{'type':Sequelize[_0xf3f9('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf3f9('0x2')]}}; \ No newline at end of file +var _0x7dea=['name','STRING'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x7dea,0x18e));var _0xa7de=function(_0x5afac2,_0x1fdb60){_0x5afac2=_0x5afac2-0x0;var _0x110523=_0x7dea[_0x5afac2];return _0x110523;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa7de('0x0'),'allowNull':![]},'description':{'type':Sequelize[_0xa7de('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c6d56b3..1e0653b 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 _0x4d11=['hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','Pause','includeAll','include','rows','catch','show','params','merge','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','name','send','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4d11,0x1f1));var _0x14d1=function(_0x28a465,_0x558c2c){_0x28a465=_0x28a465-0x0;var _0x258386=_0x4d11[_0x28a465];return _0x258386;};'use strict';var emlformat=require(_0x14d1('0x0'));var rimraf=require(_0x14d1('0x1'));var zipdir=require(_0x14d1('0x2'));var jsonpatch=require(_0x14d1('0x3'));var rp=require('request-promise');var moment=require(_0x14d1('0x4'));var BPromise=require(_0x14d1('0x5'));var Mustache=require('mustache');var util=require(_0x14d1('0x6'));var path=require(_0x14d1('0x7'));var sox=require(_0x14d1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14d1('0x9'));var squel=require(_0x14d1('0xa'));var crypto=require(_0x14d1('0xb'));var jsforce=require(_0x14d1('0xc'));var deskjs=require(_0x14d1('0xd'));var toCsv=require(_0x14d1('0xe'));var querystring=require(_0x14d1('0xf'));var Papa=require(_0x14d1('0x10'));var Redis=require(_0x14d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14d1('0x12'));var as=require(_0x14d1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14d1('0x14'))(_0x14d1('0x15'));var utils=require(_0x14d1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x14d1('0x17'));var db=require(_0x14d1('0x18'))['db'];function respondWithStatusCode(_0x52cb82,_0x736e5){_0x736e5=_0x736e5||0xcc;return function(_0x1ccac1){if(_0x1ccac1){return _0x52cb82[_0x14d1('0x19')](_0x736e5);}return _0x52cb82[_0x14d1('0x1a')](_0x736e5)[_0x14d1('0x1b')]();};}function respondWithResult(_0x1a2f9d,_0x506108){_0x506108=_0x506108||0xc8;return function(_0x12e9dd){if(_0x12e9dd){return _0x1a2f9d[_0x14d1('0x1a')](_0x506108)[_0x14d1('0x1c')](_0x12e9dd);}};}function respondWithFilteredResult(_0x486625,_0x737460){return function(_0x44d880){if(_0x44d880){var _0x5a9758=typeof _0x737460[_0x14d1('0x1d')]===_0x14d1('0x1e')&&typeof _0x737460[_0x14d1('0x1f')]===_0x14d1('0x1e');var _0x1f0364=_0x44d880[_0x14d1('0x20')];var _0x4a7c77=_0x5a9758?0x0:_0x737460[_0x14d1('0x1d')];var _0x4742e4=_0x5a9758?_0x44d880[_0x14d1('0x20')]:_0x737460[_0x14d1('0x1d')]+_0x737460[_0x14d1('0x1f')];var _0x108f06;if(_0x4742e4>=_0x1f0364){_0x4742e4=_0x1f0364;_0x108f06=0xc8;}else{_0x108f06=0xce;}_0x486625['status'](_0x108f06);return _0x486625['set']('Content-Range',_0x4a7c77+'-'+_0x4742e4+'/'+_0x1f0364)[_0x14d1('0x1c')](_0x44d880);}return null;};}function patchUpdates(_0x131b94){return function(_0x485ff1){try{jsonpatch[_0x14d1('0x21')](_0x485ff1,_0x131b94,!![]);}catch(_0x5648f0){return BPromise[_0x14d1('0x22')](_0x5648f0);}return _0x485ff1[_0x14d1('0x23')]();};}function saveUpdates(_0x587c90,_0x327bf8){return function(_0x1defee){if(_0x1defee){return _0x1defee[_0x14d1('0x24')](_0x587c90)[_0x14d1('0x25')](function(_0x49e3a9){return _0x49e3a9;});}return null;};}function removeEntity(_0x361a7e,_0x1ed73a){return function(_0x246161){if(_0x246161){return _0x246161[_0x14d1('0x26')]()['then'](function(){var _0x2f4c96=_0x246161['get']({'plain':!![]});var _0x14a722=_0x14d1('0x27');return db[_0x14d1('0x28')][_0x14d1('0x26')]({'where':{'type':_0x14a722,'resourceId':_0x2f4c96['id']}})[_0x14d1('0x25')](function(){return _0x246161;});})['then'](function(){_0x361a7e[_0x14d1('0x1a')](0xcc)[_0x14d1('0x1b')]();});}};}function handleEntityNotFound(_0x3bd629,_0xf5bb15){return function(_0xab44f){if(!_0xab44f){_0x3bd629[_0x14d1('0x19')](0x194);}return _0xab44f;};}function handleError(_0x32f258,_0x31e528){_0x31e528=_0x31e528||0x1f4;return function(_0x1642ad){logger[_0x14d1('0x29')](_0x1642ad['stack']);if(_0x1642ad[_0x14d1('0x2a')]){delete _0x1642ad['name'];}_0x32f258[_0x14d1('0x1a')](_0x31e528)[_0x14d1('0x2b')](_0x1642ad);};}exports['index']=function(_0x2ef0c4,_0x432393){var _0x22f84c={},_0x8d6f89={},_0xc21fe2={'count':0x0,'rows':[]};var _0x4a8a3e=_[_0x14d1('0x2c')](db['Pause'][_0x14d1('0x2d')],function(_0x11b3eb){return{'name':_0x11b3eb[_0x14d1('0x2e')],'type':_0x11b3eb['type'][_0x14d1('0x2f')]};});_0x8d6f89['model']=_['map'](_0x4a8a3e,_0x14d1('0x2a'));_0x8d6f89[_0x14d1('0x30')]=_[_0x14d1('0x31')](_0x2ef0c4['query']);_0x8d6f89[_0x14d1('0x32')]=_['intersection'](_0x8d6f89[_0x14d1('0x33')],_0x8d6f89[_0x14d1('0x30')]);_0x22f84c[_0x14d1('0x34')]=_[_0x14d1('0x35')](_0x8d6f89[_0x14d1('0x33')],qs[_0x14d1('0x36')](_0x2ef0c4[_0x14d1('0x30')][_0x14d1('0x36')]));_0x22f84c[_0x14d1('0x34')]=_0x22f84c['attributes'][_0x14d1('0x37')]?_0x22f84c[_0x14d1('0x34')]:_0x8d6f89[_0x14d1('0x33')];if(!_0x2ef0c4[_0x14d1('0x30')][_0x14d1('0x38')](_0x14d1('0x39'))){_0x22f84c['limit']=qs[_0x14d1('0x1f')](_0x2ef0c4['query'][_0x14d1('0x1f')]);_0x22f84c[_0x14d1('0x1d')]=qs['offset'](_0x2ef0c4[_0x14d1('0x30')][_0x14d1('0x1d')]);}_0x22f84c[_0x14d1('0x3a')]=qs['sort'](_0x2ef0c4[_0x14d1('0x30')][_0x14d1('0x3b')]);_0x22f84c[_0x14d1('0x3c')]=qs['filters'](_['pick'](_0x2ef0c4[_0x14d1('0x30')],_0x8d6f89[_0x14d1('0x32')]),_0x4a8a3e);if(_0x2ef0c4[_0x14d1('0x30')][_0x14d1('0x3d')]){_0x22f84c[_0x14d1('0x3c')]=_['merge'](_0x22f84c[_0x14d1('0x3c')],{'$or':_[_0x14d1('0x2c')](_0x4a8a3e,function(_0x35c7e2){if(_0x35c7e2[_0x14d1('0x3e')]!==_0x14d1('0x3f')){var _0x523ff3={};_0x523ff3[_0x35c7e2[_0x14d1('0x2a')]]={'$like':'%'+_0x2ef0c4[_0x14d1('0x30')][_0x14d1('0x3d')]+'%'};return _0x523ff3;}})});}_0x22f84c=_['merge']({},_0x22f84c,_0x2ef0c4[_0x14d1('0x40')]);var _0x12163c={'where':_0x22f84c[_0x14d1('0x3c')]};return db[_0x14d1('0x41')][_0x14d1('0x20')](_0x12163c)[_0x14d1('0x25')](function(_0x314dec){_0xc21fe2['count']=_0x314dec;if(_0x2ef0c4[_0x14d1('0x30')][_0x14d1('0x42')]){_0x22f84c[_0x14d1('0x43')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x22f84c);})['then'](function(_0xb1f391){_0xc21fe2[_0x14d1('0x44')]=_0xb1f391;return _0xc21fe2;})[_0x14d1('0x25')](respondWithFilteredResult(_0x432393,_0x22f84c))[_0x14d1('0x45')](handleError(_0x432393,null));};exports[_0x14d1('0x46')]=function(_0x46d3b6,_0x4386d6){var _0x379c3f={'raw':!![],'where':{'id':_0x46d3b6[_0x14d1('0x47')]['id']}},_0x41aed6={};_0x41aed6[_0x14d1('0x33')]=_[_0x14d1('0x31')](db['Pause'][_0x14d1('0x2d')]);_0x41aed6[_0x14d1('0x30')]=_[_0x14d1('0x31')](_0x46d3b6[_0x14d1('0x30')]);_0x41aed6['filters']=_['intersection'](_0x41aed6['model'],_0x41aed6['query']);_0x379c3f[_0x14d1('0x34')]=_[_0x14d1('0x35')](_0x41aed6['model'],qs['fields'](_0x46d3b6[_0x14d1('0x30')][_0x14d1('0x36')]));_0x379c3f['attributes']=_0x379c3f['attributes'][_0x14d1('0x37')]?_0x379c3f['attributes']:_0x41aed6[_0x14d1('0x33')];if(_0x46d3b6[_0x14d1('0x30')][_0x14d1('0x42')]){_0x379c3f['include']=[{'all':!![]}];}_0x379c3f=_[_0x14d1('0x48')]({},_0x379c3f,_0x46d3b6[_0x14d1('0x40')]);return db['Pause']['find'](_0x379c3f)[_0x14d1('0x25')](handleEntityNotFound(_0x4386d6,null))[_0x14d1('0x25')](respondWithResult(_0x4386d6,null))[_0x14d1('0x45')](handleError(_0x4386d6,null));};exports['create']=function(_0x444af3,_0x37e907){return db[_0x14d1('0x41')]['create'](_0x444af3['body'],{})['then'](function(_0x45f554){var _0x230473=_0x444af3[_0x14d1('0x49')][_0x14d1('0x4a')]({'plain':!![]});if(!_0x230473)throw new Error(_0x14d1('0x4b'));if(_0x230473['role']===_0x14d1('0x49')){var _0x19231b=_0x45f554['get']({'plain':!![]});var _0x4b7eee='Pauses';return db['UserProfileSection'][_0x14d1('0x4c')]({'where':{'name':_0x4b7eee,'userProfileId':_0x230473['userProfileId']},'raw':!![]})['then'](function(_0x2d0582){if(_0x2d0582&&_0x2d0582['autoAssociation']===0x0){return db['UserProfileResource'][_0x14d1('0x4d')]({'name':_0x19231b['name'],'resourceId':_0x19231b['id'],'type':_0x2d0582[_0x14d1('0x2a')],'sectionId':_0x2d0582['id']},{})[_0x14d1('0x25')](function(){return _0x45f554;});}else{return _0x45f554;}})[_0x14d1('0x45')](function(_0x202e60){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x202e60);throw _0x202e60;});}return _0x45f554;})[_0x14d1('0x25')](respondWithResult(_0x37e907,0xc9))['catch'](handleError(_0x37e907,null));};exports[_0x14d1('0x24')]=function(_0x298193,_0x1c5d0d){if(_0x298193[_0x14d1('0x4e')]['id']){delete _0x298193[_0x14d1('0x4e')]['id'];}return db['Pause'][_0x14d1('0x4c')]({'where':{'id':_0x298193['params']['id']}})[_0x14d1('0x25')](handleEntityNotFound(_0x1c5d0d,null))[_0x14d1('0x25')](saveUpdates(_0x298193[_0x14d1('0x4e')],null))[_0x14d1('0x25')](respondWithResult(_0x1c5d0d,null))['catch'](handleError(_0x1c5d0d,null));};exports['destroy']=function(_0xdef1b1,_0x5f56bc){return db[_0x14d1('0x41')][_0x14d1('0x4c')]({'where':{'id':_0xdef1b1[_0x14d1('0x47')]['id']}})[_0x14d1('0x25')](handleEntityNotFound(_0x5f56bc,null))[_0x14d1('0x25')](removeEntity(_0x5f56bc,null))[_0x14d1('0x45')](handleError(_0x5f56bc,null));}; \ No newline at end of file +var _0x088b=['error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','destroy','get','Pauses','UserProfileResource','then'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x088b,0x1bf));var _0xb088=function(_0x16b672,_0x29071e){_0x16b672=_0x16b672-0x0;var _0x2d69d2=_0x088b[_0x16b672];return _0x2d69d2;};'use strict';var emlformat=require(_0xb088('0x0'));var rimraf=require(_0xb088('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb088('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb088('0x3'));var Mustache=require(_0xb088('0x4'));var util=require(_0xb088('0x5'));var path=require(_0xb088('0x6'));var sox=require(_0xb088('0x7'));var csv=require('to-csv');var ejs=require(_0xb088('0x8'));var fs=require('fs');var fs_extra=require(_0xb088('0x9'));var _=require(_0xb088('0xa'));var squel=require('squel');var crypto=require(_0xb088('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb088('0xc'));var toCsv=require(_0xb088('0xd'));var querystring=require(_0xb088('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb088('0xf'));var qs=require(_0xb088('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb088('0x11'))(_0xb088('0x12'));var utils=require(_0xb088('0x13'));var config=require(_0xb088('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb088('0x15'))['db'];function respondWithStatusCode(_0x453834,_0x17c0f9){_0x17c0f9=_0x17c0f9||0xcc;return function(_0x2092dd){if(_0x2092dd){return _0x453834[_0xb088('0x16')](_0x17c0f9);}return _0x453834[_0xb088('0x17')](_0x17c0f9)[_0xb088('0x18')]();};}function respondWithResult(_0x5aba8d,_0x1ebf06){_0x1ebf06=_0x1ebf06||0xc8;return function(_0x49012b){if(_0x49012b){return _0x5aba8d[_0xb088('0x17')](_0x1ebf06)[_0xb088('0x19')](_0x49012b);}};}function respondWithFilteredResult(_0xbaf961,_0x473854){return function(_0x290cac){if(_0x290cac){var _0x59e178=typeof _0x473854['offset']===_0xb088('0x1a')&&typeof _0x473854['limit']===_0xb088('0x1a');var _0x359619=_0x290cac[_0xb088('0x1b')];var _0x2aae01=_0x59e178?0x0:_0x473854[_0xb088('0x1c')];var _0x463480=_0x59e178?_0x290cac[_0xb088('0x1b')]:_0x473854[_0xb088('0x1c')]+_0x473854[_0xb088('0x1d')];var _0x1268e6;if(_0x463480>=_0x359619){_0x463480=_0x359619;_0x1268e6=0xc8;}else{_0x1268e6=0xce;}_0xbaf961['status'](_0x1268e6);return _0xbaf961[_0xb088('0x1e')](_0xb088('0x1f'),_0x2aae01+'-'+_0x463480+'/'+_0x359619)[_0xb088('0x19')](_0x290cac);}return null;};}function patchUpdates(_0x238344){return function(_0x12db12){try{jsonpatch['apply'](_0x12db12,_0x238344,!![]);}catch(_0x4932de){return BPromise['reject'](_0x4932de);}return _0x12db12[_0xb088('0x20')]();};}function saveUpdates(_0x9e9f62,_0x4cd5e5){return function(_0x5a48fa){if(_0x5a48fa){return _0x5a48fa[_0xb088('0x21')](_0x9e9f62)['then'](function(_0x1357bb){return _0x1357bb;});}return null;};}function removeEntity(_0x750263,_0x5ec646){return function(_0x5e3938){if(_0x5e3938){return _0x5e3938[_0xb088('0x22')]()['then'](function(){var _0x213e90=_0x5e3938[_0xb088('0x23')]({'plain':!![]});var _0x1432d0=_0xb088('0x24');return db[_0xb088('0x25')][_0xb088('0x22')]({'where':{'type':_0x1432d0,'resourceId':_0x213e90['id']}})['then'](function(){return _0x5e3938;});})[_0xb088('0x26')](function(){_0x750263[_0xb088('0x17')](0xcc)[_0xb088('0x18')]();});}};}function handleEntityNotFound(_0x31f0be,_0x53e18a){return function(_0x3837d1){if(!_0x3837d1){_0x31f0be[_0xb088('0x16')](0x194);}return _0x3837d1;};}function handleError(_0x497497,_0x5ec3ec){_0x5ec3ec=_0x5ec3ec||0x1f4;return function(_0x18f864){logger[_0xb088('0x27')](_0x18f864[_0xb088('0x28')]);if(_0x18f864['name']){delete _0x18f864[_0xb088('0x29')];}_0x497497['status'](_0x5ec3ec)[_0xb088('0x2a')](_0x18f864);};}exports[_0xb088('0x2b')]=function(_0x4b02b1,_0x47ebcf){var _0x3b966e={},_0x598f97={},_0x55c708={'count':0x0,'rows':[]};var _0x1c5a30=_[_0xb088('0x2c')](db[_0xb088('0x2d')][_0xb088('0x2e')],function(_0x2aa4c4){return{'name':_0x2aa4c4[_0xb088('0x2f')],'type':_0x2aa4c4[_0xb088('0x30')][_0xb088('0x31')]};});_0x598f97[_0xb088('0x32')]=_[_0xb088('0x2c')](_0x1c5a30,_0xb088('0x29'));_0x598f97[_0xb088('0x33')]=_[_0xb088('0x34')](_0x4b02b1[_0xb088('0x33')]);_0x598f97[_0xb088('0x35')]=_[_0xb088('0x36')](_0x598f97[_0xb088('0x32')],_0x598f97[_0xb088('0x33')]);_0x3b966e[_0xb088('0x37')]=_[_0xb088('0x36')](_0x598f97[_0xb088('0x32')],qs[_0xb088('0x38')](_0x4b02b1[_0xb088('0x33')][_0xb088('0x38')]));_0x3b966e['attributes']=_0x3b966e[_0xb088('0x37')][_0xb088('0x39')]?_0x3b966e['attributes']:_0x598f97[_0xb088('0x32')];if(!_0x4b02b1[_0xb088('0x33')]['hasOwnProperty'](_0xb088('0x3a'))){_0x3b966e[_0xb088('0x1d')]=qs[_0xb088('0x1d')](_0x4b02b1['query'][_0xb088('0x1d')]);_0x3b966e[_0xb088('0x1c')]=qs[_0xb088('0x1c')](_0x4b02b1[_0xb088('0x33')][_0xb088('0x1c')]);}_0x3b966e['order']=qs[_0xb088('0x3b')](_0x4b02b1[_0xb088('0x33')][_0xb088('0x3b')]);_0x3b966e[_0xb088('0x3c')]=qs[_0xb088('0x35')](_[_0xb088('0x3d')](_0x4b02b1[_0xb088('0x33')],_0x598f97[_0xb088('0x35')]),_0x1c5a30);if(_0x4b02b1[_0xb088('0x33')][_0xb088('0x3e')]){_0x3b966e['where']=_[_0xb088('0x3f')](_0x3b966e[_0xb088('0x3c')],{'$or':_[_0xb088('0x2c')](_0x1c5a30,function(_0x138733){if(_0x138733[_0xb088('0x30')]!==_0xb088('0x40')){var _0x3c1657={};_0x3c1657[_0x138733['name']]={'$like':'%'+_0x4b02b1[_0xb088('0x33')][_0xb088('0x3e')]+'%'};return _0x3c1657;}})});}_0x3b966e=_[_0xb088('0x3f')]({},_0x3b966e,_0x4b02b1[_0xb088('0x41')]);var _0x5e1b6f={'where':_0x3b966e['where']};return db[_0xb088('0x2d')][_0xb088('0x1b')](_0x5e1b6f)[_0xb088('0x26')](function(_0xe3291a){_0x55c708[_0xb088('0x1b')]=_0xe3291a;if(_0x4b02b1[_0xb088('0x33')]['includeAll']){_0x3b966e['include']=[{'all':!![]}];}return db[_0xb088('0x2d')][_0xb088('0x42')](_0x3b966e);})['then'](function(_0x4dbff8){_0x55c708[_0xb088('0x43')]=_0x4dbff8;return _0x55c708;})[_0xb088('0x26')](respondWithFilteredResult(_0x47ebcf,_0x3b966e))[_0xb088('0x44')](handleError(_0x47ebcf,null));};exports[_0xb088('0x45')]=function(_0xef93ce,_0x3b0cbf){var _0x1989bd={'raw':!![],'where':{'id':_0xef93ce[_0xb088('0x46')]['id']}},_0xc3a97a={};_0xc3a97a[_0xb088('0x32')]=_[_0xb088('0x34')](db[_0xb088('0x2d')]['rawAttributes']);_0xc3a97a[_0xb088('0x33')]=_[_0xb088('0x34')](_0xef93ce[_0xb088('0x33')]);_0xc3a97a['filters']=_[_0xb088('0x36')](_0xc3a97a['model'],_0xc3a97a[_0xb088('0x33')]);_0x1989bd['attributes']=_['intersection'](_0xc3a97a['model'],qs[_0xb088('0x38')](_0xef93ce['query'][_0xb088('0x38')]));_0x1989bd[_0xb088('0x37')]=_0x1989bd[_0xb088('0x37')][_0xb088('0x39')]?_0x1989bd[_0xb088('0x37')]:_0xc3a97a[_0xb088('0x32')];if(_0xef93ce[_0xb088('0x33')][_0xb088('0x47')]){_0x1989bd['include']=[{'all':!![]}];}_0x1989bd=_[_0xb088('0x3f')]({},_0x1989bd,_0xef93ce[_0xb088('0x41')]);return db['Pause']['find'](_0x1989bd)['then'](handleEntityNotFound(_0x3b0cbf,null))[_0xb088('0x26')](respondWithResult(_0x3b0cbf,null))['catch'](handleError(_0x3b0cbf,null));};exports[_0xb088('0x48')]=function(_0x4d6406,_0x48b1b2){return db[_0xb088('0x2d')][_0xb088('0x48')](_0x4d6406['body'],{})['then'](function(_0xe5fb63){var _0x295f85=_0x4d6406[_0xb088('0x49')][_0xb088('0x23')]({'plain':!![]});if(!_0x295f85)throw new Error(_0xb088('0x4a'));if(_0x295f85[_0xb088('0x4b')]==='user'){var _0x25823c=_0xe5fb63[_0xb088('0x23')]({'plain':!![]});var _0x3699ca='Pauses';return db[_0xb088('0x4c')][_0xb088('0x4d')]({'where':{'name':_0x3699ca,'userProfileId':_0x295f85[_0xb088('0x4e')]},'raw':!![]})[_0xb088('0x26')](function(_0x5240a1){if(_0x5240a1&&_0x5240a1[_0xb088('0x4f')]===0x0){return db[_0xb088('0x25')][_0xb088('0x48')]({'name':_0x25823c[_0xb088('0x29')],'resourceId':_0x25823c['id'],'type':_0x5240a1[_0xb088('0x29')],'sectionId':_0x5240a1['id']},{})['then'](function(){return _0xe5fb63;});}else{return _0xe5fb63;}})[_0xb088('0x44')](function(_0x117b6d){logger[_0xb088('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x117b6d);throw _0x117b6d;});}return _0xe5fb63;})['then'](respondWithResult(_0x48b1b2,0xc9))[_0xb088('0x44')](handleError(_0x48b1b2,null));};exports['update']=function(_0x1b628d,_0x55e402){if(_0x1b628d[_0xb088('0x50')]['id']){delete _0x1b628d['body']['id'];}return db[_0xb088('0x2d')][_0xb088('0x4d')]({'where':{'id':_0x1b628d[_0xb088('0x46')]['id']}})['then'](handleEntityNotFound(_0x55e402,null))['then'](saveUpdates(_0x1b628d[_0xb088('0x50')],null))[_0xb088('0x26')](respondWithResult(_0x55e402,null))[_0xb088('0x44')](handleError(_0x55e402,null));};exports[_0xb088('0x22')]=function(_0x355a00,_0x420abb){return db['Pause'][_0xb088('0x4d')]({'where':{'id':_0x355a00[_0xb088('0x46')]['id']}})[_0xb088('0x26')](handleEntityNotFound(_0x420abb,null))[_0xb088('0x26')](removeEntity(_0x420abb,null))['catch'](handleError(_0x420abb,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 7816188..ce5d268 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6aa7,0x178));var _0x76aa=function(_0x23f9d2,_0x9aa743){_0x23f9d2=_0x23f9d2-0x0;var _0x54d18c=_0x6aa7[_0x23f9d2];return _0x54d18c;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x3f9819,_0x4c2e0b){var _0x2700c2=function(_0x59fd7d){while(--_0x59fd7d){_0x3f9819['push'](_0x3f9819['shift']());}};_0x2700c2(++_0x4c2e0b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x36dcf6,_0x2ff983){_0x36dcf6=_0x36dcf6-0x0;var _0x4bb3c8=_0x8ef6[_0x36dcf6];return _0x4bb3c8;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'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 5ce0595..b2ed7fa 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(_0x12f7aa,_0x4e3f63){var _0xaf085e=function(_0x538633){while(--_0x538633){_0x12f7aa['push'](_0x12f7aa['shift']());}};_0xaf085e(++_0x4e3f63);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b33ad,_0x2a7d55){_0x5b33ad=_0x5b33ad-0x0;var _0x16ec00=_0xb10b[_0x5b33ad];return _0x16ec00;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x371549,_0x44daba){var _0x2eb8f0=function(_0x295e9b){while(--_0x295e9b){_0x371549['push'](_0x371549['shift']());}};_0x2eb8f0(++_0x44daba);}(_0xb10b,0x12a));var _0xbb10=function(_0x592ebe,_0x299ff7){_0x592ebe=_0x592ebe-0x0;var _0x58948d=_0xb10b[_0x592ebe];return _0x58948d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index cb0e7d0..f828c36 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 _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x579787,_0xbd4fef){var _0x47e868=function(_0x21dcbd){while(--_0x21dcbd){_0x579787['push'](_0x579787['shift']());}};_0x47e868(++_0xbd4fef);}(_0xbec5,0xe5));var _0x5bec=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xbec5[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=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(_0x269d19,_0x492ffb){var _0x17ac2a=function(_0x5905f9){while(--_0x5905f9){_0x269d19['push'](_0x269d19['shift']());}};_0x17ac2a(++_0x492ffb);}(_0x6737,0xe2));var _0x7673=function(_0xdc2c56,_0xc109c2){_0xdc2c56=_0xdc2c56-0x0;var _0x157d2a=_0x6737[_0xdc2c56];return _0x157d2a;};'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 6fed288..c2b9033 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 _0xa801=['STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa801,0xc5));var _0x1a80=function(_0x5350d3,_0x574cdd){_0x5350d3=_0x5350d3-0x0;var _0x4d4bf9=_0xa801[_0x5350d3];return _0x4d4bf9;};'use strict';var Sequelize=require('sequelize');module[_0x1a80('0x0')]={'name':{'type':Sequelize[_0x1a80('0x1')]},'type':{'type':Sequelize[_0x1a80('0x2')]('html',_0x1a80('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x1a80('0x4')]},'path':{'type':Sequelize[_0x1a80('0x1')],'comment':_0x1a80('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x1a80('0x2')](_0x1a80('0x6'),_0x1a80('0x7'),_0x1a80('0x8'),_0x1a80('0x9')),'defaultValue':_0x1a80('0x8'),'comment':_0x1a80('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x1a80('0x1')]},'agentUrl':{'type':Sequelize[_0x1a80('0x1')]},'scriptName':{'type':Sequelize[_0x1a80('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe5eb=['TEXT','BOOLEAN','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script'];(function(_0x2bcff5,_0x2ec4fd){var _0x1d989f=function(_0x548998){while(--_0x548998){_0x2bcff5['push'](_0x2bcff5['shift']());}};_0x1d989f(++_0x2ec4fd);}(_0xe5eb,0x72));var _0xbe5e=function(_0x39494f,_0x400b84){_0x39494f=_0x39494f-0x0;var _0x20bcc9=_0xe5eb[_0x39494f];return _0x20bcc9;};'use strict';var Sequelize=require(_0xbe5e('0x0'));module[_0xbe5e('0x1')]={'name':{'type':Sequelize[_0xbe5e('0x2')]},'type':{'type':Sequelize[_0xbe5e('0x3')](_0xbe5e('0x4'),_0xbe5e('0x5'))},'description':{'type':Sequelize[_0xbe5e('0x6')]},'version':{'type':Sequelize[_0xbe5e('0x6')]},'path':{'type':Sequelize[_0xbe5e('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xbe5e('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0xbe5e('0x8'),_0xbe5e('0x9'),_0xbe5e('0xa')),'defaultValue':'always','comment':_0xbe5e('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xbe5e('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xbe5e('0x2')]},'scriptPath':{'type':Sequelize[_0xbe5e('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c9faf2e..255ff3f 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 _0xc037=['pipe','glob','**/*','join','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','info','catch','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','version','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon-apps','html','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Plugins','autoAssociation','unlinkSync','Extracted\x20folder\x20removed','update','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','set','statusCode','webhookPost','http://localhost:','%s%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','jsforce','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','Plugin','fieldName','key','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','params','keys','rawAttributes','length','options','find','download','root','server/files/plugins','format','%s.zip','basename','path','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0xc037,0x195));var _0x7c03=function(_0x507bb2,_0x16e619){_0x507bb2=_0x507bb2-0x0;var _0x44cb59=_0xc037[_0x507bb2];return _0x44cb59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c03('0x0'));var zipdir=require(_0x7c03('0x1'));var jsonpatch=require(_0x7c03('0x2'));var rp=require(_0x7c03('0x3'));var moment=require(_0x7c03('0x4'));var BPromise=require(_0x7c03('0x5'));var Mustache=require(_0x7c03('0x6'));var util=require(_0x7c03('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c03('0x8'));var ejs=require(_0x7c03('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7c03('0xa'));var jsforce=require(_0x7c03('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7c03('0x8'));var querystring=require(_0x7c03('0xc'));var Papa=require('papaparse');var extract=require(_0x7c03('0xd'));var rimraf=require(_0x7c03('0x0'));var archiver=require('archiver');var Redis=require(_0x7c03('0xe'));var authService=require(_0x7c03('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7c03('0x10'));var hardwareService=require(_0x7c03('0x11'));var logger=require(_0x7c03('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7c03('0x13'));var licenseUtil=require(_0x7c03('0x14'));var db=require('../../mysqldb')['db'];config[_0x7c03('0x15')]=_[_0x7c03('0x16')](config[_0x7c03('0x15')],{'host':_0x7c03('0x17'),'port':0x18eb});var socket=require(_0x7c03('0x18'))(new Redis(config[_0x7c03('0x15')]));require('./plugin.socket')[_0x7c03('0x19')](socket);function respondWithStatusCode(_0x14fd92,_0x47c4b7){_0x47c4b7=_0x47c4b7||0xcc;return function(_0x2769d9){if(_0x2769d9){return _0x14fd92['sendStatus'](_0x47c4b7);}return _0x14fd92[_0x7c03('0x1a')](_0x47c4b7)['end']();};}function respondWithResult(_0x29b231,_0x3dbe8b){_0x3dbe8b=_0x3dbe8b||0xc8;return function(_0x4b66db){if(_0x4b66db){return _0x29b231['status'](_0x3dbe8b)[_0x7c03('0x1b')](_0x4b66db);}};}function respondWithFilteredResult(_0x3ba737,_0x337783){return function(_0x1e5fff){if(_0x1e5fff){var _0x36f674=typeof _0x337783[_0x7c03('0x1c')]==='undefined'&&typeof _0x337783[_0x7c03('0x1d')]===_0x7c03('0x1e');var _0x369f3d=_0x1e5fff['count'];var _0x45ab14=_0x36f674?0x0:_0x337783[_0x7c03('0x1c')];var _0xc0e089=_0x36f674?_0x1e5fff[_0x7c03('0x1f')]:_0x337783[_0x7c03('0x1c')]+_0x337783[_0x7c03('0x1d')];var _0x5e6613;if(_0xc0e089>=_0x369f3d){_0xc0e089=_0x369f3d;_0x5e6613=0xc8;}else{_0x5e6613=0xce;}_0x3ba737[_0x7c03('0x1a')](_0x5e6613);return _0x3ba737['set'](_0x7c03('0x20'),_0x45ab14+'-'+_0xc0e089+'/'+_0x369f3d)[_0x7c03('0x1b')](_0x1e5fff);}return null;};}function patchUpdates(_0x148581){return function(_0x3a9399){try{jsonpatch[_0x7c03('0x21')](_0x3a9399,_0x148581,!![]);}catch(_0x369d10){return BPromise[_0x7c03('0x22')](_0x369d10);}return _0x3a9399[_0x7c03('0x23')]();};}function saveUpdates(_0x5e3469,_0x4b7e03){return function(_0x20a34d){if(_0x20a34d){return _0x20a34d['update'](_0x5e3469)[_0x7c03('0x24')](function(_0x1b27b7){return _0x1b27b7;});}return null;};}function removeEntity(_0x3cec91,_0x8f6383){return function(_0x34ee4b){if(_0x34ee4b){return _0x34ee4b[_0x7c03('0x25')]()['then'](function(){var _0x5becd3=_0x34ee4b[_0x7c03('0x26')]({'plain':!![]});var _0x3d11de='Plugins';return db[_0x7c03('0x27')][_0x7c03('0x25')]({'where':{'type':_0x3d11de,'resourceId':_0x5becd3['id']}})[_0x7c03('0x24')](function(){return _0x34ee4b;});})['then'](function(){_0x3cec91[_0x7c03('0x1a')](0xcc)[_0x7c03('0x28')]();});}};}function handleEntityNotFound(_0x25b424,_0x4ffa59){return function(_0x3c716b){if(!_0x3c716b){_0x25b424[_0x7c03('0x29')](0x194);}return _0x3c716b;};}function handleError(_0x2dd719,_0xcc94eb){_0xcc94eb=_0xcc94eb||0x1f4;return function(_0x168101){logger[_0x7c03('0x2a')](_0x168101[_0x7c03('0x2b')]);if(_0x168101['name']){delete _0x168101[_0x7c03('0x2c')];}_0x2dd719[_0x7c03('0x1a')](_0xcc94eb)[_0x7c03('0x2d')](_0x168101);};}exports[_0x7c03('0x2e')]=function(_0x246586,_0x3cb939){var _0x36e0d0={},_0x3edfe8={},_0x3ba63e={'count':0x0,'rows':[]};var _0x298b44=_['map'](db[_0x7c03('0x2f')]['rawAttributes'],function(_0xb31307){return{'name':_0xb31307[_0x7c03('0x30')],'type':_0xb31307['type'][_0x7c03('0x31')]};});_0x3edfe8[_0x7c03('0x32')]=_[_0x7c03('0x33')](_0x298b44,_0x7c03('0x2c'));_0x3edfe8['query']=_['keys'](_0x246586['query']);_0x3edfe8[_0x7c03('0x34')]=_[_0x7c03('0x35')](_0x3edfe8[_0x7c03('0x32')],_0x3edfe8[_0x7c03('0x36')]);_0x36e0d0[_0x7c03('0x37')]=_[_0x7c03('0x35')](_0x3edfe8[_0x7c03('0x32')],qs[_0x7c03('0x38')](_0x246586[_0x7c03('0x36')][_0x7c03('0x38')]));_0x36e0d0[_0x7c03('0x37')]=_0x36e0d0[_0x7c03('0x37')]['length']?_0x36e0d0['attributes']:_0x3edfe8[_0x7c03('0x32')];if(!_0x246586[_0x7c03('0x36')][_0x7c03('0x39')](_0x7c03('0x3a'))){_0x36e0d0[_0x7c03('0x1d')]=qs[_0x7c03('0x1d')](_0x246586[_0x7c03('0x36')]['limit']);_0x36e0d0[_0x7c03('0x1c')]=qs[_0x7c03('0x1c')](_0x246586['query'][_0x7c03('0x1c')]);}_0x36e0d0[_0x7c03('0x3b')]=qs[_0x7c03('0x3c')](_0x246586['query'][_0x7c03('0x3c')]);_0x36e0d0[_0x7c03('0x3d')]=qs[_0x7c03('0x34')](_[_0x7c03('0x3e')](_0x246586[_0x7c03('0x36')],_0x3edfe8['filters']),_0x298b44);if(_0x246586[_0x7c03('0x36')][_0x7c03('0x3f')]){_0x36e0d0[_0x7c03('0x3d')]=_['merge'](_0x36e0d0[_0x7c03('0x3d')],{'$or':_[_0x7c03('0x33')](_0x298b44,function(_0x434c94){if(_0x434c94[_0x7c03('0x40')]!==_0x7c03('0x41')){var _0x3ba5ed={};_0x3ba5ed[_0x434c94[_0x7c03('0x2c')]]={'$like':'%'+_0x246586[_0x7c03('0x36')][_0x7c03('0x3f')]+'%'};return _0x3ba5ed;}})});}_0x36e0d0=_[_0x7c03('0x42')]({},_0x36e0d0,_0x246586['options']);var _0x44b51a={'where':_0x36e0d0[_0x7c03('0x3d')]};return db[_0x7c03('0x2f')][_0x7c03('0x1f')](_0x44b51a)[_0x7c03('0x24')](function(_0x1f9cd4){_0x3ba63e[_0x7c03('0x1f')]=_0x1f9cd4;if(_0x246586['query'][_0x7c03('0x43')]){_0x36e0d0[_0x7c03('0x44')]=[{'all':!![]}];}return db['Plugin'][_0x7c03('0x45')](_0x36e0d0);})['then'](function(_0x22793a){_0x3ba63e['rows']=_0x22793a;return _0x3ba63e;})['then'](respondWithFilteredResult(_0x3cb939,_0x36e0d0))['catch'](handleError(_0x3cb939,null));};exports['show']=function(_0x1a7674,_0x1b9cff){var _0x3e9226={'raw':!![],'where':{'id':_0x1a7674[_0x7c03('0x46')]['id']}},_0x2bf0df={};_0x2bf0df['model']=_[_0x7c03('0x47')](db[_0x7c03('0x2f')][_0x7c03('0x48')]);_0x2bf0df[_0x7c03('0x36')]=_[_0x7c03('0x47')](_0x1a7674['query']);_0x2bf0df[_0x7c03('0x34')]=_[_0x7c03('0x35')](_0x2bf0df[_0x7c03('0x32')],_0x2bf0df['query']);_0x3e9226[_0x7c03('0x37')]=_[_0x7c03('0x35')](_0x2bf0df['model'],qs[_0x7c03('0x38')](_0x1a7674[_0x7c03('0x36')][_0x7c03('0x38')]));_0x3e9226['attributes']=_0x3e9226[_0x7c03('0x37')][_0x7c03('0x49')]?_0x3e9226[_0x7c03('0x37')]:_0x2bf0df['model'];if(_0x1a7674[_0x7c03('0x36')][_0x7c03('0x43')]){_0x3e9226[_0x7c03('0x44')]=[{'all':!![]}];}_0x3e9226=_[_0x7c03('0x42')]({},_0x3e9226,_0x1a7674[_0x7c03('0x4a')]);return db['Plugin'][_0x7c03('0x4b')](_0x3e9226)[_0x7c03('0x24')](handleEntityNotFound(_0x1b9cff,null))['then'](respondWithResult(_0x1b9cff,null))['catch'](handleError(_0x1b9cff,null));};exports[_0x7c03('0x4c')]=function(_0x11e8f7,_0x59f817,_0x4db77d){return db['Plugin'][_0x7c03('0x4b')]({'where':{'id':_0x11e8f7['params']['id']},'attributes':[_0x7c03('0x2c'),'path'],'raw':!![]})[_0x7c03('0x24')](handleEntityNotFound(_0x59f817,null))[_0x7c03('0x24')](function(_0x3349f5){if(_0x3349f5){var _0x44b0bb=path['join'](config[_0x7c03('0x4d')],_0x7c03('0x4e'),util[_0x7c03('0x4f')](_0x7c03('0x50'),path[_0x7c03('0x51')](_0x3349f5[_0x7c03('0x52')])));var _0x4a65b7=fs[_0x7c03('0x53')](_0x44b0bb);var _0x20aa56=archiver(_0x7c03('0x54'),{'zlib':{'level':0x9}});_0x20aa56['on'](_0x7c03('0x55'),function(_0x12cbd5){if(_0x12cbd5[_0x7c03('0x56')]==='ENOENT'){logger[_0x7c03('0x2a')](_0x12cbd5);}else{throw new db[(_0x7c03('0x57'))][(_0x7c03('0x58'))](_0x7c03('0x59'));}});_0x20aa56['on']('error',function(_0x58cbdd){throw new db[(_0x7c03('0x57'))][(_0x7c03('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x20aa56[_0x7c03('0x5a')](_0x4a65b7);_0x20aa56[_0x7c03('0x5b')](_0x7c03('0x5c'),{'cwd':path[_0x7c03('0x5d')](config['root'],_0x7c03('0x4e'),path['dirname'](_0x3349f5[_0x7c03('0x52')])),'ignore':[path[_0x7c03('0x5d')](path['basename'](_0x3349f5[_0x7c03('0x52')]),_0x7c03('0x5e')),path[_0x7c03('0x5d')](path[_0x7c03('0x51')](_0x3349f5[_0x7c03('0x52')]),_0x7c03('0x5f'))],'nodir':!![]})['finalize']();_0x4a65b7['on'](_0x7c03('0x60'),function(){if(!fs[_0x7c03('0x61')](_0x44b0bb)){throw new db['Sequelize'][(_0x7c03('0x58'))](_0x7c03('0x62'));}return _0x59f817['download'](_0x44b0bb,util[_0x7c03('0x4f')](_0x7c03('0x50'),path[_0x7c03('0x51')](_0x3349f5[_0x7c03('0x52')])),function(_0x120b30){if(_0x120b30){throw new db[(_0x7c03('0x57'))][(_0x7c03('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x44b0bb);logger[_0x7c03('0x63')]('Download\x20completed');logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x7c03('0x64')](handleError(_0x59f817,null));};exports[_0x7c03('0x65')]=function(_0x54d854,_0x45e41c,_0x57f097){var _0xcd64fa=path[_0x7c03('0x51')](_0x54d854[_0x7c03('0x66')][_0x7c03('0x67')],path[_0x7c03('0x68')](_0x54d854[_0x7c03('0x66')]['filename']));var _0x58a154=path[_0x7c03('0x5d')](config[_0x7c03('0x4d')],_0x7c03('0x4e'),_0x54d854['file']['filename']);var _0x4a978c=path['join'](config[_0x7c03('0x4d')],_0x7c03('0x4e'),_0xcd64fa);logger[_0x7c03('0x63')](_0x7c03('0x69'),_0x58a154);logger[_0x7c03('0x63')](_0x7c03('0x6a'),_0x4a978c);try{fs[_0x7c03('0x6b')](_0x58a154,parseInt(_0x7c03('0x6c'),0x8));extract(_0x58a154,{'dir':_0x4a978c},function(_0x4fc27d){if(_0x4fc27d){logger[_0x7c03('0x2a')](_0x4fc27d);handleError(_0x4fc27d,!![]);};var _0x551fc5=fs[_0x7c03('0x6d')](_0x4a978c);if(_0x551fc5[_0x7c03('0x49')]>0x1){removeReferences(_0x58a154,_0x4a978c);logger[_0x7c03('0x2a')]('Invalid\x20plugin\x20structure');return _0x57f097(new Error(_0x7c03('0x6e')));}var _0x131288=fs[_0x7c03('0x6f')](path[_0x7c03('0x5d')](_0x4a978c,_0x551fc5[0x0]));if(_0x131288['isFile']()){removeReferences(_0x58a154,_0x4a978c);logger[_0x7c03('0x2a')](_0x7c03('0x6e'));return _0x57f097(new Error(_0x7c03('0x6e')));}if(_0x131288[_0x7c03('0x70')]()){var _0x3100b7=fs[_0x7c03('0x6d')](path[_0x7c03('0x5d')](_0x4a978c,_0x551fc5[0x0]));if(_0x3100b7[_0x7c03('0x49')]===0x0){removeReferences(_0x58a154,_0x4a978c);logger[_0x7c03('0x2a')](_0x7c03('0x6e'));return _0x57f097(new Error('Invalid\x20plugin\x20structure'));}var _0x348bee=_0x3100b7[_0x7c03('0x71')](function(_0x364fd9){return _0x364fd9==='manifest.json';});if(!_0x348bee){return _0x57f097(new Error(_0x7c03('0x72')));}var _0x1e1575=fs[_0x7c03('0x73')](path[_0x7c03('0x5d')](_0x4a978c,_0x551fc5[0x0],_0x7c03('0x74')));var _0x4ad392=JSON[_0x7c03('0x75')](_0x1e1575);if(_0x7c03('0x1e')==typeof _0x4ad392[_0x7c03('0x2c')]){return _0x57f097(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x7c03('0x1e')==typeof _0x4ad392[_0x7c03('0x40')]){return _0x57f097(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x7c03('0x1e')==typeof _0x4ad392[_0x7c03('0x76')]){return _0x57f097(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x4ad392[_0x7c03('0x77')]){return _0x57f097(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4ad392[_0x7c03('0x40')]==='html'){if(_0x7c03('0x1e')==typeof _0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')]){return _0x57f097(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')][_0x7c03('0x79')]&&_0x7c03('0x1e')==typeof _0x4ad392['parameters'][_0x7c03('0x78')][_0x7c03('0x7a')]){return _0x57f097(new Error(_0x7c03('0x7b')));}}else if(_0x4ad392[_0x7c03('0x40')]===_0x7c03('0x7c')){if(_0x7c03('0x1e')==typeof _0x4ad392[_0x7c03('0x77')][_0x7c03('0x7d')]){return _0x57f097(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x7c03('0x1e')==typeof _0x4ad392['parameters'][_0x7c03('0x7e')]){return _0x57f097(new Error(_0x7c03('0x7f')));}}else{return _0x57f097(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x33d83e=_0x4ad392[_0x7c03('0x2c')];var _0x4035b8=_0x4ad392[_0x7c03('0x80')];var _0x3a180c=_0x4ad392['type'];var _0x60c90d=_0x4ad392[_0x7c03('0x81')]?_0x4ad392[_0x7c03('0x81')]:'always';var _0x431e3a=_0x4ad392['icon']?_0x4ad392['icon']:_0x7c03('0x82');var _0x3b0f3c='';var _0x5ed889='';var _0x4b535b='';var _0x2624f2='';var _0x1a21ae=_0x4ad392['version'];if(_0x3a180c===_0x7c03('0x83')){if(_0x7c03('0x1e')!=typeof _0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')][_0x7c03('0x79')]){var _0x429da2=_0x4ad392[_0x7c03('0x77')]['views'][_0x7c03('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x7c03('0x84')](_0x429da2)){_0x3b0f3c=path[_0x7c03('0x5d')]('plugins',_0xcd64fa,_0x551fc5[0x0],_0x429da2);}else{_0x3b0f3c=_0x429da2;}}else{logger[_0x7c03('0x63')](_0x7c03('0x85'));}if('undefined'!=typeof _0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')][_0x7c03('0x7a')]){var _0x4abb84=_0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')][_0x7c03('0x7a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4abb84)){_0x5ed889=path[_0x7c03('0x5d')](_0x7c03('0x86'),_0xcd64fa,_0x551fc5[0x0],_0x4abb84);}else{_0x5ed889=_0x4abb84;}}else{logger[_0x7c03('0x63')](_0x7c03('0x87'));}}else if(_0x3a180c===_0x7c03('0x7c')){_0x4b535b=_0x4ad392['parameters']['scriptName'];_0x2624f2=_0x4ad392['parameters'][_0x7c03('0x7e')];if(_0x7c03('0x1e')!=typeof _0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')]){if(_0x7c03('0x1e')!=typeof _0x4ad392[_0x7c03('0x77')]['views'][_0x7c03('0x79')]){var _0x429da2=_0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')][_0x7c03('0x79')];if(!/^(f|ht)tps?:\/\//i['test'](_0x429da2)){_0x3b0f3c=path['join'](_0x7c03('0x86'),_0xcd64fa,_0x551fc5[0x0],_0x429da2);}else{_0x3b0f3c=_0x429da2;}}if('undefined'!=typeof _0x4ad392[_0x7c03('0x77')][_0x7c03('0x78')][_0x7c03('0x7a')]){var _0x4abb84=_0x4ad392['parameters'][_0x7c03('0x78')][_0x7c03('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x7c03('0x84')](_0x4abb84)){_0x5ed889=path[_0x7c03('0x5d')](_0x7c03('0x86'),_0xcd64fa,_0x551fc5[0x0],_0x4abb84);}else{_0x5ed889=_0x4abb84;}}}}var _0x44a750={'name':_0x33d83e,'description':_0x4035b8,'path':path[_0x7c03('0x5d')](_0xcd64fa,_0x551fc5[0x0]),'type':_0x3a180c,'sidebar':_0x60c90d,'icon':_0x431e3a,'adminUrl':_0x3b0f3c,'agentUrl':_0x5ed889,'scriptName':_0x4b535b,'scriptPath':_0x2624f2,'version':_0x1a21ae};removeReferences(_0x58a154,null);return db[_0x7c03('0x2f')][_0x7c03('0x88')](_0x44a750)[_0x7c03('0x24')](function(_0xcfcd91){var _0x1fb39b={'role':_0x54d854[_0x7c03('0x89')]['role'],'userProfileId':_0x54d854[_0x7c03('0x89')][_0x7c03('0x8a')]};if(!_0x1fb39b)throw new Error(_0x7c03('0x8b'));if(_0x1fb39b[_0x7c03('0x8c')]===_0x7c03('0x8d')){var _0x2da572=_0xcfcd91[_0x7c03('0x26')]({'plain':!![]});return db[_0x7c03('0x8e')]['find']({'where':{'name':_0x7c03('0x8f'),'userProfileId':_0x1fb39b[_0x7c03('0x8a')]},'raw':!![]})['then'](function(_0x7b9228){if(_0x7b9228&&_0x7b9228[_0x7c03('0x90')]===0x0){return db[_0x7c03('0x27')][_0x7c03('0x88')]({'name':_0x2da572[_0x7c03('0x2c')],'resourceId':_0x2da572['id'],'type':_0x7b9228[_0x7c03('0x2c')],'sectionId':_0x7b9228['id']},{})['then'](function(){return _0xcfcd91;});}else{return _0xcfcd91;}})[_0x7c03('0x64')](function(_0x46361f){logger[_0x7c03('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46361f);throw _0x46361f;});}return _0xcfcd91;})[_0x7c03('0x24')](respondWithResult(_0x45e41c,null))[_0x7c03('0x64')](handleError(_0x45e41c,null));}});}catch(_0x9f06d0){_0x45e41c[_0x7c03('0x1a')](0x1f4)[_0x7c03('0x2d')](_0x9f06d0);}};function removeReferences(_0xd8f581,_0x287498){try{if(_0xd8f581){fs[_0x7c03('0x91')](_0xd8f581);logger[_0x7c03('0x63')]('Zip\x20archive\x20removed');}if(_0x287498){rimraf(_0x287498,function(){});logger[_0x7c03('0x63')](_0x7c03('0x92'));}}catch(_0x383bea){logger[_0x7c03('0x2a')](_0x383bea);}}exports[_0x7c03('0x93')]=function(_0x4e5eb1,_0x4fb52b,_0x26e48e){return db['Plugin'][_0x7c03('0x4b')]({'where':{'id':_0x4e5eb1[_0x7c03('0x46')]['id']}})['then'](handleEntityNotFound(_0x4fb52b,null))[_0x7c03('0x24')](saveUpdates(_0x4e5eb1[_0x7c03('0x89')],null))['then'](respondWithResult(_0x4fb52b,null))[_0x7c03('0x64')](handleError(_0x4fb52b,null));};exports['delete']=function(_0x1d8f78,_0x8b0b40,_0x138dfe){return db[_0x7c03('0x2f')][_0x7c03('0x4b')]({'where':{'id':_0x1d8f78[_0x7c03('0x46')]['id']}})['then'](function(_0x5d5777){if(_0x5d5777){return _0x5d5777['destroy']();}})[_0x7c03('0x24')](function(_0x59e921){rimraf(path['join'](config[_0x7c03('0x4d')],'server/files/plugins',path[_0x7c03('0x94')](_0x59e921[_0x7c03('0x52')])),function(){});return _0x59e921;})[_0x7c03('0x24')](handleEntityNotFound(_0x8b0b40,null))[_0x7c03('0x24')](respondWithStatusCode(_0x8b0b40,null))[_0x7c03('0x64')](handleError(_0x8b0b40,null));};exports[_0x7c03('0x95')]=function(_0x5d5319,_0x481a12,_0xada33){return BPromise[_0x7c03('0x96')]()[_0x7c03('0x24')](function(){if(!_0x5d5319[_0x7c03('0x36')][_0x7c03('0x52')]){throw new Error(_0x7c03('0x97'));}if(!_0x5d5319[_0x7c03('0x36')][_0x7c03('0x98')]){throw new Error(_0x7c03('0x99'));}var _0x53feb0=_0x5d5319['query']['hostname']?_0x5d5319[_0x7c03('0x36')][_0x7c03('0x9a')]+':'+_0x5d5319['query'][_0x7c03('0x98')]:'http://localhost:'+_0x5d5319['query'][_0x7c03('0x98')];var _0x27c42b=_0x5d5319[_0x7c03('0x36')]['json']?_0x5d5319[_0x7c03('0x36')][_0x7c03('0x1b')]:!![];var _0xd0a48=_0x5d5319[_0x7c03('0x36')][_0x7c03('0x9b')]?_0x5d5319['query']['encoding']:null;var _0x38d5ce={'method':_0x5d5319[_0x7c03('0x9c')],'uri':util[_0x7c03('0x4f')]('%s%s',_0x53feb0,_0x5d5319['query'][_0x7c03('0x52')]),'json':_0x27c42b,'resolveWithFullResponse':!![],'encoding':_0xd0a48,'qs':_0x5d5319[_0x7c03('0x36')]};if(_0x5d5319[_0x7c03('0x9d')]){_0x38d5ce[_0x7c03('0x9d')]=_0x5d5319[_0x7c03('0x9d')];if(_0x38d5ce[_0x7c03('0x9d')]['content-length']){delete _0x38d5ce['headers'][_0x7c03('0x9e')];}}if(_0x38d5ce[_0x7c03('0x9d')][_0x7c03('0x9f')]){delete _0x38d5ce['headers'][_0x7c03('0x9f')];}return rp(_0x38d5ce);})[_0x7c03('0x24')](function(_0x328725){if(_0x328725){_0x481a12[_0x7c03('0xa0')](_0x328725['headers']);logger[_0x7c03('0x63')](_0x328725[_0x7c03('0x89')]);if(_['endsWith'](_0x5d5319[_0x7c03('0x36')][_0x7c03('0x52')],_0x7c03('0x4c'))&&_0x328725[_0x7c03('0xa1')]==0x1f4){return _0x481a12[_0x7c03('0x29')](_0x328725[_0x7c03('0xa1')]);}else{return _0x481a12[_0x7c03('0x1a')](_0x328725[_0x7c03('0xa1')])[_0x7c03('0x2d')](_0x328725[_0x7c03('0x89')]);}}else{return _0x481a12[_0x7c03('0x29')](0xc8);}})[_0x7c03('0x64')](handleError(_0x481a12,null));};exports[_0x7c03('0xa2')]=function(_0x56fb6a,_0x2d8763,_0x5cf38e){return BPromise[_0x7c03('0x96')]()[_0x7c03('0x24')](function(){if(!_0x56fb6a['query'][_0x7c03('0x52')]){throw new Error(_0x7c03('0x97'));}if(!_0x56fb6a[_0x7c03('0x36')][_0x7c03('0x98')]){throw new Error(_0x7c03('0x99'));}var _0x3134b6=_0x56fb6a['query'][_0x7c03('0x9a')]?_0x56fb6a[_0x7c03('0x36')]['hostname']+':'+_0x56fb6a[_0x7c03('0x36')][_0x7c03('0x98')]:_0x7c03('0xa3')+_0x56fb6a[_0x7c03('0x36')][_0x7c03('0x98')];var _0x437671=_0x56fb6a[_0x7c03('0x36')]['json']?_0x56fb6a['query'][_0x7c03('0x1b')]:!![];var _0x4b455d=_0x56fb6a['query']['encoding']?_0x56fb6a['query'][_0x7c03('0x9b')]:null;var _0x414af9={'method':_0x56fb6a['method'],'uri':util[_0x7c03('0x4f')](_0x7c03('0xa4'),_0x3134b6,_0x56fb6a[_0x7c03('0x36')][_0x7c03('0x52')]),'json':_0x437671,'resolveWithFullResponse':!![],'encoding':_0x4b455d,'body':_0x56fb6a[_0x7c03('0x89')]};if(_0x56fb6a[_0x7c03('0x9d')]){_0x414af9[_0x7c03('0x9d')]=_0x56fb6a[_0x7c03('0x9d')];if(_0x414af9[_0x7c03('0x9d')][_0x7c03('0x9e')]){delete _0x414af9['headers'][_0x7c03('0x9e')];}}if(_0x414af9[_0x7c03('0x9d')]['content-type']){delete _0x414af9['headers'][_0x7c03('0x9f')];}return rp(_0x414af9);})[_0x7c03('0x24')](function(_0x339b5e){if(_0x339b5e){_0x2d8763[_0x7c03('0xa0')](_0x339b5e[_0x7c03('0x9d')]);logger['info'](_0x339b5e[_0x7c03('0x89')]);return _0x2d8763[_0x7c03('0x1a')](_0x339b5e[_0x7c03('0xa1')])[_0x7c03('0x2d')](_0x339b5e[_0x7c03('0x89')]);}else{return _0x2d8763[_0x7c03('0x29')](0xc8);}})[_0x7c03('0x64')](handleError(_0x2d8763,null));}; \ No newline at end of file +var _0x69d6=['name','send','index','Plugin','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','map','options','includeAll','catch','show','params','keys','rawAttributes','find','download','root','server/files/plugins','format','%s.zip','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','script','scriptPath','create','body','userProfileId','user','autoAssociation','Zip\x20archive\x20removed','update','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Plugins','UserProfileResource','end','error','stack'];(function(_0x311a19,_0x5bee85){var _0x6f5ebe=function(_0x52f0a1){while(--_0x52f0a1){_0x311a19['push'](_0x311a19['shift']());}};_0x6f5ebe(++_0x5bee85);}(_0x69d6,0x11b));var _0x669d=function(_0x170882,_0x4a709d){_0x170882=_0x170882-0x0;var _0x308853=_0x69d6[_0x170882];return _0x308853;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x669d('0x0'));var zipdir=require(_0x669d('0x1'));var jsonpatch=require(_0x669d('0x2'));var rp=require(_0x669d('0x3'));var moment=require('moment');var BPromise=require(_0x669d('0x4'));var Mustache=require(_0x669d('0x5'));var util=require(_0x669d('0x6'));var path=require(_0x669d('0x7'));var sox=require(_0x669d('0x8'));var csv=require(_0x669d('0x9'));var ejs=require(_0x669d('0xa'));var fs=require('fs');var fs_extra=require(_0x669d('0xb'));var _=require(_0x669d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x669d('0xd'));var deskjs=require(_0x669d('0xe'));var toCsv=require(_0x669d('0x9'));var querystring=require(_0x669d('0xf'));var Papa=require(_0x669d('0x10'));var extract=require('extract-zip');var rimraf=require(_0x669d('0x0'));var archiver=require(_0x669d('0x11'));var Redis=require(_0x669d('0x12'));var authService=require(_0x669d('0x13'));var qs=require(_0x669d('0x14'));var as=require(_0x669d('0x15'));var hardwareService=require(_0x669d('0x16'));var logger=require('../../config/logger')(_0x669d('0x17'));var utils=require('../../config/utils');var config=require(_0x669d('0x18'));var licenseUtil=require(_0x669d('0x19'));var db=require(_0x669d('0x1a'))['db'];config[_0x669d('0x1b')]=_[_0x669d('0x1c')](config[_0x669d('0x1b')],{'host':_0x669d('0x1d'),'port':0x18eb});var socket=require(_0x669d('0x1e'))(new Redis(config[_0x669d('0x1b')]));require(_0x669d('0x1f'))[_0x669d('0x20')](socket);function respondWithStatusCode(_0x10c1c1,_0x2f2d8b){_0x2f2d8b=_0x2f2d8b||0xcc;return function(_0x23da9b){if(_0x23da9b){return _0x10c1c1[_0x669d('0x21')](_0x2f2d8b);}return _0x10c1c1['status'](_0x2f2d8b)['end']();};}function respondWithResult(_0x4767a0,_0x241eaf){_0x241eaf=_0x241eaf||0xc8;return function(_0x3e1dc9){if(_0x3e1dc9){return _0x4767a0[_0x669d('0x22')](_0x241eaf)[_0x669d('0x23')](_0x3e1dc9);}};}function respondWithFilteredResult(_0x31ec6b,_0x35c3d9){return function(_0x21adc1){if(_0x21adc1){var _0x3d53c5=typeof _0x35c3d9[_0x669d('0x24')]===_0x669d('0x25')&&typeof _0x35c3d9['limit']===_0x669d('0x25');var _0x35c020=_0x21adc1[_0x669d('0x26')];var _0x2b376e=_0x3d53c5?0x0:_0x35c3d9[_0x669d('0x24')];var _0x5af166=_0x3d53c5?_0x21adc1[_0x669d('0x26')]:_0x35c3d9['offset']+_0x35c3d9[_0x669d('0x27')];var _0x31f2d4;if(_0x5af166>=_0x35c020){_0x5af166=_0x35c020;_0x31f2d4=0xc8;}else{_0x31f2d4=0xce;}_0x31ec6b[_0x669d('0x22')](_0x31f2d4);return _0x31ec6b[_0x669d('0x28')](_0x669d('0x29'),_0x2b376e+'-'+_0x5af166+'/'+_0x35c020)[_0x669d('0x23')](_0x21adc1);}return null;};}function patchUpdates(_0x5941bf){return function(_0x4aac78){try{jsonpatch[_0x669d('0x2a')](_0x4aac78,_0x5941bf,!![]);}catch(_0x21446c){return BPromise[_0x669d('0x2b')](_0x21446c);}return _0x4aac78[_0x669d('0x2c')]();};}function saveUpdates(_0x4793d7,_0x3293c2){return function(_0x7121fa){if(_0x7121fa){return _0x7121fa['update'](_0x4793d7)[_0x669d('0x2d')](function(_0x545ef7){return _0x545ef7;});}return null;};}function removeEntity(_0x105d7a,_0x3f4cb2){return function(_0x3f396f){if(_0x3f396f){return _0x3f396f[_0x669d('0x2e')]()[_0x669d('0x2d')](function(){var _0x5a268a=_0x3f396f[_0x669d('0x2f')]({'plain':!![]});var _0x14cfe0=_0x669d('0x30');return db[_0x669d('0x31')][_0x669d('0x2e')]({'where':{'type':_0x14cfe0,'resourceId':_0x5a268a['id']}})[_0x669d('0x2d')](function(){return _0x3f396f;});})['then'](function(){_0x105d7a[_0x669d('0x22')](0xcc)[_0x669d('0x32')]();});}};}function handleEntityNotFound(_0x1859a0,_0x50d52e){return function(_0x3edd08){if(!_0x3edd08){_0x1859a0['sendStatus'](0x194);}return _0x3edd08;};}function handleError(_0x297a2c,_0x44abe6){_0x44abe6=_0x44abe6||0x1f4;return function(_0x4fc712){logger[_0x669d('0x33')](_0x4fc712[_0x669d('0x34')]);if(_0x4fc712[_0x669d('0x35')]){delete _0x4fc712['name'];}_0x297a2c['status'](_0x44abe6)[_0x669d('0x36')](_0x4fc712);};}exports[_0x669d('0x37')]=function(_0x4dc3a1,_0x1903a5){var _0x30248b={},_0x2c4424={},_0x2e7a13={'count':0x0,'rows':[]};var _0x490c0a=_['map'](db[_0x669d('0x38')]['rawAttributes'],function(_0x5ae136){return{'name':_0x5ae136['fieldName'],'type':_0x5ae136[_0x669d('0x39')][_0x669d('0x3a')]};});_0x2c4424[_0x669d('0x3b')]=_['map'](_0x490c0a,_0x669d('0x35'));_0x2c4424['query']=_['keys'](_0x4dc3a1[_0x669d('0x3c')]);_0x2c4424[_0x669d('0x3d')]=_[_0x669d('0x3e')](_0x2c4424[_0x669d('0x3b')],_0x2c4424[_0x669d('0x3c')]);_0x30248b[_0x669d('0x3f')]=_[_0x669d('0x3e')](_0x2c4424['model'],qs['fields'](_0x4dc3a1[_0x669d('0x3c')][_0x669d('0x40')]));_0x30248b[_0x669d('0x3f')]=_0x30248b['attributes'][_0x669d('0x41')]?_0x30248b[_0x669d('0x3f')]:_0x2c4424[_0x669d('0x3b')];if(!_0x4dc3a1[_0x669d('0x3c')][_0x669d('0x42')](_0x669d('0x43'))){_0x30248b['limit']=qs[_0x669d('0x27')](_0x4dc3a1[_0x669d('0x3c')][_0x669d('0x27')]);_0x30248b[_0x669d('0x24')]=qs[_0x669d('0x24')](_0x4dc3a1['query'][_0x669d('0x24')]);}_0x30248b['order']=qs['sort'](_0x4dc3a1['query']['sort']);_0x30248b[_0x669d('0x44')]=qs['filters'](_['pick'](_0x4dc3a1[_0x669d('0x3c')],_0x2c4424[_0x669d('0x3d')]),_0x490c0a);if(_0x4dc3a1[_0x669d('0x3c')][_0x669d('0x45')]){_0x30248b[_0x669d('0x44')]=_[_0x669d('0x46')](_0x30248b[_0x669d('0x44')],{'$or':_[_0x669d('0x47')](_0x490c0a,function(_0x307b79){if(_0x307b79[_0x669d('0x39')]!=='VIRTUAL'){var _0x1e1cd7={};_0x1e1cd7[_0x307b79[_0x669d('0x35')]]={'$like':'%'+_0x4dc3a1[_0x669d('0x3c')][_0x669d('0x45')]+'%'};return _0x1e1cd7;}})});}_0x30248b=_[_0x669d('0x46')]({},_0x30248b,_0x4dc3a1[_0x669d('0x48')]);var _0x2a56c5={'where':_0x30248b[_0x669d('0x44')]};return db['Plugin'][_0x669d('0x26')](_0x2a56c5)[_0x669d('0x2d')](function(_0x1bb1a2){_0x2e7a13[_0x669d('0x26')]=_0x1bb1a2;if(_0x4dc3a1[_0x669d('0x3c')][_0x669d('0x49')]){_0x30248b['include']=[{'all':!![]}];}return db[_0x669d('0x38')]['findAll'](_0x30248b);})[_0x669d('0x2d')](function(_0x2228b5){_0x2e7a13['rows']=_0x2228b5;return _0x2e7a13;})[_0x669d('0x2d')](respondWithFilteredResult(_0x1903a5,_0x30248b))[_0x669d('0x4a')](handleError(_0x1903a5,null));};exports[_0x669d('0x4b')]=function(_0x495eef,_0x3dcffd){var _0x5ac5a4={'raw':!![],'where':{'id':_0x495eef[_0x669d('0x4c')]['id']}},_0x59ec61={};_0x59ec61[_0x669d('0x3b')]=_[_0x669d('0x4d')](db[_0x669d('0x38')][_0x669d('0x4e')]);_0x59ec61[_0x669d('0x3c')]=_['keys'](_0x495eef[_0x669d('0x3c')]);_0x59ec61[_0x669d('0x3d')]=_[_0x669d('0x3e')](_0x59ec61[_0x669d('0x3b')],_0x59ec61[_0x669d('0x3c')]);_0x5ac5a4['attributes']=_[_0x669d('0x3e')](_0x59ec61[_0x669d('0x3b')],qs['fields'](_0x495eef[_0x669d('0x3c')]['fields']));_0x5ac5a4[_0x669d('0x3f')]=_0x5ac5a4[_0x669d('0x3f')][_0x669d('0x41')]?_0x5ac5a4[_0x669d('0x3f')]:_0x59ec61[_0x669d('0x3b')];if(_0x495eef[_0x669d('0x3c')]['includeAll']){_0x5ac5a4['include']=[{'all':!![]}];}_0x5ac5a4=_['merge']({},_0x5ac5a4,_0x495eef['options']);return db['Plugin'][_0x669d('0x4f')](_0x5ac5a4)[_0x669d('0x2d')](handleEntityNotFound(_0x3dcffd,null))[_0x669d('0x2d')](respondWithResult(_0x3dcffd,null))['catch'](handleError(_0x3dcffd,null));};exports[_0x669d('0x50')]=function(_0x24e752,_0x12dcf3,_0x277940){return db[_0x669d('0x38')][_0x669d('0x4f')]({'where':{'id':_0x24e752[_0x669d('0x4c')]['id']},'attributes':[_0x669d('0x35'),_0x669d('0x7')],'raw':!![]})[_0x669d('0x2d')](handleEntityNotFound(_0x12dcf3,null))[_0x669d('0x2d')](function(_0x410ce5){if(_0x410ce5){var _0x41a2e6=path['join'](config[_0x669d('0x51')],_0x669d('0x52'),util[_0x669d('0x53')](_0x669d('0x54'),path['basename'](_0x410ce5[_0x669d('0x7')])));var _0x1a1f25=fs[_0x669d('0x55')](_0x41a2e6);var _0x41890c=archiver(_0x669d('0x56'),{'zlib':{'level':0x9}});_0x41890c['on']('warning',function(_0x279fa1){if(_0x279fa1[_0x669d('0x57')]===_0x669d('0x58')){logger['error'](_0x279fa1);}else{throw new db[(_0x669d('0x59'))][(_0x669d('0x5a'))](_0x669d('0x5b'));}});_0x41890c['on'](_0x669d('0x33'),function(_0x4a0bb6){throw new db[(_0x669d('0x59'))][(_0x669d('0x5a'))](_0x669d('0x5b'));});_0x41890c[_0x669d('0x5c')](_0x1a1f25);_0x41890c[_0x669d('0x5d')]('**/*',{'cwd':path[_0x669d('0x5e')](config['root'],_0x669d('0x52'),path['dirname'](_0x410ce5['path'])),'ignore':[path[_0x669d('0x5e')](path[_0x669d('0x5f')](_0x410ce5[_0x669d('0x7')]),_0x669d('0x60')),path['join'](path[_0x669d('0x5f')](_0x410ce5['path']),_0x669d('0x61'))],'nodir':!![]})[_0x669d('0x62')]();_0x1a1f25['on'](_0x669d('0x63'),function(){if(!fs[_0x669d('0x64')](_0x41a2e6)){throw new db['Sequelize'][(_0x669d('0x5a'))](_0x669d('0x65'));}return _0x12dcf3['download'](_0x41a2e6,util[_0x669d('0x53')](_0x669d('0x54'),path['basename'](_0x410ce5[_0x669d('0x7')])),function(_0x3ab39a){if(_0x3ab39a){throw new db['Sequelize'][(_0x669d('0x5a'))](_0x669d('0x66'));}fs[_0x669d('0x67')](_0x41a2e6);logger[_0x669d('0x68')](_0x669d('0x69'));logger['info'](_0x669d('0x6a'));});});}return null;})[_0x669d('0x4a')](handleError(_0x12dcf3,null));};exports[_0x669d('0x6b')]=function(_0x49d90e,_0x4e4d9c,_0x43a554){var _0x1caeff=path[_0x669d('0x5f')](_0x49d90e[_0x669d('0x6c')][_0x669d('0x6d')],path[_0x669d('0x6e')](_0x49d90e['file'][_0x669d('0x6d')]));var _0x570fff=path[_0x669d('0x5e')](config['root'],_0x669d('0x52'),_0x49d90e[_0x669d('0x6c')][_0x669d('0x6d')]);var _0x4af0f2=path['join'](config[_0x669d('0x51')],_0x669d('0x52'),_0x1caeff);logger[_0x669d('0x68')](_0x669d('0x6f'),_0x570fff);logger[_0x669d('0x68')](_0x669d('0x70'),_0x4af0f2);try{fs[_0x669d('0x71')](_0x570fff,parseInt(_0x669d('0x72'),0x8));extract(_0x570fff,{'dir':_0x4af0f2},function(_0x17a503){if(_0x17a503){logger[_0x669d('0x33')](_0x17a503);handleError(_0x17a503,!![]);};var _0x32f2f5=fs['readdirSync'](_0x4af0f2);if(_0x32f2f5['length']>0x1){removeReferences(_0x570fff,_0x4af0f2);logger['error']('Invalid\x20plugin\x20structure');return _0x43a554(new Error('Invalid\x20plugin\x20structure'));}var _0x18baec=fs[_0x669d('0x73')](path[_0x669d('0x5e')](_0x4af0f2,_0x32f2f5[0x0]));if(_0x18baec[_0x669d('0x74')]()){removeReferences(_0x570fff,_0x4af0f2);logger[_0x669d('0x33')](_0x669d('0x75'));return _0x43a554(new Error(_0x669d('0x75')));}if(_0x18baec[_0x669d('0x76')]()){var _0x5d3912=fs[_0x669d('0x77')](path[_0x669d('0x5e')](_0x4af0f2,_0x32f2f5[0x0]));if(_0x5d3912[_0x669d('0x41')]===0x0){removeReferences(_0x570fff,_0x4af0f2);logger[_0x669d('0x33')](_0x669d('0x75'));return _0x43a554(new Error(_0x669d('0x75')));}var _0x2c142a=_0x5d3912[_0x669d('0x78')](function(_0x17ea90){return _0x17ea90===_0x669d('0x79');});if(!_0x2c142a){return _0x43a554(new Error(_0x669d('0x7a')));}var _0x2123e3=fs[_0x669d('0x7b')](path['join'](_0x4af0f2,_0x32f2f5[0x0],'manifest.json'));var _0x5c8cbe=JSON['parse'](_0x2123e3);if(_0x669d('0x25')==typeof _0x5c8cbe[_0x669d('0x35')]){return _0x43a554(new Error(_0x669d('0x7c')));}if(_0x669d('0x25')==typeof _0x5c8cbe[_0x669d('0x39')]){return _0x43a554(new Error(_0x669d('0x7d')));}if(_0x669d('0x25')==typeof _0x5c8cbe['version']){return _0x43a554(new Error(_0x669d('0x7e')));}if(_0x669d('0x25')==typeof _0x5c8cbe[_0x669d('0x7f')]){return _0x43a554(new Error(_0x669d('0x80')));}if(_0x5c8cbe['type']===_0x669d('0x81')){if(_0x669d('0x25')==typeof _0x5c8cbe['parameters']['views']){return _0x43a554(new Error(_0x669d('0x82')));}if(_0x669d('0x25')==typeof _0x5c8cbe[_0x669d('0x7f')][_0x669d('0x83')][_0x669d('0x84')]&&'undefined'==typeof _0x5c8cbe[_0x669d('0x7f')]['views'][_0x669d('0x85')]){return _0x43a554(new Error(_0x669d('0x86')));}}else if(_0x5c8cbe[_0x669d('0x39')]==='script'){if(_0x669d('0x25')==typeof _0x5c8cbe[_0x669d('0x7f')][_0x669d('0x87')]){return _0x43a554(new Error(_0x669d('0x88')));}if(_0x669d('0x25')==typeof _0x5c8cbe[_0x669d('0x7f')]['scriptPath']){return _0x43a554(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x43a554(new Error(_0x669d('0x89')));}var _0x581b5e=_0x5c8cbe['name'];var _0x3a26f2=_0x5c8cbe[_0x669d('0x8a')];var _0x54ff5d=_0x5c8cbe[_0x669d('0x39')];var _0x33377b=_0x5c8cbe[_0x669d('0x8b')]?_0x5c8cbe['sidebar']:'always';var _0x506c3e=_0x5c8cbe[_0x669d('0x8c')]?_0x5c8cbe[_0x669d('0x8c')]:_0x669d('0x8d');var _0xa67acc='';var _0x14e6fd='';var _0x44cb04='';var _0x2f10b8='';var _0x5af9e1=_0x5c8cbe[_0x669d('0x8e')];if(_0x54ff5d===_0x669d('0x81')){if(_0x669d('0x25')!=typeof _0x5c8cbe[_0x669d('0x7f')][_0x669d('0x83')][_0x669d('0x84')]){var _0x35067a=_0x5c8cbe['parameters']['views'][_0x669d('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x669d('0x8f')](_0x35067a)){_0xa67acc=path[_0x669d('0x5e')](_0x669d('0x90'),_0x1caeff,_0x32f2f5[0x0],_0x35067a);}else{_0xa67acc=_0x35067a;}}else{logger[_0x669d('0x68')](_0x669d('0x91'));}if(_0x669d('0x25')!=typeof _0x5c8cbe['parameters']['views'][_0x669d('0x85')]){var _0x2000f4=_0x5c8cbe[_0x669d('0x7f')]['views'][_0x669d('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2000f4)){_0x14e6fd=path[_0x669d('0x5e')]('plugins',_0x1caeff,_0x32f2f5[0x0],_0x2000f4);}else{_0x14e6fd=_0x2000f4;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x54ff5d===_0x669d('0x92')){_0x44cb04=_0x5c8cbe['parameters'][_0x669d('0x87')];_0x2f10b8=_0x5c8cbe[_0x669d('0x7f')][_0x669d('0x93')];if(_0x669d('0x25')!=typeof _0x5c8cbe[_0x669d('0x7f')][_0x669d('0x83')]){if(_0x669d('0x25')!=typeof _0x5c8cbe['parameters'][_0x669d('0x83')]['admin']){var _0x35067a=_0x5c8cbe['parameters']['views'][_0x669d('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x669d('0x8f')](_0x35067a)){_0xa67acc=path[_0x669d('0x5e')](_0x669d('0x90'),_0x1caeff,_0x32f2f5[0x0],_0x35067a);}else{_0xa67acc=_0x35067a;}}if(_0x669d('0x25')!=typeof _0x5c8cbe[_0x669d('0x7f')][_0x669d('0x83')]['agent']){var _0x2000f4=_0x5c8cbe[_0x669d('0x7f')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x669d('0x8f')](_0x2000f4)){_0x14e6fd=path['join'](_0x669d('0x90'),_0x1caeff,_0x32f2f5[0x0],_0x2000f4);}else{_0x14e6fd=_0x2000f4;}}}}var _0x3022c4={'name':_0x581b5e,'description':_0x3a26f2,'path':path['join'](_0x1caeff,_0x32f2f5[0x0]),'type':_0x54ff5d,'sidebar':_0x33377b,'icon':_0x506c3e,'adminUrl':_0xa67acc,'agentUrl':_0x14e6fd,'scriptName':_0x44cb04,'scriptPath':_0x2f10b8,'version':_0x5af9e1};removeReferences(_0x570fff,null);return db[_0x669d('0x38')][_0x669d('0x94')](_0x3022c4)[_0x669d('0x2d')](function(_0x5b8e9d){var _0x3f3a00={'role':_0x49d90e[_0x669d('0x95')]['role'],'userProfileId':_0x49d90e[_0x669d('0x95')][_0x669d('0x96')]};if(!_0x3f3a00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f3a00['role']===_0x669d('0x97')){var _0x31de40=_0x5b8e9d[_0x669d('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0x669d('0x4f')]({'where':{'name':_0x669d('0x30'),'userProfileId':_0x3f3a00[_0x669d('0x96')]},'raw':!![]})['then'](function(_0xe42430){if(_0xe42430&&_0xe42430[_0x669d('0x98')]===0x0){return db[_0x669d('0x31')][_0x669d('0x94')]({'name':_0x31de40[_0x669d('0x35')],'resourceId':_0x31de40['id'],'type':_0xe42430[_0x669d('0x35')],'sectionId':_0xe42430['id']},{})[_0x669d('0x2d')](function(){return _0x5b8e9d;});}else{return _0x5b8e9d;}})[_0x669d('0x4a')](function(_0x4bbe32){logger[_0x669d('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bbe32);throw _0x4bbe32;});}return _0x5b8e9d;})[_0x669d('0x2d')](respondWithResult(_0x4e4d9c,null))[_0x669d('0x4a')](handleError(_0x4e4d9c,null));}});}catch(_0x68a284){_0x4e4d9c[_0x669d('0x22')](0x1f4)['send'](_0x68a284);}};function removeReferences(_0x59aaf6,_0x20a6f9){try{if(_0x59aaf6){fs[_0x669d('0x67')](_0x59aaf6);logger['info'](_0x669d('0x99'));}if(_0x20a6f9){rimraf(_0x20a6f9,function(){});logger[_0x669d('0x68')]('Extracted\x20folder\x20removed');}}catch(_0xf45e00){logger[_0x669d('0x33')](_0xf45e00);}}exports[_0x669d('0x9a')]=function(_0x46a2ed,_0x2f51a5,_0x24d1e1){return db[_0x669d('0x38')]['find']({'where':{'id':_0x46a2ed[_0x669d('0x4c')]['id']}})[_0x669d('0x2d')](handleEntityNotFound(_0x2f51a5,null))[_0x669d('0x2d')](saveUpdates(_0x46a2ed[_0x669d('0x95')],null))[_0x669d('0x2d')](respondWithResult(_0x2f51a5,null))[_0x669d('0x4a')](handleError(_0x2f51a5,null));};exports['delete']=function(_0x1071f1,_0x532433,_0x40ad71){return db[_0x669d('0x38')]['find']({'where':{'id':_0x1071f1[_0x669d('0x4c')]['id']}})[_0x669d('0x2d')](function(_0x56af1f){if(_0x56af1f){return _0x56af1f[_0x669d('0x2e')]();}})[_0x669d('0x2d')](function(_0x313302){rimraf(path[_0x669d('0x5e')](config[_0x669d('0x51')],'server/files/plugins',path['dirname'](_0x313302[_0x669d('0x7')])),function(){});return _0x313302;})[_0x669d('0x2d')](handleEntityNotFound(_0x532433,null))[_0x669d('0x2d')](respondWithStatusCode(_0x532433,null))['catch'](handleError(_0x532433,null));};exports['webhookGet']=function(_0x2b1351,_0x568880,_0x587881){return BPromise[_0x669d('0x9b')]()[_0x669d('0x2d')](function(){if(!_0x2b1351[_0x669d('0x3c')][_0x669d('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2b1351[_0x669d('0x3c')]['port']){throw new Error(_0x669d('0x9c'));}var _0x3d93fc=_0x2b1351['query'][_0x669d('0x9d')]?_0x2b1351['query'][_0x669d('0x9d')]+':'+_0x2b1351[_0x669d('0x3c')][_0x669d('0x9e')]:_0x669d('0x9f')+_0x2b1351[_0x669d('0x3c')][_0x669d('0x9e')];var _0x462142=_0x2b1351['query'][_0x669d('0x23')]?_0x2b1351['query'][_0x669d('0x23')]:!![];var _0x5dec61=_0x2b1351['query'][_0x669d('0xa0')]?_0x2b1351[_0x669d('0x3c')][_0x669d('0xa0')]:null;var _0x89402b={'method':_0x2b1351[_0x669d('0xa1')],'uri':util[_0x669d('0x53')](_0x669d('0xa2'),_0x3d93fc,_0x2b1351['query'][_0x669d('0x7')]),'json':_0x462142,'resolveWithFullResponse':!![],'encoding':_0x5dec61,'qs':_0x2b1351[_0x669d('0x3c')]};if(_0x2b1351[_0x669d('0xa3')]){_0x89402b[_0x669d('0xa3')]=_0x2b1351[_0x669d('0xa3')];if(_0x89402b['headers'][_0x669d('0xa4')]){delete _0x89402b[_0x669d('0xa3')][_0x669d('0xa4')];}}if(_0x89402b['headers'][_0x669d('0xa5')]){delete _0x89402b[_0x669d('0xa3')][_0x669d('0xa5')];}return rp(_0x89402b);})['then'](function(_0xa0b57d){if(_0xa0b57d){_0x568880['set'](_0xa0b57d[_0x669d('0xa3')]);logger[_0x669d('0x68')](_0xa0b57d[_0x669d('0x95')]);if(_['endsWith'](_0x2b1351[_0x669d('0x3c')][_0x669d('0x7')],_0x669d('0x50'))&&_0xa0b57d[_0x669d('0xa6')]==0x1f4){return _0x568880[_0x669d('0x21')](_0xa0b57d[_0x669d('0xa6')]);}else{return _0x568880['status'](_0xa0b57d[_0x669d('0xa6')])['send'](_0xa0b57d['body']);}}else{return _0x568880['sendStatus'](0xc8);}})['catch'](handleError(_0x568880,null));};exports[_0x669d('0xa7')]=function(_0x457361,_0x235106,_0x1dbd80){return BPromise[_0x669d('0x9b')]()[_0x669d('0x2d')](function(){if(!_0x457361[_0x669d('0x3c')][_0x669d('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x457361[_0x669d('0x3c')][_0x669d('0x9e')]){throw new Error(_0x669d('0x9c'));}var _0x7369f6=_0x457361[_0x669d('0x3c')][_0x669d('0x9d')]?_0x457361[_0x669d('0x3c')]['hostname']+':'+_0x457361['query'][_0x669d('0x9e')]:_0x669d('0x9f')+_0x457361['query'][_0x669d('0x9e')];var _0x2a1e2f=_0x457361[_0x669d('0x3c')][_0x669d('0x23')]?_0x457361[_0x669d('0x3c')][_0x669d('0x23')]:!![];var _0x5b0713=_0x457361[_0x669d('0x3c')][_0x669d('0xa0')]?_0x457361[_0x669d('0x3c')][_0x669d('0xa0')]:null;var _0x38defb={'method':_0x457361[_0x669d('0xa1')],'uri':util[_0x669d('0x53')]('%s%s',_0x7369f6,_0x457361['query']['path']),'json':_0x2a1e2f,'resolveWithFullResponse':!![],'encoding':_0x5b0713,'body':_0x457361[_0x669d('0x95')]};if(_0x457361[_0x669d('0xa3')]){_0x38defb[_0x669d('0xa3')]=_0x457361[_0x669d('0xa3')];if(_0x38defb[_0x669d('0xa3')][_0x669d('0xa4')]){delete _0x38defb[_0x669d('0xa3')][_0x669d('0xa4')];}}if(_0x38defb[_0x669d('0xa3')][_0x669d('0xa5')]){delete _0x38defb['headers']['content-type'];}return rp(_0x38defb);})['then'](function(_0x206ac6){if(_0x206ac6){_0x235106['set'](_0x206ac6[_0x669d('0xa3')]);logger['info'](_0x206ac6['body']);return _0x235106[_0x669d('0x22')](_0x206ac6[_0x669d('0xa6')])['send'](_0x206ac6[_0x669d('0x95')]);}else{return _0x235106[_0x669d('0x21')](0xc8);}})[_0x669d('0x4a')](handleError(_0x235106,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index adc8a8c..d43fcc5 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 _0xcf12=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3f063b,_0x49dfdd){var _0xb1b0de=function(_0x44ab59){while(--_0x44ab59){_0x3f063b['push'](_0x3f063b['shift']());}};_0xb1b0de(++_0x49dfdd);}(_0xcf12,0x140));var _0x2cf1=function(_0x218377,_0xb6729d){_0x218377=_0x218377-0x0;var _0x2bf02d=_0xcf12[_0x218377];return _0x2bf02d;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x2cf1('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x2cf1('0x1')](0x0);var events={'afterCreate':_0x2cf1('0x2'),'afterUpdate':_0x2cf1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3833b1){return function(_0x3553ec,_0x2c4bb6,_0x30b14c){PluginEvents[_0x2cf1('0x4')](_0x3833b1+':'+_0x3553ec['id'],_0x3553ec);PluginEvents[_0x2cf1('0x4')](_0x3833b1,_0x3553ec);_0x30b14c(null);};}for(var e in events){if(events[_0x2cf1('0x5')](e)){var event=events[e];Plugin[_0x2cf1('0x6')](e,emitEvent(event));}}module[_0x2cf1('0x7')]=PluginEvents; \ No newline at end of file +var _0x9e8a=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9e8a,0x112));var _0xa9e8=function(_0x101d16,_0x2b870f){_0x101d16=_0x101d16-0x0;var _0x519387=_0x9e8a[_0x101d16];return _0x519387;};'use strict';var EventEmitter=require(_0xa9e8('0x0'));var Plugin=require(_0xa9e8('0x1'))['db'][_0xa9e8('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa9e8('0x3')](0x0);var events={'afterCreate':_0xa9e8('0x4'),'afterUpdate':_0xa9e8('0x5'),'afterDestroy':_0xa9e8('0x6')};function emitEvent(_0x337024){return function(_0xe3b2c8,_0x57736c,_0x4f9ddb){PluginEvents['emit'](_0x337024+':'+_0xe3b2c8['id'],_0xe3b2c8);PluginEvents['emit'](_0x337024,_0xe3b2c8);_0x4f9ddb(null);};}for(var e in events){if(events[_0xa9e8('0x7')](e)){var event=events[e];Plugin[_0xa9e8('0x8')](e,emitEvent(event));}}module[_0xa9e8('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 0296919..0f98ba7 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 _0x2707=['define','plugins','lodash','util','api','bluebird','request-promise','rimraf','exports'];(function(_0x3cc8e1,_0x1ec0c9){var _0x2c0ff8=function(_0x13afea){while(--_0x13afea){_0x3cc8e1['push'](_0x3cc8e1['shift']());}};_0x2c0ff8(++_0x1ec0c9);}(_0x2707,0x65));var _0x7270=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2707[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x7270('0x0'));var util=require(_0x7270('0x1'));var logger=require('../../config/logger')(_0x7270('0x2'));var moment=require('moment');var BPromise=require(_0x7270('0x3'));var rp=require(_0x7270('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7270('0x5'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x7270('0x6')]=function(_0x56dfd5,_0x204a6a){return _0x56dfd5[_0x7270('0x7')]('Plugin',attributes,{'tableName':_0x7270('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1974=['./plugin.attributes','exports','define','Plugin','plugins','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2f1753,_0x458f6d){var _0x56a164=function(_0x1e36dd){while(--_0x1e36dd){_0x2f1753['push'](_0x2f1753['shift']());}};_0x56a164(++_0x458f6d);}(_0x1974,0x1d3));var _0x4197=function(_0x242a30,_0x688270){_0x242a30=_0x242a30-0x0;var _0x3d369a=_0x1974[_0x242a30];return _0x3d369a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4197('0x0'))('api');var moment=require(_0x4197('0x1'));var BPromise=require(_0x4197('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4197('0x3'));var rimraf=require(_0x4197('0x4'));var config=require(_0x4197('0x5'));var attributes=require(_0x4197('0x6'));module[_0x4197('0x7')]=function(_0x43687d,_0x1b0404){return _0x43687d[_0x4197('0x8')](_0x4197('0x9'),attributes,{'tableName':_0x4197('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 723de24..39c95b6 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 _0xc664=['message','info','result','catch','CreatePlugin','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31ef57,_0x362da1){var _0x53a8a0=function(_0x1f8e82){while(--_0x1f8e82){_0x31ef57['push'](_0x31ef57['shift']());}};_0x53a8a0(++_0x362da1);}(_0xc664,0x1ad));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c66('0x0'));var util=require(_0x4c66('0x1'));var moment=require(_0x4c66('0x2'));var BPromise=require(_0x4c66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c66('0x4'));var db=require(_0x4c66('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c66('0x6'))(_0x4c66('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c66('0x8'));var client=jayson[_0x4c66('0x9')][_0x4c66('0xa')]({'port':0x232a});config[_0x4c66('0xb')]=_[_0x4c66('0xc')](config[_0x4c66('0xb')],{'host':_0x4c66('0xd'),'port':0x18eb});var socket=require(_0x4c66('0xe'))(new Redis(config[_0x4c66('0xb')]));require(_0x4c66('0xf'))[_0x4c66('0x10')](socket);function respondWithRpcPromise(_0xbb2bf7,_0x30ebc6,_0x3b02a6){return new BPromise(function(_0x2d5603,_0x200a7b){return client[_0x4c66('0x11')](_0xbb2bf7,_0x3b02a6)[_0x4c66('0x12')](function(_0x57ef47){logger['info'](_0x4c66('0x13'),_0x30ebc6,_0x4c66('0x14'));logger[_0x4c66('0x15')](_0x4c66('0x16'),_0x30ebc6,'request\x20sent',JSON[_0x4c66('0x17')](_0x57ef47));if(_0x57ef47[_0x4c66('0x18')]){if(_0x57ef47['error'][_0x4c66('0x19')]===0x1f4){logger[_0x4c66('0x18')](_0x4c66('0x13'),_0x30ebc6,_0x57ef47[_0x4c66('0x18')]['message']);return _0x200a7b(_0x57ef47[_0x4c66('0x18')][_0x4c66('0x1a')]);}logger[_0x4c66('0x18')](_0x4c66('0x13'),_0x30ebc6,_0x57ef47['error']['message']);return _0x2d5603(_0x57ef47[_0x4c66('0x18')][_0x4c66('0x1a')]);}else{logger[_0x4c66('0x1b')]('Plugin,\x20%s,\x20%s',_0x30ebc6,'request\x20sent');_0x2d5603(_0x57ef47[_0x4c66('0x1c')][_0x4c66('0x1a')]);}})[_0x4c66('0x1d')](function(_0x4ae9bb){logger[_0x4c66('0x18')](_0x4c66('0x13'),_0x30ebc6,_0x4ae9bb);_0x200a7b(_0x4ae9bb);});});}exports[_0x4c66('0x1e')]=function(_0x4f9b9f){var _0x4bd27f=this;return new Promise(function(_0x4397ed,_0x2fe948){return db['Plugin'][_0x4c66('0x1f')](_0x4f9b9f[_0x4c66('0x20')],{'raw':_0x4f9b9f['options']?_0x4f9b9f[_0x4c66('0x21')][_0x4c66('0x22')]===undefined?!![]:![]:!![]})[_0x4c66('0x12')](function(_0x366abb){logger[_0x4c66('0x1b')](_0x4c66('0x1e'),_0x4f9b9f);logger[_0x4c66('0x15')](_0x4c66('0x1e'),_0x4f9b9f,JSON[_0x4c66('0x17')](_0x366abb));_0x4397ed(_0x366abb);})['catch'](function(_0x5b50de){logger['error'](_0x4c66('0x1e'),_0x5b50de[_0x4c66('0x1a')],_0x4f9b9f);_0x2fe948(_0x4bd27f[_0x4c66('0x18')](0x1f4,_0x5b50de[_0x4c66('0x1a')]));});});}; \ No newline at end of file +var _0xbbec=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Plugin,\x20%s,\x20%s','result','catch','create','body','options','raw','CreatePlugin','lodash'];(function(_0x5a17e1,_0x455cb0){var _0x9a5fba=function(_0x3326a8){while(--_0x3326a8){_0x5a17e1['push'](_0x5a17e1['shift']());}};_0x9a5fba(++_0x455cb0);}(_0xbbec,0x7b));var _0xcbbe=function(_0xcb2f5d,_0x398c9b){_0xcb2f5d=_0xcb2f5d-0x0;var _0x313741=_0xbbec[_0xcb2f5d];return _0x313741;};'use strict';var _=require(_0xcbbe('0x0'));var util=require('util');var moment=require(_0xcbbe('0x1'));var BPromise=require('bluebird');var rs=require(_0xcbbe('0x2'));var fs=require('fs');var Redis=require(_0xcbbe('0x3'));var db=require(_0xcbbe('0x4'))['db'];var utils=require(_0xcbbe('0x5'));var logger=require('../../config/logger')(_0xcbbe('0x6'));var config=require(_0xcbbe('0x7'));var jayson=require(_0xcbbe('0x8'));var client=jayson[_0xcbbe('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xcbbe('0xa')],{'host':_0xcbbe('0xb'),'port':0x18eb});var socket=require(_0xcbbe('0xc'))(new Redis(config[_0xcbbe('0xa')]));require('./plugin.socket')[_0xcbbe('0xd')](socket);function respondWithRpcPromise(_0x1c00b8,_0x24bef3,_0x1228c4){return new BPromise(function(_0x5cc094,_0x2a9b07){return client['request'](_0x1c00b8,_0x1228c4)[_0xcbbe('0xe')](function(_0x323852){logger[_0xcbbe('0xf')]('Plugin,\x20%s,\x20%s',_0x24bef3,_0xcbbe('0x10'));logger[_0xcbbe('0x11')](_0xcbbe('0x12'),_0x24bef3,_0xcbbe('0x10'),JSON[_0xcbbe('0x13')](_0x323852));if(_0x323852[_0xcbbe('0x14')]){if(_0x323852[_0xcbbe('0x14')][_0xcbbe('0x15')]===0x1f4){logger[_0xcbbe('0x14')]('Plugin,\x20%s,\x20%s',_0x24bef3,_0x323852[_0xcbbe('0x14')][_0xcbbe('0x16')]);return _0x2a9b07(_0x323852[_0xcbbe('0x14')][_0xcbbe('0x16')]);}logger[_0xcbbe('0x14')](_0xcbbe('0x17'),_0x24bef3,_0x323852['error'][_0xcbbe('0x16')]);return _0x5cc094(_0x323852[_0xcbbe('0x14')][_0xcbbe('0x16')]);}else{logger[_0xcbbe('0xf')]('Plugin,\x20%s,\x20%s',_0x24bef3,_0xcbbe('0x10'));_0x5cc094(_0x323852[_0xcbbe('0x18')][_0xcbbe('0x16')]);}})[_0xcbbe('0x19')](function(_0x3fa5f5){logger[_0xcbbe('0x14')]('Plugin,\x20%s,\x20%s',_0x24bef3,_0x3fa5f5);_0x2a9b07(_0x3fa5f5);});});}exports['CreatePlugin']=function(_0x3eb3c3){var _0x3248dc=this;return new Promise(function(_0x2eb95f,_0x39b1c1){return db['Plugin'][_0xcbbe('0x1a')](_0x3eb3c3[_0xcbbe('0x1b')],{'raw':_0x3eb3c3[_0xcbbe('0x1c')]?_0x3eb3c3[_0xcbbe('0x1c')][_0xcbbe('0x1d')]===undefined?!![]:![]:!![]})[_0xcbbe('0xe')](function(_0x51b07c){logger[_0xcbbe('0xf')](_0xcbbe('0x1e'),_0x3eb3c3);logger[_0xcbbe('0x11')](_0xcbbe('0x1e'),_0x3eb3c3,JSON[_0xcbbe('0x13')](_0x51b07c));_0x2eb95f(_0x51b07c);})[_0xcbbe('0x19')](function(_0x177a73){logger['error']('CreatePlugin',_0x177a73[_0xcbbe('0x16')],_0x3eb3c3);_0x39b1c1(_0x3248dc['error'](0x1f4,_0x177a73[_0xcbbe('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index f5c1303..b70dc8f 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 _0x8bc5=['update','emit','register','length','plugin:','./plugin.events','remove'];(function(_0x2e8322,_0x1e296b){var _0x6fa1c7=function(_0x166737){while(--_0x166737){_0x2e8322['push'](_0x2e8322['shift']());}};_0x6fa1c7(++_0x1e296b);}(_0x8bc5,0xc9));var _0x58bc=function(_0x327a4d,_0x4c5428){_0x327a4d=_0x327a4d-0x0;var _0x2ec7b2=_0x8bc5[_0x327a4d];return _0x2ec7b2;};'use strict';var PluginEvents=require(_0x58bc('0x0'));var events=['save',_0x58bc('0x1'),_0x58bc('0x2')];function createListener(_0x5ebd86,_0x5eee68){return function(_0x48293c){_0x5eee68[_0x58bc('0x3')](_0x5ebd86,_0x48293c);};}function removeListener(_0x4d1ff3,_0x55d606){return function(){PluginEvents['removeListener'](_0x4d1ff3,_0x55d606);};}exports[_0x58bc('0x4')]=function(_0x564c4f){for(var _0x1dcf91=0x0,_0x21f69d=events[_0x58bc('0x5')];_0x1dcf91<_0x21f69d;_0x1dcf91++){var _0x20a0c1=events[_0x1dcf91];var _0x2628aa=createListener(_0x58bc('0x6')+_0x20a0c1,_0x564c4f);PluginEvents['on'](_0x20a0c1,_0x2628aa);}}; \ No newline at end of file +var _0x8d69=['register','length','plugin:','./plugin.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d69,0x135));var _0x98d6=function(_0x224ef8,_0x16ad0d){_0x224ef8=_0x224ef8-0x0;var _0x5e9c0b=_0x8d69[_0x224ef8];return _0x5e9c0b;};'use strict';var PluginEvents=require(_0x98d6('0x0'));var events=[_0x98d6('0x1'),_0x98d6('0x2'),_0x98d6('0x3')];function createListener(_0x5e7f48,_0x1d45e2){return function(_0xdae6f2){_0x1d45e2[_0x98d6('0x4')](_0x5e7f48,_0xdae6f2);};}function removeListener(_0x4cd6ab,_0x4b5808){return function(){PluginEvents[_0x98d6('0x5')](_0x4cd6ab,_0x4b5808);};}exports[_0x98d6('0x6')]=function(_0x155c3e){for(var _0x35b378=0x0,_0x529a95=events[_0x98d6('0x7')];_0x35b378<_0x529a95;_0x35b378++){var _0x1bb100=events[_0x35b378];var _0x1e1405=createListener(_0x98d6('0x8')+_0x1bb100,_0x155c3e);PluginEvents['on'](_0x1bb100,_0x1e1405);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d2971a8..bb93552 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(_0x3e9160,_0x9faf1d){var _0x4c2a8a=function(_0x25688f){while(--_0x25688f){_0x3e9160['push'](_0x3e9160['shift']());}};_0x4c2a8a(++_0x9faf1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x3d6b31,_0x139381){var _0x251721=function(_0x434d7b){while(--_0x434d7b){_0x3d6b31['push'](_0x3d6b31['shift']());}};_0x251721(++_0x139381);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 deb3687..f0f512d 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','show','describe','catch','body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2'];(function(_0xcd9676,_0x344f3a){var _0x20bb39=function(_0x1704cc){while(--_0x1704cc){_0xcd9676['push'](_0xcd9676['shift']());}};_0x20bb39(++_0x344f3a);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xe5b5[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x5e5b('0x0'));var pm2=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var path=require(_0x5e5b('0x4'));var exec=require(_0x5e5b('0x5'))[_0x5e5b('0x6')];var BPromise=require(_0x5e5b('0x7'));function handleEntityNotFound(_0xf20c6a,_0x20a50c){return function(_0xdc6616){if(!_0xdc6616){_0xf20c6a[_0x5e5b('0x8')](0x194);;}return _0xdc6616;};}function respondWithResult(_0xf1fbe2,_0x11e0e0){_0x11e0e0=_0x11e0e0||0xc8;return function(_0x545eb3){if(_0x545eb3){return _0xf1fbe2[_0x5e5b('0x9')](_0x11e0e0)[_0x5e5b('0xa')](_0x545eb3);}return null;};}function handleError(_0xcbd478,_0x258414){_0x258414=_0x258414||0x1f4;return function(_0xb9d72b){logger[_0x5e5b('0xb')](_0xb9d72b[_0x5e5b('0xc')]);if(_0xb9d72b[_0x5e5b('0xd')]){delete _0xb9d72b['name'];}_0xcbd478[_0x5e5b('0x9')](_0x258414)['send'](_0xb9d72b);};}function execChildProcess(){return new BPromise(function(_0x108c34,_0x58185){exec(_0x5e5b('0xe'),function(_0x3f64b6,_0x55c974,_0x4a1424){logger['info'](_0x55c974);logger[_0x5e5b('0xf')](_0x4a1424);if(_0x3f64b6){logger[_0x5e5b('0xb')](_0x3f64b6);return _0x58185(_0x3f64b6);}return _0x108c34(_0x55c974);});});}exports[_0x5e5b('0x10')]=function(_0x1694ff,_0x13a01e){return pm2[_0x5e5b('0x11')]()[_0x5e5b('0x12')](function(_0x49edd0){if(_0x49edd0){var _0x2b37fa=_[_0x5e5b('0x13')](_0x49edd0,function(_0x4ff37b){return _0x4ff37b[_0x5e5b('0xd')]==='express'||_0x4ff37b['name']===_0x5e5b('0x14');});return{'rows':_0x2b37fa,'count':_0x2b37fa[_0x5e5b('0x15')]};}return null;})[_0x5e5b('0x12')](respondWithResult(_0x13a01e,null))['catch'](handleError(_0x13a01e,null));};exports[_0x5e5b('0x16')]=function(_0x4d490c,_0x1796af){return pm2[_0x5e5b('0x17')](_0x4d490c['params']['id'])[_0x5e5b('0x12')](respondWithResult(_0x1796af,null))[_0x5e5b('0x12')](handleEntityNotFound(_0x1796af,null))[_0x5e5b('0x18')](handleError(_0x1796af,null));};exports['create']=function(_0x2bf0b7,_0x3f1103){if(_0x2bf0b7['body'][_0x5e5b('0xd')]&&_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]){var _0x2d8252=path[_0x5e5b('0x1b')](__dirname,_0x5e5b('0x1c'),_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]);var _0x4a78e3=process['cwd']();process[_0x5e5b('0x1d')](path[_0x5e5b('0x1e')](_0x2d8252));return execChildProcess()[_0x5e5b('0x12')](function(_0xe1c268){process[_0x5e5b('0x1d')](_0x4a78e3);return pm2[_0x5e5b('0x1f')]({'name':_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0xd')],'script':_0x2d8252});})[_0x5e5b('0x12')](function(_0x26bc02){pm2[_0x5e5b('0x20')]();return _0x26bc02[0x0];})['then'](respondWithResult(_0x3f1103,0xc9))[_0x5e5b('0x18')](handleError(_0x3f1103,null));}else{return _0x3f1103[_0x5e5b('0x9')](0x1f4)[_0x5e5b('0x21')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5e5b('0x22')]=function(_0xdb2863,_0x5ee866){if(_0xdb2863[_0x5e5b('0x19')]['id']){delete _0xdb2863[_0x5e5b('0x19')]['id'];}var _0x39ce16={'online':_0x5e5b('0x23'),'stopped':_0x5e5b('0x24')};if(_0x39ce16[_0x5e5b('0x25')](_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')])){return pm2[_0x39ce16[_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')]]](_0xdb2863[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](respondWithResult(_0x5ee866,0xc8))['catch'](handleError(_0x5ee866,null));}else{return _0x5ee866['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x27')});}};exports[_0x5e5b('0x28')]=function(_0x3dcdab,_0x12f1ee){if(_0x3dcdab['body']['id']){delete _0x3dcdab[_0x5e5b('0x19')]['id'];}if(_0x3dcdab['params']['id']){return pm2[_0x5e5b('0x29')](_0x3dcdab[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](function(_0xc2bc09){pm2['dump']();return _0xc2bc09[0x0];})[_0x5e5b('0x12')](respondWithResult(_0x12f1ee,null))[_0x5e5b('0x18')](handleError(_0x12f1ee,null));}else{return _0x12f1ee['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x2a')});}}; \ No newline at end of file +var _0x1339=['body','params','delete','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','then','reject','motion2','catch','show','describe','create','../../files/plugins','cwd','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x2c8de4,_0x48ecd7){var _0xa5f1d5=function(_0x521b2a){while(--_0x521b2a){_0x2c8de4['push'](_0x2c8de4['shift']());}};_0xa5f1d5(++_0x48ecd7);}(_0x1339,0x1ed));var _0x9133=function(_0x4cfd5c,_0x10de50){_0x4cfd5c=_0x4cfd5c-0x0;var _0x90049e=_0x1339[_0x4cfd5c];return _0x90049e;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var path=require(_0x9133('0x2'));var exec=require(_0x9133('0x3'))[_0x9133('0x4')];var BPromise=require(_0x9133('0x5'));function handleEntityNotFound(_0x176e80,_0x110c51){return function(_0x558345){if(!_0x558345){_0x176e80[_0x9133('0x6')](0x194);;}return _0x558345;};}function respondWithResult(_0x855473,_0x379915){_0x379915=_0x379915||0xc8;return function(_0x539af6){if(_0x539af6){return _0x855473[_0x9133('0x7')](_0x379915)[_0x9133('0x8')](_0x539af6);}return null;};}function handleError(_0x3059c4,_0x431a55){_0x431a55=_0x431a55||0x1f4;return function(_0x261698){logger[_0x9133('0x9')](_0x261698[_0x9133('0xa')]);if(_0x261698[_0x9133('0xb')]){delete _0x261698[_0x9133('0xb')];}_0x3059c4[_0x9133('0x7')](_0x431a55)['send'](_0x261698);};}function execChildProcess(){return new BPromise(function(_0x3f9650,_0x3533fa){exec(_0x9133('0xc'),function(_0x452481,_0x3b8f89,_0x244ced){logger['info'](_0x3b8f89);logger[_0x9133('0xd')](_0x244ced);if(_0x452481){logger[_0x9133('0x9')](_0x452481);return _0x3533fa(_0x452481);}return _0x3f9650(_0x3b8f89);});});}exports['index']=function(_0x5283a3,_0x10475c){return pm2['list']()[_0x9133('0xe')](function(_0x439e1a){if(_0x439e1a){var _0x17dfd1=_[_0x9133('0xf')](_0x439e1a,function(_0x31847a){return _0x31847a[_0x9133('0xb')]==='express'||_0x31847a[_0x9133('0xb')]===_0x9133('0x10');});return{'rows':_0x17dfd1,'count':_0x17dfd1['length']};}return null;})[_0x9133('0xe')](respondWithResult(_0x10475c,null))[_0x9133('0x11')](handleError(_0x10475c,null));};exports[_0x9133('0x12')]=function(_0x427663,_0x4a2c4f){return pm2[_0x9133('0x13')](_0x427663['params']['id'])[_0x9133('0xe')](respondWithResult(_0x4a2c4f,null))['then'](handleEntityNotFound(_0x4a2c4f,null))[_0x9133('0x11')](handleError(_0x4a2c4f,null));};exports[_0x9133('0x14')]=function(_0x5e8620,_0x38dd60){if(_0x5e8620['body'][_0x9133('0xb')]&&_0x5e8620['body']['script']){var _0x2f7354=path['join'](__dirname,_0x9133('0x15'),_0x5e8620['body']['script']);var _0x4c846e=process[_0x9133('0x16')]();process[_0x9133('0x17')](path['dirname'](_0x2f7354));return execChildProcess()[_0x9133('0xe')](function(_0x3f5d0e){process[_0x9133('0x17')](_0x4c846e);return pm2[_0x9133('0x18')]({'name':_0x5e8620['body'][_0x9133('0xb')],'script':_0x2f7354});})['then'](function(_0x187e32){pm2[_0x9133('0x19')]();return _0x187e32[0x0];})[_0x9133('0xe')](respondWithResult(_0x38dd60,0xc9))[_0x9133('0x11')](handleError(_0x38dd60,null));}else{return _0x38dd60[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':_0x9133('0x1b')});}};exports[_0x9133('0x1c')]=function(_0x1b6b3e,_0x46050b){if(_0x1b6b3e['body']['id']){delete _0x1b6b3e['body']['id'];}var _0x477bf1={'online':_0x9133('0x1d'),'stopped':_0x9133('0x1e')};if(_0x477bf1[_0x9133('0x1f')](_0x1b6b3e['body']['status'])){return pm2[_0x477bf1[_0x1b6b3e[_0x9133('0x20')][_0x9133('0x7')]]](_0x1b6b3e[_0x9133('0x21')]['id'])[_0x9133('0xe')](respondWithResult(_0x46050b,0xc8))[_0x9133('0x11')](handleError(_0x46050b,null));}else{return _0x46050b[_0x9133('0x7')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x1ad222,_0x4a4a8e){if(_0x1ad222[_0x9133('0x20')]['id']){delete _0x1ad222[_0x9133('0x20')]['id'];}if(_0x1ad222['params']['id']){return pm2[_0x9133('0x22')](_0x1ad222['params']['id'])[_0x9133('0xe')](function(_0x26ca56){pm2[_0x9133('0x19')]();return _0x26ca56[0x0];})['then'](respondWithResult(_0x4a4a8e,null))[_0x9133('0x11')](handleError(_0x4a4a8e,null));}else{return _0x4a4a8e[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 49380a3..d240e7e 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 _0xf668=['getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents'];(function(_0x52b8b7,_0xc64d67){var _0x4063ef=function(_0x5414e9){while(--_0x5414e9){_0x52b8b7['push'](_0x52b8b7['shift']());}};_0x4063ef(++_0xc64d67);}(_0xf668,0xea));var _0x8f66=function(_0x1d538e,_0x542964){_0x1d538e=_0x1d538e-0x0;var _0x381540=_0xf668[_0x1d538e];return _0x381540;};'use strict';var express=require(_0x8f66('0x0'));var router=express[_0x8f66('0x1')]();var auth=require(_0x8f66('0x2'));var controller=require(_0x8f66('0x3'));router[_0x8f66('0x4')](_0x8f66('0x5'),auth['isAuthenticated'](),controller[_0x8f66('0x6')]);router[_0x8f66('0x4')](_0x8f66('0x7'),auth['isAuthenticated'](),controller[_0x8f66('0x8')]);module[_0x8f66('0x9')]=router; \ No newline at end of file +var _0x716d=['getAgents','/queues','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x942eca,_0x1d0181){var _0x589c16=function(_0x235ca1){while(--_0x235ca1){_0x942eca['push'](_0x942eca['shift']());}};_0x589c16(++_0x1d0181);}(_0x716d,0x6e));var _0xd716=function(_0x4ac4ae,_0x34a08c){_0x4ac4ae=_0x4ac4ae-0x0;var _0x22a499=_0x716d[_0x4ac4ae];return _0x22a499;};'use strict';var express=require(_0xd716('0x0'));var router=express[_0xd716('0x1')]();var auth=require(_0xd716('0x2'));var controller=require(_0xd716('0x3'));router[_0xd716('0x4')](_0xd716('0x5'),auth[_0xd716('0x6')](),controller[_0xd716('0x7')]);router[_0xd716('0x4')](_0xd716('0x8'),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 94b70ee..1b53e9a 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 _0x52dd=['faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','routealias','resolve','query','channel','sort','join','globalQueueFilter','Queue','User','rawAttributes','fieldName','type','key','agent','where','isEmpty','user','role','userProfileId','nolimit','getResources','findAndCountAll','rows','omit','pauseTypeFilter','QueueCampaigns','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','json','error','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','outbound','push','originated','message','dialActive','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','paused','loggedInDb','loggedIn','waiting','talking','busy','pTalking','find','pick','filter','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','Pause','findAll','QueueId','unknown','unavailable','ringing','isNil','chatPause','openchannelPause','smsPause','voicePause','whatsappPause','every','idle','pause','chatStatus','faxStatus','smsStatus','whatsappStatus','*pause','mail','sms','openchannel','fax','whatsapp','includes','toLowerCase','Invalid\x20channel','isArray','findOne','getAgents','all','flatten','uniq','value','split','fields','globalStatus','order','DESC','ASC','pauseType','userpic','lastLoginAt','lastPauseAt','address','mailPause'];(function(_0x2bfe51,_0xcba212){var _0x3fe5ad=function(_0x6af26e){while(--_0x6af26e){_0x2bfe51['push'](_0x2bfe51['shift']());}};_0x3fe5ad(++_0xcba212);}(_0x52dd,0x17b));var _0xd52d=function(_0x409297,_0xd56bd3){_0x409297=_0x409297-0x0;var _0x13536d=_0x52dd[_0x409297];return _0x13536d;};'use strict';var util=require(_0xd52d('0x0'));var _=require(_0xd52d('0x1'));var jayson=require('jayson/promise');var qs=require(_0xd52d('0x2'));var logger=require(_0xd52d('0x3'))('api');var db=require(_0xd52d('0x4'))['db'];var amiClient=jayson[_0xd52d('0x5')][_0xd52d('0x6')]({'port':0x232a});var routingClient=jayson[_0xd52d('0x5')][_0xd52d('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x300504,_0x5c825b){return function(_0x7e65e2){if(_0x7e65e2){var _0x138a0e=typeof _0x5c825b[_0xd52d('0x7')]===_0xd52d('0x8')&&typeof _0x5c825b[_0xd52d('0x9')]===_0xd52d('0x8');var _0x4b960d=_0x7e65e2[_0xd52d('0xa')];var _0x54d401=_0x138a0e?0x0:_0x5c825b[_0xd52d('0x7')];var _0x424a75=_0x138a0e?_0x7e65e2['count']:_0x5c825b[_0xd52d('0x7')]+_0x5c825b[_0xd52d('0x9')];var _0x3d006a;if(_0x424a75>=_0x4b960d){_0x424a75=_0x4b960d;_0x3d006a=0xc8;}else{_0x3d006a=0xce;}_0x300504[_0xd52d('0xb')](_0x3d006a);return _0x300504[_0xd52d('0xc')]('Content-Range',_0x54d401+'-'+_0x424a75+'/'+_0x4b960d)[_0xd52d('0xd')](_0x7e65e2);}return null;};}function handleError(_0x51ccf7,_0x5df086){_0x5df086=_0x5df086||0x1f4;return function(_0x1127f6){logger[_0xd52d('0xe')](_0x1127f6['stack']);if(_0x1127f6[_0xd52d('0xf')]){delete _0x1127f6['name'];}_0x51ccf7['status'](_0x5df086)[_0xd52d('0x10')](_0x1127f6);};}function getRealtimeAgents(){return new Promise(function(_0x5e9202,_0x5a730c){return amiClient[_0xd52d('0x11')](_0xd52d('0x12'),{})[_0xd52d('0x13')](function(_0x494789){if(_0x494789[_0xd52d('0xe')])throw new Error(_0xd52d('0x14'));var _0x51e3a5=_0x494789[_0xd52d('0x15')];return routingClient[_0xd52d('0x11')](_0xd52d('0x12'),{})[_0xd52d('0x13')](function(_0x2aa87a){if(_0x2aa87a[_0xd52d('0xe')])throw new Error(_0xd52d('0x16'));var _0x55a7eb=_0x2aa87a[_0xd52d('0x15')];return _0x5e9202(_[_0xd52d('0x17')]({},_0x51e3a5,_0x55a7eb));});})[_0xd52d('0x18')](function(_0x185600){_0x5a730c(_0x185600);});});}function getRealtimeQueues(_0x1fdb60,_0xe97cf4){return new Promise(function(_0x45c6b0,_0x37e2c0){var _0x55050e=_0xe97cf4===_0xd52d('0x19')?amiClient:routingClient;return _0x55050e[_0xd52d('0x11')](_[_0xd52d('0x1a')](_0xe97cf4)+_0xd52d('0x1b'),_0x1fdb60)[_0xd52d('0x13')](function(_0x4b4f08){if(_0x4b4f08[_0xd52d('0xe')])throw new Error(util['format'](_0xd52d('0x1c'),_0xe97cf4));return _0x45c6b0(_0x4b4f08['result']);})[_0xd52d('0x18')](function(_0x22e0d2){_0x37e2c0(_0x22e0d2);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5e9657,_0x132219){return amiClient[_0xd52d('0x11')](_0xd52d('0x1d'),{})[_0xd52d('0x13')](function(_0x4c1c02){if(_0x4c1c02[_0xd52d('0xe')])throw new Error(_0xd52d('0x1e'));return _0x5e9657(_0x4c1c02['result']);})[_0xd52d('0x18')](function(_0x2bd8fa){_0x132219(_0x2bd8fa);});});}function initializeQueues(_0x589516,_0x52685e,_0x25980f,_0x352677){var _0x61f8bd=['loggedIn',_0xd52d('0x1f'),'waiting','talking','paused'];if(_0x25980f===_0xd52d('0x19')&&_0x352677===_0xd52d('0x20')){_0x61f8bd[_0xd52d('0x21')]('pTalking',_0xd52d('0x22'),_0xd52d('0x23'),_0xd52d('0x24'),'dialMethod','Trunk',_0xd52d('0x25'),_0xd52d('0x26'),_0xd52d('0x27'),'erlangCallToSecond',_0xd52d('0x28'),_0xd52d('0x29'),_0xd52d('0x2a'),_0xd52d('0x2b'),_0xd52d('0x2c'),_0xd52d('0x2d'),_0xd52d('0x2e'),_0xd52d('0x2f'),'predictiveIntervalDroppedCallsTimeout',_0xd52d('0x30'),'predictiveIntervalAvgHoldtime',_0xd52d('0x31'));}return _0x589516[_0xd52d('0x32')](function(_0x3b0f3f){var _0x5005a7=_0x3b0f3f['get']({'plain':!![]});_0x5005a7[_0xd52d('0x33')]=[];_0x5005a7[_0xd52d('0x34')]=0x0;_0x5005a7[_0xd52d('0x35')]=0x0;_0x5005a7[_0xd52d('0x36')]=0x0;_0x5005a7['available']=0x0;_0x5005a7[_0xd52d('0x37')]=0x0;if(_0x25980f===_0xd52d('0x19')){_0x5005a7[_0xd52d('0x38')]=0x0;_0x5005a7[_0xd52d('0x39')]=0x0;if(_0x352677===_0xd52d('0x20')){_0x5005a7[_0xd52d('0x3a')]=0x0;_0x5005a7[_0xd52d('0x22')]=0x0;}}var _0x354996=_[_0xd52d('0x3b')](_0x52685e,['id',_0x5005a7['id']]);if(_0x354996)_[_0xd52d('0x17')](_0x5005a7,_[_0xd52d('0x3c')](_0x354996,_0x61f8bd));return _0x5005a7;});}function updateAgentVoiceStatus(_0x35b6fc,_0x3c6ba8,_0x1e4ef8){var _0x4a4118=_[_0xd52d('0x3d')](_0x1e4ef8,['queue',_0x3c6ba8[_0xd52d('0xf')]]);if(_0x4a4118[_0xd52d('0x3e')]===0x0)return _0x35b6fc[_0xd52d('0x39')]=!![];if(_[_0xd52d('0x3f')](_0x4a4118,[_0xd52d('0x40'),_0x35b6fc[_0xd52d('0x41')][_0xd52d('0x42')]()]))return _0x35b6fc[_0xd52d('0x38')]=!![];if(!_0x35b6fc['talking'])return _0x35b6fc[_0xd52d('0x39')]=!![];}function getVoiceQueueAgents(_0x34d6c0,_0xefe239,_0x4399e4,_0x141c84){var _0x478eed=_[_0xd52d('0x3b')](_0xefe239,['id',_0x34d6c0['id']]);if(!_0x478eed)return _0x34d6c0;return _0x478eed[_0xd52d('0x43')]({'raw':!![]})[_0xd52d('0x13')](function(_0x44be75){for(var _0x271aad=0x0;_0x271aad<_0x44be75[_0xd52d('0x3e')];_0x271aad++){var _0x5209b3=_[_0xd52d('0x3b')](_0x4399e4,['id',_0x44be75[_0x271aad]['UserId']]);if(!_0x5209b3){_0x5209b3={'id':_0x44be75[_0x271aad][_0xd52d('0x44')],'name':_0x44be75[_0x271aad][_0xd52d('0x44')],'accountcode':'','online':![]};}var _0x341e2d={'id':_0x5209b3['id'],'name':_0x5209b3[_0xd52d('0xf')],'internal':_0x5209b3[_0xd52d('0x45')],'online':Boolean(_0x5209b3[_0xd52d('0x46')]),'paused':Boolean(_0x44be75[_0x271aad][_0xd52d('0x34')])};if(_0x5209b3[_0xd52d('0x47')]==='talking')updateAgentVoiceStatus(_0x341e2d,_0x34d6c0,_0x141c84);if(_0x341e2d[_0xd52d('0x46')])_0x34d6c0[_0xd52d('0x35')]++;if(_0x341e2d[_0xd52d('0x39')])_0x34d6c0['busy']++;if(_0x341e2d[_0xd52d('0x34')]&&!_0x341e2d[_0xd52d('0x39')]&&!_0x341e2d[_0xd52d('0x38')])_0x34d6c0[_0xd52d('0x34')]++;_0x34d6c0['agents'][_0xd52d('0x21')](_0x341e2d);}return _0x34d6c0;});}function getQueueAgents(_0x1e5e82,_0xa868ee,_0x2a24a){var _0x3107ce='User'+_['startCase'](_0x2a24a)+'Queue';var _0x2a375a=_0x2a24a+_0xd52d('0x48');return db[_0x3107ce][_0xd52d('0x49')]({'where':{[_[_0xd52d('0x1a')](_0x2a24a)+_0xd52d('0x4a')]:_0x1e5e82['id']},'raw':!![]})['then'](function(_0x9adda6){for(var _0x219f4c=0x0;_0x219f4c<_0x9adda6[_0xd52d('0x3e')];_0x219f4c++){var _0x5c0017=_[_0xd52d('0x3b')](_0xa868ee,['id',_0x9adda6[_0x219f4c][_0xd52d('0x44')]]);if(!_0x5c0017){_0x5c0017={'id':_0x9adda6[_0x219f4c][_0xd52d('0x44')],'name':_0x9adda6[_0x219f4c][_0xd52d('0x44')],'online':![],['pauseField']:![]};}var _0xd2b586={'id':_0x5c0017['id'],'name':_0x5c0017[_0xd52d('0xf')],'online':Boolean(_0x5c0017[_0xd52d('0x46')]),'paused':Boolean(_0x5c0017[_0x2a375a])};if(_0xd2b586[_0xd52d('0x46')])_0x1e5e82[_0xd52d('0x35')]++;_0x1e5e82[_0xd52d('0x33')][_0xd52d('0x21')](_0xd2b586);}return _0x1e5e82;});}function isIdle(_0x1fcfcf){return _0x1fcfcf==='idle'||_0x1fcfcf===_0xd52d('0x4b')||_0x1fcfcf===_0xd52d('0x4c')||_0x1fcfcf===_0xd52d('0x4d')||_[_0xd52d('0x4e')](_0x1fcfcf);}function isAgentPaused(_0xa21185,_0x2a42d1){var _0x267d3f=[_0xa21185[_0xd52d('0x4f')],_0xa21185['faxPause'],_0xa21185['mailPause'],_0xa21185[_0xd52d('0x50')],_0xa21185[_0xd52d('0x51')],_0xa21185[_0xd52d('0x52')],_0xa21185[_0xd52d('0x53')]];if(!_0x2a42d1)return _[_0xd52d('0x54')](_0x267d3f);var _0x689577=_[_0xd52d('0x3d')](_0x267d3f);return _0x689577[_0xd52d('0x3e')]>0x0&&_0x689577[_0xd52d('0x3e')]<_0x267d3f['length']?!![]:![];}function isAgentIdle(_0xe13875){if(_0xe13875[_0xd52d('0x47')]!==_0xd52d('0x55')&&_0xe13875[_0xd52d('0x52')]){_0xe13875[_0xd52d('0x47')]=_0xd52d('0x56');return![];}return _[_0xd52d('0x54')]([_0xe13875[_0xd52d('0x57')],_0xe13875[_0xd52d('0x58')],_0xe13875['mailStatus'],_0xe13875['openchannelStatus'],_0xe13875[_0xd52d('0x59')],_0xe13875[_0xd52d('0x47')],_0xe13875[_0xd52d('0x5a')]],isIdle);}function getAgentStatus(_0x5675db){var _0x45edd2=_0xd52d('0x4b');if(isAgentPaused(_0x5675db))_0x45edd2=_0xd52d('0x56');else if(isAgentPaused(_0x5675db,!![]))_0x45edd2=_0xd52d('0x5b');else if(isAgentIdle(_0x5675db))_0x45edd2=_0xd52d('0x55');else _0x45edd2='busy';return _0x45edd2;}function validateChannel(_0x2ece5b){var _0x22d239=[_0xd52d('0x5c'),'chat',_0xd52d('0x5d'),_0xd52d('0x5e'),_0xd52d('0x5f'),_0xd52d('0x60'),'voice'];if(!_[_0xd52d('0x61')](_0x22d239,_0x2ece5b[_0xd52d('0x62')]()))throw new Error(_0xd52d('0x63'));return _0x2ece5b[_0xd52d('0x62')]();}function getFilteredAgentIds(_0x448dbb,_0x4dff5e){var _0x38491a=_[_0xd52d('0x64')](_0x448dbb)?_0x448dbb:[_0x448dbb];var _0x27b112=_['map'](_0x38491a,function(_0x2ce2a7){return db[_0x4dff5e][_0xd52d('0x65')]({'where':{'name':_0x2ce2a7}})['then'](function(_0x13139a){if(!_0x13139a)return[];return _0x13139a[_0xd52d('0x66')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xd52d('0x67')](_0x27b112)['then'](function(_0x5debe2){var _0x21482a=_(_0x5debe2)[_0xd52d('0x68')]()[_0xd52d('0x32')]('id')[_0xd52d('0x69')]()[_0xd52d('0x6a')]();return _0x21482a;});}function getUpdatedSortOptions(_0x5bd6af){var _0x17d76c={'fields':[],'order':null};var _0x4ee456=_0x5bd6af[_0xd52d('0x6b')](',');_0x17d76c[_0xd52d('0x6c')]=_[_0xd52d('0x3d')](_0x4ee456,function(_0x49497a){if(!_0x49497a[_0xd52d('0x61')](_0xd52d('0x6d')))return!![];_0x17d76c[_0xd52d('0x6e')]=_['startsWith'](_0x49497a,'-')?_0xd52d('0x6f'):_0xd52d('0x70');return![];});return _0x17d76c;}function orderAgentsByStatus(_0x2a5cd1,_0x318e8e){return _0x2a5cd1['sort'](function(_0x55285c,_0x54b4a1){if(_0x55285c[_0xd52d('0x6d')]===_0x54b4a1[_0xd52d('0x6d')]&&_0x55285c[_0xd52d('0x6d')]===_0xd52d('0x56')){if(_0x318e8e===_0xd52d('0x6f'))return(_0x55285c[_0xd52d('0x71')]||'')<(_0x54b4a1[_0xd52d('0x71')]||'')?0x1:-0x1;return _0x55285c[_0xd52d('0x71')]<_0x54b4a1['pauseType']?-0x1:0x1;}else{if(_0x318e8e==='DESC')return _0x55285c['globalStatus']<_0x54b4a1[_0xd52d('0x6d')]?0x1:-0x1;return _0x55285c[_0xd52d('0x6d')]<_0x54b4a1['globalStatus']?-0x1:0x1;}});}exports[_0xd52d('0x66')]=function(_0x240609,_0x46728c){var _0x62fca1={'count':0x0,'rows':[]},_0x329489={},_0x12fbb3,_0x261411,_0x3d989f,_0x319a57,_0x169a04=[_0xd52d('0x72'),_0xd52d('0x46'),_0xd52d('0x73'),_0xd52d('0x74'),_0xd52d('0x71'),_0xd52d('0x74'),_0xd52d('0x41'),_0xd52d('0x75'),_0xd52d('0x4f'),'openchannelPause',_0xd52d('0x76'),_0xd52d('0x51'),_0xd52d('0x53'),_0xd52d('0x77'),'voicePause',_0xd52d('0x78'),_0xd52d('0x79'),_0xd52d('0x7a'),_0xd52d('0x7b'),_0xd52d('0x7c'),'faxCapacity',_0xd52d('0x7d'),_0xd52d('0x7e'),_0xd52d('0x7f'),_0xd52d('0x80'),'whatsappCurrentCapacity',_0xd52d('0x81'),_0xd52d('0x57'),_0xd52d('0x82'),'mailStatus',_0xd52d('0x59'),_0xd52d('0x5a'),'faxStatus',_0xd52d('0x47'),_0xd52d('0x83'),_0xd52d('0x84'),_0xd52d('0x85'),_0xd52d('0x86'),_0xd52d('0x87'),_0xd52d('0x88'),'voiceStatusTime',_0xd52d('0x89'),_0xd52d('0x8a'),_0xd52d('0x8b'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0xd52d('0x8c')],_0x4cb032=[_0xd52d('0x4f'),'openchannelPause','mailPause',_0xd52d('0x51'),'whatsappPause','faxPause','voicePause',_0xd52d('0x46')];Promise[_0xd52d('0x8d')]()[_0xd52d('0x13')](function(){if(_0x240609[_0xd52d('0x8e')][_0xd52d('0x8f')])_0x12fbb3=validateChannel(_0x240609[_0xd52d('0x8e')][_0xd52d('0x8f')]);if(!_0x240609[_0xd52d('0x8e')][_0xd52d('0x90')]||!_0x240609['query']['sort']['includes'](_0xd52d('0x6d')))return;var _0x5510ba=getUpdatedSortOptions(_0x240609[_0xd52d('0x8e')]['sort']);_0x240609['query'][_0xd52d('0x90')]=_0x5510ba[_0xd52d('0x6c')][_0xd52d('0x91')](',');_0x261411=_0x5510ba[_0xd52d('0x6e')];})['then'](function(){if(!_0x240609[_0xd52d('0x8e')][_0xd52d('0x92')])return[];var _0x2734fe=_[_0xd52d('0x1a')](_0x12fbb3)+_0xd52d('0x93');return getFilteredAgentIds(_0x240609[_0xd52d('0x8e')][_0xd52d('0x92')],_0x2734fe);})['then'](function(_0x139418){var _0x727b03=_[_0xd52d('0x32')](db[_0xd52d('0x94')][_0xd52d('0x95')],function(_0x26815e){return{'name':_0x26815e[_0xd52d('0x96')],'type':_0x26815e[_0xd52d('0x97')][_0xd52d('0x98')]};});_0x240609[_0xd52d('0x8e')]['role']=_0xd52d('0x99');_0x240609[_0xd52d('0x8e')][_0xd52d('0x46')]=!![];_0x329489=qs['getOptions'](_0x727b03,_0x240609);_0x329489['raw']=!![];if(!_['isEmpty'](_0x139418)){_0x329489[_0xd52d('0x9a')]=_[_0xd52d('0x17')](_0x329489[_0xd52d('0x9a')],{'$and':[{'id':{'$in':_0x139418}}]});}else if(!_[_0xd52d('0x9b')](_0x240609[_0xd52d('0x8e')][_0xd52d('0x92')])){return _0x62fca1;}if(_0x240609[_0xd52d('0x9c')][_0xd52d('0x9d')]===_0xd52d('0x9c')){var _0x350223={'params':{'id':_0x240609['user'][_0xd52d('0x9e')]},'query':{'section':_0xd52d('0x12'),'role':_0xd52d('0x99'),'online':!![],'nolimit':_0x240609[_0xd52d('0x8e')][_0xd52d('0x9f')],'sort':_0x240609[_0xd52d('0x8e')][_0xd52d('0x90')],'filter':_0x240609[_0xd52d('0x8e')][_0xd52d('0x3d')],'raw':!![],'ids':_0x139418}};return db['UserProfile'][_0xd52d('0xa0')](_0x350223);}return db[_0xd52d('0x94')][_0xd52d('0xa1')](_0x329489);})[_0xd52d('0x13')](function(_0x7f85d3){_0x62fca1[_0xd52d('0xa')]=_0x7f85d3[_0xd52d('0xa')];_0x3d989f=_0x7f85d3['rows'];return getRealtimeAgents();})['then'](function(_0x48224e){_0x319a57=_0x48224e[_0xd52d('0xa2')];return _0x3d989f[_0xd52d('0x32')](function(_0x2d65a4){var _0x4c230f=_[_0xd52d('0x3b')](_0x319a57,['id',_0x2d65a4['id']]);if(_0x4c230f)_[_0xd52d('0x17')](_0x2d65a4,_[_0xd52d('0x3c')](_[_0xd52d('0xa3')](_0x4c230f,_0x4cb032),_0x169a04));_0x2d65a4['globalStatus']=getAgentStatus(_0x2d65a4);return _0x2d65a4;});})[_0xd52d('0x13')](function(_0x5337ad){var _0x172233;if(_0x240609['query']['globalStatusFilter']){_0x172233=_['filter'](_0x5337ad,[_0xd52d('0x6d'),_0x240609['query']['globalStatusFilter']]);if(_0x240609[_0xd52d('0x8e')]['pauseTypeFilter']){_0x172233=_[_0xd52d('0x3d')](_0x172233,[_0xd52d('0x71'),_0x240609[_0xd52d('0x8e')][_0xd52d('0xa4')]]);}}if(_0x172233)_0x5337ad=_0x172233;if(!_0x261411)return _0x5337ad;return orderAgentsByStatus(_0x5337ad,_0x261411);})[_0xd52d('0x13')](function(_0x4943ac){_0x62fca1[_0xd52d('0xa2')]=_0x4943ac;return _0x62fca1;})[_0xd52d('0x13')](respondWithFilteredResult(_0x46728c,_0x329489))['catch'](handleError(_0x46728c,null));};exports['getQueues']=function(_0x467eb4,_0x285a62){var _0x396a45={'count':0x0,'rows':[]},_0x308b88={},_0x215c55,_0xa7a3f8,_0x83b20,_0x58c09a,_0x23dd98;Promise['resolve']()[_0xd52d('0x13')](function(){if(_0x467eb4[_0xd52d('0x8e')]['channel'])_0x215c55=validateChannel(_0x467eb4[_0xd52d('0x8e')]['channel']);var _0x59ab15=_['startCase'](_0x215c55)+_0xd52d('0x93');var _0x56c949=_[_0xd52d('0x32')](db[_0x59ab15][_0xd52d('0x95')],function(_0x3993da){return{'name':_0x3993da['fieldName'],'type':_0x3993da['type']['key']};});_0x308b88=qs['getOptions'](_0x56c949,_0x467eb4);if(_0x467eb4['user']['role']==='user'){var _0x335acb={'params':{'id':_0x467eb4[_0xd52d('0x9c')][_0xd52d('0x9e')]},'query':{'section':_0x215c55===_0xd52d('0x19')&&_0x467eb4['query']['type']==='outbound'?_0xd52d('0xa5'):_[_0xd52d('0x1a')](_0x215c55)+_0xd52d('0x1b'),'type':_0x467eb4[_0xd52d('0x8e')][_0xd52d('0x97')],'nolimit':!![],'sort':_0xd52d('0xf'),'filter':_0x467eb4[_0xd52d('0x8e')][_0xd52d('0x3d')]}};return db['UserProfile'][_0xd52d('0xa0')](_0x335acb);}return db[_0x59ab15]['findAndCountAll'](_0x308b88);})[_0xd52d('0x13')](function(_0x1670b5){_0x396a45[_0xd52d('0xa')]=_0x1670b5[_0xd52d('0xa')];_0xa7a3f8=_0x1670b5[_0xd52d('0xa2')];return getRealtimeQueues(_0x467eb4,_0x215c55);})[_0xd52d('0x13')](function(_0x206fe9){_0x58c09a=_0x206fe9[_0xd52d('0xa2')];return getRealtimeAgents();})[_0xd52d('0x13')](function(_0x3b667e){_0x83b20=_0x3b667e['rows'];if(_0x215c55!=_0xd52d('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0xd52d('0x13')](function(_0x3555f0){_0x23dd98=_0x3555f0?_0x3555f0[_0xd52d('0xa2')]:[];return initializeQueues(_0xa7a3f8,_0x58c09a,_0x215c55,_0x467eb4[_0xd52d('0x8e')][_0xd52d('0x97')]);})[_0xd52d('0x13')](function(_0x2a8611){var _0x40acf8=_0x2a8611[_0xd52d('0x32')](function(_0x4319b7){if(_0x215c55===_0xd52d('0x19'))return getVoiceQueueAgents(_0x4319b7,_0xa7a3f8,_0x83b20,_0x23dd98);else return getQueueAgents(_0x4319b7,_0x83b20,_0x215c55);});return Promise[_0xd52d('0x67')](_0x40acf8);})[_0xd52d('0x13')](function(_0x568d75){_0x396a45[_0xd52d('0xa2')]=_0x568d75;return _0x396a45;})[_0xd52d('0x13')](respondWithFilteredResult(_0x285a62,_0x308b88))[_0xd52d('0x18')](handleError(_0x285a62,null));}; \ No newline at end of file +var _0xf9e9=['globalQueueFilter','fieldName','type','role','agent','raw','isEmpty','where','user','getResources','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','channel','key','userProfileId','QueueCampaigns','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','count','offset','limit','status','set','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','outbound','push','pTalking','message','dialMethod','Trunk','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','waiting','busy','originated','find','pick','filter','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','pause','chatStatus','faxStatus','openchannelStatus','whatsappStatus','*pause','chat','sms','openchannel','fax','whatsapp','includes','toLowerCase','map','findOne','all','flatten','split','fields','order','startsWith','ASC','sort','globalStatus','pauseType','DESC','getAgents','userpic','lastLoginAt','lastPauseAt','address','smsPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','faxCurrentCapacity','mailStatus','smsStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','query','join'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0xf9e9,0xb3));var _0x9f9e=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0xf9e9[_0x179c4a];return _0x5d1879;};'use strict';var util=require('util');var _=require(_0x9f9e('0x0'));var jayson=require(_0x9f9e('0x1'));var qs=require(_0x9f9e('0x2'));var logger=require(_0x9f9e('0x3'))(_0x9f9e('0x4'));var db=require(_0x9f9e('0x5'))['db'];var amiClient=jayson[_0x9f9e('0x6')][_0x9f9e('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0x9f9e('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x54b200,_0x43c22c){return function(_0x21c8ae){if(_0x21c8ae){var _0x148acb=typeof _0x43c22c['offset']==='undefined'&&typeof _0x43c22c['limit']===_0x9f9e('0x8');var _0x5755c2=_0x21c8ae[_0x9f9e('0x9')];var _0x4e2dda=_0x148acb?0x0:_0x43c22c[_0x9f9e('0xa')];var _0x16a423=_0x148acb?_0x21c8ae[_0x9f9e('0x9')]:_0x43c22c[_0x9f9e('0xa')]+_0x43c22c[_0x9f9e('0xb')];var _0x3f15e8;if(_0x16a423>=_0x5755c2){_0x16a423=_0x5755c2;_0x3f15e8=0xc8;}else{_0x3f15e8=0xce;}_0x54b200[_0x9f9e('0xc')](_0x3f15e8);return _0x54b200[_0x9f9e('0xd')]('Content-Range',_0x4e2dda+'-'+_0x16a423+'/'+_0x5755c2)[_0x9f9e('0xe')](_0x21c8ae);}return null;};}function handleError(_0x4e0b1b,_0x26fa88){_0x26fa88=_0x26fa88||0x1f4;return function(_0x1bf691){logger[_0x9f9e('0xf')](_0x1bf691[_0x9f9e('0x10')]);if(_0x1bf691[_0x9f9e('0x11')]){delete _0x1bf691['name'];}_0x4e0b1b[_0x9f9e('0xc')](_0x26fa88)[_0x9f9e('0x12')](_0x1bf691);};}function getRealtimeAgents(){return new Promise(function(_0x45b237,_0x7fd8db){return amiClient[_0x9f9e('0x13')](_0x9f9e('0x14'),{})[_0x9f9e('0x15')](function(_0x1e333c){if(_0x1e333c[_0x9f9e('0xf')])throw new Error(_0x9f9e('0x16'));var _0x35bc5c=_0x1e333c[_0x9f9e('0x17')];return routingClient[_0x9f9e('0x13')]('Agents',{})[_0x9f9e('0x15')](function(_0x55ef94){if(_0x55ef94[_0x9f9e('0xf')])throw new Error(_0x9f9e('0x18'));var _0x10a345=_0x55ef94[_0x9f9e('0x17')];return _0x45b237(_[_0x9f9e('0x19')]({},_0x35bc5c,_0x10a345));});})[_0x9f9e('0x1a')](function(_0x17973c){_0x7fd8db(_0x17973c);});});}function getRealtimeQueues(_0x940b10,_0x4345c2){return new Promise(function(_0xccbab,_0x5e69b0){var _0x1d41e6=_0x4345c2===_0x9f9e('0x1b')?amiClient:routingClient;return _0x1d41e6[_0x9f9e('0x13')](_[_0x9f9e('0x1c')](_0x4345c2)+'Queues',_0x940b10)[_0x9f9e('0x15')](function(_0x2c1b93){if(_0x2c1b93[_0x9f9e('0xf')])throw new Error(util[_0x9f9e('0x1d')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4345c2));return _0xccbab(_0x2c1b93[_0x9f9e('0x17')]);})[_0x9f9e('0x1a')](function(_0x5b9685){_0x5e69b0(_0x5b9685);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0xc52552,_0x5a8474){return amiClient[_0x9f9e('0x13')](_0x9f9e('0x1e'),{})[_0x9f9e('0x15')](function(_0x32db41){if(_0x32db41['error'])throw new Error(_0x9f9e('0x1f'));return _0xc52552(_0x32db41[_0x9f9e('0x17')]);})[_0x9f9e('0x1a')](function(_0x3c8845){_0x5a8474(_0x3c8845);});});}function initializeQueues(_0x540f5d,_0x74424,_0x2e24bf,_0x262b94){var _0x242af0=[_0x9f9e('0x20'),_0x9f9e('0x21'),'waiting',_0x9f9e('0x22'),_0x9f9e('0x23')];if(_0x2e24bf==='voice'&&_0x262b94===_0x9f9e('0x24')){_0x242af0[_0x9f9e('0x25')](_0x9f9e('0x26'),'originated',_0x9f9e('0x27'),'dialActive',_0x9f9e('0x28'),_0x9f9e('0x29'),'startPredictive','startProgressive','erlangCalls',_0x9f9e('0x2a'),_0x9f9e('0x2b'),_0x9f9e('0x2c'),_0x9f9e('0x2d'),_0x9f9e('0x2e'),_0x9f9e('0x2f'),'predictiveIntervalAvailable',_0x9f9e('0x30'),_0x9f9e('0x31'),_0x9f9e('0x32'),'predictiveIntervalDroppedCallsCallersExit',_0x9f9e('0x33'),_0x9f9e('0x34'));}return _0x540f5d['map'](function(_0x279081){var _0x33178f=_0x279081[_0x9f9e('0x35')]({'plain':!![]});_0x33178f[_0x9f9e('0x36')]=[];_0x33178f[_0x9f9e('0x23')]=0x0;_0x33178f[_0x9f9e('0x37')]=0x0;_0x33178f[_0x9f9e('0x20')]=0x0;_0x33178f['available']=0x0;_0x33178f[_0x9f9e('0x38')]=0x0;if(_0x2e24bf===_0x9f9e('0x1b')){_0x33178f[_0x9f9e('0x22')]=0x0;_0x33178f[_0x9f9e('0x39')]=0x0;if(_0x262b94===_0x9f9e('0x24')){_0x33178f[_0x9f9e('0x26')]=0x0;_0x33178f[_0x9f9e('0x3a')]=0x0;}}var _0xd011c=_[_0x9f9e('0x3b')](_0x74424,['id',_0x33178f['id']]);if(_0xd011c)_['merge'](_0x33178f,_[_0x9f9e('0x3c')](_0xd011c,_0x242af0));return _0x33178f;});}function updateAgentVoiceStatus(_0x4d2b35,_0x5ac435,_0x2e2613){var _0x16d14d=_[_0x9f9e('0x3d')](_0x2e2613,[_0x9f9e('0x3e'),_0x5ac435[_0x9f9e('0x11')]]);if(_0x16d14d[_0x9f9e('0x3f')]===0x0)return _0x4d2b35[_0x9f9e('0x39')]=!![];if(_[_0x9f9e('0x40')](_0x16d14d,[_0x9f9e('0x41'),_0x4d2b35[_0x9f9e('0x42')][_0x9f9e('0x43')]()]))return _0x4d2b35[_0x9f9e('0x22')]=!![];if(!_0x4d2b35[_0x9f9e('0x22')])return _0x4d2b35[_0x9f9e('0x39')]=!![];}function getVoiceQueueAgents(_0x35d368,_0x369d26,_0x3dfd13,_0x2388e1){var _0x367ab4=_['find'](_0x369d26,['id',_0x35d368['id']]);if(!_0x367ab4)return _0x35d368;return _0x367ab4[_0x9f9e('0x44')]({'raw':!![]})[_0x9f9e('0x15')](function(_0xcc50d3){for(var _0x2216bc=0x0;_0x2216bc<_0xcc50d3[_0x9f9e('0x3f')];_0x2216bc++){var _0x57fd70=_['find'](_0x3dfd13,['id',_0xcc50d3[_0x2216bc][_0x9f9e('0x45')]]);if(!_0x57fd70){_0x57fd70={'id':_0xcc50d3[_0x2216bc][_0x9f9e('0x45')],'name':_0xcc50d3[_0x2216bc][_0x9f9e('0x45')],'accountcode':'','online':![]};}var _0x185d7c={'id':_0x57fd70['id'],'name':_0x57fd70[_0x9f9e('0x11')],'internal':_0x57fd70[_0x9f9e('0x46')],'online':Boolean(_0x57fd70[_0x9f9e('0x47')]),'paused':Boolean(_0xcc50d3[_0x2216bc]['paused'])};if(_0x57fd70[_0x9f9e('0x48')]===_0x9f9e('0x22'))updateAgentVoiceStatus(_0x185d7c,_0x35d368,_0x2388e1);if(_0x185d7c[_0x9f9e('0x47')])_0x35d368[_0x9f9e('0x37')]++;if(_0x185d7c[_0x9f9e('0x39')])_0x35d368['busy']++;if(_0x185d7c[_0x9f9e('0x23')]&&!_0x185d7c[_0x9f9e('0x39')]&&!_0x185d7c['talking'])_0x35d368[_0x9f9e('0x23')]++;_0x35d368[_0x9f9e('0x36')][_0x9f9e('0x25')](_0x185d7c);}return _0x35d368;});}function getQueueAgents(_0x354962,_0x58d273,_0x3c45d2){var _0x348a1a=_0x9f9e('0x49')+_['startCase'](_0x3c45d2)+_0x9f9e('0x4a');var _0x2632eb=_0x3c45d2+_0x9f9e('0x4b');return db[_0x348a1a]['findAll']({'where':{[_['startCase'](_0x3c45d2)+_0x9f9e('0x4c')]:_0x354962['id']},'raw':!![]})['then'](function(_0x3db494){for(var _0x3d3016=0x0;_0x3d3016<_0x3db494[_0x9f9e('0x3f')];_0x3d3016++){var _0x347078=_[_0x9f9e('0x3b')](_0x58d273,['id',_0x3db494[_0x3d3016]['UserId']]);if(!_0x347078){_0x347078={'id':_0x3db494[_0x3d3016][_0x9f9e('0x45')],'name':_0x3db494[_0x3d3016][_0x9f9e('0x45')],'online':![],['pauseField']:![]};}var _0x32644d={'id':_0x347078['id'],'name':_0x347078['name'],'online':Boolean(_0x347078['online']),'paused':Boolean(_0x347078[_0x2632eb])};if(_0x32644d[_0x9f9e('0x47')])_0x354962[_0x9f9e('0x37')]++;_0x354962[_0x9f9e('0x36')][_0x9f9e('0x25')](_0x32644d);}return _0x354962;});}function isIdle(_0x4e45c4){return _0x4e45c4===_0x9f9e('0x4d')||_0x4e45c4===_0x9f9e('0x4e')||_0x4e45c4===_0x9f9e('0x4f')||_0x4e45c4===_0x9f9e('0x50')||_[_0x9f9e('0x51')](_0x4e45c4);}function isAgentPaused(_0x32d8f7,_0x4efb39){var _0x4f53c7=[_0x32d8f7[_0x9f9e('0x52')],_0x32d8f7[_0x9f9e('0x53')],_0x32d8f7[_0x9f9e('0x54')],_0x32d8f7[_0x9f9e('0x55')],_0x32d8f7['smsPause'],_0x32d8f7[_0x9f9e('0x56')],_0x32d8f7[_0x9f9e('0x57')]];if(!_0x4efb39)return _[_0x9f9e('0x58')](_0x4f53c7);var _0x4cb9e4=_[_0x9f9e('0x3d')](_0x4f53c7);return _0x4cb9e4['length']>0x0&&_0x4cb9e4['length']<_0x4f53c7['length']?!![]:![];}function isAgentIdle(_0xaeb2e8){if(_0xaeb2e8[_0x9f9e('0x48')]!=='idle'&&_0xaeb2e8['voicePause']){_0xaeb2e8[_0x9f9e('0x48')]=_0x9f9e('0x59');return![];}return _[_0x9f9e('0x58')]([_0xaeb2e8[_0x9f9e('0x5a')],_0xaeb2e8[_0x9f9e('0x5b')],_0xaeb2e8['mailStatus'],_0xaeb2e8[_0x9f9e('0x5c')],_0xaeb2e8['smsStatus'],_0xaeb2e8[_0x9f9e('0x48')],_0xaeb2e8[_0x9f9e('0x5d')]],isIdle);}function getAgentStatus(_0x4c8872){var _0x13c1b6=_0x9f9e('0x4e');if(isAgentPaused(_0x4c8872))_0x13c1b6=_0x9f9e('0x59');else if(isAgentPaused(_0x4c8872,!![]))_0x13c1b6=_0x9f9e('0x5e');else if(isAgentIdle(_0x4c8872))_0x13c1b6=_0x9f9e('0x4d');else _0x13c1b6=_0x9f9e('0x39');return _0x13c1b6;}function validateChannel(_0x3db970){var _0x1433a4=['mail',_0x9f9e('0x5f'),_0x9f9e('0x60'),_0x9f9e('0x61'),_0x9f9e('0x62'),_0x9f9e('0x63'),'voice'];if(!_[_0x9f9e('0x64')](_0x1433a4,_0x3db970['toLowerCase']()))throw new Error('Invalid\x20channel');return _0x3db970[_0x9f9e('0x65')]();}function getFilteredAgentIds(_0x482ff5,_0x282165){var _0x308cad=_['isArray'](_0x482ff5)?_0x482ff5:[_0x482ff5];var _0x37a5aa=_[_0x9f9e('0x66')](_0x308cad,function(_0x5d840c){return db[_0x282165][_0x9f9e('0x67')]({'where':{'name':_0x5d840c}})['then'](function(_0x5574b4){if(!_0x5574b4)return[];return _0x5574b4['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x9f9e('0x68')](_0x37a5aa)[_0x9f9e('0x15')](function(_0x415e3a){var _0x2fcded=_(_0x415e3a)[_0x9f9e('0x69')]()[_0x9f9e('0x66')]('id')['uniq']()['value']();return _0x2fcded;});}function getUpdatedSortOptions(_0x2dbb67){var _0x1934fe={'fields':[],'order':null};var _0x2e628b=_0x2dbb67[_0x9f9e('0x6a')](',');_0x1934fe[_0x9f9e('0x6b')]=_['filter'](_0x2e628b,function(_0x16a1bf){if(!_0x16a1bf['includes']('globalStatus'))return!![];_0x1934fe[_0x9f9e('0x6c')]=_[_0x9f9e('0x6d')](_0x16a1bf,'-')?'DESC':_0x9f9e('0x6e');return![];});return _0x1934fe;}function orderAgentsByStatus(_0xbc8120,_0x5ad0d5){return _0xbc8120[_0x9f9e('0x6f')](function(_0x1dc54d,_0x20364a){if(_0x1dc54d[_0x9f9e('0x70')]===_0x20364a['globalStatus']&&_0x1dc54d[_0x9f9e('0x70')]==='pause'){if(_0x5ad0d5==='DESC')return(_0x1dc54d[_0x9f9e('0x71')]||'')<(_0x20364a[_0x9f9e('0x71')]||'')?0x1:-0x1;return _0x1dc54d[_0x9f9e('0x71')]<_0x20364a[_0x9f9e('0x71')]?-0x1:0x1;}else{if(_0x5ad0d5===_0x9f9e('0x72'))return _0x1dc54d[_0x9f9e('0x70')]<_0x20364a['globalStatus']?0x1:-0x1;return _0x1dc54d[_0x9f9e('0x70')]<_0x20364a[_0x9f9e('0x70')]?-0x1:0x1;}});}exports[_0x9f9e('0x73')]=function(_0x15df39,_0x9f665){var _0x45c7bd={'count':0x0,'rows':[]},_0x5da803={},_0xa87bd8,_0x109294,_0x14e888,_0x27dc7a,_0x338cc0=[_0x9f9e('0x74'),'online',_0x9f9e('0x75'),'lastPauseAt',_0x9f9e('0x71'),_0x9f9e('0x76'),_0x9f9e('0x42'),_0x9f9e('0x77'),_0x9f9e('0x52'),'openchannelPause',_0x9f9e('0x54'),_0x9f9e('0x78'),_0x9f9e('0x57'),_0x9f9e('0x53'),_0x9f9e('0x56'),_0x9f9e('0x79'),_0x9f9e('0x7a'),_0x9f9e('0x7b'),'smsCapacity',_0x9f9e('0x7c'),_0x9f9e('0x7d'),_0x9f9e('0x7e'),'openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity',_0x9f9e('0x7f'),_0x9f9e('0x5a'),_0x9f9e('0x5c'),_0x9f9e('0x80'),_0x9f9e('0x81'),_0x9f9e('0x5d'),'faxStatus','voiceStatus','chatStatusTime',_0x9f9e('0x82'),_0x9f9e('0x83'),_0x9f9e('0x84'),_0x9f9e('0x85'),'faxStatusTime',_0x9f9e('0x86'),'queue','destconnectedlinenum',_0x9f9e('0x87'),_0x9f9e('0x88'),_0x9f9e('0x89'),'routealias'],_0x284c5f=['chatPause',_0x9f9e('0x55'),_0x9f9e('0x54'),_0x9f9e('0x78'),'whatsappPause',_0x9f9e('0x53'),_0x9f9e('0x56'),_0x9f9e('0x47')];Promise[_0x9f9e('0x8a')]()[_0x9f9e('0x15')](function(){if(_0x15df39[_0x9f9e('0x8b')]['channel'])_0xa87bd8=validateChannel(_0x15df39['query']['channel']);if(!_0x15df39[_0x9f9e('0x8b')]['sort']||!_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x6f')][_0x9f9e('0x64')]('globalStatus'))return;var _0x26d218=getUpdatedSortOptions(_0x15df39[_0x9f9e('0x8b')]['sort']);_0x15df39['query']['sort']=_0x26d218[_0x9f9e('0x6b')][_0x9f9e('0x8c')](',');_0x109294=_0x26d218['order'];})[_0x9f9e('0x15')](function(){if(!_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x8d')])return[];var _0x58edf8=_[_0x9f9e('0x1c')](_0xa87bd8)+'Queue';return getFilteredAgentIds(_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x8d')],_0x58edf8);})['then'](function(_0x480b3b){var _0xe0463e=_[_0x9f9e('0x66')](db['User']['rawAttributes'],function(_0xf27b1){return{'name':_0xf27b1[_0x9f9e('0x8e')],'type':_0xf27b1[_0x9f9e('0x8f')]['key']};});_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x90')]=_0x9f9e('0x91');_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x47')]=!![];_0x5da803=qs['getOptions'](_0xe0463e,_0x15df39);_0x5da803[_0x9f9e('0x92')]=!![];if(!_[_0x9f9e('0x93')](_0x480b3b)){_0x5da803['where']=_[_0x9f9e('0x19')](_0x5da803[_0x9f9e('0x94')],{'$and':[{'id':{'$in':_0x480b3b}}]});}else if(!_[_0x9f9e('0x93')](_0x15df39[_0x9f9e('0x8b')]['globalQueueFilter'])){return _0x45c7bd;}if(_0x15df39[_0x9f9e('0x95')]['role']===_0x9f9e('0x95')){var _0x519517={'params':{'id':_0x15df39[_0x9f9e('0x95')]['userProfileId']},'query':{'section':_0x9f9e('0x14'),'role':_0x9f9e('0x91'),'online':!![],'nolimit':_0x15df39[_0x9f9e('0x8b')]['nolimit'],'sort':_0x15df39['query'][_0x9f9e('0x6f')],'filter':_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x3d')],'raw':!![],'ids':_0x480b3b}};return db['UserProfile'][_0x9f9e('0x96')](_0x519517);}return db[_0x9f9e('0x49')]['findAndCountAll'](_0x5da803);})[_0x9f9e('0x15')](function(_0x460efd){_0x45c7bd['count']=_0x460efd['count'];_0x14e888=_0x460efd[_0x9f9e('0x97')];return getRealtimeAgents();})[_0x9f9e('0x15')](function(_0x306f4e){_0x27dc7a=_0x306f4e[_0x9f9e('0x97')];return _0x14e888['map'](function(_0x474370){var _0x15e648=_[_0x9f9e('0x3b')](_0x27dc7a,['id',_0x474370['id']]);if(_0x15e648)_['merge'](_0x474370,_[_0x9f9e('0x3c')](_[_0x9f9e('0x98')](_0x15e648,_0x284c5f),_0x338cc0));_0x474370[_0x9f9e('0x70')]=getAgentStatus(_0x474370);return _0x474370;});})['then'](function(_0x326963){var _0x4701c0;if(_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x99')]){_0x4701c0=_[_0x9f9e('0x3d')](_0x326963,[_0x9f9e('0x70'),_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x99')]]);if(_0x15df39[_0x9f9e('0x8b')][_0x9f9e('0x9a')]){_0x4701c0=_[_0x9f9e('0x3d')](_0x4701c0,[_0x9f9e('0x71'),_0x15df39[_0x9f9e('0x8b')]['pauseTypeFilter']]);}}if(_0x4701c0)_0x326963=_0x4701c0;if(!_0x109294)return _0x326963;return orderAgentsByStatus(_0x326963,_0x109294);})[_0x9f9e('0x15')](function(_0x5c110e){_0x45c7bd[_0x9f9e('0x97')]=_0x5c110e;return _0x45c7bd;})[_0x9f9e('0x15')](respondWithFilteredResult(_0x9f665,_0x5da803))[_0x9f9e('0x1a')](handleError(_0x9f665,null));};exports[_0x9f9e('0x9b')]=function(_0x2be5ce,_0x2b6fda){var _0x328691={'count':0x0,'rows':[]},_0x203ee6={},_0x41330b,_0x158500,_0x5dc268,_0x5d52d0,_0x17bd55;Promise[_0x9f9e('0x8a')]()['then'](function(){if(_0x2be5ce[_0x9f9e('0x8b')][_0x9f9e('0x9c')])_0x41330b=validateChannel(_0x2be5ce['query'][_0x9f9e('0x9c')]);var _0x22c1c2=_[_0x9f9e('0x1c')](_0x41330b)+_0x9f9e('0x4a');var _0x15a495=_[_0x9f9e('0x66')](db[_0x22c1c2]['rawAttributes'],function(_0x34f9ce){return{'name':_0x34f9ce[_0x9f9e('0x8e')],'type':_0x34f9ce[_0x9f9e('0x8f')][_0x9f9e('0x9d')]};});_0x203ee6=qs['getOptions'](_0x15a495,_0x2be5ce);if(_0x2be5ce[_0x9f9e('0x95')][_0x9f9e('0x90')]===_0x9f9e('0x95')){var _0x5e9fcb={'params':{'id':_0x2be5ce[_0x9f9e('0x95')][_0x9f9e('0x9e')]},'query':{'section':_0x41330b===_0x9f9e('0x1b')&&_0x2be5ce[_0x9f9e('0x8b')][_0x9f9e('0x8f')]==='outbound'?_0x9f9e('0x9f'):_[_0x9f9e('0x1c')](_0x41330b)+'Queues','type':_0x2be5ce[_0x9f9e('0x8b')][_0x9f9e('0x8f')],'nolimit':!![],'sort':_0x9f9e('0x11'),'filter':_0x2be5ce[_0x9f9e('0x8b')][_0x9f9e('0x3d')]}};return db['UserProfile'][_0x9f9e('0x96')](_0x5e9fcb);}return db[_0x22c1c2]['findAndCountAll'](_0x203ee6);})[_0x9f9e('0x15')](function(_0x2dd7c6){_0x328691['count']=_0x2dd7c6['count'];_0x158500=_0x2dd7c6['rows'];return getRealtimeQueues(_0x2be5ce,_0x41330b);})[_0x9f9e('0x15')](function(_0x25e7cb){_0x5d52d0=_0x25e7cb[_0x9f9e('0x97')];return getRealtimeAgents();})[_0x9f9e('0x15')](function(_0x5120b9){_0x5dc268=_0x5120b9['rows'];if(_0x41330b!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x9f9e('0x15')](function(_0x10ca95){_0x17bd55=_0x10ca95?_0x10ca95[_0x9f9e('0x97')]:[];return initializeQueues(_0x158500,_0x5d52d0,_0x41330b,_0x2be5ce[_0x9f9e('0x8b')][_0x9f9e('0x8f')]);})[_0x9f9e('0x15')](function(_0x4ee918){var _0x750d46=_0x4ee918[_0x9f9e('0x66')](function(_0x39dbfb){if(_0x41330b==='voice')return getVoiceQueueAgents(_0x39dbfb,_0x158500,_0x5dc268,_0x17bd55);else return getQueueAgents(_0x39dbfb,_0x5dc268,_0x41330b);});return Promise[_0x9f9e('0x68')](_0x750d46);})[_0x9f9e('0x15')](function(_0x798a7c){_0x328691[_0x9f9e('0x97')]=_0x798a7c;return _0x328691;})['then'](respondWithFilteredResult(_0x2b6fda,_0x203ee6))[_0x9f9e('0x1a')](handleError(_0x2b6fda,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 44c6d28..d5c20f0 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x51ba0b,_0x165bfe){var _0x8a921a=function(_0x33111b){while(--_0x33111b){_0x51ba0b['push'](_0x51ba0b['shift']());}};_0x8a921a(++_0x165bfe);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0xcb91[_0x1269c6];return _0x4868c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2ed96b,_0x1eeef8){var _0x12f536=function(_0x1b89f6){while(--_0x1b89f6){_0x2ed96b['push'](_0x2ed96b['shift']());}};_0x12f536(++_0x1eeef8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0xcb91[_0x232ec0];return _0x356705;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index ba0ec5f..e2faec3 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 _0xafb9=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x3cb846,_0x43f20a){var _0x404a9b=function(_0x16c9a7){while(--_0x16c9a7){_0x3cb846['push'](_0x3cb846['shift']());}};_0x404a9b(++_0x43f20a);}(_0xafb9,0x68));var _0x9afb=function(_0x39cbbd,_0x30e993){_0x39cbbd=_0x39cbbd-0x0;var _0x319836=_0xafb9[_0x39cbbd];return _0x319836;};'use strict';var Sequelize=require(_0x9afb('0x0'));module[_0x9afb('0x1')]={'state':{'type':Sequelize[_0x9afb('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9afb('0x3')]},'scheduledat':{'type':Sequelize[_0x9afb('0x4')]},'uniqueid':{'type':Sequelize[_0x9afb('0x3')]},'starttime':{'type':Sequelize[_0x9afb('0x4')]},'responsetime':{'type':Sequelize[_0x9afb('0x4')]},'ringtime':{'type':Sequelize[_0x9afb('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9afb('0x3')]}}; \ No newline at end of file +var _0x0f9f=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x51da33,_0x2403d7){var _0xdf6f8a=function(_0x273253){while(--_0x273253){_0x51da33['push'](_0x51da33['shift']());}};_0xdf6f8a(++_0x2403d7);}(_0x0f9f,0xae));var _0xf0f9=function(_0xe2b013,_0x5790ce){_0xe2b013=_0xe2b013-0x0;var _0x37e2cc=_0x0f9f[_0xe2b013];return _0x37e2cc;};'use strict';var Sequelize=require(_0xf0f9('0x0'));module[_0xf0f9('0x1')]={'state':{'type':Sequelize[_0xf0f9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xf0f9('0x3')]},'scheduledat':{'type':Sequelize[_0xf0f9('0x4')]},'uniqueid':{'type':Sequelize[_0xf0f9('0x3')]},'starttime':{'type':Sequelize[_0xf0f9('0x4')]},'responsetime':{'type':Sequelize[_0xf0f9('0x4')]},'ringtime':{'type':Sequelize[_0xf0f9('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf0f9('0x3')]},'campaigntype':{'type':Sequelize[_0xf0f9('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 5e0b0d7..41b12bc 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 _0xe130=['moment','path','rimraf','../../config/environment','define','ReportAgentPreview','lodash','util','../../config/logger','api'];(function(_0x170325,_0x4db26b){var _0x523256=function(_0xaa5a73){while(--_0xaa5a73){_0x170325['push'](_0x170325['shift']());}};_0x523256(++_0x4db26b);}(_0xe130,0x9c));var _0x0e13=function(_0x4a0601,_0xcf7c2d){_0x4a0601=_0x4a0601-0x0;var _0x57d499=_0xe130[_0x4a0601];return _0x57d499;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var logger=require(_0x0e13('0x2'))(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e13('0x5'));var rimraf=require(_0x0e13('0x6'));var config=require(_0x0e13('0x7'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x7bb9c9,_0x514c33){return _0x7bb9c9[_0x0e13('0x8')](_0x0e13('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e62=['report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview'];(function(_0xe97702,_0xdb0496){var _0x46718b=function(_0x367006){while(--_0x367006){_0xe97702['push'](_0xe97702['shift']());}};_0x46718b(++_0xdb0496);}(_0x3e62,0x1ef));var _0x23e6=function(_0x3b26ec,_0xec9015){_0x3b26ec=_0x3b26ec-0x0;var _0x33f7e2=_0x3e62[_0x3b26ec];return _0x33f7e2;};'use strict';var _=require(_0x23e6('0x0'));var util=require(_0x23e6('0x1'));var logger=require(_0x23e6('0x2'))(_0x23e6('0x3'));var moment=require(_0x23e6('0x4'));var BPromise=require(_0x23e6('0x5'));var rp=require(_0x23e6('0x6'));var fs=require('fs');var path=require(_0x23e6('0x7'));var rimraf=require(_0x23e6('0x8'));var config=require(_0x23e6('0x9'));var attributes=require(_0x23e6('0xa'));module['exports']=function(_0x3de84d,_0x2cf5c7){return _0x3de84d['define'](_0x23e6('0xb'),attributes,{'tableName':_0x23e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 9afc622..d74bb5d 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 _0x38dd=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','create','options','then','stringify','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x565186,_0x1895c0){var _0x20fe90=function(_0x1641a0){while(--_0x1641a0){_0x565186['push'](_0x565186['shift']());}};_0x20fe90(++_0x1895c0);}(_0x38dd,0x1e9));var _0xd38d=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0x38dd[_0x548200];return _0x1a6d74;};'use strict';var _=require(_0xd38d('0x0'));var util=require('util');var moment=require(_0xd38d('0x1'));var BPromise=require('bluebird');var rs=require(_0xd38d('0x2'));var fs=require('fs');var Redis=require(_0xd38d('0x3'));var db=require(_0xd38d('0x4'))['db'];var utils=require(_0xd38d('0x5'));var logger=require('../../config/logger')(_0xd38d('0x6'));var config=require(_0xd38d('0x7'));var jayson=require(_0xd38d('0x8'));var client=jayson[_0xd38d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11d1f5,_0x5619f1,_0x410134){return new BPromise(function(_0x46e24a,_0x2bcbc8){return client[_0xd38d('0xa')](_0x11d1f5,_0x410134)['then'](function(_0x5a540d){logger[_0xd38d('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x5619f1,_0xd38d('0xc'));logger[_0xd38d('0xd')](_0xd38d('0xe'),_0x5619f1,'request\x20sent',JSON['stringify'](_0x5a540d));if(_0x5a540d[_0xd38d('0xf')]){if(_0x5a540d[_0xd38d('0xf')][_0xd38d('0x10')]===0x1f4){logger['error'](_0xd38d('0x11'),_0x5619f1,_0x5a540d[_0xd38d('0xf')][_0xd38d('0x12')]);return _0x2bcbc8(_0x5a540d['error']['message']);}logger['error'](_0xd38d('0x11'),_0x5619f1,_0x5a540d[_0xd38d('0xf')][_0xd38d('0x12')]);return _0x46e24a(_0x5a540d[_0xd38d('0xf')][_0xd38d('0x12')]);}else{logger['info'](_0xd38d('0x11'),_0x5619f1,_0xd38d('0xc'));_0x46e24a(_0x5a540d[_0xd38d('0x13')][_0xd38d('0x12')]);}})[_0xd38d('0x14')](function(_0x2740ce){logger['error'](_0xd38d('0x11'),_0x5619f1,_0x2740ce);_0x2bcbc8(_0x2740ce);});});}exports[_0xd38d('0x15')]=function(_0x23a8f6){var _0x40bc66=this;return new Promise(function(_0x5ee826,_0x4ebfd8){return db['ReportAgentPreview'][_0xd38d('0x16')](_0x23a8f6['body'],{'raw':_0x23a8f6[_0xd38d('0x17')]?_0x23a8f6['options']['raw']===undefined?!![]:![]:!![]})[_0xd38d('0x18')](function(_0x11ffce){logger[_0xd38d('0xb')](_0xd38d('0x15'),_0x23a8f6);logger[_0xd38d('0xd')](_0xd38d('0x15'),_0x23a8f6,JSON[_0xd38d('0x19')](_0x11ffce));_0x5ee826(_0x11ffce);})[_0xd38d('0x14')](function(_0x249189){logger[_0xd38d('0xf')](_0xd38d('0x15'),_0x249189[_0xd38d('0x12')],_0x23a8f6);_0x4ebfd8(_0x40bc66[_0xd38d('0xf')](0x1f4,_0x249189['message']));});});}; \ No newline at end of file +var _0xfbab=['CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x11844c,_0x12efc6){var _0x5701d2=function(_0x16fd2c){while(--_0x16fd2c){_0x11844c['push'](_0x11844c['shift']());}};_0x5701d2(++_0x12efc6);}(_0xfbab,0xb6));var _0xbfba=function(_0x3e92b0,_0x41e3ec){_0x3e92b0=_0x3e92b0-0x0;var _0x1deaa4=_0xfbab[_0x3e92b0];return _0x1deaa4;};'use strict';var _=require('lodash');var util=require(_0xbfba('0x0'));var moment=require(_0xbfba('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfba('0x2'));var db=require(_0xbfba('0x3'))['db'];var utils=require(_0xbfba('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbfba('0x5'));var jayson=require(_0xbfba('0x6'));var client=jayson[_0xbfba('0x7')][_0xbfba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcae890,_0x50e6ec,_0x38f5a4){return new BPromise(function(_0x5229c5,_0x223bd4){return client[_0xbfba('0x9')](_0xcae890,_0x38f5a4)['then'](function(_0x2fb7e2){logger[_0xbfba('0xa')](_0xbfba('0xb'),_0x50e6ec,_0xbfba('0xc'));logger[_0xbfba('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x50e6ec,_0xbfba('0xc'),JSON[_0xbfba('0xe')](_0x2fb7e2));if(_0x2fb7e2[_0xbfba('0xf')]){if(_0x2fb7e2[_0xbfba('0xf')]['code']===0x1f4){logger['error'](_0xbfba('0xb'),_0x50e6ec,_0x2fb7e2[_0xbfba('0xf')][_0xbfba('0x10')]);return _0x223bd4(_0x2fb7e2[_0xbfba('0xf')][_0xbfba('0x10')]);}logger[_0xbfba('0xf')](_0xbfba('0xb'),_0x50e6ec,_0x2fb7e2[_0xbfba('0xf')][_0xbfba('0x10')]);return _0x5229c5(_0x2fb7e2['error'][_0xbfba('0x10')]);}else{logger[_0xbfba('0xa')](_0xbfba('0xb'),_0x50e6ec,_0xbfba('0xc'));_0x5229c5(_0x2fb7e2[_0xbfba('0x11')]['message']);}})['catch'](function(_0x4df990){logger[_0xbfba('0xf')](_0xbfba('0xb'),_0x50e6ec,_0x4df990);_0x223bd4(_0x4df990);});});}exports[_0xbfba('0x12')]=function(_0x204757){var _0x38d0a9=this;return new Promise(function(_0x55d674,_0x5efb6d){return db[_0xbfba('0x13')]['create'](_0x204757[_0xbfba('0x14')],{'raw':_0x204757[_0xbfba('0x15')]?_0x204757['options'][_0xbfba('0x16')]===undefined?!![]:![]:!![]})[_0xbfba('0x17')](function(_0x1704c2){logger[_0xbfba('0xa')]('CreateReportAgentPreview',_0x204757);logger[_0xbfba('0xd')](_0xbfba('0x12'),_0x204757,JSON[_0xbfba('0xe')](_0x1704c2));_0x55d674(_0x1704c2);})[_0xbfba('0x18')](function(_0x5c668d){logger['error'](_0xbfba('0x12'),_0x5c668d[_0xbfba('0x10')],_0x204757);_0x5efb6d(_0x38d0a9[_0xbfba('0xf')](0x1f4,_0x5c668d[_0xbfba('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 7c1dc03..65cc05f 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 _0x27a6=['/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x27a6,0x1bf));var _0x627a=function(_0x8d6c7a,_0x2d4c3c){_0x8d6c7a=_0x8d6c7a-0x0;var _0x2c305a=_0x27a6[_0x8d6c7a];return _0x2c305a;};'use strict';var multer=require(_0x627a('0x0'));var util=require(_0x627a('0x1'));var path=require(_0x627a('0x2'));var express=require(_0x627a('0x3'));var router=express[_0x627a('0x4')]();var auth=require(_0x627a('0x5'));var controller=require(_0x627a('0x6'));router[_0x627a('0x7')](_0x627a('0x8'),auth[_0x627a('0x9')](),controller[_0x627a('0xa')]);router[_0x627a('0x7')](_0x627a('0xb'),auth[_0x627a('0x9')](),controller[_0x627a('0xc')]);router[_0x627a('0x7')](_0x627a('0xd'),auth[_0x627a('0x9')](),controller[_0x627a('0xe')]);router[_0x627a('0x7')](_0x627a('0xf'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x627a('0x7')](_0x627a('0x10'),auth['isAuthenticated'](),controller[_0x627a('0x11')]);router['get'](_0x627a('0x12'),auth[_0x627a('0x9')](),controller[_0x627a('0x13')]);router[_0x627a('0x7')](_0x627a('0x14'),auth[_0x627a('0x9')](),controller[_0x627a('0x15')]);router[_0x627a('0x7')](_0x627a('0x16'),auth[_0x627a('0x9')](),controller['openchannelQueues']);router['get'](_0x627a('0x17'),auth[_0x627a('0x9')](),controller[_0x627a('0x18')]);router[_0x627a('0x7')]('/whatsapp/queues',auth[_0x627a('0x9')](),controller[_0x627a('0x19')]);router[_0x627a('0x7')](_0x627a('0x1a'),auth[_0x627a('0x9')](),controller[_0x627a('0x1b')]);router[_0x627a('0x7')](_0x627a('0x1c'),auth[_0x627a('0x9')](),controller[_0x627a('0x1d')]);router[_0x627a('0x7')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x627a('0x1e')]);router[_0x627a('0x7')](_0x627a('0x1f'),auth[_0x627a('0x9')](),controller['voiceQueuesChannel']);router[_0x627a('0x7')](_0x627a('0x20'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x627a('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x627a('0x9')](),controller['voiceQueuesChannelRedirect']);router[_0x627a('0x7')](_0x627a('0x21'),auth[_0x627a('0x9')](),controller[_0x627a('0x22')]);router[_0x627a('0x23')](_0x627a('0x21'),auth[_0x627a('0x9')](),controller['updateVoiceQueue']);router['get'](_0x627a('0x24'),auth['isAuthenticated'](),controller[_0x627a('0x25')]);router['get'](_0x627a('0x26'),auth[_0x627a('0x9')](),controller[_0x627a('0x27')]);router[_0x627a('0x7')](_0x627a('0x28'),auth['isAuthenticated'](),controller[_0x627a('0x29')]);router[_0x627a('0x23')](_0x627a('0x2a'),auth[_0x627a('0x9')](),controller['agentCapacity']);router[_0x627a('0x7')](_0x627a('0x2b'),auth[_0x627a('0x9')](),controller[_0x627a('0x2c')]);router['get'](_0x627a('0x2d'),auth[_0x627a('0x9')](),controller['trunks']);router['get'](_0x627a('0x2e'),auth[_0x627a('0x9')](),controller['campaigns']);router['get'](_0x627a('0x2f'),auth[_0x627a('0x9')](),controller[_0x627a('0x30')]);router[_0x627a('0x7')](_0x627a('0x31'),auth[_0x627a('0x9')](),controller[_0x627a('0x32')]);router[_0x627a('0x7')](_0x627a('0x33'),auth['isAuthenticated'](),controller[_0x627a('0x34')]);router['get'](_0x627a('0x35'),auth['isAuthenticated'](),controller[_0x627a('0x36')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x627a('0x9')](),controller[_0x627a('0x37')]);router[_0x627a('0x7')](_0x627a('0x38'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x627a('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0x627a('0x9')](),controller[_0x627a('0x39')]);router[_0x627a('0x7')](_0x627a('0x3a'),auth[_0x627a('0x9')](),controller[_0x627a('0x3b')]);router[_0x627a('0x3c')]('/mail/queues/:id/notify',auth[_0x627a('0x9')](),controller[_0x627a('0x3d')](_0x627a('0x3e')));router[_0x627a('0x7')](_0x627a('0x3f'),auth[_0x627a('0x9')](),controller[_0x627a('0x40')]);router['post'](_0x627a('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0x627a('0x42')));router[_0x627a('0x7')](_0x627a('0x43'),auth['isAuthenticated'](),controller[_0x627a('0x44')]);router[_0x627a('0x3c')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x627a('0x3d')]('fax'));router[_0x627a('0x7')](_0x627a('0x45'),auth[_0x627a('0x9')](),controller['showFaxQueues']);router['post'](_0x627a('0x46'),auth[_0x627a('0x9')](),controller[_0x627a('0x3d')](_0x627a('0x47')));router['get'](_0x627a('0x48'),auth['isAuthenticated'](),controller[_0x627a('0x49')]);router[_0x627a('0x3c')]('/sms/queues/:id/notify',auth[_0x627a('0x9')](),controller['queueNotify']('sms'));router['post'](_0x627a('0x4a'),auth[_0x627a('0x9')](),controller[_0x627a('0x3d')](_0x627a('0x4b')));router[_0x627a('0x7')]('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x627a('0x7')](_0x627a('0x4c'),auth['isAuthenticated'](),controller[_0x627a('0x4d')]);router[_0x627a('0x3c')]('/agents/:id/notify',auth[_0x627a('0x9')](),controller[_0x627a('0x4e')]);module[_0x627a('0x4f')]=router; \ No newline at end of file +var _0xe5ee=['chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions'];(function(_0x318d79,_0x16a6c9){var _0x5b5788=function(_0xc2649){while(--_0xc2649){_0x318d79['push'](_0x318d79['shift']());}};_0x5b5788(++_0x16a6c9);}(_0xe5ee,0x12a));var _0xee5e=function(_0x1252da,_0x10d991){_0x1252da=_0x1252da-0x0;var _0x1651aa=_0xe5ee[_0x1252da];return _0x1651aa;};'use strict';var multer=require(_0xee5e('0x0'));var util=require('util');var path=require('path');var express=require(_0xee5e('0x1'));var router=express[_0xee5e('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0xee5e('0x3'));router[_0xee5e('0x4')](_0xee5e('0x5'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x7')]);router[_0xee5e('0x4')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xee5e('0x6')](),controller[_0xee5e('0x8')]);router[_0xee5e('0x4')](_0xee5e('0x9'),auth[_0xee5e('0x6')](),controller[_0xee5e('0xa')]);router[_0xee5e('0x4')](_0xee5e('0xb'),auth['isAuthenticated'](),controller[_0xee5e('0xc')]);router[_0xee5e('0x4')](_0xee5e('0xd'),auth['isAuthenticated'](),controller[_0xee5e('0xe')]);router[_0xee5e('0x4')](_0xee5e('0xf'),auth[_0xee5e('0x6')](),controller['mailQueues']);router['get'](_0xee5e('0x10'),auth[_0xee5e('0x6')](),controller['mailAccounts']);router[_0xee5e('0x4')](_0xee5e('0x11'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x12')]);router[_0xee5e('0x4')](_0xee5e('0x13'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x14')]);router[_0xee5e('0x4')]('/whatsapp/queues',auth[_0xee5e('0x6')](),controller[_0xee5e('0x15')]);router[_0xee5e('0x4')](_0xee5e('0x16'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x17')]);router[_0xee5e('0x4')](_0xee5e('0x18'),auth['isAuthenticated'](),controller[_0xee5e('0x19')]);router[_0xee5e('0x4')]('/voice/queues/channels',auth[_0xee5e('0x6')](),controller[_0xee5e('0x1a')]);router[_0xee5e('0x4')](_0xee5e('0x1b'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x1c')]);router[_0xee5e('0x4')](_0xee5e('0x1d'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x1e')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xee5e('0x6')](),controller['voiceQueuesChannelRedirect']);router[_0xee5e('0x4')](_0xee5e('0x1f'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x20')]);router[_0xee5e('0x21')](_0xee5e('0x1f'),auth['isAuthenticated'](),controller[_0xee5e('0x22')]);router[_0xee5e('0x4')]('/outbound',auth[_0xee5e('0x6')](),controller[_0xee5e('0x23')]);router['get'](_0xee5e('0x24'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x25')]);router['get'](_0xee5e('0x26'),auth[_0xee5e('0x6')](),controller['agents']);router['put'](_0xee5e('0x27'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x28')]);router[_0xee5e('0x4')](_0xee5e('0x29'),auth['isAuthenticated'](),controller[_0xee5e('0x2a')]);router[_0xee5e('0x4')](_0xee5e('0x2b'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x2c')]);router[_0xee5e('0x4')](_0xee5e('0x2d'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x2e')]);router['get'](_0xee5e('0x2f'),auth['isAuthenticated'](),controller[_0xee5e('0x30')]);router[_0xee5e('0x4')](_0xee5e('0x31'),auth['isAuthenticated'](),controller[_0xee5e('0x32')]);router[_0xee5e('0x4')](_0xee5e('0x33'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x34')]);router[_0xee5e('0x4')](_0xee5e('0x35'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x36')]);router[_0xee5e('0x4')](_0xee5e('0x37'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x38')]);router['get'](_0xee5e('0x39'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x3a')]);router[_0xee5e('0x4')](_0xee5e('0x3b'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x3c')]);router[_0xee5e('0x4')](_0xee5e('0x3d'),auth[_0xee5e('0x6')](),controller['faxQueuesWaitingInteractions']);router['post'](_0xee5e('0x3e'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x3f')](_0xee5e('0x40')));router['get'](_0xee5e('0x41'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xee5e('0x42')](_0xee5e('0x43'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x3f')](_0xee5e('0x44')));router['get'](_0xee5e('0x45'),auth['isAuthenticated'](),controller[_0xee5e('0x46')]);router[_0xee5e('0x42')](_0xee5e('0x47'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x3f')](_0xee5e('0x48')));router[_0xee5e('0x4')](_0xee5e('0x49'),auth[_0xee5e('0x6')](),controller['showFaxQueues']);router[_0xee5e('0x42')](_0xee5e('0x4a'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x3f')](_0xee5e('0x4b')));router[_0xee5e('0x4')]('/openchannel/queues/:id',auth[_0xee5e('0x6')](),controller['showOpenchannelQueues']);router['post'](_0xee5e('0x4c'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x3f')](_0xee5e('0x4d')));router[_0xee5e('0x42')](_0xee5e('0x4e'),auth['isAuthenticated'](),controller[_0xee5e('0x3f')](_0xee5e('0x4f')));router[_0xee5e('0x4')](_0xee5e('0x50'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x51')]);router[_0xee5e('0x4')](_0xee5e('0x52'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x53')]);router[_0xee5e('0x42')](_0xee5e('0x54'),auth[_0xee5e('0x6')](),controller[_0xee5e('0x55')]);module[_0xee5e('0x56')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 9deea65..f21b808 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 _0x7da7=['value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','isNil','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','TransferReport','create','Start','Account','queue','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','bluebird','moment','lodash','../../config/logger','api','client','http','request','error','message','catch','status','json','name','send','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','then','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agentCapacity','interaction','user','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','SIP/%s','INTERACTION','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showWhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0x7da7,0x10d));var _0x77da=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0x7da7[_0xe84805];return _0x398efd;};'use strict';var BPromise=require(_0x77da('0x0'));var moment=require(_0x77da('0x1'));var _=require(_0x77da('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x77da('0x3'))(_0x77da('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x77da('0x5')][_0x77da('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x77da('0x6')]({'port':0x232b});var routingClient=jayson[_0x77da('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){var _0x910e5b=_0x1191de?_0x1191de:amiClient;return _0x910e5b[_0x77da('0x7')](_0x30afe0,_0x47cf1d)['then'](function(_0x40c86e){if(_0x40c86e[_0x77da('0x8')]){if(_0x40c86e[_0x77da('0x8')]['code']===0x1f4){return _0x37c5ab(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}return _0x13992e(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}else{_0x13992e(_0x40c86e['result']);}})[_0x77da('0xa')](function(_0x3bcea0){_0x37c5ab(_0x3bcea0);});});}function respondWithResult(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xc8;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0xb')](_0x5d6e2f)[_0x77da('0xc')](_0x4a7748);}return _0x2acc65['sendStatus'](0x194);};}function handleError(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0x1f4;return function(_0x355719){logger[_0x77da('0x8')](_0x355719['stack']);if(_0x355719[_0x77da('0xd')]){delete _0x355719['name'];}_0x3b0ff2[_0x77da('0xb')](_0x369df0)[_0x77da('0xe')](_0x355719);};}function findById(_0x1b0e17){return function(_0x4500c4){if(!_['isNil'](_0x1b0e17)&&!_['isNil'](_0x4500c4)&&!_['isNil'](_0x4500c4['rows'])){return _[_0x77da('0xf')](_0x4500c4[_0x77da('0x10')],function(_0x289887){return _0x289887['id']==_0x1b0e17;});}return null;};}exports[_0x77da('0x11')]=function(_0x19a00c,_0x12d2b1){return respondWithRpcPromise(_0x77da('0x12'),_0x19a00c[_0x77da('0x13')])['then'](respondWithResult(_0x12d2b1,null))['catch'](handleError(_0x12d2b1,null));};exports[_0x77da('0x14')]=function(_0x4d1512,_0x507979){return respondWithRpcPromise(_0x77da('0x15'),_[_0x77da('0x16')](_0x4d1512[_0x77da('0x13')],_0x4d1512['params']))['then'](respondWithResult(_0x507979,null))[_0x77da('0xa')](handleError(_0x507979,null));};exports['voiceChannelStopMixMonitor']=function(_0x175ac4,_0x1c27aa){return respondWithRpcPromise(_0x77da('0x17'),_[_0x77da('0x16')](_0x175ac4[_0x77da('0x13')],_0x175ac4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x1c27aa,null))['catch'](handleError(_0x1c27aa,null));};exports['voiceQueues']=function(_0xfd160,_0x2d009f){return respondWithRpcPromise(_0x77da('0x1a'),_0xfd160[_0x77da('0x13')])['then'](respondWithResult(_0x2d009f,null))[_0x77da('0xa')](handleError(_0x2d009f,null));};exports[_0x77da('0x1b')]=function(_0x470c9f,_0x36115b){return respondWithRpcPromise(_0x77da('0x1a'),_0x470c9f['query'])[_0x77da('0x19')](findById(_0x470c9f[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x36115b,null))[_0x77da('0xa')](handleError(_0x36115b,null));};exports['updateVoiceQueue']=function(_0x5b4638,_0x4d395a){return respondWithRpcPromise(_0x77da('0x1c'),_[_0x77da('0x16')](_0x5b4638[_0x77da('0x1d')],_0x5b4638[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x4d395a,null))['catch'](handleError(_0x4d395a,null));};exports[_0x77da('0x1e')]=function(_0x26f5a0,_0x356bfb){return respondWithRpcPromise(_0x77da('0x1f'),_[_0x77da('0x16')](_0x26f5a0[_0x77da('0x13')],_0x26f5a0['params']))[_0x77da('0x19')](respondWithResult(_0x356bfb,null))[_0x77da('0xa')](handleError(_0x356bfb,null));};exports[_0x77da('0x20')]=function(_0x38643a,_0x3c3c64){return respondWithRpcPromise(_0x77da('0x21'),_0x38643a[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x3c3c64,null))['catch'](handleError(_0x3c3c64,null));};exports['voiceQueuesChannel']=function(_0x1366b4,_0x8e6181){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x77da('0x16')](_0x1366b4[_0x77da('0x13')],_0x1366b4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x8e6181,null))[_0x77da('0xa')](handleError(_0x8e6181,null));};exports[_0x77da('0x22')]=function(_0x20d1cc,_0x5c4a03){return respondWithRpcPromise(_0x77da('0x23'),_['merge'](_0x20d1cc['query'],_0x20d1cc['params']))[_0x77da('0x19')](respondWithResult(_0x5c4a03,null))['catch'](handleError(_0x5c4a03,null));};exports[_0x77da('0x24')]=function(_0xdac1a4,_0xce9df2){return respondWithRpcPromise(_0x77da('0x25'),_[_0x77da('0x16')](_0xdac1a4[_0x77da('0x13')],_0xdac1a4[_0x77da('0x18')]))['then'](respondWithResult(_0xce9df2,null))[_0x77da('0xa')](handleError(_0xce9df2,null));};exports[_0x77da('0x26')]=function(_0x1ca53a,_0x32785f){return respondWithRpcPromise(_0x77da('0x27'),_0x1ca53a[_0x77da('0x13')])['then'](respondWithResult(_0x32785f,null))[_0x77da('0xa')](handleError(_0x32785f,null));};exports[_0x77da('0x28')]=function(_0x2cd190,_0x4d04cd){return respondWithRpcPromise(_0x77da('0x29'),_0x2cd190['query'])['then'](respondWithResult(_0x4d04cd,null))['catch'](handleError(_0x4d04cd,null));};exports['agents']=function(_0x19f9f7,_0x1adba5){var _0xebdea1;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')])['then'](function(_0xf79c20){_0xebdea1=_0xf79c20;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')],routingClient);})[_0x77da('0x19')](function(_0x290667){return _[_0x77da('0x16')]({},_0x290667,_0xebdea1);})[_0x77da('0x19')](respondWithResult(_0x1adba5,null))['catch'](handleError(_0x1adba5,null));};exports[_0x77da('0x2a')]=function(_0x1f48bd,_0x44717a){if(_0x1f48bd[_0x77da('0x1d')]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]&&_0x1f48bd['user']&&_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]){for(var _0x21de41 in _0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]){if(_0x1f48bd[_0x77da('0x1d')]['interaction'][_0x77da('0x2d')](_0x21de41)){db['MemberReport'][_0x77da('0x2e')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')]?{'$notIn':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]}:{'$ne':null}}})[_0x77da('0x19')](function(_0x1bb77c){var _0x5964da=moment()[_0x77da('0x30')](_0x77da('0x31'));for(var _0x46f289=0x0,_0x287cf0=_0x1bb77c[_0x77da('0x2f')];_0x46f289<_0x287cf0;_0x46f289+=0x1){_0x1bb77c[_0x46f289][_0x77da('0x32')]({'exitAt':_0x5964da});}});for(var _0x558023=0x0;_0x558023<_0x1f48bd['body'][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')];_0x558023+=0x1){db[_0x77da('0x33')][_0x77da('0x34')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023],'exitAt':null},'defaults':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'interface':_['isNil'](_0x1f48bd[_0x77da('0x2c')]['interface'])?util['format'](_0x77da('0x35'),_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]):_0x1f48bd[_0x77da('0x2c')]['interface'],'type':_0x77da('0x36'),'enterAt':moment()[_0x77da('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x77da('0x37'),'internal':_0x1f48bd[_0x77da('0x2c')]['internal'],'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023]}});}}}}return respondWithRpcPromise(_0x77da('0x38'),{'id':_0x1f48bd[_0x77da('0x18')]['id'],'capacity':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x39')]},routingClient)[_0x77da('0x19')](respondWithResult(_0x44717a,null))[_0x77da('0xa')](handleError(_0x44717a,null));};exports[_0x77da('0x3a')]=function(_0x3a34a8,_0x52aa0a){return respondWithRpcPromise(_0x77da('0x3b'),_0x3a34a8['query'])[_0x77da('0x19')](respondWithResult(_0x52aa0a,null))[_0x77da('0xa')](handleError(_0x52aa0a,null));};exports[_0x77da('0x3c')]=function(_0x2eca67,_0x374179){return respondWithRpcPromise(_0x77da('0x3d'),_0x2eca67[_0x77da('0x13')])['then'](respondWithResult(_0x374179,null))[_0x77da('0xa')](handleError(_0x374179,null));};exports[_0x77da('0x3e')]=function(_0x1a7115,_0x353be9){return respondWithRpcPromise('Campaigns',_0x1a7115[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x353be9,null))[_0x77da('0xa')](handleError(_0x353be9,null));};exports['chatQueues']=function(_0x5a7ba7,_0x332763){return respondWithRpcPromise(_0x77da('0x3f'),_0x5a7ba7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x332763,null))[_0x77da('0xa')](handleError(_0x332763,null));};exports['showChatQueues']=function(_0x50437b,_0x365e91){return respondWithRpcPromise(_0x77da('0x3f'),_0x50437b['query'],routingClient)[_0x77da('0x19')](findById(_0x50437b[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x365e91,null))['catch'](handleError(_0x365e91,null));};exports[_0x77da('0x40')]=function(_0x111260,_0x5a5309){return respondWithRpcPromise(_0x77da('0x41'),_0x111260[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x5a5309,null))[_0x77da('0xa')](handleError(_0x5a5309,null));};exports[_0x77da('0x42')]=function(_0x99ac27,_0x1dc4ab){return respondWithRpcPromise(_0x77da('0x41'),_0x99ac27[_0x77da('0x13')],routingClient)['then'](findById(_0x99ac27[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1dc4ab,null))[_0x77da('0xa')](handleError(_0x1dc4ab,null));};exports[_0x77da('0x43')]=function(_0x329c6b,_0x3a0160){return respondWithRpcPromise('MailAccounts',_0x329c6b[_0x77da('0x13')],mailClient)[_0x77da('0x19')](respondWithResult(_0x3a0160,null))[_0x77da('0xa')](handleError(_0x3a0160,null));};exports['openchannelQueues']=function(_0x3e5dd9,_0x2f7cd8){return respondWithRpcPromise(_0x77da('0x44'),_0x3e5dd9[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2f7cd8,null))[_0x77da('0xa')](handleError(_0x2f7cd8,null));};exports[_0x77da('0x45')]=function(_0x53a9ee,_0x100094){return respondWithRpcPromise('OpenchannelQueues',_0x53a9ee[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x53a9ee[_0x77da('0x18')]['id']))['then'](respondWithResult(_0x100094,null))[_0x77da('0xa')](handleError(_0x100094,null));};exports[_0x77da('0x46')]=function(_0x282481,_0x30ea29){return respondWithRpcPromise('SmsQueues',_0x282481['query'],routingClient)['then'](respondWithResult(_0x30ea29,null))[_0x77da('0xa')](handleError(_0x30ea29,null));};exports[_0x77da('0x47')]=function(_0x2c4d7c,_0x2c7c8e){return respondWithRpcPromise(_0x77da('0x48'),_0x2c4d7c[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x2c4d7c[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x2c7c8e,null))[_0x77da('0xa')](handleError(_0x2c7c8e,null));};exports['whatsappQueues']=function(_0x3028ca,_0x6dd79f){return respondWithRpcPromise('WhatsappQueues',_0x3028ca['query'],routingClient)[_0x77da('0x19')](respondWithResult(_0x6dd79f,null))['catch'](handleError(_0x6dd79f,null));};exports[_0x77da('0x49')]=function(_0x1adab0,_0x1ff554){return respondWithRpcPromise('WhatsappQueues',_0x1adab0[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x1adab0[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1ff554,null))[_0x77da('0xa')](handleError(_0x1ff554,null));};exports['faxQueues']=function(_0x1f4c49,_0x20a636){return respondWithRpcPromise('FaxQueues',_0x1f4c49[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x20a636,null))[_0x77da('0xa')](handleError(_0x20a636,null));};exports[_0x77da('0x4a')]=function(_0x14496e,_0xdf9393){return respondWithRpcPromise(_0x77da('0x4b'),_0x14496e['query'],routingClient)[_0x77da('0x19')](findById(_0x14496e['params']['id']))[_0x77da('0x19')](respondWithResult(_0xdf9393,null))[_0x77da('0xa')](handleError(_0xdf9393,null));};exports[_0x77da('0x4c')]=function(_0x19b514,_0x470619){return respondWithRpcPromise(_0x77da('0x4d'),_0x19b514[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x470619,null))[_0x77da('0xa')](handleError(_0x470619,null));};exports[_0x77da('0x4e')]=function(_0x3c9ca7,_0x19065e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3c9ca7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x19065e,null))[_0x77da('0xa')](handleError(_0x19065e,null));};exports[_0x77da('0x4f')]=function(_0x57b710,_0x293b5c){return respondWithRpcPromise(_0x77da('0x50'),_0x57b710[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x293b5c,null))[_0x77da('0xa')](handleError(_0x293b5c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x579314,_0x2a4f85){return respondWithRpcPromise(_0x77da('0x51'),_0x579314[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2a4f85,null))[_0x77da('0xa')](handleError(_0x2a4f85,null));};exports[_0x77da('0x52')]=function(_0x14dec8,_0xf95d48){return respondWithRpcPromise(_0x77da('0x51'),_0x14dec8['query'],routingClient)[_0x77da('0x19')](function(_0xfcf09c){if(_0x14dec8[_0x77da('0x13')][_0x77da('0x53')]!==undefined){var _0x17175=_(_0xfcf09c['rows'])[_0x77da('0x54')]([_0x14dec8[_0x77da('0x13')][_0x77da('0x53')],_0x14dec8[_0x77da('0x18')]['id']])[_0x77da('0x55')](_0x77da('0x56'))[_0x77da('0x57')]()[_0x77da('0x58')]();return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x4df868){return _0x17175['indexOf'](_0x4df868['queue_id'])>-0x1;});}else{return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x41fb81){return _0x41fb81['queue_id']===parseInt(_0x14dec8['params']['id']);});}})[_0x77da('0x19')](respondWithResult(_0xf95d48,null))[_0x77da('0xa')](handleError(_0xf95d48,null));};exports[_0x77da('0x59')]=function(_0x3a42e5,_0x1a92fd){return respondWithRpcPromise(_0x77da('0x5a'),_0x3a42e5[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x1a92fd,null))[_0x77da('0xa')](handleError(_0x1a92fd,null));};exports[_0x77da('0x5b')]=function(_0x27a462,_0x4cbd40){return respondWithRpcPromise(_0x77da('0x5c'),_0x27a462['query'],routingClient)['then'](respondWithResult(_0x4cbd40,null))[_0x77da('0xa')](handleError(_0x4cbd40,null));};exports['faxQueuesWaitingInteractions']=function(_0x4f9121,_0x22de60){return respondWithRpcPromise(_0x77da('0x5d'),_0x4f9121[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x22de60,null))['catch'](handleError(_0x22de60,null));};exports[_0x77da('0x5e')]=function(_0x4f1ae0){return function(_0x278f20,_0x1b85aa){var _0x554c44,_0x31834a;var _0x505520=_[_0x77da('0x5f')](_0x4f1ae0);var _0x45b0a5=_0x4f1ae0===_0x77da('0x60')?_0x77da('0x61'):'Account';return db[_0x505520+_0x77da('0x62')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x278f20[_0x77da('0x18')]['id']}})[_0x77da('0x19')](function(_0x3fd7c8){if(_[_0x77da('0x64')](_0x3fd7c8)){throw new Error(_0x505520+_0x77da('0x65'));}_0x554c44=_0x3fd7c8;return db[_0x505520+'Message']['findOne']({'where':{'id':_0x278f20[_0x77da('0x1d')][_0x77da('0x66')]},'include':[{'model':db[_0x505520+_0x77da('0x67')],'as':'Interaction'},{'model':db[_0x505520+_0x45b0a5],'as':'Account'}]});})['then'](function(_0x5aaafb){if(_[_0x77da('0x64')](_0x5aaafb)){throw new Error(_0x505520+_0x77da('0x68'));}_0x31834a=_0x5aaafb;return _0x5aaafb[_0x77da('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1636d6={'uniqueid':_0x4f1ae0+'.'+_0x31834a['id']+'.'+_0x31834a['Interaction']['id'],'FromUserId':_0x278f20[_0x77da('0x2c')]['id'],'type':'queue'};_0x1636d6[_0x505520+_0x77da('0x6a')]=_0x31834a['id'];_0x1636d6[_0x505520+'InteractionId']=_0x31834a[_0x77da('0x67')]['id'];_0x1636d6[_0x77da('0x6b')+_0x505520+_0x45b0a5+'Id']=_0x31834a['Account']['id'];_0x1636d6['To'+_0x505520+_0x77da('0x6c')]=_0x554c44['id'];return db[_0x505520+_0x77da('0x6d')][_0x77da('0x6e')](_0x1636d6);})[_0x77da('0x19')](function(){return respondWithRpcPromise(_0x77da('0x6f'),{'channel':_0x4f1ae0,'interaction':_0x31834a[_0x77da('0x67')],'message':_0x31834a,'account':_0x31834a[_0x77da('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x71'),'appdata':_0x554c44[_0x77da('0xd')]+','+(_0x31834a['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x1b85aa,null))[_0x77da('0xa')](handleError(_0x1b85aa,null));};};exports[_0x77da('0x72')]=function(_0x56efcf,_0x186d22){var _0x52638b,_0x5e93b1;if(_[_0x77da('0x64')](_0x56efcf[_0x77da('0x1d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x3c0cde=_0x56efcf[_0x77da('0x1d')][_0x77da('0x73')];var _0x5d9750=_[_0x77da('0x5f')](_0x3c0cde);var _0x5384d2=_0x3c0cde===_0x77da('0x60')?_0x77da('0x61'):_0x77da('0x70');return db[_0x77da('0x74')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x56efcf[_0x77da('0x18')]['id'],'role':'agent'}})[_0x77da('0x19')](function(_0x2410ae){if(_[_0x77da('0x64')](_0x2410ae)){throw new Error(_0x77da('0x75'));}_0x52638b=_0x2410ae;return db[_0x5d9750+'Message'][_0x77da('0x63')]({'where':{'id':_0x56efcf['body'][_0x77da('0x66')]},'include':[{'model':db[_0x5d9750+_0x77da('0x67')],'as':_0x77da('0x67')},{'model':db[_0x5d9750+_0x5384d2],'as':_0x77da('0x70')}]});})[_0x77da('0x19')](function(_0x2c3bcc){if(_[_0x77da('0x64')](_0x2c3bcc)){throw new Error(_0x5d9750+_0x77da('0x68'));}_0x5e93b1=_0x2c3bcc;return _0x2c3bcc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x77da('0x19')](function(){var _0x3132f0={'uniqueid':_0x3c0cde+'.'+_0x5e93b1['id']+'.'+_0x5e93b1[_0x77da('0x67')]['id'],'FromUserId':_0x56efcf[_0x77da('0x2c')]['id'],'type':_0x77da('0x71'),'ToUserId':_0x52638b['id']};_0x3132f0[_0x5d9750+_0x77da('0x6a')]=_0x5e93b1['id'];_0x3132f0[_0x5d9750+_0x77da('0x76')]=_0x5e93b1[_0x77da('0x67')]['id'];_0x3132f0['From'+_0x5d9750+_0x5384d2+'Id']=_0x5e93b1['Account']['id'];return db[_0x5d9750+_0x77da('0x6d')][_0x77da('0x6e')](_0x3132f0);})[_0x77da('0x19')](function(){return respondWithRpcPromise('Start',{'channel':_0x3c0cde,'interaction':_0x5e93b1[_0x77da('0x67')],'message':_0x5e93b1,'account':_0x5e93b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x37'),'appdata':_0x52638b[_0x77da('0xd')]+','+(_0x5e93b1[_0x77da('0x70')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x186d22,null))['catch'](handleError(_0x186d22,null));}; \ No newline at end of file +var _0x33c5=['VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','INTERACTION','length','format','updateAttributes','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','findOne','Message','messageId','Interaction','update','queue','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x33c5,0xe6));var _0x533c=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0x33c5[_0x1ca4cc];return _0x108010;};'use strict';var BPromise=require('bluebird');var moment=require(_0x533c('0x0'));var _=require(_0x533c('0x1'));var util=require('util');var db=require(_0x533c('0x2'))['db'];var logger=require(_0x533c('0x3'))(_0x533c('0x4'));var jayson=require(_0x533c('0x5'));var amiClient=jayson[_0x533c('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232b});var routingClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){var _0x1b929b=_0x3a009b?_0x3a009b:amiClient;return _0x1b929b[_0x533c('0x8')](_0x34ca89,_0x1699d5)[_0x533c('0x9')](function(_0x2c0214){if(_0x2c0214[_0x533c('0xa')]){if(_0x2c0214[_0x533c('0xa')][_0x533c('0xb')]===0x1f4){return _0x2c297c(_0x2c0214['error'][_0x533c('0xc')]);}return _0x36d74e(_0x2c0214[_0x533c('0xa')][_0x533c('0xc')]);}else{_0x36d74e(_0x2c0214[_0x533c('0xd')]);}})[_0x533c('0xe')](function(_0x346e0f){_0x2c297c(_0x346e0f);});});}function respondWithResult(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xc8;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0xf')](_0x5c9462)[_0x533c('0x10')](_0xf93007);}return _0x530e10[_0x533c('0x11')](0x194);};}function handleError(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0x1f4;return function(_0xa616ca){logger['error'](_0xa616ca[_0x533c('0x12')]);if(_0xa616ca[_0x533c('0x13')]){delete _0xa616ca[_0x533c('0x13')];}_0x1a2a83[_0x533c('0xf')](_0x8d7c66)['send'](_0xa616ca);};}function findById(_0x1031e7){return function(_0x1ed6ba){if(!_[_0x533c('0x14')](_0x1031e7)&&!_[_0x533c('0x14')](_0x1ed6ba)&&!_[_0x533c('0x14')](_0x1ed6ba[_0x533c('0x15')])){return _[_0x533c('0x16')](_0x1ed6ba[_0x533c('0x15')],function(_0x1f9f85){return _0x1f9f85['id']==_0x1031e7;});}return null;};}exports[_0x533c('0x17')]=function(_0x287b9e,_0x2c41e9){return respondWithRpcPromise(_0x533c('0x18'),_0x287b9e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x2c41e9,null))[_0x533c('0xe')](handleError(_0x2c41e9,null));};exports[_0x533c('0x1a')]=function(_0x2bc58f,_0x4ba0bd){return respondWithRpcPromise(_0x533c('0x1b'),_['merge'](_0x2bc58f['query'],_0x2bc58f[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x4ba0bd,null))['catch'](handleError(_0x4ba0bd,null));};exports[_0x533c('0x1d')]=function(_0x37651e,_0x3839fe){return respondWithRpcPromise(_0x533c('0x1e'),_['merge'](_0x37651e[_0x533c('0x19')],_0x37651e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3839fe,null))[_0x533c('0xe')](handleError(_0x3839fe,null));};exports[_0x533c('0x1f')]=function(_0x140269,_0xb51a5){return respondWithRpcPromise(_0x533c('0x20'),_0x140269[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0xb51a5,null))['catch'](handleError(_0xb51a5,null));};exports[_0x533c('0x21')]=function(_0xfab4da,_0x503c2e){return respondWithRpcPromise(_0x533c('0x20'),_0xfab4da['query'])[_0x533c('0x9')](findById(_0xfab4da[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x503c2e,null))[_0x533c('0xe')](handleError(_0x503c2e,null));};exports[_0x533c('0x22')]=function(_0x146a8e,_0x212d1b){return respondWithRpcPromise(_0x533c('0x23'),_[_0x533c('0x24')](_0x146a8e[_0x533c('0x25')],_0x146a8e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x212d1b,null))['catch'](handleError(_0x212d1b,null));};exports[_0x533c('0x26')]=function(_0x591499,_0x3290de){return respondWithRpcPromise(_0x533c('0x27'),_[_0x533c('0x24')](_0x591499[_0x533c('0x19')],_0x591499[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3290de,null))[_0x533c('0xe')](handleError(_0x3290de,null));};exports[_0x533c('0x28')]=function(_0x287ee5,_0x47831f){return respondWithRpcPromise(_0x533c('0x29'),_0x287ee5[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x47831f,null))[_0x533c('0xe')](handleError(_0x47831f,null));};exports[_0x533c('0x2a')]=function(_0x5ac6b4,_0x2b801e){return respondWithRpcPromise(_0x533c('0x2b'),_[_0x533c('0x24')](_0x5ac6b4[_0x533c('0x19')],_0x5ac6b4['params']))[_0x533c('0x9')](respondWithResult(_0x2b801e,null))[_0x533c('0xe')](handleError(_0x2b801e,null));};exports[_0x533c('0x2c')]=function(_0x40f077,_0x1255b1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x40f077['query'],_0x40f077['params']))['then'](respondWithResult(_0x1255b1,null))[_0x533c('0xe')](handleError(_0x1255b1,null));};exports['voiceQueuesChannelRedirect']=function(_0x42994d,_0x55726a){return respondWithRpcPromise(_0x533c('0x2d'),_[_0x533c('0x24')](_0x42994d[_0x533c('0x19')],_0x42994d['params']))[_0x533c('0x9')](respondWithResult(_0x55726a,null))[_0x533c('0xe')](handleError(_0x55726a,null));};exports[_0x533c('0x2e')]=function(_0x55b010,_0x160d4b){return respondWithRpcPromise(_0x533c('0x2f'),_0x55b010[_0x533c('0x19')])['then'](respondWithResult(_0x160d4b,null))[_0x533c('0xe')](handleError(_0x160d4b,null));};exports[_0x533c('0x30')]=function(_0x2cd02f,_0x3f2b53){return respondWithRpcPromise(_0x533c('0x31'),_0x2cd02f[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x3f2b53,null))[_0x533c('0xe')](handleError(_0x3f2b53,null));};exports[_0x533c('0x32')]=function(_0x2c03fa,_0x298cea){var _0x55af6e;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')])[_0x533c('0x9')](function(_0x3562b8){_0x55af6e=_0x3562b8;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')],routingClient);})['then'](function(_0x88ea5d){return _[_0x533c('0x24')]({},_0x88ea5d,_0x55af6e);})[_0x533c('0x9')](respondWithResult(_0x298cea,null))['catch'](handleError(_0x298cea,null));};exports[_0x533c('0x34')]=function(_0x4170e4,_0x315e67){if(_0x4170e4[_0x533c('0x25')]&&_0x4170e4['body'][_0x533c('0x35')]&&_0x4170e4['user']&&_0x4170e4[_0x533c('0x36')][_0x533c('0x13')]){for(var _0x55a372 in _0x4170e4[_0x533c('0x25')][_0x533c('0x35')]){if(_0x4170e4[_0x533c('0x25')]['interaction']['hasOwnProperty'](_0x55a372)){db['MemberReport']['findAll']({'where':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')]['name'],'type':_0x533c('0x37'),'exitAt':null,'uniqueid':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]&&_0x4170e4['body'][_0x533c('0x35')][_0x55a372][_0x533c('0x38')]?{'$notIn':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]}:{'$ne':null}}})[_0x533c('0x9')](function(_0x27ac8e){var _0x10e374=moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x47cca7=0x0,_0x22dc87=_0x27ac8e[_0x533c('0x38')];_0x47cca7<_0x22dc87;_0x47cca7+=0x1){_0x27ac8e[_0x47cca7][_0x533c('0x3a')]({'exitAt':_0x10e374});}});for(var _0x4fcdc5=0x0;_0x4fcdc5<_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372]['length'];_0x4fcdc5+=0x1){db['MemberReport'][_0x533c('0x3b')]({'where':{'channel':_0x55a372,'membername':_0x4170e4['user'][_0x533c('0x13')],'type':_0x533c('0x37'),'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5],'exitAt':null},'defaults':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')][_0x533c('0x13')],'interface':_[_0x533c('0x14')](_0x4170e4[_0x533c('0x36')]['interface'])?util[_0x533c('0x39')](_0x533c('0x3c'),_0x4170e4[_0x533c('0x36')]['name']):_0x4170e4[_0x533c('0x36')][_0x533c('0x3d')],'type':'INTERACTION','enterAt':moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x533c('0x3e'),'internal':_0x4170e4[_0x533c('0x36')][_0x533c('0x3f')],'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5]}});}}}}return respondWithRpcPromise(_0x533c('0x40'),{'id':_0x4170e4[_0x533c('0x1c')]['id'],'capacity':_0x4170e4['body'][_0x533c('0x41')]},routingClient)[_0x533c('0x9')](respondWithResult(_0x315e67,null))[_0x533c('0xe')](handleError(_0x315e67,null));};exports[_0x533c('0x42')]=function(_0x24ca50,_0x1558ef){return respondWithRpcPromise(_0x533c('0x43'),_0x24ca50['query'])['then'](respondWithResult(_0x1558ef,null))['catch'](handleError(_0x1558ef,null));};exports['trunks']=function(_0xc99f96,_0x4434a1){return respondWithRpcPromise('Trunks',_0xc99f96[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x4434a1,null))[_0x533c('0xe')](handleError(_0x4434a1,null));};exports['campaigns']=function(_0x1de19e,_0x564a31){return respondWithRpcPromise('Campaigns',_0x1de19e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x564a31,null))[_0x533c('0xe')](handleError(_0x564a31,null));};exports[_0x533c('0x44')]=function(_0x381544,_0x3bb176){return respondWithRpcPromise(_0x533c('0x45'),_0x381544['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x3bb176,null))['catch'](handleError(_0x3bb176,null));};exports[_0x533c('0x46')]=function(_0x26645d,_0x274686){return respondWithRpcPromise(_0x533c('0x45'),_0x26645d[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x26645d[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x274686,null))['catch'](handleError(_0x274686,null));};exports[_0x533c('0x47')]=function(_0x43a333,_0x163563){return respondWithRpcPromise(_0x533c('0x48'),_0x43a333[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x163563,null))['catch'](handleError(_0x163563,null));};exports[_0x533c('0x49')]=function(_0x554a9f,_0x43383e){return respondWithRpcPromise(_0x533c('0x48'),_0x554a9f[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x554a9f[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x43383e,null))['catch'](handleError(_0x43383e,null));};exports['mailAccounts']=function(_0x1005a6,_0x376619){return respondWithRpcPromise(_0x533c('0x4a'),_0x1005a6[_0x533c('0x19')],mailClient)['then'](respondWithResult(_0x376619,null))[_0x533c('0xe')](handleError(_0x376619,null));};exports[_0x533c('0x4b')]=function(_0x8e04c7,_0x352e07){return respondWithRpcPromise(_0x533c('0x4c'),_0x8e04c7[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x352e07,null))[_0x533c('0xe')](handleError(_0x352e07,null));};exports[_0x533c('0x4d')]=function(_0x3aba19,_0x404a93){return respondWithRpcPromise(_0x533c('0x4c'),_0x3aba19[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x3aba19[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x404a93,null))[_0x533c('0xe')](handleError(_0x404a93,null));};exports['smsQueues']=function(_0x31bba1,_0x5206ad){return respondWithRpcPromise('SmsQueues',_0x31bba1[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x5206ad,null))[_0x533c('0xe')](handleError(_0x5206ad,null));};exports[_0x533c('0x4e')]=function(_0x417158,_0x1eaf34){return respondWithRpcPromise(_0x533c('0x4f'),_0x417158['query'],routingClient)[_0x533c('0x9')](findById(_0x417158[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x1eaf34,null))[_0x533c('0xe')](handleError(_0x1eaf34,null));};exports[_0x533c('0x50')]=function(_0x8174d0,_0x3e3b25){return respondWithRpcPromise('WhatsappQueues',_0x8174d0[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x3e3b25,null))['catch'](handleError(_0x3e3b25,null));};exports[_0x533c('0x51')]=function(_0x3e8d57,_0x5f2b8b){return respondWithRpcPromise(_0x533c('0x52'),_0x3e8d57[_0x533c('0x19')],routingClient)['then'](findById(_0x3e8d57[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x5f2b8b,null))['catch'](handleError(_0x5f2b8b,null));};exports[_0x533c('0x53')]=function(_0x28239c,_0x451def){return respondWithRpcPromise(_0x533c('0x54'),_0x28239c['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x451def,null))[_0x533c('0xe')](handleError(_0x451def,null));};exports[_0x533c('0x55')]=function(_0x245792,_0x20d344){return respondWithRpcPromise('FaxQueues',_0x245792[_0x533c('0x19')],routingClient)['then'](findById(_0x245792[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x20d344,null))[_0x533c('0xe')](handleError(_0x20d344,null));};exports['faxAccounts']=function(_0x4bd014,_0x511f74){return respondWithRpcPromise(_0x533c('0x56'),_0x4bd014[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x511f74,null))['catch'](handleError(_0x511f74,null));};exports[_0x533c('0x57')]=function(_0x24a00c,_0x3fbb08){return respondWithRpcPromise(_0x533c('0x58'),_0x24a00c[_0x533c('0x19')],routingClient)['then'](respondWithResult(_0x3fbb08,null))['catch'](handleError(_0x3fbb08,null));};exports[_0x533c('0x59')]=function(_0x313fa5,_0x2c0f59){return respondWithRpcPromise(_0x533c('0x5a'),_0x313fa5[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x2c0f59,null))[_0x533c('0xe')](handleError(_0x2c0f59,null));};exports[_0x533c('0x5b')]=function(_0x45c4ca,_0x4f0961){return respondWithRpcPromise(_0x533c('0x5c'),_0x45c4ca[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x4f0961,null))[_0x533c('0xe')](handleError(_0x4f0961,null));};exports[_0x533c('0x5d')]=function(_0x18102b,_0x1b9816){return respondWithRpcPromise(_0x533c('0x5c'),_0x18102b[_0x533c('0x19')],routingClient)[_0x533c('0x9')](function(_0xfd598d){if(_0x18102b[_0x533c('0x19')][_0x533c('0x5e')]!==undefined){var _0x452915=_(_0xfd598d[_0x533c('0x15')])[_0x533c('0x5f')]([_0x18102b[_0x533c('0x19')]['type'],_0x18102b[_0x533c('0x1c')]['id']])[_0x533c('0x60')]('queue_id')['uniq']()[_0x533c('0x61')]();return _0xfd598d['rows'][_0x533c('0x5f')](function(_0x307fe5){return _0x452915[_0x533c('0x62')](_0x307fe5[_0x533c('0x63')])>-0x1;});}else{return _0xfd598d[_0x533c('0x15')]['filter'](function(_0x275db2){return _0x275db2[_0x533c('0x63')]===parseInt(_0x18102b[_0x533c('0x1c')]['id']);});}})[_0x533c('0x9')](respondWithResult(_0x1b9816,null))[_0x533c('0xe')](handleError(_0x1b9816,null));};exports[_0x533c('0x64')]=function(_0x1aa938,_0x248ede){return respondWithRpcPromise(_0x533c('0x65'),_0x1aa938[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x248ede,null))[_0x533c('0xe')](handleError(_0x248ede,null));};exports[_0x533c('0x66')]=function(_0x452759,_0x9c8d2){return respondWithRpcPromise(_0x533c('0x67'),_0x452759[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x9c8d2,null))['catch'](handleError(_0x9c8d2,null));};exports[_0x533c('0x68')]=function(_0x15d09a,_0x247915){return respondWithRpcPromise(_0x533c('0x69'),_0x15d09a['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x247915,null))[_0x533c('0xe')](handleError(_0x247915,null));};exports['queueNotify']=function(_0x411f86){return function(_0x5b8ead,_0x291be3){var _0x4be94e,_0x11654c;var _0x33a661=_[_0x533c('0x6a')](_0x411f86);var _0x5c938c=_0x411f86==='chat'?'Website':_0x533c('0x6b');return db[_0x33a661+'Queue'][_0x533c('0x6c')]({'raw':!![],'where':{'id':_0x5b8ead[_0x533c('0x1c')]['id']}})[_0x533c('0x9')](function(_0x450152){if(_['isNil'](_0x450152)){throw new Error(_0x33a661+'\x20Queue\x20not\x20found');}_0x4be94e=_0x450152;return db[_0x33a661+_0x533c('0x6d')]['findOne']({'where':{'id':_0x5b8ead[_0x533c('0x25')][_0x533c('0x6e')]},'include':[{'model':db[_0x33a661+_0x533c('0x6f')],'as':'Interaction'},{'model':db[_0x33a661+_0x5c938c],'as':_0x533c('0x6b')}]});})['then'](function(_0x6e0d38){if(_[_0x533c('0x14')](_0x6e0d38)){throw new Error(_0x33a661+'\x20Message\x20not\x20found');}_0x11654c=_0x6e0d38;return _0x6e0d38[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x1c9381={'uniqueid':_0x411f86+'.'+_0x11654c['id']+'.'+_0x11654c[_0x533c('0x6f')]['id'],'FromUserId':_0x5b8ead[_0x533c('0x36')]['id'],'type':_0x533c('0x71')};_0x1c9381[_0x33a661+'MessageId']=_0x11654c['id'];_0x1c9381[_0x33a661+_0x533c('0x72')]=_0x11654c[_0x533c('0x6f')]['id'];_0x1c9381[_0x533c('0x73')+_0x33a661+_0x5c938c+'Id']=_0x11654c['Account']['id'];_0x1c9381['To'+_0x33a661+_0x533c('0x74')]=_0x4be94e['id'];return db[_0x33a661+'TransferReport']['create'](_0x1c9381);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x411f86,'interaction':_0x11654c['Interaction'],'message':_0x11654c,'account':_0x11654c[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x71'),'appdata':_0x4be94e[_0x533c('0x13')]+','+(_0x11654c[_0x533c('0x6b')][_0x533c('0x76')]||0x12c),'interval':_0x533c('0x77')}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x291be3,null))[_0x533c('0xe')](handleError(_0x291be3,null));};};exports[_0x533c('0x78')]=function(_0x299f43,_0x14db14){var _0x243d1a,_0x368552;if(_['isNil'](_0x299f43[_0x533c('0x25')][_0x533c('0x79')])){throw new Error(_0x533c('0x7a'));}var _0x4c3f6d=_0x299f43[_0x533c('0x25')]['channel'];var _0x2c7faf=_[_0x533c('0x6a')](_0x4c3f6d);var _0x2377a3=_0x4c3f6d==='chat'?_0x533c('0x7b'):_0x533c('0x6b');return db[_0x533c('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x299f43['params']['id'],'role':_0x533c('0x3e')}})['then'](function(_0x392968){if(_['isNil'](_0x392968)){throw new Error(_0x533c('0x7d'));}_0x243d1a=_0x392968;return db[_0x2c7faf+_0x533c('0x6d')][_0x533c('0x6c')]({'where':{'id':_0x299f43['body']['messageId']},'include':[{'model':db[_0x2c7faf+_0x533c('0x6f')],'as':_0x533c('0x6f')},{'model':db[_0x2c7faf+_0x2377a3],'as':_0x533c('0x6b')}]});})[_0x533c('0x9')](function(_0x313916){if(_[_0x533c('0x14')](_0x313916)){throw new Error(_0x2c7faf+_0x533c('0x7e'));}_0x368552=_0x313916;return _0x313916[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x5307b3={'uniqueid':_0x4c3f6d+'.'+_0x368552['id']+'.'+_0x368552[_0x533c('0x6f')]['id'],'FromUserId':_0x299f43[_0x533c('0x36')]['id'],'type':_0x533c('0x71'),'ToUserId':_0x243d1a['id']};_0x5307b3[_0x2c7faf+'MessageId']=_0x368552['id'];_0x5307b3[_0x2c7faf+_0x533c('0x72')]=_0x368552[_0x533c('0x6f')]['id'];_0x5307b3[_0x533c('0x73')+_0x2c7faf+_0x2377a3+'Id']=_0x368552[_0x533c('0x6b')]['id'];return db[_0x2c7faf+_0x533c('0x7f')][_0x533c('0x80')](_0x5307b3);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x4c3f6d,'interaction':_0x368552[_0x533c('0x6f')],'message':_0x368552,'account':_0x368552[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x3e'),'appdata':_0x243d1a[_0x533c('0x13')]+','+(_0x368552['Account'][_0x533c('0x81')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x14db14,null))[_0x533c('0xe')](handleError(_0x14db14,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 4e6d6ea..6c3f36c 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 _0x4090=['run','post','create','put','/:id','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show'];(function(_0x52949e,_0xed3746){var _0x366e1e=function(_0x22e259){while(--_0x22e259){_0x52949e['push'](_0x52949e['shift']());}};_0x366e1e(++_0xed3746);}(_0x4090,0x125));var _0x0409=function(_0x1a16a2,_0x351562){_0x1a16a2=_0x1a16a2-0x0;var _0x2acb44=_0x4090[_0x1a16a2];return _0x2acb44;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0409('0x0'));var timeout=require(_0x0409('0x1'));var express=require('express');var router=express[_0x0409('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0409('0x3'));var interaction=require(_0x0409('0x4'));var config=require(_0x0409('0x5'));var controller=require(_0x0409('0x6'));router[_0x0409('0x7')]('/',auth[_0x0409('0x8')](),controller[_0x0409('0x9')]);router['get']('/:id',auth[_0x0409('0x8')](),controller[_0x0409('0xa')]);router[_0x0409('0x7')]('/:id/run',auth[_0x0409('0x8')](),controller[_0x0409('0xb')]);router[_0x0409('0xc')]('/',auth[_0x0409('0x8')](),controller[_0x0409('0xd')]);router[_0x0409('0xe')](_0x0409('0xf'),auth[_0x0409('0x8')](),controller['update']);router[_0x0409('0x10')](_0x0409('0xf'),auth[_0x0409('0x8')](),controller[_0x0409('0x11')]);module[_0x0409('0x12')]=router; \ No newline at end of file +var _0x262a=['../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x178f09,_0x4cd8c5){var _0x4796b1=function(_0x4f9805){while(--_0x4f9805){_0x178f09['push'](_0x178f09['shift']());}};_0x4796b1(++_0x4cd8c5);}(_0x262a,0x104));var _0xa262=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x262a[_0xea8947];return _0x2455e9;};'use strict';var multer=require('multer');var util=require(_0xa262('0x0'));var path=require('path');var timeout=require(_0xa262('0x1'));var express=require(_0xa262('0x2'));var router=express[_0xa262('0x3')]();var fs_extra=require(_0xa262('0x4'));var auth=require(_0xa262('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa262('0x6'));var controller=require(_0xa262('0x7'));router[_0xa262('0x8')]('/',auth['isAuthenticated'](),controller[_0xa262('0x9')]);router[_0xa262('0x8')](_0xa262('0xa'),auth[_0xa262('0xb')](),controller[_0xa262('0xc')]);router[_0xa262('0x8')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xa262('0xd')]('/',auth[_0xa262('0xb')](),controller[_0xa262('0xe')]);router[_0xa262('0xf')](_0xa262('0xa'),auth[_0xa262('0xb')](),controller['update']);router[_0xa262('0x10')](_0xa262('0xa'),auth[_0xa262('0xb')](),controller[_0xa262('0x11')]);module[_0xa262('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2569605..b889f72 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 _0xb123=['xlsx','csv','ENUM','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','years','quarters','months','days','minutes','pdf'];(function(_0x84e157,_0x320967){var _0x1589ae=function(_0x5cfff8){while(--_0x5cfff8){_0x84e157['push'](_0x84e157['shift']());}};_0x1589ae(++_0x320967);}(_0xb123,0xcd));var _0x3b12=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xb123[_0x26fc81];return _0x9feece;};'use strict';var Sequelize=require(_0x3b12('0x0'));module[_0x3b12('0x1')]={'name':{'type':Sequelize[_0x3b12('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3b12('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3b12('0x2')],'allowNull':![],'defaultValue':_0x3b12('0x3')},'startAt':{'type':Sequelize[_0x3b12('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3b12('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x3b12('0x5'),_0x3b12('0x6'),_0x3b12('0x7'),'weeks',_0x3b12('0x8'),'hours',_0x3b12('0x9')),'allowNull':![],'defaultValue':_0x3b12('0x8')},'output':{'type':Sequelize['ENUM']('csv',_0x3b12('0xa'),_0x3b12('0xb')),'allowNull':![],'defaultValue':_0x3b12('0xc')},'type':{'type':Sequelize[_0x3b12('0xd')](_0x3b12('0xe'),_0x3b12('0xf')),'allowNull':![],'defaultValue':_0x3b12('0xe')},'sendMail':{'type':Sequelize[_0x3b12('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x3b12('0x2')]},'cc':{'type':Sequelize[_0x3b12('0x11')]},'bcc':{'type':Sequelize[_0x3b12('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x3b12('0x10')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc1ae=['sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','hours','minutes','days','csv','pdf','xlsx','custom'];(function(_0x46ee1c,_0x45a091){var _0x23d17b=function(_0x29348b){while(--_0x29348b){_0x46ee1c['push'](_0x46ee1c['shift']());}};_0x23d17b(++_0x45a091);}(_0xc1ae,0x156));var _0xec1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1ae[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xec1a('0x0'));module[_0xec1a('0x1')]={'name':{'type':Sequelize[_0xec1a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xec1a('0x2')]},'active':{'type':Sequelize[_0xec1a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xec1a('0x4')},'startAt':{'type':Sequelize[_0xec1a('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xec1a('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xec1a('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xec1a('0x7')](_0xec1a('0x8'),_0xec1a('0x9'),'months',_0xec1a('0xa'),'days',_0xec1a('0xb'),_0xec1a('0xc')),'allowNull':![],'defaultValue':_0xec1a('0xd')},'output':{'type':Sequelize['ENUM'](_0xec1a('0xe'),_0xec1a('0xf'),_0xec1a('0x10')),'allowNull':![],'defaultValue':_0xec1a('0xe')},'type':{'type':Sequelize[_0xec1a('0x7')](_0xec1a('0x11'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xec1a('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xec1a('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index eea41ea..67c2238 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 _0x0403=['Scheduler','sendStatus','name','index','map','Schedule','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','../../config/schedule','run','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0403,0x181));var _0x3040=function(_0x2a72d7,_0x58a845){_0x2a72d7=_0x2a72d7-0x0;var _0x5ceda7=_0x0403[_0x2a72d7];return _0x5ceda7;};'use strict';var emlformat=require(_0x3040('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3040('0x1'));var jsonpatch=require(_0x3040('0x2'));var rp=require('request-promise');var moment=require(_0x3040('0x3'));var BPromise=require(_0x3040('0x4'));var Mustache=require(_0x3040('0x5'));var util=require('util');var path=require(_0x3040('0x6'));var sox=require(_0x3040('0x7'));var csv=require(_0x3040('0x8'));var ejs=require(_0x3040('0x9'));var fs=require('fs');var fs_extra=require(_0x3040('0xa'));var _=require(_0x3040('0xb'));var squel=require(_0x3040('0xc'));var crypto=require(_0x3040('0xd'));var jsforce=require(_0x3040('0xe'));var deskjs=require(_0x3040('0xf'));var toCsv=require(_0x3040('0x8'));var querystring=require(_0x3040('0x10'));var Papa=require(_0x3040('0x11'));var Redis=require(_0x3040('0x12'));var authService=require(_0x3040('0x13'));var qs=require(_0x3040('0x14'));var as=require(_0x3040('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3040('0x16'))(_0x3040('0x17'));var utils=require(_0x3040('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3040('0x19'));var db=require(_0x3040('0x1a'))['db'];function respondWithStatusCode(_0x2f12d2,_0x5ef3f7){_0x5ef3f7=_0x5ef3f7||0xcc;return function(_0x54bab0){if(_0x54bab0){return _0x2f12d2['sendStatus'](_0x5ef3f7);}return _0x2f12d2[_0x3040('0x1b')](_0x5ef3f7)[_0x3040('0x1c')]();};}function respondWithResult(_0x578637,_0x146559){_0x146559=_0x146559||0xc8;return function(_0x115991){if(_0x115991){return _0x578637[_0x3040('0x1b')](_0x146559)[_0x3040('0x1d')](_0x115991);}};}function respondWithFilteredResult(_0x13387e,_0x459f86){return function(_0x535011){if(_0x535011){var _0x40f8e9=typeof _0x459f86[_0x3040('0x1e')]==='undefined'&&typeof _0x459f86[_0x3040('0x1f')]===_0x3040('0x20');var _0x4ccf9c=_0x535011[_0x3040('0x21')];var _0x8a59e=_0x40f8e9?0x0:_0x459f86[_0x3040('0x1e')];var _0xc30097=_0x40f8e9?_0x535011['count']:_0x459f86['offset']+_0x459f86['limit'];var _0x57a451;if(_0xc30097>=_0x4ccf9c){_0xc30097=_0x4ccf9c;_0x57a451=0xc8;}else{_0x57a451=0xce;}_0x13387e['status'](_0x57a451);return _0x13387e[_0x3040('0x22')](_0x3040('0x23'),_0x8a59e+'-'+_0xc30097+'/'+_0x4ccf9c)[_0x3040('0x1d')](_0x535011);}return null;};}function patchUpdates(_0x5903f8){return function(_0x1bd785){try{jsonpatch[_0x3040('0x24')](_0x1bd785,_0x5903f8,!![]);}catch(_0x5a8eab){return BPromise[_0x3040('0x25')](_0x5a8eab);}return _0x1bd785['save']();};}function saveUpdates(_0x4f90bd,_0x111e81){return function(_0x1f8d6e){if(_0x1f8d6e){return _0x1f8d6e['update'](_0x4f90bd)[_0x3040('0x26')](function(_0x214bf6){return _0x214bf6;});}return null;};}function removeEntity(_0x49fe64,_0x84ba8){return function(_0x546270){if(_0x546270){return _0x546270[_0x3040('0x27')]()['then'](function(){var _0x5d1410=_0x546270['get']({'plain':!![]});var _0x3caab4=_0x3040('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3caab4,'resourceId':_0x5d1410['id']}})[_0x3040('0x26')](function(){return _0x546270;});})[_0x3040('0x26')](function(){_0x49fe64[_0x3040('0x1b')](0xcc)[_0x3040('0x1c')]();});}};}function handleEntityNotFound(_0x260400,_0x21adb2){return function(_0x52e9b6){if(!_0x52e9b6){_0x260400[_0x3040('0x29')](0x194);}return _0x52e9b6;};}function handleError(_0x124160,_0x1fae9d){_0x1fae9d=_0x1fae9d||0x1f4;return function(_0xb3a9f8){logger['error'](_0xb3a9f8['stack']);if(_0xb3a9f8[_0x3040('0x2a')]){delete _0xb3a9f8[_0x3040('0x2a')];}_0x124160[_0x3040('0x1b')](_0x1fae9d)['send'](_0xb3a9f8);};}exports[_0x3040('0x2b')]=function(_0x52c854,_0x3526b5){var _0x20aa9e={},_0x511502={},_0x3356a2={'count':0x0,'rows':[]};var _0x520acb=_[_0x3040('0x2c')](db[_0x3040('0x2d')][_0x3040('0x2e')],function(_0x10df46){return{'name':_0x10df46[_0x3040('0x2f')],'type':_0x10df46['type']['key']};});_0x511502[_0x3040('0x30')]=_[_0x3040('0x2c')](_0x520acb,_0x3040('0x2a'));_0x511502[_0x3040('0x31')]=_[_0x3040('0x32')](_0x52c854[_0x3040('0x31')]);_0x511502[_0x3040('0x33')]=_[_0x3040('0x34')](_0x511502[_0x3040('0x30')],_0x511502[_0x3040('0x31')]);_0x20aa9e['attributes']=_[_0x3040('0x34')](_0x511502[_0x3040('0x30')],qs[_0x3040('0x35')](_0x52c854[_0x3040('0x31')][_0x3040('0x35')]));_0x20aa9e[_0x3040('0x36')]=_0x20aa9e[_0x3040('0x36')][_0x3040('0x37')]?_0x20aa9e[_0x3040('0x36')]:_0x511502[_0x3040('0x30')];if(!_0x52c854['query'][_0x3040('0x38')](_0x3040('0x39'))){_0x20aa9e[_0x3040('0x1f')]=qs[_0x3040('0x1f')](_0x52c854[_0x3040('0x31')][_0x3040('0x1f')]);_0x20aa9e[_0x3040('0x1e')]=qs['offset'](_0x52c854[_0x3040('0x31')][_0x3040('0x1e')]);}_0x20aa9e[_0x3040('0x3a')]=qs['sort'](_0x52c854['query'][_0x3040('0x3b')]);_0x20aa9e['where']=qs['filters'](_[_0x3040('0x3c')](_0x52c854[_0x3040('0x31')],_0x511502[_0x3040('0x33')]),_0x520acb);if(_0x52c854['query'][_0x3040('0x3d')]){_0x20aa9e[_0x3040('0x3e')]=_[_0x3040('0x3f')](_0x20aa9e[_0x3040('0x3e')],{'$or':_[_0x3040('0x2c')](_0x520acb,function(_0x28a2df){if(_0x28a2df['type']!=='VIRTUAL'){var _0x1850fc={};_0x1850fc[_0x28a2df[_0x3040('0x2a')]]={'$like':'%'+_0x52c854[_0x3040('0x31')]['filter']+'%'};return _0x1850fc;}})});}_0x20aa9e=_[_0x3040('0x3f')]({},_0x20aa9e,_0x52c854[_0x3040('0x40')]);var _0x77f580={'where':_0x20aa9e[_0x3040('0x3e')]};return db[_0x3040('0x2d')][_0x3040('0x21')](_0x77f580)[_0x3040('0x26')](function(_0x165cb6){_0x3356a2[_0x3040('0x21')]=_0x165cb6;if(_0x52c854[_0x3040('0x31')]['includeAll']){_0x20aa9e[_0x3040('0x41')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x20aa9e);})['then'](function(_0x3c2d54){_0x3356a2[_0x3040('0x42')]=_0x3c2d54;return _0x3356a2;})[_0x3040('0x26')](respondWithFilteredResult(_0x3526b5,_0x20aa9e))[_0x3040('0x43')](handleError(_0x3526b5,null));};exports[_0x3040('0x44')]=function(_0x324d29,_0xb02496){var _0x48cbea={'raw':![],'where':{'id':_0x324d29[_0x3040('0x45')]['id']}},_0x14c6ea={};_0x14c6ea[_0x3040('0x30')]=_['keys'](db[_0x3040('0x2d')][_0x3040('0x2e')]);_0x14c6ea[_0x3040('0x31')]=_[_0x3040('0x32')](_0x324d29[_0x3040('0x31')]);_0x14c6ea[_0x3040('0x33')]=_[_0x3040('0x34')](_0x14c6ea[_0x3040('0x30')],_0x14c6ea[_0x3040('0x31')]);_0x48cbea['attributes']=_[_0x3040('0x34')](_0x14c6ea['model'],qs['fields'](_0x324d29[_0x3040('0x31')][_0x3040('0x35')]));_0x48cbea['attributes']=_0x48cbea[_0x3040('0x36')]['length']?_0x48cbea['attributes']:_0x14c6ea[_0x3040('0x30')];if(_0x324d29[_0x3040('0x31')][_0x3040('0x46')]){_0x48cbea['include']=[{'all':!![]}];}_0x48cbea=_[_0x3040('0x3f')]({},_0x48cbea,_0x324d29['options']);return db['Schedule'][_0x3040('0x47')](_0x48cbea)[_0x3040('0x26')](handleEntityNotFound(_0xb02496,null))[_0x3040('0x26')](respondWithResult(_0xb02496,null))[_0x3040('0x43')](handleError(_0xb02496,null));};exports[_0x3040('0x48')]=function(_0x2a3e41,_0x2e5df7){return db['Schedule'][_0x3040('0x48')](_0x2a3e41['body'],{})[_0x3040('0x26')](function(_0xde1a29){var _0x405c18=_0x2a3e41[_0x3040('0x49')]['get']({'plain':!![]});if(!_0x405c18)throw new Error(_0x3040('0x4a'));if(_0x405c18[_0x3040('0x4b')]===_0x3040('0x49')){var _0x24d059=_0xde1a29[_0x3040('0x4c')]({'plain':!![]});var _0x2c5ff7=_0x3040('0x28');return db[_0x3040('0x4d')][_0x3040('0x47')]({'where':{'name':_0x2c5ff7,'userProfileId':_0x405c18['userProfileId']},'raw':!![]})['then'](function(_0x3627d4){if(_0x3627d4&&_0x3627d4[_0x3040('0x4e')]===0x0){return db[_0x3040('0x4f')][_0x3040('0x48')]({'name':_0x24d059[_0x3040('0x2a')],'resourceId':_0x24d059['id'],'type':_0x3627d4[_0x3040('0x2a')],'sectionId':_0x3627d4['id']},{})[_0x3040('0x26')](function(){return _0xde1a29;});}else{return _0xde1a29;}})[_0x3040('0x43')](function(_0x4cb5f4){logger['error'](_0x3040('0x50'),_0x4cb5f4);throw _0x4cb5f4;});}return _0xde1a29;})[_0x3040('0x26')](respondWithResult(_0x2e5df7,0xc9))[_0x3040('0x43')](handleError(_0x2e5df7,null));};exports[_0x3040('0x51')]=function(_0x29aff4,_0x428c28){if(_0x29aff4[_0x3040('0x52')]['id']){delete _0x29aff4['body']['id'];}return db['Schedule'][_0x3040('0x47')]({'where':{'id':_0x29aff4[_0x3040('0x45')]['id']}})[_0x3040('0x26')](handleEntityNotFound(_0x428c28,null))[_0x3040('0x26')](saveUpdates(_0x29aff4[_0x3040('0x52')],null))[_0x3040('0x26')](respondWithResult(_0x428c28,null))['catch'](handleError(_0x428c28,null));};exports[_0x3040('0x27')]=function(_0x563f8b,_0x3cab96){return db[_0x3040('0x2d')][_0x3040('0x47')]({'where':{'id':_0x563f8b[_0x3040('0x45')]['id']}})[_0x3040('0x26')](handleEntityNotFound(_0x3cab96,null))['then'](removeEntity(_0x3cab96,null))['catch'](handleError(_0x3cab96,null));};exports['run']=function(_0x24ae9c,_0x3b7da7,_0x38d830){var _0x3c852a=require(_0x3040('0x53'));return db[_0x3040('0x2d')]['find']({'where':{'id':_0x24ae9c[_0x3040('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b7da7,null))[_0x3040('0x26')](function(){_0x3c852a[_0x3040('0x54')](_0x24ae9c['params']['id']);})[_0x3040('0x26')](respondWithStatusCode(_0x3b7da7,null))[_0x3040('0x43')](handleError(_0x3b7da7,null));}; \ No newline at end of file +var _0x4613=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Schedule','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','rawAttributes','find','create','body','user','get','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4613,0xc8));var _0x3461=function(_0x2005f6,_0x29b28c){_0x2005f6=_0x2005f6-0x0;var _0xf0bd90=_0x4613[_0x2005f6];return _0xf0bd90;};'use strict';var emlformat=require(_0x3461('0x0'));var rimraf=require(_0x3461('0x1'));var zipdir=require(_0x3461('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3461('0x3'));var moment=require('moment');var BPromise=require(_0x3461('0x4'));var Mustache=require('mustache');var util=require(_0x3461('0x5'));var path=require(_0x3461('0x6'));var sox=require(_0x3461('0x7'));var csv=require('to-csv');var ejs=require(_0x3461('0x8'));var fs=require('fs');var fs_extra=require(_0x3461('0x9'));var _=require(_0x3461('0xa'));var squel=require('squel');var crypto=require(_0x3461('0xb'));var jsforce=require(_0x3461('0xc'));var deskjs=require(_0x3461('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3461('0xe'));var Papa=require('papaparse');var Redis=require(_0x3461('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3461('0x10'));var hardwareService=require(_0x3461('0x11'));var logger=require(_0x3461('0x12'))(_0x3461('0x13'));var utils=require(_0x3461('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3461('0x15'))['db'];function respondWithStatusCode(_0x169bd1,_0x460ebf){_0x460ebf=_0x460ebf||0xcc;return function(_0x2f086e){if(_0x2f086e){return _0x169bd1[_0x3461('0x16')](_0x460ebf);}return _0x169bd1[_0x3461('0x17')](_0x460ebf)[_0x3461('0x18')]();};}function respondWithResult(_0x4868c6,_0x34445f){_0x34445f=_0x34445f||0xc8;return function(_0x574ed3){if(_0x574ed3){return _0x4868c6[_0x3461('0x17')](_0x34445f)['json'](_0x574ed3);}};}function respondWithFilteredResult(_0x44285c,_0x80200b){return function(_0x571ac7){if(_0x571ac7){var _0x292e7b=typeof _0x80200b[_0x3461('0x19')]===_0x3461('0x1a')&&typeof _0x80200b[_0x3461('0x1b')]===_0x3461('0x1a');var _0x2eb76c=_0x571ac7['count'];var _0x435814=_0x292e7b?0x0:_0x80200b[_0x3461('0x19')];var _0x147e3e=_0x292e7b?_0x571ac7[_0x3461('0x1c')]:_0x80200b[_0x3461('0x19')]+_0x80200b[_0x3461('0x1b')];var _0x349959;if(_0x147e3e>=_0x2eb76c){_0x147e3e=_0x2eb76c;_0x349959=0xc8;}else{_0x349959=0xce;}_0x44285c[_0x3461('0x17')](_0x349959);return _0x44285c['set'](_0x3461('0x1d'),_0x435814+'-'+_0x147e3e+'/'+_0x2eb76c)['json'](_0x571ac7);}return null;};}function patchUpdates(_0x320997){return function(_0x35fbd9){try{jsonpatch[_0x3461('0x1e')](_0x35fbd9,_0x320997,!![]);}catch(_0x1c4813){return BPromise[_0x3461('0x1f')](_0x1c4813);}return _0x35fbd9[_0x3461('0x20')]();};}function saveUpdates(_0x376392,_0x2891af){return function(_0x4491f2){if(_0x4491f2){return _0x4491f2[_0x3461('0x21')](_0x376392)[_0x3461('0x22')](function(_0x1edbe1){return _0x1edbe1;});}return null;};}function removeEntity(_0x763c06,_0x32f7aa){return function(_0x452ad6){if(_0x452ad6){return _0x452ad6[_0x3461('0x23')]()[_0x3461('0x22')](function(){var _0xa8016e=_0x452ad6['get']({'plain':!![]});var _0x4bdac5='Scheduler';return db['UserProfileResource'][_0x3461('0x23')]({'where':{'type':_0x4bdac5,'resourceId':_0xa8016e['id']}})['then'](function(){return _0x452ad6;});})[_0x3461('0x22')](function(){_0x763c06[_0x3461('0x17')](0xcc)[_0x3461('0x18')]();});}};}function handleEntityNotFound(_0x551a3c,_0x251656){return function(_0x5eb6b3){if(!_0x5eb6b3){_0x551a3c['sendStatus'](0x194);}return _0x5eb6b3;};}function handleError(_0x3fc830,_0x47c479){_0x47c479=_0x47c479||0x1f4;return function(_0x37bb3f){logger[_0x3461('0x24')](_0x37bb3f['stack']);if(_0x37bb3f[_0x3461('0x25')]){delete _0x37bb3f['name'];}_0x3fc830[_0x3461('0x17')](_0x47c479)['send'](_0x37bb3f);};}exports[_0x3461('0x26')]=function(_0x3641d5,_0x334a7d){var _0x5ac932={},_0x2f3edb={},_0x2b0335={'count':0x0,'rows':[]};var _0x5486d0=_[_0x3461('0x27')](db[_0x3461('0x28')]['rawAttributes'],function(_0x2dcb57){return{'name':_0x2dcb57['fieldName'],'type':_0x2dcb57[_0x3461('0x29')]['key']};});_0x2f3edb[_0x3461('0x2a')]=_[_0x3461('0x27')](_0x5486d0,_0x3461('0x25'));_0x2f3edb[_0x3461('0x2b')]=_[_0x3461('0x2c')](_0x3641d5[_0x3461('0x2b')]);_0x2f3edb[_0x3461('0x2d')]=_[_0x3461('0x2e')](_0x2f3edb[_0x3461('0x2a')],_0x2f3edb['query']);_0x5ac932[_0x3461('0x2f')]=_[_0x3461('0x2e')](_0x2f3edb['model'],qs['fields'](_0x3641d5[_0x3461('0x2b')]['fields']));_0x5ac932[_0x3461('0x2f')]=_0x5ac932[_0x3461('0x2f')][_0x3461('0x30')]?_0x5ac932[_0x3461('0x2f')]:_0x2f3edb[_0x3461('0x2a')];if(!_0x3641d5['query']['hasOwnProperty'](_0x3461('0x31'))){_0x5ac932[_0x3461('0x1b')]=qs['limit'](_0x3641d5[_0x3461('0x2b')][_0x3461('0x1b')]);_0x5ac932[_0x3461('0x19')]=qs[_0x3461('0x19')](_0x3641d5[_0x3461('0x2b')][_0x3461('0x19')]);}_0x5ac932[_0x3461('0x32')]=qs[_0x3461('0x33')](_0x3641d5['query']['sort']);_0x5ac932[_0x3461('0x34')]=qs[_0x3461('0x2d')](_[_0x3461('0x35')](_0x3641d5['query'],_0x2f3edb[_0x3461('0x2d')]),_0x5486d0);if(_0x3641d5[_0x3461('0x2b')][_0x3461('0x36')]){_0x5ac932['where']=_['merge'](_0x5ac932[_0x3461('0x34')],{'$or':_[_0x3461('0x27')](_0x5486d0,function(_0x1c2c14){if(_0x1c2c14['type']!==_0x3461('0x37')){var _0x541de1={};_0x541de1[_0x1c2c14[_0x3461('0x25')]]={'$like':'%'+_0x3641d5[_0x3461('0x2b')][_0x3461('0x36')]+'%'};return _0x541de1;}})});}_0x5ac932=_[_0x3461('0x38')]({},_0x5ac932,_0x3641d5[_0x3461('0x39')]);var _0x534b60={'where':_0x5ac932[_0x3461('0x34')]};return db[_0x3461('0x28')][_0x3461('0x1c')](_0x534b60)[_0x3461('0x22')](function(_0x4ffd6c){_0x2b0335[_0x3461('0x1c')]=_0x4ffd6c;if(_0x3641d5[_0x3461('0x2b')]['includeAll']){_0x5ac932['include']=[{'all':!![]}];}return db['Schedule'][_0x3461('0x3a')](_0x5ac932);})['then'](function(_0x1f40eb){_0x2b0335[_0x3461('0x3b')]=_0x1f40eb;return _0x2b0335;})[_0x3461('0x22')](respondWithFilteredResult(_0x334a7d,_0x5ac932))[_0x3461('0x3c')](handleError(_0x334a7d,null));};exports['show']=function(_0x4e4982,_0x3e8daf){var _0x417b35={'raw':![],'where':{'id':_0x4e4982[_0x3461('0x3d')]['id']}},_0x2e994e={};_0x2e994e[_0x3461('0x2a')]=_['keys'](db['Schedule'][_0x3461('0x3e')]);_0x2e994e[_0x3461('0x2b')]=_[_0x3461('0x2c')](_0x4e4982['query']);_0x2e994e[_0x3461('0x2d')]=_[_0x3461('0x2e')](_0x2e994e[_0x3461('0x2a')],_0x2e994e[_0x3461('0x2b')]);_0x417b35['attributes']=_[_0x3461('0x2e')](_0x2e994e[_0x3461('0x2a')],qs['fields'](_0x4e4982['query']['fields']));_0x417b35[_0x3461('0x2f')]=_0x417b35[_0x3461('0x2f')][_0x3461('0x30')]?_0x417b35['attributes']:_0x2e994e[_0x3461('0x2a')];if(_0x4e4982[_0x3461('0x2b')]['includeAll']){_0x417b35['include']=[{'all':!![]}];}_0x417b35=_['merge']({},_0x417b35,_0x4e4982['options']);return db[_0x3461('0x28')][_0x3461('0x3f')](_0x417b35)[_0x3461('0x22')](handleEntityNotFound(_0x3e8daf,null))[_0x3461('0x22')](respondWithResult(_0x3e8daf,null))[_0x3461('0x3c')](handleError(_0x3e8daf,null));};exports['create']=function(_0x43bfe8,_0x5ea50d){return db['Schedule'][_0x3461('0x40')](_0x43bfe8[_0x3461('0x41')],{})[_0x3461('0x22')](function(_0x439a1a){var _0x25e9db=_0x43bfe8[_0x3461('0x42')][_0x3461('0x43')]({'plain':!![]});if(!_0x25e9db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25e9db[_0x3461('0x44')]===_0x3461('0x42')){var _0x2ef5c8=_0x439a1a[_0x3461('0x43')]({'plain':!![]});var _0x515051='Scheduler';return db['UserProfileSection'][_0x3461('0x3f')]({'where':{'name':_0x515051,'userProfileId':_0x25e9db[_0x3461('0x45')]},'raw':!![]})[_0x3461('0x22')](function(_0x5419d1){if(_0x5419d1&&_0x5419d1['autoAssociation']===0x0){return db[_0x3461('0x46')][_0x3461('0x40')]({'name':_0x2ef5c8[_0x3461('0x25')],'resourceId':_0x2ef5c8['id'],'type':_0x5419d1['name'],'sectionId':_0x5419d1['id']},{})[_0x3461('0x22')](function(){return _0x439a1a;});}else{return _0x439a1a;}})[_0x3461('0x3c')](function(_0x2a4806){logger['error'](_0x3461('0x47'),_0x2a4806);throw _0x2a4806;});}return _0x439a1a;})[_0x3461('0x22')](respondWithResult(_0x5ea50d,0xc9))[_0x3461('0x3c')](handleError(_0x5ea50d,null));};exports[_0x3461('0x21')]=function(_0x37a214,_0x2fcc58){if(_0x37a214[_0x3461('0x41')]['id']){delete _0x37a214[_0x3461('0x41')]['id'];}return db[_0x3461('0x28')][_0x3461('0x3f')]({'where':{'id':_0x37a214[_0x3461('0x3d')]['id']}})[_0x3461('0x22')](handleEntityNotFound(_0x2fcc58,null))[_0x3461('0x22')](saveUpdates(_0x37a214[_0x3461('0x41')],null))[_0x3461('0x22')](respondWithResult(_0x2fcc58,null))[_0x3461('0x3c')](handleError(_0x2fcc58,null));};exports[_0x3461('0x23')]=function(_0x7c4fc2,_0x314788){return db['Schedule'][_0x3461('0x3f')]({'where':{'id':_0x7c4fc2[_0x3461('0x3d')]['id']}})[_0x3461('0x22')](handleEntityNotFound(_0x314788,null))[_0x3461('0x22')](removeEntity(_0x314788,null))['catch'](handleError(_0x314788,null));};exports[_0x3461('0x48')]=function(_0x26e61a,_0x4501a7,_0x281888){var _0x256902=require(_0x3461('0x49'));return db['Schedule'][_0x3461('0x3f')]({'where':{'id':_0x26e61a[_0x3461('0x3d')]['id']},'raw':!![]})[_0x3461('0x22')](handleEntityNotFound(_0x4501a7,null))[_0x3461('0x22')](function(){_0x256902[_0x3461('0x48')](_0x26e61a[_0x3461('0x3d')]['id']);})[_0x3461('0x22')](respondWithStatusCode(_0x4501a7,null))[_0x3461('0x3c')](handleError(_0x4501a7,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index bfc7f46..28e8e54 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 _0xfaed=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','moment','request-promise'];(function(_0x659ddb,_0x5b2484){var _0x27e930=function(_0x4badce){while(--_0x4badce){_0x659ddb['push'](_0x659ddb['shift']());}};_0x27e930(++_0x5b2484);}(_0xfaed,0x1e8));var _0xdfae=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xfaed[_0x836465];return _0x2150ea;};'use strict';var _=require(_0xdfae('0x0'));var util=require(_0xdfae('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdfae('0x2'));var BPromise=require('bluebird');var rp=require(_0xdfae('0x3'));var fs=require('fs');var path=require(_0xdfae('0x4'));var rimraf=require(_0xdfae('0x5'));var config=require(_0xdfae('0x6'));var attributes=require(_0xdfae('0x7'));module[_0xdfae('0x8')]=function(_0x47f2da,_0x85c8aa){return _0x47f2da[_0xdfae('0x9')](_0xdfae('0xa'),attributes,{'tableName':_0xdfae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b2c=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment'];(function(_0x40ed82,_0xf76860){var _0xa6dbd8=function(_0xfe550b){while(--_0xfe550b){_0x40ed82['push'](_0x40ed82['shift']());}};_0xa6dbd8(++_0xf76860);}(_0x2b2c,0x154));var _0xc2b2=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2b2c[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xc2b2('0x0'));var util=require(_0xc2b2('0x1'));var logger=require(_0xc2b2('0x2'))(_0xc2b2('0x3'));var moment=require(_0xc2b2('0x4'));var BPromise=require(_0xc2b2('0x5'));var rp=require(_0xc2b2('0x6'));var fs=require('fs');var path=require(_0xc2b2('0x7'));var rimraf=require(_0xc2b2('0x8'));var config=require(_0xc2b2('0x9'));var attributes=require(_0xc2b2('0xa'));module[_0xc2b2('0xb')]=function(_0x44cfb2,_0x947780){return _0x44cfb2[_0xc2b2('0xc')](_0xc2b2('0xd'),attributes,{'tableName':_0xc2b2('0xe'),'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 4ab4312..e159e2e 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 _0xc52f=['../../config/environment','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1b596f,_0x1d0814){var _0x48c840=function(_0x257118){while(--_0x257118){_0x1b596f['push'](_0x1b596f['shift']());}};_0x48c840(++_0x1d0814);}(_0xc52f,0x1c5));var _0xfc52=function(_0x6e5e3b,_0x5ac1c9){_0x6e5e3b=_0x6e5e3b-0x0;var _0x3b5eb9=_0xc52f[_0x6e5e3b];return _0x3b5eb9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc52('0x0'));var BPromise=require(_0xfc52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc52('0x2'));var db=require(_0xfc52('0x3'))['db'];var utils=require(_0xfc52('0x4'));var logger=require(_0xfc52('0x5'))(_0xfc52('0x6'));var config=require(_0xfc52('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfc52('0x8')][_0xfc52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbc6e3d,_0x551f2a,_0x3f66d5){return new BPromise(function(_0x394850,_0x47b2c1){return client[_0xfc52('0xa')](_0xbc6e3d,_0x3f66d5)[_0xfc52('0xb')](function(_0x3119bc){logger['info'](_0xfc52('0xc'),_0x551f2a,_0xfc52('0xd'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x551f2a,_0xfc52('0xd'),JSON['stringify'](_0x3119bc));if(_0x3119bc[_0xfc52('0xe')]){if(_0x3119bc[_0xfc52('0xe')][_0xfc52('0xf')]===0x1f4){logger['error'](_0xfc52('0xc'),_0x551f2a,_0x3119bc['error'][_0xfc52('0x10')]);return _0x47b2c1(_0x3119bc[_0xfc52('0xe')][_0xfc52('0x10')]);}logger[_0xfc52('0xe')]('Schedule,\x20%s,\x20%s',_0x551f2a,_0x3119bc[_0xfc52('0xe')]['message']);return _0x394850(_0x3119bc[_0xfc52('0xe')][_0xfc52('0x10')]);}else{logger[_0xfc52('0x11')](_0xfc52('0xc'),_0x551f2a,_0xfc52('0xd'));_0x394850(_0x3119bc[_0xfc52('0x12')][_0xfc52('0x10')]);}})[_0xfc52('0x13')](function(_0x1024c2){logger[_0xfc52('0xe')](_0xfc52('0xc'),_0x551f2a,_0x1024c2);_0x47b2c1(_0x1024c2);});});} \ No newline at end of file +var _0xcf10=['request\x20sent','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x3a8cab,_0x375ef7){var _0x2be7ad=function(_0x4a1164){while(--_0x4a1164){_0x3a8cab['push'](_0x3a8cab['shift']());}};_0x2be7ad(++_0x375ef7);}(_0xcf10,0xc0));var _0x0cf1=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0xcf10[_0x5a2285];return _0x48f6ed;};'use strict';var _=require(_0x0cf1('0x0'));var util=require(_0x0cf1('0x1'));var moment=require(_0x0cf1('0x2'));var BPromise=require(_0x0cf1('0x3'));var rs=require(_0x0cf1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cf1('0x5'))['db'];var utils=require(_0x0cf1('0x6'));var logger=require(_0x0cf1('0x7'))('rpc');var config=require(_0x0cf1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0cf1('0x9')][_0x0cf1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f5609,_0x45bff9,_0x51f3ff){return new BPromise(function(_0x257147,_0x3bac4a){return client[_0x0cf1('0xb')](_0x3f5609,_0x51f3ff)[_0x0cf1('0xc')](function(_0x4867b9){logger[_0x0cf1('0xd')]('Schedule,\x20%s,\x20%s',_0x45bff9,'request\x20sent');logger['debug'](_0x0cf1('0xe'),_0x45bff9,_0x0cf1('0xf'),JSON[_0x0cf1('0x10')](_0x4867b9));if(_0x4867b9[_0x0cf1('0x11')]){if(_0x4867b9[_0x0cf1('0x11')][_0x0cf1('0x12')]===0x1f4){logger[_0x0cf1('0x11')](_0x0cf1('0x13'),_0x45bff9,_0x4867b9[_0x0cf1('0x11')][_0x0cf1('0x14')]);return _0x3bac4a(_0x4867b9[_0x0cf1('0x11')][_0x0cf1('0x14')]);}logger[_0x0cf1('0x11')](_0x0cf1('0x13'),_0x45bff9,_0x4867b9[_0x0cf1('0x11')][_0x0cf1('0x14')]);return _0x257147(_0x4867b9['error']['message']);}else{logger['info'](_0x0cf1('0x13'),_0x45bff9,'request\x20sent');_0x257147(_0x4867b9[_0x0cf1('0x15')][_0x0cf1('0x14')]);}})[_0x0cf1('0x16')](function(_0x29aa9b){logger['error']('Schedule,\x20%s,\x20%s',_0x45bff9,_0x29aa9b);_0x3bac4a(_0x29aa9b);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index a17d6d6..18b6b24 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 _0xd315=['util','path','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x452baa,_0x5efb8d){var _0x3009ae=function(_0x44db61){while(--_0x44db61){_0x452baa['push'](_0x452baa['shift']());}};_0x3009ae(++_0x5efb8d);}(_0xd315,0x179));var _0x5d31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd315[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5d31('0x0'));var util=require(_0x5d31('0x1'));var path=require(_0x5d31('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d31('0x3'));var router=express[_0x5d31('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d31('0x5'));var config=require(_0x5d31('0x6'));var controller=require(_0x5d31('0x7'));router[_0x5d31('0x8')]('/',auth[_0x5d31('0x9')](),controller[_0x5d31('0xa')]);router[_0x5d31('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5d31('0x8')](_0x5d31('0xb'),auth['isAuthenticated'](),controller[_0x5d31('0xc')]);router[_0x5d31('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x5d31('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5d31('0xe')](_0x5d31('0xb'),auth[_0x5d31('0x9')](),controller[_0x5d31('0xf')]);router[_0x5d31('0x10')](_0x5d31('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5d31('0x11')]=router; \ No newline at end of file +var _0x9cda=['index','/describe','describe','show','/:id/download','post','create','put','update','delete','/:id','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x210a36,_0x4f26d0){var _0x469407=function(_0x47067e){while(--_0x47067e){_0x210a36['push'](_0x210a36['shift']());}};_0x469407(++_0x4f26d0);}(_0x9cda,0x199));var _0xa9cd=function(_0x1b5754,_0x1945e0){_0x1b5754=_0x1b5754-0x0;var _0x2f4134=_0x9cda[_0x1b5754];return _0x2f4134;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa9cd('0x0'));var express=require(_0xa9cd('0x1'));var router=express[_0xa9cd('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa9cd('0x3'));var interaction=require(_0xa9cd('0x4'));var config=require(_0xa9cd('0x5'));var controller=require(_0xa9cd('0x6'));router[_0xa9cd('0x7')]('/',auth[_0xa9cd('0x8')](),controller[_0xa9cd('0x9')]);router['get'](_0xa9cd('0xa'),auth[_0xa9cd('0x8')](),controller[_0xa9cd('0xb')]);router[_0xa9cd('0x7')]('/:id',auth[_0xa9cd('0x8')](),controller[_0xa9cd('0xc')]);router[_0xa9cd('0x7')](_0xa9cd('0xd'),auth[_0xa9cd('0x8')](),controller['download']);router[_0xa9cd('0xe')]('/',auth[_0xa9cd('0x8')](),controller[_0xa9cd('0xf')]);router[_0xa9cd('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa9cd('0x11')]);router[_0xa9cd('0x12')](_0xa9cd('0x13'),auth[_0xa9cd('0x8')](),controller[_0xa9cd('0x14')]);module[_0xa9cd('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 80097fb..424aeb0 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 _0x215d=['INTEGER','startedAt','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x215d,0x187));var _0xd215=function(_0x345156,_0xd6f37d){_0x345156=_0x345156-0x0;var _0x42ac01=_0x215d[_0x345156];return _0x42ac01;};'use strict';var Sequelize=require(_0xd215('0x0'));var moment=require('moment');var path=require(_0xd215('0x1'));var config=require(_0xd215('0x2'));module[_0xd215('0x3')]={'format':{'type':Sequelize[_0xd215('0x4')],'get':function(){return this[_0xd215('0x5')](_0xd215('0x6'))?path['extname'](this[_0xd215('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xd215('0x7')]},'channel':{'type':Sequelize[_0xd215('0x7')]},'value':{'type':Sequelize[_0xd215('0x7')],'set':function(_0x5a6d12){var _0xc5d7fe=_0x5a6d12['replace'](/\\/g,'/');this[_0xd215('0x8')](_0xd215('0x6'),_0xc5d7fe);}},'rating':{'type':Sequelize[_0xd215('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x184b3f){this[_0xd215('0x8')](_0xd215('0xa'),moment()[_0xd215('0xb')](_0x184b3f,'ms'));this[_0xd215('0x8')]('closedAt',moment());this[_0xd215('0x8')](_0xd215('0xc'),_0x184b3f);}},'startedAt':{'type':Sequelize[_0xd215('0xd')],'get':function(){return moment(this['getDataValue'](_0xd215('0xa')))[_0xd215('0xe')](_0xd215('0xf'))[_0xd215('0x10')]();}},'closedAt':{'type':Sequelize[_0xd215('0xd')],'get':function(){return moment(this['getDataValue'](_0xd215('0x11')))[_0xd215('0xe')](_0xd215('0xf'))[_0xd215('0x10')]();}},'createdAt':{'type':Sequelize[_0xd215('0xd')],'get':function(){return moment(this[_0xd215('0x5')](_0xd215('0x12')))[_0xd215('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xd215('0x10')]();}},'updatedAt':{'type':Sequelize[_0xd215('0xd')],'get':function(){return moment(this[_0xd215('0x5')](_0xd215('0x13')))[_0xd215('0xe')](_0xd215('0xf'))[_0xd215('0x10')]();}}}; \ No newline at end of file +var _0x253d=['toString','sequelize','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','duration','DATE','startedAt','format','closedAt'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x253d,0x1b3));var _0xd253=function(_0x29ccfa,_0x35fe38){_0x29ccfa=_0x29ccfa-0x0;var _0x176e11=_0x253d[_0x29ccfa];return _0x176e11;};'use strict';var Sequelize=require(_0xd253('0x0'));var moment=require('moment');var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0xd253('0x1')],'get':function(){return this[_0xd253('0x2')](_0xd253('0x3'))?path[_0xd253('0x4')](this[_0xd253('0x2')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xd253('0x5')]},'channel':{'type':Sequelize[_0xd253('0x5')]},'value':{'type':Sequelize[_0xd253('0x5')],'set':function(_0x17589a){var _0xf4b457=_0x17589a['replace'](/\\/g,'/');this[_0xd253('0x6')](_0xd253('0x3'),_0xf4b457);}},'rating':{'type':Sequelize[_0xd253('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd253('0x7')],'set':function(_0x351047){this[_0xd253('0x6')]('startedAt',moment()['subtract'](_0x351047,'ms'));this[_0xd253('0x6')]('closedAt',moment());this[_0xd253('0x6')](_0xd253('0x8'),_0x351047);}},'startedAt':{'type':Sequelize[_0xd253('0x9')],'get':function(){return moment(this[_0xd253('0x2')](_0xd253('0xa')))[_0xd253('0xb')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0xd253('0x9')],'get':function(){return moment(this[_0xd253('0x2')](_0xd253('0xc')))['format']('MM-DD-YYYY\x20HH:mm')[_0xd253('0xd')]();}},'createdAt':{'type':Sequelize[_0xd253('0x9')],'get':function(){return moment(this[_0xd253('0x2')]('createdAt'))[_0xd253('0xb')]('MM-DD-YYYY\x20HH:mm')[_0xd253('0xd')]();}},'updatedAt':{'type':Sequelize[_0xd253('0x9')],'get':function(){return moment(this[_0xd253('0x2')]('updatedAt'))[_0xd253('0xb')]('MM-DD-YYYY\x20HH:mm')[_0xd253('0xd')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 631ad7a..d81098e 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 _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x19a9b5,_0x198382){var _0x632733=function(_0x2b4f07){while(--_0x2b4f07){_0x19a9b5['push'](_0x19a9b5['shift']());}};_0x632733(++_0x198382);}(_0x5fd1,0x155));var _0x15fd=function(_0x1ee562,_0x1bf814){_0x1ee562=_0x1ee562-0x0;var _0x3b74cb=_0x5fd1[_0x1ee562];return _0x3b74cb;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));}; \ No newline at end of file +var _0xac31=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','then','includeAll','findAll','rows','catch','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0xac31,0xca));var _0x1ac3=function(_0x508dea,_0xdef1c8){_0x508dea=_0x508dea-0x0;var _0x48b675=_0xac31[_0x508dea];return _0x48b675;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];function respondWithStatusCode(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xcc;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0x1a')](_0x2338b9);}return _0x2eeabf[_0x1ac3('0x1b')](_0x2338b9)[_0x1ac3('0x1c')]();};}function respondWithResult(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0xc8;return function(_0x24bb5e){if(_0x24bb5e){return _0x2def9f[_0x1ac3('0x1b')](_0x53cc35)['json'](_0x24bb5e);}};}function respondWithFilteredResult(_0x29a7b3,_0x1f9641){return function(_0x38b52a){if(_0x38b52a){var _0x51f1e4=typeof _0x1f9641[_0x1ac3('0x1d')]===_0x1ac3('0x1e')&&typeof _0x1f9641[_0x1ac3('0x1f')]==='undefined';var _0x195683=_0x38b52a['count'];var _0x291616=_0x51f1e4?0x0:_0x1f9641[_0x1ac3('0x1d')];var _0x20091d=_0x51f1e4?_0x38b52a[_0x1ac3('0x20')]:_0x1f9641[_0x1ac3('0x1d')]+_0x1f9641['limit'];var _0x136e73;if(_0x20091d>=_0x195683){_0x20091d=_0x195683;_0x136e73=0xc8;}else{_0x136e73=0xce;}_0x29a7b3[_0x1ac3('0x1b')](_0x136e73);return _0x29a7b3[_0x1ac3('0x21')](_0x1ac3('0x22'),_0x291616+'-'+_0x20091d+'/'+_0x195683)['json'](_0x38b52a);}return null;};}function patchUpdates(_0x48d18a){return function(_0x2879d8){try{jsonpatch[_0x1ac3('0x23')](_0x2879d8,_0x48d18a,!![]);}catch(_0x14070b){return BPromise[_0x1ac3('0x24')](_0x14070b);}return _0x2879d8[_0x1ac3('0x25')]();};}function saveUpdates(_0x319988,_0x23b767){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x1ac3('0x26')](_0x319988)['then'](function(_0x1e277f){return _0x1e277f;});}return null;};}function removeEntity(_0x231b7f,_0x4b19f2){return function(_0x2b5182){if(_0x2b5182){return _0x2b5182[_0x1ac3('0x27')]()['then'](function(){_0x231b7f[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();});}};}function handleEntityNotFound(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(!_0x10db3d){_0x145486['sendStatus'](0x194);}return _0x10db3d;};}function handleError(_0x5a2ab2,_0x503a64){_0x503a64=_0x503a64||0x1f4;return function(_0x528807){logger['error'](_0x528807[_0x1ac3('0x28')]);if(_0x528807['name']){delete _0x528807[_0x1ac3('0x29')];}_0x5a2ab2[_0x1ac3('0x1b')](_0x503a64)[_0x1ac3('0x2a')](_0x528807);};}exports[_0x1ac3('0x2b')]=function(_0x4b3d3c,_0x61441d){var _0x541da0={},_0x2ddd73={},_0x4000b0={'count':0x0,'rows':[]};var _0x440aed=_[_0x1ac3('0x2c')](db[_0x1ac3('0x2d')][_0x1ac3('0x2e')],function(_0x9c17c2){return{'name':_0x9c17c2['fieldName'],'type':_0x9c17c2[_0x1ac3('0x2f')][_0x1ac3('0x30')]};});_0x2ddd73[_0x1ac3('0x31')]=_[_0x1ac3('0x32')](_['map'](_0x440aed,_0x1ac3('0x29')),[_0x1ac3('0x33')]);_0x2ddd73[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x34')]);_0x2ddd73['filters']=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],_0x2ddd73[_0x1ac3('0x34')]);_0x541da0[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],qs['fields'](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x541da0[_0x1ac3('0x37')]=_0x541da0[_0x1ac3('0x37')]['length']?_0x541da0[_0x1ac3('0x37')]:_0x2ddd73[_0x1ac3('0x31')];if(!_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x39')](_0x1ac3('0x3a'))){_0x541da0[_0x1ac3('0x1f')]=qs[_0x1ac3('0x1f')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x1f')]);_0x541da0['offset']=qs[_0x1ac3('0x1d')](_0x4b3d3c[_0x1ac3('0x34')]['offset']);}_0x541da0[_0x1ac3('0x3b')]=qs[_0x1ac3('0x3c')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x3c')]);_0x541da0[_0x1ac3('0x3d')]=qs[_0x1ac3('0x3e')](_[_0x1ac3('0x3f')](_0x4b3d3c[_0x1ac3('0x34')],_0x2ddd73['filters']),_0x440aed);if(_0x4b3d3c[_0x1ac3('0x34')]['filter']){_0x541da0[_0x1ac3('0x3d')]=_[_0x1ac3('0x40')](_0x541da0[_0x1ac3('0x3d')],{'$or':_[_0x1ac3('0x2c')](_0x440aed,function(_0x3141ae){if(_0x3141ae[_0x1ac3('0x2f')]!=='VIRTUAL'){var _0x3b5c1c={};_0x3b5c1c[_0x3141ae[_0x1ac3('0x29')]]={'$like':'%'+_0x4b3d3c[_0x1ac3('0x34')]['filter']+'%'};return _0x3b5c1c;}})});}_0x541da0=_[_0x1ac3('0x40')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x41')]);var _0x5cec6b={'where':_0x541da0[_0x1ac3('0x3d')]};return db[_0x1ac3('0x2d')][_0x1ac3('0x20')](_0x5cec6b)[_0x1ac3('0x42')](function(_0x466a45){_0x4000b0[_0x1ac3('0x20')]=_0x466a45;if(_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x541da0['include']=[{'all':!![]}];}return db[_0x1ac3('0x2d')][_0x1ac3('0x44')](_0x541da0);})[_0x1ac3('0x42')](function(_0x254a77){_0x4000b0[_0x1ac3('0x45')]=_0x254a77;return _0x4000b0;})[_0x1ac3('0x42')](respondWithFilteredResult(_0x61441d,_0x541da0))[_0x1ac3('0x46')](handleError(_0x61441d,null));};exports['show']=function(_0x4edc4d,_0x2c2099){var _0x3f60ca={'raw':![],'where':{'id':_0x4edc4d[_0x1ac3('0x47')]['id']}},_0x4972d1={};_0x4972d1[_0x1ac3('0x31')]=_['keys'](db[_0x1ac3('0x2d')]['rawAttributes']);_0x4972d1[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4edc4d[_0x1ac3('0x34')]);_0x4972d1[_0x1ac3('0x3e')]=_['intersection'](_0x4972d1[_0x1ac3('0x31')],_0x4972d1[_0x1ac3('0x34')]);_0x3f60ca[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x4972d1[_0x1ac3('0x31')],qs['fields'](_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x3f60ca[_0x1ac3('0x37')]=_0x3f60ca[_0x1ac3('0x37')]['length']?_0x3f60ca[_0x1ac3('0x37')]:_0x4972d1[_0x1ac3('0x31')];if(_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x3f60ca['include']=[{'all':!![]}];}_0x3f60ca=_[_0x1ac3('0x40')]({},_0x3f60ca,_0x4edc4d[_0x1ac3('0x41')]);return db[_0x1ac3('0x2d')][_0x1ac3('0x48')](_0x3f60ca)['then'](handleEntityNotFound(_0x2c2099,null))[_0x1ac3('0x42')](respondWithResult(_0x2c2099,null))['catch'](handleError(_0x2c2099,null));};exports[_0x1ac3('0x49')]=function(_0x10bcaf,_0x2e3347){return db[_0x1ac3('0x2d')][_0x1ac3('0x49')](_0x10bcaf[_0x1ac3('0x4a')],{})[_0x1ac3('0x42')](respondWithResult(_0x2e3347,0xc9))['catch'](handleError(_0x2e3347,null));};exports['update']=function(_0xe8f33c,_0x249c2d){if(_0xe8f33c[_0x1ac3('0x4a')]['id']){delete _0xe8f33c['body']['id'];}delete _0xe8f33c['body']['duration'];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4b')];delete _0xe8f33c['body'][_0x1ac3('0x4c')];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4d')];return db[_0x1ac3('0x2d')]['find']({'where':{'id':_0xe8f33c['params']['id']}})[_0x1ac3('0x42')](handleEntityNotFound(_0x249c2d,null))[_0x1ac3('0x42')](saveUpdates(_0xe8f33c['body'],null))[_0x1ac3('0x42')](respondWithResult(_0x249c2d,null))['catch'](handleError(_0x249c2d,null));};exports['describe']=function(_0x2d628d,_0x220dd0){return db['ScreenRecording'][_0x1ac3('0x4e')]()['then'](respondWithResult(_0x220dd0,null))[_0x1ac3('0x46')](handleError(_0x220dd0,null));};exports[_0x1ac3('0x4f')]=function(_0x3586b9,_0x3a0320,_0x34ad43){var _0x40e9c7=require(_0x1ac3('0x50'));var _0x331374=![];var _0xeb7e49={};if(_0x3586b9[_0x1ac3('0x34')][_0x1ac3('0x2f')]&&_0x3586b9['query']['type']===_0x1ac3('0x51')){_0xeb7e49[_0x1ac3('0x51')]=_0x3586b9[_0x1ac3('0x47')]['id'];}else{_0xeb7e49['id']=_0x3586b9[_0x1ac3('0x47')]['id'];}return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':_0xeb7e49,'attributes':['id',_0x1ac3('0x4d')],'raw':!![]})[_0x1ac3('0x42')](handleEntityNotFound(_0x3a0320,null))[_0x1ac3('0x42')](function(_0x3149f6){if(_0x3149f6){var _0x541bba=path[_0x1ac3('0x52')](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x3149f6[_0x1ac3('0x4d')]);var _0x20c195=util['format'](_0x1ac3('0x55'),_0x541bba);if(fs[_0x1ac3('0x56')](_0x20c195)){_0x331374=!![];return _0x40e9c7['decryptFile'](_0x20c195,_0x541bba,config['secrets']['recording'])[_0x1ac3('0x42')](function(){return _0x3149f6;});}return _0x3149f6;}})[_0x1ac3('0x42')](function(_0x2a1f66){if(_0x2a1f66){var _0x5ad546=path[_0x1ac3('0x52')](config['root'],'server/files/screen_recordings',_0x2a1f66['value']);if(!fs['existsSync'](_0x5ad546)){throw new db[(_0x1ac3('0x57'))][(_0x1ac3('0x58'))](_0x1ac3('0x59'));}if(_0x2a1f66[_0x1ac3('0x5a')]){return _0x3a0320[_0x1ac3('0x4f')](_0x5ad546,_0x2a1f66['filename']+path[_0x1ac3('0x5b')](_0x5ad546),function(){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}else{return _0x3a0320['download'](_0x5ad546,function(_0x2bcb4b){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}}})[_0x1ac3('0x46')](function(_0x2e79b2){if(_0x2e79b2[_0x1ac3('0x5d')]==='ScreenRecording\x20not\x20found'){_0x3a0320[_0x1ac3('0x1b')](0x194)[_0x1ac3('0x2a')](_0x1ac3('0x5e'));}else{return handleError(_0x3a0320,null);}});};exports[_0x1ac3('0x27')]=function(_0x4cfa04,_0x19407a){return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':{'id':_0x4cfa04[_0x1ac3('0x47')]['id']}})[_0x1ac3('0x42')](function(_0x1ac283){if(_['isNil'](_0x1ac283)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ac283;})['then'](function(_0x582fe2){var _0x3b930b=path['join'](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x582fe2[_0x1ac3('0x4d')]);logger[_0x1ac3('0x5f')](_0x1ac3('0x60'),_0x3b930b);if(!_[_0x1ac3('0x61')](_0x582fe2['value'])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')](_0x1ac3('0x62')+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}_0x3b930b=_0x3b930b+_0x1ac3('0x64');if(!_[_0x1ac3('0x61')](_0x582fe2[_0x1ac3('0x4d')])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')]('File:\x20\x22'+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}return _0x582fe2;})['then'](function(_0x402507){if(!_0x402507)throw new InternalError();return _0x402507[_0x1ac3('0x27')]();})[_0x1ac3('0x42')](function(){_0x19407a[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();})[_0x1ac3('0x46')](handleError(_0x19407a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 39e695e..d219b2f 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 _0x5fc0=['lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x5fc0,0x13f));var _0x05fc=function(_0x427a08,_0x56d47b){_0x427a08=_0x427a08-0x0;var _0x5e16e7=_0x5fc0[_0x427a08];return _0x5e16e7;};'use strict';var _=require(_0x05fc('0x0'));var util=require('util');var logger=require(_0x05fc('0x1'))('api');var moment=require(_0x05fc('0x2'));var BPromise=require(_0x05fc('0x3'));var rp=require(_0x05fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x05fc('0x5'));var attributes=require(_0x05fc('0x6'));module[_0x05fc('0x7')]=function(_0x22dc21,_0x3db454){return _0x22dc21[_0x05fc('0x8')]('ScreenRecording',attributes,{'tableName':_0x05fc('0x9'),'paranoid':![],'indexes':[{'name':_0x05fc('0xa'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5dca=['../../config/environment','exports','define','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a1254,_0xf36f6c){var _0x2411fb=function(_0x1c6f30){while(--_0x1c6f30){_0x5a1254['push'](_0x5a1254['shift']());}};_0x2411fb(++_0xf36f6c);}(_0x5dca,0x95));var _0xa5dc=function(_0x3c0e2a,_0x44297e){_0x3c0e2a=_0x3c0e2a-0x0;var _0x182bfe=_0x5dca[_0x3c0e2a];return _0x182bfe;};'use strict';var _=require('lodash');var util=require(_0xa5dc('0x0'));var logger=require(_0xa5dc('0x1'))(_0xa5dc('0x2'));var moment=require(_0xa5dc('0x3'));var BPromise=require(_0xa5dc('0x4'));var rp=require(_0xa5dc('0x5'));var fs=require('fs');var path=require(_0xa5dc('0x6'));var rimraf=require('rimraf');var config=require(_0xa5dc('0x7'));var attributes=require('./screenRecording.attributes');module[_0xa5dc('0x8')]=function(_0x85a9e4,_0x5aab3d){return _0x85a9e4[_0xa5dc('0x9')]('ScreenRecording',attributes,{'tableName':_0xa5dc('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xa5dc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 38ba704..59f1996 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 _0xc32e=['../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc32e,0x87));var _0xec32=function(_0xdd59d3,_0x29c9bb){_0xdd59d3=_0xdd59d3-0x0;var _0x420490=_0xc32e[_0xdd59d3];return _0x420490;};'use strict';var _=require(_0xec32('0x0'));var util=require(_0xec32('0x1'));var moment=require(_0xec32('0x2'));var BPromise=require(_0xec32('0x3'));var rs=require(_0xec32('0x4'));var fs=require('fs');var Redis=require(_0xec32('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec32('0x6'));var logger=require(_0xec32('0x7'))(_0xec32('0x8'));var config=require(_0xec32('0x9'));var jayson=require(_0xec32('0xa'));var client=jayson[_0xec32('0xb')][_0xec32('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bb283,_0x47e4bb,_0x322f33){return new BPromise(function(_0x242cbb,_0x3b4cf1){return client[_0xec32('0xd')](_0x2bb283,_0x322f33)['then'](function(_0x28e8e8){logger[_0xec32('0xe')](_0xec32('0xf'),_0x47e4bb,'request\x20sent');logger['debug'](_0xec32('0x10'),_0x47e4bb,_0xec32('0x11'),JSON[_0xec32('0x12')](_0x28e8e8));if(_0x28e8e8[_0xec32('0x13')]){if(_0x28e8e8[_0xec32('0x13')][_0xec32('0x14')]===0x1f4){logger[_0xec32('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x47e4bb,_0x28e8e8['error'][_0xec32('0x15')]);return _0x3b4cf1(_0x28e8e8[_0xec32('0x13')]['message']);}logger[_0xec32('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x47e4bb,_0x28e8e8[_0xec32('0x13')][_0xec32('0x15')]);return _0x242cbb(_0x28e8e8[_0xec32('0x13')][_0xec32('0x15')]);}else{logger[_0xec32('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x47e4bb,_0xec32('0x11'));_0x242cbb(_0x28e8e8[_0xec32('0x16')][_0xec32('0x15')]);}})[_0xec32('0x17')](function(_0x37c3f6){logger[_0xec32('0x13')](_0xec32('0xf'),_0x47e4bb,_0x37c3f6);_0x3b4cf1(_0x37c3f6);});});} \ No newline at end of file +var _0x8305=['message','result','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x8305,0x12e));var _0x5830=function(_0x593a3a,_0x38dd14){_0x593a3a=_0x593a3a-0x0;var _0x7aadb9=_0x8305[_0x593a3a];return _0x7aadb9;};'use strict';var _=require(_0x5830('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5830('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5830('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5830('0x3'));var logger=require(_0x5830('0x4'))(_0x5830('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5830('0x6')][_0x5830('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x350233,_0x187fd6,_0x1828ad){return new BPromise(function(_0x4329c4,_0x219aa9){return client[_0x5830('0x8')](_0x350233,_0x1828ad)[_0x5830('0x9')](function(_0x50cbb6){logger[_0x5830('0xa')](_0x5830('0xb'),_0x187fd6,_0x5830('0xc'));logger[_0x5830('0xd')](_0x5830('0xe'),_0x187fd6,_0x5830('0xc'),JSON[_0x5830('0xf')](_0x50cbb6));if(_0x50cbb6[_0x5830('0x10')]){if(_0x50cbb6[_0x5830('0x10')][_0x5830('0x11')]===0x1f4){logger['error'](_0x5830('0xb'),_0x187fd6,_0x50cbb6[_0x5830('0x10')][_0x5830('0x12')]);return _0x219aa9(_0x50cbb6[_0x5830('0x10')][_0x5830('0x12')]);}logger[_0x5830('0x10')](_0x5830('0xb'),_0x187fd6,_0x50cbb6[_0x5830('0x10')][_0x5830('0x12')]);return _0x4329c4(_0x50cbb6[_0x5830('0x10')][_0x5830('0x12')]);}else{logger[_0x5830('0xa')](_0x5830('0xb'),_0x187fd6,_0x5830('0xc'));_0x4329c4(_0x50cbb6[_0x5830('0x13')][_0x5830('0x12')]);}})['catch'](function(_0x3dafab){logger['error'](_0x5830('0xb'),_0x187fd6,_0x3dafab);_0x219aa9(_0x3dafab);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 3d4917a..169b07c 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 _0x4e19=['getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','diskStorage','root','logologin','addLogoLogin','preferred','addPreferred','favicon','addFavicon','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now'];(function(_0xbbbfe7,_0x167540){var _0x4af130=function(_0x5384d8){while(--_0x5384d8){_0xbbbfe7['push'](_0xbbbfe7['shift']());}};_0x4af130(++_0x167540);}(_0x4e19,0x7a));var _0x94e1=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x4e19[_0x460fd7];return _0x44d1c2;};'use strict';var multer=require(_0x94e1('0x0'));var util=require(_0x94e1('0x1'));var path=require(_0x94e1('0x2'));var timeout=require(_0x94e1('0x3'));var express=require(_0x94e1('0x4'));var router=express[_0x94e1('0x5')]();var fs_extra=require(_0x94e1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x94e1('0x7'));var config=require(_0x94e1('0x8'));var controller=require('./setting.controller');router[_0x94e1('0x9')]('/',auth[_0x94e1('0xa')](),controller[_0x94e1('0xb')]);router[_0x94e1('0x9')](_0x94e1('0xc'),controller[_0x94e1('0xd')]);router[_0x94e1('0x9')](_0x94e1('0xe'),controller[_0x94e1('0xf')]);router[_0x94e1('0x9')](_0x94e1('0x10'),controller['getLogo']);router[_0x94e1('0x9')](_0x94e1('0x11'),controller[_0x94e1('0x12')]);router[_0x94e1('0x9')](_0x94e1('0x13'),controller[_0x94e1('0x14')]);router['get'](_0x94e1('0x15'),controller[_0x94e1('0x16')]);router[_0x94e1('0x9')](_0x94e1('0x17'),controller[_0x94e1('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5071c9,_0x251384,_0x26d474){_0x26d474(null,path[_0x94e1('0x19')](config['root'],_0x94e1('0x1a')));},'filename':function(_0x7e90e3,_0x51a07e,_0x1daeac){_0x1daeac(null,util[_0x94e1('0x1b')](_0x94e1('0x1c'),_0x94e1('0x1d'),path[_0x94e1('0x1e')](_0x51a07e[_0x94e1('0x1f')])));}})});router[_0x94e1('0x20')](_0x94e1('0x10'),upload[_0x94e1('0x21')](_0x94e1('0x22')),controller['addLogo']);var upload=multer({'storage':multer[_0x94e1('0x23')]({'destination':function(_0x32ca9f,_0x24add7,_0x34e0fd){_0x34e0fd(null,path[_0x94e1('0x19')](config[_0x94e1('0x24')],'server/files/images/logos/'));},'filename':function(_0x21047e,_0x38d1ae,_0x3025f6){_0x3025f6(null,util['format'](_0x94e1('0x1c'),_0x94e1('0x25'),path[_0x94e1('0x1e')](_0x38d1ae['originalname'])));}})});router['post'](_0x94e1('0x11'),upload['single'](_0x94e1('0x22')),controller[_0x94e1('0x26')]);var upload=multer({'storage':multer[_0x94e1('0x23')]({'destination':function(_0x35a18e,_0x24b6b9,_0x80b7e){_0x80b7e(null,path[_0x94e1('0x19')](config['root'],_0x94e1('0x1a')));},'filename':function(_0x207e0d,_0xc2db8,_0xb85423){_0xb85423(null,util['format']('%s%s',_0x94e1('0x27'),path[_0x94e1('0x1e')](_0xc2db8['originalname'])));}})});router[_0x94e1('0x20')]('/:id/preferred',upload['single']('file'),controller[_0x94e1('0x28')]);var upload=multer({'storage':multer[_0x94e1('0x23')]({'destination':function(_0x5b17e8,_0x187dbb,_0x52d640){_0x52d640(null,path[_0x94e1('0x19')](config[_0x94e1('0x24')],'server/files/images/logos/'));},'filename':function(_0x3068f8,_0x2ab492,_0x5b2ec9){_0x5b2ec9(null,util[_0x94e1('0x1b')](_0x94e1('0x1c'),_0x94e1('0x29'),path[_0x94e1('0x1e')](_0x2ab492[_0x94e1('0x1f')])));}})});router[_0x94e1('0x20')]('/:id/favicon',upload[_0x94e1('0x21')]('file'),controller[_0x94e1('0x2a')]);router['put'](_0x94e1('0xe'),auth['isAuthenticated'](),controller[_0x94e1('0x2b')]);module[_0x94e1('0x2c')]=router; \ No newline at end of file +var _0xd12a=['addPreferred','favicon','put','isAuthenticated','update','exports','util','connect-timeout','fs-extra','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single','file','addLogo','logologin','addLogoLogin','preferred'];(function(_0x564d53,_0x31ac8a){var _0x1ba891=function(_0x51cad3){while(--_0x51cad3){_0x564d53['push'](_0x564d53['shift']());}};_0x1ba891(++_0x31ac8a);}(_0xd12a,0x1f2));var _0xad12=function(_0x39649f,_0x4e0e87){_0x39649f=_0x39649f-0x0;var _0x4edf8a=_0xd12a[_0x39649f];return _0x4edf8a;};'use strict';var multer=require('multer');var util=require(_0xad12('0x0'));var path=require('path');var timeout=require(_0xad12('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xad12('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xad12('0x3'));var controller=require(_0xad12('0x4'));router[_0xad12('0x5')]('/',auth['isAuthenticated'](),controller[_0xad12('0x6')]);router[_0xad12('0x5')](_0xad12('0x7'),controller[_0xad12('0x8')]);router['get'](_0xad12('0x9'),controller[_0xad12('0xa')]);router['get'](_0xad12('0xb'),controller[_0xad12('0xc')]);router[_0xad12('0x5')](_0xad12('0xd'),controller['getLogoLogin']);router[_0xad12('0x5')](_0xad12('0xe'),controller[_0xad12('0xf')]);router[_0xad12('0x5')](_0xad12('0x10'),controller[_0xad12('0x11')]);router[_0xad12('0x5')](_0xad12('0x12'),controller[_0xad12('0x13')]);var upload=multer({'storage':multer[_0xad12('0x14')]({'destination':function(_0x4e6c8c,_0x482c5c,_0x40f571){_0x40f571(null,path[_0xad12('0x15')](config[_0xad12('0x16')],_0xad12('0x17')));},'filename':function(_0x451533,_0x44bcd8,_0x5b5176){_0x5b5176(null,util[_0xad12('0x18')](_0xad12('0x19'),'logo',path[_0xad12('0x1a')](_0x44bcd8[_0xad12('0x1b')])));}})});router[_0xad12('0x1c')](_0xad12('0xb'),upload[_0xad12('0x1d')](_0xad12('0x1e')),controller[_0xad12('0x1f')]);var upload=multer({'storage':multer[_0xad12('0x14')]({'destination':function(_0x3b4561,_0x36fca6,_0x57fe6a){_0x57fe6a(null,path[_0xad12('0x15')](config[_0xad12('0x16')],_0xad12('0x17')));},'filename':function(_0x39030e,_0x4eec09,_0x281d63){_0x281d63(null,util['format'](_0xad12('0x19'),_0xad12('0x20'),path['extname'](_0x4eec09[_0xad12('0x1b')])));}})});router[_0xad12('0x1c')]('/:id/logo_login',upload[_0xad12('0x1d')](_0xad12('0x1e')),controller[_0xad12('0x21')]);var upload=multer({'storage':multer[_0xad12('0x14')]({'destination':function(_0x2b948e,_0x37f917,_0x26476c){_0x26476c(null,path['join'](config[_0xad12('0x16')],'server/files/images/logos/'));},'filename':function(_0x4bc24f,_0x6f6083,_0x4423cb){_0x4423cb(null,util['format'](_0xad12('0x19'),_0xad12('0x22'),path[_0xad12('0x1a')](_0x6f6083['originalname'])));}})});router[_0xad12('0x1c')](_0xad12('0x10'),upload[_0xad12('0x1d')](_0xad12('0x1e')),controller[_0xad12('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x151982,_0x4b7961,_0x4e5b66){_0x4e5b66(null,path[_0xad12('0x15')](config['root'],_0xad12('0x17')));},'filename':function(_0x6d747b,_0x5bc209,_0x4a709c){_0x4a709c(null,util[_0xad12('0x18')](_0xad12('0x19'),_0xad12('0x24'),path[_0xad12('0x1a')](_0x5bc209[_0xad12('0x1b')])));}})});router[_0xad12('0x1c')](_0xad12('0x12'),upload[_0xad12('0x1d')](_0xad12('0x1e')),controller['addFavicon']);router[_0xad12('0x25')](_0xad12('0x9'),auth[_0xad12('0x26')](),controller[_0xad12('0x27')]);module[_0xad12('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index bd8a0cf..5b5af32 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x36a1a9,_0x26fa59){var _0x4ffabc=function(_0x284d49){while(--_0x284d49){_0x36a1a9['push'](_0x36a1a9['shift']());}};_0x4ffabc(++_0x26fa59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x9f783,_0x18bc36){var _0x31f3c3=function(_0xf684bc){while(--_0xf684bc){_0x9f783['push'](_0x9f783['shift']());}};_0x31f3c3(++_0x18bc36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 772855c..3a0b627 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 _0x607b=['defaultLogo','defaultLoginLogo','defaultFavicon','root','join','toLower','upperFirst','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','default','custom','gdpr','securePassword','addPreferred','preferred','favicon','addFavicon','getFavicon','defaultPreferred','default_favicon.ico','now','utcOffset','format','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','stack','name','index','map','Setting','fieldName','type','key','model','query','keys','attributes','fields','length','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','intersection','include','find','body','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','getLicense','loginLogo'];(function(_0x54a8e5,_0x3d3c42){var _0x512915=function(_0x11d861){while(--_0x11d861){_0x54a8e5['push'](_0x54a8e5['shift']());}};_0x512915(++_0x3d3c42);}(_0x607b,0x18f));var _0xb607=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x607b[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xb607('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb607('0x1'));var jsonpatch=require(_0xb607('0x2'));var rp=require(_0xb607('0x3'));var moment=require(_0xb607('0x4'));var BPromise=require(_0xb607('0x5'));var Mustache=require(_0xb607('0x6'));var util=require(_0xb607('0x7'));var path=require(_0xb607('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb607('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb607('0xa'));var crypto=require(_0xb607('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb607('0xc'));var toCsv=require(_0xb607('0xd'));var querystring=require(_0xb607('0xe'));var Papa=require(_0xb607('0xf'));var Redis=require('ioredis');var authService=require(_0xb607('0x10'));var qs=require(_0xb607('0x11'));var as=require(_0xb607('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb607('0x13'))(_0xb607('0x14'));var utils=require('../../config/utils');var config=require(_0xb607('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb607('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb607('0x17')][_0xb607('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4e1f0c,_0x2ad790,_0x9b234f,_0x3f7ad7){return new BPromise(function(_0x2938ad,_0x2771a3){var _0x2fb3db=_0x3f7ad7||client;return _0x2fb3db[_0xb607('0x19')](_0x4e1f0c,_0x9b234f)[_0xb607('0x1a')](function(_0x8a7d48){logger[_0xb607('0x1b')](_0xb607('0x1c'),_0x2ad790,_0xb607('0x1d'));logger[_0xb607('0x1e')](_0xb607('0x1f'),_0x2ad790,_0xb607('0x1d'),JSON[_0xb607('0x20')](_0x8a7d48));if(_0x8a7d48[_0xb607('0x21')]){if(_0x8a7d48[_0xb607('0x21')][_0xb607('0x22')]===0x1f4){logger[_0xb607('0x21')](_0xb607('0x1c'),_0x2ad790,_0x8a7d48['error'][_0xb607('0x23')]);return _0x2771a3(_0x8a7d48[_0xb607('0x21')][_0xb607('0x23')]);}logger[_0xb607('0x21')](_0xb607('0x1c'),_0x2ad790,_0x8a7d48[_0xb607('0x21')][_0xb607('0x23')]);return _0x2938ad(_0x8a7d48[_0xb607('0x21')][_0xb607('0x23')]);}else{logger[_0xb607('0x1b')]('Setting,\x20%s,\x20%s',_0x2ad790,_0xb607('0x1d'));_0x2938ad(_0x8a7d48['result'][_0xb607('0x23')]);}})[_0xb607('0x24')](function(_0x513900){logger['error'](_0xb607('0x1c'),_0x2ad790,_0x513900);_0x2771a3(_0x513900);});});}function respondWithStatusCode(_0x1bb1c9,_0xfcf803){_0xfcf803=_0xfcf803||0xcc;return function(_0x17e5c1){if(_0x17e5c1){return _0x1bb1c9['sendStatus'](_0xfcf803);}return _0x1bb1c9[_0xb607('0x25')](_0xfcf803)['end']();};}function respondWithResult(_0x354f26,_0x2bf98b){_0x2bf98b=_0x2bf98b||0xc8;return function(_0x3b81ac){if(_0x3b81ac){return _0x354f26[_0xb607('0x25')](_0x2bf98b)[_0xb607('0x26')](_0x3b81ac);}};}function respondWithFilteredResult(_0x4900a1,_0x1a1de9){return function(_0x37ed9d){if(_0x37ed9d){var _0x1f4ae5=typeof _0x1a1de9[_0xb607('0x27')]===_0xb607('0x28')&&typeof _0x1a1de9[_0xb607('0x29')]===_0xb607('0x28');var _0x5f3388=_0x37ed9d[_0xb607('0x2a')];var _0x29e7e4=_0x1f4ae5?0x0:_0x1a1de9[_0xb607('0x27')];var _0x7b418a=_0x1f4ae5?_0x37ed9d[_0xb607('0x2a')]:_0x1a1de9['offset']+_0x1a1de9[_0xb607('0x29')];var _0x1b99c4;if(_0x7b418a>=_0x5f3388){_0x7b418a=_0x5f3388;_0x1b99c4=0xc8;}else{_0x1b99c4=0xce;}_0x4900a1[_0xb607('0x25')](_0x1b99c4);return _0x4900a1[_0xb607('0x2b')](_0xb607('0x2c'),_0x29e7e4+'-'+_0x7b418a+'/'+_0x5f3388)[_0xb607('0x26')](_0x37ed9d);}return null;};}function patchUpdates(_0x5e547d){return function(_0x44ea52){try{jsonpatch[_0xb607('0x2d')](_0x44ea52,_0x5e547d,!![]);}catch(_0x265d54){return BPromise['reject'](_0x265d54);}return _0x44ea52[_0xb607('0x2e')]();};}function saveUpdates(_0x3e5cf8,_0x20e120){return function(_0x5b05cf){if(_0x5b05cf){return _0x5b05cf[_0xb607('0x2f')](_0x3e5cf8)['then'](function(_0x5b56ba){return _0x5b56ba;});}return null;};}function removeEntity(_0x33ab49,_0x2a9536){return function(_0x10b437){if(_0x10b437){return _0x10b437[_0xb607('0x30')]()[_0xb607('0x1a')](function(){_0x33ab49[_0xb607('0x25')](0xcc)[_0xb607('0x31')]();});}};}function handleEntityNotFound(_0x3651de,_0x46a285){return function(_0x437157){if(!_0x437157){_0x3651de['sendStatus'](0x194);}return _0x437157;};}function handleError(_0x4bcabb,_0x2dae45){_0x2dae45=_0x2dae45||0x1f4;return function(_0x5358b8){logger[_0xb607('0x21')](_0x5358b8[_0xb607('0x32')]);if(_0x5358b8[_0xb607('0x33')]){delete _0x5358b8[_0xb607('0x33')];}_0x4bcabb[_0xb607('0x25')](_0x2dae45)['send'](_0x5358b8);};}exports[_0xb607('0x34')]=function(_0xc101cb,_0x38df52){var _0x4aef0d={},_0xfb2159={},_0x1edb52={'count':0x0,'rows':[]};var _0x28b85c=_[_0xb607('0x35')](db[_0xb607('0x36')]['rawAttributes'],function(_0x15761b){return{'name':_0x15761b[_0xb607('0x37')],'type':_0x15761b[_0xb607('0x38')][_0xb607('0x39')]};});_0xfb2159[_0xb607('0x3a')]=_[_0xb607('0x35')](_0x28b85c,_0xb607('0x33'));_0xfb2159[_0xb607('0x3b')]=_[_0xb607('0x3c')](_0xc101cb[_0xb607('0x3b')]);_0xfb2159['filters']=_['intersection'](_0xfb2159[_0xb607('0x3a')],_0xfb2159[_0xb607('0x3b')]);_0x4aef0d[_0xb607('0x3d')]=_['intersection'](_0xfb2159['model'],qs['fields'](_0xc101cb[_0xb607('0x3b')][_0xb607('0x3e')]));_0x4aef0d[_0xb607('0x3d')]=_0x4aef0d['attributes'][_0xb607('0x3f')]?_0x4aef0d['attributes']:_0xfb2159[_0xb607('0x3a')];if(!_0xc101cb[_0xb607('0x3b')]['hasOwnProperty']('nolimit')){_0x4aef0d[_0xb607('0x29')]=qs[_0xb607('0x29')](_0xc101cb[_0xb607('0x3b')][_0xb607('0x29')]);_0x4aef0d[_0xb607('0x27')]=qs[_0xb607('0x27')](_0xc101cb[_0xb607('0x3b')][_0xb607('0x27')]);}_0x4aef0d[_0xb607('0x40')]=qs[_0xb607('0x41')](_0xc101cb[_0xb607('0x3b')][_0xb607('0x41')]);_0x4aef0d['where']=qs[_0xb607('0x42')](_[_0xb607('0x43')](_0xc101cb['query'],_0xfb2159[_0xb607('0x42')]),_0x28b85c);if(_0xc101cb['query'][_0xb607('0x44')]){_0x4aef0d[_0xb607('0x45')]=_[_0xb607('0x46')](_0x4aef0d[_0xb607('0x45')],{'$or':_[_0xb607('0x35')](_0x28b85c,function(_0x4b002a){if(_0x4b002a[_0xb607('0x38')]!==_0xb607('0x47')){var _0x3c03b2={};_0x3c03b2[_0x4b002a[_0xb607('0x33')]]={'$like':'%'+_0xc101cb[_0xb607('0x3b')]['filter']+'%'};return _0x3c03b2;}})});}_0x4aef0d=_[_0xb607('0x46')]({},_0x4aef0d,_0xc101cb[_0xb607('0x48')]);var _0xed2343={'where':_0x4aef0d['where']};return db[_0xb607('0x36')]['count'](_0xed2343)['then'](function(_0x493c1e){_0x1edb52['count']=_0x493c1e;if(_0xc101cb['query'][_0xb607('0x49')]){_0x4aef0d['include']=[{'all':!![]}];}return db['Setting'][_0xb607('0x4a')](_0x4aef0d);})['then'](function(_0x4b590d){_0x1edb52[_0xb607('0x4b')]=_0x4b590d;return _0x1edb52;})[_0xb607('0x1a')](respondWithFilteredResult(_0x38df52,_0x4aef0d))[_0xb607('0x24')](handleError(_0x38df52,null));};exports[_0xb607('0x4c')]=function(_0x4fb64b,_0x324f3b){var _0x35bf25={'raw':![],'where':{'id':_0x4fb64b[_0xb607('0x4d')]['id']}},_0x11f324={};_0x11f324['model']=_['keys'](db[_0xb607('0x36')][_0xb607('0x4e')]);_0x11f324[_0xb607('0x3b')]=_[_0xb607('0x3c')](_0x4fb64b[_0xb607('0x3b')]);_0x11f324[_0xb607('0x42')]=_[_0xb607('0x4f')](_0x11f324[_0xb607('0x3a')],_0x11f324[_0xb607('0x3b')]);_0x35bf25[_0xb607('0x3d')]=_[_0xb607('0x4f')](_0x11f324[_0xb607('0x3a')],qs['fields'](_0x4fb64b[_0xb607('0x3b')]['fields']));_0x35bf25[_0xb607('0x3d')]=_0x35bf25[_0xb607('0x3d')][_0xb607('0x3f')]?_0x35bf25['attributes']:_0x11f324[_0xb607('0x3a')];if(_0x4fb64b[_0xb607('0x3b')]['includeAll']){_0x35bf25[_0xb607('0x50')]=[{'all':!![]}];}_0x35bf25=_['merge']({},_0x35bf25,_0x4fb64b['options']);return db[_0xb607('0x36')][_0xb607('0x51')](_0x35bf25)[_0xb607('0x1a')](handleEntityNotFound(_0x324f3b,null))['then'](respondWithResult(_0x324f3b,null))[_0xb607('0x24')](handleError(_0x324f3b,null));};exports['update']=function(_0x31e074,_0xc8e15a){if(_0x31e074[_0xb607('0x52')]['id']){delete _0x31e074['body']['id'];}return db[_0xb607('0x36')][_0xb607('0x51')]({'where':{'id':_0x31e074['params']['id']}})[_0xb607('0x1a')](handleEntityNotFound(_0xc8e15a,null))[_0xb607('0x1a')](saveUpdates(_0x31e074[_0xb607('0x52')],null))[_0xb607('0x1a')](respondWithResult(_0xc8e15a,null))[_0xb607('0x24')](handleError(_0xc8e15a,null));};exports[_0xb607('0x53')]=function(_0x2dd59b,_0x676a07,_0x4bad3a){if(_0x2dd59b[_0xb607('0x54')]&&_0x2dd59b[_0xb607('0x54')][_0xb607('0x55')]){_0x2dd59b[_0xb607('0x52')][_0xb607('0x56')]=_0x2dd59b[_0xb607('0x54')][_0xb607('0x55')];}return db[_0xb607('0x36')][_0xb607('0x51')]({'where':{'id':_0x2dd59b['params']['id']}})[_0xb607('0x1a')](handleEntityNotFound(_0x676a07,null))[_0xb607('0x1a')](saveUpdates(_0x2dd59b['body'],null))[_0xb607('0x1a')](respondWithResult(_0x676a07,null))[_0xb607('0x24')](handleError(_0x676a07,null));};exports[_0xb607('0x57')]=function(_0x4fa56a,_0x41e41,_0x5cf55b){if(_0x4fa56a[_0xb607('0x54')]&&_0x4fa56a[_0xb607('0x54')][_0xb607('0x55')]){_0x4fa56a[_0xb607('0x52')]['loginLogo']=_0x4fa56a[_0xb607('0x54')][_0xb607('0x55')];}return db[_0xb607('0x36')][_0xb607('0x51')]({'where':{'id':_0x4fa56a[_0xb607('0x4d')]['id']}})[_0xb607('0x1a')](handleEntityNotFound(_0x41e41,null))[_0xb607('0x1a')](saveUpdates(_0x4fa56a['body'],null))['then'](respondWithResult(_0x41e41,null))[_0xb607('0x24')](handleError(_0x41e41,null));};var utilLicense=require(_0xb607('0x58'));exports[_0xb607('0x59')]=function(_0x437f2e,_0x45270f,_0x278580){var _0x4177b4=_0xb607('0x5a');var _0x55e236={'custom':![]};return utilLicense[_0xb607('0x5b')]()[_0xb607('0x1a')](function(_0x3e25f7){if(_0x3e25f7){_0x55e236=_0x3e25f7;}return db[_0xb607('0x36')][_0xb607('0x51')]({'where':{'id':_0x437f2e[_0xb607('0x4d')]['id']},'attributes':[_0xb607('0x56'),_0xb607('0x5c'),'preferred','favicon',_0xb607('0x5d'),_0xb607('0x5e'),'defaultPreferred',_0xb607('0x5f')],'raw':!![]});})[_0xb607('0x1a')](handleEntityNotFound(_0x45270f,null))['then'](function(_0x556f6d){if(_0x556f6d){var _0x131241=_0x556f6d[_0xb607('0x56')]&&fs['existsSync'](path['join'](config[_0xb607('0x60')],_0x4177b4,_['toLower'](_0x556f6d[_0xb607('0x56')])))?path[_0xb607('0x61')](config[_0xb607('0x60')],_0x4177b4,_['toLower'](_0x556f6d[_0xb607('0x56')])):path[_0xb607('0x61')](config[_0xb607('0x60')],_0x4177b4,_[_0xb607('0x62')]('default_logo.svg'));var _0xa29a0c='default'+_[_0xb607('0x63')](_0xb607('0x56'));if(_0x556f6d[_0xa29a0c]||!_0x55e236['custom']){_0x131241=path[_0xb607('0x61')](config['root'],_0x4177b4,_[_0xb607('0x62')](_0xb607('0x64')));}if(!fs[_0xb607('0x65')](_0x131241)){throw new db[(_0xb607('0x66'))][(_0xb607('0x67'))](_['upperFirst'](_0xb607('0x56'))+_0xb607('0x68'));}return _0x45270f[_0xb607('0x69')](_0x131241);}})['catch'](handleError(_0x45270f,null));};var utilLicense=require('../../config/license/util');exports[_0xb607('0x6a')]=function(_0x51ff0a,_0x4e2b81,_0x5a9378){var _0x4d2a5a=_0xb607('0x5a');var _0x325a10={'custom':![]};return utilLicense[_0xb607('0x5b')]()['then'](function(_0x5b83c9){if(_0x5b83c9){_0x325a10=_0x5b83c9;}return db[_0xb607('0x36')][_0xb607('0x51')]({'where':{'id':_0x51ff0a['params']['id']},'attributes':[_0xb607('0x56'),_0xb607('0x5c'),'preferred','favicon',_0xb607('0x5d'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x4e2b81,null))[_0xb607('0x1a')](function(_0x27906f){if(_0x27906f){var _0x366482=_0x27906f[_0xb607('0x5c')]&&fs[_0xb607('0x65')](path['join'](config[_0xb607('0x60')],_0x4d2a5a,_['toLower'](_0x27906f[_0xb607('0x5c')])))?path['join'](config[_0xb607('0x60')],_0x4d2a5a,_[_0xb607('0x62')](_0x27906f[_0xb607('0x5c')])):path[_0xb607('0x61')](config['root'],_0x4d2a5a,_[_0xb607('0x62')](_0xb607('0x6b')));var _0x251d76=_0xb607('0x6c')+_['upperFirst'](_0xb607('0x5c'));if(_0x27906f[_0x251d76]||!_0x325a10[_0xb607('0x6d')]){_0x366482=path[_0xb607('0x61')](config['root'],_0x4d2a5a,_[_0xb607('0x62')]('default_loginLogo.svg'));}if(!fs[_0xb607('0x65')](_0x366482)){throw new db[(_0xb607('0x66'))]['ValidationError'](_[_0xb607('0x63')](_0xb607('0x5c'))+'\x20not\x20found');}return _0x4e2b81[_0xb607('0x69')](_0x366482);}})[_0xb607('0x24')](handleError(_0x4e2b81,null));};exports[_0xb607('0x6e')]=function(_0xcb74cb,_0x123b83){return db[_0xb607('0x36')]['find']({'where':{'id':_0xcb74cb[_0xb607('0x4d')]['id']},'attributes':[_0xb607('0x6f')]})[_0xb607('0x1a')](respondWithResult(_0x123b83,null))[_0xb607('0x24')](handleError(_0x123b83,null));};exports[_0xb607('0x70')]=function(_0x150176,_0x293dd9,_0x4d9982){if(_0x150176[_0xb607('0x54')]&&_0x150176['file'][_0xb607('0x55')]){_0x150176[_0xb607('0x52')]['preferred']=_0x150176[_0xb607('0x54')]['filename'];}return db[_0xb607('0x36')]['find']({'where':{'id':_0x150176[_0xb607('0x4d')]['id']}})[_0xb607('0x1a')](handleEntityNotFound(_0x293dd9,null))[_0xb607('0x1a')](saveUpdates(_0x150176[_0xb607('0x52')],null))[_0xb607('0x1a')](respondWithResult(_0x293dd9,null))['catch'](handleError(_0x293dd9,null));};var utilLicense=require(_0xb607('0x58'));exports['getPreferred']=function(_0xceff6a,_0x5725f9,_0x3fd7cd){var _0x108d33='server/files/images/logos';var _0x4d8724={'custom':![]};return utilLicense[_0xb607('0x5b')]()[_0xb607('0x1a')](function(_0x581296){if(_0x581296){_0x4d8724=_0x581296;}return db[_0xb607('0x36')][_0xb607('0x51')]({'where':{'id':_0xceff6a[_0xb607('0x4d')]['id']},'attributes':[_0xb607('0x56'),_0xb607('0x5c'),_0xb607('0x71'),_0xb607('0x72'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0xb607('0x5f')],'raw':!![]});})[_0xb607('0x1a')](handleEntityNotFound(_0x5725f9,null))[_0xb607('0x1a')](function(_0x555039){if(_0x555039){var _0x20a0ef=_0x555039[_0xb607('0x71')]&&fs[_0xb607('0x65')](path['join'](config[_0xb607('0x60')],_0x108d33,_[_0xb607('0x62')](_0x555039['preferred'])))?path[_0xb607('0x61')](config[_0xb607('0x60')],_0x108d33,_[_0xb607('0x62')](_0x555039[_0xb607('0x71')])):path[_0xb607('0x61')](config[_0xb607('0x60')],_0x108d33,_[_0xb607('0x62')]('default_preferred.png'));var _0x481d07=_0xb607('0x6c')+_[_0xb607('0x63')](_0xb607('0x71'));if(_0x555039[_0x481d07]||!_0x4d8724[_0xb607('0x6d')]||!_0x4d8724[_0xb607('0x71')]){_0x20a0ef=path['join'](config[_0xb607('0x60')],_0x108d33,_[_0xb607('0x62')]('default_preferred.png'));}if(!fs[_0xb607('0x65')](_0x20a0ef)){throw new db[(_0xb607('0x66'))][(_0xb607('0x67'))](_[_0xb607('0x63')](_0xb607('0x71'))+_0xb607('0x68'));}return _0x5725f9['download'](_0x20a0ef);}})[_0xb607('0x24')](handleError(_0x5725f9,null));};exports[_0xb607('0x73')]=function(_0x597463,_0x251f72,_0x3056f8){if(_0x597463['file']&&_0x597463[_0xb607('0x54')][_0xb607('0x55')]){_0x597463[_0xb607('0x52')][_0xb607('0x72')]=_0x597463[_0xb607('0x54')][_0xb607('0x55')];}return db[_0xb607('0x36')]['find']({'where':{'id':_0x597463[_0xb607('0x4d')]['id']}})[_0xb607('0x1a')](handleEntityNotFound(_0x251f72,null))[_0xb607('0x1a')](saveUpdates(_0x597463[_0xb607('0x52')],null))[_0xb607('0x1a')](respondWithResult(_0x251f72,null))[_0xb607('0x24')](handleError(_0x251f72,null));};var utilLicense=require(_0xb607('0x58'));exports[_0xb607('0x74')]=function(_0x3cb420,_0x169eb9,_0x418824){var _0x1a00a2=_0xb607('0x5a');var _0x2ea6bc={'custom':![]};return utilLicense[_0xb607('0x5b')]()['then'](function(_0x43f087){if(_0x43f087){_0x2ea6bc=_0x43f087;}return db[_0xb607('0x36')]['find']({'where':{'id':_0x3cb420[_0xb607('0x4d')]['id']},'attributes':[_0xb607('0x56'),_0xb607('0x5c'),_0xb607('0x71'),_0xb607('0x72'),_0xb607('0x5d'),_0xb607('0x5e'),_0xb607('0x75'),_0xb607('0x5f')],'raw':!![]});})[_0xb607('0x1a')](handleEntityNotFound(_0x169eb9,null))[_0xb607('0x1a')](function(_0xa41c6){if(_0xa41c6){var _0x185698=_0xa41c6['favicon']&&fs[_0xb607('0x65')](path[_0xb607('0x61')](config[_0xb607('0x60')],_0x1a00a2,_[_0xb607('0x62')](_0xa41c6[_0xb607('0x72')])))?path[_0xb607('0x61')](config['root'],_0x1a00a2,_[_0xb607('0x62')](_0xa41c6[_0xb607('0x72')])):path[_0xb607('0x61')](config[_0xb607('0x60')],_0x1a00a2,_['toLower'](_0xb607('0x76')));var _0x5a3955=_0xb607('0x6c')+_['upperFirst'](_0xb607('0x72'));if(_0xa41c6[_0x5a3955]||!_0x2ea6bc[_0xb607('0x6d')]){_0x185698=path[_0xb607('0x61')](config[_0xb607('0x60')],_0x1a00a2,_[_0xb607('0x62')](_0xb607('0x76')));}if(!fs[_0xb607('0x65')](_0x185698)){throw new db[(_0xb607('0x66'))][(_0xb607('0x67'))](_['upperFirst'](_0xb607('0x72'))+_0xb607('0x68'));}return _0x169eb9[_0xb607('0x69')](_0x185698);}})[_0xb607('0x24')](handleError(_0x169eb9,null));};exports['getDate']=function(_0x1ec3ec,_0x481929){var _0x4b5901={'offset':moment()['utcOffset']()};_0x4b5901[_0xb607('0x77')]=moment()[_0xb607('0x78')](_0x4b5901[_0xb607('0x27')])[_0xb607('0x79')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x481929[_0xb607('0x25')](0xc8)[_0xb607('0x7a')](_0x4b5901);}; \ No newline at end of file +var _0x0fc2=['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','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','name','send','index','map','Setting','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','merge','where','filter','options','includeAll','include','findAll','rows','show','params','keys','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','server/files/images/logos','preferred','default_loginLogo.svg','Sequelize','\x20not\x20found','download','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x0fc2,0x6e));var _0x20fc=function(_0x421936,_0x21e4fd){_0x421936=_0x421936-0x0;var _0x533491=_0x0fc2[_0x421936];return _0x533491;};'use strict';var emlformat=require(_0x20fc('0x0'));var rimraf=require(_0x20fc('0x1'));var zipdir=require(_0x20fc('0x2'));var jsonpatch=require(_0x20fc('0x3'));var rp=require('request-promise');var moment=require(_0x20fc('0x4'));var BPromise=require(_0x20fc('0x5'));var Mustache=require(_0x20fc('0x6'));var util=require(_0x20fc('0x7'));var path=require(_0x20fc('0x8'));var sox=require(_0x20fc('0x9'));var csv=require(_0x20fc('0xa'));var ejs=require(_0x20fc('0xb'));var fs=require('fs');var fs_extra=require(_0x20fc('0xc'));var _=require(_0x20fc('0xd'));var squel=require(_0x20fc('0xe'));var crypto=require(_0x20fc('0xf'));var jsforce=require(_0x20fc('0x10'));var deskjs=require(_0x20fc('0x11'));var toCsv=require(_0x20fc('0xa'));var querystring=require(_0x20fc('0x12'));var Papa=require('papaparse');var Redis=require(_0x20fc('0x13'));var authService=require(_0x20fc('0x14'));var qs=require(_0x20fc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20fc('0x16'));var logger=require(_0x20fc('0x17'))(_0x20fc('0x18'));var utils=require(_0x20fc('0x19'));var config=require(_0x20fc('0x1a'));var licenseUtil=require(_0x20fc('0x1b'));var db=require(_0x20fc('0x1c'))['db'];var jayson=require(_0x20fc('0x1d'));var client=jayson['client'][_0x20fc('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x54caf2,_0x2b0b4a,_0x501ab7,_0x2f0048){return new BPromise(function(_0x4c7f0e,_0x520c02){var _0x18a462=_0x2f0048||client;return _0x18a462[_0x20fc('0x1f')](_0x54caf2,_0x501ab7)[_0x20fc('0x20')](function(_0x38a6da){logger[_0x20fc('0x21')](_0x20fc('0x22'),_0x2b0b4a,_0x20fc('0x23'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x2b0b4a,_0x20fc('0x23'),JSON[_0x20fc('0x24')](_0x38a6da));if(_0x38a6da[_0x20fc('0x25')]){if(_0x38a6da[_0x20fc('0x25')]['code']===0x1f4){logger[_0x20fc('0x25')](_0x20fc('0x22'),_0x2b0b4a,_0x38a6da[_0x20fc('0x25')][_0x20fc('0x26')]);return _0x520c02(_0x38a6da[_0x20fc('0x25')][_0x20fc('0x26')]);}logger[_0x20fc('0x25')](_0x20fc('0x22'),_0x2b0b4a,_0x38a6da[_0x20fc('0x25')][_0x20fc('0x26')]);return _0x4c7f0e(_0x38a6da['error'][_0x20fc('0x26')]);}else{logger[_0x20fc('0x21')]('Setting,\x20%s,\x20%s',_0x2b0b4a,_0x20fc('0x23'));_0x4c7f0e(_0x38a6da[_0x20fc('0x27')][_0x20fc('0x26')]);}})[_0x20fc('0x28')](function(_0x2ef93a){logger[_0x20fc('0x25')](_0x20fc('0x22'),_0x2b0b4a,_0x2ef93a);_0x520c02(_0x2ef93a);});});}function respondWithStatusCode(_0x4bc36b,_0x37d3ad){_0x37d3ad=_0x37d3ad||0xcc;return function(_0x25d8d9){if(_0x25d8d9){return _0x4bc36b['sendStatus'](_0x37d3ad);}return _0x4bc36b[_0x20fc('0x29')](_0x37d3ad)[_0x20fc('0x2a')]();};}function respondWithResult(_0x227ea1,_0x2ed63f){_0x2ed63f=_0x2ed63f||0xc8;return function(_0x4feaa1){if(_0x4feaa1){return _0x227ea1[_0x20fc('0x29')](_0x2ed63f)['json'](_0x4feaa1);}};}function respondWithFilteredResult(_0x4f9b49,_0x1b80f){return function(_0x554092){if(_0x554092){var _0x4d1cb3=typeof _0x1b80f[_0x20fc('0x2b')]===_0x20fc('0x2c')&&typeof _0x1b80f['limit']==='undefined';var _0x56f147=_0x554092[_0x20fc('0x2d')];var _0x295f9a=_0x4d1cb3?0x0:_0x1b80f[_0x20fc('0x2b')];var _0x2c6408=_0x4d1cb3?_0x554092['count']:_0x1b80f['offset']+_0x1b80f[_0x20fc('0x2e')];var _0x18aa2c;if(_0x2c6408>=_0x56f147){_0x2c6408=_0x56f147;_0x18aa2c=0xc8;}else{_0x18aa2c=0xce;}_0x4f9b49['status'](_0x18aa2c);return _0x4f9b49['set'](_0x20fc('0x2f'),_0x295f9a+'-'+_0x2c6408+'/'+_0x56f147)['json'](_0x554092);}return null;};}function patchUpdates(_0x21929a){return function(_0x40fe37){try{jsonpatch[_0x20fc('0x30')](_0x40fe37,_0x21929a,!![]);}catch(_0x175d51){return BPromise[_0x20fc('0x31')](_0x175d51);}return _0x40fe37[_0x20fc('0x32')]();};}function saveUpdates(_0x4bfa23,_0x1f3413){return function(_0x50ab64){if(_0x50ab64){return _0x50ab64['update'](_0x4bfa23)[_0x20fc('0x20')](function(_0x4bbe53){return _0x4bbe53;});}return null;};}function removeEntity(_0x16ee53,_0x2e2bbd){return function(_0x19b904){if(_0x19b904){return _0x19b904[_0x20fc('0x33')]()[_0x20fc('0x20')](function(){_0x16ee53['status'](0xcc)[_0x20fc('0x2a')]();});}};}function handleEntityNotFound(_0x4e31b5,_0x2f447c){return function(_0x179f08){if(!_0x179f08){_0x4e31b5['sendStatus'](0x194);}return _0x179f08;};}function handleError(_0x2faaab,_0x4d532f){_0x4d532f=_0x4d532f||0x1f4;return function(_0x158c79){logger['error'](_0x158c79['stack']);if(_0x158c79[_0x20fc('0x34')]){delete _0x158c79[_0x20fc('0x34')];}_0x2faaab[_0x20fc('0x29')](_0x4d532f)[_0x20fc('0x35')](_0x158c79);};}exports[_0x20fc('0x36')]=function(_0x11cfc0,_0x5518ce){var _0x437fa7={},_0x1d6caa={},_0x20400d={'count':0x0,'rows':[]};var _0x1ca486=_[_0x20fc('0x37')](db[_0x20fc('0x38')][_0x20fc('0x39')],function(_0x269f37){return{'name':_0x269f37['fieldName'],'type':_0x269f37[_0x20fc('0x3a')][_0x20fc('0x3b')]};});_0x1d6caa[_0x20fc('0x3c')]=_[_0x20fc('0x37')](_0x1ca486,_0x20fc('0x34'));_0x1d6caa[_0x20fc('0x3d')]=_['keys'](_0x11cfc0['query']);_0x1d6caa['filters']=_[_0x20fc('0x3e')](_0x1d6caa['model'],_0x1d6caa[_0x20fc('0x3d')]);_0x437fa7[_0x20fc('0x3f')]=_[_0x20fc('0x3e')](_0x1d6caa['model'],qs[_0x20fc('0x40')](_0x11cfc0[_0x20fc('0x3d')][_0x20fc('0x40')]));_0x437fa7[_0x20fc('0x3f')]=_0x437fa7[_0x20fc('0x3f')][_0x20fc('0x41')]?_0x437fa7[_0x20fc('0x3f')]:_0x1d6caa[_0x20fc('0x3c')];if(!_0x11cfc0[_0x20fc('0x3d')][_0x20fc('0x42')](_0x20fc('0x43'))){_0x437fa7[_0x20fc('0x2e')]=qs['limit'](_0x11cfc0[_0x20fc('0x3d')][_0x20fc('0x2e')]);_0x437fa7[_0x20fc('0x2b')]=qs[_0x20fc('0x2b')](_0x11cfc0['query']['offset']);}_0x437fa7[_0x20fc('0x44')]=qs[_0x20fc('0x45')](_0x11cfc0[_0x20fc('0x3d')][_0x20fc('0x45')]);_0x437fa7['where']=qs['filters'](_[_0x20fc('0x46')](_0x11cfc0[_0x20fc('0x3d')],_0x1d6caa[_0x20fc('0x47')]),_0x1ca486);if(_0x11cfc0[_0x20fc('0x3d')]['filter']){_0x437fa7['where']=_[_0x20fc('0x48')](_0x437fa7[_0x20fc('0x49')],{'$or':_[_0x20fc('0x37')](_0x1ca486,function(_0x1c27b2){if(_0x1c27b2[_0x20fc('0x3a')]!=='VIRTUAL'){var _0x1687d3={};_0x1687d3[_0x1c27b2['name']]={'$like':'%'+_0x11cfc0[_0x20fc('0x3d')][_0x20fc('0x4a')]+'%'};return _0x1687d3;}})});}_0x437fa7=_[_0x20fc('0x48')]({},_0x437fa7,_0x11cfc0[_0x20fc('0x4b')]);var _0x30d630={'where':_0x437fa7[_0x20fc('0x49')]};return db[_0x20fc('0x38')][_0x20fc('0x2d')](_0x30d630)[_0x20fc('0x20')](function(_0xc692c8){_0x20400d[_0x20fc('0x2d')]=_0xc692c8;if(_0x11cfc0[_0x20fc('0x3d')][_0x20fc('0x4c')]){_0x437fa7[_0x20fc('0x4d')]=[{'all':!![]}];}return db[_0x20fc('0x38')][_0x20fc('0x4e')](_0x437fa7);})['then'](function(_0x21f50e){_0x20400d[_0x20fc('0x4f')]=_0x21f50e;return _0x20400d;})[_0x20fc('0x20')](respondWithFilteredResult(_0x5518ce,_0x437fa7))[_0x20fc('0x28')](handleError(_0x5518ce,null));};exports[_0x20fc('0x50')]=function(_0x423c69,_0x10be94){var _0x2a2897={'raw':![],'where':{'id':_0x423c69[_0x20fc('0x51')]['id']}},_0x35d84c={};_0x35d84c[_0x20fc('0x3c')]=_['keys'](db[_0x20fc('0x38')][_0x20fc('0x39')]);_0x35d84c[_0x20fc('0x3d')]=_[_0x20fc('0x52')](_0x423c69[_0x20fc('0x3d')]);_0x35d84c[_0x20fc('0x47')]=_['intersection'](_0x35d84c[_0x20fc('0x3c')],_0x35d84c[_0x20fc('0x3d')]);_0x2a2897[_0x20fc('0x3f')]=_[_0x20fc('0x3e')](_0x35d84c[_0x20fc('0x3c')],qs[_0x20fc('0x40')](_0x423c69[_0x20fc('0x3d')][_0x20fc('0x40')]));_0x2a2897['attributes']=_0x2a2897['attributes'][_0x20fc('0x41')]?_0x2a2897[_0x20fc('0x3f')]:_0x35d84c[_0x20fc('0x3c')];if(_0x423c69[_0x20fc('0x3d')]['includeAll']){_0x2a2897['include']=[{'all':!![]}];}_0x2a2897=_['merge']({},_0x2a2897,_0x423c69[_0x20fc('0x4b')]);return db[_0x20fc('0x38')][_0x20fc('0x53')](_0x2a2897)['then'](handleEntityNotFound(_0x10be94,null))[_0x20fc('0x20')](respondWithResult(_0x10be94,null))[_0x20fc('0x28')](handleError(_0x10be94,null));};exports[_0x20fc('0x54')]=function(_0x1159a2,_0x4cd106){if(_0x1159a2[_0x20fc('0x55')]['id']){delete _0x1159a2[_0x20fc('0x55')]['id'];}return db[_0x20fc('0x38')]['find']({'where':{'id':_0x1159a2[_0x20fc('0x51')]['id']}})[_0x20fc('0x20')](handleEntityNotFound(_0x4cd106,null))[_0x20fc('0x20')](saveUpdates(_0x1159a2[_0x20fc('0x55')],null))[_0x20fc('0x20')](respondWithResult(_0x4cd106,null))[_0x20fc('0x28')](handleError(_0x4cd106,null));};exports[_0x20fc('0x56')]=function(_0x1c7fa9,_0xeec2e7,_0xe2a09b){if(_0x1c7fa9[_0x20fc('0x57')]&&_0x1c7fa9['file'][_0x20fc('0x58')]){_0x1c7fa9[_0x20fc('0x55')][_0x20fc('0x59')]=_0x1c7fa9[_0x20fc('0x57')]['filename'];}return db[_0x20fc('0x38')][_0x20fc('0x53')]({'where':{'id':_0x1c7fa9[_0x20fc('0x51')]['id']}})[_0x20fc('0x20')](handleEntityNotFound(_0xeec2e7,null))['then'](saveUpdates(_0x1c7fa9['body'],null))[_0x20fc('0x20')](respondWithResult(_0xeec2e7,null))[_0x20fc('0x28')](handleError(_0xeec2e7,null));};exports[_0x20fc('0x5a')]=function(_0x5c0746,_0x273914,_0x55b3f3){if(_0x5c0746['file']&&_0x5c0746[_0x20fc('0x57')][_0x20fc('0x58')]){_0x5c0746[_0x20fc('0x55')][_0x20fc('0x5b')]=_0x5c0746['file'][_0x20fc('0x58')];}return db['Setting'][_0x20fc('0x53')]({'where':{'id':_0x5c0746[_0x20fc('0x51')]['id']}})[_0x20fc('0x20')](handleEntityNotFound(_0x273914,null))[_0x20fc('0x20')](saveUpdates(_0x5c0746[_0x20fc('0x55')],null))[_0x20fc('0x20')](respondWithResult(_0x273914,null))[_0x20fc('0x28')](handleError(_0x273914,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x5ccff8,_0x1a12ea,_0x525fba){var _0x366f18='server/files/images/logos';var _0x3608fd={'custom':![]};return utilLicense[_0x20fc('0x5c')]()['then'](function(_0x3bbd76){if(_0x3bbd76){_0x3608fd=_0x3bbd76;}return db[_0x20fc('0x38')][_0x20fc('0x53')]({'where':{'id':_0x5ccff8[_0x20fc('0x51')]['id']},'attributes':[_0x20fc('0x59'),'loginLogo','preferred',_0x20fc('0x5d'),_0x20fc('0x5e'),_0x20fc('0x5f'),_0x20fc('0x60'),_0x20fc('0x61')],'raw':!![]});})[_0x20fc('0x20')](handleEntityNotFound(_0x1a12ea,null))[_0x20fc('0x20')](function(_0x3454c7){if(_0x3454c7){var _0x221ad8=_0x3454c7['logo']&&fs[_0x20fc('0x62')](path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0x366f18,_[_0x20fc('0x65')](_0x3454c7[_0x20fc('0x59')])))?path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0x366f18,_[_0x20fc('0x65')](_0x3454c7['logo'])):path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0x366f18,_[_0x20fc('0x65')](_0x20fc('0x66')));var _0x1ac554=_0x20fc('0x67')+_[_0x20fc('0x68')](_0x20fc('0x59'));if(_0x3454c7[_0x1ac554]||!_0x3608fd[_0x20fc('0x69')]){_0x221ad8=path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0x366f18,_['toLower']('default_logo.svg'));}if(!fs['existsSync'](_0x221ad8)){throw new db['Sequelize'][(_0x20fc('0x6a'))](_[_0x20fc('0x68')](_0x20fc('0x59'))+'\x20not\x20found');}return _0x1a12ea['download'](_0x221ad8);}})[_0x20fc('0x28')](handleError(_0x1a12ea,null));};var utilLicense=require(_0x20fc('0x1b'));exports['getLogoLogin']=function(_0x5eaeaf,_0x2f07f5,_0x441aaa){var _0xd8c1de=_0x20fc('0x6b');var _0x504f0f={'custom':![]};return utilLicense['getLicense']()[_0x20fc('0x20')](function(_0x337d76){if(_0x337d76){_0x504f0f=_0x337d76;}return db[_0x20fc('0x38')][_0x20fc('0x53')]({'where':{'id':_0x5eaeaf[_0x20fc('0x51')]['id']},'attributes':[_0x20fc('0x59'),_0x20fc('0x5b'),_0x20fc('0x6c'),'favicon','defaultLogo',_0x20fc('0x5f'),_0x20fc('0x60'),_0x20fc('0x61')],'raw':!![]});})[_0x20fc('0x20')](handleEntityNotFound(_0x2f07f5,null))[_0x20fc('0x20')](function(_0x3f6bef){if(_0x3f6bef){var _0x4348f8=_0x3f6bef[_0x20fc('0x5b')]&&fs[_0x20fc('0x62')](path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0xd8c1de,_[_0x20fc('0x65')](_0x3f6bef[_0x20fc('0x5b')])))?path['join'](config[_0x20fc('0x64')],_0xd8c1de,_[_0x20fc('0x65')](_0x3f6bef[_0x20fc('0x5b')])):path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0xd8c1de,_[_0x20fc('0x65')](_0x20fc('0x6d')));var _0x427aff='default'+_['upperFirst'](_0x20fc('0x5b'));if(_0x3f6bef[_0x427aff]||!_0x504f0f['custom']){_0x4348f8=path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0xd8c1de,_['toLower'](_0x20fc('0x6d')));}if(!fs[_0x20fc('0x62')](_0x4348f8)){throw new db[(_0x20fc('0x6e'))][(_0x20fc('0x6a'))](_[_0x20fc('0x68')](_0x20fc('0x5b'))+_0x20fc('0x6f'));}return _0x2f07f5[_0x20fc('0x70')](_0x4348f8);}})[_0x20fc('0x28')](handleError(_0x2f07f5,null));};exports[_0x20fc('0x71')]=function(_0x1b6db6,_0x2a7c79){return db['Setting'][_0x20fc('0x53')]({'where':{'id':_0x1b6db6[_0x20fc('0x51')]['id']},'attributes':[_0x20fc('0x72')]})['then'](respondWithResult(_0x2a7c79,null))['catch'](handleError(_0x2a7c79,null));};exports[_0x20fc('0x73')]=function(_0x392a1b,_0x317dc0,_0x4377dc){if(_0x392a1b[_0x20fc('0x57')]&&_0x392a1b[_0x20fc('0x57')][_0x20fc('0x58')]){_0x392a1b[_0x20fc('0x55')][_0x20fc('0x6c')]=_0x392a1b[_0x20fc('0x57')]['filename'];}return db[_0x20fc('0x38')][_0x20fc('0x53')]({'where':{'id':_0x392a1b[_0x20fc('0x51')]['id']}})['then'](handleEntityNotFound(_0x317dc0,null))[_0x20fc('0x20')](saveUpdates(_0x392a1b[_0x20fc('0x55')],null))[_0x20fc('0x20')](respondWithResult(_0x317dc0,null))[_0x20fc('0x28')](handleError(_0x317dc0,null));};var utilLicense=require(_0x20fc('0x1b'));exports['getPreferred']=function(_0xc7dae8,_0xca8ef2,_0x1eed8f){var _0x1d0cbd=_0x20fc('0x6b');var _0x3b4a00={'custom':![]};return utilLicense[_0x20fc('0x5c')]()[_0x20fc('0x20')](function(_0x5d9d23){if(_0x5d9d23){_0x3b4a00=_0x5d9d23;}return db[_0x20fc('0x38')]['find']({'where':{'id':_0xc7dae8[_0x20fc('0x51')]['id']},'attributes':[_0x20fc('0x59'),'loginLogo','preferred','favicon',_0x20fc('0x5e'),_0x20fc('0x5f'),_0x20fc('0x60'),'defaultFavicon'],'raw':!![]});})[_0x20fc('0x20')](handleEntityNotFound(_0xca8ef2,null))[_0x20fc('0x20')](function(_0x4eb0d4){if(_0x4eb0d4){var _0xcc3f0c=_0x4eb0d4['preferred']&&fs['existsSync'](path['join'](config['root'],_0x1d0cbd,_[_0x20fc('0x65')](_0x4eb0d4['preferred'])))?path['join'](config[_0x20fc('0x64')],_0x1d0cbd,_['toLower'](_0x4eb0d4['preferred'])):path[_0x20fc('0x63')](config['root'],_0x1d0cbd,_[_0x20fc('0x65')](_0x20fc('0x74')));var _0x205f84='default'+_['upperFirst'](_0x20fc('0x6c'));if(_0x4eb0d4[_0x205f84]||!_0x3b4a00[_0x20fc('0x69')]||!_0x3b4a00[_0x20fc('0x6c')]){_0xcc3f0c=path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0x1d0cbd,_[_0x20fc('0x65')](_0x20fc('0x74')));}if(!fs['existsSync'](_0xcc3f0c)){throw new db[(_0x20fc('0x6e'))]['ValidationError'](_[_0x20fc('0x68')](_0x20fc('0x6c'))+_0x20fc('0x6f'));}return _0xca8ef2[_0x20fc('0x70')](_0xcc3f0c);}})['catch'](handleError(_0xca8ef2,null));};exports[_0x20fc('0x75')]=function(_0x246ee2,_0x4633fb,_0xa9b415){if(_0x246ee2['file']&&_0x246ee2[_0x20fc('0x57')][_0x20fc('0x58')]){_0x246ee2[_0x20fc('0x55')][_0x20fc('0x5d')]=_0x246ee2[_0x20fc('0x57')][_0x20fc('0x58')];}return db[_0x20fc('0x38')]['find']({'where':{'id':_0x246ee2[_0x20fc('0x51')]['id']}})[_0x20fc('0x20')](handleEntityNotFound(_0x4633fb,null))[_0x20fc('0x20')](saveUpdates(_0x246ee2['body'],null))[_0x20fc('0x20')](respondWithResult(_0x4633fb,null))[_0x20fc('0x28')](handleError(_0x4633fb,null));};var utilLicense=require(_0x20fc('0x1b'));exports[_0x20fc('0x76')]=function(_0x2b3f51,_0x40c5b3,_0x397faf){var _0x52534a=_0x20fc('0x6b');var _0xbe1fe6={'custom':![]};return utilLicense[_0x20fc('0x5c')]()['then'](function(_0x4e7d90){if(_0x4e7d90){_0xbe1fe6=_0x4e7d90;}return db['Setting'][_0x20fc('0x53')]({'where':{'id':_0x2b3f51['params']['id']},'attributes':[_0x20fc('0x59'),'loginLogo',_0x20fc('0x6c'),_0x20fc('0x5d'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x20fc('0x61')],'raw':!![]});})[_0x20fc('0x20')](handleEntityNotFound(_0x40c5b3,null))['then'](function(_0x1b7210){if(_0x1b7210){var _0x3cedd8=_0x1b7210[_0x20fc('0x5d')]&&fs[_0x20fc('0x62')](path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0x52534a,_['toLower'](_0x1b7210[_0x20fc('0x5d')])))?path['join'](config[_0x20fc('0x64')],_0x52534a,_[_0x20fc('0x65')](_0x1b7210['favicon'])):path[_0x20fc('0x63')](config[_0x20fc('0x64')],_0x52534a,_['toLower'](_0x20fc('0x77')));var _0x3d79d4='default'+_['upperFirst'](_0x20fc('0x5d'));if(_0x1b7210[_0x3d79d4]||!_0xbe1fe6['custom']){_0x3cedd8=path['join'](config[_0x20fc('0x64')],_0x52534a,_[_0x20fc('0x65')](_0x20fc('0x77')));}if(!fs['existsSync'](_0x3cedd8)){throw new db['Sequelize'][(_0x20fc('0x6a'))](_[_0x20fc('0x68')](_0x20fc('0x5d'))+_0x20fc('0x6f'));}return _0x40c5b3['download'](_0x3cedd8);}})[_0x20fc('0x28')](handleError(_0x40c5b3,null));};exports[_0x20fc('0x78')]=function(_0x19147e,_0x3437d0){var _0xdda714={'offset':moment()[_0x20fc('0x79')]()};_0xdda714['now']=moment()['utcOffset'](_0xdda714[_0x20fc('0x2b')])['format'](_0x20fc('0x7a'));return _0x3437d0[_0x20fc('0x29')](0xc8)['send'](_0xdda714);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8ecd8a9..776da6b 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x45c167,_0x41a9c0){var _0x3341cd=function(_0x5e7f93){while(--_0x5e7f93){_0x45c167['push'](_0x45c167['shift']());}};_0x3341cd(++_0x41a9c0);}(_0xedd9,0xfc));var _0x9edd=function(_0x42b15e,_0x203cc5){_0x42b15e=_0x42b15e-0x0;var _0x11ad63=_0xedd9[_0x42b15e];return _0x11ad63;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x206d02,_0x49992b){var _0x45833c=function(_0x4711c6){while(--_0x4711c6){_0x206d02['push'](_0x206d02['shift']());}};_0x45833c(++_0x49992b);}(_0x34e8,0x12c));var _0x834e=function(_0x4cfb2e,_0x2c382e){_0x4cfb2e=_0x4cfb2e-0x0;var _0x442ce0=_0x34e8[_0x4cfb2e];return _0x442ce0;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 7547bc1..4bae9c1 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 _0x791d=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','options','raw','where','attributes','model','include','map','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2ddd42,_0x39be46){var _0x189dc1=function(_0xab9aac){while(--_0xab9aac){_0x2ddd42['push'](_0x2ddd42['shift']());}};_0x189dc1(++_0x39be46);}(_0x791d,0x1c8));var _0xd791=function(_0x504202,_0x9092e5){_0x504202=_0x504202-0x0;var _0x15f061=_0x791d[_0x504202];return _0x15f061;};'use strict';var _=require(_0xd791('0x0'));var util=require(_0xd791('0x1'));var moment=require(_0xd791('0x2'));var BPromise=require(_0xd791('0x3'));var rs=require(_0xd791('0x4'));var fs=require('fs');var Redis=require(_0xd791('0x5'));var db=require(_0xd791('0x6'))['db'];var utils=require(_0xd791('0x7'));var logger=require(_0xd791('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd791('0x9'));var client=jayson['client'][_0xd791('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x350942,_0x3468de,_0x5055bd){return new BPromise(function(_0x3ef276,_0x578ee0){return client[_0xd791('0xb')](_0x350942,_0x5055bd)[_0xd791('0xc')](function(_0x5174e7){logger[_0xd791('0xd')](_0xd791('0xe'),_0x3468de,_0xd791('0xf'));logger[_0xd791('0x10')](_0xd791('0x11'),_0x3468de,_0xd791('0xf'),JSON[_0xd791('0x12')](_0x5174e7));if(_0x5174e7[_0xd791('0x13')]){if(_0x5174e7[_0xd791('0x13')][_0xd791('0x14')]===0x1f4){logger[_0xd791('0x13')](_0xd791('0xe'),_0x3468de,_0x5174e7[_0xd791('0x13')][_0xd791('0x15')]);return _0x578ee0(_0x5174e7[_0xd791('0x13')][_0xd791('0x15')]);}logger[_0xd791('0x13')](_0xd791('0xe'),_0x3468de,_0x5174e7[_0xd791('0x13')][_0xd791('0x15')]);return _0x3ef276(_0x5174e7[_0xd791('0x13')][_0xd791('0x15')]);}else{logger[_0xd791('0xd')](_0xd791('0xe'),_0x3468de,_0xd791('0xf'));_0x3ef276(_0x5174e7[_0xd791('0x16')][_0xd791('0x15')]);}})[_0xd791('0x17')](function(_0x3ae028){logger[_0xd791('0x13')]('Setting,\x20%s,\x20%s',_0x3468de,_0x3ae028);_0x578ee0(_0x3ae028);});});}exports[_0xd791('0x18')]=function(_0xa4ede2){var _0x48fd8a=this;return new Promise(function(_0x1bf4aa,_0xc5464d){return db[_0xd791('0x19')]['find']({'raw':_0xa4ede2[_0xd791('0x1a')]?_0xa4ede2[_0xd791('0x1a')][_0xd791('0x1b')]===undefined?!![]:![]:!![],'where':_0xa4ede2[_0xd791('0x1a')]?_0xa4ede2[_0xd791('0x1a')][_0xd791('0x1c')]||null:null,'attributes':_0xa4ede2['options']?_0xa4ede2[_0xd791('0x1a')][_0xd791('0x1d')]||null:null,'include':_0xa4ede2['options']?_0xa4ede2[_0xd791('0x1a')]['include']?_['map'](_0xa4ede2['options']['include'],function(_0x15a9bb){return{'model':db[_0x15a9bb[_0xd791('0x1e')]],'as':_0x15a9bb['as'],'attributes':_0x15a9bb['attributes'],'include':_0x15a9bb[_0xd791('0x1f')]?_[_0xd791('0x20')](_0x15a9bb[_0xd791('0x1f')],function(_0x502bce){return{'model':db[_0x502bce[_0xd791('0x1e')]],'as':_0x502bce['as'],'attributes':_0x502bce[_0xd791('0x1d')],'include':_0x502bce[_0xd791('0x1f')]?_[_0xd791('0x20')](_0x502bce[_0xd791('0x1f')],function(_0x3ea5ea){return{'model':db[_0x3ea5ea[_0xd791('0x1e')]],'as':_0x3ea5ea['as'],'attributes':_0x3ea5ea[_0xd791('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd791('0xc')](function(_0xfecd70){logger[_0xd791('0xd')](_0xd791('0x18'),_0xa4ede2);logger[_0xd791('0x10')]('ShowSetting',_0xa4ede2,JSON[_0xd791('0x12')](_0xfecd70));_0x1bf4aa(_0xfecd70);})['catch'](function(_0x417220){logger[_0xd791('0x13')]('ShowSetting',_0x417220['message'],_0xa4ede2);_0xc5464d(_0x48fd8a[_0xd791('0x13')](0x1f4,_0x417220['message']));});});}; \ No newline at end of file +var _0x1425=['Setting','options','raw','include','model','attributes','map','ShowSetting','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x56e833,_0x19de94){var _0x29785f=function(_0x4fa8cc){while(--_0x4fa8cc){_0x56e833['push'](_0x56e833['shift']());}};_0x29785f(++_0x19de94);}(_0x1425,0x189));var _0x5142=function(_0x22ed6e,_0x48a502){_0x22ed6e=_0x22ed6e-0x0;var _0x484207=_0x1425[_0x22ed6e];return _0x484207;};'use strict';var _=require(_0x5142('0x0'));var util=require(_0x5142('0x1'));var moment=require(_0x5142('0x2'));var BPromise=require(_0x5142('0x3'));var rs=require(_0x5142('0x4'));var fs=require('fs');var Redis=require(_0x5142('0x5'));var db=require(_0x5142('0x6'))['db'];var utils=require(_0x5142('0x7'));var logger=require('../../config/logger')(_0x5142('0x8'));var config=require(_0x5142('0x9'));var jayson=require(_0x5142('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45fec1,_0x3c84da,_0x5eb19a){return new BPromise(function(_0x1d836b,_0x4612e9){return client[_0x5142('0xb')](_0x45fec1,_0x5eb19a)[_0x5142('0xc')](function(_0x1f4b95){logger['info'](_0x5142('0xd'),_0x3c84da,_0x5142('0xe'));logger[_0x5142('0xf')](_0x5142('0x10'),_0x3c84da,_0x5142('0xe'),JSON['stringify'](_0x1f4b95));if(_0x1f4b95[_0x5142('0x11')]){if(_0x1f4b95[_0x5142('0x11')][_0x5142('0x12')]===0x1f4){logger['error'](_0x5142('0xd'),_0x3c84da,_0x1f4b95[_0x5142('0x11')][_0x5142('0x13')]);return _0x4612e9(_0x1f4b95[_0x5142('0x11')][_0x5142('0x13')]);}logger[_0x5142('0x11')]('Setting,\x20%s,\x20%s',_0x3c84da,_0x1f4b95['error']['message']);return _0x1d836b(_0x1f4b95['error'][_0x5142('0x13')]);}else{logger[_0x5142('0x14')](_0x5142('0xd'),_0x3c84da,_0x5142('0xe'));_0x1d836b(_0x1f4b95[_0x5142('0x15')][_0x5142('0x13')]);}})[_0x5142('0x16')](function(_0x55cc49){logger[_0x5142('0x11')](_0x5142('0xd'),_0x3c84da,_0x55cc49);_0x4612e9(_0x55cc49);});});}exports['ShowSetting']=function(_0x518a89){var _0x5691c1=this;return new Promise(function(_0xd609e3,_0x58621e){return db[_0x5142('0x17')]['find']({'raw':_0x518a89[_0x5142('0x18')]?_0x518a89[_0x5142('0x18')][_0x5142('0x19')]===undefined?!![]:![]:!![],'where':_0x518a89[_0x5142('0x18')]?_0x518a89[_0x5142('0x18')]['where']||null:null,'attributes':_0x518a89['options']?_0x518a89[_0x5142('0x18')]['attributes']||null:null,'include':_0x518a89['options']?_0x518a89[_0x5142('0x18')]['include']?_['map'](_0x518a89[_0x5142('0x18')][_0x5142('0x1a')],function(_0x5bfe46){return{'model':db[_0x5bfe46[_0x5142('0x1b')]],'as':_0x5bfe46['as'],'attributes':_0x5bfe46[_0x5142('0x1c')],'include':_0x5bfe46['include']?_[_0x5142('0x1d')](_0x5bfe46[_0x5142('0x1a')],function(_0x11596a){return{'model':db[_0x11596a[_0x5142('0x1b')]],'as':_0x11596a['as'],'attributes':_0x11596a[_0x5142('0x1c')],'include':_0x11596a['include']?_[_0x5142('0x1d')](_0x11596a[_0x5142('0x1a')],function(_0x4e04f8){return{'model':db[_0x4e04f8[_0x5142('0x1b')]],'as':_0x4e04f8['as'],'attributes':_0x4e04f8[_0x5142('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x378531){logger[_0x5142('0x14')]('ShowSetting',_0x518a89);logger[_0x5142('0xf')](_0x5142('0x1e'),_0x518a89,JSON[_0x5142('0x1f')](_0x378531));_0xd609e3(_0x378531);})[_0x5142('0x16')](function(_0x35fce0){logger[_0x5142('0x11')](_0x5142('0x1e'),_0x35fce0[_0x5142('0x13')],_0x518a89);_0x58621e(_0x5691c1[_0x5142('0x11')](0x1f4,_0x35fce0[_0x5142('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index c069cfc..1ad8496 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 _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0xd79d32,_0x3728ee){var _0x49b253=function(_0x21dbf0){while(--_0x21dbf0){_0xd79d32['push'](_0xd79d32['shift']());}};_0x49b253(++_0x3728ee);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file +var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x58c1ac,_0x531ed8){var _0x3eaf36=function(_0x3bac02){while(--_0x3bac02){_0x58c1ac['push'](_0x58c1ac['shift']());}};_0x3eaf36(++_0x531ed8);}(_0x53ec,0x192));var _0xc53e=function(_0x2daab7,_0x377337){_0x2daab7=_0x2daab7-0x0;var _0x1714da=_0x53ec[_0x2daab7];return _0x1714da;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 62e5a0a..50438eb 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 _0x277f=['skebby','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','ENUM'];(function(_0x3a3525,_0x5bee02){var _0x56e306=function(_0x3b21fc){while(--_0x3b21fc){_0x3a3525['push'](_0x3a3525['shift']());}};_0x56e306(++_0x5bee02);}(_0x277f,0x1b1));var _0xf277=function(_0x88e90e,_0x3f8529){_0x88e90e=_0x88e90e-0x0;var _0x40841c=_0x277f[_0x88e90e];return _0x40841c;};'use strict';var Sequelize=require(_0xf277('0x0'));var rs=require(_0xf277('0x1'));module[_0xf277('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf277('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xf277('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf277('0x5')]();}},'phone':{'type':Sequelize[_0xf277('0x4')]},'type':{'type':Sequelize[_0xf277('0x6')]('twilio',_0xf277('0x7'),'connectel',_0xf277('0x8'),_0xf277('0x9'),_0xf277('0xa'),'bandwidth',_0xf277('0xb'),'infobip',_0xf277('0xc'))},'accountSid':{'type':Sequelize[_0xf277('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xf277('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf277('0x4')]},'apiKey':{'type':Sequelize[_0xf277('0x4')]},'applicationId':{'type':Sequelize[_0xf277('0x4')]},'accountId':{'type':Sequelize[_0xf277('0x4')]},'senderString':{'type':Sequelize[_0xf277('0x4')]},'deliveryReport':{'type':Sequelize[_0xf277('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xf277('0x4')]},'notificationTemplate':{'type':Sequelize[_0xf277('0xe')],'defaultValue':function(){return _0xf277('0xf');}},'notificationSound':{'type':Sequelize[_0xf277('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf277('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf277('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf277('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf277('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf277('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf277('0x10')],'comment':_0xf277('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49d47b){if(!_0x49d47b)this[_0xf277('0x12')](_0xf277('0x13'),null);this['setDataValue']('mandatoryDisposition',_0x49d47b);}}}; \ No newline at end of file +var _0xc232=['INTEGER','setDataValue','mandatoryDisposition','exports','STRING','generate','ENUM','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xc232,0x18a));var _0x2c23=function(_0x20de57,_0x15a692){_0x20de57=_0x20de57-0x0;var _0x2b7920=_0xc232[_0x20de57];return _0x2b7920;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x2c23('0x0')]={'name':{'type':Sequelize[_0x2c23('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2c23('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x2c23('0x1')],'defaultValue':function(){return rs[_0x2c23('0x2')]();}},'phone':{'type':Sequelize[_0x2c23('0x1')]},'type':{'type':Sequelize[_0x2c23('0x3')]('twilio','skebby',_0x2c23('0x4'),_0x2c23('0x5'),_0x2c23('0x6'),_0x2c23('0x7'),'bandwidth',_0x2c23('0x8'),_0x2c23('0x9'),_0x2c23('0xa'))},'accountSid':{'type':Sequelize[_0x2c23('0x1')]},'authId':{'type':Sequelize[_0x2c23('0x1')]},'authToken':{'type':Sequelize[_0x2c23('0x1')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x2c23('0x1')]},'password':{'type':Sequelize[_0x2c23('0x1')]},'apiKey':{'type':Sequelize[_0x2c23('0x1')]},'applicationId':{'type':Sequelize[_0x2c23('0x1')]},'accountId':{'type':Sequelize[_0x2c23('0x1')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x2c23('0x1')]},'notificationTemplate':{'type':Sequelize[_0x2c23('0xb')],'defaultValue':function(){return _0x2c23('0xc');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2c23('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2c23('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2c23('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2c23('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2c23('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2c23('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x51ad04){if(!_0x51ad04)this[_0x2c23('0xf')]('mandatoryDispositionPauseId',null);this[_0x2c23('0xf')](_0x2c23('0x10'),_0x51ad04);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index b36d85a..956a78c 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 _0xbfe8=['addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','applications','orderBy','Applications','priority','account','CmContact','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','Contact','Owner','fullname','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','infobip','groupName','DELIVERED','redif','skebby','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','debug','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','UserProfileResource','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','length','rows','removeDispositions','ids'];(function(_0x2bc6a2,_0x44e6ea){var _0x50f1ce=function(_0x2d3e20){while(--_0x2d3e20){_0x2bc6a2['push'](_0x2bc6a2['shift']());}};_0x50f1ce(++_0x44e6ea);}(_0xbfe8,0x74));var _0x8bfe=function(_0x3b9f69,_0x4609d0){_0x3b9f69=_0x3b9f69-0x0;var _0x3714c2=_0xbfe8[_0x3b9f69];return _0x3714c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8bfe('0x0'));var zipdir=require(_0x8bfe('0x1'));var jsonpatch=require(_0x8bfe('0x2'));var rp=require(_0x8bfe('0x3'));var moment=require(_0x8bfe('0x4'));var BPromise=require(_0x8bfe('0x5'));var Mustache=require(_0x8bfe('0x6'));var util=require(_0x8bfe('0x7'));var path=require('path');var sox=require(_0x8bfe('0x8'));var csv=require(_0x8bfe('0x9'));var ejs=require(_0x8bfe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bfe('0xb'));var squel=require(_0x8bfe('0xc'));var crypto=require(_0x8bfe('0xd'));var jsforce=require(_0x8bfe('0xe'));var deskjs=require(_0x8bfe('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8bfe('0x10'));var Papa=require(_0x8bfe('0x11'));var Redis=require(_0x8bfe('0x12'));var authService=require(_0x8bfe('0x13'));var qs=require(_0x8bfe('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bfe('0x15'));var logger=require(_0x8bfe('0x16'))(_0x8bfe('0x17'));var utils=require(_0x8bfe('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8bfe('0x19'));var db=require(_0x8bfe('0x1a'))['db'];config[_0x8bfe('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8bfe('0x1c'))(new Redis(config[_0x8bfe('0x1b')]));require(_0x8bfe('0x1d'))[_0x8bfe('0x1e')](socket);var jayson=require(_0x8bfe('0x1f'));var client=jayson['client'][_0x8bfe('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x51f618,_0x556bf1,_0x15c090,_0x1f547a){return new BPromise(function(_0x4d4c40,_0x1fca63){var _0x5beb76=_0x1f547a||client;return _0x5beb76[_0x8bfe('0x21')](_0x51f618,_0x15c090)[_0x8bfe('0x22')](function(_0x3932b7){logger[_0x8bfe('0x23')]('SmsAccount,\x20%s,\x20%s',_0x556bf1,_0x8bfe('0x24'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x556bf1,'request\x20sent',JSON[_0x8bfe('0x25')](_0x3932b7));if(_0x3932b7[_0x8bfe('0x26')]){if(_0x3932b7[_0x8bfe('0x26')][_0x8bfe('0x27')]===0x1f4){logger['error'](_0x8bfe('0x28'),_0x556bf1,_0x3932b7[_0x8bfe('0x26')][_0x8bfe('0x29')]);return _0x1fca63(_0x3932b7[_0x8bfe('0x26')][_0x8bfe('0x29')]);}logger[_0x8bfe('0x26')]('SmsAccount,\x20%s,\x20%s',_0x556bf1,_0x3932b7[_0x8bfe('0x26')][_0x8bfe('0x29')]);return _0x4d4c40(_0x3932b7['error']['message']);}else{logger[_0x8bfe('0x23')]('SmsAccount,\x20%s,\x20%s',_0x556bf1,_0x8bfe('0x24'));_0x4d4c40(_0x3932b7['result'][_0x8bfe('0x29')]);}})[_0x8bfe('0x2a')](function(_0x42722f){logger[_0x8bfe('0x26')]('SmsAccount,\x20%s,\x20%s',_0x556bf1,_0x42722f);_0x1fca63(_0x42722f);});});}function respondWithStatusCode(_0x2692e0,_0x5a9577){_0x5a9577=_0x5a9577||0xcc;return function(_0x2345eb){if(_0x2345eb){return _0x2692e0[_0x8bfe('0x2b')](_0x5a9577);}return _0x2692e0[_0x8bfe('0x2c')](_0x5a9577)['end']();};}function respondWithResult(_0x412d54,_0x5a970d){_0x5a970d=_0x5a970d||0xc8;return function(_0x388eab){if(_0x388eab){return _0x412d54['status'](_0x5a970d)[_0x8bfe('0x2d')](_0x388eab);}};}function respondWithFilteredResult(_0x3469b1,_0x1f9dc7){return function(_0x4e86d5){if(_0x4e86d5){var _0x50b240=typeof _0x1f9dc7[_0x8bfe('0x2e')]===_0x8bfe('0x2f')&&typeof _0x1f9dc7[_0x8bfe('0x30')]==='undefined';var _0x137ad0=_0x4e86d5[_0x8bfe('0x31')];var _0x1894dc=_0x50b240?0x0:_0x1f9dc7[_0x8bfe('0x2e')];var _0xeb1840=_0x50b240?_0x4e86d5[_0x8bfe('0x31')]:_0x1f9dc7[_0x8bfe('0x2e')]+_0x1f9dc7[_0x8bfe('0x30')];var _0x4a187f;if(_0xeb1840>=_0x137ad0){_0xeb1840=_0x137ad0;_0x4a187f=0xc8;}else{_0x4a187f=0xce;}_0x3469b1[_0x8bfe('0x2c')](_0x4a187f);return _0x3469b1[_0x8bfe('0x32')](_0x8bfe('0x33'),_0x1894dc+'-'+_0xeb1840+'/'+_0x137ad0)[_0x8bfe('0x2d')](_0x4e86d5);}return null;};}function patchUpdates(_0x1f01b9){return function(_0x240534){try{jsonpatch[_0x8bfe('0x34')](_0x240534,_0x1f01b9,!![]);}catch(_0x9ce04f){return BPromise[_0x8bfe('0x35')](_0x9ce04f);}return _0x240534['save']();};}function saveUpdates(_0x4cf13d,_0x423f12){return function(_0x5067f9){if(_0x5067f9){return _0x5067f9[_0x8bfe('0x36')](_0x4cf13d)[_0x8bfe('0x22')](function(_0x319ffb){return _0x319ffb;});}return null;};}function removeEntity(_0x3b36a3,_0x1e5901){return function(_0x529f1d){if(_0x529f1d){return _0x529f1d['destroy']()['then'](function(){var _0x3b3828=_0x529f1d[_0x8bfe('0x37')]({'plain':!![]});var _0x37b6e6='SmsAccounts';return db[_0x8bfe('0x38')][_0x8bfe('0x39')]({'where':{'type':_0x37b6e6,'resourceId':_0x3b3828['id']}})[_0x8bfe('0x22')](function(){return _0x529f1d;});})[_0x8bfe('0x22')](function(){_0x3b36a3[_0x8bfe('0x2c')](0xcc)[_0x8bfe('0x3a')]();});}};}function handleEntityNotFound(_0x3d5b54,_0xbd7e52){return function(_0x5201e7){if(!_0x5201e7){_0x3d5b54[_0x8bfe('0x2b')](0x194);}return _0x5201e7;};}function handleError(_0x46bcdc,_0x15ba44){_0x15ba44=_0x15ba44||0x1f4;return function(_0x2b4c32){logger[_0x8bfe('0x26')](_0x2b4c32[_0x8bfe('0x3b')]);if(_0x2b4c32[_0x8bfe('0x3c')]){delete _0x2b4c32['name'];}_0x46bcdc[_0x8bfe('0x2c')](_0x15ba44)[_0x8bfe('0x3d')](_0x2b4c32);};}exports['index']=function(_0xb05a08,_0x321e8d){var _0x146fe3={'include':[{'model':db[_0x8bfe('0x3e')],'as':_0x8bfe('0x3f')}]},_0x3d3053={},_0x6c5ee={'count':0x0,'rows':[]};var _0x1ba990=_['map'](db[_0x8bfe('0x40')][_0x8bfe('0x41')],function(_0x2751b6){return{'name':_0x2751b6[_0x8bfe('0x42')],'type':_0x2751b6[_0x8bfe('0x43')]['key']};});_0x3d3053[_0x8bfe('0x44')]=_[_0x8bfe('0x45')](_0x1ba990,'name');_0x3d3053[_0x8bfe('0x46')]=_[_0x8bfe('0x47')](_0xb05a08[_0x8bfe('0x46')]);_0x3d3053[_0x8bfe('0x48')]=_['intersection'](_0x3d3053['model'],_0x3d3053[_0x8bfe('0x46')]);_0x146fe3['attributes']=_[_0x8bfe('0x49')](_0x3d3053[_0x8bfe('0x44')],qs[_0x8bfe('0x4a')](_0xb05a08[_0x8bfe('0x46')][_0x8bfe('0x4a')]));_0x146fe3[_0x8bfe('0x4b')]=_0x146fe3[_0x8bfe('0x4b')]['length']?_0x146fe3[_0x8bfe('0x4b')]:_0x3d3053[_0x8bfe('0x44')];if(!_0xb05a08[_0x8bfe('0x46')][_0x8bfe('0x4c')](_0x8bfe('0x4d'))){_0x146fe3[_0x8bfe('0x30')]=qs['limit'](_0xb05a08['query'][_0x8bfe('0x30')]);_0x146fe3['offset']=qs[_0x8bfe('0x2e')](_0xb05a08[_0x8bfe('0x46')][_0x8bfe('0x2e')]);}_0x146fe3[_0x8bfe('0x4e')]=qs[_0x8bfe('0x4f')](_0xb05a08[_0x8bfe('0x46')]['sort']);_0x146fe3['where']=qs[_0x8bfe('0x48')](_[_0x8bfe('0x50')](_0xb05a08[_0x8bfe('0x46')],_0x3d3053[_0x8bfe('0x48')]),_0x1ba990);if(_0xb05a08[_0x8bfe('0x46')][_0x8bfe('0x51')]){_0x146fe3[_0x8bfe('0x52')]=_[_0x8bfe('0x53')](_0x146fe3[_0x8bfe('0x52')],{'$or':_['map'](_0x1ba990,function(_0x3bcec3){if(_0x3bcec3['type']!==_0x8bfe('0x54')){var _0x32cd89={};_0x32cd89[_0x3bcec3[_0x8bfe('0x3c')]]={'$like':'%'+_0xb05a08[_0x8bfe('0x46')]['filter']+'%'};return _0x32cd89;}})});}_0x146fe3=_[_0x8bfe('0x53')]({},_0x146fe3,_0xb05a08[_0x8bfe('0x55')]);var _0x2cd8a8={'where':_0x146fe3[_0x8bfe('0x52')]};return db[_0x8bfe('0x40')][_0x8bfe('0x31')](_0x2cd8a8)[_0x8bfe('0x22')](function(_0x50bcb2){_0x6c5ee[_0x8bfe('0x31')]=_0x50bcb2;if(_0xb05a08[_0x8bfe('0x46')][_0x8bfe('0x56')]){_0x146fe3[_0x8bfe('0x57')]=[{'all':!![]}];}return db[_0x8bfe('0x40')][_0x8bfe('0x58')](_0x146fe3);})[_0x8bfe('0x22')](function(_0x32d083){_0x6c5ee['rows']=_0x32d083;return _0x6c5ee;})[_0x8bfe('0x22')](respondWithFilteredResult(_0x321e8d,_0x146fe3))[_0x8bfe('0x2a')](handleError(_0x321e8d,null));};exports[_0x8bfe('0x59')]=function(_0x4fe9c6,_0x789883){var _0x1aac3f={'raw':![],'where':{'id':_0x4fe9c6[_0x8bfe('0x5a')]['id']},'include':[{'model':db[_0x8bfe('0x3e')],'as':_0x8bfe('0x3f')}]},_0x5f0b02={};_0x5f0b02[_0x8bfe('0x44')]=_['keys'](db['SmsAccount']['rawAttributes']);_0x5f0b02[_0x8bfe('0x46')]=_[_0x8bfe('0x47')](_0x4fe9c6[_0x8bfe('0x46')]);_0x5f0b02['filters']=_[_0x8bfe('0x49')](_0x5f0b02[_0x8bfe('0x44')],_0x5f0b02[_0x8bfe('0x46')]);_0x1aac3f['attributes']=_['intersection'](_0x5f0b02[_0x8bfe('0x44')],qs[_0x8bfe('0x4a')](_0x4fe9c6['query'][_0x8bfe('0x4a')]));_0x1aac3f[_0x8bfe('0x4b')]=_0x1aac3f[_0x8bfe('0x4b')]['length']?_0x1aac3f[_0x8bfe('0x4b')]:_0x5f0b02[_0x8bfe('0x44')];if(_0x4fe9c6['query'][_0x8bfe('0x56')]){_0x1aac3f[_0x8bfe('0x57')]=[{'all':!![]}];}_0x1aac3f=_['merge']({},_0x1aac3f,_0x4fe9c6[_0x8bfe('0x55')]);return db['SmsAccount'][_0x8bfe('0x5b')](_0x1aac3f)[_0x8bfe('0x22')](handleEntityNotFound(_0x789883,null))[_0x8bfe('0x22')](respondWithResult(_0x789883,null))[_0x8bfe('0x2a')](handleError(_0x789883,null));};exports[_0x8bfe('0x5c')]=function(_0x5bf349,_0x559a3d){return db['SmsAccount'][_0x8bfe('0x5c')](_0x5bf349[_0x8bfe('0x5d')],{})['then'](function(_0x4259b0){var _0x224570=_0x5bf349[_0x8bfe('0x5e')][_0x8bfe('0x37')]({'plain':!![]});if(!_0x224570)throw new Error(_0x8bfe('0x5f'));if(_0x224570[_0x8bfe('0x60')]===_0x8bfe('0x5e')){var _0x347d77=_0x4259b0[_0x8bfe('0x37')]({'plain':!![]});var _0x312d22=_0x8bfe('0x61');return db[_0x8bfe('0x62')][_0x8bfe('0x5b')]({'where':{'name':_0x312d22,'userProfileId':_0x224570[_0x8bfe('0x63')]},'raw':!![]})['then'](function(_0x165e47){if(_0x165e47&&_0x165e47[_0x8bfe('0x64')]===0x0){return db[_0x8bfe('0x38')][_0x8bfe('0x5c')]({'name':_0x347d77[_0x8bfe('0x3c')],'resourceId':_0x347d77['id'],'type':_0x165e47['name'],'sectionId':_0x165e47['id']},{})[_0x8bfe('0x22')](function(){return _0x4259b0;});}else{return _0x4259b0;}})[_0x8bfe('0x2a')](function(_0x5586c0){logger[_0x8bfe('0x26')](_0x8bfe('0x65'),_0x5586c0);throw _0x5586c0;});}return _0x4259b0;})['then'](respondWithResult(_0x559a3d,0xc9))[_0x8bfe('0x2a')](handleError(_0x559a3d,null));};exports[_0x8bfe('0x36')]=function(_0x537ce5,_0x390553){if(_0x537ce5[_0x8bfe('0x5d')]['id']){delete _0x537ce5[_0x8bfe('0x5d')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x537ce5['params']['id']},'include':[{'model':db[_0x8bfe('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x8bfe('0x22')](handleEntityNotFound(_0x390553,null))[_0x8bfe('0x22')](saveUpdates(_0x537ce5[_0x8bfe('0x5d')],null))[_0x8bfe('0x22')](respondWithResult(_0x390553,null))['catch'](handleError(_0x390553,null));};exports['destroy']=function(_0x1a6aae,_0x3bcfd4){return db[_0x8bfe('0x40')]['find']({'where':{'id':_0x1a6aae[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x3bcfd4,null))[_0x8bfe('0x22')](removeEntity(_0x3bcfd4,null))[_0x8bfe('0x2a')](handleError(_0x3bcfd4,null));};exports[_0x8bfe('0x66')]=function(_0x43fabe,_0x2b4e02){return db[_0x8bfe('0x40')][_0x8bfe('0x66')]()[_0x8bfe('0x22')](respondWithResult(_0x2b4e02,null))[_0x8bfe('0x2a')](handleError(_0x2b4e02,null));};exports[_0x8bfe('0x67')]=function(_0x456bea,_0x199535,_0x510cb5){if(_0x456bea[_0x8bfe('0x5d')]['id']){delete _0x456bea['body']['id'];}return db[_0x8bfe('0x40')][_0x8bfe('0x5b')]({'where':{'id':_0x456bea[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x199535,null))[_0x8bfe('0x22')](function(_0x2074b5){if(_0x2074b5){_0x456bea['body'][_0x8bfe('0x68')]=_0x2074b5['id'];return db[_0x8bfe('0x69')][_0x8bfe('0x5c')](_0x456bea[_0x8bfe('0x5d')]);}})[_0x8bfe('0x22')](respondWithResult(_0x199535,null))[_0x8bfe('0x2a')](handleError(_0x199535,null));};exports[_0x8bfe('0x6a')]=function(_0x305cb3,_0x1db2ab,_0x149670){var _0x1a6dd6={'raw':![],'where':{}};var _0x4b01b4={};var _0x423d6d={'count':0x0,'rows':[]};return db[_0x8bfe('0x40')][_0x8bfe('0x6b')]({'where':{'id':_0x305cb3['params']['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x1db2ab,null))[_0x8bfe('0x22')](function(_0x2f8b7a){if(_0x2f8b7a){_0x4b01b4[_0x8bfe('0x44')]=_[_0x8bfe('0x47')](db[_0x8bfe('0x69')][_0x8bfe('0x41')]);_0x4b01b4['query']=_[_0x8bfe('0x47')](_0x305cb3[_0x8bfe('0x46')]);_0x4b01b4[_0x8bfe('0x48')]=_[_0x8bfe('0x49')](_0x4b01b4[_0x8bfe('0x44')],_0x4b01b4['query']);_0x1a6dd6[_0x8bfe('0x4b')]=_['intersection'](_0x4b01b4[_0x8bfe('0x44')],qs['fields'](_0x305cb3[_0x8bfe('0x46')][_0x8bfe('0x4a')]));_0x1a6dd6[_0x8bfe('0x4b')]=_0x1a6dd6['attributes'][_0x8bfe('0x6c')]?_0x1a6dd6[_0x8bfe('0x4b')]:_0x4b01b4['model'];if(!_0x305cb3[_0x8bfe('0x46')][_0x8bfe('0x4c')](_0x8bfe('0x4d'))){_0x1a6dd6['limit']=qs[_0x8bfe('0x30')](_0x305cb3[_0x8bfe('0x46')][_0x8bfe('0x30')]);_0x1a6dd6['offset']=qs['offset'](_0x305cb3[_0x8bfe('0x46')][_0x8bfe('0x2e')]);}_0x1a6dd6['order']=qs[_0x8bfe('0x4f')](_0x305cb3['query'][_0x8bfe('0x4f')]);_0x1a6dd6[_0x8bfe('0x52')]=qs[_0x8bfe('0x48')](_['pick'](_0x305cb3['query'],_0x4b01b4[_0x8bfe('0x48')]));_0x1a6dd6[_0x8bfe('0x52')][_0x8bfe('0x68')]=_0x2f8b7a['id'];if(_0x305cb3[_0x8bfe('0x46')][_0x8bfe('0x51')]){_0x1a6dd6[_0x8bfe('0x52')]=_['merge'](_0x1a6dd6[_0x8bfe('0x52')],{'$or':_[_0x8bfe('0x45')](_0x1a6dd6[_0x8bfe('0x4b')],function(_0x526bc3){var _0x2fa4f2={};_0x2fa4f2[_0x526bc3]={'$like':'%'+_0x305cb3[_0x8bfe('0x46')][_0x8bfe('0x51')]+'%'};return _0x2fa4f2;})});}_0x1a6dd6=_[_0x8bfe('0x53')]({},_0x1a6dd6,_0x305cb3['options']);return db[_0x8bfe('0x69')][_0x8bfe('0x31')]({'where':_0x1a6dd6[_0x8bfe('0x52')]})[_0x8bfe('0x22')](function(_0x57a7c2){_0x423d6d[_0x8bfe('0x31')]=_0x57a7c2;if(_0x305cb3[_0x8bfe('0x46')][_0x8bfe('0x56')]){_0x1a6dd6[_0x8bfe('0x57')]=[{'all':!![]}];}return db[_0x8bfe('0x69')][_0x8bfe('0x58')](_0x1a6dd6);})[_0x8bfe('0x22')](function(_0x792e07){_0x423d6d[_0x8bfe('0x6d')]=_0x792e07;return _0x423d6d;});}})[_0x8bfe('0x22')](respondWithFilteredResult(_0x1db2ab,_0x1a6dd6))[_0x8bfe('0x2a')](handleError(_0x1db2ab,null));};exports[_0x8bfe('0x6e')]=function(_0x5d5b9b,_0x455070,_0x34186e){return db['SmsAccount']['find']({'where':{'id':_0x5d5b9b[_0x8bfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x455070,null))[_0x8bfe('0x22')](function(_0x217f14){if(_0x217f14){return _0x217f14[_0x8bfe('0x6e')](_0x5d5b9b['query'][_0x8bfe('0x6f')]);}})[_0x8bfe('0x22')](respondWithStatusCode(_0x455070,null))[_0x8bfe('0x2a')](handleError(_0x455070,null));};exports[_0x8bfe('0x70')]=function(_0x50792f,_0x2902c7,_0x2342e){if(_0x50792f[_0x8bfe('0x5d')]['id']){delete _0x50792f[_0x8bfe('0x5d')]['id'];}return db[_0x8bfe('0x40')]['find']({'where':{'id':_0x50792f[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x2902c7,null))[_0x8bfe('0x22')](function(_0x5b6289){if(_0x5b6289){_0x50792f[_0x8bfe('0x5d')][_0x8bfe('0x68')]=_0x5b6289['id'];return db[_0x8bfe('0x71')][_0x8bfe('0x5c')](_0x50792f[_0x8bfe('0x5d')]);}})[_0x8bfe('0x22')](respondWithResult(_0x2902c7,null))[_0x8bfe('0x2a')](handleError(_0x2902c7,null));};exports[_0x8bfe('0x72')]=function(_0x12a456,_0x3e70ad,_0x419d56){var _0xe97725={'raw':![],'where':{}};var _0x22fe5b={};var _0x4f026b={'count':0x0,'rows':[]};return db[_0x8bfe('0x40')][_0x8bfe('0x6b')]({'where':{'id':_0x12a456[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x3e70ad,null))[_0x8bfe('0x22')](function(_0xee8afd){if(_0xee8afd){_0x22fe5b[_0x8bfe('0x44')]=_[_0x8bfe('0x47')](db[_0x8bfe('0x71')][_0x8bfe('0x41')]);_0x22fe5b[_0x8bfe('0x46')]=_[_0x8bfe('0x47')](_0x12a456[_0x8bfe('0x46')]);_0x22fe5b['filters']=_[_0x8bfe('0x49')](_0x22fe5b[_0x8bfe('0x44')],_0x22fe5b[_0x8bfe('0x46')]);_0xe97725[_0x8bfe('0x4b')]=_['intersection'](_0x22fe5b[_0x8bfe('0x44')],qs[_0x8bfe('0x4a')](_0x12a456[_0x8bfe('0x46')][_0x8bfe('0x4a')]));_0xe97725['attributes']=_0xe97725[_0x8bfe('0x4b')]['length']?_0xe97725[_0x8bfe('0x4b')]:_0x22fe5b['model'];if(!_0x12a456[_0x8bfe('0x46')][_0x8bfe('0x4c')]('nolimit')){_0xe97725[_0x8bfe('0x30')]=qs[_0x8bfe('0x30')](_0x12a456[_0x8bfe('0x46')]['limit']);_0xe97725[_0x8bfe('0x2e')]=qs[_0x8bfe('0x2e')](_0x12a456[_0x8bfe('0x46')][_0x8bfe('0x2e')]);}_0xe97725[_0x8bfe('0x4e')]=qs[_0x8bfe('0x4f')](_0x12a456[_0x8bfe('0x46')][_0x8bfe('0x4f')]);_0xe97725[_0x8bfe('0x52')]=qs[_0x8bfe('0x48')](_[_0x8bfe('0x50')](_0x12a456[_0x8bfe('0x46')],_0x22fe5b[_0x8bfe('0x48')]));_0xe97725[_0x8bfe('0x52')]['SmsAccountId']=_0xee8afd['id'];if(_0x12a456[_0x8bfe('0x46')][_0x8bfe('0x51')]){_0xe97725[_0x8bfe('0x52')]=_[_0x8bfe('0x53')](_0xe97725[_0x8bfe('0x52')],{'$or':_[_0x8bfe('0x45')](_0xe97725['attributes'],function(_0x977edf){var _0x29110e={};_0x29110e[_0x977edf]={'$like':'%'+_0x12a456[_0x8bfe('0x46')][_0x8bfe('0x51')]+'%'};return _0x29110e;})});}_0xe97725=_['merge']({},_0xe97725,_0x12a456[_0x8bfe('0x55')]);return db[_0x8bfe('0x71')]['count']({'where':_0xe97725[_0x8bfe('0x52')]})[_0x8bfe('0x22')](function(_0x2b5468){_0x4f026b['count']=_0x2b5468;if(_0x12a456[_0x8bfe('0x46')]['includeAll']){_0xe97725['include']=[{'all':!![]}];}return db[_0x8bfe('0x71')]['findAll'](_0xe97725);})[_0x8bfe('0x22')](function(_0x37f627){_0x4f026b[_0x8bfe('0x6d')]=_0x37f627;return _0x4f026b;});}})[_0x8bfe('0x22')](respondWithFilteredResult(_0x3e70ad,_0xe97725))[_0x8bfe('0x2a')](handleError(_0x3e70ad,null));};exports['removeAnswers']=function(_0x1cb17a,_0x56996a,_0x52183c){return db[_0x8bfe('0x40')]['find']({'where':{'id':_0x1cb17a[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x56996a,null))[_0x8bfe('0x22')](function(_0x8b8ed1){if(_0x8b8ed1){return _0x8b8ed1[_0x8bfe('0x73')](_0x1cb17a[_0x8bfe('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x56996a,null))['catch'](handleError(_0x56996a,null));};exports['notify']=function(_0x14d56b,_0x3958dc,_0x823d9b){var _0x319d3d={'channel':_0x8bfe('0x74')};var _0x50f598=[];var _0x3782e6=[];var _0x1814fc={};return db[_0x8bfe('0x40')][_0x8bfe('0x5b')]({'where':{'id':_0x14d56b[_0x8bfe('0x5a')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x8bfe('0x22')](handleEntityNotFound(_0x3958dc,null))['then'](function(_0x190fd8){_0x319d3d['account']=_0x190fd8;_0x319d3d[_0x8bfe('0x75')]=_[_0x8bfe('0x76')](_0x190fd8[_0x8bfe('0x77')],[_0x8bfe('0x78')],['asc']);if(_0x319d3d[_0x8bfe('0x79')][_0x8bfe('0x77')]){delete _0x319d3d[_0x8bfe('0x79')][_0x8bfe('0x77')];}return db[_0x8bfe('0x7a')][_0x8bfe('0x66')]();})['then'](function(_0xa20213){if(!_0xa20213){throw new db['Sequelize'][(_0x8bfe('0x7b'))]('no\x20available\x20attributes');}_0x50f598=_['difference'](_[_0x8bfe('0x47')](_0xa20213),[_0x8bfe('0x7c'),_0x8bfe('0x7d')]);_0x3782e6=_[_0x8bfe('0x7e')](_[_0x8bfe('0x47')](_0xa20213),[_0x8bfe('0x7c'),_0x8bfe('0x7d'),_0x8bfe('0x7f'),_0x8bfe('0x80')]);_0x319d3d[_0x8bfe('0x5d')]={'mapKey':_0x8bfe('0x81')};if(_0x319d3d['account'][_0x8bfe('0x43')]){switch(_0x319d3d[_0x8bfe('0x79')][_0x8bfe('0x43')]){case _0x8bfe('0x82'):_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x84')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x5d')]=_0x14d56b['body'][_0x8bfe('0x85')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x86')]=_0x14d56b[_0x8bfe('0x5d')]['MessageSid'];break;case'skebby':_0x319d3d['body']['from']='+'+_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x87')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x5d')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x88')];break;case _0x8bfe('0x89'):_0x319d3d['body'][_0x8bfe('0x83')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x83')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x5d')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x29')];break;case _0x8bfe('0x8a'):_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')]=_0x14d56b[_0x8bfe('0x5d')]['from'];_0x319d3d['body'][_0x8bfe('0x5d')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x5d')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x86')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x8b')];break;case _0x8bfe('0x8c'):_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x84')];_0x319d3d[_0x8bfe('0x5d')]['body']=_0x14d56b['body'][_0x8bfe('0x8d')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x86')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x8e')];break;case'infobip':_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')]='+'+_0x14d56b[_0x8bfe('0x5d')]['results'][0x0][_0x8bfe('0x83')];_0x319d3d[_0x8bfe('0x5d')]['body']=_0x14d56b[_0x8bfe('0x5d')]['results'][0x0][_0x8bfe('0x88')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x86')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x8f')][0x0]['messageId'];break;case _0x8bfe('0x90'):_0x319d3d['body'][_0x8bfe('0x83')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x91')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x5d')]=_0x14d56b['body']['segmentedMessage'][_0x8bfe('0x29')];break;case _0x8bfe('0x92'):_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')]=_0x14d56b['body'][_0x8bfe('0x93')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x5d')]=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x88')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x86')]=_0x14d56b['body'][_0x8bfe('0x94')];break;case _0x8bfe('0x95'):_0x319d3d[_0x8bfe('0x5d')]['messageId']=_0x14d56b[_0x8bfe('0x5d')][0x0][_0x8bfe('0x29')]['id'];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')]=_0x14d56b['body'][0x0]['message'][_0x8bfe('0x83')];_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x5d')]=_0x14d56b[_0x8bfe('0x5d')][0x0][_0x8bfe('0x29')][_0x8bfe('0x88')];break;case _0x8bfe('0x96'):_0x319d3d[_0x8bfe('0x5d')]['from']=_0x14d56b['body'][_0x8bfe('0x83')];_0x319d3d['body'][_0x8bfe('0x5d')]=_0x14d56b[_0x8bfe('0x5d')]['message'];_0x319d3d['body']['messageId']=_0x14d56b[_0x8bfe('0x5d')][_0x8bfe('0x97')];break;}}if(_0x319d3d[_0x8bfe('0x5d')]['id']){delete _0x319d3d[_0x8bfe('0x5d')]['id'];}if(_['isNil'](_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')])){throw new db[(_0x8bfe('0x98'))]['ValidationError'](_0x8bfe('0x99'));}if(_['isNil'](_0x319d3d['body'][_0x8bfe('0x5d')])||_0x319d3d[_0x8bfe('0x5d')]['body']===''){throw new db[(_0x8bfe('0x98'))][(_0x8bfe('0x7b'))](_0x8bfe('0x9a'));}if(_[_0x8bfe('0x9b')](_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x9c')])){throw new db[(_0x8bfe('0x98'))][(_0x8bfe('0x7b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3782e6);}if(!_[_0x8bfe('0x9d')](_0x3782e6,_0x319d3d['body']['mapKey'])){throw new db[(_0x8bfe('0x98'))][(_0x8bfe('0x7b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3782e6);}_0x1814fc[_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x9c')]]=_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')];return db[_0x8bfe('0x9e')]['find']({'where':{'id':_0x319d3d[_0x8bfe('0x79')][_0x8bfe('0x80')]},'include':[{'model':db[_0x8bfe('0x7a')],'as':_0x8bfe('0x9f'),'where':_0x1814fc,'limit':0x1,'order':[[_0x8bfe('0x7d'),_0x8bfe('0xa0')]]}]});})[_0x8bfe('0x22')](handleEntityNotFound(_0x3958dc,null))[_0x8bfe('0x22')](function(_0x1f648e){if(_0x1f648e){_0x319d3d['list']=_[_0x8bfe('0xa1')](_0x1f648e,[_0x8bfe('0x9f')]);if(_0x1f648e['Contacts'][_0x8bfe('0x6c')]){return _0x1f648e['Contacts'][0x0];}var _0x65f172=_['defaults'](_0x319d3d[_0x8bfe('0x5d')],{'firstName':_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')],'ListId':_0x1f648e['id']});_0x65f172[_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x9c')]]=_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x83')];return db['CmContact'][_0x8bfe('0x5c')](_0x65f172,{'fields':_0x50f598,'raw':!![]});}})[_0x8bfe('0x22')](handleEntityNotFound(_0x3958dc,null))['then'](function(_0x50dd4c){if(_0x50dd4c){_0x319d3d[_0x8bfe('0xa2')]=_0x50dd4c;var _0x15539a={'ContactId':_0x50dd4c['id'],'phone':_0x319d3d['body']['from'],'SmsAccountId':_0x14d56b[_0x8bfe('0x5a')]['id']};var _0x475fb6={'ContactId':_0x50dd4c['id'],'SmsAccountId':_0x14d56b[_0x8bfe('0x5a')]['id'],'closed':![]};return db[_0x8bfe('0xa3')][_0x8bfe('0x5b')]({'where':_0x475fb6})[_0x8bfe('0x22')](function(_0x267e8c){if(_0x267e8c){return[_0x267e8c,![]];}return db[_0x8bfe('0xa3')][_0x8bfe('0x5c')](_0x15539a)[_0x8bfe('0x22')](function(_0xe716e4){return[_0xe716e4,!![]];});});}})[_0x8bfe('0xa4')](function(_0x2b6867,_0x40cc65){_0x319d3d[_0x8bfe('0xa5')]=_0x2b6867[_0x8bfe('0x37')]({'plain':!![]});_0x319d3d[_0x8bfe('0xa5')][_0x8bfe('0xa6')]=![];if(_0x40cc65){if(_0x319d3d[_0x8bfe('0x79')][_0x8bfe('0xa7')]){_0x319d3d['applications'][_0x8bfe('0xa8')]({'id':0x0,'priority':_0x319d3d[_0x8bfe('0x75')][_0x8bfe('0x6c')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x8bfe('0xa9')});}_0x319d3d[_0x8bfe('0xa5')][_0x8bfe('0xa6')]=!![];}return db[_0x8bfe('0xaa')][_0x8bfe('0x5c')]({'phone':_0x319d3d['body'][_0x8bfe('0x83')],'messageId':_0x319d3d[_0x8bfe('0x5d')]['messageId'],'body':_0x319d3d[_0x8bfe('0x5d')][_0x8bfe('0x5d')],'SmsAccountId':_0x14d56b[_0x8bfe('0x5a')]['id'],'SmsInteractionId':_0x2b6867['id'],'direction':'in','ContactId':_0x2b6867[_0x8bfe('0xab')],'AttachmentId':_0x319d3d['body'][_0x8bfe('0xac')]});})[_0x8bfe('0x22')](function(_0x192aae){_0x319d3d['message']=_0x192aae;if(_0x319d3d[_0x8bfe('0xa5')][_0x8bfe('0xad')]){return db[_0x8bfe('0xae')][_0x8bfe('0x5b')]({'attributes':['id',_0x8bfe('0x3c')],'where':{'id':_0x319d3d[_0x8bfe('0xa5')]['UserId']}})[_0x8bfe('0x22')](function(_0xab0e40){if(_0xab0e40){_0x319d3d[_0x8bfe('0x75')][_0x8bfe('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xab0e40[_0x8bfe('0x3c')]+','+(_0x319d3d['account'][_0x8bfe('0xb0')]||0xa),'interval':_0x8bfe('0xa9')});}return respondWithRpcPromise(_0x8bfe('0xb1'),'startRouting',_0x319d3d);});}return respondWithRpcPromise(_0x8bfe('0xb1'),'startRouting',_0x319d3d);})[_0x8bfe('0x22')](function(_0x32a2ed){if(_0x32a2ed){var _0x2d6a2f=0xc8;var _0x3f2858='receiveMessage';logger[_0x8bfe('0x23')](_0x8bfe('0xb2'),_0x3f2858,_0x2d6a2f,_0x8bfe('0xb3'));logger['debug'](_0x8bfe('0xb4'),_0x3f2858,_0x2d6a2f,_0x8bfe('0xb3'),JSON['stringify'](_0x32a2ed));if(_0x319d3d[_0x8bfe('0x79')]['type']===_0x8bfe('0x82')){return _0x3958dc[_0x8bfe('0x2c')](_0x2d6a2f)[_0x8bfe('0x32')](_0x8bfe('0xb5'),_0x8bfe('0xb6'))[_0x8bfe('0x3d')](_0x8bfe('0xb7'));}else{return _0x3958dc[_0x8bfe('0x2c')](_0x2d6a2f)[_0x8bfe('0x2d')](_0x32a2ed);}}})['catch'](handleError(_0x3958dc,null));};exports['addApplications']=function(_0x13e6e9,_0x223181){var _0x200feb=_0x13e6e9[_0x8bfe('0x5a')]['id'];var _0x49addd=_0x13e6e9['body'];var _0x383497=0xc8;var _0x4fb370=null;return db[_0x8bfe('0xb8')][_0x8bfe('0xb9')]({'isolationLevel':db['sequelize']['Transaction'][_0x8bfe('0xba')][_0x8bfe('0xbb')]},function(_0x1c164b){return db[_0x8bfe('0x40')][_0x8bfe('0x6b')]({'where':{'id':_0x200feb},'transaction':_0x1c164b})[_0x8bfe('0x22')](function(_0x32e0df){if(_0x32e0df){return db[_0x8bfe('0xbc')][_0x8bfe('0x39')]({'where':{'SmsAccountId':_0x200feb},'transaction':_0x1c164b})[_0x8bfe('0x22')](function(){var _0x235b77=_[_0x8bfe('0x45')](_0x49addd,function(_0x29d901){_0x29d901[_0x8bfe('0x68')]=_0x200feb;return _0x29d901;});return db[_0x8bfe('0xbc')][_0x8bfe('0xbd')](_0x235b77,{'transaction':_0x1c164b});});}else{_0x383497=0x194;_0x4fb370=[];}});})['then'](function(){if(_0x383497!==0x194){return db[_0x8bfe('0xbc')][_0x8bfe('0xbe')]({'where':{'SmsAccountId':_0x200feb},'order':_0x8bfe('0x78')})['then'](function(_0xd21e4b){_0x4fb370=_0xd21e4b;});}})[_0x8bfe('0x2a')](function(_0x43b298){_0x383497=0x1f4;logger[_0x8bfe('0x26')](_0x43b298[_0x8bfe('0x3b')]);if(_0x43b298[_0x8bfe('0x3c')]){delete _0x43b298['name'];}_0x4fb370=_0x43b298;})[_0x8bfe('0xbf')](function(){if(_0x4fb370===null){_0x223181['sendStatus'](_0x383497);}else{if(_0x383497===0x1f4){_0x223181[_0x8bfe('0x2c')](_0x383497)[_0x8bfe('0x3d')](_0x4fb370);}else{_0x223181[_0x8bfe('0x2c')](_0x383497)['json'](_0x4fb370);}}});};exports[_0x8bfe('0xc0')]=function(_0x5ab6e6,_0x46bbc1,_0x3b11e9){var _0x928e94={};var _0x34bcc0={};var _0x3e3d6d;var _0x247e69;return db['SmsAccount']['findOne']({'where':{'id':_0x5ab6e6[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x46bbc1,null))[_0x8bfe('0x22')](function(_0x2b7064){if(_0x2b7064){_0x3e3d6d=_0x2b7064;_0x34bcc0[_0x8bfe('0x44')]=_[_0x8bfe('0x47')](db['SmsApplication'][_0x8bfe('0x41')]);_0x34bcc0[_0x8bfe('0x46')]=_['keys'](_0x5ab6e6[_0x8bfe('0x46')]);_0x34bcc0['filters']=_[_0x8bfe('0x49')](_0x34bcc0[_0x8bfe('0x44')],_0x34bcc0[_0x8bfe('0x46')]);_0x928e94[_0x8bfe('0x4b')]=_[_0x8bfe('0x49')](_0x34bcc0['model'],qs['fields'](_0x5ab6e6[_0x8bfe('0x46')][_0x8bfe('0x4a')]));_0x928e94['attributes']=_0x928e94[_0x8bfe('0x4b')]['length']?_0x928e94['attributes']:_0x34bcc0['model'];_0x928e94[_0x8bfe('0x4e')]=qs[_0x8bfe('0x4f')](_0x5ab6e6[_0x8bfe('0x46')]['sort']);_0x928e94[_0x8bfe('0x52')]=qs[_0x8bfe('0x48')](_[_0x8bfe('0x50')](_0x5ab6e6[_0x8bfe('0x46')],_0x34bcc0[_0x8bfe('0x48')]));if(_0x5ab6e6[_0x8bfe('0x46')][_0x8bfe('0x51')]){_0x928e94['where']=_[_0x8bfe('0x53')](_0x928e94['where'],{'$or':_[_0x8bfe('0x45')](_0x928e94[_0x8bfe('0x4b')],function(_0x43e166){var _0x40fa89={};_0x40fa89[_0x43e166]={'$like':'%'+_0x5ab6e6[_0x8bfe('0x46')][_0x8bfe('0x51')]+'%'};return _0x40fa89;})});}_0x928e94=_['merge']({},_0x928e94,_0x5ab6e6[_0x8bfe('0x55')]);return _0x3e3d6d[_0x8bfe('0xc0')](_0x928e94);}})[_0x8bfe('0x22')](function(_0x400738){if(_0x400738){_0x247e69=_0x400738[_0x8bfe('0x6c')];if(!_0x5ab6e6[_0x8bfe('0x46')]['hasOwnProperty'](_0x8bfe('0x4d'))){_0x928e94[_0x8bfe('0x30')]=qs[_0x8bfe('0x30')](_0x5ab6e6[_0x8bfe('0x46')][_0x8bfe('0x30')]);_0x928e94[_0x8bfe('0x2e')]=qs[_0x8bfe('0x2e')](_0x5ab6e6[_0x8bfe('0x46')][_0x8bfe('0x2e')]);}return _0x3e3d6d['getApplications'](_0x928e94);}})['then'](function(_0xbd4d99){if(_0xbd4d99){return _0xbd4d99?{'count':_0x247e69,'rows':_0xbd4d99}:null;}})['then'](respondWithResult(_0x46bbc1,null))[_0x8bfe('0x2a')](handleError(_0x46bbc1,null));};exports['getInteractions']=function(_0x51cb11,_0x4dde81,_0x514bb1){var _0x2f1940={'raw':![],'where':{}};var _0x321671={};var _0x508379={'count':0x0,'rows':[]};return db[_0x8bfe('0x40')][_0x8bfe('0x6b')]({'where':{'id':_0x51cb11[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x4dde81,null))[_0x8bfe('0x22')](function(_0x43c7f8){if(_0x43c7f8){_0x321671[_0x8bfe('0x44')]=_[_0x8bfe('0x47')](db['SmsInteraction']['rawAttributes']);_0x321671['query']=_[_0x8bfe('0x47')](_0x51cb11[_0x8bfe('0x46')]);_0x321671[_0x8bfe('0x48')]=_['intersection'](_0x321671['model'],_0x321671['query']);_0x2f1940[_0x8bfe('0x4b')]=_[_0x8bfe('0x49')](_0x321671[_0x8bfe('0x44')],qs['fields'](_0x51cb11['query'][_0x8bfe('0x4a')]));_0x2f1940[_0x8bfe('0x4b')]=_0x2f1940[_0x8bfe('0x4b')]['length']?_0x2f1940['attributes']:_0x321671[_0x8bfe('0x44')];if(!_0x51cb11['query'][_0x8bfe('0x4c')](_0x8bfe('0x4d'))){_0x2f1940[_0x8bfe('0x30')]=qs[_0x8bfe('0x30')](_0x51cb11[_0x8bfe('0x46')][_0x8bfe('0x30')]);_0x2f1940['offset']=qs['offset'](_0x51cb11['query'][_0x8bfe('0x2e')]);}_0x2f1940[_0x8bfe('0x4e')]=qs[_0x8bfe('0x4f')](_0x51cb11['query'][_0x8bfe('0x4f')]);_0x2f1940[_0x8bfe('0x52')]=qs[_0x8bfe('0x48')](_['pick'](_0x51cb11[_0x8bfe('0x46')],_0x321671[_0x8bfe('0x48')]));_0x2f1940['where'][_0x8bfe('0x68')]=_0x43c7f8['id'];if(_0x51cb11[_0x8bfe('0x46')][_0x8bfe('0x51')]){_0x2f1940[_0x8bfe('0x52')]=_[_0x8bfe('0x53')](_0x2f1940[_0x8bfe('0x52')],{'$or':_[_0x8bfe('0x45')](_0x2f1940[_0x8bfe('0x4b')],function(_0x4be567){var _0x316214={};_0x316214[_0x4be567]={'$like':'%'+_0x51cb11[_0x8bfe('0x46')]['filter']+'%'};return _0x316214;})});}_0x2f1940=_[_0x8bfe('0x53')]({},_0x2f1940,_0x51cb11[_0x8bfe('0x55')]);return db[_0x8bfe('0xa3')]['count']({'where':_0x2f1940[_0x8bfe('0x52')]})['then'](function(_0xb11d6e){_0x508379['count']=_0xb11d6e;if(_0x51cb11[_0x8bfe('0x46')]['includeAll']){_0x2f1940[_0x8bfe('0x57')]=[{'model':db[_0x8bfe('0x7a')],'as':_0x8bfe('0xc1'),'required':![]},{'model':db[_0x8bfe('0xae')],'as':_0x8bfe('0xc2'),'attributes':[_0x8bfe('0x3c'),_0x8bfe('0xc3'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x8bfe('0xc4'),'attributes':['id',_0x8bfe('0x3c'),_0x8bfe('0xc5')],'where':_0x51cb11[_0x8bfe('0x46')][_0x8bfe('0xc6')]?{'id':_0x51cb11[_0x8bfe('0x46')]['tag']}:undefined,'required':_0x51cb11[_0x8bfe('0x46')][_0x8bfe('0xc6')]?!![]:![]}];}return db[_0x8bfe('0xa3')][_0x8bfe('0x58')](_0x2f1940);})[_0x8bfe('0x22')](function(_0xf8eb75){_0x508379['rows']=_0xf8eb75;return _0x508379;});}})['then'](respondWithFilteredResult(_0x4dde81,_0x2f1940))[_0x8bfe('0x2a')](handleError(_0x4dde81,null));};exports['send']=function(_0x5cfaa4,_0x319ad1,_0x29564b){var _0x13445c,_0x59332d,_0x1b8088;if(_[_0x8bfe('0x9b')](_0x5cfaa4[_0x8bfe('0x5d')]['body'])||_0x5cfaa4[_0x8bfe('0x5d')]['body']===''){throw new db[(_0x8bfe('0x98'))][(_0x8bfe('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8bfe('0x9b')](_0x5cfaa4[_0x8bfe('0x5d')]['to'])){throw new db[(_0x8bfe('0x98'))]['ValidationError'](_0x8bfe('0xc7'));}_0x13445c=_0x5cfaa4[_0x8bfe('0x5d')]['to'];return db[_0x8bfe('0x40')][_0x8bfe('0x5b')]({'where':{'id':_0x5cfaa4[_0x8bfe('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8bfe('0x7a')],'as':_0x8bfe('0x9f'),'where':{'mobile':_0x13445c},'limit':0x1,'order':[['updatedAt',_0x8bfe('0xa0')]]}]}]})[_0x8bfe('0x22')](handleEntityNotFound(_0x319ad1,null))[_0x8bfe('0x22')](function(_0x4fef85){if(_0x4fef85&&_0x4fef85[_0x8bfe('0xc8')]){_0x59332d=_0x4fef85[_0x8bfe('0x37')]({'plain':!![]});if(_0x59332d[_0x8bfe('0xc8')]&&_0x59332d[_0x8bfe('0xc8')]['Contacts']['length']){return _0x59332d[_0x8bfe('0xc8')][_0x8bfe('0x9f')][0x0];}return db[_0x8bfe('0x7a')][_0x8bfe('0x5c')](_['defaults'](_0x5cfaa4[_0x8bfe('0x5d')],{'firstName':_0x13445c,'mobile':_0x13445c,'phone':_0x13445c,'ListId':_0x59332d['ListId']}));}})['then'](handleEntityNotFound(_0x319ad1,null))['then'](function(_0x444d6f){if(_0x444d6f){_0x1b8088=_0x444d6f;return db[_0x8bfe('0xa3')][_0x8bfe('0x5b')]({'where':{'ContactId':_0x1b8088['id'],'closed':![],'SmsAccountId':_0x59332d['id']}})[_0x8bfe('0x22')](function(_0x45f8be){if(_0x45f8be){return[_0x45f8be,![]];}return db['SmsInteraction'][_0x8bfe('0x5c')]({'UserId':_0x5cfaa4[_0x8bfe('0x5e')]['id'],'ContactId':_0x1b8088['id'],'SmsAccountId':_0x59332d['id'],'phone':_0x13445c,'firstMsgDirection':_0x8bfe('0xc9'),'Messages':[_[_0x8bfe('0x53')](_0x5cfaa4[_0x8bfe('0x5d')],{'read':![],'body':_0x5cfaa4[_0x8bfe('0x5d')][_0x8bfe('0x5d')],'phone':_0x13445c,'SmsAccountId':_0x59332d['id'],'UserId':_0x5cfaa4['user']['id'],'ContactId':_0x1b8088['id']})]},{'include':[{'model':db[_0x8bfe('0xaa')],'as':_0x8bfe('0xca')}]})[_0x8bfe('0x22')](function(_0x298c5a){return[_0x298c5a,!![]];});});}})[_0x8bfe('0xa4')](function(_0xd8d8e1,_0x2113bb){if(_0x2113bb){return _0xd8d8e1;}return db[_0x8bfe('0xaa')][_0x8bfe('0x5c')](_['merge'](_0x5cfaa4[_0x8bfe('0x5d')],{'read':![],'body':_0x5cfaa4[_0x8bfe('0x5d')][_0x8bfe('0x5d')],'phone':_0x13445c,'SmsAccountId':_0x59332d['id'],'SmsInteractionId':_0xd8d8e1['id'],'UserId':_0x5cfaa4[_0x8bfe('0x5e')]['id'],'ContactId':_0x1b8088['id']}))[_0x8bfe('0x22')](function(_0x318e08){_0xd8d8e1[_0x8bfe('0xcb')][_0x8bfe('0xca')]=[];_0xd8d8e1[_0x8bfe('0xcb')][_0x8bfe('0xca')][_0x8bfe('0xa8')](_0x318e08['dataValues']);return _0xd8d8e1;});})[_0x8bfe('0x22')](respondWithResult(_0x319ad1,null))[_0x8bfe('0x2a')](handleError(_0x319ad1,null));};exports['status']=function(_0x543515,_0x26e913,_0x21b47f){if(_0x543515['body']['id']){delete _0x543515[_0x8bfe('0x5d')]['id'];}var _0x3e4710,_0x4295b4,_0x282139;return db[_0x8bfe('0x40')][_0x8bfe('0x5b')]({'where':{'id':_0x543515[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x26e913,null))['then'](function(_0x385cb8){if(_0x385cb8){_0x282139=_0x385cb8;logger['debug'](_0x8bfe('0xb2'),'status',_0x8bfe('0xcc'),_0x385cb8[_0x8bfe('0x43')],util[_0x8bfe('0xcd')](_0x543515['body'],{'showHidden':![],'depth':null}));switch(_0x385cb8[_0x8bfe('0x43')]){case'skebby':if(_0x543515[_0x8bfe('0x5d')][_0x8bfe('0xce')]&&_0x543515[_0x8bfe('0x5d')][_0x8bfe('0x2c')]){_0x4295b4=_0x543515[_0x8bfe('0x5d')][_0x8bfe('0x2c')];return db[_0x8bfe('0xaa')][_0x8bfe('0x5b')]({'where':{'messageId':_0x543515[_0x8bfe('0x5d')][_0x8bfe('0xce')]}});}break;case _0x8bfe('0x89'):if(_0x543515['body'][_0x8bfe('0xcf')]&&_0x543515['body'][_0x8bfe('0xd0')]){_0x4295b4=_0x543515[_0x8bfe('0x5d')]['statusInt'];return db[_0x8bfe('0xaa')][_0x8bfe('0x5b')]({'where':{'messageId':_0x543515[_0x8bfe('0x5d')]['requestid']}});}break;case _0x8bfe('0x8a'):if(_0x543515[_0x8bfe('0x5d')]['message_id']&&_0x543515[_0x8bfe('0x5d')]['status_code']){_0x4295b4=_0x543515[_0x8bfe('0x5d')]['status_code'];return db[_0x8bfe('0xaa')][_0x8bfe('0x5b')]({'where':{'messageId':_0x543515[_0x8bfe('0x5d')][_0x8bfe('0x8b')]}});}break;case _0x8bfe('0xd1'):var _0x5412db=_0x543515[_0x8bfe('0x5d')]['results'][0x0];if(_0x5412db[_0x8bfe('0x86')]&&_0x5412db[_0x8bfe('0x2c')][_0x8bfe('0xd2')]===_0x8bfe('0xd3')){_0x4295b4=_0x5412db['status']['groupName'];return db[_0x8bfe('0xaa')][_0x8bfe('0x5b')]({'where':{'messageId':_0x5412db[_0x8bfe('0x86')]}});}break;case'clickatell':if(_0x543515[_0x8bfe('0x5d')][_0x8bfe('0x86')]&&_0x543515[_0x8bfe('0x5d')][_0x8bfe('0x2c')]){_0x4295b4=_0x543515['body'][_0x8bfe('0x2c')];return db[_0x8bfe('0xaa')][_0x8bfe('0x5b')]({'where':{'messageId':_0x543515['body']['messageId']}});}break;case'bandwidth':if(_0x543515['body'][0x0]['message']['id']){_0x4295b4=_0x543515[_0x8bfe('0x5d')][0x0][_0x8bfe('0x43')];return db['SmsMessage']['find']({'where':{'messageId':_0x543515['body'][0x0][_0x8bfe('0x29')]['id']}});}break;case _0x8bfe('0x96'):if(_0x543515[_0x8bfe('0x5d')][_0x8bfe('0xd4')]&&_0x543515['body'][_0x8bfe('0x2c')]){_0x4295b4=_0x543515[_0x8bfe('0x5d')][_0x8bfe('0x2c')];return db[_0x8bfe('0xaa')][_0x8bfe('0x5b')]({'where':{'messageId':_0x543515[_0x8bfe('0x5d')][_0x8bfe('0xd4')]}});}break;}}})[_0x8bfe('0x22')](handleEntityNotFound(_0x26e913,null))[_0x8bfe('0x22')](function(_0x2cd7be){if(_0x2cd7be){_0x3e4710=_0x2cd7be;switch(_0x282139[_0x8bfe('0x43')]){case _0x8bfe('0xd5'):if(_0x4295b4===_0x8bfe('0xd3')){return _0x3e4710[_0x8bfe('0x36')]({'read':!![]});}else{logger[_0x8bfe('0x26')](_0x8bfe('0xb2'),'status',_0x8bfe('0xd5'),util[_0x8bfe('0xcd')](_0x543515['body'],{'showHidden':![],'depth':null}));}break;case _0x8bfe('0x89'):if(_0x4295b4==='1'){return _0x3e4710[_0x8bfe('0x36')]({'read':!![]});}else{logger[_0x8bfe('0x26')](_0x8bfe('0xb2'),_0x8bfe('0x2c'),'skebby',util[_0x8bfe('0xcd')](_0x543515['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x543515[_0x8bfe('0x5d')]['error_code']&&_0x4295b4>=0xc8&&_0x4295b4<=0xce){return _0x3e4710[_0x8bfe('0x36')]({'read':!![]});}else{logger[_0x8bfe('0x26')](_0x8bfe('0xb2'),_0x8bfe('0x2c'),_0x8bfe('0x8a'),util[_0x8bfe('0xcd')](_0x543515[_0x8bfe('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x8bfe('0xd1'):var _0x2fcd93=_0x543515[_0x8bfe('0x5d')][_0x8bfe('0x8f')][0x0];if(_0x2fcd93[_0x8bfe('0x2c')]['groupName']===_0x8bfe('0xd3')){return _0x3e4710[_0x8bfe('0x36')]({'read':!![]});}else{logger['error'](_0x8bfe('0xb2'),'status',_0x8bfe('0xd1'),util[_0x8bfe('0xcd')](_0x543515[_0x8bfe('0x5d')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4295b4=='DELIVERED_TO_GATEWAY'||_0x4295b4==_0x8bfe('0xd6')){return _0x3e4710[_0x8bfe('0x36')]({'read':!![]});}else{logger['error'](_0x8bfe('0xb2'),_0x8bfe('0x2c'),_0x8bfe('0x92'),util['inspect'](_0x543515[_0x8bfe('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x8bfe('0x95'):if(_0x4295b4==_0x8bfe('0xd7')){return _0x3e4710[_0x8bfe('0x36')]({'read':!![]});}else{logger[_0x8bfe('0x26')](_0x8bfe('0xb2'),_0x8bfe('0x2c'),_0x8bfe('0x95'),util[_0x8bfe('0xcd')](_0x543515[_0x8bfe('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x8bfe('0x96'):if(_0x4295b4===_0x8bfe('0xd8')||_0x4295b4===_0x8bfe('0xd9')){return _0x3e4710[_0x8bfe('0x36')]({'read':!![]});}else{logger[_0x8bfe('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8bfe('0x2c'),_0x8bfe('0x96'),util[_0x8bfe('0xcd')](_0x543515[_0x8bfe('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x3e4710;}})[_0x8bfe('0x22')](respondWithResult(_0x26e913,null))[_0x8bfe('0x2a')](handleError(_0x26e913,null));};exports[_0x8bfe('0xda')]=function(_0x9026fa,_0x46b502,_0x2f0f69){var _0x2a8cce,_0x13da26,_0x4788fa;return db[_0x8bfe('0x40')]['find']({'where':{'id':_0x9026fa[_0x8bfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x46b502,null))[_0x8bfe('0x22')](function(_0xbb8788){if(_0xbb8788){_0x4788fa=_0xbb8788;logger[_0x8bfe('0xdb')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0xbb8788[_0x8bfe('0x43')],util[_0x8bfe('0xcd')](_0x9026fa[_0x8bfe('0x46')],{'showHidden':![],'depth':null}));switch(_0xbb8788[_0x8bfe('0x43')]){case _0x8bfe('0x90'):if(_0x9026fa[_0x8bfe('0x46')][_0x8bfe('0xdc')]&&_0x9026fa[_0x8bfe('0x46')][_0x8bfe('0xdd')]){_0x13da26=_0x9026fa[_0x8bfe('0x46')][_0x8bfe('0xdd')];return db[_0x8bfe('0xaa')][_0x8bfe('0x5b')]({'where':{'messageId':_0x9026fa[_0x8bfe('0x46')][_0x8bfe('0xdc')]}});}break;}}})[_0x8bfe('0x22')](handleEntityNotFound(_0x46b502,null))['then'](function(_0x11beac){if(_0x11beac){_0x2a8cce=_0x11beac;switch(_0x4788fa['type']){case _0x8bfe('0x90'):if(_0x13da26==='2'||_0x13da26==='6'){return _0x2a8cce[_0x8bfe('0x36')]({'read':!![]});}else{logger[_0x8bfe('0x26')](_0x8bfe('0xb2'),'status','csc',util[_0x8bfe('0xcd')](_0x9026fa['query'],{'showHidden':![],'depth':null}));};break;}return _0x2a8cce;}})['then'](respondWithResult(_0x46b502,null))[_0x8bfe('0x2a')](handleError(_0x46b502,null));};exports[_0x8bfe('0xde')]=function(_0x181789,_0xd2d743,_0xa9c996){return db[_0x8bfe('0x40')][_0x8bfe('0x5b')]({'where':{'id':_0x181789[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0xd2d743,null))[_0x8bfe('0x22')](function(_0x49a979){if(_0x49a979){return _0x49a979['addAgents'](_0x181789[_0x8bfe('0x5d')][_0x8bfe('0x6f')],_[_0x8bfe('0xa1')](_0x181789[_0x8bfe('0x5d')],[_0x8bfe('0x6f'),'id'])||{})[_0x8bfe('0xa4')](function(_0x30615b){for(var _0x412484=0x0;_0x412484<_0x181789['body'][_0x8bfe('0x6f')][_0x8bfe('0x6c')];_0x412484+=0x1){socket[_0x8bfe('0xdf')]('userSmsAccount:save',{'UserId':Number(_0x181789[_0x8bfe('0x5d')][_0x8bfe('0x6f')][_0x412484]),'SmsAccountId':Number(_0x181789[_0x8bfe('0x5a')]['id'])});}return _0x30615b;});}})[_0x8bfe('0x22')](respondWithResult(_0xd2d743,null))[_0x8bfe('0x2a')](handleError(_0xd2d743,null));};exports[_0x8bfe('0xe0')]=function(_0x6bf6d,_0x218f9b,_0x469e6a){return db[_0x8bfe('0x40')][_0x8bfe('0x5b')]({'where':{'id':_0x6bf6d[_0x8bfe('0x5a')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x218f9b,null))[_0x8bfe('0x22')](function(_0x4bac4a){if(_0x4bac4a){return _0x4bac4a['removeAgents'](_0x6bf6d[_0x8bfe('0x46')][_0x8bfe('0x6f')])[_0x8bfe('0x22')](function(){if(_[_0x8bfe('0xe1')](_0x6bf6d[_0x8bfe('0x46')][_0x8bfe('0x6f')])){for(var _0x54a4aa=0x0;_0x54a4aa<_0x6bf6d[_0x8bfe('0x46')][_0x8bfe('0x6f')]['length'];_0x54a4aa+=0x1){socket[_0x8bfe('0xdf')](_0x8bfe('0xe2'),{'UserId':Number(_0x6bf6d[_0x8bfe('0x46')][_0x8bfe('0x6f')][_0x54a4aa]),'SmsAccountId':Number(_0x6bf6d[_0x8bfe('0x5a')]['id'])});}}else{socket[_0x8bfe('0xdf')](_0x8bfe('0xe2'),{'UserId':Number(_0x6bf6d[_0x8bfe('0x46')]['ids']),'SmsAccountId':Number(_0x6bf6d[_0x8bfe('0x5a')]['id'])});}});}})[_0x8bfe('0x22')](respondWithStatusCode(_0x218f9b,null))[_0x8bfe('0x2a')](handleError(_0x218f9b,null));};exports[_0x8bfe('0xe3')]=function(_0x3c4faa,_0x166b64,_0x349ea4){var _0x11b483={};var _0x1d296c={};var _0x18f947;var _0x38d476;return db[_0x8bfe('0x40')][_0x8bfe('0x6b')]({'where':{'id':_0x3c4faa['params']['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x166b64,null))['then'](function(_0x53345e){if(_0x53345e){_0x18f947=_0x53345e;_0x1d296c['model']=_[_0x8bfe('0x47')](db[_0x8bfe('0xae')][_0x8bfe('0x41')]);_0x1d296c['query']=_['keys'](_0x3c4faa['query']);_0x1d296c[_0x8bfe('0x48')]=_[_0x8bfe('0x49')](_0x1d296c[_0x8bfe('0x44')],_0x1d296c[_0x8bfe('0x46')]);_0x11b483[_0x8bfe('0x4b')]=_[_0x8bfe('0x49')](_0x1d296c[_0x8bfe('0x44')],qs[_0x8bfe('0x4a')](_0x3c4faa['query'][_0x8bfe('0x4a')]));_0x11b483[_0x8bfe('0x4b')]=_0x11b483[_0x8bfe('0x4b')][_0x8bfe('0x6c')]?_0x11b483['attributes']:_0x1d296c[_0x8bfe('0x44')];_0x11b483[_0x8bfe('0x4e')]=qs[_0x8bfe('0x4f')](_0x3c4faa[_0x8bfe('0x46')]['sort']);_0x11b483[_0x8bfe('0x52')]=qs[_0x8bfe('0x48')](_['pick'](_0x3c4faa[_0x8bfe('0x46')],_0x1d296c[_0x8bfe('0x48')]));if(_0x3c4faa[_0x8bfe('0x46')]['filter']){_0x11b483['where']=_[_0x8bfe('0x53')](_0x11b483[_0x8bfe('0x52')],{'$or':_[_0x8bfe('0x45')](_0x11b483[_0x8bfe('0x4b')],function(_0x2bbd5d){var _0x572f61={};_0x572f61[_0x2bbd5d]={'$like':'%'+_0x3c4faa[_0x8bfe('0x46')][_0x8bfe('0x51')]+'%'};return _0x572f61;})});}_0x11b483=_[_0x8bfe('0x53')]({},_0x11b483,_0x3c4faa[_0x8bfe('0x55')]);return _0x18f947['getAgents'](_0x11b483);}})['then'](function(_0x4fb4e3){if(_0x4fb4e3){_0x38d476=_0x4fb4e3['length'];if(!_0x3c4faa[_0x8bfe('0x46')][_0x8bfe('0x4c')](_0x8bfe('0x4d'))){_0x11b483[_0x8bfe('0x30')]=qs['limit'](_0x3c4faa[_0x8bfe('0x46')]['limit']);_0x11b483[_0x8bfe('0x2e')]=qs[_0x8bfe('0x2e')](_0x3c4faa[_0x8bfe('0x46')][_0x8bfe('0x2e')]);}return _0x18f947['getAgents'](_0x11b483);}})[_0x8bfe('0x22')](function(_0x37033e){if(_0x37033e){return _0x37033e?{'count':_0x38d476,'rows':_0x37033e}:null;}})['then'](respondWithResult(_0x166b64,null))[_0x8bfe('0x2a')](handleError(_0x166b64,null));}; \ No newline at end of file +var _0x0774=['sort','where','pick','merge','type','filter','includeAll','include','show','params','Pause','mandatoryDispositionPause','keys','length','options','find','create','body','user','role','userProfileId','UserProfileResource','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','sms','Applications','account','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','autoclose','push','close','unmanaged','*,*,*,*','interaction','created','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','info','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','Contact','Owner','fullname','Tag','Tags','color','findAll','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','csc','message-id','state','addAgents','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','get','SmsAccounts','destroy','stack','name','send','index','map','SmsAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x1bd785,_0x321ce1){var _0x5bf46e=function(_0x5b72ad){while(--_0x5b72ad){_0x1bd785['push'](_0x1bd785['shift']());}};_0x5bf46e(++_0x321ce1);}(_0x0774,0x96));var _0x4077=function(_0x3a04a5,_0x101026){_0x3a04a5=_0x3a04a5-0x0;var _0x4e3298=_0x0774[_0x3a04a5];return _0x4e3298;};'use strict';var emlformat=require(_0x4077('0x0'));var rimraf=require(_0x4077('0x1'));var zipdir=require(_0x4077('0x2'));var jsonpatch=require(_0x4077('0x3'));var rp=require(_0x4077('0x4'));var moment=require(_0x4077('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4077('0x6'));var util=require('util');var path=require(_0x4077('0x7'));var sox=require(_0x4077('0x8'));var csv=require('to-csv');var ejs=require(_0x4077('0x9'));var fs=require('fs');var fs_extra=require(_0x4077('0xa'));var _=require(_0x4077('0xb'));var squel=require(_0x4077('0xc'));var crypto=require(_0x4077('0xd'));var jsforce=require(_0x4077('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4077('0xf'));var querystring=require(_0x4077('0x10'));var Papa=require(_0x4077('0x11'));var Redis=require(_0x4077('0x12'));var authService=require(_0x4077('0x13'));var qs=require(_0x4077('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4077('0x15'));var logger=require('../../config/logger')(_0x4077('0x16'));var utils=require(_0x4077('0x17'));var config=require(_0x4077('0x18'));var licenseUtil=require(_0x4077('0x19'));var db=require(_0x4077('0x1a'))['db'];config[_0x4077('0x1b')]=_[_0x4077('0x1c')](config[_0x4077('0x1b')],{'host':_0x4077('0x1d'),'port':0x18eb});var socket=require(_0x4077('0x1e'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4077('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x3e3baa,_0x2d4745,_0x5cb9d1,_0xb99f4f){return new BPromise(function(_0x36eafe,_0x2164ca){var _0x2e5c18=_0xb99f4f||client;return _0x2e5c18[_0x4077('0x20')](_0x3e3baa,_0x5cb9d1)[_0x4077('0x21')](function(_0x27fca3){logger['info'](_0x4077('0x22'),_0x2d4745,_0x4077('0x23'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d4745,_0x4077('0x23'),JSON[_0x4077('0x24')](_0x27fca3));if(_0x27fca3[_0x4077('0x25')]){if(_0x27fca3[_0x4077('0x25')][_0x4077('0x26')]===0x1f4){logger[_0x4077('0x25')](_0x4077('0x22'),_0x2d4745,_0x27fca3['error']['message']);return _0x2164ca(_0x27fca3[_0x4077('0x25')][_0x4077('0x27')]);}logger[_0x4077('0x25')](_0x4077('0x22'),_0x2d4745,_0x27fca3[_0x4077('0x25')][_0x4077('0x27')]);return _0x36eafe(_0x27fca3[_0x4077('0x25')][_0x4077('0x27')]);}else{logger['info'](_0x4077('0x22'),_0x2d4745,_0x4077('0x23'));_0x36eafe(_0x27fca3[_0x4077('0x28')][_0x4077('0x27')]);}})[_0x4077('0x29')](function(_0x425968){logger[_0x4077('0x25')](_0x4077('0x22'),_0x2d4745,_0x425968);_0x2164ca(_0x425968);});});}function respondWithStatusCode(_0x2e7193,_0x58eef0){_0x58eef0=_0x58eef0||0xcc;return function(_0xa54a7d){if(_0xa54a7d){return _0x2e7193[_0x4077('0x2a')](_0x58eef0);}return _0x2e7193['status'](_0x58eef0)[_0x4077('0x2b')]();};}function respondWithResult(_0x427e11,_0x55358e){_0x55358e=_0x55358e||0xc8;return function(_0x49f261){if(_0x49f261){return _0x427e11[_0x4077('0x2c')](_0x55358e)[_0x4077('0x2d')](_0x49f261);}};}function respondWithFilteredResult(_0x58ac14,_0x223eba){return function(_0x456ff6){if(_0x456ff6){var _0x485ac5=typeof _0x223eba['offset']===_0x4077('0x2e')&&typeof _0x223eba['limit']===_0x4077('0x2e');var _0xe9d955=_0x456ff6[_0x4077('0x2f')];var _0x325fd9=_0x485ac5?0x0:_0x223eba['offset'];var _0x303715=_0x485ac5?_0x456ff6[_0x4077('0x2f')]:_0x223eba[_0x4077('0x30')]+_0x223eba[_0x4077('0x31')];var _0x51c7db;if(_0x303715>=_0xe9d955){_0x303715=_0xe9d955;_0x51c7db=0xc8;}else{_0x51c7db=0xce;}_0x58ac14[_0x4077('0x2c')](_0x51c7db);return _0x58ac14['set'](_0x4077('0x32'),_0x325fd9+'-'+_0x303715+'/'+_0xe9d955)['json'](_0x456ff6);}return null;};}function patchUpdates(_0xf29aa9){return function(_0x58698a){try{jsonpatch[_0x4077('0x33')](_0x58698a,_0xf29aa9,!![]);}catch(_0xbccb3d){return BPromise[_0x4077('0x34')](_0xbccb3d);}return _0x58698a[_0x4077('0x35')]();};}function saveUpdates(_0x105797,_0x22a529){return function(_0x3f44be){if(_0x3f44be){return _0x3f44be[_0x4077('0x36')](_0x105797)[_0x4077('0x21')](function(_0x4cd61c){return _0x4cd61c;});}return null;};}function removeEntity(_0x42b8b3,_0x3a1dcd){return function(_0x4d55cf){if(_0x4d55cf){return _0x4d55cf['destroy']()['then'](function(){var _0x511176=_0x4d55cf[_0x4077('0x37')]({'plain':!![]});var _0x15c332=_0x4077('0x38');return db['UserProfileResource'][_0x4077('0x39')]({'where':{'type':_0x15c332,'resourceId':_0x511176['id']}})[_0x4077('0x21')](function(){return _0x4d55cf;});})[_0x4077('0x21')](function(){_0x42b8b3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x414b87,_0x34474a){return function(_0xed67dd){if(!_0xed67dd){_0x414b87[_0x4077('0x2a')](0x194);}return _0xed67dd;};}function handleError(_0x16fe9f,_0x44a836){_0x44a836=_0x44a836||0x1f4;return function(_0x58bc52){logger['error'](_0x58bc52[_0x4077('0x3a')]);if(_0x58bc52[_0x4077('0x3b')]){delete _0x58bc52[_0x4077('0x3b')];}_0x16fe9f['status'](_0x44a836)[_0x4077('0x3c')](_0x58bc52);};}exports[_0x4077('0x3d')]=function(_0x49aa96,_0x58e0f4){var _0x2b6d3c={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1b2f09={},_0x491c45={'count':0x0,'rows':[]};var _0x10614c=_[_0x4077('0x3e')](db[_0x4077('0x3f')][_0x4077('0x40')],function(_0x8e871c){return{'name':_0x8e871c[_0x4077('0x41')],'type':_0x8e871c['type'][_0x4077('0x42')]};});_0x1b2f09[_0x4077('0x43')]=_[_0x4077('0x3e')](_0x10614c,_0x4077('0x3b'));_0x1b2f09['query']=_['keys'](_0x49aa96[_0x4077('0x44')]);_0x1b2f09[_0x4077('0x45')]=_[_0x4077('0x46')](_0x1b2f09['model'],_0x1b2f09[_0x4077('0x44')]);_0x2b6d3c[_0x4077('0x47')]=_[_0x4077('0x46')](_0x1b2f09['model'],qs[_0x4077('0x48')](_0x49aa96['query'][_0x4077('0x48')]));_0x2b6d3c[_0x4077('0x47')]=_0x2b6d3c['attributes']['length']?_0x2b6d3c['attributes']:_0x1b2f09[_0x4077('0x43')];if(!_0x49aa96[_0x4077('0x44')][_0x4077('0x49')](_0x4077('0x4a'))){_0x2b6d3c[_0x4077('0x31')]=qs[_0x4077('0x31')](_0x49aa96[_0x4077('0x44')][_0x4077('0x31')]);_0x2b6d3c[_0x4077('0x30')]=qs[_0x4077('0x30')](_0x49aa96[_0x4077('0x44')]['offset']);}_0x2b6d3c[_0x4077('0x4b')]=qs['sort'](_0x49aa96[_0x4077('0x44')][_0x4077('0x4c')]);_0x2b6d3c[_0x4077('0x4d')]=qs[_0x4077('0x45')](_[_0x4077('0x4e')](_0x49aa96[_0x4077('0x44')],_0x1b2f09[_0x4077('0x45')]),_0x10614c);if(_0x49aa96[_0x4077('0x44')]['filter']){_0x2b6d3c[_0x4077('0x4d')]=_[_0x4077('0x4f')](_0x2b6d3c['where'],{'$or':_[_0x4077('0x3e')](_0x10614c,function(_0x185b6c){if(_0x185b6c[_0x4077('0x50')]!=='VIRTUAL'){var _0x4896b0={};_0x4896b0[_0x185b6c[_0x4077('0x3b')]]={'$like':'%'+_0x49aa96[_0x4077('0x44')][_0x4077('0x51')]+'%'};return _0x4896b0;}})});}_0x2b6d3c=_[_0x4077('0x4f')]({},_0x2b6d3c,_0x49aa96['options']);var _0x1ced57={'where':_0x2b6d3c['where']};return db[_0x4077('0x3f')][_0x4077('0x2f')](_0x1ced57)['then'](function(_0x48b168){_0x491c45[_0x4077('0x2f')]=_0x48b168;if(_0x49aa96['query'][_0x4077('0x52')]){_0x2b6d3c[_0x4077('0x53')]=[{'all':!![]}];}return db[_0x4077('0x3f')]['findAll'](_0x2b6d3c);})[_0x4077('0x21')](function(_0x3a6b0c){_0x491c45['rows']=_0x3a6b0c;return _0x491c45;})['then'](respondWithFilteredResult(_0x58e0f4,_0x2b6d3c))[_0x4077('0x29')](handleError(_0x58e0f4,null));};exports[_0x4077('0x54')]=function(_0x1b8379,_0x57cfe8){var _0x315ec4={'raw':![],'where':{'id':_0x1b8379[_0x4077('0x55')]['id']},'include':[{'model':db[_0x4077('0x56')],'as':_0x4077('0x57')}]},_0x23198e={};_0x23198e[_0x4077('0x43')]=_[_0x4077('0x58')](db[_0x4077('0x3f')][_0x4077('0x40')]);_0x23198e[_0x4077('0x44')]=_['keys'](_0x1b8379[_0x4077('0x44')]);_0x23198e[_0x4077('0x45')]=_[_0x4077('0x46')](_0x23198e['model'],_0x23198e[_0x4077('0x44')]);_0x315ec4[_0x4077('0x47')]=_[_0x4077('0x46')](_0x23198e[_0x4077('0x43')],qs[_0x4077('0x48')](_0x1b8379['query'][_0x4077('0x48')]));_0x315ec4[_0x4077('0x47')]=_0x315ec4[_0x4077('0x47')][_0x4077('0x59')]?_0x315ec4[_0x4077('0x47')]:_0x23198e[_0x4077('0x43')];if(_0x1b8379[_0x4077('0x44')][_0x4077('0x52')]){_0x315ec4[_0x4077('0x53')]=[{'all':!![]}];}_0x315ec4=_[_0x4077('0x4f')]({},_0x315ec4,_0x1b8379[_0x4077('0x5a')]);return db[_0x4077('0x3f')][_0x4077('0x5b')](_0x315ec4)[_0x4077('0x21')](handleEntityNotFound(_0x57cfe8,null))[_0x4077('0x21')](respondWithResult(_0x57cfe8,null))[_0x4077('0x29')](handleError(_0x57cfe8,null));};exports[_0x4077('0x5c')]=function(_0x34565a,_0x475bb1){return db['SmsAccount'][_0x4077('0x5c')](_0x34565a[_0x4077('0x5d')],{})['then'](function(_0x4829a0){var _0x1acbb3=_0x34565a[_0x4077('0x5e')][_0x4077('0x37')]({'plain':!![]});if(!_0x1acbb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1acbb3[_0x4077('0x5f')]===_0x4077('0x5e')){var _0x27cc6b=_0x4829a0['get']({'plain':!![]});var _0x16a968=_0x4077('0x38');return db['UserProfileSection'][_0x4077('0x5b')]({'where':{'name':_0x16a968,'userProfileId':_0x1acbb3[_0x4077('0x60')]},'raw':!![]})[_0x4077('0x21')](function(_0x1d49f0){if(_0x1d49f0&&_0x1d49f0['autoAssociation']===0x0){return db[_0x4077('0x61')][_0x4077('0x5c')]({'name':_0x27cc6b[_0x4077('0x3b')],'resourceId':_0x27cc6b['id'],'type':_0x1d49f0['name'],'sectionId':_0x1d49f0['id']},{})['then'](function(){return _0x4829a0;});}else{return _0x4829a0;}})['catch'](function(_0x3fc813){logger[_0x4077('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fc813);throw _0x3fc813;});}return _0x4829a0;})['then'](respondWithResult(_0x475bb1,0xc9))[_0x4077('0x29')](handleError(_0x475bb1,null));};exports[_0x4077('0x36')]=function(_0x28dfce,_0x4e63f6){if(_0x28dfce[_0x4077('0x5d')]['id']){delete _0x28dfce['body']['id'];}return db[_0x4077('0x3f')]['find']({'where':{'id':_0x28dfce[_0x4077('0x55')]['id']},'include':[{'model':db[_0x4077('0x56')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4e63f6,null))[_0x4077('0x21')](saveUpdates(_0x28dfce[_0x4077('0x5d')],null))['then'](respondWithResult(_0x4e63f6,null))[_0x4077('0x29')](handleError(_0x4e63f6,null));};exports[_0x4077('0x39')]=function(_0x385715,_0x1c0cc8){return db[_0x4077('0x3f')][_0x4077('0x5b')]({'where':{'id':_0x385715[_0x4077('0x55')]['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x1c0cc8,null))[_0x4077('0x21')](removeEntity(_0x1c0cc8,null))[_0x4077('0x29')](handleError(_0x1c0cc8,null));};exports['describe']=function(_0x11eb5a,_0x1a8a1a){return db[_0x4077('0x3f')]['describe']()[_0x4077('0x21')](respondWithResult(_0x1a8a1a,null))[_0x4077('0x29')](handleError(_0x1a8a1a,null));};exports['addDisposition']=function(_0x513667,_0x5a5ce3,_0x5d1f13){if(_0x513667[_0x4077('0x5d')]['id']){delete _0x513667[_0x4077('0x5d')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x513667[_0x4077('0x55')]['id']}})['then'](handleEntityNotFound(_0x5a5ce3,null))[_0x4077('0x21')](function(_0x2558e){if(_0x2558e){_0x513667[_0x4077('0x5d')][_0x4077('0x62')]=_0x2558e['id'];return db[_0x4077('0x63')][_0x4077('0x5c')](_0x513667[_0x4077('0x5d')]);}})[_0x4077('0x21')](respondWithResult(_0x5a5ce3,null))[_0x4077('0x29')](handleError(_0x5a5ce3,null));};exports['getDispositions']=function(_0x4b14e9,_0x4919da,_0x4177eb){var _0x2e18a3={'raw':![],'where':{}};var _0x4f5865={};var _0x39aa9={'count':0x0,'rows':[]};return db[_0x4077('0x3f')][_0x4077('0x64')]({'where':{'id':_0x4b14e9[_0x4077('0x55')]['id']}})['then'](handleEntityNotFound(_0x4919da,null))[_0x4077('0x21')](function(_0xea24a9){if(_0xea24a9){_0x4f5865[_0x4077('0x43')]=_[_0x4077('0x58')](db[_0x4077('0x63')][_0x4077('0x40')]);_0x4f5865['query']=_[_0x4077('0x58')](_0x4b14e9[_0x4077('0x44')]);_0x4f5865[_0x4077('0x45')]=_['intersection'](_0x4f5865[_0x4077('0x43')],_0x4f5865['query']);_0x2e18a3[_0x4077('0x47')]=_[_0x4077('0x46')](_0x4f5865[_0x4077('0x43')],qs[_0x4077('0x48')](_0x4b14e9[_0x4077('0x44')][_0x4077('0x48')]));_0x2e18a3[_0x4077('0x47')]=_0x2e18a3[_0x4077('0x47')][_0x4077('0x59')]?_0x2e18a3['attributes']:_0x4f5865[_0x4077('0x43')];if(!_0x4b14e9[_0x4077('0x44')][_0x4077('0x49')]('nolimit')){_0x2e18a3[_0x4077('0x31')]=qs[_0x4077('0x31')](_0x4b14e9[_0x4077('0x44')][_0x4077('0x31')]);_0x2e18a3[_0x4077('0x30')]=qs[_0x4077('0x30')](_0x4b14e9[_0x4077('0x44')]['offset']);}_0x2e18a3[_0x4077('0x4b')]=qs['sort'](_0x4b14e9[_0x4077('0x44')][_0x4077('0x4c')]);_0x2e18a3['where']=qs['filters'](_[_0x4077('0x4e')](_0x4b14e9[_0x4077('0x44')],_0x4f5865[_0x4077('0x45')]));_0x2e18a3[_0x4077('0x4d')]['SmsAccountId']=_0xea24a9['id'];if(_0x4b14e9[_0x4077('0x44')][_0x4077('0x51')]){_0x2e18a3[_0x4077('0x4d')]=_[_0x4077('0x4f')](_0x2e18a3['where'],{'$or':_['map'](_0x2e18a3[_0x4077('0x47')],function(_0xda8f3a){var _0x448ec4={};_0x448ec4[_0xda8f3a]={'$like':'%'+_0x4b14e9['query'][_0x4077('0x51')]+'%'};return _0x448ec4;})});}_0x2e18a3=_['merge']({},_0x2e18a3,_0x4b14e9[_0x4077('0x5a')]);return db[_0x4077('0x63')][_0x4077('0x2f')]({'where':_0x2e18a3[_0x4077('0x4d')]})[_0x4077('0x21')](function(_0x247e81){_0x39aa9[_0x4077('0x2f')]=_0x247e81;if(_0x4b14e9[_0x4077('0x44')]['includeAll']){_0x2e18a3[_0x4077('0x53')]=[{'all':!![]}];}return db[_0x4077('0x63')]['findAll'](_0x2e18a3);})['then'](function(_0x290f66){_0x39aa9['rows']=_0x290f66;return _0x39aa9;});}})[_0x4077('0x21')](respondWithFilteredResult(_0x4919da,_0x2e18a3))[_0x4077('0x29')](handleError(_0x4919da,null));};exports[_0x4077('0x65')]=function(_0x4a7386,_0x359998,_0x3ff9db){return db[_0x4077('0x3f')]['find']({'where':{'id':_0x4a7386[_0x4077('0x55')]['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x359998,null))['then'](function(_0x385a00){if(_0x385a00){return _0x385a00[_0x4077('0x65')](_0x4a7386['query'][_0x4077('0x66')]);}})[_0x4077('0x21')](respondWithStatusCode(_0x359998,null))[_0x4077('0x29')](handleError(_0x359998,null));};exports[_0x4077('0x67')]=function(_0x561e2b,_0x14960b,_0x5e6c1f){if(_0x561e2b[_0x4077('0x5d')]['id']){delete _0x561e2b[_0x4077('0x5d')]['id'];}return db[_0x4077('0x3f')][_0x4077('0x5b')]({'where':{'id':_0x561e2b['params']['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x14960b,null))[_0x4077('0x21')](function(_0x198fb4){if(_0x198fb4){_0x561e2b['body']['SmsAccountId']=_0x198fb4['id'];return db[_0x4077('0x68')][_0x4077('0x5c')](_0x561e2b['body']);}})[_0x4077('0x21')](respondWithResult(_0x14960b,null))['catch'](handleError(_0x14960b,null));};exports[_0x4077('0x69')]=function(_0x14ca7f,_0x2625a3,_0x4eca07){var _0x55521c={'raw':![],'where':{}};var _0x554c5e={};var _0x3c7b76={'count':0x0,'rows':[]};return db[_0x4077('0x3f')]['findOne']({'where':{'id':_0x14ca7f[_0x4077('0x55')]['id']}})['then'](handleEntityNotFound(_0x2625a3,null))[_0x4077('0x21')](function(_0x31a2a5){if(_0x31a2a5){_0x554c5e[_0x4077('0x43')]=_['keys'](db[_0x4077('0x68')][_0x4077('0x40')]);_0x554c5e[_0x4077('0x44')]=_[_0x4077('0x58')](_0x14ca7f['query']);_0x554c5e[_0x4077('0x45')]=_[_0x4077('0x46')](_0x554c5e[_0x4077('0x43')],_0x554c5e[_0x4077('0x44')]);_0x55521c[_0x4077('0x47')]=_[_0x4077('0x46')](_0x554c5e[_0x4077('0x43')],qs[_0x4077('0x48')](_0x14ca7f[_0x4077('0x44')][_0x4077('0x48')]));_0x55521c[_0x4077('0x47')]=_0x55521c[_0x4077('0x47')][_0x4077('0x59')]?_0x55521c[_0x4077('0x47')]:_0x554c5e[_0x4077('0x43')];if(!_0x14ca7f[_0x4077('0x44')][_0x4077('0x49')](_0x4077('0x4a'))){_0x55521c[_0x4077('0x31')]=qs[_0x4077('0x31')](_0x14ca7f[_0x4077('0x44')][_0x4077('0x31')]);_0x55521c[_0x4077('0x30')]=qs[_0x4077('0x30')](_0x14ca7f[_0x4077('0x44')][_0x4077('0x30')]);}_0x55521c[_0x4077('0x4b')]=qs[_0x4077('0x4c')](_0x14ca7f[_0x4077('0x44')][_0x4077('0x4c')]);_0x55521c[_0x4077('0x4d')]=qs[_0x4077('0x45')](_['pick'](_0x14ca7f['query'],_0x554c5e['filters']));_0x55521c[_0x4077('0x4d')][_0x4077('0x62')]=_0x31a2a5['id'];if(_0x14ca7f[_0x4077('0x44')][_0x4077('0x51')]){_0x55521c[_0x4077('0x4d')]=_[_0x4077('0x4f')](_0x55521c[_0x4077('0x4d')],{'$or':_[_0x4077('0x3e')](_0x55521c[_0x4077('0x47')],function(_0x1ce789){var _0x52ea5d={};_0x52ea5d[_0x1ce789]={'$like':'%'+_0x14ca7f[_0x4077('0x44')][_0x4077('0x51')]+'%'};return _0x52ea5d;})});}_0x55521c=_[_0x4077('0x4f')]({},_0x55521c,_0x14ca7f[_0x4077('0x5a')]);return db[_0x4077('0x68')][_0x4077('0x2f')]({'where':_0x55521c[_0x4077('0x4d')]})['then'](function(_0xfd80ce){_0x3c7b76[_0x4077('0x2f')]=_0xfd80ce;if(_0x14ca7f[_0x4077('0x44')]['includeAll']){_0x55521c[_0x4077('0x53')]=[{'all':!![]}];}return db[_0x4077('0x68')]['findAll'](_0x55521c);})[_0x4077('0x21')](function(_0x1a9665){_0x3c7b76[_0x4077('0x6a')]=_0x1a9665;return _0x3c7b76;});}})['then'](respondWithFilteredResult(_0x2625a3,_0x55521c))[_0x4077('0x29')](handleError(_0x2625a3,null));};exports[_0x4077('0x6b')]=function(_0x4632a2,_0xe6263f,_0x2acabc){return db[_0x4077('0x3f')][_0x4077('0x5b')]({'where':{'id':_0x4632a2[_0x4077('0x55')]['id']}})[_0x4077('0x21')](handleEntityNotFound(_0xe6263f,null))['then'](function(_0x1b4bea){if(_0x1b4bea){return _0x1b4bea['removeAnswers'](_0x4632a2['query'][_0x4077('0x66')]);}})[_0x4077('0x21')](respondWithStatusCode(_0xe6263f,null))[_0x4077('0x29')](handleError(_0xe6263f,null));};exports['notify']=function(_0x31979f,_0x5b81f8,_0x4bb6d6){var _0x284536={'channel':_0x4077('0x6c')};var _0x2bf4c7=[];var _0x2df2a2=[];var _0x563b3e={};return db[_0x4077('0x3f')][_0x4077('0x5b')]({'where':{'id':_0x31979f[_0x4077('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x4077('0x6d')}]})[_0x4077('0x21')](handleEntityNotFound(_0x5b81f8,null))[_0x4077('0x21')](function(_0xcc6b05){_0x284536[_0x4077('0x6e')]=_0xcc6b05;_0x284536[_0x4077('0x6f')]=_['orderBy'](_0xcc6b05[_0x4077('0x6d')],['priority'],[_0x4077('0x70')]);if(_0x284536['account'][_0x4077('0x6d')]){delete _0x284536[_0x4077('0x6e')][_0x4077('0x6d')];}return db[_0x4077('0x71')]['describe']();})['then'](function(_0x5e6f61){if(!_0x5e6f61){throw new db[(_0x4077('0x72'))]['ValidationError'](_0x4077('0x73'));}_0x2bf4c7=_[_0x4077('0x74')](_[_0x4077('0x58')](_0x5e6f61),[_0x4077('0x75'),_0x4077('0x76')]);_0x2df2a2=_[_0x4077('0x74')](_['keys'](_0x5e6f61),[_0x4077('0x75'),_0x4077('0x76'),_0x4077('0x77'),_0x4077('0x78')]);_0x284536['body']={'mapKey':_0x4077('0x79')};if(_0x284536[_0x4077('0x6e')][_0x4077('0x50')]){switch(_0x284536[_0x4077('0x6e')]['type']){case _0x4077('0x7a'):_0x284536['body'][_0x4077('0x7b')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x7c')];_0x284536[_0x4077('0x5d')]['body']=_0x31979f[_0x4077('0x5d')][_0x4077('0x7d')];_0x284536[_0x4077('0x5d')][_0x4077('0x7e')]=_0x31979f['body']['MessageSid'];break;case _0x4077('0x7f'):_0x284536[_0x4077('0x5d')]['from']='+'+_0x31979f['body'][_0x4077('0x80')];_0x284536[_0x4077('0x5d')][_0x4077('0x5d')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x81')];break;case _0x4077('0x82'):_0x284536[_0x4077('0x5d')][_0x4077('0x7b')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x7b')];_0x284536['body']['body']=_0x31979f['body'][_0x4077('0x27')];break;case _0x4077('0x83'):_0x284536[_0x4077('0x5d')]['from']=_0x31979f[_0x4077('0x5d')][_0x4077('0x7b')];_0x284536[_0x4077('0x5d')][_0x4077('0x5d')]=_0x31979f[_0x4077('0x5d')]['body'];_0x284536[_0x4077('0x5d')][_0x4077('0x7e')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x84')];break;case _0x4077('0x85'):_0x284536[_0x4077('0x5d')][_0x4077('0x7b')]=_0x31979f[_0x4077('0x5d')]['From'];_0x284536[_0x4077('0x5d')][_0x4077('0x5d')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x86')];_0x284536['body'][_0x4077('0x7e')]=_0x31979f['body'][_0x4077('0x87')];break;case'infobip':_0x284536['body'][_0x4077('0x7b')]='+'+_0x31979f[_0x4077('0x5d')][_0x4077('0x88')][0x0]['from'];_0x284536['body'][_0x4077('0x5d')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x88')][0x0]['text'];_0x284536[_0x4077('0x5d')][_0x4077('0x7e')]=_0x31979f['body'][_0x4077('0x88')][0x0]['messageId'];break;case'csc':_0x284536[_0x4077('0x5d')]['from']=_0x31979f[_0x4077('0x5d')][_0x4077('0x89')];_0x284536[_0x4077('0x5d')][_0x4077('0x5d')]=_0x31979f['body']['segmentedMessage'][_0x4077('0x27')];break;case _0x4077('0x8a'):_0x284536[_0x4077('0x5d')][_0x4077('0x7b')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x8b')];_0x284536['body'][_0x4077('0x5d')]=_0x31979f['body'][_0x4077('0x81')];_0x284536[_0x4077('0x5d')][_0x4077('0x7e')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x8c')];break;case _0x4077('0x8d'):_0x284536[_0x4077('0x5d')][_0x4077('0x7e')]=_0x31979f[_0x4077('0x5d')][0x0][_0x4077('0x27')]['id'];_0x284536[_0x4077('0x5d')][_0x4077('0x7b')]=_0x31979f['body'][0x0][_0x4077('0x27')][_0x4077('0x7b')];_0x284536[_0x4077('0x5d')][_0x4077('0x5d')]=_0x31979f['body'][0x0][_0x4077('0x27')][_0x4077('0x81')];break;case _0x4077('0x8e'):_0x284536['body'][_0x4077('0x7b')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x7b')];_0x284536[_0x4077('0x5d')][_0x4077('0x5d')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x27')];_0x284536[_0x4077('0x5d')][_0x4077('0x7e')]=_0x31979f[_0x4077('0x5d')][_0x4077('0x8f')];break;}}if(_0x284536[_0x4077('0x5d')]['id']){delete _0x284536[_0x4077('0x5d')]['id'];}if(_[_0x4077('0x90')](_0x284536[_0x4077('0x5d')][_0x4077('0x7b')])){throw new db[(_0x4077('0x72'))][(_0x4077('0x91'))](_0x4077('0x92'));}if(_[_0x4077('0x90')](_0x284536['body'][_0x4077('0x5d')])||_0x284536[_0x4077('0x5d')][_0x4077('0x5d')]===''){throw new db[(_0x4077('0x72'))][(_0x4077('0x91'))](_0x4077('0x93'));}if(_[_0x4077('0x90')](_0x284536['body'][_0x4077('0x94')])){throw new db[(_0x4077('0x72'))][(_0x4077('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2df2a2);}if(!_[_0x4077('0x95')](_0x2df2a2,_0x284536[_0x4077('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0x4077('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2df2a2);}_0x563b3e[_0x284536[_0x4077('0x5d')][_0x4077('0x94')]]=_0x284536[_0x4077('0x5d')][_0x4077('0x7b')];return db[_0x4077('0x96')]['find']({'where':{'id':_0x284536[_0x4077('0x6e')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x4077('0x97'),'where':_0x563b3e,'limit':0x1,'order':[[_0x4077('0x76'),_0x4077('0x98')]]}]});})[_0x4077('0x21')](handleEntityNotFound(_0x5b81f8,null))[_0x4077('0x21')](function(_0x3e2307){if(_0x3e2307){_0x284536[_0x4077('0x99')]=_[_0x4077('0x9a')](_0x3e2307,[_0x4077('0x97')]);if(_0x3e2307[_0x4077('0x97')][_0x4077('0x59')]){return _0x3e2307[_0x4077('0x97')][0x0];}var _0x305ba8=_['defaults'](_0x284536['body'],{'firstName':_0x284536['body'][_0x4077('0x7b')],'ListId':_0x3e2307['id']});_0x305ba8[_0x284536[_0x4077('0x5d')][_0x4077('0x94')]]=_0x284536['body']['from'];return db['CmContact'][_0x4077('0x5c')](_0x305ba8,{'fields':_0x2bf4c7,'raw':!![]});}})[_0x4077('0x21')](handleEntityNotFound(_0x5b81f8,null))['then'](function(_0xc47b15){if(_0xc47b15){_0x284536[_0x4077('0x9b')]=_0xc47b15;var _0x51b25f={'ContactId':_0xc47b15['id'],'phone':_0x284536[_0x4077('0x5d')][_0x4077('0x7b')],'SmsAccountId':_0x31979f['params']['id']};var _0xbe4bc={'ContactId':_0xc47b15['id'],'SmsAccountId':_0x31979f['params']['id'],'closed':![]};return db[_0x4077('0x9c')]['find']({'where':_0xbe4bc})[_0x4077('0x21')](function(_0xe53342){if(_0xe53342){return[_0xe53342,![]];}return db[_0x4077('0x9c')][_0x4077('0x5c')](_0x51b25f)[_0x4077('0x21')](function(_0x3c86b3){return[_0x3c86b3,!![]];});});}})['spread'](function(_0x1064c4,_0x5c81b7){_0x284536['interaction']=_0x1064c4[_0x4077('0x37')]({'plain':!![]});_0x284536['interaction']['created']=![];if(_0x5c81b7){if(_0x284536[_0x4077('0x6e')][_0x4077('0x9d')]){_0x284536[_0x4077('0x6f')][_0x4077('0x9e')]({'id':0x0,'priority':_0x284536[_0x4077('0x6f')][_0x4077('0x59')]+0x1,'app':_0x4077('0x9f'),'appdata':_0x4077('0xa0'),'interval':_0x4077('0xa1')});}_0x284536[_0x4077('0xa2')][_0x4077('0xa3')]=!![];}return db['SmsMessage'][_0x4077('0x5c')]({'phone':_0x284536[_0x4077('0x5d')][_0x4077('0x7b')],'messageId':_0x284536[_0x4077('0x5d')][_0x4077('0x7e')],'body':_0x284536[_0x4077('0x5d')][_0x4077('0x5d')],'SmsAccountId':_0x31979f[_0x4077('0x55')]['id'],'SmsInteractionId':_0x1064c4['id'],'direction':'in','ContactId':_0x1064c4['ContactId'],'AttachmentId':_0x284536[_0x4077('0x5d')][_0x4077('0xa4')]});})[_0x4077('0x21')](function(_0x3e9a65){_0x284536[_0x4077('0x27')]=_0x3e9a65;if(_0x284536[_0x4077('0xa2')][_0x4077('0xa5')]){return db[_0x4077('0xa6')][_0x4077('0x5b')]({'attributes':['id','name'],'where':{'id':_0x284536['interaction'][_0x4077('0xa5')]}})[_0x4077('0x21')](function(_0x3f36a1){if(_0x3f36a1){_0x284536['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3f36a1[_0x4077('0x3b')]+','+(_0x284536['account'][_0x4077('0xa7')]||0xa),'interval':_0x4077('0xa1')});}return respondWithRpcPromise(_0x4077('0xa8'),_0x4077('0xa9'),_0x284536);});}return respondWithRpcPromise('Start','startRouting',_0x284536);})[_0x4077('0x21')](function(_0x40852e){if(_0x40852e){var _0x59b616=0xc8;var _0x3bbeb5='receiveMessage';logger[_0x4077('0xaa')](_0x4077('0xab'),_0x3bbeb5,_0x59b616,_0x4077('0xac'));logger[_0x4077('0xad')](_0x4077('0xae'),_0x3bbeb5,_0x59b616,_0x4077('0xac'),JSON[_0x4077('0x24')](_0x40852e));if(_0x284536['account'][_0x4077('0x50')]===_0x4077('0x7a')){return _0x5b81f8[_0x4077('0x2c')](_0x59b616)[_0x4077('0xaf')](_0x4077('0xb0'),'text/xml')[_0x4077('0x3c')](_0x4077('0xb1'));}else{return _0x5b81f8[_0x4077('0x2c')](_0x59b616)[_0x4077('0x2d')](_0x40852e);}}})['catch'](handleError(_0x5b81f8,null));};exports['addApplications']=function(_0xd32ec4,_0xc82877){var _0x52d937=_0xd32ec4['params']['id'];var _0x48cbba=_0xd32ec4[_0x4077('0x5d')];var _0x27358b=0xc8;var _0xfd6e34=null;return db[_0x4077('0xb2')][_0x4077('0xb3')]({'isolationLevel':db[_0x4077('0xb2')][_0x4077('0xb4')]['ISOLATION_LEVELS'][_0x4077('0xb5')]},function(_0x46f6f3){return db[_0x4077('0x3f')][_0x4077('0x64')]({'where':{'id':_0x52d937},'transaction':_0x46f6f3})[_0x4077('0x21')](function(_0x2d74c0){if(_0x2d74c0){return db[_0x4077('0xb6')]['destroy']({'where':{'SmsAccountId':_0x52d937},'transaction':_0x46f6f3})[_0x4077('0x21')](function(){var _0x5e0bb4=_[_0x4077('0x3e')](_0x48cbba,function(_0x413e0b){_0x413e0b['SmsAccountId']=_0x52d937;return _0x413e0b;});return db[_0x4077('0xb6')][_0x4077('0xb7')](_0x5e0bb4,{'transaction':_0x46f6f3});});}else{_0x27358b=0x194;_0xfd6e34=[];}});})['then'](function(){if(_0x27358b!==0x194){return db[_0x4077('0xb6')][_0x4077('0xb8')]({'where':{'SmsAccountId':_0x52d937},'order':_0x4077('0xb9')})[_0x4077('0x21')](function(_0x4676be){_0xfd6e34=_0x4676be;});}})['catch'](function(_0x15e78e){_0x27358b=0x1f4;logger[_0x4077('0x25')](_0x15e78e[_0x4077('0x3a')]);if(_0x15e78e[_0x4077('0x3b')]){delete _0x15e78e[_0x4077('0x3b')];}_0xfd6e34=_0x15e78e;})[_0x4077('0xba')](function(){if(_0xfd6e34===null){_0xc82877['sendStatus'](_0x27358b);}else{if(_0x27358b===0x1f4){_0xc82877['status'](_0x27358b)['send'](_0xfd6e34);}else{_0xc82877[_0x4077('0x2c')](_0x27358b)[_0x4077('0x2d')](_0xfd6e34);}}});};exports[_0x4077('0xbb')]=function(_0x13a530,_0x3c7f06,_0x25e91a){var _0x5ba36a={};var _0x370cbc={};var _0x41acb6;var _0x3ea410;return db[_0x4077('0x3f')]['findOne']({'where':{'id':_0x13a530['params']['id']}})['then'](handleEntityNotFound(_0x3c7f06,null))[_0x4077('0x21')](function(_0x243660){if(_0x243660){_0x41acb6=_0x243660;_0x370cbc[_0x4077('0x43')]=_[_0x4077('0x58')](db[_0x4077('0xb6')][_0x4077('0x40')]);_0x370cbc[_0x4077('0x44')]=_[_0x4077('0x58')](_0x13a530[_0x4077('0x44')]);_0x370cbc[_0x4077('0x45')]=_['intersection'](_0x370cbc['model'],_0x370cbc['query']);_0x5ba36a[_0x4077('0x47')]=_['intersection'](_0x370cbc['model'],qs['fields'](_0x13a530['query'][_0x4077('0x48')]));_0x5ba36a['attributes']=_0x5ba36a[_0x4077('0x47')][_0x4077('0x59')]?_0x5ba36a['attributes']:_0x370cbc[_0x4077('0x43')];_0x5ba36a[_0x4077('0x4b')]=qs['sort'](_0x13a530['query']['sort']);_0x5ba36a['where']=qs[_0x4077('0x45')](_[_0x4077('0x4e')](_0x13a530[_0x4077('0x44')],_0x370cbc[_0x4077('0x45')]));if(_0x13a530[_0x4077('0x44')][_0x4077('0x51')]){_0x5ba36a[_0x4077('0x4d')]=_[_0x4077('0x4f')](_0x5ba36a['where'],{'$or':_[_0x4077('0x3e')](_0x5ba36a['attributes'],function(_0x5cc31e){var _0x3103a7={};_0x3103a7[_0x5cc31e]={'$like':'%'+_0x13a530[_0x4077('0x44')][_0x4077('0x51')]+'%'};return _0x3103a7;})});}_0x5ba36a=_[_0x4077('0x4f')]({},_0x5ba36a,_0x13a530[_0x4077('0x5a')]);return _0x41acb6[_0x4077('0xbb')](_0x5ba36a);}})[_0x4077('0x21')](function(_0x1e5b0d){if(_0x1e5b0d){_0x3ea410=_0x1e5b0d[_0x4077('0x59')];if(!_0x13a530[_0x4077('0x44')]['hasOwnProperty'](_0x4077('0x4a'))){_0x5ba36a['limit']=qs[_0x4077('0x31')](_0x13a530[_0x4077('0x44')][_0x4077('0x31')]);_0x5ba36a['offset']=qs[_0x4077('0x30')](_0x13a530[_0x4077('0x44')][_0x4077('0x30')]);}return _0x41acb6['getApplications'](_0x5ba36a);}})[_0x4077('0x21')](function(_0x425154){if(_0x425154){return _0x425154?{'count':_0x3ea410,'rows':_0x425154}:null;}})[_0x4077('0x21')](respondWithResult(_0x3c7f06,null))[_0x4077('0x29')](handleError(_0x3c7f06,null));};exports['getInteractions']=function(_0x51f8dd,_0x1f8da7,_0x4f2cfd){var _0x704dc6={'raw':![],'where':{}};var _0x39fc0f={};var _0x3443b5={'count':0x0,'rows':[]};return db[_0x4077('0x3f')][_0x4077('0x64')]({'where':{'id':_0x51f8dd['params']['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x1f8da7,null))[_0x4077('0x21')](function(_0xd7d384){if(_0xd7d384){_0x39fc0f[_0x4077('0x43')]=_[_0x4077('0x58')](db[_0x4077('0x9c')][_0x4077('0x40')]);_0x39fc0f[_0x4077('0x44')]=_['keys'](_0x51f8dd[_0x4077('0x44')]);_0x39fc0f[_0x4077('0x45')]=_['intersection'](_0x39fc0f[_0x4077('0x43')],_0x39fc0f[_0x4077('0x44')]);_0x704dc6[_0x4077('0x47')]=_[_0x4077('0x46')](_0x39fc0f[_0x4077('0x43')],qs['fields'](_0x51f8dd[_0x4077('0x44')][_0x4077('0x48')]));_0x704dc6[_0x4077('0x47')]=_0x704dc6['attributes'][_0x4077('0x59')]?_0x704dc6[_0x4077('0x47')]:_0x39fc0f[_0x4077('0x43')];if(!_0x51f8dd['query'][_0x4077('0x49')](_0x4077('0x4a'))){_0x704dc6[_0x4077('0x31')]=qs[_0x4077('0x31')](_0x51f8dd[_0x4077('0x44')][_0x4077('0x31')]);_0x704dc6[_0x4077('0x30')]=qs['offset'](_0x51f8dd[_0x4077('0x44')][_0x4077('0x30')]);}_0x704dc6[_0x4077('0x4b')]=qs[_0x4077('0x4c')](_0x51f8dd['query']['sort']);_0x704dc6['where']=qs[_0x4077('0x45')](_[_0x4077('0x4e')](_0x51f8dd[_0x4077('0x44')],_0x39fc0f[_0x4077('0x45')]));_0x704dc6[_0x4077('0x4d')]['SmsAccountId']=_0xd7d384['id'];if(_0x51f8dd[_0x4077('0x44')][_0x4077('0x51')]){_0x704dc6[_0x4077('0x4d')]=_[_0x4077('0x4f')](_0x704dc6[_0x4077('0x4d')],{'$or':_[_0x4077('0x3e')](_0x704dc6[_0x4077('0x47')],function(_0x18f1ad){var _0x3d3e5b={};_0x3d3e5b[_0x18f1ad]={'$like':'%'+_0x51f8dd['query'][_0x4077('0x51')]+'%'};return _0x3d3e5b;})});}_0x704dc6=_[_0x4077('0x4f')]({},_0x704dc6,_0x51f8dd['options']);return db['SmsInteraction'][_0x4077('0x2f')]({'where':_0x704dc6[_0x4077('0x4d')]})['then'](function(_0x9c87f8){_0x3443b5['count']=_0x9c87f8;if(_0x51f8dd[_0x4077('0x44')][_0x4077('0x52')]){_0x704dc6[_0x4077('0x53')]=[{'model':db[_0x4077('0x71')],'as':_0x4077('0xbc'),'required':![]},{'model':db[_0x4077('0xa6')],'as':_0x4077('0xbd'),'attributes':[_0x4077('0x3b'),_0x4077('0xbe'),'internal'],'required':![]},{'model':db[_0x4077('0xbf')],'as':_0x4077('0xc0'),'attributes':['id','name',_0x4077('0xc1')],'where':_0x51f8dd[_0x4077('0x44')]['tag']?{'id':_0x51f8dd['query']['tag']}:undefined,'required':_0x51f8dd[_0x4077('0x44')]['tag']?!![]:![]}];}return db[_0x4077('0x9c')][_0x4077('0xc2')](_0x704dc6);})[_0x4077('0x21')](function(_0x2ab0c6){_0x3443b5[_0x4077('0x6a')]=_0x2ab0c6;return _0x3443b5;});}})[_0x4077('0x21')](respondWithFilteredResult(_0x1f8da7,_0x704dc6))['catch'](handleError(_0x1f8da7,null));};exports[_0x4077('0x3c')]=function(_0x160081,_0x3d1a1a,_0x70b2f8){var _0x12d194,_0x21fc29,_0x576377;if(_[_0x4077('0x90')](_0x160081[_0x4077('0x5d')][_0x4077('0x5d')])||_0x160081[_0x4077('0x5d')][_0x4077('0x5d')]===''){throw new db[(_0x4077('0x72'))][(_0x4077('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4077('0x90')](_0x160081[_0x4077('0x5d')]['to'])){throw new db[(_0x4077('0x72'))]['ValidationError'](_0x4077('0xc3'));}_0x12d194=_0x160081['body']['to'];return db[_0x4077('0x3f')][_0x4077('0x5b')]({'where':{'id':_0x160081[_0x4077('0x55')]['id']},'include':[{'model':db[_0x4077('0x96')],'as':_0x4077('0xc4'),'include':[{'model':db['CmContact'],'as':_0x4077('0x97'),'where':{'mobile':_0x12d194},'limit':0x1,'order':[[_0x4077('0x76'),_0x4077('0x98')]]}]}]})['then'](handleEntityNotFound(_0x3d1a1a,null))[_0x4077('0x21')](function(_0x3fa83f){if(_0x3fa83f&&_0x3fa83f[_0x4077('0xc4')]){_0x21fc29=_0x3fa83f[_0x4077('0x37')]({'plain':!![]});if(_0x21fc29['List']&&_0x21fc29[_0x4077('0xc4')][_0x4077('0x97')][_0x4077('0x59')]){return _0x21fc29[_0x4077('0xc4')][_0x4077('0x97')][0x0];}return db[_0x4077('0x71')][_0x4077('0x5c')](_[_0x4077('0x1c')](_0x160081[_0x4077('0x5d')],{'firstName':_0x12d194,'mobile':_0x12d194,'phone':_0x12d194,'ListId':_0x21fc29[_0x4077('0x78')]}));}})[_0x4077('0x21')](handleEntityNotFound(_0x3d1a1a,null))['then'](function(_0x418310){if(_0x418310){_0x576377=_0x418310;return db[_0x4077('0x9c')][_0x4077('0x5b')]({'where':{'ContactId':_0x576377['id'],'closed':![],'SmsAccountId':_0x21fc29['id']}})[_0x4077('0x21')](function(_0x4e4c36){if(_0x4e4c36){return[_0x4e4c36,![]];}return db[_0x4077('0x9c')][_0x4077('0x5c')]({'UserId':_0x160081['user']['id'],'ContactId':_0x576377['id'],'SmsAccountId':_0x21fc29['id'],'phone':_0x12d194,'firstMsgDirection':_0x4077('0xc5'),'Messages':[_[_0x4077('0x4f')](_0x160081['body'],{'read':![],'body':_0x160081['body'][_0x4077('0x5d')],'phone':_0x12d194,'SmsAccountId':_0x21fc29['id'],'UserId':_0x160081[_0x4077('0x5e')]['id'],'ContactId':_0x576377['id']})]},{'include':[{'model':db[_0x4077('0xc6')],'as':_0x4077('0xc7')}]})[_0x4077('0x21')](function(_0x4038da){return[_0x4038da,!![]];});});}})['spread'](function(_0x3a48c7,_0x3e1ad6){if(_0x3e1ad6){return _0x3a48c7;}return db[_0x4077('0xc6')][_0x4077('0x5c')](_[_0x4077('0x4f')](_0x160081[_0x4077('0x5d')],{'read':![],'body':_0x160081[_0x4077('0x5d')][_0x4077('0x5d')],'phone':_0x12d194,'SmsAccountId':_0x21fc29['id'],'SmsInteractionId':_0x3a48c7['id'],'UserId':_0x160081['user']['id'],'ContactId':_0x576377['id']}))[_0x4077('0x21')](function(_0x11ae94){_0x3a48c7['dataValues']['Messages']=[];_0x3a48c7[_0x4077('0xc8')][_0x4077('0xc7')][_0x4077('0x9e')](_0x11ae94[_0x4077('0xc8')]);return _0x3a48c7;});})[_0x4077('0x21')](respondWithResult(_0x3d1a1a,null))['catch'](handleError(_0x3d1a1a,null));};exports['status']=function(_0x5110ed,_0x34e040,_0x3f7082){if(_0x5110ed[_0x4077('0x5d')]['id']){delete _0x5110ed[_0x4077('0x5d')]['id'];}var _0x5edf9f,_0x28c38c,_0x1c80ca;return db[_0x4077('0x3f')]['find']({'where':{'id':_0x5110ed['params']['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x34e040,null))[_0x4077('0x21')](function(_0x43282c){if(_0x43282c){_0x1c80ca=_0x43282c;logger[_0x4077('0xad')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4077('0x2c'),'received\x20delivery\x20report\x20from',_0x43282c['type'],util[_0x4077('0xc9')](_0x5110ed[_0x4077('0x5d')],{'showHidden':![],'depth':null}));switch(_0x43282c['type']){case'skebby':if(_0x5110ed[_0x4077('0x5d')][_0x4077('0xca')]&&_0x5110ed[_0x4077('0x5d')][_0x4077('0x2c')]){_0x28c38c=_0x5110ed[_0x4077('0x5d')][_0x4077('0x2c')];return db['SmsMessage'][_0x4077('0x5b')]({'where':{'messageId':_0x5110ed[_0x4077('0x5d')][_0x4077('0xca')]}});}break;case _0x4077('0x82'):if(_0x5110ed[_0x4077('0x5d')][_0x4077('0xcb')]&&_0x5110ed[_0x4077('0x5d')][_0x4077('0xcc')]){_0x28c38c=_0x5110ed[_0x4077('0x5d')][_0x4077('0xcc')];return db['SmsMessage'][_0x4077('0x5b')]({'where':{'messageId':_0x5110ed['body'][_0x4077('0xcb')]}});}break;case'clicksend':if(_0x5110ed['body']['message_id']&&_0x5110ed[_0x4077('0x5d')][_0x4077('0xcd')]){_0x28c38c=_0x5110ed[_0x4077('0x5d')][_0x4077('0xcd')];return db[_0x4077('0xc6')]['find']({'where':{'messageId':_0x5110ed['body'][_0x4077('0x84')]}});}break;case'infobip':var _0x4a941d=_0x5110ed[_0x4077('0x5d')][_0x4077('0x88')][0x0];if(_0x4a941d['messageId']&&_0x4a941d[_0x4077('0x2c')][_0x4077('0xce')]==='DELIVERED'){_0x28c38c=_0x4a941d['status'][_0x4077('0xce')];return db[_0x4077('0xc6')]['find']({'where':{'messageId':_0x4a941d[_0x4077('0x7e')]}});}break;case'clickatell':if(_0x5110ed[_0x4077('0x5d')][_0x4077('0x7e')]&&_0x5110ed[_0x4077('0x5d')]['status']){_0x28c38c=_0x5110ed[_0x4077('0x5d')][_0x4077('0x2c')];return db[_0x4077('0xc6')]['find']({'where':{'messageId':_0x5110ed['body']['messageId']}});}break;case _0x4077('0x8d'):if(_0x5110ed['body'][0x0]['message']['id']){_0x28c38c=_0x5110ed[_0x4077('0x5d')][0x0]['type'];return db['SmsMessage'][_0x4077('0x5b')]({'where':{'messageId':_0x5110ed[_0x4077('0x5d')][0x0][_0x4077('0x27')]['id']}});}break;case _0x4077('0x8e'):if(_0x5110ed['body']['redif']&&_0x5110ed[_0x4077('0x5d')][_0x4077('0x2c')]){_0x28c38c=_0x5110ed[_0x4077('0x5d')][_0x4077('0x2c')];return db['SmsMessage'][_0x4077('0x5b')]({'where':{'messageId':_0x5110ed['body'][_0x4077('0xcf')]}});}break;}}})[_0x4077('0x21')](handleEntityNotFound(_0x34e040,null))['then'](function(_0x3d7b47){if(_0x3d7b47){_0x5edf9f=_0x3d7b47;switch(_0x1c80ca[_0x4077('0x50')]){case _0x4077('0x7f'):if(_0x28c38c==='DELIVERED'){return _0x5edf9f[_0x4077('0x36')]({'read':!![]});}else{logger[_0x4077('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4077('0x2c'),_0x4077('0x7f'),util[_0x4077('0xc9')](_0x5110ed[_0x4077('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4077('0x82'):if(_0x28c38c==='1'){return _0x5edf9f[_0x4077('0x36')]({'read':!![]});}else{logger['error'](_0x4077('0xab'),_0x4077('0x2c'),_0x4077('0x7f'),util[_0x4077('0xc9')](_0x5110ed[_0x4077('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4077('0x83'):if(!_0x5110ed[_0x4077('0x5d')][_0x4077('0xd0')]&&_0x28c38c>=0xc8&&_0x28c38c<=0xce){return _0x5edf9f[_0x4077('0x36')]({'read':!![]});}else{logger[_0x4077('0x25')](_0x4077('0xab'),'status',_0x4077('0x83'),util[_0x4077('0xc9')](_0x5110ed[_0x4077('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4077('0xd1'):var _0x2ed80f=_0x5110ed[_0x4077('0x5d')][_0x4077('0x88')][0x0];if(_0x2ed80f['status']['groupName']==='DELIVERED'){return _0x5edf9f[_0x4077('0x36')]({'read':!![]});}else{logger[_0x4077('0x25')](_0x4077('0xab'),'status','infobip',util['inspect'](_0x5110ed[_0x4077('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4077('0x8a'):if(_0x28c38c==_0x4077('0xd2')||_0x28c38c==_0x4077('0xd3')){return _0x5edf9f[_0x4077('0x36')]({'read':!![]});}else{logger[_0x4077('0x25')](_0x4077('0xab'),'status',_0x4077('0x8a'),util['inspect'](_0x5110ed['body'],{'showHidden':![],'depth':null}));}break;case _0x4077('0x8d'):if(_0x28c38c==_0x4077('0xd4')){return _0x5edf9f['update']({'read':!![]});}else{logger[_0x4077('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4077('0x2c'),_0x4077('0x8d'),util[_0x4077('0xc9')](_0x5110ed[_0x4077('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4077('0x8e'):if(_0x28c38c===_0x4077('0xd5')||_0x28c38c==='ACCEPTD'){return _0x5edf9f[_0x4077('0x36')]({'read':!![]});}else{logger[_0x4077('0x25')](_0x4077('0xab'),_0x4077('0x2c'),_0x4077('0x8e'),util[_0x4077('0xc9')](_0x5110ed[_0x4077('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x5edf9f;}})[_0x4077('0x21')](respondWithResult(_0x34e040,null))[_0x4077('0x29')](handleError(_0x34e040,null));};exports[_0x4077('0xd6')]=function(_0x167c54,_0x19895d,_0x50b4aa){var _0x42493e,_0x962c09,_0x33bcec;return db['SmsAccount'][_0x4077('0x5b')]({'where':{'id':_0x167c54[_0x4077('0x55')]['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x19895d,null))[_0x4077('0x21')](function(_0x581d6e){if(_0x581d6e){_0x33bcec=_0x581d6e;logger[_0x4077('0xad')](_0x4077('0xab'),_0x4077('0x2c'),'received\x20delivery\x20report\x20from',_0x581d6e['type'],util['inspect'](_0x167c54[_0x4077('0x44')],{'showHidden':![],'depth':null}));switch(_0x581d6e[_0x4077('0x50')]){case _0x4077('0xd7'):if(_0x167c54['query'][_0x4077('0xd8')]&&_0x167c54['query'][_0x4077('0xd9')]){_0x962c09=_0x167c54[_0x4077('0x44')][_0x4077('0xd9')];return db[_0x4077('0xc6')][_0x4077('0x5b')]({'where':{'messageId':_0x167c54[_0x4077('0x44')][_0x4077('0xd8')]}});}break;}}})[_0x4077('0x21')](handleEntityNotFound(_0x19895d,null))[_0x4077('0x21')](function(_0x4380cb){if(_0x4380cb){_0x42493e=_0x4380cb;switch(_0x33bcec['type']){case'csc':if(_0x962c09==='2'||_0x962c09==='6'){return _0x42493e[_0x4077('0x36')]({'read':!![]});}else{logger['error'](_0x4077('0xab'),_0x4077('0x2c'),_0x4077('0xd7'),util[_0x4077('0xc9')](_0x167c54[_0x4077('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x42493e;}})['then'](respondWithResult(_0x19895d,null))[_0x4077('0x29')](handleError(_0x19895d,null));};exports[_0x4077('0xda')]=function(_0x536065,_0x408a8b,_0x2d6fb0){return db['SmsAccount']['find']({'where':{'id':_0x536065[_0x4077('0x55')]['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x408a8b,null))['then'](function(_0x126477){if(_0x126477){return _0x126477[_0x4077('0xda')](_0x536065['body'][_0x4077('0x66')],_[_0x4077('0x9a')](_0x536065[_0x4077('0x5d')],['ids','id'])||{})[_0x4077('0xdb')](function(_0x524c5b){for(var _0x588271=0x0;_0x588271<_0x536065['body'][_0x4077('0x66')][_0x4077('0x59')];_0x588271+=0x1){socket[_0x4077('0xdc')](_0x4077('0xdd'),{'UserId':Number(_0x536065[_0x4077('0x5d')][_0x4077('0x66')][_0x588271]),'SmsAccountId':Number(_0x536065[_0x4077('0x55')]['id'])});}return _0x524c5b;});}})[_0x4077('0x21')](respondWithResult(_0x408a8b,null))['catch'](handleError(_0x408a8b,null));};exports[_0x4077('0xde')]=function(_0x4f47ba,_0x522e4c,_0x2686c0){return db['SmsAccount'][_0x4077('0x5b')]({'where':{'id':_0x4f47ba[_0x4077('0x55')]['id']}})['then'](handleEntityNotFound(_0x522e4c,null))[_0x4077('0x21')](function(_0x26fe88){if(_0x26fe88){return _0x26fe88['removeAgents'](_0x4f47ba[_0x4077('0x44')]['ids'])[_0x4077('0x21')](function(){if(_[_0x4077('0xdf')](_0x4f47ba[_0x4077('0x44')][_0x4077('0x66')])){for(var _0x41868b=0x0;_0x41868b<_0x4f47ba['query'][_0x4077('0x66')][_0x4077('0x59')];_0x41868b+=0x1){socket[_0x4077('0xdc')](_0x4077('0xe0'),{'UserId':Number(_0x4f47ba[_0x4077('0x44')][_0x4077('0x66')][_0x41868b]),'SmsAccountId':Number(_0x4f47ba[_0x4077('0x55')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x4f47ba[_0x4077('0x44')][_0x4077('0x66')]),'SmsAccountId':Number(_0x4f47ba[_0x4077('0x55')]['id'])});}});}})[_0x4077('0x21')](respondWithStatusCode(_0x522e4c,null))[_0x4077('0x29')](handleError(_0x522e4c,null));};exports['getAgents']=function(_0x3f5777,_0x5aff53,_0x3dad5d){var _0x1615f0={};var _0x488e29={};var _0x41b1f2;var _0x1248ae;return db[_0x4077('0x3f')][_0x4077('0x64')]({'where':{'id':_0x3f5777[_0x4077('0x55')]['id']}})[_0x4077('0x21')](handleEntityNotFound(_0x5aff53,null))[_0x4077('0x21')](function(_0x4b30ff){if(_0x4b30ff){_0x41b1f2=_0x4b30ff;_0x488e29[_0x4077('0x43')]=_[_0x4077('0x58')](db[_0x4077('0xa6')][_0x4077('0x40')]);_0x488e29[_0x4077('0x44')]=_[_0x4077('0x58')](_0x3f5777['query']);_0x488e29[_0x4077('0x45')]=_[_0x4077('0x46')](_0x488e29[_0x4077('0x43')],_0x488e29[_0x4077('0x44')]);_0x1615f0[_0x4077('0x47')]=_[_0x4077('0x46')](_0x488e29['model'],qs[_0x4077('0x48')](_0x3f5777[_0x4077('0x44')][_0x4077('0x48')]));_0x1615f0[_0x4077('0x47')]=_0x1615f0[_0x4077('0x47')][_0x4077('0x59')]?_0x1615f0[_0x4077('0x47')]:_0x488e29[_0x4077('0x43')];_0x1615f0['order']=qs['sort'](_0x3f5777[_0x4077('0x44')]['sort']);_0x1615f0[_0x4077('0x4d')]=qs[_0x4077('0x45')](_['pick'](_0x3f5777[_0x4077('0x44')],_0x488e29[_0x4077('0x45')]));if(_0x3f5777['query'][_0x4077('0x51')]){_0x1615f0['where']=_[_0x4077('0x4f')](_0x1615f0['where'],{'$or':_[_0x4077('0x3e')](_0x1615f0[_0x4077('0x47')],function(_0x5c00f6){var _0x20087f={};_0x20087f[_0x5c00f6]={'$like':'%'+_0x3f5777[_0x4077('0x44')][_0x4077('0x51')]+'%'};return _0x20087f;})});}_0x1615f0=_[_0x4077('0x4f')]({},_0x1615f0,_0x3f5777[_0x4077('0x5a')]);return _0x41b1f2['getAgents'](_0x1615f0);}})[_0x4077('0x21')](function(_0x1c84e7){if(_0x1c84e7){_0x1248ae=_0x1c84e7[_0x4077('0x59')];if(!_0x3f5777[_0x4077('0x44')][_0x4077('0x49')](_0x4077('0x4a'))){_0x1615f0[_0x4077('0x31')]=qs['limit'](_0x3f5777[_0x4077('0x44')]['limit']);_0x1615f0[_0x4077('0x30')]=qs[_0x4077('0x30')](_0x3f5777[_0x4077('0x44')]['offset']);}return _0x41b1f2[_0x4077('0xe1')](_0x1615f0);}})[_0x4077('0x21')](function(_0x1fe61d){if(_0x1fe61d){return _0x1fe61d?{'count':_0x1248ae,'rows':_0x1fe61d}:null;}})[_0x4077('0x21')](respondWithResult(_0x5aff53,null))[_0x4077('0x29')](handleError(_0x5aff53,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 3a0fece..3539317 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 _0x0cfe=['../../mysqldb','SmsAccount','setMaxListeners','save','update','emit','hook','exports'];(function(_0x449540,_0x485f71){var _0x41cc73=function(_0x1f1017){while(--_0x1f1017){_0x449540['push'](_0x449540['shift']());}};_0x41cc73(++_0x485f71);}(_0x0cfe,0xe0));var _0xe0cf=function(_0x4717eb,_0x3e4d29){_0x4717eb=_0x4717eb-0x0;var _0x19004f=_0x0cfe[_0x4717eb];return _0x19004f;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xe0cf('0x0'))['db'][_0xe0cf('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe0cf('0x2')](0x0);var events={'afterCreate':_0xe0cf('0x3'),'afterUpdate':_0xe0cf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x470fa7){return function(_0x569fae,_0x1b4331,_0x50a241){SmsAccountEvents[_0xe0cf('0x5')](_0x470fa7+':'+_0x569fae['id'],_0x569fae);SmsAccountEvents[_0xe0cf('0x5')](_0x470fa7,_0x569fae);_0x50a241(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe0cf('0x6')](e,emitEvent(event));}}module[_0xe0cf('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x7c01=['update','remove','emit','hasOwnProperty','events','../../mysqldb','SmsAccount','save'];(function(_0x31af20,_0x44a6b9){var _0x34a205=function(_0x105278){while(--_0x105278){_0x31af20['push'](_0x31af20['shift']());}};_0x34a205(++_0x44a6b9);}(_0x7c01,0x64));var _0x17c0=function(_0x247902,_0x1bc6cc){_0x247902=_0x247902-0x0;var _0x4b01ba=_0x7c01[_0x247902];return _0x4b01ba;};'use strict';var EventEmitter=require(_0x17c0('0x0'));var SmsAccount=require(_0x17c0('0x1'))['db'][_0x17c0('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17c0('0x3'),'afterUpdate':_0x17c0('0x4'),'afterDestroy':_0x17c0('0x5')};function emitEvent(_0x1ee2e5){return function(_0x70cbe3,_0x34365e,_0x2392a2){SmsAccountEvents[_0x17c0('0x6')](_0x1ee2e5+':'+_0x70cbe3['id'],_0x70cbe3);SmsAccountEvents[_0x17c0('0x6')](_0x1ee2e5,_0x70cbe3);_0x2392a2(null);};}for(var e in events){if(events[_0x17c0('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5ad51b1..cbd3b78 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 _0x8deb=['bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts','lodash','../../config/logger','moment'];(function(_0x1c4242,_0x1b9850){var _0x5afd51=function(_0x165b24){while(--_0x165b24){_0x1c4242['push'](_0x1c4242['shift']());}};_0x5afd51(++_0x1b9850);}(_0x8deb,0x15d));var _0xb8de=function(_0x541c83,_0xf5bbb2){_0x541c83=_0x541c83-0x0;var _0x10fdd1=_0x8deb[_0x541c83];return _0x10fdd1;};'use strict';var _=require(_0xb8de('0x0'));var util=require('util');var logger=require(_0xb8de('0x1'))('api');var moment=require(_0xb8de('0x2'));var BPromise=require(_0xb8de('0x3'));var rp=require(_0xb8de('0x4'));var fs=require('fs');var path=require(_0xb8de('0x5'));var rimraf=require('rimraf');var config=require(_0xb8de('0x6'));var attributes=require(_0xb8de('0x7'));module[_0xb8de('0x8')]=function(_0xe1964f,_0x1f5d80){return _0xe1964f[_0xb8de('0x9')]('SmsAccount',attributes,{'tableName':_0xb8de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4916=['exports','define','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x7b5489,_0x7bb3c7){var _0x25b22d=function(_0x43adf8){while(--_0x43adf8){_0x7b5489['push'](_0x7b5489['shift']());}};_0x25b22d(++_0x7bb3c7);}(_0x4916,0xbd));var _0x6491=function(_0x3d80d4,_0x566226){_0x3d80d4=_0x3d80d4-0x0;var _0x70baef=_0x4916[_0x3d80d4];return _0x70baef;};'use strict';var _=require(_0x6491('0x0'));var util=require('util');var logger=require(_0x6491('0x1'))(_0x6491('0x2'));var moment=require(_0x6491('0x3'));var BPromise=require('bluebird');var rp=require(_0x6491('0x4'));var fs=require('fs');var path=require(_0x6491('0x5'));var rimraf=require(_0x6491('0x6'));var config=require(_0x6491('0x7'));var attributes=require(_0x6491('0x8'));module[_0x6491('0x9')]=function(_0x322c14,_0x5bf908){return _0x322c14[_0x6491('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','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 c8341ef..d0bdf6a 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 _0x0d6e=['SmsAccount','find','options','raw','include','model','attributes','map','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount'];(function(_0x32d6aa,_0x142bc9){var _0x210496=function(_0xad21c3){while(--_0xad21c3){_0x32d6aa['push'](_0x32d6aa['shift']());}};_0x210496(++_0x142bc9);}(_0x0d6e,0x1a0));var _0xe0d6=function(_0x54b41e,_0x52d77e){_0x54b41e=_0x54b41e-0x0;var _0x515a88=_0x0d6e[_0x54b41e];return _0x515a88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe0d6('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0d6('0x1'));var db=require(_0xe0d6('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe0d6('0x3'));var config=require(_0xe0d6('0x4'));var jayson=require(_0xe0d6('0x5'));var client=jayson[_0xe0d6('0x6')][_0xe0d6('0x7')]({'port':0x232a});config[_0xe0d6('0x8')]=_[_0xe0d6('0x9')](config[_0xe0d6('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0d6('0xa'))(new Redis(config[_0xe0d6('0x8')]));require(_0xe0d6('0xb'))['register'](socket);function respondWithRpcPromise(_0x2e71ba,_0x3db0cc,_0x1a1679){return new BPromise(function(_0x5dddbc,_0x33c83c){return client[_0xe0d6('0xc')](_0x2e71ba,_0x1a1679)[_0xe0d6('0xd')](function(_0x22744a){logger[_0xe0d6('0xe')]('SmsAccount,\x20%s,\x20%s',_0x3db0cc,_0xe0d6('0xf'));logger[_0xe0d6('0x10')](_0xe0d6('0x11'),_0x3db0cc,_0xe0d6('0xf'),JSON[_0xe0d6('0x12')](_0x22744a));if(_0x22744a[_0xe0d6('0x13')]){if(_0x22744a['error'][_0xe0d6('0x14')]===0x1f4){logger['error'](_0xe0d6('0x15'),_0x3db0cc,_0x22744a[_0xe0d6('0x13')][_0xe0d6('0x16')]);return _0x33c83c(_0x22744a[_0xe0d6('0x13')]['message']);}logger[_0xe0d6('0x13')](_0xe0d6('0x15'),_0x3db0cc,_0x22744a[_0xe0d6('0x13')][_0xe0d6('0x16')]);return _0x5dddbc(_0x22744a[_0xe0d6('0x13')]['message']);}else{logger[_0xe0d6('0xe')](_0xe0d6('0x15'),_0x3db0cc,_0xe0d6('0xf'));_0x5dddbc(_0x22744a[_0xe0d6('0x17')][_0xe0d6('0x16')]);}})[_0xe0d6('0x18')](function(_0x5e6419){logger[_0xe0d6('0x13')](_0xe0d6('0x15'),_0x3db0cc,_0x5e6419);_0x33c83c(_0x5e6419);});});}exports[_0xe0d6('0x19')]=function(_0x3d1602){var _0x3d6957=this;return new Promise(function(_0x209bda,_0x3ba0c9){return db[_0xe0d6('0x1a')][_0xe0d6('0x1b')]({'raw':_0x3d1602[_0xe0d6('0x1c')]?_0x3d1602[_0xe0d6('0x1c')][_0xe0d6('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d1602[_0xe0d6('0x1c')]?_0x3d1602['options']['where']||null:null,'attributes':_0x3d1602['options']?_0x3d1602['options']['attributes']||null:null,'include':_0x3d1602[_0xe0d6('0x1c')]?_0x3d1602[_0xe0d6('0x1c')]['include']?_['map'](_0x3d1602[_0xe0d6('0x1c')][_0xe0d6('0x1e')],function(_0x433da6){return{'model':db[_0x433da6[_0xe0d6('0x1f')]],'as':_0x433da6['as'],'attributes':_0x433da6[_0xe0d6('0x20')],'include':_0x433da6[_0xe0d6('0x1e')]?_['map'](_0x433da6[_0xe0d6('0x1e')],function(_0x24e338){return{'model':db[_0x24e338[_0xe0d6('0x1f')]],'as':_0x24e338['as'],'attributes':_0x24e338[_0xe0d6('0x20')],'include':_0x24e338[_0xe0d6('0x1e')]?_[_0xe0d6('0x21')](_0x24e338['include'],function(_0x487f01){return{'model':db[_0x487f01['model']],'as':_0x487f01['as'],'attributes':_0x487f01[_0xe0d6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe0d6('0xd')](function(_0x544e47){logger[_0xe0d6('0xe')](_0xe0d6('0x19'),_0x3d1602);logger[_0xe0d6('0x10')](_0xe0d6('0x19'),_0x3d1602,JSON[_0xe0d6('0x12')](_0x544e47));_0x209bda(_0x544e47);})[_0xe0d6('0x18')](function(_0x25f3ff){logger[_0xe0d6('0x13')](_0xe0d6('0x19'),_0x25f3ff[_0xe0d6('0x16')],_0x3d1602);_0x3ba0c9(_0x3d6957[_0xe0d6('0x13')](0x1f4,_0x25f3ff[_0xe0d6('0x16')]));});});}; \ No newline at end of file +var _0xde27=['map','info','stringify','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsAccount.socket','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','find','options','where','attributes','include','model'];(function(_0x32ce20,_0x315ba9){var _0x41a705=function(_0x45db1c){while(--_0x45db1c){_0x32ce20['push'](_0x32ce20['shift']());}};_0x41a705(++_0x315ba9);}(_0xde27,0x18f));var _0x7de2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde27[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7de2('0x0'));var BPromise=require(_0x7de2('0x1'));var rs=require(_0x7de2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7de2('0x3'));var logger=require(_0x7de2('0x4'))('rpc');var config=require(_0x7de2('0x5'));var jayson=require(_0x7de2('0x6'));var client=jayson[_0x7de2('0x7')][_0x7de2('0x8')]({'port':0x232a});config['redis']=_[_0x7de2('0x9')](config[_0x7de2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7de2('0xb'))(new Redis(config[_0x7de2('0xa')]));require(_0x7de2('0xc'))['register'](socket);function respondWithRpcPromise(_0x40b71c,_0x402689,_0x246c10){return new BPromise(function(_0x466cef,_0x4e94d1){return client['request'](_0x40b71c,_0x246c10)[_0x7de2('0xd')](function(_0x4df190){logger['info'](_0x7de2('0xe'),_0x402689,_0x7de2('0xf'));logger[_0x7de2('0x10')](_0x7de2('0x11'),_0x402689,'request\x20sent',JSON['stringify'](_0x4df190));if(_0x4df190[_0x7de2('0x12')]){if(_0x4df190[_0x7de2('0x12')][_0x7de2('0x13')]===0x1f4){logger[_0x7de2('0x12')](_0x7de2('0xe'),_0x402689,_0x4df190[_0x7de2('0x12')][_0x7de2('0x14')]);return _0x4e94d1(_0x4df190[_0x7de2('0x12')][_0x7de2('0x14')]);}logger[_0x7de2('0x12')]('SmsAccount,\x20%s,\x20%s',_0x402689,_0x4df190['error']['message']);return _0x466cef(_0x4df190[_0x7de2('0x12')][_0x7de2('0x14')]);}else{logger['info'](_0x7de2('0xe'),_0x402689,_0x7de2('0xf'));_0x466cef(_0x4df190[_0x7de2('0x15')][_0x7de2('0x14')]);}})[_0x7de2('0x16')](function(_0x1223f1){logger[_0x7de2('0x12')]('SmsAccount,\x20%s,\x20%s',_0x402689,_0x1223f1);_0x4e94d1(_0x1223f1);});});}exports[_0x7de2('0x17')]=function(_0x2d55bf){var _0x10022b=this;return new Promise(function(_0x42714d,_0x1b17cc){return db['SmsAccount'][_0x7de2('0x18')]({'raw':_0x2d55bf['options']?_0x2d55bf['options']['raw']===undefined?!![]:![]:!![],'where':_0x2d55bf[_0x7de2('0x19')]?_0x2d55bf[_0x7de2('0x19')][_0x7de2('0x1a')]||null:null,'attributes':_0x2d55bf[_0x7de2('0x19')]?_0x2d55bf[_0x7de2('0x19')][_0x7de2('0x1b')]||null:null,'include':_0x2d55bf['options']?_0x2d55bf[_0x7de2('0x19')][_0x7de2('0x1c')]?_['map'](_0x2d55bf['options']['include'],function(_0x4f3f01){return{'model':db[_0x4f3f01[_0x7de2('0x1d')]],'as':_0x4f3f01['as'],'attributes':_0x4f3f01[_0x7de2('0x1b')],'include':_0x4f3f01['include']?_[_0x7de2('0x1e')](_0x4f3f01['include'],function(_0x5cca8f){return{'model':db[_0x5cca8f[_0x7de2('0x1d')]],'as':_0x5cca8f['as'],'attributes':_0x5cca8f[_0x7de2('0x1b')],'include':_0x5cca8f[_0x7de2('0x1c')]?_[_0x7de2('0x1e')](_0x5cca8f[_0x7de2('0x1c')],function(_0x2820b3){return{'model':db[_0x2820b3[_0x7de2('0x1d')]],'as':_0x2820b3['as'],'attributes':_0x2820b3[_0x7de2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7de2('0xd')](function(_0x51ff7b){logger[_0x7de2('0x1f')]('ShowSmsAccount',_0x2d55bf);logger['debug']('ShowSmsAccount',_0x2d55bf,JSON[_0x7de2('0x20')](_0x51ff7b));_0x42714d(_0x51ff7b);})[_0x7de2('0x16')](function(_0x37dc96){logger['error'](_0x7de2('0x17'),_0x37dc96['message'],_0x2d55bf);_0x1b17cc(_0x10022b[_0x7de2('0x12')](0x1f4,_0x37dc96['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index b4e06ba..5fa46c3 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 b538145..efc837f 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 _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(_0x2c9efc,_0x44473f){var _0x4045f3=function(_0x35ba35){while(--_0x35ba35){_0x2c9efc['push'](_0x2c9efc['shift']());}};_0x4045f3(++_0x44473f);}(_0x008c,0x188));var _0xc008=function(_0x579fa4,_0x1911e0){_0x579fa4=_0x579fa4-0x0;var _0x514fa2=_0x008c[_0x579fa4];return _0x514fa2;};'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 65a66ec..0037cde 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 _0x0b9f=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x0b9f,0x1cf));var _0xf0b9=function(_0x258d86,_0x2ac3f3){_0x258d86=_0x258d86-0x0;var _0x46ff28=_0x0b9f[_0x258d86];return _0x46ff28;};'use strict';var Sequelize=require(_0xf0b9('0x0'));module[_0xf0b9('0x1')]={'priority':{'type':Sequelize[_0xf0b9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf0b9('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf0b9('0x4')],'defaultValue':_0xf0b9('0x5')}}; \ No newline at end of file +var _0x6391=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x287e2d,_0x2b8785){var _0x22c2ec=function(_0x599458){while(--_0x599458){_0x287e2d['push'](_0x287e2d['shift']());}};_0x22c2ec(++_0x2b8785);}(_0x6391,0x115));var _0x1639=function(_0x870b62,_0x2143f9){_0x870b62=_0x870b62-0x0;var _0x2dcb39=_0x6391[_0x870b62];return _0x2dcb39;};'use strict';var Sequelize=require(_0x1639('0x0'));module[_0x1639('0x1')]={'priority':{'type':Sequelize[_0x1639('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1639('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1639('0x4')]()},'description':{'type':Sequelize[_0x1639('0x3')]},'interval':{'type':Sequelize[_0x1639('0x3')],'defaultValue':_0x1639('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9c4fb76..4ca6880 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 _0xe6f6=['end','name','send','index','SmsApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','update','then'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0xe6f6,0x149));var _0x6e6f=function(_0x1812d9,_0x233e9c){_0x1812d9=_0x1812d9-0x0;var _0x3ed430=_0xe6f6[_0x1812d9];return _0x3ed430;};'use strict';var emlformat=require(_0x6e6f('0x0'));var rimraf=require(_0x6e6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e6f('0x2'));var rp=require('request-promise');var moment=require(_0x6e6f('0x3'));var BPromise=require(_0x6e6f('0x4'));var Mustache=require('mustache');var util=require(_0x6e6f('0x5'));var path=require(_0x6e6f('0x6'));var sox=require(_0x6e6f('0x7'));var csv=require(_0x6e6f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e6f('0x9'));var _=require('lodash');var squel=require(_0x6e6f('0xa'));var crypto=require(_0x6e6f('0xb'));var jsforce=require(_0x6e6f('0xc'));var deskjs=require(_0x6e6f('0xd'));var toCsv=require(_0x6e6f('0x8'));var querystring=require(_0x6e6f('0xe'));var Papa=require(_0x6e6f('0xf'));var Redis=require(_0x6e6f('0x10'));var authService=require(_0x6e6f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6e6f('0x12'));var hardwareService=require(_0x6e6f('0x13'));var logger=require(_0x6e6f('0x14'))(_0x6e6f('0x15'));var utils=require(_0x6e6f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6e6f('0x17'));var db=require(_0x6e6f('0x18'))['db'];function respondWithStatusCode(_0x2417fa,_0x57f89c){_0x57f89c=_0x57f89c||0xcc;return function(_0x259656){if(_0x259656){return _0x2417fa[_0x6e6f('0x19')](_0x57f89c);}return _0x2417fa['status'](_0x57f89c)['end']();};}function respondWithResult(_0x4b7bac,_0x3f817f){_0x3f817f=_0x3f817f||0xc8;return function(_0x29a927){if(_0x29a927){return _0x4b7bac[_0x6e6f('0x1a')](_0x3f817f)[_0x6e6f('0x1b')](_0x29a927);}};}function respondWithFilteredResult(_0x3ddb48,_0xbebf28){return function(_0x2cfbf4){if(_0x2cfbf4){var _0x4c2068=typeof _0xbebf28[_0x6e6f('0x1c')]===_0x6e6f('0x1d')&&typeof _0xbebf28[_0x6e6f('0x1e')]===_0x6e6f('0x1d');var _0x101daf=_0x2cfbf4['count'];var _0xd07ae7=_0x4c2068?0x0:_0xbebf28[_0x6e6f('0x1c')];var _0x3799ab=_0x4c2068?_0x2cfbf4['count']:_0xbebf28['offset']+_0xbebf28[_0x6e6f('0x1e')];var _0x1af34b;if(_0x3799ab>=_0x101daf){_0x3799ab=_0x101daf;_0x1af34b=0xc8;}else{_0x1af34b=0xce;}_0x3ddb48['status'](_0x1af34b);return _0x3ddb48[_0x6e6f('0x1f')]('Content-Range',_0xd07ae7+'-'+_0x3799ab+'/'+_0x101daf)[_0x6e6f('0x1b')](_0x2cfbf4);}return null;};}function patchUpdates(_0xba95c7){return function(_0x57d958){try{jsonpatch[_0x6e6f('0x20')](_0x57d958,_0xba95c7,!![]);}catch(_0x27304a){return BPromise[_0x6e6f('0x21')](_0x27304a);}return _0x57d958['save']();};}function saveUpdates(_0x2ab6c8,_0x36b2d8){return function(_0x304c8d){if(_0x304c8d){return _0x304c8d[_0x6e6f('0x22')](_0x2ab6c8)[_0x6e6f('0x23')](function(_0x3c2226){return _0x3c2226;});}return null;};}function removeEntity(_0x2778df,_0x4e1bc0){return function(_0xeb5e91){if(_0xeb5e91){return _0xeb5e91['destroy']()['then'](function(){_0x2778df[_0x6e6f('0x1a')](0xcc)[_0x6e6f('0x24')]();});}};}function handleEntityNotFound(_0x27658b,_0x54ec75){return function(_0x1d016b){if(!_0x1d016b){_0x27658b['sendStatus'](0x194);}return _0x1d016b;};}function handleError(_0x39b974,_0x46ce94){_0x46ce94=_0x46ce94||0x1f4;return function(_0x5c6cdd){logger['error'](_0x5c6cdd['stack']);if(_0x5c6cdd[_0x6e6f('0x25')]){delete _0x5c6cdd[_0x6e6f('0x25')];}_0x39b974['status'](_0x46ce94)[_0x6e6f('0x26')](_0x5c6cdd);};}exports[_0x6e6f('0x27')]=function(_0x3709fe,_0x2e1117){var _0x3ef08e={},_0x2b66b9={},_0x1e25c8={'count':0x0,'rows':[]};var _0x3148b9=_['map'](db[_0x6e6f('0x28')]['rawAttributes'],function(_0x2392b4){return{'name':_0x2392b4[_0x6e6f('0x29')],'type':_0x2392b4[_0x6e6f('0x2a')][_0x6e6f('0x2b')]};});_0x2b66b9[_0x6e6f('0x2c')]=_[_0x6e6f('0x2d')](_0x3148b9,_0x6e6f('0x25'));_0x2b66b9[_0x6e6f('0x2e')]=_[_0x6e6f('0x2f')](_0x3709fe['query']);_0x2b66b9[_0x6e6f('0x30')]=_[_0x6e6f('0x31')](_0x2b66b9[_0x6e6f('0x2c')],_0x2b66b9[_0x6e6f('0x2e')]);_0x3ef08e[_0x6e6f('0x32')]=_[_0x6e6f('0x31')](_0x2b66b9[_0x6e6f('0x2c')],qs[_0x6e6f('0x33')](_0x3709fe[_0x6e6f('0x2e')][_0x6e6f('0x33')]));_0x3ef08e[_0x6e6f('0x32')]=_0x3ef08e[_0x6e6f('0x32')][_0x6e6f('0x34')]?_0x3ef08e[_0x6e6f('0x32')]:_0x2b66b9['model'];if(!_0x3709fe[_0x6e6f('0x2e')][_0x6e6f('0x35')](_0x6e6f('0x36'))){_0x3ef08e[_0x6e6f('0x1e')]=qs[_0x6e6f('0x1e')](_0x3709fe[_0x6e6f('0x2e')]['limit']);_0x3ef08e[_0x6e6f('0x1c')]=qs[_0x6e6f('0x1c')](_0x3709fe[_0x6e6f('0x2e')][_0x6e6f('0x1c')]);}_0x3ef08e['order']=qs[_0x6e6f('0x37')](_0x3709fe[_0x6e6f('0x2e')][_0x6e6f('0x37')]);_0x3ef08e[_0x6e6f('0x38')]=qs['filters'](_[_0x6e6f('0x39')](_0x3709fe[_0x6e6f('0x2e')],_0x2b66b9[_0x6e6f('0x30')]),_0x3148b9);if(_0x3709fe[_0x6e6f('0x2e')][_0x6e6f('0x3a')]){_0x3ef08e[_0x6e6f('0x38')]=_['merge'](_0x3ef08e[_0x6e6f('0x38')],{'$or':_['map'](_0x3148b9,function(_0x5efb39){if(_0x5efb39[_0x6e6f('0x2a')]!=='VIRTUAL'){var _0x42daa0={};_0x42daa0[_0x5efb39['name']]={'$like':'%'+_0x3709fe[_0x6e6f('0x2e')]['filter']+'%'};return _0x42daa0;}})});}_0x3ef08e=_[_0x6e6f('0x3b')]({},_0x3ef08e,_0x3709fe[_0x6e6f('0x3c')]);var _0x54756f={'where':_0x3ef08e['where']};return db[_0x6e6f('0x28')][_0x6e6f('0x3d')](_0x54756f)[_0x6e6f('0x23')](function(_0x28c3e1){_0x1e25c8[_0x6e6f('0x3d')]=_0x28c3e1;if(_0x3709fe[_0x6e6f('0x2e')][_0x6e6f('0x3e')]){_0x3ef08e[_0x6e6f('0x3f')]=[{'all':!![]}];}return db['SmsApplication'][_0x6e6f('0x40')](_0x3ef08e);})['then'](function(_0x31561d){_0x1e25c8[_0x6e6f('0x41')]=_0x31561d;return _0x1e25c8;})[_0x6e6f('0x23')](respondWithFilteredResult(_0x2e1117,_0x3ef08e))[_0x6e6f('0x42')](handleError(_0x2e1117,null));};exports[_0x6e6f('0x43')]=function(_0x4d3f47,_0x2423c3){var _0x3795ab={'raw':!![],'where':{'id':_0x4d3f47[_0x6e6f('0x44')]['id']}},_0x1aa5f2={};_0x1aa5f2[_0x6e6f('0x2c')]=_['keys'](db[_0x6e6f('0x28')]['rawAttributes']);_0x1aa5f2[_0x6e6f('0x2e')]=_[_0x6e6f('0x2f')](_0x4d3f47['query']);_0x1aa5f2[_0x6e6f('0x30')]=_[_0x6e6f('0x31')](_0x1aa5f2['model'],_0x1aa5f2[_0x6e6f('0x2e')]);_0x3795ab[_0x6e6f('0x32')]=_[_0x6e6f('0x31')](_0x1aa5f2[_0x6e6f('0x2c')],qs['fields'](_0x4d3f47['query'][_0x6e6f('0x33')]));_0x3795ab[_0x6e6f('0x32')]=_0x3795ab[_0x6e6f('0x32')]['length']?_0x3795ab[_0x6e6f('0x32')]:_0x1aa5f2[_0x6e6f('0x2c')];if(_0x4d3f47[_0x6e6f('0x2e')][_0x6e6f('0x3e')]){_0x3795ab[_0x6e6f('0x3f')]=[{'all':!![]}];}_0x3795ab=_['merge']({},_0x3795ab,_0x4d3f47[_0x6e6f('0x3c')]);return db['SmsApplication'][_0x6e6f('0x45')](_0x3795ab)[_0x6e6f('0x23')](handleEntityNotFound(_0x2423c3,null))[_0x6e6f('0x23')](respondWithResult(_0x2423c3,null))['catch'](handleError(_0x2423c3,null));};exports[_0x6e6f('0x46')]=function(_0x75b3dd,_0x5320b8){return db[_0x6e6f('0x28')]['create'](_0x75b3dd[_0x6e6f('0x47')],{})['then'](respondWithResult(_0x5320b8,0xc9))[_0x6e6f('0x42')](handleError(_0x5320b8,null));};exports['update']=function(_0x1dbd31,_0x16658e){if(_0x1dbd31[_0x6e6f('0x47')]['id']){delete _0x1dbd31['body']['id'];}return db[_0x6e6f('0x28')][_0x6e6f('0x45')]({'where':{'id':_0x1dbd31[_0x6e6f('0x44')]['id']}})[_0x6e6f('0x23')](handleEntityNotFound(_0x16658e,null))[_0x6e6f('0x23')](saveUpdates(_0x1dbd31['body'],null))[_0x6e6f('0x23')](respondWithResult(_0x16658e,null))[_0x6e6f('0x42')](handleError(_0x16658e,null));};exports[_0x6e6f('0x48')]=function(_0x2c995c,_0x2cf0a7){return db[_0x6e6f('0x28')][_0x6e6f('0x45')]({'where':{'id':_0x2c995c['params']['id']}})[_0x6e6f('0x23')](handleEntityNotFound(_0x2cf0a7,null))['then'](removeEntity(_0x2cf0a7,null))[_0x6e6f('0x42')](handleError(_0x2cf0a7,null));}; \ No newline at end of file +var _0x69b0=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','SmsApplication','rawAttributes','fieldName','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','include','rows','show','params','includeAll','find','create','body','catch','eml-format','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0x69b0,0xda));var _0x069b=function(_0x1fa274,_0x27a51f){_0x1fa274=_0x1fa274-0x0;var _0x5601e0=_0x69b0[_0x1fa274];return _0x5601e0;};'use strict';var emlformat=require(_0x069b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x069b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x069b('0x2'));var BPromise=require(_0x069b('0x3'));var Mustache=require(_0x069b('0x4'));var util=require(_0x069b('0x5'));var path=require(_0x069b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x069b('0x7'));var _=require(_0x069b('0x8'));var squel=require('squel');var crypto=require(_0x069b('0x9'));var jsforce=require(_0x069b('0xa'));var deskjs=require(_0x069b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x069b('0xc'));var Papa=require(_0x069b('0xd'));var Redis=require(_0x069b('0xe'));var authService=require(_0x069b('0xf'));var qs=require(_0x069b('0x10'));var as=require(_0x069b('0x11'));var hardwareService=require(_0x069b('0x12'));var logger=require(_0x069b('0x13'))('api');var utils=require(_0x069b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x069b('0x15'));var db=require(_0x069b('0x16'))['db'];function respondWithStatusCode(_0x52578e,_0x2c0fe9){_0x2c0fe9=_0x2c0fe9||0xcc;return function(_0x7078a8){if(_0x7078a8){return _0x52578e[_0x069b('0x17')](_0x2c0fe9);}return _0x52578e[_0x069b('0x18')](_0x2c0fe9)[_0x069b('0x19')]();};}function respondWithResult(_0x1fb140,_0x9ca3ad){_0x9ca3ad=_0x9ca3ad||0xc8;return function(_0x30aee8){if(_0x30aee8){return _0x1fb140[_0x069b('0x18')](_0x9ca3ad)[_0x069b('0x1a')](_0x30aee8);}};}function respondWithFilteredResult(_0x5d1eb2,_0x3130cd){return function(_0x4b271c){if(_0x4b271c){var _0x7c9399=typeof _0x3130cd[_0x069b('0x1b')]===_0x069b('0x1c')&&typeof _0x3130cd[_0x069b('0x1d')]===_0x069b('0x1c');var _0x463bb5=_0x4b271c[_0x069b('0x1e')];var _0x243478=_0x7c9399?0x0:_0x3130cd[_0x069b('0x1b')];var _0x530450=_0x7c9399?_0x4b271c[_0x069b('0x1e')]:_0x3130cd['offset']+_0x3130cd['limit'];var _0xea4991;if(_0x530450>=_0x463bb5){_0x530450=_0x463bb5;_0xea4991=0xc8;}else{_0xea4991=0xce;}_0x5d1eb2[_0x069b('0x18')](_0xea4991);return _0x5d1eb2[_0x069b('0x1f')](_0x069b('0x20'),_0x243478+'-'+_0x530450+'/'+_0x463bb5)['json'](_0x4b271c);}return null;};}function patchUpdates(_0x591713){return function(_0x3ace91){try{jsonpatch[_0x069b('0x21')](_0x3ace91,_0x591713,!![]);}catch(_0x1a42d5){return BPromise[_0x069b('0x22')](_0x1a42d5);}return _0x3ace91[_0x069b('0x23')]();};}function saveUpdates(_0xe2a99b,_0x110cc2){return function(_0x32e529){if(_0x32e529){return _0x32e529[_0x069b('0x24')](_0xe2a99b)[_0x069b('0x25')](function(_0x3b4a15){return _0x3b4a15;});}return null;};}function removeEntity(_0x5c950a,_0x36d309){return function(_0x5ec40d){if(_0x5ec40d){return _0x5ec40d[_0x069b('0x26')]()[_0x069b('0x25')](function(){_0x5c950a[_0x069b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6091f,_0x2b49c2){return function(_0x26f741){if(!_0x26f741){_0xf6091f['sendStatus'](0x194);}return _0x26f741;};}function handleError(_0x2f2f14,_0x4d71be){_0x4d71be=_0x4d71be||0x1f4;return function(_0x4e092e){logger[_0x069b('0x27')](_0x4e092e[_0x069b('0x28')]);if(_0x4e092e[_0x069b('0x29')]){delete _0x4e092e[_0x069b('0x29')];}_0x2f2f14[_0x069b('0x18')](_0x4d71be)[_0x069b('0x2a')](_0x4e092e);};}exports['index']=function(_0x2cd3bb,_0x2e853a){var _0x16b2fc={},_0x3c2038={},_0x404c80={'count':0x0,'rows':[]};var _0x34e196=_['map'](db[_0x069b('0x2b')][_0x069b('0x2c')],function(_0x11e77f){return{'name':_0x11e77f[_0x069b('0x2d')],'type':_0x11e77f['type'][_0x069b('0x2e')]};});_0x3c2038[_0x069b('0x2f')]=_['map'](_0x34e196,_0x069b('0x29'));_0x3c2038['query']=_[_0x069b('0x30')](_0x2cd3bb['query']);_0x3c2038[_0x069b('0x31')]=_['intersection'](_0x3c2038[_0x069b('0x2f')],_0x3c2038[_0x069b('0x32')]);_0x16b2fc['attributes']=_[_0x069b('0x33')](_0x3c2038[_0x069b('0x2f')],qs['fields'](_0x2cd3bb[_0x069b('0x32')][_0x069b('0x34')]));_0x16b2fc[_0x069b('0x35')]=_0x16b2fc['attributes'][_0x069b('0x36')]?_0x16b2fc[_0x069b('0x35')]:_0x3c2038['model'];if(!_0x2cd3bb[_0x069b('0x32')][_0x069b('0x37')](_0x069b('0x38'))){_0x16b2fc['limit']=qs[_0x069b('0x1d')](_0x2cd3bb['query']['limit']);_0x16b2fc[_0x069b('0x1b')]=qs[_0x069b('0x1b')](_0x2cd3bb['query']['offset']);}_0x16b2fc[_0x069b('0x39')]=qs['sort'](_0x2cd3bb['query'][_0x069b('0x3a')]);_0x16b2fc[_0x069b('0x3b')]=qs[_0x069b('0x31')](_[_0x069b('0x3c')](_0x2cd3bb['query'],_0x3c2038[_0x069b('0x31')]),_0x34e196);if(_0x2cd3bb[_0x069b('0x32')][_0x069b('0x3d')]){_0x16b2fc[_0x069b('0x3b')]=_[_0x069b('0x3e')](_0x16b2fc[_0x069b('0x3b')],{'$or':_[_0x069b('0x3f')](_0x34e196,function(_0x7c9006){if(_0x7c9006[_0x069b('0x40')]!==_0x069b('0x41')){var _0x10d211={};_0x10d211[_0x7c9006[_0x069b('0x29')]]={'$like':'%'+_0x2cd3bb[_0x069b('0x32')][_0x069b('0x3d')]+'%'};return _0x10d211;}})});}_0x16b2fc=_[_0x069b('0x3e')]({},_0x16b2fc,_0x2cd3bb['options']);var _0x2b22c2={'where':_0x16b2fc[_0x069b('0x3b')]};return db[_0x069b('0x2b')][_0x069b('0x1e')](_0x2b22c2)['then'](function(_0x1e4e17){_0x404c80[_0x069b('0x1e')]=_0x1e4e17;if(_0x2cd3bb[_0x069b('0x32')]['includeAll']){_0x16b2fc[_0x069b('0x42')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x16b2fc);})['then'](function(_0x469be8){_0x404c80[_0x069b('0x43')]=_0x469be8;return _0x404c80;})[_0x069b('0x25')](respondWithFilteredResult(_0x2e853a,_0x16b2fc))['catch'](handleError(_0x2e853a,null));};exports[_0x069b('0x44')]=function(_0x4a5bfb,_0x5b8eb2){var _0x424401={'raw':!![],'where':{'id':_0x4a5bfb[_0x069b('0x45')]['id']}},_0x24a1f5={};_0x24a1f5['model']=_[_0x069b('0x30')](db[_0x069b('0x2b')][_0x069b('0x2c')]);_0x24a1f5[_0x069b('0x32')]=_[_0x069b('0x30')](_0x4a5bfb[_0x069b('0x32')]);_0x24a1f5[_0x069b('0x31')]=_[_0x069b('0x33')](_0x24a1f5[_0x069b('0x2f')],_0x24a1f5[_0x069b('0x32')]);_0x424401[_0x069b('0x35')]=_[_0x069b('0x33')](_0x24a1f5['model'],qs['fields'](_0x4a5bfb['query'][_0x069b('0x34')]));_0x424401[_0x069b('0x35')]=_0x424401[_0x069b('0x35')]['length']?_0x424401[_0x069b('0x35')]:_0x24a1f5[_0x069b('0x2f')];if(_0x4a5bfb['query'][_0x069b('0x46')]){_0x424401[_0x069b('0x42')]=[{'all':!![]}];}_0x424401=_['merge']({},_0x424401,_0x4a5bfb['options']);return db['SmsApplication'][_0x069b('0x47')](_0x424401)[_0x069b('0x25')](handleEntityNotFound(_0x5b8eb2,null))[_0x069b('0x25')](respondWithResult(_0x5b8eb2,null))['catch'](handleError(_0x5b8eb2,null));};exports[_0x069b('0x48')]=function(_0x4829b3,_0x33b87b){return db[_0x069b('0x2b')][_0x069b('0x48')](_0x4829b3[_0x069b('0x49')],{})['then'](respondWithResult(_0x33b87b,0xc9))[_0x069b('0x4a')](handleError(_0x33b87b,null));};exports[_0x069b('0x24')]=function(_0x40aac4,_0x3da9c7){if(_0x40aac4[_0x069b('0x49')]['id']){delete _0x40aac4[_0x069b('0x49')]['id'];}return db['SmsApplication'][_0x069b('0x47')]({'where':{'id':_0x40aac4[_0x069b('0x45')]['id']}})[_0x069b('0x25')](handleEntityNotFound(_0x3da9c7,null))[_0x069b('0x25')](saveUpdates(_0x40aac4[_0x069b('0x49')],null))[_0x069b('0x25')](respondWithResult(_0x3da9c7,null))[_0x069b('0x4a')](handleError(_0x3da9c7,null));};exports[_0x069b('0x26')]=function(_0x34dcae,_0x4997ce){return db['SmsApplication'][_0x069b('0x47')]({'where':{'id':_0x34dcae[_0x069b('0x45')]['id']}})[_0x069b('0x25')](handleEntityNotFound(_0x4997ce,null))['then'](removeEntity(_0x4997ce,null))[_0x069b('0x4a')](handleError(_0x4997ce,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index dfbe87d..2cebae8 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 _0x11be=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird'];(function(_0x26d9b3,_0x591f4e){var _0x15c226=function(_0x17bbdb){while(--_0x17bbdb){_0x26d9b3['push'](_0x26d9b3['shift']());}};_0x15c226(++_0x591f4e);}(_0x11be,0x15c));var _0xe11b=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x11be[_0x4a8bad];return _0x30cf32;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe11b('0x0'))(_0xe11b('0x1'));var moment=require('moment');var BPromise=require(_0xe11b('0x2'));var rp=require(_0xe11b('0x3'));var fs=require('fs');var path=require(_0xe11b('0x4'));var rimraf=require(_0xe11b('0x5'));var config=require(_0xe11b('0x6'));var attributes=require(_0xe11b('0x7'));module[_0xe11b('0x8')]=function(_0xea350e,_0x37ccd4){return _0xea350e['define'](_0xe11b('0x9'),attributes,{'tableName':_0xe11b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe11b('0xb'),'collate':_0xe11b('0xc')});}; \ No newline at end of file +var _0x23b0=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x393b5f,_0x4beaec){var _0x2444c6=function(_0xdee438){while(--_0xdee438){_0x393b5f['push'](_0x393b5f['shift']());}};_0x2444c6(++_0x4beaec);}(_0x23b0,0xc3));var _0x023b=function(_0x38d0ef,_0x1c9517){_0x38d0ef=_0x38d0ef-0x0;var _0x12f9bb=_0x23b0[_0x38d0ef];return _0x12f9bb;};'use strict';var _=require('lodash');var util=require(_0x023b('0x0'));var logger=require(_0x023b('0x1'))(_0x023b('0x2'));var moment=require(_0x023b('0x3'));var BPromise=require(_0x023b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x023b('0x5'));var config=require(_0x023b('0x6'));var attributes=require(_0x023b('0x7'));module[_0x023b('0x8')]=function(_0x3cc3d4,_0x3a30f0){return _0x3cc3d4[_0x023b('0x9')](_0x023b('0xa'),attributes,{'tableName':_0x023b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x023b('0xc'),'collate':_0x023b('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 8e420c2..a08f6ae 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 _0x9148=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3a7f5c,_0x374861){var _0x159f45=function(_0x48a698){while(--_0x48a698){_0x3a7f5c['push'](_0x3a7f5c['shift']());}};_0x159f45(++_0x374861);}(_0x9148,0x10d));var _0x8914=function(_0x1e6c5c,_0x5a95e3){_0x1e6c5c=_0x1e6c5c-0x0;var _0x3cbfbd=_0x9148[_0x1e6c5c];return _0x3cbfbd;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd146,_0x58e892,_0x1b0445){return new BPromise(function(_0x15aff5,_0x1e2d12){return client[_0x8914('0xc')](_0x1cd146,_0x1b0445)['then'](function(_0x2e7aac){logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));logger[_0x8914('0x10')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x58e892,_0x8914('0xf'),JSON[_0x8914('0x11')](_0x2e7aac));if(_0x2e7aac['error']){if(_0x2e7aac['error'][_0x8914('0x12')]===0x1f4){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);return _0x1e2d12(_0x2e7aac[_0x8914('0x13')]['message']);}logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac['error'][_0x8914('0x14')]);return _0x15aff5(_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);}else{logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));_0x15aff5(_0x2e7aac[_0x8914('0x15')][_0x8914('0x14')]);}})[_0x8914('0x16')](function(_0x4ca130){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x4ca130);_0x1e2d12(_0x4ca130);});});} \ No newline at end of file +var _0x2fc9=['stringify','error','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdb59f6,_0x566a68){var _0x59142c=function(_0x3a5d26){while(--_0x3a5d26){_0xdb59f6['push'](_0xdb59f6['shift']());}};_0x59142c(++_0x566a68);}(_0x2fc9,0xc2));var _0x92fc=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x2fc9[_0x420513];return _0x1b44ec;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var moment=require(_0x92fc('0x1'));var BPromise=require(_0x92fc('0x2'));var rs=require(_0x92fc('0x3'));var fs=require('fs');var Redis=require(_0x92fc('0x4'));var db=require(_0x92fc('0x5'))['db'];var utils=require(_0x92fc('0x6'));var logger=require(_0x92fc('0x7'))(_0x92fc('0x8'));var config=require(_0x92fc('0x9'));var jayson=require(_0x92fc('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c79a5,_0x340518,_0x13787c){return new BPromise(function(_0xa640a5,_0x3b656e){return client[_0x92fc('0xb')](_0x5c79a5,_0x13787c)[_0x92fc('0xc')](function(_0x2805f4){logger['info'](_0x92fc('0xd'),_0x340518,_0x92fc('0xe'));logger[_0x92fc('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x340518,_0x92fc('0xe'),JSON[_0x92fc('0x10')](_0x2805f4));if(_0x2805f4[_0x92fc('0x11')]){if(_0x2805f4['error']['code']===0x1f4){logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x2805f4['error'][_0x92fc('0x12')]);return _0x3b656e(_0x2805f4[_0x92fc('0x11')][_0x92fc('0x12')]);}logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x2805f4['error'][_0x92fc('0x12')]);return _0xa640a5(_0x2805f4[_0x92fc('0x11')][_0x92fc('0x12')]);}else{logger[_0x92fc('0x13')]('SmsApplication,\x20%s,\x20%s',_0x340518,'request\x20sent');_0xa640a5(_0x2805f4[_0x92fc('0x14')][_0x92fc('0x12')]);}})['catch'](function(_0x3370c9){logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x3370c9);_0x3b656e(_0x3370c9);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 16869d4..9170b25 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 _0x1775=['/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xa')](_0x5177('0xf'),auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5177('0x11')]);router[_0x5177('0xa')](_0x5177('0x12'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);router['post']('/',auth[_0x5177('0xb')](),controller[_0x5177('0x14')]);router[_0x5177('0x15')](_0x5177('0x16'),auth[_0x5177('0xb')](),controller[_0x5177('0x17')]);router[_0x5177('0x15')](_0x5177('0x18'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1b')),controller[_0x5177('0x1c')]);router[_0x5177('0x1d')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1e')),controller['update']);router[_0x5177('0x1f')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')]('sms',_0x5177('0x20')),controller[_0x5177('0x21')]);router[_0x5177('0x1f')]('/:id/tags',auth[_0x5177('0xb')](),controller['removeTags']);module[_0x5177('0x22')]=router; \ No newline at end of file +var _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5b78ce,_0x1d4893){_0x5b78ce=_0x5b78ce-0x0;var _0x35c05e=_0xd7d1[_0x5b78ce];return _0x35c05e;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 4677bc3..b80b452 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 _0x029b=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x029b,0x66));var _0xb029=function(_0x570ebf,_0x488b73){_0x570ebf=_0x570ebf-0x0;var _0x13de54=_0x029b[_0x570ebf];return _0x13de54;};'use strict';var Sequelize=require(_0xb029('0x0'));var moment=require(_0xb029('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb029('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb029('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb029('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb029('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb029('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb029('0x5')]('in',_0xb029('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb029('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb029('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb029('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5292=['ENUM','out','sequelize','moment','BOOLEAN','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0xf7));var _0x2529=function(_0xfc959c,_0x4660c){_0xfc959c=_0xfc959c-0x0;var _0xa12959=_0x5292[_0xfc959c];return _0xa12959;};'use strict';var Sequelize=require(_0x2529('0x0'));var moment=require(_0x2529('0x1'));module['exports']={'closed':{'type':Sequelize[_0x2529('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2529('0x3')]},'secondDisposition':{'type':Sequelize[_0x2529('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2529('0x3')]},'note':{'type':Sequelize[_0x2529('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2529('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2529('0x5')]('in',_0x2529('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 3036414..a3a8347 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 _0x5826=['direction','secret','SmsAccount','Account','Owner','get','mkdirSync','N.A.','closedAt','out','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fullname','TagIds','split','Tags','push','waiting','answered','total','UserId','closed','talking','unmanaged','SmsInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','all','catch','show','params','options','create','body','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','pick','SmsInteractionId','merge','format','YYYY-MM-DD\x20HH:mm:ss','include','setTags','spread','Tag','findAll','color','emit','removeTags','unix','server','files','tmp','join','root','CmContact','firstName','lastName','Messages','createdAt'];(function(_0x4edd90,_0x3d4ffb){var _0x336aba=function(_0x406649){while(--_0x406649){_0x4edd90['push'](_0x4edd90['shift']());}};_0x336aba(++_0x3d4ffb);}(_0x5826,0x1ea));var _0x6582=function(_0x4cde9e,_0x4130b1){_0x4cde9e=_0x4cde9e-0x0;var _0x339673=_0x5826[_0x4cde9e];return _0x339673;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6582('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6582('0x1'));var BPromise=require(_0x6582('0x2'));var Mustache=require(_0x6582('0x3'));var util=require(_0x6582('0x4'));var path=require(_0x6582('0x5'));var sox=require(_0x6582('0x6'));var csv=require(_0x6582('0x7'));var ejs=require(_0x6582('0x8'));var fs=require('fs');var fs_extra=require(_0x6582('0x9'));var _=require(_0x6582('0xa'));var squel=require(_0x6582('0xb'));var crypto=require(_0x6582('0xc'));var jsforce=require(_0x6582('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6582('0x7'));var querystring=require(_0x6582('0xe'));var Papa=require(_0x6582('0xf'));var Redis=require(_0x6582('0x10'));var authService=require(_0x6582('0x11'));var qs=require(_0x6582('0x12'));var as=require(_0x6582('0x13'));var pdf=require(_0x6582('0x14'));var hardwareService=require(_0x6582('0x15'));var logger=require(_0x6582('0x16'))(_0x6582('0x17'));var utils=require(_0x6582('0x18'));var config=require(_0x6582('0x19'));var licenseUtil=require(_0x6582('0x1a'));var db=require(_0x6582('0x1b'))['db'];config['redis']=_['defaults'](config[_0x6582('0x1c')],{'host':_0x6582('0x1d'),'port':0x18eb});var socket=require(_0x6582('0x1e'))(new Redis(config[_0x6582('0x1c')]));require('./smsInteraction.socket')[_0x6582('0x1f')](socket);function respondWithStatusCode(_0xd55a77,_0x521df3){_0x521df3=_0x521df3||0xcc;return function(_0x1f6929){if(_0x1f6929){return _0xd55a77['sendStatus'](_0x521df3);}return _0xd55a77['status'](_0x521df3)[_0x6582('0x20')]();};}function respondWithResult(_0x463128,_0x4c4514){_0x4c4514=_0x4c4514||0xc8;return function(_0x27349e){if(_0x27349e){return _0x463128[_0x6582('0x21')](_0x4c4514)[_0x6582('0x22')](_0x27349e);}};}function respondWithFilteredResult(_0x3cd803,_0x35c407){return function(_0x48c3d6){if(_0x48c3d6){var _0x4e42c4=typeof _0x35c407[_0x6582('0x23')]===_0x6582('0x24')&&typeof _0x35c407['limit']===_0x6582('0x24');var _0x294be9=_0x48c3d6[_0x6582('0x25')];var _0x485fe3=_0x4e42c4?0x0:_0x35c407[_0x6582('0x23')];var _0xe93de1=_0x4e42c4?_0x48c3d6[_0x6582('0x25')]:_0x35c407[_0x6582('0x23')]+_0x35c407['limit'];var _0x2c01dc;if(_0xe93de1>=_0x294be9){_0xe93de1=_0x294be9;_0x2c01dc=0xc8;}else{_0x2c01dc=0xce;}_0x3cd803[_0x6582('0x21')](_0x2c01dc);return _0x3cd803[_0x6582('0x26')](_0x6582('0x27'),_0x485fe3+'-'+_0xe93de1+'/'+_0x294be9)['json'](_0x48c3d6);}return null;};}function patchUpdates(_0x3eae76){return function(_0x1b2a2a){try{jsonpatch[_0x6582('0x28')](_0x1b2a2a,_0x3eae76,!![]);}catch(_0x2337fd){return BPromise[_0x6582('0x29')](_0x2337fd);}return _0x1b2a2a[_0x6582('0x2a')]();};}function saveUpdates(_0x5f0716,_0x157844){return function(_0x4e40de){if(_0x4e40de){return _0x4e40de[_0x6582('0x2b')](_0x5f0716)[_0x6582('0x2c')](function(_0x138e7a){return _0x138e7a;});}return null;};}function removeEntity(_0x2e94fe,_0x18c8fe){return function(_0x10bf92){if(_0x10bf92){return _0x10bf92[_0x6582('0x2d')]()[_0x6582('0x2c')](function(){_0x2e94fe[_0x6582('0x21')](0xcc)[_0x6582('0x20')]();});}};}function handleEntityNotFound(_0x545316,_0x511381){return function(_0x15b2b0){if(!_0x15b2b0){_0x545316[_0x6582('0x2e')](0x194);}return _0x15b2b0;};}function handleError(_0x58db2f,_0x2add50){_0x2add50=_0x2add50||0x1f4;return function(_0x4fcab1){logger[_0x6582('0x2f')](_0x4fcab1[_0x6582('0x30')]);if(_0x4fcab1[_0x6582('0x31')]){delete _0x4fcab1[_0x6582('0x31')];}_0x58db2f[_0x6582('0x21')](_0x2add50)[_0x6582('0x32')](_0x4fcab1);};}function getInteractionUsers(_0xa899b2,_0x53cf55){return new BPromise(function(_0x4dd143,_0x31e7b5){try{if(_0x53cf55[_0xa899b2['id']]){_0xa899b2['Users']=_[_0x6582('0x33')](_0x53cf55[_0xa899b2['id']],function(_0x505ddf){return{'id':_0x505ddf['id'],'fullname':_0x505ddf[_0x6582('0x34')]};});}}catch(_0x18e84e){_0x31e7b5(_0x18e84e);}_0x4dd143(_0xa899b2);});}function getInteractionTags(_0x562d46,_0x152b80){return new BPromise(function(_0x46336f,_0x45317a){try{if(_0x562d46[_0x6582('0x35')]){_0x562d46['Tags']=[];_0x562d46[_0x6582('0x35')][_0x6582('0x36')](',')['forEach'](function(_0x32773d){_0x562d46[_0x6582('0x37')][_0x6582('0x38')](_0x152b80[_0x32773d]);});}delete _0x562d46[_0x6582('0x35')];}catch(_0x4da0d5){_0x45317a(_0x4da0d5);}_0x46336f(_0x562d46);});}function updateSmsInteraction(_0x5bfd69,_0x51d291,_0x1363bf){return new BPromise(function(_0x559c73,_0x12d566){return getInteractionUsers(_0x5bfd69,_0x1363bf)['then'](function(_0x476636){return getInteractionTags(_0x476636,_0x51d291);})[_0x6582('0x2c')](function(_0x39a5d0){return getStateInteraction(_0x39a5d0);})[_0x6582('0x2c')](function(_0x44ffe1){_0x559c73(_0x44ffe1);})['catch'](function(_0x431ff2){_0x12d566(_0x431ff2);});});}function getStateInteraction(_0x306a8e){return new BPromise(function(_0x366247){_0x306a8e[_0x6582('0x39')]=0x0;_0x306a8e['talking']=0x0;_0x306a8e[_0x6582('0x3a')]=0x0;_0x306a8e['unmanaged']=0x0;_0x306a8e[_0x6582('0x3b')]=0x0;if(!_0x306a8e['closed']&&!_0x306a8e[_0x6582('0x3c')]){_0x306a8e['waiting']+=0x1;}if(!_0x306a8e[_0x6582('0x3d')]&&_0x306a8e[_0x6582('0x3c')]){_0x306a8e['talking']+=0x1;if(_0x306a8e[_0x6582('0x39')]){_0x306a8e['waiting']-=0x1;}}if(_0x306a8e[_0x6582('0x3d')]&&_0x306a8e[_0x6582('0x3c')]){_0x306a8e['answered']+=0x1;if(_0x306a8e['talking']){_0x306a8e[_0x6582('0x3e')]-=0x1;}}if(_0x306a8e[_0x6582('0x3d')]&&!_0x306a8e[_0x6582('0x3c')]){_0x306a8e[_0x6582('0x3f')]+=0x1;if(_0x306a8e['waiting']){_0x306a8e[_0x6582('0x39')]-=0x1;}}_0x306a8e[_0x6582('0x3b')]+=0x1;_0x366247(_0x306a8e);});}exports['index']=function(_0x287f8a,_0x37eecc){var _0x414ab1={},_0x3b39dc={},_0x3bd7c9={'count':0x0,'rows':[]};var _0x4707ef=_[_0x6582('0x33')](db[_0x6582('0x40')][_0x6582('0x41')],function(_0x4ac02){return{'name':_0x4ac02[_0x6582('0x42')],'type':_0x4ac02['type'][_0x6582('0x43')]};});_0x3b39dc[_0x6582('0x44')]=_['map'](_0x4707ef,_0x6582('0x31'));_0x3b39dc[_0x6582('0x45')]=_[_0x6582('0x46')](_0x287f8a['query']);_0x3b39dc[_0x6582('0x47')]=_[_0x6582('0x48')](_0x3b39dc[_0x6582('0x44')],_0x3b39dc[_0x6582('0x45')]);_0x414ab1[_0x6582('0x49')]=_[_0x6582('0x48')](_0x3b39dc[_0x6582('0x44')],qs[_0x6582('0x4a')](_0x287f8a['query'][_0x6582('0x4a')]));_0x414ab1[_0x6582('0x49')]=_0x414ab1[_0x6582('0x49')][_0x6582('0x4b')]?_0x414ab1['attributes']:_0x3b39dc['model'];if(!_0x287f8a['query'][_0x6582('0x4c')]('nolimit')){_0x414ab1[_0x6582('0x4d')]=qs['limit'](_0x287f8a[_0x6582('0x45')][_0x6582('0x4d')]);_0x414ab1[_0x6582('0x23')]=qs[_0x6582('0x23')](_0x287f8a[_0x6582('0x45')][_0x6582('0x23')]);}_0x414ab1[_0x6582('0x4e')]=qs[_0x6582('0x4f')](_0x287f8a[_0x6582('0x45')]['sort']);_0x414ab1[_0x6582('0x50')]=qs[_0x6582('0x47')](_['pick'](_0x287f8a['query'],_0x3b39dc[_0x6582('0x47')]),_0x4707ef);var _0x20d48d=[];var _0x3188f0=squel[_0x6582('0x51')]()[_0x6582('0x52')]('id')[_0x6582('0x52')](_0x6582('0x31'))[_0x6582('0x52')]('color')[_0x6582('0x53')](_0x6582('0x54'));var _0x28d0f7=squel['select']()['field'](_0x6582('0x55'))[_0x6582('0x52')](_0x6582('0x56'))[_0x6582('0x52')]('ui.SmsInteractionId')[_0x6582('0x53')](_0x6582('0x57'),'ui')[_0x6582('0x58')]('users','u',_0x6582('0x59'));var _0x3e72f0=squel['select']()[_0x6582('0x53')](_0x6582('0x5a'),'i')[_0x6582('0x58')](_0x6582('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6582('0x58')]('users','o','o.id\x20=\x20i.UserId')[_0x6582('0x58')](_0x6582('0x5c'),'a',_0x6582('0x5d'))[_0x6582('0x58')]('sms_messages','me',_0x6582('0x5e'))[_0x6582('0x58')](_0x6582('0x5f'),'it',_0x6582('0x60'))[_0x6582('0x58')](_0x6582('0x54'),'t',_0x6582('0x61'));var _0x5aafd5=squel[_0x6582('0x62')]();var _0x38be62=[];var _0x3167cf=squel[_0x6582('0x62')]();var _0x3b44ae;if(_0x287f8a[_0x6582('0x45')][_0x6582('0x63')]){_0x3b44ae=as[_0x6582('0x64')](_0x287f8a['query'][_0x6582('0x63')]);var _0x466695=_0x3b44ae[_0x6582('0x65')];for(var _0x6d0e3c=0x0;_0x6d0e3c<_0x3b44ae[_0x6582('0x66')]['length'];_0x6d0e3c++){var _0xae9df9=_0x3b44ae[_0x6582('0x66')][_0x6d0e3c];var _0x302ceb='i';var _0x1e8d17=_[_0x6582('0x67')](_0x4707ef,[_0x6582('0x31'),_0xae9df9[_0x6582('0x52')]]);if(!_0x1e8d17){switch(_0xae9df9[_0x6582('0x52')]){case'unreadMessages':if(_0xae9df9[_0x6582('0x68')]==0x1){_0x3e72f0[_0x6582('0x69')]('`'+_0xae9df9[_0x6582('0x52')]+_0x6582('0x6a'));}else{_0x3e72f0[_0x6582('0x69')]('`'+_0xae9df9[_0x6582('0x52')]+_0x6582('0x6b'));}break;case _0x6582('0x6c'):if(_0xae9df9[_0x6582('0x6d')]===_0x6582('0x6e')){if(_0xae9df9[_0x6582('0x68')][_0x6582('0x36')]('\x20')[_0x6582('0x4b')]>0x1){_0x5aafd5[_0x466695]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6582('0x6f')](_0xae9df9['value']),null);}else{var _0x7c13e0='%'+_0xae9df9['value']+'%';_0x5aafd5[_0x466695](_0x6582('0x70'),_0x7c13e0,_0x7c13e0,_0x7c13e0);}}else{_0x1e8d17=_[_0x6582('0x67')](_0x4707ef,[_0x6582('0x31'),_0x6582('0x71')]);_0xae9df9[_0x6582('0x52')]=_0x6582('0x71');_0x47f6e1=as[_0x6582('0x72')](_0x302ceb,_0x1e8d17[_0x6582('0x73')],_0xae9df9);_0x5aafd5[_0x466695](_0x47f6e1['text'],_0x47f6e1[_0x6582('0x68')][_0x6582('0x74')],_0x47f6e1[_0x6582('0x68')][_0x6582('0x20')]);}break;case'Tag':var _0x556989=_0xae9df9['value'][_0x6582('0x36')](',')[_0x6582('0x33')](function(_0x28c718){return Number(_0x28c718);});_0x556989[_0x6582('0x75')](function(_0x3712a9){_0x3167cf['or'](_0x6582('0x76'),'%,'+_0x3712a9+',%');});_0x38be62=_[_0x6582('0x77')](_0x38be62,_0x556989);break;case _0x6582('0x78'):if(_0xae9df9[_0x6582('0x6d')]===_0x6582('0x6e')){_0x5aafd5[_0x466695](_0x6582('0x79'),'%'+_0xae9df9[_0x6582('0x68')]+'%',null);}else{_0x1e8d17=_[_0x6582('0x67')](_0x4707ef,[_0x6582('0x31'),_0x6582('0x3c')]);_0xae9df9[_0x6582('0x52')]=_0x6582('0x3c');_0x47f6e1=as[_0x6582('0x72')](_0x302ceb,_0x1e8d17[_0x6582('0x73')],_0xae9df9);_0x5aafd5[_0x466695](_0x47f6e1['text'],_0x47f6e1[_0x6582('0x68')][_0x6582('0x74')],_0x47f6e1[_0x6582('0x68')][_0x6582('0x20')]);}break;case'body':_0x47f6e1=as[_0x6582('0x72')]('me',null,_0xae9df9);_0x5aafd5[_0x466695](_0x47f6e1[_0x6582('0x7a')],_0x47f6e1['value']['start'],_0x47f6e1[_0x6582('0x68')][_0x6582('0x20')]);break;}}else{var _0x47f6e1=as[_0x6582('0x72')](_0x302ceb,_0x1e8d17['type'],_0xae9df9);_0x5aafd5[_0x466695](_0x47f6e1[_0x6582('0x7a')],_0x47f6e1[_0x6582('0x68')]['start'],_0x47f6e1[_0x6582('0x68')][_0x6582('0x20')]);}}}else{var _0xec010a=_(_0x287f8a['query'])[_0x6582('0x46')]()[_0x6582('0x33')](function(_0x15364e){return _[_0x6582('0x7b')](_0x4707ef,[_0x6582('0x31'),_0x15364e])?_0x15364e:undefined;})[_0x6582('0x7c')]()[_0x6582('0x68')]();if(!_[_0x6582('0x7d')](_0xec010a)){_0xec010a[_0x6582('0x75')](function(_0x553234){if(_0x553234===_0x6582('0x7e')){_0x3e72f0[_0x6582('0x50')](_0x6582('0x7f'),[][_0x6582('0x80')](_0x287f8a[_0x6582('0x45')][_0x553234]));}else if(_0x553234==='createdAt'){var _0x2414d4=JSON[_0x6582('0x81')](_0x287f8a[_0x6582('0x45')][_0x553234])[_0x6582('0x82')];var _0x313cb4=JSON[_0x6582('0x81')](_0x287f8a[_0x6582('0x45')][_0x553234])['$lte'];_0x3e72f0['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2414d4,_0x313cb4);}else{if(_0x287f8a[_0x6582('0x45')][_0x553234]==='null'){_0x3e72f0[_0x6582('0x50')]('i.'+_0x553234+'\x20IS\x20NULL');}else{_0x3e72f0['where']('i.'+_0x553234+_0x6582('0x83'),_0x287f8a[_0x6582('0x45')][_0x553234]);}}});}if(_0x287f8a[_0x6582('0x45')][_0x6582('0x84')]){if(_0x287f8a[_0x6582('0x45')][_0x6582('0x84')]==0x1){_0x3e72f0[_0x6582('0x69')](_0x6582('0x85'));}else{_0x3e72f0[_0x6582('0x69')](_0x6582('0x86'));}}if(_0x287f8a['query']['tag']){_0x38be62=_[_0x6582('0x87')](_0x287f8a[_0x6582('0x45')]['tag'])?_0x287f8a['query']['tag']:new Array(_0x287f8a['query'][_0x6582('0x88')]);_0x38be62[_0x6582('0x75')](function(_0x5d33ba){_0x3167cf['or'](_0x6582('0x76'),'%,'+_0x5d33ba+',%');});}if(_0x287f8a[_0x6582('0x45')][_0x6582('0x89')]){var _0x5e2f82=_0x287f8a['query'][_0x6582('0x89')][_0x6582('0x8a')]('\x5c','\x5c\x5c')[_0x6582('0x8a')](/'/g,'\x27\x27');if(qs[_0x6582('0x8b')](_0x5e2f82)){_0x5aafd5['or'](_0x6582('0x8c'),_0x5e2f82+'%')['or'](_0x6582('0x8d'),_0x5e2f82+'%');}else{_0x5aafd5['or'](_0x6582('0x8e'),qs[_0x6582('0x6f')](_0x5e2f82))['or'](_0x6582('0x8f'),_0x5e2f82+'%');}}}_0x3e72f0[_0x6582('0x50')](_0x5aafd5);_0x3e72f0[_0x6582('0x90')](_0x6582('0x91'));var _0x4a1c52={'type':db[_0x6582('0x92')][_0x6582('0x93')]['SELECT'],'raw':!![]};var _0x42fb6a=_0x3e72f0[_0x6582('0x94')]();_0x42fb6a['field'](_0x6582('0x91'));_0x42fb6a['field'](_0x6582('0x95'),_0x6582('0x96'));if(_0x414ab1[_0x6582('0x4e')]){_0x414ab1[_0x6582('0x4e')][_0x6582('0x75')](function(_0x16ce22){var _0x1127af=_0x16ce22[0x0]===_0x6582('0x97')?_0x16ce22[0x0]:'i.'+_0x16ce22[0x0];_0x3e72f0[_0x6582('0x4e')](_0x1127af,_0x16ce22[0x1]===_0x6582('0x98')?![]:!![]);});}if(!_[_0x6582('0x7d')](_0x38be62)){_0x3e72f0[_0x6582('0x69')](_0x3167cf);_0x42fb6a['where'](_0x6582('0x99'),_0x38be62);}BPromise['resolve']()['then'](function(){if(!_0x3b44ae){if(_0x287f8a[_0x6582('0x45')]['SmsAccountId'])return;_0x42fb6a[_0x6582('0x50')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x3e72f0[_0x6582('0x50')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x287f8a['user'][_0x6582('0x9a')]!==_0x6582('0x9b'))return;return _0x287f8a[_0x6582('0x9c')][_0x6582('0x9d')]({'attributes':['id'],'raw':!![]})[_0x6582('0x2c')](function(_0x1499a9){if(_[_0x6582('0x7d')](_0x1499a9)){_0x42fb6a[_0x6582('0x50')](_0x6582('0x9e'));_0x3e72f0[_0x6582('0x50')](_0x6582('0x9e'));}else{_0x42fb6a[_0x6582('0x50')](_0x6582('0x7f'),_[_0x6582('0x33')](_0x1499a9,'id'));_0x3e72f0[_0x6582('0x50')](_0x6582('0x7f'),_[_0x6582('0x33')](_0x1499a9,'id'));}});})['then'](function(){if(_0x287f8a[_0x6582('0x9c')][_0x6582('0x9a')]===_0x6582('0x9b')&&!_0x3b44ae&&!_0x287f8a[_0x6582('0x45')]['SmsAccountId'])return[];return db[_0x6582('0x9f')][_0x6582('0x45')](_0x42fb6a[_0x6582('0xa0')](),_0x4a1c52);})[_0x6582('0x2c')](function(_0x419ab7){_0x3bd7c9[_0x6582('0x25')]=_0x419ab7[_0x6582('0x4b')];if(_0x3bd7c9['count']===0x0)return[];return db[_0x6582('0x9f')]['query'](_0x3188f0[_0x6582('0xa0')](),_0x4a1c52)[_0x6582('0x2c')](function(_0x1e7638){_0x20d48d=_['keyBy'](_0x1e7638,'id');_0x4a1c52=_['merge'](_0x4a1c52,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x287f8a[_0x6582('0x45')][_0x6582('0x4a')]){_0x414ab1[_0x6582('0x49')][_0x6582('0x75')](function(_0x2f4fba){_0x3e72f0['field']('i.'+_0x2f4fba);});}else{_0x3e72f0[_0x6582('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6582('0x96'));_0x3e72f0[_0x6582('0x52')](_0x6582('0xa1'),'Account.key');_0x3e72f0['field'](_0x6582('0xa2'),_0x6582('0xa3'));_0x3e72f0[_0x6582('0x52')](_0x6582('0xa4'),_0x6582('0x97'));_0x3e72f0[_0x6582('0x52')](_0x6582('0xa5'));_0x3e72f0[_0x6582('0x52')]('c.firstName',_0x6582('0xa6'));_0x3e72f0[_0x6582('0x52')](_0x6582('0xa7'),_0x6582('0xa8'));_0x3e72f0['field'](_0x6582('0xa9'),_0x6582('0xaa'));_0x3e72f0[_0x6582('0x52')](_0x6582('0xab'),_0x6582('0xac'));_0x3e72f0[_0x6582('0x52')](_0x6582('0xad'),'Contact.mobile');_0x3e72f0[_0x6582('0x52')](_0x6582('0xae'),'Contact.fax');_0x3e72f0[_0x6582('0x52')](_0x6582('0xaf'),_0x6582('0xb0'));_0x3e72f0[_0x6582('0x52')]('o.internal',_0x6582('0xb1'));_0x3e72f0[_0x6582('0x52')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6582('0x35'));}if(_0x414ab1['limit'])_0x3e72f0[_0x6582('0x4d')](_0x414ab1[_0x6582('0x4d')]);if(_0x414ab1[_0x6582('0x23')])_0x3e72f0[_0x6582('0x23')](_0x414ab1[_0x6582('0x23')]);return db[_0x6582('0x9f')]['query'](_0x3e72f0['toString'](),_0x4a1c52);})[_0x6582('0x2c')](function(_0x39d87d){if(_0x39d87d[_0x6582('0x4b')]>0x0)_0x28d0f7[_0x6582('0x50')](_0x6582('0xb2'),_[_0x6582('0x33')](_0x39d87d,'id'));return db[_0x6582('0x9f')][_0x6582('0x45')](_0x28d0f7[_0x6582('0xa0')](),_0x4a1c52)[_0x6582('0x2c')](function(_0x3e0ab6){var _0x402c9a=_[_0x6582('0xb3')](_0x3e0ab6,'SmsInteractionId');var _0x179951=[];_0x39d87d['forEach'](function(_0x57fabe){_0x179951[_0x6582('0x38')](updateSmsInteraction(_0x57fabe,_0x20d48d,_0x402c9a));});return BPromise[_0x6582('0xb4')](_0x179951);});});})['then'](function(_0x2d4d75){_0x3bd7c9['rows']=_0x2d4d75;return _0x3bd7c9;})[_0x6582('0x2c')](respondWithFilteredResult(_0x37eecc,_0x414ab1))[_0x6582('0xb5')](handleError(_0x37eecc,null));};exports[_0x6582('0xb6')]=function(_0x183c0b,_0x582800){var _0x2c4b69={'raw':![],'where':{'id':_0x183c0b[_0x6582('0xb7')]['id']}},_0x38cf84={};_0x38cf84[_0x6582('0x44')]=_[_0x6582('0x46')](db[_0x6582('0x40')][_0x6582('0x41')]);_0x38cf84[_0x6582('0x45')]=_[_0x6582('0x46')](_0x183c0b['query']);_0x38cf84[_0x6582('0x47')]=_[_0x6582('0x48')](_0x38cf84[_0x6582('0x44')],_0x38cf84[_0x6582('0x45')]);_0x2c4b69[_0x6582('0x49')]=_['intersection'](_0x38cf84[_0x6582('0x44')],qs[_0x6582('0x4a')](_0x183c0b[_0x6582('0x45')]['fields']));_0x2c4b69[_0x6582('0x49')]=_0x2c4b69[_0x6582('0x49')][_0x6582('0x4b')]?_0x2c4b69[_0x6582('0x49')]:_0x38cf84['model'];if(_0x183c0b[_0x6582('0x45')]['includeAll']){_0x2c4b69['include']=[{'all':!![]}];}_0x2c4b69=_['merge']({},_0x2c4b69,_0x183c0b[_0x6582('0xb8')]);return db[_0x6582('0x40')][_0x6582('0x67')](_0x2c4b69)[_0x6582('0x2c')](handleEntityNotFound(_0x582800,null))[_0x6582('0x2c')](respondWithResult(_0x582800,null))[_0x6582('0xb5')](handleError(_0x582800,null));};exports[_0x6582('0xb9')]=function(_0x549a2c,_0x4357b1){return db[_0x6582('0x40')][_0x6582('0xb9')](_0x549a2c['body'],{})[_0x6582('0x2c')](respondWithResult(_0x4357b1,0xc9))[_0x6582('0xb5')](handleError(_0x4357b1,null));};exports[_0x6582('0x2b')]=function(_0x33a014,_0x36c994){if(_0x33a014[_0x6582('0xba')]['id']){delete _0x33a014[_0x6582('0xba')]['id'];}return db['SmsInteraction'][_0x6582('0x67')]({'where':{'id':_0x33a014['params']['id']}})['then'](handleEntityNotFound(_0x36c994,null))[_0x6582('0x2c')](saveUpdates(_0x33a014[_0x6582('0xba')],null))[_0x6582('0x2c')](respondWithResult(_0x36c994,null))['catch'](handleError(_0x36c994,null));};exports[_0x6582('0x2d')]=function(_0xadb4bc,_0x2c7baf){return db[_0x6582('0x40')][_0x6582('0x67')]({'where':{'id':_0xadb4bc[_0x6582('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2c7baf,null))['then'](removeEntity(_0x2c7baf,null))[_0x6582('0xb5')](handleError(_0x2c7baf,null));};exports[_0x6582('0xbb')]=function(_0x5aebd2,_0x53d636){return db[_0x6582('0x40')][_0x6582('0xbb')]()[_0x6582('0x2c')](respondWithResult(_0x53d636,null))[_0x6582('0xb5')](handleError(_0x53d636,null));};exports['addMessage']=function(_0xa97da,_0xe5a78e,_0x4fd24a){return db[_0x6582('0xbc')][_0x6582('0x67')]({'where':{'id':_0xa97da[_0x6582('0xb7')]['id']}})[_0x6582('0x2c')](handleEntityNotFound(_0xe5a78e,null))['then'](function(_0x5292f3){if(_0x5292f3){return _0x5292f3[_0x6582('0xbd')](_0xa97da['body'][_0x6582('0xbe')],_[_0x6582('0xbf')](_0xa97da[_0x6582('0xba')],[_0x6582('0xbe'),'id'])||{});}})[_0x6582('0x2c')](respondWithResult(_0xe5a78e,null))[_0x6582('0xb5')](handleError(_0xe5a78e,null));};exports[_0x6582('0xc0')]=function(_0x1528ec,_0x21b2a1,_0x5c0f26){var _0x2d1a53={'raw':![],'where':{}};var _0x4cfd23={};var _0x5e444b={'count':0x0,'rows':[]};return db[_0x6582('0x40')][_0x6582('0xc1')]({'where':{'id':_0x1528ec[_0x6582('0xb7')]['id']}})[_0x6582('0x2c')](handleEntityNotFound(_0x21b2a1,null))['then'](function(_0x36ae3c){if(_0x36ae3c){_0x4cfd23[_0x6582('0x44')]=_[_0x6582('0x46')](db['SmsMessage'][_0x6582('0x41')]);_0x4cfd23['query']=_['keys'](_0x1528ec[_0x6582('0x45')]);_0x4cfd23[_0x6582('0x47')]=_[_0x6582('0x48')](_0x4cfd23[_0x6582('0x44')],_0x4cfd23[_0x6582('0x45')]);_0x2d1a53['attributes']=_[_0x6582('0x48')](_0x4cfd23[_0x6582('0x44')],qs['fields'](_0x1528ec['query'][_0x6582('0x4a')]));_0x2d1a53[_0x6582('0x49')]=_0x2d1a53[_0x6582('0x49')][_0x6582('0x4b')]?_0x2d1a53['attributes']:_0x4cfd23['model'];if(!_0x1528ec['query']['hasOwnProperty']('nolimit')){_0x2d1a53[_0x6582('0x4d')]=qs[_0x6582('0x4d')](_0x1528ec[_0x6582('0x45')][_0x6582('0x4d')]);_0x2d1a53['offset']=qs[_0x6582('0x23')](_0x1528ec[_0x6582('0x45')][_0x6582('0x23')]);}_0x2d1a53[_0x6582('0x4e')]=qs[_0x6582('0x4f')](_0x1528ec[_0x6582('0x45')]['sort']);_0x2d1a53[_0x6582('0x50')]=qs[_0x6582('0x47')](_[_0x6582('0xc2')](_0x1528ec['query'],_0x4cfd23[_0x6582('0x47')]));_0x2d1a53[_0x6582('0x50')][_0x6582('0xc3')]=_0x36ae3c['id'];if(_0x1528ec['query'][_0x6582('0x89')]){_0x2d1a53[_0x6582('0x50')]=_[_0x6582('0xc4')](_0x2d1a53['where'],{'$or':_[_0x6582('0x33')](_0x2d1a53[_0x6582('0x49')],function(_0x13d260){var _0x4ded2f={};_0x4ded2f[_0x13d260]={'$like':'%'+_0x1528ec[_0x6582('0x45')]['filter']+'%'};return _0x4ded2f;})});}if(_0x1528ec[_0x6582('0x45')]['$gte']){var _0x4a1c39=_0x1528ec['query'][_0x6582('0x82')][_0x6582('0x36')](',');var _0x382343={};_0x382343[_0x4a1c39[0x0]]={'$gte':moment(_0x4a1c39[0x1])[_0x6582('0xc5')](_0x6582('0xc6'))};_0x2d1a53[_0x6582('0x50')]=_[_0x6582('0xc4')](_0x2d1a53[_0x6582('0x50')],_0x382343);}_0x2d1a53=_[_0x6582('0xc4')]({},_0x2d1a53,_0x1528ec[_0x6582('0xb8')]);return db[_0x6582('0xbc')][_0x6582('0x25')]({'where':_0x2d1a53[_0x6582('0x50')]})['then'](function(_0x13395c){_0x5e444b[_0x6582('0x25')]=_0x13395c;if(_0x1528ec[_0x6582('0x45')]['includeAll']){_0x2d1a53[_0x6582('0xc7')]=[{'all':!![]}];}return db[_0x6582('0xbc')]['findAll'](_0x2d1a53);})[_0x6582('0x2c')](function(_0x26faea){_0x5e444b['rows']=_0x26faea;return _0x5e444b;});}})[_0x6582('0x2c')](respondWithFilteredResult(_0x21b2a1,_0x2d1a53))[_0x6582('0xb5')](handleError(_0x21b2a1,null));};exports['addTags']=function(_0x25c521,_0x40aeb7,_0x5b2d8d){return db['SmsInteraction'][_0x6582('0x67')]({'where':{'id':_0x25c521['params']['id']}})[_0x6582('0x2c')](handleEntityNotFound(_0x40aeb7,null))[_0x6582('0x2c')](function(_0x5bbccb){if(_0x5bbccb){return _0x5bbccb[_0x6582('0xc8')](_0x25c521[_0x6582('0xba')][_0x6582('0xbe')],_[_0x6582('0xbf')](_0x25c521['body'],[_0x6582('0xbe'),'id'])||{})[_0x6582('0xc9')](function(){return db[_0x6582('0xca')][_0x6582('0xcb')]({'attributes':['id',_0x6582('0x31'),_0x6582('0xcc')],'where':{'id':_0x25c521[_0x6582('0xba')][_0x6582('0xbe')]}});})[_0x6582('0x2c')](function(_0x5e6582){socket[_0x6582('0xcd')]('smsInteractionTags:save',{'id':Number(_0x25c521['params']['id']),'tags':_0x5e6582||[]});return{'id':Number(_0x25c521[_0x6582('0xb7')]['id']),'tags':_0x5e6582||[]};});}})[_0x6582('0x2c')](respondWithResult(_0x40aeb7,null))[_0x6582('0xb5')](handleError(_0x40aeb7,null));};exports[_0x6582('0xce')]=function(_0x330990,_0x46e736,_0x35c863){return db['SmsInteraction']['find']({'where':{'id':_0x330990[_0x6582('0xb7')]['id']}})[_0x6582('0x2c')](handleEntityNotFound(_0x46e736,null))['then'](function(_0x36782e){if(_0x36782e){return _0x36782e[_0x6582('0xce')](_0x330990[_0x6582('0x45')][_0x6582('0xbe')]);}})[_0x6582('0x2c')](respondWithStatusCode(_0x46e736,null))['catch'](handleError(_0x46e736,null));};exports['download']=function(_0x298737,_0x5dd303){var _0x196bb9=moment()[_0x6582('0xcf')]()[_0x6582('0xa0')]();var _0x15e620=path['join'](config['root'],_0x6582('0xd0'),_0x6582('0xd1'),_0x6582('0xd2'));var _0x5ec2d8=path[_0x6582('0xd3')](config[_0x6582('0xd4')],'server','files','attachments');var _0x35f63a=path[_0x6582('0xd3')](_0x15e620,_0x196bb9);var _0x4925f3=util[_0x6582('0xc5')]('transcript-%d-%s.zip',_0x298737[_0x6582('0xb7')]['id'],_0x196bb9);var _0x1b37a5=path[_0x6582('0xd3')](_0x15e620,_0x4925f3);var _0xf787c4=[];_0xf787c4[_0x6582('0x38')]({'model':db[_0x6582('0x78')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0xf787c4[_0x6582('0x38')]({'model':db[_0x6582('0xd5')],'as':_0x6582('0x6c'),'attributes':['id',_0x6582('0xd6'),_0x6582('0xd7')],'raw':!![]});var _0x2be319=[{'model':db['SmsMessage'],'as':_0x6582('0xd8'),'attributes':['id',_0x6582('0xba'),_0x6582('0xd9'),_0x6582('0xda'),_0x6582('0xdb'),'read'],'include':_0xf787c4}];_0x2be319[_0x6582('0x38')]({'model':db[_0x6582('0xdc')],'as':_0x6582('0xdd'),'attributes':['id',_0x6582('0x31')]});_0x2be319['push']({'model':db[_0x6582('0x78')],'as':_0x6582('0xde'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x6582('0x67')]({'where':{'id':_0x298737[_0x6582('0xb7')]['id']},'include':_0x2be319})[_0x6582('0x2c')](handleEntityNotFound(_0x5dd303,null))[_0x6582('0x2c')](function(_0x1d8f9b){if(_0x1d8f9b){var _0x3a6d36=_0x1d8f9b[_0x6582('0xdf')]({'plain':!![]});fs[_0x6582('0xe0')](_0x35f63a);var _0x193b31={'channel':'Sms','account':_0x3a6d36[_0x6582('0xdd')]['name'],'agent':_0x3a6d36[_0x6582('0xde')]?_0x3a6d36['Owner']['fullname']:_0x6582('0xe1'),'createdAt':moment(_0x3a6d36[_0x6582('0xd9')])[_0x6582('0xc5')](_0x6582('0xc6'))[_0x6582('0xa0')](),'closedAt':_0x3a6d36[_0x6582('0x3d')]?moment(_0x3a6d36[_0x6582('0xe2')])['format'](_0x6582('0xc6'))['toString']():'','disposition':_0x3a6d36['disposition'],'messages':_(_0x3a6d36[_0x6582('0xd8')])[_0x6582('0x89')]({'secret':![]})['map'](function(_0x46a1f1){return{'date':moment(_0x46a1f1['createdAt'])[_0x6582('0xc5')](_0x6582('0xc6'))['toString'](),'sender':_0x46a1f1[_0x6582('0xda')]===_0x6582('0xe3')?_0x46a1f1['User']?_0x46a1f1[_0x6582('0x78')][_0x6582('0x34')]:'System':_0x46a1f1['Contact'][_0x6582('0xd6')]+(_0x46a1f1[_0x6582('0x6c')]['lastName']?'\x20'+_0x46a1f1[_0x6582('0x6c')]['lastName']:''),'body':_0x46a1f1[_0x6582('0xba')],'direction':_0x46a1f1[_0x6582('0xda')]===_0x6582('0xe3')?'A':'C','secret':_0x46a1f1[_0x6582('0xdb')],'read':_0x46a1f1[_0x6582('0x84')]};})[_0x6582('0x68')]()};return ejs['renderFile'](path[_0x6582('0xd3')](config['root'],_0x6582('0xd0'),_0x6582('0xe4'),_0x6582('0xe5')),{'interaction':_0x193b31})['then'](function(_0x176891){var _0x18ab03=path[_0x6582('0xd3')](_0x35f63a,_0x6582('0xe6')+_0x3a6d36['id']+'-'+_0x196bb9+_0x6582('0xe7'));var _0x481334={'path':_0x18ab03,'channel':'Sms','interactionId':_0x3a6d36['id']};return pdf[_0x6582('0xe8')](_0x176891,_0x481334);})[_0x6582('0x2c')](function(){return new BPromise(function(_0x368567,_0x9b08bb){zipdir(_0x35f63a,{'saveTo':_0x1b37a5},function(_0x3ee750,_0x32293c){if(_0x3ee750)return _0x9b08bb(_0x3ee750);return _0x368567(_0x32293c);});})[_0x6582('0x2c')](function(){return new BPromise(function(_0x42ee00,_0x2b7584){rimraf(_0x35f63a,function(_0x5ab45f){if(_0x5ab45f)_0x2b7584(_0x5ab45f);return _0x42ee00();});});})[_0x6582('0x2c')](function(){return _0x5dd303['download'](_0x1b37a5,_0x4925f3,function(_0x1f130d){if(_0x1f130d){console[_0x6582('0xe9')](_0x6582('0xea'),_0x1f130d);}else{fs[_0x6582('0xeb')](_0x1b37a5);}});});});}else{return _0x5dd303[_0x6582('0x2e')](0xc8);}})[_0x6582('0xb5')](handleError(_0x5dd303,null));}; \ No newline at end of file +var _0x77cb=['start','keys','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','user','agent','i.SmsAccountId\x20IS\x20NULL','SmsAccountId','toString','sequelize','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','catch','show','params','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','hasOwnProperty','nolimit','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','removeTags','join','root','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','secret','Account','Owner','get','N.A.','closedAt','disposition','direction','out','System','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','destroy','then','error','stack','send','map','fullname','TagIds','Tags','forEach','push','waiting','talking','answered','total','UserId','closed','unmanaged','SmsInteraction','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','order','sort','filters','pick','select','field','color','tools_tags','u.id','from','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','text','body'];(function(_0x2f8026,_0x3bf338){var _0x59f7de=function(_0x3b264e){while(--_0x3b264e){_0x2f8026['push'](_0x2f8026['shift']());}};_0x59f7de(++_0x3bf338);}(_0x77cb,0x15d));var _0xb77c=function(_0x3d96a2,_0x5b22e6){_0x3d96a2=_0x3d96a2-0x0;var _0x5ab588=_0x77cb[_0x3d96a2];return _0x5ab588;};'use strict';var emlformat=require(_0xb77c('0x0'));var rimraf=require(_0xb77c('0x1'));var zipdir=require(_0xb77c('0x2'));var jsonpatch=require(_0xb77c('0x3'));var rp=require(_0xb77c('0x4'));var moment=require(_0xb77c('0x5'));var BPromise=require(_0xb77c('0x6'));var Mustache=require(_0xb77c('0x7'));var util=require(_0xb77c('0x8'));var path=require(_0xb77c('0x9'));var sox=require(_0xb77c('0xa'));var csv=require(_0xb77c('0xb'));var ejs=require(_0xb77c('0xc'));var fs=require('fs');var fs_extra=require(_0xb77c('0xd'));var _=require(_0xb77c('0xe'));var squel=require(_0xb77c('0xf'));var crypto=require(_0xb77c('0x10'));var jsforce=require(_0xb77c('0x11'));var deskjs=require(_0xb77c('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb77c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb77c('0x14'));var as=require(_0xb77c('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb77c('0x16'));var logger=require(_0xb77c('0x17'))(_0xb77c('0x18'));var utils=require(_0xb77c('0x19'));var config=require(_0xb77c('0x1a'));var licenseUtil=require(_0xb77c('0x1b'));var db=require(_0xb77c('0x1c'))['db'];config['redis']=_[_0xb77c('0x1d')](config[_0xb77c('0x1e')],{'host':_0xb77c('0x1f'),'port':0x18eb});var socket=require(_0xb77c('0x20'))(new Redis(config[_0xb77c('0x1e')]));require('./smsInteraction.socket')[_0xb77c('0x21')](socket);function respondWithStatusCode(_0x58b326,_0x3b5491){_0x3b5491=_0x3b5491||0xcc;return function(_0x30b744){if(_0x30b744){return _0x58b326[_0xb77c('0x22')](_0x3b5491);}return _0x58b326[_0xb77c('0x23')](_0x3b5491)[_0xb77c('0x24')]();};}function respondWithResult(_0x503199,_0x36190f){_0x36190f=_0x36190f||0xc8;return function(_0x4eb21d){if(_0x4eb21d){return _0x503199['status'](_0x36190f)[_0xb77c('0x25')](_0x4eb21d);}};}function respondWithFilteredResult(_0x2eb793,_0xd96596){return function(_0x59eb34){if(_0x59eb34){var _0x3367c4=typeof _0xd96596[_0xb77c('0x26')]==='undefined'&&typeof _0xd96596[_0xb77c('0x27')]===_0xb77c('0x28');var _0x2648ec=_0x59eb34[_0xb77c('0x29')];var _0x490e39=_0x3367c4?0x0:_0xd96596[_0xb77c('0x26')];var _0x49b10c=_0x3367c4?_0x59eb34[_0xb77c('0x29')]:_0xd96596[_0xb77c('0x26')]+_0xd96596['limit'];var _0x38ebd7;if(_0x49b10c>=_0x2648ec){_0x49b10c=_0x2648ec;_0x38ebd7=0xc8;}else{_0x38ebd7=0xce;}_0x2eb793[_0xb77c('0x23')](_0x38ebd7);return _0x2eb793['set']('Content-Range',_0x490e39+'-'+_0x49b10c+'/'+_0x2648ec)[_0xb77c('0x25')](_0x59eb34);}return null;};}function patchUpdates(_0x3c023d){return function(_0x5a3872){try{jsonpatch[_0xb77c('0x2a')](_0x5a3872,_0x3c023d,!![]);}catch(_0x292f8f){return BPromise[_0xb77c('0x2b')](_0x292f8f);}return _0x5a3872[_0xb77c('0x2c')]();};}function saveUpdates(_0xad5cad,_0x6c6d30){return function(_0x1d6da9){if(_0x1d6da9){return _0x1d6da9[_0xb77c('0x2d')](_0xad5cad)['then'](function(_0x18d56c){return _0x18d56c;});}return null;};}function removeEntity(_0x14b08e,_0x137561){return function(_0x4c7a42){if(_0x4c7a42){return _0x4c7a42[_0xb77c('0x2e')]()[_0xb77c('0x2f')](function(){_0x14b08e[_0xb77c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x581939,_0x4ac9dc){return function(_0x5bcf45){if(!_0x5bcf45){_0x581939[_0xb77c('0x22')](0x194);}return _0x5bcf45;};}function handleError(_0x5a2d71,_0x1cf45c){_0x1cf45c=_0x1cf45c||0x1f4;return function(_0x1f7a19){logger[_0xb77c('0x30')](_0x1f7a19[_0xb77c('0x31')]);if(_0x1f7a19['name']){delete _0x1f7a19['name'];}_0x5a2d71[_0xb77c('0x23')](_0x1cf45c)[_0xb77c('0x32')](_0x1f7a19);};}function getInteractionUsers(_0x281350,_0x1acc67){return new BPromise(function(_0x3515ba,_0x53784b){try{if(_0x1acc67[_0x281350['id']]){_0x281350['Users']=_[_0xb77c('0x33')](_0x1acc67[_0x281350['id']],function(_0x3ca4ee){return{'id':_0x3ca4ee['id'],'fullname':_0x3ca4ee[_0xb77c('0x34')]};});}}catch(_0x2810c6){_0x53784b(_0x2810c6);}_0x3515ba(_0x281350);});}function getInteractionTags(_0x147526,_0x1f1a84){return new BPromise(function(_0x40384b,_0x592eaa){try{if(_0x147526[_0xb77c('0x35')]){_0x147526[_0xb77c('0x36')]=[];_0x147526['TagIds']['split'](',')[_0xb77c('0x37')](function(_0x26e232){_0x147526[_0xb77c('0x36')][_0xb77c('0x38')](_0x1f1a84[_0x26e232]);});}delete _0x147526[_0xb77c('0x35')];}catch(_0xbd57df){_0x592eaa(_0xbd57df);}_0x40384b(_0x147526);});}function updateSmsInteraction(_0xe43e6d,_0x5c602e,_0x4af97b){return new BPromise(function(_0x43df98,_0x36a49c){return getInteractionUsers(_0xe43e6d,_0x4af97b)[_0xb77c('0x2f')](function(_0x33e9fc){return getInteractionTags(_0x33e9fc,_0x5c602e);})[_0xb77c('0x2f')](function(_0x5a01b8){return getStateInteraction(_0x5a01b8);})[_0xb77c('0x2f')](function(_0x2aa188){_0x43df98(_0x2aa188);})['catch'](function(_0xb6d341){_0x36a49c(_0xb6d341);});});}function getStateInteraction(_0x5a1f0f){return new BPromise(function(_0x10100b){_0x5a1f0f[_0xb77c('0x39')]=0x0;_0x5a1f0f[_0xb77c('0x3a')]=0x0;_0x5a1f0f[_0xb77c('0x3b')]=0x0;_0x5a1f0f['unmanaged']=0x0;_0x5a1f0f[_0xb77c('0x3c')]=0x0;if(!_0x5a1f0f['closed']&&!_0x5a1f0f[_0xb77c('0x3d')]){_0x5a1f0f[_0xb77c('0x39')]+=0x1;}if(!_0x5a1f0f[_0xb77c('0x3e')]&&_0x5a1f0f[_0xb77c('0x3d')]){_0x5a1f0f[_0xb77c('0x3a')]+=0x1;if(_0x5a1f0f[_0xb77c('0x39')]){_0x5a1f0f[_0xb77c('0x39')]-=0x1;}}if(_0x5a1f0f[_0xb77c('0x3e')]&&_0x5a1f0f[_0xb77c('0x3d')]){_0x5a1f0f[_0xb77c('0x3b')]+=0x1;if(_0x5a1f0f[_0xb77c('0x3a')]){_0x5a1f0f[_0xb77c('0x3a')]-=0x1;}}if(_0x5a1f0f[_0xb77c('0x3e')]&&!_0x5a1f0f[_0xb77c('0x3d')]){_0x5a1f0f[_0xb77c('0x3f')]+=0x1;if(_0x5a1f0f['waiting']){_0x5a1f0f[_0xb77c('0x39')]-=0x1;}}_0x5a1f0f[_0xb77c('0x3c')]+=0x1;_0x10100b(_0x5a1f0f);});}exports['index']=function(_0x415794,_0x4b553e){var _0x2ecd23={},_0x4f1a3b={},_0x39a4fa={'count':0x0,'rows':[]};var _0x41e8bc=_[_0xb77c('0x33')](db[_0xb77c('0x40')][_0xb77c('0x41')],function(_0x48a513){return{'name':_0x48a513[_0xb77c('0x42')],'type':_0x48a513[_0xb77c('0x43')][_0xb77c('0x44')]};});_0x4f1a3b[_0xb77c('0x45')]=_[_0xb77c('0x33')](_0x41e8bc,_0xb77c('0x46'));_0x4f1a3b[_0xb77c('0x47')]=_['keys'](_0x415794['query']);_0x4f1a3b['filters']=_[_0xb77c('0x48')](_0x4f1a3b[_0xb77c('0x45')],_0x4f1a3b[_0xb77c('0x47')]);_0x2ecd23[_0xb77c('0x49')]=_['intersection'](_0x4f1a3b['model'],qs[_0xb77c('0x4a')](_0x415794[_0xb77c('0x47')][_0xb77c('0x4a')]));_0x2ecd23[_0xb77c('0x49')]=_0x2ecd23[_0xb77c('0x49')][_0xb77c('0x4b')]?_0x2ecd23['attributes']:_0x4f1a3b[_0xb77c('0x45')];if(!_0x415794[_0xb77c('0x47')]['hasOwnProperty']('nolimit')){_0x2ecd23[_0xb77c('0x27')]=qs[_0xb77c('0x27')](_0x415794[_0xb77c('0x47')]['limit']);_0x2ecd23[_0xb77c('0x26')]=qs[_0xb77c('0x26')](_0x415794[_0xb77c('0x47')][_0xb77c('0x26')]);}_0x2ecd23[_0xb77c('0x4c')]=qs[_0xb77c('0x4d')](_0x415794[_0xb77c('0x47')][_0xb77c('0x4d')]);_0x2ecd23['where']=qs[_0xb77c('0x4e')](_[_0xb77c('0x4f')](_0x415794[_0xb77c('0x47')],_0x4f1a3b[_0xb77c('0x4e')]),_0x41e8bc);var _0x49332a=[];var _0x4b9b86=squel[_0xb77c('0x50')]()['field']('id')['field'](_0xb77c('0x46'))[_0xb77c('0x51')](_0xb77c('0x52'))['from'](_0xb77c('0x53'));var _0xd57fae=squel['select']()[_0xb77c('0x51')](_0xb77c('0x54'))[_0xb77c('0x51')]('u.fullname')[_0xb77c('0x51')]('ui.SmsInteractionId')[_0xb77c('0x55')](_0xb77c('0x56'),'ui')['left_join'](_0xb77c('0x57'),'u',_0xb77c('0x58'));var _0x52cef4=squel[_0xb77c('0x50')]()[_0xb77c('0x55')](_0xb77c('0x59'),'i')['left_join']('cm_contacts','c',_0xb77c('0x5a'))[_0xb77c('0x5b')]('users','o',_0xb77c('0x5c'))[_0xb77c('0x5b')](_0xb77c('0x5d'),'a',_0xb77c('0x5e'))[_0xb77c('0x5b')](_0xb77c('0x5f'),'me',_0xb77c('0x60'))['left_join'](_0xb77c('0x61'),'it',_0xb77c('0x62'))[_0xb77c('0x5b')](_0xb77c('0x53'),'t',_0xb77c('0x63'));var _0x12d056=squel[_0xb77c('0x64')]();var _0x2abddd=[];var _0x2f4103=squel[_0xb77c('0x64')]();var _0x10a776;if(_0x415794[_0xb77c('0x47')][_0xb77c('0x65')]){_0x10a776=as[_0xb77c('0x66')](_0x415794[_0xb77c('0x47')][_0xb77c('0x65')]);var _0x2e170c=_0x10a776[_0xb77c('0x67')];for(var _0x146ae4=0x0;_0x146ae4<_0x10a776['conditions'][_0xb77c('0x4b')];_0x146ae4++){var _0x4297d6=_0x10a776[_0xb77c('0x68')][_0x146ae4];var _0x1a5f2d='i';var _0x5817f2=_[_0xb77c('0x69')](_0x41e8bc,[_0xb77c('0x46'),_0x4297d6['field']]);if(!_0x5817f2){switch(_0x4297d6[_0xb77c('0x51')]){case _0xb77c('0x6a'):if(_0x4297d6[_0xb77c('0x6b')]==0x1){_0x52cef4[_0xb77c('0x6c')]('`'+_0x4297d6[_0xb77c('0x51')]+_0xb77c('0x6d'));}else{_0x52cef4['having']('`'+_0x4297d6['field']+_0xb77c('0x6e'));}break;case _0xb77c('0x6f'):if(_0x4297d6[_0xb77c('0x70')]===_0xb77c('0x71')){if(_0x4297d6[_0xb77c('0x6b')][_0xb77c('0x72')]('\x20')[_0xb77c('0x4b')]>0x1){_0x12d056[_0x2e170c](_0xb77c('0x73'),qs[_0xb77c('0x74')](_0x4297d6[_0xb77c('0x6b')]),null);}else{var _0x942a3='%'+_0x4297d6[_0xb77c('0x6b')]+'%';_0x12d056[_0x2e170c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x942a3,_0x942a3,_0x942a3);}}else{_0x5817f2=_[_0xb77c('0x69')](_0x41e8bc,[_0xb77c('0x46'),'ContactId']);_0x4297d6[_0xb77c('0x51')]=_0xb77c('0x75');_0x3909e7=as[_0xb77c('0x76')](_0x1a5f2d,_0x5817f2[_0xb77c('0x43')],_0x4297d6);_0x12d056[_0x2e170c](_0x3909e7['text'],_0x3909e7[_0xb77c('0x6b')]['start'],_0x3909e7[_0xb77c('0x6b')][_0xb77c('0x24')]);}break;case _0xb77c('0x77'):var _0x2dbd7a=_0x4297d6['value'][_0xb77c('0x72')](',')['map'](function(_0x45a92){return Number(_0x45a92);});_0x2dbd7a[_0xb77c('0x37')](function(_0x59635c){_0x2f4103['or'](_0xb77c('0x78'),'%,'+_0x59635c+',%');});_0x2abddd=_[_0xb77c('0x79')](_0x2abddd,_0x2dbd7a);break;case _0xb77c('0x7a'):if(_0x4297d6['operator']===_0xb77c('0x71')){_0x12d056[_0x2e170c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4297d6['value']+'%',null);}else{_0x5817f2=_[_0xb77c('0x69')](_0x41e8bc,[_0xb77c('0x46'),'UserId']);_0x4297d6[_0xb77c('0x51')]=_0xb77c('0x3d');_0x3909e7=as[_0xb77c('0x76')](_0x1a5f2d,_0x5817f2[_0xb77c('0x43')],_0x4297d6);_0x12d056[_0x2e170c](_0x3909e7[_0xb77c('0x7b')],_0x3909e7['value']['start'],_0x3909e7[_0xb77c('0x6b')]['end']);}break;case _0xb77c('0x7c'):_0x3909e7=as[_0xb77c('0x76')]('me',null,_0x4297d6);_0x12d056[_0x2e170c](_0x3909e7['text'],_0x3909e7[_0xb77c('0x6b')][_0xb77c('0x7d')],_0x3909e7[_0xb77c('0x6b')][_0xb77c('0x24')]);break;}}else{var _0x3909e7=as['buildExpression'](_0x1a5f2d,_0x5817f2[_0xb77c('0x43')],_0x4297d6);_0x12d056[_0x2e170c](_0x3909e7[_0xb77c('0x7b')],_0x3909e7[_0xb77c('0x6b')]['start'],_0x3909e7['value']['end']);}}}else{var _0x3a1163=_(_0x415794['query'])[_0xb77c('0x7e')]()[_0xb77c('0x33')](function(_0x55a338){return _[_0xb77c('0x7f')](_0x41e8bc,['name',_0x55a338])?_0x55a338:undefined;})[_0xb77c('0x80')]()[_0xb77c('0x6b')]();if(!_[_0xb77c('0x81')](_0x3a1163)){_0x3a1163['forEach'](function(_0x2a8827){if(_0x2a8827==='SmsAccountId'){_0x52cef4['where'](_0xb77c('0x82'),[][_0xb77c('0x83')](_0x415794[_0xb77c('0x47')][_0x2a8827]));}else if(_0x2a8827===_0xb77c('0x84')){var _0x16524d=JSON[_0xb77c('0x85')](_0x415794[_0xb77c('0x47')][_0x2a8827])['$gte'];var _0xbc2b97=JSON[_0xb77c('0x85')](_0x415794[_0xb77c('0x47')][_0x2a8827])['$lte'];_0x52cef4[_0xb77c('0x86')](_0xb77c('0x87'),_0x16524d,_0xbc2b97);}else{if(_0x415794[_0xb77c('0x47')][_0x2a8827]===_0xb77c('0x88')){_0x52cef4[_0xb77c('0x86')]('i.'+_0x2a8827+_0xb77c('0x89'));}else{_0x52cef4[_0xb77c('0x86')]('i.'+_0x2a8827+'\x20=\x20?',_0x415794[_0xb77c('0x47')][_0x2a8827]);}}});}if(_0x415794[_0xb77c('0x47')][_0xb77c('0x8a')]){if(_0x415794[_0xb77c('0x47')][_0xb77c('0x8a')]==0x1){_0x52cef4[_0xb77c('0x6c')](_0xb77c('0x8b'));}else{_0x52cef4[_0xb77c('0x6c')](_0xb77c('0x8c'));}}if(_0x415794[_0xb77c('0x47')][_0xb77c('0x8d')]){_0x2abddd=_[_0xb77c('0x8e')](_0x415794[_0xb77c('0x47')]['tag'])?_0x415794[_0xb77c('0x47')][_0xb77c('0x8d')]:new Array(_0x415794[_0xb77c('0x47')]['tag']);_0x2abddd[_0xb77c('0x37')](function(_0x55b594){_0x2f4103['or'](_0xb77c('0x78'),'%,'+_0x55b594+',%');});}if(_0x415794[_0xb77c('0x47')][_0xb77c('0x8f')]){var _0x229853=_0x415794[_0xb77c('0x47')][_0xb77c('0x8f')][_0xb77c('0x90')]('\x5c','\x5c\x5c')[_0xb77c('0x90')](/'/g,'\x27\x27');if(qs[_0xb77c('0x91')](_0x229853)){_0x12d056['or'](_0xb77c('0x92'),_0x229853+'%')['or'](_0xb77c('0x93'),_0x229853+'%');}else{_0x12d056['or'](_0xb77c('0x94'),qs[_0xb77c('0x74')](_0x229853))['or'](_0xb77c('0x95'),_0x229853+'%');}}}_0x52cef4[_0xb77c('0x86')](_0x12d056);_0x52cef4[_0xb77c('0x96')](_0xb77c('0x97'));var _0xcc13f4={'type':db[_0xb77c('0x98')][_0xb77c('0x99')]['SELECT'],'raw':!![]};var _0x55072e=_0x52cef4[_0xb77c('0x9a')]();_0x55072e[_0xb77c('0x51')](_0xb77c('0x97'));_0x55072e[_0xb77c('0x51')](_0xb77c('0x9b'),'unreadMessages');if(_0x2ecd23[_0xb77c('0x4c')]){_0x2ecd23['order'][_0xb77c('0x37')](function(_0x606165){var _0x492f89=_0x606165[0x0]===_0xb77c('0x9c')?_0x606165[0x0]:'i.'+_0x606165[0x0];_0x52cef4[_0xb77c('0x4c')](_0x492f89,_0x606165[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb77c('0x81')](_0x2abddd)){_0x52cef4['having'](_0x2f4103);_0x55072e['where']('t.id\x20IN\x20?',_0x2abddd);}BPromise[_0xb77c('0x9d')]()['then'](function(){if(!_0x10a776){if(_0x415794[_0xb77c('0x47')]['SmsAccountId'])return;_0x55072e['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x52cef4['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x415794[_0xb77c('0x9e')]['role']!==_0xb77c('0x9f'))return;return _0x415794[_0xb77c('0x9e')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x2e2ff9){if(_[_0xb77c('0x81')](_0x2e2ff9)){_0x55072e[_0xb77c('0x86')](_0xb77c('0xa0'));_0x52cef4[_0xb77c('0x86')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x55072e[_0xb77c('0x86')]('i.SmsAccountId\x20IN\x20?',_[_0xb77c('0x33')](_0x2e2ff9,'id'));_0x52cef4[_0xb77c('0x86')](_0xb77c('0x82'),_['map'](_0x2e2ff9,'id'));}});})[_0xb77c('0x2f')](function(){if(_0x415794[_0xb77c('0x9e')]['role']==='agent'&&!_0x10a776&&!_0x415794[_0xb77c('0x47')][_0xb77c('0xa1')])return[];return db['sequelize'][_0xb77c('0x47')](_0x55072e[_0xb77c('0xa2')](),_0xcc13f4);})[_0xb77c('0x2f')](function(_0x44d9f7){_0x39a4fa[_0xb77c('0x29')]=_0x44d9f7[_0xb77c('0x4b')];if(_0x39a4fa['count']===0x0)return[];return db[_0xb77c('0xa3')][_0xb77c('0x47')](_0x4b9b86['toString'](),_0xcc13f4)[_0xb77c('0x2f')](function(_0x2107e5){_0x49332a=_['keyBy'](_0x2107e5,'id');_0xcc13f4=_['merge'](_0xcc13f4,{'model':db[_0xb77c('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x415794[_0xb77c('0x47')]['fields']){_0x2ecd23[_0xb77c('0x49')][_0xb77c('0x37')](function(_0x3e9cdc){_0x52cef4[_0xb77c('0x51')]('i.'+_0x3e9cdc);});}else{_0x52cef4['field'](_0xb77c('0x9b'),_0xb77c('0x6a'));_0x52cef4[_0xb77c('0x51')]('a.key',_0xb77c('0xa4'));_0x52cef4[_0xb77c('0x51')](_0xb77c('0xa5'),_0xb77c('0xa6'));_0x52cef4[_0xb77c('0x51')](_0xb77c('0xa7'),'contactName');_0x52cef4[_0xb77c('0x51')]('i.*');_0x52cef4[_0xb77c('0x51')](_0xb77c('0xa8'),_0xb77c('0xa9'));_0x52cef4[_0xb77c('0x51')](_0xb77c('0xaa'),_0xb77c('0xab'));_0x52cef4[_0xb77c('0x51')](_0xb77c('0xac'),_0xb77c('0xad'));_0x52cef4[_0xb77c('0x51')](_0xb77c('0xae'),'Contact.phone');_0x52cef4[_0xb77c('0x51')](_0xb77c('0xaf'),'Contact.mobile');_0x52cef4[_0xb77c('0x51')]('c.fax',_0xb77c('0xb0'));_0x52cef4[_0xb77c('0x51')](_0xb77c('0xb1'),_0xb77c('0xb2'));_0x52cef4[_0xb77c('0x51')](_0xb77c('0xb3'),'Owner.internal');_0x52cef4[_0xb77c('0x51')](_0xb77c('0xb4'),_0xb77c('0x35'));}if(_0x2ecd23[_0xb77c('0x27')])_0x52cef4[_0xb77c('0x27')](_0x2ecd23[_0xb77c('0x27')]);if(_0x2ecd23[_0xb77c('0x26')])_0x52cef4[_0xb77c('0x26')](_0x2ecd23[_0xb77c('0x26')]);return db[_0xb77c('0xa3')]['query'](_0x52cef4[_0xb77c('0xa2')](),_0xcc13f4);})[_0xb77c('0x2f')](function(_0x5a3bd3){if(_0x5a3bd3[_0xb77c('0x4b')]>0x0)_0xd57fae[_0xb77c('0x86')]('ui.SmsInteractionId\x20IN\x20?',_[_0xb77c('0x33')](_0x5a3bd3,'id'));return db[_0xb77c('0xa3')][_0xb77c('0x47')](_0xd57fae[_0xb77c('0xa2')](),_0xcc13f4)['then'](function(_0xb3f865){var _0x13a9f6=_[_0xb77c('0xb5')](_0xb3f865,_0xb77c('0xb6'));var _0x275962=[];_0x5a3bd3[_0xb77c('0x37')](function(_0x5bd671){_0x275962[_0xb77c('0x38')](updateSmsInteraction(_0x5bd671,_0x49332a,_0x13a9f6));});return BPromise[_0xb77c('0xb7')](_0x275962);});});})[_0xb77c('0x2f')](function(_0x38ef94){_0x39a4fa[_0xb77c('0xb8')]=_0x38ef94;return _0x39a4fa;})[_0xb77c('0x2f')](respondWithFilteredResult(_0x4b553e,_0x2ecd23))[_0xb77c('0xb9')](handleError(_0x4b553e,null));};exports[_0xb77c('0xba')]=function(_0x473c04,_0x32de1d){var _0xa56934={'raw':![],'where':{'id':_0x473c04[_0xb77c('0xbb')]['id']}},_0x28e6e0={};_0x28e6e0[_0xb77c('0x45')]=_[_0xb77c('0x7e')](db[_0xb77c('0x40')]['rawAttributes']);_0x28e6e0[_0xb77c('0x47')]=_[_0xb77c('0x7e')](_0x473c04['query']);_0x28e6e0[_0xb77c('0x4e')]=_[_0xb77c('0x48')](_0x28e6e0[_0xb77c('0x45')],_0x28e6e0['query']);_0xa56934[_0xb77c('0x49')]=_['intersection'](_0x28e6e0[_0xb77c('0x45')],qs[_0xb77c('0x4a')](_0x473c04[_0xb77c('0x47')][_0xb77c('0x4a')]));_0xa56934[_0xb77c('0x49')]=_0xa56934['attributes'][_0xb77c('0x4b')]?_0xa56934[_0xb77c('0x49')]:_0x28e6e0[_0xb77c('0x45')];if(_0x473c04[_0xb77c('0x47')]['includeAll']){_0xa56934[_0xb77c('0xbc')]=[{'all':!![]}];}_0xa56934=_['merge']({},_0xa56934,_0x473c04[_0xb77c('0xbd')]);return db[_0xb77c('0x40')][_0xb77c('0x69')](_0xa56934)[_0xb77c('0x2f')](handleEntityNotFound(_0x32de1d,null))[_0xb77c('0x2f')](respondWithResult(_0x32de1d,null))[_0xb77c('0xb9')](handleError(_0x32de1d,null));};exports[_0xb77c('0xbe')]=function(_0x4e6558,_0x8cd123){return db['SmsInteraction']['create'](_0x4e6558[_0xb77c('0x7c')],{})[_0xb77c('0x2f')](respondWithResult(_0x8cd123,0xc9))[_0xb77c('0xb9')](handleError(_0x8cd123,null));};exports['update']=function(_0x220318,_0x30cd3b){if(_0x220318[_0xb77c('0x7c')]['id']){delete _0x220318[_0xb77c('0x7c')]['id'];}return db[_0xb77c('0x40')][_0xb77c('0x69')]({'where':{'id':_0x220318['params']['id']}})[_0xb77c('0x2f')](handleEntityNotFound(_0x30cd3b,null))[_0xb77c('0x2f')](saveUpdates(_0x220318[_0xb77c('0x7c')],null))['then'](respondWithResult(_0x30cd3b,null))[_0xb77c('0xb9')](handleError(_0x30cd3b,null));};exports[_0xb77c('0x2e')]=function(_0x38bf7d,_0x19c9c6){return db['SmsInteraction'][_0xb77c('0x69')]({'where':{'id':_0x38bf7d[_0xb77c('0xbb')]['id']}})[_0xb77c('0x2f')](handleEntityNotFound(_0x19c9c6,null))[_0xb77c('0x2f')](removeEntity(_0x19c9c6,null))['catch'](handleError(_0x19c9c6,null));};exports[_0xb77c('0xbf')]=function(_0x207fa8,_0x311557){return db[_0xb77c('0x40')]['describe']()[_0xb77c('0x2f')](respondWithResult(_0x311557,null))[_0xb77c('0xb9')](handleError(_0x311557,null));};exports[_0xb77c('0xc0')]=function(_0x119ec8,_0x198a0f,_0x3e9bae){return db[_0xb77c('0xc1')][_0xb77c('0x69')]({'where':{'id':_0x119ec8[_0xb77c('0xbb')]['id']}})[_0xb77c('0x2f')](handleEntityNotFound(_0x198a0f,null))[_0xb77c('0x2f')](function(_0x21072e){if(_0x21072e){return _0x21072e[_0xb77c('0xc0')](_0x119ec8[_0xb77c('0x7c')][_0xb77c('0xc2')],_[_0xb77c('0xc3')](_0x119ec8[_0xb77c('0x7c')],['ids','id'])||{});}})[_0xb77c('0x2f')](respondWithResult(_0x198a0f,null))[_0xb77c('0xb9')](handleError(_0x198a0f,null));};exports[_0xb77c('0xc4')]=function(_0x19022a,_0x5734cc,_0x3db12f){var _0x199e76={'raw':![],'where':{}};var _0x3ed420={};var _0x3a7193={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x19022a[_0xb77c('0xbb')]['id']}})[_0xb77c('0x2f')](handleEntityNotFound(_0x5734cc,null))[_0xb77c('0x2f')](function(_0x20479a){if(_0x20479a){_0x3ed420[_0xb77c('0x45')]=_[_0xb77c('0x7e')](db[_0xb77c('0xc1')][_0xb77c('0x41')]);_0x3ed420['query']=_[_0xb77c('0x7e')](_0x19022a[_0xb77c('0x47')]);_0x3ed420[_0xb77c('0x4e')]=_[_0xb77c('0x48')](_0x3ed420['model'],_0x3ed420['query']);_0x199e76[_0xb77c('0x49')]=_['intersection'](_0x3ed420[_0xb77c('0x45')],qs[_0xb77c('0x4a')](_0x19022a['query'][_0xb77c('0x4a')]));_0x199e76[_0xb77c('0x49')]=_0x199e76[_0xb77c('0x49')]['length']?_0x199e76['attributes']:_0x3ed420[_0xb77c('0x45')];if(!_0x19022a[_0xb77c('0x47')][_0xb77c('0xc5')](_0xb77c('0xc6'))){_0x199e76['limit']=qs[_0xb77c('0x27')](_0x19022a[_0xb77c('0x47')][_0xb77c('0x27')]);_0x199e76['offset']=qs['offset'](_0x19022a[_0xb77c('0x47')][_0xb77c('0x26')]);}_0x199e76['order']=qs[_0xb77c('0x4d')](_0x19022a[_0xb77c('0x47')]['sort']);_0x199e76['where']=qs[_0xb77c('0x4e')](_[_0xb77c('0x4f')](_0x19022a[_0xb77c('0x47')],_0x3ed420[_0xb77c('0x4e')]));_0x199e76[_0xb77c('0x86')][_0xb77c('0xb6')]=_0x20479a['id'];if(_0x19022a[_0xb77c('0x47')][_0xb77c('0x8f')]){_0x199e76[_0xb77c('0x86')]=_[_0xb77c('0xc7')](_0x199e76[_0xb77c('0x86')],{'$or':_[_0xb77c('0x33')](_0x199e76['attributes'],function(_0x4891be){var _0x25f25e={};_0x25f25e[_0x4891be]={'$like':'%'+_0x19022a[_0xb77c('0x47')][_0xb77c('0x8f')]+'%'};return _0x25f25e;})});}if(_0x19022a[_0xb77c('0x47')]['$gte']){var _0x329758=_0x19022a[_0xb77c('0x47')][_0xb77c('0xc8')][_0xb77c('0x72')](',');var _0x12bd71={};_0x12bd71[_0x329758[0x0]]={'$gte':moment(_0x329758[0x1])[_0xb77c('0xc9')](_0xb77c('0xca'))};_0x199e76['where']=_[_0xb77c('0xc7')](_0x199e76['where'],_0x12bd71);}_0x199e76=_['merge']({},_0x199e76,_0x19022a[_0xb77c('0xbd')]);return db[_0xb77c('0xc1')]['count']({'where':_0x199e76[_0xb77c('0x86')]})[_0xb77c('0x2f')](function(_0x467012){_0x3a7193['count']=_0x467012;if(_0x19022a[_0xb77c('0x47')][_0xb77c('0xcb')]){_0x199e76['include']=[{'all':!![]}];}return db[_0xb77c('0xc1')][_0xb77c('0xcc')](_0x199e76);})['then'](function(_0x42505e){_0x3a7193[_0xb77c('0xb8')]=_0x42505e;return _0x3a7193;});}})[_0xb77c('0x2f')](respondWithFilteredResult(_0x5734cc,_0x199e76))[_0xb77c('0xb9')](handleError(_0x5734cc,null));};exports[_0xb77c('0xcd')]=function(_0x14e9fd,_0x1d0204,_0x412746){return db[_0xb77c('0x40')][_0xb77c('0x69')]({'where':{'id':_0x14e9fd[_0xb77c('0xbb')]['id']}})[_0xb77c('0x2f')](handleEntityNotFound(_0x1d0204,null))[_0xb77c('0x2f')](function(_0x4f7c61){if(_0x4f7c61){return _0x4f7c61[_0xb77c('0xce')](_0x14e9fd[_0xb77c('0x7c')][_0xb77c('0xc2')],_[_0xb77c('0xc3')](_0x14e9fd[_0xb77c('0x7c')],[_0xb77c('0xc2'),'id'])||{})['spread'](function(){return db[_0xb77c('0x77')][_0xb77c('0xcc')]({'attributes':['id',_0xb77c('0x46'),_0xb77c('0x52')],'where':{'id':_0x14e9fd[_0xb77c('0x7c')][_0xb77c('0xc2')]}});})[_0xb77c('0x2f')](function(_0x2e556a){socket[_0xb77c('0xcf')]('smsInteractionTags:save',{'id':Number(_0x14e9fd[_0xb77c('0xbb')]['id']),'tags':_0x2e556a||[]});return{'id':Number(_0x14e9fd[_0xb77c('0xbb')]['id']),'tags':_0x2e556a||[]};});}})[_0xb77c('0x2f')](respondWithResult(_0x1d0204,null))[_0xb77c('0xb9')](handleError(_0x1d0204,null));};exports[_0xb77c('0xd0')]=function(_0x453c3a,_0x16184e,_0xe957dd){return db[_0xb77c('0x40')][_0xb77c('0x69')]({'where':{'id':_0x453c3a[_0xb77c('0xbb')]['id']}})[_0xb77c('0x2f')](handleEntityNotFound(_0x16184e,null))['then'](function(_0x1aed29){if(_0x1aed29){return _0x1aed29[_0xb77c('0xd0')](_0x453c3a['query'][_0xb77c('0xc2')]);}})[_0xb77c('0x2f')](respondWithStatusCode(_0x16184e,null))[_0xb77c('0xb9')](handleError(_0x16184e,null));};exports['download']=function(_0x2b22fb,_0x33c050){var _0x1db027=moment()['unix']()[_0xb77c('0xa2')]();var _0x3aa84c=path[_0xb77c('0xd1')](config[_0xb77c('0xd2')],'server',_0xb77c('0xd3'),_0xb77c('0xd4'));var _0x4453d8=path['join'](config[_0xb77c('0xd2')],'server',_0xb77c('0xd3'),_0xb77c('0xd5'));var _0x4a3ce6=path[_0xb77c('0xd1')](_0x3aa84c,_0x1db027);var _0x30f5fe=util['format'](_0xb77c('0xd6'),_0x2b22fb[_0xb77c('0xbb')]['id'],_0x1db027);var _0x12d8f6=path[_0xb77c('0xd1')](_0x3aa84c,_0x30f5fe);var _0x525b38=[];_0x525b38[_0xb77c('0x38')]({'model':db[_0xb77c('0x7a')],'as':_0xb77c('0x7a'),'attributes':['id',_0xb77c('0x34')],'raw':!![]});_0x525b38[_0xb77c('0x38')]({'model':db['CmContact'],'as':_0xb77c('0x6f'),'attributes':['id',_0xb77c('0xd7'),_0xb77c('0xd8')],'raw':!![]});var _0x3c4db3=[{'model':db[_0xb77c('0xc1')],'as':_0xb77c('0xd9'),'attributes':['id','body',_0xb77c('0x84'),'direction',_0xb77c('0xda'),'read'],'include':_0x525b38}];_0x3c4db3[_0xb77c('0x38')]({'model':db['SmsAccount'],'as':_0xb77c('0xdb'),'attributes':['id',_0xb77c('0x46')]});_0x3c4db3['push']({'model':db[_0xb77c('0x7a')],'as':_0xb77c('0xdc'),'attributes':['id',_0xb77c('0x34')]});return db[_0xb77c('0x40')][_0xb77c('0x69')]({'where':{'id':_0x2b22fb[_0xb77c('0xbb')]['id']},'include':_0x3c4db3})['then'](handleEntityNotFound(_0x33c050,null))[_0xb77c('0x2f')](function(_0x3f84fe){if(_0x3f84fe){var _0x1c2942=_0x3f84fe[_0xb77c('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x4a3ce6);var _0x10a871={'channel':'Sms','account':_0x1c2942['Account'][_0xb77c('0x46')],'agent':_0x1c2942[_0xb77c('0xdc')]?_0x1c2942[_0xb77c('0xdc')][_0xb77c('0x34')]:_0xb77c('0xde'),'createdAt':moment(_0x1c2942[_0xb77c('0x84')])[_0xb77c('0xc9')](_0xb77c('0xca'))[_0xb77c('0xa2')](),'closedAt':_0x1c2942[_0xb77c('0x3e')]?moment(_0x1c2942[_0xb77c('0xdf')])[_0xb77c('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1c2942[_0xb77c('0xe0')],'messages':_(_0x1c2942[_0xb77c('0xd9')])[_0xb77c('0x8f')]({'secret':![]})[_0xb77c('0x33')](function(_0x413742){return{'date':moment(_0x413742[_0xb77c('0x84')])['format'](_0xb77c('0xca'))[_0xb77c('0xa2')](),'sender':_0x413742[_0xb77c('0xe1')]===_0xb77c('0xe2')?_0x413742[_0xb77c('0x7a')]?_0x413742['User']['fullname']:_0xb77c('0xe3'):_0x413742[_0xb77c('0x6f')][_0xb77c('0xd7')]+(_0x413742['Contact'][_0xb77c('0xd8')]?'\x20'+_0x413742[_0xb77c('0x6f')][_0xb77c('0xd8')]:''),'body':_0x413742[_0xb77c('0x7c')],'direction':_0x413742[_0xb77c('0xe1')]==='out'?'A':'C','secret':_0x413742[_0xb77c('0xda')],'read':_0x413742[_0xb77c('0x8a')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xb77c('0xd2')],_0xb77c('0xe4'),_0xb77c('0xe5'),_0xb77c('0xe6')),{'interaction':_0x10a871})[_0xb77c('0x2f')](function(_0x2b8917){var _0x530eb9=path[_0xb77c('0xd1')](_0x4a3ce6,_0xb77c('0xe7')+_0x1c2942['id']+'-'+_0x1db027+_0xb77c('0xe8'));var _0x27f3ff={'path':_0x530eb9,'channel':'Sms','interactionId':_0x1c2942['id']};return pdf[_0xb77c('0xe9')](_0x2b8917,_0x27f3ff);})[_0xb77c('0x2f')](function(){return new BPromise(function(_0x2c7d15,_0x1f87fd){zipdir(_0x4a3ce6,{'saveTo':_0x12d8f6},function(_0x2509a4,_0x5bb486){if(_0x2509a4)return _0x1f87fd(_0x2509a4);return _0x2c7d15(_0x5bb486);});})[_0xb77c('0x2f')](function(){return new BPromise(function(_0xe0c8a6,_0x3403bd){rimraf(_0x4a3ce6,function(_0x3be718){if(_0x3be718)_0x3403bd(_0x3be718);return _0xe0c8a6();});});})['then'](function(){return _0x33c050['download'](_0x12d8f6,_0x30f5fe,function(_0x1466f8){if(_0x1466f8){console[_0xb77c('0xea')](_0xb77c('0xeb'),_0x1466f8);}else{fs[_0xb77c('0xec')](_0x12d8f6);}});});});}else{return _0x33c050[_0xb77c('0x22')](0xc8);}})['catch'](handleError(_0x33c050,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 18e98f4..74c9823 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 _0xeb3b=['then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','update','getUsers'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x3cba1d,_0x2825ae){_0x3cba1d=_0x3cba1d-0x0;var _0x5f192b=_0xeb3b[_0x3cba1d];return _0x5f192b;};'use strict';var EventEmitter=require(_0xbeb3('0x0'));var SmsInteraction=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x2')];var SmsMessage=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbeb3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e8ce3){return function(_0x4852ca,_0x2e8a69,_0x5ae6f9){_0x4852ca[_0xbeb3('0x5')]({'attributes':['id'],'raw':!![]})[_0xbeb3('0x6')](function(_0x406927){_0x4852ca[_0xbeb3('0x7')]('Users',_0x406927[_0xbeb3('0x8')](function(_0x26e0f3){return{'id':_0x26e0f3['id']};}));return SmsMessage[_0xbeb3('0x9')]({'where':{'SmsInteractionId':_0x4852ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbeb3('0x6')](function(_0x443396){_0x4852ca[_0xbeb3('0x7')](_0xbeb3('0xa'),_0x443396['length']);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3+':'+_0x4852ca['id'],_0x4852ca);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3,_0x4852ca);_0x5ae6f9(null);})['catch'](_0x5ae6f9(null));};}for(var e in events){if(events[_0xbeb3('0xc')](e)){var event=events[e];SmsInteraction[_0xbeb3('0xd')](e,emitEvent(event));}}module[_0xbeb3('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x28f2=['update','remove','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28f2,0x193));var _0x228f=function(_0x33f957,_0x3399fa){_0x33f957=_0x33f957-0x0;var _0x5ac824=_0x28f2[_0x33f957];return _0x5ac824;};'use strict';var EventEmitter=require(_0x228f('0x0'));var SmsInteraction=require(_0x228f('0x1'))['db'][_0x228f('0x2')];var SmsMessage=require(_0x228f('0x1'))['db'][_0x228f('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x228f('0x4'),'afterUpdate':_0x228f('0x5'),'afterDestroy':_0x228f('0x6')};function emitEvent(_0x4303c3){return function(_0x2bb7d7,_0x3439f5,_0x32c5c3){_0x2bb7d7['getUsers']({'attributes':['id'],'raw':!![]})[_0x228f('0x7')](function(_0x4a4a44){_0x2bb7d7[_0x228f('0x8')](_0x228f('0x9'),_0x4a4a44[_0x228f('0xa')](function(_0x5f406c){return{'id':_0x5f406c['id']};}));return SmsMessage[_0x228f('0xb')]({'where':{'SmsInteractionId':_0x2bb7d7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x212c90){_0x2bb7d7[_0x228f('0x8')]('unreadMessages',_0x212c90[_0x228f('0xc')]);SmsInteractionEvents[_0x228f('0xd')](_0x4303c3+':'+_0x2bb7d7['id'],_0x2bb7d7);SmsInteractionEvents[_0x228f('0xd')](_0x4303c3,_0x2bb7d7);_0x32c5c3(null);})[_0x228f('0xe')](_0x32c5c3(null));};}for(var e in events){if(events[_0x228f('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x228f('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 68f44e0..56a6c57 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 _0x9a3e=['api','moment','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x4c815c,_0x4ba015){var _0x250703=function(_0x4c6eca){while(--_0x4c6eca){_0x4c815c['push'](_0x4c815c['shift']());}};_0x250703(++_0x4ba015);}(_0x9a3e,0x9d));var _0xe9a3=function(_0x3220d0,_0x1fb0fc){_0x3220d0=_0x3220d0-0x0;var _0x362669=_0x9a3e[_0x3220d0];return _0x362669;};'use strict';var _=require(_0xe9a3('0x0'));var util=require(_0xe9a3('0x1'));var logger=require(_0xe9a3('0x2'))(_0xe9a3('0x3'));var moment=require(_0xe9a3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9a3('0x5'));var rimraf=require(_0xe9a3('0x6'));var config=require('../../config/environment');var attributes=require(_0xe9a3('0x7'));module[_0xe9a3('0x8')]=function(_0x5339b3,_0x10defc){return _0x5339b3[_0xe9a3('0x9')](_0xe9a3('0xa'),attributes,{'tableName':_0xe9a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x416253,_0x38aedc,_0x327eae){if(_0x416253[_0xe9a3('0xc')](_0xe9a3('0xd'))){_0x416253[_0xe9a3('0xe')]=moment()['format'](_0xe9a3('0xf'));}_0x327eae(null,_0x416253);}}});}; \ No newline at end of file +var _0xa5e4=['rimraf','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path'];(function(_0xf3d3d,_0x18c710){var _0x1e5511=function(_0x2b25e9){while(--_0x2b25e9){_0xf3d3d['push'](_0xf3d3d['shift']());}};_0x1e5511(++_0x18c710);}(_0xa5e4,0x13a));var _0x4a5e=function(_0xfc11a0,_0x3f1e35){_0xfc11a0=_0xfc11a0-0x0;var _0x482937=_0xa5e4[_0xfc11a0];return _0x482937;};'use strict';var _=require('lodash');var util=require(_0x4a5e('0x0'));var logger=require(_0x4a5e('0x1'))(_0x4a5e('0x2'));var moment=require(_0x4a5e('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a5e('0x4'));var fs=require('fs');var path=require(_0x4a5e('0x5'));var rimraf=require(_0x4a5e('0x6'));var config=require('../../config/environment');var attributes=require(_0x4a5e('0x7'));module[_0x4a5e('0x8')]=function(_0xb27df4,_0x2d496c){return _0xb27df4['define'](_0x4a5e('0x9'),attributes,{'tableName':_0x4a5e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31dafb,_0x2e7014,_0x5aaa97){if(_0x31dafb[_0x4a5e('0xb')](_0x4a5e('0xc'))){_0x31dafb[_0x4a5e('0xd')]=moment()[_0x4a5e('0xe')](_0x4a5e('0xf'));}_0x5aaa97(null,_0x31dafb);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9adf3b4..5e2f38e 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 _0x18df=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','find','addTags','body','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18df,0x173));var _0xf18d=function(_0x2c11eb,_0x855d9a){_0x2c11eb=_0x2c11eb-0x0;var _0x30aece=_0x18df[_0x2c11eb];return _0x30aece;};'use strict';var _=require(_0xf18d('0x0'));var util=require(_0xf18d('0x1'));var moment=require(_0xf18d('0x2'));var BPromise=require(_0xf18d('0x3'));var rs=require(_0xf18d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf18d('0x5'))['db'];var utils=require(_0xf18d('0x6'));var logger=require(_0xf18d('0x7'))(_0xf18d('0x8'));var config=require(_0xf18d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf18d('0xa')][_0xf18d('0xb')]({'port':0x232a});config[_0xf18d('0xc')]=_['defaults'](config[_0xf18d('0xc')],{'host':_0xf18d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf18d('0xc')]));require(_0xf18d('0xe'))[_0xf18d('0xf')](socket);function respondWithRpcPromise(_0x43ac81,_0x4250cb,_0x3d461b){return new BPromise(function(_0x2bcd25,_0x4412ab){return client['request'](_0x43ac81,_0x3d461b)[_0xf18d('0x10')](function(_0x2fb202){logger[_0xf18d('0x11')](_0xf18d('0x12'),_0x4250cb,_0xf18d('0x13'));logger[_0xf18d('0x14')](_0xf18d('0x15'),_0x4250cb,_0xf18d('0x13'),JSON[_0xf18d('0x16')](_0x2fb202));if(_0x2fb202['error']){if(_0x2fb202[_0xf18d('0x17')][_0xf18d('0x18')]===0x1f4){logger[_0xf18d('0x17')](_0xf18d('0x12'),_0x4250cb,_0x2fb202[_0xf18d('0x17')][_0xf18d('0x19')]);return _0x4412ab(_0x2fb202[_0xf18d('0x17')][_0xf18d('0x19')]);}logger[_0xf18d('0x17')](_0xf18d('0x12'),_0x4250cb,_0x2fb202[_0xf18d('0x17')]['message']);return _0x2bcd25(_0x2fb202[_0xf18d('0x17')][_0xf18d('0x19')]);}else{logger[_0xf18d('0x11')](_0xf18d('0x12'),_0x4250cb,_0xf18d('0x13'));_0x2bcd25(_0x2fb202[_0xf18d('0x1a')][_0xf18d('0x19')]);}})[_0xf18d('0x1b')](function(_0x45acc9){logger['error'](_0xf18d('0x12'),_0x4250cb,_0x45acc9);_0x4412ab(_0x45acc9);});});}exports[_0xf18d('0x1c')]=function(_0x1625f1){var _0xf7ecf9=this;return new Promise(function(_0x2d5058,_0x5c0a81){return db[_0xf18d('0x1d')][_0xf18d('0x1e')](_0x1625f1['body'],{'raw':_0x1625f1[_0xf18d('0x1f')]?_0x1625f1[_0xf18d('0x1f')][_0xf18d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1625f1[_0xf18d('0x1f')]?_0x1625f1[_0xf18d('0x1f')][_0xf18d('0x21')]||null:null,'attributes':_0x1625f1['options']?_0x1625f1[_0xf18d('0x1f')][_0xf18d('0x22')]||null:null,'limit':_0x1625f1['options']?_0x1625f1[_0xf18d('0x1f')][_0xf18d('0x23')]||null:null})[_0xf18d('0x10')](function(_0x2a66bb){logger[_0xf18d('0x11')]('UpdateSmsInteraction',_0x1625f1);logger[_0xf18d('0x14')]('UpdateSmsInteraction',_0x1625f1,JSON[_0xf18d('0x16')](_0x2a66bb));_0x2d5058(_0x2a66bb);})[_0xf18d('0x1b')](function(_0x128eb8){logger[_0xf18d('0x17')](_0xf18d('0x1c'),_0x128eb8['message'],_0x1625f1);_0x5c0a81(_0xf7ecf9[_0xf18d('0x17')](0x1f4,_0x128eb8[_0xf18d('0x19')]));});});};exports['AddTagsToSmsInteraction']=function(_0x4ccb79){return new Promise(function(_0x38d910,_0x597e3f){return db[_0xf18d('0x1d')][_0xf18d('0x24')]({'where':_0x4ccb79[_0xf18d('0x1f')]?_0x4ccb79[_0xf18d('0x1f')][_0xf18d('0x21')]||null:null})[_0xf18d('0x10')](function(_0xcd94a1){if(_0xcd94a1){return _0xcd94a1[_0xf18d('0x25')](_0x4ccb79[_0xf18d('0x26')]['ids'],_[_0xf18d('0x27')](_0x4ccb79['body'],[_0xf18d('0x28'),'id'])||{});}})['spread'](function(_0x194b84){logger['info']('AddTags',_0x4ccb79);logger['debug'](_0xf18d('0x29'),_0x4ccb79,JSON[_0xf18d('0x16')](_0x194b84));_0x38d910(_0x194b84);})[_0xf18d('0x1b')](function(_0x5d5a44){logger['error']('AddTags',_0x5d5a44[_0xf18d('0x19')],_0x4ccb79);_0x597e3f(_this[_0xf18d('0x17')](0x1f4,_0x5d5a44[_0xf18d('0x19')]));});});}; \ No newline at end of file +var _0x9f74=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','update','options','raw','where','attributes','limit','then','stringify','AddTagsToSmsInteraction','SmsInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x59c05e,_0x5e7c42){var _0x5366a2=function(_0x4e755e){while(--_0x4e755e){_0x59c05e['push'](_0x59c05e['shift']());}};_0x5366a2(++_0x5e7c42);}(_0x9f74,0x7f));var _0x49f7=function(_0x4bcd6e,_0x59e227){_0x4bcd6e=_0x4bcd6e-0x0;var _0x515795=_0x9f74[_0x4bcd6e];return _0x515795;};'use strict';var _=require(_0x49f7('0x0'));var util=require(_0x49f7('0x1'));var moment=require(_0x49f7('0x2'));var BPromise=require(_0x49f7('0x3'));var rs=require(_0x49f7('0x4'));var fs=require('fs');var Redis=require(_0x49f7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x49f7('0x6'));var logger=require(_0x49f7('0x7'))(_0x49f7('0x8'));var config=require(_0x49f7('0x9'));var jayson=require(_0x49f7('0xa'));var client=jayson[_0x49f7('0xb')]['http']({'port':0x232a});config[_0x49f7('0xc')]=_['defaults'](config['redis'],{'host':_0x49f7('0xd'),'port':0x18eb});var socket=require(_0x49f7('0xe'))(new Redis(config[_0x49f7('0xc')]));require(_0x49f7('0xf'))['register'](socket);function respondWithRpcPromise(_0x382093,_0x2725db,_0x22151f){return new BPromise(function(_0xc638a,_0x2b2ec5){return client[_0x49f7('0x10')](_0x382093,_0x22151f)['then'](function(_0x59f238){logger[_0x49f7('0x11')](_0x49f7('0x12'),_0x2725db,_0x49f7('0x13'));logger[_0x49f7('0x14')](_0x49f7('0x15'),_0x2725db,_0x49f7('0x13'),JSON['stringify'](_0x59f238));if(_0x59f238[_0x49f7('0x16')]){if(_0x59f238['error'][_0x49f7('0x17')]===0x1f4){logger[_0x49f7('0x16')](_0x49f7('0x12'),_0x2725db,_0x59f238[_0x49f7('0x16')]['message']);return _0x2b2ec5(_0x59f238[_0x49f7('0x16')][_0x49f7('0x18')]);}logger['error'](_0x49f7('0x12'),_0x2725db,_0x59f238[_0x49f7('0x16')][_0x49f7('0x18')]);return _0xc638a(_0x59f238[_0x49f7('0x16')][_0x49f7('0x18')]);}else{logger[_0x49f7('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x2725db,_0x49f7('0x13'));_0xc638a(_0x59f238[_0x49f7('0x19')][_0x49f7('0x18')]);}})[_0x49f7('0x1a')](function(_0x25dda4){logger['error'](_0x49f7('0x12'),_0x2725db,_0x25dda4);_0x2b2ec5(_0x25dda4);});});}exports[_0x49f7('0x1b')]=function(_0x45da92){var _0x48fa5b=this;return new Promise(function(_0xcde1f2,_0x41be92){return db['SmsInteraction'][_0x49f7('0x1c')](_0x45da92['body'],{'raw':_0x45da92[_0x49f7('0x1d')]?_0x45da92['options'][_0x49f7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45da92[_0x49f7('0x1d')]?_0x45da92[_0x49f7('0x1d')][_0x49f7('0x1f')]||null:null,'attributes':_0x45da92[_0x49f7('0x1d')]?_0x45da92['options'][_0x49f7('0x20')]||null:null,'limit':_0x45da92[_0x49f7('0x1d')]?_0x45da92['options'][_0x49f7('0x21')]||null:null})[_0x49f7('0x22')](function(_0x113284){logger['info'](_0x49f7('0x1b'),_0x45da92);logger[_0x49f7('0x14')](_0x49f7('0x1b'),_0x45da92,JSON[_0x49f7('0x23')](_0x113284));_0xcde1f2(_0x113284);})[_0x49f7('0x1a')](function(_0x34718f){logger[_0x49f7('0x16')](_0x49f7('0x1b'),_0x34718f[_0x49f7('0x18')],_0x45da92);_0x41be92(_0x48fa5b[_0x49f7('0x16')](0x1f4,_0x34718f[_0x49f7('0x18')]));});});};exports[_0x49f7('0x24')]=function(_0x12576a){return new Promise(function(_0x344493,_0x5e5bc4){return db[_0x49f7('0x25')][_0x49f7('0x26')]({'where':_0x12576a[_0x49f7('0x1d')]?_0x12576a[_0x49f7('0x1d')][_0x49f7('0x1f')]||null:null})['then'](function(_0x3aa7cf){if(_0x3aa7cf){return _0x3aa7cf[_0x49f7('0x27')](_0x12576a[_0x49f7('0x28')][_0x49f7('0x29')],_['omit'](_0x12576a[_0x49f7('0x28')],[_0x49f7('0x29'),'id'])||{});}})[_0x49f7('0x2a')](function(_0x32cd84){logger[_0x49f7('0x11')](_0x49f7('0x2b'),_0x12576a);logger[_0x49f7('0x14')]('AddTags',_0x12576a,JSON[_0x49f7('0x23')](_0x32cd84));_0x344493(_0x32cd84);})[_0x49f7('0x1a')](function(_0x4aad59){logger[_0x49f7('0x16')](_0x49f7('0x2b'),_0x4aad59[_0x49f7('0x18')],_0x12576a);_0x5e5bc4(_this['error'](0x1f4,_0x4aad59['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a30e3fb..9bd56f5 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 _0x7183=['./smsInteraction.events','save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x7183,0x198));var _0x3718=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x7183[_0x4792c8];return _0x35edb1;};'use strict';var SmsInteractionEvents=require(_0x3718('0x0'));var events=[_0x3718('0x1'),_0x3718('0x2'),_0x3718('0x3')];function createListener(_0x57f325,_0x43e243){return function(_0x735e5){_0x43e243['emit'](_0x57f325,_0x735e5);};}function removeListener(_0x2a3c04,_0x2a0565){return function(){SmsInteractionEvents[_0x3718('0x4')](_0x2a3c04,_0x2a0565);};}exports[_0x3718('0x5')]=function(_0x279fa3){for(var _0x44a1f3=0x0,_0x351c4d=events[_0x3718('0x6')];_0x44a1f3<_0x351c4d;_0x44a1f3++){var _0x48efb0=events[_0x44a1f3];var _0x466cd8=createListener(_0x3718('0x7')+_0x48efb0,_0x279fa3);SmsInteractionEvents['on'](_0x48efb0,_0x466cd8);}}; \ No newline at end of file +var _0x8664=['save','update','removeListener','register','smsInteraction:','./smsInteraction.events'];(function(_0x416941,_0x478f9b){var _0x206f04=function(_0xa69f25){while(--_0xa69f25){_0x416941['push'](_0x416941['shift']());}};_0x206f04(++_0x478f9b);}(_0x8664,0x1e5));var _0x4866=function(_0x551409,_0x4052cb){_0x551409=_0x551409-0x0;var _0x4e91a2=_0x8664[_0x551409];return _0x4e91a2;};'use strict';var SmsInteractionEvents=require(_0x4866('0x0'));var events=[_0x4866('0x1'),'remove',_0x4866('0x2')];function createListener(_0x5643f0,_0x207fff){return function(_0x4aea2a){_0x207fff['emit'](_0x5643f0,_0x4aea2a);};}function removeListener(_0x328bdc,_0x3f47b0){return function(){SmsInteractionEvents[_0x4866('0x3')](_0x328bdc,_0x3f47b0);};}exports[_0x4866('0x4')]=function(_0x455ff1){for(var _0x43e194=0x0,_0x345541=events['length'];_0x43e194<_0x345541;_0x43e194++){var _0xa5266d=events[_0x43e194];var _0x5d966d=createListener(_0x4866('0x5')+_0xa5266d,_0x455ff1);SmsInteractionEvents['on'](_0xa5266d,_0x5d966d);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 3ba160c..c837a02 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 _0xd23a=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','sms','smsmessage:create','create','status','put','update'];(function(_0x134448,_0x591d7b){var _0x2d52a1=function(_0x56b840){while(--_0x56b840){_0x134448['push'](_0x134448['shift']());}};_0x2d52a1(++_0x591d7b);}(_0xd23a,0xe7));var _0xad23=function(_0xf9f2e8,_0x2c908c){_0xf9f2e8=_0xf9f2e8-0x0;var _0x439631=_0xd23a[_0xf9f2e8];return _0x439631;};'use strict';var multer=require(_0xad23('0x0'));var util=require('util');var path=require(_0xad23('0x1'));var timeout=require(_0xad23('0x2'));var express=require(_0xad23('0x3'));var router=express[_0xad23('0x4')]();var fs_extra=require(_0xad23('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad23('0x6'));var config=require(_0xad23('0x7'));var controller=require('./smsMessage.controller');router[_0xad23('0x8')]('/',auth[_0xad23('0x9')](),controller[_0xad23('0xa')]);router[_0xad23('0x8')]('/describe',auth[_0xad23('0x9')](),controller[_0xad23('0xb')]);router['get'](_0xad23('0xc'),auth[_0xad23('0x9')](),controller[_0xad23('0xd')]);router[_0xad23('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xad23('0xf'),_0xad23('0x10')),controller[_0xad23('0x11')]);router[_0xad23('0xe')]('/:id/status',controller[_0xad23('0x12')]);router[_0xad23('0x13')](_0xad23('0xc'),auth[_0xad23('0x9')](),controller[_0xad23('0x14')]);router[_0xad23('0x13')](_0xad23('0x15'),auth[_0xad23('0x9')](),controller[_0xad23('0x16')]);router[_0xad23('0x13')](_0xad23('0x17'),auth['isAuthenticated'](),controller[_0xad23('0x18')]);router[_0xad23('0x19')](_0xad23('0xc'),auth[_0xad23('0x9')](),controller[_0xad23('0x1a')]);module[_0xad23('0x1b')]=router; \ No newline at end of file +var _0x1541=['status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','post','tracked','sms','smsmessage:create','create','/:id/status'];(function(_0x7375c,_0x5653b3){var _0x211973=function(_0x7cf42d){while(--_0x7cf42d){_0x7375c['push'](_0x7375c['shift']());}};_0x211973(++_0x5653b3);}(_0x1541,0xb9));var _0x1154=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x1541[_0x2f4c1c];return _0x25e0f2;};'use strict';var multer=require('multer');var util=require(_0x1154('0x0'));var path=require('path');var timeout=require(_0x1154('0x1'));var express=require('express');var router=express[_0x1154('0x2')]();var fs_extra=require(_0x1154('0x3'));var auth=require(_0x1154('0x4'));var interaction=require(_0x1154('0x5'));var config=require(_0x1154('0x6'));var controller=require(_0x1154('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1154('0x8')](_0x1154('0x9'),auth[_0x1154('0xa')](),controller[_0x1154('0xb')]);router[_0x1154('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1154('0xc')]('/',auth['isAuthenticated'](),interaction[_0x1154('0xd')](_0x1154('0xe'),_0x1154('0xf')),controller[_0x1154('0x10')]);router['post'](_0x1154('0x11'),controller[_0x1154('0x12')]);router[_0x1154('0x13')](_0x1154('0x14'),auth[_0x1154('0xa')](),controller[_0x1154('0x15')]);router[_0x1154('0x13')](_0x1154('0x16'),auth['isAuthenticated'](),controller[_0x1154('0x17')]);router['put'](_0x1154('0x18'),auth['isAuthenticated'](),controller[_0x1154('0x19')]);router[_0x1154('0x1a')](_0x1154('0x14'),auth[_0x1154('0xa')](),controller[_0x1154('0x1b')]);module[_0x1154('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 5c93d1d..446c50f 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 _0x78f6=['BOOLEAN','ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0x216036,_0x101d96){var _0x24d07b=function(_0x23fee9){while(--_0x23fee9){_0x216036['push'](_0x216036['shift']());}};_0x24d07b(++_0x101d96);}(_0x78f6,0x17e));var _0x678f=function(_0x407c79,_0x5b91a1){_0x407c79=_0x407c79-0x0;var _0x2254e7=_0x78f6[_0x407c79];return _0x2254e7;};'use strict';var Sequelize=require(_0x678f('0x0'));module['exports']={'body':{'type':Sequelize[_0x678f('0x1')](_0x678f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x678f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x678f('0x4')]('in',_0x678f('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x678f('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x678f('0x6')]},'providerResponse':{'type':Sequelize[_0x678f('0x1')]}}; \ No newline at end of file +var _0x0c48=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x204a4a,_0x297acf){var _0x1feb97=function(_0x17db8a){while(--_0x17db8a){_0x204a4a['push'](_0x204a4a['shift']());}};_0x1feb97(++_0x297acf);}(_0x0c48,0xed));var _0x80c4=function(_0x419305,_0x41c14e){_0x419305=_0x419305-0x0;var _0x4b66dc=_0x0c48[_0x419305];return _0x4b66dc;};'use strict';var Sequelize=require(_0x80c4('0x0'));module[_0x80c4('0x1')]={'body':{'type':Sequelize[_0x80c4('0x2')](_0x80c4('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x80c4('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x80c4('0x5')]('in',_0x80c4('0x6')),'defaultValue':_0x80c4('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x80c4('0x7')](0xbe)},'phone':{'type':Sequelize[_0x80c4('0x7')]},'readAt':{'type':Sequelize[_0x80c4('0x8')]},'secret':{'type':Sequelize[_0x80c4('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x80c4('0x7')]},'providerResponse':{'type':Sequelize[_0x80c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index f8e9dd4..03abfc8 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 _0x27eb=['params','merge','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','sms','agent','rejectMessage','Sequelize','contact','fullname','internal','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','localhost','redis','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','stack','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','name','options','includeAll','include','findAll','rows','show'];(function(_0x56532e,_0x3a6813){var _0x2ee0c4=function(_0x100e28){while(--_0x100e28){_0x56532e['push'](_0x56532e['shift']());}};_0x2ee0c4(++_0x3a6813);}(_0x27eb,0xd0));var _0xb27e=function(_0x25bc6e,_0x1d49a5){_0x25bc6e=_0x25bc6e-0x0;var _0xc41066=_0x27eb[_0x25bc6e];return _0xc41066;};'use strict';var emlformat=require(_0xb27e('0x0'));var rimraf=require(_0xb27e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb27e('0x2'));var moment=require(_0xb27e('0x3'));var BPromise=require(_0xb27e('0x4'));var Mustache=require('mustache');var util=require(_0xb27e('0x5'));var path=require(_0xb27e('0x6'));var sox=require(_0xb27e('0x7'));var csv=require(_0xb27e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb27e('0x9'));var _=require(_0xb27e('0xa'));var squel=require(_0xb27e('0xb'));var crypto=require(_0xb27e('0xc'));var jsforce=require(_0xb27e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb27e('0x8'));var querystring=require(_0xb27e('0xe'));var Papa=require(_0xb27e('0xf'));var Redis=require(_0xb27e('0x10'));var authService=require(_0xb27e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb27e('0x12'));var hardwareService=require(_0xb27e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb27e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb27e('0x15'));var db=require(_0xb27e('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb27e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb27e('0x18')]));require('./smsMessage.socket')[_0xb27e('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb27e('0x1a')][_0xb27e('0x1b')]({'port':0x232c});var client9002=jayson[_0xb27e('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26ec32,_0x1d14bb,_0x24fc3e,_0x188073){return new BPromise(function(_0x240767,_0x15f6c7){var _0x25ce70=_0x188073||client;return _0x25ce70[_0xb27e('0x1c')](_0x26ec32,_0x24fc3e)[_0xb27e('0x1d')](function(_0x48b70f){logger[_0xb27e('0x1e')](_0xb27e('0x1f'),_0x1d14bb,_0xb27e('0x20'));logger['debug'](_0xb27e('0x21'),_0x1d14bb,'request\x20sent',JSON['stringify'](_0x48b70f));if(_0x48b70f[_0xb27e('0x22')]){if(_0x48b70f[_0xb27e('0x22')]['code']===0x1f4){logger[_0xb27e('0x22')](_0xb27e('0x1f'),_0x1d14bb,_0x48b70f[_0xb27e('0x22')][_0xb27e('0x23')]);return _0x15f6c7(_0x48b70f['error'][_0xb27e('0x23')]);}logger['error'](_0xb27e('0x1f'),_0x1d14bb,_0x48b70f[_0xb27e('0x22')]['message']);return _0x240767(_0x48b70f['error'][_0xb27e('0x23')]);}else{logger[_0xb27e('0x1e')](_0xb27e('0x1f'),_0x1d14bb,_0xb27e('0x20'));_0x240767(_0x48b70f[_0xb27e('0x24')]['message']);}})[_0xb27e('0x25')](function(_0x4cba0b){logger[_0xb27e('0x22')](_0xb27e('0x1f'),_0x1d14bb,_0x4cba0b);_0x15f6c7(_0x4cba0b);});});}function respondWithStatusCode(_0x289bb5,_0x3fbc78){_0x3fbc78=_0x3fbc78||0xcc;return function(_0x3254fb){if(_0x3254fb){return _0x289bb5['sendStatus'](_0x3fbc78);}return _0x289bb5[_0xb27e('0x26')](_0x3fbc78)['end']();};}function respondWithResult(_0x2839cf,_0x2f44f3){_0x2f44f3=_0x2f44f3||0xc8;return function(_0x2d24b6){if(_0x2d24b6){return _0x2839cf[_0xb27e('0x26')](_0x2f44f3)[_0xb27e('0x27')](_0x2d24b6);}};}function respondWithFilteredResult(_0x35169a,_0xd27061){return function(_0x125c0b){if(_0x125c0b){var _0x42c5de=typeof _0xd27061['offset']===_0xb27e('0x28')&&typeof _0xd27061[_0xb27e('0x29')]===_0xb27e('0x28');var _0x41fc88=_0x125c0b['count'];var _0x1ba773=_0x42c5de?0x0:_0xd27061[_0xb27e('0x2a')];var _0xbcc473=_0x42c5de?_0x125c0b[_0xb27e('0x2b')]:_0xd27061[_0xb27e('0x2a')]+_0xd27061[_0xb27e('0x29')];var _0x26cd41;if(_0xbcc473>=_0x41fc88){_0xbcc473=_0x41fc88;_0x26cd41=0xc8;}else{_0x26cd41=0xce;}_0x35169a['status'](_0x26cd41);return _0x35169a['set'](_0xb27e('0x2c'),_0x1ba773+'-'+_0xbcc473+'/'+_0x41fc88)['json'](_0x125c0b);}return null;};}function patchUpdates(_0x33d1a7){return function(_0x54e58b){try{jsonpatch[_0xb27e('0x2d')](_0x54e58b,_0x33d1a7,!![]);}catch(_0x14f2b5){return BPromise[_0xb27e('0x2e')](_0x14f2b5);}return _0x54e58b[_0xb27e('0x2f')]();};}function saveUpdates(_0x26e55a,_0x2267d1){return function(_0x5ee1fe){if(_0x5ee1fe){return _0x5ee1fe[_0xb27e('0x30')](_0x26e55a)['then'](function(_0x7da214){return _0x7da214;});}return null;};}function removeEntity(_0x4b7b80,_0x2e48bc){return function(_0x49e9e1){if(_0x49e9e1){return _0x49e9e1[_0xb27e('0x31')]()[_0xb27e('0x1d')](function(){_0x4b7b80['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3445af,_0x5b9a39){return function(_0x5aafce){if(!_0x5aafce){_0x3445af['sendStatus'](0x194);}return _0x5aafce;};}function handleError(_0x1b3a3b,_0xe91c7d){_0xe91c7d=_0xe91c7d||0x1f4;return function(_0x583414){logger[_0xb27e('0x22')](_0x583414[_0xb27e('0x32')]);if(_0x583414['name']){delete _0x583414['name'];}_0x1b3a3b[_0xb27e('0x26')](_0xe91c7d)['send'](_0x583414);};}exports[_0xb27e('0x33')]=function(_0x551038,_0x127a76){var _0x6b9139={},_0x564619={},_0xaaafde={'count':0x0,'rows':[]};var _0x36c3b2=_[_0xb27e('0x34')](db[_0xb27e('0x35')][_0xb27e('0x36')],function(_0x533343){return{'name':_0x533343[_0xb27e('0x37')],'type':_0x533343[_0xb27e('0x38')][_0xb27e('0x39')]};});_0x564619[_0xb27e('0x3a')]=_[_0xb27e('0x34')](_0x36c3b2,'name');_0x564619['query']=_[_0xb27e('0x3b')](_0x551038[_0xb27e('0x3c')]);_0x564619[_0xb27e('0x3d')]=_['intersection'](_0x564619[_0xb27e('0x3a')],_0x564619[_0xb27e('0x3c')]);_0x6b9139[_0xb27e('0x3e')]=_[_0xb27e('0x3f')](_0x564619[_0xb27e('0x3a')],qs[_0xb27e('0x40')](_0x551038[_0xb27e('0x3c')]['fields']));_0x6b9139['attributes']=_0x6b9139[_0xb27e('0x3e')][_0xb27e('0x41')]?_0x6b9139[_0xb27e('0x3e')]:_0x564619[_0xb27e('0x3a')];if(!_0x551038[_0xb27e('0x3c')][_0xb27e('0x42')](_0xb27e('0x43'))){_0x6b9139[_0xb27e('0x29')]=qs['limit'](_0x551038[_0xb27e('0x3c')][_0xb27e('0x29')]);_0x6b9139[_0xb27e('0x2a')]=qs[_0xb27e('0x2a')](_0x551038['query'][_0xb27e('0x2a')]);}_0x6b9139['order']=qs['sort'](_0x551038[_0xb27e('0x3c')][_0xb27e('0x44')]);_0x6b9139['where']=qs[_0xb27e('0x3d')](_[_0xb27e('0x45')](_0x551038[_0xb27e('0x3c')],_0x564619[_0xb27e('0x3d')]),_0x36c3b2);if(_0x551038[_0xb27e('0x3c')][_0xb27e('0x46')]){_0x6b9139[_0xb27e('0x47')]=_['merge'](_0x6b9139[_0xb27e('0x47')],{'$or':_['map'](_0x36c3b2,function(_0x7488f6){if(_0x7488f6[_0xb27e('0x38')]!==_0xb27e('0x48')){var _0x269e45={};_0x269e45[_0x7488f6[_0xb27e('0x49')]]={'$like':'%'+_0x551038[_0xb27e('0x3c')]['filter']+'%'};return _0x269e45;}})});}_0x6b9139=_['merge']({},_0x6b9139,_0x551038[_0xb27e('0x4a')]);var _0x26a005={'where':_0x6b9139[_0xb27e('0x47')]};return db[_0xb27e('0x35')][_0xb27e('0x2b')](_0x26a005)['then'](function(_0x2fca54){_0xaaafde[_0xb27e('0x2b')]=_0x2fca54;if(_0x551038[_0xb27e('0x3c')][_0xb27e('0x4b')]){_0x6b9139[_0xb27e('0x4c')]=[{'all':!![]}];}return db[_0xb27e('0x35')][_0xb27e('0x4d')](_0x6b9139);})[_0xb27e('0x1d')](function(_0x22158a){_0xaaafde[_0xb27e('0x4e')]=_0x22158a;return _0xaaafde;})[_0xb27e('0x1d')](respondWithFilteredResult(_0x127a76,_0x6b9139))['catch'](handleError(_0x127a76,null));};exports[_0xb27e('0x4f')]=function(_0x4a3286,_0x18bb5c){var _0x1548bb={'raw':!![],'where':{'id':_0x4a3286[_0xb27e('0x50')]['id']}},_0x25ee57={};_0x25ee57[_0xb27e('0x3a')]=_[_0xb27e('0x3b')](db[_0xb27e('0x35')][_0xb27e('0x36')]);_0x25ee57['query']=_['keys'](_0x4a3286[_0xb27e('0x3c')]);_0x25ee57[_0xb27e('0x3d')]=_[_0xb27e('0x3f')](_0x25ee57['model'],_0x25ee57[_0xb27e('0x3c')]);_0x1548bb['attributes']=_[_0xb27e('0x3f')](_0x25ee57[_0xb27e('0x3a')],qs[_0xb27e('0x40')](_0x4a3286['query'][_0xb27e('0x40')]));_0x1548bb['attributes']=_0x1548bb[_0xb27e('0x3e')][_0xb27e('0x41')]?_0x1548bb[_0xb27e('0x3e')]:_0x25ee57[_0xb27e('0x3a')];if(_0x4a3286['query'][_0xb27e('0x4b')]){_0x1548bb[_0xb27e('0x4c')]=[{'all':!![]}];}_0x1548bb=_[_0xb27e('0x51')]({},_0x1548bb,_0x4a3286[_0xb27e('0x4a')]);return db[_0xb27e('0x35')][_0xb27e('0x52')](_0x1548bb)[_0xb27e('0x1d')](handleEntityNotFound(_0x18bb5c,null))[_0xb27e('0x1d')](respondWithResult(_0x18bb5c,null))[_0xb27e('0x25')](handleError(_0x18bb5c,null));};exports['create']=function(_0x1ae21d,_0x4a9b1a){return db['SmsMessage'][_0xb27e('0x53')](_0x1ae21d[_0xb27e('0x54')],{})[_0xb27e('0x1d')](respondWithResult(_0x4a9b1a,0xc9))[_0xb27e('0x25')](handleError(_0x4a9b1a,null));};exports[_0xb27e('0x30')]=function(_0x53e563,_0x53273a){if(_0x53e563[_0xb27e('0x54')]['id']){delete _0x53e563[_0xb27e('0x54')]['id'];}return db[_0xb27e('0x35')][_0xb27e('0x52')]({'where':{'id':_0x53e563[_0xb27e('0x50')]['id']}})[_0xb27e('0x1d')](handleEntityNotFound(_0x53273a,null))[_0xb27e('0x1d')](saveUpdates(_0x53e563[_0xb27e('0x54')],null))['then'](respondWithResult(_0x53273a,null))[_0xb27e('0x25')](handleError(_0x53273a,null));};exports[_0xb27e('0x31')]=function(_0x5910b0,_0x2a5f8b){return db[_0xb27e('0x35')][_0xb27e('0x52')]({'where':{'id':_0x5910b0[_0xb27e('0x50')]['id']}})[_0xb27e('0x1d')](handleEntityNotFound(_0x2a5f8b,null))[_0xb27e('0x1d')](removeEntity(_0x2a5f8b,null))[_0xb27e('0x25')](handleError(_0x2a5f8b,null));};exports[_0xb27e('0x55')]=function(_0x4a1e44,_0x390c7c){return db[_0xb27e('0x35')][_0xb27e('0x55')]()['then'](respondWithResult(_0x390c7c,null))[_0xb27e('0x25')](handleError(_0x390c7c,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xb27e('0x56')]=function(_0x120f11,_0x75ba47,_0x3732b1){var _0x1df744={'agent':{},'channel':'sms'};if(_0x120f11[_0xb27e('0x54')]['id']){delete _0x120f11[_0xb27e('0x54')]['id'];}_0x120f11[_0xb27e('0x54')][_0xb27e('0x57')]=!![];_0x120f11['body'][_0xb27e('0x58')]=moment()[_0xb27e('0x59')](_0xb27e('0x5a'));_0x120f11[_0xb27e('0x54')][_0xb27e('0x5b')]=_0x120f11['body'][_0xb27e('0x5b')]||_0x120f11[_0xb27e('0x5c')]['id'];_0x1df744['agent']['id']=_0x120f11[_0xb27e('0x54')][_0xb27e('0x5b')];return db['SmsMessage'][_0xb27e('0x52')]({'where':{'id':_0x120f11[_0xb27e('0x50')]['id'],'UserId':null}})[_0xb27e('0x1d')](handleEntityNotFound(_0x75ba47,null))['then'](saveUpdates(_0x120f11[_0xb27e('0x54')],null))['then'](function(_0x2a6212){if(_0x2a6212){_0x1df744['message']=_0x2a6212[_0xb27e('0x5d')]({'plain':!![]});return db[_0xb27e('0x5e')][_0xb27e('0x52')]({'where':{'id':_0x2a6212[_0xb27e('0x5f')]}});}return null;})[_0xb27e('0x1d')](handleEntityNotFound(_0x75ba47,null))[_0xb27e('0x1d')](function(_0x3a23bb){if(_0x3a23bb){return _0x3a23bb[_0xb27e('0x30')]({'UserId':_0x120f11['body'][_0xb27e('0x5b')],'read1stAt':_['isNil'](_0x3a23bb[_0xb27e('0x60')])?moment()['format'](_0xb27e('0x5a')):undefined});}return null;})[_0xb27e('0x1d')](function(_0xb0a15c){if(_0xb0a15c){_0x1df744[_0xb27e('0x61')]=_0xb0a15c[_0xb27e('0x5d')]({'plain':!![]});interaction_log[_0xb27e('0x1e')](_0xb27e('0x62'),_0x120f11[_0xb27e('0x5c')]['id'],_0x120f11['user'][_0xb27e('0x49')],_0x120f11[_0xb27e('0x5c')][_0xb27e('0x63')],_0x1df744[_0xb27e('0x61')]['id'],_0x120f11[_0xb27e('0x54')]?JSON[_0xb27e('0x64')](_0x120f11[_0xb27e('0x54')]):_0xb27e('0x65'));return respondWithRpcPromise(_0xb27e('0x66'),_0xb27e('0x67'),_0x1df744);}return null;})[_0xb27e('0x1d')](function(_0x2f81b6){var _0x39bac7=_0xb27e('0x68')+_0x2f81b6[_0xb27e('0x23')][_0xb27e('0x69')];return db[_0xb27e('0x6a')][_0xb27e('0x3c')](_0x39bac7,{'type':db['Sequelize'][_0xb27e('0x6b')][_0xb27e('0x6c')],'raw':!![]})[_0xb27e('0x1d')](function(_0x488716){return _0x488716;});})[_0xb27e('0x1d')](function(_0x51a2e1){if(_0x51a2e1){_0x1df744[_0xb27e('0x23')]['contact']=_0x51a2e1[0x0];if(!_0x120f11[_0xb27e('0x54')][_0xb27e('0x5b')])return;return db[_0xb27e('0x6d')][_0xb27e('0x52')]({'where':{'id':_0x120f11[_0xb27e('0x54')][_0xb27e('0x5b')],'role':'agent'},'attributes':['id',_0xb27e('0x49'),'fullname',_0xb27e('0x6e'),'internal'],'raw':!![]});}return null;})[_0xb27e('0x1d')](function(_0xc71cca){if(!_0xc71cca)return null;_0x1df744[_0xb27e('0x23')]['agent']=_0xc71cca;return _0x1df744;})[_0xb27e('0x1d')](function(_0x28b9e5){if(_0x28b9e5){if(_0x120f11[_0xb27e('0x54')]['manual']){_0x1df744[_0xb27e('0x23')][_0xb27e('0x6f')]=util[_0xb27e('0x59')](_0xb27e('0x70'),_0x120f11['user']['name']);_0x1df744[_0xb27e('0x23')][_0xb27e('0x71')]=_0x1df744[_0xb27e('0x71')];_0x1df744[_0xb27e('0x23')][_0xb27e('0x72')]=_0x1df744['channel'];_0x1df744[_0xb27e('0x23')][_0xb27e('0x73')]=_0xb27e('0x56');return respondWithRpcPromise(_0xb27e('0x74'),_0xb27e('0x74'),{'event':_0xb27e('0x75'),'message':_0x1df744[_0xb27e('0x23')]},client9002)[_0xb27e('0x1d')](function(){return _0x1df744;});}return _0x1df744;}return null;})[_0xb27e('0x1d')](respondWithResult(_0x75ba47,null))[_0xb27e('0x25')](handleError(_0x75ba47,null));};var interaction_log=require('../../config/logger')(_0xb27e('0x76'));exports['reject']=function(_0x17b640,_0x2a6641,_0x7ee0cc){var _0x52b02c={'agent':{},'channel':_0xb27e('0x77')};if(_0x17b640[_0xb27e('0x54')]['id']){delete _0x17b640[_0xb27e('0x54')]['id'];}_0x17b640[_0xb27e('0x54')][_0xb27e('0x5b')]=_0x17b640[_0xb27e('0x54')][_0xb27e('0x5b')]||_0x17b640[_0xb27e('0x5c')]['id'];_0x52b02c[_0xb27e('0x78')]['id']=_0x17b640[_0xb27e('0x54')][_0xb27e('0x5b')];return db[_0xb27e('0x35')][_0xb27e('0x52')]({'where':{'id':_0x17b640[_0xb27e('0x50')]['id'],'UserId':null}})[_0xb27e('0x1d')](handleEntityNotFound(_0x2a6641,null))['then'](function(_0x17d597){if(_0x17d597){_0x52b02c[_0xb27e('0x23')]=_0x17d597[_0xb27e('0x5d')]({'plain':!![]});return db[_0xb27e('0x5e')][_0xb27e('0x52')]({'where':{'id':_0x17d597[_0xb27e('0x5f')]}});}return null;})[_0xb27e('0x1d')](handleEntityNotFound(_0x2a6641,null))[_0xb27e('0x1d')](function(_0x57ba5b){if(_0x57ba5b){_0x52b02c[_0xb27e('0x61')]=_0x57ba5b['get']({'plain':!![]});interaction_log[_0xb27e('0x1e')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x17b640['user']['id'],_0x17b640[_0xb27e('0x5c')][_0xb27e('0x49')],_0x17b640[_0xb27e('0x5c')][_0xb27e('0x63')],_0x52b02c[_0xb27e('0x61')]['id'],_0x17b640[_0xb27e('0x54')]?JSON['stringify'](_0x17b640[_0xb27e('0x54')]):_0xb27e('0x65'));return respondWithRpcPromise('RejectMessage',_0xb27e('0x79'),_0x52b02c);}return null;})['then'](function(_0x2b8afb){var _0x4ea881='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b8afb[_0xb27e('0x23')][_0xb27e('0x69')];return db['sequelize'][_0xb27e('0x3c')](_0x4ea881,{'type':db[_0xb27e('0x7a')][_0xb27e('0x6b')][_0xb27e('0x6c')],'raw':!![]})['then'](function(_0x668937){return _0x668937;});})[_0xb27e('0x1d')](function(_0x27ed73){if(_0x27ed73){_0x52b02c[_0xb27e('0x23')][_0xb27e('0x7b')]=_0x27ed73[0x0];if(!_0x17b640[_0xb27e('0x54')]['UserId'])return;return db['User']['find']({'where':{'id':_0x17b640[_0xb27e('0x54')][_0xb27e('0x5b')],'role':_0xb27e('0x78')},'attributes':['id',_0xb27e('0x49'),_0xb27e('0x7c'),_0xb27e('0x6e'),_0xb27e('0x7d')],'raw':!![]});}return null;})[_0xb27e('0x1d')](function(_0x5ea652){if(!_0x5ea652)return null;_0x52b02c[_0xb27e('0x23')][_0xb27e('0x78')]=_0x5ea652;return _0x52b02c;})['then'](function(_0x18da6a){if(_0x18da6a){_0x18da6a[_0xb27e('0x23')][_0xb27e('0x6f')]=util[_0xb27e('0x59')](_0xb27e('0x70'),_0x17b640[_0xb27e('0x5c')][_0xb27e('0x49')]);_0x18da6a[_0xb27e('0x23')][_0xb27e('0x71')]=_0x52b02c['channel'];_0x18da6a[_0xb27e('0x23')][_0xb27e('0x72')]=_0x52b02c[_0xb27e('0x71')];_0x18da6a['message'][_0xb27e('0x73')]=_0xb27e('0x2e');respondWithRpcPromise(_0xb27e('0x74'),_0xb27e('0x74'),{'event':_0xb27e('0x7e'),'message':_0x18da6a[_0xb27e('0x23')]},client9002);return _0x52b02c;}return null;})[_0xb27e('0x1d')](respondWithResult(_0x2a6641,null))[_0xb27e('0x25')](handleError(_0x2a6641,null));};exports['status']=function(_0x2a626f,_0x55df43,_0x2d171b){if(_0x2a626f[_0xb27e('0x54')]['id']){delete _0x2a626f[_0xb27e('0x54')]['id'];}var _0xff249d;return db[_0xb27e('0x35')][_0xb27e('0x52')]({'where':{'id':_0x2a626f['params']['id']}})['then'](handleEntityNotFound(_0x55df43,null))['then'](function(_0xf309f7){if(_0xf309f7){_0xff249d=_0xf309f7;return db[_0xb27e('0x7f')]['find']({'where':{'id':_0xf309f7[_0xb27e('0x80')]}});}})[_0xb27e('0x1d')](handleEntityNotFound(_0x55df43,null))['then'](function(_0x3ab76c){if(_0x3ab76c){logger[_0xb27e('0x81')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb27e('0x26'),_0xb27e('0x82'),_0x3ab76c[_0xb27e('0x38')],util[_0xb27e('0x83')](_0x2a626f[_0xb27e('0x54')],{'showHidden':![],'depth':null}));switch(_0x3ab76c['type']){case'twilio':if(_0x2a626f[_0xb27e('0x54')][_0xb27e('0x84')]&&_0x2a626f[_0xb27e('0x54')][_0xb27e('0x84')]===_0xff249d[_0xb27e('0x85')]){return _0xff249d[_0xb27e('0x30')]({'read':!![]});}else{logger['error'](_0xb27e('0x86'),_0xb27e('0x26'),'twilio',util[_0xb27e('0x83')](_0x2a626f[_0xb27e('0x54')],{'showHidden':![],'depth':null}));}break;case _0xb27e('0x87'):if(_0x2a626f['body'][_0xb27e('0x88')]&&_0x2a626f[_0xb27e('0x54')][_0xb27e('0x88')]===_0xff249d[_0xb27e('0x85')]&&_[_0xb27e('0x89')]([_0xb27e('0x8a'),_0xb27e('0x8b')],_0x2a626f[_0xb27e('0x54')][_0xb27e('0x8c')])>=0x0){return _0xff249d[_0xb27e('0x30')]({'read':!![]});}else{logger[_0xb27e('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb27e('0x26'),'plivio',util[_0xb27e('0x83')](_0x2a626f[_0xb27e('0x54')],{'showHidden':![],'depth':null}));}break;case _0xb27e('0x8d'):var _0x1014cc=_0x2a626f[_0xb27e('0x54')]['results'][0x0];if(_0x1014cc[_0xb27e('0x26')][_0xb27e('0x8e')]===_0xb27e('0x8f')){return _0xff249d[_0xb27e('0x30')]({'read':!![]});}else{logger[_0xb27e('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb27e('0x26'),_0xb27e('0x8d'),util[_0xb27e('0x83')](_0x2a626f[_0xb27e('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xff249d;}})[_0xb27e('0x1d')](respondWithResult(_0x55df43,null))[_0xb27e('0x25')](handleError(_0x55df43,null));}; \ No newline at end of file +var _0xc5b3=['motionChannel','event','EventManager','../../config/logger','reject','sms','RejectMessage','rejectMessage','ContactId','sequelize','fullname','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','count','set','apply','save','update','then','destroy','end','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','include','catch','create','body','find','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','SIP/%s','channel'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xc5b3[_0x4c260a];return _0x17bbdd;};'use strict';var emlformat=require(_0x3c5b('0x0'));var rimraf=require(_0x3c5b('0x1'));var zipdir=require(_0x3c5b('0x2'));var jsonpatch=require(_0x3c5b('0x3'));var rp=require(_0x3c5b('0x4'));var moment=require(_0x3c5b('0x5'));var BPromise=require(_0x3c5b('0x6'));var Mustache=require(_0x3c5b('0x7'));var util=require('util');var path=require(_0x3c5b('0x8'));var sox=require(_0x3c5b('0x9'));var csv=require('to-csv');var ejs=require(_0x3c5b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c5b('0xb'));var squel=require(_0x3c5b('0xc'));var crypto=require(_0x3c5b('0xd'));var jsforce=require(_0x3c5b('0xe'));var deskjs=require(_0x3c5b('0xf'));var toCsv=require(_0x3c5b('0x10'));var querystring=require(_0x3c5b('0x11'));var Papa=require('papaparse');var Redis=require(_0x3c5b('0x12'));var authService=require(_0x3c5b('0x13'));var qs=require(_0x3c5b('0x14'));var as=require(_0x3c5b('0x15'));var hardwareService=require(_0x3c5b('0x16'));var logger=require('../../config/logger')(_0x3c5b('0x17'));var utils=require(_0x3c5b('0x18'));var config=require(_0x3c5b('0x19'));var licenseUtil=require(_0x3c5b('0x1a'));var db=require(_0x3c5b('0x1b'))['db'];config[_0x3c5b('0x1c')]=_[_0x3c5b('0x1d')](config['redis'],{'host':_0x3c5b('0x1e'),'port':0x18eb});var socket=require(_0x3c5b('0x1f'))(new Redis(config[_0x3c5b('0x1c')]));require(_0x3c5b('0x20'))['register'](socket);var jayson=require(_0x3c5b('0x21'));var client=jayson['client'][_0x3c5b('0x22')]({'port':0x232c});var client9002=jayson[_0x3c5b('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b1d45,_0x88069a,_0x5d64cb,_0x32c58e){return new BPromise(function(_0x1cbe52,_0x249642){var _0x5bc3e3=_0x32c58e||client;return _0x5bc3e3[_0x3c5b('0x24')](_0x2b1d45,_0x5d64cb)['then'](function(_0x40fe47){logger[_0x3c5b('0x25')](_0x3c5b('0x26'),_0x88069a,_0x3c5b('0x27'));logger[_0x3c5b('0x28')](_0x3c5b('0x29'),_0x88069a,'request\x20sent',JSON['stringify'](_0x40fe47));if(_0x40fe47[_0x3c5b('0x2a')]){if(_0x40fe47['error'][_0x3c5b('0x2b')]===0x1f4){logger[_0x3c5b('0x2a')](_0x3c5b('0x26'),_0x88069a,_0x40fe47['error'][_0x3c5b('0x2c')]);return _0x249642(_0x40fe47['error'][_0x3c5b('0x2c')]);}logger[_0x3c5b('0x2a')](_0x3c5b('0x26'),_0x88069a,_0x40fe47[_0x3c5b('0x2a')][_0x3c5b('0x2c')]);return _0x1cbe52(_0x40fe47[_0x3c5b('0x2a')][_0x3c5b('0x2c')]);}else{logger[_0x3c5b('0x25')]('SmsMessage,\x20%s,\x20%s',_0x88069a,_0x3c5b('0x27'));_0x1cbe52(_0x40fe47[_0x3c5b('0x2d')][_0x3c5b('0x2c')]);}})['catch'](function(_0x12e81a){logger['error']('SmsMessage,\x20%s,\x20%s',_0x88069a,_0x12e81a);_0x249642(_0x12e81a);});});}function respondWithStatusCode(_0x5a78c9,_0x4de3fa){_0x4de3fa=_0x4de3fa||0xcc;return function(_0x23503b){if(_0x23503b){return _0x5a78c9[_0x3c5b('0x2e')](_0x4de3fa);}return _0x5a78c9[_0x3c5b('0x2f')](_0x4de3fa)['end']();};}function respondWithResult(_0x155ae6,_0x5c7fc2){_0x5c7fc2=_0x5c7fc2||0xc8;return function(_0x3548e9){if(_0x3548e9){return _0x155ae6[_0x3c5b('0x2f')](_0x5c7fc2)[_0x3c5b('0x30')](_0x3548e9);}};}function respondWithFilteredResult(_0x38b947,_0x12440e){return function(_0x42c5e1){if(_0x42c5e1){var _0x37cd2f=typeof _0x12440e[_0x3c5b('0x31')]===_0x3c5b('0x32')&&typeof _0x12440e['limit']===_0x3c5b('0x32');var _0x217022=_0x42c5e1[_0x3c5b('0x33')];var _0x410ebf=_0x37cd2f?0x0:_0x12440e[_0x3c5b('0x31')];var _0x1c686a=_0x37cd2f?_0x42c5e1[_0x3c5b('0x33')]:_0x12440e[_0x3c5b('0x31')]+_0x12440e['limit'];var _0x5ac5c2;if(_0x1c686a>=_0x217022){_0x1c686a=_0x217022;_0x5ac5c2=0xc8;}else{_0x5ac5c2=0xce;}_0x38b947[_0x3c5b('0x2f')](_0x5ac5c2);return _0x38b947[_0x3c5b('0x34')]('Content-Range',_0x410ebf+'-'+_0x1c686a+'/'+_0x217022)[_0x3c5b('0x30')](_0x42c5e1);}return null;};}function patchUpdates(_0x1e2773){return function(_0x52a50b){try{jsonpatch[_0x3c5b('0x35')](_0x52a50b,_0x1e2773,!![]);}catch(_0x426363){return BPromise['reject'](_0x426363);}return _0x52a50b[_0x3c5b('0x36')]();};}function saveUpdates(_0x275d32,_0x388acd){return function(_0x3031d5){if(_0x3031d5){return _0x3031d5[_0x3c5b('0x37')](_0x275d32)[_0x3c5b('0x38')](function(_0x281e53){return _0x281e53;});}return null;};}function removeEntity(_0x3029b0,_0x382908){return function(_0x31a33c){if(_0x31a33c){return _0x31a33c[_0x3c5b('0x39')]()[_0x3c5b('0x38')](function(){_0x3029b0[_0x3c5b('0x2f')](0xcc)[_0x3c5b('0x3a')]();});}};}function handleEntityNotFound(_0x5c2c86,_0x3d9afc){return function(_0x37cc3f){if(!_0x37cc3f){_0x5c2c86[_0x3c5b('0x2e')](0x194);}return _0x37cc3f;};}function handleError(_0x561010,_0x4ebc4c){_0x4ebc4c=_0x4ebc4c||0x1f4;return function(_0x33b913){logger['error'](_0x33b913[_0x3c5b('0x3b')]);if(_0x33b913[_0x3c5b('0x3c')]){delete _0x33b913[_0x3c5b('0x3c')];}_0x561010[_0x3c5b('0x2f')](_0x4ebc4c)[_0x3c5b('0x3d')](_0x33b913);};}exports[_0x3c5b('0x3e')]=function(_0x24886d,_0x5c2674){var _0x4c16aa={},_0x49c18f={},_0x30a18e={'count':0x0,'rows':[]};var _0x4ed0d9=_[_0x3c5b('0x3f')](db[_0x3c5b('0x40')][_0x3c5b('0x41')],function(_0x4693c1){return{'name':_0x4693c1['fieldName'],'type':_0x4693c1[_0x3c5b('0x42')][_0x3c5b('0x43')]};});_0x49c18f[_0x3c5b('0x44')]=_['map'](_0x4ed0d9,'name');_0x49c18f[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x24886d[_0x3c5b('0x45')]);_0x49c18f[_0x3c5b('0x47')]=_[_0x3c5b('0x48')](_0x49c18f[_0x3c5b('0x44')],_0x49c18f['query']);_0x4c16aa['attributes']=_['intersection'](_0x49c18f[_0x3c5b('0x44')],qs[_0x3c5b('0x49')](_0x24886d[_0x3c5b('0x45')]['fields']));_0x4c16aa['attributes']=_0x4c16aa[_0x3c5b('0x4a')][_0x3c5b('0x4b')]?_0x4c16aa['attributes']:_0x49c18f[_0x3c5b('0x44')];if(!_0x24886d['query']['hasOwnProperty'](_0x3c5b('0x4c'))){_0x4c16aa[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4d')](_0x24886d[_0x3c5b('0x45')][_0x3c5b('0x4d')]);_0x4c16aa[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x24886d[_0x3c5b('0x45')][_0x3c5b('0x31')]);}_0x4c16aa[_0x3c5b('0x4e')]=qs[_0x3c5b('0x4f')](_0x24886d['query'][_0x3c5b('0x4f')]);_0x4c16aa['where']=qs[_0x3c5b('0x47')](_['pick'](_0x24886d[_0x3c5b('0x45')],_0x49c18f[_0x3c5b('0x47')]),_0x4ed0d9);if(_0x24886d[_0x3c5b('0x45')][_0x3c5b('0x50')]){_0x4c16aa[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x4c16aa[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x3f')](_0x4ed0d9,function(_0x50f138){if(_0x50f138[_0x3c5b('0x42')]!==_0x3c5b('0x53')){var _0xaa1592={};_0xaa1592[_0x50f138[_0x3c5b('0x3c')]]={'$like':'%'+_0x24886d['query'][_0x3c5b('0x50')]+'%'};return _0xaa1592;}})});}_0x4c16aa=_[_0x3c5b('0x52')]({},_0x4c16aa,_0x24886d[_0x3c5b('0x54')]);var _0x137919={'where':_0x4c16aa[_0x3c5b('0x51')]};return db[_0x3c5b('0x40')][_0x3c5b('0x33')](_0x137919)[_0x3c5b('0x38')](function(_0x36ff71){_0x30a18e[_0x3c5b('0x33')]=_0x36ff71;if(_0x24886d[_0x3c5b('0x45')][_0x3c5b('0x55')]){_0x4c16aa['include']=[{'all':!![]}];}return db['SmsMessage'][_0x3c5b('0x56')](_0x4c16aa);})[_0x3c5b('0x38')](function(_0xb6e9e){_0x30a18e['rows']=_0xb6e9e;return _0x30a18e;})[_0x3c5b('0x38')](respondWithFilteredResult(_0x5c2674,_0x4c16aa))['catch'](handleError(_0x5c2674,null));};exports[_0x3c5b('0x57')]=function(_0x1ec601,_0x5ec1a6){var _0x3807de={'raw':!![],'where':{'id':_0x1ec601[_0x3c5b('0x58')]['id']}},_0x7547f8={};_0x7547f8[_0x3c5b('0x44')]=_[_0x3c5b('0x46')](db[_0x3c5b('0x40')][_0x3c5b('0x41')]);_0x7547f8[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x1ec601[_0x3c5b('0x45')]);_0x7547f8[_0x3c5b('0x47')]=_[_0x3c5b('0x48')](_0x7547f8[_0x3c5b('0x44')],_0x7547f8['query']);_0x3807de[_0x3c5b('0x4a')]=_['intersection'](_0x7547f8[_0x3c5b('0x44')],qs[_0x3c5b('0x49')](_0x1ec601['query'][_0x3c5b('0x49')]));_0x3807de['attributes']=_0x3807de[_0x3c5b('0x4a')][_0x3c5b('0x4b')]?_0x3807de['attributes']:_0x7547f8[_0x3c5b('0x44')];if(_0x1ec601[_0x3c5b('0x45')]['includeAll']){_0x3807de[_0x3c5b('0x59')]=[{'all':!![]}];}_0x3807de=_[_0x3c5b('0x52')]({},_0x3807de,_0x1ec601[_0x3c5b('0x54')]);return db[_0x3c5b('0x40')]['find'](_0x3807de)[_0x3c5b('0x38')](handleEntityNotFound(_0x5ec1a6,null))[_0x3c5b('0x38')](respondWithResult(_0x5ec1a6,null))[_0x3c5b('0x5a')](handleError(_0x5ec1a6,null));};exports[_0x3c5b('0x5b')]=function(_0x365b4d,_0x46b647){return db[_0x3c5b('0x40')][_0x3c5b('0x5b')](_0x365b4d[_0x3c5b('0x5c')],{})[_0x3c5b('0x38')](respondWithResult(_0x46b647,0xc9))['catch'](handleError(_0x46b647,null));};exports[_0x3c5b('0x37')]=function(_0x174bb2,_0x12b28d){if(_0x174bb2[_0x3c5b('0x5c')]['id']){delete _0x174bb2['body']['id'];}return db[_0x3c5b('0x40')][_0x3c5b('0x5d')]({'where':{'id':_0x174bb2[_0x3c5b('0x58')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x12b28d,null))[_0x3c5b('0x38')](saveUpdates(_0x174bb2[_0x3c5b('0x5c')],null))[_0x3c5b('0x38')](respondWithResult(_0x12b28d,null))[_0x3c5b('0x5a')](handleError(_0x12b28d,null));};exports[_0x3c5b('0x39')]=function(_0x5454a9,_0x5c2667){return db[_0x3c5b('0x40')][_0x3c5b('0x5d')]({'where':{'id':_0x5454a9[_0x3c5b('0x58')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x5c2667,null))[_0x3c5b('0x38')](removeEntity(_0x5c2667,null))[_0x3c5b('0x5a')](handleError(_0x5c2667,null));};exports[_0x3c5b('0x5e')]=function(_0x281340,_0x338e2a){return db['SmsMessage'][_0x3c5b('0x5e')]()[_0x3c5b('0x38')](respondWithResult(_0x338e2a,null))['catch'](handleError(_0x338e2a,null));};var interaction_log=require('../../config/logger')(_0x3c5b('0x5f'));exports[_0x3c5b('0x60')]=function(_0x560f06,_0xa81213,_0x2838e4){var _0xf37db1={'agent':{},'channel':'sms'};if(_0x560f06[_0x3c5b('0x5c')]['id']){delete _0x560f06[_0x3c5b('0x5c')]['id'];}_0x560f06[_0x3c5b('0x5c')]['read']=!![];_0x560f06[_0x3c5b('0x5c')][_0x3c5b('0x61')]=moment()[_0x3c5b('0x62')](_0x3c5b('0x63'));_0x560f06[_0x3c5b('0x5c')][_0x3c5b('0x64')]=_0x560f06[_0x3c5b('0x5c')]['UserId']||_0x560f06['user']['id'];_0xf37db1['agent']['id']=_0x560f06[_0x3c5b('0x5c')][_0x3c5b('0x64')];return db[_0x3c5b('0x40')]['find']({'where':{'id':_0x560f06['params']['id'],'UserId':null}})[_0x3c5b('0x38')](handleEntityNotFound(_0xa81213,null))[_0x3c5b('0x38')](saveUpdates(_0x560f06[_0x3c5b('0x5c')],null))[_0x3c5b('0x38')](function(_0x2eb788){if(_0x2eb788){_0xf37db1['message']=_0x2eb788[_0x3c5b('0x65')]({'plain':!![]});return db[_0x3c5b('0x66')][_0x3c5b('0x5d')]({'where':{'id':_0x2eb788[_0x3c5b('0x67')]}});}return null;})[_0x3c5b('0x38')](handleEntityNotFound(_0xa81213,null))[_0x3c5b('0x38')](function(_0x2f3c53){if(_0x2f3c53){return _0x2f3c53[_0x3c5b('0x37')]({'UserId':_0x560f06[_0x3c5b('0x5c')][_0x3c5b('0x64')],'read1stAt':_['isNil'](_0x2f3c53[_0x3c5b('0x68')])?moment()[_0x3c5b('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x7ddd7d){if(_0x7ddd7d){_0xf37db1[_0x3c5b('0x69')]=_0x7ddd7d['get']({'plain':!![]});interaction_log['info'](_0x3c5b('0x6a'),_0x560f06['user']['id'],_0x560f06[_0x3c5b('0x6b')]['name'],_0x560f06[_0x3c5b('0x6b')][_0x3c5b('0x6c')],_0xf37db1['interaction']['id'],_0x560f06[_0x3c5b('0x5c')]?JSON[_0x3c5b('0x6d')](_0x560f06[_0x3c5b('0x5c')]):_0x3c5b('0x6e'));return respondWithRpcPromise(_0x3c5b('0x6f'),_0x3c5b('0x70'),_0xf37db1);}return null;})[_0x3c5b('0x38')](function(_0x5d67cc){var _0x17c76c=_0x3c5b('0x71')+_0x5d67cc[_0x3c5b('0x2c')]['ContactId'];return db['sequelize'][_0x3c5b('0x45')](_0x17c76c,{'type':db[_0x3c5b('0x72')][_0x3c5b('0x73')][_0x3c5b('0x74')],'raw':!![]})[_0x3c5b('0x38')](function(_0x55ec45){return _0x55ec45;});})[_0x3c5b('0x38')](function(_0x457e4c){if(_0x457e4c){_0xf37db1[_0x3c5b('0x2c')][_0x3c5b('0x75')]=_0x457e4c[0x0];if(!_0x560f06[_0x3c5b('0x5c')][_0x3c5b('0x64')])return;return db[_0x3c5b('0x76')][_0x3c5b('0x5d')]({'where':{'id':_0x560f06[_0x3c5b('0x5c')][_0x3c5b('0x64')],'role':_0x3c5b('0x77')},'attributes':['id',_0x3c5b('0x3c'),'fullname',_0x3c5b('0x78'),_0x3c5b('0x79')],'raw':!![]});}return null;})[_0x3c5b('0x38')](function(_0x561612){if(!_0x561612)return null;_0xf37db1[_0x3c5b('0x2c')][_0x3c5b('0x77')]=_0x561612;return _0xf37db1;})[_0x3c5b('0x38')](function(_0x369748){if(_0x369748){if(_0x560f06['body'][_0x3c5b('0x7a')]){_0xf37db1[_0x3c5b('0x2c')][_0x3c5b('0x7b')]=util['format'](_0x3c5b('0x7c'),_0x560f06[_0x3c5b('0x6b')][_0x3c5b('0x3c')]);_0xf37db1[_0x3c5b('0x2c')][_0x3c5b('0x7d')]=_0xf37db1['channel'];_0xf37db1['message'][_0x3c5b('0x7e')]=_0xf37db1[_0x3c5b('0x7d')];_0xf37db1[_0x3c5b('0x2c')][_0x3c5b('0x7f')]=_0x3c5b('0x60');return respondWithRpcPromise(_0x3c5b('0x80'),_0x3c5b('0x80'),{'event':'acceptmessage','message':_0xf37db1[_0x3c5b('0x2c')]},client9002)[_0x3c5b('0x38')](function(){return _0xf37db1;});}return _0xf37db1;}return null;})[_0x3c5b('0x38')](respondWithResult(_0xa81213,null))[_0x3c5b('0x5a')](handleError(_0xa81213,null));};var interaction_log=require(_0x3c5b('0x81'))(_0x3c5b('0x5f'));exports[_0x3c5b('0x82')]=function(_0x3923d8,_0x111833,_0x1e2f68){var _0x4b99f5={'agent':{},'channel':_0x3c5b('0x83')};if(_0x3923d8[_0x3c5b('0x5c')]['id']){delete _0x3923d8[_0x3c5b('0x5c')]['id'];}_0x3923d8[_0x3c5b('0x5c')][_0x3c5b('0x64')]=_0x3923d8['body'][_0x3c5b('0x64')]||_0x3923d8[_0x3c5b('0x6b')]['id'];_0x4b99f5[_0x3c5b('0x77')]['id']=_0x3923d8[_0x3c5b('0x5c')][_0x3c5b('0x64')];return db['SmsMessage']['find']({'where':{'id':_0x3923d8[_0x3c5b('0x58')]['id'],'UserId':null}})[_0x3c5b('0x38')](handleEntityNotFound(_0x111833,null))[_0x3c5b('0x38')](function(_0x831af8){if(_0x831af8){_0x4b99f5[_0x3c5b('0x2c')]=_0x831af8[_0x3c5b('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x3c5b('0x5d')]({'where':{'id':_0x831af8['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x111833,null))[_0x3c5b('0x38')](function(_0x53f979){if(_0x53f979){_0x4b99f5[_0x3c5b('0x69')]=_0x53f979['get']({'plain':!![]});interaction_log[_0x3c5b('0x25')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3923d8[_0x3c5b('0x6b')]['id'],_0x3923d8['user']['name'],_0x3923d8[_0x3c5b('0x6b')][_0x3c5b('0x6c')],_0x4b99f5['interaction']['id'],_0x3923d8[_0x3c5b('0x5c')]?JSON[_0x3c5b('0x6d')](_0x3923d8[_0x3c5b('0x5c')]):'null');return respondWithRpcPromise(_0x3c5b('0x84'),_0x3c5b('0x85'),_0x4b99f5);}return null;})[_0x3c5b('0x38')](function(_0xd5fcd5){var _0x26a991=_0x3c5b('0x71')+_0xd5fcd5[_0x3c5b('0x2c')][_0x3c5b('0x86')];return db[_0x3c5b('0x87')][_0x3c5b('0x45')](_0x26a991,{'type':db['Sequelize'][_0x3c5b('0x73')][_0x3c5b('0x74')],'raw':!![]})[_0x3c5b('0x38')](function(_0x2660c6){return _0x2660c6;});})['then'](function(_0x4a59c7){if(_0x4a59c7){_0x4b99f5['message'][_0x3c5b('0x75')]=_0x4a59c7[0x0];if(!_0x3923d8[_0x3c5b('0x5c')]['UserId'])return;return db[_0x3c5b('0x76')][_0x3c5b('0x5d')]({'where':{'id':_0x3923d8[_0x3c5b('0x5c')][_0x3c5b('0x64')],'role':_0x3c5b('0x77')},'attributes':['id',_0x3c5b('0x3c'),_0x3c5b('0x88'),'email',_0x3c5b('0x79')],'raw':!![]});}return null;})[_0x3c5b('0x38')](function(_0x3aef91){if(!_0x3aef91)return null;_0x4b99f5['message']['agent']=_0x3aef91;return _0x4b99f5;})[_0x3c5b('0x38')](function(_0x318f05){if(_0x318f05){_0x318f05['message']['interface']=util[_0x3c5b('0x62')]('SIP/%s',_0x3923d8[_0x3c5b('0x6b')][_0x3c5b('0x3c')]);_0x318f05[_0x3c5b('0x2c')][_0x3c5b('0x7d')]=_0x4b99f5[_0x3c5b('0x7d')];_0x318f05[_0x3c5b('0x2c')]['motionChannel']=_0x4b99f5['channel'];_0x318f05['message'][_0x3c5b('0x7f')]=_0x3c5b('0x82');respondWithRpcPromise(_0x3c5b('0x80'),'EventManager',{'event':_0x3c5b('0x89'),'message':_0x318f05['message']},client9002);return _0x4b99f5;}return null;})['then'](respondWithResult(_0x111833,null))[_0x3c5b('0x5a')](handleError(_0x111833,null));};exports[_0x3c5b('0x2f')]=function(_0x140dea,_0x2f9a30,_0x39609f){if(_0x140dea[_0x3c5b('0x5c')]['id']){delete _0x140dea['body']['id'];}var _0x371860;return db[_0x3c5b('0x40')][_0x3c5b('0x5d')]({'where':{'id':_0x140dea[_0x3c5b('0x58')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x2f9a30,null))[_0x3c5b('0x38')](function(_0x5aa399){if(_0x5aa399){_0x371860=_0x5aa399;return db[_0x3c5b('0x8a')][_0x3c5b('0x5d')]({'where':{'id':_0x5aa399[_0x3c5b('0x8b')]}});}})['then'](handleEntityNotFound(_0x2f9a30,null))['then'](function(_0x48da6d){if(_0x48da6d){logger[_0x3c5b('0x28')](_0x3c5b('0x29'),_0x3c5b('0x2f'),_0x3c5b('0x8c'),_0x48da6d[_0x3c5b('0x42')],util[_0x3c5b('0x8d')](_0x140dea['body'],{'showHidden':![],'depth':null}));switch(_0x48da6d[_0x3c5b('0x42')]){case _0x3c5b('0x8e'):if(_0x140dea[_0x3c5b('0x5c')][_0x3c5b('0x8f')]&&_0x140dea[_0x3c5b('0x5c')][_0x3c5b('0x8f')]===_0x371860[_0x3c5b('0x90')]){return _0x371860[_0x3c5b('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3c5b('0x2f'),'twilio',util[_0x3c5b('0x8d')](_0x140dea[_0x3c5b('0x5c')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x140dea[_0x3c5b('0x5c')][_0x3c5b('0x91')]&&_0x140dea[_0x3c5b('0x5c')][_0x3c5b('0x91')]===_0x371860['messageId']&&_[_0x3c5b('0x92')]([_0x3c5b('0x93'),'delivered'],_0x140dea[_0x3c5b('0x5c')][_0x3c5b('0x94')])>=0x0){return _0x371860[_0x3c5b('0x37')]({'read':!![]});}else{logger['error'](_0x3c5b('0x95'),_0x3c5b('0x2f'),_0x3c5b('0x96'),util[_0x3c5b('0x8d')](_0x140dea[_0x3c5b('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x3c5b('0x97'):var _0x1cf699=_0x140dea['body'][_0x3c5b('0x98')][0x0];if(_0x1cf699['status'][_0x3c5b('0x99')]===_0x3c5b('0x9a')){return _0x371860[_0x3c5b('0x37')]({'read':!![]});}else{logger[_0x3c5b('0x2a')](_0x3c5b('0x95'),_0x3c5b('0x2f'),_0x3c5b('0x97'),util[_0x3c5b('0x8d')](_0x140dea['body'],{'showHidden':![],'depth':null}));}break;}return _0x371860;}})[_0x3c5b('0x38')](respondWithResult(_0x2f9a30,null))[_0x3c5b('0x5a')](handleError(_0x2f9a30,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 18f30a1..6d11b39 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 _0xe6a8=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','emit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe6a8,0xa5));var _0x8e6a=function(_0x5c548e,_0x143082){_0x5c548e=_0x5c548e-0x0;var _0x22a3ec=_0xe6a8[_0x5c548e];return _0x22a3ec;};'use strict';var EventEmitter=require(_0x8e6a('0x0'));var SmsMessage=require(_0x8e6a('0x1'))['db'][_0x8e6a('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8e6a('0x3')](0x0);var events={'afterCreate':_0x8e6a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c3b38){return function(_0x4840d3,_0x147130,_0x2dbd6e){SmsMessageEvents[_0x8e6a('0x5')](_0x1c3b38+':'+_0x4840d3['id'],_0x4840d3);SmsMessageEvents[_0x8e6a('0x5')](_0x1c3b38,_0x4840d3);_0x2dbd6e(null);};}for(var e in events){if(events[_0x8e6a('0x6')](e)){var event=events[e];SmsMessage[_0x8e6a('0x7')](e,emitEvent(event));}}module[_0x8e6a('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x0c3e=['emit','hasOwnProperty','hook','exports','SmsMessage','save','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0c3e,0xd6));var _0xe0c3=function(_0x5934a1,_0x60fdc0){_0x5934a1=_0x5934a1-0x0;var _0x18bd41=_0x0c3e[_0x5934a1];return _0x18bd41;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0xe0c3('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0c3('0x1'),'afterUpdate':'update','afterDestroy':_0xe0c3('0x2')};function emitEvent(_0x45375a){return function(_0x4440d8,_0x27879a,_0x3e2525){SmsMessageEvents[_0xe0c3('0x3')](_0x45375a+':'+_0x4440d8['id'],_0x4440d8);SmsMessageEvents['emit'](_0x45375a,_0x4440d8);_0x3e2525(null);};}for(var e in events){if(events[_0xe0c3('0x4')](e)){var event=events[e];SmsMessage[_0xe0c3('0x5')](e,emitEvent(event));}}module[_0xe0c3('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7e205d4..5a98c6f 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 _0xe739=['https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','Bearer\x20','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','intelepeer','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','get','direction','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','toLowerCase','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','remote','/status?token=','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','toString','base64','http_code','queued_count','head','data','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','%s:%s'];(function(_0x48c38e,_0x3e50dd){var _0x2eae9f=function(_0x1a63db){while(--_0x1a63db){_0x48c38e['push'](_0x48c38e['shift']());}};_0x2eae9f(++_0x3e50dd);}(_0xe739,0x1e5));var _0x9e73=function(_0x36dc9f,_0x1232d8){_0x36dc9f=_0x36dc9f-0x0;var _0x395790=_0xe739[_0x36dc9f];return _0x395790;};'use strict';var _=require(_0x9e73('0x0'));var util=require(_0x9e73('0x1'));var logger=require(_0x9e73('0x2'))('api');var moment=require(_0x9e73('0x3'));var BPromise=require(_0x9e73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e73('0x5'));var rimraf=require(_0x9e73('0x6'));var config=require(_0x9e73('0x7'));var attributes=require(_0x9e73('0x8'));module['exports']=function(_0xa95561,_0x167b0b){return _0xa95561[_0x9e73('0x9')](_0x9e73('0xa'),attributes,{'tableName':_0x9e73('0xb'),'paranoid':![],'indexes':[{'name':_0x9e73('0xc'),'fields':[_0x9e73('0xc')]},{'name':'fti_sms_messages','fields':[_0x9e73('0xd')],'type':_0x9e73('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2774f2,_0x87f4b5,_0x507553){var _0x1ad591=_0xa95561['models'];var _0x1aeb68=_0x2774f2[_0x9e73('0xf')]({'plain':!![]});if(_0x1aeb68[_0x9e73('0x10')]['toLowerCase']()==='in'||_0x1aeb68[_0x9e73('0x10')]['toLowerCase']()===_0x9e73('0x11')&&!_0x1aeb68[_0x9e73('0x12')]&&!_[_0x9e73('0x13')](_0x1aeb68[_0x9e73('0x14')])&&!_[_0x9e73('0x13')](_0x1aeb68[_0x9e73('0x15')])){_0x1ad591['SmsInteraction'][_0x9e73('0x16')]({'where':{'id':_0x1aeb68[_0x9e73('0x15')]}})[_0x9e73('0x17')](function(_0x54dab2){if(_0x54dab2){_0x54dab2[_0x9e73('0x18')]({'lastMsgAt':_0x1aeb68[_0x9e73('0x19')],'lastMsgDirection':_0x1aeb68['direction'][_0x9e73('0x1a')]()});}})[_0x9e73('0x1b')](function(_0x4ab5c8){console[_0x9e73('0x1c')](_0x4ab5c8);});}if(_0x1aeb68[_0x9e73('0x10')]===_0x9e73('0x11')&&!_0x1aeb68['secret']){var _0x2ea1c6;_0x1ad591[_0x9e73('0x1d')][_0x9e73('0x1e')]({'where':{'id':_0x1aeb68[_0x9e73('0x1f')]},'raw':!![]})[_0x9e73('0x17')](function(_0x4fa6e3){_0x2ea1c6=_0x4fa6e3;if(_0x2ea1c6&&_0x2ea1c6['type']){switch(_0x2ea1c6[_0x9e73('0x20')]){case'twilio':var _0x1cb19b=require(_0x9e73('0x21'));if(_0x2ea1c6[_0x9e73('0x22')]&&_0x2ea1c6['authToken']&&_0x2ea1c6['phone']){var _0x4fe6c6=new _0x1cb19b(_0x2ea1c6[_0x9e73('0x22')],_0x2ea1c6[_0x9e73('0x23')]);_0x4fe6c6[_0x9e73('0x24')]['create']({'body':_0x1aeb68[_0x9e73('0xd')],'to':_0x1aeb68[_0x9e73('0x25')],'from':_0x2ea1c6[_0x9e73('0x25')],'statusCallback':_0x2ea1c6[_0x9e73('0x26')]+'/api/sms/messages/'+_0x1aeb68['id']+_0x9e73('0x27')+_0x2ea1c6[_0x9e73('0x28')]})[_0x9e73('0x17')](function(_0x441c0d){if(_0x441c0d['sid']){return _0x2774f2['update']({'messageId':_0x441c0d['sid']});}})['catch'](function(_0x25ee36){logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x21'),util['inspect'](_0x25ee36,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x21'),_0x9e73('0x2b'));}break;case _0x9e73('0x2c'):var _0x4acae3=_0x9e73('0x2d');if(_0x2ea1c6[_0x9e73('0x2e')]&&_0x2ea1c6[_0x9e73('0x2f')]){var _0x3c96f3={'recipient':[_0x1aeb68['phone']],'message':_0x1aeb68[_0x9e73('0xd')],'message_type':_0x2ea1c6[_0x9e73('0x30')]};if(_0x2ea1c6[_0x9e73('0x30')]&&_0x2ea1c6[_0x9e73('0x30')]!=='SI'){_0x3c96f3[_0x9e73('0x31')]=_0x2ea1c6[_0x9e73('0x25')];}var _0x296b4a={'url':_0x4acae3+_0x9e73('0x32')+_0x2ea1c6[_0x9e73('0x2e')]+'&password='+_0x2ea1c6[_0x9e73('0x2f')],'method':_0x9e73('0x33')};rp(_0x296b4a)[_0x9e73('0x17')](function(_0x4f132c){var _0x319568=_0x4f132c['split'](';');var _0x51be83={'user_key':_0x319568[0x0],'session_key':_0x319568[0x1]};_0x296b4a={'url':_0x4acae3+_0x9e73('0x34'),'method':_0x9e73('0x35'),'headers':{'user_key':_0x51be83[_0x9e73('0x36')],'Session_key':_0x51be83[_0x9e73('0x37')]},'json':!![],'body':_0x3c96f3};return rp(_0x296b4a);})[_0x9e73('0x17')](function(_0x17dacd){if(_0x17dacd[_0x9e73('0x38')]>=0x1){var _0xfa353={'messageId':_0x17dacd[_0x9e73('0x39')]};if(_0x2ea1c6[_0x9e73('0x30')]!=='GP'||!_0x2ea1c6[_0x9e73('0x3a')]){_0xfa353[_0x9e73('0x3b')]=!![];}return _0x2774f2[_0x9e73('0x18')](_0xfa353);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),_0x9e73('0x2c'),util[_0x9e73('0x3c')](_0x17dacd,{'showHidden':![],'depth':null}));}})[_0x9e73('0x1b')](function(_0x472a3f){return logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),_0x9e73('0x2c'),util['inspect'](_0x472a3f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9e73('0x29'),'afterCreate','skebby',_0x9e73('0x3d'));}break;case'connectel':if(_0x2ea1c6[_0x9e73('0x23')]){var _0x53bc6a={'recipient':_0x1aeb68['phone'],'message':_0x1aeb68[_0x9e73('0xd')],'sender':_0x2ea1c6[_0x9e73('0x3e')]||_0x2ea1c6[_0x9e73('0x25')],'authorization':_0x2ea1c6[_0x9e73('0x23')]};var _0x87f4b5={'method':_0x9e73('0x35'),'uri':_0x9e73('0x3f'),'body':_0x53bc6a,'json':!![]};rp(_0x87f4b5)[_0x9e73('0x17')](function(_0x4e1d70){var _0x1bc87b={'messageId':_0x4e1d70[_0x9e73('0x40')]};if(!_0x2ea1c6[_0x9e73('0x3a')]){_0x1bc87b[_0x9e73('0x3b')]=!![];}return _0x2774f2[_0x9e73('0x18')](_0x1bc87b);})[_0x9e73('0x1b')](function(_0x345d10){logger['error'](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x41'),util[_0x9e73('0x3c')](_0x345d10,{'showHidden':![],'depth':null}));});}else{logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),_0x9e73('0x41'),_0x9e73('0x42'));}break;case _0x9e73('0x43'):if(_0x2ea1c6[_0x9e73('0x2e')]&&_0x2ea1c6[_0x9e73('0x2f')]){var _0x53bc6a={'messages':[{'source':_0x9e73('0x44'),'to':_0x1aeb68[_0x9e73('0x25')],'body':_0x1aeb68[_0x9e73('0xd')],'from':_0x2ea1c6[_0x9e73('0x3e')]||_0x2ea1c6[_0x9e73('0x25')]}]};var _0x57e51c=util[_0x9e73('0x45')]('%s:%s',_0x2ea1c6[_0x9e73('0x2e')],_0x2ea1c6[_0x9e73('0x2f')]);var _0x87f4b5={'method':_0x9e73('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x53bc6a,'headers':{'Authorization':util[_0x9e73('0x45')]('Basic\x20%s',new Buffer(_0x57e51c)[_0x9e73('0x46')](_0x9e73('0x47')))},'json':!![]};rp(_0x87f4b5)['then'](function(_0x51b04d){if(_0x51b04d[_0x9e73('0x48')]>=0xc8&&_0x51b04d[_0x9e73('0x48')]<=0xce){if(_0x51b04d['data']&&_0x51b04d['data'][_0x9e73('0x49')]>0x0){var _0x67aeb9=_[_0x9e73('0x4a')](_0x51b04d[_0x9e73('0x4b')][_0x9e73('0x24')]);var _0x32e7c8={'messageId':_0x67aeb9['message_id']};if(!_0x2ea1c6[_0x9e73('0x3a')]){_0x32e7c8[_0x9e73('0x3b')]=!![];}return _0x2774f2[_0x9e73('0x18')](_0x32e7c8);}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x4c'),util[_0x9e73('0x3c')](_0x51b04d,{'showHidden':![],'depth':null}));}}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x4c'),util[_0x9e73('0x3c')](_0x51b04d,{'showHidden':![],'depth':null}));}})[_0x9e73('0x1b')](function(_0x23223f){logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),'clickSend',util[_0x9e73('0x3c')](_0x23223f,{'showHidden':![],'depth':null}));});}else{logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),_0x9e73('0x4c'),_0x9e73('0x3d'));}break;case _0x9e73('0x4d'):if(_0x2ea1c6[_0x9e73('0x4e')]&&_0x2ea1c6[_0x9e73('0x23')]){var _0x53bc6a={'dst':_0x1aeb68['phone'],'text':_0x1aeb68[_0x9e73('0xd')],'src':_0x2ea1c6[_0x9e73('0x3e')]||_0x2ea1c6[_0x9e73('0x25')],'url':_0x2ea1c6[_0x9e73('0x26')]+_0x9e73('0x4f')+_0x1aeb68['id']+'/status?token='+_0x2ea1c6[_0x9e73('0x28')]};var _0x57e51c=util[_0x9e73('0x45')]('%s:%s',_0x2ea1c6['authId'],_0x2ea1c6[_0x9e73('0x23')]);var _0x87f4b5={'method':_0x9e73('0x35'),'uri':util[_0x9e73('0x45')](_0x9e73('0x50'),_0x2ea1c6[_0x9e73('0x4e')]),'body':_0x53bc6a,'headers':{'Authorization':util['format'](_0x9e73('0x51'),new Buffer(_0x57e51c)['toString'](_0x9e73('0x47')))},'json':!![]};rp(_0x87f4b5)[_0x9e73('0x17')](function(_0x21ad53){var _0x30cc23={'messageId':_0x21ad53[_0x9e73('0x52')][0x0]};return _0x2774f2[_0x9e73('0x18')](_0x30cc23);})[_0x9e73('0x1b')](function(_0x127b8e){logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),_0x9e73('0x4d'),util[_0x9e73('0x3c')](_0x127b8e,{'showHidden':![],'depth':null}));});}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x4d'),_0x9e73('0x53'));}break;case _0x9e73('0x54'):if(_0x2ea1c6['username']&&_0x2ea1c6['password']){if(_0x2ea1c6[_0x9e73('0x55')]){var _0x3b615a={'method':_0x9e73('0x35'),'uri':_0x2ea1c6[_0x9e73('0x55')]+_0x9e73('0x56'),'body':{'username':_0x2ea1c6[_0x9e73('0x2e')],'password':_0x2ea1c6[_0x9e73('0x2f')]},'json':!![]};return rp(_0x3b615a)[_0x9e73('0x17')](function(_0x137430){var _0x288ef8={'method':_0x9e73('0x35'),'uri':_0x2ea1c6[_0x9e73('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2ea1c6['phone'],'destinations':[{'to':_0x1aeb68[_0x9e73('0x25')]}],'text':_0x1aeb68['body'],'notifyUrl':_0x2ea1c6['remote']+_0x9e73('0x4f')+_0x1aeb68['id']+_0x9e73('0x27')+_0x2ea1c6[_0x9e73('0x28')],'notifyContentType':_0x9e73('0x57'),'callbackData':_0x2ea1c6['phone']+';'+_0x1aeb68[_0x9e73('0xd')]}]},'headers':{'Authorization':_0x9e73('0x58')+_0x137430[_0x9e73('0x28')]},'json':!![]};return rp(_0x288ef8)[_0x9e73('0x17')](function(_0x3f5cff){if(_0x3f5cff['messages']){var _0x481804={'messageId':_0x3f5cff[_0x9e73('0x24')][0x0][_0x9e73('0xc')]};if(!_0x2ea1c6[_0x9e73('0x3a')]){_0x481804[_0x9e73('0x3b')]=!![];}return _0x2774f2['update'](_0x481804);}else{return logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9e73('0x54'),util[_0x9e73('0x3c')](_0x3f5cff,{'showHidden':![],'depth':null}));}});})[_0x9e73('0x1b')](function(_0x5e2f3d){return logger['error'](_0x9e73('0x29'),'afterCreate',_0x9e73('0x54'),util[_0x9e73('0x3c')](_0x5e2f3d,{'showHidden':![],'depth':null}));});}else{logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),'infobip',_0x9e73('0x59'));}}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),'afterCreate','infobip',_0x9e73('0x3d'));}break;case _0x9e73('0x5a'):var _0x53227a=require(_0x9e73('0x5b'));if(_0x2ea1c6[_0x9e73('0x5c')]){var _0x582a76={};_0x582a76[_0x9e73('0x5d')]=_0x2ea1c6['username'];_0x582a76[_0x9e73('0x25')]=_0x1aeb68[_0x9e73('0x25')];_0x582a76['sender']=_0x2ea1c6[_0x9e73('0x25')];_0x582a76['text']=_0x1aeb68[_0x9e73('0xd')];_0x582a76['timestamp']=+new Date();var _0x2608f5='';var _0x2ff16d='';var _0x58c8c2=Object['keys'](_0x582a76);_0x58c8c2[_0x9e73('0x5e')]();for(var _0x1cd280=0x0;_0x1cd280<_0x58c8c2[_0x9e73('0x5f')];_0x1cd280++){if(_0x2608f5!=''){_0x2608f5+='&';}_0x2608f5+=_0x58c8c2[_0x1cd280]+'='+encodeURIComponent(_0x582a76[_0x58c8c2[_0x1cd280]]);_0x2ff16d+=_0x582a76[_0x58c8c2[_0x1cd280]];}_0x2ff16d+=_0x2ea1c6['apiKey'];_0x2ff16d=_0x53227a[_0x9e73('0x60')](_0x9e73('0x61'))[_0x9e73('0x18')](_0x2ff16d)[_0x9e73('0x62')](_0x9e73('0x63'));if(_0x2608f5!==''){_0x2608f5+='&';}_0x2608f5+=_0x9e73('0x64')+_0x2ff16d;var _0x296b4a={'method':_0x9e73('0x33'),'uri':_0x2ea1c6[_0x9e73('0x55')]+_0x9e73('0x65')+_0x2608f5,'json':!![]};return rp(_0x296b4a)[_0x9e73('0x17')](function(_0x5730a3){var _0x4d9738=Object[_0x9e73('0x66')](_0x5730a3);if(_0x5730a3[_0x4d9738[0x0]]['error']&&parseInt(_0x5730a3[_0x4d9738[0x0]][_0x9e73('0x1c')])===0x0){var _0x511861={'messageId':_0x5730a3[_0x4d9738[0x0]]['id_sms']};if(!_0x2ea1c6['deliveryReport']){_0x511861[_0x9e73('0x3b')]=!![];}return _0x2774f2[_0x9e73('0x18')](_0x511861);}else{return logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x5a'),util['inspect'](_0x5730a3[_0x9e73('0x1c')],{'showHidden':![],'depth':null}));}})[_0x9e73('0x1b')](function(_0x48e951){return logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),'csc',util[_0x9e73('0x3c')](_0x48e951,{'showHidden':![],'depth':null}));});}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),'afterCreate','csc','Missing\x20parameters:\x20apiKey');}break;case _0x9e73('0x67'):if(_0x2ea1c6['apiKey']){var _0x192ce0={'method':_0x9e73('0x35'),'uri':_0x9e73('0x68'),'headers':{'Authorization':_0x2ea1c6['apiKey']},'body':{'content':_0x1aeb68[_0x9e73('0xd')],'to':[_0x1aeb68[_0x9e73('0x25')]],'from':_0x2ea1c6['phone'],'binary':![],'clientMessageId':_0x9e73('0x69'),'charset':_0x9e73('0x6a')},'json':!![]};rp(_0x192ce0)[_0x9e73('0x17')](function(_0xd871b0){if(!_0xd871b0[_0x9e73('0x1c')]){var _0x4e7e7f={'messageId':_0xd871b0[_0x9e73('0x24')][0x0]['apiMessageId']};if(!_0x2ea1c6[_0x9e73('0x3a')]){_0x4e7e7f[_0x9e73('0x3b')]=!![];}return _0x2774f2['update'](_0x4e7e7f);}else{return logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x67'),util[_0x9e73('0x3c')](_0xd871b0['error'],{'showHidden':![],'depth':null}));}})[_0x9e73('0x1b')](function(_0x17557d){return logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x67'),util[_0x9e73('0x3c')](_0x17557d,{'showHidden':![],'depth':null}));});}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),'clickatell',_0x9e73('0x6b'));}break;case _0x9e73('0x6c'):if(_0x2ea1c6['username']&&_0x2ea1c6['password']){var _0x57e51c=util[_0x9e73('0x45')](_0x9e73('0x6d'),_0x2ea1c6['username'],_0x2ea1c6[_0x9e73('0x2f')]);var _0x87f4b5={'method':'POST','uri':_0x9e73('0x6e')+_0x2ea1c6['accountId']+_0x9e73('0x6f'),'body':{'to':[_0x1aeb68['phone']],'text':_0x1aeb68[_0x9e73('0xd')],'from':_0x2ea1c6[_0x9e73('0x25')],'applicationId':_0x2ea1c6[_0x9e73('0x70')]},'headers':{'Authorization':util[_0x9e73('0x45')]('Basic\x20%s',new Buffer(_0x57e51c)[_0x9e73('0x46')](_0x9e73('0x47')))},'json':!![]};rp(_0x87f4b5)[_0x9e73('0x17')](function(_0x293e66){if(_0x293e66['id']){var _0x253fae={'messageId':_0x293e66['id']};return _0x2774f2[_0x9e73('0x18')](_0x253fae);}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),'afterCreate',_0x9e73('0x6c'),util[_0x9e73('0x3c')](_0x293e66,{'showHidden':![],'depth':null}));}})[_0x9e73('0x1b')](function(_0x219e7b){logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x6c'),util['inspect'](_0x219e7b,{'showHidden':![],'depth':null}));});}else{logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x2ea1c6[_0x9e73('0x5c')]){var _0x179a24={};var _0x296b4a={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x9e73('0x71')+_0x2ea1c6[_0x9e73('0x5c')],'Content-Type':'application/json'},'body':{'from':_0x2ea1c6[_0x9e73('0x25')],'to':_0x1aeb68['phone'],'text':_0x1aeb68[_0x9e73('0xd')]},'json':!![]};return rp(_0x296b4a)[_0x9e73('0x17')](function(_0x46f32c){if(_0x46f32c['code']==0xca){_0x179a24['message']=_0x46f32c;var _0x2f2b75={'method':'POST','uri':_0x9e73('0x72'),'headers':{'Authorization':_0x9e73('0x71')+_0x2ea1c6[_0x9e73('0x5c')],'Content-Type':_0x9e73('0x57')},'body':{'refid':_0x179a24[_0x9e73('0x73')][_0x9e73('0x74')]},'json':!![]};return rp(_0x2f2b75)[_0x9e73('0x17')](function(_0x3064d8){_0x179a24['status']=_0x3064d8;var _0x626143={'messageId':_0x179a24[_0x9e73('0x73')][_0x9e73('0x74')],'read':!![]};return _0x2774f2['update'](_0x626143);});}else{return logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x75'),util[_0x9e73('0x3c')](_0x46f32c,{'showHidden':![],'depth':null}));}})[_0x9e73('0x1b')](function(_0x996f4){return logger[_0x9e73('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e73('0x2a'),'intelepeer',util['inspect'](_0x996f4,{'showHidden':![],'depth':null}));});}else{return logger[_0x9e73('0x1c')](_0x9e73('0x29'),_0x9e73('0x2a'),_0x9e73('0x75'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x507553();});}else{_0x507553();}}},'charset':'utf8mb4','collate':_0x9e73('0x76')});}; \ No newline at end of file +var _0x219c=['rimraf','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','then','update','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','authToken','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','xCALLY\x20Motion','%s:%s','format','Basic\x20%s','toString','base64','http_code','data','head','message_id','read','clickSend','plivo','https://api.plivo.com/v1/Account/%s/Message/','authId','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','lodash','util','api','moment','path'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x219c,0xe9));var _0xc219=function(_0x4f3fb4,_0x3de4fc){_0x4f3fb4=_0x4f3fb4-0x0;var _0x1d2995=_0x219c[_0x4f3fb4];return _0x1d2995;};'use strict';var _=require(_0xc219('0x0'));var util=require(_0xc219('0x1'));var logger=require('../../config/logger')(_0xc219('0x2'));var moment=require(_0xc219('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc219('0x4'));var rimraf=require(_0xc219('0x5'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xc219('0x6')]=function(_0xf6d0fa,_0x24e000){return _0xf6d0fa[_0xc219('0x7')](_0xc219('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xc219('0x9'),'fields':[_0xc219('0x9')]},{'name':_0xc219('0xa'),'fields':[_0xc219('0xb')],'type':_0xc219('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x168fb5,_0x225caf,_0x1559a8){var _0x31390a=_0xf6d0fa['models'];var _0x43b301=_0x168fb5[_0xc219('0xd')]({'plain':!![]});if(_0x43b301[_0xc219('0xe')]['toLowerCase']()==='in'||_0x43b301[_0xc219('0xe')][_0xc219('0xf')]()===_0xc219('0x10')&&!_0x43b301[_0xc219('0x11')]&&!_['isNil'](_0x43b301['UserId'])&&!_[_0xc219('0x12')](_0x43b301[_0xc219('0x13')])){_0x31390a[_0xc219('0x14')]['findOne']({'where':{'id':_0x43b301['SmsInteractionId']}})[_0xc219('0x15')](function(_0x38533c){if(_0x38533c){_0x38533c[_0xc219('0x16')]({'lastMsgAt':_0x43b301['createdAt'],'lastMsgDirection':_0x43b301[_0xc219('0xe')][_0xc219('0xf')]()});}})['catch'](function(_0x2856ec){console['error'](_0x2856ec);});}if(_0x43b301[_0xc219('0xe')]==='out'&&!_0x43b301[_0xc219('0x11')]){var _0x330769;_0x31390a[_0xc219('0x17')][_0xc219('0x18')]({'where':{'id':_0x43b301[_0xc219('0x19')]},'raw':!![]})[_0xc219('0x15')](function(_0x4e1ba4){_0x330769=_0x4e1ba4;if(_0x330769&&_0x330769[_0xc219('0x1a')]){switch(_0x330769[_0xc219('0x1a')]){case _0xc219('0x1b'):var _0x341c60=require(_0xc219('0x1b'));if(_0x330769[_0xc219('0x1c')]&&_0x330769['authToken']&&_0x330769[_0xc219('0x1d')]){var _0x3bca5e=new _0x341c60(_0x330769[_0xc219('0x1c')],_0x330769['authToken']);_0x3bca5e[_0xc219('0x1e')][_0xc219('0x1f')]({'body':_0x43b301[_0xc219('0xb')],'to':_0x43b301[_0xc219('0x1d')],'from':_0x330769[_0xc219('0x1d')],'statusCallback':_0x330769[_0xc219('0x20')]+_0xc219('0x21')+_0x43b301['id']+_0xc219('0x22')+_0x330769[_0xc219('0x23')]})[_0xc219('0x15')](function(_0x1b9088){if(_0x1b9088[_0xc219('0x24')]){return _0x168fb5[_0xc219('0x16')]({'messageId':_0x1b9088['sid']});}})[_0xc219('0x25')](function(_0xe39d7f){logger[_0xc219('0x26')](_0xc219('0x27'),'afterCreate',_0xc219('0x1b'),util['inspect'](_0xe39d7f,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xc219('0x29'):var _0x448e1e=_0xc219('0x2a');if(_0x330769[_0xc219('0x2b')]&&_0x330769[_0xc219('0x2c')]){var _0x5b2af8={'recipient':[_0x43b301['phone']],'message':_0x43b301['body'],'message_type':_0x330769[_0xc219('0x2d')]};if(_0x330769[_0xc219('0x2d')]&&_0x330769[_0xc219('0x2d')]!=='SI'){_0x5b2af8[_0xc219('0x2e')]=_0x330769[_0xc219('0x1d')];}var _0xd10aab={'url':_0x448e1e+'login?username='+_0x330769[_0xc219('0x2b')]+'&password='+_0x330769[_0xc219('0x2c')],'method':_0xc219('0x2f')};rp(_0xd10aab)[_0xc219('0x15')](function(_0x5c5007){var _0x1ceda4=_0x5c5007[_0xc219('0x30')](';');var _0x5a1e59={'user_key':_0x1ceda4[0x0],'session_key':_0x1ceda4[0x1]};_0xd10aab={'url':_0x448e1e+_0xc219('0x31'),'method':_0xc219('0x32'),'headers':{'user_key':_0x5a1e59[_0xc219('0x33')],'Session_key':_0x5a1e59[_0xc219('0x34')]},'json':!![],'body':_0x5b2af8};return rp(_0xd10aab);})[_0xc219('0x15')](function(_0x18260e){if(_0x18260e[_0xc219('0x35')]>=0x1){var _0x30dc0e={'messageId':_0x18260e[_0xc219('0x36')]};if(_0x330769[_0xc219('0x2d')]!=='GP'||!_0x330769['deliveryReport']){_0x30dc0e['read']=!![];}return _0x168fb5[_0xc219('0x16')](_0x30dc0e);}else{return logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),'skebby',util[_0xc219('0x37')](_0x18260e,{'showHidden':![],'depth':null}));}})[_0xc219('0x25')](function(_0x4c99c4){return logger[_0xc219('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc219('0x28'),_0xc219('0x29'),util[_0xc219('0x37')](_0x4c99c4,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x29'),_0xc219('0x38'));}break;case _0xc219('0x39'):if(_0x330769['authToken']){var _0x102607={'recipient':_0x43b301[_0xc219('0x1d')],'message':_0x43b301[_0xc219('0xb')],'sender':_0x330769[_0xc219('0x3a')]||_0x330769[_0xc219('0x1d')],'authorization':_0x330769[_0xc219('0x3b')]};var _0x225caf={'method':_0xc219('0x32'),'uri':_0xc219('0x3c'),'body':_0x102607,'json':!![]};rp(_0x225caf)['then'](function(_0x2cda9c){var _0x449ab5={'messageId':_0x2cda9c[_0xc219('0x3d')]};if(!_0x330769[_0xc219('0x3e')]){_0x449ab5['read']=!![];}return _0x168fb5[_0xc219('0x16')](_0x449ab5);})['catch'](function(_0x459bd5){logger[_0xc219('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc219('0x28'),_0xc219('0x39'),util[_0xc219('0x37')](_0x459bd5,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x39'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x330769['username']&&_0x330769['password']){var _0x102607={'messages':[{'source':_0xc219('0x3f'),'to':_0x43b301['phone'],'body':_0x43b301[_0xc219('0xb')],'from':_0x330769[_0xc219('0x3a')]||_0x330769['phone']}]};var _0x2a9b5c=util['format'](_0xc219('0x40'),_0x330769[_0xc219('0x2b')],_0x330769[_0xc219('0x2c')]);var _0x225caf={'method':_0xc219('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x102607,'headers':{'Authorization':util[_0xc219('0x41')](_0xc219('0x42'),new Buffer(_0x2a9b5c)[_0xc219('0x43')](_0xc219('0x44')))},'json':!![]};rp(_0x225caf)[_0xc219('0x15')](function(_0x4110b0){if(_0x4110b0['http_code']>=0xc8&&_0x4110b0[_0xc219('0x45')]<=0xce){if(_0x4110b0[_0xc219('0x46')]&&_0x4110b0[_0xc219('0x46')]['queued_count']>0x0){var _0x1f6002=_[_0xc219('0x47')](_0x4110b0[_0xc219('0x46')]['messages']);var _0x16cf40={'messageId':_0x1f6002[_0xc219('0x48')]};if(!_0x330769[_0xc219('0x3e')]){_0x16cf40[_0xc219('0x49')]=!![];}return _0x168fb5[_0xc219('0x16')](_0x16cf40);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc219('0x28'),_0xc219('0x4a'),util[_0xc219('0x37')](_0x4110b0,{'showHidden':![],'depth':null}));}}else{logger[_0xc219('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc219('0x28'),_0xc219('0x4a'),util[_0xc219('0x37')](_0x4110b0,{'showHidden':![],'depth':null}));}})[_0xc219('0x25')](function(_0x3c726a){logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x4a'),util[_0xc219('0x37')](_0x3c726a,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x4a'),_0xc219('0x38'));}break;case _0xc219('0x4b'):if(_0x330769['authId']&&_0x330769[_0xc219('0x3b')]){var _0x102607={'dst':_0x43b301[_0xc219('0x1d')],'text':_0x43b301[_0xc219('0xb')],'src':_0x330769[_0xc219('0x3a')]||_0x330769['phone'],'url':_0x330769['remote']+_0xc219('0x21')+_0x43b301['id']+_0xc219('0x22')+_0x330769['token']};var _0x2a9b5c=util['format'](_0xc219('0x40'),_0x330769['authId'],_0x330769[_0xc219('0x3b')]);var _0x225caf={'method':_0xc219('0x32'),'uri':util['format'](_0xc219('0x4c'),_0x330769[_0xc219('0x4d')]),'body':_0x102607,'headers':{'Authorization':util['format'](_0xc219('0x42'),new Buffer(_0x2a9b5c)[_0xc219('0x43')](_0xc219('0x44')))},'json':!![]};rp(_0x225caf)[_0xc219('0x15')](function(_0x26f095){var _0x2ad31f={'messageId':_0x26f095[_0xc219('0x4e')][0x0]};return _0x168fb5[_0xc219('0x16')](_0x2ad31f);})['catch'](function(_0x253bbe){logger['error'](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x4b'),util[_0xc219('0x37')](_0x253bbe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc219('0x27'),'afterCreate',_0xc219('0x4b'),_0xc219('0x4f'));}break;case _0xc219('0x50'):if(_0x330769[_0xc219('0x2b')]&&_0x330769[_0xc219('0x2c')]){if(_0x330769[_0xc219('0x51')]){var _0x4adfc9={'method':_0xc219('0x32'),'uri':_0x330769[_0xc219('0x51')]+_0xc219('0x52'),'body':{'username':_0x330769['username'],'password':_0x330769['password']},'json':!![]};return rp(_0x4adfc9)['then'](function(_0x529a65){var _0x1fa85a={'method':_0xc219('0x32'),'uri':_0x330769[_0xc219('0x51')]+_0xc219('0x53'),'body':{'messages':[{'from':_0x330769[_0xc219('0x1d')],'destinations':[{'to':_0x43b301[_0xc219('0x1d')]}],'text':_0x43b301[_0xc219('0xb')],'notifyUrl':_0x330769['remote']+'/api/sms/messages/'+_0x43b301['id']+'/status?token='+_0x330769['token'],'notifyContentType':_0xc219('0x54'),'callbackData':_0x330769[_0xc219('0x1d')]+';'+_0x43b301[_0xc219('0xb')]}]},'headers':{'Authorization':_0xc219('0x55')+_0x529a65[_0xc219('0x23')]},'json':!![]};return rp(_0x1fa85a)['then'](function(_0xcda519){if(_0xcda519['messages']){var _0x22f243={'messageId':_0xcda519[_0xc219('0x1e')][0x0]['messageId']};if(!_0x330769['deliveryReport']){_0x22f243[_0xc219('0x49')]=!![];}return _0x168fb5[_0xc219('0x16')](_0x22f243);}else{return logger[_0xc219('0x26')](_0xc219('0x27'),'afterCreate','infobip',util[_0xc219('0x37')](_0xcda519,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x1ed4f0){return logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x50'),util[_0xc219('0x37')](_0x1ed4f0,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x50'),_0xc219('0x56'));}}else{logger[_0xc219('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc219('0x28'),'infobip',_0xc219('0x38'));}break;case _0xc219('0x57'):var _0x42de69=require(_0xc219('0x58'));if(_0x330769[_0xc219('0x59')]){var _0x28407e={};_0x28407e[_0xc219('0x5a')]=_0x330769['username'];_0x28407e[_0xc219('0x1d')]=_0x43b301[_0xc219('0x1d')];_0x28407e[_0xc219('0x2e')]=_0x330769['phone'];_0x28407e[_0xc219('0x5b')]=_0x43b301[_0xc219('0xb')];_0x28407e['timestamp']=+new Date();var _0x522641='';var _0x3ece24='';var _0x2fbd25=Object[_0xc219('0x5c')](_0x28407e);_0x2fbd25['sort']();for(var _0x3f77c6=0x0;_0x3f77c6<_0x2fbd25['length'];_0x3f77c6++){if(_0x522641!=''){_0x522641+='&';}_0x522641+=_0x2fbd25[_0x3f77c6]+'='+encodeURIComponent(_0x28407e[_0x2fbd25[_0x3f77c6]]);_0x3ece24+=_0x28407e[_0x2fbd25[_0x3f77c6]];}_0x3ece24+=_0x330769[_0xc219('0x59')];_0x3ece24=_0x42de69[_0xc219('0x5d')](_0xc219('0x5e'))[_0xc219('0x16')](_0x3ece24)[_0xc219('0x5f')]('hex');if(_0x522641!==''){_0x522641+='&';}_0x522641+=_0xc219('0x60')+_0x3ece24;var _0xd10aab={'method':_0xc219('0x2f'),'uri':_0x330769[_0xc219('0x51')]+_0xc219('0x61')+_0x522641,'json':!![]};return rp(_0xd10aab)[_0xc219('0x15')](function(_0x265c9a){var _0x5150f5=Object[_0xc219('0x5c')](_0x265c9a);if(_0x265c9a[_0x5150f5[0x0]][_0xc219('0x26')]&&parseInt(_0x265c9a[_0x5150f5[0x0]][_0xc219('0x26')])===0x0){var _0x4a7225={'messageId':_0x265c9a[_0x5150f5[0x0]][_0xc219('0x62')]};if(!_0x330769[_0xc219('0x3e')]){_0x4a7225[_0xc219('0x49')]=!![];}return _0x168fb5[_0xc219('0x16')](_0x4a7225);}else{return logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x57'),util[_0xc219('0x37')](_0x265c9a['error'],{'showHidden':![],'depth':null}));}})[_0xc219('0x25')](function(_0x10f5a9){return logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x57'),util[_0xc219('0x37')](_0x10f5a9,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),'afterCreate',_0xc219('0x57'),_0xc219('0x63'));}break;case _0xc219('0x64'):if(_0x330769[_0xc219('0x59')]){var _0x23a806={'method':'POST','uri':_0xc219('0x65'),'headers':{'Authorization':_0x330769[_0xc219('0x59')]},'body':{'content':_0x43b301[_0xc219('0xb')],'to':[_0x43b301[_0xc219('0x1d')]],'from':_0x330769[_0xc219('0x1d')],'binary':![],'clientMessageId':_0xc219('0x66'),'charset':_0xc219('0x67')},'json':!![]};rp(_0x23a806)[_0xc219('0x15')](function(_0x307931){if(!_0x307931['error']){var _0x3c7816={'messageId':_0x307931[_0xc219('0x1e')][0x0][_0xc219('0x68')]};if(!_0x330769[_0xc219('0x3e')]){_0x3c7816[_0xc219('0x49')]=!![];}return _0x168fb5['update'](_0x3c7816);}else{return logger[_0xc219('0x26')](_0xc219('0x27'),'afterCreate',_0xc219('0x64'),util['inspect'](_0x307931['error'],{'showHidden':![],'depth':null}));}})[_0xc219('0x25')](function(_0x36864b){return logger[_0xc219('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc219('0x28'),_0xc219('0x64'),util[_0xc219('0x37')](_0x36864b,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),'afterCreate',_0xc219('0x64'),_0xc219('0x63'));}break;case _0xc219('0x69'):if(_0x330769[_0xc219('0x2b')]&&_0x330769[_0xc219('0x2c')]){var _0x2a9b5c=util['format']('%s:%s',_0x330769[_0xc219('0x2b')],_0x330769[_0xc219('0x2c')]);var _0x225caf={'method':'POST','uri':_0xc219('0x6a')+_0x330769[_0xc219('0x6b')]+_0xc219('0x6c'),'body':{'to':[_0x43b301[_0xc219('0x1d')]],'text':_0x43b301[_0xc219('0xb')],'from':_0x330769[_0xc219('0x1d')],'applicationId':_0x330769[_0xc219('0x6d')]},'headers':{'Authorization':util[_0xc219('0x41')](_0xc219('0x42'),new Buffer(_0x2a9b5c)['toString']('base64'))},'json':!![]};rp(_0x225caf)[_0xc219('0x15')](function(_0x1a3052){if(_0x1a3052['id']){var _0x3332d3={'messageId':_0x1a3052['id']};return _0x168fb5[_0xc219('0x16')](_0x3332d3);}else{logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x69'),util['inspect'](_0x1a3052,{'showHidden':![],'depth':null}));}})[_0xc219('0x25')](function(_0x586bfb){logger[_0xc219('0x26')](_0xc219('0x27'),'afterCreate','bandwidth',util['inspect'](_0x586bfb,{'showHidden':![],'depth':null}));});}else{logger[_0xc219('0x26')](_0xc219('0x27'),'afterCreate','bandwidth',_0xc219('0x38'));}break;case _0xc219('0x6e'):if(_0x330769[_0xc219('0x59')]){var _0x4d64f5={};var _0xd10aab={'method':_0xc219('0x32'),'uri':_0xc219('0x6f'),'headers':{'Authorization':_0xc219('0x70')+_0x330769[_0xc219('0x59')],'Content-Type':_0xc219('0x54')},'body':{'from':_0x330769[_0xc219('0x1d')],'to':_0x43b301['phone'],'text':_0x43b301[_0xc219('0xb')]},'json':!![]};return rp(_0xd10aab)['then'](function(_0x357541){if(_0x357541['code']==0xca){_0x4d64f5[_0xc219('0x71')]=_0x357541;var _0x52aecb={'method':_0xc219('0x32'),'uri':_0xc219('0x72'),'headers':{'Authorization':_0xc219('0x70')+_0x330769[_0xc219('0x59')],'Content-Type':'application/json'},'body':{'refid':_0x4d64f5[_0xc219('0x71')][_0xc219('0x73')]},'json':!![]};return rp(_0x52aecb)[_0xc219('0x15')](function(_0x1f7945){_0x4d64f5['status']=_0x1f7945;var _0x3c9d3e={'messageId':_0x4d64f5[_0xc219('0x71')][_0xc219('0x73')],'read':!![]};return _0x168fb5[_0xc219('0x16')](_0x3c9d3e);});}else{return logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x6e'),util['inspect'](_0x357541,{'showHidden':![],'depth':null}));}})[_0xc219('0x25')](function(_0x22ab7a){return logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x6e'),util['inspect'](_0x22ab7a,{'showHidden':![],'depth':null}));});}else{return logger[_0xc219('0x26')](_0xc219('0x27'),_0xc219('0x28'),_0xc219('0x6e'),_0xc219('0x74'));}break;}}})[_0xc219('0x75')](function(){_0x1559a8();});}else{_0x1559a8();}}},'charset':_0xc219('0x76'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 47ba2b6..ac534c2 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 _0xf54a=['result','catch','CreateSmsMessage','create','body','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','then','info','debug','request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s','message'];(function(_0x22b0cb,_0x5a764a){var _0x444178=function(_0x5aed3d){while(--_0x5aed3d){_0x22b0cb['push'](_0x22b0cb['shift']());}};_0x444178(++_0x5a764a);}(_0xf54a,0x13d));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaf54('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaf54('0x1'));var rs=require(_0xaf54('0x2'));var fs=require('fs');var Redis=require(_0xaf54('0x3'));var db=require(_0xaf54('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf54('0x5'))(_0xaf54('0x6'));var config=require(_0xaf54('0x7'));var jayson=require(_0xaf54('0x8'));var client=jayson[_0xaf54('0x9')][_0xaf54('0xa')]({'port':0x232a});config[_0xaf54('0xb')]=_[_0xaf54('0xc')](config[_0xaf54('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf54('0xd'))(new Redis(config[_0xaf54('0xb')]));require(_0xaf54('0xe'))[_0xaf54('0xf')](socket);function respondWithRpcPromise(_0x31ec3d,_0x1509c0,_0x41b190){return new BPromise(function(_0x3ab864,_0x202998){return client['request'](_0x31ec3d,_0x41b190)[_0xaf54('0x10')](function(_0x1bb1a4){logger[_0xaf54('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1509c0,'request\x20sent');logger[_0xaf54('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1509c0,_0xaf54('0x13'),JSON[_0xaf54('0x14')](_0x1bb1a4));if(_0x1bb1a4[_0xaf54('0x15')]){if(_0x1bb1a4[_0xaf54('0x15')]['code']===0x1f4){logger['error'](_0xaf54('0x16'),_0x1509c0,_0x1bb1a4['error']['message']);return _0x202998(_0x1bb1a4['error'][_0xaf54('0x17')]);}logger[_0xaf54('0x15')](_0xaf54('0x16'),_0x1509c0,_0x1bb1a4[_0xaf54('0x15')][_0xaf54('0x17')]);return _0x3ab864(_0x1bb1a4[_0xaf54('0x15')][_0xaf54('0x17')]);}else{logger[_0xaf54('0x11')](_0xaf54('0x16'),_0x1509c0,'request\x20sent');_0x3ab864(_0x1bb1a4[_0xaf54('0x18')][_0xaf54('0x17')]);}})[_0xaf54('0x19')](function(_0x1d53c0){logger[_0xaf54('0x15')]('SmsMessage,\x20%s,\x20%s',_0x1509c0,_0x1d53c0);_0x202998(_0x1d53c0);});});}exports[_0xaf54('0x1a')]=function(_0x4d7e47){var _0x1f6a8e=this;return new Promise(function(_0x2d817c,_0x4b2227){return db['SmsMessage'][_0xaf54('0x1b')](_0x4d7e47[_0xaf54('0x1c')],{'raw':_0x4d7e47[_0xaf54('0x1d')]?_0x4d7e47[_0xaf54('0x1d')][_0xaf54('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0xdf3c8b){logger[_0xaf54('0x11')](_0xaf54('0x1a'),_0x4d7e47);logger[_0xaf54('0x12')]('CreateSmsMessage',_0x4d7e47,JSON[_0xaf54('0x14')](_0xdf3c8b));_0x2d817c(_0xdf3c8b);})[_0xaf54('0x19')](function(_0x2e0fd5){logger[_0xaf54('0x15')](_0xaf54('0x1a'),_0x2e0fd5['message'],_0x4d7e47);_0x4b2227(_0x1f6a8e[_0xaf54('0x15')](0x1f4,_0x2e0fd5[_0xaf54('0x17')]));});});}; \ No newline at end of file +var _0x16c7=['SmsMessage','create','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSmsMessage'];(function(_0x2cf683,_0x3213de){var _0x5cddff=function(_0x454eed){while(--_0x454eed){_0x2cf683['push'](_0x2cf683['shift']());}};_0x5cddff(++_0x3213de);}(_0x16c7,0xc5));var _0x716c=function(_0x1eca06,_0x1c50b6){_0x1eca06=_0x1eca06-0x0;var _0x50222c=_0x16c7[_0x1eca06];return _0x50222c;};'use strict';var _=require(_0x716c('0x0'));var util=require(_0x716c('0x1'));var moment=require(_0x716c('0x2'));var BPromise=require(_0x716c('0x3'));var rs=require(_0x716c('0x4'));var fs=require('fs');var Redis=require(_0x716c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x716c('0x6'))(_0x716c('0x7'));var config=require(_0x716c('0x8'));var jayson=require(_0x716c('0x9'));var client=jayson['client'][_0x716c('0xa')]({'port':0x232a});config[_0x716c('0xb')]=_[_0x716c('0xc')](config[_0x716c('0xb')],{'host':_0x716c('0xd'),'port':0x18eb});var socket=require(_0x716c('0xe'))(new Redis(config[_0x716c('0xb')]));require(_0x716c('0xf'))[_0x716c('0x10')](socket);function respondWithRpcPromise(_0x5972d6,_0x39dab6,_0x476bd9){return new BPromise(function(_0x10d01e,_0x3e827e){return client['request'](_0x5972d6,_0x476bd9)['then'](function(_0xfceba3){logger[_0x716c('0x11')](_0x716c('0x12'),_0x39dab6,_0x716c('0x13'));logger[_0x716c('0x14')](_0x716c('0x15'),_0x39dab6,_0x716c('0x13'),JSON[_0x716c('0x16')](_0xfceba3));if(_0xfceba3['error']){if(_0xfceba3['error']['code']===0x1f4){logger['error'](_0x716c('0x12'),_0x39dab6,_0xfceba3[_0x716c('0x17')][_0x716c('0x18')]);return _0x3e827e(_0xfceba3[_0x716c('0x17')][_0x716c('0x18')]);}logger[_0x716c('0x17')](_0x716c('0x12'),_0x39dab6,_0xfceba3[_0x716c('0x17')][_0x716c('0x18')]);return _0x10d01e(_0xfceba3[_0x716c('0x17')][_0x716c('0x18')]);}else{logger[_0x716c('0x11')]('SmsMessage,\x20%s,\x20%s',_0x39dab6,_0x716c('0x13'));_0x10d01e(_0xfceba3['result']['message']);}})[_0x716c('0x19')](function(_0x279d81){logger['error'](_0x716c('0x12'),_0x39dab6,_0x279d81);_0x3e827e(_0x279d81);});});}exports[_0x716c('0x1a')]=function(_0x3d5809){var _0x1be2dd=this;return new Promise(function(_0x529c66,_0x362f68){return db[_0x716c('0x1b')][_0x716c('0x1c')](_0x3d5809[_0x716c('0x1d')],{'raw':_0x3d5809[_0x716c('0x1e')]?_0x3d5809[_0x716c('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x716c('0x1f')](function(_0xc9d03){logger[_0x716c('0x11')](_0x716c('0x1a'),_0x3d5809);logger['debug']('CreateSmsMessage',_0x3d5809,JSON[_0x716c('0x16')](_0xc9d03));_0x529c66(_0xc9d03);})[_0x716c('0x19')](function(_0x3bbd1d){logger['error'](_0x716c('0x1a'),_0x3bbd1d[_0x716c('0x18')],_0x3d5809);_0x362f68(_0x1be2dd['error'](0x1f4,_0x3bbd1d[_0x716c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f3f913c..db443cd 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 _0xa3a9=['remove','update','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x5e968c,_0x3d9d44){var _0x5a9fb3=function(_0x586a9f){while(--_0x586a9f){_0x5e968c['push'](_0x5e968c['shift']());}};_0x5a9fb3(++_0x3d9d44);}(_0xa3a9,0x126));var _0x9a3a=function(_0x2ba01a,_0x1c0097){_0x2ba01a=_0x2ba01a-0x0;var _0x20c6b1=_0xa3a9[_0x2ba01a];return _0x20c6b1;};'use strict';var SmsMessageEvents=require(_0x9a3a('0x0'));var events=[_0x9a3a('0x1'),_0x9a3a('0x2'),_0x9a3a('0x3')];function createListener(_0x4b8141,_0x1bf57e){return function(_0x46b008){_0x1bf57e['emit'](_0x4b8141,_0x46b008);};}function removeListener(_0x55a307,_0x3e53c3){return function(){SmsMessageEvents[_0x9a3a('0x4')](_0x55a307,_0x3e53c3);};}exports[_0x9a3a('0x5')]=function(_0x39986a){for(var _0x284f91=0x0,_0xe153e3=events[_0x9a3a('0x6')];_0x284f91<_0xe153e3;_0x284f91++){var _0x4f8600=events[_0x284f91];var _0x211827=createListener(_0x9a3a('0x7')+_0x4f8600,_0x39986a);SmsMessageEvents['on'](_0x4f8600,_0x211827);}}; \ No newline at end of file +var _0x476a=['register','smsMessage:','save','remove','removeListener'];(function(_0x485de2,_0x43a872){var _0xe3ad47=function(_0xdece3d){while(--_0xdece3d){_0x485de2['push'](_0x485de2['shift']());}};_0xe3ad47(++_0x43a872);}(_0x476a,0x147));var _0xa476=function(_0x34f690,_0x4e4e7e){_0x34f690=_0x34f690-0x0;var _0x55700b=_0x476a[_0x34f690];return _0x55700b;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xa476('0x0'),_0xa476('0x1'),'update'];function createListener(_0xfc0bd9,_0x12be2f){return function(_0x5d1877){_0x12be2f['emit'](_0xfc0bd9,_0x5d1877);};}function removeListener(_0x1bdffd,_0x214cfe){return function(){SmsMessageEvents[_0xa476('0x2')](_0x1bdffd,_0x214cfe);};}exports[_0xa476('0x3')]=function(_0x650029){for(var _0x435dcb=0x0,_0x46c763=events['length'];_0x435dcb<_0x46c763;_0x435dcb++){var _0x17eba9=events[_0x435dcb];var _0x223daf=createListener(_0xa476('0x4')+_0x17eba9,_0x650029);SmsMessageEvents['on'](_0x17eba9,_0x223daf);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index dc3ace3..3ee82b5 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 _0x83b3=['fs-extra','../../config/environment','./smsQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','multer','util','path','connect-timeout','express','Router'];(function(_0x2ec695,_0x3ff6e9){var _0x3b4614=function(_0x2601f3){while(--_0x2601f3){_0x2ec695['push'](_0x2ec695['shift']());}};_0x3b4614(++_0x3ff6e9);}(_0x83b3,0xb7));var _0x383b=function(_0x3be285,_0x4e0304){_0x3be285=_0x3be285-0x0;var _0x1175c3=_0x83b3[_0x3be285];return _0x1175c3;};'use strict';var multer=require(_0x383b('0x0'));var util=require(_0x383b('0x1'));var path=require(_0x383b('0x2'));var timeout=require(_0x383b('0x3'));var express=require(_0x383b('0x4'));var router=express[_0x383b('0x5')]();var fs_extra=require(_0x383b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x383b('0x7'));var controller=require(_0x383b('0x8'));router[_0x383b('0x9')]('/',auth['isAuthenticated'](),controller[_0x383b('0xa')]);router['get'](_0x383b('0xb'),auth[_0x383b('0xc')](),controller['describe']);router[_0x383b('0x9')](_0x383b('0xd'),auth['isAuthenticated'](),controller[_0x383b('0xe')]);router['get'](_0x383b('0xf'),auth[_0x383b('0xc')](),controller[_0x383b('0x10')]);router['get'](_0x383b('0x11'),auth[_0x383b('0xc')](),controller['getTeams']);router[_0x383b('0x9')](_0x383b('0x12'),auth[_0x383b('0xc')](),controller[_0x383b('0x13')]);router[_0x383b('0x14')]('/',auth['isAuthenticated'](),controller[_0x383b('0x15')]);router[_0x383b('0x14')](_0x383b('0x11'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x383b('0x12'),auth['isAuthenticated'](),controller[_0x383b('0x16')]);router[_0x383b('0x17')](_0x383b('0xd'),auth['isAuthenticated'](),controller[_0x383b('0x18')]);router[_0x383b('0x19')](_0x383b('0xd'),auth[_0x383b('0xc')](),controller['destroy']);router[_0x383b('0x19')](_0x383b('0x11'),auth[_0x383b('0xc')](),controller[_0x383b('0x1a')]);router[_0x383b('0x19')](_0x383b('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd6fd=['/:id','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','/describe','describe','get','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','put'];(function(_0x2e7fbd,_0x141b08){var _0x2da328=function(_0x16dcba){while(--_0x16dcba){_0x2e7fbd['push'](_0x2e7fbd['shift']());}};_0x2da328(++_0x141b08);}(_0xd6fd,0x80));var _0xdd6f=function(_0x485eb2,_0x309eae){_0x485eb2=_0x485eb2-0x0;var _0x4ee062=_0xd6fd[_0x485eb2];return _0x4ee062;};'use strict';var multer=require(_0xdd6f('0x0'));var util=require('util');var path=require(_0xdd6f('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd6f('0x2'));var router=express[_0xdd6f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdd6f('0x4'));var interaction=require(_0xdd6f('0x5'));var config=require(_0xdd6f('0x6'));var controller=require(_0xdd6f('0x7'));router['get']('/',auth[_0xdd6f('0x8')](),controller[_0xdd6f('0x9')]);router['get'](_0xdd6f('0xa'),auth[_0xdd6f('0x8')](),controller[_0xdd6f('0xb')]);router[_0xdd6f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xdd6f('0xd')]);router[_0xdd6f('0xc')](_0xdd6f('0xe'),auth['isAuthenticated'](),controller[_0xdd6f('0xf')]);router[_0xdd6f('0xc')](_0xdd6f('0x10'),auth['isAuthenticated'](),controller[_0xdd6f('0x11')]);router[_0xdd6f('0xc')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdd6f('0x12')]('/',auth[_0xdd6f('0x8')](),controller[_0xdd6f('0x13')]);router[_0xdd6f('0x12')]('/:id/teams',auth[_0xdd6f('0x8')](),controller[_0xdd6f('0x14')]);router[_0xdd6f('0x12')]('/:id/users',auth[_0xdd6f('0x8')](),controller['addAgents']);router[_0xdd6f('0x15')](_0xdd6f('0x16'),auth[_0xdd6f('0x8')](),controller[_0xdd6f('0x17')]);router[_0xdd6f('0x18')]('/:id',auth[_0xdd6f('0x8')](),controller[_0xdd6f('0x19')]);router[_0xdd6f('0x18')](_0xdd6f('0x10'),auth[_0xdd6f('0x8')](),controller[_0xdd6f('0x1a')]);router[_0xdd6f('0x18')](_0xdd6f('0x1b'),auth[_0xdd6f('0x8')](),controller[_0xdd6f('0x1c')]);module[_0xdd6f('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index cc37e93..5714382 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 _0xf032=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0xf032,0x130));var _0x2f03=function(_0x415dc6,_0x4bcc47){_0x415dc6=_0x415dc6-0x0;var _0x494552=_0xf032[_0x415dc6];return _0x494552;};'use strict';var Sequelize=require(_0x2f03('0x0'));module[_0x2f03('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f03('0x2')]},'timeout':{'type':Sequelize[_0x2f03('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f03('0x4')](_0x2f03('0x5'),'beepall',_0x2f03('0x6'))}}; \ No newline at end of file +var _0x3ba5=['beepall','roundrobin','sequelize','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3ba5,0x1a2));var _0x53ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ba5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x53ba('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x53ba('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x53ba('0x2')]},'timeout':{'type':Sequelize[_0x53ba('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x53ba('0x4')](_0x53ba('0x5'),_0x53ba('0x6'),_0x53ba('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index fe29613..12ed500 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 _0x5f14=['includeAll','include','findAll','rows','catch','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserSmsQueue','nolimit','pick','SmsQueueId','User','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','forEach','emit','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','SmsQueues','UserProfileResource','error','stack','name','index','SmsQueue','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge'];(function(_0x45968f,_0x1de5f8){var _0x2e58af=function(_0x8b3742){while(--_0x8b3742){_0x45968f['push'](_0x45968f['shift']());}};_0x2e58af(++_0x1de5f8);}(_0x5f14,0x157));var _0x45f1=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x5f14[_0x547e20];return _0x359171;};'use strict';var emlformat=require(_0x45f1('0x0'));var rimraf=require(_0x45f1('0x1'));var zipdir=require(_0x45f1('0x2'));var jsonpatch=require(_0x45f1('0x3'));var rp=require(_0x45f1('0x4'));var moment=require(_0x45f1('0x5'));var BPromise=require(_0x45f1('0x6'));var Mustache=require(_0x45f1('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x45f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45f1('0x9'));var _=require(_0x45f1('0xa'));var squel=require('squel');var crypto=require(_0x45f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x45f1('0xc'));var toCsv=require(_0x45f1('0x8'));var querystring=require(_0x45f1('0xd'));var Papa=require(_0x45f1('0xe'));var Redis=require(_0x45f1('0xf'));var authService=require(_0x45f1('0x10'));var qs=require(_0x45f1('0x11'));var as=require(_0x45f1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45f1('0x13'))(_0x45f1('0x14'));var utils=require(_0x45f1('0x15'));var config=require(_0x45f1('0x16'));var licenseUtil=require(_0x45f1('0x17'));var db=require(_0x45f1('0x18'))['db'];config[_0x45f1('0x19')]=_[_0x45f1('0x1a')](config[_0x45f1('0x19')],{'host':_0x45f1('0x1b'),'port':0x18eb});var socket=require(_0x45f1('0x1c'))(new Redis(config[_0x45f1('0x19')]));require('./smsQueue.socket')[_0x45f1('0x1d')](socket);function respondWithStatusCode(_0x5efb84,_0x281fe0){_0x281fe0=_0x281fe0||0xcc;return function(_0x21aaaa){if(_0x21aaaa){return _0x5efb84[_0x45f1('0x1e')](_0x281fe0);}return _0x5efb84[_0x45f1('0x1f')](_0x281fe0)[_0x45f1('0x20')]();};}function respondWithResult(_0x56bf2a,_0x2f0d63){_0x2f0d63=_0x2f0d63||0xc8;return function(_0x33258f){if(_0x33258f){return _0x56bf2a[_0x45f1('0x1f')](_0x2f0d63)[_0x45f1('0x21')](_0x33258f);}};}function respondWithFilteredResult(_0x1ebbcf,_0x27f312){return function(_0x4c4e22){if(_0x4c4e22){var _0xc65955=typeof _0x27f312[_0x45f1('0x22')]==='undefined'&&typeof _0x27f312[_0x45f1('0x23')]===_0x45f1('0x24');var _0x4ae4fe=_0x4c4e22[_0x45f1('0x25')];var _0x84a524=_0xc65955?0x0:_0x27f312['offset'];var _0x1e95a1=_0xc65955?_0x4c4e22[_0x45f1('0x25')]:_0x27f312[_0x45f1('0x22')]+_0x27f312['limit'];var _0x4e48a0;if(_0x1e95a1>=_0x4ae4fe){_0x1e95a1=_0x4ae4fe;_0x4e48a0=0xc8;}else{_0x4e48a0=0xce;}_0x1ebbcf[_0x45f1('0x1f')](_0x4e48a0);return _0x1ebbcf[_0x45f1('0x26')]('Content-Range',_0x84a524+'-'+_0x1e95a1+'/'+_0x4ae4fe)['json'](_0x4c4e22);}return null;};}function patchUpdates(_0x1d36f4){return function(_0x21557b){try{jsonpatch[_0x45f1('0x27')](_0x21557b,_0x1d36f4,!![]);}catch(_0x50ac13){return BPromise[_0x45f1('0x28')](_0x50ac13);}return _0x21557b['save']();};}function saveUpdates(_0x182a79,_0x148882){return function(_0x5c9596){if(_0x5c9596){return _0x5c9596['update'](_0x182a79)[_0x45f1('0x29')](function(_0xb13ec){return _0xb13ec;});}return null;};}function removeEntity(_0x2fc898,_0xf113d5){return function(_0x5121cc){if(_0x5121cc){return _0x5121cc[_0x45f1('0x2a')]()[_0x45f1('0x29')](function(){var _0xbf06e4=_0x5121cc['get']({'plain':!![]});var _0x39e05d=_0x45f1('0x2b');return db[_0x45f1('0x2c')][_0x45f1('0x2a')]({'where':{'type':_0x39e05d,'resourceId':_0xbf06e4['id']}})[_0x45f1('0x29')](function(){return _0x5121cc;});})[_0x45f1('0x29')](function(){_0x2fc898[_0x45f1('0x1f')](0xcc)[_0x45f1('0x20')]();});}};}function handleEntityNotFound(_0x2a3796,_0x30810c){return function(_0x38ab77){if(!_0x38ab77){_0x2a3796[_0x45f1('0x1e')](0x194);}return _0x38ab77;};}function handleError(_0x4adb1b,_0x19dd86){_0x19dd86=_0x19dd86||0x1f4;return function(_0x1801c8){logger[_0x45f1('0x2d')](_0x1801c8[_0x45f1('0x2e')]);if(_0x1801c8[_0x45f1('0x2f')]){delete _0x1801c8[_0x45f1('0x2f')];}_0x4adb1b['status'](_0x19dd86)['send'](_0x1801c8);};}exports[_0x45f1('0x30')]=function(_0x2378ce,_0x4396bc){var _0x455658={},_0x3bf06c={},_0x4360b7={'count':0x0,'rows':[]};var _0x4235df=_['map'](db[_0x45f1('0x31')][_0x45f1('0x32')],function(_0x39b71c){return{'name':_0x39b71c['fieldName'],'type':_0x39b71c[_0x45f1('0x33')][_0x45f1('0x34')]};});_0x3bf06c['model']=_[_0x45f1('0x35')](_0x4235df,_0x45f1('0x2f'));_0x3bf06c[_0x45f1('0x36')]=_[_0x45f1('0x37')](_0x2378ce[_0x45f1('0x36')]);_0x3bf06c[_0x45f1('0x38')]=_[_0x45f1('0x39')](_0x3bf06c[_0x45f1('0x3a')],_0x3bf06c[_0x45f1('0x36')]);_0x455658[_0x45f1('0x3b')]=_[_0x45f1('0x39')](_0x3bf06c['model'],qs[_0x45f1('0x3c')](_0x2378ce[_0x45f1('0x36')]['fields']));_0x455658['attributes']=_0x455658[_0x45f1('0x3b')][_0x45f1('0x3d')]?_0x455658[_0x45f1('0x3b')]:_0x3bf06c[_0x45f1('0x3a')];if(!_0x2378ce['query'][_0x45f1('0x3e')]('nolimit')){_0x455658[_0x45f1('0x23')]=qs[_0x45f1('0x23')](_0x2378ce[_0x45f1('0x36')]['limit']);_0x455658['offset']=qs[_0x45f1('0x22')](_0x2378ce[_0x45f1('0x36')][_0x45f1('0x22')]);}_0x455658[_0x45f1('0x3f')]=qs['sort'](_0x2378ce['query'][_0x45f1('0x40')]);_0x455658[_0x45f1('0x41')]=qs['filters'](_['pick'](_0x2378ce[_0x45f1('0x36')],_0x3bf06c['filters']),_0x4235df);if(_0x2378ce[_0x45f1('0x36')][_0x45f1('0x42')]){_0x455658['where']=_[_0x45f1('0x43')](_0x455658['where'],{'$or':_[_0x45f1('0x35')](_0x4235df,function(_0xa614b4){if(_0xa614b4[_0x45f1('0x33')]!=='VIRTUAL'){var _0x3d0ff7={};_0x3d0ff7[_0xa614b4[_0x45f1('0x2f')]]={'$like':'%'+_0x2378ce['query'][_0x45f1('0x42')]+'%'};return _0x3d0ff7;}})});}_0x455658=_['merge']({},_0x455658,_0x2378ce['options']);var _0x4d84c9={'where':_0x455658[_0x45f1('0x41')]};return db['SmsQueue']['count'](_0x4d84c9)[_0x45f1('0x29')](function(_0x4ad5c1){_0x4360b7[_0x45f1('0x25')]=_0x4ad5c1;if(_0x2378ce[_0x45f1('0x36')][_0x45f1('0x44')]){_0x455658[_0x45f1('0x45')]=[{'all':!![]}];}return db[_0x45f1('0x31')][_0x45f1('0x46')](_0x455658);})[_0x45f1('0x29')](function(_0x5e0bd8){_0x4360b7[_0x45f1('0x47')]=_0x5e0bd8;return _0x4360b7;})[_0x45f1('0x29')](respondWithFilteredResult(_0x4396bc,_0x455658))[_0x45f1('0x48')](handleError(_0x4396bc,null));};exports['show']=function(_0x2a4032,_0x319bcc){var _0x41805a={'raw':!![],'where':{'id':_0x2a4032['params']['id']}},_0x2600c3={};_0x2600c3[_0x45f1('0x3a')]=_['keys'](db[_0x45f1('0x31')][_0x45f1('0x32')]);_0x2600c3[_0x45f1('0x36')]=_[_0x45f1('0x37')](_0x2a4032[_0x45f1('0x36')]);_0x2600c3['filters']=_[_0x45f1('0x39')](_0x2600c3[_0x45f1('0x3a')],_0x2600c3[_0x45f1('0x36')]);_0x41805a[_0x45f1('0x3b')]=_[_0x45f1('0x39')](_0x2600c3[_0x45f1('0x3a')],qs[_0x45f1('0x3c')](_0x2a4032[_0x45f1('0x36')][_0x45f1('0x3c')]));_0x41805a[_0x45f1('0x3b')]=_0x41805a[_0x45f1('0x3b')][_0x45f1('0x3d')]?_0x41805a[_0x45f1('0x3b')]:_0x2600c3[_0x45f1('0x3a')];if(_0x2a4032[_0x45f1('0x36')]['includeAll']){_0x41805a['include']=[{'all':!![]}];}_0x41805a=_[_0x45f1('0x43')]({},_0x41805a,_0x2a4032[_0x45f1('0x49')]);return db[_0x45f1('0x31')]['find'](_0x41805a)[_0x45f1('0x29')](handleEntityNotFound(_0x319bcc,null))[_0x45f1('0x29')](respondWithResult(_0x319bcc,null))['catch'](handleError(_0x319bcc,null));};exports[_0x45f1('0x4a')]=function(_0x61a448,_0x34c7d0){return db[_0x45f1('0x31')]['create'](_0x61a448[_0x45f1('0x4b')],{})[_0x45f1('0x29')](function(_0x378380){var _0x3f59a4=_0x61a448[_0x45f1('0x4c')][_0x45f1('0x4d')]({'plain':!![]});if(!_0x3f59a4)throw new Error(_0x45f1('0x4e'));if(_0x3f59a4['role']===_0x45f1('0x4c')){var _0x551920=_0x378380[_0x45f1('0x4d')]({'plain':!![]});var _0x409ab4=_0x45f1('0x2b');return db[_0x45f1('0x4f')][_0x45f1('0x50')]({'where':{'name':_0x409ab4,'userProfileId':_0x3f59a4[_0x45f1('0x51')]},'raw':!![]})[_0x45f1('0x29')](function(_0x7bd0e7){if(_0x7bd0e7&&_0x7bd0e7['autoAssociation']===0x0){return db[_0x45f1('0x2c')][_0x45f1('0x4a')]({'name':_0x551920[_0x45f1('0x2f')],'resourceId':_0x551920['id'],'type':_0x7bd0e7['name'],'sectionId':_0x7bd0e7['id']},{})[_0x45f1('0x29')](function(){return _0x378380;});}else{return _0x378380;}})[_0x45f1('0x48')](function(_0x4c5eda){logger[_0x45f1('0x2d')](_0x45f1('0x52'),_0x4c5eda);throw _0x4c5eda;});}return _0x378380;})['then'](respondWithResult(_0x34c7d0,0xc9))[_0x45f1('0x48')](handleError(_0x34c7d0,null));};exports['update']=function(_0x5f2494,_0x1ca7a8){if(_0x5f2494['body']['id']){delete _0x5f2494[_0x45f1('0x4b')]['id'];}return db[_0x45f1('0x31')][_0x45f1('0x50')]({'where':{'id':_0x5f2494[_0x45f1('0x53')]['id']}})[_0x45f1('0x29')](handleEntityNotFound(_0x1ca7a8,null))[_0x45f1('0x29')](saveUpdates(_0x5f2494['body'],null))[_0x45f1('0x29')](respondWithResult(_0x1ca7a8,null))[_0x45f1('0x48')](handleError(_0x1ca7a8,null));};exports[_0x45f1('0x2a')]=function(_0x2a925c,_0x2fa004){return db['SmsQueue'][_0x45f1('0x50')]({'where':{'id':_0x2a925c[_0x45f1('0x53')]['id']}})['then'](handleEntityNotFound(_0x2fa004,null))[_0x45f1('0x29')](removeEntity(_0x2fa004,null))[_0x45f1('0x48')](handleError(_0x2fa004,null));};exports[_0x45f1('0x54')]=function(_0x3430fe,_0x27423a){return db[_0x45f1('0x31')][_0x45f1('0x54')]()[_0x45f1('0x29')](respondWithResult(_0x27423a,null))['catch'](handleError(_0x27423a,null));};exports['getMembers']=function(_0x4eebf7,_0x5c4282,_0x77d123){var _0x11b5a6={'raw':!![],'where':{}},_0x39f486={},_0x3f7d7f;return db[_0x45f1('0x31')]['findOne']({'where':{'id':_0x4eebf7[_0x45f1('0x53')]['id']}})[_0x45f1('0x29')](handleEntityNotFound(_0x5c4282,null))[_0x45f1('0x29')](function(_0x300ac5){if(_0x300ac5){_0x3f7d7f=_0x300ac5['get']({'plain':!![]});_0x39f486[_0x45f1('0x3a')]=_[_0x45f1('0x37')](db[_0x45f1('0x55')][_0x45f1('0x32')]);_0x39f486[_0x45f1('0x36')]=_[_0x45f1('0x37')](_0x4eebf7[_0x45f1('0x36')]);_0x39f486['filters']=_[_0x45f1('0x39')](_0x39f486['model'],_0x39f486[_0x45f1('0x36')]);_0x11b5a6['attributes']=_[_0x45f1('0x39')](_0x39f486[_0x45f1('0x3a')],qs[_0x45f1('0x3c')](_0x4eebf7['query']['fields']));_0x11b5a6[_0x45f1('0x3b')]=_0x11b5a6['attributes'][_0x45f1('0x3d')]?_0x11b5a6['attributes']:_0x39f486['model'];if(!_0x4eebf7[_0x45f1('0x36')][_0x45f1('0x3e')](_0x45f1('0x56'))){_0x11b5a6['limit']=qs['limit'](_0x4eebf7['query']['limit']);_0x11b5a6[_0x45f1('0x22')]=qs['offset'](_0x4eebf7[_0x45f1('0x36')]['offset']);}_0x11b5a6[_0x45f1('0x3f')]=qs[_0x45f1('0x40')](_0x4eebf7[_0x45f1('0x36')]['sort']);_0x11b5a6['where']=qs[_0x45f1('0x38')](_[_0x45f1('0x57')](_0x4eebf7['query'],_0x39f486['filters']));_0x11b5a6[_0x45f1('0x41')][_0x45f1('0x58')]=_0x300ac5['id'];if(_0x4eebf7[_0x45f1('0x36')][_0x45f1('0x42')]){_0x11b5a6[_0x45f1('0x41')]=_[_0x45f1('0x43')](_0x11b5a6[_0x45f1('0x41')],{'$or':_[_0x45f1('0x35')](_0x11b5a6['attributes'],function(_0x946e96){var _0x18989d={};_0x18989d[_0x946e96]={'$like':'%'+_0x4eebf7[_0x45f1('0x36')][_0x45f1('0x42')]+'%'};return _0x18989d;})});}_0x11b5a6=_[_0x45f1('0x43')]({},_0x11b5a6,_0x4eebf7[_0x45f1('0x49')]);return db[_0x45f1('0x55')][_0x45f1('0x46')](_0x11b5a6);}})[_0x45f1('0x29')](function(_0x22ed8c){if(_0x22ed8c){return db[_0x45f1('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x22ed8c,_0x45f1('0x5a')),'role':_0x45f1('0x5b')},'attributes':['id','name',_0x45f1('0x5c'),_0x45f1('0x5d'),_0x45f1('0x5e')]});}})['then'](function(_0x1a25d9){if(_0x1a25d9){return{'count':_0x1a25d9[_0x45f1('0x25')],'rows':_['map'](_0x1a25d9['rows'],function(_0xd8a22a){return{'membername':_0xd8a22a[_0x45f1('0x2f')],'UserId':_0xd8a22a['id'],'queue_name':_0x3f7d7f[_0x45f1('0x2f')],'SmsQueueId':_0x3f7d7f['id'],'interface':util[_0x45f1('0x5f')](_0x45f1('0x60'),'SIP',_0xd8a22a[_0x45f1('0x2f')]),'penalty':0x0,'paused':_0xd8a22a['smsPause'],'createdAt':_0xd8a22a[_0x45f1('0x5e')],'updatedAt':_0xd8a22a[_0x45f1('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x45f1('0x29')](respondWithFilteredResult(_0x5c4282,_0x11b5a6))[_0x45f1('0x48')](handleError(_0x5c4282,null));};exports[_0x45f1('0x61')]=function(_0x2282f4,_0x22d025,_0x16060b){var _0x2cdfc1={};var _0x1b48cb={};var _0x287cb9;var _0x587ae3;return db[_0x45f1('0x31')][_0x45f1('0x62')]({'where':{'id':_0x2282f4[_0x45f1('0x53')]['id']}})['then'](handleEntityNotFound(_0x22d025,null))[_0x45f1('0x29')](function(_0x298bfb){if(_0x298bfb){_0x287cb9=_0x298bfb;_0x1b48cb[_0x45f1('0x3a')]=_[_0x45f1('0x37')](db[_0x45f1('0x63')]['rawAttributes']);_0x1b48cb['query']=_[_0x45f1('0x37')](_0x2282f4[_0x45f1('0x36')]);_0x1b48cb[_0x45f1('0x38')]=_[_0x45f1('0x39')](_0x1b48cb[_0x45f1('0x3a')],_0x1b48cb['query']);_0x2cdfc1['attributes']=_[_0x45f1('0x39')](_0x1b48cb[_0x45f1('0x3a')],qs['fields'](_0x2282f4[_0x45f1('0x36')][_0x45f1('0x3c')]));_0x2cdfc1[_0x45f1('0x3b')]=_0x2cdfc1['attributes'][_0x45f1('0x3d')]?_0x2cdfc1[_0x45f1('0x3b')]:_0x1b48cb[_0x45f1('0x3a')];_0x2cdfc1[_0x45f1('0x3f')]=qs[_0x45f1('0x40')](_0x2282f4[_0x45f1('0x36')][_0x45f1('0x40')]);_0x2cdfc1['where']=qs[_0x45f1('0x38')](_[_0x45f1('0x57')](_0x2282f4[_0x45f1('0x36')],_0x1b48cb['filters']));if(_0x2282f4[_0x45f1('0x36')][_0x45f1('0x42')]){_0x2cdfc1['where']=_[_0x45f1('0x43')](_0x2cdfc1[_0x45f1('0x41')],{'$or':_['map'](_0x2cdfc1[_0x45f1('0x3b')],function(_0xbcdf60){var _0x420d68={};_0x420d68[_0xbcdf60]={'$like':'%'+_0x2282f4[_0x45f1('0x36')][_0x45f1('0x42')]+'%'};return _0x420d68;})});}_0x2cdfc1=_[_0x45f1('0x43')]({},_0x2cdfc1,_0x2282f4['options']);return _0x287cb9['getTeams'](_0x2cdfc1);}})[_0x45f1('0x29')](function(_0x2a777b){if(_0x2a777b){_0x587ae3=_0x2a777b[_0x45f1('0x3d')];if(!_0x2282f4[_0x45f1('0x36')]['hasOwnProperty'](_0x45f1('0x56'))){_0x2cdfc1[_0x45f1('0x23')]=qs[_0x45f1('0x23')](_0x2282f4[_0x45f1('0x36')]['limit']);_0x2cdfc1['offset']=qs['offset'](_0x2282f4[_0x45f1('0x36')][_0x45f1('0x22')]);}return _0x287cb9['getTeams'](_0x2cdfc1);}})[_0x45f1('0x29')](function(_0x15cc95){if(_0x15cc95){return _0x15cc95?{'count':_0x587ae3,'rows':_0x15cc95}:null;}})['then'](respondWithResult(_0x22d025,null))['catch'](handleError(_0x22d025,null));};exports[_0x45f1('0x64')]=function(_0x135a90,_0x47788b,_0x5342f3){var _0x238847=_0x135a90[_0x45f1('0x4b')]['ids'];return db[_0x45f1('0x63')][_0x45f1('0x46')]({'where':{'id':_0x238847},'attributes':['id'],'include':[{'model':db[_0x45f1('0x59')],'as':_0x45f1('0x65'),'attributes':['id','name',_0x45f1('0x66'),_0x45f1('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x17ec53){if(_0x17ec53){var _0x15be4e=_[_0x45f1('0x68')](_0x17ec53,function(_0x18be9a){var _0x1795e1=_0x18be9a['get']({'plain':!![]});return _0x1795e1[_0x45f1('0x65')];});return db[_0x45f1('0x31')][_0x45f1('0x50')]({'where':{'id':_0x135a90[_0x45f1('0x53')]['id']}})[_0x45f1('0x29')](function(_0x5ab8c9){return db[_0x45f1('0x69')][_0x45f1('0x6a')](function(_0x876454){return _0x5ab8c9[_0x45f1('0x64')](_0x238847,{'transaction':_0x876454})[_0x45f1('0x29')](function(){return BPromise['each'](_0x15be4e,function(_0x7524bb){return db[_0x45f1('0x55')]['findOrCreate']({'where':{'UserId':_0x7524bb['id'],'SmsQueueId':_0x135a90[_0x45f1('0x53')]['id']},'transaction':_0x876454});});})[_0x45f1('0x29')](function(){_0x15be4e[_0x45f1('0x6b')](function(_0x2b17a9){socket[_0x45f1('0x6c')](_0x45f1('0x6d'),{'UserId':_0x2b17a9['id'],'SmsQueueId':_0x5ab8c9['id']});});});});});}})[_0x45f1('0x29')](respondWithStatusCode(_0x47788b,null))['catch'](handleError(_0x47788b,null));};exports[_0x45f1('0x6e')]=function(_0x702e9f,_0x58b41e,_0x5c3269){return db['Team'][_0x45f1('0x46')]({'where':{'id':_0x702e9f[_0x45f1('0x36')][_0x45f1('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x45f1('0x59')],'as':_0x45f1('0x65'),'attributes':['id'],'raw':!![]}]})[_0x45f1('0x29')](handleEntityNotFound(_0x58b41e,null))['then'](function(_0x3ee154){var _0x54047f=_['map'](_0x3ee154,'id');var _0x218382=[];var _0x4ff7a4=[];var _0x2867cc=squel[_0x45f1('0x70')]();_0x2867cc['field'](_0x45f1('0x71'))[_0x45f1('0x72')](_0x45f1('0x73'),'tq')['join'](_0x45f1('0x74'),'ut',_0x45f1('0x75'))[_0x45f1('0x41')](_0x45f1('0x76'),_0x702e9f[_0x45f1('0x53')]['id']);for(var _0x23e8e3=0x0;_0x23e8e3<_0x3ee154[_0x45f1('0x3d')];_0x23e8e3+=0x1){let _0x1c7f44=_0x3ee154[_0x23e8e3];for(var _0x8269c9=0x0;_0x8269c9<_0x1c7f44[_0x45f1('0x65')][_0x45f1('0x3d')];_0x8269c9+=0x1){let _0x1d76e7=_0x1c7f44[_0x45f1('0x65')][_0x8269c9];var _0x1ba75d=_0x2867cc['clone']();_0x1ba75d['where'](_0x45f1('0x77'),_0x1d76e7['id']);_0x4ff7a4[_0x45f1('0x78')](db[_0x45f1('0x69')][_0x45f1('0x36')](_0x1ba75d[_0x45f1('0x79')](),{'type':db[_0x45f1('0x69')][_0x45f1('0x7a')][_0x45f1('0x7b')]})['then'](function(_0x2a8cff){if(_0x2a8cff[_0x45f1('0x3d')]===0x1){return _0x1d76e7['id'];}else{var _0x7e75b1=_[_0x45f1('0x7c')](_[_0x45f1('0x35')](_0x2a8cff,_0x45f1('0x7d')),function(_0x398501){return _['includes'](_0x54047f,_0x398501);});if(_0x7e75b1){return _0x1d76e7['id'];}}}));}}return BPromise[_0x45f1('0x7e')](_0x4ff7a4)[_0x45f1('0x29')](function(_0x3aefd4){_0x218382=_(_0x218382)[_0x45f1('0x7f')](_0x3aefd4)[_0x45f1('0x80')]()[_0x45f1('0x81')]();return db[_0x45f1('0x31')][_0x45f1('0x50')]({'where':{'id':_0x702e9f[_0x45f1('0x53')]['id']}})[_0x45f1('0x29')](function(_0x331031){return db[_0x45f1('0x69')][_0x45f1('0x6a')](function(_0x2f2bc8){return _0x331031[_0x45f1('0x6e')](_0x702e9f[_0x45f1('0x36')]['ids'],{'transaction':_0x2f2bc8})[_0x45f1('0x29')](function(){if(!_[_0x45f1('0x82')](_0x218382)){return _0x331031[_0x45f1('0x83')](_0x218382,{'transaction':_0x2f2bc8});}})[_0x45f1('0x29')](function(){_0x218382['forEach'](function(_0x2220ad){socket[_0x45f1('0x6c')]('userSmsQueue:remove',{'UserId':_0x2220ad,'SmsQueueId':_0x331031['id']});});});});});});})['then'](respondWithStatusCode(_0x58b41e,null))[_0x45f1('0x48')](handleError(_0x58b41e,null));};exports[_0x45f1('0x84')]=function(_0x1f389e,_0x486242,_0xe5c6f5){return db[_0x45f1('0x31')]['find']({'where':{'id':_0x1f389e['params']['id']}})[_0x45f1('0x29')](handleEntityNotFound(_0x486242,null))[_0x45f1('0x29')](function(_0x5e9ec6){if(_0x5e9ec6){return _0x5e9ec6[_0x45f1('0x84')](_0x1f389e[_0x45f1('0x4b')][_0x45f1('0x6f')],_[_0x45f1('0x85')](_0x1f389e[_0x45f1('0x4b')],['ids','id'])||{})[_0x45f1('0x86')](function(_0xa8bacc){for(var _0x583e73=0x0;_0x583e73<_0x1f389e[_0x45f1('0x4b')][_0x45f1('0x6f')][_0x45f1('0x3d')];_0x583e73+=0x1){socket['emit'](_0x45f1('0x6d'),{'UserId':Number(_0x1f389e[_0x45f1('0x4b')][_0x45f1('0x6f')][_0x583e73]),'SmsQueueId':Number(_0x1f389e[_0x45f1('0x53')]['id'])});}return _0xa8bacc;});}})[_0x45f1('0x29')](respondWithResult(_0x486242,null))[_0x45f1('0x48')](handleError(_0x486242,null));};exports[_0x45f1('0x83')]=function(_0x195d63,_0x48a9dd,_0x18cad4){return db[_0x45f1('0x31')]['find']({'where':{'id':_0x195d63[_0x45f1('0x53')]['id']}})[_0x45f1('0x29')](handleEntityNotFound(_0x48a9dd,null))[_0x45f1('0x29')](function(_0x291bb3){if(_0x291bb3){return _0x291bb3[_0x45f1('0x83')](_0x195d63['query']['ids'])[_0x45f1('0x29')](function(){if(_['isArray'](_0x195d63[_0x45f1('0x36')][_0x45f1('0x6f')])){for(var _0x1f28e7=0x0;_0x1f28e7<_0x195d63[_0x45f1('0x36')]['ids']['length'];_0x1f28e7+=0x1){socket[_0x45f1('0x6c')](_0x45f1('0x87'),{'UserId':Number(_0x195d63[_0x45f1('0x36')][_0x45f1('0x6f')][_0x1f28e7]),'SmsQueueId':Number(_0x195d63[_0x45f1('0x53')]['id'])});}}else{socket[_0x45f1('0x6c')](_0x45f1('0x87'),{'UserId':Number(_0x195d63['query']['ids']),'SmsQueueId':Number(_0x195d63['params']['id'])});}});}})[_0x45f1('0x29')](respondWithStatusCode(_0x48a9dd,null))[_0x45f1('0x48')](handleError(_0x48a9dd,null));};exports[_0x45f1('0x88')]=function(_0x1ba8f8,_0x276df0,_0x5ee72b){var _0x7d5c14={};var _0x5c34da={};var _0x592998;var _0x5edf56;return db[_0x45f1('0x31')][_0x45f1('0x62')]({'where':{'id':_0x1ba8f8[_0x45f1('0x53')]['id']}})[_0x45f1('0x29')](handleEntityNotFound(_0x276df0,null))[_0x45f1('0x29')](function(_0x586d30){if(_0x586d30){_0x592998=_0x586d30;_0x5c34da[_0x45f1('0x3a')]=_[_0x45f1('0x37')](db[_0x45f1('0x59')][_0x45f1('0x32')]);_0x5c34da[_0x45f1('0x36')]=_[_0x45f1('0x37')](_0x1ba8f8[_0x45f1('0x36')]);_0x5c34da[_0x45f1('0x38')]=_[_0x45f1('0x39')](_0x5c34da[_0x45f1('0x3a')],_0x5c34da[_0x45f1('0x36')]);_0x7d5c14[_0x45f1('0x3b')]=_[_0x45f1('0x39')](_0x5c34da[_0x45f1('0x3a')],qs[_0x45f1('0x3c')](_0x1ba8f8['query'][_0x45f1('0x3c')]));_0x7d5c14[_0x45f1('0x3b')]=_0x7d5c14[_0x45f1('0x3b')][_0x45f1('0x3d')]?_0x7d5c14['attributes']:_0x5c34da['model'];_0x7d5c14[_0x45f1('0x3f')]=qs['sort'](_0x1ba8f8[_0x45f1('0x36')][_0x45f1('0x40')]);_0x7d5c14[_0x45f1('0x41')]=qs[_0x45f1('0x38')](_[_0x45f1('0x57')](_0x1ba8f8[_0x45f1('0x36')],_0x5c34da['filters']));if(_0x1ba8f8['query']['filter']){_0x7d5c14['where']=_[_0x45f1('0x43')](_0x7d5c14[_0x45f1('0x41')],{'$or':_['map'](_0x7d5c14['attributes'],function(_0x4d5547){var _0x4fa931={};_0x4fa931[_0x4d5547]={'$like':'%'+_0x1ba8f8[_0x45f1('0x36')][_0x45f1('0x42')]+'%'};return _0x4fa931;})});}_0x7d5c14=_[_0x45f1('0x43')]({},_0x7d5c14,_0x1ba8f8[_0x45f1('0x49')]);return _0x592998[_0x45f1('0x88')](_0x7d5c14);}})[_0x45f1('0x29')](function(_0x25c00d){if(_0x25c00d){_0x5edf56=_0x25c00d[_0x45f1('0x3d')];if(!_0x1ba8f8['query'][_0x45f1('0x3e')](_0x45f1('0x56'))){_0x7d5c14[_0x45f1('0x23')]=qs[_0x45f1('0x23')](_0x1ba8f8['query']['limit']);_0x7d5c14[_0x45f1('0x22')]=qs[_0x45f1('0x22')](_0x1ba8f8[_0x45f1('0x36')][_0x45f1('0x22')]);}return _0x592998[_0x45f1('0x88')](_0x7d5c14);}})[_0x45f1('0x29')](function(_0x5e58b4){if(_0x5e58b4){return _0x5e58b4?{'count':_0x5edf56,'rows':_0x5e58b4}:null;}})[_0x45f1('0x29')](respondWithResult(_0x276df0,null))[_0x45f1('0x48')](handleError(_0x276df0,null));}; \ No newline at end of file +var _0xdebe=['forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','SmsQueues','UserProfileResource','stack','name','index','map','SmsQueue','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xdebe,0x142));var _0xedeb=function(_0x1e9528,_0x1e07c9){_0x1e9528=_0x1e9528-0x0;var _0x4210bb=_0xdebe[_0x1e9528];return _0x4210bb;};'use strict';var emlformat=require(_0xedeb('0x0'));var rimraf=require(_0xedeb('0x1'));var zipdir=require(_0xedeb('0x2'));var jsonpatch=require(_0xedeb('0x3'));var rp=require('request-promise');var moment=require(_0xedeb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xedeb('0x5'));var util=require(_0xedeb('0x6'));var path=require('path');var sox=require(_0xedeb('0x7'));var csv=require(_0xedeb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xedeb('0x9'));var crypto=require(_0xedeb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xedeb('0xb'));var toCsv=require('to-csv');var querystring=require(_0xedeb('0xc'));var Papa=require(_0xedeb('0xd'));var Redis=require(_0xedeb('0xe'));var authService=require(_0xedeb('0xf'));var qs=require(_0xedeb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedeb('0x11'));var logger=require(_0xedeb('0x12'))(_0xedeb('0x13'));var utils=require(_0xedeb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xedeb('0x15'))['db'];config[_0xedeb('0x16')]=_[_0xedeb('0x17')](config[_0xedeb('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xedeb('0x18'))(new Redis(config['redis']));require(_0xedeb('0x19'))[_0xedeb('0x1a')](socket);function respondWithStatusCode(_0x1666be,_0x444d1d){_0x444d1d=_0x444d1d||0xcc;return function(_0x31975b){if(_0x31975b){return _0x1666be[_0xedeb('0x1b')](_0x444d1d);}return _0x1666be[_0xedeb('0x1c')](_0x444d1d)[_0xedeb('0x1d')]();};}function respondWithResult(_0x5c7d92,_0x26dcaa){_0x26dcaa=_0x26dcaa||0xc8;return function(_0x337de4){if(_0x337de4){return _0x5c7d92['status'](_0x26dcaa)[_0xedeb('0x1e')](_0x337de4);}};}function respondWithFilteredResult(_0x312e11,_0x332a59){return function(_0x272067){if(_0x272067){var _0x3c5492=typeof _0x332a59[_0xedeb('0x1f')]===_0xedeb('0x20')&&typeof _0x332a59[_0xedeb('0x21')]===_0xedeb('0x20');var _0x1323ec=_0x272067[_0xedeb('0x22')];var _0x12270a=_0x3c5492?0x0:_0x332a59[_0xedeb('0x1f')];var _0x372821=_0x3c5492?_0x272067[_0xedeb('0x22')]:_0x332a59[_0xedeb('0x1f')]+_0x332a59['limit'];var _0xc8359a;if(_0x372821>=_0x1323ec){_0x372821=_0x1323ec;_0xc8359a=0xc8;}else{_0xc8359a=0xce;}_0x312e11[_0xedeb('0x1c')](_0xc8359a);return _0x312e11[_0xedeb('0x23')](_0xedeb('0x24'),_0x12270a+'-'+_0x372821+'/'+_0x1323ec)[_0xedeb('0x1e')](_0x272067);}return null;};}function patchUpdates(_0x20bb3f){return function(_0x2123c0){try{jsonpatch[_0xedeb('0x25')](_0x2123c0,_0x20bb3f,!![]);}catch(_0x4bcaf4){return BPromise[_0xedeb('0x26')](_0x4bcaf4);}return _0x2123c0[_0xedeb('0x27')]();};}function saveUpdates(_0x8a1152,_0x36635f){return function(_0x381ae1){if(_0x381ae1){return _0x381ae1['update'](_0x8a1152)['then'](function(_0x35b30b){return _0x35b30b;});}return null;};}function removeEntity(_0x46db0d,_0x579987){return function(_0x515830){if(_0x515830){return _0x515830['destroy']()[_0xedeb('0x28')](function(){var _0x3c7b62=_0x515830[_0xedeb('0x29')]({'plain':!![]});var _0x2f156f=_0xedeb('0x2a');return db[_0xedeb('0x2b')]['destroy']({'where':{'type':_0x2f156f,'resourceId':_0x3c7b62['id']}})['then'](function(){return _0x515830;});})[_0xedeb('0x28')](function(){_0x46db0d[_0xedeb('0x1c')](0xcc)[_0xedeb('0x1d')]();});}};}function handleEntityNotFound(_0xedc43c,_0x3f92fa){return function(_0x366de0){if(!_0x366de0){_0xedc43c[_0xedeb('0x1b')](0x194);}return _0x366de0;};}function handleError(_0x3466bb,_0x58cc63){_0x58cc63=_0x58cc63||0x1f4;return function(_0x2be8e8){logger['error'](_0x2be8e8[_0xedeb('0x2c')]);if(_0x2be8e8[_0xedeb('0x2d')]){delete _0x2be8e8['name'];}_0x3466bb['status'](_0x58cc63)['send'](_0x2be8e8);};}exports[_0xedeb('0x2e')]=function(_0x13cc1b,_0xe2f12a){var _0x34de7a={},_0x7104ea={},_0x2df6c3={'count':0x0,'rows':[]};var _0x31268a=_[_0xedeb('0x2f')](db[_0xedeb('0x30')]['rawAttributes'],function(_0x133b00){return{'name':_0x133b00[_0xedeb('0x31')],'type':_0x133b00[_0xedeb('0x32')][_0xedeb('0x33')]};});_0x7104ea[_0xedeb('0x34')]=_[_0xedeb('0x2f')](_0x31268a,_0xedeb('0x2d'));_0x7104ea['query']=_[_0xedeb('0x35')](_0x13cc1b[_0xedeb('0x36')]);_0x7104ea['filters']=_[_0xedeb('0x37')](_0x7104ea['model'],_0x7104ea[_0xedeb('0x36')]);_0x34de7a[_0xedeb('0x38')]=_[_0xedeb('0x37')](_0x7104ea[_0xedeb('0x34')],qs[_0xedeb('0x39')](_0x13cc1b[_0xedeb('0x36')][_0xedeb('0x39')]));_0x34de7a['attributes']=_0x34de7a[_0xedeb('0x38')][_0xedeb('0x3a')]?_0x34de7a[_0xedeb('0x38')]:_0x7104ea[_0xedeb('0x34')];if(!_0x13cc1b[_0xedeb('0x36')][_0xedeb('0x3b')](_0xedeb('0x3c'))){_0x34de7a['limit']=qs[_0xedeb('0x21')](_0x13cc1b[_0xedeb('0x36')][_0xedeb('0x21')]);_0x34de7a[_0xedeb('0x1f')]=qs['offset'](_0x13cc1b[_0xedeb('0x36')][_0xedeb('0x1f')]);}_0x34de7a[_0xedeb('0x3d')]=qs[_0xedeb('0x3e')](_0x13cc1b['query'][_0xedeb('0x3e')]);_0x34de7a[_0xedeb('0x3f')]=qs[_0xedeb('0x40')](_[_0xedeb('0x41')](_0x13cc1b[_0xedeb('0x36')],_0x7104ea[_0xedeb('0x40')]),_0x31268a);if(_0x13cc1b['query'][_0xedeb('0x42')]){_0x34de7a[_0xedeb('0x3f')]=_[_0xedeb('0x43')](_0x34de7a['where'],{'$or':_[_0xedeb('0x2f')](_0x31268a,function(_0xe90d19){if(_0xe90d19[_0xedeb('0x32')]!==_0xedeb('0x44')){var _0x2ca2eb={};_0x2ca2eb[_0xe90d19['name']]={'$like':'%'+_0x13cc1b[_0xedeb('0x36')]['filter']+'%'};return _0x2ca2eb;}})});}_0x34de7a=_['merge']({},_0x34de7a,_0x13cc1b[_0xedeb('0x45')]);var _0x2cccb0={'where':_0x34de7a['where']};return db[_0xedeb('0x30')][_0xedeb('0x22')](_0x2cccb0)[_0xedeb('0x28')](function(_0x11375a){_0x2df6c3['count']=_0x11375a;if(_0x13cc1b[_0xedeb('0x36')]['includeAll']){_0x34de7a[_0xedeb('0x46')]=[{'all':!![]}];}return db[_0xedeb('0x30')][_0xedeb('0x47')](_0x34de7a);})[_0xedeb('0x28')](function(_0xb73820){_0x2df6c3[_0xedeb('0x48')]=_0xb73820;return _0x2df6c3;})[_0xedeb('0x28')](respondWithFilteredResult(_0xe2f12a,_0x34de7a))[_0xedeb('0x49')](handleError(_0xe2f12a,null));};exports[_0xedeb('0x4a')]=function(_0x70d82e,_0x224386){var _0x41dc2b={'raw':!![],'where':{'id':_0x70d82e[_0xedeb('0x4b')]['id']}},_0x42d7ab={};_0x42d7ab[_0xedeb('0x34')]=_[_0xedeb('0x35')](db['SmsQueue'][_0xedeb('0x4c')]);_0x42d7ab[_0xedeb('0x36')]=_[_0xedeb('0x35')](_0x70d82e[_0xedeb('0x36')]);_0x42d7ab[_0xedeb('0x40')]=_[_0xedeb('0x37')](_0x42d7ab[_0xedeb('0x34')],_0x42d7ab[_0xedeb('0x36')]);_0x41dc2b[_0xedeb('0x38')]=_[_0xedeb('0x37')](_0x42d7ab[_0xedeb('0x34')],qs[_0xedeb('0x39')](_0x70d82e['query'][_0xedeb('0x39')]));_0x41dc2b[_0xedeb('0x38')]=_0x41dc2b[_0xedeb('0x38')]['length']?_0x41dc2b[_0xedeb('0x38')]:_0x42d7ab[_0xedeb('0x34')];if(_0x70d82e['query'][_0xedeb('0x4d')]){_0x41dc2b[_0xedeb('0x46')]=[{'all':!![]}];}_0x41dc2b=_[_0xedeb('0x43')]({},_0x41dc2b,_0x70d82e[_0xedeb('0x45')]);return db['SmsQueue']['find'](_0x41dc2b)[_0xedeb('0x28')](handleEntityNotFound(_0x224386,null))[_0xedeb('0x28')](respondWithResult(_0x224386,null))['catch'](handleError(_0x224386,null));};exports[_0xedeb('0x4e')]=function(_0x753eda,_0x38c9b4){return db[_0xedeb('0x30')][_0xedeb('0x4e')](_0x753eda[_0xedeb('0x4f')],{})[_0xedeb('0x28')](function(_0x3b3137){var _0x5de3fb=_0x753eda[_0xedeb('0x50')]['get']({'plain':!![]});if(!_0x5de3fb)throw new Error(_0xedeb('0x51'));if(_0x5de3fb[_0xedeb('0x52')]==='user'){var _0x5e158d=_0x3b3137[_0xedeb('0x29')]({'plain':!![]});var _0x250668=_0xedeb('0x2a');return db[_0xedeb('0x53')][_0xedeb('0x54')]({'where':{'name':_0x250668,'userProfileId':_0x5de3fb[_0xedeb('0x55')]},'raw':!![]})[_0xedeb('0x28')](function(_0x23ee4c){if(_0x23ee4c&&_0x23ee4c[_0xedeb('0x56')]===0x0){return db[_0xedeb('0x2b')][_0xedeb('0x4e')]({'name':_0x5e158d['name'],'resourceId':_0x5e158d['id'],'type':_0x23ee4c['name'],'sectionId':_0x23ee4c['id']},{})[_0xedeb('0x28')](function(){return _0x3b3137;});}else{return _0x3b3137;}})[_0xedeb('0x49')](function(_0x109269){logger[_0xedeb('0x57')](_0xedeb('0x58'),_0x109269);throw _0x109269;});}return _0x3b3137;})[_0xedeb('0x28')](respondWithResult(_0x38c9b4,0xc9))[_0xedeb('0x49')](handleError(_0x38c9b4,null));};exports[_0xedeb('0x59')]=function(_0xd88087,_0x1c620c){if(_0xd88087[_0xedeb('0x4f')]['id']){delete _0xd88087['body']['id'];}return db['SmsQueue'][_0xedeb('0x54')]({'where':{'id':_0xd88087[_0xedeb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c620c,null))[_0xedeb('0x28')](saveUpdates(_0xd88087[_0xedeb('0x4f')],null))[_0xedeb('0x28')](respondWithResult(_0x1c620c,null))[_0xedeb('0x49')](handleError(_0x1c620c,null));};exports[_0xedeb('0x5a')]=function(_0x559f5d,_0x21adc6){return db[_0xedeb('0x30')][_0xedeb('0x54')]({'where':{'id':_0x559f5d[_0xedeb('0x4b')]['id']}})[_0xedeb('0x28')](handleEntityNotFound(_0x21adc6,null))[_0xedeb('0x28')](removeEntity(_0x21adc6,null))['catch'](handleError(_0x21adc6,null));};exports['describe']=function(_0x5e0a0a,_0x2ff74f){return db[_0xedeb('0x30')][_0xedeb('0x5b')]()['then'](respondWithResult(_0x2ff74f,null))[_0xedeb('0x49')](handleError(_0x2ff74f,null));};exports['getMembers']=function(_0x44b44d,_0x3a969a,_0x2914ff){var _0x5aeb78={'raw':!![],'where':{}},_0x4b7d59={},_0x5d5688;return db['SmsQueue'][_0xedeb('0x5c')]({'where':{'id':_0x44b44d['params']['id']}})[_0xedeb('0x28')](handleEntityNotFound(_0x3a969a,null))[_0xedeb('0x28')](function(_0x199b78){if(_0x199b78){_0x5d5688=_0x199b78[_0xedeb('0x29')]({'plain':!![]});_0x4b7d59[_0xedeb('0x34')]=_[_0xedeb('0x35')](db[_0xedeb('0x5d')][_0xedeb('0x4c')]);_0x4b7d59[_0xedeb('0x36')]=_[_0xedeb('0x35')](_0x44b44d[_0xedeb('0x36')]);_0x4b7d59['filters']=_[_0xedeb('0x37')](_0x4b7d59['model'],_0x4b7d59[_0xedeb('0x36')]);_0x5aeb78['attributes']=_[_0xedeb('0x37')](_0x4b7d59['model'],qs[_0xedeb('0x39')](_0x44b44d[_0xedeb('0x36')]['fields']));_0x5aeb78[_0xedeb('0x38')]=_0x5aeb78[_0xedeb('0x38')]['length']?_0x5aeb78[_0xedeb('0x38')]:_0x4b7d59['model'];if(!_0x44b44d[_0xedeb('0x36')]['hasOwnProperty']('nolimit')){_0x5aeb78[_0xedeb('0x21')]=qs[_0xedeb('0x21')](_0x44b44d[_0xedeb('0x36')][_0xedeb('0x21')]);_0x5aeb78[_0xedeb('0x1f')]=qs['offset'](_0x44b44d[_0xedeb('0x36')][_0xedeb('0x1f')]);}_0x5aeb78['order']=qs[_0xedeb('0x3e')](_0x44b44d[_0xedeb('0x36')][_0xedeb('0x3e')]);_0x5aeb78[_0xedeb('0x3f')]=qs['filters'](_['pick'](_0x44b44d['query'],_0x4b7d59[_0xedeb('0x40')]));_0x5aeb78[_0xedeb('0x3f')][_0xedeb('0x5e')]=_0x199b78['id'];if(_0x44b44d[_0xedeb('0x36')][_0xedeb('0x42')]){_0x5aeb78[_0xedeb('0x3f')]=_[_0xedeb('0x43')](_0x5aeb78[_0xedeb('0x3f')],{'$or':_['map'](_0x5aeb78[_0xedeb('0x38')],function(_0x2e4ac3){var _0x41dd24={};_0x41dd24[_0x2e4ac3]={'$like':'%'+_0x44b44d[_0xedeb('0x36')][_0xedeb('0x42')]+'%'};return _0x41dd24;})});}_0x5aeb78=_[_0xedeb('0x43')]({},_0x5aeb78,_0x44b44d[_0xedeb('0x45')]);return db[_0xedeb('0x5d')][_0xedeb('0x47')](_0x5aeb78);}})['then'](function(_0x389bd1){if(_0x389bd1){return db[_0xedeb('0x5f')][_0xedeb('0x60')]({'where':{'id':_[_0xedeb('0x2f')](_0x389bd1,_0xedeb('0x61')),'role':_0xedeb('0x62')},'attributes':['id',_0xedeb('0x2d'),_0xedeb('0x63'),_0xedeb('0x64'),_0xedeb('0x65')]});}})[_0xedeb('0x28')](function(_0x161209){if(_0x161209){return{'count':_0x161209['count'],'rows':_[_0xedeb('0x2f')](_0x161209[_0xedeb('0x48')],function(_0xe7927){return{'membername':_0xe7927[_0xedeb('0x2d')],'UserId':_0xe7927['id'],'queue_name':_0x5d5688[_0xedeb('0x2d')],'SmsQueueId':_0x5d5688['id'],'interface':util[_0xedeb('0x66')](_0xedeb('0x67'),_0xedeb('0x68'),_0xe7927[_0xedeb('0x2d')]),'penalty':0x0,'paused':_0xe7927[_0xedeb('0x63')],'createdAt':_0xe7927[_0xedeb('0x65')],'updatedAt':_0xe7927[_0xedeb('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xedeb('0x28')](respondWithFilteredResult(_0x3a969a,_0x5aeb78))[_0xedeb('0x49')](handleError(_0x3a969a,null));};exports[_0xedeb('0x69')]=function(_0x3468db,_0x2540ef,_0xe68a5f){var _0x84aaf5={};var _0x2901dd={};var _0x544dca;var _0x3dbaa6;return db[_0xedeb('0x30')][_0xedeb('0x5c')]({'where':{'id':_0x3468db[_0xedeb('0x4b')]['id']}})[_0xedeb('0x28')](handleEntityNotFound(_0x2540ef,null))[_0xedeb('0x28')](function(_0x1d30c3){if(_0x1d30c3){_0x544dca=_0x1d30c3;_0x2901dd['model']=_['keys'](db[_0xedeb('0x6a')][_0xedeb('0x4c')]);_0x2901dd[_0xedeb('0x36')]=_[_0xedeb('0x35')](_0x3468db[_0xedeb('0x36')]);_0x2901dd['filters']=_[_0xedeb('0x37')](_0x2901dd[_0xedeb('0x34')],_0x2901dd['query']);_0x84aaf5[_0xedeb('0x38')]=_[_0xedeb('0x37')](_0x2901dd[_0xedeb('0x34')],qs[_0xedeb('0x39')](_0x3468db[_0xedeb('0x36')][_0xedeb('0x39')]));_0x84aaf5[_0xedeb('0x38')]=_0x84aaf5[_0xedeb('0x38')][_0xedeb('0x3a')]?_0x84aaf5[_0xedeb('0x38')]:_0x2901dd[_0xedeb('0x34')];_0x84aaf5[_0xedeb('0x3d')]=qs[_0xedeb('0x3e')](_0x3468db[_0xedeb('0x36')]['sort']);_0x84aaf5[_0xedeb('0x3f')]=qs[_0xedeb('0x40')](_[_0xedeb('0x41')](_0x3468db['query'],_0x2901dd[_0xedeb('0x40')]));if(_0x3468db['query'][_0xedeb('0x42')]){_0x84aaf5[_0xedeb('0x3f')]=_['merge'](_0x84aaf5[_0xedeb('0x3f')],{'$or':_[_0xedeb('0x2f')](_0x84aaf5[_0xedeb('0x38')],function(_0x50e7f4){var _0x398e6e={};_0x398e6e[_0x50e7f4]={'$like':'%'+_0x3468db[_0xedeb('0x36')]['filter']+'%'};return _0x398e6e;})});}_0x84aaf5=_[_0xedeb('0x43')]({},_0x84aaf5,_0x3468db[_0xedeb('0x45')]);return _0x544dca['getTeams'](_0x84aaf5);}})[_0xedeb('0x28')](function(_0x1fae8b){if(_0x1fae8b){_0x3dbaa6=_0x1fae8b[_0xedeb('0x3a')];if(!_0x3468db['query'][_0xedeb('0x3b')](_0xedeb('0x3c'))){_0x84aaf5['limit']=qs[_0xedeb('0x21')](_0x3468db[_0xedeb('0x36')][_0xedeb('0x21')]);_0x84aaf5[_0xedeb('0x1f')]=qs['offset'](_0x3468db['query'][_0xedeb('0x1f')]);}return _0x544dca[_0xedeb('0x69')](_0x84aaf5);}})[_0xedeb('0x28')](function(_0x1a21f4){if(_0x1a21f4){return _0x1a21f4?{'count':_0x3dbaa6,'rows':_0x1a21f4}:null;}})[_0xedeb('0x28')](respondWithResult(_0x2540ef,null))['catch'](handleError(_0x2540ef,null));};exports[_0xedeb('0x6b')]=function(_0x46d567,_0x3d4c2e,_0x43fac3){var _0x5e13ec=_0x46d567[_0xedeb('0x4f')][_0xedeb('0x6c')];return db[_0xedeb('0x6a')][_0xedeb('0x47')]({'where':{'id':_0x5e13ec},'attributes':['id'],'include':[{'model':db[_0xedeb('0x5f')],'as':_0xedeb('0x6d'),'attributes':['id',_0xedeb('0x2d'),'online',_0xedeb('0x6e'),'interface'],'raw':!![]}]})[_0xedeb('0x28')](function(_0x549001){if(_0x549001){var _0x373e62=_[_0xedeb('0x6f')](_0x549001,function(_0x5a53dd){var _0x2b4d9a=_0x5a53dd[_0xedeb('0x29')]({'plain':!![]});return _0x2b4d9a[_0xedeb('0x6d')];});return db['SmsQueue']['find']({'where':{'id':_0x46d567[_0xedeb('0x4b')]['id']}})[_0xedeb('0x28')](function(_0x1b1e0b){return db[_0xedeb('0x70')][_0xedeb('0x71')](function(_0xd38007){return _0x1b1e0b[_0xedeb('0x6b')](_0x5e13ec,{'transaction':_0xd38007})[_0xedeb('0x28')](function(){return BPromise[_0xedeb('0x72')](_0x373e62,function(_0x1e5a32){return db['UserSmsQueue'][_0xedeb('0x73')]({'where':{'UserId':_0x1e5a32['id'],'SmsQueueId':_0x46d567[_0xedeb('0x4b')]['id']},'transaction':_0xd38007});});})[_0xedeb('0x28')](function(){_0x373e62[_0xedeb('0x74')](function(_0x201967){socket[_0xedeb('0x75')](_0xedeb('0x76'),{'UserId':_0x201967['id'],'SmsQueueId':_0x1b1e0b['id']});});});});});}})[_0xedeb('0x28')](respondWithStatusCode(_0x3d4c2e,null))[_0xedeb('0x49')](handleError(_0x3d4c2e,null));};exports[_0xedeb('0x77')]=function(_0x2b9957,_0xb3138d,_0x27e3b7){return db[_0xedeb('0x6a')][_0xedeb('0x47')]({'where':{'id':_0x2b9957[_0xedeb('0x36')][_0xedeb('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xedeb('0x5f')],'as':_0xedeb('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xedeb('0x28')](handleEntityNotFound(_0xb3138d,null))['then'](function(_0x30d972){var _0x2b3a29=_[_0xedeb('0x2f')](_0x30d972,'id');var _0x24e491=[];var _0x111587=[];var _0x136651=squel[_0xedeb('0x78')]();_0x136651[_0xedeb('0x79')](_0xedeb('0x7a'))[_0xedeb('0x7b')]('team_has_sms_queues','tq')['join'](_0xedeb('0x7c'),'ut',_0xedeb('0x7d'))[_0xedeb('0x3f')](_0xedeb('0x7e'),_0x2b9957[_0xedeb('0x4b')]['id']);for(var _0x44d7fb=0x0;_0x44d7fb<_0x30d972[_0xedeb('0x3a')];_0x44d7fb+=0x1){let _0x4d3a3b=_0x30d972[_0x44d7fb];for(var _0x94187a=0x0;_0x94187a<_0x4d3a3b[_0xedeb('0x6d')][_0xedeb('0x3a')];_0x94187a+=0x1){let _0x2dbe78=_0x4d3a3b['Agents'][_0x94187a];var _0x3d2f10=_0x136651[_0xedeb('0x7f')]();_0x3d2f10['where'](_0xedeb('0x80'),_0x2dbe78['id']);_0x111587[_0xedeb('0x81')](db[_0xedeb('0x70')][_0xedeb('0x36')](_0x3d2f10[_0xedeb('0x82')](),{'type':db[_0xedeb('0x70')][_0xedeb('0x83')][_0xedeb('0x84')]})[_0xedeb('0x28')](function(_0x47feb7){if(_0x47feb7[_0xedeb('0x3a')]===0x1){return _0x2dbe78['id'];}else{var _0x43f0ee=_[_0xedeb('0x85')](_[_0xedeb('0x2f')](_0x47feb7,_0xedeb('0x86')),function(_0x5acbae){return _[_0xedeb('0x87')](_0x2b3a29,_0x5acbae);});if(_0x43f0ee){return _0x2dbe78['id'];}}}));}}return BPromise[_0xedeb('0x88')](_0x111587)['then'](function(_0xe47016){_0x24e491=_(_0x24e491)[_0xedeb('0x89')](_0xe47016)[_0xedeb('0x8a')]()['value']();return db['SmsQueue']['find']({'where':{'id':_0x2b9957[_0xedeb('0x4b')]['id']}})[_0xedeb('0x28')](function(_0x25f480){return db[_0xedeb('0x70')][_0xedeb('0x71')](function(_0x2f8ffa){return _0x25f480[_0xedeb('0x77')](_0x2b9957['query']['ids'],{'transaction':_0x2f8ffa})['then'](function(){if(!_[_0xedeb('0x8b')](_0x24e491)){return _0x25f480[_0xedeb('0x8c')](_0x24e491,{'transaction':_0x2f8ffa});}})[_0xedeb('0x28')](function(){_0x24e491[_0xedeb('0x74')](function(_0x3e3e14){socket[_0xedeb('0x75')](_0xedeb('0x8d'),{'UserId':_0x3e3e14,'SmsQueueId':_0x25f480['id']});});});});});});})[_0xedeb('0x28')](respondWithStatusCode(_0xb3138d,null))[_0xedeb('0x49')](handleError(_0xb3138d,null));};exports[_0xedeb('0x8e')]=function(_0x36a513,_0x5385e8,_0xc05874){return db[_0xedeb('0x30')]['find']({'where':{'id':_0x36a513['params']['id']}})[_0xedeb('0x28')](handleEntityNotFound(_0x5385e8,null))[_0xedeb('0x28')](function(_0x2e7b2a){if(_0x2e7b2a){return _0x2e7b2a[_0xedeb('0x8e')](_0x36a513[_0xedeb('0x4f')][_0xedeb('0x6c')],_[_0xedeb('0x8f')](_0x36a513[_0xedeb('0x4f')],[_0xedeb('0x6c'),'id'])||{})[_0xedeb('0x90')](function(_0x27788c){for(var _0x3768cb=0x0;_0x3768cb<_0x36a513[_0xedeb('0x4f')][_0xedeb('0x6c')][_0xedeb('0x3a')];_0x3768cb+=0x1){socket['emit'](_0xedeb('0x76'),{'UserId':Number(_0x36a513[_0xedeb('0x4f')][_0xedeb('0x6c')][_0x3768cb]),'SmsQueueId':Number(_0x36a513[_0xedeb('0x4b')]['id'])});}return _0x27788c;});}})[_0xedeb('0x28')](respondWithResult(_0x5385e8,null))[_0xedeb('0x49')](handleError(_0x5385e8,null));};exports[_0xedeb('0x8c')]=function(_0x56a2f5,_0x4be0e6,_0x434088){return db[_0xedeb('0x30')]['find']({'where':{'id':_0x56a2f5[_0xedeb('0x4b')]['id']}})[_0xedeb('0x28')](handleEntityNotFound(_0x4be0e6,null))[_0xedeb('0x28')](function(_0x292ab7){if(_0x292ab7){return _0x292ab7[_0xedeb('0x8c')](_0x56a2f5[_0xedeb('0x36')][_0xedeb('0x6c')])[_0xedeb('0x28')](function(){if(_['isArray'](_0x56a2f5[_0xedeb('0x36')][_0xedeb('0x6c')])){for(var _0x1782af=0x0;_0x1782af<_0x56a2f5[_0xedeb('0x36')]['ids'][_0xedeb('0x3a')];_0x1782af+=0x1){socket[_0xedeb('0x75')](_0xedeb('0x8d'),{'UserId':Number(_0x56a2f5[_0xedeb('0x36')][_0xedeb('0x6c')][_0x1782af]),'SmsQueueId':Number(_0x56a2f5['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x56a2f5[_0xedeb('0x36')][_0xedeb('0x6c')]),'SmsQueueId':Number(_0x56a2f5[_0xedeb('0x4b')]['id'])});}});}})[_0xedeb('0x28')](respondWithStatusCode(_0x4be0e6,null))[_0xedeb('0x49')](handleError(_0x4be0e6,null));};exports[_0xedeb('0x91')]=function(_0x596802,_0x2576cd,_0x2f82fe){var _0x2941bf={};var _0x548d44={};var _0x5c5a66;var _0x4c960f;return db[_0xedeb('0x30')][_0xedeb('0x5c')]({'where':{'id':_0x596802['params']['id']}})[_0xedeb('0x28')](handleEntityNotFound(_0x2576cd,null))[_0xedeb('0x28')](function(_0x1e4056){if(_0x1e4056){_0x5c5a66=_0x1e4056;_0x548d44[_0xedeb('0x34')]=_[_0xedeb('0x35')](db[_0xedeb('0x5f')]['rawAttributes']);_0x548d44[_0xedeb('0x36')]=_['keys'](_0x596802['query']);_0x548d44[_0xedeb('0x40')]=_[_0xedeb('0x37')](_0x548d44[_0xedeb('0x34')],_0x548d44['query']);_0x2941bf[_0xedeb('0x38')]=_[_0xedeb('0x37')](_0x548d44[_0xedeb('0x34')],qs[_0xedeb('0x39')](_0x596802[_0xedeb('0x36')][_0xedeb('0x39')]));_0x2941bf[_0xedeb('0x38')]=_0x2941bf['attributes']['length']?_0x2941bf[_0xedeb('0x38')]:_0x548d44[_0xedeb('0x34')];_0x2941bf['order']=qs[_0xedeb('0x3e')](_0x596802[_0xedeb('0x36')][_0xedeb('0x3e')]);_0x2941bf[_0xedeb('0x3f')]=qs[_0xedeb('0x40')](_[_0xedeb('0x41')](_0x596802[_0xedeb('0x36')],_0x548d44[_0xedeb('0x40')]));if(_0x596802[_0xedeb('0x36')][_0xedeb('0x42')]){_0x2941bf[_0xedeb('0x3f')]=_[_0xedeb('0x43')](_0x2941bf[_0xedeb('0x3f')],{'$or':_[_0xedeb('0x2f')](_0x2941bf['attributes'],function(_0x14107a){var _0x447f3d={};_0x447f3d[_0x14107a]={'$like':'%'+_0x596802[_0xedeb('0x36')][_0xedeb('0x42')]+'%'};return _0x447f3d;})});}_0x2941bf=_['merge']({},_0x2941bf,_0x596802[_0xedeb('0x45')]);return _0x5c5a66[_0xedeb('0x91')](_0x2941bf);}})['then'](function(_0x3317f6){if(_0x3317f6){_0x4c960f=_0x3317f6[_0xedeb('0x3a')];if(!_0x596802[_0xedeb('0x36')]['hasOwnProperty'](_0xedeb('0x3c'))){_0x2941bf['limit']=qs[_0xedeb('0x21')](_0x596802[_0xedeb('0x36')][_0xedeb('0x21')]);_0x2941bf[_0xedeb('0x1f')]=qs[_0xedeb('0x1f')](_0x596802[_0xedeb('0x36')][_0xedeb('0x1f')]);}return _0x5c5a66[_0xedeb('0x91')](_0x2941bf);}})[_0xedeb('0x28')](function(_0x5b20cb){if(_0x5b20cb){return _0x5b20cb?{'count':_0x4c960f,'rows':_0x5b20cb}:null;}})[_0xedeb('0x28')](respondWithResult(_0x2576cd,null))[_0xedeb('0x49')](handleError(_0x2576cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index a2e3444..2a3b48b 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 _0x7e43=['hasOwnProperty','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7e43,0x182));var _0x37e4=function(_0x1a612f,_0xac4511){_0x1a612f=_0x1a612f-0x0;var _0x24ad3c=_0x7e43[_0x1a612f];return _0x24ad3c;};'use strict';var EventEmitter=require(_0x37e4('0x0'));var SmsQueue=require(_0x37e4('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x37e4('0x2'),'afterUpdate':_0x37e4('0x3'),'afterDestroy':_0x37e4('0x4')};function emitEvent(_0x4dd844){return function(_0x3828f2,_0x225f86,_0x49bddb){SmsQueueEvents[_0x37e4('0x5')](_0x4dd844+':'+_0x3828f2['id'],_0x3828f2);SmsQueueEvents['emit'](_0x4dd844,_0x3828f2);_0x49bddb(null);};}for(var e in events){if(events[_0x37e4('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x37e4('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x3667=['setMaxListeners','save','update','remove','emit','hasOwnProperty','SmsQueue'];(function(_0x2fc1db,_0x39646c){var _0x303cbf=function(_0x4ac414){while(--_0x4ac414){_0x2fc1db['push'](_0x2fc1db['shift']());}};_0x303cbf(++_0x39646c);}(_0x3667,0xf4));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x7366('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7366('0x1')](0x0);var events={'afterCreate':_0x7366('0x2'),'afterUpdate':_0x7366('0x3'),'afterDestroy':_0x7366('0x4')};function emitEvent(_0x445fe0){return function(_0x161324,_0x4573bc,_0x1ee45f){SmsQueueEvents[_0x7366('0x5')](_0x445fe0+':'+_0x161324['id'],_0x161324);SmsQueueEvents[_0x7366('0x5')](_0x445fe0,_0x161324);_0x1ee45f(null);};}for(var e in events){if(events[_0x7366('0x6')](e)){var event=events[e];SmsQueue['hook'](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 273af23..9bb6498 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 _0x2988=['path','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x1a4397,_0x5f00f3){var _0x518e11=function(_0x2419d8){while(--_0x2419d8){_0x1a4397['push'](_0x1a4397['shift']());}};_0x518e11(++_0x5f00f3);}(_0x2988,0x103));var _0x8298=function(_0x4b525b,_0x398c49){_0x4b525b=_0x4b525b-0x0;var _0x425d1f=_0x2988[_0x4b525b];return _0x425d1f;};'use strict';var _=require(_0x8298('0x0'));var util=require(_0x8298('0x1'));var logger=require(_0x8298('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8298('0x3'));var rp=require(_0x8298('0x4'));var fs=require('fs');var path=require(_0x8298('0x5'));var rimraf=require('rimraf');var config=require(_0x8298('0x6'));var attributes=require(_0x8298('0x7'));module[_0x8298('0x8')]=function(_0x4ca7f9,_0x45a8b){return _0x4ca7f9[_0x8298('0x9')](_0x8298('0xa'),attributes,{'tableName':_0x8298('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d5e=['exports','define','SmsQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x59e0cb,_0x5f16f5){var _0x11948a=function(_0x2012ea){while(--_0x2012ea){_0x59e0cb['push'](_0x59e0cb['shift']());}};_0x11948a(++_0x5f16f5);}(_0x6d5e,0xb9));var _0xe6d5=function(_0x3c5e9f,_0xfac86a){_0x3c5e9f=_0x3c5e9f-0x0;var _0x461d85=_0x6d5e[_0x3c5e9f];return _0x461d85;};'use strict';var _=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var logger=require(_0xe6d5('0x2'))(_0xe6d5('0x3'));var moment=require(_0xe6d5('0x4'));var BPromise=require(_0xe6d5('0x5'));var rp=require(_0xe6d5('0x6'));var fs=require('fs');var path=require(_0xe6d5('0x7'));var rimraf=require(_0xe6d5('0x8'));var config=require(_0xe6d5('0x9'));var attributes=require(_0xe6d5('0xa'));module[_0xe6d5('0xb')]=function(_0x128d07,_0x4a711b){return _0x128d07[_0xe6d5('0xc')](_0xe6d5('0xd'),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 3c8ce8d..e42c4cc 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 _0x5aaa=['request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','SmsQueue','findAll','options','raw','where','attributes','include','map','model','GetSmsQueue','stringify','catch','find','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s'];(function(_0x472ae8,_0x2a0fc7){var _0x48240f=function(_0x25d53e){while(--_0x25d53e){_0x472ae8['push'](_0x472ae8['shift']());}};_0x48240f(++_0x2a0fc7);}(_0x5aaa,0x18e));var _0xa5aa=function(_0x3e93a1,_0x6579e3){_0x3e93a1=_0x3e93a1-0x0;var _0x471640=_0x5aaa[_0x3e93a1];return _0x471640;};'use strict';var _=require(_0xa5aa('0x0'));var util=require('util');var moment=require(_0xa5aa('0x1'));var BPromise=require(_0xa5aa('0x2'));var rs=require(_0xa5aa('0x3'));var fs=require('fs');var Redis=require(_0xa5aa('0x4'));var db=require(_0xa5aa('0x5'))['db'];var utils=require(_0xa5aa('0x6'));var logger=require(_0xa5aa('0x7'))(_0xa5aa('0x8'));var config=require(_0xa5aa('0x9'));var jayson=require(_0xa5aa('0xa'));var client=jayson[_0xa5aa('0xb')][_0xa5aa('0xc')]({'port':0x232a});config[_0xa5aa('0xd')]=_[_0xa5aa('0xe')](config[_0xa5aa('0xd')],{'host':_0xa5aa('0xf'),'port':0x18eb});var socket=require(_0xa5aa('0x10'))(new Redis(config[_0xa5aa('0xd')]));require(_0xa5aa('0x11'))['register'](socket);function respondWithRpcPromise(_0x32a91f,_0x24e0aa,_0xc79f21){return new BPromise(function(_0x51c43d,_0x1c64a9){return client[_0xa5aa('0x12')](_0x32a91f,_0xc79f21)[_0xa5aa('0x13')](function(_0x50b8cf){logger[_0xa5aa('0x14')](_0xa5aa('0x15'),_0x24e0aa,_0xa5aa('0x16'));logger[_0xa5aa('0x17')](_0xa5aa('0x18'),_0x24e0aa,_0xa5aa('0x16'),JSON['stringify'](_0x50b8cf));if(_0x50b8cf[_0xa5aa('0x19')]){if(_0x50b8cf[_0xa5aa('0x19')]['code']===0x1f4){logger[_0xa5aa('0x19')](_0xa5aa('0x15'),_0x24e0aa,_0x50b8cf[_0xa5aa('0x19')][_0xa5aa('0x1a')]);return _0x1c64a9(_0x50b8cf[_0xa5aa('0x19')]['message']);}logger['error'](_0xa5aa('0x15'),_0x24e0aa,_0x50b8cf[_0xa5aa('0x19')]['message']);return _0x51c43d(_0x50b8cf[_0xa5aa('0x19')]['message']);}else{logger[_0xa5aa('0x14')](_0xa5aa('0x15'),_0x24e0aa,_0xa5aa('0x16'));_0x51c43d(_0x50b8cf[_0xa5aa('0x1b')][_0xa5aa('0x1a')]);}})['catch'](function(_0x49ddb0){logger[_0xa5aa('0x19')](_0xa5aa('0x15'),_0x24e0aa,_0x49ddb0);_0x1c64a9(_0x49ddb0);});});}exports['GetSmsQueue']=function(_0x5e319c){var _0x251fba=this;return new Promise(function(_0x59b44b,_0x3738c9){return db[_0xa5aa('0x1c')][_0xa5aa('0x1d')]({'raw':_0x5e319c['options']?_0x5e319c[_0xa5aa('0x1e')][_0xa5aa('0x1f')]===undefined?!![]:![]:!![],'where':_0x5e319c[_0xa5aa('0x1e')]?_0x5e319c[_0xa5aa('0x1e')][_0xa5aa('0x20')]||null:null,'attributes':_0x5e319c[_0xa5aa('0x1e')]?_0x5e319c[_0xa5aa('0x1e')][_0xa5aa('0x21')]||null:null,'limit':_0x5e319c[_0xa5aa('0x1e')]?_0x5e319c[_0xa5aa('0x1e')]['limit']||null:null,'include':_0x5e319c[_0xa5aa('0x1e')]?_0x5e319c[_0xa5aa('0x1e')][_0xa5aa('0x22')]?_[_0xa5aa('0x23')](_0x5e319c[_0xa5aa('0x1e')][_0xa5aa('0x22')],function(_0x1c6e81){return{'model':db[_0x1c6e81['model']],'as':_0x1c6e81['as'],'attributes':_0x1c6e81[_0xa5aa('0x21')],'include':_0x1c6e81[_0xa5aa('0x22')]?_[_0xa5aa('0x23')](_0x1c6e81[_0xa5aa('0x22')],function(_0x3fd943){return{'model':db[_0x3fd943['model']],'as':_0x3fd943['as'],'attributes':_0x3fd943['attributes'],'include':_0x3fd943[_0xa5aa('0x22')]?_[_0xa5aa('0x23')](_0x3fd943[_0xa5aa('0x22')],function(_0x2bf326){return{'model':db[_0x2bf326[_0xa5aa('0x24')]],'as':_0x2bf326['as'],'attributes':_0x2bf326['attributes']};}):[]};}):[]};}):[]:[]})[_0xa5aa('0x13')](function(_0xe593f2){logger['info']('GetSmsQueue',_0x5e319c);logger[_0xa5aa('0x17')](_0xa5aa('0x25'),_0x5e319c,JSON[_0xa5aa('0x26')](_0xe593f2));_0x59b44b(_0xe593f2);})[_0xa5aa('0x27')](function(_0xf66d98){logger[_0xa5aa('0x19')]('GetSmsQueue',_0xf66d98[_0xa5aa('0x1a')],_0x5e319c);_0x3738c9(_0x251fba[_0xa5aa('0x19')](0x1f4,_0xf66d98[_0xa5aa('0x1a')]));});});};exports['ShowSmsQueue']=function(_0x4b5ee2){var _0x5eb290=this;return new Promise(function(_0x2a52fd,_0x2684a1){return db[_0xa5aa('0x1c')][_0xa5aa('0x28')]({'raw':_0x4b5ee2[_0xa5aa('0x1e')]?_0x4b5ee2[_0xa5aa('0x1e')][_0xa5aa('0x1f')]===undefined?!![]:![]:!![],'where':_0x4b5ee2[_0xa5aa('0x1e')]?_0x4b5ee2[_0xa5aa('0x1e')][_0xa5aa('0x20')]||null:null,'attributes':_0x4b5ee2[_0xa5aa('0x1e')]?_0x4b5ee2[_0xa5aa('0x1e')][_0xa5aa('0x21')]||null:null,'include':_0x4b5ee2['options']?_0x4b5ee2['options'][_0xa5aa('0x22')]?_[_0xa5aa('0x23')](_0x4b5ee2[_0xa5aa('0x1e')]['include'],function(_0x52ef6e){return{'model':db[_0x52ef6e[_0xa5aa('0x24')]],'as':_0x52ef6e['as'],'attributes':_0x52ef6e[_0xa5aa('0x21')],'include':_0x52ef6e['include']?_['map'](_0x52ef6e[_0xa5aa('0x22')],function(_0xaca753){return{'model':db[_0xaca753[_0xa5aa('0x24')]],'as':_0xaca753['as'],'attributes':_0xaca753[_0xa5aa('0x21')],'include':_0xaca753[_0xa5aa('0x22')]?_[_0xa5aa('0x23')](_0xaca753[_0xa5aa('0x22')],function(_0x2bf271){return{'model':db[_0x2bf271['model']],'as':_0x2bf271['as'],'attributes':_0x2bf271[_0xa5aa('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa5aa('0x13')](function(_0x21cab1){logger['info'](_0xa5aa('0x29'),_0x4b5ee2);logger[_0xa5aa('0x17')](_0xa5aa('0x29'),_0x4b5ee2,JSON[_0xa5aa('0x26')](_0x21cab1));_0x2a52fd(_0x21cab1);})[_0xa5aa('0x27')](function(_0x3524b1){logger['error']('ShowSmsQueue',_0x3524b1[_0xa5aa('0x1a')],_0x4b5ee2);_0x2684a1(_0x5eb290[_0xa5aa('0x19')](0x1f4,_0x3524b1[_0xa5aa('0x1a')]));});});}; \ No newline at end of file +var _0xc2c2=['debug','stringify','error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','where','limit','include','model','attributes','catch','ShowSmsQueue','raw','map','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5d6b31,_0x4a1326){var _0x185b50=function(_0x63a9f6){while(--_0x63a9f6){_0x5d6b31['push'](_0x5d6b31['shift']());}};_0x185b50(++_0x4a1326);}(_0xc2c2,0x1e8));var _0x2c2c=function(_0x2a0630,_0x342bb3){_0x2a0630=_0x2a0630-0x0;var _0x2d5978=_0xc2c2[_0x2a0630];return _0x2d5978;};'use strict';var _=require('lodash');var util=require(_0x2c2c('0x0'));var moment=require('moment');var BPromise=require(_0x2c2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2c('0x2'));var db=require(_0x2c2c('0x3'))['db'];var utils=require(_0x2c2c('0x4'));var logger=require('../../config/logger')(_0x2c2c('0x5'));var config=require('../../config/environment');var jayson=require(_0x2c2c('0x6'));var client=jayson[_0x2c2c('0x7')][_0x2c2c('0x8')]({'port':0x232a});config[_0x2c2c('0x9')]=_[_0x2c2c('0xa')](config[_0x2c2c('0x9')],{'host':_0x2c2c('0xb'),'port':0x18eb});var socket=require(_0x2c2c('0xc'))(new Redis(config[_0x2c2c('0x9')]));require(_0x2c2c('0xd'))[_0x2c2c('0xe')](socket);function respondWithRpcPromise(_0x47cbef,_0x42ce89,_0x14d521){return new BPromise(function(_0x345b8f,_0x44d76f){return client[_0x2c2c('0xf')](_0x47cbef,_0x14d521)[_0x2c2c('0x10')](function(_0x5897de){logger['info'](_0x2c2c('0x11'),_0x42ce89,_0x2c2c('0x12'));logger[_0x2c2c('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x42ce89,_0x2c2c('0x12'),JSON[_0x2c2c('0x14')](_0x5897de));if(_0x5897de['error']){if(_0x5897de[_0x2c2c('0x15')][_0x2c2c('0x16')]===0x1f4){logger['error'](_0x2c2c('0x11'),_0x42ce89,_0x5897de[_0x2c2c('0x15')]['message']);return _0x44d76f(_0x5897de['error'][_0x2c2c('0x17')]);}logger[_0x2c2c('0x15')](_0x2c2c('0x11'),_0x42ce89,_0x5897de[_0x2c2c('0x15')]['message']);return _0x345b8f(_0x5897de['error']['message']);}else{logger[_0x2c2c('0x18')](_0x2c2c('0x11'),_0x42ce89,_0x2c2c('0x12'));_0x345b8f(_0x5897de[_0x2c2c('0x19')][_0x2c2c('0x17')]);}})['catch'](function(_0x250ed1){logger[_0x2c2c('0x15')]('SmsQueue,\x20%s,\x20%s',_0x42ce89,_0x250ed1);_0x44d76f(_0x250ed1);});});}exports[_0x2c2c('0x1a')]=function(_0x3831c4){var _0x52d1c0=this;return new Promise(function(_0x35fe63,_0x49dc36){return db[_0x2c2c('0x1b')][_0x2c2c('0x1c')]({'raw':_0x3831c4['options']?_0x3831c4[_0x2c2c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3831c4[_0x2c2c('0x1d')]?_0x3831c4['options'][_0x2c2c('0x1e')]||null:null,'attributes':_0x3831c4['options']?_0x3831c4[_0x2c2c('0x1d')]['attributes']||null:null,'limit':_0x3831c4[_0x2c2c('0x1d')]?_0x3831c4[_0x2c2c('0x1d')][_0x2c2c('0x1f')]||null:null,'include':_0x3831c4[_0x2c2c('0x1d')]?_0x3831c4['options']['include']?_['map'](_0x3831c4['options'][_0x2c2c('0x20')],function(_0x12c55a){return{'model':db[_0x12c55a[_0x2c2c('0x21')]],'as':_0x12c55a['as'],'attributes':_0x12c55a[_0x2c2c('0x22')],'include':_0x12c55a[_0x2c2c('0x20')]?_['map'](_0x12c55a['include'],function(_0x3dd5c5){return{'model':db[_0x3dd5c5['model']],'as':_0x3dd5c5['as'],'attributes':_0x3dd5c5[_0x2c2c('0x22')],'include':_0x3dd5c5[_0x2c2c('0x20')]?_['map'](_0x3dd5c5['include'],function(_0x52f004){return{'model':db[_0x52f004[_0x2c2c('0x21')]],'as':_0x52f004['as'],'attributes':_0x52f004[_0x2c2c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2c2c('0x10')](function(_0x405178){logger['info']('GetSmsQueue',_0x3831c4);logger[_0x2c2c('0x13')]('GetSmsQueue',_0x3831c4,JSON[_0x2c2c('0x14')](_0x405178));_0x35fe63(_0x405178);})[_0x2c2c('0x23')](function(_0x761038){logger[_0x2c2c('0x15')]('GetSmsQueue',_0x761038['message'],_0x3831c4);_0x49dc36(_0x52d1c0[_0x2c2c('0x15')](0x1f4,_0x761038[_0x2c2c('0x17')]));});});};exports[_0x2c2c('0x24')]=function(_0x4732bc){var _0x141055=this;return new Promise(function(_0x105772,_0x5de4c2){return db[_0x2c2c('0x1b')]['find']({'raw':_0x4732bc[_0x2c2c('0x1d')]?_0x4732bc[_0x2c2c('0x1d')][_0x2c2c('0x25')]===undefined?!![]:![]:!![],'where':_0x4732bc['options']?_0x4732bc[_0x2c2c('0x1d')]['where']||null:null,'attributes':_0x4732bc[_0x2c2c('0x1d')]?_0x4732bc['options'][_0x2c2c('0x22')]||null:null,'include':_0x4732bc[_0x2c2c('0x1d')]?_0x4732bc[_0x2c2c('0x1d')]['include']?_[_0x2c2c('0x26')](_0x4732bc[_0x2c2c('0x1d')][_0x2c2c('0x20')],function(_0x1d29b5){return{'model':db[_0x1d29b5[_0x2c2c('0x21')]],'as':_0x1d29b5['as'],'attributes':_0x1d29b5['attributes'],'include':_0x1d29b5['include']?_[_0x2c2c('0x26')](_0x1d29b5[_0x2c2c('0x20')],function(_0x12c8b8){return{'model':db[_0x12c8b8[_0x2c2c('0x21')]],'as':_0x12c8b8['as'],'attributes':_0x12c8b8[_0x2c2c('0x22')],'include':_0x12c8b8[_0x2c2c('0x20')]?_[_0x2c2c('0x26')](_0x12c8b8['include'],function(_0x571d38){return{'model':db[_0x571d38['model']],'as':_0x571d38['as'],'attributes':_0x571d38[_0x2c2c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2c2c('0x10')](function(_0x165833){logger[_0x2c2c('0x18')](_0x2c2c('0x24'),_0x4732bc);logger[_0x2c2c('0x13')]('ShowSmsQueue',_0x4732bc,JSON[_0x2c2c('0x14')](_0x165833));_0x105772(_0x165833);})[_0x2c2c('0x23')](function(_0x2db3af){logger[_0x2c2c('0x15')](_0x2c2c('0x24'),_0x2db3af[_0x2c2c('0x17')],_0x4732bc);_0x5de4c2(_0x141055['error'](0x1f4,_0x2db3af[_0x2c2c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index eb73c1a..18c27fa 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 _0x5e89=['removeListener','register','smsQueue:','save','remove','update','emit'];(function(_0x4cd405,_0x113676){var _0x2d5699=function(_0x2a12e3){while(--_0x2a12e3){_0x4cd405['push'](_0x4cd405['shift']());}};_0x2d5699(++_0x113676);}(_0x5e89,0x16f));var _0x95e8=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5e89[_0x5d4607];return _0x5e4a86;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x95e8('0x0'),_0x95e8('0x1'),_0x95e8('0x2')];function createListener(_0x58e6b1,_0x3992cd){return function(_0x46d4a1){_0x3992cd[_0x95e8('0x3')](_0x58e6b1,_0x46d4a1);};}function removeListener(_0x11a13e,_0x4867b7){return function(){SmsQueueEvents[_0x95e8('0x4')](_0x11a13e,_0x4867b7);};}exports[_0x95e8('0x5')]=function(_0x389d44){for(var _0x1af8bf=0x0,_0x3d3872=events['length'];_0x1af8bf<_0x3d3872;_0x1af8bf++){var _0x4cd712=events[_0x1af8bf];var _0x2177af=createListener(_0x95e8('0x6')+_0x4cd712,_0x389d44);SmsQueueEvents['on'](_0x4cd712,_0x2177af);}}; \ No newline at end of file +var _0x31dc=['save','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x5bab78,_0x14d33a){var _0x42b215=function(_0x489f1a){while(--_0x489f1a){_0x5bab78['push'](_0x5bab78['shift']());}};_0x42b215(++_0x14d33a);}(_0x31dc,0x164));var _0xc31d=function(_0x47e02d,_0x4e667a){_0x47e02d=_0x47e02d-0x0;var _0x95923c=_0x31dc[_0x47e02d];return _0x95923c;};'use strict';var SmsQueueEvents=require(_0xc31d('0x0'));var events=[_0xc31d('0x1'),'remove','update'];function createListener(_0x3a435f,_0x7a536f){return function(_0x43702e){_0x7a536f[_0xc31d('0x2')](_0x3a435f,_0x43702e);};}function removeListener(_0x15745d,_0x192135){return function(){SmsQueueEvents[_0xc31d('0x3')](_0x15745d,_0x192135);};}exports[_0xc31d('0x4')]=function(_0x18c639){for(var _0x1e8dc9=0x0,_0x2822d7=events[_0xc31d('0x5')];_0x1e8dc9<_0x2822d7;_0x1e8dc9++){var _0x5f5404=events[_0x1e8dc9];var _0x3a3a4d=createListener(_0xc31d('0x6')+_0x5f5404,_0x18c639);SmsQueueEvents['on'](_0x5f5404,_0x3a3a4d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 07f0035..b151172 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 _0x850e=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x4f6c26,_0x5c2c54){var _0x4809a0=function(_0x1b30a9){while(--_0x1b30a9){_0x4f6c26['push'](_0x4f6c26['shift']());}};_0x4809a0(++_0x5c2c54);}(_0x850e,0xaa));var _0xe850=function(_0x3f6245,_0x13cdce){_0x3f6245=_0x3f6245-0x0;var _0x2f9d4b=_0x850e[_0x3f6245];return _0x2f9d4b;};'use strict';var multer=require(_0xe850('0x0'));var util=require(_0xe850('0x1'));var path=require(_0xe850('0x2'));var timeout=require(_0xe850('0x3'));var express=require(_0xe850('0x4'));var router=express[_0xe850('0x5')]();var fs_extra=require(_0xe850('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe850('0x7'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0xe850('0x8')]('/',auth[_0xe850('0x9')](),controller['index']);router['get'](_0xe850('0xa'),auth['isAuthenticated'](),controller[_0xe850('0xb')]);router[_0xe850('0x8')](_0xe850('0xc'),auth['isAuthenticated'](),controller[_0xe850('0xd')]);router[_0xe850('0xe')]('/',auth[_0xe850('0x9')](),controller[_0xe850('0xf')]);router[_0xe850('0x10')](_0xe850('0xc'),auth['isAuthenticated'](),controller[_0xe850('0x11')]);router[_0xe850('0x12')](_0xe850('0xc'),auth[_0xe850('0x9')](),controller[_0xe850('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6240=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x10c793,_0x397641){var _0x303871=function(_0x5bcc53){while(--_0x5bcc53){_0x10c793['push'](_0x10c793['shift']());}};_0x303871(++_0x397641);}(_0x6240,0xb3));var _0x0624=function(_0x1c3158,_0x5ebb9e){_0x1c3158=_0x1c3158-0x0;var _0x55cfee=_0x6240[_0x1c3158];return _0x55cfee;};'use strict';var multer=require(_0x0624('0x0'));var util=require(_0x0624('0x1'));var path=require(_0x0624('0x2'));var timeout=require('connect-timeout');var express=require(_0x0624('0x3'));var router=express[_0x0624('0x4')]();var fs_extra=require(_0x0624('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0624('0x6'));var config=require(_0x0624('0x7'));var controller=require(_0x0624('0x8'));router[_0x0624('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0624('0x9')]('/describe',auth[_0x0624('0xa')](),controller['describe']);router[_0x0624('0x9')](_0x0624('0xb'),auth[_0x0624('0xa')](),controller[_0x0624('0xc')]);router[_0x0624('0xd')]('/',auth[_0x0624('0xa')](),controller[_0x0624('0xe')]);router[_0x0624('0xf')](_0x0624('0xb'),auth[_0x0624('0xa')](),controller['update']);router[_0x0624('0x10')](_0x0624('0xb'),auth[_0x0624('0xa')](),controller[_0x0624('0x11')]);module[_0x0624('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 00c28bf..91f3c92 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 _0xf011=['moment','sequelize','exports','STRING','DATE'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf011,0x1ae));var _0x1f01=function(_0x33d68b,_0x2b199c){_0x33d68b=_0x33d68b-0x0;var _0x1dd966=_0xf011[_0x33d68b];return _0x1dd966;};'use strict';var moment=require(_0x1f01('0x0'));var Sequelize=require(_0x1f01('0x1'));module[_0x1f01('0x2')]={'uniqueid':{'type':Sequelize[_0x1f01('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1f01('0x3')]},'joinAt':{'type':Sequelize[_0x1f01('0x4')]},'leaveAt':{'type':Sequelize[_0x1f01('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1f01('0x3')]}}; \ No newline at end of file +var _0xf2f7=['exports','DATE','STRING','moment'];(function(_0x55c115,_0x2a15f4){var _0x57cb1d=function(_0x2c00f5){while(--_0x2c00f5){_0x55c115['push'](_0x55c115['shift']());}};_0x57cb1d(++_0x2a15f4);}(_0xf2f7,0xa3));var _0x7f2f=function(_0x845d70,_0x1d9fe7){_0x845d70=_0x845d70-0x0;var _0x46e956=_0xf2f7[_0x845d70];return _0x46e956;};'use strict';var moment=require(_0x7f2f('0x0'));var Sequelize=require('sequelize');module[_0x7f2f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7f2f('0x2')]},'leaveAt':{'type':Sequelize[_0x7f2f('0x2')]},'acceptAt':{'type':Sequelize[_0x7f2f('0x2')]},'exitAt':{'type':Sequelize[_0x7f2f('0x2')]},'reason':{'type':Sequelize[_0x7f2f('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 5afad6f..07e4869 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 _0x06c2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','index','rawAttributes','type','key','model','map','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','SmsQueueReport','findAll','show','include','merge','find','catch','create','body','params','describe','eml-format','rimraf'];(function(_0x175667,_0x2fe754){var _0x438fb4=function(_0x5bef75){while(--_0x5bef75){_0x175667['push'](_0x175667['shift']());}};_0x438fb4(++_0x2fe754);}(_0x06c2,0x98));var _0x206c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x06c2[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x206c('0x0'));var rimraf=require(_0x206c('0x1'));var zipdir=require(_0x206c('0x2'));var jsonpatch=require(_0x206c('0x3'));var rp=require(_0x206c('0x4'));var moment=require(_0x206c('0x5'));var BPromise=require(_0x206c('0x6'));var Mustache=require(_0x206c('0x7'));var util=require(_0x206c('0x8'));var path=require(_0x206c('0x9'));var sox=require(_0x206c('0xa'));var csv=require('to-csv');var ejs=require(_0x206c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x206c('0xc'));var squel=require('squel');var crypto=require(_0x206c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x206c('0xe'));var toCsv=require(_0x206c('0xf'));var querystring=require(_0x206c('0x10'));var Papa=require(_0x206c('0x11'));var Redis=require(_0x206c('0x12'));var authService=require(_0x206c('0x13'));var qs=require(_0x206c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x206c('0x15'))(_0x206c('0x16'));var utils=require(_0x206c('0x17'));var config=require(_0x206c('0x18'));var licenseUtil=require(_0x206c('0x19'));var db=require(_0x206c('0x1a'))['db'];function respondWithStatusCode(_0x1300f8,_0x154e5c){_0x154e5c=_0x154e5c||0xcc;return function(_0x4af310){if(_0x4af310){return _0x1300f8[_0x206c('0x1b')](_0x154e5c);}return _0x1300f8['status'](_0x154e5c)['end']();};}function respondWithResult(_0x2d5cc7,_0x4bd1c2){_0x4bd1c2=_0x4bd1c2||0xc8;return function(_0x425678){if(_0x425678){return _0x2d5cc7[_0x206c('0x1c')](_0x4bd1c2)[_0x206c('0x1d')](_0x425678);}};}function respondWithFilteredResult(_0x52fae0,_0x1dd0c4){return function(_0x5f2d21){if(_0x5f2d21){var _0x133e3b=typeof _0x1dd0c4[_0x206c('0x1e')]==='undefined'&&typeof _0x1dd0c4[_0x206c('0x1f')]===_0x206c('0x20');var _0x58c636=_0x5f2d21[_0x206c('0x21')];var _0x17706a=_0x133e3b?0x0:_0x1dd0c4[_0x206c('0x1e')];var _0x3e6314=_0x133e3b?_0x5f2d21[_0x206c('0x21')]:_0x1dd0c4[_0x206c('0x1e')]+_0x1dd0c4['limit'];var _0xa26ff1;if(_0x3e6314>=_0x58c636){_0x3e6314=_0x58c636;_0xa26ff1=0xc8;}else{_0xa26ff1=0xce;}_0x52fae0['status'](_0xa26ff1);return _0x52fae0[_0x206c('0x22')](_0x206c('0x23'),_0x17706a+'-'+_0x3e6314+'/'+_0x58c636)[_0x206c('0x1d')](_0x5f2d21);}return null;};}function patchUpdates(_0x4af38e){return function(_0x5c8da9){try{jsonpatch[_0x206c('0x24')](_0x5c8da9,_0x4af38e,!![]);}catch(_0x517481){return BPromise[_0x206c('0x25')](_0x517481);}return _0x5c8da9[_0x206c('0x26')]();};}function saveUpdates(_0x50603c,_0x1ea049){return function(_0x5d83df){if(_0x5d83df){return _0x5d83df['update'](_0x50603c)[_0x206c('0x27')](function(_0x93bc40){return _0x93bc40;});}return null;};}function removeEntity(_0x58ad20,_0xc08e3){return function(_0x416162){if(_0x416162){return _0x416162[_0x206c('0x28')]()[_0x206c('0x27')](function(){_0x58ad20[_0x206c('0x1c')](0xcc)[_0x206c('0x29')]();});}};}function handleEntityNotFound(_0x8c3427,_0x4d8e71){return function(_0x4696de){if(!_0x4696de){_0x8c3427[_0x206c('0x1b')](0x194);}return _0x4696de;};}function handleError(_0x21b1fe,_0x3aa289){_0x3aa289=_0x3aa289||0x1f4;return function(_0x83caab){logger['error'](_0x83caab[_0x206c('0x2a')]);if(_0x83caab['name']){delete _0x83caab['name'];}_0x21b1fe['status'](_0x3aa289)['send'](_0x83caab);};}exports[_0x206c('0x2b')]=function(_0x2826e9,_0x521d0c){var _0x3e20c4={},_0x4886c5={},_0x4af8d2={'count':0x0,'rows':[]};var _0x5682d2=_['map'](db['SmsQueueReport'][_0x206c('0x2c')],function(_0x49bb44){return{'name':_0x49bb44['fieldName'],'type':_0x49bb44[_0x206c('0x2d')][_0x206c('0x2e')]};});_0x4886c5[_0x206c('0x2f')]=_[_0x206c('0x30')](_0x5682d2,_0x206c('0x31'));_0x4886c5['query']=_[_0x206c('0x32')](_0x2826e9[_0x206c('0x33')]);_0x4886c5[_0x206c('0x34')]=_['intersection'](_0x4886c5[_0x206c('0x2f')],_0x4886c5[_0x206c('0x33')]);_0x3e20c4[_0x206c('0x35')]=_[_0x206c('0x36')](_0x4886c5['model'],qs[_0x206c('0x37')](_0x2826e9[_0x206c('0x33')][_0x206c('0x37')]));_0x3e20c4[_0x206c('0x35')]=_0x3e20c4['attributes'][_0x206c('0x38')]?_0x3e20c4[_0x206c('0x35')]:_0x4886c5[_0x206c('0x2f')];if(!_0x2826e9[_0x206c('0x33')][_0x206c('0x39')](_0x206c('0x3a'))){_0x3e20c4[_0x206c('0x1f')]=qs[_0x206c('0x1f')](_0x2826e9[_0x206c('0x33')][_0x206c('0x1f')]);_0x3e20c4['offset']=qs[_0x206c('0x1e')](_0x2826e9[_0x206c('0x33')][_0x206c('0x1e')]);}_0x3e20c4[_0x206c('0x3b')]=qs['sort'](_0x2826e9[_0x206c('0x33')]['sort']);_0x3e20c4[_0x206c('0x3c')]=qs[_0x206c('0x34')](_[_0x206c('0x3d')](_0x2826e9[_0x206c('0x33')],_0x4886c5[_0x206c('0x34')]),_0x5682d2);if(_0x2826e9['query'][_0x206c('0x3e')]){_0x3e20c4['where']=_['merge'](_0x3e20c4['where'],{'$or':_[_0x206c('0x30')](_0x5682d2,function(_0x3046a5){if(_0x3046a5[_0x206c('0x2d')]!==_0x206c('0x3f')){var _0x25fbf7={};_0x25fbf7[_0x3046a5[_0x206c('0x31')]]={'$like':'%'+_0x2826e9[_0x206c('0x33')]['filter']+'%'};return _0x25fbf7;}})});}_0x3e20c4=_['merge']({},_0x3e20c4,_0x2826e9[_0x206c('0x40')]);var _0x2d1fc4={'where':_0x3e20c4[_0x206c('0x3c')]};return db['SmsQueueReport']['count'](_0x2d1fc4)[_0x206c('0x27')](function(_0x3f9aac){_0x4af8d2[_0x206c('0x21')]=_0x3f9aac;if(_0x2826e9['query'][_0x206c('0x41')]){_0x3e20c4['include']=[{'all':!![]}];}return db[_0x206c('0x42')][_0x206c('0x43')](_0x3e20c4);})[_0x206c('0x27')](function(_0x2da15b){_0x4af8d2['rows']=_0x2da15b;return _0x4af8d2;})['then'](respondWithFilteredResult(_0x521d0c,_0x3e20c4))['catch'](handleError(_0x521d0c,null));};exports[_0x206c('0x44')]=function(_0x1081ec,_0x4d8e2a){var _0x13b385={'raw':!![],'where':{'id':_0x1081ec['params']['id']}},_0x260036={};_0x260036[_0x206c('0x2f')]=_[_0x206c('0x32')](db['SmsQueueReport'][_0x206c('0x2c')]);_0x260036[_0x206c('0x33')]=_[_0x206c('0x32')](_0x1081ec[_0x206c('0x33')]);_0x260036[_0x206c('0x34')]=_[_0x206c('0x36')](_0x260036[_0x206c('0x2f')],_0x260036[_0x206c('0x33')]);_0x13b385[_0x206c('0x35')]=_[_0x206c('0x36')](_0x260036[_0x206c('0x2f')],qs[_0x206c('0x37')](_0x1081ec['query']['fields']));_0x13b385[_0x206c('0x35')]=_0x13b385[_0x206c('0x35')][_0x206c('0x38')]?_0x13b385[_0x206c('0x35')]:_0x260036['model'];if(_0x1081ec[_0x206c('0x33')][_0x206c('0x41')]){_0x13b385[_0x206c('0x45')]=[{'all':!![]}];}_0x13b385=_[_0x206c('0x46')]({},_0x13b385,_0x1081ec['options']);return db[_0x206c('0x42')][_0x206c('0x47')](_0x13b385)[_0x206c('0x27')](handleEntityNotFound(_0x4d8e2a,null))['then'](respondWithResult(_0x4d8e2a,null))[_0x206c('0x48')](handleError(_0x4d8e2a,null));};exports[_0x206c('0x49')]=function(_0x5356bc,_0xeaaed8){return db[_0x206c('0x42')][_0x206c('0x49')](_0x5356bc['body'],{})[_0x206c('0x27')](respondWithResult(_0xeaaed8,0xc9))['catch'](handleError(_0xeaaed8,null));};exports['update']=function(_0x1f0f91,_0x519155){if(_0x1f0f91[_0x206c('0x4a')]['id']){delete _0x1f0f91[_0x206c('0x4a')]['id'];}return db[_0x206c('0x42')][_0x206c('0x47')]({'where':{'id':_0x1f0f91[_0x206c('0x4b')]['id']}})[_0x206c('0x27')](handleEntityNotFound(_0x519155,null))[_0x206c('0x27')](saveUpdates(_0x1f0f91[_0x206c('0x4a')],null))['then'](respondWithResult(_0x519155,null))[_0x206c('0x48')](handleError(_0x519155,null));};exports[_0x206c('0x28')]=function(_0x12ffc5,_0x370576){return db[_0x206c('0x42')][_0x206c('0x47')]({'where':{'id':_0x12ffc5['params']['id']}})[_0x206c('0x27')](handleEntityNotFound(_0x370576,null))['then'](removeEntity(_0x370576,null))[_0x206c('0x48')](handleError(_0x370576,null));};exports[_0x206c('0x4c')]=function(_0x4790d7,_0x3fc4b3){return db['SmsQueueReport'][_0x206c('0x4c')]()[_0x206c('0x27')](respondWithResult(_0x3fc4b3,null))[_0x206c('0x48')](handleError(_0x3fc4b3,null));}; \ No newline at end of file +var _0x3490=['count','offset','set','Content-Range','reject','update','then','error','name','send','index','map','SmsQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','pick','filter','merge','where','include','findAll','rows','catch','show','rawAttributes','length','options','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit'];(function(_0x2605f3,_0xd2ddc1){var _0x58c656=function(_0x67f837){while(--_0x67f837){_0x2605f3['push'](_0x2605f3['shift']());}};_0x58c656(++_0xd2ddc1);}(_0x3490,0x14a));var _0x0349=function(_0x762f6f,_0x23da53){_0x762f6f=_0x762f6f-0x0;var _0x1219f8=_0x3490[_0x762f6f];return _0x1219f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0349('0x0'));var zipdir=require(_0x0349('0x1'));var jsonpatch=require(_0x0349('0x2'));var rp=require(_0x0349('0x3'));var moment=require('moment');var BPromise=require(_0x0349('0x4'));var Mustache=require(_0x0349('0x5'));var util=require(_0x0349('0x6'));var path=require(_0x0349('0x7'));var sox=require(_0x0349('0x8'));var csv=require(_0x0349('0x9'));var ejs=require(_0x0349('0xa'));var fs=require('fs');var fs_extra=require(_0x0349('0xb'));var _=require('lodash');var squel=require(_0x0349('0xc'));var crypto=require(_0x0349('0xd'));var jsforce=require(_0x0349('0xe'));var deskjs=require(_0x0349('0xf'));var toCsv=require(_0x0349('0x9'));var querystring=require(_0x0349('0x10'));var Papa=require('papaparse');var Redis=require(_0x0349('0x11'));var authService=require(_0x0349('0x12'));var qs=require(_0x0349('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0349('0x14'))('api');var utils=require(_0x0349('0x15'));var config=require(_0x0349('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0349('0x17'))['db'];function respondWithStatusCode(_0xd4bb5a,_0x107ea1){_0x107ea1=_0x107ea1||0xcc;return function(_0x55fcda){if(_0x55fcda){return _0xd4bb5a[_0x0349('0x18')](_0x107ea1);}return _0xd4bb5a['status'](_0x107ea1)[_0x0349('0x19')]();};}function respondWithResult(_0x28f403,_0x2e657f){_0x2e657f=_0x2e657f||0xc8;return function(_0x221676){if(_0x221676){return _0x28f403[_0x0349('0x1a')](_0x2e657f)[_0x0349('0x1b')](_0x221676);}};}function respondWithFilteredResult(_0x11ac1b,_0x1c173e){return function(_0x179d49){if(_0x179d49){var _0x59ff8e=typeof _0x1c173e['offset']===_0x0349('0x1c')&&typeof _0x1c173e[_0x0349('0x1d')]===_0x0349('0x1c');var _0x7ac756=_0x179d49[_0x0349('0x1e')];var _0x2c1d4b=_0x59ff8e?0x0:_0x1c173e[_0x0349('0x1f')];var _0x107f79=_0x59ff8e?_0x179d49[_0x0349('0x1e')]:_0x1c173e['offset']+_0x1c173e[_0x0349('0x1d')];var _0x24550c;if(_0x107f79>=_0x7ac756){_0x107f79=_0x7ac756;_0x24550c=0xc8;}else{_0x24550c=0xce;}_0x11ac1b[_0x0349('0x1a')](_0x24550c);return _0x11ac1b[_0x0349('0x20')](_0x0349('0x21'),_0x2c1d4b+'-'+_0x107f79+'/'+_0x7ac756)[_0x0349('0x1b')](_0x179d49);}return null;};}function patchUpdates(_0x1982fb){return function(_0xd13839){try{jsonpatch['apply'](_0xd13839,_0x1982fb,!![]);}catch(_0x3924f5){return BPromise[_0x0349('0x22')](_0x3924f5);}return _0xd13839['save']();};}function saveUpdates(_0x273183,_0x3a0939){return function(_0x19d940){if(_0x19d940){return _0x19d940[_0x0349('0x23')](_0x273183)['then'](function(_0x3fcb98){return _0x3fcb98;});}return null;};}function removeEntity(_0x46d156,_0x25eab3){return function(_0x46edfb){if(_0x46edfb){return _0x46edfb['destroy']()[_0x0349('0x24')](function(){_0x46d156[_0x0349('0x1a')](0xcc)[_0x0349('0x19')]();});}};}function handleEntityNotFound(_0x7b3e,_0x422ced){return function(_0x47a76d){if(!_0x47a76d){_0x7b3e[_0x0349('0x18')](0x194);}return _0x47a76d;};}function handleError(_0x306ca4,_0x16e6c2){_0x16e6c2=_0x16e6c2||0x1f4;return function(_0x1ecbf0){logger[_0x0349('0x25')](_0x1ecbf0['stack']);if(_0x1ecbf0[_0x0349('0x26')]){delete _0x1ecbf0[_0x0349('0x26')];}_0x306ca4['status'](_0x16e6c2)[_0x0349('0x27')](_0x1ecbf0);};}exports[_0x0349('0x28')]=function(_0x3a094b,_0x31cbbb){var _0x4e72c4={},_0x1ec70e={},_0x2e8eb8={'count':0x0,'rows':[]};var _0xad678e=_[_0x0349('0x29')](db[_0x0349('0x2a')]['rawAttributes'],function(_0x19e11c){return{'name':_0x19e11c[_0x0349('0x2b')],'type':_0x19e11c[_0x0349('0x2c')][_0x0349('0x2d')]};});_0x1ec70e[_0x0349('0x2e')]=_[_0x0349('0x29')](_0xad678e,_0x0349('0x26'));_0x1ec70e[_0x0349('0x2f')]=_[_0x0349('0x30')](_0x3a094b['query']);_0x1ec70e[_0x0349('0x31')]=_[_0x0349('0x32')](_0x1ec70e[_0x0349('0x2e')],_0x1ec70e['query']);_0x4e72c4['attributes']=_['intersection'](_0x1ec70e[_0x0349('0x2e')],qs[_0x0349('0x33')](_0x3a094b[_0x0349('0x2f')][_0x0349('0x33')]));_0x4e72c4[_0x0349('0x34')]=_0x4e72c4['attributes']['length']?_0x4e72c4['attributes']:_0x1ec70e[_0x0349('0x2e')];if(!_0x3a094b['query']['hasOwnProperty']('nolimit')){_0x4e72c4[_0x0349('0x1d')]=qs[_0x0349('0x1d')](_0x3a094b[_0x0349('0x2f')][_0x0349('0x1d')]);_0x4e72c4[_0x0349('0x1f')]=qs[_0x0349('0x1f')](_0x3a094b[_0x0349('0x2f')][_0x0349('0x1f')]);}_0x4e72c4[_0x0349('0x35')]=qs[_0x0349('0x36')](_0x3a094b['query'][_0x0349('0x36')]);_0x4e72c4['where']=qs[_0x0349('0x31')](_[_0x0349('0x37')](_0x3a094b['query'],_0x1ec70e[_0x0349('0x31')]),_0xad678e);if(_0x3a094b[_0x0349('0x2f')][_0x0349('0x38')]){_0x4e72c4['where']=_[_0x0349('0x39')](_0x4e72c4[_0x0349('0x3a')],{'$or':_[_0x0349('0x29')](_0xad678e,function(_0xed8f8e){if(_0xed8f8e[_0x0349('0x2c')]!=='VIRTUAL'){var _0x2b329a={};_0x2b329a[_0xed8f8e[_0x0349('0x26')]]={'$like':'%'+_0x3a094b[_0x0349('0x2f')][_0x0349('0x38')]+'%'};return _0x2b329a;}})});}_0x4e72c4=_[_0x0349('0x39')]({},_0x4e72c4,_0x3a094b['options']);var _0x4b9b29={'where':_0x4e72c4[_0x0349('0x3a')]};return db[_0x0349('0x2a')][_0x0349('0x1e')](_0x4b9b29)['then'](function(_0x4570a0){_0x2e8eb8[_0x0349('0x1e')]=_0x4570a0;if(_0x3a094b['query']['includeAll']){_0x4e72c4[_0x0349('0x3b')]=[{'all':!![]}];}return db[_0x0349('0x2a')][_0x0349('0x3c')](_0x4e72c4);})['then'](function(_0x502662){_0x2e8eb8[_0x0349('0x3d')]=_0x502662;return _0x2e8eb8;})[_0x0349('0x24')](respondWithFilteredResult(_0x31cbbb,_0x4e72c4))[_0x0349('0x3e')](handleError(_0x31cbbb,null));};exports[_0x0349('0x3f')]=function(_0x23d48f,_0x1197c0){var _0x363ca0={'raw':!![],'where':{'id':_0x23d48f['params']['id']}},_0x4a87d9={};_0x4a87d9[_0x0349('0x2e')]=_[_0x0349('0x30')](db[_0x0349('0x2a')][_0x0349('0x40')]);_0x4a87d9[_0x0349('0x2f')]=_['keys'](_0x23d48f['query']);_0x4a87d9[_0x0349('0x31')]=_['intersection'](_0x4a87d9[_0x0349('0x2e')],_0x4a87d9[_0x0349('0x2f')]);_0x363ca0[_0x0349('0x34')]=_[_0x0349('0x32')](_0x4a87d9[_0x0349('0x2e')],qs[_0x0349('0x33')](_0x23d48f['query']['fields']));_0x363ca0[_0x0349('0x34')]=_0x363ca0[_0x0349('0x34')][_0x0349('0x41')]?_0x363ca0['attributes']:_0x4a87d9[_0x0349('0x2e')];if(_0x23d48f['query']['includeAll']){_0x363ca0['include']=[{'all':!![]}];}_0x363ca0=_[_0x0349('0x39')]({},_0x363ca0,_0x23d48f[_0x0349('0x42')]);return db[_0x0349('0x2a')][_0x0349('0x43')](_0x363ca0)[_0x0349('0x24')](handleEntityNotFound(_0x1197c0,null))['then'](respondWithResult(_0x1197c0,null))[_0x0349('0x3e')](handleError(_0x1197c0,null));};exports[_0x0349('0x44')]=function(_0x2a1db6,_0x18f410){return db[_0x0349('0x2a')][_0x0349('0x44')](_0x2a1db6[_0x0349('0x45')],{})[_0x0349('0x24')](respondWithResult(_0x18f410,0xc9))[_0x0349('0x3e')](handleError(_0x18f410,null));};exports['update']=function(_0x2f1396,_0xd885b2){if(_0x2f1396[_0x0349('0x45')]['id']){delete _0x2f1396[_0x0349('0x45')]['id'];}return db[_0x0349('0x2a')][_0x0349('0x43')]({'where':{'id':_0x2f1396[_0x0349('0x46')]['id']}})[_0x0349('0x24')](handleEntityNotFound(_0xd885b2,null))[_0x0349('0x24')](saveUpdates(_0x2f1396[_0x0349('0x45')],null))[_0x0349('0x24')](respondWithResult(_0xd885b2,null))['catch'](handleError(_0xd885b2,null));};exports['destroy']=function(_0x464e90,_0xf1856f){return db[_0x0349('0x2a')]['find']({'where':{'id':_0x464e90['params']['id']}})[_0x0349('0x24')](handleEntityNotFound(_0xf1856f,null))['then'](removeEntity(_0xf1856f,null))[_0x0349('0x3e')](handleError(_0xf1856f,null));};exports[_0x0349('0x47')]=function(_0x5be9cc,_0x2245c9){return db[_0x0349('0x2a')][_0x0349('0x47')]()['then'](respondWithResult(_0x2245c9,null))['catch'](handleError(_0x2245c9,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 7a7fdeb..76e18e4 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3dea50,_0x5a7dd8){var _0xd71f14=function(_0x353661){while(--_0x353661){_0x3dea50['push'](_0x3dea50['shift']());}};_0xd71f14(++_0x5a7dd8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'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'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42eedc,_0x5d0442){var _0x369164=function(_0x11876a){while(--_0x11876a){_0x42eedc['push'](_0x42eedc['shift']());}};_0x369164(++_0x5d0442);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index a541960..acb468b 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 _0x349f=['CreateSmsQueueReport','SmsQueueReport','options','raw','catch','UpdateSmsQueueReport','body','limit','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x257f38,_0x3da259){var _0x54b78e=function(_0xa66a1e){while(--_0xa66a1e){_0x257f38['push'](_0x257f38['shift']());}};_0x54b78e(++_0x3da259);}(_0x349f,0x1a9));var _0xf349=function(_0x2752fa,_0x2fc842){_0x2752fa=_0x2752fa-0x0;var _0x2e5683=_0x349f[_0x2752fa];return _0x2e5683;};'use strict';var _=require(_0xf349('0x0'));var util=require('util');var moment=require(_0xf349('0x1'));var BPromise=require(_0xf349('0x2'));var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf349('0x4'))['db'];var utils=require(_0xf349('0x5'));var logger=require(_0xf349('0x6'))(_0xf349('0x7'));var config=require(_0xf349('0x8'));var jayson=require(_0xf349('0x9'));var client=jayson[_0xf349('0xa')][_0xf349('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56bda2,_0x522ebd,_0x82ce3a){return new BPromise(function(_0x76b305,_0x4c0d5d){return client[_0xf349('0xc')](_0x56bda2,_0x82ce3a)[_0xf349('0xd')](function(_0xac5ef8){logger[_0xf349('0xe')](_0xf349('0xf'),_0x522ebd,'request\x20sent');logger['debug'](_0xf349('0x10'),_0x522ebd,_0xf349('0x11'),JSON[_0xf349('0x12')](_0xac5ef8));if(_0xac5ef8['error']){if(_0xac5ef8[_0xf349('0x13')][_0xf349('0x14')]===0x1f4){logger[_0xf349('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x522ebd,_0xac5ef8[_0xf349('0x13')][_0xf349('0x15')]);return _0x4c0d5d(_0xac5ef8[_0xf349('0x13')][_0xf349('0x15')]);}logger[_0xf349('0x13')](_0xf349('0xf'),_0x522ebd,_0xac5ef8[_0xf349('0x13')][_0xf349('0x15')]);return _0x76b305(_0xac5ef8[_0xf349('0x13')]['message']);}else{logger[_0xf349('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x522ebd,'request\x20sent');_0x76b305(_0xac5ef8[_0xf349('0x16')][_0xf349('0x15')]);}})['catch'](function(_0x3cfdec){logger[_0xf349('0x13')](_0xf349('0xf'),_0x522ebd,_0x3cfdec);_0x4c0d5d(_0x3cfdec);});});}exports[_0xf349('0x17')]=function(_0x34cc93){var _0x21546c=this;return new Promise(function(_0x361715,_0x4a71fc){return db[_0xf349('0x18')]['create'](_0x34cc93['body'],{'raw':_0x34cc93[_0xf349('0x19')]?_0x34cc93[_0xf349('0x19')][_0xf349('0x1a')]===undefined?!![]:![]:!![]})[_0xf349('0xd')](function(_0x5c9e3b){logger['info'](_0xf349('0x17'),_0x34cc93);logger['debug']('CreateSmsQueueReport',_0x34cc93,JSON[_0xf349('0x12')](_0x5c9e3b));_0x361715(_0x5c9e3b);})[_0xf349('0x1b')](function(_0x490345){logger[_0xf349('0x13')](_0xf349('0x17'),_0x490345['message'],_0x34cc93);_0x4a71fc(_0x21546c['error'](0x1f4,_0x490345[_0xf349('0x15')]));});});};exports[_0xf349('0x1c')]=function(_0x59b79e){var _0x419c32=this;return new Promise(function(_0x1594bf,_0x3fa3f0){return db[_0xf349('0x18')]['update'](_0x59b79e[_0xf349('0x1d')],{'raw':_0x59b79e[_0xf349('0x19')]?_0x59b79e[_0xf349('0x19')][_0xf349('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59b79e['options']?_0x59b79e[_0xf349('0x19')]['where']||null:null,'attributes':_0x59b79e['options']?_0x59b79e[_0xf349('0x19')]['attributes']||null:null,'limit':_0x59b79e['options']?_0x59b79e[_0xf349('0x19')][_0xf349('0x1e')]||null:null})['then'](function(_0xa2acb5){logger[_0xf349('0xe')]('UpdateSmsQueueReport',_0x59b79e);logger[_0xf349('0x1f')](_0xf349('0x1c'),_0x59b79e,JSON['stringify'](_0xa2acb5));_0x1594bf(_0xa2acb5);})[_0xf349('0x1b')](function(_0xf7dc1e){logger['error'](_0xf349('0x1c'),_0xf7dc1e[_0xf349('0x15')],_0x59b79e);_0x3fa3f0(_0x419c32[_0xf349('0x13')](0x1f4,_0xf7dc1e[_0xf349('0x15')]));});});}; \ No newline at end of file +var _0xbdda=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','body','options','raw','debug','UpdateSmsQueueReport','update','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xbdda,0x195));var _0xabdd=function(_0x2fc764,_0x24d9f1){_0x2fc764=_0x2fc764-0x0;var _0x265ead=_0xbdda[_0x2fc764];return _0x265ead;};'use strict';var _=require(_0xabdd('0x0'));var util=require('util');var moment=require(_0xabdd('0x1'));var BPromise=require(_0xabdd('0x2'));var rs=require(_0xabdd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabdd('0x4'))['db'];var utils=require(_0xabdd('0x5'));var logger=require(_0xabdd('0x6'))(_0xabdd('0x7'));var config=require(_0xabdd('0x8'));var jayson=require(_0xabdd('0x9'));var client=jayson[_0xabdd('0xa')][_0xabdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49b9c1,_0x202a26,_0x35aa99){return new BPromise(function(_0x18bb7e,_0x4cf1dc){return client[_0xabdd('0xc')](_0x49b9c1,_0x35aa99)[_0xabdd('0xd')](function(_0x1872ea){logger[_0xabdd('0xe')](_0xabdd('0xf'),_0x202a26,_0xabdd('0x10'));logger['debug'](_0xabdd('0x11'),_0x202a26,_0xabdd('0x10'),JSON[_0xabdd('0x12')](_0x1872ea));if(_0x1872ea[_0xabdd('0x13')]){if(_0x1872ea['error'][_0xabdd('0x14')]===0x1f4){logger[_0xabdd('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x202a26,_0x1872ea['error'][_0xabdd('0x15')]);return _0x4cf1dc(_0x1872ea[_0xabdd('0x13')][_0xabdd('0x15')]);}logger[_0xabdd('0x13')](_0xabdd('0xf'),_0x202a26,_0x1872ea[_0xabdd('0x13')][_0xabdd('0x15')]);return _0x18bb7e(_0x1872ea[_0xabdd('0x13')][_0xabdd('0x15')]);}else{logger['info'](_0xabdd('0xf'),_0x202a26,'request\x20sent');_0x18bb7e(_0x1872ea[_0xabdd('0x16')]['message']);}})[_0xabdd('0x17')](function(_0x405ba9){logger[_0xabdd('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x202a26,_0x405ba9);_0x4cf1dc(_0x405ba9);});});}exports[_0xabdd('0x18')]=function(_0x293060){var _0x825756=this;return new Promise(function(_0x399057,_0x1a4875){return db['SmsQueueReport']['create'](_0x293060[_0xabdd('0x19')],{'raw':_0x293060[_0xabdd('0x1a')]?_0x293060[_0xabdd('0x1a')][_0xabdd('0x1b')]===undefined?!![]:![]:!![]})[_0xabdd('0xd')](function(_0x553332){logger[_0xabdd('0xe')](_0xabdd('0x18'),_0x293060);logger[_0xabdd('0x1c')]('CreateSmsQueueReport',_0x293060,JSON[_0xabdd('0x12')](_0x553332));_0x399057(_0x553332);})[_0xabdd('0x17')](function(_0xef0c01){logger[_0xabdd('0x13')](_0xabdd('0x18'),_0xef0c01[_0xabdd('0x15')],_0x293060);_0x1a4875(_0x825756[_0xabdd('0x13')](0x1f4,_0xef0c01[_0xabdd('0x15')]));});});};exports[_0xabdd('0x1d')]=function(_0x17a34f){var _0x550fd7=this;return new Promise(function(_0x5c77d3,_0x52ab1e){return db['SmsQueueReport'][_0xabdd('0x1e')](_0x17a34f[_0xabdd('0x19')],{'raw':_0x17a34f[_0xabdd('0x1a')]?_0x17a34f['options'][_0xabdd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17a34f['options']?_0x17a34f[_0xabdd('0x1a')]['where']||null:null,'attributes':_0x17a34f[_0xabdd('0x1a')]?_0x17a34f[_0xabdd('0x1a')][_0xabdd('0x1f')]||null:null,'limit':_0x17a34f[_0xabdd('0x1a')]?_0x17a34f['options']['limit']||null:null})[_0xabdd('0xd')](function(_0x10670a){logger[_0xabdd('0xe')](_0xabdd('0x1d'),_0x17a34f);logger['debug'](_0xabdd('0x1d'),_0x17a34f,JSON[_0xabdd('0x12')](_0x10670a));_0x5c77d3(_0x10670a);})[_0xabdd('0x17')](function(_0xc6f752){logger[_0xabdd('0x13')](_0xabdd('0x1d'),_0xc6f752[_0xabdd('0x15')],_0x17a34f);_0x52ab1e(_0x550fd7[_0xabdd('0x13')](0x1f4,_0xc6f752['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 4024086..3dc41ef 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 _0xc949=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4f52c2,_0x104386){var _0x5544d4=function(_0x40da25){while(--_0x40da25){_0x4f52c2['push'](_0x4f52c2['shift']());}};_0x5544d4(++_0x104386);}(_0xc949,0x181));var _0x9c94=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xc949[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0xf')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x10')]);router['put'](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0x12')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);module[_0x9c94('0x14')]=router; \ No newline at end of file +var _0xa3e6=['express','Router','fs-extra','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','describe','put','update','delete','/:id','destroy','multer','path'];(function(_0x6b8c3b,_0x4d2d90){var _0x421fb7=function(_0x1dd7fa){while(--_0x1dd7fa){_0x6b8c3b['push'](_0x6b8c3b['shift']());}};_0x421fb7(++_0x4d2d90);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x3a72ee,_0x5d945b){_0x3a72ee=_0x3a72ee-0x0;var _0x2d0b96=_0xa3e6[_0x3a72ee];return _0x2d0b96;};'use strict';var multer=require(_0x6a3e('0x0'));var util=require('util');var path=require(_0x6a3e('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a3e('0x2'));var router=express[_0x6a3e('0x3')]();var fs_extra=require(_0x6a3e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6a3e('0x5'));var config=require('../../config/environment');var controller=require(_0x6a3e('0x6'));router[_0x6a3e('0x7')]('/',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0x9')]);router[_0x6a3e('0x7')]('/describe',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xa')]);router['get']('/:id',auth[_0x6a3e('0x8')](),controller['show']);router['post']('/',auth[_0x6a3e('0x8')](),controller['create']);router[_0x6a3e('0xb')]('/:id',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xc')]);router[_0x6a3e('0xd')](_0x6a3e('0xe'),auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 73b77a0..25e60d2 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x9bde,0xe1));var _0xe9bd=function(_0x454526,_0x72f94e){_0x454526=_0x454526-0x0;var _0x2ba5e3=_0x9bde[_0x454526];return _0x2ba5e3;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x32e59e,_0x252469){var _0x4a621d=function(_0x7e8dd7){while(--_0x7e8dd7){_0x32e59e['push'](_0x32e59e['shift']());}};_0x4a621d(++_0x252469);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 24f185e..90aeb22 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 _0xc83e=['send','index','map','SmsTransferReport','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','show','length','options','find','catch','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','save','update','then','end','error','stack','name'];(function(_0x15c2da,_0x486447){var _0x3a219d=function(_0x305f79){while(--_0x305f79){_0x15c2da['push'](_0x15c2da['shift']());}};_0x3a219d(++_0x486447);}(_0xc83e,0x18b));var _0xec83=function(_0x5f2098,_0x47308b){_0x5f2098=_0x5f2098-0x0;var _0x18af32=_0xc83e[_0x5f2098];return _0x18af32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec83('0x0'));var zipdir=require(_0xec83('0x1'));var jsonpatch=require(_0xec83('0x2'));var rp=require(_0xec83('0x3'));var moment=require('moment');var BPromise=require(_0xec83('0x4'));var Mustache=require(_0xec83('0x5'));var util=require('util');var path=require(_0xec83('0x6'));var sox=require('sox');var csv=require(_0xec83('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec83('0x8'));var _=require(_0xec83('0x9'));var squel=require('squel');var crypto=require(_0xec83('0xa'));var jsforce=require(_0xec83('0xb'));var deskjs=require(_0xec83('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xec83('0xd'));var qs=require(_0xec83('0xe'));var as=require(_0xec83('0xf'));var hardwareService=require(_0xec83('0x10'));var logger=require(_0xec83('0x11'))(_0xec83('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xec83('0x13'));var db=require(_0xec83('0x14'))['db'];function respondWithStatusCode(_0x338bb4,_0x45da79){_0x45da79=_0x45da79||0xcc;return function(_0x3d446e){if(_0x3d446e){return _0x338bb4[_0xec83('0x15')](_0x45da79);}return _0x338bb4[_0xec83('0x16')](_0x45da79)['end']();};}function respondWithResult(_0x5f5706,_0x24a2e1){_0x24a2e1=_0x24a2e1||0xc8;return function(_0x51f1f8){if(_0x51f1f8){return _0x5f5706['status'](_0x24a2e1)[_0xec83('0x17')](_0x51f1f8);}};}function respondWithFilteredResult(_0x5d4dcb,_0x49b60f){return function(_0x5851f9){if(_0x5851f9){var _0x1eee97=typeof _0x49b60f['offset']===_0xec83('0x18')&&typeof _0x49b60f['limit']==='undefined';var _0x226aca=_0x5851f9[_0xec83('0x19')];var _0x2b9f94=_0x1eee97?0x0:_0x49b60f['offset'];var _0x180255=_0x1eee97?_0x5851f9[_0xec83('0x19')]:_0x49b60f['offset']+_0x49b60f[_0xec83('0x1a')];var _0x4c6d95;if(_0x180255>=_0x226aca){_0x180255=_0x226aca;_0x4c6d95=0xc8;}else{_0x4c6d95=0xce;}_0x5d4dcb[_0xec83('0x16')](_0x4c6d95);return _0x5d4dcb[_0xec83('0x1b')](_0xec83('0x1c'),_0x2b9f94+'-'+_0x180255+'/'+_0x226aca)['json'](_0x5851f9);}return null;};}function patchUpdates(_0x5ed5b1){return function(_0x149d1d){try{jsonpatch[_0xec83('0x1d')](_0x149d1d,_0x5ed5b1,!![]);}catch(_0xaf0fb6){return BPromise['reject'](_0xaf0fb6);}return _0x149d1d[_0xec83('0x1e')]();};}function saveUpdates(_0x3a538e,_0x407fac){return function(_0x230931){if(_0x230931){return _0x230931[_0xec83('0x1f')](_0x3a538e)[_0xec83('0x20')](function(_0x26c575){return _0x26c575;});}return null;};}function removeEntity(_0x3c0517,_0x3f9281){return function(_0x3a78db){if(_0x3a78db){return _0x3a78db['destroy']()[_0xec83('0x20')](function(){_0x3c0517[_0xec83('0x16')](0xcc)[_0xec83('0x21')]();});}};}function handleEntityNotFound(_0x316efc,_0x1974a2){return function(_0x1bf7b8){if(!_0x1bf7b8){_0x316efc[_0xec83('0x15')](0x194);}return _0x1bf7b8;};}function handleError(_0x1336ec,_0x506730){_0x506730=_0x506730||0x1f4;return function(_0x155fc2){logger[_0xec83('0x22')](_0x155fc2[_0xec83('0x23')]);if(_0x155fc2[_0xec83('0x24')]){delete _0x155fc2[_0xec83('0x24')];}_0x1336ec[_0xec83('0x16')](_0x506730)[_0xec83('0x25')](_0x155fc2);};}exports[_0xec83('0x26')]=function(_0x1b99fb,_0x28f3e4){var _0x22a566={},_0x39ef55={},_0x3ed2a7={'count':0x0,'rows':[]};var _0x192db3=_[_0xec83('0x27')](db[_0xec83('0x28')][_0xec83('0x29')],function(_0x1ccde4){return{'name':_0x1ccde4[_0xec83('0x2a')],'type':_0x1ccde4[_0xec83('0x2b')]['key']};});_0x39ef55['model']=_['map'](_0x192db3,_0xec83('0x24'));_0x39ef55['query']=_[_0xec83('0x2c')](_0x1b99fb[_0xec83('0x2d')]);_0x39ef55['filters']=_[_0xec83('0x2e')](_0x39ef55[_0xec83('0x2f')],_0x39ef55[_0xec83('0x2d')]);_0x22a566[_0xec83('0x30')]=_['intersection'](_0x39ef55['model'],qs[_0xec83('0x31')](_0x1b99fb[_0xec83('0x2d')][_0xec83('0x31')]));_0x22a566[_0xec83('0x30')]=_0x22a566[_0xec83('0x30')]['length']?_0x22a566[_0xec83('0x30')]:_0x39ef55[_0xec83('0x2f')];if(!_0x1b99fb[_0xec83('0x2d')][_0xec83('0x32')](_0xec83('0x33'))){_0x22a566[_0xec83('0x1a')]=qs[_0xec83('0x1a')](_0x1b99fb[_0xec83('0x2d')][_0xec83('0x1a')]);_0x22a566[_0xec83('0x34')]=qs[_0xec83('0x34')](_0x1b99fb[_0xec83('0x2d')][_0xec83('0x34')]);}_0x22a566[_0xec83('0x35')]=qs[_0xec83('0x36')](_0x1b99fb[_0xec83('0x2d')][_0xec83('0x36')]);_0x22a566[_0xec83('0x37')]=qs['filters'](_['pick'](_0x1b99fb[_0xec83('0x2d')],_0x39ef55['filters']),_0x192db3);if(_0x1b99fb[_0xec83('0x2d')][_0xec83('0x38')]){_0x22a566[_0xec83('0x37')]=_[_0xec83('0x39')](_0x22a566['where'],{'$or':_[_0xec83('0x27')](_0x192db3,function(_0x5268e8){if(_0x5268e8[_0xec83('0x2b')]!==_0xec83('0x3a')){var _0x197949={};_0x197949[_0x5268e8[_0xec83('0x24')]]={'$like':'%'+_0x1b99fb[_0xec83('0x2d')][_0xec83('0x38')]+'%'};return _0x197949;}})});}_0x22a566=_[_0xec83('0x39')]({},_0x22a566,_0x1b99fb['options']);var _0x48648e={'where':_0x22a566[_0xec83('0x37')]};return db[_0xec83('0x28')][_0xec83('0x19')](_0x48648e)[_0xec83('0x20')](function(_0x3ffa6c){_0x3ed2a7[_0xec83('0x19')]=_0x3ffa6c;if(_0x1b99fb[_0xec83('0x2d')][_0xec83('0x3b')]){_0x22a566[_0xec83('0x3c')]=[{'all':!![]}];}return db[_0xec83('0x28')]['findAll'](_0x22a566);})[_0xec83('0x20')](function(_0x304d3c){_0x3ed2a7[_0xec83('0x3d')]=_0x304d3c;return _0x3ed2a7;})[_0xec83('0x20')](respondWithFilteredResult(_0x28f3e4,_0x22a566))['catch'](handleError(_0x28f3e4,null));};exports[_0xec83('0x3e')]=function(_0x247359,_0x998b00){var _0xd94741={'raw':!![],'where':{'id':_0x247359['params']['id']}},_0x4f9caa={};_0x4f9caa[_0xec83('0x2f')]=_[_0xec83('0x2c')](db['SmsTransferReport']['rawAttributes']);_0x4f9caa[_0xec83('0x2d')]=_[_0xec83('0x2c')](_0x247359[_0xec83('0x2d')]);_0x4f9caa['filters']=_[_0xec83('0x2e')](_0x4f9caa[_0xec83('0x2f')],_0x4f9caa[_0xec83('0x2d')]);_0xd94741[_0xec83('0x30')]=_['intersection'](_0x4f9caa[_0xec83('0x2f')],qs['fields'](_0x247359[_0xec83('0x2d')][_0xec83('0x31')]));_0xd94741[_0xec83('0x30')]=_0xd94741['attributes'][_0xec83('0x3f')]?_0xd94741['attributes']:_0x4f9caa[_0xec83('0x2f')];if(_0x247359[_0xec83('0x2d')][_0xec83('0x3b')]){_0xd94741[_0xec83('0x3c')]=[{'all':!![]}];}_0xd94741=_[_0xec83('0x39')]({},_0xd94741,_0x247359[_0xec83('0x40')]);return db[_0xec83('0x28')][_0xec83('0x41')](_0xd94741)[_0xec83('0x20')](handleEntityNotFound(_0x998b00,null))['then'](respondWithResult(_0x998b00,null))[_0xec83('0x42')](handleError(_0x998b00,null));};exports[_0xec83('0x43')]=function(_0x2121cc,_0x1cc2a3){return db['SmsTransferReport'][_0xec83('0x43')](_0x2121cc[_0xec83('0x44')],{})[_0xec83('0x20')](respondWithResult(_0x1cc2a3,0xc9))[_0xec83('0x42')](handleError(_0x1cc2a3,null));};exports[_0xec83('0x1f')]=function(_0x1d83c2,_0x4b76eb){if(_0x1d83c2[_0xec83('0x44')]['id']){delete _0x1d83c2[_0xec83('0x44')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x1d83c2[_0xec83('0x45')]['id']}})[_0xec83('0x20')](handleEntityNotFound(_0x4b76eb,null))[_0xec83('0x20')](saveUpdates(_0x1d83c2[_0xec83('0x44')],null))[_0xec83('0x20')](respondWithResult(_0x4b76eb,null))['catch'](handleError(_0x4b76eb,null));};exports[_0xec83('0x46')]=function(_0x4f03d6,_0x5089a1){return db[_0xec83('0x28')][_0xec83('0x41')]({'where':{'id':_0x4f03d6[_0xec83('0x45')]['id']}})[_0xec83('0x20')](handleEntityNotFound(_0x5089a1,null))[_0xec83('0x20')](removeEntity(_0x5089a1,null))['catch'](handleError(_0x5089a1,null));};exports[_0xec83('0x47')]=function(_0xf876aa,_0x7a4c6){return db[_0xec83('0x28')]['describe']()[_0xec83('0x20')](respondWithResult(_0x7a4c6,null))[_0xec83('0x42')](handleError(_0x7a4c6,null));}; \ No newline at end of file +var _0x0abd=['findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','SmsTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x401a44,_0x380ba3){var _0x5acf92=function(_0x4ae709){while(--_0x4ae709){_0x401a44['push'](_0x401a44['shift']());}};_0x5acf92(++_0x380ba3);}(_0x0abd,0xee));var _0xd0ab=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0x0abd[_0x2842b4];return _0x2b9521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0ab('0x0'));var zipdir=require(_0xd0ab('0x1'));var jsonpatch=require(_0xd0ab('0x2'));var rp=require(_0xd0ab('0x3'));var moment=require(_0xd0ab('0x4'));var BPromise=require(_0xd0ab('0x5'));var Mustache=require('mustache');var util=require(_0xd0ab('0x6'));var path=require('path');var sox=require(_0xd0ab('0x7'));var csv=require('to-csv');var ejs=require(_0xd0ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0ab('0x9'));var squel=require(_0xd0ab('0xa'));var crypto=require('crypto');var jsforce=require(_0xd0ab('0xb'));var deskjs=require(_0xd0ab('0xc'));var toCsv=require(_0xd0ab('0xd'));var querystring=require(_0xd0ab('0xe'));var Papa=require('papaparse');var Redis=require(_0xd0ab('0xf'));var authService=require(_0xd0ab('0x10'));var qs=require(_0xd0ab('0x11'));var as=require(_0xd0ab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0ab('0x13'))(_0xd0ab('0x14'));var utils=require(_0xd0ab('0x15'));var config=require(_0xd0ab('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0ab('0x17'))['db'];function respondWithStatusCode(_0x163b37,_0x1612c8){_0x1612c8=_0x1612c8||0xcc;return function(_0x387aac){if(_0x387aac){return _0x163b37[_0xd0ab('0x18')](_0x1612c8);}return _0x163b37[_0xd0ab('0x19')](_0x1612c8)[_0xd0ab('0x1a')]();};}function respondWithResult(_0x1da35a,_0x59e9ea){_0x59e9ea=_0x59e9ea||0xc8;return function(_0x2067ae){if(_0x2067ae){return _0x1da35a[_0xd0ab('0x19')](_0x59e9ea)[_0xd0ab('0x1b')](_0x2067ae);}};}function respondWithFilteredResult(_0x10a2fa,_0x37e04a){return function(_0x1c1512){if(_0x1c1512){var _0x3cbc1d=typeof _0x37e04a[_0xd0ab('0x1c')]===_0xd0ab('0x1d')&&typeof _0x37e04a[_0xd0ab('0x1e')]===_0xd0ab('0x1d');var _0x4e6f23=_0x1c1512[_0xd0ab('0x1f')];var _0x5eeac5=_0x3cbc1d?0x0:_0x37e04a[_0xd0ab('0x1c')];var _0x1c8194=_0x3cbc1d?_0x1c1512[_0xd0ab('0x1f')]:_0x37e04a['offset']+_0x37e04a[_0xd0ab('0x1e')];var _0x4384e9;if(_0x1c8194>=_0x4e6f23){_0x1c8194=_0x4e6f23;_0x4384e9=0xc8;}else{_0x4384e9=0xce;}_0x10a2fa[_0xd0ab('0x19')](_0x4384e9);return _0x10a2fa[_0xd0ab('0x20')](_0xd0ab('0x21'),_0x5eeac5+'-'+_0x1c8194+'/'+_0x4e6f23)[_0xd0ab('0x1b')](_0x1c1512);}return null;};}function patchUpdates(_0x5208d7){return function(_0x2f6de5){try{jsonpatch[_0xd0ab('0x22')](_0x2f6de5,_0x5208d7,!![]);}catch(_0x3993e4){return BPromise['reject'](_0x3993e4);}return _0x2f6de5[_0xd0ab('0x23')]();};}function saveUpdates(_0x499992,_0x5411d1){return function(_0xc2a7a7){if(_0xc2a7a7){return _0xc2a7a7[_0xd0ab('0x24')](_0x499992)['then'](function(_0x50b78a){return _0x50b78a;});}return null;};}function removeEntity(_0x2b4049,_0x5448b9){return function(_0x559eec){if(_0x559eec){return _0x559eec[_0xd0ab('0x25')]()[_0xd0ab('0x26')](function(){_0x2b4049[_0xd0ab('0x19')](0xcc)[_0xd0ab('0x1a')]();});}};}function handleEntityNotFound(_0x3ee40c,_0x1a6cd6){return function(_0x24601b){if(!_0x24601b){_0x3ee40c[_0xd0ab('0x18')](0x194);}return _0x24601b;};}function handleError(_0x38483f,_0x14eb0e){_0x14eb0e=_0x14eb0e||0x1f4;return function(_0x516958){logger[_0xd0ab('0x27')](_0x516958[_0xd0ab('0x28')]);if(_0x516958[_0xd0ab('0x29')]){delete _0x516958[_0xd0ab('0x29')];}_0x38483f[_0xd0ab('0x19')](_0x14eb0e)['send'](_0x516958);};}exports[_0xd0ab('0x2a')]=function(_0x17742d,_0x41669a){var _0x2efda0={},_0x51bb1d={},_0x266ada={'count':0x0,'rows':[]};var _0x1e05b9=_[_0xd0ab('0x2b')](db[_0xd0ab('0x2c')]['rawAttributes'],function(_0x302e64){return{'name':_0x302e64['fieldName'],'type':_0x302e64[_0xd0ab('0x2d')][_0xd0ab('0x2e')]};});_0x51bb1d[_0xd0ab('0x2f')]=_[_0xd0ab('0x2b')](_0x1e05b9,_0xd0ab('0x29'));_0x51bb1d[_0xd0ab('0x30')]=_[_0xd0ab('0x31')](_0x17742d['query']);_0x51bb1d[_0xd0ab('0x32')]=_[_0xd0ab('0x33')](_0x51bb1d[_0xd0ab('0x2f')],_0x51bb1d[_0xd0ab('0x30')]);_0x2efda0[_0xd0ab('0x34')]=_[_0xd0ab('0x33')](_0x51bb1d['model'],qs['fields'](_0x17742d[_0xd0ab('0x30')][_0xd0ab('0x35')]));_0x2efda0['attributes']=_0x2efda0[_0xd0ab('0x34')][_0xd0ab('0x36')]?_0x2efda0['attributes']:_0x51bb1d[_0xd0ab('0x2f')];if(!_0x17742d['query'][_0xd0ab('0x37')](_0xd0ab('0x38'))){_0x2efda0['limit']=qs[_0xd0ab('0x1e')](_0x17742d['query']['limit']);_0x2efda0[_0xd0ab('0x1c')]=qs[_0xd0ab('0x1c')](_0x17742d[_0xd0ab('0x30')][_0xd0ab('0x1c')]);}_0x2efda0['order']=qs[_0xd0ab('0x39')](_0x17742d[_0xd0ab('0x30')][_0xd0ab('0x39')]);_0x2efda0[_0xd0ab('0x3a')]=qs['filters'](_[_0xd0ab('0x3b')](_0x17742d[_0xd0ab('0x30')],_0x51bb1d[_0xd0ab('0x32')]),_0x1e05b9);if(_0x17742d[_0xd0ab('0x30')][_0xd0ab('0x3c')]){_0x2efda0['where']=_[_0xd0ab('0x3d')](_0x2efda0['where'],{'$or':_[_0xd0ab('0x2b')](_0x1e05b9,function(_0x324115){if(_0x324115['type']!==_0xd0ab('0x3e')){var _0x2293db={};_0x2293db[_0x324115[_0xd0ab('0x29')]]={'$like':'%'+_0x17742d[_0xd0ab('0x30')]['filter']+'%'};return _0x2293db;}})});}_0x2efda0=_[_0xd0ab('0x3d')]({},_0x2efda0,_0x17742d[_0xd0ab('0x3f')]);var _0x4cc50a={'where':_0x2efda0[_0xd0ab('0x3a')]};return db[_0xd0ab('0x2c')]['count'](_0x4cc50a)['then'](function(_0x59b2e5){_0x266ada[_0xd0ab('0x1f')]=_0x59b2e5;if(_0x17742d[_0xd0ab('0x30')][_0xd0ab('0x40')]){_0x2efda0[_0xd0ab('0x41')]=[{'all':!![]}];}return db[_0xd0ab('0x2c')][_0xd0ab('0x42')](_0x2efda0);})[_0xd0ab('0x26')](function(_0x347ae2){_0x266ada[_0xd0ab('0x43')]=_0x347ae2;return _0x266ada;})[_0xd0ab('0x26')](respondWithFilteredResult(_0x41669a,_0x2efda0))['catch'](handleError(_0x41669a,null));};exports[_0xd0ab('0x44')]=function(_0x27127c,_0x2aea29){var _0x11ee52={'raw':!![],'where':{'id':_0x27127c[_0xd0ab('0x45')]['id']}},_0x253162={};_0x253162[_0xd0ab('0x2f')]=_[_0xd0ab('0x31')](db[_0xd0ab('0x2c')][_0xd0ab('0x46')]);_0x253162['query']=_[_0xd0ab('0x31')](_0x27127c[_0xd0ab('0x30')]);_0x253162[_0xd0ab('0x32')]=_[_0xd0ab('0x33')](_0x253162[_0xd0ab('0x2f')],_0x253162['query']);_0x11ee52[_0xd0ab('0x34')]=_[_0xd0ab('0x33')](_0x253162[_0xd0ab('0x2f')],qs[_0xd0ab('0x35')](_0x27127c[_0xd0ab('0x30')]['fields']));_0x11ee52['attributes']=_0x11ee52[_0xd0ab('0x34')][_0xd0ab('0x36')]?_0x11ee52[_0xd0ab('0x34')]:_0x253162['model'];if(_0x27127c[_0xd0ab('0x30')][_0xd0ab('0x40')]){_0x11ee52[_0xd0ab('0x41')]=[{'all':!![]}];}_0x11ee52=_[_0xd0ab('0x3d')]({},_0x11ee52,_0x27127c[_0xd0ab('0x3f')]);return db[_0xd0ab('0x2c')][_0xd0ab('0x47')](_0x11ee52)['then'](handleEntityNotFound(_0x2aea29,null))[_0xd0ab('0x26')](respondWithResult(_0x2aea29,null))[_0xd0ab('0x48')](handleError(_0x2aea29,null));};exports['create']=function(_0x45a243,_0x1762f0){return db[_0xd0ab('0x2c')][_0xd0ab('0x49')](_0x45a243['body'],{})['then'](respondWithResult(_0x1762f0,0xc9))[_0xd0ab('0x48')](handleError(_0x1762f0,null));};exports[_0xd0ab('0x24')]=function(_0x5217f5,_0x4c72c5){if(_0x5217f5[_0xd0ab('0x4a')]['id']){delete _0x5217f5['body']['id'];}return db[_0xd0ab('0x2c')][_0xd0ab('0x47')]({'where':{'id':_0x5217f5[_0xd0ab('0x45')]['id']}})[_0xd0ab('0x26')](handleEntityNotFound(_0x4c72c5,null))[_0xd0ab('0x26')](saveUpdates(_0x5217f5[_0xd0ab('0x4a')],null))['then'](respondWithResult(_0x4c72c5,null))[_0xd0ab('0x48')](handleError(_0x4c72c5,null));};exports['destroy']=function(_0x13fd31,_0x30b5c9){return db[_0xd0ab('0x2c')][_0xd0ab('0x47')]({'where':{'id':_0x13fd31['params']['id']}})[_0xd0ab('0x26')](handleEntityNotFound(_0x30b5c9,null))[_0xd0ab('0x26')](removeEntity(_0x30b5c9,null))[_0xd0ab('0x48')](handleError(_0x30b5c9,null));};exports[_0xd0ab('0x4b')]=function(_0xb30873,_0x18d833){return db[_0xd0ab('0x2c')][_0xd0ab('0x4b')]()['then'](respondWithResult(_0x18d833,null))[_0xd0ab('0x48')](handleError(_0x18d833,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 525bc4a..e97dbfe 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 _0x7047=['../../config/environment','./smsTransferReport.attributes','exports','define','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x25dfdf,_0x542333){var _0x5220da=function(_0x53accc){while(--_0x53accc){_0x25dfdf['push'](_0x25dfdf['shift']());}};_0x5220da(++_0x542333);}(_0x7047,0x10d));var _0x7704=function(_0x3a281f,_0x3e1615){_0x3a281f=_0x3a281f-0x0;var _0x1e1cd8=_0x7047[_0x3a281f];return _0x1e1cd8;};'use strict';var _=require(_0x7704('0x0'));var util=require(_0x7704('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7704('0x2'));var BPromise=require(_0x7704('0x3'));var rp=require(_0x7704('0x4'));var fs=require('fs');var path=require(_0x7704('0x5'));var rimraf=require(_0x7704('0x6'));var config=require(_0x7704('0x7'));var attributes=require(_0x7704('0x8'));module[_0x7704('0x9')]=function(_0x46af65,_0x4488bb){return _0x46af65[_0x7704('0xa')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x7704('0xb'),'fields':[_0x7704('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5369=['./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x20a590,_0x1e8a6d){var _0x2e1b41=function(_0x48359f){while(--_0x48359f){_0x20a590['push'](_0x20a590['shift']());}};_0x2e1b41(++_0x1e8a6d);}(_0x5369,0x17e));var _0x9536=function(_0x58f9f0,_0x53253a){_0x58f9f0=_0x58f9f0-0x0;var _0x230111=_0x5369[_0x58f9f0];return _0x230111;};'use strict';var _=require(_0x9536('0x0'));var util=require(_0x9536('0x1'));var logger=require('../../config/logger')(_0x9536('0x2'));var moment=require(_0x9536('0x3'));var BPromise=require('bluebird');var rp=require(_0x9536('0x4'));var fs=require('fs');var path=require(_0x9536('0x5'));var rimraf=require(_0x9536('0x6'));var config=require(_0x9536('0x7'));var attributes=require(_0x9536('0x8'));module['exports']=function(_0x3ae1d7,_0x3f1641){return _0x3ae1d7[_0x9536('0x9')](_0x9536('0xa'),attributes,{'tableName':_0x9536('0xb'),'paranoid':![],'indexes':[{'name':_0x9536('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 470921d..9e1fc46 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 _0x4677=['http','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x55dfed,_0x468e26){var _0x1bd060=function(_0x9db9e6){while(--_0x9db9e6){_0x55dfed['push'](_0x55dfed['shift']());}};_0x1bd060(++_0x468e26);}(_0x4677,0x155));var _0x7467=function(_0x581c8d,_0x50e542){_0x581c8d=_0x581c8d-0x0;var _0x41964e=_0x4677[_0x581c8d];return _0x41964e;};'use strict';var _=require(_0x7467('0x0'));var util=require('util');var moment=require(_0x7467('0x1'));var BPromise=require(_0x7467('0x2'));var rs=require(_0x7467('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7467('0x4'))['db'];var utils=require(_0x7467('0x5'));var logger=require(_0x7467('0x6'))(_0x7467('0x7'));var config=require(_0x7467('0x8'));var jayson=require(_0x7467('0x9'));var client=jayson[_0x7467('0xa')][_0x7467('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x198e6a,_0x4b26a7,_0x588489){return new BPromise(function(_0x418ff9,_0x1cc835){return client['request'](_0x198e6a,_0x588489)[_0x7467('0xc')](function(_0x4365e6){logger['info'](_0x7467('0xd'),_0x4b26a7,'request\x20sent');logger[_0x7467('0xe')](_0x7467('0xf'),_0x4b26a7,_0x7467('0x10'),JSON['stringify'](_0x4365e6));if(_0x4365e6[_0x7467('0x11')]){if(_0x4365e6[_0x7467('0x11')][_0x7467('0x12')]===0x1f4){logger[_0x7467('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4b26a7,_0x4365e6[_0x7467('0x11')]['message']);return _0x1cc835(_0x4365e6[_0x7467('0x11')][_0x7467('0x13')]);}logger[_0x7467('0x11')](_0x7467('0xd'),_0x4b26a7,_0x4365e6['error'][_0x7467('0x13')]);return _0x418ff9(_0x4365e6[_0x7467('0x11')][_0x7467('0x13')]);}else{logger['info'](_0x7467('0xd'),_0x4b26a7,_0x7467('0x10'));_0x418ff9(_0x4365e6[_0x7467('0x14')]['message']);}})[_0x7467('0x15')](function(_0x1df628){logger[_0x7467('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4b26a7,_0x1df628);_0x1cc835(_0x1df628);});});} \ No newline at end of file +var _0xe1dc=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xe1dc,0x8a));var _0xce1d=function(_0x1bcbb6,_0x1e2001){_0x1bcbb6=_0x1bcbb6-0x0;var _0x2fb798=_0xe1dc[_0x1bcbb6];return _0x2fb798;};'use strict';var _=require(_0xce1d('0x0'));var util=require(_0xce1d('0x1'));var moment=require(_0xce1d('0x2'));var BPromise=require(_0xce1d('0x3'));var rs=require(_0xce1d('0x4'));var fs=require('fs');var Redis=require(_0xce1d('0x5'));var db=require(_0xce1d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xce1d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xce1d('0x8'));var client=jayson[_0xce1d('0x9')][_0xce1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110cc2,_0x2a91e2,_0x62d18b){return new BPromise(function(_0x4b9a85,_0x447d87){return client[_0xce1d('0xb')](_0x110cc2,_0x62d18b)['then'](function(_0x3918ba){logger[_0xce1d('0xc')](_0xce1d('0xd'),_0x2a91e2,_0xce1d('0xe'));logger[_0xce1d('0xf')](_0xce1d('0x10'),_0x2a91e2,_0xce1d('0xe'),JSON[_0xce1d('0x11')](_0x3918ba));if(_0x3918ba['error']){if(_0x3918ba[_0xce1d('0x12')][_0xce1d('0x13')]===0x1f4){logger['error'](_0xce1d('0xd'),_0x2a91e2,_0x3918ba['error']['message']);return _0x447d87(_0x3918ba['error'][_0xce1d('0x14')]);}logger['error'](_0xce1d('0xd'),_0x2a91e2,_0x3918ba['error'][_0xce1d('0x14')]);return _0x4b9a85(_0x3918ba[_0xce1d('0x12')]['message']);}else{logger[_0xce1d('0xc')](_0xce1d('0xd'),_0x2a91e2,_0xce1d('0xe'));_0x4b9a85(_0x3918ba[_0xce1d('0x15')][_0xce1d('0x14')]);}})[_0xce1d('0x16')](function(_0x1fc463){logger['error'](_0xce1d('0xd'),_0x2a91e2,_0x1fc463);_0x447d87(_0x1fc463);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 6519e92..17885cc 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 _0x785c=['delete','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','file','create','update'];(function(_0x3c4ed9,_0x4b3eea){var _0x4f5bb7=function(_0x482742){while(--_0x482742){_0x3c4ed9['push'](_0x3c4ed9['shift']());}};_0x4f5bb7(++_0x4b3eea);}(_0x785c,0x1b5));var _0xc785=function(_0x24bd96,_0x260e8f){_0x24bd96=_0x24bd96-0x0;var _0x5bfdd7=_0x785c[_0x24bd96];return _0x5bfdd7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc785('0x0'));var timeout=require(_0xc785('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc785('0x2'));var interaction=require(_0xc785('0x3'));var config=require(_0xc785('0x4'));var controller=require(_0xc785('0x5'));router['get']('/',auth[_0xc785('0x6')](),controller[_0xc785('0x7')]);router[_0xc785('0x8')](_0xc785('0x9'),auth[_0xc785('0x6')](),controller[_0xc785('0xa')]);router[_0xc785('0x8')](_0xc785('0xb'),auth[_0xc785('0x6')](),controller[_0xc785('0xc')]);var upload=multer({'storage':multer[_0xc785('0xd')]({'destination':function(_0x287a38,_0x1d5fdb,_0x2b07e8){_0x2b07e8(null,path[_0xc785('0xe')](config[_0xc785('0xf')],_0xc785('0x10')));},'filename':function(_0x1c2a5d,_0x1f6f04,_0x3f0c47){_0x1f6f04[_0xc785('0x11')]=_0x1f6f04[_0xc785('0x11')][_0xc785('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3f0c47(null,util[_0xc785('0x13')](_0xc785('0x14'),path[_0xc785('0x15')](_0x1f6f04[_0xc785('0x11')],path[_0xc785('0x16')](_0x1f6f04['originalname'])),Date['now'](),path[_0xc785('0x16')](_0x1f6f04[_0xc785('0x11')])));}})});router[_0xc785('0x17')]('/',upload['single'](_0xc785('0x18')),controller[_0xc785('0x19')]);router['put'](_0xc785('0x9'),auth[_0xc785('0x6')](),controller[_0xc785('0x1a')]);router['delete'](_0xc785('0x9'),auth['isAuthenticated'](),controller[_0xc785('0x1b')]);module[_0xc785('0x1c')]=router; \ No newline at end of file +var _0x0b1a=['/:id/download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','file','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x578c2f,_0x3b6ee3){var _0x2b0d4b=function(_0x36cae0){while(--_0x36cae0){_0x578c2f['push'](_0x578c2f['shift']());}};_0x2b0d4b(++_0x3b6ee3);}(_0x0b1a,0x132));var _0xa0b1=function(_0x5009fa,_0x554c23){_0x5009fa=_0x5009fa-0x0;var _0x3bb400=_0x0b1a[_0x5009fa];return _0x3bb400;};'use strict';var multer=require('multer');var util=require(_0xa0b1('0x0'));var path=require(_0xa0b1('0x1'));var timeout=require(_0xa0b1('0x2'));var express=require(_0xa0b1('0x3'));var router=express[_0xa0b1('0x4')]();var fs_extra=require(_0xa0b1('0x5'));var auth=require(_0xa0b1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa0b1('0x7'));var controller=require('./sound.controller');router[_0xa0b1('0x8')]('/',auth['isAuthenticated'](),controller[_0xa0b1('0x9')]);router[_0xa0b1('0x8')](_0xa0b1('0xa'),auth[_0xa0b1('0xb')](),controller[_0xa0b1('0xc')]);router[_0xa0b1('0x8')](_0xa0b1('0xd'),auth[_0xa0b1('0xb')](),controller['download']);var upload=multer({'storage':multer[_0xa0b1('0xe')]({'destination':function(_0x40480b,_0x38b507,_0x233605){_0x233605(null,path[_0xa0b1('0xf')](config['root'],_0xa0b1('0x10')));},'filename':function(_0x5b6b6d,_0x4a8583,_0x2e1550){_0x4a8583[_0xa0b1('0x11')]=_0x4a8583[_0xa0b1('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2e1550(null,util[_0xa0b1('0x12')](_0xa0b1('0x13'),path[_0xa0b1('0x14')](_0x4a8583[_0xa0b1('0x11')],path[_0xa0b1('0x15')](_0x4a8583[_0xa0b1('0x11')])),Date[_0xa0b1('0x16')](),path[_0xa0b1('0x15')](_0x4a8583[_0xa0b1('0x11')])));}})});router[_0xa0b1('0x17')]('/',upload['single'](_0xa0b1('0x18')),controller['create']);router[_0xa0b1('0x19')](_0xa0b1('0xa'),auth[_0xa0b1('0xb')](),controller[_0xa0b1('0x1a')]);router[_0xa0b1('0x1b')](_0xa0b1('0xa'),auth[_0xa0b1('0xb')](),controller['delete']);module[_0xa0b1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 78b1cae..a366994 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 _0x037e=['BIGINT','INTEGER','sequelize','exports','STRING','name','FLOAT'];(function(_0x5aa4cc,_0x5b14d6){var _0x5a0e24=function(_0xf7c818){while(--_0xf7c818){_0x5aa4cc['push'](_0x5aa4cc['shift']());}};_0x5a0e24(++_0x5b14d6);}(_0x037e,0x1ec));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe037('0x0'));module[_0xe037('0x1')]={'name':{'type':Sequelize[_0xe037('0x2')],'unique':_0xe037('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe037('0x2')]},'display_name':{'type':Sequelize[_0xe037('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe037('0x2')]},'original_format':{'type':Sequelize[_0xe037('0x2')]},'original_duration':{'type':Sequelize[_0xe037('0x4')]},'original_sampleCount':{'type':Sequelize[_0xe037('0x5')]},'original_channelCount':{'type':Sequelize[_0xe037('0x6')]},'original_bitRate':{'type':Sequelize[_0xe037('0x5')]},'original_sampleRate':{'type':Sequelize[_0xe037('0x6')]},'converted_format':{'type':Sequelize[_0xe037('0x2')]},'converted_duration':{'type':Sequelize[_0xe037('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xe037('0x5')]},'converted_channelCount':{'type':Sequelize[_0xe037('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7c55=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x5c4777,_0x3022fe){var _0x3e9643=function(_0x2c9594){while(--_0x2c9594){_0x5c4777['push'](_0x5c4777['shift']());}};_0x3e9643(++_0x3022fe);}(_0x7c55,0x180));var _0x57c5=function(_0x3d2bb2,_0x5656b6){_0x3d2bb2=_0x3d2bb2-0x0;var _0x5ed80a=_0x7c55[_0x3d2bb2];return _0x5ed80a;};'use strict';var Sequelize=require(_0x57c5('0x0'));module[_0x57c5('0x1')]={'name':{'type':Sequelize[_0x57c5('0x2')],'unique':_0x57c5('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x57c5('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x57c5('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x57c5('0x4')]},'original_sampleCount':{'type':Sequelize[_0x57c5('0x5')]},'original_channelCount':{'type':Sequelize[_0x57c5('0x6')]},'original_bitRate':{'type':Sequelize[_0x57c5('0x5')]},'original_sampleRate':{'type':Sequelize[_0x57c5('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x57c5('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x57c5('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a78e4da..85e8ce4 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 _0x4e2e=['undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','name','send','index','map','Sound','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','count','include','findAll','rows','catch','show','keys','includeAll','options','find','download','converted_format','existsSync','join','root','Sequelize','server/files/sounds/converted','format','%s.%s','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','params','save_name','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0xa00058,_0xe8f38b){var _0x47d77b=function(_0x49073a){while(--_0x49073a){_0xa00058['push'](_0xa00058['shift']());}};_0x47d77b(++_0xe8f38b);}(_0x4e2e,0xe0));var _0xe4e2=function(_0x12e514,_0x11dd07){_0x12e514=_0x12e514-0x0;var _0x2315db=_0x4e2e[_0x12e514];return _0x2315db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require(_0xe4e2('0x6'));var util=require('util');var path=require(_0xe4e2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe4e2('0x8'));var fs=require('fs');var fs_extra=require(_0xe4e2('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe4e2('0xa'));var querystring=require('querystring');var Papa=require(_0xe4e2('0xb'));var Redis=require(_0xe4e2('0xc'));var authService=require(_0xe4e2('0xd'));var qs=require(_0xe4e2('0xe'));var as=require(_0xe4e2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4e2('0x10'))(_0xe4e2('0x11'));var utils=require(_0xe4e2('0x12'));var config=require(_0xe4e2('0x13'));var licenseUtil=require(_0xe4e2('0x14'));var db=require(_0xe4e2('0x15'))['db'];function respondWithStatusCode(_0x5a9a49,_0x2dc921){_0x2dc921=_0x2dc921||0xcc;return function(_0x45a86f){if(_0x45a86f){return _0x5a9a49['sendStatus'](_0x2dc921);}return _0x5a9a49[_0xe4e2('0x16')](_0x2dc921)[_0xe4e2('0x17')]();};}function respondWithResult(_0x41d185,_0x1ee810){_0x1ee810=_0x1ee810||0xc8;return function(_0x42b82c){if(_0x42b82c){return _0x41d185[_0xe4e2('0x16')](_0x1ee810)[_0xe4e2('0x18')](_0x42b82c);}};}function respondWithFilteredResult(_0x497bd7,_0x22f9d1){return function(_0x2a6ad8){if(_0x2a6ad8){var _0x3d1a92=typeof _0x22f9d1[_0xe4e2('0x19')]===_0xe4e2('0x1a')&&typeof _0x22f9d1[_0xe4e2('0x1b')]==='undefined';var _0x4148a6=_0x2a6ad8['count'];var _0x18c942=_0x3d1a92?0x0:_0x22f9d1[_0xe4e2('0x19')];var _0xfa93d6=_0x3d1a92?_0x2a6ad8['count']:_0x22f9d1[_0xe4e2('0x19')]+_0x22f9d1[_0xe4e2('0x1b')];var _0x141991;if(_0xfa93d6>=_0x4148a6){_0xfa93d6=_0x4148a6;_0x141991=0xc8;}else{_0x141991=0xce;}_0x497bd7[_0xe4e2('0x16')](_0x141991);return _0x497bd7[_0xe4e2('0x1c')](_0xe4e2('0x1d'),_0x18c942+'-'+_0xfa93d6+'/'+_0x4148a6)[_0xe4e2('0x18')](_0x2a6ad8);}return null;};}function patchUpdates(_0xa55e2f){return function(_0x34ea28){try{jsonpatch[_0xe4e2('0x1e')](_0x34ea28,_0xa55e2f,!![]);}catch(_0x441c80){return BPromise[_0xe4e2('0x1f')](_0x441c80);}return _0x34ea28[_0xe4e2('0x20')]();};}function saveUpdates(_0x64cce,_0x218976){return function(_0x3716d3){if(_0x3716d3){return _0x3716d3[_0xe4e2('0x21')](_0x64cce)[_0xe4e2('0x22')](function(_0x859d66){return _0x859d66;});}return null;};}function removeEntity(_0x6cf61,_0x466646){return function(_0x3a4880){if(_0x3a4880){return _0x3a4880[_0xe4e2('0x23')]()[_0xe4e2('0x22')](function(){var _0x39ba44=_0x3a4880[_0xe4e2('0x24')]({'plain':!![]});var _0x34aae7=_0xe4e2('0x25');return db[_0xe4e2('0x26')]['destroy']({'where':{'type':_0x34aae7,'resourceId':_0x39ba44['id']}})[_0xe4e2('0x22')](function(){return _0x3a4880;});})['then'](function(){_0x6cf61[_0xe4e2('0x16')](0xcc)[_0xe4e2('0x17')]();});}};}function handleEntityNotFound(_0x1e8006,_0xf4af38){return function(_0x3ccf09){if(!_0x3ccf09){_0x1e8006[_0xe4e2('0x27')](0x194);}return _0x3ccf09;};}function handleError(_0x482700,_0x3f8362){_0x3f8362=_0x3f8362||0x1f4;return function(_0x5965dd){logger[_0xe4e2('0x28')](_0x5965dd['stack']);if(_0x5965dd[_0xe4e2('0x29')]){delete _0x5965dd['name'];}_0x482700[_0xe4e2('0x16')](_0x3f8362)[_0xe4e2('0x2a')](_0x5965dd);};}exports[_0xe4e2('0x2b')]=function(_0x2c0259,_0x2dade0){var _0x2ab67e={},_0x57799c={},_0x1a1962={'count':0x0,'rows':[]};var _0x123d98=_[_0xe4e2('0x2c')](db[_0xe4e2('0x2d')][_0xe4e2('0x2e')],function(_0x21f376){return{'name':_0x21f376[_0xe4e2('0x2f')],'type':_0x21f376['type'][_0xe4e2('0x30')]};});_0x57799c[_0xe4e2('0x31')]=_[_0xe4e2('0x2c')](_0x123d98,_0xe4e2('0x29'));_0x57799c[_0xe4e2('0x32')]=_['keys'](_0x2c0259[_0xe4e2('0x32')]);_0x57799c[_0xe4e2('0x33')]=_[_0xe4e2('0x34')](_0x57799c[_0xe4e2('0x31')],_0x57799c[_0xe4e2('0x32')]);_0x2ab67e[_0xe4e2('0x35')]=_['intersection'](_0x57799c[_0xe4e2('0x31')],qs[_0xe4e2('0x36')](_0x2c0259[_0xe4e2('0x32')][_0xe4e2('0x36')]));_0x2ab67e[_0xe4e2('0x35')]=_0x2ab67e[_0xe4e2('0x35')][_0xe4e2('0x37')]?_0x2ab67e[_0xe4e2('0x35')]:_0x57799c[_0xe4e2('0x31')];if(!_0x2c0259[_0xe4e2('0x32')][_0xe4e2('0x38')]('nolimit')){_0x2ab67e[_0xe4e2('0x1b')]=qs['limit'](_0x2c0259[_0xe4e2('0x32')]['limit']);_0x2ab67e[_0xe4e2('0x19')]=qs[_0xe4e2('0x19')](_0x2c0259[_0xe4e2('0x32')][_0xe4e2('0x19')]);}_0x2ab67e[_0xe4e2('0x39')]=qs[_0xe4e2('0x3a')](_0x2c0259['query']['sort']);_0x2ab67e[_0xe4e2('0x3b')]=qs['filters'](_[_0xe4e2('0x3c')](_0x2c0259['query'],_0x57799c[_0xe4e2('0x33')]),_0x123d98);if(_0x2c0259[_0xe4e2('0x32')][_0xe4e2('0x3d')]){_0x2ab67e[_0xe4e2('0x3b')]=_['merge'](_0x2ab67e[_0xe4e2('0x3b')],{'$or':_[_0xe4e2('0x2c')](_0x123d98,function(_0x47963a){if(_0x47963a[_0xe4e2('0x3e')]!=='VIRTUAL'){var _0x2be09d={};_0x2be09d[_0x47963a[_0xe4e2('0x29')]]={'$like':'%'+_0x2c0259[_0xe4e2('0x32')][_0xe4e2('0x3d')]+'%'};return _0x2be09d;}})});}_0x2ab67e=_[_0xe4e2('0x3f')]({},_0x2ab67e,_0x2c0259['options']);var _0x1a7d86={'where':_0x2ab67e[_0xe4e2('0x3b')]};return db[_0xe4e2('0x2d')][_0xe4e2('0x40')](_0x1a7d86)[_0xe4e2('0x22')](function(_0x4ec138){_0x1a1962[_0xe4e2('0x40')]=_0x4ec138;if(_0x2c0259[_0xe4e2('0x32')]['includeAll']){_0x2ab67e[_0xe4e2('0x41')]=[{'all':!![]}];}return db[_0xe4e2('0x2d')][_0xe4e2('0x42')](_0x2ab67e);})[_0xe4e2('0x22')](function(_0x5ea43c){_0x1a1962[_0xe4e2('0x43')]=_0x5ea43c;return _0x1a1962;})[_0xe4e2('0x22')](respondWithFilteredResult(_0x2dade0,_0x2ab67e))[_0xe4e2('0x44')](handleError(_0x2dade0,null));};exports[_0xe4e2('0x45')]=function(_0x34572c,_0x2dd45f){var _0x2e1bd5={'raw':!![],'where':{'id':_0x34572c['params']['id']}},_0x5431e2={};_0x5431e2[_0xe4e2('0x31')]=_[_0xe4e2('0x46')](db[_0xe4e2('0x2d')]['rawAttributes']);_0x5431e2['query']=_[_0xe4e2('0x46')](_0x34572c[_0xe4e2('0x32')]);_0x5431e2[_0xe4e2('0x33')]=_['intersection'](_0x5431e2[_0xe4e2('0x31')],_0x5431e2[_0xe4e2('0x32')]);_0x2e1bd5[_0xe4e2('0x35')]=_[_0xe4e2('0x34')](_0x5431e2['model'],qs['fields'](_0x34572c['query'][_0xe4e2('0x36')]));_0x2e1bd5[_0xe4e2('0x35')]=_0x2e1bd5[_0xe4e2('0x35')]['length']?_0x2e1bd5['attributes']:_0x5431e2[_0xe4e2('0x31')];if(_0x34572c[_0xe4e2('0x32')][_0xe4e2('0x47')]){_0x2e1bd5[_0xe4e2('0x41')]=[{'all':!![]}];}_0x2e1bd5=_[_0xe4e2('0x3f')]({},_0x2e1bd5,_0x34572c[_0xe4e2('0x48')]);return db[_0xe4e2('0x2d')][_0xe4e2('0x49')](_0x2e1bd5)[_0xe4e2('0x22')](handleEntityNotFound(_0x2dd45f,null))[_0xe4e2('0x22')](respondWithResult(_0x2dd45f,null))[_0xe4e2('0x44')](handleError(_0x2dd45f,null));};exports[_0xe4e2('0x4a')]=function(_0x5568de,_0x366113,_0x3455ce){return db[_0xe4e2('0x2d')][_0xe4e2('0x49')]({'where':{'id':_0x5568de['params']['id']},'attributes':['name','save_name',_0xe4e2('0x4b')],'raw':!![]})[_0xe4e2('0x22')](handleEntityNotFound(_0x366113,null))[_0xe4e2('0x22')](function(_0x46e9a7){if(_0x46e9a7){if(!fs[_0xe4e2('0x4c')](path[_0xe4e2('0x4d')](config[_0xe4e2('0x4e')],'server/files/sounds/converted',_0x46e9a7['save_name']+'.'+_0x46e9a7['converted_format']))){throw new db[(_0xe4e2('0x4f'))]['ValidationError']('Sound\x20not\x20found');}return _0x366113[_0xe4e2('0x4a')](path[_0xe4e2('0x4d')](config[_0xe4e2('0x4e')],_0xe4e2('0x50'),util[_0xe4e2('0x51')](_0xe4e2('0x52'),_0x46e9a7['save_name'],_0x46e9a7[_0xe4e2('0x4b')])),util[_0xe4e2('0x51')](_0xe4e2('0x52'),_0x46e9a7[_0xe4e2('0x29')],_0x46e9a7[_0xe4e2('0x4b')]));}return null;})['catch'](handleError(_0x366113,null));};exports['create']=function(_0x1fd764,_0x30ced8,_0x13d42c){var _0x1cb398={'name':path['basename'](_0x1fd764[_0xe4e2('0x53')][_0xe4e2('0x54')],path[_0xe4e2('0x55')](_0x1fd764['file'][_0xe4e2('0x54')])),'save_name':path[_0xe4e2('0x56')](_0x1fd764[_0xe4e2('0x53')][_0xe4e2('0x57')],path[_0xe4e2('0x55')](_0x1fd764[_0xe4e2('0x53')][_0xe4e2('0x57')])),'original_format':path[_0xe4e2('0x55')](_0x1fd764['file'][_0xe4e2('0x54')])[_0xe4e2('0x58')](0x1),'converted_format':_0xe4e2('0x59')};var _0x1d3ef3=path[_0xe4e2('0x4d')](config[_0xe4e2('0x4e')],_0xe4e2('0x5a'),_0x1fd764[_0xe4e2('0x53')][_0xe4e2('0x57')]);var _0x3b8d4f=path['join'](config[_0xe4e2('0x4e')],'server/files/sounds/converted',util[_0xe4e2('0x51')](_0xe4e2('0x52'),path[_0xe4e2('0x56')](_0x1fd764[_0xe4e2('0x53')]['filename'],path[_0xe4e2('0x55')](_0x1fd764[_0xe4e2('0x53')]['filename'])),_0x1cb398[_0xe4e2('0x4b')]));logger[_0xe4e2('0x5b')](_0xe4e2('0x5c'),_0x1d3ef3);logger[_0xe4e2('0x5b')](_0xe4e2('0x5d'),_0x3b8d4f);try{fs[_0xe4e2('0x5e')](_0x1d3ef3,parseInt(_0xe4e2('0x5f'),0x8));var _0x4f8161=sox[_0xe4e2('0x60')](_0x1d3ef3,_0x3b8d4f,{'sampleRate':0x1f40,'format':_0xe4e2('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4f8161['on'](_0xe4e2('0x28'),function(_0x2330e2){fs[_0xe4e2('0x61')](_0x1d3ef3);_0x30ced8[_0xe4e2('0x16')](0x1f4)['send'](_0x2330e2);});_0x4f8161['on'](_0xe4e2('0x62'),function(_0x143820){_0x1cb398[_0xe4e2('0x63')]=isNaN(_0x143820[_0xe4e2('0x64')])?null:_0x143820[_0xe4e2('0x64')]*0x3e8;_0x1cb398[_0xe4e2('0x65')]=isNaN(_0x143820[_0xe4e2('0x66')])?null:_0x143820['sampleCount'];_0x1cb398[_0xe4e2('0x67')]=isNaN(_0x143820[_0xe4e2('0x68')])?null:_0x143820[_0xe4e2('0x68')];_0x1cb398[_0xe4e2('0x69')]=isNaN(_0x143820[_0xe4e2('0x6a')])?null:_0x143820[_0xe4e2('0x6a')];_0x1cb398[_0xe4e2('0x6b')]=isNaN(_0x143820[_0xe4e2('0x6c')])?null:_0x143820[_0xe4e2('0x6c')];});_0x4f8161['on'](_0xe4e2('0x6d'),function(_0x3be521){_0x1cb398[_0xe4e2('0x6e')]=isNaN(_0x3be521[_0xe4e2('0x64')])?null:_0x3be521[_0xe4e2('0x64')]*0x3e8;_0x1cb398['converted_sampleCount']=isNaN(_0x3be521[_0xe4e2('0x66')])?null:_0x3be521['sampleCount'];_0x1cb398[_0xe4e2('0x6f')]=isNaN(_0x3be521['channelCount'])?null:_0x3be521[_0xe4e2('0x68')];_0x1cb398[_0xe4e2('0x70')]=isNaN(_0x3be521[_0xe4e2('0x6a')])?null:_0x3be521[_0xe4e2('0x6a')];_0x1cb398['converted_sampleRate']=isNaN(_0x3be521[_0xe4e2('0x6c')])?null:_0x3be521[_0xe4e2('0x6c')];});_0x4f8161['on']('end',function(){fs[_0xe4e2('0x5e')](_0x3b8d4f,parseInt('0777',0x8));return db[_0xe4e2('0x2d')][_0xe4e2('0x71')](_0x1cb398)[_0xe4e2('0x22')](function(_0x5da879){var _0x4e991a={'role':_0x1fd764[_0xe4e2('0x72')][_0xe4e2('0x73')],'userProfileId':_0x1fd764[_0xe4e2('0x72')][_0xe4e2('0x74')]};if(!_0x4e991a)throw new Error(_0xe4e2('0x75'));if(_0x4e991a[_0xe4e2('0x73')]===_0xe4e2('0x76')){var _0x2c0b18=_0x5da879['get']({'plain':!![]});return db[_0xe4e2('0x77')][_0xe4e2('0x49')]({'where':{'name':_0xe4e2('0x25'),'userProfileId':_0x4e991a['userProfileId']},'raw':!![]})[_0xe4e2('0x22')](function(_0xcfc23d){if(_0xcfc23d&&_0xcfc23d['autoAssociation']===0x0){return db[_0xe4e2('0x26')]['create']({'name':_0x2c0b18['name'],'resourceId':_0x2c0b18['id'],'type':_0xcfc23d[_0xe4e2('0x29')],'sectionId':_0xcfc23d['id']},{})[_0xe4e2('0x22')](function(){return _0x5da879;});}else{return _0x5da879;}})[_0xe4e2('0x44')](function(_0x1a71ee){logger[_0xe4e2('0x28')](_0xe4e2('0x78'),_0x1a71ee);throw _0x1a71ee;});}return _0x5da879;})[_0xe4e2('0x22')](respondWithResult(_0x30ced8,null))[_0xe4e2('0x44')](handleError(_0x30ced8,null));});_0x4f8161['start']();}catch(_0x5c11fc){_0x30ced8[_0xe4e2('0x16')](0x1f4)[_0xe4e2('0x2a')](_0x5c11fc);}};exports[_0xe4e2('0x21')]=function(_0x5748a9,_0x1b6d73,_0x22d943){return db[_0xe4e2('0x2d')]['find']({'where':{'id':_0x5748a9['params']['id']}})[_0xe4e2('0x22')](handleEntityNotFound(_0x1b6d73,null))[_0xe4e2('0x22')](saveUpdates(_[_0xe4e2('0x3c')](_0x5748a9['body'],[_0xe4e2('0x29'),_0xe4e2('0x79')]),null))[_0xe4e2('0x22')](respondWithResult(_0x1b6d73,null))[_0xe4e2('0x44')](handleError(_0x1b6d73,null));};exports['delete']=function(_0x1fee7e,_0x4f0518,_0x4b7b82){return db['Sound'][_0xe4e2('0x49')]({'where':{'id':_0x1fee7e[_0xe4e2('0x7a')]['id']}})['then'](function(_0x575279){if(_0x575279){return _0x575279[_0xe4e2('0x23')]();}})[_0xe4e2('0x22')](function(_0x47f919){var _0x4ca3e1=path[_0xe4e2('0x4d')](config[_0xe4e2('0x4e')],_0xe4e2('0x5a'),util[_0xe4e2('0x51')]('%s.%s',_0x47f919[_0xe4e2('0x7b')],_0x47f919[_0xe4e2('0x7c')]));var _0x57d5f5=path['join'](config[_0xe4e2('0x4e')],_0xe4e2('0x50'),util[_0xe4e2('0x51')](_0xe4e2('0x52'),_0x47f919[_0xe4e2('0x7b')],_0x47f919[_0xe4e2('0x4b')]));fs[_0xe4e2('0x61')](_0x4ca3e1);fs[_0xe4e2('0x61')](_0x57d5f5);return _0x47f919;})[_0xe4e2('0x22')](function(_0x9cd5d0){if(_0x9cd5d0){return _0x4f0518[_0xe4e2('0x16')](0xcc)[_0xe4e2('0x17')]();}})[_0xe4e2('0x22')](handleEntityNotFound(_0x4f0518,null))[_0xe4e2('0x44')](handleError(_0x4f0518,null));}; \ No newline at end of file +var _0x548c=['intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','Sound','count','include','findAll','catch','length','options','find','download','save_name','converted_format','existsSync','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','join','root','format','%s.%s','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_sampleRate','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','create','start','body','description','params','original_format','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x5ec09d,_0x391827){var _0x304aae=function(_0x4153f7){while(--_0x4153f7){_0x5ec09d['push'](_0x5ec09d['shift']());}};_0x304aae(++_0x391827);}(_0x548c,0xc0));var _0xc548=function(_0x23d751,_0x2b0c83){_0x23d751=_0x23d751-0x0;var _0x134b39=_0x548c[_0x23d751];return _0x134b39;};'use strict';var emlformat=require(_0xc548('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc548('0x1'));var rp=require(_0xc548('0x2'));var moment=require(_0xc548('0x3'));var BPromise=require(_0xc548('0x4'));var Mustache=require(_0xc548('0x5'));var util=require(_0xc548('0x6'));var path=require(_0xc548('0x7'));var sox=require('sox');var csv=require(_0xc548('0x8'));var ejs=require(_0xc548('0x9'));var fs=require('fs');var fs_extra=require(_0xc548('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc548('0xb'));var toCsv=require(_0xc548('0x8'));var querystring=require('querystring');var Papa=require(_0xc548('0xc'));var Redis=require(_0xc548('0xd'));var authService=require(_0xc548('0xe'));var qs=require(_0xc548('0xf'));var as=require(_0xc548('0x10'));var hardwareService=require(_0xc548('0x11'));var logger=require(_0xc548('0x12'))(_0xc548('0x13'));var utils=require(_0xc548('0x14'));var config=require(_0xc548('0x15'));var licenseUtil=require(_0xc548('0x16'));var db=require(_0xc548('0x17'))['db'];function respondWithStatusCode(_0x44b36a,_0x32a9e6){_0x32a9e6=_0x32a9e6||0xcc;return function(_0x126c2b){if(_0x126c2b){return _0x44b36a[_0xc548('0x18')](_0x32a9e6);}return _0x44b36a[_0xc548('0x19')](_0x32a9e6)[_0xc548('0x1a')]();};}function respondWithResult(_0x1de213,_0x182711){_0x182711=_0x182711||0xc8;return function(_0x1e8651){if(_0x1e8651){return _0x1de213[_0xc548('0x19')](_0x182711)[_0xc548('0x1b')](_0x1e8651);}};}function respondWithFilteredResult(_0x3418e0,_0x4569b9){return function(_0x28b828){if(_0x28b828){var _0x15f1a7=typeof _0x4569b9[_0xc548('0x1c')]===_0xc548('0x1d')&&typeof _0x4569b9['limit']==='undefined';var _0x451fa2=_0x28b828['count'];var _0x4aa2b5=_0x15f1a7?0x0:_0x4569b9[_0xc548('0x1c')];var _0x4eaa72=_0x15f1a7?_0x28b828['count']:_0x4569b9[_0xc548('0x1c')]+_0x4569b9['limit'];var _0x570567;if(_0x4eaa72>=_0x451fa2){_0x4eaa72=_0x451fa2;_0x570567=0xc8;}else{_0x570567=0xce;}_0x3418e0[_0xc548('0x19')](_0x570567);return _0x3418e0['set'](_0xc548('0x1e'),_0x4aa2b5+'-'+_0x4eaa72+'/'+_0x451fa2)[_0xc548('0x1b')](_0x28b828);}return null;};}function patchUpdates(_0x2f8bb0){return function(_0x18186c){try{jsonpatch[_0xc548('0x1f')](_0x18186c,_0x2f8bb0,!![]);}catch(_0x4079d1){return BPromise[_0xc548('0x20')](_0x4079d1);}return _0x18186c[_0xc548('0x21')]();};}function saveUpdates(_0x1070da,_0x3ab219){return function(_0x4d8e02){if(_0x4d8e02){return _0x4d8e02[_0xc548('0x22')](_0x1070da)[_0xc548('0x23')](function(_0x28e787){return _0x28e787;});}return null;};}function removeEntity(_0x4a16ce,_0x345ea0){return function(_0x4c3f6e){if(_0x4c3f6e){return _0x4c3f6e[_0xc548('0x24')]()['then'](function(){var _0x201cba=_0x4c3f6e[_0xc548('0x25')]({'plain':!![]});var _0x2fcaff=_0xc548('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2fcaff,'resourceId':_0x201cba['id']}})[_0xc548('0x23')](function(){return _0x4c3f6e;});})[_0xc548('0x23')](function(){_0x4a16ce['status'](0xcc)[_0xc548('0x1a')]();});}};}function handleEntityNotFound(_0x1d2025,_0x253052){return function(_0x2225c5){if(!_0x2225c5){_0x1d2025[_0xc548('0x18')](0x194);}return _0x2225c5;};}function handleError(_0x4151f9,_0x46dd57){_0x46dd57=_0x46dd57||0x1f4;return function(_0x4a83c3){logger[_0xc548('0x27')](_0x4a83c3[_0xc548('0x28')]);if(_0x4a83c3[_0xc548('0x29')]){delete _0x4a83c3[_0xc548('0x29')];}_0x4151f9[_0xc548('0x19')](_0x46dd57)[_0xc548('0x2a')](_0x4a83c3);};}exports[_0xc548('0x2b')]=function(_0x2d28a8,_0x2174b1){var _0x43e3a5={},_0x4bf550={},_0x27e70e={'count':0x0,'rows':[]};var _0x279351=_[_0xc548('0x2c')](db['Sound'][_0xc548('0x2d')],function(_0x2cc5c9){return{'name':_0x2cc5c9[_0xc548('0x2e')],'type':_0x2cc5c9['type'][_0xc548('0x2f')]};});_0x4bf550[_0xc548('0x30')]=_[_0xc548('0x2c')](_0x279351,_0xc548('0x29'));_0x4bf550[_0xc548('0x31')]=_[_0xc548('0x32')](_0x2d28a8[_0xc548('0x31')]);_0x4bf550[_0xc548('0x33')]=_[_0xc548('0x34')](_0x4bf550[_0xc548('0x30')],_0x4bf550['query']);_0x43e3a5['attributes']=_['intersection'](_0x4bf550['model'],qs['fields'](_0x2d28a8['query'][_0xc548('0x35')]));_0x43e3a5[_0xc548('0x36')]=_0x43e3a5[_0xc548('0x36')]['length']?_0x43e3a5[_0xc548('0x36')]:_0x4bf550[_0xc548('0x30')];if(!_0x2d28a8['query'][_0xc548('0x37')]('nolimit')){_0x43e3a5['limit']=qs['limit'](_0x2d28a8[_0xc548('0x31')]['limit']);_0x43e3a5[_0xc548('0x1c')]=qs[_0xc548('0x1c')](_0x2d28a8[_0xc548('0x31')][_0xc548('0x1c')]);}_0x43e3a5['order']=qs[_0xc548('0x38')](_0x2d28a8[_0xc548('0x31')]['sort']);_0x43e3a5[_0xc548('0x39')]=qs[_0xc548('0x33')](_[_0xc548('0x3a')](_0x2d28a8[_0xc548('0x31')],_0x4bf550[_0xc548('0x33')]),_0x279351);if(_0x2d28a8[_0xc548('0x31')][_0xc548('0x3b')]){_0x43e3a5[_0xc548('0x39')]=_[_0xc548('0x3c')](_0x43e3a5[_0xc548('0x39')],{'$or':_['map'](_0x279351,function(_0x333527){if(_0x333527[_0xc548('0x3d')]!==_0xc548('0x3e')){var _0x4ea889={};_0x4ea889[_0x333527['name']]={'$like':'%'+_0x2d28a8[_0xc548('0x31')][_0xc548('0x3b')]+'%'};return _0x4ea889;}})});}_0x43e3a5=_[_0xc548('0x3c')]({},_0x43e3a5,_0x2d28a8['options']);var _0x143781={'where':_0x43e3a5['where']};return db[_0xc548('0x3f')]['count'](_0x143781)[_0xc548('0x23')](function(_0x12e7a1){_0x27e70e[_0xc548('0x40')]=_0x12e7a1;if(_0x2d28a8[_0xc548('0x31')]['includeAll']){_0x43e3a5[_0xc548('0x41')]=[{'all':!![]}];}return db[_0xc548('0x3f')][_0xc548('0x42')](_0x43e3a5);})[_0xc548('0x23')](function(_0x385946){_0x27e70e['rows']=_0x385946;return _0x27e70e;})[_0xc548('0x23')](respondWithFilteredResult(_0x2174b1,_0x43e3a5))[_0xc548('0x43')](handleError(_0x2174b1,null));};exports['show']=function(_0x2b0b3a,_0x3baa30){var _0x30cd38={'raw':!![],'where':{'id':_0x2b0b3a['params']['id']}},_0x2d2311={};_0x2d2311[_0xc548('0x30')]=_[_0xc548('0x32')](db[_0xc548('0x3f')][_0xc548('0x2d')]);_0x2d2311[_0xc548('0x31')]=_[_0xc548('0x32')](_0x2b0b3a[_0xc548('0x31')]);_0x2d2311[_0xc548('0x33')]=_['intersection'](_0x2d2311[_0xc548('0x30')],_0x2d2311[_0xc548('0x31')]);_0x30cd38['attributes']=_[_0xc548('0x34')](_0x2d2311['model'],qs[_0xc548('0x35')](_0x2b0b3a[_0xc548('0x31')][_0xc548('0x35')]));_0x30cd38[_0xc548('0x36')]=_0x30cd38[_0xc548('0x36')][_0xc548('0x44')]?_0x30cd38[_0xc548('0x36')]:_0x2d2311[_0xc548('0x30')];if(_0x2b0b3a[_0xc548('0x31')]['includeAll']){_0x30cd38['include']=[{'all':!![]}];}_0x30cd38=_[_0xc548('0x3c')]({},_0x30cd38,_0x2b0b3a[_0xc548('0x45')]);return db[_0xc548('0x3f')][_0xc548('0x46')](_0x30cd38)[_0xc548('0x23')](handleEntityNotFound(_0x3baa30,null))[_0xc548('0x23')](respondWithResult(_0x3baa30,null))[_0xc548('0x43')](handleError(_0x3baa30,null));};exports[_0xc548('0x47')]=function(_0x2d6cbf,_0x3a34eb,_0x196b94){return db[_0xc548('0x3f')][_0xc548('0x46')]({'where':{'id':_0x2d6cbf['params']['id']},'attributes':[_0xc548('0x29'),_0xc548('0x48'),_0xc548('0x49')],'raw':!![]})[_0xc548('0x23')](handleEntityNotFound(_0x3a34eb,null))[_0xc548('0x23')](function(_0x2b2776){if(_0x2b2776){if(!fs[_0xc548('0x4a')](path['join'](config['root'],_0xc548('0x4b'),_0x2b2776[_0xc548('0x48')]+'.'+_0x2b2776[_0xc548('0x49')]))){throw new db['Sequelize'][(_0xc548('0x4c'))](_0xc548('0x4d'));}return _0x3a34eb[_0xc548('0x47')](path[_0xc548('0x4e')](config[_0xc548('0x4f')],_0xc548('0x4b'),util[_0xc548('0x50')](_0xc548('0x51'),_0x2b2776[_0xc548('0x48')],_0x2b2776['converted_format'])),util[_0xc548('0x50')](_0xc548('0x51'),_0x2b2776[_0xc548('0x29')],_0x2b2776[_0xc548('0x49')]));}return null;})[_0xc548('0x43')](handleError(_0x3a34eb,null));};exports['create']=function(_0x814762,_0x5aba6c,_0x5a9cbd){var _0x1ac366={'name':path[_0xc548('0x52')](_0x814762[_0xc548('0x53')][_0xc548('0x54')],path[_0xc548('0x55')](_0x814762[_0xc548('0x53')][_0xc548('0x54')])),'save_name':path[_0xc548('0x52')](_0x814762['file']['filename'],path[_0xc548('0x55')](_0x814762[_0xc548('0x53')][_0xc548('0x56')])),'original_format':path[_0xc548('0x55')](_0x814762[_0xc548('0x53')][_0xc548('0x54')])[_0xc548('0x57')](0x1),'converted_format':_0xc548('0x58')};var _0x4422b4=path[_0xc548('0x4e')](config['root'],_0xc548('0x59'),_0x814762[_0xc548('0x53')][_0xc548('0x56')]);var _0x471195=path[_0xc548('0x4e')](config['root'],'server/files/sounds/converted',util[_0xc548('0x50')](_0xc548('0x51'),path[_0xc548('0x52')](_0x814762[_0xc548('0x53')]['filename'],path[_0xc548('0x55')](_0x814762[_0xc548('0x53')][_0xc548('0x56')])),_0x1ac366['converted_format']));logger['info'](_0xc548('0x5a'),_0x4422b4);logger['info'](_0xc548('0x5b'),_0x471195);try{fs[_0xc548('0x5c')](_0x4422b4,parseInt(_0xc548('0x5d'),0x8));var _0x1b6546=sox[_0xc548('0x5e')](_0x4422b4,_0x471195,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b6546['on'](_0xc548('0x27'),function(_0x1fc5f0){fs[_0xc548('0x5f')](_0x4422b4);_0x5aba6c['status'](0x1f4)[_0xc548('0x2a')](_0x1fc5f0);});_0x1b6546['on'](_0xc548('0x60'),function(_0x5cb3df){_0x1ac366[_0xc548('0x61')]=isNaN(_0x5cb3df[_0xc548('0x62')])?null:_0x5cb3df['duration']*0x3e8;_0x1ac366[_0xc548('0x63')]=isNaN(_0x5cb3df[_0xc548('0x64')])?null:_0x5cb3df[_0xc548('0x64')];_0x1ac366[_0xc548('0x65')]=isNaN(_0x5cb3df['channelCount'])?null:_0x5cb3df[_0xc548('0x66')];_0x1ac366[_0xc548('0x67')]=isNaN(_0x5cb3df[_0xc548('0x68')])?null:_0x5cb3df[_0xc548('0x68')];_0x1ac366[_0xc548('0x69')]=isNaN(_0x5cb3df[_0xc548('0x6a')])?null:_0x5cb3df[_0xc548('0x6a')];});_0x1b6546['on'](_0xc548('0x6b'),function(_0x2b9017){_0x1ac366[_0xc548('0x6c')]=isNaN(_0x2b9017[_0xc548('0x62')])?null:_0x2b9017[_0xc548('0x62')]*0x3e8;_0x1ac366[_0xc548('0x6d')]=isNaN(_0x2b9017[_0xc548('0x64')])?null:_0x2b9017['sampleCount'];_0x1ac366['converted_channelCount']=isNaN(_0x2b9017[_0xc548('0x66')])?null:_0x2b9017['channelCount'];_0x1ac366['converted_bitRate']=isNaN(_0x2b9017[_0xc548('0x68')])?null:_0x2b9017['bitRate'];_0x1ac366[_0xc548('0x6e')]=isNaN(_0x2b9017['sampleRate'])?null:_0x2b9017['sampleRate'];});_0x1b6546['on'](_0xc548('0x1a'),function(){fs[_0xc548('0x5c')](_0x471195,parseInt(_0xc548('0x5d'),0x8));return db[_0xc548('0x3f')]['create'](_0x1ac366)[_0xc548('0x23')](function(_0xc612d5){var _0x2e5ab8={'role':_0x814762['body'][_0xc548('0x6f')],'userProfileId':_0x814762['body'][_0xc548('0x70')]};if(!_0x2e5ab8)throw new Error(_0xc548('0x71'));if(_0x2e5ab8[_0xc548('0x6f')]==='user'){var _0x9b84ba=_0xc612d5[_0xc548('0x25')]({'plain':!![]});return db['UserProfileSection'][_0xc548('0x46')]({'where':{'name':_0xc548('0x26'),'userProfileId':_0x2e5ab8[_0xc548('0x70')]},'raw':!![]})[_0xc548('0x23')](function(_0x5e5d19){if(_0x5e5d19&&_0x5e5d19[_0xc548('0x72')]===0x0){return db[_0xc548('0x73')][_0xc548('0x74')]({'name':_0x9b84ba['name'],'resourceId':_0x9b84ba['id'],'type':_0x5e5d19[_0xc548('0x29')],'sectionId':_0x5e5d19['id']},{})[_0xc548('0x23')](function(){return _0xc612d5;});}else{return _0xc612d5;}})[_0xc548('0x43')](function(_0x574e0d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x574e0d);throw _0x574e0d;});}return _0xc612d5;})[_0xc548('0x23')](respondWithResult(_0x5aba6c,null))['catch'](handleError(_0x5aba6c,null));});_0x1b6546[_0xc548('0x75')]();}catch(_0x1ff3ed){_0x5aba6c[_0xc548('0x19')](0x1f4)[_0xc548('0x2a')](_0x1ff3ed);}};exports[_0xc548('0x22')]=function(_0xf451e0,_0x36f43b,_0x54b372){return db[_0xc548('0x3f')][_0xc548('0x46')]({'where':{'id':_0xf451e0['params']['id']}})[_0xc548('0x23')](handleEntityNotFound(_0x36f43b,null))[_0xc548('0x23')](saveUpdates(_[_0xc548('0x3a')](_0xf451e0[_0xc548('0x76')],['name',_0xc548('0x77')]),null))['then'](respondWithResult(_0x36f43b,null))['catch'](handleError(_0x36f43b,null));};exports['delete']=function(_0x2472ac,_0x47e8cc,_0x25f94f){return db[_0xc548('0x3f')][_0xc548('0x46')]({'where':{'id':_0x2472ac[_0xc548('0x78')]['id']}})['then'](function(_0x1ad74b){if(_0x1ad74b){return _0x1ad74b[_0xc548('0x24')]();}})[_0xc548('0x23')](function(_0x45d384){var _0x3e0baf=path['join'](config[_0xc548('0x4f')],_0xc548('0x59'),util[_0xc548('0x50')](_0xc548('0x51'),_0x45d384[_0xc548('0x48')],_0x45d384[_0xc548('0x79')]));var _0x273031=path[_0xc548('0x4e')](config[_0xc548('0x4f')],'server/files/sounds/converted',util['format'](_0xc548('0x51'),_0x45d384['save_name'],_0x45d384[_0xc548('0x49')]));fs['unlinkSync'](_0x3e0baf);fs[_0xc548('0x5f')](_0x273031);return _0x45d384;})['then'](function(_0x13f15a){if(_0x13f15a){return _0x47e8cc['status'](0xcc)[_0xc548('0x1a')]();}})[_0xc548('0x23')](handleEntityNotFound(_0x47e8cc,null))['catch'](handleError(_0x47e8cc,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index ba6b1d1..946921b 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 _0x9f20=['moment','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','util','api'];(function(_0x4f53de,_0x424b5d){var _0x53f1d4=function(_0x5598b8){while(--_0x5598b8){_0x4f53de['push'](_0x4f53de['shift']());}};_0x53f1d4(++_0x424b5d);}(_0x9f20,0x1b7));var _0x09f2=function(_0x3af56f,_0x1e42b8){_0x3af56f=_0x3af56f-0x0;var _0x12054b=_0x9f20[_0x3af56f];return _0x12054b;};'use strict';var _=require('lodash');var util=require(_0x09f2('0x0'));var logger=require('../../config/logger')(_0x09f2('0x1'));var moment=require(_0x09f2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x09f2('0x3'));var config=require(_0x09f2('0x4'));var attributes=require(_0x09f2('0x5'));module[_0x09f2('0x6')]=function(_0x280d63,_0x6376dc){return _0x280d63[_0x09f2('0x7')](_0x09f2('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e43=['tools_sounds','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./sound.attributes','exports','define','Sound'];(function(_0x3e9b06,_0x417393){var _0x442af8=function(_0x4e7bbe){while(--_0x4e7bbe){_0x3e9b06['push'](_0x3e9b06['shift']());}};_0x442af8(++_0x417393);}(_0x3e43,0x1e1));var _0x33e4=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x3e43[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x33e4('0x0'));var util=require('util');var logger=require(_0x33e4('0x1'))(_0x33e4('0x2'));var moment=require(_0x33e4('0x3'));var BPromise=require(_0x33e4('0x4'));var rp=require(_0x33e4('0x5'));var fs=require('fs');var path=require(_0x33e4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x33e4('0x7'));module[_0x33e4('0x8')]=function(_0x33444b,_0x15bf24){return _0x33444b[_0x33e4('0x9')](_0x33e4('0xa'),attributes,{'tableName':_0x33e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index f2927f4..6120870 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 _0x319e=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Sound','options','raw','where','attributes','include','model','map','ShowSound','util'];(function(_0x3433a0,_0x707c8c){var _0x428cb7=function(_0xaf2f6c){while(--_0xaf2f6c){_0x3433a0['push'](_0x3433a0['shift']());}};_0x428cb7(++_0x707c8c);}(_0x319e,0x6f));var _0xe319=function(_0xcaf791,_0x42ba63){_0xcaf791=_0xcaf791-0x0;var _0x17b827=_0x319e[_0xcaf791];return _0x17b827;};'use strict';var _=require('lodash');var util=require(_0xe319('0x0'));var moment=require('moment');var BPromise=require(_0xe319('0x1'));var rs=require(_0xe319('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe319('0x3'))['db'];var utils=require(_0xe319('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe319('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe319('0x6')][_0xe319('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a5382,_0x15dcdb,_0x50f9a7){return new BPromise(function(_0x1f14bf,_0x211852){return client['request'](_0x1a5382,_0x50f9a7)[_0xe319('0x8')](function(_0x23efdd){logger[_0xe319('0x9')](_0xe319('0xa'),_0x15dcdb,_0xe319('0xb'));logger[_0xe319('0xc')](_0xe319('0xd'),_0x15dcdb,'request\x20sent',JSON[_0xe319('0xe')](_0x23efdd));if(_0x23efdd['error']){if(_0x23efdd[_0xe319('0xf')][_0xe319('0x10')]===0x1f4){logger['error'](_0xe319('0xa'),_0x15dcdb,_0x23efdd[_0xe319('0xf')]['message']);return _0x211852(_0x23efdd['error']['message']);}logger[_0xe319('0xf')]('Sound,\x20%s,\x20%s',_0x15dcdb,_0x23efdd[_0xe319('0xf')][_0xe319('0x11')]);return _0x1f14bf(_0x23efdd[_0xe319('0xf')][_0xe319('0x11')]);}else{logger['info'](_0xe319('0xa'),_0x15dcdb,'request\x20sent');_0x1f14bf(_0x23efdd['result'][_0xe319('0x11')]);}})[_0xe319('0x12')](function(_0x3b3735){logger['error'](_0xe319('0xa'),_0x15dcdb,_0x3b3735);_0x211852(_0x3b3735);});});}exports['ShowSound']=function(_0x9ad6c2){var _0x43708e=this;return new Promise(function(_0x14fabf,_0x83a3f7){return db[_0xe319('0x13')]['find']({'raw':_0x9ad6c2[_0xe319('0x14')]?_0x9ad6c2[_0xe319('0x14')][_0xe319('0x15')]===undefined?!![]:![]:!![],'where':_0x9ad6c2[_0xe319('0x14')]?_0x9ad6c2['options'][_0xe319('0x16')]||null:null,'attributes':_0x9ad6c2[_0xe319('0x14')]?_0x9ad6c2['options'][_0xe319('0x17')]||null:null,'include':_0x9ad6c2[_0xe319('0x14')]?_0x9ad6c2[_0xe319('0x14')][_0xe319('0x18')]?_['map'](_0x9ad6c2['options'][_0xe319('0x18')],function(_0x1baa9e){return{'model':db[_0x1baa9e[_0xe319('0x19')]],'as':_0x1baa9e['as'],'attributes':_0x1baa9e['attributes'],'include':_0x1baa9e[_0xe319('0x18')]?_[_0xe319('0x1a')](_0x1baa9e[_0xe319('0x18')],function(_0x51678e){return{'model':db[_0x51678e['model']],'as':_0x51678e['as'],'attributes':_0x51678e[_0xe319('0x17')],'include':_0x51678e['include']?_[_0xe319('0x1a')](_0x51678e['include'],function(_0x3f2c70){return{'model':db[_0x3f2c70['model']],'as':_0x3f2c70['as'],'attributes':_0x3f2c70['attributes']};}):[]};}):[]};}):[]:[]})[_0xe319('0x8')](function(_0x2f4110){logger[_0xe319('0x9')](_0xe319('0x1b'),_0x9ad6c2);logger[_0xe319('0xc')](_0xe319('0x1b'),_0x9ad6c2,JSON[_0xe319('0xe')](_0x2f4110));_0x14fabf(_0x2f4110);})[_0xe319('0x12')](function(_0x1f9d5f){logger[_0xe319('0xf')](_0xe319('0x1b'),_0x1f9d5f[_0xe319('0x11')],_0x9ad6c2);_0x83a3f7(_0x43708e[_0xe319('0xf')](0x1f4,_0x1f9d5f[_0xe319('0x11')]));});});}; \ No newline at end of file +var _0x4abb=['code','message','result','catch','ShowSound','Sound','raw','options','include','map','attributes','model','then','debug','stringify','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x306f4e,_0x303fde){var _0x4424a7=function(_0x2a091e){while(--_0x2a091e){_0x306f4e['push'](_0x306f4e['shift']());}};_0x4424a7(++_0x303fde);}(_0x4abb,0x102));var _0xb4ab=function(_0xb7bd15,_0x415a4a){_0xb7bd15=_0xb7bd15-0x0;var _0x283051=_0x4abb[_0xb7bd15];return _0x283051;};'use strict';var _=require(_0xb4ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4ab('0x1'));var db=require(_0xb4ab('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4ab('0x3'))('rpc');var config=require(_0xb4ab('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb4ab('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x313534,_0x580938,_0x20a9f5){return new BPromise(function(_0x4b1173,_0xbc3b2c){return client[_0xb4ab('0x6')](_0x313534,_0x20a9f5)['then'](function(_0x2cb527){logger[_0xb4ab('0x7')](_0xb4ab('0x8'),_0x580938,'request\x20sent');logger['debug'](_0xb4ab('0x9'),_0x580938,_0xb4ab('0xa'),JSON['stringify'](_0x2cb527));if(_0x2cb527['error']){if(_0x2cb527[_0xb4ab('0xb')][_0xb4ab('0xc')]===0x1f4){logger[_0xb4ab('0xb')](_0xb4ab('0x8'),_0x580938,_0x2cb527[_0xb4ab('0xb')][_0xb4ab('0xd')]);return _0xbc3b2c(_0x2cb527[_0xb4ab('0xb')]['message']);}logger[_0xb4ab('0xb')](_0xb4ab('0x8'),_0x580938,_0x2cb527[_0xb4ab('0xb')]['message']);return _0x4b1173(_0x2cb527[_0xb4ab('0xb')][_0xb4ab('0xd')]);}else{logger[_0xb4ab('0x7')](_0xb4ab('0x8'),_0x580938,_0xb4ab('0xa'));_0x4b1173(_0x2cb527[_0xb4ab('0xe')][_0xb4ab('0xd')]);}})[_0xb4ab('0xf')](function(_0x263097){logger[_0xb4ab('0xb')](_0xb4ab('0x8'),_0x580938,_0x263097);_0xbc3b2c(_0x263097);});});}exports[_0xb4ab('0x10')]=function(_0x2dc528){var _0x216f92=this;return new Promise(function(_0x565ffa,_0x3627d5){return db[_0xb4ab('0x11')]['find']({'raw':_0x2dc528['options']?_0x2dc528['options'][_0xb4ab('0x12')]===undefined?!![]:![]:!![],'where':_0x2dc528['options']?_0x2dc528[_0xb4ab('0x13')]['where']||null:null,'attributes':_0x2dc528['options']?_0x2dc528[_0xb4ab('0x13')]['attributes']||null:null,'include':_0x2dc528[_0xb4ab('0x13')]?_0x2dc528[_0xb4ab('0x13')][_0xb4ab('0x14')]?_[_0xb4ab('0x15')](_0x2dc528['options'][_0xb4ab('0x14')],function(_0x469b55){return{'model':db[_0x469b55['model']],'as':_0x469b55['as'],'attributes':_0x469b55[_0xb4ab('0x16')],'include':_0x469b55[_0xb4ab('0x14')]?_[_0xb4ab('0x15')](_0x469b55['include'],function(_0xd9eefc){return{'model':db[_0xd9eefc[_0xb4ab('0x17')]],'as':_0xd9eefc['as'],'attributes':_0xd9eefc[_0xb4ab('0x16')],'include':_0xd9eefc[_0xb4ab('0x14')]?_['map'](_0xd9eefc[_0xb4ab('0x14')],function(_0x179cb1){return{'model':db[_0x179cb1[_0xb4ab('0x17')]],'as':_0x179cb1['as'],'attributes':_0x179cb1['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4ab('0x18')](function(_0x14e351){logger['info'](_0xb4ab('0x10'),_0x2dc528);logger[_0xb4ab('0x19')](_0xb4ab('0x10'),_0x2dc528,JSON[_0xb4ab('0x1a')](_0x14e351));_0x565ffa(_0x14e351);})[_0xb4ab('0xf')](function(_0x45aeff){logger[_0xb4ab('0xb')]('ShowSound',_0x45aeff[_0xb4ab('0xd')],_0x2dc528);_0x3627d5(_0x216f92[_0xb4ab('0xb')](0x1f4,_0x45aeff[_0xb4ab('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d493e6b..5a8bb91 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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0x8603,0x190));var _0x3860=function(_0x360206,_0x7c26ef){_0x360206=_0x360206-0x0;var _0x48eaad=_0x8603[_0x360206];return _0x48eaad;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x47e712,_0x5837d8){var _0x51c70e=function(_0x572c18){while(--_0x572c18){_0x47e712['push'](_0x47e712['shift']());}};_0x51c70e(++_0x5837d8);}(_0x5eb8,0xb0));var _0x85eb=function(_0x437b02,_0x34b630){_0x437b02=_0x437b02-0x0;var _0xf8c681=_0x5eb8[_0x437b02];return _0xf8c681;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e9c8930..b3bc4ea 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 _0x6883=['STRING','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x6883,0xef));var _0x3688=function(_0x16b5ed,_0x3e56c8){_0x16b5ed=_0x16b5ed-0x0;var _0x592d69=_0x6883[_0x16b5ed];return _0x592d69;};'use strict';var Sequelize=require(_0x3688('0x0'));module[_0x3688('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3688('0x2')](_0x3688('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x3688('0x4')]('in','out'),'defaultValue':_0x3688('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3688('0x6')]},'providerResponse':{'type':Sequelize[_0x3688('0x2')]}}; \ No newline at end of file +var _0x9871=['medium','out','TEXT','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9871,0x12a));var _0x1987=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x9871[_0x1b70e3];return _0x1452ab;};'use strict';var Sequelize=require('sequelize');module[_0x1987('0x0')]={'uniqueid':{'type':Sequelize[_0x1987('0x1')]},'body':{'type':Sequelize['TEXT'](_0x1987('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1987('0x3')),'defaultValue':_0x1987('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x1987('0x1')]},'providerResponse':{'type':Sequelize[_0x1987('0x4')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 42c97c8..71c7598 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 _0x4138=['mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareMessage','includeAll','include','findAll','rows','catch','show','find','create','body','params','zip-dir','request-promise','moment','bluebird'];(function(_0x29a09d,_0x28594a){var _0x34a673=function(_0x20b5c5){while(--_0x20b5c5){_0x29a09d['push'](_0x29a09d['shift']());}};_0x34a673(++_0x28594a);}(_0x4138,0xce));var _0x8413=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x4138[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8413('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8413('0x1'));var moment=require(_0x8413('0x2'));var BPromise=require(_0x8413('0x3'));var Mustache=require(_0x8413('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8413('0x5'));var ejs=require(_0x8413('0x6'));var fs=require('fs');var fs_extra=require(_0x8413('0x7'));var _=require('lodash');var squel=require(_0x8413('0x8'));var crypto=require(_0x8413('0x9'));var jsforce=require(_0x8413('0xa'));var deskjs=require(_0x8413('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8413('0xc'));var Papa=require(_0x8413('0xd'));var Redis=require('ioredis');var authService=require(_0x8413('0xe'));var qs=require(_0x8413('0xf'));var as=require(_0x8413('0x10'));var hardwareService=require(_0x8413('0x11'));var logger=require(_0x8413('0x12'))('api');var utils=require(_0x8413('0x13'));var config=require(_0x8413('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8413('0x15'))['db'];function respondWithStatusCode(_0xf10f14,_0x44a506){_0x44a506=_0x44a506||0xcc;return function(_0x447d44){if(_0x447d44){return _0xf10f14[_0x8413('0x16')](_0x44a506);}return _0xf10f14[_0x8413('0x17')](_0x44a506)[_0x8413('0x18')]();};}function respondWithResult(_0x3320c8,_0xff64dc){_0xff64dc=_0xff64dc||0xc8;return function(_0x163176){if(_0x163176){return _0x3320c8['status'](_0xff64dc)[_0x8413('0x19')](_0x163176);}};}function respondWithFilteredResult(_0x3b0256,_0x72ff42){return function(_0x39f0ff){if(_0x39f0ff){var _0x285db0=typeof _0x72ff42[_0x8413('0x1a')]==='undefined'&&typeof _0x72ff42[_0x8413('0x1b')]===_0x8413('0x1c');var _0x581bc8=_0x39f0ff[_0x8413('0x1d')];var _0x506a41=_0x285db0?0x0:_0x72ff42[_0x8413('0x1a')];var _0x4b47a2=_0x285db0?_0x39f0ff[_0x8413('0x1d')]:_0x72ff42[_0x8413('0x1a')]+_0x72ff42[_0x8413('0x1b')];var _0x312bb7;if(_0x4b47a2>=_0x581bc8){_0x4b47a2=_0x581bc8;_0x312bb7=0xc8;}else{_0x312bb7=0xce;}_0x3b0256[_0x8413('0x17')](_0x312bb7);return _0x3b0256[_0x8413('0x1e')]('Content-Range',_0x506a41+'-'+_0x4b47a2+'/'+_0x581bc8)['json'](_0x39f0ff);}return null;};}function patchUpdates(_0x9ea2d3){return function(_0x29e318){try{jsonpatch[_0x8413('0x1f')](_0x29e318,_0x9ea2d3,!![]);}catch(_0x5a5645){return BPromise[_0x8413('0x20')](_0x5a5645);}return _0x29e318['save']();};}function saveUpdates(_0x33f9c4,_0x108f17){return function(_0x11587c){if(_0x11587c){return _0x11587c[_0x8413('0x21')](_0x33f9c4)[_0x8413('0x22')](function(_0x3953c8){return _0x3953c8;});}return null;};}function removeEntity(_0x45cf4b,_0x352fea){return function(_0x2c57ff){if(_0x2c57ff){return _0x2c57ff['destroy']()['then'](function(){_0x45cf4b[_0x8413('0x17')](0xcc)[_0x8413('0x18')]();});}};}function handleEntityNotFound(_0x57c3df,_0x400cee){return function(_0x3b421e){if(!_0x3b421e){_0x57c3df[_0x8413('0x16')](0x194);}return _0x3b421e;};}function handleError(_0x49ddb8,_0x17a08f){_0x17a08f=_0x17a08f||0x1f4;return function(_0x1d6d1){logger['error'](_0x1d6d1[_0x8413('0x23')]);if(_0x1d6d1[_0x8413('0x24')]){delete _0x1d6d1[_0x8413('0x24')];}_0x49ddb8[_0x8413('0x17')](_0x17a08f)['send'](_0x1d6d1);};}exports['index']=function(_0x19513b,_0x5b4cb3){var _0x173d42={},_0x19cc20={},_0x2ba2fc={'count':0x0,'rows':[]};var _0x15c274=_[_0x8413('0x25')](db['SquareMessage'][_0x8413('0x26')],function(_0x32bcb2){return{'name':_0x32bcb2['fieldName'],'type':_0x32bcb2[_0x8413('0x27')][_0x8413('0x28')]};});_0x19cc20[_0x8413('0x29')]=_['map'](_0x15c274,_0x8413('0x24'));_0x19cc20[_0x8413('0x2a')]=_[_0x8413('0x2b')](_0x19513b[_0x8413('0x2a')]);_0x19cc20[_0x8413('0x2c')]=_[_0x8413('0x2d')](_0x19cc20['model'],_0x19cc20[_0x8413('0x2a')]);_0x173d42[_0x8413('0x2e')]=_[_0x8413('0x2d')](_0x19cc20['model'],qs[_0x8413('0x2f')](_0x19513b[_0x8413('0x2a')]['fields']));_0x173d42[_0x8413('0x2e')]=_0x173d42['attributes'][_0x8413('0x30')]?_0x173d42[_0x8413('0x2e')]:_0x19cc20[_0x8413('0x29')];if(!_0x19513b[_0x8413('0x2a')][_0x8413('0x31')](_0x8413('0x32'))){_0x173d42[_0x8413('0x1b')]=qs['limit'](_0x19513b[_0x8413('0x2a')][_0x8413('0x1b')]);_0x173d42[_0x8413('0x1a')]=qs['offset'](_0x19513b[_0x8413('0x2a')]['offset']);}_0x173d42[_0x8413('0x33')]=qs[_0x8413('0x34')](_0x19513b[_0x8413('0x2a')]['sort']);_0x173d42[_0x8413('0x35')]=qs[_0x8413('0x2c')](_[_0x8413('0x36')](_0x19513b['query'],_0x19cc20[_0x8413('0x2c')]),_0x15c274);if(_0x19513b['query']['filter']){_0x173d42[_0x8413('0x35')]=_[_0x8413('0x37')](_0x173d42[_0x8413('0x35')],{'$or':_['map'](_0x15c274,function(_0x39f110){if(_0x39f110[_0x8413('0x27')]!==_0x8413('0x38')){var _0x244529={};_0x244529[_0x39f110['name']]={'$like':'%'+_0x19513b[_0x8413('0x2a')][_0x8413('0x39')]+'%'};return _0x244529;}})});}_0x173d42=_['merge']({},_0x173d42,_0x19513b[_0x8413('0x3a')]);var _0x145d2f={'where':_0x173d42['where']};return db[_0x8413('0x3b')][_0x8413('0x1d')](_0x145d2f)[_0x8413('0x22')](function(_0x3abc31){_0x2ba2fc[_0x8413('0x1d')]=_0x3abc31;if(_0x19513b[_0x8413('0x2a')][_0x8413('0x3c')]){_0x173d42[_0x8413('0x3d')]=[{'all':!![]}];}return db[_0x8413('0x3b')][_0x8413('0x3e')](_0x173d42);})[_0x8413('0x22')](function(_0x4b56a4){_0x2ba2fc[_0x8413('0x3f')]=_0x4b56a4;return _0x2ba2fc;})[_0x8413('0x22')](respondWithFilteredResult(_0x5b4cb3,_0x173d42))[_0x8413('0x40')](handleError(_0x5b4cb3,null));};exports[_0x8413('0x41')]=function(_0x4b19d2,_0x4ae845){var _0x481a2f={'raw':!![],'where':{'id':_0x4b19d2['params']['id']}},_0xdc1ed8={};_0xdc1ed8[_0x8413('0x29')]=_['keys'](db['SquareMessage']['rawAttributes']);_0xdc1ed8['query']=_[_0x8413('0x2b')](_0x4b19d2[_0x8413('0x2a')]);_0xdc1ed8['filters']=_[_0x8413('0x2d')](_0xdc1ed8[_0x8413('0x29')],_0xdc1ed8[_0x8413('0x2a')]);_0x481a2f[_0x8413('0x2e')]=_[_0x8413('0x2d')](_0xdc1ed8[_0x8413('0x29')],qs[_0x8413('0x2f')](_0x4b19d2[_0x8413('0x2a')][_0x8413('0x2f')]));_0x481a2f[_0x8413('0x2e')]=_0x481a2f[_0x8413('0x2e')][_0x8413('0x30')]?_0x481a2f[_0x8413('0x2e')]:_0xdc1ed8[_0x8413('0x29')];if(_0x4b19d2[_0x8413('0x2a')][_0x8413('0x3c')]){_0x481a2f['include']=[{'all':!![]}];}_0x481a2f=_[_0x8413('0x37')]({},_0x481a2f,_0x4b19d2[_0x8413('0x3a')]);return db[_0x8413('0x3b')][_0x8413('0x42')](_0x481a2f)[_0x8413('0x22')](handleEntityNotFound(_0x4ae845,null))[_0x8413('0x22')](respondWithResult(_0x4ae845,null))[_0x8413('0x40')](handleError(_0x4ae845,null));};exports[_0x8413('0x43')]=function(_0x3d4c34,_0x10dd4a){return db['SquareMessage']['create'](_0x3d4c34[_0x8413('0x44')],{})[_0x8413('0x22')](respondWithResult(_0x10dd4a,0xc9))['catch'](handleError(_0x10dd4a,null));};exports[_0x8413('0x21')]=function(_0x330819,_0x3ca352){if(_0x330819['body']['id']){delete _0x330819[_0x8413('0x44')]['id'];}return db[_0x8413('0x3b')][_0x8413('0x42')]({'where':{'id':_0x330819[_0x8413('0x45')]['id']}})[_0x8413('0x22')](handleEntityNotFound(_0x3ca352,null))[_0x8413('0x22')](saveUpdates(_0x330819[_0x8413('0x44')],null))[_0x8413('0x22')](respondWithResult(_0x3ca352,null))[_0x8413('0x40')](handleError(_0x3ca352,null));};exports['destroy']=function(_0x34a008,_0x10a3c1){return db[_0x8413('0x3b')][_0x8413('0x42')]({'where':{'id':_0x34a008[_0x8413('0x45')]['id']}})[_0x8413('0x22')](handleEntityNotFound(_0x10a3c1,null))[_0x8413('0x22')](removeEntity(_0x10a3c1,null))[_0x8413('0x40')](handleError(_0x10a3c1,null));}; \ No newline at end of file +var _0x8ed7=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','update','body','rimraf','zip-dir','fast-json-patch'];(function(_0x10eb6b,_0x3fe155){var _0x3a3ab1=function(_0x467f24){while(--_0x467f24){_0x10eb6b['push'](_0x10eb6b['shift']());}};_0x3a3ab1(++_0x3fe155);}(_0x8ed7,0x8b));var _0x78ed=function(_0x5d14a7,_0x2be4cc){_0x5d14a7=_0x5d14a7-0x0;var _0x44e3e3=_0x8ed7[_0x5d14a7];return _0x44e3e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78ed('0x0'));var zipdir=require(_0x78ed('0x1'));var jsonpatch=require(_0x78ed('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x78ed('0x3'));var Mustache=require(_0x78ed('0x4'));var util=require(_0x78ed('0x5'));var path=require(_0x78ed('0x6'));var sox=require(_0x78ed('0x7'));var csv=require(_0x78ed('0x8'));var ejs=require(_0x78ed('0x9'));var fs=require('fs');var fs_extra=require(_0x78ed('0xa'));var _=require(_0x78ed('0xb'));var squel=require('squel');var crypto=require(_0x78ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x78ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x78ed('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78ed('0xf'));var qs=require(_0x78ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ed('0x11'));var logger=require(_0x78ed('0x12'))('api');var utils=require(_0x78ed('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x78ed('0x14'));var db=require(_0x78ed('0x15'))['db'];function respondWithStatusCode(_0x3ec02d,_0x2cb17b){_0x2cb17b=_0x2cb17b||0xcc;return function(_0x1a5254){if(_0x1a5254){return _0x3ec02d[_0x78ed('0x16')](_0x2cb17b);}return _0x3ec02d['status'](_0x2cb17b)[_0x78ed('0x17')]();};}function respondWithResult(_0x4b97ba,_0x538306){_0x538306=_0x538306||0xc8;return function(_0x510322){if(_0x510322){return _0x4b97ba['status'](_0x538306)['json'](_0x510322);}};}function respondWithFilteredResult(_0x2e88ad,_0x272171){return function(_0x2e9007){if(_0x2e9007){var _0x195b7e=typeof _0x272171[_0x78ed('0x18')]===_0x78ed('0x19')&&typeof _0x272171[_0x78ed('0x1a')]===_0x78ed('0x19');var _0x17d0d6=_0x2e9007[_0x78ed('0x1b')];var _0x2dd98c=_0x195b7e?0x0:_0x272171['offset'];var _0x2f442b=_0x195b7e?_0x2e9007[_0x78ed('0x1b')]:_0x272171['offset']+_0x272171['limit'];var _0x2868d1;if(_0x2f442b>=_0x17d0d6){_0x2f442b=_0x17d0d6;_0x2868d1=0xc8;}else{_0x2868d1=0xce;}_0x2e88ad[_0x78ed('0x1c')](_0x2868d1);return _0x2e88ad[_0x78ed('0x1d')](_0x78ed('0x1e'),_0x2dd98c+'-'+_0x2f442b+'/'+_0x17d0d6)[_0x78ed('0x1f')](_0x2e9007);}return null;};}function patchUpdates(_0x3bd736){return function(_0x3479ec){try{jsonpatch[_0x78ed('0x20')](_0x3479ec,_0x3bd736,!![]);}catch(_0x376076){return BPromise[_0x78ed('0x21')](_0x376076);}return _0x3479ec[_0x78ed('0x22')]();};}function saveUpdates(_0x4f1edb,_0x5ee188){return function(_0x425310){if(_0x425310){return _0x425310['update'](_0x4f1edb)[_0x78ed('0x23')](function(_0x55f0e8){return _0x55f0e8;});}return null;};}function removeEntity(_0x4675d3,_0x590d90){return function(_0x2af200){if(_0x2af200){return _0x2af200[_0x78ed('0x24')]()[_0x78ed('0x23')](function(){_0x4675d3['status'](0xcc)[_0x78ed('0x17')]();});}};}function handleEntityNotFound(_0x5a8b87,_0x137c7c){return function(_0x2a4573){if(!_0x2a4573){_0x5a8b87[_0x78ed('0x16')](0x194);}return _0x2a4573;};}function handleError(_0x59349a,_0x5abe1b){_0x5abe1b=_0x5abe1b||0x1f4;return function(_0x464050){logger['error'](_0x464050[_0x78ed('0x25')]);if(_0x464050['name']){delete _0x464050[_0x78ed('0x26')];}_0x59349a[_0x78ed('0x1c')](_0x5abe1b)[_0x78ed('0x27')](_0x464050);};}exports[_0x78ed('0x28')]=function(_0xafc1cf,_0x624bb1){var _0x3cd100={},_0x312801={},_0x10ea7d={'count':0x0,'rows':[]};var _0x4f6cdd=_[_0x78ed('0x29')](db[_0x78ed('0x2a')][_0x78ed('0x2b')],function(_0x1afab4){return{'name':_0x1afab4['fieldName'],'type':_0x1afab4['type']['key']};});_0x312801['model']=_[_0x78ed('0x29')](_0x4f6cdd,_0x78ed('0x26'));_0x312801[_0x78ed('0x2c')]=_[_0x78ed('0x2d')](_0xafc1cf[_0x78ed('0x2c')]);_0x312801[_0x78ed('0x2e')]=_[_0x78ed('0x2f')](_0x312801['model'],_0x312801[_0x78ed('0x2c')]);_0x3cd100['attributes']=_[_0x78ed('0x2f')](_0x312801[_0x78ed('0x30')],qs['fields'](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x31')]));_0x3cd100[_0x78ed('0x32')]=_0x3cd100[_0x78ed('0x32')][_0x78ed('0x33')]?_0x3cd100[_0x78ed('0x32')]:_0x312801[_0x78ed('0x30')];if(!_0xafc1cf[_0x78ed('0x2c')]['hasOwnProperty'](_0x78ed('0x34'))){_0x3cd100['limit']=qs[_0x78ed('0x1a')](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x1a')]);_0x3cd100[_0x78ed('0x18')]=qs[_0x78ed('0x18')](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x18')]);}_0x3cd100['order']=qs[_0x78ed('0x35')](_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x35')]);_0x3cd100[_0x78ed('0x36')]=qs[_0x78ed('0x2e')](_[_0x78ed('0x37')](_0xafc1cf[_0x78ed('0x2c')],_0x312801[_0x78ed('0x2e')]),_0x4f6cdd);if(_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x38')]){_0x3cd100[_0x78ed('0x36')]=_['merge'](_0x3cd100['where'],{'$or':_[_0x78ed('0x29')](_0x4f6cdd,function(_0x4a7506){if(_0x4a7506[_0x78ed('0x39')]!==_0x78ed('0x3a')){var _0x4edc9c={};_0x4edc9c[_0x4a7506[_0x78ed('0x26')]]={'$like':'%'+_0xafc1cf[_0x78ed('0x2c')][_0x78ed('0x38')]+'%'};return _0x4edc9c;}})});}_0x3cd100=_[_0x78ed('0x3b')]({},_0x3cd100,_0xafc1cf[_0x78ed('0x3c')]);var _0x37c26d={'where':_0x3cd100['where']};return db[_0x78ed('0x2a')][_0x78ed('0x1b')](_0x37c26d)[_0x78ed('0x23')](function(_0x2323de){_0x10ea7d['count']=_0x2323de;if(_0xafc1cf['query'][_0x78ed('0x3d')]){_0x3cd100[_0x78ed('0x3e')]=[{'all':!![]}];}return db['SquareMessage'][_0x78ed('0x3f')](_0x3cd100);})[_0x78ed('0x23')](function(_0x48629a){_0x10ea7d['rows']=_0x48629a;return _0x10ea7d;})[_0x78ed('0x23')](respondWithFilteredResult(_0x624bb1,_0x3cd100))[_0x78ed('0x40')](handleError(_0x624bb1,null));};exports[_0x78ed('0x41')]=function(_0x37e5de,_0x58177d){var _0x5c42fe={'raw':!![],'where':{'id':_0x37e5de[_0x78ed('0x42')]['id']}},_0x4ebdd6={};_0x4ebdd6['model']=_[_0x78ed('0x2d')](db['SquareMessage'][_0x78ed('0x2b')]);_0x4ebdd6[_0x78ed('0x2c')]=_[_0x78ed('0x2d')](_0x37e5de[_0x78ed('0x2c')]);_0x4ebdd6[_0x78ed('0x2e')]=_['intersection'](_0x4ebdd6[_0x78ed('0x30')],_0x4ebdd6[_0x78ed('0x2c')]);_0x5c42fe[_0x78ed('0x32')]=_[_0x78ed('0x2f')](_0x4ebdd6[_0x78ed('0x30')],qs['fields'](_0x37e5de['query'][_0x78ed('0x31')]));_0x5c42fe[_0x78ed('0x32')]=_0x5c42fe[_0x78ed('0x32')][_0x78ed('0x33')]?_0x5c42fe['attributes']:_0x4ebdd6[_0x78ed('0x30')];if(_0x37e5de[_0x78ed('0x2c')][_0x78ed('0x3d')]){_0x5c42fe[_0x78ed('0x3e')]=[{'all':!![]}];}_0x5c42fe=_[_0x78ed('0x3b')]({},_0x5c42fe,_0x37e5de[_0x78ed('0x3c')]);return db['SquareMessage'][_0x78ed('0x43')](_0x5c42fe)['then'](handleEntityNotFound(_0x58177d,null))[_0x78ed('0x23')](respondWithResult(_0x58177d,null))['catch'](handleError(_0x58177d,null));};exports[_0x78ed('0x44')]=function(_0x2a164e,_0x1020d9){return db[_0x78ed('0x2a')][_0x78ed('0x44')](_0x2a164e['body'],{})['then'](respondWithResult(_0x1020d9,0xc9))[_0x78ed('0x40')](handleError(_0x1020d9,null));};exports[_0x78ed('0x45')]=function(_0x39da99,_0x4c68f1){if(_0x39da99[_0x78ed('0x46')]['id']){delete _0x39da99[_0x78ed('0x46')]['id'];}return db[_0x78ed('0x2a')]['find']({'where':{'id':_0x39da99['params']['id']}})[_0x78ed('0x23')](handleEntityNotFound(_0x4c68f1,null))['then'](saveUpdates(_0x39da99[_0x78ed('0x46')],null))[_0x78ed('0x23')](respondWithResult(_0x4c68f1,null))['catch'](handleError(_0x4c68f1,null));};exports['destroy']=function(_0xd8fb3d,_0x192061){return db[_0x78ed('0x2a')][_0x78ed('0x43')]({'where':{'id':_0xd8fb3d[_0x78ed('0x42')]['id']}})[_0x78ed('0x23')](handleEntityNotFound(_0x192061,null))[_0x78ed('0x23')](removeEntity(_0x192061,null))[_0x78ed('0x40')](handleError(_0x192061,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 56f51e5..eb3b7f9 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 _0xd64e=['../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xd64e,0x102));var _0xed64=function(_0x4a882e,_0xcfdddc){_0x4a882e=_0x4a882e-0x0;var _0x33828e=_0xd64e[_0x4a882e];return _0x33828e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed64('0x0'))(_0xed64('0x1'));var moment=require(_0xed64('0x2'));var BPromise=require('bluebird');var rp=require(_0xed64('0x3'));var fs=require('fs');var path=require(_0xed64('0x4'));var rimraf=require(_0xed64('0x5'));var config=require(_0xed64('0x6'));var attributes=require(_0xed64('0x7'));module[_0xed64('0x8')]=function(_0x5953f8,_0x33b11c){return _0x5953f8[_0xed64('0x9')](_0xed64('0xa'),attributes,{'tableName':_0xed64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc24b=['./squareMessage.attributes','exports','define','square_messages','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xc24b,0x117));var _0xbc24=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xc24b[_0x1f7413];return _0x2d2775;};'use strict';var _=require(_0xbc24('0x0'));var util=require('util');var logger=require(_0xbc24('0x1'))(_0xbc24('0x2'));var moment=require('moment');var BPromise=require(_0xbc24('0x3'));var rp=require(_0xbc24('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc24('0x5'));var config=require(_0xbc24('0x6'));var attributes=require(_0xbc24('0x7'));module[_0xbc24('0x8')]=function(_0x6b3289,_0x53efd7){return _0x6b3289[_0xbc24('0x9')]('SquareMessage',attributes,{'tableName':_0xbc24('0xa'),'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 c277e3f..18029a8 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 _0x951b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','create','body','options','raw','debug','lodash','util','moment','bluebird'];(function(_0x3b06b9,_0x8a869d){var _0x21be7d=function(_0x517c43){while(--_0x517c43){_0x3b06b9['push'](_0x3b06b9['shift']());}};_0x21be7d(++_0x8a869d);}(_0x951b,0x100));var _0xb951=function(_0x1e8066,_0x28eb15){_0x1e8066=_0x1e8066-0x0;var _0x378b27=_0x951b[_0x1e8066];return _0x378b27;};'use strict';var _=require(_0xb951('0x0'));var util=require(_0xb951('0x1'));var moment=require(_0xb951('0x2'));var BPromise=require(_0xb951('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb951('0x4'));var logger=require(_0xb951('0x5'))(_0xb951('0x6'));var config=require('../../config/environment');var jayson=require(_0xb951('0x7'));var client=jayson[_0xb951('0x8')][_0xb951('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x487c23,_0x26e862,_0x41ebd3){return new BPromise(function(_0x3a8f91,_0x89acd7){return client[_0xb951('0xa')](_0x487c23,_0x41ebd3)[_0xb951('0xb')](function(_0x450017){logger[_0xb951('0xc')]('SquareMessage,\x20%s,\x20%s',_0x26e862,_0xb951('0xd'));logger['debug'](_0xb951('0xe'),_0x26e862,_0xb951('0xd'),JSON['stringify'](_0x450017));if(_0x450017['error']){if(_0x450017[_0xb951('0xf')][_0xb951('0x10')]===0x1f4){logger['error'](_0xb951('0x11'),_0x26e862,_0x450017[_0xb951('0xf')][_0xb951('0x12')]);return _0x89acd7(_0x450017['error'][_0xb951('0x12')]);}logger[_0xb951('0xf')](_0xb951('0x11'),_0x26e862,_0x450017[_0xb951('0xf')][_0xb951('0x12')]);return _0x3a8f91(_0x450017[_0xb951('0xf')][_0xb951('0x12')]);}else{logger[_0xb951('0xc')](_0xb951('0x11'),_0x26e862,'request\x20sent');_0x3a8f91(_0x450017[_0xb951('0x13')][_0xb951('0x12')]);}})['catch'](function(_0x3f232c){logger['error'](_0xb951('0x11'),_0x26e862,_0x3f232c);_0x89acd7(_0x3f232c);});});}exports[_0xb951('0x14')]=function(_0x456615){var _0x173f6c=this;return new Promise(function(_0x5cb94d,_0x175895){return db['SquareMessage'][_0xb951('0x15')](_0x456615[_0xb951('0x16')],{'raw':_0x456615['options']?_0x456615[_0xb951('0x17')][_0xb951('0x18')]===undefined?!![]:![]:!![]})[_0xb951('0xb')](function(_0x2df88a){logger['info']('CreateSquareMessage',_0x456615);logger[_0xb951('0x19')]('CreateSquareMessage',_0x456615,JSON['stringify'](_0x2df88a));_0x5cb94d(_0x2df88a);})['catch'](function(_0xeb291){logger[_0xb951('0xf')]('CreateSquareMessage',_0xeb291[_0xb951('0x12')],_0x456615);_0x175895(_0x173f6c['error'](0x1f4,_0xeb291[_0xb951('0x12')]));});});}; \ No newline at end of file +var _0xfba0=['rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','CreateSquareMessage','SquareMessage','create','body','options','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xfba0,0x1aa));var _0x0fba=function(_0x3bafca,_0x1002fe){_0x3bafca=_0x3bafca-0x0;var _0x521996=_0xfba0[_0x3bafca];return _0x521996;};'use strict';var _=require(_0x0fba('0x0'));var util=require(_0x0fba('0x1'));var moment=require(_0x0fba('0x2'));var BPromise=require(_0x0fba('0x3'));var rs=require(_0x0fba('0x4'));var fs=require('fs');var Redis=require(_0x0fba('0x5'));var db=require(_0x0fba('0x6'))['db'];var utils=require(_0x0fba('0x7'));var logger=require(_0x0fba('0x8'))(_0x0fba('0x9'));var config=require(_0x0fba('0xa'));var jayson=require(_0x0fba('0xb'));var client=jayson[_0x0fba('0xc')][_0x0fba('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2a7324,_0x4a1675,_0xcd56b){return new BPromise(function(_0x2b04ff,_0x5b33fb){return client[_0x0fba('0xe')](_0x2a7324,_0xcd56b)['then'](function(_0x37a828){logger[_0x0fba('0xf')](_0x0fba('0x10'),_0x4a1675,_0x0fba('0x11'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4a1675,'request\x20sent',JSON[_0x0fba('0x12')](_0x37a828));if(_0x37a828[_0x0fba('0x13')]){if(_0x37a828[_0x0fba('0x13')]['code']===0x1f4){logger[_0x0fba('0x13')]('SquareMessage,\x20%s,\x20%s',_0x4a1675,_0x37a828[_0x0fba('0x13')]['message']);return _0x5b33fb(_0x37a828[_0x0fba('0x13')]['message']);}logger[_0x0fba('0x13')](_0x0fba('0x10'),_0x4a1675,_0x37a828[_0x0fba('0x13')]['message']);return _0x2b04ff(_0x37a828[_0x0fba('0x13')]['message']);}else{logger[_0x0fba('0xf')]('SquareMessage,\x20%s,\x20%s',_0x4a1675,_0x0fba('0x11'));_0x2b04ff(_0x37a828[_0x0fba('0x14')][_0x0fba('0x15')]);}})['catch'](function(_0x12f78a){logger['error']('SquareMessage,\x20%s,\x20%s',_0x4a1675,_0x12f78a);_0x5b33fb(_0x12f78a);});});}exports[_0x0fba('0x16')]=function(_0x1b3448){var _0x20bd59=this;return new Promise(function(_0x19c374,_0x2d6f72){return db[_0x0fba('0x17')][_0x0fba('0x18')](_0x1b3448[_0x0fba('0x19')],{'raw':_0x1b3448['options']?_0x1b3448[_0x0fba('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0fba('0x1b')](function(_0x4ced9f){logger[_0x0fba('0xf')](_0x0fba('0x16'),_0x1b3448);logger[_0x0fba('0x1c')](_0x0fba('0x16'),_0x1b3448,JSON[_0x0fba('0x12')](_0x4ced9f));_0x19c374(_0x4ced9f);})['catch'](function(_0x1296c9){logger[_0x0fba('0x13')](_0x0fba('0x16'),_0x1296c9[_0x0fba('0x15')],_0x1b3448);_0x2d6f72(_0x20bd59[_0x0fba('0x13')](0x1f4,_0x1296c9[_0x0fba('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 7db933d..c5b1269 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 _0x9700=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','15s','test','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout'];(function(_0x165c96,_0x2269de){var _0x5c2420=function(_0x4e9a1e){while(--_0x4e9a1e){_0x165c96['push'](_0x165c96['shift']());}};_0x5c2420(++_0x2269de);}(_0x9700,0xec));var _0x0970=function(_0x48cbe9,_0x3e51be){_0x48cbe9=_0x48cbe9-0x0;var _0x3391bd=_0x9700[_0x48cbe9];return _0x3391bd;};'use strict';var multer=require(_0x0970('0x0'));var util=require(_0x0970('0x1'));var path=require(_0x0970('0x2'));var timeout=require(_0x0970('0x3'));var express=require(_0x0970('0x4'));var router=express['Router']();var fs_extra=require(_0x0970('0x5'));var auth=require(_0x0970('0x6'));var interaction=require(_0x0970('0x7'));var config=require('../../config/environment');var controller=require(_0x0970('0x8'));router[_0x0970('0x9')]('/',auth[_0x0970('0xa')](),controller[_0x0970('0xb')]);router[_0x0970('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0970('0x9')]('/:id/test',auth[_0x0970('0xa')](),timeout(_0x0970('0xc')),controller[_0x0970('0xd')]);router[_0x0970('0xe')]('/',auth[_0x0970('0xa')](),controller[_0x0970('0xf')]);router[_0x0970('0x10')](_0x0970('0x11'),auth[_0x0970('0xa')](),controller['update']);router[_0x0970('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0970('0x13')]);module['exports']=router; \ No newline at end of file +var _0xaaea=['create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post'];(function(_0x49fd8a,_0x3c5706){var _0x4ceed8=function(_0x1954c6){while(--_0x1954c6){_0x49fd8a['push'](_0x49fd8a['shift']());}};_0x4ceed8(++_0x3c5706);}(_0xaaea,0x14f));var _0xaaae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaaea[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xaaae('0x0'));var util=require(_0xaaae('0x1'));var path=require('path');var timeout=require(_0xaaae('0x2'));var express=require('express');var router=express[_0xaaae('0x3')]();var fs_extra=require(_0xaaae('0x4'));var auth=require(_0xaaae('0x5'));var interaction=require(_0xaaae('0x6'));var config=require(_0xaaae('0x7'));var controller=require(_0xaaae('0x8'));router[_0xaaae('0x9')]('/',auth[_0xaaae('0xa')](),controller[_0xaaae('0xb')]);router[_0xaaae('0x9')](_0xaaae('0xc'),auth[_0xaaae('0xa')](),controller['show']);router[_0xaaae('0x9')](_0xaaae('0xd'),auth[_0xaaae('0xa')](),timeout(_0xaaae('0xe')),controller[_0xaaae('0xf')]);router[_0xaaae('0x10')]('/',auth[_0xaaae('0xa')](),controller[_0xaaae('0x11')]);router['put'](_0xaaae('0xc'),auth[_0xaaae('0xa')](),controller[_0xaaae('0x12')]);router[_0xaaae('0x13')](_0xaaae('0xc'),auth[_0xaaae('0xa')](),controller[_0xaaae('0x14')]);module[_0xaaae('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 51fa1bf..f801f96 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 _0x7347=['STRING','exports'];(function(_0x23c85e,_0x55bde3){var _0x28f4ee=function(_0x22d691){while(--_0x22d691){_0x23c85e['push'](_0x23c85e['shift']());}};_0x28f4ee(++_0x55bde3);}(_0x7347,0x95));var _0x7734=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x7347[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require('sequelize');module[_0x7734('0x0')]={'name':{'type':Sequelize[_0x7734('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x7734('0x1')]},'description':{'type':Sequelize[_0x7734('0x1')]}}; \ No newline at end of file +var _0x8ab8=['exports','STRING','name','sequelize'];(function(_0x45b4f8,_0x1b2bd8){var _0x232e11=function(_0x325c42){while(--_0x325c42){_0x45b4f8['push'](_0x45b4f8['shift']());}};_0x232e11(++_0x1b2bd8);}(_0x8ab8,0x1a3));var _0x88ab=function(_0x383785,_0x32a8ee){_0x383785=_0x383785-0x0;var _0x493027=_0x8ab8[_0x383785];return _0x493027;};'use strict';var Sequelize=require(_0x88ab('0x0'));module[_0x88ab('0x1')]={'name':{'type':Sequelize[_0x88ab('0x2')],'unique':_0x88ab('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x88ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 4a9d063..cc071fd 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 _0x4cf1=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','ODBC','error','stack','name','send','index','map','SquareOdbc','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','odbc','openSync','closeSync','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xf27523,_0x45ae76){var _0x94da21=function(_0x1ef64c){while(--_0x1ef64c){_0xf27523['push'](_0xf27523['shift']());}};_0x94da21(++_0x45ae76);}(_0x4cf1,0xf6));var _0x14cf=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4cf1[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14cf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14cf('0x1'));var moment=require(_0x14cf('0x2'));var BPromise=require(_0x14cf('0x3'));var Mustache=require('mustache');var util=require(_0x14cf('0x4'));var path=require('path');var sox=require(_0x14cf('0x5'));var csv=require(_0x14cf('0x6'));var ejs=require(_0x14cf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14cf('0x8'));var squel=require(_0x14cf('0x9'));var crypto=require(_0x14cf('0xa'));var jsforce=require(_0x14cf('0xb'));var deskjs=require(_0x14cf('0xc'));var toCsv=require(_0x14cf('0x6'));var querystring=require(_0x14cf('0xd'));var Papa=require(_0x14cf('0xe'));var Redis=require(_0x14cf('0xf'));var authService=require(_0x14cf('0x10'));var qs=require(_0x14cf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14cf('0x12'));var logger=require(_0x14cf('0x13'))(_0x14cf('0x14'));var utils=require(_0x14cf('0x15'));var config=require(_0x14cf('0x16'));var licenseUtil=require(_0x14cf('0x17'));var db=require(_0x14cf('0x18'))['db'];function respondWithStatusCode(_0xe79a7a,_0x5f0cc7){_0x5f0cc7=_0x5f0cc7||0xcc;return function(_0x3626f9){if(_0x3626f9){return _0xe79a7a[_0x14cf('0x19')](_0x5f0cc7);}return _0xe79a7a[_0x14cf('0x1a')](_0x5f0cc7)[_0x14cf('0x1b')]();};}function respondWithResult(_0x169632,_0x42c005){_0x42c005=_0x42c005||0xc8;return function(_0x103b4f){if(_0x103b4f){return _0x169632[_0x14cf('0x1a')](_0x42c005)['json'](_0x103b4f);}};}function respondWithFilteredResult(_0x1826bb,_0x179414){return function(_0x1c226b){if(_0x1c226b){var _0xb446e3=typeof _0x179414[_0x14cf('0x1c')]===_0x14cf('0x1d')&&typeof _0x179414['limit']==='undefined';var _0x2f8ae2=_0x1c226b[_0x14cf('0x1e')];var _0x51c926=_0xb446e3?0x0:_0x179414['offset'];var _0x319507=_0xb446e3?_0x1c226b['count']:_0x179414[_0x14cf('0x1c')]+_0x179414[_0x14cf('0x1f')];var _0xa63d27;if(_0x319507>=_0x2f8ae2){_0x319507=_0x2f8ae2;_0xa63d27=0xc8;}else{_0xa63d27=0xce;}_0x1826bb[_0x14cf('0x1a')](_0xa63d27);return _0x1826bb[_0x14cf('0x20')](_0x14cf('0x21'),_0x51c926+'-'+_0x319507+'/'+_0x2f8ae2)[_0x14cf('0x22')](_0x1c226b);}return null;};}function patchUpdates(_0x20dc18){return function(_0x1321ee){try{jsonpatch[_0x14cf('0x23')](_0x1321ee,_0x20dc18,!![]);}catch(_0x4bf57d){return BPromise[_0x14cf('0x24')](_0x4bf57d);}return _0x1321ee[_0x14cf('0x25')]();};}function saveUpdates(_0x4289fe,_0x14a7ec){return function(_0x1bb1d4){if(_0x1bb1d4){return _0x1bb1d4[_0x14cf('0x26')](_0x4289fe)[_0x14cf('0x27')](function(_0x1be55f){return _0x1be55f;});}return null;};}function removeEntity(_0x148cba,_0x33c715){return function(_0x39135f){if(_0x39135f){return _0x39135f[_0x14cf('0x28')]()[_0x14cf('0x27')](function(){var _0x4ee8d7=_0x39135f['get']({'plain':!![]});var _0x84a727=_0x14cf('0x29');return db['UserProfileResource'][_0x14cf('0x28')]({'where':{'type':_0x84a727,'resourceId':_0x4ee8d7['id']}})[_0x14cf('0x27')](function(){return _0x39135f;});})['then'](function(){_0x148cba[_0x14cf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41fad3,_0x516e7b){return function(_0x26d363){if(!_0x26d363){_0x41fad3['sendStatus'](0x194);}return _0x26d363;};}function handleError(_0x49a9ca,_0x28fbc4){_0x28fbc4=_0x28fbc4||0x1f4;return function(_0x51fda3){logger[_0x14cf('0x2a')](_0x51fda3[_0x14cf('0x2b')]);if(_0x51fda3['name']){delete _0x51fda3[_0x14cf('0x2c')];}_0x49a9ca[_0x14cf('0x1a')](_0x28fbc4)[_0x14cf('0x2d')](_0x51fda3);};}exports[_0x14cf('0x2e')]=function(_0x239028,_0x2d5c6e){var _0x5de6d3={},_0x307234={},_0x42f5ad={'count':0x0,'rows':[]};var _0xfd28f1=_[_0x14cf('0x2f')](db[_0x14cf('0x30')]['rawAttributes'],function(_0x2fa606){return{'name':_0x2fa606['fieldName'],'type':_0x2fa606['type'][_0x14cf('0x31')]};});_0x307234[_0x14cf('0x32')]=_[_0x14cf('0x2f')](_0xfd28f1,'name');_0x307234['query']=_[_0x14cf('0x33')](_0x239028['query']);_0x307234[_0x14cf('0x34')]=_[_0x14cf('0x35')](_0x307234[_0x14cf('0x32')],_0x307234[_0x14cf('0x36')]);_0x5de6d3[_0x14cf('0x37')]=_[_0x14cf('0x35')](_0x307234[_0x14cf('0x32')],qs[_0x14cf('0x38')](_0x239028['query'][_0x14cf('0x38')]));_0x5de6d3[_0x14cf('0x37')]=_0x5de6d3[_0x14cf('0x37')][_0x14cf('0x39')]?_0x5de6d3[_0x14cf('0x37')]:_0x307234[_0x14cf('0x32')];if(!_0x239028['query'][_0x14cf('0x3a')](_0x14cf('0x3b'))){_0x5de6d3[_0x14cf('0x1f')]=qs['limit'](_0x239028['query'][_0x14cf('0x1f')]);_0x5de6d3[_0x14cf('0x1c')]=qs[_0x14cf('0x1c')](_0x239028[_0x14cf('0x36')][_0x14cf('0x1c')]);}_0x5de6d3[_0x14cf('0x3c')]=qs[_0x14cf('0x3d')](_0x239028[_0x14cf('0x36')]['sort']);_0x5de6d3[_0x14cf('0x3e')]=qs[_0x14cf('0x34')](_[_0x14cf('0x3f')](_0x239028[_0x14cf('0x36')],_0x307234[_0x14cf('0x34')]),_0xfd28f1);if(_0x239028[_0x14cf('0x36')]['filter']){_0x5de6d3[_0x14cf('0x3e')]=_[_0x14cf('0x40')](_0x5de6d3[_0x14cf('0x3e')],{'$or':_[_0x14cf('0x2f')](_0xfd28f1,function(_0x10c121){if(_0x10c121[_0x14cf('0x41')]!==_0x14cf('0x42')){var _0x34ddb4={};_0x34ddb4[_0x10c121[_0x14cf('0x2c')]]={'$like':'%'+_0x239028['query'][_0x14cf('0x43')]+'%'};return _0x34ddb4;}})});}_0x5de6d3=_[_0x14cf('0x40')]({},_0x5de6d3,_0x239028[_0x14cf('0x44')]);var _0x42846e={'where':_0x5de6d3[_0x14cf('0x3e')]};return db[_0x14cf('0x30')][_0x14cf('0x1e')](_0x42846e)[_0x14cf('0x27')](function(_0x4f0231){_0x42f5ad[_0x14cf('0x1e')]=_0x4f0231;if(_0x239028[_0x14cf('0x36')][_0x14cf('0x45')]){_0x5de6d3[_0x14cf('0x46')]=[{'all':!![]}];}return db['SquareOdbc'][_0x14cf('0x47')](_0x5de6d3);})[_0x14cf('0x27')](function(_0x3fcad2){_0x42f5ad[_0x14cf('0x48')]=_0x3fcad2;return _0x42f5ad;})[_0x14cf('0x27')](respondWithFilteredResult(_0x2d5c6e,_0x5de6d3))[_0x14cf('0x49')](handleError(_0x2d5c6e,null));};exports['show']=function(_0x1fe1be,_0x4cd7a5){var _0x3aed0f={'raw':!![],'where':{'id':_0x1fe1be[_0x14cf('0x4a')]['id']}},_0x231d39={};_0x231d39['model']=_[_0x14cf('0x33')](db['SquareOdbc'][_0x14cf('0x4b')]);_0x231d39[_0x14cf('0x36')]=_[_0x14cf('0x33')](_0x1fe1be[_0x14cf('0x36')]);_0x231d39['filters']=_['intersection'](_0x231d39[_0x14cf('0x32')],_0x231d39['query']);_0x3aed0f[_0x14cf('0x37')]=_['intersection'](_0x231d39[_0x14cf('0x32')],qs[_0x14cf('0x38')](_0x1fe1be['query']['fields']));_0x3aed0f['attributes']=_0x3aed0f[_0x14cf('0x37')][_0x14cf('0x39')]?_0x3aed0f[_0x14cf('0x37')]:_0x231d39[_0x14cf('0x32')];if(_0x1fe1be[_0x14cf('0x36')]['includeAll']){_0x3aed0f['include']=[{'all':!![]}];}_0x3aed0f=_[_0x14cf('0x40')]({},_0x3aed0f,_0x1fe1be[_0x14cf('0x44')]);return db[_0x14cf('0x30')][_0x14cf('0x4c')](_0x3aed0f)['then'](handleEntityNotFound(_0x4cd7a5,null))[_0x14cf('0x27')](respondWithResult(_0x4cd7a5,null))[_0x14cf('0x49')](handleError(_0x4cd7a5,null));};exports[_0x14cf('0x4d')]=function(_0xf5dd53,_0x153744){return db['SquareOdbc']['create'](_0xf5dd53[_0x14cf('0x4e')],{})['then'](function(_0x31eacf){var _0xf98ee4=_0xf5dd53['user'][_0x14cf('0x4f')]({'plain':!![]});if(!_0xf98ee4)throw new Error(_0x14cf('0x50'));if(_0xf98ee4[_0x14cf('0x51')]===_0x14cf('0x52')){var _0x5f198e=_0x31eacf['get']({'plain':!![]});var _0x2ba06c=_0x14cf('0x29');return db[_0x14cf('0x53')][_0x14cf('0x4c')]({'where':{'name':_0x2ba06c,'userProfileId':_0xf98ee4['userProfileId']},'raw':!![]})[_0x14cf('0x27')](function(_0x39fb42){if(_0x39fb42&&_0x39fb42['autoAssociation']===0x0){return db[_0x14cf('0x54')][_0x14cf('0x4d')]({'name':_0x5f198e['name'],'resourceId':_0x5f198e['id'],'type':_0x39fb42[_0x14cf('0x2c')],'sectionId':_0x39fb42['id']},{})[_0x14cf('0x27')](function(){return _0x31eacf;});}else{return _0x31eacf;}})[_0x14cf('0x49')](function(_0x41fbad){logger[_0x14cf('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41fbad);throw _0x41fbad;});}return _0x31eacf;})[_0x14cf('0x27')](respondWithResult(_0x153744,0xc9))[_0x14cf('0x49')](handleError(_0x153744,null));};exports[_0x14cf('0x26')]=function(_0x163acd,_0x40313a){if(_0x163acd['body']['id']){delete _0x163acd['body']['id'];}return db[_0x14cf('0x30')][_0x14cf('0x4c')]({'where':{'id':_0x163acd[_0x14cf('0x4a')]['id']}})[_0x14cf('0x27')](handleEntityNotFound(_0x40313a,null))['then'](saveUpdates(_0x163acd[_0x14cf('0x4e')],null))['then'](respondWithResult(_0x40313a,null))[_0x14cf('0x49')](handleError(_0x40313a,null));};exports['destroy']=function(_0x534acf,_0x51dbf3){return db[_0x14cf('0x30')][_0x14cf('0x4c')]({'where':{'id':_0x534acf[_0x14cf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51dbf3,null))['then'](removeEntity(_0x51dbf3,null))[_0x14cf('0x49')](handleError(_0x51dbf3,null));};exports['test']=function(_0x59f349,_0x2bd565,_0x44d1ae){var _0x4d7dc2;return db[_0x14cf('0x30')][_0x14cf('0x4c')]({'where':{'id':_0x59f349[_0x14cf('0x4a')]['id']},'attributes':['id','dsn']})[_0x14cf('0x27')](handleEntityNotFound(_0x2bd565,null))['then'](function(_0x3300ec){if(_0x3300ec){var _0x4faea1=require(_0x14cf('0x55'))();_0x4faea1[_0x14cf('0x56')](_0x3300ec['dsn']);_0x4faea1[_0x14cf('0x57')]();return _0x3300ec;}})[_0x14cf('0x27')](respondWithResult(_0x2bd565,null))[_0x14cf('0x49')](handleError(_0x2bd565,null));}; \ No newline at end of file +var _0xa63b=['order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','end','error','stack','name','index','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xa63b,0xc0));var _0xba63=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa63b[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0xba63('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba63('0x1'));var rp=require(_0xba63('0x2'));var moment=require(_0xba63('0x3'));var BPromise=require(_0xba63('0x4'));var Mustache=require('mustache');var util=require(_0xba63('0x5'));var path=require('path');var sox=require(_0xba63('0x6'));var csv=require(_0xba63('0x7'));var ejs=require(_0xba63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba63('0x9'));var squel=require('squel');var crypto=require(_0xba63('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xba63('0xb'));var toCsv=require(_0xba63('0x7'));var querystring=require(_0xba63('0xc'));var Papa=require(_0xba63('0xd'));var Redis=require(_0xba63('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xba63('0xf'));var as=require(_0xba63('0x10'));var hardwareService=require(_0xba63('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xba63('0x12'));var config=require(_0xba63('0x13'));var licenseUtil=require(_0xba63('0x14'));var db=require(_0xba63('0x15'))['db'];function respondWithStatusCode(_0x336af4,_0x2de97c){_0x2de97c=_0x2de97c||0xcc;return function(_0x4a4048){if(_0x4a4048){return _0x336af4[_0xba63('0x16')](_0x2de97c);}return _0x336af4[_0xba63('0x17')](_0x2de97c)['end']();};}function respondWithResult(_0x256ef4,_0x32d563){_0x32d563=_0x32d563||0xc8;return function(_0x3867c4){if(_0x3867c4){return _0x256ef4[_0xba63('0x17')](_0x32d563)[_0xba63('0x18')](_0x3867c4);}};}function respondWithFilteredResult(_0x535d36,_0x32689e){return function(_0x4faa55){if(_0x4faa55){var _0x535ca4=typeof _0x32689e[_0xba63('0x19')]===_0xba63('0x1a')&&typeof _0x32689e['limit']===_0xba63('0x1a');var _0x4a6367=_0x4faa55[_0xba63('0x1b')];var _0x4d8ea7=_0x535ca4?0x0:_0x32689e[_0xba63('0x19')];var _0x3ba928=_0x535ca4?_0x4faa55[_0xba63('0x1b')]:_0x32689e[_0xba63('0x19')]+_0x32689e[_0xba63('0x1c')];var _0x472ca8;if(_0x3ba928>=_0x4a6367){_0x3ba928=_0x4a6367;_0x472ca8=0xc8;}else{_0x472ca8=0xce;}_0x535d36[_0xba63('0x17')](_0x472ca8);return _0x535d36[_0xba63('0x1d')]('Content-Range',_0x4d8ea7+'-'+_0x3ba928+'/'+_0x4a6367)['json'](_0x4faa55);}return null;};}function patchUpdates(_0x6ccf84){return function(_0x49289a){try{jsonpatch[_0xba63('0x1e')](_0x49289a,_0x6ccf84,!![]);}catch(_0xb066cf){return BPromise[_0xba63('0x1f')](_0xb066cf);}return _0x49289a[_0xba63('0x20')]();};}function saveUpdates(_0x1c1799,_0x168bc0){return function(_0x323612){if(_0x323612){return _0x323612['update'](_0x1c1799)[_0xba63('0x21')](function(_0x52dc69){return _0x52dc69;});}return null;};}function removeEntity(_0x1e88b8,_0x27890f){return function(_0x136ec6){if(_0x136ec6){return _0x136ec6[_0xba63('0x22')]()[_0xba63('0x21')](function(){var _0x269ab4=_0x136ec6[_0xba63('0x23')]({'plain':!![]});var _0x2001d0=_0xba63('0x24');return db[_0xba63('0x25')][_0xba63('0x22')]({'where':{'type':_0x2001d0,'resourceId':_0x269ab4['id']}})[_0xba63('0x21')](function(){return _0x136ec6;});})['then'](function(){_0x1e88b8['status'](0xcc)[_0xba63('0x26')]();});}};}function handleEntityNotFound(_0x36ff0d,_0x5a4b95){return function(_0x5759f1){if(!_0x5759f1){_0x36ff0d[_0xba63('0x16')](0x194);}return _0x5759f1;};}function handleError(_0x1cb493,_0x36e278){_0x36e278=_0x36e278||0x1f4;return function(_0x5a41c9){logger[_0xba63('0x27')](_0x5a41c9[_0xba63('0x28')]);if(_0x5a41c9[_0xba63('0x29')]){delete _0x5a41c9[_0xba63('0x29')];}_0x1cb493[_0xba63('0x17')](_0x36e278)['send'](_0x5a41c9);};}exports[_0xba63('0x2a')]=function(_0x259422,_0xd13b97){var _0x1e609d={},_0x30cdb5={},_0x2f3673={'count':0x0,'rows':[]};var _0x4b2b23=_['map'](db[_0xba63('0x2b')][_0xba63('0x2c')],function(_0x4ff66a){return{'name':_0x4ff66a[_0xba63('0x2d')],'type':_0x4ff66a[_0xba63('0x2e')][_0xba63('0x2f')]};});_0x30cdb5['model']=_['map'](_0x4b2b23,'name');_0x30cdb5[_0xba63('0x30')]=_[_0xba63('0x31')](_0x259422[_0xba63('0x30')]);_0x30cdb5[_0xba63('0x32')]=_[_0xba63('0x33')](_0x30cdb5['model'],_0x30cdb5[_0xba63('0x30')]);_0x1e609d[_0xba63('0x34')]=_[_0xba63('0x33')](_0x30cdb5[_0xba63('0x35')],qs[_0xba63('0x36')](_0x259422[_0xba63('0x30')][_0xba63('0x36')]));_0x1e609d[_0xba63('0x34')]=_0x1e609d[_0xba63('0x34')]['length']?_0x1e609d[_0xba63('0x34')]:_0x30cdb5[_0xba63('0x35')];if(!_0x259422['query'][_0xba63('0x37')](_0xba63('0x38'))){_0x1e609d[_0xba63('0x1c')]=qs['limit'](_0x259422['query']['limit']);_0x1e609d[_0xba63('0x19')]=qs['offset'](_0x259422[_0xba63('0x30')][_0xba63('0x19')]);}_0x1e609d[_0xba63('0x39')]=qs[_0xba63('0x3a')](_0x259422[_0xba63('0x30')][_0xba63('0x3a')]);_0x1e609d[_0xba63('0x3b')]=qs[_0xba63('0x32')](_[_0xba63('0x3c')](_0x259422[_0xba63('0x30')],_0x30cdb5[_0xba63('0x32')]),_0x4b2b23);if(_0x259422[_0xba63('0x30')]['filter']){_0x1e609d[_0xba63('0x3b')]=_['merge'](_0x1e609d['where'],{'$or':_[_0xba63('0x3d')](_0x4b2b23,function(_0x1f9e2e){if(_0x1f9e2e[_0xba63('0x2e')]!=='VIRTUAL'){var _0x4487a0={};_0x4487a0[_0x1f9e2e[_0xba63('0x29')]]={'$like':'%'+_0x259422[_0xba63('0x30')][_0xba63('0x3e')]+'%'};return _0x4487a0;}})});}_0x1e609d=_[_0xba63('0x3f')]({},_0x1e609d,_0x259422[_0xba63('0x40')]);var _0x546b0c={'where':_0x1e609d[_0xba63('0x3b')]};return db[_0xba63('0x2b')][_0xba63('0x1b')](_0x546b0c)[_0xba63('0x21')](function(_0x1edf6e){_0x2f3673[_0xba63('0x1b')]=_0x1edf6e;if(_0x259422[_0xba63('0x30')][_0xba63('0x41')]){_0x1e609d[_0xba63('0x42')]=[{'all':!![]}];}return db[_0xba63('0x2b')][_0xba63('0x43')](_0x1e609d);})[_0xba63('0x21')](function(_0x17080f){_0x2f3673['rows']=_0x17080f;return _0x2f3673;})[_0xba63('0x21')](respondWithFilteredResult(_0xd13b97,_0x1e609d))[_0xba63('0x44')](handleError(_0xd13b97,null));};exports[_0xba63('0x45')]=function(_0x2f7686,_0x3ad642){var _0x4fa0f4={'raw':!![],'where':{'id':_0x2f7686[_0xba63('0x46')]['id']}},_0x4da032={};_0x4da032[_0xba63('0x35')]=_['keys'](db[_0xba63('0x2b')][_0xba63('0x2c')]);_0x4da032['query']=_['keys'](_0x2f7686[_0xba63('0x30')]);_0x4da032[_0xba63('0x32')]=_[_0xba63('0x33')](_0x4da032[_0xba63('0x35')],_0x4da032[_0xba63('0x30')]);_0x4fa0f4[_0xba63('0x34')]=_['intersection'](_0x4da032[_0xba63('0x35')],qs[_0xba63('0x36')](_0x2f7686['query'][_0xba63('0x36')]));_0x4fa0f4[_0xba63('0x34')]=_0x4fa0f4[_0xba63('0x34')]['length']?_0x4fa0f4[_0xba63('0x34')]:_0x4da032[_0xba63('0x35')];if(_0x2f7686[_0xba63('0x30')]['includeAll']){_0x4fa0f4[_0xba63('0x42')]=[{'all':!![]}];}_0x4fa0f4=_[_0xba63('0x3f')]({},_0x4fa0f4,_0x2f7686[_0xba63('0x40')]);return db[_0xba63('0x2b')][_0xba63('0x47')](_0x4fa0f4)[_0xba63('0x21')](handleEntityNotFound(_0x3ad642,null))[_0xba63('0x21')](respondWithResult(_0x3ad642,null))['catch'](handleError(_0x3ad642,null));};exports[_0xba63('0x48')]=function(_0x59fe67,_0x5441a3){return db[_0xba63('0x2b')][_0xba63('0x48')](_0x59fe67['body'],{})[_0xba63('0x21')](function(_0x59524f){var _0x58403d=_0x59fe67[_0xba63('0x49')][_0xba63('0x23')]({'plain':!![]});if(!_0x58403d)throw new Error(_0xba63('0x4a'));if(_0x58403d['role']==='user'){var _0x309161=_0x59524f[_0xba63('0x23')]({'plain':!![]});var _0x185086=_0xba63('0x24');return db[_0xba63('0x4b')][_0xba63('0x47')]({'where':{'name':_0x185086,'userProfileId':_0x58403d[_0xba63('0x4c')]},'raw':!![]})[_0xba63('0x21')](function(_0x249c43){if(_0x249c43&&_0x249c43[_0xba63('0x4d')]===0x0){return db[_0xba63('0x25')][_0xba63('0x48')]({'name':_0x309161[_0xba63('0x29')],'resourceId':_0x309161['id'],'type':_0x249c43[_0xba63('0x29')],'sectionId':_0x249c43['id']},{})[_0xba63('0x21')](function(){return _0x59524f;});}else{return _0x59524f;}})[_0xba63('0x44')](function(_0x5bbeca){logger['error'](_0xba63('0x4e'),_0x5bbeca);throw _0x5bbeca;});}return _0x59524f;})[_0xba63('0x21')](respondWithResult(_0x5441a3,0xc9))[_0xba63('0x44')](handleError(_0x5441a3,null));};exports[_0xba63('0x4f')]=function(_0x3c14e5,_0x2a23e0){if(_0x3c14e5[_0xba63('0x50')]['id']){delete _0x3c14e5[_0xba63('0x50')]['id'];}return db[_0xba63('0x2b')][_0xba63('0x47')]({'where':{'id':_0x3c14e5[_0xba63('0x46')]['id']}})[_0xba63('0x21')](handleEntityNotFound(_0x2a23e0,null))['then'](saveUpdates(_0x3c14e5[_0xba63('0x50')],null))[_0xba63('0x21')](respondWithResult(_0x2a23e0,null))[_0xba63('0x44')](handleError(_0x2a23e0,null));};exports[_0xba63('0x22')]=function(_0x5ec9b2,_0x66f480){return db['SquareOdbc']['find']({'where':{'id':_0x5ec9b2[_0xba63('0x46')]['id']}})['then'](handleEntityNotFound(_0x66f480,null))[_0xba63('0x21')](removeEntity(_0x66f480,null))[_0xba63('0x44')](handleError(_0x66f480,null));};exports[_0xba63('0x51')]=function(_0x5b3599,_0x50a7c5,_0x378246){var _0x1e2ce3;return db[_0xba63('0x2b')][_0xba63('0x47')]({'where':{'id':_0x5b3599[_0xba63('0x46')]['id']},'attributes':['id',_0xba63('0x52')]})[_0xba63('0x21')](handleEntityNotFound(_0x50a7c5,null))[_0xba63('0x21')](function(_0x284784){if(_0x284784){var _0x3f66f3=require('odbc')();_0x3f66f3['openSync'](_0x284784[_0xba63('0x52')]);_0x3f66f3['closeSync']();return _0x284784;}})[_0xba63('0x21')](respondWithResult(_0x50a7c5,null))[_0xba63('0x44')](handleError(_0x50a7c5,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index cb35f13..e55c234 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 _0x26a2=['api','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','util'];(function(_0xe5faad,_0x14a954){var _0x4a2ce9=function(_0x5b54bc){while(--_0x5b54bc){_0xe5faad['push'](_0xe5faad['shift']());}};_0x4a2ce9(++_0x14a954);}(_0x26a2,0x6b));var _0x226a=function(_0x7610ec,_0x48bf8d){_0x7610ec=_0x7610ec-0x0;var _0x566f34=_0x26a2[_0x7610ec];return _0x566f34;};'use strict';var _=require('lodash');var util=require(_0x226a('0x0'));var logger=require('../../config/logger')(_0x226a('0x1'));var moment=require('moment');var BPromise=require(_0x226a('0x2'));var rp=require(_0x226a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x226a('0x4'));var config=require(_0x226a('0x5'));var attributes=require(_0x226a('0x6'));module['exports']=function(_0x1b5d2c,_0xe10b09){return _0x1b5d2c['define'](_0x226a('0x7'),attributes,{'tableName':_0x226a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65f7=['util','api','request-promise','path','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc'];(function(_0x4bce01,_0x13a6b9){var _0x29306f=function(_0x558625){while(--_0x558625){_0x4bce01['push'](_0x4bce01['shift']());}};_0x29306f(++_0x13a6b9);}(_0x65f7,0x186));var _0x765f=function(_0x3b0f4f,_0x148d43){_0x3b0f4f=_0x3b0f4f-0x0;var _0x13c6bf=_0x65f7[_0x3b0f4f];return _0x13c6bf;};'use strict';var _=require('lodash');var util=require(_0x765f('0x0'));var logger=require('../../config/logger')(_0x765f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x765f('0x2'));var fs=require('fs');var path=require(_0x765f('0x3'));var rimraf=require(_0x765f('0x4'));var config=require(_0x765f('0x5'));var attributes=require('./squareOdbc.attributes');module[_0x765f('0x6')]=function(_0x5982df,_0x408237){return _0x5982df[_0x765f('0x7')](_0x765f('0x8'),attributes,{'tableName':_0x765f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index a4be256..c0d8a58 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 _0xbd52=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5908b8,_0x544699){var _0xe24a76=function(_0x2bd33f){while(--_0x2bd33f){_0x5908b8['push'](_0x5908b8['shift']());}};_0xe24a76(++_0x544699);}(_0xbd52,0x1ac));var _0x2bd5=function(_0x16f4cd,_0x125cb3){_0x16f4cd=_0x16f4cd-0x0;var _0x3bb8fa=_0xbd52[_0x16f4cd];return _0x3bb8fa;};'use strict';var _=require(_0x2bd5('0x0'));var util=require(_0x2bd5('0x1'));var moment=require(_0x2bd5('0x2'));var BPromise=require(_0x2bd5('0x3'));var rs=require(_0x2bd5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bd5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2bd5('0x6'))(_0x2bd5('0x7'));var config=require(_0x2bd5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2bd5('0x9')][_0x2bd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5500f9,_0x5c46dd,_0x4b4685){return new BPromise(function(_0x11c4fe,_0x4f5796){return client[_0x2bd5('0xb')](_0x5500f9,_0x4b4685)[_0x2bd5('0xc')](function(_0xbae25e){logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x5c46dd,_0x2bd5('0xf'));logger[_0x2bd5('0x10')](_0x2bd5('0x11'),_0x5c46dd,_0x2bd5('0xf'),JSON['stringify'](_0xbae25e));if(_0xbae25e[_0x2bd5('0x12')]){if(_0xbae25e['error']['code']===0x1f4){logger[_0x2bd5('0x12')](_0x2bd5('0xe'),_0x5c46dd,_0xbae25e[_0x2bd5('0x12')][_0x2bd5('0x13')]);return _0x4f5796(_0xbae25e['error'][_0x2bd5('0x13')]);}logger[_0x2bd5('0x12')](_0x2bd5('0xe'),_0x5c46dd,_0xbae25e[_0x2bd5('0x12')]['message']);return _0x11c4fe(_0xbae25e[_0x2bd5('0x12')]['message']);}else{logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x5c46dd,_0x2bd5('0xf'));_0x11c4fe(_0xbae25e[_0x2bd5('0x14')]['message']);}})[_0x2bd5('0x15')](function(_0x1df82d){logger[_0x2bd5('0x12')](_0x2bd5('0xe'),_0x5c46dd,_0x1df82d);_0x4f5796(_0x1df82d);});});}exports[_0x2bd5('0x16')]=function(_0x134358){var _0x2f752a=this;return new Promise(function(_0x3b5531,_0x1e97c6){return db[_0x2bd5('0x17')]['find']({'raw':_0x134358[_0x2bd5('0x18')]?_0x134358[_0x2bd5('0x18')][_0x2bd5('0x19')]===undefined?!![]:![]:!![],'where':_0x134358[_0x2bd5('0x18')]?_0x134358[_0x2bd5('0x18')]['where']||null:null,'attributes':_0x134358[_0x2bd5('0x18')]?_0x134358[_0x2bd5('0x18')][_0x2bd5('0x1a')]||null:null,'include':_0x134358[_0x2bd5('0x18')]?_0x134358[_0x2bd5('0x18')][_0x2bd5('0x1b')]?_[_0x2bd5('0x1c')](_0x134358[_0x2bd5('0x18')][_0x2bd5('0x1b')],function(_0x1b0ff2){return{'model':db[_0x1b0ff2[_0x2bd5('0x1d')]],'as':_0x1b0ff2['as'],'attributes':_0x1b0ff2['attributes'],'include':_0x1b0ff2[_0x2bd5('0x1b')]?_[_0x2bd5('0x1c')](_0x1b0ff2[_0x2bd5('0x1b')],function(_0x5ed6f5){return{'model':db[_0x5ed6f5[_0x2bd5('0x1d')]],'as':_0x5ed6f5['as'],'attributes':_0x5ed6f5[_0x2bd5('0x1a')],'include':_0x5ed6f5[_0x2bd5('0x1b')]?_[_0x2bd5('0x1c')](_0x5ed6f5[_0x2bd5('0x1b')],function(_0x325dd2){return{'model':db[_0x325dd2[_0x2bd5('0x1d')]],'as':_0x325dd2['as'],'attributes':_0x325dd2[_0x2bd5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2bd5('0xc')](function(_0x53a54e){logger[_0x2bd5('0xd')]('ShowSquareOdbc',_0x134358);logger['debug'](_0x2bd5('0x16'),_0x134358,JSON[_0x2bd5('0x1e')](_0x53a54e));_0x3b5531(_0x53a54e);})['catch'](function(_0x15b775){logger['error'](_0x2bd5('0x16'),_0x15b775['message'],_0x134358);_0x1e97c6(_0x2f752a[_0x2bd5('0x12')](0x1f4,_0x15b775[_0x2bd5('0x13')]));});});}; \ No newline at end of file +var _0x08e4=['SquareOdbc','options','raw','where','attributes','include','map','model','ShowSquareOdbc','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','catch'];(function(_0x4a4483,_0x48a63e){var _0x3c5310=function(_0x74d2d1){while(--_0x74d2d1){_0x4a4483['push'](_0x4a4483['shift']());}};_0x3c5310(++_0x48a63e);}(_0x08e4,0x1bb));var _0x408e=function(_0x4c7ad2,_0x2b7b91){_0x4c7ad2=_0x4c7ad2-0x0;var _0x44e999=_0x08e4[_0x4c7ad2];return _0x44e999;};'use strict';var _=require(_0x408e('0x0'));var util=require(_0x408e('0x1'));var moment=require('moment');var BPromise=require(_0x408e('0x2'));var rs=require(_0x408e('0x3'));var fs=require('fs');var Redis=require(_0x408e('0x4'));var db=require(_0x408e('0x5'))['db'];var utils=require(_0x408e('0x6'));var logger=require('../../config/logger')(_0x408e('0x7'));var config=require(_0x408e('0x8'));var jayson=require(_0x408e('0x9'));var client=jayson[_0x408e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed01d,_0x53cadb,_0x54f3a7){return new BPromise(function(_0x3b37c0,_0x5f0fb5){return client['request'](_0x1ed01d,_0x54f3a7)[_0x408e('0xb')](function(_0x4b667e){logger[_0x408e('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x53cadb,_0x408e('0xd'));logger[_0x408e('0xe')](_0x408e('0xf'),_0x53cadb,_0x408e('0xd'),JSON[_0x408e('0x10')](_0x4b667e));if(_0x4b667e[_0x408e('0x11')]){if(_0x4b667e[_0x408e('0x11')][_0x408e('0x12')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x53cadb,_0x4b667e['error'][_0x408e('0x13')]);return _0x5f0fb5(_0x4b667e[_0x408e('0x11')][_0x408e('0x13')]);}logger[_0x408e('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x53cadb,_0x4b667e[_0x408e('0x11')]['message']);return _0x3b37c0(_0x4b667e[_0x408e('0x11')][_0x408e('0x13')]);}else{logger[_0x408e('0xc')](_0x408e('0x14'),_0x53cadb,_0x408e('0xd'));_0x3b37c0(_0x4b667e['result'][_0x408e('0x13')]);}})[_0x408e('0x15')](function(_0x544480){logger[_0x408e('0x11')](_0x408e('0x14'),_0x53cadb,_0x544480);_0x5f0fb5(_0x544480);});});}exports['ShowSquareOdbc']=function(_0x347ce2){var _0x152244=this;return new Promise(function(_0xbd9404,_0x25bf1e){return db[_0x408e('0x16')]['find']({'raw':_0x347ce2[_0x408e('0x17')]?_0x347ce2['options'][_0x408e('0x18')]===undefined?!![]:![]:!![],'where':_0x347ce2['options']?_0x347ce2[_0x408e('0x17')][_0x408e('0x19')]||null:null,'attributes':_0x347ce2[_0x408e('0x17')]?_0x347ce2[_0x408e('0x17')][_0x408e('0x1a')]||null:null,'include':_0x347ce2[_0x408e('0x17')]?_0x347ce2[_0x408e('0x17')][_0x408e('0x1b')]?_[_0x408e('0x1c')](_0x347ce2['options'][_0x408e('0x1b')],function(_0xbffc32){return{'model':db[_0xbffc32[_0x408e('0x1d')]],'as':_0xbffc32['as'],'attributes':_0xbffc32[_0x408e('0x1a')],'include':_0xbffc32[_0x408e('0x1b')]?_[_0x408e('0x1c')](_0xbffc32[_0x408e('0x1b')],function(_0x453600){return{'model':db[_0x453600[_0x408e('0x1d')]],'as':_0x453600['as'],'attributes':_0x453600['attributes'],'include':_0x453600[_0x408e('0x1b')]?_[_0x408e('0x1c')](_0x453600[_0x408e('0x1b')],function(_0x1039f7){return{'model':db[_0x1039f7[_0x408e('0x1d')]],'as':_0x1039f7['as'],'attributes':_0x1039f7[_0x408e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x408e('0xb')](function(_0x3d3bca){logger[_0x408e('0xc')](_0x408e('0x1e'),_0x347ce2);logger['debug'](_0x408e('0x1e'),_0x347ce2,JSON[_0x408e('0x10')](_0x3d3bca));_0xbd9404(_0x3d3bca);})[_0x408e('0x15')](function(_0x8bad91){logger[_0x408e('0x11')](_0x408e('0x1e'),_0x8bad91[_0x408e('0x13')],_0x347ce2);_0x25bf1e(_0x152244[_0x408e('0x11')](0x1f4,_0x8bad91['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 27ac225..1597843 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 _0x6d4b=['isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x1c0747,_0x4f7d26){_0x1c0747=_0x1c0747-0x0;var _0x24b4c8=_0x6d4b[_0x1c0747];return _0x24b4c8;};'use strict';var multer=require(_0xb6d4('0x0'));var util=require(_0xb6d4('0x1'));var path=require(_0xb6d4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb6d4('0x3'));var router=express[_0xb6d4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb6d4('0x5'));var config=require(_0xb6d4('0x6'));var controller=require(_0xb6d4('0x7'));router[_0xb6d4('0x8')]('/',auth[_0xb6d4('0x9')](),controller[_0xb6d4('0xa')]);router[_0xb6d4('0x8')](_0xb6d4('0xb'),auth['isAuthenticated'](),controller[_0xb6d4('0xc')]);router[_0xb6d4('0x8')](_0xb6d4('0xd'),auth[_0xb6d4('0x9')](),controller[_0xb6d4('0xe')]);router[_0xb6d4('0xf')]('/',auth[_0xb6d4('0x9')](),controller[_0xb6d4('0x10')]);router[_0xb6d4('0xf')](_0xb6d4('0xd'),auth['isAuthenticated'](),controller['addUsers']);router['put']('/:id',auth[_0xb6d4('0x9')](),controller['update']);router[_0xb6d4('0x11')](_0xb6d4('0xb'),auth[_0xb6d4('0x9')](),controller[_0xb6d4('0x12')]);router['delete'](_0xb6d4('0xd'),auth[_0xb6d4('0x9')](),controller['removeUsers']);module[_0xb6d4('0x13')]=router; \ No newline at end of file +var _0x4342=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','/:id/users','post','create','addUsers','put','update','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4342,0xe5));var _0x2434=function(_0x5cedbc,_0x48fc4d){_0x5cedbc=_0x5cedbc-0x0;var _0x5d73a0=_0x4342[_0x5cedbc];return _0x5d73a0;};'use strict';var multer=require(_0x2434('0x0'));var util=require(_0x2434('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2434('0x2'));var router=express[_0x2434('0x3')]();var fs_extra=require(_0x2434('0x4'));var auth=require(_0x2434('0x5'));var interaction=require(_0x2434('0x6'));var config=require(_0x2434('0x7'));var controller=require(_0x2434('0x8'));router[_0x2434('0x9')]('/',auth[_0x2434('0xa')](),controller[_0x2434('0xb')]);router[_0x2434('0x9')](_0x2434('0xc'),auth[_0x2434('0xa')](),controller['show']);router[_0x2434('0x9')](_0x2434('0xd'),auth['isAuthenticated'](),controller['getUsers']);router[_0x2434('0xe')]('/',auth[_0x2434('0xa')](),controller[_0x2434('0xf')]);router['post']('/:id/users',auth[_0x2434('0xa')](),controller[_0x2434('0x10')]);router[_0x2434('0x11')](_0x2434('0xc'),auth[_0x2434('0xa')](),controller[_0x2434('0x12')]);router['delete'](_0x2434('0xc'),auth['isAuthenticated'](),controller[_0x2434('0x13')]);router['delete']('/:id/users',auth[_0x2434('0xa')](),controller['removeUsers']);module[_0x2434('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index d8061b5..2dba140 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 _0xdcd5=['exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize'];(function(_0x3dda13,_0x531a50){var _0x4cb902=function(_0x11e7f7){while(--_0x11e7f7){_0x3dda13['push'](_0x3dda13['shift']());}};_0x4cb902(++_0x531a50);}(_0xdcd5,0x110));var _0x5dcd=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xdcd5[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x5dcd('0x0'));module[_0x5dcd('0x1')]={'name':{'type':Sequelize[_0x5dcd('0x2')],'unique':_0x5dcd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5dcd('0x2')]},'notes':{'type':Sequelize[_0x5dcd('0x4')]},'preproduction':{'type':Sequelize[_0x5dcd('0x5')]('long'),'get':function(){if(this[_0x5dcd('0x6')](_0x5dcd('0x7'))){return this[_0x5dcd('0x6')](_0x5dcd('0x7'))[_0x5dcd('0x8')](_0x5dcd('0x9'));}}},'production':{'type':Sequelize[_0x5dcd('0x5')](_0x5dcd('0xa')),'get':function(){if(this['getDataValue']('production')){return this[_0x5dcd('0x6')](_0x5dcd('0xb'))[_0x5dcd('0x8')]('utf8');}}},'savedAt':{'type':Sequelize[_0x5dcd('0xc')]},'publishedAt':{'type':Sequelize[_0x5dcd('0xc')]}}; \ No newline at end of file +var _0x2243=['toString','utf8','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x50dda7,_0x155591){var _0x459e56=function(_0x2f277d){while(--_0x2f277d){_0x50dda7['push'](_0x50dda7['shift']());}};_0x459e56(++_0x155591);}(_0x2243,0x13b));var _0x3224=function(_0x86a0bf,_0x201dbd){_0x86a0bf=_0x86a0bf-0x0;var _0x5ac5ea=_0x2243[_0x86a0bf];return _0x5ac5ea;};'use strict';var Sequelize=require(_0x3224('0x0'));module[_0x3224('0x1')]={'name':{'type':Sequelize[_0x3224('0x2')],'unique':_0x3224('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3224('0x2')]},'notes':{'type':Sequelize[_0x3224('0x4')]},'preproduction':{'type':Sequelize[_0x3224('0x5')](_0x3224('0x6')),'get':function(){if(this[_0x3224('0x7')](_0x3224('0x8'))){return this[_0x3224('0x7')](_0x3224('0x8'))[_0x3224('0x9')]('utf8');}}},'production':{'type':Sequelize[_0x3224('0x5')](_0x3224('0x6')),'get':function(){if(this[_0x3224('0x7')]('production')){return this[_0x3224('0x7')]('production')['toString'](_0x3224('0xa'));}}},'savedAt':{'type':Sequelize[_0x3224('0xb')]},'publishedAt':{'type':Sequelize[_0x3224('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a21b5fb..21d8802 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 _0x18d6=['hasOwnProperty','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','destroy','then','get','SquareProjects','UserProfileResource','end','error','stack','name','net','Socket','connect','port','index','map','SquareProject','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','merge','where','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','stringify','production','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','pick','filter','getUsers'];(function(_0x407014,_0x2f8091){var _0x156689=function(_0x3bcddc){while(--_0x3bcddc){_0x407014['push'](_0x407014['shift']());}};_0x156689(++_0x2f8091);}(_0x18d6,0x13d));var _0x618d=function(_0x1c4f20,_0x2c41fd){_0x1c4f20=_0x1c4f20-0x0;var _0x315983=_0x18d6[_0x1c4f20];return _0x315983;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x618d('0x0'));var logger=require(_0x618d('0x1'))('api');var config=require(_0x618d('0x2'));var db=require('../../mysqldb')['db'];config[_0x618d('0x3')]=_[_0x618d('0x4')](config[_0x618d('0x3')],{'host':_0x618d('0x5'),'port':0x18eb});var socket=require(_0x618d('0x6'))(new Redis(config[_0x618d('0x3')]));require('./squareProject.socket')[_0x618d('0x7')](socket);function respondWithStatusCode(_0x1ba7fa,_0x334fb7){_0x334fb7=_0x334fb7||0xcc;return function(_0x86d02e){if(_0x86d02e){return _0x1ba7fa[_0x618d('0x8')](_0x334fb7);}return _0x1ba7fa['status'](_0x334fb7)['end']();};}function respondWithResult(_0x45f265,_0xcbd249){_0xcbd249=_0xcbd249||0xc8;return function(_0xcb3539){if(_0xcb3539){return _0x45f265[_0x618d('0x9')](_0xcbd249)[_0x618d('0xa')](_0xcb3539);}};}function respondWithFilteredResult(_0x5a1f11,_0x18c378){return function(_0x598444){if(_0x598444){var _0x404625=typeof _0x18c378[_0x618d('0xb')]===_0x618d('0xc')&&typeof _0x18c378[_0x618d('0xd')]==='undefined';var _0x5f3aa3=_0x598444[_0x618d('0xe')];var _0x25a601=_0x404625?0x0:_0x18c378[_0x618d('0xb')];var _0x3f60f7=_0x404625?_0x598444[_0x618d('0xe')]:_0x18c378['offset']+_0x18c378[_0x618d('0xd')];var _0x18f231;if(_0x3f60f7>=_0x5f3aa3){_0x3f60f7=_0x5f3aa3;_0x18f231=0xc8;}else{_0x18f231=0xce;}_0x5a1f11[_0x618d('0x9')](_0x18f231);return _0x5a1f11['set'](_0x618d('0xf'),_0x25a601+'-'+_0x3f60f7+'/'+_0x5f3aa3)[_0x618d('0xa')](_0x598444);}return null;};}function saveUpdates(_0x293d41){return function(_0x341d11){if(_0x341d11){return _0x341d11['update'](_0x293d41)['then'](function(_0x5d15be){return _0x5d15be;});}return null;};}function removeEntity(_0x1f5a91){return function(_0x118d3a){if(_0x118d3a){return _0x118d3a[_0x618d('0x10')]()[_0x618d('0x11')](function(){var _0x380f72=_0x118d3a[_0x618d('0x12')]({'plain':!![]});var _0x142b85=_0x618d('0x13');return db[_0x618d('0x14')][_0x618d('0x10')]({'where':{'type':_0x142b85,'resourceId':_0x380f72['id']}})['then'](function(){return _0x118d3a;});})[_0x618d('0x11')](function(){return createAgiSocket();})[_0x618d('0x11')](function(_0x461c7e){_0x461c7e[_0x618d('0x15')](JSON['stringify']({'id':_0x118d3a['id'],'deleted':!![]}));})['then'](function(){_0x1f5a91[_0x618d('0x9')](0xcc)[_0x618d('0x15')]();});}};}function handleEntityNotFound(_0x4cd963){return function(_0x1796f1){if(!_0x1796f1){_0x4cd963[_0x618d('0x8')](0x194);}return _0x1796f1;};}function handleError(_0x5bd6d7,_0x1b484f){_0x1b484f=_0x1b484f||0x1f4;return function(_0x51f0d1){logger[_0x618d('0x16')](_0x51f0d1[_0x618d('0x17')]);if(_0x51f0d1[_0x618d('0x18')]){delete _0x51f0d1[_0x618d('0x18')];}_0x5bd6d7['status'](_0x1b484f)['send'](_0x51f0d1);};}function createAgiSocket(){try{var _0x27471b=require(_0x618d('0x19'));var _0x197916=new _0x27471b[(_0x618d('0x1a'))]();return _0x197916[_0x618d('0x1b')](config['agi'][_0x618d('0x1c')]||0x11dd,'127.0.0.1');}catch(_0x2dd0de){throw _0x2dd0de;}}exports[_0x618d('0x1d')]=function(_0x23d2b1,_0x46e386){var _0x2e9006={},_0x54dd11={},_0x400ea4={'count':0x0,'rows':[]};var _0x52fd3d=_[_0x618d('0x1e')](db[_0x618d('0x1f')][_0x618d('0x20')],function(_0x2cd55c){return{'name':_0x2cd55c[_0x618d('0x21')],'type':_0x2cd55c['type']['key']};});_0x54dd11[_0x618d('0x22')]=_['map'](_0x52fd3d,'name');_0x54dd11[_0x618d('0x23')]=_[_0x618d('0x24')](_0x23d2b1[_0x618d('0x23')]);_0x54dd11[_0x618d('0x25')]=_[_0x618d('0x26')](_0x54dd11['model'],_0x54dd11[_0x618d('0x23')]);_0x2e9006[_0x618d('0x27')]=_[_0x618d('0x26')](_0x54dd11[_0x618d('0x22')],qs[_0x618d('0x28')](_0x23d2b1[_0x618d('0x23')]['fields']));_0x2e9006['attributes']=_0x2e9006[_0x618d('0x27')][_0x618d('0x29')]?_0x2e9006[_0x618d('0x27')]:_0x54dd11['model'];if(!_0x23d2b1[_0x618d('0x23')]['hasOwnProperty'](_0x618d('0x2a'))){_0x2e9006['limit']=qs[_0x618d('0xd')](_0x23d2b1['query'][_0x618d('0xd')]);_0x2e9006[_0x618d('0xb')]=qs[_0x618d('0xb')](_0x23d2b1[_0x618d('0x23')]['offset']);}_0x2e9006[_0x618d('0x2b')]=qs[_0x618d('0x2c')](_0x23d2b1[_0x618d('0x23')][_0x618d('0x2c')]);_0x2e9006['where']=qs[_0x618d('0x25')](_['pick'](_0x23d2b1[_0x618d('0x23')],_0x54dd11[_0x618d('0x25')]),_0x52fd3d);if(_0x23d2b1[_0x618d('0x23')]['filter']){_0x2e9006['where']=_[_0x618d('0x2d')](_0x2e9006[_0x618d('0x2e')],{'$or':_[_0x618d('0x1e')](_0x52fd3d,function(_0x3fad0e){if(_0x3fad0e['type']!==_0x618d('0x2f')){var _0x5490a4={};_0x5490a4[_0x3fad0e[_0x618d('0x18')]]={'$like':'%'+_0x23d2b1[_0x618d('0x23')]['filter']+'%'};return _0x5490a4;}})});}_0x2e9006=_['merge']({},_0x2e9006,_0x23d2b1[_0x618d('0x30')]);var _0x298fd1={'where':_0x2e9006[_0x618d('0x2e')]};return db[_0x618d('0x1f')][_0x618d('0xe')](_0x298fd1)['then'](function(_0x586a11){_0x400ea4[_0x618d('0xe')]=_0x586a11;if(_0x23d2b1[_0x618d('0x23')][_0x618d('0x31')]){_0x2e9006['include']=[{'all':!![]}];}return db[_0x618d('0x1f')]['findAll'](_0x2e9006);})[_0x618d('0x11')](function(_0x37e5d8){_0x400ea4[_0x618d('0x32')]=_0x37e5d8;return _0x400ea4;})[_0x618d('0x11')](respondWithFilteredResult(_0x46e386,_0x2e9006))[_0x618d('0x33')](handleError(_0x46e386,null));};exports[_0x618d('0x34')]=function(_0x5b1169,_0x140ede){var _0x4df5ec={'raw':![],'where':{'id':_0x5b1169[_0x618d('0x35')]['id']}},_0x2b4670={};_0x2b4670[_0x618d('0x22')]=_[_0x618d('0x24')](db['SquareProject'][_0x618d('0x20')]);_0x2b4670[_0x618d('0x23')]=_[_0x618d('0x24')](_0x5b1169[_0x618d('0x23')]);_0x2b4670[_0x618d('0x25')]=_['intersection'](_0x2b4670[_0x618d('0x22')],_0x2b4670['query']);_0x4df5ec['attributes']=_[_0x618d('0x26')](_0x2b4670[_0x618d('0x22')],qs[_0x618d('0x28')](_0x5b1169[_0x618d('0x23')][_0x618d('0x28')]));_0x4df5ec[_0x618d('0x27')]=_0x4df5ec['attributes'][_0x618d('0x29')]?_0x4df5ec[_0x618d('0x27')]:_0x2b4670[_0x618d('0x22')];if(_0x5b1169[_0x618d('0x23')][_0x618d('0x31')]){_0x4df5ec[_0x618d('0x36')]=[{'all':!![]}];}_0x4df5ec=_['merge']({},_0x4df5ec,_0x5b1169[_0x618d('0x30')]);return db[_0x618d('0x1f')][_0x618d('0x37')](_0x4df5ec)[_0x618d('0x11')](handleEntityNotFound(_0x140ede,null))['then'](respondWithResult(_0x140ede,null))[_0x618d('0x33')](handleError(_0x140ede,null));};exports['create']=function(_0x343cc6,_0x39276e){return db[_0x618d('0x1f')][_0x618d('0x38')](_0x343cc6[_0x618d('0x39')],{})['then'](function(_0x1b6f40){var _0x9cff7d=_0x343cc6[_0x618d('0x3a')][_0x618d('0x12')]({'plain':!![]});if(!_0x9cff7d)throw new Error(_0x618d('0x3b'));if(_0x9cff7d['role']===_0x618d('0x3a')){var _0x488851=_0x1b6f40['get']({'plain':!![]});var _0xd6bc40='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0xd6bc40,'userProfileId':_0x9cff7d[_0x618d('0x3c')]},'raw':!![]})['then'](function(_0x2572c1){if(_0x2572c1&&_0x2572c1[_0x618d('0x3d')]===0x0){return db[_0x618d('0x14')]['create']({'name':_0x488851[_0x618d('0x18')],'resourceId':_0x488851['id'],'type':_0x2572c1[_0x618d('0x18')],'sectionId':_0x2572c1['id']},{})['then'](function(){return _0x1b6f40;});}else{return _0x1b6f40;}})[_0x618d('0x33')](function(_0xdde9a7){logger['error'](_0x618d('0x3e'),_0xdde9a7);throw _0xdde9a7;});}return _0x1b6f40;})[_0x618d('0x11')](respondWithResult(_0x39276e,0xc9))[_0x618d('0x33')](handleError(_0x39276e,null));};exports[_0x618d('0x3f')]=function(_0x1675d8,_0x5ead3d){if(_0x1675d8[_0x618d('0x39')]['id']){delete _0x1675d8[_0x618d('0x39')]['id'];}return db[_0x618d('0x1f')][_0x618d('0x37')]({'where':{'id':_0x1675d8['params']['id']}})['then'](handleEntityNotFound(_0x5ead3d,null))['then'](saveUpdates(_0x1675d8[_0x618d('0x39')],null))['then'](function(_0x4c07a7){if(!_0x4c07a7)return;var _0x3e4eb6=_0x4c07a7[_0x618d('0x12')]({'plain':!![]});return _0x3e4eb6;})['then'](function(_0x508624){var _0x3aa3b2=new Redis(config[_0x618d('0x3')]);_0x3aa3b2['publish']('agi',JSON[_0x618d('0x40')](_['pick'](_0x508624,['id','name',_0x618d('0x41')])));return _0x508624;})['then'](respondWithResult(_0x5ead3d,null))[_0x618d('0x33')](handleError(_0x5ead3d,null));};exports[_0x618d('0x10')]=function(_0x55e442,_0x3cb76b){return db['SquareProject'][_0x618d('0x37')]({'where':{'id':_0x55e442[_0x618d('0x35')]['id']}})[_0x618d('0x11')](handleEntityNotFound(_0x3cb76b,null))[_0x618d('0x11')](removeEntity(_0x3cb76b,null))[_0x618d('0x33')](handleError(_0x3cb76b,null));};exports[_0x618d('0x42')]=function(_0x294ac4,_0x5885c6){return db[_0x618d('0x1f')][_0x618d('0x37')]({'where':{'id':_0x294ac4['params']['id']}})[_0x618d('0x11')](handleEntityNotFound(_0x5885c6,null))[_0x618d('0x11')](function(_0x17d032){if(_0x17d032){return _0x17d032[_0x618d('0x42')](_0x294ac4[_0x618d('0x39')]['ids'],_[_0x618d('0x43')](_0x294ac4[_0x618d('0x39')],[_0x618d('0x44'),'id'])||{});}})[_0x618d('0x11')](respondWithResult(_0x5885c6,null))[_0x618d('0x33')](handleError(_0x5885c6,null));};exports[_0x618d('0x45')]=function(_0x4939e6,_0x13a0e1){return db[_0x618d('0x1f')][_0x618d('0x37')]({'where':{'id':_0x4939e6[_0x618d('0x35')]['id']}})[_0x618d('0x11')](handleEntityNotFound(_0x13a0e1,null))[_0x618d('0x11')](function(_0x3b3342){if(_0x3b3342){return _0x3b3342[_0x618d('0x45')](_0x4939e6[_0x618d('0x23')][_0x618d('0x44')])['then'](function(){if(_[_0x618d('0x46')](_0x4939e6['query'][_0x618d('0x44')])){for(var _0x3bc946=0x0;_0x3bc946<_0x4939e6[_0x618d('0x23')][_0x618d('0x44')][_0x618d('0x29')];_0x3bc946+=0x1){socket[_0x618d('0x47')]('userSquareProject:remove',{'UserId':Number(_0x4939e6['query']['ids'][_0x3bc946]),'SquareProjectId':Number(_0x4939e6[_0x618d('0x35')]['id'])});}}else{socket[_0x618d('0x47')](_0x618d('0x48'),{'UserId':Number(_0x4939e6['query'][_0x618d('0x44')]),'SquareProjectId':Number(_0x4939e6[_0x618d('0x35')]['id'])});}});}})[_0x618d('0x11')](respondWithStatusCode(_0x13a0e1,null))[_0x618d('0x33')](handleError(_0x13a0e1,null));};exports['getUsers']=function(_0x50ebfd,_0x2bced0){var _0x2abfbf={};var _0x455a57={};var _0x417d3d;var _0x49529d;return db['SquareProject'][_0x618d('0x49')]({'where':{'id':_0x50ebfd['params']['id']}})['then'](handleEntityNotFound(_0x2bced0,null))[_0x618d('0x11')](function(_0x1b1207){if(_0x1b1207){_0x417d3d=_0x1b1207;_0x455a57[_0x618d('0x22')]=_[_0x618d('0x24')](db[_0x618d('0x4a')][_0x618d('0x20')]);_0x455a57['query']=_[_0x618d('0x24')](_0x50ebfd['query']);_0x455a57[_0x618d('0x25')]=_['intersection'](_0x455a57[_0x618d('0x22')],_0x455a57[_0x618d('0x23')]);_0x2abfbf[_0x618d('0x27')]=_[_0x618d('0x26')](_0x455a57['model'],qs[_0x618d('0x28')](_0x50ebfd['query'][_0x618d('0x28')]));_0x2abfbf['attributes']=_0x2abfbf['attributes']['length']?_0x2abfbf['attributes']:_0x455a57[_0x618d('0x22')];_0x2abfbf[_0x618d('0x2b')]=qs['sort'](_0x50ebfd[_0x618d('0x23')][_0x618d('0x2c')]);_0x2abfbf[_0x618d('0x2e')]=qs[_0x618d('0x25')](_[_0x618d('0x4b')](_0x50ebfd['query'],_0x455a57[_0x618d('0x25')]));if(_0x50ebfd[_0x618d('0x23')][_0x618d('0x4c')]){_0x2abfbf[_0x618d('0x2e')]=_[_0x618d('0x2d')](_0x2abfbf['where'],{'$or':_['map'](_0x2abfbf[_0x618d('0x27')],function(_0x3a806e){var _0x3883a8={};_0x3883a8[_0x3a806e]={'$like':'%'+_0x50ebfd[_0x618d('0x23')]['filter']+'%'};return _0x3883a8;})});}_0x2abfbf=_[_0x618d('0x2d')]({},_0x2abfbf,_0x50ebfd['options']);return _0x417d3d[_0x618d('0x4d')](_0x2abfbf);}})[_0x618d('0x11')](function(_0x1ee995){if(_0x1ee995){_0x49529d=_0x1ee995[_0x618d('0x29')];if(!_0x50ebfd[_0x618d('0x23')][_0x618d('0x4e')]('nolimit')){_0x2abfbf[_0x618d('0xd')]=qs['limit'](_0x50ebfd[_0x618d('0x23')][_0x618d('0xd')]);_0x2abfbf[_0x618d('0xb')]=qs[_0x618d('0xb')](_0x50ebfd[_0x618d('0x23')][_0x618d('0xb')]);}return _0x417d3d[_0x618d('0x4d')](_0x2abfbf);}})['then'](function(_0x4b38c9){if(_0x4b38c9){return _0x4b38c9?{'count':_0x49529d,'rows':_0x4b38c9}:null;}})[_0x618d('0x11')](respondWithResult(_0x2bced0,null))[_0x618d('0x33')](handleError(_0x2bced0,null));}; \ No newline at end of file +var _0x6a9c=['SquareProjects','UserProfileResource','stringify','sendStatus','error','name','send','net','Socket','agi','port','127.0.0.1','index','SquareProject','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','production','addUsers','omit','removeUsers','ids','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a9c,0x145));var _0xc6a9=function(_0x13806d,_0x19e4d9){_0x13806d=_0x13806d-0x0;var _0x4431f5=_0x6a9c[_0x13806d];return _0x4431f5;};'use strict';var _=require('lodash');var Redis=require(_0xc6a9('0x0'));var qs=require(_0xc6a9('0x1'));var logger=require(_0xc6a9('0x2'))(_0xc6a9('0x3'));var config=require(_0xc6a9('0x4'));var db=require(_0xc6a9('0x5'))['db'];config[_0xc6a9('0x6')]=_[_0xc6a9('0x7')](config[_0xc6a9('0x6')],{'host':_0xc6a9('0x8'),'port':0x18eb});var socket=require(_0xc6a9('0x9'))(new Redis(config[_0xc6a9('0x6')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x4b8759,_0x47a75c){_0x47a75c=_0x47a75c||0xcc;return function(_0x326c20){if(_0x326c20){return _0x4b8759['sendStatus'](_0x47a75c);}return _0x4b8759[_0xc6a9('0xa')](_0x47a75c)[_0xc6a9('0xb')]();};}function respondWithResult(_0x442aa5,_0x7ecf1d){_0x7ecf1d=_0x7ecf1d||0xc8;return function(_0x4063a8){if(_0x4063a8){return _0x442aa5[_0xc6a9('0xa')](_0x7ecf1d)[_0xc6a9('0xc')](_0x4063a8);}};}function respondWithFilteredResult(_0x1ae67a,_0x1932d9){return function(_0x4fc522){if(_0x4fc522){var _0x939330=typeof _0x1932d9[_0xc6a9('0xd')]===_0xc6a9('0xe')&&typeof _0x1932d9[_0xc6a9('0xf')]===_0xc6a9('0xe');var _0x43fafe=_0x4fc522[_0xc6a9('0x10')];var _0x2549f1=_0x939330?0x0:_0x1932d9[_0xc6a9('0xd')];var _0x506549=_0x939330?_0x4fc522[_0xc6a9('0x10')]:_0x1932d9[_0xc6a9('0xd')]+_0x1932d9['limit'];var _0x1d8adc;if(_0x506549>=_0x43fafe){_0x506549=_0x43fafe;_0x1d8adc=0xc8;}else{_0x1d8adc=0xce;}_0x1ae67a[_0xc6a9('0xa')](_0x1d8adc);return _0x1ae67a[_0xc6a9('0x11')](_0xc6a9('0x12'),_0x2549f1+'-'+_0x506549+'/'+_0x43fafe)['json'](_0x4fc522);}return null;};}function saveUpdates(_0x5ee503){return function(_0x404601){if(_0x404601){return _0x404601[_0xc6a9('0x13')](_0x5ee503)[_0xc6a9('0x14')](function(_0x45d7a3){return _0x45d7a3;});}return null;};}function removeEntity(_0x5760e1){return function(_0x327c4e){if(_0x327c4e){return _0x327c4e[_0xc6a9('0x15')]()['then'](function(){var _0x340bb5=_0x327c4e[_0xc6a9('0x16')]({'plain':!![]});var _0x4d93b4=_0xc6a9('0x17');return db[_0xc6a9('0x18')]['destroy']({'where':{'type':_0x4d93b4,'resourceId':_0x340bb5['id']}})[_0xc6a9('0x14')](function(){return _0x327c4e;});})[_0xc6a9('0x14')](function(){return createAgiSocket();})['then'](function(_0x552a86){_0x552a86[_0xc6a9('0xb')](JSON[_0xc6a9('0x19')]({'id':_0x327c4e['id'],'deleted':!![]}));})[_0xc6a9('0x14')](function(){_0x5760e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c70a3){return function(_0x2ea092){if(!_0x2ea092){_0x4c70a3[_0xc6a9('0x1a')](0x194);}return _0x2ea092;};}function handleError(_0x3c3eb5,_0x2ea508){_0x2ea508=_0x2ea508||0x1f4;return function(_0x18756a){logger[_0xc6a9('0x1b')](_0x18756a['stack']);if(_0x18756a[_0xc6a9('0x1c')]){delete _0x18756a['name'];}_0x3c3eb5[_0xc6a9('0xa')](_0x2ea508)[_0xc6a9('0x1d')](_0x18756a);};}function createAgiSocket(){try{var _0x38550c=require(_0xc6a9('0x1e'));var _0x5d51c1=new _0x38550c[(_0xc6a9('0x1f'))]();return _0x5d51c1['connect'](config[_0xc6a9('0x20')][_0xc6a9('0x21')]||0x11dd,_0xc6a9('0x22'));}catch(_0x5f6ecf){throw _0x5f6ecf;}}exports[_0xc6a9('0x23')]=function(_0x369b93,_0x27a5f1){var _0x2dd2c5={},_0x47d61f={},_0x4ad99b={'count':0x0,'rows':[]};var _0x1c90f5=_['map'](db[_0xc6a9('0x24')]['rawAttributes'],function(_0x11bb40){return{'name':_0x11bb40['fieldName'],'type':_0x11bb40[_0xc6a9('0x25')][_0xc6a9('0x26')]};});_0x47d61f[_0xc6a9('0x27')]=_[_0xc6a9('0x28')](_0x1c90f5,_0xc6a9('0x1c'));_0x47d61f[_0xc6a9('0x29')]=_[_0xc6a9('0x2a')](_0x369b93[_0xc6a9('0x29')]);_0x47d61f[_0xc6a9('0x2b')]=_[_0xc6a9('0x2c')](_0x47d61f[_0xc6a9('0x27')],_0x47d61f['query']);_0x2dd2c5[_0xc6a9('0x2d')]=_[_0xc6a9('0x2c')](_0x47d61f[_0xc6a9('0x27')],qs[_0xc6a9('0x2e')](_0x369b93[_0xc6a9('0x29')][_0xc6a9('0x2e')]));_0x2dd2c5[_0xc6a9('0x2d')]=_0x2dd2c5['attributes']['length']?_0x2dd2c5[_0xc6a9('0x2d')]:_0x47d61f[_0xc6a9('0x27')];if(!_0x369b93[_0xc6a9('0x29')][_0xc6a9('0x2f')](_0xc6a9('0x30'))){_0x2dd2c5[_0xc6a9('0xf')]=qs['limit'](_0x369b93[_0xc6a9('0x29')]['limit']);_0x2dd2c5[_0xc6a9('0xd')]=qs['offset'](_0x369b93[_0xc6a9('0x29')][_0xc6a9('0xd')]);}_0x2dd2c5['order']=qs[_0xc6a9('0x31')](_0x369b93['query'][_0xc6a9('0x31')]);_0x2dd2c5[_0xc6a9('0x32')]=qs[_0xc6a9('0x2b')](_[_0xc6a9('0x33')](_0x369b93[_0xc6a9('0x29')],_0x47d61f[_0xc6a9('0x2b')]),_0x1c90f5);if(_0x369b93[_0xc6a9('0x29')][_0xc6a9('0x34')]){_0x2dd2c5['where']=_['merge'](_0x2dd2c5[_0xc6a9('0x32')],{'$or':_[_0xc6a9('0x28')](_0x1c90f5,function(_0x3d3ed2){if(_0x3d3ed2[_0xc6a9('0x25')]!==_0xc6a9('0x35')){var _0x2ce437={};_0x2ce437[_0x3d3ed2[_0xc6a9('0x1c')]]={'$like':'%'+_0x369b93[_0xc6a9('0x29')][_0xc6a9('0x34')]+'%'};return _0x2ce437;}})});}_0x2dd2c5=_[_0xc6a9('0x36')]({},_0x2dd2c5,_0x369b93[_0xc6a9('0x37')]);var _0x3d8a5b={'where':_0x2dd2c5[_0xc6a9('0x32')]};return db[_0xc6a9('0x24')]['count'](_0x3d8a5b)[_0xc6a9('0x14')](function(_0x36568b){_0x4ad99b[_0xc6a9('0x10')]=_0x36568b;if(_0x369b93['query'][_0xc6a9('0x38')]){_0x2dd2c5[_0xc6a9('0x39')]=[{'all':!![]}];}return db[_0xc6a9('0x24')][_0xc6a9('0x3a')](_0x2dd2c5);})['then'](function(_0x804fbe){_0x4ad99b[_0xc6a9('0x3b')]=_0x804fbe;return _0x4ad99b;})[_0xc6a9('0x14')](respondWithFilteredResult(_0x27a5f1,_0x2dd2c5))[_0xc6a9('0x3c')](handleError(_0x27a5f1,null));};exports[_0xc6a9('0x3d')]=function(_0x197bfe,_0x34cc37){var _0x13d68f={'raw':![],'where':{'id':_0x197bfe[_0xc6a9('0x3e')]['id']}},_0x5e1fb2={};_0x5e1fb2[_0xc6a9('0x27')]=_['keys'](db[_0xc6a9('0x24')][_0xc6a9('0x3f')]);_0x5e1fb2[_0xc6a9('0x29')]=_['keys'](_0x197bfe[_0xc6a9('0x29')]);_0x5e1fb2[_0xc6a9('0x2b')]=_[_0xc6a9('0x2c')](_0x5e1fb2[_0xc6a9('0x27')],_0x5e1fb2[_0xc6a9('0x29')]);_0x13d68f[_0xc6a9('0x2d')]=_[_0xc6a9('0x2c')](_0x5e1fb2[_0xc6a9('0x27')],qs[_0xc6a9('0x2e')](_0x197bfe[_0xc6a9('0x29')]['fields']));_0x13d68f[_0xc6a9('0x2d')]=_0x13d68f['attributes'][_0xc6a9('0x40')]?_0x13d68f[_0xc6a9('0x2d')]:_0x5e1fb2[_0xc6a9('0x27')];if(_0x197bfe[_0xc6a9('0x29')][_0xc6a9('0x38')]){_0x13d68f[_0xc6a9('0x39')]=[{'all':!![]}];}_0x13d68f=_[_0xc6a9('0x36')]({},_0x13d68f,_0x197bfe['options']);return db['SquareProject'][_0xc6a9('0x41')](_0x13d68f)[_0xc6a9('0x14')](handleEntityNotFound(_0x34cc37,null))[_0xc6a9('0x14')](respondWithResult(_0x34cc37,null))[_0xc6a9('0x3c')](handleError(_0x34cc37,null));};exports[_0xc6a9('0x42')]=function(_0x1af1fb,_0xbeeb54){return db[_0xc6a9('0x24')]['create'](_0x1af1fb[_0xc6a9('0x43')],{})[_0xc6a9('0x14')](function(_0x3bbb6e){var _0x2eb763=_0x1af1fb[_0xc6a9('0x44')][_0xc6a9('0x16')]({'plain':!![]});if(!_0x2eb763)throw new Error(_0xc6a9('0x45'));if(_0x2eb763[_0xc6a9('0x46')]===_0xc6a9('0x44')){var _0x24dafb=_0x3bbb6e['get']({'plain':!![]});var _0xdb981e=_0xc6a9('0x17');return db[_0xc6a9('0x47')][_0xc6a9('0x41')]({'where':{'name':_0xdb981e,'userProfileId':_0x2eb763['userProfileId']},'raw':!![]})[_0xc6a9('0x14')](function(_0xce89f1){if(_0xce89f1&&_0xce89f1[_0xc6a9('0x48')]===0x0){return db[_0xc6a9('0x18')][_0xc6a9('0x42')]({'name':_0x24dafb['name'],'resourceId':_0x24dafb['id'],'type':_0xce89f1[_0xc6a9('0x1c')],'sectionId':_0xce89f1['id']},{})[_0xc6a9('0x14')](function(){return _0x3bbb6e;});}else{return _0x3bbb6e;}})[_0xc6a9('0x3c')](function(_0x2c7036){logger[_0xc6a9('0x1b')](_0xc6a9('0x49'),_0x2c7036);throw _0x2c7036;});}return _0x3bbb6e;})['then'](respondWithResult(_0xbeeb54,0xc9))[_0xc6a9('0x3c')](handleError(_0xbeeb54,null));};exports[_0xc6a9('0x13')]=function(_0x43a6ab,_0x16cb37){if(_0x43a6ab[_0xc6a9('0x43')]['id']){delete _0x43a6ab[_0xc6a9('0x43')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x43a6ab[_0xc6a9('0x3e')]['id']}})[_0xc6a9('0x14')](handleEntityNotFound(_0x16cb37,null))[_0xc6a9('0x14')](saveUpdates(_0x43a6ab[_0xc6a9('0x43')],null))[_0xc6a9('0x14')](function(_0x2b88a0){if(!_0x2b88a0)return;var _0x293a97=_0x2b88a0[_0xc6a9('0x16')]({'plain':!![]});return _0x293a97;})[_0xc6a9('0x14')](function(_0x34b2d0){var _0x1eab4c=new Redis(config[_0xc6a9('0x6')]);_0x1eab4c[_0xc6a9('0x4a')](_0xc6a9('0x20'),JSON['stringify'](_[_0xc6a9('0x33')](_0x34b2d0,['id','name',_0xc6a9('0x4b')])));return _0x34b2d0;})['then'](respondWithResult(_0x16cb37,null))[_0xc6a9('0x3c')](handleError(_0x16cb37,null));};exports[_0xc6a9('0x15')]=function(_0x3872f2,_0x1b7d67){return db[_0xc6a9('0x24')][_0xc6a9('0x41')]({'where':{'id':_0x3872f2[_0xc6a9('0x3e')]['id']}})[_0xc6a9('0x14')](handleEntityNotFound(_0x1b7d67,null))[_0xc6a9('0x14')](removeEntity(_0x1b7d67,null))['catch'](handleError(_0x1b7d67,null));};exports[_0xc6a9('0x4c')]=function(_0x38af31,_0xdc83f2){return db['SquareProject'][_0xc6a9('0x41')]({'where':{'id':_0x38af31[_0xc6a9('0x3e')]['id']}})[_0xc6a9('0x14')](handleEntityNotFound(_0xdc83f2,null))['then'](function(_0x46aec){if(_0x46aec){return _0x46aec[_0xc6a9('0x4c')](_0x38af31[_0xc6a9('0x43')]['ids'],_[_0xc6a9('0x4d')](_0x38af31[_0xc6a9('0x43')],['ids','id'])||{});}})[_0xc6a9('0x14')](respondWithResult(_0xdc83f2,null))[_0xc6a9('0x3c')](handleError(_0xdc83f2,null));};exports['removeUsers']=function(_0x3638c2,_0xf012e){return db[_0xc6a9('0x24')][_0xc6a9('0x41')]({'where':{'id':_0x3638c2[_0xc6a9('0x3e')]['id']}})['then'](handleEntityNotFound(_0xf012e,null))['then'](function(_0x4169d7){if(_0x4169d7){return _0x4169d7[_0xc6a9('0x4e')](_0x3638c2[_0xc6a9('0x29')][_0xc6a9('0x4f')])[_0xc6a9('0x14')](function(){if(_[_0xc6a9('0x50')](_0x3638c2[_0xc6a9('0x29')]['ids'])){for(var _0x4050d4=0x0;_0x4050d4<_0x3638c2[_0xc6a9('0x29')][_0xc6a9('0x4f')][_0xc6a9('0x40')];_0x4050d4+=0x1){socket[_0xc6a9('0x51')](_0xc6a9('0x52'),{'UserId':Number(_0x3638c2[_0xc6a9('0x29')][_0xc6a9('0x4f')][_0x4050d4]),'SquareProjectId':Number(_0x3638c2[_0xc6a9('0x3e')]['id'])});}}else{socket['emit'](_0xc6a9('0x52'),{'UserId':Number(_0x3638c2[_0xc6a9('0x29')][_0xc6a9('0x4f')]),'SquareProjectId':Number(_0x3638c2['params']['id'])});}});}})[_0xc6a9('0x14')](respondWithStatusCode(_0xf012e,null))[_0xc6a9('0x3c')](handleError(_0xf012e,null));};exports[_0xc6a9('0x53')]=function(_0x158cdb,_0x14749b){var _0x55c67c={};var _0x2d737b={};var _0x434bba;var _0x45614d;return db['SquareProject'][_0xc6a9('0x54')]({'where':{'id':_0x158cdb[_0xc6a9('0x3e')]['id']}})[_0xc6a9('0x14')](handleEntityNotFound(_0x14749b,null))[_0xc6a9('0x14')](function(_0x4b5cde){if(_0x4b5cde){_0x434bba=_0x4b5cde;_0x2d737b[_0xc6a9('0x27')]=_['keys'](db[_0xc6a9('0x55')]['rawAttributes']);_0x2d737b[_0xc6a9('0x29')]=_[_0xc6a9('0x2a')](_0x158cdb['query']);_0x2d737b['filters']=_[_0xc6a9('0x2c')](_0x2d737b[_0xc6a9('0x27')],_0x2d737b['query']);_0x55c67c[_0xc6a9('0x2d')]=_['intersection'](_0x2d737b[_0xc6a9('0x27')],qs[_0xc6a9('0x2e')](_0x158cdb['query']['fields']));_0x55c67c[_0xc6a9('0x2d')]=_0x55c67c[_0xc6a9('0x2d')]['length']?_0x55c67c[_0xc6a9('0x2d')]:_0x2d737b[_0xc6a9('0x27')];_0x55c67c[_0xc6a9('0x56')]=qs[_0xc6a9('0x31')](_0x158cdb[_0xc6a9('0x29')][_0xc6a9('0x31')]);_0x55c67c[_0xc6a9('0x32')]=qs[_0xc6a9('0x2b')](_[_0xc6a9('0x33')](_0x158cdb[_0xc6a9('0x29')],_0x2d737b[_0xc6a9('0x2b')]));if(_0x158cdb['query'][_0xc6a9('0x34')]){_0x55c67c[_0xc6a9('0x32')]=_[_0xc6a9('0x36')](_0x55c67c[_0xc6a9('0x32')],{'$or':_[_0xc6a9('0x28')](_0x55c67c[_0xc6a9('0x2d')],function(_0x49ee1b){var _0xdf56a8={};_0xdf56a8[_0x49ee1b]={'$like':'%'+_0x158cdb[_0xc6a9('0x29')][_0xc6a9('0x34')]+'%'};return _0xdf56a8;})});}_0x55c67c=_[_0xc6a9('0x36')]({},_0x55c67c,_0x158cdb[_0xc6a9('0x37')]);return _0x434bba[_0xc6a9('0x53')](_0x55c67c);}})[_0xc6a9('0x14')](function(_0x76052d){if(_0x76052d){_0x45614d=_0x76052d['length'];if(!_0x158cdb[_0xc6a9('0x29')][_0xc6a9('0x2f')](_0xc6a9('0x30'))){_0x55c67c[_0xc6a9('0xf')]=qs[_0xc6a9('0xf')](_0x158cdb[_0xc6a9('0x29')][_0xc6a9('0xf')]);_0x55c67c[_0xc6a9('0xd')]=qs['offset'](_0x158cdb[_0xc6a9('0x29')][_0xc6a9('0xd')]);}return _0x434bba[_0xc6a9('0x53')](_0x55c67c);}})[_0xc6a9('0x14')](function(_0x494434){if(_0x494434){return _0x494434?{'count':_0x45614d,'rows':_0x494434}:null;}})[_0xc6a9('0x14')](respondWithResult(_0x14749b,null))['catch'](handleError(_0x14749b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 619ce19..1b3eabf 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 _0xe5c6=['emit','hook','exports','events','../../mysqldb','SquareProject','save','update'];(function(_0x69f2d5,_0x5c448d){var _0x3bcf16=function(_0x4bcc75){while(--_0x4bcc75){_0x69f2d5['push'](_0x69f2d5['shift']());}};_0x3bcf16(++_0x5c448d);}(_0xe5c6,0x133));var _0x6e5c=function(_0x147104,_0x451f03){_0x147104=_0x147104-0x0;var _0x47597f=_0xe5c6[_0x147104];return _0x47597f;};'use strict';var EventEmitter=require(_0x6e5c('0x0'));var SquareProject=require(_0x6e5c('0x1'))['db'][_0x6e5c('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e5c('0x3'),'afterUpdate':_0x6e5c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e913f){return function(_0x83e6f9,_0x550180,_0x3ff77d){SquareProjectEvents[_0x6e5c('0x5')](_0x3e913f+':'+_0x83e6f9['id'],_0x83e6f9);SquareProjectEvents[_0x6e5c('0x5')](_0x3e913f,_0x83e6f9);_0x3ff77d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x6e5c('0x6')](e,emitEvent(event));}}module[_0x6e5c('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x60c6=['save','update','remove','hook','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x5c8b29,_0x4d2a16){var _0x3fb775=function(_0x7366be){while(--_0x7366be){_0x5c8b29['push'](_0x5c8b29['shift']());}};_0x3fb775(++_0x4d2a16);}(_0x60c6,0xf2));var _0x660c=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x60c6[_0x102ff9];return _0x24fa97;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x660c('0x0'))['db'][_0x660c('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x660c('0x2')](0x0);var events={'afterCreate':_0x660c('0x3'),'afterUpdate':_0x660c('0x4'),'afterDestroy':_0x660c('0x5')};function emitEvent(_0xa8ec34){return function(_0x45a258,_0x3f9167,_0x3e6ffc){SquareProjectEvents['emit'](_0xa8ec34+':'+_0x45a258['id'],_0x45a258);SquareProjectEvents['emit'](_0xa8ec34,_0x45a258);_0x3e6ffc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x660c('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index cb13780..6f96f8d 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 _0xcd6a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','api'];(function(_0x487b8e,_0x10b318){var _0x5a7018=function(_0x5ccc12){while(--_0x5ccc12){_0x487b8e['push'](_0x487b8e['shift']());}};_0x5a7018(++_0x10b318);}(_0xcd6a,0xc0));var _0xacd6=function(_0x3d841c,_0x12076b){_0x3d841c=_0x3d841c-0x0;var _0xbd02c3=_0xcd6a[_0x3d841c];return _0xbd02c3;};'use strict';var _=require(_0xacd6('0x0'));var util=require(_0xacd6('0x1'));var logger=require('../../config/logger')(_0xacd6('0x2'));var moment=require(_0xacd6('0x3'));var BPromise=require(_0xacd6('0x4'));var rp=require(_0xacd6('0x5'));var fs=require('fs');var path=require(_0xacd6('0x6'));var rimraf=require(_0xacd6('0x7'));var config=require(_0xacd6('0x8'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x5e04a6,_0x39ea72){return _0x5e04a6['define']('SquareProject',attributes,{'tableName':_0xacd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b3887,_0x210fba,_0x335ee4){if(_0x2b3887[_0xacd6('0xa')](_0xacd6('0xb'))){_0x2b3887[_0xacd6('0xc')]=moment()['format'](_0xacd6('0xd'));}if(_0x2b3887[_0xacd6('0xa')]('production')){_0x2b3887[_0xacd6('0xe')]=moment()['format'](_0xacd6('0xd'));}_0x335ee4(null,_0x2b3887);}}});}; \ No newline at end of file +var _0x1ec9=['format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','request-promise','rimraf','./squareProject.attributes','define','SquareProject','square_projects','changed','savedAt'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1ec9,0x104));var _0x91ec=function(_0x444396,_0x15fcd6){_0x444396=_0x444396-0x0;var _0x34bce4=_0x1ec9[_0x444396];return _0x34bce4;};'use strict';var _=require(_0x91ec('0x0'));var util=require(_0x91ec('0x1'));var logger=require(_0x91ec('0x2'))('api');var moment=require(_0x91ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x91ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91ec('0x5'));var config=require('../../config/environment');var attributes=require(_0x91ec('0x6'));module['exports']=function(_0x484f82,_0x42f625){return _0x484f82[_0x91ec('0x7')](_0x91ec('0x8'),attributes,{'tableName':_0x91ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e633d,_0x1b8200,_0x43a48c){if(_0x2e633d[_0x91ec('0xa')]('preproduction')){_0x2e633d[_0x91ec('0xb')]=moment()[_0x91ec('0xc')](_0x91ec('0xd'));}if(_0x2e633d['changed'](_0x91ec('0xe'))){_0x2e633d[_0x91ec('0xf')]=moment()[_0x91ec('0xc')](_0x91ec('0xd'));}_0x43a48c(null,_0x2e633d);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index cf0f37a..66f8b01 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 _0xf299=['catch','error','message','ShowSquareProject','raw','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','SquareProject','findAll','options','where','attributes','include','map','model','then','info','GetSquareProjects','debug','stringify'];(function(_0x32b4aa,_0x12eba6){var _0x473160=function(_0x4906b6){while(--_0x4906b6){_0x32b4aa['push'](_0x32b4aa['shift']());}};_0x473160(++_0x12eba6);}(_0xf299,0x101));var _0x9f29=function(_0x43dc5a,_0x4b8119){_0x43dc5a=_0x43dc5a-0x0;var _0x309159=_0xf299[_0x43dc5a];return _0x309159;};'use strict';var _=require(_0x9f29('0x0'));var Redis=require(_0x9f29('0x1'));var db=require(_0x9f29('0x2'))['db'];var logger=require(_0x9f29('0x3'))(_0x9f29('0x4'));var config=require(_0x9f29('0x5'));config[_0x9f29('0x6')]=_[_0x9f29('0x7')](config[_0x9f29('0x6')],{'host':_0x9f29('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f29('0x6')]));require(_0x9f29('0x9'))['register'](socket);exports['GetSquareProjects']=function(_0xf5a3a7){var _0x4b5441=this;return new Promise(function(_0x11b660,_0x156a95){return db[_0x9f29('0xa')][_0x9f29('0xb')]({'raw':_0xf5a3a7[_0x9f29('0xc')]?_0xf5a3a7[_0x9f29('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0xf5a3a7[_0x9f29('0xc')]?_0xf5a3a7[_0x9f29('0xc')][_0x9f29('0xd')]||null:null,'attributes':_0xf5a3a7[_0x9f29('0xc')]?_0xf5a3a7['options'][_0x9f29('0xe')]||null:null,'limit':_0xf5a3a7[_0x9f29('0xc')]?_0xf5a3a7['options']['limit']||null:null,'include':_0xf5a3a7[_0x9f29('0xc')]?_0xf5a3a7[_0x9f29('0xc')][_0x9f29('0xf')]?_[_0x9f29('0x10')](_0xf5a3a7[_0x9f29('0xc')]['include'],function(_0xd83c5d){return{'model':db[_0xd83c5d[_0x9f29('0x11')]],'as':_0xd83c5d['as'],'attributes':_0xd83c5d[_0x9f29('0xe')],'include':_0xd83c5d['include']?_['map'](_0xd83c5d[_0x9f29('0xf')],function(_0x5879d1){return{'model':db[_0x5879d1['model']],'as':_0x5879d1['as'],'attributes':_0x5879d1[_0x9f29('0xe')],'include':_0x5879d1['include']?_[_0x9f29('0x10')](_0x5879d1[_0x9f29('0xf')],function(_0x36f735){return{'model':db[_0x36f735[_0x9f29('0x11')]],'as':_0x36f735['as'],'attributes':_0x36f735[_0x9f29('0xe')]};}):[]};}):[]};}):[]:[]})[_0x9f29('0x12')](function(_0x592308){logger[_0x9f29('0x13')](_0x9f29('0x14'),_0xf5a3a7);logger[_0x9f29('0x15')](_0x9f29('0x14'),_0xf5a3a7,JSON[_0x9f29('0x16')](_0x592308));_0x11b660(_0x592308);})[_0x9f29('0x17')](function(_0x54cffb){logger[_0x9f29('0x18')](_0x9f29('0x14'),_0x54cffb[_0x9f29('0x19')],_0xf5a3a7);_0x156a95(_0x4b5441[_0x9f29('0x18')](0x1f4,_0x54cffb['message']));});});};exports[_0x9f29('0x1a')]=function(_0x34b690){var _0x36f337=this;return new Promise(function(_0x1c2339,_0x26ccdc){return db[_0x9f29('0xa')]['find']({'raw':_0x34b690[_0x9f29('0xc')]?_0x34b690[_0x9f29('0xc')][_0x9f29('0x1b')]===undefined?!![]:![]:!![],'where':_0x34b690[_0x9f29('0xc')]?_0x34b690[_0x9f29('0xc')][_0x9f29('0xd')]||null:null,'attributes':_0x34b690[_0x9f29('0xc')]?_0x34b690['options'][_0x9f29('0xe')]||null:null,'include':_0x34b690[_0x9f29('0xc')]?_0x34b690[_0x9f29('0xc')]['include']?_['map'](_0x34b690[_0x9f29('0xc')][_0x9f29('0xf')],function(_0x5347df){return{'model':db[_0x5347df[_0x9f29('0x11')]],'as':_0x5347df['as'],'attributes':_0x5347df['attributes'],'include':_0x5347df[_0x9f29('0xf')]?_[_0x9f29('0x10')](_0x5347df[_0x9f29('0xf')],function(_0x4565f0){return{'model':db[_0x4565f0['model']],'as':_0x4565f0['as'],'attributes':_0x4565f0['attributes'],'include':_0x4565f0[_0x9f29('0xf')]?_[_0x9f29('0x10')](_0x4565f0[_0x9f29('0xf')],function(_0x22d5b9){return{'model':db[_0x22d5b9[_0x9f29('0x11')]],'as':_0x22d5b9['as'],'attributes':_0x22d5b9[_0x9f29('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e91e0){logger[_0x9f29('0x13')](_0x9f29('0x1a'),_0x34b690);logger[_0x9f29('0x15')](_0x9f29('0x1a'),_0x34b690,JSON[_0x9f29('0x16')](_0x3e91e0));_0x1c2339(_0x3e91e0);})[_0x9f29('0x17')](function(_0x2dc082){logger[_0x9f29('0x18')](_0x9f29('0x1a'),_0x2dc082[_0x9f29('0x19')],_0x34b690);_0x26ccdc(_0x36f337[_0x9f29('0x18')](0x1f4,_0x2dc082['message']));});});}; \ No newline at end of file +var _0x4ab3=['debug','GetSquareProjects','stringify','catch','message','error','find','ShowSquareProject','lodash','ioredis','../../mysqldb','../../config/logger','rpc','redis','localhost','register','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','info'];(function(_0x39be0a,_0x4fc9b9){var _0x4b21ec=function(_0x40ead3){while(--_0x40ead3){_0x39be0a['push'](_0x39be0a['shift']());}};_0x4b21ec(++_0x4fc9b9);}(_0x4ab3,0x94));var _0x34ab=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x4ab3[_0x14a0a0];return _0x56b651;};'use strict';var _=require(_0x34ab('0x0'));var Redis=require(_0x34ab('0x1'));var db=require(_0x34ab('0x2'))['db'];var logger=require(_0x34ab('0x3'))(_0x34ab('0x4'));var config=require('../../config/environment');config[_0x34ab('0x5')]=_['defaults'](config[_0x34ab('0x5')],{'host':_0x34ab('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34ab('0x5')]));require('./squareProject.socket')[_0x34ab('0x7')](socket);exports['GetSquareProjects']=function(_0x330255){var _0x12aa1a=this;return new Promise(function(_0x46e09d,_0x92654f){return db[_0x34ab('0x8')][_0x34ab('0x9')]({'raw':_0x330255[_0x34ab('0xa')]?_0x330255[_0x34ab('0xa')][_0x34ab('0xb')]===undefined?!![]:![]:!![],'where':_0x330255[_0x34ab('0xa')]?_0x330255[_0x34ab('0xa')][_0x34ab('0xc')]||null:null,'attributes':_0x330255['options']?_0x330255['options'][_0x34ab('0xd')]||null:null,'limit':_0x330255[_0x34ab('0xa')]?_0x330255[_0x34ab('0xa')][_0x34ab('0xe')]||null:null,'include':_0x330255['options']?_0x330255[_0x34ab('0xa')][_0x34ab('0xf')]?_[_0x34ab('0x10')](_0x330255['options']['include'],function(_0x498813){return{'model':db[_0x498813[_0x34ab('0x11')]],'as':_0x498813['as'],'attributes':_0x498813[_0x34ab('0xd')],'include':_0x498813[_0x34ab('0xf')]?_[_0x34ab('0x10')](_0x498813[_0x34ab('0xf')],function(_0x4e2ebb){return{'model':db[_0x4e2ebb[_0x34ab('0x11')]],'as':_0x4e2ebb['as'],'attributes':_0x4e2ebb[_0x34ab('0xd')],'include':_0x4e2ebb[_0x34ab('0xf')]?_[_0x34ab('0x10')](_0x4e2ebb['include'],function(_0x4ffc21){return{'model':db[_0x4ffc21[_0x34ab('0x11')]],'as':_0x4ffc21['as'],'attributes':_0x4ffc21[_0x34ab('0xd')]};}):[]};}):[]};}):[]:[]})[_0x34ab('0x12')](function(_0x2ebb4c){logger[_0x34ab('0x13')]('GetSquareProjects',_0x330255);logger[_0x34ab('0x14')](_0x34ab('0x15'),_0x330255,JSON[_0x34ab('0x16')](_0x2ebb4c));_0x46e09d(_0x2ebb4c);})[_0x34ab('0x17')](function(_0x7ea288){logger['error'](_0x34ab('0x15'),_0x7ea288[_0x34ab('0x18')],_0x330255);_0x92654f(_0x12aa1a[_0x34ab('0x19')](0x1f4,_0x7ea288[_0x34ab('0x18')]));});});};exports['ShowSquareProject']=function(_0x57e20d){var _0x559c01=this;return new Promise(function(_0x1644a6,_0x3fa5e8){return db[_0x34ab('0x8')][_0x34ab('0x1a')]({'raw':_0x57e20d[_0x34ab('0xa')]?_0x57e20d['options'][_0x34ab('0xb')]===undefined?!![]:![]:!![],'where':_0x57e20d[_0x34ab('0xa')]?_0x57e20d[_0x34ab('0xa')][_0x34ab('0xc')]||null:null,'attributes':_0x57e20d['options']?_0x57e20d['options'][_0x34ab('0xd')]||null:null,'include':_0x57e20d[_0x34ab('0xa')]?_0x57e20d[_0x34ab('0xa')][_0x34ab('0xf')]?_[_0x34ab('0x10')](_0x57e20d[_0x34ab('0xa')][_0x34ab('0xf')],function(_0x98072b){return{'model':db[_0x98072b[_0x34ab('0x11')]],'as':_0x98072b['as'],'attributes':_0x98072b[_0x34ab('0xd')],'include':_0x98072b['include']?_[_0x34ab('0x10')](_0x98072b[_0x34ab('0xf')],function(_0x48c3dc){return{'model':db[_0x48c3dc[_0x34ab('0x11')]],'as':_0x48c3dc['as'],'attributes':_0x48c3dc[_0x34ab('0xd')],'include':_0x48c3dc[_0x34ab('0xf')]?_['map'](_0x48c3dc[_0x34ab('0xf')],function(_0x4e8acd){return{'model':db[_0x4e8acd[_0x34ab('0x11')]],'as':_0x4e8acd['as'],'attributes':_0x4e8acd[_0x34ab('0xd')]};}):[]};}):[]};}):[]:[]})[_0x34ab('0x12')](function(_0x1efc04){logger['info'](_0x34ab('0x1b'),_0x57e20d);logger[_0x34ab('0x14')](_0x34ab('0x1b'),_0x57e20d,JSON['stringify'](_0x1efc04));_0x1644a6(_0x1efc04);})[_0x34ab('0x17')](function(_0x851876){logger['error'](_0x34ab('0x1b'),_0x851876[_0x34ab('0x18')],_0x57e20d);_0x3fa5e8(_0x559c01[_0x34ab('0x19')](0x1f4,_0x851876['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 481439d..9c314ae 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 _0x9075=['register','length','./squareProject.events','save','remove','emit','removeListener'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0x9075,0xd4));var _0x5907=function(_0x54faff,_0x9a3b5e){_0x54faff=_0x54faff-0x0;var _0x5a784c=_0x9075[_0x54faff];return _0x5a784c;};'use strict';var SquareProjectEvents=require(_0x5907('0x0'));var events=[_0x5907('0x1'),_0x5907('0x2'),'update'];function createListener(_0x1bb554,_0x2e2c6c){return function(_0x4fa565){_0x2e2c6c[_0x5907('0x3')](_0x1bb554,_0x4fa565);};}function removeListener(_0x5e65f9,_0x2e81a2){return function(){SquareProjectEvents[_0x5907('0x4')](_0x5e65f9,_0x2e81a2);};}exports[_0x5907('0x5')]=function(_0x1bafa3){for(var _0x151cdb=0x0,_0x1411b1=events[_0x5907('0x6')];_0x151cdb<_0x1411b1;_0x151cdb++){var _0x1d5f79=events[_0x151cdb];var _0x4d7629=createListener('squareProject:'+_0x1d5f79,_0x1bafa3);SquareProjectEvents['on'](_0x1d5f79,_0x4d7629);}}; \ No newline at end of file +var _0xdbc9=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4085aa,_0x2a135e){var _0x1eb057=function(_0x46c628){while(--_0x46c628){_0x4085aa['push'](_0x4085aa['shift']());}};_0x1eb057(++_0x2a135e);}(_0xdbc9,0xd9));var _0x9dbc=function(_0x5913f0,_0x8747dd){_0x5913f0=_0x5913f0-0x0;var _0x56ea37=_0xdbc9[_0x5913f0];return _0x56ea37;};'use strict';var SquareProjectEvents=require(_0x9dbc('0x0'));var events=[_0x9dbc('0x1'),_0x9dbc('0x2'),_0x9dbc('0x3')];function createListener(_0x5974dc,_0xd81b7){return function(_0x1651b3){_0xd81b7[_0x9dbc('0x4')](_0x5974dc,_0x1651b3);};}function removeListener(_0xe4154b,_0x4a5fab){return function(){SquareProjectEvents[_0x9dbc('0x5')](_0xe4154b,_0x4a5fab);};}exports[_0x9dbc('0x6')]=function(_0x5d2ef1){for(var _0xe462ad=0x0,_0x235e12=events[_0x9dbc('0x7')];_0xe462ad<_0x235e12;_0xe462ad++){var _0x2845e2=events[_0xe462ad];var _0x4c3165=createListener(_0x9dbc('0x8')+_0x2845e2,_0x5d2ef1);SquareProjectEvents['on'](_0x2845e2,_0x4c3165);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 35d3662..759dd53 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x3ca6bd,_0x137714){var _0x463f79=function(_0x54d685){while(--_0x54d685){_0x3ca6bd['push'](_0x3ca6bd['shift']());}};_0x463f79(++_0x137714);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3ff849,_0x1bb1a3){_0x3ff849=_0x3ff849-0x0;var _0x3e7a74=_0x1cb9[_0x3ff849];return _0x3e7a74;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x7217=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x7217,0x19e));var _0x7721=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7217[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index e80424e..4dbc448 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x467d31,_0x5a9f6b){var _0xb86532=function(_0x592dd2){while(--_0x592dd2){_0x467d31['push'](_0x467d31['shift']());}};_0xb86532(++_0x5a9f6b);}(_0xeec6,0x1c2));var _0x6eec=function(_0x35731c,_0x5ab1d1){_0x35731c=_0x35731c-0x0;var _0x2f2957=_0xeec6[_0x35731c];return _0x2f2957;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file +var _0x207c=['savePath','substring','exports','STRING','VIRTUAL','getDataValue'];(function(_0x501dda,_0x291359){var _0x2c3fef=function(_0x5ee034){while(--_0x5ee034){_0x501dda['push'](_0x501dda['shift']());}};_0x2c3fef(++_0x291359);}(_0x207c,0x1e8));var _0xc207=function(_0x487f15,_0x1cf5fb){_0x487f15=_0x487f15-0x0;var _0x32c8a1=_0x207c[_0x487f15];return _0x32c8a1;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'uniqueid':{'type':Sequelize[_0xc207('0x1')]},'callerid':{'type':Sequelize[_0xc207('0x1')]},'calleridname':{'type':Sequelize[_0xc207('0x1')]},'context':{'type':Sequelize[_0xc207('0x1')]},'extension':{'type':Sequelize[_0xc207('0x1')]},'priority':{'type':Sequelize[_0xc207('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc207('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xc207('0x1')]},'format':{'type':Sequelize[_0xc207('0x2')],'get':function(){var _0x3395e4='';var _0x59ff6f=this[_0xc207('0x3')](_0xc207('0x4'));if(_0x59ff6f){_0x3395e4=_0x59ff6f[_0xc207('0x5')](_0x59ff6f['lastIndexOf']('.'));}return _0x3395e4;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index c60faff..478c9aa 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 _0x577a=['to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','find','create','body','params','catch','download','../../components/encryptor','type','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x577a,0x1e6));var _0xa577=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x577a[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa577('0x0'));var zipdir=require(_0xa577('0x1'));var jsonpatch=require(_0xa577('0x2'));var rp=require('request-promise');var moment=require(_0xa577('0x3'));var BPromise=require(_0xa577('0x4'));var Mustache=require(_0xa577('0x5'));var util=require(_0xa577('0x6'));var path=require(_0xa577('0x7'));var sox=require(_0xa577('0x8'));var csv=require(_0xa577('0x9'));var ejs=require(_0xa577('0xa'));var fs=require('fs');var fs_extra=require(_0xa577('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa577('0xc'));var jsforce=require(_0xa577('0xd'));var deskjs=require(_0xa577('0xe'));var toCsv=require(_0xa577('0x9'));var querystring=require(_0xa577('0xf'));var Papa=require(_0xa577('0x10'));var Redis=require('ioredis');var authService=require(_0xa577('0x11'));var qs=require(_0xa577('0x12'));var as=require(_0xa577('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa577('0x14'))(_0xa577('0x15'));var utils=require('../../config/utils');var config=require(_0xa577('0x16'));var licenseUtil=require(_0xa577('0x17'));var db=require(_0xa577('0x18'))['db'];function respondWithStatusCode(_0x7ff0f4,_0x1a460d){_0x1a460d=_0x1a460d||0xcc;return function(_0x48b67b){if(_0x48b67b){return _0x7ff0f4[_0xa577('0x19')](_0x1a460d);}return _0x7ff0f4[_0xa577('0x1a')](_0x1a460d)['end']();};}function respondWithResult(_0x395bfd,_0x29dabb){_0x29dabb=_0x29dabb||0xc8;return function(_0x52bbf4){if(_0x52bbf4){return _0x395bfd[_0xa577('0x1a')](_0x29dabb)[_0xa577('0x1b')](_0x52bbf4);}};}function respondWithFilteredResult(_0x3c18f7,_0x799958){return function(_0x4127e6){if(_0x4127e6){var _0x4486b5=typeof _0x799958['offset']===_0xa577('0x1c')&&typeof _0x799958[_0xa577('0x1d')]===_0xa577('0x1c');var _0x48cc40=_0x4127e6[_0xa577('0x1e')];var _0x1549c8=_0x4486b5?0x0:_0x799958[_0xa577('0x1f')];var _0x123122=_0x4486b5?_0x4127e6[_0xa577('0x1e')]:_0x799958[_0xa577('0x1f')]+_0x799958['limit'];var _0x1e6a41;if(_0x123122>=_0x48cc40){_0x123122=_0x48cc40;_0x1e6a41=0xc8;}else{_0x1e6a41=0xce;}_0x3c18f7[_0xa577('0x1a')](_0x1e6a41);return _0x3c18f7[_0xa577('0x20')](_0xa577('0x21'),_0x1549c8+'-'+_0x123122+'/'+_0x48cc40)[_0xa577('0x1b')](_0x4127e6);}return null;};}function patchUpdates(_0x57fc38){return function(_0x2b2222){try{jsonpatch[_0xa577('0x22')](_0x2b2222,_0x57fc38,!![]);}catch(_0x356a3b){return BPromise[_0xa577('0x23')](_0x356a3b);}return _0x2b2222[_0xa577('0x24')]();};}function saveUpdates(_0xaa6669,_0x2261f5){return function(_0x5988dc){if(_0x5988dc){return _0x5988dc[_0xa577('0x25')](_0xaa6669)[_0xa577('0x26')](function(_0x338aa5){return _0x338aa5;});}return null;};}function removeEntity(_0x350069,_0x3448b7){return function(_0x47b251){if(_0x47b251){return _0x47b251[_0xa577('0x27')]()[_0xa577('0x26')](function(){_0x350069['status'](0xcc)[_0xa577('0x28')]();});}};}function handleEntityNotFound(_0x30a1c2,_0x40b867){return function(_0x5509f6){if(!_0x5509f6){_0x30a1c2['sendStatus'](0x194);}return _0x5509f6;};}function handleError(_0x36b1ee,_0x29d069){_0x29d069=_0x29d069||0x1f4;return function(_0x2687be){logger[_0xa577('0x29')](_0x2687be[_0xa577('0x2a')]);if(_0x2687be[_0xa577('0x2b')]){delete _0x2687be['name'];}_0x36b1ee['status'](_0x29d069)[_0xa577('0x2c')](_0x2687be);};}exports['index']=function(_0x2bd6fc,_0x4e1545){var _0x440fbf={},_0xb0ad90={},_0x338664={'count':0x0,'rows':[]};var _0x268cee=_[_0xa577('0x2d')](db[_0xa577('0x2e')][_0xa577('0x2f')],function(_0x400fc4){return{'name':_0x400fc4[_0xa577('0x30')],'type':_0x400fc4['type']['key']};});_0xb0ad90[_0xa577('0x31')]=_[_0xa577('0x2d')](_0x268cee,_0xa577('0x2b'));_0xb0ad90[_0xa577('0x32')]=_[_0xa577('0x33')](_0x2bd6fc[_0xa577('0x32')]);_0xb0ad90[_0xa577('0x34')]=_[_0xa577('0x35')](_0xb0ad90[_0xa577('0x31')],_0xb0ad90['query']);_0x440fbf[_0xa577('0x36')]=_[_0xa577('0x35')](_0xb0ad90[_0xa577('0x31')],qs[_0xa577('0x37')](_0x2bd6fc[_0xa577('0x32')][_0xa577('0x37')]));_0x440fbf['attributes']=_0x440fbf[_0xa577('0x36')][_0xa577('0x38')]?_0x440fbf[_0xa577('0x36')]:_0xb0ad90[_0xa577('0x31')];if(!_0x2bd6fc['query'][_0xa577('0x39')](_0xa577('0x3a'))){_0x440fbf['limit']=qs['limit'](_0x2bd6fc[_0xa577('0x32')][_0xa577('0x1d')]);_0x440fbf['offset']=qs[_0xa577('0x1f')](_0x2bd6fc['query'][_0xa577('0x1f')]);}_0x440fbf[_0xa577('0x3b')]=qs[_0xa577('0x3c')](_0x2bd6fc['query'][_0xa577('0x3c')]);_0x440fbf[_0xa577('0x3d')]=qs[_0xa577('0x34')](_[_0xa577('0x3e')](_0x2bd6fc[_0xa577('0x32')],_0xb0ad90[_0xa577('0x34')]),_0x268cee);if(_0x2bd6fc[_0xa577('0x32')][_0xa577('0x3f')]){_0x440fbf[_0xa577('0x3d')]=_[_0xa577('0x40')](_0x440fbf[_0xa577('0x3d')],{'$or':_[_0xa577('0x2d')](_0x268cee,function(_0x381e58){if(_0x381e58['type']!==_0xa577('0x41')){var _0x657442={};_0x657442[_0x381e58['name']]={'$like':'%'+_0x2bd6fc['query'][_0xa577('0x3f')]+'%'};return _0x657442;}})});}_0x440fbf=_['merge']({},_0x440fbf,_0x2bd6fc[_0xa577('0x42')]);var _0x293a8a={'where':_0x440fbf[_0xa577('0x3d')]};return db[_0xa577('0x2e')][_0xa577('0x1e')](_0x293a8a)[_0xa577('0x26')](function(_0x34e71d){_0x338664[_0xa577('0x1e')]=_0x34e71d;if(_0x2bd6fc[_0xa577('0x32')]['includeAll']){_0x440fbf[_0xa577('0x43')]=[{'all':!![]}];}return db[_0xa577('0x2e')][_0xa577('0x44')](_0x440fbf);})['then'](function(_0x45a2b0){_0x338664['rows']=_0x45a2b0;return _0x338664;})[_0xa577('0x26')](respondWithFilteredResult(_0x4e1545,_0x440fbf))['catch'](handleError(_0x4e1545,null));};exports[_0xa577('0x45')]=function(_0x18987f,_0x1afbfd){var _0x4bb885={'raw':!![],'where':{'id':_0x18987f['params']['id']}},_0x4844a1={};_0x4844a1[_0xa577('0x31')]=_[_0xa577('0x33')](db[_0xa577('0x2e')]['rawAttributes']);_0x4844a1[_0xa577('0x32')]=_[_0xa577('0x33')](_0x18987f[_0xa577('0x32')]);_0x4844a1['filters']=_[_0xa577('0x35')](_0x4844a1[_0xa577('0x31')],_0x4844a1[_0xa577('0x32')]);_0x4bb885[_0xa577('0x36')]=_[_0xa577('0x35')](_0x4844a1[_0xa577('0x31')],qs[_0xa577('0x37')](_0x18987f['query']['fields']));_0x4bb885['attributes']=_0x4bb885[_0xa577('0x36')][_0xa577('0x38')]?_0x4bb885[_0xa577('0x36')]:_0x4844a1[_0xa577('0x31')];if(_0x18987f[_0xa577('0x32')]['includeAll']){_0x4bb885[_0xa577('0x43')]=[{'all':!![]}];}_0x4bb885=_[_0xa577('0x40')]({},_0x4bb885,_0x18987f[_0xa577('0x42')]);return db[_0xa577('0x2e')][_0xa577('0x46')](_0x4bb885)[_0xa577('0x26')](handleEntityNotFound(_0x1afbfd,null))['then'](respondWithResult(_0x1afbfd,null))['catch'](handleError(_0x1afbfd,null));};exports['create']=function(_0x4d9c47,_0x104385){return db['SquareRecording'][_0xa577('0x47')](_0x4d9c47[_0xa577('0x48')],{})[_0xa577('0x26')](respondWithResult(_0x104385,0xc9))['catch'](handleError(_0x104385,null));};exports[_0xa577('0x25')]=function(_0x607fbe,_0x349e7b){if(_0x607fbe[_0xa577('0x48')]['id']){delete _0x607fbe[_0xa577('0x48')]['id'];}return db[_0xa577('0x2e')][_0xa577('0x46')]({'where':{'id':_0x607fbe[_0xa577('0x49')]['id']}})['then'](handleEntityNotFound(_0x349e7b,null))['then'](saveUpdates(_0x607fbe[_0xa577('0x48')],null))[_0xa577('0x26')](respondWithResult(_0x349e7b,null))[_0xa577('0x4a')](handleError(_0x349e7b,null));};exports[_0xa577('0x4b')]=function(_0x59668f,_0x2432be,_0x26c081){var _0x42041d=require(_0xa577('0x4c'));var _0x37d341=![];var _0x94ba86={};if(_0x59668f[_0xa577('0x32')][_0xa577('0x4d')]&&_0x59668f[_0xa577('0x32')][_0xa577('0x4d')]==='uniqueid'){_0x94ba86[_0xa577('0x4e')]=_0x59668f[_0xa577('0x49')]['id'];}else{_0x94ba86['id']=_0x59668f[_0xa577('0x49')]['id'];}return db['SquareRecording']['find']({'where':_0x94ba86,'attributes':['id',_0xa577('0x4f'),'filename'],'raw':!![]})[_0xa577('0x26')](handleEntityNotFound(_0x2432be,null))[_0xa577('0x26')](function(_0x270904){if(_0x270904){var _0xf678ac=_0x270904['savePath'];var _0x43a6c5=util[_0xa577('0x50')](_0xa577('0x51'),_0xf678ac);if(fs[_0xa577('0x52')](_0x43a6c5)){_0x37d341=!![];return _0x42041d['decryptFile'](_0x43a6c5,_0xf678ac,config[_0xa577('0x53')][_0xa577('0x54')])[_0xa577('0x26')](function(){return _0x270904;});}return _0x270904;}})[_0xa577('0x26')](function(_0xd5b0f2){if(_0xd5b0f2){var _0x41882f=_0xd5b0f2['savePath'];if(!fs[_0xa577('0x52')](_0x41882f)){throw new db[(_0xa577('0x55'))]['ValidationError'](_0xa577('0x56'));}if(_0xd5b0f2['filename']){return _0x2432be[_0xa577('0x4b')](_0x41882f,_0xd5b0f2[_0xa577('0x57')]+path[_0xa577('0x58')](_0x41882f),function(){if(_0x37d341){fs[_0xa577('0x59')](_0x41882f);}});}else{return _0x2432be['download'](_0x41882f,function(_0xad2426){if(_0x37d341){fs[_0xa577('0x59')](_0x41882f);}});}}})[_0xa577('0x4a')](function(_0xc58f88){if(_0xc58f88[_0xa577('0x5a')]===_0xa577('0x56')){_0x2432be['status'](0x194)[_0xa577('0x2c')](_0xa577('0x5b'));}else{return handleError(_0x2432be,null);}});};exports[_0xa577('0x27')]=function(_0x486e86,_0x64a168){return db[_0xa577('0x2e')][_0xa577('0x46')]({'where':{'id':_0x486e86['params']['id']}})[_0xa577('0x26')](function(_0x45a59a){if(_['isNil'](_0x45a59a)){throw new ReferenceError('Entity\x20not\x20found');}return _0x45a59a;})['then'](function(_0x259e7f){var _0x5e30c2=_0x259e7f[_0xa577('0x4f')];logger[_0xa577('0x5c')](_0xa577('0x5d'),_0x5e30c2);if(!_[_0xa577('0x5e')](_0x259e7f['savePath'])&&fs[_0xa577('0x52')](_0x5e30c2)){logger[_0xa577('0x5c')](_0xa577('0x5f')+_0x5e30c2+_0xa577('0x60'));fs[_0xa577('0x61')](_0x5e30c2);}_0x5e30c2=_0x5e30c2+_0xa577('0x62');if(!_[_0xa577('0x5e')](_0x259e7f['savePath'])&&fs[_0xa577('0x52')](_0x5e30c2)){logger[_0xa577('0x5c')](_0xa577('0x5f')+_0x5e30c2+_0xa577('0x60'));fs['unlinkSync'](_0x5e30c2);}return _0x259e7f;})[_0xa577('0x26')](function(_0x96d68f){if(!_0x96d68f)throw new InternalError();return _0x96d68f[_0xa577('0x27')]();})[_0xa577('0x26')](function(){_0x64a168[_0xa577('0x1a')](0xcc)[_0xa577('0x28')]();})[_0xa577('0x4a')](handleError(_0x64a168,null));}; \ No newline at end of file +var _0xebc9=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x3726f7,_0x291303){var _0x58dea7=function(_0x5dd3be){while(--_0x5dd3be){_0x3726f7['push'](_0x3726f7['shift']());}};_0x58dea7(++_0x291303);}(_0xebc9,0x120));var _0x9ebc=function(_0x23d576,_0x2a14d7){_0x23d576=_0x23d576-0x0;var _0x2f292b=_0xebc9[_0x23d576];return _0x2f292b;};'use strict';var emlformat=require(_0x9ebc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ebc('0x1'));var jsonpatch=require(_0x9ebc('0x2'));var rp=require(_0x9ebc('0x3'));var moment=require('moment');var BPromise=require(_0x9ebc('0x4'));var Mustache=require(_0x9ebc('0x5'));var util=require(_0x9ebc('0x6'));var path=require(_0x9ebc('0x7'));var sox=require(_0x9ebc('0x8'));var csv=require(_0x9ebc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ebc('0xa'));var squel=require(_0x9ebc('0xb'));var crypto=require(_0x9ebc('0xc'));var jsforce=require(_0x9ebc('0xd'));var deskjs=require(_0x9ebc('0xe'));var toCsv=require(_0x9ebc('0x9'));var querystring=require(_0x9ebc('0xf'));var Papa=require(_0x9ebc('0x10'));var Redis=require(_0x9ebc('0x11'));var authService=require(_0x9ebc('0x12'));var qs=require(_0x9ebc('0x13'));var as=require(_0x9ebc('0x14'));var hardwareService=require(_0x9ebc('0x15'));var logger=require(_0x9ebc('0x16'))(_0x9ebc('0x17'));var utils=require(_0x9ebc('0x18'));var config=require(_0x9ebc('0x19'));var licenseUtil=require(_0x9ebc('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d484,_0x1c7e3f){_0x1c7e3f=_0x1c7e3f||0xcc;return function(_0x54c533){if(_0x54c533){return _0x55d484[_0x9ebc('0x1b')](_0x1c7e3f);}return _0x55d484[_0x9ebc('0x1c')](_0x1c7e3f)['end']();};}function respondWithResult(_0x5ce584,_0x532f0c){_0x532f0c=_0x532f0c||0xc8;return function(_0x16790f){if(_0x16790f){return _0x5ce584[_0x9ebc('0x1c')](_0x532f0c)[_0x9ebc('0x1d')](_0x16790f);}};}function respondWithFilteredResult(_0x3ddc86,_0x5903ce){return function(_0x417880){if(_0x417880){var _0x385416=typeof _0x5903ce['offset']===_0x9ebc('0x1e')&&typeof _0x5903ce['limit']===_0x9ebc('0x1e');var _0x2f10d7=_0x417880[_0x9ebc('0x1f')];var _0x27b7e4=_0x385416?0x0:_0x5903ce['offset'];var _0x2a9116=_0x385416?_0x417880['count']:_0x5903ce[_0x9ebc('0x20')]+_0x5903ce['limit'];var _0xefee41;if(_0x2a9116>=_0x2f10d7){_0x2a9116=_0x2f10d7;_0xefee41=0xc8;}else{_0xefee41=0xce;}_0x3ddc86[_0x9ebc('0x1c')](_0xefee41);return _0x3ddc86['set'](_0x9ebc('0x21'),_0x27b7e4+'-'+_0x2a9116+'/'+_0x2f10d7)['json'](_0x417880);}return null;};}function patchUpdates(_0x461561){return function(_0x12eef0){try{jsonpatch[_0x9ebc('0x22')](_0x12eef0,_0x461561,!![]);}catch(_0x3b3ef4){return BPromise[_0x9ebc('0x23')](_0x3b3ef4);}return _0x12eef0[_0x9ebc('0x24')]();};}function saveUpdates(_0x2d55c4,_0x378abd){return function(_0x237d0a){if(_0x237d0a){return _0x237d0a[_0x9ebc('0x25')](_0x2d55c4)['then'](function(_0x5ccd00){return _0x5ccd00;});}return null;};}function removeEntity(_0x29a78c,_0x1f0938){return function(_0x28c1ce){if(_0x28c1ce){return _0x28c1ce[_0x9ebc('0x26')]()[_0x9ebc('0x27')](function(){_0x29a78c[_0x9ebc('0x1c')](0xcc)[_0x9ebc('0x28')]();});}};}function handleEntityNotFound(_0x1d7df0,_0x37a09c){return function(_0x16d2bd){if(!_0x16d2bd){_0x1d7df0[_0x9ebc('0x1b')](0x194);}return _0x16d2bd;};}function handleError(_0x3e5fea,_0x222205){_0x222205=_0x222205||0x1f4;return function(_0x3cb41a){logger[_0x9ebc('0x29')](_0x3cb41a[_0x9ebc('0x2a')]);if(_0x3cb41a[_0x9ebc('0x2b')]){delete _0x3cb41a[_0x9ebc('0x2b')];}_0x3e5fea[_0x9ebc('0x1c')](_0x222205)[_0x9ebc('0x2c')](_0x3cb41a);};}exports['index']=function(_0x5d5a05,_0x1430a0){var _0x2b9850={},_0x3b8ec5={},_0x110e78={'count':0x0,'rows':[]};var _0x2d0f4c=_[_0x9ebc('0x2d')](db[_0x9ebc('0x2e')][_0x9ebc('0x2f')],function(_0x128fa7){return{'name':_0x128fa7['fieldName'],'type':_0x128fa7[_0x9ebc('0x30')][_0x9ebc('0x31')]};});_0x3b8ec5[_0x9ebc('0x32')]=_[_0x9ebc('0x2d')](_0x2d0f4c,'name');_0x3b8ec5[_0x9ebc('0x33')]=_[_0x9ebc('0x34')](_0x5d5a05[_0x9ebc('0x33')]);_0x3b8ec5[_0x9ebc('0x35')]=_[_0x9ebc('0x36')](_0x3b8ec5[_0x9ebc('0x32')],_0x3b8ec5[_0x9ebc('0x33')]);_0x2b9850['attributes']=_[_0x9ebc('0x36')](_0x3b8ec5['model'],qs[_0x9ebc('0x37')](_0x5d5a05['query'][_0x9ebc('0x37')]));_0x2b9850[_0x9ebc('0x38')]=_0x2b9850[_0x9ebc('0x38')]['length']?_0x2b9850[_0x9ebc('0x38')]:_0x3b8ec5['model'];if(!_0x5d5a05[_0x9ebc('0x33')]['hasOwnProperty'](_0x9ebc('0x39'))){_0x2b9850[_0x9ebc('0x3a')]=qs[_0x9ebc('0x3a')](_0x5d5a05[_0x9ebc('0x33')][_0x9ebc('0x3a')]);_0x2b9850[_0x9ebc('0x20')]=qs['offset'](_0x5d5a05[_0x9ebc('0x33')][_0x9ebc('0x20')]);}_0x2b9850[_0x9ebc('0x3b')]=qs[_0x9ebc('0x3c')](_0x5d5a05[_0x9ebc('0x33')][_0x9ebc('0x3c')]);_0x2b9850[_0x9ebc('0x3d')]=qs['filters'](_[_0x9ebc('0x3e')](_0x5d5a05[_0x9ebc('0x33')],_0x3b8ec5[_0x9ebc('0x35')]),_0x2d0f4c);if(_0x5d5a05[_0x9ebc('0x33')][_0x9ebc('0x3f')]){_0x2b9850[_0x9ebc('0x3d')]=_[_0x9ebc('0x40')](_0x2b9850[_0x9ebc('0x3d')],{'$or':_[_0x9ebc('0x2d')](_0x2d0f4c,function(_0x5c37b6){if(_0x5c37b6[_0x9ebc('0x30')]!==_0x9ebc('0x41')){var _0x1c6e16={};_0x1c6e16[_0x5c37b6['name']]={'$like':'%'+_0x5d5a05['query']['filter']+'%'};return _0x1c6e16;}})});}_0x2b9850=_[_0x9ebc('0x40')]({},_0x2b9850,_0x5d5a05[_0x9ebc('0x42')]);var _0x52c1b6={'where':_0x2b9850[_0x9ebc('0x3d')]};return db[_0x9ebc('0x2e')][_0x9ebc('0x1f')](_0x52c1b6)[_0x9ebc('0x27')](function(_0x420e80){_0x110e78[_0x9ebc('0x1f')]=_0x420e80;if(_0x5d5a05[_0x9ebc('0x33')][_0x9ebc('0x43')]){_0x2b9850[_0x9ebc('0x44')]=[{'all':!![]}];}return db[_0x9ebc('0x2e')][_0x9ebc('0x45')](_0x2b9850);})[_0x9ebc('0x27')](function(_0xb5bed0){_0x110e78[_0x9ebc('0x46')]=_0xb5bed0;return _0x110e78;})[_0x9ebc('0x27')](respondWithFilteredResult(_0x1430a0,_0x2b9850))[_0x9ebc('0x47')](handleError(_0x1430a0,null));};exports[_0x9ebc('0x48')]=function(_0x55b23f,_0xb2ad84){var _0x16fbed={'raw':!![],'where':{'id':_0x55b23f[_0x9ebc('0x49')]['id']}},_0xba923a={};_0xba923a[_0x9ebc('0x32')]=_[_0x9ebc('0x34')](db[_0x9ebc('0x2e')][_0x9ebc('0x2f')]);_0xba923a[_0x9ebc('0x33')]=_[_0x9ebc('0x34')](_0x55b23f[_0x9ebc('0x33')]);_0xba923a[_0x9ebc('0x35')]=_[_0x9ebc('0x36')](_0xba923a[_0x9ebc('0x32')],_0xba923a['query']);_0x16fbed['attributes']=_[_0x9ebc('0x36')](_0xba923a[_0x9ebc('0x32')],qs[_0x9ebc('0x37')](_0x55b23f[_0x9ebc('0x33')][_0x9ebc('0x37')]));_0x16fbed[_0x9ebc('0x38')]=_0x16fbed[_0x9ebc('0x38')]['length']?_0x16fbed['attributes']:_0xba923a[_0x9ebc('0x32')];if(_0x55b23f['query'][_0x9ebc('0x43')]){_0x16fbed[_0x9ebc('0x44')]=[{'all':!![]}];}_0x16fbed=_[_0x9ebc('0x40')]({},_0x16fbed,_0x55b23f[_0x9ebc('0x42')]);return db[_0x9ebc('0x2e')][_0x9ebc('0x4a')](_0x16fbed)['then'](handleEntityNotFound(_0xb2ad84,null))[_0x9ebc('0x27')](respondWithResult(_0xb2ad84,null))[_0x9ebc('0x47')](handleError(_0xb2ad84,null));};exports[_0x9ebc('0x4b')]=function(_0x1aebd8,_0x1b34b3){return db[_0x9ebc('0x2e')][_0x9ebc('0x4b')](_0x1aebd8['body'],{})[_0x9ebc('0x27')](respondWithResult(_0x1b34b3,0xc9))[_0x9ebc('0x47')](handleError(_0x1b34b3,null));};exports['update']=function(_0x4caa4e,_0x30ffac){if(_0x4caa4e[_0x9ebc('0x4c')]['id']){delete _0x4caa4e['body']['id'];}return db[_0x9ebc('0x2e')][_0x9ebc('0x4a')]({'where':{'id':_0x4caa4e[_0x9ebc('0x49')]['id']}})[_0x9ebc('0x27')](handleEntityNotFound(_0x30ffac,null))['then'](saveUpdates(_0x4caa4e[_0x9ebc('0x4c')],null))['then'](respondWithResult(_0x30ffac,null))[_0x9ebc('0x47')](handleError(_0x30ffac,null));};exports[_0x9ebc('0x4d')]=function(_0x21feb9,_0xc10f02,_0x1cd8a8){var _0x5d024c=require(_0x9ebc('0x4e'));var _0x19e318=![];var _0x482802={};if(_0x21feb9['query'][_0x9ebc('0x30')]&&_0x21feb9[_0x9ebc('0x33')][_0x9ebc('0x30')]===_0x9ebc('0x4f')){_0x482802['uniqueid']=_0x21feb9['params']['id'];}else{_0x482802['id']=_0x21feb9[_0x9ebc('0x49')]['id'];}return db[_0x9ebc('0x2e')][_0x9ebc('0x4a')]({'where':_0x482802,'attributes':['id',_0x9ebc('0x50'),_0x9ebc('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0xc10f02,null))[_0x9ebc('0x27')](function(_0x2adf44){if(_0x2adf44){var _0x21a31f=_0x2adf44[_0x9ebc('0x50')];var _0x47ef9a=util[_0x9ebc('0x52')](_0x9ebc('0x53'),_0x21a31f);if(fs[_0x9ebc('0x54')](_0x47ef9a)){_0x19e318=!![];return _0x5d024c['decryptFile'](_0x47ef9a,_0x21a31f,config['secrets']['recording'])[_0x9ebc('0x27')](function(){return _0x2adf44;});}return _0x2adf44;}})[_0x9ebc('0x27')](function(_0x5bea25){if(_0x5bea25){var _0x41a705=_0x5bea25[_0x9ebc('0x50')];if(!fs['existsSync'](_0x41a705)){throw new db[(_0x9ebc('0x55'))][(_0x9ebc('0x56'))]('SquareRecording\x20not\x20found');}if(_0x5bea25[_0x9ebc('0x51')]){return _0xc10f02[_0x9ebc('0x4d')](_0x41a705,_0x5bea25[_0x9ebc('0x51')]+path[_0x9ebc('0x57')](_0x41a705),function(){if(_0x19e318){fs[_0x9ebc('0x58')](_0x41a705);}});}else{return _0xc10f02[_0x9ebc('0x4d')](_0x41a705,function(_0x4f3c26){if(_0x19e318){fs[_0x9ebc('0x58')](_0x41a705);}});}}})[_0x9ebc('0x47')](function(_0xcaee73){if(_0xcaee73[_0x9ebc('0x59')]===_0x9ebc('0x5a')){_0xc10f02[_0x9ebc('0x1c')](0x194)[_0x9ebc('0x2c')](_0x9ebc('0x5b'));}else{return handleError(_0xc10f02,null);}});};exports[_0x9ebc('0x26')]=function(_0x5bb6d3,_0x3e2b50){return db['SquareRecording'][_0x9ebc('0x4a')]({'where':{'id':_0x5bb6d3['params']['id']}})[_0x9ebc('0x27')](function(_0x2b5425){if(_[_0x9ebc('0x5c')](_0x2b5425)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2b5425;})[_0x9ebc('0x27')](function(_0x1c9246){var _0x10f267=_0x1c9246[_0x9ebc('0x50')];logger['info'](_0x9ebc('0x5d'),_0x10f267);if(!_[_0x9ebc('0x5c')](_0x1c9246['savePath'])&&fs['existsSync'](_0x10f267)){logger['info'](_0x9ebc('0x5e')+_0x10f267+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9ebc('0x5f')](_0x10f267);}_0x10f267=_0x10f267+'.cypher';if(!_[_0x9ebc('0x5c')](_0x1c9246['savePath'])&&fs[_0x9ebc('0x54')](_0x10f267)){logger[_0x9ebc('0x60')](_0x9ebc('0x5e')+_0x10f267+_0x9ebc('0x61'));fs[_0x9ebc('0x5f')](_0x10f267);}return _0x1c9246;})[_0x9ebc('0x27')](function(_0x78b2a2){if(!_0x78b2a2)throw new InternalError();return _0x78b2a2[_0x9ebc('0x26')]();})[_0x9ebc('0x27')](function(){_0x3e2b50[_0x9ebc('0x1c')](0xcc)[_0x9ebc('0x28')]();})[_0x9ebc('0x47')](handleError(_0x3e2b50,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 59d94e8..dacb8ed 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 _0x19fb=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings'];(function(_0x120668,_0x2d7fe9){var _0x5af2bf=function(_0x169b60){while(--_0x169b60){_0x120668['push'](_0x120668['shift']());}};_0x5af2bf(++_0x2d7fe9);}(_0x19fb,0xdd));var _0xb19f=function(_0x3b6fcf,_0x269442){_0x3b6fcf=_0x3b6fcf-0x0;var _0x586fa8=_0x19fb[_0x3b6fcf];return _0x586fa8;};'use strict';var _=require(_0xb19f('0x0'));var util=require(_0xb19f('0x1'));var logger=require(_0xb19f('0x2'))(_0xb19f('0x3'));var moment=require(_0xb19f('0x4'));var BPromise=require(_0xb19f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb19f('0x6'));var config=require(_0xb19f('0x7'));var attributes=require(_0xb19f('0x8'));module[_0xb19f('0x9')]=function(_0x3ca9c9,_0x4d8d6a){return _0x3ca9c9[_0xb19f('0xa')](_0xb19f('0xb'),attributes,{'tableName':_0xb19f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62f1=['square_recordings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0xaa7629,_0x219723){var _0x487c07=function(_0x36959c){while(--_0x36959c){_0xaa7629['push'](_0xaa7629['shift']());}};_0x487c07(++_0x219723);}(_0x62f1,0x112));var _0x162f=function(_0x446180,_0x1496bc){_0x446180=_0x446180-0x0;var _0x82d27f=_0x62f1[_0x446180];return _0x82d27f;};'use strict';var _=require(_0x162f('0x0'));var util=require('util');var logger=require(_0x162f('0x1'))(_0x162f('0x2'));var moment=require(_0x162f('0x3'));var BPromise=require(_0x162f('0x4'));var rp=require(_0x162f('0x5'));var fs=require('fs');var path=require(_0x162f('0x6'));var rimraf=require(_0x162f('0x7'));var config=require(_0x162f('0x8'));var attributes=require(_0x162f('0x9'));module[_0x162f('0xa')]=function(_0x4c8c54,_0x3caa89){return _0x4c8c54[_0x162f('0xb')]('SquareRecording',attributes,{'tableName':_0x162f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index c234ef7..285fa3b 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 _0x69ec=['code','message','info','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x46d6c9,_0x93aac4){var _0x54bc98=function(_0x181a0b){while(--_0x181a0b){_0x46d6c9['push'](_0x46d6c9['shift']());}};_0x54bc98(++_0x93aac4);}(_0x69ec,0x1cb));var _0xc69e=function(_0x36737f,_0x594f5a){_0x36737f=_0x36737f-0x0;var _0xf3887f=_0x69ec[_0x36737f];return _0xf3887f;};'use strict';var _=require(_0xc69e('0x0'));var util=require(_0xc69e('0x1'));var moment=require(_0xc69e('0x2'));var BPromise=require(_0xc69e('0x3'));var rs=require(_0xc69e('0x4'));var fs=require('fs');var Redis=require(_0xc69e('0x5'));var db=require(_0xc69e('0x6'))['db'];var utils=require(_0xc69e('0x7'));var logger=require('../../config/logger')(_0xc69e('0x8'));var config=require(_0xc69e('0x9'));var jayson=require(_0xc69e('0xa'));var client=jayson[_0xc69e('0xb')][_0xc69e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3519e0,_0x1bb322,_0x20ccdf){return new BPromise(function(_0x99f1cb,_0x1986e2){return client[_0xc69e('0xd')](_0x3519e0,_0x20ccdf)[_0xc69e('0xe')](function(_0x44dbb8){logger['info'](_0xc69e('0xf'),_0x1bb322,'request\x20sent');logger[_0xc69e('0x10')](_0xc69e('0x11'),_0x1bb322,_0xc69e('0x12'),JSON[_0xc69e('0x13')](_0x44dbb8));if(_0x44dbb8[_0xc69e('0x14')]){if(_0x44dbb8[_0xc69e('0x14')][_0xc69e('0x15')]===0x1f4){logger[_0xc69e('0x14')](_0xc69e('0xf'),_0x1bb322,_0x44dbb8[_0xc69e('0x14')][_0xc69e('0x16')]);return _0x1986e2(_0x44dbb8[_0xc69e('0x14')][_0xc69e('0x16')]);}logger[_0xc69e('0x14')]('SquareRecording,\x20%s,\x20%s',_0x1bb322,_0x44dbb8[_0xc69e('0x14')][_0xc69e('0x16')]);return _0x99f1cb(_0x44dbb8['error']['message']);}else{logger[_0xc69e('0x17')](_0xc69e('0xf'),_0x1bb322,'request\x20sent');_0x99f1cb(_0x44dbb8[_0xc69e('0x18')][_0xc69e('0x16')]);}})[_0xc69e('0x19')](function(_0x3e2246){logger[_0xc69e('0x14')](_0xc69e('0xf'),_0x1bb322,_0x3e2246);_0x1986e2(_0x3e2246);});});}exports[_0xc69e('0x1a')]=function(_0x215aeb){var _0x3fc114=this;return new Promise(function(_0x1b48d6,_0x295d87){return db[_0xc69e('0x1b')][_0xc69e('0x1c')](_0x215aeb[_0xc69e('0x1d')],{'raw':_0x215aeb['options']?_0x215aeb[_0xc69e('0x1e')][_0xc69e('0x1f')]===undefined?!![]:![]:!![]})[_0xc69e('0xe')](function(_0xf2ee8b){logger[_0xc69e('0x17')](_0xc69e('0x1a'),_0x215aeb);logger[_0xc69e('0x10')](_0xc69e('0x1a'),_0x215aeb,JSON[_0xc69e('0x13')](_0xf2ee8b));_0x1b48d6(_0xf2ee8b);})['catch'](function(_0x596eab){logger[_0xc69e('0x14')]('CreateSquareRecording',_0x596eab[_0xc69e('0x16')],_0x215aeb);_0x295d87(_0x3fc114[_0xc69e('0x14')](0x1f4,_0x596eab[_0xc69e('0x16')]));});});}; \ No newline at end of file +var _0x8ffc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording','create','options','util','moment','bluebird','randomstring','ioredis'];(function(_0x502e3b,_0x9d918a){var _0x4435c9=function(_0x4f130c){while(--_0x4f130c){_0x502e3b['push'](_0x502e3b['shift']());}};_0x4435c9(++_0x9d918a);}(_0x8ffc,0xc6));var _0xc8ff=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x8ffc[_0x9df060];return _0x338dfe;};'use strict';var _=require('lodash');var util=require(_0xc8ff('0x0'));var moment=require(_0xc8ff('0x1'));var BPromise=require(_0xc8ff('0x2'));var rs=require(_0xc8ff('0x3'));var fs=require('fs');var Redis=require(_0xc8ff('0x4'));var db=require(_0xc8ff('0x5'))['db'];var utils=require(_0xc8ff('0x6'));var logger=require(_0xc8ff('0x7'))(_0xc8ff('0x8'));var config=require(_0xc8ff('0x9'));var jayson=require(_0xc8ff('0xa'));var client=jayson[_0xc8ff('0xb')][_0xc8ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x318bb2,_0x50849f,_0xa02b28){return new BPromise(function(_0x211fd0,_0x454347){return client[_0xc8ff('0xd')](_0x318bb2,_0xa02b28)[_0xc8ff('0xe')](function(_0x43bfd2){logger[_0xc8ff('0xf')]('SquareRecording,\x20%s,\x20%s',_0x50849f,'request\x20sent');logger[_0xc8ff('0x10')](_0xc8ff('0x11'),_0x50849f,_0xc8ff('0x12'),JSON[_0xc8ff('0x13')](_0x43bfd2));if(_0x43bfd2[_0xc8ff('0x14')]){if(_0x43bfd2[_0xc8ff('0x14')][_0xc8ff('0x15')]===0x1f4){logger[_0xc8ff('0x14')]('SquareRecording,\x20%s,\x20%s',_0x50849f,_0x43bfd2[_0xc8ff('0x14')][_0xc8ff('0x16')]);return _0x454347(_0x43bfd2['error']['message']);}logger[_0xc8ff('0x14')](_0xc8ff('0x17'),_0x50849f,_0x43bfd2[_0xc8ff('0x14')]['message']);return _0x211fd0(_0x43bfd2['error']['message']);}else{logger[_0xc8ff('0xf')](_0xc8ff('0x17'),_0x50849f,_0xc8ff('0x12'));_0x211fd0(_0x43bfd2[_0xc8ff('0x18')]['message']);}})[_0xc8ff('0x19')](function(_0x4c3417){logger[_0xc8ff('0x14')](_0xc8ff('0x17'),_0x50849f,_0x4c3417);_0x454347(_0x4c3417);});});}exports[_0xc8ff('0x1a')]=function(_0x10402d){var _0x4670b9=this;return new Promise(function(_0x4c8f30,_0x19f11f){return db['SquareRecording'][_0xc8ff('0x1b')](_0x10402d['body'],{'raw':_0x10402d[_0xc8ff('0x1c')]?_0x10402d[_0xc8ff('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3e2034){logger[_0xc8ff('0xf')]('CreateSquareRecording',_0x10402d);logger['debug'](_0xc8ff('0x1a'),_0x10402d,JSON[_0xc8ff('0x13')](_0x3e2034));_0x4c8f30(_0x3e2034);})[_0xc8ff('0x19')](function(_0x3598dd){logger[_0xc8ff('0x14')](_0xc8ff('0x1a'),_0x3598dd[_0xc8ff('0x16')],_0x10402d);_0x19f11f(_0x4670b9[_0xc8ff('0x14')](0x1f4,_0x3598dd[_0xc8ff('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 5326841..641c55f 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(_0x32e164,_0x1317bb){var _0x401ba6=function(_0x50c6f6){while(--_0x50c6f6){_0x32e164['push'](_0x32e164['shift']());}};_0x401ba6(++_0x1317bb);}(_0xe706,0xa3));var _0x6e70=function(_0x38ead5,_0x5b4fa2){_0x38ead5=_0x38ead5-0x0;var _0x4e40bc=_0xe706[_0x38ead5];return _0x4e40bc;};'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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index b1d91a7..ca40793 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 _0x0d40=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x46e18a,_0x427e4d){var _0x1f516f=function(_0x132e84){while(--_0x132e84){_0x46e18a['push'](_0x46e18a['shift']());}};_0x1f516f(++_0x427e4d);}(_0x0d40,0x1ce));var _0x00d4=function(_0x890db7,_0x4dcf2c){_0x890db7=_0x890db7-0x0;var _0x46412=_0x0d40[_0x890db7];return _0x46412;};'use strict';var Sequelize=require(_0x00d4('0x0'));module[_0x00d4('0x1')]={'network':{'type':Sequelize[_0x00d4('0x2')]},'network_script':{'type':Sequelize[_0x00d4('0x2')]},'request':{'type':Sequelize[_0x00d4('0x2')]},'channel':{'type':Sequelize[_0x00d4('0x2')]},'language':{'type':Sequelize[_0x00d4('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x00d4('0x2')]},'version':{'type':Sequelize[_0x00d4('0x2')]},'callerid':{'type':Sequelize[_0x00d4('0x2')]},'calleridname':{'type':Sequelize[_0x00d4('0x2')]},'callingpres':{'type':Sequelize[_0x00d4('0x2')]},'callingani2':{'type':Sequelize[_0x00d4('0x2')]},'callington':{'type':Sequelize[_0x00d4('0x2')]},'callingtns':{'type':Sequelize[_0x00d4('0x2')]},'dnid':{'type':Sequelize[_0x00d4('0x2')]},'rdnis':{'type':Sequelize[_0x00d4('0x2')]},'context':{'type':Sequelize[_0x00d4('0x2')]},'extension':{'type':Sequelize[_0x00d4('0x2')]},'priority':{'type':Sequelize[_0x00d4('0x2')]},'enhanced':{'type':Sequelize[_0x00d4('0x2')]},'accountcode':{'type':Sequelize[_0x00d4('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x00d4('0x2')]},'joinAt':{'type':Sequelize[_0x00d4('0x3')]},'leaveAt':{'type':Sequelize[_0x00d4('0x3')]},'bot':{'type':Sequelize[_0x00d4('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x412e=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x412e,0x19e));var _0xe412=function(_0x49cb92,_0x3c31a6){_0x49cb92=_0x49cb92-0x0;var _0x16ee5a=_0x412e[_0x49cb92];return _0x16ee5a;};'use strict';var Sequelize=require(_0xe412('0x0'));module[_0xe412('0x1')]={'network':{'type':Sequelize[_0xe412('0x2')]},'network_script':{'type':Sequelize[_0xe412('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe412('0x2')]},'language':{'type':Sequelize[_0xe412('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe412('0x2')]},'calleridname':{'type':Sequelize[_0xe412('0x2')]},'callingpres':{'type':Sequelize[_0xe412('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xe412('0x2')]},'callingtns':{'type':Sequelize[_0xe412('0x2')]},'dnid':{'type':Sequelize[_0xe412('0x2')]},'rdnis':{'type':Sequelize[_0xe412('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe412('0x2')]},'priority':{'type':Sequelize[_0xe412('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xe412('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe412('0x3')]},'leaveAt':{'type':Sequelize[_0xe412('0x3')]},'bot':{'type':Sequelize[_0xe412('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index bfc3b5f..d50c7db 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 _0xf6e6=['params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show'];(function(_0x12a06b,_0x417b51){var _0x5d0bb8=function(_0x41d3d0){while(--_0x41d3d0){_0x12a06b['push'](_0x12a06b['shift']());}};_0x5d0bb8(++_0x417b51);}(_0xf6e6,0xe0));var _0x6f6e=function(_0x1bf0f0,_0x38daa1){_0x1bf0f0=_0x1bf0f0-0x0;var _0x3087cb=_0xf6e6[_0x1bf0f0];return _0x3087cb;};'use strict';var emlformat=require(_0x6f6e('0x0'));var rimraf=require(_0x6f6e('0x1'));var zipdir=require(_0x6f6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f6e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6f6e('0x4'));var util=require(_0x6f6e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6f6e('0x6'));var ejs=require(_0x6f6e('0x7'));var fs=require('fs');var fs_extra=require(_0x6f6e('0x8'));var _=require('lodash');var squel=require(_0x6f6e('0x9'));var crypto=require(_0x6f6e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6f6e('0xb'));var Papa=require(_0x6f6e('0xc'));var Redis=require('ioredis');var authService=require(_0x6f6e('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f6e('0xe'));var logger=require(_0x6f6e('0xf'))(_0x6f6e('0x10'));var utils=require(_0x6f6e('0x11'));var config=require(_0x6f6e('0x12'));var licenseUtil=require(_0x6f6e('0x13'));var db=require(_0x6f6e('0x14'))['db'];function respondWithStatusCode(_0x405018,_0x3df85f){_0x3df85f=_0x3df85f||0xcc;return function(_0x28a3cf){if(_0x28a3cf){return _0x405018[_0x6f6e('0x15')](_0x3df85f);}return _0x405018['status'](_0x3df85f)[_0x6f6e('0x16')]();};}function respondWithResult(_0x1c700f,_0x89d3bd){_0x89d3bd=_0x89d3bd||0xc8;return function(_0x22e555){if(_0x22e555){return _0x1c700f[_0x6f6e('0x17')](_0x89d3bd)[_0x6f6e('0x18')](_0x22e555);}};}function respondWithFilteredResult(_0x1ece1a,_0x1ae648){return function(_0x46f9f6){if(_0x46f9f6){var _0x5c77e7=typeof _0x1ae648[_0x6f6e('0x19')]===_0x6f6e('0x1a')&&typeof _0x1ae648[_0x6f6e('0x1b')]===_0x6f6e('0x1a');var _0x2225c3=_0x46f9f6['count'];var _0x1bc8db=_0x5c77e7?0x0:_0x1ae648[_0x6f6e('0x19')];var _0x3a6f46=_0x5c77e7?_0x46f9f6['count']:_0x1ae648[_0x6f6e('0x19')]+_0x1ae648[_0x6f6e('0x1b')];var _0x2abca1;if(_0x3a6f46>=_0x2225c3){_0x3a6f46=_0x2225c3;_0x2abca1=0xc8;}else{_0x2abca1=0xce;}_0x1ece1a[_0x6f6e('0x17')](_0x2abca1);return _0x1ece1a[_0x6f6e('0x1c')](_0x6f6e('0x1d'),_0x1bc8db+'-'+_0x3a6f46+'/'+_0x2225c3)[_0x6f6e('0x18')](_0x46f9f6);}return null;};}function patchUpdates(_0x5cfc2d){return function(_0x5533e4){try{jsonpatch[_0x6f6e('0x1e')](_0x5533e4,_0x5cfc2d,!![]);}catch(_0x151d37){return BPromise[_0x6f6e('0x1f')](_0x151d37);}return _0x5533e4[_0x6f6e('0x20')]();};}function saveUpdates(_0x50f3eb,_0x23ab07){return function(_0x5e6888){if(_0x5e6888){return _0x5e6888[_0x6f6e('0x21')](_0x50f3eb)[_0x6f6e('0x22')](function(_0x9c5d79){return _0x9c5d79;});}return null;};}function removeEntity(_0x3d8ef7,_0x4bbdf8){return function(_0x1b7e9a){if(_0x1b7e9a){return _0x1b7e9a[_0x6f6e('0x23')]()['then'](function(){_0x3d8ef7[_0x6f6e('0x17')](0xcc)[_0x6f6e('0x16')]();});}};}function handleEntityNotFound(_0x2c4ca8,_0xdbdd9c){return function(_0x5acb6f){if(!_0x5acb6f){_0x2c4ca8[_0x6f6e('0x15')](0x194);}return _0x5acb6f;};}function handleError(_0x58c605,_0x530eb7){_0x530eb7=_0x530eb7||0x1f4;return function(_0x528946){logger[_0x6f6e('0x24')](_0x528946[_0x6f6e('0x25')]);if(_0x528946[_0x6f6e('0x26')]){delete _0x528946[_0x6f6e('0x26')];}_0x58c605[_0x6f6e('0x17')](_0x530eb7)[_0x6f6e('0x27')](_0x528946);};}exports[_0x6f6e('0x28')]=function(_0x39df73,_0x2f3bb1){var _0x54cba7={},_0x12e5c3={},_0x12907f={'count':0x0,'rows':[]};var _0x79f118=_[_0x6f6e('0x29')](db[_0x6f6e('0x2a')][_0x6f6e('0x2b')],function(_0x56c861){return{'name':_0x56c861['fieldName'],'type':_0x56c861['type']['key']};});_0x12e5c3[_0x6f6e('0x2c')]=_[_0x6f6e('0x29')](_0x79f118,_0x6f6e('0x26'));_0x12e5c3['query']=_[_0x6f6e('0x2d')](_0x39df73['query']);_0x12e5c3[_0x6f6e('0x2e')]=_[_0x6f6e('0x2f')](_0x12e5c3[_0x6f6e('0x2c')],_0x12e5c3['query']);_0x54cba7[_0x6f6e('0x30')]=_[_0x6f6e('0x2f')](_0x12e5c3['model'],qs[_0x6f6e('0x31')](_0x39df73[_0x6f6e('0x32')][_0x6f6e('0x31')]));_0x54cba7[_0x6f6e('0x30')]=_0x54cba7[_0x6f6e('0x30')][_0x6f6e('0x33')]?_0x54cba7[_0x6f6e('0x30')]:_0x12e5c3['model'];if(!_0x39df73[_0x6f6e('0x32')][_0x6f6e('0x34')](_0x6f6e('0x35'))){_0x54cba7[_0x6f6e('0x1b')]=qs['limit'](_0x39df73[_0x6f6e('0x32')][_0x6f6e('0x1b')]);_0x54cba7['offset']=qs[_0x6f6e('0x19')](_0x39df73['query'][_0x6f6e('0x19')]);}_0x54cba7['order']=qs[_0x6f6e('0x36')](_0x39df73['query'][_0x6f6e('0x36')]);_0x54cba7[_0x6f6e('0x37')]=qs[_0x6f6e('0x2e')](_['pick'](_0x39df73[_0x6f6e('0x32')],_0x12e5c3[_0x6f6e('0x2e')]),_0x79f118);if(_0x39df73['query'][_0x6f6e('0x38')]){_0x54cba7[_0x6f6e('0x37')]=_[_0x6f6e('0x39')](_0x54cba7[_0x6f6e('0x37')],{'$or':_['map'](_0x79f118,function(_0x2ff5a3){if(_0x2ff5a3[_0x6f6e('0x3a')]!==_0x6f6e('0x3b')){var _0x1f6ad6={};_0x1f6ad6[_0x2ff5a3[_0x6f6e('0x26')]]={'$like':'%'+_0x39df73[_0x6f6e('0x32')][_0x6f6e('0x38')]+'%'};return _0x1f6ad6;}})});}_0x54cba7=_[_0x6f6e('0x39')]({},_0x54cba7,_0x39df73[_0x6f6e('0x3c')]);var _0x5a2283={'where':_0x54cba7[_0x6f6e('0x37')]};return db[_0x6f6e('0x2a')][_0x6f6e('0x3d')](_0x5a2283)[_0x6f6e('0x22')](function(_0x1c7694){_0x12907f[_0x6f6e('0x3d')]=_0x1c7694;if(_0x39df73[_0x6f6e('0x32')][_0x6f6e('0x3e')]){_0x54cba7[_0x6f6e('0x3f')]=[{'all':!![]}];}return db[_0x6f6e('0x2a')][_0x6f6e('0x40')](_0x54cba7);})['then'](function(_0x180abc){_0x12907f[_0x6f6e('0x41')]=_0x180abc;return _0x12907f;})[_0x6f6e('0x22')](respondWithFilteredResult(_0x2f3bb1,_0x54cba7))[_0x6f6e('0x42')](handleError(_0x2f3bb1,null));};exports[_0x6f6e('0x43')]=function(_0x56786f,_0x2ebce1){var _0x8c224d={'raw':!![],'where':{'id':_0x56786f[_0x6f6e('0x44')]['id']}},_0x301486={};_0x301486[_0x6f6e('0x2c')]=_[_0x6f6e('0x2d')](db['SquareReport']['rawAttributes']);_0x301486[_0x6f6e('0x32')]=_[_0x6f6e('0x2d')](_0x56786f[_0x6f6e('0x32')]);_0x301486['filters']=_[_0x6f6e('0x2f')](_0x301486['model'],_0x301486['query']);_0x8c224d[_0x6f6e('0x30')]=_[_0x6f6e('0x2f')](_0x301486[_0x6f6e('0x2c')],qs[_0x6f6e('0x31')](_0x56786f[_0x6f6e('0x32')]['fields']));_0x8c224d[_0x6f6e('0x30')]=_0x8c224d[_0x6f6e('0x30')][_0x6f6e('0x33')]?_0x8c224d[_0x6f6e('0x30')]:_0x301486[_0x6f6e('0x2c')];if(_0x56786f[_0x6f6e('0x32')][_0x6f6e('0x3e')]){_0x8c224d[_0x6f6e('0x3f')]=[{'all':!![]}];}_0x8c224d=_[_0x6f6e('0x39')]({},_0x8c224d,_0x56786f['options']);return db[_0x6f6e('0x2a')][_0x6f6e('0x45')](_0x8c224d)[_0x6f6e('0x22')](handleEntityNotFound(_0x2ebce1,null))[_0x6f6e('0x22')](respondWithResult(_0x2ebce1,null))['catch'](handleError(_0x2ebce1,null));};exports[_0x6f6e('0x46')]=function(_0x4399c7,_0x48dcec){return db['SquareReport']['create'](_0x4399c7[_0x6f6e('0x47')],{})[_0x6f6e('0x22')](respondWithResult(_0x48dcec,0xc9))['catch'](handleError(_0x48dcec,null));};exports['update']=function(_0xa0de08,_0x596690){if(_0xa0de08[_0x6f6e('0x47')]['id']){delete _0xa0de08[_0x6f6e('0x47')]['id'];}return db[_0x6f6e('0x2a')][_0x6f6e('0x45')]({'where':{'id':_0xa0de08[_0x6f6e('0x44')]['id']}})[_0x6f6e('0x22')](handleEntityNotFound(_0x596690,null))[_0x6f6e('0x22')](saveUpdates(_0xa0de08[_0x6f6e('0x47')],null))[_0x6f6e('0x22')](respondWithResult(_0x596690,null))[_0x6f6e('0x42')](handleError(_0x596690,null));};exports[_0x6f6e('0x23')]=function(_0x1ef4c0,_0x5590a7){return db[_0x6f6e('0x2a')]['find']({'where':{'id':_0x1ef4c0[_0x6f6e('0x44')]['id']}})[_0x6f6e('0x22')](handleEntityNotFound(_0x5590a7,null))['then'](removeEntity(_0x5590a7,null))[_0x6f6e('0x42')](handleError(_0x5590a7,null));};exports[_0x6f6e('0x48')]=function(_0x3d8dd7,_0xff0517){return db[_0x6f6e('0x2a')][_0x6f6e('0x48')]()[_0x6f6e('0x22')](respondWithResult(_0xff0517,null))[_0x6f6e('0x42')](handleError(_0xff0517,null));}; \ No newline at end of file +var _0x1257=['index','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','SquareReport','includeAll','include','rows','show','keys','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send'];(function(_0x754154,_0x2e7ee5){var _0x54d733=function(_0x3c3f39){while(--_0x3c3f39){_0x754154['push'](_0x754154['shift']());}};_0x54d733(++_0x2e7ee5);}(_0x1257,0x67));var _0x7125=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x1257[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x7125('0x0'));var rimraf=require(_0x7125('0x1'));var zipdir=require(_0x7125('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7125('0x3'));var moment=require(_0x7125('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7125('0x5'));var path=require(_0x7125('0x6'));var sox=require(_0x7125('0x7'));var csv=require('to-csv');var ejs=require(_0x7125('0x8'));var fs=require('fs');var fs_extra=require(_0x7125('0x9'));var _=require(_0x7125('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7125('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7125('0xc'));var Papa=require(_0x7125('0xd'));var Redis=require(_0x7125('0xe'));var authService=require(_0x7125('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7125('0x10'))(_0x7125('0x11'));var utils=require(_0x7125('0x12'));var config=require(_0x7125('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7125('0x14'))['db'];function respondWithStatusCode(_0xcf8df2,_0x37af23){_0x37af23=_0x37af23||0xcc;return function(_0x156d7e){if(_0x156d7e){return _0xcf8df2['sendStatus'](_0x37af23);}return _0xcf8df2[_0x7125('0x15')](_0x37af23)[_0x7125('0x16')]();};}function respondWithResult(_0x514423,_0x266f95){_0x266f95=_0x266f95||0xc8;return function(_0x5541d5){if(_0x5541d5){return _0x514423['status'](_0x266f95)['json'](_0x5541d5);}};}function respondWithFilteredResult(_0x1ed839,_0x5ab4bd){return function(_0xca5bbf){if(_0xca5bbf){var _0xe38bd9=typeof _0x5ab4bd[_0x7125('0x17')]===_0x7125('0x18')&&typeof _0x5ab4bd[_0x7125('0x19')]===_0x7125('0x18');var _0x5cd279=_0xca5bbf['count'];var _0x474f43=_0xe38bd9?0x0:_0x5ab4bd[_0x7125('0x17')];var _0x31d9c6=_0xe38bd9?_0xca5bbf[_0x7125('0x1a')]:_0x5ab4bd[_0x7125('0x17')]+_0x5ab4bd[_0x7125('0x19')];var _0x549801;if(_0x31d9c6>=_0x5cd279){_0x31d9c6=_0x5cd279;_0x549801=0xc8;}else{_0x549801=0xce;}_0x1ed839[_0x7125('0x15')](_0x549801);return _0x1ed839[_0x7125('0x1b')]('Content-Range',_0x474f43+'-'+_0x31d9c6+'/'+_0x5cd279)[_0x7125('0x1c')](_0xca5bbf);}return null;};}function patchUpdates(_0x30be88){return function(_0x551dbc){try{jsonpatch[_0x7125('0x1d')](_0x551dbc,_0x30be88,!![]);}catch(_0x340981){return BPromise[_0x7125('0x1e')](_0x340981);}return _0x551dbc[_0x7125('0x1f')]();};}function saveUpdates(_0x443cb2,_0x51222a){return function(_0x542087){if(_0x542087){return _0x542087[_0x7125('0x20')](_0x443cb2)[_0x7125('0x21')](function(_0x452f5a){return _0x452f5a;});}return null;};}function removeEntity(_0x2c7f52,_0x31ef21){return function(_0xdff260){if(_0xdff260){return _0xdff260[_0x7125('0x22')]()[_0x7125('0x21')](function(){_0x2c7f52[_0x7125('0x15')](0xcc)[_0x7125('0x16')]();});}};}function handleEntityNotFound(_0x21758f,_0x4a5547){return function(_0x44ae6e){if(!_0x44ae6e){_0x21758f[_0x7125('0x23')](0x194);}return _0x44ae6e;};}function handleError(_0xd1d1c8,_0x3c1ca0){_0x3c1ca0=_0x3c1ca0||0x1f4;return function(_0x385720){logger[_0x7125('0x24')](_0x385720['stack']);if(_0x385720[_0x7125('0x25')]){delete _0x385720[_0x7125('0x25')];}_0xd1d1c8[_0x7125('0x15')](_0x3c1ca0)[_0x7125('0x26')](_0x385720);};}exports[_0x7125('0x27')]=function(_0x3b753c,_0x4cf8dd){var _0x2465cf={},_0x503530={},_0x110298={'count':0x0,'rows':[]};var _0x4923f7=_['map'](db['SquareReport']['rawAttributes'],function(_0x4b30da){return{'name':_0x4b30da['fieldName'],'type':_0x4b30da[_0x7125('0x28')][_0x7125('0x29')]};});_0x503530[_0x7125('0x2a')]=_['map'](_0x4923f7,'name');_0x503530['query']=_['keys'](_0x3b753c[_0x7125('0x2b')]);_0x503530[_0x7125('0x2c')]=_[_0x7125('0x2d')](_0x503530[_0x7125('0x2a')],_0x503530[_0x7125('0x2b')]);_0x2465cf[_0x7125('0x2e')]=_[_0x7125('0x2d')](_0x503530[_0x7125('0x2a')],qs['fields'](_0x3b753c[_0x7125('0x2b')][_0x7125('0x2f')]));_0x2465cf[_0x7125('0x2e')]=_0x2465cf[_0x7125('0x2e')][_0x7125('0x30')]?_0x2465cf[_0x7125('0x2e')]:_0x503530[_0x7125('0x2a')];if(!_0x3b753c[_0x7125('0x2b')]['hasOwnProperty'](_0x7125('0x31'))){_0x2465cf[_0x7125('0x19')]=qs[_0x7125('0x19')](_0x3b753c[_0x7125('0x2b')][_0x7125('0x19')]);_0x2465cf['offset']=qs[_0x7125('0x17')](_0x3b753c[_0x7125('0x2b')]['offset']);}_0x2465cf[_0x7125('0x32')]=qs[_0x7125('0x33')](_0x3b753c['query'][_0x7125('0x33')]);_0x2465cf[_0x7125('0x34')]=qs[_0x7125('0x2c')](_[_0x7125('0x35')](_0x3b753c[_0x7125('0x2b')],_0x503530[_0x7125('0x2c')]),_0x4923f7);if(_0x3b753c['query'][_0x7125('0x36')]){_0x2465cf['where']=_['merge'](_0x2465cf['where'],{'$or':_[_0x7125('0x37')](_0x4923f7,function(_0x47d713){if(_0x47d713[_0x7125('0x28')]!==_0x7125('0x38')){var _0x1c9994={};_0x1c9994[_0x47d713[_0x7125('0x25')]]={'$like':'%'+_0x3b753c['query']['filter']+'%'};return _0x1c9994;}})});}_0x2465cf=_[_0x7125('0x39')]({},_0x2465cf,_0x3b753c[_0x7125('0x3a')]);var _0x1c7449={'where':_0x2465cf[_0x7125('0x34')]};return db[_0x7125('0x3b')][_0x7125('0x1a')](_0x1c7449)[_0x7125('0x21')](function(_0x2d35a9){_0x110298[_0x7125('0x1a')]=_0x2d35a9;if(_0x3b753c[_0x7125('0x2b')][_0x7125('0x3c')]){_0x2465cf[_0x7125('0x3d')]=[{'all':!![]}];}return db[_0x7125('0x3b')]['findAll'](_0x2465cf);})[_0x7125('0x21')](function(_0x38f3a5){_0x110298[_0x7125('0x3e')]=_0x38f3a5;return _0x110298;})[_0x7125('0x21')](respondWithFilteredResult(_0x4cf8dd,_0x2465cf))['catch'](handleError(_0x4cf8dd,null));};exports[_0x7125('0x3f')]=function(_0x105f7f,_0x74b4b6){var _0x472334={'raw':!![],'where':{'id':_0x105f7f['params']['id']}},_0x529177={};_0x529177[_0x7125('0x2a')]=_[_0x7125('0x40')](db[_0x7125('0x3b')][_0x7125('0x41')]);_0x529177['query']=_[_0x7125('0x40')](_0x105f7f['query']);_0x529177[_0x7125('0x2c')]=_[_0x7125('0x2d')](_0x529177[_0x7125('0x2a')],_0x529177[_0x7125('0x2b')]);_0x472334[_0x7125('0x2e')]=_['intersection'](_0x529177[_0x7125('0x2a')],qs['fields'](_0x105f7f[_0x7125('0x2b')][_0x7125('0x2f')]));_0x472334[_0x7125('0x2e')]=_0x472334[_0x7125('0x2e')][_0x7125('0x30')]?_0x472334['attributes']:_0x529177['model'];if(_0x105f7f[_0x7125('0x2b')]['includeAll']){_0x472334[_0x7125('0x3d')]=[{'all':!![]}];}_0x472334=_[_0x7125('0x39')]({},_0x472334,_0x105f7f['options']);return db['SquareReport']['find'](_0x472334)[_0x7125('0x21')](handleEntityNotFound(_0x74b4b6,null))[_0x7125('0x21')](respondWithResult(_0x74b4b6,null))[_0x7125('0x42')](handleError(_0x74b4b6,null));};exports[_0x7125('0x43')]=function(_0x447325,_0x152642){return db[_0x7125('0x3b')]['create'](_0x447325[_0x7125('0x44')],{})[_0x7125('0x21')](respondWithResult(_0x152642,0xc9))['catch'](handleError(_0x152642,null));};exports[_0x7125('0x20')]=function(_0x56147e,_0x38685f){if(_0x56147e['body']['id']){delete _0x56147e[_0x7125('0x44')]['id'];}return db['SquareReport'][_0x7125('0x45')]({'where':{'id':_0x56147e['params']['id']}})['then'](handleEntityNotFound(_0x38685f,null))['then'](saveUpdates(_0x56147e[_0x7125('0x44')],null))[_0x7125('0x21')](respondWithResult(_0x38685f,null))['catch'](handleError(_0x38685f,null));};exports[_0x7125('0x22')]=function(_0x19ef85,_0x5ec45f){return db[_0x7125('0x3b')]['find']({'where':{'id':_0x19ef85['params']['id']}})[_0x7125('0x21')](handleEntityNotFound(_0x5ec45f,null))['then'](removeEntity(_0x5ec45f,null))['catch'](handleError(_0x5ec45f,null));};exports[_0x7125('0x46')]=function(_0x2977cf,_0x41b051){return db['SquareReport']['describe']()['then'](respondWithResult(_0x41b051,null))[_0x7125('0x42')](handleError(_0x41b051,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 7456670..35b3c54 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 _0xe8bc=['exports','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','api','moment','bluebird','request-promise','rimraf','./squareReport.attributes'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe8bc,0x1c6));var _0xce8b=function(_0x5d11d0,_0x1ddadb){_0x5d11d0=_0x5d11d0-0x0;var _0x39cf6d=_0xe8bc[_0x5d11d0];return _0x39cf6d;};'use strict';var _=require(_0xce8b('0x0'));var util=require(_0xce8b('0x1'));var logger=require('../../config/logger')(_0xce8b('0x2'));var moment=require(_0xce8b('0x3'));var BPromise=require(_0xce8b('0x4'));var rp=require(_0xce8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce8b('0x6'));var config=require('../../config/environment');var attributes=require(_0xce8b('0x7'));module[_0xce8b('0x8')]=function(_0x2ed6e5,_0x102690){return _0x2ed6e5['define'](_0xce8b('0x9'),attributes,{'tableName':_0xce8b('0xa'),'paranoid':![],'indexes':[{'name':_0xce8b('0xb'),'fields':[_0xce8b('0xc'),'project_name']},{'name':_0xce8b('0xd'),'fields':[_0xce8b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb001=['../../config/environment','exports','define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','../../config/logger','bluebird','path','rimraf'];(function(_0x414810,_0x5e924d){var _0x2d4df5=function(_0x390860){while(--_0x390860){_0x414810['push'](_0x414810['shift']());}};_0x2d4df5(++_0x5e924d);}(_0xb001,0x181));var _0x1b00=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb001[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x1b00('0x0'));var util=require('util');var logger=require(_0x1b00('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b00('0x3'));var rimraf=require(_0x1b00('0x4'));var config=require(_0x1b00('0x5'));var attributes=require('./squareReport.attributes');module[_0x1b00('0x6')]=function(_0x508f66,_0x465b0a){return _0x508f66[_0x1b00('0x7')](_0x1b00('0x8'),attributes,{'tableName':_0x1b00('0x9'),'paranoid':![],'indexes':[{'name':_0x1b00('0xa'),'fields':[_0x1b00('0xb'),'project_name']},{'name':_0x1b00('0xc'),'fields':[_0x1b00('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 87ad83f..380b3ec 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 _0x0c45=['result','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x0c45,0x1db));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x50c4('0x0'));var BPromise=require(_0x50c4('0x1'));var rs=require(_0x50c4('0x2'));var fs=require('fs');var Redis=require(_0x50c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x50c4('0x4'));var logger=require(_0x50c4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x50c4('0x6'));var client=jayson[_0x50c4('0x7')][_0x50c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x573ef1,_0x25a403,_0x175a84){return new BPromise(function(_0x1c25b8,_0x412647){return client[_0x50c4('0x9')](_0x573ef1,_0x175a84)[_0x50c4('0xa')](function(_0x4fc585){logger[_0x50c4('0xb')](_0x50c4('0xc'),_0x25a403,_0x50c4('0xd'));logger[_0x50c4('0xe')](_0x50c4('0xf'),_0x25a403,_0x50c4('0xd'),JSON[_0x50c4('0x10')](_0x4fc585));if(_0x4fc585[_0x50c4('0x11')]){if(_0x4fc585[_0x50c4('0x11')][_0x50c4('0x12')]===0x1f4){logger[_0x50c4('0x11')]('SquareReport,\x20%s,\x20%s',_0x25a403,_0x4fc585[_0x50c4('0x11')][_0x50c4('0x13')]);return _0x412647(_0x4fc585[_0x50c4('0x11')][_0x50c4('0x13')]);}logger[_0x50c4('0x11')](_0x50c4('0xc'),_0x25a403,_0x4fc585['error'][_0x50c4('0x13')]);return _0x1c25b8(_0x4fc585[_0x50c4('0x11')][_0x50c4('0x13')]);}else{logger[_0x50c4('0xb')](_0x50c4('0xc'),_0x25a403,_0x50c4('0xd'));_0x1c25b8(_0x4fc585[_0x50c4('0x14')][_0x50c4('0x13')]);}})['catch'](function(_0x2dfd0a){logger[_0x50c4('0x11')](_0x50c4('0xc'),_0x25a403,_0x2dfd0a);_0x412647(_0x2dfd0a);});});}exports[_0x50c4('0x15')]=function(_0x1c1467){var _0x4c41a4=this;return new Promise(function(_0x1f5ab6,_0x32f601){return db[_0x50c4('0x16')][_0x50c4('0x17')](_0x1c1467[_0x50c4('0x18')],{'raw':_0x1c1467[_0x50c4('0x19')]?_0x1c1467['options'][_0x50c4('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5e69b0){logger[_0x50c4('0xb')](_0x50c4('0x15'),_0x1c1467);logger[_0x50c4('0xe')](_0x50c4('0x15'),_0x1c1467,JSON[_0x50c4('0x10')](_0x5e69b0));_0x1f5ab6(_0x5e69b0);})[_0x50c4('0x1b')](function(_0x43921f){logger[_0x50c4('0x11')]('CreateSquareReport',_0x43921f[_0x50c4('0x13')],_0x1c1467);_0x32f601(_0x4c41a4[_0x50c4('0x11')](0x1f4,_0x43921f[_0x50c4('0x13')]));});});};exports[_0x50c4('0x1c')]=function(_0x30fb7a){var _0xf3e950=this;return new Promise(function(_0x6ca5fe,_0x116915){return db[_0x50c4('0x16')][_0x50c4('0x1d')](_0x30fb7a[_0x50c4('0x18')],{'raw':_0x30fb7a[_0x50c4('0x19')]?_0x30fb7a[_0x50c4('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30fb7a[_0x50c4('0x19')]?_0x30fb7a[_0x50c4('0x19')][_0x50c4('0x1e')]||null:null,'attributes':_0x30fb7a[_0x50c4('0x19')]?_0x30fb7a[_0x50c4('0x19')][_0x50c4('0x1f')]||null:null,'limit':_0x30fb7a[_0x50c4('0x19')]?_0x30fb7a[_0x50c4('0x19')][_0x50c4('0x20')]||null:null})[_0x50c4('0xa')](function(_0x61a72e){logger[_0x50c4('0xb')]('UpdateSquareReport',_0x30fb7a);logger[_0x50c4('0xe')](_0x50c4('0x1c'),_0x30fb7a,JSON[_0x50c4('0x10')](_0x61a72e));_0x6ca5fe(_0x61a72e);})['catch'](function(_0x59db4d){logger[_0x50c4('0x11')](_0x50c4('0x1c'),_0x59db4d[_0x50c4('0x13')],_0x30fb7a);_0x116915(_0xf3e950[_0x50c4('0x11')](0x1f4,_0x59db4d[_0x50c4('0x13')]));});});}; \ No newline at end of file +var _0x70e8=['UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareReport,\x20%s,\x20%s','catch','CreateSquareReport','SquareReport','create','body','options','then','update','raw','where','attributes','limit'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x70e8,0x18d));var _0x870e=function(_0x416b59,_0x5061c2){_0x416b59=_0x416b59-0x0;var _0x53f95b=_0x70e8[_0x416b59];return _0x53f95b;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var moment=require(_0x870e('0x2'));var BPromise=require(_0x870e('0x3'));var rs=require(_0x870e('0x4'));var fs=require('fs');var Redis=require(_0x870e('0x5'));var db=require(_0x870e('0x6'))['db'];var utils=require(_0x870e('0x7'));var logger=require(_0x870e('0x8'))(_0x870e('0x9'));var config=require(_0x870e('0xa'));var jayson=require(_0x870e('0xb'));var client=jayson[_0x870e('0xc')][_0x870e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33cde0,_0x5ce9ae,_0x178544){return new BPromise(function(_0x257116,_0x1944c5){return client[_0x870e('0xe')](_0x33cde0,_0x178544)['then'](function(_0x50c422){logger[_0x870e('0xf')]('SquareReport,\x20%s,\x20%s',_0x5ce9ae,_0x870e('0x10'));logger[_0x870e('0x11')](_0x870e('0x12'),_0x5ce9ae,_0x870e('0x10'),JSON[_0x870e('0x13')](_0x50c422));if(_0x50c422[_0x870e('0x14')]){if(_0x50c422[_0x870e('0x14')]['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x5ce9ae,_0x50c422[_0x870e('0x14')][_0x870e('0x15')]);return _0x1944c5(_0x50c422[_0x870e('0x14')]['message']);}logger[_0x870e('0x14')](_0x870e('0x16'),_0x5ce9ae,_0x50c422[_0x870e('0x14')]['message']);return _0x257116(_0x50c422[_0x870e('0x14')][_0x870e('0x15')]);}else{logger[_0x870e('0xf')](_0x870e('0x16'),_0x5ce9ae,_0x870e('0x10'));_0x257116(_0x50c422['result'][_0x870e('0x15')]);}})[_0x870e('0x17')](function(_0xe904e2){logger['error'](_0x870e('0x16'),_0x5ce9ae,_0xe904e2);_0x1944c5(_0xe904e2);});});}exports[_0x870e('0x18')]=function(_0x258ac7){var _0x4901f9=this;return new Promise(function(_0xa7d604,_0x18e106){return db[_0x870e('0x19')][_0x870e('0x1a')](_0x258ac7[_0x870e('0x1b')],{'raw':_0x258ac7[_0x870e('0x1c')]?_0x258ac7[_0x870e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x870e('0x1d')](function(_0x364d52){logger[_0x870e('0xf')](_0x870e('0x18'),_0x258ac7);logger['debug']('CreateSquareReport',_0x258ac7,JSON[_0x870e('0x13')](_0x364d52));_0xa7d604(_0x364d52);})[_0x870e('0x17')](function(_0x1662b6){logger['error'](_0x870e('0x18'),_0x1662b6['message'],_0x258ac7);_0x18e106(_0x4901f9[_0x870e('0x14')](0x1f4,_0x1662b6[_0x870e('0x15')]));});});};exports['UpdateSquareReport']=function(_0x252357){var _0x1b551a=this;return new Promise(function(_0x554748,_0x1907e5){return db[_0x870e('0x19')][_0x870e('0x1e')](_0x252357[_0x870e('0x1b')],{'raw':_0x252357[_0x870e('0x1c')]?_0x252357[_0x870e('0x1c')][_0x870e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x252357[_0x870e('0x1c')]?_0x252357[_0x870e('0x1c')][_0x870e('0x20')]||null:null,'attributes':_0x252357[_0x870e('0x1c')]?_0x252357[_0x870e('0x1c')][_0x870e('0x21')]||null:null,'limit':_0x252357['options']?_0x252357[_0x870e('0x1c')][_0x870e('0x22')]||null:null})['then'](function(_0x1c56a8){logger['info']('UpdateSquareReport',_0x252357);logger[_0x870e('0x11')](_0x870e('0x23'),_0x252357,JSON['stringify'](_0x1c56a8));_0x554748(_0x1c56a8);})[_0x870e('0x17')](function(_0x1dc473){logger[_0x870e('0x14')]('UpdateSquareReport',_0x1dc473['message'],_0x252357);_0x1907e5(_0x1b551a['error'](0x1f4,_0x1dc473['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 96ddd62..5681344 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 _0xdc1f=['/describe','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated'];(function(_0xaca348,_0x4d3993){var _0x560057=function(_0x41e145){while(--_0x41e145){_0xaca348['push'](_0xaca348['shift']());}};_0x560057(++_0x4d3993);}(_0xdc1f,0x8d));var _0xfdc1=function(_0x3fec2c,_0x3f40b6){_0x3fec2c=_0x3fec2c-0x0;var _0x168a69=_0xdc1f[_0x3fec2c];return _0x168a69;};'use strict';var multer=require(_0xfdc1('0x0'));var util=require('util');var path=require(_0xfdc1('0x1'));var timeout=require(_0xfdc1('0x2'));var express=require(_0xfdc1('0x3'));var router=express[_0xfdc1('0x4')]();var fs_extra=require(_0xfdc1('0x5'));var auth=require(_0xfdc1('0x6'));var interaction=require(_0xfdc1('0x7'));var config=require('../../config/environment');var controller=require(_0xfdc1('0x8'));router[_0xfdc1('0x9')]('/',auth[_0xfdc1('0xa')](),controller['index']);router[_0xfdc1('0x9')](_0xfdc1('0xb'),auth[_0xfdc1('0xa')](),controller['describe']);router[_0xfdc1('0x9')](_0xfdc1('0xc'),auth[_0xfdc1('0xa')](),controller[_0xfdc1('0xd')]);router[_0xfdc1('0xe')]('/',auth[_0xfdc1('0xa')](),controller[_0xfdc1('0xf')]);router[_0xfdc1('0x10')](_0xfdc1('0xc'),auth[_0xfdc1('0xa')](),controller[_0xfdc1('0x11')]);router['delete'](_0xfdc1('0xc'),auth[_0xfdc1('0xa')](),controller['destroy']);module[_0xfdc1('0x12')]=router; \ No newline at end of file +var _0x83a6=['./squareReportDetail.controller','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x83a6,0x16d));var _0x683a=function(_0x2b1243,_0x7e1fcc){_0x2b1243=_0x2b1243-0x0;var _0x479d34=_0x83a6[_0x2b1243];return _0x479d34;};'use strict';var multer=require(_0x683a('0x0'));var util=require(_0x683a('0x1'));var path=require(_0x683a('0x2'));var timeout=require(_0x683a('0x3'));var express=require(_0x683a('0x4'));var router=express[_0x683a('0x5')]();var fs_extra=require(_0x683a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x683a('0x7'));var config=require(_0x683a('0x8'));var controller=require(_0x683a('0x9'));router[_0x683a('0xa')]('/',auth[_0x683a('0xb')](),controller[_0x683a('0xc')]);router[_0x683a('0xa')]('/describe',auth[_0x683a('0xb')](),controller[_0x683a('0xd')]);router[_0x683a('0xa')]('/:id',auth[_0x683a('0xb')](),controller[_0x683a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x683a('0xf')]);router[_0x683a('0x10')](_0x683a('0x11'),auth[_0x683a('0xb')](),controller[_0x683a('0x12')]);router[_0x683a('0x13')](_0x683a('0x11'),auth[_0x683a('0xb')](),controller[_0x683a('0x14')]);module[_0x683a('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 2871ef4..974656a 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 _0x1743=['TEXT','sequelize','exports','STRING'];(function(_0x441cd0,_0x3ff4c5){var _0x123606=function(_0x14aa11){while(--_0x14aa11){_0x441cd0['push'](_0x441cd0['shift']());}};_0x123606(++_0x3ff4c5);}(_0x1743,0xc9));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3174('0x0'));module[_0x3174('0x1')]={'uniqueid':{'type':Sequelize[_0x3174('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x3174('0x2')]},'data':{'type':Sequelize[_0x3174('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3174('0x2')]}}; \ No newline at end of file +var _0x8f8f=['sequelize','exports','STRING','TEXT'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x8f8f,0xec));var _0xf8f8=function(_0x52da4c,_0x1c4665){_0x52da4c=_0x52da4c-0x0;var _0x324891=_0x8f8f[_0x52da4c];return _0x324891;};'use strict';var Sequelize=require(_0xf8f8('0x0'));module[_0xf8f8('0x1')]={'uniqueid':{'type':Sequelize[_0xf8f8('0x2')]},'node':{'type':Sequelize[_0xf8f8('0x2')]},'application':{'type':Sequelize[_0xf8f8('0x2')]},'data':{'type':Sequelize[_0xf8f8('0x3')]},'project_name':{'type':Sequelize[_0xf8f8('0x2')]},'callerid':{'type':Sequelize[_0xf8f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index fd5b168..fa56b23 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 _0x24cf=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','then','findAll','rows','show','params','includeAll','include','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x2441f2,_0xe55e58){var _0x75276a=function(_0x568e8b){while(--_0x568e8b){_0x2441f2['push'](_0x2441f2['shift']());}};_0x75276a(++_0xe55e58);}(_0x24cf,0x8e));var _0xf24c=function(_0x4730c9,_0x2bb84b){_0x4730c9=_0x4730c9-0x0;var _0x48041d=_0x24cf[_0x4730c9];return _0x48041d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf24c('0x0'));var zipdir=require(_0xf24c('0x1'));var jsonpatch=require(_0xf24c('0x2'));var rp=require(_0xf24c('0x3'));var moment=require('moment');var BPromise=require(_0xf24c('0x4'));var Mustache=require(_0xf24c('0x5'));var util=require('util');var path=require(_0xf24c('0x6'));var sox=require(_0xf24c('0x7'));var csv=require(_0xf24c('0x8'));var ejs=require(_0xf24c('0x9'));var fs=require('fs');var fs_extra=require(_0xf24c('0xa'));var _=require(_0xf24c('0xb'));var squel=require(_0xf24c('0xc'));var crypto=require(_0xf24c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf24c('0xe'));var toCsv=require(_0xf24c('0x8'));var querystring=require(_0xf24c('0xf'));var Papa=require(_0xf24c('0x10'));var Redis=require(_0xf24c('0x11'));var authService=require(_0xf24c('0x12'));var qs=require(_0xf24c('0x13'));var as=require(_0xf24c('0x14'));var hardwareService=require(_0xf24c('0x15'));var logger=require(_0xf24c('0x16'))('api');var utils=require(_0xf24c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf24c('0x18'));var db=require(_0xf24c('0x19'))['db'];function respondWithStatusCode(_0x21eecf,_0x1e84a7){_0x1e84a7=_0x1e84a7||0xcc;return function(_0x4f9364){if(_0x4f9364){return _0x21eecf[_0xf24c('0x1a')](_0x1e84a7);}return _0x21eecf['status'](_0x1e84a7)[_0xf24c('0x1b')]();};}function respondWithResult(_0x42c596,_0x25ce73){_0x25ce73=_0x25ce73||0xc8;return function(_0x2e35ba){if(_0x2e35ba){return _0x42c596['status'](_0x25ce73)[_0xf24c('0x1c')](_0x2e35ba);}};}function respondWithFilteredResult(_0x46dce1,_0x24f7e5){return function(_0x137d27){if(_0x137d27){var _0x26bc03=typeof _0x24f7e5[_0xf24c('0x1d')]===_0xf24c('0x1e')&&typeof _0x24f7e5[_0xf24c('0x1f')]==='undefined';var _0x55c9bc=_0x137d27[_0xf24c('0x20')];var _0x585e8b=_0x26bc03?0x0:_0x24f7e5[_0xf24c('0x1d')];var _0x514b1d=_0x26bc03?_0x137d27[_0xf24c('0x20')]:_0x24f7e5[_0xf24c('0x1d')]+_0x24f7e5[_0xf24c('0x1f')];var _0x5d36cf;if(_0x514b1d>=_0x55c9bc){_0x514b1d=_0x55c9bc;_0x5d36cf=0xc8;}else{_0x5d36cf=0xce;}_0x46dce1[_0xf24c('0x21')](_0x5d36cf);return _0x46dce1[_0xf24c('0x22')](_0xf24c('0x23'),_0x585e8b+'-'+_0x514b1d+'/'+_0x55c9bc)['json'](_0x137d27);}return null;};}function patchUpdates(_0x1e4dd2){return function(_0x236b51){try{jsonpatch['apply'](_0x236b51,_0x1e4dd2,!![]);}catch(_0x316f02){return BPromise['reject'](_0x316f02);}return _0x236b51['save']();};}function saveUpdates(_0x30e3f3,_0x3419a3){return function(_0x539dad){if(_0x539dad){return _0x539dad['update'](_0x30e3f3)['then'](function(_0x23d5f2){return _0x23d5f2;});}return null;};}function removeEntity(_0x21aa81,_0x5e844c){return function(_0x4fce6a){if(_0x4fce6a){return _0x4fce6a[_0xf24c('0x24')]()['then'](function(){_0x21aa81['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4863be,_0x2c6be6){return function(_0x1b4056){if(!_0x1b4056){_0x4863be[_0xf24c('0x1a')](0x194);}return _0x1b4056;};}function handleError(_0x4c1be1,_0xb72bc1){_0xb72bc1=_0xb72bc1||0x1f4;return function(_0xa864d5){logger['error'](_0xa864d5['stack']);if(_0xa864d5['name']){delete _0xa864d5[_0xf24c('0x25')];}_0x4c1be1[_0xf24c('0x21')](_0xb72bc1)[_0xf24c('0x26')](_0xa864d5);};}exports[_0xf24c('0x27')]=function(_0x49a3f6,_0x181b4f){var _0x4410c3={},_0x4db4a6={},_0x1d3bab={'count':0x0,'rows':[]};var _0xd87c08=_[_0xf24c('0x28')](db['SquareDetailsReport'][_0xf24c('0x29')],function(_0xdc812){return{'name':_0xdc812[_0xf24c('0x2a')],'type':_0xdc812[_0xf24c('0x2b')][_0xf24c('0x2c')]};});_0x4db4a6[_0xf24c('0x2d')]=_[_0xf24c('0x28')](_0xd87c08,'name');_0x4db4a6[_0xf24c('0x2e')]=_[_0xf24c('0x2f')](_0x49a3f6[_0xf24c('0x2e')]);_0x4db4a6[_0xf24c('0x30')]=_[_0xf24c('0x31')](_0x4db4a6[_0xf24c('0x2d')],_0x4db4a6[_0xf24c('0x2e')]);_0x4410c3['attributes']=_[_0xf24c('0x31')](_0x4db4a6[_0xf24c('0x2d')],qs[_0xf24c('0x32')](_0x49a3f6['query'][_0xf24c('0x32')]));_0x4410c3[_0xf24c('0x33')]=_0x4410c3[_0xf24c('0x33')][_0xf24c('0x34')]?_0x4410c3[_0xf24c('0x33')]:_0x4db4a6[_0xf24c('0x2d')];if(!_0x49a3f6['query'][_0xf24c('0x35')](_0xf24c('0x36'))){_0x4410c3[_0xf24c('0x1f')]=qs[_0xf24c('0x1f')](_0x49a3f6[_0xf24c('0x2e')]['limit']);_0x4410c3[_0xf24c('0x1d')]=qs['offset'](_0x49a3f6[_0xf24c('0x2e')][_0xf24c('0x1d')]);}_0x4410c3['order']=qs['sort'](_0x49a3f6[_0xf24c('0x2e')]['sort']);_0x4410c3[_0xf24c('0x37')]=qs[_0xf24c('0x30')](_[_0xf24c('0x38')](_0x49a3f6['query'],_0x4db4a6[_0xf24c('0x30')]),_0xd87c08);if(_0x49a3f6[_0xf24c('0x2e')][_0xf24c('0x39')]){_0x4410c3[_0xf24c('0x37')]=_[_0xf24c('0x3a')](_0x4410c3[_0xf24c('0x37')],{'$or':_[_0xf24c('0x28')](_0xd87c08,function(_0x44d2d5){if(_0x44d2d5[_0xf24c('0x2b')]!==_0xf24c('0x3b')){var _0x598e01={};_0x598e01[_0x44d2d5[_0xf24c('0x25')]]={'$like':'%'+_0x49a3f6[_0xf24c('0x2e')][_0xf24c('0x39')]+'%'};return _0x598e01;}})});}_0x4410c3=_['merge']({},_0x4410c3,_0x49a3f6[_0xf24c('0x3c')]);var _0x124e5f={'where':_0x4410c3[_0xf24c('0x37')]};return db[_0xf24c('0x3d')][_0xf24c('0x20')](_0x124e5f)[_0xf24c('0x3e')](function(_0x30c3e8){_0x1d3bab[_0xf24c('0x20')]=_0x30c3e8;if(_0x49a3f6[_0xf24c('0x2e')]['includeAll']){_0x4410c3['include']=[{'all':!![]}];}return db[_0xf24c('0x3d')][_0xf24c('0x3f')](_0x4410c3);})[_0xf24c('0x3e')](function(_0x74fa11){_0x1d3bab[_0xf24c('0x40')]=_0x74fa11;return _0x1d3bab;})['then'](respondWithFilteredResult(_0x181b4f,_0x4410c3))['catch'](handleError(_0x181b4f,null));};exports[_0xf24c('0x41')]=function(_0x1fd43c,_0x35d6f9){var _0x2e0465={'raw':!![],'where':{'id':_0x1fd43c[_0xf24c('0x42')]['id']}},_0x490035={};_0x490035[_0xf24c('0x2d')]=_['keys'](db['SquareDetailsReport'][_0xf24c('0x29')]);_0x490035[_0xf24c('0x2e')]=_[_0xf24c('0x2f')](_0x1fd43c['query']);_0x490035['filters']=_[_0xf24c('0x31')](_0x490035[_0xf24c('0x2d')],_0x490035['query']);_0x2e0465[_0xf24c('0x33')]=_[_0xf24c('0x31')](_0x490035[_0xf24c('0x2d')],qs[_0xf24c('0x32')](_0x1fd43c[_0xf24c('0x2e')]['fields']));_0x2e0465[_0xf24c('0x33')]=_0x2e0465[_0xf24c('0x33')]['length']?_0x2e0465[_0xf24c('0x33')]:_0x490035[_0xf24c('0x2d')];if(_0x1fd43c['query'][_0xf24c('0x43')]){_0x2e0465[_0xf24c('0x44')]=[{'all':!![]}];}_0x2e0465=_[_0xf24c('0x3a')]({},_0x2e0465,_0x1fd43c[_0xf24c('0x3c')]);return db[_0xf24c('0x3d')][_0xf24c('0x45')](_0x2e0465)['then'](handleEntityNotFound(_0x35d6f9,null))[_0xf24c('0x3e')](respondWithResult(_0x35d6f9,null))[_0xf24c('0x46')](handleError(_0x35d6f9,null));};exports[_0xf24c('0x47')]=function(_0x491e56,_0xc4597f){return db[_0xf24c('0x3d')]['create'](_0x491e56[_0xf24c('0x48')],{})[_0xf24c('0x3e')](respondWithResult(_0xc4597f,0xc9))[_0xf24c('0x46')](handleError(_0xc4597f,null));};exports['update']=function(_0x506c79,_0x530083){if(_0x506c79[_0xf24c('0x48')]['id']){delete _0x506c79[_0xf24c('0x48')]['id'];}return db['SquareDetailsReport'][_0xf24c('0x45')]({'where':{'id':_0x506c79[_0xf24c('0x42')]['id']}})[_0xf24c('0x3e')](handleEntityNotFound(_0x530083,null))[_0xf24c('0x3e')](saveUpdates(_0x506c79[_0xf24c('0x48')],null))['then'](respondWithResult(_0x530083,null))['catch'](handleError(_0x530083,null));};exports[_0xf24c('0x24')]=function(_0x3566ec,_0x37b667){return db[_0xf24c('0x3d')]['find']({'where':{'id':_0x3566ec[_0xf24c('0x42')]['id']}})[_0xf24c('0x3e')](handleEntityNotFound(_0x37b667,null))['then'](removeEntity(_0x37b667,null))['catch'](handleError(_0x37b667,null));};exports[_0xf24c('0x49')]=function(_0x1d6dd8,_0x2df1b0){return db[_0xf24c('0x3d')]['describe']()[_0xf24c('0x3e')](respondWithResult(_0x2df1b0,null))[_0xf24c('0x46')](handleError(_0x2df1b0,null));}; \ No newline at end of file +var _0x745a=['show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','name','send','index','map','SquareDetailsReport','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x4a4957,_0x4726f3){var _0x2cf8ee=function(_0x433ae5){while(--_0x433ae5){_0x4a4957['push'](_0x4a4957['shift']());}};_0x2cf8ee(++_0x4726f3);}(_0x745a,0x1c2));var _0xa745=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x745a[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0xa745('0x0'));var rimraf=require(_0xa745('0x1'));var zipdir=require(_0xa745('0x2'));var jsonpatch=require(_0xa745('0x3'));var rp=require(_0xa745('0x4'));var moment=require(_0xa745('0x5'));var BPromise=require(_0xa745('0x6'));var Mustache=require(_0xa745('0x7'));var util=require(_0xa745('0x8'));var path=require(_0xa745('0x9'));var sox=require(_0xa745('0xa'));var csv=require(_0xa745('0xb'));var ejs=require(_0xa745('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa745('0xd'));var squel=require(_0xa745('0xe'));var crypto=require('crypto');var jsforce=require(_0xa745('0xf'));var deskjs=require(_0xa745('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa745('0x11'));var Redis=require('ioredis');var authService=require(_0xa745('0x12'));var qs=require(_0xa745('0x13'));var as=require(_0xa745('0x14'));var hardwareService=require(_0xa745('0x15'));var logger=require(_0xa745('0x16'))(_0xa745('0x17'));var utils=require(_0xa745('0x18'));var config=require(_0xa745('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa745('0x1a'))['db'];function respondWithStatusCode(_0x5d631e,_0x570855){_0x570855=_0x570855||0xcc;return function(_0x483ad4){if(_0x483ad4){return _0x5d631e[_0xa745('0x1b')](_0x570855);}return _0x5d631e[_0xa745('0x1c')](_0x570855)[_0xa745('0x1d')]();};}function respondWithResult(_0xebad3b,_0x3313aa){_0x3313aa=_0x3313aa||0xc8;return function(_0x263a86){if(_0x263a86){return _0xebad3b[_0xa745('0x1c')](_0x3313aa)[_0xa745('0x1e')](_0x263a86);}};}function respondWithFilteredResult(_0x52a68d,_0x51802a){return function(_0x393c2d){if(_0x393c2d){var _0x23d632=typeof _0x51802a[_0xa745('0x1f')]===_0xa745('0x20')&&typeof _0x51802a[_0xa745('0x21')]==='undefined';var _0x405125=_0x393c2d['count'];var _0x3b06d9=_0x23d632?0x0:_0x51802a[_0xa745('0x1f')];var _0x3ab266=_0x23d632?_0x393c2d[_0xa745('0x22')]:_0x51802a[_0xa745('0x1f')]+_0x51802a[_0xa745('0x21')];var _0x1cc04a;if(_0x3ab266>=_0x405125){_0x3ab266=_0x405125;_0x1cc04a=0xc8;}else{_0x1cc04a=0xce;}_0x52a68d[_0xa745('0x1c')](_0x1cc04a);return _0x52a68d['set'](_0xa745('0x23'),_0x3b06d9+'-'+_0x3ab266+'/'+_0x405125)[_0xa745('0x1e')](_0x393c2d);}return null;};}function patchUpdates(_0x1f3c2e){return function(_0x9bf96d){try{jsonpatch[_0xa745('0x24')](_0x9bf96d,_0x1f3c2e,!![]);}catch(_0x50989d){return BPromise['reject'](_0x50989d);}return _0x9bf96d['save']();};}function saveUpdates(_0x5cef24,_0x3c62a3){return function(_0x45fe55){if(_0x45fe55){return _0x45fe55[_0xa745('0x25')](_0x5cef24)[_0xa745('0x26')](function(_0x247cca){return _0x247cca;});}return null;};}function removeEntity(_0x144a0e,_0x8b82e2){return function(_0x14f9c8){if(_0x14f9c8){return _0x14f9c8[_0xa745('0x27')]()[_0xa745('0x26')](function(){_0x144a0e[_0xa745('0x1c')](0xcc)[_0xa745('0x1d')]();});}};}function handleEntityNotFound(_0x296342,_0x25cc70){return function(_0x5aa47f){if(!_0x5aa47f){_0x296342[_0xa745('0x1b')](0x194);}return _0x5aa47f;};}function handleError(_0x1da262,_0x595b63){_0x595b63=_0x595b63||0x1f4;return function(_0x25d3ee){logger[_0xa745('0x28')](_0x25d3ee['stack']);if(_0x25d3ee[_0xa745('0x29')]){delete _0x25d3ee[_0xa745('0x29')];}_0x1da262[_0xa745('0x1c')](_0x595b63)[_0xa745('0x2a')](_0x25d3ee);};}exports[_0xa745('0x2b')]=function(_0x12dd7f,_0x4828cd){var _0x158aa8={},_0x5d3ffc={},_0x5b2b1a={'count':0x0,'rows':[]};var _0x1613bc=_[_0xa745('0x2c')](db[_0xa745('0x2d')][_0xa745('0x2e')],function(_0x4385cc){return{'name':_0x4385cc['fieldName'],'type':_0x4385cc[_0xa745('0x2f')]['key']};});_0x5d3ffc['model']=_[_0xa745('0x2c')](_0x1613bc,_0xa745('0x29'));_0x5d3ffc[_0xa745('0x30')]=_[_0xa745('0x31')](_0x12dd7f[_0xa745('0x30')]);_0x5d3ffc[_0xa745('0x32')]=_[_0xa745('0x33')](_0x5d3ffc[_0xa745('0x34')],_0x5d3ffc[_0xa745('0x30')]);_0x158aa8[_0xa745('0x35')]=_[_0xa745('0x33')](_0x5d3ffc['model'],qs['fields'](_0x12dd7f[_0xa745('0x30')][_0xa745('0x36')]));_0x158aa8[_0xa745('0x35')]=_0x158aa8['attributes']['length']?_0x158aa8[_0xa745('0x35')]:_0x5d3ffc[_0xa745('0x34')];if(!_0x12dd7f['query']['hasOwnProperty'](_0xa745('0x37'))){_0x158aa8['limit']=qs[_0xa745('0x21')](_0x12dd7f['query'][_0xa745('0x21')]);_0x158aa8['offset']=qs[_0xa745('0x1f')](_0x12dd7f[_0xa745('0x30')][_0xa745('0x1f')]);}_0x158aa8[_0xa745('0x38')]=qs[_0xa745('0x39')](_0x12dd7f['query'][_0xa745('0x39')]);_0x158aa8[_0xa745('0x3a')]=qs[_0xa745('0x32')](_[_0xa745('0x3b')](_0x12dd7f['query'],_0x5d3ffc[_0xa745('0x32')]),_0x1613bc);if(_0x12dd7f[_0xa745('0x30')][_0xa745('0x3c')]){_0x158aa8[_0xa745('0x3a')]=_[_0xa745('0x3d')](_0x158aa8[_0xa745('0x3a')],{'$or':_[_0xa745('0x2c')](_0x1613bc,function(_0x3cb5ad){if(_0x3cb5ad[_0xa745('0x2f')]!=='VIRTUAL'){var _0x4499cb={};_0x4499cb[_0x3cb5ad[_0xa745('0x29')]]={'$like':'%'+_0x12dd7f[_0xa745('0x30')][_0xa745('0x3c')]+'%'};return _0x4499cb;}})});}_0x158aa8=_[_0xa745('0x3d')]({},_0x158aa8,_0x12dd7f[_0xa745('0x3e')]);var _0x553468={'where':_0x158aa8[_0xa745('0x3a')]};return db[_0xa745('0x2d')][_0xa745('0x22')](_0x553468)[_0xa745('0x26')](function(_0x1e5aca){_0x5b2b1a[_0xa745('0x22')]=_0x1e5aca;if(_0x12dd7f[_0xa745('0x30')][_0xa745('0x3f')]){_0x158aa8[_0xa745('0x40')]=[{'all':!![]}];}return db[_0xa745('0x2d')][_0xa745('0x41')](_0x158aa8);})[_0xa745('0x26')](function(_0xf486c5){_0x5b2b1a[_0xa745('0x42')]=_0xf486c5;return _0x5b2b1a;})[_0xa745('0x26')](respondWithFilteredResult(_0x4828cd,_0x158aa8))[_0xa745('0x43')](handleError(_0x4828cd,null));};exports[_0xa745('0x44')]=function(_0x55891c,_0x5b88af){var _0x21e4d9={'raw':!![],'where':{'id':_0x55891c[_0xa745('0x45')]['id']}},_0x36e9e1={};_0x36e9e1['model']=_[_0xa745('0x31')](db[_0xa745('0x2d')]['rawAttributes']);_0x36e9e1[_0xa745('0x30')]=_['keys'](_0x55891c['query']);_0x36e9e1[_0xa745('0x32')]=_[_0xa745('0x33')](_0x36e9e1[_0xa745('0x34')],_0x36e9e1[_0xa745('0x30')]);_0x21e4d9[_0xa745('0x35')]=_[_0xa745('0x33')](_0x36e9e1[_0xa745('0x34')],qs[_0xa745('0x36')](_0x55891c[_0xa745('0x30')][_0xa745('0x36')]));_0x21e4d9['attributes']=_0x21e4d9['attributes']['length']?_0x21e4d9[_0xa745('0x35')]:_0x36e9e1[_0xa745('0x34')];if(_0x55891c[_0xa745('0x30')][_0xa745('0x3f')]){_0x21e4d9[_0xa745('0x40')]=[{'all':!![]}];}_0x21e4d9=_[_0xa745('0x3d')]({},_0x21e4d9,_0x55891c[_0xa745('0x3e')]);return db['SquareDetailsReport'][_0xa745('0x46')](_0x21e4d9)[_0xa745('0x26')](handleEntityNotFound(_0x5b88af,null))[_0xa745('0x26')](respondWithResult(_0x5b88af,null))[_0xa745('0x43')](handleError(_0x5b88af,null));};exports[_0xa745('0x47')]=function(_0x3ccbe9,_0x4895e3){return db['SquareDetailsReport']['create'](_0x3ccbe9[_0xa745('0x48')],{})['then'](respondWithResult(_0x4895e3,0xc9))[_0xa745('0x43')](handleError(_0x4895e3,null));};exports[_0xa745('0x25')]=function(_0x43b5d5,_0xf7d0dc){if(_0x43b5d5[_0xa745('0x48')]['id']){delete _0x43b5d5[_0xa745('0x48')]['id'];}return db[_0xa745('0x2d')][_0xa745('0x46')]({'where':{'id':_0x43b5d5['params']['id']}})[_0xa745('0x26')](handleEntityNotFound(_0xf7d0dc,null))['then'](saveUpdates(_0x43b5d5[_0xa745('0x48')],null))[_0xa745('0x26')](respondWithResult(_0xf7d0dc,null))[_0xa745('0x43')](handleError(_0xf7d0dc,null));};exports[_0xa745('0x27')]=function(_0x10cc7f,_0x569a2e){return db[_0xa745('0x2d')][_0xa745('0x46')]({'where':{'id':_0x10cc7f[_0xa745('0x45')]['id']}})[_0xa745('0x26')](handleEntityNotFound(_0x569a2e,null))[_0xa745('0x26')](removeEntity(_0x569a2e,null))[_0xa745('0x43')](handleError(_0x569a2e,null));};exports[_0xa745('0x49')]=function(_0x524e20,_0x4ecabe){return db[_0xa745('0x2d')][_0xa745('0x49')]()[_0xa745('0x26')](respondWithResult(_0x4ecabe,null))[_0xa745('0x43')](handleError(_0x4ecabe,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8e33a90..b276224 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 _0x44bb=['api','moment','bluebird','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','../../config/logger'];(function(_0x1e5a0c,_0x3a16fc){var _0x5cc15b=function(_0x39e08f){while(--_0x39e08f){_0x1e5a0c['push'](_0x1e5a0c['shift']());}};_0x5cc15b(++_0x3a16fc);}(_0x44bb,0x19d));var _0xb44b=function(_0x4b7560,_0xf9428f){_0x4b7560=_0x4b7560-0x0;var _0x463aac=_0x44bb[_0x4b7560];return _0x463aac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb44b('0x0'))(_0xb44b('0x1'));var moment=require(_0xb44b('0x2'));var BPromise=require(_0xb44b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb44b('0x4'));module[_0xb44b('0x5')]=function(_0x32c8c7,_0x562a6c){return _0x32c8c7[_0xb44b('0x6')](_0xb44b('0x7'),attributes,{'tableName':_0xb44b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9337=['path','../../config/environment','./squareReportDetail.attributes','define','lodash','util','api','moment','bluebird'];(function(_0x404102,_0x401aeb){var _0x3cc51b=function(_0x3d247a){while(--_0x3d247a){_0x404102['push'](_0x404102['shift']());}};_0x3cc51b(++_0x401aeb);}(_0x9337,0x8b));var _0x7933=function(_0x7d593f,_0x5c40bd){_0x7d593f=_0x7d593f-0x0;var _0x1a5691=_0x9337[_0x7d593f];return _0x1a5691;};'use strict';var _=require(_0x7933('0x0'));var util=require(_0x7933('0x1'));var logger=require('../../config/logger')(_0x7933('0x2'));var moment=require(_0x7933('0x3'));var BPromise=require(_0x7933('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7933('0x5'));var rimraf=require('rimraf');var config=require(_0x7933('0x6'));var attributes=require(_0x7933('0x7'));module['exports']=function(_0x3f96ea,_0x121751){return _0x3f96ea[_0x7933('0x8')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','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 4435b85..b3c2a04 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 _0xa571=['create','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x5cdacf,_0x7c82b1){var _0xa68a8b=function(_0x4b3818){while(--_0x4b3818){_0x5cdacf['push'](_0x5cdacf['shift']());}};_0xa68a8b(++_0x7c82b1);}(_0xa571,0x107));var _0x1a57=function(_0x20ff72,_0x23f5ff){_0x20ff72=_0x20ff72-0x0;var _0x39dd5a=_0xa571[_0x20ff72];return _0x39dd5a;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}exports[_0x1a57('0x15')]=function(_0x1662a3){var _0x80f8c1=this;return new Promise(function(_0x53bb20,_0x3daa66){return db[_0x1a57('0x16')][_0x1a57('0x17')](_0x1662a3[_0x1a57('0x18')],{'raw':_0x1662a3[_0x1a57('0x19')]?_0x1662a3['options']['raw']===undefined?!![]:![]:!![]})[_0x1a57('0xb')](function(_0x21e811){logger[_0x1a57('0xc')]('CreateSquareDetailsReport',_0x1662a3);logger['debug']('CreateSquareDetailsReport',_0x1662a3,JSON[_0x1a57('0x11')](_0x21e811));_0x53bb20(_0x21e811);})[_0x1a57('0x14')](function(_0x3f52b9){logger[_0x1a57('0x12')](_0x1a57('0x15'),_0x3f52b9[_0x1a57('0x13')],_0x1662a3);_0x3daa66(_0x80f8c1[_0x1a57('0x12')](0x1f4,_0x3f52b9[_0x1a57('0x13')]));});});}; \ No newline at end of file +var _0x5a13=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch'];(function(_0x2af6e9,_0x315547){var _0x5ae10e=function(_0x2702eb){while(--_0x2702eb){_0x2af6e9['push'](_0x2af6e9['shift']());}};_0x5ae10e(++_0x315547);}(_0x5a13,0x145));var _0x35a1=function(_0x5e7b9d,_0x57fad8){_0x5e7b9d=_0x5e7b9d-0x0;var _0x5686ab=_0x5a13[_0x5e7b9d];return _0x5686ab;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}exports[_0x35a1('0x17')]=function(_0x1de373){var _0x5e4317=this;return new Promise(function(_0x3b17dc,_0xbeb751){return db[_0x35a1('0x18')][_0x35a1('0x19')](_0x1de373[_0x35a1('0x1a')],{'raw':_0x1de373[_0x35a1('0x1b')]?_0x1de373[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![]})[_0x35a1('0xd')](function(_0x5929e5){logger[_0x35a1('0x14')](_0x35a1('0x17'),_0x1de373);logger['debug'](_0x35a1('0x17'),_0x1de373,JSON[_0x35a1('0x10')](_0x5929e5));_0x3b17dc(_0x5929e5);})['catch'](function(_0xc13bad){logger['error'](_0x35a1('0x17'),_0xc13bad[_0x35a1('0x12')],_0x1de373);_0xbeb751(_0x5e4317[_0x35a1('0x13')](0x1f4,_0xc13bad['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 995a55a..bbbfb8e 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 _0x67b9=['./system.controller','get','index','/process/:pid/kill','isAuthenticated','exports','express','../../components/auth/service'];(function(_0x522c95,_0x36ae86){var _0x2aa46e=function(_0x4276ec){while(--_0x4276ec){_0x522c95['push'](_0x522c95['shift']());}};_0x2aa46e(++_0x36ae86);}(_0x67b9,0x16e));var _0x967b=function(_0x498e3e,_0x5cf823){_0x498e3e=_0x498e3e-0x0;var _0x247afb=_0x67b9[_0x498e3e];return _0x247afb;};'use strict';var express=require(_0x967b('0x0'));var router=express['Router']();var auth=require(_0x967b('0x1'));var controller=require(_0x967b('0x2'));router[_0x967b('0x3')]('/',auth['isAuthenticated'](),controller[_0x967b('0x4')]);router[_0x967b('0x3')](_0x967b('0x5'),auth[_0x967b('0x6')](),controller['killProcess']);module[_0x967b('0x7')]=router; \ No newline at end of file +var _0x711b=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x228394,_0x2bcb15){var _0x1f4a17=function(_0x555b14){while(--_0x555b14){_0x228394['push'](_0x228394['shift']());}};_0x1f4a17(++_0x2bcb15);}(_0x711b,0x9b));var _0xb711=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x711b[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xb711('0x0'));var router=express[_0xb711('0x1')]();var auth=require(_0xb711('0x2'));var controller=require(_0xb711('0x3'));router['get']('/',auth[_0xb711('0x4')](),controller['index']);router['get'](_0xb711('0x5'),auth[_0xb711('0x4')](),controller[_0xb711('0x6')]);module[_0xb711('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index e9f7545..eaf91c6 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 _0xdfad=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','then','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','params','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','catch','json','killProcess','components/import/cm','format'];(function(_0x12a833,_0x587a49){var _0x55ba34=function(_0x29ddea){while(--_0x29ddea){_0x12a833['push'](_0x12a833['shift']());}};_0x55ba34(++_0x587a49);}(_0xdfad,0x1bd));var _0xddfa=function(_0x4e9274,_0x49576e){_0x4e9274=_0x4e9274-0x0;var _0x8b474c=_0xdfad[_0x4e9274];return _0x8b474c;};'use strict';var info=require(_0xddfa('0x0'));var exec=require(_0xddfa('0x1'))[_0xddfa('0x2')];var logger=require(_0xddfa('0x3'))('api');var util=require(_0xddfa('0x4'));var BPromise=require(_0xddfa('0x5'));var _=require(_0xddfa('0x6'));function handleError(_0xad4087,_0x1c15db,_0x5caf92){_0x1c15db=_0x1c15db||0x1f4;return function(_0x8ab5f7){logger[_0xddfa('0x7')](_0xddfa('0x8'),_0x5caf92,_0x1c15db,util[_0xddfa('0x9')](_0x8ab5f7,{'showHidden':![],'depth':null}));delete _0x8ab5f7['name'];_0xad4087[_0xddfa('0xa')](_0x1c15db)[_0xddfa('0xb')](_0x8ab5f7);};}exports[_0xddfa('0xc')]=function(_0x3a0e48,_0x2d44d5){return info[_0xddfa('0xd')]()['then'](function(_0xe201c){return _0x2d44d5['status'](0xc8)['json'](_0xe201c);})[_0xddfa('0xe')](function(_0x59bc83){return _0x2d44d5[_0xddfa('0xa')](0x1f4)[_0xddfa('0xf')](_0x59bc83);});};exports[_0xddfa('0x10')]=function(_0x7c08c3,_0x28d43e){var _0x56a30a=[_0xddfa('0x11')];return new BPromise(function(_0x3d1a16,_0x50174d){return exec(util[_0xddfa('0x12')](_0xddfa('0x13'),_0x7c08c3['params']['pid']),function(_0x16b976,_0x5c3729,_0x39db69){if(_0x16b976){return _0x50174d(_0x16b976);}return _0x3d1a16(_0x5c3729);});})[_0xddfa('0x14')](function(_0x4dd56e){var _0x2dffdf=![];var _0x17fd90=_0x4dd56e[_0xddfa('0x15')](/\n/);for(var _0x3f5e72=0x0,_0x494db9=_0x56a30a[_0xddfa('0x16')];_0x3f5e72<_0x494db9,_0x2dffdf===![];_0x3f5e72+=0x1){if(_0x4dd56e['indexOf'](_0x56a30a[_0x3f5e72])>=0x0){_0x2dffdf=!![];}}if(!_0x2dffdf){throw new Error(util[_0xddfa('0x12')](_0xddfa('0x17'),_0x7c08c3['params']['pid']));}process[_0xddfa('0x18')](_0x7c08c3['params'][_0xddfa('0x19')],_0xddfa('0x1a'));return _0x28d43e[_0xddfa('0xa')](0xc8)['json']({'message':util[_0xddfa('0x12')](_0xddfa('0x1b'),_0x7c08c3[_0xddfa('0x1c')][_0xddfa('0x19')])});})[_0xddfa('0xe')](handleError(_0x28d43e,null,_0xddfa('0x10')));}; \ No newline at end of file +var _0xbd4e=['split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index','getAllData','status','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid'];(function(_0x38ae07,_0x59d4e8){var _0x4c1010=function(_0x19fda5){while(--_0x19fda5){_0x38ae07['push'](_0x38ae07['shift']());}};_0x4c1010(++_0x59d4e8);}(_0xbd4e,0x1d4));var _0xebd4=function(_0xadb8d5,_0x4a6f6c){_0xadb8d5=_0xadb8d5-0x0;var _0x2b2b67=_0xbd4e[_0xadb8d5];return _0x2b2b67;};'use strict';var info=require(_0xebd4('0x0'));var exec=require(_0xebd4('0x1'))[_0xebd4('0x2')];var logger=require(_0xebd4('0x3'))(_0xebd4('0x4'));var util=require(_0xebd4('0x5'));var BPromise=require(_0xebd4('0x6'));var _=require(_0xebd4('0x7'));function handleError(_0x16cb6f,_0x2771f3,_0x26867f){_0x2771f3=_0x2771f3||0x1f4;return function(_0x40c995){logger['error'](_0xebd4('0x8'),_0x26867f,_0x2771f3,util[_0xebd4('0x9')](_0x40c995,{'showHidden':![],'depth':null}));delete _0x40c995['name'];_0x16cb6f['status'](_0x2771f3)[_0xebd4('0xa')](_0x40c995);};}exports[_0xebd4('0xb')]=function(_0x4a5f2c,_0x33b78c){return info[_0xebd4('0xc')]()['then'](function(_0x4b6335){return _0x33b78c[_0xebd4('0xd')](0xc8)['json'](_0x4b6335);})['catch'](function(_0x244b98){return _0x33b78c[_0xebd4('0xd')](0x1f4)['json'](_0x244b98);});};exports[_0xebd4('0xe')]=function(_0x430329,_0x5efd7a){var _0x1469d2=['components/import/cm'];return new BPromise(function(_0xa658fd,_0x40cbaa){return exec(util[_0xebd4('0xf')](_0xebd4('0x10'),_0x430329['params'][_0xebd4('0x11')]),function(_0x2d13fb,_0x534297,_0xabaaf9){if(_0x2d13fb){return _0x40cbaa(_0x2d13fb);}return _0xa658fd(_0x534297);});})['then'](function(_0x42897d){var _0xa79fb5=![];var _0x331270=_0x42897d[_0xebd4('0x12')](/\n/);for(var _0x219f9=0x0,_0x447eb5=_0x1469d2[_0xebd4('0x13')];_0x219f9<_0x447eb5,_0xa79fb5===![];_0x219f9+=0x1){if(_0x42897d[_0xebd4('0x14')](_0x1469d2[_0x219f9])>=0x0){_0xa79fb5=!![];}}if(!_0xa79fb5){throw new Error(util[_0xebd4('0xf')](_0xebd4('0x15'),_0x430329[_0xebd4('0x16')][_0xebd4('0x11')]));}process[_0xebd4('0x17')](_0x430329[_0xebd4('0x16')][_0xebd4('0x11')],_0xebd4('0x18'));return _0x5efd7a['status'](0xc8)['json']({'message':util[_0xebd4('0xf')](_0xebd4('0x19'),_0x430329[_0xebd4('0x16')][_0xebd4('0x11')])});})[_0xebd4('0x1a')](handleError(_0x5efd7a,null,_0xebd4('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 00268e9..a66f5ff 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 _0x7c27=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','show','post','put','/:id','update','exports'];(function(_0x384516,_0x3248c1){var _0x22a0c7=function(_0x1dd285){while(--_0x1dd285){_0x384516['push'](_0x384516['shift']());}};_0x22a0c7(++_0x3248c1);}(_0x7c27,0x14a));var _0x77c2=function(_0x343e17,_0x532384){_0x343e17=_0x343e17-0x0;var _0x4089b5=_0x7c27[_0x343e17];return _0x4089b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x77c2('0x0'));var timeout=require(_0x77c2('0x1'));var express=require(_0x77c2('0x2'));var router=express[_0x77c2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x77c2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77c2('0x5'));var controller=require(_0x77c2('0x6'));router[_0x77c2('0x7')]('/',auth[_0x77c2('0x8')](),controller['index']);router[_0x77c2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x77c2('0x9')]);router[_0x77c2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x77c2('0xb')](_0x77c2('0xc'),auth['isAuthenticated'](),controller[_0x77c2('0xd')]);router['delete']('/:id',auth[_0x77c2('0x8')](),controller['destroy']);module[_0x77c2('0xe')]=router; \ No newline at end of file +var _0xcd94=['create','put','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2758ec,_0x2ccc37){var _0x239eb7=function(_0x576f27){while(--_0x576f27){_0x2758ec['push'](_0x2758ec['shift']());}};_0x239eb7(++_0x2ccc37);}(_0xcd94,0x19b));var _0x4cd9=function(_0x3df517,_0x373364){_0x3df517=_0x3df517-0x0;var _0x25ddd5=_0xcd94[_0x3df517];return _0x25ddd5;};'use strict';var multer=require('multer');var util=require(_0x4cd9('0x0'));var path=require(_0x4cd9('0x1'));var timeout=require(_0x4cd9('0x2'));var express=require(_0x4cd9('0x3'));var router=express[_0x4cd9('0x4')]();var fs_extra=require(_0x4cd9('0x5'));var auth=require(_0x4cd9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4cd9('0x7'));var controller=require(_0x4cd9('0x8'));router[_0x4cd9('0x9')]('/',auth[_0x4cd9('0xa')](),controller[_0x4cd9('0xb')]);router[_0x4cd9('0x9')](_0x4cd9('0xc'),auth[_0x4cd9('0xa')](),controller[_0x4cd9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4cd9('0xe')]);router[_0x4cd9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4cd9('0xa')](),controller[_0x4cd9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c9f0695..750bbe3 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 _0x2d58=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d58,0x186));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x82d5('0x0'));module[_0x82d5('0x1')]={'name':{'type':Sequelize[_0x82d5('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x82d5('0x2')]}}; \ No newline at end of file +var _0x88c7=['sequelize','name','STRING'];(function(_0x3a14ac,_0x55403f){var _0x5e3bc3=function(_0x11f956){while(--_0x11f956){_0x3a14ac['push'](_0x3a14ac['shift']());}};_0x5e3bc3(++_0x55403f);}(_0x88c7,0x6f));var _0x788c=function(_0x2b0e63,_0x37a044){_0x2b0e63=_0x2b0e63-0x0;var _0x166e51=_0x88c7[_0x2b0e63];return _0x166e51;};'use strict';var Sequelize=require(_0x788c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x788c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x788c('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 7e4bda6..8916fa3 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 _0x3685=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','map','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3685,0xf8));var _0x5368=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3685[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5368('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5368('0x1'));var jsonpatch=require(_0x5368('0x2'));var rp=require(_0x5368('0x3'));var moment=require(_0x5368('0x4'));var BPromise=require(_0x5368('0x5'));var Mustache=require(_0x5368('0x6'));var util=require(_0x5368('0x7'));var path=require(_0x5368('0x8'));var sox=require(_0x5368('0x9'));var csv=require(_0x5368('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5368('0xb'));var _=require(_0x5368('0xc'));var squel=require(_0x5368('0xd'));var crypto=require(_0x5368('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5368('0xf'));var toCsv=require(_0x5368('0xa'));var querystring=require(_0x5368('0x10'));var Papa=require(_0x5368('0x11'));var Redis=require(_0x5368('0x12'));var authService=require(_0x5368('0x13'));var qs=require(_0x5368('0x14'));var as=require(_0x5368('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5368('0x16'))(_0x5368('0x17'));var utils=require(_0x5368('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5368('0x19'));var db=require(_0x5368('0x1a'))['db'];function respondWithStatusCode(_0x4940af,_0x5d6a86){_0x5d6a86=_0x5d6a86||0xcc;return function(_0x5c626a){if(_0x5c626a){return _0x4940af[_0x5368('0x1b')](_0x5d6a86);}return _0x4940af[_0x5368('0x1c')](_0x5d6a86)[_0x5368('0x1d')]();};}function respondWithResult(_0x5df43,_0xa5ce3c){_0xa5ce3c=_0xa5ce3c||0xc8;return function(_0x2f18dd){if(_0x2f18dd){return _0x5df43[_0x5368('0x1c')](_0xa5ce3c)[_0x5368('0x1e')](_0x2f18dd);}};}function respondWithFilteredResult(_0x3a3b8e,_0x5b1da2){return function(_0x524fbf){if(_0x524fbf){var _0x41ce0e=typeof _0x5b1da2[_0x5368('0x1f')]==='undefined'&&typeof _0x5b1da2[_0x5368('0x20')]===_0x5368('0x21');var _0x973143=_0x524fbf[_0x5368('0x22')];var _0x5b10e9=_0x41ce0e?0x0:_0x5b1da2[_0x5368('0x1f')];var _0x56ac4d=_0x41ce0e?_0x524fbf['count']:_0x5b1da2[_0x5368('0x1f')]+_0x5b1da2['limit'];var _0x52afa9;if(_0x56ac4d>=_0x973143){_0x56ac4d=_0x973143;_0x52afa9=0xc8;}else{_0x52afa9=0xce;}_0x3a3b8e['status'](_0x52afa9);return _0x3a3b8e[_0x5368('0x23')](_0x5368('0x24'),_0x5b10e9+'-'+_0x56ac4d+'/'+_0x973143)[_0x5368('0x1e')](_0x524fbf);}return null;};}function patchUpdates(_0x5cef40){return function(_0x4e3267){try{jsonpatch[_0x5368('0x25')](_0x4e3267,_0x5cef40,!![]);}catch(_0x3c891a){return BPromise[_0x5368('0x26')](_0x3c891a);}return _0x4e3267[_0x5368('0x27')]();};}function saveUpdates(_0x1c2fcd,_0x1093e2){return function(_0x4885d0){if(_0x4885d0){return _0x4885d0[_0x5368('0x28')](_0x1c2fcd)[_0x5368('0x29')](function(_0x4705f2){return _0x4705f2;});}return null;};}function removeEntity(_0x57108b,_0x45884f){return function(_0xb994f4){if(_0xb994f4){return _0xb994f4[_0x5368('0x2a')]()[_0x5368('0x29')](function(){var _0x1c287f=_0xb994f4[_0x5368('0x2b')]({'plain':!![]});var _0xabac8c=_0x5368('0x2c');return db[_0x5368('0x2d')]['destroy']({'where':{'type':_0xabac8c,'resourceId':_0x1c287f['id']}})['then'](function(){return _0xb994f4;});})[_0x5368('0x29')](function(){_0x57108b[_0x5368('0x1c')](0xcc)[_0x5368('0x1d')]();});}};}function handleEntityNotFound(_0x452c81,_0x131722){return function(_0x4b94cd){if(!_0x4b94cd){_0x452c81[_0x5368('0x1b')](0x194);}return _0x4b94cd;};}function handleError(_0x200ad0,_0x2e18e0){_0x2e18e0=_0x2e18e0||0x1f4;return function(_0x2bcf41){logger[_0x5368('0x2e')](_0x2bcf41[_0x5368('0x2f')]);if(_0x2bcf41[_0x5368('0x30')]){delete _0x2bcf41[_0x5368('0x30')];}_0x200ad0[_0x5368('0x1c')](_0x2e18e0)[_0x5368('0x31')](_0x2bcf41);};}exports[_0x5368('0x32')]=function(_0x46ea22,_0x7449cd){var _0x5810cb={},_0x73111b={},_0x256abd={'count':0x0,'rows':[]};var _0x36e230=_['map'](db[_0x5368('0x33')]['rawAttributes'],function(_0x26fc48){return{'name':_0x26fc48[_0x5368('0x34')],'type':_0x26fc48['type'][_0x5368('0x35')]};});_0x73111b[_0x5368('0x36')]=_['map'](_0x36e230,'name');_0x73111b[_0x5368('0x37')]=_[_0x5368('0x38')](_0x46ea22['query']);_0x73111b[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x73111b[_0x5368('0x36')],_0x73111b['query']);_0x5810cb[_0x5368('0x3b')]=_['intersection'](_0x73111b[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x46ea22[_0x5368('0x37')]['fields']));_0x5810cb[_0x5368('0x3b')]=_0x5810cb[_0x5368('0x3b')][_0x5368('0x3d')]?_0x5810cb[_0x5368('0x3b')]:_0x73111b['model'];if(!_0x46ea22[_0x5368('0x37')]['hasOwnProperty'](_0x5368('0x3e'))){_0x5810cb[_0x5368('0x20')]=qs['limit'](_0x46ea22[_0x5368('0x37')][_0x5368('0x20')]);_0x5810cb[_0x5368('0x1f')]=qs[_0x5368('0x1f')](_0x46ea22['query'][_0x5368('0x1f')]);}_0x5810cb[_0x5368('0x3f')]=qs[_0x5368('0x40')](_0x46ea22[_0x5368('0x37')][_0x5368('0x40')]);_0x5810cb['where']=qs[_0x5368('0x39')](_[_0x5368('0x41')](_0x46ea22['query'],_0x73111b[_0x5368('0x39')]),_0x36e230);if(_0x46ea22[_0x5368('0x37')][_0x5368('0x42')]){_0x5810cb['where']=_[_0x5368('0x43')](_0x5810cb[_0x5368('0x44')],{'$or':_[_0x5368('0x45')](_0x36e230,function(_0x25e432){if(_0x25e432['type']!=='VIRTUAL'){var _0x1be46a={};_0x1be46a[_0x25e432[_0x5368('0x30')]]={'$like':'%'+_0x46ea22[_0x5368('0x37')]['filter']+'%'};return _0x1be46a;}})});}_0x5810cb=_['merge']({},_0x5810cb,_0x46ea22[_0x5368('0x46')]);var _0x5ae3f1={'where':_0x5810cb[_0x5368('0x44')]};return db[_0x5368('0x33')]['count'](_0x5ae3f1)[_0x5368('0x29')](function(_0x3b57a2){_0x256abd[_0x5368('0x22')]=_0x3b57a2;if(_0x46ea22[_0x5368('0x37')][_0x5368('0x47')]){_0x5810cb[_0x5368('0x48')]=[{'all':!![]}];}return db[_0x5368('0x33')][_0x5368('0x49')](_0x5810cb);})[_0x5368('0x29')](function(_0x43c776){_0x256abd[_0x5368('0x4a')]=_0x43c776;return _0x256abd;})[_0x5368('0x29')](respondWithFilteredResult(_0x7449cd,_0x5810cb))['catch'](handleError(_0x7449cd,null));};exports[_0x5368('0x4b')]=function(_0x61b1a1,_0xd4e247){var _0x4cb800={'raw':!![],'where':{'id':_0x61b1a1[_0x5368('0x4c')]['id']}},_0x1b66a1={};_0x1b66a1['model']=_[_0x5368('0x38')](db[_0x5368('0x33')][_0x5368('0x4d')]);_0x1b66a1[_0x5368('0x37')]=_[_0x5368('0x38')](_0x61b1a1[_0x5368('0x37')]);_0x1b66a1[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x1b66a1[_0x5368('0x36')],_0x1b66a1[_0x5368('0x37')]);_0x4cb800['attributes']=_['intersection'](_0x1b66a1[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x61b1a1[_0x5368('0x37')][_0x5368('0x3c')]));_0x4cb800['attributes']=_0x4cb800['attributes'][_0x5368('0x3d')]?_0x4cb800['attributes']:_0x1b66a1[_0x5368('0x36')];if(_0x61b1a1['query'][_0x5368('0x47')]){_0x4cb800['include']=[{'all':!![]}];}_0x4cb800=_[_0x5368('0x43')]({},_0x4cb800,_0x61b1a1[_0x5368('0x46')]);return db['Tag']['find'](_0x4cb800)[_0x5368('0x29')](handleEntityNotFound(_0xd4e247,null))['then'](respondWithResult(_0xd4e247,null))[_0x5368('0x4e')](handleError(_0xd4e247,null));};exports[_0x5368('0x4f')]=function(_0x2ee00b,_0x121d8d){return db['Tag'][_0x5368('0x4f')](_0x2ee00b[_0x5368('0x50')],{})[_0x5368('0x29')](function(_0x1d9c87){var _0x20e641=_0x2ee00b[_0x5368('0x51')][_0x5368('0x2b')]({'plain':!![]});if(!_0x20e641)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20e641['role']===_0x5368('0x51')){var _0x7d7a5=_0x1d9c87[_0x5368('0x2b')]({'plain':!![]});var _0x4850f8=_0x5368('0x2c');return db[_0x5368('0x52')][_0x5368('0x53')]({'where':{'name':_0x4850f8,'userProfileId':_0x20e641[_0x5368('0x54')]},'raw':!![]})[_0x5368('0x29')](function(_0x233bf6){if(_0x233bf6&&_0x233bf6[_0x5368('0x55')]===0x0){return db[_0x5368('0x2d')]['create']({'name':_0x7d7a5[_0x5368('0x30')],'resourceId':_0x7d7a5['id'],'type':_0x233bf6[_0x5368('0x30')],'sectionId':_0x233bf6['id']},{})[_0x5368('0x29')](function(){return _0x1d9c87;});}else{return _0x1d9c87;}})[_0x5368('0x4e')](function(_0x5720c8){logger[_0x5368('0x2e')](_0x5368('0x56'),_0x5720c8);throw _0x5720c8;});}return _0x1d9c87;})[_0x5368('0x29')](respondWithResult(_0x121d8d,0xc9))[_0x5368('0x4e')](handleError(_0x121d8d,null));};exports[_0x5368('0x28')]=function(_0x44a481,_0x42544e){if(_0x44a481[_0x5368('0x50')]['id']){delete _0x44a481[_0x5368('0x50')]['id'];}return db[_0x5368('0x33')][_0x5368('0x53')]({'where':{'id':_0x44a481[_0x5368('0x4c')]['id']}})[_0x5368('0x29')](handleEntityNotFound(_0x42544e,null))[_0x5368('0x29')](saveUpdates(_0x44a481['body'],null))[_0x5368('0x29')](respondWithResult(_0x42544e,null))[_0x5368('0x4e')](handleError(_0x42544e,null));};exports[_0x5368('0x2a')]=function(_0x2971de,_0x2688a9){return db[_0x5368('0x33')]['find']({'where':{'id':_0x2971de[_0x5368('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2688a9,null))[_0x5368('0x29')](removeEntity(_0x2688a9,null))[_0x5368('0x4e')](handleError(_0x2688a9,null));}; \ No newline at end of file +var _0xde64=['limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Tags','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','Tag','catch','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0xde64,0x17c));var _0x4de6=function(_0x17b079,_0x313a6c){_0x17b079=_0x17b079-0x0;var _0x42017e=_0xde64[_0x17b079];return _0x42017e;};'use strict';var emlformat=require(_0x4de6('0x0'));var rimraf=require(_0x4de6('0x1'));var zipdir=require(_0x4de6('0x2'));var jsonpatch=require(_0x4de6('0x3'));var rp=require(_0x4de6('0x4'));var moment=require(_0x4de6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4de6('0x6'));var util=require(_0x4de6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4de6('0x8'));var ejs=require(_0x4de6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4de6('0xa'));var crypto=require(_0x4de6('0xb'));var jsforce=require(_0x4de6('0xc'));var deskjs=require(_0x4de6('0xd'));var toCsv=require(_0x4de6('0x8'));var querystring=require(_0x4de6('0xe'));var Papa=require('papaparse');var Redis=require(_0x4de6('0xf'));var authService=require(_0x4de6('0x10'));var qs=require(_0x4de6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4de6('0x12'));var logger=require(_0x4de6('0x13'))(_0x4de6('0x14'));var utils=require(_0x4de6('0x15'));var config=require(_0x4de6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4de6('0x17'))['db'];function respondWithStatusCode(_0x3baa31,_0xb8e256){_0xb8e256=_0xb8e256||0xcc;return function(_0x509002){if(_0x509002){return _0x3baa31[_0x4de6('0x18')](_0xb8e256);}return _0x3baa31[_0x4de6('0x19')](_0xb8e256)[_0x4de6('0x1a')]();};}function respondWithResult(_0x2bd121,_0x58b0c1){_0x58b0c1=_0x58b0c1||0xc8;return function(_0x1ccfee){if(_0x1ccfee){return _0x2bd121[_0x4de6('0x19')](_0x58b0c1)[_0x4de6('0x1b')](_0x1ccfee);}};}function respondWithFilteredResult(_0x4dd3b5,_0x33fd67){return function(_0x54e2f2){if(_0x54e2f2){var _0x4cbb5c=typeof _0x33fd67[_0x4de6('0x1c')]===_0x4de6('0x1d')&&typeof _0x33fd67[_0x4de6('0x1e')]===_0x4de6('0x1d');var _0x37975a=_0x54e2f2[_0x4de6('0x1f')];var _0x324202=_0x4cbb5c?0x0:_0x33fd67['offset'];var _0x420f7c=_0x4cbb5c?_0x54e2f2[_0x4de6('0x1f')]:_0x33fd67[_0x4de6('0x1c')]+_0x33fd67[_0x4de6('0x1e')];var _0x167c7c;if(_0x420f7c>=_0x37975a){_0x420f7c=_0x37975a;_0x167c7c=0xc8;}else{_0x167c7c=0xce;}_0x4dd3b5[_0x4de6('0x19')](_0x167c7c);return _0x4dd3b5[_0x4de6('0x20')](_0x4de6('0x21'),_0x324202+'-'+_0x420f7c+'/'+_0x37975a)[_0x4de6('0x1b')](_0x54e2f2);}return null;};}function patchUpdates(_0x15c923){return function(_0x4c4d13){try{jsonpatch[_0x4de6('0x22')](_0x4c4d13,_0x15c923,!![]);}catch(_0x51ad13){return BPromise[_0x4de6('0x23')](_0x51ad13);}return _0x4c4d13[_0x4de6('0x24')]();};}function saveUpdates(_0x43771b,_0x5de99f){return function(_0xe1b69d){if(_0xe1b69d){return _0xe1b69d['update'](_0x43771b)[_0x4de6('0x25')](function(_0x385cae){return _0x385cae;});}return null;};}function removeEntity(_0x1a64e9,_0x5ddbab){return function(_0x478d83){if(_0x478d83){return _0x478d83[_0x4de6('0x26')]()[_0x4de6('0x25')](function(){var _0x3be904=_0x478d83[_0x4de6('0x27')]({'plain':!![]});var _0x25a76b=_0x4de6('0x28');return db['UserProfileResource'][_0x4de6('0x26')]({'where':{'type':_0x25a76b,'resourceId':_0x3be904['id']}})[_0x4de6('0x25')](function(){return _0x478d83;});})[_0x4de6('0x25')](function(){_0x1a64e9[_0x4de6('0x19')](0xcc)[_0x4de6('0x1a')]();});}};}function handleEntityNotFound(_0x281060,_0xa2b88c){return function(_0x7bc61e){if(!_0x7bc61e){_0x281060[_0x4de6('0x18')](0x194);}return _0x7bc61e;};}function handleError(_0x4f168b,_0x2065b4){_0x2065b4=_0x2065b4||0x1f4;return function(_0x2a5592){logger[_0x4de6('0x29')](_0x2a5592[_0x4de6('0x2a')]);if(_0x2a5592[_0x4de6('0x2b')]){delete _0x2a5592['name'];}_0x4f168b[_0x4de6('0x19')](_0x2065b4)['send'](_0x2a5592);};}exports[_0x4de6('0x2c')]=function(_0x2bfc77,_0x1df7c0){var _0x1b5607={},_0x592799={},_0x5593e8={'count':0x0,'rows':[]};var _0x530e04=_['map'](db['Tag'][_0x4de6('0x2d')],function(_0x1da3b1){return{'name':_0x1da3b1[_0x4de6('0x2e')],'type':_0x1da3b1[_0x4de6('0x2f')][_0x4de6('0x30')]};});_0x592799[_0x4de6('0x31')]=_[_0x4de6('0x32')](_0x530e04,_0x4de6('0x2b'));_0x592799[_0x4de6('0x33')]=_[_0x4de6('0x34')](_0x2bfc77[_0x4de6('0x33')]);_0x592799[_0x4de6('0x35')]=_[_0x4de6('0x36')](_0x592799[_0x4de6('0x31')],_0x592799[_0x4de6('0x33')]);_0x1b5607[_0x4de6('0x37')]=_[_0x4de6('0x36')](_0x592799[_0x4de6('0x31')],qs[_0x4de6('0x38')](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x38')]));_0x1b5607[_0x4de6('0x37')]=_0x1b5607[_0x4de6('0x37')][_0x4de6('0x39')]?_0x1b5607[_0x4de6('0x37')]:_0x592799[_0x4de6('0x31')];if(!_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3a')](_0x4de6('0x3b'))){_0x1b5607['limit']=qs[_0x4de6('0x1e')](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x1e')]);_0x1b5607[_0x4de6('0x1c')]=qs['offset'](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x1c')]);}_0x1b5607[_0x4de6('0x3c')]=qs[_0x4de6('0x3d')](_0x2bfc77['query'][_0x4de6('0x3d')]);_0x1b5607['where']=qs[_0x4de6('0x35')](_[_0x4de6('0x3e')](_0x2bfc77[_0x4de6('0x33')],_0x592799[_0x4de6('0x35')]),_0x530e04);if(_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3f')]){_0x1b5607[_0x4de6('0x40')]=_[_0x4de6('0x41')](_0x1b5607[_0x4de6('0x40')],{'$or':_[_0x4de6('0x32')](_0x530e04,function(_0x85581b){if(_0x85581b[_0x4de6('0x2f')]!=='VIRTUAL'){var _0x57a6ca={};_0x57a6ca[_0x85581b[_0x4de6('0x2b')]]={'$like':'%'+_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3f')]+'%'};return _0x57a6ca;}})});}_0x1b5607=_[_0x4de6('0x41')]({},_0x1b5607,_0x2bfc77['options']);var _0x5d07aa={'where':_0x1b5607[_0x4de6('0x40')]};return db['Tag'][_0x4de6('0x1f')](_0x5d07aa)['then'](function(_0x3696c8){_0x5593e8['count']=_0x3696c8;if(_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x42')]){_0x1b5607[_0x4de6('0x43')]=[{'all':!![]}];}return db[_0x4de6('0x44')]['findAll'](_0x1b5607);})[_0x4de6('0x25')](function(_0x4049ed){_0x5593e8['rows']=_0x4049ed;return _0x5593e8;})['then'](respondWithFilteredResult(_0x1df7c0,_0x1b5607))[_0x4de6('0x45')](handleError(_0x1df7c0,null));};exports['show']=function(_0x118eb3,_0x3260bc){var _0x3f0f08={'raw':!![],'where':{'id':_0x118eb3[_0x4de6('0x46')]['id']}},_0x349688={};_0x349688[_0x4de6('0x31')]=_[_0x4de6('0x34')](db[_0x4de6('0x44')][_0x4de6('0x2d')]);_0x349688[_0x4de6('0x33')]=_[_0x4de6('0x34')](_0x118eb3[_0x4de6('0x33')]);_0x349688['filters']=_['intersection'](_0x349688['model'],_0x349688[_0x4de6('0x33')]);_0x3f0f08[_0x4de6('0x37')]=_['intersection'](_0x349688['model'],qs[_0x4de6('0x38')](_0x118eb3['query'][_0x4de6('0x38')]));_0x3f0f08[_0x4de6('0x37')]=_0x3f0f08['attributes'][_0x4de6('0x39')]?_0x3f0f08[_0x4de6('0x37')]:_0x349688[_0x4de6('0x31')];if(_0x118eb3[_0x4de6('0x33')][_0x4de6('0x42')]){_0x3f0f08['include']=[{'all':!![]}];}_0x3f0f08=_[_0x4de6('0x41')]({},_0x3f0f08,_0x118eb3[_0x4de6('0x47')]);return db[_0x4de6('0x44')][_0x4de6('0x48')](_0x3f0f08)[_0x4de6('0x25')](handleEntityNotFound(_0x3260bc,null))[_0x4de6('0x25')](respondWithResult(_0x3260bc,null))[_0x4de6('0x45')](handleError(_0x3260bc,null));};exports[_0x4de6('0x49')]=function(_0x698dcb,_0x3126f1){return db[_0x4de6('0x44')][_0x4de6('0x49')](_0x698dcb[_0x4de6('0x4a')],{})[_0x4de6('0x25')](function(_0x354558){var _0x12ce25=_0x698dcb[_0x4de6('0x4b')]['get']({'plain':!![]});if(!_0x12ce25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ce25[_0x4de6('0x4c')]===_0x4de6('0x4b')){var _0x524807=_0x354558[_0x4de6('0x27')]({'plain':!![]});var _0x191f93=_0x4de6('0x28');return db[_0x4de6('0x4d')][_0x4de6('0x48')]({'where':{'name':_0x191f93,'userProfileId':_0x12ce25[_0x4de6('0x4e')]},'raw':!![]})[_0x4de6('0x25')](function(_0x502e4d){if(_0x502e4d&&_0x502e4d[_0x4de6('0x4f')]===0x0){return db['UserProfileResource'][_0x4de6('0x49')]({'name':_0x524807[_0x4de6('0x2b')],'resourceId':_0x524807['id'],'type':_0x502e4d[_0x4de6('0x2b')],'sectionId':_0x502e4d['id']},{})[_0x4de6('0x25')](function(){return _0x354558;});}else{return _0x354558;}})[_0x4de6('0x45')](function(_0xac3eb5){logger[_0x4de6('0x29')](_0x4de6('0x50'),_0xac3eb5);throw _0xac3eb5;});}return _0x354558;})['then'](respondWithResult(_0x3126f1,0xc9))['catch'](handleError(_0x3126f1,null));};exports[_0x4de6('0x51')]=function(_0x198054,_0x61bc5d){if(_0x198054[_0x4de6('0x4a')]['id']){delete _0x198054['body']['id'];}return db[_0x4de6('0x44')][_0x4de6('0x48')]({'where':{'id':_0x198054[_0x4de6('0x46')]['id']}})['then'](handleEntityNotFound(_0x61bc5d,null))[_0x4de6('0x25')](saveUpdates(_0x198054['body'],null))[_0x4de6('0x25')](respondWithResult(_0x61bc5d,null))[_0x4de6('0x45')](handleError(_0x61bc5d,null));};exports['destroy']=function(_0x19f34a,_0x1b71cf){return db['Tag'][_0x4de6('0x48')]({'where':{'id':_0x19f34a[_0x4de6('0x46')]['id']}})[_0x4de6('0x25')](handleEntityNotFound(_0x1b71cf,null))[_0x4de6('0x25')](removeEntity(_0x1b71cf,null))[_0x4de6('0x45')](handleError(_0x1b71cf,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index b468014..687af04 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 _0x5262=['Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./tag.attributes','exports','define'];(function(_0x5e6fc7,_0x1151b0){var _0x2af1c9=function(_0x1d35df){while(--_0x1d35df){_0x5e6fc7['push'](_0x5e6fc7['shift']());}};_0x2af1c9(++_0x1151b0);}(_0x5262,0xc2));var _0x2526=function(_0xe83405,_0x45c437){_0xe83405=_0xe83405-0x0;var _0x13c948=_0x5262[_0xe83405];return _0x13c948;};'use strict';var _=require(_0x2526('0x0'));var util=require(_0x2526('0x1'));var logger=require(_0x2526('0x2'))(_0x2526('0x3'));var moment=require('moment');var BPromise=require(_0x2526('0x4'));var rp=require(_0x2526('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2526('0x6'));var attributes=require(_0x2526('0x7'));module[_0x2526('0x8')]=function(_0x378e13,_0x53644f){return _0x378e13[_0x2526('0x9')](_0x2526('0xa'),attributes,{'tableName':_0x2526('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf27b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Tag','tools_tags'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0xf27b,0x12b));var _0xbf27=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0xf27b[_0x3b632f];return _0x10e788;};'use strict';var _=require('lodash');var util=require(_0xbf27('0x0'));var logger=require(_0xbf27('0x1'))(_0xbf27('0x2'));var moment=require(_0xbf27('0x3'));var BPromise=require(_0xbf27('0x4'));var rp=require(_0xbf27('0x5'));var fs=require('fs');var path=require(_0xbf27('0x6'));var rimraf=require(_0xbf27('0x7'));var config=require(_0xbf27('0x8'));var attributes=require('./tag.attributes');module[_0xbf27('0x9')]=function(_0x25d8f3,_0x3218e8){return _0x25d8f3[_0xbf27('0xa')](_0xbf27('0xb'),attributes,{'tableName':_0xbf27('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 00b95a3..dcaaf01 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 _0xaba6=['../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaba6,0xe2));var _0x6aba=function(_0x2b3b07,_0xa237cb){_0x2b3b07=_0x2b3b07-0x0;var _0x553ac5=_0xaba6[_0x2b3b07];return _0x553ac5;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aba('0x2'))['db'];var utils=require(_0x6aba('0x3'));var logger=require('../../config/logger')(_0x6aba('0x4'));var config=require(_0x6aba('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39c32a,_0x54416a,_0x3766d4){return new BPromise(function(_0x1a4fbc,_0x508dff){return client[_0x6aba('0x6')](_0x39c32a,_0x3766d4)[_0x6aba('0x7')](function(_0x4ea8eb){logger[_0x6aba('0x8')](_0x6aba('0x9'),_0x54416a,_0x6aba('0xa'));logger[_0x6aba('0xb')](_0x6aba('0xc'),_0x54416a,_0x6aba('0xa'),JSON[_0x6aba('0xd')](_0x4ea8eb));if(_0x4ea8eb['error']){if(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0xf')]===0x1f4){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb['error'][_0x6aba('0x10')]);return _0x508dff(_0x4ea8eb[_0x6aba('0xe')]['message']);}logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb[_0x6aba('0xe')]['message']);return _0x1a4fbc(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0x10')]);}else{logger[_0x6aba('0x8')]('Tag,\x20%s,\x20%s',_0x54416a,_0x6aba('0xa'));_0x1a4fbc(_0x4ea8eb[_0x6aba('0x11')][_0x6aba('0x10')]);}})[_0x6aba('0x12')](function(_0x379b17){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x379b17);_0x508dff(_0x379b17);});});} \ No newline at end of file +var _0x6b19=['error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b19,0xe8));var _0x96b1=function(_0x2770a7,_0x69984){_0x2770a7=_0x2770a7-0x0;var _0x2ba67a=_0x6b19[_0x2770a7];return _0x2ba67a;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index af84255..5631304 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 cead1af..05d2a55 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x5b2a11,_0x489961){var _0x1900f3=function(_0xb97d05){while(--_0xb97d05){_0x5b2a11['push'](_0x5b2a11['shift']());}};_0x1900f3(++_0x489961);}(_0x757a,0xde));var _0xa757=function(_0x5e7724,_0x484fae){_0x5e7724=_0x5e7724-0x0;var _0x426f77=_0x757a[_0x5e7724];return _0x426f77;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0xfab21c,_0x17dbed){var _0x3af8f3=function(_0x34f2d6){while(--_0x34f2d6){_0xfab21c['push'](_0xfab21c['shift']());}};_0x3af8f3(++_0x17dbed);}(_0xb10b,0x12a));var _0xbb10=function(_0x132399,_0x1c4b0f){_0x132399=_0x132399-0x0;var _0x2a27e9=_0xb10b[_0x132399];return _0x2a27e9;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 4788e80..012b463 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 _0x3248=['order','sort','where','pick','filter','VIRTUAL','merge','options','Team','then','includeAll','include','rows','catch','params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','UserVoiceQueue','destroy','QueryTypes','MailQueueId','UserMailQueue','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Openchannel','Whatsapp','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','QueueId','findAll','online','interface','UserVoiceQueueRt','upsert','isNil','format','voicePause','all','UserVoicePrefix','spread','removeAgents','Fax','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','error','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x34baa1,_0x5c1e7a){var _0x49529b=function(_0x1cea72){while(--_0x1cea72){_0x34baa1['push'](_0x34baa1['shift']());}};_0x49529b(++_0x5c1e7a);}(_0x3248,0x199));var _0x8324=function(_0x27a296,_0x2f57dc){_0x27a296=_0x27a296-0x0;var _0x200bde=_0x3248[_0x27a296];return _0x200bde;};'use strict';var emlformat=require(_0x8324('0x0'));var rimraf=require(_0x8324('0x1'));var zipdir=require(_0x8324('0x2'));var jsonpatch=require(_0x8324('0x3'));var rp=require(_0x8324('0x4'));var moment=require(_0x8324('0x5'));var BPromise=require(_0x8324('0x6'));var Mustache=require(_0x8324('0x7'));var util=require('util');var path=require(_0x8324('0x8'));var sox=require('sox');var csv=require(_0x8324('0x9'));var ejs=require(_0x8324('0xa'));var fs=require('fs');var fs_extra=require(_0x8324('0xb'));var _=require(_0x8324('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8324('0xd'));var toCsv=require(_0x8324('0x9'));var querystring=require(_0x8324('0xe'));var Papa=require(_0x8324('0xf'));var Redis=require(_0x8324('0x10'));var authService=require(_0x8324('0x11'));var qs=require(_0x8324('0x12'));var as=require(_0x8324('0x13'));var hardwareService=require(_0x8324('0x14'));var logger=require(_0x8324('0x15'))(_0x8324('0x16'));var utils=require(_0x8324('0x17'));var config=require(_0x8324('0x18'));var licenseUtil=require(_0x8324('0x19'));var db=require('../../mysqldb')['db'];config[_0x8324('0x1a')]=_[_0x8324('0x1b')](config[_0x8324('0x1a')],{'host':_0x8324('0x1c'),'port':0x18eb});var socket=require(_0x8324('0x1d'))(new Redis(config[_0x8324('0x1a')]));require(_0x8324('0x1e'))[_0x8324('0x1f')](socket);function respondWithStatusCode(_0x4b3af6,_0xc85cf0){_0xc85cf0=_0xc85cf0||0xcc;return function(_0x3f03a5){if(_0x3f03a5){return _0x4b3af6[_0x8324('0x20')](_0xc85cf0);}return _0x4b3af6[_0x8324('0x21')](_0xc85cf0)[_0x8324('0x22')]();};}function respondWithResult(_0x475647,_0xacdad4){_0xacdad4=_0xacdad4||0xc8;return function(_0xb7b794){if(_0xb7b794){return _0x475647[_0x8324('0x21')](_0xacdad4)[_0x8324('0x23')](_0xb7b794);}};}function respondWithFilteredResult(_0x26d50e,_0x3cf402){return function(_0x3b0c9d){if(_0x3b0c9d){var _0x502d5d=typeof _0x3cf402[_0x8324('0x24')]===_0x8324('0x25')&&typeof _0x3cf402[_0x8324('0x26')]===_0x8324('0x25');var _0xaa7a72=_0x3b0c9d[_0x8324('0x27')];var _0x361fed=_0x502d5d?0x0:_0x3cf402[_0x8324('0x24')];var _0x497939=_0x502d5d?_0x3b0c9d[_0x8324('0x27')]:_0x3cf402[_0x8324('0x24')]+_0x3cf402[_0x8324('0x26')];var _0x4ce92c;if(_0x497939>=_0xaa7a72){_0x497939=_0xaa7a72;_0x4ce92c=0xc8;}else{_0x4ce92c=0xce;}_0x26d50e[_0x8324('0x21')](_0x4ce92c);return _0x26d50e['set']('Content-Range',_0x361fed+'-'+_0x497939+'/'+_0xaa7a72)[_0x8324('0x23')](_0x3b0c9d);}return null;};}function patchUpdates(_0x3c0f22){return function(_0x30a31a){try{jsonpatch[_0x8324('0x28')](_0x30a31a,_0x3c0f22,!![]);}catch(_0x1b32d0){return BPromise['reject'](_0x1b32d0);}return _0x30a31a[_0x8324('0x29')]();};}function saveUpdates(_0x34407c,_0x52dc05){return function(_0x2407da){if(_0x2407da){return _0x2407da[_0x8324('0x2a')](_0x34407c)['then'](function(_0x2e15bd){return _0x2e15bd;});}return null;};}function handleEntityNotFound(_0x3ff7a3,_0x1b9964){return function(_0x23edaf){if(!_0x23edaf){_0x3ff7a3[_0x8324('0x20')](0x194);}return _0x23edaf;};}function handleError(_0x4cf7c5,_0x5e33a7){_0x5e33a7=_0x5e33a7||0x1f4;return function(_0x390d6a){logger[_0x8324('0x2b')](_0x390d6a['stack']);if(_0x390d6a[_0x8324('0x2c')]){delete _0x390d6a[_0x8324('0x2c')];}_0x4cf7c5[_0x8324('0x21')](_0x5e33a7)[_0x8324('0x2d')](_0x390d6a);};}exports[_0x8324('0x2e')]=function(_0x362849,_0x52bcff){var _0x16300a={},_0x5212e6={},_0x5a4b86={'count':0x0,'rows':[]};var _0xf7d70b=_[_0x8324('0x2f')](db['Team'][_0x8324('0x30')],function(_0x401827){return{'name':_0x401827[_0x8324('0x31')],'type':_0x401827['type']['key']};});_0x5212e6[_0x8324('0x32')]=_[_0x8324('0x2f')](_0xf7d70b,_0x8324('0x2c'));_0x5212e6['query']=_[_0x8324('0x33')](_0x362849[_0x8324('0x34')]);_0x5212e6[_0x8324('0x35')]=_[_0x8324('0x36')](_0x5212e6[_0x8324('0x32')],_0x5212e6[_0x8324('0x34')]);_0x16300a[_0x8324('0x37')]=_['intersection'](_0x5212e6[_0x8324('0x32')],qs['fields'](_0x362849[_0x8324('0x34')][_0x8324('0x38')]));_0x16300a['attributes']=_0x16300a[_0x8324('0x37')]['length']?_0x16300a[_0x8324('0x37')]:_0x5212e6['model'];if(!_0x362849[_0x8324('0x34')][_0x8324('0x39')](_0x8324('0x3a'))){_0x16300a[_0x8324('0x26')]=qs[_0x8324('0x26')](_0x362849['query'][_0x8324('0x26')]);_0x16300a[_0x8324('0x24')]=qs[_0x8324('0x24')](_0x362849[_0x8324('0x34')][_0x8324('0x24')]);}_0x16300a[_0x8324('0x3b')]=qs['sort'](_0x362849[_0x8324('0x34')][_0x8324('0x3c')]);_0x16300a[_0x8324('0x3d')]=qs['filters'](_[_0x8324('0x3e')](_0x362849[_0x8324('0x34')],_0x5212e6[_0x8324('0x35')]),_0xf7d70b);if(_0x362849[_0x8324('0x34')][_0x8324('0x3f')]){_0x16300a[_0x8324('0x3d')]=_['merge'](_0x16300a[_0x8324('0x3d')],{'$or':_[_0x8324('0x2f')](_0xf7d70b,function(_0x262976){if(_0x262976['type']!==_0x8324('0x40')){var _0x1ad2ca={};_0x1ad2ca[_0x262976[_0x8324('0x2c')]]={'$like':'%'+_0x362849[_0x8324('0x34')]['filter']+'%'};return _0x1ad2ca;}})});}_0x16300a=_[_0x8324('0x41')]({},_0x16300a,_0x362849[_0x8324('0x42')]);var _0x4d5d78={'where':_0x16300a['where']};return db[_0x8324('0x43')][_0x8324('0x27')](_0x4d5d78)[_0x8324('0x44')](function(_0x4151bf){_0x5a4b86[_0x8324('0x27')]=_0x4151bf;if(_0x362849['query'][_0x8324('0x45')]){_0x16300a[_0x8324('0x46')]=[{'all':!![]}];}return db[_0x8324('0x43')]['findAll'](_0x16300a);})['then'](function(_0x53fd49){_0x5a4b86[_0x8324('0x47')]=_0x53fd49;return _0x5a4b86;})[_0x8324('0x44')](respondWithFilteredResult(_0x52bcff,_0x16300a))[_0x8324('0x48')](handleError(_0x52bcff,null));};exports['show']=function(_0x45706c,_0x1f364e){var _0x3a6ee4={'raw':![],'where':{'id':_0x45706c[_0x8324('0x49')]['id']}},_0x2c7159={};_0x2c7159['model']=_[_0x8324('0x33')](db[_0x8324('0x43')][_0x8324('0x30')]);_0x2c7159['query']=_[_0x8324('0x33')](_0x45706c['query']);_0x2c7159[_0x8324('0x35')]=_[_0x8324('0x36')](_0x2c7159[_0x8324('0x32')],_0x2c7159[_0x8324('0x34')]);_0x3a6ee4['attributes']=_['intersection'](_0x2c7159[_0x8324('0x32')],qs[_0x8324('0x38')](_0x45706c[_0x8324('0x34')][_0x8324('0x38')]));_0x3a6ee4['attributes']=_0x3a6ee4['attributes'][_0x8324('0x4a')]?_0x3a6ee4[_0x8324('0x37')]:_0x2c7159[_0x8324('0x32')];if(_0x45706c['query'][_0x8324('0x45')]){_0x3a6ee4[_0x8324('0x46')]=[{'all':!![]}];}_0x3a6ee4=_[_0x8324('0x41')]({},_0x3a6ee4,_0x45706c['options']);return db[_0x8324('0x43')][_0x8324('0x4b')](_0x3a6ee4)[_0x8324('0x44')](handleEntityNotFound(_0x1f364e,null))['then'](respondWithResult(_0x1f364e,null))[_0x8324('0x48')](handleError(_0x1f364e,null));};exports[_0x8324('0x4c')]=function(_0x5e38e3,_0x566998){return db['Team'][_0x8324('0x4c')](_0x5e38e3['body'],{})[_0x8324('0x44')](function(_0x508231){var _0x2d8c7d=_0x5e38e3[_0x8324('0x4d')][_0x8324('0x4e')]({'plain':!![]});if(!_0x2d8c7d)throw new Error(_0x8324('0x4f'));if(_0x2d8c7d[_0x8324('0x50')]==='user'){var _0x3ad4e0=_0x508231[_0x8324('0x4e')]({'plain':!![]});var _0x5c4f66=_0x8324('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x5c4f66,'userProfileId':_0x2d8c7d[_0x8324('0x52')]},'raw':!![]})[_0x8324('0x44')](function(_0x27c174){if(_0x27c174&&_0x27c174[_0x8324('0x53')]===0x0){return db[_0x8324('0x54')]['create']({'name':_0x3ad4e0['name'],'resourceId':_0x3ad4e0['id'],'type':_0x27c174[_0x8324('0x2c')],'sectionId':_0x27c174['id']},{})[_0x8324('0x44')](function(){return _0x508231;});}else{return _0x508231;}})['catch'](function(_0x53f90e){logger[_0x8324('0x2b')](_0x8324('0x55'),_0x53f90e);throw _0x53f90e;});}return _0x508231;})[_0x8324('0x44')](respondWithResult(_0x566998,0xc9))['catch'](handleError(_0x566998,null));};exports['update']=function(_0x3839a6,_0x1a4998){if(_0x3839a6[_0x8324('0x56')]['id']){delete _0x3839a6[_0x8324('0x56')]['id'];}return db[_0x8324('0x43')][_0x8324('0x4b')]({'where':{'id':_0x3839a6[_0x8324('0x49')]['id']}})[_0x8324('0x44')](handleEntityNotFound(_0x1a4998,null))['then'](saveUpdates(_0x3839a6['body'],null))[_0x8324('0x44')](respondWithResult(_0x1a4998,null))[_0x8324('0x48')](handleError(_0x1a4998,null));};exports['destroy']=function(_0x505d14,_0x2d0f84){var _0x3e320c=_0x505d14['params']['id'];var _0x4af8de=[];return db[_0x8324('0x57')][_0x8324('0x58')](function(_0x36e1c3){var _0x101e9c=_0x8324('0x59')+_0x3e320c;return db['sequelize']['query'](_0x101e9c,{'type':db[_0x8324('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x36e1c3})['then'](function(_0x4fff27){_0x4af8de=_[_0x8324('0x2f')](_0x4fff27,function(_0x57113b){return Number(_0x57113b[_0x8324('0x5b')]);});})[_0x8324('0x44')](function(){var _0x1413cd=_0x8324('0x5c')+_0x3e320c;return db[_0x8324('0x57')][_0x8324('0x34')](_0x1413cd,{'type':db[_0x8324('0x5a')]['QueryTypes'][_0x8324('0x5d')],'raw':!![],'transaction':_0x36e1c3});})[_0x8324('0x44')](function(_0x2093cb){var _0x1b0b69=_['map'](_0x2093cb,function(_0x3ca1ac){return Number(_0x3ca1ac[_0x8324('0x5e')]);});return db[_0x8324('0x5f')][_0x8324('0x60')]({'where':{'UserId':{'$in':_0x4af8de},'VoiceQueueId':{'$in':_0x1b0b69}},'transaction':_0x36e1c3});})[_0x8324('0x44')](function(){var _0x4febff='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e320c;return db[_0x8324('0x57')][_0x8324('0x34')](_0x4febff,{'type':db['Sequelize'][_0x8324('0x61')][_0x8324('0x5d')],'raw':!![],'transaction':_0x36e1c3});})[_0x8324('0x44')](function(_0x232403){var _0x46279b=_['map'](_0x232403,function(_0x268430){return Number(_0x268430[_0x8324('0x62')]);});return db[_0x8324('0x63')][_0x8324('0x60')]({'where':{'UserId':{'$in':_0x4af8de},'MailQueueId':{'$in':_0x46279b}},'transaction':_0x36e1c3});})[_0x8324('0x44')](function(){var _0x3e7119='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e320c;return db[_0x8324('0x57')][_0x8324('0x34')](_0x3e7119,{'type':db[_0x8324('0x5a')][_0x8324('0x61')][_0x8324('0x5d')],'raw':!![],'transaction':_0x36e1c3});})[_0x8324('0x44')](function(_0x3fc950){var _0x312a38=_[_0x8324('0x2f')](_0x3fc950,function(_0x28ac8b){return Number(_0x28ac8b['SmsQueueId']);});return db[_0x8324('0x64')][_0x8324('0x60')]({'where':{'UserId':{'$in':_0x4af8de},'SmsQueueId':{'$in':_0x312a38}},'transaction':_0x36e1c3});})['then'](function(){var _0x50c4e6=_0x8324('0x65')+_0x3e320c;return db[_0x8324('0x57')][_0x8324('0x34')](_0x50c4e6,{'type':db[_0x8324('0x5a')]['QueryTypes'][_0x8324('0x5d')],'raw':!![],'transaction':_0x36e1c3});})[_0x8324('0x44')](function(_0x392cf2){var _0x2c43cf=_[_0x8324('0x2f')](_0x392cf2,function(_0x3ec086){return Number(_0x3ec086[_0x8324('0x66')]);});return db[_0x8324('0x67')][_0x8324('0x60')]({'where':{'UserId':{'$in':_0x4af8de},'ChatQueueId':{'$in':_0x2c43cf}},'transaction':_0x36e1c3});})[_0x8324('0x44')](function(){var _0x44be58='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e320c;return db[_0x8324('0x57')][_0x8324('0x34')](_0x44be58,{'type':db['Sequelize'][_0x8324('0x61')][_0x8324('0x5d')],'raw':!![],'transaction':_0x36e1c3});})[_0x8324('0x44')](function(_0x49be0f){var _0x591e14=_[_0x8324('0x2f')](_0x49be0f,function(_0x16423a){return Number(_0x16423a[_0x8324('0x68')]);});return db[_0x8324('0x69')][_0x8324('0x60')]({'where':{'UserId':{'$in':_0x4af8de},'FaxQueueId':{'$in':_0x591e14}},'transaction':_0x36e1c3});})[_0x8324('0x44')](function(){var _0x12d6b4=_0x8324('0x6a')+_0x3e320c;return db[_0x8324('0x57')]['query'](_0x12d6b4,{'type':db[_0x8324('0x5a')][_0x8324('0x61')][_0x8324('0x5d')],'raw':!![],'transaction':_0x36e1c3});})[_0x8324('0x44')](function(_0x329edf){var _0x103a94=_['map'](_0x329edf,function(_0x476729){return Number(_0x476729[_0x8324('0x6b')]);});return db[_0x8324('0x6c')][_0x8324('0x60')]({'where':{'UserId':{'$in':_0x4af8de},'OpenchannelQueueId':{'$in':_0x103a94}},'transaction':_0x36e1c3});})[_0x8324('0x44')](function(){var _0x4dfabf='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e320c;return db[_0x8324('0x57')][_0x8324('0x34')](_0x4dfabf,{'type':db['Sequelize'][_0x8324('0x61')][_0x8324('0x5d')],'raw':!![],'transaction':_0x36e1c3});})['then'](function(_0x3dc534){var _0x2da780=_['map'](_0x3dc534,function(_0x2f0fc6){return Number(_0x2f0fc6[_0x8324('0x6d')]);});return db[_0x8324('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x4af8de},'WhatsappQueueId':{'$in':_0x2da780}},'transaction':_0x36e1c3});})[_0x8324('0x44')](function(){return db[_0x8324('0x6f')]['find']({'where':{'TeamId':_0x3e320c}});})[_0x8324('0x44')](function(_0x375297){if(_0x375297===null){return;}return db['UserVoicePrefix'][_0x8324('0x60')]({'where':{'UserId':{'$in':_0x4af8de},'VoicePrefixId':_0x375297[_0x8324('0x70')]},'transaction':_0x36e1c3});})[_0x8324('0x44')](function(){return db[_0x8324('0x43')][_0x8324('0x60')]({'where':{'id':_0x3e320c},'cascade':!![],'transaction':_0x36e1c3});})['then'](function(_0x36019d){if(_0x36019d===0x0){_0x2d0f84[_0x8324('0x20')](0x194);}else{return db['UserProfileResource'][_0x8324('0x60')]({'where':{'type':_0x8324('0x51'),'resourceId':_0x3e320c},'cascade':!![],'transaction':_0x36e1c3})[_0x8324('0x44')](function(){_0x2d0f84[_0x8324('0x21')](0xcc)[_0x8324('0x22')]();});}})[_0x8324('0x48')](function(_0x5d6dbf){_0x2d0f84[_0x8324('0x21')](0x1f4)[_0x8324('0x2d')](_0x5d6dbf);});});};exports['getQueues']=function(_0x2b472c,_0xb130bf,_0x5b2e8f){return db['Team'][_0x8324('0x71')]({'where':{'id':_0x2b472c['params']['id']}})[_0x8324('0x44')](handleEntityNotFound(_0xb130bf,null))[_0x8324('0x44')](function(_0x4d8d0c){if(!_0x2b472c[_0x8324('0x34')][_0x8324('0x72')]||!utils[_0x8324('0x73')](_0x2b472c[_0x8324('0x34')]['channel'])){throw new db[(_0x8324('0x5a'))][(_0x8324('0x74'))](_0x8324('0x75'));}var _0x48c5ea={};var _0x7fa576={};_0x7fa576[_0x8324('0x32')]=_[_0x8324('0x33')](db[_[_0x8324('0x76')](_0x2b472c['query']['channel']['toLowerCase']())+_0x8324('0x77')]['rawAttributes']);_0x7fa576[_0x8324('0x34')]=_['keys'](_0x2b472c[_0x8324('0x34')]);_0x7fa576['filters']=_['intersection'](_0x7fa576[_0x8324('0x32')],_0x7fa576[_0x8324('0x34')]);_0x48c5ea[_0x8324('0x37')]=_['intersection'](_0x7fa576[_0x8324('0x32')],qs[_0x8324('0x38')](_0x2b472c[_0x8324('0x34')][_0x8324('0x38')]));_0x48c5ea[_0x8324('0x37')]=_0x48c5ea[_0x8324('0x37')]['length']?_0x48c5ea['attributes']:_0x7fa576[_0x8324('0x32')];_0x48c5ea[_0x8324('0x26')]=qs[_0x8324('0x26')](_0x2b472c[_0x8324('0x34')]['limit']);_0x48c5ea[_0x8324('0x24')]=qs[_0x8324('0x24')](_0x2b472c[_0x8324('0x34')][_0x8324('0x24')]);_0x48c5ea['order']=qs[_0x8324('0x3c')](_0x2b472c[_0x8324('0x34')][_0x8324('0x3c')]);_0x48c5ea[_0x8324('0x3d')]=qs['filters'](_[_0x8324('0x3e')](_0x2b472c['query'],_0x7fa576[_0x8324('0x35')]));_0x48c5ea=_[_0x8324('0x41')]({},_0x48c5ea,_0x2b472c[_0x8324('0x42')]);return _0x4d8d0c[_0x8324('0x4e')+_[_0x8324('0x76')](_0x2b472c[_0x8324('0x34')][_0x8324('0x72')][_0x8324('0x78')]())+_0x8324('0x79')](_0x48c5ea);})[_0x8324('0x44')](respondWithResult(_0xb130bf,null))['catch'](handleError(_0xb130bf,null));};exports[_0x8324('0x7a')]=function(_0x4f3c04,_0x45f28c,_0x4be75c){return db['Team'][_0x8324('0x71')]({'where':{'id':_0x4f3c04[_0x8324('0x49')]['id']}})[_0x8324('0x44')](function(_0x196e94){if(_0x196e94){if(!_0x4f3c04['body'][_0x8324('0x72')]||!utils['isValidChannel'](_0x4f3c04['body'][_0x8324('0x72')])){throw new db[(_0x8324('0x5a'))][(_0x8324('0x74'))](_0x8324('0x75'));}return _0x196e94[_0x8324('0x7b')+_[_0x8324('0x76')](_0x4f3c04[_0x8324('0x56')]['channel'][_0x8324('0x78')]())+_0x8324('0x79')](_0x4f3c04['body'][_0x8324('0x7c')]);}return null;})[_0x8324('0x44')](handleEntityNotFound(_0x45f28c,null))[_0x8324('0x44')](respondWithStatusCode(_0x45f28c,null))[_0x8324('0x48')](handleError(_0x45f28c,null));};exports[_0x8324('0x7d')]=function(_0x4036eb,_0x3d7482,_0xc7484e){return db[_0x8324('0x43')][_0x8324('0x71')]({'where':{'id':_0x4036eb['params']['id']}})['then'](function(_0x4b498b){if(_0x4b498b){if(!_0x4036eb[_0x8324('0x34')]['channel']||!utils[_0x8324('0x73')](_0x4036eb['query'][_0x8324('0x72')])){throw new db[(_0x8324('0x5a'))]['ValidationError']('Unknown\x20channel');}return _0x4b498b[_0x8324('0x7e')+_['capitalize'](_0x4036eb[_0x8324('0x34')][_0x8324('0x72')][_0x8324('0x78')]())+_0x8324('0x79')](_0x4036eb[_0x8324('0x34')][_0x8324('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x3d7482,null))['then'](respondWithStatusCode(_0x3d7482,null))['catch'](handleError(_0x3d7482,null));};exports[_0x8324('0x7f')]=function(_0x5c228d,_0x4b6f3d){var _0x26595d=_[_0x8324('0x80')](_0x5c228d[_0x8324('0x56')][_0x8324('0x7c')])?_0x5c228d[_0x8324('0x56')][_0x8324('0x7c')]:[_0x5c228d[_0x8324('0x56')][_0x8324('0x7c')]];var _0x1b6206=_0x5c228d[_0x8324('0x49')]['id'];return db['Team'][_0x8324('0x4b')]({'where':{'id':_0x1b6206}})[_0x8324('0x44')](handleEntityNotFound(_0x4b6f3d,null))[_0x8324('0x44')](function(_0x2fd4d){if(_0x2fd4d){var _0x399a4a=[_0x8324('0x81'),_0x8324('0x82'),_0x8324('0x83'),'Sms','Fax',_0x8324('0x84'),_0x8324('0x85')];return db[_0x8324('0x57')]['transaction'](function(_0x1ee541){var _0x465fc8=_[_0x8324('0x2f')](_0x399a4a,function(_0x591d69){var _0x3bacc9={'attributes':['id',_0x8324('0x2c')]};if(_0x591d69===_0x8324('0x81')){_0x3bacc9[_0x8324('0x86')]={'attributes':[_0x8324('0x87')]};}return _0x2fd4d['get'+_0x591d69+_0x8324('0x79')](_0x3bacc9)[_0x8324('0x44')](function(_0x45f39d){var _0x4c6dc7=_['map'](_0x45f39d,function(_0xd552bf){var _0x2b1693=_['map'](_0x26595d,function(_0xc86798){var _0x341249={'where':{'UserId':_0xc86798,[_0x591d69+'QueueId']:_0xd552bf['id']},'transaction':_0x1ee541};if(_0x591d69==='Voice'){_0x341249[_0x8324('0x1b')]={'penalty':_0xd552bf[_0x8324('0x88')][_0x8324('0x87')]};}return db[_0x8324('0x89')+_0x591d69+_0x8324('0x77')][_0x8324('0x8a')](_0x341249)[_0x8324('0x44')](function(){socket[_0x8324('0x8b')](_0x8324('0x4d')+_0x591d69+_0x8324('0x8c'),{'UserId':_0xc86798,[_0x591d69+_0x8324('0x8d')]:_0xd552bf['id']});if(_0x591d69!=='Voice'){return;}return db[_0x8324('0x89')][_0x8324('0x8e')]({'where':{'id':_0x26595d,'online':0x1},'attributes':['id',_0x8324('0x2c'),_0x8324('0x8f'),'voicePause',_0x8324('0x90')],'raw':!![]})['then'](function(_0x5a820d){var _0x1ff124=_[_0x8324('0x2f')](_0x5a820d,function(_0x482425){return db[_0x8324('0x91')][_0x8324('0x92')]({'membername':_0x482425['name'],'UserId':_0x482425['id'],'queue_name':_0xd552bf['name'],'VoiceQueueId':_0xd552bf['id'],'interface':_[_0x8324('0x93')](_0x482425[_0x8324('0x90')])?util[_0x8324('0x94')]('SIP/%s',_0x482425['name']):_0x482425[_0x8324('0x90')],'paused':_0x482425[_0x8324('0x95')]||![],'penalty':_0xd552bf['TeamVoiceQueue'][_0x8324('0x87')]},{'transaction':_0x1ee541});});return Promise['all'](_0x1ff124);});});});return Promise[_0x8324('0x96')](_0x2b1693);});return Promise[_0x8324('0x96')](_0x4c6dc7);})[_0x8324('0x44')](function(){return db[_0x8324('0x6f')]['findOne']({'where':{'teamId':_0x1b6206}})[_0x8324('0x44')](function(_0x4496da){if(_0x4496da){var _0x1338e9=_['map'](_0x26595d,function(_0x520808){db[_0x8324('0x97')][_0x8324('0x92')]({'UserId':_0x520808,'VoicePrefixId':_0x4496da[_0x8324('0x70')]});});return Promise[_0x8324('0x96')](_0x1338e9);}});});});return Promise[_0x8324('0x96')](_0x465fc8)[_0x8324('0x44')](function(){return _0x2fd4d['addAgents'](_0x26595d,{'transaction':_0x1ee541})[_0x8324('0x98')](function(_0x5d8fcf){return _0x5d8fcf;});});});}})[_0x8324('0x44')](respondWithResult(_0x4b6f3d,null))[_0x8324('0x48')](handleError(_0x4b6f3d,null));};exports[_0x8324('0x99')]=function(_0x3fa71f,_0x153b8d){var _0x21f97d=_['isArray'](_0x3fa71f[_0x8324('0x34')][_0x8324('0x7c')])?_0x3fa71f[_0x8324('0x34')][_0x8324('0x7c')]:[_0x3fa71f[_0x8324('0x34')][_0x8324('0x7c')]];var _0x3ba3a5=_0x3fa71f[_0x8324('0x49')]['id'];return db[_0x8324('0x43')][_0x8324('0x4b')]({'where':{'id':_0x3ba3a5}})['then'](handleEntityNotFound(_0x153b8d,null))[_0x8324('0x44')](function(_0x37ce19){if(_0x37ce19){var _0x593dfc=[_0x8324('0x81'),'Chat',_0x8324('0x83'),'Sms',_0x8324('0x9a'),_0x8324('0x84'),_0x8324('0x85')];return db[_0x8324('0x57')][_0x8324('0x58')](function(_0x52ce19){var _0x31893a=_[_0x8324('0x2f')](_0x593dfc,function(_0x1cdc8f){var _0xcb07a3={'attributes':['id',_0x8324('0x2c')]};return _0x37ce19[_0x8324('0x4e')+_0x1cdc8f+'Queues'](_0xcb07a3)[_0x8324('0x44')](function(_0x22cbe1){var _0x21a953=_[_0x8324('0x2f')](_0x22cbe1,function(_0x54b027){return _0x54b027['removeAgents'](_0x21f97d,{'transaction':_0x52ce19})['then'](function(){var _0x50097c=_['map'](_0x21f97d,function(_0x5cd950){socket['emit'](_0x8324('0x4d')+_0x1cdc8f+'Queue:remove',{'UserId':Number(_0x5cd950),[_0x1cdc8f+_0x8324('0x8d')]:_0x54b027['id']});if(_0x1cdc8f!==_0x8324('0x81')){return;}return db[_0x8324('0x91')][_0x8324('0x60')]({'where':{'VoiceQueueId':_0x54b027['id'],'UserId':_0x5cd950},'transaction':_0x52ce19});});return Promise['all'](_0x50097c);});});return Promise['all'](_0x21a953);});});return Promise['all'](_0x31893a)[_0x8324('0x44')](function(){return _0x37ce19[_0x8324('0x99')](_0x21f97d,{'transaction':_0x52ce19});})[_0x8324('0x44')](function(){return db[_0x8324('0x6f')][_0x8324('0x71')]({'where':{'teamId':_0x3ba3a5}})[_0x8324('0x44')](function(_0x5bf42f){if(_0x5bf42f){var _0x30e717=_[_0x8324('0x2f')](_0x21f97d,function(_0x2bf19e){db[_0x8324('0x97')][_0x8324('0x60')]({'where':{'UserId':_0x2bf19e,'VoicePrefixId':_0x5bf42f[_0x8324('0x70')]}});});return Promise[_0x8324('0x96')](_0x30e717);}});});});}})['then'](respondWithStatusCode(_0x153b8d,null))[_0x8324('0x48')](handleError(_0x153b8d,null));};exports[_0x8324('0x9b')]=function(_0x37e576,_0x39849d,_0x521be9){var _0x24293c={};var _0x5dc21a={};var _0x4db9fa;var _0x31b54f;return db[_0x8324('0x43')][_0x8324('0x71')]({'where':{'id':_0x37e576[_0x8324('0x49')]['id']}})[_0x8324('0x44')](handleEntityNotFound(_0x39849d,null))[_0x8324('0x44')](function(_0x140467){if(_0x140467){_0x4db9fa=_0x140467;_0x5dc21a['model']=_[_0x8324('0x33')](db['User'][_0x8324('0x30')]);_0x5dc21a[_0x8324('0x34')]=_[_0x8324('0x33')](_0x37e576[_0x8324('0x34')]);_0x5dc21a[_0x8324('0x35')]=_[_0x8324('0x36')](_0x5dc21a[_0x8324('0x32')],_0x5dc21a[_0x8324('0x34')]);_0x24293c[_0x8324('0x37')]=_[_0x8324('0x36')](_0x5dc21a[_0x8324('0x32')],qs[_0x8324('0x38')](_0x37e576[_0x8324('0x34')]['fields']));_0x24293c[_0x8324('0x37')]=_0x24293c[_0x8324('0x37')][_0x8324('0x4a')]?_0x24293c[_0x8324('0x37')]:_0x5dc21a[_0x8324('0x32')];_0x24293c['order']=qs[_0x8324('0x3c')](_0x37e576[_0x8324('0x34')][_0x8324('0x3c')]);_0x24293c['where']=qs['filters'](_['pick'](_0x37e576['query'],_0x5dc21a[_0x8324('0x35')]));if(_0x37e576[_0x8324('0x34')]['filter']){_0x24293c['where']=_['merge'](_0x24293c[_0x8324('0x3d')],{'$or':_[_0x8324('0x2f')](_0x24293c[_0x8324('0x37')],function(_0x3dc658){var _0x24c60c={};_0x24c60c[_0x3dc658]={'$like':'%'+_0x37e576[_0x8324('0x34')][_0x8324('0x3f')]+'%'};return _0x24c60c;})});}_0x24293c=_[_0x8324('0x41')]({},_0x24293c,_0x37e576['options']);return _0x4db9fa['getAgents'](_0x24293c);}})['then'](function(_0x3c10aa){if(_0x3c10aa){_0x31b54f=_0x3c10aa[_0x8324('0x4a')];if(!_0x37e576[_0x8324('0x34')][_0x8324('0x39')](_0x8324('0x3a'))){_0x24293c[_0x8324('0x26')]=qs[_0x8324('0x26')](_0x37e576[_0x8324('0x34')][_0x8324('0x26')]);_0x24293c[_0x8324('0x24')]=qs[_0x8324('0x24')](_0x37e576[_0x8324('0x34')][_0x8324('0x24')]);}return _0x4db9fa[_0x8324('0x9b')](_0x24293c);}})[_0x8324('0x44')](function(_0x3a8f83){if(_0x3a8f83){return _0x3a8f83?{'count':_0x31b54f,'rows':_0x3a8f83}:null;}})[_0x8324('0x44')](respondWithResult(_0x39849d,null))['catch'](handleError(_0x39849d,null));}; \ No newline at end of file +var _0x0443=['isNil','format','SIP/%s','all','TeamVoicePrefix','UserVoicePrefix','spread','removeAgents','Sms','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','name','send','index','map','Team','rawAttributes','fieldName','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','user','get','Teams','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','VoicePrefixId','UserProfileResource','findOne','isValidChannel','channel','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','ValidationError','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','penalty','TeamVoiceQueue','User','emit','Queue:save','QueueId','online','voicePause','interface'];(function(_0x5912be,_0x1bd806){var _0x41be72=function(_0x1566fc){while(--_0x1566fc){_0x5912be['push'](_0x5912be['shift']());}};_0x41be72(++_0x1bd806);}(_0x0443,0x142));var _0x3044=function(_0x58b4d3,_0x8a5928){_0x58b4d3=_0x58b4d3-0x0;var _0x38afaf=_0x0443[_0x58b4d3];return _0x38afaf;};'use strict';var emlformat=require(_0x3044('0x0'));var rimraf=require(_0x3044('0x1'));var zipdir=require(_0x3044('0x2'));var jsonpatch=require(_0x3044('0x3'));var rp=require(_0x3044('0x4'));var moment=require('moment');var BPromise=require(_0x3044('0x5'));var Mustache=require('mustache');var util=require(_0x3044('0x6'));var path=require(_0x3044('0x7'));var sox=require(_0x3044('0x8'));var csv=require('to-csv');var ejs=require(_0x3044('0x9'));var fs=require('fs');var fs_extra=require(_0x3044('0xa'));var _=require('lodash');var squel=require(_0x3044('0xb'));var crypto=require(_0x3044('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3044('0xd'));var toCsv=require(_0x3044('0xe'));var querystring=require('querystring');var Papa=require(_0x3044('0xf'));var Redis=require('ioredis');var authService=require(_0x3044('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3044('0x11'));var hardwareService=require(_0x3044('0x12'));var logger=require(_0x3044('0x13'))('api');var utils=require(_0x3044('0x14'));var config=require(_0x3044('0x15'));var licenseUtil=require(_0x3044('0x16'));var db=require(_0x3044('0x17'))['db'];config['redis']=_[_0x3044('0x18')](config[_0x3044('0x19')],{'host':_0x3044('0x1a'),'port':0x18eb});var socket=require(_0x3044('0x1b'))(new Redis(config[_0x3044('0x19')]));require('./team.socket')[_0x3044('0x1c')](socket);function respondWithStatusCode(_0x125591,_0x1d3abb){_0x1d3abb=_0x1d3abb||0xcc;return function(_0x6bd54a){if(_0x6bd54a){return _0x125591[_0x3044('0x1d')](_0x1d3abb);}return _0x125591[_0x3044('0x1e')](_0x1d3abb)[_0x3044('0x1f')]();};}function respondWithResult(_0x52eaa6,_0x9d49b1){_0x9d49b1=_0x9d49b1||0xc8;return function(_0x4d642d){if(_0x4d642d){return _0x52eaa6[_0x3044('0x1e')](_0x9d49b1)[_0x3044('0x20')](_0x4d642d);}};}function respondWithFilteredResult(_0x29afbd,_0x262211){return function(_0x2969bc){if(_0x2969bc){var _0x2377a6=typeof _0x262211['offset']===_0x3044('0x21')&&typeof _0x262211[_0x3044('0x22')]==='undefined';var _0x452f94=_0x2969bc[_0x3044('0x23')];var _0x1d474d=_0x2377a6?0x0:_0x262211[_0x3044('0x24')];var _0x1dcf43=_0x2377a6?_0x2969bc[_0x3044('0x23')]:_0x262211[_0x3044('0x24')]+_0x262211[_0x3044('0x22')];var _0x55914d;if(_0x1dcf43>=_0x452f94){_0x1dcf43=_0x452f94;_0x55914d=0xc8;}else{_0x55914d=0xce;}_0x29afbd[_0x3044('0x1e')](_0x55914d);return _0x29afbd['set'](_0x3044('0x25'),_0x1d474d+'-'+_0x1dcf43+'/'+_0x452f94)[_0x3044('0x20')](_0x2969bc);}return null;};}function patchUpdates(_0x1d4ae3){return function(_0x161264){try{jsonpatch[_0x3044('0x26')](_0x161264,_0x1d4ae3,!![]);}catch(_0xbbe020){return BPromise['reject'](_0xbbe020);}return _0x161264[_0x3044('0x27')]();};}function saveUpdates(_0x4fb9fc,_0x23504c){return function(_0x400711){if(_0x400711){return _0x400711[_0x3044('0x28')](_0x4fb9fc)[_0x3044('0x29')](function(_0x37e420){return _0x37e420;});}return null;};}function handleEntityNotFound(_0x48274f,_0x1f7837){return function(_0x59c75d){if(!_0x59c75d){_0x48274f[_0x3044('0x1d')](0x194);}return _0x59c75d;};}function handleError(_0xeca2c4,_0x154333){_0x154333=_0x154333||0x1f4;return function(_0x361a8a){logger['error'](_0x361a8a['stack']);if(_0x361a8a[_0x3044('0x2a')]){delete _0x361a8a[_0x3044('0x2a')];}_0xeca2c4[_0x3044('0x1e')](_0x154333)[_0x3044('0x2b')](_0x361a8a);};}exports[_0x3044('0x2c')]=function(_0xdd2f6f,_0x2ae88c){var _0x1ae86f={},_0x3c42cf={},_0xa488b1={'count':0x0,'rows':[]};var _0x4c25c3=_[_0x3044('0x2d')](db[_0x3044('0x2e')][_0x3044('0x2f')],function(_0x1c53ed){return{'name':_0x1c53ed[_0x3044('0x30')],'type':_0x1c53ed['type']['key']};});_0x3c42cf[_0x3044('0x31')]=_[_0x3044('0x2d')](_0x4c25c3,_0x3044('0x2a'));_0x3c42cf['query']=_[_0x3044('0x32')](_0xdd2f6f[_0x3044('0x33')]);_0x3c42cf['filters']=_[_0x3044('0x34')](_0x3c42cf[_0x3044('0x31')],_0x3c42cf[_0x3044('0x33')]);_0x1ae86f['attributes']=_['intersection'](_0x3c42cf['model'],qs['fields'](_0xdd2f6f['query'][_0x3044('0x35')]));_0x1ae86f['attributes']=_0x1ae86f[_0x3044('0x36')][_0x3044('0x37')]?_0x1ae86f[_0x3044('0x36')]:_0x3c42cf['model'];if(!_0xdd2f6f[_0x3044('0x33')][_0x3044('0x38')](_0x3044('0x39'))){_0x1ae86f[_0x3044('0x22')]=qs['limit'](_0xdd2f6f[_0x3044('0x33')][_0x3044('0x22')]);_0x1ae86f[_0x3044('0x24')]=qs['offset'](_0xdd2f6f[_0x3044('0x33')][_0x3044('0x24')]);}_0x1ae86f['order']=qs[_0x3044('0x3a')](_0xdd2f6f[_0x3044('0x33')]['sort']);_0x1ae86f['where']=qs['filters'](_[_0x3044('0x3b')](_0xdd2f6f[_0x3044('0x33')],_0x3c42cf[_0x3044('0x3c')]),_0x4c25c3);if(_0xdd2f6f[_0x3044('0x33')][_0x3044('0x3d')]){_0x1ae86f[_0x3044('0x3e')]=_[_0x3044('0x3f')](_0x1ae86f[_0x3044('0x3e')],{'$or':_[_0x3044('0x2d')](_0x4c25c3,function(_0x1a1d14){if(_0x1a1d14[_0x3044('0x40')]!==_0x3044('0x41')){var _0x88e29c={};_0x88e29c[_0x1a1d14[_0x3044('0x2a')]]={'$like':'%'+_0xdd2f6f['query'][_0x3044('0x3d')]+'%'};return _0x88e29c;}})});}_0x1ae86f=_[_0x3044('0x3f')]({},_0x1ae86f,_0xdd2f6f['options']);var _0x471cfb={'where':_0x1ae86f[_0x3044('0x3e')]};return db[_0x3044('0x2e')][_0x3044('0x23')](_0x471cfb)[_0x3044('0x29')](function(_0x468c77){_0xa488b1[_0x3044('0x23')]=_0x468c77;if(_0xdd2f6f[_0x3044('0x33')]['includeAll']){_0x1ae86f[_0x3044('0x42')]=[{'all':!![]}];}return db[_0x3044('0x2e')][_0x3044('0x43')](_0x1ae86f);})[_0x3044('0x29')](function(_0x2fc799){_0xa488b1[_0x3044('0x44')]=_0x2fc799;return _0xa488b1;})[_0x3044('0x29')](respondWithFilteredResult(_0x2ae88c,_0x1ae86f))[_0x3044('0x45')](handleError(_0x2ae88c,null));};exports[_0x3044('0x46')]=function(_0x5a92a6,_0x12c00f){var _0x2694dd={'raw':![],'where':{'id':_0x5a92a6[_0x3044('0x47')]['id']}},_0x279205={};_0x279205[_0x3044('0x31')]=_[_0x3044('0x32')](db[_0x3044('0x2e')]['rawAttributes']);_0x279205[_0x3044('0x33')]=_[_0x3044('0x32')](_0x5a92a6[_0x3044('0x33')]);_0x279205[_0x3044('0x3c')]=_[_0x3044('0x34')](_0x279205['model'],_0x279205['query']);_0x2694dd[_0x3044('0x36')]=_['intersection'](_0x279205[_0x3044('0x31')],qs[_0x3044('0x35')](_0x5a92a6[_0x3044('0x33')][_0x3044('0x35')]));_0x2694dd[_0x3044('0x36')]=_0x2694dd[_0x3044('0x36')][_0x3044('0x37')]?_0x2694dd['attributes']:_0x279205[_0x3044('0x31')];if(_0x5a92a6[_0x3044('0x33')][_0x3044('0x48')]){_0x2694dd[_0x3044('0x42')]=[{'all':!![]}];}_0x2694dd=_[_0x3044('0x3f')]({},_0x2694dd,_0x5a92a6[_0x3044('0x49')]);return db[_0x3044('0x2e')][_0x3044('0x4a')](_0x2694dd)['then'](handleEntityNotFound(_0x12c00f,null))[_0x3044('0x29')](respondWithResult(_0x12c00f,null))['catch'](handleError(_0x12c00f,null));};exports[_0x3044('0x4b')]=function(_0x343ddf,_0x46ef2a){return db['Team'][_0x3044('0x4b')](_0x343ddf['body'],{})[_0x3044('0x29')](function(_0x2da405){var _0x30f71c=_0x343ddf[_0x3044('0x4c')][_0x3044('0x4d')]({'plain':!![]});if(!_0x30f71c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30f71c['role']===_0x3044('0x4c')){var _0x3817fe=_0x2da405[_0x3044('0x4d')]({'plain':!![]});var _0x1c6bae=_0x3044('0x4e');return db['UserProfileSection'][_0x3044('0x4a')]({'where':{'name':_0x1c6bae,'userProfileId':_0x30f71c['userProfileId']},'raw':!![]})[_0x3044('0x29')](function(_0x2dbed3){if(_0x2dbed3&&_0x2dbed3[_0x3044('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3817fe[_0x3044('0x2a')],'resourceId':_0x3817fe['id'],'type':_0x2dbed3[_0x3044('0x2a')],'sectionId':_0x2dbed3['id']},{})[_0x3044('0x29')](function(){return _0x2da405;});}else{return _0x2da405;}})['catch'](function(_0xa6e800){logger[_0x3044('0x50')](_0x3044('0x51'),_0xa6e800);throw _0xa6e800;});}return _0x2da405;})['then'](respondWithResult(_0x46ef2a,0xc9))[_0x3044('0x45')](handleError(_0x46ef2a,null));};exports['update']=function(_0x126793,_0x5b202f){if(_0x126793[_0x3044('0x52')]['id']){delete _0x126793[_0x3044('0x52')]['id'];}return db['Team'][_0x3044('0x4a')]({'where':{'id':_0x126793[_0x3044('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b202f,null))[_0x3044('0x29')](saveUpdates(_0x126793[_0x3044('0x52')],null))[_0x3044('0x29')](respondWithResult(_0x5b202f,null))[_0x3044('0x45')](handleError(_0x5b202f,null));};exports['destroy']=function(_0x5892c7,_0x3c7793){var _0x232f4c=_0x5892c7['params']['id'];var _0xf77213=[];return db[_0x3044('0x53')][_0x3044('0x54')](function(_0x4ffec3){var _0x3077d5=_0x3044('0x55')+_0x232f4c;return db[_0x3044('0x53')][_0x3044('0x33')](_0x3077d5,{'type':db[_0x3044('0x56')][_0x3044('0x57')]['SELECT'],'raw':!![],'transaction':_0x4ffec3})['then'](function(_0x59b439){_0xf77213=_[_0x3044('0x2d')](_0x59b439,function(_0x21d4f0){return Number(_0x21d4f0[_0x3044('0x58')]);});})['then'](function(){var _0x1a3024=_0x3044('0x59')+_0x232f4c;return db[_0x3044('0x53')][_0x3044('0x33')](_0x1a3024,{'type':db[_0x3044('0x56')][_0x3044('0x57')][_0x3044('0x5a')],'raw':!![],'transaction':_0x4ffec3});})[_0x3044('0x29')](function(_0x2ea30e){var _0x4b926c=_['map'](_0x2ea30e,function(_0x2e8d0c){return Number(_0x2e8d0c[_0x3044('0x5b')]);});return db[_0x3044('0x5c')][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'VoiceQueueId':{'$in':_0x4b926c}},'transaction':_0x4ffec3});})['then'](function(){var _0x3a3ed6=_0x3044('0x5e')+_0x232f4c;return db['sequelize'][_0x3044('0x33')](_0x3a3ed6,{'type':db['Sequelize'][_0x3044('0x57')][_0x3044('0x5a')],'raw':!![],'transaction':_0x4ffec3});})[_0x3044('0x29')](function(_0x546a07){var _0x16b4cc=_['map'](_0x546a07,function(_0x44364f){return Number(_0x44364f[_0x3044('0x5f')]);});return db['UserMailQueue'][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'MailQueueId':{'$in':_0x16b4cc}},'transaction':_0x4ffec3});})[_0x3044('0x29')](function(){var _0x2be002='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x232f4c;return db['sequelize'][_0x3044('0x33')](_0x2be002,{'type':db[_0x3044('0x56')]['QueryTypes'][_0x3044('0x5a')],'raw':!![],'transaction':_0x4ffec3});})[_0x3044('0x29')](function(_0x26d683){var _0x193f6e=_[_0x3044('0x2d')](_0x26d683,function(_0x577438){return Number(_0x577438[_0x3044('0x60')]);});return db[_0x3044('0x61')][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'SmsQueueId':{'$in':_0x193f6e}},'transaction':_0x4ffec3});})[_0x3044('0x29')](function(){var _0x18347e=_0x3044('0x62')+_0x232f4c;return db[_0x3044('0x53')]['query'](_0x18347e,{'type':db[_0x3044('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4ffec3});})[_0x3044('0x29')](function(_0x475384){var _0x288332=_[_0x3044('0x2d')](_0x475384,function(_0x115ebe){return Number(_0x115ebe[_0x3044('0x63')]);});return db[_0x3044('0x64')][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'ChatQueueId':{'$in':_0x288332}},'transaction':_0x4ffec3});})[_0x3044('0x29')](function(){var _0x5dfc1a=_0x3044('0x65')+_0x232f4c;return db['sequelize'][_0x3044('0x33')](_0x5dfc1a,{'type':db[_0x3044('0x56')][_0x3044('0x57')]['SELECT'],'raw':!![],'transaction':_0x4ffec3});})[_0x3044('0x29')](function(_0x3fed93){var _0x38ba6a=_[_0x3044('0x2d')](_0x3fed93,function(_0x1dfbd2){return Number(_0x1dfbd2[_0x3044('0x66')]);});return db[_0x3044('0x67')][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'FaxQueueId':{'$in':_0x38ba6a}},'transaction':_0x4ffec3});})['then'](function(){var _0xdce1dc=_0x3044('0x68')+_0x232f4c;return db[_0x3044('0x53')]['query'](_0xdce1dc,{'type':db[_0x3044('0x56')][_0x3044('0x57')][_0x3044('0x5a')],'raw':!![],'transaction':_0x4ffec3});})[_0x3044('0x29')](function(_0x11be67){var _0x5e71f5=_[_0x3044('0x2d')](_0x11be67,function(_0x354f54){return Number(_0x354f54[_0x3044('0x69')]);});return db[_0x3044('0x6a')][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'OpenchannelQueueId':{'$in':_0x5e71f5}},'transaction':_0x4ffec3});})[_0x3044('0x29')](function(){var _0x56042e=_0x3044('0x6b')+_0x232f4c;return db[_0x3044('0x53')][_0x3044('0x33')](_0x56042e,{'type':db[_0x3044('0x56')][_0x3044('0x57')]['SELECT'],'raw':!![],'transaction':_0x4ffec3});})['then'](function(_0x4accf3){var _0x3a6b9c=_[_0x3044('0x2d')](_0x4accf3,function(_0x583581){return Number(_0x583581[_0x3044('0x6c')]);});return db[_0x3044('0x6d')][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'WhatsappQueueId':{'$in':_0x3a6b9c}},'transaction':_0x4ffec3});})[_0x3044('0x29')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x232f4c}});})[_0x3044('0x29')](function(_0x16e2fd){if(_0x16e2fd===null){return;}return db['UserVoicePrefix'][_0x3044('0x5d')]({'where':{'UserId':{'$in':_0xf77213},'VoicePrefixId':_0x16e2fd[_0x3044('0x6e')]},'transaction':_0x4ffec3});})[_0x3044('0x29')](function(){return db['Team'][_0x3044('0x5d')]({'where':{'id':_0x232f4c},'cascade':!![],'transaction':_0x4ffec3});})[_0x3044('0x29')](function(_0x386347){if(_0x386347===0x0){_0x3c7793['sendStatus'](0x194);}else{return db[_0x3044('0x6f')][_0x3044('0x5d')]({'where':{'type':_0x3044('0x4e'),'resourceId':_0x232f4c},'cascade':!![],'transaction':_0x4ffec3})[_0x3044('0x29')](function(){_0x3c7793[_0x3044('0x1e')](0xcc)[_0x3044('0x1f')]();});}})[_0x3044('0x45')](function(_0x5611d4){_0x3c7793['status'](0x1f4)['send'](_0x5611d4);});});};exports['getQueues']=function(_0x3e8318,_0x56bde8,_0x164dc1){return db[_0x3044('0x2e')][_0x3044('0x70')]({'where':{'id':_0x3e8318[_0x3044('0x47')]['id']}})[_0x3044('0x29')](handleEntityNotFound(_0x56bde8,null))[_0x3044('0x29')](function(_0xc28153){if(!_0x3e8318[_0x3044('0x33')]['channel']||!utils[_0x3044('0x71')](_0x3e8318[_0x3044('0x33')][_0x3044('0x72')])){throw new db['Sequelize']['ValidationError'](_0x3044('0x73'));}var _0x27474f={};var _0x25024e={};_0x25024e[_0x3044('0x31')]=_['keys'](db[_[_0x3044('0x74')](_0x3e8318['query']['channel'][_0x3044('0x75')]())+_0x3044('0x76')][_0x3044('0x2f')]);_0x25024e['query']=_[_0x3044('0x32')](_0x3e8318[_0x3044('0x33')]);_0x25024e['filters']=_[_0x3044('0x34')](_0x25024e[_0x3044('0x31')],_0x25024e['query']);_0x27474f[_0x3044('0x36')]=_[_0x3044('0x34')](_0x25024e['model'],qs['fields'](_0x3e8318[_0x3044('0x33')][_0x3044('0x35')]));_0x27474f[_0x3044('0x36')]=_0x27474f['attributes'][_0x3044('0x37')]?_0x27474f[_0x3044('0x36')]:_0x25024e[_0x3044('0x31')];_0x27474f[_0x3044('0x22')]=qs['limit'](_0x3e8318['query'][_0x3044('0x22')]);_0x27474f[_0x3044('0x24')]=qs[_0x3044('0x24')](_0x3e8318['query']['offset']);_0x27474f[_0x3044('0x77')]=qs['sort'](_0x3e8318['query'][_0x3044('0x3a')]);_0x27474f[_0x3044('0x3e')]=qs[_0x3044('0x3c')](_['pick'](_0x3e8318[_0x3044('0x33')],_0x25024e[_0x3044('0x3c')]));_0x27474f=_[_0x3044('0x3f')]({},_0x27474f,_0x3e8318[_0x3044('0x49')]);return _0xc28153[_0x3044('0x4d')+_[_0x3044('0x74')](_0x3e8318[_0x3044('0x33')][_0x3044('0x72')]['toLowerCase']())+_0x3044('0x78')](_0x27474f);})[_0x3044('0x29')](respondWithResult(_0x56bde8,null))[_0x3044('0x45')](handleError(_0x56bde8,null));};exports['addQueues']=function(_0x215979,_0x5871b0,_0x3bb892){return db[_0x3044('0x2e')][_0x3044('0x70')]({'where':{'id':_0x215979['params']['id']}})[_0x3044('0x29')](function(_0x288c4f){if(_0x288c4f){if(!_0x215979['body'][_0x3044('0x72')]||!utils[_0x3044('0x71')](_0x215979[_0x3044('0x52')]['channel'])){throw new db['Sequelize'][(_0x3044('0x79'))](_0x3044('0x73'));}return _0x288c4f[_0x3044('0x7a')+_[_0x3044('0x74')](_0x215979[_0x3044('0x52')][_0x3044('0x72')][_0x3044('0x75')]())+_0x3044('0x78')](_0x215979['body'][_0x3044('0x7b')]);}return null;})[_0x3044('0x29')](handleEntityNotFound(_0x5871b0,null))[_0x3044('0x29')](respondWithStatusCode(_0x5871b0,null))[_0x3044('0x45')](handleError(_0x5871b0,null));};exports[_0x3044('0x7c')]=function(_0x23fb19,_0x3ccb17,_0xe8e682){return db[_0x3044('0x2e')][_0x3044('0x70')]({'where':{'id':_0x23fb19[_0x3044('0x47')]['id']}})[_0x3044('0x29')](function(_0x28ed8a){if(_0x28ed8a){if(!_0x23fb19[_0x3044('0x33')][_0x3044('0x72')]||!utils[_0x3044('0x71')](_0x23fb19[_0x3044('0x33')]['channel'])){throw new db[(_0x3044('0x56'))][(_0x3044('0x79'))](_0x3044('0x73'));}return _0x28ed8a[_0x3044('0x7d')+_[_0x3044('0x74')](_0x23fb19[_0x3044('0x33')][_0x3044('0x72')][_0x3044('0x75')]())+_0x3044('0x78')](_0x23fb19['query']['ids']);}return null;})[_0x3044('0x29')](handleEntityNotFound(_0x3ccb17,null))['then'](respondWithStatusCode(_0x3ccb17,null))[_0x3044('0x45')](handleError(_0x3ccb17,null));};exports[_0x3044('0x7e')]=function(_0x3a0863,_0x3b1f3a){var _0x5b8776=_[_0x3044('0x7f')](_0x3a0863['body']['ids'])?_0x3a0863[_0x3044('0x52')][_0x3044('0x7b')]:[_0x3a0863[_0x3044('0x52')]['ids']];var _0x2e479f=_0x3a0863[_0x3044('0x47')]['id'];return db['Team'][_0x3044('0x4a')]({'where':{'id':_0x2e479f}})[_0x3044('0x29')](handleEntityNotFound(_0x3b1f3a,null))[_0x3044('0x29')](function(_0xe5f3f6){if(_0xe5f3f6){var _0x2e5331=[_0x3044('0x80'),_0x3044('0x81'),_0x3044('0x82'),'Sms',_0x3044('0x83'),_0x3044('0x84'),_0x3044('0x85')];return db['sequelize'][_0x3044('0x54')](function(_0x334dd0){var _0x558181=_[_0x3044('0x2d')](_0x2e5331,function(_0x2ae8d){var _0x3d48bb={'attributes':['id','name']};if(_0x2ae8d===_0x3044('0x80')){_0x3d48bb['through']={'attributes':[_0x3044('0x86')]};}return _0xe5f3f6['get'+_0x2ae8d+_0x3044('0x78')](_0x3d48bb)[_0x3044('0x29')](function(_0x486cc6){var _0x43e8c5=_[_0x3044('0x2d')](_0x486cc6,function(_0x211497){var _0x108e8b=_[_0x3044('0x2d')](_0x5b8776,function(_0xcd8d99){var _0x105c9f={'where':{'UserId':_0xcd8d99,[_0x2ae8d+'QueueId']:_0x211497['id']},'transaction':_0x334dd0};if(_0x2ae8d==='Voice'){_0x105c9f['defaults']={'penalty':_0x211497[_0x3044('0x87')][_0x3044('0x86')]};}return db[_0x3044('0x88')+_0x2ae8d+_0x3044('0x76')]['findOrCreate'](_0x105c9f)[_0x3044('0x29')](function(){socket[_0x3044('0x89')](_0x3044('0x4c')+_0x2ae8d+_0x3044('0x8a'),{'UserId':_0xcd8d99,[_0x2ae8d+_0x3044('0x8b')]:_0x211497['id']});if(_0x2ae8d!==_0x3044('0x80')){return;}return db[_0x3044('0x88')][_0x3044('0x43')]({'where':{'id':_0x5b8776,'online':0x1},'attributes':['id',_0x3044('0x2a'),_0x3044('0x8c'),_0x3044('0x8d'),_0x3044('0x8e')],'raw':!![]})[_0x3044('0x29')](function(_0x255678){var _0x266834=_[_0x3044('0x2d')](_0x255678,function(_0x4b3ef0){return db['UserVoiceQueueRt']['upsert']({'membername':_0x4b3ef0[_0x3044('0x2a')],'UserId':_0x4b3ef0['id'],'queue_name':_0x211497['name'],'VoiceQueueId':_0x211497['id'],'interface':_[_0x3044('0x8f')](_0x4b3ef0[_0x3044('0x8e')])?util[_0x3044('0x90')](_0x3044('0x91'),_0x4b3ef0[_0x3044('0x2a')]):_0x4b3ef0[_0x3044('0x8e')],'paused':_0x4b3ef0[_0x3044('0x8d')]||![],'penalty':_0x211497[_0x3044('0x87')][_0x3044('0x86')]},{'transaction':_0x334dd0});});return Promise['all'](_0x266834);});});});return Promise[_0x3044('0x92')](_0x108e8b);});return Promise[_0x3044('0x92')](_0x43e8c5);})[_0x3044('0x29')](function(){return db[_0x3044('0x93')][_0x3044('0x70')]({'where':{'teamId':_0x2e479f}})['then'](function(_0x4bacc0){if(_0x4bacc0){var _0x1a056c=_[_0x3044('0x2d')](_0x5b8776,function(_0x32888e){db[_0x3044('0x94')]['upsert']({'UserId':_0x32888e,'VoicePrefixId':_0x4bacc0[_0x3044('0x6e')]});});return Promise[_0x3044('0x92')](_0x1a056c);}});});});return Promise['all'](_0x558181)[_0x3044('0x29')](function(){return _0xe5f3f6[_0x3044('0x7e')](_0x5b8776,{'transaction':_0x334dd0})[_0x3044('0x95')](function(_0x2970e8){return _0x2970e8;});});});}})[_0x3044('0x29')](respondWithResult(_0x3b1f3a,null))[_0x3044('0x45')](handleError(_0x3b1f3a,null));};exports[_0x3044('0x96')]=function(_0x4eb046,_0x33c859){var _0x30bf05=_[_0x3044('0x7f')](_0x4eb046[_0x3044('0x33')][_0x3044('0x7b')])?_0x4eb046[_0x3044('0x33')][_0x3044('0x7b')]:[_0x4eb046[_0x3044('0x33')][_0x3044('0x7b')]];var _0x14f40d=_0x4eb046[_0x3044('0x47')]['id'];return db[_0x3044('0x2e')][_0x3044('0x4a')]({'where':{'id':_0x14f40d}})[_0x3044('0x29')](handleEntityNotFound(_0x33c859,null))[_0x3044('0x29')](function(_0x2a9558){if(_0x2a9558){var _0x392625=['Voice',_0x3044('0x81'),_0x3044('0x82'),_0x3044('0x97'),_0x3044('0x83'),_0x3044('0x84'),'Whatsapp'];return db[_0x3044('0x53')][_0x3044('0x54')](function(_0x404411){var _0x2db6c7=_['map'](_0x392625,function(_0x3aafef){var _0x674fdc={'attributes':['id',_0x3044('0x2a')]};return _0x2a9558[_0x3044('0x4d')+_0x3aafef+_0x3044('0x78')](_0x674fdc)[_0x3044('0x29')](function(_0x3da79f){var _0x14e437=_[_0x3044('0x2d')](_0x3da79f,function(_0x245c2c){return _0x245c2c[_0x3044('0x96')](_0x30bf05,{'transaction':_0x404411})[_0x3044('0x29')](function(){var _0x59729a=_[_0x3044('0x2d')](_0x30bf05,function(_0x145981){socket[_0x3044('0x89')](_0x3044('0x4c')+_0x3aafef+_0x3044('0x98'),{'UserId':Number(_0x145981),[_0x3aafef+_0x3044('0x8b')]:_0x245c2c['id']});if(_0x3aafef!==_0x3044('0x80')){return;}return db[_0x3044('0x99')][_0x3044('0x5d')]({'where':{'VoiceQueueId':_0x245c2c['id'],'UserId':_0x145981},'transaction':_0x404411});});return Promise['all'](_0x59729a);});});return Promise['all'](_0x14e437);});});return Promise['all'](_0x2db6c7)['then'](function(){return _0x2a9558['removeAgents'](_0x30bf05,{'transaction':_0x404411});})[_0x3044('0x29')](function(){return db[_0x3044('0x93')]['findOne']({'where':{'teamId':_0x14f40d}})['then'](function(_0x16c18e){if(_0x16c18e){var _0x4997ee=_[_0x3044('0x2d')](_0x30bf05,function(_0x51fe29){db[_0x3044('0x94')]['destroy']({'where':{'UserId':_0x51fe29,'VoicePrefixId':_0x16c18e[_0x3044('0x6e')]}});});return Promise[_0x3044('0x92')](_0x4997ee);}});});});}})['then'](respondWithStatusCode(_0x33c859,null))[_0x3044('0x45')](handleError(_0x33c859,null));};exports[_0x3044('0x9a')]=function(_0x1da327,_0x178faf,_0x556547){var _0x35cfde={};var _0x22457a={};var _0x1c309c;var _0x39a816;return db[_0x3044('0x2e')]['findOne']({'where':{'id':_0x1da327[_0x3044('0x47')]['id']}})[_0x3044('0x29')](handleEntityNotFound(_0x178faf,null))[_0x3044('0x29')](function(_0x8785bf){if(_0x8785bf){_0x1c309c=_0x8785bf;_0x22457a['model']=_[_0x3044('0x32')](db[_0x3044('0x88')][_0x3044('0x2f')]);_0x22457a[_0x3044('0x33')]=_['keys'](_0x1da327[_0x3044('0x33')]);_0x22457a[_0x3044('0x3c')]=_[_0x3044('0x34')](_0x22457a[_0x3044('0x31')],_0x22457a['query']);_0x35cfde[_0x3044('0x36')]=_[_0x3044('0x34')](_0x22457a[_0x3044('0x31')],qs[_0x3044('0x35')](_0x1da327[_0x3044('0x33')][_0x3044('0x35')]));_0x35cfde[_0x3044('0x36')]=_0x35cfde['attributes'][_0x3044('0x37')]?_0x35cfde[_0x3044('0x36')]:_0x22457a[_0x3044('0x31')];_0x35cfde[_0x3044('0x77')]=qs['sort'](_0x1da327[_0x3044('0x33')][_0x3044('0x3a')]);_0x35cfde[_0x3044('0x3e')]=qs[_0x3044('0x3c')](_[_0x3044('0x3b')](_0x1da327[_0x3044('0x33')],_0x22457a[_0x3044('0x3c')]));if(_0x1da327[_0x3044('0x33')][_0x3044('0x3d')]){_0x35cfde[_0x3044('0x3e')]=_[_0x3044('0x3f')](_0x35cfde[_0x3044('0x3e')],{'$or':_[_0x3044('0x2d')](_0x35cfde[_0x3044('0x36')],function(_0x3a4641){var _0x567380={};_0x567380[_0x3a4641]={'$like':'%'+_0x1da327[_0x3044('0x33')][_0x3044('0x3d')]+'%'};return _0x567380;})});}_0x35cfde=_['merge']({},_0x35cfde,_0x1da327[_0x3044('0x49')]);return _0x1c309c['getAgents'](_0x35cfde);}})[_0x3044('0x29')](function(_0x9581c3){if(_0x9581c3){_0x39a816=_0x9581c3[_0x3044('0x37')];if(!_0x1da327[_0x3044('0x33')][_0x3044('0x38')]('nolimit')){_0x35cfde[_0x3044('0x22')]=qs[_0x3044('0x22')](_0x1da327[_0x3044('0x33')][_0x3044('0x22')]);_0x35cfde[_0x3044('0x24')]=qs[_0x3044('0x24')](_0x1da327[_0x3044('0x33')][_0x3044('0x24')]);}return _0x1c309c[_0x3044('0x9a')](_0x35cfde);}})[_0x3044('0x29')](function(_0x44c1c1){if(_0x44c1c1){return _0x44c1c1?{'count':_0x39a816,'rows':_0x44c1c1}:null;}})[_0x3044('0x29')](respondWithResult(_0x178faf,null))[_0x3044('0x45')](handleError(_0x178faf,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 940ab27..c0abab6 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 _0xa724=['hook','exports','../../mysqldb','Team','update','emit'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0xa724,0x1ee));var _0x4a72=function(_0x475eaf,_0x236f46){_0x475eaf=_0x475eaf-0x0;var _0x5b4cea=_0xa724[_0x475eaf];return _0x5b4cea;};'use strict';var EventEmitter=require('events');var Team=require(_0x4a72('0x0'))['db'][_0x4a72('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a72('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1a4297){return function(_0x5ec578,_0x118c89,_0x2547fa){TeamEvents[_0x4a72('0x3')](_0x1a4297+':'+_0x5ec578['id'],_0x5ec578);TeamEvents[_0x4a72('0x3')](_0x1a4297,_0x5ec578);_0x2547fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x4a72('0x4')](e,emitEvent(event));}}module[_0x4a72('0x5')]=TeamEvents; \ No newline at end of file +var _0xcac2=['Team','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x18a279,_0x45b1b3){var _0x583889=function(_0x7c102){while(--_0x7c102){_0x18a279['push'](_0x18a279['shift']());}};_0x583889(++_0x45b1b3);}(_0xcac2,0x19f));var _0x2cac=function(_0x571ee5,_0x929b69){_0x571ee5=_0x571ee5-0x0;var _0x199ca6=_0xcac2[_0x571ee5];return _0x199ca6;};'use strict';var EventEmitter=require(_0x2cac('0x0'));var Team=require('../../mysqldb')['db'][_0x2cac('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x2cac('0x2')](0x0);var events={'afterCreate':_0x2cac('0x3'),'afterUpdate':_0x2cac('0x4'),'afterDestroy':_0x2cac('0x5')};function emitEvent(_0x22a1f5){return function(_0x5e8408,_0x2b602f,_0x20bb15){TeamEvents[_0x2cac('0x6')](_0x22a1f5+':'+_0x5e8408['id'],_0x5e8408);TeamEvents[_0x2cac('0x6')](_0x22a1f5,_0x5e8408);_0x20bb15(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x2cac('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 70c5442..61f050f 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 _0x147e=['lodash','./team.attributes','get','Queues','map','setDataValue','channel','exports','define','Team','teams','Fax','Mail','Sms','Voice','Whatsapp','resolve','then','all','catch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x147e,0x17c));var _0xe147=function(_0x95c191,_0x2290e8){_0x95c191=_0x95c191-0x0;var _0x1e0c2e=_0x147e[_0x95c191];return _0x1e0c2e;};'use strict';var _=require(_0xe147('0x0'));var attributes=require(_0xe147('0x1'));function getQueuesByChannel(_0x79fc75,_0x5e7cee){var _0x59b1b6=_0xe147('0x2')+_0x5e7cee+_0xe147('0x3');return _0x79fc75[_0x59b1b6]()['then'](function(_0x51742d){return _[_0xe147('0x4')](_0x51742d,function(_0x1122ca){_0x1122ca[_0xe147('0x5')](_0xe147('0x6'),_0x5e7cee);return _0x1122ca;});})['catch'](function(_0x323142){throw _0x323142;});}module[_0xe147('0x7')]=function(_0x2acba1){return _0x2acba1[_0xe147('0x8')](_0xe147('0x9'),attributes,{'tableName':_0xe147('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x31c88d=this;var _0x1a4bca=['Chat',_0xe147('0xb'),_0xe147('0xc'),'Openchannel',_0xe147('0xd'),_0xe147('0xe'),_0xe147('0xf')];return Promise[_0xe147('0x10')]()[_0xe147('0x11')](function(){var _0x2c906b=_[_0xe147('0x4')](_0x1a4bca,function(_0x4c4fba){return getQueuesByChannel(_0x31c88d,_0x4c4fba);});return Promise[_0xe147('0x12')](_0x2c906b);})[_0xe147('0x13')](function(_0x38c09f){throw _0x38c09f;});}}});}; \ No newline at end of file +var _0xa4a6=['teams','Chat','Fax','Mail','Openchannel','Voice','Whatsapp','resolve','all','lodash','get','then','map','setDataValue','channel','catch','define','Team'];(function(_0x284f86,_0x5c163b){var _0x2d8fdf=function(_0x35653b){while(--_0x35653b){_0x284f86['push'](_0x284f86['shift']());}};_0x2d8fdf(++_0x5c163b);}(_0xa4a6,0x14d));var _0x6a4a=function(_0x51a77e,_0x5d87f1){_0x51a77e=_0x51a77e-0x0;var _0x4677c8=_0xa4a6[_0x51a77e];return _0x4677c8;};'use strict';var _=require(_0x6a4a('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x39ffae,_0x14c403){var _0x12e554=_0x6a4a('0x1')+_0x14c403+'Queues';return _0x39ffae[_0x12e554]()[_0x6a4a('0x2')](function(_0xaafc93){return _[_0x6a4a('0x3')](_0xaafc93,function(_0x5bd73e){_0x5bd73e[_0x6a4a('0x4')](_0x6a4a('0x5'),_0x14c403);return _0x5bd73e;});})[_0x6a4a('0x6')](function(_0x4c96c8){throw _0x4c96c8;});}module['exports']=function(_0x11940d){return _0x11940d[_0x6a4a('0x7')](_0x6a4a('0x8'),attributes,{'tableName':_0x6a4a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4bec10=this;var _0x481aa6=[_0x6a4a('0xa'),_0x6a4a('0xb'),_0x6a4a('0xc'),_0x6a4a('0xd'),'Sms',_0x6a4a('0xe'),_0x6a4a('0xf')];return Promise[_0x6a4a('0x10')]()[_0x6a4a('0x2')](function(){var _0x576a5f=_['map'](_0x481aa6,function(_0x5a9dde){return getQueuesByChannel(_0x4bec10,_0x5a9dde);});return Promise[_0x6a4a('0x11')](_0x576a5f);})['catch'](function(_0x2ffb15){throw _0x2ffb15;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 7ff5838..a494c39 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 _0x6d7b=['stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x41224d,_0x2e5430){var _0x1e670a=function(_0x17d0c2){while(--_0x17d0c2){_0x41224d['push'](_0x41224d['shift']());}};_0x1e670a(++_0x2e5430);}(_0x6d7b,0x1e1));var _0xb6d7=function(_0x4ae2fb,_0x1c1c67){_0x4ae2fb=_0x4ae2fb-0x0;var _0x4f5268=_0x6d7b[_0x4ae2fb];return _0x4f5268;};'use strict';var _=require(_0xb6d7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6d7('0x1'));var fs=require('fs');var Redis=require(_0xb6d7('0x2'));var db=require(_0xb6d7('0x3'))['db'];var utils=require(_0xb6d7('0x4'));var logger=require(_0xb6d7('0x5'))(_0xb6d7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb6d7('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xb6d7('0x8')]=_[_0xb6d7('0x9')](config[_0xb6d7('0x8')],{'host':_0xb6d7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6d7('0x8')]));require(_0xb6d7('0xb'))[_0xb6d7('0xc')](socket);function respondWithRpcPromise(_0x10de61,_0x429336,_0x44effd){return new BPromise(function(_0x3d6525,_0x2c2b13){return client[_0xb6d7('0xd')](_0x10de61,_0x44effd)['then'](function(_0xbdae5f){logger[_0xb6d7('0xe')](_0xb6d7('0xf'),_0x429336,_0xb6d7('0x10'));logger[_0xb6d7('0x11')](_0xb6d7('0x12'),_0x429336,'request\x20sent',JSON[_0xb6d7('0x13')](_0xbdae5f));if(_0xbdae5f[_0xb6d7('0x14')]){if(_0xbdae5f[_0xb6d7('0x14')][_0xb6d7('0x15')]===0x1f4){logger[_0xb6d7('0x14')](_0xb6d7('0xf'),_0x429336,_0xbdae5f[_0xb6d7('0x14')][_0xb6d7('0x16')]);return _0x2c2b13(_0xbdae5f['error'][_0xb6d7('0x16')]);}logger[_0xb6d7('0x14')](_0xb6d7('0xf'),_0x429336,_0xbdae5f[_0xb6d7('0x14')]['message']);return _0x3d6525(_0xbdae5f[_0xb6d7('0x14')][_0xb6d7('0x16')]);}else{logger[_0xb6d7('0xe')]('Team,\x20%s,\x20%s',_0x429336,_0xb6d7('0x10'));_0x3d6525(_0xbdae5f[_0xb6d7('0x17')][_0xb6d7('0x16')]);}})[_0xb6d7('0x18')](function(_0x59f3b5){logger[_0xb6d7('0x14')](_0xb6d7('0xf'),_0x429336,_0x59f3b5);_0x2c2b13(_0x59f3b5);});});} \ No newline at end of file +var _0xb64d=['error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','then','info','Team,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb64d,0x122));var _0xdb64=function(_0x30a2d5,_0x431b8a){_0x30a2d5=_0x30a2d5-0x0;var _0x2cf6b4=_0xb64d[_0x30a2d5];return _0x2cf6b4;};'use strict';var _=require(_0xdb64('0x0'));var util=require('util');var moment=require(_0xdb64('0x1'));var BPromise=require(_0xdb64('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb64('0x3'))['db'];var utils=require(_0xdb64('0x4'));var logger=require(_0xdb64('0x5'))(_0xdb64('0x6'));var config=require(_0xdb64('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdb64('0x8')][_0xdb64('0x9')]({'port':0x232a});config[_0xdb64('0xa')]=_[_0xdb64('0xb')](config[_0xdb64('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb64('0xc'))(new Redis(config[_0xdb64('0xa')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x25efc8,_0x5bb2a8,_0x9cffd2){return new BPromise(function(_0x16ecb0,_0x4ad242){return client['request'](_0x25efc8,_0x9cffd2)[_0xdb64('0xd')](function(_0x209af6){logger[_0xdb64('0xe')](_0xdb64('0xf'),_0x5bb2a8,_0xdb64('0x10'));logger[_0xdb64('0x11')]('Team,\x20%s,\x20%s,\x20%s',_0x5bb2a8,_0xdb64('0x10'),JSON['stringify'](_0x209af6));if(_0x209af6[_0xdb64('0x12')]){if(_0x209af6['error'][_0xdb64('0x13')]===0x1f4){logger[_0xdb64('0x12')](_0xdb64('0xf'),_0x5bb2a8,_0x209af6['error'][_0xdb64('0x14')]);return _0x4ad242(_0x209af6[_0xdb64('0x12')][_0xdb64('0x14')]);}logger['error'](_0xdb64('0xf'),_0x5bb2a8,_0x209af6['error']['message']);return _0x16ecb0(_0x209af6['error']['message']);}else{logger['info'](_0xdb64('0xf'),_0x5bb2a8,'request\x20sent');_0x16ecb0(_0x209af6['result'][_0xdb64('0x14')]);}})[_0xdb64('0x15')](function(_0x4eabd3){logger['error']('Team,\x20%s,\x20%s',_0x5bb2a8,_0x4eabd3);_0x4ad242(_0x4eabd3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 3933bea..c2faf71 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 _0x9d8c=['team:','./team.events','remove','update','emit','removeListener','register'];(function(_0xab83e8,_0x74785e){var _0x14b084=function(_0x382bf1){while(--_0x382bf1){_0xab83e8['push'](_0xab83e8['shift']());}};_0x14b084(++_0x74785e);}(_0x9d8c,0x158));var _0xc9d8=function(_0x68b84e,_0x349b79){_0x68b84e=_0x68b84e-0x0;var _0x10dd0e=_0x9d8c[_0x68b84e];return _0x10dd0e;};'use strict';var TeamEvents=require(_0xc9d8('0x0'));var events=['save',_0xc9d8('0x1'),_0xc9d8('0x2')];function createListener(_0xee3082,_0x3b1369){return function(_0x49963f){_0x3b1369[_0xc9d8('0x3')](_0xee3082,_0x49963f);};}function removeListener(_0x494f92,_0xc8a81){return function(){TeamEvents[_0xc9d8('0x4')](_0x494f92,_0xc8a81);};}exports[_0xc9d8('0x5')]=function(_0x30c887){for(var _0x240118=0x0,_0x65bb19=events['length'];_0x240118<_0x65bb19;_0x240118++){var _0x1aa3cb=events[_0x240118];var _0x58878e=createListener(_0xc9d8('0x6')+_0x1aa3cb,_0x30c887);TeamEvents['on'](_0x1aa3cb,_0x58878e);}}; \ No newline at end of file +var _0xd17b=['removeListener','register','length','team:','./team.events','save','remove','emit'];(function(_0xbd652f,_0x361776){var _0x35cc95=function(_0x835e36){while(--_0x835e36){_0xbd652f['push'](_0xbd652f['shift']());}};_0x35cc95(++_0x361776);}(_0xd17b,0x16c));var _0xbd17=function(_0x44ae0b,_0x3e9865){_0x44ae0b=_0x44ae0b-0x0;var _0x69232a=_0xd17b[_0x44ae0b];return _0x69232a;};'use strict';var TeamEvents=require(_0xbd17('0x0'));var events=[_0xbd17('0x1'),_0xbd17('0x2'),'update'];function createListener(_0xf0ad7c,_0x557b00){return function(_0x17568d){_0x557b00[_0xbd17('0x3')](_0xf0ad7c,_0x17568d);};}function removeListener(_0x4e4d89,_0x2cef80){return function(){TeamEvents[_0xbd17('0x4')](_0x4e4d89,_0x2cef80);};}exports[_0xbd17('0x5')]=function(_0x45444a){for(var _0x54cbbd=0x0,_0x1797b5=events[_0xbd17('0x6')];_0x54cbbd<_0x1797b5;_0x54cbbd++){var _0x53880c=events[_0x54cbbd];var _0x2f72ad=createListener(_0xbd17('0x7')+_0x53880c,_0x45444a);TeamEvents['on'](_0x53880c,_0x2f72ad);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index acf7754..193b780 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 _0xdeb7=['exports','INTEGER','sequelize'];(function(_0x599dfe,_0x1e15ae){var _0x42f1df=function(_0x553196){while(--_0x553196){_0x599dfe['push'](_0x599dfe['shift']());}};_0x42f1df(++_0x1e15ae);}(_0xdeb7,0x77));var _0x7deb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdeb7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x7deb('0x0'));module[_0x7deb('0x1')]={'TeamId':{'type':Sequelize[_0x7deb('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x88f5=['exports','sequelize'];(function(_0x38550,_0x1e36a6){var _0x556e2c=function(_0x20777a){while(--_0x20777a){_0x38550['push'](_0x38550['shift']());}};_0x556e2c(++_0x1e36a6);}(_0x88f5,0x79));var _0x588f=function(_0x563dc9,_0x24d2da){_0x563dc9=_0x563dc9-0x0;var _0x54539d=_0x88f5[_0x563dc9];return _0x54539d;};'use strict';var Sequelize=require(_0x588f('0x0'));module[_0x588f('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d1d1bb5..81ee5b7 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 _0x3f8c=['exports','define','TeamVoicePrefix','team_has_voice_prefixes','../../config/logger','api','moment','bluebird'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x3f8c,0x104));var _0xc3f8=function(_0x1dc5d3,_0x5257e7){_0x1dc5d3=_0x1dc5d3-0x0;var _0x5b1adb=_0x3f8c[_0x1dc5d3];return _0x5b1adb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3f8('0x0'))(_0xc3f8('0x1'));var moment=require(_0xc3f8('0x2'));var BPromise=require(_0xc3f8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module[_0xc3f8('0x4')]=function(_0x1a6976,_0x3a4e2f){return _0x1a6976[_0xc3f8('0x5')](_0xc3f8('0x6'),attributes,{'tableName':_0xc3f8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5523=['./teamVoicePrefix.attributes','exports','team_has_voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5523,0x137));var _0x3552=function(_0x1b0e6d,_0x43c19f){_0x1b0e6d=_0x1b0e6d-0x0;var _0x27432e=_0x5523[_0x1b0e6d];return _0x27432e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3552('0x0'))(_0x3552('0x1'));var moment=require(_0x3552('0x2'));var BPromise=require(_0x3552('0x3'));var rp=require(_0x3552('0x4'));var fs=require('fs');var path=require(_0x3552('0x5'));var rimraf=require(_0x3552('0x6'));var config=require(_0x3552('0x7'));var attributes=require(_0x3552('0x8'));module[_0x3552('0x9')]=function(_0x3225aa,_0x58385b){return _0x3225aa['define']('TeamVoicePrefix',attributes,{'tableName':_0x3552('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index fa9ad10..7f0ef3e 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x435edf,_0x251538){var _0x5b4618=function(_0x5b9bfa){while(--_0x5b9bfa){_0x435edf['push'](_0x435edf['shift']());}};_0x5b4618(++_0x251538);}(_0xe706,0xa3));var _0x6e70=function(_0x13d9ac,_0x193a78){_0x13d9ac=_0x13d9ac-0x0;var _0x348a17=_0xe706[_0x13d9ac];return _0x348a17;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 1b2271c..94debd9 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 _0xd24d=['sequelize','exports'];(function(_0x19821c,_0x1a7841){var _0x401995=function(_0x4e3956){while(--_0x4e3956){_0x19821c['push'](_0x19821c['shift']());}};_0x401995(++_0x1a7841);}(_0xd24d,0x168));var _0xdd24=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd24d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdd24('0x0'));module[_0xdd24('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf513=['INTEGER','sequelize','exports'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0xf513,0x181));var _0x3f51=function(_0x58966b,_0x39221f){_0x58966b=_0x58966b-0x0;var _0x5158e4=_0xf513[_0x58966b];return _0x5158e4;};'use strict';var Sequelize=require(_0x3f51('0x0'));module[_0x3f51('0x1')]={'penalty':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 401979d..217a077 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 _0x80ce=['moment','request-promise','path','rimraf','define','TeamVoiceQueue','api'];(function(_0x1865d4,_0x569a81){var _0x1f0e1c=function(_0x57887d){while(--_0x57887d){_0x1865d4['push'](_0x1865d4['shift']());}};_0x1f0e1c(++_0x569a81);}(_0x80ce,0xae));var _0xe80c=function(_0x3e2177,_0xeac06e){_0x3e2177=_0x3e2177-0x0;var _0x15ef0d=_0x80ce[_0x3e2177];return _0x15ef0d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe80c('0x0'));var moment=require(_0xe80c('0x1'));var BPromise=require('bluebird');var rp=require(_0xe80c('0x2'));var fs=require('fs');var path=require(_0xe80c('0x3'));var rimraf=require(_0xe80c('0x4'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x48d62c,_0x19b480){return _0x48d62c[_0xe80c('0x5')](_0xe80c('0x6'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4be6=['team_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define'];(function(_0xa68a10,_0x290b24){var _0x44da88=function(_0x366718){while(--_0x366718){_0xa68a10['push'](_0xa68a10['shift']());}};_0x44da88(++_0x290b24);}(_0x4be6,0xb5));var _0x64be=function(_0x31dfdd,_0x4b55f9){_0x31dfdd=_0x31dfdd-0x0;var _0x30f59b=_0x4be6[_0x31dfdd];return _0x30f59b;};'use strict';var _=require('lodash');var util=require(_0x64be('0x0'));var logger=require(_0x64be('0x1'))(_0x64be('0x2'));var moment=require(_0x64be('0x3'));var BPromise=require(_0x64be('0x4'));var rp=require(_0x64be('0x5'));var fs=require('fs');var path=require(_0x64be('0x6'));var rimraf=require(_0x64be('0x7'));var config=require(_0x64be('0x8'));var attributes=require(_0x64be('0x9'));module['exports']=function(_0x131822,_0x2430e2){return _0x131822[_0x64be('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x64be('0xb'),'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 7888633..99520c8 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 _0xacb6=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0xacb6,0xa2));var _0x6acb=function(_0x1dcd2d,_0x1bfa9a){_0x1dcd2d=_0x1dcd2d-0x0;var _0x2c7cda=_0xacb6[_0x1dcd2d];return _0x2c7cda;};'use strict';var _=require('lodash');var util=require(_0x6acb('0x0'));var moment=require('moment');var BPromise=require(_0x6acb('0x1'));var rs=require(_0x6acb('0x2'));var fs=require('fs');var Redis=require(_0x6acb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6acb('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6acb('0x5'));var jayson=require(_0x6acb('0x6'));var client=jayson[_0x6acb('0x7')][_0x6acb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e3156,_0x3a0887,_0x126087){return new BPromise(function(_0x1733c9,_0x18aaa9){return client['request'](_0x4e3156,_0x126087)['then'](function(_0x59bc87){logger[_0x6acb('0x9')](_0x6acb('0xa'),_0x3a0887,_0x6acb('0xb'));logger[_0x6acb('0xc')](_0x6acb('0xd'),_0x3a0887,_0x6acb('0xb'),JSON[_0x6acb('0xe')](_0x59bc87));if(_0x59bc87['error']){if(_0x59bc87[_0x6acb('0xf')]['code']===0x1f4){logger[_0x6acb('0xf')](_0x6acb('0xa'),_0x3a0887,_0x59bc87[_0x6acb('0xf')][_0x6acb('0x10')]);return _0x18aaa9(_0x59bc87[_0x6acb('0xf')][_0x6acb('0x10')]);}logger[_0x6acb('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3a0887,_0x59bc87[_0x6acb('0xf')][_0x6acb('0x10')]);return _0x1733c9(_0x59bc87[_0x6acb('0xf')][_0x6acb('0x10')]);}else{logger[_0x6acb('0x9')](_0x6acb('0xa'),_0x3a0887,_0x6acb('0xb'));_0x1733c9(_0x59bc87[_0x6acb('0x11')][_0x6acb('0x10')]);}})['catch'](function(_0x1f51ab){logger[_0x6acb('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3a0887,_0x1f51ab);_0x18aaa9(_0x1f51ab);});});} \ No newline at end of file +var _0x0a4b=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','moment','bluebird'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0a4b,0x6d));var _0xb0a4=function(_0x468b10,_0x1a35ee){_0x468b10=_0x468b10-0x0;var _0xce8bbd=_0x0a4b[_0x468b10];return _0xce8bbd;};'use strict';var _=require(_0xb0a4('0x0'));var util=require('util');var moment=require(_0xb0a4('0x1'));var BPromise=require(_0xb0a4('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(_0xb0a4('0x3'))(_0xb0a4('0x4'));var config=require(_0xb0a4('0x5'));var jayson=require(_0xb0a4('0x6'));var client=jayson['client'][_0xb0a4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb070d6,_0x52e871,_0x5ab960){return new BPromise(function(_0x115119,_0x30d1cb){return client['request'](_0xb070d6,_0x5ab960)['then'](function(_0x4e2ae8){logger[_0xb0a4('0x8')](_0xb0a4('0x9'),_0x52e871,_0xb0a4('0xa'));logger[_0xb0a4('0xb')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x52e871,_0xb0a4('0xa'),JSON[_0xb0a4('0xc')](_0x4e2ae8));if(_0x4e2ae8[_0xb0a4('0xd')]){if(_0x4e2ae8[_0xb0a4('0xd')][_0xb0a4('0xe')]===0x1f4){logger['error'](_0xb0a4('0x9'),_0x52e871,_0x4e2ae8[_0xb0a4('0xd')]['message']);return _0x30d1cb(_0x4e2ae8[_0xb0a4('0xd')]['message']);}logger[_0xb0a4('0xd')](_0xb0a4('0x9'),_0x52e871,_0x4e2ae8['error']['message']);return _0x115119(_0x4e2ae8[_0xb0a4('0xd')][_0xb0a4('0xf')]);}else{logger[_0xb0a4('0x8')](_0xb0a4('0x9'),_0x52e871,'request\x20sent');_0x115119(_0x4e2ae8['result'][_0xb0a4('0xf')]);}})['catch'](function(_0x3a0c9e){logger[_0xb0a4('0xd')](_0xb0a4('0x9'),_0x52e871,_0x3a0c9e);_0x30d1cb(_0x3a0c9e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b15dc24..7f9376d 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 _0x3024=['connect-timeout','express','../../components/auth/service','../../config/environment','./template.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x4863bf,_0x36918c){var _0x469dc8=function(_0x3dca91){while(--_0x3dca91){_0x4863bf['push'](_0x4863bf['shift']());}};_0x469dc8(++_0x36918c);}(_0x3024,0x64));var _0x4302=function(_0x2af712,_0x59b8b1){_0x2af712=_0x2af712-0x0;var _0x2a1cb8=_0x3024[_0x2af712];return _0x2a1cb8;};'use strict';var multer=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var path=require('path');var timeout=require(_0x4302('0x2'));var express=require(_0x4302('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4302('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4302('0x5'));var controller=require(_0x4302('0x6'));router['get']('/',auth[_0x4302('0x7')](),controller[_0x4302('0x8')]);router['get'](_0x4302('0x9'),auth[_0x4302('0x7')](),controller[_0x4302('0xa')]);router[_0x4302('0xb')]('/',auth[_0x4302('0x7')](),controller[_0x4302('0xc')]);router[_0x4302('0xd')]('/:id',auth[_0x4302('0x7')](),controller[_0x4302('0xe')]);router[_0x4302('0xf')]('/:id',auth[_0x4302('0x7')](),controller[_0x4302('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6257=['multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x1c7f3a,_0x2ca32e){var _0x51f02e=function(_0x59fa50){while(--_0x59fa50){_0x1c7f3a['push'](_0x1c7f3a['shift']());}};_0x51f02e(++_0x2ca32e);}(_0x6257,0x1d4));var _0x7625=function(_0x11bd1c,_0x488106){_0x11bd1c=_0x11bd1c-0x0;var _0x11fb0b=_0x6257[_0x11bd1c];return _0x11fb0b;};'use strict';var multer=require(_0x7625('0x0'));var util=require('util');var path=require(_0x7625('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7625('0x2')]();var fs_extra=require(_0x7625('0x3'));var auth=require(_0x7625('0x4'));var interaction=require(_0x7625('0x5'));var config=require(_0x7625('0x6'));var controller=require(_0x7625('0x7'));router[_0x7625('0x8')]('/',auth[_0x7625('0x9')](),controller[_0x7625('0xa')]);router[_0x7625('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7625('0xb')]);router[_0x7625('0xc')]('/',auth['isAuthenticated'](),controller[_0x7625('0xd')]);router[_0x7625('0xe')](_0x7625('0xf'),auth['isAuthenticated'](),controller[_0x7625('0x10')]);router[_0x7625('0x11')]('/:id',auth[_0x7625('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 8b33754..6b0fa77 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 _0x7af0=['sequelize','exports','STRING','TEXT'];(function(_0x515c5b,_0x3f6632){var _0x112f20=function(_0x27f3c4){while(--_0x27f3c4){_0x515c5b['push'](_0x515c5b['shift']());}};_0x112f20(++_0x3f6632);}(_0x7af0,0x88));var _0x07af=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0x7af0[_0x3f7598];return _0x51fb16;};'use strict';var Sequelize=require(_0x07af('0x0'));module[_0x07af('0x1')]={'name':{'type':Sequelize[_0x07af('0x2')]},'description':{'type':Sequelize[_0x07af('0x2')]},'html':{'type':Sequelize[_0x07af('0x3')]}}; \ No newline at end of file +var _0x07e7=['sequelize','STRING'];(function(_0x9691ab,_0x3cc81d){var _0x21215c=function(_0x527ca0){while(--_0x527ca0){_0x9691ab['push'](_0x9691ab['shift']());}};_0x21215c(++_0x3cc81d);}(_0x07e7,0x1aa));var _0x707e=function(_0x390b4a,_0x55987f){_0x390b4a=_0x390b4a-0x0;var _0x3eb6b4=_0x07e7[_0x390b4a];return _0x3eb6b4;};'use strict';var Sequelize=require(_0x707e('0x0'));module['exports']={'name':{'type':Sequelize[_0x707e('0x1')]},'description':{'type':Sequelize[_0x707e('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index e5e7356..eb761b0 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 _0x9c2e=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','name','send','index','Template','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','map','type','VIRTUAL','filter','options','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x9c2e,0x188));var _0xe9c2=function(_0x445ffa,_0x517a6b){_0x445ffa=_0x445ffa-0x0;var _0x2aefd2=_0x9c2e[_0x445ffa];return _0x2aefd2;};'use strict';var emlformat=require(_0xe9c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9c2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9c2('0x2'));var moment=require(_0xe9c2('0x3'));var BPromise=require(_0xe9c2('0x4'));var Mustache=require(_0xe9c2('0x5'));var util=require(_0xe9c2('0x6'));var path=require(_0xe9c2('0x7'));var sox=require(_0xe9c2('0x8'));var csv=require(_0xe9c2('0x9'));var ejs=require(_0xe9c2('0xa'));var fs=require('fs');var fs_extra=require(_0xe9c2('0xb'));var _=require(_0xe9c2('0xc'));var squel=require('squel');var crypto=require(_0xe9c2('0xd'));var jsforce=require(_0xe9c2('0xe'));var deskjs=require(_0xe9c2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe9c2('0x10'));var Papa=require(_0xe9c2('0x11'));var Redis=require(_0xe9c2('0x12'));var authService=require(_0xe9c2('0x13'));var qs=require(_0xe9c2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9c2('0x15'));var logger=require(_0xe9c2('0x16'))('api');var utils=require(_0xe9c2('0x17'));var config=require(_0xe9c2('0x18'));var licenseUtil=require(_0xe9c2('0x19'));var db=require(_0xe9c2('0x1a'))['db'];function respondWithStatusCode(_0x3e6fc5,_0x2f4739){_0x2f4739=_0x2f4739||0xcc;return function(_0x2447b6){if(_0x2447b6){return _0x3e6fc5['sendStatus'](_0x2f4739);}return _0x3e6fc5[_0xe9c2('0x1b')](_0x2f4739)[_0xe9c2('0x1c')]();};}function respondWithResult(_0x219199,_0x4e130f){_0x4e130f=_0x4e130f||0xc8;return function(_0x5885a1){if(_0x5885a1){return _0x219199[_0xe9c2('0x1b')](_0x4e130f)[_0xe9c2('0x1d')](_0x5885a1);}};}function respondWithFilteredResult(_0x2c6187,_0xdaa4df){return function(_0x513165){if(_0x513165){var _0x34353b=typeof _0xdaa4df[_0xe9c2('0x1e')]===_0xe9c2('0x1f')&&typeof _0xdaa4df[_0xe9c2('0x20')]===_0xe9c2('0x1f');var _0x4e3387=_0x513165[_0xe9c2('0x21')];var _0x170145=_0x34353b?0x0:_0xdaa4df[_0xe9c2('0x1e')];var _0x33f2eb=_0x34353b?_0x513165['count']:_0xdaa4df['offset']+_0xdaa4df[_0xe9c2('0x20')];var _0x1ee3ea;if(_0x33f2eb>=_0x4e3387){_0x33f2eb=_0x4e3387;_0x1ee3ea=0xc8;}else{_0x1ee3ea=0xce;}_0x2c6187['status'](_0x1ee3ea);return _0x2c6187[_0xe9c2('0x22')](_0xe9c2('0x23'),_0x170145+'-'+_0x33f2eb+'/'+_0x4e3387)[_0xe9c2('0x1d')](_0x513165);}return null;};}function patchUpdates(_0x473ce6){return function(_0x4bd0cd){try{jsonpatch[_0xe9c2('0x24')](_0x4bd0cd,_0x473ce6,!![]);}catch(_0x10a79c){return BPromise[_0xe9c2('0x25')](_0x10a79c);}return _0x4bd0cd[_0xe9c2('0x26')]();};}function saveUpdates(_0x477ac0,_0x1ec1c5){return function(_0x10d08d){if(_0x10d08d){return _0x10d08d[_0xe9c2('0x27')](_0x477ac0)[_0xe9c2('0x28')](function(_0x37edf5){return _0x37edf5;});}return null;};}function removeEntity(_0x103526,_0x7082de){return function(_0x3c3942){if(_0x3c3942){return _0x3c3942[_0xe9c2('0x29')]()[_0xe9c2('0x28')](function(){var _0x5b188f=_0x3c3942[_0xe9c2('0x2a')]({'plain':!![]});var _0x4a2343=_0xe9c2('0x2b');return db[_0xe9c2('0x2c')][_0xe9c2('0x29')]({'where':{'type':_0x4a2343,'resourceId':_0x5b188f['id']}})[_0xe9c2('0x28')](function(){return _0x3c3942;});})[_0xe9c2('0x28')](function(){_0x103526[_0xe9c2('0x1b')](0xcc)[_0xe9c2('0x1c')]();});}};}function handleEntityNotFound(_0xa75f36,_0x19ce19){return function(_0x25bedc){if(!_0x25bedc){_0xa75f36['sendStatus'](0x194);}return _0x25bedc;};}function handleError(_0x259ae0,_0x250d31){_0x250d31=_0x250d31||0x1f4;return function(_0x3b7f36){logger[_0xe9c2('0x2d')](_0x3b7f36['stack']);if(_0x3b7f36[_0xe9c2('0x2e')]){delete _0x3b7f36[_0xe9c2('0x2e')];}_0x259ae0[_0xe9c2('0x1b')](_0x250d31)[_0xe9c2('0x2f')](_0x3b7f36);};}exports[_0xe9c2('0x30')]=function(_0x22eaea,_0x1b26fb){var _0x4996b0={},_0x571188={},_0x259ba3={'count':0x0,'rows':[]};var _0x5a7079=_['map'](db[_0xe9c2('0x31')]['rawAttributes'],function(_0x425c49){return{'name':_0x425c49[_0xe9c2('0x32')],'type':_0x425c49['type'][_0xe9c2('0x33')]};});_0x571188[_0xe9c2('0x34')]=_['map'](_0x5a7079,_0xe9c2('0x2e'));_0x571188[_0xe9c2('0x35')]=_[_0xe9c2('0x36')](_0x22eaea['query']);_0x571188[_0xe9c2('0x37')]=_['intersection'](_0x571188[_0xe9c2('0x34')],_0x571188['query']);_0x4996b0['attributes']=_[_0xe9c2('0x38')](_0x571188['model'],qs[_0xe9c2('0x39')](_0x22eaea['query']['fields']));_0x4996b0[_0xe9c2('0x3a')]=_0x4996b0['attributes'][_0xe9c2('0x3b')]?_0x4996b0[_0xe9c2('0x3a')]:_0x571188[_0xe9c2('0x34')];if(!_0x22eaea[_0xe9c2('0x35')][_0xe9c2('0x3c')]('nolimit')){_0x4996b0['limit']=qs[_0xe9c2('0x20')](_0x22eaea['query']['limit']);_0x4996b0[_0xe9c2('0x1e')]=qs[_0xe9c2('0x1e')](_0x22eaea[_0xe9c2('0x35')][_0xe9c2('0x1e')]);}_0x4996b0['order']=qs[_0xe9c2('0x3d')](_0x22eaea[_0xe9c2('0x35')][_0xe9c2('0x3d')]);_0x4996b0[_0xe9c2('0x3e')]=qs[_0xe9c2('0x37')](_[_0xe9c2('0x3f')](_0x22eaea[_0xe9c2('0x35')],_0x571188[_0xe9c2('0x37')]),_0x5a7079);if(_0x22eaea[_0xe9c2('0x35')]['filter']){_0x4996b0[_0xe9c2('0x3e')]=_[_0xe9c2('0x40')](_0x4996b0['where'],{'$or':_[_0xe9c2('0x41')](_0x5a7079,function(_0x3176e5){if(_0x3176e5[_0xe9c2('0x42')]!==_0xe9c2('0x43')){var _0x4d10d3={};_0x4d10d3[_0x3176e5[_0xe9c2('0x2e')]]={'$like':'%'+_0x22eaea[_0xe9c2('0x35')][_0xe9c2('0x44')]+'%'};return _0x4d10d3;}})});}_0x4996b0=_[_0xe9c2('0x40')]({},_0x4996b0,_0x22eaea[_0xe9c2('0x45')]);var _0x1c8f6d={'where':_0x4996b0[_0xe9c2('0x3e')]};return db[_0xe9c2('0x31')]['count'](_0x1c8f6d)['then'](function(_0x226b4e){_0x259ba3[_0xe9c2('0x21')]=_0x226b4e;if(_0x22eaea['query']['includeAll']){_0x4996b0['include']=[{'all':!![]}];}return db['Template'][_0xe9c2('0x46')](_0x4996b0);})['then'](function(_0x485a9d){_0x259ba3[_0xe9c2('0x47')]=_0x485a9d;return _0x259ba3;})[_0xe9c2('0x28')](respondWithFilteredResult(_0x1b26fb,_0x4996b0))['catch'](handleError(_0x1b26fb,null));};exports[_0xe9c2('0x48')]=function(_0x99ca4e,_0x45482b){var _0x145b9a={'raw':!![],'where':{'id':_0x99ca4e[_0xe9c2('0x49')]['id']}},_0xda6225={};_0xda6225[_0xe9c2('0x34')]=_[_0xe9c2('0x36')](db[_0xe9c2('0x31')][_0xe9c2('0x4a')]);_0xda6225['query']=_[_0xe9c2('0x36')](_0x99ca4e['query']);_0xda6225['filters']=_[_0xe9c2('0x38')](_0xda6225[_0xe9c2('0x34')],_0xda6225['query']);_0x145b9a['attributes']=_['intersection'](_0xda6225[_0xe9c2('0x34')],qs[_0xe9c2('0x39')](_0x99ca4e[_0xe9c2('0x35')][_0xe9c2('0x39')]));_0x145b9a[_0xe9c2('0x3a')]=_0x145b9a[_0xe9c2('0x3a')][_0xe9c2('0x3b')]?_0x145b9a['attributes']:_0xda6225[_0xe9c2('0x34')];if(_0x99ca4e[_0xe9c2('0x35')][_0xe9c2('0x4b')]){_0x145b9a['include']=[{'all':!![]}];}_0x145b9a=_[_0xe9c2('0x40')]({},_0x145b9a,_0x99ca4e[_0xe9c2('0x45')]);return db[_0xe9c2('0x31')][_0xe9c2('0x4c')](_0x145b9a)[_0xe9c2('0x28')](handleEntityNotFound(_0x45482b,null))[_0xe9c2('0x28')](respondWithResult(_0x45482b,null))[_0xe9c2('0x4d')](handleError(_0x45482b,null));};exports[_0xe9c2('0x4e')]=function(_0x1df645,_0x207d4f){return db[_0xe9c2('0x31')]['create'](_0x1df645['body'],{})[_0xe9c2('0x28')](function(_0xb3a4d5){var _0x4519c5=_0x1df645[_0xe9c2('0x4f')]['get']({'plain':!![]});if(!_0x4519c5)throw new Error(_0xe9c2('0x50'));if(_0x4519c5['role']===_0xe9c2('0x4f')){var _0x1d55ba=_0xb3a4d5[_0xe9c2('0x2a')]({'plain':!![]});var _0x280583=_0xe9c2('0x2b');return db['UserProfileSection'][_0xe9c2('0x4c')]({'where':{'name':_0x280583,'userProfileId':_0x4519c5[_0xe9c2('0x51')]},'raw':!![]})[_0xe9c2('0x28')](function(_0x46476b){if(_0x46476b&&_0x46476b[_0xe9c2('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d55ba[_0xe9c2('0x2e')],'resourceId':_0x1d55ba['id'],'type':_0x46476b['name'],'sectionId':_0x46476b['id']},{})['then'](function(){return _0xb3a4d5;});}else{return _0xb3a4d5;}})[_0xe9c2('0x4d')](function(_0x704289){logger[_0xe9c2('0x2d')](_0xe9c2('0x53'),_0x704289);throw _0x704289;});}return _0xb3a4d5;})[_0xe9c2('0x28')](respondWithResult(_0x207d4f,0xc9))[_0xe9c2('0x4d')](handleError(_0x207d4f,null));};exports[_0xe9c2('0x27')]=function(_0x45fbbb,_0x4e7086){if(_0x45fbbb[_0xe9c2('0x54')]['id']){delete _0x45fbbb[_0xe9c2('0x54')]['id'];}return db['Template'][_0xe9c2('0x4c')]({'where':{'id':_0x45fbbb[_0xe9c2('0x49')]['id']}})[_0xe9c2('0x28')](handleEntityNotFound(_0x4e7086,null))[_0xe9c2('0x28')](saveUpdates(_0x45fbbb[_0xe9c2('0x54')],null))[_0xe9c2('0x28')](respondWithResult(_0x4e7086,null))[_0xe9c2('0x4d')](handleError(_0x4e7086,null));};exports[_0xe9c2('0x29')]=function(_0x181ba1,_0x353743){return db[_0xe9c2('0x31')][_0xe9c2('0x4c')]({'where':{'id':_0x181ba1['params']['id']}})['then'](handleEntityNotFound(_0x353743,null))[_0xe9c2('0x28')](removeEntity(_0x353743,null))[_0xe9c2('0x4d')](handleError(_0x353743,null));}; \ No newline at end of file +var _0x6c2c=['intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','get','role','user','Templates','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','model'];(function(_0x528fd5,_0x43b4c8){var _0x3f2fe9=function(_0x50ffc4){while(--_0x50ffc4){_0x528fd5['push'](_0x528fd5['shift']());}};_0x3f2fe9(++_0x43b4c8);}(_0x6c2c,0x74));var _0xc6c2=function(_0x2c242,_0x5941b5){_0x2c242=_0x2c242-0x0;var _0x1e84a4=_0x6c2c[_0x2c242];return _0x1e84a4;};'use strict';var emlformat=require(_0xc6c2('0x0'));var rimraf=require(_0xc6c2('0x1'));var zipdir=require(_0xc6c2('0x2'));var jsonpatch=require(_0xc6c2('0x3'));var rp=require(_0xc6c2('0x4'));var moment=require(_0xc6c2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc6c2('0x6'));var path=require(_0xc6c2('0x7'));var sox=require(_0xc6c2('0x8'));var csv=require(_0xc6c2('0x9'));var ejs=require(_0xc6c2('0xa'));var fs=require('fs');var fs_extra=require(_0xc6c2('0xb'));var _=require(_0xc6c2('0xc'));var squel=require(_0xc6c2('0xd'));var crypto=require(_0xc6c2('0xe'));var jsforce=require(_0xc6c2('0xf'));var deskjs=require(_0xc6c2('0x10'));var toCsv=require(_0xc6c2('0x9'));var querystring=require(_0xc6c2('0x11'));var Papa=require(_0xc6c2('0x12'));var Redis=require('ioredis');var authService=require(_0xc6c2('0x13'));var qs=require(_0xc6c2('0x14'));var as=require(_0xc6c2('0x15'));var hardwareService=require(_0xc6c2('0x16'));var logger=require(_0xc6c2('0x17'))(_0xc6c2('0x18'));var utils=require(_0xc6c2('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc6c2('0x1a'));var db=require(_0xc6c2('0x1b'))['db'];function respondWithStatusCode(_0x4c6262,_0x2d609e){_0x2d609e=_0x2d609e||0xcc;return function(_0x1d22f6){if(_0x1d22f6){return _0x4c6262[_0xc6c2('0x1c')](_0x2d609e);}return _0x4c6262['status'](_0x2d609e)[_0xc6c2('0x1d')]();};}function respondWithResult(_0x4424a6,_0x5c8fb6){_0x5c8fb6=_0x5c8fb6||0xc8;return function(_0x2a7388){if(_0x2a7388){return _0x4424a6[_0xc6c2('0x1e')](_0x5c8fb6)[_0xc6c2('0x1f')](_0x2a7388);}};}function respondWithFilteredResult(_0x3d97b7,_0x98c621){return function(_0x4a3a49){if(_0x4a3a49){var _0xcc1655=typeof _0x98c621[_0xc6c2('0x20')]===_0xc6c2('0x21')&&typeof _0x98c621[_0xc6c2('0x22')]===_0xc6c2('0x21');var _0x536fb4=_0x4a3a49[_0xc6c2('0x23')];var _0x4ccd96=_0xcc1655?0x0:_0x98c621[_0xc6c2('0x20')];var _0x4c079f=_0xcc1655?_0x4a3a49['count']:_0x98c621[_0xc6c2('0x20')]+_0x98c621[_0xc6c2('0x22')];var _0x595b32;if(_0x4c079f>=_0x536fb4){_0x4c079f=_0x536fb4;_0x595b32=0xc8;}else{_0x595b32=0xce;}_0x3d97b7[_0xc6c2('0x1e')](_0x595b32);return _0x3d97b7['set'](_0xc6c2('0x24'),_0x4ccd96+'-'+_0x4c079f+'/'+_0x536fb4)[_0xc6c2('0x1f')](_0x4a3a49);}return null;};}function patchUpdates(_0x370f22){return function(_0x15289a){try{jsonpatch[_0xc6c2('0x25')](_0x15289a,_0x370f22,!![]);}catch(_0x65c9a){return BPromise[_0xc6c2('0x26')](_0x65c9a);}return _0x15289a['save']();};}function saveUpdates(_0x29560f,_0x43f244){return function(_0x317445){if(_0x317445){return _0x317445[_0xc6c2('0x27')](_0x29560f)['then'](function(_0x19a2d6){return _0x19a2d6;});}return null;};}function removeEntity(_0x2e0736,_0x192fee){return function(_0x34dfe0){if(_0x34dfe0){return _0x34dfe0[_0xc6c2('0x28')]()[_0xc6c2('0x29')](function(){var _0x570ae2=_0x34dfe0['get']({'plain':!![]});var _0x137196='Templates';return db[_0xc6c2('0x2a')][_0xc6c2('0x28')]({'where':{'type':_0x137196,'resourceId':_0x570ae2['id']}})[_0xc6c2('0x29')](function(){return _0x34dfe0;});})[_0xc6c2('0x29')](function(){_0x2e0736['status'](0xcc)[_0xc6c2('0x1d')]();});}};}function handleEntityNotFound(_0x1a47be,_0x18afec){return function(_0x16c732){if(!_0x16c732){_0x1a47be[_0xc6c2('0x1c')](0x194);}return _0x16c732;};}function handleError(_0x35af56,_0x54ac7f){_0x54ac7f=_0x54ac7f||0x1f4;return function(_0x39c335){logger[_0xc6c2('0x2b')](_0x39c335[_0xc6c2('0x2c')]);if(_0x39c335[_0xc6c2('0x2d')]){delete _0x39c335[_0xc6c2('0x2d')];}_0x35af56[_0xc6c2('0x1e')](_0x54ac7f)[_0xc6c2('0x2e')](_0x39c335);};}exports[_0xc6c2('0x2f')]=function(_0xa2b3b1,_0x2391e4){var _0x5d2481={},_0x440658={},_0x466f41={'count':0x0,'rows':[]};var _0x5dacf6=_[_0xc6c2('0x30')](db[_0xc6c2('0x31')][_0xc6c2('0x32')],function(_0x296f49){return{'name':_0x296f49[_0xc6c2('0x33')],'type':_0x296f49[_0xc6c2('0x34')][_0xc6c2('0x35')]};});_0x440658['model']=_['map'](_0x5dacf6,_0xc6c2('0x2d'));_0x440658[_0xc6c2('0x36')]=_[_0xc6c2('0x37')](_0xa2b3b1[_0xc6c2('0x36')]);_0x440658[_0xc6c2('0x38')]=_['intersection'](_0x440658[_0xc6c2('0x39')],_0x440658[_0xc6c2('0x36')]);_0x5d2481['attributes']=_[_0xc6c2('0x3a')](_0x440658[_0xc6c2('0x39')],qs[_0xc6c2('0x3b')](_0xa2b3b1[_0xc6c2('0x36')][_0xc6c2('0x3b')]));_0x5d2481[_0xc6c2('0x3c')]=_0x5d2481[_0xc6c2('0x3c')]['length']?_0x5d2481['attributes']:_0x440658[_0xc6c2('0x39')];if(!_0xa2b3b1[_0xc6c2('0x36')][_0xc6c2('0x3d')](_0xc6c2('0x3e'))){_0x5d2481['limit']=qs[_0xc6c2('0x22')](_0xa2b3b1[_0xc6c2('0x36')][_0xc6c2('0x22')]);_0x5d2481[_0xc6c2('0x20')]=qs[_0xc6c2('0x20')](_0xa2b3b1['query'][_0xc6c2('0x20')]);}_0x5d2481[_0xc6c2('0x3f')]=qs[_0xc6c2('0x40')](_0xa2b3b1[_0xc6c2('0x36')][_0xc6c2('0x40')]);_0x5d2481[_0xc6c2('0x41')]=qs['filters'](_[_0xc6c2('0x42')](_0xa2b3b1[_0xc6c2('0x36')],_0x440658[_0xc6c2('0x38')]),_0x5dacf6);if(_0xa2b3b1[_0xc6c2('0x36')][_0xc6c2('0x43')]){_0x5d2481[_0xc6c2('0x41')]=_[_0xc6c2('0x44')](_0x5d2481[_0xc6c2('0x41')],{'$or':_[_0xc6c2('0x30')](_0x5dacf6,function(_0x478488){if(_0x478488['type']!==_0xc6c2('0x45')){var _0xdb3822={};_0xdb3822[_0x478488[_0xc6c2('0x2d')]]={'$like':'%'+_0xa2b3b1[_0xc6c2('0x36')][_0xc6c2('0x43')]+'%'};return _0xdb3822;}})});}_0x5d2481=_[_0xc6c2('0x44')]({},_0x5d2481,_0xa2b3b1[_0xc6c2('0x46')]);var _0x3817da={'where':_0x5d2481['where']};return db[_0xc6c2('0x31')][_0xc6c2('0x23')](_0x3817da)[_0xc6c2('0x29')](function(_0x4f8f15){_0x466f41[_0xc6c2('0x23')]=_0x4f8f15;if(_0xa2b3b1[_0xc6c2('0x36')]['includeAll']){_0x5d2481[_0xc6c2('0x47')]=[{'all':!![]}];}return db[_0xc6c2('0x31')][_0xc6c2('0x48')](_0x5d2481);})[_0xc6c2('0x29')](function(_0x453d96){_0x466f41[_0xc6c2('0x49')]=_0x453d96;return _0x466f41;})[_0xc6c2('0x29')](respondWithFilteredResult(_0x2391e4,_0x5d2481))[_0xc6c2('0x4a')](handleError(_0x2391e4,null));};exports[_0xc6c2('0x4b')]=function(_0x1d0ef8,_0x46d6e1){var _0x49608c={'raw':!![],'where':{'id':_0x1d0ef8[_0xc6c2('0x4c')]['id']}},_0x3e3bd4={};_0x3e3bd4[_0xc6c2('0x39')]=_[_0xc6c2('0x37')](db[_0xc6c2('0x31')]['rawAttributes']);_0x3e3bd4[_0xc6c2('0x36')]=_[_0xc6c2('0x37')](_0x1d0ef8[_0xc6c2('0x36')]);_0x3e3bd4[_0xc6c2('0x38')]=_[_0xc6c2('0x3a')](_0x3e3bd4[_0xc6c2('0x39')],_0x3e3bd4[_0xc6c2('0x36')]);_0x49608c[_0xc6c2('0x3c')]=_['intersection'](_0x3e3bd4[_0xc6c2('0x39')],qs[_0xc6c2('0x3b')](_0x1d0ef8[_0xc6c2('0x36')][_0xc6c2('0x3b')]));_0x49608c[_0xc6c2('0x3c')]=_0x49608c[_0xc6c2('0x3c')][_0xc6c2('0x4d')]?_0x49608c['attributes']:_0x3e3bd4[_0xc6c2('0x39')];if(_0x1d0ef8[_0xc6c2('0x36')][_0xc6c2('0x4e')]){_0x49608c[_0xc6c2('0x47')]=[{'all':!![]}];}_0x49608c=_['merge']({},_0x49608c,_0x1d0ef8[_0xc6c2('0x46')]);return db[_0xc6c2('0x31')][_0xc6c2('0x4f')](_0x49608c)[_0xc6c2('0x29')](handleEntityNotFound(_0x46d6e1,null))[_0xc6c2('0x29')](respondWithResult(_0x46d6e1,null))[_0xc6c2('0x4a')](handleError(_0x46d6e1,null));};exports[_0xc6c2('0x50')]=function(_0x50e867,_0x4d775d){return db[_0xc6c2('0x31')]['create'](_0x50e867['body'],{})[_0xc6c2('0x29')](function(_0x21323f){var _0x1c9ad3=_0x50e867['user'][_0xc6c2('0x51')]({'plain':!![]});if(!_0x1c9ad3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c9ad3[_0xc6c2('0x52')]===_0xc6c2('0x53')){var _0x3331d5=_0x21323f[_0xc6c2('0x51')]({'plain':!![]});var _0x112c8a=_0xc6c2('0x54');return db['UserProfileSection'][_0xc6c2('0x4f')]({'where':{'name':_0x112c8a,'userProfileId':_0x1c9ad3['userProfileId']},'raw':!![]})[_0xc6c2('0x29')](function(_0x4acf67){if(_0x4acf67&&_0x4acf67[_0xc6c2('0x55')]===0x0){return db[_0xc6c2('0x2a')]['create']({'name':_0x3331d5[_0xc6c2('0x2d')],'resourceId':_0x3331d5['id'],'type':_0x4acf67[_0xc6c2('0x2d')],'sectionId':_0x4acf67['id']},{})[_0xc6c2('0x29')](function(){return _0x21323f;});}else{return _0x21323f;}})[_0xc6c2('0x4a')](function(_0x28c92b){logger[_0xc6c2('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28c92b);throw _0x28c92b;});}return _0x21323f;})[_0xc6c2('0x29')](respondWithResult(_0x4d775d,0xc9))[_0xc6c2('0x4a')](handleError(_0x4d775d,null));};exports[_0xc6c2('0x27')]=function(_0x33fa06,_0x25ef6f){if(_0x33fa06[_0xc6c2('0x56')]['id']){delete _0x33fa06[_0xc6c2('0x56')]['id'];}return db[_0xc6c2('0x31')][_0xc6c2('0x4f')]({'where':{'id':_0x33fa06[_0xc6c2('0x4c')]['id']}})[_0xc6c2('0x29')](handleEntityNotFound(_0x25ef6f,null))['then'](saveUpdates(_0x33fa06[_0xc6c2('0x56')],null))[_0xc6c2('0x29')](respondWithResult(_0x25ef6f,null))[_0xc6c2('0x4a')](handleError(_0x25ef6f,null));};exports[_0xc6c2('0x28')]=function(_0x4df01f,_0x1133f5){return db[_0xc6c2('0x31')][_0xc6c2('0x4f')]({'where':{'id':_0x4df01f[_0xc6c2('0x4c')]['id']}})[_0xc6c2('0x29')](handleEntityNotFound(_0x1133f5,null))[_0xc6c2('0x29')](removeEntity(_0x1133f5,null))[_0xc6c2('0x4a')](handleError(_0x1133f5,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e2c8cc7..d60bdd1 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 _0x5c48=['../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5c48,0x1bf));var _0x85c4=function(_0x5be7ac,_0x2e2278){_0x5be7ac=_0x5be7ac-0x0;var _0x27c855=_0x5c48[_0x5be7ac];return _0x27c855;};'use strict';var _=require(_0x85c4('0x0'));var util=require('util');var logger=require(_0x85c4('0x1'))(_0x85c4('0x2'));var moment=require(_0x85c4('0x3'));var BPromise=require(_0x85c4('0x4'));var rp=require(_0x85c4('0x5'));var fs=require('fs');var path=require(_0x85c4('0x6'));var rimraf=require(_0x85c4('0x7'));var config=require(_0x85c4('0x8'));var attributes=require(_0x85c4('0x9'));module[_0x85c4('0xa')]=function(_0x579134,_0x2a2fa5){return _0x579134['define'](_0x85c4('0xb'),attributes,{'tableName':_0x85c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8f4=['tools_templates','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./template.attributes','exports'];(function(_0x1b10ac,_0x1328e7){var _0x8f98cf=function(_0x502d36){while(--_0x502d36){_0x1b10ac['push'](_0x1b10ac['shift']());}};_0x8f98cf(++_0x1328e7);}(_0xd8f4,0x11f));var _0x4d8f=function(_0x197516,_0x166112){_0x197516=_0x197516-0x0;var _0x555c02=_0xd8f4[_0x197516];return _0x555c02;};'use strict';var _=require(_0x4d8f('0x0'));var util=require(_0x4d8f('0x1'));var logger=require(_0x4d8f('0x2'))(_0x4d8f('0x3'));var moment=require('moment');var BPromise=require(_0x4d8f('0x4'));var rp=require(_0x4d8f('0x5'));var fs=require('fs');var path=require(_0x4d8f('0x6'));var rimraf=require(_0x4d8f('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d8f('0x8'));module[_0x4d8f('0x9')]=function(_0x278b76,_0x1b6ef0){return _0x278b76['define']('Template',attributes,{'tableName':_0x4d8f('0xa'),'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 0fc56d6..a287fd1 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 _0x1535=['info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1535,0x9d));var _0x5153=function(_0xe8ccc2,_0x45ff5b){_0xe8ccc2=_0xe8ccc2-0x0;var _0x5b07d=_0x1535[_0xe8ccc2];return _0x5b07d;};'use strict';var _=require(_0x5153('0x0'));var util=require(_0x5153('0x1'));var moment=require(_0x5153('0x2'));var BPromise=require(_0x5153('0x3'));var rs=require(_0x5153('0x4'));var fs=require('fs');var Redis=require(_0x5153('0x5'));var db=require(_0x5153('0x6'))['db'];var utils=require(_0x5153('0x7'));var logger=require(_0x5153('0x8'))('rpc');var config=require(_0x5153('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5153('0xa')][_0x5153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x109af7,_0x1ca57e,_0x3b3288){return new BPromise(function(_0x25b803,_0x1e1ec7){return client['request'](_0x109af7,_0x3b3288)[_0x5153('0xc')](function(_0x22c601){logger[_0x5153('0xd')](_0x5153('0xe'),_0x1ca57e,'request\x20sent');logger[_0x5153('0xf')](_0x5153('0x10'),_0x1ca57e,_0x5153('0x11'),JSON[_0x5153('0x12')](_0x22c601));if(_0x22c601[_0x5153('0x13')]){if(_0x22c601['error'][_0x5153('0x14')]===0x1f4){logger['error'](_0x5153('0xe'),_0x1ca57e,_0x22c601[_0x5153('0x13')][_0x5153('0x15')]);return _0x1e1ec7(_0x22c601['error'][_0x5153('0x15')]);}logger[_0x5153('0x13')]('Template,\x20%s,\x20%s',_0x1ca57e,_0x22c601[_0x5153('0x13')]['message']);return _0x25b803(_0x22c601[_0x5153('0x13')][_0x5153('0x15')]);}else{logger[_0x5153('0xd')]('Template,\x20%s,\x20%s',_0x1ca57e,_0x5153('0x11'));_0x25b803(_0x22c601['result'][_0x5153('0x15')]);}})['catch'](function(_0x138de2){logger[_0x5153('0x13')](_0x5153('0xe'),_0x1ca57e,_0x138de2);_0x1e1ec7(_0x138de2);});});}exports[_0x5153('0x16')]=function(_0x14b347){var _0x4b237c=this;return new Promise(function(_0x27e1fa,_0x3d9274){return db[_0x5153('0x17')][_0x5153('0x18')]({'raw':_0x14b347[_0x5153('0x19')]?_0x14b347[_0x5153('0x19')][_0x5153('0x1a')]===undefined?!![]:![]:!![],'where':_0x14b347['options']?_0x14b347[_0x5153('0x19')][_0x5153('0x1b')]||null:null,'attributes':_0x14b347[_0x5153('0x19')]?_0x14b347['options'][_0x5153('0x1c')]||null:null,'limit':_0x14b347[_0x5153('0x19')]?_0x14b347[_0x5153('0x19')][_0x5153('0x1d')]||null:null,'include':_0x14b347[_0x5153('0x19')]?_0x14b347[_0x5153('0x19')][_0x5153('0x1e')]?_[_0x5153('0x1f')](_0x14b347['options'][_0x5153('0x1e')],function(_0x1e1e1c){return{'model':db[_0x1e1e1c[_0x5153('0x20')]],'as':_0x1e1e1c['as'],'attributes':_0x1e1e1c['attributes'],'include':_0x1e1e1c['include']?_[_0x5153('0x1f')](_0x1e1e1c[_0x5153('0x1e')],function(_0x5861e9){return{'model':db[_0x5861e9[_0x5153('0x20')]],'as':_0x5861e9['as'],'attributes':_0x5861e9[_0x5153('0x1c')],'include':_0x5861e9[_0x5153('0x1e')]?_['map'](_0x5861e9[_0x5153('0x1e')],function(_0x4aac1c){return{'model':db[_0x4aac1c[_0x5153('0x20')]],'as':_0x4aac1c['as'],'attributes':_0x4aac1c[_0x5153('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6833ab){logger['info'](_0x5153('0x16'),_0x14b347);logger['debug'](_0x5153('0x16'),_0x14b347,JSON[_0x5153('0x12')](_0x6833ab));_0x27e1fa(_0x6833ab);})[_0x5153('0x21')](function(_0x5a5c03){logger[_0x5153('0x13')](_0x5153('0x16'),_0x5a5c03[_0x5153('0x15')],_0x14b347);_0x3d9274(_0x4b237c['error'](0x1f4,_0x5a5c03[_0x5153('0x15')]));});});}; \ No newline at end of file +var _0xb995=['jayson/promise','client','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','message','catch','GetTemplate','findAll','options','attributes','limit','include','map','model','stringify','util','moment','bluebird','../../mysqldb','rpc','../../config/environment'];(function(_0x5776be,_0xe7d819){var _0x2ad71a=function(_0x4f8ce0){while(--_0x4f8ce0){_0x5776be['push'](_0x5776be['shift']());}};_0x2ad71a(++_0xe7d819);}(_0xb995,0xe4));var _0x5b99=function(_0x3ba146,_0x28f9d0){_0x3ba146=_0x3ba146-0x0;var _0x3518fb=_0xb995[_0x3ba146];return _0x3518fb;};'use strict';var _=require('lodash');var util=require(_0x5b99('0x0'));var moment=require(_0x5b99('0x1'));var BPromise=require(_0x5b99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b99('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5b99('0x4'));var config=require(_0x5b99('0x5'));var jayson=require(_0x5b99('0x6'));var client=jayson[_0x5b99('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x495115,_0x2bb9cf,_0x25ef62){return new BPromise(function(_0x430dad,_0x5f1ba6){return client['request'](_0x495115,_0x25ef62)[_0x5b99('0x8')](function(_0x51439f){logger[_0x5b99('0x9')](_0x5b99('0xa'),_0x2bb9cf,_0x5b99('0xb'));logger[_0x5b99('0xc')](_0x5b99('0xd'),_0x2bb9cf,_0x5b99('0xb'),JSON['stringify'](_0x51439f));if(_0x51439f['error']){if(_0x51439f[_0x5b99('0xe')]['code']===0x1f4){logger['error'](_0x5b99('0xa'),_0x2bb9cf,_0x51439f[_0x5b99('0xe')][_0x5b99('0xf')]);return _0x5f1ba6(_0x51439f[_0x5b99('0xe')][_0x5b99('0xf')]);}logger[_0x5b99('0xe')](_0x5b99('0xa'),_0x2bb9cf,_0x51439f[_0x5b99('0xe')][_0x5b99('0xf')]);return _0x430dad(_0x51439f[_0x5b99('0xe')]['message']);}else{logger[_0x5b99('0x9')]('Template,\x20%s,\x20%s',_0x2bb9cf,_0x5b99('0xb'));_0x430dad(_0x51439f['result'][_0x5b99('0xf')]);}})[_0x5b99('0x10')](function(_0x16e128){logger['error'](_0x5b99('0xa'),_0x2bb9cf,_0x16e128);_0x5f1ba6(_0x16e128);});});}exports[_0x5b99('0x11')]=function(_0x4b29c9){var _0x47938f=this;return new Promise(function(_0x5c0c22,_0x476554){return db['Template'][_0x5b99('0x12')]({'raw':_0x4b29c9[_0x5b99('0x13')]?_0x4b29c9[_0x5b99('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x4b29c9[_0x5b99('0x13')]?_0x4b29c9['options']['where']||null:null,'attributes':_0x4b29c9[_0x5b99('0x13')]?_0x4b29c9['options'][_0x5b99('0x14')]||null:null,'limit':_0x4b29c9[_0x5b99('0x13')]?_0x4b29c9['options'][_0x5b99('0x15')]||null:null,'include':_0x4b29c9[_0x5b99('0x13')]?_0x4b29c9['options'][_0x5b99('0x16')]?_[_0x5b99('0x17')](_0x4b29c9[_0x5b99('0x13')]['include'],function(_0x514a05){return{'model':db[_0x514a05[_0x5b99('0x18')]],'as':_0x514a05['as'],'attributes':_0x514a05[_0x5b99('0x14')],'include':_0x514a05[_0x5b99('0x16')]?_[_0x5b99('0x17')](_0x514a05['include'],function(_0xb5ce76){return{'model':db[_0xb5ce76[_0x5b99('0x18')]],'as':_0xb5ce76['as'],'attributes':_0xb5ce76['attributes'],'include':_0xb5ce76[_0x5b99('0x16')]?_['map'](_0xb5ce76[_0x5b99('0x16')],function(_0x1d783b){return{'model':db[_0x1d783b['model']],'as':_0x1d783b['as'],'attributes':_0x1d783b[_0x5b99('0x14')]};}):[]};}):[]};}):[]:[]})[_0x5b99('0x8')](function(_0x2e221b){logger[_0x5b99('0x9')](_0x5b99('0x11'),_0x4b29c9);logger[_0x5b99('0xc')]('GetTemplate',_0x4b29c9,JSON[_0x5b99('0x19')](_0x2e221b));_0x5c0c22(_0x2e221b);})[_0x5b99('0x10')](function(_0x1c198b){logger['error'](_0x5b99('0x11'),_0x1c198b[_0x5b99('0xf')],_0x4b29c9);_0x476554(_0x47938f[_0x5b99('0xe')](0x1f4,_0x1c198b[_0x5b99('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 3748f82..33e2b56 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 _0x6dd5=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','put','update','delete','exports','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6dd5,0x1b8));var _0x56dd=function(_0x3c3bd3,_0x31773e){_0x3c3bd3=_0x3c3bd3-0x0;var _0x5b3140=_0x6dd5[_0x3c3bd3];return _0x5b3140;};'use strict';var multer=require('multer');var util=require(_0x56dd('0x0'));var path=require(_0x56dd('0x1'));var timeout=require(_0x56dd('0x2'));var express=require(_0x56dd('0x3'));var router=express[_0x56dd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x56dd('0x5'));var interaction=require(_0x56dd('0x6'));var config=require(_0x56dd('0x7'));var controller=require(_0x56dd('0x8'));router[_0x56dd('0x9')]('/',auth[_0x56dd('0xa')](),controller[_0x56dd('0xb')]);router[_0x56dd('0x9')](_0x56dd('0xc'),auth[_0x56dd('0xa')](),controller[_0x56dd('0xd')]);router[_0x56dd('0x9')](_0x56dd('0xe'),auth[_0x56dd('0xa')](),controller['getAllConditions']);router['get'](_0x56dd('0xf'),auth['isAuthenticated'](),controller['getAnyConditions']);router['get']('/:id/actions',auth[_0x56dd('0xa')](),controller['getActions']);router[_0x56dd('0x10')]('/',auth['isAuthenticated'](),controller[_0x56dd('0x11')]);router[_0x56dd('0x10')](_0x56dd('0xe'),auth[_0x56dd('0xa')](),controller[_0x56dd('0x12')]);router[_0x56dd('0x10')](_0x56dd('0xf'),auth[_0x56dd('0xa')](),controller[_0x56dd('0x13')]);router[_0x56dd('0x10')](_0x56dd('0x14'),auth['isAuthenticated'](),controller[_0x56dd('0x15')]);router[_0x56dd('0x16')]('/:id',auth[_0x56dd('0xa')](),controller[_0x56dd('0x17')]);router[_0x56dd('0x18')]('/:id',auth[_0x56dd('0xa')](),controller['destroy']);module[_0x56dd('0x19')]=router; \ No newline at end of file +var _0x7829=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7829,0xd4));var _0x9782=function(_0x27d009,_0x9667fd){_0x27d009=_0x27d009-0x0;var _0x1ccbde=_0x7829[_0x27d009];return _0x1ccbde;};'use strict';var multer=require(_0x9782('0x0'));var util=require(_0x9782('0x1'));var path=require('path');var timeout=require(_0x9782('0x2'));var express=require(_0x9782('0x3'));var router=express[_0x9782('0x4')]();var fs_extra=require(_0x9782('0x5'));var auth=require(_0x9782('0x6'));var interaction=require(_0x9782('0x7'));var config=require(_0x9782('0x8'));var controller=require(_0x9782('0x9'));router['get']('/',auth[_0x9782('0xa')](),controller[_0x9782('0xb')]);router[_0x9782('0xc')](_0x9782('0xd'),auth[_0x9782('0xa')](),controller['show']);router[_0x9782('0xc')]('/:id/all_conditions',auth[_0x9782('0xa')](),controller['getAllConditions']);router[_0x9782('0xc')]('/:id/any_conditions',auth[_0x9782('0xa')](),controller['getAnyConditions']);router[_0x9782('0xc')]('/:id/actions',auth[_0x9782('0xa')](),controller[_0x9782('0xe')]);router[_0x9782('0xf')]('/',auth[_0x9782('0xa')](),controller['create']);router[_0x9782('0xf')]('/:id/all_conditions',auth[_0x9782('0xa')](),controller[_0x9782('0x10')]);router[_0x9782('0xf')](_0x9782('0x11'),auth[_0x9782('0xa')](),controller[_0x9782('0x12')]);router[_0x9782('0xf')]('/:id/actions',auth['isAuthenticated'](),controller['addAction']);router[_0x9782('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x9782('0x14')]);router[_0x9782('0x15')](_0x9782('0xd'),auth[_0x9782('0xa')](),controller[_0x9782('0x16')]);module[_0x9782('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 40a4278..74caa44 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 _0xdaa6=['STRING'];(function(_0xc80d84,_0x2c72f5){var _0x231c84=function(_0x28d28a){while(--_0x28d28a){_0xc80d84['push'](_0xc80d84['shift']());}};_0x231c84(++_0x2c72f5);}(_0xdaa6,0x133));var _0x6daa=function(_0x142f99,_0xb115e9){_0x142f99=_0x142f99-0x0;var _0x29f36d=_0xdaa6[_0x142f99];return _0x29f36d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6daa('0x0')]},'description':{'type':Sequelize[_0x6daa('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb7fa=['BOOLEAN','sequelize','exports','STRING'];(function(_0x12ffdf,_0x5028d0){var _0x3ee7c1=function(_0x51641c){while(--_0x51641c){_0x12ffdf['push'](_0x12ffdf['shift']());}};_0x3ee7c1(++_0x5028d0);}(_0xb7fa,0x9d));var _0xab7f=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xb7fa[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0xab7f('0x0'));module[_0xab7f('0x1')]={'name':{'type':Sequelize[_0xab7f('0x2')]},'channel':{'type':Sequelize[_0xab7f('0x2')]},'description':{'type':Sequelize[_0xab7f('0x2')]},'status':{'type':Sequelize[_0xab7f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 6505c9d..9c9fd51 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 _0xbdf8=['sort','getAllConditions','getAnyConditions','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','user','get','role','Triggers','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','findOne','Condition'];(function(_0x224ef7,_0x2d4a1c){var _0x1e52c5=function(_0x3df78c){while(--_0x3df78c){_0x224ef7['push'](_0x224ef7['shift']());}};_0x1e52c5(++_0x2d4a1c);}(_0xbdf8,0xbc));var _0x8bdf=function(_0x4fe7d5,_0x112c3d){_0x4fe7d5=_0x4fe7d5-0x0;var _0x46e5b3=_0xbdf8[_0x4fe7d5];return _0x46e5b3;};'use strict';var emlformat=require(_0x8bdf('0x0'));var rimraf=require(_0x8bdf('0x1'));var zipdir=require(_0x8bdf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bdf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bdf('0x4'));var path=require(_0x8bdf('0x5'));var sox=require(_0x8bdf('0x6'));var csv=require(_0x8bdf('0x7'));var ejs=require(_0x8bdf('0x8'));var fs=require('fs');var fs_extra=require(_0x8bdf('0x9'));var _=require(_0x8bdf('0xa'));var squel=require('squel');var crypto=require(_0x8bdf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8bdf('0xc'));var toCsv=require(_0x8bdf('0x7'));var querystring=require('querystring');var Papa=require(_0x8bdf('0xd'));var Redis=require(_0x8bdf('0xe'));var authService=require(_0x8bdf('0xf'));var qs=require(_0x8bdf('0x10'));var as=require(_0x8bdf('0x11'));var hardwareService=require(_0x8bdf('0x12'));var logger=require(_0x8bdf('0x13'))(_0x8bdf('0x14'));var utils=require(_0x8bdf('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8bdf('0x16'))['db'];function respondWithStatusCode(_0x400a54,_0x45ea9d){_0x45ea9d=_0x45ea9d||0xcc;return function(_0x1745fc){if(_0x1745fc){return _0x400a54[_0x8bdf('0x17')](_0x45ea9d);}return _0x400a54[_0x8bdf('0x18')](_0x45ea9d)[_0x8bdf('0x19')]();};}function respondWithResult(_0x4b5f3b,_0x1d48c1){_0x1d48c1=_0x1d48c1||0xc8;return function(_0x22cfe4){if(_0x22cfe4){return _0x4b5f3b[_0x8bdf('0x18')](_0x1d48c1)[_0x8bdf('0x1a')](_0x22cfe4);}};}function respondWithFilteredResult(_0x204af8,_0x2653fe){return function(_0x111a84){if(_0x111a84){var _0x23d0ee=typeof _0x2653fe['offset']===_0x8bdf('0x1b')&&typeof _0x2653fe[_0x8bdf('0x1c')]===_0x8bdf('0x1b');var _0x3d319b=_0x111a84['count'];var _0x2eea06=_0x23d0ee?0x0:_0x2653fe['offset'];var _0x327333=_0x23d0ee?_0x111a84['count']:_0x2653fe[_0x8bdf('0x1d')]+_0x2653fe[_0x8bdf('0x1c')];var _0x10a6c5;if(_0x327333>=_0x3d319b){_0x327333=_0x3d319b;_0x10a6c5=0xc8;}else{_0x10a6c5=0xce;}_0x204af8[_0x8bdf('0x18')](_0x10a6c5);return _0x204af8['set'](_0x8bdf('0x1e'),_0x2eea06+'-'+_0x327333+'/'+_0x3d319b)[_0x8bdf('0x1a')](_0x111a84);}return null;};}function patchUpdates(_0x16dda7){return function(_0x2e4106){try{jsonpatch['apply'](_0x2e4106,_0x16dda7,!![]);}catch(_0x2436fe){return BPromise[_0x8bdf('0x1f')](_0x2436fe);}return _0x2e4106[_0x8bdf('0x20')]();};}function saveUpdates(_0x542191,_0x29fb38){return function(_0x52bd2e){if(_0x52bd2e){return _0x52bd2e['update'](_0x542191)[_0x8bdf('0x21')](function(_0x146210){return _0x146210;});}return null;};}function removeEntity(_0x7da7c0,_0x2cbb51){return function(_0x305ff4){if(_0x305ff4){return _0x305ff4[_0x8bdf('0x22')]()[_0x8bdf('0x21')](function(){var _0x29698d=_0x305ff4['get']({'plain':!![]});var _0x23550d='Triggers';return db['UserProfileResource'][_0x8bdf('0x22')]({'where':{'type':_0x23550d,'resourceId':_0x29698d['id']}})[_0x8bdf('0x21')](function(){return _0x305ff4;});})['then'](function(){_0x7da7c0[_0x8bdf('0x18')](0xcc)[_0x8bdf('0x19')]();});}};}function handleEntityNotFound(_0x1d7a10,_0x434c69){return function(_0x5b93c0){if(!_0x5b93c0){_0x1d7a10[_0x8bdf('0x17')](0x194);}return _0x5b93c0;};}function handleError(_0x5a071d,_0x4cdbe2){_0x4cdbe2=_0x4cdbe2||0x1f4;return function(_0x4c0737){logger[_0x8bdf('0x23')](_0x4c0737[_0x8bdf('0x24')]);if(_0x4c0737[_0x8bdf('0x25')]){delete _0x4c0737[_0x8bdf('0x25')];}_0x5a071d[_0x8bdf('0x18')](_0x4cdbe2)[_0x8bdf('0x26')](_0x4c0737);};}exports[_0x8bdf('0x27')]=function(_0x55ca6b,_0x1e5454){var _0xb649f5={},_0x404d8f={},_0x11f5d1={'count':0x0,'rows':[]};var _0x337cc9=_[_0x8bdf('0x28')](db[_0x8bdf('0x29')][_0x8bdf('0x2a')],function(_0x4bedec){return{'name':_0x4bedec[_0x8bdf('0x2b')],'type':_0x4bedec[_0x8bdf('0x2c')]['key']};});_0x404d8f[_0x8bdf('0x2d')]=_[_0x8bdf('0x28')](_0x337cc9,_0x8bdf('0x25'));_0x404d8f['query']=_[_0x8bdf('0x2e')](_0x55ca6b[_0x8bdf('0x2f')]);_0x404d8f['filters']=_[_0x8bdf('0x30')](_0x404d8f[_0x8bdf('0x2d')],_0x404d8f['query']);_0xb649f5[_0x8bdf('0x31')]=_[_0x8bdf('0x30')](_0x404d8f[_0x8bdf('0x2d')],qs[_0x8bdf('0x32')](_0x55ca6b[_0x8bdf('0x2f')][_0x8bdf('0x32')]));_0xb649f5[_0x8bdf('0x31')]=_0xb649f5['attributes']['length']?_0xb649f5[_0x8bdf('0x31')]:_0x404d8f[_0x8bdf('0x2d')];if(!_0x55ca6b[_0x8bdf('0x2f')][_0x8bdf('0x33')](_0x8bdf('0x34'))){_0xb649f5[_0x8bdf('0x1c')]=qs[_0x8bdf('0x1c')](_0x55ca6b[_0x8bdf('0x2f')][_0x8bdf('0x1c')]);_0xb649f5[_0x8bdf('0x1d')]=qs[_0x8bdf('0x1d')](_0x55ca6b['query'][_0x8bdf('0x1d')]);}_0xb649f5[_0x8bdf('0x35')]=qs['sort'](_0x55ca6b[_0x8bdf('0x2f')]['sort']);_0xb649f5['where']=qs[_0x8bdf('0x36')](_[_0x8bdf('0x37')](_0x55ca6b[_0x8bdf('0x2f')],_0x404d8f['filters']),_0x337cc9);if(_0x55ca6b[_0x8bdf('0x2f')][_0x8bdf('0x38')]){_0xb649f5[_0x8bdf('0x39')]=_[_0x8bdf('0x3a')](_0xb649f5[_0x8bdf('0x39')],{'$or':_[_0x8bdf('0x28')](_0x337cc9,function(_0x33f56e){if(_0x33f56e[_0x8bdf('0x2c')]!=='VIRTUAL'){var _0x385daa={};_0x385daa[_0x33f56e[_0x8bdf('0x25')]]={'$like':'%'+_0x55ca6b[_0x8bdf('0x2f')]['filter']+'%'};return _0x385daa;}})});}_0xb649f5=_[_0x8bdf('0x3a')]({},_0xb649f5,_0x55ca6b[_0x8bdf('0x3b')]);var _0x22b259={'where':_0xb649f5[_0x8bdf('0x39')]};return db['Trigger']['count'](_0x22b259)['then'](function(_0x18d73a){_0x11f5d1['count']=_0x18d73a;if(_0x55ca6b['query'][_0x8bdf('0x3c')]){_0xb649f5['include']=[{'all':!![]}];}return db['Trigger'][_0x8bdf('0x3d')](_0xb649f5);})[_0x8bdf('0x21')](function(_0xbb1a6e){_0x11f5d1[_0x8bdf('0x3e')]=_0xbb1a6e;return _0x11f5d1;})[_0x8bdf('0x21')](respondWithFilteredResult(_0x1e5454,_0xb649f5))[_0x8bdf('0x3f')](handleError(_0x1e5454,null));};exports[_0x8bdf('0x40')]=function(_0x13da44,_0x4435fb){var _0x125f01={'raw':![],'where':{'id':_0x13da44[_0x8bdf('0x41')]['id']}},_0x1aa67d={};_0x1aa67d[_0x8bdf('0x2d')]=_[_0x8bdf('0x2e')](db[_0x8bdf('0x29')]['rawAttributes']);_0x1aa67d[_0x8bdf('0x2f')]=_[_0x8bdf('0x2e')](_0x13da44[_0x8bdf('0x2f')]);_0x1aa67d['filters']=_[_0x8bdf('0x30')](_0x1aa67d['model'],_0x1aa67d[_0x8bdf('0x2f')]);_0x125f01[_0x8bdf('0x31')]=_['intersection'](_0x1aa67d[_0x8bdf('0x2d')],qs[_0x8bdf('0x32')](_0x13da44[_0x8bdf('0x2f')]['fields']));_0x125f01[_0x8bdf('0x31')]=_0x125f01[_0x8bdf('0x31')][_0x8bdf('0x42')]?_0x125f01[_0x8bdf('0x31')]:_0x1aa67d[_0x8bdf('0x2d')];if(_0x13da44[_0x8bdf('0x2f')][_0x8bdf('0x3c')]){_0x125f01['include']=[{'all':!![]}];}_0x125f01=_['merge']({},_0x125f01,_0x13da44[_0x8bdf('0x3b')]);return db['Trigger'][_0x8bdf('0x43')](_0x125f01)[_0x8bdf('0x21')](handleEntityNotFound(_0x4435fb,null))[_0x8bdf('0x21')](respondWithResult(_0x4435fb,null))['catch'](handleError(_0x4435fb,null));};exports['create']=function(_0x567a6c,_0x1566c3){return db['Trigger'][_0x8bdf('0x44')](_0x567a6c[_0x8bdf('0x45')],{})[_0x8bdf('0x21')](function(_0x3940a2){var _0x293040=_0x567a6c[_0x8bdf('0x46')][_0x8bdf('0x47')]({'plain':!![]});if(!_0x293040)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293040[_0x8bdf('0x48')]===_0x8bdf('0x46')){var _0x1ca242=_0x3940a2[_0x8bdf('0x47')]({'plain':!![]});var _0x2a5f29=_0x8bdf('0x49');return db[_0x8bdf('0x4a')][_0x8bdf('0x43')]({'where':{'name':_0x2a5f29,'userProfileId':_0x293040['userProfileId']},'raw':!![]})[_0x8bdf('0x21')](function(_0x5c349a){if(_0x5c349a&&_0x5c349a[_0x8bdf('0x4b')]===0x0){return db[_0x8bdf('0x4c')][_0x8bdf('0x44')]({'name':_0x1ca242['name'],'resourceId':_0x1ca242['id'],'type':_0x5c349a[_0x8bdf('0x25')],'sectionId':_0x5c349a['id']},{})[_0x8bdf('0x21')](function(){return _0x3940a2;});}else{return _0x3940a2;}})['catch'](function(_0x5aeb21){logger[_0x8bdf('0x23')](_0x8bdf('0x4d'),_0x5aeb21);throw _0x5aeb21;});}return _0x3940a2;})[_0x8bdf('0x21')](respondWithResult(_0x1566c3,0xc9))[_0x8bdf('0x3f')](handleError(_0x1566c3,null));};exports[_0x8bdf('0x4e')]=function(_0x42fd1a,_0x54487e){if(_0x42fd1a[_0x8bdf('0x45')]['id']){delete _0x42fd1a[_0x8bdf('0x45')]['id'];}return db[_0x8bdf('0x29')][_0x8bdf('0x43')]({'where':{'id':_0x42fd1a['params']['id']}})[_0x8bdf('0x21')](handleEntityNotFound(_0x54487e,null))[_0x8bdf('0x21')](saveUpdates(_0x42fd1a[_0x8bdf('0x45')],null))[_0x8bdf('0x21')](respondWithResult(_0x54487e,null))['catch'](handleError(_0x54487e,null));};exports[_0x8bdf('0x22')]=function(_0xf45cea,_0xe9d6e8){return db[_0x8bdf('0x29')][_0x8bdf('0x43')]({'where':{'id':_0xf45cea[_0x8bdf('0x41')]['id']}})[_0x8bdf('0x21')](handleEntityNotFound(_0xe9d6e8,null))[_0x8bdf('0x21')](removeEntity(_0xe9d6e8,null))[_0x8bdf('0x3f')](handleError(_0xe9d6e8,null));};exports[_0x8bdf('0x4f')]=function(_0x4a834b,_0x589181,_0x1ccc70){if(_0x4a834b[_0x8bdf('0x45')]['id']){delete _0x4a834b[_0x8bdf('0x45')]['id'];}return db['Trigger'][_0x8bdf('0x43')]({'where':{'id':_0x4a834b[_0x8bdf('0x41')]['id']}})['then'](handleEntityNotFound(_0x589181,null))[_0x8bdf('0x21')](function(_0x21bf43){if(_0x21bf43){_0x4a834b[_0x8bdf('0x45')][_0x8bdf('0x50')]=_0x21bf43['id'];return db['Condition'][_0x8bdf('0x44')](_0x4a834b[_0x8bdf('0x45')]);}})[_0x8bdf('0x21')](respondWithResult(_0x589181,null))['catch'](handleError(_0x589181,null));};exports[_0x8bdf('0x51')]=function(_0x310a84,_0x4c71ce,_0x19a89a){if(_0x310a84['body']['id']){delete _0x310a84[_0x8bdf('0x45')]['id'];}return db[_0x8bdf('0x29')][_0x8bdf('0x43')]({'where':{'id':_0x310a84['params']['id']}})[_0x8bdf('0x21')](handleEntityNotFound(_0x4c71ce,null))[_0x8bdf('0x21')](function(_0x349171){if(_0x349171){_0x310a84[_0x8bdf('0x45')][_0x8bdf('0x52')]=_0x349171['id'];return db['Condition'][_0x8bdf('0x44')](_0x310a84[_0x8bdf('0x45')]);}})['then'](respondWithResult(_0x4c71ce,null))[_0x8bdf('0x3f')](handleError(_0x4c71ce,null));};exports['getAllConditions']=function(_0x3e859d,_0x5e60a2,_0x5b46d8){var _0x23ac49={};var _0x4b7d98={};var _0x20404a;var _0x554ad4;return db['Trigger'][_0x8bdf('0x53')]({'where':{'id':_0x3e859d[_0x8bdf('0x41')]['id']}})[_0x8bdf('0x21')](handleEntityNotFound(_0x5e60a2,null))[_0x8bdf('0x21')](function(_0x4f29bd){if(_0x4f29bd){_0x20404a=_0x4f29bd;_0x4b7d98[_0x8bdf('0x2d')]=_[_0x8bdf('0x2e')](db[_0x8bdf('0x54')][_0x8bdf('0x2a')]);_0x4b7d98[_0x8bdf('0x2f')]=_[_0x8bdf('0x2e')](_0x3e859d[_0x8bdf('0x2f')]);_0x4b7d98[_0x8bdf('0x36')]=_[_0x8bdf('0x30')](_0x4b7d98['model'],_0x4b7d98['query']);_0x23ac49['attributes']=_['intersection'](_0x4b7d98[_0x8bdf('0x2d')],qs[_0x8bdf('0x32')](_0x3e859d['query'][_0x8bdf('0x32')]));_0x23ac49['attributes']=_0x23ac49['attributes']['length']?_0x23ac49['attributes']:_0x4b7d98[_0x8bdf('0x2d')];_0x23ac49['order']=qs[_0x8bdf('0x55')](_0x3e859d[_0x8bdf('0x2f')][_0x8bdf('0x55')]);_0x23ac49[_0x8bdf('0x39')]=qs[_0x8bdf('0x36')](_[_0x8bdf('0x37')](_0x3e859d[_0x8bdf('0x2f')],_0x4b7d98[_0x8bdf('0x36')]));if(_0x3e859d[_0x8bdf('0x2f')][_0x8bdf('0x38')]){_0x23ac49[_0x8bdf('0x39')]=_[_0x8bdf('0x3a')](_0x23ac49[_0x8bdf('0x39')],{'$or':_['map'](_0x23ac49[_0x8bdf('0x31')],function(_0x28767a){var _0x5c9d9c={};_0x5c9d9c[_0x28767a]={'$like':'%'+_0x3e859d[_0x8bdf('0x2f')][_0x8bdf('0x38')]+'%'};return _0x5c9d9c;})});}_0x23ac49=_[_0x8bdf('0x3a')]({},_0x23ac49,_0x3e859d[_0x8bdf('0x3b')]);return _0x20404a[_0x8bdf('0x56')](_0x23ac49);}})['then'](function(_0x4ae1d5){if(_0x4ae1d5){_0x554ad4=_0x4ae1d5[_0x8bdf('0x42')];if(!_0x3e859d['query'][_0x8bdf('0x33')](_0x8bdf('0x34'))){_0x23ac49[_0x8bdf('0x1c')]=qs['limit'](_0x3e859d[_0x8bdf('0x2f')][_0x8bdf('0x1c')]);_0x23ac49['offset']=qs[_0x8bdf('0x1d')](_0x3e859d[_0x8bdf('0x2f')][_0x8bdf('0x1d')]);}return _0x20404a[_0x8bdf('0x56')](_0x23ac49);}})['then'](function(_0x486adc){if(_0x486adc){return _0x486adc?{'count':_0x554ad4,'rows':_0x486adc}:null;}})[_0x8bdf('0x21')](respondWithResult(_0x5e60a2,null))[_0x8bdf('0x3f')](handleError(_0x5e60a2,null));};exports[_0x8bdf('0x57')]=function(_0x22241a,_0x5a359,_0x2c1e84){var _0x4d49b5={};var _0x46c2a7={};var _0x197cbe;var _0x4e6fa8;return db['Trigger']['findOne']({'where':{'id':_0x22241a[_0x8bdf('0x41')]['id']}})[_0x8bdf('0x21')](handleEntityNotFound(_0x5a359,null))[_0x8bdf('0x21')](function(_0xdd3953){if(_0xdd3953){_0x197cbe=_0xdd3953;_0x46c2a7['model']=_['keys'](db[_0x8bdf('0x54')][_0x8bdf('0x2a')]);_0x46c2a7[_0x8bdf('0x2f')]=_[_0x8bdf('0x2e')](_0x22241a['query']);_0x46c2a7[_0x8bdf('0x36')]=_[_0x8bdf('0x30')](_0x46c2a7['model'],_0x46c2a7[_0x8bdf('0x2f')]);_0x4d49b5['attributes']=_[_0x8bdf('0x30')](_0x46c2a7[_0x8bdf('0x2d')],qs[_0x8bdf('0x32')](_0x22241a['query'][_0x8bdf('0x32')]));_0x4d49b5[_0x8bdf('0x31')]=_0x4d49b5[_0x8bdf('0x31')][_0x8bdf('0x42')]?_0x4d49b5[_0x8bdf('0x31')]:_0x46c2a7['model'];_0x4d49b5[_0x8bdf('0x35')]=qs[_0x8bdf('0x55')](_0x22241a[_0x8bdf('0x2f')][_0x8bdf('0x55')]);_0x4d49b5['where']=qs[_0x8bdf('0x36')](_[_0x8bdf('0x37')](_0x22241a[_0x8bdf('0x2f')],_0x46c2a7[_0x8bdf('0x36')]));if(_0x22241a['query'][_0x8bdf('0x38')]){_0x4d49b5[_0x8bdf('0x39')]=_['merge'](_0x4d49b5[_0x8bdf('0x39')],{'$or':_['map'](_0x4d49b5[_0x8bdf('0x31')],function(_0x4d1c80){var _0x519acd={};_0x519acd[_0x4d1c80]={'$like':'%'+_0x22241a[_0x8bdf('0x2f')][_0x8bdf('0x38')]+'%'};return _0x519acd;})});}_0x4d49b5=_['merge']({},_0x4d49b5,_0x22241a[_0x8bdf('0x3b')]);return _0x197cbe[_0x8bdf('0x57')](_0x4d49b5);}})[_0x8bdf('0x21')](function(_0x3fa9dc){if(_0x3fa9dc){_0x4e6fa8=_0x3fa9dc[_0x8bdf('0x42')];if(!_0x22241a['query'][_0x8bdf('0x33')]('nolimit')){_0x4d49b5['limit']=qs[_0x8bdf('0x1c')](_0x22241a[_0x8bdf('0x2f')][_0x8bdf('0x1c')]);_0x4d49b5[_0x8bdf('0x1d')]=qs[_0x8bdf('0x1d')](_0x22241a[_0x8bdf('0x2f')][_0x8bdf('0x1d')]);}return _0x197cbe[_0x8bdf('0x57')](_0x4d49b5);}})['then'](function(_0x10ff78){if(_0x10ff78){return _0x10ff78?{'count':_0x4e6fa8,'rows':_0x10ff78}:null;}})[_0x8bdf('0x21')](respondWithResult(_0x5a359,null))[_0x8bdf('0x3f')](handleError(_0x5a359,null));};exports['addAction']=function(_0xd34579,_0x8a7513,_0x4a610f){if(_0xd34579[_0x8bdf('0x45')]['id']){delete _0xd34579[_0x8bdf('0x45')]['id'];}return db[_0x8bdf('0x29')][_0x8bdf('0x43')]({'where':{'id':_0xd34579[_0x8bdf('0x41')]['id']}})[_0x8bdf('0x21')](handleEntityNotFound(_0x8a7513,null))['then'](function(_0x3a2a32){if(_0x3a2a32){_0xd34579[_0x8bdf('0x45')][_0x8bdf('0x58')]=_0x3a2a32['id'];return db['Action'][_0x8bdf('0x44')](_0xd34579[_0x8bdf('0x45')]);}})[_0x8bdf('0x21')](respondWithResult(_0x8a7513,null))['catch'](handleError(_0x8a7513,null));};exports[_0x8bdf('0x59')]=function(_0x3801f0,_0x2a107b,_0x4c2984){var _0x4860e0={};var _0x24c187={};var _0x57d449;var _0x9d6b51;return db[_0x8bdf('0x29')][_0x8bdf('0x53')]({'where':{'id':_0x3801f0[_0x8bdf('0x41')]['id']}})[_0x8bdf('0x21')](handleEntityNotFound(_0x2a107b,null))['then'](function(_0x4b9d27){if(_0x4b9d27){_0x57d449=_0x4b9d27;_0x24c187[_0x8bdf('0x2d')]=_['keys'](db[_0x8bdf('0x5a')]['rawAttributes']);_0x24c187['query']=_['keys'](_0x3801f0['query']);_0x24c187[_0x8bdf('0x36')]=_[_0x8bdf('0x30')](_0x24c187[_0x8bdf('0x2d')],_0x24c187[_0x8bdf('0x2f')]);_0x4860e0[_0x8bdf('0x31')]=_[_0x8bdf('0x30')](_0x24c187[_0x8bdf('0x2d')],qs[_0x8bdf('0x32')](_0x3801f0['query'][_0x8bdf('0x32')]));_0x4860e0[_0x8bdf('0x31')]=_0x4860e0[_0x8bdf('0x31')][_0x8bdf('0x42')]?_0x4860e0[_0x8bdf('0x31')]:_0x24c187[_0x8bdf('0x2d')];_0x4860e0[_0x8bdf('0x35')]=qs[_0x8bdf('0x55')](_0x3801f0[_0x8bdf('0x2f')][_0x8bdf('0x55')]);_0x4860e0[_0x8bdf('0x39')]=qs[_0x8bdf('0x36')](_[_0x8bdf('0x37')](_0x3801f0[_0x8bdf('0x2f')],_0x24c187[_0x8bdf('0x36')]));if(_0x3801f0['query'][_0x8bdf('0x38')]){_0x4860e0[_0x8bdf('0x39')]=_['merge'](_0x4860e0['where'],{'$or':_['map'](_0x4860e0[_0x8bdf('0x31')],function(_0x24f803){var _0x481fa9={};_0x481fa9[_0x24f803]={'$like':'%'+_0x3801f0[_0x8bdf('0x2f')]['filter']+'%'};return _0x481fa9;})});}_0x4860e0=_[_0x8bdf('0x3a')]({},_0x4860e0,_0x3801f0[_0x8bdf('0x3b')]);return _0x57d449[_0x8bdf('0x59')](_0x4860e0);}})[_0x8bdf('0x21')](function(_0x54d35f){if(_0x54d35f){_0x9d6b51=_0x54d35f['length'];if(!_0x3801f0[_0x8bdf('0x2f')][_0x8bdf('0x33')](_0x8bdf('0x34'))){_0x4860e0[_0x8bdf('0x1c')]=qs[_0x8bdf('0x1c')](_0x3801f0[_0x8bdf('0x2f')][_0x8bdf('0x1c')]);_0x4860e0['offset']=qs['offset'](_0x3801f0['query']['offset']);}return _0x57d449[_0x8bdf('0x59')](_0x4860e0);}})[_0x8bdf('0x21')](function(_0x4ea709){if(_0x4ea709){return _0x4ea709?{'count':_0x9d6b51,'rows':_0x4ea709}:null;}})[_0x8bdf('0x21')](respondWithResult(_0x2a107b,null))[_0x8bdf('0x3f')](handleError(_0x2a107b,null));}; \ No newline at end of file +var _0x445f=['Condition','getAllConditions','sort','getAnyConditions','addAction','Action','getActions','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','get','Triggers','UserProfileResource','end','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Trigger','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','addAnyCondition'];(function(_0x238dd0,_0x48f910){var _0x1b9497=function(_0x1e89f3){while(--_0x1e89f3){_0x238dd0['push'](_0x238dd0['shift']());}};_0x1b9497(++_0x48f910);}(_0x445f,0x184));var _0xf445=function(_0x4935b1,_0x2c6114){_0x4935b1=_0x4935b1-0x0;var _0x3354c1=_0x445f[_0x4935b1];return _0x3354c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf445('0x0'));var zipdir=require(_0xf445('0x1'));var jsonpatch=require(_0xf445('0x2'));var rp=require('request-promise');var moment=require(_0xf445('0x3'));var BPromise=require(_0xf445('0x4'));var Mustache=require(_0xf445('0x5'));var util=require(_0xf445('0x6'));var path=require('path');var sox=require(_0xf445('0x7'));var csv=require('to-csv');var ejs=require(_0xf445('0x8'));var fs=require('fs');var fs_extra=require(_0xf445('0x9'));var _=require(_0xf445('0xa'));var squel=require('squel');var crypto=require(_0xf445('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf445('0xc'));var toCsv=require(_0xf445('0xd'));var querystring=require('querystring');var Papa=require(_0xf445('0xe'));var Redis=require(_0xf445('0xf'));var authService=require(_0xf445('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf445('0x11'));var hardwareService=require(_0xf445('0x12'));var logger=require(_0xf445('0x13'))(_0xf445('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf445('0x15'));var db=require(_0xf445('0x16'))['db'];function respondWithStatusCode(_0x2e6172,_0x2a81de){_0x2a81de=_0x2a81de||0xcc;return function(_0x49596e){if(_0x49596e){return _0x2e6172[_0xf445('0x17')](_0x2a81de);}return _0x2e6172[_0xf445('0x18')](_0x2a81de)['end']();};}function respondWithResult(_0x22fa81,_0x5a0b92){_0x5a0b92=_0x5a0b92||0xc8;return function(_0x319449){if(_0x319449){return _0x22fa81['status'](_0x5a0b92)['json'](_0x319449);}};}function respondWithFilteredResult(_0xd94eb1,_0x348fbc){return function(_0x269ce7){if(_0x269ce7){var _0x20ae34=typeof _0x348fbc[_0xf445('0x19')]==='undefined'&&typeof _0x348fbc[_0xf445('0x1a')]===_0xf445('0x1b');var _0x48b271=_0x269ce7[_0xf445('0x1c')];var _0x59b175=_0x20ae34?0x0:_0x348fbc[_0xf445('0x19')];var _0x980695=_0x20ae34?_0x269ce7['count']:_0x348fbc[_0xf445('0x19')]+_0x348fbc['limit'];var _0x327081;if(_0x980695>=_0x48b271){_0x980695=_0x48b271;_0x327081=0xc8;}else{_0x327081=0xce;}_0xd94eb1['status'](_0x327081);return _0xd94eb1[_0xf445('0x1d')](_0xf445('0x1e'),_0x59b175+'-'+_0x980695+'/'+_0x48b271)[_0xf445('0x1f')](_0x269ce7);}return null;};}function patchUpdates(_0x10fabc){return function(_0x161697){try{jsonpatch['apply'](_0x161697,_0x10fabc,!![]);}catch(_0x5d32ea){return BPromise[_0xf445('0x20')](_0x5d32ea);}return _0x161697[_0xf445('0x21')]();};}function saveUpdates(_0x44707e,_0x107025){return function(_0x19549a){if(_0x19549a){return _0x19549a[_0xf445('0x22')](_0x44707e)[_0xf445('0x23')](function(_0x2dbd31){return _0x2dbd31;});}return null;};}function removeEntity(_0x408463,_0x37645a){return function(_0x110b11){if(_0x110b11){return _0x110b11[_0xf445('0x24')]()[_0xf445('0x23')](function(){var _0x5a9808=_0x110b11[_0xf445('0x25')]({'plain':!![]});var _0x1af940=_0xf445('0x26');return db[_0xf445('0x27')][_0xf445('0x24')]({'where':{'type':_0x1af940,'resourceId':_0x5a9808['id']}})[_0xf445('0x23')](function(){return _0x110b11;});})[_0xf445('0x23')](function(){_0x408463[_0xf445('0x18')](0xcc)[_0xf445('0x28')]();});}};}function handleEntityNotFound(_0x1fd8e3,_0x10ea23){return function(_0x7e8ede){if(!_0x7e8ede){_0x1fd8e3['sendStatus'](0x194);}return _0x7e8ede;};}function handleError(_0x37d0ee,_0x119e24){_0x119e24=_0x119e24||0x1f4;return function(_0x3f58f3){logger[_0xf445('0x29')](_0x3f58f3[_0xf445('0x2a')]);if(_0x3f58f3[_0xf445('0x2b')]){delete _0x3f58f3[_0xf445('0x2b')];}_0x37d0ee['status'](_0x119e24)[_0xf445('0x2c')](_0x3f58f3);};}exports['index']=function(_0xe6acbe,_0x4794e0){var _0x2cdaae={},_0x479ab8={},_0x2058f9={'count':0x0,'rows':[]};var _0x2e1bc6=_[_0xf445('0x2d')](db['Trigger']['rawAttributes'],function(_0xaaaf4c){return{'name':_0xaaaf4c[_0xf445('0x2e')],'type':_0xaaaf4c[_0xf445('0x2f')][_0xf445('0x30')]};});_0x479ab8[_0xf445('0x31')]=_[_0xf445('0x2d')](_0x2e1bc6,'name');_0x479ab8[_0xf445('0x32')]=_['keys'](_0xe6acbe[_0xf445('0x32')]);_0x479ab8[_0xf445('0x33')]=_[_0xf445('0x34')](_0x479ab8[_0xf445('0x31')],_0x479ab8[_0xf445('0x32')]);_0x2cdaae['attributes']=_['intersection'](_0x479ab8[_0xf445('0x31')],qs[_0xf445('0x35')](_0xe6acbe[_0xf445('0x32')][_0xf445('0x35')]));_0x2cdaae[_0xf445('0x36')]=_0x2cdaae[_0xf445('0x36')][_0xf445('0x37')]?_0x2cdaae[_0xf445('0x36')]:_0x479ab8[_0xf445('0x31')];if(!_0xe6acbe[_0xf445('0x32')][_0xf445('0x38')](_0xf445('0x39'))){_0x2cdaae['limit']=qs['limit'](_0xe6acbe[_0xf445('0x32')][_0xf445('0x1a')]);_0x2cdaae['offset']=qs[_0xf445('0x19')](_0xe6acbe['query'][_0xf445('0x19')]);}_0x2cdaae[_0xf445('0x3a')]=qs['sort'](_0xe6acbe[_0xf445('0x32')]['sort']);_0x2cdaae[_0xf445('0x3b')]=qs['filters'](_[_0xf445('0x3c')](_0xe6acbe[_0xf445('0x32')],_0x479ab8[_0xf445('0x33')]),_0x2e1bc6);if(_0xe6acbe[_0xf445('0x32')][_0xf445('0x3d')]){_0x2cdaae[_0xf445('0x3b')]=_[_0xf445('0x3e')](_0x2cdaae[_0xf445('0x3b')],{'$or':_[_0xf445('0x2d')](_0x2e1bc6,function(_0x31cabc){if(_0x31cabc['type']!==_0xf445('0x3f')){var _0x670245={};_0x670245[_0x31cabc[_0xf445('0x2b')]]={'$like':'%'+_0xe6acbe[_0xf445('0x32')][_0xf445('0x3d')]+'%'};return _0x670245;}})});}_0x2cdaae=_[_0xf445('0x3e')]({},_0x2cdaae,_0xe6acbe[_0xf445('0x40')]);var _0x3a49ed={'where':_0x2cdaae[_0xf445('0x3b')]};return db['Trigger']['count'](_0x3a49ed)[_0xf445('0x23')](function(_0x36f844){_0x2058f9[_0xf445('0x1c')]=_0x36f844;if(_0xe6acbe['query'][_0xf445('0x41')]){_0x2cdaae[_0xf445('0x42')]=[{'all':!![]}];}return db[_0xf445('0x43')][_0xf445('0x44')](_0x2cdaae);})[_0xf445('0x23')](function(_0x5c17b5){_0x2058f9[_0xf445('0x45')]=_0x5c17b5;return _0x2058f9;})[_0xf445('0x23')](respondWithFilteredResult(_0x4794e0,_0x2cdaae))['catch'](handleError(_0x4794e0,null));};exports[_0xf445('0x46')]=function(_0x3868fa,_0x85b1f9){var _0x524ac3={'raw':![],'where':{'id':_0x3868fa[_0xf445('0x47')]['id']}},_0x2705af={};_0x2705af[_0xf445('0x31')]=_[_0xf445('0x48')](db[_0xf445('0x43')][_0xf445('0x49')]);_0x2705af[_0xf445('0x32')]=_[_0xf445('0x48')](_0x3868fa[_0xf445('0x32')]);_0x2705af[_0xf445('0x33')]=_[_0xf445('0x34')](_0x2705af[_0xf445('0x31')],_0x2705af[_0xf445('0x32')]);_0x524ac3[_0xf445('0x36')]=_[_0xf445('0x34')](_0x2705af[_0xf445('0x31')],qs[_0xf445('0x35')](_0x3868fa['query'][_0xf445('0x35')]));_0x524ac3[_0xf445('0x36')]=_0x524ac3['attributes'][_0xf445('0x37')]?_0x524ac3[_0xf445('0x36')]:_0x2705af['model'];if(_0x3868fa[_0xf445('0x32')][_0xf445('0x41')]){_0x524ac3[_0xf445('0x42')]=[{'all':!![]}];}_0x524ac3=_[_0xf445('0x3e')]({},_0x524ac3,_0x3868fa[_0xf445('0x40')]);return db['Trigger'][_0xf445('0x4a')](_0x524ac3)[_0xf445('0x23')](handleEntityNotFound(_0x85b1f9,null))[_0xf445('0x23')](respondWithResult(_0x85b1f9,null))[_0xf445('0x4b')](handleError(_0x85b1f9,null));};exports[_0xf445('0x4c')]=function(_0x1fecb4,_0x515cf1){return db[_0xf445('0x43')][_0xf445('0x4c')](_0x1fecb4[_0xf445('0x4d')],{})[_0xf445('0x23')](function(_0x33a31e){var _0x479e45=_0x1fecb4[_0xf445('0x4e')][_0xf445('0x25')]({'plain':!![]});if(!_0x479e45)throw new Error(_0xf445('0x4f'));if(_0x479e45[_0xf445('0x50')]===_0xf445('0x4e')){var _0x366c76=_0x33a31e[_0xf445('0x25')]({'plain':!![]});var _0x24ef8b=_0xf445('0x26');return db[_0xf445('0x51')][_0xf445('0x4a')]({'where':{'name':_0x24ef8b,'userProfileId':_0x479e45[_0xf445('0x52')]},'raw':!![]})[_0xf445('0x23')](function(_0x3c3c93){if(_0x3c3c93&&_0x3c3c93[_0xf445('0x53')]===0x0){return db[_0xf445('0x27')][_0xf445('0x4c')]({'name':_0x366c76['name'],'resourceId':_0x366c76['id'],'type':_0x3c3c93[_0xf445('0x2b')],'sectionId':_0x3c3c93['id']},{})[_0xf445('0x23')](function(){return _0x33a31e;});}else{return _0x33a31e;}})[_0xf445('0x4b')](function(_0x23b51f){logger[_0xf445('0x29')](_0xf445('0x54'),_0x23b51f);throw _0x23b51f;});}return _0x33a31e;})['then'](respondWithResult(_0x515cf1,0xc9))['catch'](handleError(_0x515cf1,null));};exports[_0xf445('0x22')]=function(_0x272158,_0x1fbfa8){if(_0x272158[_0xf445('0x4d')]['id']){delete _0x272158[_0xf445('0x4d')]['id'];}return db[_0xf445('0x43')]['find']({'where':{'id':_0x272158[_0xf445('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fbfa8,null))[_0xf445('0x23')](saveUpdates(_0x272158[_0xf445('0x4d')],null))[_0xf445('0x23')](respondWithResult(_0x1fbfa8,null))[_0xf445('0x4b')](handleError(_0x1fbfa8,null));};exports['destroy']=function(_0xcec091,_0x20e350){return db[_0xf445('0x43')]['find']({'where':{'id':_0xcec091[_0xf445('0x47')]['id']}})[_0xf445('0x23')](handleEntityNotFound(_0x20e350,null))[_0xf445('0x23')](removeEntity(_0x20e350,null))[_0xf445('0x4b')](handleError(_0x20e350,null));};exports['addAllCondition']=function(_0x2e5e12,_0x3d5f07,_0x38bca3){if(_0x2e5e12[_0xf445('0x4d')]['id']){delete _0x2e5e12[_0xf445('0x4d')]['id'];}return db[_0xf445('0x43')][_0xf445('0x4a')]({'where':{'id':_0x2e5e12[_0xf445('0x47')]['id']}})[_0xf445('0x23')](handleEntityNotFound(_0x3d5f07,null))[_0xf445('0x23')](function(_0x174964){if(_0x174964){_0x2e5e12[_0xf445('0x4d')][_0xf445('0x55')]=_0x174964['id'];return db['Condition'][_0xf445('0x4c')](_0x2e5e12['body']);}})[_0xf445('0x23')](respondWithResult(_0x3d5f07,null))[_0xf445('0x4b')](handleError(_0x3d5f07,null));};exports[_0xf445('0x56')]=function(_0x1c207d,_0x531541,_0x429ba8){if(_0x1c207d[_0xf445('0x4d')]['id']){delete _0x1c207d[_0xf445('0x4d')]['id'];}return db[_0xf445('0x43')][_0xf445('0x4a')]({'where':{'id':_0x1c207d[_0xf445('0x47')]['id']}})['then'](handleEntityNotFound(_0x531541,null))[_0xf445('0x23')](function(_0x9f429){if(_0x9f429){_0x1c207d[_0xf445('0x4d')]['TriggerAnyId']=_0x9f429['id'];return db[_0xf445('0x57')][_0xf445('0x4c')](_0x1c207d[_0xf445('0x4d')]);}})[_0xf445('0x23')](respondWithResult(_0x531541,null))[_0xf445('0x4b')](handleError(_0x531541,null));};exports[_0xf445('0x58')]=function(_0x406f55,_0x4b502b,_0x4cc8c8){var _0x9a0f3b={};var _0x49823e={};var _0x1be63b;var _0x3127d6;return db[_0xf445('0x43')]['findOne']({'where':{'id':_0x406f55[_0xf445('0x47')]['id']}})[_0xf445('0x23')](handleEntityNotFound(_0x4b502b,null))['then'](function(_0x12ca12){if(_0x12ca12){_0x1be63b=_0x12ca12;_0x49823e[_0xf445('0x31')]=_[_0xf445('0x48')](db[_0xf445('0x57')]['rawAttributes']);_0x49823e[_0xf445('0x32')]=_[_0xf445('0x48')](_0x406f55[_0xf445('0x32')]);_0x49823e[_0xf445('0x33')]=_[_0xf445('0x34')](_0x49823e[_0xf445('0x31')],_0x49823e[_0xf445('0x32')]);_0x9a0f3b[_0xf445('0x36')]=_[_0xf445('0x34')](_0x49823e[_0xf445('0x31')],qs['fields'](_0x406f55[_0xf445('0x32')][_0xf445('0x35')]));_0x9a0f3b[_0xf445('0x36')]=_0x9a0f3b[_0xf445('0x36')]['length']?_0x9a0f3b[_0xf445('0x36')]:_0x49823e['model'];_0x9a0f3b[_0xf445('0x3a')]=qs['sort'](_0x406f55['query'][_0xf445('0x59')]);_0x9a0f3b[_0xf445('0x3b')]=qs[_0xf445('0x33')](_[_0xf445('0x3c')](_0x406f55['query'],_0x49823e['filters']));if(_0x406f55['query']['filter']){_0x9a0f3b['where']=_[_0xf445('0x3e')](_0x9a0f3b[_0xf445('0x3b')],{'$or':_[_0xf445('0x2d')](_0x9a0f3b[_0xf445('0x36')],function(_0x39288a){var _0x5ee13d={};_0x5ee13d[_0x39288a]={'$like':'%'+_0x406f55[_0xf445('0x32')][_0xf445('0x3d')]+'%'};return _0x5ee13d;})});}_0x9a0f3b=_[_0xf445('0x3e')]({},_0x9a0f3b,_0x406f55[_0xf445('0x40')]);return _0x1be63b['getAllConditions'](_0x9a0f3b);}})['then'](function(_0x488342){if(_0x488342){_0x3127d6=_0x488342['length'];if(!_0x406f55[_0xf445('0x32')][_0xf445('0x38')](_0xf445('0x39'))){_0x9a0f3b[_0xf445('0x1a')]=qs[_0xf445('0x1a')](_0x406f55[_0xf445('0x32')]['limit']);_0x9a0f3b['offset']=qs['offset'](_0x406f55[_0xf445('0x32')][_0xf445('0x19')]);}return _0x1be63b[_0xf445('0x58')](_0x9a0f3b);}})['then'](function(_0xafba30){if(_0xafba30){return _0xafba30?{'count':_0x3127d6,'rows':_0xafba30}:null;}})[_0xf445('0x23')](respondWithResult(_0x4b502b,null))[_0xf445('0x4b')](handleError(_0x4b502b,null));};exports['getAnyConditions']=function(_0x3f75ad,_0x54af7f,_0x156ce4){var _0x1d38c={};var _0x21c733={};var _0x12f1da;var _0x2e1ea5;return db['Trigger']['findOne']({'where':{'id':_0x3f75ad['params']['id']}})['then'](handleEntityNotFound(_0x54af7f,null))[_0xf445('0x23')](function(_0x1319d5){if(_0x1319d5){_0x12f1da=_0x1319d5;_0x21c733[_0xf445('0x31')]=_[_0xf445('0x48')](db[_0xf445('0x57')][_0xf445('0x49')]);_0x21c733[_0xf445('0x32')]=_[_0xf445('0x48')](_0x3f75ad[_0xf445('0x32')]);_0x21c733[_0xf445('0x33')]=_[_0xf445('0x34')](_0x21c733[_0xf445('0x31')],_0x21c733[_0xf445('0x32')]);_0x1d38c['attributes']=_['intersection'](_0x21c733['model'],qs[_0xf445('0x35')](_0x3f75ad[_0xf445('0x32')]['fields']));_0x1d38c['attributes']=_0x1d38c[_0xf445('0x36')][_0xf445('0x37')]?_0x1d38c[_0xf445('0x36')]:_0x21c733[_0xf445('0x31')];_0x1d38c['order']=qs['sort'](_0x3f75ad[_0xf445('0x32')][_0xf445('0x59')]);_0x1d38c[_0xf445('0x3b')]=qs[_0xf445('0x33')](_[_0xf445('0x3c')](_0x3f75ad['query'],_0x21c733[_0xf445('0x33')]));if(_0x3f75ad['query'][_0xf445('0x3d')]){_0x1d38c[_0xf445('0x3b')]=_[_0xf445('0x3e')](_0x1d38c[_0xf445('0x3b')],{'$or':_[_0xf445('0x2d')](_0x1d38c[_0xf445('0x36')],function(_0x4946d8){var _0x3a31a8={};_0x3a31a8[_0x4946d8]={'$like':'%'+_0x3f75ad[_0xf445('0x32')][_0xf445('0x3d')]+'%'};return _0x3a31a8;})});}_0x1d38c=_[_0xf445('0x3e')]({},_0x1d38c,_0x3f75ad[_0xf445('0x40')]);return _0x12f1da[_0xf445('0x5a')](_0x1d38c);}})[_0xf445('0x23')](function(_0x4b258f){if(_0x4b258f){_0x2e1ea5=_0x4b258f[_0xf445('0x37')];if(!_0x3f75ad[_0xf445('0x32')][_0xf445('0x38')](_0xf445('0x39'))){_0x1d38c[_0xf445('0x1a')]=qs[_0xf445('0x1a')](_0x3f75ad[_0xf445('0x32')][_0xf445('0x1a')]);_0x1d38c[_0xf445('0x19')]=qs[_0xf445('0x19')](_0x3f75ad[_0xf445('0x32')][_0xf445('0x19')]);}return _0x12f1da[_0xf445('0x5a')](_0x1d38c);}})['then'](function(_0x93f440){if(_0x93f440){return _0x93f440?{'count':_0x2e1ea5,'rows':_0x93f440}:null;}})['then'](respondWithResult(_0x54af7f,null))['catch'](handleError(_0x54af7f,null));};exports[_0xf445('0x5b')]=function(_0x3d1c96,_0x2003bc,_0x1cf107){if(_0x3d1c96['body']['id']){delete _0x3d1c96[_0xf445('0x4d')]['id'];}return db['Trigger'][_0xf445('0x4a')]({'where':{'id':_0x3d1c96['params']['id']}})['then'](handleEntityNotFound(_0x2003bc,null))['then'](function(_0x240f22){if(_0x240f22){_0x3d1c96[_0xf445('0x4d')]['TriggerId']=_0x240f22['id'];return db[_0xf445('0x5c')][_0xf445('0x4c')](_0x3d1c96['body']);}})[_0xf445('0x23')](respondWithResult(_0x2003bc,null))[_0xf445('0x4b')](handleError(_0x2003bc,null));};exports[_0xf445('0x5d')]=function(_0x43e773,_0x4deac9,_0x638e8b){var _0x2693b5={};var _0x1549dc={};var _0x4bc128;var _0xc9d52e;return db['Trigger'][_0xf445('0x5e')]({'where':{'id':_0x43e773[_0xf445('0x47')]['id']}})[_0xf445('0x23')](handleEntityNotFound(_0x4deac9,null))[_0xf445('0x23')](function(_0x4f3e98){if(_0x4f3e98){_0x4bc128=_0x4f3e98;_0x1549dc[_0xf445('0x31')]=_[_0xf445('0x48')](db['Action'][_0xf445('0x49')]);_0x1549dc[_0xf445('0x32')]=_[_0xf445('0x48')](_0x43e773[_0xf445('0x32')]);_0x1549dc[_0xf445('0x33')]=_[_0xf445('0x34')](_0x1549dc[_0xf445('0x31')],_0x1549dc[_0xf445('0x32')]);_0x2693b5[_0xf445('0x36')]=_['intersection'](_0x1549dc[_0xf445('0x31')],qs[_0xf445('0x35')](_0x43e773[_0xf445('0x32')][_0xf445('0x35')]));_0x2693b5['attributes']=_0x2693b5[_0xf445('0x36')][_0xf445('0x37')]?_0x2693b5['attributes']:_0x1549dc[_0xf445('0x31')];_0x2693b5['order']=qs[_0xf445('0x59')](_0x43e773[_0xf445('0x32')][_0xf445('0x59')]);_0x2693b5[_0xf445('0x3b')]=qs[_0xf445('0x33')](_['pick'](_0x43e773[_0xf445('0x32')],_0x1549dc[_0xf445('0x33')]));if(_0x43e773[_0xf445('0x32')][_0xf445('0x3d')]){_0x2693b5[_0xf445('0x3b')]=_[_0xf445('0x3e')](_0x2693b5[_0xf445('0x3b')],{'$or':_['map'](_0x2693b5[_0xf445('0x36')],function(_0x5e2cad){var _0x2cae62={};_0x2cae62[_0x5e2cad]={'$like':'%'+_0x43e773[_0xf445('0x32')][_0xf445('0x3d')]+'%'};return _0x2cae62;})});}_0x2693b5=_[_0xf445('0x3e')]({},_0x2693b5,_0x43e773['options']);return _0x4bc128[_0xf445('0x5d')](_0x2693b5);}})[_0xf445('0x23')](function(_0x224c06){if(_0x224c06){_0xc9d52e=_0x224c06[_0xf445('0x37')];if(!_0x43e773[_0xf445('0x32')][_0xf445('0x38')](_0xf445('0x39'))){_0x2693b5['limit']=qs[_0xf445('0x1a')](_0x43e773['query']['limit']);_0x2693b5['offset']=qs[_0xf445('0x19')](_0x43e773[_0xf445('0x32')][_0xf445('0x19')]);}return _0x4bc128[_0xf445('0x5d')](_0x2693b5);}})[_0xf445('0x23')](function(_0x6c0c8a){if(_0x6c0c8a){return _0x6c0c8a?{'count':_0xc9d52e,'rows':_0x6c0c8a}:null;}})[_0xf445('0x23')](respondWithResult(_0x4deac9,null))[_0xf445('0x4b')](handleError(_0x4deac9,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a8bb9ce..a468644 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 _0x27c5=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','../../config/logger','api','moment'];(function(_0x26bcc5,_0xa69800){var _0x347a15=function(_0x33f038){while(--_0x33f038){_0x26bcc5['push'](_0x26bcc5['shift']());}};_0x347a15(++_0xa69800);}(_0x27c5,0x173));var _0x527c=function(_0x3f7e8b,_0x7291d1){_0x3f7e8b=_0x3f7e8b-0x0;var _0x4eb892=_0x27c5[_0x3f7e8b];return _0x4eb892;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x527c('0x0'))(_0x527c('0x1'));var moment=require(_0x527c('0x2'));var BPromise=require('bluebird');var rp=require(_0x527c('0x3'));var fs=require('fs');var path=require(_0x527c('0x4'));var rimraf=require(_0x527c('0x5'));var config=require(_0x527c('0x6'));var attributes=require(_0x527c('0x7'));module[_0x527c('0x8')]=function(_0x37bd95,_0x552d9b){return _0x37bd95[_0x527c('0x9')]('Trigger',attributes,{'tableName':_0x527c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c2b=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x0c2b,0x134));var _0xb0c2=function(_0x49977c,_0x3ab159){_0x49977c=_0x49977c-0x0;var _0x2b00e7=_0x0c2b[_0x49977c];return _0x2b00e7;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb0c2('0x2'));var BPromise=require('bluebird');var rp=require(_0xb0c2('0x3'));var fs=require('fs');var path=require(_0xb0c2('0x4'));var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module['exports']=function(_0x514b10,_0x1f0b7e){return _0x514b10[_0xb0c2('0x8')](_0xb0c2('0x9'),attributes,{'tableName':_0xb0c2('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 f1fd40e..5a5ef1b 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 _0xdf5d=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','GetTrigger','Trigger','findAll','options','raw','where','limit','map','include','model','attributes','ShowTrigger','catch','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdf5d,0x172));var _0xddf5=function(_0x2c926d,_0x1ade41){_0x2c926d=_0x2c926d-0x0;var _0x230ace=_0xdf5d[_0x2c926d];return _0x230ace;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var moment=require(_0xddf5('0x2'));var BPromise=require(_0xddf5('0x3'));var rs=require(_0xddf5('0x4'));var fs=require('fs');var Redis=require(_0xddf5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xddf5('0x6'))(_0xddf5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x400b91,_0x49ad0f,_0x515d73){return new BPromise(function(_0x11732c,_0x3a2529){return client[_0xddf5('0x8')](_0x400b91,_0x515d73)[_0xddf5('0x9')](function(_0xbfca6d){logger[_0xddf5('0xa')](_0xddf5('0xb'),_0x49ad0f,_0xddf5('0xc'));logger[_0xddf5('0xd')](_0xddf5('0xe'),_0x49ad0f,_0xddf5('0xc'),JSON[_0xddf5('0xf')](_0xbfca6d));if(_0xbfca6d[_0xddf5('0x10')]){if(_0xbfca6d[_0xddf5('0x10')]['code']===0x1f4){logger[_0xddf5('0x10')](_0xddf5('0xb'),_0x49ad0f,_0xbfca6d['error'][_0xddf5('0x11')]);return _0x3a2529(_0xbfca6d[_0xddf5('0x10')]['message']);}logger['error'](_0xddf5('0xb'),_0x49ad0f,_0xbfca6d[_0xddf5('0x10')]['message']);return _0x11732c(_0xbfca6d[_0xddf5('0x10')][_0xddf5('0x11')]);}else{logger[_0xddf5('0xa')](_0xddf5('0xb'),_0x49ad0f,'request\x20sent');_0x11732c(_0xbfca6d['result'][_0xddf5('0x11')]);}})['catch'](function(_0x4f3b7f){logger[_0xddf5('0x10')](_0xddf5('0xb'),_0x49ad0f,_0x4f3b7f);_0x3a2529(_0x4f3b7f);});});}exports[_0xddf5('0x12')]=function(_0x3b0b09){var _0x51d32a=this;return new Promise(function(_0x134fc0,_0x8decf9){return db[_0xddf5('0x13')][_0xddf5('0x14')]({'raw':_0x3b0b09['options']?_0x3b0b09[_0xddf5('0x15')][_0xddf5('0x16')]===undefined?!![]:![]:!![],'where':_0x3b0b09[_0xddf5('0x15')]?_0x3b0b09[_0xddf5('0x15')][_0xddf5('0x17')]||null:null,'attributes':_0x3b0b09[_0xddf5('0x15')]?_0x3b0b09['options']['attributes']||null:null,'limit':_0x3b0b09[_0xddf5('0x15')]?_0x3b0b09[_0xddf5('0x15')][_0xddf5('0x18')]||null:null,'include':_0x3b0b09[_0xddf5('0x15')]?_0x3b0b09[_0xddf5('0x15')]['include']?_[_0xddf5('0x19')](_0x3b0b09['options'][_0xddf5('0x1a')],function(_0x12ce17){return{'model':db[_0x12ce17[_0xddf5('0x1b')]],'as':_0x12ce17['as'],'attributes':_0x12ce17[_0xddf5('0x1c')],'include':_0x12ce17['include']?_[_0xddf5('0x19')](_0x12ce17[_0xddf5('0x1a')],function(_0x113ce4){return{'model':db[_0x113ce4[_0xddf5('0x1b')]],'as':_0x113ce4['as'],'attributes':_0x113ce4[_0xddf5('0x1c')],'include':_0x113ce4[_0xddf5('0x1a')]?_[_0xddf5('0x19')](_0x113ce4[_0xddf5('0x1a')],function(_0x5dca71){return{'model':db[_0x5dca71['model']],'as':_0x5dca71['as'],'attributes':_0x5dca71['attributes']};}):[]};}):[]};}):[]:[]})[_0xddf5('0x9')](function(_0x21164c){logger[_0xddf5('0xa')](_0xddf5('0x12'),_0x3b0b09);logger[_0xddf5('0xd')](_0xddf5('0x12'),_0x3b0b09,JSON[_0xddf5('0xf')](_0x21164c));_0x134fc0(_0x21164c);})['catch'](function(_0x293345){logger[_0xddf5('0x10')]('GetTrigger',_0x293345[_0xddf5('0x11')],_0x3b0b09);_0x8decf9(_0x51d32a['error'](0x1f4,_0x293345[_0xddf5('0x11')]));});});};exports[_0xddf5('0x1d')]=function(_0x3c4416){var _0x9d1be7=this;return new Promise(function(_0x4ed5dd,_0x23dc75){return db[_0xddf5('0x13')]['find']({'raw':_0x3c4416['options']?_0x3c4416[_0xddf5('0x15')][_0xddf5('0x16')]===undefined?!![]:![]:!![],'where':_0x3c4416[_0xddf5('0x15')]?_0x3c4416[_0xddf5('0x15')]['where']||null:null,'attributes':_0x3c4416[_0xddf5('0x15')]?_0x3c4416['options'][_0xddf5('0x1c')]||null:null,'include':_0x3c4416[_0xddf5('0x15')]?_0x3c4416[_0xddf5('0x15')][_0xddf5('0x1a')]?_['map'](_0x3c4416[_0xddf5('0x15')][_0xddf5('0x1a')],function(_0x3bc8ac){return{'model':db[_0x3bc8ac[_0xddf5('0x1b')]],'as':_0x3bc8ac['as'],'attributes':_0x3bc8ac['attributes'],'include':_0x3bc8ac[_0xddf5('0x1a')]?_[_0xddf5('0x19')](_0x3bc8ac[_0xddf5('0x1a')],function(_0xd4948d){return{'model':db[_0xd4948d[_0xddf5('0x1b')]],'as':_0xd4948d['as'],'attributes':_0xd4948d[_0xddf5('0x1c')],'include':_0xd4948d[_0xddf5('0x1a')]?_[_0xddf5('0x19')](_0xd4948d[_0xddf5('0x1a')],function(_0x2ac8a3){return{'model':db[_0x2ac8a3[_0xddf5('0x1b')]],'as':_0x2ac8a3['as'],'attributes':_0x2ac8a3[_0xddf5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xddf5('0x9')](function(_0x3be51f){logger[_0xddf5('0xa')]('ShowTrigger',_0x3c4416);logger['debug'](_0xddf5('0x1d'),_0x3c4416,JSON[_0xddf5('0xf')](_0x3be51f));_0x4ed5dd(_0x3be51f);})[_0xddf5('0x1e')](function(_0x1f405e){logger[_0xddf5('0x10')](_0xddf5('0x1d'),_0x1f405e[_0xddf5('0x11')],_0x3c4416);_0x23dc75(_0x9d1be7[_0xddf5('0x10')](0x1f4,_0x1f405e['message']));});});}; \ No newline at end of file +var _0xdd8a=['error','code','message','result','GetTrigger','Trigger','findAll','options','raw','where','limit','map','include','model','attributes','catch','ShowTrigger','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15c83a,_0x16033c){var _0x26ff76=function(_0x28b3c5){while(--_0x28b3c5){_0x15c83a['push'](_0x15c83a['shift']());}};_0x26ff76(++_0x16033c);}(_0xdd8a,0xc0));var _0xadd8=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xdd8a[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xadd8('0x0'));var util=require(_0xadd8('0x1'));var moment=require(_0xadd8('0x2'));var BPromise=require('bluebird');var rs=require(_0xadd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xadd8('0x4'));var logger=require('../../config/logger')(_0xadd8('0x5'));var config=require(_0xadd8('0x6'));var jayson=require(_0xadd8('0x7'));var client=jayson[_0xadd8('0x8')][_0xadd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18f601,_0x27d939,_0x1ed6de){return new BPromise(function(_0x8c255d,_0x581201){return client[_0xadd8('0xa')](_0x18f601,_0x1ed6de)[_0xadd8('0xb')](function(_0x1f454d){logger[_0xadd8('0xc')](_0xadd8('0xd'),_0x27d939,_0xadd8('0xe'));logger[_0xadd8('0xf')](_0xadd8('0x10'),_0x27d939,_0xadd8('0xe'),JSON[_0xadd8('0x11')](_0x1f454d));if(_0x1f454d[_0xadd8('0x12')]){if(_0x1f454d[_0xadd8('0x12')][_0xadd8('0x13')]===0x1f4){logger[_0xadd8('0x12')](_0xadd8('0xd'),_0x27d939,_0x1f454d[_0xadd8('0x12')]['message']);return _0x581201(_0x1f454d[_0xadd8('0x12')][_0xadd8('0x14')]);}logger[_0xadd8('0x12')]('Trigger,\x20%s,\x20%s',_0x27d939,_0x1f454d['error']['message']);return _0x8c255d(_0x1f454d['error']['message']);}else{logger['info'](_0xadd8('0xd'),_0x27d939,_0xadd8('0xe'));_0x8c255d(_0x1f454d[_0xadd8('0x15')][_0xadd8('0x14')]);}})['catch'](function(_0x5a9282){logger[_0xadd8('0x12')]('Trigger,\x20%s,\x20%s',_0x27d939,_0x5a9282);_0x581201(_0x5a9282);});});}exports[_0xadd8('0x16')]=function(_0xa6870e){var _0x9b76dc=this;return new Promise(function(_0x2250ac,_0x20ee45){return db[_0xadd8('0x17')][_0xadd8('0x18')]({'raw':_0xa6870e[_0xadd8('0x19')]?_0xa6870e[_0xadd8('0x19')][_0xadd8('0x1a')]===undefined?!![]:![]:!![],'where':_0xa6870e[_0xadd8('0x19')]?_0xa6870e[_0xadd8('0x19')][_0xadd8('0x1b')]||null:null,'attributes':_0xa6870e[_0xadd8('0x19')]?_0xa6870e[_0xadd8('0x19')]['attributes']||null:null,'limit':_0xa6870e[_0xadd8('0x19')]?_0xa6870e[_0xadd8('0x19')][_0xadd8('0x1c')]||null:null,'include':_0xa6870e[_0xadd8('0x19')]?_0xa6870e[_0xadd8('0x19')]['include']?_[_0xadd8('0x1d')](_0xa6870e[_0xadd8('0x19')][_0xadd8('0x1e')],function(_0x31952a){return{'model':db[_0x31952a[_0xadd8('0x1f')]],'as':_0x31952a['as'],'attributes':_0x31952a['attributes'],'include':_0x31952a[_0xadd8('0x1e')]?_[_0xadd8('0x1d')](_0x31952a[_0xadd8('0x1e')],function(_0x3c2b69){return{'model':db[_0x3c2b69[_0xadd8('0x1f')]],'as':_0x3c2b69['as'],'attributes':_0x3c2b69['attributes'],'include':_0x3c2b69[_0xadd8('0x1e')]?_['map'](_0x3c2b69[_0xadd8('0x1e')],function(_0x227f9d){return{'model':db[_0x227f9d[_0xadd8('0x1f')]],'as':_0x227f9d['as'],'attributes':_0x227f9d[_0xadd8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4da93b){logger['info'](_0xadd8('0x16'),_0xa6870e);logger[_0xadd8('0xf')](_0xadd8('0x16'),_0xa6870e,JSON[_0xadd8('0x11')](_0x4da93b));_0x2250ac(_0x4da93b);})[_0xadd8('0x21')](function(_0x55796a){logger[_0xadd8('0x12')]('GetTrigger',_0x55796a[_0xadd8('0x14')],_0xa6870e);_0x20ee45(_0x9b76dc[_0xadd8('0x12')](0x1f4,_0x55796a[_0xadd8('0x14')]));});});};exports[_0xadd8('0x22')]=function(_0x59d3c8){var _0x355478=this;return new Promise(function(_0x51bdaf,_0xb34eb4){return db[_0xadd8('0x17')]['find']({'raw':_0x59d3c8[_0xadd8('0x19')]?_0x59d3c8['options'][_0xadd8('0x1a')]===undefined?!![]:![]:!![],'where':_0x59d3c8[_0xadd8('0x19')]?_0x59d3c8['options'][_0xadd8('0x1b')]||null:null,'attributes':_0x59d3c8[_0xadd8('0x19')]?_0x59d3c8['options'][_0xadd8('0x20')]||null:null,'include':_0x59d3c8[_0xadd8('0x19')]?_0x59d3c8['options']['include']?_['map'](_0x59d3c8[_0xadd8('0x19')][_0xadd8('0x1e')],function(_0x19e8e3){return{'model':db[_0x19e8e3[_0xadd8('0x1f')]],'as':_0x19e8e3['as'],'attributes':_0x19e8e3[_0xadd8('0x20')],'include':_0x19e8e3[_0xadd8('0x1e')]?_[_0xadd8('0x1d')](_0x19e8e3[_0xadd8('0x1e')],function(_0x3c6d6a){return{'model':db[_0x3c6d6a[_0xadd8('0x1f')]],'as':_0x3c6d6a['as'],'attributes':_0x3c6d6a[_0xadd8('0x20')],'include':_0x3c6d6a[_0xadd8('0x1e')]?_[_0xadd8('0x1d')](_0x3c6d6a['include'],function(_0x2c57a4){return{'model':db[_0x2c57a4[_0xadd8('0x1f')]],'as':_0x2c57a4['as'],'attributes':_0x2c57a4[_0xadd8('0x20')]};}):[]};}):[]};}):[]:[]})[_0xadd8('0xb')](function(_0x5a2893){logger[_0xadd8('0xc')](_0xadd8('0x22'),_0x59d3c8);logger['debug']('ShowTrigger',_0x59d3c8,JSON[_0xadd8('0x11')](_0x5a2893));_0x51bdaf(_0x5a2893);})[_0xadd8('0x21')](function(_0x1c7e64){logger[_0xadd8('0x12')]('ShowTrigger',_0x1c7e64['message'],_0x59d3c8);_0xb34eb4(_0x355478['error'](0x1f4,_0x1c7e64['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ee714d4..05b68eb 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 _0x6c62=['post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id/clone','clone'];(function(_0x10ba49,_0x36b6d8){var _0xac19da=function(_0x242715){while(--_0x242715){_0x10ba49['push'](_0x10ba49['shift']());}};_0xac19da(++_0x36b6d8);}(_0x6c62,0x123));var _0x26c6=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x6c62[_0x4c260a];return _0x17bbdd;};'use strict';var multer=require(_0x26c6('0x0'));var util=require(_0x26c6('0x1'));var path=require('path');var timeout=require(_0x26c6('0x2'));var express=require(_0x26c6('0x3'));var router=express[_0x26c6('0x4')]();var fs_extra=require(_0x26c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x26c6('0x6'));var config=require(_0x26c6('0x7'));var controller=require(_0x26c6('0x8'));router[_0x26c6('0x9')]('/',auth[_0x26c6('0xa')](),controller['index']);router[_0x26c6('0x9')]('/:id',auth[_0x26c6('0xa')](),controller['show']);router['post'](_0x26c6('0xb'),auth[_0x26c6('0xa')](),controller[_0x26c6('0xc')]);router[_0x26c6('0xd')]('/',auth[_0x26c6('0xa')](),controller['create']);router[_0x26c6('0xe')](_0x26c6('0xf'),auth['isAuthenticated'](),controller[_0x26c6('0x10')]);router[_0x26c6('0x11')](_0x26c6('0xf'),auth['isAuthenticated'](),controller[_0x26c6('0x12')]);module['exports']=router; \ No newline at end of file +var _0xbdc3=['../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x57c507,_0x3e2466){var _0x34ad09=function(_0x37da3a){while(--_0x37da3a){_0x57c507['push'](_0x57c507['shift']());}};_0x34ad09(++_0x3e2466);}(_0xbdc3,0x164));var _0x3bdc=function(_0x18f506,_0x1491d7){_0x18f506=_0x18f506-0x0;var _0x997108=_0xbdc3[_0x18f506];return _0x997108;};'use strict';var multer=require(_0x3bdc('0x0'));var util=require(_0x3bdc('0x1'));var path=require(_0x3bdc('0x2'));var timeout=require(_0x3bdc('0x3'));var express=require(_0x3bdc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3bdc('0x5'));var interaction=require(_0x3bdc('0x6'));var config=require('../../config/environment');var controller=require(_0x3bdc('0x7'));router[_0x3bdc('0x8')]('/',auth[_0x3bdc('0x9')](),controller[_0x3bdc('0xa')]);router[_0x3bdc('0x8')]('/:id',auth[_0x3bdc('0x9')](),controller['show']);router['post'](_0x3bdc('0xb'),auth[_0x3bdc('0x9')](),controller[_0x3bdc('0xc')]);router['post']('/',auth[_0x3bdc('0x9')](),controller['create']);router[_0x3bdc('0xd')](_0x3bdc('0xe'),auth['isAuthenticated'](),controller[_0x3bdc('0xf')]);router[_0x3bdc('0x10')](_0x3bdc('0xe'),auth[_0x3bdc('0x9')](),controller[_0x3bdc('0x11')]);module[_0x3bdc('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 01b3196..50726d6 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 _0x3b73=['transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','join','nat','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','INTEGER','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x3b73,0x197));var _0x33b7=function(_0x5e1158,_0x5d520c){_0x5e1158=_0x5e1158-0x0;var _0x437f1b=_0x3b73[_0x5e1158];return _0x437f1b;};'use strict';var Sequelize=require(_0x33b7('0x0'));module[_0x33b7('0x1')]={'name':{'type':Sequelize[_0x33b7('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x4'),_0x33b7('0x5'),_0x33b7('0x6')),'allowNull':![],'defaultValue':_0x33b7('0x4')},'context':{'type':Sequelize[_0x33b7('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x7'),_0x33b7('0x8'),_0x33b7('0x9'),_0x33b7('0xa'),_0x33b7('0xb'),_0x33b7('0xc'),_0x33b7('0xd'),_0x33b7('0xe'))},'deny':{'type':Sequelize[_0x33b7('0x2')]},'permit':{'type':Sequelize[_0x33b7('0x2')]},'secret':{'type':Sequelize[_0x33b7('0x2')]},'md5secret':{'type':Sequelize[_0x33b7('0x2')]},'remotesecret':{'type':Sequelize[_0x33b7('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x33b7('0xf'),'set':function(_0x3b786e){this['setDataValue'](_0x33b7('0x10'),_0x3b786e?_0x3b786e['join'](','):null);},'get':function(){return this[_0x33b7('0x11')](_0x33b7('0x10'))?this[_0x33b7('0x11')]('transport')[_0x33b7('0x12')](','):null;},'comment':_0x33b7('0x13')},'dtmfmode':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x14'),'info','shortinfo',_0x33b7('0x15'),_0x33b7('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no',_0x33b7('0x18'),_0x33b7('0x19'),_0x33b7('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x33b7('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x33b7('0x2')]},'directmediadeny':{'type':Sequelize[_0x33b7('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x33b7('0x1b'),'set':function(_0x23bd23){this[_0x33b7('0x1c')]('nat',_0x23bd23?_0x23bd23[_0x33b7('0x1d')](','):null);},'get':function(){return this[_0x33b7('0x11')](_0x33b7('0x1e'))?this[_0x33b7('0x11')](_0x33b7('0x1e'))[_0x33b7('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x33b7('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x33b7('0x2')]},'language':{'type':Sequelize[_0x33b7('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x33b7('0x2')],'allowNull':![],'defaultValue':_0x33b7('0x1f'),'set':function(_0x2ad549){this[_0x33b7('0x1c')](_0x33b7('0x20'),_0x2ad549?_0x2ad549[_0x33b7('0x1d')](';'):_0x33b7('0x1f'));},'get':function(){return this[_0x33b7('0x11')](_0x33b7('0x20'))?this['getDataValue'](_0x33b7('0x20'))[_0x33b7('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'insecure':{'type':Sequelize[_0x33b7('0x2')],'defaultValue':'port,invite','set':function(_0x4538bf){this['setDataValue'](_0x33b7('0x21'),_0x4538bf?_0x4538bf[_0x33b7('0x1d')](','):null);},'get':function(){return this[_0x33b7('0x11')]('insecure')?this[_0x33b7('0x11')](_0x33b7('0x21'))['split'](','):null;},'comment':_0x33b7('0x22')},'trustrpid':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x33b7('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x33b7('0x3')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x33b7('0x2')]},'callcounter':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no'),'defaultValue':_0x33b7('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x33b7('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x33b7('0x2')]},'template':{'type':Sequelize[_0x33b7('0x2')]},'videosupport':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no',_0x33b7('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x33b7('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x33b7('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x33b7('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x33b7('0x25'),_0x33b7('0x26'))},'session_expires':{'type':Sequelize[_0x33b7('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x33b7('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x27'),_0x33b7('0x28')),'defaultValue':_0x33b7('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x33b7('0x2')]},'regexten':{'type':Sequelize[_0x33b7('0x2')]},'fromdomain':{'type':Sequelize[_0x33b7('0x2')]},'fromuser':{'type':Sequelize[_0x33b7('0x2')]},'port':{'type':Sequelize[_0x33b7('0x24')](0x5)},'qualify':{'type':Sequelize[_0x33b7('0x3')]('yes','no'),'defaultValue':_0x33b7('0x17')},'keepalive':{'type':Sequelize[_0x33b7('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x33b7('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x33b7('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x33b7('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x33b7('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x33b7('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x33b7('0x2')]},'callbackextension':{'type':Sequelize[_0x33b7('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x33b7('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x33b7('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x33b7('0x2')]},'contactacl':{'type':Sequelize[_0x33b7('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x33b7('0x2')]},'use_q850_reason':{'type':Sequelize[_0x33b7('0x2')]},'maxforwards':{'type':Sequelize[_0x33b7('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x33b7('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'force_avp':{'type':Sequelize[_0x33b7('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x33b7('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no',_0x33b7('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x33b7('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x33b7('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x33b7('0x2')]},'dtlscipher':{'type':Sequelize[_0x33b7('0x2')]},'dtlscafile':{'type':Sequelize[_0x33b7('0x2')]},'dtlscapath':{'type':Sequelize[_0x33b7('0x2')]},'dtlssetup':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x2b'),_0x33b7('0x2c'),_0x33b7('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x33b7('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x33b7('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x33b7('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x33b7('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x33b7('0x3')](_0x33b7('0x17'),'no')},'vmexten':{'type':Sequelize[_0x33b7('0x2')]},'mohinterpret':{'type':Sequelize[_0x33b7('0x2')]},'mohsuggest':{'type':Sequelize[_0x33b7('0x2')]},'parkinglot':{'type':Sequelize[_0x33b7('0x2')]},'description':{'type':Sequelize[_0x33b7('0x2')]},'host':{'type':Sequelize[_0x33b7('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x33b7('0x17'),'no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x33b7('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x33b7('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x33b7('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x9903=['update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','update','force_rport,comedia','nat','getDataValue','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','dynamic','nonat'];(function(_0x358120,_0x24d93a){var _0x54ae62=function(_0x43c550){while(--_0x43c550){_0x358120['push'](_0x358120['shift']());}};_0x54ae62(++_0x24d93a);}(_0x9903,0xf2));var _0x3990=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9903[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3990('0x0'));module['exports']={'name':{'type':Sequelize[_0x3990('0x1')],'allowNull':![],'unique':_0x3990('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x4'),'user','peer'),'allowNull':![],'defaultValue':_0x3990('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3990('0x5')},'callingpres':{'type':Sequelize[_0x3990('0x3')]('ALLOWED_NOT_SCREENED',_0x3990('0x6'),_0x3990('0x7'),'ALLOWED',_0x3990('0x8'),_0x3990('0x9'),_0x3990('0xa'),_0x3990('0xb'))},'deny':{'type':Sequelize[_0x3990('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x3990('0x1')]},'md5secret':{'type':Sequelize[_0x3990('0x1')]},'remotesecret':{'type':Sequelize[_0x3990('0x1')]},'transport':{'type':Sequelize[_0x3990('0x1')],'defaultValue':'udp','set':function(_0x48a3d7){this[_0x3990('0xc')]('transport',_0x48a3d7?_0x48a3d7[_0x3990('0xd')](','):null);},'get':function(){return this['getDataValue'](_0x3990('0xe'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0x3990('0xf')},'dtmfmode':{'type':Sequelize['ENUM'](_0x3990('0x10'),_0x3990('0x11'),'shortinfo',_0x3990('0x12'),_0x3990('0x13')),'defaultValue':_0x3990('0x10')},'directmedia':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no','nonat',_0x3990('0x15'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3990('0x1')]},'directmediadeny':{'type':Sequelize[_0x3990('0x1')]},'nat':{'type':Sequelize[_0x3990('0x1')],'defaultValue':_0x3990('0x16'),'set':function(_0x2ac9b7){this[_0x3990('0xc')](_0x3990('0x17'),_0x2ac9b7?_0x2ac9b7[_0x3990('0xd')](','):null);},'get':function(){return this[_0x3990('0x18')]('nat')?this['getDataValue'](_0x3990('0x17'))[_0x3990('0x19')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x3990('0x1')]},'pickupgroup':{'type':Sequelize[_0x3990('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3990('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3990('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3990('0x1')],'defaultValue':_0x3990('0x1a')},'allow':{'type':Sequelize[_0x3990('0x1')],'allowNull':![],'defaultValue':_0x3990('0x1b'),'set':function(_0x251b02){this['setDataValue'](_0x3990('0x1c'),_0x251b02?_0x251b02[_0x3990('0xd')](';'):_0x3990('0x1b'));},'get':function(){return this['getDataValue'](_0x3990('0x1c'))?this[_0x3990('0x18')](_0x3990('0x1c'))['split'](';'):null;},'comment':_0x3990('0x1d')},'autoframing':{'type':Sequelize['ENUM'](_0x3990('0x14'),'no')},'insecure':{'type':Sequelize[_0x3990('0x1')],'defaultValue':'port,invite','set':function(_0x4ee3fb){this[_0x3990('0xc')](_0x3990('0x1e'),_0x4ee3fb?_0x4ee3fb['join'](','):null);},'get':function(){return this[_0x3990('0x18')](_0x3990('0x1e'))?this[_0x3990('0x18')]('insecure')['split'](','):null;},'comment':_0x3990('0x1f')},'trustrpid':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3990('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no',_0x3990('0x20'))},'promiscredir':{'type':Sequelize['ENUM'](_0x3990('0x14'),'no')},'useclientcode':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no')},'accountcode':{'type':Sequelize[_0x3990('0x21')](0xb)},'setvar':{'type':Sequelize[_0x3990('0x1')]},'callerid':{'type':Sequelize[_0x3990('0x1')],'defaultValue':_0x3990('0x22')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x3990('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0x3990('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x3990('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x3990('0x1')]},'template':{'type':Sequelize[_0x3990('0x1')]},'videosupport':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x3990('0x14'),'no')},'mailbox':{'type':Sequelize[_0x3990('0x1')]},'session_timers':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x23'),_0x3990('0x24'),_0x3990('0x25'))},'session_expires':{'type':Sequelize[_0x3990('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x3990('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x3990('0x3')]('uac',_0x3990('0x26')),'defaultValue':_0x3990('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0x3990('0x1')]},'regexten':{'type':Sequelize[_0x3990('0x1')]},'fromdomain':{'type':Sequelize[_0x3990('0x1')]},'fromuser':{'type':Sequelize[_0x3990('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no'),'defaultValue':_0x3990('0x14')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x3990('0x1')]},'defaultuser':{'type':Sequelize[_0x3990('0x1')]},'rtptimeout':{'type':Sequelize[_0x3990('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3990('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3990('0x21')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x3990('0x14'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3990('0x1')]},'callbackextension':{'type':Sequelize[_0x3990('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x3990('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3990('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x3990('0x1')]},'contactdeny':{'type':Sequelize[_0x3990('0x1')]},'contactacl':{'type':Sequelize[_0x3990('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x3990('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no')},'force_avp':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x3990('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x3990('0x27'),_0x3990('0x28'))},'dtlsrekey':{'type':Sequelize[_0x3990('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3990('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x3990('0x1')]},'dtlscipher':{'type':Sequelize[_0x3990('0x1')]},'dtlscafile':{'type':Sequelize[_0x3990('0x1')]},'dtlscapath':{'type':Sequelize[_0x3990('0x1')]},'dtlssetup':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x29'),_0x3990('0x2a'),_0x3990('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3990('0x1')]},'usereqphone':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3990('0x1')]},'recordofffeature':{'type':Sequelize[_0x3990('0x1')]},'call_limit':{'type':Sequelize[_0x3990('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x3990('0x1')]},'mohinterpret':{'type':Sequelize[_0x3990('0x1')]},'mohsuggest':{'type':Sequelize[_0x3990('0x1')]},'parkinglot':{'type':Sequelize[_0x3990('0x1')]},'description':{'type':Sequelize[_0x3990('0x1')]},'host':{'type':Sequelize[_0x3990('0x1')],'defaultValue':_0x3990('0x2c')},'canreinvite':{'type':Sequelize[_0x3990('0x3')](_0x3990('0x14'),'no',_0x3990('0x2d'),_0x3990('0x15'),_0x3990('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x3990('0x1')]},'active':{'type':Sequelize[_0x3990('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3990('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 9e6bf31..703d78d 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 _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x281f95,_0x35e11b){var _0x313b9c=function(_0x92a1b3){while(--_0x92a1b3){_0x281f95['push'](_0x281f95['shift']());}};_0x313b9c(++_0x35e11b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file +var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5e6a4b,_0x13b66b){_0x5e6a4b=_0x5e6a4b-0x0;var _0x39ce57=_0xe5b3[_0x5e6a4b];return _0x39ce57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index e800cc5..97a6f54 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 _0x643e=['request-promise','path','rimraf','../../config/environment','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x643e,0x1ce));var _0xe643=function(_0x27a2a9,_0x1f4022){_0x27a2a9=_0x27a2a9-0x0;var _0x43617f=_0x643e[_0x27a2a9];return _0x43617f;};'use strict';var _=require(_0xe643('0x0'));var util=require(_0xe643('0x1'));var logger=require(_0xe643('0x2'))(_0xe643('0x3'));var moment=require(_0xe643('0x4'));var BPromise=require(_0xe643('0x5'));var rp=require(_0xe643('0x6'));var fs=require('fs');var path=require(_0xe643('0x7'));var rimraf=require(_0xe643('0x8'));var config=require(_0xe643('0x9'));var attributes=require('./trunk.attributes');module['exports']=function(_0x121ab6,_0x3ba54a){return _0x121ab6[_0xe643('0xa')](_0xe643('0xb'),attributes,{'tableName':_0xe643('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa85f=['api','moment','bluebird','path','rimraf','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger'];(function(_0x558e45,_0x4f5e4f){var _0x3e9075=function(_0x289725){while(--_0x289725){_0x558e45['push'](_0x558e45['shift']());}};_0x3e9075(++_0x4f5e4f);}(_0xa85f,0x135));var _0xfa85=function(_0xdca9c4,_0x56bba){_0xdca9c4=_0xdca9c4-0x0;var _0xa64296=_0xa85f[_0xdca9c4];return _0xa64296;};'use strict';var _=require(_0xfa85('0x0'));var util=require(_0xfa85('0x1'));var logger=require(_0xfa85('0x2'))(_0xfa85('0x3'));var moment=require(_0xfa85('0x4'));var BPromise=require(_0xfa85('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa85('0x6'));var rimraf=require(_0xfa85('0x7'));var config=require('../../config/environment');var attributes=require(_0xfa85('0x8'));module[_0xfa85('0x9')]=function(_0x44fda2,_0x172feb){return _0x44fda2[_0xfa85('0xa')]('Trunk',attributes,{'tableName':_0xfa85('0xb'),'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 fbb726a..f9c542c 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 _0x4e6a=['code','message','error','result','catch','GetTrunk','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowTrunk','Trunk','find','where','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e6a,0x1e8));var _0xa4e6=function(_0x9f4942,_0x5189b0){_0x9f4942=_0x9f4942-0x0;var _0xa72a7b=_0x4e6a[_0x9f4942];return _0xa72a7b;};'use strict';var _=require(_0xa4e6('0x0'));var util=require(_0xa4e6('0x1'));var moment=require(_0xa4e6('0x2'));var BPromise=require(_0xa4e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4e6('0x4'));var db=require(_0xa4e6('0x5'))['db'];var utils=require(_0xa4e6('0x6'));var logger=require(_0xa4e6('0x7'))(_0xa4e6('0x8'));var config=require(_0xa4e6('0x9'));var jayson=require(_0xa4e6('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x213a86,_0x650618,_0x4d90eb){return new BPromise(function(_0x549da6,_0x5f5408){return client['request'](_0x213a86,_0x4d90eb)[_0xa4e6('0xb')](function(_0x136e98){logger[_0xa4e6('0xc')](_0xa4e6('0xd'),_0x650618,_0xa4e6('0xe'));logger['debug'](_0xa4e6('0xf'),_0x650618,_0xa4e6('0xe'),JSON['stringify'](_0x136e98));if(_0x136e98['error']){if(_0x136e98['error'][_0xa4e6('0x10')]===0x1f4){logger['error'](_0xa4e6('0xd'),_0x650618,_0x136e98['error'][_0xa4e6('0x11')]);return _0x5f5408(_0x136e98[_0xa4e6('0x12')]['message']);}logger[_0xa4e6('0x12')](_0xa4e6('0xd'),_0x650618,_0x136e98['error']['message']);return _0x549da6(_0x136e98[_0xa4e6('0x12')][_0xa4e6('0x11')]);}else{logger['info'](_0xa4e6('0xd'),_0x650618,_0xa4e6('0xe'));_0x549da6(_0x136e98[_0xa4e6('0x13')][_0xa4e6('0x11')]);}})[_0xa4e6('0x14')](function(_0x11de9f){logger[_0xa4e6('0x12')](_0xa4e6('0xd'),_0x650618,_0x11de9f);_0x5f5408(_0x11de9f);});});}exports[_0xa4e6('0x15')]=function(_0x49aabd){var _0x128db9=this;return new Promise(function(_0x68cc46,_0x50ae58){return db['Trunk'][_0xa4e6('0x16')]({'raw':_0x49aabd[_0xa4e6('0x17')]?_0x49aabd[_0xa4e6('0x17')][_0xa4e6('0x18')]===undefined?!![]:![]:!![],'where':_0x49aabd[_0xa4e6('0x17')]?_0x49aabd['options']['where']||null:null,'attributes':_0x49aabd[_0xa4e6('0x17')]?_0x49aabd['options'][_0xa4e6('0x19')]||null:null,'limit':_0x49aabd[_0xa4e6('0x17')]?_0x49aabd[_0xa4e6('0x17')][_0xa4e6('0x1a')]||null:null,'include':_0x49aabd[_0xa4e6('0x17')]?_0x49aabd[_0xa4e6('0x17')][_0xa4e6('0x1b')]?_[_0xa4e6('0x1c')](_0x49aabd['options']['include'],function(_0x3d5ac9){return{'model':db[_0x3d5ac9[_0xa4e6('0x1d')]],'as':_0x3d5ac9['as'],'attributes':_0x3d5ac9[_0xa4e6('0x19')],'include':_0x3d5ac9['include']?_[_0xa4e6('0x1c')](_0x3d5ac9[_0xa4e6('0x1b')],function(_0x387cd9){return{'model':db[_0x387cd9[_0xa4e6('0x1d')]],'as':_0x387cd9['as'],'attributes':_0x387cd9['attributes'],'include':_0x387cd9['include']?_[_0xa4e6('0x1c')](_0x387cd9[_0xa4e6('0x1b')],function(_0x4873e8){return{'model':db[_0x4873e8['model']],'as':_0x4873e8['as'],'attributes':_0x4873e8[_0xa4e6('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa4e6('0xb')](function(_0xfe34a){logger['info'](_0xa4e6('0x15'),_0x49aabd);logger['debug']('GetTrunk',_0x49aabd,JSON[_0xa4e6('0x1e')](_0xfe34a));_0x68cc46(_0xfe34a);})['catch'](function(_0x50fe6c){logger[_0xa4e6('0x12')](_0xa4e6('0x15'),_0x50fe6c[_0xa4e6('0x11')],_0x49aabd);_0x50ae58(_0x128db9[_0xa4e6('0x12')](0x1f4,_0x50fe6c['message']));});});};exports[_0xa4e6('0x1f')]=function(_0x23d502){var _0x2103f7=this;return new Promise(function(_0x695736,_0x377226){return db[_0xa4e6('0x20')][_0xa4e6('0x21')]({'raw':_0x23d502[_0xa4e6('0x17')]?_0x23d502[_0xa4e6('0x17')][_0xa4e6('0x18')]===undefined?!![]:![]:!![],'where':_0x23d502[_0xa4e6('0x17')]?_0x23d502[_0xa4e6('0x17')][_0xa4e6('0x22')]||null:null,'attributes':_0x23d502['options']?_0x23d502[_0xa4e6('0x17')][_0xa4e6('0x19')]||null:null,'include':_0x23d502['options']?_0x23d502[_0xa4e6('0x17')]['include']?_[_0xa4e6('0x1c')](_0x23d502[_0xa4e6('0x17')][_0xa4e6('0x1b')],function(_0x5c4414){return{'model':db[_0x5c4414[_0xa4e6('0x1d')]],'as':_0x5c4414['as'],'attributes':_0x5c4414['attributes'],'include':_0x5c4414[_0xa4e6('0x1b')]?_[_0xa4e6('0x1c')](_0x5c4414[_0xa4e6('0x1b')],function(_0x5205a4){return{'model':db[_0x5205a4[_0xa4e6('0x1d')]],'as':_0x5205a4['as'],'attributes':_0x5205a4[_0xa4e6('0x19')],'include':_0x5205a4['include']?_['map'](_0x5205a4[_0xa4e6('0x1b')],function(_0x1907a8){return{'model':db[_0x1907a8[_0xa4e6('0x1d')]],'as':_0x1907a8['as'],'attributes':_0x1907a8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4e6('0xb')](function(_0x3946cf){logger[_0xa4e6('0xc')](_0xa4e6('0x1f'),_0x23d502);logger[_0xa4e6('0x23')](_0xa4e6('0x1f'),_0x23d502,JSON['stringify'](_0x3946cf));_0x695736(_0x3946cf);})[_0xa4e6('0x14')](function(_0x445f22){logger[_0xa4e6('0x12')](_0xa4e6('0x1f'),_0x445f22[_0xa4e6('0x11')],_0x23d502);_0x377226(_0x2103f7[_0xa4e6('0x12')](0x1f4,_0x445f22[_0xa4e6('0x11')]));});});}; \ No newline at end of file +var _0xd8ce=['message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','include','map','model','debug','ShowTrunk','find','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5ecc54,_0x447af5){var _0x16d1e8=function(_0x2c782f){while(--_0x2c782f){_0x5ecc54['push'](_0x5ecc54['shift']());}};_0x16d1e8(++_0x447af5);}(_0xd8ce,0x186));var _0xed8c=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xd8ce[_0x609988];return _0x159984;};'use strict';var _=require('lodash');var util=require(_0xed8c('0x0'));var moment=require(_0xed8c('0x1'));var BPromise=require(_0xed8c('0x2'));var rs=require(_0xed8c('0x3'));var fs=require('fs');var Redis=require(_0xed8c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed8c('0x5'));var logger=require(_0xed8c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xed8c('0x7'));var client=jayson['client'][_0xed8c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4179fe,_0x15cb63,_0x26546a){return new BPromise(function(_0x1e3c2e,_0x355957){return client[_0xed8c('0x9')](_0x4179fe,_0x26546a)[_0xed8c('0xa')](function(_0x43cca6){logger[_0xed8c('0xb')](_0xed8c('0xc'),_0x15cb63,'request\x20sent');logger['debug'](_0xed8c('0xd'),_0x15cb63,_0xed8c('0xe'),JSON[_0xed8c('0xf')](_0x43cca6));if(_0x43cca6[_0xed8c('0x10')]){if(_0x43cca6[_0xed8c('0x10')][_0xed8c('0x11')]===0x1f4){logger[_0xed8c('0x10')](_0xed8c('0xc'),_0x15cb63,_0x43cca6[_0xed8c('0x10')][_0xed8c('0x12')]);return _0x355957(_0x43cca6[_0xed8c('0x10')][_0xed8c('0x12')]);}logger['error'](_0xed8c('0xc'),_0x15cb63,_0x43cca6[_0xed8c('0x10')][_0xed8c('0x12')]);return _0x1e3c2e(_0x43cca6[_0xed8c('0x10')][_0xed8c('0x12')]);}else{logger[_0xed8c('0xb')]('Trunk,\x20%s,\x20%s',_0x15cb63,'request\x20sent');_0x1e3c2e(_0x43cca6[_0xed8c('0x13')][_0xed8c('0x12')]);}})[_0xed8c('0x14')](function(_0xc51f9c){logger[_0xed8c('0x10')]('Trunk,\x20%s,\x20%s',_0x15cb63,_0xc51f9c);_0x355957(_0xc51f9c);});});}exports[_0xed8c('0x15')]=function(_0x2303db){var _0x2955cf=this;return new Promise(function(_0x3863f3,_0x543ff2){return db[_0xed8c('0x16')][_0xed8c('0x17')]({'raw':_0x2303db[_0xed8c('0x18')]?_0x2303db[_0xed8c('0x18')][_0xed8c('0x19')]===undefined?!![]:![]:!![],'where':_0x2303db[_0xed8c('0x18')]?_0x2303db[_0xed8c('0x18')]['where']||null:null,'attributes':_0x2303db[_0xed8c('0x18')]?_0x2303db[_0xed8c('0x18')][_0xed8c('0x1a')]||null:null,'limit':_0x2303db[_0xed8c('0x18')]?_0x2303db[_0xed8c('0x18')]['limit']||null:null,'include':_0x2303db['options']?_0x2303db['options'][_0xed8c('0x1b')]?_[_0xed8c('0x1c')](_0x2303db[_0xed8c('0x18')][_0xed8c('0x1b')],function(_0xd384ea){return{'model':db[_0xd384ea[_0xed8c('0x1d')]],'as':_0xd384ea['as'],'attributes':_0xd384ea[_0xed8c('0x1a')],'include':_0xd384ea['include']?_['map'](_0xd384ea['include'],function(_0xabdf7f){return{'model':db[_0xabdf7f[_0xed8c('0x1d')]],'as':_0xabdf7f['as'],'attributes':_0xabdf7f[_0xed8c('0x1a')],'include':_0xabdf7f[_0xed8c('0x1b')]?_[_0xed8c('0x1c')](_0xabdf7f[_0xed8c('0x1b')],function(_0x3d83ed){return{'model':db[_0x3d83ed[_0xed8c('0x1d')]],'as':_0x3d83ed['as'],'attributes':_0x3d83ed[_0xed8c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xed8c('0xa')](function(_0x412203){logger[_0xed8c('0xb')](_0xed8c('0x15'),_0x2303db);logger[_0xed8c('0x1e')](_0xed8c('0x15'),_0x2303db,JSON['stringify'](_0x412203));_0x3863f3(_0x412203);})[_0xed8c('0x14')](function(_0x16b7b9){logger[_0xed8c('0x10')]('GetTrunk',_0x16b7b9[_0xed8c('0x12')],_0x2303db);_0x543ff2(_0x2955cf[_0xed8c('0x10')](0x1f4,_0x16b7b9[_0xed8c('0x12')]));});});};exports[_0xed8c('0x1f')]=function(_0x267f46){var _0x5203a7=this;return new Promise(function(_0x3a2168,_0xab0636){return db[_0xed8c('0x16')][_0xed8c('0x20')]({'raw':_0x267f46[_0xed8c('0x18')]?_0x267f46['options']['raw']===undefined?!![]:![]:!![],'where':_0x267f46[_0xed8c('0x18')]?_0x267f46[_0xed8c('0x18')][_0xed8c('0x21')]||null:null,'attributes':_0x267f46[_0xed8c('0x18')]?_0x267f46['options'][_0xed8c('0x1a')]||null:null,'include':_0x267f46[_0xed8c('0x18')]?_0x267f46['options']['include']?_['map'](_0x267f46[_0xed8c('0x18')][_0xed8c('0x1b')],function(_0x384835){return{'model':db[_0x384835[_0xed8c('0x1d')]],'as':_0x384835['as'],'attributes':_0x384835[_0xed8c('0x1a')],'include':_0x384835[_0xed8c('0x1b')]?_['map'](_0x384835[_0xed8c('0x1b')],function(_0x16dd64){return{'model':db[_0x16dd64[_0xed8c('0x1d')]],'as':_0x16dd64['as'],'attributes':_0x16dd64['attributes'],'include':_0x16dd64[_0xed8c('0x1b')]?_['map'](_0x16dd64[_0xed8c('0x1b')],function(_0x21e4bc){return{'model':db[_0x21e4bc[_0xed8c('0x1d')]],'as':_0x21e4bc['as'],'attributes':_0x21e4bc[_0xed8c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xed8c('0xa')](function(_0xa9eeea){logger[_0xed8c('0xb')]('ShowTrunk',_0x267f46);logger[_0xed8c('0x1e')](_0xed8c('0x1f'),_0x267f46,JSON[_0xed8c('0xf')](_0xa9eeea));_0x3a2168(_0xa9eeea);})[_0xed8c('0x14')](function(_0x3b873d){logger[_0xed8c('0x10')]('ShowTrunk',_0x3b873d[_0xed8c('0x12')],_0x267f46);_0xab0636(_0x5203a7[_0xed8c('0x10')](0x1f4,_0x3b873d['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 53172cf..4097ee8 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 _0x68c6=['/:id','isAuthenticated','update','exports','express','Router','../../components/auth/service','./user-setting.controller','put'];(function(_0x347912,_0x59380b){var _0x137fd1=function(_0x373612){while(--_0x373612){_0x347912['push'](_0x347912['shift']());}};_0x137fd1(++_0x59380b);}(_0x68c6,0xdc));var _0x668c=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x68c6[_0x1b5080];return _0x195c87;};'use strict';var express=require(_0x668c('0x0'));var router=express[_0x668c('0x1')]();var auth=require(_0x668c('0x2'));var controller=require(_0x668c('0x3'));router[_0x668c('0x4')](_0x668c('0x5'),auth[_0x668c('0x6')](),controller[_0x668c('0x7')]);module[_0x668c('0x8')]=router; \ No newline at end of file +var _0x2f24=['../../components/auth/service','put','/:id','isAuthenticated','update','express'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x2f24,0x15b));var _0x42f2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2f24[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x42f2('0x0'));var router=express['Router']();var auth=require(_0x42f2('0x1'));var controller=require('./user-setting.controller');router[_0x42f2('0x2')](_0x42f2('0x3'),auth[_0x42f2('0x4')](),controller[_0x42f2('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 246ea25..62943c7 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 _0x5e0d=['UserId','sequelize','error','warning','debug','exports','ENUM','TEXT','DATE','INTEGER'];(function(_0x39b1bd,_0x2942ac){var _0x205779=function(_0x4d1555){while(--_0x4d1555){_0x39b1bd['push'](_0x39b1bd['shift']());}};_0x205779(++_0x2942ac);}(_0x5e0d,0xf1));var _0xd5e0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5e0d[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xd5e0('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd5e0('0x1'),_0xd5e0('0x2'),'info',_0xd5e0('0x3')];module[_0xd5e0('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd5e0('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd5e0('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd5e0('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd5e0('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd5e0('0x8')],'unique':_0xd5e0('0x9')}}; \ No newline at end of file +var _0x9cc0=['exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error','warning','info','debug'];(function(_0x34599e,_0x2fb554){var _0x269645=function(_0xf5b352){while(--_0xf5b352){_0x34599e['push'](_0x34599e['shift']());}};_0x269645(++_0x2fb554);}(_0x9cc0,0x1c3));var _0x09cc=function(_0x458eef,_0x551783){_0x458eef=_0x458eef-0x0;var _0x2fb384=_0x9cc0[_0x458eef];return _0x2fb384;};'use strict';var Sequelize=require(_0x09cc('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x09cc('0x1'),_0x09cc('0x2'),_0x09cc('0x3'),_0x09cc('0x4')];module[_0x09cc('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x09cc('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x09cc('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x09cc('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x09cc('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x09cc('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x09cc('0xa')],'unique':_0x09cc('0xb')}}; \ 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 e10cd48..1b266d4 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 _0x9589=['update','then','sendStatus','error','stack','name','role','admin','Unauthorized','params','UserSetting','find','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','defaults','localhost','status','json'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x9589,0xbc));var _0x9958=function(_0x44021c,_0xb7effc){_0x44021c=_0x44021c-0x0;var _0x3c3910=_0x9589[_0x44021c];return _0x3c3910;};'use strict';var _=require(_0x9958('0x0'));var Redis=require(_0x9958('0x1'));var logger=require(_0x9958('0x2'))(_0x9958('0x3'));var config=require(_0x9958('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x9958('0x5'))(new Redis(config[_0x9958('0x6')]));require(_0x9958('0x7'))['register'](socket);config[_0x9958('0x6')]=_[_0x9958('0x8')](config[_0x9958('0x6')],{'host':_0x9958('0x9'),'port':0x18eb});function respondWithResult(_0x4225da,_0x2c3eaf){_0x2c3eaf=_0x2c3eaf||0xc8;return function(_0x5750c5){if(_0x5750c5){return _0x4225da[_0x9958('0xa')](_0x2c3eaf)[_0x9958('0xb')](_0x5750c5);}};}function saveUpdates(_0x7d5b2){return function(_0xdeddab){if(_0xdeddab){return _0xdeddab[_0x9958('0xc')](_0x7d5b2)[_0x9958('0xd')](function(_0x1e2647){return _0x1e2647;});}return null;};}function handleEntityNotFound(_0x1e5c25){return function(_0x3369b3){if(!_0x3369b3){_0x1e5c25[_0x9958('0xe')](0x194);}return _0x3369b3;};}function handleError(_0x44ea35,_0x3f0591){_0x3f0591=_0x3f0591||0x1f4;return function(_0x242f1b){logger[_0x9958('0xf')](_0x242f1b[_0x9958('0x10')]);if(_0x242f1b[_0x9958('0x11')]){delete _0x242f1b[_0x9958('0x11')];}_0x44ea35[_0x9958('0xa')](_0x3f0591)['send'](_0x242f1b);};}exports[_0x9958('0xc')]=function(_0x5251c2,_0x1d6513){if(_0x5251c2['user'][_0x9958('0x12')]!==_0x9958('0x13'))throw new Error(_0x9958('0x14'));if(isNaN(Number(_0x5251c2[_0x9958('0x15')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x9958('0x16')][_0x9958('0x17')]({'where':{'id':_0x5251c2['params']['id']}})['then'](handleEntityNotFound(_0x1d6513,null))[_0x9958('0xd')](saveUpdates(_0x5251c2['body'],null))[_0x9958('0xd')](respondWithResult(_0x1d6513,null))[_0x9958('0x18')](handleError(_0x1d6513,null));}; \ No newline at end of file +var _0x0c6d=['UserSetting','find','body','catch','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','redis','localhost','json','update','then','sendStatus','stack','name','status','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x5ef3b7,_0x2c5e94){_0x5ef3b7=_0x5ef3b7-0x0;var _0x155210=_0x0c6d[_0x5ef3b7];return _0x155210;};'use strict';var _=require('lodash');var Redis=require(_0xd0c6('0x0'));var logger=require(_0xd0c6('0x1'))(_0xd0c6('0x2'));var config=require(_0xd0c6('0x3'));var db=require(_0xd0c6('0x4'))['db'];var socket=require(_0xd0c6('0x5'))(new Redis(config['redis']));require(_0xd0c6('0x6'))['register'](socket);config['redis']=_['defaults'](config[_0xd0c6('0x7')],{'host':_0xd0c6('0x8'),'port':0x18eb});function respondWithResult(_0x2d4a64,_0x5de1cd){_0x5de1cd=_0x5de1cd||0xc8;return function(_0x16c6da){if(_0x16c6da){return _0x2d4a64['status'](_0x5de1cd)[_0xd0c6('0x9')](_0x16c6da);}};}function saveUpdates(_0x1763ab){return function(_0x3a7371){if(_0x3a7371){return _0x3a7371[_0xd0c6('0xa')](_0x1763ab)[_0xd0c6('0xb')](function(_0x2a1be){return _0x2a1be;});}return null;};}function handleEntityNotFound(_0xc00380){return function(_0x26e14b){if(!_0x26e14b){_0xc00380[_0xd0c6('0xc')](0x194);}return _0x26e14b;};}function handleError(_0x4d6034,_0x8f70a4){_0x8f70a4=_0x8f70a4||0x1f4;return function(_0x5d1321){logger['error'](_0x5d1321[_0xd0c6('0xd')]);if(_0x5d1321[_0xd0c6('0xe')]){delete _0x5d1321[_0xd0c6('0xe')];}_0x4d6034[_0xd0c6('0xf')](_0x8f70a4)[_0xd0c6('0x10')](_0x5d1321);};}exports[_0xd0c6('0xa')]=function(_0x410d58,_0x38b397){if(_0x410d58[_0xd0c6('0x11')][_0xd0c6('0x12')]!==_0xd0c6('0x13'))throw new Error(_0xd0c6('0x14'));if(isNaN(Number(_0x410d58[_0xd0c6('0x15')]['id'])))throw new Error(_0xd0c6('0x16'));return db[_0xd0c6('0x17')][_0xd0c6('0x18')]({'where':{'id':_0x410d58[_0xd0c6('0x15')]['id']}})[_0xd0c6('0xb')](handleEntityNotFound(_0x38b397,null))[_0xd0c6('0xb')](saveUpdates(_0x410d58[_0xd0c6('0x19')],null))[_0xd0c6('0xb')](respondWithResult(_0x38b397,null))[_0xd0c6('0x1a')](handleError(_0x38b397,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 46d3330..b758042 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 _0xef21=['events','UserSetting','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x39a1cd,_0x4b72d1){var _0x373410=function(_0x3f0379){while(--_0x3f0379){_0x39a1cd['push'](_0x39a1cd['shift']());}};_0x373410(++_0x4b72d1);}(_0xef21,0x100));var _0x1ef2=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xef21[_0x4e9d3c];return _0x2d0825;};'use strict';var EventEmitter=require(_0x1ef2('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x1ef2('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1ef2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ef2('0x3'),'afterDestroy':_0x1ef2('0x4')};function emitEvent(_0x1c156d){return function(_0x518f9b,_0x220d41,_0x20853b){UserSettingEvents[_0x1ef2('0x5')](_0x1c156d+':'+_0x518f9b['id'],_0x518f9b);UserSettingEvents[_0x1ef2('0x5')](_0x1c156d,_0x518f9b);_0x20853b(null);};}for(var e in events){if(events[_0x1ef2('0x6')](e)){var event=events[e];UserSetting[_0x1ef2('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x4418=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserSetting','setMaxListeners'];(function(_0xc2320a,_0x268345){var _0x34edc4=function(_0x399965){while(--_0x399965){_0xc2320a['push'](_0xc2320a['shift']());}};_0x34edc4(++_0x268345);}(_0x4418,0x115));var _0x8441=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0x4418[_0x1443eb];return _0x2b8810;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x8441('0x0'))['db'][_0x8441('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x8441('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8441('0x3'),'afterDestroy':_0x8441('0x4')};function emitEvent(_0x32709b){return function(_0x207cf9,_0x4ad1b0,_0x4dce11){UserSettingEvents[_0x8441('0x5')](_0x32709b+':'+_0x207cf9['id'],_0x207cf9);UserSettingEvents[_0x8441('0x5')](_0x32709b,_0x207cf9);_0x4dce11(null);};}for(var e in events){if(events[_0x8441('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x8441('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 d332126..baed8ed 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 _0x4899=['./user-setting.attributes','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x56ff85,_0x4dd17e){var _0x5e285b=function(_0x107325){while(--_0x107325){_0x56ff85['push'](_0x56ff85['shift']());}};_0x5e285b(++_0x4dd17e);}(_0x4899,0x74));var _0x9489=function(_0x3bb40f,_0x585425){_0x3bb40f=_0x3bb40f-0x0;var _0x4748a0=_0x4899[_0x3bb40f];return _0x4748a0;};'use strict';var attributes=require(_0x9489('0x0'));module['exports']=function(_0x3bf332){return _0x3bf332['define'](_0x9489('0x1'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6a6532){if(!_0x6a6532[_0x9489('0x2')])_0x6a6532[_0x9489('0x3')]=null;else if(_0x6a6532[_0x9489('0x3')]===null)_0x6a6532[_0x9489('0x3')]=new Date();}}});}; \ No newline at end of file +var _0x3f19=['./user-setting.attributes','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0xee4033,_0x487f38){var _0x58461f=function(_0x317d00){while(--_0x317d00){_0xee4033['push'](_0xee4033['shift']());}};_0x58461f(++_0x487f38);}(_0x3f19,0xc0));var _0x93f1=function(_0x13c779,_0x5a82a8){_0x13c779=_0x13c779-0x0;var _0xcaa0e0=_0x3f19[_0x13c779];return _0xcaa0e0;};'use strict';var attributes=require(_0x93f1('0x0'));module['exports']=function(_0x5430d0){return _0x5430d0['define'](_0x93f1('0x1'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x452cf9){if(!_0x452cf9[_0x93f1('0x2')])_0x452cf9[_0x93f1('0x3')]=null;else if(_0x452cf9[_0x93f1('0x3')]===null)_0x452cf9['clientSideLoggingEnabledSince']=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 134bed9..c197c8b 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 _0x4b03=['save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','./user-setting.events'];(function(_0x49dc0c,_0x549930){var _0x573e37=function(_0xcefd57){while(--_0xcefd57){_0x49dc0c['push'](_0x49dc0c['shift']());}};_0x573e37(++_0x549930);}(_0x4b03,0x11f));var _0x34b0=function(_0x2f33b8,_0x2da652){_0x2f33b8=_0x2f33b8-0x0;var _0x568856=_0x4b03[_0x2f33b8];return _0x568856;};'use strict';var UserSettingEvents=require(_0x34b0('0x0'));var events=[_0x34b0('0x1'),_0x34b0('0x2'),_0x34b0('0x3')];function createListener(_0xf346fd,_0x3a1a77){return function(_0x2ccde1){_0x3a1a77[_0x34b0('0x4')](_0xf346fd,_0x2ccde1);if(_0xf346fd===_0x34b0('0x5')){_0x3a1a77[_0x34b0('0x4')](_0x34b0('0x6')+_0x2ccde1[_0x34b0('0x7')],_0x2ccde1);}};}exports[_0x34b0('0x8')]=function(_0x2f225){for(var _0x1c5775=0x0,_0x287f05=events['length'];_0x1c5775<_0x287f05;_0x1c5775++){var _0x52ed51=events[_0x1c5775];var _0x312672=createListener('user-setting:'+_0x52ed51,_0x2f225);UserSettingEvents['on'](_0x52ed51,_0x312672);}}; \ No newline at end of file +var _0x5e9a=['UserId','register','length','user-setting:','save','remove','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e9a,0x72));var _0xa5e9=function(_0x56ec01,_0x236484){_0x56ec01=_0x56ec01-0x0;var _0x170a40=_0x5e9a[_0x56ec01];return _0x170a40;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xa5e9('0x0'),_0xa5e9('0x1'),_0xa5e9('0x2')];function createListener(_0x332d34,_0x184dc4){return function(_0x6e7f16){_0x184dc4[_0xa5e9('0x3')](_0x332d34,_0x6e7f16);if(_0x332d34===_0xa5e9('0x4')){_0x184dc4[_0xa5e9('0x3')](_0xa5e9('0x5')+_0x6e7f16[_0xa5e9('0x6')],_0x6e7f16);}};}exports[_0xa5e9('0x7')]=function(_0x29ae50){for(var _0x5cbc82=0x0,_0x2d0ad6=events[_0xa5e9('0x8')];_0x5cbc82<_0x2d0ad6;_0x5cbc82++){var _0x1b80c3=events[_0x5cbc82];var _0x28e946=createListener(_0xa5e9('0x9')+_0x1b80c3,_0x29ae50);UserSettingEvents['on'](_0x1b80c3,_0x28e946);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 4fe1f22..92aaf80 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 _0x7cce=['removeChatWebsites','removeWhatsappAccounts','/:id/square_projects','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','/:id/openchannel_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeWhatsappInteractions','removeFaxAccounts'];(function(_0x5f48ed,_0x6f6e7){var _0xf06d87=function(_0x57cf1f){while(--_0x57cf1f){_0x5f48ed['push'](_0x5f48ed['shift']());}};_0xf06d87(++_0x6f6e7);}(_0x7cce,0x16e));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe7cc('0x0'));var util=require(_0xe7cc('0x1'));var path=require(_0xe7cc('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7cc('0x3'));var router=express[_0xe7cc('0x4')]();var fs_extra=require(_0xe7cc('0x5'));var auth=require(_0xe7cc('0x6'));var interaction=require(_0xe7cc('0x7'));var config=require(_0xe7cc('0x8'));var controller=require(_0xe7cc('0x9'));router[_0xe7cc('0xa')]('/',auth[_0xe7cc('0xb')](),controller['index']);router[_0xe7cc('0xa')](_0xe7cc('0xc'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0xd')]);router[_0xe7cc('0xa')](_0xe7cc('0xe'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0xf')]);router[_0xe7cc('0xa')](_0xe7cc('0x10'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x11')]);router['get'](_0xe7cc('0x12'),auth['isAuthenticated'](),controller['show']);router[_0xe7cc('0xa')](_0xe7cc('0x13'),controller['getAvatar']);router[_0xe7cc('0xa')](_0xe7cc('0x14'),auth[_0xe7cc('0xb')](),controller['getOpenTabs']);router[_0xe7cc('0xa')](_0xe7cc('0x15'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x16')]);router[_0xe7cc('0xa')](_0xe7cc('0x17'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x18')]);router[_0xe7cc('0xa')](_0xe7cc('0x19'),auth['isAuthenticated'](),controller[_0xe7cc('0x1a')]);router[_0xe7cc('0xa')](_0xe7cc('0x1b'),auth[_0xe7cc('0xb')](),controller['getGroups']);router[_0xe7cc('0xa')](_0xe7cc('0x1c'),auth['isAuthenticated'](),controller[_0xe7cc('0x1d')]);router[_0xe7cc('0xa')](_0xe7cc('0x1e'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x1f')]);router[_0xe7cc('0xa')](_0xe7cc('0x20'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x21')]);router[_0xe7cc('0xa')](_0xe7cc('0x22'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x23')]);router[_0xe7cc('0xa')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0xe7cc('0x24')]);router[_0xe7cc('0xa')]('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0xe7cc('0xa')](_0xe7cc('0x25'),auth[_0xe7cc('0xb')](),controller['getFaxInteractions']);router[_0xe7cc('0xa')](_0xe7cc('0x26'),auth['isAuthenticated'](),controller[_0xe7cc('0x27')]);router['get'](_0xe7cc('0x28'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x29')]);router[_0xe7cc('0xa')](_0xe7cc('0x2a'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x2b')]);router['get'](_0xe7cc('0x2c'),auth['isAuthenticated'](),controller[_0xe7cc('0x2d')]);router[_0xe7cc('0xa')](_0xe7cc('0x2e'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x2f')]);router[_0xe7cc('0xa')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xe7cc('0x30')]);router[_0xe7cc('0xa')]('/:id/mail_accounts',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x31')]);router[_0xe7cc('0xa')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xe7cc('0xa')](_0xe7cc('0x32'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x33')]);router[_0xe7cc('0xa')](_0xe7cc('0x34'),auth['isAuthenticated'](),controller['getChatWebsites']);router['get'](_0xe7cc('0x35'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0xe7cc('0xa')]('/:id/square_projects',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x36')]);router[_0xe7cc('0xa')]('/:id/scheduled_calls',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x37')]);router[_0xe7cc('0xa')](_0xe7cc('0x38'),auth['isAuthenticated'](),controller[_0xe7cc('0x39')]);router['post']('/:id/contacts',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x3a')]);router[_0xe7cc('0x3b')]('/',auth['isAuthenticated'](),controller[_0xe7cc('0x3c')]);router[_0xe7cc('0x3b')](_0xe7cc('0x3d'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xe7cc('0x3b')]('/:id/queues',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x3e')]);var upload=multer({'storage':multer[_0xe7cc('0x3f')]({'destination':function(_0x137e8f,_0x4ae82d,_0x201aa2){_0x201aa2(null,path[_0xe7cc('0x40')](config[_0xe7cc('0x41')],_0xe7cc('0x42')));},'filename':function(_0x27ff6f,_0x366a82,_0x1d153e){_0x1d153e(null,util[_0xe7cc('0x43')](_0xe7cc('0x44'),Date[_0xe7cc('0x45')](),_0x366a82[_0xe7cc('0x46')]));}})});router[_0xe7cc('0x3b')]('/:id/avatar',upload[_0xe7cc('0x47')](_0xe7cc('0x48')),controller[_0xe7cc('0x49')]);router[_0xe7cc('0x3b')](_0xe7cc('0x4a'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x4b')]);router[_0xe7cc('0x3b')](_0xe7cc('0x4c'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x4d')]);router[_0xe7cc('0x3b')](_0xe7cc('0x4e'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x4f')]);router[_0xe7cc('0x3b')](_0xe7cc('0x50'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x51')]);router[_0xe7cc('0x3b')](_0xe7cc('0x28'),auth['isAuthenticated'](),controller[_0xe7cc('0x52')]);router[_0xe7cc('0x3b')](_0xe7cc('0x53'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x54')]);router[_0xe7cc('0x3b')](_0xe7cc('0x55'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x56')]);router['post'](_0xe7cc('0x57'),auth['isAuthenticated'](),controller[_0xe7cc('0x58')]);router[_0xe7cc('0x3b')]('/:id/sms_interactions',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x59')]);router[_0xe7cc('0x3b')](_0xe7cc('0x5a'),auth['isAuthenticated'](),controller[_0xe7cc('0x5b')]);router[_0xe7cc('0x3b')](_0xe7cc('0x5c'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x5d')]);router[_0xe7cc('0x3b')](_0xe7cc('0x5e'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0xe7cc('0x3b')]('/:id/mail_accounts',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x5f')]);router[_0xe7cc('0x3b')](_0xe7cc('0x60'),auth[_0xe7cc('0xb')](),controller['addOpenchannelAccounts']);router[_0xe7cc('0x3b')](_0xe7cc('0x32'),auth['isAuthenticated'](),controller[_0xe7cc('0x61')]);router['post'](_0xe7cc('0x34'),auth['isAuthenticated'](),controller[_0xe7cc('0x62')]);router['post'](_0xe7cc('0x35'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x63')]);router[_0xe7cc('0x3b')]('/:id/square_projects',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x64')]);router[_0xe7cc('0x3b')](_0xe7cc('0x38'),auth['isAuthenticated'](),controller[_0xe7cc('0x65')]);router['put'](_0xe7cc('0x12'),auth['isAuthenticated'](),controller['update']);router['put'](_0xe7cc('0x66'),auth['isAuthenticated'](),controller[_0xe7cc('0x67')]);router[_0xe7cc('0x68')](_0xe7cc('0x17'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x69')]);router['delete']('/:id/teams',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x6a')]);router[_0xe7cc('0x68')]('/:id',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x6b')]);router['delete']('/:id/chat_interactions',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x6c')]);router['delete']('/:id/mail_interactions',auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x6d')]);router['delete'](_0xe7cc('0x57'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x6e')]);router[_0xe7cc('0x68')](_0xe7cc('0x6f'),auth[_0xe7cc('0xb')](),controller['removeSmsInteractions']);router[_0xe7cc('0x68')](_0xe7cc('0x5a'),auth[_0xe7cc('0xb')](),controller['removeOpenchannelInteractions']);router[_0xe7cc('0x68')](_0xe7cc('0x5c'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x70')]);router['delete'](_0xe7cc('0x5e'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x71')]);router[_0xe7cc('0x68')]('/:id/mail_accounts',auth[_0xe7cc('0xb')](),controller['removeMailAccounts']);router[_0xe7cc('0x68')]('/:id/openchannel_accounts',auth[_0xe7cc('0xb')](),controller['removeOpenchannelAccounts']);router[_0xe7cc('0x68')](_0xe7cc('0x32'),auth[_0xe7cc('0xb')](),controller['removeSmsAccounts']);router['delete'](_0xe7cc('0x34'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x72')]);router[_0xe7cc('0x68')](_0xe7cc('0x35'),auth['isAuthenticated'](),controller[_0xe7cc('0x73')]);router['delete'](_0xe7cc('0x74'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x75')]);router[_0xe7cc('0x68')](_0xe7cc('0x38'),auth[_0xe7cc('0xb')](),controller[_0xe7cc('0x76')]);module[_0xe7cc('0x77')]=router; \ No newline at end of file +var _0x5912=['/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','describe','whoami','getPresence','/:id','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/: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','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','join','root','server/files/images/','format','%s-%s','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams'];(function(_0x4f62b8,_0x34b2a6){var _0x5d7303=function(_0xd3e931){while(--_0xd3e931){_0x4f62b8['push'](_0x4f62b8['shift']());}};_0x5d7303(++_0x34b2a6);}(_0x5912,0x8f));var _0x2591=function(_0x3d455f,_0x5161d1){_0x3d455f=_0x3d455f-0x0;var _0x39572f=_0x5912[_0x3d455f];return _0x39572f;};'use strict';var multer=require('multer');var util=require(_0x2591('0x0'));var path=require(_0x2591('0x1'));var timeout=require('connect-timeout');var express=require(_0x2591('0x2'));var router=express[_0x2591('0x3')]();var fs_extra=require(_0x2591('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2591('0x5'));var controller=require('./user.controller');router[_0x2591('0x6')]('/',auth[_0x2591('0x7')](),controller['index']);router['get']('/describe',auth[_0x2591('0x7')](),controller[_0x2591('0x8')]);router['get']('/whoami',auth['isAuthenticated'](),controller[_0x2591('0x9')]);router[_0x2591('0x6')]('/presence',auth[_0x2591('0x7')](),controller[_0x2591('0xa')]);router['get'](_0x2591('0xb'),auth[_0x2591('0x7')](),controller['show']);router[_0x2591('0x6')](_0x2591('0xc'),controller[_0x2591('0xd')]);router['get']('/:id/open_tabs',auth[_0x2591('0x7')](),controller[_0x2591('0xe')]);router['get'](_0x2591('0xf'),auth[_0x2591('0x7')](),controller[_0x2591('0x10')]);router[_0x2591('0x6')](_0x2591('0x11'),auth[_0x2591('0x7')](),controller['getQueues']);router[_0x2591('0x6')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x2591('0x12')]);router[_0x2591('0x6')]('/:id/groups',auth[_0x2591('0x7')](),controller[_0x2591('0x13')]);router[_0x2591('0x6')](_0x2591('0x14'),auth[_0x2591('0x7')](),controller[_0x2591('0x15')]);router[_0x2591('0x6')](_0x2591('0x16'),auth[_0x2591('0x7')](),controller['getScreenRecordings']);router[_0x2591('0x6')]('/:id/chat/interactions',auth[_0x2591('0x7')](),controller[_0x2591('0x17')]);router[_0x2591('0x6')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x2591('0x18')]);router[_0x2591('0x6')](_0x2591('0x19'),auth[_0x2591('0x7')](),controller[_0x2591('0x1a')]);router[_0x2591('0x6')]('/:id/sms/interactions',auth[_0x2591('0x7')](),controller['getSmsInteractions']);router[_0x2591('0x6')](_0x2591('0x1b'),auth[_0x2591('0x7')](),controller[_0x2591('0x1c')]);router[_0x2591('0x6')](_0x2591('0x1d'),auth[_0x2591('0x7')](),controller[_0x2591('0x1e')]);router['get']('/:id/teams',auth[_0x2591('0x7')](),controller['getTeams']);router['get'](_0x2591('0x1f'),auth[_0x2591('0x7')](),controller[_0x2591('0x20')]);router[_0x2591('0x6')](_0x2591('0x21'),auth['isAuthenticated'](),controller[_0x2591('0x22')]);router[_0x2591('0x6')](_0x2591('0x23'),auth[_0x2591('0x7')](),controller[_0x2591('0x24')]);router[_0x2591('0x6')](_0x2591('0x25'),auth['isAuthenticated'](),controller[_0x2591('0x26')]);router[_0x2591('0x6')](_0x2591('0x27'),auth[_0x2591('0x7')](),controller[_0x2591('0x28')]);router[_0x2591('0x6')](_0x2591('0x29'),auth[_0x2591('0x7')](),controller[_0x2591('0x2a')]);router['get'](_0x2591('0x2b'),auth['isAuthenticated'](),controller[_0x2591('0x2c')]);router['get'](_0x2591('0x2d'),auth['isAuthenticated'](),controller[_0x2591('0x2e')]);router[_0x2591('0x6')](_0x2591('0x2f'),auth[_0x2591('0x7')](),controller[_0x2591('0x30')]);router[_0x2591('0x6')](_0x2591('0x31'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x2591('0x6')](_0x2591('0x32'),auth[_0x2591('0x7')](),controller[_0x2591('0x33')]);router['get'](_0x2591('0x34'),auth[_0x2591('0x7')](),controller[_0x2591('0x35')]);router[_0x2591('0x36')](_0x2591('0xf'),auth[_0x2591('0x7')](),controller[_0x2591('0x37')]);router[_0x2591('0x36')]('/',auth[_0x2591('0x7')](),controller[_0x2591('0x38')]);router['post']('/create_many',auth[_0x2591('0x7')](),controller[_0x2591('0x39')]);router[_0x2591('0x36')](_0x2591('0x11'),auth[_0x2591('0x7')](),controller[_0x2591('0x3a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c77d5,_0x477d7c,_0x3af303){_0x3af303(null,path[_0x2591('0x3b')](config[_0x2591('0x3c')],_0x2591('0x3d')));},'filename':function(_0x2e974b,_0x2af2d3,_0x2798a9){_0x2798a9(null,util[_0x2591('0x3e')](_0x2591('0x3f'),Date[_0x2591('0x40')](),_0x2af2d3[_0x2591('0x41')]));}})});router['post']('/:id/avatar',upload['single'](_0x2591('0x42')),controller[_0x2591('0x43')]);router[_0x2591('0x36')](_0x2591('0x44'),auth[_0x2591('0x7')](),controller[_0x2591('0x45')]);router[_0x2591('0x36')](_0x2591('0x46'),auth[_0x2591('0x7')](),controller[_0x2591('0x47')]);router[_0x2591('0x36')](_0x2591('0x48'),auth[_0x2591('0x7')](),controller[_0x2591('0x49')]);router[_0x2591('0x36')](_0x2591('0x4a'),auth[_0x2591('0x7')](),controller[_0x2591('0x4b')]);router['post'](_0x2591('0x4c'),auth[_0x2591('0x7')](),controller['addTeams']);router['post'](_0x2591('0x4d'),auth[_0x2591('0x7')](),controller['addChatInteractions']);router[_0x2591('0x36')](_0x2591('0x4e'),auth[_0x2591('0x7')](),controller[_0x2591('0x4f')]);router[_0x2591('0x36')](_0x2591('0x50'),auth['isAuthenticated'](),controller[_0x2591('0x51')]);router['post'](_0x2591('0x52'),auth[_0x2591('0x7')](),controller[_0x2591('0x53')]);router['post']('/:id/openchannel_interactions',auth[_0x2591('0x7')](),controller[_0x2591('0x54')]);router[_0x2591('0x36')](_0x2591('0x55'),auth[_0x2591('0x7')](),controller[_0x2591('0x56')]);router[_0x2591('0x36')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2591('0x57')]);router[_0x2591('0x36')]('/:id/mail_accounts',auth[_0x2591('0x7')](),controller['addMailAccounts']);router[_0x2591('0x36')](_0x2591('0x29'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x2591('0x36')](_0x2591('0x2b'),auth[_0x2591('0x7')](),controller[_0x2591('0x58')]);router[_0x2591('0x36')](_0x2591('0x2d'),auth[_0x2591('0x7')](),controller[_0x2591('0x59')]);router[_0x2591('0x36')]('/:id/whatsapp_accounts',auth[_0x2591('0x7')](),controller[_0x2591('0x5a')]);router[_0x2591('0x36')](_0x2591('0x31'),auth[_0x2591('0x7')](),controller[_0x2591('0x5b')]);router[_0x2591('0x36')](_0x2591('0x34'),auth['isAuthenticated'](),controller[_0x2591('0x5c')]);router[_0x2591('0x5d')](_0x2591('0xb'),auth[_0x2591('0x7')](),controller['update']);router[_0x2591('0x5d')](_0x2591('0x5e'),auth[_0x2591('0x7')](),controller[_0x2591('0x5f')]);router[_0x2591('0x60')](_0x2591('0x11'),auth[_0x2591('0x7')](),controller[_0x2591('0x61')]);router[_0x2591('0x60')](_0x2591('0x4c'),auth['isAuthenticated'](),controller[_0x2591('0x62')]);router[_0x2591('0x60')](_0x2591('0xb'),auth[_0x2591('0x7')](),controller['destroy']);router[_0x2591('0x60')](_0x2591('0x4d'),auth[_0x2591('0x7')](),controller[_0x2591('0x63')]);router[_0x2591('0x60')](_0x2591('0x4e'),auth[_0x2591('0x7')](),controller[_0x2591('0x64')]);router[_0x2591('0x60')](_0x2591('0x50'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x2591('0x60')](_0x2591('0x52'),auth['isAuthenticated'](),controller[_0x2591('0x65')]);router[_0x2591('0x60')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x2591('0x60')](_0x2591('0x55'),auth[_0x2591('0x7')](),controller['removeWhatsappInteractions']);router[_0x2591('0x60')](_0x2591('0x25'),auth['isAuthenticated'](),controller[_0x2591('0x66')]);router[_0x2591('0x60')](_0x2591('0x27'),auth[_0x2591('0x7')](),controller[_0x2591('0x67')]);router[_0x2591('0x60')](_0x2591('0x29'),auth[_0x2591('0x7')](),controller[_0x2591('0x68')]);router[_0x2591('0x60')](_0x2591('0x2b'),auth[_0x2591('0x7')](),controller['removeSmsAccounts']);router[_0x2591('0x60')](_0x2591('0x2d'),auth[_0x2591('0x7')](),controller[_0x2591('0x69')]);router[_0x2591('0x60')](_0x2591('0x2f'),auth[_0x2591('0x7')](),controller[_0x2591('0x6a')]);router[_0x2591('0x60')](_0x2591('0x31'),auth[_0x2591('0x7')](),controller[_0x2591('0x6b')]);router[_0x2591('0x60')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x2591('0x6c')]);module[_0x2591('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 0b456d8..55ec272 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 _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x215f34,_0x331f68){var _0x293afe=function(_0x3e1d39){while(--_0x3e1d39){_0x215f34['push'](_0x215f34['shift']());}};_0x293afe(++_0x331f68);}(_0xedd9,0xfc));var _0x9edd=function(_0x586030,_0x404ef4){_0x586030=_0x586030-0x0;var _0x1cdb3b=_0xedd9[_0x586030];return _0x1cdb3b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0}}; \ No newline at end of file +var _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x30ec57,_0x30976c){var _0x35c28c=function(_0x7d2bb2){while(--_0x7d2bb2){_0x30ec57['push'](_0x30ec57['shift']());}};_0x35c28c(++_0x30976c);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e124f,_0x5ad7ed){_0x4e124f=_0x4e124f-0x0;var _0x5ec4e6=_0xedd9[_0x4e124f];return _0x5ec4e6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 7fbcee2..b4d2f94 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 _0xeca3=['getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','type','mailPause','faxPause','openchannelPause','whatsapppause','pauseType','manual','%s%s','Pause','unpause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','VoicePrefixId','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','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','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$or','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','CmContact','Contact','dialActive','VoiceQueue','getApiKey','json','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','token','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','flatten','asc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unavailable','ringing','busy','slice','charAt','toUpperCase','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','toString','OpenTabs','moment','bluebird','path','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','emit','destroy','role','Users','user','agent','Telephones','filter','map','value','find','name','UserProfileResource','send','index','key','includes','password','where','User','includeAll','query','userSetting','attributes','openTabs','true','push','chat','dataValues','rows','fax','mail','openchannel','whatsapp','all','params','model','rawAttributes','salt','keys','filters','intersection','fields','length','include','options','sms','body','describe','addContacts','omit','ids','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_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)','SELECT','from','voicemail','mailbox','email','permissions','102','113','110','104','105','106','108','109','100','111','114','115','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','some','findAll','isEmpty','compact','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','Queue:save','voice','get','online','format','SIP/%s','voicePause','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','Queues','isArray','Queue:remove','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','ChatOpenTabs','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','createdAt','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','order','sort','pick','merge','CmList','List','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','hasOwnProperty','nolimit'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0xeca3,0xbb));var _0x3eca=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xeca3[_0x35885a];return _0xe86249;};'use strict';var moment=require(_0x3eca('0x0'));var BPromise=require(_0x3eca('0x1'));var util=require('util');var path=require(_0x3eca('0x2'));var fs=require('fs');var _=require(_0x3eca('0x3'));var squel=require('squel');var jayson=require(_0x3eca('0x4'));var Redis=require(_0x3eca('0x5'));var authService=require(_0x3eca('0x6'));var qs=require(_0x3eca('0x7'));var logger=require(_0x3eca('0x8'))(_0x3eca('0x9'));var utils=require(_0x3eca('0xa'));var config=require(_0x3eca('0xb'));var licenseUtil=require(_0x3eca('0xc'));var APIBadRequestError=require(_0x3eca('0xd'))[_0x3eca('0xe')];var APINotFoundError=require(_0x3eca('0xd'))[_0x3eca('0xf')];var APIHandleError=require(_0x3eca('0xd'))[_0x3eca('0x10')];var db=require(_0x3eca('0x11'))['db'];var socket=require(_0x3eca('0x12'))(new Redis(config[_0x3eca('0x13')]));require('./user.socket')[_0x3eca('0x14')](socket);config[_0x3eca('0x13')]=_[_0x3eca('0x15')](config['redis'],{'host':_0x3eca('0x16'),'port':0x18eb});var client=jayson[_0x3eca('0x17')][_0x3eca('0x18')]({'port':0x232a});var values;function respondWithRpcPromise(_0x1fbc74,_0x5cad8d,_0x369a5b,_0x3547f2){return new BPromise(function(_0x2cce89,_0x87f707){var _0x4d5e3d=_0x3547f2||client;return _0x4d5e3d[_0x3eca('0x19')](_0x1fbc74,_0x369a5b)[_0x3eca('0x1a')](function(_0x230cd9){logger[_0x3eca('0x1b')](_0x3eca('0x1c'),_0x5cad8d,_0x3eca('0x1d'));logger[_0x3eca('0x1e')](_0x3eca('0x1f'),_0x5cad8d,_0x3eca('0x1d'),JSON[_0x3eca('0x20')](_0x230cd9));if(_0x230cd9[_0x3eca('0x21')]){if(_0x230cd9[_0x3eca('0x21')][_0x3eca('0x22')]===0x1f4){logger[_0x3eca('0x21')]('User,\x20%s,\x20%s',_0x5cad8d,_0x230cd9[_0x3eca('0x21')][_0x3eca('0x23')]);return _0x87f707(_0x230cd9['error']['message']);}logger[_0x3eca('0x21')]('User,\x20%s,\x20%s',_0x5cad8d,_0x230cd9['error'][_0x3eca('0x23')]);return _0x2cce89(_0x230cd9[_0x3eca('0x21')][_0x3eca('0x23')]);}else{logger[_0x3eca('0x1b')](_0x3eca('0x1c'),_0x5cad8d,'request\x20sent');_0x2cce89(_0x230cd9[_0x3eca('0x24')]['message']);}})[_0x3eca('0x25')](function(_0x421ee5){logger[_0x3eca('0x21')](_0x3eca('0x1c'),_0x5cad8d,_0x421ee5);_0x87f707(_0x421ee5);});});}function respondWithStatusCode(_0x265f3f,_0x4c2d67){_0x4c2d67=_0x4c2d67||0xcc;return function(_0x3e3ba0){if(_0x3e3ba0){return _0x265f3f[_0x3eca('0x26')](_0x4c2d67);}return _0x265f3f[_0x3eca('0x27')](_0x4c2d67)[_0x3eca('0x28')]();};}function respondWithResult(_0x1d21ad,_0x1b67f2){_0x1b67f2=_0x1b67f2||0xc8;return function(_0xd8a335){if(_0xd8a335){return _0x1d21ad[_0x3eca('0x27')](_0x1b67f2)['json'](_0xd8a335);}};}function respondWithFilteredResult(_0x3fa2b7,_0x16918c){return function(_0x5b1047){if(_0x5b1047){var _0x3d1ff7=typeof _0x16918c[_0x3eca('0x29')]===_0x3eca('0x2a')&&typeof _0x16918c[_0x3eca('0x2b')]===_0x3eca('0x2a');var _0x51efc3=_0x5b1047[_0x3eca('0x2c')];var _0x199f4b=_0x3d1ff7?0x0:_0x16918c[_0x3eca('0x29')];var _0x10d53a=_0x3d1ff7?_0x5b1047['count']:_0x16918c[_0x3eca('0x29')]+_0x16918c[_0x3eca('0x2b')];var _0xcc1a3c;if(_0x10d53a>=_0x51efc3){_0x10d53a=_0x51efc3;_0xcc1a3c=0xc8;}else{_0xcc1a3c=0xce;}_0x3fa2b7['status'](_0xcc1a3c);return _0x3fa2b7[_0x3eca('0x2d')](_0x3eca('0x2e'),_0x199f4b+'-'+_0x10d53a+'/'+_0x51efc3)['json'](_0x5b1047);}return null;};}function saveUpdates(_0x1554a8){return function(_0x48b810){if(_0x48b810){return _0x48b810[_0x3eca('0x2f')](_0x1554a8)['then'](function(_0x3c4eb4){socket[_0x3eca('0x30')]('userNotification:recalc:'+_0x3c4eb4['id'],{});return _0x3c4eb4;});}return null;};}function removeEntity(_0x4604b7){return function(_0x23ccd0){if(_0x23ccd0){return _0x23ccd0[_0x3eca('0x31')]()['then'](function(){var _0x3e5253=_0x23ccd0['get']({'plain':!![]});if(_0x3e5253[_0x3eca('0x32')]==='admin')return;var _0xfc4be=[{'name':_0x3eca('0x33'),'value':_0x3eca('0x34'),'ignore':!![]},{'name':'Agents','value':_0x3eca('0x35'),'ignore':![]},{'name':_0x3eca('0x36'),'value':'telephone','ignore':![]}];var _0x3f27b5=_(_0xfc4be)[_0x3eca('0x37')]('ignore')[_0x3eca('0x38')](_0x3eca('0x39'))['value']();if(_['includes'](_0x3f27b5,_0x3e5253[_0x3eca('0x32')])){return;}var _0x134d61=_[_0x3eca('0x3a')](_0xfc4be,['value',_0x3e5253[_0x3eca('0x32')]])[_0x3eca('0x3b')];return db[_0x3eca('0x3c')][_0x3eca('0x31')]({'where':{'type':_0x134d61,'resourceId':_0x3e5253['id']}})[_0x3eca('0x1a')](function(){return _0x23ccd0;});})[_0x3eca('0x1a')](function(){_0x4604b7[_0x3eca('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218803){return function(_0x3a0bbc){if(!_0x3a0bbc){_0x218803[_0x3eca('0x26')](0x194);}return _0x3a0bbc;};}function handleError(_0x43956a,_0x24ed49){_0x24ed49=_0x24ed49||0x1f4;return function(_0x510804){logger['error'](_0x510804['stack']);if(_0x510804[_0x3eca('0x3b')]){delete _0x510804[_0x3eca('0x3b')];}_0x43956a['status'](_0x24ed49)[_0x3eca('0x3d')](_0x510804);};}exports[_0x3eca('0x3e')]=function(_0x42697b,_0x2da4bc){var _0xe5f72b={},_0x58cbe1={'count':0x0,'rows':[]};var _0x35c9e4=_(db['User']['rawAttributes'])['map'](function(_0x360f2f){return{'name':_0x360f2f['fieldName'],'type':_0x360f2f['type'][_0x3eca('0x3f')]};})[_0x3eca('0x37')](function(_0x313e3b){return!_[_0x3eca('0x40')]([_0x3eca('0x41'),'salt'],_0x313e3b['name']);})[_0x3eca('0x39')]();_0xe5f72b=qs['getOptions'](_0x35c9e4,_0x42697b);var _0x120601={'where':_0xe5f72b[_0x3eca('0x42')]};return db[_0x3eca('0x43')]['count'](_0x120601)[_0x3eca('0x1a')](function(_0x5a22da){_0x58cbe1[_0x3eca('0x2c')]=_0x5a22da;if(_0x42697b['query'][_0x3eca('0x44')]){_0xe5f72b['include']=[{'all':!![]}];}if(_0x42697b[_0x3eca('0x45')]['userSetting']==='true'){_0xe5f72b['include']=[{'model':db['UserSetting'],'as':_0x3eca('0x46')}];}if(!_[_0x3eca('0x40')](_0xe5f72b[_0x3eca('0x47')],'id')){_0xe5f72b[_0x3eca('0x47')]['push']('id');}return db[_0x3eca('0x43')]['findAll'](_0xe5f72b);})[_0x3eca('0x1a')](function(_0x5bab7f){_0x58cbe1['rows']=_0x5bab7f;if(_0x42697b['query'][_0x3eca('0x48')]===_0x3eca('0x49')){var _0x49ac16=[];for(var _0x2ac4f3=0x0;_0x2ac4f3<_0x58cbe1['rows']['length'];_0x2ac4f3++){_0x49ac16[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x4b'),_0x58cbe1['rows'][_0x2ac4f3][_0x3eca('0x4c')]));_0x49ac16[_0x3eca('0x4a')](get_open_tabs('sms',_0x58cbe1[_0x3eca('0x4d')][_0x2ac4f3][_0x3eca('0x4c')]));_0x49ac16[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x4e'),_0x58cbe1[_0x3eca('0x4d')][_0x2ac4f3][_0x3eca('0x4c')]));_0x49ac16[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x4f'),_0x58cbe1[_0x3eca('0x4d')][_0x2ac4f3][_0x3eca('0x4c')]));_0x49ac16[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x50'),_0x58cbe1[_0x3eca('0x4d')][_0x2ac4f3][_0x3eca('0x4c')]));_0x49ac16[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x51'),_0x58cbe1[_0x3eca('0x4d')][_0x2ac4f3][_0x3eca('0x4c')]));}return BPromise[_0x3eca('0x52')](_0x49ac16)[_0x3eca('0x1a')](function(){return _0x58cbe1;});}else{return _0x58cbe1;}})[_0x3eca('0x1a')](respondWithFilteredResult(_0x2da4bc,_0xe5f72b))[_0x3eca('0x25')](handleError(_0x2da4bc,null));};exports['show']=function(_0x1dbba0,_0x26209c){var _0x5f1063={'raw':![],'where':{'id':_0x1dbba0[_0x3eca('0x53')]['id']}},_0x2515f0={};_0x2515f0[_0x3eca('0x54')]=_['differenceBy'](_['keys'](db[_0x3eca('0x43')][_0x3eca('0x55')]),['password',_0x3eca('0x56')]);_0x2515f0[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x1dbba0[_0x3eca('0x45')]);_0x2515f0[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x2515f0[_0x3eca('0x54')],_0x2515f0[_0x3eca('0x45')]);_0x5f1063[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x2515f0['model'],qs[_0x3eca('0x5a')](_0x1dbba0[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x5f1063[_0x3eca('0x47')]=_0x5f1063[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x5f1063[_0x3eca('0x47')]:_0x2515f0[_0x3eca('0x54')];if(_0x1dbba0['query'][_0x3eca('0x44')]){_0x5f1063[_0x3eca('0x5c')]=[{'all':!![]}];}if(_0x1dbba0[_0x3eca('0x45')][_0x3eca('0x46')]===_0x3eca('0x49')){_0x5f1063[_0x3eca('0x5c')]=[{'model':db['UserSetting'],'as':_0x3eca('0x46')}];}_0x5f1063=_['merge']({},_0x5f1063,_0x1dbba0[_0x3eca('0x5d')]);if(!_[_0x3eca('0x40')](_0x5f1063[_0x3eca('0x47')],'id')){_0x5f1063['attributes'][_0x3eca('0x4a')]('id');}return db[_0x3eca('0x43')][_0x3eca('0x3a')](_0x5f1063)[_0x3eca('0x1a')](handleEntityNotFound(_0x26209c,null))[_0x3eca('0x1a')](function(_0x3a2d1e){var _0x131b65=[];values=_0x3a2d1e;if(_0x1dbba0[_0x3eca('0x45')][_0x3eca('0x48')]===_0x3eca('0x49')){_0x131b65[_0x3eca('0x4a')](get_open_tabs('chat',_0x3a2d1e[_0x3eca('0x4c')]));_0x131b65['push'](get_open_tabs(_0x3eca('0x5e'),_0x3a2d1e[_0x3eca('0x4c')]));_0x131b65[_0x3eca('0x4a')](get_open_tabs('openchannel',_0x3a2d1e[_0x3eca('0x4c')]));_0x131b65[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x51'),_0x3a2d1e['dataValues']));_0x131b65[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x4e'),_0x3a2d1e[_0x3eca('0x4c')]));_0x131b65[_0x3eca('0x4a')](get_open_tabs('mail',_0x3a2d1e[_0x3eca('0x4c')]));return BPromise[_0x3eca('0x52')](_0x131b65);}else{return values;}})[_0x3eca('0x1a')](function(){return values;})[_0x3eca('0x1a')](respondWithResult(_0x26209c,null))[_0x3eca('0x25')](handleError(_0x26209c,null));};exports['update']=function(_0x5798d6,_0x2c4e1d){if(_0x5798d6[_0x3eca('0x5f')]['id']){delete _0x5798d6[_0x3eca('0x5f')]['id'];}delete _0x5798d6[_0x3eca('0x5f')]['role'];return db[_0x3eca('0x43')][_0x3eca('0x3a')]({'where':{'id':_0x5798d6[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x2c4e1d,null))[_0x3eca('0x1a')](saveUpdates(_0x5798d6[_0x3eca('0x5f')],null))[_0x3eca('0x1a')](respondWithResult(_0x2c4e1d,null))[_0x3eca('0x25')](handleError(_0x2c4e1d,null));};exports[_0x3eca('0x60')]=function(_0x179f0b,_0x3d0563){return db[_0x3eca('0x43')][_0x3eca('0x60')]()['then'](respondWithResult(_0x3d0563,null))[_0x3eca('0x25')](handleError(_0x3d0563,null));};exports[_0x3eca('0x61')]=function(_0x1aa654,_0x30c80c){return db[_0x3eca('0x43')][_0x3eca('0x3a')]({'where':{'id':_0x1aa654[_0x3eca('0x53')]['id']}})['then'](handleEntityNotFound(_0x30c80c,null))[_0x3eca('0x1a')](function(_0x4d7e65){if(_0x4d7e65){return _0x4d7e65[_0x3eca('0x61')](_0x1aa654[_0x3eca('0x5f')]['ids'],_[_0x3eca('0x62')](_0x1aa654[_0x3eca('0x5f')],[_0x3eca('0x63'),'id'])||{});}})[_0x3eca('0x1a')](respondWithResult(_0x30c80c,null))[_0x3eca('0x25')](handleError(_0x30c80c,null));};function validateUser(_0x19661c){return new BPromise(function(_0xe50eeb,_0x739249){if(_0x19661c[_0x3eca('0x64')])return _0xe50eeb(_0x19661c);return db['Setting'][_0x3eca('0x65')](0x1)[_0x3eca('0x1a')](function(_0x466f64){if(_0x466f64[_0x3eca('0x66')])authService[_0x3eca('0x67')](_0x19661c[_0x3eca('0x41')]);db[_0x3eca('0x43')][_0x3eca('0x68')](_0x3eca('0x64'))[_0x3eca('0x1a')](function(_0x214b75){if(_[_0x3eca('0x69')](_0x214b75)){_0x19661c[_0x3eca('0x64')]=_0x466f64['min_internal']||0x1;return;}if(_[_0x3eca('0x69')](_0x466f64['min_internal'])||_0x466f64[_0x3eca('0x6a')]===_0x214b75){_0x19661c[_0x3eca('0x64')]=_0x214b75+0x1;return;}if(_0x466f64[_0x3eca('0x6a')]>_0x214b75){_0x19661c[_0x3eca('0x64')]=_0x466f64[_0x3eca('0x6a')];return;}return db[_0x3eca('0x6b')][_0x3eca('0x45')](_0x3eca('0x6c'),{'type':db[_0x3eca('0x6b')]['QueryTypes'][_0x3eca('0x6d')]})[_0x3eca('0x1a')](function(_0x3f0cc4){if(_0x3f0cc4&&_0x3f0cc4[_0x3eca('0x5b')]){for(var _0x181af1=0x0,_0xca66c7=_0x3f0cc4[_0x3eca('0x5b')];_0x181af1<_0xca66c7&&_[_0x3eca('0x69')](_0x19661c[_0x3eca('0x64')]);_0x181af1++){if(_0x466f64[_0x3eca('0x6a')]<=_0x3f0cc4[_0x181af1]['from']){_0x19661c[_0x3eca('0x64')]=_0x3f0cc4[_0x181af1][_0x3eca('0x6e')];}else if(_0x466f64['min_internal']>_0x3f0cc4[_0x181af1][_0x3eca('0x6e')]&&_0x466f64[_0x3eca('0x6a')]<=_0x3f0cc4[_0x181af1]['to']){_0x19661c['internal']=_0x466f64['min_internal'];}}}if(_[_0x3eca('0x69')](_0x19661c[_0x3eca('0x64')])){_0x19661c[_0x3eca('0x64')]=_0x214b75+0x1;}return _0xe50eeb(_0x19661c);});});})[_0x3eca('0x25')](function(_0x346f6d){_0x739249(_0x346f6d);});});}function updateUser(_0x1e6377){return new BPromise(function(_0x114d8f,_0x27b9c3){try{if(_0x1e6377[_0x3eca('0x6f')]){_0x1e6377[_0x3eca('0x70')]=_0x1e6377[_0x3eca('0x64')];_0x1e6377['VoiceMail']={'mailbox':_0x1e6377['internal'],'password':_0x1e6377[_0x3eca('0x41')],'fullname':_0x1e6377['fullname'],'email':_0x1e6377[_0x3eca('0x71')]};}if(_0x1e6377[_0x3eca('0x32')]===_0x3eca('0x35')){if(!_0x1e6377[_0x3eca('0x72')])_0x1e6377[_0x3eca('0x72')]=['101',_0x3eca('0x73'),'103',_0x3eca('0x74'),_0x3eca('0x75'),_0x3eca('0x76'),_0x3eca('0x77'),_0x3eca('0x78'),'107',_0x3eca('0x79'),_0x3eca('0x7a'),_0x3eca('0x7b'),_0x3eca('0x7c'),_0x3eca('0x7d'),_0x3eca('0x7e')];}_0x114d8f(_0x1e6377);}catch(_0x39ffa0){_0x27b9c3(_0x39ffa0);}});}exports[_0x3eca('0x7f')]=function(_0x3f7bbf,_0x4c934c){if(_0x3f7bbf[_0x3eca('0x34')][_0x3eca('0x32')]===_0x3eca('0x35'))throw new Error(_0x3eca('0x80'));if(_0x3f7bbf['body'][_0x3eca('0x32')]===_0x3eca('0x34')&&_0x3f7bbf[_0x3eca('0x34')][_0x3eca('0x32')]!==_0x3eca('0x81')){throw new Error(_0x3eca('0x82'));}if(_0x3f7bbf['body'][_0x3eca('0x32')]==='admin'&&_0x3f7bbf['user'][_0x3eca('0x32')]!==_0x3eca('0x81')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x3f7bbf[_0x3eca('0x5f')]])[_0x3eca('0x1a')](function(){return validateUser(_0x3f7bbf[_0x3eca('0x5f')]);})[_0x3eca('0x1a')](function(_0x102a41){return updateUser(_0x102a41)[_0x3eca('0x1a')](function(_0x5817fa){if(_0x5817fa['role']===_0x3eca('0x81')){_0x5817fa['settingsEnabled']=_0x3f7bbf[_0x3eca('0x34')][_0x3eca('0x83')];delete _0x5817fa[_0x3eca('0x84')];}return _0x5817fa;});})['then'](function(_0xa8a2e4){return db[_0x3eca('0x43')]['create'](_0xa8a2e4,{'include':[{'model':db['VoiceMail'],'as':_0x3eca('0x85')}]});})[_0x3eca('0x1a')](function(_0x409992){if(_0x3f7bbf[_0x3eca('0x5f')][_0x3eca('0x32')]===_0x3eca('0x34'))return _0x409992;if(_0x3f7bbf[_0x3eca('0x34')][_0x3eca('0x32')]!=='user')return _0x409992;return db[_0x3eca('0x86')]['find']({'where':{'name':_0x409992['role']===_0x3eca('0x35')?_0x3eca('0x87'):_0x3eca('0x36'),'userProfileId':_0x3f7bbf[_0x3eca('0x34')]['userProfileId']},'raw':!![]})[_0x3eca('0x1a')](function(_0x373efa){if(!_0x373efa||_0x373efa[_0x3eca('0x88')]!=0x0)return _0x409992;return db[_0x3eca('0x3c')][_0x3eca('0x7f')]({'name':_0x409992[_0x3eca('0x3b')],'resourceId':_0x409992['id'],'type':_0x373efa['name'],'sectionId':_0x373efa['id']},{})[_0x3eca('0x1a')](function(){return _0x409992;});})[_0x3eca('0x25')](function(_0x49d3ca){logger[_0x3eca('0x21')](_0x3eca('0x89'),_0x49d3ca);throw _0x49d3ca;});})['then'](respondWithResult(_0x4c934c,0xc9))[_0x3eca('0x25')](handleError(_0x4c934c,null));};exports[_0x3eca('0x8a')]=function(_0xdd8960,_0xb635a2){var _0x342695=_0xdd8960['body'];var _0x1113b4=[];if(_0xdd8960['user'][_0x3eca('0x32')]==='agent')throw new Error(_0x3eca('0x80'));if(_['some'](_0x342695,[_0x3eca('0x32'),_0x3eca('0x34')])&&_0xdd8960[_0x3eca('0x34')][_0x3eca('0x32')]!==_0x3eca('0x81')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x342695,[_0x3eca('0x32'),_0x3eca('0x81')])&&_0xdd8960[_0x3eca('0x34')][_0x3eca('0x32')]!==_0x3eca('0x81')){throw new Error(_0x3eca('0x8b'));}return licenseUtil[_0x3eca('0x8c')](_0x342695)['then'](function(){return validateUser(_0x342695[0x0]);})[_0x3eca('0x1a')](function(){for(var _0x38993b=0x1;_0x38993b<_0x342695[_0x3eca('0x5b')];_0x38993b++){var _0x431139=_0x342695[_0x38993b-0x1][_0x3eca('0x64')];if(!_0x342695[_0x38993b][_0x3eca('0x64')])_0x342695[_0x38993b][_0x3eca('0x64')]=_0x431139+0x1;_0x1113b4[_0x3eca('0x4a')](validateUser(_0x342695[_0x38993b]));}return BPromise[_0x3eca('0x52')](_0x1113b4);})[_0x3eca('0x1a')](function(){_0x1113b4=[];for(var _0x5d8f01=0x0;_0x5d8f01<_0x342695[_0x3eca('0x5b')];_0x5d8f01++){_0x1113b4[_0x3eca('0x4a')](updateUser(_0x342695[_0x5d8f01]));}return BPromise['all'](_0x1113b4);})['then'](function(){return BPromise[_0x3eca('0x8d')](_0x342695,function(_0x2d2e72){return db['User']['create'](_0x2d2e72,{'include':[{'model':db['VoiceMail'],'as':_0x3eca('0x85')}]})[_0x3eca('0x1a')](function(_0xce2440){_0x2d2e72['id']=_0xce2440['id'];return _0x2d2e72;});});})[_0x3eca('0x1a')](function(_0x261b24){if(_0xdd8960[_0x3eca('0x5f')][_0x3eca('0x32')]===_0x3eca('0x34'))return _0x261b24;if(_0xdd8960[_0x3eca('0x34')][_0x3eca('0x32')]!==_0x3eca('0x34'))return _0x261b24;var _0x5ca0bf=_[_0x3eca('0x8e')](_0x261b24,function(_0x1999c4){return _0x1999c4[_0x3eca('0x32')]==='agent'||_0x1999c4[_0x3eca('0x32')]==='telephone';});if(!_0x5ca0bf)return _0x261b24;return db[_0x3eca('0x86')][_0x3eca('0x8f')]({'where':{'name':{'$or':[_0x3eca('0x87'),_0x3eca('0x36')]},'userProfileId':_0xdd8960[_0x3eca('0x34')]['userProfileId']},'raw':!![]})['then'](function(_0x5b40b6){if(_[_0x3eca('0x90')](_0x5b40b6)||!_[_0x3eca('0x8e')](_0x5b40b6,[_0x3eca('0x88'),0x0]))return _0x261b24;_0x1113b4=[];var _0x2ed0ef=_(_0x5b40b6)['map'](function(_0x1e4ba5){if(_0x1e4ba5['autoAssociation']===0x1)return;return _0x1e4ba5['name']===_0x3eca('0x87')?'agent':'telephone';})[_0x3eca('0x91')]()['value']();for(var _0x23caec=0x0;_0x23caec<_0x261b24['length'];_0x23caec++){if(!_[_0x3eca('0x40')](_0x2ed0ef,_0x261b24[_0x23caec][_0x3eca('0x32')]))return;var _0x2ee13b=_0x261b24[_0x23caec][_0x3eca('0x32')]===_0x3eca('0x35')?_0x3eca('0x87'):_0x3eca('0x36');_0x1113b4[_0x3eca('0x4a')](db[_0x3eca('0x3c')][_0x3eca('0x7f')]({'name':_0x261b24[_0x23caec][_0x3eca('0x3b')],'resourceId':_0x261b24[_0x23caec]['id'],'type':_0x2ee13b,'sectionId':_['find'](_0x5b40b6,[_0x3eca('0x3b'),_0x2ee13b])['id']},{}));}return BPromise[_0x3eca('0x52')](_0x1113b4);});})[_0x3eca('0x1a')](respondWithResult(_0xb635a2,0xc9))[_0x3eca('0x25')](handleError(_0xb635a2,null));};exports['changePassword']=function(_0x11af4b,_0x50653f){if(_0x11af4b[_0x3eca('0x5f')]['id']){delete _0x11af4b[_0x3eca('0x5f')]['id'];}return db[_0x3eca('0x43')][_0x3eca('0x3a')]({'where':{'id':_0x11af4b[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](function(_0x416d27){if(!_0x416d27)return null;if(_0x416d27['id']===_0x11af4b[_0x3eca('0x34')]['id']){if(!_0x11af4b[_0x3eca('0x5f')][_0x3eca('0x92')]||!_0x11af4b[_0x3eca('0x5f')]['newPassword']){throw new db['Sequelize'][(_0x3eca('0x93'))](_0x3eca('0x94'));}if(!_0x416d27[_0x3eca('0x95')](_0x11af4b[_0x3eca('0x5f')][_0x3eca('0x92')])){throw new db[(_0x3eca('0x96'))][(_0x3eca('0x93'))](_0x3eca('0x97'));}if(_0x11af4b['body']['oldPassword']===_0x11af4b[_0x3eca('0x5f')][_0x3eca('0x98')]){throw new db[(_0x3eca('0x96'))][(_0x3eca('0x93'))](_0x3eca('0x99'));}}else if(_0x11af4b['user'][_0x3eca('0x32')]===_0x3eca('0x81')){if(!_0x11af4b[_0x3eca('0x5f')][_0x3eca('0x98')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x11af4b[_0x3eca('0x34')][_0x3eca('0x32')]===_0x3eca('0x34')){if(!_0x11af4b[_0x3eca('0x5f')][_0x3eca('0x98')]){throw new db[(_0x3eca('0x96'))][(_0x3eca('0x93'))](_0x3eca('0x9a'));}if(_0x416d27[_0x3eca('0x32')]!==_0x3eca('0x35')){throw new db['Sequelize']['ValidationError'](_0x3eca('0x80'));}}else{throw new db['Sequelize'][(_0x3eca('0x93'))](_0x3eca('0x80'));}return _0x416d27;})[_0x3eca('0x1a')](handleEntityNotFound(_0x50653f,null))[_0x3eca('0x1a')](function(_0x54c804){return db['Setting'][_0x3eca('0x9b')]({'attributes':['id',_0x3eca('0x66'),_0x3eca('0x9c'),'passwordHistoryLimit']})[_0x3eca('0x1a')](function(_0x16119d){if(_0x16119d[_0x3eca('0x66')])authService['validatePasswordPattern'](_0x11af4b['body'][_0x3eca('0x98')]);if(!_0x16119d['enforcePasswordHistory']||!_0x54c804[_0x3eca('0x9d')])return _0x54c804;authService[_0x3eca('0x9e')](_0x11af4b[_0x3eca('0x5f')][_0x3eca('0x98')],_0x54c804[_0x3eca('0x9d')],_0x16119d[_0x3eca('0x9f')]);return _0x54c804;})[_0x3eca('0x1a')](saveUpdates({'password':_0x11af4b[_0x3eca('0x5f')]['newPassword'],'passwordResetAt':_0x11af4b['user']['id']==_0x11af4b[_0x3eca('0x53')]['id']?moment():null,'previousPasswords':authService[_0x3eca('0xa0')](_0x11af4b['body']['newPassword'],_0x54c804[_0x3eca('0x9d')])},null));})[_0x3eca('0x1a')](respondWithResult(_0x50653f,null))[_0x3eca('0x25')](handleError(_0x50653f,null));};exports[_0x3eca('0xa1')]=function(_0x5c37b5,_0x421013){var _0x5aa1ce=_0x5c37b5[_0x3eca('0x5f')][_0x3eca('0xa2')];return db['User'][_0x3eca('0x3a')]({'where':{'id':_0x5c37b5[_0x3eca('0x53')]['id']},'attributes':['id',_0x3eca('0x3b'),_0x3eca('0x32'),'online','loginInPause','voicePause',_0x3eca('0xa3')]})[_0x3eca('0x1a')](handleEntityNotFound(_0x421013,null))[_0x3eca('0x1a')](function(_0x3c055e){if(_0x3c055e){if(!utils[_0x3eca('0xa4')](_0x5aa1ce)){throw new db[(_0x3eca('0x96'))]['ValidationError'](_0x3eca('0xa5'));}return _0x3c055e[_0x3eca('0xa6')+_[_0x3eca('0xa7')](_0x5aa1ce[_0x3eca('0xa8')]())+'Queues'](_0x5c37b5[_0x3eca('0x5f')][_0x3eca('0x63')],{'penalty':_0x5c37b5['body']['penalty']||0x0})[_0x3eca('0xa9')](function(_0xbb1170){for(var _0x3f1fd3=0x0;_0x3f1fd3<_0x5c37b5['body'][_0x3eca('0x63')]['length'];_0x3f1fd3+=0x1){var _0x1fdda7={'UserId':Number(_0x5c37b5[_0x3eca('0x53')]['id'])};_0x1fdda7[_['capitalize'](_0x5aa1ce[_0x3eca('0xa8')]())+_0x3eca('0xaa')]=Number(_0x5c37b5[_0x3eca('0x5f')]['ids'][_0x3f1fd3]);socket[_0x3eca('0x30')](_0x3eca('0x34')+_[_0x3eca('0xa7')](_0x5aa1ce[_0x3eca('0xa8')]())+_0x3eca('0xab'),_0x1fdda7);}return _0xbb1170;})[_0x3eca('0x1a')](function(){if(_0x5aa1ce===_0x3eca('0xac')){return db['VoiceQueue'][_0x3eca('0x8f')]({'where':{'id':_0x5c37b5['body']['ids']||[]},'raw':!![],'attributes':['id',_0x3eca('0x3b')]});}})[_0x3eca('0x1a')](function(_0x300356){var _0x918c2f=_0x3c055e[_0x3eca('0xad')]({'plain':!![]});var _0x4c86a3=[];if(_0x5aa1ce===_0x3eca('0xac')&&_0x918c2f[_0x3eca('0x32')]==='agent'&&_0x918c2f[_0x3eca('0xae')]){for(var _0x362c47=0x0;_0x362c47<_0x300356[_0x3eca('0x5b')];_0x362c47+=0x1){_0x4c86a3['push']({'membername':_0x918c2f[_0x3eca('0x3b')],'UserId':_0x918c2f['id'],'queue_name':_0x300356[_0x362c47][_0x3eca('0x3b')],'VoiceQueueId':_0x300356[_0x362c47]['id'],'interface':_[_0x3eca('0x69')](_0x918c2f[_0x3eca('0xa3')])?util[_0x3eca('0xaf')](_0x3eca('0xb0'),_0x918c2f['name']):_0x918c2f[_0x3eca('0xa3')],'paused':_0x918c2f[_0x3eca('0xb1')]||![],'penalty':_0x5c37b5[_0x3eca('0x5f')][_0x3eca('0xb2')]||0x0});}return BPromise[_0x3eca('0x8d')](_0x4c86a3,function(_0x1948ad){return db[_0x3eca('0xb3')][_0x3eca('0xb4')](_0x1948ad);});}return _0x3c055e;});}})['then'](respondWithStatusCode(_0x421013,null))[_0x3eca('0x25')](handleError(_0x421013,null));};exports[_0x3eca('0xb5')]=function(_0x30d623,_0x375390){var _0xd6cce1,_0x5b79d7;return db['User'][_0x3eca('0x3a')]({'where':{'id':_0x30d623[_0x3eca('0x53')]['id']},'attributes':['id',_0x3eca('0x3b'),_0x3eca('0x32')]})[_0x3eca('0x1a')](handleEntityNotFound(_0x375390,null))[_0x3eca('0x1a')](function(_0x36f432){if(_0x36f432){_0xd6cce1=_0x36f432;if(!_0x30d623['query']['channel']||!utils[_0x3eca('0xa4')](_0x30d623[_0x3eca('0x45')]['channel'])){throw new db[(_0x3eca('0x96'))][(_0x3eca('0x93'))](_0x3eca('0xa5'));}return _0x36f432[_0x3eca('0xb6')+_[_0x3eca('0xa7')](_0x30d623['query'][_0x3eca('0xa2')][_0x3eca('0xa8')]())+_0x3eca('0xb7')](_0x30d623['query']['ids']);}})[_0x3eca('0x1a')](function(_0x3bc04f){if(_[_0x3eca('0xb8')](_0x30d623[_0x3eca('0x45')][_0x3eca('0x63')])){for(var _0x10f04a=0x0;_0x10f04a<_0x30d623[_0x3eca('0x45')]['ids'][_0x3eca('0x5b')];_0x10f04a+=0x1){_0x5b79d7={'UserId':Number(_0x30d623[_0x3eca('0x53')]['id'])};_0x5b79d7[_[_0x3eca('0xa7')](_0x30d623[_0x3eca('0x45')][_0x3eca('0xa2')][_0x3eca('0xa8')]())+_0x3eca('0xaa')]=Number(_0x30d623['query']['ids'][_0x10f04a]);socket['emit']('user'+_['capitalize'](_0x30d623[_0x3eca('0x45')]['channel'][_0x3eca('0xa8')]())+'Queue:remove',_0x5b79d7);}}else{_0x5b79d7={'UserId':Number(_0x30d623[_0x3eca('0x53')]['id'])};_0x5b79d7[_[_0x3eca('0xa7')](_0x30d623[_0x3eca('0x45')][_0x3eca('0xa2')][_0x3eca('0xa8')]())+_0x3eca('0xaa')]=Number(_0x30d623[_0x3eca('0x45')][_0x3eca('0x63')]);socket[_0x3eca('0x30')]('user'+_['capitalize'](_0x30d623[_0x3eca('0x45')][_0x3eca('0xa2')][_0x3eca('0xa8')]())+_0x3eca('0xb9'),_0x5b79d7);}return _0x3bc04f;})['then'](function(){if(_0x30d623[_0x3eca('0x45')][_0x3eca('0xa2')]===_0x3eca('0xac')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x30d623['params']['id'],'VoiceQueueId':_0x30d623[_0x3eca('0x45')]['ids']},'individualHooks':!![]})['then'](function(){return _0xd6cce1;});}return _0xd6cce1;})[_0x3eca('0x1a')](respondWithStatusCode(_0x375390,null))[_0x3eca('0x25')](handleError(_0x375390,null));};exports['addAvatar']=function(_0x2a1d4e,_0x322e55){_0x2a1d4e[_0x3eca('0x5f')][_0x3eca('0xba')]=_0x2a1d4e[_0x3eca('0xbb')][_0x3eca('0xbc')];return db['User']['find']({'where':{'id':_0x2a1d4e[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x322e55,null))[_0x3eca('0x1a')](saveUpdates(_0x2a1d4e[_0x3eca('0x5f')],null))[_0x3eca('0x1a')](respondWithResult(_0x322e55,null))[_0x3eca('0x25')](handleError(_0x322e55,null));};exports[_0x3eca('0xbd')]=function(_0x172995,_0x3958b1){var _0x6f8537=path['join'](config[_0x3eca('0xbe')],_0x3eca('0xbf'));return db['User'][_0x3eca('0x3a')]({'where':{'id':_0x172995[_0x3eca('0x53')]['id']},'attributes':['id',_0x3eca('0xba')],'raw':!![]})[_0x3eca('0x1a')](handleEntityNotFound(_0x3958b1,null))['then'](function(_0x1d81e9){if(_0x1d81e9){if(_[_0x3eca('0x69')](_0x1d81e9['userpic'])){return _0x3958b1[_0x3eca('0xc0')](_0x6f8537);}else{if(!fs[_0x3eca('0xc1')](path[_0x3eca('0xc2')](config[_0x3eca('0xbe')],_0x3eca('0xc3'),_0x1d81e9[_0x3eca('0xba')]))){return _0x3958b1[_0x3eca('0xc0')](_0x6f8537);}return _0x3958b1[_0x3eca('0xc0')](path['join'](config[_0x3eca('0xbe')],_0x3eca('0xc3'),_0x1d81e9[_0x3eca('0xba')]));}}})[_0x3eca('0x25')](handleError(_0x3958b1,null));};exports[_0x3eca('0xc4')]=function(_0x3277f1,_0x55e2f4){return db[_0x3eca('0x43')][_0x3eca('0x3a')]({'where':{'id':_0x3277f1[_0x3eca('0x53')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x55e2f4,null))['then'](function(_0xc2fba4){var _0x381d85=[];values=_0xc2fba4['dataValues'];_0x381d85[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x4b'),_0xc2fba4[_0x3eca('0x4c')]));_0x381d85[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x5e'),_0xc2fba4['dataValues']));_0x381d85['push'](get_open_tabs(_0x3eca('0x50'),_0xc2fba4['dataValues']));_0x381d85['push'](get_open_tabs(_0x3eca('0x51'),_0xc2fba4[_0x3eca('0x4c')]));_0x381d85[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x4e'),_0xc2fba4[_0x3eca('0x4c')]));_0x381d85[_0x3eca('0x4a')](get_open_tabs(_0x3eca('0x4f'),_0xc2fba4[_0x3eca('0x4c')]));return BPromise[_0x3eca('0x52')](_0x381d85);})[_0x3eca('0x1a')](function(_0xa158d9){if(_0xa158d9){var _0x1ba29f=_['map'](values[_0x3eca('0xc5')],function(_0xfb1841){return{'channel':'CHAT','id':_0xfb1841['id'],'createdAt':_0xfb1841['createdAt']};});var _0x174f95=_['map'](values[_0x3eca('0xc6')],function(_0x436d83){return{'channel':_0x3eca('0xc7'),'id':_0x436d83['id'],'createdAt':_0x436d83['createdAt']};});var _0x22f9cf=_[_0x3eca('0x38')](values[_0x3eca('0xc8')],function(_0x5db746){return{'channel':_0x3eca('0xc9'),'id':_0x5db746['id'],'createdAt':_0x5db746[_0x3eca('0xca')]};});var _0x1cd57e=_[_0x3eca('0x38')](values['MailOpenTabs'],function(_0x30cc3c){return{'channel':_0x3eca('0xcb'),'id':_0x30cc3c['id'],'createdAt':_0x30cc3c[_0x3eca('0xca')]};});var _0x2ad152=_[_0x3eca('0x38')](values[_0x3eca('0xcc')],function(_0x155302){return{'channel':_0x3eca('0xcd'),'id':_0x155302['id'],'createdAt':_0x155302['createdAt']};});var _0x3f5683=_[_0x3eca('0x38')](values[_0x3eca('0xce')],function(_0x18acff){return{'channel':_0x3eca('0xcf'),'id':_0x18acff['id'],'createdAt':_0x18acff['createdAt']};});var _0x334d28=_[_0x3eca('0xd0')](_0x1ba29f,_0x174f95,_0x22f9cf,_0x1cd57e,_0x2ad152,_0x3f5683);var _0x1f01f5={'count':_0x334d28[_0x3eca('0x5b')],'rows':_0x334d28};return _0x1f01f5;}else return null;})[_0x3eca('0x1a')](respondWithResult(_0x55e2f4,null))[_0x3eca('0x25')](handleError(_0x55e2f4,null));};exports[_0x3eca('0xd1')]=function(_0x19a5d1,_0x25e531){var _0x1636e9={};var _0x57d635={};var _0xee9aad;var _0x25f763;return db['User'][_0x3eca('0x9b')]({'where':{'id':_0x19a5d1[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x25e531,null))[_0x3eca('0x1a')](function(_0x3dbc89){if(_0x3dbc89){_0xee9aad=_0x3dbc89;_0x57d635[_0x3eca('0x54')]=_[_0x3eca('0x57')](db['CmContact']['rawAttributes']);_0x57d635[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x19a5d1['query']);_0x57d635['filters']=_[_0x3eca('0x59')](_0x57d635[_0x3eca('0x54')],_0x57d635['query']);_0x1636e9[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x57d635[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x19a5d1['query'][_0x3eca('0x5a')]));_0x1636e9[_0x3eca('0x47')]=_0x1636e9[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x1636e9[_0x3eca('0x47')]:_0x57d635[_0x3eca('0x54')];_0x1636e9[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x19a5d1[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x1636e9[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x19a5d1[_0x3eca('0x45')],_0x57d635[_0x3eca('0x58')]));if(_0x19a5d1[_0x3eca('0x45')]['filter']){_0x1636e9['where']=_[_0x3eca('0xd5')](_0x1636e9[_0x3eca('0x42')],{'$or':_['map'](_0x1636e9[_0x3eca('0x47')],function(_0x51f3c2){var _0x4f3e0c={};_0x4f3e0c[_0x51f3c2]={'$like':'%'+_0x19a5d1[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x4f3e0c;})});}_0x1636e9=_[_0x3eca('0xd5')]({},_0x1636e9,_0x19a5d1[_0x3eca('0x5d')]);return _0xee9aad[_0x3eca('0xd1')](_0x1636e9);}})[_0x3eca('0x1a')](function(_0x40e725){if(_0x40e725){_0x25f763=_0x40e725[_0x3eca('0x5b')];if(_0x19a5d1['query']['hasOwnProperty']('includeAll')){_0x1636e9['include']=[{'model':db[_0x3eca('0xd6')],'as':_0x3eca('0xd7'),'required':![]},{'model':db[_0x3eca('0xd8')],'as':_0x3eca('0xd9'),'attributes':['id',_0x3eca('0x3b'),_0x3eca('0xda')],'where':_0x19a5d1['query'][_0x3eca('0xdb')]?{'id':_0x19a5d1['query'][_0x3eca('0xdb')]}:undefined,'required':_0x19a5d1['query'][_0x3eca('0xdb')]?!![]:![]}];}if(!_0x19a5d1[_0x3eca('0x45')]['hasOwnProperty']('nolimit')){_0x1636e9['limit']=qs[_0x3eca('0x2b')](_0x19a5d1['query'][_0x3eca('0x2b')]);_0x1636e9[_0x3eca('0x29')]=qs['offset'](_0x19a5d1[_0x3eca('0x45')]['offset']);}return _0xee9aad[_0x3eca('0xd1')](_0x1636e9);}})['then'](function(_0x16b26a){if(_0x16b26a){return _0x16b26a?{'count':_0x25f763,'rows':_0x16b26a}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x25e531,null))['catch'](handleError(_0x25e531,null));};exports[_0x3eca('0xdc')]=function(_0x2eb64a,_0x4347ed){var _0x2cb590;var _0x4d1a36={};var _0x20125e;return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x2eb64a['params']['id']},'attributes':['id',_0x3eca('0x3b'),_0x3eca('0x32')]})[_0x3eca('0x1a')](handleEntityNotFound(_0x4347ed,null))['then'](function(_0x28c6db){if(!utils[_0x3eca('0xa4')](_0x2eb64a[_0x3eca('0x45')][_0x3eca('0xa2')])){throw new db[(_0x3eca('0x96'))]['ValidationError'](_0x3eca('0xa5'));}_0x2cb590=_0x28c6db;var _0x546261={};_0x546261[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_['capitalize'](_0x2eb64a[_0x3eca('0x45')]['channel'])+'Queue'][_0x3eca('0x55')]);_0x546261[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x2eb64a[_0x3eca('0x45')]);_0x546261[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x546261['model'],_0x546261['query']);_0x4d1a36[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x546261[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x2eb64a[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x4d1a36[_0x3eca('0x47')]=_0x4d1a36[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x4d1a36[_0x3eca('0x47')]:_0x546261[_0x3eca('0x54')];_0x4d1a36[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x2eb64a[_0x3eca('0x45')]['sort']);_0x4d1a36['where']=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x2eb64a[_0x3eca('0x45')],_0x546261[_0x3eca('0x58')]));if(_0x2eb64a['query'][_0x3eca('0x37')]){_0x4d1a36[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x4d1a36[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x4d1a36[_0x3eca('0x47')],function(_0x367978){var _0x1f5d5f={};_0x1f5d5f[_0x367978]={'$like':'%'+_0x2eb64a['query']['filter']+'%'};return _0x1f5d5f;})});}_0x4d1a36=_[_0x3eca('0xd5')]({},_0x4d1a36,_0x2eb64a[_0x3eca('0x5d')]);switch(_0x2cb590['role']){case _0x3eca('0x81'):return db[_[_0x3eca('0xa7')](_0x2eb64a[_0x3eca('0x45')]['channel'])+_0x3eca('0xdd')]['findAll'](_0x4d1a36);case _0x3eca('0x34'):case _0x3eca('0x35'):return _0x2cb590['get'+_[_0x3eca('0xa7')](_0x2eb64a['query'][_0x3eca('0xa2')])+_0x3eca('0xb7')](_0x4d1a36);default:throw new db['Sequelize'][(_0x3eca('0x93'))](_0x3eca('0xde'));}})[_0x3eca('0x1a')](function(_0x5f34a6){_0x20125e=_0x5f34a6[_0x3eca('0x5b')];if(!_0x2eb64a['query'][_0x3eca('0xdf')](_0x3eca('0xe0'))){_0x4d1a36[_0x3eca('0x2b')]=qs['limit'](_0x2eb64a[_0x3eca('0x45')][_0x3eca('0x2b')]);_0x4d1a36[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x2eb64a[_0x3eca('0x45')][_0x3eca('0x29')]);}switch(_0x2cb590[_0x3eca('0x32')]){case _0x3eca('0x81'):return db[_[_0x3eca('0xa7')](_0x2eb64a['query'][_0x3eca('0xa2')])+'Queue'][_0x3eca('0x8f')](_0x4d1a36);case _0x3eca('0x34'):case'agent':return _0x2cb590[_0x3eca('0xad')+_['capitalize'](_0x2eb64a['query'][_0x3eca('0xa2')])+_0x3eca('0xb7')](_0x4d1a36);}})[_0x3eca('0x1a')](function(_0xc4a13){return{'count':_0x20125e,'rows':_0xc4a13};})[_0x3eca('0x1a')](respondWithResult(_0x4347ed,null))['catch'](handleError(_0x4347ed,null));};exports[_0x3eca('0xe1')]=function(_0x919b40,_0x1071be){var _0x180c3f={};var _0x5d96db={};var _0x4699c5;var _0x508f2b;return db['User'][_0x3eca('0x9b')]({'where':{'id':_0x919b40[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x1071be,null))[_0x3eca('0x1a')](function(_0x1adbcc){if(_0x1adbcc){_0x4699c5=_0x1adbcc;_0x5d96db[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xb3')]['rawAttributes']);_0x5d96db[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x919b40[_0x3eca('0x45')]);_0x5d96db[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x5d96db[_0x3eca('0x54')],_0x5d96db[_0x3eca('0x45')]);_0x180c3f['attributes']=_[_0x3eca('0x59')](_0x5d96db['model'],qs[_0x3eca('0x5a')](_0x919b40[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x180c3f[_0x3eca('0x47')]=_0x180c3f[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x180c3f['attributes']:_0x5d96db[_0x3eca('0x54')];_0x180c3f[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x919b40[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x180c3f[_0x3eca('0x42')]=qs['filters'](_[_0x3eca('0xd4')](_0x919b40[_0x3eca('0x45')],_0x5d96db[_0x3eca('0x58')]));if(_0x919b40[_0x3eca('0x45')][_0x3eca('0x37')]){_0x180c3f['where']=_[_0x3eca('0xd5')](_0x180c3f['where'],{'$or':_[_0x3eca('0x38')](_0x180c3f[_0x3eca('0x47')],function(_0x2f44dd){var _0x4c247d={};_0x4c247d[_0x2f44dd]={'$like':'%'+_0x919b40['query'][_0x3eca('0x37')]+'%'};return _0x4c247d;})});}_0x180c3f=_[_0x3eca('0xd5')]({},_0x180c3f,_0x919b40['options']);return _0x4699c5['getVoiceQueuesRt'](_0x180c3f);}})[_0x3eca('0x1a')](function(_0x1096da){if(_0x1096da){_0x508f2b=_0x1096da[_0x3eca('0x5b')];if(!_0x919b40[_0x3eca('0x45')][_0x3eca('0xdf')](_0x3eca('0xe0'))){_0x180c3f[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x919b40['query'][_0x3eca('0x2b')]);_0x180c3f[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x919b40[_0x3eca('0x45')][_0x3eca('0x29')]);}return _0x4699c5['getVoiceQueuesRt'](_0x180c3f);}})[_0x3eca('0x1a')](function(_0x2a5b5){if(_0x2a5b5){return _0x2a5b5?{'count':_0x508f2b,'rows':_0x2a5b5}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x1071be,null))[_0x3eca('0x25')](handleError(_0x1071be,null));};exports[_0x3eca('0xe2')]=function(_0x78e372,_0x460178){var _0x5357c9={};var _0x5693d5={};var _0x9319ee;var _0x22fb84;return db[_0x3eca('0x43')]['findOne']({'where':{'id':_0x78e372[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x460178,null))[_0x3eca('0x1a')](function(_0x474b98){if(_0x474b98){_0x9319ee=_0x474b98;_0x5693d5[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xe3')][_0x3eca('0x55')]);_0x5693d5[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x78e372[_0x3eca('0x45')]);_0x5693d5[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x5693d5[_0x3eca('0x54')],_0x5693d5['query']);_0x5357c9[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x5693d5[_0x3eca('0x54')],qs['fields'](_0x78e372[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x5357c9[_0x3eca('0x47')]=_0x5357c9[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x5357c9['attributes']:_0x5693d5[_0x3eca('0x54')];_0x5357c9[_0x3eca('0xd2')]=qs['sort'](_0x78e372[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x5357c9['where']=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x78e372[_0x3eca('0x45')],_0x5693d5['filters']));if(_0x78e372[_0x3eca('0x45')][_0x3eca('0x37')]){_0x5357c9['where']=_[_0x3eca('0xd5')](_0x5357c9[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x5357c9[_0x3eca('0x47')],function(_0x29584a){var _0x274348={};_0x274348[_0x29584a]={'$like':'%'+_0x78e372[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x274348;})});}_0x5357c9=_[_0x3eca('0xd5')]({},_0x5357c9,_0x78e372['options']);return _0x9319ee[_0x3eca('0xe2')](_0x5357c9);}})[_0x3eca('0x1a')](function(_0x14ece0){if(_0x14ece0){_0x22fb84=_0x14ece0[_0x3eca('0x5b')];if(!_0x78e372[_0x3eca('0x45')][_0x3eca('0xdf')](_0x3eca('0xe0'))){_0x5357c9[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x78e372['query'][_0x3eca('0x2b')]);_0x5357c9[_0x3eca('0x29')]=qs['offset'](_0x78e372[_0x3eca('0x45')]['offset']);}return _0x9319ee[_0x3eca('0xe2')](_0x5357c9);}})['then'](function(_0x401d56){if(_0x401d56){return _0x401d56?{'count':_0x22fb84,'rows':_0x401d56}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x460178,null))[_0x3eca('0x25')](handleError(_0x460178,null));};exports['getRecordings']=function(_0x55c960,_0x3e8d9b){var _0x469d94={'raw':!![],'where':{}};var _0x43cfc2={};var _0x597cc0={'count':0x0,'rows':[]};return db[_0x3eca('0x43')]['findOne']({'where':{'id':_0x55c960[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x3e8d9b,null))[_0x3eca('0x1a')](function(_0x32cc9e){if(_0x32cc9e){_0x43cfc2[_0x3eca('0x54')]=_['keys'](db[_0x3eca('0xe4')][_0x3eca('0x55')]);_0x43cfc2[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x55c960[_0x3eca('0x45')]);_0x43cfc2[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x43cfc2['model'],_0x43cfc2[_0x3eca('0x45')]);_0x469d94[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x43cfc2[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x55c960[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x469d94[_0x3eca('0x47')]=_0x469d94[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x469d94[_0x3eca('0x47')]:_0x43cfc2[_0x3eca('0x54')];if(!_0x55c960[_0x3eca('0x45')]['hasOwnProperty'](_0x3eca('0xe0'))){_0x469d94['limit']=qs['limit'](_0x55c960[_0x3eca('0x45')][_0x3eca('0x2b')]);_0x469d94['offset']=qs[_0x3eca('0x29')](_0x55c960[_0x3eca('0x45')]['offset']);}_0x469d94[_0x3eca('0xd2')]=qs['sort'](_0x55c960['query']['sort']);_0x469d94['where']=qs['filters'](_['pick'](_0x55c960['query'],_0x43cfc2[_0x3eca('0x58')]));_0x469d94[_0x3eca('0x42')][_0x3eca('0xe5')]=_0x32cc9e['id'];if(_0x55c960['query']['filter']){_0x469d94['where']=_[_0x3eca('0xd5')](_0x469d94[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x469d94['attributes'],function(_0xb7b1b4){var _0x518e30={};_0x518e30[_0xb7b1b4]={'$like':'%'+_0x55c960[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x518e30;})});}_0x469d94=_[_0x3eca('0xd5')]({},_0x469d94,_0x55c960[_0x3eca('0x5d')]);return db[_0x3eca('0xe4')][_0x3eca('0x2c')]({'where':_0x469d94[_0x3eca('0x42')]})[_0x3eca('0x1a')](function(_0x353493){_0x597cc0[_0x3eca('0x2c')]=_0x353493;if(_0x55c960['query']['includeAll']){_0x469d94[_0x3eca('0x5c')]=[{'all':!![]}];}return db[_0x3eca('0xe4')][_0x3eca('0x8f')](_0x469d94);})[_0x3eca('0x1a')](function(_0x26c72d){_0x597cc0[_0x3eca('0x4d')]=_0x26c72d;return _0x597cc0;});}})['then'](respondWithFilteredResult(_0x3e8d9b,_0x469d94))[_0x3eca('0x25')](handleError(_0x3e8d9b,null));};exports[_0x3eca('0xe6')]=function(_0x428ed3,_0xf3fd15){var _0x11372d={'raw':!![],'where':{}};var _0x1efd8b={};var _0x39dfac={'count':0x0,'rows':[]};return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x428ed3[_0x3eca('0x53')]['id']}})['then'](handleEntityNotFound(_0xf3fd15,null))[_0x3eca('0x1a')](function(_0x48eb71){if(_0x48eb71){_0x1efd8b[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xe7')]['rawAttributes']);_0x1efd8b['query']=_[_0x3eca('0x57')](_0x428ed3['query']);_0x1efd8b['filters']=_[_0x3eca('0x59')](_0x1efd8b['model'],_0x1efd8b[_0x3eca('0x45')]);_0x11372d['attributes']=_['intersection'](_0x1efd8b['model'],qs['fields'](_0x428ed3[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x11372d[_0x3eca('0x47')]=_0x11372d[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x11372d[_0x3eca('0x47')]:_0x1efd8b[_0x3eca('0x54')];if(!_0x428ed3[_0x3eca('0x45')][_0x3eca('0xdf')]('nolimit')){_0x11372d[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x428ed3[_0x3eca('0x45')][_0x3eca('0x2b')]);_0x11372d[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x428ed3[_0x3eca('0x45')]['offset']);}_0x11372d[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x428ed3['query'][_0x3eca('0xd3')]);_0x11372d['where']=qs[_0x3eca('0x58')](_['pick'](_0x428ed3[_0x3eca('0x45')],_0x1efd8b[_0x3eca('0x58')]));_0x11372d[_0x3eca('0x42')]['UserId']=_0x48eb71['id'];if(_0x428ed3[_0x3eca('0x45')][_0x3eca('0x37')]){_0x11372d[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x11372d[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x11372d[_0x3eca('0x47')],function(_0x1507ad){var _0xbcb3b4={};_0xbcb3b4[_0x1507ad]={'$like':'%'+_0x428ed3[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0xbcb3b4;})});}_0x11372d=_[_0x3eca('0xd5')]({},_0x11372d,_0x428ed3['options']);return db[_0x3eca('0xe7')]['count']({'where':_0x11372d[_0x3eca('0x42')]})['then'](function(_0x4a0641){_0x39dfac['count']=_0x4a0641;if(_0x428ed3[_0x3eca('0x45')][_0x3eca('0x44')]){_0x11372d[_0x3eca('0x5c')]=[{'all':!![]}];}return db[_0x3eca('0xe7')][_0x3eca('0x8f')](_0x11372d);})['then'](function(_0x408cd4){_0x39dfac[_0x3eca('0x4d')]=_0x408cd4;return _0x39dfac;});}})[_0x3eca('0x1a')](respondWithFilteredResult(_0xf3fd15,_0x11372d))['catch'](handleError(_0xf3fd15,null));};exports[_0x3eca('0xe8')]=function(_0x186e96,_0x10ad21){var _0x277731={};var _0x369cce={};var _0x4f1fd6;var _0x4a00c1;return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x186e96[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x10ad21,null))[_0x3eca('0x1a')](function(_0x26457d){if(_0x26457d){_0x4f1fd6=_0x26457d;_0x369cce[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xe9')][_0x3eca('0x55')]);_0x369cce[_0x3eca('0x45')]=_['keys'](_0x186e96[_0x3eca('0x45')]);_0x369cce[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x369cce[_0x3eca('0x54')],_0x369cce['query']);_0x277731[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x369cce[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x186e96[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x277731[_0x3eca('0x47')]=_0x277731[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x277731[_0x3eca('0x47')]:_0x369cce['model'];_0x277731['order']=qs[_0x3eca('0xd3')](_0x186e96['query'][_0x3eca('0xd3')]);_0x277731[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x186e96[_0x3eca('0x45')],_0x369cce[_0x3eca('0x58')]));if(_0x186e96[_0x3eca('0x45')][_0x3eca('0x37')]){_0x277731[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x277731[_0x3eca('0x42')],{'$or':_['map'](_0x277731[_0x3eca('0x47')],function(_0x37b3d5){var _0x1a469c={};_0x1a469c[_0x37b3d5]={'$like':'%'+_0x186e96[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x1a469c;})});}_0x277731=_[_0x3eca('0xd5')]({},_0x277731,_0x186e96['options']);return _0x4f1fd6[_0x3eca('0xe8')](_0x277731);}})[_0x3eca('0x1a')](function(_0x173ea5){if(_0x173ea5){_0x4a00c1=_0x173ea5['length'];if(!_0x186e96['query'][_0x3eca('0xdf')](_0x3eca('0xe0'))){_0x277731[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x186e96['query']['limit']);_0x277731[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x186e96[_0x3eca('0x45')][_0x3eca('0x29')]);}return _0x4f1fd6['getChatInteractions'](_0x277731);}})['then'](function(_0x117862){if(_0x117862){return _0x117862?{'count':_0x4a00c1,'rows':_0x117862}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x10ad21,null))['catch'](handleError(_0x10ad21,null));};exports['getOpenchannelInteractions']=function(_0x1b7c78,_0x39102b){var _0x503148={};var _0x16d0b7={};var _0xf9e995;var _0x56814c;return db['User'][_0x3eca('0x9b')]({'where':{'id':_0x1b7c78['params']['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x39102b,null))[_0x3eca('0x1a')](function(_0xdc85f3){if(_0xdc85f3){_0xf9e995=_0xdc85f3;_0x16d0b7[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xea')][_0x3eca('0x55')]);_0x16d0b7[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x1b7c78[_0x3eca('0x45')]);_0x16d0b7['filters']=_[_0x3eca('0x59')](_0x16d0b7[_0x3eca('0x54')],_0x16d0b7[_0x3eca('0x45')]);_0x503148[_0x3eca('0x47')]=_['intersection'](_0x16d0b7[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x1b7c78[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x503148['attributes']=_0x503148[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x503148[_0x3eca('0x47')]:_0x16d0b7['model'];_0x503148[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x1b7c78[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x503148[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x1b7c78[_0x3eca('0x45')],_0x16d0b7[_0x3eca('0x58')]));if(_0x1b7c78[_0x3eca('0x45')]['filter']){_0x503148[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x503148[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x503148['attributes'],function(_0x284e8e){var _0x5cb0fb={};_0x5cb0fb[_0x284e8e]={'$like':'%'+_0x1b7c78['query'][_0x3eca('0x37')]+'%'};return _0x5cb0fb;})});}_0x503148=_['merge']({},_0x503148,_0x1b7c78[_0x3eca('0x5d')]);return _0xf9e995['getOpenchannelInteractions'](_0x503148);}})[_0x3eca('0x1a')](function(_0x30fb73){if(_0x30fb73){_0x56814c=_0x30fb73['length'];if(!_0x1b7c78['query']['hasOwnProperty'](_0x3eca('0xe0'))){_0x503148[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x1b7c78['query'][_0x3eca('0x2b')]);_0x503148[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x1b7c78[_0x3eca('0x45')][_0x3eca('0x29')]);}return _0xf9e995[_0x3eca('0xeb')](_0x503148);}})[_0x3eca('0x1a')](function(_0x5ddb7e){if(_0x5ddb7e){return _0x5ddb7e?{'count':_0x56814c,'rows':_0x5ddb7e}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x39102b,null))[_0x3eca('0x25')](handleError(_0x39102b,null));};exports['getMailInteractions']=function(_0x707c9f,_0x264b70){var _0x438f48={'raw':!![],'where':{}};var _0xe90f18={};var _0x4ba48c={'count':0x0,'rows':[]};return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x707c9f[_0x3eca('0x53')]['id']}})['then'](handleEntityNotFound(_0x264b70,null))[_0x3eca('0x1a')](function(_0x2d791f){if(_0x2d791f){_0xe90f18[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xec')]['rawAttributes']);_0xe90f18[_0x3eca('0x45')]=_['keys'](_0x707c9f['query']);_0xe90f18['filters']=_['intersection'](_0xe90f18[_0x3eca('0x54')],_0xe90f18[_0x3eca('0x45')]);_0x438f48['attributes']=_[_0x3eca('0x59')](_0xe90f18[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x707c9f[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x438f48[_0x3eca('0x47')]=_0x438f48[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x438f48[_0x3eca('0x47')]:_0xe90f18[_0x3eca('0x54')];if(!_0x707c9f[_0x3eca('0x45')][_0x3eca('0xdf')]('nolimit')){_0x438f48[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x707c9f[_0x3eca('0x45')][_0x3eca('0x2b')]);_0x438f48[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x707c9f[_0x3eca('0x45')][_0x3eca('0x29')]);}_0x438f48[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x707c9f[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x438f48['where']=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x707c9f['query'],_0xe90f18['filters']));_0x438f48[_0x3eca('0x42')][_0x3eca('0xe5')]=_0x2d791f['id'];if(_0x707c9f[_0x3eca('0x45')][_0x3eca('0x37')]){_0x438f48['where']=_[_0x3eca('0xd5')](_0x438f48[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x438f48[_0x3eca('0x47')],function(_0x3f7641){var _0x5d6bca={};_0x5d6bca[_0x3f7641]={'$like':'%'+_0x707c9f[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x5d6bca;})});}_0x438f48=_['merge']({},_0x438f48,_0x707c9f['options']);return db[_0x3eca('0xec')]['count']({'where':_0x438f48['where']})['then'](function(_0x9ae912){_0x4ba48c[_0x3eca('0x2c')]=_0x9ae912;if(_0x707c9f[_0x3eca('0x45')][_0x3eca('0x44')]){_0x438f48['include']=[{'all':!![]}];}return db[_0x3eca('0xec')][_0x3eca('0x8f')](_0x438f48);})['then'](function(_0x36afd5){_0x4ba48c[_0x3eca('0x4d')]=_0x36afd5;return _0x4ba48c;});}})[_0x3eca('0x1a')](respondWithFilteredResult(_0x264b70,_0x438f48))[_0x3eca('0x25')](handleError(_0x264b70,null));};exports['getSmsInteractions']=function(_0x5511cf,_0x54b306){var _0x1c2aca={};var _0x1f3a6a={};var _0x73b611;var _0x861744;return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x5511cf[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x54b306,null))[_0x3eca('0x1a')](function(_0x24117d){if(_0x24117d){_0x73b611=_0x24117d;_0x1f3a6a[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xed')][_0x3eca('0x55')]);_0x1f3a6a[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x5511cf['query']);_0x1f3a6a[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x1f3a6a[_0x3eca('0x54')],_0x1f3a6a[_0x3eca('0x45')]);_0x1c2aca[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x1f3a6a[_0x3eca('0x54')],qs['fields'](_0x5511cf[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x1c2aca['attributes']=_0x1c2aca[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x1c2aca[_0x3eca('0x47')]:_0x1f3a6a[_0x3eca('0x54')];_0x1c2aca[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x5511cf[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x1c2aca[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x5511cf['query'],_0x1f3a6a['filters']));if(_0x5511cf[_0x3eca('0x45')]['filter']){_0x1c2aca[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x1c2aca[_0x3eca('0x42')],{'$or':_['map'](_0x1c2aca[_0x3eca('0x47')],function(_0xe60297){var _0x184214={};_0x184214[_0xe60297]={'$like':'%'+_0x5511cf[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x184214;})});}_0x1c2aca=_[_0x3eca('0xd5')]({},_0x1c2aca,_0x5511cf[_0x3eca('0x5d')]);return _0x73b611[_0x3eca('0xee')](_0x1c2aca);}})['then'](function(_0x2c7110){if(_0x2c7110){_0x861744=_0x2c7110[_0x3eca('0x5b')];if(!_0x5511cf[_0x3eca('0x45')]['hasOwnProperty'](_0x3eca('0xe0'))){_0x1c2aca[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x5511cf[_0x3eca('0x45')][_0x3eca('0x2b')]);_0x1c2aca['offset']=qs['offset'](_0x5511cf[_0x3eca('0x45')]['offset']);}return _0x73b611[_0x3eca('0xee')](_0x1c2aca);}})[_0x3eca('0x1a')](function(_0x9eefb6){if(_0x9eefb6){return _0x9eefb6?{'count':_0x861744,'rows':_0x9eefb6}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x54b306,null))[_0x3eca('0x25')](handleError(_0x54b306,null));};exports[_0x3eca('0xef')]=function(_0x4b98b2,_0x311f39){var _0x597e48={};var _0x507b95={};var _0x30c943;var _0xeb4594;return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x4b98b2[_0x3eca('0x53')]['id']}})['then'](handleEntityNotFound(_0x311f39,null))[_0x3eca('0x1a')](function(_0x4f5d87){if(_0x4f5d87){_0x30c943=_0x4f5d87;_0x507b95['model']=_[_0x3eca('0x57')](db[_0x3eca('0xf0')][_0x3eca('0x55')]);_0x507b95[_0x3eca('0x45')]=_['keys'](_0x4b98b2[_0x3eca('0x45')]);_0x507b95[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x507b95[_0x3eca('0x54')],_0x507b95[_0x3eca('0x45')]);_0x597e48[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x507b95['model'],qs['fields'](_0x4b98b2[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x597e48['attributes']=_0x597e48['attributes'][_0x3eca('0x5b')]?_0x597e48[_0x3eca('0x47')]:_0x507b95[_0x3eca('0x54')];_0x597e48['order']=qs[_0x3eca('0xd3')](_0x4b98b2['query'][_0x3eca('0xd3')]);_0x597e48[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x4b98b2[_0x3eca('0x45')],_0x507b95[_0x3eca('0x58')]));if(_0x4b98b2['query'][_0x3eca('0x37')]){_0x597e48[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x597e48[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x597e48['attributes'],function(_0xc9203){var _0x3d2080={};_0x3d2080[_0xc9203]={'$like':'%'+_0x4b98b2[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x3d2080;})});}_0x597e48=_[_0x3eca('0xd5')]({},_0x597e48,_0x4b98b2[_0x3eca('0x5d')]);return _0x30c943[_0x3eca('0xef')](_0x597e48);}})[_0x3eca('0x1a')](function(_0x286098){if(_0x286098){_0xeb4594=_0x286098[_0x3eca('0x5b')];if(!_0x4b98b2['query'][_0x3eca('0xdf')](_0x3eca('0xe0'))){_0x597e48[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x4b98b2[_0x3eca('0x45')][_0x3eca('0x2b')]);_0x597e48[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x4b98b2['query'][_0x3eca('0x29')]);}return _0x30c943[_0x3eca('0xef')](_0x597e48);}})['then'](function(_0x9908da){if(_0x9908da){return _0x9908da?{'count':_0xeb4594,'rows':_0x9908da}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x311f39,null))[_0x3eca('0x25')](handleError(_0x311f39,null));};exports[_0x3eca('0xf1')]=function(_0x3d3e37,_0x51114e){var _0x3a2a48={};var _0x259781={};var _0x347878;var _0xf63e5e;return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x3d3e37[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x51114e,null))[_0x3eca('0x1a')](function(_0x2e6b1b){if(_0x2e6b1b){_0x347878=_0x2e6b1b;_0x259781[_0x3eca('0x54')]=_[_0x3eca('0x57')](db[_0x3eca('0xf2')][_0x3eca('0x55')]);_0x259781[_0x3eca('0x45')]=_['keys'](_0x3d3e37[_0x3eca('0x45')]);_0x259781[_0x3eca('0x58')]=_[_0x3eca('0x59')](_0x259781[_0x3eca('0x54')],_0x259781[_0x3eca('0x45')]);_0x3a2a48[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x259781[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x3d3e37[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x3a2a48[_0x3eca('0x47')]=_0x3a2a48[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x3a2a48[_0x3eca('0x47')]:_0x259781[_0x3eca('0x54')];_0x3a2a48['order']=qs[_0x3eca('0xd3')](_0x3d3e37[_0x3eca('0x45')]['sort']);_0x3a2a48[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x3d3e37[_0x3eca('0x45')],_0x259781[_0x3eca('0x58')]));if(_0x3d3e37[_0x3eca('0x45')][_0x3eca('0x37')]){_0x3a2a48[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x3a2a48['where'],{'$or':_[_0x3eca('0x38')](_0x3a2a48['attributes'],function(_0x3e5334){var _0x45a0c4={};_0x45a0c4[_0x3e5334]={'$like':'%'+_0x3d3e37[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x45a0c4;})});}_0x3a2a48=_[_0x3eca('0xd5')]({},_0x3a2a48,_0x3d3e37[_0x3eca('0x5d')]);return _0x347878['getWhatsappInteractions'](_0x3a2a48);}})[_0x3eca('0x1a')](function(_0x3c7e83){if(_0x3c7e83){_0xf63e5e=_0x3c7e83[_0x3eca('0x5b')];if(!_0x3d3e37[_0x3eca('0x45')][_0x3eca('0xdf')](_0x3eca('0xe0'))){_0x3a2a48[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x3d3e37[_0x3eca('0x45')]['limit']);_0x3a2a48[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x3d3e37['query'][_0x3eca('0x29')]);}return _0x347878[_0x3eca('0xf1')](_0x3a2a48);}})[_0x3eca('0x1a')](function(_0x39721c){if(_0x39721c){return _0x39721c?{'count':_0xf63e5e,'rows':_0x39721c}:null;}})['then'](respondWithResult(_0x51114e,null))[_0x3eca('0x25')](handleError(_0x51114e,null));};exports[_0x3eca('0xf3')]=function(_0x13c0d6,_0x9951ac,_0x2e32de){var _0x5e4299;var _0x215467;var _0x3960ca;var _0x261aab=!_[_0x3eca('0x69')](_0x13c0d6[_0x3eca('0x53')]['id'])?_0x13c0d6['params']['id']:!_[_0x3eca('0x69')](_0x13c0d6[_0x3eca('0x34')]['id'])?_0x13c0d6['user']['id']:null;return db[_0x3eca('0x43')][_0x3eca('0x3a')]({'where':{'id':_0x261aab,'role':{'$or':[_0x3eca('0x81'),_0x3eca('0x34'),_0x3eca('0x35')]}},'attributes':['id',_0x3eca('0x3b'),_0x3eca('0xf4'),_0x3eca('0xf5'),_0x3eca('0x32'),'internal','loginInPause']})[_0x3eca('0x1a')](function(_0x1ac9dc){if(_0x1ac9dc){if(_0x1ac9dc['role']===_0x3eca('0x35')){_0x5e4299=_0x1ac9dc;if(_0x13c0d6['body'][_0x3eca('0xa3')]){_0x3960ca=util[_0x3eca('0xaf')](_0x3eca('0xf6'),_0x5e4299[_0x13c0d6[_0x3eca('0x5f')][_0x3eca('0xa3')]]);}else if(_0x13c0d6[_0x3eca('0x5f')][_0x3eca('0xf7')]){_0x3960ca=util[_0x3eca('0xaf')](_0x3eca('0xb0'),_0x13c0d6[_0x3eca('0x5f')][_0x3eca('0xf7')]);}else{_0x3960ca=util[_0x3eca('0xaf')](_0x3eca('0xb0'),_0x5e4299[_0x3eca('0x3b')]);}socket['to'](util[_0x3eca('0xaf')](_0x3eca('0xf8'),_0x5e4299[_0x3eca('0x3b')]))['emit'](_0x3eca('0xf9'),{'user':{'id':_0x5e4299['id'],'name':_0x5e4299[_0x3eca('0x3b')]},'ip':_0x13c0d6[_0x3eca('0xfa')][_0x3eca('0xfb')]||_0x13c0d6[_0x3eca('0xfc')][_0x3eca('0xfd')]||_0x13c0d6['socket'][_0x3eca('0xfd')]||_0x13c0d6['connection'][_0x3eca('0xfe')][_0x3eca('0xfd')]});return db[_0x3eca('0xb3')][_0x3eca('0x31')]({'where':{'membername':_0x5e4299[_0x3eca('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0x3eca('0x96'))][(_0x3eca('0x93'))](_0x3eca('0xff'));}})[_0x3eca('0x1a')](function(){if(_0x5e4299){return _0x5e4299[_0x3eca('0x100')]({'raw':!![]});}})[_0x3eca('0x1a')](function(_0x539c19){if(_0x5e4299){var _0x9c9a4f=[];if(_0x539c19){_0x215467=_0x539c19;if(_0x215467['length']){for(var _0x1ca329=0x0;_0x1ca329<_0x215467[_0x3eca('0x5b')];_0x1ca329++){_0x9c9a4f[_0x3eca('0x4a')]({'membername':_0x5e4299[_0x3eca('0x3b')],'UserId':_0x5e4299['id'],'queue_name':_0x215467[_0x1ca329][_0x3eca('0x3b')],'VoiceQueueId':_0x215467[_0x1ca329]['id'],'interface':_0x3960ca,'paused':_0x5e4299[_0x3eca('0x101')]||![],'penalty':_0x215467[_0x1ca329]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x3eca('0x8d')](_0x9c9a4f,function(_0x8abaf){return db['UserVoiceQueueRt'][_0x3eca('0xb4')](_0x8abaf);});}}}})[_0x3eca('0x1a')](function(){if(_0x5e4299){return db['MemberReport'][_0x3eca('0x8f')]({'where':{'membername':_0x5e4299['name'],'exitAt':null}});}})[_0x3eca('0x1a')](function(_0x2e95cb){if(_0x5e4299){var _0x3a9626=[];_0x2e95cb[_0x3eca('0x102')](function(_0x2176b7){_0x3a9626[_0x3eca('0x4a')](_0x2176b7['update']({'exitAt':moment()['format'](_0x3eca('0x103'))}));});return BPromise[_0x3eca('0x52')](_0x3a9626);}})[_0x3eca('0x1a')](function(){if(_0x5e4299){var _0x253400=[];var _0x2cb1c2=[];var _0x184009=utils[_0x3eca('0x104')]();var _0x450094={'membername':_0x5e4299['name'],'interface':_0x3960ca,'enterAt':moment()[_0x3eca('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5e4299[_0x3eca('0x32')],'internal':_0x5e4299[_0x3eca('0x64')]};_0x184009[_0x3eca('0x102')](function(_0x5c419b){_0x253400[_0x3eca('0x4a')](_['merge']({'channel':_0x5c419b,'type':'LOGIN','data1':_0x13c0d6[_0x3eca('0x5f')][_0x3eca('0x105')],'data2':_0x3960ca},_0x450094));if(_0x5e4299[_0x3eca('0x101')]){_0x2cb1c2['push'](_['merge']({'channel':_0x5c419b,'type':_0x3eca('0x106'),'data1':_0x3eca('0x107')},_0x450094));}});return db[_0x3eca('0x108')][_0x3eca('0x8a')](_0x253400[_0x3eca('0xd0')](_0x2cb1c2),{'individualHooks':!![]});}})[_0x3eca('0x1a')](function(){if(_0x5e4299){return _0x5e4299[_0x3eca('0x2f')]({'online':!![],'lastLoginAt':moment()[_0x3eca('0xaf')](_0x3eca('0x103')),'voicePause':_0x5e4299[_0x3eca('0x101')]||![],'mailPause':_0x5e4299['loginInPause']||![],'chatPause':_0x5e4299[_0x3eca('0x101')]||![],'faxPause':_0x5e4299[_0x3eca('0x101')]||![],'smsPause':_0x5e4299['loginInPause']||![],'openchannelPause':_0x5e4299[_0x3eca('0x101')]||![],'whatsappPause':_0x5e4299['loginInPause']||![],'pauseType':_0x5e4299[_0x3eca('0x101')]?'LOGININPAUSE':null,'interface':_0x3960ca,'lastPauseAt':moment()[_0x3eca('0xaf')](_0x3eca('0x103'))});}})[_0x3eca('0x1a')](function(_0x1e547e){if(_0x13c0d6[_0x3eca('0x109')]){return _0x2e32de();}else{return BPromise[_0x3eca('0x10a')](_0x1e547e)[_0x3eca('0x1a')](respondWithResult(_0x9951ac,null));}})['catch'](handleError(_0x9951ac,null));};exports[_0x3eca('0x10b')]=function(_0x3b9c05,_0x1894a5){var _0x8b23e4;return db['User']['find']({'where':{'id':_0x3b9c05[_0x3eca('0x53')]['id'],'role':_0x3eca('0x35')},'attributes':['id','name',_0x3eca('0x32')]})[_0x3eca('0x1a')](handleEntityNotFound(_0x1894a5,null))['then'](function(_0x2f5db0){if(_0x2f5db0){_0x8b23e4=_0x2f5db0;return db[_0x3eca('0xb3')][_0x3eca('0x31')]({'where':{'membername':_0x8b23e4[_0x3eca('0x3b')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0x3eca('0x8f')]({'where':{'membername':_0x8b23e4[_0x3eca('0x3b')],'exitAt':null}});})[_0x3eca('0x1a')](function(_0x5150ae){var _0x113b94=[];_0x5150ae[_0x3eca('0x102')](function(_0x264b81){_0x113b94['push'](_0x264b81['update']({'exitAt':moment()[_0x3eca('0xaf')](_0x3eca('0x103'))}));});return BPromise[_0x3eca('0x52')](_0x113b94);})[_0x3eca('0x1a')](function(){return _0x8b23e4[_0x3eca('0x2f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x3eca('0x1a')](respondWithResult(_0x1894a5,null))[_0x3eca('0x25')](handleError(_0x1894a5,null));};exports[_0x3eca('0x10c')]=function(_0x991f8f,_0x3ef34e){var _0x5b3441;return db[_0x3eca('0xb3')][_0x3eca('0x2f')]({'paused':0x1},{'where':{'UserId':_0x991f8f['params']['id']},'individualHooks':!![]})[_0x3eca('0x1a')](function(){return db[_0x3eca('0x43')][_0x3eca('0x3a')]({'where':{'id':_0x991f8f['params']['id'],'role':_0x3eca('0x35')},'attributes':['id',_0x3eca('0x3b'),'role',_0x3eca('0x64'),'interface']});})[_0x3eca('0x1a')](handleEntityNotFound(_0x3ef34e,null))[_0x3eca('0x1a')](function(_0x4ab305){if(_0x4ab305){_0x5b3441=_0x4ab305;return respondWithRpcPromise(_0x3eca('0x10d'),_0x3eca('0x10c'),{'id':_0x5b3441['id'],'name':_0x5b3441[_0x3eca('0x3b')],'pause':!![]});}})['then'](function(){if(_0x5b3441){return db[_0x3eca('0x108')]['findAll']({'where':{'membername':_0x5b3441[_0x3eca('0x3b')],'type':_0x3eca('0x106'),'exitAt':null}});}})[_0x3eca('0x1a')](function(_0x4c08b7){if(_0x4c08b7[_0x3eca('0x5b')]){var _0x1f03aa=moment()[_0x3eca('0xaf')](_0x3eca('0x103'));for(var _0x15ac31=0x0,_0xe1280e=_0x4c08b7['length'];_0x15ac31<_0xe1280e;_0x15ac31++){_0x4c08b7[_0x15ac31][_0x3eca('0x10e')]({'exitAt':_0x1f03aa});}}})[_0x3eca('0x1a')](function(){var _0x4e0a23=[];var _0x1023c1=utils['getChannels']();_0x1023c1['forEach'](function(_0x56a69f){_0x4e0a23['push']({'channel':_0x56a69f,'membername':_0x5b3441[_0x3eca('0x3b')],'interface':_['isNil'](_0x5b3441['interface'])?util[_0x3eca('0xaf')](_0x3eca('0xb0'),_0x5b3441['name']):_0x5b3441[_0x3eca('0xa3')],'type':'PAUSE','enterAt':moment()[_0x3eca('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x991f8f[_0x3eca('0x5f')]['type']||_0x3eca('0x10f'),'role':_0x5b3441[_0x3eca('0x32')],'internal':_0x5b3441['internal']});});return db[_0x3eca('0x108')]['bulkCreate'](_0x4e0a23,{'individualHooks':!![]});})[_0x3eca('0x1a')](function(){return _0x5b3441[_0x3eca('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x991f8f[_0x3eca('0x5f')][_0x3eca('0x110')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x3eca('0xaf')](_0x3eca('0x103'))});})['then'](respondWithResult(_0x3ef34e,null))[_0x3eca('0x25')](handleError(_0x3ef34e,null));};exports['unpause']=function(_0x1af8b5,_0x337089){var _0x368704;return db[_0x3eca('0x43')][_0x3eca('0x3a')]({'where':{'id':_0x1af8b5['params']['id']},'attributes':['id',_0x3eca('0x3b'),'role',_0x3eca('0xb1'),_0x3eca('0x111'),'chatPause',_0x3eca('0x112'),_0x3eca('0x113'),'smsPause',_0x3eca('0x114'),_0x3eca('0x115'),'lastPauseAt']})[_0x3eca('0x1a')](handleEntityNotFound(_0x337089,null))[_0x3eca('0x1a')](function(_0x59b919){if(_0x59b919){_0x368704=_0x59b919;if(_0x1af8b5[_0x3eca('0x5f')]['channel']&&!utils[_0x3eca('0xa4')](_0x1af8b5[_0x3eca('0x5f')]['channel'])){throw new db['Sequelize'][(_0x3eca('0x93'))](_0x3eca('0xa5'));}switch(_0x1af8b5[_0x3eca('0x5f')][_0x3eca('0xa2')]){case'voice':return respondWithRpcPromise('QueuePause','unpause',{'id':_0x368704['id'],'name':_0x368704[_0x3eca('0x3b')],'pause':![]})[_0x3eca('0x1a')](function(){return db[_0x3eca('0xb3')]['update']({'paused':0x0},{'where':{'UserId':_0x368704['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0x3eca('0x3a')]({'where':{'channel':_0x1af8b5[_0x3eca('0x5f')][_0x3eca('0xa2')],'membername':_0x368704[_0x3eca('0x3b')],'type':_0x3eca('0x106'),'exitAt':null}});})[_0x3eca('0x1a')](function(_0x26adde){if(_0x26adde){return _0x26adde[_0x3eca('0x2f')]({'exitAt':moment()[_0x3eca('0xaf')](_0x3eca('0x103')),'data2':_0x3eca('0x116')},{'individualHooks':!![]});}return null;})[_0x3eca('0x1a')](function(){return _0x368704[_0x3eca('0x2f')]({'voicePause':![]});});case _0x3eca('0x4f'):case _0x3eca('0x4b'):case _0x3eca('0x4e'):case _0x3eca('0x5e'):case _0x3eca('0x51'):case _0x3eca('0x50'):return db[_0x3eca('0x108')][_0x3eca('0x3a')]({'where':{'channel':_0x1af8b5[_0x3eca('0x5f')][_0x3eca('0xa2')],'membername':_0x368704[_0x3eca('0x3b')],'type':_0x3eca('0x106'),'exitAt':null}})['then'](function(_0x278b10){if(_0x278b10){return _0x278b10[_0x3eca('0x2f')]({'exitAt':moment()[_0x3eca('0xaf')](_0x3eca('0x103')),'data2':_0x3eca('0x116')},{'individualHooks':!![]});}return null;})[_0x3eca('0x1a')](function(){var _0x558665={};_[_0x3eca('0x2d')](_0x558665,util[_0x3eca('0xaf')](_0x3eca('0x117'),_0x1af8b5['body'][_0x3eca('0xa2')],_0x3eca('0x118')),![]);return _0x368704[_0x3eca('0x2f')](_0x558665);});default:return respondWithRpcPromise(_0x3eca('0x10d'),_0x3eca('0x119'),{'id':_0x368704['id'],'name':_0x368704[_0x3eca('0x3b')],'pause':![]})['then'](function(){return db[_0x3eca('0xb3')][_0x3eca('0x2f')]({'paused':0x0},{'where':{'UserId':_0x368704['id']}});})[_0x3eca('0x1a')](function(){return db[_0x3eca('0x108')][_0x3eca('0x8f')]({'where':{'membername':_0x368704[_0x3eca('0x3b')],'type':_0x3eca('0x106'),'exitAt':null}});})[_0x3eca('0x1a')](function(_0x56edf8){var _0x5059b9=[];_0x56edf8[_0x3eca('0x102')](function(_0x51a80a){_0x5059b9[_0x3eca('0x4a')](_0x51a80a['update']({'exitAt':moment()[_0x3eca('0xaf')](_0x3eca('0x103')),'data2':'manual'}));});return BPromise[_0x3eca('0x52')](_0x5059b9);})['then'](function(){return _0x368704[_0x3eca('0x2f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x3eca('0x1a')](respondWithResult(_0x337089,null))[_0x3eca('0x25')](handleError(_0x337089,null));};exports[_0x3eca('0x11a')]=function(_0x3b8003,_0x4efd22){var _0x32eda2={};var _0x213f9d={};var _0x1e653f;var _0xde7f84;return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x3b8003[_0x3eca('0x53')]['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0x4efd22,null))[_0x3eca('0x1a')](function(_0x1772e3){if(_0x1772e3){_0x1e653f=_0x1772e3;_0x213f9d[_0x3eca('0x54')]=_['keys'](db[_0x3eca('0x11b')][_0x3eca('0x55')]);_0x213f9d[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x3b8003['query']);_0x213f9d['filters']=_[_0x3eca('0x59')](_0x213f9d['model'],_0x213f9d[_0x3eca('0x45')]);_0x32eda2[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x213f9d[_0x3eca('0x54')],qs[_0x3eca('0x5a')](_0x3b8003['query']['fields']));_0x32eda2[_0x3eca('0x47')]=_0x32eda2[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x32eda2[_0x3eca('0x47')]:_0x213f9d['model'];_0x32eda2[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x3b8003[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x32eda2[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x3b8003['query'],_0x213f9d[_0x3eca('0x58')]));if(_0x3b8003['query'][_0x3eca('0x37')]){_0x32eda2['where']=_[_0x3eca('0xd5')](_0x32eda2[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x32eda2[_0x3eca('0x47')],function(_0x159d6c){var _0x455f1e={};_0x455f1e[_0x159d6c]={'$like':'%'+_0x3b8003[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x455f1e;})});}_0x32eda2=_[_0x3eca('0xd5')]({},_0x32eda2,_0x3b8003[_0x3eca('0x5d')]);return _0x1e653f[_0x3eca('0x11a')](_0x32eda2);}})[_0x3eca('0x1a')](function(_0x522f3d){if(_0x522f3d){_0xde7f84=_0x522f3d[_0x3eca('0x5b')];if(!_0x3b8003['query']['hasOwnProperty'](_0x3eca('0xe0'))){_0x32eda2['limit']=qs['limit'](_0x3b8003['query'][_0x3eca('0x2b')]);_0x32eda2[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x3b8003[_0x3eca('0x45')]['offset']);}return _0x1e653f[_0x3eca('0x11a')](_0x32eda2);}})['then'](function(_0x505e33){if(_0x505e33){return _0x505e33?{'count':_0xde7f84,'rows':_0x505e33}:null;}})[_0x3eca('0x1a')](respondWithResult(_0x4efd22,null))[_0x3eca('0x25')](handleError(_0x4efd22,null));};exports[_0x3eca('0x11c')]=function(_0xd83f63,_0x1c8446){var _0x28174c=_0xd83f63[_0x3eca('0x53')]['id'];var _0x6c1734=_0xd83f63[_0x3eca('0x5f')]?_0xd83f63[_0x3eca('0x5f')][_0x3eca('0x63')]:null;var _0x36904b=[];return Promise[_0x3eca('0x10a')]()[_0x3eca('0x1a')](function(){if(!_0x6c1734)throw new APIBadRequestError(_0x3eca('0x11d'));})['then'](function(){return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x28174c}});})[_0x3eca('0x1a')](function(_0x13ee63){if(!_0x13ee63)throw new APINotFoundError(util[_0x3eca('0xaf')](_0x3eca('0x11e'),_0xd83f63['params']['id']));return db['sequelize'][_0x3eca('0x11f')](function(_0xf527a2){return _0x13ee63['addTeams'](_0x6c1734,{'transaction':_0xf527a2})[_0x3eca('0x1a')](function(){return db[_0x3eca('0x11b')][_0x3eca('0x8f')]({'where':{'id':{'$in':_0x6c1734}}});})[_0x3eca('0x1a')](function(_0x5877b8){var _0x115ce0=_[_0x3eca('0x38')](_0x5877b8,function(_0x114c08){return _0x114c08[_0x3eca('0x120')]();});return Promise['all'](_0x115ce0);})['then'](function(_0x5cc95b){_0x36904b=_[_0x3eca('0x121')](_0x5cc95b);var _0x4ccb55=_[_0x3eca('0x38')](_0x36904b,function(_0x39d4fc){return _0x39d4fc[_0x3eca('0x122')](_0x13ee63['id'],{'transaction':_0xf527a2});});return Promise[_0x3eca('0x52')](_0x4ccb55);})['then'](function(){if(!_0x13ee63[_0x3eca('0xae')])return;var _0x115ed6=_[_0x3eca('0x37')](_0x36904b,function(_0x2f935a){return _0x2f935a[_0x3eca('0x123')](_0x3eca('0xa2'))===_0x3eca('0x124');});var _0x4c380c=_['map'](_0x115ed6,function(_0x1e4a5c){return db[_0x3eca('0xb3')]['upsert']({'membername':_0x13ee63[_0x3eca('0x3b')],'UserId':_0x13ee63['id'],'queue_name':_0x1e4a5c['name'],'VoiceQueueId':_0x1e4a5c['id'],'interface':_[_0x3eca('0x69')](_0x13ee63[_0x3eca('0xa3')])?util[_0x3eca('0xaf')](_0x3eca('0xb0'),_0x13ee63[_0x3eca('0x3b')]):_0x13ee63[_0x3eca('0xa3')],'paused':_0x13ee63['voicePause']||![],'penalty':_0x13ee63[_0x3eca('0xb2')]},{'transaction':_0xf527a2});});return Promise[_0x3eca('0x52')](_0x4c380c);})[_0x3eca('0x1a')](function(){return db[_0x3eca('0x125')][_0x3eca('0x8f')]({'where':{'teamId':{'$in':_0x6c1734}}});})[_0x3eca('0x1a')](function(_0x131f04){var _0x41eaa2=_[_0x3eca('0x38')](_0x131f04,function(_0x115f45){return db[_0x3eca('0x126')][_0x3eca('0x7f')]({'UserId':_0x13ee63['id'],'VoicePrefixId':_0x115f45['VoicePrefixId']},{'transaction':_0xf527a2});});return Promise['all'](_0x41eaa2);});});})[_0x3eca('0x1a')](function(){for(var _0x273513=0x0;_0x273513<_0x36904b['length'];_0x273513++){var _0x443cbb=_0x36904b[_0x273513][_0x3eca('0x123')](_0x3eca('0xa2'));var _0xbe5d8a=_0x443cbb+_0x3eca('0xaa');socket[_0x3eca('0x30')](_0x3eca('0x34')+_0x443cbb+'Queue:save',{'UserId':_0x28174c,['queueField']:_0x36904b[_0x273513]['id']});}})[_0x3eca('0x1a')](respondWithStatusCode(_0x1c8446,null))['catch'](APIHandleError(_0x1c8446));};exports[_0x3eca('0x127')]=function(_0x1f3e39,_0x352743){var _0x544d6c=_0x1f3e39[_0x3eca('0x53')]['id'];var _0x5510e6=null;if(_0x1f3e39[_0x3eca('0x45')]['ids']){_0x5510e6=_[_0x3eca('0xb8')](_0x1f3e39[_0x3eca('0x45')][_0x3eca('0x63')])?_0x1f3e39[_0x3eca('0x45')][_0x3eca('0x63')]:[_0x1f3e39[_0x3eca('0x45')]['ids']];}var _0x5f311b=[];return Promise[_0x3eca('0x10a')]()[_0x3eca('0x1a')](function(){if(!_0x5510e6)throw new APIBadRequestError(_0x3eca('0x128'));})[_0x3eca('0x1a')](function(){return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x544d6c}});})[_0x3eca('0x1a')](function(_0x4e1737){if(!_0x4e1737)throw new APINotFoundError(util[_0x3eca('0xaf')](_0x3eca('0x11e'),_0x1f3e39[_0x3eca('0x53')]['id']));return db[_0x3eca('0x6b')][_0x3eca('0x11f')](function(_0x13774d){return _0x4e1737[_0x3eca('0x127')](_0x5510e6,{'transaction':_0x13774d})['then'](function(){return db[_0x3eca('0x11b')][_0x3eca('0x8f')]({'where':{'id':{'$in':_0x5510e6}}});})['then'](function(_0x4adabd){var _0x42f1e8=_['map'](_0x4adabd,function(_0x5f1031){return _0x5f1031[_0x3eca('0x120')]();});return Promise['all'](_0x42f1e8);})[_0x3eca('0x1a')](function(_0x518420){_0x5f311b=_['flattenDeep'](_0x518420);var _0x1c7994=_['map'](_0x5f311b,function(_0x312e26){return _0x312e26[_0x3eca('0x129')](_0x4e1737['id'],{'transaction':_0x13774d});});return Promise[_0x3eca('0x52')](_0x1c7994);})[_0x3eca('0x1a')](function(){if(!_0x4e1737['online'])return;var _0x395184=_['filter'](_0x5f311b,function(_0x5d5caa){return _0x5d5caa[_0x3eca('0x123')](_0x3eca('0xa2'))===_0x3eca('0x124');});var _0x679ef7=_['map'](_0x395184,function(_0x562b36){return db[_0x3eca('0xb3')][_0x3eca('0x31')]({'where':{'VoiceQueueId':_0x562b36['id'],'UserId':_0x4e1737['id']},'transaction':_0x13774d});});return Promise[_0x3eca('0x52')](_0x679ef7);})[_0x3eca('0x1a')](function(){return db[_0x3eca('0x125')][_0x3eca('0x8f')]({'where':{'teamId':{'$in':_0x5510e6}}});})[_0x3eca('0x1a')](function(_0x2c65e5){var _0x488698=_[_0x3eca('0x38')](_0x2c65e5,function(_0x12424a){return db[_0x3eca('0x126')][_0x3eca('0x31')]({'where':{'UserId':_0x4e1737['id'],'VoicePrefixId':_0x12424a[_0x3eca('0x12a')]}},{'transaction':_0x13774d});});return Promise[_0x3eca('0x52')](_0x488698);});});})[_0x3eca('0x1a')](function(){for(var _0x5e00e1=0x0;_0x5e00e1<_0x5f311b[_0x3eca('0x5b')];_0x5e00e1++){var _0x3f3cc2=_0x5f311b[_0x5e00e1][_0x3eca('0x123')]('channel');var _0x11e5bc=_0x3f3cc2+'QueueId';socket[_0x3eca('0x30')](_0x3eca('0x34')+_0x3f3cc2+_0x3eca('0xb9'),{'UserId':_0x544d6c,['queueField']:_0x5f311b[_0x5e00e1]['id']});}})[_0x3eca('0x1a')](respondWithStatusCode(_0x352743,null))['catch'](APIHandleError(_0x352743));};exports[_0x3eca('0x12b')]=function(_0x4716b8,_0xf52d9c){var _0x278a23={};var _0x17154c={};var _0x5dc755;var _0x23f788;return db[_0x3eca('0x43')][_0x3eca('0x9b')]({'where':{'id':_0x4716b8['params']['id']}})[_0x3eca('0x1a')](handleEntityNotFound(_0xf52d9c,null))[_0x3eca('0x1a')](function(_0x3c1454){if(_0x3c1454){_0x5dc755=_0x3c1454;_0x17154c['model']=_[_0x3eca('0x57')](db[_0x3eca('0xd6')]['rawAttributes']);_0x17154c[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x4716b8['query']);_0x17154c['filters']=_[_0x3eca('0x59')](_0x17154c['model'],_0x17154c[_0x3eca('0x45')]);_0x278a23[_0x3eca('0x47')]=_[_0x3eca('0x59')](_0x17154c['model'],qs['fields'](_0x4716b8[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x278a23[_0x3eca('0x47')]=_0x278a23[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x278a23[_0x3eca('0x47')]:_0x17154c[_0x3eca('0x54')];_0x278a23[_0x3eca('0xd2')]=qs['sort'](_0x4716b8[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x278a23[_0x3eca('0x42')]=qs[_0x3eca('0x58')](_[_0x3eca('0xd4')](_0x4716b8['query'],_0x17154c[_0x3eca('0x58')]));if(_0x4716b8[_0x3eca('0x45')][_0x3eca('0x37')]){_0x278a23[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x278a23['where'],{'$or':_[_0x3eca('0x38')](_0x278a23['attributes'],function(_0x311700){var _0x2ed31a={};_0x2ed31a[_0x311700]={'$like':'%'+_0x4716b8['query'][_0x3eca('0x37')]+'%'};return _0x2ed31a;})});}_0x278a23=_['merge']({},_0x278a23,_0x4716b8['options']);return _0x5dc755['getLists'](_0x278a23);}})['then'](function(_0x1d8b55){if(_0x1d8b55){_0x23f788=_0x1d8b55[_0x3eca('0x5b')];if(!_0x4716b8['query'][_0x3eca('0xdf')]('nolimit')){_0x278a23[_0x3eca('0x2b')]=qs[_0x3eca('0x2b')](_0x4716b8[_0x3eca('0x45')][_0x3eca('0x2b')]);_0x278a23[_0x3eca('0x29')]=qs[_0x3eca('0x29')](_0x4716b8[_0x3eca('0x45')]['offset']);}return _0x5dc755['getLists'](_0x278a23);}})[_0x3eca('0x1a')](function(_0xf234cb){if(_0xf234cb){return _0xf234cb?{'count':_0x23f788,'rows':_0xf234cb}:null;}})[_0x3eca('0x1a')](respondWithResult(_0xf52d9c,null))[_0x3eca('0x25')](handleError(_0xf52d9c,null));};exports[_0x3eca('0x12c')]=function(_0x393cca,_0x960137){var _0x1d7988={};var _0x1ee906={};var _0x2e5b51;return db[_0x3eca('0x43')]['findOne']({'where':{'id':_0x393cca['params']['id']}})['then'](handleEntityNotFound(_0x960137,null))[_0x3eca('0x1a')](function(_0x5afa91){if(_0x5afa91){_0x2e5b51=_0x5afa91;_0x1ee906['model']=_[_0x3eca('0x57')](db['User'][_0x3eca('0x55')]);_0x1ee906[_0x3eca('0x45')]=_[_0x3eca('0x57')](_0x393cca[_0x3eca('0x45')]);_0x1ee906['filters']=_[_0x3eca('0x59')](_0x1ee906[_0x3eca('0x54')],_0x1ee906['query']);_0x1d7988['attributes']=_['intersection'](_0x1ee906[_0x3eca('0x54')],qs['fields'](_0x393cca[_0x3eca('0x45')][_0x3eca('0x5a')]));_0x1d7988[_0x3eca('0x47')]=_0x1d7988[_0x3eca('0x47')][_0x3eca('0x5b')]?_0x1d7988['attributes']:_0x1ee906[_0x3eca('0x54')];_0x1d7988[_0x3eca('0xd2')]=qs[_0x3eca('0xd3')](_0x393cca[_0x3eca('0x45')][_0x3eca('0xd3')]);_0x1d7988[_0x3eca('0x42')]=qs['filters'](_[_0x3eca('0xd4')](_0x393cca['query'],_0x1ee906[_0x3eca('0x58')]));if(_0x393cca[_0x3eca('0x45')][_0x3eca('0x37')]){_0x1d7988[_0x3eca('0x42')]=_[_0x3eca('0xd5')](_0x1d7988[_0x3eca('0x42')],{'$or':_[_0x3eca('0x38')](_0x1d7988['attributes'],function(_0x4b4988){var _0x54506c={};_0x54506c[_0x4b4988]={'$like':'%'+_0x393cca[_0x3eca('0x45')][_0x3eca('0x37')]+'%'};return _0x54506c;})});}_0x1d7988[_0x3eca('0x54')]=db[_0x3eca('0x43')];_0x1d7988['as']=_0x3eca('0x87');_0x1d7988=_['merge']({},_0x1d7988,_0x393cca[_0x3eca('0x5d')]);return _0x2e5b51[_0x3eca('0x100')]({'include':[_0x1d7988]});}})['then'](function(_0x502dbf){if(_0x502dbf){var _0xc8ec17={},_0x5dd85e=[];for(var _0x370bb9=0x0;_0x370bb9<_0x502dbf[_0x3eca('0x5b')];_0x370bb9+=0x1){for(var _0x4143ca=0x0,_0x585300;_0x4143ca<_0x502dbf[_0x370bb9]['Agents'][_0x3eca('0x5b')];_0x4143ca+=0x1){_0x585300=_0x502dbf[_0x370bb9][_0x3eca('0x87')][_0x4143ca][_0x3eca('0xad')]({'plain':!![]});_0xc8ec17[_0x585300['id']]=_0x585300;}}_0xc8ec17=_[_0x3eca('0x12d')](_0xc8ec17);for(var _0xa398ec=qs[_0x3eca('0x29')](_0x393cca['query']['offset']);_0xa398ec<_0xc8ec17[_0x3eca('0x5b')]&&_0x5dd85e[_0x3eca('0x5b')]=_0x6175b6){_0x481736=_0x6175b6;_0x499838=0xc8;}else{_0x499838=0xce;}_0x2a665a['status'](_0x499838);return _0x2a665a[_0x437d('0x2b')](_0x437d('0x2c'),_0x48a444+'-'+_0x481736+'/'+_0x6175b6)[_0x437d('0x26')](_0x234588);}return null;};}function saveUpdates(_0x11bb38){return function(_0x344fd0){if(_0x344fd0){return _0x344fd0[_0x437d('0x2d')](_0x11bb38)['then'](function(_0x7245e5){socket['emit'](_0x437d('0x2e')+_0x7245e5['id'],{});return _0x7245e5;});}return null;};}function removeEntity(_0xe3d28e){return function(_0x2cb12d){if(_0x2cb12d){return _0x2cb12d[_0x437d('0x2f')]()[_0x437d('0x1a')](function(){var _0x1c0495=_0x2cb12d[_0x437d('0x30')]({'plain':!![]});if(_0x1c0495[_0x437d('0x31')]===_0x437d('0x32'))return;var _0x141f2b=[{'name':'Users','value':_0x437d('0x33'),'ignore':!![]},{'name':_0x437d('0x34'),'value':_0x437d('0x35'),'ignore':![]},{'name':_0x437d('0x36'),'value':_0x437d('0x37'),'ignore':![]}];var _0x54aeef=_(_0x141f2b)[_0x437d('0x38')]('ignore')['map'](_0x437d('0x39'))[_0x437d('0x39')]();if(_['includes'](_0x54aeef,_0x1c0495[_0x437d('0x31')])){return;}var _0x2ba441=_[_0x437d('0x3a')](_0x141f2b,[_0x437d('0x39'),_0x1c0495[_0x437d('0x31')]])[_0x437d('0x3b')];return db[_0x437d('0x3c')][_0x437d('0x2f')]({'where':{'type':_0x2ba441,'resourceId':_0x1c0495['id']}})[_0x437d('0x1a')](function(){return _0x2cb12d;});})[_0x437d('0x1a')](function(){_0xe3d28e[_0x437d('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cee09){return function(_0x2df3a3){if(!_0x2df3a3){_0x2cee09[_0x437d('0x23')](0x194);}return _0x2df3a3;};}function handleError(_0x5b38a8,_0x54aae4){_0x54aae4=_0x54aae4||0x1f4;return function(_0xffdd62){logger[_0x437d('0x1e')](_0xffdd62['stack']);if(_0xffdd62['name']){delete _0xffdd62[_0x437d('0x3b')];}_0x5b38a8['status'](_0x54aae4)[_0x437d('0x3d')](_0xffdd62);};}exports[_0x437d('0x3e')]=function(_0x21824b,_0x367241){var _0xe89b0f={},_0x217176={'count':0x0,'rows':[]};var _0x360907=_(db[_0x437d('0x3f')][_0x437d('0x40')])[_0x437d('0x41')](function(_0x538427){return{'name':_0x538427[_0x437d('0x42')],'type':_0x538427[_0x437d('0x43')][_0x437d('0x44')]};})[_0x437d('0x38')](function(_0x17e6de){return!_['includes'](['password',_0x437d('0x45')],_0x17e6de['name']);})[_0x437d('0x39')]();_0xe89b0f=qs[_0x437d('0x46')](_0x360907,_0x21824b);var _0x9e28a3={'where':_0xe89b0f['where']};return db[_0x437d('0x3f')][_0x437d('0x2a')](_0x9e28a3)[_0x437d('0x1a')](function(_0x182dd3){_0x217176[_0x437d('0x2a')]=_0x182dd3;if(_0x21824b[_0x437d('0x47')][_0x437d('0x48')]){_0xe89b0f['include']=[{'all':!![]}];}if(_0x21824b['query'][_0x437d('0x49')]==='true'){_0xe89b0f[_0x437d('0x4a')]=[{'model':db[_0x437d('0x4b')],'as':_0x437d('0x49')}];}if(!_['includes'](_0xe89b0f['attributes'],'id')){_0xe89b0f[_0x437d('0x4c')][_0x437d('0x4d')]('id');}return db[_0x437d('0x3f')][_0x437d('0x4e')](_0xe89b0f);})[_0x437d('0x1a')](function(_0x38fe38){_0x217176[_0x437d('0x4f')]=_0x38fe38;if(_0x21824b[_0x437d('0x47')][_0x437d('0x50')]===_0x437d('0x51')){var _0x4c0730=[];for(var _0x4056fc=0x0;_0x4056fc<_0x217176[_0x437d('0x4f')]['length'];_0x4056fc++){_0x4c0730['push'](get_open_tabs(_0x437d('0x52'),_0x217176['rows'][_0x4056fc][_0x437d('0x53')]));_0x4c0730[_0x437d('0x4d')](get_open_tabs(_0x437d('0x54'),_0x217176['rows'][_0x4056fc][_0x437d('0x53')]));_0x4c0730[_0x437d('0x4d')](get_open_tabs(_0x437d('0x55'),_0x217176[_0x437d('0x4f')][_0x4056fc]['dataValues']));_0x4c0730['push'](get_open_tabs(_0x437d('0x56'),_0x217176[_0x437d('0x4f')][_0x4056fc][_0x437d('0x53')]));_0x4c0730[_0x437d('0x4d')](get_open_tabs('openchannel',_0x217176[_0x437d('0x4f')][_0x4056fc]['dataValues']));_0x4c0730[_0x437d('0x4d')](get_open_tabs('whatsapp',_0x217176[_0x437d('0x4f')][_0x4056fc][_0x437d('0x53')]));}return BPromise[_0x437d('0x57')](_0x4c0730)[_0x437d('0x1a')](function(){return _0x217176;});}else{return _0x217176;}})['then'](respondWithFilteredResult(_0x367241,_0xe89b0f))[_0x437d('0x22')](handleError(_0x367241,null));};exports['show']=function(_0x434e99,_0x3fa9ce){var _0x34f7db={'raw':![],'where':{'id':_0x434e99[_0x437d('0x58')]['id']}},_0x1c0f54={};_0x1c0f54['model']=_['differenceBy'](_[_0x437d('0x59')](db[_0x437d('0x3f')][_0x437d('0x40')]),[_0x437d('0x5a'),_0x437d('0x45')]);_0x1c0f54[_0x437d('0x47')]=_[_0x437d('0x59')](_0x434e99['query']);_0x1c0f54[_0x437d('0x5b')]=_['intersection'](_0x1c0f54['model'],_0x1c0f54['query']);_0x34f7db['attributes']=_[_0x437d('0x5c')](_0x1c0f54[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x434e99[_0x437d('0x47')][_0x437d('0x5e')]));_0x34f7db[_0x437d('0x4c')]=_0x34f7db[_0x437d('0x4c')][_0x437d('0x5f')]?_0x34f7db['attributes']:_0x1c0f54['model'];if(_0x434e99[_0x437d('0x47')][_0x437d('0x48')]){_0x34f7db[_0x437d('0x4a')]=[{'all':!![]}];}if(_0x434e99[_0x437d('0x47')][_0x437d('0x49')]===_0x437d('0x51')){_0x34f7db[_0x437d('0x4a')]=[{'model':db[_0x437d('0x4b')],'as':_0x437d('0x49')}];}_0x34f7db=_[_0x437d('0x60')]({},_0x34f7db,_0x434e99['options']);if(!_[_0x437d('0x61')](_0x34f7db['attributes'],'id')){_0x34f7db[_0x437d('0x4c')][_0x437d('0x4d')]('id');}return db['User']['find'](_0x34f7db)['then'](handleEntityNotFound(_0x3fa9ce,null))[_0x437d('0x1a')](function(_0x350860){var _0x236c0c=[];values=_0x350860;if(_0x434e99['query'][_0x437d('0x50')]===_0x437d('0x51')){_0x236c0c['push'](get_open_tabs('chat',_0x350860['dataValues']));_0x236c0c[_0x437d('0x4d')](get_open_tabs(_0x437d('0x54'),_0x350860['dataValues']));_0x236c0c['push'](get_open_tabs('openchannel',_0x350860['dataValues']));_0x236c0c['push'](get_open_tabs(_0x437d('0x62'),_0x350860['dataValues']));_0x236c0c['push'](get_open_tabs(_0x437d('0x55'),_0x350860[_0x437d('0x53')]));_0x236c0c[_0x437d('0x4d')](get_open_tabs(_0x437d('0x56'),_0x350860[_0x437d('0x53')]));return BPromise[_0x437d('0x57')](_0x236c0c);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x3fa9ce,null))[_0x437d('0x22')](handleError(_0x3fa9ce,null));};exports[_0x437d('0x2d')]=function(_0x1cd686,_0x5941cc){if(_0x1cd686[_0x437d('0x63')]['id']){delete _0x1cd686[_0x437d('0x63')]['id'];}delete _0x1cd686[_0x437d('0x63')][_0x437d('0x31')];return db['User'][_0x437d('0x3a')]({'where':{'id':_0x1cd686[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x5941cc,null))['then'](saveUpdates(_0x1cd686[_0x437d('0x63')],null))['then'](respondWithResult(_0x5941cc,null))[_0x437d('0x22')](handleError(_0x5941cc,null));};exports[_0x437d('0x64')]=function(_0x2dcf18,_0x5041c1){return db[_0x437d('0x3f')][_0x437d('0x64')]()[_0x437d('0x1a')](respondWithResult(_0x5041c1,null))[_0x437d('0x22')](handleError(_0x5041c1,null));};exports[_0x437d('0x65')]=function(_0x30d4f6,_0x1d8e24){return db['User'][_0x437d('0x3a')]({'where':{'id':_0x30d4f6['params']['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x1d8e24,null))[_0x437d('0x1a')](function(_0x567d09){if(_0x567d09){return _0x567d09[_0x437d('0x65')](_0x30d4f6['body'][_0x437d('0x66')],_['omit'](_0x30d4f6[_0x437d('0x63')],[_0x437d('0x66'),'id'])||{});}})[_0x437d('0x1a')](respondWithResult(_0x1d8e24,null))[_0x437d('0x22')](handleError(_0x1d8e24,null));};function validateUser(_0xb4a543){return new BPromise(function(_0x19246a,_0x13cffe){if(_0xb4a543[_0x437d('0x67')])return _0x19246a(_0xb4a543);return db[_0x437d('0x68')]['findById'](0x1)[_0x437d('0x1a')](function(_0x31b3df){if(_0x31b3df['securePassword'])authService[_0x437d('0x69')](_0xb4a543[_0x437d('0x5a')]);db['User'][_0x437d('0x6a')](_0x437d('0x67'))[_0x437d('0x1a')](function(_0x46845d){if(_[_0x437d('0x6b')](_0x46845d)){_0xb4a543['internal']=_0x31b3df[_0x437d('0x6c')]||0x1;return;}if(_[_0x437d('0x6b')](_0x31b3df[_0x437d('0x6c')])||_0x31b3df[_0x437d('0x6c')]===_0x46845d){_0xb4a543[_0x437d('0x67')]=_0x46845d+0x1;return;}if(_0x31b3df[_0x437d('0x6c')]>_0x46845d){_0xb4a543['internal']=_0x31b3df[_0x437d('0x6c')];return;}return db[_0x437d('0x6d')][_0x437d('0x47')](_0x437d('0x6e'),{'type':db[_0x437d('0x6d')][_0x437d('0x6f')][_0x437d('0x70')]})[_0x437d('0x1a')](function(_0x145243){if(_0x145243&&_0x145243[_0x437d('0x5f')]){for(var _0x382fda=0x0,_0x54488e=_0x145243[_0x437d('0x5f')];_0x382fda<_0x54488e&&_[_0x437d('0x6b')](_0xb4a543[_0x437d('0x67')]);_0x382fda++){if(_0x31b3df[_0x437d('0x6c')]<=_0x145243[_0x382fda]['from']){_0xb4a543[_0x437d('0x67')]=_0x145243[_0x382fda]['from'];}else if(_0x31b3df[_0x437d('0x6c')]>_0x145243[_0x382fda][_0x437d('0x71')]&&_0x31b3df[_0x437d('0x6c')]<=_0x145243[_0x382fda]['to']){_0xb4a543[_0x437d('0x67')]=_0x31b3df[_0x437d('0x6c')];}}}if(_[_0x437d('0x6b')](_0xb4a543[_0x437d('0x67')])){_0xb4a543[_0x437d('0x67')]=_0x46845d+0x1;}return _0x19246a(_0xb4a543);});});})[_0x437d('0x22')](function(_0x26dd0a){_0x13cffe(_0x26dd0a);});});}function updateUser(_0x29bfb2){return new BPromise(function(_0x484604,_0x1784df){try{if(_0x29bfb2[_0x437d('0x72')]){_0x29bfb2[_0x437d('0x73')]=_0x29bfb2[_0x437d('0x67')];_0x29bfb2[_0x437d('0x74')]={'mailbox':_0x29bfb2[_0x437d('0x67')],'password':_0x29bfb2[_0x437d('0x5a')],'fullname':_0x29bfb2['fullname'],'email':_0x29bfb2[_0x437d('0x75')]};}if(_0x29bfb2[_0x437d('0x31')]===_0x437d('0x35')){if(!_0x29bfb2[_0x437d('0x76')])_0x29bfb2[_0x437d('0x76')]=['101',_0x437d('0x77'),_0x437d('0x78'),_0x437d('0x79'),'110',_0x437d('0x7a'),'105','106',_0x437d('0x7b'),_0x437d('0x7c'),_0x437d('0x7d'),_0x437d('0x7e'),_0x437d('0x7f'),_0x437d('0x80'),_0x437d('0x81')];}_0x484604(_0x29bfb2);}catch(_0xd72ee){_0x1784df(_0xd72ee);}});}exports['create']=function(_0x93f9e8,_0x21a560){if(_0x93f9e8[_0x437d('0x33')][_0x437d('0x31')]===_0x437d('0x35'))throw new Error(_0x437d('0x82'));if(_0x93f9e8['body'][_0x437d('0x31')]===_0x437d('0x33')&&_0x93f9e8[_0x437d('0x33')][_0x437d('0x31')]!==_0x437d('0x32')){throw new Error(_0x437d('0x83'));}if(_0x93f9e8[_0x437d('0x63')]['role']===_0x437d('0x32')&&_0x93f9e8[_0x437d('0x33')]['role']!==_0x437d('0x32')){throw new Error(_0x437d('0x84'));}return licenseUtil['checkUserLimits']([_0x93f9e8[_0x437d('0x63')]])[_0x437d('0x1a')](function(){return validateUser(_0x93f9e8[_0x437d('0x63')]);})[_0x437d('0x1a')](function(_0x31ccd9){return updateUser(_0x31ccd9)['then'](function(_0x195fc7){if(_0x195fc7[_0x437d('0x31')]===_0x437d('0x32')){_0x195fc7['settingsEnabled']=_0x93f9e8['user'][_0x437d('0x85')];delete _0x195fc7['userProfileId'];}return _0x195fc7;});})[_0x437d('0x1a')](function(_0x4d3a78){return db[_0x437d('0x3f')]['create'](_0x4d3a78,{'include':[{'model':db[_0x437d('0x74')],'as':_0x437d('0x74')}]});})[_0x437d('0x1a')](function(_0xe2c9d9){if(_0x93f9e8[_0x437d('0x63')][_0x437d('0x31')]===_0x437d('0x33'))return _0xe2c9d9;if(_0x93f9e8[_0x437d('0x33')][_0x437d('0x31')]!=='user')return _0xe2c9d9;return db['UserProfileSection'][_0x437d('0x3a')]({'where':{'name':_0xe2c9d9[_0x437d('0x31')]==='agent'?'Agents':_0x437d('0x36'),'userProfileId':_0x93f9e8['user'][_0x437d('0x86')]},'raw':!![]})['then'](function(_0xec4f06){if(!_0xec4f06||_0xec4f06['autoAssociation']!=0x0)return _0xe2c9d9;return db['UserProfileResource'][_0x437d('0x87')]({'name':_0xe2c9d9[_0x437d('0x3b')],'resourceId':_0xe2c9d9['id'],'type':_0xec4f06[_0x437d('0x3b')],'sectionId':_0xec4f06['id']},{})[_0x437d('0x1a')](function(){return _0xe2c9d9;});})[_0x437d('0x22')](function(_0x50f0b3){logger[_0x437d('0x1e')](_0x437d('0x88'),_0x50f0b3);throw _0x50f0b3;});})[_0x437d('0x1a')](respondWithResult(_0x21a560,0xc9))['catch'](handleError(_0x21a560,null));};exports[_0x437d('0x89')]=function(_0x5ab7fb,_0x2a246b){var _0x2b14b3=_0x5ab7fb[_0x437d('0x63')];var _0x27f2e0=[];if(_0x5ab7fb[_0x437d('0x33')][_0x437d('0x31')]==='agent')throw new Error(_0x437d('0x82'));if(_[_0x437d('0x8a')](_0x2b14b3,['role',_0x437d('0x33')])&&_0x5ab7fb['user']['role']!==_0x437d('0x32')){throw new Error(_0x437d('0x83'));}if(_[_0x437d('0x8a')](_0x2b14b3,[_0x437d('0x31'),_0x437d('0x32')])&&_0x5ab7fb['user'][_0x437d('0x31')]!==_0x437d('0x32')){throw new Error(_0x437d('0x8b'));}return licenseUtil[_0x437d('0x8c')](_0x2b14b3)[_0x437d('0x1a')](function(){return validateUser(_0x2b14b3[0x0]);})[_0x437d('0x1a')](function(){for(var _0x521f35=0x1;_0x521f35<_0x2b14b3['length'];_0x521f35++){var _0x36336b=_0x2b14b3[_0x521f35-0x1][_0x437d('0x67')];if(!_0x2b14b3[_0x521f35][_0x437d('0x67')])_0x2b14b3[_0x521f35]['internal']=_0x36336b+0x1;_0x27f2e0[_0x437d('0x4d')](validateUser(_0x2b14b3[_0x521f35]));}return BPromise['all'](_0x27f2e0);})[_0x437d('0x1a')](function(){_0x27f2e0=[];for(var _0x174af3=0x0;_0x174af3<_0x2b14b3['length'];_0x174af3++){_0x27f2e0[_0x437d('0x4d')](updateUser(_0x2b14b3[_0x174af3]));}return BPromise[_0x437d('0x57')](_0x27f2e0);})['then'](function(){return BPromise[_0x437d('0x8d')](_0x2b14b3,function(_0x296f03){return db['User'][_0x437d('0x87')](_0x296f03,{'include':[{'model':db[_0x437d('0x74')],'as':_0x437d('0x74')}]})[_0x437d('0x1a')](function(_0x49cca3){_0x296f03['id']=_0x49cca3['id'];return _0x296f03;});});})[_0x437d('0x1a')](function(_0x243dd9){if(_0x5ab7fb[_0x437d('0x63')][_0x437d('0x31')]===_0x437d('0x33'))return _0x243dd9;if(_0x5ab7fb[_0x437d('0x33')]['role']!==_0x437d('0x33'))return _0x243dd9;var _0x19730b=_[_0x437d('0x8a')](_0x243dd9,function(_0x2e822c){return _0x2e822c['role']==='agent'||_0x2e822c[_0x437d('0x31')]==='telephone';});if(!_0x19730b)return _0x243dd9;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x437d('0x34'),_0x437d('0x36')]},'userProfileId':_0x5ab7fb[_0x437d('0x33')]['userProfileId']},'raw':!![]})[_0x437d('0x1a')](function(_0x299d46){if(_[_0x437d('0x8e')](_0x299d46)||!_[_0x437d('0x8a')](_0x299d46,['autoAssociation',0x0]))return _0x243dd9;_0x27f2e0=[];var _0x1cefcf=_(_0x299d46)[_0x437d('0x41')](function(_0x516fd1){if(_0x516fd1[_0x437d('0x8f')]===0x1)return;return _0x516fd1[_0x437d('0x3b')]===_0x437d('0x34')?_0x437d('0x35'):_0x437d('0x37');})[_0x437d('0x90')]()[_0x437d('0x39')]();for(var _0x524d78=0x0;_0x524d78<_0x243dd9['length'];_0x524d78++){if(!_['includes'](_0x1cefcf,_0x243dd9[_0x524d78][_0x437d('0x31')]))return;var _0xb36ec7=_0x243dd9[_0x524d78]['role']===_0x437d('0x35')?_0x437d('0x34'):_0x437d('0x36');_0x27f2e0['push'](db[_0x437d('0x3c')][_0x437d('0x87')]({'name':_0x243dd9[_0x524d78][_0x437d('0x3b')],'resourceId':_0x243dd9[_0x524d78]['id'],'type':_0xb36ec7,'sectionId':_[_0x437d('0x3a')](_0x299d46,['name',_0xb36ec7])['id']},{}));}return BPromise[_0x437d('0x57')](_0x27f2e0);});})[_0x437d('0x1a')](respondWithResult(_0x2a246b,0xc9))['catch'](handleError(_0x2a246b,null));};exports[_0x437d('0x91')]=function(_0x10d710,_0x51a70d){if(_0x10d710[_0x437d('0x63')]['id']){delete _0x10d710[_0x437d('0x63')]['id'];}return db[_0x437d('0x3f')][_0x437d('0x3a')]({'where':{'id':_0x10d710[_0x437d('0x58')]['id']}})['then'](function(_0x319208){if(!_0x319208)return null;if(_0x319208['id']===_0x10d710['user']['id']){if(!_0x10d710[_0x437d('0x63')][_0x437d('0x92')]||!_0x10d710['body'][_0x437d('0x93')]){throw new db[(_0x437d('0x94'))][(_0x437d('0x95'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x319208['authenticate'](_0x10d710['body']['oldPassword'])){throw new db[(_0x437d('0x94'))]['ValidationError'](_0x437d('0x96'));}if(_0x10d710[_0x437d('0x63')][_0x437d('0x92')]===_0x10d710['body']['newPassword']){throw new db[(_0x437d('0x94'))][(_0x437d('0x95'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x10d710['user']['role']==='admin'){if(!_0x10d710[_0x437d('0x63')]['newPassword']){throw new db[(_0x437d('0x94'))][(_0x437d('0x95'))](_0x437d('0x97'));}}else if(_0x10d710['user'][_0x437d('0x31')]===_0x437d('0x33')){if(!_0x10d710[_0x437d('0x63')][_0x437d('0x93')]){throw new db[(_0x437d('0x94'))][(_0x437d('0x95'))](_0x437d('0x97'));}if(_0x319208[_0x437d('0x31')]!=='agent'){throw new db[(_0x437d('0x94'))]['ValidationError']('Unauthorized');}}else{throw new db['Sequelize']['ValidationError'](_0x437d('0x82'));}return _0x319208;})[_0x437d('0x1a')](handleEntityNotFound(_0x51a70d,null))[_0x437d('0x1a')](function(_0x3d9125){return db[_0x437d('0x68')]['findOne']({'attributes':['id',_0x437d('0x98'),_0x437d('0x99'),'passwordHistoryLimit']})[_0x437d('0x1a')](function(_0xffad65){if(_0xffad65['securePassword'])authService[_0x437d('0x69')](_0x10d710[_0x437d('0x63')][_0x437d('0x93')]);if(!_0xffad65[_0x437d('0x99')]||!_0x3d9125[_0x437d('0x9a')])return _0x3d9125;authService['validatePasswordHistory'](_0x10d710[_0x437d('0x63')][_0x437d('0x93')],_0x3d9125[_0x437d('0x9a')],_0xffad65['passwordHistoryLimit']);return _0x3d9125;})[_0x437d('0x1a')](saveUpdates({'password':_0x10d710[_0x437d('0x63')][_0x437d('0x93')],'passwordResetAt':_0x10d710['user']['id']==_0x10d710[_0x437d('0x58')]['id']?moment():null,'previousPasswords':authService[_0x437d('0x9b')](_0x10d710[_0x437d('0x63')][_0x437d('0x93')],_0x3d9125[_0x437d('0x9a')])},null));})[_0x437d('0x1a')](respondWithResult(_0x51a70d,null))[_0x437d('0x22')](handleError(_0x51a70d,null));};exports['addQueues']=function(_0x39b549,_0xc6e783){var _0x1635c1=_0x39b549['body'][_0x437d('0x9c')];return db[_0x437d('0x3f')][_0x437d('0x3a')]({'where':{'id':_0x39b549['params']['id']},'attributes':['id','name',_0x437d('0x31'),_0x437d('0x9d'),'loginInPause',_0x437d('0x9e'),'interface']})[_0x437d('0x1a')](handleEntityNotFound(_0xc6e783,null))[_0x437d('0x1a')](function(_0x1f52f6){if(_0x1f52f6){if(!utils[_0x437d('0x9f')](_0x1635c1)){throw new db['Sequelize'][(_0x437d('0x95'))](_0x437d('0xa0'));}return _0x1f52f6[_0x437d('0xa1')+_[_0x437d('0xa2')](_0x1635c1[_0x437d('0xa3')]())+_0x437d('0xa4')](_0x39b549[_0x437d('0x63')][_0x437d('0x66')],{'penalty':_0x39b549[_0x437d('0x63')][_0x437d('0xa5')]||0x0})[_0x437d('0xa6')](function(_0x4da3d0){for(var _0x207b29=0x0;_0x207b29<_0x39b549[_0x437d('0x63')][_0x437d('0x66')][_0x437d('0x5f')];_0x207b29+=0x1){var _0x3bf598={'UserId':Number(_0x39b549['params']['id'])};_0x3bf598[_[_0x437d('0xa2')](_0x1635c1['toLowerCase']())+_0x437d('0xa7')]=Number(_0x39b549[_0x437d('0x63')][_0x437d('0x66')][_0x207b29]);socket[_0x437d('0xa8')](_0x437d('0x33')+_[_0x437d('0xa2')](_0x1635c1[_0x437d('0xa3')]())+'Queue:save',_0x3bf598);}return _0x4da3d0;})[_0x437d('0x1a')](function(){if(_0x1635c1===_0x437d('0xa9')){return db[_0x437d('0xaa')][_0x437d('0x4e')]({'where':{'id':_0x39b549[_0x437d('0x63')][_0x437d('0x66')]||[]},'raw':!![],'attributes':['id',_0x437d('0x3b')]});}})[_0x437d('0x1a')](function(_0x3c5154){var _0x343f22=_0x1f52f6['get']({'plain':!![]});var _0x1dbdcd=[];if(_0x1635c1===_0x437d('0xa9')&&_0x343f22[_0x437d('0x31')]===_0x437d('0x35')&&_0x343f22[_0x437d('0x9d')]){for(var _0x5f2e2b=0x0;_0x5f2e2b<_0x3c5154[_0x437d('0x5f')];_0x5f2e2b+=0x1){_0x1dbdcd[_0x437d('0x4d')]({'membername':_0x343f22[_0x437d('0x3b')],'UserId':_0x343f22['id'],'queue_name':_0x3c5154[_0x5f2e2b][_0x437d('0x3b')],'VoiceQueueId':_0x3c5154[_0x5f2e2b]['id'],'interface':_[_0x437d('0x6b')](_0x343f22[_0x437d('0xab')])?util[_0x437d('0xac')](_0x437d('0xad'),_0x343f22[_0x437d('0x3b')]):_0x343f22['interface'],'paused':_0x343f22[_0x437d('0x9e')]||![],'penalty':_0x39b549[_0x437d('0x63')]['penalty']||0x0});}return BPromise[_0x437d('0x8d')](_0x1dbdcd,function(_0x354306){return db[_0x437d('0xae')][_0x437d('0xaf')](_0x354306);});}return _0x1f52f6;});}})['then'](respondWithStatusCode(_0xc6e783,null))['catch'](handleError(_0xc6e783,null));};exports['removeQueues']=function(_0x21cbf2,_0x371d0a){var _0x4d5e37,_0x402089;return db[_0x437d('0x3f')]['find']({'where':{'id':_0x21cbf2[_0x437d('0x58')]['id']},'attributes':['id',_0x437d('0x3b'),_0x437d('0x31')]})[_0x437d('0x1a')](handleEntityNotFound(_0x371d0a,null))[_0x437d('0x1a')](function(_0x2ce9ca){if(_0x2ce9ca){_0x4d5e37=_0x2ce9ca;if(!_0x21cbf2[_0x437d('0x47')][_0x437d('0x9c')]||!utils['isValidChannel'](_0x21cbf2[_0x437d('0x47')]['channel'])){throw new db['Sequelize'][(_0x437d('0x95'))]('Unknown\x20channel');}return _0x2ce9ca[_0x437d('0xb0')+_[_0x437d('0xa2')](_0x21cbf2[_0x437d('0x47')][_0x437d('0x9c')][_0x437d('0xa3')]())+'Queues'](_0x21cbf2[_0x437d('0x47')][_0x437d('0x66')]);}})[_0x437d('0x1a')](function(_0x46a5df){if(_[_0x437d('0xb1')](_0x21cbf2[_0x437d('0x47')][_0x437d('0x66')])){for(var _0x212dfc=0x0;_0x212dfc<_0x21cbf2[_0x437d('0x47')][_0x437d('0x66')][_0x437d('0x5f')];_0x212dfc+=0x1){_0x402089={'UserId':Number(_0x21cbf2[_0x437d('0x58')]['id'])};_0x402089[_[_0x437d('0xa2')](_0x21cbf2[_0x437d('0x47')][_0x437d('0x9c')]['toLowerCase']())+_0x437d('0xa7')]=Number(_0x21cbf2[_0x437d('0x47')][_0x437d('0x66')][_0x212dfc]);socket['emit'](_0x437d('0x33')+_[_0x437d('0xa2')](_0x21cbf2[_0x437d('0x47')]['channel'][_0x437d('0xa3')]())+_0x437d('0xb2'),_0x402089);}}else{_0x402089={'UserId':Number(_0x21cbf2[_0x437d('0x58')]['id'])};_0x402089[_[_0x437d('0xa2')](_0x21cbf2[_0x437d('0x47')][_0x437d('0x9c')][_0x437d('0xa3')]())+_0x437d('0xa7')]=Number(_0x21cbf2[_0x437d('0x47')][_0x437d('0x66')]);socket['emit']('user'+_['capitalize'](_0x21cbf2[_0x437d('0x47')]['channel'][_0x437d('0xa3')]())+_0x437d('0xb2'),_0x402089);}return _0x46a5df;})[_0x437d('0x1a')](function(){if(_0x21cbf2[_0x437d('0x47')][_0x437d('0x9c')]===_0x437d('0xa9')){return db['UserVoiceQueueRt'][_0x437d('0x2f')]({'where':{'UserId':_0x21cbf2['params']['id'],'VoiceQueueId':_0x21cbf2[_0x437d('0x47')]['ids']},'individualHooks':!![]})[_0x437d('0x1a')](function(){return _0x4d5e37;});}return _0x4d5e37;})[_0x437d('0x1a')](respondWithStatusCode(_0x371d0a,null))[_0x437d('0x22')](handleError(_0x371d0a,null));};exports[_0x437d('0xb3')]=function(_0x1d7961,_0x5c4656){_0x1d7961[_0x437d('0x63')][_0x437d('0xb4')]=_0x1d7961[_0x437d('0xb5')][_0x437d('0xb6')];return db[_0x437d('0x3f')]['find']({'where':{'id':_0x1d7961[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x5c4656,null))[_0x437d('0x1a')](saveUpdates(_0x1d7961[_0x437d('0x63')],null))[_0x437d('0x1a')](respondWithResult(_0x5c4656,null))[_0x437d('0x22')](handleError(_0x5c4656,null));};exports['getAvatar']=function(_0x2876ac,_0x21529a){var _0xb6bdb0=path['join'](config[_0x437d('0xb7')],'server/files/images/logos/default_profile.png');return db[_0x437d('0x3f')][_0x437d('0x3a')]({'where':{'id':_0x2876ac['params']['id']},'attributes':['id',_0x437d('0xb4')],'raw':!![]})[_0x437d('0x1a')](handleEntityNotFound(_0x21529a,null))[_0x437d('0x1a')](function(_0x430897){if(_0x430897){if(_[_0x437d('0x6b')](_0x430897['userpic'])){return _0x21529a[_0x437d('0xb8')](_0xb6bdb0);}else{if(!fs[_0x437d('0xb9')](path[_0x437d('0xba')](config['root'],'server/files/images/',_0x430897[_0x437d('0xb4')]))){return _0x21529a[_0x437d('0xb8')](_0xb6bdb0);}return _0x21529a['download'](path[_0x437d('0xba')](config[_0x437d('0xb7')],_0x437d('0xbb'),_0x430897[_0x437d('0xb4')]));}}})[_0x437d('0x22')](handleError(_0x21529a,null));};exports[_0x437d('0xbc')]=function(_0x5d1878,_0x239774){return db[_0x437d('0x3f')]['find']({'where':{'id':_0x5d1878[_0x437d('0x58')]['id']},'attributes':['id']})[_0x437d('0x1a')](handleEntityNotFound(_0x239774,null))[_0x437d('0x1a')](function(_0x4edcf3){var _0x320ddf=[];values=_0x4edcf3['dataValues'];_0x320ddf[_0x437d('0x4d')](get_open_tabs(_0x437d('0x52'),_0x4edcf3[_0x437d('0x53')]));_0x320ddf['push'](get_open_tabs(_0x437d('0x54'),_0x4edcf3['dataValues']));_0x320ddf['push'](get_open_tabs(_0x437d('0xbd'),_0x4edcf3[_0x437d('0x53')]));_0x320ddf[_0x437d('0x4d')](get_open_tabs(_0x437d('0x62'),_0x4edcf3['dataValues']));_0x320ddf[_0x437d('0x4d')](get_open_tabs(_0x437d('0x55'),_0x4edcf3[_0x437d('0x53')]));_0x320ddf[_0x437d('0x4d')](get_open_tabs(_0x437d('0x56'),_0x4edcf3[_0x437d('0x53')]));return BPromise[_0x437d('0x57')](_0x320ddf);})[_0x437d('0x1a')](function(_0x299105){if(_0x299105){var _0x1966bc=_[_0x437d('0x41')](values[_0x437d('0xbe')],function(_0x3903a7){return{'channel':_0x437d('0xbf'),'id':_0x3903a7['id'],'createdAt':_0x3903a7['createdAt']};});var _0x338b7f=_['map'](values[_0x437d('0xc0')],function(_0x13b5a1){return{'channel':_0x437d('0xc1'),'id':_0x13b5a1['id'],'createdAt':_0x13b5a1[_0x437d('0xc2')]};});var _0x1cd858=_['map'](values[_0x437d('0xc3')],function(_0x646c69){return{'channel':_0x437d('0xc4'),'id':_0x646c69['id'],'createdAt':_0x646c69[_0x437d('0xc2')]};});var _0x5b188f=_['map'](values[_0x437d('0xc5')],function(_0x325faf){return{'channel':_0x437d('0xc6'),'id':_0x325faf['id'],'createdAt':_0x325faf[_0x437d('0xc2')]};});var _0x10c7f4=_[_0x437d('0x41')](values['SmsOpenTabs'],function(_0x5b2186){return{'channel':_0x437d('0xc7'),'id':_0x5b2186['id'],'createdAt':_0x5b2186[_0x437d('0xc2')]};});var _0x19dcf2=_[_0x437d('0x41')](values[_0x437d('0xc8')],function(_0x5d7f28){return{'channel':_0x437d('0xc9'),'id':_0x5d7f28['id'],'createdAt':_0x5d7f28[_0x437d('0xc2')]};});var _0x47cd49=_['concat'](_0x1966bc,_0x338b7f,_0x1cd858,_0x5b188f,_0x10c7f4,_0x19dcf2);var _0x58820e={'count':_0x47cd49[_0x437d('0x5f')],'rows':_0x47cd49};return _0x58820e;}else return null;})[_0x437d('0x1a')](respondWithResult(_0x239774,null))['catch'](handleError(_0x239774,null));};exports[_0x437d('0xca')]=function(_0x369968,_0x4b1fda){var _0x2e2f75={};var _0x46ba52={};var _0x32806b;var _0x191392;return db['User']['findOne']({'where':{'id':_0x369968['params']['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x4b1fda,null))['then'](function(_0x3b9041){if(_0x3b9041){_0x32806b=_0x3b9041;_0x46ba52[_0x437d('0x5d')]=_['keys'](db[_0x437d('0xcb')][_0x437d('0x40')]);_0x46ba52[_0x437d('0x47')]=_[_0x437d('0x59')](_0x369968['query']);_0x46ba52['filters']=_['intersection'](_0x46ba52[_0x437d('0x5d')],_0x46ba52[_0x437d('0x47')]);_0x2e2f75[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x46ba52[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x369968[_0x437d('0x47')][_0x437d('0x5e')]));_0x2e2f75['attributes']=_0x2e2f75[_0x437d('0x4c')][_0x437d('0x5f')]?_0x2e2f75[_0x437d('0x4c')]:_0x46ba52['model'];_0x2e2f75[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x369968[_0x437d('0x47')][_0x437d('0xcd')]);_0x2e2f75[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x369968[_0x437d('0x47')],_0x46ba52[_0x437d('0x5b')]));if(_0x369968['query'][_0x437d('0x38')]){_0x2e2f75[_0x437d('0xce')]=_[_0x437d('0x60')](_0x2e2f75[_0x437d('0xce')],{'$or':_['map'](_0x2e2f75[_0x437d('0x4c')],function(_0xc2cac6){var _0x548fca={};_0x548fca[_0xc2cac6]={'$like':'%'+_0x369968[_0x437d('0x47')]['filter']+'%'};return _0x548fca;})});}_0x2e2f75=_[_0x437d('0x60')]({},_0x2e2f75,_0x369968[_0x437d('0xd0')]);return _0x32806b['getContacts'](_0x2e2f75);}})[_0x437d('0x1a')](function(_0x361bf2){if(_0x361bf2){_0x191392=_0x361bf2[_0x437d('0x5f')];if(_0x369968[_0x437d('0x47')][_0x437d('0xd1')](_0x437d('0x48'))){_0x2e2f75[_0x437d('0x4a')]=[{'model':db['CmList'],'as':_0x437d('0xd2'),'required':![]},{'model':db[_0x437d('0xd3')],'as':'Tags','attributes':['id',_0x437d('0x3b'),'color'],'where':_0x369968['query']['tag']?{'id':_0x369968[_0x437d('0x47')][_0x437d('0xd4')]}:undefined,'required':_0x369968[_0x437d('0x47')][_0x437d('0xd4')]?!![]:![]}];}if(!_0x369968[_0x437d('0x47')]['hasOwnProperty'](_0x437d('0xd5'))){_0x2e2f75[_0x437d('0x29')]=qs[_0x437d('0x29')](_0x369968[_0x437d('0x47')][_0x437d('0x29')]);_0x2e2f75[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x369968[_0x437d('0x47')][_0x437d('0x27')]);}return _0x32806b[_0x437d('0xca')](_0x2e2f75);}})['then'](function(_0x1147a1){if(_0x1147a1){return _0x1147a1?{'count':_0x191392,'rows':_0x1147a1}:null;}})[_0x437d('0x1a')](respondWithResult(_0x4b1fda,null))[_0x437d('0x22')](handleError(_0x4b1fda,null));};exports[_0x437d('0xd6')]=function(_0x3af163,_0x549c5e){var _0x13ff94;var _0x1c49dc={};var _0x40a5d3;return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x3af163[_0x437d('0x58')]['id']},'attributes':['id',_0x437d('0x3b'),_0x437d('0x31')]})[_0x437d('0x1a')](handleEntityNotFound(_0x549c5e,null))[_0x437d('0x1a')](function(_0x1c86dc){if(!utils[_0x437d('0x9f')](_0x3af163[_0x437d('0x47')][_0x437d('0x9c')])){throw new db[(_0x437d('0x94'))][(_0x437d('0x95'))](_0x437d('0xa0'));}_0x13ff94=_0x1c86dc;var _0x3da8b0={};_0x3da8b0[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_[_0x437d('0xa2')](_0x3af163[_0x437d('0x47')]['channel'])+'Queue'][_0x437d('0x40')]);_0x3da8b0[_0x437d('0x47')]=_[_0x437d('0x59')](_0x3af163[_0x437d('0x47')]);_0x3da8b0['filters']=_[_0x437d('0x5c')](_0x3da8b0['model'],_0x3da8b0[_0x437d('0x47')]);_0x1c49dc[_0x437d('0x4c')]=_['intersection'](_0x3da8b0[_0x437d('0x5d')],qs['fields'](_0x3af163[_0x437d('0x47')][_0x437d('0x5e')]));_0x1c49dc[_0x437d('0x4c')]=_0x1c49dc[_0x437d('0x4c')]['length']?_0x1c49dc[_0x437d('0x4c')]:_0x3da8b0['model'];_0x1c49dc[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x3af163[_0x437d('0x47')][_0x437d('0xcd')]);_0x1c49dc[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x3af163['query'],_0x3da8b0[_0x437d('0x5b')]));if(_0x3af163[_0x437d('0x47')][_0x437d('0x38')]){_0x1c49dc['where']=_[_0x437d('0x60')](_0x1c49dc[_0x437d('0xce')],{'$or':_['map'](_0x1c49dc['attributes'],function(_0x1ae670){var _0x46ac55={};_0x46ac55[_0x1ae670]={'$like':'%'+_0x3af163[_0x437d('0x47')][_0x437d('0x38')]+'%'};return _0x46ac55;})});}_0x1c49dc=_['merge']({},_0x1c49dc,_0x3af163['options']);switch(_0x13ff94[_0x437d('0x31')]){case _0x437d('0x32'):return db[_[_0x437d('0xa2')](_0x3af163[_0x437d('0x47')][_0x437d('0x9c')])+'Queue']['findAll'](_0x1c49dc);case'user':case _0x437d('0x35'):return _0x13ff94['get'+_[_0x437d('0xa2')](_0x3af163['query']['channel'])+_0x437d('0xa4')](_0x1c49dc);default:throw new db[(_0x437d('0x94'))][(_0x437d('0x95'))](_0x437d('0xd8'));}})[_0x437d('0x1a')](function(_0x1a1b01){_0x40a5d3=_0x1a1b01['length'];if(!_0x3af163[_0x437d('0x47')]['hasOwnProperty'](_0x437d('0xd5'))){_0x1c49dc[_0x437d('0x29')]=qs[_0x437d('0x29')](_0x3af163['query']['limit']);_0x1c49dc[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x3af163[_0x437d('0x47')][_0x437d('0x27')]);}switch(_0x13ff94[_0x437d('0x31')]){case _0x437d('0x32'):return db[_[_0x437d('0xa2')](_0x3af163[_0x437d('0x47')][_0x437d('0x9c')])+'Queue']['findAll'](_0x1c49dc);case _0x437d('0x33'):case _0x437d('0x35'):return _0x13ff94['get'+_['capitalize'](_0x3af163['query'][_0x437d('0x9c')])+'Queues'](_0x1c49dc);}})[_0x437d('0x1a')](function(_0xfc9efe){return{'count':_0x40a5d3,'rows':_0xfc9efe};})[_0x437d('0x1a')](respondWithResult(_0x549c5e,null))[_0x437d('0x22')](handleError(_0x549c5e,null));};exports['getVoiceQueuesRt']=function(_0x2f5922,_0x1a8a34){var _0x309541={};var _0x1a2815={};var _0x3bca85;var _0x1fcdfd;return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x2f5922[_0x437d('0x58')]['id']}})['then'](handleEntityNotFound(_0x1a8a34,null))[_0x437d('0x1a')](function(_0x1187db){if(_0x1187db){_0x3bca85=_0x1187db;_0x1a2815[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0xae')]['rawAttributes']);_0x1a2815[_0x437d('0x47')]=_['keys'](_0x2f5922['query']);_0x1a2815[_0x437d('0x5b')]=_['intersection'](_0x1a2815[_0x437d('0x5d')],_0x1a2815['query']);_0x309541[_0x437d('0x4c')]=_['intersection'](_0x1a2815['model'],qs[_0x437d('0x5e')](_0x2f5922[_0x437d('0x47')][_0x437d('0x5e')]));_0x309541['attributes']=_0x309541[_0x437d('0x4c')][_0x437d('0x5f')]?_0x309541['attributes']:_0x1a2815[_0x437d('0x5d')];_0x309541[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x2f5922[_0x437d('0x47')]['sort']);_0x309541['where']=qs[_0x437d('0x5b')](_['pick'](_0x2f5922['query'],_0x1a2815[_0x437d('0x5b')]));if(_0x2f5922[_0x437d('0x47')][_0x437d('0x38')]){_0x309541[_0x437d('0xce')]=_[_0x437d('0x60')](_0x309541[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0x309541[_0x437d('0x4c')],function(_0x265d5a){var _0x3496a6={};_0x3496a6[_0x265d5a]={'$like':'%'+_0x2f5922[_0x437d('0x47')][_0x437d('0x38')]+'%'};return _0x3496a6;})});}_0x309541=_[_0x437d('0x60')]({},_0x309541,_0x2f5922[_0x437d('0xd0')]);return _0x3bca85[_0x437d('0xd9')](_0x309541);}})[_0x437d('0x1a')](function(_0x1ab811){if(_0x1ab811){_0x1fcdfd=_0x1ab811['length'];if(!_0x2f5922[_0x437d('0x47')]['hasOwnProperty'](_0x437d('0xd5'))){_0x309541[_0x437d('0x29')]=qs[_0x437d('0x29')](_0x2f5922[_0x437d('0x47')][_0x437d('0x29')]);_0x309541[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x2f5922[_0x437d('0x47')][_0x437d('0x27')]);}return _0x3bca85[_0x437d('0xd9')](_0x309541);}})[_0x437d('0x1a')](function(_0x163e41){if(_0x163e41){return _0x163e41?{'count':_0x1fcdfd,'rows':_0x163e41}:null;}})[_0x437d('0x1a')](respondWithResult(_0x1a8a34,null))[_0x437d('0x22')](handleError(_0x1a8a34,null));};exports[_0x437d('0xda')]=function(_0x40914f,_0x391a2f){var _0x5bbd3c={};var _0x1b2dfb={};var _0x3f37a2;var _0x4ca056;return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x40914f[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x391a2f,null))['then'](function(_0x54b6de){if(_0x54b6de){_0x3f37a2=_0x54b6de;_0x1b2dfb[_0x437d('0x5d')]=_['keys'](db[_0x437d('0xdb')][_0x437d('0x40')]);_0x1b2dfb['query']=_['keys'](_0x40914f[_0x437d('0x47')]);_0x1b2dfb[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x1b2dfb[_0x437d('0x5d')],_0x1b2dfb[_0x437d('0x47')]);_0x5bbd3c[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x1b2dfb[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x40914f[_0x437d('0x47')][_0x437d('0x5e')]));_0x5bbd3c[_0x437d('0x4c')]=_0x5bbd3c[_0x437d('0x4c')][_0x437d('0x5f')]?_0x5bbd3c[_0x437d('0x4c')]:_0x1b2dfb[_0x437d('0x5d')];_0x5bbd3c[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x40914f['query'][_0x437d('0xcd')]);_0x5bbd3c[_0x437d('0xce')]=qs['filters'](_[_0x437d('0xcf')](_0x40914f[_0x437d('0x47')],_0x1b2dfb[_0x437d('0x5b')]));if(_0x40914f[_0x437d('0x47')][_0x437d('0x38')]){_0x5bbd3c[_0x437d('0xce')]=_[_0x437d('0x60')](_0x5bbd3c[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0x5bbd3c[_0x437d('0x4c')],function(_0x17b713){var _0x1eb820={};_0x1eb820[_0x17b713]={'$like':'%'+_0x40914f['query']['filter']+'%'};return _0x1eb820;})});}_0x5bbd3c=_[_0x437d('0x60')]({},_0x5bbd3c,_0x40914f[_0x437d('0xd0')]);return _0x3f37a2[_0x437d('0xda')](_0x5bbd3c);}})[_0x437d('0x1a')](function(_0xadb59c){if(_0xadb59c){_0x4ca056=_0xadb59c[_0x437d('0x5f')];if(!_0x40914f[_0x437d('0x47')]['hasOwnProperty'](_0x437d('0xd5'))){_0x5bbd3c['limit']=qs['limit'](_0x40914f['query']['limit']);_0x5bbd3c[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x40914f['query']['offset']);}return _0x3f37a2[_0x437d('0xda')](_0x5bbd3c);}})['then'](function(_0x40da4a){if(_0x40da4a){return _0x40da4a?{'count':_0x4ca056,'rows':_0x40da4a}:null;}})[_0x437d('0x1a')](respondWithResult(_0x391a2f,null))[_0x437d('0x22')](handleError(_0x391a2f,null));};exports[_0x437d('0xdc')]=function(_0x23ee9c,_0x2ce5a7){var _0x79dd67={'raw':!![],'where':{}};var _0x13fe99={};var _0x336d94={'count':0x0,'rows':[]};return db['User'][_0x437d('0xd7')]({'where':{'id':_0x23ee9c[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x2ce5a7,null))['then'](function(_0x2f84dc){if(_0x2f84dc){_0x13fe99['model']=_[_0x437d('0x59')](db[_0x437d('0xdd')][_0x437d('0x40')]);_0x13fe99[_0x437d('0x47')]=_[_0x437d('0x59')](_0x23ee9c[_0x437d('0x47')]);_0x13fe99[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x13fe99[_0x437d('0x5d')],_0x13fe99[_0x437d('0x47')]);_0x79dd67[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x13fe99[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x23ee9c[_0x437d('0x47')]['fields']));_0x79dd67['attributes']=_0x79dd67[_0x437d('0x4c')][_0x437d('0x5f')]?_0x79dd67[_0x437d('0x4c')]:_0x13fe99[_0x437d('0x5d')];if(!_0x23ee9c[_0x437d('0x47')]['hasOwnProperty'](_0x437d('0xd5'))){_0x79dd67[_0x437d('0x29')]=qs[_0x437d('0x29')](_0x23ee9c[_0x437d('0x47')]['limit']);_0x79dd67[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x23ee9c[_0x437d('0x47')]['offset']);}_0x79dd67[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x23ee9c[_0x437d('0x47')][_0x437d('0xcd')]);_0x79dd67[_0x437d('0xce')]=qs['filters'](_[_0x437d('0xcf')](_0x23ee9c['query'],_0x13fe99[_0x437d('0x5b')]));_0x79dd67[_0x437d('0xce')][_0x437d('0xde')]=_0x2f84dc['id'];if(_0x23ee9c[_0x437d('0x47')][_0x437d('0x38')]){_0x79dd67[_0x437d('0xce')]=_[_0x437d('0x60')](_0x79dd67[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0x79dd67[_0x437d('0x4c')],function(_0x1dc908){var _0x2b9cb8={};_0x2b9cb8[_0x1dc908]={'$like':'%'+_0x23ee9c[_0x437d('0x47')]['filter']+'%'};return _0x2b9cb8;})});}_0x79dd67=_[_0x437d('0x60')]({},_0x79dd67,_0x23ee9c[_0x437d('0xd0')]);return db['VoiceRecording']['count']({'where':_0x79dd67[_0x437d('0xce')]})[_0x437d('0x1a')](function(_0x430332){_0x336d94['count']=_0x430332;if(_0x23ee9c[_0x437d('0x47')]['includeAll']){_0x79dd67[_0x437d('0x4a')]=[{'all':!![]}];}return db[_0x437d('0xdd')]['findAll'](_0x79dd67);})[_0x437d('0x1a')](function(_0x309993){_0x336d94[_0x437d('0x4f')]=_0x309993;return _0x336d94;});}})[_0x437d('0x1a')](respondWithFilteredResult(_0x2ce5a7,_0x79dd67))[_0x437d('0x22')](handleError(_0x2ce5a7,null));};exports['getScreenRecordings']=function(_0xb005b2,_0x11a3d8){var _0x5e86d1={'raw':!![],'where':{}};var _0x426b19={};var _0x3ada71={'count':0x0,'rows':[]};return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0xb005b2[_0x437d('0x58')]['id']}})['then'](handleEntityNotFound(_0x11a3d8,null))['then'](function(_0x44230){if(_0x44230){_0x426b19[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0xdf')][_0x437d('0x40')]);_0x426b19[_0x437d('0x47')]=_[_0x437d('0x59')](_0xb005b2[_0x437d('0x47')]);_0x426b19[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x426b19['model'],_0x426b19[_0x437d('0x47')]);_0x5e86d1[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x426b19[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0xb005b2['query'][_0x437d('0x5e')]));_0x5e86d1[_0x437d('0x4c')]=_0x5e86d1[_0x437d('0x4c')][_0x437d('0x5f')]?_0x5e86d1[_0x437d('0x4c')]:_0x426b19[_0x437d('0x5d')];if(!_0xb005b2[_0x437d('0x47')][_0x437d('0xd1')](_0x437d('0xd5'))){_0x5e86d1[_0x437d('0x29')]=qs[_0x437d('0x29')](_0xb005b2[_0x437d('0x47')][_0x437d('0x29')]);_0x5e86d1[_0x437d('0x27')]=qs[_0x437d('0x27')](_0xb005b2[_0x437d('0x47')][_0x437d('0x27')]);}_0x5e86d1['order']=qs['sort'](_0xb005b2['query'][_0x437d('0xcd')]);_0x5e86d1[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0xb005b2['query'],_0x426b19[_0x437d('0x5b')]));_0x5e86d1[_0x437d('0xce')][_0x437d('0xde')]=_0x44230['id'];if(_0xb005b2[_0x437d('0x47')][_0x437d('0x38')]){_0x5e86d1[_0x437d('0xce')]=_[_0x437d('0x60')](_0x5e86d1[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0x5e86d1[_0x437d('0x4c')],function(_0x2553e3){var _0x1a9bd5={};_0x1a9bd5[_0x2553e3]={'$like':'%'+_0xb005b2[_0x437d('0x47')]['filter']+'%'};return _0x1a9bd5;})});}_0x5e86d1=_[_0x437d('0x60')]({},_0x5e86d1,_0xb005b2['options']);return db['ScreenRecording'][_0x437d('0x2a')]({'where':_0x5e86d1[_0x437d('0xce')]})[_0x437d('0x1a')](function(_0x210b44){_0x3ada71[_0x437d('0x2a')]=_0x210b44;if(_0xb005b2[_0x437d('0x47')][_0x437d('0x48')]){_0x5e86d1[_0x437d('0x4a')]=[{'all':!![]}];}return db[_0x437d('0xdf')][_0x437d('0x4e')](_0x5e86d1);})[_0x437d('0x1a')](function(_0x4f5ee2){_0x3ada71[_0x437d('0x4f')]=_0x4f5ee2;return _0x3ada71;});}})[_0x437d('0x1a')](respondWithFilteredResult(_0x11a3d8,_0x5e86d1))['catch'](handleError(_0x11a3d8,null));};exports['getChatInteractions']=function(_0x1e8979,_0x459cf3){var _0x57d49c={};var _0x63c4b4={};var _0x28b001;var _0x528b4c;return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x1e8979[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x459cf3,null))[_0x437d('0x1a')](function(_0x1a6bc8){if(_0x1a6bc8){_0x28b001=_0x1a6bc8;_0x63c4b4[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0xe0')][_0x437d('0x40')]);_0x63c4b4[_0x437d('0x47')]=_[_0x437d('0x59')](_0x1e8979[_0x437d('0x47')]);_0x63c4b4[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x63c4b4[_0x437d('0x5d')],_0x63c4b4['query']);_0x57d49c[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x63c4b4[_0x437d('0x5d')],qs['fields'](_0x1e8979['query']['fields']));_0x57d49c['attributes']=_0x57d49c[_0x437d('0x4c')]['length']?_0x57d49c[_0x437d('0x4c')]:_0x63c4b4[_0x437d('0x5d')];_0x57d49c[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x1e8979[_0x437d('0x47')][_0x437d('0xcd')]);_0x57d49c[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x1e8979['query'],_0x63c4b4['filters']));if(_0x1e8979['query'][_0x437d('0x38')]){_0x57d49c[_0x437d('0xce')]=_['merge'](_0x57d49c[_0x437d('0xce')],{'$or':_['map'](_0x57d49c[_0x437d('0x4c')],function(_0x31c865){var _0x5f6e2e={};_0x5f6e2e[_0x31c865]={'$like':'%'+_0x1e8979[_0x437d('0x47')][_0x437d('0x38')]+'%'};return _0x5f6e2e;})});}_0x57d49c=_[_0x437d('0x60')]({},_0x57d49c,_0x1e8979[_0x437d('0xd0')]);return _0x28b001[_0x437d('0xe1')](_0x57d49c);}})['then'](function(_0x2a2ab1){if(_0x2a2ab1){_0x528b4c=_0x2a2ab1[_0x437d('0x5f')];if(!_0x1e8979[_0x437d('0x47')][_0x437d('0xd1')]('nolimit')){_0x57d49c['limit']=qs['limit'](_0x1e8979[_0x437d('0x47')][_0x437d('0x29')]);_0x57d49c['offset']=qs[_0x437d('0x27')](_0x1e8979[_0x437d('0x47')][_0x437d('0x27')]);}return _0x28b001[_0x437d('0xe1')](_0x57d49c);}})[_0x437d('0x1a')](function(_0x36e51f){if(_0x36e51f){return _0x36e51f?{'count':_0x528b4c,'rows':_0x36e51f}:null;}})[_0x437d('0x1a')](respondWithResult(_0x459cf3,null))[_0x437d('0x22')](handleError(_0x459cf3,null));};exports[_0x437d('0xe2')]=function(_0x5cddb9,_0x5afbe8){var _0x23498b={};var _0x194083={};var _0x2a050b;var _0x5f538b;return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x5cddb9['params']['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x5afbe8,null))[_0x437d('0x1a')](function(_0x39abba){if(_0x39abba){_0x2a050b=_0x39abba;_0x194083[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0xe3')]['rawAttributes']);_0x194083[_0x437d('0x47')]=_['keys'](_0x5cddb9[_0x437d('0x47')]);_0x194083['filters']=_['intersection'](_0x194083[_0x437d('0x5d')],_0x194083[_0x437d('0x47')]);_0x23498b[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x194083[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x5cddb9['query'][_0x437d('0x5e')]));_0x23498b[_0x437d('0x4c')]=_0x23498b[_0x437d('0x4c')][_0x437d('0x5f')]?_0x23498b['attributes']:_0x194083[_0x437d('0x5d')];_0x23498b[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x5cddb9['query'][_0x437d('0xcd')]);_0x23498b[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x5cddb9[_0x437d('0x47')],_0x194083[_0x437d('0x5b')]));if(_0x5cddb9['query']['filter']){_0x23498b[_0x437d('0xce')]=_[_0x437d('0x60')](_0x23498b[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0x23498b[_0x437d('0x4c')],function(_0x42f075){var _0x136858={};_0x136858[_0x42f075]={'$like':'%'+_0x5cddb9[_0x437d('0x47')][_0x437d('0x38')]+'%'};return _0x136858;})});}_0x23498b=_['merge']({},_0x23498b,_0x5cddb9[_0x437d('0xd0')]);return _0x2a050b[_0x437d('0xe2')](_0x23498b);}})[_0x437d('0x1a')](function(_0x1b16a6){if(_0x1b16a6){_0x5f538b=_0x1b16a6[_0x437d('0x5f')];if(!_0x5cddb9[_0x437d('0x47')][_0x437d('0xd1')](_0x437d('0xd5'))){_0x23498b['limit']=qs['limit'](_0x5cddb9[_0x437d('0x47')][_0x437d('0x29')]);_0x23498b[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x5cddb9[_0x437d('0x47')][_0x437d('0x27')]);}return _0x2a050b[_0x437d('0xe2')](_0x23498b);}})[_0x437d('0x1a')](function(_0x3fe9e1){if(_0x3fe9e1){return _0x3fe9e1?{'count':_0x5f538b,'rows':_0x3fe9e1}:null;}})[_0x437d('0x1a')](respondWithResult(_0x5afbe8,null))[_0x437d('0x22')](handleError(_0x5afbe8,null));};exports[_0x437d('0xe4')]=function(_0x49fb23,_0x231406){var _0x4fb289={'raw':!![],'where':{}};var _0x4c3a89={};var _0xbd04eb={'count':0x0,'rows':[]};return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x49fb23[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x231406,null))['then'](function(_0x5057ae){if(_0x5057ae){_0x4c3a89[_0x437d('0x5d')]=_[_0x437d('0x59')](db['MailInteraction'][_0x437d('0x40')]);_0x4c3a89[_0x437d('0x47')]=_[_0x437d('0x59')](_0x49fb23[_0x437d('0x47')]);_0x4c3a89['filters']=_['intersection'](_0x4c3a89['model'],_0x4c3a89[_0x437d('0x47')]);_0x4fb289[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x4c3a89[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x49fb23[_0x437d('0x47')][_0x437d('0x5e')]));_0x4fb289['attributes']=_0x4fb289['attributes'][_0x437d('0x5f')]?_0x4fb289[_0x437d('0x4c')]:_0x4c3a89[_0x437d('0x5d')];if(!_0x49fb23[_0x437d('0x47')]['hasOwnProperty'](_0x437d('0xd5'))){_0x4fb289[_0x437d('0x29')]=qs[_0x437d('0x29')](_0x49fb23[_0x437d('0x47')]['limit']);_0x4fb289[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x49fb23[_0x437d('0x47')][_0x437d('0x27')]);}_0x4fb289[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x49fb23[_0x437d('0x47')][_0x437d('0xcd')]);_0x4fb289[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x49fb23['query'],_0x4c3a89[_0x437d('0x5b')]));_0x4fb289[_0x437d('0xce')][_0x437d('0xde')]=_0x5057ae['id'];if(_0x49fb23[_0x437d('0x47')][_0x437d('0x38')]){_0x4fb289[_0x437d('0xce')]=_['merge'](_0x4fb289[_0x437d('0xce')],{'$or':_['map'](_0x4fb289[_0x437d('0x4c')],function(_0x41d437){var _0x322909={};_0x322909[_0x41d437]={'$like':'%'+_0x49fb23[_0x437d('0x47')][_0x437d('0x38')]+'%'};return _0x322909;})});}_0x4fb289=_[_0x437d('0x60')]({},_0x4fb289,_0x49fb23['options']);return db['MailInteraction'][_0x437d('0x2a')]({'where':_0x4fb289[_0x437d('0xce')]})[_0x437d('0x1a')](function(_0x4e8118){_0xbd04eb[_0x437d('0x2a')]=_0x4e8118;if(_0x49fb23[_0x437d('0x47')][_0x437d('0x48')]){_0x4fb289[_0x437d('0x4a')]=[{'all':!![]}];}return db[_0x437d('0xe5')][_0x437d('0x4e')](_0x4fb289);})[_0x437d('0x1a')](function(_0x1aa329){_0xbd04eb[_0x437d('0x4f')]=_0x1aa329;return _0xbd04eb;});}})[_0x437d('0x1a')](respondWithFilteredResult(_0x231406,_0x4fb289))[_0x437d('0x22')](handleError(_0x231406,null));};exports[_0x437d('0xe6')]=function(_0x2c51ba,_0x41962d){var _0x27da5e={};var _0x1610b9={};var _0x2060b3;var _0x21a43c;return db['User'][_0x437d('0xd7')]({'where':{'id':_0x2c51ba['params']['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x41962d,null))[_0x437d('0x1a')](function(_0xb57866){if(_0xb57866){_0x2060b3=_0xb57866;_0x1610b9[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0xe7')][_0x437d('0x40')]);_0x1610b9[_0x437d('0x47')]=_[_0x437d('0x59')](_0x2c51ba[_0x437d('0x47')]);_0x1610b9[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x1610b9['model'],_0x1610b9[_0x437d('0x47')]);_0x27da5e[_0x437d('0x4c')]=_['intersection'](_0x1610b9[_0x437d('0x5d')],qs['fields'](_0x2c51ba[_0x437d('0x47')][_0x437d('0x5e')]));_0x27da5e[_0x437d('0x4c')]=_0x27da5e[_0x437d('0x4c')][_0x437d('0x5f')]?_0x27da5e[_0x437d('0x4c')]:_0x1610b9[_0x437d('0x5d')];_0x27da5e[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x2c51ba[_0x437d('0x47')][_0x437d('0xcd')]);_0x27da5e[_0x437d('0xce')]=qs['filters'](_[_0x437d('0xcf')](_0x2c51ba[_0x437d('0x47')],_0x1610b9[_0x437d('0x5b')]));if(_0x2c51ba[_0x437d('0x47')]['filter']){_0x27da5e[_0x437d('0xce')]=_['merge'](_0x27da5e[_0x437d('0xce')],{'$or':_['map'](_0x27da5e[_0x437d('0x4c')],function(_0x2b95c5){var _0x37c43a={};_0x37c43a[_0x2b95c5]={'$like':'%'+_0x2c51ba[_0x437d('0x47')]['filter']+'%'};return _0x37c43a;})});}_0x27da5e=_[_0x437d('0x60')]({},_0x27da5e,_0x2c51ba[_0x437d('0xd0')]);return _0x2060b3[_0x437d('0xe6')](_0x27da5e);}})['then'](function(_0xc62e2a){if(_0xc62e2a){_0x21a43c=_0xc62e2a['length'];if(!_0x2c51ba[_0x437d('0x47')][_0x437d('0xd1')](_0x437d('0xd5'))){_0x27da5e[_0x437d('0x29')]=qs[_0x437d('0x29')](_0x2c51ba[_0x437d('0x47')][_0x437d('0x29')]);_0x27da5e[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x2c51ba[_0x437d('0x47')][_0x437d('0x27')]);}return _0x2060b3[_0x437d('0xe6')](_0x27da5e);}})[_0x437d('0x1a')](function(_0x1671be){if(_0x1671be){return _0x1671be?{'count':_0x21a43c,'rows':_0x1671be}:null;}})[_0x437d('0x1a')](respondWithResult(_0x41962d,null))[_0x437d('0x22')](handleError(_0x41962d,null));};exports[_0x437d('0xe8')]=function(_0x5bc833,_0x575536){var _0x1301ae={};var _0x53793e={};var _0x3116f6;var _0x47e9c7;return db[_0x437d('0x3f')]['findOne']({'where':{'id':_0x5bc833['params']['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x575536,null))['then'](function(_0x5902d7){if(_0x5902d7){_0x3116f6=_0x5902d7;_0x53793e[_0x437d('0x5d')]=_['keys'](db[_0x437d('0xe9')][_0x437d('0x40')]);_0x53793e[_0x437d('0x47')]=_[_0x437d('0x59')](_0x5bc833['query']);_0x53793e[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x53793e[_0x437d('0x5d')],_0x53793e['query']);_0x1301ae[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x53793e[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x5bc833[_0x437d('0x47')]['fields']));_0x1301ae['attributes']=_0x1301ae['attributes'][_0x437d('0x5f')]?_0x1301ae[_0x437d('0x4c')]:_0x53793e['model'];_0x1301ae[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x5bc833[_0x437d('0x47')][_0x437d('0xcd')]);_0x1301ae[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x5bc833[_0x437d('0x47')],_0x53793e[_0x437d('0x5b')]));if(_0x5bc833[_0x437d('0x47')][_0x437d('0x38')]){_0x1301ae[_0x437d('0xce')]=_[_0x437d('0x60')](_0x1301ae['where'],{'$or':_['map'](_0x1301ae['attributes'],function(_0x300410){var _0x29b240={};_0x29b240[_0x300410]={'$like':'%'+_0x5bc833[_0x437d('0x47')][_0x437d('0x38')]+'%'};return _0x29b240;})});}_0x1301ae=_[_0x437d('0x60')]({},_0x1301ae,_0x5bc833[_0x437d('0xd0')]);return _0x3116f6[_0x437d('0xe8')](_0x1301ae);}})[_0x437d('0x1a')](function(_0x1858dc){if(_0x1858dc){_0x47e9c7=_0x1858dc['length'];if(!_0x5bc833[_0x437d('0x47')][_0x437d('0xd1')](_0x437d('0xd5'))){_0x1301ae['limit']=qs[_0x437d('0x29')](_0x5bc833[_0x437d('0x47')][_0x437d('0x29')]);_0x1301ae[_0x437d('0x27')]=qs[_0x437d('0x27')](_0x5bc833[_0x437d('0x47')][_0x437d('0x27')]);}return _0x3116f6[_0x437d('0xe8')](_0x1301ae);}})[_0x437d('0x1a')](function(_0x271cc5){if(_0x271cc5){return _0x271cc5?{'count':_0x47e9c7,'rows':_0x271cc5}:null;}})[_0x437d('0x1a')](respondWithResult(_0x575536,null))[_0x437d('0x22')](handleError(_0x575536,null));};exports['getWhatsappInteractions']=function(_0x37dc02,_0x16d004){var _0x56d7b3={};var _0x28d2a6={};var _0x87228;var _0x4dc1b6;return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x37dc02[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x16d004,null))[_0x437d('0x1a')](function(_0x4594e3){if(_0x4594e3){_0x87228=_0x4594e3;_0x28d2a6[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0xea')][_0x437d('0x40')]);_0x28d2a6['query']=_[_0x437d('0x59')](_0x37dc02[_0x437d('0x47')]);_0x28d2a6[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x28d2a6[_0x437d('0x5d')],_0x28d2a6[_0x437d('0x47')]);_0x56d7b3[_0x437d('0x4c')]=_['intersection'](_0x28d2a6['model'],qs[_0x437d('0x5e')](_0x37dc02['query'][_0x437d('0x5e')]));_0x56d7b3[_0x437d('0x4c')]=_0x56d7b3[_0x437d('0x4c')][_0x437d('0x5f')]?_0x56d7b3[_0x437d('0x4c')]:_0x28d2a6[_0x437d('0x5d')];_0x56d7b3[_0x437d('0xcc')]=qs[_0x437d('0xcd')](_0x37dc02[_0x437d('0x47')][_0x437d('0xcd')]);_0x56d7b3[_0x437d('0xce')]=qs[_0x437d('0x5b')](_['pick'](_0x37dc02['query'],_0x28d2a6[_0x437d('0x5b')]));if(_0x37dc02['query'][_0x437d('0x38')]){_0x56d7b3[_0x437d('0xce')]=_[_0x437d('0x60')](_0x56d7b3[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0x56d7b3[_0x437d('0x4c')],function(_0x1552b4){var _0x6cce52={};_0x6cce52[_0x1552b4]={'$like':'%'+_0x37dc02['query'][_0x437d('0x38')]+'%'};return _0x6cce52;})});}_0x56d7b3=_[_0x437d('0x60')]({},_0x56d7b3,_0x37dc02['options']);return _0x87228[_0x437d('0xeb')](_0x56d7b3);}})['then'](function(_0x72dee7){if(_0x72dee7){_0x4dc1b6=_0x72dee7[_0x437d('0x5f')];if(!_0x37dc02[_0x437d('0x47')]['hasOwnProperty']('nolimit')){_0x56d7b3[_0x437d('0x29')]=qs['limit'](_0x37dc02[_0x437d('0x47')]['limit']);_0x56d7b3['offset']=qs[_0x437d('0x27')](_0x37dc02['query']['offset']);}return _0x87228[_0x437d('0xeb')](_0x56d7b3);}})[_0x437d('0x1a')](function(_0x4d92b5){if(_0x4d92b5){return _0x4d92b5?{'count':_0x4dc1b6,'rows':_0x4d92b5}:null;}})[_0x437d('0x1a')](respondWithResult(_0x16d004,null))[_0x437d('0x22')](handleError(_0x16d004,null));};exports['login']=function(_0xce56b8,_0x29e154,_0x52f10a){var _0xf96f69;var _0x4cf631;var _0x12957e;var _0x4e216e=!_[_0x437d('0x6b')](_0xce56b8[_0x437d('0x58')]['id'])?_0xce56b8[_0x437d('0x58')]['id']:!_[_0x437d('0x6b')](_0xce56b8[_0x437d('0x33')]['id'])?_0xce56b8[_0x437d('0x33')]['id']:null;return db[_0x437d('0x3f')][_0x437d('0x3a')]({'where':{'id':_0x4e216e,'role':{'$or':[_0x437d('0x32'),'user',_0x437d('0x35')]}},'attributes':['id',_0x437d('0x3b'),_0x437d('0xec'),'mobile','role','internal',_0x437d('0xed')]})[_0x437d('0x1a')](function(_0x15a6a9){if(_0x15a6a9){if(_0x15a6a9['role']==='agent'){_0xf96f69=_0x15a6a9;if(_0xce56b8[_0x437d('0x63')]['interface']){_0x12957e=util[_0x437d('0xac')](_0x437d('0xee'),_0xf96f69[_0xce56b8[_0x437d('0x63')][_0x437d('0xab')]]);}else if(_0xce56b8[_0x437d('0x63')][_0x437d('0xef')]){_0x12957e=util[_0x437d('0xac')](_0x437d('0xad'),_0xce56b8[_0x437d('0x63')][_0x437d('0xef')]);}else{_0x12957e=util['format'](_0x437d('0xad'),_0xf96f69[_0x437d('0x3b')]);}socket['to'](util[_0x437d('0xac')]('user:%s',_0xf96f69[_0x437d('0x3b')]))[_0x437d('0xa8')](_0x437d('0xf0'),{'user':{'id':_0xf96f69['id'],'name':_0xf96f69[_0x437d('0x3b')]},'ip':_0xce56b8[_0x437d('0xf1')][_0x437d('0xf2')]||_0xce56b8[_0x437d('0xf3')][_0x437d('0xf4')]||_0xce56b8[_0x437d('0xf5')][_0x437d('0xf4')]||_0xce56b8['connection'][_0x437d('0xf5')][_0x437d('0xf4')]});return db[_0x437d('0xae')]['destroy']({'where':{'membername':_0xf96f69[_0x437d('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0x437d('0x94'))]['ValidationError'](_0x437d('0xf6'));}})[_0x437d('0x1a')](function(){if(_0xf96f69){return _0xf96f69[_0x437d('0xf7')]({'raw':!![]});}})[_0x437d('0x1a')](function(_0x4c135a){if(_0xf96f69){var _0x4abee7=[];if(_0x4c135a){_0x4cf631=_0x4c135a;if(_0x4cf631[_0x437d('0x5f')]){for(var _0x282c78=0x0;_0x282c78<_0x4cf631['length'];_0x282c78++){_0x4abee7[_0x437d('0x4d')]({'membername':_0xf96f69[_0x437d('0x3b')],'UserId':_0xf96f69['id'],'queue_name':_0x4cf631[_0x282c78][_0x437d('0x3b')],'VoiceQueueId':_0x4cf631[_0x282c78]['id'],'interface':_0x12957e,'paused':_0xf96f69[_0x437d('0xed')]||![],'penalty':_0x4cf631[_0x282c78][_0x437d('0xf8')]||0x0});}return BPromise[_0x437d('0x8d')](_0x4abee7,function(_0x1eb122){return db[_0x437d('0xae')]['upsert'](_0x1eb122);});}}}})['then'](function(){if(_0xf96f69){return db['MemberReport'][_0x437d('0x4e')]({'where':{'membername':_0xf96f69[_0x437d('0x3b')],'exitAt':null}});}})[_0x437d('0x1a')](function(_0x1cf76a){if(_0xf96f69){var _0x19f5d9=[];_0x1cf76a[_0x437d('0xf9')](function(_0x445244){_0x19f5d9[_0x437d('0x4d')](_0x445244['update']({'exitAt':moment()['format'](_0x437d('0xfa'))}));});return BPromise['all'](_0x19f5d9);}})[_0x437d('0x1a')](function(){if(_0xf96f69){var _0x108728=[];var _0x151c19=[];var _0x38781c=utils[_0x437d('0xfb')]();var _0xeca9a8={'membername':_0xf96f69[_0x437d('0x3b')],'interface':_0x12957e,'enterAt':moment()[_0x437d('0xac')](_0x437d('0xfa')),'role':_0xf96f69[_0x437d('0x31')],'internal':_0xf96f69[_0x437d('0x67')]};_0x38781c[_0x437d('0xf9')](function(_0x11f920){_0x108728[_0x437d('0x4d')](_[_0x437d('0x60')]({'channel':_0x11f920,'type':_0x437d('0xfc'),'data1':_0xce56b8[_0x437d('0x63')]['device'],'data2':_0x12957e},_0xeca9a8));if(_0xf96f69[_0x437d('0xed')]){_0x151c19['push'](_[_0x437d('0x60')]({'channel':_0x11f920,'type':_0x437d('0xfd'),'data1':'LOGININPAUSE'},_0xeca9a8));}});return db[_0x437d('0xfe')]['bulkCreate'](_0x108728[_0x437d('0xff')](_0x151c19),{'individualHooks':!![]});}})[_0x437d('0x1a')](function(){if(_0xf96f69){return _0xf96f69[_0x437d('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x437d('0xac')](_0x437d('0xfa')),'voicePause':_0xf96f69[_0x437d('0xed')]||![],'mailPause':_0xf96f69[_0x437d('0xed')]||![],'chatPause':_0xf96f69['loginInPause']||![],'faxPause':_0xf96f69[_0x437d('0xed')]||![],'smsPause':_0xf96f69[_0x437d('0xed')]||![],'openchannelPause':_0xf96f69[_0x437d('0xed')]||![],'whatsappPause':_0xf96f69[_0x437d('0xed')]||![],'pauseType':_0xf96f69[_0x437d('0xed')]?'LOGININPAUSE':null,'interface':_0x12957e,'lastPauseAt':moment()[_0x437d('0xac')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x437d('0x1a')](function(_0x4677f2){if(_0xce56b8[_0x437d('0x100')]){return _0x52f10a();}else{return BPromise[_0x437d('0x101')](_0x4677f2)[_0x437d('0x1a')](respondWithResult(_0x29e154,null));}})[_0x437d('0x22')](handleError(_0x29e154,null));};exports[_0x437d('0x102')]=function(_0x5891bc,_0x2adecb){var _0x10df5d;return db['User']['find']({'where':{'id':_0x5891bc['params']['id'],'role':_0x437d('0x35')},'attributes':['id',_0x437d('0x3b'),_0x437d('0x31')]})[_0x437d('0x1a')](handleEntityNotFound(_0x2adecb,null))[_0x437d('0x1a')](function(_0x1bbc00){if(_0x1bbc00){_0x10df5d=_0x1bbc00;return db[_0x437d('0xae')]['destroy']({'where':{'membername':_0x10df5d[_0x437d('0x3b')]},'individualHooks':!![]});}})[_0x437d('0x1a')](function(){return db[_0x437d('0xfe')][_0x437d('0x4e')]({'where':{'membername':_0x10df5d['name'],'exitAt':null}});})[_0x437d('0x1a')](function(_0xc4e921){var _0x30b533=[];_0xc4e921['forEach'](function(_0x1bc278){_0x30b533['push'](_0x1bc278[_0x437d('0x2d')]({'exitAt':moment()[_0x437d('0xac')](_0x437d('0xfa'))}));});return BPromise['all'](_0x30b533);})[_0x437d('0x1a')](function(){return _0x10df5d['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x437d('0x1a')](respondWithResult(_0x2adecb,null))[_0x437d('0x22')](handleError(_0x2adecb,null));};exports[_0x437d('0x103')]=function(_0x29ca4d,_0x4e64f8){var _0x307818;return db[_0x437d('0xae')][_0x437d('0x2d')]({'paused':0x1},{'where':{'UserId':_0x29ca4d[_0x437d('0x58')]['id']},'individualHooks':!![]})[_0x437d('0x1a')](function(){return db['User'][_0x437d('0x3a')]({'where':{'id':_0x29ca4d[_0x437d('0x58')]['id'],'role':_0x437d('0x35')},'attributes':['id','name',_0x437d('0x31'),_0x437d('0x67'),_0x437d('0xab')]});})['then'](handleEntityNotFound(_0x4e64f8,null))[_0x437d('0x1a')](function(_0x32df0e){if(_0x32df0e){_0x307818=_0x32df0e;return respondWithRpcPromise(_0x437d('0x104'),_0x437d('0x103'),{'id':_0x307818['id'],'name':_0x307818[_0x437d('0x3b')],'pause':!![]});}})[_0x437d('0x1a')](function(){if(_0x307818){return db[_0x437d('0xfe')][_0x437d('0x4e')]({'where':{'membername':_0x307818['name'],'type':'PAUSE','exitAt':null}});}})[_0x437d('0x1a')](function(_0x38d6ab){if(_0x38d6ab[_0x437d('0x5f')]){var _0x5eea5f=moment()[_0x437d('0xac')](_0x437d('0xfa'));for(var _0x3690f0=0x0,_0x4e6a04=_0x38d6ab[_0x437d('0x5f')];_0x3690f0<_0x4e6a04;_0x3690f0++){_0x38d6ab[_0x3690f0][_0x437d('0x105')]({'exitAt':_0x5eea5f});}}})[_0x437d('0x1a')](function(){var _0x232da6=[];var _0x33c1d2=utils[_0x437d('0xfb')]();_0x33c1d2[_0x437d('0xf9')](function(_0x495de1){_0x232da6['push']({'channel':_0x495de1,'membername':_0x307818[_0x437d('0x3b')],'interface':_[_0x437d('0x6b')](_0x307818['interface'])?util['format'](_0x437d('0xad'),_0x307818['name']):_0x307818[_0x437d('0xab')],'type':_0x437d('0xfd'),'enterAt':moment()[_0x437d('0xac')](_0x437d('0xfa')),'data1':_0x29ca4d[_0x437d('0x63')][_0x437d('0x43')]||_0x437d('0x106'),'role':_0x307818[_0x437d('0x31')],'internal':_0x307818['internal']});});return db[_0x437d('0xfe')]['bulkCreate'](_0x232da6,{'individualHooks':!![]});})['then'](function(){return _0x307818[_0x437d('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x29ca4d['body'][_0x437d('0x43')]||_0x437d('0x106'),'lastPauseAt':moment()[_0x437d('0xac')](_0x437d('0xfa'))});})['then'](respondWithResult(_0x4e64f8,null))[_0x437d('0x22')](handleError(_0x4e64f8,null));};exports[_0x437d('0x107')]=function(_0x1a2df4,_0x4229fa){var _0x309e9e;return db['User'][_0x437d('0x3a')]({'where':{'id':_0x1a2df4['params']['id']},'attributes':['id',_0x437d('0x3b'),'role',_0x437d('0x9e'),_0x437d('0x108'),'chatPause','faxPause',_0x437d('0x109'),_0x437d('0x10a'),'whatsapppause',_0x437d('0x10b'),'lastPauseAt']})[_0x437d('0x1a')](handleEntityNotFound(_0x4229fa,null))['then'](function(_0x314fbd){if(_0x314fbd){_0x309e9e=_0x314fbd;if(_0x1a2df4[_0x437d('0x63')][_0x437d('0x9c')]&&!utils[_0x437d('0x9f')](_0x1a2df4[_0x437d('0x63')][_0x437d('0x9c')])){throw new db[(_0x437d('0x94'))][(_0x437d('0x95'))](_0x437d('0xa0'));}switch(_0x1a2df4[_0x437d('0x63')][_0x437d('0x9c')]){case _0x437d('0xa9'):return respondWithRpcPromise(_0x437d('0x104'),_0x437d('0x107'),{'id':_0x309e9e['id'],'name':_0x309e9e[_0x437d('0x3b')],'pause':![]})[_0x437d('0x1a')](function(){return db[_0x437d('0xae')][_0x437d('0x2d')]({'paused':0x0},{'where':{'UserId':_0x309e9e['id']},'individualHooks':!![]});})[_0x437d('0x1a')](function(){return db[_0x437d('0xfe')][_0x437d('0x3a')]({'where':{'channel':_0x1a2df4['body']['channel'],'membername':_0x309e9e['name'],'type':_0x437d('0xfd'),'exitAt':null}});})[_0x437d('0x1a')](function(_0x2acdaa){if(_0x2acdaa){return _0x2acdaa[_0x437d('0x2d')]({'exitAt':moment()[_0x437d('0xac')](_0x437d('0xfa')),'data2':_0x437d('0x10c')},{'individualHooks':!![]});}return null;})[_0x437d('0x1a')](function(){return _0x309e9e[_0x437d('0x2d')]({'voicePause':![]});});case'mail':case'chat':case _0x437d('0x55'):case _0x437d('0x54'):case'whatsapp':case _0x437d('0xbd'):return db['MemberReport'][_0x437d('0x3a')]({'where':{'channel':_0x1a2df4[_0x437d('0x63')][_0x437d('0x9c')],'membername':_0x309e9e[_0x437d('0x3b')],'type':_0x437d('0xfd'),'exitAt':null}})[_0x437d('0x1a')](function(_0x5baaba){if(_0x5baaba){return _0x5baaba[_0x437d('0x2d')]({'exitAt':moment()[_0x437d('0xac')](_0x437d('0xfa')),'data2':_0x437d('0x10c')},{'individualHooks':!![]});}return null;})[_0x437d('0x1a')](function(){var _0x49f28e={};_[_0x437d('0x2b')](_0x49f28e,util['format'](_0x437d('0x10d'),_0x1a2df4[_0x437d('0x63')][_0x437d('0x9c')],_0x437d('0x10e')),![]);return _0x309e9e[_0x437d('0x2d')](_0x49f28e);});default:return respondWithRpcPromise(_0x437d('0x104'),'unpause',{'id':_0x309e9e['id'],'name':_0x309e9e[_0x437d('0x3b')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x309e9e['id']}});})['then'](function(){return db[_0x437d('0xfe')]['findAll']({'where':{'membername':_0x309e9e[_0x437d('0x3b')],'type':'PAUSE','exitAt':null}});})[_0x437d('0x1a')](function(_0x35ae80){var _0x45fa50=[];_0x35ae80[_0x437d('0xf9')](function(_0x46aac2){_0x45fa50[_0x437d('0x4d')](_0x46aac2[_0x437d('0x2d')]({'exitAt':moment()[_0x437d('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x437d('0x10c')}));});return BPromise[_0x437d('0x57')](_0x45fa50);})[_0x437d('0x1a')](function(){return _0x309e9e[_0x437d('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x4229fa,null))['catch'](handleError(_0x4229fa,null));};exports[_0x437d('0x10f')]=function(_0x46ec1e,_0x1e7246){var _0xb8794b={};var _0x3723a0={};var _0x202a95;var _0x4bb18d;return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0x46ec1e['params']['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x1e7246,null))[_0x437d('0x1a')](function(_0x56f533){if(_0x56f533){_0x202a95=_0x56f533;_0x3723a0[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0x110')][_0x437d('0x40')]);_0x3723a0[_0x437d('0x47')]=_[_0x437d('0x59')](_0x46ec1e[_0x437d('0x47')]);_0x3723a0['filters']=_[_0x437d('0x5c')](_0x3723a0['model'],_0x3723a0[_0x437d('0x47')]);_0xb8794b[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x3723a0[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x46ec1e[_0x437d('0x47')][_0x437d('0x5e')]));_0xb8794b[_0x437d('0x4c')]=_0xb8794b[_0x437d('0x4c')][_0x437d('0x5f')]?_0xb8794b[_0x437d('0x4c')]:_0x3723a0[_0x437d('0x5d')];_0xb8794b[_0x437d('0xcc')]=qs['sort'](_0x46ec1e[_0x437d('0x47')][_0x437d('0xcd')]);_0xb8794b['where']=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x46ec1e[_0x437d('0x47')],_0x3723a0[_0x437d('0x5b')]));if(_0x46ec1e[_0x437d('0x47')]['filter']){_0xb8794b['where']=_['merge'](_0xb8794b[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0xb8794b[_0x437d('0x4c')],function(_0x1082d7){var _0xd393c2={};_0xd393c2[_0x1082d7]={'$like':'%'+_0x46ec1e['query'][_0x437d('0x38')]+'%'};return _0xd393c2;})});}_0xb8794b=_[_0x437d('0x60')]({},_0xb8794b,_0x46ec1e['options']);return _0x202a95[_0x437d('0x10f')](_0xb8794b);}})[_0x437d('0x1a')](function(_0x235142){if(_0x235142){_0x4bb18d=_0x235142[_0x437d('0x5f')];if(!_0x46ec1e[_0x437d('0x47')][_0x437d('0xd1')]('nolimit')){_0xb8794b['limit']=qs['limit'](_0x46ec1e[_0x437d('0x47')][_0x437d('0x29')]);_0xb8794b['offset']=qs[_0x437d('0x27')](_0x46ec1e['query'][_0x437d('0x27')]);}return _0x202a95[_0x437d('0x10f')](_0xb8794b);}})['then'](function(_0x891661){if(_0x891661){return _0x891661?{'count':_0x4bb18d,'rows':_0x891661}:null;}})[_0x437d('0x1a')](respondWithResult(_0x1e7246,null))[_0x437d('0x22')](handleError(_0x1e7246,null));};exports['addTeams']=function(_0x48c715,_0x402537){var _0x4efb0c=_0x48c715[_0x437d('0x58')]['id'];var _0x4888b0=_0x48c715['body']?_0x48c715[_0x437d('0x63')][_0x437d('0x66')]:null;var _0xb89b3f=[];return Promise[_0x437d('0x101')]()['then'](function(){if(!_0x4888b0)throw new APIBadRequestError(_0x437d('0x111'));})[_0x437d('0x1a')](function(){return db['User']['findOne']({'where':{'id':_0x4efb0c}});})['then'](function(_0x46d5ad){if(!_0x46d5ad)throw new APINotFoundError(util[_0x437d('0xac')](_0x437d('0x112'),_0x48c715[_0x437d('0x58')]['id']));return db[_0x437d('0x6d')][_0x437d('0x113')](function(_0x103f65){return _0x46d5ad[_0x437d('0x114')](_0x4888b0,{'transaction':_0x103f65})['then'](function(){return db[_0x437d('0x110')]['findAll']({'where':{'id':{'$in':_0x4888b0}}});})[_0x437d('0x1a')](function(_0x38f08c){var _0x5b5bc8=_[_0x437d('0x41')](_0x38f08c,function(_0x304b45){return _0x304b45[_0x437d('0x115')]();});return Promise['all'](_0x5b5bc8);})[_0x437d('0x1a')](function(_0x285e31){_0xb89b3f=_[_0x437d('0x116')](_0x285e31);var _0x42d753=_['map'](_0xb89b3f,function(_0x28e6b2){return _0x28e6b2[_0x437d('0x117')](_0x46d5ad['id'],{'transaction':_0x103f65});});return Promise[_0x437d('0x57')](_0x42d753);})[_0x437d('0x1a')](function(){if(!_0x46d5ad['online'])return;var _0x557e6e=_[_0x437d('0x38')](_0xb89b3f,function(_0x504d5c){return _0x504d5c['getDataValue'](_0x437d('0x9c'))===_0x437d('0x118');});var _0x553b87=_['map'](_0x557e6e,function(_0x3f3a66){return db['UserVoiceQueueRt'][_0x437d('0xaf')]({'membername':_0x46d5ad['name'],'UserId':_0x46d5ad['id'],'queue_name':_0x3f3a66[_0x437d('0x3b')],'VoiceQueueId':_0x3f3a66['id'],'interface':_[_0x437d('0x6b')](_0x46d5ad['interface'])?util[_0x437d('0xac')](_0x437d('0xad'),_0x46d5ad[_0x437d('0x3b')]):_0x46d5ad['interface'],'paused':_0x46d5ad[_0x437d('0x9e')]||![],'penalty':_0x46d5ad['penalty']},{'transaction':_0x103f65});});return Promise[_0x437d('0x57')](_0x553b87);})['then'](function(){return db['TeamVoicePrefix'][_0x437d('0x4e')]({'where':{'teamId':{'$in':_0x4888b0}}});})['then'](function(_0x3c6080){var _0x4dbd73=_[_0x437d('0x41')](_0x3c6080,function(_0x425bf3){return db['UserVoicePrefix'][_0x437d('0x87')]({'UserId':_0x46d5ad['id'],'VoicePrefixId':_0x425bf3[_0x437d('0x119')]},{'transaction':_0x103f65});});return Promise[_0x437d('0x57')](_0x4dbd73);});});})[_0x437d('0x1a')](function(){for(var _0x1f66f8=0x0;_0x1f66f8<_0xb89b3f[_0x437d('0x5f')];_0x1f66f8++){var _0x124a80=_0xb89b3f[_0x1f66f8][_0x437d('0x11a')]('channel');var _0x5bfc78=_0x124a80+'QueueId';socket[_0x437d('0xa8')](_0x437d('0x33')+_0x124a80+'Queue:save',{'UserId':_0x4efb0c,['queueField']:_0xb89b3f[_0x1f66f8]['id']});}})['then'](respondWithStatusCode(_0x402537,null))[_0x437d('0x22')](APIHandleError(_0x402537));};exports['removeTeams']=function(_0x315408,_0x596926){var _0xa60161=_0x315408['params']['id'];var _0x10f593=null;if(_0x315408['query'][_0x437d('0x66')]){_0x10f593=_[_0x437d('0xb1')](_0x315408[_0x437d('0x47')]['ids'])?_0x315408[_0x437d('0x47')][_0x437d('0x66')]:[_0x315408['query'][_0x437d('0x66')]];}var _0x5c7198=[];return Promise[_0x437d('0x101')]()[_0x437d('0x1a')](function(){if(!_0x10f593)throw new APIBadRequestError(_0x437d('0x11b'));})[_0x437d('0x1a')](function(){return db[_0x437d('0x3f')][_0x437d('0xd7')]({'where':{'id':_0xa60161}});})['then'](function(_0x4c1f2b){if(!_0x4c1f2b)throw new APINotFoundError(util[_0x437d('0xac')](_0x437d('0x112'),_0x315408[_0x437d('0x58')]['id']));return db[_0x437d('0x6d')][_0x437d('0x113')](function(_0x1801bc){return _0x4c1f2b[_0x437d('0x11c')](_0x10f593,{'transaction':_0x1801bc})[_0x437d('0x1a')](function(){return db[_0x437d('0x110')]['findAll']({'where':{'id':{'$in':_0x10f593}}});})['then'](function(_0xb96653){var _0x4bb214=_[_0x437d('0x41')](_0xb96653,function(_0x183c08){return _0x183c08[_0x437d('0x115')]();});return Promise[_0x437d('0x57')](_0x4bb214);})[_0x437d('0x1a')](function(_0x4f6659){_0x5c7198=_[_0x437d('0x116')](_0x4f6659);var _0x3f3b16=_[_0x437d('0x41')](_0x5c7198,function(_0x20808b){return _0x20808b[_0x437d('0x11d')](_0x4c1f2b['id'],{'transaction':_0x1801bc});});return Promise[_0x437d('0x57')](_0x3f3b16);})[_0x437d('0x1a')](function(){if(!_0x4c1f2b[_0x437d('0x9d')])return;var _0x2b8ca1=_[_0x437d('0x38')](_0x5c7198,function(_0x4522e5){return _0x4522e5[_0x437d('0x11a')]('channel')===_0x437d('0x118');});var _0x3286f5=_[_0x437d('0x41')](_0x2b8ca1,function(_0x55b8e3){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x55b8e3['id'],'UserId':_0x4c1f2b['id']},'transaction':_0x1801bc});});return Promise[_0x437d('0x57')](_0x3286f5);})[_0x437d('0x1a')](function(){return db[_0x437d('0x11e')][_0x437d('0x4e')]({'where':{'teamId':{'$in':_0x10f593}}});})['then'](function(_0x214eba){var _0x31b409=_[_0x437d('0x41')](_0x214eba,function(_0x1ceeec){return db[_0x437d('0x11f')][_0x437d('0x2f')]({'where':{'UserId':_0x4c1f2b['id'],'VoicePrefixId':_0x1ceeec['VoicePrefixId']}},{'transaction':_0x1801bc});});return Promise['all'](_0x31b409);});});})[_0x437d('0x1a')](function(){for(var _0x4841eb=0x0;_0x4841eb<_0x5c7198[_0x437d('0x5f')];_0x4841eb++){var _0x1aa9bd=_0x5c7198[_0x4841eb]['getDataValue'](_0x437d('0x9c'));var _0x1c1237=_0x1aa9bd+_0x437d('0xa7');socket[_0x437d('0xa8')](_0x437d('0x33')+_0x1aa9bd+'Queue:remove',{'UserId':_0xa60161,['queueField']:_0x5c7198[_0x4841eb]['id']});}})[_0x437d('0x1a')](respondWithStatusCode(_0x596926,null))[_0x437d('0x22')](APIHandleError(_0x596926));};exports[_0x437d('0x120')]=function(_0x43c5f3,_0x4f5b91){var _0x364afc={};var _0x3f21f1={};var _0x3f7765;var _0x178386;return db['User']['findOne']({'where':{'id':_0x43c5f3[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0x4f5b91,null))['then'](function(_0x1c6988){if(_0x1c6988){_0x3f7765=_0x1c6988;_0x3f21f1[_0x437d('0x5d')]=_[_0x437d('0x59')](db['CmList']['rawAttributes']);_0x3f21f1[_0x437d('0x47')]=_['keys'](_0x43c5f3[_0x437d('0x47')]);_0x3f21f1['filters']=_['intersection'](_0x3f21f1[_0x437d('0x5d')],_0x3f21f1[_0x437d('0x47')]);_0x364afc['attributes']=_[_0x437d('0x5c')](_0x3f21f1[_0x437d('0x5d')],qs[_0x437d('0x5e')](_0x43c5f3[_0x437d('0x47')]['fields']));_0x364afc['attributes']=_0x364afc['attributes'][_0x437d('0x5f')]?_0x364afc[_0x437d('0x4c')]:_0x3f21f1['model'];_0x364afc['order']=qs[_0x437d('0xcd')](_0x43c5f3['query'][_0x437d('0xcd')]);_0x364afc['where']=qs['filters'](_[_0x437d('0xcf')](_0x43c5f3[_0x437d('0x47')],_0x3f21f1[_0x437d('0x5b')]));if(_0x43c5f3[_0x437d('0x47')][_0x437d('0x38')]){_0x364afc[_0x437d('0xce')]=_[_0x437d('0x60')](_0x364afc[_0x437d('0xce')],{'$or':_[_0x437d('0x41')](_0x364afc['attributes'],function(_0x3ae3eb){var _0x4f2b3d={};_0x4f2b3d[_0x3ae3eb]={'$like':'%'+_0x43c5f3['query'][_0x437d('0x38')]+'%'};return _0x4f2b3d;})});}_0x364afc=_[_0x437d('0x60')]({},_0x364afc,_0x43c5f3[_0x437d('0xd0')]);return _0x3f7765[_0x437d('0x120')](_0x364afc);}})[_0x437d('0x1a')](function(_0x2a976d){if(_0x2a976d){_0x178386=_0x2a976d[_0x437d('0x5f')];if(!_0x43c5f3['query'][_0x437d('0xd1')](_0x437d('0xd5'))){_0x364afc['limit']=qs[_0x437d('0x29')](_0x43c5f3['query']['limit']);_0x364afc[_0x437d('0x27')]=qs['offset'](_0x43c5f3[_0x437d('0x47')][_0x437d('0x27')]);}return _0x3f7765[_0x437d('0x120')](_0x364afc);}})['then'](function(_0x39d88d){if(_0x39d88d){return _0x39d88d?{'count':_0x178386,'rows':_0x39d88d}:null;}})[_0x437d('0x1a')](respondWithResult(_0x4f5b91,null))[_0x437d('0x22')](handleError(_0x4f5b91,null));};exports[_0x437d('0x121')]=function(_0x37c2e5,_0xc6d6f6){var _0x511af3={};var _0x4b6532={};var _0xbcc795;return db[_0x437d('0x3f')]['findOne']({'where':{'id':_0x37c2e5[_0x437d('0x58')]['id']}})[_0x437d('0x1a')](handleEntityNotFound(_0xc6d6f6,null))['then'](function(_0x442a66){if(_0x442a66){_0xbcc795=_0x442a66;_0x4b6532[_0x437d('0x5d')]=_[_0x437d('0x59')](db[_0x437d('0x3f')]['rawAttributes']);_0x4b6532['query']=_[_0x437d('0x59')](_0x37c2e5['query']);_0x4b6532[_0x437d('0x5b')]=_[_0x437d('0x5c')](_0x4b6532[_0x437d('0x5d')],_0x4b6532[_0x437d('0x47')]);_0x511af3[_0x437d('0x4c')]=_[_0x437d('0x5c')](_0x4b6532['model'],qs[_0x437d('0x5e')](_0x37c2e5[_0x437d('0x47')][_0x437d('0x5e')]));_0x511af3[_0x437d('0x4c')]=_0x511af3[_0x437d('0x4c')][_0x437d('0x5f')]?_0x511af3[_0x437d('0x4c')]:_0x4b6532['model'];_0x511af3[_0x437d('0xcc')]=qs['sort'](_0x37c2e5[_0x437d('0x47')][_0x437d('0xcd')]);_0x511af3[_0x437d('0xce')]=qs[_0x437d('0x5b')](_[_0x437d('0xcf')](_0x37c2e5['query'],_0x4b6532[_0x437d('0x5b')]));if(_0x37c2e5[_0x437d('0x47')][_0x437d('0x38')]){_0x511af3[_0x437d('0xce')]=_[_0x437d('0x60')](_0x511af3['where'],{'$or':_[_0x437d('0x41')](_0x511af3[_0x437d('0x4c')],function(_0x15b1de){var _0x2e4b30={};_0x2e4b30[_0x15b1de]={'$like':'%'+_0x37c2e5['query'][_0x437d('0x38')]+'%'};return _0x2e4b30;})});}_0x511af3[_0x437d('0x5d')]=db[_0x437d('0x3f')];_0x511af3['as']=_0x437d('0x34');_0x511af3=_[_0x437d('0x60')]({},_0x511af3,_0x37c2e5[_0x437d('0xd0')]);return _0xbcc795[_0x437d('0xf7')]({'include':[_0x511af3]});}})[_0x437d('0x1a')](function(_0x4bd4a1){if(_0x4bd4a1){var _0xee8278={},_0x6c6370=[];for(var _0x54cc05=0x0;_0x54cc05<_0x4bd4a1[_0x437d('0x5f')];_0x54cc05+=0x1){for(var _0x4ac3e5=0x0,_0x599ef7;_0x4ac3e5<_0x4bd4a1[_0x54cc05][_0x437d('0x34')]['length'];_0x4ac3e5+=0x1){_0x599ef7=_0x4bd4a1[_0x54cc05][_0x437d('0x34')][_0x4ac3e5][_0x437d('0x30')]({'plain':!![]});_0xee8278[_0x599ef7['id']]=_0x599ef7;}}_0xee8278=_['values'](_0xee8278);for(var _0x21a5d2=qs[_0x437d('0x27')](_0x37c2e5['query'][_0x437d('0x27')]);_0x21a5d2<_0xee8278[_0x437d('0x5f')]&&_0x6c6370[_0x437d('0x5f')]=_0x4237c2[_0xeb0f('0x52')]){throw new Error(_0xeb0f('0x53'));}})['then'](function(){if(_0x53d2f8){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x53d2f8[_0xeb0f('0x29')]},'individualHooks':!![]});}})[_0xeb0f('0x22')](function(){if(_0x53d2f8){return _0x53d2f8[_0xeb0f('0x54')]({'raw':!![]});}})[_0xeb0f('0x22')](function(_0x437c3e){if(_0x53d2f8){if(_0x437c3e){var _0x529a35=[];_0x2101d5=_0x437c3e;if(_0x2101d5['length']){for(var _0x3c7f70=0x0;_0x3c7f70<_0x2101d5[_0xeb0f('0x2e')];_0x3c7f70++){_0x529a35['push'](db[_0xeb0f('0x3f')][_0xeb0f('0x55')]({'membername':_0x53d2f8[_0xeb0f('0x29')],'UserId':_0x53d2f8['id'],'queue_name':_0x2101d5[_0x3c7f70][_0xeb0f('0x29')],'VoiceQueueId':_0x2101d5[_0x3c7f70]['id'],'interface':_0x17cdac,'paused':_0x53d2f8[_0xeb0f('0x4f')]||![],'penalty':_0x2101d5[_0x3c7f70][_0xeb0f('0x56')]||0x0}));}return BPromise[_0xeb0f('0x4a')](_0x529a35);}}}})['then'](function(){if(_0x53d2f8){return db['MemberReport'][_0xeb0f('0x1a')]({'where':{'membername':_0x53d2f8['name'],'exitAt':null}});}})[_0xeb0f('0x22')](function(_0x240ef8){if(_0x53d2f8){if(_0x240ef8&&_0x240ef8[_0xeb0f('0x2e')]){var _0x418257=[];_0x240ef8[_0xeb0f('0x32')](function(_0x32616e){_0x418257['push'](_0x32616e['update']({'exitAt':moment()[_0xeb0f('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xeb0f('0x4a')](_0x418257);}}})[_0xeb0f('0x22')](function(_0x25e2df){if(_0x53d2f8){var _0x15b062=[];var _0x5b2b7=[];var _0x3fa636=utils[_0xeb0f('0x57')]();var _0x2ed759={'membername':_0x53d2f8[_0xeb0f('0x29')],'interface':_0x17cdac,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x53d2f8[_0xeb0f('0x58')],'internal':_0x53d2f8[_0xeb0f('0x2a')]};_0x3fa636[_0xeb0f('0x32')](function(_0x16ac3f){_0x15b062[_0xeb0f('0x49')](_['merge']({'channel':_0x16ac3f,'type':_0xeb0f('0x59'),'data1':'callysquare','data2':_0x17cdac},_0x2ed759));if(_0x53d2f8[_0xeb0f('0x4f')]){_0x5b2b7[_0xeb0f('0x49')](_[_0xeb0f('0x5a')]({'channel':_0x16ac3f,'type':_0xeb0f('0x40'),'data1':_0xeb0f('0x5b')},_0x2ed759));}});return db[_0xeb0f('0x2d')][_0xeb0f('0x39')](_0x15b062[_0xeb0f('0x5c')](_0x5b2b7),{'individualHooks':!![]});}})[_0xeb0f('0x22')](function(){if(_0x53d2f8){return _0x53d2f8[_0xeb0f('0x2c')]({'online':!![],'lastLoginAt':moment()[_0xeb0f('0x2f')](_0xeb0f('0x30')),'voicePause':_0x53d2f8[_0xeb0f('0x4f')]||![],'mailPause':_0x53d2f8['loginInPause']||![],'chatPause':_0x53d2f8['loginInPause']||![],'faxPause':_0x53d2f8[_0xeb0f('0x4f')]||![],'smsPause':_0x53d2f8[_0xeb0f('0x4f')]||![],'openchannelPause':_0x53d2f8['loginInPause']||![],'pauseType':_0x53d2f8[_0xeb0f('0x4f')]?_0xeb0f('0x5b'):null,'lastPauseAt':moment()[_0xeb0f('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x17cdac});}})['then'](function(_0x51e538){_0x567c98(_0x51e538);})['catch'](function(_0x12843d){_0x18c174(_0x35e47a[_0xeb0f('0x13')](0x1f4,_0x12843d[_0xeb0f('0x15')]));});});}; \ No newline at end of file +var _0x8cec=['limit','map','include','model','then','ShowUser','find','PauseUser','role','internal','UserVoiceQueueRt','update','name','length','updateAttributes','getChannels','forEach','push','isNil','format','SIP/%s','interface','PAUSE','YYYY-MM-DD\x20HH:mm:ss','DEFAULT\x20PAUSE','body','uniqueid','MemberReport','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','system','mail','chat','openchannel','whatsapp','set','%s%s','all','LogoutUser','destroy','mobile','loginInPause','count','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetUser','User','findAll','options','raw','where','attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x8cec,0xec));var _0xc8ce=function(_0x1f4fa2,_0x2d1375){_0x1f4fa2=_0x1f4fa2-0x0;var _0xbc90e6=_0x8cec[_0x1f4fa2];return _0xbc90e6;};'use strict';var _=require(_0xc8ce('0x0'));var util=require(_0xc8ce('0x1'));var moment=require(_0xc8ce('0x2'));var BPromise=require(_0xc8ce('0x3'));var rs=require(_0xc8ce('0x4'));var fs=require('fs');var Redis=require(_0xc8ce('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc8ce('0x6'))('rpc');var config=require(_0xc8ce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc8ce('0x8')][_0xc8ce('0x9')]({'port':0x232a});config[_0xc8ce('0xa')]=_[_0xc8ce('0xb')](config['redis'],{'host':_0xc8ce('0xc'),'port':0x18eb});var socket=require(_0xc8ce('0xd'))(new Redis(config[_0xc8ce('0xa')]));require(_0xc8ce('0xe'))[_0xc8ce('0xf')](socket);function respondWithRpcPromise(_0x1eba79,_0x513732,_0xecc558){return new BPromise(function(_0x26060c,_0xff2d6c){return client[_0xc8ce('0x10')](_0x1eba79,_0xecc558)['then'](function(_0x4ae6ed){logger[_0xc8ce('0x11')](_0xc8ce('0x12'),_0x513732,'request\x20sent');logger[_0xc8ce('0x13')](_0xc8ce('0x14'),_0x513732,'request\x20sent',JSON[_0xc8ce('0x15')](_0x4ae6ed));if(_0x4ae6ed[_0xc8ce('0x16')]){if(_0x4ae6ed[_0xc8ce('0x16')]['code']===0x1f4){logger[_0xc8ce('0x16')](_0xc8ce('0x12'),_0x513732,_0x4ae6ed[_0xc8ce('0x16')][_0xc8ce('0x17')]);return _0xff2d6c(_0x4ae6ed[_0xc8ce('0x16')][_0xc8ce('0x17')]);}logger[_0xc8ce('0x16')](_0xc8ce('0x12'),_0x513732,_0x4ae6ed['error'][_0xc8ce('0x17')]);return _0x26060c(_0x4ae6ed['error'][_0xc8ce('0x17')]);}else{logger[_0xc8ce('0x11')](_0xc8ce('0x12'),_0x513732,_0xc8ce('0x18'));_0x26060c(_0x4ae6ed[_0xc8ce('0x19')]['message']);}})[_0xc8ce('0x1a')](function(_0x27b298){logger[_0xc8ce('0x16')](_0xc8ce('0x12'),_0x513732,_0x27b298);_0xff2d6c(_0x27b298);});});}exports[_0xc8ce('0x1b')]=function(_0x39f336){var _0x554049=this;return new Promise(function(_0xef26d0,_0x14f7ea){return db[_0xc8ce('0x1c')][_0xc8ce('0x1d')]({'raw':_0x39f336[_0xc8ce('0x1e')]?_0x39f336[_0xc8ce('0x1e')][_0xc8ce('0x1f')]===undefined?!![]:![]:!![],'where':_0x39f336[_0xc8ce('0x1e')]?_0x39f336['options'][_0xc8ce('0x20')]||null:null,'attributes':_0x39f336[_0xc8ce('0x1e')]?_0x39f336[_0xc8ce('0x1e')][_0xc8ce('0x21')]||null:null,'limit':_0x39f336[_0xc8ce('0x1e')]?_0x39f336[_0xc8ce('0x1e')][_0xc8ce('0x22')]||null:null,'include':_0x39f336[_0xc8ce('0x1e')]?_0x39f336['options']['include']?_[_0xc8ce('0x23')](_0x39f336[_0xc8ce('0x1e')][_0xc8ce('0x24')],function(_0x23c867){return{'model':db[_0x23c867[_0xc8ce('0x25')]],'as':_0x23c867['as'],'attributes':_0x23c867[_0xc8ce('0x21')],'include':_0x23c867['include']?_['map'](_0x23c867[_0xc8ce('0x24')],function(_0x339c14){return{'model':db[_0x339c14[_0xc8ce('0x25')]],'as':_0x339c14['as'],'attributes':_0x339c14['attributes'],'include':_0x339c14[_0xc8ce('0x24')]?_[_0xc8ce('0x23')](_0x339c14[_0xc8ce('0x24')],function(_0x35a911){return{'model':db[_0x35a911[_0xc8ce('0x25')]],'as':_0x35a911['as'],'attributes':_0x35a911[_0xc8ce('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc8ce('0x26')](function(_0x44ea2c){logger['info']('GetUser',_0x39f336);logger[_0xc8ce('0x13')]('GetUser',_0x39f336,JSON[_0xc8ce('0x15')](_0x44ea2c));_0xef26d0(_0x44ea2c);})[_0xc8ce('0x1a')](function(_0x5104d1){logger[_0xc8ce('0x16')](_0xc8ce('0x1b'),_0x5104d1[_0xc8ce('0x17')],_0x39f336);_0x14f7ea(_0x554049[_0xc8ce('0x16')](0x1f4,_0x5104d1[_0xc8ce('0x17')]));});});};exports[_0xc8ce('0x27')]=function(_0x355113){var _0x277764=this;return new Promise(function(_0x50d53a,_0x2c81a7){return db[_0xc8ce('0x1c')][_0xc8ce('0x28')]({'raw':_0x355113[_0xc8ce('0x1e')]?_0x355113['options']['raw']===undefined?!![]:![]:!![],'where':_0x355113[_0xc8ce('0x1e')]?_0x355113[_0xc8ce('0x1e')]['where']||null:null,'attributes':_0x355113[_0xc8ce('0x1e')]?_0x355113[_0xc8ce('0x1e')]['attributes']||null:null,'include':_0x355113[_0xc8ce('0x1e')]?_0x355113['options']['include']?_[_0xc8ce('0x23')](_0x355113[_0xc8ce('0x1e')]['include'],function(_0x199b36){return{'model':db[_0x199b36[_0xc8ce('0x25')]],'as':_0x199b36['as'],'attributes':_0x199b36[_0xc8ce('0x21')],'include':_0x199b36[_0xc8ce('0x24')]?_[_0xc8ce('0x23')](_0x199b36['include'],function(_0x22e9ec){return{'model':db[_0x22e9ec[_0xc8ce('0x25')]],'as':_0x22e9ec['as'],'attributes':_0x22e9ec[_0xc8ce('0x21')],'include':_0x22e9ec[_0xc8ce('0x24')]?_[_0xc8ce('0x23')](_0x22e9ec[_0xc8ce('0x24')],function(_0x342fd2){return{'model':db[_0x342fd2['model']],'as':_0x342fd2['as'],'attributes':_0x342fd2[_0xc8ce('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc8ce('0x26')](function(_0x412ecf){logger[_0xc8ce('0x11')](_0xc8ce('0x27'),_0x355113);logger[_0xc8ce('0x13')](_0xc8ce('0x27'),_0x355113,JSON[_0xc8ce('0x15')](_0x412ecf));_0x50d53a(_0x412ecf);})[_0xc8ce('0x1a')](function(_0x443c48){logger[_0xc8ce('0x16')](_0xc8ce('0x27'),_0x443c48[_0xc8ce('0x17')],_0x355113);_0x2c81a7(_0x277764[_0xc8ce('0x16')](0x1f4,_0x443c48['message']));});});};exports[_0xc8ce('0x29')]=function(_0x392823){var _0x85e998=this;return new Promise(function(_0x32e0a4,_0x38af3a){var _0x50007e;return db[_0xc8ce('0x1c')][_0xc8ce('0x28')]({'where':_0x392823['options'][_0xc8ce('0x20')]||{},'attributes':['id','name',_0xc8ce('0x2a'),_0xc8ce('0x2b'),'interface']})[_0xc8ce('0x26')](function(_0x1dc51e){if(_0x1dc51e){_0x50007e=_0x1dc51e;return db[_0xc8ce('0x2c')][_0xc8ce('0x2d')]({'paused':0x1},{'where':{'UserId':_0x50007e['id']},'individualHooks':!![]});}})['then'](function(){if(_0x50007e){return db['MemberReport'][_0xc8ce('0x1d')]({'where':{'membername':_0x50007e[_0xc8ce('0x2e')],'type':'PAUSE','exitAt':null}});}})[_0xc8ce('0x26')](function(_0x3f6b8d){if(_0x50007e){if(_0x3f6b8d&&_0x3f6b8d[_0xc8ce('0x2f')]){var _0x5094a6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0xaf2a3f=0x0,_0x334e3a=_0x3f6b8d[_0xc8ce('0x2f')];_0xaf2a3f<_0x334e3a;_0xaf2a3f++){_0x3f6b8d[_0xaf2a3f][_0xc8ce('0x30')]({'exitAt':_0x5094a6});}}}})[_0xc8ce('0x26')](function(){if(_0x50007e){var _0x3690c3=[];var _0x29de16=utils[_0xc8ce('0x31')]();_0x29de16[_0xc8ce('0x32')](function(_0x10627c){_0x3690c3[_0xc8ce('0x33')]({'channel':_0x10627c,'membername':_0x50007e[_0xc8ce('0x2e')],'interface':_[_0xc8ce('0x34')](_0x50007e['interface'])?util[_0xc8ce('0x35')](_0xc8ce('0x36'),_0x50007e[_0xc8ce('0x2e')]):_0x50007e[_0xc8ce('0x37')],'type':_0xc8ce('0x38'),'enterAt':moment()['format'](_0xc8ce('0x39')),'data1':_0x392823['body']['type']||_0xc8ce('0x3a'),'role':_0x50007e[_0xc8ce('0x2a')],'internal':_0x50007e[_0xc8ce('0x2b')],'uniqueid':_0x392823[_0xc8ce('0x3b')][_0xc8ce('0x3c')]||null});});return db[_0xc8ce('0x3d')][_0xc8ce('0x3e')](_0x3690c3,{'individualHooks':!![]});}})[_0xc8ce('0x26')](function(){if(_0x50007e){return _0x50007e[_0xc8ce('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x392823[_0xc8ce('0x3b')][_0xc8ce('0x3f')]||_0xc8ce('0x3a'),'lastPauseAt':moment()[_0xc8ce('0x35')](_0xc8ce('0x39'))});}})[_0xc8ce('0x26')](function(_0x19e877){_0x32e0a4(_0x19e877);})[_0xc8ce('0x1a')](function(_0x2dcfab){_0x38af3a(_0x85e998['error'](0x1f4,_0x2dcfab[_0xc8ce('0x17')]));});});};exports[_0xc8ce('0x40')]=function(_0x85e233){var _0x80d0bc=this;return new Promise(function(_0xa71532,_0x2e5982){var _0xa72da1;return db['User'][_0xc8ce('0x41')]({'where':_0x85e233[_0xc8ce('0x1e')][_0xc8ce('0x20')]||{},'attributes':['id',_0xc8ce('0x2e')]})[_0xc8ce('0x26')](function(_0x41762c){if(_0x41762c){_0xa72da1=_0x41762c;if(_0x85e233[_0xc8ce('0x3b')][_0xc8ce('0x42')]&&!utils[_0xc8ce('0x43')](_0x85e233['body'][_0xc8ce('0x42')])){throw new Error('Unknown\x20channel');}switch(_0x85e233[_0xc8ce('0x3b')][_0xc8ce('0x42')]){case'voice':return db[_0xc8ce('0x2c')][_0xc8ce('0x2d')]({'paused':0x0},{'where':{'UserId':_0xa72da1['id']}})[_0xc8ce('0x26')](function(){return db['MemberReport'][_0xc8ce('0x28')]({'where':{'channel':_0x85e233[_0xc8ce('0x3b')][_0xc8ce('0x42')],'membername':_0xa72da1[_0xc8ce('0x2e')],'type':_0xc8ce('0x38'),'exitAt':null}});})[_0xc8ce('0x26')](function(_0x6f11b9){if(_0x6f11b9){return _0x6f11b9[_0xc8ce('0x2d')]({'exitAt':moment()[_0xc8ce('0x35')](_0xc8ce('0x39')),'data2':_0xc8ce('0x44')},{'individualHooks':!![]});}return null;})['then'](function(){return _0xa72da1[_0xc8ce('0x2d')]({'voicePause':![]});});case _0xc8ce('0x45'):case _0xc8ce('0x46'):case'fax':case'sms':case _0xc8ce('0x47'):case _0xc8ce('0x48'):return db[_0xc8ce('0x3d')][_0xc8ce('0x28')]({'where':{'channel':_0x85e233[_0xc8ce('0x3b')][_0xc8ce('0x42')],'membername':_0xa72da1[_0xc8ce('0x2e')],'type':_0xc8ce('0x38'),'exitAt':null}})['then'](function(_0x1e3ef9){return _0x1e3ef9[_0xc8ce('0x2d')]({'exitAt':moment()[_0xc8ce('0x35')](_0xc8ce('0x39')),'data2':_0xc8ce('0x44')},{'individualHooks':!![]});})[_0xc8ce('0x26')](function(){var _0x4125b8={};_[_0xc8ce('0x49')](_0x4125b8,util['format'](_0xc8ce('0x4a'),_0x85e233[_0xc8ce('0x3b')][_0xc8ce('0x42')],'Pause'),![]);return _0xa72da1[_0xc8ce('0x2d')](_0x4125b8);});default:return db[_0xc8ce('0x2c')][_0xc8ce('0x2d')]({'paused':0x0},{'where':{'UserId':_0xa72da1['id']}})[_0xc8ce('0x26')](function(){return db[_0xc8ce('0x3d')]['findAll']({'where':{'membername':_0xa72da1[_0xc8ce('0x2e')],'type':'PAUSE','exitAt':null}});})[_0xc8ce('0x26')](function(_0x99ade0){var _0x288622=[];_0x99ade0['forEach'](function(_0x1b4b58){_0x288622[_0xc8ce('0x33')](_0x1b4b58['update']({'exitAt':moment()[_0xc8ce('0x35')](_0xc8ce('0x39')),'data2':_0xc8ce('0x44')}));});return BPromise[_0xc8ce('0x4b')](_0x288622);})['then'](function(){return _0xa72da1[_0xc8ce('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xc8ce('0x26')](function(_0x9367bf){_0xa71532(_0x9367bf);})['catch'](function(_0x416eaa){_0x2e5982(_0x80d0bc['error'](0x1f4,_0x416eaa[_0xc8ce('0x17')]));});});};exports[_0xc8ce('0x4c')]=function(_0x3f36df){var _0x2f1ade=this;return new Promise(function(_0x2a85cc,_0x501745){var _0xd40786;return db['User'][_0xc8ce('0x41')]({'where':_0x3f36df[_0xc8ce('0x1e')][_0xc8ce('0x20')]||{},'attributes':['id',_0xc8ce('0x2e')]})[_0xc8ce('0x26')](function(_0x23b15b){if(_0x23b15b){_0xd40786=_0x23b15b;return db[_0xc8ce('0x2c')][_0xc8ce('0x4d')]({'where':{'membername':_0xd40786[_0xc8ce('0x2e')]},'individualHooks':!![]});}})[_0xc8ce('0x26')](function(){if(_0xd40786){return db[_0xc8ce('0x3d')][_0xc8ce('0x1d')]({'where':{'membername':_0xd40786[_0xc8ce('0x2e')],'exitAt':null}});}})[_0xc8ce('0x26')](function(_0xd702b4){if(_0xd40786){if(_0xd702b4&&_0xd702b4['length']){var _0x5d94c1=[];_0xd702b4[_0xc8ce('0x32')](function(_0x4e1033){_0x5d94c1[_0xc8ce('0x33')](_0x4e1033[_0xc8ce('0x2d')]({'exitAt':moment()['format'](_0xc8ce('0x39'))}));});return BPromise[_0xc8ce('0x4b')](_0x5d94c1);}}})['then'](function(){if(_0xd40786){return _0xd40786[_0xc8ce('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x4044dc){_0x2a85cc(_0x4044dc);})[_0xc8ce('0x1a')](function(_0x314b02){_0x501745(_0x2f1ade[_0xc8ce('0x16')](0x1f4,_0x314b02[_0xc8ce('0x17')]));});});};exports['LoginUser']=function(_0x4152f9){var _0x1113f4=this;return new Promise(function(_0x27a8be,_0x4cfbb9){var _0x55e012;var _0x211db4;var _0x11279f;var _0x4a2b85;return db[_0xc8ce('0x1c')]['findOne']({'where':_0x4152f9[_0xc8ce('0x1e')]['where']||{},'attributes':['id',_0xc8ce('0x2e'),_0xc8ce('0x2a'),_0xc8ce('0x4e'),'phone',_0xc8ce('0x2b'),_0xc8ce('0x4f'),_0xc8ce('0x37')]})[_0xc8ce('0x26')](function(_0x487ee6){if(_0x487ee6){_0x55e012=_0x487ee6;_0x4a2b85=_0x4152f9[_0xc8ce('0x3b')]['interface']?_0x4152f9[_0xc8ce('0x3b')][_0xc8ce('0x37')]:util['format'](_0xc8ce('0x36'),_0x55e012['name']);return db[_0xc8ce('0x1c')][_0xc8ce('0x50')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x55e012['id']}}});}})[_0xc8ce('0x26')](function(_0x48bace){if(_0x48bace){_0x11279f=_0x48bace;return require('../../config/license/util')['getLicense']();}})['then'](function(_0x50be93){if(_0x50be93&&_0x50be93[_0xc8ce('0x51')]&&_0x11279f>=_0x50be93[_0xc8ce('0x51')]){throw new Error(_0xc8ce('0x52'));}})[_0xc8ce('0x26')](function(){if(_0x55e012){return db[_0xc8ce('0x2c')][_0xc8ce('0x4d')]({'where':{'membername':_0x55e012[_0xc8ce('0x2e')]},'individualHooks':!![]});}})[_0xc8ce('0x26')](function(){if(_0x55e012){return _0x55e012[_0xc8ce('0x53')]({'raw':!![]});}})[_0xc8ce('0x26')](function(_0x560f96){if(_0x55e012){if(_0x560f96){var _0x33dbd0=[];_0x211db4=_0x560f96;if(_0x211db4[_0xc8ce('0x2f')]){for(var _0x162a57=0x0;_0x162a57<_0x211db4[_0xc8ce('0x2f')];_0x162a57++){_0x33dbd0[_0xc8ce('0x33')](db[_0xc8ce('0x2c')]['upsert']({'membername':_0x55e012['name'],'UserId':_0x55e012['id'],'queue_name':_0x211db4[_0x162a57][_0xc8ce('0x2e')],'VoiceQueueId':_0x211db4[_0x162a57]['id'],'interface':_0x4a2b85,'paused':_0x55e012[_0xc8ce('0x4f')]||![],'penalty':_0x211db4[_0x162a57][_0xc8ce('0x54')]||0x0}));}return BPromise['all'](_0x33dbd0);}}}})[_0xc8ce('0x26')](function(){if(_0x55e012){return db['MemberReport'][_0xc8ce('0x1d')]({'where':{'membername':_0x55e012[_0xc8ce('0x2e')],'exitAt':null}});}})[_0xc8ce('0x26')](function(_0x5957d8){if(_0x55e012){if(_0x5957d8&&_0x5957d8[_0xc8ce('0x2f')]){var _0x1eae5a=[];_0x5957d8[_0xc8ce('0x32')](function(_0x28d8a){_0x1eae5a['push'](_0x28d8a[_0xc8ce('0x2d')]({'exitAt':moment()['format'](_0xc8ce('0x39'))}));});return BPromise[_0xc8ce('0x4b')](_0x1eae5a);}}})['then'](function(_0x316846){if(_0x55e012){var _0xdab43d=[];var _0x500dc7=[];var _0x342d5e=utils['getChannels']();var _0x240fd3={'membername':_0x55e012[_0xc8ce('0x2e')],'interface':_0x4a2b85,'enterAt':moment()[_0xc8ce('0x35')](_0xc8ce('0x39')),'role':_0x55e012[_0xc8ce('0x2a')],'internal':_0x55e012['internal']};_0x342d5e[_0xc8ce('0x32')](function(_0xe44f90){_0xdab43d[_0xc8ce('0x33')](_[_0xc8ce('0x55')]({'channel':_0xe44f90,'type':_0xc8ce('0x56'),'data1':_0xc8ce('0x57'),'data2':_0x4a2b85},_0x240fd3));if(_0x55e012[_0xc8ce('0x4f')]){_0x500dc7[_0xc8ce('0x33')](_[_0xc8ce('0x55')]({'channel':_0xe44f90,'type':_0xc8ce('0x38'),'data1':_0xc8ce('0x58')},_0x240fd3));}});return db[_0xc8ce('0x3d')]['bulkCreate'](_0xdab43d[_0xc8ce('0x59')](_0x500dc7),{'individualHooks':!![]});}})[_0xc8ce('0x26')](function(){if(_0x55e012){return _0x55e012['update']({'online':!![],'lastLoginAt':moment()[_0xc8ce('0x35')](_0xc8ce('0x39')),'voicePause':_0x55e012[_0xc8ce('0x4f')]||![],'mailPause':_0x55e012[_0xc8ce('0x4f')]||![],'chatPause':_0x55e012[_0xc8ce('0x4f')]||![],'faxPause':_0x55e012[_0xc8ce('0x4f')]||![],'smsPause':_0x55e012['loginInPause']||![],'openchannelPause':_0x55e012[_0xc8ce('0x4f')]||![],'pauseType':_0x55e012[_0xc8ce('0x4f')]?_0xc8ce('0x58'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4a2b85});}})[_0xc8ce('0x26')](function(_0x1c56d7){_0x27a8be(_0x1c56d7);})['catch'](function(_0x5cf1d8){_0x4cfbb9(_0x1113f4[_0xc8ce('0x16')](0x1f4,_0x5cf1d8['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index d6b1407..ad74504 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 _0x9200=['removeListener','user:','./user.events','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9200,0xbc));var _0x0920=function(_0x1e8a1b,_0x1947d0){_0x1e8a1b=_0x1e8a1b-0x0;var _0x4db0e2=_0x9200[_0x1e8a1b];return _0x4db0e2;};'use strict';var UserEvents=require(_0x0920('0x0'));var events=[_0x0920('0x1'),_0x0920('0x2'),'update'];function createListener(_0x2c941c,_0x4a8754){return function(_0x2796c6){_0x4a8754[_0x0920('0x3')](_0x2c941c,_0x2796c6);};}function removeListener(_0x942ee6,_0x3f02f2){return function(){UserEvents[_0x0920('0x4')](_0x942ee6,_0x3f02f2);};}exports['register']=function(_0x298133){for(var _0x16c1b7=0x0,_0xaca725=events['length'];_0x16c1b7<_0xaca725;_0x16c1b7++){var _0x25f537=events[_0x16c1b7];var _0x4e2e4c=createListener(_0x0920('0x5')+_0x25f537,_0x298133);UserEvents['on'](_0x25f537,_0x4e2e4c);}}; \ No newline at end of file +var _0xe06c=['save','remove','update','removeListener','length','user:','./user.events'];(function(_0x21c360,_0x3de0d5){var _0x164bac=function(_0x553163){while(--_0x553163){_0x21c360['push'](_0x21c360['shift']());}};_0x164bac(++_0x3de0d5);}(_0xe06c,0x1e9));var _0xce06=function(_0x8a6eec,_0x4da550){_0x8a6eec=_0x8a6eec-0x0;var _0x1c4075=_0xe06c[_0x8a6eec];return _0x1c4075;};'use strict';var UserEvents=require(_0xce06('0x0'));var events=[_0xce06('0x1'),_0xce06('0x2'),_0xce06('0x3')];function createListener(_0x1c853e,_0x51aac1){return function(_0x103cfa){_0x51aac1['emit'](_0x1c853e,_0x103cfa);};}function removeListener(_0x5127b2,_0x13bd48){return function(){UserEvents[_0xce06('0x4')](_0x5127b2,_0x13bd48);};}exports['register']=function(_0x1cdbaf){for(var _0x2033f4=0x0,_0x3e41d8=events[_0xce06('0x5')];_0x2033f4<_0x3e41d8;_0x2033f4++){var _0x3909e3=events[_0x2033f4];var _0x3a5e4f=createListener(_0xce06('0x6')+_0x3909e3,_0x1cdbaf);UserEvents['on'](_0x3909e3,_0x3a5e4f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4f2ed60..83c9b61 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x504235,_0x5b5b41){var _0x557913=function(_0xee5651){while(--_0xee5651){_0x504235['push'](_0x504235['shift']());}};_0x557913(++_0x5b5b41);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2001cf,_0x1e8943){var _0x3a2182=function(_0x49eca1){while(--_0x49eca1){_0x2001cf['push'](_0x2001cf['shift']());}};_0x3a2182(++_0x1e8943);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8276fe8..120c206 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 _0xf011=['INTEGER','sequelize','exports'];(function(_0x510ffb,_0x5629c9){var _0x55833a=function(_0x1bd634){while(--_0x1bd634){_0x510ffb['push'](_0x510ffb['shift']());}};_0x55833a(++_0x5629c9);}(_0xf011,0x1ae));var _0x1f01=function(_0x4ade1e,_0x579731){_0x4ade1e=_0x4ade1e-0x0;var _0x23aef7=_0xf011[_0x4ade1e];return _0x23aef7;};'use strict';var Sequelize=require(_0x1f01('0x0'));module[_0x1f01('0x1')]={'penalty':{'type':Sequelize[_0x1f01('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x29bd=['INTEGER','sequelize','exports'];(function(_0x507436,_0x445faa){var _0x43b784=function(_0x5bbc0c){while(--_0x5bbc0c){_0x507436['push'](_0x507436['shift']());}};_0x43b784(++_0x445faa);}(_0x29bd,0x178));var _0xd29b=function(_0x179bc6,_0x3f3571){_0x179bc6=_0x179bc6-0x0;var _0x44c3ac=_0x29bd[_0x179bc6];return _0x44c3ac;};'use strict';var Sequelize=require(_0xd29b('0x0'));module[_0xd29b('0x1')]={'penalty':{'type':Sequelize[_0xd29b('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 39ba525..531b707 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 _0xd881=['define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x33c82f,_0x1ef2c8){var _0x565b8e=function(_0x522ca3){while(--_0x522ca3){_0x33c82f['push'](_0x33c82f['shift']());}};_0x565b8e(++_0x1ef2c8);}(_0xd881,0xfa));var _0x1d88=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd881[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x1d88('0x0'));var util=require(_0x1d88('0x1'));var logger=require('../../config/logger')(_0x1d88('0x2'));var moment=require(_0x1d88('0x3'));var BPromise=require(_0x1d88('0x4'));var rp=require(_0x1d88('0x5'));var fs=require('fs');var path=require(_0x1d88('0x6'));var rimraf=require(_0x1d88('0x7'));var config=require(_0x1d88('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x1d88('0x9')]=function(_0x4a4235,_0x1eca00){return _0x4a4235[_0x1d88('0xa')](_0x1d88('0xb'),attributes,{'tableName':_0x1d88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6abd=['UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','bluebird','request-promise','path','./userChatQueue.attributes','exports','define'];(function(_0x2cb1bd,_0x42b64c){var _0x393fdf=function(_0x532988){while(--_0x532988){_0x2cb1bd['push'](_0x2cb1bd['shift']());}};_0x393fdf(++_0x42b64c);}(_0x6abd,0x157));var _0xd6ab=function(_0x3fd910,_0x44ecb0){_0x3fd910=_0x3fd910-0x0;var _0x4ad75c=_0x6abd[_0x3fd910];return _0x4ad75c;};'use strict';var _=require(_0xd6ab('0x0'));var util=require(_0xd6ab('0x1'));var logger=require(_0xd6ab('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd6ab('0x3'));var rp=require(_0xd6ab('0x4'));var fs=require('fs');var path=require(_0xd6ab('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd6ab('0x6'));module[_0xd6ab('0x7')]=function(_0x19c934,_0x3ebfbd){return _0x19c934[_0xd6ab('0x8')](_0xd6ab('0x9'),attributes,{'tableName':_0xd6ab('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 fc35647..c799189 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 _0x33d6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment'];(function(_0x2225eb,_0x124735){var _0x1409e4=function(_0x2b0d22){while(--_0x2b0d22){_0x2225eb['push'](_0x2225eb['shift']());}};_0x1409e4(++_0x124735);}(_0x33d6,0x1cd));var _0x633d=function(_0x358049,_0x56e00a){_0x358049=_0x358049-0x0;var _0x2426d1=_0x33d6[_0x358049];return _0x2426d1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x633d('0x0'));var BPromise=require('bluebird');var rs=require(_0x633d('0x1'));var fs=require('fs');var Redis=require(_0x633d('0x2'));var db=require(_0x633d('0x3'))['db'];var utils=require(_0x633d('0x4'));var logger=require(_0x633d('0x5'))('rpc');var config=require(_0x633d('0x6'));var jayson=require(_0x633d('0x7'));var client=jayson[_0x633d('0x8')][_0x633d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9ee9bc,_0x20b635,_0x14cfb3){return new BPromise(function(_0x353256,_0x4f509b){return client[_0x633d('0xa')](_0x9ee9bc,_0x14cfb3)['then'](function(_0x8c847e){logger[_0x633d('0xb')](_0x633d('0xc'),_0x20b635,_0x633d('0xd'));logger[_0x633d('0xe')](_0x633d('0xf'),_0x20b635,_0x633d('0xd'),JSON['stringify'](_0x8c847e));if(_0x8c847e['error']){if(_0x8c847e[_0x633d('0x10')][_0x633d('0x11')]===0x1f4){logger[_0x633d('0x10')](_0x633d('0xc'),_0x20b635,_0x8c847e['error'][_0x633d('0x12')]);return _0x4f509b(_0x8c847e[_0x633d('0x10')][_0x633d('0x12')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x20b635,_0x8c847e[_0x633d('0x10')][_0x633d('0x12')]);return _0x353256(_0x8c847e['error'][_0x633d('0x12')]);}else{logger[_0x633d('0xb')](_0x633d('0xc'),_0x20b635,_0x633d('0xd'));_0x353256(_0x8c847e[_0x633d('0x13')][_0x633d('0x12')]);}})[_0x633d('0x14')](function(_0x4d4970){logger['error'](_0x633d('0xc'),_0x20b635,_0x4d4970);_0x4f509b(_0x4d4970);});});} \ No newline at end of file +var _0x7a86=['info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a86,0x14d));var _0x67a8=function(_0xbef058,_0x12a964){_0xbef058=_0xbef058-0x0;var _0x4178f1=_0x7a86[_0xbef058];return _0x4178f1;};'use strict';var _=require(_0x67a8('0x0'));var util=require(_0x67a8('0x1'));var moment=require(_0x67a8('0x2'));var BPromise=require(_0x67a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67a8('0x4'));var db=require(_0x67a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x67a8('0x6'))(_0x67a8('0x7'));var config=require(_0x67a8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67a8('0x9')][_0x67a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8a4258,_0x452c53,_0x4b8a2a){return new BPromise(function(_0x4eede2,_0x493c05){return client['request'](_0x8a4258,_0x4b8a2a)[_0x67a8('0xb')](function(_0x21d3ce){logger[_0x67a8('0xc')](_0x67a8('0xd'),_0x452c53,_0x67a8('0xe'));logger[_0x67a8('0xf')](_0x67a8('0x10'),_0x452c53,_0x67a8('0xe'),JSON[_0x67a8('0x11')](_0x21d3ce));if(_0x21d3ce[_0x67a8('0x12')]){if(_0x21d3ce[_0x67a8('0x12')][_0x67a8('0x13')]===0x1f4){logger[_0x67a8('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x452c53,_0x21d3ce[_0x67a8('0x12')][_0x67a8('0x14')]);return _0x493c05(_0x21d3ce[_0x67a8('0x12')]['message']);}logger[_0x67a8('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x452c53,_0x21d3ce[_0x67a8('0x12')]['message']);return _0x4eede2(_0x21d3ce[_0x67a8('0x12')][_0x67a8('0x14')]);}else{logger[_0x67a8('0xc')](_0x67a8('0xd'),_0x452c53,_0x67a8('0xe'));_0x4eede2(_0x21d3ce[_0x67a8('0x15')]['message']);}})[_0x67a8('0x16')](function(_0x58fb45){logger[_0x67a8('0x12')](_0x67a8('0xd'),_0x452c53,_0x58fb45);_0x493c05(_0x58fb45);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2ea6c43..5f3c609 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x877497,_0x482e01){var _0x3e63d1=function(_0xf13d54){while(--_0xf13d54){_0x877497['push'](_0x877497['shift']());}};_0x3e63d1(++_0x482e01);}(_0xe706,0xa3));var _0x6e70=function(_0x16b51e,_0x30cb17){_0x16b51e=_0x16b51e-0x0;var _0x27b91a=_0xe706[_0x16b51e];return _0x27b91a;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x56b30e,_0x486769){var _0x27aec6=function(_0x1e4d80){while(--_0x1e4d80){_0x56b30e['push'](_0x56b30e['shift']());}};_0x27aec6(++_0x486769);}(_0x70e0,0x17b));var _0x070e=function(_0x9f21a8,_0x4ad4b2){_0x9f21a8=_0x9f21a8-0x0;var _0x1f74c4=_0x70e0[_0x9f21a8];return _0x1f74c4;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 7fc5e63..9518f13 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 _0x4f72=['INTEGER','STRING','sequelize','exports'];(function(_0x2f4c4b,_0x455f87){var _0x534abb=function(_0x1019b3){while(--_0x1019b3){_0x2f4c4b['push'](_0x2f4c4b['shift']());}};_0x534abb(++_0x455f87);}(_0x4f72,0x146));var _0x24f7=function(_0x465439,_0x65d475){_0x465439=_0x465439-0x0;var _0x4ccb75=_0x4f72[_0x465439];return _0x4ccb75;};'use strict';var Sequelize=require(_0x24f7('0x0'));module[_0x24f7('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x24f7('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x24f7('0x3')]}}; \ No newline at end of file +var _0x8d6e=['exports','INTEGER','sequelize'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0x8d6e,0x176));var _0xe8d6=function(_0x498c8b,_0x509fda){_0x498c8b=_0x498c8b-0x0;var _0xd61d86=_0x8d6e[_0x498c8b];return _0xd61d86;};'use strict';var Sequelize=require(_0xe8d6('0x0'));module[_0xe8d6('0x1')]={'penalty':{'type':Sequelize[_0xe8d6('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe8d6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 776d261..1044bf7 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 _0xec9c=['path','rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','lodash','util','api','moment','bluebird'];(function(_0x47cb26,_0x4efedd){var _0xa9e9f3=function(_0x44c43b){while(--_0x44c43b){_0x47cb26['push'](_0x47cb26['shift']());}};_0xa9e9f3(++_0x4efedd);}(_0xec9c,0x1ef));var _0xcec9=function(_0x5072c3,_0x207313){_0x5072c3=_0x5072c3-0x0;var _0x59f76e=_0xec9c[_0x5072c3];return _0x59f76e;};'use strict';var _=require(_0xcec9('0x0'));var util=require(_0xcec9('0x1'));var logger=require('../../config/logger')(_0xcec9('0x2'));var moment=require(_0xcec9('0x3'));var BPromise=require(_0xcec9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcec9('0x5'));var rimraf=require(_0xcec9('0x6'));var config=require(_0xcec9('0x7'));var attributes=require(_0xcec9('0x8'));module['exports']=function(_0x283986,_0x5e8d80){return _0x283986['define'](_0xcec9('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ca5=['../../config/environment','./userFaxQueue.attributes','define','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x154d1e,_0x1f705a){var _0x17568e=function(_0x2da0bb){while(--_0x2da0bb){_0x154d1e['push'](_0x154d1e['shift']());}};_0x17568e(++_0x1f705a);}(_0x3ca5,0x112));var _0x53ca=function(_0xbbb609,_0x214b82){_0xbbb609=_0xbbb609-0x0;var _0x720cf=_0x3ca5[_0xbbb609];return _0x720cf;};'use strict';var _=require('lodash');var util=require(_0x53ca('0x0'));var logger=require(_0x53ca('0x1'))(_0x53ca('0x2'));var moment=require(_0x53ca('0x3'));var BPromise=require(_0x53ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x53ca('0x5'));var config=require(_0x53ca('0x6'));var attributes=require(_0x53ca('0x7'));module['exports']=function(_0x10c8fc,_0x9a1607){return _0x10c8fc[_0x53ca('0x8')]('UserFaxQueue',attributes,{'tableName':_0x53ca('0x9'),'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 7afa8f5..e1536ae 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 _0xbf4c=['then','info','request\x20sent','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1225e7,_0xa60c50){var _0x571029=function(_0x57cbdd){while(--_0x57cbdd){_0x1225e7['push'](_0x1225e7['shift']());}};_0x571029(++_0xa60c50);}(_0xbf4c,0x6d));var _0xcbf4=function(_0x32a61e,_0x2cf3bd){_0x32a61e=_0x32a61e-0x0;var _0x9d8ea9=_0xbf4c[_0x32a61e];return _0x9d8ea9;};'use strict';var _=require('lodash');var util=require(_0xcbf4('0x0'));var moment=require(_0xcbf4('0x1'));var BPromise=require(_0xcbf4('0x2'));var rs=require(_0xcbf4('0x3'));var fs=require('fs');var Redis=require(_0xcbf4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbf4('0x5'));var logger=require('../../config/logger')(_0xcbf4('0x6'));var config=require(_0xcbf4('0x7'));var jayson=require(_0xcbf4('0x8'));var client=jayson[_0xcbf4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26c1a9,_0x58a3fc,_0x261acd){return new BPromise(function(_0x48a0f7,_0x5aaf79){return client[_0xcbf4('0xa')](_0x26c1a9,_0x261acd)[_0xcbf4('0xb')](function(_0x1ca2ff){logger[_0xcbf4('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x58a3fc,_0xcbf4('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x58a3fc,_0xcbf4('0xd'),JSON['stringify'](_0x1ca2ff));if(_0x1ca2ff[_0xcbf4('0xe')]){if(_0x1ca2ff[_0xcbf4('0xe')][_0xcbf4('0xf')]===0x1f4){logger[_0xcbf4('0xe')](_0xcbf4('0x10'),_0x58a3fc,_0x1ca2ff[_0xcbf4('0xe')][_0xcbf4('0x11')]);return _0x5aaf79(_0x1ca2ff[_0xcbf4('0xe')][_0xcbf4('0x11')]);}logger[_0xcbf4('0xe')](_0xcbf4('0x10'),_0x58a3fc,_0x1ca2ff[_0xcbf4('0xe')]['message']);return _0x48a0f7(_0x1ca2ff['error'][_0xcbf4('0x11')]);}else{logger[_0xcbf4('0xc')](_0xcbf4('0x10'),_0x58a3fc,'request\x20sent');_0x48a0f7(_0x1ca2ff[_0xcbf4('0x12')][_0xcbf4('0x11')]);}})[_0xcbf4('0x13')](function(_0x59fb4b){logger['error'](_0xcbf4('0x10'),_0x58a3fc,_0x59fb4b);_0x5aaf79(_0x59fb4b);});});} \ No newline at end of file +var _0x2d08=['../../mysqldb','rpc','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xc3c747,_0x49314f){var _0x1f2345=function(_0x357df8){while(--_0x357df8){_0xc3c747['push'](_0xc3c747['shift']());}};_0x1f2345(++_0x49314f);}(_0x2d08,0x16a));var _0x82d0=function(_0x4b4154,_0x38a122){_0x4b4154=_0x4b4154-0x0;var _0x340ed7=_0x2d08[_0x4b4154];return _0x340ed7;};'use strict';var _=require(_0x82d0('0x0'));var util=require(_0x82d0('0x1'));var moment=require(_0x82d0('0x2'));var BPromise=require(_0x82d0('0x3'));var rs=require(_0x82d0('0x4'));var fs=require('fs');var Redis=require(_0x82d0('0x5'));var db=require(_0x82d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x82d0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x82d0('0x8')][_0x82d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52b442,_0x1400dc,_0x308bf0){return new BPromise(function(_0x1db198,_0x42bcae){return client[_0x82d0('0xa')](_0x52b442,_0x308bf0)[_0x82d0('0xb')](function(_0x44c9fb){logger[_0x82d0('0xc')](_0x82d0('0xd'),_0x1400dc,_0x82d0('0xe'));logger[_0x82d0('0xf')](_0x82d0('0x10'),_0x1400dc,_0x82d0('0xe'),JSON[_0x82d0('0x11')](_0x44c9fb));if(_0x44c9fb['error']){if(_0x44c9fb['error'][_0x82d0('0x12')]===0x1f4){logger[_0x82d0('0x13')](_0x82d0('0xd'),_0x1400dc,_0x44c9fb[_0x82d0('0x13')]['message']);return _0x42bcae(_0x44c9fb[_0x82d0('0x13')][_0x82d0('0x14')]);}logger[_0x82d0('0x13')](_0x82d0('0xd'),_0x1400dc,_0x44c9fb['error']['message']);return _0x1db198(_0x44c9fb[_0x82d0('0x13')][_0x82d0('0x14')]);}else{logger['info'](_0x82d0('0xd'),_0x1400dc,'request\x20sent');_0x1db198(_0x44c9fb[_0x82d0('0x15')]['message']);}})[_0x82d0('0x16')](function(_0xb7c119){logger[_0x82d0('0x13')](_0x82d0('0xd'),_0x1400dc,_0xb7c119);_0x42bcae(_0xb7c119);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2433535..9146aea 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x404f55,_0x2814e3){var _0x395a9e=function(_0x5846e9){while(--_0x5846e9){_0x404f55['push'](_0x404f55['shift']());}};_0x395a9e(++_0x2814e3);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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(_0x456be1,_0x248c6e){var _0x43fa66=function(_0x8c0df9){while(--_0x8c0df9){_0x456be1['push'](_0x456be1['shift']());}};_0x43fa66(++_0x248c6e);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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 bf67c48..c1de7f3 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 _0x58af=['exports','INTEGER','sequelize'];(function(_0x308dcc,_0x2d1178){var _0x361717=function(_0x618aae){while(--_0x618aae){_0x308dcc['push'](_0x308dcc['shift']());}};_0x361717(++_0x2d1178);}(_0x58af,0x140));var _0xf58a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x58af[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xf58a('0x0'));module[_0xf58a('0x1')]={'penalty':{'type':Sequelize[_0xf58a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6236=['sequelize','INTEGER'];(function(_0x2a34ee,_0x270166){var _0x193278=function(_0x4b88bc){while(--_0x4b88bc){_0x2a34ee['push'](_0x2a34ee['shift']());}};_0x193278(++_0x270166);}(_0x6236,0x198));var _0x6623=function(_0x2e579a,_0x3dabc9){_0x2e579a=_0x2e579a-0x0;var _0x220911=_0x6236[_0x2e579a];return _0x220911;};'use strict';var Sequelize=require(_0x6623('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6623('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 36baeb0..01b156a 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 _0xc0fe=['moment','bluebird','path','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x4827ec,_0x37db7e){var _0x3e62a5=function(_0x4dadb2){while(--_0x4dadb2){_0x4827ec['push'](_0x4827ec['shift']());}};_0x3e62a5(++_0x37db7e);}(_0xc0fe,0xdd));var _0xec0f=function(_0xaff3ac,_0x1c453d){_0xaff3ac=_0xaff3ac-0x0;var _0x49861c=_0xc0fe[_0xaff3ac];return _0x49861c;};'use strict';var _=require(_0xec0f('0x0'));var util=require(_0xec0f('0x1'));var logger=require(_0xec0f('0x2'))(_0xec0f('0x3'));var moment=require(_0xec0f('0x4'));var BPromise=require(_0xec0f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec0f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x34428c,_0x797dbf){return _0x34428c['define'](_0xec0f('0x7'),attributes,{'tableName':_0xec0f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95fe=['../../config/logger','api','moment','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x396cd1,_0x2eb368){var _0x59dd4a=function(_0x8721b5){while(--_0x8721b5){_0x396cd1['push'](_0x396cd1['shift']());}};_0x59dd4a(++_0x2eb368);}(_0x95fe,0x8e));var _0xe95f=function(_0x3f6381,_0x518409){_0x3f6381=_0x3f6381-0x0;var _0x398bde=_0x95fe[_0x3f6381];return _0x398bde;};'use strict';var _=require(_0xe95f('0x0'));var util=require(_0xe95f('0x1'));var logger=require(_0xe95f('0x2'))(_0xe95f('0x3'));var moment=require(_0xe95f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe95f('0x5'));var config=require(_0xe95f('0x6'));var attributes=require(_0xe95f('0x7'));module[_0xe95f('0x8')]=function(_0x4caec6,_0x213e83){return _0x4caec6[_0xe95f('0x9')](_0xe95f('0xa'),attributes,{'tableName':_0xe95f('0xb'),'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 ad2d5a3..cd6476e 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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x751ac6,_0x49f274){var _0x2b57d7=function(_0x54415c){while(--_0x54415c){_0x751ac6['push'](_0x751ac6['shift']());}};_0x2b57d7(++_0x49f274);}(_0x4b84,0x1cc));var _0x44b8=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x4b84[_0x389832];return _0x59429e;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x1cb9,0x14e));var _0x91cb=function(_0x203faa,_0x1780a2){_0x203faa=_0x203faa-0x0;var _0x57eab2=_0x1cb9[_0x203faa];return _0x57eab2;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 99c355c..6b0b5d2 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 _0x253e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x253e,0x95));var _0xe253=function(_0x5a729c,_0x357271){_0x5a729c=_0x5a729c-0x0;var _0x500885=_0x253e[_0x5a729c];return _0x500885;};'use strict';var multer=require(_0xe253('0x0'));var util=require(_0xe253('0x1'));var path=require(_0xe253('0x2'));var timeout=require(_0xe253('0x3'));var express=require(_0xe253('0x4'));var router=express[_0xe253('0x5')]();var fs_extra=require(_0xe253('0x6'));var auth=require(_0xe253('0x7'));var interaction=require(_0xe253('0x8'));var config=require(_0xe253('0x9'));var controller=require(_0xe253('0xa'));router['post']('/',auth[_0xe253('0xb')](),controller[_0xe253('0xc')]);module['exports']=router; \ No newline at end of file +var _0x120a=['./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x53fd2c,_0x133b55){var _0xbb7f18=function(_0x2eea66){while(--_0x2eea66){_0x53fd2c['push'](_0x53fd2c['shift']());}};_0xbb7f18(++_0x133b55);}(_0x120a,0x163));var _0xa120=function(_0x297269,_0x568256){_0x297269=_0x297269-0x0;var _0x4ba584=_0x120a[_0x297269];return _0x4ba584;};'use strict';var multer=require('multer');var util=require(_0xa120('0x0'));var path=require(_0xa120('0x1'));var timeout=require(_0xa120('0x2'));var express=require(_0xa120('0x3'));var router=express[_0xa120('0x4')]();var fs_extra=require(_0xa120('0x5'));var auth=require(_0xa120('0x6'));var interaction=require(_0xa120('0x7'));var config=require(_0xa120('0x8'));var controller=require(_0xa120('0x9'));router[_0xa120('0xa')]('/',auth[_0xa120('0xb')](),controller[_0xa120('0xc')]);module[_0xa120('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index df02bb4..81fa11f 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 _0xc592=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x64cb91,_0x54868b){var _0x15392f=function(_0x26f153){while(--_0x26f153){_0x64cb91['push'](_0x64cb91['shift']());}};_0x15392f(++_0x54868b);}(_0xc592,0x1c6));var _0x2c59=function(_0x2c8c8b,_0x12736e){_0x2c8c8b=_0x2c8c8b-0x0;var _0x566099=_0xc592[_0x2c8c8b];return _0x566099;};'use strict';var Sequelize=require(_0x2c59('0x0'));module[_0x2c59('0x1')]={'body':{'type':Sequelize[_0x2c59('0x2')]},'senderName':{'type':Sequelize[_0x2c59('0x3')]},'recipientsId':{'type':Sequelize[_0x2c59('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x2c59('0x4')]}}; \ No newline at end of file +var _0x2dce=['TEXT','BOOLEAN','sequelize'];(function(_0x4497e4,_0x1ba759){var _0x119708=function(_0x4e15f2){while(--_0x4e15f2){_0x4497e4['push'](_0x4497e4['shift']());}};_0x119708(++_0x1ba759);}(_0x2dce,0x8f));var _0xe2dc=function(_0x5d87bd,_0xdd77c3){_0x5d87bd=_0x5d87bd-0x0;var _0x43eb42=_0x2dce[_0x5d87bd];return _0x43eb42;};'use strict';var Sequelize=require(_0xe2dc('0x0'));module['exports']={'body':{'type':Sequelize[_0xe2dc('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xe2dc('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 01c041c..3eff5f5 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 _0x6f80=['../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','create','forEach','emit','userNotification:send','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','startCase','union','replace','Queue','ids','all','flatten','getAgents','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x31d168,_0x5cfe86){var _0x275fc2=function(_0x3f6808){while(--_0x3f6808){_0x31d168['push'](_0x31d168['shift']());}};_0x275fc2(++_0x5cfe86);}(_0x6f80,0xad));var _0x06f8=function(_0x3c67ad,_0x154414){_0x3c67ad=_0x3c67ad-0x0;var _0x4cc5f=_0x6f80[_0x3c67ad];return _0x4cc5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06f8('0x0'));var zipdir=require(_0x06f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06f8('0x2'));var moment=require('moment');var BPromise=require(_0x06f8('0x3'));var Mustache=require('mustache');var util=require(_0x06f8('0x4'));var path=require(_0x06f8('0x5'));var sox=require(_0x06f8('0x6'));var csv=require(_0x06f8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06f8('0x8'));var _=require(_0x06f8('0x9'));var squel=require(_0x06f8('0xa'));var crypto=require(_0x06f8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x06f8('0xc'));var toCsv=require(_0x06f8('0x7'));var querystring=require(_0x06f8('0xd'));var Papa=require(_0x06f8('0xe'));var Redis=require('ioredis');var authService=require(_0x06f8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x06f8('0x10'));var hardwareService=require(_0x06f8('0x11'));var logger=require(_0x06f8('0x12'))(_0x06f8('0x13'));var utils=require('../../config/utils');var config=require(_0x06f8('0x14'));var licenseUtil=require(_0x06f8('0x15'));var db=require(_0x06f8('0x16'))['db'];config['redis']=_[_0x06f8('0x17')](config[_0x06f8('0x18')],{'host':_0x06f8('0x19'),'port':0x18eb});var socket=require(_0x06f8('0x1a'))(new Redis(config[_0x06f8('0x18')]));require('./userNotification.socket')[_0x06f8('0x1b')](socket);function respondWithStatusCode(_0xbc5571,_0x2a34bb){_0x2a34bb=_0x2a34bb||0xcc;return function(_0x234328){if(_0x234328){return _0xbc5571[_0x06f8('0x1c')](_0x2a34bb);}return _0xbc5571['status'](_0x2a34bb)['end']();};}function respondWithResult(_0x4cc8ab,_0x4f72c7){_0x4f72c7=_0x4f72c7||0xc8;return function(_0x32155b){if(_0x32155b){return _0x4cc8ab[_0x06f8('0x1d')](_0x4f72c7)[_0x06f8('0x1e')](_0x32155b);}};}function respondWithFilteredResult(_0x546911,_0x951654){return function(_0x1eeb06){if(_0x1eeb06){var _0x4dd506=typeof _0x951654['offset']===_0x06f8('0x1f')&&typeof _0x951654['limit']===_0x06f8('0x1f');var _0x28aca1=_0x1eeb06[_0x06f8('0x20')];var _0x1c0c44=_0x4dd506?0x0:_0x951654[_0x06f8('0x21')];var _0x4b9280=_0x4dd506?_0x1eeb06[_0x06f8('0x20')]:_0x951654['offset']+_0x951654[_0x06f8('0x22')];var _0x2d4fe1;if(_0x4b9280>=_0x28aca1){_0x4b9280=_0x28aca1;_0x2d4fe1=0xc8;}else{_0x2d4fe1=0xce;}_0x546911[_0x06f8('0x1d')](_0x2d4fe1);return _0x546911[_0x06f8('0x23')](_0x06f8('0x24'),_0x1c0c44+'-'+_0x4b9280+'/'+_0x28aca1)[_0x06f8('0x1e')](_0x1eeb06);}return null;};}function patchUpdates(_0x2089df){return function(_0x57af79){try{jsonpatch['apply'](_0x57af79,_0x2089df,!![]);}catch(_0x485122){return BPromise[_0x06f8('0x25')](_0x485122);}return _0x57af79[_0x06f8('0x26')]();};}function saveUpdates(_0x2e6ea3,_0x198512){return function(_0x683a6f){if(_0x683a6f){return _0x683a6f[_0x06f8('0x27')](_0x2e6ea3)[_0x06f8('0x28')](function(_0x5b04b2){return _0x5b04b2;});}return null;};}function removeEntity(_0x46259e,_0x389be5){return function(_0x54ffe7){if(_0x54ffe7){return _0x54ffe7[_0x06f8('0x29')]()['then'](function(){_0x46259e[_0x06f8('0x1d')](0xcc)[_0x06f8('0x2a')]();});}};}function handleEntityNotFound(_0x3acfd9,_0x2c0a36){return function(_0x180b4b){if(!_0x180b4b){_0x3acfd9[_0x06f8('0x1c')](0x194);}return _0x180b4b;};}function handleError(_0x2ed701,_0x5eedf9){_0x5eedf9=_0x5eedf9||0x1f4;return function(_0x1ef42c){logger['error'](_0x1ef42c['stack']);if(_0x1ef42c[_0x06f8('0x2b')]){delete _0x1ef42c[_0x06f8('0x2b')];}_0x2ed701[_0x06f8('0x1d')](_0x5eedf9)[_0x06f8('0x2c')](_0x1ef42c);};}exports[_0x06f8('0x2d')]=function(_0x3591e1,_0x6b0d8a,_0x1f6306){if(!_0x3591e1['body'][_0x06f8('0x2e')](_0x06f8('0x2f'))&&!_0x3591e1[_0x06f8('0x30')][_0x06f8('0x2e')](_0x06f8('0x31'))){throw new db['Sequelize'][(_0x06f8('0x32'))](_0x06f8('0x33'));}else{if(_0x3591e1[_0x06f8('0x30')][_0x06f8('0x2e')]('TemplateId')&&!_0x3591e1['body'][_0x06f8('0x2e')](_0x06f8('0x34'))){throw new db[(_0x06f8('0x35'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x3591e1[_0x06f8('0x30')][_0x06f8('0x2e')]('recipients')){throw new db[(_0x06f8('0x35'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5e3044=JSON['parse'](_0x3591e1[_0x06f8('0x30')][_0x06f8('0x36')]);}catch(_0x162aab){logger[_0x06f8('0x37')](_0x162aab);throw new db['Sequelize'][(_0x06f8('0x32'))](_0x06f8('0x38'));}var _0x52395a=[_0x06f8('0x39'),_0x06f8('0x3a'),_0x06f8('0x3b'),_0x06f8('0x3c'),_0x06f8('0x3d'),_0x06f8('0x3e'),_0x06f8('0x3f'),_0x06f8('0x40'),_0x06f8('0x41')];if(_[_0x06f8('0x42')](_0x5e3044,function(_0x36f08b){return!_[_0x06f8('0x43')](_0x52395a,_0x36f08b[_0x06f8('0x44')][_0x06f8('0x45')]());})){throw new db[(_0x06f8('0x35'))][(_0x06f8('0x32'))](_0x06f8('0x46'));}}}var _0x3db3a3={};_0x3db3a3['senderName']=_0x3591e1[_0x06f8('0x30')][_0x06f8('0x2e')](_0x06f8('0x47'))?_0x3591e1[_0x06f8('0x30')]['senderName']:_0x3591e1[_0x06f8('0x41')][_0x06f8('0x48')];_0x3db3a3['recipientsDescription']=_[_0x06f8('0x49')](_0x3591e1[_0x06f8('0x30')][_0x06f8('0x4a')])?null:_0x3591e1[_0x06f8('0x30')]['recipientsDescription'];_0x3db3a3[_0x06f8('0x4b')]=_0x3591e1['body'][_0x06f8('0x4b')]||![];_0x3db3a3[_0x06f8('0x4c')]=_0x3591e1[_0x06f8('0x41')]['id'];return getContent(_0x3591e1[_0x06f8('0x30')])[_0x06f8('0x28')](function(_0xbb2346){_0x3db3a3['body']=_0xbb2346;return getRecipients(_0x5e3044);})[_0x06f8('0x28')](function(_0x1409cc){_0x3db3a3[_0x06f8('0x4d')]=_[_0x06f8('0x4e')](_0x1409cc)[_0x06f8('0x4f')](',');return db[_0x06f8('0x50')]['transaction'](function(_0x1353fe){return db['UserNotification'][_0x06f8('0x51')](_0x3db3a3,{'raw':!![],'transaction':_0x1353fe})['then'](function(_0x16d96b){var _0x30adef={'sender':_0x3db3a3[_0x06f8('0x47')],'description':_0x3db3a3[_0x06f8('0x4a')],'content':_0x3db3a3[_0x06f8('0x30')],'beep':_0x3db3a3[_0x06f8('0x4b')]};_0x1409cc[_0x06f8('0x52')](function(_0x5d55a3){_0x30adef['recipient']=_0x5d55a3;socket[_0x06f8('0x53')](_0x06f8('0x54'),_0x30adef);});return _0x16d96b;});});})[_0x06f8('0x28')](respondWithResult(_0x6b0d8a,0xc9))[_0x06f8('0x55')](handleError(_0x6b0d8a,null));};function getContent(_0x384fd9){return new BPromise(function(_0x1cf63c,_0x50223e){if(_0x384fd9['text']){_0x1cf63c(_0x384fd9['text']);return;}return db['Template'][_0x06f8('0x56')]({'attributes':['html'],'where':{'id':_0x384fd9['TemplateId']},'raw':!![]})[_0x06f8('0x28')](function(_0x2badb0){if(!_0x2badb0)throw new db[(_0x06f8('0x35'))]['ValidationError'](_0x06f8('0x57'));var _0x5394e5=Mustache['render'](_0x2badb0[_0x06f8('0x58')],_0x384fd9[_0x06f8('0x34')]);_0x1cf63c(_0x5394e5);})[_0x06f8('0x55')](function(_0x59fe11){_0x50223e(_0x59fe11);});});}function getRecipients(_0x4feda9){return new BPromise(function(_0x1884ac,_0x4035c8){var _0x4cfc47=[];var _0x235af5=[];_0x4feda9[_0x06f8('0x52')](function(_0x588ff3){var _0x2a9552=_[_0x06f8('0x59')](_0x588ff3[_0x06f8('0x44')][_0x06f8('0x45')]());if(_0x2a9552==='User'){_0x4cfc47=_[_0x06f8('0x5a')](_0x4cfc47,_0x588ff3['ids']);}else{if(_[_0x06f8('0x43')](_0x2a9552,'queue'))_0x2a9552=_0x2a9552[_0x06f8('0x5b')]('queue',_0x06f8('0x5c'));_0x588ff3[_0x06f8('0x5d')]['forEach'](function(_0x2037ba){_0x235af5['push'](getAgents(_0x2a9552,_0x2037ba));});}});return BPromise[_0x06f8('0x5e')](_0x235af5)[_0x06f8('0x28')](function(_0x46cd50){_0x4cfc47=_[_0x06f8('0x5a')](_0x4cfc47,_[_0x06f8('0x5f')](_0x46cd50));_0x1884ac(_0x4cfc47);})[_0x06f8('0x55')](function(_0x527239){_0x4035c8(_0x527239);});});}function getAgents(_0x462b2f,_0x1cc5b2){return new BPromise(function(_0x174388,_0x491aa2){return db[_0x462b2f][_0x06f8('0x56')]({'where':{'id':_0x1cc5b2}})[_0x06f8('0x28')](function(_0x239cb0){return _0x239cb0[_0x06f8('0x60')]({'attributes':['id'],'raw':!![]})[_0x06f8('0x28')](function(_0x2bd7d3){var _0x200e40=_['map'](_0x2bd7d3,'id');_0x174388(_0x200e40);});})['catch'](function(_0x33597b){_0x491aa2(_0x33597b);});});} \ No newline at end of file +var _0x147b=['defaults','redis','localhost','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','model','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','toLowerCase','User','union','ids','includes','queue','replace','Queue','push','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x147b,0x1d3));var _0xb147=function(_0x516044,_0x3677f7){_0x516044=_0x516044-0x0;var _0x31684b=_0x147b[_0x516044];return _0x31684b;};'use strict';var emlformat=require(_0xb147('0x0'));var rimraf=require(_0xb147('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb147('0x2'));var rp=require('request-promise');var moment=require(_0xb147('0x3'));var BPromise=require(_0xb147('0x4'));var Mustache=require('mustache');var util=require(_0xb147('0x5'));var path=require(_0xb147('0x6'));var sox=require(_0xb147('0x7'));var csv=require(_0xb147('0x8'));var ejs=require(_0xb147('0x9'));var fs=require('fs');var fs_extra=require(_0xb147('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb147('0xb'));var deskjs=require(_0xb147('0xc'));var toCsv=require(_0xb147('0x8'));var querystring=require(_0xb147('0xd'));var Papa=require(_0xb147('0xe'));var Redis=require(_0xb147('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb147('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb147('0x11'));var logger=require(_0xb147('0x12'))(_0xb147('0x13'));var utils=require(_0xb147('0x14'));var config=require(_0xb147('0x15'));var licenseUtil=require(_0xb147('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb147('0x17')](config[_0xb147('0x18')],{'host':_0xb147('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb147('0x18')]));require(_0xb147('0x1a'))[_0xb147('0x1b')](socket);function respondWithStatusCode(_0x299c0b,_0x1d1805){_0x1d1805=_0x1d1805||0xcc;return function(_0x34e44c){if(_0x34e44c){return _0x299c0b[_0xb147('0x1c')](_0x1d1805);}return _0x299c0b[_0xb147('0x1d')](_0x1d1805)[_0xb147('0x1e')]();};}function respondWithResult(_0x206561,_0x1b7799){_0x1b7799=_0x1b7799||0xc8;return function(_0x157fa1){if(_0x157fa1){return _0x206561['status'](_0x1b7799)[_0xb147('0x1f')](_0x157fa1);}};}function respondWithFilteredResult(_0x36e909,_0x44d514){return function(_0x3cd817){if(_0x3cd817){var _0x31287b=typeof _0x44d514['offset']===_0xb147('0x20')&&typeof _0x44d514[_0xb147('0x21')]===_0xb147('0x20');var _0x4ac977=_0x3cd817[_0xb147('0x22')];var _0x2125f6=_0x31287b?0x0:_0x44d514[_0xb147('0x23')];var _0x36a8da=_0x31287b?_0x3cd817[_0xb147('0x22')]:_0x44d514['offset']+_0x44d514[_0xb147('0x21')];var _0x422d9a;if(_0x36a8da>=_0x4ac977){_0x36a8da=_0x4ac977;_0x422d9a=0xc8;}else{_0x422d9a=0xce;}_0x36e909[_0xb147('0x1d')](_0x422d9a);return _0x36e909['set']('Content-Range',_0x2125f6+'-'+_0x36a8da+'/'+_0x4ac977)[_0xb147('0x1f')](_0x3cd817);}return null;};}function patchUpdates(_0x46a6e9){return function(_0x101b5a){try{jsonpatch[_0xb147('0x24')](_0x101b5a,_0x46a6e9,!![]);}catch(_0x4bea22){return BPromise[_0xb147('0x25')](_0x4bea22);}return _0x101b5a[_0xb147('0x26')]();};}function saveUpdates(_0x730ca1,_0x200b65){return function(_0xa9d4b1){if(_0xa9d4b1){return _0xa9d4b1[_0xb147('0x27')](_0x730ca1)[_0xb147('0x28')](function(_0x2ef388){return _0x2ef388;});}return null;};}function removeEntity(_0x32b87f,_0xe19012){return function(_0x31405d){if(_0x31405d){return _0x31405d['destroy']()[_0xb147('0x28')](function(){_0x32b87f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a436,_0x223cb7){return function(_0x92c864){if(!_0x92c864){_0x42a436[_0xb147('0x1c')](0x194);}return _0x92c864;};}function handleError(_0x31db85,_0x1f3b7f){_0x1f3b7f=_0x1f3b7f||0x1f4;return function(_0x513c23){logger[_0xb147('0x29')](_0x513c23[_0xb147('0x2a')]);if(_0x513c23[_0xb147('0x2b')]){delete _0x513c23[_0xb147('0x2b')];}_0x31db85[_0xb147('0x1d')](_0x1f3b7f)[_0xb147('0x2c')](_0x513c23);};}exports[_0xb147('0x2d')]=function(_0x54df8d,_0x55e5f6,_0xf6842a){if(!_0x54df8d[_0xb147('0x2e')][_0xb147('0x2f')](_0xb147('0x30'))&&!_0x54df8d[_0xb147('0x2e')][_0xb147('0x2f')](_0xb147('0x31'))){throw new db[(_0xb147('0x32'))][(_0xb147('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x54df8d[_0xb147('0x2e')]['hasOwnProperty'](_0xb147('0x31'))&&!_0x54df8d[_0xb147('0x2e')][_0xb147('0x2f')]('view')){throw new db[(_0xb147('0x32'))][(_0xb147('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x54df8d[_0xb147('0x2e')][_0xb147('0x2f')](_0xb147('0x34'))){throw new db['Sequelize']['ValidationError'](_0xb147('0x35'));}else{try{var _0x47329e=JSON[_0xb147('0x36')](_0x54df8d[_0xb147('0x2e')][_0xb147('0x34')]);}catch(_0x44695f){logger['error'](_0x44695f);throw new db[(_0xb147('0x32'))]['ValidationError'](_0xb147('0x37'));}var _0x543fef=[_0xb147('0x38'),_0xb147('0x39'),_0xb147('0x3a'),_0xb147('0x3b'),'smsqueue',_0xb147('0x3c'),_0xb147('0x3d'),_0xb147('0x3e'),_0xb147('0x3f')];if(_[_0xb147('0x40')](_0x47329e,function(_0x4ce226){return!_['includes'](_0x543fef,_0x4ce226[_0xb147('0x41')]['toLowerCase']());})){throw new db[(_0xb147('0x32'))][(_0xb147('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x29cdc8={};_0x29cdc8[_0xb147('0x42')]=_0x54df8d[_0xb147('0x2e')][_0xb147('0x2f')]('senderName')?_0x54df8d[_0xb147('0x2e')][_0xb147('0x42')]:_0x54df8d[_0xb147('0x3f')][_0xb147('0x43')];_0x29cdc8[_0xb147('0x44')]=_[_0xb147('0x45')](_0x54df8d[_0xb147('0x2e')]['recipientsDescription'])?null:_0x54df8d[_0xb147('0x2e')][_0xb147('0x44')];_0x29cdc8[_0xb147('0x46')]=_0x54df8d['body'][_0xb147('0x46')]||![];_0x29cdc8['SenderId']=_0x54df8d['user']['id'];return getContent(_0x54df8d['body'])[_0xb147('0x28')](function(_0x23c404){_0x29cdc8[_0xb147('0x2e')]=_0x23c404;return getRecipients(_0x47329e);})[_0xb147('0x28')](function(_0x3786a1){_0x29cdc8[_0xb147('0x47')]=_['sortBy'](_0x3786a1)[_0xb147('0x48')](',');return db['sequelize'][_0xb147('0x49')](function(_0x1b31db){return db[_0xb147('0x4a')][_0xb147('0x4b')](_0x29cdc8,{'raw':!![],'transaction':_0x1b31db})[_0xb147('0x28')](function(_0x46b2d4){var _0x889a02={'sender':_0x29cdc8['senderName'],'description':_0x29cdc8[_0xb147('0x44')],'content':_0x29cdc8['body'],'beep':_0x29cdc8[_0xb147('0x46')]};_0x3786a1[_0xb147('0x4c')](function(_0x1fdb0a){_0x889a02[_0xb147('0x4d')]=_0x1fdb0a;socket[_0xb147('0x4e')](_0xb147('0x4f'),_0x889a02);});return _0x46b2d4;});});})[_0xb147('0x28')](respondWithResult(_0x55e5f6,0xc9))[_0xb147('0x50')](handleError(_0x55e5f6,null));};function getContent(_0x5f4ec3){return new BPromise(function(_0x2a70b4,_0x315940){if(_0x5f4ec3[_0xb147('0x30')]){_0x2a70b4(_0x5f4ec3[_0xb147('0x30')]);return;}return db[_0xb147('0x51')][_0xb147('0x52')]({'attributes':[_0xb147('0x53')],'where':{'id':_0x5f4ec3['TemplateId']},'raw':!![]})[_0xb147('0x28')](function(_0x22c44a){if(!_0x22c44a)throw new db[(_0xb147('0x32'))]['ValidationError'](_0xb147('0x54'));var _0x32cbc1=Mustache['render'](_0x22c44a[_0xb147('0x53')],_0x5f4ec3[_0xb147('0x55')]);_0x2a70b4(_0x32cbc1);})[_0xb147('0x50')](function(_0x59b3c0){_0x315940(_0x59b3c0);});});}function getRecipients(_0x2a9321){return new BPromise(function(_0x4faff1,_0x5d43fb){var _0xf2be5d=[];var _0x4ff11f=[];_0x2a9321[_0xb147('0x4c')](function(_0x2826cd){var _0x53bbb5=_['startCase'](_0x2826cd[_0xb147('0x41')][_0xb147('0x56')]());if(_0x53bbb5===_0xb147('0x57')){_0xf2be5d=_[_0xb147('0x58')](_0xf2be5d,_0x2826cd[_0xb147('0x59')]);}else{if(_[_0xb147('0x5a')](_0x53bbb5,_0xb147('0x5b')))_0x53bbb5=_0x53bbb5[_0xb147('0x5c')](_0xb147('0x5b'),_0xb147('0x5d'));_0x2826cd[_0xb147('0x59')][_0xb147('0x4c')](function(_0x12fa03){_0x4ff11f[_0xb147('0x5e')](getAgents(_0x53bbb5,_0x12fa03));});}});return BPromise['all'](_0x4ff11f)[_0xb147('0x28')](function(_0x4b9f9b){_0xf2be5d=_[_0xb147('0x58')](_0xf2be5d,_[_0xb147('0x5f')](_0x4b9f9b));_0x4faff1(_0xf2be5d);})[_0xb147('0x50')](function(_0x469c4c){_0x5d43fb(_0x469c4c);});});}function getAgents(_0x322d30,_0x19456e){return new BPromise(function(_0x2bc484,_0x5853e1){return db[_0x322d30][_0xb147('0x52')]({'where':{'id':_0x19456e}})[_0xb147('0x28')](function(_0x3e354e){return _0x3e354e[_0xb147('0x60')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5d8f14){var _0x10001f=_[_0xb147('0x61')](_0x5d8f14,'id');_0x2bc484(_0x10001f);});})[_0xb147('0x50')](function(_0x300c10){_0x5853e1(_0x300c10);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 8fce783..19f4417 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 _0x33ed=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x7c6867,_0x2cbc64){var _0x21b544=function(_0x544717){while(--_0x544717){_0x7c6867['push'](_0x7c6867['shift']());}};_0x21b544(++_0x2cbc64);}(_0x33ed,0xba));var _0xd33e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x33ed[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require(_0xd33e('0x0'));var UserNotification=require(_0xd33e('0x1'))['db'][_0xd33e('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xd33e('0x3')](0x0);var events={'afterCreate':_0xd33e('0x4'),'afterUpdate':_0xd33e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2837ef){return function(_0x4b911f,_0x709864,_0x4b422b){UserNotificationEvents[_0xd33e('0x6')](_0x2837ef+':'+_0x4b911f['id'],_0x4b911f);UserNotificationEvents['emit'](_0x2837ef,_0x4b911f);_0x4b422b(null);};}for(var e in events){if(events[_0xd33e('0x7')](e)){var event=events[e];UserNotification[_0xd33e('0x8')](e,emitEvent(event));}}module[_0xd33e('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x0967=['events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0x0967,0x1ea));var _0x7096=function(_0x3872e8,_0x519947){_0x3872e8=_0x3872e8-0x0;var _0x1ac47b=_0x0967[_0x3872e8];return _0x1ac47b;};'use strict';var EventEmitter=require(_0x7096('0x0'));var UserNotification=require(_0x7096('0x1'))['db'][_0x7096('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7096('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7096('0x4'),'afterDestroy':_0x7096('0x5')};function emitEvent(_0x375162){return function(_0x56c3e3,_0x46f963,_0x990da1){UserNotificationEvents[_0x7096('0x6')](_0x375162+':'+_0x56c3e3['id'],_0x56c3e3);UserNotificationEvents[_0x7096('0x6')](_0x375162,_0x56c3e3);_0x990da1(null);};}for(var e in events){if(events[_0x7096('0x7')](e)){var event=events[e];UserNotification[_0x7096('0x8')](e,emitEvent(event));}}module[_0x7096('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 4b0ac4f..ea10413 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 _0xf326=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xf326,0xfd));var _0x6f32=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0xf326[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require(_0x6f32('0x0'));var util=require('util');var logger=require(_0x6f32('0x1'))(_0x6f32('0x2'));var moment=require(_0x6f32('0x3'));var BPromise=require(_0x6f32('0x4'));var rp=require(_0x6f32('0x5'));var fs=require('fs');var path=require(_0x6f32('0x6'));var rimraf=require(_0x6f32('0x7'));var config=require(_0x6f32('0x8'));var attributes=require(_0x6f32('0x9'));module[_0x6f32('0xa')]=function(_0x48bbef,_0x4dfdb5){return _0x48bbef[_0x6f32('0xb')](_0x6f32('0xc'),attributes,{'tableName':_0x6f32('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f32('0xe'),'collate':_0x6f32('0xf')});}; \ No newline at end of file +var _0xdde5=['../../config/environment','./userNotification.attributes','exports','UserNotification','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdde5,0x87));var _0x5dde=function(_0x706091,_0x5e07d9){_0x706091=_0x706091-0x0;var _0x4aee6f=_0xdde5[_0x706091];return _0x4aee6f;};'use strict';var _=require(_0x5dde('0x0'));var util=require(_0x5dde('0x1'));var logger=require(_0x5dde('0x2'))('api');var moment=require(_0x5dde('0x3'));var BPromise=require(_0x5dde('0x4'));var rp=require(_0x5dde('0x5'));var fs=require('fs');var path=require(_0x5dde('0x6'));var rimraf=require(_0x5dde('0x7'));var config=require(_0x5dde('0x8'));var attributes=require(_0x5dde('0x9'));module[_0x5dde('0xa')]=function(_0x5d8c18,_0x5c925d){return _0x5d8c18['define'](_0x5dde('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5dde('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 3f03bd0..def9849 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 _0x3da2=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x150727,_0x5b9f1b){var _0x35f412=function(_0x29a9f4){while(--_0x29a9f4){_0x150727['push'](_0x150727['shift']());}};_0x35f412(++_0x5b9f1b);}(_0x3da2,0xb0));var _0x23da=function(_0x530e9b,_0xf96aa8){_0x530e9b=_0x530e9b-0x0;var _0x40a8ba=_0x3da2[_0x530e9b];return _0x40a8ba;};'use strict';var _=require(_0x23da('0x0'));var util=require(_0x23da('0x1'));var moment=require(_0x23da('0x2'));var BPromise=require('bluebird');var rs=require(_0x23da('0x3'));var fs=require('fs');var Redis=require(_0x23da('0x4'));var db=require(_0x23da('0x5'))['db'];var utils=require(_0x23da('0x6'));var logger=require(_0x23da('0x7'))(_0x23da('0x8'));var config=require('../../config/environment');var jayson=require(_0x23da('0x9'));var client=jayson[_0x23da('0xa')]['http']({'port':0x232a});config[_0x23da('0xb')]=_[_0x23da('0xc')](config[_0x23da('0xb')],{'host':_0x23da('0xd'),'port':0x18eb});var socket=require(_0x23da('0xe'))(new Redis(config[_0x23da('0xb')]));require(_0x23da('0xf'))[_0x23da('0x10')](socket);function respondWithRpcPromise(_0x5da45d,_0x33e840,_0x2c4a93){return new BPromise(function(_0x2fa568,_0x298e5a){return client[_0x23da('0x11')](_0x5da45d,_0x2c4a93)[_0x23da('0x12')](function(_0x447498){logger['info'](_0x23da('0x13'),_0x33e840,_0x23da('0x14'));logger[_0x23da('0x15')](_0x23da('0x16'),_0x33e840,_0x23da('0x14'),JSON[_0x23da('0x17')](_0x447498));if(_0x447498['error']){if(_0x447498[_0x23da('0x18')]['code']===0x1f4){logger[_0x23da('0x18')](_0x23da('0x13'),_0x33e840,_0x447498['error'][_0x23da('0x19')]);return _0x298e5a(_0x447498[_0x23da('0x18')][_0x23da('0x19')]);}logger[_0x23da('0x18')]('UserNotification,\x20%s,\x20%s',_0x33e840,_0x447498['error'][_0x23da('0x19')]);return _0x2fa568(_0x447498[_0x23da('0x18')][_0x23da('0x19')]);}else{logger[_0x23da('0x1a')]('UserNotification,\x20%s,\x20%s',_0x33e840,_0x23da('0x14'));_0x2fa568(_0x447498[_0x23da('0x1b')][_0x23da('0x19')]);}})[_0x23da('0x1c')](function(_0x27682c){logger[_0x23da('0x18')](_0x23da('0x13'),_0x33e840,_0x27682c);_0x298e5a(_0x27682c);});});} \ No newline at end of file +var _0x54a8=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x317d92,_0x100dc0){var _0x1e1cc4=function(_0x51bacf){while(--_0x51bacf){_0x317d92['push'](_0x317d92['shift']());}};_0x1e1cc4(++_0x100dc0);}(_0x54a8,0x93));var _0x854a=function(_0x2420c8,_0x59cdcc){_0x2420c8=_0x2420c8-0x0;var _0x46e13d=_0x54a8[_0x2420c8];return _0x46e13d;};'use strict';var _=require(_0x854a('0x0'));var util=require('util');var moment=require(_0x854a('0x1'));var BPromise=require(_0x854a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x854a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x854a('0x4'));var logger=require(_0x854a('0x5'))(_0x854a('0x6'));var config=require('../../config/environment');var jayson=require(_0x854a('0x7'));var client=jayson[_0x854a('0x8')][_0x854a('0x9')]({'port':0x232a});config['redis']=_[_0x854a('0xa')](config[_0x854a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x854a('0xc'))(new Redis(config['redis']));require('./userNotification.socket')[_0x854a('0xd')](socket);function respondWithRpcPromise(_0x52350c,_0x2fcac5,_0x2a06ee){return new BPromise(function(_0x10961d,_0xe4d2a6){return client['request'](_0x52350c,_0x2a06ee)[_0x854a('0xe')](function(_0xb3b4da){logger[_0x854a('0xf')](_0x854a('0x10'),_0x2fcac5,'request\x20sent');logger[_0x854a('0x11')](_0x854a('0x12'),_0x2fcac5,_0x854a('0x13'),JSON[_0x854a('0x14')](_0xb3b4da));if(_0xb3b4da[_0x854a('0x15')]){if(_0xb3b4da['error']['code']===0x1f4){logger[_0x854a('0x15')](_0x854a('0x10'),_0x2fcac5,_0xb3b4da[_0x854a('0x15')][_0x854a('0x16')]);return _0xe4d2a6(_0xb3b4da[_0x854a('0x15')][_0x854a('0x16')]);}logger[_0x854a('0x15')](_0x854a('0x10'),_0x2fcac5,_0xb3b4da[_0x854a('0x15')][_0x854a('0x16')]);return _0x10961d(_0xb3b4da[_0x854a('0x15')][_0x854a('0x16')]);}else{logger['info'](_0x854a('0x10'),_0x2fcac5,_0x854a('0x13'));_0x10961d(_0xb3b4da[_0x854a('0x17')][_0x854a('0x16')]);}})[_0x854a('0x18')](function(_0x41b7b1){logger['error'](_0x854a('0x10'),_0x2fcac5,_0x41b7b1);_0xe4d2a6(_0x41b7b1);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index b568a1a..8918278 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 _0xca14=['length','userNotification:','./userNotification.events','remove','update','emit','removeListener','register'];(function(_0x2320b7,_0x54e1d3){var _0x33b5b8=function(_0x95f64c){while(--_0x95f64c){_0x2320b7['push'](_0x2320b7['shift']());}};_0x33b5b8(++_0x54e1d3);}(_0xca14,0x152));var _0x4ca1=function(_0x129c27,_0x333c44){_0x129c27=_0x129c27-0x0;var _0x5a8017=_0xca14[_0x129c27];return _0x5a8017;};'use strict';var UserNotificationEvents=require(_0x4ca1('0x0'));var events=['save',_0x4ca1('0x1'),_0x4ca1('0x2')];function createListener(_0x1d4037,_0x1b6456){return function(_0x1e4827){_0x1b6456[_0x4ca1('0x3')](_0x1d4037,_0x1e4827);};}function removeListener(_0x3271b3,_0x3ab474){return function(){UserNotificationEvents[_0x4ca1('0x4')](_0x3271b3,_0x3ab474);};}exports[_0x4ca1('0x5')]=function(_0x1ff8e4){for(var _0xdb01e=0x0,_0xca3570=events[_0x4ca1('0x6')];_0xdb01e<_0xca3570;_0xdb01e++){var _0x3fd515=events[_0xdb01e];var _0x35e82b=createListener(_0x4ca1('0x7')+_0x3fd515,_0x1ff8e4);UserNotificationEvents['on'](_0x3fd515,_0x35e82b);}}; \ No newline at end of file +var _0x0540=['removeListener','register','length','userNotification:','./userNotification.events','save','update','emit'];(function(_0xf949af,_0x5eea2c){var _0x1a4ac1=function(_0x319871){while(--_0x319871){_0xf949af['push'](_0xf949af['shift']());}};_0x1a4ac1(++_0x5eea2c);}(_0x0540,0x19c));var _0x0054=function(_0x52f3b2,_0x1fec56){_0x52f3b2=_0x52f3b2-0x0;var _0x2429af=_0x0540[_0x52f3b2];return _0x2429af;};'use strict';var UserNotificationEvents=require(_0x0054('0x0'));var events=[_0x0054('0x1'),'remove',_0x0054('0x2')];function createListener(_0x2f12f5,_0x19b556){return function(_0x1c9536){_0x19b556[_0x0054('0x3')](_0x2f12f5,_0x1c9536);};}function removeListener(_0x3d64aa,_0x4e6593){return function(){UserNotificationEvents[_0x0054('0x4')](_0x3d64aa,_0x4e6593);};}exports[_0x0054('0x5')]=function(_0x5bda78){for(var _0x3a3082=0x0,_0x1a5682=events[_0x0054('0x6')];_0x3a3082<_0x1a5682;_0x3a3082++){var _0x4cfd9e=events[_0x3a3082];var _0x34c4bd=createListener(_0x0054('0x7')+_0x4cfd9e,_0x5bda78);UserNotificationEvents['on'](_0x4cfd9e,_0x34c4bd);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index f457745..0d0dd7f 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x50278a,_0x2a68e0){var _0xda665c=function(_0x1844c6){while(--_0x1844c6){_0x50278a['push'](_0x50278a['shift']());}};_0xda665c(++_0x2a68e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x306baa,_0x21aa19){var _0x35dd59=function(_0x1e49aa){while(--_0x1e49aa){_0x306baa['push'](_0x306baa['shift']());}};_0x35dd59(++_0x21aa19);}(_0xedd9,0xfc));var _0x9edd=function(_0x25ab63,_0x418a66){_0x25ab63=_0x25ab63-0x0;var _0x47e56b=_0xedd9[_0x25ab63];return _0x47e56b;};'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 acc9826..1f5f395 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 _0x2075=['exports','INTEGER'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x2075,0x70));var _0x5207=function(_0x1d1854,_0x4a83b1){_0x1d1854=_0x1d1854-0x0;var _0x5b2acb=_0x2075[_0x1d1854];return _0x5b2acb;};'use strict';var Sequelize=require('sequelize');module[_0x5207('0x0')]={'penalty':{'type':Sequelize[_0x5207('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc102=['exports','sequelize'];(function(_0x18c9f0,_0x4ebc2b){var _0x5a79b3=function(_0x2f6796){while(--_0x2f6796){_0x18c9f0['push'](_0x18c9f0['shift']());}};_0x5a79b3(++_0x4ebc2b);}(_0xc102,0x9d));var _0x2c10=function(_0x72089e,_0x59adab){_0x72089e=_0x72089e-0x0;var _0x4b5529=_0xc102[_0x72089e];return _0x4b5529;};'use strict';var Sequelize=require(_0x2c10('0x0'));module[_0x2c10('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 7203940..395d4c0 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 _0xedd7=['util','../../config/logger','api','moment','bluebird','path','rimraf','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues'];(function(_0x2e1906,_0xa281e9){var _0x3ea10e=function(_0x19749){while(--_0x19749){_0x2e1906['push'](_0x2e1906['shift']());}};_0x3ea10e(++_0xa281e9);}(_0xedd7,0xbe));var _0x7edd=function(_0x517586,_0xc97d01){_0x517586=_0x517586-0x0;var _0x4d7494=_0xedd7[_0x517586];return _0x4d7494;};'use strict';var _=require('lodash');var util=require(_0x7edd('0x0'));var logger=require(_0x7edd('0x1'))(_0x7edd('0x2'));var moment=require(_0x7edd('0x3'));var BPromise=require(_0x7edd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7edd('0x5'));var rimraf=require(_0x7edd('0x6'));var config=require('../../config/environment');var attributes=require(_0x7edd('0x7'));module[_0x7edd('0x8')]=function(_0x2205d6,_0x515710){return _0x2205d6['define']('UserOpenchannelQueue',attributes,{'tableName':_0x7edd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x585b=['moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x585b,0xe0));var _0xb585=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x585b[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xb585('0x0'));var util=require(_0xb585('0x1'));var logger=require(_0xb585('0x2'))(_0xb585('0x3'));var moment=require(_0xb585('0x4'));var BPromise=require(_0xb585('0x5'));var rp=require(_0xb585('0x6'));var fs=require('fs');var path=require(_0xb585('0x7'));var rimraf=require('rimraf');var config=require(_0xb585('0x8'));var attributes=require(_0xb585('0x9'));module['exports']=function(_0x2b8888,_0x3f967e){return _0x2b8888['define'](_0xb585('0xa'),attributes,{'tableName':_0xb585('0xb'),'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 7801307..1910b02 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 _0x3db5=['result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x24849b,_0x545e39){var _0x1f9e8a=function(_0x37257c){while(--_0x37257c){_0x24849b['push'](_0x24849b['shift']());}};_0x1f9e8a(++_0x545e39);}(_0x3db5,0x1cf));var _0x53db=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x3db5[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53db('0x0'));var BPromise=require('bluebird');var rs=require(_0x53db('0x1'));var fs=require('fs');var Redis=require(_0x53db('0x2'));var db=require(_0x53db('0x3'))['db'];var utils=require(_0x53db('0x4'));var logger=require(_0x53db('0x5'))('rpc');var config=require(_0x53db('0x6'));var jayson=require(_0x53db('0x7'));var client=jayson['client'][_0x53db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x90793e,_0x86ae8d,_0x4ca62b){return new BPromise(function(_0x434420,_0x51b0df){return client[_0x53db('0x9')](_0x90793e,_0x4ca62b)[_0x53db('0xa')](function(_0x44b6ff){logger[_0x53db('0xb')](_0x53db('0xc'),_0x86ae8d,_0x53db('0xd'));logger[_0x53db('0xe')](_0x53db('0xf'),_0x86ae8d,_0x53db('0xd'),JSON[_0x53db('0x10')](_0x44b6ff));if(_0x44b6ff['error']){if(_0x44b6ff[_0x53db('0x11')][_0x53db('0x12')]===0x1f4){logger['error'](_0x53db('0xc'),_0x86ae8d,_0x44b6ff[_0x53db('0x11')][_0x53db('0x13')]);return _0x51b0df(_0x44b6ff['error'][_0x53db('0x13')]);}logger[_0x53db('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x86ae8d,_0x44b6ff[_0x53db('0x11')][_0x53db('0x13')]);return _0x434420(_0x44b6ff[_0x53db('0x11')][_0x53db('0x13')]);}else{logger[_0x53db('0xb')](_0x53db('0xc'),_0x86ae8d,'request\x20sent');_0x434420(_0x44b6ff[_0x53db('0x14')][_0x53db('0x13')]);}})['catch'](function(_0x13ff04){logger[_0x53db('0x11')](_0x53db('0xc'),_0x86ae8d,_0x13ff04);_0x51b0df(_0x13ff04);});});} \ No newline at end of file +var _0xb45d=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then'];(function(_0x5d9a56,_0x36386b){var _0x212757=function(_0x22d74d){while(--_0x22d74d){_0x5d9a56['push'](_0x5d9a56['shift']());}};_0x212757(++_0x36386b);}(_0xb45d,0x13a));var _0xdb45=function(_0x44c974,_0x1bcfde){_0x44c974=_0x44c974-0x0;var _0x5214c6=_0xb45d[_0x44c974];return _0x5214c6;};'use strict';var _=require(_0xdb45('0x0'));var util=require(_0xdb45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb45('0x2'));var db=require(_0xdb45('0x3'))['db'];var utils=require(_0xdb45('0x4'));var logger=require(_0xdb45('0x5'))('rpc');var config=require(_0xdb45('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33bd00,_0x59e9ea,_0x599fad){return new BPromise(function(_0x3745a6,_0x58baac){return client[_0xdb45('0x7')](_0x33bd00,_0x599fad)[_0xdb45('0x8')](function(_0x5eee0b){logger[_0xdb45('0x9')](_0xdb45('0xa'),_0x59e9ea,_0xdb45('0xb'));logger[_0xdb45('0xc')](_0xdb45('0xd'),_0x59e9ea,_0xdb45('0xb'),JSON[_0xdb45('0xe')](_0x5eee0b));if(_0x5eee0b[_0xdb45('0xf')]){if(_0x5eee0b[_0xdb45('0xf')]['code']===0x1f4){logger[_0xdb45('0xf')](_0xdb45('0xa'),_0x59e9ea,_0x5eee0b[_0xdb45('0xf')][_0xdb45('0x10')]);return _0x58baac(_0x5eee0b[_0xdb45('0xf')]['message']);}logger[_0xdb45('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x59e9ea,_0x5eee0b[_0xdb45('0xf')][_0xdb45('0x10')]);return _0x3745a6(_0x5eee0b[_0xdb45('0xf')][_0xdb45('0x10')]);}else{logger[_0xdb45('0x9')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x59e9ea,_0xdb45('0xb'));_0x3745a6(_0x5eee0b[_0xdb45('0x11')][_0xdb45('0x10')]);}})[_0xdb45('0x12')](function(_0x473e79){logger[_0xdb45('0xf')](_0xdb45('0xa'),_0x59e9ea,_0x473e79);_0x58baac(_0x473e79);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6cb4afe..8350d29 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 _0xa6b8=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','delete','destroy','removeSections'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa6b8,0xc1));var _0x8a6b=function(_0x1dabc3,_0x48377c){_0x1dabc3=_0x1dabc3-0x0;var _0x328c2f=_0xa6b8[_0x1dabc3];return _0x328c2f;};'use strict';var multer=require(_0x8a6b('0x0'));var util=require(_0x8a6b('0x1'));var path=require(_0x8a6b('0x2'));var timeout=require(_0x8a6b('0x3'));var express=require(_0x8a6b('0x4'));var router=express[_0x8a6b('0x5')]();var fs_extra=require(_0x8a6b('0x6'));var auth=require(_0x8a6b('0x7'));var interaction=require(_0x8a6b('0x8'));var config=require(_0x8a6b('0x9'));var controller=require(_0x8a6b('0xa'));router[_0x8a6b('0xb')]('/',auth[_0x8a6b('0xc')](),controller[_0x8a6b('0xd')]);router[_0x8a6b('0xb')](_0x8a6b('0xe'),auth[_0x8a6b('0xc')](),controller[_0x8a6b('0xf')]);router[_0x8a6b('0xb')](_0x8a6b('0x10'),auth[_0x8a6b('0xc')](),controller[_0x8a6b('0x11')]);router[_0x8a6b('0xb')](_0x8a6b('0x12'),auth[_0x8a6b('0xc')](),controller[_0x8a6b('0x13')]);router[_0x8a6b('0xb')](_0x8a6b('0x14'),auth[_0x8a6b('0xc')](),controller[_0x8a6b('0x15')]);router[_0x8a6b('0x16')]('/',auth[_0x8a6b('0xc')](),controller[_0x8a6b('0x17')]);router[_0x8a6b('0x16')](_0x8a6b('0x18'),auth['isAuthenticated'](),controller[_0x8a6b('0x19')]);router[_0x8a6b('0x16')]('/:id/sections',auth['isAuthenticated'](),controller[_0x8a6b('0x1a')]);router[_0x8a6b('0x16')]('/:id/resources',auth['isAuthenticated'](),controller[_0x8a6b('0x1b')]);router['put'](_0x8a6b('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x8a6b('0x1c')](_0x8a6b('0x10'),auth[_0x8a6b('0xc')](),controller[_0x8a6b('0x1d')]);router[_0x8a6b('0x1c')]('/:id/sections',auth[_0x8a6b('0xc')](),controller[_0x8a6b('0x1e')]);router[_0x8a6b('0x1c')](_0x8a6b('0x14'),auth[_0x8a6b('0xc')](),controller['removeResources']);module[_0x8a6b('0x1f')]=router; \ No newline at end of file +var _0x222a=['/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x170929,_0x4e54d7){var _0x19b007=function(_0xc541df){while(--_0xc541df){_0x170929['push'](_0x170929['shift']());}};_0x19b007(++_0x4e54d7);}(_0x222a,0x1e3));var _0xa222=function(_0xe3afce,_0x5c86a3){_0xe3afce=_0xe3afce-0x0;var _0x287aac=_0x222a[_0xe3afce];return _0x287aac;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa222('0x0'));var express=require('express');var router=express[_0xa222('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xa222('0x2'));var interaction=require(_0xa222('0x3'));var config=require(_0xa222('0x4'));var controller=require('./userProfile.controller');router[_0xa222('0x5')]('/',auth[_0xa222('0x6')](),controller[_0xa222('0x7')]);router[_0xa222('0x5')](_0xa222('0x8'),auth['isAuthenticated'](),controller[_0xa222('0x9')]);router[_0xa222('0x5')](_0xa222('0xa'),auth[_0xa222('0x6')](),controller['show']);router[_0xa222('0x5')](_0xa222('0xb'),auth[_0xa222('0x6')](),controller[_0xa222('0xc')]);router['get'](_0xa222('0xd'),auth[_0xa222('0x6')](),controller[_0xa222('0xe')]);router['post']('/',auth[_0xa222('0x6')](),controller['create']);router[_0xa222('0xf')](_0xa222('0x10'),auth[_0xa222('0x6')](),controller[_0xa222('0x11')]);router[_0xa222('0xf')](_0xa222('0xb'),auth['isAuthenticated'](),controller[_0xa222('0x12')]);router['post']('/:id/resources',auth[_0xa222('0x6')](),controller[_0xa222('0x13')]);router[_0xa222('0x14')](_0xa222('0xa'),auth[_0xa222('0x6')](),controller[_0xa222('0x15')]);router[_0xa222('0x16')](_0xa222('0xa'),auth[_0xa222('0x6')](),controller[_0xa222('0x17')]);router[_0xa222('0x16')]('/:id/sections',auth[_0xa222('0x6')](),controller[_0xa222('0x18')]);router[_0xa222('0x16')](_0xa222('0xd'),auth[_0xa222('0x6')](),controller['removeResources']);module[_0xa222('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 5ea18d6..8346584 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 _0x01a8=['getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue','crudPermissions'];(function(_0x2b656b,_0x532c4e){var _0xdfac58=function(_0x1f0d57){while(--_0x1f0d57){_0x2b656b['push'](_0x2b656b['shift']());}};_0xdfac58(++_0x532c4e);}(_0x01a8,0x1a0));var _0x801a=function(_0x5ccb84,_0x2d7bf9){_0x5ccb84=_0x5ccb84-0x0;var _0x2ac365=_0x01a8[_0x5ccb84];return _0x2ac365;};'use strict';var Sequelize=require(_0x801a('0x0'));module['exports']={'name':{'type':Sequelize[_0x801a('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x801a('0x1')],'set':function(_0x39d787){this[_0x801a('0x2')](_0x801a('0x3'),_0x39d787?_0x39d787['join'](''):[]);},'get':function(){return this['getDataValue'](_0x801a('0x3'))?this[_0x801a('0x4')]('crudPermissions')[_0x801a('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x801a('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x801a('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x801a('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x801a('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x696d=['split','BOOLEAN','sequelize','exports','STRING','setDataValue','join','getDataValue','crudPermissions'];(function(_0x367001,_0x353313){var _0x5b6e54=function(_0x55ca91){while(--_0x55ca91){_0x367001['push'](_0x367001['shift']());}};_0x5b6e54(++_0x353313);}(_0x696d,0x1cd));var _0xd696=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x696d[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xd696('0x0'));module[_0xd696('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xd696('0x2')],'set':function(_0x465beb){this[_0xd696('0x3')]('crudPermissions',_0x465beb?_0x465beb[_0xd696('0x4')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xd696('0x5')](_0xd696('0x6'))[_0xd696('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd696('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd696('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd696('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd696('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd696('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index eb42f1b..56ae8b1 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 _0xd05a=['path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','UserProfileResource','findAll','userProfileId','UserProfileSection','Resources','describe','sequelize','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','mustache','util'];(function(_0x183fd4,_0x54ffa3){var _0x293d1b=function(_0x14458b){while(--_0x14458b){_0x183fd4['push'](_0x183fd4['shift']());}};_0x293d1b(++_0x54ffa3);}(_0xd05a,0x143));var _0xad05=function(_0x517381,_0x2ea90e){_0x517381=_0x517381-0x0;var _0x12c9c1=_0xd05a[_0x517381];return _0x12c9c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad05('0x0'));var zipdir=require(_0xad05('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad05('0x2'));var util=require(_0xad05('0x3'));var path=require(_0xad05('0x4'));var sox=require(_0xad05('0x5'));var csv=require(_0xad05('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad05('0x7'));var squel=require(_0xad05('0x8'));var crypto=require(_0xad05('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad05('0xa'));var toCsv=require(_0xad05('0x6'));var querystring=require(_0xad05('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xad05('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xad05('0xd'));var hardwareService=require(_0xad05('0xe'));var logger=require(_0xad05('0xf'))(_0xad05('0x10'));var utils=require(_0xad05('0x11'));var config=require(_0xad05('0x12'));var licenseUtil=require(_0xad05('0x13'));var db=require(_0xad05('0x14'))['db'];config[_0xad05('0x15')]=_[_0xad05('0x16')](config['redis'],{'host':_0xad05('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad05('0x15')]));require('./userProfile.socket')[_0xad05('0x18')](socket);function respondWithStatusCode(_0x24da60,_0x44a508){_0x44a508=_0x44a508||0xcc;return function(_0x50609d){if(_0x50609d){return _0x24da60[_0xad05('0x19')](_0x44a508);}return _0x24da60['status'](_0x44a508)[_0xad05('0x1a')]();};}function respondWithResult(_0x2bf8e9,_0x29c296){_0x29c296=_0x29c296||0xc8;return function(_0x3d7eda){if(_0x3d7eda){return _0x2bf8e9[_0xad05('0x1b')](_0x29c296)[_0xad05('0x1c')](_0x3d7eda);}};}function respondWithFilteredResult(_0x534b28,_0x30d013){return function(_0x6c363b){if(_0x6c363b){var _0x9dc4d3=typeof _0x30d013[_0xad05('0x1d')]===_0xad05('0x1e')&&typeof _0x30d013[_0xad05('0x1f')]===_0xad05('0x1e');var _0x4578af=_0x6c363b[_0xad05('0x20')];var _0x2a7e2f=_0x9dc4d3?0x0:_0x30d013[_0xad05('0x1d')];var _0x530ce3=_0x9dc4d3?_0x6c363b[_0xad05('0x20')]:_0x30d013[_0xad05('0x1d')]+_0x30d013[_0xad05('0x1f')];var _0x5e6354;if(_0x530ce3>=_0x4578af){_0x530ce3=_0x4578af;_0x5e6354=0xc8;}else{_0x5e6354=0xce;}_0x534b28[_0xad05('0x1b')](_0x5e6354);return _0x534b28['set'](_0xad05('0x21'),_0x2a7e2f+'-'+_0x530ce3+'/'+_0x4578af)[_0xad05('0x1c')](_0x6c363b);}return null;};}function patchUpdates(_0x46a3be){return function(_0x37ddb5){try{jsonpatch[_0xad05('0x22')](_0x37ddb5,_0x46a3be,!![]);}catch(_0x1fdc81){return BPromise[_0xad05('0x23')](_0x1fdc81);}return _0x37ddb5[_0xad05('0x24')]();};}function saveUpdates(_0x33c97e,_0x422698){return function(_0x545637){if(_0x545637){return _0x545637[_0xad05('0x25')](_0x33c97e)[_0xad05('0x26')](function(_0x2a4620){return _0x2a4620;});}return null;};}function removeEntity(_0x2b515d,_0x48d25f){return function(_0x391bf0){if(_0x391bf0){return _0x391bf0[_0xad05('0x27')]()[_0xad05('0x26')](function(){_0x2b515d[_0xad05('0x1b')](0xcc)[_0xad05('0x1a')]();});}};}function handleEntityNotFound(_0x206abc,_0x44d8d4){return function(_0x5c04f3){if(!_0x5c04f3){_0x206abc['sendStatus'](0x194);}return _0x5c04f3;};}function handleError(_0x264287,_0x32953a){_0x32953a=_0x32953a||0x1f4;return function(_0x91ed1d){logger['error'](_0x91ed1d['stack']);if(_0x91ed1d[_0xad05('0x28')]){delete _0x91ed1d[_0xad05('0x28')];}_0x264287[_0xad05('0x1b')](_0x32953a)['send'](_0x91ed1d);};}exports[_0xad05('0x29')]=function(_0xcfea8c,_0x594ea3){var _0x206a17={},_0x19b9f1={},_0x203158={'count':0x0,'rows':[]};var _0x36face=_[_0xad05('0x2a')](db[_0xad05('0x2b')][_0xad05('0x2c')],function(_0x5ea097){return{'name':_0x5ea097[_0xad05('0x2d')],'type':_0x5ea097[_0xad05('0x2e')]['key']};});_0x19b9f1[_0xad05('0x2f')]=_[_0xad05('0x2a')](_0x36face,'name');_0x19b9f1[_0xad05('0x30')]=_[_0xad05('0x31')](_0xcfea8c[_0xad05('0x30')]);_0x19b9f1[_0xad05('0x32')]=_[_0xad05('0x33')](_0x19b9f1[_0xad05('0x2f')],_0x19b9f1[_0xad05('0x30')]);_0x206a17[_0xad05('0x34')]=_[_0xad05('0x33')](_0x19b9f1[_0xad05('0x2f')],qs[_0xad05('0x35')](_0xcfea8c['query']['fields']));_0x206a17['attributes']=_0x206a17['attributes'][_0xad05('0x36')]?_0x206a17[_0xad05('0x34')]:_0x19b9f1[_0xad05('0x2f')];if(!_0xcfea8c[_0xad05('0x30')]['hasOwnProperty'](_0xad05('0x37'))){_0x206a17[_0xad05('0x1f')]=qs[_0xad05('0x1f')](_0xcfea8c[_0xad05('0x30')]['limit']);_0x206a17[_0xad05('0x1d')]=qs['offset'](_0xcfea8c[_0xad05('0x30')][_0xad05('0x1d')]);}_0x206a17[_0xad05('0x38')]=qs['sort'](_0xcfea8c[_0xad05('0x30')][_0xad05('0x39')]);_0x206a17[_0xad05('0x3a')]=qs[_0xad05('0x32')](_[_0xad05('0x3b')](_0xcfea8c[_0xad05('0x30')],_0x19b9f1[_0xad05('0x32')]),_0x36face);if(_0xcfea8c[_0xad05('0x30')]['filter']){_0x206a17[_0xad05('0x3a')]=_[_0xad05('0x3c')](_0x206a17[_0xad05('0x3a')],{'$or':_[_0xad05('0x2a')](_0x36face,function(_0x4655cb){if(_0x4655cb[_0xad05('0x2e')]!==_0xad05('0x3d')){var _0x1ccfde={};_0x1ccfde[_0x4655cb[_0xad05('0x28')]]={'$like':'%'+_0xcfea8c['query'][_0xad05('0x3e')]+'%'};return _0x1ccfde;}})});}_0x206a17=_[_0xad05('0x3c')]({},_0x206a17,_0xcfea8c[_0xad05('0x3f')]);var _0x26bd70={'where':_0x206a17[_0xad05('0x3a')]};return db[_0xad05('0x2b')][_0xad05('0x20')](_0x26bd70)[_0xad05('0x26')](function(_0x4cfcf0){_0x203158[_0xad05('0x20')]=_0x4cfcf0;if(_0xcfea8c[_0xad05('0x30')]['includeAll']){_0x206a17[_0xad05('0x40')]=[{'all':!![]}];}return db[_0xad05('0x2b')]['findAll'](_0x206a17);})[_0xad05('0x26')](function(_0x21007b){_0x203158[_0xad05('0x41')]=_0x21007b;return _0x203158;})['then'](respondWithFilteredResult(_0x594ea3,_0x206a17))[_0xad05('0x42')](handleError(_0x594ea3,null));};exports[_0xad05('0x43')]=function(_0x14fc94,_0x41fbd0){var _0x513ecb={'raw':![],'where':{'id':_0x14fc94[_0xad05('0x44')]['id']}},_0x26c338={};_0x26c338[_0xad05('0x2f')]=_[_0xad05('0x31')](db[_0xad05('0x2b')]['rawAttributes']);_0x26c338[_0xad05('0x30')]=_[_0xad05('0x31')](_0x14fc94[_0xad05('0x30')]);_0x26c338['filters']=_[_0xad05('0x33')](_0x26c338[_0xad05('0x2f')],_0x26c338[_0xad05('0x30')]);_0x513ecb[_0xad05('0x34')]=_[_0xad05('0x33')](_0x26c338[_0xad05('0x2f')],qs[_0xad05('0x35')](_0x14fc94['query'][_0xad05('0x35')]));_0x513ecb['attributes']=_0x513ecb[_0xad05('0x34')][_0xad05('0x36')]?_0x513ecb[_0xad05('0x34')]:_0x26c338[_0xad05('0x2f')];if(_0x14fc94[_0xad05('0x30')][_0xad05('0x45')]){_0x513ecb[_0xad05('0x40')]=[{'all':!![]}];}_0x513ecb=_[_0xad05('0x3c')]({},_0x513ecb,_0x14fc94[_0xad05('0x3f')]);return db[_0xad05('0x2b')][_0xad05('0x46')](_0x513ecb)[_0xad05('0x26')](handleEntityNotFound(_0x41fbd0,null))[_0xad05('0x26')](respondWithResult(_0x41fbd0,null))[_0xad05('0x42')](handleError(_0x41fbd0,null));};exports[_0xad05('0x47')]=function(_0x56d036,_0x3e61a4){return db[_0xad05('0x2b')][_0xad05('0x47')](_0x56d036[_0xad05('0x48')],{})[_0xad05('0x26')](respondWithResult(_0x3e61a4,0xc9))['catch'](handleError(_0x3e61a4,null));};exports[_0xad05('0x49')]=function(_0x540a4f,_0x5b7d80){var _0x2164e7={'where':{'id':_0x540a4f[_0xad05('0x44')]['id']}},_0x4ceb17={};_0x4ceb17['model']=_['keys'](db['UserProfile'][_0xad05('0x2c')]);_0x2164e7['attributes']=_[_0xad05('0x33')](_0x4ceb17[_0xad05('0x2f')],qs[_0xad05('0x35')](_0x540a4f['query'][_0xad05('0x35')]));_0x2164e7[_0xad05('0x34')]=_0x2164e7['attributes'][_0xad05('0x36')]?_0x2164e7[_0xad05('0x34')]:_0x4ceb17['model'];if(_0x540a4f[_0xad05('0x30')]['includeAll']){_0x2164e7['include']=[{'all':!![]}];}_0x2164e7=_[_0xad05('0x3c')]({},_0x2164e7,_0x540a4f[_0xad05('0x3f')]);return db[_0xad05('0x2b')][_0xad05('0x46')](_0x2164e7)[_0xad05('0x26')](handleEntityNotFound(_0x5b7d80,null))[_0xad05('0x26')](function(_0x1cc306){if(_0x1cc306){var _0x21883b=_0x1cc306[_0xad05('0x4a')]({'plain':!![]});_0x21883b=qs[_0xad05('0x4b')](_0x21883b,['id',_0xad05('0x4c'),_0xad05('0x4d'),_0xad05('0x4e')]);_0x540a4f['body']=_[_0xad05('0x4b')](_0x540a4f[_0xad05('0x48')],['id','createdAt',_0xad05('0x4d')]);return db['sequelize'][_0xad05('0x4f')](function(_0xd4d00f){return db[_0xad05('0x2b')][_0xad05('0x47')](_[_0xad05('0x3c')](_0x21883b,_0x540a4f['body']),{'include':_0x540a4f['query'][_0xad05('0x45')]?[{'all':!![]}]:undefined,'transaction':_0xd4d00f})[_0xad05('0x26')](function(_0x4fcdd5){var _0x2604f1=_0x4fcdd5[_0xad05('0x4a')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x540a4f[_0xad05('0x44')]['id']},'raw':!![]})[_0xad05('0x26')](function(_0x59c8c5){if(_0x59c8c5){return BPromise[_0xad05('0x50')](_0x59c8c5,function(_0x670d2d){return new BPromise(function(_0x1e10e8,_0x49c73a){if(_0x670d2d[_0xad05('0x51')]===null||_0x670d2d[_0xad05('0x51')]===0x1)_0x1e10e8(null);return db[_0xad05('0x52')][_0xad05('0x53')]({'where':{'sectionId':_0x670d2d['id']},'raw':!![]})[_0xad05('0x26')](function(_0x39ea3f){var _0x350e6f=_[_0xad05('0x2a')](_0x39ea3f,function(_0x44f659){return qs[_0xad05('0x4b')](_0x44f659,['id',_0xad05('0x4c'),_0xad05('0x4d'),'sectionId']);});_0x1e10e8(_0x350e6f);})[_0xad05('0x42')](function(_0x4b4907){_0x49c73a(_0x4b4907);});})[_0xad05('0x26')](function(_0x2f80da){var _0x251256=qs[_0xad05('0x4b')](_0x670d2d,['id',_0xad05('0x4c'),_0xad05('0x4d')]);_0x251256[_0xad05('0x54')]=_0x2604f1['id'];if(_0x2f80da)_0x251256['Resources']=_0x2f80da;return _0x251256;})[_0xad05('0x26')](function(_0x5071ed){return db[_0xad05('0x55')][_0xad05('0x47')](_0x5071ed,{'include':[{'model':db['UserProfileResource'],'as':_0xad05('0x56')}],'raw':!![],'transaction':_0xd4d00f});});})[_0xad05('0x26')](function(){return _0x2604f1;});}});});});}})[_0xad05('0x26')](respondWithResult(_0x5b7d80,0xc9))['catch'](handleError(_0x5b7d80,null));};exports[_0xad05('0x25')]=function(_0x292c9b,_0x3d4ce9){if(_0x292c9b['body']['id']){delete _0x292c9b[_0xad05('0x48')]['id'];}return db['UserProfile'][_0xad05('0x46')]({'where':{'id':_0x292c9b[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x3d4ce9,null))['then'](saveUpdates(_0x292c9b[_0xad05('0x48')],null))['then'](respondWithResult(_0x3d4ce9,null))[_0xad05('0x42')](handleError(_0x3d4ce9,null));};exports[_0xad05('0x27')]=function(_0x3fe887,_0x2ac74a){return db['UserProfile'][_0xad05('0x46')]({'where':{'id':_0x3fe887[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x2ac74a,null))[_0xad05('0x26')](removeEntity(_0x2ac74a,null))['catch'](handleError(_0x2ac74a,null));};exports[_0xad05('0x57')]=function(_0x3df464,_0x4f6e91){return db['UserProfile']['describe']()[_0xad05('0x26')](respondWithResult(_0x4f6e91,null))['catch'](handleError(_0x4f6e91,null));};exports['addSections']=function(_0x51f805,_0x5abf6b){var _0x278d1e=_0x51f805['body'];return db[_0xad05('0x2b')]['find']({'where':{'id':_0x51f805[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x5abf6b,null))['then'](function(_0x2d1d83){if(_0x2d1d83){return db[_0xad05('0x58')][_0xad05('0x4f')](function(_0x1b1508){return db[_0xad05('0x55')][_0xad05('0x27')]({'where':{'userProfileId':_0x51f805['params']['id'],'sectionId':_[_0xad05('0x2a')](_0x278d1e,function(_0x3fd5b0){return _0x3fd5b0[_0xad05('0x59')];})},'transaction':_0x1b1508})['then'](function(){var _0x29a0f4=_['map'](_0x278d1e,function(_0x5b5a13){_0x5b5a13[_0xad05('0x54')]=_0x51f805[_0xad05('0x44')]['id'];return _0x5b5a13;});var _0x1786b4=[];return BPromise[_0xad05('0x50')](_0x29a0f4,function(_0x3200a9){return db[_0xad05('0x55')][_0xad05('0x47')](_0x3200a9,{'include':[{'model':db[_0xad05('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x1b1508})[_0xad05('0x26')](function(_0x4f1117){_0x1786b4[_0xad05('0x5a')](_0x4f1117[_0xad05('0x4a')]({'plain':!![]}));});})[_0xad05('0x26')](function(){return _0x1786b4;});});});}})[_0xad05('0x26')](function(_0xfdec36){return _0xfdec36;})[_0xad05('0x26')](respondWithResult(_0x5abf6b,null))[_0xad05('0x42')](handleError(_0x5abf6b,null));};exports[_0xad05('0x5b')]=function(_0xb79167,_0x5814e9){var _0x47680d;return db[_0xad05('0x2b')]['find']({'where':{'id':_0xb79167[_0xad05('0x44')]['id']},'attributes':['id',_0xad05('0x28')]})[_0xad05('0x26')](handleEntityNotFound(_0x5814e9,null))[_0xad05('0x26')](function(_0x35e985){if(_0x35e985){_0x47680d=_0x35e985;return db[_0xad05('0x55')][_0xad05('0x27')]({'where':{'userProfileId':_0xb79167['params']['id'],'sectionId':_0xb79167[_0xad05('0x30')][_0xad05('0x5c')]}});}})[_0xad05('0x26')](function(){return _0x47680d;})[_0xad05('0x26')](respondWithStatusCode(_0x5814e9,null))[_0xad05('0x42')](handleError(_0x5814e9,null));};exports[_0xad05('0x5d')]=function(_0x17b4e1,_0x4410c6){var _0x233870=[];var _0x39d656=[];return db[_0xad05('0x55')][_0xad05('0x53')]({'where':{'userProfileId':_0x17b4e1[_0xad05('0x44')]['id']},'raw':!![]})[_0xad05('0x26')](function(_0x318c5d){_0x233870=_[_0xad05('0x3e')](_0x318c5d,function(_0x5e117e){return _0x5e117e[_0xad05('0x5e')]===0x1||_[_0xad05('0x5f')]([0x3eb,0x709],_0x5e117e[_0xad05('0x59')]);});if(!_[_0xad05('0x60')](_0x233870)){return _[_0xad05('0x2a')](_0x233870,function(_0x19086f){return _0x19086f['sectionId'];});}else{return;}})[_0xad05('0x26')](function(_0x4152c2){if(_0x4152c2)_0x39d656=_0x4152c2;if(_[_0xad05('0x5f')](_0x39d656,0x64)){var _0x2682dc=_[_0xad05('0x46')](_0x233870,{'sectionId':0x64});return hasDefaultDashboard(_0x2682dc)[_0xad05('0x26')](function(_0xdd7134){return _[_0xad05('0x2a')](_0x233870,function(_0xd95d11){if(_0xd95d11[_0xad05('0x59')]===0x64){_0xd95d11[_0xad05('0x61')]=_0xdd7134;}return _0xd95d11;});});}else{return;}})['then'](function(_0x26bd2c){if(_0x26bd2c)_0x233870=_0x26bd2c;if(_[_0xad05('0x5f')](_0x39d656,0x3eb)){var _0x82dd58=_['find'](_0x233870,{'sectionId':0x3eb});return getCustomDashboards(_0x82dd58)[_0xad05('0x26')](function(_0x290a89){return _[_0xad05('0x2a')](_0x233870,function(_0x191b77){if(_0x82dd58['enabled']){if(_0x191b77[_0xad05('0x59')]===0x3eb){_0x191b77[_0xad05('0x61')]=_0x290a89;}}else{if(_0x191b77[_0xad05('0x59')]===0x64){_0x191b77[_0xad05('0x61')]=_0x290a89;}}return _0x191b77;});});}else{return;}})[_0xad05('0x26')](function(_0x2ac7fa){if(_0x2ac7fa)_0x233870=_0x2ac7fa;if(_[_0xad05('0x5f')](_0x39d656,0x709)){var _0x18fff1=_[_0xad05('0x46')](_0x233870,{'sectionId':0x709});return getPlugins(_0x18fff1)[_0xad05('0x26')](function(_0x374226){if(_0x18fff1[_0xad05('0x5e')]){return _['map'](_0x233870,function(_0x2fd57f){if(_0x2fd57f['sectionId']===0x709){_0x2fd57f[_0xad05('0x61')]=_0x374226;}return _0x2fd57f;});}else{var _0x68f303={'sectionId':0x76c,'enabled':0x1,'subsections':_0x374226};var _0x5d9ad3=_[_0xad05('0x2a')](_0x233870);_0x5d9ad3[_0xad05('0x5a')](_0x68f303);return _0x5d9ad3;}});}else{return;}})[_0xad05('0x26')](function(_0x33813e){if(_0x33813e)_0x233870=_0x33813e;return _['filter'](_0x233870,[_0xad05('0x5e'),0x1]);})[_0xad05('0x26')](respondWithResult(_0x4410c6,null))[_0xad05('0x42')](handleError(_0x4410c6,null));};function hasDefaultDashboard(_0x415ce5){var _0x8dbb9a=[0x65];return new BPromise(function(_0x494eae,_0x120ee1){try{if(_0x415ce5[_0xad05('0x51')]){_0x494eae(_0x8dbb9a);}else{return db[_0xad05('0x52')][_0xad05('0x62')]({'where':{'sectionId':_0x415ce5['id']},'raw':!![]})[_0xad05('0x26')](function(_0xecffd2){_0xecffd2?_0x494eae(_0x8dbb9a):_0x494eae();});}}catch(_0x5a9f98){_0x120ee1(_0x5a9f98);}});}function getCustomDashboards(_0x521ee0){var _0x58ed8b=[];return new BPromise(function(_0x597a77,_0x15434a){try{if(_0x521ee0[_0xad05('0x51')]){return db[_0xad05('0x63')][_0xad05('0x53')]({'raw':!![]})[_0xad05('0x26')](function(_0x389c7a){_0x389c7a[_0xad05('0x64')](function(_0xb536f4){_0x58ed8b[_0xad05('0x5a')](_0xb536f4['id']+0x1869f);});_0x597a77(_0x58ed8b);});}else{return db['UserProfileResource'][_0xad05('0x53')]({'where':{'sectionId':_0x521ee0['id']},'raw':!![]})[_0xad05('0x26')](function(_0x42ec49){_0x42ec49[_0xad05('0x64')](function(_0x8a615f){_0x58ed8b[_0xad05('0x5a')](_0x8a615f['resourceId']+0x1869f);});_0x597a77(_0x58ed8b);});}}catch(_0x346ba1){_0x15434a(_0x346ba1);}});}function getPlugins(_0x172302){var _0x2d4e76=[];return new BPromise(function(_0x32dfa7,_0x105930){try{if(_0x172302['autoAssociation']){return db[_0xad05('0x65')][_0xad05('0x53')]({'raw':!![]})['then'](function(_0xd7b3b1){_0xd7b3b1[_0xad05('0x64')](function(_0x37b99c){_0x2d4e76[_0xad05('0x5a')](_0x37b99c['id']+0x15b38);});_0x32dfa7(_0x2d4e76);});}else{return db[_0xad05('0x52')]['findAll']({'where':{'sectionId':_0x172302['id']},'raw':!![]})['then'](function(_0x4b0105){_0x4b0105['forEach'](function(_0x510b99){_0x2d4e76[_0xad05('0x5a')](_0x510b99[_0xad05('0x66')]+0x15b38);});_0x32dfa7(_0x2d4e76);});}}catch(_0x5a63ad){_0x105930(_0x5a63ad);}});}exports[_0xad05('0x67')]=function(_0x29059a,_0x4088bc){return db[_0xad05('0x2b')][_0xad05('0x46')]({'where':{'id':_0x29059a['params']['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x4088bc,null))[_0xad05('0x26')](function(_0x495df8){if(_0x495df8){return db['sequelize'][_0xad05('0x4f')](function(_0x5c4531){return db[_0xad05('0x55')][_0xad05('0x53')]({'where':{'userProfileId':_0x29059a[_0xad05('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xad05('0x26')](function(_0x13cc9b){if(_0x13cc9b){return db['UserProfileSection'][_0xad05('0x27')]({'where':{'userProfileId':_0x29059a[_0xad05('0x44')]['id'],'id':_['map'](_0x13cc9b,function(_0x41057f){return _0x41057f['id'];})},'transaction':_0x5c4531});}})[_0xad05('0x26')](function(_0x163d5f){var _0x204239=_[_0xad05('0x2a')](_0x29059a[_0xad05('0x48')],function(_0x39f7ec){_0x39f7ec[_0xad05('0x54')]=_0x29059a[_0xad05('0x44')]['id'];return _0x39f7ec;});return db[_0xad05('0x55')]['bulkCreate'](_0x204239,{'raw':!![],'transaction':_0x5c4531});})[_0xad05('0x26')](function(_0x310dfc){var _0x305676=_[_0xad05('0x3e')](_['map'](_0x310dfc,function(_0x13244d){return _0x13244d[_0xad05('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x305676){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x29059a[_0xad05('0x44')]['id'],'sectionId':_[_0xad05('0x2a')](_0x305676,function(_0x110376){return _0x110376['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xad05('0x26')](function(_0x103d73){var _0x606772=_[_0xad05('0x2a')](_0x29059a[_0xad05('0x48')],function(_0x2cefda){_0x2cefda[_0xad05('0x54')]=_0x29059a['params']['id'];return _0x2cefda;});return db['UserProfileResource'][_0xad05('0x68')](_0x606772,{'raw':!![],'transaction':_0x5c4531});});}})[_0xad05('0x42')](handleError(_0x4088bc,null));});}})[_0xad05('0x26')](function(_0x206ac8){var _0x5f5062=_[_0xad05('0x2a')](_0x206ac8,function(_0xa11296){return _0xa11296['get']({'plain':!![]});});})[_0xad05('0x26')](respondWithResult(_0x4088bc,null))['catch'](handleError(_0x4088bc,null));};exports['removeResources']=function(_0x86a5a7,_0x405905,_0x17d2a1){return db[_0xad05('0x2b')][_0xad05('0x46')]({'where':{'id':_0x86a5a7[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x405905,null))[_0xad05('0x26')](function(_0x5e7a7e){if(_0x5e7a7e){return _0x5e7a7e['removeResources'](_0x86a5a7[_0xad05('0x30')][_0xad05('0x5c')]);}})[_0xad05('0x26')](respondWithStatusCode(_0x405905,null))[_0xad05('0x42')](handleError(_0x405905,null));};exports[_0xad05('0x69')]=function(_0x6df81e,_0xd561e4){var _0x3f0536={};if(!_0x6df81e[_0xad05('0x30')][_0xad05('0x6a')])throw new Error(_0xad05('0x6b'));if(!_0x6df81e['query']['hasOwnProperty']('nolimit')){_0x3f0536[_0xad05('0x1f')]=qs[_0xad05('0x1f')](_0x6df81e[_0xad05('0x30')][_0xad05('0x1f')]);_0x3f0536['offset']=qs[_0xad05('0x1d')](_0x6df81e[_0xad05('0x30')][_0xad05('0x1d')]);}return db[_0xad05('0x2b')][_0xad05('0x46')]({'where':{'id':_0x6df81e[_0xad05('0x44')]['id']}})[_0xad05('0x26')](function(_0x8a656){if(!_0x8a656)throw new Error(_0xad05('0x6c')+_0x6df81e['params']['id']);return db[_0xad05('0x2b')][_0xad05('0x69')](_0x6df81e);})[_0xad05('0x26')](respondWithFilteredResult(_0xd561e4,_0x3f0536))['catch'](handleError(_0xd561e4,null));}; \ No newline at end of file +var _0xd3f5=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','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','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','reject','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','count','findAll','catch','show','params','keys','rawAttributes','length','include','create','body','clone','includeAll','find','get','omit','createdAt','crudPermissions','updatedAt','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','sequelize','each','push','removeSections','ids','getSections','enabled','isEmpty','subsections','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch'];(function(_0x3bb71f,_0x4cb463){var _0x7cd04b=function(_0x5d199b){while(--_0x5d199b){_0x3bb71f['push'](_0x3bb71f['shift']());}};_0x7cd04b(++_0x4cb463);}(_0xd3f5,0x147));var _0x5d3f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xd3f5[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x5d3f('0x0'));var rimraf=require(_0x5d3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d3f('0x2'));var rp=require(_0x5d3f('0x3'));var moment=require(_0x5d3f('0x4'));var BPromise=require(_0x5d3f('0x5'));var Mustache=require(_0x5d3f('0x6'));var util=require(_0x5d3f('0x7'));var path=require(_0x5d3f('0x8'));var sox=require(_0x5d3f('0x9'));var csv=require('to-csv');var ejs=require(_0x5d3f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d3f('0xb'));var squel=require(_0x5d3f('0xc'));var crypto=require('crypto');var jsforce=require(_0x5d3f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5d3f('0xe'));var querystring=require('querystring');var Papa=require(_0x5d3f('0xf'));var Redis=require('ioredis');var authService=require(_0x5d3f('0x10'));var qs=require(_0x5d3f('0x11'));var as=require(_0x5d3f('0x12'));var hardwareService=require(_0x5d3f('0x13'));var logger=require(_0x5d3f('0x14'))(_0x5d3f('0x15'));var utils=require(_0x5d3f('0x16'));var config=require(_0x5d3f('0x17'));var licenseUtil=require(_0x5d3f('0x18'));var db=require(_0x5d3f('0x19'))['db'];config[_0x5d3f('0x1a')]=_['defaults'](config[_0x5d3f('0x1a')],{'host':_0x5d3f('0x1b'),'port':0x18eb});var socket=require(_0x5d3f('0x1c'))(new Redis(config[_0x5d3f('0x1a')]));require('./userProfile.socket')[_0x5d3f('0x1d')](socket);function respondWithStatusCode(_0x2d917a,_0x5d6def){_0x5d6def=_0x5d6def||0xcc;return function(_0x1d2189){if(_0x1d2189){return _0x2d917a['sendStatus'](_0x5d6def);}return _0x2d917a[_0x5d3f('0x1e')](_0x5d6def)[_0x5d3f('0x1f')]();};}function respondWithResult(_0x1f55bb,_0x166b95){_0x166b95=_0x166b95||0xc8;return function(_0x3ac7d5){if(_0x3ac7d5){return _0x1f55bb[_0x5d3f('0x1e')](_0x166b95)[_0x5d3f('0x20')](_0x3ac7d5);}};}function respondWithFilteredResult(_0x56b671,_0x770aa8){return function(_0x4cdf5e){if(_0x4cdf5e){var _0x4201b9=typeof _0x770aa8[_0x5d3f('0x21')]===_0x5d3f('0x22')&&typeof _0x770aa8[_0x5d3f('0x23')]==='undefined';var _0x40d075=_0x4cdf5e['count'];var _0x1ddcee=_0x4201b9?0x0:_0x770aa8[_0x5d3f('0x21')];var _0x58127d=_0x4201b9?_0x4cdf5e['count']:_0x770aa8[_0x5d3f('0x21')]+_0x770aa8[_0x5d3f('0x23')];var _0x3edc42;if(_0x58127d>=_0x40d075){_0x58127d=_0x40d075;_0x3edc42=0xc8;}else{_0x3edc42=0xce;}_0x56b671[_0x5d3f('0x1e')](_0x3edc42);return _0x56b671['set']('Content-Range',_0x1ddcee+'-'+_0x58127d+'/'+_0x40d075)[_0x5d3f('0x20')](_0x4cdf5e);}return null;};}function patchUpdates(_0x33fa94){return function(_0x284974){try{jsonpatch['apply'](_0x284974,_0x33fa94,!![]);}catch(_0x3a7f56){return BPromise[_0x5d3f('0x24')](_0x3a7f56);}return _0x284974['save']();};}function saveUpdates(_0x345514,_0x56ea48){return function(_0x14a8f0){if(_0x14a8f0){return _0x14a8f0['update'](_0x345514)[_0x5d3f('0x25')](function(_0x65449){return _0x65449;});}return null;};}function removeEntity(_0x1544e3,_0x37345b){return function(_0x2e0f29){if(_0x2e0f29){return _0x2e0f29[_0x5d3f('0x26')]()['then'](function(){_0x1544e3[_0x5d3f('0x1e')](0xcc)[_0x5d3f('0x1f')]();});}};}function handleEntityNotFound(_0x2e0f23,_0x59a1a8){return function(_0x1f5e07){if(!_0x1f5e07){_0x2e0f23['sendStatus'](0x194);}return _0x1f5e07;};}function handleError(_0x5f41c3,_0x4ced45){_0x4ced45=_0x4ced45||0x1f4;return function(_0x2f2c74){logger[_0x5d3f('0x27')](_0x2f2c74[_0x5d3f('0x28')]);if(_0x2f2c74['name']){delete _0x2f2c74[_0x5d3f('0x29')];}_0x5f41c3[_0x5d3f('0x1e')](_0x4ced45)[_0x5d3f('0x2a')](_0x2f2c74);};}exports[_0x5d3f('0x2b')]=function(_0x5ed9ba,_0x5c97f0){var _0x12c691={},_0x15ff9f={},_0x5dd308={'count':0x0,'rows':[]};var _0x5407d4=_[_0x5d3f('0x2c')](db[_0x5d3f('0x2d')]['rawAttributes'],function(_0x3d424a){return{'name':_0x3d424a[_0x5d3f('0x2e')],'type':_0x3d424a[_0x5d3f('0x2f')][_0x5d3f('0x30')]};});_0x15ff9f[_0x5d3f('0x31')]=_[_0x5d3f('0x2c')](_0x5407d4,_0x5d3f('0x29'));_0x15ff9f[_0x5d3f('0x32')]=_['keys'](_0x5ed9ba[_0x5d3f('0x32')]);_0x15ff9f[_0x5d3f('0x33')]=_[_0x5d3f('0x34')](_0x15ff9f['model'],_0x15ff9f[_0x5d3f('0x32')]);_0x12c691[_0x5d3f('0x35')]=_[_0x5d3f('0x34')](_0x15ff9f[_0x5d3f('0x31')],qs[_0x5d3f('0x36')](_0x5ed9ba[_0x5d3f('0x32')][_0x5d3f('0x36')]));_0x12c691[_0x5d3f('0x35')]=_0x12c691[_0x5d3f('0x35')]['length']?_0x12c691[_0x5d3f('0x35')]:_0x15ff9f['model'];if(!_0x5ed9ba[_0x5d3f('0x32')][_0x5d3f('0x37')](_0x5d3f('0x38'))){_0x12c691['limit']=qs[_0x5d3f('0x23')](_0x5ed9ba[_0x5d3f('0x32')]['limit']);_0x12c691[_0x5d3f('0x21')]=qs[_0x5d3f('0x21')](_0x5ed9ba[_0x5d3f('0x32')][_0x5d3f('0x21')]);}_0x12c691[_0x5d3f('0x39')]=qs[_0x5d3f('0x3a')](_0x5ed9ba[_0x5d3f('0x32')][_0x5d3f('0x3a')]);_0x12c691['where']=qs[_0x5d3f('0x33')](_[_0x5d3f('0x3b')](_0x5ed9ba[_0x5d3f('0x32')],_0x15ff9f[_0x5d3f('0x33')]),_0x5407d4);if(_0x5ed9ba[_0x5d3f('0x32')][_0x5d3f('0x3c')]){_0x12c691[_0x5d3f('0x3d')]=_[_0x5d3f('0x3e')](_0x12c691['where'],{'$or':_[_0x5d3f('0x2c')](_0x5407d4,function(_0x57568e){if(_0x57568e[_0x5d3f('0x2f')]!=='VIRTUAL'){var _0x2612d1={};_0x2612d1[_0x57568e[_0x5d3f('0x29')]]={'$like':'%'+_0x5ed9ba[_0x5d3f('0x32')]['filter']+'%'};return _0x2612d1;}})});}_0x12c691=_['merge']({},_0x12c691,_0x5ed9ba[_0x5d3f('0x3f')]);var _0x1771c3={'where':_0x12c691[_0x5d3f('0x3d')]};return db[_0x5d3f('0x2d')]['count'](_0x1771c3)[_0x5d3f('0x25')](function(_0x13f796){_0x5dd308[_0x5d3f('0x40')]=_0x13f796;if(_0x5ed9ba[_0x5d3f('0x32')]['includeAll']){_0x12c691['include']=[{'all':!![]}];}return db[_0x5d3f('0x2d')][_0x5d3f('0x41')](_0x12c691);})[_0x5d3f('0x25')](function(_0x13d7f5){_0x5dd308['rows']=_0x13d7f5;return _0x5dd308;})[_0x5d3f('0x25')](respondWithFilteredResult(_0x5c97f0,_0x12c691))[_0x5d3f('0x42')](handleError(_0x5c97f0,null));};exports[_0x5d3f('0x43')]=function(_0x226e22,_0xe91c45){var _0x5aae0a={'raw':![],'where':{'id':_0x226e22[_0x5d3f('0x44')]['id']}},_0x24e04c={};_0x24e04c['model']=_[_0x5d3f('0x45')](db[_0x5d3f('0x2d')][_0x5d3f('0x46')]);_0x24e04c[_0x5d3f('0x32')]=_['keys'](_0x226e22[_0x5d3f('0x32')]);_0x24e04c[_0x5d3f('0x33')]=_[_0x5d3f('0x34')](_0x24e04c['model'],_0x24e04c[_0x5d3f('0x32')]);_0x5aae0a[_0x5d3f('0x35')]=_[_0x5d3f('0x34')](_0x24e04c[_0x5d3f('0x31')],qs[_0x5d3f('0x36')](_0x226e22[_0x5d3f('0x32')][_0x5d3f('0x36')]));_0x5aae0a[_0x5d3f('0x35')]=_0x5aae0a[_0x5d3f('0x35')][_0x5d3f('0x47')]?_0x5aae0a[_0x5d3f('0x35')]:_0x24e04c[_0x5d3f('0x31')];if(_0x226e22[_0x5d3f('0x32')]['includeAll']){_0x5aae0a[_0x5d3f('0x48')]=[{'all':!![]}];}_0x5aae0a=_[_0x5d3f('0x3e')]({},_0x5aae0a,_0x226e22[_0x5d3f('0x3f')]);return db[_0x5d3f('0x2d')]['find'](_0x5aae0a)[_0x5d3f('0x25')](handleEntityNotFound(_0xe91c45,null))['then'](respondWithResult(_0xe91c45,null))[_0x5d3f('0x42')](handleError(_0xe91c45,null));};exports['create']=function(_0x124456,_0x1e9dd6){return db[_0x5d3f('0x2d')][_0x5d3f('0x49')](_0x124456[_0x5d3f('0x4a')],{})[_0x5d3f('0x25')](respondWithResult(_0x1e9dd6,0xc9))[_0x5d3f('0x42')](handleError(_0x1e9dd6,null));};exports[_0x5d3f('0x4b')]=function(_0x4df43e,_0x1debf8){var _0x3aeb6d={'where':{'id':_0x4df43e['params']['id']}},_0xade45={};_0xade45['model']=_[_0x5d3f('0x45')](db[_0x5d3f('0x2d')][_0x5d3f('0x46')]);_0x3aeb6d[_0x5d3f('0x35')]=_[_0x5d3f('0x34')](_0xade45[_0x5d3f('0x31')],qs[_0x5d3f('0x36')](_0x4df43e[_0x5d3f('0x32')][_0x5d3f('0x36')]));_0x3aeb6d[_0x5d3f('0x35')]=_0x3aeb6d['attributes'][_0x5d3f('0x47')]?_0x3aeb6d[_0x5d3f('0x35')]:_0xade45[_0x5d3f('0x31')];if(_0x4df43e[_0x5d3f('0x32')][_0x5d3f('0x4c')]){_0x3aeb6d[_0x5d3f('0x48')]=[{'all':!![]}];}_0x3aeb6d=_[_0x5d3f('0x3e')]({},_0x3aeb6d,_0x4df43e['options']);return db[_0x5d3f('0x2d')][_0x5d3f('0x4d')](_0x3aeb6d)[_0x5d3f('0x25')](handleEntityNotFound(_0x1debf8,null))[_0x5d3f('0x25')](function(_0x5899c1){if(_0x5899c1){var _0x231c0d=_0x5899c1[_0x5d3f('0x4e')]({'plain':!![]});_0x231c0d=qs[_0x5d3f('0x4f')](_0x231c0d,['id',_0x5d3f('0x50'),'updatedAt',_0x5d3f('0x51')]);_0x4df43e[_0x5d3f('0x4a')]=_[_0x5d3f('0x4f')](_0x4df43e[_0x5d3f('0x4a')],['id',_0x5d3f('0x50'),_0x5d3f('0x52')]);return db['sequelize'][_0x5d3f('0x53')](function(_0x4c53ff){return db[_0x5d3f('0x2d')][_0x5d3f('0x49')](_[_0x5d3f('0x3e')](_0x231c0d,_0x4df43e['body']),{'include':_0x4df43e[_0x5d3f('0x32')][_0x5d3f('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x4c53ff})[_0x5d3f('0x25')](function(_0x5e9516){var _0x3655f1=_0x5e9516[_0x5d3f('0x4e')]({'plain':!![]});return db[_0x5d3f('0x54')]['findAll']({'where':{'userProfileId':_0x4df43e[_0x5d3f('0x44')]['id']},'raw':!![]})[_0x5d3f('0x25')](function(_0x319299){if(_0x319299){return BPromise['each'](_0x319299,function(_0x520bff){return new BPromise(function(_0x5a0510,_0x5c4f83){if(_0x520bff[_0x5d3f('0x55')]===null||_0x520bff[_0x5d3f('0x55')]===0x1)_0x5a0510(null);return db[_0x5d3f('0x56')][_0x5d3f('0x41')]({'where':{'sectionId':_0x520bff['id']},'raw':!![]})[_0x5d3f('0x25')](function(_0x5e3a97){var _0x56322b=_[_0x5d3f('0x2c')](_0x5e3a97,function(_0x195a07){return qs['omit'](_0x195a07,['id',_0x5d3f('0x50'),_0x5d3f('0x52'),_0x5d3f('0x57')]);});_0x5a0510(_0x56322b);})[_0x5d3f('0x42')](function(_0xf68ae2){_0x5c4f83(_0xf68ae2);});})[_0x5d3f('0x25')](function(_0x3db51d){var _0x9a74a7=qs['omit'](_0x520bff,['id',_0x5d3f('0x50'),_0x5d3f('0x52')]);_0x9a74a7[_0x5d3f('0x58')]=_0x3655f1['id'];if(_0x3db51d)_0x9a74a7[_0x5d3f('0x59')]=_0x3db51d;return _0x9a74a7;})[_0x5d3f('0x25')](function(_0x5e3ab2){return db[_0x5d3f('0x54')]['create'](_0x5e3ab2,{'include':[{'model':db['UserProfileResource'],'as':_0x5d3f('0x59')}],'raw':!![],'transaction':_0x4c53ff});});})[_0x5d3f('0x25')](function(){return _0x3655f1;});}});});});}})[_0x5d3f('0x25')](respondWithResult(_0x1debf8,0xc9))[_0x5d3f('0x42')](handleError(_0x1debf8,null));};exports[_0x5d3f('0x5a')]=function(_0x4ad26f,_0xd49353){if(_0x4ad26f[_0x5d3f('0x4a')]['id']){delete _0x4ad26f[_0x5d3f('0x4a')]['id'];}return db[_0x5d3f('0x2d')][_0x5d3f('0x4d')]({'where':{'id':_0x4ad26f[_0x5d3f('0x44')]['id']}})[_0x5d3f('0x25')](handleEntityNotFound(_0xd49353,null))[_0x5d3f('0x25')](saveUpdates(_0x4ad26f['body'],null))['then'](respondWithResult(_0xd49353,null))[_0x5d3f('0x42')](handleError(_0xd49353,null));};exports['destroy']=function(_0x3013ac,_0x560180){return db[_0x5d3f('0x2d')][_0x5d3f('0x4d')]({'where':{'id':_0x3013ac[_0x5d3f('0x44')]['id']}})[_0x5d3f('0x25')](handleEntityNotFound(_0x560180,null))[_0x5d3f('0x25')](removeEntity(_0x560180,null))['catch'](handleError(_0x560180,null));};exports[_0x5d3f('0x5b')]=function(_0x36e9d0,_0x4abd68){return db[_0x5d3f('0x2d')][_0x5d3f('0x5b')]()['then'](respondWithResult(_0x4abd68,null))[_0x5d3f('0x42')](handleError(_0x4abd68,null));};exports[_0x5d3f('0x5c')]=function(_0x3a5fec,_0x1500c7){var _0x1d47e7=_0x3a5fec[_0x5d3f('0x4a')];return db[_0x5d3f('0x2d')][_0x5d3f('0x4d')]({'where':{'id':_0x3a5fec[_0x5d3f('0x44')]['id']}})[_0x5d3f('0x25')](handleEntityNotFound(_0x1500c7,null))['then'](function(_0x3b689b){if(_0x3b689b){return db[_0x5d3f('0x5d')][_0x5d3f('0x53')](function(_0x3858e3){return db[_0x5d3f('0x54')][_0x5d3f('0x26')]({'where':{'userProfileId':_0x3a5fec[_0x5d3f('0x44')]['id'],'sectionId':_[_0x5d3f('0x2c')](_0x1d47e7,function(_0x1cb80c){return _0x1cb80c[_0x5d3f('0x57')];})},'transaction':_0x3858e3})['then'](function(){var _0x18ec2c=_[_0x5d3f('0x2c')](_0x1d47e7,function(_0x46998e){_0x46998e[_0x5d3f('0x58')]=_0x3a5fec[_0x5d3f('0x44')]['id'];return _0x46998e;});var _0x28fa0d=[];return BPromise[_0x5d3f('0x5e')](_0x18ec2c,function(_0x297a27){return db[_0x5d3f('0x54')]['create'](_0x297a27,{'include':[{'model':db[_0x5d3f('0x56')],'as':_0x5d3f('0x59')}],'raw':!![],'transaction':_0x3858e3})[_0x5d3f('0x25')](function(_0x58d348){_0x28fa0d[_0x5d3f('0x5f')](_0x58d348['get']({'plain':!![]}));});})['then'](function(){return _0x28fa0d;});});});}})[_0x5d3f('0x25')](function(_0x2ba1a6){return _0x2ba1a6;})[_0x5d3f('0x25')](respondWithResult(_0x1500c7,null))[_0x5d3f('0x42')](handleError(_0x1500c7,null));};exports[_0x5d3f('0x60')]=function(_0x16498b,_0x294be4){var _0x492cd8;return db[_0x5d3f('0x2d')]['find']({'where':{'id':_0x16498b[_0x5d3f('0x44')]['id']},'attributes':['id',_0x5d3f('0x29')]})[_0x5d3f('0x25')](handleEntityNotFound(_0x294be4,null))[_0x5d3f('0x25')](function(_0x17713a){if(_0x17713a){_0x492cd8=_0x17713a;return db[_0x5d3f('0x54')][_0x5d3f('0x26')]({'where':{'userProfileId':_0x16498b[_0x5d3f('0x44')]['id'],'sectionId':_0x16498b[_0x5d3f('0x32')][_0x5d3f('0x61')]}});}})[_0x5d3f('0x25')](function(){return _0x492cd8;})[_0x5d3f('0x25')](respondWithStatusCode(_0x294be4,null))[_0x5d3f('0x42')](handleError(_0x294be4,null));};exports[_0x5d3f('0x62')]=function(_0x2454f2,_0x33f8bb){var _0x4c9c91=[];var _0x1e01b0=[];return db['UserProfileSection'][_0x5d3f('0x41')]({'where':{'userProfileId':_0x2454f2[_0x5d3f('0x44')]['id']},'raw':!![]})[_0x5d3f('0x25')](function(_0x3600c4){_0x4c9c91=_['filter'](_0x3600c4,function(_0x58b120){return _0x58b120[_0x5d3f('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x58b120[_0x5d3f('0x57')]);});if(!_[_0x5d3f('0x64')](_0x4c9c91)){return _[_0x5d3f('0x2c')](_0x4c9c91,function(_0x2c2172){return _0x2c2172[_0x5d3f('0x57')];});}else{return;}})[_0x5d3f('0x25')](function(_0xe469ae){if(_0xe469ae)_0x1e01b0=_0xe469ae;if(_['includes'](_0x1e01b0,0x64)){var _0x5116de=_[_0x5d3f('0x4d')](_0x4c9c91,{'sectionId':0x64});return hasDefaultDashboard(_0x5116de)[_0x5d3f('0x25')](function(_0x378bfe){return _[_0x5d3f('0x2c')](_0x4c9c91,function(_0x3ce946){if(_0x3ce946[_0x5d3f('0x57')]===0x64){_0x3ce946[_0x5d3f('0x65')]=_0x378bfe;}return _0x3ce946;});});}else{return;}})[_0x5d3f('0x25')](function(_0x6f87da){if(_0x6f87da)_0x4c9c91=_0x6f87da;if(_['includes'](_0x1e01b0,0x3eb)){var _0x3caab6=_[_0x5d3f('0x4d')](_0x4c9c91,{'sectionId':0x3eb});return getCustomDashboards(_0x3caab6)[_0x5d3f('0x25')](function(_0x36950d){return _[_0x5d3f('0x2c')](_0x4c9c91,function(_0x3735b5){if(_0x3caab6[_0x5d3f('0x63')]){if(_0x3735b5[_0x5d3f('0x57')]===0x3eb){_0x3735b5['subsections']=_0x36950d;}}else{if(_0x3735b5[_0x5d3f('0x57')]===0x64){_0x3735b5[_0x5d3f('0x65')]=_0x36950d;}}return _0x3735b5;});});}else{return;}})[_0x5d3f('0x25')](function(_0x1c5a24){if(_0x1c5a24)_0x4c9c91=_0x1c5a24;if(_['includes'](_0x1e01b0,0x709)){var _0x5c6b6b=_['find'](_0x4c9c91,{'sectionId':0x709});return getPlugins(_0x5c6b6b)[_0x5d3f('0x25')](function(_0x4a4b50){if(_0x5c6b6b[_0x5d3f('0x63')]){return _[_0x5d3f('0x2c')](_0x4c9c91,function(_0x5ab64a){if(_0x5ab64a['sectionId']===0x709){_0x5ab64a[_0x5d3f('0x65')]=_0x4a4b50;}return _0x5ab64a;});}else{var _0x2b75df={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4a4b50};var _0x3ccd37=_[_0x5d3f('0x2c')](_0x4c9c91);_0x3ccd37[_0x5d3f('0x5f')](_0x2b75df);return _0x3ccd37;}});}else{return;}})[_0x5d3f('0x25')](function(_0x1681ea){if(_0x1681ea)_0x4c9c91=_0x1681ea;return _[_0x5d3f('0x3c')](_0x4c9c91,[_0x5d3f('0x63'),0x1]);})['then'](respondWithResult(_0x33f8bb,null))[_0x5d3f('0x42')](handleError(_0x33f8bb,null));};function hasDefaultDashboard(_0x3ea27e){var _0x2609ed=[0x65];return new BPromise(function(_0x143b21,_0x32cd9e){try{if(_0x3ea27e[_0x5d3f('0x55')]){_0x143b21(_0x2609ed);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x3ea27e['id']},'raw':!![]})['then'](function(_0x2a9e6f){_0x2a9e6f?_0x143b21(_0x2609ed):_0x143b21();});}}catch(_0xd2efa3){_0x32cd9e(_0xd2efa3);}});}function getCustomDashboards(_0x157a61){var _0x93bef6=[];return new BPromise(function(_0x23fb62,_0x391c36){try{if(_0x157a61[_0x5d3f('0x55')]){return db['Dashboard'][_0x5d3f('0x41')]({'raw':!![]})[_0x5d3f('0x25')](function(_0x4964ac){_0x4964ac[_0x5d3f('0x66')](function(_0x37dfde){_0x93bef6[_0x5d3f('0x5f')](_0x37dfde['id']+0x1869f);});_0x23fb62(_0x93bef6);});}else{return db[_0x5d3f('0x56')]['findAll']({'where':{'sectionId':_0x157a61['id']},'raw':!![]})[_0x5d3f('0x25')](function(_0x26b551){_0x26b551[_0x5d3f('0x66')](function(_0x21ccb6){_0x93bef6[_0x5d3f('0x5f')](_0x21ccb6['resourceId']+0x1869f);});_0x23fb62(_0x93bef6);});}}catch(_0x46d8e6){_0x391c36(_0x46d8e6);}});}function getPlugins(_0x54ef58){var _0xc5c8d5=[];return new BPromise(function(_0x2568b5,_0x198cfd){try{if(_0x54ef58[_0x5d3f('0x55')]){return db[_0x5d3f('0x67')]['findAll']({'raw':!![]})[_0x5d3f('0x25')](function(_0x31af2e){_0x31af2e[_0x5d3f('0x66')](function(_0x55b45c){_0xc5c8d5[_0x5d3f('0x5f')](_0x55b45c['id']+0x15b38);});_0x2568b5(_0xc5c8d5);});}else{return db[_0x5d3f('0x56')][_0x5d3f('0x41')]({'where':{'sectionId':_0x54ef58['id']},'raw':!![]})[_0x5d3f('0x25')](function(_0x1e2bf5){_0x1e2bf5['forEach'](function(_0x502a00){_0xc5c8d5[_0x5d3f('0x5f')](_0x502a00[_0x5d3f('0x68')]+0x15b38);});_0x2568b5(_0xc5c8d5);});}}catch(_0x3ef49d){_0x198cfd(_0x3ef49d);}});}exports['addResources']=function(_0x3516c5,_0x1d10f4){return db[_0x5d3f('0x2d')]['find']({'where':{'id':_0x3516c5[_0x5d3f('0x44')]['id']}})[_0x5d3f('0x25')](handleEntityNotFound(_0x1d10f4,null))[_0x5d3f('0x25')](function(_0x4f1173){if(_0x4f1173){return db[_0x5d3f('0x5d')][_0x5d3f('0x53')](function(_0x53c81c){return db[_0x5d3f('0x54')][_0x5d3f('0x41')]({'where':{'userProfileId':_0x3516c5[_0x5d3f('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0x5d3f('0x25')](function(_0x1fdfcf){if(_0x1fdfcf){return db[_0x5d3f('0x54')]['destroy']({'where':{'userProfileId':_0x3516c5['params']['id'],'id':_[_0x5d3f('0x2c')](_0x1fdfcf,function(_0x15f857){return _0x15f857['id'];})},'transaction':_0x53c81c});}})[_0x5d3f('0x25')](function(_0xfa7c5b){var _0x590891=_[_0x5d3f('0x2c')](_0x3516c5[_0x5d3f('0x4a')],function(_0x20c9c9){_0x20c9c9[_0x5d3f('0x58')]=_0x3516c5['params']['id'];return _0x20c9c9;});return db[_0x5d3f('0x54')]['bulkCreate'](_0x590891,{'raw':!![],'transaction':_0x53c81c});})[_0x5d3f('0x25')](function(_0x2648f1){var _0x7d6129=_[_0x5d3f('0x3c')](_[_0x5d3f('0x2c')](_0x2648f1,function(_0x25a793){return _0x25a793[_0x5d3f('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x7d6129){return db[_0x5d3f('0x54')][_0x5d3f('0x41')]({'where':{'userProfileId':_0x3516c5['params']['id'],'sectionId':_['map'](_0x7d6129,function(_0x136b3f){return _0x136b3f['sectionId'];})},'attributes':['id',_0x5d3f('0x57')],'raw':!![]})[_0x5d3f('0x25')](function(_0x3e8777){var _0x15a50e=_[_0x5d3f('0x2c')](_0x3516c5[_0x5d3f('0x4a')],function(_0x297671){_0x297671['userProfileId']=_0x3516c5['params']['id'];return _0x297671;});return db['UserProfileResource'][_0x5d3f('0x69')](_0x15a50e,{'raw':!![],'transaction':_0x53c81c});});}})[_0x5d3f('0x42')](handleError(_0x1d10f4,null));});}})['then'](function(_0x444c95){var _0x33e34c=_['map'](_0x444c95,function(_0xe26bc0){return _0xe26bc0[_0x5d3f('0x4e')]({'plain':!![]});});})['then'](respondWithResult(_0x1d10f4,null))[_0x5d3f('0x42')](handleError(_0x1d10f4,null));};exports[_0x5d3f('0x6a')]=function(_0x89241d,_0x231397,_0x1df3e2){return db['UserProfile']['find']({'where':{'id':_0x89241d[_0x5d3f('0x44')]['id']}})[_0x5d3f('0x25')](handleEntityNotFound(_0x231397,null))[_0x5d3f('0x25')](function(_0x5b36e4){if(_0x5b36e4){return _0x5b36e4[_0x5d3f('0x6a')](_0x89241d[_0x5d3f('0x32')]['ids']);}})[_0x5d3f('0x25')](respondWithStatusCode(_0x231397,null))[_0x5d3f('0x42')](handleError(_0x231397,null));};exports[_0x5d3f('0x6b')]=function(_0xac1d22,_0x13479c){var _0x16eff1={};if(!_0xac1d22['query']['section'])throw new Error(_0x5d3f('0x6c'));if(!_0xac1d22[_0x5d3f('0x32')][_0x5d3f('0x37')](_0x5d3f('0x38'))){_0x16eff1[_0x5d3f('0x23')]=qs[_0x5d3f('0x23')](_0xac1d22[_0x5d3f('0x32')]['limit']);_0x16eff1[_0x5d3f('0x21')]=qs[_0x5d3f('0x21')](_0xac1d22[_0x5d3f('0x32')][_0x5d3f('0x21')]);}return db[_0x5d3f('0x2d')][_0x5d3f('0x4d')]({'where':{'id':_0xac1d22[_0x5d3f('0x44')]['id']}})[_0x5d3f('0x25')](function(_0x256f09){if(!_0x256f09)throw new Error(_0x5d3f('0x6d')+_0xac1d22[_0x5d3f('0x44')]['id']);return db[_0x5d3f('0x2d')][_0x5d3f('0x6b')](_0xac1d22);})[_0x5d3f('0x25')](respondWithFilteredResult(_0x13479c,_0x16eff1))[_0x5d3f('0x42')](handleError(_0x13479c,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 4de30d1..303f11b 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 _0xafb9=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x5387dc,_0x57356d){var _0x22b9b8=function(_0x239184){while(--_0x239184){_0x5387dc['push'](_0x5387dc['shift']());}};_0x22b9b8(++_0x57356d);}(_0xafb9,0x68));var _0x9afb=function(_0x47e181,_0x141c32){_0x47e181=_0x47e181-0x0;var _0xa19c91=_0xafb9[_0x47e181];return _0xa19c91;};'use strict';var EventEmitter=require(_0x9afb('0x0'));var UserProfile=require(_0x9afb('0x1'))['db'][_0x9afb('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9afb('0x3')](0x0);var events={'afterCreate':_0x9afb('0x4'),'afterUpdate':_0x9afb('0x5'),'afterDestroy':_0x9afb('0x6')};function emitEvent(_0x44892f){return function(_0xdaf0c6,_0x4e983d,_0x498463){UserProfileEvents[_0x9afb('0x7')](_0x44892f+':'+_0xdaf0c6['id'],_0xdaf0c6);UserProfileEvents['emit'](_0x44892f,_0xdaf0c6);_0x498463(null);};}for(var e in events){if(events[_0x9afb('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x2aa3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x5cdc33,_0x2893fd){var _0x1b2175=function(_0x5339e5){while(--_0x5339e5){_0x5cdc33['push'](_0x5cdc33['shift']());}};_0x1b2175(++_0x2893fd);}(_0x2aa3,0x83));var _0x32aa=function(_0x23141c,_0x41a81f){_0x23141c=_0x23141c-0x0;var _0x340f21=_0x2aa3[_0x23141c];return _0x340f21;};'use strict';var EventEmitter=require(_0x32aa('0x0'));var UserProfile=require(_0x32aa('0x1'))['db'][_0x32aa('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x32aa('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x32aa('0x4')};function emitEvent(_0x2b754c){return function(_0x13843c,_0x33612d,_0x22e989){UserProfileEvents[_0x32aa('0x5')](_0x2b754c+':'+_0x13843c['id'],_0x13843c);UserProfileEvents['emit'](_0x2b754c,_0x13843c);_0x22e989(null);};}for(var e in events){if(events[_0x32aa('0x6')](e)){var event=events[e];UserProfile[_0x32aa('0x7')](e,emitEvent(event));}}module[_0x32aa('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 09b436c..96976e6 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 _0xc2c7=['chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','WhatsappQueue','teams','queuecampaigns','users','agents','telephones','Users','admin','Telephones','zendeskaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trigger','Trunk','plugins','Plugin','extractedreports','Reports','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','query','raw','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','autoAssociation','all','rawAttributes','keys','attributes','fields','nolimit','limit','offset','sort','where','filters','pick','merge','key','foreignKey','options','AnalyticExtractedReport','include','forEach','reportType','default','reportId','CustomReports','rows','ids','count','includeAll','ThroughTags','color','tag','true','dataValues','sms','fax','openchannel','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','findAll','then','map','catch','field','model','associatedResources','UserProfileResource','resourceId','type','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','name','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold'];(function(_0x517f44,_0x6d75a4){var _0x2fcf9e=function(_0x3e2046){while(--_0x3e2046){_0x517f44['push'](_0x517f44['shift']());}};_0x2fcf9e(++_0x6d75a4);}(_0xc2c7,0x134));var _0x7c2c=function(_0x55babc,_0x8f0938){_0x55babc=_0x55babc-0x0;var _0x35e409=_0xc2c7[_0x55babc];return _0x35e409;};'use strict';var _=require('lodash');var attributes=require(_0x7c2c('0x0'));var qs=require(_0x7c2c('0x1'));var squel=require(_0x7c2c('0x2'));module[_0x7c2c('0x3')]=function(_0x380d13){var _0x237e4d=_0x380d13[_0x7c2c('0x4')];function _0x116f8a(_0x4bbc14,_0x59f346){return new Promise(function(_0x31dc4e,_0x42ecc9){if(!_0x59f346)return _0x31dc4e(null);var _0x23c038=_0x59f346['filter']?{[_0x59f346['filter']['field']]:_0x59f346[_0x7c2c('0x5')][_0x7c2c('0x6')]}:undefined;return _0x237e4d[_0x4bbc14][_0x7c2c('0x7')]({'where':_0x23c038,'raw':!![]})[_0x7c2c('0x8')](function(_0x279cff){_0x59f346['associatedResources']=_[_0x7c2c('0x9')](_0x279cff,'id');_0x31dc4e(_0x59f346);})[_0x7c2c('0xa')](function(_0x285ff6){_0x42ecc9(_0x285ff6);});});}function _0x1bfeaf(_0x2587ec,_0x1c66b4){return new Promise(function(_0x2cb057,_0x38fc25){var _0xed73e8=_0x2587ec[_0x7c2c('0x5')]?{[_0x2587ec[_0x7c2c('0x5')][_0x7c2c('0xb')]]:_0x2587ec[_0x7c2c('0x5')][_0x7c2c('0x6')]}:undefined;return _0x237e4d[_0x2587ec[_0x7c2c('0xc')]][_0x7c2c('0x7')]({'where':_0xed73e8,'raw':!![]})['then'](function(_0x5b5729){_0x1c66b4[_0x7c2c('0xd')]=_[_0x7c2c('0x9')](_0x5b5729,function(_0x4678a8){return _0x4678a8['name'];});_0x2cb057(_0x1c66b4);})[_0x7c2c('0xa')](function(_0x206ecd){_0x38fc25(_0x206ecd);});});}function _0x5e55e0(_0x88f54b,_0x5a5fe2,_0x1aa355){if(!_0x5a5fe2)return Promise['resolve'](null);return new Promise(function(_0x342ea2,_0x3c948a){return _0x237e4d[_0x7c2c('0xe')][_0x7c2c('0x7')]({'where':{'sectionId':_0x5a5fe2['id']},'raw':!![]})[_0x7c2c('0x8')](function(_0x26be0f){if(_0x88f54b[_0x7c2c('0xb')]&&_0x88f54b[_0x7c2c('0xb')]!=='id'){_0x5a5fe2[_0x7c2c('0xd')]=_[_0x7c2c('0x9')](_0x26be0f,function(_0x40eaef){return _0x40eaef[_0x88f54b[_0x7c2c('0xb')]];});}else{if(_0x1aa355==='AnalyticExtractedReport'){_0x5a5fe2[_0x7c2c('0xd')]=_['map'](_0x26be0f,function(_0x506d47){return{'id':_0x506d47[_0x7c2c('0xf')],'type':_0x506d47[_0x7c2c('0x10')]};});}else{_0x5a5fe2[_0x7c2c('0xd')]=_[_0x7c2c('0x9')](_0x26be0f,function(_0x41552f){return _0x41552f[_0x7c2c('0xf')];});}}_0x342ea2(_0x5a5fe2);})[_0x7c2c('0xa')](function(_0x541368){_0x3c948a(_0x541368);});});}function _0x10c356(_0x4dedd8,_0x302c93){var _0x57f510={'parentSections':[]};switch(_0x4dedd8[_0x7c2c('0x11')]()){case _0x7c2c('0x12'):_0x57f510[_0x7c2c('0x13')]='SquareProject';break;case'odbc':_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x14');break;case _0x7c2c('0x15'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x16');_0x57f510[_0x7c2c('0x17')]=[{'name':_0x7c2c('0x18'),'field':'name','foreignKey':_0x7c2c('0x19')}];break;case _0x7c2c('0x1a'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x1b');break;case _0x7c2c('0x1c'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x1d');_0x57f510[_0x7c2c('0x17')]=[{'name':_0x7c2c('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x7c2c('0x1f'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x20');break;case _0x7c2c('0x21'):_0x57f510['childModel']=_0x7c2c('0x22');break;case _0x7c2c('0x23'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x24');break;case _0x7c2c('0x25'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x26');break;case'chatwebsites':_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x27');break;case _0x7c2c('0x28'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x29');break;case'faxaccounts':_0x57f510['childModel']=_0x7c2c('0x2a');break;case'inboundroutes':case'internalroutes':case _0x7c2c('0x2b'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x2c');break;case _0x7c2c('0x2d'):_0x57f510['childModel']=_0x7c2c('0x2e');break;case _0x7c2c('0x2f'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x30');break;case _0x7c2c('0x31'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x32');_0x57f510[_0x7c2c('0x17')]=[{'name':_0x7c2c('0x33'),'field':_0x7c2c('0x34'),'foreignKey':_0x7c2c('0x35'),'model':_0x7c2c('0x36'),'filter':{'field':_0x7c2c('0x37'),'value':['agent']}},{'name':'Telephones','field':_0x7c2c('0x34'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0x7c2c('0x38')]}},{'name':_0x7c2c('0x39'),'field':_0x7c2c('0x34'),'foreignKey':_0x7c2c('0x3a'),'model':_0x7c2c('0x3b'),'filter':{'field':_0x7c2c('0x10'),'value':[_0x7c2c('0x3c')]}},{'name':_0x7c2c('0x3d'),'field':_0x7c2c('0x34'),'foreignKey':_0x7c2c('0x3a'),'model':_0x7c2c('0x3b'),'filter':{'field':'type','value':['outbound']}}];break;case _0x7c2c('0x3e'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x3f');break;case _0x7c2c('0x40'):_0x57f510['childModel']=_0x7c2c('0x41');break;case _0x7c2c('0x42'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x43');break;case _0x7c2c('0x44'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x45');break;case _0x7c2c('0x46'):_0x57f510[_0x7c2c('0x13')]='MailQueue';break;case _0x7c2c('0x47'):_0x57f510['childModel']=_0x7c2c('0x48');break;case _0x7c2c('0x49'):_0x57f510['childModel']=_0x7c2c('0x4a');break;case'openchannelqueues':_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x4b');break;case _0x7c2c('0x4c'):_0x57f510[_0x7c2c('0x13')]='OpenchannelAccount';break;case _0x7c2c('0x4d'):_0x57f510['childModel']='SmsQueue';break;case _0x7c2c('0x4e'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x4f');break;case'whatsappqueues':_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x50');break;case'whatsappaccounts':_0x57f510[_0x7c2c('0x13')]='WhatsappAccount';break;case _0x7c2c('0x51'):_0x57f510[_0x7c2c('0x13')]='Team';break;case'voicequeues':case _0x7c2c('0x52'):_0x57f510[_0x7c2c('0x13')]='VoiceQueue';if(_0x302c93){_0x57f510[_0x7c2c('0x17')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x7c2c('0x53'):case _0x7c2c('0x54'):case _0x7c2c('0x55'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x36');if(_0x302c93){_0x57f510[_0x7c2c('0x17')]=[{'name':_0x7c2c('0x56'),'filter':{'field':_0x7c2c('0x37'),'value':[_0x7c2c('0x57'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x7c2c('0x58')}];}break;case _0x7c2c('0x59'):_0x57f510[_0x7c2c('0x13')]='ZendeskAccount';break;case'salesforceaccounts':_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x5a');break;case _0x7c2c('0x5b'):_0x57f510[_0x7c2c('0x13')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x57f510['childModel']=_0x7c2c('0x5c');break;case _0x7c2c('0x5d'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x5e');break;case _0x7c2c('0x5f'):_0x57f510['childModel']=_0x7c2c('0x60');break;case _0x7c2c('0x61'):_0x57f510['childModel']=_0x7c2c('0x36');break;case'cannedanswers':_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x62');break;case _0x7c2c('0x63'):_0x57f510['childModel']='Disposition';break;case _0x7c2c('0x64'):_0x57f510['childModel']=_0x7c2c('0x65');break;case _0x7c2c('0x66'):_0x57f510['childModel']=_0x7c2c('0x67');break;case _0x7c2c('0x68'):_0x57f510['childModel']=_0x7c2c('0x69');break;case _0x7c2c('0x6a'):_0x57f510['childModel']=_0x7c2c('0x6b');break;case _0x7c2c('0x6c'):_0x57f510[_0x7c2c('0x13')]='Sound';break;case _0x7c2c('0x6d'):_0x57f510['childModel']=_0x7c2c('0x6e');break;case _0x7c2c('0x6f'):_0x57f510['childModel']=_0x7c2c('0x70');break;case _0x7c2c('0x71'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x72');break;case'trunks':_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x73');break;case'variables':_0x57f510[_0x7c2c('0x13')]='Variable';break;case _0x7c2c('0x74'):_0x57f510[_0x7c2c('0x13')]=_0x7c2c('0x75');break;case _0x7c2c('0x76'):_0x57f510[_0x7c2c('0x13')]='AnalyticExtractedReport';_0x57f510[_0x7c2c('0x17')]=[{'name':_0x7c2c('0x77'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x57f510['childModel']=_0x7c2c('0x78');break;}return _0x57f510;}function _0x4ada7a(_0x1e61fe,_0x4bcef3){var _0x469515=_0x1e61fe[_0x7c2c('0x79')](0x0)[_0x7c2c('0x7a')]()+_0x1e61fe[_0x7c2c('0x7b')](0x1);var _0x3c14af={'type':_0x237e4d[_0x7c2c('0x7c')][_0x7c2c('0x7d')][_0x7c2c('0x7e')],'raw':!![]};return new Promise(function(_0x5eb300,_0x570cd3){var _0x5baee8=squel[_0x7c2c('0x7f')]()[_0x7c2c('0xb')](_0x7c2c('0x80')+_0x469515+_0x7c2c('0x81'),'id')[_0x7c2c('0xb')](_0x7c2c('0x82'))[_0x7c2c('0x83')](_0x7c2c('0x84')+_0x1e61fe+'_interactions','ui')['where'](_0x7c2c('0x85'),_0x4bcef3['id']);return _0x237e4d[_0x7c2c('0x86')]['query'](_0x5baee8[_0x7c2c('0x87')](),_0x3c14af)['then'](function(_0x4dfd03){_0x4bcef3[_0x469515+_0x7c2c('0x88')]=_0x4dfd03;_0x5eb300(_0x4dfd03);})[_0x7c2c('0xa')](function(_0x2b4b31){_0x570cd3(_0x2b4b31);});});}return _0x380d13[_0x7c2c('0x89')](_0x7c2c('0x8a'),attributes,{'tableName':_0x7c2c('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2d4459){var _0x2a4de1={'raw':_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0x8d')],'where':{}};var _0xd01d59={};var _0x43949a={'count':0x0,'rows':[]};var _0xbe0568=_0x2d4459[_0x7c2c('0x8c')]['section'];var _0x1af153=_0x2d4459['query']['mergeResources']||![];var _0x4c0a69=_0x10c356(_0xbe0568,_0x1af153);if(!_0x4c0a69['childModel'])throw new Error(_0x7c2c('0x8e')+_0xbe0568+'\x27');var _0x34984b=[{'name':_0xbe0568}];if(!_[_0x7c2c('0x8f')](_0x4c0a69[_0x7c2c('0x17')]))_0x34984b=_0x4c0a69[_0x7c2c('0x17')];var _0x117f2a=[];for(var _0x59e46d=0x0;_0x59e46d<_0x34984b[_0x7c2c('0x90')];_0x59e46d++){_0x117f2a[_0x7c2c('0x91')](_0x237e4d[_0x7c2c('0x92')][_0x7c2c('0x93')]({'where':{'userProfileId':_0x2d4459[_0x7c2c('0x94')]['id'],'name':_0x34984b[_0x59e46d][_0x7c2c('0x34')]},'raw':!![]}));}return Promise['all'](_0x117f2a)[_0x7c2c('0x8')](function(_0x1935bf){var _0x49872b=_[_0x7c2c('0x5')](_0x1935bf,function(_0x304809){return _0x304809?_0x304809:undefined;});var _0x53e81e=_[_0x7c2c('0x5')](_0x34984b,[_0x7c2c('0x95'),!![]]);var _0x5605ef=_['isEmpty'](_0x49872b)&&_[_0x7c2c('0x8f')](_0x53e81e)?null:_['union'](_0x53e81e,_0x49872b);if(!_0x5605ef)return null;var _0x23bebd=[];for(var _0x4ee3ad=0x0;_0x4ee3ad<_0x5605ef[_0x7c2c('0x90')];_0x4ee3ad++){var _0x1e099f=_['find'](_0x34984b,function(_0x222362){return _0x5605ef[_0x4ee3ad]?_0x222362['name']===_0x5605ef[_0x4ee3ad][_0x7c2c('0x34')]:null;});if(_0x1e099f){if(_0x5605ef[_0x4ee3ad][_0x7c2c('0x95')]){_0x23bebd[_0x7c2c('0x91')](_0x116f8a(_0x4c0a69['childModel'],_0x5605ef[_0x4ee3ad]));}else{if(!_0x5605ef[_0x4ee3ad][_0x7c2c('0x96')]){_0x23bebd[_0x7c2c('0x91')](_0x5e55e0(_0x1e099f,_0x5605ef[_0x4ee3ad],_0x4c0a69[_0x7c2c('0x13')]));}else{if(_0x1e099f[_0x7c2c('0xc')]){_0x23bebd['push'](_0x1bfeaf(_0x1e099f,_0x5605ef[_0x4ee3ad]));}}}}}return Promise[_0x7c2c('0x97')](_0x23bebd);})[_0x7c2c('0x8')](function(_0x3e6d51){var _0x1d75ba=_0x3e6d51;var _0x418aba=null;if(_0x1d75ba){_0x418aba=_0x1d75ba[_0x7c2c('0x90')]===0x1?_0x1d75ba[0x0]:null;}if(!_0x418aba&&!_0x1d75ba)return _0x43949a;var _0x2423b3=_0x237e4d[_0x4c0a69[_0x7c2c('0x13')]][_0x7c2c('0x98')];_0xd01d59['model']=_[_0x7c2c('0x99')](_0x2423b3);_0xd01d59[_0x7c2c('0x8c')]=_['keys'](_0x2d4459[_0x7c2c('0x8c')]);_0xd01d59['filters']=_['intersection'](_0xd01d59[_0x7c2c('0xc')],_0xd01d59[_0x7c2c('0x8c')]);_0x2a4de1[_0x7c2c('0x9a')]=_['intersection'](_0xd01d59[_0x7c2c('0xc')],qs[_0x7c2c('0x9b')](_0x2d4459[_0x7c2c('0x8c')]['fields']));_0x2a4de1[_0x7c2c('0x9a')]=_0x2a4de1[_0x7c2c('0x9a')][_0x7c2c('0x90')]?_0x2a4de1[_0x7c2c('0x9a')]:_0xd01d59['model'];if(!_0x2d4459[_0x7c2c('0x8c')]['hasOwnProperty'](_0x7c2c('0x9c'))){_0x2a4de1['limit']=qs[_0x7c2c('0x9d')](_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0x9d')]);_0x2a4de1[_0x7c2c('0x9e')]=qs[_0x7c2c('0x9e')](_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0x9e')]);}_0x2a4de1['order']=qs[_0x7c2c('0x9f')](_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0x9f')]);_0x2a4de1[_0x7c2c('0xa0')]=qs[_0x7c2c('0xa1')](_[_0x7c2c('0xa2')](_0x2d4459[_0x7c2c('0x8c')],_0xd01d59[_0x7c2c('0xa1')]));if(_0x2d4459['query'][_0x7c2c('0x5')]){_0x2a4de1[_0x7c2c('0xa0')]=_[_0x7c2c('0xa3')](_0x2a4de1[_0x7c2c('0xa0')],{'$or':_[_0x7c2c('0x9')](_0x2423b3,function(_0x59931c){if(_0x59931c[_0x7c2c('0x10')][_0x7c2c('0xa4')]!=='VIRTUAL'){var _0x188339={};_0x188339[_0x59931c[_0x7c2c('0xb')]]={'$like':'%'+_0x2d4459['query'][_0x7c2c('0x5')]+'%'};return _0x188339;}})});}var _0x4ed2fc=[];var _0x197cac=null;var _0x303da4={};if(_0x418aba){_0x197cac=_[_0x7c2c('0x93')](_0x34984b,[_0x7c2c('0x34'),_0x418aba[_0x7c2c('0x34')]]);if(_0x197cac[_0x7c2c('0xb')]){_0x303da4={};if(_0x4c0a69[_0x7c2c('0x13')]==='AnalyticExtractedReport'){_0x303da4[_0x197cac[_0x7c2c('0xa5')]]=_[_0x7c2c('0x9')](_0x418aba['associatedResources'],'id');}else{_0x303da4[_0x197cac[_0x7c2c('0xa5')]]=_0x418aba[_0x7c2c('0xd')];}_0x4ed2fc[_0x7c2c('0x91')](_0x303da4);}else{_0x2a4de1[_0x7c2c('0xa0')]['id']=_0x418aba[_0x7c2c('0xd')];}}else{for(var _0x2f249d=0x0;_0x2f249d<_0x1d75ba[_0x7c2c('0x90')];_0x2f249d++){_0x197cac=_[_0x7c2c('0x93')](_0x34984b,[_0x7c2c('0x34'),_0x1d75ba[_0x2f249d][_0x7c2c('0x34')]]);if(_0x197cac[_0x7c2c('0xb')]){_0x303da4={};_0x303da4[_0x197cac[_0x7c2c('0xa5')]]=_0x1d75ba[_0x2f249d][_0x7c2c('0xd')];_0x4ed2fc[_0x7c2c('0x91')](_0x303da4);}else{if(!_0x2a4de1['where']['id'])_0x2a4de1[_0x7c2c('0xa0')]['id']=[];_0x1d75ba[_0x2f249d][_0x7c2c('0xd')]['forEach'](function(_0x29c103){_0x2a4de1[_0x7c2c('0xa0')]['id'][_0x7c2c('0x91')](_0x29c103);});}}}if(!_[_0x7c2c('0x8f')](_0x4ed2fc)){_0x2a4de1[_0x7c2c('0xa0')]=_['merge'](_0x2a4de1[_0x7c2c('0xa0')],{'$and':{'$or':_0x4ed2fc}});}_0x2a4de1=_[_0x7c2c('0xa3')]({},_0x2a4de1,_0x2d4459[_0x7c2c('0xa6')]);if(_0x418aba&&!_0x418aba['autoAssociation']&&_0x4c0a69[_0x7c2c('0x13')]===_0x7c2c('0xa7')){if(_0x2d4459[_0x7c2c('0x8c')]['includeAll']){_0x2a4de1[_0x7c2c('0xa8')]=[{'all':!![]}];}return _0x237e4d[_0x4c0a69['childModel']][_0x7c2c('0x7')](_0x2a4de1)['then'](function(_0x481479){var _0x1684db=[];_0x481479[_0x7c2c('0xa9')](function(_0x97011a){var _0x510a24;switch(_0x97011a[_0x7c2c('0xaa')]){case _0x7c2c('0xab'):_0x510a24=_[_0x7c2c('0x93')](_0x418aba[_0x7c2c('0xd')],function(_0x4d944d){return _0x4d944d['id']===_0x97011a[_0x7c2c('0xac')]&&_0x4d944d['type']==='DefaultReports';});break;case'custom':_0x510a24=_['find'](_0x418aba['associatedResources'],function(_0x3694b0){return _0x3694b0['id']===_0x97011a[_0x7c2c('0xac')]&&_0x3694b0[_0x7c2c('0x10')]===_0x7c2c('0xad');});break;}if(_0x510a24)_0x1684db[_0x7c2c('0x91')](_0x97011a);});_0x43949a['count']=_0x1684db[_0x7c2c('0x90')];_0x43949a[_0x7c2c('0xae')]=_0x1684db;return _0x43949a;});}else{if(!_[_0x7c2c('0x8f')](_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0xaf')])){_0x2a4de1[_0x7c2c('0xa0')]['id']=_0x2a4de1['where']['id']?_['intersection'](_0x2a4de1[_0x7c2c('0xa0')]['id'],_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0xaf')]):_0x2d4459[_0x7c2c('0x8c')]['ids'];}return _0x237e4d[_0x4c0a69[_0x7c2c('0x13')]][_0x7c2c('0xb0')]({'where':_0x2a4de1[_0x7c2c('0xa0')]})[_0x7c2c('0x8')](function(_0x249d47){_0x43949a[_0x7c2c('0xb0')]=_0x249d47;if(_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0xb1')]){if(_0x4c0a69[_0x7c2c('0x13')]==='CmContact'){_0x2a4de1[_0x7c2c('0xa8')]=[{'model':_0x237e4d[_0x7c2c('0x6e')],'as':'Tags','attributes':['id',_0x7c2c('0x34'),'color'],'required':_0x2d4459[_0x7c2c('0x8c')]['tag']?!![]:![]},{'model':_0x237e4d[_0x7c2c('0x6e')],'as':_0x7c2c('0xb2'),'attributes':['id',_0x7c2c('0x34'),_0x7c2c('0xb3')],'through':_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0xb4')]?{'attributes':[],'where':{'TagId':_0x2d4459[_0x7c2c('0x8c')][_0x7c2c('0xb4')]||undefined}}:{},'required':_0x2d4459[_0x7c2c('0x8c')]['tag']?!![]:![]}];}else{_0x2a4de1[_0x7c2c('0xa8')]=[{'all':!![]}];}}return _0x237e4d[_0x4c0a69[_0x7c2c('0x13')]][_0x7c2c('0x7')](_0x2a4de1);})['then'](function(_0x156754){_0x43949a[_0x7c2c('0xae')]=_0x156754;if(_0xbe0568==='Agents'&&_0x2d4459[_0x7c2c('0x8c')]['openTabs']===_0x7c2c('0xb5')){var _0x5c9e2c=[];for(var _0x6fb9dd=0x0;_0x6fb9dd<_0x43949a[_0x7c2c('0xae')][_0x7c2c('0x90')];_0x6fb9dd++){_0x5c9e2c[_0x7c2c('0x91')](_0x4ada7a('chat',_0x43949a[_0x7c2c('0xae')][_0x6fb9dd][_0x7c2c('0xb6')]));_0x5c9e2c[_0x7c2c('0x91')](_0x4ada7a(_0x7c2c('0xb7'),_0x43949a[_0x7c2c('0xae')][_0x6fb9dd][_0x7c2c('0xb6')]));_0x5c9e2c['push'](_0x4ada7a(_0x7c2c('0xb8'),_0x43949a['rows'][_0x6fb9dd][_0x7c2c('0xb6')]));_0x5c9e2c[_0x7c2c('0x91')](_0x4ada7a('mail',_0x43949a[_0x7c2c('0xae')][_0x6fb9dd][_0x7c2c('0xb6')]));_0x5c9e2c[_0x7c2c('0x91')](_0x4ada7a(_0x7c2c('0xb9'),_0x43949a[_0x7c2c('0xae')][_0x6fb9dd][_0x7c2c('0xb6')]));_0x5c9e2c['push'](_0x4ada7a('whatsapp',_0x43949a[_0x7c2c('0xae')][_0x6fb9dd][_0x7c2c('0xb6')]));}return Promise[_0x7c2c('0x97')](_0x5c9e2c)[_0x7c2c('0x8')](function(){return _0x43949a;});}return _0x43949a;});}});}}});}; \ No newline at end of file +var _0xb03e=['intervals','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','ignore','length','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','rows','ids','count','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','model','catch','resolve','UserProfileResource','then','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','name','projectName','JscriptyProject','CmContact','ListId','CmCompany','ChatQueue','chatwebsites','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','queuecampaigns','QueueCampaigns','users','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','User','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xb03e,0x1eb));var _0xeb03=function(_0x25d56e,_0x4ad9d4){_0x25d56e=_0x25d56e-0x0;var _0x2d68fc=_0xb03e[_0x25d56e];return _0x2d68fc;};'use strict';var _=require('lodash');var attributes=require(_0xeb03('0x0'));var qs=require(_0xeb03('0x1'));var squel=require(_0xeb03('0x2'));module[_0xeb03('0x3')]=function(_0x1c58b5){var _0x2db660=_0x1c58b5[_0xeb03('0x4')];function _0x1fe650(_0x474450,_0x3ba4b0){return new Promise(function(_0x88925b,_0xee2291){if(!_0x3ba4b0)return _0x88925b(null);var _0x4e1cea=_0x3ba4b0[_0xeb03('0x5')]?{[_0x3ba4b0[_0xeb03('0x5')][_0xeb03('0x6')]]:_0x3ba4b0[_0xeb03('0x5')][_0xeb03('0x7')]}:undefined;return _0x2db660[_0x474450][_0xeb03('0x8')]({'where':_0x4e1cea,'raw':!![]})['then'](function(_0x403b77){_0x3ba4b0[_0xeb03('0x9')]=_[_0xeb03('0xa')](_0x403b77,'id');_0x88925b(_0x3ba4b0);})['catch'](function(_0x31af2c){_0xee2291(_0x31af2c);});});}function _0x48af4f(_0x2388eb,_0x218c41){return new Promise(function(_0x3de728,_0x5e50ea){var _0x2cf152=_0x2388eb[_0xeb03('0x5')]?{[_0x2388eb[_0xeb03('0x5')][_0xeb03('0x6')]]:_0x2388eb[_0xeb03('0x5')][_0xeb03('0x7')]}:undefined;return _0x2db660[_0x2388eb[_0xeb03('0xb')]][_0xeb03('0x8')]({'where':_0x2cf152,'raw':!![]})['then'](function(_0x212082){_0x218c41[_0xeb03('0x9')]=_[_0xeb03('0xa')](_0x212082,function(_0x33f9ba){return _0x33f9ba['name'];});_0x3de728(_0x218c41);})[_0xeb03('0xc')](function(_0x36f5d8){_0x5e50ea(_0x36f5d8);});});}function _0x3f26ef(_0x478989,_0x7ce874,_0x46dd1b){if(!_0x7ce874)return Promise[_0xeb03('0xd')](null);return new Promise(function(_0x44716c,_0x42fa4e){return _0x2db660[_0xeb03('0xe')][_0xeb03('0x8')]({'where':{'sectionId':_0x7ce874['id']},'raw':!![]})[_0xeb03('0xf')](function(_0x177f9c){if(_0x478989[_0xeb03('0x6')]&&_0x478989[_0xeb03('0x6')]!=='id'){_0x7ce874[_0xeb03('0x9')]=_[_0xeb03('0xa')](_0x177f9c,function(_0x19bddf){return _0x19bddf[_0x478989['field']];});}else{if(_0x46dd1b===_0xeb03('0x10')){_0x7ce874[_0xeb03('0x9')]=_[_0xeb03('0xa')](_0x177f9c,function(_0x391729){return{'id':_0x391729[_0xeb03('0x11')],'type':_0x391729[_0xeb03('0x12')]};});}else{_0x7ce874[_0xeb03('0x9')]=_[_0xeb03('0xa')](_0x177f9c,function(_0x3c3d09){return _0x3c3d09['resourceId'];});}}_0x44716c(_0x7ce874);})[_0xeb03('0xc')](function(_0x1707ec){_0x42fa4e(_0x1707ec);});});}function _0x11ea85(_0x300dc0,_0x2f99e6){var _0x5dcda3={'parentSections':[]};switch(_0x300dc0[_0xeb03('0x13')]()){case _0xeb03('0x14'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x16');break;case _0xeb03('0x17'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x18');break;case _0xeb03('0x19'):_0x5dcda3[_0xeb03('0x15')]='SquareRecording';_0x5dcda3[_0xeb03('0x1a')]=[{'name':_0xeb03('0x1b'),'field':_0xeb03('0x1c'),'foreignKey':_0xeb03('0x1d')}];break;case'projects':_0x5dcda3['childModel']=_0xeb03('0x1e');break;case'contacts':_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x1f');_0x5dcda3[_0xeb03('0x1a')]=[{'name':'Lists','field':'id','foreignKey':_0xeb03('0x20')}];break;case'lists':_0x5dcda3['childModel']='CmList';break;case'companies':_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x21');break;case'globalcustomfields':_0x5dcda3['childModel']='CmCustomField';break;case'chatqueues':_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x22');break;case _0xeb03('0x23'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x24');break;case'faxqueues':_0x5dcda3[_0xeb03('0x15')]='FaxQueue';break;case _0xeb03('0x25'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x26');break;case _0xeb03('0x27'):case _0xeb03('0x28'):case _0xeb03('0x29'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x2a');break;case'contexts':_0x5dcda3[_0xeb03('0x15')]='VoiceContext';break;case _0xeb03('0x2b'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x2c');break;case _0xeb03('0x2d'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x2e');_0x5dcda3['parentSections']=[{'name':_0xeb03('0x2f'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':_0xeb03('0x30'),'value':[_0xeb03('0x31')]}},{'name':_0xeb03('0x32'),'field':_0xeb03('0x1c'),'foreignKey':_0xeb03('0x33'),'model':'User','filter':{'field':_0xeb03('0x30'),'value':[_0xeb03('0x34')]}},{'name':_0xeb03('0x35'),'field':'name','foreignKey':'queue','model':_0xeb03('0x36'),'filter':{'field':_0xeb03('0x12'),'value':[_0xeb03('0x37')]}},{'name':'QueueCampaigns','field':_0xeb03('0x1c'),'foreignKey':_0xeb03('0x38'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xeb03('0x39')]}}];break;case _0xeb03('0x3a'):_0x5dcda3['childModel']=_0xeb03('0x3b');break;case _0xeb03('0x3c'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x3d');break;case _0xeb03('0x3e'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x3f');break;case _0xeb03('0x40'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x41');break;case _0xeb03('0x42'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x43');break;case _0xeb03('0x44'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x45');break;case _0xeb03('0x46'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x47');break;case _0xeb03('0x48'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x49');break;case _0xeb03('0x4a'):_0x5dcda3['childModel']='OpenchannelAccount';break;case _0xeb03('0x4b'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x4c');break;case _0xeb03('0x4d'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x4e');break;case _0xeb03('0x4f'):_0x5dcda3[_0xeb03('0x15')]='WhatsappQueue';break;case _0xeb03('0x50'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x51');break;case _0xeb03('0x52'):_0x5dcda3[_0xeb03('0x15')]='Team';break;case'voicequeues':case _0xeb03('0x53'):_0x5dcda3['childModel']='VoiceQueue';if(_0x2f99e6){_0x5dcda3['parentSections']=[{'name':_0xeb03('0x35')},{'name':_0xeb03('0x54')}];}break;case _0xeb03('0x55'):case _0xeb03('0x56'):case _0xeb03('0x57'):_0x5dcda3[_0xeb03('0x15')]='User';if(_0x2f99e6){_0x5dcda3[_0xeb03('0x1a')]=[{'name':'Users','filter':{'field':'role','value':[_0xeb03('0x58'),_0xeb03('0x59')]},'ignore':!![]},{'name':_0xeb03('0x2f')},{'name':'Telephones'}];}break;case _0xeb03('0x5a'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x5b');break;case _0xeb03('0x5c'):_0x5dcda3[_0xeb03('0x15')]='SalesforceAccount';break;case _0xeb03('0x5d'):_0x5dcda3['childModel']=_0xeb03('0x5e');break;case _0xeb03('0x5f'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x60');break;case _0xeb03('0x61'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x62');break;case _0xeb03('0x63'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x64');break;case _0xeb03('0x65'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x66');break;case _0xeb03('0x67'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x68');break;case _0xeb03('0x69'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x6a');break;case _0xeb03('0x6b'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x6c');break;case _0xeb03('0x6d'):_0x5dcda3[_0xeb03('0x15')]='Interval';break;case _0xeb03('0x6e'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x6f');break;case'scheduler':_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x70');break;case _0xeb03('0x71'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x72');break;case _0xeb03('0x73'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x74');break;case _0xeb03('0x75'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x76');break;case _0xeb03('0x77'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x78');break;case'trunks':_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x79');break;case _0xeb03('0x7a'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x7b');break;case _0xeb03('0x7c'):_0x5dcda3[_0xeb03('0x15')]=_0xeb03('0x7d');break;case _0xeb03('0x7e'):_0x5dcda3[_0xeb03('0x15')]='AnalyticExtractedReport';_0x5dcda3[_0xeb03('0x1a')]=[{'name':_0xeb03('0x7f'),'field':'id','foreignKey':_0xeb03('0x80')}];break;case _0xeb03('0x81'):_0x5dcda3['childModel']=_0xeb03('0x82');break;}return _0x5dcda3;}function _0x68e1b7(_0x2130c2,_0x8a979){var _0x17a00f=_0x2130c2['charAt'](0x0)[_0xeb03('0x83')]()+_0x2130c2[_0xeb03('0x84')](0x1);var _0x28e488={'type':_0x2db660['Sequelize'][_0xeb03('0x85')][_0xeb03('0x86')],'raw':!![]};return new Promise(function(_0x4d9cfc,_0x1f6117){var _0x3102e3=squel[_0xeb03('0x87')]()['field'](_0xeb03('0x88')+_0x17a00f+_0xeb03('0x89'),'id')['field'](_0xeb03('0x8a'))[_0xeb03('0x8b')](_0xeb03('0x8c')+_0x2130c2+_0xeb03('0x8d'),'ui')[_0xeb03('0x8e')](_0xeb03('0x8f'),_0x8a979['id']);return _0x2db660[_0xeb03('0x90')][_0xeb03('0x91')](_0x3102e3['toString'](),_0x28e488)[_0xeb03('0xf')](function(_0x50489b){_0x8a979[_0x17a00f+_0xeb03('0x92')]=_0x50489b;_0x4d9cfc(_0x50489b);})[_0xeb03('0xc')](function(_0x3a9518){_0x1f6117(_0x3a9518);});});}return _0x1c58b5['define'](_0xeb03('0x93'),attributes,{'tableName':_0xeb03('0x94'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x14866f){var _0x467a9d={'raw':_0x14866f['query'][_0xeb03('0x95')],'where':{}};var _0x1cdf8e={};var _0x5db5c5={'count':0x0,'rows':[]};var _0x588f31=_0x14866f['query'][_0xeb03('0x96')];var _0x1ad3b7=_0x14866f[_0xeb03('0x91')][_0xeb03('0x97')]||![];var _0x3da5f4=_0x11ea85(_0x588f31,_0x1ad3b7);if(!_0x3da5f4[_0xeb03('0x15')])throw new Error(_0xeb03('0x98')+_0x588f31+'\x27');var _0x240178=[{'name':_0x588f31}];if(!_[_0xeb03('0x99')](_0x3da5f4['parentSections']))_0x240178=_0x3da5f4['parentSections'];var _0x43bc8f=[];for(var _0x352b6e=0x0;_0x352b6e<_0x240178['length'];_0x352b6e++){_0x43bc8f[_0xeb03('0x9a')](_0x2db660[_0xeb03('0x9b')][_0xeb03('0x9c')]({'where':{'userProfileId':_0x14866f[_0xeb03('0x9d')]['id'],'name':_0x240178[_0x352b6e]['name']},'raw':!![]}));}return Promise['all'](_0x43bc8f)[_0xeb03('0xf')](function(_0x3c404d){var _0x17f135=_[_0xeb03('0x5')](_0x3c404d,function(_0x34dd41){return _0x34dd41?_0x34dd41:undefined;});var _0x3fe121=_[_0xeb03('0x5')](_0x240178,[_0xeb03('0x9e'),!![]]);var _0x2e67a4=_[_0xeb03('0x99')](_0x17f135)&&_[_0xeb03('0x99')](_0x3fe121)?null:_['union'](_0x3fe121,_0x17f135);if(!_0x2e67a4)return null;var _0x5113fd=[];for(var _0x44b579=0x0;_0x44b579<_0x2e67a4['length'];_0x44b579++){var _0x1099ff=_['find'](_0x240178,function(_0x30623a){return _0x2e67a4[_0x44b579]?_0x30623a['name']===_0x2e67a4[_0x44b579][_0xeb03('0x1c')]:null;});if(_0x1099ff){if(_0x2e67a4[_0x44b579][_0xeb03('0x9e')]){_0x5113fd['push'](_0x1fe650(_0x3da5f4[_0xeb03('0x15')],_0x2e67a4[_0x44b579]));}else{if(!_0x2e67a4[_0x44b579]['autoAssociation']){_0x5113fd[_0xeb03('0x9a')](_0x3f26ef(_0x1099ff,_0x2e67a4[_0x44b579],_0x3da5f4['childModel']));}else{if(_0x1099ff[_0xeb03('0xb')]){_0x5113fd['push'](_0x48af4f(_0x1099ff,_0x2e67a4[_0x44b579]));}}}}}return Promise['all'](_0x5113fd);})[_0xeb03('0xf')](function(_0xee2fca){var _0x13db56=_0xee2fca;var _0x2d131e=null;if(_0x13db56){_0x2d131e=_0x13db56[_0xeb03('0x9f')]===0x1?_0x13db56[0x0]:null;}if(!_0x2d131e&&!_0x13db56)return _0x5db5c5;var _0x4666f4=_0x2db660[_0x3da5f4[_0xeb03('0x15')]]['rawAttributes'];_0x1cdf8e[_0xeb03('0xb')]=_[_0xeb03('0xa0')](_0x4666f4);_0x1cdf8e[_0xeb03('0x91')]=_[_0xeb03('0xa0')](_0x14866f[_0xeb03('0x91')]);_0x1cdf8e[_0xeb03('0xa1')]=_[_0xeb03('0xa2')](_0x1cdf8e['model'],_0x1cdf8e[_0xeb03('0x91')]);_0x467a9d[_0xeb03('0xa3')]=_[_0xeb03('0xa2')](_0x1cdf8e[_0xeb03('0xb')],qs[_0xeb03('0xa4')](_0x14866f[_0xeb03('0x91')][_0xeb03('0xa4')]));_0x467a9d[_0xeb03('0xa3')]=_0x467a9d['attributes'][_0xeb03('0x9f')]?_0x467a9d[_0xeb03('0xa3')]:_0x1cdf8e[_0xeb03('0xb')];if(!_0x14866f[_0xeb03('0x91')][_0xeb03('0xa5')]('nolimit')){_0x467a9d[_0xeb03('0xa6')]=qs[_0xeb03('0xa6')](_0x14866f[_0xeb03('0x91')][_0xeb03('0xa6')]);_0x467a9d[_0xeb03('0xa7')]=qs[_0xeb03('0xa7')](_0x14866f[_0xeb03('0x91')]['offset']);}_0x467a9d[_0xeb03('0xa8')]=qs[_0xeb03('0xa9')](_0x14866f[_0xeb03('0x91')][_0xeb03('0xa9')]);_0x467a9d[_0xeb03('0x8e')]=qs['filters'](_[_0xeb03('0xaa')](_0x14866f[_0xeb03('0x91')],_0x1cdf8e[_0xeb03('0xa1')]));if(_0x14866f[_0xeb03('0x91')][_0xeb03('0x5')]){_0x467a9d[_0xeb03('0x8e')]=_[_0xeb03('0xab')](_0x467a9d['where'],{'$or':_[_0xeb03('0xa')](_0x4666f4,function(_0xe517f9){if(_0xe517f9[_0xeb03('0x12')][_0xeb03('0xac')]!==_0xeb03('0xad')){var _0x388fbd={};_0x388fbd[_0xe517f9['field']]={'$like':'%'+_0x14866f[_0xeb03('0x91')][_0xeb03('0x5')]+'%'};return _0x388fbd;}})});}var _0x1c1181=[];var _0x48b6e9=null;var _0x349c15={};if(_0x2d131e){_0x48b6e9=_[_0xeb03('0x9c')](_0x240178,[_0xeb03('0x1c'),_0x2d131e[_0xeb03('0x1c')]]);if(_0x48b6e9[_0xeb03('0x6')]){_0x349c15={};if(_0x3da5f4[_0xeb03('0x15')]===_0xeb03('0x10')){_0x349c15[_0x48b6e9['foreignKey']]=_['map'](_0x2d131e[_0xeb03('0x9')],'id');}else{_0x349c15[_0x48b6e9[_0xeb03('0xae')]]=_0x2d131e[_0xeb03('0x9')];}_0x1c1181[_0xeb03('0x9a')](_0x349c15);}else{_0x467a9d['where']['id']=_0x2d131e[_0xeb03('0x9')];}}else{for(var _0x42c477=0x0;_0x42c477<_0x13db56['length'];_0x42c477++){_0x48b6e9=_[_0xeb03('0x9c')](_0x240178,[_0xeb03('0x1c'),_0x13db56[_0x42c477][_0xeb03('0x1c')]]);if(_0x48b6e9[_0xeb03('0x6')]){_0x349c15={};_0x349c15[_0x48b6e9[_0xeb03('0xae')]]=_0x13db56[_0x42c477][_0xeb03('0x9')];_0x1c1181['push'](_0x349c15);}else{if(!_0x467a9d[_0xeb03('0x8e')]['id'])_0x467a9d[_0xeb03('0x8e')]['id']=[];_0x13db56[_0x42c477][_0xeb03('0x9')][_0xeb03('0xaf')](function(_0xe2c7f7){_0x467a9d[_0xeb03('0x8e')]['id'][_0xeb03('0x9a')](_0xe2c7f7);});}}}if(!_[_0xeb03('0x99')](_0x1c1181)){_0x467a9d[_0xeb03('0x8e')]=_[_0xeb03('0xab')](_0x467a9d['where'],{'$and':{'$or':_0x1c1181}});}_0x467a9d=_[_0xeb03('0xab')]({},_0x467a9d,_0x14866f[_0xeb03('0xb0')]);if(_0x2d131e&&!_0x2d131e['autoAssociation']&&_0x3da5f4[_0xeb03('0x15')]===_0xeb03('0x10')){if(_0x14866f['query'][_0xeb03('0xb1')]){_0x467a9d[_0xeb03('0xb2')]=[{'all':!![]}];}return _0x2db660[_0x3da5f4[_0xeb03('0x15')]][_0xeb03('0x8')](_0x467a9d)[_0xeb03('0xf')](function(_0x501a3b){var _0x4d2a43=[];_0x501a3b['forEach'](function(_0x3cead5){var _0x4d7e0f;switch(_0x3cead5[_0xeb03('0xb3')]){case _0xeb03('0xb4'):_0x4d7e0f=_[_0xeb03('0x9c')](_0x2d131e[_0xeb03('0x9')],function(_0x294446){return _0x294446['id']===_0x3cead5[_0xeb03('0x80')]&&_0x294446[_0xeb03('0x12')]===_0xeb03('0xb5');});break;case _0xeb03('0xb6'):_0x4d7e0f=_[_0xeb03('0x9c')](_0x2d131e[_0xeb03('0x9')],function(_0x27a388){return _0x27a388['id']===_0x3cead5['reportId']&&_0x27a388['type']===_0xeb03('0xb7');});break;}if(_0x4d7e0f)_0x4d2a43['push'](_0x3cead5);});_0x5db5c5['count']=_0x4d2a43[_0xeb03('0x9f')];_0x5db5c5[_0xeb03('0xb8')]=_0x4d2a43;return _0x5db5c5;});}else{if(!_['isEmpty'](_0x14866f['query'][_0xeb03('0xb9')])){_0x467a9d[_0xeb03('0x8e')]['id']=_0x467a9d['where']['id']?_[_0xeb03('0xa2')](_0x467a9d[_0xeb03('0x8e')]['id'],_0x14866f[_0xeb03('0x91')][_0xeb03('0xb9')]):_0x14866f[_0xeb03('0x91')]['ids'];}return _0x2db660[_0x3da5f4[_0xeb03('0x15')]]['count']({'where':_0x467a9d['where']})[_0xeb03('0xf')](function(_0x2d12eb){_0x5db5c5[_0xeb03('0xba')]=_0x2d12eb;if(_0x14866f[_0xeb03('0x91')]['includeAll']){if(_0x3da5f4['childModel']===_0xeb03('0x1f')){_0x467a9d[_0xeb03('0xb2')]=[{'model':_0x2db660[_0xeb03('0x74')],'as':_0xeb03('0xbb'),'attributes':['id',_0xeb03('0x1c'),_0xeb03('0xbc')],'required':_0x14866f[_0xeb03('0x91')][_0xeb03('0xbd')]?!![]:![]},{'model':_0x2db660['Tag'],'as':'ThroughTags','attributes':['id',_0xeb03('0x1c'),'color'],'through':_0x14866f[_0xeb03('0x91')]['tag']?{'attributes':[],'where':{'TagId':_0x14866f[_0xeb03('0x91')][_0xeb03('0xbd')]||undefined}}:{},'required':_0x14866f[_0xeb03('0x91')][_0xeb03('0xbd')]?!![]:![]}];}else{_0x467a9d[_0xeb03('0xb2')]=[{'all':!![]}];}}return _0x2db660[_0x3da5f4[_0xeb03('0x15')]][_0xeb03('0x8')](_0x467a9d);})[_0xeb03('0xf')](function(_0x4a65c6){_0x5db5c5['rows']=_0x4a65c6;if(_0x588f31===_0xeb03('0x2f')&&_0x14866f[_0xeb03('0x91')][_0xeb03('0xbe')]===_0xeb03('0xbf')){var _0x3b9daa=[];for(var _0x514513=0x0;_0x514513<_0x5db5c5[_0xeb03('0xb8')][_0xeb03('0x9f')];_0x514513++){_0x3b9daa['push'](_0x68e1b7(_0xeb03('0xc0'),_0x5db5c5[_0xeb03('0xb8')][_0x514513][_0xeb03('0xc1')]));_0x3b9daa[_0xeb03('0x9a')](_0x68e1b7(_0xeb03('0xc2'),_0x5db5c5[_0xeb03('0xb8')][_0x514513][_0xeb03('0xc1')]));_0x3b9daa[_0xeb03('0x9a')](_0x68e1b7(_0xeb03('0xc3'),_0x5db5c5[_0xeb03('0xb8')][_0x514513][_0xeb03('0xc1')]));_0x3b9daa[_0xeb03('0x9a')](_0x68e1b7(_0xeb03('0xc4'),_0x5db5c5[_0xeb03('0xb8')][_0x514513]['dataValues']));_0x3b9daa[_0xeb03('0x9a')](_0x68e1b7(_0xeb03('0xc5'),_0x5db5c5['rows'][_0x514513][_0xeb03('0xc1')]));_0x3b9daa['push'](_0x68e1b7(_0xeb03('0xc6'),_0x5db5c5['rows'][_0x514513][_0xeb03('0xc1')]));}return Promise[_0xeb03('0xc7')](_0x3b9daa)[_0xeb03('0xf')](function(){return _0x5db5c5;});}return _0x5db5c5;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index de25ca2..a59b6cf 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 _0x4cff=['stringify','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x28705b,_0x193996){var _0x475a2d=function(_0x3b61d8){while(--_0x3b61d8){_0x28705b['push'](_0x28705b['shift']());}};_0x475a2d(++_0x193996);}(_0x4cff,0x14a));var _0xf4cf=function(_0x292b51,_0x3a0d77){_0x292b51=_0x292b51-0x0;var _0x59f7d3=_0x4cff[_0x292b51];return _0x59f7d3;};'use strict';var _=require(_0xf4cf('0x0'));var util=require(_0xf4cf('0x1'));var moment=require('moment');var BPromise=require(_0xf4cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4cf('0x3'));var db=require(_0xf4cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4cf('0x5'))(_0xf4cf('0x6'));var config=require(_0xf4cf('0x7'));var jayson=require(_0xf4cf('0x8'));var client=jayson[_0xf4cf('0x9')][_0xf4cf('0xa')]({'port':0x232a});config['redis']=_[_0xf4cf('0xb')](config[_0xf4cf('0xc')],{'host':_0xf4cf('0xd'),'port':0x18eb});var socket=require(_0xf4cf('0xe'))(new Redis(config['redis']));require(_0xf4cf('0xf'))[_0xf4cf('0x10')](socket);function respondWithRpcPromise(_0x10dd9e,_0x16a6f1,_0x520c03){return new BPromise(function(_0x3c40ab,_0xec3042){return client[_0xf4cf('0x11')](_0x10dd9e,_0x520c03)[_0xf4cf('0x12')](function(_0x50f939){logger['info'](_0xf4cf('0x13'),_0x16a6f1,'request\x20sent');logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x16a6f1,_0xf4cf('0x14'),JSON[_0xf4cf('0x15')](_0x50f939));if(_0x50f939[_0xf4cf('0x16')]){if(_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x17')]===0x1f4){logger[_0xf4cf('0x16')](_0xf4cf('0x13'),_0x16a6f1,_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x18')]);return _0xec3042(_0x50f939[_0xf4cf('0x16')]['message']);}logger[_0xf4cf('0x16')](_0xf4cf('0x13'),_0x16a6f1,_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x18')]);return _0x3c40ab(_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x18')]);}else{logger[_0xf4cf('0x19')]('UserProfile,\x20%s,\x20%s',_0x16a6f1,_0xf4cf('0x14'));_0x3c40ab(_0x50f939[_0xf4cf('0x1a')][_0xf4cf('0x18')]);}})['catch'](function(_0x23f181){logger['error'](_0xf4cf('0x13'),_0x16a6f1,_0x23f181);_0xec3042(_0x23f181);});});} \ No newline at end of file +var _0x2525=['socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x784aca,_0x4be662){var _0x3357f3=function(_0x32974e){while(--_0x32974e){_0x784aca['push'](_0x784aca['shift']());}};_0x3357f3(++_0x4be662);}(_0x2525,0x1f0));var _0x5252=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x2525[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x5252('0x0'));var util=require(_0x5252('0x1'));var moment=require(_0x5252('0x2'));var BPromise=require(_0x5252('0x3'));var rs=require(_0x5252('0x4'));var fs=require('fs');var Redis=require(_0x5252('0x5'));var db=require(_0x5252('0x6'))['db'];var utils=require(_0x5252('0x7'));var logger=require(_0x5252('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5252('0x9'));var client=jayson[_0x5252('0xa')][_0x5252('0xb')]({'port':0x232a});config[_0x5252('0xc')]=_[_0x5252('0xd')](config[_0x5252('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5252('0xe'))(new Redis(config['redis']));require(_0x5252('0xf'))[_0x5252('0x10')](socket);function respondWithRpcPromise(_0x4aee12,_0x52356d,_0xbe2997){return new BPromise(function(_0x5289ce,_0x3949d4){return client[_0x5252('0x11')](_0x4aee12,_0xbe2997)[_0x5252('0x12')](function(_0x1a1de4){logger[_0x5252('0x13')](_0x5252('0x14'),_0x52356d,_0x5252('0x15'));logger[_0x5252('0x16')](_0x5252('0x17'),_0x52356d,_0x5252('0x15'),JSON[_0x5252('0x18')](_0x1a1de4));if(_0x1a1de4[_0x5252('0x19')]){if(_0x1a1de4[_0x5252('0x19')][_0x5252('0x1a')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x52356d,_0x1a1de4[_0x5252('0x19')][_0x5252('0x1b')]);return _0x3949d4(_0x1a1de4[_0x5252('0x19')][_0x5252('0x1b')]);}logger[_0x5252('0x19')](_0x5252('0x14'),_0x52356d,_0x1a1de4[_0x5252('0x19')]['message']);return _0x5289ce(_0x1a1de4['error']['message']);}else{logger[_0x5252('0x13')](_0x5252('0x14'),_0x52356d,_0x5252('0x15'));_0x5289ce(_0x1a1de4[_0x5252('0x1c')][_0x5252('0x1b')]);}})[_0x5252('0x1d')](function(_0x3f8983){logger['error'](_0x5252('0x14'),_0x52356d,_0x3f8983);_0x3949d4(_0x3f8983);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3e633b7..fa04132 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 _0xd6ac=['./userProfile.events','save','update','removeListener','register'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xd6ac,0x8c));var _0xcd6a=function(_0x176846,_0x4bc17c){_0x176846=_0x176846-0x0;var _0x1cff6b=_0xd6ac[_0x176846];return _0x1cff6b;};'use strict';var UserProfileEvents=require(_0xcd6a('0x0'));var events=[_0xcd6a('0x1'),'remove',_0xcd6a('0x2')];function createListener(_0x31e2e2,_0x3d1085){return function(_0x18281b){_0x3d1085['emit'](_0x31e2e2,_0x18281b);};}function removeListener(_0x15e47d,_0x54a2cc){return function(){UserProfileEvents[_0xcd6a('0x3')](_0x15e47d,_0x54a2cc);};}exports[_0xcd6a('0x4')]=function(_0x1affab){for(var _0x266098=0x0,_0x148856=events['length'];_0x266098<_0x148856;_0x266098++){var _0xfe275b=events[_0x266098];var _0x91b09c=createListener('userProfile:'+_0xfe275b,_0x1affab);UserProfileEvents['on'](_0xfe275b,_0x91b09c);}}; \ No newline at end of file +var _0xfe7a=['update','emit','removeListener','register','length','userProfile:','./userProfile.events','remove'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0xfe7a,0x1ae));var _0xafe7=function(_0x58c56a,_0x40d9e4){_0x58c56a=_0x58c56a-0x0;var _0x4f83d0=_0xfe7a[_0x58c56a];return _0x4f83d0;};'use strict';var UserProfileEvents=require(_0xafe7('0x0'));var events=['save',_0xafe7('0x1'),_0xafe7('0x2')];function createListener(_0x141f8d,_0xcd109a){return function(_0x198dd0){_0xcd109a[_0xafe7('0x3')](_0x141f8d,_0x198dd0);};}function removeListener(_0x1bb509,_0x2ef8d9){return function(){UserProfileEvents[_0xafe7('0x4')](_0x1bb509,_0x2ef8d9);};}exports[_0xafe7('0x5')]=function(_0x48e1cf){for(var _0x512651=0x0,_0x4b151a=events[_0xafe7('0x6')];_0x512651<_0x4b151a;_0x512651++){var _0x5b8fea=events[_0x512651];var _0x2d97f6=createListener(_0xafe7('0x7')+_0x5b8fea,_0x48e1cf);UserProfileEvents['on'](_0x5b8fea,_0x2d97f6);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index ea3d010..9240683 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 _0x9be6=['./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x3b74e5,_0x1ee475){var _0x427499=function(_0x5d6ebc){while(--_0x5d6ebc){_0x3b74e5['push'](_0x3b74e5['shift']());}};_0x427499(++_0x1ee475);}(_0x9be6,0x7f));var _0x69be=function(_0xa53954,_0x49e68f){_0xa53954=_0xa53954-0x0;var _0x2ff1f4=_0x9be6[_0xa53954];return _0x2ff1f4;};'use strict';var multer=require(_0x69be('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x69be('0x1'));var express=require(_0x69be('0x2'));var router=express[_0x69be('0x3')]();var fs_extra=require(_0x69be('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x69be('0x5'));var controller=require(_0x69be('0x6'));router[_0x69be('0x7')]('/',auth[_0x69be('0x8')](),controller[_0x69be('0x9')]);router[_0x69be('0x7')](_0x69be('0xa'),auth['isAuthenticated'](),controller[_0x69be('0xb')]);router[_0x69be('0x7')](_0x69be('0xc'),auth['isAuthenticated'](),controller[_0x69be('0xd')]);router[_0x69be('0xe')]('/',auth[_0x69be('0x8')](),controller[_0x69be('0xf')]);router['put'](_0x69be('0xc'),auth[_0x69be('0x8')](),controller[_0x69be('0x10')]);router[_0x69be('0x11')](_0x69be('0xc'),auth[_0x69be('0x8')](),controller[_0x69be('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb726=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','delete'];(function(_0x3a5477,_0x16b6f3){var _0x1bedbd=function(_0x31b975){while(--_0x31b975){_0x3a5477['push'](_0x3a5477['shift']());}};_0x1bedbd(++_0x16b6f3);}(_0xb726,0x182));var _0x6b72=function(_0x2ec3a7,_0x1d5993){_0x2ec3a7=_0x2ec3a7-0x0;var _0x507f82=_0xb726[_0x2ec3a7];return _0x507f82;};'use strict';var multer=require(_0x6b72('0x0'));var util=require(_0x6b72('0x1'));var path=require(_0x6b72('0x2'));var timeout=require(_0x6b72('0x3'));var express=require('express');var router=express[_0x6b72('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b72('0x6'));var controller=require('./userProfileResource.controller');router[_0x6b72('0x7')]('/',auth[_0x6b72('0x8')](),controller[_0x6b72('0x9')]);router['get']('/describe',auth[_0x6b72('0x8')](),controller['describe']);router['get'](_0x6b72('0xa'),auth[_0x6b72('0x8')](),controller[_0x6b72('0xb')]);router[_0x6b72('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x6b72('0x8')](),controller['update']);router[_0x6b72('0xd')](_0x6b72('0xa'),auth['isAuthenticated'](),controller[_0x6b72('0xe')]);module[_0x6b72('0xf')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5a91331..996379f 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 _0xea03=['INTEGER','STRING'];(function(_0x38d697,_0x2d0fb6){var _0x112f82=function(_0x21e908){while(--_0x21e908){_0x38d697['push'](_0x38d697['shift']());}};_0x112f82(++_0x2d0fb6);}(_0xea03,0x8d));var _0x3ea0=function(_0x3a8697,_0x4e39e8){_0x3a8697=_0x3a8697-0x0;var _0xa4c873=_0xea03[_0x3a8697];return _0xa4c873;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3ea0('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3ea0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3ea0('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x4e73=['exports','STRING','sequelize'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x4e73,0x15e));var _0x34e7=function(_0x45da98,_0x592f5c){_0x45da98=_0x45da98-0x0;var _0x5e97e6=_0x4e73[_0x45da98];return _0x5e97e6;};'use strict';var Sequelize=require(_0x34e7('0x0'));module[_0x34e7('0x1')]={'name':{'type':Sequelize[_0x34e7('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x34e7('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 480f3e2..40563e8 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 _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x477024,_0x1dd691){_0x477024=_0x477024-0x0;var _0x3b2434=_0x5f2f[_0x477024];return _0x3b2434;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));}; \ No newline at end of file +var _0xc4aa=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));};exports[_0xac4a('0x4c')]=function(_0x26e716,_0x3ac36e){return db['UserProfileResource'][_0xac4a('0x4c')]()[_0xac4a('0x24')](respondWithResult(_0x3ac36e,null))[_0xac4a('0x44')](handleError(_0x3ac36e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4732c0b..f9947c8 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 _0x1534=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash'];(function(_0x58adf9,_0x5071de){var _0x25fc4b=function(_0x2e7e44){while(--_0x2e7e44){_0x58adf9['push'](_0x58adf9['shift']());}};_0x25fc4b(++_0x5071de);}(_0x1534,0x1ed));var _0x4153=function(_0x5cedbc,_0x48fc4d){_0x5cedbc=_0x5cedbc-0x0;var _0x5d73a0=_0x1534[_0x5cedbc];return _0x5d73a0;};'use strict';var _=require(_0x4153('0x0'));var util=require('util');var logger=require(_0x4153('0x1'))(_0x4153('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4153('0x3'));var fs=require('fs');var path=require(_0x4153('0x4'));var rimraf=require(_0x4153('0x5'));var config=require(_0x4153('0x6'));var attributes=require(_0x4153('0x7'));module['exports']=function(_0x46c877,_0x343c1f){return _0x46c877[_0x4153('0x8')](_0x4153('0x9'),attributes,{'tableName':_0x4153('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4153('0xb'),_0x4153('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb804=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','sectionId'];(function(_0x4f1d4b,_0x280a8e){var _0xbff8df=function(_0x540d49){while(--_0x540d49){_0x4f1d4b['push'](_0x4f1d4b['shift']());}};_0xbff8df(++_0x280a8e);}(_0xb804,0x150));var _0x4b80=function(_0x469b7d,_0x4760f8){_0x469b7d=_0x469b7d-0x0;var _0xc78a4b=_0xb804[_0x469b7d];return _0xc78a4b;};'use strict';var _=require(_0x4b80('0x0'));var util=require(_0x4b80('0x1'));var logger=require(_0x4b80('0x2'))(_0x4b80('0x3'));var moment=require('moment');var BPromise=require(_0x4b80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4b80('0x5'));var config=require(_0x4b80('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x4b80('0x7')]=function(_0x2c6ccd,_0x515801){return _0x2c6ccd[_0x4b80('0x8')](_0x4b80('0x9'),attributes,{'tableName':_0x4b80('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x4b80('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 3ba5a89..7bed8b7 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 _0xb35f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb35f,0xe7));var _0xfb35=function(_0x3ed805,_0x523ef9){_0x3ed805=_0x3ed805-0x0;var _0x3a066a=_0xb35f[_0x3ed805];return _0x3a066a;};'use strict';var _=require(_0xfb35('0x0'));var util=require('util');var moment=require(_0xfb35('0x1'));var BPromise=require(_0xfb35('0x2'));var rs=require(_0xfb35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb35('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb35('0x5'))(_0xfb35('0x6'));var config=require(_0xfb35('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfb35('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc31006,_0x11db17,_0x3d0338){return new BPromise(function(_0x108651,_0x248d0a){return client[_0xfb35('0x9')](_0xc31006,_0x3d0338)[_0xfb35('0xa')](function(_0x9d39eb){logger[_0xfb35('0xb')](_0xfb35('0xc'),_0x11db17,'request\x20sent');logger['debug'](_0xfb35('0xd'),_0x11db17,_0xfb35('0xe'),JSON[_0xfb35('0xf')](_0x9d39eb));if(_0x9d39eb[_0xfb35('0x10')]){if(_0x9d39eb[_0xfb35('0x10')][_0xfb35('0x11')]===0x1f4){logger[_0xfb35('0x10')](_0xfb35('0xc'),_0x11db17,_0x9d39eb[_0xfb35('0x10')][_0xfb35('0x12')]);return _0x248d0a(_0x9d39eb[_0xfb35('0x10')][_0xfb35('0x12')]);}logger[_0xfb35('0x10')](_0xfb35('0xc'),_0x11db17,_0x9d39eb[_0xfb35('0x10')][_0xfb35('0x12')]);return _0x108651(_0x9d39eb['error'][_0xfb35('0x12')]);}else{logger[_0xfb35('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x11db17,_0xfb35('0xe'));_0x108651(_0x9d39eb[_0xfb35('0x13')][_0xfb35('0x12')]);}})[_0xfb35('0x14')](function(_0x10bedc){logger['error'](_0xfb35('0xc'),_0x11db17,_0x10bedc);_0x248d0a(_0x10bedc);});});} \ No newline at end of file +var _0x2299=['UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x40d67d,_0x1e4228){var _0x5f0edd=function(_0x3bc34f){while(--_0x3bc34f){_0x40d67d['push'](_0x40d67d['shift']());}};_0x5f0edd(++_0x1e4228);}(_0x2299,0x1a2));var _0x9229=function(_0x80d369,_0x1155fd){_0x80d369=_0x80d369-0x0;var _0xd5ef89=_0x2299[_0x80d369];return _0xd5ef89;};'use strict';var _=require(_0x9229('0x0'));var util=require(_0x9229('0x1'));var moment=require(_0x9229('0x2'));var BPromise=require(_0x9229('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9229('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9229('0x5'));var logger=require(_0x9229('0x6'))(_0x9229('0x7'));var config=require(_0x9229('0x8'));var jayson=require(_0x9229('0x9'));var client=jayson[_0x9229('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x192e72,_0x4ab88c,_0x3a800e){return new BPromise(function(_0x2466c5,_0x219ead){return client['request'](_0x192e72,_0x3a800e)[_0x9229('0xb')](function(_0x3b2380){logger[_0x9229('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x4ab88c,'request\x20sent');logger[_0x9229('0xd')](_0x9229('0xe'),_0x4ab88c,_0x9229('0xf'),JSON[_0x9229('0x10')](_0x3b2380));if(_0x3b2380[_0x9229('0x11')]){if(_0x3b2380[_0x9229('0x11')][_0x9229('0x12')]===0x1f4){logger[_0x9229('0x11')](_0x9229('0x13'),_0x4ab88c,_0x3b2380['error'][_0x9229('0x14')]);return _0x219ead(_0x3b2380['error'][_0x9229('0x14')]);}logger['error'](_0x9229('0x13'),_0x4ab88c,_0x3b2380[_0x9229('0x11')][_0x9229('0x14')]);return _0x2466c5(_0x3b2380[_0x9229('0x11')][_0x9229('0x14')]);}else{logger[_0x9229('0xc')](_0x9229('0x13'),_0x4ab88c,_0x9229('0xf'));_0x2466c5(_0x3b2380[_0x9229('0x15')][_0x9229('0x14')]);}})[_0x9229('0x16')](function(_0x56eff6){logger[_0x9229('0x11')](_0x9229('0x13'),_0x4ab88c,_0x56eff6);_0x219ead(_0x56eff6);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 5a43fae..6920392 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 _0x8019=['create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0x8019,0xca));var _0x9801=function(_0x3e5a9e,_0x19a237){_0x3e5a9e=_0x3e5a9e-0x0;var _0x195044=_0x8019[_0x3e5a9e];return _0x195044;};'use strict';var multer=require(_0x9801('0x0'));var util=require(_0x9801('0x1'));var path=require('path');var timeout=require(_0x9801('0x2'));var express=require(_0x9801('0x3'));var router=express[_0x9801('0x4')]();var fs_extra=require(_0x9801('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9801('0x6'));var config=require(_0x9801('0x7'));var controller=require(_0x9801('0x8'));router[_0x9801('0x9')]('/',auth[_0x9801('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9801('0xb')]);router['get'](_0x9801('0xc'),auth[_0x9801('0xa')](),controller[_0x9801('0xd')]);router['post']('/',auth[_0x9801('0xa')](),controller[_0x9801('0xe')]);router[_0x9801('0xf')](_0x9801('0xc'),auth[_0x9801('0xa')](),controller['update']);router['delete']('/:id',auth[_0x9801('0xa')](),controller[_0x9801('0x10')]);module[_0x9801('0x11')]=router; \ No newline at end of file +var _0x6b81=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x389b28,_0x59bd1d){var _0x34ff43=function(_0x3312c1){while(--_0x3312c1){_0x389b28['push'](_0x389b28['shift']());}};_0x34ff43(++_0x59bd1d);}(_0x6b81,0x15c));var _0x16b8=function(_0xbd70e0,_0x193932){_0xbd70e0=_0xbd70e0-0x0;var _0x2f1f32=_0x6b81[_0xbd70e0];return _0x2f1f32;};'use strict';var multer=require(_0x16b8('0x0'));var util=require(_0x16b8('0x1'));var path=require(_0x16b8('0x2'));var timeout=require(_0x16b8('0x3'));var express=require('express');var router=express[_0x16b8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x16b8('0x5'));var config=require(_0x16b8('0x6'));var controller=require(_0x16b8('0x7'));router[_0x16b8('0x8')]('/',auth[_0x16b8('0x9')](),controller[_0x16b8('0xa')]);router[_0x16b8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x16b8('0xb')]);router[_0x16b8('0x8')](_0x16b8('0xc'),auth[_0x16b8('0x9')](),controller['show']);router[_0x16b8('0xd')]('/',auth[_0x16b8('0x9')](),controller[_0x16b8('0xe')]);router['put'](_0x16b8('0xc'),auth[_0x16b8('0x9')](),controller[_0x16b8('0xf')]);router[_0x16b8('0x10')](_0x16b8('0xc'),auth[_0x16b8('0x9')](),controller[_0x16b8('0x11')]);module[_0x16b8('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 b5baeef..f331d0f 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 _0xe2cf=['crudPermissions','join','getDataValue','exports','STRING','BOOLEAN'];(function(_0x25efeb,_0x2774f9){var _0x14977d=function(_0x4d4925){while(--_0x4d4925){_0x25efeb['push'](_0x25efeb['shift']());}};_0x14977d(++_0x2774f9);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x539386,_0x4cbc27){_0x539386=_0x539386-0x0;var _0x3d370c=_0xe2cf[_0x539386];return _0x3d370c;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xfe2c('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xfe2c('0x1')],'set':function(_0x11b6b8){this['setDataValue'](_0xfe2c('0x3'),_0x11b6b8?_0x11b6b8[_0xfe2c('0x4')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xfe2c('0x5')](_0xfe2c('0x3'))['split'](''):[];}}}; \ No newline at end of file +var _0xc900=['join','getDataValue','split','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc900,0xb3));var _0x0c90=function(_0x16c192,_0x5372a4){_0x16c192=_0x16c192-0x0;var _0x447328=_0xc900[_0x16c192];return _0x447328;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0c90('0x1')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0c90('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0c90('0x0')],'set':function(_0x492f22){this[_0x0c90('0x3')](_0x0c90('0x4'),_0x492f22?_0x492f22[_0x0c90('0x5')](''):[]);},'get':function(){return this[_0x0c90('0x6')](_0x0c90('0x4'))?this[_0x0c90('0x6')]('crudPermissions')[_0x0c90('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6275df1..c725806 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 _0xbd31=['then','error','stack','name','send','map','UserProfileSection','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','findAll','catch','show','params','keys','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','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','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbd31,0xbd));var _0x1bd3=function(_0x508d2c,_0x2ec338){_0x508d2c=_0x508d2c-0x0;var _0x271d0e=_0xbd31[_0x508d2c];return _0x271d0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bd3('0x0'));var zipdir=require(_0x1bd3('0x1'));var jsonpatch=require(_0x1bd3('0x2'));var rp=require(_0x1bd3('0x3'));var moment=require(_0x1bd3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1bd3('0x5'));var util=require(_0x1bd3('0x6'));var path=require('path');var sox=require(_0x1bd3('0x7'));var csv=require(_0x1bd3('0x8'));var ejs=require(_0x1bd3('0x9'));var fs=require('fs');var fs_extra=require(_0x1bd3('0xa'));var _=require(_0x1bd3('0xb'));var squel=require(_0x1bd3('0xc'));var crypto=require(_0x1bd3('0xd'));var jsforce=require(_0x1bd3('0xe'));var deskjs=require(_0x1bd3('0xf'));var toCsv=require(_0x1bd3('0x8'));var querystring=require(_0x1bd3('0x10'));var Papa=require('papaparse');var Redis=require(_0x1bd3('0x11'));var authService=require(_0x1bd3('0x12'));var qs=require(_0x1bd3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1bd3('0x14'));var logger=require(_0x1bd3('0x15'))(_0x1bd3('0x16'));var utils=require(_0x1bd3('0x17'));var config=require(_0x1bd3('0x18'));var licenseUtil=require(_0x1bd3('0x19'));var db=require(_0x1bd3('0x1a'))['db'];function respondWithStatusCode(_0x5600cf,_0x245390){_0x245390=_0x245390||0xcc;return function(_0x1b1a18){if(_0x1b1a18){return _0x5600cf[_0x1bd3('0x1b')](_0x245390);}return _0x5600cf[_0x1bd3('0x1c')](_0x245390)[_0x1bd3('0x1d')]();};}function respondWithResult(_0x3fda25,_0x27763f){_0x27763f=_0x27763f||0xc8;return function(_0x54f918){if(_0x54f918){return _0x3fda25[_0x1bd3('0x1c')](_0x27763f)['json'](_0x54f918);}};}function respondWithFilteredResult(_0x4a222d,_0x37fb01){return function(_0x446972){if(_0x446972){var _0x5f448d=typeof _0x37fb01[_0x1bd3('0x1e')]===_0x1bd3('0x1f')&&typeof _0x37fb01[_0x1bd3('0x20')]==='undefined';var _0xaefda8=_0x446972['count'];var _0x4188e5=_0x5f448d?0x0:_0x37fb01[_0x1bd3('0x1e')];var _0x38ce93=_0x5f448d?_0x446972[_0x1bd3('0x21')]:_0x37fb01[_0x1bd3('0x1e')]+_0x37fb01[_0x1bd3('0x20')];var _0x15e95;if(_0x38ce93>=_0xaefda8){_0x38ce93=_0xaefda8;_0x15e95=0xc8;}else{_0x15e95=0xce;}_0x4a222d[_0x1bd3('0x1c')](_0x15e95);return _0x4a222d[_0x1bd3('0x22')](_0x1bd3('0x23'),_0x4188e5+'-'+_0x38ce93+'/'+_0xaefda8)[_0x1bd3('0x24')](_0x446972);}return null;};}function patchUpdates(_0x345241){return function(_0x8de571){try{jsonpatch[_0x1bd3('0x25')](_0x8de571,_0x345241,!![]);}catch(_0x5e27f5){return BPromise[_0x1bd3('0x26')](_0x5e27f5);}return _0x8de571[_0x1bd3('0x27')]();};}function saveUpdates(_0x3821b4,_0x4cc19a){return function(_0x3aac9b){if(_0x3aac9b){return _0x3aac9b[_0x1bd3('0x28')](_0x3821b4)['then'](function(_0x45e1b7){return _0x45e1b7;});}return null;};}function removeEntity(_0x271764,_0xf60c65){return function(_0x2c2e58){if(_0x2c2e58){return _0x2c2e58[_0x1bd3('0x29')]()[_0x1bd3('0x2a')](function(){_0x271764[_0x1bd3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x234200,_0x3758a3){return function(_0x491ba){if(!_0x491ba){_0x234200[_0x1bd3('0x1b')](0x194);}return _0x491ba;};}function handleError(_0x1c763b,_0x53d6b6){_0x53d6b6=_0x53d6b6||0x1f4;return function(_0x4533cd){logger[_0x1bd3('0x2b')](_0x4533cd[_0x1bd3('0x2c')]);if(_0x4533cd['name']){delete _0x4533cd[_0x1bd3('0x2d')];}_0x1c763b[_0x1bd3('0x1c')](_0x53d6b6)[_0x1bd3('0x2e')](_0x4533cd);};}exports['index']=function(_0x54832b,_0x452082){var _0x43b5f6={},_0x1e3862={},_0x250c8e={'count':0x0,'rows':[]};var _0x13b4c3=_[_0x1bd3('0x2f')](db[_0x1bd3('0x30')]['rawAttributes'],function(_0x38654d){return{'name':_0x38654d[_0x1bd3('0x31')],'type':_0x38654d[_0x1bd3('0x32')][_0x1bd3('0x33')]};});_0x1e3862[_0x1bd3('0x34')]=_[_0x1bd3('0x2f')](_0x13b4c3,_0x1bd3('0x2d'));_0x1e3862['query']=_['keys'](_0x54832b['query']);_0x1e3862[_0x1bd3('0x35')]=_[_0x1bd3('0x36')](_0x1e3862['model'],_0x1e3862[_0x1bd3('0x37')]);_0x43b5f6[_0x1bd3('0x38')]=_['intersection'](_0x1e3862[_0x1bd3('0x34')],qs['fields'](_0x54832b['query'][_0x1bd3('0x39')]));_0x43b5f6[_0x1bd3('0x38')]=_0x43b5f6[_0x1bd3('0x38')][_0x1bd3('0x3a')]?_0x43b5f6[_0x1bd3('0x38')]:_0x1e3862[_0x1bd3('0x34')];if(!_0x54832b['query']['hasOwnProperty'](_0x1bd3('0x3b'))){_0x43b5f6['limit']=qs[_0x1bd3('0x20')](_0x54832b[_0x1bd3('0x37')][_0x1bd3('0x20')]);_0x43b5f6[_0x1bd3('0x1e')]=qs[_0x1bd3('0x1e')](_0x54832b[_0x1bd3('0x37')][_0x1bd3('0x1e')]);}_0x43b5f6[_0x1bd3('0x3c')]=qs[_0x1bd3('0x3d')](_0x54832b[_0x1bd3('0x37')][_0x1bd3('0x3d')]);_0x43b5f6[_0x1bd3('0x3e')]=qs['filters'](_[_0x1bd3('0x3f')](_0x54832b[_0x1bd3('0x37')],_0x1e3862[_0x1bd3('0x35')]),_0x13b4c3);if(_0x54832b[_0x1bd3('0x37')]['filter']){_0x43b5f6[_0x1bd3('0x3e')]=_[_0x1bd3('0x40')](_0x43b5f6[_0x1bd3('0x3e')],{'$or':_[_0x1bd3('0x2f')](_0x13b4c3,function(_0x4e56f9){if(_0x4e56f9[_0x1bd3('0x32')]!=='VIRTUAL'){var _0xac2d8={};_0xac2d8[_0x4e56f9['name']]={'$like':'%'+_0x54832b[_0x1bd3('0x37')][_0x1bd3('0x41')]+'%'};return _0xac2d8;}})});}_0x43b5f6=_[_0x1bd3('0x40')]({},_0x43b5f6,_0x54832b[_0x1bd3('0x42')]);var _0x54af4b={'where':_0x43b5f6[_0x1bd3('0x3e')]};return db[_0x1bd3('0x30')][_0x1bd3('0x21')](_0x54af4b)[_0x1bd3('0x2a')](function(_0x1b4dc2){_0x250c8e[_0x1bd3('0x21')]=_0x1b4dc2;if(_0x54832b['query']['includeAll']){_0x43b5f6['include']=[{'all':!![]}];}return db[_0x1bd3('0x30')][_0x1bd3('0x43')](_0x43b5f6);})[_0x1bd3('0x2a')](function(_0x448c5c){_0x250c8e['rows']=_0x448c5c;return _0x250c8e;})[_0x1bd3('0x2a')](respondWithFilteredResult(_0x452082,_0x43b5f6))[_0x1bd3('0x44')](handleError(_0x452082,null));};exports[_0x1bd3('0x45')]=function(_0x4ecfc5,_0x1db6b3){var _0x5e9153={'raw':![],'where':{'id':_0x4ecfc5[_0x1bd3('0x46')]['id']}},_0x2c0602={};_0x2c0602[_0x1bd3('0x34')]=_['keys'](db[_0x1bd3('0x30')]['rawAttributes']);_0x2c0602[_0x1bd3('0x37')]=_[_0x1bd3('0x47')](_0x4ecfc5[_0x1bd3('0x37')]);_0x2c0602['filters']=_[_0x1bd3('0x36')](_0x2c0602[_0x1bd3('0x34')],_0x2c0602['query']);_0x5e9153[_0x1bd3('0x38')]=_[_0x1bd3('0x36')](_0x2c0602[_0x1bd3('0x34')],qs[_0x1bd3('0x39')](_0x4ecfc5['query']['fields']));_0x5e9153[_0x1bd3('0x38')]=_0x5e9153[_0x1bd3('0x38')]['length']?_0x5e9153[_0x1bd3('0x38')]:_0x2c0602[_0x1bd3('0x34')];if(_0x4ecfc5[_0x1bd3('0x37')][_0x1bd3('0x48')]){_0x5e9153['include']=[{'all':!![]}];}_0x5e9153=_[_0x1bd3('0x40')]({},_0x5e9153,_0x4ecfc5[_0x1bd3('0x42')]);return db[_0x1bd3('0x30')][_0x1bd3('0x49')](_0x5e9153)[_0x1bd3('0x2a')](handleEntityNotFound(_0x1db6b3,null))[_0x1bd3('0x2a')](respondWithResult(_0x1db6b3,null))['catch'](handleError(_0x1db6b3,null));};exports[_0x1bd3('0x4a')]=function(_0x376d06,_0x581bb7){return db[_0x1bd3('0x30')][_0x1bd3('0x4a')](_0x376d06[_0x1bd3('0x4b')],{})[_0x1bd3('0x2a')](respondWithResult(_0x581bb7,0xc9))[_0x1bd3('0x44')](handleError(_0x581bb7,null));};exports[_0x1bd3('0x28')]=function(_0x24d21f,_0x50b6f7){if(_0x24d21f[_0x1bd3('0x4b')]['id']){delete _0x24d21f[_0x1bd3('0x4b')]['id'];}return db['UserProfileSection'][_0x1bd3('0x49')]({'where':{'id':_0x24d21f[_0x1bd3('0x46')]['id']}})['then'](handleEntityNotFound(_0x50b6f7,null))['then'](saveUpdates(_0x24d21f['body'],null))['then'](respondWithResult(_0x50b6f7,null))[_0x1bd3('0x44')](handleError(_0x50b6f7,null));};exports[_0x1bd3('0x29')]=function(_0x2b7767,_0x57b004){return db[_0x1bd3('0x30')]['find']({'where':{'id':_0x2b7767[_0x1bd3('0x46')]['id']}})[_0x1bd3('0x2a')](handleEntityNotFound(_0x57b004,null))[_0x1bd3('0x2a')](removeEntity(_0x57b004,null))[_0x1bd3('0x44')](handleError(_0x57b004,null));};exports[_0x1bd3('0x4c')]=function(_0x32156d,_0x10fc82){return db[_0x1bd3('0x30')][_0x1bd3('0x4c')]()[_0x1bd3('0x2a')](respondWithResult(_0x10fc82,null))[_0x1bd3('0x44')](handleError(_0x10fc82,null));}; \ No newline at end of file +var _0xfc6a=['error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','zip-dir','request-promise','bluebird','mustache','util','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy'];(function(_0x33a2e6,_0x278e4f){var _0x56f42=function(_0x1a54b7){while(--_0x1a54b7){_0x33a2e6['push'](_0x33a2e6['shift']());}};_0x56f42(++_0x278e4f);}(_0xfc6a,0xb1));var _0xafc6=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xfc6a[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xafc6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xafc6('0x1'));var moment=require('moment');var BPromise=require(_0xafc6('0x2'));var Mustache=require(_0xafc6('0x3'));var util=require(_0xafc6('0x4'));var path=require('path');var sox=require(_0xafc6('0x5'));var csv=require(_0xafc6('0x6'));var ejs=require(_0xafc6('0x7'));var fs=require('fs');var fs_extra=require(_0xafc6('0x8'));var _=require(_0xafc6('0x9'));var squel=require('squel');var crypto=require(_0xafc6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafc6('0xb'));var Redis=require(_0xafc6('0xc'));var authService=require(_0xafc6('0xd'));var qs=require(_0xafc6('0xe'));var as=require(_0xafc6('0xf'));var hardwareService=require(_0xafc6('0x10'));var logger=require(_0xafc6('0x11'))(_0xafc6('0x12'));var utils=require(_0xafc6('0x13'));var config=require(_0xafc6('0x14'));var licenseUtil=require(_0xafc6('0x15'));var db=require(_0xafc6('0x16'))['db'];function respondWithStatusCode(_0x5aeb6b,_0x555191){_0x555191=_0x555191||0xcc;return function(_0x4a6428){if(_0x4a6428){return _0x5aeb6b[_0xafc6('0x17')](_0x555191);}return _0x5aeb6b[_0xafc6('0x18')](_0x555191)[_0xafc6('0x19')]();};}function respondWithResult(_0x1cc763,_0x2a2950){_0x2a2950=_0x2a2950||0xc8;return function(_0x4ec4bc){if(_0x4ec4bc){return _0x1cc763['status'](_0x2a2950)[_0xafc6('0x1a')](_0x4ec4bc);}};}function respondWithFilteredResult(_0x1bf769,_0x31a925){return function(_0xc01e24){if(_0xc01e24){var _0x1e7b25=typeof _0x31a925[_0xafc6('0x1b')]===_0xafc6('0x1c')&&typeof _0x31a925[_0xafc6('0x1d')]===_0xafc6('0x1c');var _0x23ba9c=_0xc01e24[_0xafc6('0x1e')];var _0xdc4b50=_0x1e7b25?0x0:_0x31a925[_0xafc6('0x1b')];var _0x3d6d8b=_0x1e7b25?_0xc01e24[_0xafc6('0x1e')]:_0x31a925[_0xafc6('0x1b')]+_0x31a925[_0xafc6('0x1d')];var _0x2fe5c4;if(_0x3d6d8b>=_0x23ba9c){_0x3d6d8b=_0x23ba9c;_0x2fe5c4=0xc8;}else{_0x2fe5c4=0xce;}_0x1bf769[_0xafc6('0x18')](_0x2fe5c4);return _0x1bf769['set'](_0xafc6('0x1f'),_0xdc4b50+'-'+_0x3d6d8b+'/'+_0x23ba9c)[_0xafc6('0x1a')](_0xc01e24);}return null;};}function patchUpdates(_0x49b01f){return function(_0x592bb3){try{jsonpatch[_0xafc6('0x20')](_0x592bb3,_0x49b01f,!![]);}catch(_0x23ee42){return BPromise[_0xafc6('0x21')](_0x23ee42);}return _0x592bb3['save']();};}function saveUpdates(_0x5a6d06,_0xa2e5ad){return function(_0x3e9ee6){if(_0x3e9ee6){return _0x3e9ee6['update'](_0x5a6d06)[_0xafc6('0x22')](function(_0x3c0e54){return _0x3c0e54;});}return null;};}function removeEntity(_0x46160a,_0x1b33c5){return function(_0x327176){if(_0x327176){return _0x327176[_0xafc6('0x23')]()[_0xafc6('0x22')](function(){_0x46160a['status'](0xcc)[_0xafc6('0x19')]();});}};}function handleEntityNotFound(_0x15e519,_0x3d1616){return function(_0x1737fe){if(!_0x1737fe){_0x15e519[_0xafc6('0x17')](0x194);}return _0x1737fe;};}function handleError(_0x528c73,_0x589d60){_0x589d60=_0x589d60||0x1f4;return function(_0x657176){logger[_0xafc6('0x24')](_0x657176[_0xafc6('0x25')]);if(_0x657176[_0xafc6('0x26')]){delete _0x657176['name'];}_0x528c73[_0xafc6('0x18')](_0x589d60)[_0xafc6('0x27')](_0x657176);};}exports[_0xafc6('0x28')]=function(_0xece995,_0x22cb65){var _0x5c7e3d={},_0x2bf01e={},_0x36e87f={'count':0x0,'rows':[]};var _0x15eb72=_[_0xafc6('0x29')](db[_0xafc6('0x2a')][_0xafc6('0x2b')],function(_0x184d3d){return{'name':_0x184d3d['fieldName'],'type':_0x184d3d[_0xafc6('0x2c')]['key']};});_0x2bf01e['model']=_[_0xafc6('0x29')](_0x15eb72,_0xafc6('0x26'));_0x2bf01e[_0xafc6('0x2d')]=_[_0xafc6('0x2e')](_0xece995['query']);_0x2bf01e[_0xafc6('0x2f')]=_['intersection'](_0x2bf01e[_0xafc6('0x30')],_0x2bf01e[_0xafc6('0x2d')]);_0x5c7e3d[_0xafc6('0x31')]=_[_0xafc6('0x32')](_0x2bf01e[_0xafc6('0x30')],qs[_0xafc6('0x33')](_0xece995[_0xafc6('0x2d')][_0xafc6('0x33')]));_0x5c7e3d['attributes']=_0x5c7e3d[_0xafc6('0x31')][_0xafc6('0x34')]?_0x5c7e3d[_0xafc6('0x31')]:_0x2bf01e[_0xafc6('0x30')];if(!_0xece995['query'][_0xafc6('0x35')]('nolimit')){_0x5c7e3d[_0xafc6('0x1d')]=qs[_0xafc6('0x1d')](_0xece995[_0xafc6('0x2d')][_0xafc6('0x1d')]);_0x5c7e3d['offset']=qs['offset'](_0xece995[_0xafc6('0x2d')]['offset']);}_0x5c7e3d[_0xafc6('0x36')]=qs['sort'](_0xece995[_0xafc6('0x2d')][_0xafc6('0x37')]);_0x5c7e3d[_0xafc6('0x38')]=qs['filters'](_['pick'](_0xece995[_0xafc6('0x2d')],_0x2bf01e[_0xafc6('0x2f')]),_0x15eb72);if(_0xece995['query'][_0xafc6('0x39')]){_0x5c7e3d[_0xafc6('0x38')]=_[_0xafc6('0x3a')](_0x5c7e3d[_0xafc6('0x38')],{'$or':_[_0xafc6('0x29')](_0x15eb72,function(_0x12f266){if(_0x12f266[_0xafc6('0x2c')]!=='VIRTUAL'){var _0x12fb7b={};_0x12fb7b[_0x12f266[_0xafc6('0x26')]]={'$like':'%'+_0xece995[_0xafc6('0x2d')][_0xafc6('0x39')]+'%'};return _0x12fb7b;}})});}_0x5c7e3d=_['merge']({},_0x5c7e3d,_0xece995[_0xafc6('0x3b')]);var _0x2109f2={'where':_0x5c7e3d[_0xafc6('0x38')]};return db[_0xafc6('0x2a')]['count'](_0x2109f2)[_0xafc6('0x22')](function(_0x21ea1b){_0x36e87f[_0xafc6('0x1e')]=_0x21ea1b;if(_0xece995['query'][_0xafc6('0x3c')]){_0x5c7e3d[_0xafc6('0x3d')]=[{'all':!![]}];}return db[_0xafc6('0x2a')][_0xafc6('0x3e')](_0x5c7e3d);})[_0xafc6('0x22')](function(_0x31a24){_0x36e87f[_0xafc6('0x3f')]=_0x31a24;return _0x36e87f;})[_0xafc6('0x22')](respondWithFilteredResult(_0x22cb65,_0x5c7e3d))['catch'](handleError(_0x22cb65,null));};exports[_0xafc6('0x40')]=function(_0xef7415,_0x1d7ac2){var _0x1789fe={'raw':![],'where':{'id':_0xef7415[_0xafc6('0x41')]['id']}},_0x46ec36={};_0x46ec36[_0xafc6('0x30')]=_['keys'](db[_0xafc6('0x2a')][_0xafc6('0x2b')]);_0x46ec36['query']=_[_0xafc6('0x2e')](_0xef7415[_0xafc6('0x2d')]);_0x46ec36[_0xafc6('0x2f')]=_[_0xafc6('0x32')](_0x46ec36[_0xafc6('0x30')],_0x46ec36['query']);_0x1789fe[_0xafc6('0x31')]=_['intersection'](_0x46ec36[_0xafc6('0x30')],qs['fields'](_0xef7415[_0xafc6('0x2d')]['fields']));_0x1789fe[_0xafc6('0x31')]=_0x1789fe[_0xafc6('0x31')]['length']?_0x1789fe[_0xafc6('0x31')]:_0x46ec36[_0xafc6('0x30')];if(_0xef7415[_0xafc6('0x2d')][_0xafc6('0x3c')]){_0x1789fe['include']=[{'all':!![]}];}_0x1789fe=_['merge']({},_0x1789fe,_0xef7415[_0xafc6('0x3b')]);return db[_0xafc6('0x2a')][_0xafc6('0x42')](_0x1789fe)['then'](handleEntityNotFound(_0x1d7ac2,null))['then'](respondWithResult(_0x1d7ac2,null))[_0xafc6('0x43')](handleError(_0x1d7ac2,null));};exports['create']=function(_0x4f43ea,_0x214594){return db[_0xafc6('0x2a')][_0xafc6('0x44')](_0x4f43ea['body'],{})[_0xafc6('0x22')](respondWithResult(_0x214594,0xc9))[_0xafc6('0x43')](handleError(_0x214594,null));};exports['update']=function(_0x34733e,_0xa72a10){if(_0x34733e['body']['id']){delete _0x34733e[_0xafc6('0x45')]['id'];}return db['UserProfileSection'][_0xafc6('0x42')]({'where':{'id':_0x34733e[_0xafc6('0x41')]['id']}})['then'](handleEntityNotFound(_0xa72a10,null))[_0xafc6('0x22')](saveUpdates(_0x34733e[_0xafc6('0x45')],null))[_0xafc6('0x22')](respondWithResult(_0xa72a10,null))[_0xafc6('0x43')](handleError(_0xa72a10,null));};exports[_0xafc6('0x23')]=function(_0x2eaac5,_0x2c5cb6){return db[_0xafc6('0x2a')][_0xafc6('0x42')]({'where':{'id':_0x2eaac5[_0xafc6('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c5cb6,null))['then'](removeEntity(_0x2c5cb6,null))['catch'](handleError(_0x2c5cb6,null));};exports[_0xafc6('0x46')]=function(_0x1ea61e,_0x15a9e3){return db[_0xafc6('0x2a')][_0xafc6('0x46')]()['then'](respondWithResult(_0x15a9e3,null))['catch'](handleError(_0x15a9e3,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index cd09525..7163186 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 _0x6c41=['path','rimraf','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','moment','bluebird','request-promise'];(function(_0x49ba49,_0x3861d9){var _0x14921e=function(_0xb49336){while(--_0xb49336){_0x49ba49['push'](_0x49ba49['shift']());}};_0x14921e(++_0x3861d9);}(_0x6c41,0x7d));var _0x16c4=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x6c41[_0x52f1e6];return _0x21f104;};'use strict';var _=require(_0x16c4('0x0'));var util=require(_0x16c4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x16c4('0x2'));var BPromise=require(_0x16c4('0x3'));var rp=require(_0x16c4('0x4'));var fs=require('fs');var path=require(_0x16c4('0x5'));var rimraf=require(_0x16c4('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x16c4('0x7')]=function(_0x16a93e,_0x4ea133){return _0x16a93e[_0x16c4('0x8')](_0x16c4('0x9'),attributes,{'tableName':_0x16c4('0xa'),'paranoid':![],'indexes':[{'name':_0x16c4('0xb'),'fields':['sectionId',_0x16c4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabfc=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xabfc,0xf5));var _0xcabf=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xabfc[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xcabf('0x0'));var util=require(_0xcabf('0x1'));var logger=require(_0xcabf('0x2'))(_0xcabf('0x3'));var moment=require(_0xcabf('0x4'));var BPromise=require(_0xcabf('0x5'));var rp=require(_0xcabf('0x6'));var fs=require('fs');var path=require(_0xcabf('0x7'));var rimraf=require('rimraf');var config=require(_0xcabf('0x8'));var attributes=require(_0xcabf('0x9'));module[_0xcabf('0xa')]=function(_0x44b991,_0xbd6f51){return _0x44b991['define'](_0xcabf('0xb'),attributes,{'tableName':_0xcabf('0xc'),'paranoid':![],'indexes':[{'name':_0xcabf('0xd'),'fields':[_0xcabf('0xe'),_0xcabf('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 9442160..69cb86e 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 _0x354c=['../../config/utils','../../config/logger','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x354c,0x12d));var _0xc354=function(_0x70a4a6,_0x4a127d){_0x70a4a6=_0x70a4a6-0x0;var _0x69cc36=_0x354c[_0x70a4a6];return _0x69cc36;};'use strict';var _=require(_0xc354('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc354('0x1'));var rs=require(_0xc354('0x2'));var fs=require('fs');var Redis=require(_0xc354('0x3'));var db=require(_0xc354('0x4'))['db'];var utils=require(_0xc354('0x5'));var logger=require(_0xc354('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc354('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbfc3c6,_0x93b56,_0x6577c4){return new BPromise(function(_0x908f20,_0x19d468){return client['request'](_0xbfc3c6,_0x6577c4)[_0xc354('0x8')](function(_0x2d605c){logger[_0xc354('0x9')](_0xc354('0xa'),_0x93b56,_0xc354('0xb'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x93b56,_0xc354('0xb'),JSON[_0xc354('0xc')](_0x2d605c));if(_0x2d605c[_0xc354('0xd')]){if(_0x2d605c[_0xc354('0xd')][_0xc354('0xe')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x93b56,_0x2d605c[_0xc354('0xd')]['message']);return _0x19d468(_0x2d605c['error'][_0xc354('0xf')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x93b56,_0x2d605c[_0xc354('0xd')]['message']);return _0x908f20(_0x2d605c[_0xc354('0xd')][_0xc354('0xf')]);}else{logger[_0xc354('0x9')](_0xc354('0xa'),_0x93b56,_0xc354('0xb'));_0x908f20(_0x2d605c[_0xc354('0x10')][_0xc354('0xf')]);}})['catch'](function(_0x9f4ea1){logger[_0xc354('0xd')](_0xc354('0xa'),_0x93b56,_0x9f4ea1);_0x19d468(_0x9f4ea1);});});} \ No newline at end of file +var _0xe288=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c075b,_0x56c2e7){var _0x228448=function(_0x37c25c){while(--_0x37c25c){_0x4c075b['push'](_0x4c075b['shift']());}};_0x228448(++_0x56c2e7);}(_0xe288,0x104));var _0x8e28=function(_0x5e5d99,_0xbd1656){_0x5e5d99=_0x5e5d99-0x0;var _0x1b568e=_0xe288[_0x5e5d99];return _0x1b568e;};'use strict';var _=require(_0x8e28('0x0'));var util=require(_0x8e28('0x1'));var moment=require(_0x8e28('0x2'));var BPromise=require(_0x8e28('0x3'));var rs=require(_0x8e28('0x4'));var fs=require('fs');var Redis=require(_0x8e28('0x5'));var db=require(_0x8e28('0x6'))['db'];var utils=require(_0x8e28('0x7'));var logger=require(_0x8e28('0x8'))(_0x8e28('0x9'));var config=require('../../config/environment');var jayson=require(_0x8e28('0xa'));var client=jayson[_0x8e28('0xb')][_0x8e28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53dc76,_0x807217,_0x455626){return new BPromise(function(_0x59374a,_0x444f2a){return client[_0x8e28('0xd')](_0x53dc76,_0x455626)[_0x8e28('0xe')](function(_0x255c13){logger[_0x8e28('0xf')](_0x8e28('0x10'),_0x807217,_0x8e28('0x11'));logger[_0x8e28('0x12')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x807217,_0x8e28('0x11'),JSON[_0x8e28('0x13')](_0x255c13));if(_0x255c13[_0x8e28('0x14')]){if(_0x255c13['error']['code']===0x1f4){logger[_0x8e28('0x14')](_0x8e28('0x10'),_0x807217,_0x255c13[_0x8e28('0x14')][_0x8e28('0x15')]);return _0x444f2a(_0x255c13['error'][_0x8e28('0x15')]);}logger['error'](_0x8e28('0x10'),_0x807217,_0x255c13['error'][_0x8e28('0x15')]);return _0x59374a(_0x255c13['error'][_0x8e28('0x15')]);}else{logger['info'](_0x8e28('0x10'),_0x807217,_0x8e28('0x11'));_0x59374a(_0x255c13[_0x8e28('0x16')][_0x8e28('0x15')]);}})[_0x8e28('0x17')](function(_0x569842){logger['error'](_0x8e28('0x10'),_0x807217,_0x569842);_0x444f2a(_0x569842);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index d459b5c..03529fc 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x56cedb,_0x52e85f){var _0x5787ec=function(_0x10a89d){while(--_0x10a89d){_0x56cedb['push'](_0x56cedb['shift']());}};_0x5787ec(++_0x52e85f);}(_0xe706,0xa3));var _0x6e70=function(_0x23929d,_0x2d8984){_0x23929d=_0x23929d-0x0;var _0x52d817=_0xe706[_0x23929d];return _0x52d817;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1d7827,_0x42b0db){var _0xb449f1=function(_0x482ebc){while(--_0x482ebc){_0x1d7827['push'](_0x1d7827['shift']());}};_0xb449f1(++_0x42b0db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e938657..c0cd895 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 _0x015d=['sequelize'];(function(_0x10755a,_0xdbb5e1){var _0x5c4e88=function(_0x18d7b5){while(--_0x18d7b5){_0x10755a['push'](_0x10755a['shift']());}};_0x5c4e88(++_0xdbb5e1);}(_0x015d,0x78));var _0xd015=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0x015d[_0xaf025d];return _0x1c77cb;};'use strict';var Sequelize=require(_0xd015('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5577=['sequelize','INTEGER'];(function(_0xdd9118,_0x49356f){var _0x16c20f=function(_0x1b47fd){while(--_0x1b47fd){_0xdd9118['push'](_0xdd9118['shift']());}};_0x16c20f(++_0x49356f);}(_0x5577,0x1b4));var _0x7557=function(_0x3c6ff6,_0x4e136a){_0x3c6ff6=_0x3c6ff6-0x0;var _0x4ac5ba=_0x5577[_0x3c6ff6];return _0x4ac5ba;};'use strict';var Sequelize=require(_0x7557('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7557('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 9fc9a6b..0888982 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 _0xdb8b=['UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x1848bf,_0x5930ad){var _0x155b6c=function(_0x435d55){while(--_0x435d55){_0x1848bf['push'](_0x1848bf['shift']());}};_0x155b6c(++_0x5930ad);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x5ef339,_0x3da625){_0x5ef339=_0x5ef339-0x0;var _0xec3c91=_0xdb8b[_0x5ef339];return _0xec3c91;};'use strict';var _=require('lodash');var util=require(_0xbdb8('0x0'));var logger=require(_0xbdb8('0x1'))(_0xbdb8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbdb8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdb8('0x4'));var config=require(_0xbdb8('0x5'));var attributes=require(_0xbdb8('0x6'));module[_0xbdb8('0x7')]=function(_0x4c6bdb,_0x7affe8){return _0x4c6bdb['define'](_0xbdb8('0x8'),attributes,{'tableName':_0xbdb8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb46f=['request-promise','path','../../config/environment','exports','define','UserSmsQueue','lodash','util','api','moment','bluebird'];(function(_0x10a9d7,_0x543bf3){var _0x542cd4=function(_0x440956){while(--_0x440956){_0x10a9d7['push'](_0x10a9d7['shift']());}};_0x542cd4(++_0x543bf3);}(_0xb46f,0xb6));var _0xfb46=function(_0x2ec47a,_0x2e3e80){_0x2ec47a=_0x2ec47a-0x0;var _0x50ae38=_0xb46f[_0x2ec47a];return _0x50ae38;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var logger=require('../../config/logger')(_0xfb46('0x2'));var moment=require(_0xfb46('0x3'));var BPromise=require(_0xfb46('0x4'));var rp=require(_0xfb46('0x5'));var fs=require('fs');var path=require(_0xfb46('0x6'));var rimraf=require('rimraf');var config=require(_0xfb46('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xfb46('0x8')]=function(_0x3a5255,_0x186da6){return _0x3a5255[_0xfb46('0x9')](_0xfb46('0xa'),attributes,{'tableName':'user_has_sms_queues','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 9b53584..45eae2a 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 _0x318e=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5d2982,_0x37cfd6){var _0x506ec1=function(_0x20a7c1){while(--_0x20a7c1){_0x5d2982['push'](_0x5d2982['shift']());}};_0x506ec1(++_0x37cfd6);}(_0x318e,0x116));var _0xe318=function(_0x4ec758,_0x48eb35){_0x4ec758=_0x4ec758-0x0;var _0x485532=_0x318e[_0x4ec758];return _0x485532;};'use strict';var _=require(_0xe318('0x0'));var util=require('util');var moment=require(_0xe318('0x1'));var BPromise=require(_0xe318('0x2'));var rs=require(_0xe318('0x3'));var fs=require('fs');var Redis=require(_0xe318('0x4'));var db=require(_0xe318('0x5'))['db'];var utils=require(_0xe318('0x6'));var logger=require(_0xe318('0x7'))(_0xe318('0x8'));var config=require('../../config/environment');var jayson=require(_0xe318('0x9'));var client=jayson[_0xe318('0xa')][_0xe318('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xba3066,_0x1f5cd0,_0x21c8d5){return new BPromise(function(_0x97f8f3,_0x6044a7){return client[_0xe318('0xc')](_0xba3066,_0x21c8d5)[_0xe318('0xd')](function(_0x5459f2){logger[_0xe318('0xe')](_0xe318('0xf'),_0x1f5cd0,_0xe318('0x10'));logger[_0xe318('0x11')](_0xe318('0x12'),_0x1f5cd0,_0xe318('0x10'),JSON[_0xe318('0x13')](_0x5459f2));if(_0x5459f2[_0xe318('0x14')]){if(_0x5459f2['error'][_0xe318('0x15')]===0x1f4){logger[_0xe318('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x1f5cd0,_0x5459f2[_0xe318('0x14')]['message']);return _0x6044a7(_0x5459f2[_0xe318('0x14')]['message']);}logger[_0xe318('0x14')](_0xe318('0xf'),_0x1f5cd0,_0x5459f2[_0xe318('0x14')][_0xe318('0x16')]);return _0x97f8f3(_0x5459f2[_0xe318('0x14')][_0xe318('0x16')]);}else{logger[_0xe318('0xe')](_0xe318('0xf'),_0x1f5cd0,_0xe318('0x10'));_0x97f8f3(_0x5459f2['result'][_0xe318('0x16')]);}})[_0xe318('0x17')](function(_0x535eaa){logger[_0xe318('0x14')](_0xe318('0xf'),_0x1f5cd0,_0x535eaa);_0x6044a7(_0x535eaa);});});} \ No newline at end of file +var _0x28cc=['client','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0x28cc,0xf1));var _0xc28c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28cc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc28c('0x0'));var util=require(_0xc28c('0x1'));var moment=require(_0xc28c('0x2'));var BPromise=require(_0xc28c('0x3'));var rs=require(_0xc28c('0x4'));var fs=require('fs');var Redis=require(_0xc28c('0x5'));var db=require(_0xc28c('0x6'))['db'];var utils=require(_0xc28c('0x7'));var logger=require(_0xc28c('0x8'))(_0xc28c('0x9'));var config=require('../../config/environment');var jayson=require(_0xc28c('0xa'));var client=jayson[_0xc28c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d8221,_0x38f2c9,_0x28ab5f){return new BPromise(function(_0x8e5d5c,_0x3a5993){return client[_0xc28c('0xc')](_0x4d8221,_0x28ab5f)['then'](function(_0x1d70bd){logger[_0xc28c('0xd')](_0xc28c('0xe'),_0x38f2c9,_0xc28c('0xf'));logger[_0xc28c('0x10')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x38f2c9,_0xc28c('0xf'),JSON['stringify'](_0x1d70bd));if(_0x1d70bd['error']){if(_0x1d70bd['error'][_0xc28c('0x11')]===0x1f4){logger[_0xc28c('0x12')](_0xc28c('0xe'),_0x38f2c9,_0x1d70bd[_0xc28c('0x12')][_0xc28c('0x13')]);return _0x3a5993(_0x1d70bd[_0xc28c('0x12')][_0xc28c('0x13')]);}logger[_0xc28c('0x12')](_0xc28c('0xe'),_0x38f2c9,_0x1d70bd[_0xc28c('0x12')][_0xc28c('0x13')]);return _0x8e5d5c(_0x1d70bd[_0xc28c('0x12')][_0xc28c('0x13')]);}else{logger[_0xc28c('0xd')](_0xc28c('0xe'),_0x38f2c9,_0xc28c('0xf'));_0x8e5d5c(_0x1d70bd[_0xc28c('0x14')]['message']);}})['catch'](function(_0x1467aa){logger[_0xc28c('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x38f2c9,_0x1467aa);_0x3a5993(_0x1467aa);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 77c578f..00e4a55 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 _0x69b0=['INTEGER','sequelize','exports'];(function(_0x2a9c84,_0x125c78){var _0xacdd56=function(_0x4d4773){while(--_0x4d4773){_0x2a9c84['push'](_0x2a9c84['shift']());}};_0xacdd56(++_0x125c78);}(_0x69b0,0xf7));var _0x069b=function(_0xe59443,_0x1c7fbc){_0xe59443=_0xe59443-0x0;var _0x155142=_0x69b0[_0xe59443];return _0x155142;};'use strict';var Sequelize=require(_0x069b('0x0'));module[_0x069b('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x069b('0x2')]}}; \ No newline at end of file +var _0x195b=['INTEGER','sequelize','exports'];(function(_0x4cac77,_0x484f0c){var _0x59c2d7=function(_0x4760c9){while(--_0x4760c9){_0x4cac77['push'](_0x4cac77['shift']());}};_0x59c2d7(++_0x484f0c);}(_0x195b,0x166));var _0xb195=function(_0x1ca096,_0x3e72d8){_0x1ca096=_0x1ca096-0x0;var _0x4200d5=_0x195b[_0x1ca096];return _0x4200d5;};'use strict';var Sequelize=require(_0xb195('0x0'));module[_0xb195('0x1')]={'UserId':{'type':Sequelize[_0xb195('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xb195('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index ea7e4ff..863be0c 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(_0x1f9122,_0x519879){var _0xd72206=function(_0x2b0129){while(--_0x2b0129){_0x1f9122['push'](_0x1f9122['shift']());}};_0xd72206(++_0x519879);}(_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(_0x35ce6b,_0x2b6e47){var _0x152e7c=function(_0x2a2ed6){while(--_0x2a2ed6){_0x35ce6b['push'](_0x35ce6b['shift']());}};_0x152e7c(++_0x2b6e47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 a59ee34..6955377 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1b4c6d,_0x4e44f6){var _0x55092b=function(_0x342543){while(--_0x342543){_0x1b4c6d['push'](_0x1b4c6d['shift']());}};_0x55092b(++_0x4e44f6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x415b2b,_0x1a9d69){var _0x193fa9=function(_0x5b7103){while(--_0x5b7103){_0x415b2b['push'](_0x415b2b['shift']());}};_0x193fa9(++_0x1a9d69);}(_0xe706,0xa3));var _0x6e70=function(_0x355ca3,_0xd3e1e7){_0x355ca3=_0x355ca3-0x0;var _0x55edba=_0xe706[_0x355ca3];return _0x55edba;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 025e104..48a22b6 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 _0xd7a2=['INTEGER','sequelize','exports'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xd7a2,0x18a));var _0x2d7a=function(_0xe4653e,_0x462726){_0xe4653e=_0xe4653e-0x0;var _0x2cba55=_0xd7a2[_0xe4653e];return _0x2cba55;};'use strict';var Sequelize=require(_0x2d7a('0x0'));module[_0x2d7a('0x1')]={'penalty':{'type':Sequelize[_0x2d7a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x97d6=['INTEGER','sequelize'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0x97d6,0x11b));var _0x697d=function(_0x46b8d9,_0x431db3){_0x46b8d9=_0x46b8d9-0x0;var _0x383b8f=_0x97d6[_0x46b8d9];return _0x383b8f;};'use strict';var Sequelize=require(_0x697d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x697d('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 a3c9c4d..119dd08 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 _0x56a4=['exports','UserVoiceQueue','user_has_voice_queues','lodash','util','api','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x56a4,0x157));var _0x456a=function(_0x21d1eb,_0x56f664){_0x21d1eb=_0x21d1eb-0x0;var _0x4cb8cd=_0x56a4[_0x21d1eb];return _0x4cb8cd;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x456a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x456a('0x4'));var config=require(_0x456a('0x5'));var attributes=require(_0x456a('0x6'));module[_0x456a('0x7')]=function(_0x2e0fc1,_0xc19a66){return _0x2e0fc1['define'](_0x456a('0x8'),attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f85=['exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userVoiceQueue.attributes'];(function(_0x3bf181,_0x217849){var _0x41eb54=function(_0x18fb4e){while(--_0x18fb4e){_0x3bf181['push'](_0x3bf181['shift']());}};_0x41eb54(++_0x217849);}(_0x8f85,0x177));var _0x58f8=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x8f85[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x58f8('0x0'));var util=require(_0x58f8('0x1'));var logger=require(_0x58f8('0x2'))(_0x58f8('0x3'));var moment=require(_0x58f8('0x4'));var BPromise=require(_0x58f8('0x5'));var rp=require(_0x58f8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x58f8('0x7'));var attributes=require(_0x58f8('0x8'));module[_0x58f8('0x9')]=function(_0xcc75c1,_0x1a1aea){return _0xcc75c1[_0x58f8('0xa')](_0x58f8('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index bf579f8..7e12f34 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 _0x08ff=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x08ff,0x1ef));var _0xf08f=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x08ff[_0x544099];return _0x20ab09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf08f('0x0'));var BPromise=require(_0xf08f('0x1'));var rs=require(_0xf08f('0x2'));var fs=require('fs');var Redis=require(_0xf08f('0x3'));var db=require(_0xf08f('0x4'))['db'];var utils=require(_0xf08f('0x5'));var logger=require(_0xf08f('0x6'))(_0xf08f('0x7'));var config=require(_0xf08f('0x8'));var jayson=require(_0xf08f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x98eba4,_0x51bbf1,_0x2787e3){return new BPromise(function(_0x503081,_0x21177e){return client[_0xf08f('0xa')](_0x98eba4,_0x2787e3)['then'](function(_0xca8bfd){logger[_0xf08f('0xb')](_0xf08f('0xc'),_0x51bbf1,_0xf08f('0xd'));logger[_0xf08f('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x51bbf1,_0xf08f('0xd'),JSON[_0xf08f('0xf')](_0xca8bfd));if(_0xca8bfd[_0xf08f('0x10')]){if(_0xca8bfd[_0xf08f('0x10')]['code']===0x1f4){logger[_0xf08f('0x10')](_0xf08f('0xc'),_0x51bbf1,_0xca8bfd[_0xf08f('0x10')][_0xf08f('0x11')]);return _0x21177e(_0xca8bfd[_0xf08f('0x10')]['message']);}logger[_0xf08f('0x10')](_0xf08f('0xc'),_0x51bbf1,_0xca8bfd[_0xf08f('0x10')][_0xf08f('0x11')]);return _0x503081(_0xca8bfd[_0xf08f('0x10')][_0xf08f('0x11')]);}else{logger[_0xf08f('0xb')](_0xf08f('0xc'),_0x51bbf1,_0xf08f('0xd'));_0x503081(_0xca8bfd['result']['message']);}})[_0xf08f('0x12')](function(_0x3ca536){logger[_0xf08f('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x51bbf1,_0x3ca536);_0x21177e(_0x3ca536);});});} \ No newline at end of file +var _0x3823=['ioredis','../../config/logger','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3823,0x183));var _0x3382=function(_0x1993d9,_0x448390){_0x1993d9=_0x1993d9-0x0;var _0x48f360=_0x3823[_0x1993d9];return _0x48f360;};'use strict';var _=require(_0x3382('0x0'));var util=require(_0x3382('0x1'));var moment=require('moment');var BPromise=require(_0x3382('0x2'));var rs=require(_0x3382('0x3'));var fs=require('fs');var Redis=require(_0x3382('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3382('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3382('0x6')][_0x3382('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38e642,_0x3e122d,_0x37296b){return new BPromise(function(_0x2b52a4,_0x1e4e41){return client[_0x3382('0x8')](_0x38e642,_0x37296b)['then'](function(_0xeeb6d2){logger[_0x3382('0x9')]('UserVoiceQueue,\x20%s,\x20%s',_0x3e122d,'request\x20sent');logger['debug'](_0x3382('0xa'),_0x3e122d,_0x3382('0xb'),JSON['stringify'](_0xeeb6d2));if(_0xeeb6d2['error']){if(_0xeeb6d2[_0x3382('0xc')][_0x3382('0xd')]===0x1f4){logger[_0x3382('0xc')](_0x3382('0xe'),_0x3e122d,_0xeeb6d2[_0x3382('0xc')][_0x3382('0xf')]);return _0x1e4e41(_0xeeb6d2[_0x3382('0xc')][_0x3382('0xf')]);}logger[_0x3382('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x3e122d,_0xeeb6d2[_0x3382('0xc')][_0x3382('0xf')]);return _0x2b52a4(_0xeeb6d2[_0x3382('0xc')][_0x3382('0xf')]);}else{logger[_0x3382('0x9')]('UserVoiceQueue,\x20%s,\x20%s',_0x3e122d,'request\x20sent');_0x2b52a4(_0xeeb6d2[_0x3382('0x10')]['message']);}})['catch'](function(_0x497537){logger[_0x3382('0xc')](_0x3382('0xe'),_0x3e122d,_0x497537);_0x1e4e41(_0x497537);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a570bde..a05bdae 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(_0x239104,_0x31aa88){var _0x2fce2c=function(_0x215b5a){while(--_0x215b5a){_0x239104['push'](_0x239104['shift']());}};_0x2fce2c(++_0x31aa88);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x52d419,_0x5e1fbb){var _0xf6fa84=function(_0x1152ff){while(--_0x1152ff){_0x52d419['push'](_0x52d419['shift']());}};_0xf6fa84(++_0x5e1fbb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0xcb91[_0x59e821];return _0x5333f6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 030b7da..7734e30 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 _0x341a=['INTEGER','STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x341a,0xf9));var _0xa341=function(_0x2e38c0,_0x588826){_0x2e38c0=_0x2e38c0-0x0;var _0xa73566=_0x341a[_0x2e38c0];return _0xa73566;};'use strict';var Sequelize=require(_0xa341('0x0'));module[_0xa341('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa341('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xa341('0x2')},'UserId':{'type':Sequelize[_0xa341('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa341('0x4')],'allowNull':![],'unique':_0xa341('0x5'),'comment':_0xa341('0x2')},'VoiceQueueId':{'type':Sequelize[_0xa341('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xa341('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xa341('0x2')},'penalty':{'type':Sequelize[_0xa341('0x3')](0xb),'defaultValue':0x0,'comment':_0xa341('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa341('0x2')}}; \ No newline at end of file +var _0x326c=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x151831,_0x57f039){var _0x5b3d69=function(_0x4974bd){while(--_0x4974bd){_0x151831['push'](_0x151831['shift']());}};_0x5b3d69(++_0x57f039);}(_0x326c,0xcf));var _0xc326=function(_0x23adcb,_0x1cf7b0){_0x23adcb=_0x23adcb-0x0;var _0x206bcb=_0x326c[_0x23adcb];return _0x206bcb;};'use strict';var Sequelize=require(_0xc326('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc326('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc326('0x2')},'membername':{'type':Sequelize[_0xc326('0x3')],'allowNull':![],'comment':_0xc326('0x2')},'UserId':{'type':Sequelize[_0xc326('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc326('0x3')],'allowNull':![],'unique':_0xc326('0x4'),'comment':_0xc326('0x2')},'VoiceQueueId':{'type':Sequelize[_0xc326('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc326('0x4'),'comment':_0xc326('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xc326('0x2')},'paused':{'type':Sequelize[_0xc326('0x1')](0xb),'defaultValue':0x0,'comment':_0xc326('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6448ed8..c8bbd96 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 _0x598d=['hook','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4a0308,_0x5929c3){var _0x335917=function(_0x21e9c5){while(--_0x21e9c5){_0x4a0308['push'](_0x4a0308['shift']());}};_0x335917(++_0x5929c3);}(_0x598d,0xf1));var _0xd598=function(_0x20df52,_0xa408d9){_0x20df52=_0x20df52-0x0;var _0x391b52=_0x598d[_0x20df52];return _0x391b52;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xd598('0x0'))['db'][_0xd598('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd598('0x2')](0x0);var events={'afterCreate':_0xd598('0x3'),'afterUpdate':'update','afterDestroy':_0xd598('0x4')};function emitEvent(_0x5d10bd){return function(_0x1e8c57,_0x487c0e,_0x318a56){UserVoiceQueueRtEvents[_0xd598('0x5')](_0x5d10bd+':'+_0x1e8c57['id'],_0x1e8c57);UserVoiceQueueRtEvents['emit'](_0x5d10bd,_0x1e8c57);_0x318a56(null);};}for(var e in events){if(events[_0xd598('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xd598('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x78e1=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x129143,_0x3308b0){var _0xd62007=function(_0x4eccd1){while(--_0x4eccd1){_0x129143['push'](_0x129143['shift']());}};_0xd62007(++_0x3308b0);}(_0x78e1,0x1e5));var _0x178e=function(_0x51aca2,_0x441e13){_0x51aca2=_0x51aca2-0x0;var _0x458fc1=_0x78e1[_0x51aca2];return _0x458fc1;};'use strict';var EventEmitter=require(_0x178e('0x0'));var UserVoiceQueueRt=require(_0x178e('0x1'))['db'][_0x178e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x178e('0x3')](0x0);var events={'afterCreate':_0x178e('0x4'),'afterUpdate':_0x178e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x548a12){return function(_0x2e3824,_0x787043,_0x54df20){UserVoiceQueueRtEvents[_0x178e('0x6')](_0x548a12+':'+_0x2e3824['id'],_0x2e3824);UserVoiceQueueRtEvents['emit'](_0x548a12,_0x2e3824);_0x54df20(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x178e('0x7')](e,emitEvent(event));}}module[_0x178e('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 a955552..2db03a6 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 _0xfe20=['exports','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xfe20,0x1e6));var _0x0fe2=function(_0x45d400,_0x2f614b){_0x45d400=_0x45d400-0x0;var _0x34afdc=_0xfe20[_0x45d400];return _0x34afdc;};'use strict';var _=require(_0x0fe2('0x0'));var util=require(_0x0fe2('0x1'));var logger=require(_0x0fe2('0x2'))('api');var moment=require(_0x0fe2('0x3'));var BPromise=require('bluebird');var rp=require(_0x0fe2('0x4'));var fs=require('fs');var path=require(_0x0fe2('0x5'));var rimraf=require(_0x0fe2('0x6'));var config=require(_0x0fe2('0x7'));var attributes=require(_0x0fe2('0x8'));module[_0x0fe2('0x9')]=function(_0x10a7e4,_0x49c62a){return _0x10a7e4['define']('UserVoiceQueueRt',attributes,{'tableName':_0x0fe2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a91=['moment','bluebird','request-promise','path','rimraf','../../config/environment','UserVoiceQueueRt','lodash','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a91,0x133));var _0x11a9=function(_0x1ebaae,_0x270f11){_0x1ebaae=_0x1ebaae-0x0;var _0x53b153=_0x1a91[_0x1ebaae];return _0x53b153;};'use strict';var _=require(_0x11a9('0x0'));var util=require('util');var logger=require(_0x11a9('0x1'))(_0x11a9('0x2'));var moment=require(_0x11a9('0x3'));var BPromise=require(_0x11a9('0x4'));var rp=require(_0x11a9('0x5'));var fs=require('fs');var path=require(_0x11a9('0x6'));var rimraf=require(_0x11a9('0x7'));var config=require(_0x11a9('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x17ca9c,_0x3dda4b){return _0x17ca9c['define'](_0x11a9('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','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 7124396..b0f7cbe 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 _0x627f=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','error','code','result','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','debug','stringify','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x2de77d,_0x21c2d8){var _0x46b041=function(_0x20615f){while(--_0x20615f){_0x2de77d['push'](_0x2de77d['shift']());}};_0x46b041(++_0x21c2d8);}(_0x627f,0x134));var _0xf627=function(_0x8a0ba2,_0x14e3ce){_0x8a0ba2=_0x8a0ba2-0x0;var _0x5d6c97=_0x627f[_0x8a0ba2];return _0x5d6c97;};'use strict';var _=require(_0xf627('0x0'));var util=require('util');var moment=require(_0xf627('0x1'));var BPromise=require(_0xf627('0x2'));var rs=require(_0xf627('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf627('0x4'))['db'];var utils=require(_0xf627('0x5'));var logger=require('../../config/logger')(_0xf627('0x6'));var config=require('../../config/environment');var jayson=require(_0xf627('0x7'));var client=jayson[_0xf627('0x8')]['http']({'port':0x232a});config[_0xf627('0x9')]=_[_0xf627('0xa')](config['redis'],{'host':_0xf627('0xb'),'port':0x18eb});var socket=require(_0xf627('0xc'))(new Redis(config['redis']));require(_0xf627('0xd'))['register'](socket);function respondWithRpcPromise(_0x8909c3,_0x3fcc17,_0x5a2556){return new BPromise(function(_0x97eb5b,_0x473d02){return client['request'](_0x8909c3,_0x5a2556)['then'](function(_0x4f3b07){logger[_0xf627('0xe')](_0xf627('0xf'),_0x3fcc17,_0xf627('0x10'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3fcc17,_0xf627('0x10'),JSON['stringify'](_0x4f3b07));if(_0x4f3b07[_0xf627('0x11')]){if(_0x4f3b07['error'][_0xf627('0x12')]===0x1f4){logger[_0xf627('0x11')](_0xf627('0xf'),_0x3fcc17,_0x4f3b07['error']['message']);return _0x473d02(_0x4f3b07[_0xf627('0x11')]['message']);}logger[_0xf627('0x11')](_0xf627('0xf'),_0x3fcc17,_0x4f3b07[_0xf627('0x11')]['message']);return _0x97eb5b(_0x4f3b07[_0xf627('0x11')]['message']);}else{logger[_0xf627('0xe')](_0xf627('0xf'),_0x3fcc17,_0xf627('0x10'));_0x97eb5b(_0x4f3b07[_0xf627('0x13')][_0xf627('0x14')]);}})['catch'](function(_0x13fa8f){logger[_0xf627('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3fcc17,_0x13fa8f);_0x473d02(_0x13fa8f);});});}exports[_0xf627('0x15')]=function(_0x386535){var _0x30ff52=this;return new Promise(function(_0x555e19,_0x291b85){return db[_0xf627('0x16')][_0xf627('0x17')]({'raw':_0x386535[_0xf627('0x18')]?_0x386535[_0xf627('0x18')][_0xf627('0x19')]===undefined?!![]:![]:!![],'where':_0x386535['options']?_0x386535[_0xf627('0x18')][_0xf627('0x1a')]||null:null,'attributes':[[db[_0xf627('0x1b')]['fn'](_0xf627('0x1c'),db[_0xf627('0x1b')]['fn']('IF',db[_0xf627('0x1b')]['literal'](_0xf627('0x1d')))),_0xf627('0x1e')]]})[_0xf627('0x1f')](function(_0x3535e1){logger[_0xf627('0xe')](_0xf627('0x15'),_0x386535);logger[_0xf627('0x20')]('GetVoiceQueueRtPauses',_0x386535,JSON[_0xf627('0x21')](_0x3535e1));_0x555e19(_0x3535e1);})[_0xf627('0x22')](function(_0x5bb3df){logger[_0xf627('0x11')](_0xf627('0x15'),_0x5bb3df[_0xf627('0x14')],_0x386535);_0x291b85(_0x30ff52[_0xf627('0x11')](0x1f4,_0x5bb3df[_0xf627('0x14')]));});});}; \ No newline at end of file +var _0x47fc=['http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UserVoiceQueueRt','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x47fc,0x83));var _0xc47f=function(_0x459ed4,_0x3f20a7){_0x459ed4=_0x459ed4-0x0;var _0x54b7d9=_0x47fc[_0x459ed4];return _0x54b7d9;};'use strict';var _=require('lodash');var util=require(_0xc47f('0x0'));var moment=require(_0xc47f('0x1'));var BPromise=require(_0xc47f('0x2'));var rs=require(_0xc47f('0x3'));var fs=require('fs');var Redis=require(_0xc47f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc47f('0x5'));var logger=require(_0xc47f('0x6'))(_0xc47f('0x7'));var config=require('../../config/environment');var jayson=require(_0xc47f('0x8'));var client=jayson['client'][_0xc47f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc47f('0xa')],{'host':_0xc47f('0xb'),'port':0x18eb});var socket=require(_0xc47f('0xc'))(new Redis(config[_0xc47f('0xa')]));require(_0xc47f('0xd'))[_0xc47f('0xe')](socket);function respondWithRpcPromise(_0x2b9aa9,_0x584241,_0x23e27c){return new BPromise(function(_0x3f0019,_0x43d869){return client[_0xc47f('0xf')](_0x2b9aa9,_0x23e27c)[_0xc47f('0x10')](function(_0x42ba0d){logger[_0xc47f('0x11')](_0xc47f('0x12'),_0x584241,_0xc47f('0x13'));logger['debug'](_0xc47f('0x14'),_0x584241,_0xc47f('0x13'),JSON[_0xc47f('0x15')](_0x42ba0d));if(_0x42ba0d[_0xc47f('0x16')]){if(_0x42ba0d[_0xc47f('0x16')][_0xc47f('0x17')]===0x1f4){logger[_0xc47f('0x16')](_0xc47f('0x12'),_0x584241,_0x42ba0d[_0xc47f('0x16')][_0xc47f('0x18')]);return _0x43d869(_0x42ba0d[_0xc47f('0x16')][_0xc47f('0x18')]);}logger[_0xc47f('0x16')](_0xc47f('0x12'),_0x584241,_0x42ba0d[_0xc47f('0x16')][_0xc47f('0x18')]);return _0x3f0019(_0x42ba0d['error'][_0xc47f('0x18')]);}else{logger[_0xc47f('0x11')](_0xc47f('0x12'),_0x584241,'request\x20sent');_0x3f0019(_0x42ba0d['result']['message']);}})[_0xc47f('0x19')](function(_0x68a773){logger[_0xc47f('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x584241,_0x68a773);_0x43d869(_0x68a773);});});}exports['GetVoiceQueueRtPauses']=function(_0xe34959){var _0x32a61e=this;return new Promise(function(_0xecce51,_0x2fc307){return db[_0xc47f('0x1a')]['findAll']({'raw':_0xe34959[_0xc47f('0x1b')]?_0xe34959[_0xc47f('0x1b')][_0xc47f('0x1c')]===undefined?!![]:![]:!![],'where':_0xe34959[_0xc47f('0x1b')]?_0xe34959[_0xc47f('0x1b')]['where']||null:null,'attributes':[[db[_0xc47f('0x1d')]['fn'](_0xc47f('0x1e'),db[_0xc47f('0x1d')]['fn']('IF',db[_0xc47f('0x1d')]['literal'](_0xc47f('0x1f')))),_0xc47f('0x20')]]})['then'](function(_0x869803){logger['info'](_0xc47f('0x21'),_0xe34959);logger[_0xc47f('0x22')](_0xc47f('0x21'),_0xe34959,JSON[_0xc47f('0x15')](_0x869803));_0xecce51(_0x869803);})[_0xc47f('0x19')](function(_0x1b455f){logger['error'](_0xc47f('0x21'),_0x1b455f[_0xc47f('0x18')],_0xe34959);_0x2fc307(_0x32a61e[_0xc47f('0x16')](0x1f4,_0x1b455f[_0xc47f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 862ba5e..ee5f5e8 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 _0x7e02=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','register','length'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7e02,0x71));var _0x27e0=function(_0x42b74a,_0x2c2053){_0x42b74a=_0x42b74a-0x0;var _0xa73df3=_0x7e02[_0x42b74a];return _0xa73df3;};'use strict';var UserVoiceQueueRtEvents=require(_0x27e0('0x0'));var events=[_0x27e0('0x1'),_0x27e0('0x2'),_0x27e0('0x3')];function createListener(_0x6daf9e,_0x3bfa3b){return function(_0x310a36){_0x3bfa3b['emit'](_0x6daf9e,_0x310a36);};}function removeListener(_0x4fa613,_0x3d4f41){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4fa613,_0x3d4f41);};}exports[_0x27e0('0x4')]=function(_0x1f98c5){for(var _0x3ddcd2=0x0,_0x1cc944=events[_0x27e0('0x5')];_0x3ddcd2<_0x1cc944;_0x3ddcd2++){var _0x2dff51=events[_0x3ddcd2];var _0x44ae54=createListener(_0x27e0('0x6')+_0x2dff51,_0x1f98c5);UserVoiceQueueRtEvents['on'](_0x2dff51,_0x44ae54);}}; \ No newline at end of file +var _0x6bb4=['removeListener','register','length','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x4be578,_0x30a6e0){_0x4be578=_0x4be578-0x0;var _0x4ee00c=_0x6bb4[_0x4be578];return _0x4ee00c;};'use strict';var UserVoiceQueueRtEvents=require(_0x46bb('0x0'));var events=[_0x46bb('0x1'),_0x46bb('0x2'),'update'];function createListener(_0x1205ee,_0xd0784){return function(_0x4eb2a9){_0xd0784[_0x46bb('0x3')](_0x1205ee,_0x4eb2a9);};}function removeListener(_0x100be2,_0x2eefcc){return function(){UserVoiceQueueRtEvents[_0x46bb('0x4')](_0x100be2,_0x2eefcc);};}exports[_0x46bb('0x5')]=function(_0x2ae90f){for(var _0x5dd7d6=0x0,_0x4fa5c4=events[_0x46bb('0x6')];_0x5dd7d6<_0x4fa5c4;_0x5dd7d6++){var _0x4338c9=events[_0x5dd7d6];var _0x57fb08=createListener('userVoiceQueueRt:'+_0x4338c9,_0x2ae90f);UserVoiceQueueRtEvents['on'](_0x4338c9,_0x57fb08);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 4c4f618..9ea16fc 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5cec18,_0x34d5ea){var _0x4b878f=function(_0x25a030){while(--_0x25a030){_0x5cec18['push'](_0x5cec18['shift']());}};_0x4b878f(++_0x34d5ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x117a85,_0x9e5532){var _0x2a71bf=function(_0xf630cd){while(--_0xf630cd){_0x117a85['push'](_0x117a85['shift']());}};_0x2a71bf(++_0x9e5532);}(_0x70e0,0x17b));var _0x070e=function(_0x1ff60d,_0x2d5f5a){_0x1ff60d=_0x1ff60d-0x0;var _0x3102c0=_0x70e0[_0x1ff60d];return _0x3102c0;};'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 8a3a6f1..629d53e 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 _0x9e6a=['INTEGER','exports'];(function(_0x5698ce,_0x309209){var _0xaf560d=function(_0x2f3f56){while(--_0x2f3f56){_0x5698ce['push'](_0x5698ce['shift']());}};_0xaf560d(++_0x309209);}(_0x9e6a,0x15d));var _0xa9e6=function(_0x52dd39,_0xdb90a5){_0x52dd39=_0x52dd39-0x0;var _0x1d4076=_0x9e6a[_0x52dd39];return _0x1d4076;};'use strict';var Sequelize=require('sequelize');module[_0xa9e6('0x0')]={'penalty':{'type':Sequelize[_0xa9e6('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2698=['sequelize'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x2698,0x1e5));var _0x8269=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2698[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8269('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index c65ebe3..7e842f9 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 _0xef3e=['bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','lodash','util','api','moment'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xef3e,0x11a));var _0xeef3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xef3e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xeef3('0x0'));var util=require(_0xeef3('0x1'));var logger=require('../../config/logger')(_0xeef3('0x2'));var moment=require(_0xeef3('0x3'));var BPromise=require(_0xeef3('0x4'));var rp=require(_0xeef3('0x5'));var fs=require('fs');var path=require(_0xeef3('0x6'));var rimraf=require(_0xeef3('0x7'));var config=require(_0xeef3('0x8'));var attributes=require(_0xeef3('0x9'));module['exports']=function(_0x89f095,_0x367f17){return _0x89f095[_0xeef3('0xa')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d08=['request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3ad62c,_0x465700){var _0x18e4f3=function(_0x2ae3c3){while(--_0x2ae3c3){_0x3ad62c['push'](_0x3ad62c['shift']());}};_0x18e4f3(++_0x465700);}(_0x8d08,0x67));var _0x88d0=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x8d08[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var logger=require(_0x88d0('0x2'))('api');var moment=require(_0x88d0('0x3'));var BPromise=require(_0x88d0('0x4'));var rp=require(_0x88d0('0x5'));var fs=require('fs');var path=require(_0x88d0('0x6'));var rimraf=require(_0x88d0('0x7'));var config=require('../../config/environment');var attributes=require(_0x88d0('0x8'));module[_0x88d0('0x9')]=function(_0x24efaf,_0x2b03ee){return _0x24efaf[_0x88d0('0xa')]('UserWhatsappQueue',attributes,{'tableName':_0x88d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index bcebdcf..65f5da5 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 _0xf5c0=['jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x49d316,_0x108672){var _0x561a28=function(_0x3ad508){while(--_0x3ad508){_0x49d316['push'](_0x49d316['shift']());}};_0x561a28(++_0x108672);}(_0xf5c0,0x122));var _0x0f5c=function(_0xc434e4,_0x470cae){_0xc434e4=_0xc434e4-0x0;var _0x21b400=_0xf5c0[_0xc434e4];return _0x21b400;};'use strict';var _=require(_0x0f5c('0x0'));var util=require(_0x0f5c('0x1'));var moment=require(_0x0f5c('0x2'));var BPromise=require(_0x0f5c('0x3'));var rs=require(_0x0f5c('0x4'));var fs=require('fs');var Redis=require(_0x0f5c('0x5'));var db=require(_0x0f5c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f5c('0x7'))(_0x0f5c('0x8'));var config=require(_0x0f5c('0x9'));var jayson=require(_0x0f5c('0xa'));var client=jayson[_0x0f5c('0xb')][_0x0f5c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f1a7f,_0xa62722,_0x138e24){return new BPromise(function(_0x2f31ad,_0x21ca98){return client[_0x0f5c('0xd')](_0x3f1a7f,_0x138e24)[_0x0f5c('0xe')](function(_0x223940){logger[_0x0f5c('0xf')](_0x0f5c('0x10'),_0xa62722,_0x0f5c('0x11'));logger[_0x0f5c('0x12')](_0x0f5c('0x13'),_0xa62722,'request\x20sent',JSON['stringify'](_0x223940));if(_0x223940['error']){if(_0x223940['error'][_0x0f5c('0x14')]===0x1f4){logger[_0x0f5c('0x15')](_0x0f5c('0x10'),_0xa62722,_0x223940[_0x0f5c('0x15')][_0x0f5c('0x16')]);return _0x21ca98(_0x223940['error']['message']);}logger[_0x0f5c('0x15')](_0x0f5c('0x10'),_0xa62722,_0x223940[_0x0f5c('0x15')][_0x0f5c('0x16')]);return _0x2f31ad(_0x223940[_0x0f5c('0x15')][_0x0f5c('0x16')]);}else{logger[_0x0f5c('0xf')](_0x0f5c('0x10'),_0xa62722,_0x0f5c('0x11'));_0x2f31ad(_0x223940[_0x0f5c('0x17')][_0x0f5c('0x16')]);}})[_0x0f5c('0x18')](function(_0x4eec9c){logger[_0x0f5c('0x15')](_0x0f5c('0x10'),_0xa62722,_0x4eec9c);_0x21ca98(_0x4eec9c);});});} \ No newline at end of file +var _0x2717=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x2717,0x131));var _0x7271=function(_0x15a967,_0x52f8fb){_0x15a967=_0x15a967-0x0;var _0x251a1e=_0x2717[_0x15a967];return _0x251a1e;};'use strict';var _=require(_0x7271('0x0'));var util=require(_0x7271('0x1'));var moment=require('moment');var BPromise=require(_0x7271('0x2'));var rs=require(_0x7271('0x3'));var fs=require('fs');var Redis=require(_0x7271('0x4'));var db=require(_0x7271('0x5'))['db'];var utils=require(_0x7271('0x6'));var logger=require(_0x7271('0x7'))(_0x7271('0x8'));var config=require(_0x7271('0x9'));var jayson=require(_0x7271('0xa'));var client=jayson[_0x7271('0xb')][_0x7271('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22b949,_0x242d8d,_0x18331c){return new BPromise(function(_0x74274b,_0x41bdef){return client[_0x7271('0xd')](_0x22b949,_0x18331c)[_0x7271('0xe')](function(_0x4c62c5){logger[_0x7271('0xf')](_0x7271('0x10'),_0x242d8d,_0x7271('0x11'));logger[_0x7271('0x12')](_0x7271('0x13'),_0x242d8d,_0x7271('0x11'),JSON[_0x7271('0x14')](_0x4c62c5));if(_0x4c62c5[_0x7271('0x15')]){if(_0x4c62c5[_0x7271('0x15')][_0x7271('0x16')]===0x1f4){logger[_0x7271('0x15')](_0x7271('0x10'),_0x242d8d,_0x4c62c5['error'][_0x7271('0x17')]);return _0x41bdef(_0x4c62c5[_0x7271('0x15')][_0x7271('0x17')]);}logger[_0x7271('0x15')](_0x7271('0x10'),_0x242d8d,_0x4c62c5['error'][_0x7271('0x17')]);return _0x74274b(_0x4c62c5[_0x7271('0x15')][_0x7271('0x17')]);}else{logger[_0x7271('0xf')](_0x7271('0x10'),_0x242d8d,'request\x20sent');_0x74274b(_0x4c62c5[_0x7271('0x18')]['message']);}})['catch'](function(_0x35ef8f){logger[_0x7271('0x15')](_0x7271('0x10'),_0x242d8d,_0x35ef8f);_0x41bdef(_0x35ef8f);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 8e9a3b7..7306950 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 _0xd04b=['put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x3379af,_0x416f71){var _0x30134e=function(_0x1e017a){while(--_0x1e017a){_0x3379af['push'](_0x3379af['shift']());}};_0x30134e(++_0x416f71);}(_0xd04b,0x145));var _0xbd04=function(_0x365026,_0x104cfa){_0x365026=_0x365026-0x0;var _0x518276=_0xd04b[_0x365026];return _0x518276;};'use strict';var multer=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var path=require(_0xbd04('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd04('0x3'));var router=express['Router']();var fs_extra=require(_0xbd04('0x4'));var auth=require(_0xbd04('0x5'));var interaction=require(_0xbd04('0x6'));var config=require(_0xbd04('0x7'));var controller=require(_0xbd04('0x8'));router[_0xbd04('0x9')]('/',auth[_0xbd04('0xa')](),controller[_0xbd04('0xb')]);router[_0xbd04('0x9')](_0xbd04('0xc'),auth[_0xbd04('0xa')](),controller['show']);router[_0xbd04('0xd')]('/',auth[_0xbd04('0xa')](),controller[_0xbd04('0xe')]);router[_0xbd04('0xf')](_0xbd04('0xc'),auth[_0xbd04('0xa')](),controller[_0xbd04('0x10')]);router[_0xbd04('0x11')]('/:id',auth[_0xbd04('0xa')](),controller[_0xbd04('0x12')]);module[_0xbd04('0x13')]=router; \ No newline at end of file +var _0xc9f5=['express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0xa3dae0,_0x3ca52f){var _0x32d050=function(_0x40ca01){while(--_0x40ca01){_0xa3dae0['push'](_0xa3dae0['shift']());}};_0x32d050(++_0x3ca52f);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0xc9f5[_0x1e48d3];return _0x2852b1;};'use strict';var multer=require('multer');var util=require(_0x5c9f('0x0'));var path=require(_0x5c9f('0x1'));var timeout=require('connect-timeout');var express=require(_0x5c9f('0x2'));var router=express[_0x5c9f('0x3')]();var fs_extra=require(_0x5c9f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5c9f('0x5'));var controller=require('./variable.controller');router[_0x5c9f('0x6')]('/',auth['isAuthenticated'](),controller[_0x5c9f('0x7')]);router[_0x5c9f('0x6')](_0x5c9f('0x8'),auth[_0x5c9f('0x9')](),controller[_0x5c9f('0xa')]);router[_0x5c9f('0xb')]('/',auth[_0x5c9f('0x9')](),controller[_0x5c9f('0xc')]);router[_0x5c9f('0xd')](_0x5c9f('0x8'),auth[_0x5c9f('0x9')](),controller[_0x5c9f('0xe')]);router[_0x5c9f('0xf')](_0x5c9f('0x8'),auth[_0x5c9f('0x9')](),controller[_0x5c9f('0x10')]);module[_0x5c9f('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 8082a51..24a6f4e 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 _0xe553=['name','sequelize','exports','STRING'];(function(_0x3f0985,_0x72f86d){var _0x1462a6=function(_0x5e81cc){while(--_0x5e81cc){_0x3f0985['push'](_0x3f0985['shift']());}};_0x1462a6(++_0x72f86d);}(_0xe553,0x1a1));var _0x3e55=function(_0x23496e,_0x5c2620){_0x23496e=_0x23496e-0x0;var _0xd5128e=_0xe553[_0x23496e];return _0xd5128e;};'use strict';var Sequelize=require(_0x3e55('0x0'));module[_0x3e55('0x1')]={'name':{'type':Sequelize[_0x3e55('0x2')],'unique':_0x3e55('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3e55('0x2')]}}; \ No newline at end of file +var _0x64a5=['name','STRING','exports'];(function(_0x591cf9,_0x33ea78){var _0x3b46da=function(_0x96004a){while(--_0x96004a){_0x591cf9['push'](_0x591cf9['shift']());}};_0x3b46da(++_0x33ea78);}(_0x64a5,0x80));var _0x564a=function(_0x5808f5,_0x17154){_0x5808f5=_0x5808f5-0x0;var _0x51c16d=_0x64a5[_0x5808f5];return _0x51c16d;};'use strict';var Sequelize=require('sequelize');module[_0x564a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x564a('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x564a('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index f2aba02..f1ede4a 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 _0x1609=['where','pick','filter','merge','VIRTUAL','Variable','includeAll','include','findAll','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Variables','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3a088f,_0x3fb469){var _0x261687=function(_0x3f62fe){while(--_0x3f62fe){_0x3a088f['push'](_0x3a088f['shift']());}};_0x261687(++_0x3fb469);}(_0x1609,0x66));var _0x9160=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x1609[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0x9160('0x0'));var rimraf=require(_0x9160('0x1'));var zipdir=require(_0x9160('0x2'));var jsonpatch=require(_0x9160('0x3'));var rp=require(_0x9160('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9160('0x5'));var squel=require(_0x9160('0x6'));var crypto=require(_0x9160('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x9160('0x8'));var toCsv=require(_0x9160('0x9'));var querystring=require(_0x9160('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9160('0xb'));var qs=require(_0x9160('0xc'));var as=require(_0x9160('0xd'));var hardwareService=require(_0x9160('0xe'));var logger=require(_0x9160('0xf'))(_0x9160('0x10'));var utils=require(_0x9160('0x11'));var config=require(_0x9160('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9160('0x13'))['db'];function respondWithStatusCode(_0x58df93,_0x29dd37){_0x29dd37=_0x29dd37||0xcc;return function(_0x360580){if(_0x360580){return _0x58df93[_0x9160('0x14')](_0x29dd37);}return _0x58df93[_0x9160('0x15')](_0x29dd37)[_0x9160('0x16')]();};}function respondWithResult(_0x28dd52,_0x8bd99b){_0x8bd99b=_0x8bd99b||0xc8;return function(_0xf35205){if(_0xf35205){return _0x28dd52[_0x9160('0x15')](_0x8bd99b)[_0x9160('0x17')](_0xf35205);}};}function respondWithFilteredResult(_0x57c6e5,_0x768e29){return function(_0x1f231b){if(_0x1f231b){var _0x16032a=typeof _0x768e29[_0x9160('0x18')]===_0x9160('0x19')&&typeof _0x768e29[_0x9160('0x1a')]===_0x9160('0x19');var _0x2b2604=_0x1f231b[_0x9160('0x1b')];var _0xb447b4=_0x16032a?0x0:_0x768e29[_0x9160('0x18')];var _0x62c891=_0x16032a?_0x1f231b[_0x9160('0x1b')]:_0x768e29[_0x9160('0x18')]+_0x768e29[_0x9160('0x1a')];var _0x32d455;if(_0x62c891>=_0x2b2604){_0x62c891=_0x2b2604;_0x32d455=0xc8;}else{_0x32d455=0xce;}_0x57c6e5[_0x9160('0x15')](_0x32d455);return _0x57c6e5[_0x9160('0x1c')](_0x9160('0x1d'),_0xb447b4+'-'+_0x62c891+'/'+_0x2b2604)[_0x9160('0x17')](_0x1f231b);}return null;};}function patchUpdates(_0x50aead){return function(_0x38fe3a){try{jsonpatch[_0x9160('0x1e')](_0x38fe3a,_0x50aead,!![]);}catch(_0x349b7b){return BPromise[_0x9160('0x1f')](_0x349b7b);}return _0x38fe3a['save']();};}function saveUpdates(_0x5ac850,_0x42199b){return function(_0x48a816){if(_0x48a816){return _0x48a816[_0x9160('0x20')](_0x5ac850)[_0x9160('0x21')](function(_0x5ef588){return _0x5ef588;});}return null;};}function removeEntity(_0x710900,_0x14495a){return function(_0x1ffa17){if(_0x1ffa17){return _0x1ffa17[_0x9160('0x22')]()[_0x9160('0x21')](function(){var _0x29f10a=_0x1ffa17[_0x9160('0x23')]({'plain':!![]});var _0xca437d=_0x9160('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xca437d,'resourceId':_0x29f10a['id']}})['then'](function(){return _0x1ffa17;});})[_0x9160('0x21')](function(){_0x710900['status'](0xcc)[_0x9160('0x16')]();});}};}function handleEntityNotFound(_0x5e42bc,_0x558151){return function(_0x3a9cd9){if(!_0x3a9cd9){_0x5e42bc[_0x9160('0x14')](0x194);}return _0x3a9cd9;};}function handleError(_0x5220e0,_0x4cc337){_0x4cc337=_0x4cc337||0x1f4;return function(_0x4fa9e0){logger['error'](_0x4fa9e0['stack']);if(_0x4fa9e0[_0x9160('0x25')]){delete _0x4fa9e0[_0x9160('0x25')];}_0x5220e0[_0x9160('0x15')](_0x4cc337)[_0x9160('0x26')](_0x4fa9e0);};}exports['index']=function(_0x115b63,_0x1d3d4c){var _0xef7986={},_0x42ae45={},_0x3caafa={'count':0x0,'rows':[]};var _0xa91ab1=_[_0x9160('0x27')](db['Variable'][_0x9160('0x28')],function(_0x4b6787){return{'name':_0x4b6787[_0x9160('0x29')],'type':_0x4b6787[_0x9160('0x2a')][_0x9160('0x2b')]};});_0x42ae45[_0x9160('0x2c')]=_[_0x9160('0x27')](_0xa91ab1,_0x9160('0x25'));_0x42ae45[_0x9160('0x2d')]=_[_0x9160('0x2e')](_0x115b63[_0x9160('0x2d')]);_0x42ae45[_0x9160('0x2f')]=_[_0x9160('0x30')](_0x42ae45[_0x9160('0x2c')],_0x42ae45[_0x9160('0x2d')]);_0xef7986[_0x9160('0x31')]=_[_0x9160('0x30')](_0x42ae45[_0x9160('0x2c')],qs[_0x9160('0x32')](_0x115b63['query'][_0x9160('0x32')]));_0xef7986[_0x9160('0x31')]=_0xef7986[_0x9160('0x31')][_0x9160('0x33')]?_0xef7986[_0x9160('0x31')]:_0x42ae45['model'];if(!_0x115b63[_0x9160('0x2d')][_0x9160('0x34')](_0x9160('0x35'))){_0xef7986[_0x9160('0x1a')]=qs[_0x9160('0x1a')](_0x115b63['query'][_0x9160('0x1a')]);_0xef7986[_0x9160('0x18')]=qs['offset'](_0x115b63[_0x9160('0x2d')][_0x9160('0x18')]);}_0xef7986[_0x9160('0x36')]=qs['sort'](_0x115b63[_0x9160('0x2d')][_0x9160('0x37')]);_0xef7986[_0x9160('0x38')]=qs[_0x9160('0x2f')](_[_0x9160('0x39')](_0x115b63['query'],_0x42ae45['filters']),_0xa91ab1);if(_0x115b63[_0x9160('0x2d')][_0x9160('0x3a')]){_0xef7986[_0x9160('0x38')]=_[_0x9160('0x3b')](_0xef7986['where'],{'$or':_['map'](_0xa91ab1,function(_0x13f798){if(_0x13f798[_0x9160('0x2a')]!==_0x9160('0x3c')){var _0x254b79={};_0x254b79[_0x13f798['name']]={'$like':'%'+_0x115b63[_0x9160('0x2d')]['filter']+'%'};return _0x254b79;}})});}_0xef7986=_[_0x9160('0x3b')]({},_0xef7986,_0x115b63['options']);var _0x15d393={'where':_0xef7986['where']};return db[_0x9160('0x3d')][_0x9160('0x1b')](_0x15d393)[_0x9160('0x21')](function(_0x5de3e5){_0x3caafa[_0x9160('0x1b')]=_0x5de3e5;if(_0x115b63[_0x9160('0x2d')][_0x9160('0x3e')]){_0xef7986[_0x9160('0x3f')]=[{'all':!![]}];}return db[_0x9160('0x3d')][_0x9160('0x40')](_0xef7986);})[_0x9160('0x21')](function(_0x5aa01f){_0x3caafa[_0x9160('0x41')]=_0x5aa01f;return _0x3caafa;})['then'](respondWithFilteredResult(_0x1d3d4c,_0xef7986))[_0x9160('0x42')](handleError(_0x1d3d4c,null));};exports[_0x9160('0x43')]=function(_0x11cedd,_0x2bedb2){var _0xb43828={'raw':!![],'where':{'id':_0x11cedd[_0x9160('0x44')]['id']}},_0x2ff859={};_0x2ff859[_0x9160('0x2c')]=_[_0x9160('0x2e')](db[_0x9160('0x3d')][_0x9160('0x28')]);_0x2ff859[_0x9160('0x2d')]=_['keys'](_0x11cedd['query']);_0x2ff859[_0x9160('0x2f')]=_[_0x9160('0x30')](_0x2ff859[_0x9160('0x2c')],_0x2ff859[_0x9160('0x2d')]);_0xb43828[_0x9160('0x31')]=_[_0x9160('0x30')](_0x2ff859['model'],qs[_0x9160('0x32')](_0x11cedd['query'][_0x9160('0x32')]));_0xb43828[_0x9160('0x31')]=_0xb43828['attributes'][_0x9160('0x33')]?_0xb43828[_0x9160('0x31')]:_0x2ff859['model'];if(_0x11cedd[_0x9160('0x2d')]['includeAll']){_0xb43828[_0x9160('0x3f')]=[{'all':!![]}];}_0xb43828=_['merge']({},_0xb43828,_0x11cedd['options']);return db['Variable'][_0x9160('0x45')](_0xb43828)[_0x9160('0x21')](handleEntityNotFound(_0x2bedb2,null))[_0x9160('0x21')](respondWithResult(_0x2bedb2,null))[_0x9160('0x42')](handleError(_0x2bedb2,null));};exports['create']=function(_0x2a4b8f,_0x5a8c14){return db[_0x9160('0x3d')]['create'](_0x2a4b8f[_0x9160('0x46')],{})[_0x9160('0x21')](function(_0x141715){var _0x3724dd=_0x2a4b8f[_0x9160('0x47')][_0x9160('0x23')]({'plain':!![]});if(!_0x3724dd)throw new Error(_0x9160('0x48'));if(_0x3724dd['role']===_0x9160('0x47')){var _0x5b237c=_0x141715['get']({'plain':!![]});var _0x433c8a=_0x9160('0x24');return db['UserProfileSection'][_0x9160('0x45')]({'where':{'name':_0x433c8a,'userProfileId':_0x3724dd[_0x9160('0x49')]},'raw':!![]})[_0x9160('0x21')](function(_0x6b4a16){if(_0x6b4a16&&_0x6b4a16[_0x9160('0x4a')]===0x0){return db[_0x9160('0x4b')][_0x9160('0x4c')]({'name':_0x5b237c['name'],'resourceId':_0x5b237c['id'],'type':_0x6b4a16[_0x9160('0x25')],'sectionId':_0x6b4a16['id']},{})[_0x9160('0x21')](function(){return _0x141715;});}else{return _0x141715;}})[_0x9160('0x42')](function(_0x2c006a){logger[_0x9160('0x4d')](_0x9160('0x4e'),_0x2c006a);throw _0x2c006a;});}return _0x141715;})[_0x9160('0x21')](respondWithResult(_0x5a8c14,0xc9))['catch'](handleError(_0x5a8c14,null));};exports[_0x9160('0x20')]=function(_0x5522e3,_0x1ab8c8){if(_0x5522e3[_0x9160('0x46')]['id']){delete _0x5522e3[_0x9160('0x46')]['id'];}return db[_0x9160('0x3d')]['find']({'where':{'id':_0x5522e3[_0x9160('0x44')]['id']}})[_0x9160('0x21')](handleEntityNotFound(_0x1ab8c8,null))[_0x9160('0x21')](saveUpdates(_0x5522e3[_0x9160('0x46')],null))['then'](respondWithResult(_0x1ab8c8,null))[_0x9160('0x42')](handleError(_0x1ab8c8,null));};exports[_0x9160('0x22')]=function(_0x48a6cd,_0xba0be8){return db['Variable'][_0x9160('0x45')]({'where':{'id':_0x48a6cd[_0x9160('0x44')]['id']}})[_0x9160('0x21')](handleEntityNotFound(_0xba0be8,null))[_0x9160('0x21')](removeEntity(_0xba0be8,null))[_0x9160('0x42')](handleError(_0xba0be8,null));}; \ No newline at end of file +var _0x57d5=['sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','count','set','Content-Range','json','apply','reject','get','Variables','UserProfileResource','destroy','then','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57d5,0x191));var _0x557d=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x57d5[_0x2642cb];return _0xe6e41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x557d('0x0'));var zipdir=require(_0x557d('0x1'));var jsonpatch=require(_0x557d('0x2'));var rp=require(_0x557d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x557d('0x4'));var util=require(_0x557d('0x5'));var path=require(_0x557d('0x6'));var sox=require('sox');var csv=require(_0x557d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x557d('0x8'));var squel=require(_0x557d('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x557d('0xa'));var toCsv=require(_0x557d('0x7'));var querystring=require('querystring');var Papa=require(_0x557d('0xb'));var Redis=require('ioredis');var authService=require(_0x557d('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x557d('0xd'));var hardwareService=require(_0x557d('0xe'));var logger=require(_0x557d('0xf'))(_0x557d('0x10'));var utils=require(_0x557d('0x11'));var config=require(_0x557d('0x12'));var licenseUtil=require(_0x557d('0x13'));var db=require(_0x557d('0x14'))['db'];function respondWithStatusCode(_0x34602d,_0x4694a0){_0x4694a0=_0x4694a0||0xcc;return function(_0x58fea8){if(_0x58fea8){return _0x34602d['sendStatus'](_0x4694a0);}return _0x34602d['status'](_0x4694a0)[_0x557d('0x15')]();};}function respondWithResult(_0x7cbb34,_0x251e27){_0x251e27=_0x251e27||0xc8;return function(_0x11aa15){if(_0x11aa15){return _0x7cbb34[_0x557d('0x16')](_0x251e27)['json'](_0x11aa15);}};}function respondWithFilteredResult(_0x39c665,_0x200552){return function(_0x107f82){if(_0x107f82){var _0x37496d=typeof _0x200552[_0x557d('0x17')]==='undefined'&&typeof _0x200552[_0x557d('0x18')]==='undefined';var _0x4576c7=_0x107f82[_0x557d('0x19')];var _0x3f68ae=_0x37496d?0x0:_0x200552[_0x557d('0x17')];var _0x118c34=_0x37496d?_0x107f82[_0x557d('0x19')]:_0x200552[_0x557d('0x17')]+_0x200552[_0x557d('0x18')];var _0x5201fa;if(_0x118c34>=_0x4576c7){_0x118c34=_0x4576c7;_0x5201fa=0xc8;}else{_0x5201fa=0xce;}_0x39c665[_0x557d('0x16')](_0x5201fa);return _0x39c665[_0x557d('0x1a')](_0x557d('0x1b'),_0x3f68ae+'-'+_0x118c34+'/'+_0x4576c7)[_0x557d('0x1c')](_0x107f82);}return null;};}function patchUpdates(_0x4ea0a0){return function(_0x2e2fb6){try{jsonpatch[_0x557d('0x1d')](_0x2e2fb6,_0x4ea0a0,!![]);}catch(_0x3f321b){return BPromise[_0x557d('0x1e')](_0x3f321b);}return _0x2e2fb6['save']();};}function saveUpdates(_0x5acf0e,_0x4f6f68){return function(_0x56984d){if(_0x56984d){return _0x56984d['update'](_0x5acf0e)['then'](function(_0x5bd946){return _0x5bd946;});}return null;};}function removeEntity(_0xb61846,_0x548627){return function(_0x209d43){if(_0x209d43){return _0x209d43['destroy']()['then'](function(){var _0x12b53d=_0x209d43[_0x557d('0x1f')]({'plain':!![]});var _0x597513=_0x557d('0x20');return db[_0x557d('0x21')][_0x557d('0x22')]({'where':{'type':_0x597513,'resourceId':_0x12b53d['id']}})[_0x557d('0x23')](function(){return _0x209d43;});})[_0x557d('0x23')](function(){_0xb61846['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1681da,_0x2ca5da){return function(_0x237232){if(!_0x237232){_0x1681da['sendStatus'](0x194);}return _0x237232;};}function handleError(_0x4b41fb,_0x54ea8f){_0x54ea8f=_0x54ea8f||0x1f4;return function(_0x164565){logger['error'](_0x164565[_0x557d('0x24')]);if(_0x164565[_0x557d('0x25')]){delete _0x164565['name'];}_0x4b41fb['status'](_0x54ea8f)[_0x557d('0x26')](_0x164565);};}exports[_0x557d('0x27')]=function(_0x6d6929,_0x46e41c){var _0x495b4e={},_0x301132={},_0x41b3d5={'count':0x0,'rows':[]};var _0x2e91f8=_[_0x557d('0x28')](db[_0x557d('0x29')][_0x557d('0x2a')],function(_0x50115f){return{'name':_0x50115f[_0x557d('0x2b')],'type':_0x50115f[_0x557d('0x2c')][_0x557d('0x2d')]};});_0x301132[_0x557d('0x2e')]=_['map'](_0x2e91f8,_0x557d('0x25'));_0x301132[_0x557d('0x2f')]=_['keys'](_0x6d6929[_0x557d('0x2f')]);_0x301132[_0x557d('0x30')]=_[_0x557d('0x31')](_0x301132['model'],_0x301132[_0x557d('0x2f')]);_0x495b4e[_0x557d('0x32')]=_[_0x557d('0x31')](_0x301132[_0x557d('0x2e')],qs['fields'](_0x6d6929[_0x557d('0x2f')][_0x557d('0x33')]));_0x495b4e[_0x557d('0x32')]=_0x495b4e[_0x557d('0x32')]['length']?_0x495b4e[_0x557d('0x32')]:_0x301132[_0x557d('0x2e')];if(!_0x6d6929[_0x557d('0x2f')][_0x557d('0x34')](_0x557d('0x35'))){_0x495b4e[_0x557d('0x18')]=qs[_0x557d('0x18')](_0x6d6929['query']['limit']);_0x495b4e['offset']=qs[_0x557d('0x17')](_0x6d6929['query'][_0x557d('0x17')]);}_0x495b4e[_0x557d('0x36')]=qs[_0x557d('0x37')](_0x6d6929[_0x557d('0x2f')][_0x557d('0x37')]);_0x495b4e[_0x557d('0x38')]=qs[_0x557d('0x30')](_[_0x557d('0x39')](_0x6d6929[_0x557d('0x2f')],_0x301132[_0x557d('0x30')]),_0x2e91f8);if(_0x6d6929['query']['filter']){_0x495b4e[_0x557d('0x38')]=_['merge'](_0x495b4e['where'],{'$or':_['map'](_0x2e91f8,function(_0x21eefb){if(_0x21eefb[_0x557d('0x2c')]!==_0x557d('0x3a')){var _0x5a1ea8={};_0x5a1ea8[_0x21eefb['name']]={'$like':'%'+_0x6d6929['query'][_0x557d('0x3b')]+'%'};return _0x5a1ea8;}})});}_0x495b4e=_[_0x557d('0x3c')]({},_0x495b4e,_0x6d6929[_0x557d('0x3d')]);var _0x2e4127={'where':_0x495b4e[_0x557d('0x38')]};return db[_0x557d('0x29')][_0x557d('0x19')](_0x2e4127)[_0x557d('0x23')](function(_0x5d09f8){_0x41b3d5['count']=_0x5d09f8;if(_0x6d6929[_0x557d('0x2f')]['includeAll']){_0x495b4e[_0x557d('0x3e')]=[{'all':!![]}];}return db[_0x557d('0x29')][_0x557d('0x3f')](_0x495b4e);})['then'](function(_0x119608){_0x41b3d5['rows']=_0x119608;return _0x41b3d5;})['then'](respondWithFilteredResult(_0x46e41c,_0x495b4e))[_0x557d('0x40')](handleError(_0x46e41c,null));};exports[_0x557d('0x41')]=function(_0x40e4a0,_0x1e5b6c){var _0x476a14={'raw':!![],'where':{'id':_0x40e4a0[_0x557d('0x42')]['id']}},_0x46a62b={};_0x46a62b['model']=_[_0x557d('0x43')](db[_0x557d('0x29')][_0x557d('0x2a')]);_0x46a62b['query']=_[_0x557d('0x43')](_0x40e4a0[_0x557d('0x2f')]);_0x46a62b[_0x557d('0x30')]=_[_0x557d('0x31')](_0x46a62b[_0x557d('0x2e')],_0x46a62b['query']);_0x476a14['attributes']=_[_0x557d('0x31')](_0x46a62b[_0x557d('0x2e')],qs[_0x557d('0x33')](_0x40e4a0['query'][_0x557d('0x33')]));_0x476a14[_0x557d('0x32')]=_0x476a14[_0x557d('0x32')]['length']?_0x476a14[_0x557d('0x32')]:_0x46a62b[_0x557d('0x2e')];if(_0x40e4a0[_0x557d('0x2f')]['includeAll']){_0x476a14[_0x557d('0x3e')]=[{'all':!![]}];}_0x476a14=_[_0x557d('0x3c')]({},_0x476a14,_0x40e4a0[_0x557d('0x3d')]);return db[_0x557d('0x29')][_0x557d('0x44')](_0x476a14)['then'](handleEntityNotFound(_0x1e5b6c,null))[_0x557d('0x23')](respondWithResult(_0x1e5b6c,null))[_0x557d('0x40')](handleError(_0x1e5b6c,null));};exports[_0x557d('0x45')]=function(_0x43fd70,_0x15cf45){return db[_0x557d('0x29')][_0x557d('0x45')](_0x43fd70['body'],{})[_0x557d('0x23')](function(_0x2c1914){var _0x54768e=_0x43fd70['user']['get']({'plain':!![]});if(!_0x54768e)throw new Error(_0x557d('0x46'));if(_0x54768e['role']===_0x557d('0x47')){var _0x379b5e=_0x2c1914[_0x557d('0x1f')]({'plain':!![]});var _0x2a810b='Variables';return db['UserProfileSection'][_0x557d('0x44')]({'where':{'name':_0x2a810b,'userProfileId':_0x54768e[_0x557d('0x48')]},'raw':!![]})[_0x557d('0x23')](function(_0x195289){if(_0x195289&&_0x195289['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x379b5e[_0x557d('0x25')],'resourceId':_0x379b5e['id'],'type':_0x195289['name'],'sectionId':_0x195289['id']},{})[_0x557d('0x23')](function(){return _0x2c1914;});}else{return _0x2c1914;}})[_0x557d('0x40')](function(_0x4953f2){logger[_0x557d('0x49')](_0x557d('0x4a'),_0x4953f2);throw _0x4953f2;});}return _0x2c1914;})[_0x557d('0x23')](respondWithResult(_0x15cf45,0xc9))['catch'](handleError(_0x15cf45,null));};exports['update']=function(_0x57af3c,_0x522057){if(_0x57af3c[_0x557d('0x4b')]['id']){delete _0x57af3c['body']['id'];}return db[_0x557d('0x29')][_0x557d('0x44')]({'where':{'id':_0x57af3c[_0x557d('0x42')]['id']}})[_0x557d('0x23')](handleEntityNotFound(_0x522057,null))[_0x557d('0x23')](saveUpdates(_0x57af3c['body'],null))['then'](respondWithResult(_0x522057,null))[_0x557d('0x40')](handleError(_0x522057,null));};exports[_0x557d('0x22')]=function(_0x2261a3,_0x2ef109){return db[_0x557d('0x29')][_0x557d('0x44')]({'where':{'id':_0x2261a3[_0x557d('0x42')]['id']}})[_0x557d('0x23')](handleEntityNotFound(_0x2ef109,null))['then'](removeEntity(_0x2ef109,null))[_0x557d('0x40')](handleError(_0x2ef109,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ceb7a3e..37afda2 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 _0xde37=['util','../../config/logger','api','request-promise','path','rimraf','./variable.attributes','Variable','tools_variables'];(function(_0x48afaf,_0x121ecd){var _0x1c364e=function(_0x259746){while(--_0x259746){_0x48afaf['push'](_0x48afaf['shift']());}};_0x1c364e(++_0x121ecd);}(_0xde37,0x10e));var _0x7de3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde37[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7de3('0x0'));var logger=require(_0x7de3('0x1'))(_0x7de3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7de3('0x3'));var fs=require('fs');var path=require(_0x7de3('0x4'));var rimraf=require(_0x7de3('0x5'));var config=require('../../config/environment');var attributes=require(_0x7de3('0x6'));module['exports']=function(_0xf6b8b0,_0x2bf41b){return _0xf6b8b0['define'](_0x7de3('0x7'),attributes,{'tableName':_0x7de3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7472=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','lodash'];(function(_0x568e7c,_0x5ea152){var _0x4682a7=function(_0x868695){while(--_0x868695){_0x568e7c['push'](_0x568e7c['shift']());}};_0x4682a7(++_0x5ea152);}(_0x7472,0x128));var _0x2747=function(_0x4a5599,_0x37a751){_0x4a5599=_0x4a5599-0x0;var _0x1fa9f4=_0x7472[_0x4a5599];return _0x1fa9f4;};'use strict';var _=require(_0x2747('0x0'));var util=require(_0x2747('0x1'));var logger=require(_0x2747('0x2'))(_0x2747('0x3'));var moment=require(_0x2747('0x4'));var BPromise=require('bluebird');var rp=require(_0x2747('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2747('0x6'));var config=require(_0x2747('0x7'));var attributes=require(_0x2747('0x8'));module[_0x2747('0x9')]=function(_0x5b87bc,_0x1f0e99){return _0x5b87bc[_0x2747('0xa')]('Variable',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 4735be2..8cd9179 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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x402718,_0x22529c){var _0x3e6afb=function(_0x456b60){while(--_0x456b60){_0x402718['push'](_0x402718['shift']());}};_0x3e6afb(++_0x22529c);}(_0x5fc3,0xa8));var _0x35fc=function(_0xb1174e,_0x1e68a7){_0xb1174e=_0xb1174e-0x0;var _0x285bac=_0x5fc3[_0xb1174e];return _0x285bac;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x3e0d59,_0xa14104){var _0x357838=function(_0x485ec5){while(--_0x485ec5){_0x3e0d59['push'](_0x3e0d59['shift']());}};_0x357838(++_0xa14104);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Variable,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 141947a..aea6dc8 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 _0x1e03=['get','index','isAuthenticated','canUpdate','fetch','reset','/pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller'];(function(_0x5b00fa,_0x5656df){var _0x381ebb=function(_0x186f37){while(--_0x186f37){_0x5b00fa['push'](_0x5b00fa['shift']());}};_0x381ebb(++_0x5656df);}(_0x1e03,0x173));var _0x31e0=function(_0x47f6e5,_0x3a254d){_0x47f6e5=_0x47f6e5-0x0;var _0x4456f6=_0x1e03[_0x47f6e5];return _0x4456f6;};'use strict';var express=require(_0x31e0('0x0'));var router=express[_0x31e0('0x1')]();var auth=require(_0x31e0('0x2'));var controller=require(_0x31e0('0x3'));router[_0x31e0('0x4')]('/',controller[_0x31e0('0x5')]);router[_0x31e0('0x4')]('/fetch',auth[_0x31e0('0x6')](),auth[_0x31e0('0x7')](),controller[_0x31e0('0x8')]);router[_0x31e0('0x4')]('/reset',auth[_0x31e0('0x6')](),auth[_0x31e0('0x7')](),controller[_0x31e0('0x9')]);router[_0x31e0('0x4')](_0x31e0('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0x31e0('0x4')]('/restart',auth['isAuthenticated'](),controller[_0x31e0('0xb')]);router[_0x31e0('0x4')](_0x31e0('0xc'),controller[_0x31e0('0xd')]);module[_0x31e0('0xe')]=router; \ No newline at end of file +var _0x9a12=['restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','fetch','/reset','canUpdate','/pull','/restart'];(function(_0x13a447,_0x12df43){var _0x47c069=function(_0x3da2ac){while(--_0x3da2ac){_0x13a447['push'](_0x13a447['shift']());}};_0x47c069(++_0x12df43);}(_0x9a12,0x1e4));var _0x29a1=function(_0xb181ac,_0x186332){_0xb181ac=_0xb181ac-0x0;var _0x5abd4e=_0x9a12[_0xb181ac];return _0x5abd4e;};'use strict';var express=require(_0x29a1('0x0'));var router=express[_0x29a1('0x1')]();var auth=require(_0x29a1('0x2'));var controller=require(_0x29a1('0x3'));router[_0x29a1('0x4')]('/',controller[_0x29a1('0x5')]);router[_0x29a1('0x4')]('/fetch',auth[_0x29a1('0x6')](),auth['canUpdate'](),controller[_0x29a1('0x7')]);router[_0x29a1('0x4')](_0x29a1('0x8'),auth[_0x29a1('0x6')](),auth[_0x29a1('0x9')](),controller['reset']);router[_0x29a1('0x4')](_0x29a1('0xa'),auth[_0x29a1('0x6')](),auth[_0x29a1('0x9')](),controller['pull']);router[_0x29a1('0x4')](_0x29a1('0xb'),auth[_0x29a1('0x6')](),controller[_0x29a1('0xc')]);router[_0x29a1('0x4')](_0x29a1('0xd'),controller[_0x29a1('0xe')]);module[_0x29a1('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index a1b9a8c..af04412 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 _0x6080=['origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','length','.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','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','child_process','exec','../../config/environment','../../config/logger','simple-git','root','index','query','tags','exports','latest','2.0.0','status','json','fetch'];(function(_0x5ae00c,_0x29d3b7){var _0x43b618=function(_0x3875f8){while(--_0x3875f8){_0x5ae00c['push'](_0x5ae00c['shift']());}};_0x43b618(++_0x29d3b7);}(_0x6080,0x131));var _0x0608=function(_0x45cf99,_0x53ae67){_0x45cf99=_0x45cf99-0x0;var _0xa0d487=_0x6080[_0x45cf99];return _0xa0d487;};'use strict';var Umzug=require(_0x0608('0x0'));var path=require(_0x0608('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x0608('0x2'))(module,_0x0608('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x0608('0x4'))[_0x0608('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x0608('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x0608('0x7'))('update');var git=require(_0x0608('0x8'))(config[_0x0608('0x9')]);exports[_0x0608('0xa')]=function(_0x2d9ae8,_0x44daf9){var _0x439b60={'current':module['exports'][_0x0608('0x3')],'phonebar':0x2};if(_0x2d9ae8[_0x0608('0xb')]&&_0x2d9ae8['query']['latest']){return git['fetch']()[_0x0608('0xc')](function(_0x1ff4f7,_0x5dce59){_0x439b60['latest']=(_0x1ff4f7?module[_0x0608('0xd')]['version']:_0x5dce59[_0x0608('0xe')])||_0x0608('0xf');return _0x44daf9[_0x0608('0x10')](0xc8)[_0x0608('0x11')](_0x439b60);});}else{return _0x44daf9['status'](0xc8)[_0x0608('0x11')](_0x439b60);}};exports[_0x0608('0x12')]=function(_0x1b32b3,_0x400260){return git['fetch']([_0x0608('0x13'),_0x0608('0x14')],function(_0x4b2e7e){if(_0x4b2e7e){logger[_0x0608('0x15')](_0x4b2e7e);return _0x400260[_0x0608('0x10')](0x1f4)[_0x0608('0x11')](_0x4b2e7e);}logger[_0x0608('0x16')](_0x0608('0x17'));return _0x400260[_0x0608('0x10')](0xc8)['json']({'output':_0x0608('0x18')});});};exports[_0x0608('0x19')]=function(_0x4a5325,_0x419e60){return git[_0x0608('0x19')]([_0x0608('0x1a'),_0x0608('0x1b')],function(_0x265444){if(_0x265444){logger[_0x0608('0x15')](_0x265444);return _0x419e60[_0x0608('0x10')](0x1f4)[_0x0608('0x11')](_0x265444);}logger[_0x0608('0x16')](_0x0608('0x1c'));return _0x419e60[_0x0608('0x10')](0xc8)[_0x0608('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x0608('0x1d')]=function(_0x317778,_0xa7b616){exec(_0x0608('0x1e'),function(_0x4a43a9,_0x100278,_0xff1868){logger[_0x0608('0x16')](_0x100278);logger[_0x0608('0x16')](_0xff1868);if(_0x4a43a9){logger[_0x0608('0x15')](_0x4a43a9);return _0xa7b616['status'](0x1f4)[_0x0608('0x11')](_0x4a43a9);}return _0xa7b616[_0x0608('0x10')](0xc8)[_0x0608('0x11')]({'output':_0x100278});});};exports['restart']=function(_0xbd46e,_0x4cf6da){return pm2[_0x0608('0x1f')](_0x0608('0x20'))[_0x0608('0x21')](function(_0x287b67){logger[_0x0608('0x16')](_0x0608('0x22'),_0x287b67);return _0x4cf6da[_0x0608('0x10')](0xc8)['json']({'output':_0x0608('0x23')});})['catch'](function(_0x5679a8){logger[_0x0608('0x15')](_0x5679a8);return _0x4cf6da[_0x0608('0x10')](0x1f4)[_0x0608('0x11')](_0x5679a8);});};exports[_0x0608('0x24')]=function(_0x2be065,_0x5a57d7){var _0x1facb6=fs[_0x0608('0x25')](path[_0x0608('0x26')](config[_0x0608('0x9')],'server',_0x0608('0x24')));var _0x1ec9f9=[];for(var _0x4e7d0d=0x0;_0x4e7d0d<_0x1facb6[_0x0608('0x27')];_0x4e7d0d++){var _0x5c9a2c=_0x1facb6[_0x4e7d0d]['replace'](_0x0608('0x28'),'');if(compareVersions(module[_0x0608('0xd')][_0x0608('0x3')],_0x5c9a2c)===-0x1){_0x1ec9f9[_0x0608('0x29')](_0x5c9a2c);}}if(_0x1ec9f9[_0x0608('0x27')]){var _0x2a65cb=_0x1ec9f9[_0x0608('0x2a')](compareVersions);var _0x2f5110=new Umzug({'storage':_0x0608('0x2b'),'storageOptions':{'model':db[_0x0608('0x2c')],'modelName':_0x0608('0x2c'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x0608('0x2d')](),db[_0x0608('0x2b')][_0x0608('0x2e')],function(){throw new Error(_0x0608('0x2f'));}],'path':path[_0x0608('0x26')](config[_0x0608('0x9')],'server','migrations'),'pattern':/\.js$/}});_0x2f5110['up']({'migrations':_[_0x0608('0x30')](_0x2a65cb,function(_0x28eee4){return _0x28eee4+_0x0608('0x28');})})['then'](function(){return _0x5a57d7[_0x0608('0x10')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x0608('0xd')][_0x0608('0x3')]+_0x0608('0x31')+_[_0x0608('0x32')](_0x2a65cb),'migrations':_[_0x0608('0x26')](_0x2a65cb)});})[_0x0608('0x33')](function(_0x408908){if(_0x408908 instanceof db[_0x0608('0x2b')][_0x0608('0x34')]){return _0x5a57d7[_0x0608('0x10')](0xc8)[_0x0608('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x5a57d7[_0x0608('0x10')](0x1f4)[_0x0608('0x11')](_0x408908);}});}else{return _0x5a57d7[_0x0608('0x10')](0xc8)[_0x0608('0x11')]({'output':_0x0608('0x35')});}}; \ No newline at end of file +var _0x453d=['sort','Migration','sequelize','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','exports','version','query','latest','json','status','fetch','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','server','migrations','length','replace','.js','push'];(function(_0x459573,_0x35679e){var _0x51ffcd=function(_0x37bb90){while(--_0x37bb90){_0x459573['push'](_0x459573['shift']());}};_0x51ffcd(++_0x35679e);}(_0x453d,0x9c));var _0xd453=function(_0x4d1282,_0x2f9bf7){_0x4d1282=_0x4d1282-0x0;var _0x5d34d3=_0x453d[_0x4d1282];return _0x5d34d3;};'use strict';var Umzug=require(_0xd453('0x0'));var path=require(_0xd453('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xd453('0x2'));var exec=require(_0xd453('0x3'))[_0xd453('0x4')];var db=require(_0xd453('0x5'))['db'];var config=require(_0xd453('0x6'));var pm2=require(_0xd453('0x7'));var logger=require(_0xd453('0x8'))(_0xd453('0x9'));var git=require('simple-git')(config[_0xd453('0xa')]);exports['index']=function(_0x28ede5,_0x4b84e4){var _0x5d9e61={'current':module[_0xd453('0xb')][_0xd453('0xc')],'phonebar':0x2};if(_0x28ede5[_0xd453('0xd')]&&_0x28ede5[_0xd453('0xd')]['latest']){return git['fetch']()['tags'](function(_0x2d7580,_0x403037){_0x5d9e61[_0xd453('0xe')]=(_0x2d7580?module[_0xd453('0xb')][_0xd453('0xc')]:_0x403037[_0xd453('0xe')])||'2.0.0';return _0x4b84e4['status'](0xc8)[_0xd453('0xf')](_0x5d9e61);});}else{return _0x4b84e4[_0xd453('0x10')](0xc8)[_0xd453('0xf')](_0x5d9e61);}};exports['fetch']=function(_0x448beb,_0x1a8db4){return git[_0xd453('0x11')]([_0xd453('0x12'),_0xd453('0x13')],function(_0x5562d7){if(_0x5562d7){logger[_0xd453('0x14')](_0x5562d7);return _0x1a8db4[_0xd453('0x10')](0x1f4)[_0xd453('0xf')](_0x5562d7);}logger[_0xd453('0x15')]('git\x20fetch');return _0x1a8db4[_0xd453('0x10')](0xc8)[_0xd453('0xf')]({'output':_0xd453('0x16')});});};exports[_0xd453('0x17')]=function(_0x220cf2,_0x56b47e){return git[_0xd453('0x17')]([_0xd453('0x18'),'FETCH_HEAD'],function(_0x32d3df){if(_0x32d3df){logger[_0xd453('0x14')](_0x32d3df);return _0x56b47e[_0xd453('0x10')](0x1f4)['json'](_0x32d3df);}logger[_0xd453('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x56b47e['status'](0xc8)[_0xd453('0xf')]({'output':_0xd453('0x19')});});};exports[_0xd453('0x1a')]=function(_0x89db67,_0x3fc133){exec(_0xd453('0x1b'),function(_0x5702b0,_0x36dc78,_0xa9c328){logger[_0xd453('0x15')](_0x36dc78);logger[_0xd453('0x15')](_0xa9c328);if(_0x5702b0){logger[_0xd453('0x14')](_0x5702b0);return _0x3fc133[_0xd453('0x10')](0x1f4)[_0xd453('0xf')](_0x5702b0);}return _0x3fc133[_0xd453('0x10')](0xc8)[_0xd453('0xf')]({'output':_0x36dc78});});};exports[_0xd453('0x1c')]=function(_0x1e981e,_0x42eaa4){return pm2[_0xd453('0x1c')]('motion2')[_0xd453('0x1d')](function(_0x4e00bb){logger['info'](_0xd453('0x1e'),_0x4e00bb);return _0x42eaa4[_0xd453('0x10')](0xc8)[_0xd453('0xf')]({'output':_0xd453('0x1f')});})[_0xd453('0x20')](function(_0xbbbddc){logger[_0xd453('0x14')](_0xbbbddc);return _0x42eaa4[_0xd453('0x10')](0x1f4)[_0xd453('0xf')](_0xbbbddc);});};exports['migrations']=function(_0x154964,_0x3ed21d){var _0x1fc8a8=fs['readdirSync'](path[_0xd453('0x21')](config['root'],_0xd453('0x22'),_0xd453('0x23')));var _0x108e9f=[];for(var _0x46a5b8=0x0;_0x46a5b8<_0x1fc8a8[_0xd453('0x24')];_0x46a5b8++){var _0x383be2=_0x1fc8a8[_0x46a5b8][_0xd453('0x25')](_0xd453('0x26'),'');if(compareVersions(module[_0xd453('0xb')]['version'],_0x383be2)===-0x1){_0x108e9f[_0xd453('0x27')](_0x383be2);}}if(_0x108e9f[_0xd453('0x24')]){var _0x28ce9b=_0x108e9f[_0xd453('0x28')](compareVersions);var _0x821cbe=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd453('0x29')],'modelName':_0xd453('0x29'),'columnName':_0xd453('0xc')},'migrations':{'params':[db[_0xd453('0x2a')]['getQueryInterface'](),db[_0xd453('0x2a')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config['root'],'server',_0xd453('0x23')),'pattern':/\.js$/}});_0x821cbe['up']({'migrations':_[_0xd453('0x2b')](_0x28ce9b,function(_0x513027){return _0x513027+'.js';})})[_0xd453('0x1d')](function(){return _0x3ed21d[_0xd453('0x10')](0xc8)[_0xd453('0xf')]({'output':_0xd453('0x2c')+module[_0xd453('0xb')][_0xd453('0xc')]+_0xd453('0x2d')+_[_0xd453('0x2e')](_0x28ce9b),'migrations':_[_0xd453('0x21')](_0x28ce9b)});})['catch'](function(_0x58ccb8){if(_0x58ccb8 instanceof db[_0xd453('0x2a')][_0xd453('0x2f')]){return _0x3ed21d[_0xd453('0x10')](0xc8)['json']({'output':_0xd453('0x30')});}else{return _0x3ed21d[_0xd453('0x10')](0x1f4)[_0xd453('0xf')](_0x58ccb8);}});}else{return _0x3ed21d[_0xd453('0x10')](0xc8)[_0xd453('0xf')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 1414ff1..ef01f3b 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 _0x303d=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','/describe','describe'];(function(_0x2084d0,_0x4d422e){var _0x5a6e17=function(_0x2c27f3){while(--_0x2c27f3){_0x2084d0['push'](_0x2084d0['shift']());}};_0x5a6e17(++_0x4d422e);}(_0x303d,0x198));var _0xd303=function(_0x105c51,_0x412d34){_0x105c51=_0x105c51-0x0;var _0x1f727d=_0x303d[_0x105c51];return _0x1f727d;};'use strict';var multer=require(_0xd303('0x0'));var util=require(_0xd303('0x1'));var path=require('path');var timeout=require(_0xd303('0x2'));var express=require(_0xd303('0x3'));var router=express[_0xd303('0x4')]();var fs_extra=require(_0xd303('0x5'));var auth=require(_0xd303('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd303('0x7'));var controller=require(_0xd303('0x8'));router[_0xd303('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd303('0xa'),auth['isAuthenticated'](),controller[_0xd303('0xb')]);router['get'](_0xd303('0xc'),auth[_0xd303('0xd')](),controller[_0xd303('0xe')]);router[_0xd303('0xf')]('/',auth[_0xd303('0xd')](),controller[_0xd303('0x10')]);router[_0xd303('0x11')](_0xd303('0xc'),auth['isAuthenticated'](),controller[_0xd303('0x12')]);router[_0xd303('0x13')](_0xd303('0xc'),auth[_0xd303('0xd')](),controller[_0xd303('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbffb=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','update','delete','destroy','exports','multer'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0xbffb,0x1b7));var _0xbbff=function(_0x286864,_0x85d92a){_0x286864=_0x286864-0x0;var _0x2c4792=_0xbffb[_0x286864];return _0x2c4792;};'use strict';var multer=require(_0xbbff('0x0'));var util=require(_0xbbff('0x1'));var path=require(_0xbbff('0x2'));var timeout=require(_0xbbff('0x3'));var express=require('express');var router=express[_0xbbff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbbff('0x5'));var interaction=require(_0xbbff('0x6'));var config=require(_0xbbff('0x7'));var controller=require(_0xbbff('0x8'));router[_0xbbff('0x9')]('/',auth['isAuthenticated'](),controller[_0xbbff('0xa')]);router[_0xbbff('0x9')](_0xbbff('0xb'),auth[_0xbbff('0xc')](),controller[_0xbbff('0xd')]);router['get'](_0xbbff('0xe'),auth[_0xbbff('0xc')](),controller[_0xbbff('0xf')]);router['post']('/',auth[_0xbbff('0xc')](),controller['create']);router['put'](_0xbbff('0xe'),auth[_0xbbff('0xc')](),controller[_0xbbff('0x10')]);router[_0xbbff('0x11')]('/:id',auth[_0xbbff('0xc')](),controller[_0xbbff('0x12')]);module[_0xbbff('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c66a0fa..f358d3b 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 _0x0c1a=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2dcd28,_0x401951){var _0x17650c=function(_0x20b968){while(--_0x20b968){_0x2dcd28['push'](_0x2dcd28['shift']());}};_0x17650c(++_0x401951);}(_0x0c1a,0x127));var _0xa0c1=function(_0x728e33,_0x3f4fa1){_0x728e33=_0x728e33-0x0;var _0xd9728e=_0x0c1a[_0x728e33];return _0xd9728e;};'use strict';var Sequelize=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]={'type':{'type':Sequelize[_0xa0c1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa0c1('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xa0c1('0x2')]},'membername':{'type':Sequelize[_0xa0c1('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentconnectAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentdumpAt':{'type':Sequelize[_0xa0c1('0x3')]},'holdtime':{'type':Sequelize[_0xa0c1('0x4')]},'agentcomplete':{'type':Sequelize[_0xa0c1('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa0c1('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xa0c1('0x4')]},'agentacw':{'type':Sequelize[_0xa0c1('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa0c1('0x4')]},'reason':{'type':Sequelize[_0xa0c1('0x2')]},'lastevent':{'type':Sequelize[_0xa0c1('0x2')]},'channel':{'type':Sequelize[_0xa0c1('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa0c1('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa0c1('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa0c1('0x2')]},'exten':{'type':Sequelize[_0xa0c1('0x2')]},'priority':{'type':Sequelize[_0xa0c1('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa0c1('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xa0c1('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa0c1('0x2')]},'destcalleridname':{'type':Sequelize[_0xa0c1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa0c1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xa0c1('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xa0c1('0x2')]},'destexten':{'type':Sequelize[_0xa0c1('0x2')]},'destpriority':{'type':Sequelize[_0xa0c1('0x2')]},'destuniqueid':{'type':Sequelize[_0xa0c1('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa0c1('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa0c1('0x2')],'comment':_0xa0c1('0x6')},'transferexten':{'type':Sequelize[_0xa0c1('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa0c1('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb91a=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x20a22c,_0x157587){var _0x75f5c=function(_0x1cb8af){while(--_0x1cb8af){_0x20a22c['push'](_0x20a22c['shift']());}};_0x75f5c(++_0x157587);}(_0xb91a,0xe5));var _0xab91=function(_0x56ca63,_0x3b4dd6){_0x56ca63=_0x56ca63-0x0;var _0x1f0168=_0xb91a[_0x56ca63];return _0x1f0168;};'use strict';var Sequelize=require('sequelize');module[_0xab91('0x0')]={'type':{'type':Sequelize[_0xab91('0x1')]},'uniqueid':{'type':Sequelize[_0xab91('0x1')]},'calleridnum':{'type':Sequelize[_0xab91('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xab91('0x1')]},'interface':{'type':Sequelize[_0xab91('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xab91('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xab91('0x2')]},'agentdumpAt':{'type':Sequelize[_0xab91('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xab91('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xab91('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xab91('0x4')]},'agentacw':{'type':Sequelize[_0xab91('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xab91('0x1')]},'channelstate':{'type':Sequelize[_0xab91('0x4')]},'channelstatedesc':{'type':Sequelize[_0xab91('0x1')]},'connectedlinenum':{'type':Sequelize[_0xab91('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xab91('0x1')]},'accountcode':{'type':Sequelize[_0xab91('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xab91('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xab91('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xab91('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xab91('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xab91('0x1')]},'destlanguage':{'type':Sequelize[_0xab91('0x1')]},'destaccountcode':{'type':Sequelize[_0xab91('0x1')]},'destcontext':{'type':Sequelize[_0xab91('0x1')]},'destexten':{'type':Sequelize[_0xab91('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xab91('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xab91('0x1')]},'transfer':{'type':Sequelize[_0xab91('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xab91('0x1')],'comment':_0xab91('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xab91('0x1')]},'agententerreason':{'type':Sequelize[_0xab91('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 573bf23..fefb812 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_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 diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index e01ca26..aeba8c3 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 _0x8098=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid'];(function(_0xe59818,_0x303785){var _0x2ced94=function(_0x4b389a){while(--_0x4b389a){_0xe59818['push'](_0xe59818['shift']());}};_0x2ced94(++_0x303785);}(_0x8098,0x1ba));var _0x8809=function(_0x39195d,_0x362c85){_0x39195d=_0x39195d-0x0;var _0x44262a=_0x8098[_0x39195d];return _0x44262a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8809('0x0'))(_0x8809('0x1'));var moment=require(_0x8809('0x2'));var BPromise=require(_0x8809('0x3'));var rp=require(_0x8809('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8809('0x5'));var config=require(_0x8809('0x6'));var attributes=require(_0x8809('0x7'));module[_0x8809('0x8')]=function(_0x5804f0,_0xeb811){return _0x5804f0[_0x8809('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x8809('0xa'),'paranoid':![],'indexes':[{'fields':[_0x8809('0xb'),_0x8809('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14f5=['./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','util','api','moment','bluebird','path','rimraf'];(function(_0x1a5f1b,_0x5bb416){var _0x79ea2f=function(_0x1b6dc9){while(--_0x1b6dc9){_0x1a5f1b['push'](_0x1a5f1b['shift']());}};_0x79ea2f(++_0x5bb416);}(_0x14f5,0xae));var _0x514f=function(_0x58e4e0,_0x2958fa){_0x58e4e0=_0x58e4e0-0x0;var _0x1aea62=_0x14f5[_0x58e4e0];return _0x1aea62;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var logger=require('../../config/logger')(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x514f('0x4'));var rimraf=require(_0x514f('0x5'));var config=require('../../config/environment');var attributes=require(_0x514f('0x6'));module[_0x514f('0x7')]=function(_0xc2ca56,_0x434452){return _0xc2ca56[_0x514f('0x8')](_0x514f('0x9'),attributes,{'tableName':_0x514f('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x514f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index fa9c7c1..dca6b1a 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 _0x9053=['catch','CreateVoiceAgentReport','VoiceAgentReport','options','raw','update','body','attributes','limit','UpdateVoiceAgentReport','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0x9053,0xaa));var _0x3905=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0x9053[_0x8afdd0];return _0x3de7ac;};'use strict';var _=require(_0x3905('0x0'));var util=require('util');var moment=require(_0x3905('0x1'));var BPromise=require(_0x3905('0x2'));var rs=require(_0x3905('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3905('0x4'));var logger=require(_0x3905('0x5'))(_0x3905('0x6'));var config=require(_0x3905('0x7'));var jayson=require(_0x3905('0x8'));var client=jayson[_0x3905('0x9')][_0x3905('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522c59,_0x498814,_0x545f1d){return new BPromise(function(_0x14bb72,_0x251f2d){return client[_0x3905('0xb')](_0x522c59,_0x545f1d)[_0x3905('0xc')](function(_0x1cf257){logger['info'](_0x3905('0xd'),_0x498814,_0x3905('0xe'));logger[_0x3905('0xf')](_0x3905('0x10'),_0x498814,_0x3905('0xe'),JSON[_0x3905('0x11')](_0x1cf257));if(_0x1cf257['error']){if(_0x1cf257['error']['code']===0x1f4){logger[_0x3905('0x12')](_0x3905('0xd'),_0x498814,_0x1cf257[_0x3905('0x12')][_0x3905('0x13')]);return _0x251f2d(_0x1cf257[_0x3905('0x12')][_0x3905('0x13')]);}logger[_0x3905('0x12')](_0x3905('0xd'),_0x498814,_0x1cf257[_0x3905('0x12')][_0x3905('0x13')]);return _0x14bb72(_0x1cf257['error'][_0x3905('0x13')]);}else{logger[_0x3905('0x14')](_0x3905('0xd'),_0x498814,_0x3905('0xe'));_0x14bb72(_0x1cf257[_0x3905('0x15')][_0x3905('0x13')]);}})[_0x3905('0x16')](function(_0x4cdd40){logger['error'](_0x3905('0xd'),_0x498814,_0x4cdd40);_0x251f2d(_0x4cdd40);});});}exports[_0x3905('0x17')]=function(_0x12b238){var _0x4f483f=this;return new Promise(function(_0x2bfafe,_0x408e9e){return db[_0x3905('0x18')]['create'](_0x12b238['body'],{'raw':_0x12b238[_0x3905('0x19')]?_0x12b238[_0x3905('0x19')][_0x3905('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xbc53e1){logger[_0x3905('0x14')](_0x3905('0x17'),_0x12b238);logger[_0x3905('0xf')](_0x3905('0x17'),_0x12b238,JSON[_0x3905('0x11')](_0xbc53e1));_0x2bfafe(_0xbc53e1);})['catch'](function(_0x2bb9f8){logger[_0x3905('0x12')](_0x3905('0x17'),_0x2bb9f8[_0x3905('0x13')],_0x12b238);_0x408e9e(_0x4f483f[_0x3905('0x12')](0x1f4,_0x2bb9f8['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x5903f9){var _0xd91b9=this;return new Promise(function(_0x348569,_0xba1938){return db[_0x3905('0x18')][_0x3905('0x1b')](_0x5903f9[_0x3905('0x1c')],{'raw':_0x5903f9[_0x3905('0x19')]?_0x5903f9[_0x3905('0x19')][_0x3905('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5903f9[_0x3905('0x19')]?_0x5903f9[_0x3905('0x19')]['where']||null:null,'attributes':_0x5903f9['options']?_0x5903f9['options'][_0x3905('0x1d')]||null:null,'limit':_0x5903f9[_0x3905('0x19')]?_0x5903f9[_0x3905('0x19')][_0x3905('0x1e')]||null:null})[_0x3905('0xc')](function(_0x37a8e9){logger['info'](_0x3905('0x1f'),_0x5903f9);logger[_0x3905('0xf')](_0x3905('0x1f'),_0x5903f9,JSON['stringify'](_0x37a8e9));_0x348569(_0x37a8e9);})[_0x3905('0x16')](function(_0x156152){logger[_0x3905('0x12')](_0x3905('0x1f'),_0x156152['message'],_0x5903f9);_0xba1938(_0xd91b9[_0x3905('0x12')](0x1f4,_0x156152[_0x3905('0x13')]));});});}; \ No newline at end of file +var _0x685c=['jayson/promise','client','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','info','stringify','UpdateVoiceAgentReport','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4f7819,_0x4c3248){var _0x564dc6=function(_0x5721e6){while(--_0x5721e6){_0x4f7819['push'](_0x4f7819['shift']());}};_0x564dc6(++_0x4c3248);}(_0x685c,0xca));var _0xc685=function(_0x388f13,_0x3f05ef){_0x388f13=_0x388f13-0x0;var _0x18978c=_0x685c[_0x388f13];return _0x18978c;};'use strict';var _=require(_0xc685('0x0'));var util=require(_0xc685('0x1'));var moment=require('moment');var BPromise=require(_0xc685('0x2'));var rs=require(_0xc685('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc685('0x4'))['db'];var utils=require(_0xc685('0x5'));var logger=require(_0xc685('0x6'))(_0xc685('0x7'));var config=require('../../config/environment');var jayson=require(_0xc685('0x8'));var client=jayson[_0xc685('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a45df,_0x1b5413,_0x2fc856){return new BPromise(function(_0x37a947,_0x3d2cf8){return client['request'](_0x1a45df,_0x2fc856)['then'](function(_0x1f6c11){logger['info'](_0xc685('0xa'),_0x1b5413,_0xc685('0xb'));logger[_0xc685('0xc')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1b5413,_0xc685('0xb'),JSON['stringify'](_0x1f6c11));if(_0x1f6c11[_0xc685('0xd')]){if(_0x1f6c11[_0xc685('0xd')][_0xc685('0xe')]===0x1f4){logger[_0xc685('0xd')](_0xc685('0xa'),_0x1b5413,_0x1f6c11[_0xc685('0xd')]['message']);return _0x3d2cf8(_0x1f6c11['error'][_0xc685('0xf')]);}logger[_0xc685('0xd')](_0xc685('0xa'),_0x1b5413,_0x1f6c11[_0xc685('0xd')][_0xc685('0xf')]);return _0x37a947(_0x1f6c11[_0xc685('0xd')]['message']);}else{logger['info'](_0xc685('0xa'),_0x1b5413,'request\x20sent');_0x37a947(_0x1f6c11[_0xc685('0x10')][_0xc685('0xf')]);}})[_0xc685('0x11')](function(_0x19807f){logger[_0xc685('0xd')](_0xc685('0xa'),_0x1b5413,_0x19807f);_0x3d2cf8(_0x19807f);});});}exports[_0xc685('0x12')]=function(_0x20ed9a){var _0x3e5b2e=this;return new Promise(function(_0x49f3e2,_0x514e3a){return db[_0xc685('0x13')][_0xc685('0x14')](_0x20ed9a[_0xc685('0x15')],{'raw':_0x20ed9a[_0xc685('0x16')]?_0x20ed9a[_0xc685('0x16')][_0xc685('0x17')]===undefined?!![]:![]:!![]})[_0xc685('0x18')](function(_0x1b4c74){logger[_0xc685('0x19')](_0xc685('0x12'),_0x20ed9a);logger[_0xc685('0xc')]('CreateVoiceAgentReport',_0x20ed9a,JSON[_0xc685('0x1a')](_0x1b4c74));_0x49f3e2(_0x1b4c74);})[_0xc685('0x11')](function(_0x301cb3){logger[_0xc685('0xd')]('CreateVoiceAgentReport',_0x301cb3[_0xc685('0xf')],_0x20ed9a);_0x514e3a(_0x3e5b2e['error'](0x1f4,_0x301cb3[_0xc685('0xf')]));});});};exports[_0xc685('0x1b')]=function(_0x304e97){var _0x18c594=this;return new Promise(function(_0x284d21,_0x25c562){return db[_0xc685('0x13')]['update'](_0x304e97[_0xc685('0x15')],{'raw':_0x304e97[_0xc685('0x16')]?_0x304e97[_0xc685('0x16')][_0xc685('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x304e97[_0xc685('0x16')]?_0x304e97['options'][_0xc685('0x1c')]||null:null,'attributes':_0x304e97['options']?_0x304e97[_0xc685('0x16')][_0xc685('0x1d')]||null:null,'limit':_0x304e97['options']?_0x304e97[_0xc685('0x16')]['limit']||null:null})['then'](function(_0x42d6c4){logger[_0xc685('0x19')](_0xc685('0x1b'),_0x304e97);logger['debug'](_0xc685('0x1b'),_0x304e97,JSON['stringify'](_0x42d6c4));_0x284d21(_0x42d6c4);})[_0xc685('0x11')](function(_0x31d955){logger['error'](_0xc685('0x1b'),_0x31d955[_0xc685('0xf')],_0x304e97);_0x25c562(_0x18c594[_0xc685('0xd')](0x1f4,_0x31d955[_0xc685('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2335a9a..9c2ff31 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 _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','./voiceCallReport.controller','index'];(function(_0x218cc8,_0x216842){var _0x5b544f=function(_0x3eccb0){while(--_0x3eccb0){_0x218cc8['push'](_0x218cc8['shift']());}};_0x5b544f(++_0x216842);}(_0x5075,0x73));var _0x5507=function(_0x4c075b,_0x56c2e7){_0x4c075b=_0x4c075b-0x0;var _0x228448=_0x5075[_0x4c075b];return _0x228448;};'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 _0x8ef6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3016e7,_0x4ab766){var _0x161e80=function(_0x27cda8){while(--_0x27cda8){_0x3016e7['push'](_0x3016e7['shift']());}};_0x161e80(++_0x4ab766);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3b1207,_0x4f2aed){_0x3b1207=_0x3b1207-0x0;var _0x312b43=_0x8ef6[_0x3b1207];return _0x312b43;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')]('/:id',auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);module[_0x68ef('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b689a13..887ab00 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 _0x7ee4=['INTEGER','exports','STRING','inbound','inbound-fax','outbound-fax','dialer','TEXT','DATE'];(function(_0x165204,_0x3b4280){var _0x5f1816=function(_0x496651){while(--_0x496651){_0x165204['push'](_0x165204['shift']());}};_0x5f1816(++_0x3b4280);}(_0x7ee4,0xac));var _0x47ee=function(_0x2156f9,_0x7c681c){_0x2156f9=_0x2156f9-0x0;var _0x339fff=_0x7ee4[_0x2156f9];return _0x339fff;};'use strict';var Sequelize=require('sequelize');module[_0x47ee('0x0')]={'uniqueid':{'type':Sequelize[_0x47ee('0x1')]},'type':{'type':Sequelize['ENUM'](_0x47ee('0x2'),'internal','outbound',_0x47ee('0x3'),_0x47ee('0x4'),_0x47ee('0x5'))},'tag':{'type':Sequelize[_0x47ee('0x1')]},'accountcode':{'type':Sequelize[_0x47ee('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x47ee('0x1')]},'callerid':{'type':Sequelize[_0x47ee('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x47ee('0x1')]},'lastapplication':{'type':Sequelize[_0x47ee('0x1')]},'lastdata':{'type':Sequelize[_0x47ee('0x6')]},'starttime':{'type':Sequelize[_0x47ee('0x7')]},'systemanswertime':{'type':Sequelize[_0x47ee('0x7')]},'answertime':{'type':Sequelize[_0x47ee('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x47ee('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x47ee('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x47ee('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x47ee('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x47ee('0x1')]},'note':{'type':Sequelize[_0x47ee('0x1')]},'prefix':{'type':Sequelize[_0x47ee('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x47ee('0x1')]}}; \ No newline at end of file +var _0x0100=['DATE','INTEGER','sequelize','STRING','ENUM','internal','outbound','outbound-fax','dialer','TEXT'];(function(_0x110c93,_0x54f055){var _0xf35ef6=function(_0x4195e5){while(--_0x4195e5){_0x110c93['push'](_0x110c93['shift']());}};_0xf35ef6(++_0x54f055);}(_0x0100,0x7a));var _0x0010=function(_0x2e2ced,_0x1e165e){_0x2e2ced=_0x2e2ced-0x0;var _0x205d62=_0x0100[_0x2e2ced];return _0x205d62;};'use strict';var Sequelize=require(_0x0010('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0010('0x1')]},'type':{'type':Sequelize[_0x0010('0x2')]('inbound',_0x0010('0x3'),_0x0010('0x4'),'inbound-fax',_0x0010('0x5'),_0x0010('0x6'))},'tag':{'type':Sequelize[_0x0010('0x1')]},'accountcode':{'type':Sequelize[_0x0010('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0010('0x1')]},'destinationcontext':{'type':Sequelize[_0x0010('0x1')]},'callerid':{'type':Sequelize[_0x0010('0x1')]},'channel':{'type':Sequelize[_0x0010('0x1')]},'destinationchannel':{'type':Sequelize[_0x0010('0x1')]},'lastapplication':{'type':Sequelize[_0x0010('0x1')]},'lastdata':{'type':Sequelize[_0x0010('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0010('0x8')]},'answertime':{'type':Sequelize[_0x0010('0x8')]},'endtime':{'type':Sequelize[_0x0010('0x8')]},'duration':{'type':Sequelize[_0x0010('0x9')]},'billableseconds':{'type':Sequelize[_0x0010('0x9')]},'mohtime':{'type':Sequelize[_0x0010('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0010('0x1')]},'amaflags':{'type':Sequelize[_0x0010('0x1')]},'userfield':{'type':Sequelize[_0x0010('0x1')]},'userDisposition':{'type':Sequelize[_0x0010('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x0010('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0010('0x1')]},'prefix':{'type':Sequelize[_0x0010('0x1')]},'routeid':{'type':Sequelize[_0x0010('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 9e0f171..06c50f1 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x2ef3,0xba));var _0x32ef=function(_0x2ccd20,_0x524f45){_0x2ccd20=_0x2ccd20-0x0;var _0x11c03d=_0x2ef3[_0x2ccd20];return _0x11c03d;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0xadb5,0xad));var _0x5adb=function(_0x29b613,_0x5afb06){_0x29b613=_0x29b613-0x0;var _0x2dcd9b=_0xadb5[_0x29b613];return _0x2dcd9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 24f10e6..603b281 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 _0xf433=['VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x1e8381,_0x2795d1){var _0x39a797=function(_0x2d2dea){while(--_0x2d2dea){_0x1e8381['push'](_0x1e8381['shift']());}};_0x39a797(++_0x2795d1);}(_0xf433,0xb9));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f43('0x0'));var util=require(_0x3f43('0x1'));var logger=require(_0x3f43('0x2'))(_0x3f43('0x3'));var moment=require(_0x3f43('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f43('0x5'));var rimraf=require(_0x3f43('0x6'));var config=require(_0x3f43('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x3f43('0x8')]=function(_0x3813c5,_0xfde922){return _0x3813c5[_0x3f43('0x9')](_0x3f43('0xa'),attributes,{'tableName':_0x3f43('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3f43('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb9d=['VoiceCallReport','report_call','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0xfb9d,0x120));var _0xdfb9=function(_0x258a9e,_0x388f93){_0x258a9e=_0x258a9e-0x0;var _0x1016b2=_0xfb9d[_0x258a9e];return _0x1016b2;};'use strict';var _=require(_0xdfb9('0x0'));var util=require('util');var logger=require(_0xdfb9('0x1'))(_0xdfb9('0x2'));var moment=require(_0xdfb9('0x3'));var BPromise=require('bluebird');var rp=require(_0xdfb9('0x4'));var fs=require('fs');var path=require(_0xdfb9('0x5'));var rimraf=require(_0xdfb9('0x6'));var config=require(_0xdfb9('0x7'));var attributes=require(_0xdfb9('0x8'));module[_0xdfb9('0x9')]=function(_0x5397b4,_0x1b4c68){return _0x5397b4[_0xdfb9('0xa')](_0xdfb9('0xb'),attributes,{'tableName':_0xdfb9('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 2811494..f6bbc29 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 _0x0dcf=['http','request','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','result','catch','GetVoiceCallReport','findAll','options','raw','limit','include','map','model','attributes','then','info','CreateVoiceCallReport','create','UpdateVoiceCallReport','VoiceCallReport','update','body','where','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x0dcf,0xe1));var _0xf0dc=function(_0x4a8cb9,_0x2640cd){_0x4a8cb9=_0x4a8cb9-0x0;var _0x2e5ab9=_0x0dcf[_0x4a8cb9];return _0x2e5ab9;};'use strict';var _=require('lodash');var util=require(_0xf0dc('0x0'));var moment=require('moment');var BPromise=require(_0xf0dc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0dc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0dc('0x3'));var logger=require(_0xf0dc('0x4'))(_0xf0dc('0x5'));var config=require(_0xf0dc('0x6'));var jayson=require(_0xf0dc('0x7'));var client=jayson[_0xf0dc('0x8')][_0xf0dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa0f9,_0x5688a2,_0x31a4a5){return new BPromise(function(_0x3d4315,_0x27daea){return client[_0xf0dc('0xa')](_0xa0f9,_0x31a4a5)['then'](function(_0x5edca6){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x5688a2,_0xf0dc('0xb'));logger[_0xf0dc('0xc')](_0xf0dc('0xd'),_0x5688a2,_0xf0dc('0xb'),JSON[_0xf0dc('0xe')](_0x5edca6));if(_0x5edca6[_0xf0dc('0xf')]){if(_0x5edca6[_0xf0dc('0xf')][_0xf0dc('0x10')]===0x1f4){logger[_0xf0dc('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x5688a2,_0x5edca6[_0xf0dc('0xf')]['message']);return _0x27daea(_0x5edca6['error'][_0xf0dc('0x11')]);}logger[_0xf0dc('0xf')](_0xf0dc('0x12'),_0x5688a2,_0x5edca6[_0xf0dc('0xf')][_0xf0dc('0x11')]);return _0x3d4315(_0x5edca6[_0xf0dc('0xf')][_0xf0dc('0x11')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x5688a2,_0xf0dc('0xb'));_0x3d4315(_0x5edca6[_0xf0dc('0x13')][_0xf0dc('0x11')]);}})[_0xf0dc('0x14')](function(_0x3fb26a){logger[_0xf0dc('0xf')](_0xf0dc('0x12'),_0x5688a2,_0x3fb26a);_0x27daea(_0x3fb26a);});});}exports[_0xf0dc('0x15')]=function(_0x3a7b99){var _0xff6b12=this;return new Promise(function(_0x3e4080,_0x2a5c6a){return db['VoiceCallReport'][_0xf0dc('0x16')]({'raw':_0x3a7b99[_0xf0dc('0x17')]?_0x3a7b99[_0xf0dc('0x17')][_0xf0dc('0x18')]===undefined?!![]:![]:!![],'where':_0x3a7b99[_0xf0dc('0x17')]?_0x3a7b99['options']['where']||null:null,'attributes':_0x3a7b99[_0xf0dc('0x17')]?_0x3a7b99[_0xf0dc('0x17')]['attributes']||null:null,'limit':_0x3a7b99[_0xf0dc('0x17')]?_0x3a7b99['options'][_0xf0dc('0x19')]||null:null,'include':_0x3a7b99[_0xf0dc('0x17')]?_0x3a7b99[_0xf0dc('0x17')][_0xf0dc('0x1a')]?_[_0xf0dc('0x1b')](_0x3a7b99['options'][_0xf0dc('0x1a')],function(_0x4e4e85){return{'model':db[_0x4e4e85[_0xf0dc('0x1c')]],'as':_0x4e4e85['as'],'attributes':_0x4e4e85[_0xf0dc('0x1d')],'include':_0x4e4e85[_0xf0dc('0x1a')]?_['map'](_0x4e4e85[_0xf0dc('0x1a')],function(_0x499d62){return{'model':db[_0x499d62[_0xf0dc('0x1c')]],'as':_0x499d62['as'],'attributes':_0x499d62[_0xf0dc('0x1d')],'include':_0x499d62[_0xf0dc('0x1a')]?_['map'](_0x499d62[_0xf0dc('0x1a')],function(_0x5220e0){return{'model':db[_0x5220e0[_0xf0dc('0x1c')]],'as':_0x5220e0['as'],'attributes':_0x5220e0[_0xf0dc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf0dc('0x1e')](function(_0x8aeba9){logger[_0xf0dc('0x1f')](_0xf0dc('0x15'),_0x3a7b99);logger['debug']('GetVoiceCallReport',_0x3a7b99,JSON['stringify'](_0x8aeba9));_0x3e4080(_0x8aeba9);})[_0xf0dc('0x14')](function(_0x5f089a){logger['error'](_0xf0dc('0x15'),_0x5f089a[_0xf0dc('0x11')],_0x3a7b99);_0x2a5c6a(_0xff6b12[_0xf0dc('0xf')](0x1f4,_0x5f089a[_0xf0dc('0x11')]));});});};exports[_0xf0dc('0x20')]=function(_0x5c5c30){var _0x36c460=this;return new Promise(function(_0x1867a0,_0x52bc03){return db['VoiceCallReport'][_0xf0dc('0x21')](_0x5c5c30['body'],{'raw':_0x5c5c30[_0xf0dc('0x17')]?_0x5c5c30[_0xf0dc('0x17')][_0xf0dc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x34bfec){logger[_0xf0dc('0x1f')](_0xf0dc('0x20'),_0x5c5c30);logger[_0xf0dc('0xc')]('CreateVoiceCallReport',_0x5c5c30,JSON['stringify'](_0x34bfec));_0x1867a0(_0x34bfec);})[_0xf0dc('0x14')](function(_0x54292e){logger[_0xf0dc('0xf')](_0xf0dc('0x20'),_0x54292e[_0xf0dc('0x11')],_0x5c5c30);_0x52bc03(_0x36c460[_0xf0dc('0xf')](0x1f4,_0x54292e[_0xf0dc('0x11')]));});});};exports[_0xf0dc('0x22')]=function(_0x4809ee){var _0x3acac8=this;return new Promise(function(_0x5a9f65,_0x55b924){return db[_0xf0dc('0x23')][_0xf0dc('0x24')](_0x4809ee[_0xf0dc('0x25')],{'raw':_0x4809ee[_0xf0dc('0x17')]?_0x4809ee[_0xf0dc('0x17')][_0xf0dc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4809ee[_0xf0dc('0x17')]?_0x4809ee['options'][_0xf0dc('0x26')]||null:null,'attributes':_0x4809ee[_0xf0dc('0x17')]?_0x4809ee['options']['attributes']||null:null,'limit':_0x4809ee[_0xf0dc('0x17')]?_0x4809ee['options'][_0xf0dc('0x19')]||null:null})['then'](function(_0x39f3ad){logger['info'](_0xf0dc('0x22'),_0x4809ee);logger[_0xf0dc('0xc')](_0xf0dc('0x22'),_0x4809ee,JSON[_0xf0dc('0xe')](_0x39f3ad));_0x5a9f65(_0x39f3ad);})[_0xf0dc('0x14')](function(_0x5d2490){logger[_0xf0dc('0xf')](_0xf0dc('0x22'),_0x5d2490[_0xf0dc('0x11')],_0x4809ee);_0x55b924(_0x3acac8[_0xf0dc('0xf')](0x1f4,_0x5d2490[_0xf0dc('0x11')]));});});}; \ No newline at end of file +var _0x16c1=['include','map','model','attributes','create','raw','CreateVoiceCallReport','update','body','UpdateVoiceCallReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','where','limit'];(function(_0x1be142,_0x4ad07a){var _0x11f809=function(_0xb2ce8e){while(--_0xb2ce8e){_0x1be142['push'](_0x1be142['shift']());}};_0x11f809(++_0x4ad07a);}(_0x16c1,0x1a1));var _0x116c=function(_0x48b805,_0x475043){_0x48b805=_0x48b805-0x0;var _0x241618=_0x16c1[_0x48b805];return _0x241618;};'use strict';var _=require(_0x116c('0x0'));var util=require(_0x116c('0x1'));var moment=require(_0x116c('0x2'));var BPromise=require('bluebird');var rs=require(_0x116c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x116c('0x4'))['db'];var utils=require(_0x116c('0x5'));var logger=require(_0x116c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x116c('0x7'));var client=jayson[_0x116c('0x8')][_0x116c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c0021,_0x4dac12,_0xa8b583){return new BPromise(function(_0x3a04bd,_0x278ebb){return client[_0x116c('0xa')](_0x4c0021,_0xa8b583)[_0x116c('0xb')](function(_0x363028){logger[_0x116c('0xc')](_0x116c('0xd'),_0x4dac12,_0x116c('0xe'));logger[_0x116c('0xf')](_0x116c('0x10'),_0x4dac12,_0x116c('0xe'),JSON[_0x116c('0x11')](_0x363028));if(_0x363028[_0x116c('0x12')]){if(_0x363028[_0x116c('0x12')]['code']===0x1f4){logger['error'](_0x116c('0xd'),_0x4dac12,_0x363028[_0x116c('0x12')][_0x116c('0x13')]);return _0x278ebb(_0x363028[_0x116c('0x12')][_0x116c('0x13')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x4dac12,_0x363028[_0x116c('0x12')][_0x116c('0x13')]);return _0x3a04bd(_0x363028[_0x116c('0x12')][_0x116c('0x13')]);}else{logger['info'](_0x116c('0xd'),_0x4dac12,_0x116c('0xe'));_0x3a04bd(_0x363028[_0x116c('0x14')][_0x116c('0x13')]);}})[_0x116c('0x15')](function(_0x3c9a56){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x4dac12,_0x3c9a56);_0x278ebb(_0x3c9a56);});});}exports[_0x116c('0x16')]=function(_0xa579f7){var _0xca9e73=this;return new Promise(function(_0x2f2ad9,_0x2ef15f){return db[_0x116c('0x17')]['findAll']({'raw':_0xa579f7['options']?_0xa579f7[_0x116c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xa579f7['options']?_0xa579f7[_0x116c('0x18')][_0x116c('0x19')]||null:null,'attributes':_0xa579f7[_0x116c('0x18')]?_0xa579f7[_0x116c('0x18')]['attributes']||null:null,'limit':_0xa579f7[_0x116c('0x18')]?_0xa579f7['options'][_0x116c('0x1a')]||null:null,'include':_0xa579f7[_0x116c('0x18')]?_0xa579f7[_0x116c('0x18')][_0x116c('0x1b')]?_[_0x116c('0x1c')](_0xa579f7[_0x116c('0x18')][_0x116c('0x1b')],function(_0x583047){return{'model':db[_0x583047[_0x116c('0x1d')]],'as':_0x583047['as'],'attributes':_0x583047['attributes'],'include':_0x583047['include']?_[_0x116c('0x1c')](_0x583047['include'],function(_0x4803f3){return{'model':db[_0x4803f3['model']],'as':_0x4803f3['as'],'attributes':_0x4803f3[_0x116c('0x1e')],'include':_0x4803f3['include']?_[_0x116c('0x1c')](_0x4803f3[_0x116c('0x1b')],function(_0x1cfd1f){return{'model':db[_0x1cfd1f[_0x116c('0x1d')]],'as':_0x1cfd1f['as'],'attributes':_0x1cfd1f[_0x116c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x116c('0xb')](function(_0x3d91ce){logger[_0x116c('0xc')](_0x116c('0x16'),_0xa579f7);logger[_0x116c('0xf')](_0x116c('0x16'),_0xa579f7,JSON['stringify'](_0x3d91ce));_0x2f2ad9(_0x3d91ce);})[_0x116c('0x15')](function(_0x3f2cb3){logger['error'](_0x116c('0x16'),_0x3f2cb3[_0x116c('0x13')],_0xa579f7);_0x2ef15f(_0xca9e73[_0x116c('0x12')](0x1f4,_0x3f2cb3[_0x116c('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x2a9b01){var _0x419533=this;return new Promise(function(_0x1c5c08,_0x3a469c){return db[_0x116c('0x17')][_0x116c('0x1f')](_0x2a9b01['body'],{'raw':_0x2a9b01['options']?_0x2a9b01['options'][_0x116c('0x20')]===undefined?!![]:![]:!![]})[_0x116c('0xb')](function(_0x520739){logger['info'](_0x116c('0x21'),_0x2a9b01);logger[_0x116c('0xf')](_0x116c('0x21'),_0x2a9b01,JSON[_0x116c('0x11')](_0x520739));_0x1c5c08(_0x520739);})['catch'](function(_0x2d1196){logger['error']('CreateVoiceCallReport',_0x2d1196['message'],_0x2a9b01);_0x3a469c(_0x419533[_0x116c('0x12')](0x1f4,_0x2d1196[_0x116c('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x810e17){var _0x1ee547=this;return new Promise(function(_0x4523f8,_0x7cee59){return db['VoiceCallReport'][_0x116c('0x22')](_0x810e17[_0x116c('0x23')],{'raw':_0x810e17['options']?_0x810e17[_0x116c('0x18')][_0x116c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x810e17['options']?_0x810e17[_0x116c('0x18')]['where']||null:null,'attributes':_0x810e17['options']?_0x810e17[_0x116c('0x18')][_0x116c('0x1e')]||null:null,'limit':_0x810e17[_0x116c('0x18')]?_0x810e17[_0x116c('0x18')]['limit']||null:null})[_0x116c('0xb')](function(_0x288edc){logger[_0x116c('0xc')](_0x116c('0x24'),_0x810e17);logger[_0x116c('0xf')](_0x116c('0x24'),_0x810e17,JSON[_0x116c('0x11')](_0x288edc));_0x4523f8(_0x288edc);})[_0x116c('0x15')](function(_0x85ca26){logger[_0x116c('0x12')](_0x116c('0x24'),_0x85ca26[_0x116c('0x13')],_0x810e17);_0x7cee59(_0x1ee547[_0x116c('0x12')](0x1f4,_0x85ca26[_0x116c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 554eb7e..5a6ef92 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 _0xbe38=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update'];(function(_0x21c787,_0x52c061){var _0x2bb6b1=function(_0x9714b4){while(--_0x9714b4){_0x21c787['push'](_0x21c787['shift']());}};_0x2bb6b1(++_0x52c061);}(_0xbe38,0xb7));var _0x8be3=function(_0xd07e81,_0x1ccacd){_0xd07e81=_0xd07e81-0x0;var _0x379364=_0xbe38[_0xd07e81];return _0x379364;};'use strict';var multer=require(_0x8be3('0x0'));var util=require(_0x8be3('0x1'));var path=require(_0x8be3('0x2'));var timeout=require(_0x8be3('0x3'));var express=require(_0x8be3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8be3('0x5'));var interaction=require(_0x8be3('0x6'));var config=require(_0x8be3('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x8be3('0x8')]('/',auth[_0x8be3('0x9')](),controller['index']);router['get'](_0x8be3('0xa'),auth[_0x8be3('0x9')](),controller['show']);router[_0x8be3('0xb')]('/',auth[_0x8be3('0x9')](),controller[_0x8be3('0xc')]);router[_0x8be3('0xd')](_0x8be3('0xa'),auth['isAuthenticated'](),controller[_0x8be3('0xe')]);router[_0x8be3('0xf')](_0x8be3('0xa'),auth[_0x8be3('0x9')](),controller[_0x8be3('0x10')]);module[_0x8be3('0x11')]=router; \ No newline at end of file +var _0xf1bb=['update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated','index','post','create','put','/:id'];(function(_0x3ed4d7,_0x3783e0){var _0x2be1a4=function(_0x5d492f){while(--_0x5d492f){_0x3ed4d7['push'](_0x3ed4d7['shift']());}};_0x2be1a4(++_0x3783e0);}(_0xf1bb,0x1f0));var _0xbf1b=function(_0x8fb006,_0x73ef0f){_0x8fb006=_0x8fb006-0x0;var _0x56862a=_0xf1bb[_0x8fb006];return _0x56862a;};'use strict';var multer=require(_0xbf1b('0x0'));var util=require(_0xbf1b('0x1'));var path=require(_0xbf1b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf1b('0x3')]();var fs_extra=require(_0xbf1b('0x4'));var auth=require(_0xbf1b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbf1b('0x6'));router[_0xbf1b('0x7')]('/',auth[_0xbf1b('0x8')](),controller[_0xbf1b('0x9')]);router[_0xbf1b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbf1b('0xa')]('/',auth[_0xbf1b('0x8')](),controller[_0xbf1b('0xb')]);router[_0xbf1b('0xc')](_0xbf1b('0xd'),auth[_0xbf1b('0x8')](),controller[_0xbf1b('0xe')]);router[_0xbf1b('0xf')]('/:id',auth[_0xbf1b('0x8')](),controller['destroy']);module[_0xbf1b('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fb6b331..5e82d86 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 _0x7da3=['getDataValue','split','BOOLEAN','exports','STRING','setDataValue','options','join'];(function(_0x4349ec,_0x4ceca3){var _0x45cd5b=function(_0x3e9820){while(--_0x3e9820){_0x4349ec['push'](_0x4349ec['shift']());}};_0x45cd5b(++_0x4ceca3);}(_0x7da3,0x143));var _0x37da=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x7da3[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x37da('0x0')]={'name':{'type':Sequelize[_0x37da('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x37da('0x1')],'set':function(_0x12fd18){this[_0x37da('0x2')](_0x37da('0x3'),_0x12fd18?_0x12fd18[_0x37da('0x4')](''):[]);},'get':function(){return this[_0x37da('0x5')](_0x37da('0x3'))?this[_0x37da('0x5')](_0x37da('0x3'))[_0x37da('0x6')](''):[];}},'auth':{'type':Sequelize[_0x37da('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x37da('0x1')]},'record':{'type':Sequelize[_0x37da('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x37da('0x1')]}}; \ No newline at end of file +var _0x6171=['sequelize','STRING','name','setDataValue','options','getDataValue','split'];(function(_0x46e00c,_0x7f08d0){var _0x1bcafe=function(_0x519acc){while(--_0x519acc){_0x46e00c['push'](_0x46e00c['shift']());}};_0x1bcafe(++_0x7f08d0);}(_0x6171,0x142));var _0x1617=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x6171[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require(_0x1617('0x0'));module['exports']={'name':{'type':Sequelize[_0x1617('0x1')]},'prefix':{'type':Sequelize[_0x1617('0x1')],'unique':_0x1617('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x223703){this[_0x1617('0x3')]('options',_0x223703?_0x223703['join'](''):[]);},'get':function(){return this['getDataValue'](_0x1617('0x4'))?this[_0x1617('0x5')](_0x1617('0x4'))[_0x1617('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x1617('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1617('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index a08a05d..0c83c0b 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 _0x4b6c=['params','fields','include','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','ChanSpies','end','error','name','map','VoiceChanSpy','fieldName','type','keys','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','options','includeAll','findAll','rows','catch','show'];(function(_0x67f0fe,_0x1793d9){var _0x471195=function(_0x275094){while(--_0x275094){_0x67f0fe['push'](_0x67f0fe['shift']());}};_0x471195(++_0x1793d9);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc4b6('0x0'));var rimraf=require(_0xc4b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4b6('0x2'));var rp=require(_0xc4b6('0x3'));var moment=require(_0xc4b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4b6('0x5'));var util=require(_0xc4b6('0x6'));var path=require(_0xc4b6('0x7'));var sox=require('sox');var csv=require(_0xc4b6('0x8'));var ejs=require(_0xc4b6('0x9'));var fs=require('fs');var fs_extra=require(_0xc4b6('0xa'));var _=require(_0xc4b6('0xb'));var squel=require('squel');var crypto=require(_0xc4b6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc4b6('0x8'));var querystring=require(_0xc4b6('0xd'));var Papa=require(_0xc4b6('0xe'));var Redis=require(_0xc4b6('0xf'));var authService=require(_0xc4b6('0x10'));var qs=require(_0xc4b6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4b6('0x12'));var logger=require(_0xc4b6('0x13'))('api');var utils=require(_0xc4b6('0x14'));var config=require(_0xc4b6('0x15'));var licenseUtil=require(_0xc4b6('0x16'));var db=require(_0xc4b6('0x17'))['db'];function respondWithStatusCode(_0x286a5a,_0xd6208e){_0xd6208e=_0xd6208e||0xcc;return function(_0xf2a30e){if(_0xf2a30e){return _0x286a5a[_0xc4b6('0x18')](_0xd6208e);}return _0x286a5a[_0xc4b6('0x19')](_0xd6208e)['end']();};}function respondWithResult(_0x21ee35,_0x2b7aab){_0x2b7aab=_0x2b7aab||0xc8;return function(_0x5d9008){if(_0x5d9008){return _0x21ee35[_0xc4b6('0x19')](_0x2b7aab)['json'](_0x5d9008);}};}function respondWithFilteredResult(_0x41be8d,_0x408652){return function(_0x20c517){if(_0x20c517){var _0x23144b=typeof _0x408652['offset']==='undefined'&&typeof _0x408652[_0xc4b6('0x1a')]===_0xc4b6('0x1b');var _0x403f94=_0x20c517[_0xc4b6('0x1c')];var _0x220dfd=_0x23144b?0x0:_0x408652[_0xc4b6('0x1d')];var _0x471bf8=_0x23144b?_0x20c517[_0xc4b6('0x1c')]:_0x408652[_0xc4b6('0x1d')]+_0x408652[_0xc4b6('0x1a')];var _0x5c1f92;if(_0x471bf8>=_0x403f94){_0x471bf8=_0x403f94;_0x5c1f92=0xc8;}else{_0x5c1f92=0xce;}_0x41be8d[_0xc4b6('0x19')](_0x5c1f92);return _0x41be8d['set'](_0xc4b6('0x1e'),_0x220dfd+'-'+_0x471bf8+'/'+_0x403f94)[_0xc4b6('0x1f')](_0x20c517);}return null;};}function patchUpdates(_0x44618b){return function(_0x15a3de){try{jsonpatch[_0xc4b6('0x20')](_0x15a3de,_0x44618b,!![]);}catch(_0x2f207d){return BPromise[_0xc4b6('0x21')](_0x2f207d);}return _0x15a3de[_0xc4b6('0x22')]();};}function saveUpdates(_0x51090f,_0x8fcdde){return function(_0x41fedf){if(_0x41fedf){return _0x41fedf[_0xc4b6('0x23')](_0x51090f)[_0xc4b6('0x24')](function(_0x24592a){return _0x24592a;});}return null;};}function removeEntity(_0x214801,_0x2c2d35){return function(_0x81b146){if(_0x81b146){return _0x81b146[_0xc4b6('0x25')]()['then'](function(){var _0x5a6eff=_0x81b146['get']({'plain':!![]});var _0x392b0f=_0xc4b6('0x26');return db['UserProfileResource'][_0xc4b6('0x25')]({'where':{'type':_0x392b0f,'resourceId':_0x5a6eff['id']}})[_0xc4b6('0x24')](function(){return _0x81b146;});})['then'](function(){_0x214801[_0xc4b6('0x19')](0xcc)[_0xc4b6('0x27')]();});}};}function handleEntityNotFound(_0x1ce21c,_0x3340f3){return function(_0x1ee8d3){if(!_0x1ee8d3){_0x1ce21c[_0xc4b6('0x18')](0x194);}return _0x1ee8d3;};}function handleError(_0x1a1432,_0x391f5b){_0x391f5b=_0x391f5b||0x1f4;return function(_0x31a9de){logger[_0xc4b6('0x28')](_0x31a9de['stack']);if(_0x31a9de[_0xc4b6('0x29')]){delete _0x31a9de[_0xc4b6('0x29')];}_0x1a1432[_0xc4b6('0x19')](_0x391f5b)['send'](_0x31a9de);};}exports['index']=function(_0x1fbdc0,_0x4ef594){var _0x3ec5c1={},_0x1bf9a6={},_0x1e8135={'count':0x0,'rows':[]};var _0x5b5298=_[_0xc4b6('0x2a')](db[_0xc4b6('0x2b')]['rawAttributes'],function(_0x403b43){return{'name':_0x403b43[_0xc4b6('0x2c')],'type':_0x403b43[_0xc4b6('0x2d')]['key']};});_0x1bf9a6['model']=_[_0xc4b6('0x2a')](_0x5b5298,_0xc4b6('0x29'));_0x1bf9a6['query']=_[_0xc4b6('0x2e')](_0x1fbdc0['query']);_0x1bf9a6[_0xc4b6('0x2f')]=_[_0xc4b6('0x30')](_0x1bf9a6[_0xc4b6('0x31')],_0x1bf9a6[_0xc4b6('0x32')]);_0x3ec5c1[_0xc4b6('0x33')]=_[_0xc4b6('0x30')](_0x1bf9a6[_0xc4b6('0x31')],qs['fields'](_0x1fbdc0['query']['fields']));_0x3ec5c1[_0xc4b6('0x33')]=_0x3ec5c1[_0xc4b6('0x33')][_0xc4b6('0x34')]?_0x3ec5c1[_0xc4b6('0x33')]:_0x1bf9a6['model'];if(!_0x1fbdc0['query'][_0xc4b6('0x35')](_0xc4b6('0x36'))){_0x3ec5c1[_0xc4b6('0x1a')]=qs[_0xc4b6('0x1a')](_0x1fbdc0[_0xc4b6('0x32')][_0xc4b6('0x1a')]);_0x3ec5c1[_0xc4b6('0x1d')]=qs['offset'](_0x1fbdc0[_0xc4b6('0x32')][_0xc4b6('0x1d')]);}_0x3ec5c1['order']=qs[_0xc4b6('0x37')](_0x1fbdc0[_0xc4b6('0x32')][_0xc4b6('0x37')]);_0x3ec5c1[_0xc4b6('0x38')]=qs[_0xc4b6('0x2f')](_[_0xc4b6('0x39')](_0x1fbdc0[_0xc4b6('0x32')],_0x1bf9a6[_0xc4b6('0x2f')]),_0x5b5298);if(_0x1fbdc0[_0xc4b6('0x32')]['filter']){_0x3ec5c1[_0xc4b6('0x38')]=_['merge'](_0x3ec5c1[_0xc4b6('0x38')],{'$or':_[_0xc4b6('0x2a')](_0x5b5298,function(_0x3c975b){if(_0x3c975b['type']!==_0xc4b6('0x3a')){var _0x4594e5={};_0x4594e5[_0x3c975b[_0xc4b6('0x29')]]={'$like':'%'+_0x1fbdc0[_0xc4b6('0x32')]['filter']+'%'};return _0x4594e5;}})});}_0x3ec5c1=_['merge']({},_0x3ec5c1,_0x1fbdc0[_0xc4b6('0x3b')]);var _0x379656={'where':_0x3ec5c1[_0xc4b6('0x38')]};return db[_0xc4b6('0x2b')][_0xc4b6('0x1c')](_0x379656)['then'](function(_0x3ec107){_0x1e8135['count']=_0x3ec107;if(_0x1fbdc0['query'][_0xc4b6('0x3c')]){_0x3ec5c1['include']=[{'all':!![]}];}return db[_0xc4b6('0x2b')][_0xc4b6('0x3d')](_0x3ec5c1);})[_0xc4b6('0x24')](function(_0x555acf){_0x1e8135[_0xc4b6('0x3e')]=_0x555acf;return _0x1e8135;})[_0xc4b6('0x24')](respondWithFilteredResult(_0x4ef594,_0x3ec5c1))[_0xc4b6('0x3f')](handleError(_0x4ef594,null));};exports[_0xc4b6('0x40')]=function(_0x26b362,_0x4265f4){var _0x5584af={'raw':![],'where':{'id':_0x26b362[_0xc4b6('0x41')]['id']}},_0x5aaea2={};_0x5aaea2[_0xc4b6('0x31')]=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x5aaea2[_0xc4b6('0x32')]=_[_0xc4b6('0x2e')](_0x26b362[_0xc4b6('0x32')]);_0x5aaea2[_0xc4b6('0x2f')]=_[_0xc4b6('0x30')](_0x5aaea2[_0xc4b6('0x31')],_0x5aaea2[_0xc4b6('0x32')]);_0x5584af['attributes']=_[_0xc4b6('0x30')](_0x5aaea2[_0xc4b6('0x31')],qs[_0xc4b6('0x42')](_0x26b362[_0xc4b6('0x32')][_0xc4b6('0x42')]));_0x5584af[_0xc4b6('0x33')]=_0x5584af[_0xc4b6('0x33')]['length']?_0x5584af['attributes']:_0x5aaea2[_0xc4b6('0x31')];if(_0x26b362[_0xc4b6('0x32')][_0xc4b6('0x3c')]){_0x5584af[_0xc4b6('0x43')]=[{'all':!![]}];}_0x5584af=_['merge']({},_0x5584af,_0x26b362[_0xc4b6('0x3b')]);return db[_0xc4b6('0x2b')][_0xc4b6('0x44')](_0x5584af)[_0xc4b6('0x24')](handleEntityNotFound(_0x4265f4,null))['then'](respondWithResult(_0x4265f4,null))[_0xc4b6('0x3f')](handleError(_0x4265f4,null));};exports['create']=function(_0x1b66b5,_0x2f272f){return db['VoiceChanSpy'][_0xc4b6('0x45')](_0x1b66b5['body'],{})[_0xc4b6('0x24')](function(_0x1cd03f){var _0x28d6f6=_0x1b66b5[_0xc4b6('0x46')][_0xc4b6('0x47')]({'plain':!![]});if(!_0x28d6f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28d6f6[_0xc4b6('0x48')]===_0xc4b6('0x46')){var _0x444b8b=_0x1cd03f[_0xc4b6('0x47')]({'plain':!![]});var _0x3e94df=_0xc4b6('0x26');return db[_0xc4b6('0x49')][_0xc4b6('0x44')]({'where':{'name':_0x3e94df,'userProfileId':_0x28d6f6[_0xc4b6('0x4a')]},'raw':!![]})['then'](function(_0x273c58){if(_0x273c58&&_0x273c58[_0xc4b6('0x4b')]===0x0){return db[_0xc4b6('0x4c')][_0xc4b6('0x45')]({'name':_0x444b8b[_0xc4b6('0x29')],'resourceId':_0x444b8b['id'],'type':_0x273c58[_0xc4b6('0x29')],'sectionId':_0x273c58['id']},{})[_0xc4b6('0x24')](function(){return _0x1cd03f;});}else{return _0x1cd03f;}})[_0xc4b6('0x3f')](function(_0x56d6d7){logger['error'](_0xc4b6('0x4d'),_0x56d6d7);throw _0x56d6d7;});}return _0x1cd03f;})[_0xc4b6('0x24')](respondWithResult(_0x2f272f,0xc9))['catch'](handleError(_0x2f272f,null));};exports[_0xc4b6('0x23')]=function(_0x290cd4,_0xed498b){if(_0x290cd4[_0xc4b6('0x4e')]['id']){delete _0x290cd4[_0xc4b6('0x4e')]['id'];}return db['VoiceChanSpy'][_0xc4b6('0x44')]({'where':{'id':_0x290cd4[_0xc4b6('0x41')]['id']}})['then'](handleEntityNotFound(_0xed498b,null))[_0xc4b6('0x24')](saveUpdates(_0x290cd4[_0xc4b6('0x4e')],null))['then'](respondWithResult(_0xed498b,null))['catch'](handleError(_0xed498b,null));};exports[_0xc4b6('0x25')]=function(_0x5a04f7,_0x4d0bd3){return db[_0xc4b6('0x2b')][_0xc4b6('0x44')]({'where':{'id':_0x5a04f7['params']['id']}})[_0xc4b6('0x24')](handleEntityNotFound(_0x4d0bd3,null))[_0xc4b6('0x24')](removeEntity(_0x4d0bd3,null))['catch'](handleError(_0x4d0bd3,null));}; \ No newline at end of file +var _0x3164=['send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','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','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','stack','name'];(function(_0x3c6562,_0xc0548f){var _0x3515a0=function(_0x297470){while(--_0x297470){_0x3c6562['push'](_0x3c6562['shift']());}};_0x3515a0(++_0xc0548f);}(_0x3164,0x182));var _0x4316=function(_0x304828,_0x154b36){_0x304828=_0x304828-0x0;var _0x1ab51e=_0x3164[_0x304828];return _0x1ab51e;};'use strict';var emlformat=require(_0x4316('0x0'));var rimraf=require(_0x4316('0x1'));var zipdir=require(_0x4316('0x2'));var jsonpatch=require(_0x4316('0x3'));var rp=require(_0x4316('0x4'));var moment=require('moment');var BPromise=require(_0x4316('0x5'));var Mustache=require(_0x4316('0x6'));var util=require(_0x4316('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4316('0x8'));var ejs=require(_0x4316('0x9'));var fs=require('fs');var fs_extra=require(_0x4316('0xa'));var _=require(_0x4316('0xb'));var squel=require(_0x4316('0xc'));var crypto=require(_0x4316('0xd'));var jsforce=require(_0x4316('0xe'));var deskjs=require(_0x4316('0xf'));var toCsv=require(_0x4316('0x8'));var querystring=require(_0x4316('0x10'));var Papa=require(_0x4316('0x11'));var Redis=require(_0x4316('0x12'));var authService=require(_0x4316('0x13'));var qs=require(_0x4316('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4316('0x15'));var logger=require(_0x4316('0x16'))(_0x4316('0x17'));var utils=require(_0x4316('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4316('0x19'));var db=require(_0x4316('0x1a'))['db'];function respondWithStatusCode(_0x1e8f1a,_0x2a1f2c){_0x2a1f2c=_0x2a1f2c||0xcc;return function(_0x5cf490){if(_0x5cf490){return _0x1e8f1a[_0x4316('0x1b')](_0x2a1f2c);}return _0x1e8f1a['status'](_0x2a1f2c)['end']();};}function respondWithResult(_0x524c3c,_0x266777){_0x266777=_0x266777||0xc8;return function(_0x3bb6cf){if(_0x3bb6cf){return _0x524c3c['status'](_0x266777)[_0x4316('0x1c')](_0x3bb6cf);}};}function respondWithFilteredResult(_0x486a64,_0x133121){return function(_0x3e9ab8){if(_0x3e9ab8){var _0x211d87=typeof _0x133121[_0x4316('0x1d')]===_0x4316('0x1e')&&typeof _0x133121[_0x4316('0x1f')]===_0x4316('0x1e');var _0x38e68c=_0x3e9ab8[_0x4316('0x20')];var _0x3bf044=_0x211d87?0x0:_0x133121['offset'];var _0x43069f=_0x211d87?_0x3e9ab8[_0x4316('0x20')]:_0x133121['offset']+_0x133121['limit'];var _0x40f660;if(_0x43069f>=_0x38e68c){_0x43069f=_0x38e68c;_0x40f660=0xc8;}else{_0x40f660=0xce;}_0x486a64[_0x4316('0x21')](_0x40f660);return _0x486a64[_0x4316('0x22')](_0x4316('0x23'),_0x3bf044+'-'+_0x43069f+'/'+_0x38e68c)[_0x4316('0x1c')](_0x3e9ab8);}return null;};}function patchUpdates(_0x5865a3){return function(_0x888097){try{jsonpatch[_0x4316('0x24')](_0x888097,_0x5865a3,!![]);}catch(_0x599c48){return BPromise[_0x4316('0x25')](_0x599c48);}return _0x888097[_0x4316('0x26')]();};}function saveUpdates(_0x38195f,_0x494f82){return function(_0x1736d0){if(_0x1736d0){return _0x1736d0[_0x4316('0x27')](_0x38195f)[_0x4316('0x28')](function(_0x4f42aa){return _0x4f42aa;});}return null;};}function removeEntity(_0x3b994a,_0x3388ae){return function(_0x37043c){if(_0x37043c){return _0x37043c[_0x4316('0x29')]()[_0x4316('0x28')](function(){var _0x270688=_0x37043c[_0x4316('0x2a')]({'plain':!![]});var _0x46bd61=_0x4316('0x2b');return db[_0x4316('0x2c')][_0x4316('0x29')]({'where':{'type':_0x46bd61,'resourceId':_0x270688['id']}})[_0x4316('0x28')](function(){return _0x37043c;});})[_0x4316('0x28')](function(){_0x3b994a[_0x4316('0x21')](0xcc)[_0x4316('0x2d')]();});}};}function handleEntityNotFound(_0x31cd5f,_0x28e2a2){return function(_0x4cdb10){if(!_0x4cdb10){_0x31cd5f['sendStatus'](0x194);}return _0x4cdb10;};}function handleError(_0x83a6b,_0x46b619){_0x46b619=_0x46b619||0x1f4;return function(_0xa8dd01){logger[_0x4316('0x2e')](_0xa8dd01[_0x4316('0x2f')]);if(_0xa8dd01['name']){delete _0xa8dd01[_0x4316('0x30')];}_0x83a6b['status'](_0x46b619)[_0x4316('0x31')](_0xa8dd01);};}exports['index']=function(_0x46df48,_0x50e099){var _0x205e3e={},_0x26218d={},_0x4f88a2={'count':0x0,'rows':[]};var _0x22eedf=_['map'](db[_0x4316('0x32')][_0x4316('0x33')],function(_0x2d7e64){return{'name':_0x2d7e64[_0x4316('0x34')],'type':_0x2d7e64[_0x4316('0x35')][_0x4316('0x36')]};});_0x26218d[_0x4316('0x37')]=_[_0x4316('0x38')](_0x22eedf,'name');_0x26218d[_0x4316('0x39')]=_[_0x4316('0x3a')](_0x46df48['query']);_0x26218d['filters']=_[_0x4316('0x3b')](_0x26218d[_0x4316('0x37')],_0x26218d[_0x4316('0x39')]);_0x205e3e[_0x4316('0x3c')]=_[_0x4316('0x3b')](_0x26218d['model'],qs[_0x4316('0x3d')](_0x46df48[_0x4316('0x39')][_0x4316('0x3d')]));_0x205e3e[_0x4316('0x3c')]=_0x205e3e[_0x4316('0x3c')][_0x4316('0x3e')]?_0x205e3e['attributes']:_0x26218d[_0x4316('0x37')];if(!_0x46df48['query'][_0x4316('0x3f')]('nolimit')){_0x205e3e[_0x4316('0x1f')]=qs[_0x4316('0x1f')](_0x46df48[_0x4316('0x39')][_0x4316('0x1f')]);_0x205e3e['offset']=qs[_0x4316('0x1d')](_0x46df48[_0x4316('0x39')]['offset']);}_0x205e3e[_0x4316('0x40')]=qs[_0x4316('0x41')](_0x46df48[_0x4316('0x39')]['sort']);_0x205e3e[_0x4316('0x42')]=qs[_0x4316('0x43')](_[_0x4316('0x44')](_0x46df48[_0x4316('0x39')],_0x26218d[_0x4316('0x43')]),_0x22eedf);if(_0x46df48[_0x4316('0x39')][_0x4316('0x45')]){_0x205e3e[_0x4316('0x42')]=_[_0x4316('0x46')](_0x205e3e[_0x4316('0x42')],{'$or':_[_0x4316('0x38')](_0x22eedf,function(_0x2fa6f6){if(_0x2fa6f6[_0x4316('0x35')]!==_0x4316('0x47')){var _0x26817b={};_0x26817b[_0x2fa6f6[_0x4316('0x30')]]={'$like':'%'+_0x46df48[_0x4316('0x39')][_0x4316('0x45')]+'%'};return _0x26817b;}})});}_0x205e3e=_[_0x4316('0x46')]({},_0x205e3e,_0x46df48[_0x4316('0x48')]);var _0x568adf={'where':_0x205e3e[_0x4316('0x42')]};return db['VoiceChanSpy']['count'](_0x568adf)[_0x4316('0x28')](function(_0xf98933){_0x4f88a2[_0x4316('0x20')]=_0xf98933;if(_0x46df48['query'][_0x4316('0x49')]){_0x205e3e[_0x4316('0x4a')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x4316('0x4b')](_0x205e3e);})['then'](function(_0x410532){_0x4f88a2[_0x4316('0x4c')]=_0x410532;return _0x4f88a2;})[_0x4316('0x28')](respondWithFilteredResult(_0x50e099,_0x205e3e))[_0x4316('0x4d')](handleError(_0x50e099,null));};exports['show']=function(_0x1f1eaf,_0x30e03a){var _0x26b7e3={'raw':![],'where':{'id':_0x1f1eaf['params']['id']}},_0xce3f27={};_0xce3f27[_0x4316('0x37')]=_[_0x4316('0x3a')](db[_0x4316('0x32')][_0x4316('0x33')]);_0xce3f27['query']=_['keys'](_0x1f1eaf['query']);_0xce3f27[_0x4316('0x43')]=_[_0x4316('0x3b')](_0xce3f27['model'],_0xce3f27[_0x4316('0x39')]);_0x26b7e3[_0x4316('0x3c')]=_[_0x4316('0x3b')](_0xce3f27['model'],qs['fields'](_0x1f1eaf[_0x4316('0x39')][_0x4316('0x3d')]));_0x26b7e3['attributes']=_0x26b7e3['attributes']['length']?_0x26b7e3[_0x4316('0x3c')]:_0xce3f27[_0x4316('0x37')];if(_0x1f1eaf[_0x4316('0x39')][_0x4316('0x49')]){_0x26b7e3[_0x4316('0x4a')]=[{'all':!![]}];}_0x26b7e3=_[_0x4316('0x46')]({},_0x26b7e3,_0x1f1eaf['options']);return db[_0x4316('0x32')][_0x4316('0x4e')](_0x26b7e3)[_0x4316('0x28')](handleEntityNotFound(_0x30e03a,null))['then'](respondWithResult(_0x30e03a,null))[_0x4316('0x4d')](handleError(_0x30e03a,null));};exports[_0x4316('0x4f')]=function(_0x3ceb88,_0x5e6155){return db[_0x4316('0x32')][_0x4316('0x4f')](_0x3ceb88[_0x4316('0x50')],{})[_0x4316('0x28')](function(_0x3fb8ae){var _0x4d2011=_0x3ceb88['user'][_0x4316('0x2a')]({'plain':!![]});if(!_0x4d2011)throw new Error(_0x4316('0x51'));if(_0x4d2011[_0x4316('0x52')]===_0x4316('0x53')){var _0x56d541=_0x3fb8ae[_0x4316('0x2a')]({'plain':!![]});var _0x4e4cbe='ChanSpies';return db['UserProfileSection'][_0x4316('0x4e')]({'where':{'name':_0x4e4cbe,'userProfileId':_0x4d2011['userProfileId']},'raw':!![]})[_0x4316('0x28')](function(_0x1df4d6){if(_0x1df4d6&&_0x1df4d6[_0x4316('0x54')]===0x0){return db[_0x4316('0x2c')][_0x4316('0x4f')]({'name':_0x56d541[_0x4316('0x30')],'resourceId':_0x56d541['id'],'type':_0x1df4d6[_0x4316('0x30')],'sectionId':_0x1df4d6['id']},{})[_0x4316('0x28')](function(){return _0x3fb8ae;});}else{return _0x3fb8ae;}})[_0x4316('0x4d')](function(_0x427351){logger['error'](_0x4316('0x55'),_0x427351);throw _0x427351;});}return _0x3fb8ae;})['then'](respondWithResult(_0x5e6155,0xc9))[_0x4316('0x4d')](handleError(_0x5e6155,null));};exports[_0x4316('0x27')]=function(_0x2b35de,_0x47242){if(_0x2b35de[_0x4316('0x50')]['id']){delete _0x2b35de[_0x4316('0x50')]['id'];}return db['VoiceChanSpy'][_0x4316('0x4e')]({'where':{'id':_0x2b35de[_0x4316('0x56')]['id']}})[_0x4316('0x28')](handleEntityNotFound(_0x47242,null))['then'](saveUpdates(_0x2b35de['body'],null))[_0x4316('0x28')](respondWithResult(_0x47242,null))[_0x4316('0x4d')](handleError(_0x47242,null));};exports['destroy']=function(_0x5e80e2,_0x4a3767){return db[_0x4316('0x32')][_0x4316('0x4e')]({'where':{'id':_0x5e80e2[_0x4316('0x56')]['id']}})[_0x4316('0x28')](handleEntityNotFound(_0x4a3767,null))[_0x4316('0x28')](removeEntity(_0x4a3767,null))[_0x4316('0x4d')](handleError(_0x4a3767,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d03af81..da38c7a 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 _0x5b3a=['concat','internal','name','User','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length'];(function(_0x52a5e2,_0x4b520c){var _0x13908b=function(_0x58d513){while(--_0x58d513){_0x52a5e2['push'](_0x52a5e2['shift']());}};_0x13908b(++_0x4b520c);}(_0x5b3a,0x19f));var _0xa5b3=function(_0x588cd4,_0x133152){_0x588cd4=_0x588cd4-0x0;var _0x3e70f0=_0x5b3a[_0x588cd4];return _0x3e70f0;};'use strict';var _=require(_0xa5b3('0x0'));var util=require(_0xa5b3('0x1'));var BPromise=require('bluebird');var attributes=require(_0xa5b3('0x2'));var getUserApplications=function(_0x2c0ad1,_0x334820,_0x24504f){var _0x50bd24=0x1;var _0x3c2ab4=[];var _0x26b59b={'context':_0x334820[_0xa5b3('0x3')]||_0xa5b3('0x4'),'exten':util[_0xa5b3('0x5')](_0xa5b3('0x6'),_0x2c0ad1[_0xa5b3('0x7')],_0x24504f),'type':_0xa5b3('0x8'),'isApp':![],'ChanSpyId':_0x2c0ad1['id'],'UserId':_0x334820['id']};_0x3c2ab4[_0xa5b3('0x9')](_['merge']({'app':_0xa5b3('0xa'),'appdata':util['format'](_0xa5b3('0xb'),_0xa5b3('0xc')),'priority':_0x50bd24++},_0x26b59b));if(_0x2c0ad1[_0xa5b3('0xd')]){_0x3c2ab4[_0xa5b3('0x9')](_[_0xa5b3('0xe')]({'app':_0xa5b3('0xf'),'appdata':util['format'](_0xa5b3('0x10'),_0x2c0ad1['recordingFormat']),'priority':_0x50bd24++},_0x26b59b));}if(_0x2c0ad1['auth']){_0x3c2ab4[_0xa5b3('0x9')](_[_0xa5b3('0xe')]({'app':_0xa5b3('0x11'),'appdata':_0x2c0ad1[_0xa5b3('0x12')],'priority':_0x50bd24++},_0x26b59b));}_0x3c2ab4[_0xa5b3('0x9')](_['merge']({'app':_0xa5b3('0x13'),'appdata':util['format'](_0xa5b3('0x14'),_0x334820['name'],_0x2c0ad1[_0xa5b3('0x15')]?_0x2c0ad1[_0xa5b3('0x15')][_0xa5b3('0x16')](''):''),'priority':_0x50bd24++},_0x26b59b));if(_0x2c0ad1[_0xa5b3('0xd')]){_0x3c2ab4[_0xa5b3('0x9')](_[_0xa5b3('0xe')]({'app':_0xa5b3('0x17'),'priority':_0x50bd24++},_0x26b59b));}return _0x3c2ab4;};var getChanSpyApplications=function(_0x5f3114,_0x55877a){var _0x526c3c=[];for(var _0x6ce865=0x0,_0x19b984=0x1;_0x6ce865<_0x55877a[_0xa5b3('0x18')];_0x6ce865++,_0x19b984=0x1){_0x526c3c=_0x526c3c[_0xa5b3('0x19')](getUserApplications(_0x5f3114,_0x55877a[_0x6ce865],_0x55877a[_0x6ce865][_0xa5b3('0x1a')]));if(_0x55877a[_0x6ce865][_0xa5b3('0x1a')]!=_0x55877a[_0x6ce865][_0xa5b3('0x1b')]){_0x526c3c=_0x526c3c[_0xa5b3('0x19')](getUserApplications(_0x5f3114,_0x55877a[_0x6ce865],_0x55877a[_0x6ce865][_0xa5b3('0x1b')]));}}return _0x526c3c;};var getChanSpyPromise=function(_0x2a2f81,_0x44a438){return new BPromise(function(_0x43f38a,_0x51b7be){return _0x2a2f81[_0xa5b3('0x1c')][_0xa5b3('0x1d')]({'attributes':['id',_0xa5b3('0x1b'),'internal'],'where':{'role':_0xa5b3('0x1e'),'chanspy':!![]},'raw':!![]})[_0xa5b3('0x1f')](function(_0x5284f7){if(_0x5284f7){return _0x43f38a(getChanSpyApplications(_0x44a438,_0x5284f7));}return _0x43f38a([]);})[_0xa5b3('0x20')](function(_0x3d9328){_0x51b7be(_0x3d9328);});});};module[_0xa5b3('0x21')]=function(_0x352a17,_0xede1dd){var _0x5e6fce=_0x352a17['models'];return _0x352a17[_0xa5b3('0x22')](_0xa5b3('0x23'),attributes,{'tableName':_0xa5b3('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x800616,_0x28a8d8,_0x18a606){return getChanSpyPromise(_0x5e6fce,_0x800616)[_0xa5b3('0x1f')](function(_0x5a6805){if(_0x5a6805&&_0x5a6805[_0xa5b3('0x18')]){return _0x5e6fce[_0xa5b3('0x25')]['bulkCreate'](_0x5a6805);}})['then'](function(){_0x18a606();})[_0xa5b3('0x20')](function(_0x6d6f08){_0x18a606(_0x6d6f08);});},'afterUpdate':function(_0x24f277,_0xc6cc3a,_0x583ddf){return _0x5e6fce[_0xa5b3('0x25')][_0xa5b3('0x26')]({'where':{'ChanSpyId':_0x24f277['id']}})[_0xa5b3('0x1f')](function(){return getChanSpyPromise(_0x5e6fce,_0x24f277);})[_0xa5b3('0x1f')](function(_0x8a59e3){if(_0x8a59e3&&_0x8a59e3['length']){return _0x5e6fce[_0xa5b3('0x25')][_0xa5b3('0x27')](_0x8a59e3);}})[_0xa5b3('0x1f')](function(){_0x583ddf();})[_0xa5b3('0x20')](function(_0x27e34e){_0x583ddf(_0x27e34e);});},'afterDestroy':function(_0x25e1b5,_0x551750,_0x237851){return _0x5e6fce[_0xa5b3('0x25')][_0xa5b3('0x26')]({'where':{'ChanSpyId':_0x25e1b5['id']}})[_0xa5b3('0x1f')](function(){_0x237851();})[_0xa5b3('0x20')](function(_0x5f5066){_0x237851(_0x5f5066);});}}});}; \ No newline at end of file +var _0x92b9=['VoiceExtension','bulkCreate','then','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','%s%s','prefix','system','merge','Set','format','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy'];(function(_0x527aab,_0x1bb5d8){var _0x549ef1=function(_0x5a22a0){while(--_0x5a22a0){_0x527aab['push'](_0x527aab['shift']());}};_0x549ef1(++_0x1bb5d8);}(_0x92b9,0xfa));var _0x992b=function(_0x431d0d,_0x1a4fce){_0x431d0d=_0x431d0d-0x0;var _0x1036ef=_0x92b9[_0x431d0d];return _0x1036ef;};'use strict';var _=require(_0x992b('0x0'));var util=require(_0x992b('0x1'));var BPromise=require(_0x992b('0x2'));var attributes=require(_0x992b('0x3'));var getUserApplications=function(_0x2a1b12,_0x19e6a8,_0x90ccf5){var _0x1c57d0=0x1;var _0x6ec309=[];var _0x22b4e5={'context':_0x19e6a8[_0x992b('0x4')]||'from-sip','exten':util['format'](_0x992b('0x5'),_0x2a1b12[_0x992b('0x6')],_0x90ccf5),'type':_0x992b('0x7'),'isApp':![],'ChanSpyId':_0x2a1b12['id'],'UserId':_0x19e6a8['id']};_0x6ec309['push'](_[_0x992b('0x8')]({'app':_0x992b('0x9'),'appdata':util[_0x992b('0xa')]('CDR(type)=%s',_0x992b('0xb')),'priority':_0x1c57d0++},_0x22b4e5));if(_0x2a1b12[_0x992b('0xc')]){_0x6ec309[_0x992b('0xd')](_[_0x992b('0x8')]({'app':'MixMonitor','appdata':util[_0x992b('0xa')](_0x992b('0xe'),_0x2a1b12[_0x992b('0xf')]),'priority':_0x1c57d0++},_0x22b4e5));}if(_0x2a1b12[_0x992b('0x10')]){_0x6ec309['push'](_[_0x992b('0x8')]({'app':_0x992b('0x11'),'appdata':_0x2a1b12[_0x992b('0x12')],'priority':_0x1c57d0++},_0x22b4e5));}_0x6ec309[_0x992b('0xd')](_[_0x992b('0x8')]({'app':_0x992b('0x13'),'appdata':util[_0x992b('0xa')](_0x992b('0x14'),_0x19e6a8[_0x992b('0x15')],_0x2a1b12[_0x992b('0x16')]?_0x2a1b12[_0x992b('0x16')][_0x992b('0x17')](''):''),'priority':_0x1c57d0++},_0x22b4e5));if(_0x2a1b12[_0x992b('0xc')]){_0x6ec309[_0x992b('0xd')](_[_0x992b('0x8')]({'app':_0x992b('0x18'),'priority':_0x1c57d0++},_0x22b4e5));}return _0x6ec309;};var getChanSpyApplications=function(_0x4f1af4,_0xe39a1){var _0x27ef09=[];for(var _0x4acd8a=0x0,_0x483075=0x1;_0x4acd8a<_0xe39a1[_0x992b('0x19')];_0x4acd8a++,_0x483075=0x1){_0x27ef09=_0x27ef09[_0x992b('0x1a')](getUserApplications(_0x4f1af4,_0xe39a1[_0x4acd8a],_0xe39a1[_0x4acd8a][_0x992b('0x1b')]));if(_0xe39a1[_0x4acd8a][_0x992b('0x1b')]!=_0xe39a1[_0x4acd8a]['name']){_0x27ef09=_0x27ef09['concat'](getUserApplications(_0x4f1af4,_0xe39a1[_0x4acd8a],_0xe39a1[_0x4acd8a][_0x992b('0x15')]));}}return _0x27ef09;};var getChanSpyPromise=function(_0x2bb253,_0x9d51f0){return new BPromise(function(_0x1ffd45,_0x4dd115){return _0x2bb253[_0x992b('0x1c')][_0x992b('0x1d')]({'attributes':['id',_0x992b('0x15'),'internal'],'where':{'role':_0x992b('0x1e'),'chanspy':!![]},'raw':!![]})['then'](function(_0x451be3){if(_0x451be3){return _0x1ffd45(getChanSpyApplications(_0x9d51f0,_0x451be3));}return _0x1ffd45([]);})[_0x992b('0x1f')](function(_0x1cd24e){_0x4dd115(_0x1cd24e);});});};module[_0x992b('0x20')]=function(_0x3deb3e,_0x1d4b58){var _0x1b525c=_0x3deb3e[_0x992b('0x21')];return _0x3deb3e[_0x992b('0x22')](_0x992b('0x23'),attributes,{'tableName':_0x992b('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x42add6,_0x1de752,_0x542912){return getChanSpyPromise(_0x1b525c,_0x42add6)['then'](function(_0x5dfdc4){if(_0x5dfdc4&&_0x5dfdc4[_0x992b('0x19')]){return _0x1b525c[_0x992b('0x25')][_0x992b('0x26')](_0x5dfdc4);}})[_0x992b('0x27')](function(){_0x542912();})[_0x992b('0x1f')](function(_0x35263b){_0x542912(_0x35263b);});},'afterUpdate':function(_0x1e2fa6,_0x541e8c,_0x2c21af){return _0x1b525c['VoiceExtension'][_0x992b('0x28')]({'where':{'ChanSpyId':_0x1e2fa6['id']}})[_0x992b('0x27')](function(){return getChanSpyPromise(_0x1b525c,_0x1e2fa6);})['then'](function(_0x626dcb){if(_0x626dcb&&_0x626dcb[_0x992b('0x19')]){return _0x1b525c[_0x992b('0x25')]['bulkCreate'](_0x626dcb);}})[_0x992b('0x27')](function(){_0x2c21af();})[_0x992b('0x1f')](function(_0x2e7071){_0x2c21af(_0x2e7071);});},'afterDestroy':function(_0x14bccc,_0x23630e,_0x11506c){return _0x1b525c[_0x992b('0x25')][_0x992b('0x28')]({'where':{'ChanSpyId':_0x14bccc['id']}})[_0x992b('0x27')](function(){_0x11506c();})[_0x992b('0x1f')](function(_0x247def){_0x11506c(_0x247def);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 77e8699..bd7bbe5 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 _0x9aea=['result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x5e3872,_0x5161f9){var _0x352e29=function(_0x1adc34){while(--_0x1adc34){_0x5e3872['push'](_0x5e3872['shift']());}};_0x352e29(++_0x5161f9);}(_0x9aea,0xdd));var _0xa9ae=function(_0x57f518,_0x2f3e82){_0x57f518=_0x57f518-0x0;var _0x4d408f=_0x9aea[_0x57f518];return _0x4d408f;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});} \ No newline at end of file +var _0x5ec6=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x4ef794,_0x2cc596){var _0x472d4d=function(_0x463b48){while(--_0x463b48){_0x4ef794['push'](_0x4ef794['shift']());}};_0x472d4d(++_0x2cc596);}(_0x5ec6,0x7f));var _0x65ec=function(_0x63e793,_0x48f262){_0x63e793=_0x63e793-0x0;var _0x553f22=_0x5ec6[_0x63e793];return _0x553f22;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index acc63c4..4ad156e 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 _0x7b6e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','path','express'];(function(_0x10e81c,_0x15c453){var _0x3fbe09=function(_0xbde314){while(--_0xbde314){_0x10e81c['push'](_0x10e81c['shift']());}};_0x3fbe09(++_0x15c453);}(_0x7b6e,0x179));var _0xe7b6=function(_0x1707eb,_0x520e7e){_0x1707eb=_0x1707eb-0x0;var _0x31172f=_0x7b6e[_0x1707eb];return _0x31172f;};'use strict';var multer=require(_0xe7b6('0x0'));var util=require('util');var path=require(_0xe7b6('0x1'));var timeout=require('connect-timeout');var express=require(_0xe7b6('0x2'));var router=express[_0xe7b6('0x3')]();var fs_extra=require(_0xe7b6('0x4'));var auth=require(_0xe7b6('0x5'));var interaction=require(_0xe7b6('0x6'));var config=require(_0xe7b6('0x7'));var controller=require(_0xe7b6('0x8'));router[_0xe7b6('0x9')]('/',auth['isAuthenticated'](),controller[_0xe7b6('0xa')]);router[_0xe7b6('0x9')](_0xe7b6('0xb'),auth['isAuthenticated'](),controller[_0xe7b6('0xc')]);router[_0xe7b6('0xd')]('/',auth[_0xe7b6('0xe')](),controller['create']);router[_0xe7b6('0xf')](_0xe7b6('0xb'),auth[_0xe7b6('0xe')](),controller[_0xe7b6('0x10')]);router[_0xe7b6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe7b6('0x12')]);module[_0xe7b6('0x13')]=router; \ No newline at end of file +var _0x36ae=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./voiceContext.controller','get','index','show','post','isAuthenticated','create','put'];(function(_0x40de55,_0x5a34f0){var _0x4df3c7=function(_0x20a98a){while(--_0x20a98a){_0x40de55['push'](_0x40de55['shift']());}};_0x4df3c7(++_0x5a34f0);}(_0x36ae,0xd5));var _0xe36a=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0x36ae[_0x2b1551];return _0x2fc2a1;};'use strict';var multer=require(_0xe36a('0x0'));var util=require(_0xe36a('0x1'));var path=require(_0xe36a('0x2'));var timeout=require(_0xe36a('0x3'));var express=require(_0xe36a('0x4'));var router=express['Router']();var fs_extra=require(_0xe36a('0x5'));var auth=require(_0xe36a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe36a('0x7'));router[_0xe36a('0x8')]('/',auth['isAuthenticated'](),controller[_0xe36a('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe36a('0xa')]);router[_0xe36a('0xb')]('/',auth[_0xe36a('0xc')](),controller[_0xe36a('0xd')]);router[_0xe36a('0xe')](_0xe36a('0xf'),auth[_0xe36a('0xc')](),controller[_0xe36a('0x10')]);router[_0xe36a('0x11')](_0xe36a('0xf'),auth[_0xe36a('0xc')](),controller['destroy']);module[_0xe36a('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 b7f45d0..b6787ce 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 _0xe0f8=['STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0f8,0x152));var _0x8e0f=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xe0f8[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0x8e0f('0x0'));module['exports']={'name':{'type':Sequelize[_0x8e0f('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x8e0f('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8e0f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x57af=['exports','name','STRING','BOOLEAN','sequelize'];(function(_0x484fae,_0x37c7ed){var _0x2df2a7=function(_0x23603d){while(--_0x23603d){_0x484fae['push'](_0x484fae['shift']());}};_0x2df2a7(++_0x37c7ed);}(_0x57af,0xea));var _0xf57a=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x57af[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0xf57a('0x0'));module[_0xf57a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf57a('0x2')},'description':{'type':Sequelize[_0xf57a('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf57a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4648474..b0ef7b7 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 _0xa872=['writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','utf8','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VoiceContext,\x20%s,\x20%s','result','status','end','json','offset','undefined','count','limit','apply','reject','update','then','destroy','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','VoiceContext','findAll','rows','catch','show','length','includeAll','create','body','readFileSync','root','server/files/templates/context.ejs','render'];(function(_0x47ed29,_0x22e10c){var _0x3ed7e9=function(_0x32c467){while(--_0x32c467){_0x47ed29['push'](_0x47ed29['shift']());}};_0x3ed7e9(++_0x22e10c);}(_0xa872,0x146));var _0x2a87=function(_0x4168ef,_0x1d0494){_0x4168ef=_0x4168ef-0x0;var _0xc1eeeb=_0xa872[_0x4168ef];return _0xc1eeeb;};'use strict';var emlformat=require(_0x2a87('0x0'));var rimraf=require(_0x2a87('0x1'));var zipdir=require(_0x2a87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a87('0x3'));var moment=require(_0x2a87('0x4'));var BPromise=require(_0x2a87('0x5'));var Mustache=require('mustache');var util=require(_0x2a87('0x6'));var path=require('path');var sox=require(_0x2a87('0x7'));var csv=require(_0x2a87('0x8'));var ejs=require(_0x2a87('0x9'));var fs=require('fs');var fs_extra=require(_0x2a87('0xa'));var _=require(_0x2a87('0xb'));var squel=require(_0x2a87('0xc'));var crypto=require(_0x2a87('0xd'));var jsforce=require(_0x2a87('0xe'));var deskjs=require(_0x2a87('0xf'));var toCsv=require(_0x2a87('0x8'));var querystring=require(_0x2a87('0x10'));var Papa=require(_0x2a87('0x11'));var Redis=require('ioredis');var authService=require(_0x2a87('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2a87('0x13'));var hardwareService=require(_0x2a87('0x14'));var logger=require(_0x2a87('0x15'))('api');var utils=require(_0x2a87('0x16'));var config=require(_0x2a87('0x17'));var licenseUtil=require(_0x2a87('0x18'));var db=require(_0x2a87('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2a87('0x1a')][_0x2a87('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x51d843,_0xd58354,_0x5230f7,_0x1e88e0){return new BPromise(function(_0x139a52,_0x1c261f){var _0x273d21=_0x1e88e0||client;return _0x273d21[_0x2a87('0x1c')](_0x51d843,_0x5230f7)['then'](function(_0x20481d){logger[_0x2a87('0x1d')]('VoiceContext,\x20%s,\x20%s',_0xd58354,'request\x20sent');logger[_0x2a87('0x1e')](_0x2a87('0x1f'),_0xd58354,_0x2a87('0x20'),JSON['stringify'](_0x20481d));if(_0x20481d[_0x2a87('0x21')]){if(_0x20481d['error'][_0x2a87('0x22')]===0x1f4){logger[_0x2a87('0x21')]('VoiceContext,\x20%s,\x20%s',_0xd58354,_0x20481d[_0x2a87('0x21')][_0x2a87('0x23')]);return _0x1c261f(_0x20481d[_0x2a87('0x21')][_0x2a87('0x23')]);}logger[_0x2a87('0x21')]('VoiceContext,\x20%s,\x20%s',_0xd58354,_0x20481d[_0x2a87('0x21')][_0x2a87('0x23')]);return _0x139a52(_0x20481d[_0x2a87('0x21')][_0x2a87('0x23')]);}else{logger['info'](_0x2a87('0x24'),_0xd58354,'request\x20sent');_0x139a52(_0x20481d[_0x2a87('0x25')][_0x2a87('0x23')]);}})['catch'](function(_0x5dcd45){logger[_0x2a87('0x21')]('VoiceContext,\x20%s,\x20%s',_0xd58354,_0x5dcd45);_0x1c261f(_0x5dcd45);});});}function respondWithStatusCode(_0x5cc5a3,_0x34923a){_0x34923a=_0x34923a||0xcc;return function(_0x1b88f1){if(_0x1b88f1){return _0x5cc5a3['sendStatus'](_0x34923a);}return _0x5cc5a3[_0x2a87('0x26')](_0x34923a)[_0x2a87('0x27')]();};}function respondWithResult(_0x5d3d52,_0x161488){_0x161488=_0x161488||0xc8;return function(_0x7a7c6b){if(_0x7a7c6b){return _0x5d3d52[_0x2a87('0x26')](_0x161488)[_0x2a87('0x28')](_0x7a7c6b);}};}function respondWithFilteredResult(_0x1e000e,_0x3e4671){return function(_0x33b7a6){if(_0x33b7a6){var _0x2201da=typeof _0x3e4671[_0x2a87('0x29')]===_0x2a87('0x2a')&&typeof _0x3e4671['limit']===_0x2a87('0x2a');var _0x52fae0=_0x33b7a6[_0x2a87('0x2b')];var _0x161392=_0x2201da?0x0:_0x3e4671['offset'];var _0x331b50=_0x2201da?_0x33b7a6[_0x2a87('0x2b')]:_0x3e4671[_0x2a87('0x29')]+_0x3e4671[_0x2a87('0x2c')];var _0x1ffcfc;if(_0x331b50>=_0x52fae0){_0x331b50=_0x52fae0;_0x1ffcfc=0xc8;}else{_0x1ffcfc=0xce;}_0x1e000e[_0x2a87('0x26')](_0x1ffcfc);return _0x1e000e['set']('Content-Range',_0x161392+'-'+_0x331b50+'/'+_0x52fae0)[_0x2a87('0x28')](_0x33b7a6);}return null;};}function patchUpdates(_0x236b20){return function(_0x129cae){try{jsonpatch[_0x2a87('0x2d')](_0x129cae,_0x236b20,!![]);}catch(_0xa4e4d7){return BPromise[_0x2a87('0x2e')](_0xa4e4d7);}return _0x129cae['save']();};}function saveUpdates(_0x474e6c,_0xe8ee2a){return function(_0x4e129c){if(_0x4e129c){return _0x4e129c[_0x2a87('0x2f')](_0x474e6c)[_0x2a87('0x30')](function(_0x1d5486){return _0x1d5486;});}return null;};}function removeEntity(_0x4ba158,_0x20be45){return function(_0x13d21b){if(_0x13d21b){return _0x13d21b[_0x2a87('0x31')]()['then'](function(){var _0x2f8ca6=_0x13d21b['get']({'plain':!![]});var _0x4458b0=_0x2a87('0x32');return db[_0x2a87('0x33')]['destroy']({'where':{'type':_0x4458b0,'resourceId':_0x2f8ca6['id']}})[_0x2a87('0x30')](function(){return _0x13d21b;});})[_0x2a87('0x30')](function(){_0x4ba158[_0x2a87('0x26')](0xcc)[_0x2a87('0x27')]();});}};}function handleEntityNotFound(_0x49aeb3,_0x2e68be){return function(_0x172707){if(!_0x172707){_0x49aeb3[_0x2a87('0x34')](0x194);}return _0x172707;};}function handleError(_0x33773b,_0x485086){_0x485086=_0x485086||0x1f4;return function(_0x3acc07){logger[_0x2a87('0x21')](_0x3acc07[_0x2a87('0x35')]);if(_0x3acc07['name']){delete _0x3acc07[_0x2a87('0x36')];}_0x33773b[_0x2a87('0x26')](_0x485086)[_0x2a87('0x37')](_0x3acc07);};}exports[_0x2a87('0x38')]=function(_0x516e95,_0x524946){var _0x31a5b9={},_0x14de27={},_0x1f2074={'count':0x0,'rows':[]};var _0x5a0dc3=_[_0x2a87('0x39')](db['VoiceContext'][_0x2a87('0x3a')],function(_0x26c0b6){return{'name':_0x26c0b6[_0x2a87('0x3b')],'type':_0x26c0b6[_0x2a87('0x3c')]['key']};});_0x14de27[_0x2a87('0x3d')]=_[_0x2a87('0x39')](_0x5a0dc3,_0x2a87('0x36'));_0x14de27[_0x2a87('0x3e')]=_[_0x2a87('0x3f')](_0x516e95[_0x2a87('0x3e')]);_0x14de27[_0x2a87('0x40')]=_[_0x2a87('0x41')](_0x14de27[_0x2a87('0x3d')],_0x14de27[_0x2a87('0x3e')]);_0x31a5b9[_0x2a87('0x42')]=_[_0x2a87('0x41')](_0x14de27[_0x2a87('0x3d')],qs[_0x2a87('0x43')](_0x516e95[_0x2a87('0x3e')][_0x2a87('0x43')]));_0x31a5b9[_0x2a87('0x42')]=_0x31a5b9[_0x2a87('0x42')]['length']?_0x31a5b9['attributes']:_0x14de27[_0x2a87('0x3d')];if(!_0x516e95[_0x2a87('0x3e')][_0x2a87('0x44')](_0x2a87('0x45'))){_0x31a5b9['limit']=qs[_0x2a87('0x2c')](_0x516e95[_0x2a87('0x3e')][_0x2a87('0x2c')]);_0x31a5b9[_0x2a87('0x29')]=qs[_0x2a87('0x29')](_0x516e95['query']['offset']);}_0x31a5b9[_0x2a87('0x46')]=qs[_0x2a87('0x47')](_0x516e95[_0x2a87('0x3e')]['sort']);_0x31a5b9['where']=qs[_0x2a87('0x40')](_[_0x2a87('0x48')](_0x516e95[_0x2a87('0x3e')],_0x14de27[_0x2a87('0x40')]),_0x5a0dc3);if(_0x516e95[_0x2a87('0x3e')][_0x2a87('0x49')]){_0x31a5b9[_0x2a87('0x4a')]=_[_0x2a87('0x4b')](_0x31a5b9['where'],{'$or':_[_0x2a87('0x39')](_0x5a0dc3,function(_0x587450){if(_0x587450['type']!=='VIRTUAL'){var _0x8aa9a1={};_0x8aa9a1[_0x587450['name']]={'$like':'%'+_0x516e95[_0x2a87('0x3e')][_0x2a87('0x49')]+'%'};return _0x8aa9a1;}})});}_0x31a5b9=_[_0x2a87('0x4b')]({},_0x31a5b9,_0x516e95[_0x2a87('0x4c')]);var _0x26a1b8={'where':_0x31a5b9['where']};return db[_0x2a87('0x4d')][_0x2a87('0x2b')](_0x26a1b8)['then'](function(_0x47e385){_0x1f2074[_0x2a87('0x2b')]=_0x47e385;if(_0x516e95['query']['includeAll']){_0x31a5b9['include']=[{'all':!![]}];}return db[_0x2a87('0x4d')][_0x2a87('0x4e')](_0x31a5b9);})[_0x2a87('0x30')](function(_0x1b0fdf){_0x1f2074[_0x2a87('0x4f')]=_0x1b0fdf;return _0x1f2074;})[_0x2a87('0x30')](respondWithFilteredResult(_0x524946,_0x31a5b9))[_0x2a87('0x50')](handleError(_0x524946,null));};exports[_0x2a87('0x51')]=function(_0x3a286b,_0x4984ae){var _0x1f45e9={'raw':![],'where':{'id':_0x3a286b['params']['id']}},_0x5c319f={};_0x5c319f[_0x2a87('0x3d')]=_[_0x2a87('0x3f')](db[_0x2a87('0x4d')][_0x2a87('0x3a')]);_0x5c319f[_0x2a87('0x3e')]=_['keys'](_0x3a286b[_0x2a87('0x3e')]);_0x5c319f['filters']=_[_0x2a87('0x41')](_0x5c319f[_0x2a87('0x3d')],_0x5c319f[_0x2a87('0x3e')]);_0x1f45e9['attributes']=_[_0x2a87('0x41')](_0x5c319f[_0x2a87('0x3d')],qs[_0x2a87('0x43')](_0x3a286b[_0x2a87('0x3e')][_0x2a87('0x43')]));_0x1f45e9[_0x2a87('0x42')]=_0x1f45e9['attributes'][_0x2a87('0x52')]?_0x1f45e9[_0x2a87('0x42')]:_0x5c319f[_0x2a87('0x3d')];if(_0x3a286b[_0x2a87('0x3e')][_0x2a87('0x53')]){_0x1f45e9['include']=[{'all':!![]}];}_0x1f45e9=_[_0x2a87('0x4b')]({},_0x1f45e9,_0x3a286b['options']);return db[_0x2a87('0x4d')]['find'](_0x1f45e9)[_0x2a87('0x30')](handleEntityNotFound(_0x4984ae,null))['then'](respondWithResult(_0x4984ae,null))[_0x2a87('0x50')](handleError(_0x4984ae,null));};exports['create']=function(_0x34605b,_0x1f303e,_0x57758a){var _0x43d393;return db[_0x2a87('0x4d')][_0x2a87('0x54')](_0x34605b[_0x2a87('0x55')],{'raw':!![]})[_0x2a87('0x30')](function(_0x53cf9d){_0x43d393=_0x53cf9d;return db[_0x2a87('0x4d')][_0x2a87('0x4e')]({'raw':!![]});})[_0x2a87('0x30')](function(_0xab195e){var _0x242d87=fs[_0x2a87('0x56')](path['join'](config[_0x2a87('0x57')],_0x2a87('0x58')),'utf8');var _0x1d1ab8=ejs[_0x2a87('0x59')](_0x242d87,{'contexts':_0xab195e||[]});fs[_0x2a87('0x5a')](_0x2a87('0x5b'),_0x1d1ab8);})[_0x2a87('0x30')](function(){return respondWithRpcPromise(_0x2a87('0x5c'),'create',{'module':_0x2a87('0x5d')});})[_0x2a87('0x30')](function(){var _0x8c5236=_0x34605b[_0x2a87('0x5e')]['get']({'plain':!![]});if(!_0x8c5236)throw new Error(_0x2a87('0x5f'));if(_0x8c5236[_0x2a87('0x60')]===_0x2a87('0x5e')){var _0x4231e0=_0x43d393['get']({'plain':!![]});return db['UserProfileSection'][_0x2a87('0x61')]({'where':{'name':_0x2a87('0x32'),'userProfileId':_0x8c5236[_0x2a87('0x62')]},'raw':!![]})[_0x2a87('0x30')](function(_0x194a5b){if(_0x194a5b&&_0x194a5b[_0x2a87('0x63')]===0x0){return db[_0x2a87('0x33')]['create']({'name':_0x4231e0[_0x2a87('0x36')],'resourceId':_0x4231e0['id'],'type':_0x194a5b['name'],'sectionId':_0x194a5b['id']},{})['then'](function(){return _0x43d393;});}else{return _0x43d393;}})[_0x2a87('0x50')](function(_0x4ccaad){logger[_0x2a87('0x21')](_0x2a87('0x64'),_0x4ccaad);throw _0x4ccaad;});}return _0x43d393;})['then'](respondWithResult(_0x1f303e,0xc9))[_0x2a87('0x50')](handleError(_0x1f303e,null));};exports[_0x2a87('0x2f')]=function(_0xf57d53,_0x50839e,_0x599fc8){var _0x43a22d;return db[_0x2a87('0x4d')]['find']({'where':{'id':_0xf57d53[_0x2a87('0x65')]['id']}})['then'](handleEntityNotFound(_0x50839e,null))[_0x2a87('0x30')](saveUpdates(_0xf57d53[_0x2a87('0x55')],null))['then'](function(_0x1028ff){if(_0x1028ff){_0x43a22d=_0x1028ff;return db[_0x2a87('0x4d')][_0x2a87('0x4e')]({'raw':!![]});}})[_0x2a87('0x30')](function(_0x1eefc4){var _0x46c3cf=fs[_0x2a87('0x56')](path[_0x2a87('0x66')](config[_0x2a87('0x57')],_0x2a87('0x58')),'utf8');var _0x46192c=ejs['render'](_0x46c3cf,{'contexts':_0x1eefc4||[]});fs[_0x2a87('0x5a')](_0x2a87('0x5b'),_0x46192c);})[_0x2a87('0x30')](function(){return respondWithRpcPromise('Reload',_0x2a87('0x2f'),{'module':_0x2a87('0x5d')});})['then'](function(){return _0x43a22d;})['then'](respondWithResult(_0x50839e,null))[_0x2a87('0x50')](handleError(_0x50839e,null));};exports[_0x2a87('0x31')]=function(_0x3301a4,_0x5a24fa,_0x5b4205){var _0xd1cd16;return db[_0x2a87('0x4d')][_0x2a87('0x61')]({'where':{'id':_0x3301a4[_0x2a87('0x65')]['id']}})['then'](handleEntityNotFound(_0x5a24fa,null))['then'](removeEntity(_0x5a24fa,null))['then'](function(){return db['VoiceContext'][_0x2a87('0x4e')]({'raw':!![]});})[_0x2a87('0x30')](function(_0x1a945a){var _0x123373=fs[_0x2a87('0x56')](path[_0x2a87('0x66')](config[_0x2a87('0x57')],_0x2a87('0x58')),_0x2a87('0x67'));var _0x5f3249=ejs['render'](_0x123373,{'contexts':_0x1a945a});fs[_0x2a87('0x5a')](_0x2a87('0x5b'),_0x5f3249);return respondWithRpcPromise(_0x2a87('0x5c'),_0x2a87('0x31'),{'module':_0x2a87('0x5d')});})[_0x2a87('0x50')](handleError(_0x5a24fa,null));}; \ No newline at end of file +var _0xdccc=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','utf8','render','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','Contexts','UserProfileResource','sendStatus','stack','name','send','index','VoiceContext','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','keys','options','find','create','readFileSync','join','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get'];(function(_0x8c911f,_0x12f159){var _0x238de1=function(_0x56ddd6){while(--_0x56ddd6){_0x8c911f['push'](_0x8c911f['shift']());}};_0x238de1(++_0x12f159);}(_0xdccc,0xdf));var _0xcdcc=function(_0x2b13f3,_0x24b685){_0x2b13f3=_0x2b13f3-0x0;var _0x525dbc=_0xdccc[_0x2b13f3];return _0x525dbc;};'use strict';var emlformat=require(_0xcdcc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdcc('0x1'));var rp=require(_0xcdcc('0x2'));var moment=require(_0xcdcc('0x3'));var BPromise=require(_0xcdcc('0x4'));var Mustache=require(_0xcdcc('0x5'));var util=require(_0xcdcc('0x6'));var path=require(_0xcdcc('0x7'));var sox=require(_0xcdcc('0x8'));var csv=require(_0xcdcc('0x9'));var ejs=require(_0xcdcc('0xa'));var fs=require('fs');var fs_extra=require(_0xcdcc('0xb'));var _=require(_0xcdcc('0xc'));var squel=require('squel');var crypto=require(_0xcdcc('0xd'));var jsforce=require(_0xcdcc('0xe'));var deskjs=require(_0xcdcc('0xf'));var toCsv=require(_0xcdcc('0x9'));var querystring=require(_0xcdcc('0x10'));var Papa=require('papaparse');var Redis=require(_0xcdcc('0x11'));var authService=require(_0xcdcc('0x12'));var qs=require(_0xcdcc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdcc('0x14'));var logger=require(_0xcdcc('0x15'))(_0xcdcc('0x16'));var utils=require('../../config/utils');var config=require(_0xcdcc('0x17'));var licenseUtil=require(_0xcdcc('0x18'));var db=require(_0xcdcc('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xcdcc('0x1a')][_0xcdcc('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x45e401,_0x40d2af,_0x1ae8c1,_0x19d261){return new BPromise(function(_0x2ce4a9,_0x4b8729){var _0x54993f=_0x19d261||client;return _0x54993f[_0xcdcc('0x1c')](_0x45e401,_0x1ae8c1)[_0xcdcc('0x1d')](function(_0x41a968){logger[_0xcdcc('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x40d2af,'request\x20sent');logger[_0xcdcc('0x1f')](_0xcdcc('0x20'),_0x40d2af,_0xcdcc('0x21'),JSON[_0xcdcc('0x22')](_0x41a968));if(_0x41a968[_0xcdcc('0x23')]){if(_0x41a968[_0xcdcc('0x23')][_0xcdcc('0x24')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x40d2af,_0x41a968[_0xcdcc('0x23')][_0xcdcc('0x25')]);return _0x4b8729(_0x41a968[_0xcdcc('0x23')][_0xcdcc('0x25')]);}logger[_0xcdcc('0x23')](_0xcdcc('0x26'),_0x40d2af,_0x41a968['error'][_0xcdcc('0x25')]);return _0x2ce4a9(_0x41a968[_0xcdcc('0x23')][_0xcdcc('0x25')]);}else{logger['info'](_0xcdcc('0x26'),_0x40d2af,_0xcdcc('0x21'));_0x2ce4a9(_0x41a968['result'][_0xcdcc('0x25')]);}})[_0xcdcc('0x27')](function(_0x1c1e54){logger['error'](_0xcdcc('0x26'),_0x40d2af,_0x1c1e54);_0x4b8729(_0x1c1e54);});});}function respondWithStatusCode(_0x5e449f,_0x16dbcc){_0x16dbcc=_0x16dbcc||0xcc;return function(_0x3eef3b){if(_0x3eef3b){return _0x5e449f['sendStatus'](_0x16dbcc);}return _0x5e449f[_0xcdcc('0x28')](_0x16dbcc)[_0xcdcc('0x29')]();};}function respondWithResult(_0x429ff7,_0x178feb){_0x178feb=_0x178feb||0xc8;return function(_0x90d815){if(_0x90d815){return _0x429ff7[_0xcdcc('0x28')](_0x178feb)[_0xcdcc('0x2a')](_0x90d815);}};}function respondWithFilteredResult(_0x335317,_0x5d582f){return function(_0xc096cb){if(_0xc096cb){var _0x421c88=typeof _0x5d582f[_0xcdcc('0x2b')]==='undefined'&&typeof _0x5d582f[_0xcdcc('0x2c')]===_0xcdcc('0x2d');var _0x42f578=_0xc096cb['count'];var _0x3c0bea=_0x421c88?0x0:_0x5d582f[_0xcdcc('0x2b')];var _0x2436c2=_0x421c88?_0xc096cb[_0xcdcc('0x2e')]:_0x5d582f[_0xcdcc('0x2b')]+_0x5d582f[_0xcdcc('0x2c')];var _0x559326;if(_0x2436c2>=_0x42f578){_0x2436c2=_0x42f578;_0x559326=0xc8;}else{_0x559326=0xce;}_0x335317[_0xcdcc('0x28')](_0x559326);return _0x335317[_0xcdcc('0x2f')](_0xcdcc('0x30'),_0x3c0bea+'-'+_0x2436c2+'/'+_0x42f578)[_0xcdcc('0x2a')](_0xc096cb);}return null;};}function patchUpdates(_0xaaf778){return function(_0x465d03){try{jsonpatch['apply'](_0x465d03,_0xaaf778,!![]);}catch(_0x153c4c){return BPromise[_0xcdcc('0x31')](_0x153c4c);}return _0x465d03[_0xcdcc('0x32')]();};}function saveUpdates(_0x12c4ba,_0x43e245){return function(_0x31ea6a){if(_0x31ea6a){return _0x31ea6a[_0xcdcc('0x33')](_0x12c4ba)[_0xcdcc('0x1d')](function(_0x3cfc0e){return _0x3cfc0e;});}return null;};}function removeEntity(_0x3e2bf7,_0x15af18){return function(_0x4c7e41){if(_0x4c7e41){return _0x4c7e41[_0xcdcc('0x34')]()[_0xcdcc('0x1d')](function(){var _0x64167c=_0x4c7e41['get']({'plain':!![]});var _0x3f5e54=_0xcdcc('0x35');return db[_0xcdcc('0x36')]['destroy']({'where':{'type':_0x3f5e54,'resourceId':_0x64167c['id']}})[_0xcdcc('0x1d')](function(){return _0x4c7e41;});})[_0xcdcc('0x1d')](function(){_0x3e2bf7[_0xcdcc('0x28')](0xcc)[_0xcdcc('0x29')]();});}};}function handleEntityNotFound(_0x4cc7f3,_0x49a2a0){return function(_0x1bc5ad){if(!_0x1bc5ad){_0x4cc7f3[_0xcdcc('0x37')](0x194);}return _0x1bc5ad;};}function handleError(_0x387440,_0x284bcb){_0x284bcb=_0x284bcb||0x1f4;return function(_0x2f0fd6){logger[_0xcdcc('0x23')](_0x2f0fd6[_0xcdcc('0x38')]);if(_0x2f0fd6[_0xcdcc('0x39')]){delete _0x2f0fd6[_0xcdcc('0x39')];}_0x387440[_0xcdcc('0x28')](_0x284bcb)[_0xcdcc('0x3a')](_0x2f0fd6);};}exports[_0xcdcc('0x3b')]=function(_0x9a23c,_0x46684e){var _0x46376f={},_0x4b9815={},_0x547a4={'count':0x0,'rows':[]};var _0x1e9248=_['map'](db[_0xcdcc('0x3c')]['rawAttributes'],function(_0x291163){return{'name':_0x291163[_0xcdcc('0x3d')],'type':_0x291163[_0xcdcc('0x3e')][_0xcdcc('0x3f')]};});_0x4b9815[_0xcdcc('0x40')]=_['map'](_0x1e9248,_0xcdcc('0x39'));_0x4b9815[_0xcdcc('0x41')]=_['keys'](_0x9a23c[_0xcdcc('0x41')]);_0x4b9815[_0xcdcc('0x42')]=_[_0xcdcc('0x43')](_0x4b9815['model'],_0x4b9815[_0xcdcc('0x41')]);_0x46376f['attributes']=_[_0xcdcc('0x43')](_0x4b9815['model'],qs[_0xcdcc('0x44')](_0x9a23c['query']['fields']));_0x46376f['attributes']=_0x46376f[_0xcdcc('0x45')][_0xcdcc('0x46')]?_0x46376f[_0xcdcc('0x45')]:_0x4b9815[_0xcdcc('0x40')];if(!_0x9a23c[_0xcdcc('0x41')][_0xcdcc('0x47')](_0xcdcc('0x48'))){_0x46376f[_0xcdcc('0x2c')]=qs[_0xcdcc('0x2c')](_0x9a23c[_0xcdcc('0x41')][_0xcdcc('0x2c')]);_0x46376f[_0xcdcc('0x2b')]=qs[_0xcdcc('0x2b')](_0x9a23c['query'][_0xcdcc('0x2b')]);}_0x46376f[_0xcdcc('0x49')]=qs[_0xcdcc('0x4a')](_0x9a23c[_0xcdcc('0x41')][_0xcdcc('0x4a')]);_0x46376f[_0xcdcc('0x4b')]=qs[_0xcdcc('0x42')](_[_0xcdcc('0x4c')](_0x9a23c[_0xcdcc('0x41')],_0x4b9815[_0xcdcc('0x42')]),_0x1e9248);if(_0x9a23c[_0xcdcc('0x41')][_0xcdcc('0x4d')]){_0x46376f[_0xcdcc('0x4b')]=_[_0xcdcc('0x4e')](_0x46376f['where'],{'$or':_['map'](_0x1e9248,function(_0xdbc18c){if(_0xdbc18c[_0xcdcc('0x3e')]!=='VIRTUAL'){var _0x5c8dc9={};_0x5c8dc9[_0xdbc18c[_0xcdcc('0x39')]]={'$like':'%'+_0x9a23c[_0xcdcc('0x41')]['filter']+'%'};return _0x5c8dc9;}})});}_0x46376f=_['merge']({},_0x46376f,_0x9a23c['options']);var _0x51e148={'where':_0x46376f[_0xcdcc('0x4b')]};return db[_0xcdcc('0x3c')][_0xcdcc('0x2e')](_0x51e148)['then'](function(_0x33c3ad){_0x547a4[_0xcdcc('0x2e')]=_0x33c3ad;if(_0x9a23c[_0xcdcc('0x41')][_0xcdcc('0x4f')]){_0x46376f[_0xcdcc('0x50')]=[{'all':!![]}];}return db[_0xcdcc('0x3c')][_0xcdcc('0x51')](_0x46376f);})['then'](function(_0x30f254){_0x547a4[_0xcdcc('0x52')]=_0x30f254;return _0x547a4;})[_0xcdcc('0x1d')](respondWithFilteredResult(_0x46684e,_0x46376f))[_0xcdcc('0x27')](handleError(_0x46684e,null));};exports[_0xcdcc('0x53')]=function(_0x3cbf3d,_0x43fc5b){var _0x1e672b={'raw':![],'where':{'id':_0x3cbf3d['params']['id']}},_0x34c524={};_0x34c524[_0xcdcc('0x40')]=_[_0xcdcc('0x54')](db[_0xcdcc('0x3c')]['rawAttributes']);_0x34c524['query']=_[_0xcdcc('0x54')](_0x3cbf3d['query']);_0x34c524['filters']=_[_0xcdcc('0x43')](_0x34c524[_0xcdcc('0x40')],_0x34c524[_0xcdcc('0x41')]);_0x1e672b['attributes']=_[_0xcdcc('0x43')](_0x34c524[_0xcdcc('0x40')],qs['fields'](_0x3cbf3d[_0xcdcc('0x41')][_0xcdcc('0x44')]));_0x1e672b[_0xcdcc('0x45')]=_0x1e672b[_0xcdcc('0x45')][_0xcdcc('0x46')]?_0x1e672b[_0xcdcc('0x45')]:_0x34c524[_0xcdcc('0x40')];if(_0x3cbf3d[_0xcdcc('0x41')][_0xcdcc('0x4f')]){_0x1e672b[_0xcdcc('0x50')]=[{'all':!![]}];}_0x1e672b=_[_0xcdcc('0x4e')]({},_0x1e672b,_0x3cbf3d[_0xcdcc('0x55')]);return db[_0xcdcc('0x3c')][_0xcdcc('0x56')](_0x1e672b)[_0xcdcc('0x1d')](handleEntityNotFound(_0x43fc5b,null))[_0xcdcc('0x1d')](respondWithResult(_0x43fc5b,null))[_0xcdcc('0x27')](handleError(_0x43fc5b,null));};exports[_0xcdcc('0x57')]=function(_0x50bd13,_0x32683f,_0x5cea29){var _0x4ec176;return db[_0xcdcc('0x3c')]['create'](_0x50bd13['body'],{'raw':!![]})[_0xcdcc('0x1d')](function(_0x1c53b4){_0x4ec176=_0x1c53b4;return db[_0xcdcc('0x3c')][_0xcdcc('0x51')]({'raw':!![]});})[_0xcdcc('0x1d')](function(_0x34ecf){var _0x377c16=fs[_0xcdcc('0x58')](path[_0xcdcc('0x59')](config[_0xcdcc('0x5a')],_0xcdcc('0x5b')),'utf8');var _0x1cab31=ejs['render'](_0x377c16,{'contexts':_0x34ecf||[]});fs[_0xcdcc('0x5c')](_0xcdcc('0x5d'),_0x1cab31);})[_0xcdcc('0x1d')](function(){return respondWithRpcPromise(_0xcdcc('0x5e'),_0xcdcc('0x57'),{'module':_0xcdcc('0x5f')});})['then'](function(){var _0x719240=_0x50bd13[_0xcdcc('0x60')][_0xcdcc('0x61')]({'plain':!![]});if(!_0x719240)throw new Error(_0xcdcc('0x62'));if(_0x719240[_0xcdcc('0x63')]===_0xcdcc('0x60')){var _0x308067=_0x4ec176['get']({'plain':!![]});return db[_0xcdcc('0x64')][_0xcdcc('0x56')]({'where':{'name':_0xcdcc('0x35'),'userProfileId':_0x719240[_0xcdcc('0x65')]},'raw':!![]})[_0xcdcc('0x1d')](function(_0x3bfc9a){if(_0x3bfc9a&&_0x3bfc9a['autoAssociation']===0x0){return db[_0xcdcc('0x36')][_0xcdcc('0x57')]({'name':_0x308067[_0xcdcc('0x39')],'resourceId':_0x308067['id'],'type':_0x3bfc9a[_0xcdcc('0x39')],'sectionId':_0x3bfc9a['id']},{})['then'](function(){return _0x4ec176;});}else{return _0x4ec176;}})[_0xcdcc('0x27')](function(_0x439fb8){logger['error'](_0xcdcc('0x66'),_0x439fb8);throw _0x439fb8;});}return _0x4ec176;})[_0xcdcc('0x1d')](respondWithResult(_0x32683f,0xc9))[_0xcdcc('0x27')](handleError(_0x32683f,null));};exports['update']=function(_0x42e71c,_0xa9fc28,_0x166488){var _0x16390a;return db['VoiceContext']['find']({'where':{'id':_0x42e71c[_0xcdcc('0x67')]['id']}})[_0xcdcc('0x1d')](handleEntityNotFound(_0xa9fc28,null))[_0xcdcc('0x1d')](saveUpdates(_0x42e71c[_0xcdcc('0x68')],null))['then'](function(_0x10d908){if(_0x10d908){_0x16390a=_0x10d908;return db[_0xcdcc('0x3c')][_0xcdcc('0x51')]({'raw':!![]});}})[_0xcdcc('0x1d')](function(_0x1b8ac4){var _0x429f35=fs[_0xcdcc('0x58')](path[_0xcdcc('0x59')](config[_0xcdcc('0x5a')],_0xcdcc('0x5b')),_0xcdcc('0x69'));var _0x592b93=ejs[_0xcdcc('0x6a')](_0x429f35,{'contexts':_0x1b8ac4||[]});fs[_0xcdcc('0x5c')](_0xcdcc('0x5d'),_0x592b93);})[_0xcdcc('0x1d')](function(){return respondWithRpcPromise(_0xcdcc('0x5e'),_0xcdcc('0x33'),{'module':_0xcdcc('0x5f')});})[_0xcdcc('0x1d')](function(){return _0x16390a;})[_0xcdcc('0x1d')](respondWithResult(_0xa9fc28,null))[_0xcdcc('0x27')](handleError(_0xa9fc28,null));};exports[_0xcdcc('0x34')]=function(_0x4b36bd,_0x546ef8,_0x4a89e0){var _0x5870f3;return db[_0xcdcc('0x3c')][_0xcdcc('0x56')]({'where':{'id':_0x4b36bd['params']['id']}})[_0xcdcc('0x1d')](handleEntityNotFound(_0x546ef8,null))['then'](removeEntity(_0x546ef8,null))[_0xcdcc('0x1d')](function(){return db[_0xcdcc('0x3c')]['findAll']({'raw':!![]});})[_0xcdcc('0x1d')](function(_0x512f5a){var _0x1084c2=fs[_0xcdcc('0x58')](path[_0xcdcc('0x59')](config[_0xcdcc('0x5a')],_0xcdcc('0x5b')),_0xcdcc('0x69'));var _0x43ecf0=ejs['render'](_0x1084c2,{'contexts':_0x512f5a});fs[_0xcdcc('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x43ecf0);return respondWithRpcPromise('Reload',_0xcdcc('0x34'),{'module':'chan_sip.so'});})[_0xcdcc('0x27')](handleError(_0x546ef8,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 2a2f026..187bd45 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 _0xc43a=['voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x328b58,_0xa4c1b0){var _0x5b6c6c=function(_0x128d79){while(--_0x128d79){_0x328b58['push'](_0x328b58['shift']());}};_0x5b6c6c(++_0xa4c1b0);}(_0xc43a,0x115));var _0xac43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc43a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac43('0x0'));var util=require(_0xac43('0x1'));var logger=require(_0xac43('0x2'))(_0xac43('0x3'));var moment=require('moment');var BPromise=require(_0xac43('0x4'));var rp=require(_0xac43('0x5'));var fs=require('fs');var path=require(_0xac43('0x6'));var rimraf=require('rimraf');var config=require(_0xac43('0x7'));var attributes=require(_0xac43('0x8'));module[_0xac43('0x9')]=function(_0x1c36d8,_0x5b9ae8){return _0x1c36d8[_0xac43('0xa')]('VoiceContext',attributes,{'tableName':_0xac43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33a5=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x33a5,0x125));var _0x533a=function(_0x26f280,_0x433595){_0x26f280=_0x26f280-0x0;var _0x436b05=_0x33a5[_0x26f280];return _0x436b05;};'use strict';var _=require(_0x533a('0x0'));var util=require(_0x533a('0x1'));var logger=require(_0x533a('0x2'))(_0x533a('0x3'));var moment=require(_0x533a('0x4'));var BPromise=require(_0x533a('0x5'));var rp=require(_0x533a('0x6'));var fs=require('fs');var path=require(_0x533a('0x7'));var rimraf=require(_0x533a('0x8'));var config=require(_0x533a('0x9'));var attributes=require(_0x533a('0xa'));module[_0x533a('0xb')]=function(_0x1bacf2,_0x4ea14d){return _0x1bacf2[_0x533a('0xc')](_0x533a('0xd'),attributes,{'tableName':_0x533a('0xe'),'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 99d44aa..50cbacc 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 _0x9c2c=['request\x20sent','stringify','code','error','message','info','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x55a0bf,_0x3f1235){var _0x20dfec=function(_0x5b5a12){while(--_0x5b5a12){_0x55a0bf['push'](_0x55a0bf['shift']());}};_0x20dfec(++_0x3f1235);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9c2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9c2('0x3'));var logger=require(_0xc9c2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9c2('0x5'));var client=jayson['client'][_0xc9c2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x17b5e8,_0x711f3d,_0x18a815){return new BPromise(function(_0x270572,_0xd7fb27){return client[_0xc9c2('0x7')](_0x17b5e8,_0x18a815)[_0xc9c2('0x8')](function(_0x8614c4){logger['info'](_0xc9c2('0x9'),_0x711f3d,'request\x20sent');logger[_0xc9c2('0xa')](_0xc9c2('0xb'),_0x711f3d,_0xc9c2('0xc'),JSON[_0xc9c2('0xd')](_0x8614c4));if(_0x8614c4['error']){if(_0x8614c4['error'][_0xc9c2('0xe')]===0x1f4){logger[_0xc9c2('0xf')]('VoiceContext,\x20%s,\x20%s',_0x711f3d,_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);return _0xd7fb27(_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);}logger[_0xc9c2('0xf')](_0xc9c2('0x9'),_0x711f3d,_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);return _0x270572(_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);}else{logger[_0xc9c2('0x11')](_0xc9c2('0x9'),_0x711f3d,'request\x20sent');_0x270572(_0x8614c4[_0xc9c2('0x12')][_0xc9c2('0x10')]);}})[_0xc9c2('0x13')](function(_0x240099){logger[_0xc9c2('0xf')]('VoiceContext,\x20%s,\x20%s',_0x711f3d,_0x240099);_0xd7fb27(_0x240099);});});} \ No newline at end of file +var _0xe330=['code','message','result','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4bdcd8,_0x5b4cd6){var _0x2bf60=function(_0x526da7){while(--_0x526da7){_0x4bdcd8['push'](_0x4bdcd8['shift']());}};_0x2bf60(++_0x5b4cd6);}(_0xe330,0x96));var _0x0e33=function(_0x53273e,_0xeedda3){_0x53273e=_0x53273e-0x0;var _0x28afea=_0xe330[_0x53273e];return _0x28afea;};'use strict';var _=require('lodash');var util=require(_0x0e33('0x0'));var moment=require(_0x0e33('0x1'));var BPromise=require(_0x0e33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e33('0x3'))['db'];var utils=require(_0x0e33('0x4'));var logger=require('../../config/logger')(_0x0e33('0x5'));var config=require(_0x0e33('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0e33('0x7')][_0x0e33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2db301,_0x1668a2,_0x21553b){return new BPromise(function(_0x3e4028,_0x2350dd){return client[_0x0e33('0x9')](_0x2db301,_0x21553b)[_0x0e33('0xa')](function(_0x391713){logger[_0x0e33('0xb')](_0x0e33('0xc'),_0x1668a2,'request\x20sent');logger[_0x0e33('0xd')](_0x0e33('0xe'),_0x1668a2,_0x0e33('0xf'),JSON[_0x0e33('0x10')](_0x391713));if(_0x391713['error']){if(_0x391713[_0x0e33('0x11')][_0x0e33('0x12')]===0x1f4){logger[_0x0e33('0x11')](_0x0e33('0xc'),_0x1668a2,_0x391713['error'][_0x0e33('0x13')]);return _0x2350dd(_0x391713[_0x0e33('0x11')]['message']);}logger[_0x0e33('0x11')](_0x0e33('0xc'),_0x1668a2,_0x391713[_0x0e33('0x11')][_0x0e33('0x13')]);return _0x3e4028(_0x391713[_0x0e33('0x11')][_0x0e33('0x13')]);}else{logger[_0x0e33('0xb')](_0x0e33('0xc'),_0x1668a2,_0x0e33('0xf'));_0x3e4028(_0x391713[_0x0e33('0x14')]['message']);}})['catch'](function(_0x6f3075){logger[_0x0e33('0x11')](_0x0e33('0xc'),_0x1668a2,_0x6f3075);_0x2350dd(_0x6f3075);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4d25b34..9063f18 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 _0x20fa=['show','post','create','update','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','/:id'];(function(_0x1396c6,_0x55e1aa){var _0x16ceca=function(_0x51597e){while(--_0x51597e){_0x1396c6['push'](_0x1396c6['shift']());}};_0x16ceca(++_0x55e1aa);}(_0x20fa,0x166));var _0xa20f=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x20fa[_0x3ec333];return _0x15ccb8;};'use strict';var multer=require(_0xa20f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa20f('0x1'));var express=require('express');var router=express[_0xa20f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa20f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa20f('0x4'));var controller=require('./voiceDialReport.controller');router[_0xa20f('0x5')]('/',auth['isAuthenticated'](),controller[_0xa20f('0x6')]);router[_0xa20f('0x5')](_0xa20f('0x7'),auth[_0xa20f('0x8')](),controller['describe']);router['get'](_0xa20f('0x9'),auth['isAuthenticated'](),controller[_0xa20f('0xa')]);router[_0xa20f('0xb')]('/',auth[_0xa20f('0x8')](),controller[_0xa20f('0xc')]);router['put'](_0xa20f('0x9'),auth['isAuthenticated'](),controller[_0xa20f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa20f('0xe')]);module[_0xa20f('0xf')]=router; \ No newline at end of file +var _0x2e14=['describe','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x208c93,_0x1d28c4){var _0x3ad814=function(_0x321089){while(--_0x321089){_0x208c93['push'](_0x208c93['shift']());}};_0x3ad814(++_0x1d28c4);}(_0x2e14,0x158));var _0x42e1=function(_0x549d57,_0x6b8598){_0x549d57=_0x549d57-0x0;var _0x330291=_0x2e14[_0x549d57];return _0x330291;};'use strict';var multer=require(_0x42e1('0x0'));var util=require(_0x42e1('0x1'));var path=require('path');var timeout=require(_0x42e1('0x2'));var express=require('express');var router=express[_0x42e1('0x3')]();var fs_extra=require(_0x42e1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x42e1('0x5'));var controller=require('./voiceDialReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x42e1('0x6')]('/describe',auth[_0x42e1('0x7')](),controller[_0x42e1('0x8')]);router['get'](_0x42e1('0x9'),auth[_0x42e1('0x7')](),controller[_0x42e1('0xa')]);router['post']('/',auth[_0x42e1('0x7')](),controller[_0x42e1('0xb')]);router[_0x42e1('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x42e1('0xd')]);router[_0x42e1('0xe')](_0x42e1('0x9'),auth[_0x42e1('0x7')](),controller['destroy']);module[_0x42e1('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0f6d792..4db82b5 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 _0xdace=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0xdace,0xc5));var _0xedac=function(_0x27d958,_0x29ef87){_0x27d958=_0x27d958-0x0;var _0x53e63e=_0xdace[_0x27d958];return _0x53e63e;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xedac('0x1')]},'channel':{'type':Sequelize[_0xedac('0x1')]},'channelstate':{'type':Sequelize[_0xedac('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xedac('0x1')]},'calleridname':{'type':Sequelize[_0xedac('0x1')]},'connectedlinenum':{'type':Sequelize[_0xedac('0x1')]},'connectedlinename':{'type':Sequelize[_0xedac('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xedac('0x1')]},'context':{'type':Sequelize[_0xedac('0x1')]},'exten':{'type':Sequelize[_0xedac('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xedac('0x1')]},'linkedid':{'type':Sequelize[_0xedac('0x1')]},'destchannel':{'type':Sequelize[_0xedac('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xedac('0x1')]},'destcalleridnum':{'type':Sequelize[_0xedac('0x1')]},'destcalleridname':{'type':Sequelize[_0xedac('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xedac('0x1')]},'destaccountcode':{'type':Sequelize[_0xedac('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xedac('0x2')]},'destuniqueid':{'type':Sequelize[_0xedac('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xedac('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xedac('0x3')]},'answertime':{'type':Sequelize[_0xedac('0x3')]},'endtime':{'type':Sequelize[_0xedac('0x3')]},'lastevent':{'type':Sequelize[_0xedac('0x1')],'comment':_0xedac('0x4')},'routeId':{'type':Sequelize[_0xedac('0x2')]},'duration':{'type':Sequelize[_0xedac('0x2')]},'holdtime':{'type':Sequelize[_0xedac('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x3611ef,_0x4fbb05){var _0x246a54=function(_0x2bbd56){while(--_0x2bbd56){_0x3611ef['push'](_0x3611ef['shift']());}};_0x246a54(++_0x4fbb05);}(_0xb821,0xa7));var _0x1b82=function(_0x368278,_0x128399){_0x368278=_0x368278-0x0;var _0x250968=_0xb821[_0x368278];return _0x250968;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 2de2bdf..7dc235c 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 _0xa813=['then','error','stack','name','index','map','VoiceDialReport','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy'];(function(_0x565e1a,_0x391df9){var _0x10aab4=function(_0x32532a){while(--_0x32532a){_0x565e1a['push'](_0x565e1a['shift']());}};_0x10aab4(++_0x391df9);}(_0xa813,0xbb));var _0x3a81=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa813[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x3a81('0x0'));var rimraf=require(_0x3a81('0x1'));var zipdir=require(_0x3a81('0x2'));var jsonpatch=require(_0x3a81('0x3'));var rp=require(_0x3a81('0x4'));var moment=require(_0x3a81('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3a81('0x6'));var util=require(_0x3a81('0x7'));var path=require(_0x3a81('0x8'));var sox=require('sox');var csv=require(_0x3a81('0x9'));var ejs=require(_0x3a81('0xa'));var fs=require('fs');var fs_extra=require(_0x3a81('0xb'));var _=require(_0x3a81('0xc'));var squel=require(_0x3a81('0xd'));var crypto=require(_0x3a81('0xe'));var jsforce=require(_0x3a81('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3a81('0x9'));var querystring=require(_0x3a81('0x10'));var Papa=require('papaparse');var Redis=require(_0x3a81('0x11'));var authService=require(_0x3a81('0x12'));var qs=require(_0x3a81('0x13'));var as=require(_0x3a81('0x14'));var hardwareService=require(_0x3a81('0x15'));var logger=require('../../config/logger')(_0x3a81('0x16'));var utils=require(_0x3a81('0x17'));var config=require(_0x3a81('0x18'));var licenseUtil=require(_0x3a81('0x19'));var db=require(_0x3a81('0x1a'))['db'];function respondWithStatusCode(_0xe26062,_0x5ddafe){_0x5ddafe=_0x5ddafe||0xcc;return function(_0x40faa7){if(_0x40faa7){return _0xe26062[_0x3a81('0x1b')](_0x5ddafe);}return _0xe26062[_0x3a81('0x1c')](_0x5ddafe)[_0x3a81('0x1d')]();};}function respondWithResult(_0x5fa155,_0x583280){_0x583280=_0x583280||0xc8;return function(_0x280871){if(_0x280871){return _0x5fa155[_0x3a81('0x1c')](_0x583280)[_0x3a81('0x1e')](_0x280871);}};}function respondWithFilteredResult(_0x3476e0,_0x4524e9){return function(_0x2e87f7){if(_0x2e87f7){var _0x54faf5=typeof _0x4524e9[_0x3a81('0x1f')]===_0x3a81('0x20')&&typeof _0x4524e9[_0x3a81('0x21')]==='undefined';var _0x5bc654=_0x2e87f7[_0x3a81('0x22')];var _0x1ad85c=_0x54faf5?0x0:_0x4524e9[_0x3a81('0x1f')];var _0x5aa994=_0x54faf5?_0x2e87f7[_0x3a81('0x22')]:_0x4524e9[_0x3a81('0x1f')]+_0x4524e9[_0x3a81('0x21')];var _0x12a5f7;if(_0x5aa994>=_0x5bc654){_0x5aa994=_0x5bc654;_0x12a5f7=0xc8;}else{_0x12a5f7=0xce;}_0x3476e0[_0x3a81('0x1c')](_0x12a5f7);return _0x3476e0[_0x3a81('0x23')](_0x3a81('0x24'),_0x1ad85c+'-'+_0x5aa994+'/'+_0x5bc654)[_0x3a81('0x1e')](_0x2e87f7);}return null;};}function patchUpdates(_0x2802a4){return function(_0x3854c1){try{jsonpatch['apply'](_0x3854c1,_0x2802a4,!![]);}catch(_0x19e51b){return BPromise[_0x3a81('0x25')](_0x19e51b);}return _0x3854c1[_0x3a81('0x26')]();};}function saveUpdates(_0x261da6,_0x254044){return function(_0x328e72){if(_0x328e72){return _0x328e72[_0x3a81('0x27')](_0x261da6)['then'](function(_0xc72d24){return _0xc72d24;});}return null;};}function removeEntity(_0x2f33e,_0x2dfb23){return function(_0x4cabe2){if(_0x4cabe2){return _0x4cabe2[_0x3a81('0x28')]()[_0x3a81('0x29')](function(){_0x2f33e['status'](0xcc)[_0x3a81('0x1d')]();});}};}function handleEntityNotFound(_0x1a8bd9,_0xbad718){return function(_0x381cc7){if(!_0x381cc7){_0x1a8bd9[_0x3a81('0x1b')](0x194);}return _0x381cc7;};}function handleError(_0x1b4f44,_0xc0da05){_0xc0da05=_0xc0da05||0x1f4;return function(_0x160953){logger[_0x3a81('0x2a')](_0x160953[_0x3a81('0x2b')]);if(_0x160953[_0x3a81('0x2c')]){delete _0x160953['name'];}_0x1b4f44[_0x3a81('0x1c')](_0xc0da05)['send'](_0x160953);};}exports[_0x3a81('0x2d')]=function(_0x3ff642,_0xdcc0bb){var _0x26a3cd={},_0x40edcd={},_0x58c1e3={'count':0x0,'rows':[]};var _0x3955a1=_[_0x3a81('0x2e')](db[_0x3a81('0x2f')]['rawAttributes'],function(_0x1862f0){return{'name':_0x1862f0['fieldName'],'type':_0x1862f0[_0x3a81('0x30')]['key']};});_0x40edcd[_0x3a81('0x31')]=_['map'](_0x3955a1,_0x3a81('0x2c'));_0x40edcd['query']=_['keys'](_0x3ff642[_0x3a81('0x32')]);_0x40edcd[_0x3a81('0x33')]=_['intersection'](_0x40edcd[_0x3a81('0x31')],_0x40edcd['query']);_0x26a3cd['attributes']=_[_0x3a81('0x34')](_0x40edcd[_0x3a81('0x31')],qs['fields'](_0x3ff642[_0x3a81('0x32')][_0x3a81('0x35')]));_0x26a3cd[_0x3a81('0x36')]=_0x26a3cd[_0x3a81('0x36')][_0x3a81('0x37')]?_0x26a3cd[_0x3a81('0x36')]:_0x40edcd[_0x3a81('0x31')];if(!_0x3ff642[_0x3a81('0x32')][_0x3a81('0x38')]('nolimit')){_0x26a3cd[_0x3a81('0x21')]=qs[_0x3a81('0x21')](_0x3ff642[_0x3a81('0x32')][_0x3a81('0x21')]);_0x26a3cd[_0x3a81('0x1f')]=qs[_0x3a81('0x1f')](_0x3ff642[_0x3a81('0x32')][_0x3a81('0x1f')]);}_0x26a3cd['order']=qs[_0x3a81('0x39')](_0x3ff642[_0x3a81('0x32')][_0x3a81('0x39')]);_0x26a3cd[_0x3a81('0x3a')]=qs['filters'](_[_0x3a81('0x3b')](_0x3ff642[_0x3a81('0x32')],_0x40edcd[_0x3a81('0x33')]),_0x3955a1);if(_0x3ff642[_0x3a81('0x32')][_0x3a81('0x3c')]){_0x26a3cd[_0x3a81('0x3a')]=_[_0x3a81('0x3d')](_0x26a3cd[_0x3a81('0x3a')],{'$or':_[_0x3a81('0x2e')](_0x3955a1,function(_0x192be8){if(_0x192be8[_0x3a81('0x30')]!==_0x3a81('0x3e')){var _0x3f00c6={};_0x3f00c6[_0x192be8[_0x3a81('0x2c')]]={'$like':'%'+_0x3ff642[_0x3a81('0x32')][_0x3a81('0x3c')]+'%'};return _0x3f00c6;}})});}_0x26a3cd=_[_0x3a81('0x3d')]({},_0x26a3cd,_0x3ff642[_0x3a81('0x3f')]);var _0x53de1c={'where':_0x26a3cd[_0x3a81('0x3a')]};return db['VoiceDialReport'][_0x3a81('0x22')](_0x53de1c)[_0x3a81('0x29')](function(_0x26a19e){_0x58c1e3[_0x3a81('0x22')]=_0x26a19e;if(_0x3ff642[_0x3a81('0x32')][_0x3a81('0x40')]){_0x26a3cd[_0x3a81('0x41')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x3a81('0x42')](_0x26a3cd);})[_0x3a81('0x29')](function(_0x430926){_0x58c1e3[_0x3a81('0x43')]=_0x430926;return _0x58c1e3;})[_0x3a81('0x29')](respondWithFilteredResult(_0xdcc0bb,_0x26a3cd))['catch'](handleError(_0xdcc0bb,null));};exports[_0x3a81('0x44')]=function(_0x332ba1,_0x3ef3b5){var _0x4e755a={'raw':!![],'where':{'id':_0x332ba1['params']['id']}},_0x416cb4={};_0x416cb4['model']=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x416cb4[_0x3a81('0x32')]=_[_0x3a81('0x45')](_0x332ba1['query']);_0x416cb4[_0x3a81('0x33')]=_[_0x3a81('0x34')](_0x416cb4['model'],_0x416cb4['query']);_0x4e755a[_0x3a81('0x36')]=_[_0x3a81('0x34')](_0x416cb4[_0x3a81('0x31')],qs[_0x3a81('0x35')](_0x332ba1[_0x3a81('0x32')]['fields']));_0x4e755a[_0x3a81('0x36')]=_0x4e755a[_0x3a81('0x36')][_0x3a81('0x37')]?_0x4e755a[_0x3a81('0x36')]:_0x416cb4['model'];if(_0x332ba1[_0x3a81('0x32')][_0x3a81('0x40')]){_0x4e755a['include']=[{'all':!![]}];}_0x4e755a=_[_0x3a81('0x3d')]({},_0x4e755a,_0x332ba1[_0x3a81('0x3f')]);return db['VoiceDialReport'][_0x3a81('0x46')](_0x4e755a)[_0x3a81('0x29')](handleEntityNotFound(_0x3ef3b5,null))['then'](respondWithResult(_0x3ef3b5,null))[_0x3a81('0x47')](handleError(_0x3ef3b5,null));};exports[_0x3a81('0x48')]=function(_0x10069f,_0x2ab20d){return db[_0x3a81('0x2f')][_0x3a81('0x48')](_0x10069f['body'],{})['then'](respondWithResult(_0x2ab20d,0xc9))[_0x3a81('0x47')](handleError(_0x2ab20d,null));};exports['update']=function(_0x16bed6,_0x1641f9){if(_0x16bed6[_0x3a81('0x49')]['id']){delete _0x16bed6[_0x3a81('0x49')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x16bed6['params']['id']}})[_0x3a81('0x29')](handleEntityNotFound(_0x1641f9,null))['then'](saveUpdates(_0x16bed6[_0x3a81('0x49')],null))['then'](respondWithResult(_0x1641f9,null))[_0x3a81('0x47')](handleError(_0x1641f9,null));};exports['destroy']=function(_0x5d6aad,_0x3c0d9d){return db['VoiceDialReport']['find']({'where':{'id':_0x5d6aad[_0x3a81('0x4a')]['id']}})[_0x3a81('0x29')](handleEntityNotFound(_0x3c0d9d,null))['then'](removeEntity(_0x3c0d9d,null))[_0x3a81('0x47')](handleError(_0x3c0d9d,null));};exports[_0x3a81('0x4b')]=function(_0xf6c5b4,_0xc8c2f3){return db['VoiceDialReport']['describe']()[_0x3a81('0x29')](respondWithResult(_0xc8c2f3,null))['catch'](handleError(_0xc8c2f3,null));}; \ No newline at end of file +var _0x46a0=['set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','merge','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x457fe4,_0xc65b07){var _0x4ef69f=function(_0x40255a){while(--_0x40255a){_0x457fe4['push'](_0x457fe4['shift']());}};_0x4ef69f(++_0xc65b07);}(_0x46a0,0x15c));var _0x046a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x46a0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x046a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x046a('0x1'));var jsonpatch=require(_0x046a('0x2'));var rp=require(_0x046a('0x3'));var moment=require('moment');var BPromise=require(_0x046a('0x4'));var Mustache=require(_0x046a('0x5'));var util=require(_0x046a('0x6'));var path=require('path');var sox=require(_0x046a('0x7'));var csv=require(_0x046a('0x8'));var ejs=require(_0x046a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x046a('0xa'));var squel=require(_0x046a('0xb'));var crypto=require('crypto');var jsforce=require(_0x046a('0xc'));var deskjs=require(_0x046a('0xd'));var toCsv=require(_0x046a('0x8'));var querystring=require('querystring');var Papa=require(_0x046a('0xe'));var Redis=require(_0x046a('0xf'));var authService=require(_0x046a('0x10'));var qs=require(_0x046a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x046a('0x12'));var logger=require(_0x046a('0x13'))(_0x046a('0x14'));var utils=require(_0x046a('0x15'));var config=require(_0x046a('0x16'));var licenseUtil=require(_0x046a('0x17'));var db=require(_0x046a('0x18'))['db'];function respondWithStatusCode(_0x3a5f54,_0xa3ec92){_0xa3ec92=_0xa3ec92||0xcc;return function(_0x422e29){if(_0x422e29){return _0x3a5f54['sendStatus'](_0xa3ec92);}return _0x3a5f54[_0x046a('0x19')](_0xa3ec92)[_0x046a('0x1a')]();};}function respondWithResult(_0x4c8110,_0x1f73bb){_0x1f73bb=_0x1f73bb||0xc8;return function(_0x398ef7){if(_0x398ef7){return _0x4c8110[_0x046a('0x19')](_0x1f73bb)[_0x046a('0x1b')](_0x398ef7);}};}function respondWithFilteredResult(_0x58d8cb,_0xdbc862){return function(_0x4cff75){if(_0x4cff75){var _0x2a70a5=typeof _0xdbc862[_0x046a('0x1c')]===_0x046a('0x1d')&&typeof _0xdbc862[_0x046a('0x1e')]===_0x046a('0x1d');var _0xa5ce62=_0x4cff75[_0x046a('0x1f')];var _0x38578a=_0x2a70a5?0x0:_0xdbc862[_0x046a('0x1c')];var _0x5d60dc=_0x2a70a5?_0x4cff75[_0x046a('0x1f')]:_0xdbc862[_0x046a('0x1c')]+_0xdbc862[_0x046a('0x1e')];var _0x1815af;if(_0x5d60dc>=_0xa5ce62){_0x5d60dc=_0xa5ce62;_0x1815af=0xc8;}else{_0x1815af=0xce;}_0x58d8cb[_0x046a('0x19')](_0x1815af);return _0x58d8cb[_0x046a('0x20')](_0x046a('0x21'),_0x38578a+'-'+_0x5d60dc+'/'+_0xa5ce62)[_0x046a('0x1b')](_0x4cff75);}return null;};}function patchUpdates(_0x3a2a3f){return function(_0x267275){try{jsonpatch['apply'](_0x267275,_0x3a2a3f,!![]);}catch(_0x29d84b){return BPromise[_0x046a('0x22')](_0x29d84b);}return _0x267275['save']();};}function saveUpdates(_0x589938,_0x35b284){return function(_0x31578d){if(_0x31578d){return _0x31578d[_0x046a('0x23')](_0x589938)[_0x046a('0x24')](function(_0x529500){return _0x529500;});}return null;};}function removeEntity(_0x703c3a,_0x40e3f4){return function(_0x3d0eae){if(_0x3d0eae){return _0x3d0eae[_0x046a('0x25')]()[_0x046a('0x24')](function(){_0x703c3a[_0x046a('0x19')](0xcc)[_0x046a('0x1a')]();});}};}function handleEntityNotFound(_0x256211,_0xfcbb4d){return function(_0x3ee88c){if(!_0x3ee88c){_0x256211[_0x046a('0x26')](0x194);}return _0x3ee88c;};}function handleError(_0x319ecd,_0x5e3b91){_0x5e3b91=_0x5e3b91||0x1f4;return function(_0x25a34a){logger[_0x046a('0x27')](_0x25a34a[_0x046a('0x28')]);if(_0x25a34a[_0x046a('0x29')]){delete _0x25a34a[_0x046a('0x29')];}_0x319ecd[_0x046a('0x19')](_0x5e3b91)[_0x046a('0x2a')](_0x25a34a);};}exports['index']=function(_0x4daf40,_0x8d3274){var _0x46c087={},_0x57ae6b={},_0x4cbc8c={'count':0x0,'rows':[]};var _0x589b9c=_[_0x046a('0x2b')](db[_0x046a('0x2c')][_0x046a('0x2d')],function(_0x12c281){return{'name':_0x12c281['fieldName'],'type':_0x12c281[_0x046a('0x2e')][_0x046a('0x2f')]};});_0x57ae6b[_0x046a('0x30')]=_[_0x046a('0x2b')](_0x589b9c,'name');_0x57ae6b[_0x046a('0x31')]=_[_0x046a('0x32')](_0x4daf40[_0x046a('0x31')]);_0x57ae6b[_0x046a('0x33')]=_[_0x046a('0x34')](_0x57ae6b[_0x046a('0x30')],_0x57ae6b[_0x046a('0x31')]);_0x46c087[_0x046a('0x35')]=_[_0x046a('0x34')](_0x57ae6b[_0x046a('0x30')],qs['fields'](_0x4daf40[_0x046a('0x31')][_0x046a('0x36')]));_0x46c087[_0x046a('0x35')]=_0x46c087[_0x046a('0x35')][_0x046a('0x37')]?_0x46c087['attributes']:_0x57ae6b['model'];if(!_0x4daf40[_0x046a('0x31')][_0x046a('0x38')](_0x046a('0x39'))){_0x46c087[_0x046a('0x1e')]=qs[_0x046a('0x1e')](_0x4daf40[_0x046a('0x31')][_0x046a('0x1e')]);_0x46c087[_0x046a('0x1c')]=qs['offset'](_0x4daf40[_0x046a('0x31')]['offset']);}_0x46c087[_0x046a('0x3a')]=qs['sort'](_0x4daf40[_0x046a('0x31')][_0x046a('0x3b')]);_0x46c087[_0x046a('0x3c')]=qs[_0x046a('0x33')](_[_0x046a('0x3d')](_0x4daf40['query'],_0x57ae6b['filters']),_0x589b9c);if(_0x4daf40[_0x046a('0x31')][_0x046a('0x3e')]){_0x46c087[_0x046a('0x3c')]=_['merge'](_0x46c087[_0x046a('0x3c')],{'$or':_['map'](_0x589b9c,function(_0x441851){if(_0x441851[_0x046a('0x2e')]!==_0x046a('0x3f')){var _0x16afca={};_0x16afca[_0x441851[_0x046a('0x29')]]={'$like':'%'+_0x4daf40['query'][_0x046a('0x3e')]+'%'};return _0x16afca;}})});}_0x46c087=_['merge']({},_0x46c087,_0x4daf40[_0x046a('0x40')]);var _0x210c9d={'where':_0x46c087[_0x046a('0x3c')]};return db['VoiceDialReport']['count'](_0x210c9d)['then'](function(_0x2f04a6){_0x4cbc8c[_0x046a('0x1f')]=_0x2f04a6;if(_0x4daf40[_0x046a('0x31')][_0x046a('0x41')]){_0x46c087[_0x046a('0x42')]=[{'all':!![]}];}return db[_0x046a('0x2c')][_0x046a('0x43')](_0x46c087);})[_0x046a('0x24')](function(_0x4b0f34){_0x4cbc8c[_0x046a('0x44')]=_0x4b0f34;return _0x4cbc8c;})[_0x046a('0x24')](respondWithFilteredResult(_0x8d3274,_0x46c087))[_0x046a('0x45')](handleError(_0x8d3274,null));};exports['show']=function(_0x1fef9f,_0x2f9ffb){var _0x436d97={'raw':!![],'where':{'id':_0x1fef9f['params']['id']}},_0x4759a9={};_0x4759a9[_0x046a('0x30')]=_['keys'](db['VoiceDialReport'][_0x046a('0x2d')]);_0x4759a9[_0x046a('0x31')]=_[_0x046a('0x32')](_0x1fef9f[_0x046a('0x31')]);_0x4759a9[_0x046a('0x33')]=_[_0x046a('0x34')](_0x4759a9[_0x046a('0x30')],_0x4759a9[_0x046a('0x31')]);_0x436d97[_0x046a('0x35')]=_[_0x046a('0x34')](_0x4759a9[_0x046a('0x30')],qs['fields'](_0x1fef9f['query'][_0x046a('0x36')]));_0x436d97[_0x046a('0x35')]=_0x436d97[_0x046a('0x35')][_0x046a('0x37')]?_0x436d97[_0x046a('0x35')]:_0x4759a9[_0x046a('0x30')];if(_0x1fef9f[_0x046a('0x31')][_0x046a('0x41')]){_0x436d97['include']=[{'all':!![]}];}_0x436d97=_[_0x046a('0x46')]({},_0x436d97,_0x1fef9f[_0x046a('0x40')]);return db['VoiceDialReport']['find'](_0x436d97)[_0x046a('0x24')](handleEntityNotFound(_0x2f9ffb,null))['then'](respondWithResult(_0x2f9ffb,null))[_0x046a('0x45')](handleError(_0x2f9ffb,null));};exports[_0x046a('0x47')]=function(_0x18bd2e,_0x4bf47e){return db[_0x046a('0x2c')]['create'](_0x18bd2e[_0x046a('0x48')],{})[_0x046a('0x24')](respondWithResult(_0x4bf47e,0xc9))[_0x046a('0x45')](handleError(_0x4bf47e,null));};exports[_0x046a('0x23')]=function(_0x366693,_0x569713){if(_0x366693[_0x046a('0x48')]['id']){delete _0x366693[_0x046a('0x48')]['id'];}return db['VoiceDialReport'][_0x046a('0x49')]({'where':{'id':_0x366693['params']['id']}})['then'](handleEntityNotFound(_0x569713,null))['then'](saveUpdates(_0x366693[_0x046a('0x48')],null))[_0x046a('0x24')](respondWithResult(_0x569713,null))[_0x046a('0x45')](handleError(_0x569713,null));};exports[_0x046a('0x25')]=function(_0x4b8b2b,_0x4b42b2){return db[_0x046a('0x2c')][_0x046a('0x49')]({'where':{'id':_0x4b8b2b[_0x046a('0x4a')]['id']}})[_0x046a('0x24')](handleEntityNotFound(_0x4b42b2,null))['then'](removeEntity(_0x4b42b2,null))['catch'](handleError(_0x4b42b2,null));};exports[_0x046a('0x4b')]=function(_0x315164,_0x32e1dd){return db[_0x046a('0x2c')]['describe']()[_0x046a('0x24')](respondWithResult(_0x32e1dd,null))[_0x046a('0x45')](handleError(_0x32e1dd,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 19fca8c..3107f4c 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 _0x6a9d=['define','VoiceDialReport','report_dial','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x750b62,_0x511a63){var _0x4a80cc=function(_0x2ad29b){while(--_0x2ad29b){_0x750b62['push'](_0x750b62['shift']());}};_0x4a80cc(++_0x511a63);}(_0x6a9d,0x111));var _0xd6a9=function(_0x22412c,_0x9bcdc0){_0x22412c=_0x22412c-0x0;var _0x2fe93c=_0x6a9d[_0x22412c];return _0x2fe93c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd6a9('0x0'));var moment=require(_0xd6a9('0x1'));var BPromise=require(_0xd6a9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6a9('0x3'));var rimraf=require(_0xd6a9('0x4'));var config=require(_0xd6a9('0x5'));var attributes=require(_0xd6a9('0x6'));module['exports']=function(_0x21228e,_0x2462cb){return _0x21228e[_0xd6a9('0x7')](_0xd6a9('0x8'),attributes,{'tableName':_0xd6a9('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4874=['../../config/logger','api','moment','bluebird','path','rimraf','./voiceDialReport.attributes','VoiceDialReport','uniqueid','util'];(function(_0x4d6492,_0x5128ae){var _0x4a12b1=function(_0x200867){while(--_0x200867){_0x4d6492['push'](_0x4d6492['shift']());}};_0x4a12b1(++_0x5128ae);}(_0x4874,0x17b));var _0x4487=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4874[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0x4487('0x0'));var logger=require(_0x4487('0x1'))(_0x4487('0x2'));var moment=require(_0x4487('0x3'));var BPromise=require(_0x4487('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4487('0x5'));var rimraf=require(_0x4487('0x6'));var config=require('../../config/environment');var attributes=require(_0x4487('0x7'));module['exports']=function(_0x1111a2,_0x1ac5e5){return _0x1111a2['define'](_0x4487('0x8'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x4487('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 956d727..0525530 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 _0xa260=['message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','UpdateVoiceDialReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','code','error','VoiceDialReport,\x20%s,\x20%s'];(function(_0x8466a2,_0x45e187){var _0x1a36c9=function(_0x2f4395){while(--_0x2f4395){_0x8466a2['push'](_0x8466a2['shift']());}};_0x1a36c9(++_0x45e187);}(_0xa260,0xfc));var _0x0a26=function(_0x1d5a2c,_0x477a01){_0x1d5a2c=_0x1d5a2c-0x0;var _0x3c8443=_0xa260[_0x1d5a2c];return _0x3c8443;};'use strict';var _=require(_0x0a26('0x0'));var util=require(_0x0a26('0x1'));var moment=require(_0x0a26('0x2'));var BPromise=require(_0x0a26('0x3'));var rs=require(_0x0a26('0x4'));var fs=require('fs');var Redis=require(_0x0a26('0x5'));var db=require(_0x0a26('0x6'))['db'];var utils=require(_0x0a26('0x7'));var logger=require(_0x0a26('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f01ab,_0x3a719d,_0x2a1b7a){return new BPromise(function(_0x37df52,_0x13863f){return client['request'](_0x2f01ab,_0x2a1b7a)[_0x0a26('0x9')](function(_0x20c562){logger[_0x0a26('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x3a719d,_0x0a26('0xb'));logger[_0x0a26('0xc')](_0x0a26('0xd'),_0x3a719d,'request\x20sent',JSON[_0x0a26('0xe')](_0x20c562));if(_0x20c562['error']){if(_0x20c562['error'][_0x0a26('0xf')]===0x1f4){logger[_0x0a26('0x10')](_0x0a26('0x11'),_0x3a719d,_0x20c562[_0x0a26('0x10')][_0x0a26('0x12')]);return _0x13863f(_0x20c562[_0x0a26('0x10')][_0x0a26('0x12')]);}logger[_0x0a26('0x10')](_0x0a26('0x11'),_0x3a719d,_0x20c562[_0x0a26('0x10')]['message']);return _0x37df52(_0x20c562[_0x0a26('0x10')][_0x0a26('0x12')]);}else{logger['info'](_0x0a26('0x11'),_0x3a719d,'request\x20sent');_0x37df52(_0x20c562[_0x0a26('0x13')][_0x0a26('0x12')]);}})['catch'](function(_0x5096b1){logger['error'](_0x0a26('0x11'),_0x3a719d,_0x5096b1);_0x13863f(_0x5096b1);});});}exports[_0x0a26('0x14')]=function(_0x46818e){var _0x340300=this;return new Promise(function(_0x2de617,_0x472bda){return db[_0x0a26('0x15')][_0x0a26('0x16')](_0x46818e[_0x0a26('0x17')],{'raw':_0x46818e[_0x0a26('0x18')]?_0x46818e[_0x0a26('0x18')][_0x0a26('0x19')]===undefined?!![]:![]:!![]})[_0x0a26('0x9')](function(_0xed3f35){logger[_0x0a26('0xa')](_0x0a26('0x14'),_0x46818e);logger[_0x0a26('0xc')](_0x0a26('0x14'),_0x46818e,JSON[_0x0a26('0xe')](_0xed3f35));_0x2de617(_0xed3f35);})[_0x0a26('0x1a')](function(_0xeb0ca9){logger[_0x0a26('0x10')](_0x0a26('0x14'),_0xeb0ca9[_0x0a26('0x12')],_0x46818e);_0x472bda(_0x340300['error'](0x1f4,_0xeb0ca9[_0x0a26('0x12')]));});});};exports[_0x0a26('0x1b')]=function(_0x781634){var _0x4a459d=this;return new Promise(function(_0x5a099d,_0x2b7650){return db[_0x0a26('0x15')][_0x0a26('0x1c')](_0x781634[_0x0a26('0x17')],{'raw':_0x781634[_0x0a26('0x18')]?_0x781634['options'][_0x0a26('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x781634[_0x0a26('0x18')]?_0x781634['options'][_0x0a26('0x1d')]||null:null,'attributes':_0x781634[_0x0a26('0x18')]?_0x781634['options']['attributes']||null:null,'limit':_0x781634[_0x0a26('0x18')]?_0x781634['options']['limit']||null:null})['then'](function(_0x4f90fe){logger[_0x0a26('0xa')](_0x0a26('0x1b'),_0x781634);logger[_0x0a26('0xc')](_0x0a26('0x1b'),_0x781634,JSON[_0x0a26('0xe')](_0x4f90fe));_0x5a099d(_0x4f90fe);})[_0x0a26('0x1a')](function(_0x592791){logger['error'](_0x0a26('0x1b'),_0x592791[_0x0a26('0x12')],_0x781634);_0x2b7650(_0x4a459d[_0x0a26('0x10')](0x1f4,_0x592791[_0x0a26('0x12')]));});});}; \ No newline at end of file +var _0xa8e4=['where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport'];(function(_0x4e9c97,_0xb15ed4){var _0x3c90c8=function(_0x24244e){while(--_0x24244e){_0x4e9c97['push'](_0x4e9c97['shift']());}};_0x3c90c8(++_0xb15ed4);}(_0xa8e4,0xc9));var _0x4a8e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa8e4[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x4a8e('0x0'));var util=require(_0x4a8e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4a8e('0x2'));var fs=require('fs');var Redis=require(_0x4a8e('0x3'));var db=require(_0x4a8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a8e('0x5'));var config=require(_0x4a8e('0x6'));var jayson=require(_0x4a8e('0x7'));var client=jayson[_0x4a8e('0x8')][_0x4a8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26976c,_0x2a49a7,_0x4d112c){return new BPromise(function(_0x139976,_0x292489){return client[_0x4a8e('0xa')](_0x26976c,_0x4d112c)[_0x4a8e('0xb')](function(_0x21b2a3){logger[_0x4a8e('0xc')](_0x4a8e('0xd'),_0x2a49a7,_0x4a8e('0xe'));logger[_0x4a8e('0xf')](_0x4a8e('0x10'),_0x2a49a7,_0x4a8e('0xe'),JSON[_0x4a8e('0x11')](_0x21b2a3));if(_0x21b2a3[_0x4a8e('0x12')]){if(_0x21b2a3[_0x4a8e('0x12')][_0x4a8e('0x13')]===0x1f4){logger['error'](_0x4a8e('0xd'),_0x2a49a7,_0x21b2a3[_0x4a8e('0x12')]['message']);return _0x292489(_0x21b2a3[_0x4a8e('0x12')][_0x4a8e('0x14')]);}logger[_0x4a8e('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x2a49a7,_0x21b2a3['error'][_0x4a8e('0x14')]);return _0x139976(_0x21b2a3[_0x4a8e('0x12')]['message']);}else{logger[_0x4a8e('0xc')](_0x4a8e('0xd'),_0x2a49a7,_0x4a8e('0xe'));_0x139976(_0x21b2a3[_0x4a8e('0x15')][_0x4a8e('0x14')]);}})[_0x4a8e('0x16')](function(_0x5e0532){logger[_0x4a8e('0x12')](_0x4a8e('0xd'),_0x2a49a7,_0x5e0532);_0x292489(_0x5e0532);});});}exports[_0x4a8e('0x17')]=function(_0x4d4e8b){var _0x443293=this;return new Promise(function(_0x5f3bd6,_0x26b97c){return db[_0x4a8e('0x18')][_0x4a8e('0x19')](_0x4d4e8b[_0x4a8e('0x1a')],{'raw':_0x4d4e8b[_0x4a8e('0x1b')]?_0x4d4e8b[_0x4a8e('0x1b')][_0x4a8e('0x1c')]===undefined?!![]:![]:!![]})[_0x4a8e('0xb')](function(_0x156ac8){logger[_0x4a8e('0xc')](_0x4a8e('0x17'),_0x4d4e8b);logger[_0x4a8e('0xf')](_0x4a8e('0x17'),_0x4d4e8b,JSON[_0x4a8e('0x11')](_0x156ac8));_0x5f3bd6(_0x156ac8);})[_0x4a8e('0x16')](function(_0x22e981){logger[_0x4a8e('0x12')](_0x4a8e('0x17'),_0x22e981[_0x4a8e('0x14')],_0x4d4e8b);_0x26b97c(_0x443293[_0x4a8e('0x12')](0x1f4,_0x22e981[_0x4a8e('0x14')]));});});};exports[_0x4a8e('0x1d')]=function(_0xb2e8ca){var _0x27a999=this;return new Promise(function(_0x1aba9b,_0x20350a){return db['VoiceDialReport']['update'](_0xb2e8ca[_0x4a8e('0x1a')],{'raw':_0xb2e8ca['options']?_0xb2e8ca['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb2e8ca[_0x4a8e('0x1b')]?_0xb2e8ca['options'][_0x4a8e('0x1e')]||null:null,'attributes':_0xb2e8ca[_0x4a8e('0x1b')]?_0xb2e8ca[_0x4a8e('0x1b')][_0x4a8e('0x1f')]||null:null,'limit':_0xb2e8ca['options']?_0xb2e8ca[_0x4a8e('0x1b')][_0x4a8e('0x20')]||null:null})[_0x4a8e('0xb')](function(_0x5ba338){logger['info']('UpdateVoiceDialReport',_0xb2e8ca);logger[_0x4a8e('0xf')](_0x4a8e('0x1d'),_0xb2e8ca,JSON[_0x4a8e('0x11')](_0x5ba338));_0x1aba9b(_0x5ba338);})[_0x4a8e('0x16')](function(_0x2477d2){logger[_0x4a8e('0x12')]('UpdateVoiceDialReport',_0x2477d2[_0x4a8e('0x14')],_0xb2e8ca);_0x20350a(_0x27a999['error'](0x1f4,_0x2477d2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index d14b1ed..1ac1464 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 _0xce3d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','addApplications','put','update','exports','multer','util','connect-timeout','express','Router'];(function(_0x262957,_0x34c699){var _0x27e221=function(_0x49e5cf){while(--_0x49e5cf){_0x262957['push'](_0x262957['shift']());}};_0x27e221(++_0x34c699);}(_0xce3d,0xc3));var _0xdce3=function(_0x4f939a,_0x5232ee){_0x4f939a=_0x4f939a-0x0;var _0xb1d4eb=_0xce3d[_0x4f939a];return _0xb1d4eb;};'use strict';var multer=require(_0xdce3('0x0'));var util=require(_0xdce3('0x1'));var path=require('path');var timeout=require(_0xdce3('0x2'));var express=require(_0xdce3('0x3'));var router=express[_0xdce3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdce3('0x5'));var interaction=require(_0xdce3('0x6'));var config=require(_0xdce3('0x7'));var controller=require(_0xdce3('0x8'));router[_0xdce3('0x9')]('/',auth[_0xdce3('0xa')](),controller[_0xdce3('0xb')]);router[_0xdce3('0x9')](_0xdce3('0xc'),auth[_0xdce3('0xa')](),controller[_0xdce3('0xd')]);router[_0xdce3('0xe')]('/',auth[_0xdce3('0xa')](),controller[_0xdce3('0xf')]);router[_0xdce3('0xe')]('/:id/applications',auth['isAuthenticated'](),controller[_0xdce3('0x10')]);router[_0xdce3('0x11')]('/:id',auth[_0xdce3('0xa')](),controller[_0xdce3('0x12')]);router['delete'](_0xdce3('0xc'),auth[_0xdce3('0xa')](),controller['destroy']);module[_0xdce3('0x13')]=router; \ No newline at end of file +var _0x375a=['connect-timeout','express','../../components/auth/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','create','post','/:id/applications','addApplications','put','update','destroy','util','path'];(function(_0x3b1c52,_0x3f10fd){var _0x1ad2de=function(_0x63b6c5){while(--_0x63b6c5){_0x3b1c52['push'](_0x3b1c52['shift']());}};_0x1ad2de(++_0x3f10fd);}(_0x375a,0x12e));var _0xa375=function(_0x1d8b28,_0x2f348a){_0x1d8b28=_0x1d8b28-0x0;var _0xdc0cb8=_0x375a[_0x1d8b28];return _0xdc0cb8;};'use strict';var multer=require('multer');var util=require(_0xa375('0x0'));var path=require(_0xa375('0x1'));var timeout=require(_0xa375('0x2'));var express=require(_0xa375('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa375('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa375('0x5'));var controller=require(_0xa375('0x6'));router['get']('/',auth[_0xa375('0x7')](),controller[_0xa375('0x8')]);router[_0xa375('0x9')](_0xa375('0xa'),auth['isAuthenticated'](),controller[_0xa375('0xb')]);router['post']('/',auth[_0xa375('0x7')](),controller[_0xa375('0xc')]);router[_0xa375('0xd')](_0xa375('0xe'),auth[_0xa375('0x7')](),controller[_0xa375('0xf')]);router[_0xa375('0x10')]('/:id',auth[_0xa375('0x7')](),controller[_0xa375('0x11')]);router['delete'](_0xa375('0xa'),auth[_0xa375('0x7')](),controller[_0xa375('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 34522bc..c5edc26 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 _0xfe41=['VIRTUAL','exten','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x279fc8,_0x1ba427){var _0x4521a5=function(_0xbd2f4c){while(--_0xbd2f4c){_0x279fc8['push'](_0x279fc8['shift']());}};_0x4521a5(++_0x1ba427);}(_0xfe41,0x1ef));var _0x1fe4=function(_0x1c3ec5,_0x2969d3){_0x1c3ec5=_0x1c3ec5-0x0;var _0x51b9f0=_0xfe41[_0x1c3ec5];return _0x51b9f0;};'use strict';var Sequelize=require('sequelize');module[_0x1fe4('0x0')]={'context':{'type':Sequelize[_0x1fe4('0x1')],'allowNull':![],'unique':_0x1fe4('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1fe4('0x1')],'allowNull':![],'unique':_0x1fe4('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x1fe4('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x1fe4('0x3')](_0x1fe4('0x4'),_0x1fe4('0x5'),_0x1fe4('0x6'),_0x1fe4('0x7'),_0x1fe4('0x8'),_0x1fe4('0x9'),_0x1fe4('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x1fe4('0x1')]},'interval':{'type':Sequelize[_0x1fe4('0x1')],'allowNull':![],'defaultValue':_0x1fe4('0xb')},'IntervalId':{'type':Sequelize[_0x1fe4('0xc')]},'isApp':{'type':Sequelize[_0x1fe4('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1fe4('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1fe4('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x1fe4('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1fe4('0xc')]},'recordingFormat':{'type':Sequelize[_0x1fe4('0x1')],'defaultValue':_0x1fe4('0xe')},'answer':{'type':Sequelize[_0x1fe4('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x1fe4('0xf')],'get':function(_0x29f2a4){return this['getDataValue'](_0x1fe4('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x9ac0=['*,*,*,*','wav','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','any'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x9ac0,0x7c));var _0x09ac=function(_0xb36341,_0x4d70a4){_0xb36341=_0xb36341-0x0;var _0xe31d87=_0x9ac0[_0xb36341];return _0xe31d87;};'use strict';var Sequelize=require(_0x09ac('0x0'));module[_0x09ac('0x1')]={'context':{'type':Sequelize[_0x09ac('0x2')],'allowNull':![],'unique':_0x09ac('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x09ac('0x2')],'allowNull':![],'unique':_0x09ac('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x09ac('0x3')},'tag':{'type':Sequelize[_0x09ac('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x09ac('0x2')],'allowNull':![],'defaultValue':_0x09ac('0x4')},'appdata':{'type':Sequelize[_0x09ac('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x09ac('0x5')](_0x09ac('0x6'),_0x09ac('0x7'),_0x09ac('0x8'),'inbound-fax',_0x09ac('0x9'),'system',_0x09ac('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x09ac('0x2')]},'interval':{'type':Sequelize[_0x09ac('0x2')],'allowNull':![],'defaultValue':_0x09ac('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x09ac('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x09ac('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x09ac('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b7d21){return this[_0x09ac('0xd')](_0x09ac('0xe'));}},'alias':{'type':Sequelize[_0x09ac('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 7e1c6c3..73a9b83 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 _0x5443=['include','findAll','rows','show','params','keys','find','catch','create','body','outbound','startsWith','exten','concat','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','api','../../config/environment','defaults','redis','./voiceExtension.socket','register','sendStatus','end','status','offset','limit','count','set','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','value','includes','type','name','UserProfileResource','error','send','index','map','VoiceExtension','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x5443,0x84));var _0x3544=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5443[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var Redis=require(_0x3544('0x0'));var qs=require(_0x3544('0x1'));var logger=require('../../config/logger')(_0x3544('0x2'));var config=require(_0x3544('0x3'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3544('0x4')](config[_0x3544('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3544('0x5')]));require(_0x3544('0x6'))[_0x3544('0x7')](socket);function respondWithStatusCode(_0xd8022a,_0x10a4e1){_0x10a4e1=_0x10a4e1||0xcc;return function(_0x5be335){if(_0x5be335){return _0xd8022a[_0x3544('0x8')](_0x10a4e1);}return _0xd8022a['status'](_0x10a4e1)[_0x3544('0x9')]();};}function respondWithResult(_0x4e4c17,_0x4cb326){_0x4cb326=_0x4cb326||0xc8;return function(_0x4986c5){if(_0x4986c5){return _0x4e4c17[_0x3544('0xa')](_0x4cb326)['json'](_0x4986c5);}};}function respondWithFilteredResult(_0x15f864,_0x2f7d26){return function(_0x1eb0f7){if(_0x1eb0f7){var _0x1e9424=typeof _0x2f7d26[_0x3544('0xb')]==='undefined'&&typeof _0x2f7d26[_0x3544('0xc')]==='undefined';var _0x5054a1=_0x1eb0f7[_0x3544('0xd')];var _0x4b7f9a=_0x1e9424?0x0:_0x2f7d26[_0x3544('0xb')];var _0x4b32c4=_0x1e9424?_0x1eb0f7[_0x3544('0xd')]:_0x2f7d26[_0x3544('0xb')]+_0x2f7d26[_0x3544('0xc')];var _0x317d91;if(_0x4b32c4>=_0x5054a1){_0x4b32c4=_0x5054a1;_0x317d91=0xc8;}else{_0x317d91=0xce;}_0x15f864[_0x3544('0xa')](_0x317d91);return _0x15f864[_0x3544('0xe')]('Content-Range',_0x4b7f9a+'-'+_0x4b32c4+'/'+_0x5054a1)[_0x3544('0xf')](_0x1eb0f7);}return null;};}function removeEntity(_0x14cd72){return function(_0x42351e){if(_0x42351e){return _0x42351e[_0x3544('0x10')]()[_0x3544('0x11')](function(){var _0x41d206=_0x42351e[_0x3544('0x12')]({'plain':!![]});var _0x421926=[{'name':_0x3544('0x13'),'value':_0x3544('0x14'),'ignore':![]},{'name':_0x3544('0x15'),'value':'outbound','ignore':![]},{'name':_0x3544('0x16'),'value':_0x3544('0x17'),'ignore':![]}];var _0x10a9a0=_(_0x421926)[_0x3544('0x18')](_0x3544('0x19'))['map'](_0x3544('0x1a'))[_0x3544('0x1a')]();if(_[_0x3544('0x1b')](_0x10a9a0,_0x41d206[_0x3544('0x1c')])){return;}var _0x17298d=_['find'](_0x421926,[_0x3544('0x1a'),_0x41d206['type']])[_0x3544('0x1d')];return db[_0x3544('0x1e')][_0x3544('0x10')]({'where':{'type':_0x17298d,'resourceId':_0x41d206['id']}})['then'](function(){return _0x42351e;});})[_0x3544('0x11')](function(){_0x14cd72[_0x3544('0xa')](0xcc)[_0x3544('0x9')]();});}};}function handleEntityNotFound(_0x96ece2){return function(_0x14b4e0){if(!_0x14b4e0){_0x96ece2[_0x3544('0x8')](0x194);}return _0x14b4e0;};}function handleError(_0x1799f2,_0x497b53){_0x497b53=_0x497b53||0x1f4;return function(_0x598c4f){logger[_0x3544('0x1f')](_0x598c4f['stack']);if(_0x598c4f['name']){delete _0x598c4f[_0x3544('0x1d')];}_0x1799f2['status'](_0x497b53)[_0x3544('0x20')](_0x598c4f);};}exports[_0x3544('0x21')]=function(_0x21a6f3,_0x585d31){var _0x464f4b={},_0x28dffd={},_0x2959ba={'count':0x0,'rows':[]};var _0x137105=_[_0x3544('0x22')](db[_0x3544('0x23')][_0x3544('0x24')],function(_0x4611d8){return{'name':_0x4611d8[_0x3544('0x25')],'type':_0x4611d8[_0x3544('0x1c')][_0x3544('0x26')]};});_0x28dffd['model']=_['map'](_0x137105,_0x3544('0x1d'));_0x28dffd['query']=_['keys'](_0x21a6f3[_0x3544('0x27')]);_0x28dffd[_0x3544('0x28')]=_[_0x3544('0x29')](_0x28dffd[_0x3544('0x2a')],_0x28dffd[_0x3544('0x27')]);_0x464f4b[_0x3544('0x2b')]=_[_0x3544('0x29')](_0x28dffd[_0x3544('0x2a')],qs[_0x3544('0x2c')](_0x21a6f3['query'][_0x3544('0x2c')]));_0x464f4b[_0x3544('0x2b')]=_0x464f4b['attributes'][_0x3544('0x2d')]?_0x464f4b[_0x3544('0x2b')]:_0x28dffd[_0x3544('0x2a')];if(!_0x21a6f3['query'][_0x3544('0x2e')](_0x3544('0x2f'))){_0x464f4b['limit']=qs['limit'](_0x21a6f3['query'][_0x3544('0xc')]);_0x464f4b[_0x3544('0xb')]=qs['offset'](_0x21a6f3[_0x3544('0x27')][_0x3544('0xb')]);}_0x464f4b[_0x3544('0x30')]=qs[_0x3544('0x31')](_0x21a6f3['query']['sort']);_0x464f4b[_0x3544('0x32')]=qs[_0x3544('0x28')](_[_0x3544('0x33')](_0x21a6f3[_0x3544('0x27')],_0x28dffd[_0x3544('0x28')]),_0x137105);if(_0x21a6f3[_0x3544('0x27')][_0x3544('0x18')]){_0x464f4b[_0x3544('0x32')]=_[_0x3544('0x34')](_0x464f4b[_0x3544('0x32')],{'$or':_['map'](_0x137105,function(_0x180c1a){if(_0x180c1a[_0x3544('0x1c')]!==_0x3544('0x35')){var _0x3acadd={};_0x3acadd[_0x180c1a[_0x3544('0x1d')]]={'$like':'%'+_0x21a6f3[_0x3544('0x27')]['filter']+'%'};return _0x3acadd;}})});}_0x464f4b=_[_0x3544('0x34')]({},_0x464f4b,_0x21a6f3[_0x3544('0x36')]);var _0x1c8969={'where':_0x464f4b[_0x3544('0x32')]};return db[_0x3544('0x23')][_0x3544('0xd')](_0x1c8969)['then'](function(_0xcf194a){_0x2959ba[_0x3544('0xd')]=_0xcf194a;if(_0x21a6f3[_0x3544('0x27')][_0x3544('0x37')]){_0x464f4b[_0x3544('0x38')]=[{'all':!![]}];}return db[_0x3544('0x23')][_0x3544('0x39')](_0x464f4b);})['then'](function(_0x29048a){_0x2959ba[_0x3544('0x3a')]=_0x29048a;return _0x2959ba;})[_0x3544('0x11')](respondWithFilteredResult(_0x585d31,_0x464f4b))['catch'](handleError(_0x585d31,null));};exports[_0x3544('0x3b')]=function(_0x36af85,_0x3cc748){var _0x10e0ba={'raw':![],'where':{'id':_0x36af85[_0x3544('0x3c')]['id']}},_0x53cb0c={};_0x53cb0c['model']=_[_0x3544('0x3d')](db['VoiceExtension']['rawAttributes']);_0x53cb0c[_0x3544('0x27')]=_[_0x3544('0x3d')](_0x36af85['query']);_0x53cb0c['filters']=_['intersection'](_0x53cb0c[_0x3544('0x2a')],_0x53cb0c[_0x3544('0x27')]);_0x10e0ba[_0x3544('0x2b')]=_[_0x3544('0x29')](_0x53cb0c[_0x3544('0x2a')],qs[_0x3544('0x2c')](_0x36af85[_0x3544('0x27')][_0x3544('0x2c')]));_0x10e0ba[_0x3544('0x2b')]=_0x10e0ba[_0x3544('0x2b')]['length']?_0x10e0ba[_0x3544('0x2b')]:_0x53cb0c[_0x3544('0x2a')];if(_0x36af85['query']['includeAll']){_0x10e0ba['include']=[{'all':!![]}];}_0x10e0ba=_['merge']({},_0x10e0ba,_0x36af85[_0x3544('0x36')]);return db[_0x3544('0x23')][_0x3544('0x3e')](_0x10e0ba)[_0x3544('0x11')](handleEntityNotFound(_0x3cc748,null))['then'](respondWithResult(_0x3cc748,null))['catch'](handleError(_0x3cc748,null));};exports['destroy']=function(_0x5b5a2f,_0xcb3f39){return db[_0x3544('0x23')][_0x3544('0x3e')]({'where':{'id':_0x5b5a2f[_0x3544('0x3c')]['id']}})[_0x3544('0x11')](handleEntityNotFound(_0xcb3f39,null))['then'](removeEntity(_0xcb3f39,null))[_0x3544('0x3f')](handleError(_0xcb3f39,null));};exports[_0x3544('0x40')]=function(_0xa4da31,_0x4bf2b6){if(_0xa4da31[_0x3544('0x41')][_0x3544('0x1c')]===_0x3544('0x42')&&!_[_0x3544('0x43')](_0xa4da31[_0x3544('0x41')][_0x3544('0x44')],'_')){_0xa4da31['body'][_0x3544('0x44')]='_'[_0x3544('0x45')](_0xa4da31[_0x3544('0x41')]['exten']);}return db['VoiceExtension'][_0x3544('0x40')](_0xa4da31['body'],{'raw':![]})[_0x3544('0x11')](function(_0x41c36c){var _0x3f24be=_0xa4da31[_0x3544('0x46')][_0x3544('0x12')]({'plain':!![]});if(!_0x3f24be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f24be[_0x3544('0x47')]===_0x3544('0x46')){var _0x2d9b6b=_0x41c36c[_0x3544('0x12')]({'plain':!![]});var _0x5e616b=[{'name':_0x3544('0x13'),'value':_0x3544('0x14')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x3544('0x16'),'value':_0x3544('0x17')}];var _0x30408b=_[_0x3544('0x3e')](_0x5e616b,['value',_0x2d9b6b[_0x3544('0x1c')]])[_0x3544('0x1d')];return db['UserProfileSection'][_0x3544('0x3e')]({'where':{'name':_0x30408b,'userProfileId':_0x3f24be[_0x3544('0x48')]},'raw':!![]})[_0x3544('0x11')](function(_0x202f60){if(_0x202f60&&_0x202f60[_0x3544('0x49')]===0x0){return db[_0x3544('0x1e')]['create']({'name':_0x2d9b6b[_0x3544('0x1d')],'resourceId':_0x2d9b6b['id'],'type':_0x202f60['name'],'sectionId':_0x202f60['id']},{})[_0x3544('0x11')](function(){return _0x41c36c;});}else{return _0x41c36c;}})[_0x3544('0x3f')](function(_0x1472f6){logger['error'](_0x3544('0x4a'),_0x1472f6);throw _0x1472f6;});}return _0x41c36c;})[_0x3544('0x11')](respondWithResult(_0x4bf2b6,0xc9))['catch'](handleError(_0x4bf2b6,null));};exports[_0x3544('0x4b')]=function(_0x3d573c,_0x25c41e){if(_0x3d573c['body']['id']){delete _0x3d573c[_0x3544('0x41')]['id'];}return db[_0x3544('0x23')]['find']({'where':{'id':_0x3d573c['params']['id']}})[_0x3544('0x11')](handleEntityNotFound(_0x25c41e,null))[_0x3544('0x11')](function(_0x4c139b){if(_0x4c139b){return db[_0x3544('0x23')][_0x3544('0x4b')](_[_0x3544('0x33')](_0x3d573c['body'],[_0x3544('0x44'),_0x3544('0x4c'),_0x3544('0x4d'),_0x3544('0x4e'),_0x3544('0x4f'),_0x3544('0x50'),_0x3544('0x51')]),{'where':{'context':_0x4c139b[_0x3544('0x4c')],'exten':_0x4c139b[_0x3544('0x44')]},'individualHooks':!![]})[_0x3544('0x11')](function(_0xe7247e){return _0xe7247e;});}return null;})[_0x3544('0x11')](respondWithStatusCode(_0x25c41e,null))[_0x3544('0x3f')](handleError(_0x25c41e,null));};exports[_0x3544('0x52')]=function(_0x2c72b3,_0x1b6f61){var _0x160955=_0x2c72b3[_0x3544('0x3c')]['id'];var _0x34b7e5=_0x2c72b3[_0x3544('0x41')];var _0x2a8210=0xc8;var _0x3d4b41=null;return db['sequelize'][_0x3544('0x53')]({'isolationLevel':db[_0x3544('0x54')]['Transaction'][_0x3544('0x55')][_0x3544('0x56')]},function(_0x185531){return db[_0x3544('0x23')][_0x3544('0x57')]({'where':{'id':_0x160955},'transaction':_0x185531})['then'](function(_0x41b7b4){if(_0x41b7b4){return db[_0x3544('0x23')][_0x3544('0x10')]({'where':{'VoiceExtensionId':_0x160955},'transaction':_0x185531})[_0x3544('0x11')](function(){var _0x3e90b7=_[_0x3544('0x22')](_0x34b7e5,function(_0x3d659c){_0x3d659c[_0x3544('0x58')]=_0x160955;_0x3d659c[_0x3544('0x59')]=!![];return _0x3d659c;});return _0x41b7b4[_0x3544('0x5a')](_0x3e90b7);})[_0x3544('0x11')](function(_0x9bca93){return db['VoiceExtension']['bulkCreate'](_0x9bca93,{'transaction':_0x185531});});}else{_0x2a8210=0x194;_0x3d4b41=[];}});})['then'](function(){if(_0x2a8210!==0x194){return db['VoiceExtension'][_0x3544('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x160955},'order':_0x3544('0x5c')})[_0x3544('0x11')](function(_0x464e7c){_0x3d4b41=_0x464e7c;});}})[_0x3544('0x3f')](function(_0x3377f4){_0x2a8210=0x1f4;logger['error'](_0x3377f4['stack']);if(_0x3377f4[_0x3544('0x1d')]){delete _0x3377f4[_0x3544('0x1d')];}_0x3d4b41=_0x3377f4;})[_0x3544('0x5d')](function(){if(_0x3d4b41===null){_0x1b6f61['sendStatus'](_0x2a8210);}else{if(_0x2a8210===0x1f4){_0x1b6f61[_0x3544('0xa')](_0x2a8210)[_0x3544('0x20')](_0x3d4b41);}else{_0x1b6f61['status'](_0x2a8210)[_0x3544('0xf')](_0x3d4b41);}}});}; \ No newline at end of file +var _0x8b76=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','then','InboundRoutes','inbound','InternalRoutes','internal','filter','ignore','value','includes','type','find','destroy','error','name','send','index','map','VoiceExtension','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','includeAll','include','findAll','rows','params','rawAttributes','catch','create','body','startsWith','exten'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0x8b76,0x76));var _0x68b7=function(_0x3244df,_0x5b633e){_0x3244df=_0x3244df-0x0;var _0x11a268=_0x8b76[_0x3244df];return _0x11a268;};'use strict';var _=require(_0x68b7('0x0'));var Redis=require(_0x68b7('0x1'));var qs=require(_0x68b7('0x2'));var logger=require('../../config/logger')(_0x68b7('0x3'));var config=require(_0x68b7('0x4'));var db=require(_0x68b7('0x5'))['db'];config[_0x68b7('0x6')]=_['defaults'](config['redis'],{'host':_0x68b7('0x7'),'port':0x18eb});var socket=require(_0x68b7('0x8'))(new Redis(config[_0x68b7('0x6')]));require(_0x68b7('0x9'))[_0x68b7('0xa')](socket);function respondWithStatusCode(_0x40d6bf,_0x32da2f){_0x32da2f=_0x32da2f||0xcc;return function(_0xf41a46){if(_0xf41a46){return _0x40d6bf[_0x68b7('0xb')](_0x32da2f);}return _0x40d6bf[_0x68b7('0xc')](_0x32da2f)[_0x68b7('0xd')]();};}function respondWithResult(_0x21525b,_0xf80f6a){_0xf80f6a=_0xf80f6a||0xc8;return function(_0x58285b){if(_0x58285b){return _0x21525b[_0x68b7('0xc')](_0xf80f6a)[_0x68b7('0xe')](_0x58285b);}};}function respondWithFilteredResult(_0x130b57,_0x583de5){return function(_0x5143f2){if(_0x5143f2){var _0x580cf0=typeof _0x583de5[_0x68b7('0xf')]===_0x68b7('0x10')&&typeof _0x583de5[_0x68b7('0x11')]===_0x68b7('0x10');var _0x40f01a=_0x5143f2[_0x68b7('0x12')];var _0x145218=_0x580cf0?0x0:_0x583de5[_0x68b7('0xf')];var _0x746a5c=_0x580cf0?_0x5143f2[_0x68b7('0x12')]:_0x583de5[_0x68b7('0xf')]+_0x583de5[_0x68b7('0x11')];var _0x200a3c;if(_0x746a5c>=_0x40f01a){_0x746a5c=_0x40f01a;_0x200a3c=0xc8;}else{_0x200a3c=0xce;}_0x130b57[_0x68b7('0xc')](_0x200a3c);return _0x130b57[_0x68b7('0x13')]('Content-Range',_0x145218+'-'+_0x746a5c+'/'+_0x40f01a)[_0x68b7('0xe')](_0x5143f2);}return null;};}function removeEntity(_0x11fd73){return function(_0xed1ade){if(_0xed1ade){return _0xed1ade['destroy']()[_0x68b7('0x14')](function(){var _0x32b698=_0xed1ade['get']({'plain':!![]});var _0x4e1998=[{'name':_0x68b7('0x15'),'value':_0x68b7('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x68b7('0x17'),'value':_0x68b7('0x18'),'ignore':![]}];var _0x512502=_(_0x4e1998)[_0x68b7('0x19')](_0x68b7('0x1a'))['map'](_0x68b7('0x1b'))[_0x68b7('0x1b')]();if(_[_0x68b7('0x1c')](_0x512502,_0x32b698[_0x68b7('0x1d')])){return;}var _0x127440=_[_0x68b7('0x1e')](_0x4e1998,['value',_0x32b698[_0x68b7('0x1d')]])['name'];return db['UserProfileResource'][_0x68b7('0x1f')]({'where':{'type':_0x127440,'resourceId':_0x32b698['id']}})[_0x68b7('0x14')](function(){return _0xed1ade;});})[_0x68b7('0x14')](function(){_0x11fd73[_0x68b7('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59f7ab){return function(_0x28e19a){if(!_0x28e19a){_0x59f7ab[_0x68b7('0xb')](0x194);}return _0x28e19a;};}function handleError(_0x55d1a7,_0x32834a){_0x32834a=_0x32834a||0x1f4;return function(_0x483410){logger[_0x68b7('0x20')](_0x483410['stack']);if(_0x483410[_0x68b7('0x21')]){delete _0x483410[_0x68b7('0x21')];}_0x55d1a7['status'](_0x32834a)[_0x68b7('0x22')](_0x483410);};}exports[_0x68b7('0x23')]=function(_0x4f0df4,_0x42a100){var _0x1e1e9d={},_0x48bfcb={},_0x4701d0={'count':0x0,'rows':[]};var _0x4ff610=_[_0x68b7('0x24')](db[_0x68b7('0x25')]['rawAttributes'],function(_0x4ba13d){return{'name':_0x4ba13d[_0x68b7('0x26')],'type':_0x4ba13d[_0x68b7('0x1d')][_0x68b7('0x27')]};});_0x48bfcb[_0x68b7('0x28')]=_[_0x68b7('0x24')](_0x4ff610,_0x68b7('0x21'));_0x48bfcb[_0x68b7('0x29')]=_[_0x68b7('0x2a')](_0x4f0df4[_0x68b7('0x29')]);_0x48bfcb['filters']=_[_0x68b7('0x2b')](_0x48bfcb[_0x68b7('0x28')],_0x48bfcb[_0x68b7('0x29')]);_0x1e1e9d[_0x68b7('0x2c')]=_[_0x68b7('0x2b')](_0x48bfcb[_0x68b7('0x28')],qs[_0x68b7('0x2d')](_0x4f0df4[_0x68b7('0x29')][_0x68b7('0x2d')]));_0x1e1e9d[_0x68b7('0x2c')]=_0x1e1e9d['attributes'][_0x68b7('0x2e')]?_0x1e1e9d['attributes']:_0x48bfcb[_0x68b7('0x28')];if(!_0x4f0df4[_0x68b7('0x29')][_0x68b7('0x2f')](_0x68b7('0x30'))){_0x1e1e9d[_0x68b7('0x11')]=qs[_0x68b7('0x11')](_0x4f0df4[_0x68b7('0x29')]['limit']);_0x1e1e9d[_0x68b7('0xf')]=qs[_0x68b7('0xf')](_0x4f0df4[_0x68b7('0x29')][_0x68b7('0xf')]);}_0x1e1e9d[_0x68b7('0x31')]=qs[_0x68b7('0x32')](_0x4f0df4['query'][_0x68b7('0x32')]);_0x1e1e9d[_0x68b7('0x33')]=qs[_0x68b7('0x34')](_['pick'](_0x4f0df4[_0x68b7('0x29')],_0x48bfcb[_0x68b7('0x34')]),_0x4ff610);if(_0x4f0df4['query']['filter']){_0x1e1e9d['where']=_[_0x68b7('0x35')](_0x1e1e9d[_0x68b7('0x33')],{'$or':_['map'](_0x4ff610,function(_0xc0db15){if(_0xc0db15[_0x68b7('0x1d')]!=='VIRTUAL'){var _0x5994c5={};_0x5994c5[_0xc0db15[_0x68b7('0x21')]]={'$like':'%'+_0x4f0df4['query']['filter']+'%'};return _0x5994c5;}})});}_0x1e1e9d=_[_0x68b7('0x35')]({},_0x1e1e9d,_0x4f0df4[_0x68b7('0x36')]);var _0x49db80={'where':_0x1e1e9d[_0x68b7('0x33')]};return db['VoiceExtension'][_0x68b7('0x12')](_0x49db80)[_0x68b7('0x14')](function(_0x42294d){_0x4701d0[_0x68b7('0x12')]=_0x42294d;if(_0x4f0df4[_0x68b7('0x29')][_0x68b7('0x37')]){_0x1e1e9d[_0x68b7('0x38')]=[{'all':!![]}];}return db[_0x68b7('0x25')][_0x68b7('0x39')](_0x1e1e9d);})[_0x68b7('0x14')](function(_0x3d285b){_0x4701d0[_0x68b7('0x3a')]=_0x3d285b;return _0x4701d0;})[_0x68b7('0x14')](respondWithFilteredResult(_0x42a100,_0x1e1e9d))['catch'](handleError(_0x42a100,null));};exports['show']=function(_0x2309d1,_0x32d06f){var _0x281b71={'raw':![],'where':{'id':_0x2309d1[_0x68b7('0x3b')]['id']}},_0x226ff5={};_0x226ff5[_0x68b7('0x28')]=_[_0x68b7('0x2a')](db['VoiceExtension'][_0x68b7('0x3c')]);_0x226ff5[_0x68b7('0x29')]=_[_0x68b7('0x2a')](_0x2309d1[_0x68b7('0x29')]);_0x226ff5[_0x68b7('0x34')]=_[_0x68b7('0x2b')](_0x226ff5[_0x68b7('0x28')],_0x226ff5['query']);_0x281b71['attributes']=_[_0x68b7('0x2b')](_0x226ff5[_0x68b7('0x28')],qs['fields'](_0x2309d1[_0x68b7('0x29')][_0x68b7('0x2d')]));_0x281b71[_0x68b7('0x2c')]=_0x281b71[_0x68b7('0x2c')][_0x68b7('0x2e')]?_0x281b71['attributes']:_0x226ff5[_0x68b7('0x28')];if(_0x2309d1[_0x68b7('0x29')][_0x68b7('0x37')]){_0x281b71['include']=[{'all':!![]}];}_0x281b71=_['merge']({},_0x281b71,_0x2309d1[_0x68b7('0x36')]);return db[_0x68b7('0x25')]['find'](_0x281b71)[_0x68b7('0x14')](handleEntityNotFound(_0x32d06f,null))['then'](respondWithResult(_0x32d06f,null))[_0x68b7('0x3d')](handleError(_0x32d06f,null));};exports[_0x68b7('0x1f')]=function(_0x50b96d,_0x4d72b8){return db[_0x68b7('0x25')]['find']({'where':{'id':_0x50b96d['params']['id']}})[_0x68b7('0x14')](handleEntityNotFound(_0x4d72b8,null))['then'](removeEntity(_0x4d72b8,null))[_0x68b7('0x3d')](handleError(_0x4d72b8,null));};exports[_0x68b7('0x3e')]=function(_0x34eaac,_0x299d25){if(_0x34eaac[_0x68b7('0x3f')]['type']==='outbound'&&!_[_0x68b7('0x40')](_0x34eaac[_0x68b7('0x3f')][_0x68b7('0x41')],'_')){_0x34eaac[_0x68b7('0x3f')][_0x68b7('0x41')]='_'['concat'](_0x34eaac['body'][_0x68b7('0x41')]);}return db['VoiceExtension'][_0x68b7('0x3e')](_0x34eaac['body'],{'raw':![]})[_0x68b7('0x14')](function(_0x28085b){var _0x3242ba=_0x34eaac[_0x68b7('0x42')][_0x68b7('0x43')]({'plain':!![]});if(!_0x3242ba)throw new Error(_0x68b7('0x44'));if(_0x3242ba[_0x68b7('0x45')]===_0x68b7('0x42')){var _0x41842d=_0x28085b[_0x68b7('0x43')]({'plain':!![]});var _0x213317=[{'name':_0x68b7('0x15'),'value':'inbound'},{'name':_0x68b7('0x46'),'value':'outbound'},{'name':'InternalRoutes','value':_0x68b7('0x18')}];var _0x5938b9=_[_0x68b7('0x1e')](_0x213317,['value',_0x41842d[_0x68b7('0x1d')]])[_0x68b7('0x21')];return db[_0x68b7('0x47')][_0x68b7('0x1e')]({'where':{'name':_0x5938b9,'userProfileId':_0x3242ba[_0x68b7('0x48')]},'raw':!![]})[_0x68b7('0x14')](function(_0x2f162f){if(_0x2f162f&&_0x2f162f[_0x68b7('0x49')]===0x0){return db['UserProfileResource'][_0x68b7('0x3e')]({'name':_0x41842d[_0x68b7('0x21')],'resourceId':_0x41842d['id'],'type':_0x2f162f[_0x68b7('0x21')],'sectionId':_0x2f162f['id']},{})[_0x68b7('0x14')](function(){return _0x28085b;});}else{return _0x28085b;}})[_0x68b7('0x3d')](function(_0x5cc986){logger[_0x68b7('0x20')](_0x68b7('0x4a'),_0x5cc986);throw _0x5cc986;});}return _0x28085b;})[_0x68b7('0x14')](respondWithResult(_0x299d25,0xc9))[_0x68b7('0x3d')](handleError(_0x299d25,null));};exports['update']=function(_0x246ae8,_0x132abf){if(_0x246ae8[_0x68b7('0x3f')]['id']){delete _0x246ae8[_0x68b7('0x3f')]['id'];}return db[_0x68b7('0x25')][_0x68b7('0x1e')]({'where':{'id':_0x246ae8[_0x68b7('0x3b')]['id']}})[_0x68b7('0x14')](handleEntityNotFound(_0x132abf,null))['then'](function(_0x3dfb5a){if(_0x3dfb5a){return db[_0x68b7('0x25')][_0x68b7('0x4b')](_['pick'](_0x246ae8[_0x68b7('0x3f')],['exten',_0x68b7('0x4c'),_0x68b7('0x4d'),_0x68b7('0x4e'),'cutdigits',_0x68b7('0x4f'),_0x68b7('0x50')]),{'where':{'context':_0x3dfb5a['context'],'exten':_0x3dfb5a['exten']},'individualHooks':!![]})[_0x68b7('0x14')](function(_0xb8ba81){return _0xb8ba81;});}return null;})[_0x68b7('0x14')](respondWithStatusCode(_0x132abf,null))[_0x68b7('0x3d')](handleError(_0x132abf,null));};exports[_0x68b7('0x51')]=function(_0x113bbd,_0x1a8d6a){var _0x4737e7=_0x113bbd[_0x68b7('0x3b')]['id'];var _0x55d3e7=_0x113bbd['body'];var _0x2ceebc=0xc8;var _0x1b1916=null;return db[_0x68b7('0x52')]['transaction']({'isolationLevel':db['sequelize'][_0x68b7('0x53')][_0x68b7('0x54')]['READ_COMMITTED']},function(_0x23d142){return db[_0x68b7('0x25')][_0x68b7('0x55')]({'where':{'id':_0x4737e7},'transaction':_0x23d142})['then'](function(_0x13600b){if(_0x13600b){return db[_0x68b7('0x25')]['destroy']({'where':{'VoiceExtensionId':_0x4737e7},'transaction':_0x23d142})['then'](function(){var _0x2c2b86=_[_0x68b7('0x24')](_0x55d3e7,function(_0x252762){_0x252762[_0x68b7('0x56')]=_0x4737e7;_0x252762[_0x68b7('0x57')]=!![];return _0x252762;});return _0x13600b['createRouting'](_0x2c2b86);})[_0x68b7('0x14')](function(_0xccf8df){return db[_0x68b7('0x25')][_0x68b7('0x58')](_0xccf8df,{'transaction':_0x23d142});});}else{_0x2ceebc=0x194;_0x1b1916=[];}});})[_0x68b7('0x14')](function(){if(_0x2ceebc!==0x194){return db['VoiceExtension'][_0x68b7('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4737e7},'order':_0x68b7('0x5a')})[_0x68b7('0x14')](function(_0x119b53){_0x1b1916=_0x119b53;});}})[_0x68b7('0x3d')](function(_0x380325){_0x2ceebc=0x1f4;logger[_0x68b7('0x20')](_0x380325[_0x68b7('0x5b')]);if(_0x380325[_0x68b7('0x21')]){delete _0x380325[_0x68b7('0x21')];}_0x1b1916=_0x380325;})['finally'](function(){if(_0x1b1916===null){_0x1a8d6a[_0x68b7('0xb')](_0x2ceebc);}else{if(_0x2ceebc===0x1f4){_0x1a8d6a['status'](_0x2ceebc)[_0x68b7('0x22')](_0x1b1916);}else{_0x1a8d6a[_0x68b7('0xc')](_0x2ceebc)[_0x68b7('0xe')](_0x1b1916);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d28ea64..3bf4a1a 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 _0xeedd=['hook','exports','events','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x36a1db,_0x42e050){var _0x10812f=function(_0x58073b){while(--_0x58073b){_0x36a1db['push'](_0x36a1db['shift']());}};_0x10812f(++_0x42e050);}(_0xeedd,0xc8));var _0xdeed=function(_0x44672f,_0x1c6e6e){_0x44672f=_0x44672f-0x0;var _0x4ee8fb=_0xeedd[_0x44672f];return _0x4ee8fb;};'use strict';var EventEmitter=require(_0xdeed('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xdeed('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xdeed('0x2')](0x0);var events={'afterCreate':_0xdeed('0x3'),'afterUpdate':'update','afterDestroy':_0xdeed('0x4')};function emitEvent(_0xf43aec){return function(_0x48ac1c,_0x2b437a,_0x59c511){VoiceExtensionEvents['emit'](_0xf43aec+':'+_0x48ac1c['id'],_0x48ac1c);VoiceExtensionEvents[_0xdeed('0x5')](_0xf43aec,_0x48ac1c);_0x59c511(null);};}for(var e in events){if(events[_0xdeed('0x6')](e)){var event=events[e];VoiceExtension[_0xdeed('0x7')](e,emitEvent(event));}}module[_0xdeed('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x8730=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xe0643,_0x41edec){var _0x277fc0=function(_0x5e78f5){while(--_0x5e78f5){_0xe0643['push'](_0xe0643['shift']());}};_0x277fc0(++_0x41edec);}(_0x8730,0x8e));var _0x0873=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x8730[_0x349367];return _0x14179b;};'use strict';var EventEmitter=require(_0x0873('0x0'));var VoiceExtension=require(_0x0873('0x1'))['db'][_0x0873('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0873('0x3')](0x0);var events={'afterCreate':_0x0873('0x4'),'afterUpdate':_0x0873('0x5'),'afterDestroy':_0x0873('0x6')};function emitEvent(_0xcc3241){return function(_0x175aa1,_0x2202fc,_0x42d19a){VoiceExtensionEvents[_0x0873('0x7')](_0xcc3241+':'+_0x175aa1['id'],_0x175aa1);VoiceExtensionEvents[_0x0873('0x7')](_0xcc3241,_0x175aa1);_0x42d19a(null);};}for(var e in events){if(events[_0x0873('0x8')](e)){var event=events[e];VoiceExtension[_0x0873('0x9')](e,emitEvent(event));}}module[_0x0873('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 765d7b3..a64180b 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 _0x4986=['isEmpty','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','trunk','options','split','length','name','param','prefix','phone','SIP','join','none','indexOf','replace','U(xcally-mixmonitor-context)'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x4986,0x6e));var _0x6498=function(_0x4cbd2c,_0x22b391){_0x4cbd2c=_0x4cbd2c-0x0;var _0x210e15=_0x4986[_0x4cbd2c];return _0x210e15;};'use strict';var _=require(_0x6498('0x0'));var attributes=require(_0x6498('0x1'));module[_0x6498('0x2')]=function(_0x5c0f72){var _0x5ab420=_0x5c0f72[_0x6498('0x3')];function _0x40bbc9(_0x5d24c6){var _0x15e8d3=0x2;var _0x12a6fb=[{'type':_0x5d24c6[_0x6498('0x4')],'app':_0x6498('0x5'),'appdata':_0x6498('0x6')+_0x5d24c6[_0x6498('0x4')],'context':_0x5d24c6[_0x6498('0x7')],'exten':_0x5d24c6['exten'],'priority':_0x15e8d3++,'VoiceExtensionId':_0x5d24c6['id']},{'type':_0x5d24c6['type'],'app':_0x5d24c6[_0x6498('0x8')]?_0x6498('0x5'):_0x6498('0x9'),'appdata':_0x5d24c6[_0x6498('0x8')]?_0x6498('0xa')+_0x5d24c6['alias']:_0x6498('0xb'),'context':_0x5d24c6[_0x6498('0x7')],'exten':_0x5d24c6[_0x6498('0xc')],'priority':_0x15e8d3++,'VoiceExtensionId':_0x5d24c6['id']}];if(_0x5d24c6['type']==='inbound'){_0x12a6fb[_0x6498('0xd')]({'type':'inbound','app':_0x6498('0x5'),'appdata':_0x6498('0xe')+_0x5d24c6['id'],'context':_0x5d24c6[_0x6498('0x7')],'exten':_0x5d24c6[_0x6498('0xc')],'priority':_0x15e8d3++,'VoiceExtensionId':_0x5d24c6['id']});}_0x12a6fb[_0x6498('0xd')]({'type':_0x5d24c6[_0x6498('0x4')],'app':_0x6498('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5d24c6['context'],'exten':_0x5d24c6[_0x6498('0xc')],'priority':_0x15e8d3++,'VoiceExtensionId':_0x5d24c6['id']},{'type':_0x5d24c6[_0x6498('0x4')],'app':_0x6498('0x5'),'appdata':_0x6498('0xf'),'context':_0x5d24c6[_0x6498('0x7')],'exten':_0x5d24c6['exten'],'priority':_0x15e8d3++,'VoiceExtensionId':_0x5d24c6['id']},{'type':_0x5d24c6[_0x6498('0x4')],'app':_0x6498('0x5'),'appdata':_0x6498('0x10'),'context':_0x5d24c6[_0x6498('0x7')],'exten':_0x5d24c6[_0x6498('0xc')],'priority':_0x15e8d3++,'VoiceExtensionId':_0x5d24c6['id']});return _0x12a6fb;}function _0x1b4083(_0x3fa89d){var _0x500d3f=0x2;var _0x43ae3b=[{'type':_0x6498('0x11'),'app':_0x6498('0x5'),'appdata':_0x6498('0x12'),'context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d['exten'],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':'outbound','app':_0x3fa89d[_0x6498('0x8')]?_0x6498('0x5'):_0x6498('0x9'),'appdata':_0x3fa89d[_0x6498('0x8')]?_0x6498('0xa')+_0x3fa89d[_0x6498('0x8')]:_0x6498('0xb'),'context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':_0x6498('0x11'),'app':_0x6498('0x5'),'appdata':_0x6498('0x13')+(_0x3fa89d[_0x6498('0x14')]?_0x6498('0x15')+_0x3fa89d['cutdigits']+'}':'${EXTEN}'),'context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d['exten'],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':_0x6498('0x11'),'app':_0x6498('0x5'),'appdata':_0x6498('0xe')+_0x3fa89d['id'],'context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d['exten'],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':'outbound','app':_0x6498('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x500d3f+0x2)+_0x6498('0x17')+(_0x500d3f+0x1)+')','context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':_0x6498('0x11'),'app':_0x6498('0x5'),'appdata':_0x3fa89d[_0x6498('0x14')]?_0x6498('0x18')+_0x3fa89d[_0x6498('0x14')]+'}':_0x6498('0x19'),'context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':_0x6498('0x11'),'app':_0x6498('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3fa89d['context'],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':_0x6498('0x11'),'app':_0x6498('0x5'),'appdata':_0x6498('0x10'),'context':_0x3fa89d['context'],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':'outbound','app':'Set','appdata':'outboundrouteid='+_0x3fa89d['id'],'context':_0x3fa89d['context'],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']}];if(_0x3fa89d[_0x6498('0x1a')]('recordingFormat')&&_0x3fa89d[_0x6498('0x1b')]!=='none'){_0x43ae3b[_0x6498('0xd')]({'type':_0x6498('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d['exten'],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']},{'type':_0x6498('0x11'),'app':_0x6498('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3fa89d[_0x6498('0x1b')]||'wav','context':_0x3fa89d[_0x6498('0x7')],'exten':_0x3fa89d[_0x6498('0xc')],'priority':_0x500d3f++,'VoiceExtensionId':_0x3fa89d['id']});}return _0x43ae3b;}function _0x56739d(_0x2bbb2c,_0x1fed77){var _0xfd79c3=[{'name':_0x6498('0x1c'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x6498('0x1d'),'param':0x2},{'name':'url','param':0x3}];var _0x2548b8={};var _0x5b5089=_0x1fed77[_0x6498('0x1e')](',');var _0x50179d=[];for(var _0x2411ee=0x0;_0x2411ee<_0xfd79c3[_0x6498('0x1f')];_0x2411ee++){switch(_0xfd79c3[_0x2411ee][_0x6498('0x20')]){case _0x6498('0x1c'):_0x2548b8[_0x6498('0x1c')]=_0x5b5089[_0xfd79c3[_0x2411ee][_0x6498('0x21')]][_0x6498('0x1e')]('/')[0x1];_0x2548b8['phone']=_0x5b5089[_0xfd79c3[_0x2411ee][_0x6498('0x21')]][_0x6498('0x1e')]('/')[0x2];_0x2548b8[_0x6498('0x22')]=_0x2548b8[_0x6498('0x23')]?_0x2548b8[_0x6498('0x23')][_0x6498('0x1e')]('$')[0x0]:undefined;_0x2548b8[_0x6498('0x23')]=_0x2bbb2c[_0x6498('0x14')]?(_0x2548b8['prefix']||'')+_0x6498('0x15')+_0x2bbb2c[_0x6498('0x14')]+'}':(_0x2548b8[_0x6498('0x22')]||'')+'${EXTEN}';_0x50179d[_0xfd79c3[_0x2411ee][_0x6498('0x21')]]=[_0x6498('0x24'),_0x2548b8[_0x6498('0x1c')],_0x2548b8[_0x6498('0x23')]][_0x6498('0x25')]('/');break;case _0x6498('0x1d'):_0x2548b8[_0x6498('0x1d')]=_0x5b5089[_0xfd79c3[_0x2411ee][_0x6498('0x21')]];if(_0x2bbb2c[_0x6498('0x1b')]!==_0x6498('0x26')){if(_0x2548b8[_0x6498('0x1d')][_0x6498('0x27')]('U(xcally-mixmonitor-context)')<0x0){_0x2548b8['options']+='U(xcally-mixmonitor-context)';}}else{_0x2548b8[_0x6498('0x1d')]=_0x2548b8[_0x6498('0x1d')][_0x6498('0x28')](_0x6498('0x29'),'');}_0x50179d[_0xfd79c3[_0x2411ee][_0x6498('0x21')]]=_0x2548b8[_0x6498('0x1d')];break;default:_0x50179d[_0xfd79c3[_0x2411ee][_0x6498('0x21')]]=_0x5b5089[_0xfd79c3[_0x2411ee]['param']];}}return _0x50179d[_0x6498('0x25')](',');}function _0x15b5ee(_0x28cfb7,_0x6fca6d,_0x2cb807){return new Promise(function(_0x3bc9ca,_0x484cba){var _0x427e95=[];if(_[_0x6498('0x2a')](_0x6fca6d))return _0x3bc9ca(_0x427e95);_0x5ab420['Interval']['findAll']({'attributes':['id',_0x6498('0x2b'),_0x6498('0x2c')],'raw':!![]})[_0x6498('0x2d')](function(_0x4d2f1f){for(var _0x4fb005=0x0,_0xc578de=0x0;_0x4fb005<_0x6fca6d['length'];_0x4fb005++,_0xc578de=0x0){var _0x419b04=_0x6fca6d[_0x4fb005];var _0x468e1f=[];var _0x34e5b2=[];delete _0x419b04['id'];if(_0x419b04[_0x6498('0x2b')]!==_0x6498('0x2e')){_0x419b04[_0x6498('0x2f')]=[_0x419b04['interval']];}else{_0x419b04[_0x6498('0x2f')]=_0x419b04[_0x6498('0x2c')]?_[_0x6498('0x30')](_[_0x6498('0x31')](_0x4d2f1f,{'IntervalId':_0x419b04['IntervalId']}),_0x6498('0x2b')):[];}_0x419b04[_0x6498('0x7')]=_0x28cfb7[_0x6498('0x7')];_0x419b04[_0x6498('0xc')]=_0x28cfb7[_0x6498('0xc')];if(_0x419b04[_0x6498('0x4')])_0x419b04[_0x6498('0x4')]=_0x419b04[_0x6498('0x4')]['toLowerCase']();if(_0x28cfb7[_0x6498('0x4')]===_0x6498('0x11')){if(_0x419b04[_0x6498('0x1a')](_0x6498('0x32'))&&_0x419b04[_0x6498('0x32')]&&_0x419b04[_0x6498('0x32')]!=='--'){_0x468e1f[_0x6498('0xd')]({'type':_0x419b04[_0x6498('0x4')][_0x6498('0x33')](),'app':_0x6498('0x5'),'appdata':_0x6498('0x34')+_0x419b04[_0x6498('0x32')],'context':_0x28cfb7[_0x6498('0x7')],'exten':_0x28cfb7[_0x6498('0xc')],'priority':_0x419b04[_0x6498('0x2f')][_0x6498('0x1f')]+_0x2cb807+_0xc578de++,'VoiceExtensionId':_0x28cfb7['id']});}_0x468e1f[_0x6498('0xd')]({'type':_0x419b04[_0x6498('0x4')][_0x6498('0x33')](),'app':_0x6498('0x16'),'appdata':_0x6498('0x35')+(_0x419b04['callerID']?_0x6498('0x36')+_0x419b04[_0x6498('0x37')]+')':_0x6498('0x38')),'context':_0x28cfb7[_0x6498('0x7')],'exten':_0x28cfb7[_0x6498('0xc')],'priority':_0x419b04[_0x6498('0x2f')]['length']+_0x2cb807+_0xc578de++,'VoiceExtensionId':_0x28cfb7['id']});}else{if(_0x419b04['hasOwnProperty'](_0x6498('0x39'))){if(['queue',_0x6498('0x3a')][_0x6498('0x3b')](_0x419b04[_0x6498('0x3c')][_0x6498('0x33')]())&&_0x419b04[_0x6498('0x3d')]!=='custom'){if(_0x419b04[_0x6498('0x39')]){_0x468e1f[_0x6498('0xd')]({'type':_0x419b04[_0x6498('0x4')][_0x6498('0x33')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x28cfb7[_0x6498('0x7')],'exten':_0x28cfb7['exten'],'priority':_0x419b04[_0x6498('0x2f')][_0x6498('0x1f')]+_0x2cb807+_0xc578de++,'VoiceExtensionId':_0x28cfb7['id']});_0x468e1f[_0x6498('0xd')]({'type':_0x419b04[_0x6498('0x4')][_0x6498('0x33')](),'app':_0x6498('0x5'),'appdata':_0x6498('0x3e'),'context':_0x28cfb7[_0x6498('0x7')],'exten':_0x28cfb7['exten'],'priority':_0x419b04[_0x6498('0x2f')][_0x6498('0x1f')]+_0x2cb807+_0xc578de++,'VoiceExtensionId':_0x28cfb7['id']});}else{_0x468e1f[_0x6498('0xd')]({'type':_0x419b04[_0x6498('0x4')]['toLowerCase'](),'app':_0x6498('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x28cfb7[_0x6498('0x7')],'exten':_0x28cfb7['exten'],'priority':_0x419b04[_0x6498('0x2f')][_0x6498('0x1f')]+_0x2cb807+_0xc578de++,'VoiceExtensionId':_0x28cfb7['id']});_0x468e1f['push']({'type':_0x419b04['type']['toLowerCase'](),'app':_0x6498('0x5'),'appdata':_0x6498('0x3f'),'context':_0x28cfb7['context'],'exten':_0x28cfb7[_0x6498('0xc')],'priority':_0x419b04[_0x6498('0x2f')]['length']+_0x2cb807+_0xc578de++,'VoiceExtensionId':_0x28cfb7['id']});}}}}for(var _0x5eccb8=0x0;_0x5eccb8<_0x419b04[_0x6498('0x2f')][_0x6498('0x1f')];_0x5eccb8++){var _0x13503=_0x2cb807+_0x419b04[_0x6498('0x2f')][_0x6498('0x1f')];var _0x33c930=_0x5eccb8===_0x419b04[_0x6498('0x2f')][_0x6498('0x1f')]-0x1?_0x2cb807+_0x468e1f[_0x6498('0x1f')]+_0x34e5b2['length']+0x2:_0x2cb807+_0x5eccb8+0x1;_0x468e1f['splice'](_0x5eccb8,0x0,{'type':_0x28cfb7[_0x6498('0x4')],'app':_0x6498('0x40'),'appdata':_0x419b04['intervals'][_0x5eccb8]+'?'+_0x28cfb7[_0x6498('0x7')]+_0x6498('0x41')+_0x13503+':'+_0x28cfb7[_0x6498('0x7')]+_0x6498('0x41')+_0x33c930,'exten':_0x28cfb7[_0x6498('0xc')],'context':_0x28cfb7[_0x6498('0x7')],'priority':_0x2cb807+_0x5eccb8,'VoiceExtensionId':_0x28cfb7['id']});}if(_0x419b04['appType']==='outboundDial')_0x419b04['appdata']=_0x56739d(_0x28cfb7,_0x419b04[_0x6498('0x42')]);_0x419b04[_0x6498('0x43')]=_0x468e1f['length']?_[_0x6498('0x44')](_0x468e1f)[_0x6498('0x43')]+0x1:_0x2cb807;_0x427e95=_[_0x6498('0x45')](_0x427e95,_0x468e1f,[_0x419b04],_0x34e5b2);_0x2cb807=_[_0x6498('0x44')](_0x427e95)[_0x6498('0x43')]+0x1;}return _0x3bc9ca(_0x427e95);})[_0x6498('0x46')](function(_0x11f3f7){_0x484cba(_0x11f3f7);});});}return _0x5c0f72[_0x6498('0x47')](_0x6498('0x48'),attributes,{'tableName':_0x6498('0x49'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4c2abb){var _0x4496f0=this[_0x6498('0x4a')]({'plain':!![]});var _0x525208=_0x4496f0['type']==='outbound'?_0x1b4083(_0x4496f0):_0x40bbc9(_0x4496f0);return _0x15b5ee(_0x4496f0,_0x4c2abb,_['last'](_0x525208)[_0x6498('0x43')]+0x1)[_0x6498('0x2d')](function(_0x43296a){var _0x45dcda=_['concat'](_0x525208,_0x43296a);_0x45dcda[_0x6498('0xd')]({'type':_0x4496f0['type'],'app':_0x6498('0x4b'),'exten':_0x4496f0[_0x6498('0xc')],'context':_0x4496f0[_0x6498('0x7')],'priority':_[_0x6498('0x44')](_0x45dcda)[_0x6498('0x43')]+0x1,'VoiceExtensionId':_0x4496f0['id']});return _0x45dcda;});}}});}; \ No newline at end of file +var _0x6726=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','split','name','trunk','param','phone','prefix','SIP','options','indexOf','U(xcally-mixmonitor-context)','join','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','priority','last','define','VoiceExtension','voice_extensions','get','concat','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','hasOwnProperty','recordingFormat','none'];(function(_0x570841,_0x47a630){var _0x4efdc7=function(_0x18b2c7){while(--_0x18b2c7){_0x570841['push'](_0x570841['shift']());}};_0x4efdc7(++_0x47a630);}(_0x6726,0xdb));var _0x6672=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0x6726[_0xacb1e2];return _0x463815;};'use strict';var _=require('lodash');var attributes=require(_0x6672('0x0'));module[_0x6672('0x1')]=function(_0x4ad73d){var _0x3a0005=_0x4ad73d[_0x6672('0x2')];function _0x5cdb03(_0x122ae0){var _0x5bf86c=0x2;var _0x32e5c6=[{'type':_0x122ae0[_0x6672('0x3')],'app':_0x6672('0x4'),'appdata':_0x6672('0x5')+_0x122ae0['type'],'context':_0x122ae0[_0x6672('0x6')],'exten':_0x122ae0[_0x6672('0x7')],'priority':_0x5bf86c++,'VoiceExtensionId':_0x122ae0['id']},{'type':_0x122ae0[_0x6672('0x3')],'app':_0x122ae0[_0x6672('0x8')]?_0x6672('0x4'):_0x6672('0x9'),'appdata':_0x122ae0[_0x6672('0x8')]?_0x6672('0xa')+_0x122ae0[_0x6672('0x8')]:'No\x20alias\x20set','context':_0x122ae0[_0x6672('0x6')],'exten':_0x122ae0[_0x6672('0x7')],'priority':_0x5bf86c++,'VoiceExtensionId':_0x122ae0['id']}];if(_0x122ae0['type']===_0x6672('0xb')){_0x32e5c6[_0x6672('0xc')]({'type':_0x6672('0xb'),'app':_0x6672('0x4'),'appdata':_0x6672('0xd')+_0x122ae0['id'],'context':_0x122ae0[_0x6672('0x6')],'exten':_0x122ae0[_0x6672('0x7')],'priority':_0x5bf86c++,'VoiceExtensionId':_0x122ae0['id']});}_0x32e5c6[_0x6672('0xc')]({'type':_0x122ae0[_0x6672('0x3')],'app':'Set','appdata':_0x6672('0xe'),'context':_0x122ae0[_0x6672('0x6')],'exten':_0x122ae0[_0x6672('0x7')],'priority':_0x5bf86c++,'VoiceExtensionId':_0x122ae0['id']},{'type':_0x122ae0[_0x6672('0x3')],'app':_0x6672('0x4'),'appdata':_0x6672('0xf'),'context':_0x122ae0[_0x6672('0x6')],'exten':_0x122ae0['exten'],'priority':_0x5bf86c++,'VoiceExtensionId':_0x122ae0['id']},{'type':_0x122ae0[_0x6672('0x3')],'app':_0x6672('0x4'),'appdata':_0x6672('0x10'),'context':_0x122ae0[_0x6672('0x6')],'exten':_0x122ae0[_0x6672('0x7')],'priority':_0x5bf86c++,'VoiceExtensionId':_0x122ae0['id']});return _0x32e5c6;}function _0x6884f(_0xebfb0f){var _0x184a79=0x2;var _0x4e3fde=[{'type':_0x6672('0x11'),'app':_0x6672('0x4'),'appdata':_0x6672('0x12'),'context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f['exten'],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':_0xebfb0f['alias']?_0x6672('0x4'):'NoOp','appdata':_0xebfb0f[_0x6672('0x8')]?_0x6672('0xa')+_0xebfb0f['alias']:_0x6672('0x13'),'context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':'outbound','app':'Set','appdata':_0x6672('0x14')+(_0xebfb0f[_0x6672('0x15')]?_0x6672('0x16')+_0xebfb0f[_0x6672('0x15')]+'}':_0x6672('0x17')),'context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':_0x6672('0x4'),'appdata':_0x6672('0xd')+_0xebfb0f['id'],'context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':_0x6672('0x18'),'appdata':_0x6672('0x19')+(_0x184a79+0x2)+_0x6672('0x1a')+(_0x184a79+0x1)+')','context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':'Set','appdata':_0xebfb0f[_0x6672('0x15')]?'CDR(prefix)=${EXTEN:0:'+_0xebfb0f[_0x6672('0x15')]+'}':'CDR(prefix)=noprefix','context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f['exten'],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':'outbound','app':'Set','appdata':_0x6672('0xe'),'context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':'Set','appdata':_0x6672('0xf'),'context':_0xebfb0f['context'],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':_0x6672('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f['exten'],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':'Set','appdata':'outboundrouteid='+_0xebfb0f['id'],'context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']}];if(_0xebfb0f[_0x6672('0x1b')](_0x6672('0x1c'))&&_0xebfb0f[_0x6672('0x1c')]!==_0x6672('0x1d')){_0x4e3fde[_0x6672('0xc')]({'type':_0x6672('0x11'),'app':_0x6672('0x4'),'appdata':_0x6672('0x1e'),'context':_0xebfb0f[_0x6672('0x6')],'exten':_0xebfb0f['exten'],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']},{'type':_0x6672('0x11'),'app':'Set','appdata':_0x6672('0x1f')+_0xebfb0f[_0x6672('0x1c')]||_0x6672('0x20'),'context':_0xebfb0f['context'],'exten':_0xebfb0f[_0x6672('0x7')],'priority':_0x184a79++,'VoiceExtensionId':_0xebfb0f['id']});}return _0x4e3fde;}function _0x3ab614(_0x4aba6c,_0x4c5849){var _0x4fbe1a=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x3e8cd5={};var _0x28e5ac=_0x4c5849[_0x6672('0x21')](',');var _0x3da7b8=[];for(var _0x1926cb=0x0;_0x1926cb<_0x4fbe1a['length'];_0x1926cb++){switch(_0x4fbe1a[_0x1926cb][_0x6672('0x22')]){case _0x6672('0x23'):_0x3e8cd5['trunk']=_0x28e5ac[_0x4fbe1a[_0x1926cb][_0x6672('0x24')]]['split']('/')[0x1];_0x3e8cd5[_0x6672('0x25')]=_0x28e5ac[_0x4fbe1a[_0x1926cb]['param']]['split']('/')[0x2];_0x3e8cd5[_0x6672('0x26')]=_0x3e8cd5[_0x6672('0x25')]?_0x3e8cd5['phone'][_0x6672('0x21')]('$')[0x0]:undefined;_0x3e8cd5['phone']=_0x4aba6c[_0x6672('0x15')]?(_0x3e8cd5[_0x6672('0x26')]||'')+_0x6672('0x16')+_0x4aba6c['cutdigits']+'}':(_0x3e8cd5['prefix']||'')+_0x6672('0x17');_0x3da7b8[_0x4fbe1a[_0x1926cb][_0x6672('0x24')]]=[_0x6672('0x27'),_0x3e8cd5['trunk'],_0x3e8cd5['phone']]['join']('/');break;case'options':_0x3e8cd5[_0x6672('0x28')]=_0x28e5ac[_0x4fbe1a[_0x1926cb][_0x6672('0x24')]];if(_0x4aba6c[_0x6672('0x1c')]!=='none'){if(_0x3e8cd5['options'][_0x6672('0x29')](_0x6672('0x2a'))<0x0){_0x3e8cd5[_0x6672('0x28')]+=_0x6672('0x2a');}}else{_0x3e8cd5['options']=_0x3e8cd5[_0x6672('0x28')]['replace'](_0x6672('0x2a'),'');}_0x3da7b8[_0x4fbe1a[_0x1926cb][_0x6672('0x24')]]=_0x3e8cd5['options'];break;default:_0x3da7b8[_0x4fbe1a[_0x1926cb]['param']]=_0x28e5ac[_0x4fbe1a[_0x1926cb]['param']];}}return _0x3da7b8[_0x6672('0x2b')](',');}function _0x3c3bda(_0x439c66,_0x27743b,_0x82d469){return new Promise(function(_0x55e443,_0x595061){var _0x49867f=[];if(_[_0x6672('0x2c')](_0x27743b))return _0x55e443(_0x49867f);_0x3a0005['Interval'][_0x6672('0x2d')]({'attributes':['id',_0x6672('0x2e'),_0x6672('0x2f')],'raw':!![]})[_0x6672('0x30')](function(_0x65cbea){for(var _0x1188d8=0x0,_0x26d876=0x0;_0x1188d8<_0x27743b['length'];_0x1188d8++,_0x26d876=0x0){var _0x1a4563=_0x27743b[_0x1188d8];var _0x3815a1=[];var _0x5adc76=[];delete _0x1a4563['id'];if(_0x1a4563['interval']!==_0x6672('0x31')){_0x1a4563[_0x6672('0x32')]=[_0x1a4563[_0x6672('0x2e')]];}else{_0x1a4563[_0x6672('0x32')]=_0x1a4563[_0x6672('0x2f')]?_[_0x6672('0x33')](_[_0x6672('0x34')](_0x65cbea,{'IntervalId':_0x1a4563[_0x6672('0x2f')]}),_0x6672('0x2e')):[];}_0x1a4563['context']=_0x439c66[_0x6672('0x6')];_0x1a4563['exten']=_0x439c66[_0x6672('0x7')];if(_0x1a4563['type'])_0x1a4563[_0x6672('0x3')]=_0x1a4563['type'][_0x6672('0x35')]();if(_0x439c66[_0x6672('0x3')]===_0x6672('0x11')){if(_0x1a4563[_0x6672('0x1b')]('tag')&&_0x1a4563[_0x6672('0x36')]&&_0x1a4563[_0x6672('0x36')]!=='--'){_0x3815a1[_0x6672('0xc')]({'type':_0x1a4563['type'][_0x6672('0x35')](),'app':'Set','appdata':_0x6672('0x37')+_0x1a4563[_0x6672('0x36')],'context':_0x439c66[_0x6672('0x6')],'exten':_0x439c66[_0x6672('0x7')],'priority':_0x1a4563[_0x6672('0x32')][_0x6672('0x38')]+_0x82d469+_0x26d876++,'VoiceExtensionId':_0x439c66['id']});}_0x3815a1[_0x6672('0xc')]({'type':_0x1a4563['type']['toLowerCase'](),'app':_0x6672('0x18'),'appdata':_0x6672('0x39')+(_0x1a4563['callerID']?_0x6672('0x3a')+_0x1a4563[_0x6672('0x3b')]+')':_0x6672('0x3c')),'context':_0x439c66[_0x6672('0x6')],'exten':_0x439c66[_0x6672('0x7')],'priority':_0x1a4563['intervals'][_0x6672('0x38')]+_0x82d469+_0x26d876++,'VoiceExtensionId':_0x439c66['id']});}else{if(_0x1a4563['hasOwnProperty'](_0x6672('0x3d'))){if([_0x6672('0x3e'),_0x6672('0x3f')][_0x6672('0x40')](_0x1a4563[_0x6672('0x41')][_0x6672('0x35')]())&&_0x1a4563['appType']!==_0x6672('0x42')){if(_0x1a4563[_0x6672('0x3d')]){_0x3815a1['push']({'type':_0x1a4563['type'][_0x6672('0x35')](),'app':_0x6672('0x18'),'appdata':_0x6672('0x43'),'context':_0x439c66['context'],'exten':_0x439c66['exten'],'priority':_0x1a4563[_0x6672('0x32')][_0x6672('0x38')]+_0x82d469+_0x26d876++,'VoiceExtensionId':_0x439c66['id']});_0x3815a1[_0x6672('0xc')]({'type':_0x1a4563[_0x6672('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x6672('0x44'),'context':_0x439c66[_0x6672('0x6')],'exten':_0x439c66[_0x6672('0x7')],'priority':_0x1a4563[_0x6672('0x32')][_0x6672('0x38')]+_0x82d469+_0x26d876++,'VoiceExtensionId':_0x439c66['id']});}else{_0x3815a1[_0x6672('0xc')]({'type':_0x1a4563[_0x6672('0x3')][_0x6672('0x35')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x439c66[_0x6672('0x6')],'exten':_0x439c66[_0x6672('0x7')],'priority':_0x1a4563['intervals'][_0x6672('0x38')]+_0x82d469+_0x26d876++,'VoiceExtensionId':_0x439c66['id']});_0x3815a1[_0x6672('0xc')]({'type':_0x1a4563['type']['toLowerCase'](),'app':'Set','appdata':_0x6672('0x45'),'context':_0x439c66[_0x6672('0x6')],'exten':_0x439c66[_0x6672('0x7')],'priority':_0x1a4563['intervals'][_0x6672('0x38')]+_0x82d469+_0x26d876++,'VoiceExtensionId':_0x439c66['id']});}}}}for(var _0x241ab9=0x0;_0x241ab9<_0x1a4563[_0x6672('0x32')][_0x6672('0x38')];_0x241ab9++){var _0x486471=_0x82d469+_0x1a4563['intervals'][_0x6672('0x38')];var _0x3cc957=_0x241ab9===_0x1a4563[_0x6672('0x32')][_0x6672('0x38')]-0x1?_0x82d469+_0x3815a1[_0x6672('0x38')]+_0x5adc76[_0x6672('0x38')]+0x2:_0x82d469+_0x241ab9+0x1;_0x3815a1[_0x6672('0x46')](_0x241ab9,0x0,{'type':_0x439c66[_0x6672('0x3')],'app':'GotoIfTime','appdata':_0x1a4563[_0x6672('0x32')][_0x241ab9]+'?'+_0x439c66[_0x6672('0x6')]+_0x6672('0x47')+_0x486471+':'+_0x439c66[_0x6672('0x6')]+',${EXTEN},'+_0x3cc957,'exten':_0x439c66[_0x6672('0x7')],'context':_0x439c66[_0x6672('0x6')],'priority':_0x82d469+_0x241ab9,'VoiceExtensionId':_0x439c66['id']});}if(_0x1a4563[_0x6672('0x48')]===_0x6672('0x49'))_0x1a4563['appdata']=_0x3ab614(_0x439c66,_0x1a4563[_0x6672('0x4a')]);_0x1a4563[_0x6672('0x4b')]=_0x3815a1[_0x6672('0x38')]?_[_0x6672('0x4c')](_0x3815a1)['priority']+0x1:_0x82d469;_0x49867f=_['concat'](_0x49867f,_0x3815a1,[_0x1a4563],_0x5adc76);_0x82d469=_[_0x6672('0x4c')](_0x49867f)[_0x6672('0x4b')]+0x1;}return _0x55e443(_0x49867f);})['catch'](function(_0x1b84b8){_0x595061(_0x1b84b8);});});}return _0x4ad73d[_0x6672('0x4d')](_0x6672('0x4e'),attributes,{'tableName':_0x6672('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3e772b){var _0x26f06b=this[_0x6672('0x50')]({'plain':!![]});var _0x8b3453=_0x26f06b[_0x6672('0x3')]===_0x6672('0x11')?_0x6884f(_0x26f06b):_0x5cdb03(_0x26f06b);return _0x3c3bda(_0x26f06b,_0x3e772b,_[_0x6672('0x4c')](_0x8b3453)[_0x6672('0x4b')]+0x1)[_0x6672('0x30')](function(_0x2882d6){var _0x1efd7d=_[_0x6672('0x51')](_0x8b3453,_0x2882d6);_0x1efd7d[_0x6672('0xc')]({'type':_0x26f06b['type'],'app':_0x6672('0x52'),'exten':_0x26f06b[_0x6672('0x7')],'context':_0x26f06b[_0x6672('0x6')],'priority':_[_0x6672('0x4c')](_0x1efd7d)[_0x6672('0x4b')]+0x1,'VoiceExtensionId':_0x26f06b['id']});return _0x1efd7d;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 78c9b02..badb83d 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 _0xf494=['localhost','socket.io-emitter','./voiceExtension.socket','register','request','request\x20sent','debug','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','then','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0xf494,0x1c6));var _0x4f49=function(_0x339ea6,_0x565567){_0x339ea6=_0x339ea6-0x0;var _0x3e9997=_0xf494[_0x339ea6];return _0x3e9997;};'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});config[_0x4f49('0xd')]=_['defaults'](config['redis'],{'host':_0x4f49('0xe'),'port':0x18eb});var socket=require(_0x4f49('0xf'))(new Redis(config[_0x4f49('0xd')]));require(_0x4f49('0x10'))[_0x4f49('0x11')](socket);function respondWithRpcPromise(_0x174d0d,_0x151d8c,_0x410884){return new BPromise(function(_0x53ee74,_0x3e464f){return client[_0x4f49('0x12')](_0x174d0d,_0x410884)['then'](function(_0x15e7a1){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x151d8c,_0x4f49('0x13'));logger[_0x4f49('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x151d8c,_0x4f49('0x13'),JSON[_0x4f49('0x15')](_0x15e7a1));if(_0x15e7a1[_0x4f49('0x16')]){if(_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x17')]===0x1f4){logger[_0x4f49('0x16')](_0x4f49('0x18'),_0x151d8c,_0x15e7a1['error'][_0x4f49('0x19')]);return _0x3e464f(_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x19')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x151d8c,_0x15e7a1[_0x4f49('0x16')][_0x4f49('0x19')]);return _0x53ee74(_0x15e7a1[_0x4f49('0x16')]['message']);}else{logger[_0x4f49('0x1a')](_0x4f49('0x18'),_0x151d8c,_0x4f49('0x13'));_0x53ee74(_0x15e7a1['result']['message']);}})['catch'](function(_0x47f1e8){logger[_0x4f49('0x16')](_0x4f49('0x18'),_0x151d8c,_0x47f1e8);_0x3e464f(_0x47f1e8);});});}exports[_0x4f49('0x1b')]=function(_0x407042){var _0x5793ac=this;return new Promise(function(_0x416893,_0x2aed27){return db[_0x4f49('0x1c')][_0x4f49('0x1d')]({'raw':_0x407042[_0x4f49('0x1e')]?_0x407042['options'][_0x4f49('0x1f')]===undefined?!![]:![]:!![],'where':_0x407042[_0x4f49('0x1e')]?_0x407042[_0x4f49('0x1e')]['where']||null:null,'attributes':_0x407042[_0x4f49('0x1e')]?_0x407042[_0x4f49('0x1e')][_0x4f49('0x20')]||null:null,'limit':_0x407042[_0x4f49('0x1e')]?_0x407042[_0x4f49('0x1e')][_0x4f49('0x21')]||null:null,'include':_0x407042['options']?_0x407042['options'][_0x4f49('0x22')]?_[_0x4f49('0x23')](_0x407042['options'][_0x4f49('0x22')],function(_0x2c1519){return{'model':db[_0x2c1519[_0x4f49('0x24')]],'as':_0x2c1519['as'],'attributes':_0x2c1519['attributes'],'include':_0x2c1519[_0x4f49('0x22')]?_[_0x4f49('0x23')](_0x2c1519[_0x4f49('0x22')],function(_0x148153){return{'model':db[_0x148153[_0x4f49('0x24')]],'as':_0x148153['as'],'attributes':_0x148153[_0x4f49('0x20')],'include':_0x148153['include']?_['map'](_0x148153[_0x4f49('0x22')],function(_0x2c00ee){return{'model':db[_0x2c00ee[_0x4f49('0x24')]],'as':_0x2c00ee['as'],'attributes':_0x2c00ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f49('0x25')](function(_0x206203){logger[_0x4f49('0x1a')]('GetVoiceExtension',_0x407042);logger['debug'](_0x4f49('0x1b'),_0x407042,JSON[_0x4f49('0x15')](_0x206203));_0x416893(_0x206203);})[_0x4f49('0x26')](function(_0x5e7076){logger[_0x4f49('0x16')](_0x4f49('0x1b'),_0x5e7076[_0x4f49('0x19')],_0x407042);_0x2aed27(_0x5793ac[_0x4f49('0x16')](0x1f4,_0x5e7076[_0x4f49('0x19')]));});});}; \ No newline at end of file +var _0xc1c6=['socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1d167f,_0x46d3ff){_0x1d167f=_0x1d167f-0x0;var _0x9aad7f=_0xc1c6[_0x1d167f];return _0x9aad7f;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});config['redis']=_[_0x6c1c('0x9')](config[_0x6c1c('0xa')],{'host':_0x6c1c('0xb'),'port':0x18eb});var socket=require(_0x6c1c('0xc'))(new Redis(config['redis']));require(_0x6c1c('0xd'))[_0x6c1c('0xe')](socket);function respondWithRpcPromise(_0x524d21,_0x147c7b,_0x36275f){return new BPromise(function(_0xb3bd12,_0x1137e8){return client['request'](_0x524d21,_0x36275f)[_0x6c1c('0xf')](function(_0x2a4fd4){logger[_0x6c1c('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));logger[_0x6c1c('0x12')](_0x6c1c('0x13'),_0x147c7b,'request\x20sent',JSON[_0x6c1c('0x14')](_0x2a4fd4));if(_0x2a4fd4['error']){if(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x16')]===0x1f4){logger[_0x6c1c('0x15')](_0x6c1c('0x17'),_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0x1137e8(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);}logger[_0x6c1c('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0xb3bd12(_0x2a4fd4['error'][_0x6c1c('0x18')]);}else{logger[_0x6c1c('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));_0xb3bd12(_0x2a4fd4['result'][_0x6c1c('0x18')]);}})[_0x6c1c('0x19')](function(_0x5a3bb7){logger[_0x6c1c('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x147c7b,_0x5a3bb7);_0x1137e8(_0x5a3bb7);});});}exports[_0x6c1c('0x1a')]=function(_0x3527bf){var _0x23470e=this;return new Promise(function(_0x211f49,_0x1acf7f){return db[_0x6c1c('0x1b')][_0x6c1c('0x1c')]({'raw':_0x3527bf[_0x6c1c('0x1d')]?_0x3527bf[_0x6c1c('0x1d')][_0x6c1c('0x1e')]===undefined?!![]:![]:!![],'where':_0x3527bf[_0x6c1c('0x1d')]?_0x3527bf[_0x6c1c('0x1d')][_0x6c1c('0x1f')]||null:null,'attributes':_0x3527bf[_0x6c1c('0x1d')]?_0x3527bf[_0x6c1c('0x1d')][_0x6c1c('0x20')]||null:null,'limit':_0x3527bf[_0x6c1c('0x1d')]?_0x3527bf[_0x6c1c('0x1d')][_0x6c1c('0x21')]||null:null,'include':_0x3527bf[_0x6c1c('0x1d')]?_0x3527bf[_0x6c1c('0x1d')][_0x6c1c('0x22')]?_[_0x6c1c('0x23')](_0x3527bf[_0x6c1c('0x1d')][_0x6c1c('0x22')],function(_0x80bc05){return{'model':db[_0x80bc05[_0x6c1c('0x24')]],'as':_0x80bc05['as'],'attributes':_0x80bc05[_0x6c1c('0x20')],'include':_0x80bc05[_0x6c1c('0x22')]?_['map'](_0x80bc05[_0x6c1c('0x22')],function(_0x4d73aa){return{'model':db[_0x4d73aa[_0x6c1c('0x24')]],'as':_0x4d73aa['as'],'attributes':_0x4d73aa['attributes'],'include':_0x4d73aa[_0x6c1c('0x22')]?_['map'](_0x4d73aa[_0x6c1c('0x22')],function(_0xf557ba){return{'model':db[_0xf557ba['model']],'as':_0xf557ba['as'],'attributes':_0xf557ba[_0x6c1c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6c1c('0xf')](function(_0x4e13e3){logger[_0x6c1c('0x10')](_0x6c1c('0x1a'),_0x3527bf);logger[_0x6c1c('0x12')](_0x6c1c('0x1a'),_0x3527bf,JSON['stringify'](_0x4e13e3));_0x211f49(_0x4e13e3);})['catch'](function(_0x3cba17){logger[_0x6c1c('0x15')](_0x6c1c('0x1a'),_0x3cba17[_0x6c1c('0x18')],_0x3527bf);_0x1acf7f(_0x23470e[_0x6c1c('0x15')](0x1f4,_0x3cba17[_0x6c1c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index c7edc18..e8ba9b1 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0xcd06b0,_0x21dee6){var _0x19b4a5=function(_0x206201){while(--_0x206201){_0xcd06b0['push'](_0xcd06b0['shift']());}};_0x19b4a5(++_0x21dee6);}(_0xabce,0x103));var _0xeabc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xabce[_0x5bd426];return _0x23a7eb;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x4a5299,_0x3438f6){var _0x3097f2=function(_0x4b70a3){while(--_0x4b70a3){_0x4a5299['push'](_0x4a5299['shift']());}};_0x3097f2(++_0x3438f6);}(_0xf494,0x1c6));var _0x4f49=function(_0x5f025e,_0x459129){_0x5f025e=_0x5f025e-0x0;var _0x3467cb=_0xf494[_0x5f025e];return _0x3467cb;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 5c401dc..8c47801 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x187d=['/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show'];(function(_0x4af0a7,_0x49afdd){var _0x2d7cc9=function(_0x3b3089){while(--_0x3b3089){_0x4af0a7['push'](_0x4af0a7['shift']());}};_0x2d7cc9(++_0x49afdd);}(_0x187d,0x93));var _0xd187=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x187d[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','getMessages','post','create','put','delete','exports'];(function(_0x3ba2d6,_0x4910cb){var _0x6f362a=function(_0x4ac813){while(--_0x4ac813){_0x3ba2d6['push'](_0x3ba2d6['shift']());}};_0x6f362a(++_0x4910cb);}(_0x326f,0xd1));var _0xf326=function(_0x214c25,_0x28a74c){_0x214c25=_0x214c25-0x0;var _0xbdbd62=_0x326f[_0x214c25];return _0xbdbd62;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 938fecc..f916933 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 _0x3dea=['mailbox','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname'];(function(_0x3ccfbf,_0x4814d0){var _0x1a67f8=function(_0x6c7667){while(--_0x6c7667){_0x3ccfbf['push'](_0x3ccfbf['shift']());}};_0x1a67f8(++_0x4814d0);}(_0x3dea,0x91));var _0xa3de=function(_0x372a02,_0x2a2b00){_0x372a02=_0x372a02-0x0;var _0x3a11cc=_0x3dea[_0x372a02];return _0x3a11cc;};'use strict';var Sequelize=require(_0xa3de('0x0'));module[_0xa3de('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xa3de('0x2'),'unique':_0xa3de('0x3')},'mailbox':{'type':Sequelize[_0xa3de('0x4')],'defaultValue':'','allowNull':![],'unique':_0xa3de('0x3')},'password':{'type':Sequelize[_0xa3de('0x4')]},'fullname':{'type':Sequelize[_0xa3de('0x4')]},'email':{'type':Sequelize[_0xa3de('0x4')],'validate':{'isEmail':!![]},'set':function(_0x29f6cb){this[_0xa3de('0x5')](_0xa3de('0x6'),typeof _0x29f6cb===_0xa3de('0x7')&&_0x29f6cb[_0xa3de('0x8')]()?_0x29f6cb[_0xa3de('0x8')]():null);}},'pager':{'type':Sequelize[_0xa3de('0x4')]},'tz':{'type':Sequelize[_0xa3de('0x4')],'defaultValue':_0xa3de('0x9')},'attach':{'type':Sequelize[_0xa3de('0xa')]('yes','no'),'defaultValue':_0xa3de('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xa3de('0xb'),'no'),'defaultValue':_0xa3de('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xa3de('0x4')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xa3de('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xa3de('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xa3de('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xa3de('0xa')](_0xa3de('0xb'),'no'),'defaultValue':_0xa3de('0xb'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xa3de('0x4')]},'maxsecs':{'type':Sequelize[_0xa3de('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xa3de('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xa3de('0xe')],'get':function(){return this[_0xa3de('0xf')](_0xa3de('0x10'))+'\x20-\x20'+this['getDataValue'](_0xa3de('0x11'));}}}; \ No newline at end of file +var _0x0496=['mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue'];(function(_0x147aac,_0x5e5ec5){var _0x1b82d9=function(_0x47bb41){while(--_0x47bb41){_0x147aac['push'](_0x147aac['shift']());}};_0x1b82d9(++_0x5e5ec5);}(_0x0496,0x141));var _0x6049=function(_0x5714d1,_0xb08d23){_0x5714d1=_0x5714d1-0x0;var _0x578deb=_0x0496[_0x5714d1];return _0x578deb;};'use strict';var Sequelize=require('sequelize');module[_0x6049('0x0')]={'customer_id':{'type':Sequelize[_0x6049('0x1')]},'context':{'type':Sequelize[_0x6049('0x1')],'defaultValue':_0x6049('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x6049('0x1')],'defaultValue':'','allowNull':![],'unique':_0x6049('0x3')},'password':{'type':Sequelize[_0x6049('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xb115c9){this[_0x6049('0x4')](_0x6049('0x5'),typeof _0xb115c9==='string'&&_0xb115c9[_0x6049('0x6')]()?_0xb115c9[_0x6049('0x6')]():null);}},'pager':{'type':Sequelize[_0x6049('0x1')]},'tz':{'type':Sequelize[_0x6049('0x1')],'defaultValue':_0x6049('0x7')},'attach':{'type':Sequelize[_0x6049('0x8')](_0x6049('0x9'),'no'),'defaultValue':_0x6049('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6049('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x6049('0x1')]},'review':{'type':Sequelize[_0x6049('0x8')](_0x6049('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6049('0x8')](_0x6049('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6049('0x8')](_0x6049('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6049('0x8')](_0x6049('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x6049('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x6049('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6049('0x8')](_0x6049('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x6049('0x8')](_0x6049('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6049('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6049('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x6049('0xa')},'emailsubject':{'type':Sequelize[_0x6049('0x1')]},'emailbody':{'type':Sequelize[_0x6049('0x1')]},'maxsecs':{'type':Sequelize[_0x6049('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6049('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6049('0xc')],'get':function(){return this['getDataValue'](_0x6049('0xd'))+'\x20-\x20'+this[_0x6049('0xe')](_0x6049('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f8206ae..266c86e 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 _0x373d=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','filter','VoiceMail','include','findAll','catch','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','nolimit','pick','mailbox','options','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x3a8280,_0x5ebbbc){var _0x36af67=function(_0x44062f){while(--_0x44062f){_0x3a8280['push'](_0x3a8280['shift']());}};_0x36af67(++_0x5ebbbc);}(_0x373d,0x1e2));var _0xd373=function(_0x548a37,_0x5f1aa5){_0x548a37=_0x548a37-0x0;var _0x4ce567=_0x373d[_0x548a37];return _0x4ce567;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7f91,_0x5ab89c){_0x5ab89c=_0x5ab89c||0xcc;return function(_0xcd9b8c){if(_0xcd9b8c){return _0x4c7f91[_0xd373('0x15')](_0x5ab89c);}return _0x4c7f91['status'](_0x5ab89c)[_0xd373('0x16')]();};}function respondWithResult(_0x129475,_0x27c161){_0x27c161=_0x27c161||0xc8;return function(_0x23ed86){if(_0x23ed86){return _0x129475[_0xd373('0x17')](_0x27c161)[_0xd373('0x18')](_0x23ed86);}};}function respondWithFilteredResult(_0x20aca5,_0x2eacb1){return function(_0x5a286a){if(_0x5a286a){var _0x2c5854=typeof _0x2eacb1[_0xd373('0x19')]===_0xd373('0x1a')&&typeof _0x2eacb1[_0xd373('0x1b')]==='undefined';var _0x1e26cf=_0x5a286a['count'];var _0x460259=_0x2c5854?0x0:_0x2eacb1[_0xd373('0x19')];var _0x55c5c7=_0x2c5854?_0x5a286a[_0xd373('0x1c')]:_0x2eacb1['offset']+_0x2eacb1['limit'];var _0x23fada;if(_0x55c5c7>=_0x1e26cf){_0x55c5c7=_0x1e26cf;_0x23fada=0xc8;}else{_0x23fada=0xce;}_0x20aca5[_0xd373('0x17')](_0x23fada);return _0x20aca5[_0xd373('0x1d')](_0xd373('0x1e'),_0x460259+'-'+_0x55c5c7+'/'+_0x1e26cf)[_0xd373('0x18')](_0x5a286a);}return null;};}function patchUpdates(_0x181eb2){return function(_0x4ba510){try{jsonpatch[_0xd373('0x1f')](_0x4ba510,_0x181eb2,!![]);}catch(_0xd808f8){return BPromise[_0xd373('0x20')](_0xd808f8);}return _0x4ba510[_0xd373('0x21')]();};}function saveUpdates(_0x165e21,_0x3aa1c5){return function(_0x4f64bd){if(_0x4f64bd){return _0x4f64bd[_0xd373('0x22')](_0x165e21)[_0xd373('0x23')](function(_0x157f81){return _0x157f81;});}return null;};}function removeEntity(_0x209ca7,_0x217ee7){return function(_0x238ffd){if(_0x238ffd){return _0x238ffd[_0xd373('0x24')]()[_0xd373('0x23')](function(){var _0x1ab540=_0x238ffd[_0xd373('0x25')]({'plain':!![]});var _0x437110=_0xd373('0x26');return db[_0xd373('0x27')][_0xd373('0x24')]({'where':{'type':_0x437110,'resourceId':_0x1ab540['id']}})[_0xd373('0x23')](function(){return _0x238ffd;});})[_0xd373('0x23')](function(){_0x209ca7[_0xd373('0x17')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x3e657b,_0x470612){return function(_0x45ee58){if(!_0x45ee58){_0x3e657b[_0xd373('0x15')](0x194);}return _0x45ee58;};}function handleError(_0x71c5c,_0x3384a5){_0x3384a5=_0x3384a5||0x1f4;return function(_0xf85ca8){logger[_0xd373('0x28')](_0xf85ca8[_0xd373('0x29')]);if(_0xf85ca8[_0xd373('0x2a')]){delete _0xf85ca8[_0xd373('0x2a')];}_0x71c5c[_0xd373('0x17')](_0x3384a5)['send'](_0xf85ca8);};}exports[_0xd373('0x2b')]=function(_0x490842,_0x498aaa){var _0xedc8f3={},_0x15da6c={},_0x25e016={'count':0x0,'rows':[]};var _0x23024c=_[_0xd373('0x2c')](db['VoiceMail'][_0xd373('0x2d')],function(_0x104156){return{'name':_0x104156['fieldName'],'type':_0x104156[_0xd373('0x2e')][_0xd373('0x2f')]};});_0x15da6c[_0xd373('0x30')]=_[_0xd373('0x2c')](_0x23024c,_0xd373('0x2a'));_0x15da6c[_0xd373('0x31')]=_[_0xd373('0x32')](_0x490842[_0xd373('0x31')]);_0x15da6c[_0xd373('0x33')]=_['intersection'](_0x15da6c[_0xd373('0x30')],_0x15da6c[_0xd373('0x31')]);_0xedc8f3[_0xd373('0x34')]=_[_0xd373('0x35')](_0x15da6c[_0xd373('0x30')],qs[_0xd373('0x36')](_0x490842[_0xd373('0x31')][_0xd373('0x36')]));_0xedc8f3[_0xd373('0x34')]=_0xedc8f3[_0xd373('0x34')][_0xd373('0x37')]?_0xedc8f3[_0xd373('0x34')]:_0x15da6c[_0xd373('0x30')];if(!_0x490842[_0xd373('0x31')][_0xd373('0x38')]('nolimit')){_0xedc8f3[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x490842[_0xd373('0x31')][_0xd373('0x1b')]);_0xedc8f3['offset']=qs[_0xd373('0x19')](_0x490842[_0xd373('0x31')][_0xd373('0x19')]);}_0xedc8f3[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0x490842[_0xd373('0x31')]['sort']);_0xedc8f3['where']=qs[_0xd373('0x33')](_['pick'](_0x490842[_0xd373('0x31')],_0x15da6c[_0xd373('0x33')]),_0x23024c);if(_0x490842[_0xd373('0x31')]['filter']){_0xedc8f3[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0xedc8f3[_0xd373('0x3b')],{'$or':_[_0xd373('0x2c')](_0x23024c,function(_0x504450){if(_0x504450['type']!=='VIRTUAL'){var _0x11ec1b={};_0x11ec1b[_0x504450['name']]={'$like':'%'+_0x490842[_0xd373('0x31')][_0xd373('0x3d')]+'%'};return _0x11ec1b;}})});}_0xedc8f3=_['merge']({},_0xedc8f3,_0x490842['options']);var _0x5f3dd5={'where':_0xedc8f3[_0xd373('0x3b')]};return db[_0xd373('0x3e')][_0xd373('0x1c')](_0x5f3dd5)['then'](function(_0x5c3b22){_0x25e016[_0xd373('0x1c')]=_0x5c3b22;if(_0x490842[_0xd373('0x31')]['includeAll']){_0xedc8f3[_0xd373('0x3f')]=[{'all':!![]}];}return db[_0xd373('0x3e')][_0xd373('0x40')](_0xedc8f3);})[_0xd373('0x23')](function(_0x2d8c7d){_0x25e016['rows']=_0x2d8c7d;return _0x25e016;})['then'](respondWithFilteredResult(_0x498aaa,_0xedc8f3))[_0xd373('0x41')](handleError(_0x498aaa,null));};exports[_0xd373('0x42')]=function(_0x30b423,_0x302f65){var _0x5d4dd2={'raw':!![],'where':{'id':_0x30b423['params']['id']}},_0x29725c={};_0x29725c[_0xd373('0x30')]=_[_0xd373('0x32')](db[_0xd373('0x3e')][_0xd373('0x2d')]);_0x29725c[_0xd373('0x31')]=_['keys'](_0x30b423[_0xd373('0x31')]);_0x29725c[_0xd373('0x33')]=_['intersection'](_0x29725c[_0xd373('0x30')],_0x29725c[_0xd373('0x31')]);_0x5d4dd2[_0xd373('0x34')]=_[_0xd373('0x35')](_0x29725c[_0xd373('0x30')],qs[_0xd373('0x36')](_0x30b423[_0xd373('0x31')][_0xd373('0x36')]));_0x5d4dd2[_0xd373('0x34')]=_0x5d4dd2[_0xd373('0x34')]['length']?_0x5d4dd2['attributes']:_0x29725c[_0xd373('0x30')];if(_0x30b423['query'][_0xd373('0x43')]){_0x5d4dd2['include']=[{'all':!![]}];}_0x5d4dd2=_['merge']({},_0x5d4dd2,_0x30b423['options']);return db[_0xd373('0x3e')][_0xd373('0x44')](_0x5d4dd2)[_0xd373('0x23')](handleEntityNotFound(_0x302f65,null))[_0xd373('0x23')](respondWithResult(_0x302f65,null))[_0xd373('0x41')](handleError(_0x302f65,null));};exports[_0xd373('0x45')]=function(_0x1855aa,_0x4d1088){return db[_0xd373('0x3e')]['create'](_0x1855aa[_0xd373('0x46')],{})[_0xd373('0x23')](function(_0x5502e5){var _0x4517ab=_0x1855aa['user'][_0xd373('0x25')]({'plain':!![]});if(!_0x4517ab)throw new Error(_0xd373('0x47'));if(_0x4517ab[_0xd373('0x48')]===_0xd373('0x49')){var _0xe22cbd=_0x5502e5['get']({'plain':!![]});var _0x4971a0='Voicemails';return db[_0xd373('0x4a')][_0xd373('0x44')]({'where':{'name':_0x4971a0,'userProfileId':_0x4517ab['userProfileId']},'raw':!![]})[_0xd373('0x23')](function(_0x3e6766){if(_0x3e6766&&_0x3e6766['autoAssociation']===0x0){return db[_0xd373('0x27')][_0xd373('0x45')]({'name':_0xe22cbd[_0xd373('0x2a')],'resourceId':_0xe22cbd['id'],'type':_0x3e6766[_0xd373('0x2a')],'sectionId':_0x3e6766['id']},{})[_0xd373('0x23')](function(){return _0x5502e5;});}else{return _0x5502e5;}})[_0xd373('0x41')](function(_0xc255ec){logger[_0xd373('0x28')](_0xd373('0x4b'),_0xc255ec);throw _0xc255ec;});}return _0x5502e5;})[_0xd373('0x23')](respondWithResult(_0x4d1088,0xc9))[_0xd373('0x41')](handleError(_0x4d1088,null));};exports['update']=function(_0x4b2645,_0x51ca73){if(_0x4b2645['body']['id']){delete _0x4b2645['body']['id'];}return db['VoiceMail'][_0xd373('0x44')]({'where':{'id':_0x4b2645[_0xd373('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51ca73,null))['then'](saveUpdates(_0x4b2645['body'],null))[_0xd373('0x23')](respondWithResult(_0x51ca73,null))[_0xd373('0x41')](handleError(_0x51ca73,null));};exports['destroy']=function(_0x52fa5b,_0x2230d6){return db[_0xd373('0x3e')][_0xd373('0x44')]({'where':{'id':_0x52fa5b[_0xd373('0x4c')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x2230d6,null))['then'](removeEntity(_0x2230d6,null))[_0xd373('0x41')](handleError(_0x2230d6,null));};exports[_0xd373('0x4d')]=function(_0x386e4c,_0x213da6,_0xc607fb){return db[_0xd373('0x3e')][_0xd373('0x4e')]({'where':{'id':_0x386e4c[_0xd373('0x4c')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x213da6,null))[_0xd373('0x23')](function(_0x1c21d2){var _0x3ad1ec;var _0x213b3c={},_0x42e45d={};_0x42e45d[_0xd373('0x30')]=_['keys'](db[_0xd373('0x4f')][_0xd373('0x2d')]);_0x42e45d[_0xd373('0x31')]=_['keys'](_0x386e4c[_0xd373('0x31')]);_0x42e45d['filters']=_[_0xd373('0x35')](_0x42e45d['model'],_0x42e45d[_0xd373('0x31')]);_0x213b3c[_0xd373('0x34')]=_[_0xd373('0x35')](_0x42e45d[_0xd373('0x30')],qs[_0xd373('0x36')](_0x386e4c[_0xd373('0x31')][_0xd373('0x36')]));_0x213b3c[_0xd373('0x34')]=_0x213b3c[_0xd373('0x34')][_0xd373('0x37')]?_0x213b3c[_0xd373('0x34')]:_0x42e45d[_0xd373('0x30')];if(!_0x386e4c[_0xd373('0x31')][_0xd373('0x38')](_0xd373('0x50'))){_0x213b3c[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x386e4c[_0xd373('0x31')][_0xd373('0x1b')]);_0x213b3c[_0xd373('0x19')]=qs[_0xd373('0x19')](_0x386e4c[_0xd373('0x31')][_0xd373('0x19')]);}_0x213b3c[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0x386e4c[_0xd373('0x31')]['sort']);_0x213b3c[_0xd373('0x3b')]=qs[_0xd373('0x33')](_[_0xd373('0x51')](_0x386e4c['query'],_0x42e45d[_0xd373('0x33')]));if(_0x386e4c[_0xd373('0x31')][_0xd373('0x3d')]){_0x213b3c[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0x213b3c[_0xd373('0x3b')],{'$or':_[_0xd373('0x2c')](_0x213b3c['attributes'],function(_0x1afe12){var _0x356820={};_0x356820[_0x1afe12]={'$like':'%'+_0x386e4c[_0xd373('0x31')][_0xd373('0x3d')]+'%'};return _0x356820;})});}_0x213b3c[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0x213b3c[_0xd373('0x3b')],{'mailboxuser':_0x1c21d2[_0xd373('0x52')]});_0x213b3c=_['merge']({},_0x213b3c,_0x386e4c[_0xd373('0x53')]);return db['VoiceMailMessage'][_0xd373('0x54')](_0x213b3c)[_0xd373('0x23')](respondWithFilteredResult(_0x213da6,_0x213b3c));})[_0xd373('0x41')](handleError(_0x213da6,null));}; \ No newline at end of file +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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb9be,0xc5));var _0xeb9b=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xb9be[_0x1d70db];return _0x3060c6;};'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 diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 190e59b..9702f40 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 _0xa8dd=['voice_voicemail','mailbox_context','mailbox','context','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail'];(function(_0x25f39c,_0x4f231a){var _0x19bb4a=function(_0x33feb5){while(--_0x33feb5){_0x25f39c['push'](_0x25f39c['shift']());}};_0x19bb4a(++_0x4f231a);}(_0xa8dd,0x1a8));var _0xda8d=function(_0xb2eb8,_0xeebbdf){_0xb2eb8=_0xb2eb8-0x0;var _0xd94a48=_0xa8dd[_0xb2eb8];return _0xd94a48;};'use strict';var _=require('lodash');var util=require(_0xda8d('0x0'));var logger=require(_0xda8d('0x1'))('api');var moment=require(_0xda8d('0x2'));var BPromise=require(_0xda8d('0x3'));var rp=require(_0xda8d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda8d('0x5'));var config=require(_0xda8d('0x6'));var attributes=require(_0xda8d('0x7'));module[_0xda8d('0x8')]=function(_0x2b76c9,_0x552d3c){return _0x2b76c9['define'](_0xda8d('0x9'),attributes,{'tableName':_0xda8d('0xa'),'paranoid':![],'indexes':[{'name':_0xda8d('0xb'),'fields':[_0xda8d('0xc'),_0xda8d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d9f=['rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','request-promise'];(function(_0x12f897,_0x81cfc5){var _0x4c1ee4=function(_0x468697){while(--_0x468697){_0x12f897['push'](_0x12f897['shift']());}};_0x4c1ee4(++_0x81cfc5);}(_0x0d9f,0xd8));var _0xf0d9=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x0d9f[_0x381379];return _0x3e1063;};'use strict';var _=require(_0xf0d9('0x0'));var util=require('util');var logger=require(_0xf0d9('0x1'))(_0xf0d9('0x2'));var moment=require(_0xf0d9('0x3'));var BPromise=require('bluebird');var rp=require(_0xf0d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0d9('0x5'));var config=require(_0xf0d9('0x6'));var attributes=require(_0xf0d9('0x7'));module[_0xf0d9('0x8')]=function(_0x2f0a40,_0x2f50df){return _0x2f0a40['define'](_0xf0d9('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xf0d9('0xa'),'fields':[_0xf0d9('0xb'),_0xf0d9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 369af3b..b58f56e 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 _0x0acd=['error','code','VoiceMail,\x20%s,\x20%s','message','info','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x1cc2ed,_0x448a8d){var _0x168e06=function(_0x9a4869){while(--_0x9a4869){_0x1cc2ed['push'](_0x1cc2ed['shift']());}};_0x168e06(++_0x448a8d);}(_0x0acd,0x195));var _0xd0ac=function(_0x32b680,_0x26fdd5){_0x32b680=_0x32b680-0x0;var _0x58d7a4=_0x0acd[_0x32b680];return _0x58d7a4;};'use strict';var _=require(_0xd0ac('0x0'));var util=require('util');var moment=require(_0xd0ac('0x1'));var BPromise=require('bluebird');var rs=require(_0xd0ac('0x2'));var fs=require('fs');var Redis=require(_0xd0ac('0x3'));var db=require(_0xd0ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0ac('0x5'))(_0xd0ac('0x6'));var config=require(_0xd0ac('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd0ac('0x8')][_0xd0ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a992b,_0x51df08,_0x2ce5b0){return new BPromise(function(_0x289ef8,_0x497941){return client[_0xd0ac('0xa')](_0x3a992b,_0x2ce5b0)[_0xd0ac('0xb')](function(_0x23c03c){logger['info']('VoiceMail,\x20%s,\x20%s',_0x51df08,_0xd0ac('0xc'));logger[_0xd0ac('0xd')](_0xd0ac('0xe'),_0x51df08,_0xd0ac('0xc'),JSON['stringify'](_0x23c03c));if(_0x23c03c[_0xd0ac('0xf')]){if(_0x23c03c[_0xd0ac('0xf')][_0xd0ac('0x10')]===0x1f4){logger['error'](_0xd0ac('0x11'),_0x51df08,_0x23c03c[_0xd0ac('0xf')]['message']);return _0x497941(_0x23c03c[_0xd0ac('0xf')][_0xd0ac('0x12')]);}logger['error'](_0xd0ac('0x11'),_0x51df08,_0x23c03c[_0xd0ac('0xf')]['message']);return _0x289ef8(_0x23c03c[_0xd0ac('0xf')][_0xd0ac('0x12')]);}else{logger[_0xd0ac('0x13')](_0xd0ac('0x11'),_0x51df08,'request\x20sent');_0x289ef8(_0x23c03c['result']['message']);}})['catch'](function(_0x1449d8){logger[_0xd0ac('0xf')]('VoiceMail,\x20%s,\x20%s',_0x51df08,_0x1449d8);_0x497941(_0x1449d8);});});} \ No newline at end of file +var _0xae2a=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0xae2a,0x1e7));var _0xaae2=function(_0x38f057,_0x5cbc67){_0x38f057=_0x38f057-0x0;var _0x289965=_0xae2a[_0x38f057];return _0x289965;};'use strict';var _=require(_0xaae2('0x0'));var util=require(_0xaae2('0x1'));var moment=require(_0xaae2('0x2'));var BPromise=require(_0xaae2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaae2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaae2('0x5'));var logger=require(_0xaae2('0x6'))('rpc');var config=require(_0xaae2('0x7'));var jayson=require(_0xaae2('0x8'));var client=jayson['client'][_0xaae2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x586770,_0x22384e,_0xbdc184){return new BPromise(function(_0x355658,_0x9e1f96){return client['request'](_0x586770,_0xbdc184)['then'](function(_0x43c7ed){logger[_0xaae2('0xa')](_0xaae2('0xb'),_0x22384e,_0xaae2('0xc'));logger[_0xaae2('0xd')](_0xaae2('0xe'),_0x22384e,'request\x20sent',JSON['stringify'](_0x43c7ed));if(_0x43c7ed[_0xaae2('0xf')]){if(_0x43c7ed[_0xaae2('0xf')][_0xaae2('0x10')]===0x1f4){logger[_0xaae2('0xf')](_0xaae2('0xb'),_0x22384e,_0x43c7ed[_0xaae2('0xf')][_0xaae2('0x11')]);return _0x9e1f96(_0x43c7ed[_0xaae2('0xf')]['message']);}logger[_0xaae2('0xf')](_0xaae2('0xb'),_0x22384e,_0x43c7ed['error'][_0xaae2('0x11')]);return _0x355658(_0x43c7ed[_0xaae2('0xf')]['message']);}else{logger[_0xaae2('0xa')]('VoiceMail,\x20%s,\x20%s',_0x22384e,_0xaae2('0xc'));_0x355658(_0x43c7ed[_0xaae2('0x12')][_0xaae2('0x11')]);}})[_0xaae2('0x13')](function(_0x359e0c){logger[_0xaae2('0xf')](_0xaae2('0xb'),_0x22384e,_0x359e0c);_0x9e1f96(_0x359e0c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index b419ee7..438cc27 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 _0x763a=['delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','download','post','create','put','update'];(function(_0x5f36cd,_0x37d4c9){var _0x49832a=function(_0xa82985){while(--_0xa82985){_0x5f36cd['push'](_0x5f36cd['shift']());}};_0x49832a(++_0x37d4c9);}(_0x763a,0xab));var _0xa763=function(_0xe13fdd,_0x480d78){_0xe13fdd=_0xe13fdd-0x0;var _0x45b95f=_0x763a[_0xe13fdd];return _0x45b95f;};'use strict';var multer=require(_0xa763('0x0'));var util=require(_0xa763('0x1'));var path=require(_0xa763('0x2'));var timeout=require('connect-timeout');var express=require(_0xa763('0x3'));var router=express['Router']();var fs_extra=require(_0xa763('0x4'));var auth=require(_0xa763('0x5'));var interaction=require(_0xa763('0x6'));var config=require(_0xa763('0x7'));var controller=require(_0xa763('0x8'));router[_0xa763('0x9')]('/',auth[_0xa763('0xa')](),controller['index']);router[_0xa763('0x9')](_0xa763('0xb'),auth[_0xa763('0xa')](),controller[_0xa763('0xc')]);router[_0xa763('0x9')]('/:id/download',auth[_0xa763('0xa')](),controller[_0xa763('0xd')]);router[_0xa763('0xe')]('/',auth[_0xa763('0xa')](),controller[_0xa763('0xf')]);router[_0xa763('0x10')](_0xa763('0xb'),auth['isAuthenticated'](),controller[_0xa763('0x11')]);router[_0xa763('0x12')]('/:id',auth[_0xa763('0xa')](),controller[_0xa763('0x13')]);module[_0xa763('0x14')]=router; \ No newline at end of file +var _0xc615=['Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','index','get','isAuthenticated','show','download','post','put','/:id','destroy','exports','multer','util','connect-timeout','express'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc615,0x1d0));var _0x5c61=function(_0x3871d7,_0x3cfcc5){_0x3871d7=_0x3871d7-0x0;var _0x28ec09=_0xc615[_0x3871d7];return _0x28ec09;};'use strict';var multer=require(_0x5c61('0x0'));var util=require(_0x5c61('0x1'));var path=require('path');var timeout=require(_0x5c61('0x2'));var express=require(_0x5c61('0x3'));var router=express[_0x5c61('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5c61('0x5'));var interaction=require(_0x5c61('0x6'));var config=require('../../config/environment');var controller=require(_0x5c61('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5c61('0x8')]);router[_0x5c61('0x9')]('/:id',auth[_0x5c61('0xa')](),controller[_0x5c61('0xb')]);router[_0x5c61('0x9')]('/:id/download',auth[_0x5c61('0xa')](),controller[_0x5c61('0xc')]);router[_0x5c61('0xd')]('/',auth[_0x5c61('0xa')](),controller['create']);router[_0x5c61('0xe')](_0x5c61('0xf'),auth[_0x5c61('0xa')](),controller['update']);router['delete'](_0x5c61('0xf'),auth[_0x5c61('0xa')](),controller[_0x5c61('0x10')]);module[_0x5c61('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 12eddac..eecf792 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 _0x1468=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0x1468,0xad));var _0x8146=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x1468[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x8146('0x0'));module[_0x8146('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3612a9){return this[_0x8146('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8146('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x8146('0x5')](_0x8146('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8146('0x4')],'defaultValue':''},'stamp':{'type':_0x8146('0x7'),'defaultValue':Sequelize[_0x8146('0x8')](_0x8146('0x9'))}}; \ No newline at end of file +var _0xa8f0=['TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','INTEGER','STRING','BLOB','long'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa8f0,0xbf));var _0x0a8f=function(_0x503ea8,_0x22e391){_0x503ea8=_0x503ea8-0x0;var _0x427e5d=_0xa8f0[_0x503ea8];return _0x427e5d;};'use strict';var Sequelize=require('sequelize');module[_0x0a8f('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4b852e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x0a8f('0x1')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0a8f('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0x0a8f('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x0a8f('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0a8f('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x0a8f('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x0a8f('0x3')](_0x0a8f('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0a8f('0x2')],'defaultValue':''},'stamp':{'type':_0x0a8f('0x5'),'defaultValue':Sequelize['literal'](_0x0a8f('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index fb81a35..5e7e3c8 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 _0x7062=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','include','findAll','rows','catch','params','options','find','create','body','update','destroy','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22'];(function(_0x4fb6b6,_0x5eb1c7){var _0x3ea470=function(_0x26228c){while(--_0x26228c){_0x4fb6b6['push'](_0x4fb6b6['shift']());}};_0x3ea470(++_0x5eb1c7);}(_0x7062,0xa8));var _0x2706=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7062[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2706('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2706('0x1'));var rp=require(_0x2706('0x2'));var moment=require(_0x2706('0x3'));var BPromise=require(_0x2706('0x4'));var Mustache=require(_0x2706('0x5'));var util=require(_0x2706('0x6'));var path=require(_0x2706('0x7'));var sox=require(_0x2706('0x8'));var csv=require(_0x2706('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2706('0xa'));var _=require(_0x2706('0xb'));var squel=require('squel');var crypto=require(_0x2706('0xc'));var jsforce=require(_0x2706('0xd'));var deskjs=require(_0x2706('0xe'));var toCsv=require(_0x2706('0x9'));var querystring=require(_0x2706('0xf'));var Papa=require(_0x2706('0x10'));var Redis=require(_0x2706('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2706('0x12'));var as=require(_0x2706('0x13'));var hardwareService=require(_0x2706('0x14'));var logger=require(_0x2706('0x15'))(_0x2706('0x16'));var utils=require(_0x2706('0x17'));var config=require(_0x2706('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2706('0x19'))['db'];function respondWithStatusCode(_0x382522,_0x50500a){_0x50500a=_0x50500a||0xcc;return function(_0x3bf2cd){if(_0x3bf2cd){return _0x382522[_0x2706('0x1a')](_0x50500a);}return _0x382522[_0x2706('0x1b')](_0x50500a)[_0x2706('0x1c')]();};}function respondWithResult(_0x192676,_0x2e0f8d){_0x2e0f8d=_0x2e0f8d||0xc8;return function(_0x2d5d11){if(_0x2d5d11){return _0x192676[_0x2706('0x1b')](_0x2e0f8d)['json'](_0x2d5d11);}};}function respondWithFilteredResult(_0x3b79a6,_0x2938b6){return function(_0x597054){if(_0x597054){var _0x2939da=typeof _0x2938b6[_0x2706('0x1d')]==='undefined'&&typeof _0x2938b6[_0x2706('0x1e')]===_0x2706('0x1f');var _0x43bade=_0x597054[_0x2706('0x20')];var _0x18cc47=_0x2939da?0x0:_0x2938b6[_0x2706('0x1d')];var _0x3d6ee2=_0x2939da?_0x597054[_0x2706('0x20')]:_0x2938b6[_0x2706('0x1d')]+_0x2938b6['limit'];var _0x59fa82;if(_0x3d6ee2>=_0x43bade){_0x3d6ee2=_0x43bade;_0x59fa82=0xc8;}else{_0x59fa82=0xce;}_0x3b79a6[_0x2706('0x1b')](_0x59fa82);return _0x3b79a6[_0x2706('0x21')](_0x2706('0x22'),_0x18cc47+'-'+_0x3d6ee2+'/'+_0x43bade)[_0x2706('0x23')](_0x597054);}return null;};}function patchUpdates(_0x38037f){return function(_0x4d625b){try{jsonpatch[_0x2706('0x24')](_0x4d625b,_0x38037f,!![]);}catch(_0x82c2f0){return BPromise['reject'](_0x82c2f0);}return _0x4d625b[_0x2706('0x25')]();};}function saveUpdates(_0x5064da,_0x5e8cd4){return function(_0x15ec81){if(_0x15ec81){return _0x15ec81['update'](_0x5064da)[_0x2706('0x26')](function(_0x3a6b1e){return _0x3a6b1e;});}return null;};}function removeEntity(_0x268110,_0x365547){return function(_0x161d66){if(_0x161d66){return _0x161d66['destroy']()[_0x2706('0x26')](function(){_0x268110['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x246fa6,_0x1aa03a){return function(_0x509db9){if(!_0x509db9){_0x246fa6[_0x2706('0x1a')](0x194);}return _0x509db9;};}function handleError(_0x46cf72,_0x40f39d){_0x40f39d=_0x40f39d||0x1f4;return function(_0x405655){logger[_0x2706('0x27')](_0x405655[_0x2706('0x28')]);if(_0x405655[_0x2706('0x29')]){delete _0x405655[_0x2706('0x29')];}_0x46cf72[_0x2706('0x1b')](_0x40f39d)[_0x2706('0x2a')](_0x405655);};}exports[_0x2706('0x2b')]=function(_0x3070af,_0x456c15){var _0x103394={},_0x2635f5={},_0x2aab07={'count':0x0,'rows':[]};var _0x515861=_[_0x2706('0x2c')](db[_0x2706('0x2d')][_0x2706('0x2e')],function(_0x3a8a4e){return{'name':_0x3a8a4e['fieldName'],'type':_0x3a8a4e['type']['key']};});_0x2635f5[_0x2706('0x2f')]=_[_0x2706('0x30')](_[_0x2706('0x2c')](_0x515861,_0x2706('0x29')),[_0x2706('0x29')]);_0x2635f5[_0x2706('0x31')]=_[_0x2706('0x32')](_0x3070af[_0x2706('0x31')]);_0x2635f5[_0x2706('0x33')]=_[_0x2706('0x34')](_0x2635f5[_0x2706('0x2f')],_0x2635f5[_0x2706('0x31')]);_0x103394[_0x2706('0x35')]=_[_0x2706('0x34')](_0x2635f5['model'],qs['fields'](_0x3070af[_0x2706('0x31')][_0x2706('0x36')]));_0x103394['attributes']=_0x103394['attributes'][_0x2706('0x37')]?_0x103394[_0x2706('0x35')]:_0x2635f5[_0x2706('0x2f')];if(!_0x3070af['query'][_0x2706('0x38')](_0x2706('0x39'))){_0x103394[_0x2706('0x1e')]=qs['limit'](_0x3070af[_0x2706('0x31')][_0x2706('0x1e')]);_0x103394[_0x2706('0x1d')]=qs[_0x2706('0x1d')](_0x3070af['query']['offset']);}_0x103394[_0x2706('0x3a')]=qs['sort'](_0x3070af['query'][_0x2706('0x3b')]);_0x103394[_0x2706('0x3c')]=qs[_0x2706('0x33')](_[_0x2706('0x3d')](_0x3070af[_0x2706('0x31')],_0x2635f5[_0x2706('0x33')]),_0x515861);if(_0x3070af[_0x2706('0x31')]['filter']){_0x103394[_0x2706('0x3c')]=_[_0x2706('0x3e')](_0x103394[_0x2706('0x3c')],{'$or':_[_0x2706('0x2c')](_0x515861,function(_0x203919){if(_0x203919[_0x2706('0x3f')]!==_0x2706('0x40')){var _0x36101f={};_0x36101f[_0x203919['name']]={'$like':'%'+_0x3070af[_0x2706('0x31')]['filter']+'%'};return _0x36101f;}})});}_0x103394=_[_0x2706('0x3e')]({},_0x103394,_0x3070af['options']);var _0x171c8a={'where':_0x103394['where']};return db[_0x2706('0x2d')][_0x2706('0x20')](_0x171c8a)[_0x2706('0x26')](function(_0x1660ac){_0x2aab07[_0x2706('0x20')]=_0x1660ac;if(_0x3070af[_0x2706('0x31')]['includeAll']){_0x103394[_0x2706('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x2706('0x42')](_0x103394);})['then'](function(_0x15e191){_0x2aab07[_0x2706('0x43')]=_0x15e191;return _0x2aab07;})[_0x2706('0x26')](respondWithFilteredResult(_0x456c15,_0x103394))[_0x2706('0x44')](handleError(_0x456c15,null));};exports['show']=function(_0xfe33bc,_0x103df7){var _0x3517c6={'raw':!![],'where':{'id':_0xfe33bc[_0x2706('0x45')]['id']}},_0x4219fb={};_0x4219fb[_0x2706('0x2f')]=_['keys'](db[_0x2706('0x2d')][_0x2706('0x2e')]);_0x4219fb['query']=_['keys'](_0xfe33bc['query']);_0x4219fb[_0x2706('0x33')]=_[_0x2706('0x34')](_0x4219fb[_0x2706('0x2f')],_0x4219fb[_0x2706('0x31')]);_0x3517c6[_0x2706('0x35')]=_['intersection'](_0x4219fb[_0x2706('0x2f')],qs[_0x2706('0x36')](_0xfe33bc[_0x2706('0x31')][_0x2706('0x36')]));_0x3517c6[_0x2706('0x35')]=_0x3517c6[_0x2706('0x35')]['length']?_0x3517c6['attributes']:_0x4219fb[_0x2706('0x2f')];if(_0xfe33bc[_0x2706('0x31')]['includeAll']){_0x3517c6[_0x2706('0x41')]=[{'all':!![]}];}_0x3517c6=_[_0x2706('0x3e')]({},_0x3517c6,_0xfe33bc[_0x2706('0x46')]);return db['VoiceMailMessage'][_0x2706('0x47')](_0x3517c6)[_0x2706('0x26')](handleEntityNotFound(_0x103df7,null))[_0x2706('0x26')](respondWithResult(_0x103df7,null))[_0x2706('0x44')](handleError(_0x103df7,null));};exports[_0x2706('0x48')]=function(_0x5ddf3c,_0x4fe94a){return db[_0x2706('0x2d')][_0x2706('0x48')](_0x5ddf3c[_0x2706('0x49')],{})[_0x2706('0x26')](respondWithResult(_0x4fe94a,0xc9))['catch'](handleError(_0x4fe94a,null));};exports[_0x2706('0x4a')]=function(_0x5cec33,_0x45456e){if(_0x5cec33[_0x2706('0x49')]['id']){delete _0x5cec33[_0x2706('0x49')]['id'];}return db[_0x2706('0x2d')][_0x2706('0x47')]({'where':{'id':_0x5cec33[_0x2706('0x45')]['id']}})[_0x2706('0x26')](handleEntityNotFound(_0x45456e,null))[_0x2706('0x26')](saveUpdates(_0x5cec33['body'],null))[_0x2706('0x26')](respondWithResult(_0x45456e,null))[_0x2706('0x44')](handleError(_0x45456e,null));};exports[_0x2706('0x4b')]=function(_0x3eccda,_0x3cdd87){return db[_0x2706('0x2d')][_0x2706('0x47')]({'where':{'id':_0x3eccda[_0x2706('0x45')]['id']}})[_0x2706('0x26')](handleEntityNotFound(_0x3cdd87,null))[_0x2706('0x26')](removeEntity(_0x3cdd87,null))[_0x2706('0x44')](handleError(_0x3cdd87,null));};exports['download']=function(_0x1f8383,_0x427db6,_0x59a6b5){return db['VoiceMailMessage'][_0x2706('0x47')]({'where':{'id':_0x1f8383['params']['id']},'attributes':['id',_0x2706('0x4c'),_0x2706('0x4d')]})[_0x2706('0x26')](handleEntityNotFound(_0x427db6,null))[_0x2706('0x26')](function(_0x456133){if(_0x456133){if(!_0x456133[_0x2706('0x4c')]){throw new db[(_0x2706('0x4e'))][(_0x2706('0x4f'))](_0x2706('0x50'));}var _0x3b9c63={'Content-Type':_0x2706('0x51'),'Content-Disposition':_0x2706('0x52')};if(_0x456133[_0x2706('0x4d')]){_0x3b9c63['Content-Disposition']=_0x2706('0x53')+_0x456133[_0x2706('0x4d')]+'.wav\x22';}_0x427db6[_0x2706('0x21')](_0x3b9c63);return _0x427db6[_0x2706('0x2a')](new Buffer(_0x456133[_0x2706('0x4c')]));}})['catch'](handleError(_0x427db6,null));}; \ No newline at end of file +var _0x9335=['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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','intersection','attributes','fields','length','nolimit','order','sort','filters','merge','where','filter','options','include','rows','catch','show','params','keys','includeAll','find','create','body','destroy','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','rimraf','fast-json-patch','request-promise','bluebird','util','path'];(function(_0x1ce16d,_0x545cf8){var _0x3c0cf7=function(_0x175680){while(--_0x175680){_0x1ce16d['push'](_0x1ce16d['shift']());}};_0x3c0cf7(++_0x545cf8);}(_0x9335,0x1e0));var _0x5933=function(_0x95a380,_0x10465c){_0x95a380=_0x95a380-0x0;var _0x1a869a=_0x9335[_0x95a380];return _0x1a869a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5933('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5933('0x1'));var rp=require(_0x5933('0x2'));var moment=require('moment');var BPromise=require(_0x5933('0x3'));var Mustache=require('mustache');var util=require(_0x5933('0x4'));var path=require(_0x5933('0x5'));var sox=require(_0x5933('0x6'));var csv=require(_0x5933('0x7'));var ejs=require(_0x5933('0x8'));var fs=require('fs');var fs_extra=require(_0x5933('0x9'));var _=require(_0x5933('0xa'));var squel=require(_0x5933('0xb'));var crypto=require(_0x5933('0xc'));var jsforce=require(_0x5933('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5933('0xe'));var Papa=require(_0x5933('0xf'));var Redis=require('ioredis');var authService=require(_0x5933('0x10'));var qs=require(_0x5933('0x11'));var as=require(_0x5933('0x12'));var hardwareService=require(_0x5933('0x13'));var logger=require(_0x5933('0x14'))(_0x5933('0x15'));var utils=require(_0x5933('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5933('0x17'))['db'];function respondWithStatusCode(_0x56506f,_0x562288){_0x562288=_0x562288||0xcc;return function(_0x3de5ae){if(_0x3de5ae){return _0x56506f[_0x5933('0x18')](_0x562288);}return _0x56506f['status'](_0x562288)[_0x5933('0x19')]();};}function respondWithResult(_0x56d2a6,_0x5a9734){_0x5a9734=_0x5a9734||0xc8;return function(_0x31f388){if(_0x31f388){return _0x56d2a6[_0x5933('0x1a')](_0x5a9734)[_0x5933('0x1b')](_0x31f388);}};}function respondWithFilteredResult(_0xf909e9,_0x250de8){return function(_0x3e8125){if(_0x3e8125){var _0x2800dc=typeof _0x250de8[_0x5933('0x1c')]===_0x5933('0x1d')&&typeof _0x250de8[_0x5933('0x1e')]===_0x5933('0x1d');var _0x50a91d=_0x3e8125[_0x5933('0x1f')];var _0x3639b5=_0x2800dc?0x0:_0x250de8[_0x5933('0x1c')];var _0x3cbaea=_0x2800dc?_0x3e8125[_0x5933('0x1f')]:_0x250de8[_0x5933('0x1c')]+_0x250de8[_0x5933('0x1e')];var _0xf74f3a;if(_0x3cbaea>=_0x50a91d){_0x3cbaea=_0x50a91d;_0xf74f3a=0xc8;}else{_0xf74f3a=0xce;}_0xf909e9[_0x5933('0x1a')](_0xf74f3a);return _0xf909e9[_0x5933('0x20')]('Content-Range',_0x3639b5+'-'+_0x3cbaea+'/'+_0x50a91d)[_0x5933('0x1b')](_0x3e8125);}return null;};}function patchUpdates(_0x4390b5){return function(_0x4ab2ca){try{jsonpatch['apply'](_0x4ab2ca,_0x4390b5,!![]);}catch(_0x5ea19a){return BPromise[_0x5933('0x21')](_0x5ea19a);}return _0x4ab2ca[_0x5933('0x22')]();};}function saveUpdates(_0x313c3f,_0x2dd408){return function(_0x5d461e){if(_0x5d461e){return _0x5d461e[_0x5933('0x23')](_0x313c3f)[_0x5933('0x24')](function(_0x543c34){return _0x543c34;});}return null;};}function removeEntity(_0x212b52,_0x1ac885){return function(_0x1a92ec){if(_0x1a92ec){return _0x1a92ec['destroy']()['then'](function(){_0x212b52[_0x5933('0x1a')](0xcc)[_0x5933('0x19')]();});}};}function handleEntityNotFound(_0x67bbad,_0x17154f){return function(_0xc2d02f){if(!_0xc2d02f){_0x67bbad['sendStatus'](0x194);}return _0xc2d02f;};}function handleError(_0x147543,_0x1280c7){_0x1280c7=_0x1280c7||0x1f4;return function(_0x5f4685){logger[_0x5933('0x25')](_0x5f4685[_0x5933('0x26')]);if(_0x5f4685[_0x5933('0x27')]){delete _0x5f4685[_0x5933('0x27')];}_0x147543[_0x5933('0x1a')](_0x1280c7)[_0x5933('0x28')](_0x5f4685);};}exports[_0x5933('0x29')]=function(_0x53da67,_0x29e87e){var _0x3ad439={},_0x40e68c={},_0x535f07={'count':0x0,'rows':[]};var _0xbc6e6b=_[_0x5933('0x2a')](db[_0x5933('0x2b')][_0x5933('0x2c')],function(_0x2a2b9a){return{'name':_0x2a2b9a[_0x5933('0x2d')],'type':_0x2a2b9a[_0x5933('0x2e')]['key']};});_0x40e68c[_0x5933('0x2f')]=_[_0x5933('0x30')](_[_0x5933('0x2a')](_0xbc6e6b,_0x5933('0x27')),[_0x5933('0x27')]);_0x40e68c['query']=_['keys'](_0x53da67[_0x5933('0x31')]);_0x40e68c['filters']=_[_0x5933('0x32')](_0x40e68c['model'],_0x40e68c[_0x5933('0x31')]);_0x3ad439[_0x5933('0x33')]=_[_0x5933('0x32')](_0x40e68c[_0x5933('0x2f')],qs['fields'](_0x53da67[_0x5933('0x31')][_0x5933('0x34')]));_0x3ad439['attributes']=_0x3ad439[_0x5933('0x33')][_0x5933('0x35')]?_0x3ad439[_0x5933('0x33')]:_0x40e68c['model'];if(!_0x53da67[_0x5933('0x31')]['hasOwnProperty'](_0x5933('0x36'))){_0x3ad439[_0x5933('0x1e')]=qs[_0x5933('0x1e')](_0x53da67['query'][_0x5933('0x1e')]);_0x3ad439['offset']=qs[_0x5933('0x1c')](_0x53da67[_0x5933('0x31')][_0x5933('0x1c')]);}_0x3ad439[_0x5933('0x37')]=qs['sort'](_0x53da67['query'][_0x5933('0x38')]);_0x3ad439['where']=qs[_0x5933('0x39')](_['pick'](_0x53da67[_0x5933('0x31')],_0x40e68c[_0x5933('0x39')]),_0xbc6e6b);if(_0x53da67['query']['filter']){_0x3ad439['where']=_[_0x5933('0x3a')](_0x3ad439[_0x5933('0x3b')],{'$or':_[_0x5933('0x2a')](_0xbc6e6b,function(_0x17848b){if(_0x17848b['type']!=='VIRTUAL'){var _0x384f16={};_0x384f16[_0x17848b['name']]={'$like':'%'+_0x53da67['query'][_0x5933('0x3c')]+'%'};return _0x384f16;}})});}_0x3ad439=_['merge']({},_0x3ad439,_0x53da67[_0x5933('0x3d')]);var _0x90f7b2={'where':_0x3ad439[_0x5933('0x3b')]};return db[_0x5933('0x2b')]['count'](_0x90f7b2)['then'](function(_0x442e0c){_0x535f07[_0x5933('0x1f')]=_0x442e0c;if(_0x53da67[_0x5933('0x31')]['includeAll']){_0x3ad439[_0x5933('0x3e')]=[{'all':!![]}];}return db[_0x5933('0x2b')]['findAll'](_0x3ad439);})[_0x5933('0x24')](function(_0xac8e7e){_0x535f07[_0x5933('0x3f')]=_0xac8e7e;return _0x535f07;})['then'](respondWithFilteredResult(_0x29e87e,_0x3ad439))[_0x5933('0x40')](handleError(_0x29e87e,null));};exports[_0x5933('0x41')]=function(_0xf1c65,_0x3e7cf7){var _0x5ee3cc={'raw':!![],'where':{'id':_0xf1c65[_0x5933('0x42')]['id']}},_0x21f9a4={};_0x21f9a4['model']=_[_0x5933('0x43')](db[_0x5933('0x2b')][_0x5933('0x2c')]);_0x21f9a4[_0x5933('0x31')]=_[_0x5933('0x43')](_0xf1c65[_0x5933('0x31')]);_0x21f9a4[_0x5933('0x39')]=_['intersection'](_0x21f9a4[_0x5933('0x2f')],_0x21f9a4[_0x5933('0x31')]);_0x5ee3cc[_0x5933('0x33')]=_[_0x5933('0x32')](_0x21f9a4[_0x5933('0x2f')],qs[_0x5933('0x34')](_0xf1c65[_0x5933('0x31')][_0x5933('0x34')]));_0x5ee3cc['attributes']=_0x5ee3cc['attributes']['length']?_0x5ee3cc[_0x5933('0x33')]:_0x21f9a4[_0x5933('0x2f')];if(_0xf1c65[_0x5933('0x31')][_0x5933('0x44')]){_0x5ee3cc[_0x5933('0x3e')]=[{'all':!![]}];}_0x5ee3cc=_[_0x5933('0x3a')]({},_0x5ee3cc,_0xf1c65['options']);return db[_0x5933('0x2b')][_0x5933('0x45')](_0x5ee3cc)['then'](handleEntityNotFound(_0x3e7cf7,null))[_0x5933('0x24')](respondWithResult(_0x3e7cf7,null))[_0x5933('0x40')](handleError(_0x3e7cf7,null));};exports[_0x5933('0x46')]=function(_0x18354a,_0x44d041){return db[_0x5933('0x2b')][_0x5933('0x46')](_0x18354a[_0x5933('0x47')],{})[_0x5933('0x24')](respondWithResult(_0x44d041,0xc9))['catch'](handleError(_0x44d041,null));};exports[_0x5933('0x23')]=function(_0x22c2ab,_0x1d2ca4){if(_0x22c2ab[_0x5933('0x47')]['id']){delete _0x22c2ab['body']['id'];}return db[_0x5933('0x2b')][_0x5933('0x45')]({'where':{'id':_0x22c2ab[_0x5933('0x42')]['id']}})[_0x5933('0x24')](handleEntityNotFound(_0x1d2ca4,null))[_0x5933('0x24')](saveUpdates(_0x22c2ab[_0x5933('0x47')],null))[_0x5933('0x24')](respondWithResult(_0x1d2ca4,null))[_0x5933('0x40')](handleError(_0x1d2ca4,null));};exports[_0x5933('0x48')]=function(_0x2faf9b,_0x589a9f){return db[_0x5933('0x2b')][_0x5933('0x45')]({'where':{'id':_0x2faf9b['params']['id']}})[_0x5933('0x24')](handleEntityNotFound(_0x589a9f,null))[_0x5933('0x24')](removeEntity(_0x589a9f,null))[_0x5933('0x40')](handleError(_0x589a9f,null));};exports['download']=function(_0x563cf2,_0x3f72ee,_0x102485){return db['VoiceMailMessage'][_0x5933('0x45')]({'where':{'id':_0x563cf2[_0x5933('0x42')]['id']},'attributes':['id',_0x5933('0x49'),_0x5933('0x4a')]})[_0x5933('0x24')](handleEntityNotFound(_0x3f72ee,null))[_0x5933('0x24')](function(_0x29cae6){if(_0x29cae6){if(!_0x29cae6[_0x5933('0x49')]){throw new db[(_0x5933('0x4b'))]['ValidationError'](_0x5933('0x4c'));}var _0x5734ce={'Content-Type':_0x5933('0x4d'),'Content-Disposition':_0x5933('0x4e')};if(_0x29cae6[_0x5933('0x4a')]){_0x5734ce[_0x5933('0x4f')]=_0x5933('0x50')+_0x29cae6['msg_id']+'.wav\x22';}_0x3f72ee[_0x5933('0x20')](_0x5734ce);return _0x3f72ee[_0x5933('0x28')](new Buffer(_0x29cae6[_0x5933('0x49')]));}})[_0x5933('0x40')](handleError(_0x3f72ee,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 34bcec5..3a0a066 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 _0x353c=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x2ae489,_0x9f8183){var _0x144cd2=function(_0x3a62b7){while(--_0x3a62b7){_0x2ae489['push'](_0x2ae489['shift']());}};_0x144cd2(++_0x9f8183);}(_0x353c,0xed));var _0xc353=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0x353c[_0x4e21ba];return _0x55b94b;};'use strict';var _=require(_0xc353('0x0'));var util=require(_0xc353('0x1'));var logger=require(_0xc353('0x2'))(_0xc353('0x3'));var moment=require(_0xc353('0x4'));var BPromise=require(_0xc353('0x5'));var rp=require(_0xc353('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc353('0x7'));var config=require(_0xc353('0x8'));var attributes=require(_0xc353('0x9'));module[_0xc353('0xa')]=function(_0x259ac8,_0x2faa88){return _0x259ac8[_0xc353('0xb')](_0xc353('0xc'),attributes,{'tableName':_0xc353('0xd'),'paranoid':![],'indexes':[{'name':_0xc353('0xe'),'fields':[_0xc353('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xa935=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x136ef9,_0x26e3a3){var _0x5164f6=function(_0x242168){while(--_0x242168){_0x136ef9['push'](_0x136ef9['shift']());}};_0x5164f6(++_0x26e3a3);}(_0xa935,0xeb));var _0x5a93=function(_0x3f94c0,_0x21c689){_0x3f94c0=_0x3f94c0-0x0;var _0x9e5521=_0xa935[_0x3f94c0];return _0x9e5521;};'use strict';var _=require(_0x5a93('0x0'));var util=require(_0x5a93('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5a93('0x2'));var BPromise=require(_0x5a93('0x3'));var rp=require(_0x5a93('0x4'));var fs=require('fs');var path=require(_0x5a93('0x5'));var rimraf=require('rimraf');var config=require(_0x5a93('0x6'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x56315f,_0x1ae339){return _0x56315f[_0x5a93('0x7')](_0x5a93('0x8'),attributes,{'tableName':_0x5a93('0x9'),'paranoid':![],'indexes':[{'name':_0x5a93('0xa'),'fields':[_0x5a93('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 101f1ca..849e590 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 _0x67a4=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5edf65,_0x87b4fd){var _0x4e30c7=function(_0x2dce6f){while(--_0x2dce6f){_0x5edf65['push'](_0x5edf65['shift']());}};_0x4e30c7(++_0x87b4fd);}(_0x67a4,0x104));var _0x467a=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x67a4[_0x1e3671];return _0x48d5f5;};'use strict';var _=require(_0x467a('0x0'));var util=require(_0x467a('0x1'));var moment=require(_0x467a('0x2'));var BPromise=require(_0x467a('0x3'));var rs=require(_0x467a('0x4'));var fs=require('fs');var Redis=require(_0x467a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x467a('0x6'));var logger=require(_0x467a('0x7'))(_0x467a('0x8'));var config=require(_0x467a('0x9'));var jayson=require(_0x467a('0xa'));var client=jayson[_0x467a('0xb')][_0x467a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x398656,_0x5cc4bc,_0x522a7b){return new BPromise(function(_0xe71331,_0x19b642){return client[_0x467a('0xd')](_0x398656,_0x522a7b)[_0x467a('0xe')](function(_0x2e9ddf){logger[_0x467a('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x5cc4bc,'request\x20sent');logger['debug'](_0x467a('0x10'),_0x5cc4bc,_0x467a('0x11'),JSON[_0x467a('0x12')](_0x2e9ddf));if(_0x2e9ddf['error']){if(_0x2e9ddf[_0x467a('0x13')]['code']===0x1f4){logger[_0x467a('0x13')](_0x467a('0x14'),_0x5cc4bc,_0x2e9ddf[_0x467a('0x13')][_0x467a('0x15')]);return _0x19b642(_0x2e9ddf[_0x467a('0x13')][_0x467a('0x15')]);}logger[_0x467a('0x13')](_0x467a('0x14'),_0x5cc4bc,_0x2e9ddf['error'][_0x467a('0x15')]);return _0xe71331(_0x2e9ddf[_0x467a('0x13')][_0x467a('0x15')]);}else{logger['info'](_0x467a('0x14'),_0x5cc4bc,_0x467a('0x11'));_0xe71331(_0x2e9ddf[_0x467a('0x16')][_0x467a('0x15')]);}})['catch'](function(_0x3c2a99){logger[_0x467a('0x13')](_0x467a('0x14'),_0x5cc4bc,_0x3c2a99);_0x19b642(_0x3c2a99);});});} \ No newline at end of file +var _0xd6f4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xd6f4,0x1ce));var _0x4d6f=function(_0x10cd53,_0x528930){_0x10cd53=_0x10cd53-0x0;var _0x554db9=_0xd6f4[_0x10cd53];return _0x554db9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4d6f('0x0'));var BPromise=require(_0x4d6f('0x1'));var rs=require(_0x4d6f('0x2'));var fs=require('fs');var Redis=require(_0x4d6f('0x3'));var db=require(_0x4d6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d6f('0x5'))(_0x4d6f('0x6'));var config=require(_0x4d6f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4d6f('0x8')][_0x4d6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32b331,_0x9805ed,_0x1dc080){return new BPromise(function(_0x5a83f3,_0x14494d){return client[_0x4d6f('0xa')](_0x32b331,_0x1dc080)[_0x4d6f('0xb')](function(_0x934668){logger['info'](_0x4d6f('0xc'),_0x9805ed,_0x4d6f('0xd'));logger[_0x4d6f('0xe')](_0x4d6f('0xf'),_0x9805ed,_0x4d6f('0xd'),JSON[_0x4d6f('0x10')](_0x934668));if(_0x934668[_0x4d6f('0x11')]){if(_0x934668[_0x4d6f('0x11')][_0x4d6f('0x12')]===0x1f4){logger[_0x4d6f('0x11')](_0x4d6f('0xc'),_0x9805ed,_0x934668[_0x4d6f('0x11')][_0x4d6f('0x13')]);return _0x14494d(_0x934668[_0x4d6f('0x11')][_0x4d6f('0x13')]);}logger['error'](_0x4d6f('0xc'),_0x9805ed,_0x934668[_0x4d6f('0x11')]['message']);return _0x5a83f3(_0x934668[_0x4d6f('0x11')][_0x4d6f('0x13')]);}else{logger['info'](_0x4d6f('0xc'),_0x9805ed,_0x4d6f('0xd'));_0x5a83f3(_0x934668[_0x4d6f('0x14')]['message']);}})['catch'](function(_0x12e4ea){logger[_0x4d6f('0x11')](_0x4d6f('0xc'),_0x9805ed,_0x12e4ea);_0x14494d(_0x12e4ea);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f7e8e92..cb97699 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 _0xd819=['./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','delete','removeSound','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a5a3f,_0x3ba65d){var _0x38dcd1=function(_0x59b357){while(--_0x59b357){_0x5a5a3f['push'](_0x5a5a3f['shift']());}};_0x38dcd1(++_0x3ba65d);}(_0xd819,0x92));var _0x9d81=function(_0x49253a,_0x2c347d){_0x49253a=_0x49253a-0x0;var _0x749351=_0xd819[_0x49253a];return _0x749351;};'use strict';var multer=require('multer');var util=require(_0x9d81('0x0'));var path=require('path');var timeout=require(_0x9d81('0x1'));var express=require(_0x9d81('0x2'));var router=express[_0x9d81('0x3')]();var fs_extra=require(_0x9d81('0x4'));var auth=require(_0x9d81('0x5'));var interaction=require(_0x9d81('0x6'));var config=require(_0x9d81('0x7'));var controller=require(_0x9d81('0x8'));router[_0x9d81('0x9')]('/',auth[_0x9d81('0xa')](),controller['index']);router['get'](_0x9d81('0xb'),auth[_0x9d81('0xa')](),controller[_0x9d81('0xc')]);router[_0x9d81('0x9')](_0x9d81('0xd'),auth['isAuthenticated'](),controller[_0x9d81('0xe')]);router[_0x9d81('0xf')]('/',auth[_0x9d81('0xa')](),controller['create']);router[_0x9d81('0xf')](_0x9d81('0xd'),auth[_0x9d81('0xa')](),controller[_0x9d81('0x10')]);router[_0x9d81('0x11')](_0x9d81('0xb'),auth['isAuthenticated'](),controller[_0x9d81('0x12')]);router[_0x9d81('0x13')](_0x9d81('0xb'),auth[_0x9d81('0xa')](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth[_0x9d81('0xa')](),controller[_0x9d81('0x14')]);module[_0x9d81('0x15')]=router; \ No newline at end of file +var _0xdf6b=['../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x34bbc5,_0x462e17){var _0x3f3db9=function(_0x54db32){while(--_0x54db32){_0x34bbc5['push'](_0x34bbc5['shift']());}};_0x3f3db9(++_0x462e17);}(_0xdf6b,0xc7));var _0xbdf6=function(_0x22652a,_0x249d40){_0x22652a=_0x22652a-0x0;var _0x4e4c26=_0xdf6b[_0x22652a];return _0x4e4c26;};'use strict';var multer=require(_0xbdf6('0x0'));var util=require(_0xbdf6('0x1'));var path=require(_0xbdf6('0x2'));var timeout=require(_0xbdf6('0x3'));var express=require(_0xbdf6('0x4'));var router=express[_0xbdf6('0x5')]();var fs_extra=require(_0xbdf6('0x6'));var auth=require(_0xbdf6('0x7'));var interaction=require(_0xbdf6('0x8'));var config=require(_0xbdf6('0x9'));var controller=require(_0xbdf6('0xa'));router['get']('/',auth[_0xbdf6('0xb')](),controller['index']);router[_0xbdf6('0xc')](_0xbdf6('0xd'),auth[_0xbdf6('0xb')](),controller[_0xbdf6('0xe')]);router[_0xbdf6('0xc')](_0xbdf6('0xf'),auth['isAuthenticated'](),controller[_0xbdf6('0x10')]);router[_0xbdf6('0x11')]('/',auth['isAuthenticated'](),controller[_0xbdf6('0x12')]);router[_0xbdf6('0x11')](_0xbdf6('0xf'),auth[_0xbdf6('0xb')](),controller[_0xbdf6('0x13')]);router['put'](_0xbdf6('0xd'),auth[_0xbdf6('0xb')](),controller[_0xbdf6('0x14')]);router[_0xbdf6('0x15')](_0xbdf6('0xd'),auth[_0xbdf6('0xb')](),controller[_0xbdf6('0x16')]);router[_0xbdf6('0x15')](_0xbdf6('0x17'),auth[_0xbdf6('0xb')](),controller[_0xbdf6('0x18')]);module[_0xbdf6('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index d8654b9..4c8e69e 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 _0x2068=['BOOLEAN','exports','STRING','name','custom','files','mp3nb','quietmp3','mp3','TIMESTAMP'];(function(_0xa46cb6,_0x1b3ec6){var _0x4c2e02=function(_0x2d60f3){while(--_0x2d60f3){_0xa46cb6['push'](_0xa46cb6['shift']());}};_0x4c2e02(++_0x1b3ec6);}(_0x2068,0x1d7));var _0x8206=function(_0xbc8177,_0x4d1cfd){_0xbc8177=_0xbc8177-0x0;var _0x91d12f=_0x2068[_0xbc8177];return _0x91d12f;};'use strict';var Sequelize=require('sequelize');module[_0x8206('0x0')]={'name':{'type':Sequelize[_0x8206('0x1')],'allowNull':![],'unique':_0x8206('0x2')},'mode':{'type':Sequelize['ENUM'](_0x8206('0x3'),_0x8206('0x4'),_0x8206('0x5'),'quietmp3nb',_0x8206('0x6'),_0x8206('0x7')),'allowNull':!![],'defaultValue':_0x8206('0x4')},'directory':{'type':Sequelize[_0x8206('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x8206('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8206('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8206('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x8206('0x8')},'defaultEntry':{'type':Sequelize[_0x8206('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb51c=['BOOLEAN','sequelize','exports','STRING','ENUM','custom','files','mp3nb','quietmp3','mp3','alpha'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xb51c,0x9b));var _0xcb51=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xb51c[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xcb51('0x0'));module[_0xcb51('0x1')]={'name':{'type':Sequelize[_0xcb51('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xcb51('0x3')](_0xcb51('0x4'),_0xcb51('0x5'),_0xcb51('0x6'),'quietmp3nb',_0xcb51('0x7'),_0xcb51('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xcb51('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xcb51('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xcb51('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xcb51('0x2')],'allowNull':!![],'defaultValue':_0xcb51('0x9')},'format':{'type':Sequelize[_0xcb51('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xcb51('0xa')],'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 560e6af..71c3ce6 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 _0xc198=['intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','keys','find','body','params','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','addSound','Sound','save_name','converted_format','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','ValidationError','message','removeSound','id2','findOne','createdAt','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc198,0xb1));var _0x8c19=function(_0x5d1b83,_0x300e99){_0x5d1b83=_0x5d1b83-0x0;var _0x55a198=_0xc198[_0x5d1b83];return _0x55a198;};'use strict';var emlformat=require(_0x8c19('0x0'));var rimraf=require(_0x8c19('0x1'));var zipdir=require(_0x8c19('0x2'));var jsonpatch=require(_0x8c19('0x3'));var rp=require(_0x8c19('0x4'));var moment=require(_0x8c19('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c19('0x6'));var util=require(_0x8c19('0x7'));var path=require(_0x8c19('0x8'));var sox=require('sox');var csv=require(_0x8c19('0x9'));var ejs=require(_0x8c19('0xa'));var fs=require('fs');var fs_extra=require(_0x8c19('0xb'));var _=require('lodash');var squel=require(_0x8c19('0xc'));var crypto=require(_0x8c19('0xd'));var jsforce=require(_0x8c19('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8c19('0x9'));var querystring=require(_0x8c19('0xf'));var Papa=require(_0x8c19('0x10'));var Redis=require(_0x8c19('0x11'));var authService=require(_0x8c19('0x12'));var qs=require(_0x8c19('0x13'));var as=require(_0x8c19('0x14'));var hardwareService=require(_0x8c19('0x15'));var logger=require(_0x8c19('0x16'))(_0x8c19('0x17'));var utils=require(_0x8c19('0x18'));var config=require(_0x8c19('0x19'));var licenseUtil=require(_0x8c19('0x1a'));var db=require(_0x8c19('0x1b'))['db'];function respondWithStatusCode(_0x400e06,_0x2b3128){_0x2b3128=_0x2b3128||0xcc;return function(_0x323b73){if(_0x323b73){return _0x400e06[_0x8c19('0x1c')](_0x2b3128);}return _0x400e06[_0x8c19('0x1d')](_0x2b3128)[_0x8c19('0x1e')]();};}function respondWithResult(_0xbf40e1,_0x4823c1){_0x4823c1=_0x4823c1||0xc8;return function(_0x1b0ee5){if(_0x1b0ee5){return _0xbf40e1['status'](_0x4823c1)[_0x8c19('0x1f')](_0x1b0ee5);}};}function respondWithFilteredResult(_0x542ed0,_0x14997d){return function(_0x178142){if(_0x178142){var _0x3fa6a7=typeof _0x14997d[_0x8c19('0x20')]===_0x8c19('0x21')&&typeof _0x14997d[_0x8c19('0x22')]===_0x8c19('0x21');var _0x5169ed=_0x178142[_0x8c19('0x23')];var _0x341d8e=_0x3fa6a7?0x0:_0x14997d['offset'];var _0x49764a=_0x3fa6a7?_0x178142[_0x8c19('0x23')]:_0x14997d[_0x8c19('0x20')]+_0x14997d[_0x8c19('0x22')];var _0x430f3d;if(_0x49764a>=_0x5169ed){_0x49764a=_0x5169ed;_0x430f3d=0xc8;}else{_0x430f3d=0xce;}_0x542ed0['status'](_0x430f3d);return _0x542ed0[_0x8c19('0x24')]('Content-Range',_0x341d8e+'-'+_0x49764a+'/'+_0x5169ed)[_0x8c19('0x1f')](_0x178142);}return null;};}function patchUpdates(_0x2d6373){return function(_0x16ec11){try{jsonpatch[_0x8c19('0x25')](_0x16ec11,_0x2d6373,!![]);}catch(_0xdbbef7){return BPromise[_0x8c19('0x26')](_0xdbbef7);}return _0x16ec11['save']();};}function saveUpdates(_0x203516,_0x1aa4bc){return function(_0x2f7df2){if(_0x2f7df2){return _0x2f7df2[_0x8c19('0x27')](_0x203516)[_0x8c19('0x28')](function(_0x125c1a){return _0x125c1a;});}return null;};}function removeEntity(_0x47a2e0,_0x7d8a76){return function(_0x2440c1){if(_0x2440c1){return _0x2440c1[_0x8c19('0x29')]()['then'](function(){var _0x31e0bf=_0x2440c1[_0x8c19('0x2a')]({'plain':!![]});var _0x56307a=_0x8c19('0x2b');return db[_0x8c19('0x2c')][_0x8c19('0x29')]({'where':{'type':_0x56307a,'resourceId':_0x31e0bf['id']}})[_0x8c19('0x28')](function(){return _0x2440c1;});})['then'](function(){_0x47a2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x815914,_0x3462ac){return function(_0x3cd8d2){if(!_0x3cd8d2){_0x815914['sendStatus'](0x194);}return _0x3cd8d2;};}function handleError(_0x51a051,_0xc0f521){_0xc0f521=_0xc0f521||0x1f4;return function(_0x146d3e){logger[_0x8c19('0x2d')](_0x146d3e[_0x8c19('0x2e')]);if(_0x146d3e[_0x8c19('0x2f')]){delete _0x146d3e[_0x8c19('0x2f')];}_0x51a051['status'](_0xc0f521)[_0x8c19('0x30')](_0x146d3e);};}exports['index']=function(_0x556be8,_0x1a96f0){var _0x1e401c={},_0x506406={},_0x407709={'count':0x0,'rows':[]};var _0x4e3b70=_[_0x8c19('0x31')](db['VoiceMusicOnHold'][_0x8c19('0x32')],function(_0x581059){return{'name':_0x581059[_0x8c19('0x33')],'type':_0x581059[_0x8c19('0x34')][_0x8c19('0x35')]};});_0x506406[_0x8c19('0x36')]=_[_0x8c19('0x31')](_0x4e3b70,'name');_0x506406[_0x8c19('0x37')]=_['keys'](_0x556be8[_0x8c19('0x37')]);_0x506406[_0x8c19('0x38')]=_[_0x8c19('0x39')](_0x506406[_0x8c19('0x36')],_0x506406['query']);_0x1e401c['attributes']=_[_0x8c19('0x39')](_0x506406[_0x8c19('0x36')],qs['fields'](_0x556be8['query'][_0x8c19('0x3a')]));_0x1e401c['attributes']=_0x1e401c['attributes'][_0x8c19('0x3b')]?_0x1e401c[_0x8c19('0x3c')]:_0x506406['model'];if(!_0x556be8[_0x8c19('0x37')][_0x8c19('0x3d')](_0x8c19('0x3e'))){_0x1e401c[_0x8c19('0x22')]=qs[_0x8c19('0x22')](_0x556be8[_0x8c19('0x37')][_0x8c19('0x22')]);_0x1e401c[_0x8c19('0x20')]=qs[_0x8c19('0x20')](_0x556be8[_0x8c19('0x37')][_0x8c19('0x20')]);}_0x1e401c[_0x8c19('0x3f')]=qs[_0x8c19('0x40')](_0x556be8[_0x8c19('0x37')][_0x8c19('0x40')]);delete _0x556be8[_0x8c19('0x37')][_0x8c19('0x40')];_0x1e401c['where']=qs['filters'](_[_0x8c19('0x41')](_0x556be8[_0x8c19('0x37')],_0x506406[_0x8c19('0x38')]),_0x4e3b70);if(_0x556be8[_0x8c19('0x37')][_0x8c19('0x42')]){_0x1e401c[_0x8c19('0x43')]=_[_0x8c19('0x44')](_0x1e401c['where'],{'$or':_['map'](_0x4e3b70,function(_0x109866){if(_0x109866[_0x8c19('0x34')]!==_0x8c19('0x45')){var _0x2c660d={};_0x2c660d[_0x109866[_0x8c19('0x2f')]]={'$like':'%'+_0x556be8[_0x8c19('0x37')][_0x8c19('0x42')]+'%'};return _0x2c660d;}})});}_0x1e401c=_[_0x8c19('0x44')]({},_0x1e401c,_0x556be8[_0x8c19('0x46')]);var _0x597666={'where':_0x1e401c[_0x8c19('0x43')]};return db['VoiceMusicOnHold'][_0x8c19('0x23')](_0x597666)['then'](function(_0x3f9818){_0x407709[_0x8c19('0x23')]=_0x3f9818;if(_0x556be8['query'][_0x8c19('0x47')]){_0x1e401c[_0x8c19('0x48')]=[{'all':!![]}];}return db[_0x8c19('0x49')][_0x8c19('0x4a')](_0x1e401c);})['then'](function(_0x3cd3c4){_0x407709[_0x8c19('0x4b')]=_0x3cd3c4;return _0x407709;})['then'](respondWithFilteredResult(_0x1a96f0,_0x1e401c))[_0x8c19('0x4c')](handleError(_0x1a96f0,null));};exports['show']=function(_0xcb2538,_0x59530e){var _0x35cd66={'raw':![],'where':{'id':_0xcb2538['params']['id']}},_0x12730b={};_0x12730b[_0x8c19('0x36')]=_['keys'](db[_0x8c19('0x49')][_0x8c19('0x32')]);_0x12730b[_0x8c19('0x37')]=_[_0x8c19('0x4d')](_0xcb2538[_0x8c19('0x37')]);_0x12730b['filters']=_[_0x8c19('0x39')](_0x12730b[_0x8c19('0x36')],_0x12730b[_0x8c19('0x37')]);_0x35cd66[_0x8c19('0x3c')]=_[_0x8c19('0x39')](_0x12730b[_0x8c19('0x36')],qs['fields'](_0xcb2538[_0x8c19('0x37')]['fields']));_0x35cd66[_0x8c19('0x3c')]=_0x35cd66['attributes']['length']?_0x35cd66[_0x8c19('0x3c')]:_0x12730b[_0x8c19('0x36')];if(_0xcb2538[_0x8c19('0x37')][_0x8c19('0x47')]){_0x35cd66[_0x8c19('0x48')]=[{'all':!![]}];}_0x35cd66=_[_0x8c19('0x44')]({},_0x35cd66,_0xcb2538[_0x8c19('0x46')]);return db[_0x8c19('0x49')][_0x8c19('0x4e')](_0x35cd66)[_0x8c19('0x28')](handleEntityNotFound(_0x59530e,null))[_0x8c19('0x28')](respondWithResult(_0x59530e,null))[_0x8c19('0x4c')](handleError(_0x59530e,null));};exports[_0x8c19('0x27')]=function(_0x3173d4,_0x43efb6){if(_0x3173d4[_0x8c19('0x4f')]['id']){delete _0x3173d4[_0x8c19('0x4f')]['id'];}return db[_0x8c19('0x49')][_0x8c19('0x4e')]({'where':{'id':_0x3173d4[_0x8c19('0x50')]['id']}})[_0x8c19('0x28')](handleEntityNotFound(_0x43efb6,null))[_0x8c19('0x28')](saveUpdates(_0x3173d4[_0x8c19('0x4f')],null))[_0x8c19('0x28')](respondWithResult(_0x43efb6,null))[_0x8c19('0x4c')](handleError(_0x43efb6,null));};exports[_0x8c19('0x51')]=function(_0x782b2,_0x1c9c28,_0x862f9c){return db[_0x8c19('0x52')][_0x8c19('0x53')](function(_0x41a975){if(_0x782b2[_0x8c19('0x4f')][_0x8c19('0x54')]===_0x8c19('0x55')){_0x782b2[_0x8c19('0x4f')][_0x8c19('0x56')]=path[_0x8c19('0x57')](config[_0x8c19('0x58')],_0x8c19('0x59'),_0x782b2['body'][_0x8c19('0x2f')]);}return db[_0x8c19('0x49')][_0x8c19('0x51')](_0x782b2['body'],{'transaction':_0x41a975})[_0x8c19('0x28')](function(_0x1c40ad){if(_0x782b2[_0x8c19('0x4f')][_0x8c19('0x54')]==='files'){fs[_0x8c19('0x5a')](_0x1c40ad['directory'],parseInt(_0x8c19('0x5b'),0x8));}var _0x39470e=_0x782b2['user'][_0x8c19('0x2a')]({'plain':!![]});if(!_0x39470e)throw new Error(_0x8c19('0x5c'));if(_0x39470e[_0x8c19('0x5d')]==='user'){var _0x5ab7bd=_0x1c40ad[_0x8c19('0x2a')]({'plain':!![]});return db[_0x8c19('0x5e')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x39470e['userProfileId']},'raw':!![]})[_0x8c19('0x28')](function(_0x2d4b1a){if(_0x2d4b1a&&_0x2d4b1a[_0x8c19('0x5f')]===0x0){return db[_0x8c19('0x2c')]['create']({'name':_0x5ab7bd[_0x8c19('0x2f')],'resourceId':_0x5ab7bd['id'],'type':_0x2d4b1a[_0x8c19('0x2f')],'sectionId':_0x2d4b1a['id']},{})[_0x8c19('0x28')](function(){return _0x1c40ad;});}else{return _0x1c40ad;}})[_0x8c19('0x4c')](function(_0x40b9a4){logger[_0x8c19('0x2d')](_0x8c19('0x60'),_0x40b9a4);});}return _0x1c40ad;});})['then'](respondWithResult(_0x1c9c28,0xc9))[_0x8c19('0x4c')](handleError(_0x1c9c28,null));};exports[_0x8c19('0x29')]=function(_0x1d1313,_0x98f440,_0x47ccb5){var _0x44f20e;return db[_0x8c19('0x49')]['find']({'where':{'id':_0x1d1313[_0x8c19('0x50')]['id']}})[_0x8c19('0x28')](function(_0x1fd8b9){if(_0x1fd8b9){return db[_0x8c19('0x52')]['transaction'](function(_0x1c8e66){return _0x1fd8b9[_0x8c19('0x29')]({'transaction':_0x1c8e66,'raw':!![]})[_0x8c19('0x28')](function(_0x5534ff){if(_0x5534ff[_0x8c19('0x56')]){fs[_0x8c19('0x61')](_0x5534ff[_0x8c19('0x56')])['forEach'](function(_0x37f24f){fs[_0x8c19('0x62')](path[_0x8c19('0x57')](_0x5534ff['directory'],_0x37f24f));});fs[_0x8c19('0x63')](_0x5534ff[_0x8c19('0x56')]);}return _0x5534ff;});})[_0x8c19('0x4c')](function(_0xf81bcd){throw new db[(_0x8c19('0x64'))]['ValidationError'](_0xf81bcd['message']);});}})['then'](handleEntityNotFound(_0x98f440,null))[_0x8c19('0x28')](removeEntity(_0x98f440,null))['catch'](handleError(_0x98f440,null));};exports[_0x8c19('0x65')]=function(_0xe7a7,_0x3194ca,_0x4cefdb){return db[_0x8c19('0x52')][_0x8c19('0x53')](function(_0x356584){var _0x4562c5;return db['VoiceMusicOnHold']['find']({'where':{'id':_0xe7a7['params']['id']}})[_0x8c19('0x28')](function(_0x5a574e){if(_0x5a574e){_0x4562c5=_0x5a574e;return _0x5a574e[_0x8c19('0x65')](_0xe7a7[_0x8c19('0x4f')]['id'],{'transaction':_0x356584});}})[_0x8c19('0x28')](function(_0x554a69){if(_0x554a69){return db[_0x8c19('0x66')]['findOne']({'where':{'id':_0xe7a7[_0x8c19('0x4f')]['id']},'attributes':['id',_0x8c19('0x2f'),_0x8c19('0x67'),_0x8c19('0x68'),'createdAt'],'raw':!![]});}})[_0x8c19('0x28')](function(_0x375532){if(_0x375532){var _0x588d71=path[_0x8c19('0x57')](config[_0x8c19('0x58')],_0x8c19('0x69'),util[_0x8c19('0x6a')](_0x8c19('0x6b'),path['basename'](_0x375532[_0x8c19('0x67')],path[_0x8c19('0x6c')](_0x375532[_0x8c19('0x67')])),_0x375532[_0x8c19('0x68')]));var _0x5b70e6=path[_0x8c19('0x57')](config[_0x8c19('0x58')],_0x8c19('0x59'),_0x4562c5[_0x8c19('0x2f')],util[_0x8c19('0x6a')](_0x8c19('0x6b'),_0x375532['name'],_0x375532['converted_format']));fs[_0x8c19('0x6d')](_0x588d71,_0x5b70e6);return _0x375532;}})[_0x8c19('0x4c')](function(_0x126702){throw new db[(_0x8c19('0x64'))][(_0x8c19('0x6e'))](_0x126702[_0x8c19('0x6f')]);});})['then'](handleEntityNotFound(_0x3194ca,null))[_0x8c19('0x28')](respondWithResult(_0x3194ca,0xc9))['catch'](handleError(_0x3194ca,null));};exports[_0x8c19('0x70')]=function(_0x1019f8,_0x30b7c6,_0x3ae9ea){return db[_0x8c19('0x52')][_0x8c19('0x53')](function(_0x536577){var _0x17cc59;return db[_0x8c19('0x49')]['findOne']({'where':{'id':_0x1019f8['params']['id']}})[_0x8c19('0x28')](handleEntityNotFound(_0x30b7c6,null))['then'](function(_0x36f5a6){if(_0x36f5a6){_0x17cc59=_0x36f5a6;return _0x36f5a6[_0x8c19('0x70')](_0x1019f8[_0x8c19('0x50')][_0x8c19('0x71')]);}})[_0x8c19('0x28')](function(_0x3e7640){if(_0x3e7640){return db[_0x8c19('0x66')][_0x8c19('0x72')]({'where':{'id':_0x1019f8['params'][_0x8c19('0x71')]},'attributes':['id',_0x8c19('0x2f'),_0x8c19('0x67'),_0x8c19('0x68'),_0x8c19('0x73')],'raw':!![]});}})[_0x8c19('0x28')](function(_0x5ad067){if(_0x5ad067){fs[_0x8c19('0x62')](path[_0x8c19('0x57')](_0x17cc59[_0x8c19('0x56')],util[_0x8c19('0x6a')](_0x8c19('0x6b'),_0x5ad067[_0x8c19('0x2f')],_0x5ad067['converted_format'])));return _0x5ad067;}})[_0x8c19('0x4c')](function(_0x59d503){throw new db[(_0x8c19('0x64'))][(_0x8c19('0x6e'))](_0x59d503['message']);});})[_0x8c19('0x28')](handleEntityNotFound(_0x30b7c6,null))[_0x8c19('0x28')](respondWithStatusCode(_0x30b7c6,0xcc))[_0x8c19('0x4c')](handleError(_0x30b7c6,null));};exports['getSounds']=function(_0x46643a,_0x5114a4,_0xdd32e1){var _0x10ef86={};var _0x5e5c99={};var _0x132855;var _0x2b4ba2;return db['VoiceMusicOnHold'][_0x8c19('0x72')]({'where':{'id':_0x46643a[_0x8c19('0x50')]['id']}})['then'](handleEntityNotFound(_0x5114a4,null))[_0x8c19('0x28')](function(_0x3dfcce){if(_0x3dfcce){_0x132855=_0x3dfcce;_0x5e5c99[_0x8c19('0x36')]=_[_0x8c19('0x4d')](db[_0x8c19('0x66')][_0x8c19('0x32')]);_0x5e5c99[_0x8c19('0x37')]=_[_0x8c19('0x4d')](_0x46643a[_0x8c19('0x37')]);_0x5e5c99[_0x8c19('0x38')]=_[_0x8c19('0x39')](_0x5e5c99[_0x8c19('0x36')],_0x5e5c99[_0x8c19('0x37')]);_0x10ef86[_0x8c19('0x3c')]=_[_0x8c19('0x39')](_0x5e5c99[_0x8c19('0x36')],qs[_0x8c19('0x3a')](_0x46643a[_0x8c19('0x37')][_0x8c19('0x3a')]));_0x10ef86[_0x8c19('0x3c')]=_0x10ef86[_0x8c19('0x3c')][_0x8c19('0x3b')]?_0x10ef86[_0x8c19('0x3c')]:_0x5e5c99['model'];_0x10ef86[_0x8c19('0x3f')]=qs[_0x8c19('0x40')](_0x46643a[_0x8c19('0x37')][_0x8c19('0x40')]);_0x10ef86[_0x8c19('0x43')]=qs[_0x8c19('0x38')](_[_0x8c19('0x41')](_0x46643a['query'],_0x5e5c99['filters']));if(_0x46643a[_0x8c19('0x37')]['filter']){_0x10ef86['where']=_[_0x8c19('0x44')](_0x10ef86[_0x8c19('0x43')],{'$or':_[_0x8c19('0x31')](_0x10ef86[_0x8c19('0x3c')],function(_0x55ca1c){var _0x58c14a={};_0x58c14a[_0x55ca1c]={'$like':'%'+_0x46643a[_0x8c19('0x37')][_0x8c19('0x42')]+'%'};return _0x58c14a;})});}_0x10ef86=_[_0x8c19('0x44')]({},_0x10ef86,_0x46643a[_0x8c19('0x46')]);return _0x132855['getSounds'](_0x10ef86);}})[_0x8c19('0x28')](function(_0x1d880d){if(_0x1d880d){_0x2b4ba2=_0x1d880d[_0x8c19('0x3b')];if(!_0x46643a[_0x8c19('0x37')][_0x8c19('0x3d')](_0x8c19('0x3e'))){_0x10ef86[_0x8c19('0x22')]=qs[_0x8c19('0x22')](_0x46643a[_0x8c19('0x37')][_0x8c19('0x22')]);_0x10ef86[_0x8c19('0x20')]=qs[_0x8c19('0x20')](_0x46643a[_0x8c19('0x37')][_0x8c19('0x20')]);}return _0x132855[_0x8c19('0x74')](_0x10ef86);}})[_0x8c19('0x28')](function(_0x270ecb){if(_0x270ecb){return _0x270ecb?{'count':_0x2b4ba2,'rows':_0x270ecb}:null;}})[_0x8c19('0x28')](respondWithResult(_0x5114a4,null))[_0x8c19('0x4c')](handleError(_0x5114a4,null));}; \ No newline at end of file +var _0x54ee=['directory','join','root','server/files/moh','files','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','transaction','forEach','rmdirSync','message','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','Sequelize','removeSound','findOne','Sound','id2','unlinkSync','getSounds','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find','body','create','sequelize','mode'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x54ee,0x102));var _0xe54e=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x54ee[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0xe54e('0x0'));var rimraf=require(_0xe54e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe54e('0x2'));var rp=require(_0xe54e('0x3'));var moment=require('moment');var BPromise=require(_0xe54e('0x4'));var Mustache=require('mustache');var util=require(_0xe54e('0x5'));var path=require('path');var sox=require(_0xe54e('0x6'));var csv=require('to-csv');var ejs=require(_0xe54e('0x7'));var fs=require('fs');var fs_extra=require(_0xe54e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe54e('0x9'));var jsforce=require(_0xe54e('0xa'));var deskjs=require(_0xe54e('0xb'));var toCsv=require(_0xe54e('0xc'));var querystring=require('querystring');var Papa=require(_0xe54e('0xd'));var Redis=require(_0xe54e('0xe'));var authService=require(_0xe54e('0xf'));var qs=require(_0xe54e('0x10'));var as=require(_0xe54e('0x11'));var hardwareService=require(_0xe54e('0x12'));var logger=require(_0xe54e('0x13'))(_0xe54e('0x14'));var utils=require('../../config/utils');var config=require(_0xe54e('0x15'));var licenseUtil=require(_0xe54e('0x16'));var db=require(_0xe54e('0x17'))['db'];function respondWithStatusCode(_0x180ea1,_0x495c0e){_0x495c0e=_0x495c0e||0xcc;return function(_0x43a2ab){if(_0x43a2ab){return _0x180ea1[_0xe54e('0x18')](_0x495c0e);}return _0x180ea1[_0xe54e('0x19')](_0x495c0e)[_0xe54e('0x1a')]();};}function respondWithResult(_0x5bd343,_0x3439c5){_0x3439c5=_0x3439c5||0xc8;return function(_0x429325){if(_0x429325){return _0x5bd343[_0xe54e('0x19')](_0x3439c5)[_0xe54e('0x1b')](_0x429325);}};}function respondWithFilteredResult(_0x40da46,_0x237850){return function(_0x4e9b8f){if(_0x4e9b8f){var _0x813999=typeof _0x237850['offset']===_0xe54e('0x1c')&&typeof _0x237850[_0xe54e('0x1d')]===_0xe54e('0x1c');var _0xb631a9=_0x4e9b8f[_0xe54e('0x1e')];var _0x419fb5=_0x813999?0x0:_0x237850[_0xe54e('0x1f')];var _0x38bf91=_0x813999?_0x4e9b8f[_0xe54e('0x1e')]:_0x237850['offset']+_0x237850[_0xe54e('0x1d')];var _0x4caccf;if(_0x38bf91>=_0xb631a9){_0x38bf91=_0xb631a9;_0x4caccf=0xc8;}else{_0x4caccf=0xce;}_0x40da46[_0xe54e('0x19')](_0x4caccf);return _0x40da46['set'](_0xe54e('0x20'),_0x419fb5+'-'+_0x38bf91+'/'+_0xb631a9)[_0xe54e('0x1b')](_0x4e9b8f);}return null;};}function patchUpdates(_0x2a87fd){return function(_0x4840ec){try{jsonpatch[_0xe54e('0x21')](_0x4840ec,_0x2a87fd,!![]);}catch(_0x19b6b6){return BPromise[_0xe54e('0x22')](_0x19b6b6);}return _0x4840ec[_0xe54e('0x23')]();};}function saveUpdates(_0x5abf98,_0x2af723){return function(_0x3e3bdb){if(_0x3e3bdb){return _0x3e3bdb[_0xe54e('0x24')](_0x5abf98)['then'](function(_0x38ba1e){return _0x38ba1e;});}return null;};}function removeEntity(_0x2a3048,_0x497603){return function(_0x3a4f2f){if(_0x3a4f2f){return _0x3a4f2f[_0xe54e('0x25')]()[_0xe54e('0x26')](function(){var _0xbf2094=_0x3a4f2f[_0xe54e('0x27')]({'plain':!![]});var _0x49f11c=_0xe54e('0x28');return db[_0xe54e('0x29')][_0xe54e('0x25')]({'where':{'type':_0x49f11c,'resourceId':_0xbf2094['id']}})[_0xe54e('0x26')](function(){return _0x3a4f2f;});})[_0xe54e('0x26')](function(){_0x2a3048['status'](0xcc)[_0xe54e('0x1a')]();});}};}function handleEntityNotFound(_0x4bd15e,_0x5b15ad){return function(_0x225623){if(!_0x225623){_0x4bd15e[_0xe54e('0x18')](0x194);}return _0x225623;};}function handleError(_0x3f6320,_0x1c427d){_0x1c427d=_0x1c427d||0x1f4;return function(_0x1355ca){logger[_0xe54e('0x2a')](_0x1355ca[_0xe54e('0x2b')]);if(_0x1355ca[_0xe54e('0x2c')]){delete _0x1355ca['name'];}_0x3f6320[_0xe54e('0x19')](_0x1c427d)[_0xe54e('0x2d')](_0x1355ca);};}exports['index']=function(_0x338232,_0x23cddc){var _0x34bb45={},_0xc587fc={},_0x2725f6={'count':0x0,'rows':[]};var _0x316c02=_[_0xe54e('0x2e')](db[_0xe54e('0x2f')][_0xe54e('0x30')],function(_0x1266c3){return{'name':_0x1266c3['fieldName'],'type':_0x1266c3[_0xe54e('0x31')][_0xe54e('0x32')]};});_0xc587fc[_0xe54e('0x33')]=_[_0xe54e('0x2e')](_0x316c02,_0xe54e('0x2c'));_0xc587fc[_0xe54e('0x34')]=_[_0xe54e('0x35')](_0x338232[_0xe54e('0x34')]);_0xc587fc[_0xe54e('0x36')]=_['intersection'](_0xc587fc['model'],_0xc587fc['query']);_0x34bb45['attributes']=_[_0xe54e('0x37')](_0xc587fc[_0xe54e('0x33')],qs['fields'](_0x338232[_0xe54e('0x34')][_0xe54e('0x38')]));_0x34bb45[_0xe54e('0x39')]=_0x34bb45[_0xe54e('0x39')]['length']?_0x34bb45[_0xe54e('0x39')]:_0xc587fc[_0xe54e('0x33')];if(!_0x338232['query'][_0xe54e('0x3a')](_0xe54e('0x3b'))){_0x34bb45[_0xe54e('0x1d')]=qs['limit'](_0x338232[_0xe54e('0x34')][_0xe54e('0x1d')]);_0x34bb45[_0xe54e('0x1f')]=qs['offset'](_0x338232[_0xe54e('0x34')][_0xe54e('0x1f')]);}_0x34bb45[_0xe54e('0x3c')]=qs[_0xe54e('0x3d')](_0x338232['query'][_0xe54e('0x3d')]);delete _0x338232[_0xe54e('0x34')][_0xe54e('0x3d')];_0x34bb45[_0xe54e('0x3e')]=qs[_0xe54e('0x36')](_[_0xe54e('0x3f')](_0x338232['query'],_0xc587fc[_0xe54e('0x36')]),_0x316c02);if(_0x338232[_0xe54e('0x34')][_0xe54e('0x40')]){_0x34bb45[_0xe54e('0x3e')]=_[_0xe54e('0x41')](_0x34bb45[_0xe54e('0x3e')],{'$or':_[_0xe54e('0x2e')](_0x316c02,function(_0x1e76e2){if(_0x1e76e2['type']!==_0xe54e('0x42')){var _0x55c9e7={};_0x55c9e7[_0x1e76e2[_0xe54e('0x2c')]]={'$like':'%'+_0x338232[_0xe54e('0x34')]['filter']+'%'};return _0x55c9e7;}})});}_0x34bb45=_['merge']({},_0x34bb45,_0x338232['options']);var _0x26edef={'where':_0x34bb45[_0xe54e('0x3e')]};return db[_0xe54e('0x2f')]['count'](_0x26edef)[_0xe54e('0x26')](function(_0x2a0656){_0x2725f6[_0xe54e('0x1e')]=_0x2a0656;if(_0x338232[_0xe54e('0x34')][_0xe54e('0x43')]){_0x34bb45['include']=[{'all':!![]}];}return db[_0xe54e('0x2f')][_0xe54e('0x44')](_0x34bb45);})['then'](function(_0xc38f44){_0x2725f6[_0xe54e('0x45')]=_0xc38f44;return _0x2725f6;})['then'](respondWithFilteredResult(_0x23cddc,_0x34bb45))[_0xe54e('0x46')](handleError(_0x23cddc,null));};exports[_0xe54e('0x47')]=function(_0x1c223b,_0x9604c5){var _0x47e53f={'raw':![],'where':{'id':_0x1c223b[_0xe54e('0x48')]['id']}},_0x360442={};_0x360442[_0xe54e('0x33')]=_[_0xe54e('0x35')](db[_0xe54e('0x2f')][_0xe54e('0x30')]);_0x360442[_0xe54e('0x34')]=_[_0xe54e('0x35')](_0x1c223b['query']);_0x360442[_0xe54e('0x36')]=_[_0xe54e('0x37')](_0x360442['model'],_0x360442[_0xe54e('0x34')]);_0x47e53f[_0xe54e('0x39')]=_[_0xe54e('0x37')](_0x360442[_0xe54e('0x33')],qs[_0xe54e('0x38')](_0x1c223b[_0xe54e('0x34')][_0xe54e('0x38')]));_0x47e53f[_0xe54e('0x39')]=_0x47e53f[_0xe54e('0x39')][_0xe54e('0x49')]?_0x47e53f[_0xe54e('0x39')]:_0x360442[_0xe54e('0x33')];if(_0x1c223b[_0xe54e('0x34')][_0xe54e('0x43')]){_0x47e53f[_0xe54e('0x4a')]=[{'all':!![]}];}_0x47e53f=_[_0xe54e('0x41')]({},_0x47e53f,_0x1c223b[_0xe54e('0x4b')]);return db[_0xe54e('0x2f')][_0xe54e('0x4c')](_0x47e53f)[_0xe54e('0x26')](handleEntityNotFound(_0x9604c5,null))[_0xe54e('0x26')](respondWithResult(_0x9604c5,null))['catch'](handleError(_0x9604c5,null));};exports[_0xe54e('0x24')]=function(_0x2707a2,_0x4f2377){if(_0x2707a2['body']['id']){delete _0x2707a2[_0xe54e('0x4d')]['id'];}return db[_0xe54e('0x2f')][_0xe54e('0x4c')]({'where':{'id':_0x2707a2[_0xe54e('0x48')]['id']}})[_0xe54e('0x26')](handleEntityNotFound(_0x4f2377,null))['then'](saveUpdates(_0x2707a2[_0xe54e('0x4d')],null))[_0xe54e('0x26')](respondWithResult(_0x4f2377,null))[_0xe54e('0x46')](handleError(_0x4f2377,null));};exports[_0xe54e('0x4e')]=function(_0x1f07d1,_0x2295c0,_0x3a0462){return db[_0xe54e('0x4f')]['transaction'](function(_0x3bb942){if(_0x1f07d1[_0xe54e('0x4d')][_0xe54e('0x50')]==='files'){_0x1f07d1[_0xe54e('0x4d')][_0xe54e('0x51')]=path[_0xe54e('0x52')](config[_0xe54e('0x53')],_0xe54e('0x54'),_0x1f07d1[_0xe54e('0x4d')][_0xe54e('0x2c')]);}return db[_0xe54e('0x2f')]['create'](_0x1f07d1[_0xe54e('0x4d')],{'transaction':_0x3bb942})['then'](function(_0x4afcdb){if(_0x1f07d1[_0xe54e('0x4d')]['mode']===_0xe54e('0x55')){fs['mkdirSync'](_0x4afcdb[_0xe54e('0x51')],parseInt(_0xe54e('0x56'),0x8));}var _0x43821f=_0x1f07d1['user'][_0xe54e('0x27')]({'plain':!![]});if(!_0x43821f)throw new Error(_0xe54e('0x57'));if(_0x43821f[_0xe54e('0x58')]==='user'){var _0x15eb3a=_0x4afcdb[_0xe54e('0x27')]({'plain':!![]});return db[_0xe54e('0x59')]['find']({'where':{'name':_0xe54e('0x28'),'userProfileId':_0x43821f[_0xe54e('0x5a')]},'raw':!![]})['then'](function(_0x3fbba4){if(_0x3fbba4&&_0x3fbba4[_0xe54e('0x5b')]===0x0){return db[_0xe54e('0x29')]['create']({'name':_0x15eb3a['name'],'resourceId':_0x15eb3a['id'],'type':_0x3fbba4[_0xe54e('0x2c')],'sectionId':_0x3fbba4['id']},{})[_0xe54e('0x26')](function(){return _0x4afcdb;});}else{return _0x4afcdb;}})[_0xe54e('0x46')](function(_0x4d5f84){logger[_0xe54e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d5f84);});}return _0x4afcdb;});})[_0xe54e('0x26')](respondWithResult(_0x2295c0,0xc9))[_0xe54e('0x46')](handleError(_0x2295c0,null));};exports[_0xe54e('0x25')]=function(_0x31faa6,_0x39beb,_0x32cdf1){var _0x3d1fb6;return db[_0xe54e('0x2f')][_0xe54e('0x4c')]({'where':{'id':_0x31faa6[_0xe54e('0x48')]['id']}})['then'](function(_0x135af0){if(_0x135af0){return db[_0xe54e('0x4f')][_0xe54e('0x5c')](function(_0x952b93){return _0x135af0['destroy']({'transaction':_0x952b93,'raw':!![]})[_0xe54e('0x26')](function(_0x206940){if(_0x206940[_0xe54e('0x51')]){fs['readdirSync'](_0x206940[_0xe54e('0x51')])[_0xe54e('0x5d')](function(_0x4b825b){fs['unlinkSync'](path[_0xe54e('0x52')](_0x206940[_0xe54e('0x51')],_0x4b825b));});fs[_0xe54e('0x5e')](_0x206940[_0xe54e('0x51')]);}return _0x206940;});})[_0xe54e('0x46')](function(_0x3b81c9){throw new db['Sequelize']['ValidationError'](_0x3b81c9[_0xe54e('0x5f')]);});}})['then'](handleEntityNotFound(_0x39beb,null))[_0xe54e('0x26')](removeEntity(_0x39beb,null))[_0xe54e('0x46')](handleError(_0x39beb,null));};exports[_0xe54e('0x60')]=function(_0x3aa743,_0x3e8ed5,_0x1079d2){return db[_0xe54e('0x4f')][_0xe54e('0x5c')](function(_0x392120){var _0x8ddfd0;return db[_0xe54e('0x2f')]['find']({'where':{'id':_0x3aa743[_0xe54e('0x48')]['id']}})['then'](function(_0x2224b7){if(_0x2224b7){_0x8ddfd0=_0x2224b7;return _0x2224b7[_0xe54e('0x60')](_0x3aa743[_0xe54e('0x4d')]['id'],{'transaction':_0x392120});}})['then'](function(_0x295d1d){if(_0x295d1d){return db['Sound']['findOne']({'where':{'id':_0x3aa743[_0xe54e('0x4d')]['id']},'attributes':['id',_0xe54e('0x2c'),_0xe54e('0x61'),_0xe54e('0x62'),_0xe54e('0x63')],'raw':!![]});}})[_0xe54e('0x26')](function(_0x27f313){if(_0x27f313){var _0x426a64=path[_0xe54e('0x52')](config[_0xe54e('0x53')],_0xe54e('0x64'),util['format'](_0xe54e('0x65'),path[_0xe54e('0x66')](_0x27f313[_0xe54e('0x61')],path[_0xe54e('0x67')](_0x27f313['save_name'])),_0x27f313['converted_format']));var _0x4c4c30=path[_0xe54e('0x52')](config[_0xe54e('0x53')],_0xe54e('0x54'),_0x8ddfd0[_0xe54e('0x2c')],util[_0xe54e('0x68')](_0xe54e('0x65'),_0x27f313[_0xe54e('0x2c')],_0x27f313[_0xe54e('0x62')]));fs[_0xe54e('0x69')](_0x426a64,_0x4c4c30);return _0x27f313;}})[_0xe54e('0x46')](function(_0x38c5a7){throw new db[(_0xe54e('0x6a'))]['ValidationError'](_0x38c5a7[_0xe54e('0x5f')]);});})['then'](handleEntityNotFound(_0x3e8ed5,null))['then'](respondWithResult(_0x3e8ed5,0xc9))['catch'](handleError(_0x3e8ed5,null));};exports[_0xe54e('0x6b')]=function(_0x77ece9,_0x13cbf8,_0x201dfb){return db['sequelize']['transaction'](function(_0x4e275b){var _0x1e4f75;return db['VoiceMusicOnHold'][_0xe54e('0x6c')]({'where':{'id':_0x77ece9['params']['id']}})['then'](handleEntityNotFound(_0x13cbf8,null))[_0xe54e('0x26')](function(_0x24743c){if(_0x24743c){_0x1e4f75=_0x24743c;return _0x24743c[_0xe54e('0x6b')](_0x77ece9['params']['id2']);}})[_0xe54e('0x26')](function(_0xf42d78){if(_0xf42d78){return db[_0xe54e('0x6d')]['findOne']({'where':{'id':_0x77ece9[_0xe54e('0x48')][_0xe54e('0x6e')]},'attributes':['id','name',_0xe54e('0x61'),_0xe54e('0x62'),_0xe54e('0x63')],'raw':!![]});}})[_0xe54e('0x26')](function(_0x21f3a3){if(_0x21f3a3){fs[_0xe54e('0x6f')](path['join'](_0x1e4f75['directory'],util[_0xe54e('0x68')](_0xe54e('0x65'),_0x21f3a3[_0xe54e('0x2c')],_0x21f3a3[_0xe54e('0x62')])));return _0x21f3a3;}})['catch'](function(_0x992484){throw new db[(_0xe54e('0x6a'))]['ValidationError'](_0x992484[_0xe54e('0x5f')]);});})[_0xe54e('0x26')](handleEntityNotFound(_0x13cbf8,null))[_0xe54e('0x26')](respondWithStatusCode(_0x13cbf8,0xcc))[_0xe54e('0x46')](handleError(_0x13cbf8,null));};exports[_0xe54e('0x70')]=function(_0x1ac16e,_0x53966f,_0xe02a4c){var _0x10bb49={};var _0x29ec92={};var _0x3fee5;var _0x35d50a;return db['VoiceMusicOnHold'][_0xe54e('0x6c')]({'where':{'id':_0x1ac16e[_0xe54e('0x48')]['id']}})[_0xe54e('0x26')](handleEntityNotFound(_0x53966f,null))[_0xe54e('0x26')](function(_0x41506b){if(_0x41506b){_0x3fee5=_0x41506b;_0x29ec92['model']=_[_0xe54e('0x35')](db['Sound'][_0xe54e('0x30')]);_0x29ec92['query']=_['keys'](_0x1ac16e[_0xe54e('0x34')]);_0x29ec92[_0xe54e('0x36')]=_[_0xe54e('0x37')](_0x29ec92['model'],_0x29ec92[_0xe54e('0x34')]);_0x10bb49[_0xe54e('0x39')]=_[_0xe54e('0x37')](_0x29ec92[_0xe54e('0x33')],qs['fields'](_0x1ac16e['query'][_0xe54e('0x38')]));_0x10bb49[_0xe54e('0x39')]=_0x10bb49['attributes'][_0xe54e('0x49')]?_0x10bb49[_0xe54e('0x39')]:_0x29ec92[_0xe54e('0x33')];_0x10bb49[_0xe54e('0x3c')]=qs[_0xe54e('0x3d')](_0x1ac16e[_0xe54e('0x34')][_0xe54e('0x3d')]);_0x10bb49['where']=qs['filters'](_['pick'](_0x1ac16e['query'],_0x29ec92[_0xe54e('0x36')]));if(_0x1ac16e[_0xe54e('0x34')][_0xe54e('0x40')]){_0x10bb49['where']=_[_0xe54e('0x41')](_0x10bb49[_0xe54e('0x3e')],{'$or':_[_0xe54e('0x2e')](_0x10bb49['attributes'],function(_0x2812cc){var _0xd2f7a1={};_0xd2f7a1[_0x2812cc]={'$like':'%'+_0x1ac16e[_0xe54e('0x34')]['filter']+'%'};return _0xd2f7a1;})});}_0x10bb49=_[_0xe54e('0x41')]({},_0x10bb49,_0x1ac16e[_0xe54e('0x4b')]);return _0x3fee5[_0xe54e('0x70')](_0x10bb49);}})[_0xe54e('0x26')](function(_0x125ccf){if(_0x125ccf){_0x35d50a=_0x125ccf[_0xe54e('0x49')];if(!_0x1ac16e[_0xe54e('0x34')][_0xe54e('0x3a')]('nolimit')){_0x10bb49['limit']=qs[_0xe54e('0x1d')](_0x1ac16e['query'][_0xe54e('0x1d')]);_0x10bb49[_0xe54e('0x1f')]=qs['offset'](_0x1ac16e[_0xe54e('0x34')][_0xe54e('0x1f')]);}return _0x3fee5[_0xe54e('0x70')](_0x10bb49);}})[_0xe54e('0x26')](function(_0x3560ac){if(_0x3560ac){return _0x3560ac?{'count':_0x35d50a,'rows':_0x3560ac}:null;}})[_0xe54e('0x26')](respondWithResult(_0x53966f,null))[_0xe54e('0x46')](handleError(_0x53966f,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 97f2281..8066289 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 _0x7740=['VoiceMusicOnHold','voice_musiconhold','util','api','request-promise','rimraf','exports'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0x7740,0x1c2));var _0x0774=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x7740[_0x168127];return _0x4c99ad;};'use strict';var _=require('lodash');var util=require(_0x0774('0x0'));var logger=require('../../config/logger')(_0x0774('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0774('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0774('0x3'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x0774('0x4')]=function(_0x11b820,_0x283602){return _0x11b820['define'](_0x0774('0x5'),attributes,{'tableName':_0x0774('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x525e=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x226896,_0x427637){var _0x5a8b4c=function(_0x3eb2b7){while(--_0x3eb2b7){_0x226896['push'](_0x226896['shift']());}};_0x5a8b4c(++_0x427637);}(_0x525e,0x178));var _0xe525=function(_0x2a52a1,_0x4c9abb){_0x2a52a1=_0x2a52a1-0x0;var _0xe4ced3=_0x525e[_0x2a52a1];return _0xe4ced3;};'use strict';var _=require(_0xe525('0x0'));var util=require('util');var logger=require(_0xe525('0x1'))(_0xe525('0x2'));var moment=require(_0xe525('0x3'));var BPromise=require(_0xe525('0x4'));var rp=require(_0xe525('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe525('0x6'));var config=require(_0xe525('0x7'));var attributes=require(_0xe525('0x8'));module[_0xe525('0x9')]=function(_0x529173,_0x5785e5){return _0x529173[_0xe525('0xa')](_0xe525('0xb'),attributes,{'tableName':_0xe525('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index c3cba89..c644507 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(_0x2f2d8a,_0x423e62){var _0x304e9e=function(_0x348bbf){while(--_0x348bbf){_0x2f2d8a['push'](_0x2f2d8a['shift']());}};_0x304e9e(++_0x423e62);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0xcb91[_0x2d460c];return _0xf6fc4c;};'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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x839f60,_0x2fece3){var _0x2f3f4e=function(_0x481bda){while(--_0x481bda){_0x839f60['push'](_0x839f60['shift']());}};_0x2f3f4e(++_0x2fece3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a7103f0..4fa6e3f 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 _0xa915=['removeAgents','removeTeams','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','create','post','addTeams','update','destroy','delete'];(function(_0x41319a,_0x13d5d2){var _0x2d63f0=function(_0x42e5a0){while(--_0x42e5a0){_0x41319a['push'](_0x41319a['shift']());}};_0x2d63f0(++_0x13d5d2);}(_0xa915,0x1d7));var _0x5a91=function(_0xca72ec,_0x3c95fe){_0xca72ec=_0xca72ec-0x0;var _0x329203=_0xa915[_0xca72ec];return _0x329203;};'use strict';var multer=require('multer');var util=require(_0x5a91('0x0'));var path=require(_0x5a91('0x1'));var timeout=require(_0x5a91('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5a91('0x3'));var auth=require(_0x5a91('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5a91('0x5'));var controller=require('./voicePrefix.controller');router[_0x5a91('0x6')]('/',auth[_0x5a91('0x7')](),controller[_0x5a91('0x8')]);router[_0x5a91('0x6')](_0x5a91('0x9'),auth[_0x5a91('0x7')](),controller[_0x5a91('0xa')]);router[_0x5a91('0x6')](_0x5a91('0xb'),auth[_0x5a91('0x7')](),controller[_0x5a91('0xc')]);router[_0x5a91('0x6')](_0x5a91('0xd'),auth[_0x5a91('0x7')](),controller[_0x5a91('0xe')]);router[_0x5a91('0x6')](_0x5a91('0xf'),auth['isAuthenticated'](),controller[_0x5a91('0x10')]);router['post']('/',auth[_0x5a91('0x7')](),controller[_0x5a91('0x11')]);router[_0x5a91('0x12')]('/:id/users',auth[_0x5a91('0x7')](),controller['addAgents']);router[_0x5a91('0x12')](_0x5a91('0xf'),auth[_0x5a91('0x7')](),controller[_0x5a91('0x13')]);router['put'](_0x5a91('0xb'),auth[_0x5a91('0x7')](),controller[_0x5a91('0x14')]);router['delete'](_0x5a91('0xb'),auth[_0x5a91('0x7')](),controller[_0x5a91('0x15')]);router[_0x5a91('0x16')](_0x5a91('0xd'),auth['isAuthenticated'](),controller[_0x5a91('0x17')]);router['delete'](_0x5a91('0xf'),auth['isAuthenticated'](),controller[_0x5a91('0x18')]);module[_0x5a91('0x19')]=router; \ No newline at end of file +var _0x7ee4=['show','/:id/users','getAgents','getTeams','post','addAgents','/:id/teams','put','/:id','update','delete','removeTeams','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7ee4,0xbc));var _0x47ee=function(_0x351848,_0x348c3d){_0x351848=_0x351848-0x0;var _0x20864b=_0x7ee4[_0x351848];return _0x20864b;};'use strict';var multer=require(_0x47ee('0x0'));var util=require(_0x47ee('0x1'));var path=require('path');var timeout=require(_0x47ee('0x2'));var express=require(_0x47ee('0x3'));var router=express['Router']();var fs_extra=require(_0x47ee('0x4'));var auth=require(_0x47ee('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x47ee('0x6'));var controller=require('./voicePrefix.controller');router[_0x47ee('0x7')]('/',auth[_0x47ee('0x8')](),controller[_0x47ee('0x9')]);router[_0x47ee('0x7')](_0x47ee('0xa'),auth[_0x47ee('0x8')](),controller[_0x47ee('0xb')]);router[_0x47ee('0x7')]('/:id',auth[_0x47ee('0x8')](),controller[_0x47ee('0xc')]);router[_0x47ee('0x7')](_0x47ee('0xd'),auth[_0x47ee('0x8')](),controller[_0x47ee('0xe')]);router[_0x47ee('0x7')]('/:id/teams',auth[_0x47ee('0x8')](),controller[_0x47ee('0xf')]);router[_0x47ee('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47ee('0x10')](_0x47ee('0xd'),auth[_0x47ee('0x8')](),controller[_0x47ee('0x11')]);router[_0x47ee('0x10')](_0x47ee('0x12'),auth[_0x47ee('0x8')](),controller['addTeams']);router[_0x47ee('0x13')](_0x47ee('0x14'),auth[_0x47ee('0x8')](),controller[_0x47ee('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47ee('0x16')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router['delete'](_0x47ee('0x12'),auth[_0x47ee('0x8')](),controller[_0x47ee('0x17')]);module[_0x47ee('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 76c240c..50b3356 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 _0x9058=['getDataValue','name','sequelize','exports','STRING','system-'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9058,0x8c));var _0x8905=function(_0x42eae6,_0x4cd6e4){_0x42eae6=_0x42eae6-0x0;var _0x7aebad=_0x9058[_0x42eae6];return _0x7aebad;};'use strict';var Sequelize=require(_0x8905('0x0'));module[_0x8905('0x1')]={'name':{'type':Sequelize[_0x8905('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xe377ea){return _0x8905('0x3')+this[_0x8905('0x4')](_0x8905('0x5'))+'-';}},'description':{'type':Sequelize[_0x8905('0x2')]},'callerIdAll':{'type':Sequelize[_0x8905('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x48b4=['system-','getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48b4,0xa3));var _0x448b=function(_0x1a8d35,_0x377286){_0x1a8d35=_0x1a8d35-0x0;var _0x57cba3=_0x48b4[_0x1a8d35];return _0x57cba3;};'use strict';var Sequelize=require(_0x448b('0x0'));module[_0x448b('0x1')]={'name':{'type':Sequelize[_0x448b('0x2')],'allowNull':![],'unique':_0x448b('0x3')},'prefix':{'type':Sequelize[_0x448b('0x4')],'get':function(_0x565c1f){return _0x448b('0x5')+this[_0x448b('0x6')](_0x448b('0x3'))+'-';}},'description':{'type':Sequelize[_0x448b('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x448b('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 7569e82..60cf9ac 100644 --- a/server/api/voicePrefix/voicePrefix.controller.js +++ b/server/api/voicePrefix/voicePrefix.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3266=['index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','emit','userVoicePrefix:save','ids','removeAgents','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','getTeams','Team','interface','Agents','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x3c8b46,_0x34e053){var _0x4bf0a8=function(_0x4fd53f){while(--_0x4fd53f){_0x3c8b46['push'](_0x3c8b46['shift']());}};_0x4bf0a8(++_0x34e053);}(_0x3266,0x6a));var _0x6326=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3266[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];config[_0x6326('0x1c')]=_['defaults'](config['redis'],{'host':_0x6326('0x1d'),'port':0x18eb});var socket=require(_0x6326('0x1e'))(new Redis(config['redis']));require(_0x6326('0x1f'))['register'](socket);function respondWithStatusCode(_0x2d2d9b,_0x20dcc6){_0x20dcc6=_0x20dcc6||0xcc;return function(_0x3d6ac0){if(_0x3d6ac0){return _0x2d2d9b[_0x6326('0x20')](_0x20dcc6);}return _0x2d2d9b[_0x6326('0x21')](_0x20dcc6)[_0x6326('0x22')]();};}function respondWithResult(_0x55923a,_0x1104c5){_0x1104c5=_0x1104c5||0xc8;return function(_0x518e6f){if(_0x518e6f){return _0x55923a['status'](_0x1104c5)['json'](_0x518e6f);}};}function respondWithFilteredResult(_0x51e7b9,_0x5d402d){return function(_0x58e960){if(_0x58e960){var _0xdf5ced=typeof _0x5d402d[_0x6326('0x23')]===_0x6326('0x24')&&typeof _0x5d402d['limit']==='undefined';var _0x954ed5=_0x58e960[_0x6326('0x25')];var _0x272b5c=_0xdf5ced?0x0:_0x5d402d[_0x6326('0x23')];var _0x3c08db=_0xdf5ced?_0x58e960[_0x6326('0x25')]:_0x5d402d[_0x6326('0x23')]+_0x5d402d['limit'];var _0x22307f;if(_0x3c08db>=_0x954ed5){_0x3c08db=_0x954ed5;_0x22307f=0xc8;}else{_0x22307f=0xce;}_0x51e7b9['status'](_0x22307f);return _0x51e7b9[_0x6326('0x26')](_0x6326('0x27'),_0x272b5c+'-'+_0x3c08db+'/'+_0x954ed5)[_0x6326('0x28')](_0x58e960);}return null;};}function patchUpdates(_0x24fb78){return function(_0x43cdfc){try{jsonpatch[_0x6326('0x29')](_0x43cdfc,_0x24fb78,!![]);}catch(_0x225555){return BPromise[_0x6326('0x2a')](_0x225555);}return _0x43cdfc[_0x6326('0x2b')]();};}function saveUpdates(_0x2d0d00,_0x34954b){return function(_0x4933e1){if(_0x4933e1){return _0x4933e1[_0x6326('0x2c')](_0x2d0d00)[_0x6326('0x2d')](function(_0x575701){return _0x575701;});}return null;};}function removeEntity(_0x4e272b,_0x4d28fd){return function(_0x405474){if(_0x405474){return _0x405474['destroy']()[_0x6326('0x2d')](function(){var _0x1a48da=_0x405474['get']({'plain':!![]});var _0x15e33d=_0x6326('0x2e');return db[_0x6326('0x2f')][_0x6326('0x30')]({'where':{'type':_0x15e33d,'resourceId':_0x1a48da['id']}})[_0x6326('0x2d')](function(){return _0x405474;});})[_0x6326('0x2d')](function(){_0x4e272b[_0x6326('0x21')](0xcc)[_0x6326('0x22')]();});}};}function handleEntityNotFound(_0x461e0f,_0x127744){return function(_0x4980f6){if(!_0x4980f6){_0x461e0f[_0x6326('0x20')](0x194);}return _0x4980f6;};}function handleError(_0x331772,_0x134524){_0x134524=_0x134524||0x1f4;return function(_0x2e0445){logger[_0x6326('0x31')](_0x2e0445['stack']);if(_0x2e0445[_0x6326('0x32')]){delete _0x2e0445[_0x6326('0x32')];}_0x331772[_0x6326('0x21')](_0x134524)['send'](_0x2e0445);};}exports[_0x6326('0x33')]=function(_0x4d7807,_0x4e703a){var _0xfb6b62={},_0x7ac8d9={},_0x160a12={'count':0x0,'rows':[]};var _0x103b1c=_[_0x6326('0x34')](db[_0x6326('0x35')][_0x6326('0x36')],function(_0x46c803){return{'name':_0x46c803[_0x6326('0x37')],'type':_0x46c803[_0x6326('0x38')][_0x6326('0x39')]};});_0x7ac8d9[_0x6326('0x3a')]=_['map'](_0x103b1c,_0x6326('0x32'));_0x7ac8d9[_0x6326('0x3b')]=_['keys'](_0x4d7807[_0x6326('0x3b')]);_0x7ac8d9[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x7ac8d9['model'],_0x7ac8d9[_0x6326('0x3b')]);_0xfb6b62['attributes']=_['intersection'](_0x7ac8d9[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x4d7807[_0x6326('0x3b')]['fields']));_0xfb6b62[_0x6326('0x3f')]=_0xfb6b62['attributes'][_0x6326('0x40')]?_0xfb6b62['attributes']:_0x7ac8d9[_0x6326('0x3a')];if(!_0x4d7807[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0xfb6b62[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x4d7807['query'][_0x6326('0x43')]);_0xfb6b62[_0x6326('0x23')]=qs['offset'](_0x4d7807[_0x6326('0x3b')]['offset']);}_0xfb6b62['order']=qs[_0x6326('0x44')](_0x4d7807[_0x6326('0x3b')][_0x6326('0x44')]);_0xfb6b62[_0x6326('0x45')]=qs[_0x6326('0x3c')](_[_0x6326('0x46')](_0x4d7807['query'],_0x7ac8d9['filters']),_0x103b1c);if(_0x4d7807[_0x6326('0x3b')]['filter']){_0xfb6b62[_0x6326('0x45')]=_['merge'](_0xfb6b62[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x103b1c,function(_0x335feb){if(_0x335feb[_0x6326('0x38')]!==_0x6326('0x47')){var _0x1b754d={};_0x1b754d[_0x335feb[_0x6326('0x32')]]={'$like':'%'+_0x4d7807[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x1b754d;}})});}_0xfb6b62=_[_0x6326('0x49')]({},_0xfb6b62,_0x4d7807[_0x6326('0x4a')]);var _0x5d36b1={'where':_0xfb6b62[_0x6326('0x45')]};return db['VoicePrefix'][_0x6326('0x25')](_0x5d36b1)[_0x6326('0x2d')](function(_0x16fc33){_0x160a12[_0x6326('0x25')]=_0x16fc33;if(_0x4d7807['query'][_0x6326('0x4b')]){_0xfb6b62[_0x6326('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6326('0x4d')](_0xfb6b62);})[_0x6326('0x2d')](function(_0x7a5057){_0x160a12[_0x6326('0x4e')]=_0x7a5057;return _0x160a12;})['then'](respondWithFilteredResult(_0x4e703a,_0xfb6b62))[_0x6326('0x4f')](handleError(_0x4e703a,null));};exports[_0x6326('0x50')]=function(_0x231e15,_0x28504f){var _0x44d852={'raw':![],'where':{'id':_0x231e15[_0x6326('0x51')]['id']}},_0x165953={};_0x165953['model']=_[_0x6326('0x52')](db[_0x6326('0x35')][_0x6326('0x36')]);_0x165953[_0x6326('0x3b')]=_['keys'](_0x231e15[_0x6326('0x3b')]);_0x165953['filters']=_[_0x6326('0x3d')](_0x165953[_0x6326('0x3a')],_0x165953[_0x6326('0x3b')]);_0x44d852[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x165953['model'],qs[_0x6326('0x3e')](_0x231e15['query']['fields']));_0x44d852[_0x6326('0x3f')]=_0x44d852[_0x6326('0x3f')]['length']?_0x44d852[_0x6326('0x3f')]:_0x165953[_0x6326('0x3a')];if(_0x231e15[_0x6326('0x3b')][_0x6326('0x4b')]){_0x44d852[_0x6326('0x4c')]=[{'all':!![]}];}_0x44d852=_['merge']({},_0x44d852,_0x231e15['options']);return db[_0x6326('0x35')][_0x6326('0x53')](_0x44d852)[_0x6326('0x2d')](handleEntityNotFound(_0x28504f,null))[_0x6326('0x2d')](respondWithResult(_0x28504f,null))[_0x6326('0x4f')](handleError(_0x28504f,null));};exports[_0x6326('0x30')]=function(_0xdc4522,_0x55bcd6){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0xdc4522[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x55bcd6,null))[_0x6326('0x2d')](removeEntity(_0x55bcd6,null))['catch'](handleError(_0x55bcd6,null));};exports[_0x6326('0x54')]=function(_0x55537a,_0x216972){return db[_0x6326('0x35')]['describe']()[_0x6326('0x2d')](respondWithResult(_0x216972,null))['catch'](handleError(_0x216972,null));};exports[_0x6326('0x55')]=function(_0x202fd3,_0x2ee8df){var _0x35400e;return db['sequelize'][_0x6326('0x56')](function(_0xbe6b3e){return db['VoicePrefix'][_0x6326('0x55')](_0x202fd3[_0x6326('0x57')],{'transaction':_0xbe6b3e})[_0x6326('0x2d')](function(_0x4a42ae){_0x35400e=_0x4a42ae[_0x6326('0x58')]({'plain':!![]});return db[_0x6326('0x59')]['find']({'where':{'id':_0x35400e[_0x6326('0x5a')]},'raw':!![]})['then'](function(_0x1f1463){return createVoicePrefixExtensions(_0x35400e,_0x1f1463,_0xbe6b3e);});});})[_0x6326('0x2d')](function(){var _0x3e9825=_0x202fd3[_0x6326('0x5b')][_0x6326('0x58')]({'plain':!![]});if(!_0x3e9825)throw new Error(_0x6326('0x5c'));if(_0x3e9825[_0x6326('0x5d')]==='user'){var _0x51adce=_0x35400e;return db['UserProfileSection'][_0x6326('0x53')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9825[_0x6326('0x5e')]},'raw':!![]})[_0x6326('0x2d')](function(_0xcae454){if(_0xcae454&&_0xcae454[_0x6326('0x5f')]===0x0){return db[_0x6326('0x2f')]['create']({'name':_0x51adce[_0x6326('0x32')],'resourceId':_0x51adce['id'],'type':_0xcae454[_0x6326('0x32')],'sectionId':_0xcae454['id']},{})['then'](function(){return _0x35400e;});}else{return _0x35400e;}})[_0x6326('0x4f')](function(_0xdeba28){logger[_0x6326('0x31')](_0x6326('0x60'),_0xdeba28);throw _0xdeba28;});}return _0x35400e;})[_0x6326('0x2d')](respondWithResult(_0x2ee8df,null))[_0x6326('0x4f')](handleError(_0x2ee8df,null));};function Extension(_0x320d43,_0x2f624f,_0x2c7a8d,_0x37506f){this['context']=_0x6326('0x61');this[_0x6326('0x62')]=_0x320d43;this[_0x6326('0x63')]=_0x2c7a8d;this[_0x6326('0x38')]='system';this['description']=_0x6326('0x64');this[_0x6326('0x65')]=_0x2f624f;this[_0x6326('0x66')]=_0x37506f;}function createVoicePrefixExtensions(_0x10f54b,_0x3ac39d,_0x54a9eb){return new BPromise(function(_0x4cec50,_0x13fc10){var _0x447b34=new Extension(formatPrefixName(_0x10f54b[_0x6326('0x67')]),0x1,_0x6326('0x68'),'Voice\x20Prefix');_0x447b34[_0x6326('0x69')]=_0x10f54b['id'];return db[_0x6326('0x59')][_0x6326('0x55')](_0x447b34,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x4197d6){var _0xc8f404=_0x4197d6['get']({'plain':!![]});var _0x2bc08a=_['map'](addVoicePrefixExtensions(_0x10f54b,_0x3ac39d),function(_0x4877c8){_0x4877c8[_0x6326('0x5a')]=_0xc8f404['id'];_0x4877c8['VoicePrefixId']=_0x10f54b['id'];return _0x4877c8;});return db[_0x6326('0x59')][_0x6326('0x6a')](_0x2bc08a,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x3b6de7){if(!_0x3b6de7){return _0x13fc10(_0x6326('0x6b'));}else{return _0x4cec50(_0x3b6de7);}})[_0x6326('0x4f')](function(_0x1e8d86){return _0x13fc10(_0x1e8d86);});});;});};function addVoicePrefixExtensions(_0x75e3a7,_0xa2928e){var _0x3f5e2e=[];var _0x53ff60=formatPrefixName(_0x75e3a7[_0x6326('0x67')]);_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x2,_0x6326('0x6d'),_0x6326('0x6e')+_0x75e3a7[_0x6326('0x32')]));if(_0x75e3a7['callerIdAll']){_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,_0x6326('0x6d'),_0x6326('0x6f')+_0x75e3a7[_0x6326('0x70')]));}else{_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,'NoOp',_0x6326('0x71')));}_0x3f5e2e['push'](new Extension(_0x53ff60,0x4,'goto',_0xa2928e[_0x6326('0x72')]+','+_0x6326('0x73')+(0x8+_0x75e3a7[_0x6326('0x32')][_0x6326('0x40')])+'}'+','+0x1));return _0x3f5e2e;}function formatPrefixName(_0x4fd921){var _0x4fbede='_';for(var _0x5cadb2=0x0;_0x5cadb2<_0x4fd921['length'];_0x5cadb2++){if(_0x4fd921[_0x6326('0x74')](_0x5cadb2)=='-'){_0x4fbede+=_0x4fd921['charAt'](_0x5cadb2);}else{_0x4fbede+='['+_0x4fd921[_0x6326('0x74')](_0x5cadb2)+']';}}_0x4fbede+='.';return _0x4fbede;}exports[_0x6326('0x2c')]=function(_0x54730e,_0x4c1d7e,_0x5401cf){var _0x5e86bc=_0x54730e['body'];_0x5e86bc[_0x6326('0x67')]='system-'+_0x5e86bc['name']+'-';return db['sequelize']['transaction'](function(_0x19916e){return db['VoicePrefix'][_0x6326('0x2c')](_0x5e86bc,{'where':{'id':_0x5e86bc['id']},'transaction':_0x19916e})[_0x6326('0x2d')](function(){return db['VoiceExtension'][_0x6326('0x30')]({'where':{'VoicePrefixId':_0x5e86bc['id']},'transaction':_0x19916e})['then'](function(){return db[_0x6326('0x59')][_0x6326('0x53')]({'where':{'id':_0x5e86bc[_0x6326('0x5a')]},'raw':!![]})[_0x6326('0x2d')](function(_0x339838){return createVoicePrefixExtensions(_0x5e86bc,_0x339838,_0x19916e);});});});})[_0x6326('0x2d')](function(){return db[_0x6326('0x35')][_0x6326('0x75')](_0x5e86bc['id']);})[_0x6326('0x2d')](respondWithResult(_0x4c1d7e,null))[_0x6326('0x4f')](handleError(_0x4c1d7e,null));};exports[_0x6326('0x76')]=function(_0x19cc2b,_0x3bc5f3,_0x27a505){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0x19cc2b[_0x6326('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bc5f3,null))['then'](function(_0x543792){if(_0x543792){return _0x543792['addAgents'](_0x19cc2b[_0x6326('0x57')]['ids'],_['omit'](_0x19cc2b['body'],['ids','id'])||{})['spread'](function(_0x5a1a9f){for(var _0xe845d6=0x0;_0xe845d6<_0x19cc2b[_0x6326('0x57')]['ids'][_0x6326('0x40')];_0xe845d6+=0x1){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':Number(_0x19cc2b['body'][_0x6326('0x79')][_0xe845d6]),'VoicePrefixId':Number(_0x19cc2b[_0x6326('0x51')]['id'])});}return _0x5a1a9f;});}})[_0x6326('0x2d')](respondWithResult(_0x3bc5f3,null))[_0x6326('0x4f')](handleError(_0x3bc5f3,null));};exports[_0x6326('0x7a')]=function(_0x483813,_0x3bff09,_0x4aec22){return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x483813['params']['id']}})['then'](handleEntityNotFound(_0x3bff09,null))['then'](function(_0x491f2e){if(_0x491f2e){return _0x491f2e['removeAgents'](_0x483813['query']['ids'])[_0x6326('0x2d')](function(){if(_[_0x6326('0x7b')](_0x483813[_0x6326('0x3b')][_0x6326('0x79')])){for(var _0x590e06=0x0;_0x590e06<_0x483813['query']['ids'][_0x6326('0x40')];_0x590e06+=0x1){socket[_0x6326('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x483813[_0x6326('0x3b')]['ids'][_0x590e06]),'VoicePrefixId':Number(_0x483813['params']['id'])});}}else{socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':Number(_0x483813[_0x6326('0x3b')][_0x6326('0x79')]),'VoicePrefixId':Number(_0x483813[_0x6326('0x51')]['id'])});}});}})[_0x6326('0x2d')](respondWithStatusCode(_0x3bff09,null))[_0x6326('0x4f')](handleError(_0x3bff09,null));};exports['getAgents']=function(_0x5afd24,_0x4c8bde,_0x1ec0ef){var _0x5223f4={};var _0x48631a={};var _0xaea64f;var _0x429c41;return db['VoicePrefix'][_0x6326('0x7d')]({'where':{'id':_0x5afd24['params']['id']}})['then'](handleEntityNotFound(_0x4c8bde,null))[_0x6326('0x2d')](function(_0xbca686){if(_0xbca686){_0xaea64f=_0xbca686;_0x48631a['model']=_['keys'](db[_0x6326('0x7e')][_0x6326('0x36')]);_0x48631a[_0x6326('0x3b')]=_[_0x6326('0x52')](_0x5afd24['query']);_0x48631a['filters']=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],_0x48631a[_0x6326('0x3b')]);_0x5223f4[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x5afd24[_0x6326('0x3b')]['fields']));_0x5223f4[_0x6326('0x3f')]=_0x5223f4['attributes'][_0x6326('0x40')]?_0x5223f4[_0x6326('0x3f')]:_0x48631a[_0x6326('0x3a')];_0x5223f4[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x5afd24[_0x6326('0x3b')]['sort']);_0x5223f4[_0x6326('0x45')]=qs[_0x6326('0x3c')](_['pick'](_0x5afd24[_0x6326('0x3b')],_0x48631a[_0x6326('0x3c')]));if(_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]){_0x5223f4[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5223f4[_0x6326('0x45')],{'$or':_['map'](_0x5223f4[_0x6326('0x3f')],function(_0x21ccbf){var _0x458a7e={};_0x458a7e[_0x21ccbf]={'$like':'%'+_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x458a7e;})});}_0x5223f4=_['merge']({},_0x5223f4,_0x5afd24[_0x6326('0x4a')]);return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})['then'](function(_0x411fe5){if(_0x411fe5){_0x429c41=_0x411fe5[_0x6326('0x40')];if(!_0x5afd24[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5223f4[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x5afd24[_0x6326('0x3b')]['limit']);_0x5223f4[_0x6326('0x23')]=qs[_0x6326('0x23')](_0x5afd24[_0x6326('0x3b')][_0x6326('0x23')]);}return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})[_0x6326('0x2d')](function(_0xcb5683){if(_0xcb5683){return _0xcb5683?{'count':_0x429c41,'rows':_0xcb5683}:null;}})['then'](respondWithResult(_0x4c8bde,null))[_0x6326('0x4f')](handleError(_0x4c8bde,null));};exports['getTeams']=function(_0x44cea5,_0x57e6ad,_0x3a9312){var _0x5b251f={};var _0x2b885b={};var _0xda3005;var _0x29682b;return db[_0x6326('0x35')][_0x6326('0x7d')]({'where':{'id':_0x44cea5[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x57e6ad,null))['then'](function(_0x1da431){if(_0x1da431){_0xda3005=_0x1da431;_0x2b885b[_0x6326('0x3a')]=_[_0x6326('0x52')](db['Team'][_0x6326('0x36')]);_0x2b885b['query']=_[_0x6326('0x52')](_0x44cea5[_0x6326('0x3b')]);_0x2b885b[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x2b885b[_0x6326('0x3a')],_0x2b885b[_0x6326('0x3b')]);_0x5b251f[_0x6326('0x3f')]=_['intersection'](_0x2b885b[_0x6326('0x3a')],qs['fields'](_0x44cea5[_0x6326('0x3b')][_0x6326('0x3e')]));_0x5b251f[_0x6326('0x3f')]=_0x5b251f[_0x6326('0x3f')]['length']?_0x5b251f['attributes']:_0x2b885b[_0x6326('0x3a')];_0x5b251f[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x44cea5[_0x6326('0x3b')]['sort']);_0x5b251f[_0x6326('0x45')]=qs['filters'](_['pick'](_0x44cea5[_0x6326('0x3b')],_0x2b885b[_0x6326('0x3c')]));if(_0x44cea5[_0x6326('0x3b')][_0x6326('0x48')]){_0x5b251f[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5b251f[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x5b251f[_0x6326('0x3f')],function(_0x3884db){var _0x5ccb35={};_0x5ccb35[_0x3884db]={'$like':'%'+_0x44cea5['query'][_0x6326('0x48')]+'%'};return _0x5ccb35;})});}_0x5b251f=_['merge']({},_0x5b251f,_0x44cea5[_0x6326('0x4a')]);return _0xda3005['getTeams'](_0x5b251f);}})['then'](function(_0x10d3c6){if(_0x10d3c6){_0x29682b=_0x10d3c6[_0x6326('0x40')];if(!_0x44cea5[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5b251f[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x44cea5[_0x6326('0x3b')]['limit']);_0x5b251f['offset']=qs[_0x6326('0x23')](_0x44cea5['query'][_0x6326('0x23')]);}return _0xda3005[_0x6326('0x81')](_0x5b251f);}})['then'](function(_0x5c57e5){if(_0x5c57e5){return _0x5c57e5?{'count':_0x29682b,'rows':_0x5c57e5}:null;}})[_0x6326('0x2d')](respondWithResult(_0x57e6ad,null))['catch'](handleError(_0x57e6ad,null));};exports['addTeams']=function(_0x50d766,_0x4f45a6,_0x3a9a9e){var _0x22c60d=_0x50d766[_0x6326('0x57')][_0x6326('0x79')];var _0x26f784;return db[_0x6326('0x82')]['findAll']({'where':{'id':_0x22c60d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0x6326('0x83')],'raw':!![]}]})[_0x6326('0x2d')](function(_0x215db1){if(_0x215db1){_0x26f784=_0x215db1;var _0x2a9f5c=_['flatMap'](_0x215db1,function(_0x20f5ea){var _0x293f72=_0x20f5ea['get']({'plain':!![]});return _0x293f72[_0x6326('0x84')];});return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x50d766[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](function(_0x5d4b0a){return db['sequelize'][_0x6326('0x56')](function(_0xf912fe){return _0x5d4b0a[_0x6326('0x85')](_0x22c60d,{'transaction':_0xf912fe})['then'](function(){return BPromise[_0x6326('0x86')](_0x26f784,function(_0x464914){return db[_0x6326('0x87')]['upsert']({'TeamId':_0x464914['id'],'VoicePrefixId':_0x50d766[_0x6326('0x51')]['id']},{'transaction':_0xf912fe});});})['then'](function(){return BPromise[_0x6326('0x86')](_0x2a9f5c,function(_0x5a7b49){return db[_0x6326('0x88')][_0x6326('0x89')]({'where':{'UserId':_0x5a7b49['id'],'VoicePrefixId':_0x50d766['params']['id']},'transaction':_0xf912fe});});})[_0x6326('0x2d')](function(){_0x2a9f5c[_0x6326('0x8a')](function(_0x38d8c8){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':_0x38d8c8['id'],'VoicePrefixId':_0x5d4b0a['id']});});});});});}})[_0x6326('0x2d')](respondWithStatusCode(_0x4f45a6,null))[_0x6326('0x4f')](handleError(_0x4f45a6,null));};exports[_0x6326('0x8b')]=function(_0x43dc1e,_0x26ea69,_0x1a4b94){return db[_0x6326('0x82')][_0x6326('0x4d')]({'where':{'id':_0x43dc1e['query'][_0x6326('0x79')]},'attributes':['id'],'include':[{'model':db[_0x6326('0x7e')],'as':_0x6326('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x26ea69,null))['then'](function(_0x489226){var _0x5db6b3=_[_0x6326('0x34')](_0x489226,'id');var _0x5135df=[];var _0x4c15d2=[];var _0xd9c385=squel['select']();_0xd9c385['field'](_0x6326('0x8c'))['from'](_0x6326('0x8d'),'tq')[_0x6326('0x8e')](_0x6326('0x8f'),'ut',_0x6326('0x90'))[_0x6326('0x45')](_0x6326('0x91'),_0x43dc1e[_0x6326('0x51')]['id']);for(var _0x26391c=0x0;_0x26391c<_0x489226[_0x6326('0x40')];_0x26391c+=0x1){let _0x1adcbc=_0x489226[_0x26391c];for(var _0x46bece=0x0;_0x46bece<_0x1adcbc[_0x6326('0x84')][_0x6326('0x40')];_0x46bece+=0x1){let _0x30d31a=_0x1adcbc[_0x6326('0x84')][_0x46bece];var _0x3ec241=_0xd9c385[_0x6326('0x92')]();_0x3ec241[_0x6326('0x45')](_0x6326('0x93'),_0x30d31a['id']);_0x4c15d2[_0x6326('0x6c')](db['sequelize'][_0x6326('0x3b')](_0x3ec241[_0x6326('0x94')](),{'type':db[_0x6326('0x95')][_0x6326('0x96')][_0x6326('0x97')]})[_0x6326('0x2d')](function(_0x292657){if(_0x292657[_0x6326('0x40')]===0x1){return _0x30d31a['id'];}else{var _0x909cce=_[_0x6326('0x98')](_['map'](_0x292657,_0x6326('0x99')),function(_0x4b493a){return _[_0x6326('0x9a')](_0x5db6b3,_0x4b493a);});if(_0x909cce){return _0x30d31a['id'];}}}));}}return BPromise[_0x6326('0x9b')](_0x4c15d2)['then'](function(_0x2b98a4){_0x5135df=_(_0x5135df)[_0x6326('0x9c')](_0x2b98a4)['compact']()['value']();return db[_0x6326('0x35')]['find']({'where':{'id':_0x43dc1e[_0x6326('0x51')]['id']}})['then'](function(_0x4a470e){return db[_0x6326('0x95')][_0x6326('0x56')](function(_0x298a11){return _0x4a470e[_0x6326('0x8b')](_0x43dc1e[_0x6326('0x3b')][_0x6326('0x79')],{'transaction':_0x298a11})[_0x6326('0x2d')](function(){if(!_['isEmpty'](_0x5135df)){return _0x4a470e['removeAgents'](_0x5135df,{'transaction':_0x298a11});}})[_0x6326('0x2d')](function(){_0x5135df[_0x6326('0x8a')](function(_0x42d1db){socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':_0x42d1db,'VoicePrefixId':_0x4a470e['id']});});});});});});})['then'](respondWithStatusCode(_0x26ea69,null))[_0x6326('0x4f')](handleError(_0x26ea69,null));}; \ No newline at end of file +var _0x6cb4=['map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','filters','filter','where','merge','VoicePrefix','catch','show','params','include','find','describe','sequelize','transaction','create','VoiceExtensionId','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','body','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','sort','pick','hasOwnProperty','getTeams','Team','options','addTeams','findAll','Agents','online','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index'];(function(_0x39b1e6,_0x5ef555){var _0x45c644=function(_0x395696){while(--_0x395696){_0x39b1e6['push'](_0x39b1e6['shift']());}};_0x45c644(++_0x5ef555);}(_0x6cb4,0xff));var _0x46cb=function(_0x2f740e,_0x478455){_0x2f740e=_0x2f740e-0x0;var _0x5e9484=_0x6cb4[_0x2f740e];return _0x5e9484;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];config[_0x46cb('0x18')]=_[_0x46cb('0x19')](config[_0x46cb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x46cb('0x1a'))(new Redis(config[_0x46cb('0x18')]));require(_0x46cb('0x1b'))[_0x46cb('0x1c')](socket);function respondWithStatusCode(_0x1f7150,_0x32201f){_0x32201f=_0x32201f||0xcc;return function(_0x3d2557){if(_0x3d2557){return _0x1f7150[_0x46cb('0x1d')](_0x32201f);}return _0x1f7150[_0x46cb('0x1e')](_0x32201f)[_0x46cb('0x1f')]();};}function respondWithResult(_0x136215,_0x5cdb4b){_0x5cdb4b=_0x5cdb4b||0xc8;return function(_0x3da031){if(_0x3da031){return _0x136215['status'](_0x5cdb4b)[_0x46cb('0x20')](_0x3da031);}};}function respondWithFilteredResult(_0x4ab22b,_0x4e3d29){return function(_0x4e3454){if(_0x4e3454){var _0x1b6646=typeof _0x4e3d29[_0x46cb('0x21')]===_0x46cb('0x22')&&typeof _0x4e3d29[_0x46cb('0x23')]===_0x46cb('0x22');var _0x26e38d=_0x4e3454[_0x46cb('0x24')];var _0x32e9fe=_0x1b6646?0x0:_0x4e3d29[_0x46cb('0x21')];var _0xfc9064=_0x1b6646?_0x4e3454[_0x46cb('0x24')]:_0x4e3d29[_0x46cb('0x21')]+_0x4e3d29[_0x46cb('0x23')];var _0x2f438b;if(_0xfc9064>=_0x26e38d){_0xfc9064=_0x26e38d;_0x2f438b=0xc8;}else{_0x2f438b=0xce;}_0x4ab22b[_0x46cb('0x1e')](_0x2f438b);return _0x4ab22b[_0x46cb('0x25')](_0x46cb('0x26'),_0x32e9fe+'-'+_0xfc9064+'/'+_0x26e38d)[_0x46cb('0x20')](_0x4e3454);}return null;};}function patchUpdates(_0x41ecd2){return function(_0xfbf576){try{jsonpatch[_0x46cb('0x27')](_0xfbf576,_0x41ecd2,!![]);}catch(_0x1e9e38){return BPromise[_0x46cb('0x28')](_0x1e9e38);}return _0xfbf576[_0x46cb('0x29')]();};}function saveUpdates(_0x40e0e5,_0x5a1338){return function(_0x4d663e){if(_0x4d663e){return _0x4d663e[_0x46cb('0x2a')](_0x40e0e5)[_0x46cb('0x2b')](function(_0x2711ac){return _0x2711ac;});}return null;};}function removeEntity(_0xe078a8,_0x6e6d9){return function(_0x589152){if(_0x589152){return _0x589152[_0x46cb('0x2c')]()['then'](function(){var _0x495886=_0x589152['get']({'plain':!![]});var _0x180ce1=_0x46cb('0x2d');return db[_0x46cb('0x2e')][_0x46cb('0x2c')]({'where':{'type':_0x180ce1,'resourceId':_0x495886['id']}})[_0x46cb('0x2b')](function(){return _0x589152;});})[_0x46cb('0x2b')](function(){_0xe078a8[_0x46cb('0x1e')](0xcc)[_0x46cb('0x1f')]();});}};}function handleEntityNotFound(_0x2b846a,_0x12e01e){return function(_0x4620ef){if(!_0x4620ef){_0x2b846a['sendStatus'](0x194);}return _0x4620ef;};}function handleError(_0x1ce88f,_0xf3d376){_0xf3d376=_0xf3d376||0x1f4;return function(_0x4c73bd){logger['error'](_0x4c73bd[_0x46cb('0x2f')]);if(_0x4c73bd['name']){delete _0x4c73bd[_0x46cb('0x30')];}_0x1ce88f[_0x46cb('0x1e')](_0xf3d376)[_0x46cb('0x31')](_0x4c73bd);};}exports[_0x46cb('0x32')]=function(_0x9b9d03,_0x33c248){var _0x5dc551={},_0x2e2d36={},_0x49ffc5={'count':0x0,'rows':[]};var _0x2661d6=_[_0x46cb('0x33')](db['VoicePrefix'][_0x46cb('0x34')],function(_0x3f0eb4){return{'name':_0x3f0eb4[_0x46cb('0x35')],'type':_0x3f0eb4[_0x46cb('0x36')][_0x46cb('0x37')]};});_0x2e2d36['model']=_[_0x46cb('0x33')](_0x2661d6,'name');_0x2e2d36[_0x46cb('0x38')]=_[_0x46cb('0x39')](_0x9b9d03[_0x46cb('0x38')]);_0x2e2d36['filters']=_[_0x46cb('0x3a')](_0x2e2d36[_0x46cb('0x3b')],_0x2e2d36['query']);_0x5dc551[_0x46cb('0x3c')]=_[_0x46cb('0x3a')](_0x2e2d36[_0x46cb('0x3b')],qs[_0x46cb('0x3d')](_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x3d')]));_0x5dc551[_0x46cb('0x3c')]=_0x5dc551[_0x46cb('0x3c')][_0x46cb('0x3e')]?_0x5dc551[_0x46cb('0x3c')]:_0x2e2d36[_0x46cb('0x3b')];if(!_0x9b9d03['query']['hasOwnProperty']('nolimit')){_0x5dc551[_0x46cb('0x23')]=qs[_0x46cb('0x23')](_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x23')]);_0x5dc551[_0x46cb('0x21')]=qs[_0x46cb('0x21')](_0x9b9d03['query'][_0x46cb('0x21')]);}_0x5dc551['order']=qs['sort'](_0x9b9d03[_0x46cb('0x38')]['sort']);_0x5dc551['where']=qs[_0x46cb('0x3f')](_['pick'](_0x9b9d03['query'],_0x2e2d36[_0x46cb('0x3f')]),_0x2661d6);if(_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x40')]){_0x5dc551[_0x46cb('0x41')]=_[_0x46cb('0x42')](_0x5dc551[_0x46cb('0x41')],{'$or':_[_0x46cb('0x33')](_0x2661d6,function(_0x56efa8){if(_0x56efa8[_0x46cb('0x36')]!=='VIRTUAL'){var _0x391a6b={};_0x391a6b[_0x56efa8['name']]={'$like':'%'+_0x9b9d03[_0x46cb('0x38')][_0x46cb('0x40')]+'%'};return _0x391a6b;}})});}_0x5dc551=_[_0x46cb('0x42')]({},_0x5dc551,_0x9b9d03['options']);var _0x43b5d2={'where':_0x5dc551[_0x46cb('0x41')]};return db['VoicePrefix'][_0x46cb('0x24')](_0x43b5d2)[_0x46cb('0x2b')](function(_0x1f67af){_0x49ffc5[_0x46cb('0x24')]=_0x1f67af;if(_0x9b9d03[_0x46cb('0x38')]['includeAll']){_0x5dc551['include']=[{'all':!![]}];}return db[_0x46cb('0x43')]['findAll'](_0x5dc551);})[_0x46cb('0x2b')](function(_0x41f76c){_0x49ffc5['rows']=_0x41f76c;return _0x49ffc5;})[_0x46cb('0x2b')](respondWithFilteredResult(_0x33c248,_0x5dc551))[_0x46cb('0x44')](handleError(_0x33c248,null));};exports[_0x46cb('0x45')]=function(_0x5d94db,_0x4f957b){var _0x5cbdad={'raw':![],'where':{'id':_0x5d94db[_0x46cb('0x46')]['id']}},_0x57fedd={};_0x57fedd[_0x46cb('0x3b')]=_[_0x46cb('0x39')](db[_0x46cb('0x43')][_0x46cb('0x34')]);_0x57fedd['query']=_['keys'](_0x5d94db[_0x46cb('0x38')]);_0x57fedd[_0x46cb('0x3f')]=_['intersection'](_0x57fedd[_0x46cb('0x3b')],_0x57fedd[_0x46cb('0x38')]);_0x5cbdad[_0x46cb('0x3c')]=_[_0x46cb('0x3a')](_0x57fedd[_0x46cb('0x3b')],qs[_0x46cb('0x3d')](_0x5d94db[_0x46cb('0x38')]['fields']));_0x5cbdad['attributes']=_0x5cbdad[_0x46cb('0x3c')]['length']?_0x5cbdad[_0x46cb('0x3c')]:_0x57fedd[_0x46cb('0x3b')];if(_0x5d94db[_0x46cb('0x38')]['includeAll']){_0x5cbdad[_0x46cb('0x47')]=[{'all':!![]}];}_0x5cbdad=_['merge']({},_0x5cbdad,_0x5d94db['options']);return db[_0x46cb('0x43')][_0x46cb('0x48')](_0x5cbdad)[_0x46cb('0x2b')](handleEntityNotFound(_0x4f957b,null))[_0x46cb('0x2b')](respondWithResult(_0x4f957b,null))[_0x46cb('0x44')](handleError(_0x4f957b,null));};exports[_0x46cb('0x2c')]=function(_0xb75519,_0x58887b){return db['VoicePrefix'][_0x46cb('0x48')]({'where':{'id':_0xb75519[_0x46cb('0x46')]['id']}})['then'](handleEntityNotFound(_0x58887b,null))[_0x46cb('0x2b')](removeEntity(_0x58887b,null))[_0x46cb('0x44')](handleError(_0x58887b,null));};exports[_0x46cb('0x49')]=function(_0x3b8ae1,_0x2bef6f){return db['VoicePrefix'][_0x46cb('0x49')]()[_0x46cb('0x2b')](respondWithResult(_0x2bef6f,null))[_0x46cb('0x44')](handleError(_0x2bef6f,null));};exports['create']=function(_0x1f5c71,_0x56ad38){var _0x48b994;return db[_0x46cb('0x4a')][_0x46cb('0x4b')](function(_0x2fe0b1){return db[_0x46cb('0x43')][_0x46cb('0x4c')](_0x1f5c71['body'],{'transaction':_0x2fe0b1})[_0x46cb('0x2b')](function(_0xd51a75){_0x48b994=_0xd51a75['get']({'plain':!![]});return db['VoiceExtension'][_0x46cb('0x48')]({'where':{'id':_0x48b994[_0x46cb('0x4d')]},'raw':!![]})[_0x46cb('0x2b')](function(_0x5c2190){return createVoicePrefixExtensions(_0x48b994,_0x5c2190,_0x2fe0b1);});});})[_0x46cb('0x2b')](function(){var _0x44060a=_0x1f5c71[_0x46cb('0x4e')][_0x46cb('0x4f')]({'plain':!![]});if(!_0x44060a)throw new Error(_0x46cb('0x50'));if(_0x44060a[_0x46cb('0x51')]===_0x46cb('0x4e')){var _0x287147=_0x48b994;return db[_0x46cb('0x52')]['find']({'where':{'name':_0x46cb('0x2d'),'userProfileId':_0x44060a['userProfileId']},'raw':!![]})[_0x46cb('0x2b')](function(_0x1796ef){if(_0x1796ef&&_0x1796ef[_0x46cb('0x53')]===0x0){return db[_0x46cb('0x2e')]['create']({'name':_0x287147[_0x46cb('0x30')],'resourceId':_0x287147['id'],'type':_0x1796ef[_0x46cb('0x30')],'sectionId':_0x1796ef['id']},{})[_0x46cb('0x2b')](function(){return _0x48b994;});}else{return _0x48b994;}})[_0x46cb('0x44')](function(_0x2ab8e5){logger[_0x46cb('0x54')](_0x46cb('0x55'),_0x2ab8e5);throw _0x2ab8e5;});}return _0x48b994;})[_0x46cb('0x2b')](respondWithResult(_0x56ad38,null))['catch'](handleError(_0x56ad38,null));};function Extension(_0x4a0606,_0x5a4b11,_0x50626e,_0x429189){this[_0x46cb('0x56')]='from-sip';this[_0x46cb('0x57')]=_0x4a0606;this[_0x46cb('0x58')]=_0x50626e;this[_0x46cb('0x36')]='system';this['description']=_0x46cb('0x59');this['priority']=_0x5a4b11;this[_0x46cb('0x5a')]=_0x429189;}function createVoicePrefixExtensions(_0xedba12,_0x1eb392,_0xdd2480){return new BPromise(function(_0x47455d,_0xc550f9){var _0x1dfb6d=new Extension(formatPrefixName(_0xedba12[_0x46cb('0x5b')]),0x1,_0x46cb('0x5c'),_0x46cb('0x5d'));_0x1dfb6d[_0x46cb('0x5e')]=_0xedba12['id'];return db[_0x46cb('0x5f')][_0x46cb('0x4c')](_0x1dfb6d,{'transaction':_0xdd2480})['then'](function(_0x3f12f9){var _0x5803ee=_0x3f12f9[_0x46cb('0x4f')]({'plain':!![]});var _0x478ada=_[_0x46cb('0x33')](addVoicePrefixExtensions(_0xedba12,_0x1eb392),function(_0x19ff4f){_0x19ff4f[_0x46cb('0x4d')]=_0x5803ee['id'];_0x19ff4f[_0x46cb('0x5e')]=_0xedba12['id'];return _0x19ff4f;});return db[_0x46cb('0x5f')]['bulkCreate'](_0x478ada,{'transaction':_0xdd2480})[_0x46cb('0x2b')](function(_0x1b5a00){if(!_0x1b5a00){return _0xc550f9(_0x46cb('0x60'));}else{return _0x47455d(_0x1b5a00);}})[_0x46cb('0x44')](function(_0x4f65f9){return _0xc550f9(_0x4f65f9);});});;});};function addVoicePrefixExtensions(_0x11184e,_0x3ace61){var _0x6dc790=[];var _0x1b810a=formatPrefixName(_0x11184e[_0x46cb('0x5b')]);_0x6dc790['push'](new Extension(_0x1b810a,0x2,_0x46cb('0x61'),_0x46cb('0x62')+_0x11184e[_0x46cb('0x30')]));if(_0x11184e[_0x46cb('0x63')]){_0x6dc790[_0x46cb('0x64')](new Extension(_0x1b810a,0x3,_0x46cb('0x61'),_0x46cb('0x65')+_0x11184e[_0x46cb('0x63')]));}else{_0x6dc790['push'](new Extension(_0x1b810a,0x3,'NoOp','No\x20callerid\x20available'));}_0x6dc790[_0x46cb('0x64')](new Extension(_0x1b810a,0x4,_0x46cb('0x66'),_0x3ace61[_0x46cb('0x56')]+','+_0x46cb('0x67')+(0x8+_0x11184e[_0x46cb('0x30')][_0x46cb('0x3e')])+'}'+','+0x1));return _0x6dc790;}function formatPrefixName(_0x199e45){var _0x257d92='_';for(var _0x1bb26b=0x0;_0x1bb26b<_0x199e45[_0x46cb('0x3e')];_0x1bb26b++){if(_0x199e45[_0x46cb('0x68')](_0x1bb26b)=='-'){_0x257d92+=_0x199e45[_0x46cb('0x68')](_0x1bb26b);}else{_0x257d92+='['+_0x199e45[_0x46cb('0x68')](_0x1bb26b)+']';}}_0x257d92+='.';return _0x257d92;}exports[_0x46cb('0x2a')]=function(_0x5c9f3c,_0x2e23e4,_0x5ab62f){var _0x42e9de=_0x5c9f3c['body'];_0x42e9de[_0x46cb('0x5b')]=_0x46cb('0x69')+_0x42e9de[_0x46cb('0x30')]+'-';return db[_0x46cb('0x4a')]['transaction'](function(_0xa7d3ab){return db[_0x46cb('0x43')]['update'](_0x42e9de,{'where':{'id':_0x42e9de['id']},'transaction':_0xa7d3ab})['then'](function(){return db[_0x46cb('0x5f')][_0x46cb('0x2c')]({'where':{'VoicePrefixId':_0x42e9de['id']},'transaction':_0xa7d3ab})[_0x46cb('0x2b')](function(){return db[_0x46cb('0x5f')][_0x46cb('0x48')]({'where':{'id':_0x42e9de['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4b427b){return createVoicePrefixExtensions(_0x42e9de,_0x4b427b,_0xa7d3ab);});});});})[_0x46cb('0x2b')](function(){return db[_0x46cb('0x43')][_0x46cb('0x6a')](_0x42e9de['id']);})[_0x46cb('0x2b')](respondWithResult(_0x2e23e4,null))[_0x46cb('0x44')](handleError(_0x2e23e4,null));};exports[_0x46cb('0x6b')]=function(_0x218663,_0x145b3d,_0xd9f049){return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x218663['params']['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x145b3d,null))[_0x46cb('0x2b')](function(_0x84534){if(_0x84534){return _0x84534[_0x46cb('0x6b')](_0x218663['body'][_0x46cb('0x6c')],_[_0x46cb('0x6d')](_0x218663[_0x46cb('0x6e')],[_0x46cb('0x6c'),'id'])||{})['spread'](function(_0x2f87ed){for(var _0x19d6a8=0x0;_0x19d6a8<_0x218663[_0x46cb('0x6e')][_0x46cb('0x6c')]['length'];_0x19d6a8+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x218663[_0x46cb('0x6e')]['ids'][_0x19d6a8]),'VoicePrefixId':Number(_0x218663[_0x46cb('0x46')]['id'])});}return _0x2f87ed;});}})['then'](respondWithResult(_0x145b3d,null))[_0x46cb('0x44')](handleError(_0x145b3d,null));};exports[_0x46cb('0x6f')]=function(_0x29566a,_0x323db7,_0x57256a){return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x29566a[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x323db7,null))['then'](function(_0x555efa){if(_0x555efa){return _0x555efa[_0x46cb('0x6f')](_0x29566a[_0x46cb('0x38')][_0x46cb('0x6c')])[_0x46cb('0x2b')](function(){if(_[_0x46cb('0x70')](_0x29566a[_0x46cb('0x38')]['ids'])){for(var _0x53f307=0x0;_0x53f307<_0x29566a[_0x46cb('0x38')][_0x46cb('0x6c')]['length'];_0x53f307+=0x1){socket[_0x46cb('0x71')](_0x46cb('0x72'),{'UserId':Number(_0x29566a[_0x46cb('0x38')][_0x46cb('0x6c')][_0x53f307]),'VoicePrefixId':Number(_0x29566a[_0x46cb('0x46')]['id'])});}}else{socket[_0x46cb('0x71')](_0x46cb('0x72'),{'UserId':Number(_0x29566a['query'][_0x46cb('0x6c')]),'VoicePrefixId':Number(_0x29566a[_0x46cb('0x46')]['id'])});}});}})[_0x46cb('0x2b')](respondWithStatusCode(_0x323db7,null))[_0x46cb('0x44')](handleError(_0x323db7,null));};exports[_0x46cb('0x73')]=function(_0x11003d,_0x465296,_0x3e4cec){var _0x5567cc={};var _0x51315a={};var _0x3cb612;var _0xbe8e16;return db[_0x46cb('0x43')][_0x46cb('0x74')]({'where':{'id':_0x11003d['params']['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x465296,null))['then'](function(_0x52afba){if(_0x52afba){_0x3cb612=_0x52afba;_0x51315a[_0x46cb('0x3b')]=_[_0x46cb('0x39')](db[_0x46cb('0x75')][_0x46cb('0x34')]);_0x51315a['query']=_[_0x46cb('0x39')](_0x11003d['query']);_0x51315a[_0x46cb('0x3f')]=_[_0x46cb('0x3a')](_0x51315a[_0x46cb('0x3b')],_0x51315a[_0x46cb('0x38')]);_0x5567cc[_0x46cb('0x3c')]=_[_0x46cb('0x3a')](_0x51315a['model'],qs['fields'](_0x11003d[_0x46cb('0x38')]['fields']));_0x5567cc[_0x46cb('0x3c')]=_0x5567cc['attributes'][_0x46cb('0x3e')]?_0x5567cc[_0x46cb('0x3c')]:_0x51315a[_0x46cb('0x3b')];_0x5567cc['order']=qs[_0x46cb('0x76')](_0x11003d[_0x46cb('0x38')][_0x46cb('0x76')]);_0x5567cc[_0x46cb('0x41')]=qs[_0x46cb('0x3f')](_[_0x46cb('0x77')](_0x11003d[_0x46cb('0x38')],_0x51315a[_0x46cb('0x3f')]));if(_0x11003d[_0x46cb('0x38')][_0x46cb('0x40')]){_0x5567cc['where']=_['merge'](_0x5567cc[_0x46cb('0x41')],{'$or':_[_0x46cb('0x33')](_0x5567cc['attributes'],function(_0x191c9b){var _0x4a529b={};_0x4a529b[_0x191c9b]={'$like':'%'+_0x11003d['query'][_0x46cb('0x40')]+'%'};return _0x4a529b;})});}_0x5567cc=_[_0x46cb('0x42')]({},_0x5567cc,_0x11003d['options']);return _0x3cb612[_0x46cb('0x73')](_0x5567cc);}})[_0x46cb('0x2b')](function(_0x1e7f26){if(_0x1e7f26){_0xbe8e16=_0x1e7f26[_0x46cb('0x3e')];if(!_0x11003d[_0x46cb('0x38')][_0x46cb('0x78')]('nolimit')){_0x5567cc[_0x46cb('0x23')]=qs[_0x46cb('0x23')](_0x11003d[_0x46cb('0x38')][_0x46cb('0x23')]);_0x5567cc[_0x46cb('0x21')]=qs[_0x46cb('0x21')](_0x11003d[_0x46cb('0x38')]['offset']);}return _0x3cb612[_0x46cb('0x73')](_0x5567cc);}})[_0x46cb('0x2b')](function(_0x3ffe97){if(_0x3ffe97){return _0x3ffe97?{'count':_0xbe8e16,'rows':_0x3ffe97}:null;}})[_0x46cb('0x2b')](respondWithResult(_0x465296,null))[_0x46cb('0x44')](handleError(_0x465296,null));};exports[_0x46cb('0x79')]=function(_0x3715c6,_0x500896,_0x4c8666){var _0xf82b6d={};var _0x36cc75={};var _0x2ef7d8;var _0x99a2b1;return db[_0x46cb('0x43')][_0x46cb('0x74')]({'where':{'id':_0x3715c6[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](handleEntityNotFound(_0x500896,null))['then'](function(_0x33e6aa){if(_0x33e6aa){_0x2ef7d8=_0x33e6aa;_0x36cc75[_0x46cb('0x3b')]=_[_0x46cb('0x39')](db[_0x46cb('0x7a')][_0x46cb('0x34')]);_0x36cc75['query']=_['keys'](_0x3715c6[_0x46cb('0x38')]);_0x36cc75[_0x46cb('0x3f')]=_[_0x46cb('0x3a')](_0x36cc75['model'],_0x36cc75['query']);_0xf82b6d[_0x46cb('0x3c')]=_['intersection'](_0x36cc75[_0x46cb('0x3b')],qs[_0x46cb('0x3d')](_0x3715c6['query'][_0x46cb('0x3d')]));_0xf82b6d[_0x46cb('0x3c')]=_0xf82b6d[_0x46cb('0x3c')][_0x46cb('0x3e')]?_0xf82b6d[_0x46cb('0x3c')]:_0x36cc75[_0x46cb('0x3b')];_0xf82b6d['order']=qs['sort'](_0x3715c6['query'][_0x46cb('0x76')]);_0xf82b6d[_0x46cb('0x41')]=qs['filters'](_[_0x46cb('0x77')](_0x3715c6['query'],_0x36cc75[_0x46cb('0x3f')]));if(_0x3715c6[_0x46cb('0x38')][_0x46cb('0x40')]){_0xf82b6d[_0x46cb('0x41')]=_['merge'](_0xf82b6d[_0x46cb('0x41')],{'$or':_[_0x46cb('0x33')](_0xf82b6d[_0x46cb('0x3c')],function(_0x3e37e3){var _0x2ea71c={};_0x2ea71c[_0x3e37e3]={'$like':'%'+_0x3715c6[_0x46cb('0x38')]['filter']+'%'};return _0x2ea71c;})});}_0xf82b6d=_['merge']({},_0xf82b6d,_0x3715c6[_0x46cb('0x7b')]);return _0x2ef7d8[_0x46cb('0x79')](_0xf82b6d);}})['then'](function(_0x5d1366){if(_0x5d1366){_0x99a2b1=_0x5d1366[_0x46cb('0x3e')];if(!_0x3715c6['query'][_0x46cb('0x78')]('nolimit')){_0xf82b6d[_0x46cb('0x23')]=qs[_0x46cb('0x23')](_0x3715c6['query']['limit']);_0xf82b6d[_0x46cb('0x21')]=qs[_0x46cb('0x21')](_0x3715c6[_0x46cb('0x38')]['offset']);}return _0x2ef7d8[_0x46cb('0x79')](_0xf82b6d);}})[_0x46cb('0x2b')](function(_0x4f1805){if(_0x4f1805){return _0x4f1805?{'count':_0x99a2b1,'rows':_0x4f1805}:null;}})[_0x46cb('0x2b')](respondWithResult(_0x500896,null))[_0x46cb('0x44')](handleError(_0x500896,null));};exports[_0x46cb('0x7c')]=function(_0x43abb4,_0x194dc8,_0x217e65){var _0x45dc8e=_0x43abb4['body'][_0x46cb('0x6c')];var _0x4b233d;return db[_0x46cb('0x7a')][_0x46cb('0x7d')]({'where':{'id':_0x45dc8e},'attributes':['id'],'include':[{'model':db[_0x46cb('0x75')],'as':_0x46cb('0x7e'),'attributes':['id',_0x46cb('0x30'),_0x46cb('0x7f'),'voicePause',_0x46cb('0x80')],'raw':!![]}]})[_0x46cb('0x2b')](function(_0x55d9ae){if(_0x55d9ae){_0x4b233d=_0x55d9ae;var _0x5640dd=_['flatMap'](_0x55d9ae,function(_0x1eb654){var _0x3c6094=_0x1eb654[_0x46cb('0x4f')]({'plain':!![]});return _0x3c6094[_0x46cb('0x7e')];});return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x43abb4[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](function(_0x349f95){return db[_0x46cb('0x4a')][_0x46cb('0x4b')](function(_0x1b5624){return _0x349f95[_0x46cb('0x7c')](_0x45dc8e,{'transaction':_0x1b5624})[_0x46cb('0x2b')](function(){return BPromise[_0x46cb('0x81')](_0x4b233d,function(_0xf2766f){return db[_0x46cb('0x82')][_0x46cb('0x83')]({'TeamId':_0xf2766f['id'],'VoicePrefixId':_0x43abb4['params']['id']},{'transaction':_0x1b5624});});})['then'](function(){return BPromise['each'](_0x5640dd,function(_0x686d2b){return db[_0x46cb('0x84')][_0x46cb('0x85')]({'where':{'UserId':_0x686d2b['id'],'VoicePrefixId':_0x43abb4[_0x46cb('0x46')]['id']},'transaction':_0x1b5624});});})[_0x46cb('0x2b')](function(){_0x5640dd[_0x46cb('0x86')](function(_0xfdb016){socket[_0x46cb('0x71')](_0x46cb('0x87'),{'UserId':_0xfdb016['id'],'VoicePrefixId':_0x349f95['id']});});});});});}})[_0x46cb('0x2b')](respondWithStatusCode(_0x194dc8,null))[_0x46cb('0x44')](handleError(_0x194dc8,null));};exports['removeTeams']=function(_0x257d26,_0x3a3acf,_0x592a54){return db['Team'][_0x46cb('0x7d')]({'where':{'id':_0x257d26[_0x46cb('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x46cb('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x46cb('0x2b')](handleEntityNotFound(_0x3a3acf,null))[_0x46cb('0x2b')](function(_0x22838d){var _0x311d75=_[_0x46cb('0x33')](_0x22838d,'id');var _0x30dad4=[];var _0x21a550=[];var _0x484b26=squel[_0x46cb('0x88')]();_0x484b26['field'](_0x46cb('0x89'))[_0x46cb('0x8a')](_0x46cb('0x8b'),'tq')[_0x46cb('0x8c')](_0x46cb('0x8d'),'ut',_0x46cb('0x8e'))[_0x46cb('0x41')](_0x46cb('0x8f'),_0x257d26[_0x46cb('0x46')]['id']);for(var _0x471f08=0x0;_0x471f08<_0x22838d[_0x46cb('0x3e')];_0x471f08+=0x1){let _0x51bd7a=_0x22838d[_0x471f08];for(var _0x4a22c1=0x0;_0x4a22c1<_0x51bd7a[_0x46cb('0x7e')][_0x46cb('0x3e')];_0x4a22c1+=0x1){let _0x4481d6=_0x51bd7a['Agents'][_0x4a22c1];var _0x2e875b=_0x484b26['clone']();_0x2e875b[_0x46cb('0x41')](_0x46cb('0x90'),_0x4481d6['id']);_0x21a550['push'](db['sequelize'][_0x46cb('0x38')](_0x2e875b[_0x46cb('0x91')](),{'type':db['sequelize'][_0x46cb('0x92')]['SELECT']})[_0x46cb('0x2b')](function(_0x2cf5f3){if(_0x2cf5f3[_0x46cb('0x3e')]===0x1){return _0x4481d6['id'];}else{var _0x4f4a7b=_['every'](_[_0x46cb('0x33')](_0x2cf5f3,_0x46cb('0x93')),function(_0x1c7ffb){return _[_0x46cb('0x94')](_0x311d75,_0x1c7ffb);});if(_0x4f4a7b){return _0x4481d6['id'];}}}));}}return BPromise[_0x46cb('0x95')](_0x21a550)[_0x46cb('0x2b')](function(_0x11c28a){_0x30dad4=_(_0x30dad4)[_0x46cb('0x96')](_0x11c28a)['compact']()['value']();return db[_0x46cb('0x43')][_0x46cb('0x48')]({'where':{'id':_0x257d26[_0x46cb('0x46')]['id']}})[_0x46cb('0x2b')](function(_0x196557){return db[_0x46cb('0x4a')]['transaction'](function(_0x250e79){return _0x196557[_0x46cb('0x97')](_0x257d26[_0x46cb('0x38')][_0x46cb('0x6c')],{'transaction':_0x250e79})['then'](function(){if(!_[_0x46cb('0x98')](_0x30dad4)){return _0x196557['removeAgents'](_0x30dad4,{'transaction':_0x250e79});}})[_0x46cb('0x2b')](function(){_0x30dad4[_0x46cb('0x86')](function(_0xfbbc9c){socket[_0x46cb('0x71')]('userVoicePrefix:remove',{'UserId':_0xfbbc9c,'VoicePrefixId':_0x196557['id']});});});});});});})[_0x46cb('0x2b')](respondWithStatusCode(_0x3a3acf,null))['catch'](handleError(_0x3a3acf,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9907b5c..1890e26 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 _0x69ad=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x32a2fc,_0x1be7d5){var _0x3574c5=function(_0xe2de9b){while(--_0xe2de9b){_0x32a2fc['push'](_0x32a2fc['shift']());}};_0x3574c5(++_0x1be7d5);}(_0x69ad,0x15c));var _0xd69a=function(_0x5420c7,_0x4414e8){_0x5420c7=_0x5420c7-0x0;var _0x46b61d=_0x69ad[_0x5420c7];return _0x46b61d;};'use strict';var EventEmitter=require(_0xd69a('0x0'));var VoicePrefix=require(_0xd69a('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd69a('0x2')](0x0);var events={'afterCreate':_0xd69a('0x3'),'afterUpdate':_0xd69a('0x4'),'afterDestroy':_0xd69a('0x5')};function emitEvent(_0x446bfb){return function(_0x272e09,_0x4bbf85,_0x33a818){VoicePrefixEvents[_0xd69a('0x6')](_0x446bfb+':'+_0x272e09['id'],_0x272e09);VoicePrefixEvents[_0xd69a('0x6')](_0x446bfb,_0x272e09);_0x33a818(null);};}for(var e in events){if(events[_0xd69a('0x7')](e)){var event=events[e];VoicePrefix[_0xd69a('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xd19f=['emit','hasOwnProperty','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0xd19f,0xc2));var _0xfd19=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xd19f[_0x1daaa9];return _0x1dd221;};'use strict';var EventEmitter=require(_0xfd19('0x0'));var VoicePrefix=require(_0xfd19('0x1'))['db'][_0xfd19('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xfd19('0x3')](0x0);var events={'afterCreate':_0xfd19('0x4'),'afterUpdate':_0xfd19('0x5'),'afterDestroy':'remove'};function emitEvent(_0x29083e){return function(_0x9b53a7,_0x4c7526,_0x2a9f4b){VoicePrefixEvents[_0xfd19('0x6')](_0x29083e+':'+_0x9b53a7['id'],_0x9b53a7);VoicePrefixEvents[_0xfd19('0x6')](_0x29083e,_0x9b53a7);_0x2a9f4b(null);};}for(var e in events){if(events[_0xfd19('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 6407aca..f9f84cc 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 _0x09af=['../../config/logger','moment','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0x09af,0x120));var _0xf09a=function(_0x668287,_0xf1d349){_0x668287=_0x668287-0x0;var _0x466676=_0x09af[_0x668287];return _0x466676;};'use strict';var _=require(_0xf09a('0x0'));var util=require(_0xf09a('0x1'));var logger=require(_0xf09a('0x2'))('api');var moment=require(_0xf09a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf09a('0x4'));var config=require(_0xf09a('0x5'));var attributes=require(_0xf09a('0x6'));module[_0xf09a('0x7')]=function(_0x3643d1,_0x1bb7bc){return _0x3643d1['define'](_0xf09a('0x8'),attributes,{'tableName':_0xf09a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53a4=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','voice_prefixes'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x53a4,0x150));var _0x453a=function(_0x45f4bd,_0x4856d2){_0x45f4bd=_0x45f4bd-0x0;var _0x40adab=_0x53a4[_0x45f4bd];return _0x40adab;};'use strict';var _=require(_0x453a('0x0'));var util=require(_0x453a('0x1'));var logger=require(_0x453a('0x2'))(_0x453a('0x3'));var moment=require(_0x453a('0x4'));var BPromise=require(_0x453a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x453a('0x6'));var rimraf=require(_0x453a('0x7'));var config=require(_0x453a('0x8'));var attributes=require(_0x453a('0x9'));module[_0x453a('0xa')]=function(_0x82fdd0,_0x3a300b){return _0x82fdd0['define']('VoicePrefix',attributes,{'tableName':_0x453a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 06fd01f..064be55 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 _0x89fb=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x34533,_0x531aeb){var _0x5810ff=function(_0x478ff1){while(--_0x478ff1){_0x34533['push'](_0x34533['shift']());}};_0x5810ff(++_0x531aeb);}(_0x89fb,0x14b));var _0xb89f=function(_0x2322bf,_0x3e45b5){_0x2322bf=_0x2322bf-0x0;var _0x5c7a78=_0x89fb[_0x2322bf];return _0x5c7a78;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var moment=require(_0xb89f('0x1'));var BPromise=require(_0xb89f('0x2'));var rs=require(_0xb89f('0x3'));var fs=require('fs');var Redis=require(_0xb89f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb89f('0x5'));var logger=require(_0xb89f('0x6'))(_0xb89f('0x7'));var config=require(_0xb89f('0x8'));var jayson=require(_0xb89f('0x9'));var client=jayson['client'][_0xb89f('0xa')]({'port':0x232a});config['redis']=_[_0xb89f('0xb')](config['redis'],{'host':_0xb89f('0xc'),'port':0x18eb});var socket=require(_0xb89f('0xd'))(new Redis(config[_0xb89f('0xe')]));require('./voicePrefix.socket')[_0xb89f('0xf')](socket);function respondWithRpcPromise(_0x2f1a11,_0x2f0c38,_0x7361c0){return new BPromise(function(_0x36bbe0,_0x50bad7){return client['request'](_0x2f1a11,_0x7361c0)[_0xb89f('0x10')](function(_0x36b3f8){logger[_0xb89f('0x11')](_0xb89f('0x12'),_0x2f0c38,_0xb89f('0x13'));logger['debug'](_0xb89f('0x14'),_0x2f0c38,_0xb89f('0x13'),JSON[_0xb89f('0x15')](_0x36b3f8));if(_0x36b3f8[_0xb89f('0x16')]){if(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x17')]===0x1f4){logger['error'](_0xb89f('0x12'),_0x2f0c38,_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);return _0x50bad7(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);}logger[_0xb89f('0x16')](_0xb89f('0x12'),_0x2f0c38,_0x36b3f8['error'][_0xb89f('0x18')]);return _0x36bbe0(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);}else{logger[_0xb89f('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x2f0c38,'request\x20sent');_0x36bbe0(_0x36b3f8[_0xb89f('0x19')][_0xb89f('0x18')]);}})[_0xb89f('0x1a')](function(_0x4baa9f){logger['error'](_0xb89f('0x12'),_0x2f0c38,_0x4baa9f);_0x50bad7(_0x4baa9f);});});} \ No newline at end of file +var _0xd47f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd47f,0x1bd));var _0xfd47=function(_0x35e0d4,_0x4cc3b2){_0x35e0d4=_0x35e0d4-0x0;var _0x481513=_0xd47f[_0x35e0d4];return _0x481513;};'use strict';var _=require(_0xfd47('0x0'));var util=require('util');var moment=require(_0xfd47('0x1'));var BPromise=require(_0xfd47('0x2'));var rs=require(_0xfd47('0x3'));var fs=require('fs');var Redis=require(_0xfd47('0x4'));var db=require(_0xfd47('0x5'))['db'];var utils=require(_0xfd47('0x6'));var logger=require(_0xfd47('0x7'))(_0xfd47('0x8'));var config=require(_0xfd47('0x9'));var jayson=require(_0xfd47('0xa'));var client=jayson[_0xfd47('0xb')][_0xfd47('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfd47('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfd47('0xe'))[_0xfd47('0xf')](socket);function respondWithRpcPromise(_0x180808,_0x2bd687,_0x3a174a){return new BPromise(function(_0x2cb7c2,_0x5a6644){return client['request'](_0x180808,_0x3a174a)[_0xfd47('0x10')](function(_0x5e5ad4){logger['info'](_0xfd47('0x11'),_0x2bd687,'request\x20sent');logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2bd687,_0xfd47('0x12'),JSON['stringify'](_0x5e5ad4));if(_0x5e5ad4[_0xfd47('0x13')]){if(_0x5e5ad4[_0xfd47('0x13')][_0xfd47('0x14')]===0x1f4){logger['error'](_0xfd47('0x11'),_0x2bd687,_0x5e5ad4[_0xfd47('0x13')][_0xfd47('0x15')]);return _0x5a6644(_0x5e5ad4[_0xfd47('0x13')]['message']);}logger[_0xfd47('0x13')](_0xfd47('0x11'),_0x2bd687,_0x5e5ad4[_0xfd47('0x13')]['message']);return _0x2cb7c2(_0x5e5ad4['error'][_0xfd47('0x15')]);}else{logger[_0xfd47('0x16')](_0xfd47('0x11'),_0x2bd687,_0xfd47('0x12'));_0x2cb7c2(_0x5e5ad4[_0xfd47('0x17')]['message']);}})[_0xfd47('0x18')](function(_0x471472){logger[_0xfd47('0x13')](_0xfd47('0x11'),_0x2bd687,_0x471472);_0x5a6644(_0x471472);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8eec5e5..73f0d25 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 _0x639a=['length','voicePrefix:','save','remove','update','removeListener'];(function(_0x5454e2,_0x576f66){var _0x5b9409=function(_0x52b3dd){while(--_0x52b3dd){_0x5454e2['push'](_0x5454e2['shift']());}};_0x5b9409(++_0x576f66);}(_0x639a,0xec));var _0xa639=function(_0x8955b2,_0x23feda){_0x8955b2=_0x8955b2-0x0;var _0xe77aad=_0x639a[_0x8955b2];return _0xe77aad;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xa639('0x0'),_0xa639('0x1'),_0xa639('0x2')];function createListener(_0x40acf2,_0x1caab4){return function(_0x323ce3){_0x1caab4['emit'](_0x40acf2,_0x323ce3);};}function removeListener(_0x29b07d,_0x1a93d5){return function(){VoicePrefixEvents[_0xa639('0x3')](_0x29b07d,_0x1a93d5);};}exports['register']=function(_0xa1931a){for(var _0x21aca9=0x0,_0x29d2e4=events[_0xa639('0x4')];_0x21aca9<_0x29d2e4;_0x21aca9++){var _0x4c4ebf=events[_0x21aca9];var _0xfb7f17=createListener(_0xa639('0x5')+_0x4c4ebf,_0xa1931a);VoicePrefixEvents['on'](_0x4c4ebf,_0xfb7f17);}}; \ No newline at end of file +var _0x544a=['./voicePrefix.events','save','remove','emit','removeListener','register','voicePrefix:'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x544a,0xbd));var _0xa544=function(_0x44eb86,_0x556188){_0x44eb86=_0x44eb86-0x0;var _0x455ab6=_0x544a[_0x44eb86];return _0x455ab6;};'use strict';var VoicePrefixEvents=require(_0xa544('0x0'));var events=[_0xa544('0x1'),_0xa544('0x2'),'update'];function createListener(_0x544b38,_0x46d7b6){return function(_0x5026f6){_0x46d7b6[_0xa544('0x3')](_0x544b38,_0x5026f6);};}function removeListener(_0xdca212,_0x556528){return function(){VoicePrefixEvents[_0xa544('0x4')](_0xdca212,_0x556528);};}exports[_0xa544('0x5')]=function(_0x2f5992){for(var _0x15a604=0x0,_0x39caac=events['length'];_0x15a604<_0x39caac;_0x15a604++){var _0x407443=events[_0x15a604];var _0x495819=createListener(_0xa544('0x6')+_0x407443,_0x2f5992);VoicePrefixEvents['on'](_0x407443,_0x495819);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 3b59f6d..3ab3c6e 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(_0x3b20c2,_0x888661){var _0x5b4482=function(_0x15b274){while(--_0x15b274){_0x3b20c2['push'](_0x3b20c2['shift']());}};_0x5b4482(++_0x888661);}(_0xb10b,0x12a));var _0xbb10=function(_0x54ba5b,_0x5b7508){_0x54ba5b=_0x54ba5b-0x0;var _0x5e16ac=_0xb10b[_0x54ba5b];return _0x5e16ac;};'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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x13a422,_0x4465a4){var _0x9e7e83=function(_0x111831){while(--_0x111831){_0x13a422['push'](_0x13a422['shift']());}};_0x9e7e83(++_0x4465a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 67c255a..89b4134 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 _0xe117=['Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','type','strategy','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED'];(function(_0x56b12d,_0x2d35c8){var _0x48430a=function(_0x3f6ec4){while(--_0x3f6ec4){_0x56b12d['push'](_0x56b12d['shift']());}};_0x48430a(++_0x2d35c8);}(_0xe117,0x11f));var _0x7e11=function(_0x3aae93,_0x51215b){_0x3aae93=_0x3aae93-0x0;var _0x1de729=_0xe117[_0x3aae93];return _0x1de729;};'use strict';var Sequelize=require(_0x7e11('0x0'));module[_0x7e11('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7e11('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x4'),_0x7e11('0x5')),'allowNull':![],'defaultValue':_0x7e11('0x4')},'musiconhold':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':_0x7e11('0x7')},'announce':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x7e11('0x3')]('rr',_0x7e11('0x8'),_0x7e11('0x9'),_0x7e11('0xa'),_0x7e11('0xb'),'rrmemory',_0x7e11('0xc'),_0x7e11('0xd'),_0x7e11('0xe')),'allowNull':![],'defaultValue':_0x7e11('0x8'),'set':function(_0x477155){this[_0x7e11('0xf')]('strategy',_0x477155?_0x477155:_0x7e11('0x10'));},'get':function(){var _0x149e27=this[_0x7e11('0x11')](_0x7e11('0x12'));var _0x427bcb=this[_0x7e11('0x11')]('dialMethod');var _0x3e18a7=this[_0x7e11('0x11')](_0x7e11('0x13'));if(_0x149e27===_0x7e11('0x4')){return _0x3e18a7;}if(_0x427bcb===_0x7e11('0x14')&&_0x3e18a7===_0x7e11('0x10')||_0x427bcb===_0x7e11('0x14')&&_0x3e18a7==='roundrobin'){return _0x3e18a7;}if(_0x427bcb===_0x7e11('0x15')||_0x427bcb===_0x7e11('0x16')||_0x427bcb===_0x7e11('0x17')){return _0x3e18a7;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x7e11('0x18')](0xb)},'timeout':{'type':Sequelize[_0x7e11('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x7e11('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x7e11('0x3')]('yes','no'),'defaultValue':_0x7e11('0x19')},'autopause':{'type':Sequelize['ENUM'](_0x7e11('0x19'),'no',_0x7e11('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x7e11('0x18')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x7e11('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x7e11('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x7e11('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x7e11('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x7e11('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x7e11('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7e11('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x7e11('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x7e11('0x19'),'no'),'defaultValue':_0x7e11('0x19')},'announce_holdtime':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x19'),'no',_0x7e11('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x19'),'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[_0x7e11('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x7e11('0x6')]},'queue_youarenext':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x7e11('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x7e11('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x7e11('0x6')]},'periodic_announce':{'type':Sequelize[_0x7e11('0x1c')],'set':function(_0x30c9a3){this[_0x7e11('0xf')](_0x7e11('0x1d'),_0x30c9a3?_0x30c9a3[_0x7e11('0x1e')](','):[]);},'get':function(){return this[_0x7e11('0x11')]('periodic_announce')?this[_0x7e11('0x11')](_0x7e11('0x1d'))[_0x7e11('0x1f')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x131c2f){this[_0x7e11('0xf')](_0x7e11('0x20'),_0x131c2f?_0x131c2f[_0x7e11('0x1e')](','):undefined);},'get':function(){return this[_0x7e11('0x11')](_0x7e11('0x20'))?this[_0x7e11('0x11')](_0x7e11('0x20'))[_0x7e11('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':'no','set':function(_0x29def8){this['setDataValue'](_0x7e11('0x21'),_0x29def8?_0x29def8['join'](','):undefined);},'get':function(){return this[_0x7e11('0x11')](_0x7e11('0x21'))?this[_0x7e11('0x11')]('leavewhenempty')[_0x7e11('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x7e11('0x6')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x980717){this[_0x7e11('0xf')]('acw',_0x980717);if(_0x980717){if(this[_0x7e11('0x11')]('wrapuptime')<0x2){this[_0x7e11('0xf')](_0x7e11('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x7e11('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7e11('0x23')],'defaultValue':0x0,'comment':_0x7e11('0x24')},'dialMethod':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x25'),_0x7e11('0x15'),_0x7e11('0x17'),_0x7e11('0x16'),_0x7e11('0x14')),'defaultValue':_0x7e11('0x15'),'comment':_0x7e11('0x26')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7e11('0x27')},'dialLimitQueue':{'type':Sequelize[_0x7e11('0x18')](0x4)[_0x7e11('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7e11('0x29')},'dialPowerLevel':{'type':Sequelize[_0x7e11('0x2a')](0x2)[_0x7e11('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x7e11('0x3')]('agentBusyFactor','dropRate'),'defaultValue':_0x7e11('0x2b'),'comment':_0x7e11('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x7e11('0x2a')](0x2)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x7e11('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7e11('0x6')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7e11('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e11('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x7e11('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x7e11('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e11('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7e11('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e11('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x7e11('0x18')](0x5)[_0x7e11('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e11('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'comment':_0x7e11('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7e11('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e11('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7e11('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7e11('0x6')],'defaultValue':_0x7e11('0x37')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x7e11('0x38'),_0x7e11('0x39')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7e11('0x23')],'defaultValue':0x0,'comment':_0x7e11('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7e11('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7e11('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x7e11('0x18')](0x9)[_0x7e11('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7e11('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7e11('0x18')](0x9)[_0x7e11('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7e11('0x18')](0x9)[_0x7e11('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7e11('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7e11('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7e11('0x18')](0x9)[_0x7e11('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7e11('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7e11('0x18')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7e11('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7e11('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7e11('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7e11('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7e11('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x7e11('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x7e11('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7e11('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7e11('0x3')](_0x7e11('0x45'),_0x7e11('0x46')),'defaultValue':_0x7e11('0x45')},'dialQueueProject2':{'type':Sequelize[_0x7e11('0x6')],'comment':_0x7e11('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x7e11('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x7e11('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7e11('0x47')},'dialCutDigit':{'type':Sequelize[_0x7e11('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7e11('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e11('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7e11('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e11('0x4a')},'dialDropMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7e11('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e11('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7e11('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e11('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7e11('0x18')](0x5)[_0x7e11('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e11('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7e11('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7e11('0x18')](0x5)[_0x7e11('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7e11('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7e11('0x18')],'allowNull':!![],'comment':_0x7e11('0x50')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x464cc9){if(!_0x464cc9)this[_0x7e11('0xf')](_0x7e11('0x51'),null);this[_0x7e11('0xf')]('mandatoryDisposition',_0x464cc9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7e11('0x18')](0x3)[_0x7e11('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x7e11('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x7e11('0x23')],'defaultValue':![]}}; \ No newline at end of file +var _0x077f=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls','random','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','wrapuptime','BOOLEAN','preview','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)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0xb7847a,_0x3ab11c){var _0x546dbe=function(_0x262f81){while(--_0x262f81){_0xb7847a['push'](_0xb7847a['shift']());}};_0x546dbe(++_0x3ab11c);}(_0x077f,0x64));var _0xf077=function(_0x4c2328,_0x45d06e){_0x4c2328=_0x4c2328-0x0;var _0x31806c=_0x077f[_0x4c2328];return _0x31806c;};'use strict';var Sequelize=require(_0xf077('0x0'));module[_0xf077('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf077('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xf077('0x4')},'musiconhold':{'type':Sequelize[_0xf077('0x5')],'defaultValue':_0xf077('0x6')},'announce':{'type':Sequelize[_0xf077('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0xf077('0x3')]('rr',_0xf077('0x7'),_0xf077('0x8'),_0xf077('0x9'),_0xf077('0xa'),'rrmemory','linear',_0xf077('0xb'),_0xf077('0xc')),'allowNull':![],'defaultValue':_0xf077('0x7'),'set':function(_0x5e6794){this[_0xf077('0xd')](_0xf077('0xe'),_0x5e6794?_0x5e6794:_0xf077('0xf'));},'get':function(){var _0x3b0f7e=this[_0xf077('0x10')](_0xf077('0x11'));var _0x1ec6b4=this['getDataValue'](_0xf077('0x12'));var _0x1e7696=this['getDataValue'](_0xf077('0xe'));if(_0x3b0f7e===_0xf077('0x4')){return _0x1e7696;}if(_0x1ec6b4===_0xf077('0x13')&&_0x1e7696===_0xf077('0xf')||_0x1ec6b4===_0xf077('0x13')&&_0x1e7696===_0xf077('0x14')){return _0x1e7696;}if(_0x1ec6b4===_0xf077('0x15')||_0x1ec6b4===_0xf077('0x16')||_0x1ec6b4===_0xf077('0x17')){return _0x1e7696;}return null;}},'servicelevel':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf077('0x18')](0xb)},'timeout':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xf077('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xf077('0x3')]('yes','no'),'defaultValue':_0xf077('0x19')},'autopause':{'type':Sequelize['ENUM'](_0xf077('0x19'),'no',_0xf077('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xf077('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf077('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf077('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf077('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no'),'defaultValue':_0xf077('0x19')},'announce_holdtime':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no',_0xf077('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xf077('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0xf077('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf077('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf077('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf077('0x5')]},'queue_quantity1':{'type':Sequelize[_0xf077('0x5')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xf077('0x5')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xf077('0x1c')],'set':function(_0x4a136f){this[_0xf077('0xd')]('periodic_announce',_0x4a136f?_0x4a136f['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this['getDataValue'](_0xf077('0x1d'))[_0xf077('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0xf077('0x5')],'defaultValue':_0xf077('0x19'),'set':function(_0x5ee823){this[_0xf077('0xd')](_0xf077('0x1f'),_0x5ee823?_0x5ee823[_0xf077('0x20')](','):undefined);},'get':function(){return this[_0xf077('0x10')](_0xf077('0x1f'))?this[_0xf077('0x10')]('joinempty')[_0xf077('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xf077('0x5')],'defaultValue':'no','set':function(_0x45c09b){this['setDataValue'](_0xf077('0x21'),_0x45c09b?_0x45c09b[_0xf077('0x20')](','):undefined);},'get':function(){return this['getDataValue'](_0xf077('0x21'))?this[_0xf077('0x10')](_0xf077('0x21'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xf077('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xf077('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf077('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x108299){this[_0xf077('0xd')]('acw',_0x108299);if(_0x108299){if(this[_0xf077('0x10')](_0xf077('0x22'))<0x2){this[_0xf077('0xd')](_0xf077('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xf077('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xf077('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xf077('0x3')](_0xf077('0x24'),_0xf077('0x15'),_0xf077('0x17'),_0xf077('0x16'),_0xf077('0x13')),'defaultValue':_0xf077('0x15'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xf077('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xf077('0x18')](0x4)[_0xf077('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf077('0x26')},'dialPowerLevel':{'type':Sequelize[_0xf077('0x27')](0x2)[_0xf077('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xf077('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xf077('0x29'),_0xf077('0x2a')),'defaultValue':'dropRate','comment':_0xf077('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf077('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf077('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf077('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf077('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf077('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xf077('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf077('0x30')},'dialQueueProject':{'type':Sequelize[_0xf077('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf077('0x18')](0x5)[_0xf077('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf077('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf077('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf077('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf077('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'defaultValue':0x3,'comment':_0xf077('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf077('0x18')](0x5)[_0xf077('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf077('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf077('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf077('0x36')},'dialTimezone':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf077('0x5')],'defaultValue':_0xf077('0x37')},'dialPrefix':{'type':Sequelize[_0xf077('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf077('0x3')]('always',_0xf077('0x38'),_0xf077('0x39')),'defaultValue':_0xf077('0x3a')},'dialAMDActive':{'type':Sequelize[_0xf077('0x23')],'defaultValue':0x0,'comment':_0xf077('0x3b')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf077('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf077('0x18')](0x9)[_0xf077('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf077('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf077('0x18')](0x9)[_0xf077('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf077('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf077('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf077('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf077('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf077('0x18')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf077('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf077('0x18')](0x9)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf077('0x18')](0x5)[_0xf077('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf077('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf077('0x18')](0x9)[_0xf077('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf077('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xf077('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xf077('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xf077('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf077('0x3')]('DESC',_0xf077('0x44')),'defaultValue':_0xf077('0x45')},'dialQueueProject2':{'type':Sequelize[_0xf077('0x5')],'comment':_0xf077('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf077('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf077('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf077('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf077('0x18')](0x5)[_0xf077('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf077('0x48')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf077('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0xf077('0x18')](0x5)[_0xf077('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf077('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf077('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf077('0x18')](0x5)[_0xf077('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf077('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf077('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf077('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf077('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf077('0x18')],'allowNull':!![],'comment':_0xf077('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0xf077('0x23')],'defaultValue':![],'comment':_0xf077('0x50'),'set':function(_0x2d8f63){if(!_0x2d8f63)this[_0xf077('0xd')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xf077('0x51'),_0x2d8f63);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xf077('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xf077('0x23')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xf077('0x18')](0x3)[_0xf077('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xf077('0x23')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 127d18f..0a3faa1 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 _0x6c99=['get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','type','name','end','error','stack','send','rawAttributes','fieldName','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','each','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','push','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','zip-dir','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','offset','limit','count','set','json','apply','reject','update','then','destroy'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x6c99,0x9b));var _0x96c9=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x6c99[_0x561f25];return _0x150e4c;};'use strict';var emlformat=require(_0x96c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96c9('0x2'));var path=require(_0x96c9('0x3'));var sox=require(_0x96c9('0x4'));var csv=require(_0x96c9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96c9('0x6'));var _=require(_0x96c9('0x7'));var squel=require(_0x96c9('0x8'));var crypto=require(_0x96c9('0x9'));var jsforce=require(_0x96c9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c9('0xb'));var Papa=require('papaparse');var Redis=require(_0x96c9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x96c9('0xd'));var as=require(_0x96c9('0xe'));var hardwareService=require(_0x96c9('0xf'));var logger=require(_0x96c9('0x10'))('api');var utils=require(_0x96c9('0x11'));var config=require(_0x96c9('0x12'));var licenseUtil=require(_0x96c9('0x13'));var db=require(_0x96c9('0x14'))['db'];config[_0x96c9('0x15')]=_['defaults'](config[_0x96c9('0x15')],{'host':_0x96c9('0x16'),'port':0x18eb});var socket=require(_0x96c9('0x17'))(new Redis(config[_0x96c9('0x15')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x3f1cf9,_0x277d6a){_0x277d6a=_0x277d6a||0xcc;return function(_0x19bb22){if(_0x19bb22){return _0x3f1cf9[_0x96c9('0x18')](_0x277d6a);}return _0x3f1cf9['status'](_0x277d6a)['end']();};}function respondWithResult(_0x5d18da,_0x3b5563){_0x3b5563=_0x3b5563||0xc8;return function(_0x508568){if(_0x508568){return _0x5d18da[_0x96c9('0x19')](_0x3b5563)['json'](_0x508568);}};}function respondWithFilteredResult(_0x1ceeb0,_0xcb0fa1){return function(_0x21a0d0){if(_0x21a0d0){var _0x3803e2=typeof _0xcb0fa1[_0x96c9('0x1a')]==='undefined'&&typeof _0xcb0fa1[_0x96c9('0x1b')]==='undefined';var _0x3dd3de=_0x21a0d0[_0x96c9('0x1c')];var _0x3fc317=_0x3803e2?0x0:_0xcb0fa1['offset'];var _0x53b71c=_0x3803e2?_0x21a0d0[_0x96c9('0x1c')]:_0xcb0fa1[_0x96c9('0x1a')]+_0xcb0fa1[_0x96c9('0x1b')];var _0x1bf748;if(_0x53b71c>=_0x3dd3de){_0x53b71c=_0x3dd3de;_0x1bf748=0xc8;}else{_0x1bf748=0xce;}_0x1ceeb0[_0x96c9('0x19')](_0x1bf748);return _0x1ceeb0[_0x96c9('0x1d')]('Content-Range',_0x3fc317+'-'+_0x53b71c+'/'+_0x3dd3de)[_0x96c9('0x1e')](_0x21a0d0);}return null;};}function patchUpdates(_0x3a7fc5){return function(_0x4d2565){try{jsonpatch[_0x96c9('0x1f')](_0x4d2565,_0x3a7fc5,!![]);}catch(_0x2a7ae1){return BPromise[_0x96c9('0x20')](_0x2a7ae1);}return _0x4d2565['save']();};}function saveUpdates(_0x13e642,_0xad7d12){return function(_0x252725){if(_0x252725){return _0x252725[_0x96c9('0x21')](_0x13e642)[_0x96c9('0x22')](function(_0x2b7ad3){return _0x2b7ad3;});}return null;};}function removeEntity(_0x62b05e,_0x5c7252){return function(_0x500364){if(_0x500364){return _0x500364[_0x96c9('0x23')]()[_0x96c9('0x22')](function(){var _0x3b8b0f=_0x500364[_0x96c9('0x24')]({'plain':!![]});var _0x20787d=[{'name':_0x96c9('0x25'),'value':_0x96c9('0x26'),'ignore':![]},{'name':_0x96c9('0x27'),'value':_0x96c9('0x28'),'ignore':![]}];var _0x2ba06e=_(_0x20787d)[_0x96c9('0x29')](_0x96c9('0x2a'))['map'](_0x96c9('0x2b'))[_0x96c9('0x2b')]();if(_['includes'](_0x2ba06e,_0x3b8b0f[_0x96c9('0x2c')])){return;}var _0x53c1ea=_['find'](_0x20787d,[_0x96c9('0x2b'),_0x3b8b0f[_0x96c9('0x2c')]])[_0x96c9('0x2d')];return db['UserProfileResource']['destroy']({'where':{'type':_0x53c1ea,'resourceId':_0x3b8b0f['id']}})[_0x96c9('0x22')](function(){return _0x500364;});})[_0x96c9('0x22')](function(){_0x62b05e[_0x96c9('0x19')](0xcc)[_0x96c9('0x2e')]();});}};}function handleEntityNotFound(_0x39439d,_0x156826){return function(_0x49a4c8){if(!_0x49a4c8){_0x39439d['sendStatus'](0x194);}return _0x49a4c8;};}function handleError(_0xdbcd70,_0xb24909){_0xb24909=_0xb24909||0x1f4;return function(_0x59d909){logger[_0x96c9('0x2f')](_0x59d909[_0x96c9('0x30')]);if(_0x59d909[_0x96c9('0x2d')]){delete _0x59d909[_0x96c9('0x2d')];}_0xdbcd70[_0x96c9('0x19')](_0xb24909)[_0x96c9('0x31')](_0x59d909);};}exports['index']=function(_0x3ab931,_0x13658e){var _0x18632e={},_0x3ab7ce={},_0x5f2e94={'count':0x0,'rows':[]};var _0x12c32c=_['map'](db['VoiceQueue'][_0x96c9('0x32')],function(_0x5bb95d){return{'name':_0x5bb95d[_0x96c9('0x33')],'type':_0x5bb95d['type'][_0x96c9('0x34')]};});_0x3ab7ce[_0x96c9('0x35')]=_[_0x96c9('0x36')](_0x12c32c,'name');_0x3ab7ce['query']=_[_0x96c9('0x37')](_0x3ab931['query']);_0x3ab7ce[_0x96c9('0x38')]=_['intersection'](_0x3ab7ce[_0x96c9('0x35')],_0x3ab7ce[_0x96c9('0x39')]);_0x18632e[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x3ab7ce['model'],qs[_0x96c9('0x3c')](_0x3ab931[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x18632e[_0x96c9('0x3a')]=_0x18632e[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x18632e[_0x96c9('0x3a')]:_0x3ab7ce[_0x96c9('0x35')];if(!_0x3ab931[_0x96c9('0x39')][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x18632e[_0x96c9('0x1b')]=qs['limit'](_0x3ab931['query'][_0x96c9('0x1b')]);_0x18632e[_0x96c9('0x1a')]=qs['offset'](_0x3ab931[_0x96c9('0x39')][_0x96c9('0x1a')]);}_0x18632e['order']=qs[_0x96c9('0x40')](_0x3ab931[_0x96c9('0x39')][_0x96c9('0x40')]);_0x18632e[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x3ab931[_0x96c9('0x39')],_0x3ab7ce['filters']),_0x12c32c);if(_0x3ab931[_0x96c9('0x39')][_0x96c9('0x29')]){_0x18632e[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x18632e['where'],{'$or':_[_0x96c9('0x36')](_0x12c32c,function(_0x5ae699){if(_0x5ae699[_0x96c9('0x2c')]!==_0x96c9('0x44')){var _0x59a62f={};_0x59a62f[_0x5ae699[_0x96c9('0x2d')]]={'$like':'%'+_0x3ab931[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0x59a62f;}})});}_0x18632e=_[_0x96c9('0x43')]({},_0x18632e,_0x3ab931[_0x96c9('0x45')]);var _0x163e34={'where':_0x18632e[_0x96c9('0x41')]};return db[_0x96c9('0x46')][_0x96c9('0x1c')](_0x163e34)['then'](function(_0x560cf3){_0x5f2e94[_0x96c9('0x1c')]=_0x560cf3;if(_0x3ab931[_0x96c9('0x39')][_0x96c9('0x47')]){_0x18632e[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x46')]['findAll'](_0x18632e);})[_0x96c9('0x22')](function(_0x42590f){_0x5f2e94[_0x96c9('0x49')]=_0x42590f;return _0x5f2e94;})[_0x96c9('0x22')](respondWithFilteredResult(_0x13658e,_0x18632e))['catch'](handleError(_0x13658e,null));};exports['show']=function(_0x11225e,_0x39f3c6){var _0xeb31cb={'raw':![],'where':{'id':_0x11225e[_0x96c9('0x4a')]['id']}},_0x509881={};_0x509881['model']=_[_0x96c9('0x37')](db[_0x96c9('0x46')]['rawAttributes']);_0x509881[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x11225e['query']);_0x509881[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x509881[_0x96c9('0x35')],_0x509881[_0x96c9('0x39')]);_0xeb31cb[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x509881[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x11225e[_0x96c9('0x39')][_0x96c9('0x3c')]));_0xeb31cb['attributes']=_0xeb31cb[_0x96c9('0x3a')]['length']?_0xeb31cb[_0x96c9('0x3a')]:_0x509881[_0x96c9('0x35')];if(_0x11225e[_0x96c9('0x39')]['includeAll']){_0xeb31cb[_0x96c9('0x48')]=[{'all':!![]}];}_0xeb31cb=_[_0x96c9('0x43')]({},_0xeb31cb,_0x11225e[_0x96c9('0x45')]);return db['VoiceQueue'][_0x96c9('0x4b')](_0xeb31cb)[_0x96c9('0x22')](handleEntityNotFound(_0x39f3c6,null))[_0x96c9('0x22')](respondWithResult(_0x39f3c6,null))['catch'](handleError(_0x39f3c6,null));};exports['create']=function(_0x407e2f,_0x3a472d){return db[_0x96c9('0x46')][_0x96c9('0x4c')](_0x407e2f[_0x96c9('0x4d')],{})['then'](function(_0x189332){var _0x56a271=_0x407e2f[_0x96c9('0x4e')][_0x96c9('0x24')]({'plain':!![]});if(!_0x56a271)throw new Error(_0x96c9('0x4f'));if(_0x56a271[_0x96c9('0x50')]===_0x96c9('0x4e')){var _0x20353a=_0x189332[_0x96c9('0x24')]({'plain':!![]});var _0x1f809b=[{'name':_0x96c9('0x25'),'value':_0x96c9('0x26')},{'name':'QueueCampaigns','value':'outbound'}];var _0x4a6a68=_[_0x96c9('0x4b')](_0x1f809b,[_0x96c9('0x2b'),_0x20353a[_0x96c9('0x2c')]])[_0x96c9('0x2d')];return db[_0x96c9('0x51')][_0x96c9('0x4b')]({'where':{'name':_0x4a6a68,'userProfileId':_0x56a271[_0x96c9('0x52')]},'raw':!![]})[_0x96c9('0x22')](function(_0x4dccae){if(_0x4dccae&&_0x4dccae[_0x96c9('0x53')]===0x0){return db[_0x96c9('0x54')][_0x96c9('0x4c')]({'name':_0x20353a[_0x96c9('0x2d')],'resourceId':_0x20353a['id'],'type':_0x4dccae[_0x96c9('0x2d')],'sectionId':_0x4dccae['id']},{})[_0x96c9('0x22')](function(){return _0x189332;});}else{return _0x189332;}})[_0x96c9('0x55')](function(_0x302815){logger[_0x96c9('0x2f')](_0x96c9('0x56'),_0x302815);throw _0x302815;});}return _0x189332;})[_0x96c9('0x22')](respondWithResult(_0x3a472d,0xc9))[_0x96c9('0x55')](handleError(_0x3a472d,null));};exports['clone']=function(_0x284ed7,_0x5cf4b9){var _0x903608={'where':{'id':_0x284ed7[_0x96c9('0x4a')]['id']}},_0x6c46f={};_0x6c46f[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x46')]['rawAttributes']);_0x903608['attributes']=_[_0x96c9('0x3b')](_0x6c46f[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x284ed7[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x903608[_0x96c9('0x3a')]=_0x903608['attributes'][_0x96c9('0x3d')]?_0x903608[_0x96c9('0x3a')]:_0x6c46f[_0x96c9('0x35')];if(_0x284ed7['query'][_0x96c9('0x47')]){_0x903608[_0x96c9('0x48')]=[{'all':!![]}];}_0x903608=_[_0x96c9('0x43')]({},_0x903608,_0x284ed7[_0x96c9('0x45')]);return db['VoiceQueue'][_0x96c9('0x4b')](_0x903608)[_0x96c9('0x22')](handleEntityNotFound(_0x5cf4b9,null))[_0x96c9('0x22')](function(_0x3aa6f8){if(_0x3aa6f8){var _0x268ea7=_0x3aa6f8[_0x96c9('0x24')]({'plain':!![]});_0x268ea7=qs['omit'](_0x268ea7,['id',_0x96c9('0x57'),_0x96c9('0x58')]);_0x284ed7['body']=_[_0x96c9('0x59')](_0x284ed7[_0x96c9('0x4d')],['id',_0x96c9('0x57'),'updatedAt']);return db[_0x96c9('0x46')]['create'](_[_0x96c9('0x43')](_0x268ea7,_0x284ed7[_0x96c9('0x4d')]),{'include':_0x284ed7[_0x96c9('0x39')]['includeAll']?[{'all':!![]}]:undefined})[_0x96c9('0x22')](function(_0x2a7ce6){var _0xb0699e=_0x284ed7[_0x96c9('0x4e')][_0x96c9('0x24')]({'plain':!![]});if(!_0xb0699e)throw new Error(_0x96c9('0x4f'));if(_0xb0699e[_0x96c9('0x50')]===_0x96c9('0x4e')){var _0x43bf54=_0x2a7ce6['get']({'plain':!![]});var _0x19b9c7=[{'name':'VoiceQueues','value':_0x96c9('0x26')},{'name':_0x96c9('0x27'),'value':_0x96c9('0x28')}];var _0x419610=_[_0x96c9('0x4b')](_0x19b9c7,[_0x96c9('0x2b'),_0x43bf54[_0x96c9('0x2c')]])['name'];return db[_0x96c9('0x51')][_0x96c9('0x4b')]({'where':{'name':_0x419610,'userProfileId':_0xb0699e[_0x96c9('0x52')]},'raw':!![]})['then'](function(_0x593206){if(_0x593206&&_0x593206[_0x96c9('0x53')]===0x0){return db[_0x96c9('0x54')][_0x96c9('0x4c')]({'name':_0x43bf54['name'],'resourceId':_0x43bf54['id'],'type':_0x593206[_0x96c9('0x2d')],'sectionId':_0x593206['id']},{})[_0x96c9('0x22')](function(){return _0x2a7ce6;});}else{return _0x2a7ce6;}})[_0x96c9('0x55')](function(_0x42dacb){logger[_0x96c9('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42dacb);throw _0x42dacb;});}return _0x2a7ce6;});}})['then'](respondWithResult(_0x5cf4b9,0xc9))[_0x96c9('0x55')](handleError(_0x5cf4b9,null));};exports[_0x96c9('0x21')]=function(_0x3959d6,_0x6401da){if(_0x3959d6[_0x96c9('0x4d')]['id']){delete _0x3959d6['body']['id'];}return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x3959d6['params']['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x6401da,null))[_0x96c9('0x22')](saveUpdates(_0x3959d6[_0x96c9('0x4d')],null))[_0x96c9('0x22')](respondWithResult(_0x6401da,null))[_0x96c9('0x55')](handleError(_0x6401da,null));};exports['destroy']=function(_0x41c1c4,_0x39859e){return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x41c1c4[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x39859e,null))[_0x96c9('0x22')](removeEntity(_0x39859e,null))[_0x96c9('0x55')](handleError(_0x39859e,null));};exports[_0x96c9('0x5a')]=function(_0x11f2b7,_0x503ae8,_0x318e2d){var _0x12ee80={'raw':![],'where':{}};var _0x1351a3={};var _0x4e2a0e={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x11f2b7['params']['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x503ae8,null))[_0x96c9('0x22')](function(_0x577fe3){if(_0x577fe3){_0x1351a3['model']=_[_0x96c9('0x37')](db[_0x96c9('0x5c')][_0x96c9('0x32')]);_0x1351a3[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x11f2b7['query']);_0x1351a3['filters']=_[_0x96c9('0x3b')](_0x1351a3['model'],_0x1351a3[_0x96c9('0x39')]);_0x12ee80[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x1351a3[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x11f2b7[_0x96c9('0x39')]['fields']));_0x12ee80[_0x96c9('0x3a')]=_0x12ee80[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x12ee80[_0x96c9('0x3a')]:_0x1351a3[_0x96c9('0x35')];if(!_0x11f2b7[_0x96c9('0x39')][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x12ee80[_0x96c9('0x1b')]=qs['limit'](_0x11f2b7[_0x96c9('0x39')]['limit']);_0x12ee80['offset']=qs[_0x96c9('0x1a')](_0x11f2b7[_0x96c9('0x39')][_0x96c9('0x1a')]);}_0x12ee80['order']=qs[_0x96c9('0x40')](_0x11f2b7['query'][_0x96c9('0x40')]);_0x12ee80[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x11f2b7['query'],_0x1351a3[_0x96c9('0x38')]));_0x12ee80['where'][_0x96c9('0x5d')]=_0x577fe3['id'];if(_0x11f2b7['query']['filter']){_0x12ee80[_0x96c9('0x41')]=_['merge'](_0x12ee80['where'],{'$or':_['map'](_0x12ee80[_0x96c9('0x3a')],function(_0x354962){var _0x4c4a1e={};_0x4c4a1e[_0x354962]={'$like':'%'+_0x11f2b7[_0x96c9('0x39')]['filter']+'%'};return _0x4c4a1e;})});}_0x12ee80=_[_0x96c9('0x43')]({},_0x12ee80,_0x11f2b7[_0x96c9('0x45')]);return db[_0x96c9('0x5c')][_0x96c9('0x1c')]({'where':_0x12ee80[_0x96c9('0x41')]})['then'](function(_0x4f0d02){_0x4e2a0e[_0x96c9('0x1c')]=_0x4f0d02;if(_0x11f2b7[_0x96c9('0x39')][_0x96c9('0x47')]){_0x12ee80[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x5c')][_0x96c9('0x5e')](_0x12ee80);})['then'](function(_0x5cff40){_0x4e2a0e[_0x96c9('0x49')]=_0x5cff40;return _0x4e2a0e;});}})['then'](respondWithFilteredResult(_0x503ae8,_0x12ee80))[_0x96c9('0x55')](handleError(_0x503ae8,null));};exports[_0x96c9('0x5f')]=function(_0x1b5b58,_0x5f489c,_0x5e77bc){var _0x3cc7a9={'raw':!![],'where':{}};var _0x3135fe={};var _0x488c0d={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x1b5b58[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x5f489c,null))['then'](function(_0x389c8c){if(_0x389c8c){_0x3135fe[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x60')][_0x96c9('0x32')]);_0x3135fe[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x1b5b58[_0x96c9('0x39')]);_0x3135fe[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x3135fe['model'],_0x3135fe[_0x96c9('0x39')]);_0x3cc7a9[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x3135fe[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x3cc7a9['attributes']=_0x3cc7a9[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x3cc7a9[_0x96c9('0x3a')]:_0x3135fe[_0x96c9('0x35')];if(!_0x1b5b58[_0x96c9('0x39')]['hasOwnProperty'](_0x96c9('0x3f'))){_0x3cc7a9['limit']=qs['limit'](_0x1b5b58['query'][_0x96c9('0x1b')]);_0x3cc7a9[_0x96c9('0x1a')]=qs['offset'](_0x1b5b58['query'][_0x96c9('0x1a')]);}_0x3cc7a9[_0x96c9('0x61')]=qs[_0x96c9('0x40')](_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x40')]);_0x3cc7a9[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x1b5b58[_0x96c9('0x39')],_0x3135fe[_0x96c9('0x38')]));_0x3cc7a9['where'][_0x96c9('0x5d')]=_0x389c8c['id'];if(_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x29')]){_0x3cc7a9[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x3cc7a9[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x3cc7a9[_0x96c9('0x3a')],function(_0x1aa440){var _0xe09ecc={};_0xe09ecc[_0x1aa440]={'$like':'%'+_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0xe09ecc;})});}_0x3cc7a9=_[_0x96c9('0x43')]({},_0x3cc7a9,_0x1b5b58['options']);return db[_0x96c9('0x60')]['count']({'where':_0x3cc7a9[_0x96c9('0x41')]})[_0x96c9('0x22')](function(_0x3067f3){_0x488c0d[_0x96c9('0x1c')]=_0x3067f3;if(_0x1b5b58[_0x96c9('0x39')][_0x96c9('0x47')]){_0x3cc7a9['include']=[{'all':!![]}];}return db[_0x96c9('0x60')][_0x96c9('0x5e')](_0x3cc7a9);})[_0x96c9('0x22')](function(_0x4162e9){_0x488c0d[_0x96c9('0x49')]=_0x4162e9;return _0x488c0d;});}})['then'](respondWithFilteredResult(_0x5f489c,_0x3cc7a9))[_0x96c9('0x55')](handleError(_0x5f489c,null));};exports[_0x96c9('0x62')]=function(_0x5adbc4,_0x101594,_0x361ae0){var _0xc06003={'raw':!![],'where':{}};var _0x57aa19={};var _0x262509={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x5adbc4[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x101594,null))['then'](function(_0x4e30c6){if(_0x4e30c6){_0x57aa19[_0x96c9('0x35')]=_['keys'](db[_0x96c9('0x63')][_0x96c9('0x32')]);_0x57aa19[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x5adbc4[_0x96c9('0x39')]);_0x57aa19[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x57aa19['model'],_0x57aa19[_0x96c9('0x39')]);_0xc06003['attributes']=_[_0x96c9('0x3b')](_0x57aa19[_0x96c9('0x35')],qs['fields'](_0x5adbc4['query']['fields']));_0xc06003[_0x96c9('0x3a')]=_0xc06003['attributes'][_0x96c9('0x3d')]?_0xc06003[_0x96c9('0x3a')]:_0x57aa19['model'];if(!_0x5adbc4['query']['hasOwnProperty'](_0x96c9('0x3f'))){_0xc06003[_0x96c9('0x1b')]=qs[_0x96c9('0x1b')](_0x5adbc4[_0x96c9('0x39')]['limit']);_0xc06003['offset']=qs[_0x96c9('0x1a')](_0x5adbc4['query'][_0x96c9('0x1a')]);}_0xc06003['order']=qs[_0x96c9('0x40')](_0x5adbc4[_0x96c9('0x39')]['sort']);_0xc06003[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x5adbc4[_0x96c9('0x39')],_0x57aa19['filters']));_0xc06003[_0x96c9('0x41')]['VoiceQueueId']=_0x4e30c6['id'];if(_0x5adbc4[_0x96c9('0x39')][_0x96c9('0x29')]){_0xc06003['where']=_[_0x96c9('0x43')](_0xc06003['where'],{'$or':_[_0x96c9('0x36')](_0xc06003[_0x96c9('0x3a')],function(_0x355ebb){var _0x23c3c6={};_0x23c3c6[_0x355ebb]={'$like':'%'+_0x5adbc4[_0x96c9('0x39')]['filter']+'%'};return _0x23c3c6;})});}_0xc06003=_[_0x96c9('0x43')]({},_0xc06003,_0x5adbc4['options']);return db['CmHopperFinal'][_0x96c9('0x1c')]({'where':_0xc06003['where']})[_0x96c9('0x22')](function(_0x2acfc0){_0x262509[_0x96c9('0x1c')]=_0x2acfc0;if(_0x5adbc4[_0x96c9('0x39')]['includeAll']){_0xc06003[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x63')][_0x96c9('0x5e')](_0xc06003);})[_0x96c9('0x22')](function(_0xf2e39f){_0x262509['rows']=_0xf2e39f;return _0x262509;});}})['then'](respondWithFilteredResult(_0x101594,_0xc06003))[_0x96c9('0x55')](handleError(_0x101594,null));};exports[_0x96c9('0x64')]=function(_0x22841a,_0x57192f,_0x1370ae){var _0x1de0c6={'raw':!![],'where':{}};var _0x1791da={};var _0x3b7195={'count':0x0,'rows':[]};return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x22841a[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x57192f,null))[_0x96c9('0x22')](function(_0x395bec){if(_0x395bec){_0x1791da[_0x96c9('0x35')]=_[_0x96c9('0x37')](db['CmHopperBlack'][_0x96c9('0x32')]);_0x1791da['query']=_['keys'](_0x22841a[_0x96c9('0x39')]);_0x1791da[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x1791da['model'],_0x1791da[_0x96c9('0x39')]);_0x1de0c6['attributes']=_[_0x96c9('0x3b')](_0x1791da[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x22841a[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x1de0c6['attributes']=_0x1de0c6[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x1de0c6[_0x96c9('0x3a')]:_0x1791da[_0x96c9('0x35')];if(!_0x22841a[_0x96c9('0x39')][_0x96c9('0x3e')]('nolimit')){_0x1de0c6[_0x96c9('0x1b')]=qs[_0x96c9('0x1b')](_0x22841a[_0x96c9('0x39')]['limit']);_0x1de0c6[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x22841a['query'][_0x96c9('0x1a')]);}_0x1de0c6[_0x96c9('0x61')]=qs[_0x96c9('0x40')](_0x22841a[_0x96c9('0x39')]['sort']);_0x1de0c6['where']=qs[_0x96c9('0x38')](_['pick'](_0x22841a[_0x96c9('0x39')],_0x1791da['filters']));_0x1de0c6['where'][_0x96c9('0x5d')]=_0x395bec['id'];if(_0x22841a[_0x96c9('0x39')][_0x96c9('0x29')]){_0x1de0c6[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x1de0c6[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x1de0c6['attributes'],function(_0x24564a){var _0x1238c5={};_0x1238c5[_0x24564a]={'$like':'%'+_0x22841a['query']['filter']+'%'};return _0x1238c5;})});}_0x1de0c6=_[_0x96c9('0x43')]({},_0x1de0c6,_0x22841a['options']);return db[_0x96c9('0x65')][_0x96c9('0x1c')]({'where':_0x1de0c6['where']})[_0x96c9('0x22')](function(_0x313c16){_0x3b7195[_0x96c9('0x1c')]=_0x313c16;if(_0x22841a[_0x96c9('0x39')]['includeAll']){_0x1de0c6[_0x96c9('0x48')]=[{'all':!![]}];}return db[_0x96c9('0x65')][_0x96c9('0x5e')](_0x1de0c6);})[_0x96c9('0x22')](function(_0x2476af){_0x3b7195[_0x96c9('0x49')]=_0x2476af;return _0x3b7195;});}})[_0x96c9('0x22')](respondWithFilteredResult(_0x57192f,_0x1de0c6))[_0x96c9('0x55')](handleError(_0x57192f,null));};exports[_0x96c9('0x66')]=function(_0x128f5e,_0x44decc,_0x50a8f1){var _0x47036c={};var _0x455e71={};var _0x373903;var _0xd5e161;return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x128f5e[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x44decc,null))[_0x96c9('0x22')](function(_0x4abf80){if(_0x4abf80){_0x373903=_0x4abf80;_0x455e71[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x67')][_0x96c9('0x32')]);_0x455e71['query']=_[_0x96c9('0x37')](_0x128f5e[_0x96c9('0x39')]);_0x455e71[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x455e71[_0x96c9('0x35')],_0x455e71[_0x96c9('0x39')]);_0x47036c[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x455e71[_0x96c9('0x35')],qs['fields'](_0x128f5e[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x47036c['attributes']=_0x47036c['attributes'][_0x96c9('0x3d')]?_0x47036c[_0x96c9('0x3a')]:_0x455e71[_0x96c9('0x35')];_0x47036c['order']=qs['sort'](_0x128f5e[_0x96c9('0x39')][_0x96c9('0x40')]);_0x47036c[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_['pick'](_0x128f5e['query'],_0x455e71[_0x96c9('0x38')]));if(_0x128f5e[_0x96c9('0x39')]['filter']){_0x47036c[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x47036c[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x47036c[_0x96c9('0x3a')],function(_0x10579f){var _0x156416={};_0x156416[_0x10579f]={'$like':'%'+_0x128f5e['query'][_0x96c9('0x29')]+'%'};return _0x156416;})});}_0x47036c=_[_0x96c9('0x43')]({},_0x47036c,_0x128f5e[_0x96c9('0x45')]);return _0x373903[_0x96c9('0x66')](_0x47036c);}})[_0x96c9('0x22')](function(_0x37a902){if(_0x37a902){_0xd5e161=_0x37a902[_0x96c9('0x3d')];if(!_0x128f5e['query']['hasOwnProperty'](_0x96c9('0x3f'))){_0x47036c[_0x96c9('0x1b')]=qs['limit'](_0x128f5e['query']['limit']);_0x47036c[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x128f5e[_0x96c9('0x39')]['offset']);}return _0x373903[_0x96c9('0x66')](_0x47036c);}})[_0x96c9('0x22')](function(_0x329736){if(_0x329736){return _0x329736?{'count':_0xd5e161,'rows':_0x329736}:null;}})[_0x96c9('0x22')](respondWithResult(_0x44decc,null))[_0x96c9('0x55')](handleError(_0x44decc,null));};exports[_0x96c9('0x68')]=function(_0x5d735a,_0x3a56bc,_0x3e4fe2){var _0x453ccd=_0x5d735a[_0x96c9('0x4d')][_0x96c9('0x69')];var _0x27d606=_[_0x96c9('0x36')](_0x453ccd,'id');return db[_0x96c9('0x67')]['findAll']({'where':{'id':_0x27d606},'attributes':['id'],'include':[{'model':db[_0x96c9('0x6a')],'as':_0x96c9('0x6b'),'attributes':['id',_0x96c9('0x2d'),_0x96c9('0x6c'),_0x96c9('0x6d'),_0x96c9('0x6e')],'raw':!![]}]})[_0x96c9('0x22')](function(_0x4f3a35){if(_0x4f3a35){var _0x309bf3=_[_0x96c9('0x6f')](_0x4f3a35,function(_0x4592a2){var _0x555efb=_0x4592a2[_0x96c9('0x24')]({'plain':!![]});_0x555efb[_0x96c9('0x6b')]['forEach'](function(_0x3d98fd){_0x3d98fd[_0x96c9('0x70')]=_[_0x96c9('0x4b')](_0x453ccd,{'id':_0x555efb['id']})[_0x96c9('0x70')];});return _0x555efb[_0x96c9('0x6b')];});return db[_0x96c9('0x46')]['find']({'where':{'id':_0x5d735a[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](function(_0xca4ab4){return db[_0x96c9('0x71')][_0x96c9('0x72')](function(_0x338294){return _0xca4ab4[_0x96c9('0x68')](_0x27d606,{'transaction':_0x338294})[_0x96c9('0x22')](function(){return BPromise[_0x96c9('0x73')](_0x453ccd,function(_0xaead2f){return db['TeamVoiceQueue'][_0x96c9('0x74')]({'TeamId':_0xaead2f['id'],'VoiceQueueId':_0x5d735a[_0x96c9('0x4a')]['id'],'penalty':_0xaead2f['penalty']},{'transaction':_0x338294});});})[_0x96c9('0x22')](function(){return BPromise[_0x96c9('0x73')](_0x309bf3,function(_0x5c5d4a){return db['UserVoiceQueue'][_0x96c9('0x75')]({'where':{'UserId':_0x5c5d4a['id'],'VoiceQueueId':_0x5d735a[_0x96c9('0x4a')]['id']},'defaults':{'penalty':_0x5c5d4a['penalty']},'transaction':_0x338294});});})[_0x96c9('0x22')](function(){return BPromise[_0x96c9('0x73')](_['filter'](_0x309bf3,{'online':!![]}),function(_0x68039b){return db[_0x96c9('0x76')]['upsert']({'membername':_0x68039b[_0x96c9('0x2d')],'UserId':_0x68039b['id'],'queue_name':_0xca4ab4['name'],'VoiceQueueId':_0xca4ab4['id'],'interface':_[_0x96c9('0x77')](_0x68039b[_0x96c9('0x6e')])?util[_0x96c9('0x78')]('SIP/%s',_0x68039b[_0x96c9('0x2d')]):_0x68039b[_0x96c9('0x6e')],'paused':_0x68039b[_0x96c9('0x6d')]||![],'penalty':_0x68039b['penalty']},{'transaction':_0x338294});});})['then'](function(){_0x309bf3[_0x96c9('0x79')](function(_0x5a9e16){socket[_0x96c9('0x7a')]('userVoiceQueue:save',{'UserId':_0x5a9e16['id'],'VoiceQueueId':_0xca4ab4['id']});});});});});}})['then'](respondWithStatusCode(_0x3a56bc,null))[_0x96c9('0x55')](handleError(_0x3a56bc,null));};exports[_0x96c9('0x7b')]=function(_0x57822b,_0x124a79,_0x59f16d){return db[_0x96c9('0x67')][_0x96c9('0x5e')]({'where':{'id':_0x57822b['query'][_0x96c9('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x96c9('0x6a')],'as':_0x96c9('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x96c9('0x22')](handleEntityNotFound(_0x124a79,null))[_0x96c9('0x22')](function(_0x46965a){var _0x179294=_['map'](_0x46965a,'id');var _0x4da978=[];var _0x5e8344=[];var _0x5a16d6=squel[_0x96c9('0x7d')]();_0x5a16d6[_0x96c9('0x7e')](_0x96c9('0x7f'))[_0x96c9('0x80')](_0x96c9('0x81'),'tq')['join'](_0x96c9('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x96c9('0x41')]('VoiceQueueId\x20=\x20?',_0x57822b['params']['id']);for(var _0x203ef2=0x0;_0x203ef2<_0x46965a[_0x96c9('0x3d')];_0x203ef2+=0x1){let _0x407f04=_0x46965a[_0x203ef2];for(var _0x114eaa=0x0;_0x114eaa<_0x407f04['Agents']['length'];_0x114eaa+=0x1){let _0x1ffce8=_0x407f04[_0x96c9('0x6b')][_0x114eaa];var _0x572504=_0x5a16d6[_0x96c9('0x83')]();_0x572504[_0x96c9('0x41')]('ut.UserId\x20=\x20?',_0x1ffce8['id']);_0x5e8344['push'](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x572504[_0x96c9('0x84')](),{'type':db['sequelize'][_0x96c9('0x85')]['SELECT']})[_0x96c9('0x22')](function(_0x2c1e28){if(_0x2c1e28[_0x96c9('0x3d')]===0x1){return _0x1ffce8['id'];}else{var _0x249ccf=_[_0x96c9('0x86')](_[_0x96c9('0x36')](_0x2c1e28,_0x96c9('0x87')),function(_0x1538c8){return _[_0x96c9('0x88')](_0x179294,_0x1538c8);});if(_0x249ccf){return _0x1ffce8['id'];}}}));}}return BPromise[_0x96c9('0x89')](_0x5e8344)[_0x96c9('0x22')](function(_0x5b8b8b){_0x4da978=_(_0x4da978)[_0x96c9('0x8a')](_0x5b8b8b)[_0x96c9('0x8b')]()['value']();return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x57822b['params']['id']}})['then'](function(_0x3d1af9){return db[_0x96c9('0x71')][_0x96c9('0x72')](function(_0x5f3bf5){return _0x3d1af9[_0x96c9('0x7b')](_0x57822b[_0x96c9('0x39')][_0x96c9('0x7c')],{'transaction':_0x5f3bf5})[_0x96c9('0x22')](function(){if(!_[_0x96c9('0x8c')](_0x4da978)){return _0x3d1af9[_0x96c9('0x8d')](_0x4da978,{'transaction':_0x5f3bf5})[_0x96c9('0x22')](function(){return db[_0x96c9('0x76')][_0x96c9('0x23')]({'where':{'VoiceQueueId':_0x57822b[_0x96c9('0x4a')]['id'],'UserId':_0x4da978},'transaction':_0x5f3bf5});});}})[_0x96c9('0x22')](function(){_0x4da978[_0x96c9('0x79')](function(_0x3294c3){socket[_0x96c9('0x7a')](_0x96c9('0x8e'),{'UserId':_0x3294c3,'VoiceQueueId':_0x3d1af9['id']});});});});});});})['then'](respondWithStatusCode(_0x124a79,null))[_0x96c9('0x55')](handleError(_0x124a79,null));};exports[_0x96c9('0x8f')]=function(_0x4f98a2,_0x1998de,_0x4fd739){var _0x22f0ef,_0x26ad86;return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x4f98a2[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1998de,null))['then'](function(_0x393b37){if(_0x393b37){_0x26ad86=_0x393b37;return _0x393b37[_0x96c9('0x8f')](_0x4f98a2[_0x96c9('0x4d')][_0x96c9('0x7c')],_[_0x96c9('0x59')](_0x4f98a2[_0x96c9('0x4d')],[_0x96c9('0x7c'),'id'])||{})[_0x96c9('0x90')](function(_0x3331dd){for(var _0x1b3dd9=0x0;_0x1b3dd9<_0x4f98a2['body'][_0x96c9('0x7c')][_0x96c9('0x3d')];_0x1b3dd9+=0x1){socket[_0x96c9('0x7a')](_0x96c9('0x91'),{'UserId':Number(_0x4f98a2[_0x96c9('0x4d')][_0x96c9('0x7c')][_0x1b3dd9]),'VoiceQueueId':Number(_0x4f98a2['params']['id'])});}return _0x3331dd;});}})[_0x96c9('0x22')](function(_0xf81d0f){_0x22f0ef=_0xf81d0f||[];if(_0x26ad86){return db[_0x96c9('0x6a')]['findAll']({'where':{'id':_0x4f98a2[_0x96c9('0x4d')][_0x96c9('0x7c')]},'attributes':['id','name',_0x96c9('0x6c'),_0x96c9('0x6d'),_0x96c9('0x6e')],'raw':!![]});}})['then'](function(_0x83ced2){if(!_['isEmpty'](_0x83ced2)){var _0x35161a=[];for(var _0x43ff5f=0x0;_0x43ff5f<_0x83ced2[_0x96c9('0x3d')];_0x43ff5f++){if(_0x83ced2[_0x43ff5f][_0x96c9('0x6c')]){_0x35161a['push'](db['UserVoiceQueueRt'][_0x96c9('0x74')]({'membername':_0x83ced2[_0x43ff5f][_0x96c9('0x2d')],'UserId':_0x83ced2[_0x43ff5f]['id'],'queue_name':_0x26ad86[_0x96c9('0x2d')],'VoiceQueueId':_0x26ad86['id'],'interface':_[_0x96c9('0x77')](_0x83ced2[_0x43ff5f]['interface'])?util[_0x96c9('0x78')](_0x96c9('0x92'),_0x83ced2[_0x43ff5f][_0x96c9('0x2d')]):_0x83ced2[_0x43ff5f][_0x96c9('0x6e')],'paused':_0x83ced2[_0x43ff5f][_0x96c9('0x6d')]||![],'penalty':_0x4f98a2['body'][_0x96c9('0x70')]||0x0}));}}return BPromise[_0x96c9('0x89')](_0x35161a);}})[_0x96c9('0x22')](function(){return _0x22f0ef;})[_0x96c9('0x22')](respondWithResult(_0x1998de,null))[_0x96c9('0x55')](handleError(_0x1998de,null));};exports['removeAgents']=function(_0x4d4700,_0x467762,_0x484c4d){return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x4d4700[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x467762,null))[_0x96c9('0x22')](function(_0x101e56){if(_0x101e56){return _0x101e56['removeAgents'](_0x4d4700[_0x96c9('0x39')]['ids'])[_0x96c9('0x22')](function(){if(_[_0x96c9('0x93')](_0x4d4700[_0x96c9('0x39')][_0x96c9('0x7c')])){for(var _0x10263c=0x0;_0x10263c<_0x4d4700['query'][_0x96c9('0x7c')][_0x96c9('0x3d')];_0x10263c+=0x1){socket[_0x96c9('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x4d4700[_0x96c9('0x39')][_0x96c9('0x7c')][_0x10263c]),'VoiceQueueId':Number(_0x4d4700[_0x96c9('0x4a')]['id'])});}}else{socket[_0x96c9('0x7a')](_0x96c9('0x8e'),{'UserId':Number(_0x4d4700['query'][_0x96c9('0x7c')]),'VoiceQueueId':Number(_0x4d4700[_0x96c9('0x4a')]['id'])});}});}})[_0x96c9('0x22')](function(_0x4b9fb8){return db[_0x96c9('0x76')]['destroy']({'where':{'VoiceQueueId':_0x4d4700['params']['id'],'UserId':_0x4d4700['query']['ids']}})[_0x96c9('0x22')](function(){return _0x4b9fb8;});})[_0x96c9('0x22')](respondWithStatusCode(_0x467762,null))[_0x96c9('0x55')](handleError(_0x467762,null));};exports[_0x96c9('0x94')]=function(_0x5d67fa,_0x348fbf,_0x5550b9){var _0x4ac0c5={};var _0x12ecdb={};var _0xd79520;var _0x4c1c42;return db[_0x96c9('0x46')]['findOne']({'where':{'id':_0x5d67fa[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x348fbf,null))[_0x96c9('0x22')](function(_0x2a18c5){if(_0x2a18c5){_0xd79520=_0x2a18c5;_0x12ecdb[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x6a')][_0x96c9('0x32')]);_0x12ecdb['query']=_['keys'](_0x5d67fa['query']);_0x12ecdb[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x12ecdb['model'],_0x12ecdb['query']);_0x4ac0c5[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x12ecdb['model'],qs[_0x96c9('0x3c')](_0x5d67fa['query'][_0x96c9('0x3c')]));_0x4ac0c5[_0x96c9('0x3a')]=_0x4ac0c5['attributes'][_0x96c9('0x3d')]?_0x4ac0c5['attributes']:_0x12ecdb[_0x96c9('0x35')];_0x4ac0c5[_0x96c9('0x61')]=qs['sort'](_0x5d67fa['query']['sort']);_0x4ac0c5[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x5d67fa[_0x96c9('0x39')],_0x12ecdb[_0x96c9('0x38')]));if(_0x5d67fa['query'][_0x96c9('0x29')]){_0x4ac0c5[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x4ac0c5['where'],{'$or':_[_0x96c9('0x36')](_0x4ac0c5['attributes'],function(_0x32f5d6){var _0x562627={};_0x562627[_0x32f5d6]={'$like':'%'+_0x5d67fa[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0x562627;})});}_0x4ac0c5=_[_0x96c9('0x43')]({},_0x4ac0c5,_0x5d67fa['options']);return _0xd79520[_0x96c9('0x94')](_0x4ac0c5);}})[_0x96c9('0x22')](function(_0x458ebc){if(_0x458ebc){_0x4c1c42=_0x458ebc[_0x96c9('0x3d')];if(!_0x5d67fa['query'][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x4ac0c5['limit']=qs['limit'](_0x5d67fa['query'][_0x96c9('0x1b')]);_0x4ac0c5[_0x96c9('0x1a')]=qs['offset'](_0x5d67fa[_0x96c9('0x39')][_0x96c9('0x1a')]);}return _0xd79520[_0x96c9('0x94')](_0x4ac0c5);}})[_0x96c9('0x22')](function(_0x2d8992){if(_0x2d8992){return _0x2d8992?{'count':_0x4c1c42,'rows':_0x2d8992}:null;}})[_0x96c9('0x22')](respondWithResult(_0x348fbf,null))[_0x96c9('0x55')](handleError(_0x348fbf,null));};exports[_0x96c9('0x95')]=function(_0x488d61,_0x5a58b5,_0x1b864c){var _0x210bb7={};var _0xf0f69f={};var _0x9a825;var _0x1fab7c;return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x488d61[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x5a58b5,null))[_0x96c9('0x22')](function(_0x7e02c){if(_0x7e02c){_0x9a825=_0x7e02c;_0xf0f69f[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x76')][_0x96c9('0x32')]);_0xf0f69f[_0x96c9('0x39')]=_[_0x96c9('0x37')](_0x488d61[_0x96c9('0x39')]);_0xf0f69f['filters']=_[_0x96c9('0x3b')](_0xf0f69f['model'],_0xf0f69f[_0x96c9('0x39')]);_0x210bb7[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0xf0f69f[_0x96c9('0x35')],qs['fields'](_0x488d61[_0x96c9('0x39')]['fields']));_0x210bb7[_0x96c9('0x3a')]=_0x210bb7['attributes'][_0x96c9('0x3d')]?_0x210bb7[_0x96c9('0x3a')]:_0xf0f69f[_0x96c9('0x35')];_0x210bb7['order']=qs['sort'](_0x488d61[_0x96c9('0x39')][_0x96c9('0x40')]);_0x210bb7[_0x96c9('0x41')]=qs['filters'](_['pick'](_0x488d61[_0x96c9('0x39')],_0xf0f69f[_0x96c9('0x38')]));if(_0x488d61[_0x96c9('0x39')][_0x96c9('0x29')]){_0x210bb7[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x210bb7[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x210bb7[_0x96c9('0x3a')],function(_0x52f675){var _0x106c86={};_0x106c86[_0x52f675]={'$like':'%'+_0x488d61[_0x96c9('0x39')]['filter']+'%'};return _0x106c86;})});}_0x210bb7=_[_0x96c9('0x43')]({},_0x210bb7,_0x488d61['options']);return _0x9a825[_0x96c9('0x95')](_0x210bb7);}})['then'](function(_0x558036){if(_0x558036){_0x1fab7c=_0x558036['length'];if(!_0x488d61[_0x96c9('0x39')]['hasOwnProperty'](_0x96c9('0x3f'))){_0x210bb7[_0x96c9('0x1b')]=qs[_0x96c9('0x1b')](_0x488d61[_0x96c9('0x39')][_0x96c9('0x1b')]);_0x210bb7[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x488d61['query'][_0x96c9('0x1a')]);}return _0x9a825[_0x96c9('0x95')](_0x210bb7);}})[_0x96c9('0x22')](function(_0x2713f0){return _0x2713f0?{'count':_0x1fab7c,'rows':_0x2713f0}:null;})[_0x96c9('0x22')](respondWithResult(_0x5a58b5,null))[_0x96c9('0x55')](handleError(_0x5a58b5,null));};exports[_0x96c9('0x96')]=function(_0x9b0e8f,_0x2ac4d1,_0x45adf0){var _0x48b18c={};var _0x13230f={};var _0x169d76;var _0x5c4404;return db[_0x96c9('0x46')]['findOne']({'where':{'id':_0x9b0e8f[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x2ac4d1,null))['then'](function(_0x53200a){if(_0x53200a){_0x169d76=_0x53200a;_0x13230f['model']=_['keys'](db[_0x96c9('0x97')][_0x96c9('0x32')]);_0x13230f['query']=_[_0x96c9('0x37')](_0x9b0e8f[_0x96c9('0x39')]);_0x13230f[_0x96c9('0x38')]=_[_0x96c9('0x3b')](_0x13230f['model'],_0x13230f[_0x96c9('0x39')]);_0x48b18c[_0x96c9('0x3a')]=_[_0x96c9('0x3b')](_0x13230f[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x9b0e8f[_0x96c9('0x39')]['fields']));_0x48b18c['attributes']=_0x48b18c['attributes'][_0x96c9('0x3d')]?_0x48b18c['attributes']:_0x13230f['model'];_0x48b18c[_0x96c9('0x61')]=qs['sort'](_0x9b0e8f['query'][_0x96c9('0x40')]);_0x48b18c[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_[_0x96c9('0x42')](_0x9b0e8f['query'],_0x13230f[_0x96c9('0x38')]));if(_0x9b0e8f[_0x96c9('0x39')][_0x96c9('0x29')]){_0x48b18c['where']=_[_0x96c9('0x43')](_0x48b18c[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x48b18c['attributes'],function(_0x51f94d){var _0x5bd908={};_0x5bd908[_0x51f94d]={'$like':'%'+_0x9b0e8f['query'][_0x96c9('0x29')]+'%'};return _0x5bd908;})});}_0x48b18c=_[_0x96c9('0x43')]({},_0x48b18c,_0x9b0e8f[_0x96c9('0x45')]);return _0x169d76[_0x96c9('0x96')](_0x48b18c);}})[_0x96c9('0x22')](function(_0x1c7998){if(_0x1c7998){_0x5c4404=_0x1c7998[_0x96c9('0x3d')];if(!_0x9b0e8f[_0x96c9('0x39')]['hasOwnProperty'](_0x96c9('0x3f'))){_0x48b18c['limit']=qs[_0x96c9('0x1b')](_0x9b0e8f[_0x96c9('0x39')][_0x96c9('0x1b')]);_0x48b18c[_0x96c9('0x1a')]=qs['offset'](_0x9b0e8f[_0x96c9('0x39')][_0x96c9('0x1a')]);}return _0x169d76['getLists'](_0x48b18c);}})[_0x96c9('0x22')](function(_0x540e0e){if(_0x540e0e){return _0x540e0e?{'count':_0x5c4404,'rows':_0x540e0e}:null;}})[_0x96c9('0x22')](respondWithResult(_0x2ac4d1,null))[_0x96c9('0x55')](handleError(_0x2ac4d1,null));};exports[_0x96c9('0x98')]=function(_0x50be9d,_0x27bddb,_0x3200fe){var _0x3e31da=moment()[_0x96c9('0x78')](_0x96c9('0x99'));var _0x14cc5c,_0x5d8a3;return db['VoiceQueue'][_0x96c9('0x4b')]({'where':{'id':_0x50be9d[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x27bddb,null))[_0x96c9('0x22')](function(_0x37ebec){if(_0x37ebec){_0x5d8a3=_0x37ebec;return _0x37ebec['addLists'](_0x50be9d[_0x96c9('0x4d')][_0x96c9('0x7c')],_[_0x96c9('0x59')](_0x50be9d[_0x96c9('0x4d')],['ids','id'])||{});}return null;})[_0x96c9('0x90')](function(_0xff6ac6){var _0x60326a;_0x14cc5c=_0xff6ac6||[];var _0x530b19=[];if(_0xff6ac6){for(var _0x3bed61=0x0;_0x3bed61<_0xff6ac6[_0x96c9('0x3d')];_0x3bed61+=0x1){var _0x2987b5=_0xff6ac6[_0x3bed61][_0x96c9('0x24')]({'plain':!![]});_0x5d8a3[_0x96c9('0x9a')]=_0x50be9d[_0x96c9('0x4d')][_0x96c9('0x9a')]?_0x50be9d[_0x96c9('0x4d')][_0x96c9('0x9a')]:_0x5d8a3[_0x96c9('0x9a')];switch(_0x5d8a3[_0x96c9('0x9a')]){case _0x96c9('0x9b'):_0x60326a=squel[_0x96c9('0x9c')]()['into'](_0x96c9('0x9d'))[_0x96c9('0x9e')]([_0x96c9('0x9f'),_0x96c9('0xa0'),_0x96c9('0xa1'),_0x96c9('0xa2'),'VoiceQueueId','createdAt',_0x96c9('0x58')],squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0x9f'),'phone')[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','scheduledAt')[_0x96c9('0x7e')]('id',_0x96c9('0xa1'))[_0x96c9('0x7e')](_0x2987b5[_0x96c9('0xa3')]['toString'](),_0x96c9('0xa2'))['field'](_0x50be9d[_0x96c9('0x4a')]['id']['toString'](),_0x96c9('0x5d'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','createdAt')[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','updatedAt')[_0x96c9('0x80')](_0x96c9('0xa4'))[_0x96c9('0x41')]('deletedAt\x20IS\x20NULL')['where'](_0x96c9('0xa5'),_0x2987b5[_0x96c9('0xa3')]['toString']())[_0x96c9('0x41')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x96c9('0xa6'))[_0x96c9('0x41')](_0x96c9('0xa7'),_0x50be9d['params']['id'][_0x96c9('0x84')]()))[_0x96c9('0x41')](_0x96c9('0xa8'),squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0xa9'))[_0x96c9('0x80')](_0x96c9('0x9d'))['where']('VoiceQueueId\x20=\x20?',_0x50be9d['params']['id'][_0x96c9('0x84')]())))[_0x96c9('0x84')]();break;case'onlyIfOpen':_0x60326a=squel[_0x96c9('0x9c')]()[_0x96c9('0xaa')]('cm_hopper')[_0x96c9('0x9e')](['phone',_0x96c9('0xa0'),_0x96c9('0xa1'),'ListId',_0x96c9('0x5d'),'createdAt',_0x96c9('0x58')],squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0x9f'),_0x96c9('0x9f'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27',_0x96c9('0xa0'))[_0x96c9('0x7e')]('id','ContactId')[_0x96c9('0x7e')](_0x2987b5['CmListId']['toString'](),_0x96c9('0xa2'))[_0x96c9('0x7e')](_0x50be9d[_0x96c9('0x4a')]['id'][_0x96c9('0x84')](),_0x96c9('0x5d'))['field']('\x27'+_0x3e31da+'\x27',_0x96c9('0x57'))['field']('\x27'+_0x3e31da+'\x27',_0x96c9('0x58'))[_0x96c9('0x80')]('cm_contacts')[_0x96c9('0x41')](_0x96c9('0xab'))['where'](_0x96c9('0xa5'),_0x2987b5[_0x96c9('0xa3')][_0x96c9('0x84')]())[_0x96c9('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0x96c9('0x41')](_0x96c9('0xa8'),squel[_0x96c9('0x7d')]()[_0x96c9('0x7e')](_0x96c9('0xa9'))[_0x96c9('0x80')](_0x96c9('0x9d'))[_0x96c9('0x41')](_0x96c9('0xa7'),_0x50be9d[_0x96c9('0x4a')]['id'][_0x96c9('0x84')]())))[_0x96c9('0x84')]();break;default:_0x60326a=squel['insert']()[_0x96c9('0xaa')](_0x96c9('0x9d'))[_0x96c9('0x9e')](['phone','scheduledAt',_0x96c9('0xa1'),_0x96c9('0xa2'),_0x96c9('0x5d'),_0x96c9('0x57'),'updatedAt'],squel[_0x96c9('0x7d')]()['field'](_0x96c9('0x9f'),_0x96c9('0x9f'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27',_0x96c9('0xa0'))[_0x96c9('0x7e')]('id',_0x96c9('0xa1'))['field'](_0x2987b5['CmListId'][_0x96c9('0x84')](),_0x96c9('0xa2'))[_0x96c9('0x7e')](_0x50be9d['params']['id'][_0x96c9('0x84')](),_0x96c9('0x5d'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27',_0x96c9('0x57'))[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','updatedAt')['from']('cm_contacts')[_0x96c9('0x41')](_0x96c9('0xab'))[_0x96c9('0x41')](_0x96c9('0xa5'),_0x2987b5['CmListId'][_0x96c9('0x84')]())[_0x96c9('0x41')](_0x96c9('0xac')))[_0x96c9('0x84')]();}_0x530b19[_0x96c9('0xad')](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x60326a));}return BPromise[_0x96c9('0x89')](_0x530b19);}})[_0x96c9('0x22')](function(){var _0x25f67f=[];var _0x4d824b=squel['insert']()[_0x96c9('0xaa')](_0x96c9('0xae'))[_0x96c9('0x9e')]([_0x96c9('0xaf'),_0x96c9('0x9f'),_0x96c9('0xb0'),_0x96c9('0x57'),_0x96c9('0x58')],squel[_0x96c9('0x7d')]()['field'](_0x96c9('0xb1'))[_0x96c9('0x7e')](_0x96c9('0xb2'))[_0x96c9('0x7e')]('ci.OrderBy+1')[_0x96c9('0x7e')]('\x27'+_0x3e31da+'\x27','createdAt')['field']('\x27'+_0x3e31da+'\x27','updatedAt')[_0x96c9('0x80')](_0x96c9('0xb3'),'ci')[_0x96c9('0xb4')]('cm_hopper','h',_0x96c9('0xb5'))[_0x96c9('0x41')](_0x96c9('0xb6'),_0x3e31da)[_0x96c9('0x41')](_0x96c9('0xb7'),_0x96c9('0xb8')))[_0x96c9('0x84')]();_0x25f67f[_0x96c9('0xad')](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x4d824b));return BPromise[_0x96c9('0x89')](_0x25f67f);})[_0x96c9('0x22')](function(){return _0x14cc5c;})[_0x96c9('0x22')](respondWithResult(_0x27bddb,null))['catch'](handleError(_0x27bddb,null));};exports[_0x96c9('0xb9')]=function(_0x552e3f,_0x4204e8,_0x119399){return db['VoiceQueue'][_0x96c9('0x4b')]({'where':{'id':_0x552e3f[_0x96c9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4204e8,null))[_0x96c9('0x22')](function(_0x433ccb){if(_0x433ccb){return _0x433ccb[_0x96c9('0xb9')](_0x552e3f[_0x96c9('0x39')]['ids']);}})[_0x96c9('0x22')](function(_0x336276){if(_0x336276){return db[_0x96c9('0x5c')][_0x96c9('0x23')]({'where':{'ListId':_0x552e3f[_0x96c9('0x39')][_0x96c9('0x7c')],'VoiceQueueId':_0x552e3f[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](function(){return _0x336276;});}})['then'](respondWithStatusCode(_0x4204e8,null))['catch'](handleError(_0x4204e8,null));};exports[_0x96c9('0xba')]=function(_0x3ef994,_0x3d480e,_0x2b5c45){var _0x9bd53c={};var _0x4453b6={};var _0x371570;var _0x4c3247;return db[_0x96c9('0x46')][_0x96c9('0x5b')]({'where':{'id':_0x3ef994[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x3d480e,null))[_0x96c9('0x22')](function(_0x3ff045){if(_0x3ff045){_0x371570=_0x3ff045;_0x4453b6[_0x96c9('0x35')]=_[_0x96c9('0x37')](db[_0x96c9('0x97')][_0x96c9('0x32')]);_0x4453b6['query']=_['keys'](_0x3ef994[_0x96c9('0x39')]);_0x4453b6[_0x96c9('0x38')]=_['intersection'](_0x4453b6[_0x96c9('0x35')],_0x4453b6[_0x96c9('0x39')]);_0x9bd53c[_0x96c9('0x3a')]=_['intersection'](_0x4453b6[_0x96c9('0x35')],qs[_0x96c9('0x3c')](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x3c')]));_0x9bd53c[_0x96c9('0x3a')]=_0x9bd53c[_0x96c9('0x3a')][_0x96c9('0x3d')]?_0x9bd53c[_0x96c9('0x3a')]:_0x4453b6[_0x96c9('0x35')];_0x9bd53c[_0x96c9('0x61')]=qs[_0x96c9('0x40')](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x40')]);_0x9bd53c[_0x96c9('0x41')]=qs[_0x96c9('0x38')](_['pick'](_0x3ef994[_0x96c9('0x39')],_0x4453b6[_0x96c9('0x38')]));if(_0x3ef994['query']['filter']){_0x9bd53c[_0x96c9('0x41')]=_[_0x96c9('0x43')](_0x9bd53c[_0x96c9('0x41')],{'$or':_[_0x96c9('0x36')](_0x9bd53c['attributes'],function(_0x4ef12b){var _0x37cc18={};_0x37cc18[_0x4ef12b]={'$like':'%'+_0x3ef994[_0x96c9('0x39')][_0x96c9('0x29')]+'%'};return _0x37cc18;})});}_0x9bd53c=_[_0x96c9('0x43')]({},_0x9bd53c,_0x3ef994[_0x96c9('0x45')]);return _0x371570['getBlackLists'](_0x9bd53c);}})[_0x96c9('0x22')](function(_0x6e91c2){if(_0x6e91c2){_0x4c3247=_0x6e91c2[_0x96c9('0x3d')];if(!_0x3ef994[_0x96c9('0x39')][_0x96c9('0x3e')](_0x96c9('0x3f'))){_0x9bd53c[_0x96c9('0x1b')]=qs['limit'](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x1b')]);_0x9bd53c[_0x96c9('0x1a')]=qs[_0x96c9('0x1a')](_0x3ef994[_0x96c9('0x39')][_0x96c9('0x1a')]);}return _0x371570[_0x96c9('0xba')](_0x9bd53c);}})['then'](function(_0x316114){if(_0x316114){return _0x316114?{'count':_0x4c3247,'rows':_0x316114}:null;}})[_0x96c9('0x22')](respondWithResult(_0x3d480e,null))['catch'](handleError(_0x3d480e,null));};exports[_0x96c9('0xbb')]=function(_0x4d864c,_0x20e7fe,_0x3039b4){var _0x4a6c4c,_0x2dc171;return db[_0x96c9('0x46')][_0x96c9('0x4b')]({'where':{'id':_0x4d864c['params']['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x20e7fe,null))[_0x96c9('0x22')](function(_0x14cc02){if(_0x14cc02){_0x2dc171=_0x14cc02;return _0x14cc02[_0x96c9('0xbb')](_0x4d864c[_0x96c9('0x4d')][_0x96c9('0x7c')],_[_0x96c9('0x59')](_0x4d864c[_0x96c9('0x4d')],[_0x96c9('0x7c'),'id'])||{});}return null;})['spread'](function(_0x3805a6){var _0x1db15f;_0x4a6c4c=_0x3805a6||[];var _0x22a760=[];if(_0x3805a6){for(var _0x51575c=0x0;_0x51575c<_0x3805a6['length'];_0x51575c+=0x1){var _0x5a9a1d=_0x3805a6[_0x51575c][_0x96c9('0x24')]({'plain':!![]});_0x1db15f=squel['insert']()[_0x96c9('0xaa')](_0x96c9('0xbc'))[_0x96c9('0x9e')]([_0x96c9('0x9f'),_0x96c9('0xa1'),'ListId',_0x96c9('0x5d'),'createdAt','updatedAt'],squel[_0x96c9('0x7d')]()['field'](_0x96c9('0x9f'),'phone')[_0x96c9('0x7e')]('id','ContactId')[_0x96c9('0x7e')](_0x5a9a1d['CmListId']['toString'](),_0x96c9('0xa2'))[_0x96c9('0x7e')](_0x4d864c[_0x96c9('0x4a')]['id']['toString'](),'VoiceQueueId')[_0x96c9('0x7e')](_0x96c9('0xbd'),_0x96c9('0x57'))[_0x96c9('0x7e')](_0x96c9('0xbd'),_0x96c9('0x58'))[_0x96c9('0x80')](_0x96c9('0xa4'))[_0x96c9('0x41')]('deletedAt\x20IS\x20NULL')[_0x96c9('0x41')](_0x96c9('0xa5'),_0x5a9a1d[_0x96c9('0xa3')][_0x96c9('0x84')]())[_0x96c9('0x41')](_0x96c9('0xac')))[_0x96c9('0x84')]();_0x22a760[_0x96c9('0xad')](db[_0x96c9('0x71')][_0x96c9('0x39')](_0x1db15f));}return BPromise[_0x96c9('0x89')](_0x22a760);}})[_0x96c9('0x22')](function(){return _0x4a6c4c;})[_0x96c9('0x22')](respondWithResult(_0x20e7fe,null))[_0x96c9('0x55')](handleError(_0x20e7fe,null));};exports[_0x96c9('0xbe')]=function(_0x55f8e5,_0x28312c,_0x462e02){return db['VoiceQueue'][_0x96c9('0x4b')]({'where':{'id':_0x55f8e5[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](handleEntityNotFound(_0x28312c,null))[_0x96c9('0x22')](function(_0xf61650){if(_0xf61650){return _0xf61650[_0x96c9('0xbe')](_0x55f8e5['query'][_0x96c9('0x7c')]);}})[_0x96c9('0x22')](function(_0x119ab8){if(_0x119ab8){return db[_0x96c9('0x65')][_0x96c9('0x23')]({'where':{'ListId':_0x55f8e5[_0x96c9('0x39')][_0x96c9('0x7c')],'VoiceQueueId':_0x55f8e5[_0x96c9('0x4a')]['id']}})[_0x96c9('0x22')](function(){return _0x119ab8;});}})['then'](respondWithStatusCode(_0x28312c,null))[_0x96c9('0x55')](handleError(_0x28312c,null));}; \ No newline at end of file +var _0x96e0=['where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','clone','length','createdAt','updatedAt','omit','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','sort','pick','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','QueryTypes','SELECT','every','includes','all','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','online','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','select','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','push','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','zip-dir','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','count','set','reject','save','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','limit','order'];(function(_0x5734d5,_0x14f665){var _0x3db21e=function(_0x2cca23){while(--_0x2cca23){_0x5734d5['push'](_0x5734d5['shift']());}};_0x3db21e(++_0x14f665);}(_0x96e0,0x7e));var _0x096e=function(_0x3a7f46,_0x5b7bb7){_0x3a7f46=_0x3a7f46-0x0;var _0x931f3b=_0x96e0[_0x3a7f46];return _0x931f3b;};'use strict';var emlformat=require(_0x096e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x096e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x096e('0x2'));var BPromise=require(_0x096e('0x3'));var Mustache=require(_0x096e('0x4'));var util=require(_0x096e('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x096e('0x6'));var fs=require('fs');var fs_extra=require(_0x096e('0x7'));var _=require(_0x096e('0x8'));var squel=require(_0x096e('0x9'));var crypto=require(_0x096e('0xa'));var jsforce=require(_0x096e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x096e('0xc'));var querystring=require('querystring');var Papa=require(_0x096e('0xd'));var Redis=require(_0x096e('0xe'));var authService=require(_0x096e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x096e('0x10'));var hardwareService=require(_0x096e('0x11'));var logger=require(_0x096e('0x12'))('api');var utils=require(_0x096e('0x13'));var config=require(_0x096e('0x14'));var licenseUtil=require(_0x096e('0x15'));var db=require(_0x096e('0x16'))['db'];config[_0x096e('0x17')]=_[_0x096e('0x18')](config[_0x096e('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x096e('0x19'))(new Redis(config[_0x096e('0x17')]));require('./voiceQueue.socket')[_0x096e('0x1a')](socket);function respondWithStatusCode(_0x18fe8f,_0x9504de){_0x9504de=_0x9504de||0xcc;return function(_0x1de257){if(_0x1de257){return _0x18fe8f['sendStatus'](_0x9504de);}return _0x18fe8f[_0x096e('0x1b')](_0x9504de)[_0x096e('0x1c')]();};}function respondWithResult(_0x53e483,_0x3aef60){_0x3aef60=_0x3aef60||0xc8;return function(_0x565ca1){if(_0x565ca1){return _0x53e483[_0x096e('0x1b')](_0x3aef60)[_0x096e('0x1d')](_0x565ca1);}};}function respondWithFilteredResult(_0x1bf7c5,_0x41b02d){return function(_0x396f57){if(_0x396f57){var _0x38f8f0=typeof _0x41b02d[_0x096e('0x1e')]==='undefined'&&typeof _0x41b02d['limit']==='undefined';var _0x29a380=_0x396f57[_0x096e('0x1f')];var _0x50665d=_0x38f8f0?0x0:_0x41b02d[_0x096e('0x1e')];var _0x22a057=_0x38f8f0?_0x396f57['count']:_0x41b02d[_0x096e('0x1e')]+_0x41b02d['limit'];var _0x4c92ab;if(_0x22a057>=_0x29a380){_0x22a057=_0x29a380;_0x4c92ab=0xc8;}else{_0x4c92ab=0xce;}_0x1bf7c5[_0x096e('0x1b')](_0x4c92ab);return _0x1bf7c5[_0x096e('0x20')]('Content-Range',_0x50665d+'-'+_0x22a057+'/'+_0x29a380)[_0x096e('0x1d')](_0x396f57);}return null;};}function patchUpdates(_0x63bce1){return function(_0xc65c46){try{jsonpatch['apply'](_0xc65c46,_0x63bce1,!![]);}catch(_0x508232){return BPromise[_0x096e('0x21')](_0x508232);}return _0xc65c46[_0x096e('0x22')]();};}function saveUpdates(_0x2affa2,_0x1c1968){return function(_0x2bbcbe){if(_0x2bbcbe){return _0x2bbcbe['update'](_0x2affa2)[_0x096e('0x23')](function(_0x5f5189){return _0x5f5189;});}return null;};}function removeEntity(_0x2a368a,_0xccfaac){return function(_0x3d924){if(_0x3d924){return _0x3d924['destroy']()[_0x096e('0x23')](function(){var _0x56a2c3=_0x3d924['get']({'plain':!![]});var _0x455b5c=[{'name':_0x096e('0x24'),'value':_0x096e('0x25'),'ignore':![]},{'name':_0x096e('0x26'),'value':_0x096e('0x27'),'ignore':![]}];var _0x485e79=_(_0x455b5c)[_0x096e('0x28')](_0x096e('0x29'))[_0x096e('0x2a')](_0x096e('0x2b'))['value']();if(_['includes'](_0x485e79,_0x56a2c3[_0x096e('0x2c')])){return;}var _0x41752b=_[_0x096e('0x2d')](_0x455b5c,[_0x096e('0x2b'),_0x56a2c3[_0x096e('0x2c')]])[_0x096e('0x2e')];return db[_0x096e('0x2f')][_0x096e('0x30')]({'where':{'type':_0x41752b,'resourceId':_0x56a2c3['id']}})['then'](function(){return _0x3d924;});})[_0x096e('0x23')](function(){_0x2a368a[_0x096e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8034ab,_0x24c592){return function(_0x3ace6f){if(!_0x3ace6f){_0x8034ab[_0x096e('0x31')](0x194);}return _0x3ace6f;};}function handleError(_0x5765b0,_0x2ee96a){_0x2ee96a=_0x2ee96a||0x1f4;return function(_0x62dd3b){logger[_0x096e('0x32')](_0x62dd3b[_0x096e('0x33')]);if(_0x62dd3b[_0x096e('0x2e')]){delete _0x62dd3b['name'];}_0x5765b0[_0x096e('0x1b')](_0x2ee96a)[_0x096e('0x34')](_0x62dd3b);};}exports[_0x096e('0x35')]=function(_0x4b9957,_0x42d204){var _0x4b164b={},_0x53b50f={},_0x5bd524={'count':0x0,'rows':[]};var _0x1ea29f=_[_0x096e('0x2a')](db[_0x096e('0x36')][_0x096e('0x37')],function(_0x8b0d21){return{'name':_0x8b0d21[_0x096e('0x38')],'type':_0x8b0d21['type'][_0x096e('0x39')]};});_0x53b50f[_0x096e('0x3a')]=_['map'](_0x1ea29f,_0x096e('0x2e'));_0x53b50f[_0x096e('0x3b')]=_[_0x096e('0x3c')](_0x4b9957['query']);_0x53b50f[_0x096e('0x3d')]=_['intersection'](_0x53b50f[_0x096e('0x3a')],_0x53b50f[_0x096e('0x3b')]);_0x4b164b[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x53b50f[_0x096e('0x3a')],qs[_0x096e('0x40')](_0x4b9957[_0x096e('0x3b')][_0x096e('0x40')]));_0x4b164b[_0x096e('0x3e')]=_0x4b164b[_0x096e('0x3e')]['length']?_0x4b164b[_0x096e('0x3e')]:_0x53b50f['model'];if(!_0x4b9957[_0x096e('0x3b')]['hasOwnProperty']('nolimit')){_0x4b164b[_0x096e('0x41')]=qs['limit'](_0x4b9957[_0x096e('0x3b')][_0x096e('0x41')]);_0x4b164b['offset']=qs[_0x096e('0x1e')](_0x4b9957[_0x096e('0x3b')][_0x096e('0x1e')]);}_0x4b164b[_0x096e('0x42')]=qs['sort'](_0x4b9957[_0x096e('0x3b')]['sort']);_0x4b164b[_0x096e('0x43')]=qs[_0x096e('0x3d')](_['pick'](_0x4b9957[_0x096e('0x3b')],_0x53b50f['filters']),_0x1ea29f);if(_0x4b9957[_0x096e('0x3b')][_0x096e('0x28')]){_0x4b164b['where']=_[_0x096e('0x44')](_0x4b164b['where'],{'$or':_[_0x096e('0x2a')](_0x1ea29f,function(_0x2cb4ee){if(_0x2cb4ee[_0x096e('0x2c')]!==_0x096e('0x45')){var _0x321fe5={};_0x321fe5[_0x2cb4ee[_0x096e('0x2e')]]={'$like':'%'+_0x4b9957[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0x321fe5;}})});}_0x4b164b=_['merge']({},_0x4b164b,_0x4b9957[_0x096e('0x46')]);var _0x37c853={'where':_0x4b164b[_0x096e('0x43')]};return db[_0x096e('0x36')][_0x096e('0x1f')](_0x37c853)[_0x096e('0x23')](function(_0x4254cb){_0x5bd524['count']=_0x4254cb;if(_0x4b9957[_0x096e('0x3b')][_0x096e('0x47')]){_0x4b164b[_0x096e('0x48')]=[{'all':!![]}];}return db['VoiceQueue'][_0x096e('0x49')](_0x4b164b);})[_0x096e('0x23')](function(_0x2f957a){_0x5bd524['rows']=_0x2f957a;return _0x5bd524;})[_0x096e('0x23')](respondWithFilteredResult(_0x42d204,_0x4b164b))['catch'](handleError(_0x42d204,null));};exports[_0x096e('0x4a')]=function(_0x3b7050,_0x562bfb){var _0x342416={'raw':![],'where':{'id':_0x3b7050[_0x096e('0x4b')]['id']}},_0x5ad99f={};_0x5ad99f[_0x096e('0x3a')]=_[_0x096e('0x3c')](db[_0x096e('0x36')]['rawAttributes']);_0x5ad99f[_0x096e('0x3b')]=_[_0x096e('0x3c')](_0x3b7050[_0x096e('0x3b')]);_0x5ad99f[_0x096e('0x3d')]=_[_0x096e('0x3f')](_0x5ad99f[_0x096e('0x3a')],_0x5ad99f[_0x096e('0x3b')]);_0x342416[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x5ad99f[_0x096e('0x3a')],qs['fields'](_0x3b7050[_0x096e('0x3b')][_0x096e('0x40')]));_0x342416['attributes']=_0x342416[_0x096e('0x3e')]['length']?_0x342416[_0x096e('0x3e')]:_0x5ad99f[_0x096e('0x3a')];if(_0x3b7050[_0x096e('0x3b')][_0x096e('0x47')]){_0x342416[_0x096e('0x48')]=[{'all':!![]}];}_0x342416=_['merge']({},_0x342416,_0x3b7050[_0x096e('0x46')]);return db[_0x096e('0x36')][_0x096e('0x2d')](_0x342416)[_0x096e('0x23')](handleEntityNotFound(_0x562bfb,null))['then'](respondWithResult(_0x562bfb,null))[_0x096e('0x4c')](handleError(_0x562bfb,null));};exports[_0x096e('0x4d')]=function(_0x58d291,_0x2c15da){return db[_0x096e('0x36')]['create'](_0x58d291[_0x096e('0x4e')],{})['then'](function(_0x3a485a){var _0x4c087e=_0x58d291[_0x096e('0x4f')][_0x096e('0x50')]({'plain':!![]});if(!_0x4c087e)throw new Error(_0x096e('0x51'));if(_0x4c087e['role']==='user'){var _0x2575b0=_0x3a485a[_0x096e('0x50')]({'plain':!![]});var _0x2b22af=[{'name':_0x096e('0x24'),'value':_0x096e('0x25')},{'name':_0x096e('0x26'),'value':'outbound'}];var _0x4b875b=_['find'](_0x2b22af,[_0x096e('0x2b'),_0x2575b0[_0x096e('0x2c')]])[_0x096e('0x2e')];return db[_0x096e('0x52')][_0x096e('0x2d')]({'where':{'name':_0x4b875b,'userProfileId':_0x4c087e[_0x096e('0x53')]},'raw':!![]})['then'](function(_0x2c8d24){if(_0x2c8d24&&_0x2c8d24[_0x096e('0x54')]===0x0){return db[_0x096e('0x2f')][_0x096e('0x4d')]({'name':_0x2575b0['name'],'resourceId':_0x2575b0['id'],'type':_0x2c8d24[_0x096e('0x2e')],'sectionId':_0x2c8d24['id']},{})[_0x096e('0x23')](function(){return _0x3a485a;});}else{return _0x3a485a;}})['catch'](function(_0x4c6c74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c6c74);throw _0x4c6c74;});}return _0x3a485a;})[_0x096e('0x23')](respondWithResult(_0x2c15da,0xc9))[_0x096e('0x4c')](handleError(_0x2c15da,null));};exports[_0x096e('0x55')]=function(_0x480d98,_0x3a20d7){var _0x1aa273={'where':{'id':_0x480d98[_0x096e('0x4b')]['id']}},_0xf0d84b={};_0xf0d84b[_0x096e('0x3a')]=_[_0x096e('0x3c')](db[_0x096e('0x36')][_0x096e('0x37')]);_0x1aa273['attributes']=_['intersection'](_0xf0d84b[_0x096e('0x3a')],qs[_0x096e('0x40')](_0x480d98[_0x096e('0x3b')][_0x096e('0x40')]));_0x1aa273[_0x096e('0x3e')]=_0x1aa273[_0x096e('0x3e')][_0x096e('0x56')]?_0x1aa273[_0x096e('0x3e')]:_0xf0d84b[_0x096e('0x3a')];if(_0x480d98[_0x096e('0x3b')][_0x096e('0x47')]){_0x1aa273[_0x096e('0x48')]=[{'all':!![]}];}_0x1aa273=_['merge']({},_0x1aa273,_0x480d98[_0x096e('0x46')]);return db[_0x096e('0x36')][_0x096e('0x2d')](_0x1aa273)[_0x096e('0x23')](handleEntityNotFound(_0x3a20d7,null))[_0x096e('0x23')](function(_0x14e1aa){if(_0x14e1aa){var _0x1d780e=_0x14e1aa['get']({'plain':!![]});_0x1d780e=qs['omit'](_0x1d780e,['id',_0x096e('0x57'),_0x096e('0x58')]);_0x480d98['body']=_[_0x096e('0x59')](_0x480d98[_0x096e('0x4e')],['id',_0x096e('0x57'),_0x096e('0x58')]);return db[_0x096e('0x36')]['create'](_[_0x096e('0x44')](_0x1d780e,_0x480d98[_0x096e('0x4e')]),{'include':_0x480d98['query'][_0x096e('0x47')]?[{'all':!![]}]:undefined})[_0x096e('0x23')](function(_0x541232){var _0x55170c=_0x480d98[_0x096e('0x4f')]['get']({'plain':!![]});if(!_0x55170c)throw new Error(_0x096e('0x51'));if(_0x55170c[_0x096e('0x5a')]===_0x096e('0x4f')){var _0x129388=_0x541232[_0x096e('0x50')]({'plain':!![]});var _0x479e0a=[{'name':'VoiceQueues','value':_0x096e('0x25')},{'name':_0x096e('0x26'),'value':_0x096e('0x27')}];var _0x5165f1=_[_0x096e('0x2d')](_0x479e0a,['value',_0x129388[_0x096e('0x2c')]])[_0x096e('0x2e')];return db[_0x096e('0x52')]['find']({'where':{'name':_0x5165f1,'userProfileId':_0x55170c[_0x096e('0x53')]},'raw':!![]})[_0x096e('0x23')](function(_0x4d35bb){if(_0x4d35bb&&_0x4d35bb[_0x096e('0x54')]===0x0){return db[_0x096e('0x2f')][_0x096e('0x4d')]({'name':_0x129388['name'],'resourceId':_0x129388['id'],'type':_0x4d35bb[_0x096e('0x2e')],'sectionId':_0x4d35bb['id']},{})['then'](function(){return _0x541232;});}else{return _0x541232;}})[_0x096e('0x4c')](function(_0x3c4fe2){logger[_0x096e('0x32')](_0x096e('0x5b'),_0x3c4fe2);throw _0x3c4fe2;});}return _0x541232;});}})[_0x096e('0x23')](respondWithResult(_0x3a20d7,0xc9))[_0x096e('0x4c')](handleError(_0x3a20d7,null));};exports[_0x096e('0x5c')]=function(_0x32ccbe,_0xff3dde){if(_0x32ccbe['body']['id']){delete _0x32ccbe[_0x096e('0x4e')]['id'];}return db[_0x096e('0x36')][_0x096e('0x2d')]({'where':{'id':_0x32ccbe[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0xff3dde,null))[_0x096e('0x23')](saveUpdates(_0x32ccbe[_0x096e('0x4e')],null))[_0x096e('0x23')](respondWithResult(_0xff3dde,null))[_0x096e('0x4c')](handleError(_0xff3dde,null));};exports[_0x096e('0x30')]=function(_0x54223f,_0x5b9e9b){return db['VoiceQueue'][_0x096e('0x2d')]({'where':{'id':_0x54223f[_0x096e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b9e9b,null))[_0x096e('0x23')](removeEntity(_0x5b9e9b,null))[_0x096e('0x4c')](handleError(_0x5b9e9b,null));};exports[_0x096e('0x5d')]=function(_0x3744bb,_0x367bbe,_0x3b1009){var _0x2b4bd3={'raw':![],'where':{}};var _0x15da21={};var _0x2ef808={'count':0x0,'rows':[]};return db[_0x096e('0x36')][_0x096e('0x5e')]({'where':{'id':_0x3744bb[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x367bbe,null))['then'](function(_0x2e00ac){if(_0x2e00ac){_0x15da21[_0x096e('0x3a')]=_[_0x096e('0x3c')](db[_0x096e('0x5f')][_0x096e('0x37')]);_0x15da21[_0x096e('0x3b')]=_[_0x096e('0x3c')](_0x3744bb['query']);_0x15da21[_0x096e('0x3d')]=_[_0x096e('0x3f')](_0x15da21[_0x096e('0x3a')],_0x15da21[_0x096e('0x3b')]);_0x2b4bd3[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x15da21[_0x096e('0x3a')],qs[_0x096e('0x40')](_0x3744bb['query'][_0x096e('0x40')]));_0x2b4bd3[_0x096e('0x3e')]=_0x2b4bd3[_0x096e('0x3e')]['length']?_0x2b4bd3[_0x096e('0x3e')]:_0x15da21['model'];if(!_0x3744bb['query'][_0x096e('0x60')](_0x096e('0x61'))){_0x2b4bd3['limit']=qs[_0x096e('0x41')](_0x3744bb[_0x096e('0x3b')]['limit']);_0x2b4bd3[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x3744bb[_0x096e('0x3b')][_0x096e('0x1e')]);}_0x2b4bd3[_0x096e('0x42')]=qs['sort'](_0x3744bb[_0x096e('0x3b')][_0x096e('0x62')]);_0x2b4bd3['where']=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x3744bb[_0x096e('0x3b')],_0x15da21['filters']));_0x2b4bd3['where']['VoiceQueueId']=_0x2e00ac['id'];if(_0x3744bb[_0x096e('0x3b')][_0x096e('0x28')]){_0x2b4bd3['where']=_['merge'](_0x2b4bd3[_0x096e('0x43')],{'$or':_[_0x096e('0x2a')](_0x2b4bd3['attributes'],function(_0x1fac86){var _0x2ab4e2={};_0x2ab4e2[_0x1fac86]={'$like':'%'+_0x3744bb[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0x2ab4e2;})});}_0x2b4bd3=_[_0x096e('0x44')]({},_0x2b4bd3,_0x3744bb['options']);return db[_0x096e('0x5f')][_0x096e('0x1f')]({'where':_0x2b4bd3[_0x096e('0x43')]})[_0x096e('0x23')](function(_0x1b3057){_0x2ef808[_0x096e('0x1f')]=_0x1b3057;if(_0x3744bb[_0x096e('0x3b')][_0x096e('0x47')]){_0x2b4bd3[_0x096e('0x48')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2b4bd3);})[_0x096e('0x23')](function(_0x964f4e){_0x2ef808[_0x096e('0x64')]=_0x964f4e;return _0x2ef808;});}})[_0x096e('0x23')](respondWithFilteredResult(_0x367bbe,_0x2b4bd3))[_0x096e('0x4c')](handleError(_0x367bbe,null));};exports[_0x096e('0x65')]=function(_0x2e6b3f,_0x5aa95c,_0x53edea){var _0x161047={'raw':!![],'where':{}};var _0x160665={};var _0x5c24b4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x096e('0x5e')]({'where':{'id':_0x2e6b3f[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x5aa95c,null))[_0x096e('0x23')](function(_0x15cbdd){if(_0x15cbdd){_0x160665[_0x096e('0x3a')]=_[_0x096e('0x3c')](db[_0x096e('0x66')][_0x096e('0x37')]);_0x160665[_0x096e('0x3b')]=_['keys'](_0x2e6b3f[_0x096e('0x3b')]);_0x160665[_0x096e('0x3d')]=_[_0x096e('0x3f')](_0x160665[_0x096e('0x3a')],_0x160665[_0x096e('0x3b')]);_0x161047[_0x096e('0x3e')]=_['intersection'](_0x160665[_0x096e('0x3a')],qs['fields'](_0x2e6b3f[_0x096e('0x3b')][_0x096e('0x40')]));_0x161047[_0x096e('0x3e')]=_0x161047[_0x096e('0x3e')][_0x096e('0x56')]?_0x161047[_0x096e('0x3e')]:_0x160665[_0x096e('0x3a')];if(!_0x2e6b3f['query'][_0x096e('0x60')](_0x096e('0x61'))){_0x161047[_0x096e('0x41')]=qs[_0x096e('0x41')](_0x2e6b3f['query'][_0x096e('0x41')]);_0x161047[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x2e6b3f[_0x096e('0x3b')][_0x096e('0x1e')]);}_0x161047[_0x096e('0x42')]=qs['sort'](_0x2e6b3f[_0x096e('0x3b')][_0x096e('0x62')]);_0x161047['where']=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x2e6b3f['query'],_0x160665[_0x096e('0x3d')]));_0x161047[_0x096e('0x43')][_0x096e('0x67')]=_0x15cbdd['id'];if(_0x2e6b3f[_0x096e('0x3b')]['filter']){_0x161047[_0x096e('0x43')]=_[_0x096e('0x44')](_0x161047['where'],{'$or':_[_0x096e('0x2a')](_0x161047[_0x096e('0x3e')],function(_0x4ae217){var _0x18e715={};_0x18e715[_0x4ae217]={'$like':'%'+_0x2e6b3f[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0x18e715;})});}_0x161047=_['merge']({},_0x161047,_0x2e6b3f[_0x096e('0x46')]);return db['CmHopperHistory']['count']({'where':_0x161047[_0x096e('0x43')]})['then'](function(_0x14e8bc){_0x5c24b4[_0x096e('0x1f')]=_0x14e8bc;if(_0x2e6b3f[_0x096e('0x3b')]['includeAll']){_0x161047[_0x096e('0x48')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x161047);})[_0x096e('0x23')](function(_0x2ac82a){_0x5c24b4[_0x096e('0x64')]=_0x2ac82a;return _0x5c24b4;});}})[_0x096e('0x23')](respondWithFilteredResult(_0x5aa95c,_0x161047))['catch'](handleError(_0x5aa95c,null));};exports['getHopperFinals']=function(_0x4c341b,_0x42c904,_0x5922fc){var _0x1965bf={'raw':!![],'where':{}};var _0x251191={};var _0x223e9f={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x096e('0x5e')]({'where':{'id':_0x4c341b[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x42c904,null))[_0x096e('0x23')](function(_0x9f6752){if(_0x9f6752){_0x251191['model']=_[_0x096e('0x3c')](db[_0x096e('0x68')][_0x096e('0x37')]);_0x251191[_0x096e('0x3b')]=_[_0x096e('0x3c')](_0x4c341b[_0x096e('0x3b')]);_0x251191['filters']=_['intersection'](_0x251191['model'],_0x251191[_0x096e('0x3b')]);_0x1965bf[_0x096e('0x3e')]=_['intersection'](_0x251191['model'],qs[_0x096e('0x40')](_0x4c341b['query']['fields']));_0x1965bf[_0x096e('0x3e')]=_0x1965bf[_0x096e('0x3e')]['length']?_0x1965bf[_0x096e('0x3e')]:_0x251191['model'];if(!_0x4c341b[_0x096e('0x3b')][_0x096e('0x60')](_0x096e('0x61'))){_0x1965bf[_0x096e('0x41')]=qs[_0x096e('0x41')](_0x4c341b['query']['limit']);_0x1965bf[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x4c341b['query'][_0x096e('0x1e')]);}_0x1965bf[_0x096e('0x42')]=qs[_0x096e('0x62')](_0x4c341b[_0x096e('0x3b')][_0x096e('0x62')]);_0x1965bf[_0x096e('0x43')]=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x4c341b[_0x096e('0x3b')],_0x251191[_0x096e('0x3d')]));_0x1965bf[_0x096e('0x43')]['VoiceQueueId']=_0x9f6752['id'];if(_0x4c341b[_0x096e('0x3b')][_0x096e('0x28')]){_0x1965bf['where']=_[_0x096e('0x44')](_0x1965bf[_0x096e('0x43')],{'$or':_[_0x096e('0x2a')](_0x1965bf[_0x096e('0x3e')],function(_0xbf501f){var _0x4fa9e6={};_0x4fa9e6[_0xbf501f]={'$like':'%'+_0x4c341b[_0x096e('0x3b')]['filter']+'%'};return _0x4fa9e6;})});}_0x1965bf=_[_0x096e('0x44')]({},_0x1965bf,_0x4c341b['options']);return db[_0x096e('0x68')][_0x096e('0x1f')]({'where':_0x1965bf[_0x096e('0x43')]})['then'](function(_0x508322){_0x223e9f[_0x096e('0x1f')]=_0x508322;if(_0x4c341b[_0x096e('0x3b')]['includeAll']){_0x1965bf['include']=[{'all':!![]}];}return db[_0x096e('0x68')]['findAll'](_0x1965bf);})[_0x096e('0x23')](function(_0x1f2cdb){_0x223e9f['rows']=_0x1f2cdb;return _0x223e9f;});}})[_0x096e('0x23')](respondWithFilteredResult(_0x42c904,_0x1965bf))[_0x096e('0x4c')](handleError(_0x42c904,null));};exports[_0x096e('0x69')]=function(_0x303134,_0x2ae0d3,_0x370b89){var _0x3b232b={'raw':!![],'where':{}};var _0x4cebca={};var _0x53eef9={'count':0x0,'rows':[]};return db[_0x096e('0x36')][_0x096e('0x5e')]({'where':{'id':_0x303134['params']['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x2ae0d3,null))[_0x096e('0x23')](function(_0x2a19fe){if(_0x2a19fe){_0x4cebca['model']=_[_0x096e('0x3c')](db[_0x096e('0x6a')][_0x096e('0x37')]);_0x4cebca['query']=_[_0x096e('0x3c')](_0x303134[_0x096e('0x3b')]);_0x4cebca['filters']=_[_0x096e('0x3f')](_0x4cebca[_0x096e('0x3a')],_0x4cebca['query']);_0x3b232b[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x4cebca[_0x096e('0x3a')],qs[_0x096e('0x40')](_0x303134['query']['fields']));_0x3b232b['attributes']=_0x3b232b[_0x096e('0x3e')][_0x096e('0x56')]?_0x3b232b[_0x096e('0x3e')]:_0x4cebca['model'];if(!_0x303134['query'][_0x096e('0x60')]('nolimit')){_0x3b232b[_0x096e('0x41')]=qs[_0x096e('0x41')](_0x303134[_0x096e('0x3b')][_0x096e('0x41')]);_0x3b232b[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x303134['query'][_0x096e('0x1e')]);}_0x3b232b[_0x096e('0x42')]=qs[_0x096e('0x62')](_0x303134[_0x096e('0x3b')][_0x096e('0x62')]);_0x3b232b[_0x096e('0x43')]=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x303134[_0x096e('0x3b')],_0x4cebca[_0x096e('0x3d')]));_0x3b232b[_0x096e('0x43')][_0x096e('0x67')]=_0x2a19fe['id'];if(_0x303134[_0x096e('0x3b')]['filter']){_0x3b232b[_0x096e('0x43')]=_[_0x096e('0x44')](_0x3b232b[_0x096e('0x43')],{'$or':_['map'](_0x3b232b[_0x096e('0x3e')],function(_0x2801cc){var _0x3b06fd={};_0x3b06fd[_0x2801cc]={'$like':'%'+_0x303134[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0x3b06fd;})});}_0x3b232b=_[_0x096e('0x44')]({},_0x3b232b,_0x303134['options']);return db['CmHopperBlack'][_0x096e('0x1f')]({'where':_0x3b232b[_0x096e('0x43')]})[_0x096e('0x23')](function(_0x3ce989){_0x53eef9['count']=_0x3ce989;if(_0x303134[_0x096e('0x3b')][_0x096e('0x47')]){_0x3b232b[_0x096e('0x48')]=[{'all':!![]}];}return db[_0x096e('0x6a')]['findAll'](_0x3b232b);})[_0x096e('0x23')](function(_0x11ec4c){_0x53eef9[_0x096e('0x64')]=_0x11ec4c;return _0x53eef9;});}})['then'](respondWithFilteredResult(_0x2ae0d3,_0x3b232b))[_0x096e('0x4c')](handleError(_0x2ae0d3,null));};exports[_0x096e('0x6b')]=function(_0x3ea036,_0x23796c,_0x193fa1){var _0x8738cc={};var _0x406ba1={};var _0x4c1882;var _0xe6b7f0;return db[_0x096e('0x36')][_0x096e('0x5e')]({'where':{'id':_0x3ea036[_0x096e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x23796c,null))[_0x096e('0x23')](function(_0x358ea7){if(_0x358ea7){_0x4c1882=_0x358ea7;_0x406ba1[_0x096e('0x3a')]=_[_0x096e('0x3c')](db[_0x096e('0x6c')]['rawAttributes']);_0x406ba1[_0x096e('0x3b')]=_[_0x096e('0x3c')](_0x3ea036[_0x096e('0x3b')]);_0x406ba1[_0x096e('0x3d')]=_[_0x096e('0x3f')](_0x406ba1['model'],_0x406ba1[_0x096e('0x3b')]);_0x8738cc[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x406ba1[_0x096e('0x3a')],qs[_0x096e('0x40')](_0x3ea036[_0x096e('0x3b')][_0x096e('0x40')]));_0x8738cc[_0x096e('0x3e')]=_0x8738cc[_0x096e('0x3e')][_0x096e('0x56')]?_0x8738cc[_0x096e('0x3e')]:_0x406ba1['model'];_0x8738cc['order']=qs[_0x096e('0x62')](_0x3ea036['query'][_0x096e('0x62')]);_0x8738cc[_0x096e('0x43')]=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x3ea036[_0x096e('0x3b')],_0x406ba1[_0x096e('0x3d')]));if(_0x3ea036[_0x096e('0x3b')]['filter']){_0x8738cc[_0x096e('0x43')]=_[_0x096e('0x44')](_0x8738cc[_0x096e('0x43')],{'$or':_[_0x096e('0x2a')](_0x8738cc['attributes'],function(_0x443035){var _0x1ca565={};_0x1ca565[_0x443035]={'$like':'%'+_0x3ea036[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0x1ca565;})});}_0x8738cc=_[_0x096e('0x44')]({},_0x8738cc,_0x3ea036['options']);return _0x4c1882[_0x096e('0x6b')](_0x8738cc);}})['then'](function(_0x1efb74){if(_0x1efb74){_0xe6b7f0=_0x1efb74[_0x096e('0x56')];if(!_0x3ea036[_0x096e('0x3b')]['hasOwnProperty']('nolimit')){_0x8738cc[_0x096e('0x41')]=qs[_0x096e('0x41')](_0x3ea036[_0x096e('0x3b')][_0x096e('0x41')]);_0x8738cc[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x3ea036['query'][_0x096e('0x1e')]);}return _0x4c1882[_0x096e('0x6b')](_0x8738cc);}})[_0x096e('0x23')](function(_0x31b1e9){if(_0x31b1e9){return _0x31b1e9?{'count':_0xe6b7f0,'rows':_0x31b1e9}:null;}})[_0x096e('0x23')](respondWithResult(_0x23796c,null))[_0x096e('0x4c')](handleError(_0x23796c,null));};exports[_0x096e('0x6d')]=function(_0x160970,_0x348719,_0x414dcf){var _0x136e5b=_0x160970[_0x096e('0x4e')][_0x096e('0x6e')];var _0x2582d0=_['map'](_0x136e5b,'id');return db[_0x096e('0x6c')][_0x096e('0x49')]({'where':{'id':_0x2582d0},'attributes':['id'],'include':[{'model':db[_0x096e('0x6f')],'as':_0x096e('0x70'),'attributes':['id','name','online',_0x096e('0x71'),_0x096e('0x72')],'raw':!![]}]})[_0x096e('0x23')](function(_0x1ed0b0){if(_0x1ed0b0){var _0x4d2cdb=_[_0x096e('0x73')](_0x1ed0b0,function(_0x25189f){var _0x1af12d=_0x25189f[_0x096e('0x50')]({'plain':!![]});_0x1af12d[_0x096e('0x70')][_0x096e('0x74')](function(_0x5bc7c6){_0x5bc7c6[_0x096e('0x75')]=_[_0x096e('0x2d')](_0x136e5b,{'id':_0x1af12d['id']})['penalty'];});return _0x1af12d[_0x096e('0x70')];});return db['VoiceQueue'][_0x096e('0x2d')]({'where':{'id':_0x160970[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](function(_0x4bcfce){return db[_0x096e('0x76')][_0x096e('0x77')](function(_0x3b0f20){return _0x4bcfce['addTeams'](_0x2582d0,{'transaction':_0x3b0f20})[_0x096e('0x23')](function(){return BPromise[_0x096e('0x78')](_0x136e5b,function(_0x15edbc){return db['TeamVoiceQueue'][_0x096e('0x79')]({'TeamId':_0x15edbc['id'],'VoiceQueueId':_0x160970[_0x096e('0x4b')]['id'],'penalty':_0x15edbc['penalty']},{'transaction':_0x3b0f20});});})['then'](function(){return BPromise['each'](_0x4d2cdb,function(_0xc7f942){return db[_0x096e('0x7a')][_0x096e('0x7b')]({'where':{'UserId':_0xc7f942['id'],'VoiceQueueId':_0x160970[_0x096e('0x4b')]['id']},'defaults':{'penalty':_0xc7f942['penalty']},'transaction':_0x3b0f20});});})[_0x096e('0x23')](function(){return BPromise['each'](_[_0x096e('0x28')](_0x4d2cdb,{'online':!![]}),function(_0x372dfe){return db[_0x096e('0x7c')][_0x096e('0x79')]({'membername':_0x372dfe[_0x096e('0x2e')],'UserId':_0x372dfe['id'],'queue_name':_0x4bcfce['name'],'VoiceQueueId':_0x4bcfce['id'],'interface':_[_0x096e('0x7d')](_0x372dfe['interface'])?util[_0x096e('0x7e')](_0x096e('0x7f'),_0x372dfe['name']):_0x372dfe[_0x096e('0x72')],'paused':_0x372dfe['voicePause']||![],'penalty':_0x372dfe[_0x096e('0x75')]},{'transaction':_0x3b0f20});});})[_0x096e('0x23')](function(){_0x4d2cdb[_0x096e('0x74')](function(_0x282c73){socket[_0x096e('0x80')](_0x096e('0x81'),{'UserId':_0x282c73['id'],'VoiceQueueId':_0x4bcfce['id']});});});});});}})['then'](respondWithStatusCode(_0x348719,null))[_0x096e('0x4c')](handleError(_0x348719,null));};exports[_0x096e('0x82')]=function(_0x6a7ff0,_0x366d96,_0xa23066){return db[_0x096e('0x6c')][_0x096e('0x49')]({'where':{'id':_0x6a7ff0[_0x096e('0x3b')][_0x096e('0x83')]},'attributes':['id'],'include':[{'model':db[_0x096e('0x6f')],'as':_0x096e('0x70'),'attributes':['id'],'raw':!![]}]})[_0x096e('0x23')](handleEntityNotFound(_0x366d96,null))['then'](function(_0x108a09){var _0xb256ad=_['map'](_0x108a09,'id');var _0x1af920=[];var _0x5cbe5b=[];var _0xef954a=squel['select']();_0xef954a[_0x096e('0x84')](_0x096e('0x85'))[_0x096e('0x86')]('team_has_voice_queues','tq')['join'](_0x096e('0x87'),'ut',_0x096e('0x88'))[_0x096e('0x43')]('VoiceQueueId\x20=\x20?',_0x6a7ff0['params']['id']);for(var _0x29c62e=0x0;_0x29c62e<_0x108a09[_0x096e('0x56')];_0x29c62e+=0x1){let _0x2393a3=_0x108a09[_0x29c62e];for(var _0x382d3c=0x0;_0x382d3c<_0x2393a3[_0x096e('0x70')][_0x096e('0x56')];_0x382d3c+=0x1){let _0x5cbdce=_0x2393a3[_0x096e('0x70')][_0x382d3c];var _0x5bfa4d=_0xef954a['clone']();_0x5bfa4d['where']('ut.UserId\x20=\x20?',_0x5cbdce['id']);_0x5cbe5b['push'](db[_0x096e('0x76')][_0x096e('0x3b')](_0x5bfa4d[_0x096e('0x89')](),{'type':db[_0x096e('0x76')][_0x096e('0x8a')][_0x096e('0x8b')]})['then'](function(_0x34dbe3){if(_0x34dbe3['length']===0x1){return _0x5cbdce['id'];}else{var _0x41528f=_[_0x096e('0x8c')](_[_0x096e('0x2a')](_0x34dbe3,'TeamId'),function(_0x2511ff){return _[_0x096e('0x8d')](_0xb256ad,_0x2511ff);});if(_0x41528f){return _0x5cbdce['id'];}}}));}}return BPromise[_0x096e('0x8e')](_0x5cbe5b)['then'](function(_0x50395a){_0x1af920=_(_0x1af920)['union'](_0x50395a)[_0x096e('0x8f')]()[_0x096e('0x2b')]();return db[_0x096e('0x36')][_0x096e('0x2d')]({'where':{'id':_0x6a7ff0[_0x096e('0x4b')]['id']}})['then'](function(_0x299832){return db['sequelize']['transaction'](function(_0x441de9){return _0x299832[_0x096e('0x82')](_0x6a7ff0[_0x096e('0x3b')][_0x096e('0x83')],{'transaction':_0x441de9})[_0x096e('0x23')](function(){if(!_[_0x096e('0x90')](_0x1af920)){return _0x299832['removeAgents'](_0x1af920,{'transaction':_0x441de9})[_0x096e('0x23')](function(){return db[_0x096e('0x7c')][_0x096e('0x30')]({'where':{'VoiceQueueId':_0x6a7ff0[_0x096e('0x4b')]['id'],'UserId':_0x1af920},'transaction':_0x441de9});});}})[_0x096e('0x23')](function(){_0x1af920['forEach'](function(_0x35bf32){socket['emit'](_0x096e('0x91'),{'UserId':_0x35bf32,'VoiceQueueId':_0x299832['id']});});});});});});})[_0x096e('0x23')](respondWithStatusCode(_0x366d96,null))[_0x096e('0x4c')](handleError(_0x366d96,null));};exports['addAgents']=function(_0x50c268,_0xd4d1f4,_0x9820ba){var _0x5e0ae8,_0x1f41ae;return db[_0x096e('0x36')][_0x096e('0x2d')]({'where':{'id':_0x50c268['params']['id']}})[_0x096e('0x23')](handleEntityNotFound(_0xd4d1f4,null))['then'](function(_0x11c799){if(_0x11c799){_0x1f41ae=_0x11c799;return _0x11c799[_0x096e('0x92')](_0x50c268['body'][_0x096e('0x83')],_[_0x096e('0x59')](_0x50c268[_0x096e('0x4e')],[_0x096e('0x83'),'id'])||{})[_0x096e('0x93')](function(_0x44b5b2){for(var _0x12b167=0x0;_0x12b167<_0x50c268[_0x096e('0x4e')][_0x096e('0x83')]['length'];_0x12b167+=0x1){socket['emit'](_0x096e('0x81'),{'UserId':Number(_0x50c268[_0x096e('0x4e')][_0x096e('0x83')][_0x12b167]),'VoiceQueueId':Number(_0x50c268['params']['id'])});}return _0x44b5b2;});}})[_0x096e('0x23')](function(_0xc36fca){_0x5e0ae8=_0xc36fca||[];if(_0x1f41ae){return db[_0x096e('0x6f')][_0x096e('0x49')]({'where':{'id':_0x50c268[_0x096e('0x4e')]['ids']},'attributes':['id',_0x096e('0x2e'),_0x096e('0x94'),_0x096e('0x71'),_0x096e('0x72')],'raw':!![]});}})[_0x096e('0x23')](function(_0x257fe8){if(!_['isEmpty'](_0x257fe8)){var _0x8367a=[];for(var _0x21b863=0x0;_0x21b863<_0x257fe8[_0x096e('0x56')];_0x21b863++){if(_0x257fe8[_0x21b863][_0x096e('0x94')]){_0x8367a['push'](db[_0x096e('0x7c')][_0x096e('0x79')]({'membername':_0x257fe8[_0x21b863][_0x096e('0x2e')],'UserId':_0x257fe8[_0x21b863]['id'],'queue_name':_0x1f41ae[_0x096e('0x2e')],'VoiceQueueId':_0x1f41ae['id'],'interface':_['isNil'](_0x257fe8[_0x21b863][_0x096e('0x72')])?util[_0x096e('0x7e')]('SIP/%s',_0x257fe8[_0x21b863][_0x096e('0x2e')]):_0x257fe8[_0x21b863]['interface'],'paused':_0x257fe8[_0x21b863]['voicePause']||![],'penalty':_0x50c268[_0x096e('0x4e')][_0x096e('0x75')]||0x0}));}}return BPromise[_0x096e('0x8e')](_0x8367a);}})[_0x096e('0x23')](function(){return _0x5e0ae8;})[_0x096e('0x23')](respondWithResult(_0xd4d1f4,null))[_0x096e('0x4c')](handleError(_0xd4d1f4,null));};exports['removeAgents']=function(_0xac2596,_0x252db5,_0xff3d62){return db[_0x096e('0x36')][_0x096e('0x2d')]({'where':{'id':_0xac2596[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x252db5,null))['then'](function(_0x2a013d){if(_0x2a013d){return _0x2a013d[_0x096e('0x95')](_0xac2596[_0x096e('0x3b')]['ids'])[_0x096e('0x23')](function(){if(_[_0x096e('0x96')](_0xac2596[_0x096e('0x3b')]['ids'])){for(var _0x4e0ef1=0x0;_0x4e0ef1<_0xac2596[_0x096e('0x3b')][_0x096e('0x83')][_0x096e('0x56')];_0x4e0ef1+=0x1){socket[_0x096e('0x80')](_0x096e('0x91'),{'UserId':Number(_0xac2596[_0x096e('0x3b')][_0x096e('0x83')][_0x4e0ef1]),'VoiceQueueId':Number(_0xac2596[_0x096e('0x4b')]['id'])});}}else{socket[_0x096e('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0xac2596[_0x096e('0x3b')][_0x096e('0x83')]),'VoiceQueueId':Number(_0xac2596[_0x096e('0x4b')]['id'])});}});}})[_0x096e('0x23')](function(_0x27d66a){return db[_0x096e('0x7c')][_0x096e('0x30')]({'where':{'VoiceQueueId':_0xac2596[_0x096e('0x4b')]['id'],'UserId':_0xac2596['query']['ids']}})[_0x096e('0x23')](function(){return _0x27d66a;});})['then'](respondWithStatusCode(_0x252db5,null))[_0x096e('0x4c')](handleError(_0x252db5,null));};exports[_0x096e('0x97')]=function(_0x503dfd,_0x14cda9,_0x934cbd){var _0xaf208={};var _0x163561={};var _0x3d5a30;var _0x32b741;return db[_0x096e('0x36')]['findOne']({'where':{'id':_0x503dfd[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x14cda9,null))['then'](function(_0x509f74){if(_0x509f74){_0x3d5a30=_0x509f74;_0x163561[_0x096e('0x3a')]=_[_0x096e('0x3c')](db[_0x096e('0x6f')][_0x096e('0x37')]);_0x163561['query']=_[_0x096e('0x3c')](_0x503dfd[_0x096e('0x3b')]);_0x163561[_0x096e('0x3d')]=_['intersection'](_0x163561['model'],_0x163561[_0x096e('0x3b')]);_0xaf208[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x163561['model'],qs[_0x096e('0x40')](_0x503dfd[_0x096e('0x3b')][_0x096e('0x40')]));_0xaf208[_0x096e('0x3e')]=_0xaf208[_0x096e('0x3e')][_0x096e('0x56')]?_0xaf208['attributes']:_0x163561['model'];_0xaf208[_0x096e('0x42')]=qs['sort'](_0x503dfd[_0x096e('0x3b')][_0x096e('0x62')]);_0xaf208[_0x096e('0x43')]=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x503dfd[_0x096e('0x3b')],_0x163561[_0x096e('0x3d')]));if(_0x503dfd[_0x096e('0x3b')][_0x096e('0x28')]){_0xaf208[_0x096e('0x43')]=_['merge'](_0xaf208[_0x096e('0x43')],{'$or':_['map'](_0xaf208['attributes'],function(_0x188d3c){var _0x24381a={};_0x24381a[_0x188d3c]={'$like':'%'+_0x503dfd[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0x24381a;})});}_0xaf208=_['merge']({},_0xaf208,_0x503dfd[_0x096e('0x46')]);return _0x3d5a30[_0x096e('0x97')](_0xaf208);}})['then'](function(_0x21d684){if(_0x21d684){_0x32b741=_0x21d684[_0x096e('0x56')];if(!_0x503dfd[_0x096e('0x3b')]['hasOwnProperty'](_0x096e('0x61'))){_0xaf208[_0x096e('0x41')]=qs[_0x096e('0x41')](_0x503dfd[_0x096e('0x3b')]['limit']);_0xaf208[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x503dfd['query'][_0x096e('0x1e')]);}return _0x3d5a30['getAgents'](_0xaf208);}})[_0x096e('0x23')](function(_0x2a254c){if(_0x2a254c){return _0x2a254c?{'count':_0x32b741,'rows':_0x2a254c}:null;}})['then'](respondWithResult(_0x14cda9,null))['catch'](handleError(_0x14cda9,null));};exports[_0x096e('0x98')]=function(_0x3a2aaf,_0x1af250,_0x1ae423){var _0x5ce54d={};var _0x19929f={};var _0x2d6032;var _0x1d8012;return db[_0x096e('0x36')][_0x096e('0x5e')]({'where':{'id':_0x3a2aaf['params']['id']}})['then'](handleEntityNotFound(_0x1af250,null))[_0x096e('0x23')](function(_0x46737f){if(_0x46737f){_0x2d6032=_0x46737f;_0x19929f['model']=_[_0x096e('0x3c')](db[_0x096e('0x7c')][_0x096e('0x37')]);_0x19929f['query']=_[_0x096e('0x3c')](_0x3a2aaf['query']);_0x19929f[_0x096e('0x3d')]=_[_0x096e('0x3f')](_0x19929f[_0x096e('0x3a')],_0x19929f['query']);_0x5ce54d[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x19929f[_0x096e('0x3a')],qs['fields'](_0x3a2aaf[_0x096e('0x3b')][_0x096e('0x40')]));_0x5ce54d[_0x096e('0x3e')]=_0x5ce54d[_0x096e('0x3e')][_0x096e('0x56')]?_0x5ce54d['attributes']:_0x19929f[_0x096e('0x3a')];_0x5ce54d[_0x096e('0x42')]=qs['sort'](_0x3a2aaf['query'][_0x096e('0x62')]);_0x5ce54d[_0x096e('0x43')]=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x3a2aaf[_0x096e('0x3b')],_0x19929f[_0x096e('0x3d')]));if(_0x3a2aaf['query'][_0x096e('0x28')]){_0x5ce54d[_0x096e('0x43')]=_[_0x096e('0x44')](_0x5ce54d[_0x096e('0x43')],{'$or':_[_0x096e('0x2a')](_0x5ce54d[_0x096e('0x3e')],function(_0x1368b0){var _0x3483ce={};_0x3483ce[_0x1368b0]={'$like':'%'+_0x3a2aaf[_0x096e('0x3b')]['filter']+'%'};return _0x3483ce;})});}_0x5ce54d=_[_0x096e('0x44')]({},_0x5ce54d,_0x3a2aaf[_0x096e('0x46')]);return _0x2d6032[_0x096e('0x98')](_0x5ce54d);}})[_0x096e('0x23')](function(_0x7593f0){if(_0x7593f0){_0x1d8012=_0x7593f0[_0x096e('0x56')];if(!_0x3a2aaf[_0x096e('0x3b')][_0x096e('0x60')](_0x096e('0x61'))){_0x5ce54d[_0x096e('0x41')]=qs['limit'](_0x3a2aaf[_0x096e('0x3b')][_0x096e('0x41')]);_0x5ce54d[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x3a2aaf[_0x096e('0x3b')][_0x096e('0x1e')]);}return _0x2d6032[_0x096e('0x98')](_0x5ce54d);}})[_0x096e('0x23')](function(_0x44be56){return _0x44be56?{'count':_0x1d8012,'rows':_0x44be56}:null;})[_0x096e('0x23')](respondWithResult(_0x1af250,null))[_0x096e('0x4c')](handleError(_0x1af250,null));};exports['getLists']=function(_0x37b868,_0x579cc0,_0x165db2){var _0x7dee5e={};var _0x30a6df={};var _0x421550;var _0x2af88f;return db[_0x096e('0x36')][_0x096e('0x5e')]({'where':{'id':_0x37b868['params']['id']}})['then'](handleEntityNotFound(_0x579cc0,null))['then'](function(_0xc6a88f){if(_0xc6a88f){_0x421550=_0xc6a88f;_0x30a6df[_0x096e('0x3a')]=_[_0x096e('0x3c')](db[_0x096e('0x99')][_0x096e('0x37')]);_0x30a6df[_0x096e('0x3b')]=_[_0x096e('0x3c')](_0x37b868['query']);_0x30a6df['filters']=_[_0x096e('0x3f')](_0x30a6df[_0x096e('0x3a')],_0x30a6df['query']);_0x7dee5e[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x30a6df['model'],qs[_0x096e('0x40')](_0x37b868[_0x096e('0x3b')][_0x096e('0x40')]));_0x7dee5e[_0x096e('0x3e')]=_0x7dee5e[_0x096e('0x3e')][_0x096e('0x56')]?_0x7dee5e[_0x096e('0x3e')]:_0x30a6df[_0x096e('0x3a')];_0x7dee5e[_0x096e('0x42')]=qs[_0x096e('0x62')](_0x37b868[_0x096e('0x3b')][_0x096e('0x62')]);_0x7dee5e[_0x096e('0x43')]=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x37b868[_0x096e('0x3b')],_0x30a6df[_0x096e('0x3d')]));if(_0x37b868[_0x096e('0x3b')][_0x096e('0x28')]){_0x7dee5e[_0x096e('0x43')]=_['merge'](_0x7dee5e[_0x096e('0x43')],{'$or':_[_0x096e('0x2a')](_0x7dee5e[_0x096e('0x3e')],function(_0x4a54cb){var _0x3579e4={};_0x3579e4[_0x4a54cb]={'$like':'%'+_0x37b868[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0x3579e4;})});}_0x7dee5e=_[_0x096e('0x44')]({},_0x7dee5e,_0x37b868[_0x096e('0x46')]);return _0x421550[_0x096e('0x9a')](_0x7dee5e);}})[_0x096e('0x23')](function(_0x2628aa){if(_0x2628aa){_0x2af88f=_0x2628aa[_0x096e('0x56')];if(!_0x37b868[_0x096e('0x3b')][_0x096e('0x60')]('nolimit')){_0x7dee5e[_0x096e('0x41')]=qs[_0x096e('0x41')](_0x37b868[_0x096e('0x3b')][_0x096e('0x41')]);_0x7dee5e[_0x096e('0x1e')]=qs['offset'](_0x37b868['query']['offset']);}return _0x421550[_0x096e('0x9a')](_0x7dee5e);}})[_0x096e('0x23')](function(_0x489812){if(_0x489812){return _0x489812?{'count':_0x2af88f,'rows':_0x489812}:null;}})['then'](respondWithResult(_0x579cc0,null))[_0x096e('0x4c')](handleError(_0x579cc0,null));};exports[_0x096e('0x9b')]=function(_0x2c63d3,_0x172d71,_0x59958e){var _0x154a8b=moment()[_0x096e('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x9c34a8,_0x1f240c;return db['VoiceQueue'][_0x096e('0x2d')]({'where':{'id':_0x2c63d3[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x172d71,null))[_0x096e('0x23')](function(_0x35b9e6){if(_0x35b9e6){_0x1f240c=_0x35b9e6;return _0x35b9e6[_0x096e('0x9b')](_0x2c63d3[_0x096e('0x4e')][_0x096e('0x83')],_[_0x096e('0x59')](_0x2c63d3[_0x096e('0x4e')],['ids','id'])||{});}return null;})[_0x096e('0x93')](function(_0x29c027){var _0xa5041a;_0x9c34a8=_0x29c027||[];var _0x5282f4=[];if(_0x29c027){for(var _0xdcc5a2=0x0;_0xdcc5a2<_0x29c027[_0x096e('0x56')];_0xdcc5a2+=0x1){var _0x5bbba0=_0x29c027[_0xdcc5a2][_0x096e('0x50')]({'plain':!![]});_0x1f240c['dialCheckDuplicateType']=_0x2c63d3[_0x096e('0x4e')]['dialCheckDuplicateType']?_0x2c63d3[_0x096e('0x4e')][_0x096e('0x9c')]:_0x1f240c[_0x096e('0x9c')];switch(_0x1f240c[_0x096e('0x9c')]){case _0x096e('0x9d'):_0xa5041a=squel[_0x096e('0x9e')]()['into'](_0x096e('0x9f'))['fromQuery']([_0x096e('0xa0'),_0x096e('0xa1'),_0x096e('0xa2'),_0x096e('0xa3'),_0x096e('0x67'),_0x096e('0x57'),_0x096e('0x58')],squel[_0x096e('0xa4')]()[_0x096e('0x84')](_0x096e('0xa0'),'phone')[_0x096e('0x84')]('\x27'+_0x154a8b+'\x27',_0x096e('0xa1'))[_0x096e('0x84')]('id',_0x096e('0xa2'))[_0x096e('0x84')](_0x5bbba0[_0x096e('0xa5')][_0x096e('0x89')](),'ListId')[_0x096e('0x84')](_0x2c63d3['params']['id'][_0x096e('0x89')](),_0x096e('0x67'))[_0x096e('0x84')]('\x27'+_0x154a8b+'\x27','createdAt')[_0x096e('0x84')]('\x27'+_0x154a8b+'\x27',_0x096e('0x58'))[_0x096e('0x86')](_0x096e('0xa6'))['where'](_0x096e('0xa7'))[_0x096e('0x43')](_0x096e('0xa8'),_0x5bbba0[_0x096e('0xa5')][_0x096e('0x89')]())[_0x096e('0x43')](_0x096e('0xa9'))[_0x096e('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x096e('0xa4')]()[_0x096e('0x84')](_0x096e('0xaa'))[_0x096e('0x86')](_0x096e('0xab'))[_0x096e('0x43')](_0x096e('0xac'),_0x2c63d3[_0x096e('0x4b')]['id'][_0x096e('0x89')]()))['where'](_0x096e('0xad'),squel[_0x096e('0xa4')]()[_0x096e('0x84')](_0x096e('0xae'))['from'](_0x096e('0x9f'))[_0x096e('0x43')](_0x096e('0xac'),_0x2c63d3[_0x096e('0x4b')]['id'][_0x096e('0x89')]())))[_0x096e('0x89')]();break;case _0x096e('0xaf'):_0xa5041a=squel['insert']()[_0x096e('0xb0')](_0x096e('0x9f'))[_0x096e('0xb1')]([_0x096e('0xa0'),_0x096e('0xa1'),_0x096e('0xa2'),_0x096e('0xa3'),'VoiceQueueId','createdAt',_0x096e('0x58')],squel['select']()[_0x096e('0x84')](_0x096e('0xa0'),_0x096e('0xa0'))[_0x096e('0x84')]('\x27'+_0x154a8b+'\x27',_0x096e('0xa1'))[_0x096e('0x84')]('id',_0x096e('0xa2'))[_0x096e('0x84')](_0x5bbba0[_0x096e('0xa5')][_0x096e('0x89')](),_0x096e('0xa3'))[_0x096e('0x84')](_0x2c63d3['params']['id']['toString'](),_0x096e('0x67'))[_0x096e('0x84')]('\x27'+_0x154a8b+'\x27',_0x096e('0x57'))['field']('\x27'+_0x154a8b+'\x27',_0x096e('0x58'))[_0x096e('0x86')](_0x096e('0xa6'))[_0x096e('0x43')](_0x096e('0xa7'))[_0x096e('0x43')](_0x096e('0xa8'),_0x5bbba0['CmListId'][_0x096e('0x89')]())[_0x096e('0x43')](_0x096e('0xa9'))[_0x096e('0x43')](_0x096e('0xad'),squel[_0x096e('0xa4')]()[_0x096e('0x84')](_0x096e('0xae'))['from']('cm_hopper')[_0x096e('0x43')](_0x096e('0xac'),_0x2c63d3[_0x096e('0x4b')]['id'][_0x096e('0x89')]())))[_0x096e('0x89')]();break;default:_0xa5041a=squel[_0x096e('0x9e')]()[_0x096e('0xb0')](_0x096e('0x9f'))[_0x096e('0xb1')](['phone',_0x096e('0xa1'),_0x096e('0xa2'),_0x096e('0xa3'),_0x096e('0x67'),_0x096e('0x57'),_0x096e('0x58')],squel[_0x096e('0xa4')]()[_0x096e('0x84')](_0x096e('0xa0'),_0x096e('0xa0'))[_0x096e('0x84')]('\x27'+_0x154a8b+'\x27',_0x096e('0xa1'))[_0x096e('0x84')]('id',_0x096e('0xa2'))[_0x096e('0x84')](_0x5bbba0[_0x096e('0xa5')][_0x096e('0x89')](),_0x096e('0xa3'))[_0x096e('0x84')](_0x2c63d3[_0x096e('0x4b')]['id'][_0x096e('0x89')](),_0x096e('0x67'))['field']('\x27'+_0x154a8b+'\x27','createdAt')['field']('\x27'+_0x154a8b+'\x27',_0x096e('0x58'))[_0x096e('0x86')](_0x096e('0xa6'))['where']('deletedAt\x20IS\x20NULL')[_0x096e('0x43')]('ListId\x20=\x20?',_0x5bbba0[_0x096e('0xa5')][_0x096e('0x89')]())[_0x096e('0x43')](_0x096e('0xa9')))[_0x096e('0x89')]();}_0x5282f4[_0x096e('0xb2')](db[_0x096e('0x76')][_0x096e('0x3b')](_0xa5041a));}return BPromise['all'](_0x5282f4);}})[_0x096e('0x23')](function(){var _0x394870=[];var _0x203e4b=squel[_0x096e('0x9e')]()[_0x096e('0xb0')](_0x096e('0xb3'))[_0x096e('0xb1')](['CmHopperId',_0x096e('0xa0'),'OrderBy',_0x096e('0x57'),_0x096e('0x58')],squel[_0x096e('0xa4')]()['field'](_0x096e('0xb4'))[_0x096e('0x84')](_0x096e('0xb5'))[_0x096e('0x84')](_0x096e('0xb6'))['field']('\x27'+_0x154a8b+'\x27',_0x096e('0x57'))['field']('\x27'+_0x154a8b+'\x27',_0x096e('0x58'))[_0x096e('0x86')](_0x096e('0xb7'),'ci')['join'](_0x096e('0x9f'),'h',_0x096e('0xb8'))[_0x096e('0x43')]('h.scheduledat=?',_0x154a8b)[_0x096e('0x43')](_0x096e('0xb9'),_0x096e('0xba')))[_0x096e('0x89')]();_0x394870[_0x096e('0xb2')](db[_0x096e('0x76')]['query'](_0x203e4b));return BPromise['all'](_0x394870);})[_0x096e('0x23')](function(){return _0x9c34a8;})[_0x096e('0x23')](respondWithResult(_0x172d71,null))[_0x096e('0x4c')](handleError(_0x172d71,null));};exports['removeLists']=function(_0x157b88,_0x336604,_0xce1995){return db[_0x096e('0x36')][_0x096e('0x2d')]({'where':{'id':_0x157b88['params']['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x336604,null))['then'](function(_0x192cf0){if(_0x192cf0){return _0x192cf0[_0x096e('0xbb')](_0x157b88['query']['ids']);}})[_0x096e('0x23')](function(_0x4c8ed5){if(_0x4c8ed5){return db[_0x096e('0x5f')][_0x096e('0x30')]({'where':{'ListId':_0x157b88['query'][_0x096e('0x83')],'VoiceQueueId':_0x157b88['params']['id']}})['then'](function(){return _0x4c8ed5;});}})[_0x096e('0x23')](respondWithStatusCode(_0x336604,null))['catch'](handleError(_0x336604,null));};exports[_0x096e('0xbc')]=function(_0x3e5331,_0x14bd11,_0x5980b1){var _0x4049d0={};var _0x50909e={};var _0x5e4992;var _0x5d0de0;return db[_0x096e('0x36')][_0x096e('0x5e')]({'where':{'id':_0x3e5331[_0x096e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x14bd11,null))[_0x096e('0x23')](function(_0x268dd2){if(_0x268dd2){_0x5e4992=_0x268dd2;_0x50909e[_0x096e('0x3a')]=_['keys'](db[_0x096e('0x99')][_0x096e('0x37')]);_0x50909e[_0x096e('0x3b')]=_[_0x096e('0x3c')](_0x3e5331['query']);_0x50909e['filters']=_[_0x096e('0x3f')](_0x50909e['model'],_0x50909e[_0x096e('0x3b')]);_0x4049d0[_0x096e('0x3e')]=_[_0x096e('0x3f')](_0x50909e[_0x096e('0x3a')],qs[_0x096e('0x40')](_0x3e5331['query'][_0x096e('0x40')]));_0x4049d0[_0x096e('0x3e')]=_0x4049d0['attributes'][_0x096e('0x56')]?_0x4049d0['attributes']:_0x50909e[_0x096e('0x3a')];_0x4049d0[_0x096e('0x42')]=qs[_0x096e('0x62')](_0x3e5331[_0x096e('0x3b')][_0x096e('0x62')]);_0x4049d0['where']=qs[_0x096e('0x3d')](_[_0x096e('0x63')](_0x3e5331[_0x096e('0x3b')],_0x50909e[_0x096e('0x3d')]));if(_0x3e5331[_0x096e('0x3b')][_0x096e('0x28')]){_0x4049d0['where']=_[_0x096e('0x44')](_0x4049d0[_0x096e('0x43')],{'$or':_[_0x096e('0x2a')](_0x4049d0[_0x096e('0x3e')],function(_0x1e1f6c){var _0xcebe5c={};_0xcebe5c[_0x1e1f6c]={'$like':'%'+_0x3e5331[_0x096e('0x3b')][_0x096e('0x28')]+'%'};return _0xcebe5c;})});}_0x4049d0=_['merge']({},_0x4049d0,_0x3e5331[_0x096e('0x46')]);return _0x5e4992[_0x096e('0xbc')](_0x4049d0);}})[_0x096e('0x23')](function(_0x348571){if(_0x348571){_0x5d0de0=_0x348571[_0x096e('0x56')];if(!_0x3e5331[_0x096e('0x3b')]['hasOwnProperty'](_0x096e('0x61'))){_0x4049d0['limit']=qs['limit'](_0x3e5331[_0x096e('0x3b')][_0x096e('0x41')]);_0x4049d0[_0x096e('0x1e')]=qs[_0x096e('0x1e')](_0x3e5331[_0x096e('0x3b')][_0x096e('0x1e')]);}return _0x5e4992[_0x096e('0xbc')](_0x4049d0);}})[_0x096e('0x23')](function(_0x32ca19){if(_0x32ca19){return _0x32ca19?{'count':_0x5d0de0,'rows':_0x32ca19}:null;}})['then'](respondWithResult(_0x14bd11,null))['catch'](handleError(_0x14bd11,null));};exports[_0x096e('0xbd')]=function(_0x287013,_0x2b333d,_0x2a1e29){var _0x4cfc55,_0xc62571;return db['VoiceQueue'][_0x096e('0x2d')]({'where':{'id':_0x287013[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x2b333d,null))[_0x096e('0x23')](function(_0x238f9f){if(_0x238f9f){_0xc62571=_0x238f9f;return _0x238f9f[_0x096e('0xbd')](_0x287013['body'][_0x096e('0x83')],_[_0x096e('0x59')](_0x287013[_0x096e('0x4e')],['ids','id'])||{});}return null;})['spread'](function(_0x1e9f81){var _0x414a41;_0x4cfc55=_0x1e9f81||[];var _0x1ea777=[];if(_0x1e9f81){for(var _0x5863ef=0x0;_0x5863ef<_0x1e9f81[_0x096e('0x56')];_0x5863ef+=0x1){var _0xded574=_0x1e9f81[_0x5863ef]['get']({'plain':!![]});_0x414a41=squel[_0x096e('0x9e')]()[_0x096e('0xb0')](_0x096e('0xbe'))[_0x096e('0xb1')]([_0x096e('0xa0'),_0x096e('0xa2'),_0x096e('0xa3'),_0x096e('0x67'),_0x096e('0x57'),_0x096e('0x58')],squel[_0x096e('0xa4')]()[_0x096e('0x84')]('phone',_0x096e('0xa0'))[_0x096e('0x84')]('id',_0x096e('0xa2'))[_0x096e('0x84')](_0xded574['CmListId'][_0x096e('0x89')](),_0x096e('0xa3'))[_0x096e('0x84')](_0x287013[_0x096e('0x4b')]['id'][_0x096e('0x89')](),_0x096e('0x67'))['field'](_0x096e('0xbf'),_0x096e('0x57'))[_0x096e('0x84')]('NOW()','updatedAt')[_0x096e('0x86')](_0x096e('0xa6'))['where'](_0x096e('0xa7'))[_0x096e('0x43')](_0x096e('0xa8'),_0xded574['CmListId']['toString']())[_0x096e('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x1ea777[_0x096e('0xb2')](db['sequelize'][_0x096e('0x3b')](_0x414a41));}return BPromise[_0x096e('0x8e')](_0x1ea777);}})[_0x096e('0x23')](function(){return _0x4cfc55;})[_0x096e('0x23')](respondWithResult(_0x2b333d,null))['catch'](handleError(_0x2b333d,null));};exports[_0x096e('0xc0')]=function(_0x54bacc,_0x3d3118,_0x2298b1){return db[_0x096e('0x36')][_0x096e('0x2d')]({'where':{'id':_0x54bacc[_0x096e('0x4b')]['id']}})[_0x096e('0x23')](handleEntityNotFound(_0x3d3118,null))[_0x096e('0x23')](function(_0x4959f7){if(_0x4959f7){return _0x4959f7['removeBlackLists'](_0x54bacc[_0x096e('0x3b')]['ids']);}})[_0x096e('0x23')](function(_0x2759ea){if(_0x2759ea){return db[_0x096e('0x6a')]['destroy']({'where':{'ListId':_0x54bacc[_0x096e('0x3b')][_0x096e('0x83')],'VoiceQueueId':_0x54bacc['params']['id']}})[_0x096e('0x23')](function(){return _0x2759ea;});}})['then'](respondWithStatusCode(_0x3d3118,null))[_0x096e('0x4c')](handleError(_0x3d3118,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5b20d6c..7a5669b 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 _0xd4c8=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0xdc175d,_0x37bd32){var _0x497f9e=function(_0x413c82){while(--_0x413c82){_0xdc175d['push'](_0xdc175d['shift']());}};_0x497f9e(++_0x37bd32);}(_0xd4c8,0x69));var _0x8d4c=function(_0x5cb5b7,_0x27c81e){_0x5cb5b7=_0x5cb5b7-0x0;var _0x2e85d3=_0xd4c8[_0x5cb5b7];return _0x2e85d3;};'use strict';var EventEmitter=require(_0x8d4c('0x0'));var VoiceQueue=require(_0x8d4c('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8d4c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8d4c('0x3'),'afterDestroy':_0x8d4c('0x4')};function emitEvent(_0x2abfc4){return function(_0x3da4cb,_0x3ff810,_0x11ce7a){VoiceQueueEvents[_0x8d4c('0x5')](_0x2abfc4+':'+_0x3da4cb['id'],_0x3da4cb);VoiceQueueEvents[_0x8d4c('0x5')](_0x2abfc4,_0x3da4cb);_0x11ce7a(null);};}for(var e in events){if(events[_0x8d4c('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x8d4c('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x7cc1=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x54d850,_0x59c472){var _0x4d3c3a=function(_0x18afd4){while(--_0x18afd4){_0x54d850['push'](_0x54d850['shift']());}};_0x4d3c3a(++_0x59c472);}(_0x7cc1,0x171));var _0x17cc=function(_0x3939dc,_0x481952){_0x3939dc=_0x3939dc-0x0;var _0x391293=_0x7cc1[_0x3939dc];return _0x391293;};'use strict';var EventEmitter=require(_0x17cc('0x0'));var VoiceQueue=require(_0x17cc('0x1'))['db'][_0x17cc('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x17cc('0x3')](0x0);var events={'afterCreate':_0x17cc('0x4'),'afterUpdate':_0x17cc('0x5'),'afterDestroy':_0x17cc('0x6')};function emitEvent(_0x4e8502){return function(_0x34eebc,_0x403690,_0x5095bc){VoiceQueueEvents[_0x17cc('0x7')](_0x4e8502+':'+_0x34eebc['id'],_0x34eebc);VoiceQueueEvents[_0x17cc('0x7')](_0x4e8502,_0x34eebc);_0x5095bc(null);};}for(var e in events){if(events[_0x17cc('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 84a57d2..335ef0d 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x25a386,_0x4acd61){var _0x4d3d47=function(_0x2e4efb){while(--_0x2e4efb){_0x25a386['push'](_0x25a386['shift']());}};_0x4d3d47(++_0x4acd61);}(_0x008c,0x188));var _0xc008=function(_0xf7224d,_0x2b8c21){_0xf7224d=_0xf7224d-0x0;var _0x525740=_0x008c[_0xf7224d];return _0x525740;};'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 +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x355f89,_0x3e55ff){var _0x38d4b0=function(_0x559614){while(--_0x559614){_0x355f89['push'](_0x355f89['shift']());}};_0x38d4b0(++_0x3e55ff);}(_0x34e8,0x12c));var _0x834e=function(_0x222208,_0x136f3c){_0x222208=_0x222208-0x0;var _0x69f91=_0x34e8[_0x222208];return _0x69f91;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 22d0f1e..cdb9705 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 _0x6a87=['VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVoiceQueue','find','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x834ff9,_0xa87fee){var _0x1863c7=function(_0x43016b){while(--_0x43016b){_0x834ff9['push'](_0x834ff9['shift']());}};_0x1863c7(++_0xa87fee);}(_0x6a87,0x169));var _0x76a8=function(_0x5bb86d,_0x581891){_0x5bb86d=_0x5bb86d-0x0;var _0xef3895=_0x6a87[_0x5bb86d];return _0xef3895;};'use strict';var _=require(_0x76a8('0x0'));var util=require(_0x76a8('0x1'));var moment=require('moment');var BPromise=require(_0x76a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x76a8('0x4'));var logger=require(_0x76a8('0x5'))(_0x76a8('0x6'));var config=require('../../config/environment');var jayson=require(_0x76a8('0x7'));var client=jayson['client'][_0x76a8('0x8')]({'port':0x232a});config[_0x76a8('0x9')]=_[_0x76a8('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x76a8('0xb'))(new Redis(config[_0x76a8('0x9')]));require(_0x76a8('0xc'))[_0x76a8('0xd')](socket);function respondWithRpcPromise(_0x55db05,_0x3e4108,_0xd173cf){return new BPromise(function(_0x1c44bb,_0x30d6a5){return client['request'](_0x55db05,_0xd173cf)[_0x76a8('0xe')](function(_0x48e522){logger[_0x76a8('0xf')](_0x76a8('0x10'),_0x3e4108,_0x76a8('0x11'));logger[_0x76a8('0x12')](_0x76a8('0x13'),_0x3e4108,_0x76a8('0x11'),JSON[_0x76a8('0x14')](_0x48e522));if(_0x48e522[_0x76a8('0x15')]){if(_0x48e522[_0x76a8('0x15')]['code']===0x1f4){logger[_0x76a8('0x15')](_0x76a8('0x10'),_0x3e4108,_0x48e522[_0x76a8('0x15')][_0x76a8('0x16')]);return _0x30d6a5(_0x48e522[_0x76a8('0x15')]['message']);}logger[_0x76a8('0x15')](_0x76a8('0x10'),_0x3e4108,_0x48e522[_0x76a8('0x15')]['message']);return _0x1c44bb(_0x48e522[_0x76a8('0x15')][_0x76a8('0x16')]);}else{logger[_0x76a8('0xf')](_0x76a8('0x10'),_0x3e4108,'request\x20sent');_0x1c44bb(_0x48e522[_0x76a8('0x17')][_0x76a8('0x16')]);}})['catch'](function(_0x333d56){logger[_0x76a8('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x3e4108,_0x333d56);_0x30d6a5(_0x333d56);});});}exports[_0x76a8('0x18')]=function(_0xd40445){var _0x4e10ed=this;return new Promise(function(_0x4b778e,_0x4d9b1f){return db[_0x76a8('0x19')][_0x76a8('0x1a')]({'raw':_0xd40445['options']?_0xd40445[_0x76a8('0x1b')][_0x76a8('0x1c')]===undefined?!![]:![]:!![],'where':_0xd40445['options']?_0xd40445['options'][_0x76a8('0x1d')]||null:null,'attributes':_0xd40445[_0x76a8('0x1b')]?_0xd40445[_0x76a8('0x1b')][_0x76a8('0x1e')]||null:null,'limit':_0xd40445[_0x76a8('0x1b')]?_0xd40445['options'][_0x76a8('0x1f')]||null:null,'include':_0xd40445[_0x76a8('0x1b')]?_0xd40445[_0x76a8('0x1b')][_0x76a8('0x20')]?_[_0x76a8('0x21')](_0xd40445[_0x76a8('0x1b')][_0x76a8('0x20')],function(_0x309fbe){return{'model':db[_0x309fbe[_0x76a8('0x22')]],'as':_0x309fbe['as'],'attributes':_0x309fbe['attributes'],'include':_0x309fbe['include']?_['map'](_0x309fbe['include'],function(_0x4774b8){return{'model':db[_0x4774b8[_0x76a8('0x22')]],'as':_0x4774b8['as'],'attributes':_0x4774b8['attributes'],'include':_0x4774b8['include']?_[_0x76a8('0x21')](_0x4774b8['include'],function(_0x37a44c){return{'model':db[_0x37a44c['model']],'as':_0x37a44c['as'],'attributes':_0x37a44c['attributes']};}):[]};}):[]};}):[]:[]})[_0x76a8('0xe')](function(_0x52ab42){logger[_0x76a8('0xf')](_0x76a8('0x18'),_0xd40445);logger[_0x76a8('0x12')]('GetVoiceQueue',_0xd40445,JSON[_0x76a8('0x14')](_0x52ab42));_0x4b778e(_0x52ab42);})[_0x76a8('0x23')](function(_0x528beb){logger[_0x76a8('0x15')](_0x76a8('0x18'),_0x528beb[_0x76a8('0x16')],_0xd40445);_0x4d9b1f(_0x4e10ed['error'](0x1f4,_0x528beb[_0x76a8('0x16')]));});});};exports[_0x76a8('0x24')]=function(_0x3b6fb8){var _0x393cb9=this;return new Promise(function(_0x23079e,_0x5872f0){return db['VoiceQueue'][_0x76a8('0x25')]({'raw':_0x3b6fb8[_0x76a8('0x1b')]?_0x3b6fb8[_0x76a8('0x1b')][_0x76a8('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b6fb8[_0x76a8('0x1b')]?_0x3b6fb8['options'][_0x76a8('0x1d')]||null:null,'attributes':_0x3b6fb8[_0x76a8('0x1b')]?_0x3b6fb8[_0x76a8('0x1b')][_0x76a8('0x1e')]||null:null,'include':_0x3b6fb8['options']?_0x3b6fb8[_0x76a8('0x1b')][_0x76a8('0x20')]?_['map'](_0x3b6fb8[_0x76a8('0x1b')][_0x76a8('0x20')],function(_0x3befed){return{'model':db[_0x3befed[_0x76a8('0x22')]],'as':_0x3befed['as'],'attributes':_0x3befed[_0x76a8('0x1e')],'include':_0x3befed[_0x76a8('0x20')]?_[_0x76a8('0x21')](_0x3befed[_0x76a8('0x20')],function(_0x58d87d){return{'model':db[_0x58d87d[_0x76a8('0x22')]],'as':_0x58d87d['as'],'attributes':_0x58d87d[_0x76a8('0x1e')],'include':_0x58d87d[_0x76a8('0x20')]?_[_0x76a8('0x21')](_0x58d87d[_0x76a8('0x20')],function(_0x59a29a){return{'model':db[_0x59a29a[_0x76a8('0x22')]],'as':_0x59a29a['as'],'attributes':_0x59a29a[_0x76a8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x76a8('0xe')](function(_0x4da4cd){logger['info'](_0x76a8('0x24'),_0x3b6fb8);logger['debug']('ShowVoiceQueue',_0x3b6fb8,JSON[_0x76a8('0x14')](_0x4da4cd));_0x23079e(_0x4da4cd);})['catch'](function(_0x3d4d55){logger['error'](_0x76a8('0x24'),_0x3d4d55[_0x76a8('0x16')],_0x3b6fb8);_0x5872f0(_0x393cb9[_0x76a8('0x15')](0x1f4,_0x3d4d55[_0x76a8('0x16')]));});});}; \ No newline at end of file +var _0x269c=['VoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowVoiceQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x269c,0xab));var _0xc269=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x269c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc269('0x0'));var util=require(_0xc269('0x1'));var moment=require(_0xc269('0x2'));var BPromise=require('bluebird');var rs=require(_0xc269('0x3'));var fs=require('fs');var Redis=require(_0xc269('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc269('0x5'));var logger=require('../../config/logger')(_0xc269('0x6'));var config=require(_0xc269('0x7'));var jayson=require(_0xc269('0x8'));var client=jayson[_0xc269('0x9')][_0xc269('0xa')]({'port':0x232a});config[_0xc269('0xb')]=_[_0xc269('0xc')](config[_0xc269('0xb')],{'host':_0xc269('0xd'),'port':0x18eb});var socket=require(_0xc269('0xe'))(new Redis(config[_0xc269('0xb')]));require(_0xc269('0xf'))['register'](socket);function respondWithRpcPromise(_0x232c20,_0x255264,_0x5d062f){return new BPromise(function(_0x29ff3b,_0xe4b13e){return client[_0xc269('0x10')](_0x232c20,_0x5d062f)[_0xc269('0x11')](function(_0x160869){logger[_0xc269('0x12')](_0xc269('0x13'),_0x255264,_0xc269('0x14'));logger[_0xc269('0x15')](_0xc269('0x16'),_0x255264,_0xc269('0x14'),JSON[_0xc269('0x17')](_0x160869));if(_0x160869[_0xc269('0x18')]){if(_0x160869[_0xc269('0x18')][_0xc269('0x19')]===0x1f4){logger['error'](_0xc269('0x13'),_0x255264,_0x160869[_0xc269('0x18')][_0xc269('0x1a')]);return _0xe4b13e(_0x160869[_0xc269('0x18')][_0xc269('0x1a')]);}logger[_0xc269('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x255264,_0x160869[_0xc269('0x18')]['message']);return _0x29ff3b(_0x160869['error'][_0xc269('0x1a')]);}else{logger[_0xc269('0x12')](_0xc269('0x13'),_0x255264,_0xc269('0x14'));_0x29ff3b(_0x160869[_0xc269('0x1b')][_0xc269('0x1a')]);}})[_0xc269('0x1c')](function(_0x2fb2ec){logger['error'](_0xc269('0x13'),_0x255264,_0x2fb2ec);_0xe4b13e(_0x2fb2ec);});});}exports['GetVoiceQueue']=function(_0x5af5e8){var _0x61ebb8=this;return new Promise(function(_0x584471,_0x4de2f4){return db[_0xc269('0x1d')][_0xc269('0x1e')]({'raw':_0x5af5e8[_0xc269('0x1f')]?_0x5af5e8[_0xc269('0x1f')][_0xc269('0x20')]===undefined?!![]:![]:!![],'where':_0x5af5e8[_0xc269('0x1f')]?_0x5af5e8[_0xc269('0x1f')][_0xc269('0x21')]||null:null,'attributes':_0x5af5e8[_0xc269('0x1f')]?_0x5af5e8[_0xc269('0x1f')][_0xc269('0x22')]||null:null,'limit':_0x5af5e8['options']?_0x5af5e8[_0xc269('0x1f')][_0xc269('0x23')]||null:null,'include':_0x5af5e8[_0xc269('0x1f')]?_0x5af5e8['options'][_0xc269('0x24')]?_['map'](_0x5af5e8[_0xc269('0x1f')]['include'],function(_0x5da9a6){return{'model':db[_0x5da9a6[_0xc269('0x25')]],'as':_0x5da9a6['as'],'attributes':_0x5da9a6[_0xc269('0x22')],'include':_0x5da9a6[_0xc269('0x24')]?_['map'](_0x5da9a6[_0xc269('0x24')],function(_0xce56d3){return{'model':db[_0xce56d3[_0xc269('0x25')]],'as':_0xce56d3['as'],'attributes':_0xce56d3[_0xc269('0x22')],'include':_0xce56d3[_0xc269('0x24')]?_['map'](_0xce56d3[_0xc269('0x24')],function(_0x23d3f7){return{'model':db[_0x23d3f7[_0xc269('0x25')]],'as':_0x23d3f7['as'],'attributes':_0x23d3f7[_0xc269('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc269('0x11')](function(_0x26be1f){logger[_0xc269('0x12')]('GetVoiceQueue',_0x5af5e8);logger[_0xc269('0x15')]('GetVoiceQueue',_0x5af5e8,JSON[_0xc269('0x17')](_0x26be1f));_0x584471(_0x26be1f);})['catch'](function(_0x23b5f1){logger[_0xc269('0x18')]('GetVoiceQueue',_0x23b5f1[_0xc269('0x1a')],_0x5af5e8);_0x4de2f4(_0x61ebb8[_0xc269('0x18')](0x1f4,_0x23b5f1[_0xc269('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0xe35728){var _0x13f9ef=this;return new Promise(function(_0x409a06,_0x559459){return db[_0xc269('0x1d')]['find']({'raw':_0xe35728[_0xc269('0x1f')]?_0xe35728[_0xc269('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xe35728[_0xc269('0x1f')]?_0xe35728[_0xc269('0x1f')][_0xc269('0x21')]||null:null,'attributes':_0xe35728[_0xc269('0x1f')]?_0xe35728[_0xc269('0x1f')][_0xc269('0x22')]||null:null,'include':_0xe35728[_0xc269('0x1f')]?_0xe35728[_0xc269('0x1f')][_0xc269('0x24')]?_['map'](_0xe35728[_0xc269('0x1f')][_0xc269('0x24')],function(_0x3b9541){return{'model':db[_0x3b9541[_0xc269('0x25')]],'as':_0x3b9541['as'],'attributes':_0x3b9541[_0xc269('0x22')],'include':_0x3b9541['include']?_[_0xc269('0x26')](_0x3b9541[_0xc269('0x24')],function(_0x5867b5){return{'model':db[_0x5867b5[_0xc269('0x25')]],'as':_0x5867b5['as'],'attributes':_0x5867b5['attributes'],'include':_0x5867b5[_0xc269('0x24')]?_['map'](_0x5867b5[_0xc269('0x24')],function(_0x22b125){return{'model':db[_0x22b125[_0xc269('0x25')]],'as':_0x22b125['as'],'attributes':_0x22b125[_0xc269('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc269('0x11')](function(_0x49f01f){logger['info'](_0xc269('0x27'),_0xe35728);logger[_0xc269('0x15')](_0xc269('0x27'),_0xe35728,JSON['stringify'](_0x49f01f));_0x409a06(_0x49f01f);})[_0xc269('0x1c')](function(_0x425f45){logger[_0xc269('0x18')](_0xc269('0x27'),_0x425f45[_0xc269('0x1a')],_0xe35728);_0x559459(_0x13f9ef[_0xc269('0x18')](0x1f4,_0x425f45[_0xc269('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 24f9ff5..3f6b52c 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 _0x9d24=['emit','voiceQueue:','./voiceQueue.events','save','update'];(function(_0x4e92dc,_0xec2543){var _0x176db3=function(_0x5efa7c){while(--_0x5efa7c){_0x4e92dc['push'](_0x4e92dc['shift']());}};_0x176db3(++_0xec2543);}(_0x9d24,0x160));var _0x49d2=function(_0x48afc6,_0x183228){_0x48afc6=_0x48afc6-0x0;var _0x14de38=_0x9d24[_0x48afc6];return _0x14de38;};'use strict';var VoiceQueueEvents=require(_0x49d2('0x0'));var events=[_0x49d2('0x1'),'remove',_0x49d2('0x2')];function createListener(_0x3a4bef,_0x2a32f7){return function(_0x432b05){_0x2a32f7[_0x49d2('0x3')](_0x3a4bef,_0x432b05);};}function removeListener(_0x2c352e,_0x4bce81){return function(){VoiceQueueEvents['removeListener'](_0x2c352e,_0x4bce81);};}exports['register']=function(_0xaddc0e){for(var _0x59f816=0x0,_0x48fb95=events['length'];_0x59f816<_0x48fb95;_0x59f816++){var _0x63d135=events[_0x59f816];var _0x25dde5=createListener(_0x49d2('0x4')+_0x63d135,_0xaddc0e);VoiceQueueEvents['on'](_0x63d135,_0x25dde5);}}; \ No newline at end of file +var _0x920a=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','update'];(function(_0x244d4d,_0x30eebb){var _0x176ff4=function(_0x286885){while(--_0x286885){_0x244d4d['push'](_0x244d4d['shift']());}};_0x176ff4(++_0x30eebb);}(_0x920a,0x1bd));var _0xa920=function(_0x23e41a,_0x38fdab){_0x23e41a=_0x23e41a-0x0;var _0xfe1113=_0x920a[_0x23e41a];return _0xfe1113;};'use strict';var VoiceQueueEvents=require(_0xa920('0x0'));var events=[_0xa920('0x1'),'remove',_0xa920('0x2')];function createListener(_0x38b8e8,_0x4add35){return function(_0x346cc9){_0x4add35[_0xa920('0x3')](_0x38b8e8,_0x346cc9);};}function removeListener(_0x25b848,_0x48be41){return function(){VoiceQueueEvents[_0xa920('0x4')](_0x25b848,_0x48be41);};}exports[_0xa920('0x5')]=function(_0x4a0fe1){for(var _0x21f83d=0x0,_0x5289a3=events[_0xa920('0x6')];_0x21f83d<_0x5289a3;_0x21f83d++){var _0x21a13e=events[_0x21f83d];var _0x3dc1f9=createListener(_0xa920('0x7')+_0x21a13e,_0x4a0fe1);VoiceQueueEvents['on'](_0x21a13e,_0x3dc1f9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 52475d6..95a2b55 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 _0x32f2=['/describe','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x32f2,0x97));var _0x232f=function(_0x34836a,_0x3d7194){_0x34836a=_0x34836a-0x0;var _0x13013c=_0x32f2[_0x34836a];return _0x13013c;};'use strict';var multer=require(_0x232f('0x0'));var util=require(_0x232f('0x1'));var path=require(_0x232f('0x2'));var timeout=require(_0x232f('0x3'));var express=require('express');var router=express[_0x232f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x232f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x232f('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x232f('0x7')]('/',auth[_0x232f('0x8')](),controller['index']);router[_0x232f('0x7')](_0x232f('0x9'),auth[_0x232f('0x8')](),controller[_0x232f('0xa')]);router['get']('/index',auth[_0x232f('0x8')](),controller[_0x232f('0xb')]);router['get'](_0x232f('0xc'),auth[_0x232f('0x8')](),controller[_0x232f('0xd')]);router[_0x232f('0xe')]('/',auth[_0x232f('0x8')](),controller[_0x232f('0xf')]);router[_0x232f('0x10')](_0x232f('0xc'),auth['isAuthenticated'](),controller[_0x232f('0x11')]);router[_0x232f('0x12')](_0x232f('0xc'),auth[_0x232f('0x8')](),controller['destroy']);module[_0x232f('0x13')]=router; \ No newline at end of file +var _0xd75b=['isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','post','create','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get'];(function(_0xbba421,_0x81d172){var _0x420880=function(_0x264b93){while(--_0x264b93){_0xbba421['push'](_0xbba421['shift']());}};_0x420880(++_0x81d172);}(_0xd75b,0x128));var _0xbd75=function(_0x9e8cd0,_0x30dd72){_0x9e8cd0=_0x9e8cd0-0x0;var _0x25bc77=_0xd75b[_0x9e8cd0];return _0x25bc77;};'use strict';var multer=require(_0xbd75('0x0'));var util=require(_0xbd75('0x1'));var path=require(_0xbd75('0x2'));var timeout=require(_0xbd75('0x3'));var express=require(_0xbd75('0x4'));var router=express[_0xbd75('0x5')]();var fs_extra=require(_0xbd75('0x6'));var auth=require(_0xbd75('0x7'));var interaction=require(_0xbd75('0x8'));var config=require(_0xbd75('0x9'));var controller=require(_0xbd75('0xa'));router[_0xbd75('0xb')]('/',auth[_0xbd75('0xc')](),controller[_0xbd75('0xd')]);router[_0xbd75('0xb')](_0xbd75('0xe'),auth[_0xbd75('0xc')](),controller[_0xbd75('0xf')]);router[_0xbd75('0xb')](_0xbd75('0x10'),auth[_0xbd75('0xc')](),controller[_0xbd75('0x11')]);router[_0xbd75('0xb')](_0xbd75('0x12'),auth[_0xbd75('0xc')](),controller['show']);router[_0xbd75('0x13')]('/',auth[_0xbd75('0xc')](),controller[_0xbd75('0x14')]);router[_0xbd75('0x15')]('/:id',auth[_0xbd75('0xc')](),controller['update']);router['delete']('/:id',auth[_0xbd75('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 138dab4..dde330e 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 _0x465f=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x493d12,_0x23666c){var _0x963e4=function(_0x47fbf8){while(--_0x47fbf8){_0x493d12['push'](_0x493d12['shift']());}};_0x963e4(++_0x23666c);}(_0x465f,0x1b5));var _0xf465=function(_0x1284ab,_0xa14300){_0x1284ab=_0x1284ab-0x0;var _0x5b5c79=_0x465f[_0x1284ab];return _0x5b5c79;};'use strict';var Sequelize=require(_0xf465('0x0'));var moment=require(_0xf465('0x1'));module[_0xf465('0x2')]={'type':{'type':Sequelize[_0xf465('0x3')]},'uniqueid':{'type':Sequelize[_0xf465('0x3')]},'calleridnum':{'type':Sequelize[_0xf465('0x3')]},'calleridname':{'type':Sequelize[_0xf465('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xf465('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xf465('0x4')],'set':function(_0x23024a){var _0x165c0d=moment(_0x23024a);var _0x3e0693=moment(this[_0xf465('0x5')](_0xf465('0x6')))[_0xf465('0x7')](_0xf465('0x8'));var _0x5989de=_0x165c0d[_0xf465('0x9')](_0x3e0693,_0xf465('0xa'));this[_0xf465('0xb')](_0xf465('0xc'),_0x23024a);this[_0xf465('0xb')](_0xf465('0xd'),_0x5989de||null);}},'position':{'type':Sequelize[_0xf465('0xe')]},'count':{'type':Sequelize[_0xf465('0xe')]},'queuecallerabandon':{'type':Sequelize[_0xf465('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xf465('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xf465('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf465('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xf465('0x3')],'comment':_0xf465('0x10')},'originalposition':{'type':Sequelize[_0xf465('0xe')]},'channel':{'type':Sequelize[_0xf465('0x3')]},'connectedlinenum':{'type':Sequelize[_0xf465('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf465('0x3')]},'priority':{'type':Sequelize[_0xf465('0x3')]},'holdtime':{'type':Sequelize[_0xf465('0xe')]},'mohtime':{'type':Sequelize[_0xf465('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf465('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf465('0x3')]},'transfer':{'type':Sequelize[_0xf465('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf465('0x3')],'comment':_0xf465('0x11')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf465('0x3')]},'secondDisposition':{'type':Sequelize[_0xf465('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf465('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xf465('0xe')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a83=['exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x6a83,0x1db));var _0x36a8=function(_0x3cb77d,_0x3be282){_0x3cb77d=_0x3cb77d-0x0;var _0x461fcd=_0x6a83[_0x3cb77d];return _0x461fcd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x36a8('0x0'));module[_0x36a8('0x1')]={'type':{'type':Sequelize[_0x36a8('0x2')]},'uniqueid':{'type':Sequelize[_0x36a8('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x36a8('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x36a8('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x4907eb){var _0x45fce4=moment(_0x4907eb);var _0x4f0f17=moment(this[_0x36a8('0x4')]('queuecallerjoinAt'))[_0x36a8('0x5')](_0x36a8('0x6'));var _0xbd4047=_0x45fce4[_0x36a8('0x7')](_0x4f0f17,'seconds');this[_0x36a8('0x8')](_0x36a8('0x9'),_0x4907eb);this[_0x36a8('0x8')](_0x36a8('0xa'),_0xbd4047||null);}},'position':{'type':Sequelize[_0x36a8('0xb')]},'count':{'type':Sequelize[_0x36a8('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x36a8('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x36a8('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x36a8('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x36a8('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x36a8('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x36a8('0x2')]},'connectedlinenum':{'type':Sequelize[_0x36a8('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x36a8('0x2')]},'exten':{'type':Sequelize[_0x36a8('0x2')]},'priority':{'type':Sequelize[_0x36a8('0x2')]},'holdtime':{'type':Sequelize[_0x36a8('0xb')]},'mohtime':{'type':Sequelize[_0x36a8('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x36a8('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x36a8('0x2')]},'transfer':{'type':Sequelize[_0x36a8('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x36a8('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x36a8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x36a8('0x2')]},'thirdDisposition':{'type':Sequelize[_0x36a8('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 3956ca7..e1a8d5b 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 _0x95ac=['filter','merge','options','includeAll','include','rows','catch','params','length','find','create','body','destroy','describe','getVoiceQueuesReport','findAll','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1733e6,_0x2fa487){var _0x248f5a=function(_0x259e96){while(--_0x259e96){_0x1733e6['push'](_0x1733e6['shift']());}};_0x248f5a(++_0x2fa487);}(_0x95ac,0x1b4));var _0xc95a=function(_0x38a926,_0x10ce8d){_0x38a926=_0x38a926-0x0;var _0x4c02ac=_0x95ac[_0x38a926];return _0x4c02ac;};'use strict';var emlformat=require(_0xc95a('0x0'));var rimraf=require(_0xc95a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc95a('0x2'));var rp=require(_0xc95a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc95a('0x4'));var util=require('util');var path=require(_0xc95a('0x5'));var sox=require(_0xc95a('0x6'));var csv=require(_0xc95a('0x7'));var ejs=require(_0xc95a('0x8'));var fs=require('fs');var fs_extra=require(_0xc95a('0x9'));var _=require(_0xc95a('0xa'));var squel=require(_0xc95a('0xb'));var crypto=require(_0xc95a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc95a('0xd'));var toCsv=require(_0xc95a('0x7'));var querystring=require('querystring');var Papa=require(_0xc95a('0xe'));var Redis=require(_0xc95a('0xf'));var authService=require(_0xc95a('0x10'));var qs=require(_0xc95a('0x11'));var as=require(_0xc95a('0x12'));var hardwareService=require(_0xc95a('0x13'));var logger=require(_0xc95a('0x14'))(_0xc95a('0x15'));var utils=require(_0xc95a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc95a('0x17'));var db=require(_0xc95a('0x18'))['db'];config[_0xc95a('0x19')]=_[_0xc95a('0x1a')](config[_0xc95a('0x19')],{'host':_0xc95a('0x1b'),'port':0x18eb});var socket=require(_0xc95a('0x1c'))(new Redis(config[_0xc95a('0x19')]));require(_0xc95a('0x1d'))[_0xc95a('0x1e')](socket);function respondWithStatusCode(_0x41e6af,_0x335f56){_0x335f56=_0x335f56||0xcc;return function(_0x233e4d){if(_0x233e4d){return _0x41e6af[_0xc95a('0x1f')](_0x335f56);}return _0x41e6af[_0xc95a('0x20')](_0x335f56)[_0xc95a('0x21')]();};}function respondWithResult(_0x5f0166,_0xee12b0){_0xee12b0=_0xee12b0||0xc8;return function(_0x1b47d6){if(_0x1b47d6){return _0x5f0166['status'](_0xee12b0)['json'](_0x1b47d6);}};}function respondWithFilteredResult(_0x3a3c61,_0x2458aa){return function(_0x6f1b9){if(_0x6f1b9){var _0xf9db54=typeof _0x2458aa[_0xc95a('0x22')]===_0xc95a('0x23')&&typeof _0x2458aa[_0xc95a('0x24')]==='undefined';var _0x16eedd=_0x6f1b9['count'];var _0x37f4fb=_0xf9db54?0x0:_0x2458aa[_0xc95a('0x22')];var _0x1d1110=_0xf9db54?_0x6f1b9[_0xc95a('0x25')]:_0x2458aa[_0xc95a('0x22')]+_0x2458aa[_0xc95a('0x24')];var _0x79d357;if(_0x1d1110>=_0x16eedd){_0x1d1110=_0x16eedd;_0x79d357=0xc8;}else{_0x79d357=0xce;}_0x3a3c61['status'](_0x79d357);return _0x3a3c61[_0xc95a('0x26')](_0xc95a('0x27'),_0x37f4fb+'-'+_0x1d1110+'/'+_0x16eedd)[_0xc95a('0x28')](_0x6f1b9);}return null;};}function patchUpdates(_0x1cdc91){return function(_0x180682){try{jsonpatch[_0xc95a('0x29')](_0x180682,_0x1cdc91,!![]);}catch(_0x3ff174){return BPromise[_0xc95a('0x2a')](_0x3ff174);}return _0x180682[_0xc95a('0x2b')]();};}function saveUpdates(_0x36e61e,_0x3d1361){return function(_0x37e576){if(_0x37e576){return _0x37e576[_0xc95a('0x2c')](_0x36e61e)[_0xc95a('0x2d')](function(_0x57cf77){return _0x57cf77;});}return null;};}function removeEntity(_0xa001c4,_0x30dc1a){return function(_0x6462ee){if(_0x6462ee){return _0x6462ee['destroy']()[_0xc95a('0x2d')](function(){_0xa001c4[_0xc95a('0x20')](0xcc)[_0xc95a('0x21')]();});}};}function handleEntityNotFound(_0x4f29af,_0x1389a9){return function(_0x3f3554){if(!_0x3f3554){_0x4f29af[_0xc95a('0x1f')](0x194);}return _0x3f3554;};}function handleError(_0x1f154d,_0x18c304){_0x18c304=_0x18c304||0x1f4;return function(_0x3d0d04){logger[_0xc95a('0x2e')](_0x3d0d04['stack']);if(_0x3d0d04[_0xc95a('0x2f')]){delete _0x3d0d04[_0xc95a('0x2f')];}_0x1f154d[_0xc95a('0x20')](_0x18c304)[_0xc95a('0x30')](_0x3d0d04);};}exports[_0xc95a('0x31')]=function(_0x560d89,_0x417d15){var _0x463949={},_0x5918c6={},_0x185872={'count':0x0,'rows':[]};var _0x29116e=_[_0xc95a('0x32')](db[_0xc95a('0x33')][_0xc95a('0x34')],function(_0x41e747){return{'name':_0x41e747['fieldName'],'type':_0x41e747[_0xc95a('0x35')][_0xc95a('0x36')]};});_0x5918c6[_0xc95a('0x37')]=_[_0xc95a('0x32')](_0x29116e,_0xc95a('0x2f'));_0x5918c6[_0xc95a('0x38')]=_[_0xc95a('0x39')](_0x560d89[_0xc95a('0x38')]);_0x5918c6[_0xc95a('0x3a')]=_[_0xc95a('0x3b')](_0x5918c6[_0xc95a('0x37')],_0x5918c6[_0xc95a('0x38')]);_0x463949[_0xc95a('0x3c')]=_[_0xc95a('0x3b')](_0x5918c6['model'],qs['fields'](_0x560d89['query'][_0xc95a('0x3d')]));_0x463949[_0xc95a('0x3c')]=_0x463949['attributes']['length']?_0x463949[_0xc95a('0x3c')]:_0x5918c6[_0xc95a('0x37')];if(!_0x560d89[_0xc95a('0x38')][_0xc95a('0x3e')](_0xc95a('0x3f'))){_0x463949[_0xc95a('0x24')]=qs['limit'](_0x560d89['query'][_0xc95a('0x24')]);_0x463949[_0xc95a('0x22')]=qs[_0xc95a('0x22')](_0x560d89['query']['offset']);}_0x463949[_0xc95a('0x40')]=qs[_0xc95a('0x41')](_0x560d89[_0xc95a('0x38')][_0xc95a('0x41')]);_0x463949[_0xc95a('0x42')]=qs['filters'](_[_0xc95a('0x43')](_0x560d89[_0xc95a('0x38')],_0x5918c6[_0xc95a('0x3a')]),_0x29116e);if(_0x560d89[_0xc95a('0x38')][_0xc95a('0x44')]){_0x463949[_0xc95a('0x42')]=_[_0xc95a('0x45')](_0x463949[_0xc95a('0x42')],{'$or':_[_0xc95a('0x32')](_0x29116e,function(_0x2fa170){if(_0x2fa170[_0xc95a('0x35')]!=='VIRTUAL'){var _0x1c22b4={};_0x1c22b4[_0x2fa170[_0xc95a('0x2f')]]={'$like':'%'+_0x560d89[_0xc95a('0x38')][_0xc95a('0x44')]+'%'};return _0x1c22b4;}})});}_0x463949=_[_0xc95a('0x45')]({},_0x463949,_0x560d89[_0xc95a('0x46')]);var _0x33eca1={'where':_0x463949[_0xc95a('0x42')]};return db[_0xc95a('0x33')][_0xc95a('0x25')](_0x33eca1)[_0xc95a('0x2d')](function(_0xe79bc1){_0x185872[_0xc95a('0x25')]=_0xe79bc1;if(_0x560d89[_0xc95a('0x38')][_0xc95a('0x47')]){_0x463949[_0xc95a('0x48')]=[{'all':!![]}];}return db[_0xc95a('0x33')]['findAll'](_0x463949);})[_0xc95a('0x2d')](function(_0xedb216){_0x185872[_0xc95a('0x49')]=_0xedb216;return _0x185872;})[_0xc95a('0x2d')](respondWithFilteredResult(_0x417d15,_0x463949))[_0xc95a('0x4a')](handleError(_0x417d15,null));};exports['show']=function(_0x19475a,_0x3ff895){var _0x58954c={'raw':![],'where':{'id':_0x19475a[_0xc95a('0x4b')]['id']}},_0x26ba67={};_0x26ba67[_0xc95a('0x37')]=_[_0xc95a('0x39')](db[_0xc95a('0x33')]['rawAttributes']);_0x26ba67[_0xc95a('0x38')]=_[_0xc95a('0x39')](_0x19475a[_0xc95a('0x38')]);_0x26ba67[_0xc95a('0x3a')]=_[_0xc95a('0x3b')](_0x26ba67[_0xc95a('0x37')],_0x26ba67[_0xc95a('0x38')]);_0x58954c[_0xc95a('0x3c')]=_[_0xc95a('0x3b')](_0x26ba67['model'],qs['fields'](_0x19475a[_0xc95a('0x38')][_0xc95a('0x3d')]));_0x58954c[_0xc95a('0x3c')]=_0x58954c[_0xc95a('0x3c')][_0xc95a('0x4c')]?_0x58954c[_0xc95a('0x3c')]:_0x26ba67[_0xc95a('0x37')];if(_0x19475a[_0xc95a('0x38')][_0xc95a('0x47')]){_0x58954c[_0xc95a('0x48')]=[{'all':!![]}];}_0x58954c=_[_0xc95a('0x45')]({},_0x58954c,_0x19475a[_0xc95a('0x46')]);return db[_0xc95a('0x33')][_0xc95a('0x4d')](_0x58954c)[_0xc95a('0x2d')](handleEntityNotFound(_0x3ff895,null))[_0xc95a('0x2d')](respondWithResult(_0x3ff895,null))['catch'](handleError(_0x3ff895,null));};exports[_0xc95a('0x4e')]=function(_0x49974d,_0x4b7076){return db[_0xc95a('0x33')]['create'](_0x49974d[_0xc95a('0x4f')],{})[_0xc95a('0x2d')](respondWithResult(_0x4b7076,0xc9))[_0xc95a('0x4a')](handleError(_0x4b7076,null));};exports[_0xc95a('0x2c')]=function(_0xd3886,_0x39ab86){if(_0xd3886[_0xc95a('0x4f')]['id']){delete _0xd3886[_0xc95a('0x4f')]['id'];}return db[_0xc95a('0x33')]['find']({'where':{'id':_0xd3886['params']['id']}})['then'](handleEntityNotFound(_0x39ab86,null))['then'](saveUpdates(_0xd3886[_0xc95a('0x4f')],null))['then'](respondWithResult(_0x39ab86,null))['catch'](handleError(_0x39ab86,null));};exports[_0xc95a('0x50')]=function(_0x2c458d,_0x4f69e5){return db['VoiceQueueReport'][_0xc95a('0x4d')]({'where':{'id':_0x2c458d[_0xc95a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f69e5,null))['then'](removeEntity(_0x4f69e5,null))[_0xc95a('0x4a')](handleError(_0x4f69e5,null));};exports['describe']=function(_0x26b424,_0x2d1d2e){return db['VoiceQueueReport'][_0xc95a('0x51')]()['then'](respondWithResult(_0x2d1d2e,null))[_0xc95a('0x4a')](handleError(_0x2d1d2e,null));};exports[_0xc95a('0x52')]=function(_0x316bd3,_0x3c8773){var _0x9b14a0={},_0x1c7357={},_0x550ce9={'count':0x0,'rows':[]};_0x1c7357[_0xc95a('0x37')]=_['keys'](db[_0xc95a('0x33')]['rawAttributes']);_0x1c7357['query']=_[_0xc95a('0x39')](_0x316bd3[_0xc95a('0x38')]);_0x1c7357[_0xc95a('0x3a')]=_[_0xc95a('0x3b')](_0x1c7357[_0xc95a('0x37')],_0x1c7357[_0xc95a('0x38')]);_0x9b14a0[_0xc95a('0x3c')]=_[_0xc95a('0x3b')](_0x1c7357[_0xc95a('0x37')],qs['fields'](_0x316bd3[_0xc95a('0x38')]['fields']));_0x9b14a0['attributes']=_0x9b14a0[_0xc95a('0x3c')][_0xc95a('0x4c')]?_0x9b14a0[_0xc95a('0x3c')]:_0x1c7357[_0xc95a('0x37')];if(!_0x316bd3[_0xc95a('0x38')][_0xc95a('0x3e')](_0xc95a('0x3f'))){_0x9b14a0[_0xc95a('0x24')]=qs[_0xc95a('0x24')](_0x316bd3[_0xc95a('0x38')][_0xc95a('0x24')]);_0x9b14a0[_0xc95a('0x22')]=qs['offset'](_0x316bd3[_0xc95a('0x38')][_0xc95a('0x22')]);}_0x9b14a0['order']=qs[_0xc95a('0x41')](_0x316bd3[_0xc95a('0x38')][_0xc95a('0x41')]);_0x9b14a0[_0xc95a('0x42')]=qs[_0xc95a('0x3a')](_[_0xc95a('0x43')](_0x316bd3[_0xc95a('0x38')],_0x1c7357[_0xc95a('0x3a')]));if(_0x316bd3[_0xc95a('0x38')][_0xc95a('0x44')]){_0x9b14a0[_0xc95a('0x42')]=_[_0xc95a('0x45')](_0x9b14a0[_0xc95a('0x42')],{'$or':_[_0xc95a('0x32')](_0x9b14a0['attributes'],function(_0x1766a0){var _0x1637ba={};_0x1637ba[_0x1766a0]={'$like':'%'+_0x316bd3[_0xc95a('0x38')][_0xc95a('0x44')]+'%'};return _0x1637ba;})});}_0x9b14a0=_[_0xc95a('0x45')]({},_0x9b14a0,_0x316bd3[_0xc95a('0x46')]);var _0x2a14f0={'where':_0x9b14a0[_0xc95a('0x42')]};return db[_0xc95a('0x33')][_0xc95a('0x25')](_0x2a14f0)[_0xc95a('0x2d')](function(_0x3a3e67){_0x550ce9[_0xc95a('0x25')]=_0x3a3e67;if(_0x316bd3[_0xc95a('0x38')]['includeAll']){_0x9b14a0[_0xc95a('0x48')]=[{'all':!![]}];}return db[_0xc95a('0x33')][_0xc95a('0x53')](_0x9b14a0);})['then'](function(_0x204096){_0x550ce9['rows']=_0x204096;return _0x550ce9;})[_0xc95a('0x2d')](respondWithFilteredResult(_0x3c8773,_0x9b14a0,'getVoiceQueuesReport'))['catch'](handleError(_0x3c8773,null,_0xc95a('0x52')));}; \ No newline at end of file +var _0xfbc3=['VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack'];(function(_0x47ad61,_0x1a865d){var _0x4b2ac0=function(_0x834c39){while(--_0x834c39){_0x47ad61['push'](_0x47ad61['shift']());}};_0x4b2ac0(++_0x1a865d);}(_0xfbc3,0x120));var _0x3fbc=function(_0x429ac4,_0x487dc0){_0x429ac4=_0x429ac4-0x0;var _0x2834c8=_0xfbc3[_0x429ac4];return _0x2834c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fbc('0x0'));var zipdir=require(_0x3fbc('0x1'));var jsonpatch=require(_0x3fbc('0x2'));var rp=require(_0x3fbc('0x3'));var moment=require(_0x3fbc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fbc('0x5'));var util=require(_0x3fbc('0x6'));var path=require(_0x3fbc('0x7'));var sox=require(_0x3fbc('0x8'));var csv=require(_0x3fbc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fbc('0xa'));var _=require(_0x3fbc('0xb'));var squel=require(_0x3fbc('0xc'));var crypto=require('crypto');var jsforce=require(_0x3fbc('0xd'));var deskjs=require(_0x3fbc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3fbc('0xf'));var Papa=require(_0x3fbc('0x10'));var Redis=require(_0x3fbc('0x11'));var authService=require(_0x3fbc('0x12'));var qs=require(_0x3fbc('0x13'));var as=require(_0x3fbc('0x14'));var hardwareService=require(_0x3fbc('0x15'));var logger=require(_0x3fbc('0x16'))(_0x3fbc('0x17'));var utils=require('../../config/utils');var config=require(_0x3fbc('0x18'));var licenseUtil=require(_0x3fbc('0x19'));var db=require(_0x3fbc('0x1a'))['db'];config['redis']=_[_0x3fbc('0x1b')](config[_0x3fbc('0x1c')],{'host':_0x3fbc('0x1d'),'port':0x18eb});var socket=require(_0x3fbc('0x1e'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x3fbc('0x1f')](socket);function respondWithStatusCode(_0x29acb0,_0x2ca290){_0x2ca290=_0x2ca290||0xcc;return function(_0x4da227){if(_0x4da227){return _0x29acb0[_0x3fbc('0x20')](_0x2ca290);}return _0x29acb0[_0x3fbc('0x21')](_0x2ca290)[_0x3fbc('0x22')]();};}function respondWithResult(_0x412121,_0x5361b2){_0x5361b2=_0x5361b2||0xc8;return function(_0x322d1c){if(_0x322d1c){return _0x412121['status'](_0x5361b2)[_0x3fbc('0x23')](_0x322d1c);}};}function respondWithFilteredResult(_0x3a48c9,_0x281e08){return function(_0x260386){if(_0x260386){var _0x34f496=typeof _0x281e08[_0x3fbc('0x24')]===_0x3fbc('0x25')&&typeof _0x281e08[_0x3fbc('0x26')]===_0x3fbc('0x25');var _0x1f83b4=_0x260386[_0x3fbc('0x27')];var _0x362111=_0x34f496?0x0:_0x281e08[_0x3fbc('0x24')];var _0x16ba26=_0x34f496?_0x260386['count']:_0x281e08['offset']+_0x281e08[_0x3fbc('0x26')];var _0x260222;if(_0x16ba26>=_0x1f83b4){_0x16ba26=_0x1f83b4;_0x260222=0xc8;}else{_0x260222=0xce;}_0x3a48c9['status'](_0x260222);return _0x3a48c9[_0x3fbc('0x28')](_0x3fbc('0x29'),_0x362111+'-'+_0x16ba26+'/'+_0x1f83b4)['json'](_0x260386);}return null;};}function patchUpdates(_0x36f855){return function(_0x47ab28){try{jsonpatch[_0x3fbc('0x2a')](_0x47ab28,_0x36f855,!![]);}catch(_0xc50700){return BPromise['reject'](_0xc50700);}return _0x47ab28[_0x3fbc('0x2b')]();};}function saveUpdates(_0x177977,_0x24f215){return function(_0x503b21){if(_0x503b21){return _0x503b21[_0x3fbc('0x2c')](_0x177977)['then'](function(_0x15585a){return _0x15585a;});}return null;};}function removeEntity(_0x54ec6b,_0x8b418e){return function(_0x3e55f0){if(_0x3e55f0){return _0x3e55f0[_0x3fbc('0x2d')]()[_0x3fbc('0x2e')](function(){_0x54ec6b['status'](0xcc)[_0x3fbc('0x22')]();});}};}function handleEntityNotFound(_0x50deca,_0x5ac42b){return function(_0x114916){if(!_0x114916){_0x50deca['sendStatus'](0x194);}return _0x114916;};}function handleError(_0x4afd0c,_0x8ad559){_0x8ad559=_0x8ad559||0x1f4;return function(_0x29b313){logger['error'](_0x29b313[_0x3fbc('0x2f')]);if(_0x29b313['name']){delete _0x29b313['name'];}_0x4afd0c[_0x3fbc('0x21')](_0x8ad559)['send'](_0x29b313);};}exports['index']=function(_0x210b01,_0x49b9ce){var _0x4e848b={},_0x5bc6e1={},_0x4d0ee8={'count':0x0,'rows':[]};var _0x6f73aa=_['map'](db[_0x3fbc('0x30')][_0x3fbc('0x31')],function(_0x43efcd){return{'name':_0x43efcd[_0x3fbc('0x32')],'type':_0x43efcd[_0x3fbc('0x33')][_0x3fbc('0x34')]};});_0x5bc6e1[_0x3fbc('0x35')]=_[_0x3fbc('0x36')](_0x6f73aa,_0x3fbc('0x37'));_0x5bc6e1['query']=_[_0x3fbc('0x38')](_0x210b01[_0x3fbc('0x39')]);_0x5bc6e1[_0x3fbc('0x3a')]=_[_0x3fbc('0x3b')](_0x5bc6e1[_0x3fbc('0x35')],_0x5bc6e1[_0x3fbc('0x39')]);_0x4e848b[_0x3fbc('0x3c')]=_[_0x3fbc('0x3b')](_0x5bc6e1['model'],qs[_0x3fbc('0x3d')](_0x210b01[_0x3fbc('0x39')][_0x3fbc('0x3d')]));_0x4e848b[_0x3fbc('0x3c')]=_0x4e848b['attributes'][_0x3fbc('0x3e')]?_0x4e848b[_0x3fbc('0x3c')]:_0x5bc6e1[_0x3fbc('0x35')];if(!_0x210b01['query'][_0x3fbc('0x3f')](_0x3fbc('0x40'))){_0x4e848b['limit']=qs[_0x3fbc('0x26')](_0x210b01[_0x3fbc('0x39')]['limit']);_0x4e848b[_0x3fbc('0x24')]=qs[_0x3fbc('0x24')](_0x210b01['query'][_0x3fbc('0x24')]);}_0x4e848b[_0x3fbc('0x41')]=qs[_0x3fbc('0x42')](_0x210b01['query'][_0x3fbc('0x42')]);_0x4e848b[_0x3fbc('0x43')]=qs[_0x3fbc('0x3a')](_[_0x3fbc('0x44')](_0x210b01['query'],_0x5bc6e1['filters']),_0x6f73aa);if(_0x210b01[_0x3fbc('0x39')]['filter']){_0x4e848b[_0x3fbc('0x43')]=_[_0x3fbc('0x45')](_0x4e848b[_0x3fbc('0x43')],{'$or':_[_0x3fbc('0x36')](_0x6f73aa,function(_0x2432b6){if(_0x2432b6[_0x3fbc('0x33')]!=='VIRTUAL'){var _0x56cc97={};_0x56cc97[_0x2432b6[_0x3fbc('0x37')]]={'$like':'%'+_0x210b01[_0x3fbc('0x39')][_0x3fbc('0x46')]+'%'};return _0x56cc97;}})});}_0x4e848b=_[_0x3fbc('0x45')]({},_0x4e848b,_0x210b01[_0x3fbc('0x47')]);var _0x19e3ef={'where':_0x4e848b[_0x3fbc('0x43')]};return db['VoiceQueueReport']['count'](_0x19e3ef)['then'](function(_0x345d63){_0x4d0ee8[_0x3fbc('0x27')]=_0x345d63;if(_0x210b01['query'][_0x3fbc('0x48')]){_0x4e848b[_0x3fbc('0x49')]=[{'all':!![]}];}return db[_0x3fbc('0x30')][_0x3fbc('0x4a')](_0x4e848b);})[_0x3fbc('0x2e')](function(_0x39234f){_0x4d0ee8[_0x3fbc('0x4b')]=_0x39234f;return _0x4d0ee8;})[_0x3fbc('0x2e')](respondWithFilteredResult(_0x49b9ce,_0x4e848b))[_0x3fbc('0x4c')](handleError(_0x49b9ce,null));};exports[_0x3fbc('0x4d')]=function(_0x45a220,_0x28b7fc){var _0x5d8bbe={'raw':![],'where':{'id':_0x45a220['params']['id']}},_0x1b64ab={};_0x1b64ab[_0x3fbc('0x35')]=_[_0x3fbc('0x38')](db[_0x3fbc('0x30')][_0x3fbc('0x31')]);_0x1b64ab[_0x3fbc('0x39')]=_[_0x3fbc('0x38')](_0x45a220[_0x3fbc('0x39')]);_0x1b64ab[_0x3fbc('0x3a')]=_['intersection'](_0x1b64ab[_0x3fbc('0x35')],_0x1b64ab[_0x3fbc('0x39')]);_0x5d8bbe[_0x3fbc('0x3c')]=_[_0x3fbc('0x3b')](_0x1b64ab[_0x3fbc('0x35')],qs[_0x3fbc('0x3d')](_0x45a220['query'][_0x3fbc('0x3d')]));_0x5d8bbe['attributes']=_0x5d8bbe[_0x3fbc('0x3c')][_0x3fbc('0x3e')]?_0x5d8bbe[_0x3fbc('0x3c')]:_0x1b64ab[_0x3fbc('0x35')];if(_0x45a220[_0x3fbc('0x39')][_0x3fbc('0x48')]){_0x5d8bbe[_0x3fbc('0x49')]=[{'all':!![]}];}_0x5d8bbe=_[_0x3fbc('0x45')]({},_0x5d8bbe,_0x45a220[_0x3fbc('0x47')]);return db['VoiceQueueReport']['find'](_0x5d8bbe)[_0x3fbc('0x2e')](handleEntityNotFound(_0x28b7fc,null))[_0x3fbc('0x2e')](respondWithResult(_0x28b7fc,null))[_0x3fbc('0x4c')](handleError(_0x28b7fc,null));};exports[_0x3fbc('0x4e')]=function(_0xd3d9fc,_0x136258){return db[_0x3fbc('0x30')][_0x3fbc('0x4e')](_0xd3d9fc['body'],{})[_0x3fbc('0x2e')](respondWithResult(_0x136258,0xc9))['catch'](handleError(_0x136258,null));};exports['update']=function(_0x4e1feb,_0x5ccddf){if(_0x4e1feb[_0x3fbc('0x4f')]['id']){delete _0x4e1feb[_0x3fbc('0x4f')]['id'];}return db[_0x3fbc('0x30')][_0x3fbc('0x50')]({'where':{'id':_0x4e1feb[_0x3fbc('0x51')]['id']}})[_0x3fbc('0x2e')](handleEntityNotFound(_0x5ccddf,null))[_0x3fbc('0x2e')](saveUpdates(_0x4e1feb[_0x3fbc('0x4f')],null))[_0x3fbc('0x2e')](respondWithResult(_0x5ccddf,null))[_0x3fbc('0x4c')](handleError(_0x5ccddf,null));};exports[_0x3fbc('0x2d')]=function(_0x14edcd,_0x201938){return db['VoiceQueueReport'][_0x3fbc('0x50')]({'where':{'id':_0x14edcd[_0x3fbc('0x51')]['id']}})['then'](handleEntityNotFound(_0x201938,null))['then'](removeEntity(_0x201938,null))[_0x3fbc('0x4c')](handleError(_0x201938,null));};exports[_0x3fbc('0x52')]=function(_0x305354,_0x32cf7e){return db['VoiceQueueReport']['describe']()[_0x3fbc('0x2e')](respondWithResult(_0x32cf7e,null))[_0x3fbc('0x4c')](handleError(_0x32cf7e,null));};exports[_0x3fbc('0x53')]=function(_0x203a8e,_0x625923){var _0x32f081={},_0x3fb0c7={},_0x34683b={'count':0x0,'rows':[]};_0x3fb0c7[_0x3fbc('0x35')]=_[_0x3fbc('0x38')](db[_0x3fbc('0x30')][_0x3fbc('0x31')]);_0x3fb0c7[_0x3fbc('0x39')]=_[_0x3fbc('0x38')](_0x203a8e['query']);_0x3fb0c7[_0x3fbc('0x3a')]=_['intersection'](_0x3fb0c7[_0x3fbc('0x35')],_0x3fb0c7['query']);_0x32f081[_0x3fbc('0x3c')]=_['intersection'](_0x3fb0c7['model'],qs[_0x3fbc('0x3d')](_0x203a8e[_0x3fbc('0x39')][_0x3fbc('0x3d')]));_0x32f081[_0x3fbc('0x3c')]=_0x32f081[_0x3fbc('0x3c')]['length']?_0x32f081[_0x3fbc('0x3c')]:_0x3fb0c7[_0x3fbc('0x35')];if(!_0x203a8e[_0x3fbc('0x39')][_0x3fbc('0x3f')](_0x3fbc('0x40'))){_0x32f081[_0x3fbc('0x26')]=qs[_0x3fbc('0x26')](_0x203a8e[_0x3fbc('0x39')][_0x3fbc('0x26')]);_0x32f081['offset']=qs[_0x3fbc('0x24')](_0x203a8e[_0x3fbc('0x39')]['offset']);}_0x32f081[_0x3fbc('0x41')]=qs[_0x3fbc('0x42')](_0x203a8e[_0x3fbc('0x39')][_0x3fbc('0x42')]);_0x32f081['where']=qs[_0x3fbc('0x3a')](_[_0x3fbc('0x44')](_0x203a8e[_0x3fbc('0x39')],_0x3fb0c7['filters']));if(_0x203a8e[_0x3fbc('0x39')][_0x3fbc('0x46')]){_0x32f081[_0x3fbc('0x43')]=_['merge'](_0x32f081[_0x3fbc('0x43')],{'$or':_[_0x3fbc('0x36')](_0x32f081[_0x3fbc('0x3c')],function(_0x385d26){var _0x3fb96d={};_0x3fb96d[_0x385d26]={'$like':'%'+_0x203a8e['query'][_0x3fbc('0x46')]+'%'};return _0x3fb96d;})});}_0x32f081=_[_0x3fbc('0x45')]({},_0x32f081,_0x203a8e['options']);var _0x4f8921={'where':_0x32f081[_0x3fbc('0x43')]};return db[_0x3fbc('0x30')][_0x3fbc('0x27')](_0x4f8921)[_0x3fbc('0x2e')](function(_0x2cbd9f){_0x34683b['count']=_0x2cbd9f;if(_0x203a8e['query'][_0x3fbc('0x48')]){_0x32f081['include']=[{'all':!![]}];}return db[_0x3fbc('0x30')][_0x3fbc('0x4a')](_0x32f081);})[_0x3fbc('0x2e')](function(_0xa12b33){_0x34683b['rows']=_0xa12b33;return _0x34683b;})[_0x3fbc('0x2e')](respondWithFilteredResult(_0x625923,_0x32f081,_0x3fbc('0x53')))['catch'](handleError(_0x625923,null,_0x3fbc('0x53')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1a268ff..2c194d0 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 _0x318c=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x2475aa,_0x59092a){var _0xa6de99=function(_0x305f70){while(--_0x305f70){_0x2475aa['push'](_0x2475aa['shift']());}};_0xa6de99(++_0x59092a);}(_0x318c,0xb3));var _0xc318=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x318c[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0xc318('0x0'));var VoiceQueueReport=require(_0xc318('0x1'))['db'][_0xc318('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc318('0x3')](0x0);var events={'afterCreate':_0xc318('0x4'),'afterUpdate':_0xc318('0x5'),'afterDestroy':'remove'};function emitEvent(_0xce10a){return function(_0x44168e,_0x4e8869,_0x1fe8ab){VoiceQueueReportEvents[_0xc318('0x6')](_0xce10a+':'+_0x44168e['id'],_0x44168e);VoiceQueueReportEvents[_0xc318('0x6')](_0xce10a,_0x44168e);_0x1fe8ab(null);};}for(var e in events){if(events[_0xc318('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xc318('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x12b5=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hook','../../mysqldb'];(function(_0x4da708,_0x311479){var _0x33e7f=function(_0x584c69){while(--_0x584c69){_0x4da708['push'](_0x4da708['shift']());}};_0x33e7f(++_0x311479);}(_0x12b5,0x1bf));var _0x512b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12b5[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x512b('0x0'))['db'][_0x512b('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x512b('0x2')](0x0);var events={'afterCreate':_0x512b('0x3'),'afterUpdate':_0x512b('0x4'),'afterDestroy':_0x512b('0x5')};function emitEvent(_0x53831f){return function(_0x2ec3db,_0x15929c,_0x6178b5){VoiceQueueReportEvents[_0x512b('0x6')](_0x53831f+':'+_0x2ec3db['id'],_0x2ec3db);VoiceQueueReportEvents['emit'](_0x53831f,_0x2ec3db);_0x6178b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x512b('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 44726b7..5c9dca1 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 _0xc73b=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum'];(function(_0xde4e46,_0x783d3){var _0x31057d=function(_0x3395f4){while(--_0x3395f4){_0xde4e46['push'](_0xde4e46['shift']());}};_0x31057d(++_0x783d3);}(_0xc73b,0x16c));var _0xbc73=function(_0x3b9e90,_0x5f017f){_0x3b9e90=_0x3b9e90-0x0;var _0x93cf2b=_0xc73b[_0x3b9e90];return _0x93cf2b;};'use strict';var _=require(_0xbc73('0x0'));var util=require(_0xbc73('0x1'));var logger=require(_0xbc73('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbc73('0x3'));var rp=require(_0xbc73('0x4'));var fs=require('fs');var path=require(_0xbc73('0x5'));var rimraf=require(_0xbc73('0x6'));var config=require(_0xbc73('0x7'));var attributes=require(_0xbc73('0x8'));module[_0xbc73('0x9')]=function(_0x2f9756,_0xf3c45f){return _0x2f9756[_0xbc73('0xa')](_0xbc73('0xb'),attributes,{'tableName':_0xbc73('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xbc73('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3955=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_queue','uniqueid'];(function(_0x2eaac5,_0x1d6aed){var _0x9d43bf=function(_0x373254){while(--_0x373254){_0x2eaac5['push'](_0x2eaac5['shift']());}};_0x9d43bf(++_0x1d6aed);}(_0x3955,0x12c));var _0x5395=function(_0x49cd7b,_0x54d16f){_0x49cd7b=_0x49cd7b-0x0;var _0x3cedc2=_0x3955[_0x49cd7b];return _0x3cedc2;};'use strict';var _=require(_0x5395('0x0'));var util=require(_0x5395('0x1'));var logger=require(_0x5395('0x2'))('api');var moment=require(_0x5395('0x3'));var BPromise=require(_0x5395('0x4'));var rp=require(_0x5395('0x5'));var fs=require('fs');var path=require(_0x5395('0x6'));var rimraf=require(_0x5395('0x7'));var config=require(_0x5395('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x5395('0x9')]=function(_0x37e233,_0x2d7ec9){return _0x37e233['define']('VoiceQueueReport',attributes,{'tableName':_0x5395('0xa'),'paranoid':![],'indexes':[{'fields':[_0x5395('0xb')]},{'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 67214c6..84b7b02 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 _0x1044=['where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','raw','options'];(function(_0x345688,_0xe7463a){var _0x2b0b2e=function(_0x5daf47){while(--_0x5daf47){_0x345688['push'](_0x345688['shift']());}};_0x2b0b2e(++_0xe7463a);}(_0x1044,0xbb));var _0x4104=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1044[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x4104('0x0'));var util=require(_0x4104('0x1'));var moment=require('moment');var BPromise=require(_0x4104('0x2'));var rs=require(_0x4104('0x3'));var fs=require('fs');var Redis=require(_0x4104('0x4'));var db=require(_0x4104('0x5'))['db'];var utils=require(_0x4104('0x6'));var logger=require(_0x4104('0x7'))(_0x4104('0x8'));var config=require(_0x4104('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4104('0xa')]['http']({'port':0x232a});config[_0x4104('0xb')]=_[_0x4104('0xc')](config[_0x4104('0xb')],{'host':_0x4104('0xd'),'port':0x18eb});var socket=require(_0x4104('0xe'))(new Redis(config[_0x4104('0xb')]));require(_0x4104('0xf'))[_0x4104('0x10')](socket);function respondWithRpcPromise(_0x434f01,_0x6dbec7,_0x20b87c){return new BPromise(function(_0x28327a,_0x47c207){return client['request'](_0x434f01,_0x20b87c)[_0x4104('0x11')](function(_0x46386c){logger[_0x4104('0x12')](_0x4104('0x13'),_0x6dbec7,_0x4104('0x14'));logger[_0x4104('0x15')](_0x4104('0x16'),_0x6dbec7,_0x4104('0x14'),JSON[_0x4104('0x17')](_0x46386c));if(_0x46386c[_0x4104('0x18')]){if(_0x46386c[_0x4104('0x18')][_0x4104('0x19')]===0x1f4){logger[_0x4104('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x6dbec7,_0x46386c[_0x4104('0x18')][_0x4104('0x1a')]);return _0x47c207(_0x46386c[_0x4104('0x18')][_0x4104('0x1a')]);}logger[_0x4104('0x18')](_0x4104('0x13'),_0x6dbec7,_0x46386c[_0x4104('0x18')][_0x4104('0x1a')]);return _0x28327a(_0x46386c[_0x4104('0x18')][_0x4104('0x1a')]);}else{logger[_0x4104('0x12')](_0x4104('0x13'),_0x6dbec7,_0x4104('0x14'));_0x28327a(_0x46386c[_0x4104('0x1b')][_0x4104('0x1a')]);}})[_0x4104('0x1c')](function(_0x517e99){logger[_0x4104('0x18')](_0x4104('0x13'),_0x6dbec7,_0x517e99);_0x47c207(_0x517e99);});});}exports[_0x4104('0x1d')]=function(_0x535462){var _0x29ecd1=this;return new Promise(function(_0x164273,_0x2f9f5e){return db[_0x4104('0x1e')]['findAll']({'raw':_0x535462['options']?_0x535462['options'][_0x4104('0x1f')]===undefined?!![]:![]:!![],'where':_0x535462[_0x4104('0x20')]?_0x535462[_0x4104('0x20')][_0x4104('0x21')]||null:null,'attributes':_0x535462[_0x4104('0x20')]?_0x535462['options'][_0x4104('0x22')]||null:null,'limit':_0x535462[_0x4104('0x20')]?_0x535462['options'][_0x4104('0x23')]||null:null,'include':_0x535462['options']?_0x535462['options'][_0x4104('0x24')]?_[_0x4104('0x25')](_0x535462['options'][_0x4104('0x24')],function(_0x4ebc90){return{'model':db[_0x4ebc90[_0x4104('0x26')]],'as':_0x4ebc90['as'],'attributes':_0x4ebc90[_0x4104('0x22')],'include':_0x4ebc90['include']?_[_0x4104('0x25')](_0x4ebc90['include'],function(_0x8d709e){return{'model':db[_0x8d709e['model']],'as':_0x8d709e['as'],'attributes':_0x8d709e[_0x4104('0x22')],'include':_0x8d709e['include']?_[_0x4104('0x25')](_0x8d709e[_0x4104('0x24')],function(_0x206de4){return{'model':db[_0x206de4[_0x4104('0x26')]],'as':_0x206de4['as'],'attributes':_0x206de4['attributes']};}):[]};}):[]};}):[]:[]})[_0x4104('0x11')](function(_0x521200){logger['info']('GetVoiceQueueReport',_0x535462);logger['debug'](_0x4104('0x1d'),_0x535462,JSON['stringify'](_0x521200));_0x164273(_0x521200);})[_0x4104('0x1c')](function(_0x5b3397){logger[_0x4104('0x18')]('GetVoiceQueueReport',_0x5b3397[_0x4104('0x1a')],_0x535462);_0x2f9f5e(_0x29ecd1[_0x4104('0x18')](0x1f4,_0x5b3397[_0x4104('0x1a')]));});});};exports[_0x4104('0x27')]=function(_0x2f30cd){var _0x5b8d35=this;return new Promise(function(_0x17a3ac,_0x215dfe){return db[_0x4104('0x1e')][_0x4104('0x28')](_0x2f30cd[_0x4104('0x29')],{'raw':_0x2f30cd[_0x4104('0x20')]?_0x2f30cd['options'][_0x4104('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5c85da){logger[_0x4104('0x12')](_0x4104('0x27'),_0x2f30cd);logger['debug']('CreateVoiceQueueReport',_0x2f30cd,JSON['stringify'](_0x5c85da));_0x17a3ac(_0x5c85da);})[_0x4104('0x1c')](function(_0x466073){logger[_0x4104('0x18')](_0x4104('0x27'),_0x466073[_0x4104('0x1a')],_0x2f30cd);_0x215dfe(_0x5b8d35[_0x4104('0x18')](0x1f4,_0x466073[_0x4104('0x1a')]));});});};exports[_0x4104('0x2a')]=function(_0x5dda4b){var _0x582a97=this;return new Promise(function(_0x1e2746,_0x197c84){return db[_0x4104('0x1e')][_0x4104('0x2b')](_0x5dda4b[_0x4104('0x29')],{'raw':_0x5dda4b[_0x4104('0x20')]?_0x5dda4b['options'][_0x4104('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dda4b['options']?_0x5dda4b[_0x4104('0x20')][_0x4104('0x21')]||null:null,'attributes':_0x5dda4b[_0x4104('0x20')]?_0x5dda4b['options'][_0x4104('0x22')]||null:null,'limit':_0x5dda4b['options']?_0x5dda4b['options'][_0x4104('0x23')]||null:null})[_0x4104('0x11')](function(_0xf49dbc){logger[_0x4104('0x12')](_0x4104('0x2a'),_0x5dda4b);logger['debug'](_0x4104('0x2a'),_0x5dda4b,JSON[_0x4104('0x17')](_0xf49dbc));_0x1e2746(_0xf49dbc);})[_0x4104('0x1c')](function(_0x19d15a){logger[_0x4104('0x18')](_0x4104('0x2a'),_0x19d15a['message'],_0x5dda4b);_0x197c84(_0x582a97[_0x4104('0x18')](0x1f4,_0x19d15a[_0x4104('0x1a')]));});});}; \ No newline at end of file +var _0x9dde=['findAll','options','raw','where','attributes','limit','include','map','model','catch','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueueReport','VoiceQueueReport'];(function(_0x54231d,_0x129f6a){var _0x7a5bfd=function(_0x2d9d15){while(--_0x2d9d15){_0x54231d['push'](_0x54231d['shift']());}};_0x7a5bfd(++_0x129f6a);}(_0x9dde,0x116));var _0xe9dd=function(_0x12eef2,_0x7bc27d){_0x12eef2=_0x12eef2-0x0;var _0x5a1e45=_0x9dde[_0x12eef2];return _0x5a1e45;};'use strict';var _=require(_0xe9dd('0x0'));var util=require(_0xe9dd('0x1'));var moment=require(_0xe9dd('0x2'));var BPromise=require(_0xe9dd('0x3'));var rs=require(_0xe9dd('0x4'));var fs=require('fs');var Redis=require(_0xe9dd('0x5'));var db=require(_0xe9dd('0x6'))['db'];var utils=require(_0xe9dd('0x7'));var logger=require('../../config/logger')(_0xe9dd('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe9dd('0x9')][_0xe9dd('0xa')]({'port':0x232a});config['redis']=_[_0xe9dd('0xb')](config[_0xe9dd('0xc')],{'host':_0xe9dd('0xd'),'port':0x18eb});var socket=require(_0xe9dd('0xe'))(new Redis(config['redis']));require(_0xe9dd('0xf'))[_0xe9dd('0x10')](socket);function respondWithRpcPromise(_0x8b2521,_0x3f85d9,_0x462ec6){return new BPromise(function(_0x3e7b67,_0xef74f2){return client[_0xe9dd('0x11')](_0x8b2521,_0x462ec6)[_0xe9dd('0x12')](function(_0x447d9a){logger[_0xe9dd('0x13')](_0xe9dd('0x14'),_0x3f85d9,_0xe9dd('0x15'));logger[_0xe9dd('0x16')](_0xe9dd('0x17'),_0x3f85d9,_0xe9dd('0x15'),JSON[_0xe9dd('0x18')](_0x447d9a));if(_0x447d9a['error']){if(_0x447d9a[_0xe9dd('0x19')]['code']===0x1f4){logger[_0xe9dd('0x19')](_0xe9dd('0x14'),_0x3f85d9,_0x447d9a[_0xe9dd('0x19')][_0xe9dd('0x1a')]);return _0xef74f2(_0x447d9a['error'][_0xe9dd('0x1a')]);}logger[_0xe9dd('0x19')](_0xe9dd('0x14'),_0x3f85d9,_0x447d9a['error'][_0xe9dd('0x1a')]);return _0x3e7b67(_0x447d9a[_0xe9dd('0x19')][_0xe9dd('0x1a')]);}else{logger['info'](_0xe9dd('0x14'),_0x3f85d9,_0xe9dd('0x15'));_0x3e7b67(_0x447d9a[_0xe9dd('0x1b')]['message']);}})['catch'](function(_0xb0cbc4){logger[_0xe9dd('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x3f85d9,_0xb0cbc4);_0xef74f2(_0xb0cbc4);});});}exports[_0xe9dd('0x1c')]=function(_0x2aefbe){var _0x45b868=this;return new Promise(function(_0x50e950,_0x22e20e){return db[_0xe9dd('0x1d')][_0xe9dd('0x1e')]({'raw':_0x2aefbe[_0xe9dd('0x1f')]?_0x2aefbe[_0xe9dd('0x1f')][_0xe9dd('0x20')]===undefined?!![]:![]:!![],'where':_0x2aefbe[_0xe9dd('0x1f')]?_0x2aefbe[_0xe9dd('0x1f')][_0xe9dd('0x21')]||null:null,'attributes':_0x2aefbe['options']?_0x2aefbe[_0xe9dd('0x1f')][_0xe9dd('0x22')]||null:null,'limit':_0x2aefbe['options']?_0x2aefbe[_0xe9dd('0x1f')][_0xe9dd('0x23')]||null:null,'include':_0x2aefbe['options']?_0x2aefbe[_0xe9dd('0x1f')][_0xe9dd('0x24')]?_[_0xe9dd('0x25')](_0x2aefbe['options'][_0xe9dd('0x24')],function(_0x4a13e7){return{'model':db[_0x4a13e7[_0xe9dd('0x26')]],'as':_0x4a13e7['as'],'attributes':_0x4a13e7[_0xe9dd('0x22')],'include':_0x4a13e7[_0xe9dd('0x24')]?_[_0xe9dd('0x25')](_0x4a13e7[_0xe9dd('0x24')],function(_0xb1d6f){return{'model':db[_0xb1d6f[_0xe9dd('0x26')]],'as':_0xb1d6f['as'],'attributes':_0xb1d6f[_0xe9dd('0x22')],'include':_0xb1d6f[_0xe9dd('0x24')]?_[_0xe9dd('0x25')](_0xb1d6f[_0xe9dd('0x24')],function(_0x3f6b73){return{'model':db[_0x3f6b73['model']],'as':_0x3f6b73['as'],'attributes':_0x3f6b73[_0xe9dd('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe9dd('0x12')](function(_0x5ddb5f){logger[_0xe9dd('0x13')](_0xe9dd('0x1c'),_0x2aefbe);logger[_0xe9dd('0x16')]('GetVoiceQueueReport',_0x2aefbe,JSON[_0xe9dd('0x18')](_0x5ddb5f));_0x50e950(_0x5ddb5f);})[_0xe9dd('0x27')](function(_0x313753){logger[_0xe9dd('0x19')]('GetVoiceQueueReport',_0x313753[_0xe9dd('0x1a')],_0x2aefbe);_0x22e20e(_0x45b868['error'](0x1f4,_0x313753['message']));});});};exports['CreateVoiceQueueReport']=function(_0x1152c8){var _0x7dbcf5=this;return new Promise(function(_0x12d8a4,_0x4cf08a){return db[_0xe9dd('0x1d')]['create'](_0x1152c8[_0xe9dd('0x28')],{'raw':_0x1152c8[_0xe9dd('0x1f')]?_0x1152c8[_0xe9dd('0x1f')][_0xe9dd('0x20')]===undefined?!![]:![]:!![]})[_0xe9dd('0x12')](function(_0x58f954){logger['info'](_0xe9dd('0x29'),_0x1152c8);logger[_0xe9dd('0x16')](_0xe9dd('0x29'),_0x1152c8,JSON[_0xe9dd('0x18')](_0x58f954));_0x12d8a4(_0x58f954);})[_0xe9dd('0x27')](function(_0x10acd1){logger[_0xe9dd('0x19')]('CreateVoiceQueueReport',_0x10acd1['message'],_0x1152c8);_0x4cf08a(_0x7dbcf5[_0xe9dd('0x19')](0x1f4,_0x10acd1[_0xe9dd('0x1a')]));});});};exports[_0xe9dd('0x2a')]=function(_0x59c9d9){var _0x1d5241=this;return new Promise(function(_0x2c9b5e,_0xe3ce67){return db['VoiceQueueReport'][_0xe9dd('0x2b')](_0x59c9d9[_0xe9dd('0x28')],{'raw':_0x59c9d9[_0xe9dd('0x1f')]?_0x59c9d9[_0xe9dd('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59c9d9[_0xe9dd('0x1f')]?_0x59c9d9['options'][_0xe9dd('0x21')]||null:null,'attributes':_0x59c9d9[_0xe9dd('0x1f')]?_0x59c9d9['options'][_0xe9dd('0x22')]||null:null,'limit':_0x59c9d9[_0xe9dd('0x1f')]?_0x59c9d9[_0xe9dd('0x1f')][_0xe9dd('0x23')]||null:null})['then'](function(_0xcf1295){logger[_0xe9dd('0x13')](_0xe9dd('0x2a'),_0x59c9d9);logger['debug'](_0xe9dd('0x2a'),_0x59c9d9,JSON[_0xe9dd('0x18')](_0xcf1295));_0x2c9b5e(_0xcf1295);})[_0xe9dd('0x27')](function(_0x5020f6){logger[_0xe9dd('0x19')](_0xe9dd('0x2a'),_0x5020f6['message'],_0x59c9d9);_0xe3ce67(_0x1d5241[_0xe9dd('0x19')](0x1f4,_0x5020f6[_0xe9dd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 36f6983..db11033 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 _0x85d0=['emit','register','length','voiceQueueReport:'];(function(_0x38ed99,_0xdb5869){var _0x250e0e=function(_0x3cd0a7){while(--_0x3cd0a7){_0x38ed99['push'](_0x38ed99['shift']());}};_0x250e0e(++_0xdb5869);}(_0x85d0,0x164));var _0x085d=function(_0x5a82e1,_0x536b87){_0x5a82e1=_0x5a82e1-0x0;var _0x2c293e=_0x85d0[_0x5a82e1];return _0x2c293e;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){VoiceQueueReportEvents['removeListener'](_0x231765,_0x19ae4c);};}exports[_0x085d('0x1')]=function(_0x5c917f){for(var _0x364f09=0x0,_0x9acc97=events[_0x085d('0x2')];_0x364f09<_0x9acc97;_0x364f09++){var _0x4a12b7=events[_0x364f09];var _0xf65d01=createListener(_0x085d('0x3')+_0x4a12b7,_0x5c917f);VoiceQueueReportEvents['on'](_0x4a12b7,_0xf65d01);}}; \ No newline at end of file +var _0x7cab=['./voiceQueueReport.events','save','remove','register','voiceQueueReport:'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x7cab,0x91));var _0xb7ca=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7cab[_0x1589dd];return _0x1bddd1;};'use strict';var VoiceQueueReportEvents=require(_0xb7ca('0x0'));var events=[_0xb7ca('0x1'),_0xb7ca('0x2'),'update'];function createListener(_0x215da3,_0x2aca5c){return function(_0x317484){_0x2aca5c['emit'](_0x215da3,_0x317484);};}function removeListener(_0x37e571,_0x5014c1){return function(){VoiceQueueReportEvents['removeListener'](_0x37e571,_0x5014c1);};}exports[_0xb7ca('0x3')]=function(_0x3f038a){for(var _0x582824=0x0,_0x42656e=events['length'];_0x582824<_0x42656e;_0x582824++){var _0x16f21b=events[_0x582824];var _0x462848=createListener(_0xb7ca('0x4')+_0x16f21b,_0x3f038a);VoiceQueueReportEvents['on'](_0x16f21b,_0x462848);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index d5d23b6..338eaf4 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 _0x0dc1=['index','get','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5ea543,_0x503cda){var _0x1ef79b=function(_0x597595){while(--_0x597595){_0x5ea543['push'](_0x5ea543['shift']());}};_0x1ef79b(++_0x503cda);}(_0x0dc1,0x198));var _0x10dc=function(_0x259c84,_0x51de45){_0x259c84=_0x259c84-0x0;var _0x4ecbab=_0x0dc1[_0x259c84];return _0x4ecbab;};'use strict';var multer=require('multer');var util=require(_0x10dc('0x0'));var path=require(_0x10dc('0x1'));var timeout=require(_0x10dc('0x2'));var express=require(_0x10dc('0x3'));var router=express[_0x10dc('0x4')]();var fs_extra=require(_0x10dc('0x5'));var auth=require(_0x10dc('0x6'));var interaction=require(_0x10dc('0x7'));var config=require(_0x10dc('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x10dc('0x9')](),controller[_0x10dc('0xa')]);router[_0x10dc('0xb')](_0x10dc('0xc'),auth['isAuthenticated'](),controller[_0x10dc('0xd')]);router[_0x10dc('0xe')]('/',auth[_0x10dc('0x9')](),controller[_0x10dc('0xf')]);router['put'](_0x10dc('0xc'),auth['isAuthenticated'](),controller[_0x10dc('0x10')]);router[_0x10dc('0x11')](_0x10dc('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x10dc('0x12')]=router; \ No newline at end of file +var _0x6816=['index','/:id','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated'];(function(_0x15c2f2,_0x3f7c7c){var _0x588765=function(_0x3ce41d){while(--_0x3ce41d){_0x15c2f2['push'](_0x15c2f2['shift']());}};_0x588765(++_0x3f7c7c);}(_0x6816,0x16f));var _0x6681=function(_0x5d7a8f,_0x41e036){_0x5d7a8f=_0x5d7a8f-0x0;var _0x19713d=_0x6816[_0x5d7a8f];return _0x19713d;};'use strict';var multer=require(_0x6681('0x0'));var util=require(_0x6681('0x1'));var path=require(_0x6681('0x2'));var timeout=require('connect-timeout');var express=require(_0x6681('0x3'));var router=express['Router']();var fs_extra=require(_0x6681('0x4'));var auth=require(_0x6681('0x5'));var interaction=require(_0x6681('0x6'));var config=require(_0x6681('0x7'));var controller=require(_0x6681('0x8'));router[_0x6681('0x9')]('/',auth[_0x6681('0xa')](),controller[_0x6681('0xb')]);router[_0x6681('0x9')](_0x6681('0xc'),auth[_0x6681('0xa')](),controller['show']);router['post']('/',auth[_0x6681('0xa')](),controller[_0x6681('0xd')]);router[_0x6681('0xe')](_0x6681('0xc'),auth['isAuthenticated'](),controller[_0x6681('0xf')]);router[_0x6681('0x10')](_0x6681('0xc'),auth[_0x6681('0xa')](),controller['destroy']);module[_0x6681('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 14ee957..f40ec78 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 _0xe50f=['YYYY-MM-DD\x20HH:mm:ss','sequelize','STRING','DATE'];(function(_0x1f18e7,_0xe484ae){var _0xf98014=function(_0x3daabf){while(--_0x3daabf){_0x1f18e7['push'](_0x1f18e7['shift']());}};_0xf98014(++_0xe484ae);}(_0xe50f,0x1b9));var _0xfe50=function(_0x429bfc,_0x157106){_0x429bfc=_0x429bfc-0x0;var _0x1ac267=_0xe50f[_0x429bfc];return _0x1ac267;};'use strict';var Sequelize=require(_0xfe50('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0xfe50('0x1')]},'callid':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfe50('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfe50('0x2')],'allowNull':![],'defaultValue':moment()['format'](_0xfe50('0x3'))}}; \ No newline at end of file +var _0xc677=['moment','exports','STRING','format'];(function(_0x4b7d0f,_0x8fea12){var _0x27e769=function(_0x1ff7bd){while(--_0x1ff7bd){_0x4b7d0f['push'](_0x4b7d0f['shift']());}};_0x27e769(++_0x8fea12);}(_0xc677,0x16c));var _0x7c67=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc677[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7c67('0x0'));module[_0x7c67('0x1')]={'time':{'type':Sequelize[_0x7c67('0x2')]},'callid':{'type':Sequelize[_0x7c67('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7c67('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7c67('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7c67('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7c67('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7c67('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x7c67('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index d6a70cf..b3f21fa 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 _0xb403=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','update','stack','name','send','map','VoiceQueuesLog','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','find','body','catch','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0xb403,0x185));var _0x3b40=function(_0x4b33d1,_0x2414e1){_0x4b33d1=_0x4b33d1-0x0;var _0x9e7221=_0xb403[_0x4b33d1];return _0x9e7221;};'use strict';var emlformat=require(_0x3b40('0x0'));var rimraf=require(_0x3b40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b40('0x2'));var rp=require(_0x3b40('0x3'));var moment=require(_0x3b40('0x4'));var BPromise=require(_0x3b40('0x5'));var Mustache=require('mustache');var util=require(_0x3b40('0x6'));var path=require(_0x3b40('0x7'));var sox=require('sox');var csv=require(_0x3b40('0x8'));var ejs=require(_0x3b40('0x9'));var fs=require('fs');var fs_extra=require(_0x3b40('0xa'));var _=require(_0x3b40('0xb'));var squel=require('squel');var crypto=require(_0x3b40('0xc'));var jsforce=require(_0x3b40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3b40('0xe'));var Papa=require('papaparse');var Redis=require(_0x3b40('0xf'));var authService=require(_0x3b40('0x10'));var qs=require(_0x3b40('0x11'));var as=require(_0x3b40('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3b40('0x13'));var utils=require(_0x3b40('0x14'));var config=require(_0x3b40('0x15'));var licenseUtil=require(_0x3b40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x466fc8,_0x10f8c1){_0x10f8c1=_0x10f8c1||0xcc;return function(_0x5c191a){if(_0x5c191a){return _0x466fc8[_0x3b40('0x17')](_0x10f8c1);}return _0x466fc8['status'](_0x10f8c1)[_0x3b40('0x18')]();};}function respondWithResult(_0x15b2a0,_0xf37a8){_0xf37a8=_0xf37a8||0xc8;return function(_0x248b21){if(_0x248b21){return _0x15b2a0[_0x3b40('0x19')](_0xf37a8)[_0x3b40('0x1a')](_0x248b21);}};}function respondWithFilteredResult(_0x470250,_0xba2cdd){return function(_0x541b19){if(_0x541b19){var _0x42c177=typeof _0xba2cdd[_0x3b40('0x1b')]===_0x3b40('0x1c')&&typeof _0xba2cdd[_0x3b40('0x1d')]===_0x3b40('0x1c');var _0x3c3d93=_0x541b19['count'];var _0x203c17=_0x42c177?0x0:_0xba2cdd['offset'];var _0x164da0=_0x42c177?_0x541b19[_0x3b40('0x1e')]:_0xba2cdd[_0x3b40('0x1b')]+_0xba2cdd[_0x3b40('0x1d')];var _0x1c1652;if(_0x164da0>=_0x3c3d93){_0x164da0=_0x3c3d93;_0x1c1652=0xc8;}else{_0x1c1652=0xce;}_0x470250[_0x3b40('0x19')](_0x1c1652);return _0x470250['set'](_0x3b40('0x1f'),_0x203c17+'-'+_0x164da0+'/'+_0x3c3d93)[_0x3b40('0x1a')](_0x541b19);}return null;};}function patchUpdates(_0x74b145){return function(_0x47901e){try{jsonpatch['apply'](_0x47901e,_0x74b145,!![]);}catch(_0x439dec){return BPromise['reject'](_0x439dec);}return _0x47901e[_0x3b40('0x20')]();};}function saveUpdates(_0x4eb01e,_0x50ca7d){return function(_0x52d216){if(_0x52d216){return _0x52d216[_0x3b40('0x21')](_0x4eb01e)['then'](function(_0x27ec10){return _0x27ec10;});}return null;};}function removeEntity(_0x4b3ecc,_0x51d3f8){return function(_0x373295){if(_0x373295){return _0x373295['destroy']()['then'](function(){_0x4b3ecc[_0x3b40('0x19')](0xcc)[_0x3b40('0x18')]();});}};}function handleEntityNotFound(_0xe19e6e,_0x47946e){return function(_0x1a6435){if(!_0x1a6435){_0xe19e6e[_0x3b40('0x17')](0x194);}return _0x1a6435;};}function handleError(_0x2fe4f1,_0x12df07){_0x12df07=_0x12df07||0x1f4;return function(_0x1c7cac){logger['error'](_0x1c7cac[_0x3b40('0x22')]);if(_0x1c7cac['name']){delete _0x1c7cac[_0x3b40('0x23')];}_0x2fe4f1[_0x3b40('0x19')](_0x12df07)[_0x3b40('0x24')](_0x1c7cac);};}exports['index']=function(_0xc5543f,_0x585f89){var _0x36f4ee={},_0x28ccd3={},_0x463faa={'count':0x0,'rows':[]};var _0x4b49ec=_[_0x3b40('0x25')](db[_0x3b40('0x26')]['rawAttributes'],function(_0x5b7817){return{'name':_0x5b7817['fieldName'],'type':_0x5b7817[_0x3b40('0x27')]['key']};});_0x28ccd3[_0x3b40('0x28')]=_[_0x3b40('0x25')](_0x4b49ec,_0x3b40('0x23'));_0x28ccd3[_0x3b40('0x29')]=_[_0x3b40('0x2a')](_0xc5543f[_0x3b40('0x29')]);_0x28ccd3['filters']=_[_0x3b40('0x2b')](_0x28ccd3['model'],_0x28ccd3[_0x3b40('0x29')]);_0x36f4ee[_0x3b40('0x2c')]=_[_0x3b40('0x2b')](_0x28ccd3[_0x3b40('0x28')],qs[_0x3b40('0x2d')](_0xc5543f['query'][_0x3b40('0x2d')]));_0x36f4ee['attributes']=_0x36f4ee[_0x3b40('0x2c')][_0x3b40('0x2e')]?_0x36f4ee[_0x3b40('0x2c')]:_0x28ccd3[_0x3b40('0x28')];if(!_0xc5543f[_0x3b40('0x29')][_0x3b40('0x2f')](_0x3b40('0x30'))){_0x36f4ee['limit']=qs[_0x3b40('0x1d')](_0xc5543f[_0x3b40('0x29')][_0x3b40('0x1d')]);_0x36f4ee[_0x3b40('0x1b')]=qs['offset'](_0xc5543f['query'][_0x3b40('0x1b')]);}_0x36f4ee[_0x3b40('0x31')]=qs['sort'](_0xc5543f['query'][_0x3b40('0x32')]);_0x36f4ee['where']=qs[_0x3b40('0x33')](_[_0x3b40('0x34')](_0xc5543f[_0x3b40('0x29')],_0x28ccd3[_0x3b40('0x33')]),_0x4b49ec);if(_0xc5543f[_0x3b40('0x29')][_0x3b40('0x35')]){_0x36f4ee[_0x3b40('0x36')]=_[_0x3b40('0x37')](_0x36f4ee['where'],{'$or':_[_0x3b40('0x25')](_0x4b49ec,function(_0x2bfea5){if(_0x2bfea5[_0x3b40('0x27')]!==_0x3b40('0x38')){var _0x284960={};_0x284960[_0x2bfea5[_0x3b40('0x23')]]={'$like':'%'+_0xc5543f[_0x3b40('0x29')][_0x3b40('0x35')]+'%'};return _0x284960;}})});}_0x36f4ee=_[_0x3b40('0x37')]({},_0x36f4ee,_0xc5543f[_0x3b40('0x39')]);var _0x44028d={'where':_0x36f4ee['where']};return db[_0x3b40('0x26')][_0x3b40('0x1e')](_0x44028d)['then'](function(_0x54254c){_0x463faa['count']=_0x54254c;if(_0xc5543f[_0x3b40('0x29')][_0x3b40('0x3a')]){_0x36f4ee[_0x3b40('0x3b')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x3b40('0x3c')](_0x36f4ee);})[_0x3b40('0x3d')](function(_0x2b2dd9){_0x463faa[_0x3b40('0x3e')]=_0x2b2dd9;return _0x463faa;})[_0x3b40('0x3d')](respondWithFilteredResult(_0x585f89,_0x36f4ee))['catch'](handleError(_0x585f89,null));};exports['show']=function(_0x4fb54e,_0x384bb3){var _0x222973={'raw':!![],'where':{'id':_0x4fb54e['params']['id']}},_0x1f22ed={};_0x1f22ed[_0x3b40('0x28')]=_[_0x3b40('0x2a')](db['VoiceQueuesLog']['rawAttributes']);_0x1f22ed['query']=_[_0x3b40('0x2a')](_0x4fb54e['query']);_0x1f22ed['filters']=_[_0x3b40('0x2b')](_0x1f22ed[_0x3b40('0x28')],_0x1f22ed[_0x3b40('0x29')]);_0x222973[_0x3b40('0x2c')]=_[_0x3b40('0x2b')](_0x1f22ed[_0x3b40('0x28')],qs[_0x3b40('0x2d')](_0x4fb54e[_0x3b40('0x29')][_0x3b40('0x2d')]));_0x222973[_0x3b40('0x2c')]=_0x222973[_0x3b40('0x2c')][_0x3b40('0x2e')]?_0x222973['attributes']:_0x1f22ed['model'];if(_0x4fb54e[_0x3b40('0x29')][_0x3b40('0x3a')]){_0x222973['include']=[{'all':!![]}];}_0x222973=_[_0x3b40('0x37')]({},_0x222973,_0x4fb54e[_0x3b40('0x39')]);return db[_0x3b40('0x26')][_0x3b40('0x3f')](_0x222973)[_0x3b40('0x3d')](handleEntityNotFound(_0x384bb3,null))['then'](respondWithResult(_0x384bb3,null))['catch'](handleError(_0x384bb3,null));};exports['create']=function(_0x29f446,_0x17b399){return db[_0x3b40('0x26')]['create'](_0x29f446[_0x3b40('0x40')],{})[_0x3b40('0x3d')](respondWithResult(_0x17b399,0xc9))[_0x3b40('0x41')](handleError(_0x17b399,null));};exports['update']=function(_0x4df570,_0x5aef2f){if(_0x4df570['body']['id']){delete _0x4df570[_0x3b40('0x40')]['id'];}return db[_0x3b40('0x26')]['find']({'where':{'id':_0x4df570[_0x3b40('0x42')]['id']}})[_0x3b40('0x3d')](handleEntityNotFound(_0x5aef2f,null))[_0x3b40('0x3d')](saveUpdates(_0x4df570[_0x3b40('0x40')],null))[_0x3b40('0x3d')](respondWithResult(_0x5aef2f,null))[_0x3b40('0x41')](handleError(_0x5aef2f,null));};exports[_0x3b40('0x43')]=function(_0x1c809b,_0x593387){return db[_0x3b40('0x26')][_0x3b40('0x3f')]({'where':{'id':_0x1c809b[_0x3b40('0x42')]['id']}})[_0x3b40('0x3d')](handleEntityNotFound(_0x593387,null))[_0x3b40('0x3d')](removeEntity(_0x593387,null))[_0x3b40('0x41')](handleError(_0x593387,null));}; \ No newline at end of file +var _0x2e7e=['map','type','VIRTUAL','options','VoiceQueuesLog','includeAll','include','findAll','rows','catch','params','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','undefined','count','limit','Content-Range','save','then','destroy','sendStatus','error','stack','name','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge'];(function(_0x20f00f,_0x545fc9){var _0x35bec4=function(_0x3da3bd){while(--_0x3da3bd){_0x20f00f['push'](_0x20f00f['shift']());}};_0x35bec4(++_0x545fc9);}(_0x2e7e,0x172));var _0xe2e7=function(_0xe02ef9,_0x436a80){_0xe02ef9=_0xe02ef9-0x0;var _0x191acb=_0x2e7e[_0xe02ef9];return _0x191acb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2e7('0x0'));var zipdir=require(_0xe2e7('0x1'));var jsonpatch=require(_0xe2e7('0x2'));var rp=require(_0xe2e7('0x3'));var moment=require(_0xe2e7('0x4'));var BPromise=require(_0xe2e7('0x5'));var Mustache=require('mustache');var util=require(_0xe2e7('0x6'));var path=require(_0xe2e7('0x7'));var sox=require(_0xe2e7('0x8'));var csv=require(_0xe2e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2e7('0xa'));var squel=require(_0xe2e7('0xb'));var crypto=require(_0xe2e7('0xc'));var jsforce=require(_0xe2e7('0xd'));var deskjs=require(_0xe2e7('0xe'));var toCsv=require(_0xe2e7('0x9'));var querystring=require(_0xe2e7('0xf'));var Papa=require('papaparse');var Redis=require(_0xe2e7('0x10'));var authService=require(_0xe2e7('0x11'));var qs=require(_0xe2e7('0x12'));var as=require(_0xe2e7('0x13'));var hardwareService=require(_0xe2e7('0x14'));var logger=require(_0xe2e7('0x15'))(_0xe2e7('0x16'));var utils=require(_0xe2e7('0x17'));var config=require(_0xe2e7('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fcccf,_0x107a12){_0x107a12=_0x107a12||0xcc;return function(_0x110dd8){if(_0x110dd8){return _0x1fcccf['sendStatus'](_0x107a12);}return _0x1fcccf[_0xe2e7('0x19')](_0x107a12)[_0xe2e7('0x1a')]();};}function respondWithResult(_0x431eba,_0x4b5687){_0x4b5687=_0x4b5687||0xc8;return function(_0x4dca6f){if(_0x4dca6f){return _0x431eba[_0xe2e7('0x19')](_0x4b5687)['json'](_0x4dca6f);}};}function respondWithFilteredResult(_0x5ba0e1,_0x26648c){return function(_0x3e0618){if(_0x3e0618){var _0x118da5=typeof _0x26648c[_0xe2e7('0x1b')]===_0xe2e7('0x1c')&&typeof _0x26648c['limit']===_0xe2e7('0x1c');var _0x175cdd=_0x3e0618[_0xe2e7('0x1d')];var _0x25eccd=_0x118da5?0x0:_0x26648c[_0xe2e7('0x1b')];var _0x2aba1e=_0x118da5?_0x3e0618[_0xe2e7('0x1d')]:_0x26648c[_0xe2e7('0x1b')]+_0x26648c[_0xe2e7('0x1e')];var _0x5e653c;if(_0x2aba1e>=_0x175cdd){_0x2aba1e=_0x175cdd;_0x5e653c=0xc8;}else{_0x5e653c=0xce;}_0x5ba0e1[_0xe2e7('0x19')](_0x5e653c);return _0x5ba0e1['set'](_0xe2e7('0x1f'),_0x25eccd+'-'+_0x2aba1e+'/'+_0x175cdd)['json'](_0x3e0618);}return null;};}function patchUpdates(_0xe43cb7){return function(_0x5eb40f){try{jsonpatch['apply'](_0x5eb40f,_0xe43cb7,!![]);}catch(_0x6705ce){return BPromise['reject'](_0x6705ce);}return _0x5eb40f[_0xe2e7('0x20')]();};}function saveUpdates(_0x54c88a,_0x4e15f3){return function(_0x18c9da){if(_0x18c9da){return _0x18c9da['update'](_0x54c88a)[_0xe2e7('0x21')](function(_0xbcdc54){return _0xbcdc54;});}return null;};}function removeEntity(_0x92f7f2,_0x1a6bb1){return function(_0x257b58){if(_0x257b58){return _0x257b58[_0xe2e7('0x22')]()[_0xe2e7('0x21')](function(){_0x92f7f2[_0xe2e7('0x19')](0xcc)[_0xe2e7('0x1a')]();});}};}function handleEntityNotFound(_0x77a934,_0x3a9407){return function(_0x22b421){if(!_0x22b421){_0x77a934[_0xe2e7('0x23')](0x194);}return _0x22b421;};}function handleError(_0x267a31,_0x35c6e6){_0x35c6e6=_0x35c6e6||0x1f4;return function(_0xe7c5f1){logger[_0xe2e7('0x24')](_0xe7c5f1[_0xe2e7('0x25')]);if(_0xe7c5f1['name']){delete _0xe7c5f1[_0xe2e7('0x26')];}_0x267a31['status'](_0x35c6e6)['send'](_0xe7c5f1);};}exports[_0xe2e7('0x27')]=function(_0x10a075,_0xa87f5a){var _0x311c3b={},_0x37bdfb={},_0xfcbb06={'count':0x0,'rows':[]};var _0x456290=_['map'](db['VoiceQueuesLog'][_0xe2e7('0x28')],function(_0x4bf628){return{'name':_0x4bf628['fieldName'],'type':_0x4bf628['type'][_0xe2e7('0x29')]};});_0x37bdfb[_0xe2e7('0x2a')]=_['map'](_0x456290,_0xe2e7('0x26'));_0x37bdfb[_0xe2e7('0x2b')]=_[_0xe2e7('0x2c')](_0x10a075[_0xe2e7('0x2b')]);_0x37bdfb[_0xe2e7('0x2d')]=_[_0xe2e7('0x2e')](_0x37bdfb[_0xe2e7('0x2a')],_0x37bdfb['query']);_0x311c3b[_0xe2e7('0x2f')]=_[_0xe2e7('0x2e')](_0x37bdfb[_0xe2e7('0x2a')],qs[_0xe2e7('0x30')](_0x10a075[_0xe2e7('0x2b')]['fields']));_0x311c3b['attributes']=_0x311c3b[_0xe2e7('0x2f')][_0xe2e7('0x31')]?_0x311c3b['attributes']:_0x37bdfb[_0xe2e7('0x2a')];if(!_0x10a075[_0xe2e7('0x2b')]['hasOwnProperty']('nolimit')){_0x311c3b[_0xe2e7('0x1e')]=qs[_0xe2e7('0x1e')](_0x10a075[_0xe2e7('0x2b')][_0xe2e7('0x1e')]);_0x311c3b['offset']=qs['offset'](_0x10a075[_0xe2e7('0x2b')][_0xe2e7('0x1b')]);}_0x311c3b[_0xe2e7('0x32')]=qs[_0xe2e7('0x33')](_0x10a075['query'][_0xe2e7('0x33')]);_0x311c3b[_0xe2e7('0x34')]=qs['filters'](_[_0xe2e7('0x35')](_0x10a075[_0xe2e7('0x2b')],_0x37bdfb[_0xe2e7('0x2d')]),_0x456290);if(_0x10a075[_0xe2e7('0x2b')][_0xe2e7('0x36')]){_0x311c3b[_0xe2e7('0x34')]=_[_0xe2e7('0x37')](_0x311c3b[_0xe2e7('0x34')],{'$or':_[_0xe2e7('0x38')](_0x456290,function(_0x17eb4a){if(_0x17eb4a[_0xe2e7('0x39')]!==_0xe2e7('0x3a')){var _0x5502f2={};_0x5502f2[_0x17eb4a[_0xe2e7('0x26')]]={'$like':'%'+_0x10a075[_0xe2e7('0x2b')][_0xe2e7('0x36')]+'%'};return _0x5502f2;}})});}_0x311c3b=_['merge']({},_0x311c3b,_0x10a075[_0xe2e7('0x3b')]);var _0x2712c3={'where':_0x311c3b[_0xe2e7('0x34')]};return db[_0xe2e7('0x3c')]['count'](_0x2712c3)['then'](function(_0x1d3759){_0xfcbb06['count']=_0x1d3759;if(_0x10a075[_0xe2e7('0x2b')][_0xe2e7('0x3d')]){_0x311c3b[_0xe2e7('0x3e')]=[{'all':!![]}];}return db[_0xe2e7('0x3c')][_0xe2e7('0x3f')](_0x311c3b);})[_0xe2e7('0x21')](function(_0xc7b189){_0xfcbb06[_0xe2e7('0x40')]=_0xc7b189;return _0xfcbb06;})[_0xe2e7('0x21')](respondWithFilteredResult(_0xa87f5a,_0x311c3b))[_0xe2e7('0x41')](handleError(_0xa87f5a,null));};exports['show']=function(_0x5151cc,_0x2f5d93){var _0xe776a3={'raw':!![],'where':{'id':_0x5151cc[_0xe2e7('0x42')]['id']}},_0x133c9f={};_0x133c9f[_0xe2e7('0x2a')]=_[_0xe2e7('0x2c')](db[_0xe2e7('0x3c')]['rawAttributes']);_0x133c9f[_0xe2e7('0x2b')]=_['keys'](_0x5151cc['query']);_0x133c9f[_0xe2e7('0x2d')]=_[_0xe2e7('0x2e')](_0x133c9f[_0xe2e7('0x2a')],_0x133c9f[_0xe2e7('0x2b')]);_0xe776a3[_0xe2e7('0x2f')]=_['intersection'](_0x133c9f['model'],qs[_0xe2e7('0x30')](_0x5151cc[_0xe2e7('0x2b')][_0xe2e7('0x30')]));_0xe776a3[_0xe2e7('0x2f')]=_0xe776a3[_0xe2e7('0x2f')][_0xe2e7('0x31')]?_0xe776a3[_0xe2e7('0x2f')]:_0x133c9f['model'];if(_0x5151cc[_0xe2e7('0x2b')][_0xe2e7('0x3d')]){_0xe776a3[_0xe2e7('0x3e')]=[{'all':!![]}];}_0xe776a3=_[_0xe2e7('0x37')]({},_0xe776a3,_0x5151cc[_0xe2e7('0x3b')]);return db[_0xe2e7('0x3c')][_0xe2e7('0x43')](_0xe776a3)[_0xe2e7('0x21')](handleEntityNotFound(_0x2f5d93,null))[_0xe2e7('0x21')](respondWithResult(_0x2f5d93,null))[_0xe2e7('0x41')](handleError(_0x2f5d93,null));};exports['create']=function(_0x16e191,_0x5e7469){return db[_0xe2e7('0x3c')][_0xe2e7('0x44')](_0x16e191['body'],{})['then'](respondWithResult(_0x5e7469,0xc9))[_0xe2e7('0x41')](handleError(_0x5e7469,null));};exports[_0xe2e7('0x45')]=function(_0x28e21d,_0x3cba75){if(_0x28e21d[_0xe2e7('0x46')]['id']){delete _0x28e21d[_0xe2e7('0x46')]['id'];}return db[_0xe2e7('0x3c')][_0xe2e7('0x43')]({'where':{'id':_0x28e21d[_0xe2e7('0x42')]['id']}})['then'](handleEntityNotFound(_0x3cba75,null))[_0xe2e7('0x21')](saveUpdates(_0x28e21d[_0xe2e7('0x46')],null))['then'](respondWithResult(_0x3cba75,null))[_0xe2e7('0x41')](handleError(_0x3cba75,null));};exports[_0xe2e7('0x22')]=function(_0xec1c00,_0x1fed9b){return db[_0xe2e7('0x3c')][_0xe2e7('0x43')]({'where':{'id':_0xec1c00[_0xe2e7('0x42')]['id']}})[_0xe2e7('0x21')](handleEntityNotFound(_0x1fed9b,null))[_0xe2e7('0x21')](removeEntity(_0x1fed9b,null))[_0xe2e7('0x41')](handleError(_0x1fed9b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4b15aa2..ea21a71 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 _0x2b55=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x946ae6,_0x2ed8a5){var _0x561ce0=function(_0x2bc1e3){while(--_0x2bc1e3){_0x946ae6['push'](_0x946ae6['shift']());}};_0x561ce0(++_0x2ed8a5);}(_0x2b55,0x1f0));var _0x52b5=function(_0x1a84f7,_0x59d97e){_0x1a84f7=_0x1a84f7-0x0;var _0x3edea7=_0x2b55[_0x1a84f7];return _0x3edea7;};'use strict';var _=require(_0x52b5('0x0'));var util=require(_0x52b5('0x1'));var logger=require(_0x52b5('0x2'))('api');var moment=require(_0x52b5('0x3'));var BPromise=require(_0x52b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52b5('0x5'));var rimraf=require(_0x52b5('0x6'));var config=require(_0x52b5('0x7'));var attributes=require(_0x52b5('0x8'));module[_0x52b5('0x9')]=function(_0x54eb44,_0xd1f017){return _0x54eb44[_0x52b5('0xa')](_0x52b5('0xb'),attributes,{'tableName':_0x52b5('0xc'),'paranoid':![],'indexes':[{'name':_0x52b5('0xd'),'fields':[_0x52b5('0xe'),_0x52b5('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc820=['voice_queues_log','event_dtm','event','dtm','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0xc820,0x13f));var _0x0c82=function(_0x59624b,_0x9f3aa7){_0x59624b=_0x59624b-0x0;var _0x406833=_0xc820[_0x59624b];return _0x406833;};'use strict';var _=require('lodash');var util=require(_0x0c82('0x0'));var logger=require(_0x0c82('0x1'))(_0x0c82('0x2'));var moment=require(_0x0c82('0x3'));var BPromise=require(_0x0c82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c82('0x5'));var rimraf=require('rimraf');var config=require(_0x0c82('0x6'));var attributes=require(_0x0c82('0x7'));module[_0x0c82('0x8')]=function(_0x1da0ac,_0x28db5e){return _0x1da0ac[_0x0c82('0x9')](_0x0c82('0xa'),attributes,{'tableName':_0x0c82('0xb'),'paranoid':![],'indexes':[{'name':_0x0c82('0xc'),'fields':[_0x0c82('0xd'),_0x0c82('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index a1e2ca7..65fc0a4 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 _0x5dd6=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x5dd6,0x140));var _0x65dd=function(_0x2f2315,_0x85c29e){_0x2f2315=_0x2f2315-0x0;var _0x574853=_0x5dd6[_0x2f2315];return _0x574853;};'use strict';var _=require(_0x65dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x65dd('0x1'));var rs=require(_0x65dd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65dd('0x3'))['db'];var utils=require(_0x65dd('0x4'));var logger=require(_0x65dd('0x5'))(_0x65dd('0x6'));var config=require(_0x65dd('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6b180f,_0x5ad516,_0x5cf2a6){return new BPromise(function(_0x45cec0,_0x9b2db9){return client[_0x65dd('0x9')](_0x6b180f,_0x5cf2a6)[_0x65dd('0xa')](function(_0x2a9f4b){logger[_0x65dd('0xb')](_0x65dd('0xc'),_0x5ad516,_0x65dd('0xd'));logger['debug'](_0x65dd('0xe'),_0x5ad516,_0x65dd('0xd'),JSON[_0x65dd('0xf')](_0x2a9f4b));if(_0x2a9f4b[_0x65dd('0x10')]){if(_0x2a9f4b[_0x65dd('0x10')][_0x65dd('0x11')]===0x1f4){logger[_0x65dd('0x10')](_0x65dd('0xc'),_0x5ad516,_0x2a9f4b[_0x65dd('0x10')][_0x65dd('0x12')]);return _0x9b2db9(_0x2a9f4b['error'][_0x65dd('0x12')]);}logger[_0x65dd('0x10')](_0x65dd('0xc'),_0x5ad516,_0x2a9f4b[_0x65dd('0x10')][_0x65dd('0x12')]);return _0x45cec0(_0x2a9f4b[_0x65dd('0x10')][_0x65dd('0x12')]);}else{logger[_0x65dd('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5ad516,'request\x20sent');_0x45cec0(_0x2a9f4b['result'][_0x65dd('0x12')]);}})[_0x65dd('0x13')](function(_0x2de3c7){logger[_0x65dd('0x10')](_0x65dd('0xc'),_0x5ad516,_0x2de3c7);_0x9b2db9(_0x2de3c7);});});} \ No newline at end of file +var _0xc9fa=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x231e13,_0xaea844){var _0x40b564=function(_0x130eba){while(--_0x130eba){_0x231e13['push'](_0x231e13['shift']());}};_0x40b564(++_0xaea844);}(_0xc9fa,0x129));var _0xac9f=function(_0x29107e,_0x26c7e7){_0x29107e=_0x29107e-0x0;var _0x55e177=_0xc9fa[_0x29107e];return _0x55e177;};'use strict';var _=require(_0xac9f('0x0'));var util=require(_0xac9f('0x1'));var moment=require(_0xac9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xac9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac9f('0x4'))['db'];var utils=require(_0xac9f('0x5'));var logger=require(_0xac9f('0x6'))(_0xac9f('0x7'));var config=require(_0xac9f('0x8'));var jayson=require(_0xac9f('0x9'));var client=jayson[_0xac9f('0xa')][_0xac9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f0a33,_0x20140b,_0x21ee84){return new BPromise(function(_0x562307,_0x5d1208){return client[_0xac9f('0xc')](_0x3f0a33,_0x21ee84)[_0xac9f('0xd')](function(_0xf8d3c){logger[_0xac9f('0xe')](_0xac9f('0xf'),_0x20140b,_0xac9f('0x10'));logger[_0xac9f('0x11')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x20140b,_0xac9f('0x10'),JSON[_0xac9f('0x12')](_0xf8d3c));if(_0xf8d3c['error']){if(_0xf8d3c[_0xac9f('0x13')]['code']===0x1f4){logger[_0xac9f('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x20140b,_0xf8d3c[_0xac9f('0x13')][_0xac9f('0x14')]);return _0x5d1208(_0xf8d3c[_0xac9f('0x13')]['message']);}logger[_0xac9f('0x13')](_0xac9f('0xf'),_0x20140b,_0xf8d3c[_0xac9f('0x13')][_0xac9f('0x14')]);return _0x562307(_0xf8d3c[_0xac9f('0x13')][_0xac9f('0x14')]);}else{logger[_0xac9f('0xe')](_0xac9f('0xf'),_0x20140b,_0xac9f('0x10'));_0x562307(_0xf8d3c[_0xac9f('0x15')]['message']);}})[_0xac9f('0x16')](function(_0x37701a){logger['error'](_0xac9f('0xf'),_0x20140b,_0x37701a);_0x5d1208(_0x37701a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 92ddc5b..87df98d 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 _0x2f9c=['connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/download','/:id/downloads','/:id/transcribe','post','runTranscribe','put','update','destroy','exports','multer','util','path'];(function(_0xaf42ab,_0x349f87){var _0x3b34e0=function(_0x5cdfc5){while(--_0x5cdfc5){_0xaf42ab['push'](_0xaf42ab['shift']());}};_0x3b34e0(++_0x349f87);}(_0x2f9c,0xe3));var _0xc2f9=function(_0x1f8e20,_0x68888){_0x1f8e20=_0x1f8e20-0x0;var _0x55e3fc=_0x2f9c[_0x1f8e20];return _0x55e3fc;};'use strict';var multer=require(_0xc2f9('0x0'));var util=require(_0xc2f9('0x1'));var path=require(_0xc2f9('0x2'));var timeout=require(_0xc2f9('0x3'));var express=require(_0xc2f9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc2f9('0x5'));var config=require(_0xc2f9('0x6'));var controller=require(_0xc2f9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc2f9('0x8')]);router[_0xc2f9('0x9')](_0xc2f9('0xa'),auth[_0xc2f9('0xb')](),controller[_0xc2f9('0xc')]);router[_0xc2f9('0x9')](_0xc2f9('0xd'),auth[_0xc2f9('0xb')](),controller['show']);router[_0xc2f9('0x9')](_0xc2f9('0xe'),auth[_0xc2f9('0xb')](),controller['download']);router[_0xc2f9('0x9')](_0xc2f9('0xf'),controller['downloads']);router[_0xc2f9('0x9')](_0xc2f9('0x10'),auth[_0xc2f9('0xb')](),controller['downloadTranscribe']);router[_0xc2f9('0x11')]('/',auth[_0xc2f9('0xb')](),controller['create']);router['post'](_0xc2f9('0x10'),auth[_0xc2f9('0xb')](),controller[_0xc2f9('0x12')]);router[_0xc2f9('0x13')]('/:id',auth[_0xc2f9('0xb')](),controller[_0xc2f9('0x14')]);router['delete'](_0xc2f9('0xd'),auth[_0xc2f9('0xb')](),controller[_0xc2f9('0x15')]);module[_0xc2f9('0x16')]=router; \ No newline at end of file +var _0x410a=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','delete','destroy','exports','multer'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x410a,0x1db));var _0xa410=function(_0x265508,_0x3e53fc){_0x265508=_0x265508-0x0;var _0x4f401b=_0x410a[_0x265508];return _0x4f401b;};'use strict';var multer=require(_0xa410('0x0'));var util=require(_0xa410('0x1'));var path=require(_0xa410('0x2'));var timeout=require(_0xa410('0x3'));var express=require('express');var router=express[_0xa410('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa410('0x5'));var interaction=require(_0xa410('0x6'));var config=require(_0xa410('0x7'));var controller=require(_0xa410('0x8'));router[_0xa410('0x9')]('/',auth[_0xa410('0xa')](),controller[_0xa410('0xb')]);router['get']('/describe',auth[_0xa410('0xa')](),controller[_0xa410('0xc')]);router[_0xa410('0x9')](_0xa410('0xd'),auth[_0xa410('0xa')](),controller[_0xa410('0xe')]);router['get'](_0xa410('0xf'),auth[_0xa410('0xa')](),controller[_0xa410('0x10')]);router['get'](_0xa410('0x11'),controller[_0xa410('0x12')]);router['get'](_0xa410('0x13'),auth[_0xa410('0xa')](),controller[_0xa410('0x14')]);router[_0xa410('0x15')]('/',auth[_0xa410('0xa')](),controller[_0xa410('0x16')]);router['post']('/:id/transcribe',auth[_0xa410('0xa')](),controller[_0xa410('0x17')]);router['put'](_0xa410('0xd'),auth[_0xa410('0xa')](),controller[_0xa410('0x18')]);router[_0xa410('0x19')](_0xa410('0xd'),auth[_0xa410('0xa')](),controller[_0xa410('0x1a')]);module[_0xa410('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index e48cb65..acdae4f 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 5c08469..e1ec41e 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 _0xe96b=['map','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','VoiceRecording','includeAll','catch','show','params','find','create','body','describe','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','$and','push','unlink','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','recording','Sequelize','Setting','findOne','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','limit','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe96b,0x1a3));var _0xbe96=function(_0x2e7fde,_0x4b1a06){_0x2e7fde=_0x2e7fde-0x0;var _0x22851b=_0xe96b[_0x2e7fde];return _0x22851b;};'use strict';var emlformat=require(_0xbe96('0x0'));var rimraf=require(_0xbe96('0x1'));var zipdir=require(_0xbe96('0x2'));var jsonpatch=require(_0xbe96('0x3'));var rp=require(_0xbe96('0x4'));var moment=require(_0xbe96('0x5'));var BPromise=require(_0xbe96('0x6'));var Mustache=require('mustache');var util=require(_0xbe96('0x7'));var path=require(_0xbe96('0x8'));var sox=require(_0xbe96('0x9'));var csv=require('to-csv');var ejs=require(_0xbe96('0xa'));var fs=require('fs');var fs_extra=require(_0xbe96('0xb'));var _=require(_0xbe96('0xc'));var squel=require(_0xbe96('0xd'));var crypto=require(_0xbe96('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbe96('0xf'));var querystring=require(_0xbe96('0x10'));var Papa=require(_0xbe96('0x11'));var AWS=require(_0xbe96('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0xbe96('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbe96('0x14'));var as=require(_0xbe96('0x15'));var hardwareService=require(_0xbe96('0x16'));var logger=require(_0xbe96('0x17'))(_0xbe96('0x18'));var utils=require(_0xbe96('0x19'));var config=require(_0xbe96('0x1a'));var licenseUtil=require(_0xbe96('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554098,_0x15fb6d){_0x15fb6d=_0x15fb6d||0xcc;return function(_0x5606f5){if(_0x5606f5){return _0x554098[_0xbe96('0x1c')](_0x15fb6d);}return _0x554098['status'](_0x15fb6d)[_0xbe96('0x1d')]();};}function respondWithResult(_0x17fc14,_0x1ece38){_0x1ece38=_0x1ece38||0xc8;return function(_0xe9b1cc){if(_0xe9b1cc){return _0x17fc14['status'](_0x1ece38)['json'](_0xe9b1cc);}};}function respondWithFilteredResult(_0x4b06a8,_0x16392f){return function(_0x14362d){if(_0x14362d){var _0x3747e4=typeof _0x16392f[_0xbe96('0x1e')]==='undefined'&&typeof _0x16392f[_0xbe96('0x1f')]==='undefined';var _0x3adf0b=_0x14362d[_0xbe96('0x20')];var _0x3dbbba=_0x3747e4?0x0:_0x16392f[_0xbe96('0x1e')];var _0x5c3b53=_0x3747e4?_0x14362d[_0xbe96('0x20')]:_0x16392f[_0xbe96('0x1e')]+_0x16392f[_0xbe96('0x1f')];var _0x649ab0;if(_0x5c3b53>=_0x3adf0b){_0x5c3b53=_0x3adf0b;_0x649ab0=0xc8;}else{_0x649ab0=0xce;}_0x4b06a8[_0xbe96('0x21')](_0x649ab0);return _0x4b06a8[_0xbe96('0x22')]('Content-Range',_0x3dbbba+'-'+_0x5c3b53+'/'+_0x3adf0b)['json'](_0x14362d);}return null;};}function patchUpdates(_0x1c8373){return function(_0x28bc9c){try{jsonpatch[_0xbe96('0x23')](_0x28bc9c,_0x1c8373,!![]);}catch(_0x49a618){return BPromise[_0xbe96('0x24')](_0x49a618);}return _0x28bc9c[_0xbe96('0x25')]();};}function saveUpdates(_0x1f42c9,_0x1bab2f){return function(_0x5e740e){if(_0x5e740e){return _0x5e740e[_0xbe96('0x26')](_0x1f42c9)[_0xbe96('0x27')](function(_0x400ace){return _0x400ace;});}return null;};}function removeEntity(_0xabd62e,_0x4f6c5b){return function(_0x3c7934){if(_0x3c7934){return _0x3c7934[_0xbe96('0x28')]()[_0xbe96('0x27')](function(){_0xabd62e[_0xbe96('0x21')](0xcc)[_0xbe96('0x1d')]();});}};}function handleEntityNotFound(_0x1a7728,_0x337d0a){return function(_0x487fe6){if(!_0x487fe6){_0x1a7728[_0xbe96('0x1c')](0x194);}return _0x487fe6;};}function handleError(_0x32db22,_0x2b6222){_0x2b6222=_0x2b6222||0x1f4;return function(_0x22df95){logger[_0xbe96('0x29')](_0x22df95[_0xbe96('0x2a')]);if(_0x22df95[_0xbe96('0x2b')]){delete _0x22df95['name'];}_0x32db22[_0xbe96('0x21')](_0x2b6222)[_0xbe96('0x2c')](_0x22df95);};}exports[_0xbe96('0x2d')]=function(_0x504e89,_0x116b9b){var _0x28fb4b={},_0x2e5a45={},_0x807c74={'count':0x0,'rows':[]};var _0x4046fd=_[_0xbe96('0x2e')](db['VoiceRecording'][_0xbe96('0x2f')],function(_0x2fdcb8){return{'name':_0x2fdcb8[_0xbe96('0x30')],'type':_0x2fdcb8[_0xbe96('0x31')][_0xbe96('0x32')]};});_0x2e5a45['model']=_[_0xbe96('0x33')](_['map'](_0x4046fd,'name'),[_0xbe96('0x34')]);_0x2e5a45[_0xbe96('0x35')]=_[_0xbe96('0x36')](_0x504e89[_0xbe96('0x35')]);_0x2e5a45[_0xbe96('0x37')]=_[_0xbe96('0x38')](_0x2e5a45[_0xbe96('0x39')],_0x2e5a45['query']);_0x28fb4b['attributes']=_[_0xbe96('0x38')](_0x2e5a45[_0xbe96('0x39')],qs[_0xbe96('0x3a')](_0x504e89[_0xbe96('0x35')]['fields']));_0x28fb4b[_0xbe96('0x3b')]=_0x28fb4b['attributes'][_0xbe96('0x3c')]?_0x28fb4b[_0xbe96('0x3b')]:_0x2e5a45[_0xbe96('0x39')];if(!_0x504e89['query'][_0xbe96('0x3d')]('nolimit')){_0x28fb4b[_0xbe96('0x1f')]=qs[_0xbe96('0x1f')](_0x504e89[_0xbe96('0x35')][_0xbe96('0x1f')]);_0x28fb4b[_0xbe96('0x1e')]=qs[_0xbe96('0x1e')](_0x504e89[_0xbe96('0x35')][_0xbe96('0x1e')]);}_0x28fb4b[_0xbe96('0x3e')]=qs[_0xbe96('0x3f')](_0x504e89[_0xbe96('0x35')][_0xbe96('0x3f')]);_0x28fb4b[_0xbe96('0x40')]=qs[_0xbe96('0x37')](_['pick'](_0x504e89[_0xbe96('0x35')],_0x2e5a45['filters']),_0x4046fd);if(_0x504e89['query'][_0xbe96('0x41')]){_0x28fb4b[_0xbe96('0x40')]=_['merge'](_0x28fb4b[_0xbe96('0x40')],{'$or':_[_0xbe96('0x2e')](_0x4046fd,function(_0x2f5b17){if(_0x2f5b17['type']!=='VIRTUAL'){var _0x4ae905={};_0x4ae905[_0x2f5b17[_0xbe96('0x2b')]]={'$like':'%'+_0x504e89['query'][_0xbe96('0x41')]+'%'};return _0x4ae905;}})});}_0x28fb4b=_[_0xbe96('0x42')]({},_0x28fb4b,_0x504e89[_0xbe96('0x43')]);var _0x53daaf={'where':_0x28fb4b[_0xbe96('0x40')]};return db[_0xbe96('0x44')]['count'](_0x53daaf)[_0xbe96('0x27')](function(_0x1f75ec){_0x807c74[_0xbe96('0x20')]=_0x1f75ec;if(_0x504e89['query'][_0xbe96('0x45')]){_0x28fb4b['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x28fb4b);})[_0xbe96('0x27')](function(_0x338625){_0x807c74['rows']=_0x338625;return _0x807c74;})[_0xbe96('0x27')](respondWithFilteredResult(_0x116b9b,_0x28fb4b))[_0xbe96('0x46')](handleError(_0x116b9b,null));};exports[_0xbe96('0x47')]=function(_0x5f4eed,_0x26d103){var _0x4073a0={'raw':![],'where':{'id':_0x5f4eed[_0xbe96('0x48')]['id']}},_0x495f7c={};_0x495f7c[_0xbe96('0x39')]=_[_0xbe96('0x36')](db[_0xbe96('0x44')][_0xbe96('0x2f')]);_0x495f7c[_0xbe96('0x35')]=_[_0xbe96('0x36')](_0x5f4eed[_0xbe96('0x35')]);_0x495f7c[_0xbe96('0x37')]=_[_0xbe96('0x38')](_0x495f7c['model'],_0x495f7c['query']);_0x4073a0[_0xbe96('0x3b')]=_[_0xbe96('0x38')](_0x495f7c[_0xbe96('0x39')],qs[_0xbe96('0x3a')](_0x5f4eed[_0xbe96('0x35')][_0xbe96('0x3a')]));_0x4073a0[_0xbe96('0x3b')]=_0x4073a0['attributes']['length']?_0x4073a0[_0xbe96('0x3b')]:_0x495f7c[_0xbe96('0x39')];if(_0x5f4eed[_0xbe96('0x35')]['includeAll']){_0x4073a0['include']=[{'all':!![]}];}_0x4073a0=_[_0xbe96('0x42')]({},_0x4073a0,_0x5f4eed['options']);return db[_0xbe96('0x44')][_0xbe96('0x49')](_0x4073a0)[_0xbe96('0x27')](handleEntityNotFound(_0x26d103,null))[_0xbe96('0x27')](respondWithResult(_0x26d103,null))[_0xbe96('0x46')](handleError(_0x26d103,null));};exports[_0xbe96('0x4a')]=function(_0x29a8e8,_0x3e311c){return db[_0xbe96('0x44')][_0xbe96('0x4a')](_0x29a8e8[_0xbe96('0x4b')],{})[_0xbe96('0x27')](respondWithResult(_0x3e311c,0xc9))[_0xbe96('0x46')](handleError(_0x3e311c,null));};exports[_0xbe96('0x26')]=function(_0x218acb,_0x49ad43){if(_0x218acb[_0xbe96('0x4b')]['id']){delete _0x218acb[_0xbe96('0x4b')]['id'];}return db[_0xbe96('0x44')][_0xbe96('0x49')]({'where':{'id':_0x218acb['params']['id']}})[_0xbe96('0x27')](handleEntityNotFound(_0x49ad43,null))[_0xbe96('0x27')](saveUpdates(_0x218acb[_0xbe96('0x4b')],null))[_0xbe96('0x27')](respondWithResult(_0x49ad43,null))[_0xbe96('0x46')](handleError(_0x49ad43,null));};exports[_0xbe96('0x4c')]=function(_0x3ac0f3,_0x380919){return db[_0xbe96('0x44')][_0xbe96('0x4c')]()['then'](respondWithResult(_0x380919,null))['catch'](handleError(_0x380919,null));};exports['download']=function(_0x3ccc10,_0x44d3f4,_0x4c074a){var _0x1bfc9e=require('../../components/encryptor');var _0x5b7b00=![];var _0x140888={};if(_0x3ccc10[_0xbe96('0x35')][_0xbe96('0x31')]&&_0x3ccc10['query']['type']===_0xbe96('0x4d')){_0x140888[_0xbe96('0x4d')]=_0x3ccc10['params']['id'];}else{_0x140888['id']=_0x3ccc10[_0xbe96('0x48')]['id'];}return db[_0xbe96('0x44')][_0xbe96('0x49')]({'where':_0x140888,'attributes':['id',_0xbe96('0x4e')],'raw':!![]})[_0xbe96('0x27')](handleEntityNotFound(_0x44d3f4,null))[_0xbe96('0x27')](function(_0x2bb826){if(_0x2bb826){var _0x2febf2=_0x2bb826[_0xbe96('0x4e')];var _0x20d7d1=util['format'](_0xbe96('0x4f'),_0x2febf2);if(fs[_0xbe96('0x50')](_0x20d7d1)){_0x5b7b00=!![];return _0x1bfc9e[_0xbe96('0x51')](_0x20d7d1,_0x2febf2,config[_0xbe96('0x52')]['recording'])[_0xbe96('0x27')](function(){return _0x2bb826;});}return _0x2bb826;}})['then'](function(_0x44ec35){if(_0x44ec35){var _0x2bd177=_0x44ec35[_0xbe96('0x4e')];if(!fs[_0xbe96('0x50')](_0x2bd177)){throw new db['Sequelize'][(_0xbe96('0x53'))](_0xbe96('0x54'));}if(_0x44ec35[_0xbe96('0x55')]){return _0x44d3f4[_0xbe96('0x56')](_0x2bd177,_0x44ec35[_0xbe96('0x55')]+path[_0xbe96('0x57')](_0x2bd177),function(){if(_0x5b7b00){fs['unlink'](_0x2bd177);}});}else{return _0x44d3f4[_0xbe96('0x56')](_0x2bd177,function(_0x1bb398){if(_0x5b7b00){fs['unlink'](_0x2bd177);}});}}})[_0xbe96('0x46')](function(_0x50280b){if(_0x50280b[_0xbe96('0x58')]==='VoiceRecording\x20not\x20found'){_0x44d3f4[_0xbe96('0x21')](0x194)[_0xbe96('0x2c')](_0xbe96('0x59'));}else{return handleError(_0x44d3f4,null);}});};exports[_0xbe96('0x5a')]=function(_0x36053a,_0x44af1d,_0x302cfd){var _0x721956=require(_0xbe96('0x5b'));var _0x2327a0=![];var _0x56ba61={'$and':[db[_0xbe96('0x5c')][_0xbe96('0x40')](db[_0xbe96('0x5c')]['fn'](_0xbe96('0x5d'),db[_0xbe96('0x5c')][_0xbe96('0x5e')](_0xbe96('0x4d'))),_0x36053a[_0xbe96('0x35')]['token'])]};if(_0x36053a[_0xbe96('0x35')][_0xbe96('0x31')]&&_0x36053a[_0xbe96('0x35')]['type']===_0xbe96('0x4d')){_0x56ba61[_0xbe96('0x5f')][_0xbe96('0x60')]({'uniqueid':_0x36053a[_0xbe96('0x48')]['id']});}else{_0x56ba61[_0xbe96('0x5f')][_0xbe96('0x60')]({'id':_0x36053a['params']['id']});}return db[_0xbe96('0x44')][_0xbe96('0x49')]({'where':_0x56ba61,'attributes':['id',_0xbe96('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x44af1d,null))[_0xbe96('0x27')](function(_0x42c0a3){if(_0x42c0a3){var _0x10f4f6=util[_0xbe96('0x34')]('%s.cypher',_0x42c0a3['value']);if(fs['existsSync'](_0x10f4f6)){_0x2327a0=!![];return _0x721956[_0xbe96('0x51')](_0x10f4f6,_0x42c0a3[_0xbe96('0x4e')],config[_0xbe96('0x52')]['recording'])['then'](function(){return _0x42c0a3;});}return _0x42c0a3;}})['then'](function(_0x10bea0){if(_0x10bea0){if(!fs['existsSync'](_0x10bea0[_0xbe96('0x4e')])){throw new db['Sequelize'][(_0xbe96('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x10bea0[_0xbe96('0x55')]){return _0x44af1d['download'](_0x10bea0[_0xbe96('0x4e')],_0x10bea0[_0xbe96('0x55')]+path[_0xbe96('0x57')](_0x10bea0['value']),function(){if(_0x2327a0){fs[_0xbe96('0x61')](_0x10bea0['value']);}});}else{return _0x44af1d[_0xbe96('0x56')](_0x10bea0[_0xbe96('0x4e')],function(_0x1ca1a0){if(_0x2327a0){fs[_0xbe96('0x61')](_0x10bea0['value']);}});}}})['catch'](handleError(_0x44af1d,null));};exports[_0xbe96('0x28')]=function(_0x14d7a8,_0x3b49d0){return db['VoiceRecording']['find']({'where':{'id':_0x14d7a8['params']['id']}})[_0xbe96('0x27')](function(_0x33b658){if(_['isNil'](_0x33b658)){throw new ReferenceError(_0xbe96('0x62'));}return _0x33b658;})[_0xbe96('0x27')](function(_0x78c5c1){var _0x55a12c=_0x78c5c1['value'];logger[_0xbe96('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x55a12c);if(!_[_0xbe96('0x64')](_0x78c5c1[_0xbe96('0x4e')])&&fs[_0xbe96('0x50')](_0x55a12c)){logger[_0xbe96('0x63')](_0xbe96('0x65')+_0x55a12c+_0xbe96('0x66'));fs['unlinkSync'](_0x55a12c);}_0x55a12c=_0x55a12c+_0xbe96('0x67');if(!_[_0xbe96('0x64')](_0x78c5c1[_0xbe96('0x4e')])&&fs[_0xbe96('0x50')](_0x55a12c)){logger['info']('File:\x20\x22'+_0x55a12c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbe96('0x68')](_0x55a12c);}return _0x78c5c1;})[_0xbe96('0x27')](function(_0x505251){if(!_0x505251)throw new InternalError();return _0x505251[_0xbe96('0x28')]();})['then'](function(){_0x3b49d0[_0xbe96('0x21')](0xcc)[_0xbe96('0x1d')]();})[_0xbe96('0x46')](handleError(_0x3b49d0,null));};function getBucketslist(_0x47d64c,_0x49ab1d,_0x380e61){return new Promise(function(_0x2c0d9e,_0x46a6a7){var _0x1a9ba0=new AWS['S3']({'accessKeyId':_0x49ab1d,'secretAccessKey':_0x47d64c,'region':_0x380e61});_0x1a9ba0[_0xbe96('0x69')]({},function(_0x571709,_0x1fa404){if(_0x571709){return _0x46a6a7(_0x571709);}else{return _0x2c0d9e(_0x1fa404);}});});}function createBucket(_0x555e94,_0x55fc51,_0x51eef1,_0x314f83){return new Promise(function(_0x4f97d0,_0x5a71ba){var _0x101774=new AWS['S3']({'accessKeyId':_0x55fc51,'secretAccessKey':_0x555e94,'region':_0x51eef1});_0x101774[_0xbe96('0x6a')]({'Bucket':_0x314f83},function(_0x5f1710,_0x3a0252){if(_0x5f1710){return _0x5a71ba(_0x5f1710);}else{return _0x4f97d0(_0x3a0252);}});});}function uploadFile(_0x47cc2c,_0x29e2a2,_0x2383cc,_0x19214e,_0xbf66aa,_0x9154a5){return new Promise(function(_0x52870d,_0x3dbd1b){var _0x2d20e7=new AWS['S3']({'accessKeyId':_0x29e2a2,'secretAccessKey':_0x47cc2c,'region':_0x2383cc});_0x2d20e7[_0xbe96('0x6b')]({'Bucket':_0x19214e,'Key':_0xbf66aa,'Body':_0x9154a5},function(_0x47f26a,_0xa18961){if(_0x47f26a){return _0x3dbd1b(_0x47f26a);}else{return _0x52870d(_0xa18961);}});});}function startTranscribe(_0x169c08,_0x60616c,_0x132fce,_0x139903,_0x208344,_0x5b0db9){return new Promise(function(_0x2d933f,_0x24a6eb){var _0x56fc1e=new AWS[(_0xbe96('0x6c'))]({'accessKeyId':_0x60616c,'secretAccessKey':_0x169c08,'region':_0x132fce});_0x56fc1e[_0xbe96('0x6d')]({'TranscriptionJobName':_0x139903,'LanguageCode':_0x208344,'Media':{'MediaFileUri':_0x5b0db9}},function(_0xedbdb5,_0x3fd549){if(_0xedbdb5){return _0x24a6eb(_0xedbdb5);}else{return _0x2d933f(_0x3fd549);}});});}function transcribe(_0x53adbc,_0x2121e3,_0x5a23c6,_0x6220b4,_0x23e29b,_0x183570,_0x598dea){return new Promise(function(_0x3d9313,_0xb9e50e){var _0x231a7c={};logger[_0xbe96('0x63')](util[_0xbe96('0x34')](_0xbe96('0x6e'),_0x53adbc,_0x23e29b));return uploadFile(_0x2121e3,_0x5a23c6,_0x6220b4,_0x23e29b,path[_0xbe96('0x6f')](_0x183570),fs[_0xbe96('0x70')](_0x183570))['then'](function(_0x41c2cb){logger[_0xbe96('0x63')](util['format'](_0xbe96('0x71'),_0x53adbc,_0x23e29b,_0x41c2cb['Location']));_0x231a7c[_0xbe96('0x72')]=_0x41c2cb[_0xbe96('0x73')];_0x231a7c[_0xbe96('0x74')]=_0x41c2cb[_0xbe96('0x75')];logger[_0xbe96('0x63')](util[_0xbe96('0x34')](_0xbe96('0x76'),_0x53adbc));return startTranscribe(_0x2121e3,_0x5a23c6,_0x6220b4,uuidv4(),_0x598dea,_0x41c2cb[_0xbe96('0x75')]);})[_0xbe96('0x27')](function(_0x5e8b2a){logger['info'](util[_0xbe96('0x34')](_0xbe96('0x77'),_0x53adbc,_0x5e8b2a[_0xbe96('0x78')][_0xbe96('0x79')]));_0x231a7c[_0xbe96('0x7a')]=_0x5e8b2a[_0xbe96('0x78')]['TranscriptionJobName'];_0x231a7c['transcribeStatus']=_0x5e8b2a[_0xbe96('0x78')][_0xbe96('0x7b')];return _0x3d9313(_0x231a7c);})['catch'](function(_0x27db4a){return _0xb9e50e(_0x27db4a);});});}exports[_0xbe96('0x7c')]=function(_0x529110,_0x5d9254,_0x203cf4){var _0x224359;var _0x17cca8;var _0x5bfaca;var _0x5ae961=require(_0xbe96('0x5b'));return db[_0xbe96('0x44')]['findOne']({'where':{'id':_0x529110[_0xbe96('0x48')]['id']}})[_0xbe96('0x27')](function(_0x3b8468){if(_0x3b8468){var _0x2e0751=util[_0xbe96('0x34')]('%s.cypher',_0x3b8468[_0xbe96('0x4e')]);if(fs[_0xbe96('0x50')](_0x2e0751)){cypher=!![];return _0x5ae961[_0xbe96('0x51')](_0x2e0751,_0x3b8468[_0xbe96('0x4e')],config[_0xbe96('0x52')][_0xbe96('0x7d')])[_0xbe96('0x27')](function(){return _0x3b8468;});}return _0x3b8468;}})[_0xbe96('0x27')](function(_0x3e8bf5){if(!_0x3e8bf5){throw new db[(_0xbe96('0x7e'))][(_0xbe96('0x53'))]('Voice\x20Recording\x20not\x20found');}_0x17cca8=_0x3e8bf5;return db[_0xbe96('0x7f')][_0xbe96('0x80')]({'where':{'id':0x1}});})[_0xbe96('0x27')](handleEntityNotFound(_0x5d9254,null))[_0xbe96('0x27')](function(_0x2277b5){if(_0x2277b5){_0x224359=_0x2277b5;if(!_0x224359[_0xbe96('0x81')]||!_0x224359['transcribeAccountId']||!_0x224359[_0xbe96('0x82')]||!_0x224359[_0xbe96('0x83')]||!_0x224359[_0xbe96('0x72')]){throw new db[(_0xbe96('0x7e'))]['ValidationError'](_0xbe96('0x84'));}if(_0x529110[_0xbe96('0x4b')][_0xbe96('0x85')]&&(!_0x224359[_0xbe96('0x86')]||!_0x224359[_0xbe96('0x87')]||!_0x224359[_0xbe96('0x88')]||!_0x224359[_0xbe96('0x83')]||!_0x224359['bucket'])){throw new db[(_0xbe96('0x7e'))]['ValidationError'](_0xbe96('0x89'));}return db[_0xbe96('0x8a')]['findOne']({'where':{'id':_0x224359[_0xbe96('0x8b')]}});}})['then'](function(_0x4dec88){if(!_0x4dec88){throw new db[(_0xbe96('0x7e'))]['ValidationError'](_0xbe96('0x8c'));}if(!_0x4dec88[_0xbe96('0x8d')]||!_0x4dec88[_0xbe96('0x8e')]){throw new db[(_0xbe96('0x7e'))][(_0xbe96('0x53'))](_0xbe96('0x8f'));}_0x5bfaca=_0x4dec88;return getBucketslist(_0x5bfaca[_0xbe96('0x8d')],_0x5bfaca['data2'],_0x224359['transcribeRegion']);})[_0xbe96('0x27')](function(_0x50832b){if(_0x50832b&&_0x50832b[_0xbe96('0x90')]){var _0x33f01c=_[_0xbe96('0x49')](_0x50832b[_0xbe96('0x90')],function(_0x5950fa){return _0x5950fa[_0xbe96('0x91')]===_0x224359['bucket'];});if(!_0x33f01c){logger[_0xbe96('0x63')](util['format'](_0xbe96('0x92'),_0x529110[_0xbe96('0x48')]['id'],_0x224359[_0xbe96('0x72')]));return createBucket(_0x5bfaca[_0xbe96('0x8d')],_0x5bfaca[_0xbe96('0x8e')],_0x224359[_0xbe96('0x82')],_0x224359[_0xbe96('0x72')]);}logger[_0xbe96('0x63')](util['format'](_0xbe96('0x93'),_0x529110['params']['id'],_0x224359[_0xbe96('0x72')]));return;}})[_0xbe96('0x27')](function(_0x5a9582){if(_0x17cca8['transcribeStatus']==='NEW'){return transcribe(_0x529110[_0xbe96('0x48')]['id'],_0x5bfaca[_0xbe96('0x8d')],_0x5bfaca['data2'],_0x224359[_0xbe96('0x82')],_0x224359[_0xbe96('0x72')],_0x17cca8[_0xbe96('0x4e')],_0x224359[_0xbe96('0x83')]);}else{logger['info'](util[_0xbe96('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x529110[_0xbe96('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x1cd132){if(_0x1cd132){_0x1cd132[_0xbe96('0x94')]=_0x529110[_0xbe96('0x4b')][_0xbe96('0x85')];return _0x17cca8[_0xbe96('0x95')](_0x1cd132);}})[_0xbe96('0x27')](respondWithResult(_0x5d9254,null))[_0xbe96('0x46')](handleError(_0x5d9254,null));};function writeFile(_0x216af5,_0x396072){return new Promise(function(_0x28de79,_0x185fce){fs[_0xbe96('0x96')](_0x396072,_0x216af5,function(_0x1c04f0,_0x80aa54){if(_0x1c04f0){return _0x185fce(_0x1c04f0);}else{return _0x28de79(_0x80aa54);}});});}exports[_0xbe96('0x97')]=function(_0x4d14b8,_0x2e1c8d,_0x4c0b6b){return db['VoiceRecording'][_0xbe96('0x80')]({'where':{'id':_0x4d14b8[_0xbe96('0x48')]['id']}})[_0xbe96('0x27')](handleEntityNotFound(_0x2e1c8d))[_0xbe96('0x27')](function(_0x44a57b){if(_0x44a57b&&_0x44a57b[_0xbe96('0x98')]){var _0x2f7182=_0x44a57b[_0xbe96('0x98')];var _0x57c435=config['root']+_0xbe96('0x99')+_0x44a57b['id']+_0xbe96('0x9a');if(fs[_0xbe96('0x50')](_0x57c435)){return _0x57c435;}return writeFile(_0x2f7182,_0x57c435)[_0xbe96('0x27')](function(){return _0x57c435;});}else{throw new db[(_0xbe96('0x7e'))][(_0xbe96('0x53'))]('Transcript\x20not\x20available');}})[_0xbe96('0x27')](function(_0x20d78e){return _0x2e1c8d[_0xbe96('0x56')](_0x20d78e);})[_0xbe96('0x46')](handleError(_0x2e1c8d));}; \ No newline at end of file +var _0x7330=['listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','destroy','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','sequelize','col','token','$and','push','%s.cypher','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x374f60,_0x551010){var _0x454eda=function(_0x5c096e){while(--_0x5c096e){_0x374f60['push'](_0x374f60['shift']());}};_0x454eda(++_0x551010);}(_0x7330,0xc7));var _0x0733=function(_0x124ae4,_0x28fd89){_0x124ae4=_0x124ae4-0x0;var _0x28daac=_0x7330[_0x124ae4];return _0x28daac;};'use strict';var emlformat=require(_0x0733('0x0'));var rimraf=require(_0x0733('0x1'));var zipdir=require(_0x0733('0x2'));var jsonpatch=require(_0x0733('0x3'));var rp=require(_0x0733('0x4'));var moment=require(_0x0733('0x5'));var BPromise=require(_0x0733('0x6'));var Mustache=require(_0x0733('0x7'));var util=require(_0x0733('0x8'));var path=require(_0x0733('0x9'));var sox=require(_0x0733('0xa'));var csv=require(_0x0733('0xb'));var ejs=require(_0x0733('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0733('0xd'));var squel=require(_0x0733('0xe'));var crypto=require('crypto');var jsforce=require(_0x0733('0xf'));var deskjs=require(_0x0733('0x10'));var toCsv=require(_0x0733('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x0733('0x11'));var uuidv4=require(_0x0733('0x12'));var Redis=require('ioredis');var authService=require(_0x0733('0x13'));var qs=require(_0x0733('0x14'));var as=require(_0x0733('0x15'));var hardwareService=require(_0x0733('0x16'));var logger=require(_0x0733('0x17'))(_0x0733('0x18'));var utils=require('../../config/utils');var config=require(_0x0733('0x19'));var licenseUtil=require(_0x0733('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53f974,_0x1d411d){_0x1d411d=_0x1d411d||0xcc;return function(_0x2a2a8b){if(_0x2a2a8b){return _0x53f974[_0x0733('0x1b')](_0x1d411d);}return _0x53f974[_0x0733('0x1c')](_0x1d411d)[_0x0733('0x1d')]();};}function respondWithResult(_0x1dea1b,_0x2d3c9b){_0x2d3c9b=_0x2d3c9b||0xc8;return function(_0x2f8483){if(_0x2f8483){return _0x1dea1b[_0x0733('0x1c')](_0x2d3c9b)['json'](_0x2f8483);}};}function respondWithFilteredResult(_0x1d0d94,_0x3013d8){return function(_0x4ea18c){if(_0x4ea18c){var _0xd58df0=typeof _0x3013d8[_0x0733('0x1e')]===_0x0733('0x1f')&&typeof _0x3013d8[_0x0733('0x20')]===_0x0733('0x1f');var _0x38f8be=_0x4ea18c[_0x0733('0x21')];var _0x194cc2=_0xd58df0?0x0:_0x3013d8[_0x0733('0x1e')];var _0x3ab2c5=_0xd58df0?_0x4ea18c[_0x0733('0x21')]:_0x3013d8[_0x0733('0x1e')]+_0x3013d8[_0x0733('0x20')];var _0x39fef7;if(_0x3ab2c5>=_0x38f8be){_0x3ab2c5=_0x38f8be;_0x39fef7=0xc8;}else{_0x39fef7=0xce;}_0x1d0d94['status'](_0x39fef7);return _0x1d0d94[_0x0733('0x22')]('Content-Range',_0x194cc2+'-'+_0x3ab2c5+'/'+_0x38f8be)[_0x0733('0x23')](_0x4ea18c);}return null;};}function patchUpdates(_0x38b089){return function(_0x791753){try{jsonpatch[_0x0733('0x24')](_0x791753,_0x38b089,!![]);}catch(_0x3a7867){return BPromise['reject'](_0x3a7867);}return _0x791753[_0x0733('0x25')]();};}function saveUpdates(_0x3f8277,_0x5ebab2){return function(_0x5e26cb){if(_0x5e26cb){return _0x5e26cb[_0x0733('0x26')](_0x3f8277)['then'](function(_0x14c7aa){return _0x14c7aa;});}return null;};}function removeEntity(_0x3fe838,_0x160a70){return function(_0x23ca4c){if(_0x23ca4c){return _0x23ca4c[_0x0733('0x27')]()['then'](function(){_0x3fe838[_0x0733('0x1c')](0xcc)[_0x0733('0x1d')]();});}};}function handleEntityNotFound(_0x3e25e3,_0x1751fc){return function(_0x4cb2a3){if(!_0x4cb2a3){_0x3e25e3['sendStatus'](0x194);}return _0x4cb2a3;};}function handleError(_0x383117,_0xf637a2){_0xf637a2=_0xf637a2||0x1f4;return function(_0x50b53d){logger['error'](_0x50b53d[_0x0733('0x28')]);if(_0x50b53d[_0x0733('0x29')]){delete _0x50b53d[_0x0733('0x29')];}_0x383117['status'](_0xf637a2)[_0x0733('0x2a')](_0x50b53d);};}exports['index']=function(_0x30824b,_0x289391){var _0x3cd342={},_0x4c8a84={},_0x56909d={'count':0x0,'rows':[]};var _0x5e8fac=_[_0x0733('0x2b')](db[_0x0733('0x2c')][_0x0733('0x2d')],function(_0xfba9be){return{'name':_0xfba9be[_0x0733('0x2e')],'type':_0xfba9be[_0x0733('0x2f')][_0x0733('0x30')]};});_0x4c8a84[_0x0733('0x31')]=_[_0x0733('0x32')](_['map'](_0x5e8fac,'name'),['format']);_0x4c8a84[_0x0733('0x33')]=_[_0x0733('0x34')](_0x30824b[_0x0733('0x33')]);_0x4c8a84[_0x0733('0x35')]=_['intersection'](_0x4c8a84[_0x0733('0x31')],_0x4c8a84[_0x0733('0x33')]);_0x3cd342['attributes']=_[_0x0733('0x36')](_0x4c8a84[_0x0733('0x31')],qs[_0x0733('0x37')](_0x30824b[_0x0733('0x33')][_0x0733('0x37')]));_0x3cd342[_0x0733('0x38')]=_0x3cd342[_0x0733('0x38')][_0x0733('0x39')]?_0x3cd342[_0x0733('0x38')]:_0x4c8a84['model'];if(!_0x30824b['query'][_0x0733('0x3a')]('nolimit')){_0x3cd342[_0x0733('0x20')]=qs[_0x0733('0x20')](_0x30824b[_0x0733('0x33')]['limit']);_0x3cd342[_0x0733('0x1e')]=qs[_0x0733('0x1e')](_0x30824b[_0x0733('0x33')][_0x0733('0x1e')]);}_0x3cd342['order']=qs[_0x0733('0x3b')](_0x30824b[_0x0733('0x33')][_0x0733('0x3b')]);_0x3cd342['where']=qs['filters'](_[_0x0733('0x3c')](_0x30824b['query'],_0x4c8a84[_0x0733('0x35')]),_0x5e8fac);if(_0x30824b[_0x0733('0x33')][_0x0733('0x3d')]){_0x3cd342['where']=_['merge'](_0x3cd342[_0x0733('0x3e')],{'$or':_[_0x0733('0x2b')](_0x5e8fac,function(_0x21eeea){if(_0x21eeea['type']!==_0x0733('0x3f')){var _0x118cd2={};_0x118cd2[_0x21eeea[_0x0733('0x29')]]={'$like':'%'+_0x30824b['query'][_0x0733('0x3d')]+'%'};return _0x118cd2;}})});}_0x3cd342=_[_0x0733('0x40')]({},_0x3cd342,_0x30824b['options']);var _0x3a5951={'where':_0x3cd342[_0x0733('0x3e')]};return db[_0x0733('0x2c')][_0x0733('0x21')](_0x3a5951)[_0x0733('0x41')](function(_0x7c6168){_0x56909d['count']=_0x7c6168;if(_0x30824b['query'][_0x0733('0x42')]){_0x3cd342[_0x0733('0x43')]=[{'all':!![]}];}return db[_0x0733('0x2c')][_0x0733('0x44')](_0x3cd342);})[_0x0733('0x41')](function(_0x371c57){_0x56909d[_0x0733('0x45')]=_0x371c57;return _0x56909d;})[_0x0733('0x41')](respondWithFilteredResult(_0x289391,_0x3cd342))[_0x0733('0x46')](handleError(_0x289391,null));};exports[_0x0733('0x47')]=function(_0x33857d,_0x3a180c){var _0x20c00a={'raw':![],'where':{'id':_0x33857d[_0x0733('0x48')]['id']}},_0x6375bf={};_0x6375bf['model']=_[_0x0733('0x34')](db[_0x0733('0x2c')][_0x0733('0x2d')]);_0x6375bf[_0x0733('0x33')]=_[_0x0733('0x34')](_0x33857d['query']);_0x6375bf[_0x0733('0x35')]=_[_0x0733('0x36')](_0x6375bf[_0x0733('0x31')],_0x6375bf[_0x0733('0x33')]);_0x20c00a[_0x0733('0x38')]=_[_0x0733('0x36')](_0x6375bf[_0x0733('0x31')],qs[_0x0733('0x37')](_0x33857d[_0x0733('0x33')]['fields']));_0x20c00a[_0x0733('0x38')]=_0x20c00a[_0x0733('0x38')]['length']?_0x20c00a[_0x0733('0x38')]:_0x6375bf['model'];if(_0x33857d['query'][_0x0733('0x42')]){_0x20c00a[_0x0733('0x43')]=[{'all':!![]}];}_0x20c00a=_[_0x0733('0x40')]({},_0x20c00a,_0x33857d[_0x0733('0x49')]);return db[_0x0733('0x2c')][_0x0733('0x4a')](_0x20c00a)[_0x0733('0x41')](handleEntityNotFound(_0x3a180c,null))['then'](respondWithResult(_0x3a180c,null))[_0x0733('0x46')](handleError(_0x3a180c,null));};exports[_0x0733('0x4b')]=function(_0xd91ade,_0x19cf04){return db[_0x0733('0x2c')][_0x0733('0x4b')](_0xd91ade[_0x0733('0x4c')],{})[_0x0733('0x41')](respondWithResult(_0x19cf04,0xc9))['catch'](handleError(_0x19cf04,null));};exports[_0x0733('0x26')]=function(_0x1ad98e,_0x87674){if(_0x1ad98e[_0x0733('0x4c')]['id']){delete _0x1ad98e['body']['id'];}return db[_0x0733('0x2c')][_0x0733('0x4a')]({'where':{'id':_0x1ad98e[_0x0733('0x48')]['id']}})[_0x0733('0x41')](handleEntityNotFound(_0x87674,null))[_0x0733('0x41')](saveUpdates(_0x1ad98e[_0x0733('0x4c')],null))[_0x0733('0x41')](respondWithResult(_0x87674,null))[_0x0733('0x46')](handleError(_0x87674,null));};exports[_0x0733('0x4d')]=function(_0x3f519e,_0x48e79d){return db[_0x0733('0x2c')]['describe']()[_0x0733('0x41')](respondWithResult(_0x48e79d,null))[_0x0733('0x46')](handleError(_0x48e79d,null));};exports[_0x0733('0x4e')]=function(_0x3afb41,_0x4a3c59,_0xaa6d18){var _0x399a53=require(_0x0733('0x4f'));var _0x5b6813=![];var _0x1c4a1d={};if(_0x3afb41[_0x0733('0x33')][_0x0733('0x2f')]&&_0x3afb41[_0x0733('0x33')][_0x0733('0x2f')]===_0x0733('0x50')){_0x1c4a1d[_0x0733('0x50')]=_0x3afb41[_0x0733('0x48')]['id'];}else{_0x1c4a1d['id']=_0x3afb41['params']['id'];}return db['VoiceRecording']['find']({'where':_0x1c4a1d,'attributes':['id',_0x0733('0x51')],'raw':!![]})[_0x0733('0x41')](handleEntityNotFound(_0x4a3c59,null))[_0x0733('0x41')](function(_0x315ad6){if(_0x315ad6){var _0x53232b=_0x315ad6['value'];var _0x28a97f=util[_0x0733('0x52')]('%s.cypher',_0x53232b);if(fs[_0x0733('0x53')](_0x28a97f)){_0x5b6813=!![];return _0x399a53[_0x0733('0x54')](_0x28a97f,_0x53232b,config[_0x0733('0x55')][_0x0733('0x56')])[_0x0733('0x41')](function(){return _0x315ad6;});}return _0x315ad6;}})[_0x0733('0x41')](function(_0xf3e2b8){if(_0xf3e2b8){var _0x234943=_0xf3e2b8[_0x0733('0x51')];if(!fs['existsSync'](_0x234943)){throw new db[(_0x0733('0x57'))][(_0x0733('0x58'))](_0x0733('0x59'));}if(_0xf3e2b8[_0x0733('0x5a')]){return _0x4a3c59[_0x0733('0x4e')](_0x234943,_0xf3e2b8[_0x0733('0x5a')]+path['extname'](_0x234943),function(){if(_0x5b6813){fs[_0x0733('0x5b')](_0x234943);}});}else{return _0x4a3c59[_0x0733('0x4e')](_0x234943,function(_0x400908){if(_0x5b6813){fs[_0x0733('0x5b')](_0x234943);}});}}})[_0x0733('0x46')](function(_0x5c78ba){if(_0x5c78ba[_0x0733('0x5c')]==='VoiceRecording\x20not\x20found'){_0x4a3c59['status'](0x194)[_0x0733('0x2a')](_0x0733('0x5d'));}else{return handleError(_0x4a3c59,null);}});};exports['downloads']=function(_0x174220,_0x4b9631,_0x38a8c4){var _0x3356e3=require('../../components/encryptor');var _0x24fdf4=![];var _0x1cc888={'$and':[db[_0x0733('0x5e')][_0x0733('0x3e')](db['sequelize']['fn']('MD5',db[_0x0733('0x5e')][_0x0733('0x5f')](_0x0733('0x50'))),_0x174220[_0x0733('0x33')][_0x0733('0x60')])]};if(_0x174220[_0x0733('0x33')]['type']&&_0x174220[_0x0733('0x33')][_0x0733('0x2f')]===_0x0733('0x50')){_0x1cc888[_0x0733('0x61')][_0x0733('0x62')]({'uniqueid':_0x174220[_0x0733('0x48')]['id']});}else{_0x1cc888[_0x0733('0x61')][_0x0733('0x62')]({'id':_0x174220['params']['id']});}return db[_0x0733('0x2c')][_0x0733('0x4a')]({'where':_0x1cc888,'attributes':['id','value'],'raw':!![]})[_0x0733('0x41')](handleEntityNotFound(_0x4b9631,null))['then'](function(_0x3b4e20){if(_0x3b4e20){var _0x382e78=util['format'](_0x0733('0x63'),_0x3b4e20[_0x0733('0x51')]);if(fs[_0x0733('0x53')](_0x382e78)){_0x24fdf4=!![];return _0x3356e3['decryptFile'](_0x382e78,_0x3b4e20['value'],config[_0x0733('0x55')][_0x0733('0x56')])[_0x0733('0x41')](function(){return _0x3b4e20;});}return _0x3b4e20;}})[_0x0733('0x41')](function(_0x500b44){if(_0x500b44){if(!fs['existsSync'](_0x500b44[_0x0733('0x51')])){throw new db['Sequelize'][(_0x0733('0x58'))](_0x0733('0x59'));}if(_0x500b44[_0x0733('0x5a')]){return _0x4b9631['download'](_0x500b44[_0x0733('0x51')],_0x500b44[_0x0733('0x5a')]+path[_0x0733('0x64')](_0x500b44[_0x0733('0x51')]),function(){if(_0x24fdf4){fs['unlink'](_0x500b44[_0x0733('0x51')]);}});}else{return _0x4b9631['download'](_0x500b44[_0x0733('0x51')],function(_0x4ba14a){if(_0x24fdf4){fs['unlink'](_0x500b44[_0x0733('0x51')]);}});}}})[_0x0733('0x46')](handleError(_0x4b9631,null));};exports[_0x0733('0x27')]=function(_0x215038,_0x1d3b55){return db['VoiceRecording'][_0x0733('0x4a')]({'where':{'id':_0x215038[_0x0733('0x48')]['id']}})[_0x0733('0x41')](function(_0x3b6698){if(_[_0x0733('0x65')](_0x3b6698)){throw new ReferenceError(_0x0733('0x66'));}return _0x3b6698;})[_0x0733('0x41')](function(_0x582f14){var _0x372bdb=_0x582f14[_0x0733('0x51')];logger[_0x0733('0x67')](_0x0733('0x68'),_0x372bdb);if(!_[_0x0733('0x65')](_0x582f14[_0x0733('0x51')])&&fs[_0x0733('0x53')](_0x372bdb)){logger['info']('File:\x20\x22'+_0x372bdb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0733('0x69')](_0x372bdb);}_0x372bdb=_0x372bdb+_0x0733('0x6a');if(!_[_0x0733('0x65')](_0x582f14[_0x0733('0x51')])&&fs[_0x0733('0x53')](_0x372bdb)){logger[_0x0733('0x67')](_0x0733('0x6b')+_0x372bdb+_0x0733('0x6c'));fs[_0x0733('0x69')](_0x372bdb);}return _0x582f14;})[_0x0733('0x41')](function(_0x510716){if(!_0x510716)throw new InternalError();return _0x510716[_0x0733('0x27')]();})[_0x0733('0x41')](function(){_0x1d3b55[_0x0733('0x1c')](0xcc)[_0x0733('0x1d')]();})[_0x0733('0x46')](handleError(_0x1d3b55,null));};function getBucketslist(_0x2be4ac,_0x4626e2,_0x52f90c){return new Promise(function(_0x4ec57d,_0x4bf518){var _0x1cb9a6=new AWS['S3']({'accessKeyId':_0x4626e2,'secretAccessKey':_0x2be4ac,'region':_0x52f90c});_0x1cb9a6[_0x0733('0x6d')]({},function(_0x3d2f1d,_0x37db72){if(_0x3d2f1d){return _0x4bf518(_0x3d2f1d);}else{return _0x4ec57d(_0x37db72);}});});}function createBucket(_0x306d97,_0x5f466e,_0x147024,_0x9a4e87){return new Promise(function(_0x27faec,_0x5dc88d){var _0x4f0601=new AWS['S3']({'accessKeyId':_0x5f466e,'secretAccessKey':_0x306d97,'region':_0x147024});_0x4f0601[_0x0733('0x6e')]({'Bucket':_0x9a4e87},function(_0x1e4e3c,_0x5e6860){if(_0x1e4e3c){return _0x5dc88d(_0x1e4e3c);}else{return _0x27faec(_0x5e6860);}});});}function uploadFile(_0x4919c1,_0x53b188,_0x1f018a,_0x455c57,_0xd1593,_0x5d8db7){return new Promise(function(_0x27f323,_0x357b5b){var _0x241931=new AWS['S3']({'accessKeyId':_0x53b188,'secretAccessKey':_0x4919c1,'region':_0x1f018a});_0x241931[_0x0733('0x6f')]({'Bucket':_0x455c57,'Key':_0xd1593,'Body':_0x5d8db7},function(_0x1850d,_0x5a1fc4){if(_0x1850d){return _0x357b5b(_0x1850d);}else{return _0x27f323(_0x5a1fc4);}});});}function startTranscribe(_0x143929,_0x34b1a4,_0x2bc9e3,_0x4716a7,_0x243dd6,_0x128b2c){return new Promise(function(_0x199655,_0xfa8297){var _0x44197e=new AWS[(_0x0733('0x70'))]({'accessKeyId':_0x34b1a4,'secretAccessKey':_0x143929,'region':_0x2bc9e3});_0x44197e[_0x0733('0x71')]({'TranscriptionJobName':_0x4716a7,'LanguageCode':_0x243dd6,'Media':{'MediaFileUri':_0x128b2c}},function(_0x5ba470,_0x2642c4){if(_0x5ba470){return _0xfa8297(_0x5ba470);}else{return _0x199655(_0x2642c4);}});});}function transcribe(_0x432112,_0x102884,_0x17b897,_0x5053e0,_0x3c1590,_0x535574,_0x5aed4e){return new Promise(function(_0x12d2f0,_0x3e91f0){var _0x38be8b={};logger[_0x0733('0x67')](util['format'](_0x0733('0x72'),_0x432112,_0x3c1590));return uploadFile(_0x102884,_0x17b897,_0x5053e0,_0x3c1590,path[_0x0733('0x73')](_0x535574),fs[_0x0733('0x74')](_0x535574))[_0x0733('0x41')](function(_0x47ce8c){logger['info'](util[_0x0733('0x52')](_0x0733('0x75'),_0x432112,_0x3c1590,_0x47ce8c[_0x0733('0x76')]));_0x38be8b[_0x0733('0x77')]=_0x47ce8c[_0x0733('0x78')];_0x38be8b[_0x0733('0x79')]=_0x47ce8c['Location'];logger[_0x0733('0x67')](util[_0x0733('0x52')](_0x0733('0x7a'),_0x432112));return startTranscribe(_0x102884,_0x17b897,_0x5053e0,uuidv4(),_0x5aed4e,_0x47ce8c[_0x0733('0x76')]);})[_0x0733('0x41')](function(_0x57a0a5){logger[_0x0733('0x67')](util[_0x0733('0x52')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x432112,_0x57a0a5['TranscriptionJob'][_0x0733('0x7b')]));_0x38be8b['transcribeName']=_0x57a0a5[_0x0733('0x7c')][_0x0733('0x7b')];_0x38be8b['transcribeStatus']=_0x57a0a5[_0x0733('0x7c')][_0x0733('0x7d')];return _0x12d2f0(_0x38be8b);})[_0x0733('0x46')](function(_0x23cd8a){return _0x3e91f0(_0x23cd8a);});});}exports[_0x0733('0x7e')]=function(_0xc99b5a,_0xdd945f,_0x29d694){var _0x320cb6;var _0x526690;var _0x2152d0;var _0x33db73=require('../../components/encryptor');return db['VoiceRecording'][_0x0733('0x7f')]({'where':{'id':_0xc99b5a[_0x0733('0x48')]['id']}})[_0x0733('0x41')](function(_0x2185d5){if(_0x2185d5){var _0x2fe9b5=util['format'](_0x0733('0x63'),_0x2185d5[_0x0733('0x51')]);if(fs[_0x0733('0x53')](_0x2fe9b5)){cypher=!![];return _0x33db73[_0x0733('0x54')](_0x2fe9b5,_0x2185d5[_0x0733('0x51')],config[_0x0733('0x55')][_0x0733('0x56')])[_0x0733('0x41')](function(){return _0x2185d5;});}return _0x2185d5;}})['then'](function(_0x23596f){if(!_0x23596f){throw new db[(_0x0733('0x57'))][(_0x0733('0x58'))](_0x0733('0x80'));}_0x526690=_0x23596f;return db[_0x0733('0x81')][_0x0733('0x7f')]({'where':{'id':0x1}});})[_0x0733('0x41')](handleEntityNotFound(_0xdd945f,null))[_0x0733('0x41')](function(_0x39ad2d){if(_0x39ad2d){_0x320cb6=_0x39ad2d;if(!_0x320cb6[_0x0733('0x82')]||!_0x320cb6[_0x0733('0x83')]||!_0x320cb6[_0x0733('0x84')]||!_0x320cb6[_0x0733('0x85')]||!_0x320cb6[_0x0733('0x77')]){throw new db[(_0x0733('0x57'))][(_0x0733('0x58'))](_0x0733('0x86'));}if(_0xc99b5a[_0x0733('0x4c')]['runSentiment']&&(!_0x320cb6[_0x0733('0x87')]||!_0x320cb6[_0x0733('0x88')]||!_0x320cb6[_0x0733('0x89')]||!_0x320cb6[_0x0733('0x85')]||!_0x320cb6[_0x0733('0x77')])){throw new db[(_0x0733('0x57'))][(_0x0733('0x58'))](_0x0733('0x8a'));}return db[_0x0733('0x8b')][_0x0733('0x7f')]({'where':{'id':_0x320cb6[_0x0733('0x83')]}});}})[_0x0733('0x41')](function(_0x1d2aa9){if(!_0x1d2aa9){throw new db[(_0x0733('0x57'))][(_0x0733('0x58'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1d2aa9[_0x0733('0x8c')]||!_0x1d2aa9[_0x0733('0x8d')]){throw new db[(_0x0733('0x57'))][(_0x0733('0x58'))](_0x0733('0x8e'));}_0x2152d0=_0x1d2aa9;return getBucketslist(_0x2152d0[_0x0733('0x8c')],_0x2152d0[_0x0733('0x8d')],_0x320cb6[_0x0733('0x84')]);})[_0x0733('0x41')](function(_0x4614b8){if(_0x4614b8&&_0x4614b8['Buckets']){var _0x3704c7=_['find'](_0x4614b8[_0x0733('0x8f')],function(_0x40db84){return _0x40db84[_0x0733('0x90')]===_0x320cb6[_0x0733('0x77')];});if(!_0x3704c7){logger[_0x0733('0x67')](util[_0x0733('0x52')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xc99b5a[_0x0733('0x48')]['id'],_0x320cb6[_0x0733('0x77')]));return createBucket(_0x2152d0[_0x0733('0x8c')],_0x2152d0[_0x0733('0x8d')],_0x320cb6['transcribeRegion'],_0x320cb6[_0x0733('0x77')]);}logger[_0x0733('0x67')](util[_0x0733('0x52')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xc99b5a[_0x0733('0x48')]['id'],_0x320cb6[_0x0733('0x77')]));return;}})[_0x0733('0x41')](function(_0x5a6ef5){if(_0x526690[_0x0733('0x91')]===_0x0733('0x92')){return transcribe(_0xc99b5a['params']['id'],_0x2152d0[_0x0733('0x8c')],_0x2152d0[_0x0733('0x8d')],_0x320cb6[_0x0733('0x84')],_0x320cb6[_0x0733('0x77')],_0x526690[_0x0733('0x51')],_0x320cb6[_0x0733('0x85')]);}else{logger['info'](util[_0x0733('0x52')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xc99b5a[_0x0733('0x48')]['id']));return{'transcribeStatus':_0x0733('0x93')};}})[_0x0733('0x41')](function(_0x472ed1){if(_0x472ed1){_0x472ed1[_0x0733('0x94')]=_0xc99b5a['body']['runSentiment'];return _0x526690['updateAttributes'](_0x472ed1);}})[_0x0733('0x41')](respondWithResult(_0xdd945f,null))[_0x0733('0x46')](handleError(_0xdd945f,null));};function writeFile(_0x4dee8a,_0x254437){return new Promise(function(_0x32d762,_0x17e008){fs[_0x0733('0x95')](_0x254437,_0x4dee8a,function(_0x456871,_0x1e2e68){if(_0x456871){return _0x17e008(_0x456871);}else{return _0x32d762(_0x1e2e68);}});});}exports[_0x0733('0x96')]=function(_0x1bc498,_0x267626,_0xb5a358){return db[_0x0733('0x2c')][_0x0733('0x7f')]({'where':{'id':_0x1bc498[_0x0733('0x48')]['id']}})[_0x0733('0x41')](handleEntityNotFound(_0x267626))[_0x0733('0x41')](function(_0x291753){if(_0x291753&&_0x291753[_0x0733('0x97')]){var _0x118d5a=_0x291753[_0x0733('0x97')];var _0x2bd6b6=config['root']+_0x0733('0x98')+_0x291753['id']+'.txt';if(fs[_0x0733('0x53')](_0x2bd6b6)){return _0x2bd6b6;}return writeFile(_0x118d5a,_0x2bd6b6)[_0x0733('0x41')](function(){return _0x2bd6b6;});}else{throw new db['Sequelize'][(_0x0733('0x58'))](_0x0733('0x99'));}})[_0x0733('0x41')](function(_0x3ad309){return _0x267626[_0x0733('0x4e')](_0x3ad309);})[_0x0733('0x46')](handleError(_0x267626));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 3f75f8d..ee58ba4 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 _0x4f54=['define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x4f54,0x123));var _0x44f5=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4f54[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x44f5('0x0'));var util=require(_0x44f5('0x1'));var logger=require(_0x44f5('0x2'))(_0x44f5('0x3'));var moment=require(_0x44f5('0x4'));var BPromise=require(_0x44f5('0x5'));var rp=require(_0x44f5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44f5('0x7'));var config=require(_0x44f5('0x8'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x4b15c6,_0x5815ed){return _0x4b15c6[_0x44f5('0x9')]('VoiceRecording',attributes,{'tableName':_0x44f5('0xa'),'paranoid':![],'indexes':[{'name':_0x44f5('0xb'),'fields':[_0x44f5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa30=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger'];(function(_0x470711,_0x415ae0){var _0x33b3aa=function(_0x4fb7c0){while(--_0x4fb7c0){_0x470711['push'](_0x470711['shift']());}};_0x33b3aa(++_0x415ae0);}(_0xaa30,0xfa));var _0x0aa3=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xaa30[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require(_0x0aa3('0x0'));var logger=require(_0x0aa3('0x1'))(_0x0aa3('0x2'));var moment=require(_0x0aa3('0x3'));var BPromise=require(_0x0aa3('0x4'));var rp=require(_0x0aa3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0aa3('0x6'));var config=require(_0x0aa3('0x7'));var attributes=require(_0x0aa3('0x8'));module[_0x0aa3('0x9')]=function(_0x123e78,_0x3c4c43){return _0x123e78[_0x0aa3('0xa')](_0x0aa3('0xb'),attributes,{'tableName':_0x0aa3('0xc'),'paranoid':![],'indexes':[{'name':_0x0aa3('0xd'),'fields':[_0x0aa3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index abf4a8c..f06a368 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 _0x5464=['UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','unlink','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0x5464,0x15d));var _0x4546=function(_0x56dabc,_0x4fe2fc){_0x56dabc=_0x56dabc-0x0;var _0x5f4bf9=_0x5464[_0x56dabc];return _0x5f4bf9;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}exports[_0x4546('0x14')]=function(_0x57d8de){var _0x4ffd6b=this;return new Promise(function(_0x5780a7,_0x330235){return db[_0x4546('0x15')][_0x4546('0x16')](_0x57d8de[_0x4546('0x17')],{'raw':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d8de[_0x4546('0x18')]?_0x57d8de[_0x4546('0x18')][_0x4546('0x1a')]||null:null,'attributes':_0x57d8de['options']?_0x57d8de[_0x4546('0x18')][_0x4546('0x1b')]||null:null,'limit':_0x57d8de['options']?_0x57d8de[_0x4546('0x18')][_0x4546('0x1c')]||null:null})[_0x4546('0xa')](function(_0x2f065d){logger[_0x4546('0xb')](_0x4546('0x14'),_0x57d8de);logger['debug'](_0x4546('0x14'),_0x57d8de,JSON[_0x4546('0x1d')](_0x2f065d));_0x5780a7(_0x2f065d);})['catch'](function(_0x824698){logger[_0x4546('0x10')](_0x4546('0x14'),_0x824698[_0x4546('0x12')],_0x57d8de);_0x330235(_0x4ffd6b[_0x4546('0x10')](0x1f4,_0x824698['message']));});});};exports[_0x4546('0x1e')]=function(_0x3796fe){var _0x831fa5=this;return new Promise(function(_0x48fc36,_0x4c1dad){var _0x43740e=require(_0x4546('0x1f'));var _0x15611c;return db[_0x4546('0x20')][_0x4546('0x21')]({'attributes':['id',_0x4546('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4546('0xa')](function(_0x586ff1){_0x15611c=_0x586ff1;return db[_0x4546('0x15')]['create'](_0x3796fe[_0x4546('0x17')]);})[_0x4546('0xa')](function(_0x5396c5){if(_0x15611c['callRecordingEncryption']&&fs[_0x4546('0x23')](_0x5396c5['value'])){var _0x3c7c7d=util[_0x4546('0x24')]('%s.cypher',_0x5396c5['value']);return _0x43740e[_0x4546('0x25')](_0x5396c5[_0x4546('0x26')],_0x3c7c7d,config[_0x4546('0x27')]['recording'])[_0x4546('0xa')](function(){fs[_0x4546('0x28')](_0x5396c5['value']);logger[_0x4546('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x5396c5;});}return _0x5396c5;})[_0x4546('0xa')](function(_0x44f604){logger[_0x4546('0xb')](_0x4546('0x1e'),_0x3796fe);logger['debug'](_0x4546('0x1e'),_0x3796fe,JSON[_0x4546('0x1d')](_0x44f604));_0x48fc36(_0x44f604);})[_0x4546('0x13')](function(_0x298bef){logger[_0x4546('0x10')](_0x4546('0x1e'),_0x298bef['message'],_0x3796fe);_0x4c1dad(_0x831fa5[_0x4546('0x10')](0x1f4,_0x298bef[_0x4546('0x12')]));});});}; \ No newline at end of file +var _0xed1c=['jayson/promise','client','http','request','then','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','catch','UpdateVoiceRecording','VoiceRecording','body','options','where','attributes','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','existsSync','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0xed1c,0xe4));var _0xced1=function(_0x26d757,_0xbce70e){_0x26d757=_0x26d757-0x0;var _0x52ce09=_0xed1c[_0x26d757];return _0x52ce09;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced1('0x2'))['db'];var utils=require(_0xced1('0x3'));var logger=require(_0xced1('0x4'))('rpc');var config=require(_0xced1('0x5'));var jayson=require(_0xced1('0x6'));var client=jayson[_0xced1('0x7')][_0xced1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59399e,_0x2bcf42,_0x38bca8){return new BPromise(function(_0x39d5df,_0x1fb40b){return client[_0xced1('0x9')](_0x59399e,_0x38bca8)[_0xced1('0xa')](function(_0x325dd2){logger[_0xced1('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x2bcf42,_0xced1('0xc'));logger['debug'](_0xced1('0xd'),_0x2bcf42,_0xced1('0xc'),JSON[_0xced1('0xe')](_0x325dd2));if(_0x325dd2[_0xced1('0xf')]){if(_0x325dd2[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x2bcf42,_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);return _0x1fb40b(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}logger['error'](_0xced1('0x12'),_0x2bcf42,_0x325dd2[_0xced1('0xf')]['message']);return _0x39d5df(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}else{logger[_0xced1('0xb')](_0xced1('0x12'),_0x2bcf42,'request\x20sent');_0x39d5df(_0x325dd2['result'][_0xced1('0x11')]);}})[_0xced1('0x13')](function(_0x236473){logger[_0xced1('0xf')](_0xced1('0x12'),_0x2bcf42,_0x236473);_0x1fb40b(_0x236473);});});}exports[_0xced1('0x14')]=function(_0x5a563a){var _0x56fc50=this;return new Promise(function(_0x2a92c8,_0x111fb0){return db[_0xced1('0x15')]['update'](_0x5a563a[_0xced1('0x16')],{'raw':_0x5a563a[_0xced1('0x17')]?_0x5a563a[_0xced1('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a563a[_0xced1('0x17')]?_0x5a563a[_0xced1('0x17')][_0xced1('0x18')]||null:null,'attributes':_0x5a563a['options']?_0x5a563a[_0xced1('0x17')][_0xced1('0x19')]||null:null,'limit':_0x5a563a[_0xced1('0x17')]?_0x5a563a['options']['limit']||null:null})[_0xced1('0xa')](function(_0x41ee91){logger[_0xced1('0xb')](_0xced1('0x14'),_0x5a563a);logger[_0xced1('0x1a')]('UpdateVoiceRecording',_0x5a563a,JSON[_0xced1('0xe')](_0x41ee91));_0x2a92c8(_0x41ee91);})[_0xced1('0x13')](function(_0x4ea85e){logger['error'](_0xced1('0x14'),_0x4ea85e[_0xced1('0x11')],_0x5a563a);_0x111fb0(_0x56fc50[_0xced1('0xf')](0x1f4,_0x4ea85e[_0xced1('0x11')]));});});};exports[_0xced1('0x1b')]=function(_0x25b6e7){var _0x50c543=this;return new Promise(function(_0x181f6e,_0xf51411){var _0x43cdec=require(_0xced1('0x1c'));var _0x34dd2e;return db[_0xced1('0x1d')][_0xced1('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xced1('0xa')](function(_0x4ef64e){_0x34dd2e=_0x4ef64e;return db[_0xced1('0x15')][_0xced1('0x1f')](_0x25b6e7[_0xced1('0x16')]);})[_0xced1('0xa')](function(_0x5f03cc){if(_0x34dd2e['callRecordingEncryption']&&fs[_0xced1('0x20')](_0x5f03cc[_0xced1('0x21')])){var _0x2bc785=util['format']('%s.cypher',_0x5f03cc['value']);return _0x43cdec[_0xced1('0x22')](_0x5f03cc[_0xced1('0x21')],_0x2bc785,config[_0xced1('0x23')][_0xced1('0x24')])['then'](function(){fs[_0xced1('0x25')](_0x5f03cc[_0xced1('0x21')]);logger[_0xced1('0xb')](_0xced1('0x26'));return _0x5f03cc;});}return _0x5f03cc;})[_0xced1('0xa')](function(_0x33ac43){logger[_0xced1('0xb')]('CreateVoiceRecording',_0x25b6e7);logger['debug'](_0xced1('0x1b'),_0x25b6e7,JSON[_0xced1('0xe')](_0x33ac43));_0x181f6e(_0x33ac43);})[_0xced1('0x13')](function(_0x7ebeb3){logger[_0xced1('0xf')](_0xced1('0x1b'),_0x7ebeb3['message'],_0x25b6e7);_0xf51411(_0x50c543['error'](0x1f4,_0x7ebeb3['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c73ecbe..a9bc896 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 _0xb63c=['index','/describe','/:id','show','post','create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x4268c4,_0x21dc9c){var _0x4a7596=function(_0xe7c6c5){while(--_0xe7c6c5){_0x4268c4['push'](_0x4268c4['shift']());}};_0x4a7596(++_0x21dc9c);}(_0xb63c,0xdc));var _0xcb63=function(_0x101189,_0x57f57c){_0x101189=_0x101189-0x0;var _0x37fce=_0xb63c[_0x101189];return _0x37fce;};'use strict';var multer=require(_0xcb63('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb63('0x1'));var express=require(_0xcb63('0x2'));var router=express[_0xcb63('0x3')]();var fs_extra=require(_0xcb63('0x4'));var auth=require(_0xcb63('0x5'));var interaction=require(_0xcb63('0x6'));var config=require(_0xcb63('0x7'));var controller=require(_0xcb63('0x8'));router[_0xcb63('0x9')]('/',auth[_0xcb63('0xa')](),controller[_0xcb63('0xb')]);router[_0xcb63('0x9')](_0xcb63('0xc'),auth[_0xcb63('0xa')](),controller['describe']);router[_0xcb63('0x9')](_0xcb63('0xd'),auth['isAuthenticated'](),controller[_0xcb63('0xe')]);router[_0xcb63('0xf')]('/',auth['isAuthenticated'](),controller[_0xcb63('0x10')]);router[_0xcb63('0x11')](_0xcb63('0xd'),auth[_0xcb63('0xa')](),controller[_0xcb63('0x12')]);router[_0xcb63('0x13')](_0xcb63('0xd'),auth[_0xcb63('0xa')](),controller[_0xcb63('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3a82=['show','post','create','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x1d9332,_0x205f61){var _0x23f112=function(_0x51b62b){while(--_0x51b62b){_0x1d9332['push'](_0x1d9332['shift']());}};_0x23f112(++_0x205f61);}(_0x3a82,0x1b9));var _0x23a8=function(_0x53949a,_0x2ddc5b){_0x53949a=_0x53949a-0x0;var _0xe5c764=_0x3a82[_0x53949a];return _0xe5c764;};'use strict';var multer=require(_0x23a8('0x0'));var util=require(_0x23a8('0x1'));var path=require(_0x23a8('0x2'));var timeout=require(_0x23a8('0x3'));var express=require(_0x23a8('0x4'));var router=express[_0x23a8('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x23a8('0x6'));var config=require(_0x23a8('0x7'));var controller=require(_0x23a8('0x8'));router[_0x23a8('0x9')]('/',auth['isAuthenticated'](),controller[_0x23a8('0xa')]);router[_0x23a8('0x9')](_0x23a8('0xb'),auth['isAuthenticated'](),controller[_0x23a8('0xc')]);router[_0x23a8('0x9')](_0x23a8('0xd'),auth[_0x23a8('0xe')](),controller[_0x23a8('0xf')]);router[_0x23a8('0x10')]('/',auth['isAuthenticated'](),controller[_0x23a8('0x11')]);router['put'](_0x23a8('0xd'),auth[_0x23a8('0xe')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x23a8('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 029add5..4f8dfc7 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 _0x17ba=['attended','STRING','Yes','sequelize','moment','ENUM','blind'];(function(_0x2ecdf2,_0x138d9d){var _0x312d39=function(_0x2fb5fc){while(--_0x2fb5fc){_0x2ecdf2['push'](_0x2ecdf2['shift']());}};_0x312d39(++_0x138d9d);}(_0x17ba,0xab));var _0xa17b=function(_0x1f08d5,_0x4bb6a7){_0x1f08d5=_0x1f08d5-0x0;var _0x33f5a6=_0x17ba[_0x1f08d5];return _0x33f5a6;};'use strict';var Sequelize=require(_0xa17b('0x0'));var moment=require(_0xa17b('0x1'));module['exports']={'type':{'type':Sequelize[_0xa17b('0x2')](_0xa17b('0x3'),_0xa17b('0x4'))},'result':{'type':Sequelize[_0xa17b('0x5')]},'transfererchannel':{'type':Sequelize[_0xa17b('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xa17b('0x5')]},'transferercalleridname':{'type':Sequelize[_0xa17b('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xa17b('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xa17b('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xa17b('0x5')]},'transferercontext':{'type':Sequelize[_0xa17b('0x5')]},'transfererexten':{'type':Sequelize[_0xa17b('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xa17b('0x5')]},'transfereechannel':{'type':Sequelize[_0xa17b('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xa17b('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xa17b('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa17b('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xa17b('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xa17b('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xa17b('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xa17b('0x5')]},'isexternal':{'type':Sequelize[_0xa17b('0x2')](_0xa17b('0x6'),'No')},'context':{'type':Sequelize[_0xa17b('0x5')]},'extension':{'type':Sequelize[_0xa17b('0x5')]}}; \ No newline at end of file +var _0x3330=['STRING','Yes','sequelize','ENUM','blind'];(function(_0x46221f,_0x21ac41){var _0x203f91=function(_0x520307){while(--_0x520307){_0x46221f['push'](_0x46221f['shift']());}};_0x203f91(++_0x21ac41);}(_0x3330,0xc0));var _0x0333=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3330[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x0333('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x0333('0x1')](_0x0333('0x2'),'attended')},'result':{'type':Sequelize[_0x0333('0x3')]},'transfererchannel':{'type':Sequelize[_0x0333('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x0333('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x0333('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x0333('0x3')]},'transferercontext':{'type':Sequelize[_0x0333('0x3')]},'transfererexten':{'type':Sequelize[_0x0333('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x0333('0x3')]},'transfereechannel':{'type':Sequelize[_0x0333('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x0333('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x0333('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0333('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0333('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x0333('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x0333('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x0333('0x3')]},'isexternal':{'type':Sequelize[_0x0333('0x1')](_0x0333('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0333('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index a0c503c..84819d7 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 _0x790f=['api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/logger'];(function(_0x39ae94,_0x1efe5a){var _0x28ba97=function(_0x41d740){while(--_0x41d740){_0x39ae94['push'](_0x39ae94['shift']());}};_0x28ba97(++_0x1efe5a);}(_0x790f,0x146));var _0xf790=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x790f[_0x4b1032];return _0x5a1d55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf790('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf790('0x1'));var BPromise=require(_0xf790('0x2'));var Mustache=require(_0xf790('0x3'));var util=require('util');var path=require(_0xf790('0x4'));var sox=require(_0xf790('0x5'));var csv=require(_0xf790('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf790('0x7'));var squel=require(_0xf790('0x8'));var crypto=require(_0xf790('0x9'));var jsforce=require(_0xf790('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf790('0x6'));var querystring=require('querystring');var Papa=require(_0xf790('0xb'));var Redis=require('ioredis');var authService=require(_0xf790('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf790('0xd'))(_0xf790('0xe'));var utils=require(_0xf790('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xf790('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40546e,_0x193c9a){_0x193c9a=_0x193c9a||0xcc;return function(_0x16c987){if(_0x16c987){return _0x40546e[_0xf790('0x11')](_0x193c9a);}return _0x40546e[_0xf790('0x12')](_0x193c9a)[_0xf790('0x13')]();};}function respondWithResult(_0x3b5a7b,_0x3116b9){_0x3116b9=_0x3116b9||0xc8;return function(_0x16b42b){if(_0x16b42b){return _0x3b5a7b['status'](_0x3116b9)[_0xf790('0x14')](_0x16b42b);}};}function respondWithFilteredResult(_0x5d8220,_0x294238){return function(_0xe31f24){if(_0xe31f24){var _0x63a2c3=typeof _0x294238['offset']===_0xf790('0x15')&&typeof _0x294238[_0xf790('0x16')]===_0xf790('0x15');var _0x440966=_0xe31f24[_0xf790('0x17')];var _0x2b008a=_0x63a2c3?0x0:_0x294238['offset'];var _0xc6d794=_0x63a2c3?_0xe31f24[_0xf790('0x17')]:_0x294238[_0xf790('0x18')]+_0x294238[_0xf790('0x16')];var _0x4903b4;if(_0xc6d794>=_0x440966){_0xc6d794=_0x440966;_0x4903b4=0xc8;}else{_0x4903b4=0xce;}_0x5d8220[_0xf790('0x12')](_0x4903b4);return _0x5d8220['set']('Content-Range',_0x2b008a+'-'+_0xc6d794+'/'+_0x440966)[_0xf790('0x14')](_0xe31f24);}return null;};}function patchUpdates(_0x5128fe){return function(_0x303a90){try{jsonpatch[_0xf790('0x19')](_0x303a90,_0x5128fe,!![]);}catch(_0x3e498e){return BPromise[_0xf790('0x1a')](_0x3e498e);}return _0x303a90[_0xf790('0x1b')]();};}function saveUpdates(_0xc51090,_0x4be935){return function(_0xcf4482){if(_0xcf4482){return _0xcf4482[_0xf790('0x1c')](_0xc51090)['then'](function(_0x62a058){return _0x62a058;});}return null;};}function removeEntity(_0x4b5011,_0x31f58b){return function(_0x4781ed){if(_0x4781ed){return _0x4781ed['destroy']()['then'](function(){_0x4b5011[_0xf790('0x12')](0xcc)[_0xf790('0x13')]();});}};}function handleEntityNotFound(_0x528b9e,_0x5c62cc){return function(_0x27f560){if(!_0x27f560){_0x528b9e['sendStatus'](0x194);}return _0x27f560;};}function handleError(_0x11bbbf,_0x480c26){_0x480c26=_0x480c26||0x1f4;return function(_0x2b4bf0){logger['error'](_0x2b4bf0['stack']);if(_0x2b4bf0[_0xf790('0x1d')]){delete _0x2b4bf0[_0xf790('0x1d')];}_0x11bbbf[_0xf790('0x12')](_0x480c26)[_0xf790('0x1e')](_0x2b4bf0);};}exports[_0xf790('0x1f')]=function(_0x2280ef,_0x19c1d8){var _0x5283f9={},_0x4c2528={},_0x554a36={'count':0x0,'rows':[]};var _0x57b45e=_[_0xf790('0x20')](db[_0xf790('0x21')][_0xf790('0x22')],function(_0xc7034){return{'name':_0xc7034[_0xf790('0x23')],'type':_0xc7034[_0xf790('0x24')][_0xf790('0x25')]};});_0x4c2528[_0xf790('0x26')]=_[_0xf790('0x20')](_0x57b45e,_0xf790('0x1d'));_0x4c2528['query']=_[_0xf790('0x27')](_0x2280ef[_0xf790('0x28')]);_0x4c2528['filters']=_[_0xf790('0x29')](_0x4c2528[_0xf790('0x26')],_0x4c2528[_0xf790('0x28')]);_0x5283f9['attributes']=_['intersection'](_0x4c2528[_0xf790('0x26')],qs[_0xf790('0x2a')](_0x2280ef['query'][_0xf790('0x2a')]));_0x5283f9[_0xf790('0x2b')]=_0x5283f9[_0xf790('0x2b')][_0xf790('0x2c')]?_0x5283f9[_0xf790('0x2b')]:_0x4c2528[_0xf790('0x26')];if(!_0x2280ef[_0xf790('0x28')][_0xf790('0x2d')](_0xf790('0x2e'))){_0x5283f9[_0xf790('0x16')]=qs[_0xf790('0x16')](_0x2280ef['query']['limit']);_0x5283f9[_0xf790('0x18')]=qs[_0xf790('0x18')](_0x2280ef['query']['offset']);}_0x5283f9[_0xf790('0x2f')]=qs['sort'](_0x2280ef[_0xf790('0x28')][_0xf790('0x30')]);_0x5283f9[_0xf790('0x31')]=qs['filters'](_[_0xf790('0x32')](_0x2280ef[_0xf790('0x28')],_0x4c2528[_0xf790('0x33')]),_0x57b45e);if(_0x2280ef['query'][_0xf790('0x34')]){_0x5283f9[_0xf790('0x31')]=_[_0xf790('0x35')](_0x5283f9[_0xf790('0x31')],{'$or':_[_0xf790('0x20')](_0x57b45e,function(_0x171e33){if(_0x171e33[_0xf790('0x24')]!==_0xf790('0x36')){var _0x4744d8={};_0x4744d8[_0x171e33[_0xf790('0x1d')]]={'$like':'%'+_0x2280ef[_0xf790('0x28')]['filter']+'%'};return _0x4744d8;}})});}_0x5283f9=_[_0xf790('0x35')]({},_0x5283f9,_0x2280ef[_0xf790('0x37')]);var _0x4359e3={'where':_0x5283f9[_0xf790('0x31')]};return db[_0xf790('0x21')][_0xf790('0x17')](_0x4359e3)[_0xf790('0x38')](function(_0x534673){_0x554a36['count']=_0x534673;if(_0x2280ef[_0xf790('0x28')][_0xf790('0x39')]){_0x5283f9[_0xf790('0x3a')]=[{'all':!![]}];}return db[_0xf790('0x21')][_0xf790('0x3b')](_0x5283f9);})[_0xf790('0x38')](function(_0x1ab647){_0x554a36[_0xf790('0x3c')]=_0x1ab647;return _0x554a36;})[_0xf790('0x38')](respondWithFilteredResult(_0x19c1d8,_0x5283f9))[_0xf790('0x3d')](handleError(_0x19c1d8,null));};exports[_0xf790('0x3e')]=function(_0x2d912c,_0x11de04){var _0x169b65={'raw':!![],'where':{'id':_0x2d912c[_0xf790('0x3f')]['id']}},_0x31f066={};_0x31f066[_0xf790('0x26')]=_[_0xf790('0x27')](db[_0xf790('0x21')][_0xf790('0x22')]);_0x31f066[_0xf790('0x28')]=_[_0xf790('0x27')](_0x2d912c[_0xf790('0x28')]);_0x31f066[_0xf790('0x33')]=_[_0xf790('0x29')](_0x31f066['model'],_0x31f066['query']);_0x169b65[_0xf790('0x2b')]=_['intersection'](_0x31f066[_0xf790('0x26')],qs[_0xf790('0x2a')](_0x2d912c[_0xf790('0x28')][_0xf790('0x2a')]));_0x169b65[_0xf790('0x2b')]=_0x169b65['attributes'][_0xf790('0x2c')]?_0x169b65[_0xf790('0x2b')]:_0x31f066['model'];if(_0x2d912c[_0xf790('0x28')][_0xf790('0x39')]){_0x169b65['include']=[{'all':!![]}];}_0x169b65=_[_0xf790('0x35')]({},_0x169b65,_0x2d912c['options']);return db[_0xf790('0x21')][_0xf790('0x40')](_0x169b65)[_0xf790('0x38')](handleEntityNotFound(_0x11de04,null))[_0xf790('0x38')](respondWithResult(_0x11de04,null))[_0xf790('0x3d')](handleError(_0x11de04,null));};exports[_0xf790('0x41')]=function(_0x17e406,_0x314331){return db[_0xf790('0x21')][_0xf790('0x41')](_0x17e406[_0xf790('0x42')],{})[_0xf790('0x38')](respondWithResult(_0x314331,0xc9))[_0xf790('0x3d')](handleError(_0x314331,null));};exports['update']=function(_0x4555f9,_0x55ecc1){if(_0x4555f9['body']['id']){delete _0x4555f9[_0xf790('0x42')]['id'];}return db[_0xf790('0x21')][_0xf790('0x40')]({'where':{'id':_0x4555f9['params']['id']}})[_0xf790('0x38')](handleEntityNotFound(_0x55ecc1,null))['then'](saveUpdates(_0x4555f9[_0xf790('0x42')],null))[_0xf790('0x38')](respondWithResult(_0x55ecc1,null))['catch'](handleError(_0x55ecc1,null));};exports['destroy']=function(_0x4bc515,_0x2bc4a2){return db['VoiceTransferReport'][_0xf790('0x40')]({'where':{'id':_0x4bc515['params']['id']}})['then'](handleEntityNotFound(_0x2bc4a2,null))[_0xf790('0x38')](removeEntity(_0x2bc4a2,null))[_0xf790('0x3d')](handleError(_0x2bc4a2,null));};exports[_0xf790('0x43')]=function(_0x5bb6be,_0x34c14d){return db[_0xf790('0x21')][_0xf790('0x43')]()[_0xf790('0x38')](respondWithResult(_0x34c14d,null))[_0xf790('0x3d')](handleError(_0x34c14d,null));}; \ No newline at end of file +var _0xd2a8=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','type','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0xd2a8,0x1dc));var _0x8d2a=function(_0x846d1b,_0x4f7c27){_0x846d1b=_0x846d1b-0x0;var _0x5a49a9=_0xd2a8[_0x846d1b];return _0x5a49a9;};'use strict';var emlformat=require(_0x8d2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d2a('0x2'));var moment=require(_0x8d2a('0x3'));var BPromise=require(_0x8d2a('0x4'));var Mustache=require('mustache');var util=require(_0x8d2a('0x5'));var path=require(_0x8d2a('0x6'));var sox=require(_0x8d2a('0x7'));var csv=require(_0x8d2a('0x8'));var ejs=require(_0x8d2a('0x9'));var fs=require('fs');var fs_extra=require(_0x8d2a('0xa'));var _=require(_0x8d2a('0xb'));var squel=require(_0x8d2a('0xc'));var crypto=require(_0x8d2a('0xd'));var jsforce=require(_0x8d2a('0xe'));var deskjs=require(_0x8d2a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8d2a('0x10'));var Papa=require('papaparse');var Redis=require(_0x8d2a('0x11'));var authService=require(_0x8d2a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d2a('0x13'));var logger=require('../../config/logger')(_0x8d2a('0x14'));var utils=require('../../config/utils');var config=require(_0x8d2a('0x15'));var licenseUtil=require(_0x8d2a('0x16'));var db=require(_0x8d2a('0x17'))['db'];function respondWithStatusCode(_0x4935df,_0x5a2cc2){_0x5a2cc2=_0x5a2cc2||0xcc;return function(_0x39c9ea){if(_0x39c9ea){return _0x4935df[_0x8d2a('0x18')](_0x5a2cc2);}return _0x4935df[_0x8d2a('0x19')](_0x5a2cc2)[_0x8d2a('0x1a')]();};}function respondWithResult(_0xaea3db,_0x1c0e42){_0x1c0e42=_0x1c0e42||0xc8;return function(_0x198b2e){if(_0x198b2e){return _0xaea3db[_0x8d2a('0x19')](_0x1c0e42)[_0x8d2a('0x1b')](_0x198b2e);}};}function respondWithFilteredResult(_0x85754b,_0x3c4662){return function(_0x3da26e){if(_0x3da26e){var _0x4119c6=typeof _0x3c4662[_0x8d2a('0x1c')]===_0x8d2a('0x1d')&&typeof _0x3c4662[_0x8d2a('0x1e')]===_0x8d2a('0x1d');var _0x49aa8b=_0x3da26e[_0x8d2a('0x1f')];var _0x16cbfe=_0x4119c6?0x0:_0x3c4662[_0x8d2a('0x1c')];var _0x4c8e41=_0x4119c6?_0x3da26e[_0x8d2a('0x1f')]:_0x3c4662['offset']+_0x3c4662[_0x8d2a('0x1e')];var _0xcb528d;if(_0x4c8e41>=_0x49aa8b){_0x4c8e41=_0x49aa8b;_0xcb528d=0xc8;}else{_0xcb528d=0xce;}_0x85754b['status'](_0xcb528d);return _0x85754b['set'](_0x8d2a('0x20'),_0x16cbfe+'-'+_0x4c8e41+'/'+_0x49aa8b)[_0x8d2a('0x1b')](_0x3da26e);}return null;};}function patchUpdates(_0x22f33b){return function(_0x3cf0fb){try{jsonpatch[_0x8d2a('0x21')](_0x3cf0fb,_0x22f33b,!![]);}catch(_0x270312){return BPromise['reject'](_0x270312);}return _0x3cf0fb[_0x8d2a('0x22')]();};}function saveUpdates(_0x17aa3e,_0x4e3343){return function(_0x242551){if(_0x242551){return _0x242551[_0x8d2a('0x23')](_0x17aa3e)[_0x8d2a('0x24')](function(_0x1ca196){return _0x1ca196;});}return null;};}function removeEntity(_0xd92034,_0x54e822){return function(_0x291993){if(_0x291993){return _0x291993['destroy']()['then'](function(){_0xd92034[_0x8d2a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d8bb,_0x6bfd2d){return function(_0x41973c){if(!_0x41973c){_0x52d8bb[_0x8d2a('0x18')](0x194);}return _0x41973c;};}function handleError(_0x445f79,_0x218013){_0x218013=_0x218013||0x1f4;return function(_0x28030a){logger[_0x8d2a('0x25')](_0x28030a[_0x8d2a('0x26')]);if(_0x28030a[_0x8d2a('0x27')]){delete _0x28030a['name'];}_0x445f79['status'](_0x218013)[_0x8d2a('0x28')](_0x28030a);};}exports['index']=function(_0xbf5968,_0x4472db){var _0x1bd0fe={},_0x46c551={},_0x3e1f9e={'count':0x0,'rows':[]};var _0x17e912=_[_0x8d2a('0x29')](db['VoiceTransferReport'][_0x8d2a('0x2a')],function(_0x177a5a){return{'name':_0x177a5a[_0x8d2a('0x2b')],'type':_0x177a5a['type']['key']};});_0x46c551[_0x8d2a('0x2c')]=_['map'](_0x17e912,_0x8d2a('0x27'));_0x46c551[_0x8d2a('0x2d')]=_[_0x8d2a('0x2e')](_0xbf5968[_0x8d2a('0x2d')]);_0x46c551[_0x8d2a('0x2f')]=_[_0x8d2a('0x30')](_0x46c551[_0x8d2a('0x2c')],_0x46c551['query']);_0x1bd0fe['attributes']=_[_0x8d2a('0x30')](_0x46c551[_0x8d2a('0x2c')],qs[_0x8d2a('0x31')](_0xbf5968[_0x8d2a('0x2d')][_0x8d2a('0x31')]));_0x1bd0fe[_0x8d2a('0x32')]=_0x1bd0fe[_0x8d2a('0x32')][_0x8d2a('0x33')]?_0x1bd0fe[_0x8d2a('0x32')]:_0x46c551['model'];if(!_0xbf5968[_0x8d2a('0x2d')]['hasOwnProperty']('nolimit')){_0x1bd0fe[_0x8d2a('0x1e')]=qs[_0x8d2a('0x1e')](_0xbf5968[_0x8d2a('0x2d')][_0x8d2a('0x1e')]);_0x1bd0fe[_0x8d2a('0x1c')]=qs[_0x8d2a('0x1c')](_0xbf5968[_0x8d2a('0x2d')]['offset']);}_0x1bd0fe['order']=qs[_0x8d2a('0x34')](_0xbf5968[_0x8d2a('0x2d')][_0x8d2a('0x34')]);_0x1bd0fe[_0x8d2a('0x35')]=qs[_0x8d2a('0x2f')](_['pick'](_0xbf5968['query'],_0x46c551[_0x8d2a('0x2f')]),_0x17e912);if(_0xbf5968[_0x8d2a('0x2d')][_0x8d2a('0x36')]){_0x1bd0fe[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x1bd0fe[_0x8d2a('0x35')],{'$or':_[_0x8d2a('0x29')](_0x17e912,function(_0x23cc25){if(_0x23cc25[_0x8d2a('0x38')]!==_0x8d2a('0x39')){var _0x208387={};_0x208387[_0x23cc25[_0x8d2a('0x27')]]={'$like':'%'+_0xbf5968[_0x8d2a('0x2d')][_0x8d2a('0x36')]+'%'};return _0x208387;}})});}_0x1bd0fe=_[_0x8d2a('0x37')]({},_0x1bd0fe,_0xbf5968[_0x8d2a('0x3a')]);var _0x5c3954={'where':_0x1bd0fe[_0x8d2a('0x35')]};return db[_0x8d2a('0x3b')][_0x8d2a('0x1f')](_0x5c3954)[_0x8d2a('0x24')](function(_0x20a416){_0x3e1f9e['count']=_0x20a416;if(_0xbf5968[_0x8d2a('0x2d')][_0x8d2a('0x3c')]){_0x1bd0fe[_0x8d2a('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x8d2a('0x3e')](_0x1bd0fe);})[_0x8d2a('0x24')](function(_0x21f4fa){_0x3e1f9e[_0x8d2a('0x3f')]=_0x21f4fa;return _0x3e1f9e;})[_0x8d2a('0x24')](respondWithFilteredResult(_0x4472db,_0x1bd0fe))['catch'](handleError(_0x4472db,null));};exports['show']=function(_0xab260,_0xd7f432){var _0x5e9223={'raw':!![],'where':{'id':_0xab260['params']['id']}},_0x597513={};_0x597513[_0x8d2a('0x2c')]=_[_0x8d2a('0x2e')](db[_0x8d2a('0x3b')][_0x8d2a('0x2a')]);_0x597513[_0x8d2a('0x2d')]=_[_0x8d2a('0x2e')](_0xab260[_0x8d2a('0x2d')]);_0x597513[_0x8d2a('0x2f')]=_[_0x8d2a('0x30')](_0x597513['model'],_0x597513['query']);_0x5e9223[_0x8d2a('0x32')]=_[_0x8d2a('0x30')](_0x597513['model'],qs[_0x8d2a('0x31')](_0xab260[_0x8d2a('0x2d')][_0x8d2a('0x31')]));_0x5e9223[_0x8d2a('0x32')]=_0x5e9223[_0x8d2a('0x32')][_0x8d2a('0x33')]?_0x5e9223[_0x8d2a('0x32')]:_0x597513[_0x8d2a('0x2c')];if(_0xab260[_0x8d2a('0x2d')][_0x8d2a('0x3c')]){_0x5e9223['include']=[{'all':!![]}];}_0x5e9223=_['merge']({},_0x5e9223,_0xab260[_0x8d2a('0x3a')]);return db[_0x8d2a('0x3b')][_0x8d2a('0x40')](_0x5e9223)[_0x8d2a('0x24')](handleEntityNotFound(_0xd7f432,null))[_0x8d2a('0x24')](respondWithResult(_0xd7f432,null))[_0x8d2a('0x41')](handleError(_0xd7f432,null));};exports['create']=function(_0x4291ab,_0x150bd1){return db[_0x8d2a('0x3b')][_0x8d2a('0x42')](_0x4291ab[_0x8d2a('0x43')],{})['then'](respondWithResult(_0x150bd1,0xc9))['catch'](handleError(_0x150bd1,null));};exports['update']=function(_0x2853cf,_0x32fc83){if(_0x2853cf['body']['id']){delete _0x2853cf[_0x8d2a('0x43')]['id'];}return db[_0x8d2a('0x3b')][_0x8d2a('0x40')]({'where':{'id':_0x2853cf[_0x8d2a('0x44')]['id']}})[_0x8d2a('0x24')](handleEntityNotFound(_0x32fc83,null))['then'](saveUpdates(_0x2853cf[_0x8d2a('0x43')],null))[_0x8d2a('0x24')](respondWithResult(_0x32fc83,null))[_0x8d2a('0x41')](handleError(_0x32fc83,null));};exports['destroy']=function(_0x1e8052,_0x19630c){return db[_0x8d2a('0x3b')]['find']({'where':{'id':_0x1e8052[_0x8d2a('0x44')]['id']}})[_0x8d2a('0x24')](handleEntityNotFound(_0x19630c,null))[_0x8d2a('0x24')](removeEntity(_0x19630c,null))[_0x8d2a('0x41')](handleError(_0x19630c,null));};exports[_0x8d2a('0x45')]=function(_0x1749df,_0x166d80){return db['VoiceTransferReport'][_0x8d2a('0x45')]()['then'](respondWithResult(_0x166d80,null))[_0x8d2a('0x41')](handleError(_0x166d80,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1f87edb..5f43ffe 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 _0xeb0f=['request-promise','path','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','util','api','moment'];(function(_0x4c8627,_0x35da57){var _0x216f5f=function(_0x3ea964){while(--_0x3ea964){_0x4c8627['push'](_0x4c8627['shift']());}};_0x216f5f(++_0x35da57);}(_0xeb0f,0x115));var _0xfeb0=function(_0x483da5,_0x3b9228){_0x483da5=_0x483da5-0x0;var _0x1cccfa=_0xeb0f[_0x483da5];return _0x1cccfa;};'use strict';var _=require('lodash');var util=require(_0xfeb0('0x0'));var logger=require('../../config/logger')(_0xfeb0('0x1'));var moment=require(_0xfeb0('0x2'));var BPromise=require('bluebird');var rp=require(_0xfeb0('0x3'));var fs=require('fs');var path=require(_0xfeb0('0x4'));var rimraf=require('rimraf');var config=require(_0xfeb0('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0xfeb0('0x6')]=function(_0x1abf6f,_0x460886){return _0x1abf6f[_0xfeb0('0x7')](_0xfeb0('0x8'),attributes,{'tableName':_0xfeb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0045=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer'];(function(_0x2a6a54,_0x2bd8bc){var _0x5cae84=function(_0x18da82){while(--_0x18da82){_0x2a6a54['push'](_0x2a6a54['shift']());}};_0x5cae84(++_0x2bd8bc);}(_0x0045,0x1c8));var _0x5004=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0045[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5004('0x0'));var util=require(_0x5004('0x1'));var logger=require('../../config/logger')(_0x5004('0x2'));var moment=require(_0x5004('0x3'));var BPromise=require(_0x5004('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5004('0x5'));var rimraf=require(_0x5004('0x6'));var config=require(_0x5004('0x7'));var attributes=require(_0x5004('0x8'));module[_0x5004('0x9')]=function(_0x4ea687,_0x4ae156){return _0x4ea687[_0x5004('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x5004('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index d167b59..ee1cb56 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 _0x11ec=['error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x104830,_0x4efe9b){var _0x495616=function(_0x4d0716){while(--_0x4d0716){_0x104830['push'](_0x104830['shift']());}};_0x495616(++_0x4efe9b);}(_0x11ec,0x14a));var _0xc11e=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x11ec[_0x10b48a];return _0x2c4533;};'use strict';var _=require('lodash');var util=require(_0xc11e('0x0'));var moment=require(_0xc11e('0x1'));var BPromise=require(_0xc11e('0x2'));var rs=require(_0xc11e('0x3'));var fs=require('fs');var Redis=require(_0xc11e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc11e('0x5'));var logger=require('../../config/logger')(_0xc11e('0x6'));var config=require(_0xc11e('0x7'));var jayson=require(_0xc11e('0x8'));var client=jayson['client'][_0xc11e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a40f4,_0x11ac3e,_0x1b7bae){return new BPromise(function(_0x925aef,_0x2eb1f9){return client[_0xc11e('0xa')](_0x2a40f4,_0x1b7bae)[_0xc11e('0xb')](function(_0x15977e){logger[_0xc11e('0xc')](_0xc11e('0xd'),_0x11ac3e,_0xc11e('0xe'));logger[_0xc11e('0xf')](_0xc11e('0x10'),_0x11ac3e,_0xc11e('0xe'),JSON[_0xc11e('0x11')](_0x15977e));if(_0x15977e[_0xc11e('0x12')]){if(_0x15977e[_0xc11e('0x12')][_0xc11e('0x13')]===0x1f4){logger['error'](_0xc11e('0xd'),_0x11ac3e,_0x15977e[_0xc11e('0x12')]['message']);return _0x2eb1f9(_0x15977e['error'][_0xc11e('0x14')]);}logger[_0xc11e('0x12')](_0xc11e('0xd'),_0x11ac3e,_0x15977e['error'][_0xc11e('0x14')]);return _0x925aef(_0x15977e[_0xc11e('0x12')][_0xc11e('0x14')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x11ac3e,_0xc11e('0xe'));_0x925aef(_0x15977e[_0xc11e('0x15')][_0xc11e('0x14')]);}})[_0xc11e('0x16')](function(_0x3b8527){logger[_0xc11e('0x12')](_0xc11e('0xd'),_0x11ac3e,_0x3b8527);_0x2eb1f9(_0x3b8527);});});}exports['CreateVoiceTransferReport']=function(_0xbf9587){var _0x4bc34e=this;return new Promise(function(_0x3b9ad1,_0x3635c9){return db[_0xc11e('0x17')][_0xc11e('0x18')](_0xbf9587[_0xc11e('0x19')],{'raw':_0xbf9587[_0xc11e('0x1a')]?_0xbf9587[_0xc11e('0x1a')][_0xc11e('0x1b')]===undefined?!![]:![]:!![]})[_0xc11e('0xb')](function(_0x2662e4){logger[_0xc11e('0xc')](_0xc11e('0x1c'),_0xbf9587);logger[_0xc11e('0xf')]('CreateVoiceTransferReport',_0xbf9587,JSON[_0xc11e('0x11')](_0x2662e4));_0x3b9ad1(_0x2662e4);})[_0xc11e('0x16')](function(_0x4cbd7c){logger[_0xc11e('0x12')](_0xc11e('0x1c'),_0x4cbd7c[_0xc11e('0x14')],_0xbf9587);_0x3635c9(_0x4bc34e[_0xc11e('0x12')](0x1f4,_0x4cbd7c['message']));});});}; \ No newline at end of file +var _0xac8f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','randomstring','ioredis'];(function(_0x2a45d9,_0x470d6f){var _0x274612=function(_0x103c3f){while(--_0x103c3f){_0x2a45d9['push'](_0x2a45d9['shift']());}};_0x274612(++_0x470d6f);}(_0xac8f,0x126));var _0xfac8=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xac8f[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xfac8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfac8('0x1'));var fs=require('fs');var Redis=require(_0xfac8('0x2'));var db=require(_0xfac8('0x3'))['db'];var utils=require(_0xfac8('0x4'));var logger=require(_0xfac8('0x5'))(_0xfac8('0x6'));var config=require('../../config/environment');var jayson=require(_0xfac8('0x7'));var client=jayson['client'][_0xfac8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x304c3b,_0x711565,_0x1b2abe){return new BPromise(function(_0x298c46,_0x258fea){return client['request'](_0x304c3b,_0x1b2abe)[_0xfac8('0x9')](function(_0x5de7ec){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x711565,_0xfac8('0xa'));logger[_0xfac8('0xb')](_0xfac8('0xc'),_0x711565,_0xfac8('0xa'),JSON[_0xfac8('0xd')](_0x5de7ec));if(_0x5de7ec[_0xfac8('0xe')]){if(_0x5de7ec[_0xfac8('0xe')][_0xfac8('0xf')]===0x1f4){logger[_0xfac8('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x711565,_0x5de7ec[_0xfac8('0xe')][_0xfac8('0x10')]);return _0x258fea(_0x5de7ec['error'][_0xfac8('0x10')]);}logger[_0xfac8('0xe')](_0xfac8('0x11'),_0x711565,_0x5de7ec[_0xfac8('0xe')]['message']);return _0x298c46(_0x5de7ec[_0xfac8('0xe')][_0xfac8('0x10')]);}else{logger[_0xfac8('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x711565,_0xfac8('0xa'));_0x298c46(_0x5de7ec[_0xfac8('0x13')]['message']);}})['catch'](function(_0x37d68b){logger[_0xfac8('0xe')](_0xfac8('0x11'),_0x711565,_0x37d68b);_0x258fea(_0x37d68b);});});}exports[_0xfac8('0x14')]=function(_0x5fa9dd){var _0x558b65=this;return new Promise(function(_0x2cfb59,_0x460ca9){return db[_0xfac8('0x15')][_0xfac8('0x16')](_0x5fa9dd[_0xfac8('0x17')],{'raw':_0x5fa9dd[_0xfac8('0x18')]?_0x5fa9dd[_0xfac8('0x18')][_0xfac8('0x19')]===undefined?!![]:![]:!![]})[_0xfac8('0x9')](function(_0x17c2fc){logger[_0xfac8('0x12')](_0xfac8('0x14'),_0x5fa9dd);logger[_0xfac8('0xb')]('CreateVoiceTransferReport',_0x5fa9dd,JSON[_0xfac8('0xd')](_0x17c2fc));_0x2cfb59(_0x17c2fc);})[_0xfac8('0x1a')](function(_0x28d184){logger['error']('CreateVoiceTransferReport',_0x28d184[_0xfac8('0x10')],_0x5fa9dd);_0x460ca9(_0x558b65['error'](0x1f4,_0x28d184[_0xfac8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 30fad68..5e72419 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 _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x4478f7,_0x33a75f){var _0x1cef5f=function(_0x572989){while(--_0x572989){_0x4478f7['push'](_0x4478f7['shift']());}};_0x1cef5f(++_0x33a75f);}(_0xdace,0xc5));var _0xedac=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xdace[_0x1beef3];return _0x5af964;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file +var _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x20d919,_0x106eb9){var _0x2726b0=function(_0x1030d5){while(--_0x1030d5){_0x20d919['push'](_0x20d919['shift']());}};_0x2726b0(++_0x106eb9);}(_0xedd9,0xfc));var _0x9edd=function(_0x4a3b67,_0x2e0c40){_0x4a3b67=_0x4a3b67-0x0;var _0x273be6=_0xedd9[_0x4a3b67];return _0x273be6;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 02bc82c..54b82cf 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 _0xe28e=['../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','handleError:','stack','name','send','status','NotFound','request','error','code','message','result','catch','findOne','VoiceChannels','all','then','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','body','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup','hangup\x20fired:','userId','format','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','webbar:unhold','calls','rows','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','transferNumber','path','lodash'];(function(_0x46eaae,_0x189c95){var _0x540d9d=function(_0x141c63){while(--_0x141c63){_0x46eaae['push'](_0x46eaae['shift']());}};_0x540d9d(++_0x189c95);}(_0xe28e,0x1ba));var _0xee28=function(_0x3173c0,_0x2f82f4){_0x3173c0=_0x3173c0-0x0;var _0x344042=_0xe28e[_0x3173c0];return _0x344042;};'use strict';var path=require(_0xee28('0x0'));var fs=require('fs');var _=require(_0xee28('0x1'));var db=require(_0xee28('0x2'))['db'];var config=require(_0xee28('0x3'));var util=require(_0xee28('0x4'));var BPromise=require(_0xee28('0x5'));var jayson=require(_0xee28('0x6'));var amiClient=jayson[_0xee28('0x7')][_0xee28('0x8')]({'port':0x232a});var logger=require(_0xee28('0x9'))(_0xee28('0xa'));var Redis=require(_0xee28('0xb'));config[_0xee28('0xc')]=_['defaults'](config[_0xee28('0xc')],{'host':_0xee28('0xd'),'port':0x18eb});var io=require(_0xee28('0xe'))(new Redis(config[_0xee28('0xc')]));var Schema=require(_0xee28('0xf'));var originateValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0xee28('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':[!![],_0xee28('0x13')]},'transferNumber':{'type':_0xee28('0x12'),'required':[!![],_0xee28('0x14')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xee28('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]}});function emit(_0x343358,_0x1ff99e,_0x11c95d){logger['info'](_0x343358,_0x1ff99e,JSON[_0xee28('0x15')](_0x11c95d));io['to'](_0x343358)['emit'](_0x1ff99e,_0x11c95d);}function handleError(_0x37e429){return function(_0x19472a){console['log'](_0xee28('0x16'),_0x19472a,_0x19472a instanceof RangeError);logger['error'](_0x19472a[_0xee28('0x17')]);if(_0x19472a instanceof RangeError){if(_0x19472a['name']){delete _0x19472a[_0xee28('0x18')];}_0x37e429['status'](0x194)[_0xee28('0x19')](_0x19472a);}else{if(_0x19472a['name']){delete _0x19472a[_0xee28('0x18')];}_0x37e429[_0xee28('0x1a')](0x1f4)[_0xee28('0x19')](_0x19472a);}};}function checkError(){return function(_0x3674c7){if(!_0x3674c7){throw new RangeError(_0xee28('0x1b'));}return _0x3674c7;};}function respondWithRpcPromise(_0x1280f5,_0x2dbd49){return new BPromise(function(_0x4bda53,_0x342798){var _0x44d7ff=amiClient;return _0x44d7ff[_0xee28('0x1c')](_0x1280f5,_0x2dbd49)['then'](function(_0x5b500b){if(_0x5b500b[_0xee28('0x1d')]){if(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1e')]===0x1f4){return _0x342798(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1f')]);}return _0x4bda53(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1f')]);}else{_0x4bda53(_0x5b500b[_0xee28('0x20')]);}})[_0xee28('0x21')](function(_0x733ca8){_0x342798(_0x733ca8);});});}function getAgent(_0x281c8a){return db['User'][_0xee28('0x22')]({'where':{'id':_0x281c8a,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x54528b,_0x587aac){return new BPromise(function(_0x51eae7,_0x8373a7){var _0x884e7d=respondWithRpcPromise(_0xee28('0x23'));var _0x469889=getAgent(_0x54528b);Promise[_0xee28('0x24')]([_0x884e7d,_0x469889])[_0xee28('0x25')](function(_0xbafd67){var _0x4fcc8f=_0xbafd67[0x0];var _0x84e0ba=_0xbafd67[0x1];var _0x7390dc=_[_0xee28('0x26')](_0x4fcc8f['rows'],function(_0x14f7c4){return _0x14f7c4[_0xee28('0x27')]==_0x84e0ba['id']&&_0x14f7c4[_0xee28('0x28')]==_0x587aac;});if(_0x7390dc[_0xee28('0x29')]==0x1){_0x51eae7(_0x84e0ba);}else{_0x8373a7(new RangeError(_0xee28('0x2a')+_0x587aac+_0xee28('0x2b')));}});});}exports[_0xee28('0x2c')]=function(_0x5d2a9d,_0x15f294){logger[_0xee28('0x2d')]('originate\x20fired:',_0x5d2a9d[_0xee28('0x2e')]);var _0x34dd11=originateValidation[_0xee28('0xf')](_0x5d2a9d[_0xee28('0x2e')]);if(_0x34dd11[_0xee28('0x29')]>0x0){return _0x15f294[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x34dd11);}var _0x5a4f48=_0x5d2a9d['body']['userId'];var _0x1a8ef0=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x30')];var _0x3402ce=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x31')];var _0x5b0c20=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x32')];return getAgent(_0x5a4f48)['then'](function(_0x51b28d){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x51b28d['name']);emit(util['format'](_0xee28('0x34'),_0x51b28d[_0xee28('0x18')]),'webbar:originate',{'callNumber':_0x1a8ef0,'callerId':_0x3402ce,'callbackUrl':_0x5b0c20});return _0x15f294[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x35')});})[_0xee28('0x21')](handleError(_0x15f294));};exports[_0xee28('0x36')]=function(_0x594116,_0x2a5d06){logger[_0xee28('0x2d')](_0xee28('0x37'),_0x594116[_0xee28('0x2e')]);var _0x43b587=hangupValidation[_0xee28('0xf')](_0x594116['body']);if(_0x43b587[_0xee28('0x29')]>0x0){return _0x2a5d06['status'](0x190)['json'](_0x43b587);}var _0x265ae5=_0x594116['body'][_0xee28('0x38')];var _0x5c5f08=_0x594116[_0xee28('0x2e')]['sessionId'];return getAgent(_0x265ae5)[_0xee28('0x25')](function(_0x211345){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x211345['name']);emit(util[_0xee28('0x39')]('user:%s',_0x211345[_0xee28('0x18')]),_0xee28('0x3a'),{'sessionId':_0x5c5f08});return _0x2a5d06[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x3b')});})[_0xee28('0x21')](handleError(_0x2a5d06));};exports[_0xee28('0x3c')]=function(_0x5a4b9c,_0x4d9d21){logger[_0xee28('0x2d')]('answer\x20fired:',_0x5a4b9c['body']);var _0x4064cf=answerValidation[_0xee28('0xf')](_0x5a4b9c['body']);if(_0x4064cf[_0xee28('0x29')]>0x0){return _0x4d9d21[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x4064cf);}var _0x24cfaa=_0x5a4b9c[_0xee28('0x2e')][_0xee28('0x38')];var _0x1735a9=_0x5a4b9c['body'][_0xee28('0x28')];return getAgent(_0x24cfaa)[_0xee28('0x25')](function(_0x2dd024){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x2dd024['name']);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x2dd024['name']),_0xee28('0x3d'),{'sessionId':_0x1735a9});return _0x4d9d21[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x3e')});})[_0xee28('0x21')](handleError(_0x4d9d21));};exports[_0xee28('0x3f')]=function(_0x54ab7b,_0x36e5bb){logger['info']('hold\x20fired:',_0x54ab7b[_0xee28('0x2e')]);var _0x2f240f=holdValidation['validate'](_0x54ab7b[_0xee28('0x2e')]);if(_0x2f240f[_0xee28('0x29')]>0x0){return _0x36e5bb[_0xee28('0x1a')](0x190)['json'](_0x2f240f);}var _0x57e57e=_0x54ab7b[_0xee28('0x2e')][_0xee28('0x38')];var _0x1bb1ac=_0x54ab7b[_0xee28('0x2e')][_0xee28('0x28')];return getAgent(_0x57e57e)[_0xee28('0x25')](function(_0x2574c5){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x2574c5[_0xee28('0x18')]);emit(util['format'](_0xee28('0x34'),_0x2574c5['name']),_0xee28('0x40'),{'sessionId':_0x1bb1ac});return _0x36e5bb[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x41')});})[_0xee28('0x21')](handleError(_0x36e5bb));};exports['unhold']=function(_0x5247fe,_0x5ca018){logger[_0xee28('0x2d')]('unhold\x20fired:',_0x5247fe['body']);var _0x659fc4=unholdValidation['validate'](_0x5247fe[_0xee28('0x2e')]);if(_0x659fc4[_0xee28('0x29')]>0x0){return _0x5ca018[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x659fc4);}var _0x398120=_0x5247fe[_0xee28('0x2e')][_0xee28('0x38')];var _0xc1bdba=_0x5247fe[_0xee28('0x2e')][_0xee28('0x28')];return getAgent(_0x398120)['then'](function(_0x1f3680){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x1f3680['name']);emit(util['format']('user:%s',_0x1f3680['name']),_0xee28('0x42'),{'sessionId':_0xc1bdba});return _0x5ca018[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':'unhold\x20executed!'});})[_0xee28('0x21')](handleError(_0x5ca018));};exports[_0xee28('0x43')]=function(_0x204bbe,_0x39b228){logger[_0xee28('0x2d')]('calls\x20fired:',_0x39b228[_0xee28('0x2e')]);var _0x1c6696=callsValidation[_0xee28('0xf')](_0x204bbe['body']);if(_0x1c6696[_0xee28('0x29')]>0x0){return _0x39b228[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x1c6696);}var _0x47794a=_0x204bbe[_0xee28('0x2e')][_0xee28('0x38')];var _0xfcca7e=respondWithRpcPromise('VoiceChannels');var _0x161394=getAgent(_0x47794a);return Promise['all']([_0xfcca7e,_0x161394])['then'](function(_0x5b7292){var _0x333d7e=_0x5b7292[0x0];var _0x7c51d5=_0x5b7292[0x1];var _0x3cad0a=_[_0xee28('0x26')](_0x333d7e[_0xee28('0x44')],function(_0x27d96d){return _0x27d96d[_0xee28('0x27')]==_0x7c51d5['id'];});return _0x39b228[_0xee28('0x1a')](0xc8)['json']({'count':_0x3cad0a[_0xee28('0x29')],'rows':_0x3cad0a});})[_0xee28('0x21')](handleError(_0x39b228));};exports[_0xee28('0x45')]=function(_0x2b8252,_0x209c3e){logger[_0xee28('0x2d')](_0xee28('0x46'),_0x2b8252['body']);var _0x438943=conferenceValidation['validate'](_0x2b8252[_0xee28('0x2e')]);if(_0x438943[_0xee28('0x29')]>0x0){return _0x209c3e['status'](0x190)[_0xee28('0x2f')](_0x438943);}var _0x2a5fa7=_0x2b8252[_0xee28('0x2e')][_0xee28('0x38')];return getAgent(_0x2a5fa7)['then'](function(_0x209d6d){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x209d6d[_0xee28('0x18')]);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x209d6d[_0xee28('0x18')]),'webbar:conference');return _0x209c3e[_0xee28('0x1a')](0xc8)['json']({'error':![],'message':_0xee28('0x47')});})[_0xee28('0x21')](handleError(_0x209c3e));};exports['transfer']=function(_0x4b222a,_0x14bc7a){logger['info'](_0xee28('0x48'),_0x4b222a[_0xee28('0x2e')]);var _0x19f81a=transferValidation[_0xee28('0xf')](_0x4b222a[_0xee28('0x2e')]);if(_0x19f81a[_0xee28('0x29')]>0x0){return _0x14bc7a[_0xee28('0x1a')](0x190)['json'](_0x19f81a);}var _0x179ce6=_0x4b222a[_0xee28('0x2e')][_0xee28('0x38')];var _0x57ded5=_0x4b222a[_0xee28('0x2e')][_0xee28('0x28')];var _0x1e190f=_0x4b222a[_0xee28('0x2e')][_0xee28('0x49')];return getAgent(_0x179ce6)[_0xee28('0x25')](function(_0x5dc31e){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x5dc31e[_0xee28('0x18')]);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x5dc31e[_0xee28('0x18')]),'webbar:transfer',{'sessionId':_0x57ded5,'transferNumber':_0x1e190f});return _0x14bc7a[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x14bc7a));}; \ No newline at end of file +var _0x0e9f=['answer\x20executed!','hold','hold\x20fired:','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','path','lodash','util','client','webbarapi','ioredis','defaults','localhost','socket.io-emitter','redis','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required','info','stringify','log','handleError:','name','status','request','error','code','message','result','catch','User','then','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','body','validate','length','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:'];(function(_0x49217e,_0x33fa9a){var _0x252033=function(_0x14c9c9){while(--_0x14c9c9){_0x49217e['push'](_0x49217e['shift']());}};_0x252033(++_0x33fa9a);}(_0x0e9f,0x116));var _0xf0e9=function(_0x141ec5,_0x4097c7){_0x141ec5=_0x141ec5-0x0;var _0x3a7433=_0x0e9f[_0x141ec5];return _0x3a7433;};'use strict';var path=require(_0xf0e9('0x0'));var fs=require('fs');var _=require(_0xf0e9('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0xf0e9('0x2'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0xf0e9('0x3')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0xf0e9('0x4'));var Redis=require(_0xf0e9('0x5'));config['redis']=_[_0xf0e9('0x6')](config['redis'],{'host':_0xf0e9('0x7'),'port':0x18eb});var io=require(_0xf0e9('0x8'))(new Redis(config[_0xf0e9('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf0e9('0xa')]},'callNumber':{'type':_0xf0e9('0xb'),'required':[!![],_0xf0e9('0xc')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xf0e9('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':_0xf0e9('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf0e9('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xf0e9('0xb'),'required':[!![],_0xf0e9('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':_0xf0e9('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':_0xf0e9('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]}});function emit(_0x4f37b5,_0x320a29,_0xcf4be0){logger[_0xf0e9('0xf')](_0x4f37b5,_0x320a29,JSON[_0xf0e9('0x10')](_0xcf4be0));io['to'](_0x4f37b5)['emit'](_0x320a29,_0xcf4be0);}function handleError(_0x45a4fb){return function(_0x2f4ee3){console[_0xf0e9('0x11')](_0xf0e9('0x12'),_0x2f4ee3,_0x2f4ee3 instanceof RangeError);logger['error'](_0x2f4ee3['stack']);if(_0x2f4ee3 instanceof RangeError){if(_0x2f4ee3[_0xf0e9('0x13')]){delete _0x2f4ee3[_0xf0e9('0x13')];}_0x45a4fb[_0xf0e9('0x14')](0x194)['send'](_0x2f4ee3);}else{if(_0x2f4ee3['name']){delete _0x2f4ee3[_0xf0e9('0x13')];}_0x45a4fb[_0xf0e9('0x14')](0x1f4)['send'](_0x2f4ee3);}};}function checkError(){return function(_0x3d6c12){if(!_0x3d6c12){throw new RangeError('NotFound');}return _0x3d6c12;};}function respondWithRpcPromise(_0x3916aa,_0x1c956d){return new BPromise(function(_0x4afcff,_0x5dd652){var _0x186fa5=amiClient;return _0x186fa5[_0xf0e9('0x15')](_0x3916aa,_0x1c956d)['then'](function(_0x1cd143){if(_0x1cd143[_0xf0e9('0x16')]){if(_0x1cd143['error'][_0xf0e9('0x17')]===0x1f4){return _0x5dd652(_0x1cd143[_0xf0e9('0x16')]['message']);}return _0x4afcff(_0x1cd143[_0xf0e9('0x16')][_0xf0e9('0x18')]);}else{_0x4afcff(_0x1cd143[_0xf0e9('0x19')]);}})[_0xf0e9('0x1a')](function(_0x33048a){_0x5dd652(_0x33048a);});});}function getAgent(_0x25eacb){return db[_0xf0e9('0x1b')]['findOne']({'where':{'id':_0x25eacb,'role':'agent'}})[_0xf0e9('0x1c')](checkError());}function getAgentCheckSession(_0x4f9e96,_0x553788){return new BPromise(function(_0x5aac7f,_0x8b5167){var _0x8fd443=respondWithRpcPromise('VoiceChannels');var _0x258927=getAgent(_0x4f9e96);Promise[_0xf0e9('0x1d')]([_0x8fd443,_0x258927])[_0xf0e9('0x1c')](function(_0x480b7d){var _0x2fa5e9=_0x480b7d[0x0];var _0x337a59=_0x480b7d[0x1];var _0x439072=_[_0xf0e9('0x1e')](_0x2fa5e9[_0xf0e9('0x1f')],function(_0xf90eea){return _0xf90eea[_0xf0e9('0x20')]==_0x337a59['id']&&_0xf90eea[_0xf0e9('0x21')]==_0x553788;});if(_0x439072['length']==0x1){_0x5aac7f(_0x337a59);}else{_0x8b5167(new RangeError(_0xf0e9('0x22')+_0x553788+_0xf0e9('0x23')));}});});}exports['originate']=function(_0x4822c9,_0x25452f){logger[_0xf0e9('0xf')]('originate\x20fired:',_0x4822c9[_0xf0e9('0x24')]);var _0x10ae6c=originateValidation[_0xf0e9('0x25')](_0x4822c9[_0xf0e9('0x24')]);if(_0x10ae6c[_0xf0e9('0x26')]>0x0){return _0x25452f[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x10ae6c);}var _0x11812e=_0x4822c9['body'][_0xf0e9('0x28')];var _0x2dc765=_0x4822c9['body'][_0xf0e9('0x29')];var _0x4a8c60=_0x4822c9[_0xf0e9('0x24')]['callerId'];var _0x592402=_0x4822c9[_0xf0e9('0x24')][_0xf0e9('0x2a')];return getAgent(_0x11812e)[_0xf0e9('0x1c')](function(_0x4661bc){logger[_0xf0e9('0xf')](_0xf0e9('0x2b'),_0x4661bc['name']);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x4661bc[_0xf0e9('0x13')]),'webbar:originate',{'callNumber':_0x2dc765,'callerId':_0x4a8c60,'callbackUrl':_0x592402});return _0x25452f[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':_0xf0e9('0x2e')});})[_0xf0e9('0x1a')](handleError(_0x25452f));};exports[_0xf0e9('0x2f')]=function(_0x3ab157,_0xd20a18){logger[_0xf0e9('0xf')](_0xf0e9('0x30'),_0x3ab157[_0xf0e9('0x24')]);var _0x48040c=hangupValidation[_0xf0e9('0x25')](_0x3ab157[_0xf0e9('0x24')]);if(_0x48040c['length']>0x0){return _0xd20a18[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x48040c);}var _0x390f75=_0x3ab157[_0xf0e9('0x24')][_0xf0e9('0x28')];var _0x4ef477=_0x3ab157[_0xf0e9('0x24')][_0xf0e9('0x21')];return getAgent(_0x390f75)['then'](function(_0x27173f){logger['info'](_0xf0e9('0x2b'),_0x27173f['name']);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x27173f['name']),_0xf0e9('0x31'),{'sessionId':_0x4ef477});return _0xd20a18['status'](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0xf0e9('0x1a')](handleError(_0xd20a18));};exports[_0xf0e9('0x32')]=function(_0x13975e,_0x405bf3){logger['info'](_0xf0e9('0x33'),_0x13975e[_0xf0e9('0x24')]);var _0x50fc1b=answerValidation['validate'](_0x13975e[_0xf0e9('0x24')]);if(_0x50fc1b[_0xf0e9('0x26')]>0x0){return _0x405bf3[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x50fc1b);}var _0x1e9c7e=_0x13975e['body'][_0xf0e9('0x28')];var _0x75c120=_0x13975e[_0xf0e9('0x24')][_0xf0e9('0x21')];return getAgent(_0x1e9c7e)[_0xf0e9('0x1c')](function(_0x33a3b5){logger[_0xf0e9('0xf')]('entityFound:',_0x33a3b5[_0xf0e9('0x13')]);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x33a3b5[_0xf0e9('0x13')]),'webbar:answer',{'sessionId':_0x75c120});return _0x405bf3[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':_0xf0e9('0x34')});})['catch'](handleError(_0x405bf3));};exports[_0xf0e9('0x35')]=function(_0x33f702,_0x176871){logger[_0xf0e9('0xf')](_0xf0e9('0x36'),_0x33f702[_0xf0e9('0x24')]);var _0x25f741=holdValidation[_0xf0e9('0x25')](_0x33f702[_0xf0e9('0x24')]);if(_0x25f741[_0xf0e9('0x26')]>0x0){return _0x176871[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x25f741);}var _0x317419=_0x33f702[_0xf0e9('0x24')][_0xf0e9('0x28')];var _0x44967c=_0x33f702[_0xf0e9('0x24')][_0xf0e9('0x21')];return getAgent(_0x317419)[_0xf0e9('0x1c')](function(_0x39def0){logger[_0xf0e9('0xf')](_0xf0e9('0x2b'),_0x39def0[_0xf0e9('0x13')]);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x39def0[_0xf0e9('0x13')]),'webbar:hold',{'sessionId':_0x44967c});return _0x176871[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':'hold\x20executed!'});})[_0xf0e9('0x1a')](handleError(_0x176871));};exports[_0xf0e9('0x37')]=function(_0x26789c,_0x19419e){logger[_0xf0e9('0xf')]('unhold\x20fired:',_0x26789c[_0xf0e9('0x24')]);var _0x5ea49e=unholdValidation[_0xf0e9('0x25')](_0x26789c['body']);if(_0x5ea49e[_0xf0e9('0x26')]>0x0){return _0x19419e[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x5ea49e);}var _0xc7c4fa=_0x26789c['body']['userId'];var _0x2eaceb=_0x26789c['body'][_0xf0e9('0x21')];return getAgent(_0xc7c4fa)[_0xf0e9('0x1c')](function(_0x58f225){logger[_0xf0e9('0xf')]('entityFound:',_0x58f225[_0xf0e9('0x13')]);emit(util['format'](_0xf0e9('0x2d'),_0x58f225['name']),_0xf0e9('0x38'),{'sessionId':_0x2eaceb});return _0x19419e[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':_0xf0e9('0x39')});})['catch'](handleError(_0x19419e));};exports[_0xf0e9('0x3a')]=function(_0x5ee5fb,_0xabea45){logger['info'](_0xf0e9('0x3b'),_0xabea45[_0xf0e9('0x24')]);var _0x43fdc5=callsValidation[_0xf0e9('0x25')](_0x5ee5fb['body']);if(_0x43fdc5[_0xf0e9('0x26')]>0x0){return _0xabea45['status'](0x190)[_0xf0e9('0x27')](_0x43fdc5);}var _0x573349=_0x5ee5fb[_0xf0e9('0x24')][_0xf0e9('0x28')];var _0x6f08d9=respondWithRpcPromise(_0xf0e9('0x3c'));var _0x54a911=getAgent(_0x573349);return Promise['all']([_0x6f08d9,_0x54a911])[_0xf0e9('0x1c')](function(_0xc9dcf2){var _0xaa2ec8=_0xc9dcf2[0x0];var _0x356a71=_0xc9dcf2[0x1];var _0x20333d=_[_0xf0e9('0x1e')](_0xaa2ec8[_0xf0e9('0x1f')],function(_0xe36788){return _0xe36788[_0xf0e9('0x20')]==_0x356a71['id'];});return _0xabea45[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'count':_0x20333d[_0xf0e9('0x26')],'rows':_0x20333d});})[_0xf0e9('0x1a')](handleError(_0xabea45));};exports[_0xf0e9('0x3d')]=function(_0x5d9ebb,_0x56c259){logger[_0xf0e9('0xf')]('conference\x20fired:',_0x5d9ebb[_0xf0e9('0x24')]);var _0x42189e=conferenceValidation['validate'](_0x5d9ebb[_0xf0e9('0x24')]);if(_0x42189e[_0xf0e9('0x26')]>0x0){return _0x56c259[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x42189e);}var _0x393d6b=_0x5d9ebb[_0xf0e9('0x24')][_0xf0e9('0x28')];return getAgent(_0x393d6b)[_0xf0e9('0x1c')](function(_0x3550ea){logger[_0xf0e9('0xf')]('entityFound:',_0x3550ea[_0xf0e9('0x13')]);emit(util['format']('user:%s',_0x3550ea[_0xf0e9('0x13')]),_0xf0e9('0x3e'));return _0x56c259[_0xf0e9('0x14')](0xc8)['json']({'error':![],'message':_0xf0e9('0x3f')});})[_0xf0e9('0x1a')](handleError(_0x56c259));};exports['transfer']=function(_0x4b64d5,_0x75a07b){logger[_0xf0e9('0xf')](_0xf0e9('0x40'),_0x4b64d5[_0xf0e9('0x24')]);var _0x2e8ef8=transferValidation['validate'](_0x4b64d5[_0xf0e9('0x24')]);if(_0x2e8ef8[_0xf0e9('0x26')]>0x0){return _0x75a07b[_0xf0e9('0x14')](0x190)['json'](_0x2e8ef8);}var _0x2669e6=_0x4b64d5['body'][_0xf0e9('0x28')];var _0x19061d=_0x4b64d5['body'][_0xf0e9('0x21')];var _0x20a111=_0x4b64d5[_0xf0e9('0x24')][_0xf0e9('0x41')];return getAgent(_0x2669e6)[_0xf0e9('0x1c')](function(_0x11a77a){logger[_0xf0e9('0xf')](_0xf0e9('0x2b'),_0x11a77a[_0xf0e9('0x13')]);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x11a77a[_0xf0e9('0x13')]),'webbar:transfer',{'sessionId':_0x19061d,'transferNumber':_0x20a111});return _0x75a07b[_0xf0e9('0x14')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x75a07b));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4c88ecc..da35881 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 _0xd943=['show','get','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','send','put','/:id','destroy','/:id/dispositions','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x3e196f,_0x242865){var _0x379ca2=function(_0x1ff421){while(--_0x1ff421){_0x3e196f['push'](_0x3e196f['shift']());}};_0x379ca2(++_0x242865);}(_0xd943,0x15d));var _0x3d94=function(_0x154bba,_0x1c3d5e){_0x154bba=_0x154bba-0x0;var _0x5a01d5=_0xd943[_0x154bba];return _0x5a01d5;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller['getDispositions']);router[_0x3d94('0xc')](_0x3d94('0xd'),auth['isAuthenticated'](),controller[_0x3d94('0xe')]);router[_0x3d94('0xc')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);router['get'](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x12')]);router['post']('/',auth[_0x3d94('0x9')](),controller[_0x3d94('0x13')]);router[_0x3d94('0x14')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller[_0x3d94('0x15')]);router[_0x3d94('0x14')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x16')]);router[_0x3d94('0x14')](_0x3d94('0xf'),auth['isAuthenticated'](),controller[_0x3d94('0x17')]);router[_0x3d94('0x14')](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x18')]);router[_0x3d94('0x14')](_0x3d94('0x19'),controller['notify']);router[_0x3d94('0x14')]('/:id/send',auth[_0x3d94('0x9')](),controller[_0x3d94('0x1a')]);router[_0x3d94('0x1b')](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller['update']);router['delete'](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1d')]);router['delete'](_0x3d94('0x1e'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1f')]);router[_0x3d94('0x20')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x21')]);router[_0x3d94('0x20')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x22')]);module[_0x3d94('0x23')]=router; \ No newline at end of file +var _0xdb28=['removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','notify','/:id/send','put','update','delete','destroy'];(function(_0x1b7710,_0x14f79e){var _0x24ba26=function(_0x76b693){while(--_0x76b693){_0x1b7710['push'](_0x1b7710['shift']());}};_0x24ba26(++_0x14f79e);}(_0xdb28,0x106));var _0x8db2=function(_0x3d2025,_0x28f01b){_0x3d2025=_0x3d2025-0x0;var _0x331658=_0xdb28[_0x3d2025];return _0x331658;};'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('./whatsappAccount.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['getAnswers']);router[_0x8db2('0x9')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8db2('0x14')]);router[_0x8db2('0x15')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);router[_0x8db2('0x15')](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x17')]);router[_0x8db2('0x15')](_0x8db2('0x11'),auth['isAuthenticated'](),controller[_0x8db2('0x18')]);router[_0x8db2('0x15')]('/:id/users',auth[_0x8db2('0xa')](),controller[_0x8db2('0x19')]);router[_0x8db2('0x15')](_0x8db2('0x1a'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x1b')]);router['post']('/:id/notify',controller[_0x8db2('0x1c')]);router[_0x8db2('0x15')](_0x8db2('0x1d'),auth[_0x8db2('0xa')](),controller['send']);router[_0x8db2('0x1e')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);router[_0x8db2('0x20')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x21')]);router[_0x8db2('0x20')](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x22')]);router[_0x8db2('0x20')]('/:id/canned_answers',auth[_0x8db2('0xa')](),controller['removeAnswers']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x8db2('0x23')]);module[_0x8db2('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index af0dd78..6541332 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 _0x3912=['randomstring','exports','STRING','name','generate','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize'];(function(_0x546a6e,_0x16122e){var _0x2289df=function(_0x35ba06){while(--_0x35ba06){_0x546a6e['push'](_0x546a6e['shift']());}};_0x2289df(++_0x16122e);}(_0x3912,0xfb));var _0x2391=function(_0x3f8e03,_0x52fbfc){_0x3f8e03=_0x3f8e03-0x0;var _0x365adc=_0x3912[_0x3f8e03];return _0x365adc;};'use strict';var Sequelize=require(_0x2391('0x0'));var rs=require(_0x2391('0x1'));module[_0x2391('0x2')]={'name':{'type':Sequelize[_0x2391('0x3')],'unique':_0x2391('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x2391('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x2391('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x2391('0x3')],'defaultValue':function(){return rs[_0x2391('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio',_0x2391('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x2391('0x3')]},'authToken':{'type':Sequelize[_0x2391('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2391('0x7');}},'notificationSound':{'type':Sequelize[_0x2391('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2391('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2391('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2391('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2391('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2391('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2391('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2391('0xa'),'set':function(_0x151ad3){if(!_0x151ad3){this['setDataValue']('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x2391('0xb'),_0x151ad3);}},'description':{'type':Sequelize[_0x2391('0x3')]}}; \ No newline at end of file +var _0x1857=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0x1857,0x96));var _0x7185=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1857[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x7185('0x0'));var rs=require(_0x7185('0x1'));module[_0x7185('0x2')]={'name':{'type':Sequelize[_0x7185('0x3')],'unique':_0x7185('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7185('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x7185('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7185('0x5')](_0x7185('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0x7185('0x3')]},'baseUrl':{'type':Sequelize[_0x7185('0x3')]},'authToken':{'type':Sequelize[_0x7185('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7185('0x7')],'defaultValue':function(){return _0x7185('0x8');}},'notificationSound':{'type':Sequelize[_0x7185('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7185('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7185('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7185('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7185('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7185('0xa')],'comment':_0x7185('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x7185('0x9')],'defaultValue':![],'comment':_0x7185('0xc'),'set':function(_0x468cb8){if(!_0x468cb8){this['setDataValue'](_0x7185('0xd'),null);}this[_0x7185('0xe')](_0x7185('0xf'),_0x468cb8);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 3f82c5b..47557e3 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 _0xf0b9=['ListId','Contacts','DESC','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','Pause','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','nolimit','order','merge','removeDispositions','ids','WhatsappAccountId','CannedAnswer','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','findOne','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','finally','getApplications','notify','whatsapp','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','twilio','from','From','replace','MessageSid','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList'];(function(_0x5e1dfe,_0x269b65){var _0x3375e2=function(_0x386c4){while(--_0x386c4){_0x5e1dfe['push'](_0x5e1dfe['shift']());}};_0x3375e2(++_0x269b65);}(_0xf0b9,0xe0));var _0x9f0b=function(_0x3f6bdf,_0x4128ef){_0x3f6bdf=_0x3f6bdf-0x0;var _0x3f64a9=_0xf0b9[_0x3f6bdf];return _0x3f64a9;};'use strict';var emlformat=require(_0x9f0b('0x0'));var rimraf=require(_0x9f0b('0x1'));var zipdir=require(_0x9f0b('0x2'));var jsonpatch=require(_0x9f0b('0x3'));var rp=require('request-promise');var moment=require(_0x9f0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9f0b('0x5'));var util=require('util');var path=require(_0x9f0b('0x6'));var sox=require(_0x9f0b('0x7'));var csv=require('to-csv');var ejs=require(_0x9f0b('0x8'));var fs=require('fs');var fs_extra=require(_0x9f0b('0x9'));var _=require(_0x9f0b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9f0b('0xb'));var deskjs=require(_0x9f0b('0xc'));var toCsv=require(_0x9f0b('0xd'));var querystring=require(_0x9f0b('0xe'));var Papa=require(_0x9f0b('0xf'));var Redis=require('ioredis');var authService=require(_0x9f0b('0x10'));var qs=require(_0x9f0b('0x11'));var as=require(_0x9f0b('0x12'));var hardwareService=require(_0x9f0b('0x13'));var logger=require(_0x9f0b('0x14'))(_0x9f0b('0x15'));var utils=require(_0x9f0b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9f0b('0x17'));var db=require('../../mysqldb')['db'];config[_0x9f0b('0x18')]=_[_0x9f0b('0x19')](config['redis'],{'host':_0x9f0b('0x1a'),'port':0x18eb});var socket=require(_0x9f0b('0x1b'))(new Redis(config['redis']));require(_0x9f0b('0x1c'))[_0x9f0b('0x1d')](socket);var jayson=require(_0x9f0b('0x1e'));var client=jayson['client'][_0x9f0b('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2e7978,_0x260820,_0x637146,_0x4b4022){return new BPromise(function(_0x294d45,_0x1f7e02){var _0x4f079f=_0x4b4022||client;return _0x4f079f[_0x9f0b('0x20')](_0x2e7978,_0x637146)[_0x9f0b('0x21')](function(_0x23f610){logger[_0x9f0b('0x22')](_0x9f0b('0x23'),_0x260820,_0x9f0b('0x24'));logger[_0x9f0b('0x25')](_0x9f0b('0x26'),_0x260820,_0x9f0b('0x24'),JSON[_0x9f0b('0x27')](_0x23f610));if(_0x23f610[_0x9f0b('0x28')]){if(_0x23f610[_0x9f0b('0x28')][_0x9f0b('0x29')]===0x1f4){logger[_0x9f0b('0x28')](_0x9f0b('0x23'),_0x260820,_0x23f610['error']['message']);return _0x1f7e02(_0x23f610[_0x9f0b('0x28')][_0x9f0b('0x2a')]);}logger['error'](_0x9f0b('0x23'),_0x260820,_0x23f610[_0x9f0b('0x28')][_0x9f0b('0x2a')]);return _0x294d45(_0x23f610[_0x9f0b('0x28')][_0x9f0b('0x2a')]);}else{logger[_0x9f0b('0x22')](_0x9f0b('0x23'),_0x260820,_0x9f0b('0x24'));_0x294d45(_0x23f610['result'][_0x9f0b('0x2a')]);}})[_0x9f0b('0x2b')](function(_0x57b89d){logger[_0x9f0b('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x260820,_0x57b89d);_0x1f7e02(_0x57b89d);});});}function respondWithStatusCode(_0x5d205a,_0x4219db){_0x4219db=_0x4219db||0xcc;return function(_0x239fa7){if(_0x239fa7){return _0x5d205a[_0x9f0b('0x2c')](_0x4219db);}return _0x5d205a[_0x9f0b('0x2d')](_0x4219db)[_0x9f0b('0x2e')]();};}function respondWithResult(_0x1cf106,_0x37156f){_0x37156f=_0x37156f||0xc8;return function(_0x55b0ae){if(_0x55b0ae){return _0x1cf106[_0x9f0b('0x2d')](_0x37156f)[_0x9f0b('0x2f')](_0x55b0ae);}};}function respondWithFilteredResult(_0x5f3fd7,_0x1dc4e7){return function(_0x4ec120){if(_0x4ec120){var _0x330948=typeof _0x1dc4e7[_0x9f0b('0x30')]==='undefined'&&typeof _0x1dc4e7['limit']===_0x9f0b('0x31');var _0x293ab0=_0x4ec120[_0x9f0b('0x32')];var _0x5173ff=_0x330948?0x0:_0x1dc4e7[_0x9f0b('0x30')];var _0x3f817c=_0x330948?_0x4ec120[_0x9f0b('0x32')]:_0x1dc4e7['offset']+_0x1dc4e7[_0x9f0b('0x33')];var _0x452b17;if(_0x3f817c>=_0x293ab0){_0x3f817c=_0x293ab0;_0x452b17=0xc8;}else{_0x452b17=0xce;}_0x5f3fd7['status'](_0x452b17);return _0x5f3fd7[_0x9f0b('0x34')](_0x9f0b('0x35'),_0x5173ff+'-'+_0x3f817c+'/'+_0x293ab0)['json'](_0x4ec120);}return null;};}function patchUpdates(_0xddb33d){return function(_0x41ee03){try{jsonpatch[_0x9f0b('0x36')](_0x41ee03,_0xddb33d,!![]);}catch(_0x3a8659){return BPromise[_0x9f0b('0x37')](_0x3a8659);}return _0x41ee03['save']();};}function saveUpdates(_0x3d9ef7,_0x1f4703){return function(_0x1904d8){if(_0x1904d8){return _0x1904d8[_0x9f0b('0x38')](_0x3d9ef7)['then'](function(_0x287e18){return _0x287e18;});}return null;};}function removeEntity(_0x57ef42,_0x28f63a){return function(_0x313f42){if(_0x313f42){return _0x313f42[_0x9f0b('0x39')]()[_0x9f0b('0x21')](function(){var _0x4d431e=_0x313f42[_0x9f0b('0x3a')]({'plain':!![]});var _0x4d120b=_0x9f0b('0x3b');return db[_0x9f0b('0x3c')][_0x9f0b('0x39')]({'where':{'type':_0x4d120b,'resourceId':_0x4d431e['id']}})[_0x9f0b('0x21')](function(){return _0x313f42;});})[_0x9f0b('0x21')](function(){_0x57ef42[_0x9f0b('0x2d')](0xcc)[_0x9f0b('0x2e')]();});}};}function handleEntityNotFound(_0x5164be,_0x5d0226){return function(_0x51db32){if(!_0x51db32){_0x5164be['sendStatus'](0x194);}return _0x51db32;};}function handleError(_0x55972a,_0x40af66){_0x40af66=_0x40af66||0x1f4;return function(_0x5b9965){logger[_0x9f0b('0x28')](_0x5b9965[_0x9f0b('0x3d')]);if(_0x5b9965[_0x9f0b('0x3e')]){delete _0x5b9965[_0x9f0b('0x3e')];}_0x55972a[_0x9f0b('0x2d')](_0x40af66)[_0x9f0b('0x3f')](_0x5b9965);};}exports[_0x9f0b('0x40')]=function(_0xe5b04b,_0x497b4c){var _0x34d402={'include':[{'model':db['Pause'],'as':_0x9f0b('0x41')}]},_0x398b0d={},_0x30bab5={'count':0x0,'rows':[]};var _0x187bfb=_['map'](db[_0x9f0b('0x42')][_0x9f0b('0x43')],function(_0x543730){return{'name':_0x543730[_0x9f0b('0x44')],'type':_0x543730[_0x9f0b('0x45')][_0x9f0b('0x46')]};});_0x398b0d['model']=_[_0x9f0b('0x47')](_0x187bfb,'name');_0x398b0d[_0x9f0b('0x48')]=_[_0x9f0b('0x49')](_0xe5b04b[_0x9f0b('0x48')]);_0x398b0d[_0x9f0b('0x4a')]=_[_0x9f0b('0x4b')](_0x398b0d[_0x9f0b('0x4c')],_0x398b0d[_0x9f0b('0x48')]);_0x34d402[_0x9f0b('0x4d')]=_[_0x9f0b('0x4b')](_0x398b0d['model'],qs[_0x9f0b('0x4e')](_0xe5b04b['query'][_0x9f0b('0x4e')]));_0x34d402[_0x9f0b('0x4d')]=_0x34d402[_0x9f0b('0x4d')][_0x9f0b('0x4f')]?_0x34d402[_0x9f0b('0x4d')]:_0x398b0d[_0x9f0b('0x4c')];if(!_0xe5b04b[_0x9f0b('0x48')][_0x9f0b('0x50')]('nolimit')){_0x34d402[_0x9f0b('0x33')]=qs[_0x9f0b('0x33')](_0xe5b04b['query'][_0x9f0b('0x33')]);_0x34d402[_0x9f0b('0x30')]=qs[_0x9f0b('0x30')](_0xe5b04b[_0x9f0b('0x48')]['offset']);}_0x34d402['order']=qs[_0x9f0b('0x51')](_0xe5b04b[_0x9f0b('0x48')]['sort']);_0x34d402['where']=qs[_0x9f0b('0x4a')](_[_0x9f0b('0x52')](_0xe5b04b[_0x9f0b('0x48')],_0x398b0d['filters']),_0x187bfb);if(_0xe5b04b[_0x9f0b('0x48')][_0x9f0b('0x53')]){_0x34d402[_0x9f0b('0x54')]=_['merge'](_0x34d402[_0x9f0b('0x54')],{'$or':_[_0x9f0b('0x47')](_0x187bfb,function(_0x15d1b1){if(_0x15d1b1[_0x9f0b('0x45')]!==_0x9f0b('0x55')){var _0x27c371={};_0x27c371[_0x15d1b1[_0x9f0b('0x3e')]]={'$like':'%'+_0xe5b04b['query'][_0x9f0b('0x53')]+'%'};return _0x27c371;}})});}_0x34d402=_['merge']({},_0x34d402,_0xe5b04b[_0x9f0b('0x56')]);var _0x5bdaf9={'where':_0x34d402[_0x9f0b('0x54')]};return db[_0x9f0b('0x42')][_0x9f0b('0x32')](_0x5bdaf9)['then'](function(_0x36b4d1){_0x30bab5[_0x9f0b('0x32')]=_0x36b4d1;if(_0xe5b04b['query'][_0x9f0b('0x57')]){_0x34d402[_0x9f0b('0x58')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x9f0b('0x59')](_0x34d402);})[_0x9f0b('0x21')](function(_0x16cab3){_0x30bab5[_0x9f0b('0x5a')]=_0x16cab3;return _0x30bab5;})['then'](respondWithFilteredResult(_0x497b4c,_0x34d402))[_0x9f0b('0x2b')](handleError(_0x497b4c,null));};exports['show']=function(_0x2b3d55,_0x158000){var _0x1afd78={'raw':![],'where':{'id':_0x2b3d55[_0x9f0b('0x5b')]['id']},'include':[{'model':db[_0x9f0b('0x5c')],'as':_0x9f0b('0x41')}]},_0x2f1d44={};_0x2f1d44['model']=_[_0x9f0b('0x49')](db[_0x9f0b('0x42')][_0x9f0b('0x43')]);_0x2f1d44['query']=_['keys'](_0x2b3d55[_0x9f0b('0x48')]);_0x2f1d44['filters']=_['intersection'](_0x2f1d44[_0x9f0b('0x4c')],_0x2f1d44[_0x9f0b('0x48')]);_0x1afd78[_0x9f0b('0x4d')]=_[_0x9f0b('0x4b')](_0x2f1d44[_0x9f0b('0x4c')],qs[_0x9f0b('0x4e')](_0x2b3d55[_0x9f0b('0x48')][_0x9f0b('0x4e')]));_0x1afd78['attributes']=_0x1afd78[_0x9f0b('0x4d')][_0x9f0b('0x4f')]?_0x1afd78['attributes']:_0x2f1d44['model'];if(_0x2b3d55[_0x9f0b('0x48')]['includeAll']){_0x1afd78[_0x9f0b('0x58')]=[{'all':!![]}];}_0x1afd78=_['merge']({},_0x1afd78,_0x2b3d55[_0x9f0b('0x56')]);return db[_0x9f0b('0x42')]['find'](_0x1afd78)[_0x9f0b('0x21')](handleEntityNotFound(_0x158000,null))['then'](respondWithResult(_0x158000,null))[_0x9f0b('0x2b')](handleError(_0x158000,null));};exports[_0x9f0b('0x5d')]=function(_0x11c933,_0x41b700){return db[_0x9f0b('0x42')][_0x9f0b('0x5d')](_0x11c933[_0x9f0b('0x5e')],{})[_0x9f0b('0x21')](function(_0x2d8d69){var _0x1f00f6=_0x11c933['user'][_0x9f0b('0x3a')]({'plain':!![]});if(!_0x1f00f6)throw new Error(_0x9f0b('0x5f'));if(_0x1f00f6[_0x9f0b('0x60')]===_0x9f0b('0x61')){var _0x152d63=_0x2d8d69[_0x9f0b('0x3a')]({'plain':!![]});var _0x1be658='WhatsappAccounts';return db[_0x9f0b('0x62')][_0x9f0b('0x63')]({'where':{'name':_0x1be658,'userProfileId':_0x1f00f6[_0x9f0b('0x64')]},'raw':!![]})[_0x9f0b('0x21')](function(_0x436b59){if(_0x436b59&&_0x436b59[_0x9f0b('0x65')]===0x0){return db[_0x9f0b('0x3c')][_0x9f0b('0x5d')]({'name':_0x152d63[_0x9f0b('0x3e')],'resourceId':_0x152d63['id'],'type':_0x436b59[_0x9f0b('0x3e')],'sectionId':_0x436b59['id']},{})[_0x9f0b('0x21')](function(){return _0x2d8d69;});}else{return _0x2d8d69;}})['catch'](function(_0x15fffe){logger[_0x9f0b('0x28')](_0x9f0b('0x66'),_0x15fffe);throw _0x15fffe;});}return _0x2d8d69;})['then'](respondWithResult(_0x41b700,0xc9))['catch'](handleError(_0x41b700,null));};exports[_0x9f0b('0x38')]=function(_0x281d22,_0x547a2f){if(_0x281d22[_0x9f0b('0x5e')]['id']){delete _0x281d22[_0x9f0b('0x5e')]['id'];}return db['WhatsappAccount'][_0x9f0b('0x63')]({'where':{'id':_0x281d22[_0x9f0b('0x5b')]['id']},'include':[{'model':db[_0x9f0b('0x5c')],'as':'mandatoryDispositionPause'}]})[_0x9f0b('0x21')](handleEntityNotFound(_0x547a2f,null))[_0x9f0b('0x21')](saveUpdates(_0x281d22[_0x9f0b('0x5e')],null))[_0x9f0b('0x21')](respondWithResult(_0x547a2f,null))[_0x9f0b('0x2b')](handleError(_0x547a2f,null));};exports['destroy']=function(_0xf46b8f,_0x3ab3a1){return db[_0x9f0b('0x42')][_0x9f0b('0x63')]({'where':{'id':_0xf46b8f[_0x9f0b('0x5b')]['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0x3ab3a1,null))['then'](removeEntity(_0x3ab3a1,null))[_0x9f0b('0x2b')](handleError(_0x3ab3a1,null));};exports[_0x9f0b('0x67')]=function(_0x4478a2,_0x1f0a87){return db[_0x9f0b('0x42')]['describe']()[_0x9f0b('0x21')](respondWithResult(_0x1f0a87,null))[_0x9f0b('0x2b')](handleError(_0x1f0a87,null));};exports[_0x9f0b('0x68')]=function(_0x4cb5b8,_0x1b974c,_0x10b62c){if(_0x4cb5b8[_0x9f0b('0x5e')]['id']){delete _0x4cb5b8['body']['id'];}return db[_0x9f0b('0x42')][_0x9f0b('0x63')]({'where':{'id':_0x4cb5b8[_0x9f0b('0x5b')]['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0x1b974c,null))[_0x9f0b('0x21')](function(_0x51736d){if(_0x51736d){_0x4cb5b8['body']['WhatsappAccountId']=_0x51736d['id'];return db[_0x9f0b('0x69')][_0x9f0b('0x5d')](_0x4cb5b8[_0x9f0b('0x5e')]);}})['then'](respondWithResult(_0x1b974c,null))[_0x9f0b('0x2b')](handleError(_0x1b974c,null));};exports[_0x9f0b('0x6a')]=function(_0x19bf66,_0x202daf,_0x3e1da1){var _0x533c22={'raw':![],'where':{}};var _0x44e229={};var _0x4f9ee5={'count':0x0,'rows':[]};return db[_0x9f0b('0x42')]['findOne']({'where':{'id':_0x19bf66['params']['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0x202daf,null))[_0x9f0b('0x21')](function(_0x3125db){if(_0x3125db){_0x44e229[_0x9f0b('0x4c')]=_['keys'](db[_0x9f0b('0x69')][_0x9f0b('0x43')]);_0x44e229['query']=_[_0x9f0b('0x49')](_0x19bf66[_0x9f0b('0x48')]);_0x44e229[_0x9f0b('0x4a')]=_[_0x9f0b('0x4b')](_0x44e229[_0x9f0b('0x4c')],_0x44e229[_0x9f0b('0x48')]);_0x533c22[_0x9f0b('0x4d')]=_[_0x9f0b('0x4b')](_0x44e229[_0x9f0b('0x4c')],qs[_0x9f0b('0x4e')](_0x19bf66[_0x9f0b('0x48')][_0x9f0b('0x4e')]));_0x533c22[_0x9f0b('0x4d')]=_0x533c22[_0x9f0b('0x4d')][_0x9f0b('0x4f')]?_0x533c22[_0x9f0b('0x4d')]:_0x44e229[_0x9f0b('0x4c')];if(!_0x19bf66[_0x9f0b('0x48')]['hasOwnProperty'](_0x9f0b('0x6b'))){_0x533c22['limit']=qs[_0x9f0b('0x33')](_0x19bf66[_0x9f0b('0x48')]['limit']);_0x533c22[_0x9f0b('0x30')]=qs['offset'](_0x19bf66[_0x9f0b('0x48')][_0x9f0b('0x30')]);}_0x533c22[_0x9f0b('0x6c')]=qs[_0x9f0b('0x51')](_0x19bf66['query'][_0x9f0b('0x51')]);_0x533c22[_0x9f0b('0x54')]=qs[_0x9f0b('0x4a')](_[_0x9f0b('0x52')](_0x19bf66[_0x9f0b('0x48')],_0x44e229[_0x9f0b('0x4a')]));_0x533c22[_0x9f0b('0x54')]['WhatsappAccountId']=_0x3125db['id'];if(_0x19bf66[_0x9f0b('0x48')][_0x9f0b('0x53')]){_0x533c22['where']=_[_0x9f0b('0x6d')](_0x533c22['where'],{'$or':_[_0x9f0b('0x47')](_0x533c22[_0x9f0b('0x4d')],function(_0x389c6f){var _0x4e2e88={};_0x4e2e88[_0x389c6f]={'$like':'%'+_0x19bf66[_0x9f0b('0x48')][_0x9f0b('0x53')]+'%'};return _0x4e2e88;})});}_0x533c22=_[_0x9f0b('0x6d')]({},_0x533c22,_0x19bf66[_0x9f0b('0x56')]);return db[_0x9f0b('0x69')]['count']({'where':_0x533c22[_0x9f0b('0x54')]})[_0x9f0b('0x21')](function(_0x2e4c35){_0x4f9ee5[_0x9f0b('0x32')]=_0x2e4c35;if(_0x19bf66['query']['includeAll']){_0x533c22[_0x9f0b('0x58')]=[{'all':!![]}];}return db[_0x9f0b('0x69')][_0x9f0b('0x59')](_0x533c22);})[_0x9f0b('0x21')](function(_0x1a0851){_0x4f9ee5[_0x9f0b('0x5a')]=_0x1a0851;return _0x4f9ee5;});}})[_0x9f0b('0x21')](respondWithFilteredResult(_0x202daf,_0x533c22))[_0x9f0b('0x2b')](handleError(_0x202daf,null));};exports[_0x9f0b('0x6e')]=function(_0x592afb,_0x2efa0d,_0x46071e){return db[_0x9f0b('0x42')][_0x9f0b('0x63')]({'where':{'id':_0x592afb['params']['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0x2efa0d,null))[_0x9f0b('0x21')](function(_0x3233ee){if(_0x3233ee){return _0x3233ee['removeDispositions'](_0x592afb['query'][_0x9f0b('0x6f')]);}})[_0x9f0b('0x21')](respondWithStatusCode(_0x2efa0d,null))[_0x9f0b('0x2b')](handleError(_0x2efa0d,null));};exports['addAnswer']=function(_0x1d2661,_0x18569b,_0x5a0606){if(_0x1d2661[_0x9f0b('0x5e')]['id']){delete _0x1d2661[_0x9f0b('0x5e')]['id'];}return db[_0x9f0b('0x42')][_0x9f0b('0x63')]({'where':{'id':_0x1d2661[_0x9f0b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x18569b,null))[_0x9f0b('0x21')](function(_0x15f944){if(_0x15f944){_0x1d2661[_0x9f0b('0x5e')][_0x9f0b('0x70')]=_0x15f944['id'];return db[_0x9f0b('0x71')]['create'](_0x1d2661[_0x9f0b('0x5e')]);}})['then'](respondWithResult(_0x18569b,null))[_0x9f0b('0x2b')](handleError(_0x18569b,null));};exports['getAnswers']=function(_0x4d10ec,_0x329a1e,_0x273ffb){var _0x4344f4={'raw':![],'where':{}};var _0x43cbe3={};var _0x158d37={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x4d10ec['params']['id']}})['then'](handleEntityNotFound(_0x329a1e,null))['then'](function(_0x4380bf){if(_0x4380bf){_0x43cbe3[_0x9f0b('0x4c')]=_['keys'](db[_0x9f0b('0x71')][_0x9f0b('0x43')]);_0x43cbe3['query']=_[_0x9f0b('0x49')](_0x4d10ec[_0x9f0b('0x48')]);_0x43cbe3[_0x9f0b('0x4a')]=_[_0x9f0b('0x4b')](_0x43cbe3[_0x9f0b('0x4c')],_0x43cbe3[_0x9f0b('0x48')]);_0x4344f4['attributes']=_[_0x9f0b('0x4b')](_0x43cbe3[_0x9f0b('0x4c')],qs[_0x9f0b('0x4e')](_0x4d10ec[_0x9f0b('0x48')][_0x9f0b('0x4e')]));_0x4344f4[_0x9f0b('0x4d')]=_0x4344f4['attributes'][_0x9f0b('0x4f')]?_0x4344f4['attributes']:_0x43cbe3[_0x9f0b('0x4c')];if(!_0x4d10ec[_0x9f0b('0x48')][_0x9f0b('0x50')]('nolimit')){_0x4344f4[_0x9f0b('0x33')]=qs[_0x9f0b('0x33')](_0x4d10ec[_0x9f0b('0x48')]['limit']);_0x4344f4[_0x9f0b('0x30')]=qs['offset'](_0x4d10ec[_0x9f0b('0x48')][_0x9f0b('0x30')]);}_0x4344f4[_0x9f0b('0x6c')]=qs[_0x9f0b('0x51')](_0x4d10ec[_0x9f0b('0x48')]['sort']);_0x4344f4[_0x9f0b('0x54')]=qs[_0x9f0b('0x4a')](_[_0x9f0b('0x52')](_0x4d10ec['query'],_0x43cbe3[_0x9f0b('0x4a')]));_0x4344f4[_0x9f0b('0x54')][_0x9f0b('0x70')]=_0x4380bf['id'];if(_0x4d10ec['query'][_0x9f0b('0x53')]){_0x4344f4[_0x9f0b('0x54')]=_['merge'](_0x4344f4[_0x9f0b('0x54')],{'$or':_[_0x9f0b('0x47')](_0x4344f4[_0x9f0b('0x4d')],function(_0x3dd775){var _0x37547d={};_0x37547d[_0x3dd775]={'$like':'%'+_0x4d10ec['query'][_0x9f0b('0x53')]+'%'};return _0x37547d;})});}_0x4344f4=_[_0x9f0b('0x6d')]({},_0x4344f4,_0x4d10ec['options']);return db[_0x9f0b('0x71')][_0x9f0b('0x32')]({'where':_0x4344f4[_0x9f0b('0x54')]})[_0x9f0b('0x21')](function(_0x46b664){_0x158d37[_0x9f0b('0x32')]=_0x46b664;if(_0x4d10ec[_0x9f0b('0x48')]['includeAll']){_0x4344f4['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x9f0b('0x59')](_0x4344f4);})['then'](function(_0x381d6e){_0x158d37[_0x9f0b('0x5a')]=_0x381d6e;return _0x158d37;});}})['then'](respondWithFilteredResult(_0x329a1e,_0x4344f4))[_0x9f0b('0x2b')](handleError(_0x329a1e,null));};exports['removeAnswers']=function(_0x51b6f0,_0x53dd75,_0x48f4fd){return db[_0x9f0b('0x42')][_0x9f0b('0x63')]({'where':{'id':_0x51b6f0['params']['id']}})['then'](handleEntityNotFound(_0x53dd75,null))['then'](function(_0x5a22a0){if(_0x5a22a0){return _0x5a22a0['removeAnswers'](_0x51b6f0[_0x9f0b('0x48')][_0x9f0b('0x6f')]);}})[_0x9f0b('0x21')](respondWithStatusCode(_0x53dd75,null))['catch'](handleError(_0x53dd75,null));};exports[_0x9f0b('0x72')]=function(_0x4fef52,_0x255dac,_0x36411e){return db[_0x9f0b('0x42')]['find']({'where':{'id':_0x4fef52['params']['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0x255dac,null))[_0x9f0b('0x21')](function(_0x321ee3){if(_0x321ee3){return _0x321ee3[_0x9f0b('0x72')](_0x4fef52[_0x9f0b('0x5e')][_0x9f0b('0x6f')],_[_0x9f0b('0x73')](_0x4fef52[_0x9f0b('0x5e')],[_0x9f0b('0x6f'),'id'])||{})[_0x9f0b('0x74')](function(_0xadb2e7){for(var _0x219c25=0x0;_0x219c25<_0x4fef52[_0x9f0b('0x5e')][_0x9f0b('0x6f')][_0x9f0b('0x4f')];_0x219c25+=0x1){socket[_0x9f0b('0x75')]('userWhatsappAccount:save',{'UserId':Number(_0x4fef52[_0x9f0b('0x5e')][_0x9f0b('0x6f')][_0x219c25]),'WhatsappAccountId':Number(_0x4fef52[_0x9f0b('0x5b')]['id'])});}return _0xadb2e7;});}})[_0x9f0b('0x21')](respondWithResult(_0x255dac,null))[_0x9f0b('0x2b')](handleError(_0x255dac,null));};exports['removeAgents']=function(_0x59532d,_0x3981f2,_0x574ec5){return db[_0x9f0b('0x42')][_0x9f0b('0x63')]({'where':{'id':_0x59532d[_0x9f0b('0x5b')]['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0x3981f2,null))[_0x9f0b('0x21')](function(_0x46c2bf){if(_0x46c2bf){return _0x46c2bf[_0x9f0b('0x76')](_0x59532d[_0x9f0b('0x48')][_0x9f0b('0x6f')])[_0x9f0b('0x21')](function(){if(_['isArray'](_0x59532d['query'][_0x9f0b('0x6f')])){for(var _0x48f9e3=0x0;_0x48f9e3<_0x59532d[_0x9f0b('0x48')][_0x9f0b('0x6f')]['length'];_0x48f9e3+=0x1){socket['emit'](_0x9f0b('0x77'),{'UserId':Number(_0x59532d[_0x9f0b('0x48')][_0x9f0b('0x6f')][_0x48f9e3]),'WhatsappAccountId':Number(_0x59532d[_0x9f0b('0x5b')]['id'])});}}else{socket[_0x9f0b('0x75')](_0x9f0b('0x77'),{'UserId':Number(_0x59532d[_0x9f0b('0x48')][_0x9f0b('0x6f')]),'WhatsappAccountId':Number(_0x59532d['params']['id'])});}});}})[_0x9f0b('0x21')](respondWithStatusCode(_0x3981f2,null))[_0x9f0b('0x2b')](handleError(_0x3981f2,null));};exports[_0x9f0b('0x78')]=function(_0x8cad67,_0xb94331,_0x35233d){var _0xf71900={};var _0x308076={};var _0x388bd3;var _0x237ff2;return db[_0x9f0b('0x42')][_0x9f0b('0x79')]({'where':{'id':_0x8cad67['params']['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0xb94331,null))[_0x9f0b('0x21')](function(_0x1fecef){if(_0x1fecef){_0x388bd3=_0x1fecef;_0x308076[_0x9f0b('0x4c')]=_[_0x9f0b('0x49')](db[_0x9f0b('0x7a')]['rawAttributes']);_0x308076[_0x9f0b('0x48')]=_['keys'](_0x8cad67['query']);_0x308076[_0x9f0b('0x4a')]=_[_0x9f0b('0x4b')](_0x308076[_0x9f0b('0x4c')],_0x308076[_0x9f0b('0x48')]);_0xf71900['attributes']=_[_0x9f0b('0x4b')](_0x308076[_0x9f0b('0x4c')],qs['fields'](_0x8cad67['query'][_0x9f0b('0x4e')]));_0xf71900[_0x9f0b('0x4d')]=_0xf71900[_0x9f0b('0x4d')][_0x9f0b('0x4f')]?_0xf71900['attributes']:_0x308076[_0x9f0b('0x4c')];_0xf71900[_0x9f0b('0x6c')]=qs[_0x9f0b('0x51')](_0x8cad67[_0x9f0b('0x48')][_0x9f0b('0x51')]);_0xf71900[_0x9f0b('0x54')]=qs[_0x9f0b('0x4a')](_[_0x9f0b('0x52')](_0x8cad67['query'],_0x308076[_0x9f0b('0x4a')]));if(_0x8cad67[_0x9f0b('0x48')][_0x9f0b('0x53')]){_0xf71900['where']=_['merge'](_0xf71900[_0x9f0b('0x54')],{'$or':_[_0x9f0b('0x47')](_0xf71900[_0x9f0b('0x4d')],function(_0x43f340){var _0x882894={};_0x882894[_0x43f340]={'$like':'%'+_0x8cad67[_0x9f0b('0x48')][_0x9f0b('0x53')]+'%'};return _0x882894;})});}_0xf71900=_[_0x9f0b('0x6d')]({},_0xf71900,_0x8cad67[_0x9f0b('0x56')]);return _0x388bd3['getAgents'](_0xf71900);}})[_0x9f0b('0x21')](function(_0x30b2e5){if(_0x30b2e5){_0x237ff2=_0x30b2e5[_0x9f0b('0x4f')];if(!_0x8cad67['query'][_0x9f0b('0x50')](_0x9f0b('0x6b'))){_0xf71900[_0x9f0b('0x33')]=qs[_0x9f0b('0x33')](_0x8cad67[_0x9f0b('0x48')][_0x9f0b('0x33')]);_0xf71900[_0x9f0b('0x30')]=qs[_0x9f0b('0x30')](_0x8cad67[_0x9f0b('0x48')][_0x9f0b('0x30')]);}return _0x388bd3[_0x9f0b('0x78')](_0xf71900);}})[_0x9f0b('0x21')](function(_0x5f9368){if(_0x5f9368){return _0x5f9368?{'count':_0x237ff2,'rows':_0x5f9368}:null;}})['then'](respondWithResult(_0xb94331,null))[_0x9f0b('0x2b')](handleError(_0xb94331,null));};exports[_0x9f0b('0x7b')]=function(_0x49ef74,_0x1cd2fc){var _0x4fd3e3=_0x49ef74[_0x9f0b('0x5b')]['id'];var _0x2abf17=_0x49ef74['body'];var _0x20e985=0xc8;var _0x1f4cee=null;return db[_0x9f0b('0x7c')][_0x9f0b('0x7d')]({'isolationLevel':db[_0x9f0b('0x7c')][_0x9f0b('0x7e')][_0x9f0b('0x7f')][_0x9f0b('0x80')]},function(_0x16aa14){return db[_0x9f0b('0x42')][_0x9f0b('0x79')]({'where':{'id':_0x4fd3e3},'transaction':_0x16aa14})[_0x9f0b('0x21')](function(_0x61fefd){if(_0x61fefd){return db['WhatsappApplication'][_0x9f0b('0x39')]({'where':{'WhatsappAccountId':_0x4fd3e3},'transaction':_0x16aa14})[_0x9f0b('0x21')](function(){var _0x180e93=_[_0x9f0b('0x47')](_0x2abf17,function(_0x194c60){_0x194c60['WhatsappAccountId']=_0x4fd3e3;return _0x194c60;});return db[_0x9f0b('0x81')]['bulkCreate'](_0x180e93,{'transaction':_0x16aa14});});}else{_0x20e985=0x194;_0x1f4cee=[];}});})[_0x9f0b('0x21')](function(){if(_0x20e985!==0x194){return db[_0x9f0b('0x81')][_0x9f0b('0x82')]({'where':{'WhatsappAccountId':_0x4fd3e3},'order':'priority'})[_0x9f0b('0x21')](function(_0x56ad55){_0x1f4cee=_0x56ad55;});}})[_0x9f0b('0x2b')](function(_0x5e4371){_0x20e985=0x1f4;logger['error'](_0x5e4371[_0x9f0b('0x3d')]);if(_0x5e4371[_0x9f0b('0x3e')]){delete _0x5e4371[_0x9f0b('0x3e')];}_0x1f4cee=_0x5e4371;})[_0x9f0b('0x83')](function(){if(_0x1f4cee===null){_0x1cd2fc[_0x9f0b('0x2c')](_0x20e985);}else{if(_0x20e985===0x1f4){_0x1cd2fc['status'](_0x20e985)[_0x9f0b('0x3f')](_0x1f4cee);}else{_0x1cd2fc['status'](_0x20e985)['json'](_0x1f4cee);}}});};exports[_0x9f0b('0x84')]=function(_0x37541c,_0x3499a8,_0x18e024){var _0x445b75={};var _0x400f70={};var _0xf0c2dd;var _0x17de12;return db[_0x9f0b('0x42')]['findOne']({'where':{'id':_0x37541c[_0x9f0b('0x5b')]['id']}})[_0x9f0b('0x21')](handleEntityNotFound(_0x3499a8,null))['then'](function(_0x460a19){if(_0x460a19){_0xf0c2dd=_0x460a19;_0x400f70['model']=_[_0x9f0b('0x49')](db[_0x9f0b('0x81')]['rawAttributes']);_0x400f70[_0x9f0b('0x48')]=_[_0x9f0b('0x49')](_0x37541c['query']);_0x400f70['filters']=_[_0x9f0b('0x4b')](_0x400f70[_0x9f0b('0x4c')],_0x400f70[_0x9f0b('0x48')]);_0x445b75[_0x9f0b('0x4d')]=_[_0x9f0b('0x4b')](_0x400f70[_0x9f0b('0x4c')],qs[_0x9f0b('0x4e')](_0x37541c[_0x9f0b('0x48')][_0x9f0b('0x4e')]));_0x445b75[_0x9f0b('0x4d')]=_0x445b75[_0x9f0b('0x4d')][_0x9f0b('0x4f')]?_0x445b75['attributes']:_0x400f70[_0x9f0b('0x4c')];_0x445b75[_0x9f0b('0x6c')]=qs[_0x9f0b('0x51')](_0x37541c[_0x9f0b('0x48')][_0x9f0b('0x51')]);_0x445b75['where']=qs[_0x9f0b('0x4a')](_['pick'](_0x37541c[_0x9f0b('0x48')],_0x400f70['filters']));if(_0x37541c['query']['filter']){_0x445b75[_0x9f0b('0x54')]=_['merge'](_0x445b75[_0x9f0b('0x54')],{'$or':_[_0x9f0b('0x47')](_0x445b75[_0x9f0b('0x4d')],function(_0x459f67){var _0x1a92cf={};_0x1a92cf[_0x459f67]={'$like':'%'+_0x37541c[_0x9f0b('0x48')][_0x9f0b('0x53')]+'%'};return _0x1a92cf;})});}_0x445b75=_[_0x9f0b('0x6d')]({},_0x445b75,_0x37541c['options']);return _0xf0c2dd[_0x9f0b('0x84')](_0x445b75);}})[_0x9f0b('0x21')](function(_0x171c2f){if(_0x171c2f){_0x17de12=_0x171c2f[_0x9f0b('0x4f')];if(!_0x37541c[_0x9f0b('0x48')]['hasOwnProperty'](_0x9f0b('0x6b'))){_0x445b75[_0x9f0b('0x33')]=qs['limit'](_0x37541c[_0x9f0b('0x48')][_0x9f0b('0x33')]);_0x445b75[_0x9f0b('0x30')]=qs['offset'](_0x37541c[_0x9f0b('0x48')][_0x9f0b('0x30')]);}return _0xf0c2dd['getApplications'](_0x445b75);}})[_0x9f0b('0x21')](function(_0x43cb18){if(_0x43cb18){return _0x43cb18?{'count':_0x17de12,'rows':_0x43cb18}:null;}})[_0x9f0b('0x21')](respondWithResult(_0x3499a8,null))[_0x9f0b('0x2b')](handleError(_0x3499a8,null));};exports[_0x9f0b('0x85')]=function(_0x53377c,_0x41b77d,_0x29d3d2){var _0x516c10={'channel':_0x9f0b('0x86')};var _0x13f22b=[];var _0x43cf5e=[];var _0x11ad77={};return db['WhatsappAccount']['find']({'where':{'id':_0x53377c[_0x9f0b('0x5b')]['id']},'include':[{'model':db[_0x9f0b('0x81')],'as':'Applications'}]})[_0x9f0b('0x21')](handleEntityNotFound(_0x41b77d,null))[_0x9f0b('0x21')](function(_0x5b6937){_0x516c10[_0x9f0b('0x87')]=_0x5b6937;if(_0x516c10[_0x9f0b('0x87')]&&_0x516c10['account'][_0x9f0b('0x45')]===_0x9f0b('0x88')&&_0x53377c['body'][_0x9f0b('0x89')]){if(_0x53377c[_0x9f0b('0x5e')]['statuses'][_0x9f0b('0x4f')]===0x0)return;if(_0x53377c['body'][_0x9f0b('0x89')][0x0]['state']!==_0x9f0b('0x8a'))return;return db[_0x9f0b('0x8b')]['update']({'read':!![],'readAt':_0x53377c[_0x9f0b('0x5e')][_0x9f0b('0x89')][0x0][_0x9f0b('0x8c')]},{'where':{'messageId':_0x53377c[_0x9f0b('0x5e')]['statuses'][0x0][_0x9f0b('0x8d')]},'individualHooks':!![]})[_0x9f0b('0x21')](function(_0x3ebe55){return _0x41b77d['status'](0xc8)[_0x9f0b('0x2f')](_0x3ebe55);});}_0x516c10[_0x9f0b('0x8e')]=_['orderBy'](_0x5b6937[_0x9f0b('0x8f')],['priority'],[_0x9f0b('0x90')]);if(_0x516c10[_0x9f0b('0x87')][_0x9f0b('0x8f')]){delete _0x516c10['account']['Applications'];}return db[_0x9f0b('0x91')][_0x9f0b('0x67')]()[_0x9f0b('0x21')](function(_0x210c79){if(!_0x210c79){throw new db[(_0x9f0b('0x92'))][(_0x9f0b('0x93'))](_0x9f0b('0x94'));}_0x13f22b=_[_0x9f0b('0x95')](_[_0x9f0b('0x49')](_0x210c79),['createdAt',_0x9f0b('0x96')]);_0x43cf5e=_['difference'](_[_0x9f0b('0x49')](_0x210c79),[_0x9f0b('0x97'),'updatedAt',_0x9f0b('0x98'),'ListId']);_0x516c10[_0x9f0b('0x5e')]={'mapKey':'mobile'};if(_0x516c10[_0x9f0b('0x87')]&&_0x516c10[_0x9f0b('0x87')][_0x9f0b('0x45')]===_0x9f0b('0x99')){_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9a')]=_0x53377c[_0x9f0b('0x5e')][_0x9f0b('0x9b')][_0x9f0b('0x9c')]('whatsapp:','');_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x5e')]=_0x53377c[_0x9f0b('0x5e')]['Body'];_0x516c10[_0x9f0b('0x5e')]['messageId']=_0x53377c[_0x9f0b('0x5e')][_0x9f0b('0x9d')];}if(_0x516c10[_0x9f0b('0x87')]&&_0x516c10[_0x9f0b('0x87')][_0x9f0b('0x45')]==='sinch'){_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9a')]=_0x53377c['body']['notifications'][0x0][_0x9f0b('0x9a')];_0x516c10['body'][_0x9f0b('0x5e')]=_0x53377c[_0x9f0b('0x5e')][_0x9f0b('0x9e')][0x0][_0x9f0b('0x2a')][_0x9f0b('0x5e')];_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9f')]=_0x53377c[_0x9f0b('0x5e')]['notifications'][0x0][_0x9f0b('0x8d')];}if(_0x516c10[_0x9f0b('0x5e')]['id']){delete _0x516c10[_0x9f0b('0x5e')]['id'];}if(_[_0x9f0b('0xa0')](_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9a')])){throw new db[(_0x9f0b('0x92'))]['ValidationError'](_0x9f0b('0xa1'));}if(_[_0x9f0b('0xa0')](_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x5e')])||_0x516c10['body'][_0x9f0b('0x5e')]===''){throw new db[(_0x9f0b('0x92'))][(_0x9f0b('0x93'))](_0x9f0b('0xa2'));}if(_[_0x9f0b('0xa0')](_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0xa3')])){throw new db[(_0x9f0b('0x92'))][(_0x9f0b('0x93'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43cf5e);}if(!_[_0x9f0b('0xa4')](_0x43cf5e,_0x516c10[_0x9f0b('0x5e')]['mapKey'])){throw new db[(_0x9f0b('0x92'))][(_0x9f0b('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43cf5e);}_0x11ad77[_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0xa3')]]=_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9a')];return db[_0x9f0b('0xa5')]['find']({'where':{'id':_0x516c10[_0x9f0b('0x87')][_0x9f0b('0xa6')]},'include':[{'model':db[_0x9f0b('0x91')],'as':_0x9f0b('0xa7'),'where':_0x11ad77,'limit':0x1,'order':[[_0x9f0b('0x96'),_0x9f0b('0xa8')]]}]});})[_0x9f0b('0x21')](handleEntityNotFound(_0x41b77d,null))[_0x9f0b('0x21')](function(_0x5c62f1){if(_0x5c62f1){_0x516c10['list']=_[_0x9f0b('0x73')](_0x5c62f1,[_0x9f0b('0xa7')]);if(_0x5c62f1[_0x9f0b('0xa7')][_0x9f0b('0x4f')]){return _0x5c62f1[_0x9f0b('0xa7')][0x0];}var _0x3659b0=_[_0x9f0b('0x19')](_0x516c10[_0x9f0b('0x5e')],{'firstName':_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9a')],'ListId':_0x5c62f1['id']});_0x3659b0[_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0xa3')]]=_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9a')];return db[_0x9f0b('0x91')][_0x9f0b('0x5d')](_0x3659b0,{'fields':_0x13f22b,'raw':!![]});}})[_0x9f0b('0x21')](handleEntityNotFound(_0x41b77d,null))[_0x9f0b('0x21')](function(_0xfa1d6){if(_0xfa1d6){_0x516c10[_0x9f0b('0xa9')]=_0xfa1d6;var _0x3cdd7c={'ContactId':_0xfa1d6['id'],'phone':_0x516c10[_0x9f0b('0x5e')]['from'],'WhatsappAccountId':_0x53377c[_0x9f0b('0x5b')]['id']};var _0x11c766={'ContactId':_0xfa1d6['id'],'WhatsappAccountId':_0x53377c['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x9f0b('0x63')]({'where':_0x11c766})['then'](function(_0x149706){if(_0x149706){return[_0x149706,![]];}return db[_0x9f0b('0xaa')][_0x9f0b('0x5d')](_0x3cdd7c)[_0x9f0b('0x21')](function(_0xc76441){return[_0xc76441,!![]];});});}})['spread'](function(_0x4b43a8,_0x574624){_0x516c10[_0x9f0b('0xab')]=_0x4b43a8[_0x9f0b('0x3a')]({'plain':!![]});_0x516c10['interaction'][_0x9f0b('0xac')]=![];if(_0x574624){if(_0x516c10['account'][_0x9f0b('0xad')]){_0x516c10[_0x9f0b('0x8e')][_0x9f0b('0xae')]({'id':0x0,'priority':_0x516c10[_0x9f0b('0x8e')]['length']+0x1,'app':_0x9f0b('0xaf'),'appdata':_0x9f0b('0xb0'),'interval':'*,*,*,*'});}_0x516c10['interaction'][_0x9f0b('0xac')]=!![];}return db[_0x9f0b('0x8b')][_0x9f0b('0x5d')]({'phone':_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x9a')],'messageId':_0x516c10[_0x9f0b('0x5e')]['messageId'],'body':_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0x5e')],'WhatsappAccountId':_0x53377c[_0x9f0b('0x5b')]['id'],'WhatsappInteractionId':_0x4b43a8['id'],'direction':'in','ContactId':_0x4b43a8[_0x9f0b('0xb1')],'AttachmentId':_0x516c10[_0x9f0b('0x5e')][_0x9f0b('0xb2')]});})[_0x9f0b('0x21')](function(_0x36cf2d){_0x516c10['message']=_0x36cf2d;if(_0x516c10[_0x9f0b('0xab')]['UserId']){return db['User'][_0x9f0b('0x63')]({'attributes':['id',_0x9f0b('0x3e')],'where':{'id':_0x516c10[_0x9f0b('0xab')][_0x9f0b('0xb3')]}})['then'](function(_0x4f20ea){if(_0x4f20ea){_0x516c10[_0x9f0b('0x8e')][_0x9f0b('0xb4')]({'id':0x0,'priority':0x0,'app':_0x9f0b('0xb5'),'appdata':_0x4f20ea[_0x9f0b('0x3e')]+','+(_0x516c10[_0x9f0b('0x87')][_0x9f0b('0xb6')]||0xa),'interval':_0x9f0b('0xb7')});}return respondWithRpcPromise(_0x9f0b('0xb8'),_0x9f0b('0xb9'),_0x516c10);});}return respondWithRpcPromise('Start',_0x9f0b('0xb9'),_0x516c10);})[_0x9f0b('0x21')](function(_0x27b378){if(_0x27b378){var _0x557c03=0xc8;var _0x37c729=_0x9f0b('0xba');logger['info'](_0x9f0b('0x26'),_0x37c729,_0x557c03,_0x9f0b('0xbb'));logger[_0x9f0b('0x25')](_0x9f0b('0xbc'),_0x37c729,_0x557c03,'entity\x20found',JSON[_0x9f0b('0x27')](_0x27b378));if(_0x516c10[_0x9f0b('0x87')][_0x9f0b('0x45')]===_0x9f0b('0x99')){return _0x41b77d['status'](_0x557c03)[_0x9f0b('0x34')](_0x9f0b('0xbd'),_0x9f0b('0xbe'))['send']('\x0a');}else{return _0x41b77d[_0x9f0b('0x2d')](_0x557c03)[_0x9f0b('0x2f')](_0x27b378);}}});})[_0x9f0b('0x2b')](handleError(_0x41b77d,null));};exports['send']=function(_0x399e5a,_0x1803b7,_0x15a091){var _0x2d4e39,_0x366fcd,_0x5a34b7;if(_[_0x9f0b('0xa0')](_0x399e5a[_0x9f0b('0x5e')][_0x9f0b('0x5e')])||_0x399e5a['body'][_0x9f0b('0x5e')]===''){throw new db[(_0x9f0b('0x92'))][(_0x9f0b('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9f0b('0xa0')](_0x399e5a['body']['to'])){throw new db[(_0x9f0b('0x92'))][(_0x9f0b('0x93'))]('to\x20is\x20mandatory');}_0x2d4e39=_0x399e5a[_0x9f0b('0x5e')]['to'];return db[_0x9f0b('0x42')]['find']({'where':{'id':_0x399e5a[_0x9f0b('0x5b')]['id']},'include':[{'model':db[_0x9f0b('0xa5')],'as':_0x9f0b('0xbf'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x2d4e39},'limit':0x1,'order':[[_0x9f0b('0x96'),_0x9f0b('0xa8')]]}]}]})[_0x9f0b('0x21')](handleEntityNotFound(_0x1803b7,null))[_0x9f0b('0x21')](function(_0xe47532){if(_0xe47532&&_0xe47532[_0x9f0b('0xbf')]){_0x366fcd=_0xe47532[_0x9f0b('0x3a')]({'plain':!![]});if(_0x366fcd['List']&&_0x366fcd[_0x9f0b('0xbf')][_0x9f0b('0xa7')][_0x9f0b('0x4f')]){return _0x366fcd[_0x9f0b('0xbf')][_0x9f0b('0xa7')][0x0];}return db[_0x9f0b('0x91')][_0x9f0b('0x5d')](_['defaults'](_0x399e5a[_0x9f0b('0x5e')],{'firstName':_0x2d4e39,'mobile':_0x2d4e39,'phone':_0x2d4e39,'ListId':_0x366fcd[_0x9f0b('0xa6')]}));}})['then'](handleEntityNotFound(_0x1803b7,null))[_0x9f0b('0x21')](function(_0x2de193){if(_0x2de193){_0x5a34b7=_0x2de193;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x5a34b7['id'],'closed':![],'WhatsappAccountId':_0x366fcd['id']}})['then'](function(_0xe59996){if(_0xe59996){return[_0xe59996,![]];}return db[_0x9f0b('0xaa')][_0x9f0b('0x5d')]({'UserId':_0x399e5a[_0x9f0b('0x61')]['id'],'ContactId':_0x5a34b7['id'],'WhatsappAccountId':_0x366fcd['id'],'phone':_0x2d4e39,'firstMsgDirection':_0x9f0b('0xc0'),'Messages':[_[_0x9f0b('0x6d')](_0x399e5a[_0x9f0b('0x5e')],{'read':![],'body':_0x399e5a[_0x9f0b('0x5e')][_0x9f0b('0x5e')],'phone':_0x2d4e39,'WhatsappAccountId':_0x366fcd['id'],'UserId':_0x399e5a[_0x9f0b('0x61')]['id'],'ContactId':_0x5a34b7['id']})]},{'include':[{'model':db[_0x9f0b('0x8b')],'as':_0x9f0b('0xc1')}]})['then'](function(_0x1ef7d1){return[_0x1ef7d1,!![]];});});}})[_0x9f0b('0x74')](function(_0x20c0d4,_0x4255f6){if(_0x4255f6){return _0x20c0d4;}return db[_0x9f0b('0x8b')]['create'](_[_0x9f0b('0x6d')](_0x399e5a[_0x9f0b('0x5e')],{'read':![],'body':_0x399e5a[_0x9f0b('0x5e')][_0x9f0b('0x5e')],'phone':_0x2d4e39,'WhatsappAccountId':_0x366fcd['id'],'WhatsappInteractionId':_0x20c0d4['id'],'UserId':_0x399e5a[_0x9f0b('0x61')]['id'],'ContactId':_0x5a34b7['id']}))['then'](function(_0x12e666){_0x20c0d4[_0x9f0b('0xc2')]['Messages']=[];_0x20c0d4[_0x9f0b('0xc2')][_0x9f0b('0xc1')]['push'](_0x12e666['dataValues']);return _0x20c0d4;});})[_0x9f0b('0x21')](respondWithResult(_0x1803b7,null))[_0x9f0b('0x2b')](handleError(_0x1803b7,null));}; \ No newline at end of file +var _0x7245=['applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','From','replace','messageId','notifications','message_id','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','list','Contacts','mapKey','WhatsappInteraction','interaction','created','autoclose','push','close','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','set','\x0a','to\x20is\x20mandatory','List','DESC','user','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','WhatsappAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','priority','finally','getApplications','notify','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7245,0xf4));var _0x5724=function(_0x4ea561,_0x1b596d){_0x4ea561=_0x4ea561-0x0;var _0x53dcc9=_0x7245[_0x4ea561];return _0x53dcc9;};'use strict';var emlformat=require(_0x5724('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5724('0x1'));var jsonpatch=require(_0x5724('0x2'));var rp=require(_0x5724('0x3'));var moment=require(_0x5724('0x4'));var BPromise=require(_0x5724('0x5'));var Mustache=require(_0x5724('0x6'));var util=require(_0x5724('0x7'));var path=require(_0x5724('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5724('0x9'));var fs=require('fs');var fs_extra=require(_0x5724('0xa'));var _=require(_0x5724('0xb'));var squel=require(_0x5724('0xc'));var crypto=require(_0x5724('0xd'));var jsforce=require(_0x5724('0xe'));var deskjs=require(_0x5724('0xf'));var toCsv=require(_0x5724('0x10'));var querystring=require(_0x5724('0x11'));var Papa=require(_0x5724('0x12'));var Redis=require(_0x5724('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5724('0x14'));var as=require(_0x5724('0x15'));var hardwareService=require(_0x5724('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x5724('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5724('0x18'));var db=require(_0x5724('0x19'))['db'];config['redis']=_[_0x5724('0x1a')](config[_0x5724('0x1b')],{'host':_0x5724('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5724('0x1d'))[_0x5724('0x1e')](socket);var jayson=require(_0x5724('0x1f'));var client=jayson[_0x5724('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x246739,_0x437718,_0x1055b6,_0xff7b9b){return new BPromise(function(_0x3cde76,_0x5a1763){var _0x507494=_0xff7b9b||client;return _0x507494[_0x5724('0x21')](_0x246739,_0x1055b6)[_0x5724('0x22')](function(_0x5c3b28){logger[_0x5724('0x23')](_0x5724('0x24'),_0x437718,_0x5724('0x25'));logger['debug'](_0x5724('0x26'),_0x437718,_0x5724('0x25'),JSON[_0x5724('0x27')](_0x5c3b28));if(_0x5c3b28[_0x5724('0x28')]){if(_0x5c3b28[_0x5724('0x28')][_0x5724('0x29')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x437718,_0x5c3b28[_0x5724('0x28')][_0x5724('0x2a')]);return _0x5a1763(_0x5c3b28[_0x5724('0x28')][_0x5724('0x2a')]);}logger[_0x5724('0x28')](_0x5724('0x24'),_0x437718,_0x5c3b28[_0x5724('0x28')][_0x5724('0x2a')]);return _0x3cde76(_0x5c3b28['error'][_0x5724('0x2a')]);}else{logger[_0x5724('0x23')](_0x5724('0x24'),_0x437718,_0x5724('0x25'));_0x3cde76(_0x5c3b28['result'][_0x5724('0x2a')]);}})[_0x5724('0x2b')](function(_0x1a003a){logger[_0x5724('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x437718,_0x1a003a);_0x5a1763(_0x1a003a);});});}function respondWithStatusCode(_0x53872e,_0x2b6f5e){_0x2b6f5e=_0x2b6f5e||0xcc;return function(_0x3dd861){if(_0x3dd861){return _0x53872e[_0x5724('0x2c')](_0x2b6f5e);}return _0x53872e['status'](_0x2b6f5e)[_0x5724('0x2d')]();};}function respondWithResult(_0x1ad68c,_0x5d991){_0x5d991=_0x5d991||0xc8;return function(_0x3009ef){if(_0x3009ef){return _0x1ad68c[_0x5724('0x2e')](_0x5d991)[_0x5724('0x2f')](_0x3009ef);}};}function respondWithFilteredResult(_0x1ccc58,_0x4fe6f2){return function(_0x1d88b9){if(_0x1d88b9){var _0x4744d2=typeof _0x4fe6f2[_0x5724('0x30')]===_0x5724('0x31')&&typeof _0x4fe6f2[_0x5724('0x32')]===_0x5724('0x31');var _0x6f1889=_0x1d88b9[_0x5724('0x33')];var _0xb3098f=_0x4744d2?0x0:_0x4fe6f2[_0x5724('0x30')];var _0x20cd30=_0x4744d2?_0x1d88b9['count']:_0x4fe6f2[_0x5724('0x30')]+_0x4fe6f2[_0x5724('0x32')];var _0x33b349;if(_0x20cd30>=_0x6f1889){_0x20cd30=_0x6f1889;_0x33b349=0xc8;}else{_0x33b349=0xce;}_0x1ccc58[_0x5724('0x2e')](_0x33b349);return _0x1ccc58['set'](_0x5724('0x34'),_0xb3098f+'-'+_0x20cd30+'/'+_0x6f1889)[_0x5724('0x2f')](_0x1d88b9);}return null;};}function patchUpdates(_0x2386a5){return function(_0x689464){try{jsonpatch[_0x5724('0x35')](_0x689464,_0x2386a5,!![]);}catch(_0x1b6990){return BPromise[_0x5724('0x36')](_0x1b6990);}return _0x689464[_0x5724('0x37')]();};}function saveUpdates(_0x44bdf4,_0xcce07d){return function(_0x4cc576){if(_0x4cc576){return _0x4cc576['update'](_0x44bdf4)[_0x5724('0x22')](function(_0x18bef0){return _0x18bef0;});}return null;};}function removeEntity(_0x10d2e9,_0x545115){return function(_0x1cee0a){if(_0x1cee0a){return _0x1cee0a[_0x5724('0x38')]()[_0x5724('0x22')](function(){var _0x46e82e=_0x1cee0a[_0x5724('0x39')]({'plain':!![]});var _0x4f66b9='WhatsappAccounts';return db[_0x5724('0x3a')][_0x5724('0x38')]({'where':{'type':_0x4f66b9,'resourceId':_0x46e82e['id']}})[_0x5724('0x22')](function(){return _0x1cee0a;});})[_0x5724('0x22')](function(){_0x10d2e9[_0x5724('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56799f,_0x18b5d7){return function(_0x5bb545){if(!_0x5bb545){_0x56799f['sendStatus'](0x194);}return _0x5bb545;};}function handleError(_0x477f9c,_0x3bd891){_0x3bd891=_0x3bd891||0x1f4;return function(_0x1694d1){logger[_0x5724('0x28')](_0x1694d1[_0x5724('0x3b')]);if(_0x1694d1[_0x5724('0x3c')]){delete _0x1694d1[_0x5724('0x3c')];}_0x477f9c[_0x5724('0x2e')](_0x3bd891)[_0x5724('0x3d')](_0x1694d1);};}exports['index']=function(_0x351e26,_0x3e9067){var _0x59ce68={'include':[{'model':db[_0x5724('0x3e')],'as':_0x5724('0x3f')}]},_0x1405e4={},_0x9290a6={'count':0x0,'rows':[]};var _0x42b653=_[_0x5724('0x40')](db[_0x5724('0x41')][_0x5724('0x42')],function(_0x46cd49){return{'name':_0x46cd49[_0x5724('0x43')],'type':_0x46cd49[_0x5724('0x44')]['key']};});_0x1405e4[_0x5724('0x45')]=_['map'](_0x42b653,_0x5724('0x3c'));_0x1405e4[_0x5724('0x46')]=_[_0x5724('0x47')](_0x351e26[_0x5724('0x46')]);_0x1405e4['filters']=_[_0x5724('0x48')](_0x1405e4[_0x5724('0x45')],_0x1405e4[_0x5724('0x46')]);_0x59ce68[_0x5724('0x49')]=_[_0x5724('0x48')](_0x1405e4['model'],qs[_0x5724('0x4a')](_0x351e26['query'][_0x5724('0x4a')]));_0x59ce68[_0x5724('0x49')]=_0x59ce68[_0x5724('0x49')][_0x5724('0x4b')]?_0x59ce68['attributes']:_0x1405e4[_0x5724('0x45')];if(!_0x351e26[_0x5724('0x46')][_0x5724('0x4c')](_0x5724('0x4d'))){_0x59ce68['limit']=qs[_0x5724('0x32')](_0x351e26[_0x5724('0x46')][_0x5724('0x32')]);_0x59ce68[_0x5724('0x30')]=qs[_0x5724('0x30')](_0x351e26['query'][_0x5724('0x30')]);}_0x59ce68[_0x5724('0x4e')]=qs['sort'](_0x351e26[_0x5724('0x46')][_0x5724('0x4f')]);_0x59ce68[_0x5724('0x50')]=qs[_0x5724('0x51')](_['pick'](_0x351e26[_0x5724('0x46')],_0x1405e4[_0x5724('0x51')]),_0x42b653);if(_0x351e26[_0x5724('0x46')][_0x5724('0x52')]){_0x59ce68[_0x5724('0x50')]=_[_0x5724('0x53')](_0x59ce68[_0x5724('0x50')],{'$or':_[_0x5724('0x40')](_0x42b653,function(_0x4e3b57){if(_0x4e3b57['type']!==_0x5724('0x54')){var _0x32c6ed={};_0x32c6ed[_0x4e3b57[_0x5724('0x3c')]]={'$like':'%'+_0x351e26[_0x5724('0x46')][_0x5724('0x52')]+'%'};return _0x32c6ed;}})});}_0x59ce68=_[_0x5724('0x53')]({},_0x59ce68,_0x351e26[_0x5724('0x55')]);var _0x4bd31c={'where':_0x59ce68[_0x5724('0x50')]};return db[_0x5724('0x41')][_0x5724('0x33')](_0x4bd31c)[_0x5724('0x22')](function(_0x546cd7){_0x9290a6['count']=_0x546cd7;if(_0x351e26['query'][_0x5724('0x56')]){_0x59ce68[_0x5724('0x57')]=[{'all':!![]}];}return db[_0x5724('0x41')][_0x5724('0x58')](_0x59ce68);})[_0x5724('0x22')](function(_0x140729){_0x9290a6[_0x5724('0x59')]=_0x140729;return _0x9290a6;})[_0x5724('0x22')](respondWithFilteredResult(_0x3e9067,_0x59ce68))[_0x5724('0x2b')](handleError(_0x3e9067,null));};exports[_0x5724('0x5a')]=function(_0x29e6b9,_0x11a2a7){var _0x2938ad={'raw':![],'where':{'id':_0x29e6b9[_0x5724('0x5b')]['id']},'include':[{'model':db[_0x5724('0x3e')],'as':_0x5724('0x3f')}]},_0x29aaa6={};_0x29aaa6[_0x5724('0x45')]=_['keys'](db['WhatsappAccount'][_0x5724('0x42')]);_0x29aaa6[_0x5724('0x46')]=_['keys'](_0x29e6b9[_0x5724('0x46')]);_0x29aaa6[_0x5724('0x51')]=_['intersection'](_0x29aaa6[_0x5724('0x45')],_0x29aaa6['query']);_0x2938ad['attributes']=_[_0x5724('0x48')](_0x29aaa6[_0x5724('0x45')],qs[_0x5724('0x4a')](_0x29e6b9[_0x5724('0x46')][_0x5724('0x4a')]));_0x2938ad[_0x5724('0x49')]=_0x2938ad[_0x5724('0x49')][_0x5724('0x4b')]?_0x2938ad[_0x5724('0x49')]:_0x29aaa6[_0x5724('0x45')];if(_0x29e6b9[_0x5724('0x46')][_0x5724('0x56')]){_0x2938ad[_0x5724('0x57')]=[{'all':!![]}];}_0x2938ad=_[_0x5724('0x53')]({},_0x2938ad,_0x29e6b9[_0x5724('0x55')]);return db[_0x5724('0x41')][_0x5724('0x5c')](_0x2938ad)[_0x5724('0x22')](handleEntityNotFound(_0x11a2a7,null))['then'](respondWithResult(_0x11a2a7,null))[_0x5724('0x2b')](handleError(_0x11a2a7,null));};exports[_0x5724('0x5d')]=function(_0x10bfdb,_0x30a209){return db[_0x5724('0x41')][_0x5724('0x5d')](_0x10bfdb[_0x5724('0x5e')],{})[_0x5724('0x22')](function(_0x4230e7){var _0x3a4594=_0x10bfdb['user'][_0x5724('0x39')]({'plain':!![]});if(!_0x3a4594)throw new Error(_0x5724('0x5f'));if(_0x3a4594[_0x5724('0x60')]==='user'){var _0x3b1973=_0x4230e7[_0x5724('0x39')]({'plain':!![]});var _0x426a36='WhatsappAccounts';return db[_0x5724('0x61')][_0x5724('0x5c')]({'where':{'name':_0x426a36,'userProfileId':_0x3a4594[_0x5724('0x62')]},'raw':!![]})[_0x5724('0x22')](function(_0x49f85a){if(_0x49f85a&&_0x49f85a['autoAssociation']===0x0){return db[_0x5724('0x3a')][_0x5724('0x5d')]({'name':_0x3b1973['name'],'resourceId':_0x3b1973['id'],'type':_0x49f85a[_0x5724('0x3c')],'sectionId':_0x49f85a['id']},{})[_0x5724('0x22')](function(){return _0x4230e7;});}else{return _0x4230e7;}})[_0x5724('0x2b')](function(_0x283203){logger['error'](_0x5724('0x63'),_0x283203);throw _0x283203;});}return _0x4230e7;})[_0x5724('0x22')](respondWithResult(_0x30a209,0xc9))[_0x5724('0x2b')](handleError(_0x30a209,null));};exports[_0x5724('0x64')]=function(_0x4da33f,_0x53bc3f){if(_0x4da33f[_0x5724('0x5e')]['id']){delete _0x4da33f['body']['id'];}return db[_0x5724('0x41')][_0x5724('0x5c')]({'where':{'id':_0x4da33f['params']['id']},'include':[{'model':db['Pause'],'as':_0x5724('0x3f')}]})[_0x5724('0x22')](handleEntityNotFound(_0x53bc3f,null))['then'](saveUpdates(_0x4da33f[_0x5724('0x5e')],null))[_0x5724('0x22')](respondWithResult(_0x53bc3f,null))[_0x5724('0x2b')](handleError(_0x53bc3f,null));};exports[_0x5724('0x38')]=function(_0x5338f9,_0x456466){return db[_0x5724('0x41')]['find']({'where':{'id':_0x5338f9[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x456466,null))[_0x5724('0x22')](removeEntity(_0x456466,null))[_0x5724('0x2b')](handleError(_0x456466,null));};exports[_0x5724('0x65')]=function(_0x37a8bc,_0x10c8b4){return db[_0x5724('0x41')][_0x5724('0x65')]()[_0x5724('0x22')](respondWithResult(_0x10c8b4,null))[_0x5724('0x2b')](handleError(_0x10c8b4,null));};exports['addDisposition']=function(_0x5409df,_0x2b145f,_0xcf2edf){if(_0x5409df[_0x5724('0x5e')]['id']){delete _0x5409df[_0x5724('0x5e')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x5409df['params']['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x2b145f,null))['then'](function(_0x5d04e0){if(_0x5d04e0){_0x5409df[_0x5724('0x5e')][_0x5724('0x66')]=_0x5d04e0['id'];return db[_0x5724('0x67')][_0x5724('0x5d')](_0x5409df[_0x5724('0x5e')]);}})[_0x5724('0x22')](respondWithResult(_0x2b145f,null))['catch'](handleError(_0x2b145f,null));};exports[_0x5724('0x68')]=function(_0x3a2551,_0x4789a7,_0x19e650){var _0x47ecd8={'raw':![],'where':{}};var _0x2382c4={};var _0x59a0e1={'count':0x0,'rows':[]};return db[_0x5724('0x41')][_0x5724('0x69')]({'where':{'id':_0x3a2551[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x4789a7,null))[_0x5724('0x22')](function(_0xad199){if(_0xad199){_0x2382c4[_0x5724('0x45')]=_['keys'](db[_0x5724('0x67')][_0x5724('0x42')]);_0x2382c4[_0x5724('0x46')]=_[_0x5724('0x47')](_0x3a2551['query']);_0x2382c4[_0x5724('0x51')]=_[_0x5724('0x48')](_0x2382c4[_0x5724('0x45')],_0x2382c4[_0x5724('0x46')]);_0x47ecd8[_0x5724('0x49')]=_[_0x5724('0x48')](_0x2382c4['model'],qs['fields'](_0x3a2551[_0x5724('0x46')][_0x5724('0x4a')]));_0x47ecd8['attributes']=_0x47ecd8[_0x5724('0x49')][_0x5724('0x4b')]?_0x47ecd8[_0x5724('0x49')]:_0x2382c4['model'];if(!_0x3a2551[_0x5724('0x46')]['hasOwnProperty'](_0x5724('0x4d'))){_0x47ecd8['limit']=qs[_0x5724('0x32')](_0x3a2551[_0x5724('0x46')][_0x5724('0x32')]);_0x47ecd8[_0x5724('0x30')]=qs['offset'](_0x3a2551['query'][_0x5724('0x30')]);}_0x47ecd8[_0x5724('0x4e')]=qs['sort'](_0x3a2551[_0x5724('0x46')][_0x5724('0x4f')]);_0x47ecd8[_0x5724('0x50')]=qs[_0x5724('0x51')](_[_0x5724('0x6a')](_0x3a2551[_0x5724('0x46')],_0x2382c4[_0x5724('0x51')]));_0x47ecd8[_0x5724('0x50')][_0x5724('0x66')]=_0xad199['id'];if(_0x3a2551[_0x5724('0x46')][_0x5724('0x52')]){_0x47ecd8[_0x5724('0x50')]=_['merge'](_0x47ecd8[_0x5724('0x50')],{'$or':_['map'](_0x47ecd8['attributes'],function(_0x545b8e){var _0x9eadab={};_0x9eadab[_0x545b8e]={'$like':'%'+_0x3a2551[_0x5724('0x46')][_0x5724('0x52')]+'%'};return _0x9eadab;})});}_0x47ecd8=_[_0x5724('0x53')]({},_0x47ecd8,_0x3a2551[_0x5724('0x55')]);return db[_0x5724('0x67')][_0x5724('0x33')]({'where':_0x47ecd8[_0x5724('0x50')]})[_0x5724('0x22')](function(_0x12c24c){_0x59a0e1[_0x5724('0x33')]=_0x12c24c;if(_0x3a2551['query'][_0x5724('0x56')]){_0x47ecd8[_0x5724('0x57')]=[{'all':!![]}];}return db[_0x5724('0x67')][_0x5724('0x58')](_0x47ecd8);})[_0x5724('0x22')](function(_0x1adc45){_0x59a0e1[_0x5724('0x59')]=_0x1adc45;return _0x59a0e1;});}})[_0x5724('0x22')](respondWithFilteredResult(_0x4789a7,_0x47ecd8))[_0x5724('0x2b')](handleError(_0x4789a7,null));};exports[_0x5724('0x6b')]=function(_0x3ac90c,_0x51d56c,_0x4e1965){return db[_0x5724('0x41')][_0x5724('0x5c')]({'where':{'id':_0x3ac90c[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x51d56c,null))[_0x5724('0x22')](function(_0x367c8f){if(_0x367c8f){return _0x367c8f[_0x5724('0x6b')](_0x3ac90c[_0x5724('0x46')][_0x5724('0x6c')]);}})[_0x5724('0x22')](respondWithStatusCode(_0x51d56c,null))[_0x5724('0x2b')](handleError(_0x51d56c,null));};exports[_0x5724('0x6d')]=function(_0x2320f2,_0x11081a,_0x4b35c8){if(_0x2320f2[_0x5724('0x5e')]['id']){delete _0x2320f2[_0x5724('0x5e')]['id'];}return db[_0x5724('0x41')][_0x5724('0x5c')]({'where':{'id':_0x2320f2[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x11081a,null))[_0x5724('0x22')](function(_0x366e74){if(_0x366e74){_0x2320f2[_0x5724('0x5e')][_0x5724('0x66')]=_0x366e74['id'];return db[_0x5724('0x6e')][_0x5724('0x5d')](_0x2320f2[_0x5724('0x5e')]);}})[_0x5724('0x22')](respondWithResult(_0x11081a,null))[_0x5724('0x2b')](handleError(_0x11081a,null));};exports['getAnswers']=function(_0x5e61ed,_0x5a6b3c,_0x31d999){var _0x1b1fa6={'raw':![],'where':{}};var _0x38e7aa={};var _0x25b198={'count':0x0,'rows':[]};return db[_0x5724('0x41')][_0x5724('0x69')]({'where':{'id':_0x5e61ed[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x5a6b3c,null))[_0x5724('0x22')](function(_0x299ff0){if(_0x299ff0){_0x38e7aa[_0x5724('0x45')]=_[_0x5724('0x47')](db[_0x5724('0x6e')][_0x5724('0x42')]);_0x38e7aa['query']=_['keys'](_0x5e61ed[_0x5724('0x46')]);_0x38e7aa[_0x5724('0x51')]=_[_0x5724('0x48')](_0x38e7aa['model'],_0x38e7aa[_0x5724('0x46')]);_0x1b1fa6[_0x5724('0x49')]=_['intersection'](_0x38e7aa[_0x5724('0x45')],qs['fields'](_0x5e61ed['query']['fields']));_0x1b1fa6[_0x5724('0x49')]=_0x1b1fa6['attributes'][_0x5724('0x4b')]?_0x1b1fa6[_0x5724('0x49')]:_0x38e7aa['model'];if(!_0x5e61ed[_0x5724('0x46')][_0x5724('0x4c')](_0x5724('0x4d'))){_0x1b1fa6[_0x5724('0x32')]=qs['limit'](_0x5e61ed['query']['limit']);_0x1b1fa6[_0x5724('0x30')]=qs[_0x5724('0x30')](_0x5e61ed[_0x5724('0x46')]['offset']);}_0x1b1fa6[_0x5724('0x4e')]=qs[_0x5724('0x4f')](_0x5e61ed[_0x5724('0x46')][_0x5724('0x4f')]);_0x1b1fa6[_0x5724('0x50')]=qs['filters'](_['pick'](_0x5e61ed['query'],_0x38e7aa[_0x5724('0x51')]));_0x1b1fa6[_0x5724('0x50')][_0x5724('0x66')]=_0x299ff0['id'];if(_0x5e61ed[_0x5724('0x46')][_0x5724('0x52')]){_0x1b1fa6[_0x5724('0x50')]=_['merge'](_0x1b1fa6[_0x5724('0x50')],{'$or':_[_0x5724('0x40')](_0x1b1fa6['attributes'],function(_0x34306a){var _0x4a5777={};_0x4a5777[_0x34306a]={'$like':'%'+_0x5e61ed[_0x5724('0x46')][_0x5724('0x52')]+'%'};return _0x4a5777;})});}_0x1b1fa6=_[_0x5724('0x53')]({},_0x1b1fa6,_0x5e61ed['options']);return db['CannedAnswer']['count']({'where':_0x1b1fa6['where']})[_0x5724('0x22')](function(_0x47d986){_0x25b198[_0x5724('0x33')]=_0x47d986;if(_0x5e61ed[_0x5724('0x46')]['includeAll']){_0x1b1fa6['include']=[{'all':!![]}];}return db[_0x5724('0x6e')][_0x5724('0x58')](_0x1b1fa6);})[_0x5724('0x22')](function(_0x5332ac){_0x25b198[_0x5724('0x59')]=_0x5332ac;return _0x25b198;});}})['then'](respondWithFilteredResult(_0x5a6b3c,_0x1b1fa6))['catch'](handleError(_0x5a6b3c,null));};exports[_0x5724('0x6f')]=function(_0x8f9813,_0x7065db,_0x343466){return db[_0x5724('0x41')]['find']({'where':{'id':_0x8f9813[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x7065db,null))['then'](function(_0x15747c){if(_0x15747c){return _0x15747c[_0x5724('0x6f')](_0x8f9813[_0x5724('0x46')][_0x5724('0x6c')]);}})[_0x5724('0x22')](respondWithStatusCode(_0x7065db,null))['catch'](handleError(_0x7065db,null));};exports['addAgents']=function(_0xda9c2a,_0x4e3984,_0x3386cc){return db[_0x5724('0x41')][_0x5724('0x5c')]({'where':{'id':_0xda9c2a[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x4e3984,null))['then'](function(_0x1adaba){if(_0x1adaba){return _0x1adaba[_0x5724('0x70')](_0xda9c2a['body'][_0x5724('0x6c')],_[_0x5724('0x71')](_0xda9c2a[_0x5724('0x5e')],[_0x5724('0x6c'),'id'])||{})[_0x5724('0x72')](function(_0x48358a){for(var _0x5b68ed=0x0;_0x5b68ed<_0xda9c2a['body'][_0x5724('0x6c')][_0x5724('0x4b')];_0x5b68ed+=0x1){socket[_0x5724('0x73')](_0x5724('0x74'),{'UserId':Number(_0xda9c2a[_0x5724('0x5e')][_0x5724('0x6c')][_0x5b68ed]),'WhatsappAccountId':Number(_0xda9c2a[_0x5724('0x5b')]['id'])});}return _0x48358a;});}})['then'](respondWithResult(_0x4e3984,null))['catch'](handleError(_0x4e3984,null));};exports[_0x5724('0x75')]=function(_0xc28994,_0x1a4c53,_0xcc20b5){return db[_0x5724('0x41')][_0x5724('0x5c')]({'where':{'id':_0xc28994[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x1a4c53,null))['then'](function(_0x259a64){if(_0x259a64){return _0x259a64['removeAgents'](_0xc28994['query'][_0x5724('0x6c')])[_0x5724('0x22')](function(){if(_['isArray'](_0xc28994[_0x5724('0x46')]['ids'])){for(var _0x377880=0x0;_0x377880<_0xc28994[_0x5724('0x46')][_0x5724('0x6c')][_0x5724('0x4b')];_0x377880+=0x1){socket['emit'](_0x5724('0x76'),{'UserId':Number(_0xc28994[_0x5724('0x46')][_0x5724('0x6c')][_0x377880]),'WhatsappAccountId':Number(_0xc28994[_0x5724('0x5b')]['id'])});}}else{socket[_0x5724('0x73')](_0x5724('0x76'),{'UserId':Number(_0xc28994[_0x5724('0x46')][_0x5724('0x6c')]),'WhatsappAccountId':Number(_0xc28994[_0x5724('0x5b')]['id'])});}});}})[_0x5724('0x22')](respondWithStatusCode(_0x1a4c53,null))[_0x5724('0x2b')](handleError(_0x1a4c53,null));};exports[_0x5724('0x77')]=function(_0x165818,_0x3ae626,_0x1d2a8a){var _0x430d01={};var _0x864a2a={};var _0x1cfbee;var _0x211dcd;return db[_0x5724('0x41')][_0x5724('0x69')]({'where':{'id':_0x165818[_0x5724('0x5b')]['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x3ae626,null))[_0x5724('0x22')](function(_0xfe5e7b){if(_0xfe5e7b){_0x1cfbee=_0xfe5e7b;_0x864a2a['model']=_[_0x5724('0x47')](db['User']['rawAttributes']);_0x864a2a[_0x5724('0x46')]=_[_0x5724('0x47')](_0x165818[_0x5724('0x46')]);_0x864a2a[_0x5724('0x51')]=_['intersection'](_0x864a2a['model'],_0x864a2a[_0x5724('0x46')]);_0x430d01[_0x5724('0x49')]=_[_0x5724('0x48')](_0x864a2a[_0x5724('0x45')],qs['fields'](_0x165818[_0x5724('0x46')]['fields']));_0x430d01[_0x5724('0x49')]=_0x430d01[_0x5724('0x49')][_0x5724('0x4b')]?_0x430d01[_0x5724('0x49')]:_0x864a2a[_0x5724('0x45')];_0x430d01['order']=qs[_0x5724('0x4f')](_0x165818[_0x5724('0x46')]['sort']);_0x430d01[_0x5724('0x50')]=qs[_0x5724('0x51')](_[_0x5724('0x6a')](_0x165818['query'],_0x864a2a['filters']));if(_0x165818[_0x5724('0x46')][_0x5724('0x52')]){_0x430d01['where']=_[_0x5724('0x53')](_0x430d01['where'],{'$or':_[_0x5724('0x40')](_0x430d01[_0x5724('0x49')],function(_0x3c7825){var _0x117f91={};_0x117f91[_0x3c7825]={'$like':'%'+_0x165818[_0x5724('0x46')][_0x5724('0x52')]+'%'};return _0x117f91;})});}_0x430d01=_[_0x5724('0x53')]({},_0x430d01,_0x165818[_0x5724('0x55')]);return _0x1cfbee[_0x5724('0x77')](_0x430d01);}})[_0x5724('0x22')](function(_0x28f43e){if(_0x28f43e){_0x211dcd=_0x28f43e['length'];if(!_0x165818[_0x5724('0x46')][_0x5724('0x4c')](_0x5724('0x4d'))){_0x430d01[_0x5724('0x32')]=qs['limit'](_0x165818[_0x5724('0x46')][_0x5724('0x32')]);_0x430d01['offset']=qs['offset'](_0x165818[_0x5724('0x46')][_0x5724('0x30')]);}return _0x1cfbee['getAgents'](_0x430d01);}})[_0x5724('0x22')](function(_0x984b24){if(_0x984b24){return _0x984b24?{'count':_0x211dcd,'rows':_0x984b24}:null;}})[_0x5724('0x22')](respondWithResult(_0x3ae626,null))[_0x5724('0x2b')](handleError(_0x3ae626,null));};exports['addApplications']=function(_0x2d8194,_0x3a5f03){var _0x150215=_0x2d8194[_0x5724('0x5b')]['id'];var _0x1fbba7=_0x2d8194[_0x5724('0x5e')];var _0x3b5ecb=0xc8;var _0x3804bd=null;return db[_0x5724('0x78')][_0x5724('0x79')]({'isolationLevel':db[_0x5724('0x78')][_0x5724('0x7a')][_0x5724('0x7b')]['READ_COMMITTED']},function(_0x381cf0){return db[_0x5724('0x41')]['findOne']({'where':{'id':_0x150215},'transaction':_0x381cf0})[_0x5724('0x22')](function(_0x428f8f){if(_0x428f8f){return db[_0x5724('0x7c')][_0x5724('0x38')]({'where':{'WhatsappAccountId':_0x150215},'transaction':_0x381cf0})[_0x5724('0x22')](function(){var _0x598304=_[_0x5724('0x40')](_0x1fbba7,function(_0x3e7d38){_0x3e7d38['WhatsappAccountId']=_0x150215;return _0x3e7d38;});return db['WhatsappApplication']['bulkCreate'](_0x598304,{'transaction':_0x381cf0});});}else{_0x3b5ecb=0x194;_0x3804bd=[];}});})[_0x5724('0x22')](function(){if(_0x3b5ecb!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x150215},'order':_0x5724('0x7d')})[_0x5724('0x22')](function(_0x48ff52){_0x3804bd=_0x48ff52;});}})[_0x5724('0x2b')](function(_0x394721){_0x3b5ecb=0x1f4;logger[_0x5724('0x28')](_0x394721['stack']);if(_0x394721[_0x5724('0x3c')]){delete _0x394721[_0x5724('0x3c')];}_0x3804bd=_0x394721;})[_0x5724('0x7e')](function(){if(_0x3804bd===null){_0x3a5f03[_0x5724('0x2c')](_0x3b5ecb);}else{if(_0x3b5ecb===0x1f4){_0x3a5f03['status'](_0x3b5ecb)[_0x5724('0x3d')](_0x3804bd);}else{_0x3a5f03['status'](_0x3b5ecb)[_0x5724('0x2f')](_0x3804bd);}}});};exports[_0x5724('0x7f')]=function(_0x4f9503,_0x54ed4d,_0x1a9347){var _0x422e80={};var _0x126160={};var _0x3bb1ed;var _0x530506;return db[_0x5724('0x41')][_0x5724('0x69')]({'where':{'id':_0x4f9503['params']['id']}})[_0x5724('0x22')](handleEntityNotFound(_0x54ed4d,null))[_0x5724('0x22')](function(_0x471224){if(_0x471224){_0x3bb1ed=_0x471224;_0x126160['model']=_[_0x5724('0x47')](db[_0x5724('0x7c')][_0x5724('0x42')]);_0x126160['query']=_[_0x5724('0x47')](_0x4f9503[_0x5724('0x46')]);_0x126160[_0x5724('0x51')]=_[_0x5724('0x48')](_0x126160[_0x5724('0x45')],_0x126160[_0x5724('0x46')]);_0x422e80['attributes']=_[_0x5724('0x48')](_0x126160[_0x5724('0x45')],qs[_0x5724('0x4a')](_0x4f9503[_0x5724('0x46')][_0x5724('0x4a')]));_0x422e80[_0x5724('0x49')]=_0x422e80[_0x5724('0x49')][_0x5724('0x4b')]?_0x422e80[_0x5724('0x49')]:_0x126160['model'];_0x422e80[_0x5724('0x4e')]=qs['sort'](_0x4f9503[_0x5724('0x46')][_0x5724('0x4f')]);_0x422e80[_0x5724('0x50')]=qs['filters'](_[_0x5724('0x6a')](_0x4f9503[_0x5724('0x46')],_0x126160[_0x5724('0x51')]));if(_0x4f9503['query']['filter']){_0x422e80[_0x5724('0x50')]=_['merge'](_0x422e80['where'],{'$or':_['map'](_0x422e80[_0x5724('0x49')],function(_0xe60726){var _0x1413ec={};_0x1413ec[_0xe60726]={'$like':'%'+_0x4f9503[_0x5724('0x46')][_0x5724('0x52')]+'%'};return _0x1413ec;})});}_0x422e80=_['merge']({},_0x422e80,_0x4f9503[_0x5724('0x55')]);return _0x3bb1ed['getApplications'](_0x422e80);}})[_0x5724('0x22')](function(_0x34f670){if(_0x34f670){_0x530506=_0x34f670[_0x5724('0x4b')];if(!_0x4f9503[_0x5724('0x46')][_0x5724('0x4c')](_0x5724('0x4d'))){_0x422e80['limit']=qs[_0x5724('0x32')](_0x4f9503[_0x5724('0x46')][_0x5724('0x32')]);_0x422e80['offset']=qs[_0x5724('0x30')](_0x4f9503[_0x5724('0x46')][_0x5724('0x30')]);}return _0x3bb1ed['getApplications'](_0x422e80);}})[_0x5724('0x22')](function(_0x22acbd){if(_0x22acbd){return _0x22acbd?{'count':_0x530506,'rows':_0x22acbd}:null;}})[_0x5724('0x22')](respondWithResult(_0x54ed4d,null))['catch'](handleError(_0x54ed4d,null));};exports[_0x5724('0x80')]=function(_0x5bc3c4,_0x4e3a6e,_0x3df1bb){var _0x2ed190={'channel':'whatsapp'};var _0x49c26b=[];var _0x474cab=[];var _0x3463d0={};return db[_0x5724('0x41')]['find']({'where':{'id':_0x5bc3c4['params']['id']},'include':[{'model':db[_0x5724('0x7c')],'as':_0x5724('0x81')}]})[_0x5724('0x22')](handleEntityNotFound(_0x4e3a6e,null))[_0x5724('0x22')](function(_0x4a3f1a){_0x2ed190[_0x5724('0x82')]=_0x4a3f1a;if(_0x2ed190[_0x5724('0x82')]&&_0x2ed190[_0x5724('0x82')][_0x5724('0x44')]===_0x5724('0x83')&&_0x5bc3c4[_0x5724('0x5e')][_0x5724('0x84')]){if(_0x5bc3c4['body'][_0x5724('0x84')][_0x5724('0x4b')]===0x0)return;if(_0x5bc3c4['body'][_0x5724('0x84')][0x0]['state']!==_0x5724('0x85'))return;return db[_0x5724('0x86')][_0x5724('0x64')]({'read':!![],'readAt':_0x5bc3c4[_0x5724('0x5e')]['statuses'][0x0][_0x5724('0x87')]},{'where':{'messageId':_0x5bc3c4[_0x5724('0x5e')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x5724('0x22')](function(_0x29fcc9){return _0x4e3a6e[_0x5724('0x2e')](0xc8)['json'](_0x29fcc9);});}_0x2ed190[_0x5724('0x88')]=_[_0x5724('0x89')](_0x4a3f1a['Applications'],['priority'],[_0x5724('0x8a')]);if(_0x2ed190[_0x5724('0x82')]['Applications']){delete _0x2ed190['account'][_0x5724('0x81')];}return db[_0x5724('0x8b')][_0x5724('0x65')]()[_0x5724('0x22')](function(_0xa45347){if(!_0xa45347){throw new db['Sequelize'][(_0x5724('0x8c'))](_0x5724('0x8d'));}_0x49c26b=_[_0x5724('0x8e')](_[_0x5724('0x47')](_0xa45347),[_0x5724('0x8f'),'updatedAt']);_0x474cab=_[_0x5724('0x8e')](_[_0x5724('0x47')](_0xa45347),[_0x5724('0x8f'),_0x5724('0x90'),_0x5724('0x91'),_0x5724('0x92')]);_0x2ed190[_0x5724('0x5e')]={'mapKey':'mobile'};if(_0x2ed190[_0x5724('0x82')]&&_0x2ed190['account'][_0x5724('0x44')]==='twilio'){_0x2ed190['body'][_0x5724('0x93')]=_0x5bc3c4[_0x5724('0x5e')][_0x5724('0x94')][_0x5724('0x95')]('whatsapp:','');_0x2ed190['body']['body']=_0x5bc3c4[_0x5724('0x5e')]['Body'];_0x2ed190[_0x5724('0x5e')][_0x5724('0x96')]=_0x5bc3c4['body']['MessageSid'];}if(_0x2ed190['account']&&_0x2ed190[_0x5724('0x82')]['type']==='sinch'){_0x2ed190[_0x5724('0x5e')]['from']=_0x5bc3c4[_0x5724('0x5e')]['notifications'][0x0]['from'];_0x2ed190['body'][_0x5724('0x5e')]=_0x5bc3c4[_0x5724('0x5e')][_0x5724('0x97')][0x0][_0x5724('0x2a')]['body'];_0x2ed190['body'][_0x5724('0x96')]=_0x5bc3c4['body'][_0x5724('0x97')][0x0][_0x5724('0x98')];}if(_0x2ed190[_0x5724('0x5e')]['id']){delete _0x2ed190[_0x5724('0x5e')]['id'];}if(_[_0x5724('0x99')](_0x2ed190[_0x5724('0x5e')]['from'])){throw new db[(_0x5724('0x9a'))]['ValidationError'](_0x5724('0x9b'));}if(_['isNil'](_0x2ed190['body']['body'])||_0x2ed190[_0x5724('0x5e')][_0x5724('0x5e')]===''){throw new db['Sequelize']['ValidationError'](_0x5724('0x9c'));}if(_['isNil'](_0x2ed190[_0x5724('0x5e')]['mapKey'])){throw new db['Sequelize'][(_0x5724('0x8c'))](_0x5724('0x9d')+_0x474cab);}if(!_[_0x5724('0x9e')](_0x474cab,_0x2ed190['body']['mapKey'])){throw new db[(_0x5724('0x9a'))][(_0x5724('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x474cab);}_0x3463d0[_0x2ed190[_0x5724('0x5e')]['mapKey']]=_0x2ed190[_0x5724('0x5e')][_0x5724('0x93')];return db[_0x5724('0x9f')][_0x5724('0x5c')]({'where':{'id':_0x2ed190[_0x5724('0x82')][_0x5724('0x92')]},'include':[{'model':db[_0x5724('0x8b')],'as':'Contacts','where':_0x3463d0,'limit':0x1,'order':[[_0x5724('0x90'),'DESC']]}]});})[_0x5724('0x22')](handleEntityNotFound(_0x4e3a6e,null))['then'](function(_0xe200f3){if(_0xe200f3){_0x2ed190[_0x5724('0xa0')]=_['omit'](_0xe200f3,[_0x5724('0xa1')]);if(_0xe200f3[_0x5724('0xa1')][_0x5724('0x4b')]){return _0xe200f3['Contacts'][0x0];}var _0x49a35b=_[_0x5724('0x1a')](_0x2ed190[_0x5724('0x5e')],{'firstName':_0x2ed190['body']['from'],'ListId':_0xe200f3['id']});_0x49a35b[_0x2ed190['body'][_0x5724('0xa2')]]=_0x2ed190['body'][_0x5724('0x93')];return db[_0x5724('0x8b')][_0x5724('0x5d')](_0x49a35b,{'fields':_0x49c26b,'raw':!![]});}})[_0x5724('0x22')](handleEntityNotFound(_0x4e3a6e,null))[_0x5724('0x22')](function(_0x53aadb){if(_0x53aadb){_0x2ed190['contact']=_0x53aadb;var _0x283707={'ContactId':_0x53aadb['id'],'phone':_0x2ed190['body']['from'],'WhatsappAccountId':_0x5bc3c4[_0x5724('0x5b')]['id']};var _0x3907aa={'ContactId':_0x53aadb['id'],'WhatsappAccountId':_0x5bc3c4[_0x5724('0x5b')]['id'],'closed':![]};return db[_0x5724('0xa3')][_0x5724('0x5c')]({'where':_0x3907aa})[_0x5724('0x22')](function(_0xb6659b){if(_0xb6659b){return[_0xb6659b,![]];}return db['WhatsappInteraction']['create'](_0x283707)[_0x5724('0x22')](function(_0x4f4170){return[_0x4f4170,!![]];});});}})[_0x5724('0x72')](function(_0xd80473,_0x32de25){_0x2ed190[_0x5724('0xa4')]=_0xd80473['get']({'plain':!![]});_0x2ed190[_0x5724('0xa4')][_0x5724('0xa5')]=![];if(_0x32de25){if(_0x2ed190[_0x5724('0x82')][_0x5724('0xa6')]){_0x2ed190[_0x5724('0x88')][_0x5724('0xa7')]({'id':0x0,'priority':_0x2ed190[_0x5724('0x88')]['length']+0x1,'app':_0x5724('0xa8'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x2ed190[_0x5724('0xa4')]['created']=!![];}return db[_0x5724('0x86')]['create']({'phone':_0x2ed190[_0x5724('0x5e')]['from'],'messageId':_0x2ed190[_0x5724('0x5e')][_0x5724('0x96')],'body':_0x2ed190[_0x5724('0x5e')][_0x5724('0x5e')],'WhatsappAccountId':_0x5bc3c4[_0x5724('0x5b')]['id'],'WhatsappInteractionId':_0xd80473['id'],'direction':'in','ContactId':_0xd80473['ContactId'],'AttachmentId':_0x2ed190[_0x5724('0x5e')][_0x5724('0xa9')]});})[_0x5724('0x22')](function(_0x2b98f9){_0x2ed190[_0x5724('0x2a')]=_0x2b98f9;if(_0x2ed190[_0x5724('0xa4')][_0x5724('0xaa')]){return db[_0x5724('0xab')][_0x5724('0x5c')]({'attributes':['id','name'],'where':{'id':_0x2ed190[_0x5724('0xa4')][_0x5724('0xaa')]}})[_0x5724('0x22')](function(_0x706814){if(_0x706814){_0x2ed190[_0x5724('0x88')][_0x5724('0xac')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x706814[_0x5724('0x3c')]+','+(_0x2ed190[_0x5724('0x82')][_0x5724('0xad')]||0xa),'interval':_0x5724('0xae')});}return respondWithRpcPromise(_0x5724('0xaf'),'startRouting',_0x2ed190);});}return respondWithRpcPromise(_0x5724('0xaf'),_0x5724('0xb0'),_0x2ed190);})[_0x5724('0x22')](function(_0x8bf475){if(_0x8bf475){var _0x23c7a4=0xc8;var _0x49be4a='receiveMessage';logger[_0x5724('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x49be4a,_0x23c7a4,'entity\x20found');logger[_0x5724('0xb1')](_0x5724('0xb2'),_0x49be4a,_0x23c7a4,_0x5724('0xb3'),JSON[_0x5724('0x27')](_0x8bf475));if(_0x2ed190[_0x5724('0x82')][_0x5724('0x44')]===_0x5724('0xb4')){return _0x4e3a6e[_0x5724('0x2e')](_0x23c7a4)[_0x5724('0xb5')]('Content-Type','text/xml')[_0x5724('0x3d')](_0x5724('0xb6'));}else{return _0x4e3a6e[_0x5724('0x2e')](_0x23c7a4)['json'](_0x8bf475);}}});})[_0x5724('0x2b')](handleError(_0x4e3a6e,null));};exports[_0x5724('0x3d')]=function(_0x3b3b97,_0x13d438,_0x3f0bfc){var _0x15dd60,_0x7a1f75,_0x3ed860;if(_[_0x5724('0x99')](_0x3b3b97[_0x5724('0x5e')][_0x5724('0x5e')])||_0x3b3b97[_0x5724('0x5e')][_0x5724('0x5e')]===''){throw new db[(_0x5724('0x9a'))][(_0x5724('0x8c'))](_0x5724('0x9c'));}if(_[_0x5724('0x99')](_0x3b3b97['body']['to'])){throw new db[(_0x5724('0x9a'))][(_0x5724('0x8c'))](_0x5724('0xb7'));}_0x15dd60=_0x3b3b97[_0x5724('0x5e')]['to'];return db['WhatsappAccount'][_0x5724('0x5c')]({'where':{'id':_0x3b3b97[_0x5724('0x5b')]['id']},'include':[{'model':db[_0x5724('0x9f')],'as':_0x5724('0xb8'),'include':[{'model':db['CmContact'],'as':_0x5724('0xa1'),'where':{'mobile':_0x15dd60},'limit':0x1,'order':[[_0x5724('0x90'),_0x5724('0xb9')]]}]}]})[_0x5724('0x22')](handleEntityNotFound(_0x13d438,null))[_0x5724('0x22')](function(_0x3f6733){if(_0x3f6733&&_0x3f6733[_0x5724('0xb8')]){_0x7a1f75=_0x3f6733[_0x5724('0x39')]({'plain':!![]});if(_0x7a1f75[_0x5724('0xb8')]&&_0x7a1f75[_0x5724('0xb8')][_0x5724('0xa1')][_0x5724('0x4b')]){return _0x7a1f75[_0x5724('0xb8')][_0x5724('0xa1')][0x0];}return db[_0x5724('0x8b')]['create'](_[_0x5724('0x1a')](_0x3b3b97[_0x5724('0x5e')],{'firstName':_0x15dd60,'mobile':_0x15dd60,'phone':_0x15dd60,'ListId':_0x7a1f75[_0x5724('0x92')]}));}})[_0x5724('0x22')](handleEntityNotFound(_0x13d438,null))[_0x5724('0x22')](function(_0x1db6ed){if(_0x1db6ed){_0x3ed860=_0x1db6ed;return db[_0x5724('0xa3')][_0x5724('0x5c')]({'where':{'ContactId':_0x3ed860['id'],'closed':![],'WhatsappAccountId':_0x7a1f75['id']}})['then'](function(_0x5e4ac3){if(_0x5e4ac3){return[_0x5e4ac3,![]];}return db[_0x5724('0xa3')][_0x5724('0x5d')]({'UserId':_0x3b3b97[_0x5724('0xba')]['id'],'ContactId':_0x3ed860['id'],'WhatsappAccountId':_0x7a1f75['id'],'phone':_0x15dd60,'firstMsgDirection':_0x5724('0xbb'),'Messages':[_[_0x5724('0x53')](_0x3b3b97[_0x5724('0x5e')],{'read':![],'body':_0x3b3b97[_0x5724('0x5e')][_0x5724('0x5e')],'phone':_0x15dd60,'WhatsappAccountId':_0x7a1f75['id'],'UserId':_0x3b3b97[_0x5724('0xba')]['id'],'ContactId':_0x3ed860['id']})]},{'include':[{'model':db[_0x5724('0x86')],'as':_0x5724('0xbc')}]})[_0x5724('0x22')](function(_0x280cd7){return[_0x280cd7,!![]];});});}})[_0x5724('0x72')](function(_0x2e7d7a,_0x34cfda){if(_0x34cfda){return _0x2e7d7a;}return db[_0x5724('0x86')][_0x5724('0x5d')](_['merge'](_0x3b3b97[_0x5724('0x5e')],{'read':![],'body':_0x3b3b97[_0x5724('0x5e')][_0x5724('0x5e')],'phone':_0x15dd60,'WhatsappAccountId':_0x7a1f75['id'],'WhatsappInteractionId':_0x2e7d7a['id'],'UserId':_0x3b3b97['user']['id'],'ContactId':_0x3ed860['id']}))[_0x5724('0x22')](function(_0x2cd03a){_0x2e7d7a[_0x5724('0xbd')][_0x5724('0xbc')]=[];_0x2e7d7a[_0x5724('0xbd')]['Messages'][_0x5724('0xa7')](_0x2cd03a[_0x5724('0xbd')]);return _0x2e7d7a;});})[_0x5724('0x22')](respondWithResult(_0x13d438,null))[_0x5724('0x2b')](handleError(_0x13d438,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ef8c934..fe6d04d 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 _0x8074=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x264f8a,_0x10a1a9){var _0x46394c=function(_0x109506){while(--_0x109506){_0x264f8a['push'](_0x264f8a['shift']());}};_0x46394c(++_0x10a1a9);}(_0x8074,0x128));var _0x4807=function(_0x4b3207,_0x4e232c){_0x4b3207=_0x4b3207-0x0;var _0x40ec70=_0x8074[_0x4b3207];return _0x40ec70;};'use strict';var EventEmitter=require(_0x4807('0x0'));var WhatsappAccount=require(_0x4807('0x1'))['db'][_0x4807('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4807('0x3')](0x0);var events={'afterCreate':_0x4807('0x4'),'afterUpdate':_0x4807('0x5'),'afterDestroy':_0x4807('0x6')};function emitEvent(_0x2c593e){return function(_0x31e433,_0x109d4c,_0x395627){WhatsappAccountEvents[_0x4807('0x7')](_0x2c593e+':'+_0x31e433['id'],_0x31e433);WhatsappAccountEvents['emit'](_0x2c593e,_0x31e433);_0x395627(null);};}for(var e in events){if(events[_0x4807('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x27ac=['remove','hasOwnProperty','hook','events','WhatsappAccount','setMaxListeners','save','update'];(function(_0x6b81e5,_0x294931){var _0x30b891=function(_0x500c91){while(--_0x500c91){_0x6b81e5['push'](_0x6b81e5['shift']());}};_0x30b891(++_0x294931);}(_0x27ac,0x1c3));var _0xc27a=function(_0x4bf3a7,_0x5d756b){_0x4bf3a7=_0x4bf3a7-0x0;var _0x58c9cc=_0x27ac[_0x4bf3a7];return _0x58c9cc;};'use strict';var EventEmitter=require(_0xc27a('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xc27a('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc27a('0x2')](0x0);var events={'afterCreate':_0xc27a('0x3'),'afterUpdate':_0xc27a('0x4'),'afterDestroy':_0xc27a('0x5')};function emitEvent(_0x43cf36){return function(_0x38b328,_0x431957,_0x4e04dd){WhatsappAccountEvents['emit'](_0x43cf36+':'+_0x38b328['id'],_0x38b328);WhatsappAccountEvents['emit'](_0x43cf36,_0x38b328);_0x4e04dd(null);};}for(var e in events){if(events[_0xc27a('0x6')](e)){var event=events[e];WhatsappAccount[_0xc27a('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index e81a092..9ca1860 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 _0x1a58=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x424a26,_0x125957){var _0x20cc43=function(_0x9f9e09){while(--_0x9f9e09){_0x424a26['push'](_0x424a26['shift']());}};_0x20cc43(++_0x125957);}(_0x1a58,0x196));var _0x81a5=function(_0x5c6ce9,_0x3fb7bd){_0x5c6ce9=_0x5c6ce9-0x0;var _0xf79b17=_0x1a58[_0x5c6ce9];return _0xf79b17;};'use strict';var _=require(_0x81a5('0x0'));var util=require(_0x81a5('0x1'));var logger=require(_0x81a5('0x2'))('api');var moment=require(_0x81a5('0x3'));var BPromise=require(_0x81a5('0x4'));var rp=require(_0x81a5('0x5'));var fs=require('fs');var path=require(_0x81a5('0x6'));var rimraf=require(_0x81a5('0x7'));var config=require(_0x81a5('0x8'));var attributes=require(_0x81a5('0x9'));module[_0x81a5('0xa')]=function(_0x1e5d50,_0x5dba81){return _0x1e5d50[_0x81a5('0xb')](_0x81a5('0xc'),attributes,{'tableName':_0x81a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8557=['request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api','moment'];(function(_0x5874e2,_0x2ac3d8){var _0x12bbbc=function(_0x737a08){while(--_0x737a08){_0x5874e2['push'](_0x5874e2['shift']());}};_0x12bbbc(++_0x2ac3d8);}(_0x8557,0xe6));var _0x7855=function(_0x23bea4,_0x38a38){_0x23bea4=_0x23bea4-0x0;var _0xb54789=_0x8557[_0x23bea4];return _0xb54789;};'use strict';var _=require('lodash');var util=require(_0x7855('0x0'));var logger=require(_0x7855('0x1'))(_0x7855('0x2'));var moment=require(_0x7855('0x3'));var BPromise=require('bluebird');var rp=require(_0x7855('0x4'));var fs=require('fs');var path=require(_0x7855('0x5'));var rimraf=require(_0x7855('0x6'));var config=require(_0x7855('0x7'));var attributes=require(_0x7855('0x8'));module[_0x7855('0x9')]=function(_0x4d66af,_0x965db3){return _0x4d66af[_0x7855('0xa')](_0x7855('0xb'),attributes,{'tableName':_0x7855('0xc'),'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 ae68851..f8ff728 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 _0xd0d5=['error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','model','map','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent'];(function(_0xd5cb11,_0x203dbf){var _0x5e6fb4=function(_0x422853){while(--_0x422853){_0xd5cb11['push'](_0xd5cb11['shift']());}};_0x5e6fb4(++_0x203dbf);}(_0xd0d5,0x1e3));var _0x5d0d=function(_0x1d2955,_0x4991e9){_0x1d2955=_0x1d2955-0x0;var _0x5ab8cf=_0xd0d5[_0x1d2955];return _0x5ab8cf;};'use strict';var _=require(_0x5d0d('0x0'));var util=require('util');var moment=require(_0x5d0d('0x1'));var BPromise=require(_0x5d0d('0x2'));var rs=require(_0x5d0d('0x3'));var fs=require('fs');var Redis=require(_0x5d0d('0x4'));var db=require(_0x5d0d('0x5'))['db'];var utils=require(_0x5d0d('0x6'));var logger=require(_0x5d0d('0x7'))(_0x5d0d('0x8'));var config=require(_0x5d0d('0x9'));var jayson=require(_0x5d0d('0xa'));var client=jayson[_0x5d0d('0xb')][_0x5d0d('0xc')]({'port':0x232a});config['redis']=_[_0x5d0d('0xd')](config[_0x5d0d('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d0d('0xf'))(new Redis(config['redis']));require(_0x5d0d('0x10'))[_0x5d0d('0x11')](socket);function respondWithRpcPromise(_0x1ad570,_0x491bea,_0x566cf5){return new BPromise(function(_0xfa62a8,_0x3e1419){return client[_0x5d0d('0x12')](_0x1ad570,_0x566cf5)[_0x5d0d('0x13')](function(_0x5f37a9){logger[_0x5d0d('0x14')](_0x5d0d('0x15'),_0x491bea,'request\x20sent');logger[_0x5d0d('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x491bea,_0x5d0d('0x17'),JSON['stringify'](_0x5f37a9));if(_0x5f37a9[_0x5d0d('0x18')]){if(_0x5f37a9[_0x5d0d('0x18')][_0x5d0d('0x19')]===0x1f4){logger[_0x5d0d('0x18')](_0x5d0d('0x15'),_0x491bea,_0x5f37a9[_0x5d0d('0x18')][_0x5d0d('0x1a')]);return _0x3e1419(_0x5f37a9[_0x5d0d('0x18')]['message']);}logger[_0x5d0d('0x18')](_0x5d0d('0x15'),_0x491bea,_0x5f37a9[_0x5d0d('0x18')][_0x5d0d('0x1a')]);return _0xfa62a8(_0x5f37a9[_0x5d0d('0x18')][_0x5d0d('0x1a')]);}else{logger['info'](_0x5d0d('0x15'),_0x491bea,_0x5d0d('0x17'));_0xfa62a8(_0x5f37a9[_0x5d0d('0x1b')][_0x5d0d('0x1a')]);}})[_0x5d0d('0x1c')](function(_0x5830f9){logger[_0x5d0d('0x18')](_0x5d0d('0x15'),_0x491bea,_0x5830f9);_0x3e1419(_0x5830f9);});});}exports[_0x5d0d('0x1d')]=function(_0x405c12){var _0x55a424=this;return new Promise(function(_0x23e17f,_0x39105b){return db[_0x5d0d('0x1e')][_0x5d0d('0x1f')]({'raw':_0x405c12[_0x5d0d('0x20')]?_0x405c12[_0x5d0d('0x20')][_0x5d0d('0x21')]===undefined?!![]:![]:!![],'where':_0x405c12[_0x5d0d('0x20')]?_0x405c12[_0x5d0d('0x20')]['where']||null:null,'attributes':_0x405c12[_0x5d0d('0x20')]?_0x405c12[_0x5d0d('0x20')][_0x5d0d('0x22')]||null:null,'include':_0x405c12[_0x5d0d('0x20')]?_0x405c12['options'][_0x5d0d('0x23')]?_['map'](_0x405c12[_0x5d0d('0x20')][_0x5d0d('0x23')],function(_0x18a511){return{'model':db[_0x18a511[_0x5d0d('0x24')]],'as':_0x18a511['as'],'attributes':_0x18a511['attributes'],'include':_0x18a511[_0x5d0d('0x23')]?_[_0x5d0d('0x25')](_0x18a511[_0x5d0d('0x23')],function(_0xcb1548){return{'model':db[_0xcb1548[_0x5d0d('0x24')]],'as':_0xcb1548['as'],'attributes':_0xcb1548['attributes'],'include':_0xcb1548[_0x5d0d('0x23')]?_['map'](_0xcb1548['include'],function(_0x50de91){return{'model':db[_0x50de91[_0x5d0d('0x24')]],'as':_0x50de91['as'],'attributes':_0x50de91['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d0d('0x13')](function(_0x4e7be0){logger['info'](_0x5d0d('0x1d'),_0x405c12);logger[_0x5d0d('0x16')](_0x5d0d('0x1d'),_0x405c12,JSON[_0x5d0d('0x26')](_0x4e7be0));_0x23e17f(_0x4e7be0);})[_0x5d0d('0x1c')](function(_0x3d70a0){logger[_0x5d0d('0x18')]('ShowWhatsappAccount',_0x3d70a0[_0x5d0d('0x1a')],_0x405c12);_0x39105b(_0x55a424[_0x5d0d('0x18')](0x1f4,_0x3d70a0['message']));});});}; \ No newline at end of file +var _0xc8a4=['options','raw','where','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find'];(function(_0x2b37b5,_0x4f677b){var _0x36df6d=function(_0x501dc7){while(--_0x501dc7){_0x2b37b5['push'](_0x2b37b5['shift']());}};_0x36df6d(++_0x4f677b);}(_0xc8a4,0x154));var _0x4c8a=function(_0x203ff9,_0x216d2b){_0x203ff9=_0x203ff9-0x0;var _0x273ca4=_0xc8a4[_0x203ff9];return _0x273ca4;};'use strict';var _=require(_0x4c8a('0x0'));var util=require(_0x4c8a('0x1'));var moment=require(_0x4c8a('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c8a('0x3'));var fs=require('fs');var Redis=require(_0x4c8a('0x4'));var db=require(_0x4c8a('0x5'))['db'];var utils=require(_0x4c8a('0x6'));var logger=require('../../config/logger')(_0x4c8a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c8a('0x8'));var client=jayson[_0x4c8a('0x9')][_0x4c8a('0xa')]({'port':0x232a});config['redis']=_[_0x4c8a('0xb')](config[_0x4c8a('0xc')],{'host':_0x4c8a('0xd'),'port':0x18eb});var socket=require(_0x4c8a('0xe'))(new Redis(config[_0x4c8a('0xc')]));require('./whatsappAccount.socket')[_0x4c8a('0xf')](socket);function respondWithRpcPromise(_0x182ed9,_0x159ed0,_0x391374){return new BPromise(function(_0x57c344,_0x44204e){return client[_0x4c8a('0x10')](_0x182ed9,_0x391374)[_0x4c8a('0x11')](function(_0x19b301){logger[_0x4c8a('0x12')](_0x4c8a('0x13'),_0x159ed0,'request\x20sent');logger[_0x4c8a('0x14')](_0x4c8a('0x15'),_0x159ed0,'request\x20sent',JSON[_0x4c8a('0x16')](_0x19b301));if(_0x19b301['error']){if(_0x19b301[_0x4c8a('0x17')][_0x4c8a('0x18')]===0x1f4){logger[_0x4c8a('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x159ed0,_0x19b301[_0x4c8a('0x17')]['message']);return _0x44204e(_0x19b301[_0x4c8a('0x17')][_0x4c8a('0x19')]);}logger[_0x4c8a('0x17')](_0x4c8a('0x13'),_0x159ed0,_0x19b301[_0x4c8a('0x17')][_0x4c8a('0x19')]);return _0x57c344(_0x19b301['error']['message']);}else{logger[_0x4c8a('0x12')](_0x4c8a('0x13'),_0x159ed0,'request\x20sent');_0x57c344(_0x19b301[_0x4c8a('0x1a')][_0x4c8a('0x19')]);}})['catch'](function(_0xd8660e){logger[_0x4c8a('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x159ed0,_0xd8660e);_0x44204e(_0xd8660e);});});}exports[_0x4c8a('0x1b')]=function(_0x15b9e6){var _0x2f5424=this;return new Promise(function(_0x309fa7,_0x1a2abc){return db[_0x4c8a('0x1c')][_0x4c8a('0x1d')]({'raw':_0x15b9e6[_0x4c8a('0x1e')]?_0x15b9e6[_0x4c8a('0x1e')][_0x4c8a('0x1f')]===undefined?!![]:![]:!![],'where':_0x15b9e6[_0x4c8a('0x1e')]?_0x15b9e6[_0x4c8a('0x1e')][_0x4c8a('0x20')]||null:null,'attributes':_0x15b9e6[_0x4c8a('0x1e')]?_0x15b9e6[_0x4c8a('0x1e')]['attributes']||null:null,'include':_0x15b9e6[_0x4c8a('0x1e')]?_0x15b9e6[_0x4c8a('0x1e')][_0x4c8a('0x21')]?_[_0x4c8a('0x22')](_0x15b9e6[_0x4c8a('0x1e')][_0x4c8a('0x21')],function(_0x50a1d4){return{'model':db[_0x50a1d4[_0x4c8a('0x23')]],'as':_0x50a1d4['as'],'attributes':_0x50a1d4[_0x4c8a('0x24')],'include':_0x50a1d4[_0x4c8a('0x21')]?_[_0x4c8a('0x22')](_0x50a1d4[_0x4c8a('0x21')],function(_0x698ba){return{'model':db[_0x698ba[_0x4c8a('0x23')]],'as':_0x698ba['as'],'attributes':_0x698ba[_0x4c8a('0x24')],'include':_0x698ba['include']?_[_0x4c8a('0x22')](_0x698ba['include'],function(_0x1c85d8){return{'model':db[_0x1c85d8[_0x4c8a('0x23')]],'as':_0x1c85d8['as'],'attributes':_0x1c85d8[_0x4c8a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4c8a('0x11')](function(_0x131910){logger[_0x4c8a('0x12')]('ShowWhatsappAccount',_0x15b9e6);logger[_0x4c8a('0x14')]('ShowWhatsappAccount',_0x15b9e6,JSON[_0x4c8a('0x16')](_0x131910));_0x309fa7(_0x131910);})['catch'](function(_0x387fd7){logger[_0x4c8a('0x17')](_0x4c8a('0x1b'),_0x387fd7[_0x4c8a('0x19')],_0x15b9e6);_0x1a2abc(_0x2f5424[_0x4c8a('0x17')](0x1f4,_0x387fd7[_0x4c8a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index d11db11..d369584 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 _0xc9c1=['whatsappAccount:','save','update','emit','length'];(function(_0x28171f,_0x270ed1){var _0x27c49c=function(_0x586ef6){while(--_0x586ef6){_0x28171f['push'](_0x28171f['shift']());}};_0x27c49c(++_0x270ed1);}(_0xc9c1,0x178));var _0x1c9c=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xc9c1[_0x4709c0];return _0x13348b;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x1c9c('0x0'),'remove',_0x1c9c('0x1')];function createListener(_0x348ac8,_0x4939db){return function(_0x31527c){_0x4939db[_0x1c9c('0x2')](_0x348ac8,_0x31527c);};}function removeListener(_0x3990cf,_0x2b8d0d){return function(){WhatsappAccountEvents['removeListener'](_0x3990cf,_0x2b8d0d);};}exports['register']=function(_0x457364){for(var _0x4b2cfc=0x0,_0x958f7b=events[_0x1c9c('0x3')];_0x4b2cfc<_0x958f7b;_0x4b2cfc++){var _0x2afb6f=events[_0x4b2cfc];var _0x5ab975=createListener(_0x1c9c('0x4')+_0x2afb6f,_0x457364);WhatsappAccountEvents['on'](_0x2afb6f,_0x5ab975);}}; \ No newline at end of file +var _0x0153=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0153,0x93));var _0x3015=function(_0x100a69,_0x1fc235){_0x100a69=_0x100a69-0x0;var _0x1f9bb4=_0x0153[_0x100a69];return _0x1f9bb4;};'use strict';var WhatsappAccountEvents=require(_0x3015('0x0'));var events=[_0x3015('0x1'),_0x3015('0x2'),_0x3015('0x3')];function createListener(_0x4a1b7a,_0x239bbb){return function(_0x4ed4e7){_0x239bbb[_0x3015('0x4')](_0x4a1b7a,_0x4ed4e7);};}function removeListener(_0xdff87b,_0x7be95f){return function(){WhatsappAccountEvents[_0x3015('0x5')](_0xdff87b,_0x7be95f);};}exports[_0x3015('0x6')]=function(_0x1c5186){for(var _0x4720e5=0x0,_0x263cd1=events[_0x3015('0x7')];_0x4720e5<_0x263cd1;_0x4720e5++){var _0x510c2b=events[_0x4720e5];var _0x3e5b38=createListener(_0x3015('0x8')+_0x510c2b,_0x1c5186);WhatsappAccountEvents['on'](_0x510c2b,_0x3e5b38);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index eb25b5a..cd9bb18 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 _0x2281=['get','/:id','post','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x15b767,_0x22dc5a){var _0x21eb2f=function(_0xf33e42){while(--_0xf33e42){_0x15b767['push'](_0x15b767['shift']());}};_0x21eb2f(++_0x22dc5a);}(_0x2281,0x117));var _0x1228=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2281[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x1228('0x0'));var util=require(_0x1228('0x1'));var path=require(_0x1228('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1228('0x3')]();var fs_extra=require(_0x1228('0x4'));var auth=require(_0x1228('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1228('0x6'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x1228('0x7')](),controller[_0x1228('0x8')]);router[_0x1228('0x9')](_0x1228('0xa'),auth[_0x1228('0x7')](),controller['show']);router[_0x1228('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1228('0xc')](_0x1228('0xa'),auth[_0x1228('0x7')](),controller[_0x1228('0xd')]);router['delete'](_0x1228('0xa'),auth[_0x1228('0x7')](),controller[_0x1228('0xe')]);module[_0x1228('0xf')]=router; \ No newline at end of file +var _0x5725=['destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','create','put','delete'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5725,0xa4));var _0x5572=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5725[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5572('0x0'));var timeout=require('connect-timeout');var express=require(_0x5572('0x1'));var router=express[_0x5572('0x2')]();var fs_extra=require(_0x5572('0x3'));var auth=require(_0x5572('0x4'));var interaction=require(_0x5572('0x5'));var config=require(_0x5572('0x6'));var controller=require(_0x5572('0x7'));router[_0x5572('0x8')]('/',auth['isAuthenticated'](),controller[_0x5572('0x9')]);router[_0x5572('0x8')](_0x5572('0xa'),auth[_0x5572('0xb')](),controller[_0x5572('0xc')]);router['post']('/',auth[_0x5572('0xb')](),controller[_0x5572('0xd')]);router[_0x5572('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5572('0xf')](_0x5572('0xa'),auth['isAuthenticated'](),controller[_0x5572('0x10')]);module[_0x5572('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 86314bb..8d9bd09 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 _0x96f3=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0xef7c71,_0x4fc71c){var _0x41de8c=function(_0x41e09c){while(--_0x41e09c){_0xef7c71['push'](_0xef7c71['shift']());}};_0x41de8c(++_0x4fc71c);}(_0x96f3,0x1b8));var _0x396f=function(_0x14c59f,_0x56d0ac){_0x14c59f=_0x14c59f-0x0;var _0x9c15a=_0x96f3[_0x14c59f];return _0x9c15a;};'use strict';var Sequelize=require(_0x396f('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x396f('0x1')],'allowNull':![],'defaultValue':_0x396f('0x2')},'appdata':{'type':Sequelize[_0x396f('0x3')]()},'description':{'type':Sequelize[_0x396f('0x1')]},'interval':{'type':Sequelize[_0x396f('0x1')],'defaultValue':_0x396f('0x4')}}; \ No newline at end of file +var _0x26d5=['STRING','noop','sequelize'];(function(_0x954122,_0x456278){var _0x398809=function(_0x51a3c4){while(--_0x51a3c4){_0x954122['push'](_0x954122['shift']());}};_0x398809(++_0x456278);}(_0x26d5,0x1e5));var _0x526d=function(_0x330ae9,_0x380026){_0x330ae9=_0x330ae9-0x0;var _0x189aa9=_0x26d5[_0x330ae9];return _0x189aa9;};'use strict';var Sequelize=require(_0x526d('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x526d('0x1')],'allowNull':![],'defaultValue':_0x526d('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x526d('0x1')]},'interval':{'type':Sequelize[_0x526d('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index a9dc278..2b90857 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 _0x9134=['zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','then','end','error','stack','name','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','includeAll','rows','catch','show','params','options','create','body','rimraf'];(function(_0x296402,_0x44efc3){var _0x4f30b7=function(_0x4b6727){while(--_0x4b6727){_0x296402['push'](_0x296402['shift']());}};_0x4f30b7(++_0x44efc3);}(_0x9134,0x87));var _0x4913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9134[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4913('0x0'));var zipdir=require(_0x4913('0x1'));var jsonpatch=require(_0x4913('0x2'));var rp=require(_0x4913('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4913('0x4'));var util=require(_0x4913('0x5'));var path=require(_0x4913('0x6'));var sox=require(_0x4913('0x7'));var csv=require(_0x4913('0x8'));var ejs=require(_0x4913('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4913('0xa'));var squel=require(_0x4913('0xb'));var crypto=require(_0x4913('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4913('0xd'));var toCsv=require(_0x4913('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4913('0xe'));var authService=require(_0x4913('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4913('0x10'));var hardwareService=require(_0x4913('0x11'));var logger=require(_0x4913('0x12'))(_0x4913('0x13'));var utils=require(_0x4913('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4913('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23b04f,_0x5ada12){_0x5ada12=_0x5ada12||0xcc;return function(_0x2394e7){if(_0x2394e7){return _0x23b04f[_0x4913('0x16')](_0x5ada12);}return _0x23b04f[_0x4913('0x17')](_0x5ada12)['end']();};}function respondWithResult(_0x3c8dc1,_0x34cc89){_0x34cc89=_0x34cc89||0xc8;return function(_0x525990){if(_0x525990){return _0x3c8dc1['status'](_0x34cc89)[_0x4913('0x18')](_0x525990);}};}function respondWithFilteredResult(_0xa6bd33,_0x270802){return function(_0x41b53c){if(_0x41b53c){var _0x579144=typeof _0x270802[_0x4913('0x19')]===_0x4913('0x1a')&&typeof _0x270802['limit']===_0x4913('0x1a');var _0x504efe=_0x41b53c[_0x4913('0x1b')];var _0x398f2f=_0x579144?0x0:_0x270802['offset'];var _0x366045=_0x579144?_0x41b53c['count']:_0x270802[_0x4913('0x19')]+_0x270802[_0x4913('0x1c')];var _0x3c22de;if(_0x366045>=_0x504efe){_0x366045=_0x504efe;_0x3c22de=0xc8;}else{_0x3c22de=0xce;}_0xa6bd33['status'](_0x3c22de);return _0xa6bd33['set'](_0x4913('0x1d'),_0x398f2f+'-'+_0x366045+'/'+_0x504efe)['json'](_0x41b53c);}return null;};}function patchUpdates(_0xcb1c7a){return function(_0x195f17){try{jsonpatch['apply'](_0x195f17,_0xcb1c7a,!![]);}catch(_0x15935b){return BPromise[_0x4913('0x1e')](_0x15935b);}return _0x195f17[_0x4913('0x1f')]();};}function saveUpdates(_0x12cd8a,_0x2611b8){return function(_0x3c099e){if(_0x3c099e){return _0x3c099e[_0x4913('0x20')](_0x12cd8a)['then'](function(_0x262cab){return _0x262cab;});}return null;};}function removeEntity(_0x53cf21,_0x3d450f){return function(_0x3ff8de){if(_0x3ff8de){return _0x3ff8de[_0x4913('0x21')]()[_0x4913('0x22')](function(){_0x53cf21[_0x4913('0x17')](0xcc)[_0x4913('0x23')]();});}};}function handleEntityNotFound(_0x8f40a9,_0x4139a1){return function(_0x203ba7){if(!_0x203ba7){_0x8f40a9[_0x4913('0x16')](0x194);}return _0x203ba7;};}function handleError(_0x3bb9cd,_0x38a4a2){_0x38a4a2=_0x38a4a2||0x1f4;return function(_0x5afb75){logger[_0x4913('0x24')](_0x5afb75[_0x4913('0x25')]);if(_0x5afb75['name']){delete _0x5afb75[_0x4913('0x26')];}_0x3bb9cd[_0x4913('0x17')](_0x38a4a2)['send'](_0x5afb75);};}exports['index']=function(_0x115f54,_0x1dc1da){var _0x2f74c4={},_0x4c68bf={},_0x2ff818={'count':0x0,'rows':[]};var _0x3c1798=_[_0x4913('0x27')](db[_0x4913('0x28')][_0x4913('0x29')],function(_0x3ba6ea){return{'name':_0x3ba6ea[_0x4913('0x2a')],'type':_0x3ba6ea[_0x4913('0x2b')][_0x4913('0x2c')]};});_0x4c68bf[_0x4913('0x2d')]=_[_0x4913('0x27')](_0x3c1798,_0x4913('0x26'));_0x4c68bf[_0x4913('0x2e')]=_[_0x4913('0x2f')](_0x115f54['query']);_0x4c68bf[_0x4913('0x30')]=_['intersection'](_0x4c68bf['model'],_0x4c68bf[_0x4913('0x2e')]);_0x2f74c4[_0x4913('0x31')]=_[_0x4913('0x32')](_0x4c68bf[_0x4913('0x2d')],qs[_0x4913('0x33')](_0x115f54[_0x4913('0x2e')][_0x4913('0x33')]));_0x2f74c4[_0x4913('0x31')]=_0x2f74c4[_0x4913('0x31')][_0x4913('0x34')]?_0x2f74c4['attributes']:_0x4c68bf[_0x4913('0x2d')];if(!_0x115f54['query'][_0x4913('0x35')](_0x4913('0x36'))){_0x2f74c4['limit']=qs[_0x4913('0x1c')](_0x115f54[_0x4913('0x2e')][_0x4913('0x1c')]);_0x2f74c4[_0x4913('0x19')]=qs['offset'](_0x115f54[_0x4913('0x2e')][_0x4913('0x19')]);}_0x2f74c4['order']=qs[_0x4913('0x37')](_0x115f54['query'][_0x4913('0x37')]);_0x2f74c4['where']=qs['filters'](_['pick'](_0x115f54[_0x4913('0x2e')],_0x4c68bf[_0x4913('0x30')]),_0x3c1798);if(_0x115f54['query'][_0x4913('0x38')]){_0x2f74c4['where']=_[_0x4913('0x39')](_0x2f74c4[_0x4913('0x3a')],{'$or':_[_0x4913('0x27')](_0x3c1798,function(_0x281db4){if(_0x281db4[_0x4913('0x2b')]!==_0x4913('0x3b')){var _0x166b23={};_0x166b23[_0x281db4[_0x4913('0x26')]]={'$like':'%'+_0x115f54[_0x4913('0x2e')][_0x4913('0x38')]+'%'};return _0x166b23;}})});}_0x2f74c4=_[_0x4913('0x39')]({},_0x2f74c4,_0x115f54['options']);var _0x10bcc1={'where':_0x2f74c4[_0x4913('0x3a')]};return db['WhatsappApplication'][_0x4913('0x1b')](_0x10bcc1)['then'](function(_0x90c348){_0x2ff818[_0x4913('0x1b')]=_0x90c348;if(_0x115f54['query'][_0x4913('0x3c')]){_0x2f74c4['include']=[{'all':!![]}];}return db[_0x4913('0x28')]['findAll'](_0x2f74c4);})[_0x4913('0x22')](function(_0x51c6c3){_0x2ff818[_0x4913('0x3d')]=_0x51c6c3;return _0x2ff818;})['then'](respondWithFilteredResult(_0x1dc1da,_0x2f74c4))[_0x4913('0x3e')](handleError(_0x1dc1da,null));};exports[_0x4913('0x3f')]=function(_0xa5a5f8,_0x69a188){var _0x354bfa={'raw':!![],'where':{'id':_0xa5a5f8[_0x4913('0x40')]['id']}},_0x4d6536={};_0x4d6536[_0x4913('0x2d')]=_[_0x4913('0x2f')](db[_0x4913('0x28')]['rawAttributes']);_0x4d6536[_0x4913('0x2e')]=_[_0x4913('0x2f')](_0xa5a5f8[_0x4913('0x2e')]);_0x4d6536[_0x4913('0x30')]=_[_0x4913('0x32')](_0x4d6536['model'],_0x4d6536[_0x4913('0x2e')]);_0x354bfa[_0x4913('0x31')]=_[_0x4913('0x32')](_0x4d6536['model'],qs[_0x4913('0x33')](_0xa5a5f8[_0x4913('0x2e')][_0x4913('0x33')]));_0x354bfa[_0x4913('0x31')]=_0x354bfa[_0x4913('0x31')][_0x4913('0x34')]?_0x354bfa[_0x4913('0x31')]:_0x4d6536[_0x4913('0x2d')];if(_0xa5a5f8[_0x4913('0x2e')]['includeAll']){_0x354bfa['include']=[{'all':!![]}];}_0x354bfa=_['merge']({},_0x354bfa,_0xa5a5f8[_0x4913('0x41')]);return db[_0x4913('0x28')]['find'](_0x354bfa)[_0x4913('0x22')](handleEntityNotFound(_0x69a188,null))['then'](respondWithResult(_0x69a188,null))['catch'](handleError(_0x69a188,null));};exports[_0x4913('0x42')]=function(_0x3e9186,_0x38e1e8){return db[_0x4913('0x28')][_0x4913('0x42')](_0x3e9186[_0x4913('0x43')],{})[_0x4913('0x22')](respondWithResult(_0x38e1e8,0xc9))[_0x4913('0x3e')](handleError(_0x38e1e8,null));};exports[_0x4913('0x20')]=function(_0x82d456,_0x23c32d){if(_0x82d456[_0x4913('0x43')]['id']){delete _0x82d456[_0x4913('0x43')]['id'];}return db[_0x4913('0x28')]['find']({'where':{'id':_0x82d456['params']['id']}})[_0x4913('0x22')](handleEntityNotFound(_0x23c32d,null))[_0x4913('0x22')](saveUpdates(_0x82d456['body'],null))['then'](respondWithResult(_0x23c32d,null))[_0x4913('0x3e')](handleError(_0x23c32d,null));};exports[_0x4913('0x21')]=function(_0x2793ec,_0x261eb6){return db[_0x4913('0x28')]['find']({'where':{'id':_0x2793ec[_0x4913('0x40')]['id']}})[_0x4913('0x22')](handleEntityNotFound(_0x261eb6,null))[_0x4913('0x22')](removeEntity(_0x261eb6,null))['catch'](handleError(_0x261eb6,null));}; \ No newline at end of file +var _0x8ff9=['name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','include','findAll','show','params','length','options','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','error','stack'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x4aaaef,_0x5cb832){_0x4aaaef=_0x4aaaef-0x0;var _0x2dd96a=_0x8ff9[_0x4aaaef];return _0x2dd96a;};'use strict';var emlformat=require(_0x98ff('0x0'));var rimraf=require(_0x98ff('0x1'));var zipdir=require(_0x98ff('0x2'));var jsonpatch=require(_0x98ff('0x3'));var rp=require(_0x98ff('0x4'));var moment=require(_0x98ff('0x5'));var BPromise=require(_0x98ff('0x6'));var Mustache=require(_0x98ff('0x7'));var util=require(_0x98ff('0x8'));var path=require(_0x98ff('0x9'));var sox=require(_0x98ff('0xa'));var csv=require('to-csv');var ejs=require(_0x98ff('0xb'));var fs=require('fs');var fs_extra=require(_0x98ff('0xc'));var _=require(_0x98ff('0xd'));var squel=require(_0x98ff('0xe'));var crypto=require(_0x98ff('0xf'));var jsforce=require(_0x98ff('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x98ff('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x98ff('0x12'));var authService=require(_0x98ff('0x13'));var qs=require(_0x98ff('0x14'));var as=require(_0x98ff('0x15'));var hardwareService=require(_0x98ff('0x16'));var logger=require('../../config/logger')(_0x98ff('0x17'));var utils=require('../../config/utils');var config=require(_0x98ff('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc547f8,_0x1529cf){_0x1529cf=_0x1529cf||0xcc;return function(_0x24a64e){if(_0x24a64e){return _0xc547f8['sendStatus'](_0x1529cf);}return _0xc547f8[_0x98ff('0x19')](_0x1529cf)['end']();};}function respondWithResult(_0x7af35,_0x373e14){_0x373e14=_0x373e14||0xc8;return function(_0x2c4e4d){if(_0x2c4e4d){return _0x7af35[_0x98ff('0x19')](_0x373e14)[_0x98ff('0x1a')](_0x2c4e4d);}};}function respondWithFilteredResult(_0x2ebc89,_0x4c319c){return function(_0x3573a4){if(_0x3573a4){var _0x196f27=typeof _0x4c319c[_0x98ff('0x1b')]===_0x98ff('0x1c')&&typeof _0x4c319c[_0x98ff('0x1d')]===_0x98ff('0x1c');var _0x1f3044=_0x3573a4[_0x98ff('0x1e')];var _0x268121=_0x196f27?0x0:_0x4c319c[_0x98ff('0x1b')];var _0x91e31c=_0x196f27?_0x3573a4[_0x98ff('0x1e')]:_0x4c319c[_0x98ff('0x1b')]+_0x4c319c[_0x98ff('0x1d')];var _0x4c235b;if(_0x91e31c>=_0x1f3044){_0x91e31c=_0x1f3044;_0x4c235b=0xc8;}else{_0x4c235b=0xce;}_0x2ebc89[_0x98ff('0x19')](_0x4c235b);return _0x2ebc89[_0x98ff('0x1f')](_0x98ff('0x20'),_0x268121+'-'+_0x91e31c+'/'+_0x1f3044)[_0x98ff('0x1a')](_0x3573a4);}return null;};}function patchUpdates(_0x41b840){return function(_0x26e589){try{jsonpatch[_0x98ff('0x21')](_0x26e589,_0x41b840,!![]);}catch(_0x3a6c52){return BPromise[_0x98ff('0x22')](_0x3a6c52);}return _0x26e589[_0x98ff('0x23')]();};}function saveUpdates(_0xf0f062,_0x2b21be){return function(_0x2fdbc2){if(_0x2fdbc2){return _0x2fdbc2['update'](_0xf0f062)['then'](function(_0x4c6ddc){return _0x4c6ddc;});}return null;};}function removeEntity(_0x27a070,_0x3ee01b){return function(_0x547fab){if(_0x547fab){return _0x547fab[_0x98ff('0x24')]()['then'](function(){_0x27a070[_0x98ff('0x19')](0xcc)[_0x98ff('0x25')]();});}};}function handleEntityNotFound(_0x308efd,_0x2b3ee9){return function(_0x4003de){if(!_0x4003de){_0x308efd['sendStatus'](0x194);}return _0x4003de;};}function handleError(_0x577ca7,_0xf53ff7){_0xf53ff7=_0xf53ff7||0x1f4;return function(_0x1a4ebd){logger[_0x98ff('0x26')](_0x1a4ebd[_0x98ff('0x27')]);if(_0x1a4ebd[_0x98ff('0x28')]){delete _0x1a4ebd[_0x98ff('0x28')];}_0x577ca7[_0x98ff('0x19')](_0xf53ff7)[_0x98ff('0x29')](_0x1a4ebd);};}exports[_0x98ff('0x2a')]=function(_0x25a658,_0x4b6e9c){var _0x43e12c={},_0x256823={},_0x19df47={'count':0x0,'rows':[]};var _0x45d045=_[_0x98ff('0x2b')](db[_0x98ff('0x2c')][_0x98ff('0x2d')],function(_0x41c093){return{'name':_0x41c093[_0x98ff('0x2e')],'type':_0x41c093[_0x98ff('0x2f')][_0x98ff('0x30')]};});_0x256823[_0x98ff('0x31')]=_[_0x98ff('0x2b')](_0x45d045,_0x98ff('0x28'));_0x256823[_0x98ff('0x32')]=_[_0x98ff('0x33')](_0x25a658[_0x98ff('0x32')]);_0x256823[_0x98ff('0x34')]=_[_0x98ff('0x35')](_0x256823[_0x98ff('0x31')],_0x256823[_0x98ff('0x32')]);_0x43e12c['attributes']=_[_0x98ff('0x35')](_0x256823[_0x98ff('0x31')],qs[_0x98ff('0x36')](_0x25a658[_0x98ff('0x32')][_0x98ff('0x36')]));_0x43e12c['attributes']=_0x43e12c[_0x98ff('0x37')]['length']?_0x43e12c[_0x98ff('0x37')]:_0x256823[_0x98ff('0x31')];if(!_0x25a658[_0x98ff('0x32')][_0x98ff('0x38')](_0x98ff('0x39'))){_0x43e12c[_0x98ff('0x1d')]=qs[_0x98ff('0x1d')](_0x25a658[_0x98ff('0x32')][_0x98ff('0x1d')]);_0x43e12c[_0x98ff('0x1b')]=qs['offset'](_0x25a658[_0x98ff('0x32')][_0x98ff('0x1b')]);}_0x43e12c[_0x98ff('0x3a')]=qs[_0x98ff('0x3b')](_0x25a658[_0x98ff('0x32')][_0x98ff('0x3b')]);_0x43e12c[_0x98ff('0x3c')]=qs[_0x98ff('0x34')](_['pick'](_0x25a658[_0x98ff('0x32')],_0x256823['filters']),_0x45d045);if(_0x25a658[_0x98ff('0x32')][_0x98ff('0x3d')]){_0x43e12c[_0x98ff('0x3c')]=_[_0x98ff('0x3e')](_0x43e12c[_0x98ff('0x3c')],{'$or':_['map'](_0x45d045,function(_0x543762){if(_0x543762[_0x98ff('0x2f')]!==_0x98ff('0x3f')){var _0x1f08c7={};_0x1f08c7[_0x543762[_0x98ff('0x28')]]={'$like':'%'+_0x25a658[_0x98ff('0x32')][_0x98ff('0x3d')]+'%'};return _0x1f08c7;}})});}_0x43e12c=_[_0x98ff('0x3e')]({},_0x43e12c,_0x25a658['options']);var _0x263e85={'where':_0x43e12c[_0x98ff('0x3c')]};return db[_0x98ff('0x2c')][_0x98ff('0x1e')](_0x263e85)[_0x98ff('0x40')](function(_0x676d0b){_0x19df47[_0x98ff('0x1e')]=_0x676d0b;if(_0x25a658['query'][_0x98ff('0x41')]){_0x43e12c[_0x98ff('0x42')]=[{'all':!![]}];}return db[_0x98ff('0x2c')][_0x98ff('0x43')](_0x43e12c);})[_0x98ff('0x40')](function(_0x5d8c45){_0x19df47['rows']=_0x5d8c45;return _0x19df47;})[_0x98ff('0x40')](respondWithFilteredResult(_0x4b6e9c,_0x43e12c))['catch'](handleError(_0x4b6e9c,null));};exports[_0x98ff('0x44')]=function(_0x3914e6,_0x3fe271){var _0x11d4e7={'raw':!![],'where':{'id':_0x3914e6[_0x98ff('0x45')]['id']}},_0x4208f5={};_0x4208f5['model']=_['keys'](db[_0x98ff('0x2c')]['rawAttributes']);_0x4208f5[_0x98ff('0x32')]=_[_0x98ff('0x33')](_0x3914e6[_0x98ff('0x32')]);_0x4208f5[_0x98ff('0x34')]=_[_0x98ff('0x35')](_0x4208f5[_0x98ff('0x31')],_0x4208f5['query']);_0x11d4e7[_0x98ff('0x37')]=_[_0x98ff('0x35')](_0x4208f5[_0x98ff('0x31')],qs['fields'](_0x3914e6[_0x98ff('0x32')][_0x98ff('0x36')]));_0x11d4e7[_0x98ff('0x37')]=_0x11d4e7[_0x98ff('0x37')][_0x98ff('0x46')]?_0x11d4e7[_0x98ff('0x37')]:_0x4208f5[_0x98ff('0x31')];if(_0x3914e6[_0x98ff('0x32')][_0x98ff('0x41')]){_0x11d4e7[_0x98ff('0x42')]=[{'all':!![]}];}_0x11d4e7=_[_0x98ff('0x3e')]({},_0x11d4e7,_0x3914e6[_0x98ff('0x47')]);return db[_0x98ff('0x2c')][_0x98ff('0x48')](_0x11d4e7)[_0x98ff('0x40')](handleEntityNotFound(_0x3fe271,null))[_0x98ff('0x40')](respondWithResult(_0x3fe271,null))['catch'](handleError(_0x3fe271,null));};exports['create']=function(_0x30aa8b,_0x4c2b0e){return db[_0x98ff('0x2c')][_0x98ff('0x49')](_0x30aa8b[_0x98ff('0x4a')],{})[_0x98ff('0x40')](respondWithResult(_0x4c2b0e,0xc9))[_0x98ff('0x4b')](handleError(_0x4c2b0e,null));};exports[_0x98ff('0x4c')]=function(_0x4596f5,_0x3eb900){if(_0x4596f5[_0x98ff('0x4a')]['id']){delete _0x4596f5['body']['id'];}return db[_0x98ff('0x2c')]['find']({'where':{'id':_0x4596f5[_0x98ff('0x45')]['id']}})[_0x98ff('0x40')](handleEntityNotFound(_0x3eb900,null))['then'](saveUpdates(_0x4596f5[_0x98ff('0x4a')],null))[_0x98ff('0x40')](respondWithResult(_0x3eb900,null))['catch'](handleError(_0x3eb900,null));};exports[_0x98ff('0x24')]=function(_0xe7c8e4,_0x4dd9f5){return db[_0x98ff('0x2c')][_0x98ff('0x48')]({'where':{'id':_0xe7c8e4[_0x98ff('0x45')]['id']}})[_0x98ff('0x40')](handleEntityNotFound(_0x4dd9f5,null))[_0x98ff('0x40')](removeEntity(_0x4dd9f5,null))[_0x98ff('0x4b')](handleError(_0x4dd9f5,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 090a2ae..b718e3d 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 _0xb717=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb717,0x1b4));var _0x7b71=function(_0x422892,_0xe08b65){_0x422892=_0x422892-0x0;var _0x3e6b67=_0xb717[_0x422892];return _0x3e6b67;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b71('0xc'),'collate':_0x7b71('0xd')});}; \ No newline at end of file +var _0x0b78=['moment','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b78,0x1ad));var _0x80b7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0b78[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var logger=require('../../config/logger')(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var attributes=require(_0x80b7('0x7'));module['exports']=function(_0x49bc7f,_0x167ddd){return _0x49bc7f['define'](_0x80b7('0x8'),attributes,{'tableName':_0x80b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80b7('0xa'),'collate':_0x80b7('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 472a922..25fdf96 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x5222d6,_0x453237){var _0x3620dc=function(_0xfbde91){while(--_0xfbde91){_0x5222d6['push'](_0x5222d6['shift']());}};_0x3620dc(++_0x453237);}(_0x55ca,0x126));var _0xa55c=function(_0x4e71ac,_0x42aced){_0x4e71ac=_0x4e71ac-0x0;var _0x11d76c=_0x55ca[_0x4e71ac];return _0x11d76c;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0x33c5=['then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x33c5,0xe6));var _0x533c=function(_0x26299e,_0x394ad1){_0x26299e=_0x26299e-0x0;var _0x6c4f4a=_0x33c5[_0x26299e];return _0x6c4f4a;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var moment=require(_0x533c('0x1'));var BPromise=require('bluebird');var rs=require(_0x533c('0x2'));var fs=require('fs');var Redis=require(_0x533c('0x3'));var db=require(_0x533c('0x4'))['db'];var utils=require(_0x533c('0x5'));var logger=require(_0x533c('0x6'))('rpc');var config=require(_0x533c('0x7'));var jayson=require(_0x533c('0x8'));var client=jayson[_0x533c('0x9')][_0x533c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){return client[_0x533c('0xb')](_0x34ca89,_0x3a009b)[_0x533c('0xc')](function(_0x46536d){logger[_0x533c('0xd')](_0x533c('0xe'),_0x1699d5,_0x533c('0xf'));logger[_0x533c('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1699d5,_0x533c('0xf'),JSON[_0x533c('0x11')](_0x46536d));if(_0x46536d[_0x533c('0x12')]){if(_0x46536d[_0x533c('0x12')][_0x533c('0x13')]===0x1f4){logger[_0x533c('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x1699d5,_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);return _0x2c297c(_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);}logger[_0x533c('0x12')](_0x533c('0xe'),_0x1699d5,_0x46536d[_0x533c('0x12')][_0x533c('0x14')]);return _0x36d74e(_0x46536d['error'][_0x533c('0x14')]);}else{logger[_0x533c('0xd')](_0x533c('0xe'),_0x1699d5,_0x533c('0xf'));_0x36d74e(_0x46536d['result'][_0x533c('0x14')]);}})[_0x533c('0x15')](function(_0x41e22c){logger[_0x533c('0x12')](_0x533c('0xe'),_0x1699d5,_0x41e22c);_0x2c297c(_0x41e22c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 06c7c64..ed51f62 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 _0x4317=['./whatsappInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x586018,_0x3fb0ae){var _0x40e9ad=function(_0x229965){while(--_0x229965){_0x586018['push'](_0x586018['shift']());}};_0x40e9ad(++_0x3fb0ae);}(_0x4317,0x7c));var _0x7431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4317[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xa')](_0x7431('0xe'),auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0xa')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0xa')](_0x7431('0x12'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);router[_0x7431('0x14')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0x15')]);router[_0x7431('0x14')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x16')]);router['post'](_0x7431('0x17'),auth[_0x7431('0xc')](),interaction[_0x7431('0x18')]('whatsapp',_0x7431('0x19')),controller[_0x7431('0x1a')]);router[_0x7431('0x1b')]('/:id',auth[_0x7431('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x7431('0x1c')]);router[_0x7431('0x1d')](_0x7431('0xe'),auth[_0x7431('0xc')](),interaction['tracked']('whatsapp',_0x7431('0x1e')),controller[_0x7431('0x1f')]);router[_0x7431('0x1d')](_0x7431('0x17'),auth[_0x7431('0xc')](),controller[_0x7431('0x20')]);module['exports']=router; \ No newline at end of file +var _0xfcf0=['/:id/download','download','create','post','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','tracked','update','delete','whatsappinteraction:destroy','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xfcf0[_0x3a7a9c];return _0x59156e;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0fcf('0x14')]);router[_0x0fcf('0x15')]('/:id/messages',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x16')]);router[_0x0fcf('0x15')](_0x0fcf('0x17'),auth[_0x0fcf('0xa')](),interaction['tracked'](_0x0fcf('0x18'),_0x0fcf('0x19')),controller[_0x0fcf('0x1a')]);router['put'](_0x0fcf('0xe'),auth[_0x0fcf('0xa')](),interaction[_0x0fcf('0x1b')](_0x0fcf('0x18'),'whatsappinteraction:update'),controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x1d')](_0x0fcf('0xe'),auth[_0x0fcf('0xa')](),interaction[_0x0fcf('0x1b')]('whatsapp',_0x0fcf('0x1e')),controller[_0x0fcf('0x1f')]);router['delete'](_0x0fcf('0x17'),auth[_0x0fcf('0xa')](),controller['removeTags']);module[_0x0fcf('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index d591271..cb7da3f 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 _0x98a7=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x55ab50,_0x12752a){var _0xf6b514=function(_0x5424e4){while(--_0x5424e4){_0x55ab50['push'](_0x55ab50['shift']());}};_0xf6b514(++_0x12752a);}(_0x98a7,0x9e));var _0x798a=function(_0x2e5937,_0x55baa9){_0x2e5937=_0x2e5937-0x0;var _0x5aaec4=_0x98a7[_0x2e5937];return _0x5aaec4;};'use strict';var Sequelize=require(_0x798a('0x0'));var moment=require(_0x798a('0x1'));module[_0x798a('0x2')]={'closed':{'type':Sequelize[_0x798a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x798a('0x4')]},'disposition':{'type':Sequelize[_0x798a('0x5')]},'secondDisposition':{'type':Sequelize[_0x798a('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x798a('0x5')]},'phone':{'type':Sequelize[_0x798a('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x798a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x798a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x798a('0x7')]('in',_0x798a('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x798a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8585=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x492ad3,_0x27146a){var _0x31abf9=function(_0x3b99ef){while(--_0x3b99ef){_0x492ad3['push'](_0x492ad3['shift']());}};_0x31abf9(++_0x27146a);}(_0x8585,0x64));var _0x5858=function(_0x30a898,_0x4ff20a){_0x30a898=_0x30a898-0x0;var _0x2bdc2f=_0x8585[_0x30a898];return _0x2bdc2f;};'use strict';var Sequelize=require(_0x5858('0x0'));var moment=require(_0x5858('0x1'));module[_0x5858('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5858('0x3')]},'disposition':{'type':Sequelize[_0x5858('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x5858('0x4')]},'read1stAt':{'type':Sequelize[_0x5858('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5858('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5858('0x5')]('in',_0x5858('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index ef206ca..297a045 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c19=['download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','Content-Range','reject','update','then','end','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','closed','UserId','unmanaged','total','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','$substring','value','getFullTextValue','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','show','params','includeAll','include','options','create','body','destroy','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','unix','join','files','tmp','root','server','User','CmContact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','System','Contact','lastName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML'];(function(_0x300dce,_0x4e314b){var _0x1df283=function(_0x49eb31){while(--_0x49eb31){_0x300dce['push'](_0x300dce['shift']());}};_0x1df283(++_0x4e314b);}(_0x0c19,0xf5));var _0x90c1=function(_0x1d6dfd,_0x2023f8){_0x1d6dfd=_0x1d6dfd-0x0;var _0x840328=_0x0c19[_0x1d6dfd];return _0x840328;};'use strict';var emlformat=require(_0x90c1('0x0'));var rimraf=require(_0x90c1('0x1'));var zipdir=require(_0x90c1('0x2'));var jsonpatch=require(_0x90c1('0x3'));var rp=require(_0x90c1('0x4'));var moment=require(_0x90c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x90c1('0x6'));var util=require(_0x90c1('0x7'));var path=require(_0x90c1('0x8'));var sox=require('sox');var csv=require(_0x90c1('0x9'));var ejs=require(_0x90c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90c1('0xb'));var squel=require(_0x90c1('0xc'));var crypto=require(_0x90c1('0xd'));var jsforce=require(_0x90c1('0xe'));var deskjs=require(_0x90c1('0xf'));var toCsv=require(_0x90c1('0x9'));var querystring=require(_0x90c1('0x10'));var Papa=require('papaparse');var Redis=require(_0x90c1('0x11'));var authService=require(_0x90c1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x90c1('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90c1('0x14'))('api');var utils=require(_0x90c1('0x15'));var config=require(_0x90c1('0x16'));var licenseUtil=require(_0x90c1('0x17'));var db=require(_0x90c1('0x18'))['db'];config['redis']=_['defaults'](config[_0x90c1('0x19')],{'host':_0x90c1('0x1a'),'port':0x18eb});var socket=require(_0x90c1('0x1b'))(new Redis(config[_0x90c1('0x19')]));require('./whatsappInteraction.socket')[_0x90c1('0x1c')](socket);function respondWithStatusCode(_0x46b951,_0x154cde){_0x154cde=_0x154cde||0xcc;return function(_0x139c67){if(_0x139c67){return _0x46b951[_0x90c1('0x1d')](_0x154cde);}return _0x46b951[_0x90c1('0x1e')](_0x154cde)['end']();};}function respondWithResult(_0x39dc3c,_0x387b94){_0x387b94=_0x387b94||0xc8;return function(_0x45a64c){if(_0x45a64c){return _0x39dc3c[_0x90c1('0x1e')](_0x387b94)[_0x90c1('0x1f')](_0x45a64c);}};}function respondWithFilteredResult(_0x397be4,_0x3b6671){return function(_0x2960f2){if(_0x2960f2){var _0x372949=typeof _0x3b6671[_0x90c1('0x20')]===_0x90c1('0x21')&&typeof _0x3b6671['limit']===_0x90c1('0x21');var _0x365726=_0x2960f2[_0x90c1('0x22')];var _0x1cd1f6=_0x372949?0x0:_0x3b6671[_0x90c1('0x20')];var _0x3c8cc6=_0x372949?_0x2960f2['count']:_0x3b6671[_0x90c1('0x20')]+_0x3b6671['limit'];var _0x299241;if(_0x3c8cc6>=_0x365726){_0x3c8cc6=_0x365726;_0x299241=0xc8;}else{_0x299241=0xce;}_0x397be4['status'](_0x299241);return _0x397be4['set'](_0x90c1('0x23'),_0x1cd1f6+'-'+_0x3c8cc6+'/'+_0x365726)['json'](_0x2960f2);}return null;};}function patchUpdates(_0x5d692b){return function(_0x2291b6){try{jsonpatch['apply'](_0x2291b6,_0x5d692b,!![]);}catch(_0x4d53fd){return BPromise[_0x90c1('0x24')](_0x4d53fd);}return _0x2291b6['save']();};}function saveUpdates(_0x213cd1,_0x4e9caa){return function(_0x46dad7){if(_0x46dad7){return _0x46dad7[_0x90c1('0x25')](_0x213cd1)[_0x90c1('0x26')](function(_0x2625af){return _0x2625af;});}return null;};}function removeEntity(_0x174506,_0x3902c8){return function(_0x2a60fb){if(_0x2a60fb){return _0x2a60fb['destroy']()[_0x90c1('0x26')](function(){_0x174506[_0x90c1('0x1e')](0xcc)[_0x90c1('0x27')]();});}};}function handleEntityNotFound(_0x12d35d,_0x3c3a20){return function(_0x3b6a58){if(!_0x3b6a58){_0x12d35d[_0x90c1('0x1d')](0x194);}return _0x3b6a58;};}function handleError(_0x3b1924,_0x40c45d){_0x40c45d=_0x40c45d||0x1f4;return function(_0x1ed79c){logger[_0x90c1('0x28')](_0x1ed79c[_0x90c1('0x29')]);if(_0x1ed79c[_0x90c1('0x2a')]){delete _0x1ed79c[_0x90c1('0x2a')];}_0x3b1924[_0x90c1('0x1e')](_0x40c45d)['send'](_0x1ed79c);};}function getInteractionUsers(_0x3ccb3d,_0x435e56){return new BPromise(function(_0x40c2f1,_0x5be73c){try{if(_0x435e56[_0x3ccb3d['id']]){_0x3ccb3d[_0x90c1('0x2b')]=_[_0x90c1('0x2c')](_0x435e56[_0x3ccb3d['id']],function(_0x222124){return{'id':_0x222124['id'],'fullname':_0x222124[_0x90c1('0x2d')]};});}}catch(_0x26d3c0){_0x5be73c(_0x26d3c0);}_0x40c2f1(_0x3ccb3d);});}function getInteractionTags(_0x2991c1,_0x25a721){return new BPromise(function(_0x4d7a09,_0x2366b4){try{if(_0x2991c1[_0x90c1('0x2e')]){_0x2991c1[_0x90c1('0x2f')]=[];_0x2991c1['TagIds'][_0x90c1('0x30')](',')[_0x90c1('0x31')](function(_0x145fc4){_0x2991c1[_0x90c1('0x2f')][_0x90c1('0x32')](_0x25a721[_0x145fc4]);});}delete _0x2991c1[_0x90c1('0x2e')];}catch(_0xa5ee96){_0x2366b4(_0xa5ee96);}_0x4d7a09(_0x2991c1);});}function updateWhatsappInteraction(_0x36e431,_0x207e63,_0x17fd69){return new BPromise(function(_0x441f86,_0x35a312){return getInteractionUsers(_0x36e431,_0x17fd69)[_0x90c1('0x26')](function(_0x3a130f){return getInteractionTags(_0x3a130f,_0x207e63);})['then'](function(_0x253e92){return getStateInteraction(_0x253e92);})[_0x90c1('0x26')](function(_0x400134){_0x441f86(_0x400134);})[_0x90c1('0x33')](function(_0x5c62a4){_0x35a312(_0x5c62a4);});});}function getStateInteraction(_0x5d9ec8){return new BPromise(function(_0x173dae){_0x5d9ec8[_0x90c1('0x34')]=0x0;_0x5d9ec8[_0x90c1('0x35')]=0x0;_0x5d9ec8[_0x90c1('0x36')]=0x0;_0x5d9ec8['unmanaged']=0x0;_0x5d9ec8['total']=0x0;if(!_0x5d9ec8[_0x90c1('0x37')]&&!_0x5d9ec8[_0x90c1('0x38')]){_0x5d9ec8[_0x90c1('0x34')]+=0x1;}if(!_0x5d9ec8[_0x90c1('0x37')]&&_0x5d9ec8[_0x90c1('0x38')]){_0x5d9ec8['talking']+=0x1;if(_0x5d9ec8['waiting']){_0x5d9ec8['waiting']-=0x1;}}if(_0x5d9ec8[_0x90c1('0x37')]&&_0x5d9ec8[_0x90c1('0x38')]){_0x5d9ec8[_0x90c1('0x36')]+=0x1;if(_0x5d9ec8['talking']){_0x5d9ec8[_0x90c1('0x35')]-=0x1;}}if(_0x5d9ec8['closed']&&!_0x5d9ec8['UserId']){_0x5d9ec8[_0x90c1('0x39')]+=0x1;if(_0x5d9ec8[_0x90c1('0x34')]){_0x5d9ec8['waiting']-=0x1;}}_0x5d9ec8[_0x90c1('0x3a')]+=0x1;_0x173dae(_0x5d9ec8);});}exports[_0x90c1('0x3b')]=function(_0x916ce1,_0x8e4792){var _0x1b3372={},_0x275731={},_0x55969f={'count':0x0,'rows':[]};var _0x3fb4ed=_['map'](db[_0x90c1('0x3c')][_0x90c1('0x3d')],function(_0x3b6c89){return{'name':_0x3b6c89[_0x90c1('0x3e')],'type':_0x3b6c89[_0x90c1('0x3f')][_0x90c1('0x40')]};});_0x275731[_0x90c1('0x41')]=_['map'](_0x3fb4ed,'name');_0x275731[_0x90c1('0x42')]=_[_0x90c1('0x43')](_0x916ce1[_0x90c1('0x42')]);_0x275731[_0x90c1('0x44')]=_[_0x90c1('0x45')](_0x275731['model'],_0x275731['query']);_0x1b3372[_0x90c1('0x46')]=_[_0x90c1('0x45')](_0x275731['model'],qs[_0x90c1('0x47')](_0x916ce1['query']['fields']));_0x1b3372[_0x90c1('0x46')]=_0x1b3372['attributes'][_0x90c1('0x48')]?_0x1b3372['attributes']:_0x275731['model'];if(!_0x916ce1[_0x90c1('0x42')][_0x90c1('0x49')](_0x90c1('0x4a'))){_0x1b3372[_0x90c1('0x4b')]=qs['limit'](_0x916ce1[_0x90c1('0x42')][_0x90c1('0x4b')]);_0x1b3372[_0x90c1('0x20')]=qs[_0x90c1('0x20')](_0x916ce1['query'][_0x90c1('0x20')]);}_0x1b3372[_0x90c1('0x4c')]=qs['sort'](_0x916ce1[_0x90c1('0x42')][_0x90c1('0x4d')]);_0x1b3372[_0x90c1('0x4e')]=qs[_0x90c1('0x44')](_[_0x90c1('0x4f')](_0x916ce1['query'],_0x275731[_0x90c1('0x44')]),_0x3fb4ed);var _0x4bde8e=[];var _0x304011=squel['select']()[_0x90c1('0x50')]('id')[_0x90c1('0x50')](_0x90c1('0x2a'))[_0x90c1('0x50')](_0x90c1('0x51'))[_0x90c1('0x52')](_0x90c1('0x53'));var _0x23359c=squel[_0x90c1('0x54')]()['field'](_0x90c1('0x55'))['field'](_0x90c1('0x56'))[_0x90c1('0x50')](_0x90c1('0x57'))[_0x90c1('0x52')](_0x90c1('0x58'),'ui')[_0x90c1('0x59')](_0x90c1('0x5a'),'u',_0x90c1('0x5b'));var _0xa117d1=squel[_0x90c1('0x54')]()[_0x90c1('0x52')]('whatsapp_interactions','i')[_0x90c1('0x59')](_0x90c1('0x5c'),'c',_0x90c1('0x5d'))['left_join'](_0x90c1('0x5a'),'o',_0x90c1('0x5e'))[_0x90c1('0x59')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x90c1('0x59')](_0x90c1('0x5f'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x90c1('0x59')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x90c1('0x53'),'t','t.id\x20=\x20it.TagId');var _0x38f50a=squel[_0x90c1('0x60')]();var _0x3cdd0c=[];var _0x298aa2=squel['expr']();var _0x53d98f;if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x61')]){_0x53d98f=as[_0x90c1('0x62')](_0x916ce1[_0x90c1('0x42')]['search']);var _0x4a78ca=_0x53d98f[_0x90c1('0x63')];for(var _0x4850f7=0x0;_0x4850f7<_0x53d98f[_0x90c1('0x64')][_0x90c1('0x48')];_0x4850f7++){var _0x38d884=_0x53d98f[_0x90c1('0x64')][_0x4850f7];var _0x5a7948='i';var _0xded4ef=_[_0x90c1('0x65')](_0x3fb4ed,[_0x90c1('0x2a'),_0x38d884[_0x90c1('0x50')]]);if(!_0xded4ef){switch(_0x38d884[_0x90c1('0x50')]){case _0x90c1('0x66'):if(_0x38d884['value']==0x1){_0xa117d1[_0x90c1('0x67')]('`'+_0x38d884[_0x90c1('0x50')]+_0x90c1('0x68'));}else{_0xa117d1['having']('`'+_0x38d884[_0x90c1('0x50')]+_0x90c1('0x69'));}break;case'Contact':if(_0x38d884['operator']===_0x90c1('0x6a')){if(_0x38d884[_0x90c1('0x6b')][_0x90c1('0x30')]('\x20')[_0x90c1('0x48')]>0x1){_0x38f50a[_0x4a78ca]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x90c1('0x6c')](_0x38d884[_0x90c1('0x6b')]),null);}else{var _0x12296c='%'+_0x38d884[_0x90c1('0x6b')]+'%';_0x38f50a[_0x4a78ca]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x12296c,_0x12296c,_0x12296c);}}else{_0xded4ef=_['find'](_0x3fb4ed,[_0x90c1('0x2a'),_0x90c1('0x6d')]);_0x38d884[_0x90c1('0x50')]=_0x90c1('0x6d');_0x2d696e=as[_0x90c1('0x6e')](_0x5a7948,_0xded4ef['type'],_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e[_0x90c1('0x6f')],_0x2d696e[_0x90c1('0x6b')]['start'],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x27')]);}break;case _0x90c1('0x70'):var _0x43d513=_0x38d884['value'][_0x90c1('0x30')](',')[_0x90c1('0x2c')](function(_0xaa044c){return Number(_0xaa044c);});_0x43d513[_0x90c1('0x31')](function(_0x985223){_0x298aa2['or'](_0x90c1('0x71'),'%,'+_0x985223+',%');});_0x3cdd0c=_[_0x90c1('0x72')](_0x3cdd0c,_0x43d513);break;case'User':if(_0x38d884['operator']===_0x90c1('0x6a')){_0x38f50a[_0x4a78ca](_0x90c1('0x73'),'%'+_0x38d884['value']+'%',null);}else{_0xded4ef=_[_0x90c1('0x65')](_0x3fb4ed,[_0x90c1('0x2a'),_0x90c1('0x38')]);_0x38d884[_0x90c1('0x50')]=_0x90c1('0x38');_0x2d696e=as[_0x90c1('0x6e')](_0x5a7948,_0xded4ef['type'],_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e['text'],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x74')],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x27')]);}break;case'body':_0x2d696e=as['buildExpression']('me',null,_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e[_0x90c1('0x6f')],_0x2d696e[_0x90c1('0x6b')]['start'],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x27')]);break;}}else{var _0x2d696e=as[_0x90c1('0x6e')](_0x5a7948,_0xded4ef[_0x90c1('0x3f')],_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e[_0x90c1('0x6f')],_0x2d696e['value'][_0x90c1('0x74')],_0x2d696e['value'][_0x90c1('0x27')]);}}}else{var _0x1939a6=_(_0x916ce1[_0x90c1('0x42')])['keys']()['map'](function(_0x5b883b){return _[_0x90c1('0x75')](_0x3fb4ed,[_0x90c1('0x2a'),_0x5b883b])?_0x5b883b:undefined;})[_0x90c1('0x76')]()[_0x90c1('0x6b')]();if(!_[_0x90c1('0x77')](_0x1939a6)){_0x1939a6[_0x90c1('0x31')](function(_0xf9f88c){if(_0xf9f88c===_0x90c1('0x78')){_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x79'),[][_0x90c1('0x7a')](_0x916ce1['query'][_0xf9f88c]));}else if(_0xf9f88c==='createdAt'){var _0x46f511=JSON[_0x90c1('0x7b')](_0x916ce1['query'][_0xf9f88c])[_0x90c1('0x7c')];var _0x2d7a5d=JSON[_0x90c1('0x7b')](_0x916ce1[_0x90c1('0x42')][_0xf9f88c])[_0x90c1('0x7d')];_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x7e'),_0x46f511,_0x2d7a5d);}else{if(_0x916ce1['query'][_0xf9f88c]===_0x90c1('0x7f')){_0xa117d1[_0x90c1('0x4e')]('i.'+_0xf9f88c+_0x90c1('0x80'));}else{_0xa117d1[_0x90c1('0x4e')]('i.'+_0xf9f88c+'\x20=\x20?',_0x916ce1[_0x90c1('0x42')][_0xf9f88c]);}}});}if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x81')]){if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x81')]==0x1){_0xa117d1[_0x90c1('0x67')]('`unreadMessages`\x20=\x200');}else{_0xa117d1['having'](_0x90c1('0x82'));}}if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x83')]){_0x3cdd0c=_[_0x90c1('0x84')](_0x916ce1[_0x90c1('0x42')][_0x90c1('0x83')])?_0x916ce1['query']['tag']:new Array(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x83')]);_0x3cdd0c[_0x90c1('0x31')](function(_0x5d2e8b){_0x298aa2['or'](_0x90c1('0x71'),'%,'+_0x5d2e8b+',%');});}if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x85')]){var _0x5bd1da=_0x916ce1[_0x90c1('0x42')][_0x90c1('0x85')][_0x90c1('0x86')]('\x5c','\x5c\x5c')[_0x90c1('0x86')](/'/g,'\x27\x27');if(qs[_0x90c1('0x87')](_0x5bd1da)){_0x38f50a['or'](_0x90c1('0x88'),_0x5bd1da+'%')['or']('i.phone\x20LIKE\x20?',_0x5bd1da+'%');}else{_0x38f50a['or'](_0x90c1('0x89'),qs[_0x90c1('0x6c')](_0x5bd1da))['or'](_0x90c1('0x8a'),_0x5bd1da+'%');}}}_0xa117d1[_0x90c1('0x4e')](_0x38f50a);_0xa117d1[_0x90c1('0x8b')](_0x90c1('0x8c'));var _0x57f05d={'type':db[_0x90c1('0x8d')][_0x90c1('0x8e')][_0x90c1('0x8f')],'raw':!![]};var _0x1b71e2=_0xa117d1['clone']();_0x1b71e2[_0x90c1('0x50')](_0x90c1('0x8c'));_0x1b71e2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x90c1('0x66'));if(_0x1b3372[_0x90c1('0x4c')]){_0x1b3372[_0x90c1('0x4c')][_0x90c1('0x31')](function(_0x2c15ba){var _0x2231c7=_0x2c15ba[0x0]==='contactName'?_0x2c15ba[0x0]:'i.'+_0x2c15ba[0x0];_0xa117d1['order'](_0x2231c7,_0x2c15ba[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3cdd0c)){_0xa117d1[_0x90c1('0x67')](_0x298aa2);_0x1b71e2['where']('t.id\x20IN\x20?',_0x3cdd0c);}BPromise[_0x90c1('0x90')]()[_0x90c1('0x26')](function(){if(!_0x53d98f){if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x78')])return;_0x1b71e2[_0x90c1('0x4e')](_0x90c1('0x91'));_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x91'));return;}if(_0x916ce1[_0x90c1('0x92')][_0x90c1('0x93')]!==_0x90c1('0x94'))return;return _0x916ce1[_0x90c1('0x92')][_0x90c1('0x95')]({'attributes':['id'],'raw':!![]})[_0x90c1('0x26')](function(_0x27e909){if(_[_0x90c1('0x77')](_0x27e909)){_0x1b71e2['where'](_0x90c1('0x96'));_0xa117d1[_0x90c1('0x4e')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x1b71e2[_0x90c1('0x4e')](_0x90c1('0x79'),_[_0x90c1('0x2c')](_0x27e909,'id'));_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x79'),_['map'](_0x27e909,'id'));}});})[_0x90c1('0x26')](function(){if(_0x916ce1['user'][_0x90c1('0x93')]===_0x90c1('0x94')&&!_0x53d98f&&!_0x916ce1['query'][_0x90c1('0x78')])return[];return db[_0x90c1('0x97')][_0x90c1('0x42')](_0x1b71e2[_0x90c1('0x98')](),_0x57f05d);})[_0x90c1('0x26')](function(_0x514f1d){_0x55969f[_0x90c1('0x22')]=_0x514f1d['length'];if(_0x55969f['count']===0x0)return[];return db['sequelize'][_0x90c1('0x42')](_0x304011[_0x90c1('0x98')](),_0x57f05d)['then'](function(_0x2a21cc){_0x4bde8e=_[_0x90c1('0x99')](_0x2a21cc,'id');_0x57f05d=_[_0x90c1('0x9a')](_0x57f05d,{'model':db[_0x90c1('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x47')]){_0x1b3372[_0x90c1('0x46')]['forEach'](function(_0x5b9abf){_0xa117d1['field']('i.'+_0x5b9abf);});}else{_0xa117d1[_0x90c1('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x90c1('0x66'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0x9b'),_0x90c1('0x9c'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0x9d'),'Account.mandatoryDisposition');_0xa117d1[_0x90c1('0x50')](_0x90c1('0x9e'),_0x90c1('0x9f'));_0xa117d1['field'](_0x90c1('0xa0'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa1'),_0x90c1('0xa2'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa3'),_0x90c1('0xa4'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa5'),_0x90c1('0xa6'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa7'),_0x90c1('0xa8'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa9'),_0x90c1('0xaa'));_0xa117d1['field'](_0x90c1('0xab'),_0x90c1('0xac'));_0xa117d1[_0x90c1('0x50')]('o.fullname',_0x90c1('0xad'));_0xa117d1[_0x90c1('0x50')]('o.internal','Owner.internal');_0xa117d1['field'](_0x90c1('0xae'),'TagIds');}if(_0x1b3372[_0x90c1('0x4b')])_0xa117d1[_0x90c1('0x4b')](_0x1b3372[_0x90c1('0x4b')]);if(_0x1b3372[_0x90c1('0x20')])_0xa117d1[_0x90c1('0x20')](_0x1b3372[_0x90c1('0x20')]);return db['sequelize']['query'](_0xa117d1[_0x90c1('0x98')](),_0x57f05d);})['then'](function(_0x2d109b){if(_0x2d109b['length']>0x0)_0x23359c['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0x90c1('0x2c')](_0x2d109b,'id'));return db['sequelize'][_0x90c1('0x42')](_0x23359c[_0x90c1('0x98')](),_0x57f05d)[_0x90c1('0x26')](function(_0x3f6a68){var _0x7e5291=_[_0x90c1('0xaf')](_0x3f6a68,_0x90c1('0xb0'));var _0x4f672a=[];_0x2d109b[_0x90c1('0x31')](function(_0x48d935){_0x4f672a['push'](updateWhatsappInteraction(_0x48d935,_0x4bde8e,_0x7e5291));});return BPromise['all'](_0x4f672a);});});})['then'](function(_0x538c2f){_0x55969f['rows']=_0x538c2f;return _0x55969f;})['then'](respondWithFilteredResult(_0x8e4792,_0x1b3372))['catch'](handleError(_0x8e4792,null));};exports[_0x90c1('0xb1')]=function(_0x374380,_0x1b67a0){var _0xe3940a={'raw':![],'where':{'id':_0x374380[_0x90c1('0xb2')]['id']}},_0x56e5cf={};_0x56e5cf[_0x90c1('0x41')]=_[_0x90c1('0x43')](db[_0x90c1('0x3c')][_0x90c1('0x3d')]);_0x56e5cf[_0x90c1('0x42')]=_[_0x90c1('0x43')](_0x374380['query']);_0x56e5cf[_0x90c1('0x44')]=_[_0x90c1('0x45')](_0x56e5cf[_0x90c1('0x41')],_0x56e5cf[_0x90c1('0x42')]);_0xe3940a[_0x90c1('0x46')]=_['intersection'](_0x56e5cf['model'],qs[_0x90c1('0x47')](_0x374380[_0x90c1('0x42')][_0x90c1('0x47')]));_0xe3940a['attributes']=_0xe3940a[_0x90c1('0x46')]['length']?_0xe3940a['attributes']:_0x56e5cf[_0x90c1('0x41')];if(_0x374380['query'][_0x90c1('0xb3')]){_0xe3940a[_0x90c1('0xb4')]=[{'all':!![]}];}_0xe3940a=_[_0x90c1('0x9a')]({},_0xe3940a,_0x374380[_0x90c1('0xb5')]);return db[_0x90c1('0x3c')][_0x90c1('0x65')](_0xe3940a)[_0x90c1('0x26')](handleEntityNotFound(_0x1b67a0,null))['then'](respondWithResult(_0x1b67a0,null))[_0x90c1('0x33')](handleError(_0x1b67a0,null));};exports[_0x90c1('0xb6')]=function(_0x15fcbf,_0x456986){return db[_0x90c1('0x3c')][_0x90c1('0xb6')](_0x15fcbf[_0x90c1('0xb7')],{})[_0x90c1('0x26')](respondWithResult(_0x456986,0xc9))[_0x90c1('0x33')](handleError(_0x456986,null));};exports[_0x90c1('0x25')]=function(_0x44dd1b,_0x2ce759){if(_0x44dd1b[_0x90c1('0xb7')]['id']){delete _0x44dd1b['body']['id'];}return db[_0x90c1('0x3c')][_0x90c1('0x65')]({'where':{'id':_0x44dd1b['params']['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x2ce759,null))[_0x90c1('0x26')](saveUpdates(_0x44dd1b[_0x90c1('0xb7')],null))[_0x90c1('0x26')](respondWithResult(_0x2ce759,null))['catch'](handleError(_0x2ce759,null));};exports[_0x90c1('0xb8')]=function(_0x3b6f03,_0x247af3){return db['WhatsappInteraction'][_0x90c1('0x65')]({'where':{'id':_0x3b6f03['params']['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x247af3,null))[_0x90c1('0x26')](removeEntity(_0x247af3,null))[_0x90c1('0x33')](handleError(_0x247af3,null));};exports[_0x90c1('0xb9')]=function(_0x506ca9,_0x5eae13){return db[_0x90c1('0x3c')][_0x90c1('0xb9')]()[_0x90c1('0x26')](respondWithResult(_0x5eae13,null))['catch'](handleError(_0x5eae13,null));};exports[_0x90c1('0xba')]=function(_0x5b3b15,_0x22458f,_0x2f8553){return db[_0x90c1('0xbb')]['find']({'where':{'id':_0x5b3b15[_0x90c1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x22458f,null))['then'](function(_0x54ec71){if(_0x54ec71){return _0x54ec71[_0x90c1('0xba')](_0x5b3b15['body'][_0x90c1('0xbc')],_['omit'](_0x5b3b15[_0x90c1('0xb7')],[_0x90c1('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x22458f,null))['catch'](handleError(_0x22458f,null));};exports[_0x90c1('0xbd')]=function(_0x52c3be,_0x17539a,_0x6c1b40){var _0x1cb90e={'raw':![],'where':{}};var _0x21e3d5={};var _0x24816b={'count':0x0,'rows':[]};return db[_0x90c1('0x3c')][_0x90c1('0xbe')]({'where':{'id':_0x52c3be['params']['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x17539a,null))[_0x90c1('0x26')](function(_0x504f1d){if(_0x504f1d){_0x21e3d5[_0x90c1('0x41')]=_[_0x90c1('0x43')](db[_0x90c1('0xbb')]['rawAttributes']);_0x21e3d5[_0x90c1('0x42')]=_[_0x90c1('0x43')](_0x52c3be[_0x90c1('0x42')]);_0x21e3d5[_0x90c1('0x44')]=_[_0x90c1('0x45')](_0x21e3d5[_0x90c1('0x41')],_0x21e3d5[_0x90c1('0x42')]);_0x1cb90e[_0x90c1('0x46')]=_[_0x90c1('0x45')](_0x21e3d5[_0x90c1('0x41')],qs[_0x90c1('0x47')](_0x52c3be[_0x90c1('0x42')][_0x90c1('0x47')]));_0x1cb90e[_0x90c1('0x46')]=_0x1cb90e[_0x90c1('0x46')][_0x90c1('0x48')]?_0x1cb90e[_0x90c1('0x46')]:_0x21e3d5[_0x90c1('0x41')];if(!_0x52c3be[_0x90c1('0x42')]['hasOwnProperty'](_0x90c1('0x4a'))){_0x1cb90e['limit']=qs[_0x90c1('0x4b')](_0x52c3be[_0x90c1('0x42')][_0x90c1('0x4b')]);_0x1cb90e[_0x90c1('0x20')]=qs[_0x90c1('0x20')](_0x52c3be['query'][_0x90c1('0x20')]);}_0x1cb90e[_0x90c1('0x4c')]=qs['sort'](_0x52c3be[_0x90c1('0x42')][_0x90c1('0x4d')]);_0x1cb90e[_0x90c1('0x4e')]=qs[_0x90c1('0x44')](_[_0x90c1('0x4f')](_0x52c3be['query'],_0x21e3d5[_0x90c1('0x44')]));_0x1cb90e['where'][_0x90c1('0xb0')]=_0x504f1d['id'];if(_0x52c3be[_0x90c1('0x42')][_0x90c1('0x85')]){_0x1cb90e[_0x90c1('0x4e')]=_['merge'](_0x1cb90e['where'],{'$or':_['map'](_0x1cb90e['attributes'],function(_0x21f88f){var _0x433d6f={};_0x433d6f[_0x21f88f]={'$like':'%'+_0x52c3be[_0x90c1('0x42')][_0x90c1('0x85')]+'%'};return _0x433d6f;})});}if(_0x52c3be['query'][_0x90c1('0x7c')]){var _0x18b29a=_0x52c3be[_0x90c1('0x42')][_0x90c1('0x7c')][_0x90c1('0x30')](',');var _0x5e9923={};_0x5e9923[_0x18b29a[0x0]]={'$gte':moment(_0x18b29a[0x1])[_0x90c1('0xbf')](_0x90c1('0xc0'))};_0x1cb90e[_0x90c1('0x4e')]=_['merge'](_0x1cb90e[_0x90c1('0x4e')],_0x5e9923);}_0x1cb90e=_[_0x90c1('0x9a')]({},_0x1cb90e,_0x52c3be[_0x90c1('0xb5')]);return db[_0x90c1('0xbb')][_0x90c1('0x22')]({'where':_0x1cb90e[_0x90c1('0x4e')]})[_0x90c1('0x26')](function(_0x2130f4){_0x24816b['count']=_0x2130f4;if(_0x52c3be['query'][_0x90c1('0xb3')]){_0x1cb90e[_0x90c1('0xb4')]=[{'all':!![]}];}return db[_0x90c1('0xbb')][_0x90c1('0xc1')](_0x1cb90e);})[_0x90c1('0x26')](function(_0x149b98){_0x24816b[_0x90c1('0xc2')]=_0x149b98;return _0x24816b;});}})[_0x90c1('0x26')](respondWithFilteredResult(_0x17539a,_0x1cb90e))[_0x90c1('0x33')](handleError(_0x17539a,null));};exports[_0x90c1('0xc3')]=function(_0x31cc49,_0x53218c,_0x5671ff){return db[_0x90c1('0x3c')][_0x90c1('0x65')]({'where':{'id':_0x31cc49['params']['id']}})['then'](handleEntityNotFound(_0x53218c,null))[_0x90c1('0x26')](function(_0x5911ab){if(_0x5911ab){return _0x5911ab[_0x90c1('0xc4')](_0x31cc49[_0x90c1('0xb7')][_0x90c1('0xbc')],_[_0x90c1('0xc5')](_0x31cc49[_0x90c1('0xb7')],['ids','id'])||{})[_0x90c1('0xc6')](function(){return db[_0x90c1('0x70')][_0x90c1('0xc1')]({'attributes':['id',_0x90c1('0x2a'),_0x90c1('0x51')],'where':{'id':_0x31cc49['body'][_0x90c1('0xbc')]}});})[_0x90c1('0x26')](function(_0x4a9148){socket[_0x90c1('0xc7')](_0x90c1('0xc8'),{'id':Number(_0x31cc49['params']['id']),'tags':_0x4a9148||[]});return{'id':Number(_0x31cc49['params']['id']),'tags':_0x4a9148||[]};});}})[_0x90c1('0x26')](respondWithResult(_0x53218c,null))[_0x90c1('0x33')](handleError(_0x53218c,null));};exports[_0x90c1('0xc9')]=function(_0x15a9c6,_0x1994f8,_0x4660fa){return db[_0x90c1('0x3c')]['find']({'where':{'id':_0x15a9c6[_0x90c1('0xb2')]['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x1994f8,null))[_0x90c1('0x26')](function(_0x550ae5){if(_0x550ae5){return _0x550ae5[_0x90c1('0xc9')](_0x15a9c6[_0x90c1('0x42')][_0x90c1('0xbc')]);}})[_0x90c1('0x26')](respondWithStatusCode(_0x1994f8,null))[_0x90c1('0x33')](handleError(_0x1994f8,null));};exports['download']=function(_0x39f2cd,_0x385a82){var _0x3d688f=moment()[_0x90c1('0xca')]()[_0x90c1('0x98')]();var _0x2b1dfe=path[_0x90c1('0xcb')](config['root'],'server',_0x90c1('0xcc'),_0x90c1('0xcd'));var _0x2aaca6=path[_0x90c1('0xcb')](config[_0x90c1('0xce')],_0x90c1('0xcf'),_0x90c1('0xcc'),'attachments');var _0x382a51=path['join'](_0x2b1dfe,_0x3d688f);var _0x4138dc=util['format']('transcript-%d-%s.zip',_0x39f2cd['params']['id'],_0x3d688f);var _0x46461f=path[_0x90c1('0xcb')](_0x2b1dfe,_0x4138dc);var _0x32b274=[];_0x32b274[_0x90c1('0x32')]({'model':db[_0x90c1('0xd0')],'as':_0x90c1('0xd0'),'attributes':['id','fullname'],'raw':!![]});_0x32b274[_0x90c1('0x32')]({'model':db[_0x90c1('0xd1')],'as':'Contact','attributes':['id',_0x90c1('0xd2'),'lastName'],'raw':!![]});if(_0x39f2cd[_0x90c1('0x42')][_0x90c1('0xd3')]){_0x32b274[_0x90c1('0x32')]({'model':db[_0x90c1('0xd4')],'as':_0x90c1('0xd4'),'raw':!![]});}var _0x599e02=[{'model':db[_0x90c1('0xbb')],'as':_0x90c1('0xd5'),'attributes':['id',_0x90c1('0xb7'),_0x90c1('0xd6'),_0x90c1('0xd7'),_0x90c1('0xd8'),_0x90c1('0x81')],'include':_0x32b274}];_0x599e02[_0x90c1('0x32')]({'model':db[_0x90c1('0xd9')],'as':'Account','attributes':['id',_0x90c1('0x2a')]});_0x599e02[_0x90c1('0x32')]({'model':db[_0x90c1('0xd0')],'as':_0x90c1('0xda'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x90c1('0x65')]({'where':{'id':_0x39f2cd[_0x90c1('0xb2')]['id']},'include':_0x599e02})[_0x90c1('0x26')](handleEntityNotFound(_0x385a82,null))[_0x90c1('0x26')](function(_0x17eec9){if(_0x17eec9){var _0x5e6557=_0x17eec9['get']({'plain':!![]});fs[_0x90c1('0xdb')](_0x382a51);var _0x31e6c9={'channel':_0x90c1('0xdc'),'account':_0x5e6557[_0x90c1('0xdd')][_0x90c1('0x2a')],'agent':_0x5e6557[_0x90c1('0xda')]?_0x5e6557['Owner'][_0x90c1('0x2d')]:_0x90c1('0xde'),'createdAt':moment(_0x5e6557[_0x90c1('0xd6')])[_0x90c1('0xbf')](_0x90c1('0xc0'))[_0x90c1('0x98')](),'closedAt':_0x5e6557[_0x90c1('0x37')]?moment(_0x5e6557[_0x90c1('0xdf')])[_0x90c1('0xbf')](_0x90c1('0xc0'))['toString']():'','disposition':_0x5e6557[_0x90c1('0xe0')],'messages':_(_0x5e6557[_0x90c1('0xd5')])[_0x90c1('0x85')]({'secret':![]})[_0x90c1('0x2c')](function(_0x26f005){if(_0x26f005['Attachment']){var _0x280894=path[_0x90c1('0xcb')](_0x2aaca6,_0x26f005[_0x90c1('0xd4')][_0x90c1('0xe1')]);if(fs[_0x90c1('0xe2')](_0x280894)){fs[_0x90c1('0xe3')](_0x280894)[_0x90c1('0xe4')](fs[_0x90c1('0xe5')](path[_0x90c1('0xcb')](_0x382a51,_0x26f005[_0x90c1('0xd4')][_0x90c1('0xe1')])));}}return{'date':moment(_0x26f005[_0x90c1('0xd6')])[_0x90c1('0xbf')](_0x90c1('0xc0'))['toString'](),'sender':_0x26f005[_0x90c1('0xd7')]==='out'?_0x26f005[_0x90c1('0xd0')]?_0x26f005['User'][_0x90c1('0x2d')]:_0x90c1('0xe6'):_0x26f005['Contact'][_0x90c1('0xd2')]+(_0x26f005[_0x90c1('0xe7')]['lastName']?'\x20'+_0x26f005[_0x90c1('0xe7')][_0x90c1('0xe8')]:''),'body':_0x26f005[_0x90c1('0xd4')]?_0x26f005['Attachment'][_0x90c1('0xe1')]:_0x26f005['body'],'direction':_0x26f005[_0x90c1('0xd7')]==='out'?'A':'C','secret':_0x26f005[_0x90c1('0xd8')],'read':_0x26f005[_0x90c1('0x81')],'attachment':_0x26f005[_0x90c1('0xd4')]};})[_0x90c1('0x6b')]()};return ejs[_0x90c1('0xe9')](path['join'](config[_0x90c1('0xce')],_0x90c1('0xcf'),'views',_0x90c1('0xea')),{'interaction':_0x31e6c9})[_0x90c1('0x26')](function(_0x43691c){var _0x338fa1=path[_0x90c1('0xcb')](_0x382a51,'transcript-'+_0x5e6557['id']+'-'+_0x3d688f+_0x90c1('0xeb'));var _0x2baed5={'path':_0x338fa1,'channel':'Whatsapp','interactionId':_0x5e6557['id']};return pdf[_0x90c1('0xec')](_0x43691c,_0x2baed5);})[_0x90c1('0x26')](function(){return new BPromise(function(_0x2ffbce,_0x58e4d5){zipdir(_0x382a51,{'saveTo':_0x46461f},function(_0x100e4d,_0x33e00c){if(_0x100e4d)return _0x58e4d5(_0x100e4d);return _0x2ffbce(_0x33e00c);});})['then'](function(){return new BPromise(function(_0x3f5f3e,_0x251c7e){rimraf(_0x382a51,function(_0x1f0d68){if(_0x1f0d68)_0x251c7e(_0x1f0d68);return _0x3f5f3e();});});})[_0x90c1('0x26')](function(){return _0x385a82[_0x90c1('0xed')](_0x46461f,_0x4138dc,function(_0x1cbb30){if(_0x1cbb30){console[_0x90c1('0xee')](_0x90c1('0xef'),_0x1cbb30);}else{fs[_0x90c1('0xf0')](_0x46461f);}});});});}else{return _0x385a82[_0x90c1('0x1d')](0xc8);}})[_0x90c1('0x33')](handleError(_0x385a82,null));}; \ No newline at end of file +var _0xf970=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','unmanaged','total','closed','UserId','WhatsappInteraction','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','User','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','parse','$gte','$lte','where','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','rows','show','includeAll','include','merge','options','create','body','params','describe','addMessage','ids','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','findAll','emit','removeTags','download','join','server','files','root','transcript-%d-%s.zip','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','Owner','get','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format'];(function(_0x5b15df,_0x1d1537){var _0xa6a7a5=function(_0x2d1043){while(--_0x2d1043){_0x5b15df['push'](_0x5b15df['shift']());}};_0xa6a7a5(++_0x1d1537);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0f97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f97('0x1'));var jsonpatch=require(_0x0f97('0x2'));var rp=require(_0x0f97('0x3'));var moment=require(_0x0f97('0x4'));var BPromise=require(_0x0f97('0x5'));var Mustache=require(_0x0f97('0x6'));var util=require(_0x0f97('0x7'));var path=require('path');var sox=require(_0x0f97('0x8'));var csv=require(_0x0f97('0x9'));var ejs=require(_0x0f97('0xa'));var fs=require('fs');var fs_extra=require(_0x0f97('0xb'));var _=require(_0x0f97('0xc'));var squel=require(_0x0f97('0xd'));var crypto=require(_0x0f97('0xe'));var jsforce=require(_0x0f97('0xf'));var deskjs=require(_0x0f97('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0f97('0x11'));var Redis=require('ioredis');var authService=require(_0x0f97('0x12'));var qs=require(_0x0f97('0x13'));var as=require(_0x0f97('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x0f97('0x15'));var logger=require('../../config/logger')(_0x0f97('0x16'));var utils=require(_0x0f97('0x17'));var config=require(_0x0f97('0x18'));var licenseUtil=require(_0x0f97('0x19'));var db=require(_0x0f97('0x1a'))['db'];config['redis']=_[_0x0f97('0x1b')](config[_0x0f97('0x1c')],{'host':_0x0f97('0x1d'),'port':0x18eb});var socket=require(_0x0f97('0x1e'))(new Redis(config[_0x0f97('0x1c')]));require(_0x0f97('0x1f'))[_0x0f97('0x20')](socket);function respondWithStatusCode(_0x54f205,_0x4c34fc){_0x4c34fc=_0x4c34fc||0xcc;return function(_0x2a1fb8){if(_0x2a1fb8){return _0x54f205[_0x0f97('0x21')](_0x4c34fc);}return _0x54f205[_0x0f97('0x22')](_0x4c34fc)[_0x0f97('0x23')]();};}function respondWithResult(_0x5e3f3a,_0x58cb79){_0x58cb79=_0x58cb79||0xc8;return function(_0x336f61){if(_0x336f61){return _0x5e3f3a[_0x0f97('0x22')](_0x58cb79)[_0x0f97('0x24')](_0x336f61);}};}function respondWithFilteredResult(_0x185ba3,_0xae246){return function(_0x208f6b){if(_0x208f6b){var _0x5059ad=typeof _0xae246['offset']===_0x0f97('0x25')&&typeof _0xae246[_0x0f97('0x26')]===_0x0f97('0x25');var _0x425d97=_0x208f6b[_0x0f97('0x27')];var _0x3a91b4=_0x5059ad?0x0:_0xae246['offset'];var _0x27b771=_0x5059ad?_0x208f6b[_0x0f97('0x27')]:_0xae246[_0x0f97('0x28')]+_0xae246[_0x0f97('0x26')];var _0x13c7ed;if(_0x27b771>=_0x425d97){_0x27b771=_0x425d97;_0x13c7ed=0xc8;}else{_0x13c7ed=0xce;}_0x185ba3[_0x0f97('0x22')](_0x13c7ed);return _0x185ba3[_0x0f97('0x29')]('Content-Range',_0x3a91b4+'-'+_0x27b771+'/'+_0x425d97)[_0x0f97('0x24')](_0x208f6b);}return null;};}function patchUpdates(_0x2201d4){return function(_0xf2dab8){try{jsonpatch['apply'](_0xf2dab8,_0x2201d4,!![]);}catch(_0x31d384){return BPromise[_0x0f97('0x2a')](_0x31d384);}return _0xf2dab8['save']();};}function saveUpdates(_0xb5721e,_0x15df5c){return function(_0x4ef5bc){if(_0x4ef5bc){return _0x4ef5bc['update'](_0xb5721e)['then'](function(_0x406e24){return _0x406e24;});}return null;};}function removeEntity(_0x22eb53,_0x5247ad){return function(_0x8ef8c4){if(_0x8ef8c4){return _0x8ef8c4[_0x0f97('0x2b')]()[_0x0f97('0x2c')](function(){_0x22eb53[_0x0f97('0x22')](0xcc)[_0x0f97('0x23')]();});}};}function handleEntityNotFound(_0x23f078,_0x51a376){return function(_0x164ad6){if(!_0x164ad6){_0x23f078[_0x0f97('0x21')](0x194);}return _0x164ad6;};}function handleError(_0x3f4922,_0x37d7c9){_0x37d7c9=_0x37d7c9||0x1f4;return function(_0x4fe728){logger[_0x0f97('0x2d')](_0x4fe728[_0x0f97('0x2e')]);if(_0x4fe728[_0x0f97('0x2f')]){delete _0x4fe728[_0x0f97('0x2f')];}_0x3f4922[_0x0f97('0x22')](_0x37d7c9)[_0x0f97('0x30')](_0x4fe728);};}function getInteractionUsers(_0x2aeef8,_0x28ba36){return new BPromise(function(_0x51de2e,_0x481654){try{if(_0x28ba36[_0x2aeef8['id']]){_0x2aeef8[_0x0f97('0x31')]=_[_0x0f97('0x32')](_0x28ba36[_0x2aeef8['id']],function(_0x2fa2a7){return{'id':_0x2fa2a7['id'],'fullname':_0x2fa2a7[_0x0f97('0x33')]};});}}catch(_0x25bd0e){_0x481654(_0x25bd0e);}_0x51de2e(_0x2aeef8);});}function getInteractionTags(_0x405062,_0x17f244){return new BPromise(function(_0x46e0b4,_0x139c8a){try{if(_0x405062[_0x0f97('0x34')]){_0x405062[_0x0f97('0x35')]=[];_0x405062['TagIds'][_0x0f97('0x36')](',')[_0x0f97('0x37')](function(_0xe2526c){_0x405062[_0x0f97('0x35')][_0x0f97('0x38')](_0x17f244[_0xe2526c]);});}delete _0x405062['TagIds'];}catch(_0x1ba047){_0x139c8a(_0x1ba047);}_0x46e0b4(_0x405062);});}function updateWhatsappInteraction(_0x4e1471,_0x2f85f5,_0x5dc775){return new BPromise(function(_0x4037b2,_0xf86a26){return getInteractionUsers(_0x4e1471,_0x5dc775)[_0x0f97('0x2c')](function(_0x44ad1b){return getInteractionTags(_0x44ad1b,_0x2f85f5);})[_0x0f97('0x2c')](function(_0x5cfdf1){return getStateInteraction(_0x5cfdf1);})['then'](function(_0x133f74){_0x4037b2(_0x133f74);})[_0x0f97('0x39')](function(_0x595adf){_0xf86a26(_0x595adf);});});}function getStateInteraction(_0xfa6702){return new BPromise(function(_0x184e05){_0xfa6702[_0x0f97('0x3a')]=0x0;_0xfa6702[_0x0f97('0x3b')]=0x0;_0xfa6702['answered']=0x0;_0xfa6702[_0x0f97('0x3c')]=0x0;_0xfa6702[_0x0f97('0x3d')]=0x0;if(!_0xfa6702[_0x0f97('0x3e')]&&!_0xfa6702[_0x0f97('0x3f')]){_0xfa6702[_0x0f97('0x3a')]+=0x1;}if(!_0xfa6702['closed']&&_0xfa6702[_0x0f97('0x3f')]){_0xfa6702[_0x0f97('0x3b')]+=0x1;if(_0xfa6702[_0x0f97('0x3a')]){_0xfa6702[_0x0f97('0x3a')]-=0x1;}}if(_0xfa6702[_0x0f97('0x3e')]&&_0xfa6702[_0x0f97('0x3f')]){_0xfa6702['answered']+=0x1;if(_0xfa6702['talking']){_0xfa6702[_0x0f97('0x3b')]-=0x1;}}if(_0xfa6702[_0x0f97('0x3e')]&&!_0xfa6702[_0x0f97('0x3f')]){_0xfa6702['unmanaged']+=0x1;if(_0xfa6702[_0x0f97('0x3a')]){_0xfa6702[_0x0f97('0x3a')]-=0x1;}}_0xfa6702[_0x0f97('0x3d')]+=0x1;_0x184e05(_0xfa6702);});}exports['index']=function(_0x18aae7,_0x1de27e){var _0x1abb7e={},_0x679aea={},_0x3c84f7={'count':0x0,'rows':[]};var _0x1dc76d=_[_0x0f97('0x32')](db[_0x0f97('0x40')][_0x0f97('0x41')],function(_0x79aa92){return{'name':_0x79aa92[_0x0f97('0x42')],'type':_0x79aa92['type'][_0x0f97('0x43')]};});_0x679aea[_0x0f97('0x44')]=_['map'](_0x1dc76d,_0x0f97('0x2f'));_0x679aea['query']=_[_0x0f97('0x45')](_0x18aae7[_0x0f97('0x46')]);_0x679aea[_0x0f97('0x47')]=_['intersection'](_0x679aea['model'],_0x679aea[_0x0f97('0x46')]);_0x1abb7e[_0x0f97('0x48')]=_[_0x0f97('0x49')](_0x679aea[_0x0f97('0x44')],qs[_0x0f97('0x4a')](_0x18aae7['query']['fields']));_0x1abb7e[_0x0f97('0x48')]=_0x1abb7e[_0x0f97('0x48')][_0x0f97('0x4b')]?_0x1abb7e[_0x0f97('0x48')]:_0x679aea[_0x0f97('0x44')];if(!_0x18aae7[_0x0f97('0x46')][_0x0f97('0x4c')](_0x0f97('0x4d'))){_0x1abb7e[_0x0f97('0x26')]=qs['limit'](_0x18aae7[_0x0f97('0x46')]['limit']);_0x1abb7e[_0x0f97('0x28')]=qs[_0x0f97('0x28')](_0x18aae7[_0x0f97('0x46')]['offset']);}_0x1abb7e['order']=qs[_0x0f97('0x4e')](_0x18aae7[_0x0f97('0x46')][_0x0f97('0x4e')]);_0x1abb7e['where']=qs['filters'](_['pick'](_0x18aae7[_0x0f97('0x46')],_0x679aea[_0x0f97('0x47')]),_0x1dc76d);var _0x1871b6=[];var _0xf95e68=squel[_0x0f97('0x4f')]()[_0x0f97('0x50')]('id')[_0x0f97('0x50')](_0x0f97('0x2f'))[_0x0f97('0x50')](_0x0f97('0x51'))[_0x0f97('0x52')]('tools_tags');var _0xbc30c6=squel['select']()['field'](_0x0f97('0x53'))['field'](_0x0f97('0x54'))[_0x0f97('0x50')](_0x0f97('0x55'))[_0x0f97('0x52')](_0x0f97('0x56'),'ui')['left_join']('users','u',_0x0f97('0x57'));var _0xf5fedc=squel['select']()[_0x0f97('0x52')](_0x0f97('0x58'),'i')[_0x0f97('0x59')](_0x0f97('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0f97('0x59')](_0x0f97('0x5b'),'o',_0x0f97('0x5c'))[_0x0f97('0x59')](_0x0f97('0x5d'),'a',_0x0f97('0x5e'))[_0x0f97('0x59')](_0x0f97('0x5f'),'me',_0x0f97('0x60'))[_0x0f97('0x59')](_0x0f97('0x61'),'it',_0x0f97('0x62'))[_0x0f97('0x59')](_0x0f97('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1b757a=squel['expr']();var _0x2444e3=[];var _0x21ae61=squel[_0x0f97('0x64')]();var _0x5716c5;if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x65')]){_0x5716c5=as[_0x0f97('0x66')](_0x18aae7['query']['search']);var _0x5f0f31=_0x5716c5['sqlOperator'];for(var _0x375285=0x0;_0x375285<_0x5716c5[_0x0f97('0x67')][_0x0f97('0x4b')];_0x375285++){var _0x4c71b9=_0x5716c5[_0x0f97('0x67')][_0x375285];var _0x52a2ed='i';var _0x2285ba=_[_0x0f97('0x68')](_0x1dc76d,[_0x0f97('0x2f'),_0x4c71b9[_0x0f97('0x50')]]);if(!_0x2285ba){switch(_0x4c71b9[_0x0f97('0x50')]){case _0x0f97('0x69'):if(_0x4c71b9[_0x0f97('0x6a')]==0x1){_0xf5fedc[_0x0f97('0x6b')]('`'+_0x4c71b9[_0x0f97('0x50')]+'`\x20=\x200');}else{_0xf5fedc[_0x0f97('0x6b')]('`'+_0x4c71b9[_0x0f97('0x50')]+_0x0f97('0x6c'));}break;case _0x0f97('0x6d'):if(_0x4c71b9[_0x0f97('0x6e')]===_0x0f97('0x6f')){if(_0x4c71b9[_0x0f97('0x6a')][_0x0f97('0x36')]('\x20')['length']>0x1){_0x1b757a[_0x5f0f31](_0x0f97('0x70'),qs[_0x0f97('0x71')](_0x4c71b9['value']),null);}else{var _0x35d089='%'+_0x4c71b9[_0x0f97('0x6a')]+'%';_0x1b757a[_0x5f0f31](_0x0f97('0x72'),_0x35d089,_0x35d089,_0x35d089);}}else{_0x2285ba=_[_0x0f97('0x68')](_0x1dc76d,['name',_0x0f97('0x73')]);_0x4c71b9[_0x0f97('0x50')]=_0x0f97('0x73');_0x4b1bce=as[_0x0f97('0x74')](_0x52a2ed,_0x2285ba[_0x0f97('0x75')],_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x77')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x23')]);}break;case _0x0f97('0x78'):var _0xeddf70=_0x4c71b9[_0x0f97('0x6a')][_0x0f97('0x36')](',')['map'](function(_0x2e7c3a){return Number(_0x2e7c3a);});_0xeddf70[_0x0f97('0x37')](function(_0x359f6b){_0x21ae61['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x359f6b+',%');});_0x2444e3=_['union'](_0x2444e3,_0xeddf70);break;case _0x0f97('0x79'):if(_0x4c71b9['operator']===_0x0f97('0x6f')){_0x1b757a[_0x5f0f31]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c71b9[_0x0f97('0x6a')]+'%',null);}else{_0x2285ba=_['find'](_0x1dc76d,[_0x0f97('0x2f'),'UserId']);_0x4c71b9[_0x0f97('0x50')]=_0x0f97('0x3f');_0x4b1bce=as[_0x0f97('0x74')](_0x52a2ed,_0x2285ba[_0x0f97('0x75')],_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')]['start'],_0x4b1bce['value'][_0x0f97('0x23')]);}break;case'body':_0x4b1bce=as[_0x0f97('0x74')]('me',null,_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')]['start'],_0x4b1bce['value'][_0x0f97('0x23')]);break;}}else{var _0x4b1bce=as['buildExpression'](_0x52a2ed,_0x2285ba[_0x0f97('0x75')],_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x77')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x23')]);}}}else{var _0x294ac8=_(_0x18aae7[_0x0f97('0x46')])[_0x0f97('0x45')]()['map'](function(_0x568116){return _['some'](_0x1dc76d,[_0x0f97('0x2f'),_0x568116])?_0x568116:undefined;})['compact']()[_0x0f97('0x6a')]();if(!_[_0x0f97('0x7a')](_0x294ac8)){_0x294ac8[_0x0f97('0x37')](function(_0x361504){if(_0x361504===_0x0f97('0x7b')){_0xf5fedc['where'](_0x0f97('0x7c'),[]['concat'](_0x18aae7[_0x0f97('0x46')][_0x361504]));}else if(_0x361504==='createdAt'){var _0x568821=JSON[_0x0f97('0x7d')](_0x18aae7[_0x0f97('0x46')][_0x361504])[_0x0f97('0x7e')];var _0x599011=JSON[_0x0f97('0x7d')](_0x18aae7[_0x0f97('0x46')][_0x361504])[_0x0f97('0x7f')];_0xf5fedc[_0x0f97('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x568821,_0x599011);}else{if(_0x18aae7[_0x0f97('0x46')][_0x361504]==='null'){_0xf5fedc[_0x0f97('0x80')]('i.'+_0x361504+_0x0f97('0x81'));}else{_0xf5fedc['where']('i.'+_0x361504+'\x20=\x20?',_0x18aae7[_0x0f97('0x46')][_0x361504]);}}});}if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x82')]){if(_0x18aae7[_0x0f97('0x46')]['read']==0x1){_0xf5fedc['having'](_0x0f97('0x83'));}else{_0xf5fedc[_0x0f97('0x6b')](_0x0f97('0x84'));}}if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x85')]){_0x2444e3=_[_0x0f97('0x86')](_0x18aae7['query'][_0x0f97('0x85')])?_0x18aae7[_0x0f97('0x46')][_0x0f97('0x85')]:new Array(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x85')]);_0x2444e3[_0x0f97('0x37')](function(_0x57b810){_0x21ae61['or'](_0x0f97('0x87'),'%,'+_0x57b810+',%');});}if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x88')]){var _0x393fe7=_0x18aae7[_0x0f97('0x46')][_0x0f97('0x88')][_0x0f97('0x89')]('\x5c','\x5c\x5c')[_0x0f97('0x89')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x393fe7)){_0x1b757a['or'](_0x0f97('0x8a'),_0x393fe7+'%')['or'](_0x0f97('0x8b'),_0x393fe7+'%');}else{_0x1b757a['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x393fe7))['or'](_0x0f97('0x8c'),_0x393fe7+'%');}}}_0xf5fedc['where'](_0x1b757a);_0xf5fedc[_0x0f97('0x8d')](_0x0f97('0x8e'));var _0xe654d5={'type':db['Sequelize'][_0x0f97('0x8f')][_0x0f97('0x90')],'raw':!![]};var _0x16071d=_0xf5fedc[_0x0f97('0x91')]();_0x16071d[_0x0f97('0x50')](_0x0f97('0x8e'));_0x16071d[_0x0f97('0x50')](_0x0f97('0x92'),_0x0f97('0x69'));if(_0x1abb7e['order']){_0x1abb7e[_0x0f97('0x93')][_0x0f97('0x37')](function(_0x2042df){var _0x46d7c0=_0x2042df[0x0]===_0x0f97('0x94')?_0x2042df[0x0]:'i.'+_0x2042df[0x0];_0xf5fedc['order'](_0x46d7c0,_0x2042df[0x1]===_0x0f97('0x95')?![]:!![]);});}if(!_[_0x0f97('0x7a')](_0x2444e3)){_0xf5fedc['having'](_0x21ae61);_0x16071d[_0x0f97('0x80')]('t.id\x20IN\x20?',_0x2444e3);}BPromise[_0x0f97('0x96')]()['then'](function(){if(!_0x5716c5){if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x7b')])return;_0x16071d['where'](_0x0f97('0x97'));_0xf5fedc['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x18aae7['user'][_0x0f97('0x98')]!==_0x0f97('0x99'))return;return _0x18aae7[_0x0f97('0x9a')][_0x0f97('0x9b')]({'attributes':['id'],'raw':!![]})[_0x0f97('0x2c')](function(_0x40897e){if(_[_0x0f97('0x7a')](_0x40897e)){_0x16071d[_0x0f97('0x80')](_0x0f97('0x9c'));_0xf5fedc[_0x0f97('0x80')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x16071d[_0x0f97('0x80')](_0x0f97('0x7c'),_[_0x0f97('0x32')](_0x40897e,'id'));_0xf5fedc['where'](_0x0f97('0x7c'),_[_0x0f97('0x32')](_0x40897e,'id'));}});})['then'](function(){if(_0x18aae7[_0x0f97('0x9a')][_0x0f97('0x98')]===_0x0f97('0x99')&&!_0x5716c5&&!_0x18aae7[_0x0f97('0x46')][_0x0f97('0x7b')])return[];return db[_0x0f97('0x9d')][_0x0f97('0x46')](_0x16071d[_0x0f97('0x9e')](),_0xe654d5);})[_0x0f97('0x2c')](function(_0x445892){_0x3c84f7[_0x0f97('0x27')]=_0x445892[_0x0f97('0x4b')];if(_0x3c84f7[_0x0f97('0x27')]===0x0)return[];return db[_0x0f97('0x9d')][_0x0f97('0x46')](_0xf95e68[_0x0f97('0x9e')](),_0xe654d5)[_0x0f97('0x2c')](function(_0x18dded){_0x1871b6=_['keyBy'](_0x18dded,'id');_0xe654d5=_['merge'](_0xe654d5,{'model':db[_0x0f97('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18aae7['query'][_0x0f97('0x4a')]){_0x1abb7e[_0x0f97('0x48')][_0x0f97('0x37')](function(_0xc2f752){_0xf5fedc[_0x0f97('0x50')]('i.'+_0xc2f752);});}else{_0xf5fedc['field'](_0x0f97('0x92'),_0x0f97('0x69'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0x9f'),'Account.key');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa0'),'Account.mandatoryDisposition');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa1'),'contactName');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa2'));_0xf5fedc['field'](_0x0f97('0xa3'),'Contact.firstName');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa4'),'Contact.lastName');_0xf5fedc[_0x0f97('0x50')]('c.email',_0x0f97('0xa5'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa6'),_0x0f97('0xa7'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa8'),_0x0f97('0xa9'));_0xf5fedc[_0x0f97('0x50')]('c.fax',_0x0f97('0xaa'));_0xf5fedc[_0x0f97('0x50')]('o.fullname',_0x0f97('0xab'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xac'),_0x0f97('0xad'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xae'),_0x0f97('0x34'));}if(_0x1abb7e[_0x0f97('0x26')])_0xf5fedc['limit'](_0x1abb7e[_0x0f97('0x26')]);if(_0x1abb7e[_0x0f97('0x28')])_0xf5fedc[_0x0f97('0x28')](_0x1abb7e[_0x0f97('0x28')]);return db['sequelize']['query'](_0xf5fedc[_0x0f97('0x9e')](),_0xe654d5);})[_0x0f97('0x2c')](function(_0x34d326){if(_0x34d326[_0x0f97('0x4b')]>0x0)_0xbc30c6[_0x0f97('0x80')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x0f97('0x32')](_0x34d326,'id'));return db[_0x0f97('0x9d')][_0x0f97('0x46')](_0xbc30c6['toString'](),_0xe654d5)[_0x0f97('0x2c')](function(_0x1c3338){var _0x20f089=_[_0x0f97('0xaf')](_0x1c3338,_0x0f97('0xb0'));var _0x21fcf2=[];_0x34d326[_0x0f97('0x37')](function(_0xfd416d){_0x21fcf2[_0x0f97('0x38')](updateWhatsappInteraction(_0xfd416d,_0x1871b6,_0x20f089));});return BPromise['all'](_0x21fcf2);});});})[_0x0f97('0x2c')](function(_0x542d4e){_0x3c84f7[_0x0f97('0xb1')]=_0x542d4e;return _0x3c84f7;})['then'](respondWithFilteredResult(_0x1de27e,_0x1abb7e))['catch'](handleError(_0x1de27e,null));};exports[_0x0f97('0xb2')]=function(_0x2895f5,_0x452693){var _0x200d9b={'raw':![],'where':{'id':_0x2895f5['params']['id']}},_0x16f78c={};_0x16f78c[_0x0f97('0x44')]=_['keys'](db[_0x0f97('0x40')][_0x0f97('0x41')]);_0x16f78c[_0x0f97('0x46')]=_['keys'](_0x2895f5[_0x0f97('0x46')]);_0x16f78c[_0x0f97('0x47')]=_[_0x0f97('0x49')](_0x16f78c[_0x0f97('0x44')],_0x16f78c[_0x0f97('0x46')]);_0x200d9b[_0x0f97('0x48')]=_[_0x0f97('0x49')](_0x16f78c['model'],qs[_0x0f97('0x4a')](_0x2895f5[_0x0f97('0x46')]['fields']));_0x200d9b[_0x0f97('0x48')]=_0x200d9b[_0x0f97('0x48')][_0x0f97('0x4b')]?_0x200d9b[_0x0f97('0x48')]:_0x16f78c[_0x0f97('0x44')];if(_0x2895f5['query'][_0x0f97('0xb3')]){_0x200d9b[_0x0f97('0xb4')]=[{'all':!![]}];}_0x200d9b=_[_0x0f97('0xb5')]({},_0x200d9b,_0x2895f5[_0x0f97('0xb6')]);return db['WhatsappInteraction'][_0x0f97('0x68')](_0x200d9b)['then'](handleEntityNotFound(_0x452693,null))[_0x0f97('0x2c')](respondWithResult(_0x452693,null))[_0x0f97('0x39')](handleError(_0x452693,null));};exports['create']=function(_0x523784,_0xa622da){return db[_0x0f97('0x40')][_0x0f97('0xb7')](_0x523784['body'],{})[_0x0f97('0x2c')](respondWithResult(_0xa622da,0xc9))['catch'](handleError(_0xa622da,null));};exports['update']=function(_0x561cc7,_0x529bc3){if(_0x561cc7[_0x0f97('0xb8')]['id']){delete _0x561cc7['body']['id'];}return db[_0x0f97('0x40')][_0x0f97('0x68')]({'where':{'id':_0x561cc7[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x529bc3,null))['then'](saveUpdates(_0x561cc7[_0x0f97('0xb8')],null))[_0x0f97('0x2c')](respondWithResult(_0x529bc3,null))[_0x0f97('0x39')](handleError(_0x529bc3,null));};exports[_0x0f97('0x2b')]=function(_0x47b00d,_0x1ab583){return db['WhatsappInteraction'][_0x0f97('0x68')]({'where':{'id':_0x47b00d[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x1ab583,null))[_0x0f97('0x2c')](removeEntity(_0x1ab583,null))[_0x0f97('0x39')](handleError(_0x1ab583,null));};exports[_0x0f97('0xba')]=function(_0x55f0f2,_0x38c2d7){return db[_0x0f97('0x40')][_0x0f97('0xba')]()[_0x0f97('0x2c')](respondWithResult(_0x38c2d7,null))[_0x0f97('0x39')](handleError(_0x38c2d7,null));};exports[_0x0f97('0xbb')]=function(_0xc556c4,_0x5eeb8c,_0x367ac7){return db['WhatsappMessage']['find']({'where':{'id':_0xc556c4[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x5eeb8c,null))[_0x0f97('0x2c')](function(_0x2a35a7){if(_0x2a35a7){return _0x2a35a7[_0x0f97('0xbb')](_0xc556c4['body'][_0x0f97('0xbc')],_['omit'](_0xc556c4[_0x0f97('0xb8')],[_0x0f97('0xbc'),'id'])||{});}})[_0x0f97('0x2c')](respondWithResult(_0x5eeb8c,null))[_0x0f97('0x39')](handleError(_0x5eeb8c,null));};exports['getMessages']=function(_0x1027a6,_0x48b794,_0x5024c4){var _0x3ce24d={'raw':![],'where':{}};var _0x5e4cf2={};var _0x5c935e={'count':0x0,'rows':[]};return db[_0x0f97('0x40')][_0x0f97('0xbd')]({'where':{'id':_0x1027a6[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x48b794,null))[_0x0f97('0x2c')](function(_0xb40340){if(_0xb40340){_0x5e4cf2[_0x0f97('0x44')]=_[_0x0f97('0x45')](db[_0x0f97('0xbe')][_0x0f97('0x41')]);_0x5e4cf2[_0x0f97('0x46')]=_['keys'](_0x1027a6['query']);_0x5e4cf2[_0x0f97('0x47')]=_['intersection'](_0x5e4cf2[_0x0f97('0x44')],_0x5e4cf2[_0x0f97('0x46')]);_0x3ce24d[_0x0f97('0x48')]=_['intersection'](_0x5e4cf2[_0x0f97('0x44')],qs[_0x0f97('0x4a')](_0x1027a6[_0x0f97('0x46')][_0x0f97('0x4a')]));_0x3ce24d[_0x0f97('0x48')]=_0x3ce24d['attributes'][_0x0f97('0x4b')]?_0x3ce24d['attributes']:_0x5e4cf2[_0x0f97('0x44')];if(!_0x1027a6[_0x0f97('0x46')]['hasOwnProperty']('nolimit')){_0x3ce24d['limit']=qs[_0x0f97('0x26')](_0x1027a6[_0x0f97('0x46')][_0x0f97('0x26')]);_0x3ce24d[_0x0f97('0x28')]=qs[_0x0f97('0x28')](_0x1027a6['query'][_0x0f97('0x28')]);}_0x3ce24d[_0x0f97('0x93')]=qs[_0x0f97('0x4e')](_0x1027a6[_0x0f97('0x46')][_0x0f97('0x4e')]);_0x3ce24d[_0x0f97('0x80')]=qs[_0x0f97('0x47')](_['pick'](_0x1027a6[_0x0f97('0x46')],_0x5e4cf2[_0x0f97('0x47')]));_0x3ce24d[_0x0f97('0x80')][_0x0f97('0xb0')]=_0xb40340['id'];if(_0x1027a6[_0x0f97('0x46')]['filter']){_0x3ce24d[_0x0f97('0x80')]=_[_0x0f97('0xb5')](_0x3ce24d[_0x0f97('0x80')],{'$or':_[_0x0f97('0x32')](_0x3ce24d['attributes'],function(_0x2422ad){var _0x11d733={};_0x11d733[_0x2422ad]={'$like':'%'+_0x1027a6[_0x0f97('0x46')]['filter']+'%'};return _0x11d733;})});}if(_0x1027a6['query'][_0x0f97('0x7e')]){var _0x3e1126=_0x1027a6['query']['$gte']['split'](',');var _0x4f8ffb={};_0x4f8ffb[_0x3e1126[0x0]]={'$gte':moment(_0x3e1126[0x1])[_0x0f97('0xbf')](_0x0f97('0xc0'))};_0x3ce24d[_0x0f97('0x80')]=_['merge'](_0x3ce24d[_0x0f97('0x80')],_0x4f8ffb);}_0x3ce24d=_['merge']({},_0x3ce24d,_0x1027a6['options']);return db['WhatsappMessage']['count']({'where':_0x3ce24d[_0x0f97('0x80')]})['then'](function(_0xc66311){_0x5c935e[_0x0f97('0x27')]=_0xc66311;if(_0x1027a6[_0x0f97('0x46')]['includeAll']){_0x3ce24d[_0x0f97('0xb4')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x3ce24d);})[_0x0f97('0x2c')](function(_0x22c0a5){_0x5c935e[_0x0f97('0xb1')]=_0x22c0a5;return _0x5c935e;});}})[_0x0f97('0x2c')](respondWithFilteredResult(_0x48b794,_0x3ce24d))[_0x0f97('0x39')](handleError(_0x48b794,null));};exports[_0x0f97('0xc1')]=function(_0x429875,_0x4c6a81,_0x2b61c3){return db[_0x0f97('0x40')][_0x0f97('0x68')]({'where':{'id':_0x429875['params']['id']}})['then'](handleEntityNotFound(_0x4c6a81,null))[_0x0f97('0x2c')](function(_0x2d5239){if(_0x2d5239){return _0x2d5239[_0x0f97('0xc2')](_0x429875[_0x0f97('0xb8')][_0x0f97('0xbc')],_[_0x0f97('0xc3')](_0x429875[_0x0f97('0xb8')],['ids','id'])||{})[_0x0f97('0xc4')](function(){return db[_0x0f97('0x78')][_0x0f97('0xc5')]({'attributes':['id','name','color'],'where':{'id':_0x429875[_0x0f97('0xb8')][_0x0f97('0xbc')]}});})[_0x0f97('0x2c')](function(_0x4fda78){socket[_0x0f97('0xc6')]('whatsappInteractionTags:save',{'id':Number(_0x429875[_0x0f97('0xb9')]['id']),'tags':_0x4fda78||[]});return{'id':Number(_0x429875[_0x0f97('0xb9')]['id']),'tags':_0x4fda78||[]};});}})[_0x0f97('0x2c')](respondWithResult(_0x4c6a81,null))[_0x0f97('0x39')](handleError(_0x4c6a81,null));};exports[_0x0f97('0xc7')]=function(_0x2e1395,_0x2d36c9,_0x23dc23){return db['WhatsappInteraction']['find']({'where':{'id':_0x2e1395[_0x0f97('0xb9')]['id']}})['then'](handleEntityNotFound(_0x2d36c9,null))[_0x0f97('0x2c')](function(_0x26c00f){if(_0x26c00f){return _0x26c00f[_0x0f97('0xc7')](_0x2e1395[_0x0f97('0x46')][_0x0f97('0xbc')]);}})[_0x0f97('0x2c')](respondWithStatusCode(_0x2d36c9,null))[_0x0f97('0x39')](handleError(_0x2d36c9,null));};exports[_0x0f97('0xc8')]=function(_0x5c0d1e,_0x510150){var _0x56d728=moment()['unix']()[_0x0f97('0x9e')]();var _0x19fa62=path[_0x0f97('0xc9')](config['root'],_0x0f97('0xca'),_0x0f97('0xcb'),'tmp');var _0x383231=path[_0x0f97('0xc9')](config[_0x0f97('0xcc')],_0x0f97('0xca'),'files','attachments');var _0x2d0665=path[_0x0f97('0xc9')](_0x19fa62,_0x56d728);var _0x542721=util['format'](_0x0f97('0xcd'),_0x5c0d1e[_0x0f97('0xb9')]['id'],_0x56d728);var _0x106b18=path[_0x0f97('0xc9')](_0x19fa62,_0x542721);var _0x2c1b31=[];_0x2c1b31[_0x0f97('0x38')]({'model':db[_0x0f97('0x79')],'as':_0x0f97('0x79'),'attributes':['id',_0x0f97('0x33')],'raw':!![]});_0x2c1b31[_0x0f97('0x38')]({'model':db['CmContact'],'as':_0x0f97('0x6d'),'attributes':['id',_0x0f97('0xce'),_0x0f97('0xcf')],'raw':!![]});if(_0x5c0d1e[_0x0f97('0x46')][_0x0f97('0xd0')]){_0x2c1b31[_0x0f97('0x38')]({'model':db[_0x0f97('0xd1')],'as':_0x0f97('0xd1'),'raw':!![]});}var _0x3b8d1c=[{'model':db[_0x0f97('0xbe')],'as':_0x0f97('0xd2'),'attributes':['id',_0x0f97('0xb8'),_0x0f97('0xd3'),_0x0f97('0xd4'),_0x0f97('0xd5'),_0x0f97('0x82')],'include':_0x2c1b31}];_0x3b8d1c[_0x0f97('0x38')]({'model':db[_0x0f97('0xd6')],'as':_0x0f97('0xd7'),'attributes':['id','name']});_0x3b8d1c[_0x0f97('0x38')]({'model':db['User'],'as':_0x0f97('0xd8'),'attributes':['id',_0x0f97('0x33')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x5c0d1e['params']['id']},'include':_0x3b8d1c})[_0x0f97('0x2c')](handleEntityNotFound(_0x510150,null))['then'](function(_0x4b34dd){if(_0x4b34dd){var _0x4e8147=_0x4b34dd[_0x0f97('0xd9')]({'plain':!![]});fs['mkdirSync'](_0x2d0665);var _0x4af6fe={'channel':'Whatsapp','account':_0x4e8147['Account'][_0x0f97('0x2f')],'agent':_0x4e8147[_0x0f97('0xd8')]?_0x4e8147['Owner'][_0x0f97('0x33')]:_0x0f97('0xda'),'createdAt':moment(_0x4e8147[_0x0f97('0xd3')])[_0x0f97('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0f97('0x9e')](),'closedAt':_0x4e8147[_0x0f97('0x3e')]?moment(_0x4e8147[_0x0f97('0xdb')])[_0x0f97('0xbf')](_0x0f97('0xc0'))[_0x0f97('0x9e')]():'','disposition':_0x4e8147[_0x0f97('0xdc')],'messages':_(_0x4e8147['Messages'])[_0x0f97('0x88')]({'secret':![]})[_0x0f97('0x32')](function(_0xd09dd4){if(_0xd09dd4['Attachment']){var _0x43bd55=path[_0x0f97('0xc9')](_0x383231,_0xd09dd4[_0x0f97('0xd1')][_0x0f97('0xdd')]);if(fs[_0x0f97('0xde')](_0x43bd55)){fs[_0x0f97('0xdf')](_0x43bd55)[_0x0f97('0xe0')](fs[_0x0f97('0xe1')](path[_0x0f97('0xc9')](_0x2d0665,_0xd09dd4['Attachment']['basename'])));}}return{'date':moment(_0xd09dd4[_0x0f97('0xd3')])[_0x0f97('0xbf')](_0x0f97('0xc0'))[_0x0f97('0x9e')](),'sender':_0xd09dd4[_0x0f97('0xd4')]===_0x0f97('0xe2')?_0xd09dd4[_0x0f97('0x79')]?_0xd09dd4['User']['fullname']:_0x0f97('0xe3'):_0xd09dd4[_0x0f97('0x6d')][_0x0f97('0xce')]+(_0xd09dd4[_0x0f97('0x6d')]['lastName']?'\x20'+_0xd09dd4[_0x0f97('0x6d')][_0x0f97('0xcf')]:''),'body':_0xd09dd4['Attachment']?_0xd09dd4[_0x0f97('0xd1')][_0x0f97('0xdd')]:_0xd09dd4[_0x0f97('0xb8')],'direction':_0xd09dd4['direction']==='out'?'A':'C','secret':_0xd09dd4[_0x0f97('0xd5')],'read':_0xd09dd4[_0x0f97('0x82')],'attachment':_0xd09dd4[_0x0f97('0xd1')]};})[_0x0f97('0x6a')]()};return ejs[_0x0f97('0xe4')](path['join'](config[_0x0f97('0xcc')],_0x0f97('0xca'),_0x0f97('0xe5'),_0x0f97('0xe6')),{'interaction':_0x4af6fe})['then'](function(_0x26abbc){var _0x31fb17=path['join'](_0x2d0665,_0x0f97('0xe7')+_0x4e8147['id']+'-'+_0x56d728+_0x0f97('0xe8'));var _0x3906a6={'path':_0x31fb17,'channel':'Whatsapp','interactionId':_0x4e8147['id']};return pdf[_0x0f97('0xe9')](_0x26abbc,_0x3906a6);})[_0x0f97('0x2c')](function(){return new BPromise(function(_0x50f874,_0x360f79){zipdir(_0x2d0665,{'saveTo':_0x106b18},function(_0x51bf38,_0x2bbf20){if(_0x51bf38)return _0x360f79(_0x51bf38);return _0x50f874(_0x2bbf20);});})[_0x0f97('0x2c')](function(){return new BPromise(function(_0x1ed2ca,_0x7bd3ca){rimraf(_0x2d0665,function(_0x4b0d00){if(_0x4b0d00)_0x7bd3ca(_0x4b0d00);return _0x1ed2ca();});});})[_0x0f97('0x2c')](function(){return _0x510150[_0x0f97('0xc8')](_0x106b18,_0x542721,function(_0x5d9c64){if(_0x5d9c64){console[_0x0f97('0xea')](_0x0f97('0xeb'),_0x5d9c64);}else{fs[_0x0f97('0xec')](_0x106b18);}});});});}else{return _0x510150[_0x0f97('0x21')](0xc8);}})[_0x0f97('0x39')](handleError(_0x510150,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 50f3b4f..d926ea9 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 _0x26bc=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x26bc,0x162));var _0xc26b=function(_0x2002ab,_0x1bcfde){_0x2002ab=_0x2002ab-0x0;var _0x4acc63=_0x26bc[_0x2002ab];return _0x4acc63;};'use strict';var EventEmitter=require(_0xc26b('0x0'));var WhatsappInteraction=require(_0xc26b('0x1'))['db'][_0xc26b('0x2')];var WhatsappMessage=require(_0xc26b('0x1'))['db'][_0xc26b('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc26b('0x4'),'afterUpdate':_0xc26b('0x5'),'afterDestroy':_0xc26b('0x6')};function emitEvent(_0x4d8d28){return function(_0xdd0a64,_0x5c87f7,_0x299ad8){_0xdd0a64[_0xc26b('0x7')]({'attributes':['id'],'raw':!![]})[_0xc26b('0x8')](function(_0x5c2f6f){_0xdd0a64[_0xc26b('0x9')](_0xc26b('0xa'),_0x5c2f6f[_0xc26b('0xb')](function(_0x15cfa5){return{'id':_0x15cfa5['id']};}));return WhatsappMessage[_0xc26b('0xc')]({'where':{'WhatsappInteractionId':_0xdd0a64['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc26b('0x8')](function(_0x22af41){_0xdd0a64[_0xc26b('0x9')](_0xc26b('0xd'),_0x22af41[_0xc26b('0xe')]);WhatsappInteractionEvents['emit'](_0x4d8d28+':'+_0xdd0a64['id'],_0xdd0a64);WhatsappInteractionEvents[_0xc26b('0xf')](_0x4d8d28,_0xdd0a64);_0x299ad8(null);})[_0xc26b('0x10')](_0x299ad8(null));};}for(var e in events){if(events[_0xc26b('0x11')](e)){var event=events[e];WhatsappInteraction[_0xc26b('0x12')](e,emitEvent(event));}}module[_0xc26b('0x13')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x1094=['catch','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','length','emit'];(function(_0x1d00c7,_0x9b96b2){var _0x5b4f51=function(_0x15fc7d){while(--_0x15fc7d){_0x1d00c7['push'](_0x1d00c7['shift']());}};_0x5b4f51(++_0x9b96b2);}(_0x1094,0x143));var _0x4109=function(_0x5906a5,_0x48af0a){_0x5906a5=_0x5906a5-0x0;var _0x1b9a31=_0x1094[_0x5906a5];return _0x1b9a31;};'use strict';var EventEmitter=require(_0x4109('0x0'));var WhatsappInteraction=require(_0x4109('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x4109('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4109('0x2')](0x0);var events={'afterCreate':_0x4109('0x3'),'afterUpdate':_0x4109('0x4'),'afterDestroy':_0x4109('0x5')};function emitEvent(_0x36e917){return function(_0x5684ce,_0x1cf079,_0x12fdda){_0x5684ce[_0x4109('0x6')]({'attributes':['id'],'raw':!![]})[_0x4109('0x7')](function(_0xd2df16){_0x5684ce[_0x4109('0x8')]('Users',_0xd2df16[_0x4109('0x9')](function(_0x175d5e){return{'id':_0x175d5e['id']};}));return WhatsappMessage[_0x4109('0xa')]({'where':{'WhatsappInteractionId':_0x5684ce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4109('0x7')](function(_0x1b7798){_0x5684ce['setDataValue']('unreadMessages',_0x1b7798[_0x4109('0xb')]);WhatsappInteractionEvents['emit'](_0x36e917+':'+_0x5684ce['id'],_0x5684ce);WhatsappInteractionEvents[_0x4109('0xc')](_0x36e917,_0x5684ce);_0x12fdda(null);})[_0x4109('0xd')](_0x12fdda(null));};}for(var e in events){if(events[_0x4109('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x4109('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 9b78bd6..8017656 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 _0xeba0=['whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0xeba0,0x1e2));var _0x0eba=function(_0x3520a3,_0x585b4e){_0x3520a3=_0x3520a3-0x0;var _0x266257=_0xeba0[_0x3520a3];return _0x266257;};'use strict';var _=require(_0x0eba('0x0'));var util=require(_0x0eba('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0eba('0x2'));var BPromise=require('bluebird');var rp=require(_0x0eba('0x3'));var fs=require('fs');var path=require(_0x0eba('0x4'));var rimraf=require(_0x0eba('0x5'));var config=require(_0x0eba('0x6'));var attributes=require(_0x0eba('0x7'));module['exports']=function(_0x414f33,_0x4e765b){return _0x414f33['define']('WhatsappInteraction',attributes,{'tableName':_0x0eba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x277363,_0x4eee86,_0x5908ed){if(_0x277363[_0x0eba('0x9')](_0x0eba('0xa'))){_0x277363[_0x0eba('0xb')]=moment()[_0x0eba('0xc')](_0x0eba('0xd'));}_0x5908ed(null,_0x277363);}}});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','path','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','closed','closedAt','format','lodash','util','../../config/logger','api','moment'];(function(_0x5c6d2c,_0x6e29b3){var _0x5309cf=function(_0x3b9041){while(--_0x3b9041){_0x5c6d2c['push'](_0x5c6d2c['shift']());}};_0x5309cf(++_0x6e29b3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2edee2,_0x4dd048){_0x2edee2=_0x2edee2-0x0;var _0x5b1d2d=_0x5f2f[_0x2edee2];return _0x5b1d2d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x466882,_0x46cd9c,_0x2ec345){if(_0x466882['changed'](_0xf5f2('0xc'))){_0x466882[_0xf5f2('0xd')]=moment()[_0xf5f2('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2ec345(null,_0x466882);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 7e1aa00..d30173e 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 _0xaf30=['addTags','ids','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','debug','request\x20sent','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','WhatsappInteraction','update','body','options','raw','where','attributes','limit','info','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find'];(function(_0x243ce2,_0x13e4ff){var _0x365c08=function(_0x52afd4){while(--_0x52afd4){_0x243ce2['push'](_0x243ce2['shift']());}};_0x365c08(++_0x13e4ff);}(_0xaf30,0xf4));var _0x0af3=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xaf30[_0x5c78d9];return _0x69ae1f;};'use strict';var _=require(_0x0af3('0x0'));var util=require('util');var moment=require(_0x0af3('0x1'));var BPromise=require(_0x0af3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0af3('0x3'));var db=require(_0x0af3('0x4'))['db'];var utils=require(_0x0af3('0x5'));var logger=require('../../config/logger')(_0x0af3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0af3('0x7')][_0x0af3('0x8')]({'port':0x232a});config[_0x0af3('0x9')]=_[_0x0af3('0xa')](config['redis'],{'host':_0x0af3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0af3('0x9')]));require(_0x0af3('0xc'))[_0x0af3('0xd')](socket);function respondWithRpcPromise(_0x52aab3,_0xabb47b,_0x3e69da){return new BPromise(function(_0xd66a38,_0x55c093){return client[_0x0af3('0xe')](_0x52aab3,_0x3e69da)[_0x0af3('0xf')](function(_0x54a185){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0xabb47b,'request\x20sent');logger[_0x0af3('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xabb47b,_0x0af3('0x11'),JSON['stringify'](_0x54a185));if(_0x54a185[_0x0af3('0x12')]){if(_0x54a185[_0x0af3('0x12')][_0x0af3('0x13')]===0x1f4){logger[_0x0af3('0x12')](_0x0af3('0x14'),_0xabb47b,_0x54a185[_0x0af3('0x12')][_0x0af3('0x15')]);return _0x55c093(_0x54a185['error'][_0x0af3('0x15')]);}logger[_0x0af3('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0xabb47b,_0x54a185[_0x0af3('0x12')][_0x0af3('0x15')]);return _0xd66a38(_0x54a185['error'][_0x0af3('0x15')]);}else{logger['info'](_0x0af3('0x14'),_0xabb47b,_0x0af3('0x11'));_0xd66a38(_0x54a185[_0x0af3('0x16')]['message']);}})[_0x0af3('0x17')](function(_0x79c2f6){logger[_0x0af3('0x12')](_0x0af3('0x14'),_0xabb47b,_0x79c2f6);_0x55c093(_0x79c2f6);});});}exports['UpdateWhatsappInteraction']=function(_0x4181d8){var _0x3ec4eb=this;return new Promise(function(_0xce859d,_0x20d7cd){return db[_0x0af3('0x18')][_0x0af3('0x19')](_0x4181d8[_0x0af3('0x1a')],{'raw':_0x4181d8[_0x0af3('0x1b')]?_0x4181d8['options'][_0x0af3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4181d8['options']?_0x4181d8['options'][_0x0af3('0x1d')]||null:null,'attributes':_0x4181d8[_0x0af3('0x1b')]?_0x4181d8[_0x0af3('0x1b')][_0x0af3('0x1e')]||null:null,'limit':_0x4181d8[_0x0af3('0x1b')]?_0x4181d8[_0x0af3('0x1b')][_0x0af3('0x1f')]||null:null})[_0x0af3('0xf')](function(_0x4fc867){logger[_0x0af3('0x20')]('UpdateWhatsappInteraction',_0x4181d8);logger['debug'](_0x0af3('0x21'),_0x4181d8,JSON['stringify'](_0x4fc867));_0xce859d(_0x4fc867);})['catch'](function(_0x119e37){logger[_0x0af3('0x12')](_0x0af3('0x21'),_0x119e37[_0x0af3('0x15')],_0x4181d8);_0x20d7cd(_0x3ec4eb[_0x0af3('0x12')](0x1f4,_0x119e37[_0x0af3('0x15')]));});});};exports[_0x0af3('0x22')]=function(_0x51a2a0){return new Promise(function(_0x1551dd,_0x1204d6){return db['WhatsappInteraction'][_0x0af3('0x23')]({'where':_0x51a2a0[_0x0af3('0x1b')]?_0x51a2a0[_0x0af3('0x1b')]['where']||null:null})[_0x0af3('0xf')](function(_0x59f6d6){if(_0x59f6d6){return _0x59f6d6[_0x0af3('0x24')](_0x51a2a0['body'][_0x0af3('0x25')],_['omit'](_0x51a2a0['body'],[_0x0af3('0x25'),'id'])||{});}})[_0x0af3('0x26')](function(_0x2094d8){logger['info']('AddTags',_0x51a2a0);logger[_0x0af3('0x10')](_0x0af3('0x27'),_0x51a2a0,JSON['stringify'](_0x2094d8));_0x1551dd(_0x2094d8);})[_0x0af3('0x17')](function(_0x211782){logger[_0x0af3('0x12')](_0x0af3('0x27'),_0x211782[_0x0af3('0x15')],_0x51a2a0);_0x1204d6(_this[_0x0af3('0x12')](0x1f4,_0x211782['message']));});});}; \ No newline at end of file +var _0xb4d1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','limit','then','AddTagsToWhatsappInteraction','find','where','addTags','ids','omit','body','AddTags','lodash','util','bluebird','randomstring'];(function(_0x34fef9,_0x5e6cb5){var _0xb283f1=function(_0x117581){while(--_0x117581){_0x34fef9['push'](_0x34fef9['shift']());}};_0xb283f1(++_0x5e6cb5);}(_0xb4d1,0x15c));var _0x1b4d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb4d1[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x1b4d('0x0'));var util=require(_0x1b4d('0x1'));var moment=require('moment');var BPromise=require(_0x1b4d('0x2'));var rs=require(_0x1b4d('0x3'));var fs=require('fs');var Redis=require(_0x1b4d('0x4'));var db=require(_0x1b4d('0x5'))['db'];var utils=require(_0x1b4d('0x6'));var logger=require(_0x1b4d('0x7'))(_0x1b4d('0x8'));var config=require(_0x1b4d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1b4d('0xa')][_0x1b4d('0xb')]({'port':0x232a});config[_0x1b4d('0xc')]=_[_0x1b4d('0xd')](config[_0x1b4d('0xc')],{'host':_0x1b4d('0xe'),'port':0x18eb});var socket=require(_0x1b4d('0xf'))(new Redis(config[_0x1b4d('0xc')]));require(_0x1b4d('0x10'))[_0x1b4d('0x11')](socket);function respondWithRpcPromise(_0x41e906,_0x1351cd,_0x52ac8d){return new BPromise(function(_0x174022,_0x3588f2){return client['request'](_0x41e906,_0x52ac8d)['then'](function(_0x1d59db){logger[_0x1b4d('0x12')](_0x1b4d('0x13'),_0x1351cd,'request\x20sent');logger[_0x1b4d('0x14')](_0x1b4d('0x15'),_0x1351cd,_0x1b4d('0x16'),JSON[_0x1b4d('0x17')](_0x1d59db));if(_0x1d59db[_0x1b4d('0x18')]){if(_0x1d59db[_0x1b4d('0x18')][_0x1b4d('0x19')]===0x1f4){logger[_0x1b4d('0x18')](_0x1b4d('0x13'),_0x1351cd,_0x1d59db[_0x1b4d('0x18')]['message']);return _0x3588f2(_0x1d59db[_0x1b4d('0x18')][_0x1b4d('0x1a')]);}logger[_0x1b4d('0x18')](_0x1b4d('0x13'),_0x1351cd,_0x1d59db[_0x1b4d('0x18')][_0x1b4d('0x1a')]);return _0x174022(_0x1d59db[_0x1b4d('0x18')][_0x1b4d('0x1a')]);}else{logger[_0x1b4d('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x1351cd,'request\x20sent');_0x174022(_0x1d59db[_0x1b4d('0x1b')][_0x1b4d('0x1a')]);}})[_0x1b4d('0x1c')](function(_0x2bb25d){logger[_0x1b4d('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x1351cd,_0x2bb25d);_0x3588f2(_0x2bb25d);});});}exports[_0x1b4d('0x1d')]=function(_0x2c93b6){var _0x8be83a=this;return new Promise(function(_0x3ca009,_0x5c35a6){return db[_0x1b4d('0x1e')][_0x1b4d('0x1f')](_0x2c93b6['body'],{'raw':_0x2c93b6[_0x1b4d('0x20')]?_0x2c93b6[_0x1b4d('0x20')][_0x1b4d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c93b6[_0x1b4d('0x20')]?_0x2c93b6[_0x1b4d('0x20')]['where']||null:null,'attributes':_0x2c93b6[_0x1b4d('0x20')]?_0x2c93b6[_0x1b4d('0x20')]['attributes']||null:null,'limit':_0x2c93b6[_0x1b4d('0x20')]?_0x2c93b6[_0x1b4d('0x20')][_0x1b4d('0x22')]||null:null})[_0x1b4d('0x23')](function(_0x3137c5){logger[_0x1b4d('0x12')]('UpdateWhatsappInteraction',_0x2c93b6);logger[_0x1b4d('0x14')](_0x1b4d('0x1d'),_0x2c93b6,JSON[_0x1b4d('0x17')](_0x3137c5));_0x3ca009(_0x3137c5);})[_0x1b4d('0x1c')](function(_0x1194d8){logger[_0x1b4d('0x18')](_0x1b4d('0x1d'),_0x1194d8[_0x1b4d('0x1a')],_0x2c93b6);_0x5c35a6(_0x8be83a[_0x1b4d('0x18')](0x1f4,_0x1194d8[_0x1b4d('0x1a')]));});});};exports[_0x1b4d('0x24')]=function(_0x16d1a4){return new Promise(function(_0x5b4fdb,_0x5a73d4){return db['WhatsappInteraction'][_0x1b4d('0x25')]({'where':_0x16d1a4['options']?_0x16d1a4[_0x1b4d('0x20')][_0x1b4d('0x26')]||null:null})[_0x1b4d('0x23')](function(_0x262197){if(_0x262197){return _0x262197[_0x1b4d('0x27')](_0x16d1a4['body'][_0x1b4d('0x28')],_[_0x1b4d('0x29')](_0x16d1a4[_0x1b4d('0x2a')],[_0x1b4d('0x28'),'id'])||{});}})['spread'](function(_0x1adbd4){logger[_0x1b4d('0x12')](_0x1b4d('0x2b'),_0x16d1a4);logger[_0x1b4d('0x14')](_0x1b4d('0x2b'),_0x16d1a4,JSON[_0x1b4d('0x17')](_0x1adbd4));_0x5b4fdb(_0x1adbd4);})[_0x1b4d('0x1c')](function(_0x2923cf){logger[_0x1b4d('0x18')](_0x1b4d('0x2b'),_0x2923cf[_0x1b4d('0x1a')],_0x16d1a4);_0x5a73d4(_this[_0x1b4d('0x18')](0x1f4,_0x2923cf[_0x1b4d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7beba8e..903980e 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 _0x0376=['register','length','whatsappInteraction:','save','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0376,0xb2));var _0x6037=function(_0x40f0a9,_0x24a6e1){_0x40f0a9=_0x40f0a9-0x0;var _0x3c5464=_0x0376[_0x40f0a9];return _0x3c5464;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x6037('0x0'),'remove',_0x6037('0x1')];function createListener(_0x157f33,_0x16e991){return function(_0xd0bf09){_0x16e991[_0x6037('0x2')](_0x157f33,_0xd0bf09);};}function removeListener(_0x3f4527,_0x1d17ae){return function(){WhatsappInteractionEvents[_0x6037('0x3')](_0x3f4527,_0x1d17ae);};}exports[_0x6037('0x4')]=function(_0x4ed0e9){for(var _0x5d74c9=0x0,_0x3ef581=events[_0x6037('0x5')];_0x5d74c9<_0x3ef581;_0x5d74c9++){var _0x1b9f14=events[_0x5d74c9];var _0x93b8f2=createListener(_0x6037('0x6')+_0x1b9f14,_0x4ed0e9);WhatsappInteractionEvents['on'](_0x1b9f14,_0x93b8f2);}}; \ No newline at end of file +var _0xe072=['save','remove','update','emit','register','length','whatsappInteraction:'];(function(_0xc391bf,_0x5cc846){var _0x4bd503=function(_0x6970a9){while(--_0x6970a9){_0xc391bf['push'](_0xc391bf['shift']());}};_0x4bd503(++_0x5cc846);}(_0xe072,0x142));var _0x2e07=function(_0x165872,_0x1e3a2f){_0x165872=_0x165872-0x0;var _0x24ba24=_0xe072[_0x165872];return _0x24ba24;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x2e07('0x0'),_0x2e07('0x1'),_0x2e07('0x2')];function createListener(_0x56140d,_0x2337b0){return function(_0x52cc48){_0x2337b0[_0x2e07('0x3')](_0x56140d,_0x52cc48);};}function removeListener(_0x5141a2,_0x6dca4e){return function(){WhatsappInteractionEvents['removeListener'](_0x5141a2,_0x6dca4e);};}exports[_0x2e07('0x4')]=function(_0x4463fd){for(var _0xe4adb7=0x0,_0x347f37=events[_0x2e07('0x5')];_0xe4adb7<_0x347f37;_0xe4adb7++){var _0x3d7b2d=events[_0xe4adb7];var _0x408859=createListener(_0x2e07('0x6')+_0x3d7b2d,_0x4463fd);WhatsappInteractionEvents['on'](_0x3d7b2d,_0x408859);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index ad155d0..f7e0d15 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 _0xbd64=['/:id','show','post','isAuthenticated','whatsapp','whatsappmessage:create','create','/:id/status','status','update','accept','put','reject','delete','multer','path','connect-timeout','express','fs-extra','./whatsappMessage.controller','get','index','/describe','describe'];(function(_0x5adfe5,_0x4fa7d8){var _0x2dd38c=function(_0x36b82e){while(--_0x36b82e){_0x5adfe5['push'](_0x5adfe5['shift']());}};_0x2dd38c(++_0x4fa7d8);}(_0xbd64,0xb6));var _0x4bd6=function(_0x52b12d,_0x4d2e52){_0x52b12d=_0x52b12d-0x0;var _0x5c0fab=_0xbd64[_0x52b12d];return _0x5c0fab;};'use strict';var multer=require(_0x4bd6('0x0'));var util=require('util');var path=require(_0x4bd6('0x1'));var timeout=require(_0x4bd6('0x2'));var express=require(_0x4bd6('0x3'));var router=express['Router']();var fs_extra=require(_0x4bd6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4bd6('0x5'));router[_0x4bd6('0x6')]('/',auth['isAuthenticated'](),controller[_0x4bd6('0x7')]);router[_0x4bd6('0x6')](_0x4bd6('0x8'),auth['isAuthenticated'](),controller[_0x4bd6('0x9')]);router[_0x4bd6('0x6')](_0x4bd6('0xa'),auth['isAuthenticated'](),controller[_0x4bd6('0xb')]);router[_0x4bd6('0xc')]('/',auth[_0x4bd6('0xd')](),interaction['tracked'](_0x4bd6('0xe'),_0x4bd6('0xf')),controller[_0x4bd6('0x10')]);router[_0x4bd6('0xc')](_0x4bd6('0x11'),controller[_0x4bd6('0x12')]);router['put'](_0x4bd6('0xa'),auth['isAuthenticated'](),controller[_0x4bd6('0x13')]);router['put']('/:id/accept',auth[_0x4bd6('0xd')](),controller[_0x4bd6('0x14')]);router[_0x4bd6('0x15')]('/:id/reject',auth[_0x4bd6('0xd')](),controller[_0x4bd6('0x16')]);router[_0x4bd6('0x17')](_0x4bd6('0xa'),auth[_0x4bd6('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdcbe=['multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','exports'];(function(_0x14f437,_0xbd068b){var _0x4939bc=function(_0x4d5ff8){while(--_0x4d5ff8){_0x14f437['push'](_0x14f437['shift']());}};_0x4939bc(++_0xbd068b);}(_0xdcbe,0x90));var _0xedcb=function(_0x4d957e,_0x26bef5){_0x4d957e=_0x4d957e-0x0;var _0xc2dfeb=_0xdcbe[_0x4d957e];return _0xc2dfeb;};'use strict';var multer=require(_0xedcb('0x0'));var util=require(_0xedcb('0x1'));var path=require('path');var timeout=require(_0xedcb('0x2'));var express=require('express');var router=express[_0xedcb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xedcb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xedcb('0x5'));var controller=require(_0xedcb('0x6'));router['get']('/',auth[_0xedcb('0x7')](),controller[_0xedcb('0x8')]);router[_0xedcb('0x9')](_0xedcb('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xedcb('0x9')](_0xedcb('0xb'),auth[_0xedcb('0x7')](),controller[_0xedcb('0xc')]);router[_0xedcb('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xedcb('0xe'),_0xedcb('0xf')),controller[_0xedcb('0x10')]);router[_0xedcb('0xd')](_0xedcb('0x11'),controller[_0xedcb('0x12')]);router[_0xedcb('0x13')](_0xedcb('0xb'),auth['isAuthenticated'](),controller[_0xedcb('0x14')]);router[_0xedcb('0x13')]('/:id/accept',auth[_0xedcb('0x7')](),controller[_0xedcb('0x15')]);router['put'](_0xedcb('0x16'),auth[_0xedcb('0x7')](),controller['reject']);router['delete'](_0xedcb('0xb'),auth[_0xedcb('0x7')](),controller['destroy']);module[_0xedcb('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index c52c835..67a86f2 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 _0x201d=['STRING','TEXT','BOOLEAN','ENUM','out'];(function(_0x2908cc,_0x3c2687){var _0x5a547a=function(_0x35c015){while(--_0x35c015){_0x2908cc['push'](_0x2908cc['shift']());}};_0x5a547a(++_0x3c2687);}(_0x201d,0x97));var _0xd201=function(_0xfc47b,_0x5b510a){_0xfc47b=_0xfc47b-0x0;var _0x4f7871=_0x201d[_0xfc47b];return _0x4f7871;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd201('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd201('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd201('0x2')]('in',_0xd201('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd201('0x4')](0xbe)},'phone':{'type':Sequelize[_0xd201('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd201('0x4')]},'providerResponse':{'type':Sequelize[_0xd201('0x0')]}}; \ No newline at end of file +var _0xfa59=['STRING','DATE','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x464bd8,_0x5733f9){var _0x56e608=function(_0x8f9c10){while(--_0x8f9c10){_0x464bd8['push'](_0x464bd8['shift']());}};_0x56e608(++_0x5733f9);}(_0xfa59,0x121));var _0x9fa5=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfa59[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x9fa5('0x0')](_0x9fa5('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9fa5('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9fa5('0x3')]('in',_0x9fa5('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x9fa5('0x5')]},'readAt':{'type':Sequelize[_0x9fa5('0x6')]},'secret':{'type':Sequelize[_0x9fa5('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index de2038b..e9536b4 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 _0x3b1c=['path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','destroy','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','whatsapp-interactions','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','agent','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','event','rejectmessage','debug','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x3b1c,0x1a0));var _0xc3b1=function(_0x10c7a5,_0x5d0771){_0x10c7a5=_0x10c7a5-0x0;var _0x4f33ce=_0x3b1c[_0x10c7a5];return _0x4f33ce;};'use strict';var emlformat=require(_0xc3b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3b1('0x1'));var jsonpatch=require(_0xc3b1('0x2'));var rp=require(_0xc3b1('0x3'));var moment=require(_0xc3b1('0x4'));var BPromise=require(_0xc3b1('0x5'));var Mustache=require('mustache');var util=require(_0xc3b1('0x6'));var path=require(_0xc3b1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc3b1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3b1('0x9'));var squel=require(_0xc3b1('0xa'));var crypto=require(_0xc3b1('0xb'));var jsforce=require(_0xc3b1('0xc'));var deskjs=require(_0xc3b1('0xd'));var toCsv=require(_0xc3b1('0xe'));var querystring=require('querystring');var Papa=require(_0xc3b1('0xf'));var Redis=require(_0xc3b1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3b1('0x11'));var hardwareService=require(_0xc3b1('0x12'));var logger=require(_0xc3b1('0x13'))(_0xc3b1('0x14'));var utils=require('../../config/utils');var config=require(_0xc3b1('0x15'));var licenseUtil=require(_0xc3b1('0x16'));var db=require(_0xc3b1('0x17'))['db'];config[_0xc3b1('0x18')]=_[_0xc3b1('0x19')](config[_0xc3b1('0x18')],{'host':_0xc3b1('0x1a'),'port':0x18eb});var socket=require(_0xc3b1('0x1b'))(new Redis(config[_0xc3b1('0x18')]));require(_0xc3b1('0x1c'))[_0xc3b1('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc3b1('0x1e')]({'port':0x232c});var client9002=jayson[_0xc3b1('0x1f')][_0xc3b1('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3d823f,_0x519cc3,_0x494cc8,_0x4edbb2){return new BPromise(function(_0x4dee73,_0x5b6ea7){var _0x2e02f7=_0x4edbb2||client;return _0x2e02f7[_0xc3b1('0x20')](_0x3d823f,_0x494cc8)[_0xc3b1('0x21')](function(_0x2ed386){logger[_0xc3b1('0x22')](_0xc3b1('0x23'),_0x519cc3,_0xc3b1('0x24'));logger['debug'](_0xc3b1('0x25'),_0x519cc3,_0xc3b1('0x24'),JSON[_0xc3b1('0x26')](_0x2ed386));if(_0x2ed386[_0xc3b1('0x27')]){if(_0x2ed386[_0xc3b1('0x27')]['code']===0x1f4){logger[_0xc3b1('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x519cc3,_0x2ed386['error'][_0xc3b1('0x28')]);return _0x5b6ea7(_0x2ed386[_0xc3b1('0x27')]['message']);}logger[_0xc3b1('0x27')](_0xc3b1('0x23'),_0x519cc3,_0x2ed386[_0xc3b1('0x27')]['message']);return _0x4dee73(_0x2ed386[_0xc3b1('0x27')][_0xc3b1('0x28')]);}else{logger[_0xc3b1('0x22')](_0xc3b1('0x23'),_0x519cc3,_0xc3b1('0x24'));_0x4dee73(_0x2ed386[_0xc3b1('0x29')][_0xc3b1('0x28')]);}})['catch'](function(_0x4b0a05){logger[_0xc3b1('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x519cc3,_0x4b0a05);_0x5b6ea7(_0x4b0a05);});});}function respondWithStatusCode(_0x2e4882,_0x40c8f1){_0x40c8f1=_0x40c8f1||0xcc;return function(_0xdf7249){if(_0xdf7249){return _0x2e4882[_0xc3b1('0x2a')](_0x40c8f1);}return _0x2e4882[_0xc3b1('0x2b')](_0x40c8f1)[_0xc3b1('0x2c')]();};}function respondWithResult(_0x2f97c5,_0x16a6fe){_0x16a6fe=_0x16a6fe||0xc8;return function(_0x570def){if(_0x570def){return _0x2f97c5[_0xc3b1('0x2b')](_0x16a6fe)[_0xc3b1('0x2d')](_0x570def);}};}function respondWithFilteredResult(_0x3f36c1,_0x2e9049){return function(_0x59b653){if(_0x59b653){var _0x1b1c3e=typeof _0x2e9049[_0xc3b1('0x2e')]===_0xc3b1('0x2f')&&typeof _0x2e9049['limit']===_0xc3b1('0x2f');var _0x3c3e6d=_0x59b653[_0xc3b1('0x30')];var _0x5ab04f=_0x1b1c3e?0x0:_0x2e9049['offset'];var _0x493ae0=_0x1b1c3e?_0x59b653[_0xc3b1('0x30')]:_0x2e9049['offset']+_0x2e9049[_0xc3b1('0x31')];var _0x8d7ea6;if(_0x493ae0>=_0x3c3e6d){_0x493ae0=_0x3c3e6d;_0x8d7ea6=0xc8;}else{_0x8d7ea6=0xce;}_0x3f36c1['status'](_0x8d7ea6);return _0x3f36c1[_0xc3b1('0x32')]('Content-Range',_0x5ab04f+'-'+_0x493ae0+'/'+_0x3c3e6d)[_0xc3b1('0x2d')](_0x59b653);}return null;};}function patchUpdates(_0x5053be){return function(_0x445345){try{jsonpatch['apply'](_0x445345,_0x5053be,!![]);}catch(_0x34dffa){return BPromise[_0xc3b1('0x33')](_0x34dffa);}return _0x445345[_0xc3b1('0x34')]();};}function saveUpdates(_0x4a127f,_0x18ba5b){return function(_0x16302d){if(_0x16302d){return _0x16302d['update'](_0x4a127f)['then'](function(_0x1dcbb6){return _0x1dcbb6;});}return null;};}function removeEntity(_0x258f42,_0x4e2c24){return function(_0x2b0f1d){if(_0x2b0f1d){return _0x2b0f1d[_0xc3b1('0x35')]()['then'](function(){_0x258f42[_0xc3b1('0x2b')](0xcc)[_0xc3b1('0x2c')]();});}};}function handleEntityNotFound(_0x33fe99,_0x2f677e){return function(_0x26a1a9){if(!_0x26a1a9){_0x33fe99['sendStatus'](0x194);}return _0x26a1a9;};}function handleError(_0x591d67,_0xc083ef){_0xc083ef=_0xc083ef||0x1f4;return function(_0x5b09e3){logger['error'](_0x5b09e3[_0xc3b1('0x36')]);if(_0x5b09e3[_0xc3b1('0x37')]){delete _0x5b09e3[_0xc3b1('0x37')];}_0x591d67[_0xc3b1('0x2b')](_0xc083ef)[_0xc3b1('0x38')](_0x5b09e3);};}exports['index']=function(_0x2664d2,_0x11903c){var _0x167c40={},_0x5e8cce={},_0x38cb33={'count':0x0,'rows':[]};var _0x5d5d1a=_[_0xc3b1('0x39')](db[_0xc3b1('0x3a')][_0xc3b1('0x3b')],function(_0x2a3d4b){return{'name':_0x2a3d4b[_0xc3b1('0x3c')],'type':_0x2a3d4b['type'][_0xc3b1('0x3d')]};});_0x5e8cce[_0xc3b1('0x3e')]=_[_0xc3b1('0x39')](_0x5d5d1a,_0xc3b1('0x37'));_0x5e8cce['query']=_[_0xc3b1('0x3f')](_0x2664d2[_0xc3b1('0x40')]);_0x5e8cce[_0xc3b1('0x41')]=_['intersection'](_0x5e8cce['model'],_0x5e8cce[_0xc3b1('0x40')]);_0x167c40['attributes']=_[_0xc3b1('0x42')](_0x5e8cce[_0xc3b1('0x3e')],qs['fields'](_0x2664d2[_0xc3b1('0x40')][_0xc3b1('0x43')]));_0x167c40[_0xc3b1('0x44')]=_0x167c40['attributes'][_0xc3b1('0x45')]?_0x167c40[_0xc3b1('0x44')]:_0x5e8cce['model'];if(!_0x2664d2[_0xc3b1('0x40')][_0xc3b1('0x46')](_0xc3b1('0x47'))){_0x167c40['limit']=qs[_0xc3b1('0x31')](_0x2664d2[_0xc3b1('0x40')]['limit']);_0x167c40[_0xc3b1('0x2e')]=qs['offset'](_0x2664d2['query']['offset']);}_0x167c40[_0xc3b1('0x48')]=qs[_0xc3b1('0x49')](_0x2664d2[_0xc3b1('0x40')][_0xc3b1('0x49')]);_0x167c40['where']=qs[_0xc3b1('0x41')](_[_0xc3b1('0x4a')](_0x2664d2[_0xc3b1('0x40')],_0x5e8cce['filters']),_0x5d5d1a);if(_0x2664d2['query']['filter']){_0x167c40[_0xc3b1('0x4b')]=_['merge'](_0x167c40[_0xc3b1('0x4b')],{'$or':_[_0xc3b1('0x39')](_0x5d5d1a,function(_0x5d2cd7){if(_0x5d2cd7[_0xc3b1('0x4c')]!==_0xc3b1('0x4d')){var _0x160e29={};_0x160e29[_0x5d2cd7[_0xc3b1('0x37')]]={'$like':'%'+_0x2664d2['query']['filter']+'%'};return _0x160e29;}})});}_0x167c40=_[_0xc3b1('0x4e')]({},_0x167c40,_0x2664d2['options']);var _0x584559={'where':_0x167c40[_0xc3b1('0x4b')]};return db[_0xc3b1('0x3a')]['count'](_0x584559)[_0xc3b1('0x21')](function(_0x512c13){_0x38cb33['count']=_0x512c13;if(_0x2664d2[_0xc3b1('0x40')][_0xc3b1('0x4f')]){_0x167c40[_0xc3b1('0x50')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xc3b1('0x51')](_0x167c40);})['then'](function(_0x493243){_0x38cb33[_0xc3b1('0x52')]=_0x493243;return _0x38cb33;})[_0xc3b1('0x21')](respondWithFilteredResult(_0x11903c,_0x167c40))[_0xc3b1('0x53')](handleError(_0x11903c,null));};exports[_0xc3b1('0x54')]=function(_0x4004a8,_0x279b65){var _0x23c925={'raw':!![],'where':{'id':_0x4004a8[_0xc3b1('0x55')]['id']}},_0x586bc3={};_0x586bc3[_0xc3b1('0x3e')]=_['keys'](db[_0xc3b1('0x3a')][_0xc3b1('0x3b')]);_0x586bc3[_0xc3b1('0x40')]=_[_0xc3b1('0x3f')](_0x4004a8[_0xc3b1('0x40')]);_0x586bc3[_0xc3b1('0x41')]=_['intersection'](_0x586bc3[_0xc3b1('0x3e')],_0x586bc3['query']);_0x23c925[_0xc3b1('0x44')]=_[_0xc3b1('0x42')](_0x586bc3[_0xc3b1('0x3e')],qs[_0xc3b1('0x43')](_0x4004a8[_0xc3b1('0x40')][_0xc3b1('0x43')]));_0x23c925[_0xc3b1('0x44')]=_0x23c925[_0xc3b1('0x44')]['length']?_0x23c925[_0xc3b1('0x44')]:_0x586bc3[_0xc3b1('0x3e')];if(_0x4004a8[_0xc3b1('0x40')]['includeAll']){_0x23c925['include']=[{'all':!![]}];}_0x23c925=_[_0xc3b1('0x4e')]({},_0x23c925,_0x4004a8[_0xc3b1('0x56')]);return db[_0xc3b1('0x3a')][_0xc3b1('0x57')](_0x23c925)['then'](handleEntityNotFound(_0x279b65,null))[_0xc3b1('0x21')](respondWithResult(_0x279b65,null))[_0xc3b1('0x53')](handleError(_0x279b65,null));};exports['create']=function(_0x49f836,_0x4cbb53){return db['WhatsappMessage'][_0xc3b1('0x58')](_0x49f836[_0xc3b1('0x59')],{})[_0xc3b1('0x21')](respondWithResult(_0x4cbb53,0xc9))[_0xc3b1('0x53')](handleError(_0x4cbb53,null));};exports[_0xc3b1('0x5a')]=function(_0x19b48b,_0x5867c1){if(_0x19b48b[_0xc3b1('0x59')]['id']){delete _0x19b48b['body']['id'];}return db[_0xc3b1('0x3a')][_0xc3b1('0x57')]({'where':{'id':_0x19b48b[_0xc3b1('0x55')]['id']}})[_0xc3b1('0x21')](handleEntityNotFound(_0x5867c1,null))['then'](saveUpdates(_0x19b48b[_0xc3b1('0x59')],null))[_0xc3b1('0x21')](respondWithResult(_0x5867c1,null))[_0xc3b1('0x53')](handleError(_0x5867c1,null));};exports[_0xc3b1('0x35')]=function(_0x1cf2f6,_0x1ebf28){return db[_0xc3b1('0x3a')][_0xc3b1('0x57')]({'where':{'id':_0x1cf2f6['params']['id']}})[_0xc3b1('0x21')](handleEntityNotFound(_0x1ebf28,null))[_0xc3b1('0x21')](removeEntity(_0x1ebf28,null))['catch'](handleError(_0x1ebf28,null));};exports[_0xc3b1('0x5b')]=function(_0x3dee07,_0x2ddecb){return db['WhatsappMessage'][_0xc3b1('0x5b')]()[_0xc3b1('0x21')](respondWithResult(_0x2ddecb,null))[_0xc3b1('0x53')](handleError(_0x2ddecb,null));};var interaction_log=require('../../config/logger')(_0xc3b1('0x5c'));exports['accept']=function(_0x45d60a,_0x195a42,_0x2e8d9f){var _0x407623={'agent':{},'channel':_0xc3b1('0x5d')};if(_0x45d60a[_0xc3b1('0x59')]['id']){delete _0x45d60a[_0xc3b1('0x59')]['id'];}_0x45d60a[_0xc3b1('0x59')]['read']=!![];_0x45d60a[_0xc3b1('0x59')][_0xc3b1('0x5e')]=moment()['format'](_0xc3b1('0x5f'));_0x45d60a[_0xc3b1('0x59')]['UserId']=_0x45d60a[_0xc3b1('0x59')][_0xc3b1('0x60')]||_0x45d60a['user']['id'];_0x407623['agent']['id']=_0x45d60a[_0xc3b1('0x59')][_0xc3b1('0x60')];return db[_0xc3b1('0x3a')]['find']({'where':{'id':_0x45d60a['params']['id'],'UserId':null}})[_0xc3b1('0x21')](handleEntityNotFound(_0x195a42,null))['then'](saveUpdates(_0x45d60a['body'],null))[_0xc3b1('0x21')](function(_0x3bd7b1){if(_0x3bd7b1){_0x407623[_0xc3b1('0x28')]=_0x3bd7b1[_0xc3b1('0x61')]({'plain':!![]});return db[_0xc3b1('0x62')]['find']({'where':{'id':_0x3bd7b1[_0xc3b1('0x63')]}});}return null;})[_0xc3b1('0x21')](handleEntityNotFound(_0x195a42,null))[_0xc3b1('0x21')](function(_0x9bd73d){if(_0x9bd73d){return _0x9bd73d[_0xc3b1('0x5a')]({'UserId':_0x45d60a[_0xc3b1('0x59')][_0xc3b1('0x60')],'read1stAt':_[_0xc3b1('0x64')](_0x9bd73d[_0xc3b1('0x65')])?moment()[_0xc3b1('0x66')](_0xc3b1('0x5f')):undefined});}return null;})[_0xc3b1('0x21')](function(_0x45d18e){if(_0x45d18e){_0x407623[_0xc3b1('0x67')]=_0x45d18e[_0xc3b1('0x61')]({'plain':!![]});interaction_log[_0xc3b1('0x22')](_0xc3b1('0x68'),_0x45d60a[_0xc3b1('0x69')]['id'],_0x45d60a[_0xc3b1('0x69')][_0xc3b1('0x37')],_0x45d60a[_0xc3b1('0x69')][_0xc3b1('0x6a')],_0x407623[_0xc3b1('0x67')]['id'],_0x45d60a['body']?JSON[_0xc3b1('0x26')](_0x45d60a['body']):_0xc3b1('0x6b'));return respondWithRpcPromise(_0xc3b1('0x6c'),_0xc3b1('0x6d'),_0x407623);}return null;})[_0xc3b1('0x21')](function(_0x3b19dc){var _0x540be4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b19dc['message'][_0xc3b1('0x6e')];return db[_0xc3b1('0x6f')][_0xc3b1('0x40')](_0x540be4,{'type':db[_0xc3b1('0x70')][_0xc3b1('0x71')][_0xc3b1('0x72')],'raw':!![]})[_0xc3b1('0x21')](function(_0x229d89){return _0x229d89;});})['then'](function(_0x6a5486){if(_0x6a5486){_0x407623[_0xc3b1('0x28')][_0xc3b1('0x73')]=_0x6a5486[0x0];if(!_0x45d60a[_0xc3b1('0x59')][_0xc3b1('0x60')])return;return db[_0xc3b1('0x74')]['find']({'where':{'id':_0x45d60a[_0xc3b1('0x59')][_0xc3b1('0x60')],'role':'agent'},'attributes':['id','name',_0xc3b1('0x75'),'email',_0xc3b1('0x76')],'raw':!![]});}return null;})[_0xc3b1('0x21')](function(_0x5a3e1d){if(!_0x5a3e1d)return null;_0x407623['message'][_0xc3b1('0x77')]=_0x5a3e1d;return _0x407623;})[_0xc3b1('0x21')](function(_0xa429ba){if(_0xa429ba){if(_0x45d60a['body'][_0xc3b1('0x78')]){_0x407623[_0xc3b1('0x28')][_0xc3b1('0x79')]=util[_0xc3b1('0x66')](_0xc3b1('0x7a'),_0x45d60a['user']['name']);_0x407623[_0xc3b1('0x28')][_0xc3b1('0x7b')]=_0x407623[_0xc3b1('0x7b')];_0x407623[_0xc3b1('0x28')][_0xc3b1('0x7c')]=_0x407623[_0xc3b1('0x7b')];_0x407623[_0xc3b1('0x28')]['event']=_0xc3b1('0x7d');return respondWithRpcPromise('EventManager',_0xc3b1('0x7e'),{'event':'acceptmessage','message':_0x407623['message']},client9002)['then'](function(){return _0x407623;});}return _0x407623;}return null;})[_0xc3b1('0x21')](respondWithResult(_0x195a42,null))[_0xc3b1('0x53')](handleError(_0x195a42,null));};var interaction_log=require(_0xc3b1('0x13'))(_0xc3b1('0x5c'));exports[_0xc3b1('0x33')]=function(_0x5b7b1c,_0x4f3fb3,_0x458ad7){var _0x1698ac={'agent':{},'channel':_0xc3b1('0x5d')};if(_0x5b7b1c[_0xc3b1('0x59')]['id']){delete _0x5b7b1c[_0xc3b1('0x59')]['id'];}_0x5b7b1c[_0xc3b1('0x59')][_0xc3b1('0x60')]=_0x5b7b1c[_0xc3b1('0x59')]['UserId']||_0x5b7b1c['user']['id'];_0x1698ac[_0xc3b1('0x77')]['id']=_0x5b7b1c['body']['UserId'];return db[_0xc3b1('0x3a')][_0xc3b1('0x57')]({'where':{'id':_0x5b7b1c[_0xc3b1('0x55')]['id'],'UserId':null}})[_0xc3b1('0x21')](handleEntityNotFound(_0x4f3fb3,null))[_0xc3b1('0x21')](function(_0x5259ce){if(_0x5259ce){_0x1698ac['message']=_0x5259ce[_0xc3b1('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0xc3b1('0x57')]({'where':{'id':_0x5259ce[_0xc3b1('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4f3fb3,null))[_0xc3b1('0x21')](function(_0x2d206c){if(_0x2d206c){_0x1698ac[_0xc3b1('0x67')]=_0x2d206c[_0xc3b1('0x61')]({'plain':!![]});interaction_log['info'](_0xc3b1('0x7f'),_0x5b7b1c[_0xc3b1('0x69')]['id'],_0x5b7b1c[_0xc3b1('0x69')][_0xc3b1('0x37')],_0x5b7b1c['user'][_0xc3b1('0x6a')],_0x1698ac[_0xc3b1('0x67')]['id'],_0x5b7b1c[_0xc3b1('0x59')]?JSON[_0xc3b1('0x26')](_0x5b7b1c['body']):_0xc3b1('0x6b'));return respondWithRpcPromise(_0xc3b1('0x80'),_0xc3b1('0x81'),_0x1698ac);}return null;})[_0xc3b1('0x21')](function(_0x51b7d3){var _0x10cd0f=_0xc3b1('0x82')+_0x51b7d3['message'][_0xc3b1('0x6e')];return db[_0xc3b1('0x6f')][_0xc3b1('0x40')](_0x10cd0f,{'type':db[_0xc3b1('0x70')][_0xc3b1('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x49b977){return _0x49b977;});})[_0xc3b1('0x21')](function(_0x4d3811){if(_0x4d3811){_0x1698ac[_0xc3b1('0x28')][_0xc3b1('0x73')]=_0x4d3811[0x0];if(!_0x5b7b1c[_0xc3b1('0x59')][_0xc3b1('0x60')])return;return db[_0xc3b1('0x74')][_0xc3b1('0x57')]({'where':{'id':_0x5b7b1c['body'][_0xc3b1('0x60')],'role':'agent'},'attributes':['id',_0xc3b1('0x37'),'fullname',_0xc3b1('0x83'),'internal'],'raw':!![]});}return null;})[_0xc3b1('0x21')](function(_0x31838f){if(!_0x31838f)return null;_0x1698ac['message']['agent']=_0x31838f;return _0x1698ac;})['then'](function(_0x34ed31){if(_0x34ed31){_0x34ed31[_0xc3b1('0x28')][_0xc3b1('0x79')]=util[_0xc3b1('0x66')](_0xc3b1('0x7a'),_0x5b7b1c['user'][_0xc3b1('0x37')]);_0x34ed31[_0xc3b1('0x28')][_0xc3b1('0x7b')]=_0x1698ac[_0xc3b1('0x7b')];_0x34ed31[_0xc3b1('0x28')][_0xc3b1('0x7c')]=_0x1698ac['channel'];_0x34ed31['message'][_0xc3b1('0x84')]=_0xc3b1('0x33');respondWithRpcPromise(_0xc3b1('0x7e'),_0xc3b1('0x7e'),{'event':_0xc3b1('0x85'),'message':_0x34ed31[_0xc3b1('0x28')]},client9002);return _0x1698ac;}return null;})['then'](respondWithResult(_0x4f3fb3,null))[_0xc3b1('0x53')](handleError(_0x4f3fb3,null));};exports[_0xc3b1('0x2b')]=function(_0x527ad6,_0x5bd56e,_0x1064b8){if(_0x527ad6[_0xc3b1('0x59')]['id']){delete _0x527ad6['body']['id'];}var _0xfeac62;return db[_0xc3b1('0x3a')]['find']({'where':{'id':_0x527ad6[_0xc3b1('0x55')]['id']}})[_0xc3b1('0x21')](handleEntityNotFound(_0x5bd56e,null))[_0xc3b1('0x21')](function(_0x270947){if(_0x270947){_0xfeac62=_0x270947;return db['WhatsappAccount'][_0xc3b1('0x57')]({'where':{'id':_0x270947['WhatsappAccountId']}});}})[_0xc3b1('0x21')](handleEntityNotFound(_0x5bd56e,null))['then'](function(_0x6bb4b7){if(_0x6bb4b7){logger[_0xc3b1('0x86')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xc3b1('0x2b'),'received\x20delivery\x20report\x20from',_0x6bb4b7['type'],util[_0xc3b1('0x87')](_0x527ad6['body'],{'showHidden':![],'depth':null}));switch(_0x6bb4b7[_0xc3b1('0x4c')]){case _0xc3b1('0x88'):if(_0x527ad6[_0xc3b1('0x59')][_0xc3b1('0x89')]&&_0x527ad6[_0xc3b1('0x59')][_0xc3b1('0x89')]===_0xfeac62[_0xc3b1('0x8a')]&&_0x527ad6['body'][_0xc3b1('0x8b')]&&_0x527ad6['body'][_0xc3b1('0x8b')]==='read'){return _0xfeac62[_0xc3b1('0x5a')]({'read':!![]});}else{logger[_0xc3b1('0x27')](_0xc3b1('0x8c'),_0xc3b1('0x2b'),_0xc3b1('0x88'),util[_0xc3b1('0x87')](_0x527ad6['body'],{'showHidden':![],'depth':null}));}break;}return _0xfeac62;}})[_0xc3b1('0x21')](respondWithResult(_0x5bd56e,null))[_0xc3b1('0x53')](handleError(_0x5bd56e,null));}; \ No newline at end of file +var _0x2e69=['count','limit','set','Content-Range','apply','reject','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','params','WhatsappMessage','filters','find','body','update','destroy','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','manual','interface','channel','motionChannel','EventManager','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','internal','SIP/%s','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','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','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x552f86,_0x47232d){var _0x76b82d=function(_0x44a24e){while(--_0x44a24e){_0x552f86['push'](_0x552f86['shift']());}};_0x76b82d(++_0x47232d);}(_0x2e69,0x16c));var _0x92e6=function(_0x351b4b,_0x19a26f){_0x351b4b=_0x351b4b-0x0;var _0xed1a7=_0x2e69[_0x351b4b];return _0xed1a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92e6('0x0'));var zipdir=require(_0x92e6('0x1'));var jsonpatch=require(_0x92e6('0x2'));var rp=require('request-promise');var moment=require(_0x92e6('0x3'));var BPromise=require(_0x92e6('0x4'));var Mustache=require(_0x92e6('0x5'));var util=require(_0x92e6('0x6'));var path=require('path');var sox=require(_0x92e6('0x7'));var csv=require('to-csv');var ejs=require(_0x92e6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x92e6('0x9'));var crypto=require(_0x92e6('0xa'));var jsforce=require(_0x92e6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x92e6('0xc'));var querystring=require(_0x92e6('0xd'));var Papa=require(_0x92e6('0xe'));var Redis=require(_0x92e6('0xf'));var authService=require(_0x92e6('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92e6('0x11'));var logger=require(_0x92e6('0x12'))(_0x92e6('0x13'));var utils=require(_0x92e6('0x14'));var config=require(_0x92e6('0x15'));var licenseUtil=require(_0x92e6('0x16'));var db=require(_0x92e6('0x17'))['db'];config[_0x92e6('0x18')]=_['defaults'](config['redis'],{'host':_0x92e6('0x19'),'port':0x18eb});var socket=require(_0x92e6('0x1a'))(new Redis(config['redis']));require(_0x92e6('0x1b'))[_0x92e6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x92e6('0x1d')][_0x92e6('0x1e')]({'port':0x232c});var client9002=jayson[_0x92e6('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0xae32ec,_0x21ca31,_0x4f60f7,_0x505fb5){return new BPromise(function(_0x451bde,_0x403aa3){var _0x1be479=_0x505fb5||client;return _0x1be479[_0x92e6('0x1f')](_0xae32ec,_0x4f60f7)[_0x92e6('0x20')](function(_0x57a0d4){logger[_0x92e6('0x21')](_0x92e6('0x22'),_0x21ca31,_0x92e6('0x23'));logger[_0x92e6('0x24')](_0x92e6('0x25'),_0x21ca31,_0x92e6('0x23'),JSON[_0x92e6('0x26')](_0x57a0d4));if(_0x57a0d4['error']){if(_0x57a0d4[_0x92e6('0x27')][_0x92e6('0x28')]===0x1f4){logger[_0x92e6('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x21ca31,_0x57a0d4[_0x92e6('0x27')][_0x92e6('0x29')]);return _0x403aa3(_0x57a0d4[_0x92e6('0x27')][_0x92e6('0x29')]);}logger['error'](_0x92e6('0x22'),_0x21ca31,_0x57a0d4[_0x92e6('0x27')][_0x92e6('0x29')]);return _0x451bde(_0x57a0d4[_0x92e6('0x27')][_0x92e6('0x29')]);}else{logger[_0x92e6('0x21')](_0x92e6('0x22'),_0x21ca31,_0x92e6('0x23'));_0x451bde(_0x57a0d4[_0x92e6('0x2a')][_0x92e6('0x29')]);}})[_0x92e6('0x2b')](function(_0xb197a6){logger[_0x92e6('0x27')](_0x92e6('0x22'),_0x21ca31,_0xb197a6);_0x403aa3(_0xb197a6);});});}function respondWithStatusCode(_0x492d54,_0x497cb9){_0x497cb9=_0x497cb9||0xcc;return function(_0x3b3565){if(_0x3b3565){return _0x492d54[_0x92e6('0x2c')](_0x497cb9);}return _0x492d54[_0x92e6('0x2d')](_0x497cb9)[_0x92e6('0x2e')]();};}function respondWithResult(_0x187d8d,_0x1c5eef){_0x1c5eef=_0x1c5eef||0xc8;return function(_0x1dc609){if(_0x1dc609){return _0x187d8d[_0x92e6('0x2d')](_0x1c5eef)[_0x92e6('0x2f')](_0x1dc609);}};}function respondWithFilteredResult(_0x13498f,_0x459a02){return function(_0xad0851){if(_0xad0851){var _0x7539f8=typeof _0x459a02[_0x92e6('0x30')]==='undefined'&&typeof _0x459a02['limit']===_0x92e6('0x31');var _0x866c0d=_0xad0851[_0x92e6('0x32')];var _0x37d8ef=_0x7539f8?0x0:_0x459a02[_0x92e6('0x30')];var _0x480294=_0x7539f8?_0xad0851[_0x92e6('0x32')]:_0x459a02[_0x92e6('0x30')]+_0x459a02[_0x92e6('0x33')];var _0x15ca3a;if(_0x480294>=_0x866c0d){_0x480294=_0x866c0d;_0x15ca3a=0xc8;}else{_0x15ca3a=0xce;}_0x13498f['status'](_0x15ca3a);return _0x13498f[_0x92e6('0x34')](_0x92e6('0x35'),_0x37d8ef+'-'+_0x480294+'/'+_0x866c0d)[_0x92e6('0x2f')](_0xad0851);}return null;};}function patchUpdates(_0x1c5ddd){return function(_0x1e6d3a){try{jsonpatch[_0x92e6('0x36')](_0x1e6d3a,_0x1c5ddd,!![]);}catch(_0x46ac89){return BPromise[_0x92e6('0x37')](_0x46ac89);}return _0x1e6d3a['save']();};}function saveUpdates(_0x3ffbdc,_0x3119e0){return function(_0x1b77d7){if(_0x1b77d7){return _0x1b77d7['update'](_0x3ffbdc)['then'](function(_0xfbe0dc){return _0xfbe0dc;});}return null;};}function removeEntity(_0x309902,_0x215078){return function(_0xa1a5d3){if(_0xa1a5d3){return _0xa1a5d3['destroy']()['then'](function(){_0x309902[_0x92e6('0x2d')](0xcc)[_0x92e6('0x2e')]();});}};}function handleEntityNotFound(_0x1f5a4f,_0x255e15){return function(_0x297b3f){if(!_0x297b3f){_0x1f5a4f[_0x92e6('0x2c')](0x194);}return _0x297b3f;};}function handleError(_0x6ba1e6,_0xa7b40e){_0xa7b40e=_0xa7b40e||0x1f4;return function(_0x5c2551){logger['error'](_0x5c2551[_0x92e6('0x38')]);if(_0x5c2551[_0x92e6('0x39')]){delete _0x5c2551[_0x92e6('0x39')];}_0x6ba1e6[_0x92e6('0x2d')](_0xa7b40e)[_0x92e6('0x3a')](_0x5c2551);};}exports[_0x92e6('0x3b')]=function(_0x4acc52,_0x7d0760){var _0x36fbe9={},_0x976ee5={},_0x46f4af={'count':0x0,'rows':[]};var _0x1fe510=_['map'](db['WhatsappMessage'][_0x92e6('0x3c')],function(_0x55e570){return{'name':_0x55e570[_0x92e6('0x3d')],'type':_0x55e570[_0x92e6('0x3e')][_0x92e6('0x3f')]};});_0x976ee5['model']=_['map'](_0x1fe510,_0x92e6('0x39'));_0x976ee5[_0x92e6('0x40')]=_[_0x92e6('0x41')](_0x4acc52[_0x92e6('0x40')]);_0x976ee5['filters']=_[_0x92e6('0x42')](_0x976ee5[_0x92e6('0x43')],_0x976ee5[_0x92e6('0x40')]);_0x36fbe9['attributes']=_['intersection'](_0x976ee5[_0x92e6('0x43')],qs[_0x92e6('0x44')](_0x4acc52[_0x92e6('0x40')]['fields']));_0x36fbe9[_0x92e6('0x45')]=_0x36fbe9['attributes'][_0x92e6('0x46')]?_0x36fbe9['attributes']:_0x976ee5[_0x92e6('0x43')];if(!_0x4acc52[_0x92e6('0x40')][_0x92e6('0x47')]('nolimit')){_0x36fbe9[_0x92e6('0x33')]=qs[_0x92e6('0x33')](_0x4acc52[_0x92e6('0x40')][_0x92e6('0x33')]);_0x36fbe9[_0x92e6('0x30')]=qs[_0x92e6('0x30')](_0x4acc52[_0x92e6('0x40')][_0x92e6('0x30')]);}_0x36fbe9[_0x92e6('0x48')]=qs[_0x92e6('0x49')](_0x4acc52['query']['sort']);_0x36fbe9['where']=qs['filters'](_[_0x92e6('0x4a')](_0x4acc52[_0x92e6('0x40')],_0x976ee5['filters']),_0x1fe510);if(_0x4acc52[_0x92e6('0x40')][_0x92e6('0x4b')]){_0x36fbe9[_0x92e6('0x4c')]=_[_0x92e6('0x4d')](_0x36fbe9[_0x92e6('0x4c')],{'$or':_['map'](_0x1fe510,function(_0x3660c9){if(_0x3660c9[_0x92e6('0x3e')]!=='VIRTUAL'){var _0x33dadb={};_0x33dadb[_0x3660c9[_0x92e6('0x39')]]={'$like':'%'+_0x4acc52[_0x92e6('0x40')]['filter']+'%'};return _0x33dadb;}})});}_0x36fbe9=_[_0x92e6('0x4d')]({},_0x36fbe9,_0x4acc52[_0x92e6('0x4e')]);var _0x56a6c1={'where':_0x36fbe9['where']};return db['WhatsappMessage'][_0x92e6('0x32')](_0x56a6c1)[_0x92e6('0x20')](function(_0x3eb322){_0x46f4af[_0x92e6('0x32')]=_0x3eb322;if(_0x4acc52[_0x92e6('0x40')][_0x92e6('0x4f')]){_0x36fbe9[_0x92e6('0x50')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x92e6('0x51')](_0x36fbe9);})[_0x92e6('0x20')](function(_0x156650){_0x46f4af['rows']=_0x156650;return _0x46f4af;})[_0x92e6('0x20')](respondWithFilteredResult(_0x7d0760,_0x36fbe9))[_0x92e6('0x2b')](handleError(_0x7d0760,null));};exports['show']=function(_0x4c8a09,_0x3ad8fd){var _0x2bed46={'raw':!![],'where':{'id':_0x4c8a09[_0x92e6('0x52')]['id']}},_0x2e1c5f={};_0x2e1c5f[_0x92e6('0x43')]=_[_0x92e6('0x41')](db[_0x92e6('0x53')]['rawAttributes']);_0x2e1c5f[_0x92e6('0x40')]=_['keys'](_0x4c8a09[_0x92e6('0x40')]);_0x2e1c5f[_0x92e6('0x54')]=_[_0x92e6('0x42')](_0x2e1c5f[_0x92e6('0x43')],_0x2e1c5f[_0x92e6('0x40')]);_0x2bed46['attributes']=_[_0x92e6('0x42')](_0x2e1c5f[_0x92e6('0x43')],qs['fields'](_0x4c8a09[_0x92e6('0x40')]['fields']));_0x2bed46[_0x92e6('0x45')]=_0x2bed46['attributes']['length']?_0x2bed46[_0x92e6('0x45')]:_0x2e1c5f[_0x92e6('0x43')];if(_0x4c8a09[_0x92e6('0x40')][_0x92e6('0x4f')]){_0x2bed46[_0x92e6('0x50')]=[{'all':!![]}];}_0x2bed46=_['merge']({},_0x2bed46,_0x4c8a09[_0x92e6('0x4e')]);return db[_0x92e6('0x53')][_0x92e6('0x55')](_0x2bed46)[_0x92e6('0x20')](handleEntityNotFound(_0x3ad8fd,null))[_0x92e6('0x20')](respondWithResult(_0x3ad8fd,null))[_0x92e6('0x2b')](handleError(_0x3ad8fd,null));};exports['create']=function(_0x5dcd53,_0x56bd15){return db[_0x92e6('0x53')]['create'](_0x5dcd53[_0x92e6('0x56')],{})[_0x92e6('0x20')](respondWithResult(_0x56bd15,0xc9))['catch'](handleError(_0x56bd15,null));};exports[_0x92e6('0x57')]=function(_0x41d288,_0x3dbb49){if(_0x41d288['body']['id']){delete _0x41d288[_0x92e6('0x56')]['id'];}return db[_0x92e6('0x53')][_0x92e6('0x55')]({'where':{'id':_0x41d288[_0x92e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x3dbb49,null))[_0x92e6('0x20')](saveUpdates(_0x41d288[_0x92e6('0x56')],null))[_0x92e6('0x20')](respondWithResult(_0x3dbb49,null))[_0x92e6('0x2b')](handleError(_0x3dbb49,null));};exports[_0x92e6('0x58')]=function(_0xdf29f7,_0x1337e7){return db[_0x92e6('0x53')][_0x92e6('0x55')]({'where':{'id':_0xdf29f7[_0x92e6('0x52')]['id']}})[_0x92e6('0x20')](handleEntityNotFound(_0x1337e7,null))[_0x92e6('0x20')](removeEntity(_0x1337e7,null))[_0x92e6('0x2b')](handleError(_0x1337e7,null));};exports[_0x92e6('0x59')]=function(_0x5022e9,_0x3d1e73){return db['WhatsappMessage']['describe']()['then'](respondWithResult(_0x3d1e73,null))['catch'](handleError(_0x3d1e73,null));};var interaction_log=require('../../config/logger')(_0x92e6('0x5a'));exports[_0x92e6('0x5b')]=function(_0x18a28e,_0x438dd5,_0x58d166){var _0x234ee5={'agent':{},'channel':'whatsapp'};if(_0x18a28e[_0x92e6('0x56')]['id']){delete _0x18a28e[_0x92e6('0x56')]['id'];}_0x18a28e[_0x92e6('0x56')][_0x92e6('0x5c')]=!![];_0x18a28e[_0x92e6('0x56')][_0x92e6('0x5d')]=moment()[_0x92e6('0x5e')](_0x92e6('0x5f'));_0x18a28e['body'][_0x92e6('0x60')]=_0x18a28e[_0x92e6('0x56')]['UserId']||_0x18a28e[_0x92e6('0x61')]['id'];_0x234ee5[_0x92e6('0x62')]['id']=_0x18a28e[_0x92e6('0x56')]['UserId'];return db[_0x92e6('0x53')][_0x92e6('0x55')]({'where':{'id':_0x18a28e[_0x92e6('0x52')]['id'],'UserId':null}})[_0x92e6('0x20')](handleEntityNotFound(_0x438dd5,null))[_0x92e6('0x20')](saveUpdates(_0x18a28e[_0x92e6('0x56')],null))['then'](function(_0x3b9e3d){if(_0x3b9e3d){_0x234ee5[_0x92e6('0x29')]=_0x3b9e3d[_0x92e6('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0x92e6('0x55')]({'where':{'id':_0x3b9e3d['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x438dd5,null))['then'](function(_0x4eb0e2){if(_0x4eb0e2){return _0x4eb0e2[_0x92e6('0x57')]({'UserId':_0x18a28e[_0x92e6('0x56')][_0x92e6('0x60')],'read1stAt':_[_0x92e6('0x64')](_0x4eb0e2[_0x92e6('0x65')])?moment()[_0x92e6('0x5e')](_0x92e6('0x5f')):undefined});}return null;})['then'](function(_0x2da47e){if(_0x2da47e){_0x234ee5[_0x92e6('0x66')]=_0x2da47e[_0x92e6('0x63')]({'plain':!![]});interaction_log[_0x92e6('0x21')](_0x92e6('0x67'),_0x18a28e[_0x92e6('0x61')]['id'],_0x18a28e[_0x92e6('0x61')][_0x92e6('0x39')],_0x18a28e[_0x92e6('0x61')][_0x92e6('0x68')],_0x234ee5[_0x92e6('0x66')]['id'],_0x18a28e[_0x92e6('0x56')]?JSON['stringify'](_0x18a28e[_0x92e6('0x56')]):_0x92e6('0x69'));return respondWithRpcPromise(_0x92e6('0x6a'),'acceptMessage',_0x234ee5);}return null;})[_0x92e6('0x20')](function(_0x4c5cb1){var _0x32244a=_0x92e6('0x6b')+_0x4c5cb1[_0x92e6('0x29')][_0x92e6('0x6c')];return db[_0x92e6('0x6d')][_0x92e6('0x40')](_0x32244a,{'type':db[_0x92e6('0x6e')][_0x92e6('0x6f')]['SELECT'],'raw':!![]})[_0x92e6('0x20')](function(_0x42365c){return _0x42365c;});})[_0x92e6('0x20')](function(_0x49b99d){if(_0x49b99d){_0x234ee5[_0x92e6('0x29')][_0x92e6('0x70')]=_0x49b99d[0x0];if(!_0x18a28e[_0x92e6('0x56')]['UserId'])return;return db[_0x92e6('0x71')][_0x92e6('0x55')]({'where':{'id':_0x18a28e[_0x92e6('0x56')][_0x92e6('0x60')],'role':_0x92e6('0x62')},'attributes':['id',_0x92e6('0x39'),_0x92e6('0x72'),_0x92e6('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x59110e){if(!_0x59110e)return null;_0x234ee5[_0x92e6('0x29')][_0x92e6('0x62')]=_0x59110e;return _0x234ee5;})[_0x92e6('0x20')](function(_0x3b98cd){if(_0x3b98cd){if(_0x18a28e[_0x92e6('0x56')][_0x92e6('0x74')]){_0x234ee5['message'][_0x92e6('0x75')]=util[_0x92e6('0x5e')]('SIP/%s',_0x18a28e[_0x92e6('0x61')]['name']);_0x234ee5['message'][_0x92e6('0x76')]=_0x234ee5[_0x92e6('0x76')];_0x234ee5['message'][_0x92e6('0x77')]=_0x234ee5[_0x92e6('0x76')];_0x234ee5[_0x92e6('0x29')]['event']=_0x92e6('0x5b');return respondWithRpcPromise(_0x92e6('0x78'),_0x92e6('0x78'),{'event':'acceptmessage','message':_0x234ee5[_0x92e6('0x29')]},client9002)['then'](function(){return _0x234ee5;});}return _0x234ee5;}return null;})[_0x92e6('0x20')](respondWithResult(_0x438dd5,null))['catch'](handleError(_0x438dd5,null));};var interaction_log=require(_0x92e6('0x12'))(_0x92e6('0x5a'));exports[_0x92e6('0x37')]=function(_0x111b5b,_0x569b07,_0x8e428c){var _0xe06a3f={'agent':{},'channel':'whatsapp'};if(_0x111b5b[_0x92e6('0x56')]['id']){delete _0x111b5b['body']['id'];}_0x111b5b[_0x92e6('0x56')][_0x92e6('0x60')]=_0x111b5b['body'][_0x92e6('0x60')]||_0x111b5b[_0x92e6('0x61')]['id'];_0xe06a3f['agent']['id']=_0x111b5b[_0x92e6('0x56')]['UserId'];return db[_0x92e6('0x53')][_0x92e6('0x55')]({'where':{'id':_0x111b5b['params']['id'],'UserId':null}})[_0x92e6('0x20')](handleEntityNotFound(_0x569b07,null))[_0x92e6('0x20')](function(_0x6173ae){if(_0x6173ae){_0xe06a3f[_0x92e6('0x29')]=_0x6173ae[_0x92e6('0x63')]({'plain':!![]});return db[_0x92e6('0x79')]['find']({'where':{'id':_0x6173ae[_0x92e6('0x7a')]}});}return null;})[_0x92e6('0x20')](handleEntityNotFound(_0x569b07,null))[_0x92e6('0x20')](function(_0x35bc2f){if(_0x35bc2f){_0xe06a3f['interaction']=_0x35bc2f[_0x92e6('0x63')]({'plain':!![]});interaction_log[_0x92e6('0x21')](_0x92e6('0x7b'),_0x111b5b[_0x92e6('0x61')]['id'],_0x111b5b[_0x92e6('0x61')][_0x92e6('0x39')],_0x111b5b[_0x92e6('0x61')][_0x92e6('0x68')],_0xe06a3f['interaction']['id'],_0x111b5b[_0x92e6('0x56')]?JSON[_0x92e6('0x26')](_0x111b5b['body']):_0x92e6('0x69'));return respondWithRpcPromise('RejectMessage',_0x92e6('0x7c'),_0xe06a3f);}return null;})[_0x92e6('0x20')](function(_0x1b45cc){var _0x14552a=_0x92e6('0x6b')+_0x1b45cc[_0x92e6('0x29')][_0x92e6('0x6c')];return db[_0x92e6('0x6d')][_0x92e6('0x40')](_0x14552a,{'type':db[_0x92e6('0x6e')][_0x92e6('0x6f')]['SELECT'],'raw':!![]})[_0x92e6('0x20')](function(_0x227173){return _0x227173;});})[_0x92e6('0x20')](function(_0x56b038){if(_0x56b038){_0xe06a3f['message'][_0x92e6('0x70')]=_0x56b038[0x0];if(!_0x111b5b[_0x92e6('0x56')]['UserId'])return;return db[_0x92e6('0x71')][_0x92e6('0x55')]({'where':{'id':_0x111b5b[_0x92e6('0x56')][_0x92e6('0x60')],'role':_0x92e6('0x62')},'attributes':['id',_0x92e6('0x39'),'fullname',_0x92e6('0x73'),_0x92e6('0x7d')],'raw':!![]});}return null;})['then'](function(_0x519a02){if(!_0x519a02)return null;_0xe06a3f['message']['agent']=_0x519a02;return _0xe06a3f;})[_0x92e6('0x20')](function(_0x298943){if(_0x298943){_0x298943[_0x92e6('0x29')]['interface']=util[_0x92e6('0x5e')](_0x92e6('0x7e'),_0x111b5b[_0x92e6('0x61')][_0x92e6('0x39')]);_0x298943[_0x92e6('0x29')]['channel']=_0xe06a3f[_0x92e6('0x76')];_0x298943[_0x92e6('0x29')][_0x92e6('0x77')]=_0xe06a3f[_0x92e6('0x76')];_0x298943[_0x92e6('0x29')][_0x92e6('0x7f')]='reject';respondWithRpcPromise(_0x92e6('0x78'),'EventManager',{'event':_0x92e6('0x80'),'message':_0x298943[_0x92e6('0x29')]},client9002);return _0xe06a3f;}return null;})[_0x92e6('0x20')](respondWithResult(_0x569b07,null))[_0x92e6('0x2b')](handleError(_0x569b07,null));};exports[_0x92e6('0x2d')]=function(_0x4f7d21,_0x1ff95f,_0x2fd577){if(_0x4f7d21[_0x92e6('0x56')]['id']){delete _0x4f7d21[_0x92e6('0x56')]['id'];}var _0x34e71e;return db[_0x92e6('0x53')][_0x92e6('0x55')]({'where':{'id':_0x4f7d21[_0x92e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x1ff95f,null))[_0x92e6('0x20')](function(_0x43d446){if(_0x43d446){_0x34e71e=_0x43d446;return db[_0x92e6('0x81')][_0x92e6('0x55')]({'where':{'id':_0x43d446[_0x92e6('0x82')]}});}})[_0x92e6('0x20')](handleEntityNotFound(_0x1ff95f,null))[_0x92e6('0x20')](function(_0x2f03a8){if(_0x2f03a8){logger[_0x92e6('0x24')](_0x92e6('0x83'),_0x92e6('0x2d'),_0x92e6('0x84'),_0x2f03a8[_0x92e6('0x3e')],util[_0x92e6('0x85')](_0x4f7d21[_0x92e6('0x56')],{'showHidden':![],'depth':null}));switch(_0x2f03a8['type']){case _0x92e6('0x86'):if(_0x4f7d21[_0x92e6('0x56')][_0x92e6('0x87')]&&_0x4f7d21[_0x92e6('0x56')][_0x92e6('0x87')]===_0x34e71e['messageId']&&_0x4f7d21[_0x92e6('0x56')][_0x92e6('0x88')]&&_0x4f7d21['body'][_0x92e6('0x88')]===_0x92e6('0x5c')){return _0x34e71e[_0x92e6('0x57')]({'read':!![]});}else{logger[_0x92e6('0x27')](_0x92e6('0x89'),_0x92e6('0x2d'),_0x92e6('0x86'),util[_0x92e6('0x85')](_0x4f7d21[_0x92e6('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x34e71e;}})[_0x92e6('0x20')](respondWithResult(_0x1ff95f,null))[_0x92e6('0x2b')](handleError(_0x1ff95f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 6262a7a..acae5fb 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 _0x087b=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x34643f,_0x3ff34b){var _0x177f20=function(_0x4b4da8){while(--_0x4b4da8){_0x34643f['push'](_0x34643f['shift']());}};_0x177f20(++_0x3ff34b);}(_0x087b,0x11a));var _0xb087=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x087b[_0x432fca];return _0x3adba4;};'use strict';var EventEmitter=require(_0xb087('0x0'));var WhatsappMessage=require(_0xb087('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb087('0x2'),'afterUpdate':'update','afterDestroy':_0xb087('0x3')};function emitEvent(_0x2020b7){return function(_0x1d3299,_0xf1cf84,_0x183efd){WhatsappMessageEvents[_0xb087('0x4')](_0x2020b7+':'+_0x1d3299['id'],_0x1d3299);WhatsappMessageEvents[_0xb087('0x4')](_0x2020b7,_0x1d3299);_0x183efd(null);};}for(var e in events){if(events[_0xb087('0x5')](e)){var event=events[e];WhatsappMessage[_0xb087('0x6')](e,emitEvent(event));}}module[_0xb087('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0xa25c=['WhatsappMessage','setMaxListeners','save','update','remove','hasOwnProperty','exports','../../mysqldb'];(function(_0x197ae6,_0x711c0a){var _0x28d275=function(_0x48f4a4){while(--_0x48f4a4){_0x197ae6['push'](_0x197ae6['shift']());}};_0x28d275(++_0x711c0a);}(_0xa25c,0x13f));var _0xca25=function(_0xd3c515,_0x27b9bf){_0xd3c515=_0xd3c515-0x0;var _0x526fac=_0xa25c[_0xd3c515];return _0x526fac;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xca25('0x0'))['db'][_0xca25('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xca25('0x2')](0x0);var events={'afterCreate':_0xca25('0x3'),'afterUpdate':_0xca25('0x4'),'afterDestroy':_0xca25('0x5')};function emitEvent(_0x2cc2d6){return function(_0x336741,_0x498b8e,_0x41d208){WhatsappMessageEvents['emit'](_0x2cc2d6+':'+_0x336741['id'],_0x336741);WhatsappMessageEvents['emit'](_0x2cc2d6,_0x336741);_0x41d208(null);};}for(var e in events){if(events[_0xca25('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xca25('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 4e04570..f16dd7d 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 _0x9bf7=['toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','whatsapp:','phone','remote','/api/whatsapp/messages/','token','sid','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','POST','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction'];(function(_0x536515,_0xa21705){var _0x23885e=function(_0xe7d566){while(--_0xe7d566){_0x536515['push'](_0x536515['shift']());}};_0x23885e(++_0xa21705);}(_0x9bf7,0x149));var _0x79bf=function(_0x255c90,_0x3bc8ac){_0x255c90=_0x255c90-0x0;var _0x795251=_0x9bf7[_0x255c90];return _0x795251;};'use strict';var _=require('lodash');var util=require(_0x79bf('0x0'));var logger=require(_0x79bf('0x1'))(_0x79bf('0x2'));var moment=require(_0x79bf('0x3'));var BPromise=require('bluebird');var rp=require(_0x79bf('0x4'));var fetch=require(_0x79bf('0x5'));var fs=require('fs');var path=require(_0x79bf('0x6'));var rimraf=require(_0x79bf('0x7'));var config=require(_0x79bf('0x8'));var attributes=require(_0x79bf('0x9'));module['exports']=function(_0x421fe8,_0x5cc67b){return _0x421fe8['define'](_0x79bf('0xa'),attributes,{'tableName':_0x79bf('0xb'),'paranoid':![],'indexes':[{'name':_0x79bf('0xc'),'fields':['messageId']},{'name':_0x79bf('0xd'),'fields':[_0x79bf('0xe')],'type':_0x79bf('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35f41f,_0x4e2b85,_0x3129e2){var _0xd7e8d9=_0x421fe8[_0x79bf('0x10')];var _0x42db85=_0x35f41f[_0x79bf('0x11')]({'plain':!![]});if(_0x42db85[_0x79bf('0x12')][_0x79bf('0x13')]()==='in'||_0x42db85[_0x79bf('0x12')]['toLowerCase']()===_0x79bf('0x14')&&!_0x42db85[_0x79bf('0x15')]&&!_[_0x79bf('0x16')](_0x42db85[_0x79bf('0x17')])){_0xd7e8d9['WhatsappInteraction'][_0x79bf('0x18')]({'where':{'id':_0x42db85[_0x79bf('0x19')]}})[_0x79bf('0x1a')](function(_0x407d8b){if(_0x407d8b){_0x407d8b[_0x79bf('0x1b')]({'lastMsgAt':_0x42db85[_0x79bf('0x1c')],'lastMsgDirection':_0x42db85[_0x79bf('0x12')][_0x79bf('0x13')]()});}})[_0x79bf('0x1d')](function(_0x41ad7a){console[_0x79bf('0x1e')](_0x41ad7a);});}if(_0x42db85[_0x79bf('0x12')]===_0x79bf('0x14')&&!_0x42db85[_0x79bf('0x15')]){var _0x36dda4;_0xd7e8d9[_0x79bf('0x1f')][_0x79bf('0x20')]({'where':{'id':_0x42db85[_0x79bf('0x21')]},'raw':!![]})[_0x79bf('0x1a')](function(_0x35e95){_0x36dda4=_0x35e95;if(_0x36dda4&&_0x36dda4[_0x79bf('0x22')]){switch(_0x36dda4[_0x79bf('0x22')]){case'twilio':var _0x4589d9=require(_0x79bf('0x23'));if(_0x36dda4[_0x79bf('0x24')]&&_0x36dda4['authToken']&&_0x36dda4['phone']){var _0x2cd9e9=new _0x4589d9(_0x36dda4['accountSid'],_0x36dda4[_0x79bf('0x25')]);_0x2cd9e9['messages']['create']({'body':_0x42db85['body'],'to':_0x79bf('0x26')+_0x42db85[_0x79bf('0x27')],'from':_0x79bf('0x26')+_0x36dda4[_0x79bf('0x27')],'statusCallback':_0x36dda4[_0x79bf('0x28')]+_0x79bf('0x29')+_0x42db85['id']+'/status?token='+_0x36dda4[_0x79bf('0x2a')]})[_0x79bf('0x1a')](function(_0x327ae0){if(_0x327ae0[_0x79bf('0x2b')]){return _0x35f41f[_0x79bf('0x1b')]({'messageId':_0x327ae0['sid']});}})[_0x79bf('0x1d')](function(_0x4a26be){logger[_0x79bf('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x79bf('0x23'),util[_0x79bf('0x2c')](_0x4a26be,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x79bf('0x2d'),_0x79bf('0x2e'),'twilio',_0x79bf('0x2f'));}break;case _0x79bf('0x30'):var _0x14941b=_0x36dda4[_0x79bf('0x24')];var _0x224867=_0x36dda4[_0x79bf('0x25')];var _0x30acc0=_0x36dda4[_0x79bf('0x31')]+'/whatsapp/v1/'+_0x14941b+_0x79bf('0x32');var _0x4f87b5={'to':[_0x42db85['phone']],'message':{'type':'text','text':_0x42db85[_0x79bf('0xe')]}};var _0x5a7b0c={'method':_0x79bf('0x33'),'uri':_0x30acc0,'headers':{'Authorization':_0x79bf('0x34')+_0x224867,'Content-Type':'application/json'},'body':_0x4f87b5,'json':!![]};rp(_0x5a7b0c)['then'](function(_0x18ec8b){if(_0x18ec8b[_0x79bf('0x35')][0x0][_0x79bf('0x36')]){return _0x35f41f['update']({'messageId':_0x18ec8b[_0x79bf('0x35')][0x0][_0x79bf('0x36')]});}})[_0x79bf('0x1d')](function(_0x1a0a9e){logger['err'](_0x79bf('0x37'),_0x1a0a9e);});break;}}})['finally'](function(){_0x3129e2();});}else{_0x3129e2();}}},'charset':_0x79bf('0x38'),'collate':_0x79bf('0x39')});}; \ No newline at end of file +var _0x3286=['UserId','WhatsappInteractionId','then','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x31c1c2,_0x4f2dba){var _0x1007fd=function(_0x38c739){while(--_0x38c739){_0x31c1c2['push'](_0x31c1c2['shift']());}};_0x1007fd(++_0x4f2dba);}(_0x3286,0x1da));var _0x6328=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3286[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6328('0x0'));var util=require('util');var logger=require(_0x6328('0x1'))('api');var moment=require(_0x6328('0x2'));var BPromise=require(_0x6328('0x3'));var rp=require(_0x6328('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x6328('0x5'));var rimraf=require(_0x6328('0x6'));var config=require(_0x6328('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x6328('0x8')]=function(_0x400f23,_0xbdeec8){return _0x400f23['define'](_0x6328('0x9'),attributes,{'tableName':_0x6328('0xa'),'paranoid':![],'indexes':[{'name':_0x6328('0xb'),'fields':[_0x6328('0xb')]},{'name':_0x6328('0xc'),'fields':[_0x6328('0xd')],'type':_0x6328('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51a8fe,_0x574868,_0x569178){var _0x2ba813=_0x400f23[_0x6328('0xf')];var _0x4acd31=_0x51a8fe[_0x6328('0x10')]({'plain':!![]});if(_0x4acd31['direction']['toLowerCase']()==='in'||_0x4acd31[_0x6328('0x11')][_0x6328('0x12')]()===_0x6328('0x13')&&!_0x4acd31[_0x6328('0x14')]&&!_[_0x6328('0x15')](_0x4acd31[_0x6328('0x16')])){_0x2ba813['WhatsappInteraction']['findOne']({'where':{'id':_0x4acd31[_0x6328('0x17')]}})[_0x6328('0x18')](function(_0x1db8e5){if(_0x1db8e5){_0x1db8e5['update']({'lastMsgAt':_0x4acd31[_0x6328('0x19')],'lastMsgDirection':_0x4acd31[_0x6328('0x11')][_0x6328('0x12')]()});}})[_0x6328('0x1a')](function(_0x56a278){console[_0x6328('0x1b')](_0x56a278);});}if(_0x4acd31['direction']==='out'&&!_0x4acd31[_0x6328('0x14')]){var _0xe20096;_0x2ba813[_0x6328('0x1c')]['find']({'where':{'id':_0x4acd31[_0x6328('0x1d')]},'raw':!![]})[_0x6328('0x18')](function(_0x23d564){_0xe20096=_0x23d564;if(_0xe20096&&_0xe20096['type']){switch(_0xe20096[_0x6328('0x1e')]){case'twilio':var _0xe4c846=require(_0x6328('0x1f'));if(_0xe20096[_0x6328('0x20')]&&_0xe20096[_0x6328('0x21')]&&_0xe20096[_0x6328('0x22')]){var _0x1d1abb=new _0xe4c846(_0xe20096[_0x6328('0x20')],_0xe20096[_0x6328('0x21')]);_0x1d1abb[_0x6328('0x23')][_0x6328('0x24')]({'body':_0x4acd31[_0x6328('0xd')],'to':_0x6328('0x25')+_0x4acd31[_0x6328('0x22')],'from':_0x6328('0x25')+_0xe20096[_0x6328('0x22')],'statusCallback':_0xe20096[_0x6328('0x26')]+_0x6328('0x27')+_0x4acd31['id']+_0x6328('0x28')+_0xe20096[_0x6328('0x29')]})[_0x6328('0x18')](function(_0x52cde9){if(_0x52cde9[_0x6328('0x2a')]){return _0x51a8fe[_0x6328('0x2b')]({'messageId':_0x52cde9[_0x6328('0x2a')]});}})[_0x6328('0x1a')](function(_0x1d8be7){logger[_0x6328('0x1b')](_0x6328('0x2c'),'afterCreate',_0x6328('0x1f'),util[_0x6328('0x2d')](_0x1d8be7,{'showHidden':![],'depth':null}));});}else{logger[_0x6328('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x6328('0x2e'),'twilio',_0x6328('0x2f'));}break;case _0x6328('0x30'):var _0x17c37b=_0xe20096[_0x6328('0x20')];var _0x54abbc=_0xe20096['authToken'];var _0x591698=_0xe20096[_0x6328('0x31')]+_0x6328('0x32')+_0x17c37b+_0x6328('0x33');var _0x3a9239={'to':[_0x4acd31[_0x6328('0x22')]],'message':{'type':_0x6328('0x34'),'text':_0x4acd31[_0x6328('0xd')]}};var _0x5dfa1f={'method':_0x6328('0x35'),'uri':_0x591698,'headers':{'Authorization':'Bearer\x20'+_0x54abbc,'Content-Type':_0x6328('0x36')},'body':_0x3a9239,'json':!![]};rp(_0x5dfa1f)['then'](function(_0x3caa7e){if(_0x3caa7e['statuses'][0x0][_0x6328('0x37')]){return _0x51a8fe[_0x6328('0x2b')]({'messageId':_0x3caa7e[_0x6328('0x38')][0x0]['message_id']});}})[_0x6328('0x1a')](function(_0x549a3b){logger[_0x6328('0x39')](_0x6328('0x3a'),_0x549a3b);});break;}}})[_0x6328('0x3b')](function(){_0x569178();});}else{_0x569178();}}},'charset':_0x6328('0x3c'),'collate':_0x6328('0x3d')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 1703d98..c442778 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 _0x16ac=['request\x20sent','debug','stringify','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s'];(function(_0x45203d,_0x376d1c){var _0x409772=function(_0x16822d){while(--_0x16822d){_0x45203d['push'](_0x45203d['shift']());}};_0x409772(++_0x376d1c);}(_0x16ac,0x10e));var _0xc16a=function(_0x3c24c3,_0x39888b){_0x3c24c3=_0x3c24c3-0x0;var _0x23e5e0=_0x16ac[_0x3c24c3];return _0x23e5e0;};'use strict';var _=require(_0xc16a('0x0'));var util=require('util');var moment=require(_0xc16a('0x1'));var BPromise=require('bluebird');var rs=require(_0xc16a('0x2'));var fs=require('fs');var Redis=require(_0xc16a('0x3'));var db=require(_0xc16a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc16a('0x5'))(_0xc16a('0x6'));var config=require(_0xc16a('0x7'));var jayson=require(_0xc16a('0x8'));var client=jayson[_0xc16a('0x9')]['http']({'port':0x232a});config[_0xc16a('0xa')]=_[_0xc16a('0xb')](config[_0xc16a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc16a('0xc'))(new Redis(config[_0xc16a('0xa')]));require('./whatsappMessage.socket')[_0xc16a('0xd')](socket);function respondWithRpcPromise(_0x2f5fa3,_0x316ac4,_0x2660f8){return new BPromise(function(_0x2f3cc6,_0x4ec86b){return client[_0xc16a('0xe')](_0x2f5fa3,_0x2660f8)[_0xc16a('0xf')](function(_0x38c8e2){logger[_0xc16a('0x10')](_0xc16a('0x11'),_0x316ac4,_0xc16a('0x12'));logger[_0xc16a('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x316ac4,_0xc16a('0x12'),JSON[_0xc16a('0x14')](_0x38c8e2));if(_0x38c8e2[_0xc16a('0x15')]){if(_0x38c8e2[_0xc16a('0x15')][_0xc16a('0x16')]===0x1f4){logger[_0xc16a('0x15')](_0xc16a('0x11'),_0x316ac4,_0x38c8e2[_0xc16a('0x15')]['message']);return _0x4ec86b(_0x38c8e2[_0xc16a('0x15')][_0xc16a('0x17')]);}logger[_0xc16a('0x15')](_0xc16a('0x11'),_0x316ac4,_0x38c8e2[_0xc16a('0x15')][_0xc16a('0x17')]);return _0x2f3cc6(_0x38c8e2[_0xc16a('0x15')]['message']);}else{logger['info'](_0xc16a('0x11'),_0x316ac4,_0xc16a('0x12'));_0x2f3cc6(_0x38c8e2[_0xc16a('0x18')][_0xc16a('0x17')]);}})['catch'](function(_0x967d63){logger[_0xc16a('0x15')](_0xc16a('0x11'),_0x316ac4,_0x967d63);_0x4ec86b(_0x967d63);});});}exports[_0xc16a('0x19')]=function(_0x534d2e){var _0x3c0e68=this;return new Promise(function(_0x5806e7,_0x8e9d85){return db[_0xc16a('0x1a')][_0xc16a('0x1b')](_0x534d2e[_0xc16a('0x1c')],{'raw':_0x534d2e['options']?_0x534d2e[_0xc16a('0x1d')][_0xc16a('0x1e')]===undefined?!![]:![]:!![]})[_0xc16a('0xf')](function(_0x1d790e){logger[_0xc16a('0x10')]('CreateWhatsappMessage',_0x534d2e);logger['debug'](_0xc16a('0x19'),_0x534d2e,JSON[_0xc16a('0x14')](_0x1d790e));_0x5806e7(_0x1d790e);})[_0xc16a('0x1f')](function(_0x14cbf3){logger[_0xc16a('0x15')](_0xc16a('0x19'),_0x14cbf3[_0xc16a('0x17')],_0x534d2e);_0x8e9d85(_0x3c0e68['error'](0x1f4,_0x14cbf3[_0xc16a('0x17')]));});});}; \ No newline at end of file +var _0x87d2=['register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','defaults','redis','socket.io-emitter'];(function(_0x4c1883,_0x38441b){var _0x47ea1d=function(_0x37b384){while(--_0x37b384){_0x4c1883['push'](_0x4c1883['shift']());}};_0x47ea1d(++_0x38441b);}(_0x87d2,0x1b6));var _0x287d=function(_0x322160,_0x59ac1a){_0x322160=_0x322160-0x0;var _0x2bcfca=_0x87d2[_0x322160];return _0x2bcfca;};'use strict';var _=require(_0x287d('0x0'));var util=require(_0x287d('0x1'));var moment=require(_0x287d('0x2'));var BPromise=require('bluebird');var rs=require(_0x287d('0x3'));var fs=require('fs');var Redis=require(_0x287d('0x4'));var db=require(_0x287d('0x5'))['db'];var utils=require(_0x287d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x287d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x287d('0x8')]({'port':0x232a});config['redis']=_[_0x287d('0x9')](config[_0x287d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x287d('0xb'))(new Redis(config[_0x287d('0xa')]));require('./whatsappMessage.socket')[_0x287d('0xc')](socket);function respondWithRpcPromise(_0x2cdb59,_0x6321e2,_0x2c54bb){return new BPromise(function(_0x353957,_0xb4244e){return client[_0x287d('0xd')](_0x2cdb59,_0x2c54bb)[_0x287d('0xe')](function(_0x5eda71){logger[_0x287d('0xf')](_0x287d('0x10'),_0x6321e2,_0x287d('0x11'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x6321e2,_0x287d('0x11'),JSON[_0x287d('0x12')](_0x5eda71));if(_0x5eda71[_0x287d('0x13')]){if(_0x5eda71[_0x287d('0x13')]['code']===0x1f4){logger[_0x287d('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x6321e2,_0x5eda71[_0x287d('0x13')][_0x287d('0x14')]);return _0xb4244e(_0x5eda71[_0x287d('0x13')]['message']);}logger[_0x287d('0x13')](_0x287d('0x10'),_0x6321e2,_0x5eda71[_0x287d('0x13')][_0x287d('0x14')]);return _0x353957(_0x5eda71['error'][_0x287d('0x14')]);}else{logger[_0x287d('0xf')](_0x287d('0x10'),_0x6321e2,'request\x20sent');_0x353957(_0x5eda71[_0x287d('0x15')][_0x287d('0x14')]);}})[_0x287d('0x16')](function(_0xeffdcb){logger[_0x287d('0x13')](_0x287d('0x10'),_0x6321e2,_0xeffdcb);_0xb4244e(_0xeffdcb);});});}exports[_0x287d('0x17')]=function(_0x2a6fb9){var _0xde3888=this;return new Promise(function(_0x316e06,_0x5d271e){return db[_0x287d('0x18')][_0x287d('0x19')](_0x2a6fb9[_0x287d('0x1a')],{'raw':_0x2a6fb9[_0x287d('0x1b')]?_0x2a6fb9['options'][_0x287d('0x1c')]===undefined?!![]:![]:!![]})[_0x287d('0xe')](function(_0x522ee3){logger[_0x287d('0xf')](_0x287d('0x17'),_0x2a6fb9);logger[_0x287d('0x1d')](_0x287d('0x17'),_0x2a6fb9,JSON['stringify'](_0x522ee3));_0x316e06(_0x522ee3);})[_0x287d('0x16')](function(_0x191afc){logger['error'](_0x287d('0x17'),_0x191afc['message'],_0x2a6fb9);_0x5d271e(_0xde3888[_0x287d('0x13')](0x1f4,_0x191afc[_0x287d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index c2a6b2d..aff7e46 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 _0xb5c7=['update','removeListener','register','length','./whatsappMessage.events','save','remove'];(function(_0x508471,_0x27232e){var _0x44bb04=function(_0x2c15de){while(--_0x2c15de){_0x508471['push'](_0x508471['shift']());}};_0x44bb04(++_0x27232e);}(_0xb5c7,0x1cb));var _0x7b5c=function(_0x4816aa,_0x1578bd){_0x4816aa=_0x4816aa-0x0;var _0xc30d28=_0xb5c7[_0x4816aa];return _0xc30d28;};'use strict';var WhatsappMessageEvents=require(_0x7b5c('0x0'));var events=[_0x7b5c('0x1'),_0x7b5c('0x2'),_0x7b5c('0x3')];function createListener(_0x5f434f,_0x506c4d){return function(_0x3b613c){_0x506c4d['emit'](_0x5f434f,_0x3b613c);};}function removeListener(_0x52a9d2,_0x2b4431){return function(){WhatsappMessageEvents[_0x7b5c('0x4')](_0x52a9d2,_0x2b4431);};}exports[_0x7b5c('0x5')]=function(_0xb3eba5){for(var _0x400be0=0x0,_0x1cb8ff=events[_0x7b5c('0x6')];_0x400be0<_0x1cb8ff;_0x400be0++){var _0x215c05=events[_0x400be0];var _0x364b93=createListener('whatsappMessage:'+_0x215c05,_0xb3eba5);WhatsappMessageEvents['on'](_0x215c05,_0x364b93);}}; \ No newline at end of file +var _0x976c=['register','length','whatsappMessage:','save','remove','update','emit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x976c,0x122));var _0xc976=function(_0x408abe,_0x96cc05){_0x408abe=_0x408abe-0x0;var _0x1ba49a=_0x976c[_0x408abe];return _0x1ba49a;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xc976('0x0'),_0xc976('0x1'),_0xc976('0x2')];function createListener(_0x48895a,_0x34463a){return function(_0x5a43ca){_0x34463a[_0xc976('0x3')](_0x48895a,_0x5a43ca);};}function removeListener(_0x1fed84,_0x13cb76){return function(){WhatsappMessageEvents['removeListener'](_0x1fed84,_0x13cb76);};}exports[_0xc976('0x4')]=function(_0x41e616){for(var _0x55856e=0x0,_0x1f91fa=events[_0xc976('0x5')];_0x55856e<_0x1f91fa;_0x55856e++){var _0x198033=events[_0x55856e];var _0x89d70=createListener(_0xc976('0x6')+_0x198033,_0x41e616);WhatsappMessageEvents['on'](_0x198033,_0x89d70);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 4da640e..4d747a1 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 _0xb68e=['getAgents','create','post','put','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','../../components/auth/service','./whatsappQueue.controller','isAuthenticated','index','get','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x17e9de,_0x3894fa){var _0x5098d4=function(_0x4d417e){while(--_0x4d417e){_0x17e9de['push'](_0x17e9de['shift']());}};_0x5098d4(++_0x3894fa);}(_0xb68e,0x80));var _0xeb68=function(_0x1f9770,_0xe27af0){_0x1f9770=_0x1f9770-0x0;var _0x4863db=_0xb68e[_0x1f9770];return _0x4863db;};'use strict';var multer=require(_0xeb68('0x0'));var util=require(_0xeb68('0x1'));var path=require('path');var timeout=require(_0xeb68('0x2'));var express=require(_0xeb68('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeb68('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb68('0x5'));router['get']('/',auth[_0xeb68('0x6')](),controller[_0xeb68('0x7')]);router[_0xeb68('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xeb68('0x9')]);router[_0xeb68('0x8')](_0xeb68('0xa'),auth[_0xeb68('0x6')](),controller[_0xeb68('0xb')]);router[_0xeb68('0x8')]('/:id/members',auth[_0xeb68('0x6')](),controller[_0xeb68('0xc')]);router['get'](_0xeb68('0xd'),auth[_0xeb68('0x6')](),controller[_0xeb68('0xe')]);router[_0xeb68('0x8')](_0xeb68('0xf'),auth[_0xeb68('0x6')](),controller[_0xeb68('0x10')]);router['post']('/',auth[_0xeb68('0x6')](),controller[_0xeb68('0x11')]);router[_0xeb68('0x12')](_0xeb68('0xd'),auth[_0xeb68('0x6')](),controller['addTeams']);router[_0xeb68('0x12')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xeb68('0x13')](_0xeb68('0xa'),auth[_0xeb68('0x6')](),controller['update']);router['delete'](_0xeb68('0xa'),auth[_0xeb68('0x6')](),controller['destroy']);router[_0xeb68('0x14')]('/:id/teams',auth[_0xeb68('0x6')](),controller[_0xeb68('0x15')]);router['delete'](_0xeb68('0xf'),auth['isAuthenticated'](),controller[_0xeb68('0x16')]);module[_0xeb68('0x17')]=router; \ No newline at end of file +var _0x7b13=['util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','destroy','removeTeams','delete','exports','multer'];(function(_0x443dd5,_0x2d9a42){var _0x1b56ae=function(_0xc991d2){while(--_0xc991d2){_0x443dd5['push'](_0x443dd5['shift']());}};_0x1b56ae(++_0x2d9a42);}(_0x7b13,0xad));var _0x37b1=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7b13[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x37b1('0x0'));var util=require(_0x37b1('0x1'));var path=require(_0x37b1('0x2'));var timeout=require('connect-timeout');var express=require(_0x37b1('0x3'));var router=express[_0x37b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x37b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x37b1('0x6'));var controller=require('./whatsappQueue.controller');router[_0x37b1('0x7')]('/',auth[_0x37b1('0x8')](),controller[_0x37b1('0x9')]);router[_0x37b1('0x7')]('/describe',auth[_0x37b1('0x8')](),controller[_0x37b1('0xa')]);router[_0x37b1('0x7')]('/:id',auth[_0x37b1('0x8')](),controller[_0x37b1('0xb')]);router[_0x37b1('0x7')](_0x37b1('0xc'),auth[_0x37b1('0x8')](),controller[_0x37b1('0xd')]);router['get'](_0x37b1('0xe'),auth['isAuthenticated'](),controller[_0x37b1('0xf')]);router['get'](_0x37b1('0x10'),auth[_0x37b1('0x8')](),controller[_0x37b1('0x11')]);router[_0x37b1('0x12')]('/',auth['isAuthenticated'](),controller[_0x37b1('0x13')]);router['post'](_0x37b1('0xe'),auth[_0x37b1('0x8')](),controller[_0x37b1('0x14')]);router[_0x37b1('0x12')](_0x37b1('0x10'),auth[_0x37b1('0x8')](),controller[_0x37b1('0x15')]);router[_0x37b1('0x16')](_0x37b1('0x17'),auth[_0x37b1('0x8')](),controller[_0x37b1('0x18')]);router['delete'](_0x37b1('0x17'),auth[_0x37b1('0x8')](),controller[_0x37b1('0x19')]);router['delete'](_0x37b1('0xe'),auth[_0x37b1('0x8')](),controller[_0x37b1('0x1a')]);router[_0x37b1('0x1b')](_0x37b1('0x10'),auth[_0x37b1('0x8')](),controller['removeAgents']);module[_0x37b1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index db5adf9..f1f6f9a 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 _0xa0bc=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x1796f9,_0x432228){var _0x42aca5=function(_0x53bbb7){while(--_0x53bbb7){_0x1796f9['push'](_0x1796f9['shift']());}};_0x42aca5(++_0x432228);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xca0b('0x0')]={'name':{'type':Sequelize[_0xca0b('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xca0b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xca0b('0x3')](_0xca0b('0x4'),_0xca0b('0x5'),_0xca0b('0x6'))},'description':{'type':Sequelize[_0xca0b('0x1')]}}; \ No newline at end of file +var _0x175e=['exports','STRING','name','INTEGER','beepall','roundrobin','sequelize'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x175e,0xe6));var _0xe175=function(_0x5cc372,_0x339b93){_0x5cc372=_0x5cc372-0x0;var _0x56f357=_0x175e[_0x5cc372];return _0x56f357;};'use strict';var Sequelize=require(_0xe175('0x0'));module[_0xe175('0x1')]={'name':{'type':Sequelize[_0xe175('0x2')],'unique':_0xe175('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe175('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xe175('0x5'),_0xe175('0x6'))},'description':{'type':Sequelize[_0xe175('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index aa6dcc2..9033fd6 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 _0x56fe=['then','destroy','UserProfileResource','end','stack','name','index','WhatsappQueue','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','user','get','WhatsappQueues','find','userProfileId','autoAssociation','error','body','describe','getMembers','findOne','WhatsappQueueId','User','UserId','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','online','voicePause','interface','Agents','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','ids','field','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','transaction','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x2f3a64,_0x40f6bb){var _0x2da930=function(_0x5f1b86){while(--_0x5f1b86){_0x2f3a64['push'](_0x2f3a64['shift']());}};_0x2da930(++_0x40f6bb);}(_0x56fe,0x1e1));var _0xe56f=function(_0x2bbac8,_0xf6835){_0x2bbac8=_0x2bbac8-0x0;var _0x5347ba=_0x56fe[_0x2bbac8];return _0x5347ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe56f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe56f('0x1'));var rp=require(_0xe56f('0x2'));var moment=require(_0xe56f('0x3'));var BPromise=require(_0xe56f('0x4'));var Mustache=require(_0xe56f('0x5'));var util=require(_0xe56f('0x6'));var path=require(_0xe56f('0x7'));var sox=require(_0xe56f('0x8'));var csv=require(_0xe56f('0x9'));var ejs=require(_0xe56f('0xa'));var fs=require('fs');var fs_extra=require(_0xe56f('0xb'));var _=require(_0xe56f('0xc'));var squel=require(_0xe56f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe56f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe56f('0xf'));var Papa=require(_0xe56f('0x10'));var Redis=require(_0xe56f('0x11'));var authService=require(_0xe56f('0x12'));var qs=require(_0xe56f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe56f('0x14'));var logger=require(_0xe56f('0x15'))('api');var utils=require(_0xe56f('0x16'));var config=require(_0xe56f('0x17'));var licenseUtil=require(_0xe56f('0x18'));var db=require(_0xe56f('0x19'))['db'];config[_0xe56f('0x1a')]=_['defaults'](config[_0xe56f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe56f('0x1a')]));require('./whatsappQueue.socket')[_0xe56f('0x1b')](socket);function respondWithStatusCode(_0xf5130a,_0x3f3d37){_0x3f3d37=_0x3f3d37||0xcc;return function(_0x1cd3e2){if(_0x1cd3e2){return _0xf5130a[_0xe56f('0x1c')](_0x3f3d37);}return _0xf5130a[_0xe56f('0x1d')](_0x3f3d37)['end']();};}function respondWithResult(_0xa34584,_0x46c0cd){_0x46c0cd=_0x46c0cd||0xc8;return function(_0x46d2c8){if(_0x46d2c8){return _0xa34584[_0xe56f('0x1d')](_0x46c0cd)[_0xe56f('0x1e')](_0x46d2c8);}};}function respondWithFilteredResult(_0x40628a,_0x25cf09){return function(_0xc66cdd){if(_0xc66cdd){var _0x4fedf7=typeof _0x25cf09['offset']===_0xe56f('0x1f')&&typeof _0x25cf09['limit']===_0xe56f('0x1f');var _0x1b5cdf=_0xc66cdd[_0xe56f('0x20')];var _0x2ecfbb=_0x4fedf7?0x0:_0x25cf09[_0xe56f('0x21')];var _0x3e1fd3=_0x4fedf7?_0xc66cdd[_0xe56f('0x20')]:_0x25cf09[_0xe56f('0x21')]+_0x25cf09[_0xe56f('0x22')];var _0x7ccd01;if(_0x3e1fd3>=_0x1b5cdf){_0x3e1fd3=_0x1b5cdf;_0x7ccd01=0xc8;}else{_0x7ccd01=0xce;}_0x40628a[_0xe56f('0x1d')](_0x7ccd01);return _0x40628a[_0xe56f('0x23')](_0xe56f('0x24'),_0x2ecfbb+'-'+_0x3e1fd3+'/'+_0x1b5cdf)[_0xe56f('0x1e')](_0xc66cdd);}return null;};}function patchUpdates(_0x349b3d){return function(_0x4c47a6){try{jsonpatch[_0xe56f('0x25')](_0x4c47a6,_0x349b3d,!![]);}catch(_0x40c1e4){return BPromise[_0xe56f('0x26')](_0x40c1e4);}return _0x4c47a6['save']();};}function saveUpdates(_0x3ca777,_0x965e5f){return function(_0x50f2f1){if(_0x50f2f1){return _0x50f2f1['update'](_0x3ca777)[_0xe56f('0x27')](function(_0xe8ac8a){return _0xe8ac8a;});}return null;};}function removeEntity(_0x2bc284,_0x277dd2){return function(_0x52f567){if(_0x52f567){return _0x52f567[_0xe56f('0x28')]()[_0xe56f('0x27')](function(){var _0xea4099=_0x52f567['get']({'plain':!![]});var _0x39481c='WhatsappQueues';return db[_0xe56f('0x29')][_0xe56f('0x28')]({'where':{'type':_0x39481c,'resourceId':_0xea4099['id']}})['then'](function(){return _0x52f567;});})['then'](function(){_0x2bc284[_0xe56f('0x1d')](0xcc)[_0xe56f('0x2a')]();});}};}function handleEntityNotFound(_0x4badc7,_0x42adf0){return function(_0x25759f){if(!_0x25759f){_0x4badc7['sendStatus'](0x194);}return _0x25759f;};}function handleError(_0x32eea2,_0x3d55e7){_0x3d55e7=_0x3d55e7||0x1f4;return function(_0x393e8c){logger['error'](_0x393e8c[_0xe56f('0x2b')]);if(_0x393e8c[_0xe56f('0x2c')]){delete _0x393e8c[_0xe56f('0x2c')];}_0x32eea2[_0xe56f('0x1d')](_0x3d55e7)['send'](_0x393e8c);};}exports[_0xe56f('0x2d')]=function(_0x491fb0,_0x2cd480){var _0x489f56={},_0x431101={},_0x4a23ea={'count':0x0,'rows':[]};var _0x27df5b=_['map'](db[_0xe56f('0x2e')][_0xe56f('0x2f')],function(_0x35db99){return{'name':_0x35db99['fieldName'],'type':_0x35db99['type']['key']};});_0x431101[_0xe56f('0x30')]=_['map'](_0x27df5b,_0xe56f('0x2c'));_0x431101['query']=_['keys'](_0x491fb0[_0xe56f('0x31')]);_0x431101[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0x431101[_0xe56f('0x30')],_0x431101['query']);_0x489f56[_0xe56f('0x34')]=_['intersection'](_0x431101[_0xe56f('0x30')],qs[_0xe56f('0x35')](_0x491fb0[_0xe56f('0x31')][_0xe56f('0x35')]));_0x489f56[_0xe56f('0x34')]=_0x489f56[_0xe56f('0x34')][_0xe56f('0x36')]?_0x489f56['attributes']:_0x431101['model'];if(!_0x491fb0[_0xe56f('0x31')][_0xe56f('0x37')](_0xe56f('0x38'))){_0x489f56[_0xe56f('0x22')]=qs[_0xe56f('0x22')](_0x491fb0[_0xe56f('0x31')]['limit']);_0x489f56[_0xe56f('0x21')]=qs[_0xe56f('0x21')](_0x491fb0[_0xe56f('0x31')]['offset']);}_0x489f56[_0xe56f('0x39')]=qs[_0xe56f('0x3a')](_0x491fb0[_0xe56f('0x31')][_0xe56f('0x3a')]);_0x489f56['where']=qs['filters'](_[_0xe56f('0x3b')](_0x491fb0[_0xe56f('0x31')],_0x431101[_0xe56f('0x32')]),_0x27df5b);if(_0x491fb0[_0xe56f('0x31')][_0xe56f('0x3c')]){_0x489f56[_0xe56f('0x3d')]=_[_0xe56f('0x3e')](_0x489f56[_0xe56f('0x3d')],{'$or':_[_0xe56f('0x3f')](_0x27df5b,function(_0x380d28){if(_0x380d28[_0xe56f('0x40')]!==_0xe56f('0x41')){var _0x1901b0={};_0x1901b0[_0x380d28[_0xe56f('0x2c')]]={'$like':'%'+_0x491fb0['query'][_0xe56f('0x3c')]+'%'};return _0x1901b0;}})});}_0x489f56=_[_0xe56f('0x3e')]({},_0x489f56,_0x491fb0[_0xe56f('0x42')]);var _0x87804a={'where':_0x489f56[_0xe56f('0x3d')]};return db['WhatsappQueue'][_0xe56f('0x20')](_0x87804a)[_0xe56f('0x27')](function(_0x46251b){_0x4a23ea[_0xe56f('0x20')]=_0x46251b;if(_0x491fb0[_0xe56f('0x31')][_0xe56f('0x43')]){_0x489f56[_0xe56f('0x44')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xe56f('0x45')](_0x489f56);})['then'](function(_0x945192){_0x4a23ea[_0xe56f('0x46')]=_0x945192;return _0x4a23ea;})[_0xe56f('0x27')](respondWithFilteredResult(_0x2cd480,_0x489f56))[_0xe56f('0x47')](handleError(_0x2cd480,null));};exports[_0xe56f('0x48')]=function(_0x2181c9,_0x5d8724){var _0x4711fd={'raw':!![],'where':{'id':_0x2181c9[_0xe56f('0x49')]['id']}},_0x55d063={};_0x55d063[_0xe56f('0x30')]=_[_0xe56f('0x4a')](db[_0xe56f('0x2e')][_0xe56f('0x2f')]);_0x55d063[_0xe56f('0x31')]=_[_0xe56f('0x4a')](_0x2181c9[_0xe56f('0x31')]);_0x55d063[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0x55d063[_0xe56f('0x30')],_0x55d063[_0xe56f('0x31')]);_0x4711fd[_0xe56f('0x34')]=_[_0xe56f('0x33')](_0x55d063[_0xe56f('0x30')],qs[_0xe56f('0x35')](_0x2181c9['query'][_0xe56f('0x35')]));_0x4711fd['attributes']=_0x4711fd['attributes'][_0xe56f('0x36')]?_0x4711fd[_0xe56f('0x34')]:_0x55d063[_0xe56f('0x30')];if(_0x2181c9[_0xe56f('0x31')][_0xe56f('0x43')]){_0x4711fd[_0xe56f('0x44')]=[{'all':!![]}];}_0x4711fd=_[_0xe56f('0x3e')]({},_0x4711fd,_0x2181c9[_0xe56f('0x42')]);return db[_0xe56f('0x2e')]['find'](_0x4711fd)[_0xe56f('0x27')](handleEntityNotFound(_0x5d8724,null))[_0xe56f('0x27')](respondWithResult(_0x5d8724,null))[_0xe56f('0x47')](handleError(_0x5d8724,null));};exports['create']=function(_0x9a44e8,_0x5be706){return db[_0xe56f('0x2e')][_0xe56f('0x4b')](_0x9a44e8['body'],{})[_0xe56f('0x27')](function(_0x3c1045){var _0x18d510=_0x9a44e8[_0xe56f('0x4c')][_0xe56f('0x4d')]({'plain':!![]});if(!_0x18d510)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18d510['role']==='user'){var _0x180212=_0x3c1045['get']({'plain':!![]});var _0x178dc9=_0xe56f('0x4e');return db['UserProfileSection'][_0xe56f('0x4f')]({'where':{'name':_0x178dc9,'userProfileId':_0x18d510[_0xe56f('0x50')]},'raw':!![]})['then'](function(_0x51345c){if(_0x51345c&&_0x51345c[_0xe56f('0x51')]===0x0){return db[_0xe56f('0x29')][_0xe56f('0x4b')]({'name':_0x180212[_0xe56f('0x2c')],'resourceId':_0x180212['id'],'type':_0x51345c[_0xe56f('0x2c')],'sectionId':_0x51345c['id']},{})[_0xe56f('0x27')](function(){return _0x3c1045;});}else{return _0x3c1045;}})[_0xe56f('0x47')](function(_0x5be783){logger[_0xe56f('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5be783);throw _0x5be783;});}return _0x3c1045;})['then'](respondWithResult(_0x5be706,0xc9))[_0xe56f('0x47')](handleError(_0x5be706,null));};exports['update']=function(_0x66daf5,_0x428a0c){if(_0x66daf5[_0xe56f('0x53')]['id']){delete _0x66daf5[_0xe56f('0x53')]['id'];}return db[_0xe56f('0x2e')][_0xe56f('0x4f')]({'where':{'id':_0x66daf5[_0xe56f('0x49')]['id']}})[_0xe56f('0x27')](handleEntityNotFound(_0x428a0c,null))[_0xe56f('0x27')](saveUpdates(_0x66daf5[_0xe56f('0x53')],null))[_0xe56f('0x27')](respondWithResult(_0x428a0c,null))[_0xe56f('0x47')](handleError(_0x428a0c,null));};exports['destroy']=function(_0x2b5d1b,_0x563391){return db['WhatsappQueue'][_0xe56f('0x4f')]({'where':{'id':_0x2b5d1b['params']['id']}})['then'](handleEntityNotFound(_0x563391,null))['then'](removeEntity(_0x563391,null))[_0xe56f('0x47')](handleError(_0x563391,null));};exports[_0xe56f('0x54')]=function(_0x34bfe7,_0x422bb2){return db[_0xe56f('0x2e')][_0xe56f('0x54')]()[_0xe56f('0x27')](respondWithResult(_0x422bb2,null))[_0xe56f('0x47')](handleError(_0x422bb2,null));};exports[_0xe56f('0x55')]=function(_0x361427,_0x57a8e1,_0xcd380){var _0x3835b5={'raw':!![],'where':{}},_0x57c745={},_0x328611;return db[_0xe56f('0x2e')][_0xe56f('0x56')]({'where':{'id':_0x361427[_0xe56f('0x49')]['id']}})[_0xe56f('0x27')](handleEntityNotFound(_0x57a8e1,null))['then'](function(_0x356ab7){if(_0x356ab7){_0x328611=_0x356ab7[_0xe56f('0x4d')]({'plain':!![]});_0x57c745[_0xe56f('0x30')]=_[_0xe56f('0x4a')](db['UserWhatsappQueue']['rawAttributes']);_0x57c745[_0xe56f('0x31')]=_[_0xe56f('0x4a')](_0x361427[_0xe56f('0x31')]);_0x57c745[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0x57c745['model'],_0x57c745[_0xe56f('0x31')]);_0x3835b5['attributes']=_['intersection'](_0x57c745[_0xe56f('0x30')],qs['fields'](_0x361427[_0xe56f('0x31')][_0xe56f('0x35')]));_0x3835b5['attributes']=_0x3835b5[_0xe56f('0x34')]['length']?_0x3835b5[_0xe56f('0x34')]:_0x57c745[_0xe56f('0x30')];if(!_0x361427[_0xe56f('0x31')]['hasOwnProperty'](_0xe56f('0x38'))){_0x3835b5['limit']=qs[_0xe56f('0x22')](_0x361427[_0xe56f('0x31')][_0xe56f('0x22')]);_0x3835b5[_0xe56f('0x21')]=qs['offset'](_0x361427[_0xe56f('0x31')][_0xe56f('0x21')]);}_0x3835b5[_0xe56f('0x39')]=qs[_0xe56f('0x3a')](_0x361427[_0xe56f('0x31')][_0xe56f('0x3a')]);_0x3835b5[_0xe56f('0x3d')]=qs[_0xe56f('0x32')](_['pick'](_0x361427['query'],_0x57c745['filters']));_0x3835b5[_0xe56f('0x3d')][_0xe56f('0x57')]=_0x356ab7['id'];if(_0x361427['query'][_0xe56f('0x3c')]){_0x3835b5[_0xe56f('0x3d')]=_[_0xe56f('0x3e')](_0x3835b5['where'],{'$or':_[_0xe56f('0x3f')](_0x3835b5[_0xe56f('0x34')],function(_0x551d23){var _0x14339b={};_0x14339b[_0x551d23]={'$like':'%'+_0x361427[_0xe56f('0x31')][_0xe56f('0x3c')]+'%'};return _0x14339b;})});}_0x3835b5=_[_0xe56f('0x3e')]({},_0x3835b5,_0x361427[_0xe56f('0x42')]);return db['UserWhatsappQueue'][_0xe56f('0x45')](_0x3835b5);}})[_0xe56f('0x27')](function(_0x41036){if(_0x41036){return db[_0xe56f('0x58')]['findAndCountAll']({'where':{'id':_[_0xe56f('0x3f')](_0x41036,_0xe56f('0x59')),'role':'agent'},'attributes':['id',_0xe56f('0x2c'),'whatsappPause','updatedAt',_0xe56f('0x5a')]});}})['then'](function(_0xd3f2e5){if(_0xd3f2e5){return{'count':_0xd3f2e5[_0xe56f('0x20')],'rows':_['map'](_0xd3f2e5[_0xe56f('0x46')],function(_0x105b66){return{'membername':_0x105b66[_0xe56f('0x2c')],'UserId':_0x105b66['id'],'queue_name':_0x328611[_0xe56f('0x2c')],'WhatsappQueueId':_0x328611['id'],'interface':util[_0xe56f('0x5b')]('%s/%s',_0xe56f('0x5c'),_0x105b66['name']),'penalty':0x0,'paused':_0x105b66['whatsappPause'],'createdAt':_0x105b66[_0xe56f('0x5a')],'updatedAt':_0x105b66[_0xe56f('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe56f('0x27')](respondWithFilteredResult(_0x57a8e1,_0x3835b5))[_0xe56f('0x47')](handleError(_0x57a8e1,null));};exports[_0xe56f('0x5e')]=function(_0x2d8834,_0x580f50,_0x1c79f9){var _0x2179b3={};var _0x339225={};var _0x476ac6;var _0x277f53;return db[_0xe56f('0x2e')][_0xe56f('0x56')]({'where':{'id':_0x2d8834[_0xe56f('0x49')]['id']}})[_0xe56f('0x27')](handleEntityNotFound(_0x580f50,null))[_0xe56f('0x27')](function(_0x307dd5){if(_0x307dd5){_0x476ac6=_0x307dd5;_0x339225['model']=_[_0xe56f('0x4a')](db[_0xe56f('0x5f')]['rawAttributes']);_0x339225[_0xe56f('0x31')]=_['keys'](_0x2d8834['query']);_0x339225[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0x339225[_0xe56f('0x30')],_0x339225[_0xe56f('0x31')]);_0x2179b3[_0xe56f('0x34')]=_[_0xe56f('0x33')](_0x339225['model'],qs['fields'](_0x2d8834[_0xe56f('0x31')][_0xe56f('0x35')]));_0x2179b3[_0xe56f('0x34')]=_0x2179b3[_0xe56f('0x34')]['length']?_0x2179b3['attributes']:_0x339225[_0xe56f('0x30')];_0x2179b3[_0xe56f('0x39')]=qs[_0xe56f('0x3a')](_0x2d8834[_0xe56f('0x31')][_0xe56f('0x3a')]);_0x2179b3['where']=qs[_0xe56f('0x32')](_[_0xe56f('0x3b')](_0x2d8834['query'],_0x339225['filters']));if(_0x2d8834[_0xe56f('0x31')][_0xe56f('0x3c')]){_0x2179b3[_0xe56f('0x3d')]=_[_0xe56f('0x3e')](_0x2179b3[_0xe56f('0x3d')],{'$or':_['map'](_0x2179b3[_0xe56f('0x34')],function(_0x399c7e){var _0x12f2a7={};_0x12f2a7[_0x399c7e]={'$like':'%'+_0x2d8834[_0xe56f('0x31')]['filter']+'%'};return _0x12f2a7;})});}_0x2179b3=_[_0xe56f('0x3e')]({},_0x2179b3,_0x2d8834[_0xe56f('0x42')]);return _0x476ac6['getTeams'](_0x2179b3);}})[_0xe56f('0x27')](function(_0x441c66){if(_0x441c66){_0x277f53=_0x441c66['length'];if(!_0x2d8834[_0xe56f('0x31')][_0xe56f('0x37')]('nolimit')){_0x2179b3[_0xe56f('0x22')]=qs[_0xe56f('0x22')](_0x2d8834[_0xe56f('0x31')][_0xe56f('0x22')]);_0x2179b3[_0xe56f('0x21')]=qs[_0xe56f('0x21')](_0x2d8834[_0xe56f('0x31')][_0xe56f('0x21')]);}return _0x476ac6[_0xe56f('0x5e')](_0x2179b3);}})['then'](function(_0x132606){if(_0x132606){return _0x132606?{'count':_0x277f53,'rows':_0x132606}:null;}})[_0xe56f('0x27')](respondWithResult(_0x580f50,null))[_0xe56f('0x47')](handleError(_0x580f50,null));};exports[_0xe56f('0x60')]=function(_0x42c772,_0x1c3c61,_0x361a76){var _0x168843=_0x42c772[_0xe56f('0x53')]['ids'];return db[_0xe56f('0x5f')]['findAll']({'where':{'id':_0x168843},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xe56f('0x61'),_0xe56f('0x62'),_0xe56f('0x63')],'raw':!![]}]})[_0xe56f('0x27')](function(_0x109288){if(_0x109288){var _0x2427bb=_['flatMap'](_0x109288,function(_0x445279){var _0xf6dd77=_0x445279[_0xe56f('0x4d')]({'plain':!![]});return _0xf6dd77[_0xe56f('0x64')];});return db[_0xe56f('0x2e')][_0xe56f('0x4f')]({'where':{'id':_0x42c772[_0xe56f('0x49')]['id']}})['then'](function(_0x307734){return db[_0xe56f('0x65')]['transaction'](function(_0x1e8385){return _0x307734['addTeams'](_0x168843,{'transaction':_0x1e8385})['then'](function(){return BPromise[_0xe56f('0x66')](_0x2427bb,function(_0x2a5249){return db['UserWhatsappQueue'][_0xe56f('0x67')]({'where':{'UserId':_0x2a5249['id'],'WhatsappQueueId':_0x42c772[_0xe56f('0x49')]['id']},'transaction':_0x1e8385});});})['then'](function(){_0x2427bb['forEach'](function(_0x379bed){socket[_0xe56f('0x68')](_0xe56f('0x69'),{'UserId':_0x379bed['id'],'WhatsappQueueId':_0x307734['id']});});});});});}})[_0xe56f('0x27')](respondWithStatusCode(_0x1c3c61,null))[_0xe56f('0x47')](handleError(_0x1c3c61,null));};exports['removeTeams']=function(_0x39802d,_0x434c29,_0x590908){return db[_0xe56f('0x5f')]['findAll']({'where':{'id':_0x39802d[_0xe56f('0x31')][_0xe56f('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe56f('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x434c29,null))[_0xe56f('0x27')](function(_0x436c9f){var _0x2ea1d2=_[_0xe56f('0x3f')](_0x436c9f,'id');var _0x5a9ff0=[];var _0x3f6e6d=[];var _0x4d2aea=squel['select']();_0x4d2aea[_0xe56f('0x6b')]('tq.TeamId')[_0xe56f('0x6c')]('team_has_whatsapp_queues','tq')[_0xe56f('0x6d')](_0xe56f('0x6e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe56f('0x3d')](_0xe56f('0x6f'),_0x39802d['params']['id']);for(var _0x51a3d1=0x0;_0x51a3d1<_0x436c9f[_0xe56f('0x36')];_0x51a3d1+=0x1){let _0x516519=_0x436c9f[_0x51a3d1];for(var _0x40ae7a=0x0;_0x40ae7a<_0x516519[_0xe56f('0x64')][_0xe56f('0x36')];_0x40ae7a+=0x1){let _0x1d086b=_0x516519[_0xe56f('0x64')][_0x40ae7a];var _0x256aea=_0x4d2aea['clone']();_0x256aea[_0xe56f('0x3d')](_0xe56f('0x70'),_0x1d086b['id']);_0x3f6e6d['push'](db['sequelize'][_0xe56f('0x31')](_0x256aea[_0xe56f('0x71')](),{'type':db[_0xe56f('0x65')][_0xe56f('0x72')][_0xe56f('0x73')]})[_0xe56f('0x27')](function(_0x147944){if(_0x147944[_0xe56f('0x36')]===0x1){return _0x1d086b['id'];}else{var _0x8541ee=_[_0xe56f('0x74')](_[_0xe56f('0x3f')](_0x147944,_0xe56f('0x75')),function(_0xb31052){return _['includes'](_0x2ea1d2,_0xb31052);});if(_0x8541ee){return _0x1d086b['id'];}}}));}}return BPromise[_0xe56f('0x76')](_0x3f6e6d)[_0xe56f('0x27')](function(_0x3e93d3){_0x5a9ff0=_(_0x5a9ff0)[_0xe56f('0x77')](_0x3e93d3)[_0xe56f('0x78')]()['value']();return db['WhatsappQueue'][_0xe56f('0x4f')]({'where':{'id':_0x39802d[_0xe56f('0x49')]['id']}})['then'](function(_0x422621){return db[_0xe56f('0x65')][_0xe56f('0x79')](function(_0x3a95d9){return _0x422621[_0xe56f('0x7a')](_0x39802d[_0xe56f('0x31')]['ids'],{'transaction':_0x3a95d9})[_0xe56f('0x27')](function(){if(!_[_0xe56f('0x7b')](_0x5a9ff0)){return _0x422621[_0xe56f('0x7c')](_0x5a9ff0,{'transaction':_0x3a95d9});}})[_0xe56f('0x27')](function(){_0x5a9ff0['forEach'](function(_0x37fac5){socket['emit'](_0xe56f('0x7d'),{'UserId':_0x37fac5,'WhatsappQueueId':_0x422621['id']});});});});});});})['then'](respondWithStatusCode(_0x434c29,null))[_0xe56f('0x47')](handleError(_0x434c29,null));};exports[_0xe56f('0x7e')]=function(_0x272d48,_0x1d15e3,_0x55ef26){return db[_0xe56f('0x2e')][_0xe56f('0x4f')]({'where':{'id':_0x272d48[_0xe56f('0x49')]['id']}})[_0xe56f('0x27')](handleEntityNotFound(_0x1d15e3,null))['then'](function(_0x2a7299){if(_0x2a7299){return _0x2a7299['addAgents'](_0x272d48[_0xe56f('0x53')][_0xe56f('0x6a')],_['omit'](_0x272d48[_0xe56f('0x53')],['ids','id'])||{})[_0xe56f('0x7f')](function(_0x349190){for(var _0x27c3df=0x0;_0x27c3df<_0x272d48[_0xe56f('0x53')]['ids'][_0xe56f('0x36')];_0x27c3df+=0x1){socket['emit'](_0xe56f('0x69'),{'UserId':Number(_0x272d48[_0xe56f('0x53')][_0xe56f('0x6a')][_0x27c3df]),'WhatsappQueueId':Number(_0x272d48[_0xe56f('0x49')]['id'])});}return _0x349190;});}})[_0xe56f('0x27')](respondWithResult(_0x1d15e3,null))[_0xe56f('0x47')](handleError(_0x1d15e3,null));};exports[_0xe56f('0x7c')]=function(_0x5bb8cc,_0x388fdf,_0x27c53b){return db[_0xe56f('0x2e')]['find']({'where':{'id':_0x5bb8cc[_0xe56f('0x49')]['id']}})[_0xe56f('0x27')](handleEntityNotFound(_0x388fdf,null))[_0xe56f('0x27')](function(_0x57ae51){if(_0x57ae51){return _0x57ae51[_0xe56f('0x7c')](_0x5bb8cc[_0xe56f('0x31')][_0xe56f('0x6a')])[_0xe56f('0x27')](function(){if(_[_0xe56f('0x80')](_0x5bb8cc['query'][_0xe56f('0x6a')])){for(var _0x4129b2=0x0;_0x4129b2<_0x5bb8cc[_0xe56f('0x31')][_0xe56f('0x6a')][_0xe56f('0x36')];_0x4129b2+=0x1){socket[_0xe56f('0x68')](_0xe56f('0x7d'),{'UserId':Number(_0x5bb8cc[_0xe56f('0x31')][_0xe56f('0x6a')][_0x4129b2]),'WhatsappQueueId':Number(_0x5bb8cc[_0xe56f('0x49')]['id'])});}}else{socket[_0xe56f('0x68')](_0xe56f('0x7d'),{'UserId':Number(_0x5bb8cc['query'][_0xe56f('0x6a')]),'WhatsappQueueId':Number(_0x5bb8cc[_0xe56f('0x49')]['id'])});}});}})[_0xe56f('0x27')](respondWithStatusCode(_0x388fdf,null))[_0xe56f('0x47')](handleError(_0x388fdf,null));};exports[_0xe56f('0x81')]=function(_0x391fcb,_0x3ddea3,_0x3956ab){var _0x45cc09={};var _0x323688={};var _0x229cc0;var _0x1e2c1b;return db[_0xe56f('0x2e')][_0xe56f('0x56')]({'where':{'id':_0x391fcb['params']['id']}})[_0xe56f('0x27')](handleEntityNotFound(_0x3ddea3,null))[_0xe56f('0x27')](function(_0x581d07){if(_0x581d07){_0x229cc0=_0x581d07;_0x323688['model']=_['keys'](db[_0xe56f('0x58')][_0xe56f('0x2f')]);_0x323688['query']=_[_0xe56f('0x4a')](_0x391fcb['query']);_0x323688[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0x323688[_0xe56f('0x30')],_0x323688[_0xe56f('0x31')]);_0x45cc09[_0xe56f('0x34')]=_[_0xe56f('0x33')](_0x323688[_0xe56f('0x30')],qs[_0xe56f('0x35')](_0x391fcb[_0xe56f('0x31')]['fields']));_0x45cc09[_0xe56f('0x34')]=_0x45cc09['attributes'][_0xe56f('0x36')]?_0x45cc09[_0xe56f('0x34')]:_0x323688[_0xe56f('0x30')];_0x45cc09[_0xe56f('0x39')]=qs[_0xe56f('0x3a')](_0x391fcb[_0xe56f('0x31')][_0xe56f('0x3a')]);_0x45cc09['where']=qs[_0xe56f('0x32')](_[_0xe56f('0x3b')](_0x391fcb['query'],_0x323688[_0xe56f('0x32')]));if(_0x391fcb[_0xe56f('0x31')][_0xe56f('0x3c')]){_0x45cc09[_0xe56f('0x3d')]=_['merge'](_0x45cc09['where'],{'$or':_[_0xe56f('0x3f')](_0x45cc09[_0xe56f('0x34')],function(_0x54b493){var _0x3773c8={};_0x3773c8[_0x54b493]={'$like':'%'+_0x391fcb[_0xe56f('0x31')][_0xe56f('0x3c')]+'%'};return _0x3773c8;})});}_0x45cc09=_['merge']({},_0x45cc09,_0x391fcb[_0xe56f('0x42')]);return _0x229cc0['getAgents'](_0x45cc09);}})[_0xe56f('0x27')](function(_0x484d16){if(_0x484d16){_0x1e2c1b=_0x484d16[_0xe56f('0x36')];if(!_0x391fcb[_0xe56f('0x31')][_0xe56f('0x37')](_0xe56f('0x38'))){_0x45cc09[_0xe56f('0x22')]=qs[_0xe56f('0x22')](_0x391fcb[_0xe56f('0x31')][_0xe56f('0x22')]);_0x45cc09[_0xe56f('0x21')]=qs[_0xe56f('0x21')](_0x391fcb[_0xe56f('0x31')]['offset']);}return _0x229cc0[_0xe56f('0x81')](_0x45cc09);}})[_0xe56f('0x27')](function(_0xd759ed){if(_0xd759ed){return _0xd759ed?{'count':_0x1e2c1b,'rows':_0xd759ed}:null;}})[_0xe56f('0x27')](respondWithResult(_0x3ddea3,null))['catch'](handleError(_0x3ddea3,null));}; \ No newline at end of file +var _0xcd06=['all','union','value','isEmpty','removeAgents','emit','addAgents','omit','spread','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','WhatsappQueue','findAll','rows','params','length','includeAll','include','options','find','catch','create','body','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserWhatsappQueue','User','UserId','agent','whatsappPause','updatedAt','format','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes'];(function(_0x246d15,_0x4abe3b){var _0x2419ff=function(_0x5b0c7d){while(--_0x5b0c7d){_0x246d15['push'](_0x246d15['shift']());}};_0x2419ff(++_0x4abe3b);}(_0xcd06,0x99));var _0x6cd0=function(_0x162f7f,_0x20ee0f){_0x162f7f=_0x162f7f-0x0;var _0x54f990=_0xcd06[_0x162f7f];return _0x54f990;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cd0('0x0'));var zipdir=require(_0x6cd0('0x1'));var jsonpatch=require(_0x6cd0('0x2'));var rp=require(_0x6cd0('0x3'));var moment=require(_0x6cd0('0x4'));var BPromise=require(_0x6cd0('0x5'));var Mustache=require('mustache');var util=require(_0x6cd0('0x6'));var path=require(_0x6cd0('0x7'));var sox=require(_0x6cd0('0x8'));var csv=require(_0x6cd0('0x9'));var ejs=require(_0x6cd0('0xa'));var fs=require('fs');var fs_extra=require(_0x6cd0('0xb'));var _=require(_0x6cd0('0xc'));var squel=require(_0x6cd0('0xd'));var crypto=require(_0x6cd0('0xe'));var jsforce=require(_0x6cd0('0xf'));var deskjs=require(_0x6cd0('0x10'));var toCsv=require(_0x6cd0('0x9'));var querystring=require(_0x6cd0('0x11'));var Papa=require(_0x6cd0('0x12'));var Redis=require(_0x6cd0('0x13'));var authService=require(_0x6cd0('0x14'));var qs=require(_0x6cd0('0x15'));var as=require(_0x6cd0('0x16'));var hardwareService=require(_0x6cd0('0x17'));var logger=require(_0x6cd0('0x18'))(_0x6cd0('0x19'));var utils=require('../../config/utils');var config=require(_0x6cd0('0x1a'));var licenseUtil=require(_0x6cd0('0x1b'));var db=require(_0x6cd0('0x1c'))['db'];config[_0x6cd0('0x1d')]=_['defaults'](config[_0x6cd0('0x1d')],{'host':_0x6cd0('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6cd0('0x1f'))[_0x6cd0('0x20')](socket);function respondWithStatusCode(_0x411c2d,_0x28c9b4){_0x28c9b4=_0x28c9b4||0xcc;return function(_0x13e2db){if(_0x13e2db){return _0x411c2d[_0x6cd0('0x21')](_0x28c9b4);}return _0x411c2d['status'](_0x28c9b4)[_0x6cd0('0x22')]();};}function respondWithResult(_0x23153b,_0x20c759){_0x20c759=_0x20c759||0xc8;return function(_0x46b27a){if(_0x46b27a){return _0x23153b[_0x6cd0('0x23')](_0x20c759)[_0x6cd0('0x24')](_0x46b27a);}};}function respondWithFilteredResult(_0x29dad9,_0x44e578){return function(_0x3e413b){if(_0x3e413b){var _0x38159d=typeof _0x44e578[_0x6cd0('0x25')]===_0x6cd0('0x26')&&typeof _0x44e578[_0x6cd0('0x27')]===_0x6cd0('0x26');var _0x354c0e=_0x3e413b[_0x6cd0('0x28')];var _0x459be5=_0x38159d?0x0:_0x44e578['offset'];var _0x49873d=_0x38159d?_0x3e413b['count']:_0x44e578['offset']+_0x44e578[_0x6cd0('0x27')];var _0x2f0d0f;if(_0x49873d>=_0x354c0e){_0x49873d=_0x354c0e;_0x2f0d0f=0xc8;}else{_0x2f0d0f=0xce;}_0x29dad9[_0x6cd0('0x23')](_0x2f0d0f);return _0x29dad9[_0x6cd0('0x29')](_0x6cd0('0x2a'),_0x459be5+'-'+_0x49873d+'/'+_0x354c0e)[_0x6cd0('0x24')](_0x3e413b);}return null;};}function patchUpdates(_0x4787d6){return function(_0x53082d){try{jsonpatch['apply'](_0x53082d,_0x4787d6,!![]);}catch(_0xba9e83){return BPromise[_0x6cd0('0x2b')](_0xba9e83);}return _0x53082d[_0x6cd0('0x2c')]();};}function saveUpdates(_0xc9e760,_0x3c5d75){return function(_0x213ef5){if(_0x213ef5){return _0x213ef5['update'](_0xc9e760)[_0x6cd0('0x2d')](function(_0x3ac128){return _0x3ac128;});}return null;};}function removeEntity(_0x4ee4b6,_0x20b355){return function(_0x2a345e){if(_0x2a345e){return _0x2a345e[_0x6cd0('0x2e')]()[_0x6cd0('0x2d')](function(){var _0x30bcb6=_0x2a345e[_0x6cd0('0x2f')]({'plain':!![]});var _0x27c4d8=_0x6cd0('0x30');return db[_0x6cd0('0x31')][_0x6cd0('0x2e')]({'where':{'type':_0x27c4d8,'resourceId':_0x30bcb6['id']}})['then'](function(){return _0x2a345e;});})[_0x6cd0('0x2d')](function(){_0x4ee4b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d03e,_0x47fe39){return function(_0xf661c1){if(!_0xf661c1){_0x42d03e['sendStatus'](0x194);}return _0xf661c1;};}function handleError(_0x12143b,_0x147d80){_0x147d80=_0x147d80||0x1f4;return function(_0x583365){logger[_0x6cd0('0x32')](_0x583365[_0x6cd0('0x33')]);if(_0x583365[_0x6cd0('0x34')]){delete _0x583365['name'];}_0x12143b[_0x6cd0('0x23')](_0x147d80)[_0x6cd0('0x35')](_0x583365);};}exports['index']=function(_0x1ef425,_0x1778ed){var _0x31d15f={},_0x44b554={},_0x3ca927={'count':0x0,'rows':[]};var _0x4672bf=_[_0x6cd0('0x36')](db['WhatsappQueue'][_0x6cd0('0x37')],function(_0x543ca7){return{'name':_0x543ca7[_0x6cd0('0x38')],'type':_0x543ca7['type']['key']};});_0x44b554[_0x6cd0('0x39')]=_[_0x6cd0('0x36')](_0x4672bf,'name');_0x44b554['query']=_[_0x6cd0('0x3a')](_0x1ef425[_0x6cd0('0x3b')]);_0x44b554[_0x6cd0('0x3c')]=_[_0x6cd0('0x3d')](_0x44b554['model'],_0x44b554[_0x6cd0('0x3b')]);_0x31d15f[_0x6cd0('0x3e')]=_[_0x6cd0('0x3d')](_0x44b554[_0x6cd0('0x39')],qs[_0x6cd0('0x3f')](_0x1ef425[_0x6cd0('0x3b')]['fields']));_0x31d15f[_0x6cd0('0x3e')]=_0x31d15f[_0x6cd0('0x3e')]['length']?_0x31d15f['attributes']:_0x44b554[_0x6cd0('0x39')];if(!_0x1ef425['query'][_0x6cd0('0x40')](_0x6cd0('0x41'))){_0x31d15f[_0x6cd0('0x27')]=qs['limit'](_0x1ef425[_0x6cd0('0x3b')]['limit']);_0x31d15f[_0x6cd0('0x25')]=qs[_0x6cd0('0x25')](_0x1ef425[_0x6cd0('0x3b')][_0x6cd0('0x25')]);}_0x31d15f[_0x6cd0('0x42')]=qs[_0x6cd0('0x43')](_0x1ef425[_0x6cd0('0x3b')][_0x6cd0('0x43')]);_0x31d15f[_0x6cd0('0x44')]=qs['filters'](_[_0x6cd0('0x45')](_0x1ef425['query'],_0x44b554[_0x6cd0('0x3c')]),_0x4672bf);if(_0x1ef425[_0x6cd0('0x3b')]['filter']){_0x31d15f['where']=_[_0x6cd0('0x46')](_0x31d15f[_0x6cd0('0x44')],{'$or':_['map'](_0x4672bf,function(_0x116c3d){if(_0x116c3d[_0x6cd0('0x47')]!==_0x6cd0('0x48')){var _0x303303={};_0x303303[_0x116c3d[_0x6cd0('0x34')]]={'$like':'%'+_0x1ef425[_0x6cd0('0x3b')][_0x6cd0('0x49')]+'%'};return _0x303303;}})});}_0x31d15f=_[_0x6cd0('0x46')]({},_0x31d15f,_0x1ef425['options']);var _0x4b4ab5={'where':_0x31d15f[_0x6cd0('0x44')]};return db[_0x6cd0('0x4a')][_0x6cd0('0x28')](_0x4b4ab5)[_0x6cd0('0x2d')](function(_0x283291){_0x3ca927['count']=_0x283291;if(_0x1ef425[_0x6cd0('0x3b')]['includeAll']){_0x31d15f['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x6cd0('0x4b')](_0x31d15f);})[_0x6cd0('0x2d')](function(_0x2094cc){_0x3ca927[_0x6cd0('0x4c')]=_0x2094cc;return _0x3ca927;})[_0x6cd0('0x2d')](respondWithFilteredResult(_0x1778ed,_0x31d15f))['catch'](handleError(_0x1778ed,null));};exports['show']=function(_0x3498b9,_0x8438e4){var _0x1528cb={'raw':!![],'where':{'id':_0x3498b9[_0x6cd0('0x4d')]['id']}},_0x4601f6={};_0x4601f6[_0x6cd0('0x39')]=_[_0x6cd0('0x3a')](db[_0x6cd0('0x4a')][_0x6cd0('0x37')]);_0x4601f6['query']=_[_0x6cd0('0x3a')](_0x3498b9[_0x6cd0('0x3b')]);_0x4601f6[_0x6cd0('0x3c')]=_[_0x6cd0('0x3d')](_0x4601f6[_0x6cd0('0x39')],_0x4601f6['query']);_0x1528cb['attributes']=_[_0x6cd0('0x3d')](_0x4601f6[_0x6cd0('0x39')],qs[_0x6cd0('0x3f')](_0x3498b9[_0x6cd0('0x3b')][_0x6cd0('0x3f')]));_0x1528cb[_0x6cd0('0x3e')]=_0x1528cb['attributes'][_0x6cd0('0x4e')]?_0x1528cb[_0x6cd0('0x3e')]:_0x4601f6[_0x6cd0('0x39')];if(_0x3498b9[_0x6cd0('0x3b')][_0x6cd0('0x4f')]){_0x1528cb[_0x6cd0('0x50')]=[{'all':!![]}];}_0x1528cb=_[_0x6cd0('0x46')]({},_0x1528cb,_0x3498b9[_0x6cd0('0x51')]);return db[_0x6cd0('0x4a')][_0x6cd0('0x52')](_0x1528cb)[_0x6cd0('0x2d')](handleEntityNotFound(_0x8438e4,null))[_0x6cd0('0x2d')](respondWithResult(_0x8438e4,null))[_0x6cd0('0x53')](handleError(_0x8438e4,null));};exports['create']=function(_0x4aca8c,_0x1d892f){return db['WhatsappQueue'][_0x6cd0('0x54')](_0x4aca8c[_0x6cd0('0x55')],{})[_0x6cd0('0x2d')](function(_0x4ebc90){var _0x4a349e=_0x4aca8c['user']['get']({'plain':!![]});if(!_0x4a349e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a349e['role']==='user'){var _0x541ce6=_0x4ebc90[_0x6cd0('0x2f')]({'plain':!![]});var _0x5d477a=_0x6cd0('0x30');return db[_0x6cd0('0x56')][_0x6cd0('0x52')]({'where':{'name':_0x5d477a,'userProfileId':_0x4a349e['userProfileId']},'raw':!![]})[_0x6cd0('0x2d')](function(_0xb8c84){if(_0xb8c84&&_0xb8c84['autoAssociation']===0x0){return db[_0x6cd0('0x31')]['create']({'name':_0x541ce6['name'],'resourceId':_0x541ce6['id'],'type':_0xb8c84[_0x6cd0('0x34')],'sectionId':_0xb8c84['id']},{})[_0x6cd0('0x2d')](function(){return _0x4ebc90;});}else{return _0x4ebc90;}})[_0x6cd0('0x53')](function(_0x1639d3){logger[_0x6cd0('0x32')](_0x6cd0('0x57'),_0x1639d3);throw _0x1639d3;});}return _0x4ebc90;})[_0x6cd0('0x2d')](respondWithResult(_0x1d892f,0xc9))['catch'](handleError(_0x1d892f,null));};exports[_0x6cd0('0x58')]=function(_0x110648,_0x475629){if(_0x110648[_0x6cd0('0x55')]['id']){delete _0x110648[_0x6cd0('0x55')]['id'];}return db[_0x6cd0('0x4a')]['find']({'where':{'id':_0x110648[_0x6cd0('0x4d')]['id']}})[_0x6cd0('0x2d')](handleEntityNotFound(_0x475629,null))['then'](saveUpdates(_0x110648['body'],null))[_0x6cd0('0x2d')](respondWithResult(_0x475629,null))['catch'](handleError(_0x475629,null));};exports[_0x6cd0('0x2e')]=function(_0x23f22f,_0x305b99){return db[_0x6cd0('0x4a')][_0x6cd0('0x52')]({'where':{'id':_0x23f22f[_0x6cd0('0x4d')]['id']}})[_0x6cd0('0x2d')](handleEntityNotFound(_0x305b99,null))[_0x6cd0('0x2d')](removeEntity(_0x305b99,null))[_0x6cd0('0x53')](handleError(_0x305b99,null));};exports[_0x6cd0('0x59')]=function(_0x499c1c,_0x10155d){return db[_0x6cd0('0x4a')]['describe']()[_0x6cd0('0x2d')](respondWithResult(_0x10155d,null))[_0x6cd0('0x53')](handleError(_0x10155d,null));};exports[_0x6cd0('0x5a')]=function(_0x409db8,_0xd8c9c1,_0x3fb942){var _0x26d09c={'raw':!![],'where':{}},_0x5bf6b1={},_0x371ce9;return db[_0x6cd0('0x4a')][_0x6cd0('0x5b')]({'where':{'id':_0x409db8['params']['id']}})[_0x6cd0('0x2d')](handleEntityNotFound(_0xd8c9c1,null))[_0x6cd0('0x2d')](function(_0x55f412){if(_0x55f412){_0x371ce9=_0x55f412[_0x6cd0('0x2f')]({'plain':!![]});_0x5bf6b1[_0x6cd0('0x39')]=_[_0x6cd0('0x3a')](db['UserWhatsappQueue'][_0x6cd0('0x37')]);_0x5bf6b1['query']=_[_0x6cd0('0x3a')](_0x409db8['query']);_0x5bf6b1[_0x6cd0('0x3c')]=_[_0x6cd0('0x3d')](_0x5bf6b1[_0x6cd0('0x39')],_0x5bf6b1[_0x6cd0('0x3b')]);_0x26d09c[_0x6cd0('0x3e')]=_[_0x6cd0('0x3d')](_0x5bf6b1['model'],qs[_0x6cd0('0x3f')](_0x409db8[_0x6cd0('0x3b')]['fields']));_0x26d09c[_0x6cd0('0x3e')]=_0x26d09c[_0x6cd0('0x3e')]['length']?_0x26d09c[_0x6cd0('0x3e')]:_0x5bf6b1['model'];if(!_0x409db8[_0x6cd0('0x3b')]['hasOwnProperty'](_0x6cd0('0x41'))){_0x26d09c[_0x6cd0('0x27')]=qs[_0x6cd0('0x27')](_0x409db8[_0x6cd0('0x3b')][_0x6cd0('0x27')]);_0x26d09c[_0x6cd0('0x25')]=qs[_0x6cd0('0x25')](_0x409db8[_0x6cd0('0x3b')]['offset']);}_0x26d09c[_0x6cd0('0x42')]=qs[_0x6cd0('0x43')](_0x409db8[_0x6cd0('0x3b')][_0x6cd0('0x43')]);_0x26d09c[_0x6cd0('0x44')]=qs[_0x6cd0('0x3c')](_['pick'](_0x409db8[_0x6cd0('0x3b')],_0x5bf6b1[_0x6cd0('0x3c')]));_0x26d09c[_0x6cd0('0x44')]['WhatsappQueueId']=_0x55f412['id'];if(_0x409db8[_0x6cd0('0x3b')]['filter']){_0x26d09c[_0x6cd0('0x44')]=_[_0x6cd0('0x46')](_0x26d09c['where'],{'$or':_[_0x6cd0('0x36')](_0x26d09c['attributes'],function(_0x812a6){var _0x150090={};_0x150090[_0x812a6]={'$like':'%'+_0x409db8[_0x6cd0('0x3b')][_0x6cd0('0x49')]+'%'};return _0x150090;})});}_0x26d09c=_[_0x6cd0('0x46')]({},_0x26d09c,_0x409db8[_0x6cd0('0x51')]);return db[_0x6cd0('0x5c')]['findAll'](_0x26d09c);}})[_0x6cd0('0x2d')](function(_0x250d72){if(_0x250d72){return db[_0x6cd0('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x250d72,_0x6cd0('0x5e')),'role':_0x6cd0('0x5f')},'attributes':['id',_0x6cd0('0x34'),_0x6cd0('0x60'),_0x6cd0('0x61'),'createdAt']});}})['then'](function(_0x471cfa){if(_0x471cfa){return{'count':_0x471cfa[_0x6cd0('0x28')],'rows':_['map'](_0x471cfa[_0x6cd0('0x4c')],function(_0x11c47b){return{'membername':_0x11c47b['name'],'UserId':_0x11c47b['id'],'queue_name':_0x371ce9[_0x6cd0('0x34')],'WhatsappQueueId':_0x371ce9['id'],'interface':util[_0x6cd0('0x62')]('%s/%s',_0x6cd0('0x63'),_0x11c47b[_0x6cd0('0x34')]),'penalty':0x0,'paused':_0x11c47b['whatsappPause'],'createdAt':_0x11c47b[_0x6cd0('0x64')],'updatedAt':_0x11c47b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6cd0('0x2d')](respondWithFilteredResult(_0xd8c9c1,_0x26d09c))[_0x6cd0('0x53')](handleError(_0xd8c9c1,null));};exports[_0x6cd0('0x65')]=function(_0x4a65ef,_0x111226,_0x26b0d6){var _0x2226db={};var _0x3ba304={};var _0x3153d0;var _0x5833f4;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4a65ef[_0x6cd0('0x4d')]['id']}})[_0x6cd0('0x2d')](handleEntityNotFound(_0x111226,null))[_0x6cd0('0x2d')](function(_0x1dd0c2){if(_0x1dd0c2){_0x3153d0=_0x1dd0c2;_0x3ba304[_0x6cd0('0x39')]=_[_0x6cd0('0x3a')](db['Team']['rawAttributes']);_0x3ba304['query']=_[_0x6cd0('0x3a')](_0x4a65ef['query']);_0x3ba304[_0x6cd0('0x3c')]=_[_0x6cd0('0x3d')](_0x3ba304[_0x6cd0('0x39')],_0x3ba304[_0x6cd0('0x3b')]);_0x2226db['attributes']=_['intersection'](_0x3ba304[_0x6cd0('0x39')],qs[_0x6cd0('0x3f')](_0x4a65ef[_0x6cd0('0x3b')]['fields']));_0x2226db[_0x6cd0('0x3e')]=_0x2226db[_0x6cd0('0x3e')][_0x6cd0('0x4e')]?_0x2226db[_0x6cd0('0x3e')]:_0x3ba304['model'];_0x2226db['order']=qs[_0x6cd0('0x43')](_0x4a65ef[_0x6cd0('0x3b')][_0x6cd0('0x43')]);_0x2226db[_0x6cd0('0x44')]=qs['filters'](_[_0x6cd0('0x45')](_0x4a65ef[_0x6cd0('0x3b')],_0x3ba304[_0x6cd0('0x3c')]));if(_0x4a65ef[_0x6cd0('0x3b')]['filter']){_0x2226db[_0x6cd0('0x44')]=_[_0x6cd0('0x46')](_0x2226db[_0x6cd0('0x44')],{'$or':_[_0x6cd0('0x36')](_0x2226db[_0x6cd0('0x3e')],function(_0xb4422e){var _0x5cc377={};_0x5cc377[_0xb4422e]={'$like':'%'+_0x4a65ef['query']['filter']+'%'};return _0x5cc377;})});}_0x2226db=_[_0x6cd0('0x46')]({},_0x2226db,_0x4a65ef['options']);return _0x3153d0[_0x6cd0('0x65')](_0x2226db);}})[_0x6cd0('0x2d')](function(_0x265f11){if(_0x265f11){_0x5833f4=_0x265f11[_0x6cd0('0x4e')];if(!_0x4a65ef[_0x6cd0('0x3b')][_0x6cd0('0x40')]('nolimit')){_0x2226db['limit']=qs[_0x6cd0('0x27')](_0x4a65ef[_0x6cd0('0x3b')][_0x6cd0('0x27')]);_0x2226db['offset']=qs[_0x6cd0('0x25')](_0x4a65ef[_0x6cd0('0x3b')][_0x6cd0('0x25')]);}return _0x3153d0[_0x6cd0('0x65')](_0x2226db);}})[_0x6cd0('0x2d')](function(_0x584e9a){if(_0x584e9a){return _0x584e9a?{'count':_0x5833f4,'rows':_0x584e9a}:null;}})[_0x6cd0('0x2d')](respondWithResult(_0x111226,null))['catch'](handleError(_0x111226,null));};exports[_0x6cd0('0x66')]=function(_0xc380ab,_0x171a5f,_0x4aa76c){var _0x145fd6=_0xc380ab['body'][_0x6cd0('0x67')];return db[_0x6cd0('0x68')][_0x6cd0('0x4b')]({'where':{'id':_0x145fd6},'attributes':['id'],'include':[{'model':db[_0x6cd0('0x5d')],'as':_0x6cd0('0x69'),'attributes':['id','name','online',_0x6cd0('0x6a'),_0x6cd0('0x6b')],'raw':!![]}]})[_0x6cd0('0x2d')](function(_0x14505e){if(_0x14505e){var _0x5d1e26=_[_0x6cd0('0x6c')](_0x14505e,function(_0x4fc323){var _0x3b042d=_0x4fc323[_0x6cd0('0x2f')]({'plain':!![]});return _0x3b042d[_0x6cd0('0x69')];});return db[_0x6cd0('0x4a')]['find']({'where':{'id':_0xc380ab['params']['id']}})[_0x6cd0('0x2d')](function(_0x4f7891){return db[_0x6cd0('0x6d')][_0x6cd0('0x6e')](function(_0x34af86){return _0x4f7891[_0x6cd0('0x66')](_0x145fd6,{'transaction':_0x34af86})[_0x6cd0('0x2d')](function(){return BPromise[_0x6cd0('0x6f')](_0x5d1e26,function(_0x3b77fa){return db['UserWhatsappQueue'][_0x6cd0('0x70')]({'where':{'UserId':_0x3b77fa['id'],'WhatsappQueueId':_0xc380ab['params']['id']},'transaction':_0x34af86});});})[_0x6cd0('0x2d')](function(){_0x5d1e26[_0x6cd0('0x71')](function(_0x918ec9){socket['emit'](_0x6cd0('0x72'),{'UserId':_0x918ec9['id'],'WhatsappQueueId':_0x4f7891['id']});});});});});}})[_0x6cd0('0x2d')](respondWithStatusCode(_0x171a5f,null))['catch'](handleError(_0x171a5f,null));};exports[_0x6cd0('0x73')]=function(_0x84655e,_0x3e63ab,_0x55666f){return db['Team'][_0x6cd0('0x4b')]({'where':{'id':_0x84655e['query'][_0x6cd0('0x67')]},'attributes':['id'],'include':[{'model':db[_0x6cd0('0x5d')],'as':_0x6cd0('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e63ab,null))[_0x6cd0('0x2d')](function(_0x3d68db){var _0x20c6d6=_[_0x6cd0('0x36')](_0x3d68db,'id');var _0x487143=[];var _0x4f86aa=[];var _0x2fe8c8=squel[_0x6cd0('0x74')]();_0x2fe8c8[_0x6cd0('0x75')](_0x6cd0('0x76'))[_0x6cd0('0x77')](_0x6cd0('0x78'),'tq')[_0x6cd0('0x79')](_0x6cd0('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6cd0('0x44')](_0x6cd0('0x7b'),_0x84655e[_0x6cd0('0x4d')]['id']);for(var _0x4526f3=0x0;_0x4526f3<_0x3d68db['length'];_0x4526f3+=0x1){let _0xc87f98=_0x3d68db[_0x4526f3];for(var _0x5a7490=0x0;_0x5a7490<_0xc87f98[_0x6cd0('0x69')][_0x6cd0('0x4e')];_0x5a7490+=0x1){let _0x344fd4=_0xc87f98[_0x6cd0('0x69')][_0x5a7490];var _0x91d35d=_0x2fe8c8[_0x6cd0('0x7c')]();_0x91d35d[_0x6cd0('0x44')](_0x6cd0('0x7d'),_0x344fd4['id']);_0x4f86aa[_0x6cd0('0x7e')](db['sequelize'][_0x6cd0('0x3b')](_0x91d35d['toString'](),{'type':db['sequelize'][_0x6cd0('0x7f')]['SELECT']})['then'](function(_0x4c74dc){if(_0x4c74dc['length']===0x1){return _0x344fd4['id'];}else{var _0x33db0c=_[_0x6cd0('0x80')](_['map'](_0x4c74dc,_0x6cd0('0x81')),function(_0x4ce29a){return _[_0x6cd0('0x82')](_0x20c6d6,_0x4ce29a);});if(_0x33db0c){return _0x344fd4['id'];}}}));}}return BPromise[_0x6cd0('0x83')](_0x4f86aa)[_0x6cd0('0x2d')](function(_0x22e795){_0x487143=_(_0x487143)[_0x6cd0('0x84')](_0x22e795)['compact']()[_0x6cd0('0x85')]();return db[_0x6cd0('0x4a')]['find']({'where':{'id':_0x84655e[_0x6cd0('0x4d')]['id']}})[_0x6cd0('0x2d')](function(_0x3e6834){return db[_0x6cd0('0x6d')][_0x6cd0('0x6e')](function(_0x68f9e5){return _0x3e6834['removeTeams'](_0x84655e[_0x6cd0('0x3b')][_0x6cd0('0x67')],{'transaction':_0x68f9e5})[_0x6cd0('0x2d')](function(){if(!_[_0x6cd0('0x86')](_0x487143)){return _0x3e6834[_0x6cd0('0x87')](_0x487143,{'transaction':_0x68f9e5});}})[_0x6cd0('0x2d')](function(){_0x487143[_0x6cd0('0x71')](function(_0x188930){socket[_0x6cd0('0x88')]('userWhatsappQueue:remove',{'UserId':_0x188930,'WhatsappQueueId':_0x3e6834['id']});});});});});});})[_0x6cd0('0x2d')](respondWithStatusCode(_0x3e63ab,null))[_0x6cd0('0x53')](handleError(_0x3e63ab,null));};exports['addAgents']=function(_0xcba2fd,_0x2a6ea8,_0x2221f3){return db['WhatsappQueue'][_0x6cd0('0x52')]({'where':{'id':_0xcba2fd['params']['id']}})[_0x6cd0('0x2d')](handleEntityNotFound(_0x2a6ea8,null))['then'](function(_0xab3975){if(_0xab3975){return _0xab3975[_0x6cd0('0x89')](_0xcba2fd[_0x6cd0('0x55')][_0x6cd0('0x67')],_[_0x6cd0('0x8a')](_0xcba2fd[_0x6cd0('0x55')],[_0x6cd0('0x67'),'id'])||{})[_0x6cd0('0x8b')](function(_0x1f1e83){for(var _0x58ce22=0x0;_0x58ce22<_0xcba2fd['body']['ids'][_0x6cd0('0x4e')];_0x58ce22+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0xcba2fd[_0x6cd0('0x55')]['ids'][_0x58ce22]),'WhatsappQueueId':Number(_0xcba2fd[_0x6cd0('0x4d')]['id'])});}return _0x1f1e83;});}})[_0x6cd0('0x2d')](respondWithResult(_0x2a6ea8,null))['catch'](handleError(_0x2a6ea8,null));};exports['removeAgents']=function(_0x30f2f0,_0x58ebb0,_0x3db04b){return db['WhatsappQueue'][_0x6cd0('0x52')]({'where':{'id':_0x30f2f0['params']['id']}})['then'](handleEntityNotFound(_0x58ebb0,null))[_0x6cd0('0x2d')](function(_0x25d061){if(_0x25d061){return _0x25d061[_0x6cd0('0x87')](_0x30f2f0['query'][_0x6cd0('0x67')])[_0x6cd0('0x2d')](function(){if(_['isArray'](_0x30f2f0[_0x6cd0('0x3b')]['ids'])){for(var _0x308c8a=0x0;_0x308c8a<_0x30f2f0[_0x6cd0('0x3b')][_0x6cd0('0x67')][_0x6cd0('0x4e')];_0x308c8a+=0x1){socket[_0x6cd0('0x88')](_0x6cd0('0x8c'),{'UserId':Number(_0x30f2f0[_0x6cd0('0x3b')]['ids'][_0x308c8a]),'WhatsappQueueId':Number(_0x30f2f0[_0x6cd0('0x4d')]['id'])});}}else{socket[_0x6cd0('0x88')]('userWhatsappQueue:remove',{'UserId':Number(_0x30f2f0[_0x6cd0('0x3b')][_0x6cd0('0x67')]),'WhatsappQueueId':Number(_0x30f2f0[_0x6cd0('0x4d')]['id'])});}});}})[_0x6cd0('0x2d')](respondWithStatusCode(_0x58ebb0,null))[_0x6cd0('0x53')](handleError(_0x58ebb0,null));};exports[_0x6cd0('0x8d')]=function(_0x47e938,_0x424ea3,_0x51684c){var _0x28e330={};var _0x27126e={};var _0x3fed3b;var _0x4cdacc;return db[_0x6cd0('0x4a')][_0x6cd0('0x5b')]({'where':{'id':_0x47e938[_0x6cd0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x424ea3,null))[_0x6cd0('0x2d')](function(_0x2e33e8){if(_0x2e33e8){_0x3fed3b=_0x2e33e8;_0x27126e[_0x6cd0('0x39')]=_[_0x6cd0('0x3a')](db[_0x6cd0('0x5d')][_0x6cd0('0x37')]);_0x27126e[_0x6cd0('0x3b')]=_[_0x6cd0('0x3a')](_0x47e938[_0x6cd0('0x3b')]);_0x27126e[_0x6cd0('0x3c')]=_['intersection'](_0x27126e[_0x6cd0('0x39')],_0x27126e[_0x6cd0('0x3b')]);_0x28e330[_0x6cd0('0x3e')]=_[_0x6cd0('0x3d')](_0x27126e[_0x6cd0('0x39')],qs[_0x6cd0('0x3f')](_0x47e938[_0x6cd0('0x3b')][_0x6cd0('0x3f')]));_0x28e330[_0x6cd0('0x3e')]=_0x28e330[_0x6cd0('0x3e')]['length']?_0x28e330[_0x6cd0('0x3e')]:_0x27126e[_0x6cd0('0x39')];_0x28e330[_0x6cd0('0x42')]=qs[_0x6cd0('0x43')](_0x47e938[_0x6cd0('0x3b')][_0x6cd0('0x43')]);_0x28e330[_0x6cd0('0x44')]=qs[_0x6cd0('0x3c')](_[_0x6cd0('0x45')](_0x47e938[_0x6cd0('0x3b')],_0x27126e[_0x6cd0('0x3c')]));if(_0x47e938[_0x6cd0('0x3b')]['filter']){_0x28e330['where']=_[_0x6cd0('0x46')](_0x28e330[_0x6cd0('0x44')],{'$or':_[_0x6cd0('0x36')](_0x28e330[_0x6cd0('0x3e')],function(_0x5e257a){var _0x5f148d={};_0x5f148d[_0x5e257a]={'$like':'%'+_0x47e938[_0x6cd0('0x3b')]['filter']+'%'};return _0x5f148d;})});}_0x28e330=_[_0x6cd0('0x46')]({},_0x28e330,_0x47e938[_0x6cd0('0x51')]);return _0x3fed3b[_0x6cd0('0x8d')](_0x28e330);}})[_0x6cd0('0x2d')](function(_0x4d7f6f){if(_0x4d7f6f){_0x4cdacc=_0x4d7f6f[_0x6cd0('0x4e')];if(!_0x47e938[_0x6cd0('0x3b')][_0x6cd0('0x40')]('nolimit')){_0x28e330['limit']=qs[_0x6cd0('0x27')](_0x47e938[_0x6cd0('0x3b')]['limit']);_0x28e330['offset']=qs[_0x6cd0('0x25')](_0x47e938[_0x6cd0('0x3b')][_0x6cd0('0x25')]);}return _0x3fed3b[_0x6cd0('0x8d')](_0x28e330);}})[_0x6cd0('0x2d')](function(_0x1c715c){if(_0x1c715c){return _0x1c715c?{'count':_0x4cdacc,'rows':_0x1c715c}:null;}})[_0x6cd0('0x2d')](respondWithResult(_0x424ea3,null))[_0x6cd0('0x53')](handleError(_0x424ea3,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 5cac1b7..1290f9d 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 _0x0a73=['remove','exports','setMaxListeners','save','update'];(function(_0x5e4eb8,_0xcae319){var _0x27751c=function(_0x3bb5ee){while(--_0x3bb5ee){_0x5e4eb8['push'](_0x5e4eb8['shift']());}};_0x27751c(++_0xcae319);}(_0x0a73,0x1e7));var _0x30a7=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x0a73[_0x5c7e53];return _0x1c9af9;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x30a7('0x0')](0x0);var events={'afterCreate':_0x30a7('0x1'),'afterUpdate':_0x30a7('0x2'),'afterDestroy':_0x30a7('0x3')};function emitEvent(_0x10c500){return function(_0x1f39d9,_0x41f01d,_0x107cb2){WhatsappQueueEvents['emit'](_0x10c500+':'+_0x1f39d9['id'],_0x1f39d9);WhatsappQueueEvents['emit'](_0x10c500,_0x1f39d9);_0x107cb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x30a7('0x4')]=WhatsappQueueEvents; \ No newline at end of file +var _0xdc85=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2057ca,_0x34b43c){var _0x242563=function(_0xb1c706){while(--_0xb1c706){_0x2057ca['push'](_0x2057ca['shift']());}};_0x242563(++_0x34b43c);}(_0xdc85,0x107));var _0x5dc8=function(_0x223d45,_0x3e2623){_0x223d45=_0x223d45-0x0;var _0x474bbf=_0xdc85[_0x223d45];return _0x474bbf;};'use strict';var EventEmitter=require(_0x5dc8('0x0'));var WhatsappQueue=require(_0x5dc8('0x1'))['db'][_0x5dc8('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5dc8('0x3')](0x0);var events={'afterCreate':_0x5dc8('0x4'),'afterUpdate':_0x5dc8('0x5'),'afterDestroy':_0x5dc8('0x6')};function emitEvent(_0x5d2547){return function(_0x2d558d,_0x1ab7cd,_0x1a9724){WhatsappQueueEvents[_0x5dc8('0x7')](_0x5d2547+':'+_0x2d558d['id'],_0x2d558d);WhatsappQueueEvents[_0x5dc8('0x7')](_0x5d2547,_0x2d558d);_0x1a9724(null);};}for(var e in events){if(events[_0x5dc8('0x8')](e)){var event=events[e];WhatsappQueue[_0x5dc8('0x9')](e,emitEvent(event));}}module[_0x5dc8('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 736a814..38d4b4e 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 _0x8d5c=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d5c,0x81));var _0xc8d5=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x8d5c[_0x13594e];return _0x1a4f42;};'use strict';var _=require(_0xc8d5('0x0'));var util=require(_0xc8d5('0x1'));var logger=require(_0xc8d5('0x2'))(_0xc8d5('0x3'));var moment=require(_0xc8d5('0x4'));var BPromise=require(_0xc8d5('0x5'));var rp=require(_0xc8d5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8d5('0x7'));var config=require(_0xc8d5('0x8'));var attributes=require(_0xc8d5('0x9'));module[_0xc8d5('0xa')]=function(_0x566476,_0x3977cc){return _0x566476['define'](_0xc8d5('0xb'),attributes,{'tableName':_0xc8d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a80=['request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','bluebird'];(function(_0x9bfa91,_0x6dfb43){var _0x18740c=function(_0x134f4a){while(--_0x134f4a){_0x9bfa91['push'](_0x9bfa91['shift']());}};_0x18740c(++_0x6dfb43);}(_0x3a80,0x10f));var _0x03a8=function(_0x4da481,_0x11224a){_0x4da481=_0x4da481-0x0;var _0x43204d=_0x3a80[_0x4da481];return _0x43204d;};'use strict';var _=require(_0x03a8('0x0'));var util=require(_0x03a8('0x1'));var logger=require(_0x03a8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x03a8('0x3'));var rp=require(_0x03a8('0x4'));var fs=require('fs');var path=require(_0x03a8('0x5'));var rimraf=require(_0x03a8('0x6'));var config=require(_0x03a8('0x7'));var attributes=require(_0x03a8('0x8'));module['exports']=function(_0x2d36c0,_0x4791de){return _0x2d36c0['define'](_0x03a8('0x9'),attributes,{'tableName':_0x03a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 8756720..2964a2c 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 _0x07be=['redis','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetWhatsappQueue','WhatsappQueue','findAll','options','attributes','include','map','model','catch','ShowWhatsappQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','http'];(function(_0x36d9d5,_0x1489bd){var _0x2dbcb0=function(_0x2fa006){while(--_0x2fa006){_0x36d9d5['push'](_0x36d9d5['shift']());}};_0x2dbcb0(++_0x1489bd);}(_0x07be,0x84));var _0xe07b=function(_0x5234bb,_0x6e1f87){_0x5234bb=_0x5234bb-0x0;var _0x22c605=_0x07be[_0x5234bb];return _0x22c605;};'use strict';var _=require(_0xe07b('0x0'));var util=require(_0xe07b('0x1'));var moment=require(_0xe07b('0x2'));var BPromise=require(_0xe07b('0x3'));var rs=require(_0xe07b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe07b('0x5'));var logger=require('../../config/logger')(_0xe07b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe07b('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe07b('0x8')]));require(_0xe07b('0x9'))[_0xe07b('0xa')](socket);function respondWithRpcPromise(_0x28ea3e,_0x569c03,_0x1a8821){return new BPromise(function(_0x2cde78,_0x2d3e40){return client[_0xe07b('0xb')](_0x28ea3e,_0x1a8821)[_0xe07b('0xc')](function(_0xd68408){logger['info'](_0xe07b('0xd'),_0x569c03,_0xe07b('0xe'));logger[_0xe07b('0xf')](_0xe07b('0x10'),_0x569c03,'request\x20sent',JSON[_0xe07b('0x11')](_0xd68408));if(_0xd68408[_0xe07b('0x12')]){if(_0xd68408[_0xe07b('0x12')][_0xe07b('0x13')]===0x1f4){logger['error'](_0xe07b('0xd'),_0x569c03,_0xd68408['error'][_0xe07b('0x14')]);return _0x2d3e40(_0xd68408['error']['message']);}logger[_0xe07b('0x12')](_0xe07b('0xd'),_0x569c03,_0xd68408[_0xe07b('0x12')]['message']);return _0x2cde78(_0xd68408[_0xe07b('0x12')][_0xe07b('0x14')]);}else{logger[_0xe07b('0x15')](_0xe07b('0xd'),_0x569c03,'request\x20sent');_0x2cde78(_0xd68408['result'][_0xe07b('0x14')]);}})['catch'](function(_0x3590aa){logger[_0xe07b('0x12')](_0xe07b('0xd'),_0x569c03,_0x3590aa);_0x2d3e40(_0x3590aa);});});}exports[_0xe07b('0x16')]=function(_0x52214f){var _0x3b752f=this;return new Promise(function(_0x24a887,_0x539666){return db[_0xe07b('0x17')][_0xe07b('0x18')]({'raw':_0x52214f[_0xe07b('0x19')]?_0x52214f[_0xe07b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x52214f['options']?_0x52214f[_0xe07b('0x19')]['where']||null:null,'attributes':_0x52214f[_0xe07b('0x19')]?_0x52214f[_0xe07b('0x19')][_0xe07b('0x1a')]||null:null,'limit':_0x52214f[_0xe07b('0x19')]?_0x52214f[_0xe07b('0x19')]['limit']||null:null,'include':_0x52214f[_0xe07b('0x19')]?_0x52214f[_0xe07b('0x19')][_0xe07b('0x1b')]?_[_0xe07b('0x1c')](_0x52214f[_0xe07b('0x19')][_0xe07b('0x1b')],function(_0x4af244){return{'model':db[_0x4af244[_0xe07b('0x1d')]],'as':_0x4af244['as'],'attributes':_0x4af244[_0xe07b('0x1a')],'include':_0x4af244[_0xe07b('0x1b')]?_[_0xe07b('0x1c')](_0x4af244[_0xe07b('0x1b')],function(_0x529f69){return{'model':db[_0x529f69[_0xe07b('0x1d')]],'as':_0x529f69['as'],'attributes':_0x529f69[_0xe07b('0x1a')],'include':_0x529f69[_0xe07b('0x1b')]?_[_0xe07b('0x1c')](_0x529f69[_0xe07b('0x1b')],function(_0x5bd3d1){return{'model':db[_0x5bd3d1[_0xe07b('0x1d')]],'as':_0x5bd3d1['as'],'attributes':_0x5bd3d1[_0xe07b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe07b('0xc')](function(_0x43df31){logger[_0xe07b('0x15')]('GetWhatsappQueue',_0x52214f);logger['debug'](_0xe07b('0x16'),_0x52214f,JSON[_0xe07b('0x11')](_0x43df31));_0x24a887(_0x43df31);})[_0xe07b('0x1e')](function(_0x350b68){logger[_0xe07b('0x12')](_0xe07b('0x16'),_0x350b68['message'],_0x52214f);_0x539666(_0x3b752f[_0xe07b('0x12')](0x1f4,_0x350b68[_0xe07b('0x14')]));});});};exports[_0xe07b('0x1f')]=function(_0x2f94b1){var _0x3fe7a4=this;return new Promise(function(_0x456fde,_0x173aef){return db[_0xe07b('0x17')][_0xe07b('0x20')]({'raw':_0x2f94b1['options']?_0x2f94b1[_0xe07b('0x19')][_0xe07b('0x21')]===undefined?!![]:![]:!![],'where':_0x2f94b1['options']?_0x2f94b1[_0xe07b('0x19')][_0xe07b('0x22')]||null:null,'attributes':_0x2f94b1[_0xe07b('0x19')]?_0x2f94b1[_0xe07b('0x19')][_0xe07b('0x1a')]||null:null,'include':_0x2f94b1[_0xe07b('0x19')]?_0x2f94b1['options'][_0xe07b('0x1b')]?_[_0xe07b('0x1c')](_0x2f94b1[_0xe07b('0x19')][_0xe07b('0x1b')],function(_0xf3e4c8){return{'model':db[_0xf3e4c8['model']],'as':_0xf3e4c8['as'],'attributes':_0xf3e4c8['attributes'],'include':_0xf3e4c8['include']?_[_0xe07b('0x1c')](_0xf3e4c8[_0xe07b('0x1b')],function(_0x21de02){return{'model':db[_0x21de02[_0xe07b('0x1d')]],'as':_0x21de02['as'],'attributes':_0x21de02[_0xe07b('0x1a')],'include':_0x21de02[_0xe07b('0x1b')]?_['map'](_0x21de02[_0xe07b('0x1b')],function(_0x199cda){return{'model':db[_0x199cda[_0xe07b('0x1d')]],'as':_0x199cda['as'],'attributes':_0x199cda['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x435248){logger[_0xe07b('0x15')]('ShowWhatsappQueue',_0x2f94b1);logger[_0xe07b('0xf')](_0xe07b('0x1f'),_0x2f94b1,JSON['stringify'](_0x435248));_0x456fde(_0x435248);})[_0xe07b('0x1e')](function(_0x38a1ab){logger[_0xe07b('0x12')](_0xe07b('0x1f'),_0x38a1ab[_0xe07b('0x14')],_0x2f94b1);_0x173aef(_0x3fe7a4[_0xe07b('0x12')](0x1f4,_0x38a1ab['message']));});});}; \ No newline at end of file +var _0x519f=['debug','ShowWhatsappQueue','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x52f555,_0x110b13){var _0x7b81b1=function(_0xf8a78c){while(--_0xf8a78c){_0x52f555['push'](_0x52f555['shift']());}};_0x7b81b1(++_0x110b13);}(_0x519f,0x7f));var _0xf519=function(_0x42ab37,_0x538b19){_0x42ab37=_0x42ab37-0x0;var _0x42d8ac=_0x519f[_0x42ab37];return _0x42d8ac;};'use strict';var _=require(_0xf519('0x0'));var util=require(_0xf519('0x1'));var moment=require(_0xf519('0x2'));var BPromise=require(_0xf519('0x3'));var rs=require(_0xf519('0x4'));var fs=require('fs');var Redis=require(_0xf519('0x5'));var db=require(_0xf519('0x6'))['db'];var utils=require(_0xf519('0x7'));var logger=require('../../config/logger')(_0xf519('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf519('0x9')][_0xf519('0xa')]({'port':0x232a});config[_0xf519('0xb')]=_['defaults'](config[_0xf519('0xb')],{'host':_0xf519('0xc'),'port':0x18eb});var socket=require(_0xf519('0xd'))(new Redis(config[_0xf519('0xb')]));require(_0xf519('0xe'))[_0xf519('0xf')](socket);function respondWithRpcPromise(_0x7d4b52,_0x264dd9,_0x1aaa5b){return new BPromise(function(_0x387874,_0x56d2c0){return client[_0xf519('0x10')](_0x7d4b52,_0x1aaa5b)[_0xf519('0x11')](function(_0x56ff8d){logger['info'](_0xf519('0x12'),_0x264dd9,_0xf519('0x13'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x264dd9,_0xf519('0x13'),JSON[_0xf519('0x14')](_0x56ff8d));if(_0x56ff8d[_0xf519('0x15')]){if(_0x56ff8d[_0xf519('0x15')][_0xf519('0x16')]===0x1f4){logger['error'](_0xf519('0x12'),_0x264dd9,_0x56ff8d[_0xf519('0x15')][_0xf519('0x17')]);return _0x56d2c0(_0x56ff8d[_0xf519('0x15')]['message']);}logger[_0xf519('0x15')](_0xf519('0x12'),_0x264dd9,_0x56ff8d['error']['message']);return _0x387874(_0x56ff8d[_0xf519('0x15')][_0xf519('0x17')]);}else{logger[_0xf519('0x18')](_0xf519('0x12'),_0x264dd9,_0xf519('0x13'));_0x387874(_0x56ff8d[_0xf519('0x19')]['message']);}})[_0xf519('0x1a')](function(_0x4e9621){logger[_0xf519('0x15')](_0xf519('0x12'),_0x264dd9,_0x4e9621);_0x56d2c0(_0x4e9621);});});}exports[_0xf519('0x1b')]=function(_0x248ebf){var _0x42fdc8=this;return new Promise(function(_0x2ae6cb,_0x3592f4){return db[_0xf519('0x1c')][_0xf519('0x1d')]({'raw':_0x248ebf[_0xf519('0x1e')]?_0x248ebf[_0xf519('0x1e')][_0xf519('0x1f')]===undefined?!![]:![]:!![],'where':_0x248ebf[_0xf519('0x1e')]?_0x248ebf[_0xf519('0x1e')][_0xf519('0x20')]||null:null,'attributes':_0x248ebf[_0xf519('0x1e')]?_0x248ebf['options'][_0xf519('0x21')]||null:null,'limit':_0x248ebf[_0xf519('0x1e')]?_0x248ebf[_0xf519('0x1e')][_0xf519('0x22')]||null:null,'include':_0x248ebf['options']?_0x248ebf[_0xf519('0x1e')]['include']?_['map'](_0x248ebf[_0xf519('0x1e')][_0xf519('0x23')],function(_0x4d93f9){return{'model':db[_0x4d93f9[_0xf519('0x24')]],'as':_0x4d93f9['as'],'attributes':_0x4d93f9[_0xf519('0x21')],'include':_0x4d93f9[_0xf519('0x23')]?_['map'](_0x4d93f9[_0xf519('0x23')],function(_0x2511c7){return{'model':db[_0x2511c7[_0xf519('0x24')]],'as':_0x2511c7['as'],'attributes':_0x2511c7[_0xf519('0x21')],'include':_0x2511c7['include']?_['map'](_0x2511c7[_0xf519('0x23')],function(_0x4282cd){return{'model':db[_0x4282cd['model']],'as':_0x4282cd['as'],'attributes':_0x4282cd['attributes']};}):[]};}):[]};}):[]:[]})[_0xf519('0x11')](function(_0x238cb3){logger[_0xf519('0x18')](_0xf519('0x1b'),_0x248ebf);logger[_0xf519('0x25')](_0xf519('0x1b'),_0x248ebf,JSON[_0xf519('0x14')](_0x238cb3));_0x2ae6cb(_0x238cb3);})[_0xf519('0x1a')](function(_0x1811ac){logger['error'](_0xf519('0x1b'),_0x1811ac[_0xf519('0x17')],_0x248ebf);_0x3592f4(_0x42fdc8[_0xf519('0x15')](0x1f4,_0x1811ac[_0xf519('0x17')]));});});};exports[_0xf519('0x26')]=function(_0x1277bc){var _0x5b7de1=this;return new Promise(function(_0x5a208f,_0x541631){return db[_0xf519('0x1c')][_0xf519('0x27')]({'raw':_0x1277bc['options']?_0x1277bc[_0xf519('0x1e')][_0xf519('0x1f')]===undefined?!![]:![]:!![],'where':_0x1277bc['options']?_0x1277bc[_0xf519('0x1e')][_0xf519('0x20')]||null:null,'attributes':_0x1277bc[_0xf519('0x1e')]?_0x1277bc[_0xf519('0x1e')][_0xf519('0x21')]||null:null,'include':_0x1277bc[_0xf519('0x1e')]?_0x1277bc[_0xf519('0x1e')][_0xf519('0x23')]?_[_0xf519('0x28')](_0x1277bc[_0xf519('0x1e')][_0xf519('0x23')],function(_0x963942){return{'model':db[_0x963942['model']],'as':_0x963942['as'],'attributes':_0x963942['attributes'],'include':_0x963942[_0xf519('0x23')]?_[_0xf519('0x28')](_0x963942['include'],function(_0x2ce45f){return{'model':db[_0x2ce45f[_0xf519('0x24')]],'as':_0x2ce45f['as'],'attributes':_0x2ce45f[_0xf519('0x21')],'include':_0x2ce45f[_0xf519('0x23')]?_[_0xf519('0x28')](_0x2ce45f['include'],function(_0x509936){return{'model':db[_0x509936['model']],'as':_0x509936['as'],'attributes':_0x509936[_0xf519('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf519('0x11')](function(_0xb615c1){logger['info'](_0xf519('0x26'),_0x1277bc);logger['debug'](_0xf519('0x26'),_0x1277bc,JSON[_0xf519('0x14')](_0xb615c1));_0x5a208f(_0xb615c1);})[_0xf519('0x1a')](function(_0x2df85e){logger[_0xf519('0x15')](_0xf519('0x26'),_0x2df85e[_0xf519('0x17')],_0x1277bc);_0x541631(_0x5b7de1['error'](0x1f4,_0x2df85e[_0xf519('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 7682770..f988fd7 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 _0x75ed=['./whatsappQueue.events','remove','emit','removeListener'];(function(_0x2db37a,_0x1bbc2b){var _0x3d7a43=function(_0x4bbb74){while(--_0x4bbb74){_0x2db37a['push'](_0x2db37a['shift']());}};_0x3d7a43(++_0x1bbc2b);}(_0x75ed,0xa8));var _0xd75e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x75ed[_0x501510];return _0x1e6ee5;};'use strict';var WhatsappQueueEvents=require(_0xd75e('0x0'));var events=['save',_0xd75e('0x1'),'update'];function createListener(_0x72a5e3,_0x21d1d7){return function(_0x41db9e){_0x21d1d7[_0xd75e('0x2')](_0x72a5e3,_0x41db9e);};}function removeListener(_0x17f499,_0x46eeed){return function(){WhatsappQueueEvents[_0xd75e('0x3')](_0x17f499,_0x46eeed);};}exports['register']=function(_0x3f8032){for(var _0x4107b6=0x0,_0x18b44b=events['length'];_0x4107b6<_0x18b44b;_0x4107b6++){var _0x2f1b98=events[_0x4107b6];var _0x5b220c=createListener('whatsappQueue:'+_0x2f1b98,_0x3f8032);WhatsappQueueEvents['on'](_0x2f1b98,_0x5b220c);}}; \ No newline at end of file +var _0x563f=['whatsappQueue:','save','update','emit','removeListener','length'];(function(_0x8cea57,_0x290172){var _0x25ce1d=function(_0x152c9a){while(--_0x152c9a){_0x8cea57['push'](_0x8cea57['shift']());}};_0x25ce1d(++_0x290172);}(_0x563f,0x12d));var _0xf563=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x563f[_0x5b644e];return _0x49c6bf;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xf563('0x0'),'remove',_0xf563('0x1')];function createListener(_0x301b4f,_0x261f4a){return function(_0x106cc8){_0x261f4a[_0xf563('0x2')](_0x301b4f,_0x106cc8);};}function removeListener(_0xc4c5e8,_0x57edb6){return function(){WhatsappQueueEvents[_0xf563('0x3')](_0xc4c5e8,_0x57edb6);};}exports['register']=function(_0x241fd1){for(var _0x536cfe=0x0,_0xbd815=events[_0xf563('0x4')];_0x536cfe<_0xbd815;_0x536cfe++){var _0x230325=events[_0x536cfe];var _0x5277ce=createListener(_0xf563('0x5')+_0x230325,_0x241fd1);WhatsappQueueEvents['on'](_0x230325,_0x5277ce);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index d049c6d..ba30f58 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 _0x3e3c=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id'];(function(_0x4deca4,_0x4c21ac){var _0x1950a8=function(_0x161f8c){while(--_0x161f8c){_0x4deca4['push'](_0x4deca4['shift']());}};_0x1950a8(++_0x4c21ac);}(_0x3e3c,0x1e6));var _0xc3e3=function(_0x551671,_0x2fe0a1){_0x551671=_0x551671-0x0;var _0x1a0f62=_0x3e3c[_0x551671];return _0x1a0f62;};'use strict';var multer=require(_0xc3e3('0x0'));var util=require('util');var path=require(_0xc3e3('0x1'));var timeout=require(_0xc3e3('0x2'));var express=require(_0xc3e3('0x3'));var router=express[_0xc3e3('0x4')]();var fs_extra=require(_0xc3e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc3e3('0x6'));var config=require('../../config/environment');var controller=require(_0xc3e3('0x7'));router[_0xc3e3('0x8')]('/',auth[_0xc3e3('0x9')](),controller[_0xc3e3('0xa')]);router[_0xc3e3('0x8')](_0xc3e3('0xb'),auth[_0xc3e3('0x9')](),controller[_0xc3e3('0xc')]);router['get']('/:id',auth[_0xc3e3('0x9')](),controller[_0xc3e3('0xd')]);router[_0xc3e3('0xe')]('/',auth['isAuthenticated'](),controller[_0xc3e3('0xf')]);router[_0xc3e3('0x10')](_0xc3e3('0x11'),auth[_0xc3e3('0x9')](),controller[_0xc3e3('0x12')]);router[_0xc3e3('0x13')](_0xc3e3('0x11'),auth[_0xc3e3('0x9')](),controller[_0xc3e3('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf57c=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','exports'];(function(_0x48ca20,_0x2d38cf){var _0x10e56d=function(_0x1026f4){while(--_0x1026f4){_0x48ca20['push'](_0x48ca20['shift']());}};_0x10e56d(++_0x2d38cf);}(_0xf57c,0x154));var _0xcf57=function(_0x537186,_0x2e5e54){_0x537186=_0x537186-0x0;var _0x1908c9=_0xf57c[_0x537186];return _0x1908c9;};'use strict';var multer=require(_0xcf57('0x0'));var util=require(_0xcf57('0x1'));var path=require(_0xcf57('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf57('0x3'));var router=express[_0xcf57('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcf57('0x5'));var config=require(_0xcf57('0x6'));var controller=require(_0xcf57('0x7'));router[_0xcf57('0x8')]('/',auth[_0xcf57('0x9')](),controller[_0xcf57('0xa')]);router['get'](_0xcf57('0xb'),auth[_0xcf57('0x9')](),controller[_0xcf57('0xc')]);router[_0xcf57('0x8')](_0xcf57('0xd'),auth[_0xcf57('0x9')](),controller[_0xcf57('0xe')]);router[_0xcf57('0xf')]('/',auth[_0xcf57('0x9')](),controller[_0xcf57('0x10')]);router[_0xcf57('0x11')](_0xcf57('0xd'),auth[_0xcf57('0x9')](),controller[_0xcf57('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xcf57('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index ed8d920..33fd6f2 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(_0x471fd7,_0x2b5422){var _0x2aad64=function(_0x345966){while(--_0x345966){_0x471fd7['push'](_0x471fd7['shift']());}};_0x2aad64(++_0x2b5422);}(_0x7a54,0x106));var _0x47a5=function(_0x6cfebc,_0x5a9ad6){_0x6cfebc=_0x6cfebc-0x0;var _0x377358=_0x7a54[_0x6cfebc];return _0x377358;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5aa72f,_0x48f0d3){var _0x589c1e=function(_0x2ba7f5){while(--_0x2ba7f5){_0x5aa72f['push'](_0x5aa72f['shift']());}};_0x589c1e(++_0x48f0d3);}(_0x7a54,0x106));var _0x47a5=function(_0x1e9db6,_0xc1a389){_0x1e9db6=_0x1e9db6-0x0;var _0x59d375=_0x7a54[_0x1e9db6];return _0x59d375;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 78674d3..d2b251f 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 _0xed3c=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x90a6e9,_0x1df316){var _0x47c0c6=function(_0x64de27){while(--_0x64de27){_0x90a6e9['push'](_0x90a6e9['shift']());}};_0x47c0c6(++_0x1df316);}(_0xed3c,0x1a6));var _0xced3=function(_0x12cbd8,_0x8ef0ce){_0x12cbd8=_0x12cbd8-0x0;var _0x2fb1ab=_0xed3c[_0x12cbd8];return _0x2fb1ab;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){_0x559fa2['status'](0xcc)[_0xced3('0x23')]();});}};}function handleEntityNotFound(_0x23f92b,_0x4fc285){return function(_0x3fb4f9){if(!_0x3fb4f9){_0x23f92b['sendStatus'](0x194);}return _0x3fb4f9;};}function handleError(_0x1dcc52,_0x4123ba){_0x4123ba=_0x4123ba||0x1f4;return function(_0x3b728d){logger[_0xced3('0x24')](_0x3b728d[_0xced3('0x25')]);if(_0x3b728d['name']){delete _0x3b728d['name'];}_0x1dcc52[_0xced3('0x17')](_0x4123ba)['send'](_0x3b728d);};}exports[_0xced3('0x26')]=function(_0x1e6923,_0x4a8e85){var _0x3db664={},_0x4024fa={},_0x196956={'count':0x0,'rows':[]};var _0x1032d6=_[_0xced3('0x27')](db[_0xced3('0x28')][_0xced3('0x29')],function(_0x41d003){return{'name':_0x41d003[_0xced3('0x2a')],'type':_0x41d003['type'][_0xced3('0x2b')]};});_0x4024fa[_0xced3('0x2c')]=_[_0xced3('0x27')](_0x1032d6,_0xced3('0x2d'));_0x4024fa[_0xced3('0x2e')]=_[_0xced3('0x2f')](_0x1e6923[_0xced3('0x2e')]);_0x4024fa[_0xced3('0x30')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],_0x4024fa[_0xced3('0x2e')]);_0x3db664[_0xced3('0x32')]=_[_0xced3('0x31')](_0x4024fa[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x33')]));_0x3db664[_0xced3('0x32')]=_0x3db664[_0xced3('0x32')][_0xced3('0x34')]?_0x3db664[_0xced3('0x32')]:_0x4024fa['model'];if(!_0x1e6923[_0xced3('0x2e')]['hasOwnProperty'](_0xced3('0x35'))){_0x3db664[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1a')]);_0x3db664[_0xced3('0x1c')]=qs[_0xced3('0x1c')](_0x1e6923[_0xced3('0x2e')][_0xced3('0x1c')]);}_0x3db664[_0xced3('0x36')]=qs['sort'](_0x1e6923[_0xced3('0x2e')][_0xced3('0x37')]);_0x3db664['where']=qs[_0xced3('0x30')](_[_0xced3('0x38')](_0x1e6923[_0xced3('0x2e')],_0x4024fa['filters']),_0x1032d6);if(_0x1e6923['query'][_0xced3('0x39')]){_0x3db664['where']=_[_0xced3('0x3a')](_0x3db664[_0xced3('0x3b')],{'$or':_['map'](_0x1032d6,function(_0x180b65){if(_0x180b65[_0xced3('0x3c')]!==_0xced3('0x3d')){var _0x58b344={};_0x58b344[_0x180b65[_0xced3('0x2d')]]={'$like':'%'+_0x1e6923['query']['filter']+'%'};return _0x58b344;}})});}_0x3db664=_[_0xced3('0x3a')]({},_0x3db664,_0x1e6923[_0xced3('0x3e')]);var _0x217bff={'where':_0x3db664['where']};return db[_0xced3('0x28')][_0xced3('0x1b')](_0x217bff)[_0xced3('0x21')](function(_0x28626b){_0x196956[_0xced3('0x1b')]=_0x28626b;if(_0x1e6923[_0xced3('0x2e')][_0xced3('0x3f')]){_0x3db664[_0xced3('0x40')]=[{'all':!![]}];}return db[_0xced3('0x28')][_0xced3('0x41')](_0x3db664);})[_0xced3('0x21')](function(_0x38855f){_0x196956[_0xced3('0x42')]=_0x38855f;return _0x196956;})[_0xced3('0x21')](respondWithFilteredResult(_0x4a8e85,_0x3db664))[_0xced3('0x43')](handleError(_0x4a8e85,null));};exports['show']=function(_0x4279a3,_0x2ec0ad){var _0x44ff72={'raw':!![],'where':{'id':_0x4279a3[_0xced3('0x44')]['id']}},_0x1a6c1f={};_0x1a6c1f[_0xced3('0x2c')]=_[_0xced3('0x2f')](db[_0xced3('0x28')][_0xced3('0x29')]);_0x1a6c1f['query']=_[_0xced3('0x2f')](_0x4279a3['query']);_0x1a6c1f[_0xced3('0x30')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],_0x1a6c1f['query']);_0x44ff72[_0xced3('0x32')]=_[_0xced3('0x31')](_0x1a6c1f[_0xced3('0x2c')],qs[_0xced3('0x33')](_0x4279a3['query'][_0xced3('0x33')]));_0x44ff72[_0xced3('0x32')]=_0x44ff72[_0xced3('0x32')][_0xced3('0x34')]?_0x44ff72[_0xced3('0x32')]:_0x1a6c1f['model'];if(_0x4279a3[_0xced3('0x2e')][_0xced3('0x3f')]){_0x44ff72[_0xced3('0x40')]=[{'all':!![]}];}_0x44ff72=_[_0xced3('0x3a')]({},_0x44ff72,_0x4279a3[_0xced3('0x3e')]);return db[_0xced3('0x28')][_0xced3('0x45')](_0x44ff72)['then'](handleEntityNotFound(_0x2ec0ad,null))[_0xced3('0x21')](respondWithResult(_0x2ec0ad,null))[_0xced3('0x43')](handleError(_0x2ec0ad,null));};exports['create']=function(_0x569c3d,_0x140df2){return db['WhatsappQueueReport'][_0xced3('0x46')](_0x569c3d[_0xced3('0x47')],{})[_0xced3('0x21')](respondWithResult(_0x140df2,0xc9))[_0xced3('0x43')](handleError(_0x140df2,null));};exports[_0xced3('0x20')]=function(_0x1b3396,_0x3700ed){if(_0x1b3396[_0xced3('0x47')]['id']){delete _0x1b3396[_0xced3('0x47')]['id'];}return db['WhatsappQueueReport'][_0xced3('0x45')]({'where':{'id':_0x1b3396[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x3700ed,null))[_0xced3('0x21')](saveUpdates(_0x1b3396[_0xced3('0x47')],null))[_0xced3('0x21')](respondWithResult(_0x3700ed,null))['catch'](handleError(_0x3700ed,null));};exports[_0xced3('0x22')]=function(_0x629ecf,_0x74f70){return db[_0xced3('0x28')][_0xced3('0x45')]({'where':{'id':_0x629ecf[_0xced3('0x44')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x74f70,null))[_0xced3('0x21')](removeEntity(_0x74f70,null))[_0xced3('0x43')](handleError(_0x74f70,null));};exports[_0xced3('0x48')]=function(_0x257ff0,_0x3e2a19){return db['WhatsappQueueReport'][_0xced3('0x48')]()['then'](respondWithResult(_0x3e2a19,null))[_0xced3('0x43')](handleError(_0x3e2a19,null));}; \ No newline at end of file +var _0x3f8c=['end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xf5a51e,_0x14a189){var _0x5035da=function(_0x144185){while(--_0x144185){_0xf5a51e['push'](_0xf5a51e['shift']());}};_0x5035da(++_0x14a189);}(_0x3f8c,0x104));var _0xc3f8=function(_0x2f278c,_0x437f85){_0x2f278c=_0x2f278c-0x0;var _0x30e22f=_0x3f8c[_0x2f278c];return _0x30e22f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569c2,_0x327b2d){return function(_0x2d237e){if(!_0x2d237e){_0x4569c2[_0xc3f8('0x16')](0x194);}return _0x2d237e;};}function handleError(_0x25088f,_0x9d43b4){_0x9d43b4=_0x9d43b4||0x1f4;return function(_0xf1d460){logger[_0xc3f8('0x22')](_0xf1d460[_0xc3f8('0x23')]);if(_0xf1d460[_0xc3f8('0x24')]){delete _0xf1d460[_0xc3f8('0x24')];}_0x25088f[_0xc3f8('0x17')](_0x9d43b4)[_0xc3f8('0x25')](_0xf1d460);};}exports[_0xc3f8('0x26')]=function(_0x59e4dd,_0x58b303){var _0x2909f8={},_0x218029={},_0x5bf6e2={'count':0x0,'rows':[]};var _0x151bba=_['map'](db[_0xc3f8('0x27')][_0xc3f8('0x28')],function(_0x47ab53){return{'name':_0x47ab53['fieldName'],'type':_0x47ab53[_0xc3f8('0x29')][_0xc3f8('0x2a')]};});_0x218029[_0xc3f8('0x2b')]=_[_0xc3f8('0x2c')](_0x151bba,_0xc3f8('0x24'));_0x218029[_0xc3f8('0x2d')]=_[_0xc3f8('0x2e')](_0x59e4dd[_0xc3f8('0x2d')]);_0x218029[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x218029['model'],_0x218029[_0xc3f8('0x2d')]);_0x2909f8[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x218029[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x59e4dd['query']['fields']));_0x2909f8[_0xc3f8('0x31')]=_0x2909f8[_0xc3f8('0x31')][_0xc3f8('0x33')]?_0x2909f8[_0xc3f8('0x31')]:_0x218029[_0xc3f8('0x2b')];if(!_0x59e4dd['query'][_0xc3f8('0x34')](_0xc3f8('0x35'))){_0x2909f8[_0xc3f8('0x1b')]=qs['limit'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1b')]);_0x2909f8[_0xc3f8('0x1a')]=qs['offset'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1a')]);}_0x2909f8['order']=qs[_0xc3f8('0x36')](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x36')]);_0x2909f8[_0xc3f8('0x37')]=qs[_0xc3f8('0x2f')](_[_0xc3f8('0x38')](_0x59e4dd['query'],_0x218029[_0xc3f8('0x2f')]),_0x151bba);if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]){_0x2909f8[_0xc3f8('0x37')]=_[_0xc3f8('0x3a')](_0x2909f8['where'],{'$or':_[_0xc3f8('0x2c')](_0x151bba,function(_0x4451a2){if(_0x4451a2[_0xc3f8('0x29')]!=='VIRTUAL'){var _0x316643={};_0x316643[_0x4451a2[_0xc3f8('0x24')]]={'$like':'%'+_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]+'%'};return _0x316643;}})});}_0x2909f8=_['merge']({},_0x2909f8,_0x59e4dd[_0xc3f8('0x3b')]);var _0x45d416={'where':_0x2909f8[_0xc3f8('0x37')]};return db[_0xc3f8('0x27')]['count'](_0x45d416)[_0xc3f8('0x21')](function(_0x5db44d){_0x5bf6e2['count']=_0x5db44d;if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x3c')]){_0x2909f8[_0xc3f8('0x3d')]=[{'all':!![]}];}return db[_0xc3f8('0x27')]['findAll'](_0x2909f8);})['then'](function(_0x361a85){_0x5bf6e2[_0xc3f8('0x3e')]=_0x361a85;return _0x5bf6e2;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x58b303,_0x2909f8))[_0xc3f8('0x3f')](handleError(_0x58b303,null));};exports[_0xc3f8('0x40')]=function(_0x465547,_0x3113b4){var _0x45e6ea={'raw':!![],'where':{'id':_0x465547[_0xc3f8('0x41')]['id']}},_0x13d8dc={};_0x13d8dc[_0xc3f8('0x2b')]=_['keys'](db[_0xc3f8('0x27')][_0xc3f8('0x28')]);_0x13d8dc['query']=_[_0xc3f8('0x2e')](_0x465547[_0xc3f8('0x2d')]);_0x13d8dc['filters']=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],_0x13d8dc[_0xc3f8('0x2d')]);_0x45e6ea[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x465547[_0xc3f8('0x2d')][_0xc3f8('0x32')]));_0x45e6ea[_0xc3f8('0x31')]=_0x45e6ea[_0xc3f8('0x31')]['length']?_0x45e6ea[_0xc3f8('0x31')]:_0x13d8dc[_0xc3f8('0x2b')];if(_0x465547['query'][_0xc3f8('0x3c')]){_0x45e6ea[_0xc3f8('0x3d')]=[{'all':!![]}];}_0x45e6ea=_[_0xc3f8('0x3a')]({},_0x45e6ea,_0x465547[_0xc3f8('0x3b')]);return db['WhatsappQueueReport']['find'](_0x45e6ea)[_0xc3f8('0x21')](handleEntityNotFound(_0x3113b4,null))[_0xc3f8('0x21')](respondWithResult(_0x3113b4,null))[_0xc3f8('0x3f')](handleError(_0x3113b4,null));};exports['create']=function(_0x1b5777,_0x3a665e){return db[_0xc3f8('0x27')][_0xc3f8('0x42')](_0x1b5777[_0xc3f8('0x43')],{})['then'](respondWithResult(_0x3a665e,0xc9))[_0xc3f8('0x3f')](handleError(_0x3a665e,null));};exports[_0xc3f8('0x20')]=function(_0x5961ab,_0x1becae){if(_0x5961ab[_0xc3f8('0x43')]['id']){delete _0x5961ab[_0xc3f8('0x43')]['id'];}return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x5961ab[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1becae,null))['then'](saveUpdates(_0x5961ab[_0xc3f8('0x43')],null))[_0xc3f8('0x21')](respondWithResult(_0x1becae,null))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x45')]=function(_0x2e9f93,_0x2448bf){return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x2e9f93[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x2448bf,null))['then'](removeEntity(_0x2448bf,null))[_0xc3f8('0x3f')](handleError(_0x2448bf,null));};exports[_0xc3f8('0x46')]=function(_0x425fee,_0x267c95){return db[_0xc3f8('0x27')][_0xc3f8('0x46')]()[_0xc3f8('0x21')](respondWithResult(_0x267c95,null))[_0xc3f8('0x3f')](handleError(_0x267c95,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a978814..7e67f21 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 _0x2f39=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport'];(function(_0x56b4b0,_0x4c8f7b){var _0x4b04cc=function(_0x21eb86){while(--_0x21eb86){_0x56b4b0['push'](_0x56b4b0['shift']());}};_0x4b04cc(++_0x4c8f7b);}(_0x2f39,0x157));var _0x92f3=function(_0xea6018,_0x4cf082){_0xea6018=_0xea6018-0x0;var _0x57b54d=_0x2f39[_0xea6018];return _0x57b54d;};'use strict';var _=require(_0x92f3('0x0'));var util=require(_0x92f3('0x1'));var logger=require(_0x92f3('0x2'))('api');var moment=require(_0x92f3('0x3'));var BPromise=require(_0x92f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x92f3('0x5'));module[_0x92f3('0x6')]=function(_0x421885,_0x481bc8){return _0x421885[_0x92f3('0x7')](_0x92f3('0x8'),attributes,{'tableName':_0x92f3('0x9'),'paranoid':![],'indexes':[{'name':_0x92f3('0xa'),'fields':[_0x92f3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6647=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0x6647,0x126));var _0x7664=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6647[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7664('0x0'));var logger=require(_0x7664('0x1'))(_0x7664('0x2'));var moment=require(_0x7664('0x3'));var BPromise=require(_0x7664('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7664('0x5'));var rimraf=require(_0x7664('0x6'));var config=require(_0x7664('0x7'));var attributes=require(_0x7664('0x8'));module[_0x7664('0x9')]=function(_0x6d814c,_0x357a49){return _0x6d814c['define'](_0x7664('0xa'),attributes,{'tableName':_0x7664('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7664('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 6a05c8a..ac81afb 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 _0x80cb=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','raw','update','options','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x327f3c,_0x46981a){var _0x2d85f3=function(_0x487da0){while(--_0x487da0){_0x327f3c['push'](_0x327f3c['shift']());}};_0x2d85f3(++_0x46981a);}(_0x80cb,0xf9));var _0xb80c=function(_0x2e3ef6,_0x7d3c9a){_0x2e3ef6=_0x2e3ef6-0x0;var _0x4780b5=_0x80cb[_0x2e3ef6];return _0x4780b5;};'use strict';var _=require(_0xb80c('0x0'));var util=require(_0xb80c('0x1'));var moment=require(_0xb80c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb80c('0x3'));var db=require(_0xb80c('0x4'))['db'];var utils=require(_0xb80c('0x5'));var logger=require('../../config/logger')(_0xb80c('0x6'));var config=require(_0xb80c('0x7'));var jayson=require(_0xb80c('0x8'));var client=jayson[_0xb80c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x355226,_0x36c573,_0x1e727f){return new BPromise(function(_0x421eed,_0x420526){return client[_0xb80c('0xa')](_0x355226,_0x1e727f)[_0xb80c('0xb')](function(_0x4b169e){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x36c573,_0xb80c('0xc'));logger[_0xb80c('0xd')](_0xb80c('0xe'),_0x36c573,'request\x20sent',JSON[_0xb80c('0xf')](_0x4b169e));if(_0x4b169e[_0xb80c('0x10')]){if(_0x4b169e[_0xb80c('0x10')]['code']===0x1f4){logger[_0xb80c('0x10')](_0xb80c('0x11'),_0x36c573,_0x4b169e[_0xb80c('0x10')]['message']);return _0x420526(_0x4b169e[_0xb80c('0x10')][_0xb80c('0x12')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x36c573,_0x4b169e['error'][_0xb80c('0x12')]);return _0x421eed(_0x4b169e[_0xb80c('0x10')][_0xb80c('0x12')]);}else{logger[_0xb80c('0x13')](_0xb80c('0x11'),_0x36c573,_0xb80c('0xc'));_0x421eed(_0x4b169e[_0xb80c('0x14')][_0xb80c('0x12')]);}})[_0xb80c('0x15')](function(_0x4f6f6c){logger[_0xb80c('0x10')](_0xb80c('0x11'),_0x36c573,_0x4f6f6c);_0x420526(_0x4f6f6c);});});}exports[_0xb80c('0x16')]=function(_0x333758){var _0x10a803=this;return new Promise(function(_0x499669,_0x1f49aa){return db[_0xb80c('0x17')][_0xb80c('0x18')](_0x333758[_0xb80c('0x19')],{'raw':_0x333758['options']?_0x333758['options'][_0xb80c('0x1a')]===undefined?!![]:![]:!![]})[_0xb80c('0xb')](function(_0x97cad7){logger[_0xb80c('0x13')]('CreateWhatsappQueueReport',_0x333758);logger['debug'](_0xb80c('0x16'),_0x333758,JSON[_0xb80c('0xf')](_0x97cad7));_0x499669(_0x97cad7);})[_0xb80c('0x15')](function(_0x293bc9){logger[_0xb80c('0x10')]('CreateWhatsappQueueReport',_0x293bc9[_0xb80c('0x12')],_0x333758);_0x1f49aa(_0x10a803['error'](0x1f4,_0x293bc9[_0xb80c('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x267d9c){var _0x2cf1d2=this;return new Promise(function(_0x4d5113,_0x263209){return db[_0xb80c('0x17')][_0xb80c('0x1b')](_0x267d9c[_0xb80c('0x19')],{'raw':_0x267d9c[_0xb80c('0x1c')]?_0x267d9c['options'][_0xb80c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267d9c[_0xb80c('0x1c')]?_0x267d9c['options']['where']||null:null,'attributes':_0x267d9c[_0xb80c('0x1c')]?_0x267d9c[_0xb80c('0x1c')][_0xb80c('0x1d')]||null:null,'limit':_0x267d9c[_0xb80c('0x1c')]?_0x267d9c[_0xb80c('0x1c')][_0xb80c('0x1e')]||null:null})[_0xb80c('0xb')](function(_0x5aad31){logger[_0xb80c('0x13')](_0xb80c('0x1f'),_0x267d9c);logger['debug'](_0xb80c('0x1f'),_0x267d9c,JSON[_0xb80c('0xf')](_0x5aad31));_0x4d5113(_0x5aad31);})['catch'](function(_0x3f9623){logger[_0xb80c('0x10')]('UpdateWhatsappQueueReport',_0x3f9623[_0xb80c('0x12')],_0x267d9c);_0x263209(_0x2cf1d2[_0xb80c('0x10')](0x1f4,_0x3f9623[_0xb80c('0x12')]));});});}; \ No newline at end of file +var _0x3fd9=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport','body','options','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','raw','where','attributes','util'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0x3fd9,0x173));var _0x93fd=function(_0x13beea,_0x526573){_0x13beea=_0x13beea-0x0;var _0x37335f=_0x3fd9[_0x13beea];return _0x37335f;};'use strict';var _=require('lodash');var util=require(_0x93fd('0x0'));var moment=require(_0x93fd('0x1'));var BPromise=require('bluebird');var rs=require(_0x93fd('0x2'));var fs=require('fs');var Redis=require(_0x93fd('0x3'));var db=require(_0x93fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x93fd('0x5'))(_0x93fd('0x6'));var config=require(_0x93fd('0x7'));var jayson=require(_0x93fd('0x8'));var client=jayson[_0x93fd('0x9')][_0x93fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4789c2,_0x1d531f,_0x5984b7){return new BPromise(function(_0x2f86f2,_0x35fc82){return client['request'](_0x4789c2,_0x5984b7)[_0x93fd('0xb')](function(_0x5a6dcf){logger[_0x93fd('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1d531f,'request\x20sent');logger[_0x93fd('0xd')](_0x93fd('0xe'),_0x1d531f,'request\x20sent',JSON[_0x93fd('0xf')](_0x5a6dcf));if(_0x5a6dcf[_0x93fd('0x10')]){if(_0x5a6dcf['error'][_0x93fd('0x11')]===0x1f4){logger[_0x93fd('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1d531f,_0x5a6dcf[_0x93fd('0x10')]['message']);return _0x35fc82(_0x5a6dcf[_0x93fd('0x10')]['message']);}logger[_0x93fd('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1d531f,_0x5a6dcf[_0x93fd('0x10')][_0x93fd('0x12')]);return _0x2f86f2(_0x5a6dcf['error'][_0x93fd('0x12')]);}else{logger['info'](_0x93fd('0x13'),_0x1d531f,_0x93fd('0x14'));_0x2f86f2(_0x5a6dcf['result']['message']);}})['catch'](function(_0x28c4ed){logger[_0x93fd('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1d531f,_0x28c4ed);_0x35fc82(_0x28c4ed);});});}exports['CreateWhatsappQueueReport']=function(_0x1f8f54){var _0x19cfa1=this;return new Promise(function(_0x49efb0,_0x2a2bc6){return db[_0x93fd('0x15')]['create'](_0x1f8f54[_0x93fd('0x16')],{'raw':_0x1f8f54[_0x93fd('0x17')]?_0x1f8f54[_0x93fd('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x93fd('0xb')](function(_0x5c40fb){logger[_0x93fd('0xc')](_0x93fd('0x18'),_0x1f8f54);logger['debug'](_0x93fd('0x18'),_0x1f8f54,JSON[_0x93fd('0xf')](_0x5c40fb));_0x49efb0(_0x5c40fb);})[_0x93fd('0x19')](function(_0x685342){logger[_0x93fd('0x10')]('CreateWhatsappQueueReport',_0x685342[_0x93fd('0x12')],_0x1f8f54);_0x2a2bc6(_0x19cfa1[_0x93fd('0x10')](0x1f4,_0x685342[_0x93fd('0x12')]));});});};exports[_0x93fd('0x1a')]=function(_0x134c5d){var _0x14b977=this;return new Promise(function(_0x1006b2,_0x4182dd){return db[_0x93fd('0x15')][_0x93fd('0x1b')](_0x134c5d[_0x93fd('0x16')],{'raw':_0x134c5d[_0x93fd('0x17')]?_0x134c5d[_0x93fd('0x17')][_0x93fd('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x134c5d['options']?_0x134c5d['options'][_0x93fd('0x1d')]||null:null,'attributes':_0x134c5d[_0x93fd('0x17')]?_0x134c5d['options'][_0x93fd('0x1e')]||null:null,'limit':_0x134c5d[_0x93fd('0x17')]?_0x134c5d[_0x93fd('0x17')]['limit']||null:null})[_0x93fd('0xb')](function(_0x34c677){logger[_0x93fd('0xc')]('UpdateWhatsappQueueReport',_0x134c5d);logger[_0x93fd('0xd')]('UpdateWhatsappQueueReport',_0x134c5d,JSON[_0x93fd('0xf')](_0x34c677));_0x1006b2(_0x34c677);})['catch'](function(_0x323cf6){logger[_0x93fd('0x10')](_0x93fd('0x1a'),_0x323cf6[_0x93fd('0x12')],_0x134c5d);_0x4182dd(_0x14b977[_0x93fd('0x10')](0x1f4,_0x323cf6[_0x93fd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f11d86d..4c2f69f 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 _0xffdd=['/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xffdd,0xf2));var _0xdffd=function(_0x258e1d,_0x511ad5){_0x258e1d=_0x258e1d-0x0;var _0x515006=_0xffdd[_0x258e1d];return _0x515006;};'use strict';var multer=require(_0xdffd('0x0'));var util=require(_0xdffd('0x1'));var path=require('path');var timeout=require(_0xdffd('0x2'));var express=require('express');var router=express[_0xdffd('0x3')]();var fs_extra=require(_0xdffd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdffd('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0xdffd('0x6')]('/',auth[_0xdffd('0x7')](),controller['index']);router[_0xdffd('0x6')](_0xdffd('0x8'),auth['isAuthenticated'](),controller[_0xdffd('0x9')]);router[_0xdffd('0x6')](_0xdffd('0xa'),auth['isAuthenticated'](),controller[_0xdffd('0xb')]);router[_0xdffd('0xc')]('/',auth[_0xdffd('0x7')](),controller[_0xdffd('0xd')]);router[_0xdffd('0xe')]('/:id',auth[_0xdffd('0x7')](),controller[_0xdffd('0xf')]);router[_0xdffd('0x10')]('/:id',auth[_0xdffd('0x7')](),controller[_0xdffd('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd61b=['describe','/:id','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xd61b,0xdf));var _0xbd61=function(_0x21ae22,_0x54911f){_0x21ae22=_0x21ae22-0x0;var _0x1e610a=_0xd61b[_0x21ae22];return _0x1e610a;};'use strict';var multer=require(_0xbd61('0x0'));var util=require('util');var path=require(_0xbd61('0x1'));var timeout=require(_0xbd61('0x2'));var express=require('express');var router=express[_0xbd61('0x3')]();var fs_extra=require(_0xbd61('0x4'));var auth=require(_0xbd61('0x5'));var interaction=require(_0xbd61('0x6'));var config=require(_0xbd61('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xbd61('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd61('0x9')]);router[_0xbd61('0x8')]('/describe',auth[_0xbd61('0xa')](),controller[_0xbd61('0xb')]);router[_0xbd61('0x8')](_0xbd61('0xc'),auth[_0xbd61('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbd61('0xd')]);router['put'](_0xbd61('0xc'),auth[_0xbd61('0xa')](),controller[_0xbd61('0xe')]);router[_0xbd61('0xf')](_0xbd61('0xc'),auth[_0xbd61('0xa')](),controller[_0xbd61('0x10')]);module[_0xbd61('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 59d61dc..b6f7988 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 _0xc3ed=['sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x316881,_0x228056){var _0x526fff=function(_0x381247){while(--_0x381247){_0x316881['push'](_0x316881['shift']());}};_0x526fff(++_0x228056);}(_0xc3ed,0x111));var _0xdc3e=function(_0x50df1f,_0x45b8b1){_0x50df1f=_0x50df1f-0x0;var _0x5180e3=_0xc3ed[_0x50df1f];return _0x5180e3;};'use strict';var Sequelize=require(_0xdc3e('0x0'));module[_0xdc3e('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xdc3e('0x2')](_0xdc3e('0x3'),_0xdc3e('0x4'),_0xdc3e('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdc3e('0x6')]}}; \ No newline at end of file +var _0xfbe2=['STRING','ENUM','agent','queue','DATE','sequelize','exports'];(function(_0x2a7761,_0x5598ce){var _0x5760c8=function(_0x4e94cb){while(--_0x4e94cb){_0x2a7761['push'](_0x2a7761['shift']());}};_0x5760c8(++_0x5598ce);}(_0xfbe2,0x1da));var _0x2fbe=function(_0x5c51cc,_0x37d5b0){_0x5c51cc=_0x5c51cc-0x0;var _0x1833bb=_0xfbe2[_0x5c51cc];return _0x1833bb;};'use strict';var Sequelize=require(_0x2fbe('0x0'));module[_0x2fbe('0x1')]={'uniqueid':{'type':Sequelize[_0x2fbe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2fbe('0x3')]('account',_0x2fbe('0x4'),_0x2fbe('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2fbe('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 5330238..b1b2ab5 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 _0x51c5=['Content-Range','json','apply','reject','update','then','destroy','error','stack','send','index','map','WhatsappTransferReport','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','find','create','body','catch','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set'];(function(_0xb8e8c,_0x49cd74){var _0x388760=function(_0x3278c6){while(--_0x3278c6){_0xb8e8c['push'](_0xb8e8c['shift']());}};_0x388760(++_0x49cd74);}(_0x51c5,0xc8));var _0x551c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x51c5[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x551c('0x0'));var jsonpatch=require(_0x551c('0x1'));var rp=require(_0x551c('0x2'));var moment=require(_0x551c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x551c('0x4'));var util=require(_0x551c('0x5'));var path=require(_0x551c('0x6'));var sox=require(_0x551c('0x7'));var csv=require(_0x551c('0x8'));var ejs=require(_0x551c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x551c('0xa'));var squel=require(_0x551c('0xb'));var crypto=require(_0x551c('0xc'));var jsforce=require(_0x551c('0xd'));var deskjs=require(_0x551c('0xe'));var toCsv=require(_0x551c('0x8'));var querystring=require(_0x551c('0xf'));var Papa=require(_0x551c('0x10'));var Redis=require(_0x551c('0x11'));var authService=require(_0x551c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x551c('0x13'));var logger=require('../../config/logger')(_0x551c('0x14'));var utils=require(_0x551c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x551c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcd80b2,_0x3db0d9){_0x3db0d9=_0x3db0d9||0xcc;return function(_0x32fa3d){if(_0x32fa3d){return _0xcd80b2[_0x551c('0x17')](_0x3db0d9);}return _0xcd80b2[_0x551c('0x18')](_0x3db0d9)[_0x551c('0x19')]();};}function respondWithResult(_0x1c3c83,_0x569557){_0x569557=_0x569557||0xc8;return function(_0x2587a3){if(_0x2587a3){return _0x1c3c83[_0x551c('0x18')](_0x569557)['json'](_0x2587a3);}};}function respondWithFilteredResult(_0x5db2ea,_0x19713e){return function(_0xedf795){if(_0xedf795){var _0x1af11e=typeof _0x19713e['offset']===_0x551c('0x1a')&&typeof _0x19713e[_0x551c('0x1b')]===_0x551c('0x1a');var _0x532dca=_0xedf795[_0x551c('0x1c')];var _0x29d639=_0x1af11e?0x0:_0x19713e['offset'];var _0x34e284=_0x1af11e?_0xedf795['count']:_0x19713e[_0x551c('0x1d')]+_0x19713e[_0x551c('0x1b')];var _0x16c4d7;if(_0x34e284>=_0x532dca){_0x34e284=_0x532dca;_0x16c4d7=0xc8;}else{_0x16c4d7=0xce;}_0x5db2ea['status'](_0x16c4d7);return _0x5db2ea[_0x551c('0x1e')](_0x551c('0x1f'),_0x29d639+'-'+_0x34e284+'/'+_0x532dca)[_0x551c('0x20')](_0xedf795);}return null;};}function patchUpdates(_0x1fff90){return function(_0x5b7d3b){try{jsonpatch[_0x551c('0x21')](_0x5b7d3b,_0x1fff90,!![]);}catch(_0x1a9916){return BPromise[_0x551c('0x22')](_0x1a9916);}return _0x5b7d3b['save']();};}function saveUpdates(_0x3a9a45,_0x10e611){return function(_0x4613e0){if(_0x4613e0){return _0x4613e0[_0x551c('0x23')](_0x3a9a45)[_0x551c('0x24')](function(_0x4f7398){return _0x4f7398;});}return null;};}function removeEntity(_0x1e664e,_0x520220){return function(_0x24b561){if(_0x24b561){return _0x24b561[_0x551c('0x25')]()['then'](function(){_0x1e664e['status'](0xcc)[_0x551c('0x19')]();});}};}function handleEntityNotFound(_0x23db19,_0x2cc0a6){return function(_0xc101){if(!_0xc101){_0x23db19[_0x551c('0x17')](0x194);}return _0xc101;};}function handleError(_0x2e4110,_0xeb9dce){_0xeb9dce=_0xeb9dce||0x1f4;return function(_0xdefd66){logger[_0x551c('0x26')](_0xdefd66[_0x551c('0x27')]);if(_0xdefd66['name']){delete _0xdefd66['name'];}_0x2e4110[_0x551c('0x18')](_0xeb9dce)[_0x551c('0x28')](_0xdefd66);};}exports[_0x551c('0x29')]=function(_0x37db6c,_0x37b5fa){var _0x20dc09={},_0x6d940b={},_0x1ca9d0={'count':0x0,'rows':[]};var _0x2290bd=_[_0x551c('0x2a')](db[_0x551c('0x2b')]['rawAttributes'],function(_0x40fc65){return{'name':_0x40fc65[_0x551c('0x2c')],'type':_0x40fc65[_0x551c('0x2d')][_0x551c('0x2e')]};});_0x6d940b[_0x551c('0x2f')]=_[_0x551c('0x2a')](_0x2290bd,_0x551c('0x30'));_0x6d940b[_0x551c('0x31')]=_['keys'](_0x37db6c[_0x551c('0x31')]);_0x6d940b[_0x551c('0x32')]=_[_0x551c('0x33')](_0x6d940b['model'],_0x6d940b[_0x551c('0x31')]);_0x20dc09[_0x551c('0x34')]=_[_0x551c('0x33')](_0x6d940b[_0x551c('0x2f')],qs[_0x551c('0x35')](_0x37db6c[_0x551c('0x31')][_0x551c('0x35')]));_0x20dc09[_0x551c('0x34')]=_0x20dc09[_0x551c('0x34')][_0x551c('0x36')]?_0x20dc09['attributes']:_0x6d940b[_0x551c('0x2f')];if(!_0x37db6c[_0x551c('0x31')][_0x551c('0x37')](_0x551c('0x38'))){_0x20dc09[_0x551c('0x1b')]=qs['limit'](_0x37db6c[_0x551c('0x31')][_0x551c('0x1b')]);_0x20dc09[_0x551c('0x1d')]=qs['offset'](_0x37db6c[_0x551c('0x31')][_0x551c('0x1d')]);}_0x20dc09[_0x551c('0x39')]=qs[_0x551c('0x3a')](_0x37db6c[_0x551c('0x31')]['sort']);_0x20dc09[_0x551c('0x3b')]=qs[_0x551c('0x32')](_['pick'](_0x37db6c['query'],_0x6d940b[_0x551c('0x32')]),_0x2290bd);if(_0x37db6c[_0x551c('0x31')][_0x551c('0x3c')]){_0x20dc09[_0x551c('0x3b')]=_[_0x551c('0x3d')](_0x20dc09[_0x551c('0x3b')],{'$or':_['map'](_0x2290bd,function(_0x1e7945){if(_0x1e7945['type']!==_0x551c('0x3e')){var _0x2fabe8={};_0x2fabe8[_0x1e7945[_0x551c('0x30')]]={'$like':'%'+_0x37db6c[_0x551c('0x31')][_0x551c('0x3c')]+'%'};return _0x2fabe8;}})});}_0x20dc09=_['merge']({},_0x20dc09,_0x37db6c['options']);var _0xcb0e12={'where':_0x20dc09[_0x551c('0x3b')]};return db[_0x551c('0x2b')][_0x551c('0x1c')](_0xcb0e12)['then'](function(_0x2212c2){_0x1ca9d0[_0x551c('0x1c')]=_0x2212c2;if(_0x37db6c[_0x551c('0x31')][_0x551c('0x3f')]){_0x20dc09[_0x551c('0x40')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x551c('0x41')](_0x20dc09);})[_0x551c('0x24')](function(_0x5c66eb){_0x1ca9d0[_0x551c('0x42')]=_0x5c66eb;return _0x1ca9d0;})[_0x551c('0x24')](respondWithFilteredResult(_0x37b5fa,_0x20dc09))['catch'](handleError(_0x37b5fa,null));};exports[_0x551c('0x43')]=function(_0x3fd39a,_0x3a0ecf){var _0x527b66={'raw':!![],'where':{'id':_0x3fd39a[_0x551c('0x44')]['id']}},_0x47d0ff={};_0x47d0ff['model']=_[_0x551c('0x45')](db['WhatsappTransferReport'][_0x551c('0x46')]);_0x47d0ff['query']=_[_0x551c('0x45')](_0x3fd39a[_0x551c('0x31')]);_0x47d0ff['filters']=_[_0x551c('0x33')](_0x47d0ff[_0x551c('0x2f')],_0x47d0ff[_0x551c('0x31')]);_0x527b66[_0x551c('0x34')]=_['intersection'](_0x47d0ff[_0x551c('0x2f')],qs[_0x551c('0x35')](_0x3fd39a[_0x551c('0x31')][_0x551c('0x35')]));_0x527b66[_0x551c('0x34')]=_0x527b66[_0x551c('0x34')][_0x551c('0x36')]?_0x527b66[_0x551c('0x34')]:_0x47d0ff['model'];if(_0x3fd39a['query'][_0x551c('0x3f')]){_0x527b66[_0x551c('0x40')]=[{'all':!![]}];}_0x527b66=_[_0x551c('0x3d')]({},_0x527b66,_0x3fd39a[_0x551c('0x47')]);return db['WhatsappTransferReport'][_0x551c('0x48')](_0x527b66)[_0x551c('0x24')](handleEntityNotFound(_0x3a0ecf,null))[_0x551c('0x24')](respondWithResult(_0x3a0ecf,null))['catch'](handleError(_0x3a0ecf,null));};exports[_0x551c('0x49')]=function(_0x3950d2,_0x5564c1){return db['WhatsappTransferReport'][_0x551c('0x49')](_0x3950d2[_0x551c('0x4a')],{})[_0x551c('0x24')](respondWithResult(_0x5564c1,0xc9))['catch'](handleError(_0x5564c1,null));};exports[_0x551c('0x23')]=function(_0x2a01ea,_0x55ca9c){if(_0x2a01ea['body']['id']){delete _0x2a01ea[_0x551c('0x4a')]['id'];}return db[_0x551c('0x2b')][_0x551c('0x48')]({'where':{'id':_0x2a01ea['params']['id']}})[_0x551c('0x24')](handleEntityNotFound(_0x55ca9c,null))[_0x551c('0x24')](saveUpdates(_0x2a01ea[_0x551c('0x4a')],null))[_0x551c('0x24')](respondWithResult(_0x55ca9c,null))['catch'](handleError(_0x55ca9c,null));};exports[_0x551c('0x25')]=function(_0x2e34e0,_0x4f583f){return db[_0x551c('0x2b')][_0x551c('0x48')]({'where':{'id':_0x2e34e0[_0x551c('0x44')]['id']}})[_0x551c('0x24')](handleEntityNotFound(_0x4f583f,null))[_0x551c('0x24')](removeEntity(_0x4f583f,null))[_0x551c('0x4b')](handleError(_0x4f583f,null));};exports[_0x551c('0x4c')]=function(_0x4a82a5,_0x18ee4a){return db['WhatsappTransferReport'][_0x551c('0x4c')]()['then'](respondWithResult(_0x18ee4a,null))[_0x551c('0x4b')](handleError(_0x18ee4a,null));}; \ No newline at end of file +var _0xf057=['undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset'];(function(_0x7f01bc,_0x4c4d8e){var _0x317b99=function(_0x451d97){while(--_0x451d97){_0x7f01bc['push'](_0x7f01bc['shift']());}};_0x317b99(++_0x4c4d8e);}(_0xf057,0x16e));var _0x7f05=function(_0x263ad7,_0x980253){_0x263ad7=_0x263ad7-0x0;var _0x13df85=_0xf057[_0x263ad7];return _0x13df85;};'use strict';var emlformat=require(_0x7f05('0x0'));var rimraf=require(_0x7f05('0x1'));var zipdir=require(_0x7f05('0x2'));var jsonpatch=require(_0x7f05('0x3'));var rp=require(_0x7f05('0x4'));var moment=require(_0x7f05('0x5'));var BPromise=require(_0x7f05('0x6'));var Mustache=require('mustache');var util=require(_0x7f05('0x7'));var path=require(_0x7f05('0x8'));var sox=require(_0x7f05('0x9'));var csv=require(_0x7f05('0xa'));var ejs=require(_0x7f05('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f05('0xc'));var squel=require(_0x7f05('0xd'));var crypto=require(_0x7f05('0xe'));var jsforce=require(_0x7f05('0xf'));var deskjs=require(_0x7f05('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7f05('0x11'));var Papa=require(_0x7f05('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7f05('0x13'));var as=require(_0x7f05('0x14'));var hardwareService=require(_0x7f05('0x15'));var logger=require('../../config/logger')(_0x7f05('0x16'));var utils=require(_0x7f05('0x17'));var config=require(_0x7f05('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f05('0x19'))['db'];function respondWithStatusCode(_0x36a040,_0x1b9a1d){_0x1b9a1d=_0x1b9a1d||0xcc;return function(_0x9b7c1d){if(_0x9b7c1d){return _0x36a040['sendStatus'](_0x1b9a1d);}return _0x36a040[_0x7f05('0x1a')](_0x1b9a1d)['end']();};}function respondWithResult(_0x43f927,_0x140bb8){_0x140bb8=_0x140bb8||0xc8;return function(_0x14d73d){if(_0x14d73d){return _0x43f927[_0x7f05('0x1a')](_0x140bb8)[_0x7f05('0x1b')](_0x14d73d);}};}function respondWithFilteredResult(_0x4160d5,_0x175931){return function(_0x438fa7){if(_0x438fa7){var _0x1c3a89=typeof _0x175931[_0x7f05('0x1c')]===_0x7f05('0x1d')&&typeof _0x175931[_0x7f05('0x1e')]===_0x7f05('0x1d');var _0x41f07c=_0x438fa7['count'];var _0x2caa49=_0x1c3a89?0x0:_0x175931[_0x7f05('0x1c')];var _0x1ac544=_0x1c3a89?_0x438fa7[_0x7f05('0x1f')]:_0x175931[_0x7f05('0x1c')]+_0x175931[_0x7f05('0x1e')];var _0x3fdd72;if(_0x1ac544>=_0x41f07c){_0x1ac544=_0x41f07c;_0x3fdd72=0xc8;}else{_0x3fdd72=0xce;}_0x4160d5[_0x7f05('0x1a')](_0x3fdd72);return _0x4160d5[_0x7f05('0x20')](_0x7f05('0x21'),_0x2caa49+'-'+_0x1ac544+'/'+_0x41f07c)[_0x7f05('0x1b')](_0x438fa7);}return null;};}function patchUpdates(_0x136844){return function(_0x1f2e18){try{jsonpatch[_0x7f05('0x22')](_0x1f2e18,_0x136844,!![]);}catch(_0x8ec055){return BPromise[_0x7f05('0x23')](_0x8ec055);}return _0x1f2e18[_0x7f05('0x24')]();};}function saveUpdates(_0x1c5c4e,_0x4d5400){return function(_0x5db22e){if(_0x5db22e){return _0x5db22e[_0x7f05('0x25')](_0x1c5c4e)['then'](function(_0x5b74a8){return _0x5b74a8;});}return null;};}function removeEntity(_0x474e83,_0x522920){return function(_0x526465){if(_0x526465){return _0x526465[_0x7f05('0x26')]()[_0x7f05('0x27')](function(){_0x474e83[_0x7f05('0x1a')](0xcc)[_0x7f05('0x28')]();});}};}function handleEntityNotFound(_0x54d2df,_0x583a32){return function(_0x3e2d42){if(!_0x3e2d42){_0x54d2df[_0x7f05('0x29')](0x194);}return _0x3e2d42;};}function handleError(_0xe444a7,_0x52ffec){_0x52ffec=_0x52ffec||0x1f4;return function(_0x4364a1){logger['error'](_0x4364a1[_0x7f05('0x2a')]);if(_0x4364a1[_0x7f05('0x2b')]){delete _0x4364a1['name'];}_0xe444a7[_0x7f05('0x1a')](_0x52ffec)[_0x7f05('0x2c')](_0x4364a1);};}exports['index']=function(_0x3c2bb,_0x119484){var _0x45a05c={},_0x4c7ba7={},_0x517a89={'count':0x0,'rows':[]};var _0x2c04b8=_[_0x7f05('0x2d')](db[_0x7f05('0x2e')][_0x7f05('0x2f')],function(_0x14bd93){return{'name':_0x14bd93[_0x7f05('0x30')],'type':_0x14bd93[_0x7f05('0x31')]['key']};});_0x4c7ba7[_0x7f05('0x32')]=_['map'](_0x2c04b8,_0x7f05('0x2b'));_0x4c7ba7[_0x7f05('0x33')]=_[_0x7f05('0x34')](_0x3c2bb[_0x7f05('0x33')]);_0x4c7ba7[_0x7f05('0x35')]=_[_0x7f05('0x36')](_0x4c7ba7[_0x7f05('0x32')],_0x4c7ba7[_0x7f05('0x33')]);_0x45a05c[_0x7f05('0x37')]=_['intersection'](_0x4c7ba7[_0x7f05('0x32')],qs[_0x7f05('0x38')](_0x3c2bb['query'][_0x7f05('0x38')]));_0x45a05c[_0x7f05('0x37')]=_0x45a05c[_0x7f05('0x37')]['length']?_0x45a05c[_0x7f05('0x37')]:_0x4c7ba7[_0x7f05('0x32')];if(!_0x3c2bb[_0x7f05('0x33')][_0x7f05('0x39')](_0x7f05('0x3a'))){_0x45a05c[_0x7f05('0x1e')]=qs[_0x7f05('0x1e')](_0x3c2bb['query'][_0x7f05('0x1e')]);_0x45a05c[_0x7f05('0x1c')]=qs['offset'](_0x3c2bb[_0x7f05('0x33')][_0x7f05('0x1c')]);}_0x45a05c[_0x7f05('0x3b')]=qs[_0x7f05('0x3c')](_0x3c2bb[_0x7f05('0x33')][_0x7f05('0x3c')]);_0x45a05c['where']=qs[_0x7f05('0x35')](_[_0x7f05('0x3d')](_0x3c2bb['query'],_0x4c7ba7[_0x7f05('0x35')]),_0x2c04b8);if(_0x3c2bb[_0x7f05('0x33')]['filter']){_0x45a05c['where']=_[_0x7f05('0x3e')](_0x45a05c[_0x7f05('0x3f')],{'$or':_[_0x7f05('0x2d')](_0x2c04b8,function(_0x6c6799){if(_0x6c6799[_0x7f05('0x31')]!==_0x7f05('0x40')){var _0x565ff3={};_0x565ff3[_0x6c6799['name']]={'$like':'%'+_0x3c2bb['query'][_0x7f05('0x41')]+'%'};return _0x565ff3;}})});}_0x45a05c=_['merge']({},_0x45a05c,_0x3c2bb[_0x7f05('0x42')]);var _0x56bfca={'where':_0x45a05c[_0x7f05('0x3f')]};return db[_0x7f05('0x2e')][_0x7f05('0x1f')](_0x56bfca)[_0x7f05('0x27')](function(_0x1d9d05){_0x517a89['count']=_0x1d9d05;if(_0x3c2bb[_0x7f05('0x33')][_0x7f05('0x43')]){_0x45a05c[_0x7f05('0x44')]=[{'all':!![]}];}return db[_0x7f05('0x2e')][_0x7f05('0x45')](_0x45a05c);})['then'](function(_0x4898ae){_0x517a89[_0x7f05('0x46')]=_0x4898ae;return _0x517a89;})[_0x7f05('0x27')](respondWithFilteredResult(_0x119484,_0x45a05c))[_0x7f05('0x47')](handleError(_0x119484,null));};exports[_0x7f05('0x48')]=function(_0x5546c7,_0x5c7a10){var _0x189818={'raw':!![],'where':{'id':_0x5546c7[_0x7f05('0x49')]['id']}},_0x1ece2c={};_0x1ece2c[_0x7f05('0x32')]=_[_0x7f05('0x34')](db['WhatsappTransferReport'][_0x7f05('0x2f')]);_0x1ece2c['query']=_[_0x7f05('0x34')](_0x5546c7[_0x7f05('0x33')]);_0x1ece2c[_0x7f05('0x35')]=_[_0x7f05('0x36')](_0x1ece2c['model'],_0x1ece2c[_0x7f05('0x33')]);_0x189818[_0x7f05('0x37')]=_[_0x7f05('0x36')](_0x1ece2c[_0x7f05('0x32')],qs[_0x7f05('0x38')](_0x5546c7['query'][_0x7f05('0x38')]));_0x189818[_0x7f05('0x37')]=_0x189818['attributes'][_0x7f05('0x4a')]?_0x189818[_0x7f05('0x37')]:_0x1ece2c['model'];if(_0x5546c7[_0x7f05('0x33')]['includeAll']){_0x189818['include']=[{'all':!![]}];}_0x189818=_[_0x7f05('0x3e')]({},_0x189818,_0x5546c7['options']);return db[_0x7f05('0x2e')][_0x7f05('0x4b')](_0x189818)[_0x7f05('0x27')](handleEntityNotFound(_0x5c7a10,null))['then'](respondWithResult(_0x5c7a10,null))[_0x7f05('0x47')](handleError(_0x5c7a10,null));};exports[_0x7f05('0x4c')]=function(_0x4e5b23,_0x1ca300){return db[_0x7f05('0x2e')][_0x7f05('0x4c')](_0x4e5b23[_0x7f05('0x4d')],{})[_0x7f05('0x27')](respondWithResult(_0x1ca300,0xc9))[_0x7f05('0x47')](handleError(_0x1ca300,null));};exports[_0x7f05('0x25')]=function(_0x30aec1,_0x5a0aa2){if(_0x30aec1['body']['id']){delete _0x30aec1[_0x7f05('0x4d')]['id'];}return db[_0x7f05('0x2e')][_0x7f05('0x4b')]({'where':{'id':_0x30aec1['params']['id']}})[_0x7f05('0x27')](handleEntityNotFound(_0x5a0aa2,null))['then'](saveUpdates(_0x30aec1[_0x7f05('0x4d')],null))[_0x7f05('0x27')](respondWithResult(_0x5a0aa2,null))[_0x7f05('0x47')](handleError(_0x5a0aa2,null));};exports[_0x7f05('0x26')]=function(_0x5cb2f6,_0x51b579){return db['WhatsappTransferReport'][_0x7f05('0x4b')]({'where':{'id':_0x5cb2f6[_0x7f05('0x49')]['id']}})[_0x7f05('0x27')](handleEntityNotFound(_0x51b579,null))[_0x7f05('0x27')](removeEntity(_0x51b579,null))['catch'](handleError(_0x51b579,null));};exports['describe']=function(_0x1f8f48,_0x113ae0){return db[_0x7f05('0x2e')][_0x7f05('0x4e')]()[_0x7f05('0x27')](respondWithResult(_0x113ae0,null))['catch'](handleError(_0x113ae0,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 0360f64..9438ed2 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 _0xd34d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util'];(function(_0x57825a,_0x4f18de){var _0x496e87=function(_0x177465){while(--_0x177465){_0x57825a['push'](_0x57825a['shift']());}};_0x496e87(++_0x4f18de);}(_0xd34d,0x178));var _0xdd34=function(_0x1ed3e6,_0x5a895c){_0x1ed3e6=_0x1ed3e6-0x0;var _0x165038=_0xd34d[_0x1ed3e6];return _0x165038;};'use strict';var _=require('lodash');var util=require(_0xdd34('0x0'));var logger=require(_0xdd34('0x1'))(_0xdd34('0x2'));var moment=require(_0xdd34('0x3'));var BPromise=require(_0xdd34('0x4'));var rp=require(_0xdd34('0x5'));var fs=require('fs');var path=require(_0xdd34('0x6'));var rimraf=require(_0xdd34('0x7'));var config=require(_0xdd34('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0xa694e,_0x1fa652){return _0xa694e[_0xdd34('0x9')](_0xdd34('0xa'),attributes,{'tableName':_0xdd34('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdd34('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d2a=['../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x186bc8,_0x5c8998){var _0x399d4e=function(_0x3efa73){while(--_0x3efa73){_0x186bc8['push'](_0x186bc8['shift']());}};_0x399d4e(++_0x5c8998);}(_0x5d2a,0xa1));var _0xa5d2=function(_0x1efcd5,_0xb519e4){_0x1efcd5=_0x1efcd5-0x0;var _0x2e602f=_0x5d2a[_0x1efcd5];return _0x2e602f;};'use strict';var _=require(_0xa5d2('0x0'));var util=require(_0xa5d2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa5d2('0x2'));var BPromise=require(_0xa5d2('0x3'));var rp=require(_0xa5d2('0x4'));var fs=require('fs');var path=require(_0xa5d2('0x5'));var rimraf=require(_0xa5d2('0x6'));var config=require(_0xa5d2('0x7'));var attributes=require(_0xa5d2('0x8'));module[_0xa5d2('0x9')]=function(_0x52d7ba,_0x19a1d4){return _0x52d7ba[_0xa5d2('0xa')](_0xa5d2('0xb'),attributes,{'tableName':_0xa5d2('0xc'),'paranoid':![],'indexes':[{'name':_0xa5d2('0xd'),'fields':[_0xa5d2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index aca12cb..4f4f103 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 _0x3da9=['../../config/logger','../../config/environment','jayson/promise','client','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x254955,_0x2bb0e2){var _0x2d5437=function(_0x499c1b){while(--_0x499c1b){_0x254955['push'](_0x254955['shift']());}};_0x2d5437(++_0x2bb0e2);}(_0x3da9,0x101));var _0x93da=function(_0x3a5315,_0x6c6d3b){_0x3a5315=_0x3a5315-0x0;var _0x1116ac=_0x3da9[_0x3a5315];return _0x1116ac;};'use strict';var _=require(_0x93da('0x0'));var util=require(_0x93da('0x1'));var moment=require(_0x93da('0x2'));var BPromise=require(_0x93da('0x3'));var rs=require(_0x93da('0x4'));var fs=require('fs');var Redis=require(_0x93da('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x93da('0x6'));var logger=require(_0x93da('0x7'))('rpc');var config=require(_0x93da('0x8'));var jayson=require(_0x93da('0x9'));var client=jayson[_0x93da('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2efad7,_0x2ff480,_0x3f3baf){return new BPromise(function(_0x2187be,_0x47a182){return client['request'](_0x2efad7,_0x3f3baf)[_0x93da('0xb')](function(_0x4f64df){logger[_0x93da('0xc')](_0x93da('0xd'),_0x2ff480,'request\x20sent');logger[_0x93da('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2ff480,_0x93da('0xf'),JSON[_0x93da('0x10')](_0x4f64df));if(_0x4f64df['error']){if(_0x4f64df[_0x93da('0x11')][_0x93da('0x12')]===0x1f4){logger['error'](_0x93da('0xd'),_0x2ff480,_0x4f64df['error']['message']);return _0x47a182(_0x4f64df[_0x93da('0x11')][_0x93da('0x13')]);}logger[_0x93da('0x11')](_0x93da('0xd'),_0x2ff480,_0x4f64df[_0x93da('0x11')][_0x93da('0x13')]);return _0x2187be(_0x4f64df[_0x93da('0x11')][_0x93da('0x13')]);}else{logger['info'](_0x93da('0xd'),_0x2ff480,_0x93da('0xf'));_0x2187be(_0x4f64df[_0x93da('0x14')][_0x93da('0x13')]);}})[_0x93da('0x15')](function(_0x51e250){logger['error'](_0x93da('0xd'),_0x2ff480,_0x51e250);_0x47a182(_0x51e250);});});} \ No newline at end of file +var _0xaad3=['stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5e76e7,_0x107c6f){var _0x51e072=function(_0x908176){while(--_0x908176){_0x5e76e7['push'](_0x5e76e7['shift']());}};_0x51e072(++_0x107c6f);}(_0xaad3,0x191));var _0x3aad=function(_0x1e6773,_0x138124){_0x1e6773=_0x1e6773-0x0;var _0x4c81a0=_0xaad3[_0x1e6773];return _0x4c81a0;};'use strict';var _=require(_0x3aad('0x0'));var util=require('util');var moment=require(_0x3aad('0x1'));var BPromise=require(_0x3aad('0x2'));var rs=require(_0x3aad('0x3'));var fs=require('fs');var Redis=require(_0x3aad('0x4'));var db=require(_0x3aad('0x5'))['db'];var utils=require(_0x3aad('0x6'));var logger=require(_0x3aad('0x7'))(_0x3aad('0x8'));var config=require(_0x3aad('0x9'));var jayson=require(_0x3aad('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee802,_0x28b161,_0x509334){return new BPromise(function(_0x53b34c,_0x53abd9){return client[_0x3aad('0xb')](_0x5ee802,_0x509334)[_0x3aad('0xc')](function(_0x4af4dd){logger[_0x3aad('0xd')](_0x3aad('0xe'),_0x28b161,_0x3aad('0xf'));logger[_0x3aad('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x28b161,_0x3aad('0xf'),JSON[_0x3aad('0x11')](_0x4af4dd));if(_0x4af4dd[_0x3aad('0x12')]){if(_0x4af4dd[_0x3aad('0x12')][_0x3aad('0x13')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x28b161,_0x4af4dd[_0x3aad('0x12')][_0x3aad('0x14')]);return _0x53abd9(_0x4af4dd[_0x3aad('0x12')][_0x3aad('0x14')]);}logger[_0x3aad('0x12')](_0x3aad('0xe'),_0x28b161,_0x4af4dd['error']['message']);return _0x53b34c(_0x4af4dd[_0x3aad('0x12')][_0x3aad('0x14')]);}else{logger[_0x3aad('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x28b161,_0x3aad('0xf'));_0x53b34c(_0x4af4dd['result'][_0x3aad('0x14')]);}})[_0x3aad('0x15')](function(_0x4e3975){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x28b161,_0x4e3975);_0x53abd9(_0x4e3975);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 2735cc1..025f9d2 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46cb=['./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','online','join','Offline\x20apps:','log','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./config/license','./rpc'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0x46cb,0xd6));var _0xb46c=function(_0x1bb29c,_0x297df2){_0x1bb29c=_0x1bb29c-0x0;var _0x7262c6=_0x46cb[_0x1bb29c];return _0x7262c6;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xb46c('0x0'));var rpc=require(_0xb46c('0x1'));var config=require(_0xb46c('0x2'));var logger=require(_0xb46c('0x3'))(_0xb46c('0x4'));var pm2=require(_0xb46c('0x5'));var pm2Config=require(_0xb46c('0x6'));var schedule=require(_0xb46c('0x7'));var chat=require(_0xb46c('0x8'));var whatsapp=require(_0xb46c('0x9'));var transcribe=require(_0xb46c('0xa'));var provider=require(_0xb46c('0xb'));function main(){return db[_0xb46c('0xc')][_0xb46c('0xd')]()['then'](function(){if(config[_0xb46c('0xe')]){return seedDb[_0xb46c('0xf')]();}})[_0xb46c('0x10')](function(){return checkLicense[_0xb46c('0xf')]();})[_0xb46c('0x10')](function(){return rpc['listen']();})['then'](function(_0x5ddc29){logger[_0xb46c('0x11')](_0x5ddc29);return chat[_0xb46c('0x12')]();})[_0xb46c('0x10')](function(){return whatsapp[_0xb46c('0x12')]();})[_0xb46c('0x10')](function(){return schedule[_0xb46c('0x12')]();})['then'](function(){return transcribe[_0xb46c('0x12')]();})['then'](function(){return provider[_0xb46c('0x12')]();})[_0xb46c('0x10')](function(_0x5603b1){logger[_0xb46c('0x11')](_0x5603b1);return pm2[_0xb46c('0x12')](pm2Config);})[_0xb46c('0x10')](function(_0x5246b4){var _0xbed789=_0x5246b4[_0xb46c('0x13')](function(_0x4ee554){return typeof _0x4ee554[_0xb46c('0x14')]===_0xb46c('0x15')&&_0x4ee554[_0xb46c('0x14')]>=0x0;});if(_0xbed789[_0xb46c('0x16')]>0x0){throw new Error(_0xbed789[_0xb46c('0x16')]+_0xb46c('0x17')+_[_0xb46c('0x18')](_0xbed789,function(_0x1c8e0b){return'\x22'+_0x1c8e0b['pm2_env'][_0xb46c('0x19')]+'\x22';}));}logger[_0xb46c('0x11')](_0xb46c('0x1a'),_[_0xb46c('0x18')](_['filter'](_0x5246b4,{'status':_0xb46c('0x1b')}),'name')[_0xb46c('0x1c')]());logger[_0xb46c('0x11')](_0xb46c('0x1d'),_['map'](_[_0xb46c('0x13')](_0x5246b4,function(_0x113da5){return _0x113da5['status']!=='online';}),_0xb46c('0x19'))['join']()||'None');console[_0xb46c('0x1e')](_0xb46c('0x1f'));})[_0xb46c('0x20')](function(_0x7a09e6){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x7a09e6);logger[_0xb46c('0x21')](_0xb46c('0x22'),_0x7a09e6);process[_0xb46c('0x23')](0x1);});}main(); \ No newline at end of file +var _0x8585=['./config/schedule/cloud-provider','sequelize','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','status','online','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/pm2/config','./config/schedule','./config/schedule/transcribe'];(function(_0x219f03,_0x57bac5){var _0xb64201=function(_0x30825){while(--_0x30825){_0x219f03['push'](_0x219f03['shift']());}};_0xb64201(++_0x57bac5);}(_0x8585,0x64));var _0x5858=function(_0x50500f,_0x54b94b){_0x50500f=_0x50500f-0x0;var _0xb49c81=_0x8585[_0x50500f];return _0xb49c81;};'use strict';var _=require(_0x5858('0x0'));var db=require(_0x5858('0x1'))['db'];var seedDb=require(_0x5858('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x5858('0x3'));var config=require(_0x5858('0x4'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0x5858('0x5'));var schedule=require(_0x5858('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x5858('0x7'));var provider=require(_0x5858('0x8'));function main(){return db[_0x5858('0x9')]['sync']()['then'](function(){if(config[_0x5858('0xa')]){return seedDb[_0x5858('0xb')]();}})['then'](function(){return checkLicense['default']();})[_0x5858('0xc')](function(){return rpc[_0x5858('0xd')]();})['then'](function(_0x2c8b1f){logger[_0x5858('0xe')](_0x2c8b1f);return chat[_0x5858('0xf')]();})[_0x5858('0xc')](function(){return whatsapp[_0x5858('0xf')]();})[_0x5858('0xc')](function(){return schedule[_0x5858('0xf')]();})[_0x5858('0xc')](function(){return transcribe[_0x5858('0xf')]();})['then'](function(){return provider[_0x5858('0xf')]();})[_0x5858('0xc')](function(_0x8f69f8){logger['info'](_0x8f69f8);return pm2[_0x5858('0xf')](pm2Config);})[_0x5858('0xc')](function(_0x40335a){var _0x2c658a=_0x40335a[_0x5858('0x10')](function(_0x623683){return typeof _0x623683[_0x5858('0x11')]===_0x5858('0x12')&&_0x623683[_0x5858('0x11')]>=0x0;});if(_0x2c658a[_0x5858('0x13')]>0x0){throw new Error(_0x2c658a[_0x5858('0x13')]+_0x5858('0x14')+_[_0x5858('0x15')](_0x2c658a,function(_0x1a0f9f){return'\x22'+_0x1a0f9f[_0x5858('0x16')][_0x5858('0x17')]+'\x22';}));}logger['info'](_0x5858('0x18'),_[_0x5858('0x15')](_[_0x5858('0x10')](_0x40335a,{'status':'online'}),_0x5858('0x17'))[_0x5858('0x19')]());logger[_0x5858('0xe')]('Offline\x20apps:',_[_0x5858('0x15')](_[_0x5858('0x10')](_0x40335a,function(_0x57c278){return _0x57c278[_0x5858('0x1a')]!==_0x5858('0x1b');}),_0x5858('0x17'))[_0x5858('0x19')]()||_0x5858('0x1c'));console[_0x5858('0x1d')](_0x5858('0x1e'));})[_0x5858('0x1f')](function(_0x41e4fa){console['log'](_0x5858('0x20'),_0x41e4fa);logger[_0x5858('0x21')](_0x5858('0x22'),_0x41e4fa);process[_0x5858('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 9b28932..9382f62 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 _0x54ef=['../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','moment','secrets','session','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','headers','authorization','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','payload','options','toString','hex','floor','HS512','../../mysqldb','../../config/environment'];(function(_0x5e89d8,_0x30a21a){var _0x5c1153=function(_0x2dcba0){while(--_0x2dcba0){_0x5e89d8['push'](_0x5e89d8['shift']());}};_0x5c1153(++_0x30a21a);}(_0x54ef,0x112));var _0xf54e=function(_0xd14638,_0x11e9ec){_0xd14638=_0xd14638-0x0;var _0x3a1d2d=_0x54ef[_0xd14638];return _0x3a1d2d;};'use strict';var db=require(_0xf54e('0x0'))['db'];var config=require(_0xf54e('0x1'));var hardwareConf=require(_0xf54e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf54e('0x3'));var _=require(_0xf54e('0x4'));var jwt=require(_0xf54e('0x5'));var expressJwt=require(_0xf54e('0x6'));var compose=require(_0xf54e('0x7'));var basicAuth=require(_0xf54e('0x8'));var crypto=require(_0xf54e('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xf54e('0xa'));var validateJwt=expressJwt({'secret':config[_0xf54e('0xb')][_0xf54e('0xc')]});var userAttributes=['id','role',_0xf54e('0xd'),'name',_0xf54e('0xe'),_0xf54e('0xf'),'userpic',_0xf54e('0x10'),_0xf54e('0x11'),_0xf54e('0x12'),_0xf54e('0x13'),'mailPause',_0xf54e('0x14'),_0xf54e('0x15'),_0xf54e('0x16'),_0xf54e('0x17'),'showWebBar',_0xf54e('0x18'),'lastPauseAt','crudPermissions',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'phoneBarAutoAnswerDelay',_0xf54e('0x1d'),_0xf54e('0x1e'),_0xf54e('0x1f'),_0xf54e('0x20'),'phoneBarExpires',_0xf54e('0x21'),_0xf54e('0x22'),_0xf54e('0x23'),'hotdesk','interface',_0xf54e('0x24'),_0xf54e('0x25'),_0xf54e('0x26'),_0xf54e('0x27'),_0xf54e('0x28'),_0xf54e('0x29'),_0xf54e('0x2a'),_0xf54e('0x2b'),_0xf54e('0x2c'),_0xf54e('0x2d'),_0xf54e('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0xf54e('0x2f'),'smsAutoanswerDelay',_0xf54e('0x30'),_0xf54e('0x31'),_0xf54e('0x32'),_0xf54e('0x33'),_0xf54e('0x34'),_0xf54e('0x35')];exports[_0xf54e('0x36')]=function(){return this[_0xf54e('0x37')](!![])[_0xf54e('0x38')](function(_0x5f9eea,_0x1c58bd,_0x5b83df){if(_0x5f9eea[_0xf54e('0x39')]){_0x5b83df();}else{return db['ChatInteraction'][_0xf54e('0x3a')]({'where':{'id':_0x5f9eea[_0xf54e('0x3b')]['id']},'attributes':['id',_0xf54e('0x3c'),_0xf54e('0x3d')],'raw':!![]})[_0xf54e('0x3e')](function(_0x160160){if(_0x160160&&_0x160160[_0xf54e('0x3c')]){return _0x1c58bd[_0xf54e('0x3f')](_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?0x195:0x193)[_0xf54e('0x41')]({'message':_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?'Unmanaged.':_0xf54e('0x42')});}else{_0x5b83df();}})['catch'](function(_0x282c63){_0x5b83df(_0x282c63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15b888){return compose()[_0xf54e('0x38')](function(_0x21ba00,_0xa13cd0,_0x25b643){var _0x3993e4;if(_0x21ba00[_0xf54e('0x43')]['authorization']){if(_['startsWith'](_0x21ba00[_0xf54e('0x43')][_0xf54e('0x44')],_0xf54e('0x45'))){var _0x16d00f=basicAuth(_0x21ba00);db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'name':_0x16d00f[_0xf54e('0x48')]}})[_0xf54e('0x3e')](function(_0x3ae704){if(!_0x3ae704||!_0x3ae704[_0xf54e('0x49')](_0x16d00f['pass'])){return _0xa13cd0['status'](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x4a')});}_0x21ba00['user']={'id':_0x3ae704['id']};_0x25b643();})[_0xf54e('0x4b')](function(_0x82e313){_0x25b643(_0x82e313);});}else if(_[_0xf54e('0x4c')](_0x21ba00[_0xf54e('0x43')]['authorization'],'Bearer')){validateJwt(_0x21ba00,_0xa13cd0,_0x25b643);}else{if(_0x15b888){_0x25b643();}else{return _0xa13cd0['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x4d')});}}}else if(_0x21ba00[_0xf54e('0x4e')][_0xf54e('0x4f')]){try{var _0x29dc39={'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ba00['query']['apikey'],_0x29dc39)[_0xf54e('0x3e')](function(_0x734187){return db['User']['find']({'where':{'id':_0x734187[_0xf54e('0x51')]}})[_0xf54e('0x3e')](function(_0x173e6c){_0x3993e4=_0x173e6c;return db['Setting'][_0xf54e('0x3a')]({'where':{'id':0x1},'attributes':[_0xf54e('0x52'),'blockDuration'],'raw':!![]});})[_0xf54e('0x3e')](function(_0x6e5bdf){if(!_0x3993e4||!_[_0xf54e('0x53')](_0x3993e4[_0xf54e('0x54')],_0x734187[_0xf54e('0x55')])){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3993e4[_0xf54e('0x56')]){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3993e4[_0xf54e('0x57')]){if(_0x6e5bdf[_0xf54e('0x58')]>0x0){if(moment(_0x3993e4[_0xf54e('0x59')])[_0xf54e('0x5a')](_0x6e5bdf[_0xf54e('0x58')],_0xf54e('0x5b'))>moment()){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}else{return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}_0x21ba00[_0xf54e('0x39')]={'id':_0x3993e4['id']};_0x25b643();});})[_0xf54e('0x4b')](function(){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x533423){_0x25b643(_0x533423);}}else if(_0x15b888){_0x25b643();}else{return _0xa13cd0[_0xf54e('0x3f')](0x193)[_0xf54e('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf54e('0x38')](function(_0x311ce1,_0x381c03,_0x4f61d7){if(_0x311ce1[_0xf54e('0x39')]){db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'id':_0x311ce1[_0xf54e('0x39')]['id']},'attributes':userAttributes})[_0xf54e('0x3e')](function(_0x143a39){if(!_0x143a39){return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5d')});}_0x311ce1['user']=_0x143a39;_0x4f61d7();})[_0xf54e('0x4b')](function(_0x3447fd){_0x4f61d7(_0x3447fd);});}else if(_0x15b888){_0x4f61d7();}else{return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5e')});}});};exports[_0xf54e('0x5f')]=function canUpdate(){return compose()['use'](function(_0x23a4a1,_0x59af72,_0x1d16e0){return licenseUtil['getLicense']()[_0xf54e('0x3e')](function(_0x331b16){if(_0x331b16[_0xf54e('0x60')]){_0x1d16e0();}else{return _0x59af72['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0x32fb46){_0x1d16e0(_0x32fb46);});});};exports[_0xf54e('0x62')]=function isWebrtcLicence(){return compose()['use'](function(_0x427799,_0x297737,_0x346bb4){return licenseUtil[_0xf54e('0x63')]()['then'](function(_0x1bdb5a){if(_0x1bdb5a[_0xf54e('0x64')]){_0x346bb4();}else{return _0x297737['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0xca0141){_0x346bb4(_0xca0141);});});};exports['isMiddleware']=function(_0x196e68,_0x2b645e,_0x2527f6){_0x196e68[_0xf54e('0x65')]=!![];return _0x2527f6();};exports[_0xf54e('0x66')]=function signToken(_0x3237ef){return signJwt(_0x3237ef);};exports[_0xf54e('0x67')]=function(_0xd7b0c5,_0x15bfef){if(!_0xd7b0c5[_0xf54e('0x39')]){return _0x15bfef[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x68')});}var _0x2de1fe={'payload':{'id':_0xd7b0c5[_0xf54e('0x39')]['id'],'role':_0xd7b0c5[_0xf54e('0x39')][_0xf54e('0x69')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2de1fe)[_0xf54e('0x3e')](function(_0x21fd80){_0x15bfef[_0xf54e('0x6a')]('motion.token',_0x21fd80);_0x15bfef['redirect'](_0xf54e('0x6b'));})[_0xf54e('0x4b')](function(_0x45861b){return _0x15bfef[_0xf54e('0x3f')](0x1f4)[_0xf54e('0x6c')](_0x45861b);});};exports[_0xf54e('0x6d')]=function(_0x22763f){if(_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x54')])||_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x6f')])){return null;}else{return createJwt(_0x22763f);}};exports['generateApiKey']=function(_0x2aacf6){_0x2aacf6[_0xf54e('0x54')]=generateNonce();_0x2aacf6[_0xf54e('0x6f')]=generateIssuedAt();return createJwt(_0x2aacf6);};exports[_0xf54e('0x70')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f=_0x1b8f16['query'][_0xf54e('0x4f')];if(_0x18a25f){var _0x5fabd2={'nonce':_0x30f53b[_0xf54e('0x54')],'iat':_0x30f53b['apiKeyIat'],'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18a25f,_0x5fabd2)[_0xf54e('0x3e')](function(){return generateApiKey(_0x30f53b);});}else{throw{'message':_0xf54e('0x71')};}};exports[_0xf54e('0x72')]=function(_0x5b882f){var _0x1d8ccf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8ccf[_0xf54e('0x73')](_0x5b882f))throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0xf54e('0x76'));return;};exports[_0xf54e('0x77')]=function(_0x21d485,_0x55d57f,_0x55de5c){var _0x4270e1=encryptor[_0xf54e('0x78')](_0x55d57f)['split'](',');for(var _0x29743e=0x0;_0x29743e<_0x55de5c;_0x29743e++){if(!_0x4270e1[_0x29743e])break;if(_0x21d485['toLowerCase']()===_0x4270e1[_0x29743e][_0xf54e('0x79')]()){var _0x528a64=util[_0xf54e('0x7a')](_0xf54e('0x7b'),_0x55de5c);if(_0x55de5c===0x1){_0x528a64=_0xf54e('0x7c');}throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0x528a64);}}return;};exports[_0xf54e('0x7d')]=function(_0x556e55,_0x479572){var _0x79345=_0x479572?encryptor[_0xf54e('0x78')](_0x479572)['split'](','):[];if(_0x79345['length']===0x5){_0x79345[_0xf54e('0x7e')](-0x1,0x1);}_0x79345['unshift'](_0x556e55);return encryptor[_0xf54e('0x7f')](_0x79345[_0xf54e('0x80')](','));};function signJwt(_0x47596c){var _0x2b11f8=BPromise[_0xf54e('0x81')](jwt[_0xf54e('0x82')],{'context':jwt});var _0x3bf476=_0x47596c[_0xf54e('0x83')]||config[_0xf54e('0xb')][_0xf54e('0xc')];return new BPromise(function(_0x1f9dad,_0x2c6d0e){_0x2b11f8(_0x47596c[_0xf54e('0x84')],_0x3bf476,_0x47596c[_0xf54e('0x85')])['then'](function(_0x302f3d){_0x1f9dad(_0x302f3d);})[_0xf54e('0x4b')](function(_0xb7ff4d){_0x2c6d0e(_0xb7ff4d);});});}function verifyJwt(_0x11908b,_0x1e4c0d,_0x494629){var _0xf50b1b=BPromise[_0xf54e('0x81')](jwt['verify'],{'context':jwt});var _0x51ec35=_0x494629||config[_0xf54e('0xb')]['session'];return new BPromise(function(_0x26322a,_0x39c5eb){_0xf50b1b(_0x11908b,_0x51ec35,_0x1e4c0d)[_0xf54e('0x3e')](function(_0x9789b9){_0x26322a(_0x9789b9);})['catch'](function(_0x2ecda1){_0x39c5eb(_0x2ecda1);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf54e('0x86')](_0xf54e('0x87'));}function generateIssuedAt(){return Math[_0xf54e('0x88')](Date['now']()/0x3e8)[_0xf54e('0x86')]();}function createJwt(_0x504ec7){var _0x3f7224={'payload':{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce']},'options':{'algorithm':_0xf54e('0x89'),'subject':_0x504ec7['id']['toString'](),'issuer':hardwareConf[_0xf54e('0x50')](),'audience':hardwareConf[_0xf54e('0x50')]()}};return signJwt(_0x3f7224)[_0xf54e('0x3e')](function(_0x38405c){return{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce'],'token':_0x38405c};});} \ No newline at end of file +var _0x70e0=['express-jwt','composable-middleware','crypto','util','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','catch','headers','authorization','startsWith','Basic','User','authenticate','Bearer','status','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','splice','encryptString','promisify','sign','secret','secrets','session','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken'];(function(_0x3fc28f,_0x5aba73){var _0x36bd7e=function(_0x5f16f9){while(--_0x5f16f9){_0x3fc28f['push'](_0x3fc28f['shift']());}};_0x36bd7e(++_0x5aba73);}(_0x70e0,0x17b));var _0x070e=function(_0x57b14a,_0x15646e){_0x57b14a=_0x57b14a-0x0;var _0x5c5fbd=_0x70e0[_0x57b14a];return _0x5c5fbd;};'use strict';var db=require(_0x070e('0x0'))['db'];var config=require(_0x070e('0x1'));var hardwareConf=require(_0x070e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x070e('0x3'));var jwt=require(_0x070e('0x4'));var expressJwt=require(_0x070e('0x5'));var compose=require(_0x070e('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x070e('0x7'));var BPromise=require('bluebird');var util=require(_0x070e('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x070e('0x9'),_0x070e('0xa'),_0x070e('0xb'),_0x070e('0xc'),_0x070e('0xd'),_0x070e('0xe'),_0x070e('0xf'),'md5secret','voicePause',_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13'),_0x070e('0x14'),_0x070e('0x15'),_0x070e('0x16'),_0x070e('0x17'),_0x070e('0x18'),_0x070e('0x19'),_0x070e('0x1a'),'passwordResetAt','alias',_0x070e('0x1b'),'phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0x070e('0x1c'),_0x070e('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0x070e('0x1e'),_0x070e('0x1f'),_0x070e('0x20'),_0x070e('0x21'),'userProfileId','privacyEnabled',_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26'),'ignorePauseForPreviewCalls',_0x070e('0x27'),_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a'),_0x070e('0x2b'),'smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer',_0x070e('0x2c'),_0x070e('0x2d'),_0x070e('0x2e'),'whatsappAutoanswer',_0x070e('0x2f')];exports['isChatInteractionAuthorized']=function(){return this[_0x070e('0x30')](!![])[_0x070e('0x31')](function(_0x27a01e,_0x33e8c6,_0x28a1c3){if(_0x27a01e[_0x070e('0x32')]){_0x28a1c3();}else{return db[_0x070e('0x33')][_0x070e('0x34')]({'where':{'id':_0x27a01e['params']['id']},'attributes':['id',_0x070e('0x35'),_0x070e('0x36')],'raw':!![]})[_0x070e('0x37')](function(_0x503f4d){if(_0x503f4d&&_0x503f4d[_0x070e('0x35')]){return _0x33e8c6['status'](_0x503f4d['disposition']===_0x070e('0x38')?0x195:0x193)[_0x070e('0x39')]({'message':_0x503f4d[_0x070e('0x36')]===_0x070e('0x38')?_0x070e('0x3a'):'Forbidden.'});}else{_0x28a1c3();}})[_0x070e('0x3b')](function(_0x219e48){_0x28a1c3(_0x219e48);});}});};exports[_0x070e('0x30')]=function isAuthenticated(_0x1d2a34){return compose()[_0x070e('0x31')](function(_0x28d7f2,_0x1a1892,_0x26373b){var _0x5e8326;if(_0x28d7f2[_0x070e('0x3c')][_0x070e('0x3d')]){if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x3f'))){var _0x46065c=basicAuth(_0x28d7f2);db[_0x070e('0x40')]['find']({'where':{'name':_0x46065c[_0x070e('0xb')]}})[_0x070e('0x37')](function(_0x3a9425){if(!_0x3a9425||!_0x3a9425[_0x070e('0x41')](_0x46065c['pass'])){return _0x1a1892['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x28d7f2[_0x070e('0x32')]={'id':_0x3a9425['id']};_0x26373b();})['catch'](function(_0x1dff97){_0x26373b(_0x1dff97);});}else if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x42'))){validateJwt(_0x28d7f2,_0x1a1892,_0x26373b);}else{if(_0x1d2a34){_0x26373b();}else{return _0x1a1892[_0x070e('0x43')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x28d7f2[_0x070e('0x44')][_0x070e('0x45')]){try{var _0x444d02={'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};verifyJwt(_0x28d7f2['query']['apikey'],_0x444d02)[_0x070e('0x37')](function(_0x3011c4){return db[_0x070e('0x40')][_0x070e('0x47')]({'where':{'id':_0x3011c4[_0x070e('0x48')]}})['then'](function(_0x22f3a9){_0x5e8326=_0x22f3a9;return db[_0x070e('0x49')]['findOne']({'where':{'id':0x1},'attributes':[_0x070e('0x4a'),_0x070e('0x4b')],'raw':!![]});})['then'](function(_0x4d4ee8){if(!_0x5e8326||!_['isEqual'](_0x5e8326[_0x070e('0x4c')],_0x3011c4[_0x070e('0x4d')])){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4e')});}if(_0x5e8326['disabled']){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}if(_0x5e8326['blocked']){if(_0x4d4ee8[_0x070e('0x4b')]>0x0){if(moment(_0x5e8326[_0x070e('0x50')])[_0x070e('0x51')](_0x4d4ee8['blockDuration'],_0x070e('0x52'))>moment()){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});}}else{return _0x1a1892['status'](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}}_0x28d7f2[_0x070e('0x32')]={'id':_0x5e8326['id']};_0x26373b();});})[_0x070e('0x3b')](function(){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});});}catch(_0x5db2ce){_0x26373b(_0x5db2ce);}}else if(_0x1d2a34){_0x26373b();}else{return _0x1a1892['status'](0x193)[_0x070e('0x39')]({'message':_0x070e('0x53')});}})[_0x070e('0x31')](function(_0x4d52ff,_0x2ad56c,_0x1223be){if(_0x4d52ff[_0x070e('0x32')]){db[_0x070e('0x40')]['find']({'where':{'id':_0x4d52ff[_0x070e('0x32')]['id']},'attributes':userAttributes})['then'](function(_0x544b53){if(!_0x544b53){return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':_0x070e('0x54')});}_0x4d52ff[_0x070e('0x32')]=_0x544b53;_0x1223be();})[_0x070e('0x3b')](function(_0x34f23e){_0x1223be(_0x34f23e);});}else if(_0x1d2a34){_0x1223be();}else{return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x070e('0x55')]=function canUpdate(){return compose()[_0x070e('0x31')](function(_0xff760c,_0x52fcea,_0x54285a){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x35349f){if(_0x35349f[_0x070e('0x57')]){_0x54285a();}else{return _0x52fcea[_0x070e('0x43')](0x193)['json']({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x48d836){_0x54285a(_0x48d836);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x070e('0x31')](function(_0x945901,_0x2d43ce,_0x1fc7c4){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x20b80e){if(_0x20b80e[_0x070e('0x59')]){_0x1fc7c4();}else{return _0x2d43ce[_0x070e('0x43')](0x193)[_0x070e('0x39')]({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x1f54d5){_0x1fc7c4(_0x1f54d5);});});};exports[_0x070e('0x5a')]=function(_0xd67987,_0x66a3f3,_0x210c4d){_0xd67987[_0x070e('0x5a')]=!![];return _0x210c4d();};exports[_0x070e('0x5b')]=function signToken(_0x216d27){return signJwt(_0x216d27);};exports[_0x070e('0x5c')]=function(_0x5e051a,_0x171621){if(!_0x5e051a[_0x070e('0x32')]){return _0x171621[_0x070e('0x43')](0x194)[_0x070e('0x39')]({'message':_0x070e('0x5d')});}var _0x3bd738={'payload':{'id':_0x5e051a[_0x070e('0x32')]['id'],'role':_0x5e051a[_0x070e('0x32')][_0x070e('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3bd738)['then'](function(_0x251696){_0x171621['cookie'](_0x070e('0x5e'),_0x251696);_0x171621[_0x070e('0x5f')]('/dashboards/general');})[_0x070e('0x3b')](function(_0x130a50){return _0x171621[_0x070e('0x43')](0x1f4)[_0x070e('0x60')](_0x130a50);});};exports[_0x070e('0x61')]=function(_0x1e8a4f){if(_[_0x070e('0x62')](_0x1e8a4f['apiKeyNonce'])||_[_0x070e('0x62')](_0x1e8a4f['apiKeyIat'])){return null;}else{return createJwt(_0x1e8a4f);}};exports['generateApiKey']=function(_0x3a06c6){_0x3a06c6[_0x070e('0x4c')]=generateNonce();_0x3a06c6[_0x070e('0x63')]=generateIssuedAt();return createJwt(_0x3a06c6);};exports[_0x070e('0x64')]=function(_0x202015,_0x7948ed){var _0x440fa1=_0x202015[_0x070e('0x44')]['apikey'];if(_0x440fa1){var _0x477e69={'nonce':_0x7948ed['apiKeyNonce'],'iat':_0x7948ed['apiKeyIat'],'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};return verifyJwt(_0x440fa1,_0x477e69)['then'](function(){return generateApiKey(_0x7948ed);});}else{throw{'message':_0x070e('0x65')};}};exports[_0x070e('0x66')]=function(_0x210f4a){var _0x2f8104=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2f8104[_0x070e('0x67')](_0x210f4a))throw new db[(_0x070e('0x68'))][(_0x070e('0x69'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x5943e3,_0x3087e5,_0x1948a5){var _0x29f497=encryptor[_0x070e('0x6a')](_0x3087e5)['split'](',');for(var _0x25f34c=0x0;_0x25f34c<_0x1948a5;_0x25f34c++){if(!_0x29f497[_0x25f34c])break;if(_0x5943e3['toLowerCase']()===_0x29f497[_0x25f34c][_0x070e('0x6b')]()){var _0x1cbb7e=util[_0x070e('0x6c')](_0x070e('0x6d'),_0x1948a5);if(_0x1948a5===0x1){_0x1cbb7e=_0x070e('0x6e');}throw new db[(_0x070e('0x68'))]['ValidationError'](_0x1cbb7e);}}return;};exports[_0x070e('0x6f')]=function(_0x18e8d0,_0x8aaf00){var _0x533431=_0x8aaf00?encryptor[_0x070e('0x6a')](_0x8aaf00)[_0x070e('0x70')](','):[];if(_0x533431['length']===0x5){_0x533431[_0x070e('0x71')](-0x1,0x1);}_0x533431['unshift'](_0x18e8d0);return encryptor[_0x070e('0x72')](_0x533431['join'](','));};function signJwt(_0x4cb86f){var _0x4b354d=BPromise[_0x070e('0x73')](jwt[_0x070e('0x74')],{'context':jwt});var _0x1100d8=_0x4cb86f[_0x070e('0x75')]||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x498bc6,_0x841c89){_0x4b354d(_0x4cb86f['payload'],_0x1100d8,_0x4cb86f[_0x070e('0x78')])['then'](function(_0x2e10f7){_0x498bc6(_0x2e10f7);})[_0x070e('0x3b')](function(_0x5b0b46){_0x841c89(_0x5b0b46);});});}function verifyJwt(_0x1bcdc3,_0x50399e,_0x1a9e25){var _0x139630=BPromise[_0x070e('0x73')](jwt[_0x070e('0x79')],{'context':jwt});var _0x764b06=_0x1a9e25||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x148f1d,_0x3ef9cc){_0x139630(_0x1bcdc3,_0x764b06,_0x50399e)[_0x070e('0x37')](function(_0x40c560){_0x148f1d(_0x40c560);})[_0x070e('0x3b')](function(_0x455bf2){_0x3ef9cc(_0x455bf2);});});}function generateNonce(){return crypto[_0x070e('0x7a')](0x10)['toString'](_0x070e('0x7b'));}function generateIssuedAt(){return Math[_0x070e('0x7c')](Date[_0x070e('0x7d')]()/0x3e8)[_0x070e('0x7e')]();}function createJwt(_0x5712d1){var _0x2ccd8d={'payload':{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')]},'options':{'algorithm':_0x070e('0x7f'),'subject':_0x5712d1['id'][_0x070e('0x7e')](),'issuer':hardwareConf[_0x070e('0x46')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x2ccd8d)[_0x070e('0x37')](function(_0x7d154){return{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')],'token':_0x7d154};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 65c0eac..bc0ac82 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 _0x9eab=['utf8','base64','decryptString','bluebird','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','secret'];(function(_0x518990,_0x8fa098){var _0x258811=function(_0x479279){while(--_0x479279){_0x518990['push'](_0x518990['shift']());}};_0x258811(++_0x8fa098);}(_0x9eab,0xfb));var _0xb9ea=function(_0x54e038,_0x29333c){_0x54e038=_0x54e038-0x0;var _0x5a6693=_0x9eab[_0x54e038];return _0x5a6693;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xb9ea('0x0'));var _=require('lodash');var config=require(_0xb9ea('0x1'));var logger=require(_0xb9ea('0x2'))(_0xb9ea('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xb9ea('0x4')],'algorithm':_0xb9ea('0x5')};const fileOptions={'algorithm':_0xb9ea('0x6')};if(config['encrypt']&&config[_0xb9ea('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xb9ea('0x7')]['algorithm']);if(isSupported){fileOptions[_0xb9ea('0x8')]=config[_0xb9ea('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xb9ea('0x7')][_0xb9ea('0x8')],_0xb9ea('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x5c211d){return AES_SUPPORTED_RX[_0xb9ea('0xa')](_0x5c211d);}function getSupportedCiphers(){return crypto[_0xb9ea('0xb')]()[_0xb9ea('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x1f4378){return getSupportedCiphers()[_0xb9ea('0xd')](_0x1f4378)>-0x1;}function combineOptions(_0x57fecf){var _0x6deb94={};for(var _0x29da8 in fileOptions){if(fileOptions['hasOwnProperty'](_0x29da8)){_0x6deb94[_0x29da8]=fileOptions[_0x29da8];}}if(_0x57fecf){for(var _0x523625 in _0x57fecf){if(_0x57fecf[_0xb9ea('0xe')](_0x523625)){_0x6deb94[_0x523625]=_0x57fecf[_0x523625];}}}return _0x6deb94;}exports['encryptFile']=function(_0x2308ee,_0x4b453e,_0x191fa7,_0x15d6a3){return new BPromise(function(_0x3ebac9,_0x475422){_0x15d6a3=combineOptions(_0x15d6a3);var _0x3bf648=new Buffer(_0x191fa7);var _0x2e10fb=fs[_0xb9ea('0xf')](_0x2308ee);var _0xc78dcb=fs[_0xb9ea('0x10')](_0x4b453e);var _0x23e88a=crypto[_0xb9ea('0x11')](_0x15d6a3[_0xb9ea('0x8')],_0x3bf648);_0x2e10fb['on']('data',function(_0x508f84){var _0x3f1262=new Buffer(_0x23e88a[_0xb9ea('0x12')](_0x508f84),_0xb9ea('0x13'));_0xc78dcb[_0xb9ea('0x14')](_0x3f1262);});_0x2e10fb['on'](_0xb9ea('0x15'),function(){try{var _0x2380cf=new Buffer(_0x23e88a[_0xb9ea('0x16')]('binary'),_0xb9ea('0x13'));_0xc78dcb[_0xb9ea('0x14')](_0x2380cf);_0xc78dcb[_0xb9ea('0x15')]();_0xc78dcb['on'](_0xb9ea('0x17'),function(){return _0x3ebac9(_0x4b453e);});}catch(_0x328d71){fs[_0xb9ea('0x18')](_0x4b453e);return _0x475422(_0x328d71);}});});};exports[_0xb9ea('0x19')]=function(_0x2f8806,_0x337875,_0x1128d0,_0x19cd69){return new BPromise(function(_0x805185,_0x1cc04c){_0x19cd69=combineOptions(_0x19cd69);var _0x2fa3e7=new Buffer(_0x1128d0);var _0x508a34=fs[_0xb9ea('0xf')](_0x2f8806);var _0xd7ff2f=fs[_0xb9ea('0x10')](_0x337875);var _0x59a5d9=crypto[_0xb9ea('0x1a')](_0x19cd69[_0xb9ea('0x8')],_0x2fa3e7);_0x508a34['on']('data',function(_0x2da8f4){var _0x278cc6=new Buffer(_0x59a5d9[_0xb9ea('0x12')](_0x2da8f4),_0xb9ea('0x13'));_0xd7ff2f[_0xb9ea('0x14')](_0x278cc6);});_0x508a34['on'](_0xb9ea('0x15'),function(){try{var _0x3f6aa0=new Buffer(_0x59a5d9[_0xb9ea('0x16')](_0xb9ea('0x13')),'binary');_0xd7ff2f[_0xb9ea('0x14')](_0x3f6aa0);_0xd7ff2f[_0xb9ea('0x15')]();_0xd7ff2f['on'](_0xb9ea('0x17'),function(){return _0x805185(_0x337875);});}catch(_0x29e118){fs[_0xb9ea('0x18')](_0x337875);return _0x1cc04c(_0x29e118);}});});};exports['encryptString']=function(_0x41439e,_0x619b13,_0x125fa2){var _0x31dc98=_0x125fa2||stringOptions['algorithm'];var _0x58aa4e=_0x619b13||stringOptions[_0xb9ea('0x1b')];var _0x37b248=crypto['createCipher'](_0x31dc98,_0x58aa4e);var _0x26727c=_0x37b248[_0xb9ea('0x12')](_0x41439e,_0xb9ea('0x1c'),'base64');_0x26727c+=_0x37b248[_0xb9ea('0x16')](_0xb9ea('0x1d'));return _0x26727c;};exports[_0xb9ea('0x1e')]=function(_0x4f4970,_0x6c2d8f,_0x286d04){var _0x3766db=_0x286d04||stringOptions['algorithm'];var _0xaf8ae1=_0x6c2d8f||stringOptions[_0xb9ea('0x1b')];var _0x100239=crypto[_0xb9ea('0x1a')](_0x3766db,_0xaf8ae1);var _0x1f02f8=_0x100239['update'](_0x4f4970,'base64','utf8');_0x1f02f8+=_0x100239[_0xb9ea('0x16')]('utf8');return _0x1f02f8;}; \ No newline at end of file +var _0xeb07=['end','binary','close','decryptFile','createDecipher','final','unlink','encryptString','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','write'];(function(_0x186159,_0x19b28a){var _0x512ab4=function(_0x5d298c){while(--_0x5d298c){_0x186159['push'](_0x186159['shift']());}};_0x512ab4(++_0x19b28a);}(_0xeb07,0x94));var _0x7eb0=function(_0x90ebdd,_0x4509b3){_0x90ebdd=_0x90ebdd-0x0;var _0x58ebb0=_0xeb07[_0x90ebdd];return _0x58ebb0;};'use strict';var crypto=require(_0x7eb0('0x0'));var fs=require('fs');var BPromise=require(_0x7eb0('0x1'));var _=require(_0x7eb0('0x2'));var config=require(_0x7eb0('0x3'));var logger=require(_0x7eb0('0x4'))(_0x7eb0('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7eb0('0x6')][_0x7eb0('0x7')],'algorithm':_0x7eb0('0x8')};const fileOptions={'algorithm':'aes192'};if(config[_0x7eb0('0x9')]&&config[_0x7eb0('0x9')][_0x7eb0('0xa')]){var isSupported=isAlgorithmSupported(config[_0x7eb0('0x9')]['algorithm']);if(isSupported){fileOptions[_0x7eb0('0xa')]=config[_0x7eb0('0x9')][_0x7eb0('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x7eb0('0x9')][_0x7eb0('0xa')],_0x7eb0('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x50de98){return AES_SUPPORTED_RX[_0x7eb0('0xc')](_0x50de98);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x7eb0('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x50b61a){return getSupportedCiphers()[_0x7eb0('0xe')](_0x50b61a)>-0x1;}function combineOptions(_0x5444a3){var _0x116a12={};for(var _0x53e3ec in fileOptions){if(fileOptions[_0x7eb0('0xf')](_0x53e3ec)){_0x116a12[_0x53e3ec]=fileOptions[_0x53e3ec];}}if(_0x5444a3){for(var _0x4103c4 in _0x5444a3){if(_0x5444a3['hasOwnProperty'](_0x4103c4)){_0x116a12[_0x4103c4]=_0x5444a3[_0x4103c4];}}}return _0x116a12;}exports[_0x7eb0('0x10')]=function(_0x557bca,_0x1e7858,_0x13f2c7,_0x2e40bc){return new BPromise(function(_0xb9f676,_0x670826){_0x2e40bc=combineOptions(_0x2e40bc);var _0x41b839=new Buffer(_0x13f2c7);var _0x34e2ea=fs[_0x7eb0('0x11')](_0x557bca);var _0x26a251=fs[_0x7eb0('0x12')](_0x1e7858);var _0x2e4859=crypto['createCipher'](_0x2e40bc['algorithm'],_0x41b839);_0x34e2ea['on'](_0x7eb0('0x13'),function(_0x44c932){var _0x27312a=new Buffer(_0x2e4859[_0x7eb0('0x14')](_0x44c932),'binary');_0x26a251[_0x7eb0('0x15')](_0x27312a);});_0x34e2ea['on'](_0x7eb0('0x16'),function(){try{var _0x124f28=new Buffer(_0x2e4859['final'](_0x7eb0('0x17')),'binary');_0x26a251[_0x7eb0('0x15')](_0x124f28);_0x26a251[_0x7eb0('0x16')]();_0x26a251['on'](_0x7eb0('0x18'),function(){return _0xb9f676(_0x1e7858);});}catch(_0x42c774){fs['unlink'](_0x1e7858);return _0x670826(_0x42c774);}});});};exports[_0x7eb0('0x19')]=function(_0x49191d,_0x3017b3,_0x480154,_0x35143d){return new BPromise(function(_0x5414b3,_0x5db21f){_0x35143d=combineOptions(_0x35143d);var _0x2ba72b=new Buffer(_0x480154);var _0x133a71=fs[_0x7eb0('0x11')](_0x49191d);var _0x1d8f74=fs[_0x7eb0('0x12')](_0x3017b3);var _0x5e0294=crypto[_0x7eb0('0x1a')](_0x35143d[_0x7eb0('0xa')],_0x2ba72b);_0x133a71['on'](_0x7eb0('0x13'),function(_0x4f572a){var _0x1ba41a=new Buffer(_0x5e0294[_0x7eb0('0x14')](_0x4f572a),_0x7eb0('0x17'));_0x1d8f74[_0x7eb0('0x15')](_0x1ba41a);});_0x133a71['on'](_0x7eb0('0x16'),function(){try{var _0x5cb560=new Buffer(_0x5e0294[_0x7eb0('0x1b')](_0x7eb0('0x17')),_0x7eb0('0x17'));_0x1d8f74[_0x7eb0('0x15')](_0x5cb560);_0x1d8f74[_0x7eb0('0x16')]();_0x1d8f74['on']('close',function(){return _0x5414b3(_0x3017b3);});}catch(_0x1af28a){fs[_0x7eb0('0x1c')](_0x3017b3);return _0x5db21f(_0x1af28a);}});});};exports[_0x7eb0('0x1d')]=function(_0x530b0a,_0x342937,_0x15d4e9){var _0x3a0643=_0x15d4e9||stringOptions[_0x7eb0('0xa')];var _0x882fd0=_0x342937||stringOptions[_0x7eb0('0x1e')];var _0x192fae=crypto['createCipher'](_0x3a0643,_0x882fd0);var _0x157f52=_0x192fae[_0x7eb0('0x14')](_0x530b0a,'utf8',_0x7eb0('0x1f'));_0x157f52+=_0x192fae[_0x7eb0('0x1b')](_0x7eb0('0x1f'));return _0x157f52;};exports[_0x7eb0('0x20')]=function(_0x305eac,_0x78c90a,_0x5409c1){var _0x885e65=_0x5409c1||stringOptions[_0x7eb0('0xa')];var _0x5ae15d=_0x78c90a||stringOptions[_0x7eb0('0x1e')];var _0x2e1071=crypto[_0x7eb0('0x1a')](_0x885e65,_0x5ae15d);var _0x3d2204=_0x2e1071[_0x7eb0('0x14')](_0x305eac,_0x7eb0('0x1f'),_0x7eb0('0x21'));_0x3d2204+=_0x2e1071[_0x7eb0('0x1b')](_0x7eb0('0x21'));return _0x3d2204;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index a377188..41844c2 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 _0x7ab1=['forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','%s.%s','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','exit','util','lodash','bluebird','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length'];(function(_0x3b7fe7,_0x59b34c){var _0x4aa4bc=function(_0x12ac5a){while(--_0x12ac5a){_0x3b7fe7['push'](_0x3b7fe7['shift']());}};_0x4aa4bc(++_0x59b34c);}(_0x7ab1,0x1ea));var _0x17ab=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x7ab1[_0xc4001c];return _0x49f7bc;};'use strict';var util=require(_0x17ab('0x0'));var path=require('path');var _=require(_0x17ab('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x17ab('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x17ab('0x3'));var db=require(_0x17ab('0x4'))['db'];var dbH=require(_0x17ab('0x4'))[_0x17ab('0x5')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x17ab('0x6')][0x2]);var QUERY=process[_0x17ab('0x6')][0x3];var PATH=process[_0x17ab('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x56032b,_0x2681c8){var _0x34a0cf={'status':_0x56032b};var _0x53b4c4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2681c8){_0x34a0cf[_0x17ab('0x7')]=_0x2681c8;}return db[_0x17ab('0x8')][_0x17ab('0x9')](_0x34a0cf,_0x53b4c4);}function main(){var _0x33d44c=0x1388;var _0x12c12f;logger[_0x17ab('0xa')](util['format'](_0x17ab('0xb'),EXTRACTED_REPORT_ID,_0x17ab('0xc')));return db[_0x17ab('0xd')][_0x17ab('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x17ab('0xf'),_0x17ab('0x10')]})['then'](function(_0x38130b){if(_0x38130b){_0x12c12f=_0x38130b;_0x33d44c=_0x12c12f['splitSizeCsv']||0x1388;}})[_0x17ab('0x11')](function(){return dbH['sequelize'][_0x17ab('0x12')](util[_0x17ab('0x13')](_0x17ab('0x14'),QUERY),{'type':dbH[_0x17ab('0x15')][_0x17ab('0x16')][_0x17ab('0x17')]});})[_0x17ab('0x11')](function(_0x1b0ed4){if(!_0x1b0ed4[0x0][_0x17ab('0x18')]){return analyticExtractedReport(_0x17ab('0x19'));}var _0x2046b8=[];var _0x46088d=0x0;if(_0x12c12f[_0x17ab('0xf')]){if(_0x1b0ed4&&_0x1b0ed4[_0x17ab('0x1a')]){var _0x158fd0=_['range'](_0x1b0ed4[0x0][_0x17ab('0x18')]/_0x33d44c);var _0x4ff691=Number['isInteger'](_0x1b0ed4[0x0]['num']/_0x33d44c)?_0x1b0ed4[0x0][_0x17ab('0x18')]%_0x33d44c:0x0;_0x158fd0[_0x17ab('0x1b')](function(_0x1e05ac){if(_0x1e05ac>0x0){_0x46088d+=_0x33d44c;}_0x2046b8[_0x17ab('0x1c')](dbH['sequelize'][_0x17ab('0x12')](util[_0x17ab('0x13')](_0x17ab('0x1d'),QUERY,_0x33d44c,_0x46088d),{'type':dbH[_0x17ab('0x15')][_0x17ab('0x16')][_0x17ab('0x17')]}));});if(_0x4ff691>0x0){_0x46088d+=_0x33d44c;_0x2046b8['push'](dbH['sequelize'][_0x17ab('0x12')](util['format'](_0x17ab('0x1d'),QUERY,_0x4ff691,_0x46088d),{'type':dbH[_0x17ab('0x15')][_0x17ab('0x16')][_0x17ab('0x17')]}));}}}else{_0x2046b8[_0x17ab('0x1c')](dbH[_0x17ab('0x15')][_0x17ab('0x12')](QUERY,{'type':dbH[_0x17ab('0x15')]['QueryTypes'][_0x17ab('0x17')]}));}var _0x4ee430=path[_0x17ab('0x1e')](PATH);var _0x378faa=path[_0x17ab('0x1f')](PATH,_0x17ab('0x20'));var _0x13fd5a=_0x12c12f[_0x17ab('0xf')]&&_0x2046b8[_0x17ab('0x1a')]>0x1;var _0x543a69=[];if(!fs['existsSync'](path[_0x17ab('0x21')](_0x4ee430,_0x378faa))&&_0x13fd5a){fs[_0x17ab('0x22')](path[_0x17ab('0x21')](_0x4ee430,_0x378faa));}return BPromise[_0x17ab('0x23')](_0x2046b8,function(_0x2fd268){_0x543a69[_0x17ab('0x1c')](_0x2fd268);})[_0x17ab('0x11')](function(){for(var _0x51ef82=0x0;_0x51ef82<_0x543a69['length'];_0x51ef82+=0x1){var _0x328b12;var _0x61ed3c=_0x543a69[_0x51ef82];if(_0x13fd5a){_0x328b12=path[_0x17ab('0x21')](_0x4ee430,_0x378faa,util['format'](_0x17ab('0x24'),_0x378faa,_0x51ef82,_0x17ab('0x25')));}else{_0x328b12=path[_0x17ab('0x21')](_0x4ee430,util[_0x17ab('0x13')]('%s.%s',_0x378faa,'csv'));}fs[_0x17ab('0x26')](_0x328b12,csv(_0x61ed3c));}})[_0x17ab('0x11')](function(){if(_0x13fd5a){return new Promise(function(_0x2d854b){zipdir(path[_0x17ab('0x21')](_0x4ee430,_0x378faa),{'saveTo':path['join'](_0x4ee430,util[_0x17ab('0x13')](_0x17ab('0x27'),_0x378faa,_0x17ab('0x28')))},function(_0x2dc2c7,_0x557585){rimraf(path[_0x17ab('0x21')](_0x4ee430,_0x378faa),function(){});_0x2d854b('zip\x20finished');});});}})[_0x17ab('0x11')](function(){logger[_0x17ab('0xa')](util[_0x17ab('0x13')](_0x17ab('0x29'),EXTRACTED_REPORT_ID,_0x17ab('0xc')));return analyticExtractedReport('Completed',_0x13fd5a?util['format']('%s.%s',_0x378faa,_0x13fd5a?_0x17ab('0x28'):_0x17ab('0x25')):null);});})[_0x17ab('0x2a')](function(_0x531ee6){logger[_0x17ab('0xa')](util['format'](_0x17ab('0x2b'),EXTRACTED_REPORT_ID,_0x17ab('0xc')),util[_0x17ab('0x2c')](_0x531ee6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x17ab('0x2d'));})['finally'](function(){process[_0x17ab('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa8af=['analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','split','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.csv','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','lodash','to-csv','bluebird','../../mysqldb','dbH','../../config/logger'];(function(_0x43e22e,_0x45ae78){var _0x1e5059=function(_0x1d3f94){while(--_0x1d3f94){_0x43e22e['push'](_0x43e22e['shift']());}};_0x1e5059(++_0x45ae78);}(_0xa8af,0x83));var _0xfa8a=function(_0x578bee,_0x514615){_0x578bee=_0x578bee-0x0;var _0x3f8188=_0xa8af[_0x578bee];return _0x3f8188;};'use strict';var util=require(_0xfa8a('0x0'));var path=require('path');var _=require(_0xfa8a('0x1'));var csv=require(_0xfa8a('0x2'));var fs=require('fs');var BPromise=require(_0xfa8a('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xfa8a('0x4'))['db'];var dbH=require(_0xfa8a('0x4'))[_0xfa8a('0x5')];var logger=require(_0xfa8a('0x6'))(_0xfa8a('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xfa8a('0x8')][0x2]);var QUERY=process[_0xfa8a('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa0d050,_0x5ca393){var _0x5bc2ed={'status':_0xa0d050};var _0xb0ac1d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5ca393){_0x5bc2ed[_0xfa8a('0x9')]=_0x5ca393;}return db[_0xfa8a('0xa')][_0xfa8a('0xb')](_0x5bc2ed,_0xb0ac1d);}function main(){var _0xc686c7=0x1388;var _0x132403;logger['info'](util['format'](_0xfa8a('0xc'),EXTRACTED_REPORT_ID,_0xfa8a('0xd')));return db[_0xfa8a('0xe')][_0xfa8a('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xfa8a('0x10')]})[_0xfa8a('0x11')](function(_0x13a7b){if(_0x13a7b){_0x132403=_0x13a7b;_0xc686c7=_0x132403['splitSizeCsv']||0x1388;}})[_0xfa8a('0x11')](function(){return dbH[_0xfa8a('0x12')][_0xfa8a('0x13')](util[_0xfa8a('0x14')](_0xfa8a('0x15'),QUERY),{'type':dbH[_0xfa8a('0x12')][_0xfa8a('0x16')]['SELECT']});})[_0xfa8a('0x11')](function(_0x2b756d){if(!_0x2b756d[0x0][_0xfa8a('0x17')]){return analyticExtractedReport(_0xfa8a('0x18'));}var _0x2e7e25=[];var _0xe3904e=0x0;if(_0x132403[_0xfa8a('0x19')]){if(_0x2b756d&&_0x2b756d[_0xfa8a('0x1a')]){var _0x19c54b=_[_0xfa8a('0x1b')](_0x2b756d[0x0][_0xfa8a('0x17')]/_0xc686c7);var _0x27b967=Number[_0xfa8a('0x1c')](_0x2b756d[0x0][_0xfa8a('0x17')]/_0xc686c7)?_0x2b756d[0x0][_0xfa8a('0x17')]%_0xc686c7:0x0;_0x19c54b['forEach'](function(_0x3fc591){if(_0x3fc591>0x0){_0xe3904e+=_0xc686c7;}_0x2e7e25[_0xfa8a('0x1d')](dbH[_0xfa8a('0x12')][_0xfa8a('0x13')](util['format'](_0xfa8a('0x1e'),QUERY,_0xc686c7,_0xe3904e),{'type':dbH['sequelize'][_0xfa8a('0x16')][_0xfa8a('0x1f')]}));});if(_0x27b967>0x0){_0xe3904e+=_0xc686c7;_0x2e7e25[_0xfa8a('0x1d')](dbH['sequelize']['query'](util[_0xfa8a('0x14')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x27b967,_0xe3904e),{'type':dbH[_0xfa8a('0x12')]['QueryTypes'][_0xfa8a('0x1f')]}));}}}else{_0x2e7e25[_0xfa8a('0x1d')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xfa8a('0x12')][_0xfa8a('0x16')][_0xfa8a('0x1f')]}));}var _0x504999=path[_0xfa8a('0x20')](PATH);var _0x13e133=path['basename'](PATH,_0xfa8a('0x21'));var _0x36fcc9=_0x132403[_0xfa8a('0x19')]&&_0x2e7e25[_0xfa8a('0x1a')]>0x1;var _0x337e1d=[];if(!fs[_0xfa8a('0x22')](path[_0xfa8a('0x23')](_0x504999,_0x13e133))&&_0x36fcc9){fs['mkdirSync'](path['join'](_0x504999,_0x13e133));}return BPromise['each'](_0x2e7e25,function(_0x4dc411){_0x337e1d[_0xfa8a('0x1d')](_0x4dc411);})[_0xfa8a('0x11')](function(){for(var _0x1ecc14=0x0;_0x1ecc14<_0x337e1d[_0xfa8a('0x1a')];_0x1ecc14+=0x1){var _0x2fb25d;var _0x52ec13=_0x337e1d[_0x1ecc14];if(_0x36fcc9){_0x2fb25d=path['join'](_0x504999,_0x13e133,util[_0xfa8a('0x14')](_0xfa8a('0x24'),_0x13e133,_0x1ecc14,_0xfa8a('0x25')));}else{_0x2fb25d=path[_0xfa8a('0x23')](_0x504999,util[_0xfa8a('0x14')](_0xfa8a('0x26'),_0x13e133,_0xfa8a('0x25')));}fs[_0xfa8a('0x27')](_0x2fb25d,csv(_0x52ec13));}})[_0xfa8a('0x11')](function(){if(_0x36fcc9){return new Promise(function(_0x4c5448){zipdir(path[_0xfa8a('0x23')](_0x504999,_0x13e133),{'saveTo':path[_0xfa8a('0x23')](_0x504999,util[_0xfa8a('0x14')](_0xfa8a('0x26'),_0x13e133,_0xfa8a('0x28')))},function(_0xa730a8,_0x16ae0){rimraf(path[_0xfa8a('0x23')](_0x504999,_0x13e133),function(){});_0x4c5448(_0xfa8a('0x29'));});});}})[_0xfa8a('0x11')](function(){logger[_0xfa8a('0x2a')](util[_0xfa8a('0x14')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xfa8a('0xd')));return analyticExtractedReport('Completed',_0x36fcc9?util[_0xfa8a('0x14')](_0xfa8a('0x26'),_0x13e133,_0x36fcc9?_0xfa8a('0x28'):_0xfa8a('0x25')):null);});})['catch'](function(_0x2d95b2){logger[_0xfa8a('0x2a')](util['format'](_0xfa8a('0x2b'),EXTRACTED_REPORT_ID,_0xfa8a('0xd')),util['inspect'](_0x2d95b2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfa8a('0x2c'));})[_0xfa8a('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index a6cae66..94bf4d9 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 _0x5ece=['split','splitSizePdf','then','num','isInteger','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','tableHeader','map','pick','value','fill','length','auto','body','push','concat','chunk','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','format','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','Empty','Setting','find'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x5ece,0x13c));var _0xe5ec=function(_0x25340e,_0x28078d){_0x25340e=_0x25340e-0x0;var _0x4fb042=_0x5ece[_0x25340e];return _0x4fb042;};'use strict';var _=require(_0xe5ec('0x0'));var fs=require('fs');var util=require(_0xe5ec('0x1'));var path=require(_0xe5ec('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xe5ec('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xe5ec('0x4'));var rimraf=require(_0xe5ec('0x5'));var JSDOM=require(_0xe5ec('0x6'))[_0xe5ec('0x7')];var window=new JSDOM('')[_0xe5ec('0x8')];var BPromise=require(_0xe5ec('0x9'));var db=require(_0xe5ec('0xa'))['db'];var dbH=require(_0xe5ec('0xa'))[_0xe5ec('0xb')];var logger=require('../../config/logger')(_0xe5ec('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xe5ec('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xe5ec('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a0341,_0x3d1b72){var _0x489d2f={'status':_0x4a0341};var _0x3e0a01={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3d1b72){_0x489d2f[_0xe5ec('0xe')]=_0x3d1b72;}return db[_0xe5ec('0xf')][_0xe5ec('0x10')](_0x489d2f,_0x3e0a01);}function getHeaders(_0x2ae855){return _['map'](_0x2ae855,function(_0x3dea48){return{'text':_0x3dea48,'style':_0xe5ec('0x11')};});}function getRows(_0x2b8bf5,_0x2614d8){return _[_0xe5ec('0x12')](_0x2614d8,function(_0xede119){return _(_0xede119)[_0xe5ec('0x13')](_0x2b8bf5)[_0xe5ec('0x12')](function(_0x219da7){return _0x219da7?_['toString'](_0x219da7):'';})[_0xe5ec('0x14')]();});}function createTable(_0x33ca5d,_0x325c97){var _0x36bcd3={'widths':_[_0xe5ec('0x15')](Array(_0x33ca5d[_0xe5ec('0x16')]),0x91),'heights':function(_0x218b24){return _0x218b24===0x0?_0xe5ec('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x27762e=getHeaders(_0x33ca5d);_0x36bcd3[_0xe5ec('0x18')][_0xe5ec('0x19')](_0x27762e);var _0x2e5f78=getRows(_0x33ca5d,_0x325c97);_0x36bcd3[_0xe5ec('0x18')]=_0x36bcd3[_0xe5ec('0x18')][_0xe5ec('0x1a')](_0x2e5f78);return _0x36bcd3;}function createTables(_0x17b597){var _0x1c06aa=[];var _0x3098a0=_[_0xe5ec('0x1b')](Object['keys'](_0x17b597[0x0]),0x5);_0x3098a0['forEach'](function(_0x21d1e8){_0x1c06aa[_0xe5ec('0x19')](createTable(_0x21d1e8,_0x17b597));});return _0x1c06aa;}function getPDFDocDefinition(_0x5dfd41){var _0x4be163=util['format'](_0xe5ec('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xe5ec('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xe5ec('0x1e')])[_0xe5ec('0x1d')](FORMAT));var _0x7691fa=[];for(var _0x3efa63=0x0;_0x3efa63<_0x5dfd41[_0xe5ec('0x16')];_0x3efa63++){var _0x499247=[];if(_0x3efa63===0x0){_0x499247[_0xe5ec('0x19')]({'text':_0x4be163,'style':_0xe5ec('0x1f')});}var _0xeb0356={'table':_0x5dfd41[_0x3efa63]};if(_0x3efa63>0x0){_0xeb0356[_0xe5ec('0x20')]=_0xe5ec('0x21');_0xeb0356[_0xe5ec('0x22')]=[0x0,0x46,0x0,0x0];}_0x499247['push'](_0xeb0356);_0x7691fa[_0xe5ec('0x19')](_0x499247);}return{'pageSize':'A4','pageOrientation':_0xe5ec('0x23'),'content':_0x7691fa,'footer':function(_0x470be8,_0x31a928){return{'text':_0x470be8[_0xe5ec('0x24')]()+_0xe5ec('0x25')+_0x31a928,'style':_0xe5ec('0x26')};},'defaultStyle':{'font':_0xe5ec('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe5ec('0x28')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x514d0b){var _0x4e9d5c=0x1388;var _0xd35770;if(!_0x514d0b[0x0]['num']){return analyticExtractedReport(_0xe5ec('0x29'));}return db[_0xe5ec('0x2a')][_0xe5ec('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe5ec('0x2c'),_0xe5ec('0x2d')]})[_0xe5ec('0x2e')](function(_0x2db43a){if(_0x2db43a){_0xd35770=_0x2db43a;_0x4e9d5c=_0xd35770['splitSizePdf']||0x3e8;}})[_0xe5ec('0x2e')](function(){var _0x3c25bd=[];var _0x343ef2=0x0;if(_0xd35770[_0xe5ec('0x2c')]){if(_0x514d0b&&_0x514d0b[_0xe5ec('0x16')]){var _0x2fc2b8=_['range'](_0x514d0b[0x0][_0xe5ec('0x2f')]/_0x4e9d5c);var _0x57b1fb=Number[_0xe5ec('0x30')](_0x514d0b[0x0][_0xe5ec('0x2f')]/_0x4e9d5c)?_0x514d0b[0x0][_0xe5ec('0x2f')]%_0x4e9d5c:0x0;_0x2fc2b8['forEach'](function(_0xf34323){if(_0xf34323>0x0){_0x343ef2+=_0x4e9d5c;}_0x3c25bd[_0xe5ec('0x19')](dbH['sequelize'][_0xe5ec('0x31')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4e9d5c,_0x343ef2),{'type':dbH[_0xe5ec('0x32')][_0xe5ec('0x33')][_0xe5ec('0x34')]}));});if(_0x57b1fb>0x0){_0x343ef2+=_0x4e9d5c;_0x3c25bd[_0xe5ec('0x19')](dbH[_0xe5ec('0x32')][_0xe5ec('0x31')](util[_0xe5ec('0x1d')](_0xe5ec('0x35'),QUERY,_0x57b1fb,_0x343ef2),{'type':dbH[_0xe5ec('0x32')][_0xe5ec('0x33')][_0xe5ec('0x34')]}));}}}else{_0x3c25bd[_0xe5ec('0x19')](dbH[_0xe5ec('0x32')][_0xe5ec('0x31')](QUERY,{'type':dbH[_0xe5ec('0x32')][_0xe5ec('0x33')][_0xe5ec('0x34')]}));}var _0x10628d=path['dirname'](PATH);var _0x5026bf=path[_0xe5ec('0x36')](PATH,_0xe5ec('0x37'));var _0x5dec60=_0xd35770[_0xe5ec('0x2c')]&&_0x3c25bd[_0xe5ec('0x16')]>0x1;var _0xffd53c=[];if(!fs[_0xe5ec('0x38')](path[_0xe5ec('0x39')](_0x10628d,_0x5026bf))&&_0x5dec60){fs[_0xe5ec('0x3a')](path[_0xe5ec('0x39')](_0x10628d,_0x5026bf));}return BPromise[_0xe5ec('0x3b')](_0x3c25bd,function(_0x21bbc1){_0xffd53c[_0xe5ec('0x19')](_0x21bbc1);})[_0xe5ec('0x2e')](function(){var _0x5651f2=[];for(var _0x3acd64=0x0;_0x3acd64<_0xffd53c['length'];_0x3acd64+=0x1){var _0x15fae2=_0xffd53c[_0x3acd64];var _0x14c7d5=createTables(_[_0xe5ec('0x3c')](_0x15fae2));var _0x1bf984;var _0x2f37d7=getPDFDocDefinition(_0x14c7d5);var _0x2525b4=getPDFPrinter();var _0x4c0c37=_0x2525b4[_0xe5ec('0x3d')](_0x2f37d7);if(_0x5dec60){_0x1bf984=path[_0xe5ec('0x39')](_0x10628d,_0x5026bf,util[_0xe5ec('0x1d')]('%s%d.%s',_0x5026bf,_0x3acd64,_0xe5ec('0x3e')));}else{_0x1bf984=path[_0xe5ec('0x39')](_0x10628d,util[_0xe5ec('0x1d')](_0xe5ec('0x3f'),_0x5026bf,_0xe5ec('0x3e')));}_0x5651f2[_0xe5ec('0x19')](writePDFDocument(_0x4c0c37,_0x1bf984));}return Promise[_0xe5ec('0x40')](_0x5651f2);})[_0xe5ec('0x2e')](function(){if(_0x5dec60){return new Promise(function(_0x52d7b7){zipdir(path[_0xe5ec('0x39')](_0x10628d,_0x5026bf),{'saveTo':path['join'](_0x10628d,util[_0xe5ec('0x1d')](_0xe5ec('0x3f'),_0x5026bf,_0xe5ec('0x41')))},function(){rimraf(path[_0xe5ec('0x39')](_0x10628d,_0x5026bf),function(){});_0x52d7b7(_0xe5ec('0x42'));});});}})['then'](function(){if(!_0x5dec60)return;rimraf(path[_0xe5ec('0x39')](_0x10628d,_0x5026bf),function(){});})['then'](function(){logger['info'](util[_0xe5ec('0x1d')](_0xe5ec('0x43'),EXTRACTED_REPORT_ID,_0xe5ec('0x44')));return analyticExtractedReport(_0xe5ec('0x45'),_0x5dec60?util[_0xe5ec('0x1d')](_0xe5ec('0x3f'),_0x5026bf,_0x5dec60?_0xe5ec('0x41'):_0xe5ec('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe5ec('0x46')](util[_0xe5ec('0x1d')](_0xe5ec('0x47'),EXTRACTED_REPORT_ID,_0xe5ec('0x44')));return db[_0xe5ec('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe5ec('0x2e')](function(_0x1916a3){EXTRACTED_REPORT=_0x1916a3;return dbH[_0xe5ec('0x32')][_0xe5ec('0x31')](util[_0xe5ec('0x1d')](_0xe5ec('0x48'),QUERY),{'type':dbH[_0xe5ec('0x32')]['QueryTypes'][_0xe5ec('0x34')]});})[_0xe5ec('0x2e')](extractReport)[_0xe5ec('0x49')](function(_0xd49638){logger[_0xe5ec('0x46')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe5ec('0x44')),util[_0xe5ec('0x4a')](_0xd49638,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xe5ec('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x481556=new PdfPrinter({'Arial':{'normal':__dirname+_0xe5ec('0x4c'),'bold':__dirname+_0xe5ec('0x4d'),'italics':__dirname+_0xe5ec('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x481556;}function getPDFDocDefinitionFromHTML(_0x65356e,_0x35951d){var _0x21d93a=util[_0xe5ec('0x1d')](_0xe5ec('0x4f'),_0x35951d[_0xe5ec('0x50')],_0x35951d[_0xe5ec('0x51')]);var _0x4d67fe=moment()['format'](_0xe5ec('0x52'))[_0xe5ec('0x24')]();var _0x217b52=htmlToPdfmake(_0x65356e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x217b52],'defaultStyle':{'font':_0xe5ec('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xe5ec('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe5ec('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xe5ec('0x1f')}];},'footer':function(_0x2b13bd,_0x1515fb){return[{'text':util[_0xe5ec('0x1d')](_0xe5ec('0x54'),_0x21d93a,_0x2b13bd,_0x1515fb,_0x4d67fe),'style':'footer'}];}};}function writePDFDocument(_0x336fea,_0x1697e4){return new Promise(function(_0xcca817,_0x5c0c07){var _0x417251=_0x336fea[_0xe5ec('0x55')](fs[_0xe5ec('0x56')](_0x1697e4));_0x417251['on'](_0xe5ec('0x57'),function(){_0xcca817('finish');});_0x417251['on']('error',function(_0x4fc404){_0x5c0c07(_0x4fc404);});_0x336fea[_0xe5ec('0x58')]();});}exports[_0xe5ec('0x59')]=function(_0x512d84,_0x700fb0){var _0x4eb312=getPDFPrinter();var _0xff863=getPDFDocDefinitionFromHTML(_0x512d84,_0x700fb0);var _0xfa97a0=_0x4eb312[_0xe5ec('0x3d')](_0xff863);return writePDFDocument(_0xfa97a0,_0x700fb0[_0xe5ec('0x2')])[_0xe5ec('0x49')](function(_0x5c1107){throw _0x5c1107;});}; \ No newline at end of file +var _0x766c=['argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','landscape','\x20/\x20','right','num','find','splitSizePdf','then','range','isInteger','forEach','sequelize','query','QueryTypes','SELECT','.pdf','split','join','mkdirSync','each','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x766c,0x1a6));var _0xc766=function(_0x19159d,_0x3d05c8){_0x19159d=_0x19159d-0x0;var _0x35884a=_0x766c[_0x19159d];return _0x35884a;};'use strict';var _=require(_0xc766('0x0'));var fs=require('fs');var util=require(_0xc766('0x1'));var path=require(_0xc766('0x2'));var moment=require(_0xc766('0x3'));var htmlToPdfmake=require(_0xc766('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xc766('0x5'));var rimraf=require(_0xc766('0x6'));var JSDOM=require('jsdom')[_0xc766('0x7')];var window=new JSDOM('')[_0xc766('0x8')];var BPromise=require(_0xc766('0x9'));var db=require(_0xc766('0xa'))['db'];var dbH=require(_0xc766('0xa'))['dbH'];var logger=require(_0xc766('0xb'))(_0xc766('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xc766('0xd')][0x2]);var QUERY=process[_0xc766('0xd')][0x3];var PATH=process[_0xc766('0xd')][0x4];var NAME=process[_0xc766('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x18a3d7,_0x3260ef){var _0xa25570={'status':_0x18a3d7};var _0x5785c4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3260ef){_0xa25570[_0xc766('0xe')]=_0x3260ef;}return db[_0xc766('0xf')][_0xc766('0x10')](_0xa25570,_0x5785c4);}function getHeaders(_0x42ad75){return _[_0xc766('0x11')](_0x42ad75,function(_0x54a370){return{'text':_0x54a370,'style':_0xc766('0x12')};});}function getRows(_0x12a1a6,_0x294d3b){return _[_0xc766('0x11')](_0x294d3b,function(_0x1f7a04){return _(_0x1f7a04)[_0xc766('0x13')](_0x12a1a6)[_0xc766('0x11')](function(_0x187949){return _0x187949?_[_0xc766('0x14')](_0x187949):'';})[_0xc766('0x15')]();});}function createTable(_0x1fc632,_0x57065b){var _0x1d9f53={'widths':_[_0xc766('0x16')](Array(_0x1fc632[_0xc766('0x17')]),0x91),'heights':function(_0x3532a3){return _0x3532a3===0x0?_0xc766('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x11ce5f=getHeaders(_0x1fc632);_0x1d9f53[_0xc766('0x19')][_0xc766('0x1a')](_0x11ce5f);var _0x4a7ff4=getRows(_0x1fc632,_0x57065b);_0x1d9f53[_0xc766('0x19')]=_0x1d9f53['body'][_0xc766('0x1b')](_0x4a7ff4);return _0x1d9f53;}function createTables(_0x250077){var _0x11216c=[];var _0x5c756d=_[_0xc766('0x1c')](Object[_0xc766('0x1d')](_0x250077[0x0]),0x5);_0x5c756d['forEach'](function(_0x24e713){_0x11216c['push'](createTable(_0x24e713,_0x250077));});return _0x11216c;}function getPDFDocDefinition(_0x30bea8){var _0x41757b=util[_0xc766('0x1e')](_0xc766('0x1f'),NAME,EXTRACTED_REPORT[_0xc766('0x20')],moment(EXTRACTED_REPORT[_0xc766('0x21')])[_0xc766('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xc766('0x22')])['format'](FORMAT));var _0x2b2a52=[];for(var _0x3a48cc=0x0;_0x3a48cc<_0x30bea8[_0xc766('0x17')];_0x3a48cc++){var _0x2627e4=[];if(_0x3a48cc===0x0){_0x2627e4[_0xc766('0x1a')]({'text':_0x41757b,'style':_0xc766('0x23')});}var _0x52c899={'table':_0x30bea8[_0x3a48cc]};if(_0x3a48cc>0x0){_0x52c899[_0xc766('0x24')]=_0xc766('0x25');_0x52c899['margin']=[0x0,0x46,0x0,0x0];}_0x2627e4['push'](_0x52c899);_0x2b2a52[_0xc766('0x1a')](_0x2627e4);}return{'pageSize':'A4','pageOrientation':_0xc766('0x26'),'content':_0x2b2a52,'footer':function(_0x1e7c52,_0x1bf076){return{'text':_0x1e7c52[_0xc766('0x14')]()+_0xc766('0x27')+_0x1bf076,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xc766('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x35de51){var _0x4da365=0x1388;var _0x42190f;if(!_0x35de51[0x0][_0xc766('0x29')]){return analyticExtractedReport('Empty');}return db['Setting'][_0xc766('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xc766('0x2b')]})[_0xc766('0x2c')](function(_0x4bb98e){if(_0x4bb98e){_0x42190f=_0x4bb98e;_0x4da365=_0x42190f[_0xc766('0x2b')]||0x3e8;}})[_0xc766('0x2c')](function(){var _0x3fdc4a=[];var _0x10ea05=0x0;if(_0x42190f['split']){if(_0x35de51&&_0x35de51[_0xc766('0x17')]){var _0x33cfa9=_[_0xc766('0x2d')](_0x35de51[0x0][_0xc766('0x29')]/_0x4da365);var _0x4b1353=Number[_0xc766('0x2e')](_0x35de51[0x0]['num']/_0x4da365)?_0x35de51[0x0][_0xc766('0x29')]%_0x4da365:0x0;_0x33cfa9[_0xc766('0x2f')](function(_0x2263ef){if(_0x2263ef>0x0){_0x10ea05+=_0x4da365;}_0x3fdc4a[_0xc766('0x1a')](dbH[_0xc766('0x30')][_0xc766('0x31')](util[_0xc766('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4da365,_0x10ea05),{'type':dbH[_0xc766('0x30')][_0xc766('0x32')][_0xc766('0x33')]}));});if(_0x4b1353>0x0){_0x10ea05+=_0x4da365;_0x3fdc4a[_0xc766('0x1a')](dbH[_0xc766('0x30')][_0xc766('0x31')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4b1353,_0x10ea05),{'type':dbH[_0xc766('0x30')]['QueryTypes'][_0xc766('0x33')]}));}}}else{_0x3fdc4a[_0xc766('0x1a')](dbH[_0xc766('0x30')][_0xc766('0x31')](QUERY,{'type':dbH['sequelize'][_0xc766('0x32')][_0xc766('0x33')]}));}var _0x363ee1=path['dirname'](PATH);var _0x264d4c=path['basename'](PATH,_0xc766('0x34'));var _0x1d2dc9=_0x42190f[_0xc766('0x35')]&&_0x3fdc4a[_0xc766('0x17')]>0x1;var _0x4abd47=[];if(!fs['existsSync'](path[_0xc766('0x36')](_0x363ee1,_0x264d4c))&&_0x1d2dc9){fs[_0xc766('0x37')](path[_0xc766('0x36')](_0x363ee1,_0x264d4c));}return BPromise[_0xc766('0x38')](_0x3fdc4a,function(_0x4a6d4d){_0x4abd47[_0xc766('0x1a')](_0x4a6d4d);})['then'](function(){var _0x8a3231=[];for(var _0x67430d=0x0;_0x67430d<_0x4abd47['length'];_0x67430d+=0x1){var _0x43e6e3=_0x4abd47[_0x67430d];var _0x43aa01=createTables(_['flatten'](_0x43e6e3));var _0x557b8b;var _0x4a0352=getPDFDocDefinition(_0x43aa01);var _0xa717fe=getPDFPrinter();var _0x18750e=_0xa717fe[_0xc766('0x39')](_0x4a0352);if(_0x1d2dc9){_0x557b8b=path[_0xc766('0x36')](_0x363ee1,_0x264d4c,util[_0xc766('0x1e')]('%s%d.%s',_0x264d4c,_0x67430d,_0xc766('0x3a')));}else{_0x557b8b=path['join'](_0x363ee1,util[_0xc766('0x1e')](_0xc766('0x3b'),_0x264d4c,_0xc766('0x3a')));}_0x8a3231[_0xc766('0x1a')](writePDFDocument(_0x18750e,_0x557b8b));}return Promise[_0xc766('0x3c')](_0x8a3231);})['then'](function(){if(_0x1d2dc9){return new Promise(function(_0x479ad8){zipdir(path[_0xc766('0x36')](_0x363ee1,_0x264d4c),{'saveTo':path['join'](_0x363ee1,util[_0xc766('0x1e')]('%s.%s',_0x264d4c,_0xc766('0x3d')))},function(){rimraf(path[_0xc766('0x36')](_0x363ee1,_0x264d4c),function(){});_0x479ad8(_0xc766('0x3e'));});});}})[_0xc766('0x2c')](function(){if(!_0x1d2dc9)return;rimraf(path['join'](_0x363ee1,_0x264d4c),function(){});})[_0xc766('0x2c')](function(){logger[_0xc766('0x3f')](util[_0xc766('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xc766('0x40')));return analyticExtractedReport(_0xc766('0x41'),_0x1d2dc9?util[_0xc766('0x1e')]('%s.%s',_0x264d4c,_0x1d2dc9?'zip':_0xc766('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc766('0x3f')](util[_0xc766('0x1e')](_0xc766('0x42'),EXTRACTED_REPORT_ID,_0xc766('0x40')));return db[_0xc766('0xf')][_0xc766('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc766('0x2c')](function(_0x1ce861){EXTRACTED_REPORT=_0x1ce861;return dbH[_0xc766('0x30')][_0xc766('0x31')](util[_0xc766('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc766('0x30')][_0xc766('0x32')][_0xc766('0x33')]});})[_0xc766('0x2c')](extractReport)[_0xc766('0x44')](function(_0x49ab58){logger[_0xc766('0x3f')](util['format'](_0xc766('0x45'),EXTRACTED_REPORT_ID,_0xc766('0x40')),util[_0xc766('0x46')](_0x49ab58,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc766('0x47'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5d7c41=new PdfPrinter({'Arial':{'normal':__dirname+_0xc766('0x48'),'bold':__dirname+_0xc766('0x49'),'italics':__dirname+_0xc766('0x4a'),'bolditalics':__dirname+_0xc766('0x4b')}});return _0x5d7c41;}function getPDFDocDefinitionFromHTML(_0x4ea568,_0x512de3){var _0xb9f7bc=util[_0xc766('0x1e')](_0xc766('0x4c'),_0x512de3[_0xc766('0x4d')],_0x512de3[_0xc766('0x4e')]);var _0x23cfe7=moment()[_0xc766('0x1e')]('YYYY-MM-DD')[_0xc766('0x14')]();var _0x286b34=htmlToPdfmake(_0x4ea568,{'window':window,'tableAutoSize':!![]});return{'content':[_0x286b34],'defaultStyle':{'font':_0xc766('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc766('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc766('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xc766('0x51'),'style':_0xc766('0x23')}];},'footer':function(_0x43e68f,_0x33ab02){return[{'text':util[_0xc766('0x1e')](_0xc766('0x52'),_0xb9f7bc,_0x43e68f,_0x33ab02,_0x23cfe7),'style':'footer'}];}};}function writePDFDocument(_0x147372,_0x38a506){return new Promise(function(_0x1ac8dd,_0x3fd924){var _0x207d84=_0x147372['pipe'](fs[_0xc766('0x53')](_0x38a506));_0x207d84['on'](_0xc766('0x54'),function(){_0x1ac8dd('finish');});_0x207d84['on'](_0xc766('0x55'),function(_0x324ca5){_0x3fd924(_0x324ca5);});_0x147372['end']();});}exports[_0xc766('0x56')]=function(_0x54fb77,_0x1ee798){var _0xaa523f=getPDFPrinter();var _0x331b42=getPDFDocDefinitionFromHTML(_0x54fb77,_0x1ee798);var _0x4da975=_0xaa523f[_0xc766('0x39')](_0x331b42);return writePDFDocument(_0x4da975,_0x1ee798[_0xc766('0x2')])['catch'](function(_0x386fb1){throw _0x386fb1;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 077f11f..7a93bea 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 _0x1e59=['../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','forEach','push','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','zip','inspect','Failed','finally','exit','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x2add5b,_0x1529b3){var _0x442aeb=function(_0x5b5d28){while(--_0x5b5d28){_0x2add5b['push'](_0x2add5b['shift']());}};_0x442aeb(++_0x1529b3);}(_0x1e59,0x97));var _0x91e5=function(_0xf532fa,_0x3a939a){_0xf532fa=_0xf532fa-0x0;var _0x18203d=_0x1e59[_0xf532fa];return _0x18203d;};'use strict';var util=require(_0x91e5('0x0'));var path=require(_0x91e5('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x91e5('0x2'));var BPromise=require(_0x91e5('0x3'));var zipdir=require(_0x91e5('0x4'));var rimraf=require(_0x91e5('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x91e5('0x6'))[_0x91e5('0x7')];var logger=require(_0x91e5('0x8'))(_0x91e5('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x91e5('0xa')][0x2]);var QUERY=process[_0x91e5('0xa')][0x3];var PATH=process[_0x91e5('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1b7c0c,_0x20bf5f){var _0x1a6157={'status':_0x1b7c0c};var _0x356709={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x20bf5f){_0x1a6157[_0x91e5('0xb')]=_0x20bf5f;}return db[_0x91e5('0xc')][_0x91e5('0xd')](_0x1a6157,_0x356709);}function main(){var _0xf44707=0x1388;var _0x123941;logger[_0x91e5('0xe')](util[_0x91e5('0xf')](_0x91e5('0x10'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x91e5('0x11')][_0x91e5('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x91e5('0x13'),_0x91e5('0x14')]})['then'](function(_0x1e0770){if(_0x1e0770){_0x123941=_0x1e0770;_0xf44707=_0x123941[_0x91e5('0x14')]||0x1388;}})[_0x91e5('0x15')](function(){return dbH[_0x91e5('0x16')][_0x91e5('0x17')](util[_0x91e5('0xf')](_0x91e5('0x18'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x91e5('0x15')](function(_0x1a4033){if(!_0x1a4033[0x0][_0x91e5('0x19')]){return analyticExtractedReport(_0x91e5('0x1a'));}var _0x30eb97=[];var _0x2c6ab7=0x0;if(_0x123941[_0x91e5('0x13')]){if(_0x1a4033&&_0x1a4033[_0x91e5('0x1b')]){var _0x28c75c=_[_0x91e5('0x1c')](_0x1a4033[0x0]['num']/_0xf44707);var _0xbaefae=Number['isInteger'](_0x1a4033[0x0][_0x91e5('0x19')]/_0xf44707)?_0x1a4033[0x0][_0x91e5('0x19')]%_0xf44707:0x0;_0x28c75c[_0x91e5('0x1d')](function(_0x343629){if(_0x343629>0x0){_0x2c6ab7+=_0xf44707;}_0x30eb97[_0x91e5('0x1e')](dbH[_0x91e5('0x16')]['query'](util[_0x91e5('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xf44707,_0x2c6ab7),{'type':dbH[_0x91e5('0x16')][_0x91e5('0x1f')][_0x91e5('0x20')]}));});if(_0xbaefae>0x0){_0x2c6ab7+=_0xf44707;_0x30eb97[_0x91e5('0x1e')](dbH['sequelize']['query'](util[_0x91e5('0xf')](_0x91e5('0x21'),QUERY,_0xbaefae,_0x2c6ab7),{'type':dbH[_0x91e5('0x16')][_0x91e5('0x1f')][_0x91e5('0x20')]}));}}}else{_0x30eb97[_0x91e5('0x1e')](dbH['sequelize'][_0x91e5('0x17')](QUERY,{'type':dbH[_0x91e5('0x16')][_0x91e5('0x1f')]['SELECT']}));}var _0x214d01=path[_0x91e5('0x22')](PATH);var _0x461b42=path['basename'](PATH,_0x91e5('0x23'));var _0x5c6aeb=_0x123941[_0x91e5('0x13')]&&_0x30eb97[_0x91e5('0x1b')]>0x1;var _0x40b8dd=[];if(!fs[_0x91e5('0x24')](path[_0x91e5('0x25')](_0x214d01,_0x461b42))&&_0x5c6aeb){fs[_0x91e5('0x26')](path[_0x91e5('0x25')](_0x214d01,_0x461b42));}return BPromise[_0x91e5('0x27')](_0x30eb97,function(_0x5b610b){_0x40b8dd[_0x91e5('0x1e')](_0x5b610b);})[_0x91e5('0x15')](function(){for(var _0x238f06=0x0;_0x238f06<_0x40b8dd[_0x91e5('0x1b')];_0x238f06+=0x1){var _0x16d0e2;var _0x36223e=_0x40b8dd[_0x238f06];if(_0x5c6aeb){_0x16d0e2=path[_0x91e5('0x25')](_0x214d01,_0x461b42,util[_0x91e5('0xf')](_0x91e5('0x28'),_0x461b42,_0x238f06,'xlsx'));}else{_0x16d0e2=path[_0x91e5('0x25')](_0x214d01,util[_0x91e5('0xf')](_0x91e5('0x29'),_0x461b42,_0x91e5('0x2a')));}fs[_0x91e5('0x2b')](_0x16d0e2,json2xls(_0x36223e),_0x91e5('0x2c'));}})['then'](function(){if(_0x5c6aeb){return new Promise(function(_0x4ffc2f){zipdir(path['join'](_0x214d01,_0x461b42),{'saveTo':path[_0x91e5('0x25')](_0x214d01,util[_0x91e5('0xf')](_0x91e5('0x29'),_0x461b42,'zip'))},function(_0x26d907,_0x396a07){rimraf(path[_0x91e5('0x25')](_0x214d01,_0x461b42),function(){});_0x4ffc2f('zip\x20finished');});});}})['then'](function(){logger[_0x91e5('0xe')](util[_0x91e5('0xf')](_0x91e5('0x2d'),EXTRACTED_REPORT_ID,_0x91e5('0x2e')));return analyticExtractedReport(_0x91e5('0x2f'),_0x5c6aeb?util[_0x91e5('0xf')](_0x91e5('0x29'),_0x461b42,_0x5c6aeb?_0x91e5('0x30'):'xlsx'):null);});})['catch'](function(_0x4d871b){logger[_0x91e5('0xe')](util[_0x91e5('0xf')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x91e5('0x2e')),util[_0x91e5('0x31')](_0x4d871b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x91e5('0x32'));})[_0x91e5('0x33')](function(){process[_0x91e5('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6969=['%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','mkdirSync','join','xlsx','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','util','json2xls','bluebird','zip-dir','rimraf','dbH','../../config/logger','analytics','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','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6969,0x1c9));var _0x9696=function(_0x2e973c,_0x25c533){_0x2e973c=_0x2e973c-0x0;var _0x29007a=_0x6969[_0x2e973c];return _0x29007a;};'use strict';var util=require(_0x9696('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x9696('0x1'));var BPromise=require(_0x9696('0x2'));var zipdir=require(_0x9696('0x3'));var rimraf=require(_0x9696('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x9696('0x5')];var logger=require(_0x9696('0x6'))(_0x9696('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9696('0x8')][0x2]);var QUERY=process[_0x9696('0x8')][0x3];var PATH=process[_0x9696('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x23ac0e,_0x5e4c72){var _0x3dc374={'status':_0x23ac0e};var _0x30a983={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e4c72){_0x3dc374[_0x9696('0x9')]=_0x5e4c72;}return db[_0x9696('0xa')][_0x9696('0xb')](_0x3dc374,_0x30a983);}function main(){var _0x1f3ae6=0x1388;var _0x4f176c;logger[_0x9696('0xc')](util[_0x9696('0xd')](_0x9696('0xe'),EXTRACTED_REPORT_ID,_0x9696('0xf')));return db[_0x9696('0x10')][_0x9696('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9696('0x12'),_0x9696('0x13')]})[_0x9696('0x14')](function(_0x3b5dda){if(_0x3b5dda){_0x4f176c=_0x3b5dda;_0x1f3ae6=_0x4f176c[_0x9696('0x13')]||0x1388;}})[_0x9696('0x14')](function(){return dbH[_0x9696('0x15')][_0x9696('0x16')](util[_0x9696('0xd')](_0x9696('0x17'),QUERY),{'type':dbH[_0x9696('0x15')][_0x9696('0x18')][_0x9696('0x19')]});})[_0x9696('0x14')](function(_0x47fefb){if(!_0x47fefb[0x0][_0x9696('0x1a')]){return analyticExtractedReport(_0x9696('0x1b'));}var _0x40abb5=[];var _0x49dfb9=0x0;if(_0x4f176c['split']){if(_0x47fefb&&_0x47fefb[_0x9696('0x1c')]){var _0x55f8f6=_[_0x9696('0x1d')](_0x47fefb[0x0]['num']/_0x1f3ae6);var _0x57ec92=Number[_0x9696('0x1e')](_0x47fefb[0x0]['num']/_0x1f3ae6)?_0x47fefb[0x0][_0x9696('0x1a')]%_0x1f3ae6:0x0;_0x55f8f6[_0x9696('0x1f')](function(_0x27c735){if(_0x27c735>0x0){_0x49dfb9+=_0x1f3ae6;}_0x40abb5[_0x9696('0x20')](dbH[_0x9696('0x15')][_0x9696('0x16')](util[_0x9696('0xd')](_0x9696('0x21'),QUERY,_0x1f3ae6,_0x49dfb9),{'type':dbH[_0x9696('0x15')]['QueryTypes'][_0x9696('0x19')]}));});if(_0x57ec92>0x0){_0x49dfb9+=_0x1f3ae6;_0x40abb5[_0x9696('0x20')](dbH[_0x9696('0x15')][_0x9696('0x16')](util[_0x9696('0xd')](_0x9696('0x21'),QUERY,_0x57ec92,_0x49dfb9),{'type':dbH[_0x9696('0x15')][_0x9696('0x18')][_0x9696('0x19')]}));}}}else{_0x40abb5[_0x9696('0x20')](dbH[_0x9696('0x15')][_0x9696('0x16')](QUERY,{'type':dbH[_0x9696('0x15')][_0x9696('0x18')][_0x9696('0x19')]}));}var _0x19590f=path[_0x9696('0x22')](PATH);var _0x2e6bec=path['basename'](PATH,_0x9696('0x23'));var _0x76a843=_0x4f176c['split']&&_0x40abb5[_0x9696('0x1c')]>0x1;var _0x15de57=[];if(!fs[_0x9696('0x24')](path['join'](_0x19590f,_0x2e6bec))&&_0x76a843){fs[_0x9696('0x25')](path[_0x9696('0x26')](_0x19590f,_0x2e6bec));}return BPromise['each'](_0x40abb5,function(_0x2e209a){_0x15de57[_0x9696('0x20')](_0x2e209a);})[_0x9696('0x14')](function(){for(var _0x2a2333=0x0;_0x2a2333<_0x15de57[_0x9696('0x1c')];_0x2a2333+=0x1){var _0x372a4f;var _0x887a8b=_0x15de57[_0x2a2333];if(_0x76a843){_0x372a4f=path['join'](_0x19590f,_0x2e6bec,util[_0x9696('0xd')]('%s%d.%s',_0x2e6bec,_0x2a2333,_0x9696('0x27')));}else{_0x372a4f=path['join'](_0x19590f,util[_0x9696('0xd')](_0x9696('0x28'),_0x2e6bec,_0x9696('0x27')));}fs[_0x9696('0x29')](_0x372a4f,json2xls(_0x887a8b),'binary');}})[_0x9696('0x14')](function(){if(_0x76a843){return new Promise(function(_0x48dcf1){zipdir(path[_0x9696('0x26')](_0x19590f,_0x2e6bec),{'saveTo':path[_0x9696('0x26')](_0x19590f,util[_0x9696('0xd')]('%s.%s',_0x2e6bec,_0x9696('0x2a')))},function(_0x5d12ed,_0x5d6d42){rimraf(path['join'](_0x19590f,_0x2e6bec),function(){});_0x48dcf1('zip\x20finished');});});}})[_0x9696('0x14')](function(){logger[_0x9696('0xc')](util[_0x9696('0xd')](_0x9696('0x2b'),EXTRACTED_REPORT_ID,_0x9696('0xf')));return analyticExtractedReport(_0x9696('0x2c'),_0x76a843?util[_0x9696('0xd')](_0x9696('0x28'),_0x2e6bec,_0x76a843?_0x9696('0x2a'):'xlsx'):null);});})[_0x9696('0x2d')](function(_0x4d7f94){logger['info'](util[_0x9696('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9696('0xf')),util[_0x9696('0x2e')](_0x4d7f94,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9696('0x2f'));})[_0x9696('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8ffa8df..d4c8c70 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 _0x87ca=['groupBy','exten','queue','playback','hasOwnProperty','extensions','extension','find','type','Set','format','CDR(type)=%s','context','priority','push','CDR(routeid)=','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','map','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','bulkCreate','catch','error','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter'];(function(_0x160ce3,_0x81b988){var _0x1cc5f0=function(_0x81352b){while(--_0x81352b){_0x160ce3['push'](_0x160ce3['shift']());}};_0x1cc5f0(++_0x81b988);}(_0x87ca,0x87));var _0xa87c=function(_0x3ba7c4,_0x17c8f2){_0x3ba7c4=_0x3ba7c4-0x0;var _0x4e48ea=_0x87ca[_0x3ba7c4];return _0x4e48ea;};'use strict';var _=require('lodash');var util=require(_0xa87c('0x0'));function rewrite(_0x5b44c4,_0x4224bd){var _0x28d0ac=this;return _0x5b44c4[_0xa87c('0x1')][_0xa87c('0x2')][_0xa87c('0x3')]({'raw':!![]})[_0xa87c('0x4')](function(_0x3dc555){_0x28d0ac[_0xa87c('0x5')]=_0x3dc555;return _0x5b44c4[_0xa87c('0x1')][_0xa87c('0x6')][_0xa87c('0x3')]({'where':{'IntervalId':_0x4224bd[_0xa87c('0x7')]},'raw':!![]});})['then'](function(_0x6d42ef){return _0x5b44c4[_0xa87c('0x1')]['VoiceExtension'][_0xa87c('0x3')]({'where':{'exten':{'$in':_[_0xa87c('0x8')](_['map'](_0x6d42ef,'exten'))}},'order':[{'raw':_0xa87c('0x9')}],'raw':!![]});})['then'](function(_0x159e37){var _0x33e509=_['filter'](_0x159e37,{'priority':'1'});var _0x35fc22=_[_0xa87c('0xa')](_0x159e37,{'isApp':0x1});var _0x38a785=_[_0xa87c('0xb')](_0x35fc22,_0xa87c('0xc'));var _0x45ef71=[_0xa87c('0xd'),_0xa87c('0xe')];var _0x5288bf=[];var _0x84fb9b=[];for(var _0x53249d in _0x38a785){if(_0x38a785[_0xa87c('0xf')](_0x53249d)){_0x28d0ac['priority']=0x2;_0x28d0ac[_0xa87c('0x10')]=[];_0x28d0ac[_0xa87c('0x11')]=_[_0xa87c('0x12')](_0x33e509,{'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')]});_0x28d0ac[_0xa87c('0x10')]['push']({'type':_0x38a785[_0x53249d][0x0][_0xa87c('0x13')],'app':_0xa87c('0x14'),'appdata':util[_0xa87c('0x15')](_0xa87c('0x16'),_0x38a785[_0x53249d][0x0][_0xa87c('0x13')]),'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0]['exten'],'priority':_0x28d0ac[_0xa87c('0x18')]++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0]['VoiceExtensionId']});if(_0x38a785[_0x53249d][0x0]['type']==='inbound'){_0x28d0ac['extensions'][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0]['type'],'app':'Set','appdata':_0xa87c('0x1a')+_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')],'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac['priority']++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});}else if(_0x38a785[_0x53249d][0x0][_0xa87c('0x13')]==='outbound'){if(_0x28d0ac[_0xa87c('0x11')]){_0x28d0ac[_0xa87c('0x10')][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0][_0xa87c('0x13')],'app':'Set','appdata':_0xa87c('0x1c')+(_0x28d0ac[_0xa87c('0x11')][_0xa87c('0x1d')]?_0xa87c('0x1e')+_0x28d0ac['extension'][_0xa87c('0x1d')]+'}':'${EXTEN}'),'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac[_0xa87c('0x18')]++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0]['VoiceExtensionId']});}_0x28d0ac['extensions']['push']({'type':_0x38a785[_0x53249d][0x0]['type'],'app':_0xa87c('0x14'),'appdata':'CDR(routeid)='+_0x38a785[_0x53249d][0x0]['VoiceExtensionId'],'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac[_0xa87c('0x18')]++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});var _0x479c5c=_0x28d0ac[_0xa87c('0x18')]++;_0x28d0ac[_0xa87c('0x10')][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0]['type'],'app':'ExecIf','appdata':_0xa87c('0x1f')+(_0x479c5c+0x2)+_0xa87c('0x20')+(_0x479c5c+0x1)+')','context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x479c5c,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});if(_0x28d0ac[_0xa87c('0x11')]){_0x28d0ac[_0xa87c('0x10')][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0]['type'],'app':_0xa87c('0x14'),'appdata':_0x28d0ac[_0xa87c('0x11')]['cutdigits']?_0xa87c('0x21')+_0x28d0ac[_0xa87c('0x11')][_0xa87c('0x1d')]+'}':_0xa87c('0x22'),'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac[_0xa87c('0x18')]++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});}_0x28d0ac[_0xa87c('0x10')][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0]['type'],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x23')+_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')],'context':_0x38a785[_0x53249d][0x0]['context'],'exten':_0x38a785[_0x53249d][0x0]['exten'],'priority':_0x28d0ac[_0xa87c('0x18')]++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});if(_0x28d0ac[_0xa87c('0x11')]&&_0x28d0ac[_0xa87c('0x11')]['hasOwnProperty'](_0xa87c('0x24'))&&_0x28d0ac[_0xa87c('0x11')][_0xa87c('0x24')]!==_0xa87c('0x25')){_0x28d0ac[_0xa87c('0x10')]['push']({'type':_0x38a785[_0x53249d][0x0]['type'],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x26'),'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac['priority']++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});_0x28d0ac[_0xa87c('0x10')][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0][_0xa87c('0x13')],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x27')+_0x28d0ac[_0xa87c('0x11')][_0xa87c('0x24')]||_0xa87c('0x28'),'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac[_0xa87c('0x18')]++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});}}_0x28d0ac['extensions'][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0][_0xa87c('0x13')],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x29'),'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0]['exten'],'priority':_0x28d0ac[_0xa87c('0x18')]++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});_0x28d0ac[_0xa87c('0x10')][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0][_0xa87c('0x13')],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x2a'),'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac['priority']++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});_0x28d0ac[_0xa87c('0x10')][_0xa87c('0x19')]({'type':_0x38a785[_0x53249d][0x0][_0xa87c('0x13')],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x2b'),'context':_0x38a785[_0x53249d][0x0]['context'],'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'priority':_0x28d0ac['priority']++,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});for(var _0x2ec32e=0x0,_0x2f5d91=0x0;_0x2ec32e<_0x38a785[_0x53249d][_0xa87c('0x2c')];_0x2ec32e+=0x1,_0x2f5d91=0x0){var _0x33b2d8=_0x38a785[_0x53249d][_0x2ec32e];if(_0x33b2d8[_0xa87c('0x13')]){_0x33b2d8[_0xa87c('0x13')]=_0x33b2d8[_0xa87c('0x13')][_0xa87c('0x2d')]();}var _0x265d55=[];var _0x18957c=[];delete _0x33b2d8['id'];delete _0x33b2d8[_0xa87c('0x2e')];delete _0x33b2d8[_0xa87c('0x2f')];var _0x77b160=_0x33b2d8['interval']!==_0xa87c('0x30')?[_0x33b2d8['interval']]:_0x33b2d8['IntervalId']?_[_0xa87c('0x31')](_['filter'](_0x28d0ac[_0xa87c('0x5')],{'IntervalId':_0x33b2d8[_0xa87c('0x7')]}),'interval'):[];if(_0x33b2d8[_0xa87c('0xf')](_0xa87c('0x32'))){if(_0x33b2d8[_0xa87c('0x32')]&&_0x33b2d8['tag']!=='--'){_0x265d55['push']({'type':_0x33b2d8[_0xa87c('0x13')],'app':'Set','appdata':_0xa87c('0x33')+_0x33b2d8[_0xa87c('0x32')],'context':_0x33b2d8[_0xa87c('0x17')],'exten':_0x33b2d8['exten'],'priority':_0x77b160[_0xa87c('0x2c')]+_0x28d0ac[_0xa87c('0x18')]+_0x2f5d91++,'VoiceExtensionId':_0x33b2d8['VoiceExtensionId']});}}if(_0x33b2d8[_0xa87c('0x13')]==='outbound'&&_0x33b2d8[_0xa87c('0xf')]('callerID')){if(_0x33b2d8[_0xa87c('0x34')]){_0x265d55[_0xa87c('0x19')]({'type':_0x33b2d8['type'],'app':_0xa87c('0x35'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x33b2d8['callerID']+')','context':_0x33b2d8['context'],'exten':_0x33b2d8['exten'],'priority':_0x77b160[_0xa87c('0x2c')]+_0x28d0ac['priority']+_0x2f5d91++,'VoiceExtensionId':_0x33b2d8[_0xa87c('0x1b')]});}else{_0x265d55[_0xa87c('0x19')]({'type':_0x33b2d8[_0xa87c('0x13')],'app':_0xa87c('0x35'),'appdata':_0xa87c('0x36'),'context':_0x33b2d8[_0xa87c('0x17')],'exten':_0x33b2d8[_0xa87c('0xc')],'priority':_0x77b160[_0xa87c('0x2c')]+_0x28d0ac['priority']+_0x2f5d91++,'VoiceExtensionId':_0x33b2d8[_0xa87c('0x1b')]});}}if(_0x33b2d8['hasOwnProperty'](_0xa87c('0x37'))){if(_0x45ef71[_0xa87c('0x38')](_0x33b2d8[_0xa87c('0x39')][_0xa87c('0x2d')]())>=0x0&&_0x33b2d8[_0xa87c('0x3a')]!==_0xa87c('0x3b')){if(_0x33b2d8[_0xa87c('0x37')]){_0x265d55['push']({'type':_0x33b2d8['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x33b2d8[_0xa87c('0x17')],'exten':_0x33b2d8['exten'],'priority':_0x77b160['length']+_0x28d0ac[_0xa87c('0x18')]+_0x2f5d91++,'VoiceExtensionId':_0x33b2d8[_0xa87c('0x1b')]});_0x265d55[_0xa87c('0x19')]({'type':_0x33b2d8[_0xa87c('0x13')],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x3c'),'context':_0x33b2d8[_0xa87c('0x17')],'exten':_0x33b2d8[_0xa87c('0xc')],'priority':_0x77b160[_0xa87c('0x2c')]+_0x28d0ac[_0xa87c('0x18')]+_0x2f5d91++,'VoiceExtensionId':_0x33b2d8[_0xa87c('0x1b')]});}else{_0x265d55['push']({'type':_0x33b2d8[_0xa87c('0x13')],'app':_0xa87c('0x35'),'appdata':_0xa87c('0x3d'),'context':_0x33b2d8['context'],'exten':_0x33b2d8['exten'],'priority':_0x77b160[_0xa87c('0x2c')]+_0x28d0ac['priority']+_0x2f5d91++,'VoiceExtensionId':_0x33b2d8[_0xa87c('0x1b')]});_0x265d55[_0xa87c('0x19')]({'type':_0x33b2d8[_0xa87c('0x13')],'app':_0xa87c('0x14'),'appdata':_0xa87c('0x3e'),'context':_0x33b2d8['context'],'exten':_0x33b2d8[_0xa87c('0xc')],'priority':_0x77b160[_0xa87c('0x2c')]+_0x28d0ac[_0xa87c('0x18')]+_0x2f5d91++,'VoiceExtensionId':_0x33b2d8[_0xa87c('0x1b')]});}}}for(var _0x31aa6b=0x0;_0x31aa6b<_0x77b160['length'];_0x31aa6b+=0x1){var _0x48112b=_0x28d0ac[_0xa87c('0x18')]+_0x77b160['length'];var _0x32464a=_0x31aa6b===_0x77b160[_0xa87c('0x2c')]-0x1?_0x28d0ac[_0xa87c('0x18')]+_0x265d55[_0xa87c('0x2c')]+_0x18957c[_0xa87c('0x2c')]+0x2:_0x28d0ac['priority']+_0x31aa6b+0x1;_0x265d55['splice'](_0x31aa6b,0x0,{'type':_0x33b2d8['type'],'app':_0xa87c('0x3f'),'appdata':_0x77b160[_0x31aa6b]+'?'+_0x33b2d8[_0xa87c('0x17')]+_0xa87c('0x40')+_0x48112b+':'+_0x33b2d8[_0xa87c('0x17')]+_0xa87c('0x40')+_0x32464a,'exten':_0x33b2d8['exten'],'context':_0x33b2d8[_0xa87c('0x17')],'priority':_0x28d0ac['priority']+_0x31aa6b,'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});}_0x33b2d8['priority']=_0x265d55['length']?_[_0xa87c('0x41')](_0x265d55)[_0xa87c('0x18')]+0x1:_0x28d0ac['priority'];_0x28d0ac[_0xa87c('0x18')]=(_0x18957c[_0xa87c('0x2c')]?_[_0xa87c('0x41')](_0x18957c)[_0xa87c('0x18')]:_0x33b2d8['priority'])+0x1;_0x28d0ac['extensions']=_['concat'](_0x28d0ac[_0xa87c('0x10')],_0x265d55,[_0x33b2d8],_0x18957c);}_0x28d0ac['extensions']['push']({'type':_0x38a785[_0x53249d][0x0][_0xa87c('0x13')],'app':_0xa87c('0x42'),'exten':_0x38a785[_0x53249d][0x0][_0xa87c('0xc')],'context':_0x38a785[_0x53249d][0x0][_0xa87c('0x17')],'priority':_0x28d0ac[_0xa87c('0x18')],'VoiceExtensionId':_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]});_0x5288bf[_0xa87c('0x19')](_0x38a785[_0x53249d][0x0][_0xa87c('0x1b')]);_0x84fb9b=_[_0xa87c('0x43')](_0x84fb9b,_0x28d0ac[_0xa87c('0x10')]);}}return _0x5b44c4[_0xa87c('0x44')](function(_0x2e9add){return _0x5b44c4[_0xa87c('0x1')][_0xa87c('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5288bf}},'transaction':_0x2e9add})[_0xa87c('0x4')](function(_0x549291){return _0x5b44c4['models'][_0xa87c('0x6')][_0xa87c('0x45')](_['sortBy'](_0x84fb9b,'priority'),{'transaction':_0x2e9add});});});})[_0xa87c('0x46')](function(_0x21e0f3){console[_0xa87c('0x47')](_0x21e0f3);});}exports[_0xa87c('0x48')]=rewrite; \ No newline at end of file +var _0x9257=['interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','then','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','playback','priority','extensions','extension','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','push','outbound','Set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9257,0xad));var _0x7925=function(_0x3a1bcd,_0x244041){_0x3a1bcd=_0x3a1bcd-0x0;var _0x57422c=_0x9257[_0x3a1bcd];return _0x57422c;};'use strict';var _=require(_0x7925('0x0'));var util=require(_0x7925('0x1'));function rewrite(_0xf405c1,_0x113a77){var _0xfcadf3=this;return _0xf405c1[_0x7925('0x2')][_0x7925('0x3')][_0x7925('0x4')]({'raw':!![]})['then'](function(_0x8ffd0a){_0xfcadf3[_0x7925('0x5')]=_0x8ffd0a;return _0xf405c1[_0x7925('0x2')][_0x7925('0x6')][_0x7925('0x4')]({'where':{'IntervalId':_0x113a77['IntervalId']},'raw':!![]});})[_0x7925('0x7')](function(_0x212a59){return _0xf405c1[_0x7925('0x2')]['VoiceExtension'][_0x7925('0x4')]({'where':{'exten':{'$in':_[_0x7925('0x8')](_[_0x7925('0x9')](_0x212a59,'exten'))}},'order':[{'raw':_0x7925('0xa')}],'raw':!![]});})[_0x7925('0x7')](function(_0x20c714){var _0x21256e=_[_0x7925('0xb')](_0x20c714,{'priority':'1'});var _0x11a0ec=_[_0x7925('0xb')](_0x20c714,{'isApp':0x1});var _0x4931a1=_[_0x7925('0xc')](_0x11a0ec,_0x7925('0xd'));var _0x5a65c5=['queue',_0x7925('0xe')];var _0x5cd7ed=[];var _0x36d5ab=[];for(var _0x565521 in _0x4931a1){if(_0x4931a1['hasOwnProperty'](_0x565521)){_0xfcadf3[_0x7925('0xf')]=0x2;_0xfcadf3[_0x7925('0x10')]=[];_0xfcadf3[_0x7925('0x11')]=_['find'](_0x21256e,{'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')]});_0xfcadf3['extensions']['push']({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':'Set','appdata':util[_0x7925('0x13')](_0x7925('0x14'),_0x4931a1[_0x565521][0x0][_0x7925('0x12')]),'context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0]['exten'],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});if(_0x4931a1[_0x565521][0x0]['type']===_0x7925('0x17')){_0xfcadf3['extensions'][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x4931a1[_0x565521][0x0][_0x7925('0x16')],'context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});}else if(_0x4931a1[_0x565521][0x0][_0x7925('0x12')]===_0x7925('0x19')){if(_0xfcadf3[_0x7925('0x11')]){_0xfcadf3[_0x7925('0x10')][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':_0x7925('0x1a'),'appdata':_0x7925('0x1b')+(_0xfcadf3['extension'][_0x7925('0x1c')]?_0x7925('0x1d')+_0xfcadf3[_0x7925('0x11')][_0x7925('0x1c')]+'}':_0x7925('0x1e')),'context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});}_0xfcadf3[_0x7925('0x10')][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':_0x7925('0x1a'),'appdata':_0x7925('0x1f')+_0x4931a1[_0x565521][0x0][_0x7925('0x16')],'context':_0x4931a1[_0x565521][0x0]['context'],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});var _0x223336=_0xfcadf3[_0x7925('0xf')]++;_0xfcadf3[_0x7925('0x10')][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0]['type'],'app':_0x7925('0x20'),'appdata':_0x7925('0x21')+(_0x223336+0x2)+'):Goto('+(_0x223336+0x1)+')','context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0x223336,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});if(_0xfcadf3[_0x7925('0x11')]){_0xfcadf3[_0x7925('0x10')]['push']({'type':_0x4931a1[_0x565521][0x0]['type'],'app':_0x7925('0x1a'),'appdata':_0xfcadf3[_0x7925('0x11')]['cutdigits']?_0x7925('0x22')+_0xfcadf3[_0x7925('0x11')][_0x7925('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0xfcadf3['priority']++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0]['VoiceExtensionId']});}_0xfcadf3[_0x7925('0x10')][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0]['type'],'app':_0x7925('0x1a'),'appdata':_0x7925('0x23')+_0x4931a1[_0x565521][0x0][_0x7925('0x16')],'context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0]['exten'],'priority':_0xfcadf3['priority']++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});if(_0xfcadf3['extension']&&_0xfcadf3[_0x7925('0x11')][_0x7925('0x24')](_0x7925('0x25'))&&_0xfcadf3['extension'][_0x7925('0x25')]!==_0x7925('0x26')){_0xfcadf3[_0x7925('0x10')][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':_0x7925('0x1a'),'appdata':_0x7925('0x27'),'context':_0x4931a1[_0x565521][0x0]['context'],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});_0xfcadf3[_0x7925('0x10')][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0]['type'],'app':_0x7925('0x1a'),'appdata':_0x7925('0x28')+_0xfcadf3[_0x7925('0x11')][_0x7925('0x25')]||_0x7925('0x29'),'context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0]['exten'],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});}}_0xfcadf3['extensions'][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':_0x7925('0x1a'),'appdata':_0x7925('0x2a'),'context':_0x4931a1[_0x565521][0x0]['context'],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0]['VoiceExtensionId']});_0xfcadf3[_0x7925('0x10')]['push']({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':_0x7925('0x1a'),'appdata':_0x7925('0x2b'),'context':_0x4931a1[_0x565521][0x0]['context'],'exten':_0x4931a1[_0x565521][0x0]['exten'],'priority':_0xfcadf3['priority']++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});_0xfcadf3[_0x7925('0x10')]['push']({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':'Set','appdata':_0x7925('0x2c'),'context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'exten':_0x4931a1[_0x565521][0x0][_0x7925('0xd')],'priority':_0xfcadf3[_0x7925('0xf')]++,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});for(var _0x1552db=0x0,_0x3313ae=0x0;_0x1552db<_0x4931a1[_0x565521][_0x7925('0x2d')];_0x1552db+=0x1,_0x3313ae=0x0){var _0x42bac6=_0x4931a1[_0x565521][_0x1552db];if(_0x42bac6[_0x7925('0x12')]){_0x42bac6[_0x7925('0x12')]=_0x42bac6[_0x7925('0x12')][_0x7925('0x2e')]();}var _0xc95585=[];var _0x32e439=[];delete _0x42bac6['id'];delete _0x42bac6[_0x7925('0x2f')];delete _0x42bac6[_0x7925('0x30')];var _0x2606d2=_0x42bac6[_0x7925('0x31')]!==_0x7925('0x32')?[_0x42bac6['interval']]:_0x42bac6[_0x7925('0x33')]?_['map'](_['filter'](_0xfcadf3[_0x7925('0x5')],{'IntervalId':_0x42bac6[_0x7925('0x33')]}),_0x7925('0x31')):[];if(_0x42bac6[_0x7925('0x24')](_0x7925('0x34'))){if(_0x42bac6['tag']&&_0x42bac6[_0x7925('0x34')]!=='--'){_0xc95585[_0x7925('0x18')]({'type':_0x42bac6[_0x7925('0x12')],'app':'Set','appdata':_0x7925('0x35')+_0x42bac6['tag'],'context':_0x42bac6[_0x7925('0x15')],'exten':_0x42bac6[_0x7925('0xd')],'priority':_0x2606d2[_0x7925('0x2d')]+_0xfcadf3['priority']+_0x3313ae++,'VoiceExtensionId':_0x42bac6['VoiceExtensionId']});}}if(_0x42bac6[_0x7925('0x12')]===_0x7925('0x19')&&_0x42bac6[_0x7925('0x24')](_0x7925('0x36'))){if(_0x42bac6[_0x7925('0x36')]){_0xc95585['push']({'type':_0x42bac6[_0x7925('0x12')],'app':'ExecIf','appdata':_0x7925('0x37')+_0x42bac6[_0x7925('0x36')]+')','context':_0x42bac6[_0x7925('0x15')],'exten':_0x42bac6['exten'],'priority':_0x2606d2[_0x7925('0x2d')]+_0xfcadf3[_0x7925('0xf')]+_0x3313ae++,'VoiceExtensionId':_0x42bac6[_0x7925('0x16')]});}else{_0xc95585['push']({'type':_0x42bac6[_0x7925('0x12')],'app':_0x7925('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x42bac6[_0x7925('0x15')],'exten':_0x42bac6[_0x7925('0xd')],'priority':_0x2606d2[_0x7925('0x2d')]+_0xfcadf3[_0x7925('0xf')]+_0x3313ae++,'VoiceExtensionId':_0x42bac6[_0x7925('0x16')]});}}if(_0x42bac6[_0x7925('0x24')](_0x7925('0x38'))){if(_0x5a65c5[_0x7925('0x39')](_0x42bac6[_0x7925('0x3a')][_0x7925('0x2e')]())>=0x0&&_0x42bac6[_0x7925('0x3b')]!==_0x7925('0x3c')){if(_0x42bac6[_0x7925('0x38')]){_0xc95585[_0x7925('0x18')]({'type':_0x42bac6[_0x7925('0x12')],'app':_0x7925('0x20'),'appdata':_0x7925('0x3d'),'context':_0x42bac6[_0x7925('0x15')],'exten':_0x42bac6[_0x7925('0xd')],'priority':_0x2606d2['length']+_0xfcadf3['priority']+_0x3313ae++,'VoiceExtensionId':_0x42bac6[_0x7925('0x16')]});_0xc95585[_0x7925('0x18')]({'type':_0x42bac6[_0x7925('0x12')],'app':'Set','appdata':_0x7925('0x3e'),'context':_0x42bac6[_0x7925('0x15')],'exten':_0x42bac6[_0x7925('0xd')],'priority':_0x2606d2[_0x7925('0x2d')]+_0xfcadf3[_0x7925('0xf')]+_0x3313ae++,'VoiceExtensionId':_0x42bac6[_0x7925('0x16')]});}else{_0xc95585['push']({'type':_0x42bac6[_0x7925('0x12')],'app':_0x7925('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x42bac6[_0x7925('0x15')],'exten':_0x42bac6[_0x7925('0xd')],'priority':_0x2606d2[_0x7925('0x2d')]+_0xfcadf3[_0x7925('0xf')]+_0x3313ae++,'VoiceExtensionId':_0x42bac6['VoiceExtensionId']});_0xc95585['push']({'type':_0x42bac6[_0x7925('0x12')],'app':'Set','appdata':_0x7925('0x3f'),'context':_0x42bac6[_0x7925('0x15')],'exten':_0x42bac6[_0x7925('0xd')],'priority':_0x2606d2[_0x7925('0x2d')]+_0xfcadf3[_0x7925('0xf')]+_0x3313ae++,'VoiceExtensionId':_0x42bac6[_0x7925('0x16')]});}}}for(var _0x17f310=0x0;_0x17f310<_0x2606d2['length'];_0x17f310+=0x1){var _0x1e4028=_0xfcadf3[_0x7925('0xf')]+_0x2606d2['length'];var _0x4279f5=_0x17f310===_0x2606d2[_0x7925('0x2d')]-0x1?_0xfcadf3['priority']+_0xc95585[_0x7925('0x2d')]+_0x32e439[_0x7925('0x2d')]+0x2:_0xfcadf3['priority']+_0x17f310+0x1;_0xc95585[_0x7925('0x40')](_0x17f310,0x0,{'type':_0x42bac6[_0x7925('0x12')],'app':'GotoIfTime','appdata':_0x2606d2[_0x17f310]+'?'+_0x42bac6[_0x7925('0x15')]+',${EXTEN},'+_0x1e4028+':'+_0x42bac6[_0x7925('0x15')]+',${EXTEN},'+_0x4279f5,'exten':_0x42bac6[_0x7925('0xd')],'context':_0x42bac6[_0x7925('0x15')],'priority':_0xfcadf3[_0x7925('0xf')]+_0x17f310,'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});}_0x42bac6['priority']=_0xc95585[_0x7925('0x2d')]?_[_0x7925('0x41')](_0xc95585)['priority']+0x1:_0xfcadf3[_0x7925('0xf')];_0xfcadf3[_0x7925('0xf')]=(_0x32e439[_0x7925('0x2d')]?_[_0x7925('0x41')](_0x32e439)[_0x7925('0xf')]:_0x42bac6['priority'])+0x1;_0xfcadf3['extensions']=_[_0x7925('0x42')](_0xfcadf3[_0x7925('0x10')],_0xc95585,[_0x42bac6],_0x32e439);}_0xfcadf3[_0x7925('0x10')][_0x7925('0x18')]({'type':_0x4931a1[_0x565521][0x0][_0x7925('0x12')],'app':_0x7925('0x43'),'exten':_0x4931a1[_0x565521][0x0]['exten'],'context':_0x4931a1[_0x565521][0x0][_0x7925('0x15')],'priority':_0xfcadf3['priority'],'VoiceExtensionId':_0x4931a1[_0x565521][0x0][_0x7925('0x16')]});_0x5cd7ed[_0x7925('0x18')](_0x4931a1[_0x565521][0x0][_0x7925('0x16')]);_0x36d5ab=_[_0x7925('0x42')](_0x36d5ab,_0xfcadf3[_0x7925('0x10')]);}}return _0xf405c1[_0x7925('0x44')](function(_0x590a2e){return _0xf405c1[_0x7925('0x2')][_0x7925('0x6')][_0x7925('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x5cd7ed}},'transaction':_0x590a2e})[_0x7925('0x7')](function(_0x150a66){return _0xf405c1['models']['VoiceExtension']['bulkCreate'](_[_0x7925('0x46')](_0x36d5ab,'priority'),{'transaction':_0x590a2e});});});})[_0x7925('0x47')](function(_0x1f9445){console[_0x7925('0x48')](_0x1f9445);});}exports[_0x7925('0x49')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 95412ee..db49c96 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 _0xbd0a=['socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','select','NOW()','scheduledAt','field','ContactId','toString','createdAt','updatedAt','cm_contacts','where','ListId\x20=\x20?','from','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','phone\x20IS\x20NOT\x20NULL','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','onlyIfOpen','query','VoiceQueueId','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost'];(function(_0x35af69,_0x3a034f){var _0x3825d5=function(_0x196b67){while(--_0x196b67){_0x35af69['push'](_0x35af69['shift']());}};_0x3825d5(++_0x3a034f);}(_0xbd0a,0x13f));var _0xabd0=function(_0x58cdf9,_0x5fe98a){_0x58cdf9=_0x58cdf9-0x0;var _0x2b12a5=_0xbd0a[_0x58cdf9];return _0x2b12a5;};'use strict';var BPromise=require(_0xabd0('0x0'));var util=require(_0xabd0('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xabd0('0x2'));var Papa=require('papaparse');var Redis=require(_0xabd0('0x3'));var db=require(_0xabd0('0x4'))['db'];var config=require(_0xabd0('0x5'));var logger=require(_0xabd0('0x6'))(_0xabd0('0x7'));config[_0xabd0('0x8')]=_[_0xabd0('0x9')](config[_0xabd0('0x8')],{'host':_0xabd0('0xa'),'port':0x18eb});var socket=require(_0xabd0('0xb'))(new Redis(config[_0xabd0('0x8')]));require(_0xabd0('0xc'))[_0xabd0('0xd')](socket);try{if(!process[_0xabd0('0xe')][0x2]||process[_0xabd0('0xe')][0x2]===_0xabd0('0xf')||process[_0xabd0('0xe')][0x2]===_0xabd0('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0xabd0('0xe')][0x3]||process['argv'][0x3]===_0xabd0('0xf')||process[_0xabd0('0xe')][0x3]==='null'||!process[_0xabd0('0xe')][0x4]||process[_0xabd0('0xe')][0x4]===_0xabd0('0xf')||process[_0xabd0('0xe')][0x4]==='null'){throw new Error(_0xabd0('0x11'));}var FIELDS=_['zipObject'](process[_0xabd0('0xe')][0x3][_0xabd0('0x12')](','),process[_0xabd0('0xe')][0x4]['split'](','));if(!process[_0xabd0('0xe')][0x5]||process[_0xabd0('0xe')][0x5]==='undefined'||process[_0xabd0('0xe')][0x5]===_0xabd0('0x10')){throw new Error(_0xabd0('0x13'));}var LISTID=process[_0xabd0('0xe')][0x5];var COMPANYID=process[_0xabd0('0xe')][0x6]&&process[_0xabd0('0xe')][0x6]!==_0xabd0('0xf')&&process[_0xabd0('0xe')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xabd0('0xe')][0x7]&&process[_0xabd0('0xe')][0x7]!==_0xabd0('0xf')&&process[_0xabd0('0xe')][0x7]!=='null'?process[_0xabd0('0xe')][0x7]:null;if(!process[_0xabd0('0xe')][0x8]||process[_0xabd0('0xe')][0x8]===_0xabd0('0xf')||process[_0xabd0('0xe')][0x8]===_0xabd0('0x10')){throw new Error(_0xabd0('0x14'));}var SOCKET_TIMESTAMP=process[_0xabd0('0xe')][0x8];}catch(_0x4dee00){logger[_0xabd0('0x15')](_0x4dee00);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(_0x334e71,_0x57d244,_0x4dca89,_0xf6583e){var _0x2eb4df={'message':_0x57d244};_0x2eb4df[_0x334e71]=!![];if(_0x4dca89){_0x2eb4df[_0xabd0('0x16')]=_0x4dca89;}if(_0xf6583e){_0x2eb4df[_0xabd0('0x17')]=_0xf6583e;}return _0x2eb4df;}function isEmail(_0x22a6e2){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))*$/[_0xabd0('0x18')](_0x22a6e2);}function checkRow(_0x3063cf,_0x17b931,_0x5cc19b){return new BPromise(function(_0x2fccf2,_0xb6a11){if(_[_0xabd0('0x19')](_0x3063cf)){return _0xb6a11(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x5cc19b));}if(_0x3063cf[_0xabd0('0x1a')]&&_0x3063cf['errors'][_0xabd0('0x1b')]){var _0x50a8c5=_[_0xabd0('0x1c')](_0x3063cf[_0xabd0('0x1a')],'message')[_0xabd0('0x1d')](';');return _0xb6a11(handleCheckRowError(_0xabd0('0x15'),_0x50a8c5,null,_0x5cc19b));}var _0x2dad77={};for(var _0x4207dd in FIELDS){if(FIELDS[_0xabd0('0x1e')](_0x4207dd)&&FIELDS[_0x4207dd]){_0x2dad77[_0x4207dd]=_0x3063cf['data'][0x0][FIELDS[_0x4207dd]]||_0x3063cf[_0xabd0('0x1f')][0x0]['\ufeff'+FIELDS[_0x4207dd]];}}if(!_0x2dad77[_0xabd0('0x20')]){return _0xb6a11(handleCheckRowError(_0xabd0('0x15'),_0xabd0('0x21'),null,_0x5cc19b));}if(!_0x2dad77[_0xabd0('0x22')]){return _0xb6a11(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x5cc19b));}if(_0x2dad77['birthDate']){var _0x5a2f27=moment(_0x2dad77[_0xabd0('0x23')],_0xabd0('0x24'));if(!_0x5a2f27['isValid']()){return _0xb6a11(handleCheckRowError(_0xabd0('0x15'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5cc19b));}}if(_0x2dad77[_0xabd0('0x25')]){if(!isEmail(_0x2dad77[_0xabd0('0x25')])){return _0xb6a11(handleCheckRowError(_0xabd0('0x15'),_0xabd0('0x26'),null,_0x5cc19b));}}_0x2dad77[_0xabd0('0x27')]=LISTID;_0x2dad77['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x17b931){var _0x1f51ea={};for(var _0x19f567=0x0,_0x1893d6=DUPLICATES[_0xabd0('0x1b')];_0x19f567<_0x1893d6;_0x19f567+=0x1){_0x1f51ea[DUPLICATES[_0x19f567]]=_0x2dad77[DUPLICATES[_0x19f567]];}var _0x3f2428=_[_0xabd0('0x28')](_0x17b931,_0x1f51ea);if(_0x3f2428){return _0xb6a11(handleCheckRowError(_0xabd0('0x29'),_0xabd0('0x2a'),_0x3f2428,_0x5cc19b));}}return db[_0xabd0('0x2b')]['create'](_0x2dad77,{'raw':!![],'hooks':![],'fields':_[_0xabd0('0x2c')](_0x2dad77)})[_0xabd0('0x2d')](function(_0x66b647){if(DUPLICATES&&DUPLICATES[_0xabd0('0x1b')]&&_0x17b931){_0x17b931[_0xabd0('0x2e')](_[_0xabd0('0x2f')](_0x2dad77,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x66b647['id'];return _0x2fccf2();})[_0xabd0('0x30')](function(_0x5aea03){return _0xb6a11(handleCheckRowError(_0xabd0('0x15'),_0xabd0('0x31')+(_0x5aea03[_0xabd0('0x32')]||JSON[_0xabd0('0x33')](_0x5aea03)),null,_0x5cc19b));});});}function checkHopper(){function _0x87488c(){return function(_0x4c9b31){logger[_0xabd0('0x15')](_0xabd0('0x34'),'checkHopper',util[_0xabd0('0x35')](_0x4c9b31,{'showHidden':![],'depth':null}));};}var _0x44bdd0=function(_0x103c14,_0x109f76){var _0x46d77e=squel[_0xabd0('0x36')]()[_0xabd0('0x37')](_0xabd0('0x38'))[_0xabd0('0x39')](['phone','scheduledAt','ContactId','ListId',_0x109f76,'createdAt','updatedAt'],squel[_0xabd0('0x3a')]()['field'](_0xabd0('0x22'),_0xabd0('0x22'))['field'](_0xabd0('0x3b'),_0xabd0('0x3c'))[_0xabd0('0x3d')]('id',_0xabd0('0x3e'))[_0xabd0('0x3d')](LISTID[_0xabd0('0x3f')](),'ListId')[_0xabd0('0x3d')](_0x103c14['id'][_0xabd0('0x3f')](),_0x109f76)[_0xabd0('0x3d')](_0xabd0('0x3b'),_0xabd0('0x40'))[_0xabd0('0x3d')](_0xabd0('0x3b'),_0xabd0('0x41'))['from'](_0xabd0('0x42'))[_0xabd0('0x43')]('deletedAt\x20IS\x20NULL')[_0xabd0('0x43')](_0xabd0('0x44'),LISTID[_0xabd0('0x3f')]())[_0xabd0('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0xabd0('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xabd0('0x3a')]()[_0xabd0('0x3d')]('phone')[_0xabd0('0x45')]('cm_hopper')[_0xabd0('0x43')](_0x109f76+'\x20=\x20?',_0x103c14['id'][_0xabd0('0x3f')]())))['toString']();return _0x46d77e;};var _0x46e224=function(_0x5c8be9,_0x4249b3){var _0x25780d=squel['insert']()[_0xabd0('0x37')](_0xabd0('0x38'))[_0xabd0('0x39')]([_0xabd0('0x22'),_0xabd0('0x3c'),'ContactId','ListId',_0x4249b3,_0xabd0('0x40'),_0xabd0('0x41')],squel[_0xabd0('0x3a')]()['field']('phone',_0xabd0('0x22'))[_0xabd0('0x3d')](_0xabd0('0x3b'),_0xabd0('0x3c'))['field']('id','ContactId')[_0xabd0('0x3d')](LISTID[_0xabd0('0x3f')](),_0xabd0('0x27'))['field'](_0x5c8be9['id']['toString'](),_0x4249b3)['field']('NOW()',_0xabd0('0x40'))[_0xabd0('0x3d')]('NOW()',_0xabd0('0x41'))[_0xabd0('0x45')](_0xabd0('0x42'))[_0xabd0('0x43')](_0xabd0('0x46'))[_0xabd0('0x43')]('ListId\x20=\x20?',LISTID[_0xabd0('0x3f')]())[_0xabd0('0x43')](_0xabd0('0x47'),squel[_0xabd0('0x48')](hopperContacts))[_0xabd0('0x43')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xabd0('0x49'),squel[_0xabd0('0x3a')]()[_0xabd0('0x3d')](_0xabd0('0x4a'))[_0xabd0('0x45')](_0xabd0('0x4b'))[_0xabd0('0x43')](_0x4249b3+'\x20=\x20?',_0x5c8be9['id'][_0xabd0('0x3f')]()))[_0xabd0('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xabd0('0x3a')]()[_0xabd0('0x3d')]('phone')[_0xabd0('0x45')](_0xabd0('0x38'))[_0xabd0('0x43')](_0x4249b3+_0xabd0('0x4c'),_0x5c8be9['id'][_0xabd0('0x3f')]())))['toString']();return _0x25780d;};function _0x27690d(_0x3cffe5,_0x455d70){var _0xd63abf=squel[_0xabd0('0x36')]()[_0xabd0('0x37')](_0xabd0('0x38'))['fromQuery'](['phone',_0xabd0('0x3c'),_0xabd0('0x3e'),'ListId',_0x455d70,_0xabd0('0x40'),_0xabd0('0x41')],squel[_0xabd0('0x3a')]()[_0xabd0('0x3d')]('phone',_0xabd0('0x22'))[_0xabd0('0x3d')](_0xabd0('0x3b'),_0xabd0('0x3c'))['field']('id',_0xabd0('0x3e'))[_0xabd0('0x3d')](LISTID[_0xabd0('0x3f')](),_0xabd0('0x27'))[_0xabd0('0x3d')](_0x3cffe5['id'][_0xabd0('0x3f')](),_0x455d70)[_0xabd0('0x3d')](_0xabd0('0x3b'),'createdAt')[_0xabd0('0x3d')](_0xabd0('0x3b'),_0xabd0('0x41'))[_0xabd0('0x45')](_0xabd0('0x42'))['where'](_0xabd0('0x46'))[_0xabd0('0x43')](_0xabd0('0x44'),LISTID[_0xabd0('0x3f')]())[_0xabd0('0x43')](_0xabd0('0x47'),squel[_0xabd0('0x48')](hopperContacts))['where'](_0xabd0('0x4d')))[_0xabd0('0x3f')]();return _0xd63abf;}function _0x67adcb(_0x56e9c3,_0x49483f){var _0x5dcc0c=squel[_0xabd0('0x36')]()[_0xabd0('0x37')]('cm_hopper_black')['fromQuery']([_0xabd0('0x22'),_0xabd0('0x3e'),_0xabd0('0x27'),_0x49483f,_0xabd0('0x40'),'updatedAt'],squel[_0xabd0('0x3a')]()[_0xabd0('0x3d')](_0xabd0('0x22'),_0xabd0('0x22'))[_0xabd0('0x3d')]('id','ContactId')[_0xabd0('0x3d')](LISTID[_0xabd0('0x3f')](),_0xabd0('0x27'))[_0xabd0('0x3d')](_0x56e9c3['id'][_0xabd0('0x3f')](),_0x49483f)[_0xabd0('0x3d')](_0xabd0('0x3b'),_0xabd0('0x40'))[_0xabd0('0x3d')](_0xabd0('0x3b'),_0xabd0('0x41'))['from'](_0xabd0('0x42'))[_0xabd0('0x43')](_0xabd0('0x46'))[_0xabd0('0x43')](_0xabd0('0x44'),LISTID['toString']())[_0xabd0('0x43')](_0xabd0('0x47'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xabd0('0x3f')]();return _0x5dcc0c;}return db[_0xabd0('0x4e')]['findAll']({'where':{'type':_0xabd0('0x4f')},'attributes':['id',_0xabd0('0x50')],'include':[{'model':db[_0xabd0('0x51')],'as':_0xabd0('0x52'),'where':{'id':LISTID}}]})[_0xabd0('0x2d')](function(_0x4df177){var _0x59a812=[];if(_0x4df177){var _0x4747cc;for(var _0x40288a=0x0,_0x180c5d;_0x40288a<_0x4df177['length'];_0x40288a+=0x1){_0x180c5d=_0x4df177[_0x40288a][_0xabd0('0x53')]({'plain':!![]});switch(_0x180c5d[_0xabd0('0x50')]){case _0xabd0('0x54'):_0x59a812[_0xabd0('0x2e')](db[_0xabd0('0x55')]['query'](_0x46e224(_0x180c5d,'VoiceQueueId'))[_0xabd0('0x2d')](function(){})[_0xabd0('0x30')](_0x87488c()));break;case _0xabd0('0x56'):_0x59a812[_0xabd0('0x2e')](db[_0xabd0('0x55')][_0xabd0('0x57')](_0x44bdd0(_0x180c5d,_0xabd0('0x58')))[_0xabd0('0x2d')](function(){})['catch'](_0x87488c()));break;default:_0x59a812[_0xabd0('0x2e')](db[_0xabd0('0x55')][_0xabd0('0x57')](_0x27690d(_0x180c5d,_0xabd0('0x58')))['then'](function(){})[_0xabd0('0x30')](_0x87488c()));}}}return _0x59a812;})[_0xabd0('0x59')]()[_0xabd0('0x2d')](function(){return db[_0xabd0('0x4e')][_0xabd0('0x5a')]({'where':{'type':_0xabd0('0x4f')},'attributes':['id'],'include':[{'model':db[_0xabd0('0x51')],'as':_0xabd0('0x5b'),'where':{'id':LISTID}}]})[_0xabd0('0x2d')](function(_0x5947f9){var _0x36d31c=[];if(_0x5947f9){var _0x5f200c;for(var _0x208c3c=0x0,_0x2a9e5c;_0x208c3c<_0x5947f9['length'];_0x208c3c+=0x1){_0x2a9e5c=_0x5947f9[_0x208c3c][_0xabd0('0x53')]({'plain':!![]});_0x36d31c['push'](db[_0xabd0('0x55')][_0xabd0('0x57')](_0x67adcb(_0x2a9e5c,_0xabd0('0x58')))[_0xabd0('0x2d')](function(){})[_0xabd0('0x30')](_0x87488c()));}}return _0x36d31c;})['all']();})[_0xabd0('0x2d')](function(){return db[_0xabd0('0x5c')]['findAll']({'attributes':['id',_0xabd0('0x50')],'include':[{'model':db['CmList'],'as':_0xabd0('0x52'),'where':{'id':LISTID}}]})[_0xabd0('0x2d')](function(_0x2bca20){var _0x298ca9=[];if(_0x2bca20){for(var _0x19c2a7=0x0,_0x5af34c;_0x19c2a7<_0x2bca20[_0xabd0('0x1b')];_0x19c2a7+=0x1){_0x5af34c=_0x2bca20[_0x19c2a7][_0xabd0('0x53')]({'plain':!![]});switch(_0x5af34c['dialCheckDuplicateType']){case _0xabd0('0x54'):_0x298ca9[_0xabd0('0x2e')](db[_0xabd0('0x55')][_0xabd0('0x57')](_0x46e224(_0x5af34c,'CampaignId'))[_0xabd0('0x2d')](function(){})[_0xabd0('0x30')](_0x87488c()));break;case _0xabd0('0x56'):_0x298ca9[_0xabd0('0x2e')](db[_0xabd0('0x55')][_0xabd0('0x57')](_0x44bdd0(_0x5af34c,_0xabd0('0x5d')))[_0xabd0('0x2d')](function(){})[_0xabd0('0x30')](_0x87488c()));break;default:_0x298ca9[_0xabd0('0x2e')](db[_0xabd0('0x55')]['query'](_0x27690d(_0x5af34c,_0xabd0('0x5d')))[_0xabd0('0x2d')](function(){})[_0xabd0('0x30')](_0x87488c()));}}}return _0x298ca9;})['all']();})[_0xabd0('0x2d')](function(){return db[_0xabd0('0x5c')][_0xabd0('0x5a')]({'attributes':['id'],'include':[{'model':db[_0xabd0('0x51')],'as':_0xabd0('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x1e8ca2){var _0x2b8353=[];if(_0x1e8ca2){for(var _0x24817b=0x0,_0x435742;_0x24817b<_0x1e8ca2[_0xabd0('0x1b')];_0x24817b+=0x1){_0x435742=_0x1e8ca2[_0x24817b][_0xabd0('0x53')]({'plain':!![]});_0x2b8353[_0xabd0('0x2e')](db[_0xabd0('0x55')][_0xabd0('0x57')](_0x67adcb(_0x435742,_0xabd0('0x5d')))['then'](function(){})[_0xabd0('0x30')](_0x87488c()));}}return _0x2b8353;})[_0xabd0('0x59')]();})[_0xabd0('0x30')](function(_0x4d4845){logger[_0xabd0('0x15')](_0xabd0('0x5e'),_0xabd0('0x5f'),_0x4d4845[_0xabd0('0x32')]);});}var processPromises=function(_0x5cf132){return BPromise[_0xabd0('0x59')](promises)[_0xabd0('0x2d')](function(_0x1dd2d0){})[_0xabd0('0x30')](function(_0x5519e0){logger[_0xabd0('0x15')]('Error\x20processing\x20rows\x20block:',JSON[_0xabd0('0x33')](_0x5519e0));})[_0xabd0('0x60')](function(){socket[_0xabd0('0x61')](_0xabd0('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5cf132){return _0x5cf132[_0xabd0('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xabd0('0x2d')](function(){socket['emit'](_0xabd0('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1b6195){logger[_0xabd0('0x15')](_0xabd0('0x64'),JSON[_0xabd0('0x33')](_0x1b6195));}finally{process[_0xabd0('0x65')](0x0);}});};process['on'](_0xabd0('0x66'),function(){logger[_0xabd0('0x67')](_0xabd0('0x68'));endCsv();});function main(){return BPromise['resolve']()[_0xabd0('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xabd0('0x2b')][_0xabd0('0x5a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x483c6e){var _0x5810ef=fs[_0xabd0('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x5810ef,{'header':!![],'skipEmptyLines':!![],'step':function(_0x551a77,_0x5f1d5c){total+=0x1;var _0x5c15f4=total;promises[_0xabd0('0x2e')](checkRow(_0x551a77,_0x483c6e,_0x5c15f4)[_0xabd0('0x2d')](function(){success+=0x1;})['catch'](function(_0xf0edf9){if(_0xf0edf9[_0xabd0('0x15')]){errors+=0x1;delete _0xf0edf9['error'];}else if(_0xf0edf9[_0xabd0('0x29')]){duplicates+=0x1;delete _0xf0edf9[_0xabd0('0x29')];}rows[_0xabd0('0x2e')](_0xf0edf9);}));if(total%0xc8===0x0){_0x5f1d5c[_0xabd0('0x6a')]();return processPromises(_0x5f1d5c);}},'complete':function(){return processPromises()[_0xabd0('0x2d')](function(){logger[_0xabd0('0x67')](_0xabd0('0x6b'));endCsv();});},'error':function(_0x74e2f8,_0x3fd6c9){logger['info'](_0xabd0('0x6c'),JSON[_0xabd0('0x33')](_0x74e2f8));endCsv();}});})[_0xabd0('0x30')](function(_0x523418){logger[_0xabd0('0x15')](_0xabd0('0x6d'),JSON[_0xabd0('0x33')](_0x523418));});}main(); \ No newline at end of file +var _0x7935=['util','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','CmContact','create','then','stringify','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_hopper','id\x20IN\x20?','str','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','get','always','push','sequelize','catch','onlyIfOpen','query','VoiceQueueId','all','VoiceQueue','BlackLists','Lists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','pause','Error\x20executing\x20contact\x20csv\x20import:'];(function(_0x90ccff,_0x2ebe46){var _0x3a736c=function(_0x48fe58){while(--_0x48fe58){_0x90ccff['push'](_0x90ccff['shift']());}};_0x3a736c(++_0x2ebe46);}(_0x7935,0xce));var _0x5793=function(_0x4c6c3f,_0x54c1ee){_0x4c6c3f=_0x4c6c3f-0x0;var _0x3f0d7c=_0x7935[_0x4c6c3f];return _0x3f0d7c;};'use strict';var BPromise=require('bluebird');var util=require(_0x5793('0x0'));var _=require(_0x5793('0x1'));var fs=require('fs');var squel=require(_0x5793('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x5793('0x3'))['db'];var config=require(_0x5793('0x4'));var logger=require(_0x5793('0x5'))('api');config[_0x5793('0x6')]=_[_0x5793('0x7')](config[_0x5793('0x6')],{'host':_0x5793('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5793('0x6')]));require(_0x5793('0x9'))['register'](socket);try{if(!process[_0x5793('0xa')][0x2]||process[_0x5793('0xa')][0x2]===_0x5793('0xb')||process['argv'][0x2]===_0x5793('0xc')){throw new Error(_0x5793('0xd'));}var FILEPATH=process[_0x5793('0xa')][0x2];if(!process[_0x5793('0xa')][0x3]||process[_0x5793('0xa')][0x3]===_0x5793('0xb')||process[_0x5793('0xa')][0x3]===_0x5793('0xc')||!process['argv'][0x4]||process['argv'][0x4]==='undefined'||process[_0x5793('0xa')][0x4]===_0x5793('0xc')){throw new Error(_0x5793('0xe'));}var FIELDS=_[_0x5793('0xf')](process[_0x5793('0xa')][0x3][_0x5793('0x10')](','),process[_0x5793('0xa')][0x4][_0x5793('0x10')](','));if(!process[_0x5793('0xa')][0x5]||process['argv'][0x5]===_0x5793('0xb')||process['argv'][0x5]===_0x5793('0xc')){throw new Error(_0x5793('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x5793('0xa')][0x6]&&process[_0x5793('0xa')][0x6]!==_0x5793('0xb')&&process[_0x5793('0xa')][0x6]!==_0x5793('0xc')?process[_0x5793('0xa')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x5793('0xa')][0x7]!=='undefined'&&process[_0x5793('0xa')][0x7]!==_0x5793('0xc')?process[_0x5793('0xa')][0x7]:null;if(!process[_0x5793('0xa')][0x8]||process[_0x5793('0xa')][0x8]===_0x5793('0xb')||process[_0x5793('0xa')][0x8]===_0x5793('0xc')){throw new Error(_0x5793('0x12'));}var SOCKET_TIMESTAMP=process[_0x5793('0xa')][0x8];}catch(_0x42fe41){logger[_0x5793('0x13')](_0x42fe41);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(_0x3b1582,_0x535098,_0x4e5e1c,_0x29c8bb){var _0x213300={'message':_0x535098};_0x213300[_0x3b1582]=!![];if(_0x4e5e1c){_0x213300[_0x5793('0x14')]=_0x4e5e1c;}if(_0x29c8bb){_0x213300[_0x5793('0x15')]=_0x29c8bb;}return _0x213300;}function isEmail(_0x4cc0e4){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))*$/[_0x5793('0x16')](_0x4cc0e4);}function checkRow(_0x5d5439,_0x580fb0,_0x3e0961){return new BPromise(function(_0x4d84c0,_0x243928){if(_[_0x5793('0x17')](_0x5d5439)){return _0x243928(handleCheckRowError(_0x5793('0x13'),_0x5793('0x18'),null,_0x3e0961));}if(_0x5d5439['errors']&&_0x5d5439[_0x5793('0x19')]['length']){var _0x5382f3=_[_0x5793('0x1a')](_0x5d5439[_0x5793('0x19')],_0x5793('0x1b'))[_0x5793('0x1c')](';');return _0x243928(handleCheckRowError(_0x5793('0x13'),_0x5382f3,null,_0x3e0961));}var _0x1eea59={};for(var _0x1ae7b9 in FIELDS){if(FIELDS[_0x5793('0x1d')](_0x1ae7b9)&&FIELDS[_0x1ae7b9]){_0x1eea59[_0x1ae7b9]=_0x5d5439[_0x5793('0x1e')][0x0][FIELDS[_0x1ae7b9]]||_0x5d5439[_0x5793('0x1e')][0x0]['\ufeff'+FIELDS[_0x1ae7b9]];}}if(!_0x1eea59[_0x5793('0x1f')]){return _0x243928(handleCheckRowError(_0x5793('0x13'),_0x5793('0x20'),null,_0x3e0961));}if(!_0x1eea59[_0x5793('0x21')]){return _0x243928(handleCheckRowError(_0x5793('0x13'),_0x5793('0x22'),null,_0x3e0961));}if(_0x1eea59[_0x5793('0x23')]){var _0x5ec5aa=moment(_0x1eea59[_0x5793('0x23')],_0x5793('0x24'));if(!_0x5ec5aa['isValid']()){return _0x243928(handleCheckRowError(_0x5793('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x3e0961));}}if(_0x1eea59[_0x5793('0x25')]){if(!isEmail(_0x1eea59[_0x5793('0x25')])){return _0x243928(handleCheckRowError(_0x5793('0x13'),_0x5793('0x26'),null,_0x3e0961));}}_0x1eea59[_0x5793('0x27')]=LISTID;_0x1eea59[_0x5793('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5793('0x29')]&&_0x580fb0){var _0x215c89={};for(var _0x2f3d02=0x0,_0x1fc962=DUPLICATES[_0x5793('0x29')];_0x2f3d02<_0x1fc962;_0x2f3d02+=0x1){_0x215c89[DUPLICATES[_0x2f3d02]]=_0x1eea59[DUPLICATES[_0x2f3d02]];}var _0x3d42e9=_[_0x5793('0x2a')](_0x580fb0,_0x215c89);if(_0x3d42e9){return _0x243928(handleCheckRowError(_0x5793('0x2b'),'Duplicate\x20Contact',_0x3d42e9,_0x3e0961));}}return db[_0x5793('0x2c')][_0x5793('0x2d')](_0x1eea59,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1eea59)})[_0x5793('0x2e')](function(_0x1cda78){if(DUPLICATES&&DUPLICATES['length']&&_0x580fb0){_0x580fb0['push'](_['pick'](_0x1eea59,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1cda78['id'];return _0x4d84c0();})['catch'](function(_0x47c07f){return _0x243928(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x47c07f[_0x5793('0x1b')]||JSON[_0x5793('0x2f')](_0x47c07f)),null,_0x3e0961));});});}function checkHopper(){function _0xd1730e(){return function(_0x2af5e8){logger[_0x5793('0x13')]('cmContact',_0x5793('0x30'),util[_0x5793('0x31')](_0x2af5e8,{'showHidden':![],'depth':null}));};}var _0x1b3865=function(_0x31cc2a,_0x3ff167){var _0x51a528=squel[_0x5793('0x32')]()[_0x5793('0x33')]('cm_hopper')[_0x5793('0x34')]([_0x5793('0x21'),_0x5793('0x35'),_0x5793('0x36'),_0x5793('0x27'),_0x3ff167,_0x5793('0x37'),_0x5793('0x38')],squel[_0x5793('0x39')]()[_0x5793('0x3a')](_0x5793('0x21'),_0x5793('0x21'))[_0x5793('0x3a')](_0x5793('0x3b'),_0x5793('0x35'))[_0x5793('0x3a')]('id',_0x5793('0x36'))[_0x5793('0x3a')](LISTID[_0x5793('0x3c')](),_0x5793('0x27'))['field'](_0x31cc2a['id'][_0x5793('0x3c')](),_0x3ff167)[_0x5793('0x3a')](_0x5793('0x3b'),_0x5793('0x37'))[_0x5793('0x3a')](_0x5793('0x3b'),'updatedAt')[_0x5793('0x3d')](_0x5793('0x3e'))[_0x5793('0x3f')](_0x5793('0x40'))[_0x5793('0x3f')](_0x5793('0x41'),LISTID[_0x5793('0x3c')]())[_0x5793('0x3f')](_0x5793('0x42'))['where'](_0x5793('0x43'),squel[_0x5793('0x39')]()[_0x5793('0x3a')](_0x5793('0x21'))[_0x5793('0x3d')]('cm_hopper')[_0x5793('0x3f')](_0x3ff167+_0x5793('0x44'),_0x31cc2a['id'][_0x5793('0x3c')]())))[_0x5793('0x3c')]();return _0x51a528;};var _0x32fd64=function(_0x2d3d00,_0x4468ad){var _0x2ae635=squel[_0x5793('0x32')]()[_0x5793('0x33')](_0x5793('0x45'))[_0x5793('0x34')]([_0x5793('0x21'),_0x5793('0x35'),'ContactId',_0x5793('0x27'),_0x4468ad,_0x5793('0x37'),'updatedAt'],squel['select']()[_0x5793('0x3a')](_0x5793('0x21'),_0x5793('0x21'))[_0x5793('0x3a')](_0x5793('0x3b'),_0x5793('0x35'))[_0x5793('0x3a')]('id',_0x5793('0x36'))[_0x5793('0x3a')](LISTID['toString'](),'ListId')[_0x5793('0x3a')](_0x2d3d00['id']['toString'](),_0x4468ad)[_0x5793('0x3a')](_0x5793('0x3b'),_0x5793('0x37'))[_0x5793('0x3a')](_0x5793('0x3b'),_0x5793('0x38'))[_0x5793('0x3d')]('cm_contacts')[_0x5793('0x3f')](_0x5793('0x40'))[_0x5793('0x3f')](_0x5793('0x41'),LISTID[_0x5793('0x3c')]())[_0x5793('0x3f')](_0x5793('0x46'),squel[_0x5793('0x47')](hopperContacts))[_0x5793('0x3f')](_0x5793('0x42'))[_0x5793('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5793('0x39')]()[_0x5793('0x3a')]('calleridnum')['from']('cm_hopper_final')[_0x5793('0x3f')](_0x4468ad+'\x20=\x20?',_0x2d3d00['id'][_0x5793('0x3c')]()))[_0x5793('0x3f')](_0x5793('0x43'),squel['select']()['field'](_0x5793('0x21'))[_0x5793('0x3d')](_0x5793('0x45'))[_0x5793('0x3f')](_0x4468ad+'\x20=\x20?',_0x2d3d00['id'][_0x5793('0x3c')]())))[_0x5793('0x3c')]();return _0x2ae635;};function _0x4ceb94(_0x38abbd,_0x22c1bc){var _0x4f25b4=squel[_0x5793('0x32')]()['into'](_0x5793('0x45'))[_0x5793('0x34')]([_0x5793('0x21'),_0x5793('0x35'),_0x5793('0x36'),_0x5793('0x27'),_0x22c1bc,_0x5793('0x37'),_0x5793('0x38')],squel[_0x5793('0x39')]()[_0x5793('0x3a')](_0x5793('0x21'),_0x5793('0x21'))[_0x5793('0x3a')](_0x5793('0x3b'),_0x5793('0x35'))[_0x5793('0x3a')]('id',_0x5793('0x36'))[_0x5793('0x3a')](LISTID[_0x5793('0x3c')](),_0x5793('0x27'))['field'](_0x38abbd['id'][_0x5793('0x3c')](),_0x22c1bc)[_0x5793('0x3a')]('NOW()',_0x5793('0x37'))[_0x5793('0x3a')](_0x5793('0x3b'),'updatedAt')[_0x5793('0x3d')](_0x5793('0x3e'))['where'](_0x5793('0x40'))['where'](_0x5793('0x41'),LISTID['toString']())[_0x5793('0x3f')](_0x5793('0x46'),squel[_0x5793('0x47')](hopperContacts))[_0x5793('0x3f')](_0x5793('0x42')))[_0x5793('0x3c')]();return _0x4f25b4;}function _0x5dce9d(_0x24fe80,_0x2d5fac){var _0x39608a=squel[_0x5793('0x32')]()[_0x5793('0x33')](_0x5793('0x48'))[_0x5793('0x34')]([_0x5793('0x21'),_0x5793('0x36'),'ListId',_0x2d5fac,_0x5793('0x37'),'updatedAt'],squel[_0x5793('0x39')]()['field'](_0x5793('0x21'),_0x5793('0x21'))[_0x5793('0x3a')]('id',_0x5793('0x36'))[_0x5793('0x3a')](LISTID[_0x5793('0x3c')](),'ListId')[_0x5793('0x3a')](_0x24fe80['id'][_0x5793('0x3c')](),_0x2d5fac)[_0x5793('0x3a')](_0x5793('0x3b'),_0x5793('0x37'))['field'](_0x5793('0x3b'),_0x5793('0x38'))[_0x5793('0x3d')]('cm_contacts')['where'](_0x5793('0x40'))['where'](_0x5793('0x41'),LISTID[_0x5793('0x3c')]())[_0x5793('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x5793('0x3f')](_0x5793('0x42')))[_0x5793('0x3c')]();return _0x39608a;}return db['VoiceQueue'][_0x5793('0x49')]({'where':{'type':_0x5793('0x4a')},'attributes':['id',_0x5793('0x4b')],'include':[{'model':db[_0x5793('0x4c')],'as':'Lists','where':{'id':LISTID}}]})[_0x5793('0x2e')](function(_0x3824f8){var _0xdaec7b=[];if(_0x3824f8){var _0x419598;for(var _0x4f8126=0x0,_0x1d59a8;_0x4f8126<_0x3824f8['length'];_0x4f8126+=0x1){_0x1d59a8=_0x3824f8[_0x4f8126][_0x5793('0x4d')]({'plain':!![]});switch(_0x1d59a8[_0x5793('0x4b')]){case _0x5793('0x4e'):_0xdaec7b[_0x5793('0x4f')](db[_0x5793('0x50')]['query'](_0x32fd64(_0x1d59a8,'VoiceQueueId'))[_0x5793('0x2e')](function(){})[_0x5793('0x51')](_0xd1730e()));break;case _0x5793('0x52'):_0xdaec7b[_0x5793('0x4f')](db[_0x5793('0x50')][_0x5793('0x53')](_0x1b3865(_0x1d59a8,_0x5793('0x54')))[_0x5793('0x2e')](function(){})[_0x5793('0x51')](_0xd1730e()));break;default:_0xdaec7b[_0x5793('0x4f')](db[_0x5793('0x50')][_0x5793('0x53')](_0x4ceb94(_0x1d59a8,'VoiceQueueId'))[_0x5793('0x2e')](function(){})[_0x5793('0x51')](_0xd1730e()));}}}return _0xdaec7b;})[_0x5793('0x55')]()[_0x5793('0x2e')](function(){return db[_0x5793('0x56')][_0x5793('0x49')]({'where':{'type':_0x5793('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x5793('0x57'),'where':{'id':LISTID}}]})[_0x5793('0x2e')](function(_0x529e59){var _0x4189cf=[];if(_0x529e59){var _0x5ec614;for(var _0x1d6506=0x0,_0x1f17fa;_0x1d6506<_0x529e59[_0x5793('0x29')];_0x1d6506+=0x1){_0x1f17fa=_0x529e59[_0x1d6506]['get']({'plain':!![]});_0x4189cf[_0x5793('0x4f')](db[_0x5793('0x50')][_0x5793('0x53')](_0x5dce9d(_0x1f17fa,_0x5793('0x54')))[_0x5793('0x2e')](function(){})[_0x5793('0x51')](_0xd1730e()));}}return _0x4189cf;})[_0x5793('0x55')]();})['then'](function(){return db['Campaign'][_0x5793('0x49')]({'attributes':['id',_0x5793('0x4b')],'include':[{'model':db[_0x5793('0x4c')],'as':_0x5793('0x58'),'where':{'id':LISTID}}]})[_0x5793('0x2e')](function(_0x25b423){var _0x4334cf=[];if(_0x25b423){for(var _0x25937e=0x0,_0x826894;_0x25937e<_0x25b423[_0x5793('0x29')];_0x25937e+=0x1){_0x826894=_0x25b423[_0x25937e][_0x5793('0x4d')]({'plain':!![]});switch(_0x826894[_0x5793('0x4b')]){case _0x5793('0x4e'):_0x4334cf[_0x5793('0x4f')](db['sequelize'][_0x5793('0x53')](_0x32fd64(_0x826894,'CampaignId'))['then'](function(){})['catch'](_0xd1730e()));break;case _0x5793('0x52'):_0x4334cf[_0x5793('0x4f')](db[_0x5793('0x50')]['query'](_0x1b3865(_0x826894,_0x5793('0x59')))[_0x5793('0x2e')](function(){})[_0x5793('0x51')](_0xd1730e()));break;default:_0x4334cf[_0x5793('0x4f')](db['sequelize']['query'](_0x4ceb94(_0x826894,_0x5793('0x59')))[_0x5793('0x2e')](function(){})[_0x5793('0x51')](_0xd1730e()));}}}return _0x4334cf;})[_0x5793('0x55')]();})[_0x5793('0x2e')](function(){return db[_0x5793('0x5a')][_0x5793('0x49')]({'attributes':['id'],'include':[{'model':db[_0x5793('0x4c')],'as':_0x5793('0x57'),'where':{'id':LISTID}}]})[_0x5793('0x2e')](function(_0x5550f4){var _0x847b49=[];if(_0x5550f4){for(var _0x73ca2b=0x0,_0x374949;_0x73ca2b<_0x5550f4[_0x5793('0x29')];_0x73ca2b+=0x1){_0x374949=_0x5550f4[_0x73ca2b]['get']({'plain':!![]});_0x847b49[_0x5793('0x4f')](db[_0x5793('0x50')][_0x5793('0x53')](_0x5dce9d(_0x374949,_0x5793('0x59')))[_0x5793('0x2e')](function(){})[_0x5793('0x51')](_0xd1730e()));}}return _0x847b49;})[_0x5793('0x55')]();})[_0x5793('0x51')](function(_0x49aa2f){logger[_0x5793('0x13')](_0x5793('0x5b'),'generalCheckHopper',_0x49aa2f[_0x5793('0x1b')]);});}var processPromises=function(_0x3862b8){return BPromise[_0x5793('0x55')](promises)[_0x5793('0x2e')](function(_0xb5a1a8){})[_0x5793('0x51')](function(_0x41e4cc){logger[_0x5793('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0x5793('0x2f')](_0x41e4cc));})[_0x5793('0x5c')](function(){socket[_0x5793('0x5d')](_0x5793('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3862b8){return _0x3862b8[_0x5793('0x5f')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x5793('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x52145a){logger[_0x5793('0x13')](_0x5793('0x60'),JSON['stringify'](_0x52145a));}finally{process['exit'](0x0);}});};process['on'](_0x5793('0x61'),function(){logger[_0x5793('0x62')](_0x5793('0x63'));endCsv();});function main(){return BPromise['resolve']()[_0x5793('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5793('0x10')](',');return db[_0x5793('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5793('0x2e')](function(_0x38962c){var _0x48eb53=fs[_0x5793('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x48eb53,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ac7e3,_0x5c62da){total+=0x1;var _0x591245=total;promises[_0x5793('0x4f')](checkRow(_0x5ac7e3,_0x38962c,_0x591245)[_0x5793('0x2e')](function(){success+=0x1;})[_0x5793('0x51')](function(_0x330716){if(_0x330716[_0x5793('0x13')]){errors+=0x1;delete _0x330716[_0x5793('0x13')];}else if(_0x330716[_0x5793('0x2b')]){duplicates+=0x1;delete _0x330716[_0x5793('0x2b')];}rows[_0x5793('0x4f')](_0x330716);}));if(total%0xc8===0x0){_0x5c62da[_0x5793('0x65')]();return processPromises(_0x5c62da);}},'complete':function(){return processPromises()[_0x5793('0x2e')](function(){logger[_0x5793('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x91ba99,_0x309522){logger[_0x5793('0x62')]('CSV\x20parse\x20error',JSON[_0x5793('0x2f')](_0x91ba99));endCsv();}});})[_0x5793('0x51')](function(_0x195f98){logger['error'](_0x5793('0x66'),JSON[_0x5793('0x2f')](_0x195f98));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5a672fa..60c965e 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 _0x0acf=['format','select','field','phone','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','push','all','split','length','isNil','filter','CmContactHasItem','findOne','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','insert','into','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','recallme','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','createdAt','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','UserId','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','Received\x20SIGINT','message','exit','errors','code','query','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','spread','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','set','dialTimezone','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','ContactItemType','findAll','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','dateOfBirth','YYYY-MM-DD','utcOffset','firstName','\x20not\x20specified','itemTypeId','description','appendFileSync','emit','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','contact:import:','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter'];(function(_0x253d8c,_0x3b6071){var _0x466588=function(_0x4921a3){while(--_0x4921a3){_0x253d8c['push'](_0x253d8c['shift']());}};_0x466588(++_0x3b6071);}(_0x0acf,0xac));var _0xf0ac=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0x0acf[_0x5528c3];return _0x47ec1b;};'use strict';var fs=require('fs');var path=require(_0xf0ac('0x0'));var _=require(_0xf0ac('0x1'));var Papa=require('papaparse');var util=require(_0xf0ac('0x2'));var BPromise=require(_0xf0ac('0x3'));var moment=require(_0xf0ac('0x4'));var squel=require(_0xf0ac('0x5'));var Redis=require(_0xf0ac('0x6'));var db=require(_0xf0ac('0x7'))['db'];var config=require(_0xf0ac('0x8'));var shared=require(_0xf0ac('0x9'));var logger=require(_0xf0ac('0xa'))(_0xf0ac('0xb'));config['redis']=_[_0xf0ac('0xc')](config[_0xf0ac('0xd')],{'host':_0xf0ac('0xe'),'port':0x18eb});var socket=require(_0xf0ac('0xf'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xf0ac('0x10')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf0ac('0x10')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x45294e){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'](_0x45294e);}function selectNotIn(_0x2e8829,_0x2fc2c5,_0x15c67e,_0x3dbcac,_0x1db7cc){return squel[_0xf0ac('0x11')]()[_0xf0ac('0x12')](_0xf0ac('0x13'))[_0xf0ac('0x14')](_0x3dbcac)['join'](_0x2fc2c5,null,_0x2fc2c5+_0xf0ac('0x15')+_0x3dbcac+'.'+_0x15c67e)['where'](_0x3dbcac+'.'+_0x15c67e+_0xf0ac('0x16')+_0x2e8829+'.'+_0x15c67e)[_0xf0ac('0x17')](_0x2fc2c5+_0xf0ac('0x18')+_0x1db7cc['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x58aeba,_0x346295){promisesAdditionalPhones=[];return db[_0xf0ac('0x19')]['findAll']({'raw':!![],'attributes':['id',_0xf0ac('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xf0ac('0x1b')](function(_0x4500f4){if(_0x4500f4!==null){var _0xcc10e0=[];for(var _0x2d3cc8=0x0;_0x2d3cc8<_0x4500f4['length'];_0x2d3cc8++){var _0x16d45f=_0x4500f4[_0x2d3cc8];_0xcc10e0[_0xf0ac('0x1c')](insertAdditionalPhones(_0x16d45f));}}Promise[_0xf0ac('0x1d')](_0xcc10e0)[_0xf0ac('0x1b')](function(){_0x58aeba({'val':0x1});});});});}function insertAdditionalPhones(_0x4db13f){return new Promise(function(_0x4e6b22,_0x19ed4c){var _0x3f6674=_0x4db13f[_0xf0ac('0x1a')];var _0x52d89b=_0x3f6674[_0xf0ac('0x1e')](';');var _0x4b0c20=[];orderBy=0x0;for(var _0x28d4bf=0x0;_0x28d4bf<_0x52d89b['length'];_0x28d4bf++){_0x4b0c20[_0xf0ac('0x1c')](splitAdditionalPhone(_0x4db13f['id'],_0x52d89b[_0x28d4bf]));}Promise[_0xf0ac('0x1d')](_0x4b0c20)[_0xf0ac('0x1b')](function(){_0x4e6b22({'val':_0x52d89b[_0xf0ac('0x1f')]});});});}function splitAdditionalPhone(_0x12a9c6,_0x5d6154){return new Promise(function(_0x3eb449,_0x2fb580){var _0x137dba=_0x5d6154['split'](':');var _0x911218=_0x137dba[0x0];var _0x369461=_0x137dba[0x1];if(!_[_0xf0ac('0x20')](_0x369461)){var _0x48e695=_0x369461[_0xf0ac('0x1e')]('|');var _0x2f7cb0=[];for(var _0x4ac4a8=0x0;_0x4ac4a8<_0x48e695[_0xf0ac('0x1f')];_0x4ac4a8++){if(_0x48e695[_0x4ac4a8]!==''){var _0x3694a4=_[_0xf0ac('0x21')](promisesAdditionalPhones,{'contactId':_0x12a9c6,'phone':_0x48e695[_0x4ac4a8]});if(_0x3694a4[_0xf0ac('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0xf0ac('0x1c')]({'contactId':_0x12a9c6,'contactTypeId':_0x911218,'phone':_0x48e695[_0x4ac4a8],'orderBy':orderBy});}}}_0x3eb449({'ok':0x1});}else _0x3eb449({'res':0x0});});}function createAdditionalPhone(_0x52e76b,_0x481445,_0x388fb9,_0xb22ae9){var _0x23a8a5='';var _0x30a438='';var _0x403771=_0x388fb9[_0xf0ac('0x1e')]('§');_0x23a8a5=_0x403771[0x0];if(_0x403771['length']==0x2)_0x30a438=_0x403771[0x1];return new Promise(function(_0x9791e8,_0x3a2677){return db[_0xf0ac('0x22')][_0xf0ac('0x23')]({'where':{'CmContactId':_0x52e76b,'item':_0x23a8a5}})['then'](function(_0x36b90b){if(_0x36b90b){return db[_0xf0ac('0x22')][_0xf0ac('0x24')]({'ItemTypeId':_0x481445,'description':_0x30a438,'OrderBy':_0xb22ae9},{'where':{'CmContactId':_0x52e76b,'item':_0x23a8a5}})[_0xf0ac('0x1b')](function(_0x28c261){_0x9791e8({'res':_0xf0ac('0x25')});});}else{return db['CmContactHasItem'][_0xf0ac('0x26')]({'CmContactId':_0x52e76b,'item':_0x23a8a5,'description':_0x30a438,'ItemTypeId':_0x481445,'OrderBy':_0xb22ae9,'ItemClass':'PHONE'})[_0xf0ac('0x1b')](function(_0x3dce9f){_0x9791e8({'res':_0xf0ac('0x27')});});}});});}function insertCmHopper(_0x1a1e07,_0x3c3490,_0x170888,_0x4833ef,_0x46637e){var _0x1c88d8=[_0xf0ac('0x28'),_0xf0ac('0x29'),_0xf0ac('0x2a'),_0xf0ac('0x2b'),_0x3c3490+'.'+_0x4833ef,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xf0ac('0x2c'),'cm_contacts.UserId','\x22'+_0x46637e+'\x22'];return squel[_0xf0ac('0x2d')]()[_0xf0ac('0x2e')]('cm_hopper')[_0xf0ac('0x2f')]([_0xf0ac('0x13'),_0xf0ac('0x30'),_0xf0ac('0x31'),_0xf0ac('0x32'),_0x4833ef,'createdAt',_0xf0ac('0x33'),_0xf0ac('0x34'),'UserId',_0xf0ac('0x35')],squel['select']()[_0xf0ac('0x36')](_0x1c88d8)[_0xf0ac('0x14')](_0x3c3490)[_0xf0ac('0x37')](_0xf0ac('0x38'),null,_0xf0ac('0x39')+_0x3c3490+_0xf0ac('0x3a'))[_0xf0ac('0x37')](_0x170888,null,_0x170888+_0xf0ac('0x15')+_0x3c3490+'.'+_0x4833ef)[_0xf0ac('0x17')](_0x3c3490+_0xf0ac('0x3b'),_0x1a1e07)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf0ac('0x17')](_0xf0ac('0x3c'),selectNotIn(_0x3c3490,_0x170888,_0x4833ef,_0xf0ac('0x3d'),[_0xf0ac('0x3e'),_0xf0ac('0x3f')]))[_0xf0ac('0x17')](_0xf0ac('0x3c'),selectNotIn(_0x3c3490,_0x170888,_0x4833ef,'cm_hopper',['\x22always\x22'])))[_0xf0ac('0x40')]();}function insertCmHopperBlack(_0x29c249,_0x441352,_0x13e61d,_0x2727eb){var _0x55eabc=['cm_contacts.phone',_0xf0ac('0x2a'),_0xf0ac('0x2b'),_0x441352+'.'+_0x2727eb,_0xf0ac('0x41'),_0xf0ac('0x42')];return squel[_0xf0ac('0x2d')]()[_0xf0ac('0x2e')](_0xf0ac('0x43'))[_0xf0ac('0x2f')]([_0xf0ac('0x13'),_0xf0ac('0x31'),_0xf0ac('0x32'),_0x2727eb,_0xf0ac('0x44'),_0xf0ac('0x33')],squel[_0xf0ac('0x11')]()[_0xf0ac('0x36')](_0x55eabc)['from'](_0x441352)[_0xf0ac('0x37')](_0xf0ac('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x441352+_0xf0ac('0x3a'))[_0xf0ac('0x37')](_0x13e61d,null,_0x13e61d+_0xf0ac('0x15')+_0x441352+'.'+_0x2727eb)['where'](_0x441352+_0xf0ac('0x3b'),_0x29c249)[_0xf0ac('0x17')](_0xf0ac('0x45'),NOW)[_0xf0ac('0x17')](_0xf0ac('0x3c'),squel[_0xf0ac('0x11')]()[_0xf0ac('0x12')](_0xf0ac('0x13'))[_0xf0ac('0x14')](_0xf0ac('0x43'))[_0xf0ac('0x17')](_0xf0ac('0x46'),_0x29c249)['where'](_0x2727eb+_0xf0ac('0x16')+_0x441352+'.'+_0x2727eb)))['toString']();}function insertTzCmHopper(_0x345440,_0x4df6fe,_0x2c6345,_0x283763,_0xca5a5,_0x5cc9f3){var _0x1fd436=['cm_contacts.phone',_0xf0ac('0x47')+_0x5cc9f3+_0xf0ac('0x48'),_0xf0ac('0x2a'),_0xf0ac('0x2b'),_0x4df6fe+'.'+_0x283763,_0xf0ac('0x41'),'cm_contacts.updatedAt',_0xf0ac('0x2c'),_0xf0ac('0x49'),'\x22'+_0xca5a5+'\x22'];var _0x379312=squel[_0xf0ac('0x2d')]()['into'](_0xf0ac('0x3d'))['fromQuery']([_0xf0ac('0x13'),'scheduledat',_0xf0ac('0x31'),_0xf0ac('0x32'),_0x283763,_0xf0ac('0x44'),_0xf0ac('0x33'),'priority',_0xf0ac('0x4a'),'recallme'],squel[_0xf0ac('0x11')]()[_0xf0ac('0x36')](_0x1fd436)['from'](_0x4df6fe)['join'](_0xf0ac('0x38'),null,_0xf0ac('0x39')+_0x4df6fe+_0xf0ac('0x3a'))[_0xf0ac('0x37')](_0x2c6345,null,_0x2c6345+_0xf0ac('0x15')+_0x4df6fe+'.'+_0x283763)[_0xf0ac('0x37')](_0x5cc9f3,null,_0x5cc9f3+_0xf0ac('0x15')+_0x4df6fe+'.'+_0x283763)[_0xf0ac('0x17')](_0x4df6fe+'.CmListId\x20=\x20?',_0x345440)[_0xf0ac('0x17')](_0xf0ac('0x45'),NOW)[_0xf0ac('0x17')](_0xf0ac('0x3c'),selectNotIn(_0x4df6fe,_0x2c6345,_0x283763,_0xf0ac('0x3d'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xf0ac('0x17')](_0xf0ac('0x3c'),selectNotIn(_0x4df6fe,_0x2c6345,_0x283763,_0xf0ac('0x3d'),['\x22always\x22'])))[_0xf0ac('0x40')]();return _0x379312;}function insertTzCmHopperBlack(_0x36aa43,_0x516bdb,_0x3f5104,_0x4d83c7){var _0x51e686=[_0xf0ac('0x28'),'cm_contacts.id',_0xf0ac('0x2b'),_0x516bdb+'.'+_0x4d83c7,_0xf0ac('0x41'),_0xf0ac('0x42')];return squel[_0xf0ac('0x2d')]()['into'](_0xf0ac('0x43'))[_0xf0ac('0x2f')]([_0xf0ac('0x13'),_0xf0ac('0x31'),'ListId',_0x4d83c7,_0xf0ac('0x44'),_0xf0ac('0x33')],squel[_0xf0ac('0x11')]()[_0xf0ac('0x36')](_0x51e686)[_0xf0ac('0x14')](_0x516bdb)[_0xf0ac('0x37')]('cm_contacts',null,_0xf0ac('0x39')+_0x516bdb+'.CmListId')['join'](_0x3f5104,null,_0x3f5104+_0xf0ac('0x15')+_0x516bdb+'.'+_0x4d83c7)['where'](_0x516bdb+_0xf0ac('0x3b'),_0x36aa43)[_0xf0ac('0x17')](_0xf0ac('0x45'),NOW)[_0xf0ac('0x17')](_0xf0ac('0x3c'),squel[_0xf0ac('0x11')]()[_0xf0ac('0x12')](_0xf0ac('0x13'))[_0xf0ac('0x14')](_0xf0ac('0x43'))[_0xf0ac('0x17')]('ListId\x20=\x20?',_0x36aa43)[_0xf0ac('0x17')](_0x4d83c7+'\x20=\x20'+_0x516bdb+'.'+_0x4d83c7)))[_0xf0ac('0x40')]();}function insertCmHopperAdditionalPhones(_0xae5235){var _0x2ffd1d=[_0xf0ac('0x4b'),'cm_contact_has_items.item',_0xf0ac('0x4c'),_0xf0ac('0x4d'),_0xf0ac('0x4e')];return squel['insert']()[_0xf0ac('0x2e')](_0xf0ac('0x4f'))[_0xf0ac('0x2f')]([_0xf0ac('0x50'),_0xf0ac('0x13'),_0xf0ac('0x51'),'createdAt',_0xf0ac('0x33')],squel[_0xf0ac('0x11')]()[_0xf0ac('0x36')](_0x2ffd1d)['from'](_0xf0ac('0x3d'))['join'](_0xf0ac('0x38'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xf0ac('0x37')](_0xf0ac('0x52'),null,_0xf0ac('0x53'))[_0xf0ac('0x17')](_0xf0ac('0x54'),_0xae5235)[_0xf0ac('0x17')](_0xf0ac('0x45'),NOW))[_0xf0ac('0x40')]();}function insertCmContact(_0x16f69b,_0x33cb83,_0x48a2ef,_0x577984){var _0x288de6=_[_0xf0ac('0x55')](_[_0xf0ac('0x56')](_0x577984),[_0xf0ac('0x32'),_0xf0ac('0x57'),_0xf0ac('0x44'),_0xf0ac('0x33')]);return squel[_0xf0ac('0x2d')]()[_0xf0ac('0x2e')](_0xf0ac('0x38'))[_0xf0ac('0x2f')](_0x288de6,squel[_0xf0ac('0x11')]()['fields'](_0x288de6)[_0xf0ac('0x14')](_0x33cb83)[_0xf0ac('0x17')]('('+_0x48a2ef['join'](',')+_0xf0ac('0x58'),squel[_0xf0ac('0x11')]()['fields'](_0x48a2ef)['from'](_0xf0ac('0x38'))['where'](_0xf0ac('0x46'),_0x16f69b)['where'](_0xf0ac('0x59')))['where']('id\x20IN\x20?',squel[_0xf0ac('0x11')]()['field']('MIN(id)',_0xf0ac('0x5a'))[_0xf0ac('0x14')](_0x33cb83)[_0xf0ac('0x5b')](_0x48a2ef[_0xf0ac('0x37')](','))))[_0xf0ac('0x40')]();}function handleStop(){logger[_0xf0ac('0x5c')](_0xf0ac('0x5d'));stopped=!![];}function handleUncaughtException(_0x555e0a){logger['error'](_0x555e0a[_0xf0ac('0x5e')]);process[_0xf0ac('0x5f')](0x1);}function handleError(_0x22f72d,_0x177199){stats[_0xf0ac('0x60')]['push']({'name':_0x177199[_0xf0ac('0x61')],'message':_0x177199[_0xf0ac('0x5e')],'row':_0x22f72d});}function handleQuery(_0x5d3e1d){logger['info'](_0x5d3e1d);return db['sequelize'][_0xf0ac('0x62')](_0x5d3e1d)['spread'](function(_0x43b5e4){results[_0xf0ac('0x1c')](_0x43b5e4);})[_0xf0ac('0x63')](function(_0x573dbd){logger[_0xf0ac('0x64')](_0x573dbd[_0xf0ac('0x5e')]);});}function updateTzCampaigns(_0x4c416d){return new Promise(function(_0x53f356,_0x3b504a){var _0x477a35=squel[_0xf0ac('0x11')]()[_0xf0ac('0x36')]([_0xf0ac('0x65'),_0xf0ac('0x66')])[_0xf0ac('0x14')](_0xf0ac('0x67'))['join'](_0xf0ac('0x68'),null,_0xf0ac('0x69'))['where'](_0xf0ac('0x6a')+_0x4c416d);db[_0xf0ac('0x6b')][_0xf0ac('0x62')](_0x477a35[_0xf0ac('0x40')]())[_0xf0ac('0x6c')](function(_0x3fab05){var _0x21e35e=[];for(var _0x40cb18=0x0;_0x40cb18<_0x3fab05[_0xf0ac('0x1f')];_0x40cb18++){_0x21e35e[_0xf0ac('0x1c')](getTimezoneData(_0x3fab05[_0x40cb18],tmp_campaigns));}BPromise['all'](_0x21e35e)['then'](function(){_0x53f356({'val':0x1});});})[_0xf0ac('0x63')](function(_0x194299){logger[_0xf0ac('0x64')](_0x194299[_0xf0ac('0x5e')]);_0x53f356({'val':0x0});});});}function updateTzVoiceQueues(_0x36315d){return new Promise(function(_0x2c8280,_0xcb9134){var _0x335115=squel['select']()[_0xf0ac('0x36')](['voice_queues.id','voice_queues.dialTimezone'])[_0xf0ac('0x14')](_0xf0ac('0x6d'))[_0xf0ac('0x37')](_0xf0ac('0x6e'),null,_0xf0ac('0x6f'))[_0xf0ac('0x17')](_0xf0ac('0x70')+_0x36315d);db['sequelize'][_0xf0ac('0x62')](_0x335115['toString']())['spread'](function(_0x4d4573){var _0x4c4465=[];for(var _0x1119d2=0x0;_0x1119d2<_0x4d4573[_0xf0ac('0x1f')];_0x1119d2++){_0x4c4465['push'](getTimezoneData(_0x4d4573[_0x1119d2],tmp_voice_queues));}BPromise[_0xf0ac('0x1d')](_0x4c4465)['then'](function(){_0x2c8280({'val':0x1});});})[_0xf0ac('0x63')](function(_0xc7d615){logger[_0xf0ac('0x64')](_0xc7d615['message']);_0x2c8280({'val':0x0});});});}function getTimezoneData(_0x53d31c,_0x50b7a4){return new Promise(function(_0x117173,_0x3ff42e){var _0x284091=shared[_0xf0ac('0x71')];var _0x1cca75=_0x284091[_0x53d31c['dialTimezone']];if(_['isNil'](_0x1cca75)){_0x117173({'ret':0x1});}else{var _0x4a8a73=_0x1cca75['utcOffset'];var _0x5367c4=squel[_0xf0ac('0x2d')]()[_0xf0ac('0x2e')](_0x50b7a4)[_0xf0ac('0x72')]('id',_0x53d31c['id'])[_0xf0ac('0x72')]('offset',_0x4a8a73)['set'](_0xf0ac('0x73'),_0x53d31c[_0xf0ac('0x73')])[_0xf0ac('0x40')]();return db[_0xf0ac('0x6b')][_0xf0ac('0x62')](_0x5367c4)['spread'](function(_0x156ee9){_0x117173({'ret':0x1});})['catch'](function(_0x60268d){logger[_0xf0ac('0x64')](_0x60268d[_0xf0ac('0x5e')]);_0x3ff42e({'ret':0x1});});}});}function handleTZQuery(_0x3d4e4b){logger[_0xf0ac('0x5c')](_0x3d4e4b);return db[_0xf0ac('0x6b')][_0xf0ac('0x62')](_0x3d4e4b)[_0xf0ac('0x6c')](function(_0x3380b8){})[_0xf0ac('0x63')](function(_0x2cb9b4){logger[_0xf0ac('0x64')](_0x2cb9b4[_0xf0ac('0x5e')]);});}function main(_0x3acc6d,_0x380fc7,_0x29ae59,_0x225712){logger[_0xf0ac('0x5c')](_0xf0ac('0x74'),_0x3acc6d,JSON[_0xf0ac('0x75')](_0x380fc7));process[_0xf0ac('0x76')](_0xf0ac('0x77'));var _0x4db6e0=_0x380fc7[_0xf0ac('0x78')];var _0xde5ecf=_[_0xf0ac('0x79')](_0x4db6e0);var _0x277d84=_0x380fc7[_0xf0ac('0x7a')];var _0x2ffa86=path['join'](config[_0xf0ac('0x7b')],_0xf0ac('0x7c'),_0x277d84+_0xf0ac('0x7d'));hasTZ=_[_0xf0ac('0x56')](_0x4db6e0)[_0xf0ac('0x7e')](_0xf0ac('0x73'));var _0x269026=_[_0xf0ac('0x56')](_0x4db6e0)['join']();logger['info']('header',_0x269026);db[_0xf0ac('0x7f')][_0xf0ac('0x80')]({'raw':!![],'attributes':['id','name']})[_0xf0ac('0x1b')](function(_0xf1d2d1){for(var _0x15594f=0x0;_0x15594f<_0xf1d2d1[_0xf0ac('0x1f')];_0x15594f++){if(_0xf1d2d1[_0x15594f][_0xf0ac('0x81')]in _0x4db6e0){contactItemTypes['push'](_0xf1d2d1[_0x15594f]);delete _0xde5ecf[_0xf1d2d1[_0x15594f][_0xf0ac('0x81')]];hasAdditionalPhones=!![];}for(var _0xa22997 in _0x4db6e0){if(_0xf1d2d1[_0x15594f][_0xf0ac('0x81')]+_0xf0ac('0x82')===_0xa22997){phoneDescriptions[_0xf0ac('0x1c')]({'itemTypeId':_0xf1d2d1[_0x15594f]['id'],'description':_0xa22997});delete _0xde5ecf[_0xa22997];}}}if(hasAdditionalPhones)_0xde5ecf[_0xf0ac('0x1a')]='';var _0x4725f3=_[_0xf0ac('0x56')](_0xde5ecf)[_0xf0ac('0x37')]();logger[_0xf0ac('0x5c')]('header',_0x4725f3);fs[_0xf0ac('0x83')](_0x2ffa86,_0x4725f3+'\x0a');Papa[_0xf0ac('0x84')](fs[_0xf0ac('0x85')](_0x3acc6d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x58757d,_0x362ca0){try{for(var _0x4564da=0x0,_0xcd562a=[];_0x4564da<_0x58757d[_0xf0ac('0x86')][_0xf0ac('0x1f')];_0x4564da++){stats[_0xf0ac('0x87')]+=0x1;if(_0x58757d['errors'][_0x4564da]){handleError(_0x58757d[_0xf0ac('0x86')][_0x4564da],_0x58757d[_0xf0ac('0x60')][_0x4564da]);}else{var _0x1e8716=[];var _0x35b1fe=[];var _0x3cedfe={};for(var _0x50c1b2 in _0x4db6e0){let _0x546e39=contactItemTypes[_0xf0ac('0x88')](_0x390c42=>_0x390c42[_0xf0ac('0x81')]===_0x50c1b2);let _0x3945c3=contactItemTypes[_0xf0ac('0x88')](_0x2839a3=>_0x2839a3['name']+_0xf0ac('0x82')===_0x50c1b2);if(_[_0xf0ac('0x20')](_0x546e39)&&_['isNil'](_0x3945c3)){if(_0x4db6e0[_0xf0ac('0x89')](_0x50c1b2)){if(_0x58757d[_0xf0ac('0x86')][_0x4564da][_0x4db6e0[_0x50c1b2]]){var _0x50672b=_[_0xf0ac('0x8a')](_0x58757d['data'][_0x4564da][_0x4db6e0[_0x50c1b2]][_0xf0ac('0x8b')](/"/g,'\x27'));switch(_0x50c1b2){case _0xf0ac('0x30'):var _0x4db1a7=moment(_0x50672b,_0xf0ac('0x8c'),!![]);if(_0x4db1a7[_0xf0ac('0x8d')]()){_0xcd562a['push']('\x22'+_0x50672b+'\x22');}else{_0x1e8716[_0xf0ac('0x1c')](_0xf0ac('0x8e'));}break;case _0xf0ac('0x34'):var _0xedef01=parseInt(_0x50672b);_0x50672b=_[_0xf0ac('0x8f')](_0xedef01)||_0xedef01<0x0||_0xedef01>0x4?_0x225712?0x3:0x2:_0xedef01;_0xcd562a[_0xf0ac('0x1c')]('\x22'+_0x50672b+'\x22');break;case _0xf0ac('0x4a'):var _0x57a55c=parseInt(_0x50672b);if(_[_0xf0ac('0x90')](_0x57a55c)&&_[_0xf0ac('0x7e')](_0x29ae59,_0x57a55c)){_0xcd562a[_0xf0ac('0x1c')]('\x22'+_0x57a55c+'\x22');}else{_0x1e8716[_0xf0ac('0x1c')]('agent\x20not\x20exists');}break;case _0xf0ac('0x91'):if(isEmail(_0x50672b)){_0xcd562a[_0xf0ac('0x1c')]('\x22'+_0x50672b+'\x22');}else{_0x1e8716[_0xf0ac('0x1c')]('email\x20wrong\x20format');}break;case _0xf0ac('0x92'):var _0x54f87c=moment(_0x50672b,_0xf0ac('0x93'),!![]);if(_0x54f87c[_0xf0ac('0x8d')]()){_0xcd562a['push']('\x22'+_0x50672b+'\x22');}else{_0x1e8716[_0xf0ac('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xf0ac('0x73'):var _0xe79bbb=shared[_0xf0ac('0x71')];var _0x70fa77=_0xe79bbb[_0x50672b];if(!_[_0xf0ac('0x20')](_0x70fa77)){var _0x2f46c1=_0x70fa77[_0xf0ac('0x94')];_0xcd562a[_0xf0ac('0x1c')]('\x22'+_0x50672b+'\x22');_0xcd562a[_0xf0ac('0x1c')]('\x22'+_0x2f46c1+'\x22');}break;default:_0xcd562a[_0xf0ac('0x1c')]('\x22'+_0x50672b+'\x22');}}else{switch(_0x50c1b2){case _0xf0ac('0x95'):case _0xf0ac('0x13'):_0x1e8716['push'](_0x50c1b2+_0xf0ac('0x96'));break;default:_0xcd562a[_0xf0ac('0x1c')]('\x22\x22');}}}}else{var _0x3297f4='';if(!_[_0xf0ac('0x20')](_0x546e39)){if(!_0x3cedfe[_0xf0ac('0x89')](_0x546e39['id'])){if(!_[_0xf0ac('0x20')](_0x58757d[_0xf0ac('0x86')][_0x4564da][_0x4db6e0[_0x50c1b2]])){var _0x50672b=_[_0xf0ac('0x8a')](_0x58757d[_0xf0ac('0x86')][_0x4564da][_0x4db6e0[_0x50c1b2]][_0xf0ac('0x8b')](/"/g,'\x27'));var _0xee1a23=phoneDescriptions[_0xf0ac('0x88')](_0x4a8db8=>_0x4a8db8[_0xf0ac('0x97')]===_0x546e39['id']);if(!_[_0xf0ac('0x20')](_0xee1a23)){var _0x3824db=_[_0xf0ac('0x8a')](_0x58757d['data'][_0x4564da][_0x4db6e0[_0xee1a23[_0xf0ac('0x98')]]][_0xf0ac('0x8b')](/"/g,'\x27'));if(!_['isNil'](_0x3824db))_0x50672b=_0x50672b+'§'+_0x3824db;}if(_0x3297f4=='')_0x3297f4=_0x50672b;else _0x3297f4+='|'+_0x50672b;}_0x35b1fe['push'](_0x546e39['id']+':'+_0x3297f4);_0x3cedfe[_0x546e39['id']]=0x1;}}}}if(hasAdditionalPhones){_0xcd562a[_0xf0ac('0x1c')]('\x22'+_0x35b1fe[_0xf0ac('0x37')](';')+'\x22');}if(_0x1e8716[_0xf0ac('0x1f')]){handleError(_0x58757d[_0xf0ac('0x86')][_0x4564da],{'code':'SystemRow','message':_0x1e8716[_0xf0ac('0x37')]()});}else{fs[_0xf0ac('0x99')](_0x2ffa86,_0xcd562a[_0xf0ac('0x37')]()+'\x0a');}_0xcd562a=[];}if(!(stats[_0xf0ac('0x87')]%0xc8)){socket[_0xf0ac('0x9a')]('contact:import:'+_0x277d84,stats);stats[_0xf0ac('0x60')]=[];}}if(stopped){logger[_0xf0ac('0x5c')](_0xf0ac('0x9b'));_0x362ca0['abort']();}}catch(_0x4866e2){handleError(_0x58757d[_0xf0ac('0x86')][_0x4564da],{'code':_0xf0ac('0x9c'),'message':_0x4866e2[_0xf0ac('0x5e')]});logger[_0xf0ac('0x64')](_0xf0ac('0x9d'),_0x4866e2[_0xf0ac('0x5e')]);}},'complete':function(){try{var _0x4f6611=[];var _0x33b8a2=[];var _0x4b5497=_0xf0ac('0x38');if(_0x380fc7[_0xf0ac('0x9e')]&&_0x380fc7[_0xf0ac('0x9e')][_0xf0ac('0x1f')]){_0x4b5497=_0xf0ac('0x9f')+_0x277d84;_0x4f6611[_0xf0ac('0x1c')]('CREATE\x20TABLE\x20'+_0x4b5497+_0xf0ac('0xa0'));}tmp_campaigns=_0xf0ac('0xa1')+_0x277d84;tmp_voice_queues=_0xf0ac('0xa2')+_0x277d84;_0x33b8a2['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0xf0ac('0xa3'));_0x33b8a2['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xf0ac('0xa3'));BPromise[_0xf0ac('0xa4')](_0x33b8a2,handleTZQuery)[_0xf0ac('0x1b')](function(_0x486501){updateTzCampaigns(_0x380fc7[_0xf0ac('0x32')])[_0xf0ac('0x1b')](function(_0x43278f){updateTzVoiceQueues(_0x380fc7[_0xf0ac('0x32')])['then'](function(_0x3508b6){if(hasTZ)_0x4725f3=_0x4725f3['replace']('dialTimezone',_0xf0ac('0xa5'));var _0x17bffe=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',_0x2ffa86,_0x4b5497,_0x4725f3,_0x380fc7['ListId'],_0x380fc7[_0xf0ac('0x57')]||null,NOW,NOW);if(_['isNil'](_0x4db6e0[_0xf0ac('0x30')])){_0x17bffe+=',\x20scheduledAt\x20=\x20NOW()';}_0x4f6611[_0xf0ac('0x1c')](_0x17bffe);if(_0x380fc7[_0xf0ac('0x9e')]&&_0x380fc7[_0xf0ac('0x9e')]['length']){_0x4f6611[_0xf0ac('0x1c')](insertCmContact(_0x380fc7[_0xf0ac('0x32')],_0x4b5497,_0x380fc7[_0xf0ac('0x9e')],_0x4db6e0));_0x4f6611[_0xf0ac('0x1c')](_0xf0ac('0xa6')+_0x4b5497+';');}BPromise['each'](_0x4f6611,handleQuery)['then'](function(_0xf77859){BPromise['all']([handleAdditionalPhones()])[_0xf0ac('0x1b')](function(){_0x4f6611=[];for(var _0x1e36fe=0x0;_0x1e36fe\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','all','split','length','isNil','CmContactHasItem','findOne','update','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','insert','createdAt','cm_contacts.ListId\x20=\x20','cm_hopper_black','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','recallme','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','message','errors','code','info','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','sequelize','query','voice_queues.id','voice_queues','voice_queues_has_cm_lists','catch','timezones','dialTimezone','utcOffset','offset','set'];(function(_0xbca161,_0x4ff432){var _0x16b108=function(_0x1f0463){while(--_0x1f0463){_0xbca161['push'](_0xbca161['shift']());}};_0x16b108(++_0x4ff432);}(_0x1f60,0x1bf));var _0x01f6=function(_0x547e7f,_0x220540){_0x547e7f=_0x547e7f-0x0;var _0x4403d4=_0x1f60[_0x547e7f];return _0x4403d4;};'use strict';var fs=require('fs');var path=require(_0x01f6('0x0'));var _=require(_0x01f6('0x1'));var Papa=require('papaparse');var util=require(_0x01f6('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x01f6('0x3'));var Redis=require(_0x01f6('0x4'));var db=require(_0x01f6('0x5'))['db'];var config=require(_0x01f6('0x6'));var shared=require(_0x01f6('0x7'));var logger=require('../../../config/logger')(_0x01f6('0x8'));config[_0x01f6('0x9')]=_[_0x01f6('0xa')](config[_0x01f6('0x9')],{'host':_0x01f6('0xb'),'port':0x18eb});var socket=require(_0x01f6('0xc'))(new Redis(config[_0x01f6('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x01f6('0xd')](_0x01f6('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x01f6('0xd')](_0x01f6('0xe'));function isEmail(_0x4c4c44){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))*$/[_0x01f6('0xf')](_0x4c4c44);}function selectNotIn(_0x37e208,_0x2898d9,_0x12ab1d,_0x23d709,_0x4da48b){return squel[_0x01f6('0x10')]()[_0x01f6('0x11')](_0x01f6('0x12'))[_0x01f6('0x13')](_0x23d709)[_0x01f6('0x14')](_0x2898d9,null,_0x2898d9+_0x01f6('0x15')+_0x23d709+'.'+_0x12ab1d)['where'](_0x23d709+'.'+_0x12ab1d+_0x01f6('0x16')+_0x37e208+'.'+_0x12ab1d)[_0x01f6('0x17')](_0x2898d9+_0x01f6('0x18')+_0x4da48b[_0x01f6('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2297a5,_0x310da3){promisesAdditionalPhones=[];return db[_0x01f6('0x19')][_0x01f6('0x1a')]({'raw':!![],'attributes':['id',_0x01f6('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x01f6('0x1c')](function(_0x57900d){if(_0x57900d!==null){var _0x4f14a9=[];for(var _0x157c97=0x0;_0x157c97<_0x57900d['length'];_0x157c97++){var _0x49ae84=_0x57900d[_0x157c97];_0x4f14a9[_0x01f6('0x1d')](insertAdditionalPhones(_0x49ae84));}}Promise[_0x01f6('0x1e')](_0x4f14a9)[_0x01f6('0x1c')](function(){_0x2297a5({'val':0x1});});});});}function insertAdditionalPhones(_0x2d06c8){return new Promise(function(_0x5d1ef2,_0x3f16b1){var _0x2f53e7=_0x2d06c8[_0x01f6('0x1b')];var _0x335ca4=_0x2f53e7[_0x01f6('0x1f')](';');var _0x531a05=[];orderBy=0x0;for(var _0x1313cd=0x0;_0x1313cd<_0x335ca4['length'];_0x1313cd++){_0x531a05[_0x01f6('0x1d')](splitAdditionalPhone(_0x2d06c8['id'],_0x335ca4[_0x1313cd]));}Promise[_0x01f6('0x1e')](_0x531a05)[_0x01f6('0x1c')](function(){_0x5d1ef2({'val':_0x335ca4[_0x01f6('0x20')]});});});}function splitAdditionalPhone(_0x517de5,_0x1be7f4){return new Promise(function(_0x4e4627,_0x45c973){var _0x2bbab2=_0x1be7f4[_0x01f6('0x1f')](':');var _0x5778a9=_0x2bbab2[0x0];var _0x13a88c=_0x2bbab2[0x1];if(!_[_0x01f6('0x21')](_0x13a88c)){var _0x69ba8a=_0x13a88c[_0x01f6('0x1f')]('|');var _0x5eec4b=[];for(var _0x5076dd=0x0;_0x5076dd<_0x69ba8a[_0x01f6('0x20')];_0x5076dd++){if(_0x69ba8a[_0x5076dd]!==''){var _0x22d444=_['filter'](promisesAdditionalPhones,{'contactId':_0x517de5,'phone':_0x69ba8a[_0x5076dd]});if(_0x22d444[_0x01f6('0x20')]==0x0){orderBy++;promisesAdditionalPhones[_0x01f6('0x1d')]({'contactId':_0x517de5,'contactTypeId':_0x5778a9,'phone':_0x69ba8a[_0x5076dd],'orderBy':orderBy});}}}_0x4e4627({'ok':0x1});}else _0x4e4627({'res':0x0});});}function createAdditionalPhone(_0x385760,_0x5cd3a4,_0x565d7e,_0x3358b3){var _0x3f7d7e='';var _0x4522f6='';var _0x50ea8d=_0x565d7e[_0x01f6('0x1f')]('§');_0x3f7d7e=_0x50ea8d[0x0];if(_0x50ea8d[_0x01f6('0x20')]==0x2)_0x4522f6=_0x50ea8d[0x1];return new Promise(function(_0x47c98b,_0x48b4ce){return db[_0x01f6('0x22')][_0x01f6('0x23')]({'where':{'CmContactId':_0x385760,'item':_0x3f7d7e}})[_0x01f6('0x1c')](function(_0x411b15){if(_0x411b15){return db['CmContactHasItem'][_0x01f6('0x24')]({'ItemTypeId':_0x5cd3a4,'description':_0x4522f6,'OrderBy':_0x3358b3},{'where':{'CmContactId':_0x385760,'item':_0x3f7d7e}})[_0x01f6('0x1c')](function(_0x444fd8){_0x47c98b({'res':_0x01f6('0x25')});});}else{return db[_0x01f6('0x22')][_0x01f6('0x26')]({'CmContactId':_0x385760,'item':_0x3f7d7e,'description':_0x4522f6,'ItemTypeId':_0x5cd3a4,'OrderBy':_0x3358b3,'ItemClass':_0x01f6('0x27')})[_0x01f6('0x1c')](function(_0x32cd68){_0x47c98b({'res':'inserted'});});}});});}function insertCmHopper(_0x29df4e,_0x52e197,_0xd1661e,_0x45e876,_0x495427){var _0xa7f26a=[_0x01f6('0x28'),_0x01f6('0x29'),_0x01f6('0x2a'),_0x01f6('0x2b'),_0x52e197+'.'+_0x45e876,_0x01f6('0x2c'),_0x01f6('0x2d'),_0x01f6('0x2e'),_0x01f6('0x2f'),'\x22'+_0x495427+'\x22'];return squel['insert']()[_0x01f6('0x30')](_0x01f6('0x31'))[_0x01f6('0x32')]([_0x01f6('0x12'),_0x01f6('0x33'),_0x01f6('0x34'),_0x01f6('0x35'),_0x45e876,'createdAt',_0x01f6('0x36'),_0x01f6('0x37'),_0x01f6('0x38'),'recallme'],squel[_0x01f6('0x10')]()[_0x01f6('0x39')](_0xa7f26a)['from'](_0x52e197)[_0x01f6('0x14')](_0x01f6('0x3a'),null,'cm_contacts.ListId\x20=\x20'+_0x52e197+_0x01f6('0x3b'))[_0x01f6('0x14')](_0xd1661e,null,_0xd1661e+'.id\x20=\x20'+_0x52e197+'.'+_0x45e876)[_0x01f6('0x17')](_0x52e197+_0x01f6('0x3c'),_0x29df4e)[_0x01f6('0x17')](_0x01f6('0x3d'),NOW)[_0x01f6('0x17')](_0x01f6('0x3e'),selectNotIn(_0x52e197,_0xd1661e,_0x45e876,'cm_hopper',[_0x01f6('0x3f'),'\x22onlyIfOpen\x22']))[_0x01f6('0x17')](_0x01f6('0x3e'),selectNotIn(_0x52e197,_0xd1661e,_0x45e876,_0x01f6('0x31'),[_0x01f6('0x3f')])))[_0x01f6('0x40')]();}function insertCmHopperBlack(_0x5ced7d,_0x11d236,_0x374f46,_0x1990af){var _0x38b6df=['cm_contacts.phone',_0x01f6('0x2a'),_0x01f6('0x2b'),_0x11d236+'.'+_0x1990af,'cm_contacts.createdAt',_0x01f6('0x2d')];return squel[_0x01f6('0x41')]()[_0x01f6('0x30')]('cm_hopper_black')[_0x01f6('0x32')]([_0x01f6('0x12'),_0x01f6('0x34'),_0x01f6('0x35'),_0x1990af,_0x01f6('0x42'),_0x01f6('0x36')],squel[_0x01f6('0x10')]()[_0x01f6('0x39')](_0x38b6df)[_0x01f6('0x13')](_0x11d236)[_0x01f6('0x14')](_0x01f6('0x3a'),null,_0x01f6('0x43')+_0x11d236+_0x01f6('0x3b'))[_0x01f6('0x14')](_0x374f46,null,_0x374f46+_0x01f6('0x15')+_0x11d236+'.'+_0x1990af)['where'](_0x11d236+_0x01f6('0x3c'),_0x5ced7d)[_0x01f6('0x17')](_0x01f6('0x3d'),NOW)[_0x01f6('0x17')](_0x01f6('0x3e'),squel[_0x01f6('0x10')]()[_0x01f6('0x11')](_0x01f6('0x12'))[_0x01f6('0x13')](_0x01f6('0x44'))[_0x01f6('0x17')](_0x01f6('0x45'),_0x5ced7d)[_0x01f6('0x17')](_0x1990af+_0x01f6('0x16')+_0x11d236+'.'+_0x1990af)))[_0x01f6('0x40')]();}function insertTzCmHopper(_0x532fff,_0x2699a1,_0x5ce4a8,_0x2d5c5d,_0x5ad896,_0x312bbb){var _0x115351=[_0x01f6('0x28'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x312bbb+_0x01f6('0x46'),_0x01f6('0x2a'),_0x01f6('0x2b'),_0x2699a1+'.'+_0x2d5c5d,_0x01f6('0x2c'),_0x01f6('0x2d'),_0x01f6('0x2e'),_0x01f6('0x2f'),'\x22'+_0x5ad896+'\x22'];var _0x5cddcc=squel[_0x01f6('0x41')]()[_0x01f6('0x30')]('cm_hopper')[_0x01f6('0x32')](['phone','scheduledat',_0x01f6('0x34'),_0x01f6('0x35'),_0x2d5c5d,_0x01f6('0x42'),'updatedAt',_0x01f6('0x37'),_0x01f6('0x38'),_0x01f6('0x47')],squel[_0x01f6('0x10')]()[_0x01f6('0x39')](_0x115351)[_0x01f6('0x13')](_0x2699a1)['join'](_0x01f6('0x3a'),null,'cm_contacts.ListId\x20=\x20'+_0x2699a1+_0x01f6('0x3b'))[_0x01f6('0x14')](_0x5ce4a8,null,_0x5ce4a8+_0x01f6('0x15')+_0x2699a1+'.'+_0x2d5c5d)[_0x01f6('0x14')](_0x312bbb,null,_0x312bbb+_0x01f6('0x15')+_0x2699a1+'.'+_0x2d5c5d)[_0x01f6('0x17')](_0x2699a1+_0x01f6('0x3c'),_0x532fff)[_0x01f6('0x17')](_0x01f6('0x3d'),NOW)[_0x01f6('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2699a1,_0x5ce4a8,_0x2d5c5d,_0x01f6('0x31'),[_0x01f6('0x3f'),'\x22onlyIfOpen\x22']))[_0x01f6('0x17')](_0x01f6('0x3e'),selectNotIn(_0x2699a1,_0x5ce4a8,_0x2d5c5d,_0x01f6('0x31'),[_0x01f6('0x3f')])))[_0x01f6('0x40')]();return _0x5cddcc;}function insertTzCmHopperBlack(_0x3d37aa,_0x3aed3d,_0x3773ec,_0xdf216c){var _0x3606a0=['cm_contacts.phone',_0x01f6('0x2a'),_0x01f6('0x2b'),_0x3aed3d+'.'+_0xdf216c,_0x01f6('0x2c'),_0x01f6('0x2d')];return squel[_0x01f6('0x41')]()[_0x01f6('0x30')](_0x01f6('0x44'))[_0x01f6('0x32')]([_0x01f6('0x12'),'ContactId',_0x01f6('0x35'),_0xdf216c,_0x01f6('0x42'),'updatedAt'],squel['select']()[_0x01f6('0x39')](_0x3606a0)[_0x01f6('0x13')](_0x3aed3d)[_0x01f6('0x14')](_0x01f6('0x3a'),null,_0x01f6('0x43')+_0x3aed3d+'.CmListId')[_0x01f6('0x14')](_0x3773ec,null,_0x3773ec+_0x01f6('0x15')+_0x3aed3d+'.'+_0xdf216c)[_0x01f6('0x17')](_0x3aed3d+'.CmListId\x20=\x20?',_0x3d37aa)[_0x01f6('0x17')](_0x01f6('0x3d'),NOW)[_0x01f6('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x01f6('0x10')]()[_0x01f6('0x11')]('phone')[_0x01f6('0x13')](_0x01f6('0x44'))[_0x01f6('0x17')]('ListId\x20=\x20?',_0x3d37aa)[_0x01f6('0x17')](_0xdf216c+'\x20=\x20'+_0x3aed3d+'.'+_0xdf216c)))[_0x01f6('0x40')]();}function insertCmHopperAdditionalPhones(_0x1b204f){var _0x58ab1d=[_0x01f6('0x48'),_0x01f6('0x49'),'cm_contact_has_items.OrderBy',_0x01f6('0x4a'),_0x01f6('0x4b')];return squel[_0x01f6('0x41')]()[_0x01f6('0x30')](_0x01f6('0x4c'))['fromQuery']([_0x01f6('0x4d'),'phone','OrderBy',_0x01f6('0x42'),_0x01f6('0x36')],squel['select']()[_0x01f6('0x39')](_0x58ab1d)[_0x01f6('0x13')]('cm_hopper')[_0x01f6('0x14')](_0x01f6('0x3a'),null,_0x01f6('0x4e'))['join'](_0x01f6('0x4f'),null,_0x01f6('0x50'))[_0x01f6('0x17')]('cm_hopper.ListId\x20=\x20?',_0x1b204f)[_0x01f6('0x17')](_0x01f6('0x3d'),NOW))[_0x01f6('0x40')]();}function insertCmContact(_0x19dcf7,_0x11b595,_0x16d630,_0x313b4b){var _0x1fec87=_[_0x01f6('0x51')](_[_0x01f6('0x52')](_0x313b4b),[_0x01f6('0x35'),_0x01f6('0x53'),_0x01f6('0x42'),_0x01f6('0x36')]);return squel[_0x01f6('0x41')]()[_0x01f6('0x30')]('cm_contacts')[_0x01f6('0x32')](_0x1fec87,squel[_0x01f6('0x10')]()[_0x01f6('0x39')](_0x1fec87)[_0x01f6('0x13')](_0x11b595)['where']('('+_0x16d630[_0x01f6('0x14')](',')+_0x01f6('0x54'),squel['select']()['fields'](_0x16d630)[_0x01f6('0x13')](_0x01f6('0x3a'))[_0x01f6('0x17')](_0x01f6('0x45'),_0x19dcf7)['where'](_0x01f6('0x55')))[_0x01f6('0x17')](_0x01f6('0x56'),squel[_0x01f6('0x10')]()['field'](_0x01f6('0x57'),'min_id')['from'](_0x11b595)[_0x01f6('0x58')](_0x16d630['join'](','))))[_0x01f6('0x40')]();}function handleStop(){logger['info'](_0x01f6('0x59'));stopped=!![];}function handleUncaughtException(_0x2823c5){logger[_0x01f6('0x5a')](_0x2823c5[_0x01f6('0x5b')]);process['exit'](0x1);}function handleError(_0x37020b,_0x545318){stats[_0x01f6('0x5c')][_0x01f6('0x1d')]({'name':_0x545318[_0x01f6('0x5d')],'message':_0x545318['message'],'row':_0x37020b});}function handleQuery(_0x362df3){logger[_0x01f6('0x5e')](_0x362df3);return db['sequelize']['query'](_0x362df3)[_0x01f6('0x5f')](function(_0x55c6f1){results[_0x01f6('0x1d')](_0x55c6f1);})['catch'](function(_0x4fe406){logger[_0x01f6('0x5a')](_0x4fe406[_0x01f6('0x5b')]);});}function updateTzCampaigns(_0x3d4426){return new Promise(function(_0x569a0e,_0x42ca30){var _0x13f19f=squel[_0x01f6('0x10')]()[_0x01f6('0x39')]([_0x01f6('0x60'),'campaigns.dialTimezone'])['from'](_0x01f6('0x61'))[_0x01f6('0x14')](_0x01f6('0x62'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x01f6('0x17')](_0x01f6('0x63')+_0x3d4426);db[_0x01f6('0x64')][_0x01f6('0x65')](_0x13f19f[_0x01f6('0x40')]())[_0x01f6('0x5f')](function(_0x2355f4){var _0x1a04d5=[];for(var _0x3a4796=0x0;_0x3a4796<_0x2355f4[_0x01f6('0x20')];_0x3a4796++){_0x1a04d5[_0x01f6('0x1d')](getTimezoneData(_0x2355f4[_0x3a4796],tmp_campaigns));}BPromise[_0x01f6('0x1e')](_0x1a04d5)[_0x01f6('0x1c')](function(){_0x569a0e({'val':0x1});});})['catch'](function(_0x3dcd70){logger[_0x01f6('0x5a')](_0x3dcd70['message']);_0x569a0e({'val':0x0});});});}function updateTzVoiceQueues(_0x1b6b64){return new Promise(function(_0x141a5a,_0x3ddbab){var _0x5d0987=squel[_0x01f6('0x10')]()[_0x01f6('0x39')]([_0x01f6('0x66'),'voice_queues.dialTimezone'])[_0x01f6('0x13')](_0x01f6('0x67'))[_0x01f6('0x14')](_0x01f6('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x01f6('0x17')]('voice_queues_has_cm_lists.CmListId='+_0x1b6b64);db[_0x01f6('0x64')]['query'](_0x5d0987['toString']())[_0x01f6('0x5f')](function(_0x359e95){var _0x3ae17d=[];for(var _0xe468fd=0x0;_0xe468fd<_0x359e95[_0x01f6('0x20')];_0xe468fd++){_0x3ae17d[_0x01f6('0x1d')](getTimezoneData(_0x359e95[_0xe468fd],tmp_voice_queues));}BPromise[_0x01f6('0x1e')](_0x3ae17d)[_0x01f6('0x1c')](function(){_0x141a5a({'val':0x1});});})[_0x01f6('0x69')](function(_0x3626d0){logger[_0x01f6('0x5a')](_0x3626d0['message']);_0x141a5a({'val':0x0});});});}function getTimezoneData(_0x51a44b,_0x3e4725){return new Promise(function(_0x2952ba,_0x33a8e3){var _0x40dbb8=shared[_0x01f6('0x6a')];var _0x39302d=_0x40dbb8[_0x51a44b[_0x01f6('0x6b')]];if(_[_0x01f6('0x21')](_0x39302d)){_0x2952ba({'ret':0x1});}else{var _0x546e68=_0x39302d[_0x01f6('0x6c')];var _0x47621b=squel[_0x01f6('0x41')]()['into'](_0x3e4725)['set']('id',_0x51a44b['id'])['set'](_0x01f6('0x6d'),_0x546e68)[_0x01f6('0x6e')]('dialTimezone',_0x51a44b[_0x01f6('0x6b')])[_0x01f6('0x40')]();return db['sequelize'][_0x01f6('0x65')](_0x47621b)['spread'](function(_0x38aca4){_0x2952ba({'ret':0x1});})[_0x01f6('0x69')](function(_0x2b598f){logger[_0x01f6('0x5a')](_0x2b598f[_0x01f6('0x5b')]);_0x33a8e3({'ret':0x1});});}});}function handleTZQuery(_0x124d69){logger[_0x01f6('0x5e')](_0x124d69);return db[_0x01f6('0x64')][_0x01f6('0x65')](_0x124d69)['spread'](function(_0x55a8cd){})[_0x01f6('0x69')](function(_0x3f989a){logger[_0x01f6('0x5a')](_0x3f989a[_0x01f6('0x5b')]);});}function main(_0x179b53,_0x23b02d,_0x273064,_0x5ccbc7){logger[_0x01f6('0x5e')](_0x01f6('0x6f'),_0x179b53,JSON[_0x01f6('0x70')](_0x23b02d));process[_0x01f6('0x71')](_0x01f6('0x72'));var _0x3e258b=_0x23b02d[_0x01f6('0x73')];var _0x267275=_[_0x01f6('0x74')](_0x3e258b);var _0x2b7a35=_0x23b02d[_0x01f6('0x75')];var _0x4485b9=path['join'](config[_0x01f6('0x76')],'server/files/tmp',_0x2b7a35+_0x01f6('0x77'));hasTZ=_['keys'](_0x3e258b)[_0x01f6('0x78')](_0x01f6('0x6b'));var _0x46d2f7=_[_0x01f6('0x52')](_0x3e258b)['join']();logger['info'](_0x01f6('0x79'),_0x46d2f7);db[_0x01f6('0x7a')][_0x01f6('0x1a')]({'raw':!![],'attributes':['id','name']})[_0x01f6('0x1c')](function(_0x95ef2b){for(var _0x112f7e=0x0;_0x112f7e<_0x95ef2b[_0x01f6('0x20')];_0x112f7e++){if(_0x95ef2b[_0x112f7e]['name']in _0x3e258b){contactItemTypes[_0x01f6('0x1d')](_0x95ef2b[_0x112f7e]);delete _0x267275[_0x95ef2b[_0x112f7e]['name']];hasAdditionalPhones=!![];}for(var _0x237d3d in _0x3e258b){if(_0x95ef2b[_0x112f7e][_0x01f6('0x7b')]+'_description'===_0x237d3d){phoneDescriptions[_0x01f6('0x1d')]({'itemTypeId':_0x95ef2b[_0x112f7e]['id'],'description':_0x237d3d});delete _0x267275[_0x237d3d];}}}if(hasAdditionalPhones)_0x267275['AdditionalPhones']='';var _0x5581b2=_['keys'](_0x267275)[_0x01f6('0x14')]();logger[_0x01f6('0x5e')](_0x01f6('0x79'),_0x5581b2);fs['writeFileSync'](_0x4485b9,_0x5581b2+'\x0a');Papa['parse'](fs['createReadStream'](_0x179b53),{'header':!![],'skipEmptyLines':!![],'step':function(_0x56797c,_0x37b339){try{for(var _0x1d08e5=0x0,_0x1fe774=[];_0x1d08e5<_0x56797c[_0x01f6('0x7c')][_0x01f6('0x20')];_0x1d08e5++){stats['rows']+=0x1;if(_0x56797c[_0x01f6('0x5c')][_0x1d08e5]){handleError(_0x56797c[_0x01f6('0x7c')][_0x1d08e5],_0x56797c[_0x01f6('0x5c')][_0x1d08e5]);}else{var _0x1376ba=[];var _0x246f87=[];var _0xf7daac={};for(var _0x46d7fd in _0x3e258b){let _0x4087c7=contactItemTypes['find'](_0x19d494=>_0x19d494[_0x01f6('0x7b')]===_0x46d7fd);let _0x2d68f6=contactItemTypes[_0x01f6('0x7d')](_0x2f45bf=>_0x2f45bf[_0x01f6('0x7b')]+_0x01f6('0x7e')===_0x46d7fd);if(_[_0x01f6('0x21')](_0x4087c7)&&_[_0x01f6('0x21')](_0x2d68f6)){if(_0x3e258b[_0x01f6('0x7f')](_0x46d7fd)){if(_0x56797c[_0x01f6('0x7c')][_0x1d08e5][_0x3e258b[_0x46d7fd]]){var _0x3ba6eb=_[_0x01f6('0x80')](_0x56797c[_0x01f6('0x7c')][_0x1d08e5][_0x3e258b[_0x46d7fd]][_0x01f6('0x81')](/"/g,'\x27'));switch(_0x46d7fd){case'scheduledat':var _0x145019=moment(_0x3ba6eb,_0x01f6('0xe'),!![]);if(_0x145019['isValid']()){_0x1fe774['push']('\x22'+_0x3ba6eb+'\x22');}else{_0x1376ba[_0x01f6('0x1d')](_0x01f6('0x82'));}break;case'priority':var _0x2bf444=parseInt(_0x3ba6eb);_0x3ba6eb=_[_0x01f6('0x83')](_0x2bf444)||_0x2bf444<0x0||_0x2bf444>0x4?_0x5ccbc7?0x3:0x2:_0x2bf444;_0x1fe774[_0x01f6('0x1d')]('\x22'+_0x3ba6eb+'\x22');break;case _0x01f6('0x38'):var _0xe86ff5=parseInt(_0x3ba6eb);if(_[_0x01f6('0x84')](_0xe86ff5)&&_[_0x01f6('0x78')](_0x273064,_0xe86ff5)){_0x1fe774[_0x01f6('0x1d')]('\x22'+_0xe86ff5+'\x22');}else{_0x1376ba[_0x01f6('0x1d')](_0x01f6('0x85'));}break;case _0x01f6('0x86'):if(isEmail(_0x3ba6eb)){_0x1fe774[_0x01f6('0x1d')]('\x22'+_0x3ba6eb+'\x22');}else{_0x1376ba[_0x01f6('0x1d')](_0x01f6('0x87'));}break;case _0x01f6('0x88'):var _0x2f3196=moment(_0x3ba6eb,_0x01f6('0x89'),!![]);if(_0x2f3196[_0x01f6('0x8a')]()){_0x1fe774[_0x01f6('0x1d')]('\x22'+_0x3ba6eb+'\x22');}else{_0x1376ba[_0x01f6('0x1d')](_0x01f6('0x8b'));}break;case _0x01f6('0x6b'):var _0x35ad32=shared[_0x01f6('0x6a')];var _0x2469fb=_0x35ad32[_0x3ba6eb];if(!_[_0x01f6('0x21')](_0x2469fb)){var _0x4a9fbd=_0x2469fb[_0x01f6('0x6c')];_0x1fe774['push']('\x22'+_0x3ba6eb+'\x22');_0x1fe774[_0x01f6('0x1d')]('\x22'+_0x4a9fbd+'\x22');}break;default:_0x1fe774[_0x01f6('0x1d')]('\x22'+_0x3ba6eb+'\x22');}}else{switch(_0x46d7fd){case'firstName':case _0x01f6('0x12'):_0x1376ba[_0x01f6('0x1d')](_0x46d7fd+'\x20not\x20specified');break;default:_0x1fe774[_0x01f6('0x1d')]('\x22\x22');}}}}else{var _0x184207='';if(!_[_0x01f6('0x21')](_0x4087c7)){if(!_0xf7daac[_0x01f6('0x7f')](_0x4087c7['id'])){if(!_[_0x01f6('0x21')](_0x56797c[_0x01f6('0x7c')][_0x1d08e5][_0x3e258b[_0x46d7fd]])){var _0x3ba6eb=_['trim'](_0x56797c[_0x01f6('0x7c')][_0x1d08e5][_0x3e258b[_0x46d7fd]][_0x01f6('0x81')](/"/g,'\x27'));var _0x4aeb6c=phoneDescriptions[_0x01f6('0x7d')](_0x4bfe27=>_0x4bfe27[_0x01f6('0x8c')]===_0x4087c7['id']);if(!_[_0x01f6('0x21')](_0x4aeb6c)){var _0x2d807b=_['trim'](_0x56797c[_0x01f6('0x7c')][_0x1d08e5][_0x3e258b[_0x4aeb6c[_0x01f6('0x8d')]]][_0x01f6('0x81')](/"/g,'\x27'));if(!_[_0x01f6('0x21')](_0x2d807b))_0x3ba6eb=_0x3ba6eb+'§'+_0x2d807b;}if(_0x184207=='')_0x184207=_0x3ba6eb;else _0x184207+='|'+_0x3ba6eb;}_0x246f87[_0x01f6('0x1d')](_0x4087c7['id']+':'+_0x184207);_0xf7daac[_0x4087c7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1fe774[_0x01f6('0x1d')]('\x22'+_0x246f87['join'](';')+'\x22');}if(_0x1376ba[_0x01f6('0x20')]){handleError(_0x56797c[_0x01f6('0x7c')][_0x1d08e5],{'code':'SystemRow','message':_0x1376ba['join']()});}else{fs[_0x01f6('0x8e')](_0x4485b9,_0x1fe774['join']()+'\x0a');}_0x1fe774=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x01f6('0x8f')+_0x2b7a35,stats);stats[_0x01f6('0x5c')]=[];}}if(stopped){logger[_0x01f6('0x5e')](_0x01f6('0x90'));_0x37b339[_0x01f6('0x91')]();}}catch(_0x577054){handleError(_0x56797c[_0x01f6('0x7c')][_0x1d08e5],{'code':'SystemError','message':_0x577054[_0x01f6('0x5b')]});logger[_0x01f6('0x5a')]('step',_0x577054[_0x01f6('0x5b')]);}},'complete':function(){try{var _0x2bf541=[];var _0x54ff6c=[];var _0x3b243b=_0x01f6('0x3a');if(_0x23b02d[_0x01f6('0x92')]&&_0x23b02d['duplicates']['length']){_0x3b243b=_0x01f6('0x93')+_0x2b7a35;_0x2bf541[_0x01f6('0x1d')](_0x01f6('0x94')+_0x3b243b+_0x01f6('0x95'));}tmp_campaigns=_0x01f6('0x96')+_0x2b7a35;tmp_voice_queues='voice_queues_'+_0x2b7a35;_0x54ff6c[_0x01f6('0x1d')](_0x01f6('0x94')+tmp_campaigns+_0x01f6('0x97'));_0x54ff6c[_0x01f6('0x1d')](_0x01f6('0x94')+tmp_voice_queues+_0x01f6('0x97'));BPromise[_0x01f6('0x98')](_0x54ff6c,handleTZQuery)[_0x01f6('0x1c')](function(_0x522bdd){updateTzCampaigns(_0x23b02d[_0x01f6('0x35')])[_0x01f6('0x1c')](function(_0x5a4245){updateTzVoiceQueues(_0x23b02d[_0x01f6('0x35')])['then'](function(_0x1d1324){if(hasTZ)_0x5581b2=_0x5581b2[_0x01f6('0x81')](_0x01f6('0x6b'),_0x01f6('0x99'));var _0x244b54=util[_0x01f6('0xd')](_0x01f6('0x9a'),_0x4485b9,_0x3b243b,_0x5581b2,_0x23b02d[_0x01f6('0x35')],_0x23b02d[_0x01f6('0x53')]||null,NOW,NOW);if(_[_0x01f6('0x21')](_0x3e258b['scheduledat'])){_0x244b54+=_0x01f6('0x9b');}_0x2bf541[_0x01f6('0x1d')](_0x244b54);if(_0x23b02d[_0x01f6('0x92')]&&_0x23b02d[_0x01f6('0x92')]['length']){_0x2bf541['push'](insertCmContact(_0x23b02d['ListId'],_0x3b243b,_0x23b02d[_0x01f6('0x92')],_0x3e258b));_0x2bf541[_0x01f6('0x1d')](_0x01f6('0x9c')+_0x3b243b+';');}BPromise[_0x01f6('0x98')](_0x2bf541,handleQuery)[_0x01f6('0x1c')](function(_0x3544c7){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x2bf541=[];for(var _0x5a46f2=0x0;_0x5a46f2\x20\x20','existsSync','parse','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','import'];(function(_0x5a1506,_0x282379){var _0x399864=function(_0x93a8cd){while(--_0x93a8cd){_0x5a1506['push'](_0x5a1506['shift']());}};_0x399864(++_0x282379);}(_0x55f1,0x9b));var _0x155f=function(_0x17a468,_0x467991){_0x17a468=_0x17a468-0x0;var _0x6e0dbe=_0x55f1[_0x17a468];return _0x6e0dbe;};'use strict';var fs=require('fs');var path=require(_0x155f('0x0'));var _=require('lodash');var Papa=require(_0x155f('0x1'));var util=require(_0x155f('0x2'));var BPromise=require(_0x155f('0x3'));var moment=require(_0x155f('0x4'));var squel=require(_0x155f('0x5'));var Redis=require(_0x155f('0x6'));var db=require(_0x155f('0x7'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x155f('0x8'));config['redis']=_[_0x155f('0x9')](config[_0x155f('0xa')],{'host':_0x155f('0xb'),'port':0x18eb});var socket=require(_0x155f('0xc'))(new Redis(config[_0x155f('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x155f('0xd')](_0x155f('0xe'));var tempTableName=_0x155f('0xf')+moment()[_0x155f('0xd')](_0x155f('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x11c946){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))*$/[_0x155f('0x11')](_0x11c946);}function selectNotIn(_0x5b9e3b,_0x9fb9a,_0x1b5da0,_0x20dd5f,_0x3575d8){return squel['select']()[_0x155f('0x12')](_0x155f('0x13'))[_0x155f('0x14')](_0x20dd5f)['join'](_0x9fb9a,null,_0x9fb9a+'.id\x20=\x20'+_0x20dd5f+'.'+_0x1b5da0)[_0x155f('0x15')](_0x20dd5f+'.'+_0x1b5da0+_0x155f('0x16')+_0x5b9e3b+'.'+_0x1b5da0)[_0x155f('0x15')](_0x9fb9a+_0x155f('0x17')+_0x3575d8[_0x155f('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2fa0d4,_0x14dad8){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x155f('0x19')](_0x155f('0x1a')+tempTableName)['spread'](function(_0x44c018){if(_0x44c018!==null){var _0x1c2d06=[];for(var _0x1fe82c=0x0;_0x1fe82c<_0x44c018[_0x155f('0x1b')];_0x1fe82c++){var _0x9bf908=_0x44c018[_0x1fe82c];if(!_[_0x155f('0x1c')](_0x9bf908[_0x155f('0x13')])){if(!_[_0x155f('0x1c')](_0x9bf908[_0x155f('0x1d')]))_0x1c2d06[_0x155f('0x1e')](insertAdditionalPhones(_0x9bf908));promisesContact[_0x155f('0x1e')]({'contact':_0x9bf908});}}}Promise[_0x155f('0x1f')](_0x1c2d06)[_0x155f('0x20')](function(){_0x2fa0d4({'val':0x1});});})[_0x155f('0x21')](function(_0x1f76e9){logger[_0x155f('0x22')](_0x1f76e9['message']);});});}function insertAdditionalPhones(_0x44102a){return new Promise(function(_0x26a322,_0x39c362){var _0x5ec409=_0x44102a['AdditionalPhones'];if(_['isNil'](_0x5ec409))_0x39c362({'val':0x0});else{var _0x47906a=_0x5ec409[_0x155f('0x23')](';');var _0x3a40b4=[];orderBy=0x0;for(var _0x2e337e=0x0;_0x2e337e<_0x47906a[_0x155f('0x1b')];_0x2e337e++){_0x3a40b4[_0x155f('0x1e')](splitAdditionalPhone(_0x44102a['id'],_0x47906a[_0x2e337e]));}Promise['all'](_0x3a40b4)[_0x155f('0x20')](function(){_0x26a322({'val':_0x47906a[_0x155f('0x1b')]});});}});}function splitAdditionalPhone(_0x172077,_0x348240){return new Promise(function(_0xee4dbc,_0x2588f5){var _0x280978=_0x348240[_0x155f('0x23')](':');var _0x45b580=_0x280978[0x0];var _0x2bc5b5=_0x280978[0x1];if(_0x2bc5b5!==''){var _0x143749=_0x2bc5b5[_0x155f('0x23')]('|');var _0x52af8e=[];for(var _0x5c0a30=0x0;_0x5c0a30<_0x143749[_0x155f('0x1b')];_0x5c0a30++){if(_0x143749[_0x5c0a30]!==''){var _0x38e172=_[_0x155f('0x24')](promisesAdditionalPhones,{'contactId':_0x172077,'phone':_0x143749[_0x5c0a30]});if(_0x38e172[_0x155f('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x172077,'contactTypeId':_0x45b580,'phone':_0x143749[_0x5c0a30],'orderBy':orderBy});}}}_0xee4dbc({'ok':0x1});}else _0xee4dbc({'res':0x0});});}function createAdditionalPhone(_0x2c0f05,_0x25c952,_0x28cd98,_0x29e9dd){var _0x1f53c8='';var _0x3d3e46='';var _0x1a89bb=_0x28cd98['split']('§');_0x1f53c8=_0x1a89bb[0x0];if(_0x1a89bb[_0x155f('0x1b')]==0x2)_0x3d3e46=_0x1a89bb[0x1];return new Promise(function(_0x283476,_0x154158){return db[_0x155f('0x25')][_0x155f('0x26')]({'where':{'CmContactId':_0x2c0f05,'item':_0x1f53c8}})[_0x155f('0x20')](function(_0x22221a){if(_0x22221a){return db[_0x155f('0x25')][_0x155f('0x27')]({'ItemTypeId':_0x25c952,'description':_0x3d3e46,'OrderBy':_0x29e9dd},{'where':{'CmContactId':_0x2c0f05,'item':_0x1f53c8}})['then'](function(_0x36b196){_0x283476({'res':_0x155f('0x28')});});}else{return db[_0x155f('0x25')]['create']({'CmContactId':_0x2c0f05,'item':_0x1f53c8,'ItemTypeId':_0x25c952,'description':_0x3d3e46,'OrderBy':_0x29e9dd,'ItemClass':_0x155f('0x29')})[_0x155f('0x20')](function(_0x4839ae){_0x283476({'res':_0x155f('0x2a')});});}});});}function updateContact(_0x537940){return new Promise(function(_0x45a676,_0x3a8a14){var _0x5dfb2f=_0x537940['id'];delete _0x537940['id'];return db['CmContact'][_0x155f('0x27')](_0x537940,{'where':{'id':_0x5dfb2f}})[_0x155f('0x20')](function(_0x143191){updatedRows+=0x1;return db['CmHopper'][_0x155f('0x27')]({'phone':_0x537940[_0x155f('0x13')]},{'where':{'ContactId':_0x5dfb2f}})[_0x155f('0x20')](function(_0x1f84fc){_0x45a676({'ret':'OK'});});});});}function insertCmHopper(_0x5c1f6b,_0x2ce226,_0xedfb25,_0x48dfcb,_0x28e7d5){var _0x4ce79f=[_0x155f('0x2b'),'cm_contacts.scheduledat',_0x155f('0x2c'),'cm_contacts.ListId',_0x2ce226+'.'+_0x48dfcb,'cm_contacts.createdAt',_0x155f('0x2d'),_0x155f('0x2e'),_0x155f('0x2f'),'\x22'+_0x28e7d5+'\x22'];return squel[_0x155f('0x30')]()[_0x155f('0x31')](_0x155f('0x32'))['fromQuery']([_0x155f('0x13'),_0x155f('0x33'),_0x155f('0x34'),'ListId',_0x48dfcb,_0x155f('0x35'),_0x155f('0x36'),_0x155f('0x37'),_0x155f('0x38'),_0x155f('0x39')],squel[_0x155f('0x3a')]()['fields'](_0x4ce79f)[_0x155f('0x14')](_0x2ce226)[_0x155f('0x18')](_0x155f('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0x2ce226+_0x155f('0x3c'))['join'](_0xedfb25,null,_0xedfb25+_0x155f('0x3d')+_0x2ce226+'.'+_0x48dfcb)[_0x155f('0x15')](_0x2ce226+_0x155f('0x3e'),_0x5c1f6b)[_0x155f('0x15')](_0x155f('0x3f'),NOW)['where'](_0x155f('0x40'),selectNotIn(_0x2ce226,_0xedfb25,_0x48dfcb,'cm_hopper',[_0x155f('0x41'),_0x155f('0x42')]))[_0x155f('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2ce226,_0xedfb25,_0x48dfcb,'cm_hopper',[_0x155f('0x41')])))[_0x155f('0x43')]();}function insertCmHopperBlack(_0x4c3fca,_0x4dcbd5,_0x105a85,_0x51f824){var _0x2d0e67=[_0x155f('0x2b'),'cm_contacts.id',_0x155f('0x44'),_0x4dcbd5+'.'+_0x51f824,_0x155f('0x45'),_0x155f('0x2d')];return squel['insert']()[_0x155f('0x31')]('cm_hopper_black')['fromQuery']([_0x155f('0x13'),_0x155f('0x34'),'ListId',_0x51f824,_0x155f('0x35'),_0x155f('0x36')],squel[_0x155f('0x3a')]()[_0x155f('0x46')](_0x2d0e67)[_0x155f('0x14')](_0x4dcbd5)[_0x155f('0x18')](_0x155f('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0x4dcbd5+'.CmListId')['join'](_0x105a85,null,_0x105a85+_0x155f('0x3d')+_0x4dcbd5+'.'+_0x51f824)['where'](_0x4dcbd5+_0x155f('0x3e'),_0x4c3fca)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x155f('0x15')](_0x155f('0x40'),squel[_0x155f('0x3a')]()[_0x155f('0x12')](_0x155f('0x13'))[_0x155f('0x14')](_0x155f('0x47'))[_0x155f('0x15')](_0x155f('0x48'),_0x4c3fca)[_0x155f('0x15')](_0x51f824+_0x155f('0x49'),_0x4dcbd5+'.'+_0x51f824)))[_0x155f('0x43')]();}function insertCmHopperAdditionalPhones(_0x825735){var _0x477c93=[_0x155f('0x4a'),_0x155f('0x4b'),_0x155f('0x4c'),_0x155f('0x4d'),_0x155f('0x4e')];return squel[_0x155f('0x30')]()['into'](_0x155f('0x4f'))[_0x155f('0x50')]([_0x155f('0x51'),_0x155f('0x13'),'OrderBy',_0x155f('0x35'),_0x155f('0x36')],squel[_0x155f('0x3a')]()[_0x155f('0x46')](_0x477c93)[_0x155f('0x14')](_0x155f('0x32'))[_0x155f('0x18')](_0x155f('0x3b'),null,_0x155f('0x52'))[_0x155f('0x18')](_0x155f('0x53'),null,_0x155f('0x54'))[_0x155f('0x15')](_0x155f('0x55'),_0x825735)[_0x155f('0x15')](_0x155f('0x3f'),NOW))[_0x155f('0x43')]();}function insertCmContact(_0x4ae039,_0x206bdb,_0x1461cd,_0x26234e){var _0x41bd08=_[_0x155f('0x56')](_['keys'](_0x26234e),[_0x155f('0x57'),'CompanyId',_0x155f('0x35'),_0x155f('0x36')]);return squel[_0x155f('0x30')]()[_0x155f('0x31')](_0x155f('0x3b'))[_0x155f('0x50')](_0x41bd08,squel['select']()[_0x155f('0x46')](_0x41bd08)[_0x155f('0x14')](_0x206bdb)[_0x155f('0x15')]('('+_0x1461cd[_0x155f('0x18')](',')+_0x155f('0x58'),squel[_0x155f('0x3a')]()['fields'](_0x1461cd)[_0x155f('0x14')](_0x155f('0x3b'))[_0x155f('0x15')](_0x155f('0x48'),_0x4ae039))[_0x155f('0x15')](_0x155f('0x59'),squel['select']()[_0x155f('0x12')](_0x155f('0x5a'),_0x155f('0x5b'))[_0x155f('0x14')](_0x206bdb)['group'](_0x1461cd[_0x155f('0x18')](','))))[_0x155f('0x43')]();}function handleStop(){logger[_0x155f('0x5c')](_0x155f('0x5d'));stopped=!![];}function handleUncaughtException(_0x39d522){logger[_0x155f('0x22')](_0x39d522[_0x155f('0x5e')]);process[_0x155f('0x5f')](0x1);}function handleError(_0x79d851,_0x52796d){stats[_0x155f('0x60')][_0x155f('0x1e')]({'name':_0x52796d[_0x155f('0x61')],'message':_0x52796d[_0x155f('0x5e')],'row':_0x79d851});}function handleQuery(_0x362991){logger[_0x155f('0x5c')](_0x362991);return db['sequelize'][_0x155f('0x19')](_0x362991)[_0x155f('0x62')](function(_0x173974){results[_0x155f('0x1e')](_0x173974);})[_0x155f('0x21')](function(_0x28f397){logger[_0x155f('0x22')](_0x28f397[_0x155f('0x5e')]);});}function main(_0x10542d,_0x37d7d7,_0x7ac9d2,_0x4b4a2f){logger[_0x155f('0x5c')](_0x155f('0x63'),_0x10542d,JSON['stringify'](_0x37d7d7));process[_0x155f('0x64')](_0x155f('0x65'));var _0x4f7e4f=_0x37d7d7['binding'];var _0x3067fb=_[_0x155f('0x66')](_0x4f7e4f);var _0x2a3312=_0x37d7d7[_0x155f('0x67')];var _0x2fcf21=path['join'](config[_0x155f('0x68')],_0x155f('0x69'),_0x2a3312+'.csv');logger[_0x155f('0x5c')](_0x155f('0x6a'),_0x37d7d7);db[_0x155f('0x6b')]['findAll']({'raw':!![],'attributes':['id',_0x155f('0x6c')]})[_0x155f('0x20')](function(_0x4d6046){for(var _0x3c88e4=0x0;_0x3c88e4<_0x4d6046[_0x155f('0x1b')];_0x3c88e4++){if(_0x4d6046[_0x3c88e4][_0x155f('0x6c')]in _0x4f7e4f){contactItemTypes[_0x155f('0x1e')](_0x4d6046[_0x3c88e4]);delete _0x3067fb[_0x4d6046[_0x3c88e4][_0x155f('0x6c')]];hasAdditionalPhones=!![];}for(var _0x4947d8 in _0x4f7e4f){if(_0x4d6046[_0x3c88e4][_0x155f('0x6c')]+_0x155f('0x6d')===_0x4947d8){phoneDescriptions[_0x155f('0x1e')]({'itemTypeId':_0x4d6046[_0x3c88e4]['id'],'description':_0x4947d8});delete _0x3067fb[_0x4947d8];}}}if(hasAdditionalPhones)_0x3067fb[_0x155f('0x1d')]='';var _0x526356=_[_0x155f('0x6e')](_0x3067fb)[_0x155f('0x18')]();logger['info'](_0x155f('0x6f'),_0x526356);fs[_0x155f('0x70')](_0x2fcf21,_0x526356+'\x0a');Papa['parse'](fs[_0x155f('0x71')](_0x10542d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x511a47,_0x2b58f6){try{for(var _0x17b201=0x0,_0xdf3ab=[];_0x17b201<_0x511a47[_0x155f('0x72')][_0x155f('0x1b')];_0x17b201++){stats[_0x155f('0x73')]+=0x1;if(_0x511a47['errors'][_0x17b201]){handleError(_0x511a47[_0x155f('0x72')][_0x17b201],_0x511a47[_0x155f('0x60')][_0x17b201]);}else{var _0x2e4cff=[];var _0x32b93b=[];var _0x6271b5={};for(var _0x3c6bec in _0x4f7e4f){let _0x32d94b=contactItemTypes[_0x155f('0x74')](_0x3ad424=>_0x3ad424[_0x155f('0x6c')]===_0x3c6bec);let _0x4d257e=contactItemTypes[_0x155f('0x74')](_0x33e1fc=>_0x33e1fc[_0x155f('0x6c')]+'_description'===_0x3c6bec);if(_[_0x155f('0x1c')](_0x32d94b)&&_[_0x155f('0x1c')](_0x4d257e)){if(_0x4f7e4f['hasOwnProperty'](_0x3c6bec)){if(_0x511a47[_0x155f('0x72')][_0x17b201][_0x4f7e4f[_0x3c6bec]]){var _0x244b84=_[_0x155f('0x75')](_0x511a47['data'][_0x17b201][_0x4f7e4f[_0x3c6bec]][_0x155f('0x76')](/"/g,'\x27'));switch(_0x3c6bec){case'scheduledat':var _0x2b1359=moment(_0x244b84,_0x155f('0xe'),!![]);if(_0x2b1359[_0x155f('0x77')]()){_0xdf3ab[_0x155f('0x1e')]('\x22'+_0x244b84+'\x22');}else{_0x2e4cff['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x155f('0x37'):var _0x45cd0f=parseInt(_0x244b84);_0x244b84=_[_0x155f('0x78')](_0x45cd0f)||_0x45cd0f<0x0||_0x45cd0f>0x4?_0x4b4a2f?0x3:0x2:_0x45cd0f;_0xdf3ab[_0x155f('0x1e')]('\x22'+_0x244b84+'\x22');break;case _0x155f('0x38'):var _0x53574d=parseInt(_0x244b84);if(_[_0x155f('0x79')](_0x53574d)&&_[_0x155f('0x7a')](_0x7ac9d2,_0x53574d)){_0xdf3ab[_0x155f('0x1e')]('\x22'+_0x53574d+'\x22');}else{_0x2e4cff[_0x155f('0x1e')](_0x155f('0x7b'));}break;case _0x155f('0x7c'):if(isEmail(_0x244b84)){_0xdf3ab[_0x155f('0x1e')]('\x22'+_0x244b84+'\x22');}else{_0x2e4cff[_0x155f('0x1e')](_0x155f('0x7d'));}break;case _0x155f('0x7e'):var _0x44b742=moment(_0x244b84,_0x155f('0x7f'),!![]);if(_0x44b742['isValid']()){_0xdf3ab[_0x155f('0x1e')]('\x22'+_0x244b84+'\x22');}else{_0x2e4cff[_0x155f('0x1e')](_0x155f('0x80'));}break;default:_0xdf3ab[_0x155f('0x1e')]('\x22'+_0x244b84+'\x22');}}else{switch(_0x3c6bec){case _0x155f('0x81'):case _0x155f('0x13'):_0x2e4cff['push'](_0x3c6bec+_0x155f('0x82'));break;default:_0xdf3ab['push']('\x22\x22');}}}}else{var _0xa13413='';if(!_[_0x155f('0x1c')](_0x32d94b)){if(!_0x6271b5[_0x155f('0x83')](_0x32d94b['id'])){for(var _0x4b95aa=0x0;_0x4b95aa<_0x4f7e4f[_0x3c6bec][_0x155f('0x1b')];_0x4b95aa++){var _0x244b84=_[_0x155f('0x75')](_0x511a47['data'][_0x17b201][_0x4f7e4f[_0x3c6bec][_0x4b95aa]][_0x155f('0x76')](/"/g,'\x27'));var _0x40ab70=phoneDescriptions[_0x155f('0x74')](_0x132ca0=>_0x132ca0[_0x155f('0x84')]===_0x32d94b['id']);if(!_[_0x155f('0x1c')](_0x40ab70)){var _0x47eab2=_[_0x155f('0x75')](_0x511a47[_0x155f('0x72')][_0x17b201][_0x4f7e4f[_0x40ab70[_0x155f('0x85')]][0x0]][_0x155f('0x76')](/"/g,'\x27'));if(!_[_0x155f('0x1c')](_0x47eab2))_0x244b84=_0x244b84+'§'+_0x47eab2;}if(_0xa13413=='')_0xa13413=_0x244b84;else _0xa13413+='|'+_0x244b84;}_0x32b93b[_0x155f('0x1e')](_0x32d94b['id']+':'+_0xa13413);_0x6271b5[_0x32d94b['id']]=0x1;}}}}if(hasAdditionalPhones){_0xdf3ab['push']('\x22'+_0x32b93b[_0x155f('0x18')](';')+'\x22');}if(_0x2e4cff[_0x155f('0x1b')]){handleError(_0x511a47[_0x155f('0x72')][_0x17b201],{'code':_0x155f('0x86'),'message':_0x2e4cff[_0x155f('0x18')]()});}else{fs[_0x155f('0x87')](_0x2fcf21,_0xdf3ab[_0x155f('0x18')]()+'\x0a');}_0xdf3ab=[];}if(!(stats[_0x155f('0x73')]%0xc8)){socket['emit'](_0x155f('0x88')+_0x2a3312,stats);stats[_0x155f('0x60')]=[];}}if(stopped){logger[_0x155f('0x5c')]('Abort\x20parser');_0x2b58f6[_0x155f('0x89')]();}}catch(_0x2b39be){handleError(_0x511a47['data'][_0x17b201],{'code':'SystemError','message':_0x2b39be['message']});logger[_0x155f('0x22')]('step',_0x2b39be['message']);}},'complete':function(){try{var _0x174528=[];var _0x5c9332=tempTableName;_0x174528[_0x155f('0x1e')](_0x155f('0x8a')+_0x5c9332+'\x20LIKE\x20cm_contacts;');logger[_0x155f('0x5c')](_0x155f('0x8b'),contactItemTypes[_0x155f('0x1b')]);var _0x20e462=util[_0x155f('0xd')](_0x155f('0x8c'),_0x2fcf21,_0x5c9332,_0x526356,_0x37d7d7[_0x155f('0x57')],_0x37d7d7[_0x155f('0x8d')]||null,NOW,NOW);if(_['isNil'](_0x4f7e4f['scheduledat'])){_0x20e462+=_0x155f('0x8e');}_0x174528['push'](_0x20e462);BPromise[_0x155f('0x8f')](_0x174528,handleQuery)[_0x155f('0x20')](function(_0x232065){BPromise[_0x155f('0x1f')]([handleAdditionalPhones()])[_0x155f('0x20')](function(){_0x174528=[];for(var _0x869ca7=0x0;_0x869ca7_0x4d23b9['name']===_0x48641d);let _0x202ec5=contactItemTypes['find'](_0xbc8aee=>_0xbc8aee[_0x04b2('0x64')]+_0x04b2('0x65')===_0x48641d);if(_[_0x04b2('0x1e')](_0xe38cd8)&&_[_0x04b2('0x1e')](_0x202ec5)){if(_0x27f4cd[_0x04b2('0x6c')](_0x48641d)){if(_0x451766[_0x04b2('0x6d')][_0x288640][_0x27f4cd[_0x48641d]]){var _0x531ee5=_[_0x04b2('0x6e')](_0x451766[_0x04b2('0x6d')][_0x288640][_0x27f4cd[_0x48641d]][_0x04b2('0x6f')](/"/g,'\x27'));switch(_0x48641d){case'scheduledat':var _0x53078b=moment(_0x531ee5,_0x04b2('0x70'),!![]);if(_0x53078b['isValid']()){_0x2b341e['push']('\x22'+_0x531ee5+'\x22');}else{_0x317381['push'](_0x04b2('0x71'));}break;case _0x04b2('0x38'):var _0x4d02d8=parseInt(_0x531ee5);_0x531ee5=_[_0x04b2('0x72')](_0x4d02d8)||_0x4d02d8<0x0||_0x4d02d8>0x4?_0x298f64?0x3:0x2:_0x4d02d8;_0x2b341e[_0x04b2('0x20')]('\x22'+_0x531ee5+'\x22');break;case _0x04b2('0x73'):var _0x3368d9=parseInt(_0x531ee5);if(_['isNumber'](_0x3368d9)&&_[_0x04b2('0x74')](_0x455ad4,_0x3368d9)){_0x2b341e[_0x04b2('0x20')]('\x22'+_0x3368d9+'\x22');}else{_0x317381[_0x04b2('0x20')]('agent\x20not\x20exists');}break;case _0x04b2('0x75'):if(isEmail(_0x531ee5)){_0x2b341e[_0x04b2('0x20')]('\x22'+_0x531ee5+'\x22');}else{_0x317381[_0x04b2('0x20')](_0x04b2('0x76'));}break;case _0x04b2('0x77'):var _0x1075c9=moment(_0x531ee5,_0x04b2('0x78'),!![]);if(_0x1075c9['isValid']()){_0x2b341e['push']('\x22'+_0x531ee5+'\x22');}else{_0x317381['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2b341e[_0x04b2('0x20')]('\x22'+_0x531ee5+'\x22');}}else{switch(_0x48641d){case'firstName':case _0x04b2('0x2d'):_0x317381[_0x04b2('0x20')](_0x48641d+_0x04b2('0x79'));break;default:_0x2b341e[_0x04b2('0x20')]('\x22\x22');}}}}else{var _0x3d58e9='';if(!_[_0x04b2('0x1e')](_0xe38cd8)){if(!_0x5975d9[_0x04b2('0x6c')](_0xe38cd8['id'])){for(var _0x58cda3=0x0;_0x58cda3<_0x27f4cd[_0x48641d][_0x04b2('0x1d')];_0x58cda3++){var _0x531ee5=_['trim'](_0x451766['data'][_0x288640][_0x27f4cd[_0x48641d][_0x58cda3]][_0x04b2('0x6f')](/"/g,'\x27'));var _0x2f4a59=phoneDescriptions[_0x04b2('0x6b')](_0x56a54c=>_0x56a54c['itemTypeId']===_0xe38cd8['id']);if(!_[_0x04b2('0x1e')](_0x2f4a59)){var _0x178fa3=_[_0x04b2('0x6e')](_0x451766[_0x04b2('0x6d')][_0x288640][_0x27f4cd[_0x2f4a59['description']][0x0]][_0x04b2('0x6f')](/"/g,'\x27'));if(!_[_0x04b2('0x1e')](_0x178fa3))_0x531ee5=_0x531ee5+'§'+_0x178fa3;}if(_0x3d58e9=='')_0x3d58e9=_0x531ee5;else _0x3d58e9+='|'+_0x531ee5;}_0x4ff26a['push'](_0xe38cd8['id']+':'+_0x3d58e9);_0x5975d9[_0xe38cd8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2b341e[_0x04b2('0x20')]('\x22'+_0x4ff26a[_0x04b2('0x19')](';')+'\x22');}if(_0x317381[_0x04b2('0x1d')]){handleError(_0x451766[_0x04b2('0x6d')][_0x288640],{'code':'SystemRow','message':_0x317381[_0x04b2('0x19')]()});}else{fs[_0x04b2('0x7a')](_0x15c203,_0x2b341e[_0x04b2('0x19')]()+'\x0a');}_0x2b341e=[];}if(!(stats[_0x04b2('0x6a')]%0xc8)){socket[_0x04b2('0x7b')](_0x04b2('0x7c')+_0x32a1c1,stats);stats[_0x04b2('0x55')]=[];}}if(stopped){logger[_0x04b2('0x56')](_0x04b2('0x7d'));_0x4c7f98[_0x04b2('0x7e')]();}}catch(_0x5a1307){handleError(_0x451766[_0x04b2('0x6d')][_0x288640],{'code':_0x04b2('0x7f'),'message':_0x5a1307['message']});logger[_0x04b2('0x24')](_0x04b2('0x80'),_0x5a1307[_0x04b2('0x25')]);}},'complete':function(){try{var _0x409259=[];var _0x2d396=tempTableName;_0x409259['push'](_0x04b2('0x81')+_0x2d396+_0x04b2('0x82'));logger[_0x04b2('0x56')](_0x04b2('0x83'),contactItemTypes[_0x04b2('0x1d')]);var _0x3dd526=util[_0x04b2('0xf')](_0x04b2('0x84'),_0x15c203,_0x2d396,_0x1ffe2a,_0x2605a9[_0x04b2('0x44')],_0x2605a9[_0x04b2('0x50')]||null,NOW,NOW);if(_[_0x04b2('0x1e')](_0x27f4cd['scheduledat'])){_0x3dd526+=_0x04b2('0x85');}_0x409259[_0x04b2('0x20')](_0x3dd526);BPromise[_0x04b2('0x86')](_0x409259,handleQuery)[_0x04b2('0x22')](function(_0x7c543d){BPromise['all']([handleAdditionalPhones()])[_0x04b2('0x22')](function(){_0x409259=[];for(var _0x4ba239=0x0;_0x4ba239\x20\x20');}var _0x5921ad=path[_0x04b2('0x19')](config['root'],_0x04b2('0x5f'),process[_0x04b2('0x8e')][0x2]);if(!fs[_0x04b2('0x8f')](_0x5921ad)){throw new Error(_0x04b2('0x90'));}var _0x10ff21={};try{_0x10ff21=JSON[_0x04b2('0x68')](process[_0x04b2('0x8e')][0x3]);if(!_0x10ff21[_0x04b2('0x5b')]){throw new Error(_0x04b2('0x91'));}var _0x338b0c=0x0;if(_0x10ff21[_0x04b2('0x5b')][_0x04b2('0x73')]){_0x338b0c=0x1;}if(!_0x10ff21[_0x04b2('0x44')]){throw new Error(_0x04b2('0x92'));}}catch(_0xb5d1d9){throw new Error('body\x20id\x20mandatory');}var _0x4061ad=[];try{_0x4061ad=_[_0x04b2('0x93')](JSON[_0x04b2('0x68')](process[_0x04b2('0x8e')][0x4]),'id');}catch(_0x4cb11a){logger[_0x04b2('0x56')](_0x04b2('0x94'));}main(_0x5921ad,_0x10ff21,_0x4061ad,_0x338b0c);}validate();process['on'](_0x04b2('0x95'),handleStop);process['on'](_0x04b2('0x96'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index b012118..0c9e78d 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 _0x37a8=['destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','queue','calleridnum','push','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number'];(function(_0x379e7e,_0x310dc9){var _0x3e7254=function(_0x23bdba){while(--_0x23bdba){_0x379e7e['push'](_0x379e7e['shift']());}};_0x3e7254(++_0x310dc9);}(_0x37a8,0x1a1));var _0x837a=function(_0x4af6a0,_0x522121){_0x4af6a0=_0x4af6a0-0x0;var _0x4c2b23=_0x37a8[_0x4af6a0];return _0x4c2b23;};'use strict';exports[_0x837a('0x0')]=function(_0x5e5302,_0x4d2f76){var _0x5dabc2=[{'type':_0x837a('0x1'),'content':_0x837a('0x2'),'variableName':null}];switch(_0x5e5302[_0x837a('0x3')]()){case _0x837a('0x4'):switch(_0x4d2f76['toLowerCase']()){case _0x837a('0x5'):_0x5dabc2['push']({'type':_0x837a('0x6'),'content':'','variableName':_0x837a('0x7')});_0x5dabc2['push']({'type':_0x837a('0x6'),'content':'','variableName':_0x837a('0x8')});break;case'outbound':_0x5dabc2[_0x837a('0x9')]({'type':_0x837a('0x1'),'content':_0x837a('0xa'),'variableName':null});_0x5dabc2[_0x837a('0x9')]({'type':_0x837a('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x5dabc2;};exports[_0x837a('0xb')]=function(_0x3ca923,_0x1204e4){var _0x2add99=[];switch(_0x3ca923[_0x837a('0x3')]()){case _0x837a('0x4'):switch(_0x1204e4[_0x837a('0x3')]()){case _0x837a('0x5'):_0x2add99=[{'type':_0x837a('0x1'),'content':_0x837a('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0xe'),'keyType':_0x837a('0x6'),'variableName':_0x837a('0x8')},{'type':'keyValue','content':'','key':_0x837a('0xf'),'keyType':_0x837a('0x6'),'variableName':_0x837a('0x10')},{'type':_0x837a('0xd'),'content':'','key':'Call\x20To','keyType':_0x837a('0x6'),'variableName':'destexten'},{'type':_0x837a('0xd'),'content':'','key':'Queue','keyType':_0x837a('0x6'),'variableName':'queue'},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x11'),'keyType':_0x837a('0x6'),'variableName':'uniqueid'},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x12'),'keyType':_0x837a('0x6'),'variableName':'agentcalledAt'},{'type':'string','content':_0x837a('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x14'),'keyType':_0x837a('0x6'),'variableName':_0x837a('0x15')},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x16'),'keyType':_0x837a('0x6'),'variableName':_0x837a('0x17')},{'type':_0x837a('0x1'),'content':_0x837a('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x19'),'keyType':_0x837a('0x6'),'variableName':_0x837a('0x1a')},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x1b'),'keyType':'variable','variableName':_0x837a('0x1c')},{'type':_0x837a('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x837a('0x6'),'variableName':_0x837a('0x1d')},{'type':_0x837a('0xd'),'content':'','key':'Hold\x20Time','keyType':_0x837a('0x6'),'variableName':_0x837a('0x1e')},{'type':'keyValue','content':'','key':_0x837a('0x1f'),'keyType':_0x837a('0x6'),'variableName':_0x837a('0x20')}];break;case _0x837a('0x21'):_0x2add99=[{'type':_0x837a('0x1'),'content':_0x837a('0xc'),'variableName':null},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x22'),'keyType':'variable','keyContent':'','variableName':_0x837a('0x17')},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x23'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x11'),'keyType':_0x837a('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0x837a('0x6'),'keyContent':'','variableName':'starttime'},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x24'),'keyType':'variable','keyContent':'','variableName':_0x837a('0x25')},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x26'),'keyType':_0x837a('0x6'),'keyContent':'','variableName':_0x837a('0x27')},{'type':'keyValue','content':'','key':_0x837a('0x28'),'keyType':'variable','keyContent':'','variableName':_0x837a('0x29')},{'type':_0x837a('0xd'),'content':'','key':_0x837a('0x2a'),'keyType':_0x837a('0x6'),'keyContent':'','variableName':_0x837a('0x2b')}];break;}}return _0x2add99;}; \ No newline at end of file +var _0x3cb8=['push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','Queue','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','UniqueId','uniqueid','Date','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','string','toLowerCase','voice','inbound'];(function(_0x5e038e,_0x324774){var _0x16e58e=function(_0x399d4a){while(--_0x399d4a){_0x5e038e['push'](_0x5e038e['shift']());}};_0x16e58e(++_0x324774);}(_0x3cb8,0x164));var _0x83cb=function(_0x9523e5,_0xef604b){_0x9523e5=_0x9523e5-0x0;var _0xec295a=_0x3cb8[_0x9523e5];return _0xec295a;};'use strict';exports['getSubjects']=function(_0x218c6c,_0x5cf945){var _0x558c2e=[{'type':_0x83cb('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x218c6c[_0x83cb('0x1')]()){case _0x83cb('0x2'):switch(_0x5cf945[_0x83cb('0x1')]()){case _0x83cb('0x3'):_0x558c2e[_0x83cb('0x4')]({'type':_0x83cb('0x5'),'content':'','variableName':_0x83cb('0x6')});_0x558c2e[_0x83cb('0x4')]({'type':'variable','content':'','variableName':_0x83cb('0x7')});break;case _0x83cb('0x8'):_0x558c2e['push']({'type':_0x83cb('0x0'),'content':_0x83cb('0x9'),'variableName':null});_0x558c2e[_0x83cb('0x4')]({'type':_0x83cb('0x5'),'content':'','variableName':_0x83cb('0xa')});break;}}return _0x558c2e;};exports[_0x83cb('0xb')]=function(_0x5dc939,_0x303ed8){var _0x18a6a6=[];switch(_0x5dc939['toLowerCase']()){case _0x83cb('0x2'):switch(_0x303ed8[_0x83cb('0x1')]()){case _0x83cb('0x3'):_0x18a6a6=[{'type':_0x83cb('0x0'),'content':_0x83cb('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0xe'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0xf'),'keyType':_0x83cb('0x5'),'variableName':_0x83cb('0x10')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0x83cb('0x5'),'variableName':_0x83cb('0x11')},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x12'),'keyType':_0x83cb('0x5'),'variableName':_0x83cb('0x6')},{'type':_0x83cb('0xd'),'content':'','key':'UniqueId','keyType':_0x83cb('0x5'),'variableName':'uniqueid'},{'type':_0x83cb('0xd'),'content':'','key':'Date','keyType':_0x83cb('0x5'),'variableName':_0x83cb('0x13')},{'type':'string','content':_0x83cb('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x15'),'keyType':_0x83cb('0x5'),'variableName':'destcalleridname'},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x16'),'keyType':_0x83cb('0x5'),'variableName':'destcalleridnum'},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x17'),'keyType':_0x83cb('0x5'),'variableName':_0x83cb('0x13')},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x18'),'keyType':_0x83cb('0x5'),'variableName':_0x83cb('0x19')},{'type':'keyValue','content':'','key':_0x83cb('0x1a'),'keyType':_0x83cb('0x5'),'variableName':'agentcompleteAt'},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x1b'),'keyType':'variable','variableName':_0x83cb('0x1c')},{'type':'keyValue','content':'','key':_0x83cb('0x1d'),'keyType':_0x83cb('0x5'),'variableName':_0x83cb('0x1e')}];break;case _0x83cb('0x8'):_0x18a6a6=[{'type':_0x83cb('0x0'),'content':_0x83cb('0xc'),'variableName':null},{'type':'keyValue','content':'','key':_0x83cb('0x1f'),'keyType':_0x83cb('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x20'),'keyType':_0x83cb('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x21'),'keyType':'variable','keyContent':'','variableName':_0x83cb('0x22')},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x23'),'keyType':_0x83cb('0x5'),'keyContent':'','variableName':_0x83cb('0x24')},{'type':_0x83cb('0x0'),'content':_0x83cb('0x25')},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x26'),'keyType':_0x83cb('0x5'),'keyContent':'','variableName':_0x83cb('0x27')},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x28'),'keyType':_0x83cb('0x5'),'keyContent':'','variableName':_0x83cb('0x29')},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x83cb('0x2a')},{'type':_0x83cb('0xd'),'content':'','key':_0x83cb('0x2b'),'keyType':_0x83cb('0x5'),'keyContent':'','variableName':_0x83cb('0x2c')}];break;}}return _0x18a6a6;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 280ef1a..63d7e7c 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 _0x45e6=['user','query','clone','body','html','phone','fax','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info','error','tracked'];(function(_0x11ba46,_0x1d6752){var _0x1c8c6f=function(_0x4cf96f){while(--_0x4cf96f){_0x11ba46['push'](_0x11ba46['shift']());}};_0x1c8c6f(++_0x1d6752);}(_0x45e6,0x194));var _0x645e=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x45e6[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x645e('0x0'));var db=require(_0x645e('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x645e('0x2')),'mail':require(_0x645e('0x3'))(_0x645e('0x4')),'fax':require(_0x645e('0x3'))(_0x645e('0x5')),'sms':require(_0x645e('0x3'))(_0x645e('0x6')),'chat':require(_0x645e('0x3'))(_0x645e('0x7')),'whatsapp':require(_0x645e('0x3'))(_0x645e('0x8'))};function getInteractionId(_0x1d6f51,_0x2a98f5,_0xad2663){if(_0x1d6f51&&_0x1d6f51[_[_0x645e('0x9')](_0xad2663)+_0x645e('0xa')]){return _0x1d6f51[_[_0x645e('0x9')](_0xad2663)+_0x645e('0xa')];}else if(_0x1d6f51&&_0x1d6f51['id']){return _0x1d6f51['id'];}else if(_0x2a98f5&&_0x2a98f5['id']){return _0x2a98f5['id'];}else{return _0x645e('0xb');}}function log(_0xb3085,_0x36c403,_0x19f544,_0x485d39,_0x84d0ee,_0x374b67){loggers[_0x84d0ee[_0x645e('0xc')]()][_0xb3085](_0x645e('0xd'),_0x374b67[_0x645e('0xe')](),_0x36c403?_0x36c403['id']:null,_0x36c403?_0x36c403[_0x645e('0xf')]:null,_0x36c403?_0x36c403['role']:null,getInteractionId(_0x19f544,_0x485d39,_0x84d0ee),_0x19f544?JSON[_0x645e('0x10')](_0x19f544):_0x645e('0x11'));}function updateUser(_0x4db238,_0x29ac7e,_0x1675b8,_0x3489e6,_0x4c946b){db[_[_0x645e('0x9')](_0x3489e6)+_0x645e('0x12')][_0x645e('0x13')]({'where':{'id':getInteractionId(_0x29ac7e,_0x1675b8,_0x3489e6)}})[_0x645e('0x14')](function(_0x4db429){if(_0x4db429){return _0x4db429[_0x645e('0x15')]({'UserId':_0x4db238?_0x4db238['id']:null});}})[_0x645e('0x14')](function(_0x322435){if(_0x322435){log(_0x645e('0x16'),_0x4db238,_0x29ac7e,_0x1675b8,_0x3489e6,_0x4c946b);}})['catch'](function(){log(_0x645e('0x17'),_0x4db238,_0x29ac7e,_0x1675b8,_0x3489e6,_0x4c946b);});}exports[_0x645e('0x18')]=function(_0x518dcd,_0x4638af){return function(_0xbec37c,_0x23d7f3,_0x5cfa7f){var _0x553264=_0xbec37c[_0x645e('0x19')];var _0x3c3140={};var _0x20f22b=_0xbec37c[_0x645e('0x1a')];if(_0x3c3140){_0x3c3140=_[_0x645e('0x1b')](_0xbec37c[_0x645e('0x1c')]);_0x3c3140=_['omit'](_0x3c3140,[_0x645e('0x1c'),_0x645e('0x1d'),_0x645e('0x1e'),_0x645e('0x1f'),_0x645e('0x20')]);}updateUser(_0x553264,_0x3c3140,_0x20f22b,_0x518dcd,_0x4638af);_0x5cfa7f(null);};}; \ No newline at end of file +var _0xada8=['[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','update','user','query','clone','omit','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xada8,0x69));var _0x8ada=function(_0x1bc9ad,_0x5a6b00){_0x1bc9ad=_0x1bc9ad-0x0;var _0x37662f=_0xada8[_0x1bc9ad];return _0x37662f;};'use strict';var _=require(_0x8ada('0x0'));var db=require(_0x8ada('0x1'))['db'];var loggers={'openchannel':require(_0x8ada('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x8ada('0x3')),'fax':require('../../config/logger')(_0x8ada('0x4')),'sms':require('../../config/logger')(_0x8ada('0x5')),'chat':require(_0x8ada('0x2'))(_0x8ada('0x6')),'whatsapp':require(_0x8ada('0x2'))(_0x8ada('0x7'))};function getInteractionId(_0x5a5c69,_0x3a9bc3,_0x2e174d){if(_0x5a5c69&&_0x5a5c69[_[_0x8ada('0x8')](_0x2e174d)+_0x8ada('0x9')]){return _0x5a5c69[_[_0x8ada('0x8')](_0x2e174d)+_0x8ada('0x9')];}else if(_0x5a5c69&&_0x5a5c69['id']){return _0x5a5c69['id'];}else if(_0x3a9bc3&&_0x3a9bc3['id']){return _0x3a9bc3['id'];}else{return'unknown';}}function log(_0xbe0b85,_0x7185d6,_0x290a71,_0x45e02a,_0xde63ae,_0x47dc51){loggers[_0xde63ae[_0x8ada('0xa')]()][_0xbe0b85](_0x8ada('0xb'),_0x47dc51[_0x8ada('0xc')](),_0x7185d6?_0x7185d6['id']:null,_0x7185d6?_0x7185d6[_0x8ada('0xd')]:null,_0x7185d6?_0x7185d6[_0x8ada('0xe')]:null,getInteractionId(_0x290a71,_0x45e02a,_0xde63ae),_0x290a71?JSON['stringify'](_0x290a71):_0x8ada('0xf'));}function updateUser(_0x2bb3e8,_0x365e52,_0x3c20f9,_0x138f4e,_0x969f1c){db[_[_0x8ada('0x8')](_0x138f4e)+_0x8ada('0x10')][_0x8ada('0x11')]({'where':{'id':getInteractionId(_0x365e52,_0x3c20f9,_0x138f4e)}})[_0x8ada('0x12')](function(_0x3b70cf){if(_0x3b70cf){return _0x3b70cf[_0x8ada('0x13')]({'UserId':_0x2bb3e8?_0x2bb3e8['id']:null});}})['then'](function(_0x2d7cc4){if(_0x2d7cc4){log('info',_0x2bb3e8,_0x365e52,_0x3c20f9,_0x138f4e,_0x969f1c);}})['catch'](function(){log('error',_0x2bb3e8,_0x365e52,_0x3c20f9,_0x138f4e,_0x969f1c);});}exports['tracked']=function(_0x53bb66,_0x4702ff){return function(_0xdb410c,_0x4427a0,_0x25c4e5){var _0x5cafb5=_0xdb410c[_0x8ada('0x14')];var _0x1a5637={};var _0x30b180=_0xdb410c[_0x8ada('0x15')];if(_0x1a5637){_0x1a5637=_[_0x8ada('0x16')](_0xdb410c['body']);_0x1a5637=_[_0x8ada('0x17')](_0x1a5637,[_0x8ada('0x18'),_0x8ada('0x19'),_0x8ada('0x1a'),_0x8ada('0x1b'),_0x8ada('0x1c')]);}updateUser(_0x5cafb5,_0x1a5637,_0x30b180,_0x53bb66,_0x4702ff);_0x25c4e5(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 1186295..100602e 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 _0x484c=['createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split'];(function(_0x2ff219,_0x183f67){var _0xf86565=function(_0x2a5866){while(--_0x2a5866){_0x2ff219['push'](_0x2ff219['shift']());}};_0xf86565(++_0x183f67);}(_0x484c,0xfd));var _0xc484=function(_0x3246f3,_0x3778b8){_0x3246f3=_0x3246f3-0x0;var _0x2fb194=_0x484c[_0x3246f3];return _0x2fb194;};'use strict';var crypto=require(_0xc484('0x0'));var util=require(_0xc484('0x1'));var compose=require(_0xc484('0x2'));var db=require(_0xc484('0x3'))['db'];var config=require(_0xc484('0x4'));function getValueFromLicense(_0x2140a8,_0x232e1a){if(_0x2140a8&&_0x232e1a){if(_0x232e1a['data1']&&_0x232e1a[_0xc484('0x5')]){var _0x3e3141=_0x232e1a[_0xc484('0x6')];var _0x107002=_0x232e1a[_0xc484('0x5')];var _0x3098b1=_0x3e3141[_0xc484('0x7')]('-')[0x4];var _0x5da1ab=_0x3e3141['split']('-')[0x0];var _0x1663df=crypto[_0xc484('0x8')](_0xc484('0x9'),util[_0xc484('0xa')](_0xc484('0xb'),_0x3098b1,_0x3e3141,_0x5da1ab));var _0x1d0c05=_0x1663df[_0xc484('0xc')](_0x107002,_0xc484('0xd'),_0xc484('0xe'));_0x1d0c05+=_0x1663df[_0xc484('0xf')](_0xc484('0xe'));var _0x4d4923=JSON[_0xc484('0x10')](_0x1d0c05);return _0x4d4923[_0xc484('0x11')](_0x2140a8)?_0x4d4923[_0x2140a8]:null;}}return null;}function isLimit(_0x16f3b2,_0x77afac,_0x1ef403,_0x7bb614){var _0x49d460=_0x77afac;return compose()[_0xc484('0x12')](function(_0x43551d,_0x2f13b5,_0x7ae4a6){return db['License'][_0xc484('0x13')]({'where':{'id':0x1},'raw':!![]})[_0xc484('0x14')](function(_0x2a0682){var _0x363b34=getValueFromLicense(_0x16f3b2,_0x2a0682);return _0x363b34?_0x363b34:_0x49d460;})[_0xc484('0x14')](function(_0x4b9833){_0x49d460=_0x4b9833;return _0x1ef403[_0xc484('0x15')](_0x7bb614);})[_0xc484('0x14')](function(_0x4ba9d7){if(_0x4ba9d7>=_0x49d460){return _0x2f13b5[_0xc484('0x16')](0x193)[_0xc484('0x17')]({'message':util[_0xc484('0xa')](_0xc484('0x18'),_0x16f3b2)});}_0x7ae4a6();})['catch'](function(_0x466aa5){_0x7ae4a6(_0x466aa5);});});}function isUserLimit(){return isLimit(_0xc484('0x19'),0x1,db['User'],{'where':{'$or':[{'role':_0xc484('0x1a')},{'role':_0xc484('0x1b')}]}});}exports[_0xc484('0x1c')]=isUserLimit; \ No newline at end of file +var _0xbfb4=['util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','isUserLimit','crypto'];(function(_0x1c9530,_0x14f81c){var _0x264fde=function(_0x2f50cd){while(--_0x2f50cd){_0x1c9530['push'](_0x1c9530['shift']());}};_0x264fde(++_0x14f81c);}(_0xbfb4,0xfb));var _0x4bfb=function(_0x1c7b39,_0x237242){_0x1c7b39=_0x1c7b39-0x0;var _0x38676f=_0xbfb4[_0x1c7b39];return _0x38676f;};'use strict';var crypto=require(_0x4bfb('0x0'));var util=require(_0x4bfb('0x1'));var compose=require(_0x4bfb('0x2'));var db=require(_0x4bfb('0x3'))['db'];var config=require(_0x4bfb('0x4'));function getValueFromLicense(_0x3578cb,_0x591cf9){if(_0x3578cb&&_0x591cf9){if(_0x591cf9[_0x4bfb('0x5')]&&_0x591cf9[_0x4bfb('0x6')]){var _0x3d53d3=_0x591cf9['data1'];var _0x2f1713=_0x591cf9[_0x4bfb('0x6')];var _0x1d645e=_0x3d53d3[_0x4bfb('0x7')]('-')[0x4];var _0x19970a=_0x3d53d3[_0x4bfb('0x7')]('-')[0x0];var _0x2d0af6=crypto['createDecipher'](_0x4bfb('0x8'),util[_0x4bfb('0x9')](_0x4bfb('0xa'),_0x1d645e,_0x3d53d3,_0x19970a));var _0x4ad5ae=_0x2d0af6[_0x4bfb('0xb')](_0x2f1713,_0x4bfb('0xc'),'utf8');_0x4ad5ae+=_0x2d0af6['final'](_0x4bfb('0xd'));var _0x3e25ab=JSON[_0x4bfb('0xe')](_0x4ad5ae);return _0x3e25ab[_0x4bfb('0xf')](_0x3578cb)?_0x3e25ab[_0x3578cb]:null;}}return null;}function isLimit(_0x106802,_0xb91e8,_0x21499a,_0x352595){var _0x267a8b=_0xb91e8;return compose()[_0x4bfb('0x10')](function(_0x486a10,_0x503758,_0x388d2e){return db[_0x4bfb('0x11')][_0x4bfb('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x4bfb('0x13')](function(_0x1f394d){var _0x56ddd1=getValueFromLicense(_0x106802,_0x1f394d);return _0x56ddd1?_0x56ddd1:_0x267a8b;})[_0x4bfb('0x13')](function(_0x5a6715){_0x267a8b=_0x5a6715;return _0x21499a[_0x4bfb('0x14')](_0x352595);})[_0x4bfb('0x13')](function(_0x413455){if(_0x413455>=_0x267a8b){return _0x503758[_0x4bfb('0x15')](0x193)[_0x4bfb('0x16')]({'message':util['format'](_0x4bfb('0x17'),_0x106802)});}_0x388d2e();})[_0x4bfb('0x18')](function(_0x103869){_0x388d2e(_0x103869);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x4bfb('0x19')],{'where':{'$or':[{'role':_0x4bfb('0x1a')},{'role':'user'}]}});}exports[_0x4bfb('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 5bab215..b41784e 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 _0xf248=['pop','utcOffset','hours','minutes','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','forEach','shift','match','filter','indexOf','map','push','buildExpression','DATE','operator','$eq','$between','includes','$gt','$lte','value','add','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','$in','IN\x20?','=\x20?','<>\x20?','$substring','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','start'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf248,0x1ea));var _0x8f24=function(_0x1c5095,_0x155813){_0x1c5095=_0x1c5095-0x0;var _0x16ecca=_0xf248[_0x1c5095];return _0x16ecca;};'use strict';var _=require(_0x8f24('0x0'));var moment=require(_0x8f24('0x1'));exports[_0x8f24('0x2')]=function(_0x12dfff){var _0x3c8170={'conditions':[]};_0x3c8170[_0x8f24('0x3')]=_[_0x8f24('0x4')](_0x12dfff,_0x8f24('0x5'))?'or':_0x8f24('0x6');var _0x4e73e2=_0x12dfff[_0x8f24('0x7')](_0x8f24('0x8'),'')[_0x8f24('0x7')](_0x8f24('0x5'),'')[_0x8f24('0x9')]('||');for(var _0x32c84b=0x0;_0x32c84b<_0x4e73e2[_0x8f24('0xa')];_0x32c84b++){var _0x188d91=_0x4e73e2[_0x32c84b][_0x8f24('0x9')](':=');var _0x41ef8b=_0x188d91[0x0];var _0x46d61d=_0x188d91['slice'](0x1);_0x46d61d[_0x8f24('0xb')](function(_0x389e30){var _0x4d2457=_0x389e30['split']('[')[_0x8f24('0xc')]();var _0x1f06be=_0x389e30[_0x8f24('0xd')](/\[(.*?)\]/g);_0x1f06be['forEach'](function(_0x279890){var _0x54a724=_0x279890['split']('[')[_0x8f24('0xe')](function(_0x180b55){return _0x180b55[_0x8f24('0xf')](']')>-0x1;})[_0x8f24('0x10')](function(_0x3a4ca7){return _0x3a4ca7[_0x8f24('0x9')](']')[0x0];})[0x0];_0x3c8170['conditions'][_0x8f24('0x11')]({'field':_0x41ef8b,'operator':_0x4d2457,'value':_0x54a724});});});}return _0x3c8170;};exports[_0x8f24('0x12')]=function(_0x1f730a,_0x473a8b,_0x33136b){var _0x1c7a45={};if(_0x473a8b===_0x8f24('0x13')){if(_0x33136b[_0x8f24('0x14')]===_0x8f24('0x15')){_0x33136b['operator']=_0x8f24('0x16');_0x33136b['value']+=','+_0x33136b['value'];}else if(_[_0x8f24('0x17')]([_0x8f24('0x18'),_0x8f24('0x19')],_0x33136b['operator'])){_0x33136b[_0x8f24('0x1a')]=moment(_0x33136b[_0x8f24('0x1a')])[_0x8f24('0x1b')](0x1,_0x8f24('0x1c'))[_0x8f24('0x1d')](_0x8f24('0x1e'));}}if(_0x33136b[_0x8f24('0x1f')]){_0x473a8b=_0x33136b[_0x8f24('0x1f')];_0x1c7a45['text']=_0x8f24('0x20')+_0x1f730a+'.'+_0x33136b[_0x8f24('0x21')]+_0x8f24('0x22')+_0x33136b[_0x8f24('0x1f')]+')\x20'+parseOperator(_0x33136b['operator']);}else{_0x1c7a45[_0x8f24('0x23')]=_0x1f730a+'.'+_0x33136b['field']+'\x20'+parseOperator(_0x33136b[_0x8f24('0x14')]);}if(_[_0x8f24('0x17')]([_0x8f24('0x24'),_0x8f24('0x25')],_0x33136b[_0x8f24('0x14')]))_0x1c7a45[_0x8f24('0x23')]='('+_0x1c7a45[_0x8f24('0x23')]+_0x8f24('0x26')+_0x1f730a+'.'+_0x33136b[_0x8f24('0x21')]+'\x20IS\x20NULL)';_0x1c7a45[_0x8f24('0x1a')]=parseValue(_0x473a8b,_0x33136b[_0x8f24('0x14')],_0x33136b[_0x8f24('0x1a')]);return _0x1c7a45;};function parseOperator(_0x8fa51b){var _0x23132c;switch(_0x8fa51b){case _0x8f24('0x27'):_0x23132c=_0x8f24('0x28');break;case _0x8f24('0x25'):_0x23132c='NOT\x20IN\x20?';break;case'$eq':_0x23132c=_0x8f24('0x29');break;case _0x8f24('0x24'):_0x23132c=_0x8f24('0x2a');break;case _0x8f24('0x2b'):case'$startsWith':case'$endsWith':_0x23132c=_0x8f24('0x2c');break;case'$lt':_0x23132c=_0x8f24('0x2d');break;case _0x8f24('0x18'):_0x23132c=_0x8f24('0x2e');break;case _0x8f24('0x19'):_0x23132c=_0x8f24('0x2f');break;case _0x8f24('0x30'):_0x23132c='>=\x20?';break;case _0x8f24('0x16'):_0x23132c='BETWEEN\x20?\x20AND\x20?';break;}return _0x23132c;}function parseValue(_0x4c36d3,_0x3ad4f1,_0x2af046){var _0x468c6d={'start':undefined,'end':undefined};switch(_0x3ad4f1){case _0x8f24('0x27'):case _0x8f24('0x25'):_0x468c6d['start']=_0x2af046['split'](',');break;case'$substring':_0x468c6d[_0x8f24('0x31')]='%'+_0x2af046+'%';break;case'$startsWith':_0x468c6d[_0x8f24('0x31')]=_0x2af046+'%';break;case'$endsWith':_0x468c6d['start']='%'+_0x2af046;break;case'$between':var _0x27ac61=_0x2af046[_0x8f24('0x9')](',');var _0x2af046=_0x27ac61[_0x8f24('0xc')]();var _0x3b691a=_0x27ac61[_0x8f24('0x32')]();if(_0x4c36d3==='DATE'){_0x2af046=moment(_0x2af046)['utcOffset'](0x0,!![])[_0x8f24('0x1d')]();_0x3b691a=moment(_0x3b691a)[_0x8f24('0x33')](0x0,!![])[_0x8f24('0x1b')](0x17,_0x8f24('0x34'))[_0x8f24('0x1b')](0x3b,_0x8f24('0x35'))[_0x8f24('0x1b')](0x3b,'seconds')[_0x8f24('0x1d')]();}_0x468c6d={'start':_0x2af046,'end':_0x3b691a};break;default:_0x468c6d[_0x8f24('0x31')]=_0x2af046;break;}return _0x468c6d;} \ No newline at end of file +var _0x14ba=['LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','shift','DATE','format','utcOffset','minutes','seconds','lodash','moment','[$or]','and','replace','[$and]','length','split','forEach','match','filter','indexOf','map','conditions','buildExpression','$eq','operator','$between','value','includes','$gt','$lte','add','days','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','$substring','$startsWith'];(function(_0x15f40d,_0x7b8730){var _0x3410c5=function(_0x12bc7d){while(--_0x12bc7d){_0x15f40d['push'](_0x15f40d['shift']());}};_0x3410c5(++_0x7b8730);}(_0x14ba,0x1ec));var _0xa14b=function(_0x3d9362,_0x281193){_0x3d9362=_0x3d9362-0x0;var _0x3df7ef=_0x14ba[_0x3d9362];return _0x3df7ef;};'use strict';var _=require(_0xa14b('0x0'));var moment=require(_0xa14b('0x1'));exports['parseSearch']=function(_0x4d2a51){var _0xb610f1={'conditions':[]};_0xb610f1['sqlOperator']=_['startsWith'](_0x4d2a51,_0xa14b('0x2'))?'or':_0xa14b('0x3');var _0x204133=_0x4d2a51[_0xa14b('0x4')](_0xa14b('0x5'),'')[_0xa14b('0x4')](_0xa14b('0x2'),'')['split']('||');for(var _0x420a80=0x0;_0x420a80<_0x204133[_0xa14b('0x6')];_0x420a80++){var _0x4cbe72=_0x204133[_0x420a80][_0xa14b('0x7')](':=');var _0x129127=_0x4cbe72[0x0];var _0x52646b=_0x4cbe72['slice'](0x1);_0x52646b[_0xa14b('0x8')](function(_0x4fd98d){var _0x566f63=_0x4fd98d[_0xa14b('0x7')]('[')['shift']();var _0x37f787=_0x4fd98d[_0xa14b('0x9')](/\[(.*?)\]/g);_0x37f787[_0xa14b('0x8')](function(_0x4ec6fe){var _0x30c7d7=_0x4ec6fe[_0xa14b('0x7')]('[')[_0xa14b('0xa')](function(_0x5b9cca){return _0x5b9cca[_0xa14b('0xb')](']')>-0x1;})[_0xa14b('0xc')](function(_0x2bf4e4){return _0x2bf4e4[_0xa14b('0x7')](']')[0x0];})[0x0];_0xb610f1[_0xa14b('0xd')]['push']({'field':_0x129127,'operator':_0x566f63,'value':_0x30c7d7});});});}return _0xb610f1;};exports[_0xa14b('0xe')]=function(_0x4da848,_0x18f69a,_0x57ce07){var _0x1a000c={};if(_0x18f69a==='DATE'){if(_0x57ce07['operator']===_0xa14b('0xf')){_0x57ce07[_0xa14b('0x10')]=_0xa14b('0x11');_0x57ce07[_0xa14b('0x12')]+=','+_0x57ce07[_0xa14b('0x12')];}else if(_[_0xa14b('0x13')]([_0xa14b('0x14'),_0xa14b('0x15')],_0x57ce07[_0xa14b('0x10')])){_0x57ce07['value']=moment(_0x57ce07[_0xa14b('0x12')])[_0xa14b('0x16')](0x1,_0xa14b('0x17'))['format']('YYYY-MM-DD');}}if(_0x57ce07[_0xa14b('0x18')]){_0x18f69a=_0x57ce07[_0xa14b('0x18')];_0x1a000c[_0xa14b('0x19')]=_0xa14b('0x1a')+_0x4da848+'.'+_0x57ce07[_0xa14b('0x1b')]+_0xa14b('0x1c')+_0x57ce07[_0xa14b('0x18')]+')\x20'+parseOperator(_0x57ce07[_0xa14b('0x10')]);}else{_0x1a000c[_0xa14b('0x19')]=_0x4da848+'.'+_0x57ce07['field']+'\x20'+parseOperator(_0x57ce07[_0xa14b('0x10')]);}if(_[_0xa14b('0x13')]([_0xa14b('0x1d'),'$notIn'],_0x57ce07[_0xa14b('0x10')]))_0x1a000c[_0xa14b('0x19')]='('+_0x1a000c[_0xa14b('0x19')]+_0xa14b('0x1e')+_0x4da848+'.'+_0x57ce07[_0xa14b('0x1b')]+_0xa14b('0x1f');_0x1a000c['value']=parseValue(_0x18f69a,_0x57ce07['operator'],_0x57ce07[_0xa14b('0x12')]);return _0x1a000c;};function parseOperator(_0x2db729){var _0x2cfe07;switch(_0x2db729){case _0xa14b('0x20'):_0x2cfe07=_0xa14b('0x21');break;case _0xa14b('0x22'):_0x2cfe07=_0xa14b('0x23');break;case _0xa14b('0xf'):_0x2cfe07='=\x20?';break;case'$ne':_0x2cfe07='<>\x20?';break;case _0xa14b('0x24'):case _0xa14b('0x25'):case'$endsWith':_0x2cfe07=_0xa14b('0x26');break;case _0xa14b('0x27'):_0x2cfe07=_0xa14b('0x28');break;case _0xa14b('0x14'):_0x2cfe07='>\x20?';break;case _0xa14b('0x15'):_0x2cfe07=_0xa14b('0x29');break;case _0xa14b('0x2a'):_0x2cfe07=_0xa14b('0x2b');break;case'$between':_0x2cfe07=_0xa14b('0x2c');break;}return _0x2cfe07;}function parseValue(_0x471f23,_0x5355dd,_0x29418f){var _0xbdfd0b={'start':undefined,'end':undefined};switch(_0x5355dd){case'$in':case _0xa14b('0x22'):_0xbdfd0b[_0xa14b('0x2d')]=_0x29418f['split'](',');break;case _0xa14b('0x24'):_0xbdfd0b[_0xa14b('0x2d')]='%'+_0x29418f+'%';break;case _0xa14b('0x25'):_0xbdfd0b[_0xa14b('0x2d')]=_0x29418f+'%';break;case _0xa14b('0x2e'):_0xbdfd0b[_0xa14b('0x2d')]='%'+_0x29418f;break;case _0xa14b('0x11'):var _0x6d6386=_0x29418f[_0xa14b('0x7')](',');var _0x29418f=_0x6d6386[_0xa14b('0x2f')]();var _0x59a306=_0x6d6386['pop']();if(_0x471f23===_0xa14b('0x30')){_0x29418f=moment(_0x29418f)['utcOffset'](0x0,!![])[_0xa14b('0x31')]();_0x59a306=moment(_0x59a306)[_0xa14b('0x32')](0x0,!![])[_0xa14b('0x16')](0x17,'hours')[_0xa14b('0x16')](0x3b,_0xa14b('0x33'))[_0xa14b('0x16')](0x3b,_0xa14b('0x34'))[_0xa14b('0x31')]();}_0xbdfd0b={'start':_0x29418f,'end':_0x59a306};break;default:_0xbdfd0b[_0xa14b('0x2d')]=_0x29418f;break;}return _0xbdfd0b;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bf0598c..69cfd30 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 _0x3eea=['intersection','offset','where','filter','object','value','VIRTUAL','lower','merge','options','lodash','moment','parse','keys','includes','fields','filters','isEmpty','type','DATE','isPlainObject','format','YYYY-MM-DD','utc','name','uniqueid','isArray','split','limit','sort','indexOf','cast','priority','unsigned','substr','DESC','col','ASC','omit','isObject','isString','length','unset','hasOwnProperty','^[+]?[0-9]*$','match','getFullTextValue','forEach','replace','push','getOptions','$id','query','model','map','attributes'];(function(_0x289e88,_0x35e971){var _0x5c7f9c=function(_0x4b0b7b){while(--_0x4b0b7b){_0x289e88['push'](_0x289e88['shift']());}};_0x5c7f9c(++_0x35e971);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x56a80d,_0x3e5992){_0x56a80d=_0x56a80d-0x0;var _0x5e6009=_0x3eea[_0x56a80d];return _0x5e6009;};'use strict';var _=require(_0xa3ee('0x0'));var sequelize=require('sequelize');var moment=require(_0xa3ee('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2abe9e){var _0x16512c=['ne'];try{var _0x1c6a49=JSON[_0xa3ee('0x2')](_0x2abe9e);var _0x269141=Object[_0xa3ee('0x3')](_0x1c6a49)[0x0];return _0x16512c[_0xa3ee('0x4')](_0x269141);}catch(_0x23c42d){return![];}}function getOperatorValue(_0x1d91df){var _0xb93cdb=JSON['parse'](_0x1d91df);var _0x538bf9=Object[_0xa3ee('0x3')](_0xb93cdb)[0x0];var _0x4e4588=_0xb93cdb[_0x538bf9];return{['$'+_0x538bf9]:_0x4e4588};}exports[_0xa3ee('0x5')]=function(_0x56f37b){var _0x1eeb5b=null;if(_0x56f37b){_0x1eeb5b=_0x56f37b['split'](',');}return _0x1eeb5b;};exports[_0xa3ee('0x6')]=function(_0x5ef236,_0x28aeb1){var _0x1a3ab0={};if(!_[_0xa3ee('0x7')](_0x5ef236)){_['forOwn'](_0x5ef236,function(_0x3e5ac2,_0x327e98){try{if(_0x28aeb1){var _0x4dc361=_['find'](_0x28aeb1,{'name':_0x327e98})||{};if(hasSequelizeOperator(_0x3e5ac2)){_0x1a3ab0[_0x327e98]=getOperatorValue(_0x3e5ac2);}else if(_0x4dc361[_0xa3ee('0x8')]===_0xa3ee('0x9')&&_[_0xa3ee('0xa')](_0x3e5ac2)){var _0x4363d1=JSON['parse'](_0x3e5ac2);var _0x16d2f9={'$gte':moment(moment(_0x4363d1['$gte'])[_0xa3ee('0xb')](_0xa3ee('0xc')))[_0xa3ee('0xd')]()[_0xa3ee('0xb')](),'$lte':moment(moment(_0x4363d1['$lte'])[_0xa3ee('0xb')](_0xa3ee('0xc')))['utc']()['subtract'](0x1,'s')['format']()};_0x1a3ab0[_0x327e98]=_0x16d2f9;}else if(_0x4dc361[_0xa3ee('0xe')]===_0xa3ee('0xf')){_0x1a3ab0[_0x327e98]=_0x3e5ac2;}else{_0x1a3ab0[_0x327e98]=_[_0xa3ee('0x10')](_0x3e5ac2)?_0x3e5ac2:JSON[_0xa3ee('0x2')](_0x3e5ac2);}}else{_0x1a3ab0[_0x327e98]=_['isArray'](_0x3e5ac2)?_0x3e5ac2:JSON[_0xa3ee('0x2')](_0x3e5ac2);}}catch(_0x40ffdb){_0x1a3ab0[_0x327e98]=_0x3e5ac2[_0xa3ee('0x11')](',');}});}return _0x1a3ab0;};exports[_0xa3ee('0x12')]=function(_0xfab13e){_0xfab13e=parseInt(_0xfab13e,0xa);if(!_0xfab13e||_0xfab13e<0x0){_0xfab13e=LIMIT_VALUE;}return _0xfab13e;};exports['offset']=function(_0x377b9d){_0x377b9d=parseInt(_0x377b9d,0xa);if(!_0x377b9d||_0x377b9d<0x0){_0x377b9d=0x0;}return _0x377b9d;};exports[_0xa3ee('0x13')]=function(_0x35fbb2){var _0xad8187,_0x216b7d=null;if(_0x35fbb2){_0xad8187=_0x35fbb2[_0xa3ee('0x11')](',');_0x216b7d=_['map'](_0xad8187,function(_0x3f5d70){if(_0x3f5d70[_0xa3ee('0x14')]('-')===0x0){return[_0x3f5d70==='priority'?sequelize[_0xa3ee('0x15')](sequelize['col'](_0xa3ee('0x16')),_0xa3ee('0x17')):_0x3f5d70[_0xa3ee('0x18')](0x1),_0xa3ee('0x19')];}else{return[_0x3f5d70===_0xa3ee('0x16')?sequelize[_0xa3ee('0x15')](sequelize[_0xa3ee('0x1a')](_0xa3ee('0x16')),_0xa3ee('0x17')):_0x3f5d70,_0xa3ee('0x1b')];}});}return _0x216b7d;};exports['omit']=function(_0x1998b9,_0x1dca29){if(_[_0xa3ee('0x7')](_0x1998b9)){return _0x1998b9;}if(_[_0xa3ee('0x10')](_0x1998b9)){for(var _0x2c48db=0x0;_0x2c48db<_0x1998b9['length'];_0x2c48db+=0x1){_0x1998b9[_0x2c48db]=this[_0xa3ee('0x1c')](_0x1998b9[_0x2c48db],_0x1dca29);}return _0x1998b9;}if(!_[_0xa3ee('0x1d')](_0x1998b9)){return _0x1998b9;}if(_[_0xa3ee('0x1e')](_0x1dca29)){_0x1dca29=[_0x1dca29];}if(!_[_0xa3ee('0x10')](_0x1dca29)){return _0x1998b9;}for(var _0x42e97c=0x0;_0x42e97c<_0x1dca29[_0xa3ee('0x1f')];_0x42e97c+=0x1){_[_0xa3ee('0x20')](_0x1998b9,_0x1dca29[_0x42e97c]);}for(var _0x30b12b in _0x1998b9){if(_0x1998b9[_0xa3ee('0x21')](_0x30b12b)){_0x1998b9[_0x30b12b]=this[_0xa3ee('0x1c')](_0x1998b9[_0x30b12b],_0x1dca29);}}return _0x1998b9;};exports['isNumeric']=function(_0x5ba571){return _0x5ba571['match'](RegExp(_0xa3ee('0x22')))?!![]:![];};exports['isEmail']=function(_0x3fa094){return _0x3fa094[_0xa3ee('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xa3ee('0x24')]=function(_0x353272){var _0x26b222=[];_0x353272[_0xa3ee('0x11')](/[ ,]+/)[_0xa3ee('0x25')](function(_0x1dd03b){_0x1dd03b=_0x1dd03b[_0xa3ee('0x26')](/([^:]")"+/g,'$1');_0x1dd03b='+'+_0x1dd03b+'*';var _0x2cc835=/[ `!@#$%^&*()_\-?~]/;if(_0x1dd03b['match'](_0x2cc835))_0x1dd03b='\x22'+_0x1dd03b+'\x22';_0x26b222[_0xa3ee('0x27')](_0x1dd03b);});return _0x26b222['join']('\x20');};exports[_0xa3ee('0x28')]=function(_0x332d61,_0x496839,_0x179bc2){var _0x5a3c7f={},_0x5b54ba={};if(_0x496839['query'][_0xa3ee('0x29')]){_0x496839[_0xa3ee('0x2a')]['id']=_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x29')];delete _0x496839[_0xa3ee('0x2a')]['$id'];}_0x5a3c7f[_0xa3ee('0x2b')]=_[_0xa3ee('0x2c')](_0x332d61,_0xa3ee('0xe'));_0x5a3c7f['query']=_[_0xa3ee('0x3')](_0x496839['query']);_0x5a3c7f[_0xa3ee('0x6')]=_['intersection'](_0x5a3c7f[_0xa3ee('0x2b')],_0x5a3c7f['query']);_0x5b54ba[_0xa3ee('0x2d')]=_[_0xa3ee('0x2e')](_0x5a3c7f[_0xa3ee('0x2b')],this[_0xa3ee('0x5')](_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x5')]));_0x5b54ba[_0xa3ee('0x2d')]=_0x5b54ba[_0xa3ee('0x2d')][_0xa3ee('0x1f')]?_0x5b54ba[_0xa3ee('0x2d')]:_0x5a3c7f[_0xa3ee('0x2b')];if(!_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x21')]('nolimit')){_0x5b54ba[_0xa3ee('0x12')]=this[_0xa3ee('0x12')](_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x12')]);_0x5b54ba['offset']=this[_0xa3ee('0x2f')](_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x2f')]);}_0x5b54ba['order']=this[_0xa3ee('0x13')](_0x496839[_0xa3ee('0x2a')]['sort']);_0x5b54ba[_0xa3ee('0x30')]=this[_0xa3ee('0x6')](_['pick'](_0x496839[_0xa3ee('0x2a')],_0x5a3c7f[_0xa3ee('0x6')]),_0x332d61);if(_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x31')]){var _0x1f0023=_0x332d61;var _0x28e8c3=_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x31')];if(typeof _0x28e8c3===_0xa3ee('0x32')){_0x1f0023=_[_0xa3ee('0x31')](_0x332d61,function(_0xa0d2d5){return _['includes'](_0x28e8c3['columns'],_0xa0d2d5['name']);});_0x28e8c3=_0x28e8c3[_0xa3ee('0x33')];}_0x5b54ba[_0xa3ee('0x30')]=_['merge'](_0x5b54ba[_0xa3ee('0x30')],{'$or':_[_0xa3ee('0x2c')](_0x1f0023,function(_0x279834){if(_0x279834['type']!==_0xa3ee('0x34')){if(_0x179bc2){return sequelize['where'](sequelize['fn'](_0xa3ee('0x35'),sequelize[_0xa3ee('0x1a')](_0x279834[_0xa3ee('0xe')])),{'$like':sequelize['fn'](_0xa3ee('0x35'),'%'+_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x31')]+'%')});}else{var _0x3dd243={};_0x3dd243[_0x279834[_0xa3ee('0xe')]]={'$like':'%'+_0x496839[_0xa3ee('0x2a')][_0xa3ee('0x31')]+'%'};return _0x3dd243;}}})});}_0x5b54ba=_[_0xa3ee('0x36')]({},_0x5b54ba,_0x496839[_0xa3ee('0x37')]);return _0x5b54ba;}; \ No newline at end of file +var _0x3831=['unsigned','DESC','ASC','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','intersection','model','attributes','nolimit','offset','order','where','filter','object','value','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col'];(function(_0x29db2d,_0x24adce){var _0x35bfc1=function(_0x31ed79){while(--_0x31ed79){_0x29db2d['push'](_0x29db2d['shift']());}};_0x35bfc1(++_0x24adce);}(_0x3831,0x14c));var _0x1383=function(_0x4089c7,_0x120195){_0x4089c7=_0x4089c7-0x0;var _0x33dd04=_0x3831[_0x4089c7];return _0x33dd04;};'use strict';var _=require(_0x1383('0x0'));var sequelize=require('sequelize');var moment=require(_0x1383('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x42a46a){var _0x3a25fd=['ne'];try{var _0x15e6b5=JSON[_0x1383('0x2')](_0x42a46a);var _0x580d3d=Object[_0x1383('0x3')](_0x15e6b5)[0x0];return _0x3a25fd['includes'](_0x580d3d);}catch(_0x21ea2c){return![];}}function getOperatorValue(_0x53b708){var _0x5b64b1=JSON['parse'](_0x53b708);var _0x45a030=Object['keys'](_0x5b64b1)[0x0];var _0x187027=_0x5b64b1[_0x45a030];return{['$'+_0x45a030]:_0x187027};}exports[_0x1383('0x4')]=function(_0x2e9a5b){var _0x266bde=null;if(_0x2e9a5b){_0x266bde=_0x2e9a5b[_0x1383('0x5')](',');}return _0x266bde;};exports[_0x1383('0x6')]=function(_0x3ca0e6,_0xe0ee2f){var _0x47ba84={};if(!_[_0x1383('0x7')](_0x3ca0e6)){_[_0x1383('0x8')](_0x3ca0e6,function(_0x627ec3,_0xb11599){try{if(_0xe0ee2f){var _0x3675cb=_['find'](_0xe0ee2f,{'name':_0xb11599})||{};if(hasSequelizeOperator(_0x627ec3)){_0x47ba84[_0xb11599]=getOperatorValue(_0x627ec3);}else if(_0x3675cb[_0x1383('0x9')]===_0x1383('0xa')&&_[_0x1383('0xb')](_0x627ec3)){var _0x48c107=JSON['parse'](_0x627ec3);var _0x32e302={'$gte':moment(moment(_0x48c107[_0x1383('0xc')])[_0x1383('0xd')](_0x1383('0xe')))[_0x1383('0xf')]()[_0x1383('0xd')](),'$lte':moment(moment(_0x48c107[_0x1383('0x10')])[_0x1383('0xd')]('YYYY-MM-DD'))[_0x1383('0xf')]()[_0x1383('0x11')](0x1,'s')[_0x1383('0xd')]()};_0x47ba84[_0xb11599]=_0x32e302;}else if(_0x3675cb[_0x1383('0x12')]===_0x1383('0x13')){_0x47ba84[_0xb11599]=_0x627ec3;}else{_0x47ba84[_0xb11599]=_[_0x1383('0x14')](_0x627ec3)?_0x627ec3:JSON[_0x1383('0x2')](_0x627ec3);}}else{_0x47ba84[_0xb11599]=_['isArray'](_0x627ec3)?_0x627ec3:JSON['parse'](_0x627ec3);}}catch(_0x2301a6){_0x47ba84[_0xb11599]=_0x627ec3['split'](',');}});}return _0x47ba84;};exports[_0x1383('0x15')]=function(_0x5b3705){_0x5b3705=parseInt(_0x5b3705,0xa);if(!_0x5b3705||_0x5b3705<0x0){_0x5b3705=LIMIT_VALUE;}return _0x5b3705;};exports['offset']=function(_0x4d854f){_0x4d854f=parseInt(_0x4d854f,0xa);if(!_0x4d854f||_0x4d854f<0x0){_0x4d854f=0x0;}return _0x4d854f;};exports[_0x1383('0x16')]=function(_0x598d09){var _0x2aa3b6,_0x57a840=null;if(_0x598d09){_0x2aa3b6=_0x598d09[_0x1383('0x5')](',');_0x57a840=_[_0x1383('0x17')](_0x2aa3b6,function(_0xca314){if(_0xca314[_0x1383('0x18')]('-')===0x0){return[_0xca314===_0x1383('0x19')?sequelize[_0x1383('0x1a')](sequelize[_0x1383('0x1b')](_0x1383('0x19')),_0x1383('0x1c')):_0xca314['substr'](0x1),_0x1383('0x1d')];}else{return[_0xca314===_0x1383('0x19')?sequelize[_0x1383('0x1a')](sequelize[_0x1383('0x1b')](_0x1383('0x19')),_0x1383('0x1c')):_0xca314,_0x1383('0x1e')];}});}return _0x57a840;};exports['omit']=function(_0x5c4658,_0x1d24b7){if(_[_0x1383('0x7')](_0x5c4658)){return _0x5c4658;}if(_[_0x1383('0x14')](_0x5c4658)){for(var _0x3b158d=0x0;_0x3b158d<_0x5c4658[_0x1383('0x1f')];_0x3b158d+=0x1){_0x5c4658[_0x3b158d]=this['omit'](_0x5c4658[_0x3b158d],_0x1d24b7);}return _0x5c4658;}if(!_['isObject'](_0x5c4658)){return _0x5c4658;}if(_['isString'](_0x1d24b7)){_0x1d24b7=[_0x1d24b7];}if(!_[_0x1383('0x14')](_0x1d24b7)){return _0x5c4658;}for(var _0x128628=0x0;_0x128628<_0x1d24b7[_0x1383('0x1f')];_0x128628+=0x1){_[_0x1383('0x20')](_0x5c4658,_0x1d24b7[_0x128628]);}for(var _0x5866a1 in _0x5c4658){if(_0x5c4658[_0x1383('0x21')](_0x5866a1)){_0x5c4658[_0x5866a1]=this['omit'](_0x5c4658[_0x5866a1],_0x1d24b7);}}return _0x5c4658;};exports[_0x1383('0x22')]=function(_0xf0037f){return _0xf0037f[_0x1383('0x23')](RegExp(_0x1383('0x24')))?!![]:![];};exports[_0x1383('0x25')]=function(_0x15a3c4){return _0x15a3c4[_0x1383('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x1383('0x26')]=function(_0x1e91e7){var _0x29ca05=[];_0x1e91e7[_0x1383('0x5')](/[ ,]+/)[_0x1383('0x27')](function(_0x370bea){_0x370bea=_0x370bea[_0x1383('0x28')](/([^:]")"+/g,'$1');_0x370bea='+'+_0x370bea+'*';var _0x4c5810=/[ `!@#$%^&*()_\-?~]/;if(_0x370bea[_0x1383('0x23')](_0x4c5810))_0x370bea='\x22'+_0x370bea+'\x22';_0x29ca05[_0x1383('0x29')](_0x370bea);});return _0x29ca05[_0x1383('0x2a')]('\x20');};exports[_0x1383('0x2b')]=function(_0x64c8ce,_0x307ad7,_0x52b5b8){var _0x4522f5={},_0x12111e={};if(_0x307ad7[_0x1383('0x2c')][_0x1383('0x2d')]){_0x307ad7[_0x1383('0x2c')]['id']=_0x307ad7[_0x1383('0x2c')]['$id'];delete _0x307ad7[_0x1383('0x2c')]['$id'];}_0x4522f5['model']=_[_0x1383('0x17')](_0x64c8ce,_0x1383('0x12'));_0x4522f5[_0x1383('0x2c')]=_['keys'](_0x307ad7['query']);_0x4522f5['filters']=_[_0x1383('0x2e')](_0x4522f5[_0x1383('0x2f')],_0x4522f5[_0x1383('0x2c')]);_0x12111e['attributes']=_['intersection'](_0x4522f5[_0x1383('0x2f')],this[_0x1383('0x4')](_0x307ad7[_0x1383('0x2c')][_0x1383('0x4')]));_0x12111e['attributes']=_0x12111e['attributes'][_0x1383('0x1f')]?_0x12111e[_0x1383('0x30')]:_0x4522f5[_0x1383('0x2f')];if(!_0x307ad7[_0x1383('0x2c')][_0x1383('0x21')](_0x1383('0x31'))){_0x12111e[_0x1383('0x15')]=this['limit'](_0x307ad7[_0x1383('0x2c')]['limit']);_0x12111e[_0x1383('0x32')]=this[_0x1383('0x32')](_0x307ad7[_0x1383('0x2c')]['offset']);}_0x12111e[_0x1383('0x33')]=this['sort'](_0x307ad7['query'][_0x1383('0x16')]);_0x12111e[_0x1383('0x34')]=this[_0x1383('0x6')](_['pick'](_0x307ad7[_0x1383('0x2c')],_0x4522f5[_0x1383('0x6')]),_0x64c8ce);if(_0x307ad7[_0x1383('0x2c')][_0x1383('0x35')]){var _0x56c269=_0x64c8ce;var _0x1ea73e=_0x307ad7['query']['filter'];if(typeof _0x1ea73e===_0x1383('0x36')){_0x56c269=_[_0x1383('0x35')](_0x64c8ce,function(_0x524eaf){return _['includes'](_0x1ea73e['columns'],_0x524eaf[_0x1383('0x12')]);});_0x1ea73e=_0x1ea73e[_0x1383('0x37')];}_0x12111e[_0x1383('0x34')]=_[_0x1383('0x38')](_0x12111e[_0x1383('0x34')],{'$or':_[_0x1383('0x17')](_0x56c269,function(_0x12d58d){if(_0x12d58d[_0x1383('0x9')]!==_0x1383('0x39')){if(_0x52b5b8){return sequelize['where'](sequelize['fn'](_0x1383('0x3a'),sequelize[_0x1383('0x1b')](_0x12d58d[_0x1383('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x307ad7[_0x1383('0x2c')]['filter']+'%')});}else{var _0x2bc288={};_0x2bc288[_0x12d58d[_0x1383('0x12')]]={'$like':'%'+_0x307ad7[_0x1383('0x2c')][_0x1383('0x35')]+'%'};return _0x2bc288;}}})});}_0x12111e=_[_0x1383('0x38')]({},_0x12111e,_0x307ad7[_0x1383('0x3b')]);return _0x12111e;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 24f64db..3f93ca1 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(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 4be7fba..98b19d2 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 _0x433f=['family','IPv4','internal','concat','address','127.0.0.1','orderBy','cpus','map','model','createHash','md5','digest','platform','test','licenseToken','utf8','replace','hostname','macAddress','ipAddress','update','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','filter'];(function(_0x63fd6f,_0x2234d7){var _0x5d4fb1=function(_0x32247b){while(--_0x32247b){_0x63fd6f['push'](_0x63fd6f['shift']());}};_0x5d4fb1(++_0x2234d7);}(_0x433f,0x162));var _0xf433=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x433f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf433('0x0'));var os=require('os');var crypto=require(_0xf433('0x1'));var machine=require(_0xf433('0x2'));var exec=require(_0xf433('0x3'))[_0xf433('0x4')];var config=require(_0xf433('0x5'));function getInterfaces(){var _0x1fc877=[];var _0x2b2d8a=os[_0xf433('0x6')]();var _0x3b7ad1=_['orderBy'](_[_0xf433('0x7')](_0x2b2d8a));for(var _0x350ce4=0x0;_0x350ce4<_0x3b7ad1['length'];_0x350ce4++){var _0x2e2371=_0x2b2d8a[_0x3b7ad1[_0x350ce4]][_0xf433('0x8')](function(_0x374598){return _0x374598[_0xf433('0x9')]===_0xf433('0xa')&&_0x374598[_0xf433('0xb')]===![];});_0x1fc877=_0x1fc877[_0xf433('0xc')](_0x2e2371);}return _0x1fc877;}function getFirstInterface(){var _0x1ed2fb=_['head'](getInterfaces());return{'macAddress':_0x1ed2fb&&_0x1ed2fb['mac']?_0x1ed2fb['mac']:'00:00:00:00:00:00','ipAddress':_0x1ed2fb&&_0x1ed2fb['address']?_0x1ed2fb[_0xf433('0xd')]:_0xf433('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x3ad1d2=_[_0xf433('0xf')](os[_0xf433('0x10')]()[_0xf433('0x11')](function(_0x28868c){return _0x28868c[_0xf433('0x12')];}))['join'](':');return crypto[_0xf433('0x13')](_0xf433('0x14'))['update'](_0x3ad1d2)[_0xf433('0x15')]('hex');}exports['getUuid']=function(){var _0x426718=os[_0xf433('0x16')]();var _0x311ebe=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x311ebe[_0xf433('0x17')](config[_0xf433('0x18')])){return config[_0xf433('0x18')];}else if(_0x426718==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xf433('0x19')})[_0xf433('0x1a')]('\x0d\x0a','');}else{var _0x38cf54=getFirstInterface();var _0x7efdcc=getCPUhash();var _0xc14479=_0x7efdcc+'|'+os[_0xf433('0x1b')]()+'|'+_0x38cf54[_0xf433('0x1c')]+'|'+_0x38cf54[_0xf433('0x1d')];var _0x3eebb0=crypto[_0xf433('0x13')](_0xf433('0x14'))[_0xf433('0x1e')](_0xc14479)[_0xf433('0x15')](_0xf433('0x1f'));return _0x3eebb0[_0xf433('0x20')](0x0,0x8)+'-'+_0x3eebb0[_0xf433('0x20')](0x8,0xc)+'-'+_0x3eebb0[_0xf433('0x20')](0xc,0x10)+'-'+_0x3eebb0[_0xf433('0x20')](0x10,0x14)+'-'+_0x3eebb0[_0xf433('0x20')](0x14);}}; \ No newline at end of file +var _0x936b=['licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','orderBy','cpus','model','join','createHash','md5','update','digest','hex'];(function(_0x394af5,_0x21f22a){var _0x330508=function(_0x468a44){while(--_0x468a44){_0x394af5['push'](_0x394af5['shift']());}};_0x330508(++_0x21f22a);}(_0x936b,0x15d));var _0xb936=function(_0x21c022,_0x2798f6){_0x21c022=_0x21c022-0x0;var _0x3a5556=_0x936b[_0x21c022];return _0x3a5556;};'use strict';var _=require(_0xb936('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xb936('0x1'));var exec=require(_0xb936('0x2'))[_0xb936('0x3')];var config=require(_0xb936('0x4'));function getInterfaces(){var _0x3694fb=[];var _0x2cbfff=os[_0xb936('0x5')]();var _0x2e4606=_['orderBy'](_[_0xb936('0x6')](_0x2cbfff));for(var _0x342c49=0x0;_0x342c49<_0x2e4606[_0xb936('0x7')];_0x342c49++){var _0x2c31d8=_0x2cbfff[_0x2e4606[_0x342c49]][_0xb936('0x8')](function(_0x92c35d){return _0x92c35d['family']===_0xb936('0x9')&&_0x92c35d[_0xb936('0xa')]===![];});_0x3694fb=_0x3694fb[_0xb936('0xb')](_0x2c31d8);}return _0x3694fb;}function getFirstInterface(){var _0x359e02=_[_0xb936('0xc')](getInterfaces());return{'macAddress':_0x359e02&&_0x359e02[_0xb936('0xd')]?_0x359e02['mac']:_0xb936('0xe'),'ipAddress':_0x359e02&&_0x359e02[_0xb936('0xf')]?_0x359e02[_0xb936('0xf')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x12f3d2=_[_0xb936('0x10')](os[_0xb936('0x11')]()['map'](function(_0x89413c){return _0x89413c[_0xb936('0x12')];}))[_0xb936('0x13')](':');return crypto[_0xb936('0x14')](_0xb936('0x15'))[_0xb936('0x16')](_0x12f3d2)[_0xb936('0x17')](_0xb936('0x18'));}exports['getUuid']=function(){var _0x2368f1=os['platform']();var _0x18fdcf=/[0-9a-f-]{36}/;if(config[_0xb936('0x19')]&&_0x18fdcf[_0xb936('0x1a')](config[_0xb936('0x19')])){return config[_0xb936('0x19')];}else if(_0x2368f1===_0xb936('0x1b')){return exec(_0xb936('0x1c'),{'encoding':_0xb936('0x1d')})[_0xb936('0x1e')]('\x0d\x0a','');}else{var _0x29ca62=getFirstInterface();var _0x5459f1=getCPUhash();var _0x272eaf=_0x5459f1+'|'+os[_0xb936('0x1f')]()+'|'+_0x29ca62['macAddress']+'|'+_0x29ca62[_0xb936('0x20')];var _0x1ad287=crypto['createHash'](_0xb936('0x15'))[_0xb936('0x16')](_0x272eaf)[_0xb936('0x17')]('hex');return _0x1ad287[_0xb936('0x21')](0x0,0x8)+'-'+_0x1ad287['substring'](0x8,0xc)+'-'+_0x1ad287[_0xb936('0x21')](0xc,0x10)+'-'+_0x1ad287[_0xb936('0x21')](0x10,0x14)+'-'+_0x1ad287[_0xb936('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 8cbe409..d09f10d 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 _0xa5e7=['%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xa5e7,0x1b2));var _0x7a5e=function(_0x3cd038,_0x160ba0){_0x3cd038=_0x3cd038-0x0;var _0x511906=_0xa5e7[_0x3cd038];return _0x511906;};'use strict';var util=require('util');var moment=require(_0x7a5e('0x0'));var rp=require(_0x7a5e('0x1'));var BPromise=require(_0x7a5e('0x2'));var pkginfo=require(_0x7a5e('0x3'))(module,_0x7a5e('0x4'));var db=require(_0x7a5e('0x5'))['db'];var encryptor=require(_0x7a5e('0x6'));var hardware=require(_0x7a5e('0x7'));var logger=require('../logger')('license');var HOST=_0x7a5e('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xb1189a){return new BPromise(function(_0xc8ab38,_0x15cf3b){var _0x63ad3=util[_0x7a5e('0x9')](_0x7a5e('0xa'),HOST,_0xb1189a,module[_0x7a5e('0xb')][_0x7a5e('0x4')]);if(oldToken){_0x63ad3=util[_0x7a5e('0x9')](_0x7a5e('0xc'),HOST,_0xb1189a,module[_0x7a5e('0xb')][_0x7a5e('0x4')],oldToken);}var _0x28b54f={'uri':_0x63ad3,'method':_0x7a5e('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x28b54f)[_0x7a5e('0xe')](function(_0xea544){_0xc8ab38(_0xea544);})[_0x7a5e('0xf')](function(_0x33dd48){_0x15cf3b(_0x33dd48);});});}function manageLicense(_0xadb26d,_0x1e886e){var _0x3610a7=_0x1e886e[_0x7a5e('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x3610a7[_0x7a5e('0x11')]!==_0xadb26d&&!_0x3610a7[_0x7a5e('0x12')]){oldToken=_0x3610a7[_0x7a5e('0x11')];}httpRequest(_0xadb26d)[_0x7a5e('0xe')](function(_0x35cab6){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x35cab6[_0x7a5e('0x13')]){isOldTokenSent=![];if(!_0x3610a7[_0x7a5e('0x14')]&&_0x3610a7['license']!=_0x35cab6[_0x7a5e('0x14')]||_0x3610a7[_0x7a5e('0x14')]&&_0x3610a7[_0x7a5e('0x12')]){logger[_0x7a5e('0x15')](_0x7a5e('0x16'));}if(_0x3610a7[_0x7a5e('0x14')]&&!_0x3610a7[_0x7a5e('0x12')]&&_0x3610a7['license']!=_0x35cab6[_0x7a5e('0x14')]){logger[_0x7a5e('0x15')](_0x7a5e('0x17'));}if(_0x3610a7[_0x7a5e('0x14')]&&!_0x3610a7[_0x7a5e('0x12')]&&_0x3610a7[_0x7a5e('0x14')]==_0x35cab6[_0x7a5e('0x14')]){return _0x1e886e;}return _0x1e886e[_0x7a5e('0x18')]({'data1':_0xadb26d,'data2':null,'license':_0x35cab6[_0x7a5e('0x14')]});}else{if(_0x35cab6[_0x7a5e('0x14')]||_0x3610a7[_0x7a5e('0x14')]){if(!_0x3610a7[_0x7a5e('0x12')]){if(_0x3610a7['data1']==_0xadb26d){GRAY_PERIOD_REASON=_0x7a5e('0x19');logger[_0x7a5e('0x15')](_0x7a5e('0x1a'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x7a5e('0x1b'),_0x3610a7[_0x7a5e('0x11')],_0xadb26d);}logger['info'](_0x7a5e('0x1c'),GRAY_PERIOD_REASON[_0x7a5e('0x1d')](),moment()['format'](_0x7a5e('0x1e')));return _0x1e886e[_0x7a5e('0x18')]({'data2':encryptor[_0x7a5e('0x1f')](moment()['format'](_0x7a5e('0x1e')))});}else{if(moment()[_0x7a5e('0x20')](encryptor[_0x7a5e('0x21')](_0x3610a7[_0x7a5e('0x12')]),_0x7a5e('0x22'))>DAYS){logger['info'](_0x7a5e('0x23'),moment()[_0x7a5e('0x9')](_0x7a5e('0x1e')));isOldTokenSent=![];return _0x1e886e[_0x7a5e('0x18')]({'data1':_0xadb26d,'data2':null,'license':null});}}}else{if(_0x3610a7[_0x7a5e('0x11')]!=_0xadb26d){logger[_0x7a5e('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3610a7[_0x7a5e('0x11')],_0xadb26d);return _0x1e886e['update']({'data1':_0xadb26d,'data2':null,'license':null});}}}return _0x1e886e;})['then'](function(_0xdf7c1d){_0x1e886e=_0xdf7c1d;})['catch'](function(_0x4c3639){logger[_0x7a5e('0x24')](_0x4c3639[_0x7a5e('0x25')]);})[_0x7a5e('0x26')](function(){setTimeout(function(){manageLicense(hardware[_0x7a5e('0x27')](),_0x1e886e);},TIME);});}function defaultLicense(){var _0x5d3ee0=hardware[_0x7a5e('0x27')]();if(_0x5d3ee0){return db[_0x7a5e('0x28')][_0x7a5e('0x29')]({'where':{'id':0x1},'defaults':{'data1':_0x5d3ee0}})['spread'](function(_0x398f2a,_0x5c1745){logger[_0x7a5e('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x5d3ee0);manageLicense(_0x5d3ee0,_0x398f2a);})[_0x7a5e('0xf')](function(_0x822219){logger['error'](_0x822219[_0x7a5e('0x25')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x25fc=['../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','default','util','request-promise','bluebird','pkginfo','version','../../mysqldb'];(function(_0x28ce1b,_0x3a1baf){var _0x59f036=function(_0x6cc5cf){while(--_0x6cc5cf){_0x28ce1b['push'](_0x28ce1b['shift']());}};_0x59f036(++_0x3a1baf);}(_0x25fc,0x112));var _0xc25f=function(_0x3e6f96,_0x511e59){_0x3e6f96=_0x3e6f96-0x0;var _0x5533b5=_0x25fc[_0x3e6f96];return _0x5533b5;};'use strict';var util=require(_0xc25f('0x0'));var moment=require('moment');var rp=require(_0xc25f('0x1'));var BPromise=require(_0xc25f('0x2'));var pkginfo=require(_0xc25f('0x3'))(module,_0xc25f('0x4'));var db=require(_0xc25f('0x5'))['db'];var encryptor=require(_0xc25f('0x6'));var hardware=require(_0xc25f('0x7'));var logger=require(_0xc25f('0x8'))('license');var HOST=_0xc25f('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5d4b9e){return new BPromise(function(_0x3f7f29,_0x518c21){var _0x20da5b=util[_0xc25f('0xa')](_0xc25f('0xb'),HOST,_0x5d4b9e,module['exports']['version']);if(oldToken){_0x20da5b=util[_0xc25f('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x5d4b9e,module[_0xc25f('0xc')]['version'],oldToken);}var _0x3b9a72={'uri':_0x20da5b,'method':_0xc25f('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x3b9a72)[_0xc25f('0xe')](function(_0x4a8d1b){_0x3f7f29(_0x4a8d1b);})[_0xc25f('0xf')](function(_0x1d6f99){_0x518c21(_0x1d6f99);});});}function manageLicense(_0x41227d,_0x495c95){var _0x5e9241=_0x495c95[_0xc25f('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x5e9241[_0xc25f('0x11')]!==_0x41227d&&!_0x5e9241[_0xc25f('0x12')]){oldToken=_0x5e9241[_0xc25f('0x11')];}httpRequest(_0x41227d)[_0xc25f('0xe')](function(_0x39d481){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x39d481[_0xc25f('0x13')]){isOldTokenSent=![];if(!_0x5e9241[_0xc25f('0x14')]&&_0x5e9241[_0xc25f('0x14')]!=_0x39d481[_0xc25f('0x14')]||_0x5e9241[_0xc25f('0x14')]&&_0x5e9241[_0xc25f('0x12')]){logger[_0xc25f('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5e9241[_0xc25f('0x14')]&&!_0x5e9241['data2']&&_0x5e9241[_0xc25f('0x14')]!=_0x39d481['license']){logger['info'](_0xc25f('0x16'));}if(_0x5e9241[_0xc25f('0x14')]&&!_0x5e9241[_0xc25f('0x12')]&&_0x5e9241[_0xc25f('0x14')]==_0x39d481[_0xc25f('0x14')]){return _0x495c95;}return _0x495c95['update']({'data1':_0x41227d,'data2':null,'license':_0x39d481['license']});}else{if(_0x39d481[_0xc25f('0x14')]||_0x5e9241[_0xc25f('0x14')]){if(!_0x5e9241[_0xc25f('0x12')]){if(_0x5e9241[_0xc25f('0x11')]==_0x41227d){GRAY_PERIOD_REASON=_0xc25f('0x17');logger[_0xc25f('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xc25f('0x18');logger[_0xc25f('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5e9241['data1'],_0x41227d);}logger[_0xc25f('0x15')](_0xc25f('0x19'),GRAY_PERIOD_REASON[_0xc25f('0x1a')](),moment()[_0xc25f('0xa')](_0xc25f('0x1b')));return _0x495c95[_0xc25f('0x1c')]({'data2':encryptor[_0xc25f('0x1d')](moment()[_0xc25f('0xa')](_0xc25f('0x1b')))});}else{if(moment()[_0xc25f('0x1e')](encryptor['decryptString'](_0x5e9241['data2']),'days')>DAYS){logger[_0xc25f('0x15')](_0xc25f('0x1f'),moment()[_0xc25f('0xa')](_0xc25f('0x1b')));isOldTokenSent=![];return _0x495c95[_0xc25f('0x1c')]({'data1':_0x41227d,'data2':null,'license':null});}}}else{if(_0x5e9241['data1']!=_0x41227d){logger[_0xc25f('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5e9241['data1'],_0x41227d);return _0x495c95[_0xc25f('0x1c')]({'data1':_0x41227d,'data2':null,'license':null});}}}return _0x495c95;})['then'](function(_0x3c32df){_0x495c95=_0x3c32df;})[_0xc25f('0xf')](function(_0x561ea7){logger[_0xc25f('0x20')](_0x561ea7[_0xc25f('0x21')]);})[_0xc25f('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xc25f('0x23')](),_0x495c95);},TIME);});}function defaultLicense(){var _0xdd63e7=hardware[_0xc25f('0x23')]();if(_0xdd63e7){return db[_0xc25f('0x24')][_0xc25f('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0xdd63e7}})[_0xc25f('0x26')](function(_0x44bbe7,_0x372b1d){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xdd63e7);manageLicense(_0xdd63e7,_0x44bbe7);})[_0xc25f('0xf')](function(_0x2acfe2){logger[_0xc25f('0x20')](_0x2acfe2[_0xc25f('0x21')]);});}}exports[_0xc25f('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 185270d..e27d70b 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 _0x132e=['Breaking\x20license','License','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','grayReason','message','User','findAll','role','sequelize','COUNT','col','admin','telephone','users','forEach','user','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid'];(function(_0x287496,_0x3caace){var _0x105b4c=function(_0x248ed7){while(--_0x248ed7){_0x287496['push'](_0x287496['shift']());}};_0x105b4c(++_0x3caace);}(_0x132e,0x134));var _0xe132=function(_0x542e14,_0x5dfd4b){_0x542e14=_0x542e14-0x0;var _0xe3bbb=_0x132e[_0x542e14];return _0xe3bbb;};'use strict';var util=require('util');var _=require(_0xe132('0x0'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0xe132('0x1'));var encryptor=require(_0xe132('0x2'));var db=require(_0xe132('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe132('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe132('0x5'),'machineUuid':hardware[_0xe132('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe132('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe132('0x7'),'machineUuid':hardware[_0xe132('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x486bd2){return new BPromise(function(_0x182abe,_0x4c77ad){return db[_0xe132('0x8')]['find'](_[_0xe132('0x9')](_0x486bd2,{'raw':!![],'where':{'id':0x1}}))[_0xe132('0xa')](function(_0x18ee54){return checkLicense(_0x18ee54,null);})[_0xe132('0xa')](function(_0x5e884b){_0x182abe(_0x5e884b);return;})[_0xe132('0xb')](function(_0x3ee9b4){_0x4c77ad(_0x3ee9b4);});});}function checkLicense(_0xed6755,_0x6c0d86){if(!_0xed6755){demoLicense[_0xe132('0xc')]=_0xed6755[_0xe132('0xd')];return demoLicense;}try{var _0x4d77a9=_0x6c0d86||_0xed6755[_0xe132('0xe')];if(_[_0xe132('0xf')](_0x4d77a9)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x27d2a4=_0xed6755['data1'];var _0x317ba7=_0xed6755[_0xe132('0x10')];var _0x1c7a03=_0x27d2a4[_0xe132('0x11')]('-')[0x4];var _0x1e13a8=_0x27d2a4[_0xe132('0x11')]('-')[0x0];var _0xa0d1d6=encryptor[_0xe132('0x12')](_0x4d77a9,util[_0xe132('0x13')](_0xe132('0x14'),_0x1c7a03,_0x27d2a4,_0x1e13a8));var _0x45a2d6=JSON[_0xe132('0x15')](_0xa0d1d6);_0x45a2d6[_0xe132('0x16')]=![];_0x45a2d6[_0xe132('0xc')]=_0x27d2a4;_0x45a2d6[_0xe132('0x17')]=hardware[_0xe132('0x6')]();if(_0x317ba7){var _0x302c75=encryptor[_0xe132('0x12')](_0x317ba7);_0x45a2d6[_0xe132('0x18')]=_0x302c75;_0x45a2d6[_0xe132('0x19')]=moment(_0x302c75)['add'](0x7,'days')[_0xe132('0x13')]();_0x45a2d6[_0xe132('0x1a')]=_0x45a2d6[_0xe132('0xc')]!=_0x45a2d6[_0xe132('0x17')]?'changed':'disabled';}return _0x45a2d6;}catch(_0x39c916){breakingLicense[_0xe132('0xc')]=_0xed6755['data1'];breakingLicense[_0xe132('0x1b')]=_0x39c916[_0xe132('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x23cc0b,_0x1bbf73){getLicense()[_0xe132('0xa')](function(_0x40a452){return db[_0xe132('0x1c')][_0xe132('0x1d')]({'attributes':[_0xe132('0x1e'),[db[_0xe132('0x1f')]['fn'](_0xe132('0x20'),db['sequelize'][_0xe132('0x21')](_0xe132('0x1e'))),'count']],'group':_0xe132('0x1e'),'where':{'role':{'$or':[_0xe132('0x22'),'user',_0xe132('0x23')]}},'raw':!![]})[_0xe132('0xa')](function(_0x42b556){var _0x19505e={'user':_0x40a452[_0xe132('0x24')]||0x0,'telephone':_0x40a452['telephones']||0x0};_0x42b556[_0xe132('0x25')](function(_0x2f7209){var _0xec4523=_0x2f7209['role']===_0xe132('0x22')?_0xe132('0x26'):_0x2f7209[_0xe132('0x1e')];_0x19505e[_0xec4523]-=_0x2f7209[_0xe132('0x27')];if(_0x19505e[_0xec4523]<0x0)_0x19505e[_0xec4523]=0x0;});_0x23cc0b(_0x19505e);return;});})['catch'](function(_0x5b4c35){_0x1bbf73(_0x5b4c35);});});}function checkUserLimits(_0x36f56b){return new BPromise(function(_0x4fa7a3,_0x680a2a){getLimits()['then'](function(_0x3131fb){var _0x8e0d04=_[_0xe132('0x28')](_[_0xe132('0x29')](_0x36f56b,'role'),[_0xe132('0x22'),_0xe132('0x26'),_0xe132('0x23')]);var _0x3bf222=(_0x8e0d04[_0xe132('0x22')]||0x0)+(_0x8e0d04[_0xe132('0x26')]||0x0);var _0x166f6c=_0x8e0d04[_0xe132('0x23')]||0x0;if(_0x3bf222>_0x3131fb[_0xe132('0x26')])return _0x680a2a(_0xe132('0x2a'));if(_0x166f6c>_0x3131fb[_0xe132('0x23')])return _0x680a2a(_0xe132('0x2b'));return _0x4fa7a3();})[_0xe132('0xb')](function(_0x4d4816){_0x680a2a(_0x4d4816);});});}module[_0xe132('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x69d8=['License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','defaults','then','catch','data1','isEmpty','License\x20key\x20value\x20not\x20found','split','format','%s:%s:%s','parse','demo','uuid','machineUuid','decryptString','deadline','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','admin','user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users'];(function(_0x576359,_0x17b0a1){var _0x531a89=function(_0x2cecd5){while(--_0x2cecd5){_0x576359['push'](_0x576359['shift']());}};_0x531a89(++_0x17b0a1);}(_0x69d8,0x1c3));var _0x869d=function(_0x3b204d,_0x2868c6){_0x3b204d=_0x3b204d-0x0;var _0x31c4dd=_0x69d8[_0x3b204d];return _0x31c4dd;};'use strict';var util=require(_0x869d('0x0'));var _=require(_0x869d('0x1'));var moment=require(_0x869d('0x2'));var BPromise=require('bluebird');var hardware=require(_0x869d('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x869d('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x869d('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x869d('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x869d('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x869d('0x7'),'machineUuid':hardware[_0x869d('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2019bb){return new BPromise(function(_0x16602a,_0x32a8ae){return db[_0x869d('0x9')]['find'](_[_0x869d('0xa')](_0x2019bb,{'raw':!![],'where':{'id':0x1}}))[_0x869d('0xb')](function(_0x54428a){return checkLicense(_0x54428a,null);})[_0x869d('0xb')](function(_0x24e117){_0x16602a(_0x24e117);return;})[_0x869d('0xc')](function(_0x1adb9d){_0x32a8ae(_0x1adb9d);});});}function checkLicense(_0x9a12bf,_0xd888d9){if(!_0x9a12bf){demoLicense['uuid']=_0x9a12bf[_0x869d('0xd')];return demoLicense;}try{var _0x2a659d=_0xd888d9||_0x9a12bf['license'];if(_[_0x869d('0xe')](_0x2a659d)){throw new Error(_0x869d('0xf'));}var _0xe390ce=_0x9a12bf[_0x869d('0xd')];var _0x376684=_0x9a12bf['data2'];var _0x599a33=_0xe390ce[_0x869d('0x10')]('-')[0x4];var _0x13a7e7=_0xe390ce[_0x869d('0x10')]('-')[0x0];var _0x4583a5=encryptor['decryptString'](_0x2a659d,util[_0x869d('0x11')](_0x869d('0x12'),_0x599a33,_0xe390ce,_0x13a7e7));var _0x2eada8=JSON[_0x869d('0x13')](_0x4583a5);_0x2eada8[_0x869d('0x14')]=![];_0x2eada8[_0x869d('0x15')]=_0xe390ce;_0x2eada8[_0x869d('0x16')]=hardware['getUuid']();if(_0x376684){var _0x370bba=encryptor[_0x869d('0x17')](_0x376684);_0x2eada8['gray']=_0x370bba;_0x2eada8[_0x869d('0x18')]=moment(_0x370bba)['add'](0x7,_0x869d('0x19'))[_0x869d('0x11')]();_0x2eada8[_0x869d('0x1a')]=_0x2eada8[_0x869d('0x15')]!=_0x2eada8[_0x869d('0x16')]?_0x869d('0x1b'):_0x869d('0x1c');}return _0x2eada8;}catch(_0x2e565c){breakingLicense[_0x869d('0x15')]=_0x9a12bf[_0x869d('0xd')];breakingLicense[_0x869d('0x1d')]=_0x2e565c[_0x869d('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x51471b,_0x1d96a9){getLicense()[_0x869d('0xb')](function(_0x23b88e){return db[_0x869d('0x1e')][_0x869d('0x1f')]({'attributes':[_0x869d('0x20'),[db[_0x869d('0x21')]['fn']('COUNT',db[_0x869d('0x21')]['col'](_0x869d('0x20'))),'count']],'group':_0x869d('0x20'),'where':{'role':{'$or':[_0x869d('0x22'),_0x869d('0x23'),_0x869d('0x24')]}},'raw':!![]})[_0x869d('0xb')](function(_0xfb016c){var _0xcc88aa={'user':_0x23b88e[_0x869d('0x25')]||0x0,'telephone':_0x23b88e[_0x869d('0x26')]||0x0};_0xfb016c[_0x869d('0x27')](function(_0x569875){var _0x5bf4d2=_0x569875['role']==='admin'?_0x869d('0x23'):_0x569875[_0x869d('0x20')];_0xcc88aa[_0x5bf4d2]-=_0x569875[_0x869d('0x28')];if(_0xcc88aa[_0x5bf4d2]<0x0)_0xcc88aa[_0x5bf4d2]=0x0;});_0x51471b(_0xcc88aa);return;});})[_0x869d('0xc')](function(_0x295e9b){_0x1d96a9(_0x295e9b);});});}function checkUserLimits(_0x44d660){return new BPromise(function(_0x54a29e,_0x263924){getLimits()[_0x869d('0xb')](function(_0x1ca1b3){var _0x34c8d0=_[_0x869d('0x29')](_[_0x869d('0x2a')](_0x44d660,_0x869d('0x20')),[_0x869d('0x22'),_0x869d('0x23'),_0x869d('0x24')]);var _0x274233=(_0x34c8d0[_0x869d('0x22')]||0x0)+(_0x34c8d0['user']||0x0);var _0x2df5d3=_0x34c8d0[_0x869d('0x24')]||0x0;if(_0x274233>_0x1ca1b3[_0x869d('0x23')])return _0x263924(_0x869d('0x2b'));if(_0x2df5d3>_0x1ca1b3[_0x869d('0x24')])return _0x263924(_0x869d('0x2c'));return _0x54a29e();})['catch'](function(_0x20e369){_0x263924(_0x20e369);});});}module['exports']={'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 431d776..f597cf4 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 _0xf7b4=['app-id','secret','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1393d4,_0x1264b3){_0x1393d4=_0x1393d4-0x0;var _0x5f58a2=_0xf7b4[_0x1393d4];return _0x5f58a2;};'use strict';module[_0x4f7b('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4f7b('0x1'),'GOOGLE_SECRET':_0x4f7b('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x3423=['app-id','secret','myappanuglar-secret'];(function(_0x1b2afb,_0x198235){var _0x7610b5=function(_0x2bda16){while(--_0x2bda16){_0x1b2afb['push'](_0x1b2afb['shift']());}};_0x7610b5(++_0x198235);}(_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 diff --git a/server/config/logger.js b/server/config/logger.js index 33cfba9..2658d10 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa559=['exports','../utils/loggers','fileLogger'];(function(_0x43efc2,_0x440f4e){var _0x538e8e=function(_0x283f99){while(--_0x283f99){_0x43efc2['push'](_0x43efc2['shift']());}};_0x538e8e(++_0x440f4e);}(_0xa559,0xf4));var _0x9a55=function(_0x619b73,_0x1640ad){_0x619b73=_0x619b73-0x0;var _0x386ab3=_0xa559[_0x619b73];return _0x386ab3;};'use strict';var fileLogger=require(_0x9a55('0x0'))[_0x9a55('0x1')];module[_0x9a55('0x2')]=fileLogger; \ No newline at end of file +var _0x36d8=['exports','../utils/loggers','fileLogger'];(function(_0x46cd97,_0x1d7f12){var _0x4eeb8a=function(_0x46d6bf){while(--_0x46d6bf){_0x46cd97['push'](_0x46cd97['shift']());}};_0x4eeb8a(++_0x1d7f12);}(_0x36d8,0x1f3));var _0x836d=function(_0x28149d,_0x48d33a){_0x28149d=_0x28149d-0x0;var _0x4a36d7=_0x36d8[_0x28149d];return _0x4a36d7;};'use strict';var fileLogger=require(_0x836d('0x0'))[_0x836d('0x1')];module[_0x836d('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index dc24a8d..e5a2c3e 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 _0x2dcb=['../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','exports','path','../../services/express/index.js','join'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2dcb,0x1bf));var _0xb2dc=function(_0x1fe326,_0x13ebe4){_0x1fe326=_0x1fe326-0x0;var _0x474ca=_0x2dcb[_0x1fe326];return _0x474ca;};'use strict';var path=require(_0xb2dc('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0xb2dc('0x1'))},{'name':'ami','script':path[_0xb2dc('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0xb2dc('0x2')](__dirname,_0xb2dc('0x3'))},{'name':_0xb2dc('0x4'),'script':path[_0xb2dc('0x2')](__dirname,_0xb2dc('0x5'))},{'name':'routing','script':path[_0xb2dc('0x2')](__dirname,_0xb2dc('0x6'))},{'name':_0xb2dc('0x7'),'script':path[_0xb2dc('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xb2dc('0x8')]=config; \ No newline at end of file +var _0x45d9=['../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','path','express','join'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x45d9,0x75));var _0x945d=function(_0xf49d9c,_0x34a0ba){_0xf49d9c=_0xf49d9c-0x0;var _0x5abd3d=_0x45d9[_0xf49d9c];return _0x5abd3d;};'use strict';var path=require(_0x945d('0x0'));var os=require('os');var config={'apps':[{'name':_0x945d('0x1'),'script':path[_0x945d('0x2')](__dirname,_0x945d('0x3'))},{'name':'ami','script':path[_0x945d('0x2')](__dirname,_0x945d('0x4'))},{'name':_0x945d('0x5'),'script':path[_0x945d('0x2')](__dirname,_0x945d('0x6'))},{'name':_0x945d('0x7'),'script':path[_0x945d('0x2')](__dirname,_0x945d('0x8'))},{'name':'routing','script':path[_0x945d('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x945d('0x9'),'script':path['join'](__dirname,_0x945d('0xa'))}]};module[_0x945d('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7f71be4..8558895 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 _0x7062=['list','delete','dump','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart'];(function(_0x121e06,_0x4255ea){var _0x361d2a=function(_0x463396){while(--_0x463396){_0x121e06['push'](_0x121e06['shift']());}};_0x361d2a(++_0x4255ea);}(_0x7062,0x78));var _0x2706=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7062[_0x19950b];return _0x3c6b41;};'use strict';var pm2=require(_0x2706('0x0'));var BPromise=require(_0x2706('0x1'));var config=require(_0x2706('0x2'));function connect(){return new BPromise(function(_0x48d699,_0x49435c){return pm2[_0x2706('0x3')](function(_0x2d6356){if(_0x2d6356){return _0x49435c(_0x2d6356);}return _0x48d699(_0x2706('0x4'));});});};exports[_0x2706('0x5')]=function(_0x500656){return connect()[_0x2706('0x6')](function(){return new BPromise(function(_0x3afcd5,_0x508d9c){return pm2[_0x2706('0x5')](_0x500656,function(_0x303433,_0x31bfa2){if(_0x303433){return _0x508d9c(_0x303433);}pm2[_0x2706('0x7')]();return _0x3afcd5(_0x31bfa2);});});});};exports['stop']=function(_0x4b3823){return connect()[_0x2706('0x6')](function(){return new BPromise(function(_0xbf3088,_0x10f4b9){return pm2[_0x2706('0x8')](_0x4b3823,function(_0x352714,_0x25b01d){if(_0x352714){return _0x10f4b9(_0x352714);}pm2[_0x2706('0x7')]();return _0xbf3088(_0x25b01d);});});});};exports[_0x2706('0x9')]=function(_0x3162ad){return connect()['then'](function(){return new BPromise(function(_0x4f48f8,_0x226a05){return pm2[_0x2706('0x9')](_0x3162ad,function(_0x8b36ab,_0x402db1){if(_0x8b36ab){return _0x226a05(_0x8b36ab);}pm2['disconnect']();return _0x4f48f8(_0x402db1);});});});};exports['list']=function(){return connect()[_0x2706('0x6')](function(){return new BPromise(function(_0x47f668,_0x246d6b){return pm2[_0x2706('0xa')](function(_0x2072d3,_0x2f4dce){if(_0x2072d3){return _0x246d6b(_0x2072d3);}pm2[_0x2706('0x7')]();return _0x47f668(_0x2f4dce);});});});};exports['describe']=function(_0x296a52){return connect()[_0x2706('0x6')](function(){return new BPromise(function(_0x3513db,_0x20f509){return pm2['describe'](_0x296a52,function(_0x46d19f,_0x533187){if(_0x46d19f){return _0x20f509(_0x46d19f);}pm2[_0x2706('0x7')]();return _0x3513db(_0x533187);});});});};exports[_0x2706('0xb')]=function(_0x3da9e0){return connect()[_0x2706('0x6')](function(){return new BPromise(function(_0x28f30b,_0x2edfdf){return pm2[_0x2706('0xb')](_0x3da9e0,function(_0x4dba78,_0x52e126){if(_0x4dba78){return _0x2edfdf(_0x4dba78);}pm2[_0x2706('0x7')]();return _0x28f30b(_0x52e126);});});});};exports[_0x2706('0xc')]=function(){return connect()[_0x2706('0x6')](function(){return new BPromise(function(_0x17fb23,_0x5acf65){return pm2['dump'](function(_0x215852){if(_0x215852){return _0x5acf65(_0x215852);}return _0x17fb23('saved');});});});}; \ No newline at end of file +var _0x8da2=['then','disconnect','stop','restart','describe','delete','dump','pm2','./config','connected','start'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x8da2,0x188));var _0x28da=function(_0x1167f4,_0x41d21c){_0x1167f4=_0x1167f4-0x0;var _0x5f2a1c=_0x8da2[_0x1167f4];return _0x5f2a1c;};'use strict';var pm2=require(_0x28da('0x0'));var BPromise=require('bluebird');var config=require(_0x28da('0x1'));function connect(){return new BPromise(function(_0x13c913,_0x7d70b2){return pm2['connect'](function(_0x58824f){if(_0x58824f){return _0x7d70b2(_0x58824f);}return _0x13c913(_0x28da('0x2'));});});};exports[_0x28da('0x3')]=function(_0x3a48c){return connect()[_0x28da('0x4')](function(){return new BPromise(function(_0x4d1fbd,_0x8d7e88){return pm2[_0x28da('0x3')](_0x3a48c,function(_0x1b8fc3,_0x54bf51){if(_0x1b8fc3){return _0x8d7e88(_0x1b8fc3);}pm2[_0x28da('0x5')]();return _0x4d1fbd(_0x54bf51);});});});};exports[_0x28da('0x6')]=function(_0x3b7cdd){return connect()[_0x28da('0x4')](function(){return new BPromise(function(_0x365443,_0x49219c){return pm2[_0x28da('0x6')](_0x3b7cdd,function(_0x1ce62d,_0xa66495){if(_0x1ce62d){return _0x49219c(_0x1ce62d);}pm2[_0x28da('0x5')]();return _0x365443(_0xa66495);});});});};exports[_0x28da('0x7')]=function(_0x2e8470){return connect()[_0x28da('0x4')](function(){return new BPromise(function(_0x169033,_0x2bbe70){return pm2[_0x28da('0x7')](_0x2e8470,function(_0x5924f1,_0x3edf84){if(_0x5924f1){return _0x2bbe70(_0x5924f1);}pm2[_0x28da('0x5')]();return _0x169033(_0x3edf84);});});});};exports['list']=function(){return connect()[_0x28da('0x4')](function(){return new BPromise(function(_0x146c57,_0x19dfbb){return pm2['list'](function(_0x33e144,_0x27a925){if(_0x33e144){return _0x19dfbb(_0x33e144);}pm2[_0x28da('0x5')]();return _0x146c57(_0x27a925);});});});};exports['describe']=function(_0xbeb5ed){return connect()[_0x28da('0x4')](function(){return new BPromise(function(_0x191f5d,_0x1e1db4){return pm2[_0x28da('0x8')](_0xbeb5ed,function(_0x4e9a37,_0x1bb4a1){if(_0x4e9a37){return _0x1e1db4(_0x4e9a37);}pm2[_0x28da('0x5')]();return _0x191f5d(_0x1bb4a1);});});});};exports[_0x28da('0x9')]=function(_0xf8e0f0){return connect()[_0x28da('0x4')](function(){return new BPromise(function(_0x192bf2,_0x1f6d10){return pm2[_0x28da('0x9')](_0xf8e0f0,function(_0x466896,_0x2fb7f2){if(_0x466896){return _0x1f6d10(_0x466896);}pm2['disconnect']();return _0x192bf2(_0x2fb7f2);});});});};exports[_0x28da('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x52fb77,_0x35a6b5){return pm2[_0x28da('0xa')](function(_0x5a845d){if(_0x5a845d){return _0x35a6b5(_0x5a845d);}return _0x52fb77('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 4d86aca..a39e852 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 _0xe42c=['[CHAT]\x20Interactions\x20to\x20close:','update','system','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','find','then','ChatInteraction','findAll','lastMsgAt','subtract','chatTimeout','map','info'];(function(_0xf32c6d,_0x372704){var _0x156c11=function(_0x34ef76){while(--_0x34ef76){_0xf32c6d['push'](_0xf32c6d['shift']());}};_0x156c11(++_0x372704);}(_0xe42c,0x1cb));var _0xce42=function(_0x58b062,_0x1e68f9){_0x58b062=_0x58b062-0x0;var _0x15bf0a=_0xe42c[_0x58b062];return _0x15bf0a;};'use strict';var _=require(_0xce42('0x0'));var moment=require(_0xce42('0x1'));var Redis=require(_0xce42('0x2'));var util=require(_0xce42('0x3'));var config=require(_0xce42('0x4'));var db=require(_0xce42('0x5'))['db'];var logger=require(_0xce42('0x6'))(_0xce42('0x7'));config[_0xce42('0x8')]=_[_0xce42('0x9')](config[_0xce42('0x8')],{'host':_0xce42('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x4f1088=0x0;var _0xab8d8e=[];return db[_0xce42('0xb')][_0xce42('0xc')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xce42('0xd')](function(_0x49ea97){_0x4f1088=_0x49ea97['chatTimeout'];if(_0x4f1088){return db[_0xce42('0xe')][_0xce42('0xf')]({'raw':!![],'attributes':['id',_0xce42('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xce42('0x11')](_0x49ea97[_0xce42('0x12')],'minutes')}}});}else{return[];}})['then'](function(_0x5192ff){if(_0x5192ff&&_0x5192ff['length']){_0xab8d8e=_[_0xce42('0x13')](_0x5192ff||[],'id');logger[_0xce42('0x14')](_0xce42('0x15'),_0xab8d8e['join']());return db['ChatInteraction'][_0xce42('0x16')]({'closeReason':_0xce42('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xce42('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xab8d8e}});}})['then'](function(){if(_0xab8d8e&&_0xab8d8e[_0xce42('0x19')]){logger[_0xce42('0x14')](_0xce42('0x1a'),_0xab8d8e['join']());for(var _0x337799=0x0;_0x337799<_0xab8d8e[_0xce42('0x19')];_0x337799++){io['emit']('chatInteraction:update',{'id':_0xab8d8e[_0x337799],'closed':!![]});}}})['catch'](function(_0x2e4852){logger[_0xce42('0x1b')](_0xce42('0x1c'),_0x2e4852?util['inspect'](_0x2e4852,{'showHidden':![],'depth':null}):'');});}exports[_0xce42('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x891b=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1e840f,_0x6e0f61){var _0x4cb0c6=function(_0x20834e){while(--_0x20834e){_0x1e840f['push'](_0x1e840f['shift']());}};_0x4cb0c6(++_0x6e0f61);}(_0x891b,0x8b));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb891('0x0'));var moment=require('moment');var Redis=require(_0xb891('0x1'));var util=require(_0xb891('0x2'));var config=require(_0xb891('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xb891('0x4'))(_0xb891('0x5'));config[_0xb891('0x6')]=_[_0xb891('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb891('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x1ec6e0=0x0;var _0x5aa4d2=[];return db[_0xb891('0x9')][_0xb891('0xa')]({'raw':!![],'attributes':['id',_0xb891('0xb')],'where':{'id':0x1}})[_0xb891('0xc')](function(_0x241355){_0x1ec6e0=_0x241355[_0xb891('0xb')];if(_0x1ec6e0){return db[_0xb891('0xd')][_0xb891('0xe')]({'raw':!![],'attributes':['id',_0xb891('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb891('0x10')](_0x241355[_0xb891('0xb')],_0xb891('0x11'))}}});}else{return[];}})['then'](function(_0x2b4aaa){if(_0x2b4aaa&&_0x2b4aaa[_0xb891('0x12')]){_0x5aa4d2=_[_0xb891('0x13')](_0x2b4aaa||[],'id');logger[_0xb891('0x14')]('[CHAT]\x20Interactions\x20to\x20close:',_0x5aa4d2[_0xb891('0x15')]());return db[_0xb891('0xd')][_0xb891('0x16')]({'closeReason':_0xb891('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xb891('0x18')](_0xb891('0x19'))},{'where':{'id':_0x5aa4d2}});}})[_0xb891('0xc')](function(){if(_0x5aa4d2&&_0x5aa4d2['length']){logger[_0xb891('0x14')](_0xb891('0x1a'),_0x5aa4d2[_0xb891('0x15')]());for(var _0x178773=0x0;_0x178773<_0x5aa4d2[_0xb891('0x12')];_0x178773++){io[_0xb891('0x1b')](_0xb891('0x1c'),{'id':_0x5aa4d2[_0x178773],'closed':!![]});}}})[_0xb891('0x1d')](function(_0x594d92){logger['error'](_0xb891('0x1e'),_0x594d92?util[_0xb891('0x1f')](_0x594d92,{'showHidden':![],'depth':null}):'');});}exports[_0xb891('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 aebbab2..85ef4e5 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 _0x3318=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x6b885d,_0x32b712){var _0xa79168=function(_0x4670c2){while(--_0x4670c2){_0x6b885d['push'](_0x6b885d['shift']());}};_0xa79168(++_0x32b712);}(_0x3318,0xcc));var _0x8331=function(_0x57a711,_0x419635){_0x57a711=_0x57a711-0x0;var _0x3e4c01=_0x3318[_0x57a711];return _0x3e4c01;};'use strict';function start(){var _0x45b6cc=require(_0x8331('0x0'));return _0x45b6cc[_0x8331('0x1')]();}module[_0x8331('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x2280=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1b664d,_0x1d8695){var _0x43af6b=function(_0x7fe8b2){while(--_0x7fe8b2){_0x1b664d['push'](_0x1b664d['shift']());}};_0x43af6b(++_0x1d8695);}(_0x2280,0xbf));var _0x0228=function(_0x3e69d3,_0x54d7cf){_0x3e69d3=_0x3e69d3-0x0;var _0x39d9dd=_0x2280[_0x3e69d3];return _0x39d9dd;};'use strict';function start(){var _0x59e2e9=require(_0x0228('0x0'));return _0x59e2e9[_0x0228('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index d0ffe96..578026c 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 _0x0c25=['moment','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','stringify','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','keyBy','toString','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','deleteJob','startAt','update\x20cron','run','util','path'];(function(_0x2a3922,_0x225dd2){var _0x3ccc8c=function(_0x3d972a){while(--_0x3d972a){_0x2a3922['push'](_0x2a3922['shift']());}};_0x3ccc8c(++_0x225dd2);}(_0x0c25,0xfd));var _0x50c2=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x0c25[_0x34d346];return _0x122d76;};'use strict';var fs=require('fs');var util=require(_0x50c2('0x0'));var path=require(_0x50c2('0x1'));var _=require('lodash');var moment=require(_0x50c2('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x50c2('0x3'));var logger=require(_0x50c2('0x4'))(_0x50c2('0x5'));var db=require(_0x50c2('0x6'))['db'];var analyticCustomReportController=require(_0x50c2('0x7'));var analyticDefaultReportController=require(_0x50c2('0x8'));var client=jayson['client'][_0x50c2('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2a15d4,_0x1d77e9){return function(){logger['info'](_0x50c2('0xa'),_0x2a15d4[_0x50c2('0xb')]);var _0x5d651d=!![];var _0x7e9cd0=_0x2a15d4[_0x50c2('0xc')][_0x50c2('0xd')]();var _0x4c6074={'account':_0x7e9cd0,'message':{'from':util[_0x50c2('0xe')](_0x50c2('0xf'),_0x2a15d4[_0x50c2('0xc')][_0x50c2('0x10')],_0x2a15d4[_0x50c2('0xc')][_0x50c2('0xb')]||_0x2a15d4[_0x50c2('0xc')]['Smtp']['user']),'to':_0x2a15d4[_0x50c2('0xb')],'cc':_0x2a15d4['cc'],'bcc':_0x2a15d4['bcc'],'subject':util['format'](_0x50c2('0x11'),_0x1d77e9[_0x50c2('0x10')],_0x2a15d4[_0x50c2('0x12')],_0x2a15d4[_0x50c2('0x13')])}};var _0x4bfdee=path[_0x50c2('0x14')](__dirname,_0x50c2('0x15'));var _0x2edd28=_0x1d77e9[_0x50c2('0x16')];var _0x5e2d95=util[_0x50c2('0xe')](_0x50c2('0x17'),path[_0x50c2('0x18')](_0x1d77e9[_0x50c2('0x16')],path[_0x50c2('0x19')](_0x1d77e9[_0x50c2('0x16')])),_0x50c2('0x1a'));var _0x3ba1a0=path[_0x50c2('0x14')](_0x4bfdee,_0x2edd28);var _0x2c169a=path[_0x50c2('0x14')](_0x4bfdee,_0x5e2d95);if(fs[_0x50c2('0x1b')](_0x3ba1a0)){_0x1d77e9[_0x50c2('0x1c')]='Sent';_0x4c6074[_0x50c2('0x1d')][_0x50c2('0x1e')]=[{'filename':_0x2edd28,'path':_0x3ba1a0}];_0x4c6074[_0x50c2('0x1d')][_0x50c2('0x1f')]=util['format'](_0x50c2('0x20'),JSON['stringify'](_0x1d77e9,null,0x2));}else if(fs[_0x50c2('0x1b')](_0x2c169a)){_0x1d77e9[_0x50c2('0x1c')]=_0x50c2('0x21');_0x4c6074[_0x50c2('0x1d')][_0x50c2('0x1e')]=[{'filename':_0x5e2d95,'path':_0x2c169a}];}else{_0x4c6074[_0x50c2('0x1d')][_0x50c2('0x1f')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2a15d4[_0x50c2('0x22')]){_0x5d651d=![];logger[_0x50c2('0x23')](_0x50c2('0x24'));}}if(_0x5d651d){return client[_0x50c2('0x25')](_0x50c2('0x26'),_0x4c6074)['then'](function(_0x40a637){if(_0x40a637[_0x50c2('0x27')]){return logger['error'](_0x50c2('0x28'),JSON['stringify'](_0x40a637));}return logger['info'](_0x50c2('0x29'));})[_0x50c2('0x2a')](function(_0x2e9c49){return logger[_0x50c2('0x27')]('error\x20mail',JSON[_0x50c2('0x2b')](_0x2e9c49));});}};}function handleError(){return function(_0x56948){return logger[_0x50c2('0x27')](JSON['stringify'](_0x56948));};}function handleResult(_0x9aac3){return function(_0x1567ea){logger[_0x50c2('0x23')]('data',JSON[_0x50c2('0x2b')](_0x1567ea));if(_0x9aac3[_0x50c2('0xc')]&&_0x9aac3[_0x50c2('0xc')][_0x50c2('0x2c')]&&!_[_0x50c2('0x2d')](_0x9aac3[_0x50c2('0xb')])){setTimeout(handleSendEmail(_0x9aac3,_0x1567ea),0x3c*0x3e8);}};}function handleJob(_0x48a755){return function(){try{if(_['isNil'](_0x48a755[_0x50c2('0x12')])){return logger[_0x50c2('0x23')](_0x50c2('0x2e'));}if(_[_0x50c2('0x2d')](_0x48a755[_0x50c2('0x13')])){return logger[_0x50c2('0x23')]('subtractUnit\x20null\x20or\x20undefined');}var _0x32bc92={'startDate':moment()['subtract'](_0x48a755[_0x50c2('0x12')],_0x48a755[_0x50c2('0x13')])[_0x50c2('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x50c2('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x50c2('0x2f'),'output':_0x48a755[_0x50c2('0x30')],'name':_0x48a755[_0x50c2('0x10')]};if(!_[_0x50c2('0x2d')](_0x48a755[_0x50c2('0x31')])){logger[_0x50c2('0x23')](_0x50c2('0x32'),_0x48a755['DefaultReportId']);return analyticDefaultReportController[_0x50c2('0x33')]({'id':_0x48a755[_0x50c2('0x31')]},_0x32bc92)[_0x50c2('0x34')](handleResult(_0x48a755))[_0x50c2('0x2a')](handleError());}if(!_[_0x50c2('0x2d')](_0x48a755[_0x50c2('0x35')])){logger[_0x50c2('0x23')](_0x50c2('0x36'),_0x48a755[_0x50c2('0x35')]);return analyticCustomReportController[_0x50c2('0x33')]({'id':_0x48a755[_0x50c2('0x35')]},_0x32bc92)['then'](handleResult(_0x48a755))[_0x50c2('0x2a')](handleError());}}catch(_0x2912aa){logger[_0x50c2('0x27')](JSON['stringify'](_0x2912aa));}return logger[_0x50c2('0x23')](_0x50c2('0x37'));};}function getJobs(_0x5a774d){var _0x1024cc={};if(_0x5a774d){_0x1024cc['id']=_0x5a774d;}return db[_0x50c2('0x38')][_0x50c2('0x39')]({'where':_0x1024cc,'include':[{'model':db[_0x50c2('0xc')],'attributes':['id','name',_0x50c2('0xb')],'include':[{'model':db[_0x50c2('0x3a')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x50c2('0x3b')}]}]}]})[_0x50c2('0x34')](function(_0x260c02){var _0x590b6e=_[_0x50c2('0x3c')](manager[_0x50c2('0x3d')]);var _0x2adbe6=_['map'](_0x260c02,function(_0x30fd27){return _0x30fd27['id']['toString']();});var _0x2fc18c=_[_0x50c2('0x3e')](_0x260c02,function(_0x22d750){return _0x22d750['id'][_0x50c2('0x3f')]();});var _0x30c9b1=_0x5a774d?_0x2adbe6:_[_0x50c2('0x40')](_0x2adbe6,_0x590b6e);var _0x1b19dd=_[_0x50c2('0x41')](_0x2adbe6,_0x590b6e);var _0x4f8477=_[_0x50c2('0x40')](_0x590b6e,_0x2adbe6);var _0x39c909;var _0x43ff32;for(_0x39c909=0x0;_0x39c909<_0x4f8477[_0x50c2('0x42')]&&!_0x5a774d;_0x39c909+=0x1){_0x43ff32=_0x4f8477[_0x39c909][_0x50c2('0x3f')]();if(manager[_0x50c2('0x43')](_0x43ff32)){manager[_0x50c2('0x44')](_0x43ff32);manager['deleteJob'](_0x43ff32);logger['info'](_0x50c2('0x45'),_0x43ff32);}}logger[_0x50c2('0x23')](_0x50c2('0x46'),JSON['stringify'](_0x30c9b1));for(_0x39c909=0x0;_0x39c909<_0x30c9b1[_0x50c2('0x42')];_0x39c909+=0x1){_0x43ff32=_0x30c9b1[_0x39c909][_0x50c2('0x3f')]();logger[_0x50c2('0x23')](_0x50c2('0x47'),_0x43ff32);if(_0x5a774d){logger['info']('my\x20id',_0x5a774d);logger[_0x50c2('0x23')](JSON[_0x50c2('0x2b')](_0x2fc18c[_0x43ff32]));BPromise[_0x50c2('0x48')]()['then'](handleJob(_0x2fc18c[_0x43ff32]));logger[_0x50c2('0x23')](_0x50c2('0x49'),_0x2fc18c[_0x43ff32][_0x50c2('0x10')],_0x2fc18c[_0x43ff32][_0x50c2('0x4a')]);}else if(_0x2fc18c[_0x43ff32][_0x50c2('0x4a')]&&_0x2fc18c[_0x43ff32][_0x50c2('0x4b')]&&moment()[_0x50c2('0x4c')](_0x2fc18c[_0x43ff32]['startAt'],_0x2fc18c[_0x43ff32][_0x50c2('0x4d')])){manager[_0x50c2('0x4e')](_0x43ff32,_0x2fc18c[_0x43ff32][_0x50c2('0x4a')],handleJob(_0x2fc18c[_0x43ff32]));manager[_0x50c2('0x4f')](_0x43ff32);logger[_0x50c2('0x23')](_0x50c2('0x50'),_0x2fc18c[_0x43ff32][_0x50c2('0x10')],_0x2fc18c[_0x43ff32][_0x50c2('0x4a')]);}else if(manager[_0x50c2('0x43')](_0x43ff32)){manager[_0x50c2('0x44')](_0x43ff32);manager[_0x50c2('0x51')](_0x43ff32);logger[_0x50c2('0x23')]('stop\x20cron',_0x2fc18c[_0x43ff32][_0x50c2('0x10')],_0x2fc18c[_0x43ff32][_0x50c2('0x4a')]);}}for(_0x39c909=0x0,_0x43ff32;_0x39c909<_0x1b19dd[_0x50c2('0x42')]&&!_0x5a774d;_0x39c909+=0x1){_0x43ff32=_0x1b19dd[_0x39c909][_0x50c2('0x3f')]();if(manager[_0x50c2('0x43')](_0x43ff32)){if(_0x2fc18c[_0x43ff32][_0x50c2('0x4a')]&&_0x2fc18c[_0x43ff32]['active']&&moment()['isBetween'](_0x2fc18c[_0x43ff32][_0x50c2('0x52')],_0x2fc18c[_0x43ff32][_0x50c2('0x4d')])){manager['update'](_0x43ff32,_0x2fc18c[_0x43ff32][_0x50c2('0x4a')],handleJob(_0x2fc18c[_0x43ff32]));logger[_0x50c2('0x23')](_0x50c2('0x53'),_0x2fc18c[_0x43ff32]['name'],_0x2fc18c[_0x43ff32][_0x50c2('0x4a')]);}else{manager[_0x50c2('0x44')](_0x43ff32);manager[_0x50c2('0x51')](_0x43ff32);logger['info']('stop\x20cron',_0x2fc18c[_0x43ff32]['name'],_0x2fc18c[_0x43ff32][_0x50c2('0x4a')]);}}}})[_0x50c2('0x2a')](function(_0xe7ad5e){logger[_0x50c2('0x27')](JSON[_0x50c2('0x2b')](_0xe7ad5e));});}exports[_0x50c2('0x54')]=function(_0x428450){return getJobs(_0x428450);};exports[_0x50c2('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x7e87=['%s.%s','basename','savename','zip','existsSync','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','add','add\x20cron','stop\x20cron','update','run','start','util','lodash','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x7e87,0x132));var _0x77e8=function(_0x3230ed,_0x4af912){_0x3230ed=_0x3230ed-0x0;var _0x5e355d=_0x7e87[_0x3230ed];return _0x5e355d;};'use strict';var fs=require('fs');var util=require(_0x77e8('0x0'));var path=require('path');var _=require(_0x77e8('0x1'));var moment=require('moment');var CronJobManager=require(_0x77e8('0x2'));var jayson=require(_0x77e8('0x3'));var BPromise=require('bluebird');var logger=require(_0x77e8('0x4'))('schedule');var db=require(_0x77e8('0x5'))['db'];var analyticCustomReportController=require(_0x77e8('0x6'));var analyticDefaultReportController=require(_0x77e8('0x7'));var client=jayson[_0x77e8('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2ae070,_0x289888){return function(){logger['info'](_0x77e8('0x9'),_0x2ae070[_0x77e8('0xa')]);var _0x319367=!![];var _0x40d01a=_0x2ae070[_0x77e8('0xb')][_0x77e8('0xc')]();var _0x1e6a1c={'account':_0x40d01a,'message':{'from':util[_0x77e8('0xd')](_0x77e8('0xe'),_0x2ae070[_0x77e8('0xb')]['name'],_0x2ae070[_0x77e8('0xb')]['email']||_0x2ae070[_0x77e8('0xb')][_0x77e8('0xf')]['user']),'to':_0x2ae070[_0x77e8('0xa')],'cc':_0x2ae070['cc'],'bcc':_0x2ae070['bcc'],'subject':util['format'](_0x77e8('0x10'),_0x289888[_0x77e8('0x11')],_0x2ae070[_0x77e8('0x12')],_0x2ae070[_0x77e8('0x13')])}};var _0x1d5b4c=path[_0x77e8('0x14')](__dirname,_0x77e8('0x15'));var _0x3c9b35=_0x289888['savename'];var _0x4553ae=util[_0x77e8('0xd')](_0x77e8('0x16'),path[_0x77e8('0x17')](_0x289888[_0x77e8('0x18')],path['extname'](_0x289888['savename'])),_0x77e8('0x19'));var _0xd92579=path['join'](_0x1d5b4c,_0x3c9b35);var _0x3080c1=path['join'](_0x1d5b4c,_0x4553ae);if(fs[_0x77e8('0x1a')](_0xd92579)){_0x289888['status']='Sent';_0x1e6a1c[_0x77e8('0x1b')][_0x77e8('0x1c')]=[{'filename':_0x3c9b35,'path':_0xd92579}];_0x1e6a1c[_0x77e8('0x1b')][_0x77e8('0x1d')]=util[_0x77e8('0xd')](_0x77e8('0x1e'),JSON[_0x77e8('0x1f')](_0x289888,null,0x2));}else if(fs['existsSync'](_0x3080c1)){_0x289888[_0x77e8('0x20')]=_0x77e8('0x21');_0x1e6a1c['message'][_0x77e8('0x1c')]=[{'filename':_0x4553ae,'path':_0x3080c1}];}else{_0x1e6a1c[_0x77e8('0x1b')]['text']=_0x77e8('0x22');if(!_0x2ae070[_0x77e8('0x23')]){_0x319367=![];logger[_0x77e8('0x24')](_0x77e8('0x25'));}}if(_0x319367){return client['request'](_0x77e8('0x26'),_0x1e6a1c)[_0x77e8('0x27')](function(_0x5cc496){if(_0x5cc496[_0x77e8('0x28')]){return logger['error'](_0x77e8('0x29'),JSON['stringify'](_0x5cc496));}return logger[_0x77e8('0x24')]('email\x20sent');})[_0x77e8('0x2a')](function(_0x216f8f){return logger[_0x77e8('0x28')](_0x77e8('0x29'),JSON[_0x77e8('0x1f')](_0x216f8f));});}};}function handleError(){return function(_0x20492d){return logger['error'](JSON[_0x77e8('0x1f')](_0x20492d));};}function handleResult(_0xfcaf9d){return function(_0x38509c){logger[_0x77e8('0x24')](_0x77e8('0x2b'),JSON['stringify'](_0x38509c));if(_0xfcaf9d['MailAccount']&&_0xfcaf9d['MailAccount']['Smtp']&&!_[_0x77e8('0x2c')](_0xfcaf9d['email'])){setTimeout(handleSendEmail(_0xfcaf9d,_0x38509c),0x3c*0x3e8);}};}function handleJob(_0x5b681d){return function(){try{if(_[_0x77e8('0x2c')](_0x5b681d[_0x77e8('0x12')])){return logger[_0x77e8('0x24')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x77e8('0x2c')](_0x5b681d[_0x77e8('0x13')])){return logger['info'](_0x77e8('0x2d'));}var _0x476793={'startDate':moment()['subtract'](_0x5b681d[_0x77e8('0x12')],_0x5b681d[_0x77e8('0x13')])[_0x77e8('0xd')](_0x77e8('0x2e')),'endDate':moment()[_0x77e8('0xd')](_0x77e8('0x2e')),'type':_0x77e8('0x2f'),'output':_0x5b681d['output'],'name':_0x5b681d[_0x77e8('0x11')]};if(!_[_0x77e8('0x2c')](_0x5b681d[_0x77e8('0x30')])){logger[_0x77e8('0x24')]('exec\x20defaul\x20report\x20id:%s',_0x5b681d[_0x77e8('0x30')]);return analyticDefaultReportController[_0x77e8('0x31')]({'id':_0x5b681d[_0x77e8('0x30')]},_0x476793)[_0x77e8('0x27')](handleResult(_0x5b681d))['catch'](handleError());}if(!_['isNil'](_0x5b681d['CustomReportId'])){logger[_0x77e8('0x24')](_0x77e8('0x32'),_0x5b681d[_0x77e8('0x33')]);return analyticCustomReportController[_0x77e8('0x31')]({'id':_0x5b681d['CustomReportId']},_0x476793)[_0x77e8('0x27')](handleResult(_0x5b681d))[_0x77e8('0x2a')](handleError());}}catch(_0x43e2ae){logger[_0x77e8('0x28')](JSON['stringify'](_0x43e2ae));}return logger[_0x77e8('0x24')](_0x77e8('0x34'));};}function getJobs(_0x3f07bf){var _0x383c16={};if(_0x3f07bf){_0x383c16['id']=_0x3f07bf;}return db[_0x77e8('0x35')][_0x77e8('0x36')]({'where':_0x383c16,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x77e8('0xa')],'include':[{'model':db[_0x77e8('0x37')],'as':_0x77e8('0xf'),'include':[{'model':db[_0x77e8('0x38')],'as':'CloudProvider'}]}]}]})['then'](function(_0x2f456c){var _0x538c1b=_[_0x77e8('0x39')](manager[_0x77e8('0x3a')]);var _0x2a71f2=_[_0x77e8('0x3b')](_0x2f456c,function(_0x38b1c6){return _0x38b1c6['id'][_0x77e8('0x3c')]();});var _0xe9a3c5=_['keyBy'](_0x2f456c,function(_0x5da874){return _0x5da874['id'][_0x77e8('0x3c')]();});var _0x1279d1=_0x3f07bf?_0x2a71f2:_[_0x77e8('0x3d')](_0x2a71f2,_0x538c1b);var _0x5a0399=_[_0x77e8('0x3e')](_0x2a71f2,_0x538c1b);var _0xb0585e=_[_0x77e8('0x3d')](_0x538c1b,_0x2a71f2);var _0x4af47f;var _0x68aed7;for(_0x4af47f=0x0;_0x4af47f<_0xb0585e[_0x77e8('0x3f')]&&!_0x3f07bf;_0x4af47f+=0x1){_0x68aed7=_0xb0585e[_0x4af47f][_0x77e8('0x3c')]();if(manager[_0x77e8('0x40')](_0x68aed7)){manager[_0x77e8('0x41')](_0x68aed7);manager[_0x77e8('0x42')](_0x68aed7);logger[_0x77e8('0x24')](_0x77e8('0x43'),_0x68aed7);}}logger[_0x77e8('0x24')](_0x77e8('0x44'),JSON[_0x77e8('0x1f')](_0x1279d1));for(_0x4af47f=0x0;_0x4af47f<_0x1279d1[_0x77e8('0x3f')];_0x4af47f+=0x1){_0x68aed7=_0x1279d1[_0x4af47f][_0x77e8('0x3c')]();logger[_0x77e8('0x24')]('index',_0x68aed7);if(_0x3f07bf){logger[_0x77e8('0x24')](_0x77e8('0x45'),_0x3f07bf);logger[_0x77e8('0x24')](JSON['stringify'](_0xe9a3c5[_0x68aed7]));BPromise[_0x77e8('0x46')]()[_0x77e8('0x27')](handleJob(_0xe9a3c5[_0x68aed7]));logger[_0x77e8('0x24')](_0x77e8('0x47'),_0xe9a3c5[_0x68aed7]['name'],_0xe9a3c5[_0x68aed7][_0x77e8('0x48')]);}else if(_0xe9a3c5[_0x68aed7][_0x77e8('0x48')]&&_0xe9a3c5[_0x68aed7][_0x77e8('0x49')]&&moment()[_0x77e8('0x4a')](_0xe9a3c5[_0x68aed7]['startAt'],_0xe9a3c5[_0x68aed7][_0x77e8('0x4b')])){manager[_0x77e8('0x4c')](_0x68aed7,_0xe9a3c5[_0x68aed7][_0x77e8('0x48')],handleJob(_0xe9a3c5[_0x68aed7]));manager['start'](_0x68aed7);logger[_0x77e8('0x24')](_0x77e8('0x4d'),_0xe9a3c5[_0x68aed7][_0x77e8('0x11')],_0xe9a3c5[_0x68aed7][_0x77e8('0x48')]);}else if(manager[_0x77e8('0x40')](_0x68aed7)){manager[_0x77e8('0x41')](_0x68aed7);manager['deleteJob'](_0x68aed7);logger[_0x77e8('0x24')](_0x77e8('0x4e'),_0xe9a3c5[_0x68aed7]['name'],_0xe9a3c5[_0x68aed7]['cron']);}}for(_0x4af47f=0x0,_0x68aed7;_0x4af47f<_0x5a0399[_0x77e8('0x3f')]&&!_0x3f07bf;_0x4af47f+=0x1){_0x68aed7=_0x5a0399[_0x4af47f][_0x77e8('0x3c')]();if(manager['exists'](_0x68aed7)){if(_0xe9a3c5[_0x68aed7][_0x77e8('0x48')]&&_0xe9a3c5[_0x68aed7][_0x77e8('0x49')]&&moment()[_0x77e8('0x4a')](_0xe9a3c5[_0x68aed7]['startAt'],_0xe9a3c5[_0x68aed7][_0x77e8('0x4b')])){manager[_0x77e8('0x4f')](_0x68aed7,_0xe9a3c5[_0x68aed7]['cron'],handleJob(_0xe9a3c5[_0x68aed7]));logger['info']('update\x20cron',_0xe9a3c5[_0x68aed7]['name'],_0xe9a3c5[_0x68aed7][_0x77e8('0x48')]);}else{manager[_0x77e8('0x41')](_0x68aed7);manager[_0x77e8('0x42')](_0x68aed7);logger[_0x77e8('0x24')](_0x77e8('0x4e'),_0xe9a3c5[_0x68aed7][_0x77e8('0x11')],_0xe9a3c5[_0x68aed7][_0x77e8('0x48')]);}}}})[_0x77e8('0x2a')](function(_0x3a8d3f){logger[_0x77e8('0x28')](JSON['stringify'](_0x3a8d3f));});}exports[_0x77e8('0x50')]=function(_0x124185){return getJobs(_0x124185);};exports[_0x77e8('0x51')]=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 8e0573b..462f87a 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 _0xf682=['Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Positive','Negative','catch','name','SequelizeValidationError','error','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Cloud\x20Provider\x20not\x20configured','forEach','push','lodash','aws-sdk','request-promise','util','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError'];(function(_0x1bcb2c,_0xf85d2a){var _0x843eab=function(_0x4ec292){while(--_0x4ec292){_0x1bcb2c['push'](_0x1bcb2c['shift']());}};_0x843eab(++_0xf85d2a);}(_0xf682,0x12f));var _0x2f68=function(_0x5d6abd,_0x165b60){_0x5d6abd=_0x5d6abd-0x0;var _0x171601=_0xf682[_0x5d6abd];return _0x171601;};var _=require(_0x2f68('0x0'));var AWS=require(_0x2f68('0x1'));var rp=require(_0x2f68('0x2'));var util=require(_0x2f68('0x3'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x2f68('0x4'))(_0x2f68('0x5'));function getTranscriptionJob(_0x1703e0,_0x39c412,_0x4a1466,_0x382bd8){return new Promise(function(_0x46dd32,_0x6f92f6){var _0x3c4e31=new AWS['TranscribeService']({'accessKeyId':_0x39c412,'secretAccessKey':_0x1703e0,'region':_0x4a1466});_0x3c4e31[_0x2f68('0x6')]({'TranscriptionJobName':_0x382bd8},function(_0x3a4dad,_0x56d93c){if(_0x3a4dad){return _0x6f92f6(_0x3a4dad);}else{return _0x46dd32(_0x56d93c);}});});}function sentiment(_0x4bc53b,_0x5e38b5,_0x57a6b0,_0x15845e,_0x3ed3d7){return new Promise(function(_0x3cb657,_0x342d06){var _0x229525=new AWS[(_0x2f68('0x7'))]({'accessKeyId':_0x5e38b5,'secretAccessKey':_0x4bc53b,'region':_0x57a6b0});_0x229525[_0x2f68('0x8')]({'Text':_0x15845e,'LanguageCode':_0x3ed3d7[_0x2f68('0x9')](0x0,0x2)},function(_0x1b91c0,_0x10186d){if(_0x1b91c0){return _0x342d06(_0x1b91c0);}else{return _0x3cb657(_0x10186d);}});});}function checkTranscribeJob(_0x375ac8,_0xe71dbe,_0x2d9b69){var _0x308cc9;return new BPromise(function(_0x4632ba,_0x9651ac){logger['info'](util[_0x2f68('0xa')](_0x2f68('0xb'),_0x375ac8['id'],_0x375ac8[_0x2f68('0xc')]));return getTranscriptionJob(_0x2d9b69[_0x2f68('0xd')],_0x2d9b69[_0x2f68('0xe')],_0xe71dbe[_0x2f68('0xf')],_0x375ac8[_0x2f68('0xc')])[_0x2f68('0x10')](function(_0x4e4a11){logger[_0x2f68('0x11')](util[_0x2f68('0xa')](_0x2f68('0x12'),_0x375ac8['id'],_0x375ac8['transcribeName'],_0x4e4a11[_0x2f68('0x13')]['TranscriptionJobStatus']));if(!_0x375ac8[_0x2f68('0x14')]){switch(_0x4e4a11['TranscriptionJob'][_0x2f68('0x15')]){case _0x2f68('0x16'):var _0x1e6118={'transcribeStatus':_0x4e4a11[_0x2f68('0x13')][_0x2f68('0x15')],'fileUri':_0x4e4a11['TranscriptionJob'][_0x2f68('0x17')][_0x2f68('0x18')]};logger[_0x2f68('0x11')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x375ac8['id']));return rp({'uri':_0x4e4a11[_0x2f68('0x13')][_0x2f68('0x17')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x3141b4){logger['info'](util[_0x2f68('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x375ac8['id']));if(_0x3141b4&&_0x3141b4[_0x2f68('0x19')]&&_0x3141b4[_0x2f68('0x19')][_0x2f68('0x1a')]&&_0x3141b4[_0x2f68('0x19')][_0x2f68('0x1a')][_0x2f68('0x1b')]){_0x1e6118['fileText']='';for(var _0x5cc4f2=0x0;_0x5cc4f2<_0x3141b4[_0x2f68('0x19')][_0x2f68('0x1a')]['length'];_0x5cc4f2++){_0x1e6118['fileText']+=_0x3141b4[_0x2f68('0x19')]['transcripts'][_0x5cc4f2][_0x2f68('0x1c')]+'';}}return _0x375ac8['update'](_0x1e6118);})[_0x2f68('0x10')](function(){logger[_0x2f68('0x11')](util[_0x2f68('0xa')](_0x2f68('0x1d'),_0x375ac8['id']));if(!_0x375ac8['tempSentiment']){throw new db[(_0x2f68('0x1e'))][(_0x2f68('0x1f'))](_0x2f68('0x20'));}if(!_0xe71dbe[_0x2f68('0x21')]||!_0xe71dbe[_0x2f68('0x22')]||!_0xe71dbe[_0x2f68('0x23')]||!_0xe71dbe[_0x2f68('0x24')]||!_0xe71dbe[_0x2f68('0x25')]){throw new db[(_0x2f68('0x1e'))][(_0x2f68('0x1f'))](_0x2f68('0x26'));}if(!_0x1e6118[_0x2f68('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0xe71dbe['sentimentAccountId']===_0x2d9b69['id']){return _0x2d9b69;}else{return db[_0x2f68('0x27')]['findOne']({'where':{'id':_settings[_0x2f68('0x22')]}});}})[_0x2f68('0x10')](function(_0x3dd3c5){if(!_0x3dd3c5){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3dd3c5[_0x2f68('0xd')]||!_0x3dd3c5[_0x2f68('0xe')]){throw new db['Sequelize'][(_0x2f68('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x308cc9=_0x3dd3c5;logger[_0x2f68('0x11')](util['format'](_0x2f68('0x28'),_0x375ac8['id']));return sentiment(_0x308cc9['data1'],_0x308cc9['data2'],_0xe71dbe[_0x2f68('0x23')],_0x1e6118[_0x2f68('0x14')],_0xe71dbe[_0x2f68('0x24')]);})[_0x2f68('0x10')](function(_0x1338f5){logger[_0x2f68('0x11')](util[_0x2f68('0xa')](_0x2f68('0x29'),_0x375ac8['id']));return _0x375ac8['update']({'sentiment':_0x1338f5[_0x2f68('0x2a')],'sPositive':_0x1338f5[_0x2f68('0x2b')]['Positive'],'sNegative':_0x1338f5[_0x2f68('0x2b')]['Negative'],'sMixed':_0x1338f5[_0x2f68('0x2b')][_0x2f68('0x2c')],'sNeutral':_0x1338f5[_0x2f68('0x2b')][_0x2f68('0x2d')]});})[_0x2f68('0x10')](function(){logger[_0x2f68('0x11')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x375ac8['id']));_0x4632ba();});case _0x2f68('0x2e'):return _0x375ac8['update']({'transcribeStatus':_0x2f68('0x2e'),'failureReason':_0x4e4a11[_0x2f68('0x13')]['FailureReason']})[_0x2f68('0x10')](function(){logger[_0x2f68('0x11')](util[_0x2f68('0xa')](_0x2f68('0x1d'),_0x375ac8['id']));_0x4632ba();});default:logger['info'](util[_0x2f68('0xa')](_0x2f68('0x2f'),_0x375ac8['id']));break;}}else{return BPromise[_0x2f68('0x30')]()[_0x2f68('0x10')](function(){if(!_0x375ac8[_0x2f68('0x31')]){throw new db[(_0x2f68('0x1e'))]['ValidationError'](_0x2f68('0x20'));}if(!_0xe71dbe[_0x2f68('0x21')]||!_0xe71dbe[_0x2f68('0x22')]||!_0xe71dbe[_0x2f68('0x23')]||!_0xe71dbe[_0x2f68('0x24')]||!_0xe71dbe[_0x2f68('0x25')]){throw new db[(_0x2f68('0x1e'))][(_0x2f68('0x1f'))](_0x2f68('0x26'));}if(!_0x375ac8[_0x2f68('0x14')]){throw new Error(_0x2f68('0x32'));}if(_0xe71dbe[_0x2f68('0x22')]===_0x2d9b69['id']){return _0x2d9b69;}else{return db['CloudProvider'][_0x2f68('0x33')]({'where':{'id':_settings[_0x2f68('0x22')]}});}})[_0x2f68('0x10')](function(_0x1c10f0){if(!_0x1c10f0){throw new db['Sequelize'][(_0x2f68('0x1f'))](_0x2f68('0x34'));}if(!_0x1c10f0[_0x2f68('0xd')]||!_0x1c10f0[_0x2f68('0xe')]){throw new db[(_0x2f68('0x1e'))][(_0x2f68('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x308cc9=_0x1c10f0;logger[_0x2f68('0x11')](util[_0x2f68('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x375ac8['id']));return sentiment(_0x308cc9[_0x2f68('0xd')],_0x308cc9[_0x2f68('0xe')],_0xe71dbe[_0x2f68('0x23')],_0x375ac8['fileText'],_0xe71dbe[_0x2f68('0x24')]);})[_0x2f68('0x10')](function(_0x1075a1){logger[_0x2f68('0x11')](util['format'](_0x2f68('0x29'),_0x375ac8['id']));return _0x375ac8['update']({'sentiment':_0x1075a1[_0x2f68('0x2a')],'sPositive':_0x1075a1[_0x2f68('0x2b')][_0x2f68('0x35')],'sNegative':_0x1075a1[_0x2f68('0x2b')][_0x2f68('0x36')],'sMixed':_0x1075a1[_0x2f68('0x2b')][_0x2f68('0x2c')],'sNeutral':_0x1075a1['SentimentScore'][_0x2f68('0x2d')],'transcribeStatus':_0x2f68('0x16')});})[_0x2f68('0x10')](function(){logger[_0x2f68('0x11')](util[_0x2f68('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x375ac8['id']));_0x4632ba();});}})[_0x2f68('0x37')](function(_0x38ce23){if(_0x38ce23){if(!_0x38ce23[_0x2f68('0x38')]||_0x38ce23['name']!==_0x2f68('0x39')){logger[_0x2f68('0x3a')](util[_0x2f68('0xa')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x375ac8['id']),util['inspect'](_0x38ce23,{'showHidden':![],'depth':null}));}}_0x4632ba();});});}function checkTranscribe(){var _0x4a7247;var _0xe1b091;var _0x579fe7;return db[_0x2f68('0x3b')][_0x2f68('0x3c')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x2f68('0x10')](function(_0x31999d){if(!_0x31999d||!_0x31999d[_0x2f68('0x1b')]){throw new db[(_0x2f68('0x1e'))][(_0x2f68('0x1f'))](_0x2f68('0x3d'));}_0x4a7247=_0x31999d;return db[_0x2f68('0x3e')][_0x2f68('0x33')]({'where':{'id':0x1}});})[_0x2f68('0x10')](function(_0x4d1afc){if(!_0x4d1afc){throw new db[(_0x2f68('0x1e'))][(_0x2f68('0x1f'))]('Settings\x20not\x20available');}_0xe1b091=_0x4d1afc;if(!_0xe1b091[_0x2f68('0x5')]||!_0xe1b091[_0x2f68('0x3f')]||!_0xe1b091[_0x2f68('0xf')]||!_0xe1b091[_0x2f68('0x24')]||!_0xe1b091[_0x2f68('0x25')]){throw new db[(_0x2f68('0x1e'))][(_0x2f68('0x1f'))]('Transcribe\x20not\x20configured');}return db[_0x2f68('0x27')][_0x2f68('0x33')]({'where':{'id':_0xe1b091[_0x2f68('0x3f')]}});})[_0x2f68('0x10')](function(_0x21ac8e){if(!_0x21ac8e){throw new db['Sequelize'][(_0x2f68('0x1f'))](_0x2f68('0x34'));}if(!_0x21ac8e[_0x2f68('0xd')]||!_0x21ac8e[_0x2f68('0xe')]){throw new db['Sequelize'][(_0x2f68('0x1f'))](_0x2f68('0x40'));}_0x579fe7=_0x21ac8e;var _0x937f4e=[];_0x4a7247[_0x2f68('0x41')](function(_0x322f10){_0x937f4e[_0x2f68('0x42')](checkTranscribeJob(_0x322f10,_0xe1b091,_0x579fe7));});return BPromise['all'](_0x937f4e);})['catch'](function(_0x3c8c7e){if(_0x3c8c7e){if(!_0x3c8c7e[_0x2f68('0x38')]||_0x3c8c7e[_0x2f68('0x38')]!==_0x2f68('0x39')){logger['error'](util['inspect'](_0x3c8c7e,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x1f75=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','update','Sentiment','SentimentScore','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','catch','name','SequelizeValidationError','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeRegion','transcribeAccountId','all','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','results','transcripts','length','transcript'];(function(_0x532da4,_0x47d1f4){var _0x1b809a=function(_0x2c6271){while(--_0x2c6271){_0x532da4['push'](_0x532da4['shift']());}};_0x1b809a(++_0x47d1f4);}(_0x1f75,0x13c));var _0x51f7=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x1f75[_0x55e08b];return _0xd1a7ff;};var _=require('lodash');var AWS=require(_0x51f7('0x0'));var rp=require(_0x51f7('0x1'));var util=require(_0x51f7('0x2'));var BPromise=require(_0x51f7('0x3'));var db=require(_0x51f7('0x4'))['db'];var logger=require('../../config/logger')(_0x51f7('0x5'));function getTranscriptionJob(_0x4273aa,_0xb25a20,_0x331fd3,_0x23eea5){return new Promise(function(_0x1fe16a,_0x244646){var _0xb4e621=new AWS[(_0x51f7('0x6'))]({'accessKeyId':_0xb25a20,'secretAccessKey':_0x4273aa,'region':_0x331fd3});_0xb4e621[_0x51f7('0x7')]({'TranscriptionJobName':_0x23eea5},function(_0x20d374,_0x4158a6){if(_0x20d374){return _0x244646(_0x20d374);}else{return _0x1fe16a(_0x4158a6);}});});}function sentiment(_0x4ee384,_0x2fb7ee,_0x450767,_0x4d7014,_0x11e24c){return new Promise(function(_0x3ad08e,_0x4c5629){var _0x4ddeb4=new AWS[(_0x51f7('0x8'))]({'accessKeyId':_0x2fb7ee,'secretAccessKey':_0x4ee384,'region':_0x450767});_0x4ddeb4[_0x51f7('0x9')]({'Text':_0x4d7014,'LanguageCode':_0x11e24c['substring'](0x0,0x2)},function(_0x457791,_0x30190a){if(_0x457791){return _0x4c5629(_0x457791);}else{return _0x3ad08e(_0x30190a);}});});}function checkTranscribeJob(_0x49c0dd,_0x452c6b,_0x180e9d){var _0x11cc37;return new BPromise(function(_0x58919c,_0x546f55){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0xc'),_0x49c0dd['id'],_0x49c0dd[_0x51f7('0xd')]));return getTranscriptionJob(_0x180e9d[_0x51f7('0xe')],_0x180e9d[_0x51f7('0xf')],_0x452c6b['transcribeRegion'],_0x49c0dd[_0x51f7('0xd')])[_0x51f7('0x10')](function(_0x12e09d){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x11'),_0x49c0dd['id'],_0x49c0dd[_0x51f7('0xd')],_0x12e09d['TranscriptionJob'][_0x51f7('0x12')]));if(!_0x49c0dd[_0x51f7('0x13')]){switch(_0x12e09d['TranscriptionJob'][_0x51f7('0x12')]){case _0x51f7('0x14'):var _0x4dfdef={'transcribeStatus':_0x12e09d['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x12e09d[_0x51f7('0x15')]['Transcript']['TranscriptFileUri']};logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x16'),_0x49c0dd['id']));return rp({'uri':_0x12e09d[_0x51f7('0x15')][_0x51f7('0x17')][_0x51f7('0x18')],'json':!![]})[_0x51f7('0x10')](function(_0x22f585){logger['info'](util[_0x51f7('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x49c0dd['id']));if(_0x22f585&&_0x22f585[_0x51f7('0x19')]&&_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')]&&_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')][_0x51f7('0x1b')]){_0x4dfdef[_0x51f7('0x13')]='';for(var _0x1b7282=0x0;_0x1b7282<_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')][_0x51f7('0x1b')];_0x1b7282++){_0x4dfdef['fileText']+=_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')][_0x1b7282][_0x51f7('0x1c')]+'';}}return _0x49c0dd['update'](_0x4dfdef);})[_0x51f7('0x10')](function(){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x1d'),_0x49c0dd['id']));if(!_0x49c0dd['tempSentiment']){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x20'));}if(!_0x452c6b[_0x51f7('0x21')]||!_0x452c6b[_0x51f7('0x22')]||!_0x452c6b['sentimentRegion']||!_0x452c6b[_0x51f7('0x23')]||!_0x452c6b[_0x51f7('0x24')]){throw new db[(_0x51f7('0x1e'))]['ValidationError'](_0x51f7('0x25'));}if(!_0x4dfdef['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x452c6b[_0x51f7('0x22')]===_0x180e9d['id']){return _0x180e9d;}else{return db[_0x51f7('0x26')][_0x51f7('0x27')]({'where':{'id':_settings[_0x51f7('0x22')]}});}})[_0x51f7('0x10')](function(_0x44bca8){if(!_0x44bca8){throw new db[(_0x51f7('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x44bca8[_0x51f7('0xe')]||!_0x44bca8[_0x51f7('0xf')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x28'));}_0x11cc37=_0x44bca8;logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x29'),_0x49c0dd['id']));return sentiment(_0x11cc37[_0x51f7('0xe')],_0x11cc37['data2'],_0x452c6b[_0x51f7('0x2a')],_0x4dfdef['fileText'],_0x452c6b[_0x51f7('0x23')]);})['then'](function(_0x3c1c80){logger['info'](util[_0x51f7('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x49c0dd['id']));return _0x49c0dd[_0x51f7('0x2b')]({'sentiment':_0x3c1c80[_0x51f7('0x2c')],'sPositive':_0x3c1c80[_0x51f7('0x2d')]['Positive'],'sNegative':_0x3c1c80[_0x51f7('0x2d')][_0x51f7('0x2e')],'sMixed':_0x3c1c80['SentimentScore']['Mixed'],'sNeutral':_0x3c1c80['SentimentScore'][_0x51f7('0x2f')]});})[_0x51f7('0x10')](function(){logger[_0x51f7('0xa')](util['format'](_0x51f7('0x1d'),_0x49c0dd['id']));_0x58919c();});case _0x51f7('0x30'):return _0x49c0dd[_0x51f7('0x2b')]({'transcribeStatus':'FAILED','failureReason':_0x12e09d[_0x51f7('0x15')][_0x51f7('0x31')]})[_0x51f7('0x10')](function(){logger['info'](util[_0x51f7('0xb')](_0x51f7('0x1d'),_0x49c0dd['id']));_0x58919c();});default:logger[_0x51f7('0xa')](util['format'](_0x51f7('0x32'),_0x49c0dd['id']));break;}}else{return BPromise[_0x51f7('0x33')]()[_0x51f7('0x10')](function(){if(!_0x49c0dd[_0x51f7('0x34')]){throw new db[(_0x51f7('0x1e'))]['ValidationError'](_0x51f7('0x20'));}if(!_0x452c6b[_0x51f7('0x21')]||!_0x452c6b[_0x51f7('0x22')]||!_0x452c6b[_0x51f7('0x2a')]||!_0x452c6b['language']||!_0x452c6b[_0x51f7('0x24')]){throw new db['Sequelize'][(_0x51f7('0x1f'))](_0x51f7('0x25'));}if(!_0x49c0dd[_0x51f7('0x13')]){throw new Error(_0x51f7('0x35'));}if(_0x452c6b[_0x51f7('0x22')]===_0x180e9d['id']){return _0x180e9d;}else{return db[_0x51f7('0x26')][_0x51f7('0x27')]({'where':{'id':_settings[_0x51f7('0x22')]}});}})[_0x51f7('0x10')](function(_0x3b4139){if(!_0x3b4139){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x36'));}if(!_0x3b4139['data1']||!_0x3b4139['data2']){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x11cc37=_0x3b4139;logger['info'](util[_0x51f7('0xb')](_0x51f7('0x29'),_0x49c0dd['id']));return sentiment(_0x11cc37[_0x51f7('0xe')],_0x11cc37['data2'],_0x452c6b[_0x51f7('0x2a')],_0x49c0dd[_0x51f7('0x13')],_0x452c6b[_0x51f7('0x23')]);})[_0x51f7('0x10')](function(_0x4c2817){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x37'),_0x49c0dd['id']));return _0x49c0dd[_0x51f7('0x2b')]({'sentiment':_0x4c2817[_0x51f7('0x2c')],'sPositive':_0x4c2817[_0x51f7('0x2d')][_0x51f7('0x38')],'sNegative':_0x4c2817[_0x51f7('0x2d')]['Negative'],'sMixed':_0x4c2817[_0x51f7('0x2d')]['Mixed'],'sNeutral':_0x4c2817[_0x51f7('0x2d')][_0x51f7('0x2f')],'transcribeStatus':_0x51f7('0x14')});})[_0x51f7('0x10')](function(){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x1d'),_0x49c0dd['id']));_0x58919c();});}})[_0x51f7('0x39')](function(_0x59d062){if(_0x59d062){if(!_0x59d062[_0x51f7('0x3a')]||_0x59d062['name']!==_0x51f7('0x3b')){logger['error'](util[_0x51f7('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x49c0dd['id']),util[_0x51f7('0x3c')](_0x59d062,{'showHidden':![],'depth':null}));}}_0x58919c();});});}function checkTranscribe(){var _0x97e23b;var _0xed6254;var _0x501cb8;return db['VoiceRecording'][_0x51f7('0x3d')]({'where':{'transcribeStatus':_0x51f7('0x3e')}})[_0x51f7('0x10')](function(_0xb39a71){if(!_0xb39a71||!_0xb39a71[_0x51f7('0x1b')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x3f'));}_0x97e23b=_0xb39a71;return db[_0x51f7('0x40')][_0x51f7('0x27')]({'where':{'id':0x1}});})[_0x51f7('0x10')](function(_0x2ea89d){if(!_0x2ea89d){throw new db['Sequelize'][(_0x51f7('0x1f'))](_0x51f7('0x41'));}_0xed6254=_0x2ea89d;if(!_0xed6254['transcribe']||!_0xed6254['transcribeAccountId']||!_0xed6254[_0x51f7('0x42')]||!_0xed6254['language']||!_0xed6254[_0x51f7('0x24')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))]('Transcribe\x20not\x20configured');}return db[_0x51f7('0x26')]['findOne']({'where':{'id':_0xed6254[_0x51f7('0x43')]}});})[_0x51f7('0x10')](function(_0x1eadbc){if(!_0x1eadbc){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1eadbc[_0x51f7('0xe')]||!_0x1eadbc[_0x51f7('0xf')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x28'));}_0x501cb8=_0x1eadbc;var _0x1310c2=[];_0x97e23b['forEach'](function(_0x27a1c5){_0x1310c2['push'](checkTranscribeJob(_0x27a1c5,_0xed6254,_0x501cb8));});return BPromise[_0x51f7('0x44')](_0x1310c2);})[_0x51f7('0x39')](function(_0x5a6b0b){if(_0x5a6b0b){if(!_0x5a6b0b[_0x51f7('0x3a')]||_0x5a6b0b[_0x51f7('0x3a')]!==_0x51f7('0x3b')){logger['error'](util[_0x51f7('0x3c')](_0x5a6b0b,{'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 6c9d3bb..edbebc7 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 _0x12ed=['subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x12ed,0x1e2));var _0xd12e=function(_0x505ab6,_0x3c25ee){_0x505ab6=_0x505ab6-0x0;var _0x50e283=_0x12ed[_0x505ab6];return _0x50e283;};'use strict';var _=require(_0xd12e('0x0'));var moment=require(_0xd12e('0x1'));var Redis=require('ioredis');var util=require(_0xd12e('0x2'));var config=require(_0xd12e('0x3'));var db=require(_0xd12e('0x4'))['db'];var logger=require(_0xd12e('0x5'))('schedule');config[_0xd12e('0x6')]=_['defaults'](config[_0xd12e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd12e('0x7'))(new Redis(config[_0xd12e('0x6')]));function closeInteractions(){var _0x249b1f=[];return db[_0xd12e('0x8')][_0xd12e('0x9')]({'raw':!![],'attributes':['id',_0xd12e('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd12e('0xb')](0x18,_0xd12e('0xc'))}}})[_0xd12e('0xd')](function(_0x48ad9c){if(_0x48ad9c&&_0x48ad9c[_0xd12e('0xe')]){_0x249b1f=_[_0xd12e('0xf')](_0x48ad9c||[],'id');logger[_0xd12e('0x10')](_0xd12e('0x11'),_0x249b1f['join']());return db[_0xd12e('0x8')][_0xd12e('0x12')]({'closeReason':_0xd12e('0x13'),'disposition':_0xd12e('0x14'),'closed':!![],'closedAt':moment()[_0xd12e('0x15')](_0xd12e('0x16'))},{'where':{'id':_0x249b1f}});}})[_0xd12e('0xd')](function(){if(_0x249b1f&&_0x249b1f[_0xd12e('0xe')]){logger[_0xd12e('0x10')](_0xd12e('0x17'),_0x249b1f[_0xd12e('0x18')]());for(var _0x514c0d=0x0;_0x514c0d<_0x249b1f[_0xd12e('0xe')];_0x514c0d++){io['emit'](_0xd12e('0x19'),{'id':_0x249b1f[_0x514c0d],'closed':!![]});}}})[_0xd12e('0x1a')](function(_0x1d5af5){logger['error'](_0xd12e('0x1b'),_0x1d5af5?util['inspect'](_0x1d5af5,{'showHidden':![],'depth':null}):'');});}exports[_0xd12e('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0c6a=['hours','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../mysqldb','../logger','redis','defaults','findAll','lastMsgAt'];(function(_0x162e74,_0x2d0b3e){var _0x5db37f=function(_0x20ce98){while(--_0x20ce98){_0x162e74['push'](_0x162e74['shift']());}};_0x5db37f(++_0x2d0b3e);}(_0x0c6a,0x157));var _0xa0c6=function(_0x8a8a5,_0x440238){_0x8a8a5=_0x8a8a5-0x0;var _0x2e4ab9=_0x0c6a[_0x8a8a5];return _0x2e4ab9;};'use strict';var _=require('lodash');var moment=require(_0xa0c6('0x0'));var Redis=require('ioredis');var util=require(_0xa0c6('0x1'));var config=require('../../config/environment');var db=require(_0xa0c6('0x2'))['db'];var logger=require(_0xa0c6('0x3'))('schedule');config[_0xa0c6('0x4')]=_[_0xa0c6('0x5')](config[_0xa0c6('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa0c6('0x4')]));function closeInteractions(){var _0x5cd359=[];return db['WhatsappInteraction'][_0xa0c6('0x6')]({'raw':!![],'attributes':['id',_0xa0c6('0x7')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xa0c6('0x8'))}}})['then'](function(_0x1046d4){if(_0x1046d4&&_0x1046d4[_0xa0c6('0x9')]){_0x5cd359=_['map'](_0x1046d4||[],'id');logger[_0xa0c6('0xa')](_0xa0c6('0xb'),_0x5cd359[_0xa0c6('0xc')]());return db[_0xa0c6('0xd')][_0xa0c6('0xe')]({'closeReason':_0xa0c6('0xf'),'disposition':_0xa0c6('0x10'),'closed':!![],'closedAt':moment()[_0xa0c6('0x11')](_0xa0c6('0x12'))},{'where':{'id':_0x5cd359}});}})[_0xa0c6('0x13')](function(){if(_0x5cd359&&_0x5cd359[_0xa0c6('0x9')]){logger[_0xa0c6('0xa')](_0xa0c6('0x14'),_0x5cd359[_0xa0c6('0xc')]());for(var _0x51b8ce=0x0;_0x51b8ce<_0x5cd359['length'];_0x51b8ce++){io[_0xa0c6('0x15')](_0xa0c6('0x16'),{'id':_0x5cd359[_0x51b8ce],'closed':!![]});}}})[_0xa0c6('0x17')](function(_0x404627){logger['error'](_0xa0c6('0x18'),_0x404627?util[_0xa0c6('0x19')](_0x404627,{'showHidden':![],'depth':null}):'');});}exports[_0xa0c6('0x1a')]=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 05776bc..de2aa83 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6d1=['Innocenzo','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','hopper1','finished\x20populating','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now'];(function(_0x3d13d7,_0x295266){var _0x34fdde=function(_0x2c52bf){while(--_0x2c52bf){_0x3d13d7['push'](_0x3d13d7['shift']());}};_0x34fdde(++_0x295266);}(_0xf6d1,0x103));var _0x1f6d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf6d1[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0x1f6d('0x0'));var db=require(_0x1f6d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1f6d('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1f6d('0x3')+i,'phone':0xf879fb460+i,'email':_0x1f6d('0x4')+i+_0x1f6d('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1f6d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x1f6d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1f6d('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1f6d('0x2')]({'id':i,'firstName':_0x1f6d('0x7')+i,'lastName':_0x1f6d('0x3')+i,'phone':0xf879fb460+i,'email':_0x1f6d('0x4')+i+_0x1f6d('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1f6d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x1f6d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1f6d('0x6')](),'updatedAt':Date[_0x1f6d('0x6')]()});}db[_0x1f6d('0x8')][_0x1f6d('0x9')]({'where':{}})[_0x1f6d('0xa')](function(){return db[_0x1f6d('0x8')][_0x1f6d('0xb')](contacts);})[_0x1f6d('0xa')](function(){console[_0x1f6d('0xc')]('finished\x20populating',_0x1f6d('0xd'));return db['CmHopper'][_0x1f6d('0x9')]({'where':{}});})[_0x1f6d('0xa')](function(){return db[_0x1f6d('0xe')][_0x1f6d('0xb')](hopper);})['then'](function(){console[_0x1f6d('0xc')]('finished\x20populating',_0x1f6d('0xf'));return db['CmContact'][_0x1f6d('0xb')](contacts2);})[_0x1f6d('0xa')](function(){console[_0x1f6d('0xc')](_0x1f6d('0x10'),_0x1f6d('0x11'));return db[_0x1f6d('0xe')][_0x1f6d('0xb')](hopper2);})[_0x1f6d('0xa')](function(){console[_0x1f6d('0xc')](_0x1f6d('0x10'),_0x1f6d('0x12'));})['catch'](function(_0x55dbfb){console['log'](_0x55dbfb);}); \ No newline at end of file +var _0xeb23=['../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','CmContact','then','bulkCreate','contacts1','CmHopper','destroy','finished\x20populating','log','contacts2','hopper2','catch','util'];(function(_0xf96fa3,_0x5ad3ec){var _0x58c0fa=function(_0x2059b9){while(--_0x2059b9){_0xf96fa3['push'](_0xf96fa3['shift']());}};_0x58c0fa(++_0x5ad3ec);}(_0xeb23,0x19d));var _0x3eb2=function(_0x162f05,_0x328e0f){_0x162f05=_0x162f05-0x0;var _0x54f59a=_0xeb23[_0x162f05];return _0x54f59a;};'use strict';var util=require(_0x3eb2('0x0'));var db=require(_0x3eb2('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3eb2('0x2')]({'id':i,'firstName':_0x3eb2('0x3')+i,'lastName':_0x3eb2('0x4')+i,'phone':0xf879fb460+i,'email':_0x3eb2('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x3eb2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3eb2('0x6')](),'updatedAt':Date[_0x3eb2('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3eb2('0x2')]({'id':i,'firstName':_0x3eb2('0x3')+i,'lastName':_0x3eb2('0x4')+i,'phone':0xf879fb460+i,'email':_0x3eb2('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3eb2('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3eb2('0x6')](),'updatedAt':Date['now']()});}db[_0x3eb2('0x7')]['destroy']({'where':{}})[_0x3eb2('0x8')](function(){return db[_0x3eb2('0x7')][_0x3eb2('0x9')](contacts);})[_0x3eb2('0x8')](function(){console['log']('finished\x20populating',_0x3eb2('0xa'));return db[_0x3eb2('0xb')][_0x3eb2('0xc')]({'where':{}});})[_0x3eb2('0x8')](function(){return db[_0x3eb2('0xb')][_0x3eb2('0x9')](hopper);})[_0x3eb2('0x8')](function(){console['log'](_0x3eb2('0xd'),'hopper1');return db[_0x3eb2('0x7')][_0x3eb2('0x9')](contacts2);})[_0x3eb2('0x8')](function(){console[_0x3eb2('0xe')](_0x3eb2('0xd'),_0x3eb2('0xf'));return db[_0x3eb2('0xb')][_0x3eb2('0x9')](hopper2);})[_0x3eb2('0x8')](function(){console[_0x3eb2('0xe')](_0x3eb2('0xd'),_0x3eb2('0x10'));})[_0x3eb2('0x11')](function(_0x36e5a2){console[_0x3eb2('0xe')](_0x36e5a2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 01ed9b7..95fbc35 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x251d=['friend','udp','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','log','util','push','format','%s%s','agent','%s%s@xcally.com','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x251d,0x162));var _0xd251=function(_0x47c8e0,_0x15440e){_0x47c8e0=_0x47c8e0-0x0;var _0x30dc82=_0x251d[_0x47c8e0];return _0x30dc82;};'use strict';var util=require(_0xd251('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd251('0x1')]({'name':util[_0xd251('0x2')](_0xd251('0x3'),_0xd251('0x4'),i),'fullname':util[_0xd251('0x2')]('%s%s','agent',i),'email':util[_0xd251('0x2')](_0xd251('0x5'),_0xd251('0x4'),i),'role':_0xd251('0x4'),'password':_0xd251('0x6'),'internal':0xfa0+i,'type':_0xd251('0x7'),'transport':[_0xd251('0x8'),'ws','wss'],'disallow':['all'],'allow':[_0xd251('0x9')],'defaultuser':util['format'](_0xd251('0x3'),'agent',i),'encryption':_0xd251('0xa'),'avpf':_0xd251('0xa'),'force_avp':_0xd251('0xa'),'icesupport':_0xd251('0xa'),'dtlsenable':_0xd251('0xa'),'dtlsverify':'no','dtlscertfile':_0xd251('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xd251('0xc'),'callerid':util[_0xd251('0x2')](_0xd251('0xd'),util[_0xd251('0x2')](_0xd251('0x3'),_0xd251('0x4'),i),0xfa0+i)});}db[_0xd251('0xe')][_0xd251('0xf')](users)[_0xd251('0x10')](function(){console['log'](_0xd251('0x11'));})['catch'](function(_0x1a4478){console[_0xd251('0x12')](_0x1a4478);}); \ No newline at end of file +var _0x347a=['push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','bulkCreate','add\x20user','catch','log','../mysqldb'];(function(_0x241eb9,_0x5ccc3f){var _0x4f916b=function(_0x412d98){while(--_0x412d98){_0x241eb9['push'](_0x241eb9['shift']());}};_0x4f916b(++_0x5ccc3f);}(_0x347a,0x109));var _0xa347=function(_0x52ab8a,_0xee034b){_0x52ab8a=_0x52ab8a-0x0;var _0x5d6ddc=_0x347a[_0x52ab8a];return _0x5d6ddc;};'use strict';var util=require('util');var db=require(_0xa347('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa347('0x1')]({'name':util[_0xa347('0x2')](_0xa347('0x3'),'agent',i),'fullname':util['format'](_0xa347('0x3'),_0xa347('0x4'),i),'email':util[_0xa347('0x2')](_0xa347('0x5'),_0xa347('0x4'),i),'role':_0xa347('0x4'),'password':_0xa347('0x6'),'internal':0xfa0+i,'type':_0xa347('0x7'),'transport':[_0xa347('0x8'),'ws',_0xa347('0x9')],'disallow':['all'],'allow':[_0xa347('0xa')],'defaultuser':util[_0xa347('0x2')](_0xa347('0x3'),'agent',i),'encryption':_0xa347('0xb'),'avpf':_0xa347('0xb'),'force_avp':_0xa347('0xb'),'icesupport':_0xa347('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xa347('0xc'),'dtlsprivatekey':_0xa347('0xd'),'dtlssetup':_0xa347('0xe'),'callerid':util[_0xa347('0x2')]('\x22%s\x22\x20<%s>',util[_0xa347('0x2')]('%s%s',_0xa347('0x4'),i),0xfa0+i)});}db['User'][_0xa347('0xf')](users)['then'](function(){console['log'](_0xa347('0x10'));})[_0xa347('0x11')](function(_0x2ea705){console[_0xa347('0x12')](_0x2ea705);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index afcebf5..57c73a8 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6931=['user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','log','join','default','request','connection','remoteAddress','connectedAt','SocketIO\x20','address','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','ivr','%s:queue:%s','format','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','voice:inbound','SmsQueues','WhatsappQueue','getChatQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','removeChatInteractions','leave','removeMailInteractions','emit'];(function(_0x389fb4,_0x7b4baf){var _0x14aebd=function(_0x1a7e7c){while(--_0x1a7e7c){_0x389fb4['push'](_0x389fb4['shift']());}};_0x14aebd(++_0x7b4baf);}(_0x6931,0x1a9));var _0x1693=function(_0x16ed17,_0xe56f30){_0x16ed17=_0x16ed17-0x0;var _0x449e1c=_0x6931[_0x16ed17];return _0x449e1c;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var BPromise=require(_0x1693('0x2'));var db=require(_0x1693('0x3'))['db'];var config=require(_0x1693('0x4'));var queryQueues={'attributes':['id',_0x1693('0x5')],'include':[{'as':_0x1693('0x6'),'model':db[_0x1693('0x7')],'attributes':['id','name',_0x1693('0x8')],'raw':!![],'where':{'role':_0x1693('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1693('0x5')],'where':{'role':_0x1693('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1693('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1693('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1693('0x5'),_0x1693('0xb')],'where':{'type':'ivr'}};function getAssociatedResources(_0xc66466,_0x2dfab9,_0x356ec3){return db[_0x1693('0xc')][_0x1693('0xd')]({'where':{'name':_0xc66466,'userProfileId':_0x2dfab9},'raw':!![]})[_0x1693('0xe')](function(_0x26ba4b){if(_0x26ba4b){if(_0x26ba4b[_0x1693('0xf')]){switch(_0xc66466){case _0x1693('0x10'):case _0x1693('0x11'):case _0x1693('0x12'):case'SmsQueues':case _0x1693('0x13'):case _0x1693('0x14'):case _0x1693('0x15'):return db[_0x356ec3][_0x1693('0x16')](queryQueues);case _0x1693('0x17'):return db[_0x356ec3][_0x1693('0x16')](queryTelephones);case _0x1693('0x18'):return db[_0x356ec3]['findAll'](queryTrunks);case _0x1693('0x19'):return db[_0x356ec3]['findAll'](queryCampaigns);}}else{return db[_0x1693('0x1a')]['findAll']({'attributes':[_0x1693('0x1b')],'where':{'sectionId':_0x26ba4b['id']},'raw':!![]})[_0x1693('0xe')](function(_0x4db220){if(_0x4db220){var _0x5a4fb3={'where':{'id':_[_0x1693('0x1c')](_0x4db220,'resourceId')},'raw':!![]};switch(_0x356ec3){case'User':_0x5a4fb3['where'][_0x1693('0x8')]='telephone';break;case'Campaign':_0x5a4fb3[_0x1693('0x1d')][_0x1693('0xb')]=_0x1693('0x1e');break;}return db[_0x356ec3][_0x1693('0x16')](_0x5a4fb3);}else{return[];}});}}else{return[];}})[_0x1693('0xe')](function(_0x7a19ae){return _0x7a19ae;});}function joinOrLeaveQueues(_0x4c3977,_0x5c4159,_0x266bb6,_0x3d1559){_0x4c3977[_0x5c4159](util['format'](_0x1693('0x1f'),_0x266bb6,_0x3d1559[_0x1693('0x5')]));if(_0x3d1559[_0x1693('0x6')]){for(var _0xd2ff89=0x0;_0xd2ff89<_0x3d1559[_0x1693('0x6')]['length'];_0xd2ff89+=0x1){_0x4c3977[_0x5c4159](util[_0x1693('0x20')](_0x1693('0x21'),_0x3d1559[_0x1693('0x6')][_0xd2ff89][_0x1693('0x5')]));}}}function joinOrLeave(_0x36a062,_0x2fa64c,_0x56655d){var _0x45ceea;if(_0x36a062['handshake'][_0x1693('0x22')]['id']){db[_0x1693('0x7')][_0x1693('0x23')]({'attributes':['id','name',_0x1693('0x8'),_0x1693('0x24')],'where':{'id':_0x36a062[_0x1693('0x25')][_0x1693('0x22')]['id']},'include':[{'model':db[_0x1693('0x26')],'as':_0x1693('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x1693('0x28')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1693('0x29')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1693('0x2a')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1693('0x2b')],'as':_0x1693('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x1693('0x2d')],'as':_0x1693('0x2e'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x425361){if(_0x425361){_0x45ceea=_0x425361;_0x36a062[_0x2fa64c](util[_0x1693('0x20')]('user:%s',_0x425361['name']));var _0x372585=[];switch(_0x425361['role']){case'admin':_0x36a062[_0x2fa64c]('voice:inbound');_0x36a062[_0x2fa64c](_0x1693('0x2f'));if(queryQueues[_0x1693('0x30')]('include')){delete queryQueues[_0x1693('0x31')];}_0x372585['push'](db[_0x1693('0x32')]['findAll'](queryQueues));_0x372585[_0x1693('0x33')](db[_0x1693('0x34')][_0x1693('0x16')](queryQueues));_0x372585['push'](db[_0x1693('0x35')][_0x1693('0x16')](queryQueues));_0x372585[_0x1693('0x33')](db[_0x1693('0x36')][_0x1693('0x16')](queryQueues));_0x372585[_0x1693('0x33')](db[_0x1693('0x37')][_0x1693('0x16')](queryQueues));_0x372585[_0x1693('0x33')](db[_0x1693('0x38')][_0x1693('0x16')](queryQueues));_0x372585[_0x1693('0x33')](db['WhatsappQueue'][_0x1693('0x16')](queryQueues));_0x372585['push'](db[_0x1693('0x7')][_0x1693('0x16')](queryTelephones));_0x372585[_0x1693('0x33')](db[_0x1693('0x39')][_0x1693('0x16')](queryTrunks));_0x372585[_0x1693('0x33')](db[_0x1693('0x3a')][_0x1693('0x16')](queryCampaigns));_0x372585[_0x1693('0x33')](db['User'][_0x1693('0x16')](queryAgents));break;case _0x1693('0x3b'):_0x36a062[_0x2fa64c](_0x1693('0x3c'));_0x36a062[_0x2fa64c](_0x1693('0x2f'));_0x372585[_0x1693('0x33')](getAssociatedResources(_0x1693('0x10'),_0x425361[_0x1693('0x24')],_0x1693('0x32')));_0x372585[_0x1693('0x33')](getAssociatedResources(_0x1693('0x11'),_0x425361['userProfileId'],'ChatQueue'));_0x372585['push'](getAssociatedResources(_0x1693('0x12'),_0x425361[_0x1693('0x24')],_0x1693('0x35')));_0x372585[_0x1693('0x33')](getAssociatedResources(_0x1693('0x3d'),_0x425361[_0x1693('0x24')],_0x1693('0x36')));_0x372585[_0x1693('0x33')](getAssociatedResources(_0x1693('0x13'),_0x425361[_0x1693('0x24')],_0x1693('0x37')));_0x372585[_0x1693('0x33')](getAssociatedResources('OpenchannelQueues',_0x425361[_0x1693('0x24')],_0x1693('0x38')));_0x372585[_0x1693('0x33')](getAssociatedResources(_0x1693('0x15'),_0x425361[_0x1693('0x24')],_0x1693('0x3e')));_0x372585['push'](getAssociatedResources(_0x1693('0x17'),_0x425361['userProfileId'],'User'));_0x372585['push'](getAssociatedResources('Trunks',_0x425361['userProfileId'],_0x1693('0x39')));_0x372585[_0x1693('0x33')](getAssociatedResources(_0x1693('0x19'),_0x425361['userProfileId'],'Campaign'));_0x372585['push'](db[_0x1693('0x7')][_0x1693('0x16')](queryAgents));break;case _0x1693('0x9'):_0x36a062[_0x2fa64c]('voice:inbound');_0x36a062[_0x2fa64c](_0x1693('0x2f'));_0x372585[_0x1693('0x33')](_0x425361['getVoiceQueues']({'attributes':['id',_0x1693('0x5')]}));_0x372585['push'](_0x425361[_0x1693('0x3f')]({'attributes':['id',_0x1693('0x5')]}));_0x372585[_0x1693('0x33')](_0x425361['getFaxQueues']({'attributes':['id',_0x1693('0x5')]}));_0x372585['push'](_0x425361[_0x1693('0x40')]({'attributes':['id',_0x1693('0x5')]}));_0x372585[_0x1693('0x33')](_0x425361[_0x1693('0x41')]({'attributes':['id',_0x1693('0x5')]}));_0x372585['push'](_0x425361['getOpenchannelQueues']({'attributes':['id','name']}));_0x372585[_0x1693('0x33')](_0x425361[_0x1693('0x42')]({'attributes':['id',_0x1693('0x5')]}));break;}return BPromise[_0x1693('0x43')](_0x372585);}})[_0x1693('0xe')](function(_0x4be5c5){if(_0x4be5c5&&_0x4be5c5[_0x1693('0x44')]){for(var _0x30838c=0x0;_0x30838c<_0x4be5c5[_0x1693('0x44')];_0x30838c+=0x1){for(var _0x5a7791=0x0;_0x5a7791<_0x4be5c5[_0x30838c][_0x1693('0x44')];_0x5a7791+=0x1){switch(_0x30838c){case 0x0:joinOrLeaveQueues(_0x36a062,_0x2fa64c,'voice',_0x4be5c5[_0x30838c][_0x5a7791]);break;case 0x1:joinOrLeaveQueues(_0x36a062,_0x2fa64c,'chat',_0x4be5c5[_0x30838c][_0x5a7791]);break;case 0x2:joinOrLeaveQueues(_0x36a062,_0x2fa64c,_0x1693('0x45'),_0x4be5c5[_0x30838c][_0x5a7791]);break;case 0x3:joinOrLeaveQueues(_0x36a062,_0x2fa64c,_0x1693('0x46'),_0x4be5c5[_0x30838c][_0x5a7791]);break;case 0x4:joinOrLeaveQueues(_0x36a062,_0x2fa64c,_0x1693('0x47'),_0x4be5c5[_0x30838c][_0x5a7791]);break;case 0x5:joinOrLeaveQueues(_0x36a062,_0x2fa64c,_0x1693('0x48'),_0x4be5c5[_0x30838c][_0x5a7791]);break;case 0x6:joinOrLeaveQueues(_0x36a062,_0x2fa64c,_0x1693('0x49'),_0x4be5c5[_0x30838c][_0x5a7791]);break;case 0x7:if(_0x45ceea['role']!=='agent')_0x36a062[_0x2fa64c](util[_0x1693('0x20')](_0x1693('0x4a'),_0x4be5c5[_0x30838c][_0x5a7791]['name']));break;case 0x8:if(_0x45ceea[_0x1693('0x8')]!==_0x1693('0x9'))_0x36a062[_0x2fa64c](util['format'](_0x1693('0x4b'),_0x4be5c5[_0x30838c][_0x5a7791][_0x1693('0x5')]));break;case 0x9:if(_0x45ceea[_0x1693('0x8')]!==_0x1693('0x9'))_0x36a062[_0x2fa64c](util[_0x1693('0x20')]('campaign:%s:%s',_0x4be5c5[_0x30838c][_0x5a7791][_0x1693('0xb')],_0x4be5c5[_0x30838c][_0x5a7791]['name']));break;case 0xa:_0x36a062[_0x2fa64c](util['format']('user:%s',_0x4be5c5[_0x30838c][_0x5a7791][_0x1693('0x5')]));break;}}}}})['then'](function(){if(_0x2fa64c==='leave'){var _0x27f3c7=_[_0x1693('0x1c')](_0x45ceea[_0x1693('0x27')],'id');return _0x45ceea[_0x1693('0x4c')](_0x27f3c7)[_0x1693('0xe')](function(){for(var _0x117370=0x0;_0x117370<_0x27f3c7[_0x1693('0x44')];_0x117370+=0x1){_0x56655d['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x27f3c7[_0x117370]),'UserId':Number(_0x45ceea['id'])});}});}})['then'](function(){if(_0x2fa64c===_0x1693('0x4d')){var _0x1a9303=_[_0x1693('0x1c')](_0x45ceea['MailInteractions'],'id');return _0x45ceea[_0x1693('0x4e')](_0x1a9303)[_0x1693('0xe')](function(){for(var _0x4ce5b6=0x0;_0x4ce5b6<_0x1a9303[_0x1693('0x44')];_0x4ce5b6+=0x1){_0x56655d[_0x1693('0x4f')](_0x1693('0x50'),{'MailInteractionId':Number(_0x1a9303[_0x4ce5b6]),'UserId':Number(_0x45ceea['id'])});}});}})['then'](function(){if(_0x2fa64c===_0x1693('0x4d')){var _0x3b1b33=_[_0x1693('0x1c')](_0x45ceea[_0x1693('0x51')],'id');return _0x45ceea[_0x1693('0x52')](_0x3b1b33)[_0x1693('0xe')](function(){for(var _0x39c68d=0x0;_0x39c68d<_0x3b1b33[_0x1693('0x44')];_0x39c68d+=0x1){_0x56655d[_0x1693('0x4f')](_0x1693('0x53'),{'FaxInteractionId':Number(_0x3b1b33[_0x39c68d]),'UserId':Number(_0x45ceea['id'])});}});}})['then'](function(){if(_0x2fa64c===_0x1693('0x4d')){var _0x12f360=_[_0x1693('0x1c')](_0x45ceea[_0x1693('0x54')],'id');return _0x45ceea[_0x1693('0x55')](_0x12f360)['then'](function(){for(var _0x1e7035=0x0;_0x1e7035<_0x12f360['length'];_0x1e7035+=0x1){_0x56655d['emit'](_0x1693('0x56'),{'SmsInteractionId':Number(_0x12f360[_0x1e7035]),'UserId':Number(_0x45ceea['id'])});}});}})['then'](function(){if(_0x2fa64c==='leave'){var _0x4fe87e=_[_0x1693('0x1c')](_0x45ceea[_0x1693('0x2c')],'id');return _0x45ceea[_0x1693('0x57')](_0x4fe87e)['then'](function(){for(var _0x434987=0x0;_0x434987<_0x4fe87e[_0x1693('0x44')];_0x434987+=0x1){_0x56655d[_0x1693('0x4f')](_0x1693('0x58'),{'OpenchannelInteractionId':Number(_0x4fe87e[_0x434987]),'UserId':Number(_0x45ceea['id'])});}});}})[_0x1693('0xe')](function(){if(_0x2fa64c===_0x1693('0x4d')){var _0x58e30d=_[_0x1693('0x1c')](_0x45ceea[_0x1693('0x2e')],'id');return _0x45ceea[_0x1693('0x59')](_0x58e30d)[_0x1693('0xe')](function(){for(var _0x4250ab=0x0;_0x4250ab<_0x58e30d['length'];_0x4250ab+=0x1){_0x56655d['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x58e30d[_0x4250ab]),'UserId':Number(_0x45ceea['id'])});}});}})['catch'](function(_0x10a19c){_0x36a062[_0x1693('0x5a')](_0x10a19c);});}}function onDisconnect(_0x4f5659,_0x2d714f){joinOrLeave(_0x4f5659,_0x1693('0x4d'),_0x2d714f);}function onConnect(_0x43c713){joinOrLeave(_0x43c713,_0x1693('0x5b'));}exports[_0x1693('0x5c')]=function(_0x5c7d13){_0x5c7d13['on']('connection',function(_0x36fd60){_0x36fd60['setMaxListeners'](0x0);_0x36fd60['address']=_0x36fd60[_0x1693('0x5d')][_0x1693('0x5e')][_0x1693('0x5f')]+':'+_0x36fd60[_0x1693('0x5d')][_0x1693('0x5e')]['remotePort'];_0x36fd60[_0x1693('0x60')]=new Date();_0x36fd60[_0x1693('0x5a')]=function(_0x3e6469){console[_0x1693('0x5a')](_0x1693('0x61')+_0x36fd60['nsp'][_0x1693('0x5')]+'['+_0x36fd60[_0x1693('0x62')]+']',_0x3e6469);};_0x36fd60['on'](_0x1693('0x63'),function(){onDisconnect(_0x36fd60,_0x5c7d13);_0x36fd60[_0x1693('0x5a')]('DISCONNECTED');});onConnect(_0x36fd60);_0x36fd60[_0x1693('0x5a')](_0x1693('0x64'));});}; \ No newline at end of file +var _0xa3eb=['role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','length','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','user','FaxQueue','WhatsappQueue','Trunks','Trunk','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User'];(function(_0x3f7861,_0x13619b){var _0x36fdae=function(_0x6aa7b8){while(--_0x6aa7b8){_0x3f7861['push'](_0x3f7861['shift']());}};_0x36fdae(++_0x13619b);}(_0xa3eb,0x1ed));var _0xba3e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa3eb[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xba3e('0x0'));var util=require(_0xba3e('0x1'));var BPromise=require(_0xba3e('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xba3e('0x3'));var queryQueues={'attributes':['id',_0xba3e('0x4')],'include':[{'as':_0xba3e('0x5'),'model':db[_0xba3e('0x6')],'attributes':['id',_0xba3e('0x4'),_0xba3e('0x7')],'raw':!![],'where':{'role':_0xba3e('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xba3e('0x4')],'where':{'role':_0xba3e('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xba3e('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xba3e('0x4')],'where':{'role':_0xba3e('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xba3e('0x4'),_0xba3e('0xa')],'where':{'type':_0xba3e('0xb')}};function getAssociatedResources(_0x31137f,_0xb73664,_0x1722bc){return db[_0xba3e('0xc')]['findOne']({'where':{'name':_0x31137f,'userProfileId':_0xb73664},'raw':!![]})[_0xba3e('0xd')](function(_0x400389){if(_0x400389){if(_0x400389[_0xba3e('0xe')]){switch(_0x31137f){case'VoiceQueues':case _0xba3e('0xf'):case _0xba3e('0x10'):case _0xba3e('0x11'):case _0xba3e('0x12'):case _0xba3e('0x13'):case _0xba3e('0x14'):return db[_0x1722bc][_0xba3e('0x15')](queryQueues);case _0xba3e('0x16'):return db[_0x1722bc]['findAll'](queryTelephones);case'Trunks':return db[_0x1722bc][_0xba3e('0x15')](queryTrunks);case _0xba3e('0x17'):return db[_0x1722bc][_0xba3e('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0xba3e('0x15')]({'attributes':[_0xba3e('0x18')],'where':{'sectionId':_0x400389['id']},'raw':!![]})['then'](function(_0x20ccd2){if(_0x20ccd2){var _0x395965={'where':{'id':_[_0xba3e('0x19')](_0x20ccd2,'resourceId')},'raw':!![]};switch(_0x1722bc){case'User':_0x395965[_0xba3e('0x1a')]['role']=_0xba3e('0x9');break;case _0xba3e('0x1b'):_0x395965[_0xba3e('0x1a')][_0xba3e('0xa')]=_0xba3e('0xb');break;}return db[_0x1722bc][_0xba3e('0x15')](_0x395965);}else{return[];}});}}else{return[];}})[_0xba3e('0xd')](function(_0x354e2e){return _0x354e2e;});}function joinOrLeaveQueues(_0x498735,_0x5198b6,_0x1bdc05,_0x351e47){_0x498735[_0x5198b6](util[_0xba3e('0x1c')](_0xba3e('0x1d'),_0x1bdc05,_0x351e47[_0xba3e('0x4')]));if(_0x351e47[_0xba3e('0x5')]){for(var _0x4f6d50=0x0;_0x4f6d50<_0x351e47[_0xba3e('0x5')][_0xba3e('0x1e')];_0x4f6d50+=0x1){_0x498735[_0x5198b6](util['format']('user:%s',_0x351e47['Agents'][_0x4f6d50][_0xba3e('0x4')]));}}}function joinOrLeave(_0x184275,_0x4a1368,_0xa774f9){var _0x570fc9;if(_0x184275[_0xba3e('0x1f')][_0xba3e('0x20')]['id']){db[_0xba3e('0x6')][_0xba3e('0x21')]({'attributes':['id',_0xba3e('0x4'),_0xba3e('0x7'),_0xba3e('0x22')],'where':{'id':_0x184275[_0xba3e('0x1f')][_0xba3e('0x20')]['id']},'include':[{'model':db[_0xba3e('0x23')],'as':_0xba3e('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xba3e('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xba3e('0x26')],'as':_0xba3e('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xba3e('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xba3e('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xba3e('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xba3e('0xd')](function(_0x26a025){if(_0x26a025){_0x570fc9=_0x26a025;_0x184275[_0x4a1368](util['format'](_0xba3e('0x2b'),_0x26a025[_0xba3e('0x4')]));var _0xcf6a7a=[];switch(_0x26a025[_0xba3e('0x7')]){case _0xba3e('0x2c'):_0x184275[_0x4a1368](_0xba3e('0x2d'));_0x184275[_0x4a1368](_0xba3e('0x2e'));if(queryQueues[_0xba3e('0x2f')](_0xba3e('0x30'))){delete queryQueues[_0xba3e('0x30')];}_0xcf6a7a[_0xba3e('0x31')](db[_0xba3e('0x32')][_0xba3e('0x15')](queryQueues));_0xcf6a7a['push'](db[_0xba3e('0x33')][_0xba3e('0x15')](queryQueues));_0xcf6a7a[_0xba3e('0x31')](db['FaxQueue'][_0xba3e('0x15')](queryQueues));_0xcf6a7a['push'](db[_0xba3e('0x34')][_0xba3e('0x15')](queryQueues));_0xcf6a7a['push'](db[_0xba3e('0x35')][_0xba3e('0x15')](queryQueues));_0xcf6a7a[_0xba3e('0x31')](db[_0xba3e('0x36')]['findAll'](queryQueues));_0xcf6a7a[_0xba3e('0x31')](db['WhatsappQueue']['findAll'](queryQueues));_0xcf6a7a['push'](db[_0xba3e('0x6')]['findAll'](queryTelephones));_0xcf6a7a[_0xba3e('0x31')](db['Trunk']['findAll'](queryTrunks));_0xcf6a7a['push'](db[_0xba3e('0x1b')]['findAll'](queryCampaigns));_0xcf6a7a['push'](db[_0xba3e('0x6')][_0xba3e('0x15')](queryAgents));break;case _0xba3e('0x37'):_0x184275[_0x4a1368]('voice:inbound');_0x184275[_0x4a1368](_0xba3e('0x2e'));_0xcf6a7a[_0xba3e('0x31')](getAssociatedResources('VoiceQueues',_0x26a025[_0xba3e('0x22')],_0xba3e('0x32')));_0xcf6a7a[_0xba3e('0x31')](getAssociatedResources(_0xba3e('0xf'),_0x26a025[_0xba3e('0x22')],_0xba3e('0x33')));_0xcf6a7a[_0xba3e('0x31')](getAssociatedResources('FaxQueues',_0x26a025[_0xba3e('0x22')],_0xba3e('0x38')));_0xcf6a7a['push'](getAssociatedResources('SmsQueues',_0x26a025[_0xba3e('0x22')],_0xba3e('0x34')));_0xcf6a7a[_0xba3e('0x31')](getAssociatedResources(_0xba3e('0x12'),_0x26a025[_0xba3e('0x22')],'MailQueue'));_0xcf6a7a['push'](getAssociatedResources(_0xba3e('0x13'),_0x26a025[_0xba3e('0x22')],'OpenchannelQueue'));_0xcf6a7a['push'](getAssociatedResources(_0xba3e('0x14'),_0x26a025[_0xba3e('0x22')],_0xba3e('0x39')));_0xcf6a7a['push'](getAssociatedResources(_0xba3e('0x16'),_0x26a025[_0xba3e('0x22')],_0xba3e('0x6')));_0xcf6a7a['push'](getAssociatedResources(_0xba3e('0x3a'),_0x26a025['userProfileId'],_0xba3e('0x3b')));_0xcf6a7a[_0xba3e('0x31')](getAssociatedResources('IvrCampaigns',_0x26a025[_0xba3e('0x22')],_0xba3e('0x1b')));_0xcf6a7a[_0xba3e('0x31')](db[_0xba3e('0x6')]['findAll'](queryAgents));break;case _0xba3e('0x8'):_0x184275[_0x4a1368]('voice:inbound');_0x184275[_0x4a1368]('voice:outbound');_0xcf6a7a[_0xba3e('0x31')](_0x26a025[_0xba3e('0x3c')]({'attributes':['id','name']}));_0xcf6a7a[_0xba3e('0x31')](_0x26a025['getChatQueues']({'attributes':['id',_0xba3e('0x4')]}));_0xcf6a7a[_0xba3e('0x31')](_0x26a025['getFaxQueues']({'attributes':['id',_0xba3e('0x4')]}));_0xcf6a7a[_0xba3e('0x31')](_0x26a025[_0xba3e('0x3d')]({'attributes':['id',_0xba3e('0x4')]}));_0xcf6a7a['push'](_0x26a025[_0xba3e('0x3e')]({'attributes':['id',_0xba3e('0x4')]}));_0xcf6a7a[_0xba3e('0x31')](_0x26a025[_0xba3e('0x3f')]({'attributes':['id',_0xba3e('0x4')]}));_0xcf6a7a[_0xba3e('0x31')](_0x26a025[_0xba3e('0x40')]({'attributes':['id',_0xba3e('0x4')]}));break;}return BPromise[_0xba3e('0x41')](_0xcf6a7a);}})[_0xba3e('0xd')](function(_0x4de03b){if(_0x4de03b&&_0x4de03b[_0xba3e('0x1e')]){for(var _0x18cea1=0x0;_0x18cea1<_0x4de03b[_0xba3e('0x1e')];_0x18cea1+=0x1){for(var _0x53012d=0x0;_0x53012d<_0x4de03b[_0x18cea1]['length'];_0x53012d+=0x1){switch(_0x18cea1){case 0x0:joinOrLeaveQueues(_0x184275,_0x4a1368,_0xba3e('0x42'),_0x4de03b[_0x18cea1][_0x53012d]);break;case 0x1:joinOrLeaveQueues(_0x184275,_0x4a1368,'chat',_0x4de03b[_0x18cea1][_0x53012d]);break;case 0x2:joinOrLeaveQueues(_0x184275,_0x4a1368,'fax',_0x4de03b[_0x18cea1][_0x53012d]);break;case 0x3:joinOrLeaveQueues(_0x184275,_0x4a1368,_0xba3e('0x43'),_0x4de03b[_0x18cea1][_0x53012d]);break;case 0x4:joinOrLeaveQueues(_0x184275,_0x4a1368,_0xba3e('0x44'),_0x4de03b[_0x18cea1][_0x53012d]);break;case 0x5:joinOrLeaveQueues(_0x184275,_0x4a1368,_0xba3e('0x45'),_0x4de03b[_0x18cea1][_0x53012d]);break;case 0x6:joinOrLeaveQueues(_0x184275,_0x4a1368,_0xba3e('0x46'),_0x4de03b[_0x18cea1][_0x53012d]);break;case 0x7:if(_0x570fc9[_0xba3e('0x7')]!=='agent')_0x184275[_0x4a1368](util[_0xba3e('0x1c')]('telephone:%s',_0x4de03b[_0x18cea1][_0x53012d]['name']));break;case 0x8:if(_0x570fc9[_0xba3e('0x7')]!==_0xba3e('0x8'))_0x184275[_0x4a1368](util[_0xba3e('0x1c')](_0xba3e('0x47'),_0x4de03b[_0x18cea1][_0x53012d][_0xba3e('0x4')]));break;case 0x9:if(_0x570fc9['role']!==_0xba3e('0x8'))_0x184275[_0x4a1368](util[_0xba3e('0x1c')](_0xba3e('0x48'),_0x4de03b[_0x18cea1][_0x53012d][_0xba3e('0xa')],_0x4de03b[_0x18cea1][_0x53012d][_0xba3e('0x4')]));break;case 0xa:_0x184275[_0x4a1368](util[_0xba3e('0x1c')]('user:%s',_0x4de03b[_0x18cea1][_0x53012d][_0xba3e('0x4')]));break;}}}}})[_0xba3e('0xd')](function(){if(_0x4a1368===_0xba3e('0x49')){var _0x4d0c6e=_['map'](_0x570fc9['ChatInteractions'],'id');return _0x570fc9[_0xba3e('0x4a')](_0x4d0c6e)[_0xba3e('0xd')](function(){for(var _0xbe45a3=0x0;_0xbe45a3<_0x4d0c6e[_0xba3e('0x1e')];_0xbe45a3+=0x1){_0xa774f9[_0xba3e('0x4b')](_0xba3e('0x4c'),{'ChatInteractionId':Number(_0x4d0c6e[_0xbe45a3]),'UserId':Number(_0x570fc9['id'])});}});}})[_0xba3e('0xd')](function(){if(_0x4a1368===_0xba3e('0x49')){var _0x41314f=_['map'](_0x570fc9['MailInteractions'],'id');return _0x570fc9[_0xba3e('0x4d')](_0x41314f)['then'](function(){for(var _0xe3135e=0x0;_0xe3135e<_0x41314f[_0xba3e('0x1e')];_0xe3135e+=0x1){_0xa774f9[_0xba3e('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x41314f[_0xe3135e]),'UserId':Number(_0x570fc9['id'])});}});}})[_0xba3e('0xd')](function(){if(_0x4a1368===_0xba3e('0x49')){var _0x4185a7=_[_0xba3e('0x19')](_0x570fc9[_0xba3e('0x27')],'id');return _0x570fc9['removeFaxInteractions'](_0x4185a7)[_0xba3e('0xd')](function(){for(var _0x2b4e72=0x0;_0x2b4e72<_0x4185a7[_0xba3e('0x1e')];_0x2b4e72+=0x1){_0xa774f9['emit'](_0xba3e('0x4e'),{'FaxInteractionId':Number(_0x4185a7[_0x2b4e72]),'UserId':Number(_0x570fc9['id'])});}});}})['then'](function(){if(_0x4a1368==='leave'){var _0x317144=_['map'](_0x570fc9[_0xba3e('0x4f')],'id');return _0x570fc9[_0xba3e('0x50')](_0x317144)['then'](function(){for(var _0x480a08=0x0;_0x480a08<_0x317144[_0xba3e('0x1e')];_0x480a08+=0x1){_0xa774f9[_0xba3e('0x4b')](_0xba3e('0x51'),{'SmsInteractionId':Number(_0x317144[_0x480a08]),'UserId':Number(_0x570fc9['id'])});}});}})[_0xba3e('0xd')](function(){if(_0x4a1368===_0xba3e('0x49')){var _0x30c0c4=_[_0xba3e('0x19')](_0x570fc9[_0xba3e('0x52')],'id');return _0x570fc9[_0xba3e('0x53')](_0x30c0c4)[_0xba3e('0xd')](function(){for(var _0x41e268=0x0;_0x41e268<_0x30c0c4[_0xba3e('0x1e')];_0x41e268+=0x1){_0xa774f9[_0xba3e('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x30c0c4[_0x41e268]),'UserId':Number(_0x570fc9['id'])});}});}})['then'](function(){if(_0x4a1368===_0xba3e('0x49')){var _0x1cb9d9=_['map'](_0x570fc9[_0xba3e('0x2a')],'id');return _0x570fc9[_0xba3e('0x54')](_0x1cb9d9)[_0xba3e('0xd')](function(){for(var _0x4d7552=0x0;_0x4d7552<_0x1cb9d9[_0xba3e('0x1e')];_0x4d7552+=0x1){_0xa774f9[_0xba3e('0x4b')](_0xba3e('0x55'),{'WhatsappInteractionId':Number(_0x1cb9d9[_0x4d7552]),'UserId':Number(_0x570fc9['id'])});}});}})[_0xba3e('0x56')](function(_0x4c5d09){_0x184275[_0xba3e('0x57')](_0x4c5d09);});}}function onDisconnect(_0xa53621,_0x500df3){joinOrLeave(_0xa53621,_0xba3e('0x49'),_0x500df3);}function onConnect(_0x104ce5){joinOrLeave(_0x104ce5,_0xba3e('0x58'));}exports[_0xba3e('0x59')]=function(_0x4d92b6){_0x4d92b6['on'](_0xba3e('0x5a'),function(_0x4dd38a){_0x4dd38a['setMaxListeners'](0x0);_0x4dd38a[_0xba3e('0x5b')]=_0x4dd38a[_0xba3e('0x5c')][_0xba3e('0x5a')][_0xba3e('0x5d')]+':'+_0x4dd38a[_0xba3e('0x5c')][_0xba3e('0x5a')][_0xba3e('0x5e')];_0x4dd38a[_0xba3e('0x5f')]=new Date();_0x4dd38a[_0xba3e('0x57')]=function(_0x75394d){console[_0xba3e('0x57')](_0xba3e('0x60')+_0x4dd38a['nsp'][_0xba3e('0x4')]+'['+_0x4dd38a[_0xba3e('0x5b')]+']',_0x75394d);};_0x4dd38a['on'](_0xba3e('0x61'),function(){onDisconnect(_0x4dd38a,_0x4d92b6);_0x4dd38a[_0xba3e('0x57')](_0xba3e('0x62'));});onConnect(_0x4dd38a);_0x4dd38a[_0xba3e('0x57')](_0xba3e('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index bb5540e..68863ae 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 _0x4664=['catch','Trigger,\x20%s','get','motionChannel','event','direction','resolve','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','contact','UserId','interface','agent','channel','incomingmessage','AfterCreateMessage','offlineMessage','QueryTypes','SIP/%s','name','AfterCreate','changed','closed','substatus','SELECT','format','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','toLowerCase','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','error','code'];(function(_0x1c82a7,_0xccf404){var _0x516e2b=function(_0x5064f0){while(--_0x5064f0){_0x1c82a7['push'](_0x1c82a7['shift']());}};_0x516e2b(++_0xccf404);}(_0x4664,0x115));var _0x4466=function(_0x39ad4c,_0x2fa27e){_0x39ad4c=_0x39ad4c-0x0;var _0xf3314d=_0x4664[_0x39ad4c];return _0xf3314d;};'use strict';var util=require(_0x4466('0x0'));var db=require(_0x4466('0x1'))['db'];var jayson=require(_0x4466('0x2'));var logger=require(_0x4466('0x3'))('triggers');var client=jayson[_0x4466('0x4')][_0x4466('0x5')]({'port':0x232a});var triggers=[{'channel':_0x4466('0x6'),'model':_0x4466('0x7'),'event':_0x4466('0x8'),'condition':_0x4466('0x9'),'callback':afterCreate},{'channel':_0x4466('0x6'),'model':'ChatInteraction','event':_0x4466('0xa'),'condition':_0x4466('0xb'),'callback':afterUpdate},{'channel':_0x4466('0x6'),'model':_0x4466('0xc'),'event':_0x4466('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0x4466('0xd'),'event':_0x4466('0x8'),'condition':_0x4466('0xe'),'callback':afterCreateOfflineMessage},{'channel':_0x4466('0xf'),'model':_0x4466('0x10'),'event':_0x4466('0x8'),'condition':_0x4466('0x9'),'callback':afterCreate},{'channel':_0x4466('0xf'),'model':_0x4466('0x10'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4466('0xf'),'model':_0x4466('0x11'),'event':_0x4466('0x8'),'condition':_0x4466('0xe'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x4466('0x12'),'event':_0x4466('0x8'),'condition':_0x4466('0x9'),'callback':afterCreate},{'channel':_0x4466('0x13'),'model':_0x4466('0x12'),'event':'afterUpdate','condition':_0x4466('0xb'),'callback':afterUpdate},{'channel':_0x4466('0x13'),'model':_0x4466('0x14'),'event':'afterCreate','condition':_0x4466('0xe'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x4466('0x15'),'event':_0x4466('0x8'),'condition':_0x4466('0x9'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0x4466('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4466('0x16'),'model':_0x4466('0x17'),'event':'afterCreate','condition':_0x4466('0xe'),'callback':afterCreateMessage},{'channel':_0x4466('0x18'),'model':'MailInteraction','event':_0x4466('0x8'),'condition':_0x4466('0x9'),'callback':afterCreate},{'channel':_0x4466('0x18'),'model':_0x4466('0x19'),'event':'afterUpdate','condition':_0x4466('0xb'),'callback':afterUpdate},{'channel':_0x4466('0x18'),'model':_0x4466('0x1a'),'event':_0x4466('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4466('0x1b'),'model':'OpenchannelInteraction','event':_0x4466('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4466('0x1b'),'model':_0x4466('0x1c'),'event':_0x4466('0xa'),'condition':_0x4466('0xb'),'callback':afterUpdate},{'channel':_0x4466('0x1b'),'model':_0x4466('0x1d'),'event':'afterCreate','condition':_0x4466('0xe'),'callback':afterCreateMessage}];function request(_0x56e6e0){return client[_0x4466('0x1e')](_0x4466('0x1f'),_0x56e6e0)['then'](function(_0x39a969){logger[_0x4466('0x20')]('Trigger,\x20%s','EventManager',_0x39a969);if(_0x39a969['error']){if(_0x39a969[_0x4466('0x21')][_0x4466('0x22')]===0x1f4){logger[_0x4466('0x21')]('Trigger,\x20%s',_0x4466('0x1f'),_0x39a969[_0x4466('0x21')]);}}})[_0x4466('0x23')](function(_0x309a89){logger[_0x4466('0x21')](_0x4466('0x24'),_0x4466('0x1f'),_0x309a89);});}function afterCreateMessage(_0xf454a4){return function(_0x94bd14){_0x94bd14=_0x94bd14[_0x4466('0x25')]({'plain':!![]});_0x94bd14['channel']=_0xf454a4;_0x94bd14[_0x4466('0x26')]=_0xf454a4;_0x94bd14[_0x4466('0x27')]=_0x94bd14[_0x4466('0x28')];Promise[_0x4466('0x29')]()[_0x4466('0x2a')](function(){if(typeof _0x94bd14[_0x4466('0x2b')]===_0x4466('0x2c'))return null;var _0x27893b=_0x4466('0x2d')+_0x94bd14[_0x4466('0x2b')];return db[_0x4466('0x2e')][_0x4466('0x2f')](_0x27893b,{'type':db[_0x4466('0x30')]['QueryTypes']['SELECT'],'raw':!![]});})[_0x4466('0x2a')](function(_0x45105c){if(_0x45105c){_0x94bd14[_0x4466('0x31')]=_0x45105c[0x0];}if(typeof _0x94bd14[_0x4466('0x32')]===_0x4466('0x2c'))return;return getAgent(_0x94bd14[_0x4466('0x32')]);})['then'](function(_0x3b00d2){if(_0x3b00d2){_0x94bd14[_0x4466('0x33')]=util['format']('SIP/%s',_0x3b00d2['name']);_0x94bd14[_0x4466('0x34')]=_0x3b00d2;_0x94bd14[_0x4466('0x35')]=_0xf454a4;return request({'event':_0x4466('0x36'),'message':_0x94bd14});}else{return request({'event':'outgoingmessage','message':_0x94bd14});}})['catch'](function(_0x583b34){logger[_0x4466('0x21')]('Trigger,\x20%s',_0x4466('0x37'),_0x583b34);});};}function afterCreateOfflineMessage(_0x2a8818){return function(_0x124eea){_0x124eea=_0x124eea[_0x4466('0x25')]({'plain':!![]});_0x124eea[_0x4466('0x35')]=_0x2a8818;_0x124eea[_0x4466('0x26')]=_0x2a8818;_0x124eea['event']=_0x4466('0x38');return request({'event':_0x124eea[_0x4466('0x27')],'message':_0x124eea});};}function afterCreate(_0x37bc1e,_0x36ce3c){return function(_0x4dcf72){_0x4dcf72=_0x4dcf72[_0x4466('0x25')]({'plain':!![]});_0x4dcf72[_0x4466('0x35')]=_0x37bc1e;_0x4dcf72[_0x4466('0x26')]=_0x37bc1e;_0x4dcf72[_0x4466('0x27')]='opened';Promise[_0x4466('0x29')]()[_0x4466('0x2a')](function(){var _0x3778da=_0x4466('0x2d')+_0x4dcf72[_0x4466('0x2b')];return db[_0x4466('0x2e')][_0x4466('0x2f')](_0x3778da,{'type':db[_0x4466('0x30')][_0x4466('0x39')]['SELECT'],'raw':!![]});})[_0x4466('0x2a')](function(_0x891136){if(_0x891136){_0x4dcf72[_0x4466('0x31')]=_0x891136[0x0];}if(typeof _0x4dcf72['UserId']===_0x4466('0x2c'))return;return getAgent(_0x4dcf72['UserId']);})[_0x4466('0x2a')](function(_0x382d38){if(_0x382d38){_0x4dcf72[_0x4466('0x33')]=util['format'](_0x4466('0x3a'),_0x382d38[_0x4466('0x3b')]);_0x4dcf72[_0x4466('0x34')]=_0x382d38;}return request({'event':_0x36ce3c,'message':_0x4dcf72});})[_0x4466('0x23')](function(_0x804446){logger[_0x4466('0x21')]('Trigger,\x20%s',_0x4466('0x3c'),_0x804446);});};}function afterUpdate(_0x133f67){return function(_0x4ecf25){var _0x51ee28=_0x4ecf25[_0x4466('0x3d')](_0x4466('0x3e'))&&_0x4ecf25[_0x4466('0x3e')];var _0x3574a3=_0x4ecf25['changed'](_0x4466('0x3f'));if(_0x51ee28||_0x3574a3){var _0x358df8=_0x51ee28?'closedinteraction':_0x4466('0x3f');var _0x4923be=_0x4ecf25[_0x4466('0x25')]({'plain':!![]});_0x4923be[_0x4466('0x35')]=_0x133f67;_0x4923be['motionChannel']=_0x133f67;_0x4923be[_0x4466('0x27')]=_0x51ee28?_0x4466('0x3e'):_0x4466('0x3f');var _0x55089c=_0x4466('0x2d')+_0x4923be['ContactId'];return db[_0x4466('0x2e')][_0x4466('0x2f')](_0x55089c,{'type':db[_0x4466('0x30')][_0x4466('0x39')][_0x4466('0x40')],'raw':!![]})[_0x4466('0x2a')](function(_0x426887){if(_0x426887){_0x4923be['contact']=_0x426887[0x0];}if(typeof _0x4923be[_0x4466('0x32')]===_0x4466('0x2c'))return;return getAgent(_0x4923be[_0x4466('0x32')]);})['then'](function(_0xfa228f){if(_0xfa228f){_0x4923be['interface']=util[_0x4466('0x41')](_0x4466('0x3a'),_0xfa228f[_0x4466('0x3b')]);_0x4923be[_0x4466('0x34')]=_0xfa228f;}return request({'event':_0x358df8,'message':_0x4923be});})[_0x4466('0x23')](function(_0x1c3fb2){logger[_0x4466('0x21')](_0x4466('0x24'),_0x4466('0x42'),_0x1c3fb2);});}};}function getAgent(_0x304d33){return db[_0x4466('0x43')][_0x4466('0x44')]({'where':{'id':_0x304d33},'attributes':['id','name',_0x4466('0x45'),_0x4466('0x46'),_0x4466('0x47')],'raw':!![]})[_0x4466('0x2a')](function(_0x3ba4dd){return _0x3ba4dd;});}exports[_0x4466('0x48')]=function(){for(var _0x3ae6a3=0x0;_0x3ae6a3=_0x58ef73[_0x7b87('0x14')]){throw Error(_0x7b87('0x15'));}_0x2463ed(_0x1533b2);})[_0x7b87('0x16')](function(_0x161139){_0xf1cfad(_0x161139);});});}; \ No newline at end of file +var _0x6f2a=['agents','../mysqldb','./license/util','voice','mail','chat','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','getLicense','role','agent','User','then'];(function(_0x2e08d1,_0x368221){var _0x44fb2b=function(_0x36aaed){while(--_0x36aaed){_0x2e08d1['push'](_0x2e08d1['shift']());}};_0x44fb2b(++_0x368221);}(_0x6f2a,0x17b));var _0xa6f2=function(_0x26f039,_0x574b32){_0x26f039=_0x26f039-0x0;var _0x4e3ee2=_0x6f2a[_0x26f039];return _0x4e3ee2;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0xa6f2('0x0'))['db'];var util=require(_0xa6f2('0x1'));var channels=[_0xa6f2('0x2'),_0xa6f2('0x3'),_0xa6f2('0x4'),'fax',_0xa6f2('0x5'),_0xa6f2('0x6'),_0xa6f2('0x7')];exports[_0xa6f2('0x8')]=function(){return channels;};exports[_0xa6f2('0x9')]=function(_0x42302c){_0x42302c=_0x42302c[_0xa6f2('0xa')]();return _[_0xa6f2('0xb')](channels,_0x42302c);};exports[_0xa6f2('0xc')]=function(_0x323bdc,_0x40945d,_0x2f103f,_0x431cf9){var _0xc00dd8={'loginAttempts':_0x40945d,'blocked':_0x2f103f};if(!_[_0xa6f2('0xd')](_0x431cf9)){_0xc00dd8[_0xa6f2('0xe')]=_0x431cf9;}return _0x323bdc['updateAttributes'](_0xc00dd8);};exports[_0xa6f2('0xf')]=function(_0x5d4dd8){return new BPromise(function(_0x184310,_0x526f22){var _0x45df22=0x0;if(_0x5d4dd8[_0xa6f2('0x10')]!==_0xa6f2('0x11')){_0x184310(_0x5d4dd8);}db[_0xa6f2('0x12')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5d4dd8['id']}}})[_0xa6f2('0x13')](function(_0x42d6bc){_0x45df22=_0x42d6bc;return util[_0xa6f2('0xf')]();})[_0xa6f2('0x13')](function(_0x1a499d){if(_0x1a499d&&_0x1a499d['agents']&&_0x45df22>=_0x1a499d[_0xa6f2('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x184310(_0x5d4dd8);})['catch'](function(_0x2eff4f){_0x526f22(_0x2eff4f);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index c0c03f1..d3d6846 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a7=['name','inherits','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack','status','send','../config/logger','api','message'];(function(_0x5acdbf,_0x18dd63){var _0x5b5c8c=function(_0x4f7abe){while(--_0x4f7abe){_0x5acdbf['push'](_0x5acdbf['shift']());}};_0x5b5c8c(++_0x18dd63);}(_0x91a7,0xe7));var _0x791a=function(_0x9ea665,_0x4fecf4){_0x9ea665=_0x9ea665-0x0;var _0x583ad0=_0x91a7[_0x9ea665];return _0x583ad0;};'use strict';var util=require('util');var logger=require(_0x791a('0x0'))(_0x791a('0x1'));var APIError=function(_0x268862,_0x5d2796){this[_0x791a('0x2')]=_0x268862||'Internal\x20Server\x20Error';this[_0x791a('0x3')]=_0x5d2796||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x32fe2b){this[_0x791a('0x2')]=_0x32fe2b||'Bad\x20Request';this[_0x791a('0x3')]='Bad\x20Request';util[_0x791a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x159e24){this['message']=_0x159e24||_0x791a('0x5');this[_0x791a('0x3')]=_0x791a('0x6');util[_0x791a('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x266e4b){switch(_0x266e4b){case'Bad\x20Request':return 0x190;case _0x791a('0x7'),_0x791a('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2bd26a){return function(_0x206eea){logger[_0x791a('0x9')](_0x206eea[_0x791a('0xa')]);var _0x2805c9=getStatusCode(_0x206eea[_0x791a('0x3')]);if(_0x206eea['name'])delete _0x206eea['name'];return _0x2bd26a[_0x791a('0xb')](_0x2805c9)[_0x791a('0xc')](_0x206eea);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xb688=['status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','Error','inherits','name','Entity\x20not\x20found','Not\x20Found','Bad\x20Request','Forbidden','OutOfInterval','error','stack'];(function(_0x38441d,_0x12e5f5){var _0x23c0a0=function(_0xa360c8){while(--_0xa360c8){_0x38441d['push'](_0x38441d['shift']());}};_0x23c0a0(++_0x12e5f5);}(_0xb688,0xcf));var _0x8b68=function(_0x268159,_0x11bcc1){_0x268159=_0x268159-0x0;var _0x5bce80=_0xb688[_0x268159];return _0x5bce80;};'use strict';var util=require('util');var logger=require(_0x8b68('0x0'))(_0x8b68('0x1'));var APIError=function(_0x266285,_0x1080e8){this[_0x8b68('0x2')]=_0x266285||_0x8b68('0x3');this['name']=_0x1080e8||_0x8b68('0x4');util[_0x8b68('0x5')](APIError,Error);};var APIBadRequestError=function(_0x30f33d){this[_0x8b68('0x2')]=_0x30f33d||'Bad\x20Request';this[_0x8b68('0x6')]='Bad\x20Request';util[_0x8b68('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2bbffd){this[_0x8b68('0x2')]=_0x2bbffd||_0x8b68('0x7');this[_0x8b68('0x6')]=_0x8b68('0x8');util[_0x8b68('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x21d944){switch(_0x21d944){case _0x8b68('0x9'):return 0x190;case _0x8b68('0xa'),_0x8b68('0xb'):return 0x193;case _0x8b68('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2a852a){return function(_0x502727){logger[_0x8b68('0xc')](_0x502727[_0x8b68('0xd')]);var _0x5e76c=getStatusCode(_0x502727[_0x8b68('0x6')]);if(_0x502727[_0x8b68('0x6')])delete _0x502727[_0x8b68('0x6')];return _0x2a852a[_0x8b68('0xe')](_0x5e76c)[_0x8b68('0xf')](_0x502727);};}module[_0x8b68('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 9f455d4..0904e75 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaac7=['exports','status','render','json','send'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0xaac7,0x122));var _0x7aac=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xaac7[_0x484c03];return _0x294127;};'use strict';module[_0x7aac('0x0')][0x194]=function pageNotFound(_0x149115,_0xb9db35){var _0x597d27='404';var _0x265c97=0x194;var _0x4c51d9={'status':_0x265c97};_0xb9db35[_0x7aac('0x1')](_0x4c51d9[_0x7aac('0x1')]);_0xb9db35[_0x7aac('0x2')](_0x597d27,{},function(_0x14db0f,_0x3ce43e){if(_0x14db0f){return _0xb9db35[_0x7aac('0x1')](_0x4c51d9[_0x7aac('0x1')])[_0x7aac('0x3')](_0x4c51d9);}_0xb9db35[_0x7aac('0x4')](_0x3ce43e);});}; \ No newline at end of file +var _0xa383=['json','exports','404','status','render'];(function(_0x395e06,_0x49a223){var _0x281b3f=function(_0x2e3672){while(--_0x2e3672){_0x395e06['push'](_0x395e06['shift']());}};_0x281b3f(++_0x49a223);}(_0xa383,0xa1));var _0x3a38=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0xa383[_0x8ba19a];return _0x2bd8b4;};'use strict';module[_0x3a38('0x0')][0x194]=function pageNotFound(_0xa8dc10,_0x1ff923){var _0x58ffc9=_0x3a38('0x1');var _0x4e270c=0x194;var _0x5bf4d0={'status':_0x4e270c};_0x1ff923[_0x3a38('0x2')](_0x5bf4d0[_0x3a38('0x2')]);_0x1ff923[_0x3a38('0x3')](_0x58ffc9,{},function(_0x1e6491,_0x5f522f){if(_0x1e6491){return _0x1ff923[_0x3a38('0x2')](_0x5bf4d0['status'])[_0x3a38('0x4')](_0x5bf4d0);}_0x1ff923['send'](_0x5f522f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 0a1e80c..5517eae 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25de=['../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','VoiceRecording','Recordings','UserVoiceQueueRt','Extensions','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','Team','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueue','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperBlacks','TrunkId','Interval','IntervalId','Pause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','VoiceAgentReport','Contact','ContactId','MailAccountId','restrict','Imap','Smtp','Disposition','Answers','Interactions','MailApplication','List','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatOfflineMessageId','TagId','ListId','Dashboard','Items','Dispositions','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','Phones','HopperHistories','JscriptySessions','OpenchannelInteractions','cm_contact_has_tags','CmHopperId','OwnerId','CampaignId','Condition','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','fax_interaction_has_tags','whatsapp_interaction_has_tags','ItemTypeId','Hopper','CmContactId','AllConditions','TriggerAllId','AnyCondition','Action','TriggerId','Fields','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','int_desk_configuration_has_tags','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowField','Dynamics365Configuration','CloudProviderId','FreshsalesField','FreshsalesAccount','FromId','SessionId','ProjectId','user_has_square_projects','team_has_whatsapp_queues','TeamVoicePrefix','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromAccount','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','exports','sequelize','jstz','determine','defaultsDeep','xcall','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','username','password','options','database','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','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','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0x25de,0x198));var _0xe25d=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x25de[_0x4c80d7];return _0x3c5095;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xe25d('0x0'));var _=require('lodash');var jstz=require(_0xe25d('0x1'));var timezone=jstz[_0xe25d('0x2')]();config['sequelize']=_[_0xe25d('0x3')](config[_0xe25d('0x0')],{'database':'motion2','username':_0xe25d('0x4'),'password':'xC@LL1234','options':{'host':_0xe25d('0x5'),'port':0xcea,'dialect':_0xe25d('0x6'),'dialectOptions':{'charset':_0xe25d('0x7')},'logging':![],'timezone':timezone[_0xe25d('0x8')](),'define':{'charset':'utf8','collate':_0xe25d('0x9')}}});config[_0xe25d('0xa')]=_['defaultsDeep'](config[_0xe25d('0xa')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xe25d('0x7')},'logging':![],'timezone':timezone[_0xe25d('0x8')](),'define':{'charset':'utf8','collate':_0xe25d('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe25d('0x0')]['database'],config[_0xe25d('0x0')][_0xe25d('0xb')],config['sequelize'][_0xe25d('0xc')],config['sequelize'][_0xe25d('0xd')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe25d('0xa')][_0xe25d('0xe')],config[_0xe25d('0xa')][_0xe25d('0xb')],config['sequelizeHistory'][_0xe25d('0xc')],config['sequelizeHistory'][_0xe25d('0xd')])};db[_0xe25d('0xf')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x11'));db['VoiceChanSpy']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x12'));db[_0xe25d('0x13')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/voiceContext/voiceContext.model');db[_0xe25d('0x14')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x15'));db[_0xe25d('0x16')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xe25d('0x17')]=db['sequelize'][_0xe25d('0x10')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x18'));db[_0xe25d('0x19')]=db[_0xe25d('0x0')]['import'](_0xe25d('0x1a'));db[_0xe25d('0x1b')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x1c'));db[_0xe25d('0x1d')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x1e'));db[_0xe25d('0x1f')]=db['sequelize'][_0xe25d('0x10')]('../api/voiceCallReport/voiceCallReport.model');db[_0xe25d('0x20')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x21'));db['VoiceAgentReport']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x22'));db['VoiceQueueReport']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x23'));db[_0xe25d('0x24')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x25'));db[_0xe25d('0x26')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x27'));db[_0xe25d('0x28')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x29'));db['UserVoiceQueueRt']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x2a'));db[_0xe25d('0x2b')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x2c'));db['UserChatQueue']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x2d'));db[_0xe25d('0x2e')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x2f'));db[_0xe25d('0x30')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x31'));db[_0xe25d('0x32')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/userSmsQueue/userSmsQueue.model');db[_0xe25d('0x33')]=db['sequelize']['import'](_0xe25d('0x34'));db[_0xe25d('0x35')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x36'));db[_0xe25d('0x37')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x38'));db[_0xe25d('0x39')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x3a'));db[_0xe25d('0x3b')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x3c'));db[_0xe25d('0x3d')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/mailQueue/mailQueue.model');db[_0xe25d('0x3e')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x3f'));db[_0xe25d('0x40')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x41'));db[_0xe25d('0x42')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x43'));db['MailApplication']=db[_0xe25d('0x0')]['import'](_0xe25d('0x44'));db[_0xe25d('0x45')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x46'));db['Dashboard']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x47'));db[_0xe25d('0x48')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x49'));db[_0xe25d('0x4a')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x4b'));db[_0xe25d('0x4c')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x4d'));db[_0xe25d('0x4e')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x4f'));db[_0xe25d('0x50')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x51'));db['FaxQueue']=db[_0xe25d('0x0')]['import'](_0xe25d('0x52'));db['FaxQueueReport']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x53'));db[_0xe25d('0x54')]=db['sequelize']['import']('../api/smsAccount/smsAccount.model');db[_0xe25d('0x55')]=db['sequelize'][_0xe25d('0x10')]('../api/smsApplication/smsApplication.model');db[_0xe25d('0x56')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x57'));db[_0xe25d('0x58')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x59'));db['SmsQueue']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x5a'));db[_0xe25d('0x5b')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/openchannelAccount/openchannelAccount.model');db[_0xe25d('0x5c')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x5d'));db[_0xe25d('0x5e')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x5f'));db[_0xe25d('0x60')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x61'));db['OpenchannelQueue']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x62'));db['ChatWebsite']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x63'));db['OpenchannelQueueReport']=db['sequelize'][_0xe25d('0x10')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xe25d('0x64')]=db['sequelize'][_0xe25d('0x10')]('../api/chatApplication/chatApplication.model');db[_0xe25d('0x65')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/chatInteraction/chatInteraction.model');db[_0xe25d('0x66')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x67'));db[_0xe25d('0x68')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x69'));db[_0xe25d('0x6a')]=db[_0xe25d('0x0')]['import']('../api/chatQueue/chatQueue.model');db[_0xe25d('0x6b')]=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x6c'));db[_0xe25d('0x6d')]=db[_0xe25d('0x0')]['import'](_0xe25d('0x6e'));db['CmContact']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x6f'));db[_0xe25d('0x70')]=db['sequelize']['import']('../api/cmHopper/cmHopper.model');db[_0xe25d('0x71')]=db['sequelize']['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0xe25d('0x72')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x73'));db[_0xe25d('0x74')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x75'));db[_0xe25d('0x76')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x77'));db['CmCustomField']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x78'));db['Action']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x79'));db[_0xe25d('0x7a')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x7b'));db[_0xe25d('0x7c')]=db['sequelize']['import'](_0xe25d('0x7d'));db['Disposition']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x7e'));db['Condition']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x7f'));db['Interval']=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/interval/interval.model');db['Pause']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x80'));db[_0xe25d('0x81')]=db['sequelize'][_0xe25d('0x10')]('../api/cdr/cdr.model');db[_0xe25d('0x82')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x83'));db[_0xe25d('0x84')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x85'));db['Sound']=db[_0xe25d('0x0')]['import']('../api/sound/sound.model');db[_0xe25d('0x86')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x87'));db[_0xe25d('0x88')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x89'));db[_0xe25d('0x8a')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x8b'));db[_0xe25d('0x8c')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x8d'));db[_0xe25d('0x8e')]=db['sequelize']['import']('../api/template/template.model');db[_0xe25d('0x8f')]=db['sequelize']['import'](_0xe25d('0x90'));db[_0xe25d('0x91')]=db[_0xe25d('0x0')]['import'](_0xe25d('0x92'));db['Integration']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x93'));db['IntegrationReport']=db[_0xe25d('0x0')]['import']('../api/integrationReport/integrationReport.model');db[_0xe25d('0x94')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x95'));db[_0xe25d('0x96')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x97'));db[_0xe25d('0x98')]=db[_0xe25d('0x0')]['import'](_0xe25d('0x99'));db['AnalyticMetric']=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/analyticMetric/analyticMetric.model');db[_0xe25d('0x9a')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xe25d('0x9b')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x9c'));db[_0xe25d('0x9d')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x9e'));db['SalesforceConfiguration']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x9f'));db[_0xe25d('0xa0')]=db[_0xe25d('0x0')]['import'](_0xe25d('0xa1'));db[_0xe25d('0xa2')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xa3'));db[_0xe25d('0xa4')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xa5'));db[_0xe25d('0xa6')]=db[_0xe25d('0x0')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xe25d('0xa7')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/intDeskAccount/intDeskAccount.model');db[_0xe25d('0xa8')]=db['sequelize']['import'](_0xe25d('0xa9'));db[_0xe25d('0xaa')]=db['sequelize']['import'](_0xe25d('0xab'));db[_0xe25d('0xac')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xad'));db[_0xe25d('0xae')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xaf'));db[_0xe25d('0xb0')]=db[_0xe25d('0x0')]['import'](_0xe25d('0xb1'));db['ZendeskAccount']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xb2'));db[_0xe25d('0xb3')]=db[_0xe25d('0x0')]['import'](_0xe25d('0xb4'));db[_0xe25d('0xb5')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xb6'));db[_0xe25d('0xb7')]=db[_0xe25d('0x0')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xe25d('0xb8')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xb9'));db['FreshdeskField']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xba'));db[_0xe25d('0xbb')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xbc'));db['VtigerConfiguration']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xbd'));db[_0xe25d('0xbe')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xbf'));db[_0xe25d('0xc0')]=db['sequelize']['import'](_0xe25d('0xc1'));db[_0xe25d('0xc2')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xc3'));db['ServicenowField']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xc4'));db[_0xe25d('0xc5')]=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0xe25d('0x0')]['import'](_0xe25d('0xc6'));db[_0xe25d('0xc7')]=db[_0xe25d('0x0')]['import'](_0xe25d('0xc8'));db['FreshsalesAccount']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xc9'));db[_0xe25d('0xca')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xcb'));db['FreshsalesField']=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db['sequelize'][_0xe25d('0x10')]('../api/integration/integration.model');db[_0xe25d('0xcc')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xcd'));db[_0xe25d('0xce')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xcf'));db[_0xe25d('0xd0')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xe25d('0xd1')]=db['sequelize'][_0xe25d('0x10')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xe25d('0xd2')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xd3'));db[_0xe25d('0xd4')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xd5'));db[_0xe25d('0xd6')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xd7'));db['SquareReport']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xd8'));db['SquareDetailsReport']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xd9'));db[_0xe25d('0xda')]=db[_0xe25d('0x0')]['import'](_0xe25d('0xdb'));db['Setting']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xdc'));db[_0xe25d('0xdd')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xde'));db[_0xe25d('0xdf')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xe0'));db[_0xe25d('0xe1')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/squareRecording/squareRecording.model');db[_0xe25d('0xe2')]=db['sequelize'][_0xe25d('0x10')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xe3'));db[_0xe25d('0xe4')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xe5'));db[_0xe25d('0xe6')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xe7'));db['Migration']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xe8'));db[_0xe25d('0xe9')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xea'));db[_0xe25d('0xeb')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xec'));db[_0xe25d('0xed')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/mailTransferReport/mailTransferReport.model');db[_0xe25d('0xee')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xef'));db[_0xe25d('0xf0')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xf1'));db[_0xe25d('0xf2')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xf3'));db[_0xe25d('0xf4')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xf5'));db['CmList']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xf6'));db[_0xe25d('0xf7')]=db['sequelize'][_0xe25d('0x10')](_0xe25d('0xf8'));db[_0xe25d('0xf9')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xfa'));db[_0xe25d('0xfb')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xfc'));db['UserProfileResource']=db[_0xe25d('0x0')]['import']('../api/userProfileResource/userProfileResource.model');db[_0xe25d('0xfd')]=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/userNotification/userNotification.model');db[_0xe25d('0xfe')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0xff'));db['WhatsappApplication']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x100'));db['WhatsappInteraction']=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xe25d('0x101')]=db['sequelize'][_0xe25d('0x10')]('../api/whatsappMessage/whatsappMessage.model');db[_0xe25d('0x102')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x103'));db['WhatsappTransferReport']=db[_0xe25d('0x0')][_0xe25d('0x10')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x104'));db[_0xe25d('0x105')]=db[_0xe25d('0x0')]['import'](_0xe25d('0x106'));db['TeamVoiceQueue']=db['sequelize'][_0xe25d('0x10')](_0xe25d('0x107'));db['TeamVoicePrefix']=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x108'));db[_0xe25d('0x109')]=db[_0xe25d('0x0')][_0xe25d('0x10')](_0xe25d('0x10a'));db[_0xe25d('0x10b')]=db['sequelize']['import'](_0xe25d('0x10c'));db[_0xe25d('0xf')][_0xe25d('0x10d')](db[_0xe25d('0x1b')],{'as':_0xe25d('0x1b'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x10d')](db['UserSetting'],{'as':_0xe25d('0x110'),'onDelete':_0xe25d('0x10e'),'foreignKey':'UserId'});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0x112')],{'as':_0xe25d('0x113'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0x114')],{'as':'VoiceQueuesRt','foreignKey':_0xe25d('0x10f')});db['User']['hasMany'](db['VoiceExtension'],{'as':_0xe25d('0x115'),'onDelete':_0xe25d('0x10e'),'hooks':!![]});db['User'][_0xe25d('0x111')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')]['hasMany'](db[_0xe25d('0x74')],{'as':_0xe25d('0x116'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0x76')],{'as':_0xe25d('0x76'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x111')](db['ChatInteraction'],{'as':_0xe25d('0x117'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0x56')],{'as':_0xe25d('0x118'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0x4e')],{'as':_0xe25d('0x119'),'foreignKey':'UserId'});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0x40')],{'as':'MailInteractions','foreignKey':_0xe25d('0x10f')});db[_0xe25d('0xf')][_0xe25d('0x111')](db['WhatsappInteraction'],{'as':_0xe25d('0x11a'),'foreignKey':'UserId'});db[_0xe25d('0xf')][_0xe25d('0x111')](db[_0xe25d('0xfd')],{'as':_0xe25d('0x11b'),'foreignKey':_0xe25d('0x11c')});db[_0xe25d('0xf')][_0xe25d('0x11d')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0xe25d('0x11e')});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x6b')],{'as':_0xe25d('0x120'),'through':_0xe25d('0x121')});db[_0xe25d('0xf')]['belongsToMany'](db[_0xe25d('0x122')],{'as':_0xe25d('0x123'),'through':_0xe25d('0x124')});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x125')],{'as':_0xe25d('0x126'),'through':_0xe25d('0x127')});db['User']['belongsToMany'](db[_0xe25d('0x128')],{'through':_0xe25d('0x129')});db['User']['belongsToMany'](db['MailInteraction'],{'as':_0xe25d('0x12a'),'through':'user_has_mail_interactions'});db['User'][_0xe25d('0x11f')](db[_0xe25d('0x65')],{'as':_0xe25d('0x117'),'through':_0xe25d('0x12b')});db[_0xe25d('0xf')]['belongsToMany'](db[_0xe25d('0x4e')],{'as':_0xe25d('0x119'),'through':_0xe25d('0x12c')});db['User'][_0xe25d('0x11f')](db[_0xe25d('0x56')],{'as':_0xe25d('0x118'),'through':_0xe25d('0x12d')});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x5e')],{'as':'OpenchannelInteractions','through':_0xe25d('0x12e')});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x12f')],{'as':'WhatsappInteractions','through':_0xe25d('0x130')});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x17')],{'as':_0xe25d('0x131'),'through':_0xe25d('0x2b'),'required':![]});db[_0xe25d('0xf')][_0xe25d('0x11f')](db['VoicePrefix'],{'as':_0xe25d('0x132'),'through':_0xe25d('0x109'),'required':![]});db[_0xe25d('0xf')]['belongsToMany'](db[_0xe25d('0x3d')],{'as':_0xe25d('0x133'),'through':_0xe25d('0x2e'),'required':![]});db['User'][_0xe25d('0x11f')](db[_0xe25d('0x6a')],{'as':_0xe25d('0x134'),'through':_0xe25d('0x135'),'required':![],'hooks':!![]});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x136')],{'as':_0xe25d('0x137'),'through':_0xe25d('0x30'),'required':![]});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x138')],{'as':_0xe25d('0x139'),'through':'UserSmsQueue','required':![]});db['User'][_0xe25d('0x11f')](db[_0xe25d('0x13a')],{'as':_0xe25d('0x13b'),'through':_0xe25d('0x33'),'required':![]});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x13c')],{'as':_0xe25d('0x13d'),'through':'UserWhatsappQueue','required':![]});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x125')],{'through':'cm_user_has_lists'});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0x13e')],{'as':_0xe25d('0x13f'),'through':'user_has_chat_websites'});db['User'][_0xe25d('0x11f')](db['FaxAccount'],{'as':_0xe25d('0x140'),'through':'user_has_fax_accounts'});db[_0xe25d('0xf')]['belongsToMany'](db[_0xe25d('0x3b')],{'as':'MailAccounts','through':_0xe25d('0x141')});db['User']['belongsToMany'](db[_0xe25d('0x5b')],{'as':_0xe25d('0x142'),'through':_0xe25d('0x143')});db['User'][_0xe25d('0x11f')](db['SmsAccount'],{'as':_0xe25d('0x144'),'through':_0xe25d('0x145')});db['User']['belongsToMany'](db[_0xe25d('0xfe')],{'as':_0xe25d('0x146'),'through':_0xe25d('0x147')});db[_0xe25d('0xf')][_0xe25d('0x11f')](db[_0xe25d('0xdf')],{'as':_0xe25d('0x148'),'through':'user_has_square_projects'});db[_0xe25d('0x149')]['hasMany'](db[_0xe25d('0x14')],{'as':_0xe25d('0x14a'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x14b')});db[_0xe25d('0x13')][_0xe25d('0x111')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xe25d('0x14')]['hasMany'](db['VoiceExtension'],{'as':_0xe25d('0x14c'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x16')][_0xe25d('0x11f')](db[_0xe25d('0x14d')],{'as':_0xe25d('0x14e'),'through':_0xe25d('0x14f')});db['VoiceQueue'][_0xe25d('0x111')](db[_0xe25d('0x114')],{'as':_0xe25d('0x150'),'foreignKey':_0xe25d('0x151')});db[_0xe25d('0x17')][_0xe25d('0x111')](db[_0xe25d('0x70')],{'as':_0xe25d('0x152'),'foreignKey':_0xe25d('0x151')});db[_0xe25d('0x17')]['hasMany'](db[_0xe25d('0x72')],{'as':_0xe25d('0x153'),'foreignKey':_0xe25d('0x151')});db['VoiceQueue'][_0xe25d('0x111')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xe25d('0x151')});db[_0xe25d('0x17')][_0xe25d('0x111')](db[_0xe25d('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xe25d('0x151')});db[_0xe25d('0x17')][_0xe25d('0x111')](db[_0xe25d('0x71')],{'as':_0xe25d('0x154'),'foreignKey':_0xe25d('0x151')});db['VoiceQueue'][_0xe25d('0x111')](db[_0xe25d('0xd4')],{'as':'JscriptySessions','foreignKey':_0xe25d('0x151')});db[_0xe25d('0x17')][_0xe25d('0x11d')](db[_0xe25d('0x26')],{'as':_0xe25d('0x26'),'foreignKey':_0xe25d('0x155')});db[_0xe25d('0x17')][_0xe25d('0x11d')](db[_0xe25d('0x26')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xe25d('0x17')][_0xe25d('0x11d')](db['Interval'],{'as':_0xe25d('0x156'),'foreignKey':_0xe25d('0x157')});db['VoiceQueue']['belongsTo'](db[_0xe25d('0x158')],{'as':'mandatoryDispositionPause','foreignKey':_0xe25d('0x159')});db['VoiceQueue']['belongsToMany'](db[_0xe25d('0x125')],{'as':_0xe25d('0x126'),'through':_0xe25d('0x15a')});db[_0xe25d('0x17')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x2b')});db[_0xe25d('0x17')][_0xe25d('0x11f')](db[_0xe25d('0x128')],{'as':_0xe25d('0x15c'),'through':_0xe25d('0x15d')});db[_0xe25d('0x17')][_0xe25d('0x11f')](db[_0xe25d('0x125')],{'as':'BlackLists','through':_0xe25d('0x15e')});db[_0xe25d('0x112')]['belongsTo'](db[_0xe25d('0xf')],{'as':_0xe25d('0xf'),'foreignKey':_0xe25d('0x10f')});db['ScreenRecording'][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'as':_0xe25d('0xf'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0x1b')]['hasMany'](db[_0xe25d('0x1d')],{'as':_0xe25d('0x15f'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x160'),'sourceKey':_0xe25d('0x161')});db[_0xe25d('0x1d')][_0xe25d('0x11d')](db[_0xe25d('0x1b')],{'foreignKey':_0xe25d('0x160'),'targetKey':_0xe25d('0x161')});db[_0xe25d('0x1f')][_0xe25d('0x111')](db[_0xe25d('0x162')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0xe25d('0x1f')][_0xe25d('0x111')](db[_0xe25d('0x163')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xe25d('0x1f')][_0xe25d('0x11d')](db['User'],{'as':_0xe25d('0xf'),'foreignKey':_0xe25d('0x10f')});db['VoiceCallReport'][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165')});db['MailServerIn'][_0xe25d('0x11d')](db[_0xe25d('0x3b')],{'as':_0xe25d('0x3b'),'foreignKey':_0xe25d('0x166')});db[_0xe25d('0x37')][_0xe25d('0x11d')](db[_0xe25d('0x105')],{'as':_0xe25d('0x105'),'foreignKey':'CloudProviderId','onDelete':_0xe25d('0x167')});db[_0xe25d('0x39')]['belongsTo'](db[_0xe25d('0x3b')],{'as':_0xe25d('0x3b'),'foreignKey':_0xe25d('0x166')});db[_0xe25d('0x39')][_0xe25d('0x11d')](db[_0xe25d('0x105')],{'as':_0xe25d('0x105'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db['MailAccount'][_0xe25d('0x10d')](db[_0xe25d('0x37')],{'as':_0xe25d('0x168'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x3b')][_0xe25d('0x10d')](db[_0xe25d('0x39')],{'as':_0xe25d('0x169'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x3b')][_0xe25d('0x111')](db[_0xe25d('0x16a')],{'as':'Dispositions','foreignKey':_0xe25d('0x166'),'onDelete':'cascade'});db['MailAccount'][_0xe25d('0x111')](db['CannedAnswer'],{'as':_0xe25d('0x16b'),'foreignKey':_0xe25d('0x166')});db[_0xe25d('0x3b')][_0xe25d('0x111')](db[_0xe25d('0x42')],{'as':_0xe25d('0x15f'),'foreignKey':_0xe25d('0x166')});db['MailAccount'][_0xe25d('0x111')](db[_0xe25d('0x40')],{'as':_0xe25d('0x16c')});db['MailAccount'][_0xe25d('0x111')](db[_0xe25d('0x16d')],{'as':_0xe25d('0x14c')});db['MailAccount'][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':'ListId'});db[_0xe25d('0x3b')][_0xe25d('0x11d')](db['Template'],{'as':'Template','foreignKey':'TemplateId'});db[_0xe25d('0x3b')][_0xe25d('0x11d')](db[_0xe25d('0x158')],{'as':_0xe25d('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe25d('0x3b')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x141')});db[_0xe25d('0x3d')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':'Agents','through':_0xe25d('0x2e')});db['MailQueue'][_0xe25d('0x11f')](db[_0xe25d('0x128')],{'through':_0xe25d('0x170'),'as':_0xe25d('0x15c')});db[_0xe25d('0x40')][_0xe25d('0x111')](db[_0xe25d('0x42')],{'as':'Messages','onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x171')});db['MailInteraction']['belongsTo'](db[_0xe25d('0x3b')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x166')});db[_0xe25d('0x40')]['belongsTo'](db[_0xe25d('0x122')],{'as':'Contact','foreignKey':_0xe25d('0x165')});db[_0xe25d('0x40')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'as':_0xe25d('0x173'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0x40')][_0xe25d('0x11f')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xe25d('0x174')});db[_0xe25d('0x40')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':_0xe25d('0x175'),'as':_0xe25d('0x176')});db[_0xe25d('0x40')][_0xe25d('0x11f')](db['User'],{'as':_0xe25d('0x177'),'through':_0xe25d('0x178'),'foreignKey':'MailInteractionId'});db[_0xe25d('0x42')][_0xe25d('0x111')](db['Attachment'],{'as':_0xe25d('0x179'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x42')][_0xe25d('0x11d')](db['User'],{'as':_0xe25d('0xf')});db[_0xe25d('0x42')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'onDelete':'cascade','as':_0xe25d('0x164')});db['MailMessage'][_0xe25d('0x11d')](db['MailInteraction'],{'as':_0xe25d('0x17a'),'foreignKey':_0xe25d('0x171')});db['MailMessage'][_0xe25d('0x11d')](db[_0xe25d('0x3b')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x166')});db[_0xe25d('0x42')][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{'as':_0xe25d('0x13e'),'foreignKey':'ChatWebsiteId'});db['MailMessage'][_0xe25d('0x11d')](db[_0xe25d('0x68')],{'as':'ChatOfflineMessage','foreignKey':_0xe25d('0x17b')});db['MailApplication'][_0xe25d('0x11d')](db['User'],{'onDelete':_0xe25d('0x167')});db['MailApplication'][_0xe25d('0x11d')](db['MailQueue'],{'onDelete':'restrict'});db[_0xe25d('0x16d')][_0xe25d('0x11d')](db[_0xe25d('0x3b')],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x16d')][_0xe25d('0x11d')](db[_0xe25d('0x156')],{'onDelete':'restrict','foreignKey':_0xe25d('0x157')});db['MailApplication'][_0xe25d('0x11d')](db[_0xe25d('0x86')],{'onDelete':_0xe25d('0x167'),'foreignKey':_0xe25d('0x17c')});db[_0xe25d('0x45')][_0xe25d('0x11d')](db[_0xe25d('0x3b')],{});db[_0xe25d('0x45')][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d')});db[_0xe25d('0x45')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165')});db[_0xe25d('0x45')][_0xe25d('0x11d')](db[_0xe25d('0x40')],{});db['MailQueueReport'][_0xe25d('0x11d')](db[_0xe25d('0x42')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db[_0xe25d('0x45')][_0xe25d('0x11d')](db['MailQueue'],{});db[_0xe25d('0x17e')][_0xe25d('0x111')](db[_0xe25d('0x48')],{'as':_0xe25d('0x17f'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x4a')][_0xe25d('0x111')](db[_0xe25d('0x16a')],{'as':_0xe25d('0x180'),'foreignKey':_0xe25d('0x181'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x4a')]['hasMany'](db[_0xe25d('0x7c')],{'as':_0xe25d('0x16b'),'foreignKey':_0xe25d('0x181')});db[_0xe25d('0x4a')][_0xe25d('0x111')](db[_0xe25d('0x4e')],{'as':_0xe25d('0x16c')});db['FaxAccount']['hasMany'](db['FaxApplication'],{'as':_0xe25d('0x14c')});db[_0xe25d('0x4a')][_0xe25d('0x111')](db[_0xe25d('0x14')],{'as':_0xe25d('0x182'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x4a')][_0xe25d('0x111')](db['FaxMessage'],{'as':_0xe25d('0x15f')});db[_0xe25d('0x4a')][_0xe25d('0x11d')](db[_0xe25d('0x26')],{'as':_0xe25d('0x26')});db[_0xe25d('0x4a')][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':'List','foreignKey':_0xe25d('0x17d')});db[_0xe25d('0x4a')][_0xe25d('0x11d')](db[_0xe25d('0x158')],{'as':_0xe25d('0x16f'),'foreignKey':_0xe25d('0x159')});db[_0xe25d('0x4a')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x183')});db[_0xe25d('0x4c')]['belongsTo'](db[_0xe25d('0xf')],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x4c')][_0xe25d('0x11d')](db[_0xe25d('0x136')],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x4c')][_0xe25d('0x11d')](db['FaxAccount'],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x4c')][_0xe25d('0x11d')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xe25d('0x17c')});db['FaxInteraction']['hasMany'](db[_0xe25d('0x50')],{'as':_0xe25d('0x15f'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x184')});db['FaxInteraction'][_0xe25d('0x11d')](db[_0xe25d('0x4a')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x181')});db[_0xe25d('0x4e')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165')});db[_0xe25d('0x4e')]['belongsTo'](db['User'],{'as':_0xe25d('0x173'),'foreignKey':'UserId'});db[_0xe25d('0x4e')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':'fax_interaction_has_tags','as':_0xe25d('0x174')});db['FaxInteraction'][_0xe25d('0x11f')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xe25d('0x176')});db[_0xe25d('0x4e')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x177'),'through':'user_has_fax_interactions','foreignKey':_0xe25d('0x184')});db[_0xe25d('0x50')]['belongsTo'](db[_0xe25d('0xf')],{'onDelete':_0xe25d('0x10e'),'as':'User'});db[_0xe25d('0x50')][_0xe25d('0x11d')](db[_0xe25d('0x4e')],{'as':_0xe25d('0x17a'),'foreignKey':_0xe25d('0x184')});db[_0xe25d('0x50')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0x164')});db[_0xe25d('0x50')][_0xe25d('0x11d')](db[_0xe25d('0xe9')],{'as':_0xe25d('0xe9'),'foreignKey':_0xe25d('0x185')});db[_0xe25d('0x50')]['belongsTo'](db[_0xe25d('0x4a')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x181')});db[_0xe25d('0x136')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':'UserFaxQueue'});db['FaxQueue'][_0xe25d('0x11f')](db[_0xe25d('0x128')],{'through':_0xe25d('0x186'),'as':'Teams'});db[_0xe25d('0x187')]['belongsTo'](db[_0xe25d('0x4a')],{});db['FaxQueueReport'][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d')});db[_0xe25d('0x187')]['belongsTo'](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':'ContactId'});db[_0xe25d('0x187')][_0xe25d('0x11d')](db['FaxInteraction'],{});db[_0xe25d('0x187')]['belongsTo'](db[_0xe25d('0x50')],{});db[_0xe25d('0x187')]['belongsTo'](db[_0xe25d('0xf')],{});db[_0xe25d('0x187')][_0xe25d('0x11d')](db[_0xe25d('0x136')],{});db[_0xe25d('0x54')][_0xe25d('0x111')](db['Disposition'],{'as':_0xe25d('0x180'),'foreignKey':_0xe25d('0x188'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x54')]['hasMany'](db[_0xe25d('0x7c')],{'as':_0xe25d('0x16b'),'foreignKey':_0xe25d('0x188')});db['SmsAccount'][_0xe25d('0x111')](db[_0xe25d('0x58')],{'as':_0xe25d('0x15f'),'foreignKey':'SmsAccountId'});db[_0xe25d('0x54')]['hasMany'](db[_0xe25d('0x56')],{'as':_0xe25d('0x16c')});db[_0xe25d('0x54')][_0xe25d('0x111')](db[_0xe25d('0x55')],{'as':_0xe25d('0x14c')});db[_0xe25d('0x54')][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':'ListId'});db[_0xe25d('0x54')][_0xe25d('0x11d')](db['Pause'],{'as':_0xe25d('0x16f'),'foreignKey':_0xe25d('0x159')});db[_0xe25d('0x54')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x145')});db[_0xe25d('0x55')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'onDelete':'restrict'});db[_0xe25d('0x55')][_0xe25d('0x11d')](db[_0xe25d('0x138')],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x55')]['belongsTo'](db['SmsAccount'],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x55')][_0xe25d('0x11d')](db[_0xe25d('0x156')],{'onDelete':_0xe25d('0x167'),'foreignKey':_0xe25d('0x157')});db['SmsApplication']['belongsTo'](db[_0xe25d('0x86')],{'onDelete':'restrict','foreignKey':_0xe25d('0x17c')});db[_0xe25d('0x56')]['hasMany'](db[_0xe25d('0x58')],{'as':_0xe25d('0x15f'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x189')});db[_0xe25d('0x56')][_0xe25d('0x11d')](db[_0xe25d('0x54')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x188')});db['SmsInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xe25d('0x165')});db[_0xe25d('0x56')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'as':_0xe25d('0x173'),'foreignKey':'UserId'});db[_0xe25d('0x56')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':_0xe25d('0x18a'),'as':_0xe25d('0x174')});db[_0xe25d('0x56')][_0xe25d('0x11f')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xe25d('0x176')});db['SmsInteraction'][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x177'),'through':_0xe25d('0x12d'),'foreignKey':_0xe25d('0x189')});db[_0xe25d('0x58')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'as':_0xe25d('0xf')});db[_0xe25d('0x58')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'onDelete':'cascade','as':'Contact'});db[_0xe25d('0x58')][_0xe25d('0x11d')](db['SmsInteraction'],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0x17a'),'foreignKey':_0xe25d('0x189')});db[_0xe25d('0x58')][_0xe25d('0x11d')](db[_0xe25d('0x54')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x188')});db[_0xe25d('0x138')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x32'),'foreignKey':_0xe25d('0x18b')});db[_0xe25d('0x138')]['belongsToMany'](db[_0xe25d('0x128')],{'through':_0xe25d('0x18c'),'as':_0xe25d('0x15c')});db[_0xe25d('0x5b')][_0xe25d('0x111')](db['Disposition'],{'as':_0xe25d('0x180'),'foreignKey':_0xe25d('0x18d'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x5b')][_0xe25d('0x111')](db[_0xe25d('0x7c')],{'as':_0xe25d('0x16b'),'foreignKey':_0xe25d('0x18d')});db['OpenchannelAccount']['hasMany'](db[_0xe25d('0x5e')],{'as':_0xe25d('0x16c'),'foreignKey':_0xe25d('0x18d')});db[_0xe25d('0x5b')][_0xe25d('0x111')](db[_0xe25d('0x60')],{'as':_0xe25d('0x15f'),'foreignKey':_0xe25d('0x18d')});db[_0xe25d('0x5b')]['hasMany'](db[_0xe25d('0x5c')],{'as':_0xe25d('0x14c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d')});db['OpenchannelAccount'][_0xe25d('0x11d')](db[_0xe25d('0x158')],{'as':_0xe25d('0x16f'),'foreignKey':_0xe25d('0x159')});db['OpenchannelAccount'][_0xe25d('0x11f')](db['User'],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x143')});db[_0xe25d('0x5c')][_0xe25d('0x11d')](db['User'],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x5c')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0xe25d('0x18e')});db[_0xe25d('0x5c')][_0xe25d('0x11d')](db[_0xe25d('0x5b')],{'onDelete':'restrict','foreignKey':_0xe25d('0x18d')});db[_0xe25d('0x5c')][_0xe25d('0x11d')](db[_0xe25d('0x156')],{'onDelete':_0xe25d('0x167'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xe25d('0x11d')](db[_0xe25d('0x86')],{'onDelete':_0xe25d('0x167'),'foreignKey':_0xe25d('0x17c')});db[_0xe25d('0x5e')][_0xe25d('0x111')](db[_0xe25d('0x60')],{'as':_0xe25d('0x15f'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x18f')});db[_0xe25d('0x5e')][_0xe25d('0x11d')](db[_0xe25d('0x5b')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x18d')});db[_0xe25d('0x5e')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':'ContactId'});db[_0xe25d('0x5e')][_0xe25d('0x11d')](db['User'],{'as':_0xe25d('0x173'),'foreignKey':_0xe25d('0x10f')});db['OpenchannelInteraction'][_0xe25d('0x11f')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xe25d('0x174')});db[_0xe25d('0x5e')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':_0xe25d('0x190'),'as':'ThroughTags'});db[_0xe25d('0x5e')][_0xe25d('0x11f')](db['User'],{'as':_0xe25d('0x177'),'through':_0xe25d('0x12e'),'foreignKey':_0xe25d('0x18f')});db[_0xe25d('0x60')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0xf')});db[_0xe25d('0x60')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0x164')});db[_0xe25d('0x60')][_0xe25d('0x11d')](db[_0xe25d('0x5e')],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0x17a'),'foreignKey':_0xe25d('0x18f')});db[_0xe25d('0x60')]['belongsTo'](db['Attachment'],{'as':_0xe25d('0xe9'),'foreignKey':'AttachmentId'});db[_0xe25d('0x60')][_0xe25d('0x11d')](db[_0xe25d('0x5b')],{'as':_0xe25d('0x172'),'foreignKey':'OpenchannelAccountId'});db[_0xe25d('0x13a')][_0xe25d('0x11f')](db['User'],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x33'),'foreignKey':_0xe25d('0x18e')});db[_0xe25d('0x13a')]['belongsToMany'](db[_0xe25d('0x128')],{'through':_0xe25d('0x191'),'as':_0xe25d('0x15c')});db[_0xe25d('0x13e')][_0xe25d('0x111')](db[_0xe25d('0x16a')],{'as':'Dispositions','foreignKey':_0xe25d('0x192'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x13e')][_0xe25d('0x111')](db['CannedAnswer'],{'as':_0xe25d('0x16b'),'foreignKey':'ChatWebsiteId'});db[_0xe25d('0x13e')][_0xe25d('0x111')](db[_0xe25d('0x193')],{'as':_0xe25d('0x194')});db['ChatWebsite']['hasMany'](db['ChatInteraction'],{'as':'Interactions'});db['ChatWebsite']['hasMany'](db['ChatApplication'],{'as':_0xe25d('0x14c')});db['ChatWebsite']['hasMany'](db[_0xe25d('0x66')],{'as':_0xe25d('0x15f')});db[_0xe25d('0x13e')][_0xe25d('0x11d')](db['CmList'],{'as':_0xe25d('0x16e'),'foreignKey':'ListId'});db['ChatWebsite'][_0xe25d('0x11d')](db['Interval'],{'as':_0xe25d('0x156'),'foreignKey':_0xe25d('0x157')});db[_0xe25d('0x13e')][_0xe25d('0x11d')](db[_0xe25d('0x3b')],{'as':_0xe25d('0x3b'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xe25d('0x11d')](db[_0xe25d('0x158')],{'as':'mandatoryDispositionPause','foreignKey':_0xe25d('0x159')});db[_0xe25d('0x13e')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x195')});db[_0xe25d('0x196')]['belongsTo'](db[_0xe25d('0x5b')],{});db[_0xe25d('0x196')][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':'List','foreignKey':'ListId'});db[_0xe25d('0x196')]['belongsTo'](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165')});db['OpenchannelQueueReport'][_0xe25d('0x11d')](db['OpenchannelInteraction'],{});db[_0xe25d('0x196')]['belongsTo'](db[_0xe25d('0x60')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xe25d('0xf')],{});db[_0xe25d('0x196')][_0xe25d('0x11d')](db[_0xe25d('0x13a')],{});db['ChatApplication'][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'as':_0xe25d('0x197'),'foreignKey':'UserId','onDelete':_0xe25d('0x167')});db['ChatApplication'][_0xe25d('0x11d')](db['ChatQueue'],{'as':_0xe25d('0x198'),'foreignKey':_0xe25d('0x199'),'onDelete':_0xe25d('0x167')});db[_0xe25d('0x64')][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{'as':'Website','foreignKey':_0xe25d('0x192'),'onDelete':_0xe25d('0x167')});db['ChatApplication']['belongsTo'](db[_0xe25d('0x86')],{'onDelete':'restrict','foreignKey':_0xe25d('0x17c')});db['ChatInteraction'][_0xe25d('0x111')](db[_0xe25d('0x66')],{'as':_0xe25d('0x15f'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x19a')});db['ChatInteraction']['belongsTo'](db[_0xe25d('0x13e')],{'as':'Account','foreignKey':_0xe25d('0x192')});db[_0xe25d('0x65')]['belongsTo'](db['CmContact'],{'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165')});db['ChatInteraction']['belongsTo'](db[_0xe25d('0xf')],{'as':_0xe25d('0x173'),'foreignKey':_0xe25d('0x10f')});db[_0xe25d('0x65')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':_0xe25d('0x19b'),'as':_0xe25d('0x174')});db['ChatInteraction'][_0xe25d('0x11f')](db['Tag'],{'through':_0xe25d('0x19b'),'as':_0xe25d('0x176')});db[_0xe25d('0x65')]['belongsToMany'](db[_0xe25d('0xf')],{'as':_0xe25d('0x177'),'through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0xf')});db[_0xe25d('0x66')]['belongsTo'](db['CmContact'],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165')});db['ChatMessage'][_0xe25d('0x11d')](db[_0xe25d('0x65')],{'onDelete':_0xe25d('0x10e'),'as':'Interaction','foreignKey':_0xe25d('0x19a')});db['ChatMessage'][_0xe25d('0x11d')](db[_0xe25d('0xe9')],{'as':_0xe25d('0xe9'),'foreignKey':'AttachmentId'});db[_0xe25d('0x66')][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x192')});db[_0xe25d('0x68')][_0xe25d('0x111')](db[_0xe25d('0xe9')],{'as':'Attachments','foreignKey':_0xe25d('0x17b'),'onDelete':_0xe25d('0x10e'),'hooks':!![]});db[_0xe25d('0x68')]['belongsTo'](db[_0xe25d('0x122')],{'onDelete':_0xe25d('0x10e'),'as':'Contact','foreignKey':_0xe25d('0x165')});db[_0xe25d('0x68')][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x192')});db[_0xe25d('0x6a')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x135'),'hooks':!![]});db[_0xe25d('0x6a')]['belongsToMany'](db['Team'],{'through':_0xe25d('0x19c'),'as':_0xe25d('0x15c')});db[_0xe25d('0x6b')]['hasMany'](db[_0xe25d('0xd0')],{'as':_0xe25d('0x15f'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xe25d('0x6b')]['belongsToMany'](db[_0xe25d('0xf')],{'as':_0xe25d('0x150'),'through':_0xe25d('0x121')});db['ChatProactiveAction'][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{'as':'Website','foreignKey':_0xe25d('0x192')});db['CmCompany'][_0xe25d('0x111')](db['CmContact'],{'as':_0xe25d('0x123'),'foreignKey':'CompanyId'});db[_0xe25d('0x122')]['hasMany'](db[_0xe25d('0x8a')],{'as':_0xe25d('0x19d'),'foreignKey':'CmContactId'});db[_0xe25d('0x122')][_0xe25d('0x111')](db[_0xe25d('0x70')],{'as':'Hoppers','foreignKey':_0xe25d('0x165')});db['CmContact']['hasMany'](db['CmHopperFinal'],{'as':_0xe25d('0x153'),'foreignKey':_0xe25d('0x165')});db[_0xe25d('0x122')][_0xe25d('0x111')](db[_0xe25d('0x74')],{'as':_0xe25d('0x19e'),'foreignKey':_0xe25d('0x165')});db[_0xe25d('0x122')]['hasMany'](db[_0xe25d('0x76')],{'as':_0xe25d('0x76'),'foreignKey':'ContactId'});db[_0xe25d('0x122')][_0xe25d('0x111')](db[_0xe25d('0xd4')],{'as':_0xe25d('0x19f'),'foreignKey':_0xe25d('0x165')});db[_0xe25d('0x122')]['hasMany'](db[_0xe25d('0x5e')],{'as':_0xe25d('0x1a0'),'foreignKey':_0xe25d('0x165'),'onDelete':_0xe25d('0x167')});db[_0xe25d('0x122')]['hasMany'](db[_0xe25d('0x65')],{'as':_0xe25d('0x117'),'foreignKey':_0xe25d('0x165'),'onDelete':_0xe25d('0x167')});db[_0xe25d('0x122')][_0xe25d('0x111')](db[_0xe25d('0x56')],{'as':_0xe25d('0x118'),'foreignKey':_0xe25d('0x165'),'onDelete':_0xe25d('0x167')});db[_0xe25d('0x122')][_0xe25d('0x111')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0xe25d('0x167')});db[_0xe25d('0x122')][_0xe25d('0x111')](db[_0xe25d('0x40')],{'as':_0xe25d('0x12a'),'foreignKey':_0xe25d('0x165'),'onDelete':_0xe25d('0x167')});db[_0xe25d('0x122')]['belongsTo'](db[_0xe25d('0x6d')],{'as':'Company','foreignKey':'CompanyId'});db['CmContact'][_0xe25d('0x11d')](db['CmList'],{'as':_0xe25d('0x16e'),'foreignKey':'ListId','onDelete':_0xe25d('0x10e')});db[_0xe25d('0x122')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x177'),'through':_0xe25d('0x124')});db[_0xe25d('0x122')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'as':_0xe25d('0x174'),'through':_0xe25d('0x1a1')});db[_0xe25d('0x122')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':'cm_contact_has_tags','as':_0xe25d('0x176')});db[_0xe25d('0x70')][_0xe25d('0x111')](db[_0xe25d('0x8c')],{'as':'AdditionalPhones','foreignKey':_0xe25d('0x1a2')});db['CmHopper'][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':'Contact','foreignKey':_0xe25d('0x165'),'onDelete':_0xe25d('0x10e')});db['CmHopper']['belongsTo'](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x70')]['belongsTo'](db[_0xe25d('0xf')],{'as':_0xe25d('0x197'),'foreignKey':_0xe25d('0x10f')});db['CmHopper'][_0xe25d('0x11d')](db[_0xe25d('0x17')],{'as':_0xe25d('0x198'),'foreignKey':'VoiceQueueId','onDelete':_0xe25d('0x10e')});db[_0xe25d('0x70')][_0xe25d('0x11d')](db[_0xe25d('0xe6')],{'as':_0xe25d('0xe6'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xe25d('0x70')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'as':'Owner','foreignKey':_0xe25d('0x1a3')});db[_0xe25d('0x71')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165'),'onDelete':'cascade'});db[_0xe25d('0x71')][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d'),'onDelete':_0xe25d('0x10e')});db['CmHopperBlack'][_0xe25d('0x11d')](db[_0xe25d('0x17')],{'as':_0xe25d('0x198'),'foreignKey':_0xe25d('0x151'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0xe25d('0xe6'),'foreignKey':_0xe25d('0x1a4'),'onDelete':_0xe25d('0x10e')});db['Automation'][_0xe25d('0x111')](db[_0xe25d('0x1a5')],{'as':{'plural':'All','singular':_0xe25d('0x1a6')},'foreignKey':'AutomationAllId','onDelete':_0xe25d('0x10e'),'hooks':!![]});db['Automation'][_0xe25d('0x111')](db[_0xe25d('0x1a5')],{'as':{'plural':_0xe25d('0x1a7'),'singular':_0xe25d('0x1a8')},'foreignKey':_0xe25d('0x1a9'),'onDelete':_0xe25d('0x10e'),'hooks':!![]});db[_0xe25d('0x7a')][_0xe25d('0x111')](db['Action'],{'as':_0xe25d('0x1aa'),'foreignKey':_0xe25d('0x1ab'),'onDelete':'cascade','hooks':!![]});db[_0xe25d('0x16a')][_0xe25d('0x111')](db[_0xe25d('0x16a')],{'as':_0xe25d('0x180'),'foreignKey':_0xe25d('0x1ac'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0x156')][_0xe25d('0x111')](db[_0xe25d('0x156')],{'as':_0xe25d('0x1ad'),'foreignKey':'IntervalId','onDelete':_0xe25d('0x10e'),'hooks':!![],'required':![]});db[_0xe25d('0x156')][_0xe25d('0x111')](db[_0xe25d('0x14')],{'as':_0xe25d('0x115'),'foreignKey':_0xe25d('0x157'),'onDelete':_0xe25d('0x167')});db[_0xe25d('0x156')][_0xe25d('0x111')](db[_0xe25d('0x16d')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xe25d('0x156')][_0xe25d('0x111')](db[_0xe25d('0x64')],{'as':_0xe25d('0x1ae'),'foreignKey':_0xe25d('0x157')});db[_0xe25d('0x156')][_0xe25d('0x111')](db[_0xe25d('0x4c')],{'as':'FaxApplications','foreignKey':_0xe25d('0x157')});db[_0xe25d('0x156')][_0xe25d('0x111')](db['SmsApplication'],{'as':_0xe25d('0x1af'),'foreignKey':'IntervalId'});db[_0xe25d('0x84')][_0xe25d('0x11d')](db[_0xe25d('0x3b')],{});db[_0xe25d('0x84')][_0xe25d('0x11d')](db[_0xe25d('0x96')],{'foreignKey':_0xe25d('0x1b0')});db[_0xe25d('0x84')][_0xe25d('0x11d')](db['AnalyticCustomReport'],{'foreignKey':_0xe25d('0x1b1')});db['Sound']['belongsToMany'](db[_0xe25d('0x16')],{'as':_0xe25d('0x1b2'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0xe25d('0x86')][_0xe25d('0x11f')](db[_0xe25d('0x122')],{'through':_0xe25d('0x1a1')});db['Tag']['belongsToMany'](db[_0xe25d('0x65')],{'through':_0xe25d('0x19b')});db['Tag'][_0xe25d('0x11f')](db[_0xe25d('0x40')],{'through':'mail_interaction_has_tags'});db[_0xe25d('0x86')][_0xe25d('0x11f')](db['SmsInteraction'],{'through':_0xe25d('0x18a')});db['Tag'][_0xe25d('0x11f')](db[_0xe25d('0x4e')],{'through':_0xe25d('0x1b3')});db[_0xe25d('0x86')][_0xe25d('0x11f')](db[_0xe25d('0x5e')],{'through':_0xe25d('0x190')});db[_0xe25d('0x86')][_0xe25d('0x11f')](db[_0xe25d('0x12f')],{'through':_0xe25d('0x1b4')});db[_0xe25d('0x8a')][_0xe25d('0x11d')](db[_0xe25d('0x88')],{'as':'ItemType','foreignKey':_0xe25d('0x1b5')});db['CmHopperAdditionalPhone'][_0xe25d('0x11d')](db[_0xe25d('0x70')],{'as':_0xe25d('0x1b6'),'foreignKey':'CmHopperId'});db[_0xe25d('0x8a')][_0xe25d('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':_0xe25d('0x1b7')});db['Trigger']['hasMany'](db['Condition'],{'as':{'plural':_0xe25d('0x1b8'),'singular':'AllCondition'},'foreignKey':_0xe25d('0x1b9'),'onDelete':'cascade','hooks':!![]});db[_0xe25d('0x8f')][_0xe25d('0x111')](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0xe25d('0x1ba')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0xe25d('0x8f')][_0xe25d('0x111')](db[_0xe25d('0x1bb')],{'as':_0xe25d('0x1aa'),'foreignKey':_0xe25d('0x1bc'),'onDelete':_0xe25d('0x10e'),'hooks':!![]});db[_0xe25d('0x94')][_0xe25d('0x111')](db[_0xe25d('0x9a')],{'as':_0xe25d('0x1bd'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1b1'),'hooks':!![]});db[_0xe25d('0x96')][_0xe25d('0x111')](db[_0xe25d('0x9a')],{'as':_0xe25d('0x1bd'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1b0')});db[_0xe25d('0x1be')][_0xe25d('0x111')](db[_0xe25d('0x9a')],{'as':_0xe25d('0x1bd'),'onDelete':_0xe25d('0x10e'),'foreignKey':'MetricId'});db[_0xe25d('0x9a')][_0xe25d('0x11d')](db[_0xe25d('0x1be')],{'foreignKey':_0xe25d('0x1bf')});db[_0xe25d('0x9d')][_0xe25d('0x111')](db[_0xe25d('0x1c0')],{'as':_0xe25d('0x1c1'),'onDelete':'cascade','foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0x1c0')][_0xe25d('0x111')](db[_0xe25d('0xa0')],{'as':_0xe25d('0x1c3'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0x1c0')][_0xe25d('0x111')](db[_0xe25d('0xa0')],{'as':_0xe25d('0x1c5'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0x1c0')][_0xe25d('0x111')](db[_0xe25d('0xa0')],{'as':_0xe25d('0x1bd'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0x1c0')][_0xe25d('0x11d')](db[_0xe25d('0x9d')],{'as':'Account','foreignKey':_0xe25d('0x1c2')});db['SalesforceField'][_0xe25d('0x111')](db[_0xe25d('0xa0')],{'as':_0xe25d('0x1c8'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0xa0')][_0xe25d('0x111')](db[_0xe25d('0xa0')],{'as':_0xe25d('0x1c9'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xa0')][_0xe25d('0x111')](db[_0xe25d('0xa0')],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0xa0')][_0xe25d('0x11d')](db[_0xe25d('0x91')],{'as':_0xe25d('0x91'),'foreignKey':'VariableId'});db['SugarcrmAccount']['hasMany'](db[_0xe25d('0xa4')],{'as':_0xe25d('0x1c1'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xa4')]['hasMany'](db[_0xe25d('0xa6')],{'as':_0xe25d('0x1c3'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0xa4')]['hasMany'](db['SugarcrmField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xe25d('0xa4')]['hasMany'](db[_0xe25d('0xa6')],{'as':'Fields','onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0xa4')][_0xe25d('0x11d')](db[_0xe25d('0xa2')],{'as':'Account','foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xa6')][_0xe25d('0x111')](db[_0xe25d('0xa6')],{'as':_0xe25d('0x1c8'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0xa6')]['hasMany'](db[_0xe25d('0xa6')],{'as':_0xe25d('0x1c9'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xa6')][_0xe25d('0x111')](db['SugarcrmField'],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0xa6')][_0xe25d('0x11d')](db[_0xe25d('0x91')],{'as':_0xe25d('0x91'),'foreignKey':_0xe25d('0x1cb')});db['DeskAccount']['hasMany'](db['DeskConfiguration'],{'as':_0xe25d('0x1c1'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xa8')][_0xe25d('0x111')](db['DeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xe25d('0x1c4')});db['DeskConfiguration'][_0xe25d('0x111')](db['DeskField'],{'as':'Descriptions','onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xa8')][_0xe25d('0x111')](db[_0xe25d('0xaa')],{'as':_0xe25d('0x1bd'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c7')});db['DeskConfiguration'][_0xe25d('0x11d')](db[_0xe25d('0xa7')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xa8')]['belongsToMany'](db[_0xe25d('0x86')],{'through':_0xe25d('0x1cc')});db[_0xe25d('0xaa')][_0xe25d('0x111')](db[_0xe25d('0xaa')],{'as':_0xe25d('0x1c8'),'foreignKey':'SubjectId'});db[_0xe25d('0xaa')]['hasMany'](db['DeskField'],{'as':_0xe25d('0x1c9'),'foreignKey':'DescriptionId'});db['DeskField'][_0xe25d('0x111')](db[_0xe25d('0xaa')],{'as':'Field','foreignKey':'FieldId'});db[_0xe25d('0xaa')][_0xe25d('0x11d')](db['Variable'],{'as':'Variable','foreignKey':_0xe25d('0x1cb')});db['ZohoAccount'][_0xe25d('0x111')](db[_0xe25d('0xae')],{'as':_0xe25d('0x1c1'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xae')][_0xe25d('0x111')](db[_0xe25d('0xb0')],{'as':'Subjects','onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0xae')][_0xe25d('0x111')](db['ZohoField'],{'as':_0xe25d('0x1c5'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xae')][_0xe25d('0x111')](db['ZohoField'],{'as':_0xe25d('0x1bd'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c7')});db['ZohoConfiguration'][_0xe25d('0x11d')](db[_0xe25d('0xac')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0xe25d('0x111')](db[_0xe25d('0xb0')],{'as':_0xe25d('0x1c8'),'foreignKey':'SubjectId'});db['ZohoField'][_0xe25d('0x111')](db[_0xe25d('0xb0')],{'as':_0xe25d('0x1c9'),'foreignKey':'DescriptionId'});db[_0xe25d('0xb0')][_0xe25d('0x111')](db[_0xe25d('0xb0')],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db['ZohoField'][_0xe25d('0x11d')](db['Variable'],{'as':_0xe25d('0x91'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0xe25d('0x111')](db[_0xe25d('0xb3')],{'as':'Configurations','onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xb3')]['hasMany'](db['ZendeskField'],{'as':_0xe25d('0x1c3'),'foreignKey':_0xe25d('0x1c4')});db['ZendeskConfiguration'][_0xe25d('0x111')](db[_0xe25d('0xb5')],{'as':_0xe25d('0x1c5'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xb3')][_0xe25d('0x111')](db[_0xe25d('0xb5')],{'as':_0xe25d('0x1bd'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0xe25d('0x1cd')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xb3')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':_0xe25d('0x1ce')});db[_0xe25d('0xb5')][_0xe25d('0x111')](db[_0xe25d('0xb5')],{'as':_0xe25d('0x1c8'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0xb5')][_0xe25d('0x111')](db[_0xe25d('0xb5')],{'as':'Description','foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xb5')][_0xe25d('0x111')](db[_0xe25d('0xb5')],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0xb5')][_0xe25d('0x11d')](db['Variable'],{'as':_0xe25d('0x91'),'foreignKey':_0xe25d('0x1cb')});db[_0xe25d('0xb7')][_0xe25d('0x111')](db[_0xe25d('0xb8')],{'as':_0xe25d('0x1c1'),'onDelete':'cascade','foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xb8')]['hasMany'](db[_0xe25d('0x1cf')],{'as':_0xe25d('0x1c3'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0xb8')][_0xe25d('0x111')](db[_0xe25d('0x1cf')],{'as':_0xe25d('0x1c5'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xb8')][_0xe25d('0x111')](db['FreshdeskField'],{'as':_0xe25d('0x1bd'),'onDelete':'cascade','foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0xb8')][_0xe25d('0x11d')](db[_0xe25d('0xb7')],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x1c2')});db['FreshdeskConfiguration'][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':_0xe25d('0x1d0')});db[_0xe25d('0x1cf')][_0xe25d('0x111')](db[_0xe25d('0x1cf')],{'as':_0xe25d('0x1c8'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0x1cf')][_0xe25d('0x111')](db[_0xe25d('0x1cf')],{'as':_0xe25d('0x1c9'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0x1cf')][_0xe25d('0x111')](db[_0xe25d('0x1cf')],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0x1cf')][_0xe25d('0x11d')](db[_0xe25d('0x91')],{'as':_0xe25d('0x91'),'foreignKey':'VariableId'});db[_0xe25d('0xbb')][_0xe25d('0x111')](db[_0xe25d('0x1d1')],{'as':_0xe25d('0x1c1'),'onDelete':'cascade','foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0x1d1')][_0xe25d('0x111')](db[_0xe25d('0xbe')],{'as':_0xe25d('0x1c3'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0x1d1')][_0xe25d('0x111')](db[_0xe25d('0xbe')],{'as':_0xe25d('0x1c5'),'foreignKey':_0xe25d('0x1c6')});db['VtigerConfiguration'][_0xe25d('0x111')](db[_0xe25d('0xbe')],{'as':'Fields','foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0x1d1')]['belongsTo'](db['VtigerAccount'],{'as':_0xe25d('0x172'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xbe')][_0xe25d('0x111')](db[_0xe25d('0xbe')],{'as':_0xe25d('0x1c8'),'foreignKey':_0xe25d('0x1c4')});db['VtigerField'][_0xe25d('0x111')](db[_0xe25d('0xbe')],{'as':_0xe25d('0x1c9'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xbe')]['hasMany'](db[_0xe25d('0xbe')],{'as':_0xe25d('0x1ca'),'foreignKey':'FieldId'});db['VtigerField']['belongsTo'](db[_0xe25d('0x91')],{'as':_0xe25d('0x91'),'foreignKey':_0xe25d('0x1cb')});db['ServicenowAccount'][_0xe25d('0x111')](db[_0xe25d('0xc2')],{'as':_0xe25d('0x1c1'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xc2')][_0xe25d('0x111')](db[_0xe25d('0x1d2')],{'as':_0xe25d('0x1c3'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0xc2')][_0xe25d('0x111')](db[_0xe25d('0x1d2')],{'as':_0xe25d('0x1c5'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xe25d('0x111')](db[_0xe25d('0x1d2')],{'as':'Fields','foreignKey':'FieldId'});db['ServicenowConfiguration'][_0xe25d('0x11d')](db[_0xe25d('0xc0')],{'as':'Account','foreignKey':_0xe25d('0x1c2')});db['ServicenowField'][_0xe25d('0x111')](db[_0xe25d('0x1d2')],{'as':_0xe25d('0x1c8'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0x1d2')][_0xe25d('0x111')](db['ServicenowField'],{'as':_0xe25d('0x1c9'),'foreignKey':'DescriptionId'});db[_0xe25d('0x1d2')][_0xe25d('0x111')](db['ServicenowField'],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db['ServicenowField'][_0xe25d('0x11d')](db[_0xe25d('0x91')],{'as':_0xe25d('0x91'),'foreignKey':_0xe25d('0x1cb')});db['Dynamics365Account'][_0xe25d('0x111')](db[_0xe25d('0x1d3')],{'as':'Configurations','onDelete':_0xe25d('0x10e'),'foreignKey':'AccountId'});db[_0xe25d('0xc5')][_0xe25d('0x11d')](db[_0xe25d('0x105')],{'as':_0xe25d('0x105'),'foreignKey':_0xe25d('0x1d4')});db['Dynamics365Configuration'][_0xe25d('0x111')](db[_0xe25d('0xc7')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xe25d('0x1c4')});db['Dynamics365Configuration'][_0xe25d('0x111')](db['Dynamics365Field'],{'as':_0xe25d('0x1c5'),'onDelete':_0xe25d('0x10e'),'foreignKey':'DescriptionId'});db[_0xe25d('0x1d3')][_0xe25d('0x111')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c7')});db[_0xe25d('0x1d3')][_0xe25d('0x11d')](db[_0xe25d('0xc5')],{'as':'Account','foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xc7')][_0xe25d('0x111')](db['Dynamics365Field'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xe25d('0xc7')][_0xe25d('0x111')](db[_0xe25d('0xc7')],{'as':_0xe25d('0x1c9'),'foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xc7')][_0xe25d('0x111')](db[_0xe25d('0xc7')],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db['Dynamics365Field'][_0xe25d('0x11d')](db[_0xe25d('0x91')],{'as':_0xe25d('0x91'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xe25d('0x111')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1c2')});db[_0xe25d('0xca')][_0xe25d('0x111')](db['FreshsalesField'],{'as':_0xe25d('0x1c3'),'foreignKey':'SubjectId'});db[_0xe25d('0xca')][_0xe25d('0x111')](db[_0xe25d('0x1d5')],{'as':'Descriptions','foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0xca')]['hasMany'](db[_0xe25d('0x1d5')],{'as':_0xe25d('0x1bd'),'foreignKey':_0xe25d('0x1c7')});db['FreshsalesConfiguration'][_0xe25d('0x11d')](db[_0xe25d('0x1d6')],{'as':_0xe25d('0x172'),'foreignKey':'AccountId'});db[_0xe25d('0x1d5')][_0xe25d('0x111')](db[_0xe25d('0x1d5')],{'as':_0xe25d('0x1c8'),'foreignKey':_0xe25d('0x1c4')});db[_0xe25d('0x1d5')]['hasMany'](db[_0xe25d('0x1d5')],{'as':'Description','foreignKey':_0xe25d('0x1c6')});db[_0xe25d('0x1d5')]['hasMany'](db[_0xe25d('0x1d5')],{'as':_0xe25d('0x1ca'),'foreignKey':_0xe25d('0x1c7')});db['FreshsalesField'][_0xe25d('0x11d')](db[_0xe25d('0x91')],{'as':_0xe25d('0x91'),'foreignKey':_0xe25d('0x1cb')});db[_0xe25d('0xce')][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{});db[_0xe25d('0xce')][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d')});db[_0xe25d('0xce')]['belongsTo'](db[_0xe25d('0x122')],{'as':_0xe25d('0x164'),'foreignKey':_0xe25d('0x165')});db[_0xe25d('0xce')][_0xe25d('0x11d')](db[_0xe25d('0x65')],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db['ChatQueueReport'][_0xe25d('0x11d')](db[_0xe25d('0xf')],{});db[_0xe25d('0xce')][_0xe25d('0x11d')](db[_0xe25d('0x6a')],{});db[_0xe25d('0xd0')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x1d7')});db[_0xe25d('0xd0')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'onDelete':_0xe25d('0x10e'),'foreignKey':'ToId'});db[_0xe25d('0xd4')]['hasMany'](db[_0xe25d('0xd2')],{'foreignKey':_0xe25d('0x1d8'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0xd4')][_0xe25d('0x111')](db[_0xe25d('0xd1')],{'foreignKey':'SessionId','onDelete':_0xe25d('0x10e')});db[_0xe25d('0xd6')][_0xe25d('0x11d')](db[_0xe25d('0x54')],{});db[_0xe25d('0xd6')][_0xe25d('0x11d')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['SmsQueueReport'][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':'Contact','foreignKey':_0xe25d('0x165')});db[_0xe25d('0xd6')][_0xe25d('0x11d')](db[_0xe25d('0x56')],{});db[_0xe25d('0xd6')][_0xe25d('0x11d')](db[_0xe25d('0x58')],{});db[_0xe25d('0xd6')][_0xe25d('0x11d')](db[_0xe25d('0xf')],{});db[_0xe25d('0xd6')][_0xe25d('0x11d')](db[_0xe25d('0x138')],{});db[_0xe25d('0xda')]['hasMany'](db[_0xe25d('0xd4')],{'foreignKey':_0xe25d('0x1d9')});db[_0xe25d('0xda')]['hasMany'](db[_0xe25d('0xd2')],{'foreignKey':'ProjectId'});db[_0xe25d('0xda')][_0xe25d('0x111')](db[_0xe25d('0xd1')],{'foreignKey':'ProjectId'});db[_0xe25d('0xdf')][_0xe25d('0x11f')](db['User'],{'as':_0xe25d('0x177'),'through':_0xe25d('0x1da')});db['Team'][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':'Agents','through':'user_has_teams'});db['Team'][_0xe25d('0x11f')](db[_0xe25d('0x17')],{'through':'TeamVoiceQueue','as':_0xe25d('0x131')});db[_0xe25d('0x128')]['belongsToMany'](db[_0xe25d('0x3d')],{'through':_0xe25d('0x170'),'as':_0xe25d('0x133')});db['Team'][_0xe25d('0x11f')](db[_0xe25d('0x6a')],{'through':'team_has_chat_queues','as':_0xe25d('0x134')});db[_0xe25d('0x128')][_0xe25d('0x11f')](db[_0xe25d('0x136')],{'through':_0xe25d('0x186'),'as':_0xe25d('0x137')});db[_0xe25d('0x128')][_0xe25d('0x11f')](db[_0xe25d('0x138')],{'through':'team_has_sms_queues','as':_0xe25d('0x139')});db[_0xe25d('0x128')][_0xe25d('0x11f')](db[_0xe25d('0x13a')],{'through':'team_has_openchannel_queues','as':_0xe25d('0x13b')});db[_0xe25d('0x128')][_0xe25d('0x11f')](db['WhatsappQueue'],{'through':_0xe25d('0x1db'),'as':'WhatsappQueues'});db[_0xe25d('0x128')][_0xe25d('0x11f')](db[_0xe25d('0xf7')],{'through':_0xe25d('0x1dc'),'as':_0xe25d('0x132')});db[_0xe25d('0xe6')][_0xe25d('0x111')](db['CmHopper'],{'as':_0xe25d('0x152'),'foreignKey':_0xe25d('0x1a4')});db[_0xe25d('0xe6')]['hasMany'](db[_0xe25d('0x72')],{'as':_0xe25d('0x153'),'foreignKey':_0xe25d('0x1a4')});db['Campaign'][_0xe25d('0x111')](db[_0xe25d('0x74')],{'as':_0xe25d('0x19e'),'foreignKey':_0xe25d('0x1a4')});db['Campaign'][_0xe25d('0x111')](db[_0xe25d('0x71')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0xe25d('0xe6')][_0xe25d('0x11d')](db[_0xe25d('0x26')],{'as':_0xe25d('0x26'),'foreignKey':'TrunkId'});db['Campaign'][_0xe25d('0x11d')](db['Trunk'],{'as':_0xe25d('0x1dd'),'foreignKey':_0xe25d('0x1de')});db[_0xe25d('0xe6')]['belongsTo'](db[_0xe25d('0x156')],{'as':_0xe25d('0x156'),'foreignKey':'IntervalId'});db[_0xe25d('0xe6')][_0xe25d('0x11d')](db['SquareProject'],{'as':_0xe25d('0xdf'),'foreignKey':_0xe25d('0x1df')});db[_0xe25d('0xe6')]['belongsToMany'](db['CmList'],{'as':_0xe25d('0x126'),'through':_0xe25d('0x1e0')});db[_0xe25d('0xe6')][_0xe25d('0x11f')](db[_0xe25d('0x125')],{'as':_0xe25d('0x1e1'),'through':_0xe25d('0x1e2')});db[_0xe25d('0xe9')][_0xe25d('0x11d')](db['ChatOfflineMessage'],{'as':_0xe25d('0x68'),'foreignKey':'ChatOfflineMessageId'});db[_0xe25d('0xed')][_0xe25d('0x11d')](db[_0xe25d('0x42')],{});db[_0xe25d('0xed')][_0xe25d('0x11d')](db[_0xe25d('0x40')],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0xe25d('0x1e3'),'as':'FromAccount'});db[_0xe25d('0xed')]['belongsTo'](db[_0xe25d('0xf')],{'foreignKey':_0xe25d('0x1e4'),'as':_0xe25d('0x1e5')});db['MailTransferReport'][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db['MailTransferReport']['belongsTo'](db[_0xe25d('0x3d')],{'foreignKey':'ToMailQueueId','as':_0xe25d('0x1e6')});db[_0xe25d('0xed')][_0xe25d('0x11d')](db[_0xe25d('0x3b')],{'foreignKey':_0xe25d('0x1e7'),'as':_0xe25d('0x1e8')});db[_0xe25d('0xee')]['belongsTo'](db['ChatMessage'],{});db['ChatTransferReport'][_0xe25d('0x11d')](db['ChatInteraction'],{});db[_0xe25d('0xee')][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{'foreignKey':_0xe25d('0x1e9'),'as':'FromAccount'});db[_0xe25d('0xee')]['belongsTo'](db[_0xe25d('0xf')],{'foreignKey':_0xe25d('0x1e4'),'as':_0xe25d('0x1e5')});db[_0xe25d('0xee')][_0xe25d('0x11d')](db['User'],{'foreignKey':_0xe25d('0x1ea'),'as':_0xe25d('0x1eb')});db[_0xe25d('0xee')]['belongsTo'](db[_0xe25d('0x6a')],{'foreignKey':_0xe25d('0x1ec'),'as':_0xe25d('0x1e6')});db['ChatTransferReport'][_0xe25d('0x11d')](db[_0xe25d('0x13e')],{'foreignKey':_0xe25d('0x1ed'),'as':'ToAccount'});db[_0xe25d('0xf0')]['belongsTo'](db['FaxMessage'],{});db[_0xe25d('0xf0')][_0xe25d('0x11d')](db[_0xe25d('0x4e')],{});db[_0xe25d('0xf0')]['belongsTo'](db[_0xe25d('0x4a')],{'foreignKey':_0xe25d('0x1ee'),'as':_0xe25d('0x1ef')});db[_0xe25d('0xf0')]['belongsTo'](db[_0xe25d('0xf')],{'foreignKey':_0xe25d('0x1e4'),'as':_0xe25d('0x1e5')});db[_0xe25d('0xf0')]['belongsTo'](db[_0xe25d('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xe25d('0xf0')][_0xe25d('0x11d')](db[_0xe25d('0x136')],{'foreignKey':'ToFaxQueueId','as':_0xe25d('0x1e6')});db[_0xe25d('0xf0')]['belongsTo'](db[_0xe25d('0x4a')],{'foreignKey':'ToFaxAccountId','as':_0xe25d('0x1e8')});db['OpenchannelTransferReport'][_0xe25d('0x11d')](db[_0xe25d('0x60')],{});db['OpenchannelTransferReport'][_0xe25d('0x11d')](db[_0xe25d('0x5e')],{});db['OpenchannelTransferReport'][_0xe25d('0x11d')](db[_0xe25d('0x5b')],{'foreignKey':_0xe25d('0x1f0'),'as':_0xe25d('0x1ef')});db[_0xe25d('0xf2')][_0xe25d('0x11d')](db['User'],{'foreignKey':_0xe25d('0x1e4'),'as':_0xe25d('0x1e5')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe25d('0xf')],{'foreignKey':_0xe25d('0x1ea'),'as':_0xe25d('0x1eb')});db[_0xe25d('0xf2')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0xe25d('0x1f1'),'as':_0xe25d('0x1e6')});db[_0xe25d('0xf2')][_0xe25d('0x11d')](db['OpenchannelAccount'],{'foreignKey':_0xe25d('0x1f2'),'as':_0xe25d('0x1e8')});db[_0xe25d('0xf4')][_0xe25d('0x11d')](db['SmsMessage'],{});db[_0xe25d('0xf4')]['belongsTo'](db['SmsInteraction'],{});db[_0xe25d('0xf4')][_0xe25d('0x11d')](db['SmsAccount'],{'foreignKey':_0xe25d('0x1f3'),'as':_0xe25d('0x1ef')});db[_0xe25d('0xf4')]['belongsTo'](db[_0xe25d('0xf')],{'foreignKey':'FromUserId','as':_0xe25d('0x1e5')});db['SmsTransferReport'][_0xe25d('0x11d')](db[_0xe25d('0xf')],{'foreignKey':'ToUserId','as':_0xe25d('0x1eb')});db[_0xe25d('0xf4')][_0xe25d('0x11d')](db[_0xe25d('0x138')],{'foreignKey':_0xe25d('0x1f4'),'as':_0xe25d('0x1e6')});db[_0xe25d('0xf4')][_0xe25d('0x11d')](db[_0xe25d('0x54')],{'foreignKey':'ToSmsAccountId','as':_0xe25d('0x1e8')});db[_0xe25d('0x125')][_0xe25d('0x111')](db[_0xe25d('0x16a')],{'as':_0xe25d('0x180'),'foreignKey':'ListId','onDelete':_0xe25d('0x10e')});db['CmList'][_0xe25d('0x111')](db[_0xe25d('0x1f5')],{'as':_0xe25d('0x1f6'),'foreignKey':_0xe25d('0x17d')});db['CmList'][_0xe25d('0x111')](db[_0xe25d('0x122')],{'as':_0xe25d('0x123'),'onDelete':_0xe25d('0x10e'),'foreignKey':_0xe25d('0x17d')});db[_0xe25d('0x125')][_0xe25d('0x111')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe25d('0x17d')});db[_0xe25d('0x125')][_0xe25d('0x111')](db[_0xe25d('0x74')],{'as':_0xe25d('0x116'),'foreignKey':_0xe25d('0x17d')});db[_0xe25d('0x125')][_0xe25d('0x111')](db[_0xe25d('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xe25d('0x17d')});db['CmList'][_0xe25d('0x11f')](db[_0xe25d('0x17')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0xe25d('0x125')]['belongsToMany'](db[_0xe25d('0xf')],{'as':'Agents','through':_0xe25d('0x127')});db['VoicePrefix'][_0xe25d('0x111')](db[_0xe25d('0x14')],{'as':_0xe25d('0x115'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0xf7')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x109')});db[_0xe25d('0xf7')][_0xe25d('0x11f')](db[_0xe25d('0x128')],{'through':'TeamVoicePrefix','as':_0xe25d('0x15c')});db[_0xe25d('0xf9')][_0xe25d('0x111')](db[_0xe25d('0xf')],{'as':'Users','foreignKey':_0xe25d('0x11e')});db['UserProfile'][_0xe25d('0x111')](db[_0xe25d('0xfb')],{'as':_0xe25d('0x1f7'),'foreignKey':_0xe25d('0x11e'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0xfb')][_0xe25d('0x111')](db[_0xe25d('0x1f8')],{'as':_0xe25d('0x1f9'),'foreignKey':_0xe25d('0x1fa'),'onDelete':_0xe25d('0x10e')});db[_0xe25d('0xfe')]['hasMany'](db[_0xe25d('0x16a')],{'as':_0xe25d('0x180'),'foreignKey':'WhatsappAccountId','onDelete':_0xe25d('0x10e')});db[_0xe25d('0xfe')][_0xe25d('0x111')](db[_0xe25d('0x7c')],{'as':'Answers','foreignKey':_0xe25d('0x1fb')});db[_0xe25d('0xfe')]['hasMany'](db[_0xe25d('0x101')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xe25d('0x111')](db[_0xe25d('0x12f')],{'as':'Interactions'});db['WhatsappAccount'][_0xe25d('0x111')](db[_0xe25d('0x1fc')],{'as':'Applications'});db[_0xe25d('0xfe')][_0xe25d('0x11d')](db['CmList'],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d')});db[_0xe25d('0xfe')][_0xe25d('0x11d')](db[_0xe25d('0x158')],{'as':_0xe25d('0x16f'),'foreignKey':_0xe25d('0x159')});db[_0xe25d('0xfe')]['belongsToMany'](db[_0xe25d('0xf')],{'as':_0xe25d('0x15b'),'through':_0xe25d('0x147')});db[_0xe25d('0x1fc')][_0xe25d('0x11d')](db['User'],{'onDelete':_0xe25d('0x167')});db[_0xe25d('0x1fc')]['belongsTo'](db[_0xe25d('0x13c')],{'onDelete':_0xe25d('0x167')});db['WhatsappApplication'][_0xe25d('0x11d')](db[_0xe25d('0xfe')],{'onDelete':_0xe25d('0x167')});db['WhatsappApplication'][_0xe25d('0x11d')](db[_0xe25d('0x156')],{'onDelete':_0xe25d('0x167'),'foreignKey':_0xe25d('0x157')});db[_0xe25d('0x1fc')][_0xe25d('0x11d')](db[_0xe25d('0x86')],{'onDelete':_0xe25d('0x167'),'foreignKey':_0xe25d('0x17c')});db[_0xe25d('0x12f')][_0xe25d('0x111')](db[_0xe25d('0x101')],{'as':_0xe25d('0x15f'),'onDelete':'cascade','foreignKey':_0xe25d('0x1fd')});db[_0xe25d('0x12f')][_0xe25d('0x11d')](db[_0xe25d('0xfe')],{'as':_0xe25d('0x172'),'foreignKey':'WhatsappAccountId'});db[_0xe25d('0x12f')]['belongsTo'](db[_0xe25d('0x122')],{'as':'Contact','foreignKey':_0xe25d('0x165')});db[_0xe25d('0x12f')][_0xe25d('0x11d')](db['User'],{'as':'Owner','foreignKey':_0xe25d('0x10f')});db[_0xe25d('0x12f')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':'whatsapp_interaction_has_tags','as':_0xe25d('0x174')});db[_0xe25d('0x12f')][_0xe25d('0x11f')](db[_0xe25d('0x86')],{'through':'whatsapp_interaction_has_tags','as':_0xe25d('0x176')});db[_0xe25d('0x12f')][_0xe25d('0x11f')](db[_0xe25d('0xf')],{'as':_0xe25d('0x177'),'through':_0xe25d('0x130'),'foreignKey':_0xe25d('0x1fd')});db[_0xe25d('0x101')][_0xe25d('0x11d')](db['User'],{'as':_0xe25d('0xf')});db[_0xe25d('0x101')][_0xe25d('0x11d')](db['CmContact'],{'onDelete':_0xe25d('0x10e'),'as':'Contact'});db[_0xe25d('0x101')][_0xe25d('0x11d')](db[_0xe25d('0x12f')],{'onDelete':_0xe25d('0x10e'),'as':_0xe25d('0x17a'),'foreignKey':_0xe25d('0x1fd')});db[_0xe25d('0x101')][_0xe25d('0x11d')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xe25d('0x1fb')});db[_0xe25d('0x102')][_0xe25d('0x11d')](db[_0xe25d('0xfe')],{});db['WhatsappQueueReport'][_0xe25d('0x11d')](db[_0xe25d('0x125')],{'as':_0xe25d('0x16e'),'foreignKey':_0xe25d('0x17d')});db[_0xe25d('0x102')][_0xe25d('0x11d')](db[_0xe25d('0x122')],{'as':'Contact','foreignKey':_0xe25d('0x165')});db['WhatsappQueueReport']['belongsTo'](db['WhatsappInteraction'],{});db[_0xe25d('0x102')][_0xe25d('0x11d')](db[_0xe25d('0x13c')],{});db[_0xe25d('0x102')][_0xe25d('0x11d')](db[_0xe25d('0x101')],{});db[_0xe25d('0x102')]['belongsTo'](db[_0xe25d('0xf')],{});db[_0xe25d('0x1fe')]['belongsTo'](db[_0xe25d('0x101')],{});db[_0xe25d('0x1fe')]['belongsTo'](db['WhatsappInteraction'],{});db[_0xe25d('0x1fe')][_0xe25d('0x11d')](db[_0xe25d('0xfe')],{'foreignKey':_0xe25d('0x1ff'),'as':_0xe25d('0x1ef')});db[_0xe25d('0x1fe')][_0xe25d('0x11d')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0xe25d('0x1e8')});db['WhatsappTransferReport'][_0xe25d('0x11d')](db[_0xe25d('0x13c')],{'foreignKey':'ToQueueId','as':_0xe25d('0x1e6')});db['WhatsappTransferReport'][_0xe25d('0x11d')](db['User'],{'foreignKey':_0xe25d('0x1e4'),'as':_0xe25d('0x1e5')});db[_0xe25d('0x1fe')][_0xe25d('0x11d')](db['User'],{'foreignKey':_0xe25d('0x1ea'),'as':_0xe25d('0x1eb')});db[_0xe25d('0x13c')][_0xe25d('0x11f')](db['User'],{'as':_0xe25d('0x15b'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xe25d('0x13c')][_0xe25d('0x11f')](db[_0xe25d('0x128')],{'through':_0xe25d('0x1db'),'as':_0xe25d('0x15c')});db[_0xe25d('0x10b')][_0xe25d('0x11d')](db['User'],{'as':'user','foreignKey':_0xe25d('0x10f'),'onDelete':_0xe25d('0x10e'),'hooks':!![]});db['CloudProvider']['hasOne'](db['Dynamics365Account'],{'as':_0xe25d('0xc5'),'onDelete':'restrict'});db[_0xe25d('0x105')][_0xe25d('0x10d')](db['MailServerIn'],{'as':_0xe25d('0x168'),'onDelete':_0xe25d('0x167')});db['CloudProvider']['hasOne'](db[_0xe25d('0x39')],{'as':_0xe25d('0x169'),'onDelete':_0xe25d('0x167')});module[_0xe25d('0x200')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x25a9=['OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','userSetting','hasMany','Recordings','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','UserMailQueue','ChatQueues','UserFaxQueue','SmsQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceContext','Applications','moh_has_sounds','VoiceQueueId','Hoppers','CmHopperFinal','HopperHistories','JscriptySessions','TrunkId','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','IntervalId','ListId','Items','FaxAccountId','Exntensions','TagId','fax_interaction_has_tags','ThroughTags','FaxInteractionId','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','OpenchannelQueueId','ChatProactiveAction','OpenchannelQueueReport','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','Members','Phones','CmContactId','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','Queue','OwnerId','All','OneAll','Any','OneAny','AutomationAnyId','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Sound','whatsapp_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','Actions','TriggerId','CustomReportId','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','DescriptionId','Fields','FieldId','Subject','Description','Field','Variable','VariableId','SugarcrmConfiguration','Descriptions','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','FreshdeskAccount','ServicenowField','Dynamics365Account','Dynamics365Field','ChatQueueReport','SessionId','SmsQueueReport','ProjectId','TeamVoiceQueue','team_has_openchannel_queues','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','CampaignId','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToUserId','ToAgent','ToQueue','ToChatWebsiteId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappMessage','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','UserWhatsappQueue','WhatsappQueueId','user','exports','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','utf8','utf8_general_ci','sequelizeHistory','motion2','mysql','name','database','username','password','options','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../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/sound/sound.model','Tag','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model'];(function(_0x1fb2c3,_0x20da4c){var _0x44ac2a=function(_0x4ac5a8){while(--_0x4ac5a8){_0x1fb2c3['push'](_0x1fb2c3['shift']());}};_0x44ac2a(++_0x20da4c);}(_0x25a9,0x112));var _0x925a=function(_0x446970,_0x2e8abc){_0x446970=_0x446970-0x0;var _0xccb49a=_0x25a9[_0x446970];return _0xccb49a;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x925a('0x0'));var _=require(_0x925a('0x1'));var jstz=require(_0x925a('0x2'));var timezone=jstz[_0x925a('0x3')]();config['sequelize']=_[_0x925a('0x4')](config[_0x925a('0x0')],{'database':'motion2','username':_0x925a('0x5'),'password':_0x925a('0x6'),'options':{'host':_0x925a('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x925a('0x8'),'collate':_0x925a('0x9')}}});config[_0x925a('0xa')]=_[_0x925a('0x4')](config[_0x925a('0xa')],{'database':_0x925a('0xb'),'username':_0x925a('0x5'),'password':_0x925a('0x6'),'options':{'host':_0x925a('0x7'),'port':0xcea,'dialect':_0x925a('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x925a('0xd')](),'define':{'charset':_0x925a('0x8'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x925a('0x0')][_0x925a('0xe')],config[_0x925a('0x0')][_0x925a('0xf')],config['sequelize'][_0x925a('0x10')],config[_0x925a('0x0')][_0x925a('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x925a('0xa')]['database'],config[_0x925a('0xa')]['username'],config[_0x925a('0xa')][_0x925a('0x10')],config[_0x925a('0xa')][_0x925a('0x11')])};db['User']=db['sequelize'][_0x925a('0x12')](_0x925a('0x13'));db['VoiceChanSpy']=db['sequelize'][_0x925a('0x12')](_0x925a('0x14'));db['VoiceContext']=db['sequelize'][_0x925a('0x12')](_0x925a('0x15'));db[_0x925a('0x16')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x17'));db[_0x925a('0x18')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x925a('0x19')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x1a'));db[_0x925a('0x1b')]=db[_0x925a('0x0')]['import'](_0x925a('0x1c'));db[_0x925a('0x1d')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x1e'));db[_0x925a('0x1f')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x20'));db[_0x925a('0x21')]=db[_0x925a('0x0')]['import'](_0x925a('0x22'));db[_0x925a('0x23')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x24'));db[_0x925a('0x25')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x26'));db[_0x925a('0x27')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x28'));db['MemberReport']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/memberReport/memberReport.model');db[_0x925a('0x29')]=db[_0x925a('0x0')]['import'](_0x925a('0x2a'));db[_0x925a('0x2b')]=db[_0x925a('0x0')]['import'](_0x925a('0x2c'));db[_0x925a('0x2d')]=db['sequelize'][_0x925a('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0x925a('0x0')]['import'](_0x925a('0x2e'));db[_0x925a('0x2f')]=db[_0x925a('0x0')]['import'](_0x925a('0x30'));db['UserMailQueue']=db['sequelize'][_0x925a('0x12')](_0x925a('0x31'));db['UserFaxQueue']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0x925a('0x32')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x33'));db[_0x925a('0x34')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0x925a('0x0')]['import'](_0x925a('0x35'));db[_0x925a('0x36')]=db[_0x925a('0x0')]['import'](_0x925a('0x37'));db[_0x925a('0x38')]=db[_0x925a('0x0')]['import']('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x39'));db[_0x925a('0x3a')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x3b'));db[_0x925a('0x3c')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x3d'));db[_0x925a('0x3e')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x3f'));db[_0x925a('0x40')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x41'));db['MailApplication']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x42'));db[_0x925a('0x43')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x44'));db[_0x925a('0x45')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x46'));db[_0x925a('0x47')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x48'));db['FaxAccount']=db['sequelize'][_0x925a('0x12')](_0x925a('0x49'));db[_0x925a('0x4a')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x4b'));db[_0x925a('0x4c')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x4d'));db[_0x925a('0x4e')]=db[_0x925a('0x0')]['import']('../api/faxMessage/faxMessage.model');db[_0x925a('0x4f')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x50'));db['FaxQueueReport']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x51'));db['SmsAccount']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x52'));db[_0x925a('0x53')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x54'));db[_0x925a('0x55')]=db[_0x925a('0x0')]['import'](_0x925a('0x56'));db[_0x925a('0x57')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x58'));db['SmsQueue']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x59'));db[_0x925a('0x5a')]=db[_0x925a('0x0')]['import']('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db['sequelize'][_0x925a('0x12')](_0x925a('0x5b'));db['OpenchannelInteraction']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x5c'));db[_0x925a('0x5d')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x5e'));db['OpenchannelQueue']=db[_0x925a('0x0')]['import'](_0x925a('0x5f'));db['ChatWebsite']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x60'));db['OpenchannelQueueReport']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x925a('0x61')]=db[_0x925a('0x0')]['import'](_0x925a('0x62'));db[_0x925a('0x63')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x64'));db[_0x925a('0x65')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x66'));db[_0x925a('0x67')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x68'));db[_0x925a('0x69')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x6a'));db[_0x925a('0x6b')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x6c'));db['ChatProactiveAction']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x925a('0x6d')]=db[_0x925a('0x0')]['import'](_0x925a('0x6e'));db[_0x925a('0x6f')]=db[_0x925a('0x0')]['import'](_0x925a('0x70'));db[_0x925a('0x71')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x72'));db[_0x925a('0x73')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x74'));db['CmHopperFinal']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x925a('0x75')]=db[_0x925a('0x0')]['import'](_0x925a('0x76'));db['ReportAgentPreview']=db['sequelize'][_0x925a('0x12')](_0x925a('0x77'));db[_0x925a('0x78')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x79'));db[_0x925a('0x7a')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x7b'));db[_0x925a('0x7c')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/automation/automation.model');db[_0x925a('0x7d')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x7e'));db[_0x925a('0x7f')]=db['sequelize']['import'](_0x925a('0x80'));db[_0x925a('0x81')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/condition/condition.model');db[_0x925a('0x82')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x83'));db['Pause']=db[_0x925a('0x0')]['import'](_0x925a('0x84'));db['Cdr']=db[_0x925a('0x0')]['import'](_0x925a('0x85'));db[_0x925a('0x86')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x87'));db[_0x925a('0x88')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/schedule/schedule.model');db['Sound']=db['sequelize'][_0x925a('0x12')](_0x925a('0x89'));db[_0x925a('0x8a')]=db['sequelize'][_0x925a('0x12')]('../api/tag/tag.model');db['ContactItemType']=db['sequelize'][_0x925a('0x12')](_0x925a('0x8b'));db[_0x925a('0x8c')]=db['sequelize']['import'](_0x925a('0x8d'));db['CmHopperAdditionalPhone']=db[_0x925a('0x0')]['import'](_0x925a('0x8e'));db[_0x925a('0x8f')]=db[_0x925a('0x0')]['import'](_0x925a('0x90'));db[_0x925a('0x91')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x92'));db['Variable']=db[_0x925a('0x0')]['import'](_0x925a('0x93'));db['Integration']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x94'));db['IntegrationReport']=db['sequelize'][_0x925a('0x12')](_0x925a('0x95'));db[_0x925a('0x96')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x97'));db[_0x925a('0x98')]=db[_0x925a('0x0')]['import'](_0x925a('0x99'));db[_0x925a('0x9a')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x9b'));db[_0x925a('0x9c')]=db[_0x925a('0x0')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x925a('0x9d')]=db[_0x925a('0x0')]['import'](_0x925a('0x9e'));db[_0x925a('0x9f')]=db[_0x925a('0x0')]['import'](_0x925a('0xa0'));db['SalesforceAccount']=db[_0x925a('0x0')]['import'](_0x925a('0xa1'));db[_0x925a('0xa2')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xa3'));db[_0x925a('0xa4')]=db['sequelize'][_0x925a('0x12')](_0x925a('0xa5'));db[_0x925a('0xa6')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x925a('0xa7')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x925a('0xa8')]=db[_0x925a('0x0')]['import'](_0x925a('0xa9'));db[_0x925a('0xaa')]=db['sequelize'][_0x925a('0x12')](_0x925a('0xab'));db[_0x925a('0xac')]=db[_0x925a('0x0')]['import'](_0x925a('0xad'));db[_0x925a('0xae')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xaf'));db[_0x925a('0xb0')]=db[_0x925a('0x0')]['import'](_0x925a('0xb1'));db[_0x925a('0xb2')]=db['sequelize'][_0x925a('0x12')](_0x925a('0xb3'));db[_0x925a('0xb4')]=db['sequelize']['import'](_0x925a('0xb5'));db[_0x925a('0xb6')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xb7'));db[_0x925a('0xb8')]=db['sequelize'][_0x925a('0x12')](_0x925a('0xb9'));db['FreshdeskAccount']=db[_0x925a('0x0')]['import'](_0x925a('0xba'));db[_0x925a('0xbb')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xbc'));db['FreshdeskField']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x925a('0xbd')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xbe'));db[_0x925a('0xbf')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xc0'));db[_0x925a('0xc1')]=db['sequelize'][_0x925a('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x925a('0xc2')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x925a('0xc3')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xc4'));db['ServicenowField']=db['sequelize'][_0x925a('0x12')](_0x925a('0xc5'));db['Dynamics365Account']=db['sequelize'][_0x925a('0x12')](_0x925a('0xc6'));db[_0x925a('0xc7')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xc8'));db[_0x925a('0xc9')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x925a('0xca')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xcb'));db[_0x925a('0xcc')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xcd'));db['Integration']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x94'));db['Network']=db['sequelize']['import']('../api/network/network.model');db['ChatQueueReport']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xce'));db[_0x925a('0xcf')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xd0'));db[_0x925a('0xd1')]=db['sequelize']['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x925a('0xd2')]=db['sequelize'][_0x925a('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x925a('0xd3')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xd4'));db['SmsQueueReport']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x925a('0xd5')]=db[_0x925a('0x0')]['import'](_0x925a('0xd6'));db[_0x925a('0xd7')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/squareReportDetail/squareReportDetail.model');db[_0x925a('0xd8')]=db['sequelize']['import'](_0x925a('0xd9'));db[_0x925a('0xda')]=db['sequelize']['import'](_0x925a('0xdb'));db[_0x925a('0xdc')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xdd'));db[_0x925a('0xde')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xdf'));db['SquareRecording']=db[_0x925a('0x0')]['import'](_0x925a('0xe0'));db['SquareMessage']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xe1'));db[_0x925a('0xe2')]=db[_0x925a('0x0')]['import'](_0x925a('0xe3'));db[_0x925a('0xe4')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xe5'));db[_0x925a('0xe6')]=db['sequelize'][_0x925a('0x12')](_0x925a('0xe7'));db[_0x925a('0xe8')]=db['sequelize'][_0x925a('0x12')]('../api/migration/migration.model');db['Attachment']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xe9'));db[_0x925a('0xea')]=db[_0x925a('0x0')]['import']('../api/plugin/plugin.model');db[_0x925a('0xeb')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xec'));db[_0x925a('0xed')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xee'));db[_0x925a('0xef')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xf0'));db[_0x925a('0xf1')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x925a('0xf2')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0xf3'));db[_0x925a('0xf4')]=db[_0x925a('0x0')][_0x925a('0x12')]('../api/cmList/cmList.model');db[_0x925a('0xf5')]=db[_0x925a('0x0')]['import'](_0x925a('0xf6'));db[_0x925a('0xf7')]=db[_0x925a('0x0')]['import'](_0x925a('0xf8'));db[_0x925a('0xf9')]=db['sequelize']['import'](_0x925a('0xfa'));db[_0x925a('0xfb')]=db['sequelize']['import'](_0x925a('0xfc'));db[_0x925a('0xfd')]=db[_0x925a('0x0')]['import'](_0x925a('0xfe'));db['WhatsappAccount']=db['sequelize']['import'](_0x925a('0xff'));db[_0x925a('0x100')]=db[_0x925a('0x0')]['import'](_0x925a('0x101'));db['WhatsappInteraction']=db['sequelize'][_0x925a('0x12')](_0x925a('0x102'));db['WhatsappMessage']=db['sequelize']['import'](_0x925a('0x103'));db[_0x925a('0x104')]=db[_0x925a('0x0')]['import'](_0x925a('0x105'));db['WhatsappTransferReport']=db[_0x925a('0x0')][_0x925a('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x106'));db[_0x925a('0x107')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x108'));db['TeamVoiceQueue']=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x109'));db['TeamVoicePrefix']=db['sequelize'][_0x925a('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x925a('0x10a')]=db[_0x925a('0x0')][_0x925a('0x12')](_0x925a('0x10b'));db[_0x925a('0x10c')]=db['sequelize'][_0x925a('0x12')](_0x925a('0x10d'));db[_0x925a('0x10e')][_0x925a('0x10f')](db[_0x925a('0x1f')],{'as':'VoiceMail','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')][_0x925a('0x10f')](db['UserSetting'],{'as':_0x925a('0x112'),'onDelete':'cascade','foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')][_0x925a('0x113')](db['VoiceRecording'],{'as':_0x925a('0x114'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')][_0x925a('0x113')](db[_0x925a('0x2d')],{'as':'VoiceQueuesRt','foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')]['hasMany'](db['VoiceExtension'],{'as':_0x925a('0x115'),'onDelete':_0x925a('0x110'),'hooks':!![]});db[_0x925a('0x10e')][_0x925a('0x113')](db['CmHopperFinal'],{'as':_0x925a('0x116'),'foreignKey':'UserId'});db['User'][_0x925a('0x113')](db[_0x925a('0x75')],{'as':_0x925a('0x117'),'foreignKey':'UserId'});db[_0x925a('0x10e')]['hasMany'](db[_0x925a('0x118')],{'as':_0x925a('0x118'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')][_0x925a('0x113')](db[_0x925a('0x119')],{'as':_0x925a('0x11a'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')][_0x925a('0x113')](db[_0x925a('0x63')],{'as':_0x925a('0x11b'),'foreignKey':_0x925a('0x111')});db['User'][_0x925a('0x113')](db[_0x925a('0x55')],{'as':_0x925a('0x11c'),'foreignKey':_0x925a('0x111')});db['User']['hasMany'](db[_0x925a('0x4c')],{'as':'FaxInteractions','foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')][_0x925a('0x113')](db[_0x925a('0x3e')],{'as':_0x925a('0x11d'),'foreignKey':'UserId'});db[_0x925a('0x10e')][_0x925a('0x113')](db[_0x925a('0x11e')],{'as':_0x925a('0x11f'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x10e')][_0x925a('0x113')](db[_0x925a('0xfd')],{'as':_0x925a('0x120'),'foreignKey':_0x925a('0x121')});db[_0x925a('0x10e')][_0x925a('0x122')](db[_0x925a('0xf7')],{'as':'UserProfile','foreignKey':_0x925a('0x123')});db['User'][_0x925a('0x124')](db[_0x925a('0x6b')],{'as':_0x925a('0x125'),'through':_0x925a('0x126')});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x6f')],{'as':_0x925a('0x127'),'through':'cm_user_has_contacts'});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0xf4')],{'as':_0x925a('0x128'),'through':'cm_user_has_lists'});db[_0x925a('0x10e')][_0x925a('0x124')](db['Team'],{'through':_0x925a('0x129')});db['User'][_0x925a('0x124')](db['MailInteraction'],{'as':_0x925a('0x11d'),'through':_0x925a('0x12a')});db[_0x925a('0x10e')]['belongsToMany'](db['ChatInteraction'],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x4c')],{'as':_0x925a('0x12b'),'through':'user_has_fax_interactions'});db['User'][_0x925a('0x124')](db[_0x925a('0x55')],{'as':_0x925a('0x11c'),'through':_0x925a('0x12c')});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x119')],{'as':'OpenchannelInteractions','through':_0x925a('0x12d')});db['User'][_0x925a('0x124')](db[_0x925a('0x11e')],{'as':_0x925a('0x11f'),'through':_0x925a('0x12e')});db['User'][_0x925a('0x124')](db[_0x925a('0x19')],{'as':_0x925a('0x12f'),'through':_0x925a('0x130'),'required':![]});db['User'][_0x925a('0x124')](db[_0x925a('0xf5')],{'as':'VoicePrefixes','through':_0x925a('0x10a'),'required':![]});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x3a')],{'as':'MailQueues','through':_0x925a('0x131'),'required':![]});db['User'][_0x925a('0x124')](db[_0x925a('0x69')],{'as':_0x925a('0x132'),'through':_0x925a('0x2f'),'required':![],'hooks':!![]});db[_0x925a('0x10e')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':_0x925a('0x133'),'required':![]});db[_0x925a('0x10e')]['belongsToMany'](db[_0x925a('0x134')],{'as':_0x925a('0x135'),'through':'UserSmsQueue','required':![]});db['User'][_0x925a('0x124')](db[_0x925a('0x136')],{'as':_0x925a('0x137'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x925a('0x124')](db[_0x925a('0x138')],{'as':_0x925a('0x139'),'through':'UserWhatsappQueue','required':![]});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0xf4')],{'through':_0x925a('0x13a')});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x13b')],{'as':_0x925a('0x13c'),'through':_0x925a('0x13d')});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x13e')],{'as':_0x925a('0x13f'),'through':_0x925a('0x140')});db[_0x925a('0x10e')]['belongsToMany'](db[_0x925a('0x141')],{'as':'MailAccounts','through':_0x925a('0x142')});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x5a')],{'as':'OpenchannelAccounts','through':_0x925a('0x143')});db[_0x925a('0x10e')][_0x925a('0x124')](db[_0x925a('0x144')],{'as':'SmsAccounts','through':_0x925a('0x145')});db['User'][_0x925a('0x124')](db[_0x925a('0x146')],{'as':_0x925a('0x147'),'through':_0x925a('0x148')});db[_0x925a('0x10e')]['belongsToMany'](db[_0x925a('0xde')],{'as':'SquareProjects','through':_0x925a('0x149')});db['VoiceChanSpy'][_0x925a('0x113')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0x925a('0x110'),'foreignKey':'ChanSpyId'});db[_0x925a('0x14a')][_0x925a('0x113')](db[_0x925a('0x16')],{'onDelete':_0x925a('0x110')});db[_0x925a('0x16')][_0x925a('0x113')](db[_0x925a('0x16')],{'as':_0x925a('0x14b'),'onDelete':_0x925a('0x110')});db[_0x925a('0x18')][_0x925a('0x124')](db['Sound'],{'as':'Sounds','through':_0x925a('0x14c')});db[_0x925a('0x19')][_0x925a('0x113')](db[_0x925a('0x2d')],{'as':'Members','foreignKey':_0x925a('0x14d')});db[_0x925a('0x19')][_0x925a('0x113')](db[_0x925a('0x71')],{'as':_0x925a('0x14e'),'foreignKey':_0x925a('0x14d')});db[_0x925a('0x19')][_0x925a('0x113')](db[_0x925a('0x14f')],{'as':'HopperFinals','foreignKey':_0x925a('0x14d')});db[_0x925a('0x19')][_0x925a('0x113')](db[_0x925a('0x75')],{'as':_0x925a('0x150'),'foreignKey':'VoiceQueueId'});db[_0x925a('0x19')][_0x925a('0x113')](db['ReportAgentPreview'],{'as':_0x925a('0x118'),'foreignKey':_0x925a('0x14d')});db[_0x925a('0x19')][_0x925a('0x113')](db[_0x925a('0x73')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x925a('0x19')]['hasMany'](db[_0x925a('0xd3')],{'as':_0x925a('0x151'),'foreignKey':'VoiceQueueId'});db[_0x925a('0x19')]['belongsTo'](db[_0x925a('0x29')],{'as':_0x925a('0x29'),'foreignKey':_0x925a('0x152')});db['VoiceQueue'][_0x925a('0x122')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x925a('0x153')});db[_0x925a('0x19')][_0x925a('0x122')](db['Interval'],{'as':_0x925a('0x82'),'foreignKey':'IntervalId'});db[_0x925a('0x19')][_0x925a('0x122')](db[_0x925a('0x154')],{'as':_0x925a('0x155'),'foreignKey':_0x925a('0x156')});db[_0x925a('0x19')][_0x925a('0x124')](db[_0x925a('0xf4')],{'as':_0x925a('0x128'),'through':_0x925a('0x157')});db[_0x925a('0x19')]['belongsToMany'](db['User'],{'as':_0x925a('0x158'),'through':_0x925a('0x130')});db[_0x925a('0x19')]['belongsToMany'](db[_0x925a('0xe2')],{'as':_0x925a('0x159'),'through':'TeamVoiceQueue'});db[_0x925a('0x19')][_0x925a('0x124')](db['CmList'],{'as':_0x925a('0x15a'),'through':_0x925a('0x15b')});db[_0x925a('0x1b')][_0x925a('0x122')](db['User'],{'as':'User','foreignKey':_0x925a('0x111')});db['ScreenRecording']['belongsTo'](db[_0x925a('0x10e')],{'as':_0x925a('0x10e'),'foreignKey':'UserId'});db[_0x925a('0x1f')][_0x925a('0x113')](db['VoiceMailMessage'],{'as':_0x925a('0x15c'),'onDelete':'cascade','foreignKey':_0x925a('0x15d'),'sourceKey':_0x925a('0x15e')});db['VoiceMailMessage']['belongsTo'](db[_0x925a('0x1f')],{'foreignKey':_0x925a('0x15d'),'targetKey':_0x925a('0x15e')});db[_0x925a('0x23')][_0x925a('0x113')](db['VoiceQueueReport'],{'as':_0x925a('0x15f'),'foreignKey':'uniqueid','constraints':![]});db[_0x925a('0x23')][_0x925a('0x113')](db[_0x925a('0x25')],{'as':_0x925a('0x160'),'foreignKey':_0x925a('0x161'),'constraints':![]});db[_0x925a('0x23')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x10e'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x23')]['belongsTo'](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x36')][_0x925a('0x122')](db[_0x925a('0x141')],{'as':_0x925a('0x141'),'foreignKey':_0x925a('0x164')});db[_0x925a('0x36')][_0x925a('0x122')](db[_0x925a('0x107')],{'as':_0x925a('0x107'),'foreignKey':_0x925a('0x165'),'onDelete':_0x925a('0x166')});db[_0x925a('0x38')][_0x925a('0x122')](db[_0x925a('0x141')],{'as':_0x925a('0x141'),'foreignKey':'MailAccountId'});db[_0x925a('0x38')][_0x925a('0x122')](db[_0x925a('0x107')],{'as':_0x925a('0x107'),'foreignKey':_0x925a('0x165'),'onDelete':'restrict'});db[_0x925a('0x141')][_0x925a('0x10f')](db['MailServerIn'],{'as':_0x925a('0x167'),'onDelete':_0x925a('0x110')});db[_0x925a('0x141')][_0x925a('0x10f')](db[_0x925a('0x38')],{'as':_0x925a('0x168'),'onDelete':'cascade'});db[_0x925a('0x141')]['hasMany'](db[_0x925a('0x7f')],{'as':_0x925a('0x169'),'foreignKey':_0x925a('0x164'),'onDelete':_0x925a('0x110')});db[_0x925a('0x141')][_0x925a('0x113')](db['CannedAnswer'],{'as':_0x925a('0x16a'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x925a('0x113')](db['MailMessage'],{'as':_0x925a('0x15c'),'foreignKey':_0x925a('0x164')});db['MailAccount']['hasMany'](db['MailInteraction'],{'as':_0x925a('0x16b')});db[_0x925a('0x141')][_0x925a('0x113')](db[_0x925a('0x16c')],{'as':_0x925a('0x14b')});db[_0x925a('0x141')][_0x925a('0x122')](db['CmList'],{'as':_0x925a('0x16d'),'foreignKey':'ListId'});db[_0x925a('0x141')]['belongsTo'](db[_0x925a('0x8f')],{'as':'Template','foreignKey':_0x925a('0x16e')});db[_0x925a('0x141')][_0x925a('0x122')](db[_0x925a('0x154')],{'as':'mandatoryDispositionPause','foreignKey':_0x925a('0x156')});db[_0x925a('0x141')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x142')});db[_0x925a('0x3a')]['belongsToMany'](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x131')});db[_0x925a('0x3a')][_0x925a('0x124')](db['Team'],{'through':_0x925a('0x16f'),'as':_0x925a('0x159')});db[_0x925a('0x3e')][_0x925a('0x113')](db[_0x925a('0x40')],{'as':_0x925a('0x15c'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x170')});db[_0x925a('0x3e')][_0x925a('0x122')](db[_0x925a('0x141')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x164')});db[_0x925a('0x3e')][_0x925a('0x122')](db['CmContact'],{'as':'Contact','foreignKey':_0x925a('0x163')});db[_0x925a('0x3e')][_0x925a('0x122')](db['User'],{'as':_0x925a('0x172'),'foreignKey':_0x925a('0x111')});db['MailInteraction'][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':_0x925a('0x173'),'as':_0x925a('0x174')});db[_0x925a('0x3e')][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':_0x925a('0x173'),'as':'ThroughTags'});db['MailInteraction']['belongsToMany'](db['User'],{'as':_0x925a('0x175'),'through':'user_has_mail_interactions','foreignKey':_0x925a('0x170')});db['MailMessage']['hasMany'](db[_0x925a('0x176')],{'as':_0x925a('0x177'),'onDelete':_0x925a('0x110')});db[_0x925a('0x40')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x10e')});db[_0x925a('0x40')]['belongsTo'](db[_0x925a('0x6f')],{'onDelete':_0x925a('0x110'),'as':_0x925a('0x162')});db['MailMessage']['belongsTo'](db[_0x925a('0x3e')],{'as':_0x925a('0x178'),'foreignKey':_0x925a('0x170')});db[_0x925a('0x40')][_0x925a('0x122')](db['MailAccount'],{'as':'Account','foreignKey':_0x925a('0x164')});db[_0x925a('0x40')]['belongsTo'](db[_0x925a('0x13b')],{'as':_0x925a('0x13b'),'foreignKey':_0x925a('0x179')});db[_0x925a('0x40')][_0x925a('0x122')](db[_0x925a('0x67')],{'as':_0x925a('0x67'),'foreignKey':'ChatOfflineMessageId'});db[_0x925a('0x16c')][_0x925a('0x122')](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x16c')][_0x925a('0x122')](db['MailQueue'],{'onDelete':_0x925a('0x166')});db[_0x925a('0x16c')][_0x925a('0x122')](db[_0x925a('0x141')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x16c')][_0x925a('0x122')](db['Interval'],{'onDelete':_0x925a('0x166'),'foreignKey':_0x925a('0x17a')});db[_0x925a('0x16c')]['belongsTo'](db[_0x925a('0x8a')],{'onDelete':_0x925a('0x166'),'foreignKey':'TagId'});db[_0x925a('0x43')][_0x925a('0x122')](db[_0x925a('0x141')],{});db[_0x925a('0x43')][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':_0x925a('0x16d'),'foreignKey':_0x925a('0x17b')});db['MailQueueReport']['belongsTo'](db[_0x925a('0x6f')],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport'][_0x925a('0x122')](db['MailInteraction'],{});db[_0x925a('0x43')]['belongsTo'](db[_0x925a('0x40')],{});db[_0x925a('0x43')][_0x925a('0x122')](db[_0x925a('0x10e')],{});db[_0x925a('0x43')][_0x925a('0x122')](db['MailQueue'],{});db[_0x925a('0x45')]['hasMany'](db['DashboardItem'],{'as':_0x925a('0x17c'),'onDelete':_0x925a('0x110')});db[_0x925a('0x13e')][_0x925a('0x113')](db[_0x925a('0x7f')],{'as':_0x925a('0x169'),'foreignKey':_0x925a('0x17d'),'onDelete':_0x925a('0x110')});db['FaxAccount'][_0x925a('0x113')](db[_0x925a('0x7d')],{'as':'Answers','foreignKey':_0x925a('0x17d')});db[_0x925a('0x13e')][_0x925a('0x113')](db[_0x925a('0x4c')],{'as':_0x925a('0x16b')});db[_0x925a('0x13e')][_0x925a('0x113')](db['FaxApplication'],{'as':_0x925a('0x14b')});db[_0x925a('0x13e')][_0x925a('0x113')](db[_0x925a('0x16')],{'as':_0x925a('0x17e'),'onDelete':_0x925a('0x110')});db[_0x925a('0x13e')][_0x925a('0x113')](db[_0x925a('0x4e')],{'as':'Messages'});db['FaxAccount'][_0x925a('0x122')](db[_0x925a('0x29')],{'as':_0x925a('0x29')});db['FaxAccount'][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':_0x925a('0x16d'),'foreignKey':'ListId'});db[_0x925a('0x13e')]['belongsTo'](db['Pause'],{'as':_0x925a('0x155'),'foreignKey':_0x925a('0x156')});db[_0x925a('0x13e')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x140')});db[_0x925a('0x4a')][_0x925a('0x122')](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x4a')]['belongsTo'](db[_0x925a('0x4f')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x4a')][_0x925a('0x122')](db[_0x925a('0x13e')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x4a')]['belongsTo'](db[_0x925a('0x8a')],{'onDelete':_0x925a('0x166'),'foreignKey':_0x925a('0x17f')});db[_0x925a('0x4c')][_0x925a('0x113')](db[_0x925a('0x4e')],{'as':'Messages','onDelete':_0x925a('0x110'),'foreignKey':'FaxInteractionId'});db[_0x925a('0x4c')]['belongsTo'](db[_0x925a('0x13e')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x17d')});db['FaxInteraction'][_0x925a('0x122')](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x4c')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':'Owner','foreignKey':_0x925a('0x111')});db[_0x925a('0x4c')][_0x925a('0x124')](db['Tag'],{'through':_0x925a('0x180'),'as':_0x925a('0x174')});db[_0x925a('0x4c')][_0x925a('0x124')](db['Tag'],{'through':_0x925a('0x180'),'as':_0x925a('0x181')});db['FaxInteraction'][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x175'),'through':'user_has_fax_interactions','foreignKey':_0x925a('0x182')});db[_0x925a('0x4e')][_0x925a('0x122')](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x110'),'as':'User'});db[_0x925a('0x4e')][_0x925a('0x122')](db[_0x925a('0x4c')],{'as':_0x925a('0x178'),'foreignKey':_0x925a('0x182')});db[_0x925a('0x4e')]['belongsTo'](db[_0x925a('0x6f')],{'onDelete':_0x925a('0x110'),'as':'Contact'});db[_0x925a('0x4e')][_0x925a('0x122')](db[_0x925a('0x176')],{'as':_0x925a('0x176'),'foreignKey':'AttachmentId'});db[_0x925a('0x4e')][_0x925a('0x122')](db[_0x925a('0x13e')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x17d')});db[_0x925a('0x4f')][_0x925a('0x124')](db['User'],{'as':_0x925a('0x158'),'through':_0x925a('0x133')});db[_0x925a('0x4f')]['belongsToMany'](db['Team'],{'through':'team_has_fax_queues','as':_0x925a('0x159')});db['FaxQueueReport'][_0x925a('0x122')](db[_0x925a('0x13e')],{});db[_0x925a('0x183')][_0x925a('0x122')](db['CmList'],{'as':'List','foreignKey':_0x925a('0x17b')});db[_0x925a('0x183')][_0x925a('0x122')](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db['FaxQueueReport']['belongsTo'](db['FaxInteraction'],{});db[_0x925a('0x183')][_0x925a('0x122')](db['FaxMessage'],{});db[_0x925a('0x183')]['belongsTo'](db[_0x925a('0x10e')],{});db[_0x925a('0x183')][_0x925a('0x122')](db[_0x925a('0x4f')],{});db['SmsAccount'][_0x925a('0x113')](db[_0x925a('0x7f')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x925a('0x110')});db[_0x925a('0x144')][_0x925a('0x113')](db[_0x925a('0x7d')],{'as':_0x925a('0x16a'),'foreignKey':_0x925a('0x184')});db['SmsAccount']['hasMany'](db[_0x925a('0x57')],{'as':_0x925a('0x15c'),'foreignKey':_0x925a('0x184')});db[_0x925a('0x144')][_0x925a('0x113')](db[_0x925a('0x55')],{'as':_0x925a('0x16b')});db[_0x925a('0x144')][_0x925a('0x113')](db['SmsApplication'],{'as':_0x925a('0x14b')});db[_0x925a('0x144')]['belongsTo'](db['CmList'],{'as':_0x925a('0x16d'),'foreignKey':'ListId'});db[_0x925a('0x144')]['belongsTo'](db[_0x925a('0x154')],{'as':_0x925a('0x155'),'foreignKey':_0x925a('0x156')});db[_0x925a('0x144')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x145')});db['SmsApplication']['belongsTo'](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x53')][_0x925a('0x122')](db['SmsQueue'],{'onDelete':_0x925a('0x166')});db[_0x925a('0x53')][_0x925a('0x122')](db['SmsAccount'],{'onDelete':_0x925a('0x166')});db['SmsApplication'][_0x925a('0x122')](db[_0x925a('0x82')],{'onDelete':_0x925a('0x166'),'foreignKey':_0x925a('0x17a')});db[_0x925a('0x53')][_0x925a('0x122')](db[_0x925a('0x8a')],{'onDelete':'restrict','foreignKey':_0x925a('0x17f')});db['SmsInteraction'][_0x925a('0x113')](db['SmsMessage'],{'as':_0x925a('0x15c'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x185')});db['SmsInteraction'][_0x925a('0x122')](db[_0x925a('0x144')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x184')});db[_0x925a('0x55')][_0x925a('0x122')](db[_0x925a('0x6f')],{'as':'Contact','foreignKey':_0x925a('0x163')});db[_0x925a('0x55')]['belongsTo'](db[_0x925a('0x10e')],{'as':_0x925a('0x172'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x55')][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':_0x925a('0x186'),'as':_0x925a('0x174')});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':_0x925a('0x186'),'as':'ThroughTags'});db[_0x925a('0x55')]['belongsToMany'](db[_0x925a('0x10e')],{'as':_0x925a('0x175'),'through':_0x925a('0x12c'),'foreignKey':'SmsInteractionId'});db[_0x925a('0x57')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x10e')});db[_0x925a('0x57')][_0x925a('0x122')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x925a('0x57')][_0x925a('0x122')](db[_0x925a('0x55')],{'onDelete':_0x925a('0x110'),'as':_0x925a('0x178'),'foreignKey':_0x925a('0x185')});db['SmsMessage'][_0x925a('0x122')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x925a('0x134')]['belongsToMany'](db[_0x925a('0x10e')],{'as':'Agents','through':_0x925a('0x32'),'foreignKey':_0x925a('0x187')});db[_0x925a('0x134')][_0x925a('0x124')](db[_0x925a('0xe2')],{'through':_0x925a('0x188'),'as':_0x925a('0x159')});db[_0x925a('0x5a')][_0x925a('0x113')](db[_0x925a('0x7f')],{'as':_0x925a('0x169'),'foreignKey':_0x925a('0x189'),'onDelete':_0x925a('0x110')});db[_0x925a('0x5a')][_0x925a('0x113')](db['CannedAnswer'],{'as':_0x925a('0x16a'),'foreignKey':_0x925a('0x189')});db[_0x925a('0x5a')][_0x925a('0x113')](db[_0x925a('0x119')],{'as':_0x925a('0x16b'),'foreignKey':_0x925a('0x189')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0x925a('0x15c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x925a('0x113')](db[_0x925a('0x18a')],{'as':_0x925a('0x14b'),'foreignKey':_0x925a('0x189')});db[_0x925a('0x5a')][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':'List','foreignKey':'ListId'});db[_0x925a('0x5a')][_0x925a('0x122')](db[_0x925a('0x154')],{'as':'mandatoryDispositionPause','foreignKey':_0x925a('0x156')});db[_0x925a('0x5a')]['belongsToMany'](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x143')});db[_0x925a('0x18a')][_0x925a('0x122')](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x166')});db['OpenchannelApplication'][_0x925a('0x122')](db['OpenchannelQueue'],{'onDelete':_0x925a('0x166'),'foreignKey':'OpenchannelQueueId'});db[_0x925a('0x18a')]['belongsTo'](db[_0x925a('0x5a')],{'onDelete':_0x925a('0x166'),'foreignKey':_0x925a('0x189')});db[_0x925a('0x18a')][_0x925a('0x122')](db['Interval'],{'onDelete':_0x925a('0x166'),'foreignKey':'IntervalId'});db[_0x925a('0x18a')]['belongsTo'](db[_0x925a('0x8a')],{'onDelete':'restrict','foreignKey':_0x925a('0x17f')});db['OpenchannelInteraction'][_0x925a('0x113')](db[_0x925a('0x5d')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x925a('0x18b')});db[_0x925a('0x119')][_0x925a('0x122')](db[_0x925a('0x5a')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x189')});db[_0x925a('0x119')][_0x925a('0x122')](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':'ContactId'});db[_0x925a('0x119')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x172'),'foreignKey':_0x925a('0x111')});db['OpenchannelInteraction'][_0x925a('0x124')](db['Tag'],{'through':_0x925a('0x18c'),'as':_0x925a('0x174')});db['OpenchannelInteraction'][_0x925a('0x124')](db['Tag'],{'through':_0x925a('0x18c'),'as':'ThroughTags'});db[_0x925a('0x119')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x175'),'through':_0x925a('0x12d'),'foreignKey':_0x925a('0x18b')});db[_0x925a('0x5d')][_0x925a('0x122')](db['User'],{'onDelete':_0x925a('0x110'),'as':_0x925a('0x10e')});db[_0x925a('0x5d')]['belongsTo'](db[_0x925a('0x6f')],{'onDelete':'cascade','as':_0x925a('0x162')});db['OpenchannelMessage'][_0x925a('0x122')](db[_0x925a('0x119')],{'onDelete':_0x925a('0x110'),'as':_0x925a('0x178'),'foreignKey':_0x925a('0x18b')});db[_0x925a('0x5d')][_0x925a('0x122')](db[_0x925a('0x176')],{'as':_0x925a('0x176'),'foreignKey':_0x925a('0x18d')});db['OpenchannelMessage'][_0x925a('0x122')](db[_0x925a('0x5a')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x189')});db['OpenchannelQueue'][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':'Agents','through':_0x925a('0x34'),'foreignKey':_0x925a('0x18e')});db[_0x925a('0x136')][_0x925a('0x124')](db[_0x925a('0xe2')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x925a('0x13b')][_0x925a('0x113')](db[_0x925a('0x7f')],{'as':_0x925a('0x169'),'foreignKey':_0x925a('0x179'),'onDelete':'cascade'});db[_0x925a('0x13b')][_0x925a('0x113')](db[_0x925a('0x7d')],{'as':_0x925a('0x16a'),'foreignKey':_0x925a('0x179')});db['ChatWebsite']['hasMany'](db[_0x925a('0x18f')],{'as':'ProactiveActions'});db['ChatWebsite'][_0x925a('0x113')](db[_0x925a('0x63')],{'as':_0x925a('0x16b')});db['ChatWebsite'][_0x925a('0x113')](db['ChatApplication'],{'as':_0x925a('0x14b')});db[_0x925a('0x13b')][_0x925a('0x113')](db['ChatMessage'],{'as':_0x925a('0x15c')});db[_0x925a('0x13b')]['belongsTo'](db['CmList'],{'as':_0x925a('0x16d'),'foreignKey':_0x925a('0x17b')});db[_0x925a('0x13b')][_0x925a('0x122')](db[_0x925a('0x82')],{'as':'Interval','foreignKey':_0x925a('0x17a')});db[_0x925a('0x13b')][_0x925a('0x122')](db[_0x925a('0x141')],{'as':_0x925a('0x141'),'foreignKey':_0x925a('0x164')});db[_0x925a('0x13b')][_0x925a('0x122')](db[_0x925a('0x154')],{'as':_0x925a('0x155'),'foreignKey':_0x925a('0x156')});db[_0x925a('0x13b')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':'user_has_chat_websites'});db[_0x925a('0x190')]['belongsTo'](db[_0x925a('0x5a')],{});db[_0x925a('0x190')][_0x925a('0x122')](db['CmList'],{'as':_0x925a('0x16d'),'foreignKey':_0x925a('0x17b')});db[_0x925a('0x190')][_0x925a('0x122')](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x190')][_0x925a('0x122')](db[_0x925a('0x119')],{});db['OpenchannelQueueReport'][_0x925a('0x122')](db['OpenchannelMessage'],{});db[_0x925a('0x190')]['belongsTo'](db[_0x925a('0x10e')],{});db[_0x925a('0x190')]['belongsTo'](db[_0x925a('0x136')],{});db[_0x925a('0x61')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x191'),'foreignKey':_0x925a('0x111'),'onDelete':_0x925a('0x166')});db[_0x925a('0x61')]['belongsTo'](db[_0x925a('0x69')],{'as':'Queue','foreignKey':_0x925a('0x192'),'onDelete':'restrict'});db[_0x925a('0x61')]['belongsTo'](db['ChatWebsite'],{'as':_0x925a('0x193'),'foreignKey':_0x925a('0x179'),'onDelete':_0x925a('0x166')});db[_0x925a('0x61')][_0x925a('0x122')](db[_0x925a('0x8a')],{'onDelete':_0x925a('0x166'),'foreignKey':_0x925a('0x17f')});db['ChatInteraction'][_0x925a('0x113')](db[_0x925a('0x65')],{'as':'Messages','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x194')});db[_0x925a('0x63')][_0x925a('0x122')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x925a('0x179')});db[_0x925a('0x63')]['belongsTo'](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x63')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x172'),'foreignKey':_0x925a('0x111')});db['ChatInteraction'][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':_0x925a('0x195'),'as':_0x925a('0x174')});db[_0x925a('0x63')][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':'chat_interaction_has_tags','as':_0x925a('0x181')});db['ChatInteraction'][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x175'),'through':'user_has_chat_interactions','foreignKey':_0x925a('0x194')});db[_0x925a('0x65')][_0x925a('0x122')](db[_0x925a('0x10e')],{'onDelete':'cascade','as':_0x925a('0x10e')});db[_0x925a('0x65')][_0x925a('0x122')](db[_0x925a('0x6f')],{'onDelete':_0x925a('0x110'),'as':_0x925a('0x162'),'foreignKey':'ContactId'});db[_0x925a('0x65')]['belongsTo'](db['ChatInteraction'],{'onDelete':'cascade','as':_0x925a('0x178'),'foreignKey':_0x925a('0x194')});db[_0x925a('0x65')]['belongsTo'](db[_0x925a('0x176')],{'as':_0x925a('0x176'),'foreignKey':_0x925a('0x18d')});db[_0x925a('0x65')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0x925a('0x179')});db[_0x925a('0x67')][_0x925a('0x113')](db[_0x925a('0x176')],{'as':_0x925a('0x177'),'foreignKey':_0x925a('0x196'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0x925a('0x122')](db[_0x925a('0x6f')],{'onDelete':'cascade','as':_0x925a('0x162'),'foreignKey':'ContactId'});db[_0x925a('0x67')][_0x925a('0x122')](db[_0x925a('0x13b')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x179')});db[_0x925a('0x69')]['belongsToMany'](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':'UserChatQueue','hooks':!![]});db[_0x925a('0x69')][_0x925a('0x124')](db[_0x925a('0xe2')],{'through':_0x925a('0x197'),'as':_0x925a('0x159')});db[_0x925a('0x6b')][_0x925a('0x113')](db[_0x925a('0xcf')],{'as':_0x925a('0x15c'),'foreignKey':_0x925a('0x198'),'onDelete':'cascade'});db[_0x925a('0x6b')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x199'),'through':_0x925a('0x126')});db[_0x925a('0x18f')][_0x925a('0x122')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x925a('0x179')});db[_0x925a('0x6d')][_0x925a('0x113')](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x925a('0x6f')][_0x925a('0x113')](db[_0x925a('0x8c')],{'as':_0x925a('0x19a'),'foreignKey':_0x925a('0x19b')});db[_0x925a('0x6f')]['hasMany'](db[_0x925a('0x71')],{'as':_0x925a('0x14e'),'foreignKey':_0x925a('0x163')});db['CmContact'][_0x925a('0x113')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x925a('0x163')});db[_0x925a('0x6f')][_0x925a('0x113')](db[_0x925a('0x75')],{'as':_0x925a('0x150'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x6f')][_0x925a('0x113')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x925a('0x163')});db[_0x925a('0x6f')][_0x925a('0x113')](db[_0x925a('0xd3')],{'as':_0x925a('0x151'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x6f')][_0x925a('0x113')](db[_0x925a('0x119')],{'as':_0x925a('0x11a'),'foreignKey':_0x925a('0x163'),'onDelete':'restrict'});db[_0x925a('0x6f')]['hasMany'](db[_0x925a('0x63')],{'as':_0x925a('0x11b'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x925a('0x113')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x925a('0x163'),'onDelete':_0x925a('0x166')});db[_0x925a('0x6f')][_0x925a('0x113')](db[_0x925a('0x4c')],{'as':'FaxInteractions','foreignKey':_0x925a('0x163'),'onDelete':_0x925a('0x166')});db[_0x925a('0x6f')][_0x925a('0x113')](db[_0x925a('0x3e')],{'as':_0x925a('0x11d'),'foreignKey':_0x925a('0x163'),'onDelete':'restrict'});db[_0x925a('0x6f')][_0x925a('0x122')](db[_0x925a('0x6d')],{'as':'Company','foreignKey':_0x925a('0x19c')});db[_0x925a('0x6f')][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':_0x925a('0x16d'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x925a('0x6f')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x175'),'through':_0x925a('0x19d')});db[_0x925a('0x6f')][_0x925a('0x124')](db['Tag'],{'as':'Tags','through':_0x925a('0x19e')});db['CmContact']['belongsToMany'](db[_0x925a('0x8a')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x925a('0x71')][_0x925a('0x113')](db[_0x925a('0x19f')],{'as':_0x925a('0x1a0'),'foreignKey':'CmHopperId'});db[_0x925a('0x71')][_0x925a('0x122')](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163'),'onDelete':'cascade'});db['CmHopper'][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':_0x925a('0x16d'),'foreignKey':_0x925a('0x17b'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0x925a('0x111')});db['CmHopper']['belongsTo'](db['VoiceQueue'],{'as':_0x925a('0x1a1'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0x925a('0x122')](db['Campaign'],{'as':_0x925a('0xe6'),'foreignKey':'CampaignId','onDelete':_0x925a('0x110')});db['CmHopper'][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x172'),'foreignKey':_0x925a('0x1a2')});db[_0x925a('0x73')]['belongsTo'](db[_0x925a('0x6f')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0x925a('0x73')][_0x925a('0x122')](db['CmList'],{'as':'List','foreignKey':_0x925a('0x17b'),'onDelete':_0x925a('0x110')});db[_0x925a('0x73')][_0x925a('0x122')](db['VoiceQueue'],{'as':_0x925a('0x1a1'),'foreignKey':_0x925a('0x14d'),'onDelete':_0x925a('0x110')});db['CmHopperBlack'][_0x925a('0x122')](db[_0x925a('0xe6')],{'as':_0x925a('0xe6'),'foreignKey':'CampaignId','onDelete':_0x925a('0x110')});db[_0x925a('0x7c')][_0x925a('0x113')](db['Condition'],{'as':{'plural':_0x925a('0x1a3'),'singular':_0x925a('0x1a4')},'foreignKey':'AutomationAllId','onDelete':_0x925a('0x110'),'hooks':!![]});db[_0x925a('0x7c')]['hasMany'](db[_0x925a('0x81')],{'as':{'plural':_0x925a('0x1a5'),'singular':_0x925a('0x1a6')},'foreignKey':_0x925a('0x1a7'),'onDelete':_0x925a('0x110'),'hooks':!![]});db['Automation']['hasMany'](db[_0x925a('0x7a')],{'as':'Actions','foreignKey':_0x925a('0x1a8'),'onDelete':_0x925a('0x110'),'hooks':!![]});db['Disposition'][_0x925a('0x113')](db[_0x925a('0x7f')],{'as':_0x925a('0x169'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0x925a('0x82')]['hasMany'](db[_0x925a('0x82')],{'as':_0x925a('0x1a9'),'foreignKey':_0x925a('0x17a'),'onDelete':_0x925a('0x110'),'hooks':!![],'required':![]});db[_0x925a('0x82')][_0x925a('0x113')](db[_0x925a('0x16')],{'as':_0x925a('0x115'),'foreignKey':_0x925a('0x17a'),'onDelete':_0x925a('0x166')});db[_0x925a('0x82')]['hasMany'](db[_0x925a('0x16c')],{'as':_0x925a('0x1aa'),'foreignKey':_0x925a('0x17a')});db['Interval']['hasMany'](db[_0x925a('0x61')],{'as':_0x925a('0x1ab'),'foreignKey':_0x925a('0x17a')});db[_0x925a('0x82')][_0x925a('0x113')](db[_0x925a('0x4a')],{'as':_0x925a('0x1ac'),'foreignKey':'IntervalId'});db[_0x925a('0x82')][_0x925a('0x113')](db[_0x925a('0x53')],{'as':_0x925a('0x1ad'),'foreignKey':'IntervalId'});db[_0x925a('0x88')][_0x925a('0x122')](db[_0x925a('0x141')],{});db['Schedule'][_0x925a('0x122')](db[_0x925a('0x98')],{'foreignKey':_0x925a('0x1ae')});db[_0x925a('0x88')][_0x925a('0x122')](db[_0x925a('0x96')],{'foreignKey':'CustomReportId'});db[_0x925a('0x1af')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0x925a('0x166')});db[_0x925a('0x8a')][_0x925a('0x124')](db['CmContact'],{'through':_0x925a('0x19e')});db[_0x925a('0x8a')]['belongsToMany'](db[_0x925a('0x63')],{'through':_0x925a('0x195')});db[_0x925a('0x8a')][_0x925a('0x124')](db['MailInteraction'],{'through':_0x925a('0x173')});db[_0x925a('0x8a')][_0x925a('0x124')](db[_0x925a('0x55')],{'through':'sms_interaction_has_tags'});db[_0x925a('0x8a')][_0x925a('0x124')](db['FaxInteraction'],{'through':_0x925a('0x180')});db[_0x925a('0x8a')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x925a('0x18c')});db[_0x925a('0x8a')][_0x925a('0x124')](db[_0x925a('0x11e')],{'through':_0x925a('0x1b0')});db['CmContactHasItem'][_0x925a('0x122')](db[_0x925a('0x1b1')],{'as':_0x925a('0x1b2'),'foreignKey':_0x925a('0x1b3')});db['CmHopperAdditionalPhone'][_0x925a('0x122')](db[_0x925a('0x71')],{'as':_0x925a('0x1b4'),'foreignKey':_0x925a('0x1b5')});db[_0x925a('0x8c')]['belongsTo'](db[_0x925a('0x6f')],{'as':'Contact','foreignKey':'CmContactId'});db[_0x925a('0x91')][_0x925a('0x113')](db[_0x925a('0x81')],{'as':{'plural':_0x925a('0x1b6'),'singular':_0x925a('0x1b7')},'foreignKey':_0x925a('0x1b8'),'onDelete':_0x925a('0x110'),'hooks':!![]});db[_0x925a('0x91')]['hasMany'](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0x925a('0x1b9')},'foreignKey':_0x925a('0x1ba'),'onDelete':_0x925a('0x110'),'hooks':!![]});db[_0x925a('0x91')]['hasMany'](db[_0x925a('0x7a')],{'as':_0x925a('0x1bb'),'foreignKey':_0x925a('0x1bc'),'onDelete':_0x925a('0x110'),'hooks':!![]});db[_0x925a('0x96')][_0x925a('0x113')](db[_0x925a('0x9d')],{'as':'Fields','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1bd'),'hooks':!![]});db['AnalyticDefaultReport'][_0x925a('0x113')](db[_0x925a('0x9d')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x925a('0x1ae')});db[_0x925a('0x9c')][_0x925a('0x113')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1be')});db['AnalyticFieldReport'][_0x925a('0x122')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x925a('0x1bf')][_0x925a('0x113')](db[_0x925a('0xa2')],{'as':_0x925a('0x1c0'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xa2')][_0x925a('0x113')](db[_0x925a('0xa4')],{'as':_0x925a('0x1c2'),'onDelete':'cascade','foreignKey':_0x925a('0x1c3')});db[_0x925a('0xa2')]['hasMany'](db[_0x925a('0xa4')],{'as':'Descriptions','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c4')});db['SalesforceConfiguration'][_0x925a('0x113')](db[_0x925a('0xa4')],{'as':_0x925a('0x1c5'),'onDelete':'cascade','foreignKey':_0x925a('0x1c6')});db[_0x925a('0xa2')][_0x925a('0x122')](db[_0x925a('0x1bf')],{'as':'Account','foreignKey':'AccountId'});db[_0x925a('0xa4')][_0x925a('0x113')](db[_0x925a('0xa4')],{'as':_0x925a('0x1c7'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0xa4')]['hasMany'](db['SalesforceField'],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db[_0x925a('0xa4')]['hasMany'](db[_0x925a('0xa4')],{'as':_0x925a('0x1c9'),'foreignKey':_0x925a('0x1c6')});db[_0x925a('0xa4')][_0x925a('0x122')](db[_0x925a('0x1ca')],{'as':'Variable','foreignKey':_0x925a('0x1cb')});db[_0x925a('0xa6')][_0x925a('0x113')](db[_0x925a('0x1cc')],{'as':_0x925a('0x1c0'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x925a('0x1cc')][_0x925a('0x113')](db[_0x925a('0xa7')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x925a('0x1c3')});db[_0x925a('0x1cc')][_0x925a('0x113')](db[_0x925a('0xa7')],{'as':_0x925a('0x1cd'),'onDelete':_0x925a('0x110'),'foreignKey':'DescriptionId'});db[_0x925a('0x1cc')][_0x925a('0x113')](db['SugarcrmField'],{'as':_0x925a('0x1c5'),'onDelete':'cascade','foreignKey':_0x925a('0x1c6')});db[_0x925a('0x1cc')]['belongsTo'](db[_0x925a('0xa6')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xa7')]['hasMany'](db[_0x925a('0xa7')],{'as':'Subject','foreignKey':'SubjectId'});db['SugarcrmField'][_0x925a('0x113')](db[_0x925a('0xa7')],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db[_0x925a('0xa7')]['hasMany'](db[_0x925a('0xa7')],{'as':_0x925a('0x1c9'),'foreignKey':_0x925a('0x1c6')});db[_0x925a('0xa7')][_0x925a('0x122')](db['Variable'],{'as':'Variable','foreignKey':_0x925a('0x1cb')});db[_0x925a('0xa8')][_0x925a('0x113')](db[_0x925a('0xaa')],{'as':_0x925a('0x1c0'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xaa')][_0x925a('0x113')](db[_0x925a('0xac')],{'as':_0x925a('0x1c2'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0xaa')][_0x925a('0x113')](db[_0x925a('0xac')],{'as':'Descriptions','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c4')});db[_0x925a('0xaa')][_0x925a('0x113')](db[_0x925a('0xac')],{'as':_0x925a('0x1c5'),'onDelete':_0x925a('0x110'),'foreignKey':'FieldId'});db[_0x925a('0xaa')][_0x925a('0x122')](db[_0x925a('0xa8')],{'as':_0x925a('0x171'),'foreignKey':'AccountId'});db[_0x925a('0xaa')]['belongsToMany'](db[_0x925a('0x8a')],{'through':_0x925a('0x1ce')});db[_0x925a('0xac')][_0x925a('0x113')](db[_0x925a('0xac')],{'as':'Subject','foreignKey':_0x925a('0x1c3')});db['DeskField'][_0x925a('0x113')](db[_0x925a('0xac')],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db['DeskField'][_0x925a('0x113')](db[_0x925a('0xac')],{'as':'Field','foreignKey':_0x925a('0x1c6')});db[_0x925a('0xac')][_0x925a('0x122')](db[_0x925a('0x1ca')],{'as':'Variable','foreignKey':_0x925a('0x1cb')});db['ZohoAccount'][_0x925a('0x113')](db['ZohoConfiguration'],{'as':_0x925a('0x1c0'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xb0')][_0x925a('0x113')](db['ZohoField'],{'as':_0x925a('0x1c2'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0xb0')][_0x925a('0x113')](db[_0x925a('0xb2')],{'as':_0x925a('0x1cd'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c4')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':'Fields','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c6')});db[_0x925a('0xb0')]['belongsTo'](db[_0x925a('0xae')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xb2')][_0x925a('0x113')](db['ZohoField'],{'as':'Subject','foreignKey':_0x925a('0x1c3')});db[_0x925a('0xb2')][_0x925a('0x113')](db['ZohoField'],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db['ZohoField'][_0x925a('0x113')](db['ZohoField'],{'as':'Field','foreignKey':_0x925a('0x1c6')});db[_0x925a('0xb2')][_0x925a('0x122')](db[_0x925a('0x1ca')],{'as':_0x925a('0x1ca'),'foreignKey':_0x925a('0x1cb')});db[_0x925a('0xb4')][_0x925a('0x113')](db[_0x925a('0xb6')],{'as':_0x925a('0x1c0'),'onDelete':_0x925a('0x110'),'foreignKey':'AccountId'});db[_0x925a('0xb6')]['hasMany'](db[_0x925a('0xb8')],{'as':_0x925a('0x1c2'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0xb6')][_0x925a('0x113')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x925a('0x1c4')});db['ZendeskConfiguration']['hasMany'](db[_0x925a('0xb8')],{'as':_0x925a('0x1c5'),'foreignKey':_0x925a('0x1c6')});db[_0x925a('0xb6')][_0x925a('0x122')](db['ZendeskAccount'],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xb6')][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':_0x925a('0x1cf')});db[_0x925a('0xb8')][_0x925a('0x113')](db[_0x925a('0xb8')],{'as':_0x925a('0x1c7'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0xb8')][_0x925a('0x113')](db[_0x925a('0xb8')],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db[_0x925a('0xb8')]['hasMany'](db[_0x925a('0xb8')],{'as':'Field','foreignKey':'FieldId'});db[_0x925a('0xb8')][_0x925a('0x122')](db[_0x925a('0x1ca')],{'as':_0x925a('0x1ca'),'foreignKey':_0x925a('0x1cb')});db['FreshdeskAccount'][_0x925a('0x113')](db[_0x925a('0xbb')],{'as':_0x925a('0x1c0'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xbb')][_0x925a('0x113')](db['FreshdeskField'],{'as':_0x925a('0x1c2'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0xbb')][_0x925a('0x113')](db[_0x925a('0x1d0')],{'as':_0x925a('0x1cd'),'onDelete':'cascade','foreignKey':_0x925a('0x1c4')});db[_0x925a('0xbb')][_0x925a('0x113')](db[_0x925a('0x1d0')],{'as':_0x925a('0x1c5'),'onDelete':'cascade','foreignKey':_0x925a('0x1c6')});db['FreshdeskConfiguration'][_0x925a('0x122')](db[_0x925a('0x1d1')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xbb')][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x925a('0x113')](db[_0x925a('0x1d0')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x925a('0x1d0')]['hasMany'](db[_0x925a('0x1d0')],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db['FreshdeskField']['hasMany'](db[_0x925a('0x1d0')],{'as':_0x925a('0x1c9'),'foreignKey':'FieldId'});db[_0x925a('0x1d0')][_0x925a('0x122')](db['Variable'],{'as':_0x925a('0x1ca'),'foreignKey':_0x925a('0x1cb')});db[_0x925a('0xbd')][_0x925a('0x113')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xbf')][_0x925a('0x113')](db[_0x925a('0xc1')],{'as':'Subjects','foreignKey':_0x925a('0x1c3')});db[_0x925a('0xbf')][_0x925a('0x113')](db[_0x925a('0xc1')],{'as':_0x925a('0x1cd'),'foreignKey':_0x925a('0x1c4')});db[_0x925a('0xbf')]['hasMany'](db[_0x925a('0xc1')],{'as':_0x925a('0x1c5'),'foreignKey':_0x925a('0x1c6')});db[_0x925a('0xbf')]['belongsTo'](db[_0x925a('0xbd')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xc1')][_0x925a('0x113')](db[_0x925a('0xc1')],{'as':_0x925a('0x1c7'),'foreignKey':_0x925a('0x1c3')});db['VtigerField']['hasMany'](db[_0x925a('0xc1')],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db['VtigerField']['hasMany'](db[_0x925a('0xc1')],{'as':_0x925a('0x1c9'),'foreignKey':_0x925a('0x1c6')});db['VtigerField'][_0x925a('0x122')](db['Variable'],{'as':_0x925a('0x1ca'),'foreignKey':_0x925a('0x1cb')});db[_0x925a('0xc2')][_0x925a('0x113')](db[_0x925a('0xc3')],{'as':_0x925a('0x1c0'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0xc3')][_0x925a('0x113')](db[_0x925a('0x1d2')],{'as':'Subjects','foreignKey':_0x925a('0x1c3')});db['ServicenowConfiguration']['hasMany'](db[_0x925a('0x1d2')],{'as':_0x925a('0x1cd'),'foreignKey':'DescriptionId'});db[_0x925a('0xc3')][_0x925a('0x113')](db[_0x925a('0x1d2')],{'as':'Fields','foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x925a('0x122')](db[_0x925a('0xc2')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0x1d2')]['hasMany'](db[_0x925a('0x1d2')],{'as':_0x925a('0x1c7'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0x1d2')][_0x925a('0x113')](db[_0x925a('0x1d2')],{'as':_0x925a('0x1c8'),'foreignKey':'DescriptionId'});db[_0x925a('0x1d2')][_0x925a('0x113')](db[_0x925a('0x1d2')],{'as':_0x925a('0x1c9'),'foreignKey':'FieldId'});db[_0x925a('0x1d2')]['belongsTo'](db[_0x925a('0x1ca')],{'as':_0x925a('0x1ca'),'foreignKey':'VariableId'});db['Dynamics365Account']['hasMany'](db[_0x925a('0xc7')],{'as':'Configurations','onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c1')});db[_0x925a('0x1d3')][_0x925a('0x122')](db[_0x925a('0x107')],{'as':'CloudProvider','foreignKey':_0x925a('0x165')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0x925a('0x1c2'),'onDelete':'cascade','foreignKey':_0x925a('0x1c3')});db[_0x925a('0xc7')][_0x925a('0x113')](db['Dynamics365Field'],{'as':_0x925a('0x1cd'),'onDelete':_0x925a('0x110'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x925a('0x113')](db[_0x925a('0x1d4')],{'as':_0x925a('0x1c5'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1c6')});db['Dynamics365Configuration'][_0x925a('0x122')](db[_0x925a('0x1d3')],{'as':_0x925a('0x171'),'foreignKey':'AccountId'});db['Dynamics365Field']['hasMany'](db[_0x925a('0x1d4')],{'as':_0x925a('0x1c7'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0x1d4')][_0x925a('0x113')](db[_0x925a('0x1d4')],{'as':_0x925a('0x1c8'),'foreignKey':_0x925a('0x1c4')});db[_0x925a('0x1d4')][_0x925a('0x113')](db[_0x925a('0x1d4')],{'as':'Field','foreignKey':_0x925a('0x1c6')});db['Dynamics365Field'][_0x925a('0x122')](db[_0x925a('0x1ca')],{'as':'Variable','foreignKey':'VariableId'});db[_0x925a('0xc9')][_0x925a('0x113')](db[_0x925a('0xca')],{'as':_0x925a('0x1c0'),'onDelete':'cascade','foreignKey':_0x925a('0x1c1')});db[_0x925a('0xca')][_0x925a('0x113')](db['FreshsalesField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x925a('0xca')]['hasMany'](db[_0x925a('0xcc')],{'as':_0x925a('0x1cd'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x925a('0x113')](db[_0x925a('0xcc')],{'as':'Fields','foreignKey':_0x925a('0x1c6')});db[_0x925a('0xca')][_0x925a('0x122')](db[_0x925a('0xc9')],{'as':_0x925a('0x171'),'foreignKey':'AccountId'});db[_0x925a('0xcc')]['hasMany'](db[_0x925a('0xcc')],{'as':_0x925a('0x1c7'),'foreignKey':_0x925a('0x1c3')});db[_0x925a('0xcc')][_0x925a('0x113')](db[_0x925a('0xcc')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x925a('0xcc')]['hasMany'](db['FreshsalesField'],{'as':'Field','foreignKey':'FieldId'});db[_0x925a('0xcc')][_0x925a('0x122')](db['Variable'],{'as':_0x925a('0x1ca'),'foreignKey':'VariableId'});db[_0x925a('0x1d5')][_0x925a('0x122')](db[_0x925a('0x13b')],{});db['ChatQueueReport'][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':_0x925a('0x16d'),'foreignKey':_0x925a('0x17b')});db['ChatQueueReport'][_0x925a('0x122')](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x1d5')][_0x925a('0x122')](db[_0x925a('0x63')],{});db[_0x925a('0x1d5')][_0x925a('0x122')](db[_0x925a('0x65')],{});db['ChatQueueReport']['belongsTo'](db[_0x925a('0x10e')],{});db[_0x925a('0x1d5')][_0x925a('0x122')](db['ChatQueue'],{});db[_0x925a('0xcf')]['belongsTo'](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x110'),'foreignKey':'FromId'});db[_0x925a('0xcf')][_0x925a('0x122')](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x110'),'foreignKey':'ToId'});db[_0x925a('0xd3')][_0x925a('0x113')](db[_0x925a('0xd2')],{'foreignKey':_0x925a('0x1d6'),'onDelete':_0x925a('0x110')});db[_0x925a('0xd3')][_0x925a('0x113')](db[_0x925a('0xd1')],{'foreignKey':_0x925a('0x1d6'),'onDelete':_0x925a('0x110')});db[_0x925a('0x1d7')][_0x925a('0x122')](db[_0x925a('0x144')],{});db[_0x925a('0x1d7')][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':_0x925a('0x16d'),'foreignKey':'ListId'});db[_0x925a('0x1d7')]['belongsTo'](db[_0x925a('0x6f')],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db['SmsQueueReport']['belongsTo'](db[_0x925a('0x55')],{});db[_0x925a('0x1d7')][_0x925a('0x122')](db['SmsMessage'],{});db[_0x925a('0x1d7')][_0x925a('0x122')](db[_0x925a('0x10e')],{});db[_0x925a('0x1d7')][_0x925a('0x122')](db[_0x925a('0x134')],{});db['JscriptyProject'][_0x925a('0x113')](db['JscriptySessionReport'],{'foreignKey':_0x925a('0x1d8')});db['JscriptyProject'][_0x925a('0x113')](db[_0x925a('0xd2')],{'foreignKey':'ProjectId'});db[_0x925a('0xd8')][_0x925a('0x113')](db['JscriptyAnswerReport'],{'foreignKey':_0x925a('0x1d8')});db['SquareProject']['belongsToMany'](db['User'],{'as':'Users','through':_0x925a('0x149')});db['Team'][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x129')});db[_0x925a('0xe2')][_0x925a('0x124')](db['VoiceQueue'],{'through':_0x925a('0x1d9'),'as':_0x925a('0x12f')});db[_0x925a('0xe2')][_0x925a('0x124')](db[_0x925a('0x3a')],{'through':_0x925a('0x16f'),'as':'MailQueues'});db[_0x925a('0xe2')][_0x925a('0x124')](db['ChatQueue'],{'through':_0x925a('0x197'),'as':_0x925a('0x132')});db[_0x925a('0xe2')][_0x925a('0x124')](db[_0x925a('0x4f')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x925a('0xe2')][_0x925a('0x124')](db[_0x925a('0x134')],{'through':_0x925a('0x188'),'as':_0x925a('0x135')});db['Team']['belongsToMany'](db[_0x925a('0x136')],{'through':_0x925a('0x1da'),'as':_0x925a('0x137')});db[_0x925a('0xe2')]['belongsToMany'](db['WhatsappQueue'],{'through':_0x925a('0x1db'),'as':_0x925a('0x139')});db[_0x925a('0xe2')][_0x925a('0x124')](db[_0x925a('0xf5')],{'through':_0x925a('0x1dc'),'as':_0x925a('0x1dd')});db[_0x925a('0xe6')][_0x925a('0x113')](db['CmHopper'],{'as':_0x925a('0x14e'),'foreignKey':_0x925a('0x1de')});db[_0x925a('0xe6')][_0x925a('0x113')](db[_0x925a('0x14f')],{'as':_0x925a('0x116'),'foreignKey':_0x925a('0x1de')});db[_0x925a('0xe6')][_0x925a('0x113')](db[_0x925a('0x75')],{'as':_0x925a('0x150'),'foreignKey':_0x925a('0x1de')});db[_0x925a('0xe6')][_0x925a('0x113')](db[_0x925a('0x73')],{'as':_0x925a('0x1df'),'foreignKey':_0x925a('0x1de')});db[_0x925a('0xe6')][_0x925a('0x122')](db[_0x925a('0x29')],{'as':_0x925a('0x29'),'foreignKey':_0x925a('0x152')});db[_0x925a('0xe6')][_0x925a('0x122')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x925a('0x153')});db[_0x925a('0xe6')]['belongsTo'](db['Interval'],{'as':_0x925a('0x82'),'foreignKey':_0x925a('0x17a')});db[_0x925a('0xe6')][_0x925a('0x122')](db[_0x925a('0xde')],{'as':_0x925a('0xde'),'foreignKey':_0x925a('0x1e0')});db[_0x925a('0xe6')][_0x925a('0x124')](db[_0x925a('0xf4')],{'as':_0x925a('0x128'),'through':_0x925a('0x1e1')});db[_0x925a('0xe6')]['belongsToMany'](db[_0x925a('0xf4')],{'as':_0x925a('0x15a'),'through':_0x925a('0x1e2')});db['Attachment']['belongsTo'](db[_0x925a('0x67')],{'as':_0x925a('0x67'),'foreignKey':'ChatOfflineMessageId'});db[_0x925a('0xeb')][_0x925a('0x122')](db[_0x925a('0x40')],{});db['MailTransferReport'][_0x925a('0x122')](db['MailInteraction'],{});db['MailTransferReport'][_0x925a('0x122')](db[_0x925a('0x141')],{'foreignKey':_0x925a('0x1e3'),'as':'FromAccount'});db[_0x925a('0xeb')][_0x925a('0x122')](db[_0x925a('0x10e')],{'foreignKey':_0x925a('0x1e4'),'as':_0x925a('0x1e5')});db[_0x925a('0xeb')]['belongsTo'](db[_0x925a('0x10e')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x925a('0xeb')][_0x925a('0x122')](db['MailQueue'],{'foreignKey':_0x925a('0x1e6'),'as':'ToQueue'});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0x925a('0x1e7'),'as':_0x925a('0x1e8')});db[_0x925a('0xed')][_0x925a('0x122')](db[_0x925a('0x65')],{});db[_0x925a('0xed')][_0x925a('0x122')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x925a('0x122')](db[_0x925a('0x13b')],{'foreignKey':_0x925a('0x1e9'),'as':_0x925a('0x1ea')});db[_0x925a('0xed')]['belongsTo'](db[_0x925a('0x10e')],{'foreignKey':'FromUserId','as':_0x925a('0x1e5')});db[_0x925a('0xed')][_0x925a('0x122')](db[_0x925a('0x10e')],{'foreignKey':_0x925a('0x1eb'),'as':_0x925a('0x1ec')});db['ChatTransferReport'][_0x925a('0x122')](db[_0x925a('0x69')],{'foreignKey':'ToChatQueueId','as':_0x925a('0x1ed')});db[_0x925a('0xed')]['belongsTo'](db[_0x925a('0x13b')],{'foreignKey':_0x925a('0x1ee'),'as':'ToAccount'});db[_0x925a('0xef')][_0x925a('0x122')](db['FaxMessage'],{});db[_0x925a('0xef')][_0x925a('0x122')](db['FaxInteraction'],{});db[_0x925a('0xef')][_0x925a('0x122')](db[_0x925a('0x13e')],{'foreignKey':'FromFaxAccountId','as':_0x925a('0x1ea')});db['FaxTransferReport'][_0x925a('0x122')](db[_0x925a('0x10e')],{'foreignKey':'FromUserId','as':_0x925a('0x1e5')});db['FaxTransferReport'][_0x925a('0x122')](db['User'],{'foreignKey':_0x925a('0x1eb'),'as':_0x925a('0x1ec')});db['FaxTransferReport'][_0x925a('0x122')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x925a('0x1ed')});db['FaxTransferReport'][_0x925a('0x122')](db['FaxAccount'],{'foreignKey':_0x925a('0x1ef'),'as':_0x925a('0x1e8')});db['OpenchannelTransferReport'][_0x925a('0x122')](db['OpenchannelMessage'],{});db[_0x925a('0xf1')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x925a('0x122')](db['OpenchannelAccount'],{'foreignKey':_0x925a('0x1f0'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x925a('0x122')](db[_0x925a('0x10e')],{'foreignKey':_0x925a('0x1e4'),'as':_0x925a('0x1e5')});db[_0x925a('0xf1')]['belongsTo'](db['User'],{'foreignKey':_0x925a('0x1eb'),'as':_0x925a('0x1ec')});db['OpenchannelTransferReport']['belongsTo'](db[_0x925a('0x136')],{'foreignKey':_0x925a('0x1f1'),'as':_0x925a('0x1ed')});db[_0x925a('0xf1')][_0x925a('0x122')](db[_0x925a('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0x925a('0x1e8')});db[_0x925a('0xf2')][_0x925a('0x122')](db[_0x925a('0x57')],{});db['SmsTransferReport'][_0x925a('0x122')](db[_0x925a('0x55')],{});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x925a('0x1f2'),'as':_0x925a('0x1ea')});db[_0x925a('0xf2')][_0x925a('0x122')](db[_0x925a('0x10e')],{'foreignKey':_0x925a('0x1e4'),'as':_0x925a('0x1e5')});db['SmsTransferReport'][_0x925a('0x122')](db[_0x925a('0x10e')],{'foreignKey':'ToUserId','as':_0x925a('0x1ec')});db[_0x925a('0xf2')][_0x925a('0x122')](db['SmsQueue'],{'foreignKey':_0x925a('0x1f3'),'as':_0x925a('0x1ed')});db[_0x925a('0xf2')][_0x925a('0x122')](db[_0x925a('0x144')],{'foreignKey':_0x925a('0x1f4'),'as':'ToAccount'});db[_0x925a('0xf4')][_0x925a('0x113')](db[_0x925a('0x7f')],{'as':_0x925a('0x169'),'foreignKey':_0x925a('0x17b'),'onDelete':_0x925a('0x110')});db[_0x925a('0xf4')][_0x925a('0x113')](db[_0x925a('0x78')],{'as':_0x925a('0x1f5'),'foreignKey':_0x925a('0x17b')});db[_0x925a('0xf4')][_0x925a('0x113')](db['CmContact'],{'as':_0x925a('0x127'),'onDelete':'cascade','foreignKey':_0x925a('0x17b')});db[_0x925a('0xf4')][_0x925a('0x113')](db[_0x925a('0x14f')],{'as':'HopperFinals','foreignKey':_0x925a('0x17b')});db[_0x925a('0xf4')][_0x925a('0x113')](db['CmHopperHistory'],{'as':_0x925a('0x117'),'foreignKey':_0x925a('0x17b')});db[_0x925a('0xf4')][_0x925a('0x113')](db[_0x925a('0x118')],{'as':_0x925a('0x118'),'foreignKey':_0x925a('0x17b')});db[_0x925a('0xf4')]['belongsToMany'](db[_0x925a('0x19')],{'as':_0x925a('0x1f6'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0x925a('0x124')](db['User'],{'as':_0x925a('0x158'),'through':_0x925a('0x13a')});db[_0x925a('0xf5')][_0x925a('0x113')](db[_0x925a('0x16')],{'as':_0x925a('0x115'),'onDelete':'cascade'});db['VoicePrefix']['belongsToMany'](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x10a')});db[_0x925a('0xf5')]['belongsToMany'](db['Team'],{'through':_0x925a('0x1dc'),'as':'Teams'});db[_0x925a('0xf7')][_0x925a('0x113')](db[_0x925a('0x10e')],{'as':_0x925a('0x175'),'foreignKey':'userProfileId'});db[_0x925a('0xf7')][_0x925a('0x113')](db[_0x925a('0xf9')],{'as':'UserProfileSections','foreignKey':_0x925a('0x123'),'onDelete':_0x925a('0x110')});db['UserProfileSection'][_0x925a('0x113')](db[_0x925a('0xfb')],{'as':_0x925a('0x1f7'),'foreignKey':_0x925a('0x1f8'),'onDelete':_0x925a('0x110')});db[_0x925a('0x146')][_0x925a('0x113')](db[_0x925a('0x7f')],{'as':_0x925a('0x169'),'foreignKey':_0x925a('0x1f9'),'onDelete':_0x925a('0x110')});db['WhatsappAccount'][_0x925a('0x113')](db['CannedAnswer'],{'as':_0x925a('0x16a'),'foreignKey':_0x925a('0x1f9')});db[_0x925a('0x146')]['hasMany'](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0x925a('0x1f9')});db[_0x925a('0x146')][_0x925a('0x113')](db[_0x925a('0x11e')],{'as':'Interactions'});db['WhatsappAccount'][_0x925a('0x113')](db[_0x925a('0x100')],{'as':_0x925a('0x14b')});db[_0x925a('0x146')]['belongsTo'](db[_0x925a('0xf4')],{'as':'List','foreignKey':_0x925a('0x17b')});db[_0x925a('0x146')]['belongsTo'](db[_0x925a('0x154')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x925a('0x146')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x148')});db[_0x925a('0x100')][_0x925a('0x122')](db[_0x925a('0x10e')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x100')][_0x925a('0x122')](db['WhatsappQueue'],{'onDelete':'restrict'});db[_0x925a('0x100')][_0x925a('0x122')](db[_0x925a('0x146')],{'onDelete':_0x925a('0x166')});db[_0x925a('0x100')][_0x925a('0x122')](db[_0x925a('0x82')],{'onDelete':_0x925a('0x166'),'foreignKey':_0x925a('0x17a')});db[_0x925a('0x100')][_0x925a('0x122')](db[_0x925a('0x8a')],{'onDelete':_0x925a('0x166'),'foreignKey':'TagId'});db[_0x925a('0x11e')][_0x925a('0x113')](db['WhatsappMessage'],{'as':_0x925a('0x15c'),'onDelete':_0x925a('0x110'),'foreignKey':_0x925a('0x1fa')});db[_0x925a('0x11e')][_0x925a('0x122')](db[_0x925a('0x146')],{'as':'Account','foreignKey':_0x925a('0x1f9')});db[_0x925a('0x11e')][_0x925a('0x122')](db['CmContact'],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x11e')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':_0x925a('0x172'),'foreignKey':_0x925a('0x111')});db[_0x925a('0x11e')]['belongsToMany'](db[_0x925a('0x8a')],{'through':_0x925a('0x1b0'),'as':_0x925a('0x174')});db[_0x925a('0x11e')][_0x925a('0x124')](db[_0x925a('0x8a')],{'through':_0x925a('0x1b0'),'as':_0x925a('0x181')});db[_0x925a('0x11e')][_0x925a('0x124')](db['User'],{'as':_0x925a('0x175'),'through':_0x925a('0x12e'),'foreignKey':'WhatsappInteractionId'});db[_0x925a('0x1fb')][_0x925a('0x122')](db[_0x925a('0x10e')],{'as':'User'});db[_0x925a('0x1fb')]['belongsTo'](db[_0x925a('0x6f')],{'onDelete':_0x925a('0x110'),'as':_0x925a('0x162')});db[_0x925a('0x1fb')]['belongsTo'](db[_0x925a('0x11e')],{'onDelete':_0x925a('0x110'),'as':_0x925a('0x178'),'foreignKey':_0x925a('0x1fa')});db['WhatsappMessage'][_0x925a('0x122')](db[_0x925a('0x146')],{'as':_0x925a('0x171'),'foreignKey':_0x925a('0x1f9')});db[_0x925a('0x104')][_0x925a('0x122')](db['WhatsappAccount'],{});db[_0x925a('0x104')][_0x925a('0x122')](db[_0x925a('0xf4')],{'as':_0x925a('0x16d'),'foreignKey':'ListId'});db['WhatsappQueueReport'][_0x925a('0x122')](db['CmContact'],{'as':_0x925a('0x162'),'foreignKey':_0x925a('0x163')});db[_0x925a('0x104')]['belongsTo'](db[_0x925a('0x11e')],{});db[_0x925a('0x104')][_0x925a('0x122')](db[_0x925a('0x138')],{});db[_0x925a('0x104')][_0x925a('0x122')](db[_0x925a('0x1fb')],{});db[_0x925a('0x104')][_0x925a('0x122')](db['User'],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappMessage'],{});db[_0x925a('0x1fc')][_0x925a('0x122')](db[_0x925a('0x11e')],{});db[_0x925a('0x1fc')][_0x925a('0x122')](db[_0x925a('0x146')],{'foreignKey':'FromWhatsappAccountId','as':_0x925a('0x1ea')});db['WhatsappTransferReport']['belongsTo'](db[_0x925a('0x146')],{'foreignKey':_0x925a('0x1fd'),'as':_0x925a('0x1e8')});db[_0x925a('0x1fc')]['belongsTo'](db[_0x925a('0x138')],{'foreignKey':_0x925a('0x1fe'),'as':_0x925a('0x1ed')});db[_0x925a('0x1fc')]['belongsTo'](db[_0x925a('0x10e')],{'foreignKey':_0x925a('0x1e4'),'as':'FromAgent'});db[_0x925a('0x1fc')][_0x925a('0x122')](db[_0x925a('0x10e')],{'foreignKey':_0x925a('0x1eb'),'as':'ToAgent'});db[_0x925a('0x138')][_0x925a('0x124')](db[_0x925a('0x10e')],{'as':_0x925a('0x158'),'through':_0x925a('0x1ff'),'foreignKey':_0x925a('0x200')});db[_0x925a('0x138')][_0x925a('0x124')](db[_0x925a('0xe2')],{'through':'team_has_whatsapp_queues','as':_0x925a('0x159')});db[_0x925a('0x10c')][_0x925a('0x122')](db['User'],{'as':_0x925a('0x201'),'foreignKey':'UserId','onDelete':_0x925a('0x110'),'hooks':!![]});db[_0x925a('0x107')]['hasOne'](db[_0x925a('0x1d3')],{'as':'Dynamics365Account','onDelete':_0x925a('0x166')});db[_0x925a('0x107')][_0x925a('0x10f')](db[_0x925a('0x36')],{'as':'Imap','onDelete':_0x925a('0x166')});db['CloudProvider']['hasOne'](db[_0x925a('0x38')],{'as':_0x925a('0x168'),'onDelete':_0x925a('0x166')});module[_0x925a('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 53ec239..4ad9498 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea73=['./api/integrationReport','/api/analytics/custom_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','/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/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','./api/user','use','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports'];(function(_0x5280f4,_0x3c36d0){var _0xba93e7=function(_0x14d63a){while(--_0x14d63a){_0x5280f4['push'](_0x5280f4['shift']());}};_0xba93e7(++_0x3c36d0);}(_0xea73,0x95));var _0x3ea7=function(_0x1eaef1,_0x30f0f6){_0x1eaef1=_0x1eaef1-0x0;var _0x4d9c81=_0xea73[_0x1eaef1];return _0x4d9c81;};'use strict';var path=require(_0x3ea7('0x0'));var express=require(_0x3ea7('0x1'));var errors=require(_0x3ea7('0x2'));var config=require(_0x3ea7('0x3'));var setupLoggers=require(_0x3ea7('0x4'))['setupLoggers'];var clientSideLogs=require(_0x3ea7('0x5'));exports[_0x3ea7('0x6')]=function(_0x1f1c76){return setupLoggers(_0x1f1c76)['then'](function(){_0x1f1c76['use']('/api/users',require(_0x3ea7('0x7')));_0x1f1c76[_0x3ea7('0x8')]('/api/voice/chanspy',require(_0x3ea7('0x9')));_0x1f1c76['use']('/api/voice/contexts',require(_0x3ea7('0xa')));_0x1f1c76[_0x3ea7('0x8')]('/api/voice/extensions',require(_0x3ea7('0xb')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xc'),require('./api/voiceMusicOnHold'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xd'),require(_0x3ea7('0xe')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xf'),require(_0x3ea7('0x10')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x11'),require(_0x3ea7('0x12')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x13'),require(_0x3ea7('0x14')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x15'),require(_0x3ea7('0x16')));_0x1f1c76['use'](_0x3ea7('0x17'),require(_0x3ea7('0x18')));_0x1f1c76[_0x3ea7('0x8')]('/api/voice/dials/reports',require(_0x3ea7('0x19')));_0x1f1c76[_0x3ea7('0x8')]('/api/voice/agents/reports',require(_0x3ea7('0x1a')));_0x1f1c76['use'](_0x3ea7('0x1b'),require(_0x3ea7('0x1c')));_0x1f1c76[_0x3ea7('0x8')]('/api/members/reports',require(_0x3ea7('0x1d')));_0x1f1c76[_0x3ea7('0x8')]('/api/trunks',require(_0x3ea7('0x1e')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x1f'),require('./api/voiceTransferReport'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x20'),require('./api/mailServerOut'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x21'),require(_0x3ea7('0x22')));_0x1f1c76['use'](_0x3ea7('0x23'),require(_0x3ea7('0x24')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x25'),require('./api/mailSubstatus'));_0x1f1c76['use']('/api/mail/interactions',require(_0x3ea7('0x26')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x27'),require(_0x3ea7('0x28')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x29'),require(_0x3ea7('0x2a')));_0x1f1c76['use'](_0x3ea7('0x2b'),require(_0x3ea7('0x2c')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x2d'),require(_0x3ea7('0x2e')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x2f'),require(_0x3ea7('0x30')));_0x1f1c76[_0x3ea7('0x8')]('/api/fax/accounts',require(_0x3ea7('0x31')));_0x1f1c76[_0x3ea7('0x8')]('/api/fax/applications',require(_0x3ea7('0x32')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x33'),require(_0x3ea7('0x34')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x35'),require(_0x3ea7('0x36')));_0x1f1c76['use'](_0x3ea7('0x37'),require(_0x3ea7('0x38')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x39'),require(_0x3ea7('0x3a')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x3b'),require(_0x3ea7('0x3c')));_0x1f1c76[_0x3ea7('0x8')]('/api/sms/applications',require(_0x3ea7('0x3d')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x3e'),require(_0x3ea7('0x3f')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x40'),require(_0x3ea7('0x41')));_0x1f1c76['use'](_0x3ea7('0x42'),require(_0x3ea7('0x43')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x44'),require(_0x3ea7('0x45')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x46'),require('./api/openchannelApplication'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x47'),require(_0x3ea7('0x48')));_0x1f1c76[_0x3ea7('0x8')]('/api/openchannel/messages',require(_0x3ea7('0x49')));_0x1f1c76['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x4a'),require('./api/chatWebsite'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x4b'),require('./api/openchannelQueueReport'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x4c'),require(_0x3ea7('0x4d')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x4e'),require('./api/chatInteraction'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x4f'),require(_0x3ea7('0x50')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x51'),require(_0x3ea7('0x52')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x53'),require(_0x3ea7('0x54')));_0x1f1c76['use']('/api/chat/groups',require(_0x3ea7('0x55')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x56'),require(_0x3ea7('0x57')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x58'),require(_0x3ea7('0x59')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x5a'),require(_0x3ea7('0x5b')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x5c'),require('./api/cmHopper'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x5d'),require('./api/cmHopperBlack'));_0x1f1c76[_0x3ea7('0x8')]('/api/cm/hopper_final',require(_0x3ea7('0x5e')));_0x1f1c76[_0x3ea7('0x8')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x1f1c76['use'](_0x3ea7('0x5f'),require(_0x3ea7('0x60')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x61'),require(_0x3ea7('0x62')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x63'),require(_0x3ea7('0x64')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x65'),require(_0x3ea7('0x66')));_0x1f1c76[_0x3ea7('0x8')]('/api/dispositions',require(_0x3ea7('0x67')));_0x1f1c76['use'](_0x3ea7('0x68'),require(_0x3ea7('0x69')));_0x1f1c76[_0x3ea7('0x8')]('/api/intervals',require(_0x3ea7('0x6a')));_0x1f1c76['use'](_0x3ea7('0x6b'),require(_0x3ea7('0x6c')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x6d'),require(_0x3ea7('0x6e')));_0x1f1c76['use'](_0x3ea7('0x6f'),require(_0x3ea7('0x70')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x71'),require(_0x3ea7('0x72')));_0x1f1c76['use']('/api/sounds',require(_0x3ea7('0x73')));_0x1f1c76[_0x3ea7('0x8')]('/api/tags',require(_0x3ea7('0x74')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x75'),require(_0x3ea7('0x76')));_0x1f1c76[_0x3ea7('0x8')]('/api/cm_contact_has_items',require(_0x3ea7('0x77')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x78'),require(_0x3ea7('0x79')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x7a'),require(_0x3ea7('0x7b')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x7c'),require(_0x3ea7('0x7d')));_0x1f1c76['use'](_0x3ea7('0x7e'),require(_0x3ea7('0x7f')));_0x1f1c76['use'](_0x3ea7('0x80'),require(_0x3ea7('0x81')));_0x1f1c76['use'](_0x3ea7('0x82'),require(_0x3ea7('0x83')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x84'),require('./api/analyticCustomReport'));_0x1f1c76['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x85'),require('./api/analyticExtractedReport'));_0x1f1c76['use'](_0x3ea7('0x86'),require(_0x3ea7('0x87')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x88'),require(_0x3ea7('0x89')));_0x1f1c76['use']('/api/analytics/tree_reports',require(_0x3ea7('0x8a')));_0x1f1c76['use'](_0x3ea7('0x8b'),require(_0x3ea7('0x8c')));_0x1f1c76[_0x3ea7('0x8')]('/api/integrations/salesforce/configurations',require(_0x3ea7('0x8d')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x8e'),require('./api/intSalesforceField'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x8f'),require('./api/intSugarcrmAccount'));_0x1f1c76['use'](_0x3ea7('0x90'),require(_0x3ea7('0x91')));_0x1f1c76[_0x3ea7('0x8')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x92'),require('./api/intDeskAccount'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x93'),require(_0x3ea7('0x94')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x95'),require(_0x3ea7('0x96')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x97'),require(_0x3ea7('0x98')));_0x1f1c76['use'](_0x3ea7('0x99'),require(_0x3ea7('0x9a')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x9b'),require('./api/intZohoField'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x9c'),require(_0x3ea7('0x9d')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x9e'),require('./api/intZendeskConfiguration'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x9f'),require(_0x3ea7('0xa0')));_0x1f1c76[_0x3ea7('0x8')]('/api/integrations/freshdesk/accounts',require(_0x3ea7('0xa1')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xa2'),require(_0x3ea7('0xa3')));_0x1f1c76['use'](_0x3ea7('0xa4'),require(_0x3ea7('0xa5')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xa6'),require('./api/intVtigerAccount'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xa7'),require('./api/intVtigerConfiguration'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xa8'),require(_0x3ea7('0xa9')));_0x1f1c76['use']('/api/integrations/servicenow/accounts',require(_0x3ea7('0xaa')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xab'),require(_0x3ea7('0xac')));_0x1f1c76[_0x3ea7('0x8')]('/api/integrations/servicenow/fields',require(_0x3ea7('0xad')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xae'),require('./api/intDynamics365Account'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xaf'),require(_0x3ea7('0xb0')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xb1'),require(_0x3ea7('0xb2')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xb3'),require(_0x3ea7('0xb4')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xb5'),require(_0x3ea7('0xb6')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xb7'),require(_0x3ea7('0xb8')));_0x1f1c76[_0x3ea7('0x8')]('/api/networks',require(_0x3ea7('0xb9')));_0x1f1c76['use'](_0x3ea7('0xba'),require('./api/chatQueueReport'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xbb'),require(_0x3ea7('0xbc')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xbd'),require(_0x3ea7('0xbe')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xbf'),require(_0x3ea7('0xc0')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xc1'),require(_0x3ea7('0xc2')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xc3'),require(_0x3ea7('0xc4')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xc5'),require(_0x3ea7('0xc6')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xc7'),require(_0x3ea7('0xc8')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xc9'),require(_0x3ea7('0xca')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xcb'),require(_0x3ea7('0xcc')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xcd'),require(_0x3ea7('0xce')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xcf'),require(_0x3ea7('0xd0')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xd1'),require(_0x3ea7('0xd2')));_0x1f1c76['use'](_0x3ea7('0xd3'),require('./api/squareMessage'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xd4'),require(_0x3ea7('0xd5')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xd6'),require(_0x3ea7('0xd7')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xd8'),require(_0x3ea7('0xd9')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xda'),require(_0x3ea7('0xdb')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xdc'),require(_0x3ea7('0xdd')));_0x1f1c76['use']('/api/plugins',require('./api/plugin'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xde'),require(_0x3ea7('0xdf')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xe0'),require(_0x3ea7('0xe1')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xe2'),require('./api/faxTransferReport'));_0x1f1c76[_0x3ea7('0x8')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xe3'),require(_0x3ea7('0xe4')));_0x1f1c76['use']('/api/cm/lists',require(_0x3ea7('0xe5')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xe6'),require(_0x3ea7('0xe7')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xe8'),require(_0x3ea7('0xe9')));_0x1f1c76[_0x3ea7('0x8')]('/api/userProfile/sections',require(_0x3ea7('0xea')));_0x1f1c76['use'](_0x3ea7('0xeb'),require('./api/userProfileResource'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xec'),require('./api/userNotification'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xed'),require(_0x3ea7('0xee')));_0x1f1c76[_0x3ea7('0x8')]('/api/whatsapp/applications',require(_0x3ea7('0xef')));_0x1f1c76['use']('/api/whatsapp/interactions',require(_0x3ea7('0xf0')));_0x1f1c76[_0x3ea7('0x8')]('/api/whatsapp/messages',require(_0x3ea7('0xf1')));_0x1f1c76['use'](_0x3ea7('0xf2'),require('./api/whatsappQueueReport'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xf3'),require(_0x3ea7('0xf4')));_0x1f1c76['use']('/api/whatsapp/queues',require(_0x3ea7('0xf5')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xf6'),require(_0x3ea7('0xf7')));_0x1f1c76[_0x3ea7('0x8')]('/api/realtime',require('./api/realtime'));_0x1f1c76['use']('/api/user-settings',require('./api/user-setting'));_0x1f1c76['use'](_0x3ea7('0xf8'),require(_0x3ea7('0xf9')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xfa'),require('./api/authGoogle'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xfb'),require(_0x3ea7('0xfc')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0xfd'),require(_0x3ea7('0xfe')));_0x1f1c76['use'](_0x3ea7('0xff'),require(_0x3ea7('0x100')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x101'),require(_0x3ea7('0x102')));_0x1f1c76['use'](_0x3ea7('0x103'),require(_0x3ea7('0x104')));_0x1f1c76[_0x3ea7('0x8')]('/api/pm2',require('./api/pm2'));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x105'),require(_0x3ea7('0x106')));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x107'),clientSideLogs);_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x108'),express[_0x3ea7('0x109')](path[_0x3ea7('0x10a')](config[_0x3ea7('0x10b')],_0x3ea7('0x108'))));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x10c'),express[_0x3ea7('0x109')](path[_0x3ea7('0x10a')](config[_0x3ea7('0x10b')],_0x3ea7('0x10c'))));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x10d'),express['static'](path[_0x3ea7('0x10a')](config['root'],_0x3ea7('0x10d'))));_0x1f1c76[_0x3ea7('0x8')]('/snippet',express['static'](path[_0x3ea7('0x10a')](config[_0x3ea7('0x10b')],_0x3ea7('0x10e'),_0x3ea7('0x10f'))));_0x1f1c76[_0x3ea7('0x8')](_0x3ea7('0x110'),express[_0x3ea7('0x109')](path[_0x3ea7('0x10a')](config[_0x3ea7('0x10b')],_0x3ea7('0x111'))));_0x1f1c76[_0x3ea7('0x112')](_0x3ea7('0x113'))['get'](errors[0x194]);_0x1f1c76[_0x3ea7('0x112')]('/*')[_0x3ea7('0x114')](function(_0x1a9f31,_0x367d5e){_0x367d5e[_0x3ea7('0x115')](path['resolve'](_0x1f1c76[_0x3ea7('0x114')](_0x3ea7('0x116'))+_0x3ea7('0x117')));});return _0x1f1c76;});}; \ No newline at end of file +var _0x0e6a=['/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./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/intDeskConfiguration','/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/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/version','/api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','3.0.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x0e6a,0xca));var _0xa0e6=function(_0x4cd727,_0x37335e){_0x4cd727=_0x4cd727-0x0;var _0x9f3a81=_0x0e6a[_0x4cd727];return _0x9f3a81;};'use strict';var path=require('path');var express=require(_0xa0e6('0x0'));var errors=require(_0xa0e6('0x1'));var config=require(_0xa0e6('0x2'));var setupLoggers=require(_0xa0e6('0x3'))[_0xa0e6('0x4')];var clientSideLogs=require(_0xa0e6('0x5'));exports[_0xa0e6('0x6')]=function(_0x1ea038){return setupLoggers(_0x1ea038)[_0xa0e6('0x7')](function(){_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x9'),require(_0xa0e6('0xa')));_0x1ea038['use'](_0xa0e6('0xb'),require(_0xa0e6('0xc')));_0x1ea038[_0xa0e6('0x8')]('/api/voice/contexts',require(_0xa0e6('0xd')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xe'),require(_0xa0e6('0xf')));_0x1ea038['use'](_0xa0e6('0x10'),require(_0xa0e6('0x11')));_0x1ea038['use'](_0xa0e6('0x12'),require(_0xa0e6('0x13')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x14'),require(_0xa0e6('0x15')));_0x1ea038[_0xa0e6('0x8')]('/api/screen/recordings',require(_0xa0e6('0x16')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x17'),require(_0xa0e6('0x18')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x19'),require(_0xa0e6('0x1a')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x1b'),require('./api/voiceCallReport'));_0x1ea038['use'](_0xa0e6('0x1c'),require(_0xa0e6('0x1d')));_0x1ea038['use']('/api/voice/agents/reports',require(_0xa0e6('0x1e')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x1f'),require('./api/voiceQueueReport'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x20'),require(_0xa0e6('0x21')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x22'),require(_0xa0e6('0x23')));_0x1ea038[_0xa0e6('0x8')]('/api/voice/transfers/reports',require(_0xa0e6('0x24')));_0x1ea038['use'](_0xa0e6('0x25'),require('./api/mailServerOut'));_0x1ea038['use'](_0xa0e6('0x26'),require('./api/mailAccount'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x27'),require(_0xa0e6('0x28')));_0x1ea038['use'](_0xa0e6('0x29'),require(_0xa0e6('0x2a')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x2b'),require(_0xa0e6('0x2c')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x2d'),require('./api/mailMessage'));_0x1ea038['use'](_0xa0e6('0x2e'),require('./api/mailApplication'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x2f'),require(_0xa0e6('0x30')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x31'),require(_0xa0e6('0x32')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x33'),require('./api/dashboardItem'));_0x1ea038['use'](_0xa0e6('0x34'),require(_0xa0e6('0x35')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x36'),require('./api/faxApplication'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x37'),require('./api/faxInteraction'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x38'),require(_0xa0e6('0x39')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x3a'),require(_0xa0e6('0x3b')));_0x1ea038[_0xa0e6('0x8')]('/api/fax/reports/queue',require(_0xa0e6('0x3c')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x3d'),require(_0xa0e6('0x3e')));_0x1ea038[_0xa0e6('0x8')]('/api/sms/applications',require(_0xa0e6('0x3f')));_0x1ea038[_0xa0e6('0x8')]('/api/sms/interactions',require(_0xa0e6('0x40')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x41'),require(_0xa0e6('0x42')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x43'),require('./api/smsQueue'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x44'),require(_0xa0e6('0x45')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x46'),require(_0xa0e6('0x47')));_0x1ea038[_0xa0e6('0x8')]('/api/openchannel/interactions',require(_0xa0e6('0x48')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x49'),require(_0xa0e6('0x4a')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x4b'),require('./api/openchannelQueue'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x4c'),require('./api/chatWebsite'));_0x1ea038[_0xa0e6('0x8')]('/api/openchannel/reports/queue',require(_0xa0e6('0x4d')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x4e'),require(_0xa0e6('0x4f')));_0x1ea038['use'](_0xa0e6('0x50'),require(_0xa0e6('0x51')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x52'),require('./api/chatMessage'));_0x1ea038[_0xa0e6('0x8')]('/api/chat/offline_messages',require(_0xa0e6('0x53')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x54'),require(_0xa0e6('0x55')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x56'),require(_0xa0e6('0x57')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x58'),require('./api/chatProactiveAction'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x59'),require(_0xa0e6('0x5a')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x5b'),require(_0xa0e6('0x5c')));_0x1ea038[_0xa0e6('0x8')]('/api/cm/hopper',require(_0xa0e6('0x5d')));_0x1ea038[_0xa0e6('0x8')]('/api/cm/hopper_black',require(_0xa0e6('0x5e')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x5f'),require(_0xa0e6('0x60')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x61'),require(_0xa0e6('0x62')));_0x1ea038['use'](_0xa0e6('0x63'),require(_0xa0e6('0x64')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x65'),require(_0xa0e6('0x66')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x67'),require(_0xa0e6('0x68')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x69'),require(_0xa0e6('0x6a')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x6b'),require(_0xa0e6('0x6c')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x6d'),require('./api/condition'));_0x1ea038['use'](_0xa0e6('0x6e'),require(_0xa0e6('0x6f')));_0x1ea038['use'](_0xa0e6('0x70'),require(_0xa0e6('0x71')));_0x1ea038[_0xa0e6('0x8')]('/api/cdr',require(_0xa0e6('0x72')));_0x1ea038['use'](_0xa0e6('0x73'),require('./api/voiceQueuesLog'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x74'),require(_0xa0e6('0x75')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x76'),require(_0xa0e6('0x77')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x78'),require(_0xa0e6('0x79')));_0x1ea038['use'](_0xa0e6('0x7a'),require('./api/contactItemType'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x7b'),require('./api/cmContactHasItem'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x7c'),require(_0xa0e6('0x7d')));_0x1ea038[_0xa0e6('0x8')]('/api/templates',require('./api/template'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x7e'),require(_0xa0e6('0x7f')));_0x1ea038['use'](_0xa0e6('0x80'),require('./api/variable'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x81'),require(_0xa0e6('0x82')));_0x1ea038['use'](_0xa0e6('0x83'),require(_0xa0e6('0x84')));_0x1ea038[_0xa0e6('0x8')]('/api/analytics/custom_reports',require(_0xa0e6('0x85')));_0x1ea038[_0xa0e6('0x8')]('/api/analytics/default_reports',require(_0xa0e6('0x86')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x87'),require(_0xa0e6('0x88')));_0x1ea038['use'](_0xa0e6('0x89'),require('./api/analyticMetric'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x8a'),require('./api/analyticFieldReport'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x8b'),require(_0xa0e6('0x8c')));_0x1ea038['use'](_0xa0e6('0x8d'),require(_0xa0e6('0x8e')));_0x1ea038[_0xa0e6('0x8')]('/api/integrations/salesforce/configurations',require(_0xa0e6('0x8f')));_0x1ea038['use'](_0xa0e6('0x90'),require(_0xa0e6('0x91')));_0x1ea038[_0xa0e6('0x8')]('/api/integrations/sugarcrm/accounts',require(_0xa0e6('0x92')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x93'),require(_0xa0e6('0x94')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x95'),require(_0xa0e6('0x96')));_0x1ea038['use'](_0xa0e6('0x97'),require(_0xa0e6('0x98')));_0x1ea038['use'](_0xa0e6('0x99'),require(_0xa0e6('0x9a')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x9b'),require(_0xa0e6('0x9c')));_0x1ea038[_0xa0e6('0x8')]('/api/integrations/zoho/accounts',require(_0xa0e6('0x9d')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x9e'),require(_0xa0e6('0x9f')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xa0'),require(_0xa0e6('0xa1')));_0x1ea038['use'](_0xa0e6('0xa2'),require(_0xa0e6('0xa3')));_0x1ea038['use'](_0xa0e6('0xa4'),require(_0xa0e6('0xa5')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xa6'),require(_0xa0e6('0xa7')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xa8'),require('./api/intFreshdeskAccount'));_0x1ea038['use'](_0xa0e6('0xa9'),require(_0xa0e6('0xaa')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xab'),require(_0xa0e6('0xac')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xad'),require(_0xa0e6('0xae')));_0x1ea038['use'](_0xa0e6('0xaf'),require('./api/intVtigerConfiguration'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xb0'),require(_0xa0e6('0xb1')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xb2'),require('./api/intServicenowAccount'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xb3'),require('./api/intServicenowConfiguration'));_0x1ea038['use'](_0xa0e6('0xb4'),require('./api/intServicenowField'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xb5'),require(_0xa0e6('0xb6')));_0x1ea038[_0xa0e6('0x8')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x1ea038[_0xa0e6('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xb7'),require(_0xa0e6('0xb8')));_0x1ea038['use'](_0xa0e6('0xb9'),require(_0xa0e6('0xba')));_0x1ea038['use'](_0xa0e6('0xbb'),require(_0xa0e6('0xbc')));_0x1ea038['use'](_0xa0e6('0xbd'),require(_0xa0e6('0xbe')));_0x1ea038[_0xa0e6('0x8')]('/api/chat/reports/queue',require(_0xa0e6('0xbf')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xc0'),require(_0xa0e6('0xc1')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xc2'),require('./api/jscriptyAnswerReport'));_0x1ea038['use'](_0xa0e6('0xc3'),require(_0xa0e6('0xc4')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xc5'),require(_0xa0e6('0xc6')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xc7'),require('./api/smsQueueReport'));_0x1ea038[_0xa0e6('0x8')]('/api/square/reports',require('./api/squareReport'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xc8'),require(_0xa0e6('0xc9')));_0x1ea038['use'](_0xa0e6('0xca'),require(_0xa0e6('0xcb')));_0x1ea038['use'](_0xa0e6('0xcc'),require(_0xa0e6('0xcd')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xce'),require('./api/squareOdbc'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xcf'),require(_0xa0e6('0xd0')));_0x1ea038['use']('/api/square/recordings',require(_0xa0e6('0xd1')));_0x1ea038[_0xa0e6('0x8')]('/api/square/messages',require(_0xa0e6('0xd2')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xd3'),require(_0xa0e6('0xd4')));_0x1ea038[_0xa0e6('0x8')]('/api/license',require(_0xa0e6('0xd5')));_0x1ea038[_0xa0e6('0x8')]('/api/campaigns',require(_0xa0e6('0xd6')));_0x1ea038['use'](_0xa0e6('0xd7'),require(_0xa0e6('0xd8')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xd9'),require(_0xa0e6('0xda')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xdb'),require('./api/plugin'));_0x1ea038['use'](_0xa0e6('0xdc'),require('./api/mailTransferReport'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xdd'),require(_0xa0e6('0xde')));_0x1ea038['use'](_0xa0e6('0xdf'),require('./api/faxTransferReport'));_0x1ea038[_0xa0e6('0x8')]('/api/openchannel/reports/transfer',require(_0xa0e6('0xe0')));_0x1ea038[_0xa0e6('0x8')]('/api/sms/reports/transfer',require(_0xa0e6('0xe1')));_0x1ea038['use']('/api/cm/lists',require(_0xa0e6('0xe2')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xe3'),require(_0xa0e6('0xe4')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xe5'),require(_0xa0e6('0xe6')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xe7'),require(_0xa0e6('0xe8')));_0x1ea038[_0xa0e6('0x8')]('/api/userProfile/resources',require(_0xa0e6('0xe9')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xea'),require(_0xa0e6('0xeb')));_0x1ea038['use']('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xec'),require('./api/whatsappApplication'));_0x1ea038['use'](_0xa0e6('0xed'),require('./api/whatsappInteraction'));_0x1ea038[_0xa0e6('0x8')]('/api/whatsapp/messages',require(_0xa0e6('0xee')));_0x1ea038['use']('/api/whatsapp/reports/queue',require(_0xa0e6('0xef')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xf0'),require(_0xa0e6('0xf1')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xf2'),require(_0xa0e6('0xf3')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xf4'),require(_0xa0e6('0xf5')));_0x1ea038[_0xa0e6('0x8')]('/api/realtime',require('./api/realtime'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xf6'),require(_0xa0e6('0xf7')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xf8'),require('./api/authLocal'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xf9'),require(_0xa0e6('0xfa')));_0x1ea038['use'](_0xa0e6('0xfb'),require(_0xa0e6('0xfc')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xfd'),require(_0xa0e6('0xfe')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0xff'),require('./api/rpc'));_0x1ea038[_0xa0e6('0x8')]('/api/version',require(_0xa0e6('0x100')));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x101'),require('./api/system'));_0x1ea038['use'](_0xa0e6('0x102'),require('./api/pm2'));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x103'),require(_0xa0e6('0x104')));_0x1ea038['use'](_0xa0e6('0x105'),clientSideLogs);_0x1ea038[_0xa0e6('0x8')]('/apidoc',express[_0xa0e6('0x106')](path[_0xa0e6('0x107')](config[_0xa0e6('0x108')],_0xa0e6('0x109'))));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x10a'),express[_0xa0e6('0x106')](path['join'](config[_0xa0e6('0x108')],_0xa0e6('0x10a'))));_0x1ea038[_0xa0e6('0x8')]('/demo',express[_0xa0e6('0x106')](path[_0xa0e6('0x107')](config['root'],_0xa0e6('0x10b'))));_0x1ea038[_0xa0e6('0x8')](_0xa0e6('0x10c'),express['static'](path[_0xa0e6('0x107')](config['root'],'snippet',_0xa0e6('0x10d'))));_0x1ea038[_0xa0e6('0x8')]('/plugins',express[_0xa0e6('0x106')](path[_0xa0e6('0x107')](config[_0xa0e6('0x108')],'/server/files/plugins')));_0x1ea038[_0xa0e6('0x10e')](_0xa0e6('0x10f'))[_0xa0e6('0x110')](errors[0x194]);_0x1ea038['route']('/*')['get'](function(_0x1243a7,_0x4fd941){_0x4fd941[_0xa0e6('0x111')](path['resolve'](_0x1ea038[_0xa0e6('0x110')]('appPath')+_0xa0e6('0x112')));});return _0x1ea038;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index c5988d7..4f8ec74 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaefe=['../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','log','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0xaefe,0x91));var _0xeaef=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xaefe[_0x3712e2];return _0x1faff4;};'use strict';var jayson=require(_0xeaef('0x0'));var _=require(_0xeaef('0x1'));var config=require(_0xeaef('0x2'));exports[_0xeaef('0x3')]=function(){return new Promise(function(_0x3b371c,_0x4a5e2f){var _0xe4e064={};_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/user/user.rpc'));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x5')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/voiceQueue/voiceQueue.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x6')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x7')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x8')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x9')));_0xe4e064=_['merge'](_0xe4e064,require('../api/memberReport/memberReport.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0xa')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0xb')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0xc')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0xd')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0xe')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0xf')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x10')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x11')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x12')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/mailQueueReport/mailQueueReport.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x13')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/faxApplication/faxApplication.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x14')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x15')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x16')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x17')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x18')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x19')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/smsMessage/smsMessage.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x1a')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x1b')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x1c')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x1d')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x1e')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x1f')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x20')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/chatQueue/chatQueue.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/cmContact/cmContact.rpc'));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x21')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x22')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x23')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x24')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x25')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x26')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x27')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x28')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x29')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x2a')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x2b')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intDeskAccount/intDeskAccount.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intZohoAccount/intZohoAccount.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x2c')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x2d')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x2e')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x2f')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x30')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x31')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x32')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x33')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x34')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/squareRecording/squareRecording.rpc'));_0xe4e064=_['merge'](_0xe4e064,require('../api/squareMessage/squareMessage.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x35')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x36')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x37')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x38')));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require('../api/whatsappMessage/whatsappMessage.rpc'));_0xe4e064=_[_0xeaef('0x4')](_0xe4e064,require(_0xeaef('0x39')));_0xe4e064=_['merge'](_0xe4e064,require(_0xeaef('0x3a')));var _0x5d80f9=jayson['server'](_0xe4e064)[_0xeaef('0x3b')]();var _0x3135c0=config[_0xeaef('0x3c')]['port']||config['port']+0x1;var _0x63c303=config[_0xeaef('0x3c')]['ip']||'localhost';_0x5d80f9['on']('error',function(_0x504184){return _0x4a5e2f(_0x504184);});_0x5d80f9[_0xeaef('0x3')](_0x3135c0,_0x63c303,function(){console[_0xeaef('0x3d')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x63c303,_0x3135c0);require(_0xeaef('0x3e'))[_0xeaef('0x3f')]();return _0x3b371c('RPC\x20listening\x20on\x20'+_0x63c303+':'+_0x3135c0);});});}; \ No newline at end of file +var _0x9cf8=['../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc'];(function(_0x39804a,_0x42deba){var _0x42feca=function(_0x262d26){while(--_0x262d26){_0x39804a['push'](_0x39804a['shift']());}};_0x42feca(++_0x42deba);}(_0x9cf8,0x1f2));var _0x89cf=function(_0x437551,_0x5b91f4){_0x437551=_0x437551-0x0;var _0x590981=_0x9cf8[_0x437551];return _0x590981;};'use strict';var jayson=require('jayson/promise');var _=require(_0x89cf('0x0'));var config=require('../config/environment');exports[_0x89cf('0x1')]=function(){return new Promise(function(_0x4f5beb,_0x5741ee){var _0x1ca436={};_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/user/user.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x3')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x4')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/voiceRecording/voiceRecording.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x5')));_0x1ca436=_['merge'](_0x1ca436,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x6')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x7')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x8')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/trunk/trunk.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x9')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0xa')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0xb')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/mailQueue/mailQueue.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/mailInteraction/mailInteraction.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/mailMessage/mailMessage.rpc'));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0xc')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0xd')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0xe')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/faxApplication/faxApplication.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0xf')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x10')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x11')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/smsAccount/smsAccount.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x12')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/smsMessage/smsMessage.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/smsQueue/smsQueue.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x13')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x14')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x15')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x16')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x17')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x18')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x19')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x1a')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x1b')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x1c')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x1d')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x1e')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x1f')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x20')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/pause/pause.rpc'));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x21')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x22')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x23')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x24')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x25')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x26')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x27')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x28')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x29')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x2a')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x2b')));_0x1ca436=_['merge'](_0x1ca436,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x2c')));_0x1ca436=_['merge'](_0x1ca436,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1ca436=_['merge'](_0x1ca436,require('../api/squareReport/squareReport.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1ca436=_['merge'](_0x1ca436,require('../api/setting/setting.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x2d')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x2e')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x2f')));_0x1ca436=_['merge'](_0x1ca436,require('../api/squareMessage/squareMessage.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/campaign/campaign.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x30')));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x31')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1ca436=_['merge'](_0x1ca436,require(_0x89cf('0x32')));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1ca436=_[_0x89cf('0x2')](_0x1ca436,require(_0x89cf('0x33')));var _0x3d6f06=jayson[_0x89cf('0x34')](_0x1ca436)[_0x89cf('0x35')]();var _0x10bdda=config[_0x89cf('0x36')]['port']||config[_0x89cf('0x37')]+0x1;var _0x58ee3b=config[_0x89cf('0x36')]['ip']||_0x89cf('0x38');_0x3d6f06['on']('error',function(_0x27da96){return _0x5741ee(_0x27da96);});_0x3d6f06[_0x89cf('0x1')](_0x10bdda,_0x58ee3b,function(){console['log'](_0x89cf('0x39'),_0x58ee3b,_0x10bdda);require(_0x89cf('0x3a'))['default']();return _0x4f5beb(_0x89cf('0x3b')+_0x58ee3b+':'+_0x10bdda);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index cfc287d..7404e73 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 _0x0182=['setPriority','HANGUP','isBoolean','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','indexOf','substr','startsWith','split','substring','length','match','error','E_AGI_SOCKET_ERROR','code','close','emit','timeout','destroy','command','function','write','inherits','prototype','sendRequest','answer','ANSWER','getData','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0182,0x18a));var _0x2018=function(_0x359377,_0x1a63ef){_0x359377=_0x359377-0x0;var _0x8be18a=_0x0182[_0x359377];return _0x8be18a;};'use strict';var util=require(_0x2018('0x0'));var _=require(_0x2018('0x1'));var EventEmitter=require(_0x2018('0x2'))[_0x2018('0x3')];var AGIReply=require(_0x2018('0x4'));var AGIError=require(_0x2018('0x5'));function AGIChannel(_0x328459){var _0x3aea8e=this,_0x4865d0=new AGIReply(),_0x3d9255=![],_0x50d61c={};EventEmitter[_0x2018('0x6')](_0x3aea8e);_0x328459['setEncoding'](_0x2018('0x7'));_0x328459[_0x2018('0x8')](0x8*0x3c*0x3c*0x3e8);_0x4865d0[_0x2018('0x9')](_0x2018('0x7'));_0x4865d0['on'](_0x2018('0xa'),function(_0x1f5b3f){for(var _0x3ef6ba in _0x1f5b3f){_0x3aea8e[_0x3ef6ba]=_0x1f5b3f[_0x3ef6ba];}_0x3aea8e['emit']('ready');});_0x4865d0['on']('line',function(_0x3cf6c6){if(_0x3cf6c6[_0x2018('0xb')]()==_0x2018('0xc')){_0x3aea8e['emit'](_0x2018('0xc'));return;}if(_0x3cf6c6['substring'](0x0,0xb)==_0x2018('0xd')){_0x3d9255=!![];}if(_0x3d9255){_0x50d61c['rx']+=_0x3cf6c6+'\x0a';if(_0x3cf6c6[_0x2018('0xe')](_0x2018('0xf'))!=-0x1){_0x3d9255=![];}}else{_0x50d61c['rx']=_0x3cf6c6;}if(_0x3d9255){return;}if(typeof _0x50d61c['cb']=='function'){var _0x51e80c=_0x50d61c['rx']['substring'](0x0,0x3),_0x4c3bce=null,_0x4b8213=null;_0x51e80c=parseInt(_0x51e80c);if(isNaN(_0x51e80c)){_0x50d61c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x51e80c!=0xc8){_0x50d61c['cb'](null,{'code':_0x51e80c,'result':-0x1,'extra':'KO'});return;}_0x4c3bce=_0x50d61c['rx']['substring'](0x4)['replace']('result=','');if(_0x4c3bce[_0x2018('0x10')]('\x20')!=-0x1){_0x4c3bce=_0x4c3bce[_0x2018('0x11')](0x0,_0x4c3bce[_0x2018('0x10')]('\x20'));}if(_[_0x2018('0x12')](_0x4c3bce,'-1')){_0x4c3bce=parseInt(_0x4c3bce);}_0x4b8213=_0x50d61c['rx'][_0x2018('0x13')]('\x20');if(_0x4b8213['length']==0x3){_0x4b8213=_0x4b8213[0x2][_0x2018('0x14')](0x1,_0x4b8213[0x2][_0x2018('0x15')]-0x1);}else if(_0x4b8213[_0x2018('0x15')]>0x3){var _0x4cbc30=/\((.+)\)/;var _0x3a56c8=_0x50d61c['rx'][_0x2018('0x16')](_0x4cbc30);if(_0x3a56c8){_0x4b8213=_0x3a56c8[0x1];}else{_0x4b8213=null;}}else{_0x4b8213=null;}_0x50d61c['cb'](null,{'code':_0x51e80c,'result':_0x4c3bce,'extra':_0x4b8213});}});_0x328459['on'](_0x2018('0x17'),function(_0x13fb2e){_0x3aea8e['emit']('error',new AGIError(_0x2018('0x18'),_0x13fb2e[_0x2018('0x19')]));});_0x328459['on'](_0x2018('0x1a'),function(){_0x3aea8e[_0x2018('0x1b')](_0x2018('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x328459['on'](_0x2018('0x1c'),function(){_0x3aea8e['emit']('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x328459[_0x2018('0x1d')]();});_0x328459['pipe'](_0x4865d0);this[_0x2018('0x1e')]=function(_0x323d1d,_0x293105){var _0x323d1d=_0x323d1d||'',_0x293105=typeof _0x293105==_0x2018('0x1f')?_0x293105:new Function();_0x50d61c={'tx':_0x323d1d,'rx':'','cb':_0x293105};_0x328459[_0x2018('0x20')](_0x323d1d+'\x0a');},this['close']=function(){_0x328459[_0x2018('0x1d')]();};}util[_0x2018('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x2018('0x22')][_0x2018('0x23')]=function(_0x2ed644){return this[_0x2018('0x1e')]['sync'](this,_0x2ed644);};AGIChannel[_0x2018('0x22')][_0x2018('0x24')]=function(){return this[_0x2018('0x23')](_0x2018('0x25'));};AGIChannel[_0x2018('0x22')][_0x2018('0x26')]=function(_0x67ec31,_0x566a02,_0x1c1bd0){_0x67ec31=_0x67ec31===undefined?'beep':_0x67ec31;_0x566a02=_0x566a02===undefined?'5':_0x566a02;_0x1c1bd0=_0x1c1bd0===undefined?'1':_0x1c1bd0;return this[_0x2018('0x23')](util[_0x2018('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x67ec31,_0x566a02*0x3e8,_0x1c1bd0));};AGIChannel[_0x2018('0x22')][_0x2018('0x28')]=function(_0x5bb327){_0x5bb327=_0x5bb327||_0x2018('0x29');return this[_0x2018('0x23')](util[_0x2018('0x27')](_0x2018('0x2a'),_0x5bb327));};AGIChannel[_0x2018('0x22')]['exec']=function(_0x19ba79,_0x17ae9c){if(_[_0x2018('0x2b')](_0x17ae9c)){return this[_0x2018('0x23')](util[_0x2018('0x27')](_0x2018('0x2c'),_0x19ba79,_0x17ae9c[_0x2018('0x2d')](',')));}return this['sendRequest'](util['format'](_0x2018('0x2c'),_0x19ba79,_0x17ae9c));};AGIChannel[_0x2018('0x22')][_0x2018('0x2e')]=function(_0x4383aa){return this[_0x2018('0x23')](util[_0x2018('0x27')](_0x2018('0x2f'),_0x4383aa));};AGIChannel[_0x2018('0x22')][_0x2018('0x30')]=function(_0x11b871){return this['sendRequest'](util[_0x2018('0x27')](_0x2018('0x31'),_0x11b871));};AGIChannel['prototype'][_0x2018('0x32')]=function(_0xd3761e){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0xd3761e));};AGIChannel['prototype'][_0x2018('0xc')]=function(){return this[_0x2018('0x23')](_0x2018('0x33'));};AGIChannel[_0x2018('0x22')]['setVariable']=function(_0x2933b6,_0x215312){var _0x4f56c8=_[_0x2018('0x34')](_0x215312)||_[_0x2018('0x35')](_0x215312)?_0x215312[_0x2018('0x36')]():_0x215312;return this[_0x2018('0x23')](util[_0x2018('0x27')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x2933b6,_0x4f56c8?_0x4f56c8[_0x2018('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2018('0x22')]['sayNumber']=function(_0x4b26ea,_0x460be0){return this[_0x2018('0x23')](util[_0x2018('0x27')](_0x2018('0x37'),_0x4b26ea,_0x460be0));};AGIChannel[_0x2018('0x22')]['sayDigits']=function(_0x2afcee,_0x3f5f27){return this['sendRequest'](util[_0x2018('0x27')]('SAY\x20DIGITS\x20%s\x20%s',_0x2afcee,_0x3f5f27));};AGIChannel[_0x2018('0x22')][_0x2018('0x38')]=function(_0x694512,_0x316da7){return this[_0x2018('0x23')](util[_0x2018('0x27')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x694512,_0x316da7));};AGIChannel[_0x2018('0x22')][_0x2018('0x39')]=function(_0x3edb11,_0x27dd94,_0x39b1d5){_0x27dd94=_0x27dd94||this[_0x2018('0x3a')];_0x39b1d5=_0x39b1d5||0x1;this['setContext'](_0x3edb11);this['setExtension'](_0x27dd94);this[_0x2018('0x32')](_0x39b1d5);return this[_0x2018('0x28')](util[_0x2018('0x27')](_0x2018('0x3b'),_0x3edb11,_0x27dd94,_0x39b1d5));};AGIChannel[_0x2018('0x22')][_0x2018('0x3c')]=function(_0x59006c){return this[_0x2018('0x23')](util['format'](_0x2018('0x3d'),_0x59006c));};AGIChannel['prototype'][_0x2018('0x3e')]=function(_0xb07f6e,_0x59a254,_0x168eec,_0x10d620,_0x3f18de,_0x24fbfe){_0x59a254=_0x59a254||_0x2018('0x3f');_0x168eec=_0x168eec||'';_0x10d620=_0x10d620===undefined?-0x1:_0x10d620==='-1'?-0x1:_0x10d620*0x3e8;_0x3f18de=_0x3f18de===undefined?'':'s='+_0x3f18de;_0x24fbfe=_0x24fbfe?_0x2018('0x40'):'';return this[_0x2018('0x23')](util[_0x2018('0x27')](_0x2018('0x41'),_0xb07f6e,_0x59a254,_0x168eec,_0x10d620,_0x24fbfe,_0x3f18de));};AGIChannel[_0x2018('0x22')][_0x2018('0x42')]=function(_0x136e28,_0x9a806e){_0x9a806e=_0x9a806e||'';return this[_0x2018('0x23')](util[_0x2018('0x27')](_0x2018('0x43'),_0x136e28,_0x9a806e));};AGIChannel[_0x2018('0x22')][_0x2018('0x44')]=function(_0x2ba065){return this[_0x2018('0x45')](_0x2018('0x46'),_0x2ba065);};AGIChannel[_0x2018('0x22')]['wait']=function(_0x453c43){return this[_0x2018('0x45')](_0x2018('0x47'),_0x453c43);};AGIChannel[_0x2018('0x22')][_0x2018('0x17')]=function(_0x56b4fd,_0x39f1d3){this[_0x2018('0x28')](util[_0x2018('0x27')](_0x2018('0x48'),_0x56b4fd['id'],_0x56b4fd['label'],_0x39f1d3));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2018('0x49')]=AGIChannel; \ No newline at end of file +var _0x9dfc=['SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','./reply','./error','call','setEncoding','utf8','headers','ready','toLowerCase','emit','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','ANSWER','getData','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setPriority'];(function(_0x1bd230,_0x1da01e){var _0x19a3e3=function(_0x3cb9fa){while(--_0x3cb9fa){_0x1bd230['push'](_0x1bd230['shift']());}};_0x19a3e3(++_0x1da01e);}(_0x9dfc,0x140));var _0xc9df=function(_0x385ef3,_0x19118b){_0x385ef3=_0x385ef3-0x0;var _0x345443=_0x9dfc[_0x385ef3];return _0x345443;};'use strict';var util=require(_0xc9df('0x0'));var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0xc9df('0x1'));var AGIError=require(_0xc9df('0x2'));function AGIChannel(_0x2aeaff){var _0xf2621e=this,_0x336c0a=new AGIReply(),_0x19b2c7=![],_0x147adf={};EventEmitter[_0xc9df('0x3')](_0xf2621e);_0x2aeaff[_0xc9df('0x4')](_0xc9df('0x5'));_0x2aeaff['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x336c0a[_0xc9df('0x4')](_0xc9df('0x5'));_0x336c0a['on'](_0xc9df('0x6'),function(_0xdfd75b){for(var _0xded560 in _0xdfd75b){_0xf2621e[_0xded560]=_0xdfd75b[_0xded560];}_0xf2621e['emit'](_0xc9df('0x7'));});_0x336c0a['on']('line',function(_0xd6ed09){if(_0xd6ed09[_0xc9df('0x8')]()=='hangup'){_0xf2621e[_0xc9df('0x9')](_0xc9df('0xa'));return;}if(_0xd6ed09['substring'](0x0,0xb)==_0xc9df('0xb')){_0x19b2c7=!![];}if(_0x19b2c7){_0x147adf['rx']+=_0xd6ed09+'\x0a';if(_0xd6ed09[_0xc9df('0xc')](_0xc9df('0xd'))!=-0x1){_0x19b2c7=![];}}else{_0x147adf['rx']=_0xd6ed09;}if(_0x19b2c7){return;}if(typeof _0x147adf['cb']==_0xc9df('0xe')){var _0x3ce9c9=_0x147adf['rx'][_0xc9df('0xf')](0x0,0x3),_0x25d196=null,_0x454d7d=null;_0x3ce9c9=parseInt(_0x3ce9c9);if(isNaN(_0x3ce9c9)){_0x147adf['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3ce9c9!=0xc8){_0x147adf['cb'](null,{'code':_0x3ce9c9,'result':-0x1,'extra':'KO'});return;}_0x25d196=_0x147adf['rx'][_0xc9df('0xf')](0x4)[_0xc9df('0x10')](_0xc9df('0x11'),'');if(_0x25d196[_0xc9df('0x12')]('\x20')!=-0x1){_0x25d196=_0x25d196['substr'](0x0,_0x25d196[_0xc9df('0x12')]('\x20'));}if(_[_0xc9df('0x13')](_0x25d196,'-1')){_0x25d196=parseInt(_0x25d196);}_0x454d7d=_0x147adf['rx'][_0xc9df('0x14')]('\x20');if(_0x454d7d[_0xc9df('0x15')]==0x3){_0x454d7d=_0x454d7d[0x2][_0xc9df('0xf')](0x1,_0x454d7d[0x2]['length']-0x1);}else if(_0x454d7d[_0xc9df('0x15')]>0x3){var _0xa48f1e=/\((.+)\)/;var _0x106f0b=_0x147adf['rx'][_0xc9df('0x16')](_0xa48f1e);if(_0x106f0b){_0x454d7d=_0x106f0b[0x1];}else{_0x454d7d=null;}}else{_0x454d7d=null;}_0x147adf['cb'](null,{'code':_0x3ce9c9,'result':_0x25d196,'extra':_0x454d7d});}});_0x2aeaff['on'](_0xc9df('0x17'),function(_0x59eef9){_0xf2621e[_0xc9df('0x9')](_0xc9df('0x17'),new AGIError(_0xc9df('0x18'),_0x59eef9['code']));});_0x2aeaff['on'](_0xc9df('0x19'),function(){_0xf2621e[_0xc9df('0x9')](_0xc9df('0x19'),new AGIError(_0xc9df('0x1a')));});_0x2aeaff['on'](_0xc9df('0x1b'),function(){_0xf2621e[_0xc9df('0x9')]('timeout',new AGIError(_0xc9df('0x1c')));_0x2aeaff[_0xc9df('0x1d')]();});_0x2aeaff[_0xc9df('0x1e')](_0x336c0a);this[_0xc9df('0x1f')]=function(_0xeb54c1,_0x24c3a7){var _0xeb54c1=_0xeb54c1||'',_0x24c3a7=typeof _0x24c3a7==_0xc9df('0xe')?_0x24c3a7:new Function();_0x147adf={'tx':_0xeb54c1,'rx':'','cb':_0x24c3a7};_0x2aeaff[_0xc9df('0x20')](_0xeb54c1+'\x0a');},this['close']=function(){_0x2aeaff[_0xc9df('0x1d')]();};}util[_0xc9df('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xc9df('0x22')]=function(_0x7d7351){return this[_0xc9df('0x1f')][_0xc9df('0x23')](this,_0x7d7351);};AGIChannel[_0xc9df('0x24')]['answer']=function(){return this['sendRequest'](_0xc9df('0x25'));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x26')]=function(_0x59cc56,_0xc92463,_0x1a838c){_0x59cc56=_0x59cc56===undefined?'beep':_0x59cc56;_0xc92463=_0xc92463===undefined?'5':_0xc92463;_0x1a838c=_0x1a838c===undefined?'1':_0x1a838c;return this[_0xc9df('0x22')](util[_0xc9df('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x59cc56,_0xc92463*0x3e8,_0x1a838c));};AGIChannel['prototype'][_0xc9df('0x28')]=function(_0x199070){_0x199070=_0x199070||_0xc9df('0x29');return this[_0xc9df('0x22')](util[_0xc9df('0x27')](_0xc9df('0x2a'),_0x199070));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x2b')]=function(_0x352742,_0x48fd53){if(_[_0xc9df('0x2c')](_0x48fd53)){return this[_0xc9df('0x22')](util[_0xc9df('0x27')](_0xc9df('0x2d'),_0x352742,_0x48fd53[_0xc9df('0x2e')](',')));}return this[_0xc9df('0x22')](util['format'](_0xc9df('0x2d'),_0x352742,_0x48fd53));};AGIChannel['prototype'][_0xc9df('0x2f')]=function(_0x40f90a){return this[_0xc9df('0x22')](util[_0xc9df('0x27')](_0xc9df('0x30'),_0x40f90a));};AGIChannel['prototype']['setExtension']=function(_0x124c6b){return this[_0xc9df('0x22')](util[_0xc9df('0x27')]('SET\x20EXTENSION\x20%s',_0x124c6b));};AGIChannel['prototype'][_0xc9df('0x31')]=function(_0x30fccf){return this[_0xc9df('0x22')](util[_0xc9df('0x27')](_0xc9df('0x32'),_0x30fccf));};AGIChannel[_0xc9df('0x24')][_0xc9df('0xa')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0xc9df('0x24')][_0xc9df('0x33')]=function(_0x48b472,_0x432023){var _0x2f5c48=_[_0xc9df('0x34')](_0x432023)||_[_0xc9df('0x35')](_0x432023)?_0x432023[_0xc9df('0x36')]():_0x432023;return this[_0xc9df('0x22')](util[_0xc9df('0x27')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x48b472,_0x2f5c48?_0x2f5c48[_0xc9df('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x37')]=function(_0x65a082,_0x479b51){return this[_0xc9df('0x22')](util[_0xc9df('0x27')](_0xc9df('0x38'),_0x65a082,_0x479b51));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x39')]=function(_0x4748f4,_0x151394){return this[_0xc9df('0x22')](util[_0xc9df('0x27')](_0xc9df('0x3a'),_0x4748f4,_0x151394));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x3b')]=function(_0x56f87a,_0x285a75){return this['sendRequest'](util['format'](_0xc9df('0x3c'),_0x56f87a,_0x285a75));};AGIChannel['prototype'][_0xc9df('0x3d')]=function(_0x29e8e7,_0xc8bfd5,_0x2e5599){_0xc8bfd5=_0xc8bfd5||this[_0xc9df('0x3e')];_0x2e5599=_0x2e5599||0x1;this[_0xc9df('0x2f')](_0x29e8e7);this[_0xc9df('0x3f')](_0xc8bfd5);this[_0xc9df('0x31')](_0x2e5599);return this[_0xc9df('0x28')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x29e8e7,_0xc8bfd5,_0x2e5599));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x40')]=function(_0x4df5f5){return this[_0xc9df('0x22')](util[_0xc9df('0x27')](_0xc9df('0x41'),_0x4df5f5));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x42')]=function(_0x41c2c7,_0x4b272b,_0x100350,_0x156978,_0x5183c7,_0x131293){_0x4b272b=_0x4b272b||_0xc9df('0x43');_0x100350=_0x100350||'';_0x156978=_0x156978===undefined?-0x1:_0x156978==='-1'?-0x1:_0x156978*0x3e8;_0x5183c7=_0x5183c7===undefined?'':'s='+_0x5183c7;_0x131293=_0x131293?'BEEP':'';return this['sendRequest'](util[_0xc9df('0x27')](_0xc9df('0x44'),_0x41c2c7,_0x4b272b,_0x100350,_0x156978,_0x131293,_0x5183c7));};AGIChannel[_0xc9df('0x24')]['streamFile']=function(_0x136280,_0x55ccbe){_0x55ccbe=_0x55ccbe||'';return this[_0xc9df('0x22')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x136280,_0x55ccbe));};AGIChannel[_0xc9df('0x24')][_0xc9df('0x45')]=function(_0x216c1d){return this[_0xc9df('0x2b')]('AGI',_0x216c1d);};AGIChannel[_0xc9df('0x24')]['wait']=function(_0x5217ce){return this[_0xc9df('0x2b')](_0xc9df('0x46'),_0x5217ce);};AGIChannel['prototype'][_0xc9df('0x17')]=function(_0x5a075d,_0x20d41c){this[_0xc9df('0x28')](util[_0xc9df('0x27')](_0xc9df('0x47'),_0x5a075d['id'],_0x5a075d[_0xc9df('0x48')],_0x20d41c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xc9df('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 26d0f53..2db6b11 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 _0x8b73=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.'];(function(_0x570251,_0x3a591e){var _0x5a0cfd=function(_0xc0075f){while(--_0xc0075f){_0x570251['push'](_0x570251['shift']());}};_0x5a0cfd(++_0x3a591e);}(_0x8b73,0x1bf));var _0x38b7=function(_0x1af482,_0x1af5b7){_0x1af482=_0x1af482-0x0;var _0x7e7580=_0x8b73[_0x1af482];return _0x7e7580;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x38b7('0x0'),'E_AGI_ARGUMENT_PORT':_0x38b7('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x38b7('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x38b7('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x38b7('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x38b7('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x38b7('0x6'),'E_AGI_COMMAND_EMPTY':_0x38b7('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x38b7('0x8'),'E_AGI_IVR_ENTRY':_0x38b7('0x9')};function AGIError(_0x3e8c90){var _0x3e8c90=_0x3e8c90||null,_0x25d0a9=_0x25d0a9||[],_0x2e8923=0x1,_0x39485e='';if(!error[_0x3e8c90]){_0x3e8c90=_0x38b7('0xa');}_0x25d0a9[_0x38b7('0xb')](error[_0x3e8c90]);while(arguments[_0x2e8923]){_0x25d0a9[_0x38b7('0xb')](arguments[_0x2e8923]);_0x2e8923++;}_0x39485e=util['format'][_0x38b7('0xc')](util,_0x25d0a9);this['message']=_0x39485e;this['name']=_0x3e8c90;}module['exports']=AGIError; \ No newline at end of file +var _0x1875=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x4913a8,_0x5a8cbd){var _0x50a4de=function(_0x31892e){while(--_0x31892e){_0x4913a8['push'](_0x4913a8['shift']());}};_0x50a4de(++_0x5a8cbd);}(_0x1875,0x6b));var _0x5187=function(_0x48031c,_0x9c711){_0x48031c=_0x48031c-0x0;var _0x55d04f=_0x1875[_0x48031c];return _0x55d04f;};'use strict';var util=require(_0x5187('0x0'));var error={'E_AGI_UNDEFINED':_0x5187('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x5187('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x5187('0x3'),'E_AGI_SOCKET_ERROR':_0x5187('0x4'),'E_AGI_SOCKET_CLOSE':_0x5187('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x5187('0x6'),'E_AGI_COMMAND_EMPTY':_0x5187('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5187('0x8'),'E_AGI_IVR_ENTRY':_0x5187('0x9')};function AGIError(_0xa17443){var _0xa17443=_0xa17443||null,_0x49a60c=_0x49a60c||[],_0x30932a=0x1,_0x313407='';if(!error[_0xa17443]){_0xa17443=_0x5187('0xa');}_0x49a60c['push'](error[_0xa17443]);while(arguments[_0x30932a]){_0x49a60c['push'](arguments[_0x30932a]);_0x30932a++;}_0x313407=util[_0x5187('0xb')][_0x5187('0xc')](util,_0x49a60c);this[_0x5187('0xd')]=_0x313407;this[_0x5187('0xe')]=_0xa17443;}module[_0x5187('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 2fd5ac8..7575be9 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 _0x036c=['E_AGI_SERVER_ERROR','parse','exports','lodash','events','EventEmitter','ioredis','../../config/environment','redis','defaults','subscribe','agi','emit','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x036c,0x73));var _0xc036=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x036c[_0x934425];return _0x31d596;};'use strict';var _=require(_0xc036('0x0'));var EventEmitter=require(_0xc036('0x1'))[_0xc036('0x2')];var Redis=require(_0xc036('0x3'));var AGIError=require('./error');var config=require(_0xc036('0x4'));config[_0xc036('0x5')]=_[_0xc036('0x6')](config[_0xc036('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc036('0x5')]);sub[_0xc036('0x7')](_0xc036('0x8'),function(_0x4b9fd8){if(_0x4b9fd8)return eventEmitter[_0xc036('0x9')](_0xc036('0xa'),new AGIError(_0xc036('0xb'),_0x4b9fd8));});sub['on']('message',function(_0x3cd3d9,_0x2de9ce){if(_0x3cd3d9!==_0xc036('0x8'))return;try{var _0x5ee3f8=JSON[_0xc036('0xc')](_0x2de9ce);eventEmitter['emit']('projectUpdate',_0x5ee3f8);}catch(_0xd8ffff){eventEmitter['emit'](_0xc036('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0xd8ffff));}});module[_0xc036('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x9926=['parse','exports','lodash','events','ioredis','../../config/environment','defaults','redis','localhost','agi','emit','error','E_AGI_SERVER_ERROR','message'];(function(_0x21c535,_0x420228){var _0x257eb4=function(_0xc02c86){while(--_0xc02c86){_0x21c535['push'](_0x21c535['shift']());}};_0x257eb4(++_0x420228);}(_0x9926,0x1ec));var _0x6992=function(_0x324f93,_0x3c0faa){_0x324f93=_0x324f93-0x0;var _0x21235a=_0x9926[_0x324f93];return _0x21235a;};'use strict';var _=require(_0x6992('0x0'));var EventEmitter=require(_0x6992('0x1'))['EventEmitter'];var Redis=require(_0x6992('0x2'));var AGIError=require('./error');var config=require(_0x6992('0x3'));config['redis']=_[_0x6992('0x4')](config[_0x6992('0x5')],{'host':_0x6992('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub['subscribe'](_0x6992('0x7'),function(_0x51add5){if(_0x51add5)return eventEmitter[_0x6992('0x8')](_0x6992('0x9'),new AGIError(_0x6992('0xa'),_0x51add5));});sub['on'](_0x6992('0xb'),function(_0x20c7d4,_0x309e69){if(_0x20c7d4!==_0x6992('0x7'))return;try{var _0x86824d=JSON[_0x6992('0xc')](_0x309e69);eventEmitter[_0x6992('0x8')]('projectUpdate',_0x86824d);}catch(_0x40e3f4){eventEmitter[_0x6992('0x8')](_0x6992('0x9'),new AGIError(_0x6992('0xa'),_0x40e3f4));}});module[_0x6992('0xd')]={'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 bd5c061..8d8a718 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 _0x8148=['numberOfEdges','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','target','default','agicommand','invalid','vswitch','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','menu','getdigits','getsecretdigits','edges','prototype','addVertex','vertices'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0x8148,0x117));var _0x8814=function(_0x390bc5,_0x286a71){_0x390bc5=_0x390bc5-0x0;var _0x22ed1a=_0x8148[_0x390bc5];return _0x22ed1a;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x8814('0x0'),_0x8814('0x1'),_0x8814('0x2')];var Graph=function(){this['vertices']={};this[_0x8814('0x3')]={};this['numberOfEdges']=0x0;};Graph[_0x8814('0x4')][_0x8814('0x5')]=function(_0x528a0a){this[_0x8814('0x6')][_0x528a0a['id']]=_0x528a0a;this['edges'][_0x528a0a['id']]=[];};Graph[_0x8814('0x4')]['addEdge']=function(_0x52c11b,_0x1f32c8,_0x817a18){this[_0x8814('0x3')][_0x52c11b]['push']({'target':_0x1f32c8,'condition':_0x817a18});this[_0x8814('0x7')]+=0x1;};Graph[_0x8814('0x4')][_0x8814('0x8')]=function(){return _[_0x8814('0x8')](this[_0x8814('0x6')]);};Graph[_0x8814('0x4')][_0x8814('0x9')]=function(){return this[_0x8814('0x7')];};Graph[_0x8814('0x4')]['getVertex']=function(_0x527d99){return this['vertices'][_0x527d99];};Graph[_0x8814('0x4')][_0x8814('0xa')]=function(_0x4085b4,_0xb78d88){if(!this[_0x8814('0x6')][_0x4085b4]){return logger[_0x8814('0xb')](_0x8814('0xc'));}var _0x3feb67=_0xb78d88(this[_0x8814('0x6')][_0x4085b4]);if(!_0x3feb67){return logger[_0x8814('0xb')](_0x8814('0xd'));}if(this['edges'][_0x4085b4][_0x8814('0xe')]===0x0){return logger[_0x8814('0xb')](_0x8814('0xf'));}for(var _0x661648=0x0,_0x255485=[],_0x18ed48=![];_0x661648\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','close','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','127.0.0.1','projectUpdate','nextTick','error','findIndex','splice','stack','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','info','arg_1','calleridname','callerid','uniqueid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','indexOf','agi_','substring'];(function(_0x1fc1d7,_0x409009){var _0x46c50b=function(_0x1d7e3e){while(--_0x1d7e3e){_0x1fc1d7['push'](_0x1fc1d7['shift']());}};_0x46c50b(++_0x409009);}(_0x775c,0x18a));var _0xc775=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x775c[_0xbe40ad];return _0x50fac9;};'use strict';var _=require(_0xc775('0x0'));var syncho=require(_0xc775('0x1'));var util=require(_0xc775('0x2'));var config=require(_0xc775('0x3'));var logger=require(_0xc775('0x4'))(_0xc775('0x5'));var utilLicense=require(_0xc775('0x6'));var rpc=require(_0xc775('0x7'));var Project=require(_0xc775('0x8'));var AGIEmitter=require(_0xc775('0x9'))['EventEmitter'];var projects=[];config[_0xc775('0x5')]=_[_0xc775('0xa')](config['agi'],{'ip':_0xc775('0xb'),'port':0x11dd});AGIEmitter['on'](_0xc775('0xc'),projectUpdateHandler);function connectionHandler(_0x14039e){process[_0xc775('0xd')](function(){syncho(function(){try{setChannelVariables(_0x14039e);agiHandler(_0x14039e);}catch(_0x5c1756){logger[_0xc775('0xe')](_0x5c1756['stack']);}});});}function projectUpdateHandler(_0x36771f){try{var _0x520f76=_[_0xc775('0xf')](projects,['id',_0x36771f['id']]);if(_0x520f76>-0x1){if(_0x36771f['deleted']===!![]){projects[_0xc775('0x10')](_0x520f76,0x1);}else{projects[_0x520f76]=_0x36771f;}}else{projects['push'](_0x36771f);}}catch(_0x56baab){logger['error'](_0x56baab[_0xc775('0x11')]);}}function listeningHandler(){console[_0xc775('0x12')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0xc775('0x13')]);logger['info'](util[_0xc775('0x14')](_0xc775('0x15'),config[_0xc775('0x5')]['ip'],config[_0xc775('0x5')][_0xc775('0x13')]));}function errorHandler(_0x5900da){if(_0x5900da&&_0x5900da[_0xc775('0x16')]&&_0x5900da[_0xc775('0x17')]){logger[_0xc775('0xe')](util['format'](_0xc775('0x18'),_0x5900da['name'],_0x5900da[_0xc775('0x17')]));}else{logger[_0xc775('0xe')](util[_0xc775('0x14')](_0xc775('0x19'),_0x5900da[_0xc775('0x11')]));}}function closeHandler(){logger[_0xc775('0x1a')](util[_0xc775('0x14')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xc775('0x1b')],this[_0xc775('0x1c')],this[_0xc775('0x1d')],this['dnid'],this[_0xc775('0x1e')]));try{createSquareReport(this);}catch(_0x200c9b){logger[_0xc775('0xe')](_0x200c9b['stack']);}}function timeoutHandler(){logger[_0xc775('0x1a')](util[_0xc775('0x14')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xc775('0x1b')],this['calleridname'],this[_0xc775('0x1d')],this[_0xc775('0x1f')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xc775('0x14')](_0xc775('0x20'),this[_0xc775('0x1b')],this[_0xc775('0x1c')],this['callerid'],this['dnid'],this['uniqueid']));this[_0xc775('0x21')]=!![];}function createSquareReport(_0x38f416,_0x4fa24e){rpc[_0xc775('0x22')](_0x38f416)[_0xc775('0x23')](function(_0x277fbd){if(_0x4fa24e){_0x4fa24e(null,_0x277fbd);}})[_0xc775('0x24')](function(_0x7aa345){if(_0x4fa24e){_0x4fa24e(null,_0x7aa345);}});}function setChannelVariables(_0x827045){for(var _0x5bb1f8 in _0x827045){if(_0x827045['hasOwnProperty'](_0x5bb1f8)){if(_0x5bb1f8[_0xc775('0x25')](_0xc775('0x26'))===0x0){_0x827045[_0x5bb1f8[_0xc775('0x27')](0x4)]=_0x827045[_0x5bb1f8];delete _0x827045[_0x5bb1f8];}}}}function agiHandler(_0x5d756b){logger['debug'](_0xc775('0x28'),JSON['stringify'](_0x5d756b,null,0x2));logger[_0xc775('0x1a')](util[_0xc775('0x14')](_0xc775('0x29'),_0x5d756b['arg_1'],_0x5d756b[_0xc775('0x1c')],_0x5d756b[_0xc775('0x1d')],_0x5d756b[_0xc775('0x1f')],_0x5d756b[_0xc775('0x1e')]));_0x5d756b['on']('error',errorHandler);_0x5d756b['on']('close',closeHandler);_0x5d756b['on'](_0xc775('0x2a'),timeoutHandler);_0x5d756b[_0xc775('0x21')]=![];_0x5d756b['on'](_0xc775('0x2b'),hangupHandler);var _0x751a72=_[_0xc775('0x2c')](projects,[_0xc775('0x16'),_0x5d756b[_0xc775('0x1b')]]);if(!_0x751a72)return Project[_0xc775('0x2d')](_0x5d756b);if(!_0x751a72[_0xc775('0x2e')])return Project[_0xc775('0x2f')](_0x5d756b);return Project[_0xc775('0x30')](_0x751a72,_0x5d756b);}function main(){var _0x50428c;return utilLicense[_0xc775('0x31')]()[_0xc775('0x23')](function(_0x26db43){if(!_0x26db43)return;if(_0x26db43[_0xc775('0x32')]){if(_0x26db43[_0xc775('0x33')]&&_0x26db43[_0xc775('0x33')]>0x0){logger[_0xc775('0x1a')](util['format'](_0xc775('0x34'),_0x26db43[_0xc775('0x33')]));_0x50428c=_0x26db43[_0xc775('0x33')];}else{logger[_0xc775('0x1a')](_0xc775('0x35'));}}else{logger[_0xc775('0x1a')](_0xc775('0x36'));_0x50428c=-0x1;}})[_0xc775('0x23')](function(){return Project[_0xc775('0x37')]();})[_0xc775('0x23')](function(_0x258e21){projects=_0x258e21;return;})[_0xc775('0x24')](function(_0x456561){logger[_0xc775('0xe')](_0xc775('0x38'),_0x456561[_0xc775('0x11')]);})[_0xc775('0x39')](function(){var _0x479c70=require(_0xc775('0x3a'))(config[_0xc775('0x5')][_0xc775('0x13')],config[_0xc775('0x5')]['ip'],_0x50428c);_0x479c70['on'](_0xc775('0xe'),errorHandler);_0x479c70['on'](_0xc775('0x3b'),listeningHandler);_0x479c70['on'](_0xc775('0x3c'),connectionHandler);_0x479c70['on'](_0xc775('0x3d'),closeHandler);});}main(); \ No newline at end of file +var _0x4b02=['finally','listening','connection','lodash','syncho','util','agi','./rpc','./events','EventEmitter','defaults','127.0.0.1','nextTick','findIndex','deleted','splice','push','error','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','format','[%s]\x20%s','message','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf','agi_','variables','close','timeout','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','then','[LICENSE]'];(function(_0x1d6fce,_0x4671c9){var _0x556c10=function(_0x99cae0){while(--_0x99cae0){_0x1d6fce['push'](_0x1d6fce['shift']());}};_0x556c10(++_0x4671c9);}(_0x4b02,0xdb));var _0x24b0=function(_0x2dc3c4,_0x9f99e5){_0x2dc3c4=_0x2dc3c4-0x0;var _0x58c380=_0x4b02[_0x2dc3c4];return _0x58c380;};'use strict';var _=require(_0x24b0('0x0'));var syncho=require(_0x24b0('0x1'));var util=require(_0x24b0('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x24b0('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0x24b0('0x4'));var Project=require('./project');var AGIEmitter=require(_0x24b0('0x5'))[_0x24b0('0x6')];var projects=[];config[_0x24b0('0x3')]=_[_0x24b0('0x7')](config['agi'],{'ip':_0x24b0('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x3049cb){process[_0x24b0('0x9')](function(){syncho(function(){try{setChannelVariables(_0x3049cb);agiHandler(_0x3049cb);}catch(_0x34ee19){logger['error'](_0x34ee19['stack']);}});});}function projectUpdateHandler(_0x572eb3){try{var _0x26236d=_[_0x24b0('0xa')](projects,['id',_0x572eb3['id']]);if(_0x26236d>-0x1){if(_0x572eb3[_0x24b0('0xb')]===!![]){projects[_0x24b0('0xc')](_0x26236d,0x1);}else{projects[_0x26236d]=_0x572eb3;}}else{projects[_0x24b0('0xd')](_0x572eb3);}}catch(_0x5e15c2){logger[_0x24b0('0xe')](_0x5e15c2['stack']);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x24b0('0x3')][_0x24b0('0xf')]);logger[_0x24b0('0x10')](util['format'](_0x24b0('0x11'),config[_0x24b0('0x3')]['ip'],config[_0x24b0('0x3')][_0x24b0('0xf')]));}function errorHandler(_0x26c845){if(_0x26c845&&_0x26c845[_0x24b0('0x12')]&&_0x26c845['message']){logger['error'](util[_0x24b0('0x13')](_0x24b0('0x14'),_0x26c845[_0x24b0('0x12')],_0x26c845[_0x24b0('0x15')]));}else{logger[_0x24b0('0xe')](util['format'](_0x24b0('0x16'),_0x26c845[_0x24b0('0x17')]));}}function closeHandler(){logger[_0x24b0('0x10')](util[_0x24b0('0x13')](_0x24b0('0x18'),this[_0x24b0('0x19')],this[_0x24b0('0x1a')],this[_0x24b0('0x1b')],this[_0x24b0('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x56c4ba){logger[_0x24b0('0xe')](_0x56c4ba[_0x24b0('0x17')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x24b0('0x19')],this[_0x24b0('0x1a')],this['callerid'],this[_0x24b0('0x1c')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x24b0('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x24b0('0x19')],this['calleridname'],this[_0x24b0('0x1b')],this[_0x24b0('0x1c')],this[_0x24b0('0x1d')]));this[_0x24b0('0x1e')]=!![];}function createSquareReport(_0x176798,_0x4c5742){rpc[_0x24b0('0x1f')](_0x176798)['then'](function(_0x25515a){if(_0x4c5742){_0x4c5742(null,_0x25515a);}})[_0x24b0('0x20')](function(_0x1841af){if(_0x4c5742){_0x4c5742(null,_0x1841af);}});}function setChannelVariables(_0x23e60e){for(var _0x54c5bc in _0x23e60e){if(_0x23e60e[_0x24b0('0x21')](_0x54c5bc)){if(_0x54c5bc[_0x24b0('0x22')](_0x24b0('0x23'))===0x0){_0x23e60e[_0x54c5bc['substring'](0x4)]=_0x23e60e[_0x54c5bc];delete _0x23e60e[_0x54c5bc];}}}}function agiHandler(_0x27a7c6){logger['debug'](_0x24b0('0x24'),JSON['stringify'](_0x27a7c6,null,0x2));logger['info'](util[_0x24b0('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x27a7c6[_0x24b0('0x19')],_0x27a7c6[_0x24b0('0x1a')],_0x27a7c6['callerid'],_0x27a7c6['dnid'],_0x27a7c6['uniqueid']));_0x27a7c6['on'](_0x24b0('0xe'),errorHandler);_0x27a7c6['on'](_0x24b0('0x25'),closeHandler);_0x27a7c6['on'](_0x24b0('0x26'),timeoutHandler);_0x27a7c6[_0x24b0('0x1e')]=![];_0x27a7c6['on'](_0x24b0('0x27'),hangupHandler);var _0x2053b6=_[_0x24b0('0x28')](projects,[_0x24b0('0x12'),_0x27a7c6[_0x24b0('0x19')]]);if(!_0x2053b6)return Project[_0x24b0('0x29')](_0x27a7c6);if(!_0x2053b6['production'])return Project[_0x24b0('0x2a')](_0x27a7c6);return Project[_0x24b0('0x2b')](_0x2053b6,_0x27a7c6);}function main(){var _0x474d10;return utilLicense[_0x24b0('0x2c')]()['then'](function(_0x40f0ed){if(!_0x40f0ed)return;if(_0x40f0ed['voice']){if(_0x40f0ed[_0x24b0('0x2d')]&&_0x40f0ed['callysquare']>0x0){logger[_0x24b0('0x10')](util[_0x24b0('0x13')](_0x24b0('0x2e'),_0x40f0ed[_0x24b0('0x2d')]));_0x474d10=_0x40f0ed[_0x24b0('0x2d')];}else{logger[_0x24b0('0x10')](_0x24b0('0x2f'));}}else{logger['info'](_0x24b0('0x30'));_0x474d10=-0x1;}})[_0x24b0('0x31')](function(){return Project['getAll']();})[_0x24b0('0x31')](function(_0x2ef65f){projects=_0x2ef65f;return;})[_0x24b0('0x20')](function(_0x5e1178){logger[_0x24b0('0xe')](_0x24b0('0x32'),_0x5e1178[_0x24b0('0x17')]);})[_0x24b0('0x33')](function(){var _0x37b111=require('./server')(config[_0x24b0('0x3')][_0x24b0('0xf')],config[_0x24b0('0x3')]['ip'],_0x474d10);_0x37b111['on'](_0x24b0('0xe'),errorHandler);_0x37b111['on'](_0x24b0('0x34'),listeningHandler);_0x37b111['on'](_0x24b0('0x35'),connectionHandler);_0x37b111['on'](_0x24b0('0x25'),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 076cb1f..83bab8a 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 _0xaa57=['then','error','message','result','catch','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0xbc9827,_0x24a166){var _0x145393=function(_0x2c1bad){while(--_0x2c1bad){_0xbc9827['push'](_0xbc9827['shift']());}};_0x145393(++_0x24a166);}(_0xaa57,0x15c));var _0x7aa5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xaa57[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0x7aa5('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x7aa5('0x1')][_0x7aa5('0x2')]({'port':0x232b});function request(_0x447450,_0x2d7e88){return new BPromise(function(_0x33edd5,_0x476543){return client[_0x7aa5('0x3')](_0x447450,_0x2d7e88)[_0x7aa5('0x4')](function(_0x28497c){if(_0x28497c[_0x7aa5('0x5')]){return _0x476543(_0x28497c[_0x7aa5('0x5')][_0x7aa5('0x6')]);}else{return _0x33edd5(_0x28497c[_0x7aa5('0x7')]);}})[_0x7aa5('0x8')](function(_0x78fa12){return _0x476543(_0x78fa12);});});}exports[_0x7aa5('0x9')]=function(_0x305493,_0x4a07a4){return request(_0x7aa5('0xa'),{'account':_0x305493,'message':_0x4a07a4});}; \ No newline at end of file +var _0xfdc5=['error','message','result','catch','sendMailMessage','SendMail','client','http','request','then'];(function(_0x48c96d,_0x4c8874){var _0x573261=function(_0x15d38d){while(--_0x15d38d){_0x48c96d['push'](_0x48c96d['shift']());}};_0x573261(++_0x4c8874);}(_0xfdc5,0x92));var _0x5fdc=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xfdc5[_0x46f1a6];return _0x38429a;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x5fdc('0x0')][_0x5fdc('0x1')]({'port':0x232b});function request(_0x2dfad7,_0xfde73b){return new BPromise(function(_0x485c72,_0x13f39f){return client[_0x5fdc('0x2')](_0x2dfad7,_0xfde73b)[_0x5fdc('0x3')](function(_0x890093){if(_0x890093[_0x5fdc('0x4')]){return _0x13f39f(_0x890093[_0x5fdc('0x4')][_0x5fdc('0x5')]);}else{return _0x485c72(_0x890093[_0x5fdc('0x6')]);}})[_0x5fdc('0x7')](function(_0xa85971){return _0x13f39f(_0xa85971);});});}exports[_0x5fdc('0x8')]=function(_0x4e416f,_0x25f92b){return request(_0x5fdc('0x9'),{'account':_0x4e416f,'message':_0x25f92b});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 06b4543..f6c0fb2 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 _0x3fcd=['getSquareProjects','catch','error','stack','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','traverseBFS','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','continueAt','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3fcd,0x1be));var _0xd3fc=function(_0x164594,_0x3d7fb2){_0x164594=_0x164594-0x0;var _0x2ad222=_0x3fcd[_0x164594];return _0x2ad222;};'use strict';var _=require(_0xd3fc('0x0'));var moment=require(_0xd3fc('0x1'));var parser=require(_0xd3fc('0x2'));var util=require(_0xd3fc('0x3'));var logger=require(_0xd3fc('0x4'))(_0xd3fc('0x5'));var rpc=require(_0xd3fc('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0xd3fc('0x7'));var Vertices=require(_0xd3fc('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xd3fc('0x9')]()[_0xd3fc('0xa')](function(_0x1ed7e3){logger[_0xd3fc('0xb')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x1ed7e3[_0xd3fc('0xc')]);return[];});}function addVertex(_0xbe49fc,_0x2a55a8,_0x4d1035){_0x2a55a8['agicommand']=_0x4d1035;if(_0x2a55a8[_0xd3fc('0xd')]('retry')){_0x2a55a8[_0xd3fc('0xe')]=parseInt(_0x2a55a8[_0xd3fc('0xf')],0xa);}_0xbe49fc[_0xd3fc('0x10')](_[_0xd3fc('0x11')](_0x2a55a8,_0xd3fc('0x12')));}function initGraph(_0xdd7171,_0x40268a){var _0x440071=new Graph();for(var _0x3a2fa6 in _0xdd7171){if(_0xdd7171[_0xd3fc('0xd')](_0x3a2fa6)){if(_[_0xd3fc('0x13')](_0xdd7171[_0x3a2fa6])){for(var _0x5e74bd=0x0;_0x5e74bd<_0xdd7171[_0x3a2fa6][_0xd3fc('0x14')];_0x5e74bd+=0x1){addVertex(_0x440071,_0xdd7171[_0x3a2fa6][_0x5e74bd],_0x3a2fa6);}}else{addVertex(_0x440071,_0xdd7171[_0x3a2fa6],_0x3a2fa6);}}}for(var _0x3b00fc=0x0;_0x3b00fc<_0x40268a['length'];_0x3b00fc+=0x1){if(_0x40268a[_0x3b00fc][_0xd3fc('0x15')]&&_0x40268a[_0x3b00fc]['target']){_0x440071[_0xd3fc('0x16')](_0x40268a[_0x3b00fc][_0xd3fc('0x15')],_0x40268a[_0x3b00fc][_0xd3fc('0x17')],_0x40268a[_0x3b00fc][_0xd3fc('0x18')]);}}return _0x440071;}function getRoot(_0x238738){return parser['toJson'](_0x238738,{'object':!![]})[_0xd3fc('0x19')][_0xd3fc('0x1a')];}function inspect(_0x47a9b9){return util[_0xd3fc('0x1b')](_0x47a9b9,{'showHidden':![],'depth':null});}function initialize(_0x322ac5,_0x3dde5b){var _0x3263b2=getRoot(_0x322ac5[_0xd3fc('0x1c')]);if(!_0x3263b2||!_0x3263b2[_0xd3fc('0x1d')])return;var _0x2d55b7,_0x49c787,_0x411d15;logger[_0xd3fc('0x1e')](_0xd3fc('0x1a'),JSON[_0xd3fc('0x1f')](_0x3263b2,null,0x2));_0x3dde5b[_0xd3fc('0x20')]=moment()[_0xd3fc('0x21')](_0xd3fc('0x22'));_0x2d55b7=initGraph(_[_0xd3fc('0x11')](_0x3263b2,_0xd3fc('0x12')),_0x3263b2[_0xd3fc('0x12')]);_0x49c787=new Vertices(_0x3dde5b,rpc,mailRpc);logger[_0xd3fc('0x23')](util['format'](_0xd3fc('0x24'),_0x3dde5b[_0xd3fc('0x25')],_0x3dde5b[_0xd3fc('0x26')],_0x3dde5b['callerid'],_0x3dde5b['dnid'],_0x3dde5b['uniqueid']));_0x2d55b7['traverseBFS'](_0x3263b2['start']['id'],function(_0x28a233){try{_0x28a233=_0x49c787[_0xd3fc('0x27')](_0x28a233);logger['debug'](_0xd3fc('0x28'),JSON[_0xd3fc('0x1f')](_0x28a233,null,0x2));if(_0x28a233[_0xd3fc('0x29')]==='gotoc'){logger['info'](_0xd3fc('0x2a'));_0x3dde5b[_0xd3fc('0x2b')]=_0x28a233['context']||_0x3dde5b['context'];_0x3dde5b[_0xd3fc('0x2c')]=_0x28a233[_0xd3fc('0x2c')];_0x3dde5b[_0xd3fc('0x2d')]=_0x28a233[_0xd3fc('0x2d')]?_0x28a233['priority']-0x1:0x1;return null;}else if(_0x28a233&&_0x49c787[_0x28a233[_0xd3fc('0x29')]]){_0x411d15=_0x49c787[_0x28a233['agicommand']](_0x28a233);logger[_0xd3fc('0x23')]('response',JSON[_0xd3fc('0x1f')](_0x411d15,null,0x2));if(_0x411d15&&_0x411d15[_0xd3fc('0x2e')]===AGI_CODE_SUCCESS&&_0x411d15[_0xd3fc('0x2f')]!==AGI_RESULT_ERROR&&!_0x3dde5b[_0xd3fc('0x30')]){logger['debug'](_0xd3fc('0x31'),inspect(_0x411d15));return _[_0xd3fc('0x32')](_0x411d15[_0xd3fc('0x2f')])?null:_0x411d15[_0xd3fc('0x2f')][_0xd3fc('0x33')]();}else{logger[_0xd3fc('0xb')](_0xd3fc('0x31'),inspect(_0x411d15));return null;}}else{logger[_0xd3fc('0xb')](_0xd3fc('0x34'));return null;}}catch(_0x2ee7cc){logger[_0xd3fc('0xb')](_0x2ee7cc[_0xd3fc('0xc')]);return null;}});if(_0x3263b2['finally']){logger[_0xd3fc('0x23')](util[_0xd3fc('0x21')](_0xd3fc('0x35'),_0x3dde5b[_0xd3fc('0x25')],_0x3dde5b[_0xd3fc('0x26')],_0x3dde5b['callerid'],_0x3dde5b[_0xd3fc('0x36')],_0x3dde5b['uniqueid']));_0x2d55b7[_0xd3fc('0x37')](_0x3263b2[_0xd3fc('0x38')]['id'],function(_0x5a0e4c){try{_0x5a0e4c=_0x49c787['clear'](_0x5a0e4c);logger[_0xd3fc('0x1e')]('vertex',JSON[_0xd3fc('0x1f')](_0x5a0e4c,null,0x2));if(_0x5a0e4c&&_0x49c787[_0x5a0e4c['agicommand']]){_0x411d15=_0x49c787[_0x5a0e4c['agicommand']](_0x5a0e4c);if(_0x411d15){logger['debug'](_0xd3fc('0x31'),inspect(_0x411d15));return _['isUndefined'](_0x411d15[_0xd3fc('0x2f')])?null:_0x411d15[_0xd3fc('0x2f')]['toString']();}else{logger[_0xd3fc('0xb')](_0xd3fc('0x31'),inspect(_0x411d15));return null;}}else{logger[_0xd3fc('0xb')](_0xd3fc('0x34'));return null;}}catch(_0x230b21){logger[_0xd3fc('0xb')](_0x230b21[_0xd3fc('0xc')]);return null;}});}logger['info'](util['format'](_0xd3fc('0x39'),_0x3dde5b[_0xd3fc('0x25')],_0x3dde5b[_0xd3fc('0x26')],_0x3dde5b[_0xd3fc('0x3a')],_0x3dde5b[_0xd3fc('0x36')],_0x3dde5b[_0xd3fc('0x3b')]));logger['info'](util[_0xd3fc('0x21')](_0xd3fc('0x3c'),_0x3dde5b[_0xd3fc('0x2b')],_0x3dde5b[_0xd3fc('0x2c')],parseInt(_0x3dde5b['priority'],0xa)+0x1));_0x3dde5b['continueAt'](_0x3dde5b[_0xd3fc('0x2b')],_0x3dde5b[_0xd3fc('0x2c')],parseInt(_0x3dde5b[_0xd3fc('0x2d')],0xa)+0x1);_0x3dde5b[_0xd3fc('0x3d')]();}function handleNotFound(_0x373be9){logger[_0xd3fc('0xb')](util[_0xd3fc('0x21')]('Project\x20%s\x20not\x20found',_0x373be9['arg_1']));_0x373be9[_0xd3fc('0x3e')](_0x373be9[_0xd3fc('0x2b')],_0x373be9[_0xd3fc('0x2c')],parseInt(_0x373be9[_0xd3fc('0x2d')],0xa)+0x1);_0x373be9[_0xd3fc('0x3d')]();}function handleUnpublished(_0x4148d2){logger[_0xd3fc('0xb')](util['format'](_0xd3fc('0x3f'),_0x4148d2[_0xd3fc('0x25')]));_0x4148d2['continueAt'](_0x4148d2[_0xd3fc('0x2b')],_0x4148d2[_0xd3fc('0x2c')],parseInt(_0x4148d2['priority'],0xa)+0x1);_0x4148d2[_0xd3fc('0x3d')]();}module[_0xd3fc('0x40')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x73db=['../../config/logger','agi','./rpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','traverseBFS','start','clear','debug','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','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','calleridname','dnid','uniqueid','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','moment','xml2json','util'];(function(_0x184c8a,_0x1d57dc){var _0x5a48f5=function(_0x4fac1a){while(--_0x4fac1a){_0x184c8a['push'](_0x184c8a['shift']());}};_0x5a48f5(++_0x1d57dc);}(_0x73db,0xc2));var _0xb73d=function(_0x579a75,_0x1b2397){_0x579a75=_0x579a75-0x0;var _0x578c6d=_0x73db[_0x579a75];return _0x578c6d;};'use strict';var _=require(_0xb73d('0x0'));var moment=require(_0xb73d('0x1'));var parser=require(_0xb73d('0x2'));var util=require(_0xb73d('0x3'));var logger=require(_0xb73d('0x4'))(_0xb73d('0x5'));var rpc=require(_0xb73d('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0xb73d('0x7'));var Vertices=require(_0xb73d('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xb73d('0x9')](function(_0x5dfc3e){logger[_0xb73d('0xa')](_0xb73d('0xb'),_0x5dfc3e[_0xb73d('0xc')]);return[];});}function addVertex(_0x226089,_0x87ab88,_0x5cde6c){_0x87ab88[_0xb73d('0xd')]=_0x5cde6c;if(_0x87ab88[_0xb73d('0xe')](_0xb73d('0xf'))){_0x87ab88[_0xb73d('0x10')]=parseInt(_0x87ab88[_0xb73d('0xf')],0xa);}_0x226089[_0xb73d('0x11')](_['omit'](_0x87ab88,_0xb73d('0x12')));}function initGraph(_0x461c59,_0x51bb80){var _0x5b0778=new Graph();for(var _0xbfba0 in _0x461c59){if(_0x461c59[_0xb73d('0xe')](_0xbfba0)){if(_[_0xb73d('0x13')](_0x461c59[_0xbfba0])){for(var _0x1b73ff=0x0;_0x1b73ff<_0x461c59[_0xbfba0][_0xb73d('0x14')];_0x1b73ff+=0x1){addVertex(_0x5b0778,_0x461c59[_0xbfba0][_0x1b73ff],_0xbfba0);}}else{addVertex(_0x5b0778,_0x461c59[_0xbfba0],_0xbfba0);}}}for(var _0x379303=0x0;_0x379303<_0x51bb80['length'];_0x379303+=0x1){if(_0x51bb80[_0x379303][_0xb73d('0x15')]&&_0x51bb80[_0x379303][_0xb73d('0x16')]){_0x5b0778[_0xb73d('0x17')](_0x51bb80[_0x379303][_0xb73d('0x15')],_0x51bb80[_0x379303]['target'],_0x51bb80[_0x379303][_0xb73d('0x18')]);}}return _0x5b0778;}function getRoot(_0x3d9d24){return parser[_0xb73d('0x19')](_0x3d9d24,{'object':!![]})[_0xb73d('0x1a')][_0xb73d('0x1b')];}function inspect(_0x39fa4e){return util[_0xb73d('0x1c')](_0x39fa4e,{'showHidden':![],'depth':null});}function initialize(_0x2c9775,_0x2c2176){var _0x28fe0f=getRoot(_0x2c9775['production']);if(!_0x28fe0f||!_0x28fe0f['start'])return;var _0x1d36fc,_0x4de59d,_0x104cac;logger['debug']('root',JSON['stringify'](_0x28fe0f,null,0x2));_0x2c2176[_0xb73d('0x1d')]=moment()[_0xb73d('0x1e')](_0xb73d('0x1f'));_0x1d36fc=initGraph(_[_0xb73d('0x20')](_0x28fe0f,'mxCell'),_0x28fe0f[_0xb73d('0x12')]);_0x4de59d=new Vertices(_0x2c2176,rpc,mailRpc);logger[_0xb73d('0x21')](util[_0xb73d('0x1e')](_0xb73d('0x22'),_0x2c2176[_0xb73d('0x23')],_0x2c2176['calleridname'],_0x2c2176[_0xb73d('0x24')],_0x2c2176['dnid'],_0x2c2176['uniqueid']));_0x1d36fc[_0xb73d('0x25')](_0x28fe0f[_0xb73d('0x26')]['id'],function(_0x417b86){try{_0x417b86=_0x4de59d[_0xb73d('0x27')](_0x417b86);logger[_0xb73d('0x28')]('vertex',JSON[_0xb73d('0x29')](_0x417b86,null,0x2));if(_0x417b86[_0xb73d('0xd')]===_0xb73d('0x2a')){logger[_0xb73d('0x21')](_0xb73d('0x2b'));_0x2c2176[_0xb73d('0x2c')]=_0x417b86[_0xb73d('0x2c')]||_0x2c2176[_0xb73d('0x2c')];_0x2c2176[_0xb73d('0x2d')]=_0x417b86[_0xb73d('0x2d')];_0x2c2176[_0xb73d('0x2e')]=_0x417b86[_0xb73d('0x2e')]?_0x417b86[_0xb73d('0x2e')]-0x1:0x1;return null;}else if(_0x417b86&&_0x4de59d[_0x417b86[_0xb73d('0xd')]]){_0x104cac=_0x4de59d[_0x417b86[_0xb73d('0xd')]](_0x417b86);logger[_0xb73d('0x21')]('response',JSON[_0xb73d('0x29')](_0x104cac,null,0x2));if(_0x104cac&&_0x104cac[_0xb73d('0x2f')]===AGI_CODE_SUCCESS&&_0x104cac[_0xb73d('0x30')]!==AGI_RESULT_ERROR&&!_0x2c2176[_0xb73d('0x31')]){logger[_0xb73d('0x28')](_0xb73d('0x32'),inspect(_0x104cac));return _[_0xb73d('0x33')](_0x104cac[_0xb73d('0x30')])?null:_0x104cac[_0xb73d('0x30')][_0xb73d('0x34')]();}else{logger['error'](_0xb73d('0x32'),inspect(_0x104cac));return null;}}else{logger['error'](_0xb73d('0x35'));return null;}}catch(_0x521c12){logger[_0xb73d('0xa')](_0x521c12['stack']);return null;}});if(_0x28fe0f[_0xb73d('0x36')]){logger[_0xb73d('0x21')](util[_0xb73d('0x1e')](_0xb73d('0x37'),_0x2c2176[_0xb73d('0x23')],_0x2c2176[_0xb73d('0x38')],_0x2c2176['callerid'],_0x2c2176[_0xb73d('0x39')],_0x2c2176[_0xb73d('0x3a')]));_0x1d36fc[_0xb73d('0x25')](_0x28fe0f['finally']['id'],function(_0x4e9d44){try{_0x4e9d44=_0x4de59d['clear'](_0x4e9d44);logger[_0xb73d('0x28')](_0xb73d('0x3b'),JSON[_0xb73d('0x29')](_0x4e9d44,null,0x2));if(_0x4e9d44&&_0x4de59d[_0x4e9d44[_0xb73d('0xd')]]){_0x104cac=_0x4de59d[_0x4e9d44[_0xb73d('0xd')]](_0x4e9d44);if(_0x104cac){logger[_0xb73d('0x28')](_0xb73d('0x32'),inspect(_0x104cac));return _['isUndefined'](_0x104cac[_0xb73d('0x30')])?null:_0x104cac[_0xb73d('0x30')][_0xb73d('0x34')]();}else{logger[_0xb73d('0xa')](_0xb73d('0x32'),inspect(_0x104cac));return null;}}else{logger[_0xb73d('0xa')](_0xb73d('0x35'));return null;}}catch(_0x4cfd4b){logger[_0xb73d('0xa')](_0x4cfd4b[_0xb73d('0xc')]);return null;}});}logger[_0xb73d('0x21')](util[_0xb73d('0x1e')](_0xb73d('0x3c'),_0x2c2176['arg_1'],_0x2c2176['calleridname'],_0x2c2176[_0xb73d('0x24')],_0x2c2176['dnid'],_0x2c2176['uniqueid']));logger[_0xb73d('0x21')](util[_0xb73d('0x1e')](_0xb73d('0x3d'),_0x2c2176[_0xb73d('0x2c')],_0x2c2176[_0xb73d('0x2d')],parseInt(_0x2c2176[_0xb73d('0x2e')],0xa)+0x1));_0x2c2176[_0xb73d('0x3e')](_0x2c2176[_0xb73d('0x2c')],_0x2c2176['extension'],parseInt(_0x2c2176[_0xb73d('0x2e')],0xa)+0x1);_0x2c2176[_0xb73d('0x3f')]();}function handleNotFound(_0x24d119){logger[_0xb73d('0xa')](util[_0xb73d('0x1e')](_0xb73d('0x40'),_0x24d119[_0xb73d('0x23')]));_0x24d119[_0xb73d('0x3e')](_0x24d119['context'],_0x24d119[_0xb73d('0x2d')],parseInt(_0x24d119['priority'],0xa)+0x1);_0x24d119[_0xb73d('0x3f')]();}function handleUnpublished(_0x32c6d6){logger[_0xb73d('0xa')](util[_0xb73d('0x1e')](_0xb73d('0x41'),_0x32c6d6['arg_1']));_0x32c6d6[_0xb73d('0x3e')](_0x32c6d6[_0xb73d('0x2c')],_0x32c6d6['extension'],parseInt(_0x32c6d6[_0xb73d('0x2e')],0xa)+0x1);_0x32c6d6['close']();}module['exports']={'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 23886a5..a39ea2c 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 _0xd876=['_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','slice','trim','emit','headers','line','exports','util','stream','call'];(function(_0x30cb3f,_0x859105){var _0x527cc1=function(_0x406d06){while(--_0x406d06){_0x30cb3f['push'](_0x30cb3f['shift']());}};_0x527cc1(++_0x859105);}(_0xd876,0xed));var _0x6d87=function(_0x245979,_0x1e52de){_0x245979=_0x245979-0x0;var _0x25ef14=_0xd876[_0x245979];return _0x25ef14;};'use strict';var util=require(_0x6d87('0x0'));var Transform=require(_0x6d87('0x1'))['Transform'];function AGIReply(_0x201d35){Transform[_0x6d87('0x2')](this,_0x201d35);this[_0x6d87('0x3')]='';this[_0x6d87('0x4')]=![];}util[_0x6d87('0x5')](AGIReply,Transform);AGIReply[_0x6d87('0x6')][_0x6d87('0x7')]=function(_0x22bf97,_0x3309f4,_0x3b1fa3){var _0x500178='\x0a',_0x4c57b3=['\x0a\x0a',_0x6d87('0x8')],_0x3302b7=-0x1,_0x59382b=-0x1,_0x429cb2='',_0x4d40ba=0x0,_0x3eb752='',_0x451e82='';this[_0x6d87('0x3')]+=_0x22bf97[_0x6d87('0x9')]();_0x3eb752=this[_0x6d87('0x3')];if(!this[_0x6d87('0x4')]){_0x4d40ba=0x0;while(_0x4c57b3[_0x4d40ba]){while((_0x59382b=_0x3eb752['indexOf'](_0x4c57b3[_0x4d40ba]))!=-0x1){_0x429cb2=_0x4c57b3[_0x4d40ba];_0x451e82=_0x3eb752[_0x6d87('0xa')](0x0,_0x59382b);_0x3eb752=_0x3eb752[_0x6d87('0xa')](_0x59382b+_0x429cb2[_0x6d87('0xb')]);var _0x20bb09=_0x451e82[_0x6d87('0xc')](_0x500178),_0x343281=0x0,_0x591666={},_0x17693a='',_0x2783c4='',_0x2a52ed=-0x1;while(_0x20bb09[_0x343281]){_0x2a52ed=_0x20bb09[_0x343281][_0x6d87('0xd')](':');if(_0x2a52ed!=-0x1){_0x17693a=_0x20bb09[_0x343281]['slice'](0x0,_0x2a52ed)['trim']();_0x2783c4=_0x20bb09[_0x343281][_0x6d87('0xe')](_0x2a52ed+0x1)[_0x6d87('0xf')]();if(_0x17693a[_0x6d87('0xb')]>0x0){_0x591666[_0x17693a]=_0x2783c4;}}else{}_0x343281++;}this[_0x6d87('0x10')](_0x6d87('0x11'),_0x591666);this['_inBody']=!![];}_0x4d40ba++;}this['_localBuffer']=_0x3eb752;}else{while((_0x3302b7=_0x3eb752[_0x6d87('0xd')](_0x500178))!=-0x1){_0x451e82=_0x3eb752[_0x6d87('0xa')](0x0,_0x3302b7);this[_0x6d87('0x10')](_0x6d87('0x12'),_0x451e82);_0x3eb752=_0x3eb752[_0x6d87('0xa')](_0x3302b7+_0x500178[_0x6d87('0xb')]);}this[_0x6d87('0x3')]=_0x3eb752;}_0x3b1fa3();};module[_0x6d87('0x13')]=AGIReply; \ No newline at end of file +var _0x3d4e=['length','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','trim','emit','headers','line'];(function(_0x26fb8c,_0x56ce21){var _0x456312=function(_0x53edce){while(--_0x53edce){_0x26fb8c['push'](_0x26fb8c['shift']());}};_0x456312(++_0x56ce21);}(_0x3d4e,0x1dd));var _0xe3d4=function(_0x560711,_0x5b233d){_0x560711=_0x560711-0x0;var _0x584c27=_0x3d4e[_0x560711];return _0x584c27;};'use strict';var util=require(_0xe3d4('0x0'));var Transform=require(_0xe3d4('0x1'))[_0xe3d4('0x2')];function AGIReply(_0x250611){Transform[_0xe3d4('0x3')](this,_0x250611);this[_0xe3d4('0x4')]='';this[_0xe3d4('0x5')]=![];}util[_0xe3d4('0x6')](AGIReply,Transform);AGIReply[_0xe3d4('0x7')][_0xe3d4('0x8')]=function(_0x2472b3,_0x5be6a4,_0x433f04){var _0x2a328d='\x0a',_0x58eb48=['\x0a\x0a',_0xe3d4('0x9')],_0x13a6cd=-0x1,_0x20e6a5=-0x1,_0x565b6b='',_0x16c959=0x0,_0xd48674='',_0x48dc87='';this[_0xe3d4('0x4')]+=_0x2472b3[_0xe3d4('0xa')]();_0xd48674=this['_localBuffer'];if(!this[_0xe3d4('0x5')]){_0x16c959=0x0;while(_0x58eb48[_0x16c959]){while((_0x20e6a5=_0xd48674[_0xe3d4('0xb')](_0x58eb48[_0x16c959]))!=-0x1){_0x565b6b=_0x58eb48[_0x16c959];_0x48dc87=_0xd48674['substring'](0x0,_0x20e6a5);_0xd48674=_0xd48674[_0xe3d4('0xc')](_0x20e6a5+_0x565b6b['length']);var _0x471e63=_0x48dc87['split'](_0x2a328d),_0x4e3174=0x0,_0x23863c={},_0x46a1e8='',_0x36ca71='',_0x1c055f=-0x1;while(_0x471e63[_0x4e3174]){_0x1c055f=_0x471e63[_0x4e3174][_0xe3d4('0xb')](':');if(_0x1c055f!=-0x1){_0x46a1e8=_0x471e63[_0x4e3174]['slice'](0x0,_0x1c055f)[_0xe3d4('0xd')]();_0x36ca71=_0x471e63[_0x4e3174]['slice'](_0x1c055f+0x1)[_0xe3d4('0xd')]();if(_0x46a1e8['length']>0x0){_0x23863c[_0x46a1e8]=_0x36ca71;}}else{}_0x4e3174++;}this[_0xe3d4('0xe')](_0xe3d4('0xf'),_0x23863c);this[_0xe3d4('0x5')]=!![];}_0x16c959++;}this['_localBuffer']=_0xd48674;}else{while((_0x13a6cd=_0xd48674[_0xe3d4('0xb')](_0x2a328d))!=-0x1){_0x48dc87=_0xd48674[_0xe3d4('0xc')](0x0,_0x13a6cd);this[_0xe3d4('0xe')](_0xe3d4('0x10'),_0x48dc87);_0xd48674=_0xd48674[_0xe3d4('0xc')](_0x13a6cd+_0x2a328d[_0xe3d4('0x11')]);}this[_0xe3d4('0x4')]=_0xd48674;}_0x433f04();};module[_0xe3d4('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 26faf36..c4cef31 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 _0xe0b2=['moment','jayson/promise','client','http','request','then','error','message','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getContactByPhone','GetContactByPhone','phone','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser'];(function(_0x45e07b,_0x5d8f35){var _0x56fcb8=function(_0xd33266){while(--_0xd33266){_0x45e07b['push'](_0x45e07b['shift']());}};_0x56fcb8(++_0x5d8f35);}(_0xe0b2,0xec));var _0x2e0b=function(_0x455a3e,_0x210f64){_0x455a3e=_0x455a3e-0x0;var _0x5f39c2=_0xe0b2[_0x455a3e];return _0x5f39c2;};'use strict';var _=require('lodash');var moment=require(_0x2e0b('0x0'));var jayson=require(_0x2e0b('0x1'));var client=jayson[_0x2e0b('0x2')][_0x2e0b('0x3')]({'port':0x2329});function request(_0x406b1c,_0x187b65){return new Promise(function(_0x46deb8,_0x56b694){return client[_0x2e0b('0x4')](_0x406b1c,_0x187b65)[_0x2e0b('0x5')](function(_0x1426a8){if(_0x1426a8[_0x2e0b('0x6')]){return _0x56b694(_0x1426a8[_0x2e0b('0x6')][_0x2e0b('0x7')]);}else{return _0x46deb8(_0x1426a8['result']);}})[_0x2e0b('0x8')](function(_0x504ea6){return _0x56b694(_0x504ea6);});});}exports[_0x2e0b('0x9')]=function(){return request(_0x2e0b('0xa'),{'options':{'raw':![],'attributes':['id',_0x2e0b('0xb'),_0x2e0b('0xc')]}});};exports[_0x2e0b('0xd')]=function(_0x173f25){return request(_0x2e0b('0xe'),{'options':{'raw':![],'where':{'name':_0x173f25},'attributes':[_0x2e0b('0xc')]}});};exports[_0x2e0b('0xf')]=function(_0x4fc22f){return request(_0x2e0b('0x10'),{'options':{'raw':![],'where':{'id':_0x4fc22f},'include':[{'model':_0x2e0b('0x11'),'as':'Smtp','include':[{'model':'CloudProvider','as':_0x2e0b('0x12')}]}],'attributes':['id',_0x2e0b('0xb'),_0x2e0b('0x13')],'smtp':!![]}});};exports[_0x2e0b('0x14')]=function(_0x2a7d19){return request(_0x2e0b('0xe'),{'options':{'where':{'id':_0x2a7d19},'attributes':[_0x2e0b('0xb')]}});};exports[_0x2e0b('0x15')]=function(_0x188928){return request(_0x2e0b('0x16'),{'options':{'where':{'id':_0x188928},'attributes':[_0x2e0b('0xb')]}});};exports[_0x2e0b('0x17')]=function(_0x5d0d0c){return request('ShowVariable',{'options':{'where':{'id':_0x5d0d0c},'attributes':['name']}});};exports[_0x2e0b('0x18')]=function(_0x4bcc46){return request(_0x2e0b('0x19'),{'options':{'where':{'id':_0x4bcc46},'attributes':[_0x2e0b('0x1a')]}});};exports['getUserById']=function(_0x589079){return request('ShowUser',{'options':{'where':{'id':_0x589079},'attributes':[_0x2e0b('0xb')]}});};exports[_0x2e0b('0x1b')]=function(_0x1c86a6){return request(_0x2e0b('0x1c'),{'options':{'where':{'phone':_0x1c86a6[_0x2e0b('0x1d')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x2b2e7b){return request('ShowTrunk',{'options':{'where':{'id':_0x2b2e7b},'attributes':[_0x2e0b('0xb')]}});};exports[_0x2e0b('0x1e')]=function(_0x4b5b6d){return request(_0x2e0b('0x1f'),{'options':{'where':{'id':_0x4b5b6d},'attributes':[_0x2e0b('0x20')]}});};exports[_0x2e0b('0x21')]=function(_0x43341a){return request(_0x2e0b('0x22'),{'options':{'raw':![],'where':{'id':_0x43341a},'include':[{'model':'Interval','as':_0x2e0b('0x23')}]}});};exports['getSmsAccountById']=function(_0x49d111){return request(_0x2e0b('0x24'),{'options':{'where':{'id':_0x49d111},'attributes':['id',_0x2e0b('0xb')]}});};exports[_0x2e0b('0x25')]=function(_0x5688c6){return request(_0x2e0b('0x26'),{'body':_0x5688c6});};exports[_0x2e0b('0x27')]=function(_0x20b662){return request(_0x2e0b('0x28'),{'body':_0x20b662});};exports[_0x2e0b('0x29')]=function(_0x1a7857){return request(_0x2e0b('0x2a'),{'body':_[_0x2e0b('0x2b')](_0x1a7857,{'project_name':_0x1a7857['arg_1'],'prev_project_name':_0x1a7857['arg_2']||'','is_subproject':_0x1a7857['arg_2']?!![]:![],'leaveAt':moment()[_0x2e0b('0x2c')](_0x2e0b('0x2d'))})});};exports[_0x2e0b('0x2e')]=function(_0x452080){return request(_0x2e0b('0x2f'),{'body':_0x452080});};exports[_0x2e0b('0x30')]=function(_0x2d46bf){return request('CreateSquareMessage',{'body':_0x2d46bf});};exports[_0x2e0b('0x31')]=function(_0x12cca8){return request(_0x2e0b('0x32'),{'options':{'raw':![],'where':{'phone':_0x12cca8[_0x2e0b('0x1d')],'ListId':_0x12cca8['ListId']}}})[_0x2e0b('0x5')](function(_0x49e19e){if(_0x49e19e){return _0x49e19e;}return request('CreateCmContact',{'body':_0x12cca8});});};exports[_0x2e0b('0x33')]=function(_0x15d3ca){return request(_0x2e0b('0x34'),{'options':{'where':{'id':_0x15d3ca},'attributes':[_0x2e0b('0xb')]}});};exports['agentLogin']=function(_0x4b0216,_0x517509){return request(_0x2e0b('0x35'),{'body':{'interface':_0x517509},'options':{'where':_0x4b0216}});};exports[_0x2e0b('0x36')]=function(_0x2cbfbd,_0x20e62d,_0x3a72a6){return request(_0x2e0b('0x37'),{'body':{'type':_0x20e62d,'uniqueid':_0x3a72a6},'options':{'where':_0x2cbfbd}});};exports['agentUnpause']=function(_0x257572){return request(_0x2e0b('0x38'),{'body':{},'options':{'where':_0x257572}});};exports[_0x2e0b('0x39')]=function(_0x5c0e15){return request(_0x2e0b('0x3a'),{'body':{},'options':{'where':_0x5c0e15}});}; \ No newline at end of file +var _0xeddd=['email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','agentUnpause','UnpauseUser','agentLogout','lodash','moment','jayson/promise','client','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider'];(function(_0x228640,_0xf5556e){var _0x18fa2f=function(_0x2d48fa){while(--_0x2d48fa){_0x228640['push'](_0x228640['shift']());}};_0x18fa2f(++_0xf5556e);}(_0xeddd,0x69));var _0xdedd=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xeddd[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xdedd('0x0'));var moment=require(_0xdedd('0x1'));var jayson=require(_0xdedd('0x2'));var client=jayson[_0xdedd('0x3')]['http']({'port':0x2329});function request(_0x3a53b4,_0x591965){return new Promise(function(_0x10de65,_0xd2ff49){return client['request'](_0x3a53b4,_0x591965)[_0xdedd('0x4')](function(_0x13563b){if(_0x13563b[_0xdedd('0x5')]){return _0xd2ff49(_0x13563b[_0xdedd('0x5')][_0xdedd('0x6')]);}else{return _0x10de65(_0x13563b[_0xdedd('0x7')]);}})[_0xdedd('0x8')](function(_0x260839){return _0xd2ff49(_0x260839);});});}exports[_0xdedd('0x9')]=function(){return request(_0xdedd('0xa'),{'options':{'raw':![],'attributes':['id',_0xdedd('0xb'),_0xdedd('0xc')]}});};exports['getSquareProject']=function(_0x3ef3d3){return request(_0xdedd('0xd'),{'options':{'raw':![],'where':{'name':_0x3ef3d3},'attributes':[_0xdedd('0xc')]}});};exports[_0xdedd('0xe')]=function(_0x5db016){return request(_0xdedd('0xf'),{'options':{'raw':![],'where':{'id':_0x5db016},'include':[{'model':_0xdedd('0x10'),'as':_0xdedd('0x11'),'include':[{'model':_0xdedd('0x12'),'as':_0xdedd('0x12')}]}],'attributes':['id',_0xdedd('0xb'),_0xdedd('0x13')],'smtp':!![]}});};exports[_0xdedd('0x14')]=function(_0x3680f4){return request(_0xdedd('0xd'),{'options':{'where':{'id':_0x3680f4},'attributes':[_0xdedd('0xb')]}});};exports[_0xdedd('0x15')]=function(_0x3b098a){return request(_0xdedd('0x16'),{'options':{'where':{'id':_0x3b098a},'attributes':[_0xdedd('0xb')]}});};exports[_0xdedd('0x17')]=function(_0x2de906){return request(_0xdedd('0x18'),{'options':{'where':{'id':_0x2de906},'attributes':[_0xdedd('0xb')]}});};exports['getSquareOdbcById']=function(_0x3cf7b6){return request(_0xdedd('0x19'),{'options':{'where':{'id':_0x3cf7b6},'attributes':['dsn']}});};exports[_0xdedd('0x1a')]=function(_0x114694){return request(_0xdedd('0x1b'),{'options':{'where':{'id':_0x114694},'attributes':['name']}});};exports[_0xdedd('0x1c')]=function(_0x24e331){return request(_0xdedd('0x1d'),{'options':{'where':{'phone':_0x24e331[_0xdedd('0x1e')]},'attributes':['id']}});};exports[_0xdedd('0x1f')]=function(_0x530faf){return request(_0xdedd('0x20'),{'options':{'where':{'id':_0x530faf},'attributes':[_0xdedd('0xb')]}});};exports[_0xdedd('0x21')]=function(_0x143c5f){return request(_0xdedd('0x22'),{'options':{'where':{'id':_0x143c5f},'attributes':[_0xdedd('0x23')]}});};exports[_0xdedd('0x24')]=function(_0x187487){return request(_0xdedd('0x25'),{'options':{'raw':![],'where':{'id':_0x187487},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x53b2b2){return request(_0xdedd('0x26'),{'options':{'where':{'id':_0x53b2b2},'attributes':['id',_0xdedd('0xb')]}});};exports[_0xdedd('0x27')]=function(_0x31b14f){return request(_0xdedd('0x28'),{'body':_0x31b14f});};exports['createSquareDetailsReport']=function(_0xce1515){return request(_0xdedd('0x29'),{'body':_0xce1515});};exports[_0xdedd('0x2a')]=function(_0x242b39){return request('CreateSquareReport',{'body':_[_0xdedd('0x2b')](_0x242b39,{'project_name':_0x242b39[_0xdedd('0x2c')],'prev_project_name':_0x242b39[_0xdedd('0x2d')]||'','is_subproject':_0x242b39[_0xdedd('0x2d')]?!![]:![],'leaveAt':moment()[_0xdedd('0x2e')](_0xdedd('0x2f'))})});};exports[_0xdedd('0x30')]=function(_0x29efe0){return request(_0xdedd('0x31'),{'body':_0x29efe0});};exports[_0xdedd('0x32')]=function(_0x269ded){return request(_0xdedd('0x33'),{'body':_0x269ded});};exports[_0xdedd('0x34')]=function(_0xa9b7ea){return request(_0xdedd('0x35'),{'options':{'raw':![],'where':{'phone':_0xa9b7ea['phone'],'ListId':_0xa9b7ea['ListId']}}})['then'](function(_0x235195){if(_0x235195){return _0x235195;}return request(_0xdedd('0x36'),{'body':_0xa9b7ea});});};exports[_0xdedd('0x37')]=function(_0x2b3094){return request(_0xdedd('0x38'),{'options':{'where':{'id':_0x2b3094},'attributes':[_0xdedd('0xb')]}});};exports[_0xdedd('0x39')]=function(_0x1419b5,_0x2ddda6){return request('LoginUser',{'body':{'interface':_0x2ddda6},'options':{'where':_0x1419b5}});};exports[_0xdedd('0x3a')]=function(_0x420ae2,_0x55a70c,_0x58a524){return request('PauseUser',{'body':{'type':_0x55a70c,'uniqueid':_0x58a524},'options':{'where':_0x420ae2}});};exports[_0xdedd('0x3b')]=function(_0x460f56){return request(_0xdedd('0x3c'),{'body':{},'options':{'where':_0x460f56}});};exports[_0xdedd('0x3d')]=function(_0x40ad67){return request('LogoutUser',{'body':{},'options':{'where':_0x40ad67}});}; \ 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 253544c..ae2beb5 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 _0xe2bc=['./polly','exports'];(function(_0x399e3b,_0x5dd3d2){var _0x28c6a4=function(_0x7d77c1){while(--_0x7d77c1){_0x399e3b['push'](_0x399e3b['shift']());}};_0x28c6a4(++_0x5dd3d2);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xe2bc[_0x344a3f];return _0x264712;};var polly=require(_0xce2b('0x0'));var lex=require('./lex');module[_0xce2b('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xbfe8=['./lex'];(function(_0x3abf16,_0x49fa8f){var _0x18f011=function(_0x59f270){while(--_0x59f270){_0x3abf16['push'](_0x3abf16['shift']());}};_0x18f011(++_0x49fa8f);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x520fd6,_0x424096){_0x520fd6=_0x520fd6-0x0;var _0x57f3a3=_0xbfe8[_0x520fd6];return _0x57f3a3;};var polly=require('./polly');var lex=require(_0x8bfe('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index b99a559..5d9137c 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 _0xb7e7=['./lib/api'];(function(_0x1b2df8,_0x45c564){var _0x5e3d64=function(_0x20f52c){while(--_0x20f52c){_0x1b2df8['push'](_0x1b2df8['shift']());}};_0x5e3d64(++_0x45c564);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb7e7[_0x3305de];return _0x3b5a84;};'use strict';var lex=require(_0x7b7e('0x0'));module['exports']=function(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){return lex(_0x40e269,_0x518dc6,_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x1c27bb,_0x4a4906,_0x3f643d,_0x306b6e,_0x2221f1,_0x10d2c4){return lex(_0x1c27bb,_0x4a4906,_0x3f643d,_0x306b6e,_0x2221f1,_0x10d2c4);}; \ 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 8d09db8..2a4e3ad 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(_0x545d4c,_0x58c9a6){var _0x2e96bd=function(_0x4a55ae){while(--_0x4a55ae){_0x545d4c['push'](_0x545d4c['shift']());}};_0x2e96bd(++_0x58c9a6);}(_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 +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x224ed8,_0x2c435e){var _0x1ff382=function(_0xb5535a){while(--_0xb5535a){_0x224ed8['push'](_0x224ed8['shift']());}};_0x1ff382(++_0x2c435e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 04eec4d..d6b6abd 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 _0xb51e=['./lib/api','exports'];(function(_0x3925ff,_0x3fe6e5){var _0x1f16d5=function(_0xc538a2){while(--_0xc538a2){_0x3925ff['push'](_0x3925ff['shift']());}};_0x1f16d5(++_0x3fe6e5);}(_0xb51e,0xcc));var _0xeb51=function(_0x3ebda5,_0x501f6e){_0x3ebda5=_0x3ebda5-0x0;var _0x178d00=_0xb51e[_0x3ebda5];return _0x178d00;};'use strict';var polly=require(_0xeb51('0x0'));module[_0xeb51('0x1')]=function(_0x431b7e,_0x189c48,_0x229fac,_0x5db572,_0x5bd9d8,_0x5b87db,_0x15a311){return polly(_0x431b7e,_0x189c48,_0x229fac,_0x5db572,_0x5bd9d8,_0x5b87db,_0x15a311);}; \ No newline at end of file +var _0x617f=['exports'];(function(_0x4f2afe,_0x26a2e6){var _0x2ca7fa=function(_0x5b5a2f){while(--_0x5b5a2f){_0x4f2afe['push'](_0x4f2afe['shift']());}};_0x2ca7fa(++_0x26a2e6);}(_0x617f,0x19c));var _0xf617=function(_0x386a70,_0x53478b){_0x386a70=_0x386a70-0x0;var _0xe9b1dc=_0x617f[_0x386a70];return _0xe9b1dc;};'use strict';var polly=require('./lib/api');module[_0xf617('0x0')]=function(_0x4af7eb,_0x49afa0,_0xbaf5e3,_0x31be13,_0x89a478,_0x454d46,_0x2675f7){return polly(_0x4af7eb,_0x49afa0,_0xbaf5e3,_0x31be13,_0x89a478,_0x454d46,_0x2675f7);}; \ 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 fdf0483..d37c36c 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 _0x2785=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x22416a,_0x530751){var _0x431ade=function(_0x380ac0){while(--_0x380ac0){_0x22416a['push'](_0x22416a['shift']());}};_0x431ade(++_0x530751);}(_0x2785,0x157));var _0x5278=function(_0x175da3,_0x2c89f2){_0x175da3=_0x175da3-0x0;var _0x45afc8=_0x2785[_0x175da3];return _0x45afc8;};'use strict';var fs=require('fs');var path=require(_0x5278('0x0'));var BPromise=require(_0x5278('0x1'));var rs=require(_0x5278('0x2'));var AWS=require(_0x5278('0x3'));function pollyResult(_0x2d6973,_0x9219cb,_0x29d83c){return new BPromise(function(_0x1234e9,_0x2fc084){_0x2d6973[_0x5278('0x4')](_0x9219cb,function(_0x281c7f,_0x8ce61e){if(_0x281c7f){_0x2fc084(_0x281c7f);}else if(_0x8ce61e){if(_0x8ce61e[_0x5278('0x5')]instanceof Buffer){fs[_0x5278('0x6')](_0x29d83c,_0x8ce61e[_0x5278('0x5')],function(_0x5a5815){if(_0x5a5815){_0x2fc084(_0x5a5815);}else{_0x1234e9();}});}else{_0x2fc084(new Error(_0x5278('0x7')));}}else{_0x2fc084(new Error(_0x5278('0x8')));}});});}module['exports']=function(_0x34c855,_0x35e06b,_0x42d85a,_0x1de686,_0x173322,_0x45fc4e,_0xae3cc2){var _0x5b1963=new AWS[(_0x5278('0x9'))]({'accessKeyId':_0x34c855,'secretAccessKey':_0x35e06b,'region':_0x42d85a});var _0x1ca019={'Text':_0x173322,'TextType':_0x45fc4e||_0x5278('0xa'),'OutputFormat':_0x5278('0xb'),'VoiceId':_0x1de686};return pollyResult(_0x5b1963,_0x1ca019,_0xae3cc2);}; \ No newline at end of file +var _0xedd5=['mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0xedd5,0x1a3));var _0x5edd=function(_0x435f2d,_0x1843f9){_0x435f2d=_0x435f2d-0x0;var _0x5992a7=_0xedd5[_0x435f2d];return _0x5992a7;};'use strict';var fs=require('fs');var path=require(_0x5edd('0x0'));var BPromise=require('bluebird');var rs=require(_0x5edd('0x1'));var AWS=require(_0x5edd('0x2'));function pollyResult(_0x1cec74,_0x50e39a,_0x1119b8){return new BPromise(function(_0x1909b7,_0x133c88){_0x1cec74[_0x5edd('0x3')](_0x50e39a,function(_0x576172,_0x5c868b){if(_0x576172){_0x133c88(_0x576172);}else if(_0x5c868b){if(_0x5c868b[_0x5edd('0x4')]instanceof Buffer){fs[_0x5edd('0x5')](_0x1119b8,_0x5c868b[_0x5edd('0x4')],function(_0x549e2a){if(_0x549e2a){_0x133c88(_0x549e2a);}else{_0x1909b7();}});}else{_0x133c88(new Error(_0x5edd('0x6')));}}else{_0x133c88(new Error(_0x5edd('0x7')));}});});}module[_0x5edd('0x8')]=function(_0x24c159,_0x1318be,_0x4a0ac3,_0x39423b,_0x591992,_0x431487,_0x590a53){var _0x33b5ca=new AWS[(_0x5edd('0x9'))]({'accessKeyId':_0x24c159,'secretAccessKey':_0x1318be,'region':_0x4a0ac3});var _0x59d192={'Text':_0x591992,'TextType':_0x431487||'text','OutputFormat':_0x5edd('0xa'),'VoiceId':_0x39423b};return pollyResult(_0x33b5ca,_0x59d192,_0x590a53);}; \ 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 2ff27c8..a1da19e 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 _0xdfaf=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfaf,0x82));var _0xfdfa=function(_0x7f14c1,_0x41adf1){_0x7f14c1=_0x7f14c1-0x0;var _0xc7e0d5=_0xdfaf[_0x7f14c1];return _0xc7e0d5;};'use strict';var asr=require(_0xfdfa('0x0'));module[_0xfdfa('0x1')]=function(_0x3a0594,_0x3b5f7a,_0x70389a,_0x56224a){return asr(_0x3a0594,_0x3b5f7a,_0x70389a);}; \ No newline at end of file +var _0xcd90=['exports'];(function(_0x47d8b9,_0x3f2a35){var _0x5d9b55=function(_0x29abd3){while(--_0x29abd3){_0x47d8b9['push'](_0x47d8b9['shift']());}};_0x5d9b55(++_0x3f2a35);}(_0xcd90,0x1de));var _0x0cd9=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xcd90[_0x36eaaa];return _0x461349;};'use strict';var asr=require('./lib/api');module[_0x0cd9('0x0')]=function(_0x261e7d,_0x3cacfc,_0x3cd300,_0x2d2684){return asr(_0x261e7d,_0x3cacfc,_0x3cd300);}; \ 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 ceda897..12c6823 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 _0x222f=['url','bluebird','https://speech.googleapis.com','exports','length','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000'];(function(_0x20dbcf,_0x3c761b){var _0x5dc5b5=function(_0x41002a){while(--_0x41002a){_0x20dbcf['push'](_0x20dbcf['shift']());}};_0x5dc5b5(++_0x3c761b);}(_0x222f,0x1a4));var _0xf222=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x222f[_0x3de8a4];return _0x4635cf;};'use strict';var url=require(_0xf222('0x0'));var BPromise=require(_0xf222('0x1'));var fs=require('fs');var host=_0xf222('0x2');module[_0xf222('0x3')]=function(_0x4d09ec,_0x4b4237,_0x195de1){return new BPromise(function(_0x233e95,_0x307791){var _0x7b187d;if(typeof _0x4d09ec!=='string'||_0x4d09ec[_0xf222('0x4')]===0x0){return _0x307791('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x4b4237!==_0xf222('0x5')||_0x4b4237[_0xf222('0x4')]===0x0){return _0x307791('key\x20should\x20be\x20a\x20string');}if(typeof _0x195de1!==_0xf222('0x6')&&(typeof _0x195de1!==_0xf222('0x5')||_0x195de1['length']===0x0)){return _0x307791(_0xf222('0x7'));}try{_0x7b187d=fs[_0xf222('0x8')](_0x4d09ec)[_0xf222('0x9')](_0xf222('0xa'));}catch(_0x46ccfe){return _0x307791(_0x46ccfe);}return _0x233e95({'method':_0xf222('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x4b4237,'body':{'config':{'encoding':_0xf222('0xc'),'sampleRateHertz':_0xf222('0xd'),'languageCode':_0x195de1},'audio':{'content':_0x7b187d}},'json':!![]});});}; \ No newline at end of file +var _0xb6b1=['LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xb6b1[_0x199c03];return _0x11a7d4;};'use strict';var url=require(_0x1b6b('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x1b6b('0x1');module['exports']=function(_0xede124,_0x29651a,_0x59b931){return new BPromise(function(_0x3f12e2,_0x5100e5){var _0x2a2c45;if(typeof _0xede124!==_0x1b6b('0x2')||_0xede124[_0x1b6b('0x3')]===0x0){return _0x5100e5(_0x1b6b('0x4'));}if(typeof _0x29651a!=='string'||_0x29651a[_0x1b6b('0x3')]===0x0){return _0x5100e5('key\x20should\x20be\x20a\x20string');}if(typeof _0x59b931!==_0x1b6b('0x5')&&(typeof _0x59b931!=='string'||_0x59b931[_0x1b6b('0x3')]===0x0)){return _0x5100e5(_0x1b6b('0x6'));}try{_0x2a2c45=fs[_0x1b6b('0x7')](_0xede124)[_0x1b6b('0x8')]('base64');}catch(_0x4c750a){return _0x5100e5(_0x4c750a);}return _0x3f12e2({'method':_0x1b6b('0x9'),'uri':host+_0x1b6b('0xa')+_0x29651a,'body':{'config':{'encoding':_0x1b6b('0xb'),'sampleRateHertz':_0x1b6b('0xc'),'languageCode':_0x59b931},'audio':{'content':_0x2a2c45}},'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 8268dec..a8a1b6d 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 _0x1113=['./asr'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0x1113,0x1dc));var _0x3111=function(_0x26bd8e,_0x2a9fdf){_0x26bd8e=_0x26bd8e-0x0;var _0x3a659d=_0x1113[_0x26bd8e];return _0x3a659d;};var asr=require(_0x3111('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x8e92=['exports','./asr'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x8e92,0x11b));var _0x28e9=function(_0x3cd088,_0x5ef0b3){_0x3cd088=_0x3cd088-0x0;var _0x4aacfc=_0x8e92[_0x3cd088];return _0x4aacfc;};var asr=require(_0x28e9('0x0'));module[_0x28e9('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 5f3d0b1..92ac195 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 _0xfe9a=['text:synthesize','POST','audioContent','writeFile','googleTTS','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','.mp3','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','actionIncomplete','fulfillment','speech','score','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','finish\x20download\x20file','close','error','download\x20error','path','WHAT_EVER','data','end','transcode','wav','error\x20convert','info','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3'];(function(_0x24e66c,_0x51a451){var _0x5ac1b6=function(_0x467246){while(--_0x467246){_0x24e66c['push'](_0x24e66c['shift']());}};_0x5ac1b6(++_0x51a451);}(_0xfe9a,0xe3));var _0xafe9=function(_0x41da89,_0x297b3d){_0x41da89=_0x41da89-0x0;var _0x50c82c=_0xfe9a[_0x41da89];return _0x50c82c;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xafe9('0x0'));var dialogflow=require(_0xafe9('0x1'));var fs=require('fs');var http=require(_0xafe9('0x2'));var https=require(_0xafe9('0x3'));var md5=require(_0xafe9('0x4'));var path=require('path');var querystring=require(_0xafe9('0x5'));var rp=require(_0xafe9('0x6'));var rs=require(_0xafe9('0x7'));var sox=require(_0xafe9('0x8'));var tts=require(_0xafe9('0x9'));var urlParse=require(_0xafe9('0xa'))[_0xafe9('0xb')];var util=require(_0xafe9('0xc'));var aws=require(_0xafe9('0xd'));var google=require(_0xafe9('0xe'));var sestek=require(_0xafe9('0xf'));var tilde=require(_0xafe9('0x10'));var logger=require(_0xafe9('0x11'))(_0xafe9('0x12'));var ISPEECH_API=_0xafe9('0x13');function downloadFile(_0x5b97c2,_0x5c703d){return new BPromise(function(_0x9022e1,_0x41b997){var _0x57e47e=urlParse(_0x5b97c2);var _0x53746e=_0x57e47e['protocol']===_0xafe9('0x14')?https:http;var _0x1ba5eb={'host':_0x57e47e[_0xafe9('0x15')],'path':_0x57e47e['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x53746e['get'](_0x1ba5eb,function(_0x3f52d8){if(_0x3f52d8[_0xafe9('0x16')]!==0xc8){logger['error'](_0xafe9('0x17')+_0x5b97c2+'\x20failed,\x20status\x20code\x20=\x20'+_0x3f52d8['statusCode']+'\x20('+_0x3f52d8[_0xafe9('0x18')]+')');_0x41b997(new Error(_0xafe9('0x17')+_0x5b97c2+_0xafe9('0x19')+_0x3f52d8[_0xafe9('0x16')]+'\x20('+_0x3f52d8[_0xafe9('0x18')]+')'));return;}var _0x32866c=fs['createWriteStream'](_0x5c703d);_0x32866c['on'](_0xafe9('0x1a'),function(){logger['info'](_0xafe9('0x1b'));_0x32866c[_0xafe9('0x1c')](_0x9022e1);});_0x32866c['on'](_0xafe9('0x1d'),function(_0x340f7b){fs['unlink'](_0x5c703d);logger[_0xafe9('0x1d')](_0xafe9('0x1e'),_0x340f7b);_0x41b997(_0x340f7b);});_0x3f52d8['pipe'](_0x32866c);})['on'](_0xafe9('0x1d'),function(_0x1c9c47){logger['error'](_0x1c9c47);_0x41b997(_0x1c9c47);})['end']();});}function uploadFile(_0x4c99ba){return new BPromise(function(_0x3e951d,_0x24af67){var _0x12c29b=urlParse(_0x4c99ba);var _0x129530=_0x12c29b['protocol']===_0xafe9('0x14')?https:http;var _0x153067={'host':_0x12c29b[_0xafe9('0x15')],'path':_0x12c29b[_0xafe9('0x1f')],'headers':{'user-agent':_0xafe9('0x20')}};_0x129530['get'](_0x153067,function(_0x157a26){if(_0x157a26[_0xafe9('0x16')]!==0xc8){_0x24af67(new Error(_0xafe9('0x17')+_0x4c99ba+_0xafe9('0x19')+_0x157a26[_0xafe9('0x16')]+'\x20('+_0x157a26[_0xafe9('0x18')]+')'));return;}var _0x34c3dc='';_0x157a26['on'](_0xafe9('0x21'),function(_0x4c2776){_0x34c3dc+=_0x4c2776;});_0x157a26['on']('end',function(){_0x3e951d(_0x34c3dc);});})['on'](_0xafe9('0x1d'),function(_0x397a6e){_0x24af67(_0x397a6e);})[_0xafe9('0x22')]();});}function convertFile(_0x27c501,_0x3477c9){return new BPromise(function(_0x563272,_0x1b730e){var _0x885928=sox[_0xafe9('0x23')](_0x27c501,_0x3477c9,{'sampleRate':0x1f40,'format':_0xafe9('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x885928['on']('error',function(_0x402121){logger[_0xafe9('0x1d')](_0xafe9('0x25'),_0x402121);_0x1b730e(_0x402121);});_0x885928['on'](_0xafe9('0x22'),function(){logger[_0xafe9('0x26')]('finish\x20to\x20convert');_0x563272();});_0x885928[_0xafe9('0x27')]();});}function base64Decode(_0x39cadc,_0x4b8410){var _0xb98ceb=path[_0xafe9('0x28')](__dirname,_0xafe9('0x29'),rs[_0xafe9('0x2a')](0x4)+_0xafe9('0x2b'));fs[_0xafe9('0x2c')](_0xb98ceb,_0x39cadc,_0xafe9('0x2d'));return convertFile(_0xb98ceb,_0x4b8410)[_0xafe9('0x2e')](function(){try{fs[_0xafe9('0x2f')](_0xb98ceb);fs[_0xafe9('0x30')](_0x4b8410,_0xafe9('0x31'));}catch(_0x2d0bc0){logger['error'](_0x2d0bc0);}return _0x4b8410[_0xafe9('0x32')]('.')[0x0];});}function base64Encode(_0x327c47){var _0x4889ef=fs[_0xafe9('0x33')](_0x327c47);return new Buffer(_0x4889ef)[_0xafe9('0x34')]('base64');}exports[_0xafe9('0x35')]=function(_0x1babd0,_0x4a373d,_0x1cb78f,_0x3f5d9d,_0x838549,_0x34031d){var _0x1d9e1b,_0xf0a48e;var _0xac04d6=_0xafe9('0x36');var _0x3d61ab=_0xafe9('0x37')+_0x1babd0;var _0x5d23f2={};if(_0x4a373d===_0xafe9('0x38')){_0x5d23f2[_0xafe9('0x39')]={'ssml':_0x1cb78f};}else{_0x5d23f2[_0xafe9('0x39')]={'text':_0x1cb78f};};_0x5d23f2[_0xafe9('0x3a')]={'languageCode':_0x3f5d9d,'ssmlGender':_0x838549};_0x5d23f2[_0xafe9('0x3b')]={'audioEncoding':_0xafe9('0x3c'),'sampleRateHertz':0x1f40};var _0x8ca2d0={'url':_0xac04d6+_0xafe9('0x3d')+_0x3d61ab,'method':_0xafe9('0x3e'),'json':!![],'body':_0x5d23f2};return rp(_0x8ca2d0)[_0xafe9('0x2e')](function(_0x4f70e2){return new BPromise(function(_0x8c16b8,_0x1fa7ef){_0x1d9e1b=path[_0xafe9('0x28')](__dirname,_0xafe9('0x29'),rs['generate'](0x4)+'.mp3');var _0x4cd9d4=Buffer['from'](_0x4f70e2[_0xafe9('0x3f')],_0xafe9('0x2d'));return fs[_0xafe9('0x40')](_0x1d9e1b,_0x4cd9d4,function(_0x5a4184){_0x1fa7ef(_0x5a4184);},function(_0x44669c){fs[_0xafe9('0x30')](_0x1d9e1b,_0xafe9('0x31'));_0x8c16b8(_0x44669c);});});})['then'](function(_0x2426fe){_0xf0a48e=path['resolve'](__dirname,_0xafe9('0x29'),rs[_0xafe9('0x2a')](0x4)+_0xafe9('0x2b'));return convertFile(_0x1d9e1b,_0xf0a48e);})['then'](function(){try{fs[_0xafe9('0x2f')](_0x1d9e1b);fs['chmodSync'](_0xf0a48e,_0xafe9('0x31'));}catch(_0x47a6c2){logger['error'](_0x47a6c2);}logger[_0xafe9('0x26')]('googleCloudTTS\x20path',_0xf0a48e['split']('.')[0x0]);return _0xf0a48e[_0xafe9('0x32')]('.')[0x0];});};exports[_0xafe9('0x41')]=function(_0x2e37bd,_0x38cae0){var _0x26a1dc='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x36f09c,_0xad95c9;var _0x238364;var _0x5a2217={'encoding':_0xafe9('0x42'),'method':_0xafe9('0x3e'),'timeout':0x2710,'url':_0x26a1dc,'headers':{'Content-Type':_0xafe9('0x43')},'body':'f.req='+encodeURIComponent(JSON[_0xafe9('0x44')]([[[_0xafe9('0x45'),JSON[_0xafe9('0x44')]([_0x2e37bd,_0x38cae0||'en',![],_0xafe9('0x46')]),null,_0xafe9('0x47')]]]))};return rp(_0x5a2217)[_0xafe9('0x2e')](function(_0x49b583){try{_0x238364=eval(_0x49b583['slice'](0x5))[0x0][0x2];}catch(_0x371682){throw new Error(_0xafe9('0x48')+_0x49b583[_0xafe9('0x21')]);}if(!_0x238364){if(_0x2e37bd[_0xafe9('0x49')]>0xc8){throw new Error(_0xafe9('0x4a'));}else{throw new Error(_0xafe9('0x4b')+_0x38cae0+'\x22\x20might\x20not\x20exist');}}try{_0x238364=eval(_0x238364)[0x0];}catch(_0x39d27d){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xafe9('0x21')]);}const _0x283db5=_0x238364;_0x36f09c=path[_0xafe9('0x28')](__dirname,_0xafe9('0x29'),rs['generate'](0x4)+_0xafe9('0x4c'));fs['writeFileSync'](_0x36f09c,_0x238364,{'encoding':_0xafe9('0x2d')});_0xad95c9=path[_0xafe9('0x28')](__dirname,_0xafe9('0x29'),rs[_0xafe9('0x2a')](0x4)+_0xafe9('0x2b'));return convertFile(_0x36f09c,_0xad95c9);})[_0xafe9('0x2e')](function(){try{fs['unlink'](_0x36f09c);fs[_0xafe9('0x30')](_0xad95c9,_0xafe9('0x31'));}catch(_0x56dd6a){logger['error'](_0x56dd6a);}logger['info'](_0xafe9('0x4d'),_0xad95c9[_0xafe9('0x32')]('.')[0x0]);return _0xad95c9[_0xafe9('0x32')]('.')[0x0];});};exports[_0xafe9('0x4e')]=function(_0x4718f7,_0xa5c525,_0x401ca8){return google[_0xafe9('0x4f')](_0x4718f7,_0xa5c525,_0x401ca8)[_0xafe9('0x2e')](function(_0xaaf74e){logger[_0xafe9('0x26')](_0xaaf74e['uri']);return rp(_0xaaf74e);})[_0xafe9('0x2e')](function(_0x502e30){var _0x529e19='';var _0x7ac9e9=0x0;try{fs[_0xafe9('0x2f')](_0x4718f7);}catch(_0x3e5a12){logger[_0xafe9('0x1d')](_0x3e5a12);}if(_0x502e30&&_0x502e30[_0xafe9('0x50')]){_0x529e19=_0x502e30[_0xafe9('0x50')][_0xafe9('0x51')](function(_0x29e3bd){return _0x29e3bd&&_0x29e3bd[_0xafe9('0x52')][0x0]&&_0x29e3bd[_0xafe9('0x52')][0x0][_0xafe9('0x53')]?_0x29e3bd[_0xafe9('0x52')][0x0][_0xafe9('0x53')]:'';})['join']('\x0a');_0x7ac9e9=_0x502e30[_0xafe9('0x50')][_0xafe9('0x51')](function(_0x39a6e8){return _0x39a6e8&&_0x39a6e8[_0xafe9('0x52')][0x0]&&_0x39a6e8[_0xafe9('0x52')][0x0][_0xafe9('0x54')]?_0x39a6e8['alternatives'][0x0][_0xafe9('0x54')]:0x0;})[_0xafe9('0x55')]('\x0a');}logger[_0xafe9('0x26')](_0xafe9('0x56'),_0x529e19);logger[_0xafe9('0x26')](_0xafe9('0x57'),_0x7ac9e9);return{'transcript':_0x529e19,'confidence':_0x7ac9e9};})[_0xafe9('0x58')](function(_0x5b8b97){logger[_0xafe9('0x1d')](_0xafe9('0x59'),_0x5b8b97['statusCode'],_0x5b8b97[_0xafe9('0x5a')],_0x5b8b97[_0xafe9('0x5b')]);});};exports[_0xafe9('0x5c')]=function(_0x16d404,_0x4f6e2c,_0x4d67f9,_0x56246c){var _0x1f63a6=apiai(_0x4f6e2c,{'language':_0x56246c||'en'});return _0x1f63a6[_0xafe9('0x5d')](_0x4d67f9,{'sessionId':md5(_0x16d404)})[_0xafe9('0x2e')](function(_0x40b744){logger[_0xafe9('0x26')](JSON[_0xafe9('0x44')](_0x40b744));return{'source':_0x40b744['result']['source'],'resolvedQuery':_0x40b744[_0xafe9('0x5e')][_0xafe9('0x5f')],'action':_0x40b744[_0xafe9('0x5e')]['action'],'actionIncomplete':_0x40b744[_0xafe9('0x5e')][_0xafe9('0x60')],'speech':_0x40b744[_0xafe9('0x5e')][_0xafe9('0x61')][_0xafe9('0x62')],'score':_0x40b744[_0xafe9('0x5e')][_0xafe9('0x63')],'statusCode':_0x40b744['status'][_0xafe9('0x64')],'endConversation':_0x40b744[_0xafe9('0x5e')]['metadata'][_0xafe9('0x65')]||![],'isFallbackIntent':_0x40b744[_0xafe9('0x5e')][_0xafe9('0x66')][_0xafe9('0x67')]};});};exports[_0xafe9('0x68')]=function(_0x5c0f35,_0x4a33a1,_0x87aae,_0x32d819,_0x5068a0,_0x1b247f){var _0xc5e61=_0x32d819[_0xafe9('0x69')](/\\n/g,'\x0a');var _0xbbff3={'credentials':{'private_key':_0xc5e61,'client_email':_0x87aae}};var _0x5b8f4d=new dialogflow[(_0xafe9('0x6a'))](_0xbbff3);var _0x1c63dd=_0x5b8f4d[_0xafe9('0x6b')](_0x4a33a1,md5(_0x5c0f35));var _0x8d2f6a={'session':_0x1c63dd,'queryInput':{'text':{'text':_0x5068a0,'languageCode':_0x1b247f}}};return _0x5b8f4d[_0xafe9('0x6c')](_0x8d2f6a)[_0xafe9('0x2e')](function(_0x169479){if(_0x169479&&_0x169479[_0xafe9('0x49')]){logger[_0xafe9('0x26')](_0xafe9('0x6d'),JSON[_0xafe9('0x44')](_0x169479));var _0x351778=_0x169479[0x0];if(_0x351778){var _0x107c0e={'action':_0x351778[_0xafe9('0x6e')]['action'],'allRequiredParamsPresent':_0x351778['queryResult'][_0xafe9('0x6f')],'endConversation':_0x351778[_0xafe9('0x6e')][_0xafe9('0x70')]&&_0x351778[_0xafe9('0x6e')][_0xafe9('0x70')][_0xafe9('0x71')]?_0x351778['queryResult'][_0xafe9('0x70')][_0xafe9('0x71')][_0xafe9('0x72')][_0xafe9('0x73')]:![],'fulfillmentText':_0x351778[_0xafe9('0x6e')][_0xafe9('0x74')],'intentName':_0x351778[_0xafe9('0x6e')][_0xafe9('0x75')]['name'],'intentDisplayName':_0x351778['queryResult'][_0xafe9('0x75')][_0xafe9('0x76')],'isFallbackIntent':_0x351778['queryResult'][_0xafe9('0x75')][_0xafe9('0x77')],'languageCode':_0x351778[_0xafe9('0x6e')][_0xafe9('0x78')],'queryText':_0x351778['queryResult'][_0xafe9('0x79')],'responseId':_0x351778['responseId'],'score':_0x351778['queryResult'][_0xafe9('0x7a')],'speech':_0x351778[_0xafe9('0x6e')]['fulfillmentText'],'providerResponse':JSON[_0xafe9('0x44')](_0x169479)};return _0x107c0e;}}});};exports[_0xafe9('0x7b')]=function(_0x457e10,_0x487b40,_0x3ea5be,_0x14fdf0){return tilde[_0xafe9('0x4f')](_0x457e10,_0x487b40,_0x3ea5be,_0x14fdf0)['then'](function(_0x43bd2a){try{fs[_0xafe9('0x2f')](_0x457e10);}catch(_0x1ac8d9){logger[_0xafe9('0x1d')](_0x1ac8d9);}logger[_0xafe9('0x26')](_0xafe9('0x7c'),_0x43bd2a[_0xafe9('0x53')]);logger[_0xafe9('0x26')](_0xafe9('0x7d'),_0x43bd2a[_0xafe9('0x54')]);return _0x43bd2a;});};exports[_0xafe9('0x7e')]=function(_0x2f639b,_0x71641d,_0x514414,_0x14d880,_0x1c6ec2,_0x2df236){var _0x34021f=path['resolve'](__dirname,'tmp',rs[_0xafe9('0x2a')](0x4)+'.mp3');var _0x395443;return aws[_0xafe9('0x7f')](_0x2f639b,_0x71641d,_0x514414,_0x14d880,_0x1c6ec2,_0x2df236,_0x34021f)[_0xafe9('0x2e')](function(){_0x395443=path[_0xafe9('0x28')](__dirname,'tmp',rs[_0xafe9('0x2a')](0x4)+_0xafe9('0x2b'));return convertFile(_0x34021f,_0x395443);})['then'](function(){try{fs[_0xafe9('0x2f')](_0x34021f);fs['chmodSync'](_0x395443,_0xafe9('0x31'));}catch(_0x5bcba4){logger[_0xafe9('0x1d')](_0x5bcba4);}return _0x395443[_0xafe9('0x32')]('.')[0x0];});};exports[_0xafe9('0x80')]=function(_0x4a1639,_0x2c810e,_0x8a8195,_0x2fac57,_0xd71b35,_0x4ce520){return aws[_0xafe9('0x81')](_0x4a1639,_0x2c810e,_0x8a8195,_0x2fac57,_0xd71b35,_0x4ce520)[_0xafe9('0x2e')](function(_0x36bfc0){logger[_0xafe9('0x26')](JSON[_0xafe9('0x44')](_0x36bfc0));return _0x36bfc0;});};exports[_0xafe9('0x82')]=function(_0x4bd917,_0x84a9a5,_0x536bdb,_0x3c93c2){var _0x16d90c=util[_0xafe9('0x83')](_0xafe9('0x84'),ISPEECH_API,_0x4bd917,encodeURIComponent(_0x84a9a5),_0x536bdb,_0x3c93c2);var _0x5079f5=path[_0xafe9('0x28')](__dirname,_0xafe9('0x29'),rs['generate'](0x4)+_0xafe9('0x4c'));var _0x4a45c7;return downloadFile(_0x16d90c,_0x5079f5)['then'](function(){_0x4a45c7=path[_0xafe9('0x28')](__dirname,_0xafe9('0x29'),rs[_0xafe9('0x2a')](0x4)+_0xafe9('0x2b'));return convertFile(_0x5079f5,_0x4a45c7);})[_0xafe9('0x2e')](function(){try{fs['unlink'](_0x5079f5);fs[_0xafe9('0x30')](_0x4a45c7,_0xafe9('0x31'));}catch(_0x57fd66){logger['error'](_0x57fd66);}return _0x4a45c7[_0xafe9('0x32')]('.')[0x0];});};exports['ispeechASR']=function(_0x8250c6,_0x5b0ceb,_0x573131,_0x326adb){var _0xe878ca=util[_0xafe9('0x83')](_0xafe9('0x85'),ISPEECH_API,_0x5b0ceb,_0x573131,base64Encode(_0x8250c6),_0x326adb?util[_0xafe9('0x83')](_0xafe9('0x86'),encodeURIComponent(_0x326adb)):'freeform=3');return uploadFile(_0xe878ca)[_0xafe9('0x2e')](function(_0x3bdbdd){return querystring[_0xafe9('0xb')](_0x3bdbdd);});};exports[_0xafe9('0x87')]=function(_0x2d3dc2,_0x3e8864){return sestek[_0xafe9('0x88')](_0x2d3dc2,_0x3e8864)['then'](function(_0x434cfb){logger[_0xafe9('0x26')](JSON[_0xafe9('0x44')](_0x434cfb));var _0x275afe={'speech':_0x434cfb[_0xafe9('0x89')],'action':_0x434cfb[_0xafe9('0x8a')]?_0x434cfb[_0xafe9('0x8a')]['CustomAction']:undefined,'actiondata':_0x434cfb[_0xafe9('0x8a')]?_0x434cfb[_0xafe9('0x8a')][_0xafe9('0x8b')]:undefined};if(_0x434cfb[_0xafe9('0x8a')]&&_0x434cfb[_0xafe9('0x8a')][_0xafe9('0x8c')]){return base64Decode(_0x434cfb[_0xafe9('0x8a')][_0xafe9('0x8c')][_0xafe9('0x8d')],path[_0xafe9('0x28')](__dirname,_0xafe9('0x29'),rs[_0xafe9('0x2a')](0x4)+_0xafe9('0x2b')))[_0xafe9('0x2e')](function(_0x125fd6){_0x275afe[_0xafe9('0x8e')]=_0x125fd6;return _0x275afe;});}return _0x275afe;});};exports[_0xafe9('0x8f')]=function(){return __dirname;}; \ No newline at end of file +var _0xaaec=['map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','score','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','name','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','google-tts-api','parse','util','./aws','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','end','WHAT_EVER','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','base64','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','then','.mp3','from','audioContent','.wav','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xaaec,0x151));var _0xcaae=function(_0x1715f0,_0x3311fe){_0x1715f0=_0x1715f0-0x0;var _0x504209=_0xaaec[_0x1715f0];return _0x504209;};'use strict';var apiai=require(_0xcaae('0x0'));var BPromise=require(_0xcaae('0x1'));var dialogflow=require(_0xcaae('0x2'));var fs=require('fs');var http=require(_0xcaae('0x3'));var https=require(_0xcaae('0x4'));var md5=require(_0xcaae('0x5'));var path=require(_0xcaae('0x6'));var querystring=require(_0xcaae('0x7'));var rp=require(_0xcaae('0x8'));var rs=require('randomstring');var sox=require('sox');var tts=require(_0xcaae('0x9'));var urlParse=require('url')[_0xcaae('0xa')];var util=require(_0xcaae('0xb'));var aws=require(_0xcaae('0xc'));var google=require('./google');var sestek=require(_0xcaae('0xd'));var tilde=require(_0xcaae('0xe'));var logger=require('../../../config/logger')(_0xcaae('0xf'));var ISPEECH_API=_0xcaae('0x10');function downloadFile(_0x3f6c86,_0x235c3c){return new BPromise(function(_0x596e62,_0x45a880){var _0x5cb7a9=urlParse(_0x3f6c86);var _0x46bf5c=_0x5cb7a9['protocol']===_0xcaae('0x11')?https:http;var _0x579257={'host':_0x5cb7a9[_0xcaae('0x12')],'path':_0x5cb7a9[_0xcaae('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x46bf5c[_0xcaae('0x13')](_0x579257,function(_0x507f20){if(_0x507f20[_0xcaae('0x14')]!==0xc8){logger[_0xcaae('0x15')](_0xcaae('0x16')+_0x3f6c86+_0xcaae('0x17')+_0x507f20[_0xcaae('0x14')]+'\x20('+_0x507f20[_0xcaae('0x18')]+')');_0x45a880(new Error(_0xcaae('0x16')+_0x3f6c86+'\x20failed,\x20status\x20code\x20=\x20'+_0x507f20[_0xcaae('0x14')]+'\x20('+_0x507f20[_0xcaae('0x18')]+')'));return;}var _0x114bda=fs[_0xcaae('0x19')](_0x235c3c);_0x114bda['on'](_0xcaae('0x1a'),function(){logger[_0xcaae('0x1b')](_0xcaae('0x1c'));_0x114bda[_0xcaae('0x1d')](_0x596e62);});_0x114bda['on'](_0xcaae('0x15'),function(_0x284fb9){fs[_0xcaae('0x1e')](_0x235c3c);logger['error']('download\x20error',_0x284fb9);_0x45a880(_0x284fb9);});_0x507f20[_0xcaae('0x1f')](_0x114bda);})['on'](_0xcaae('0x15'),function(_0x485a05){logger[_0xcaae('0x15')](_0x485a05);_0x45a880(_0x485a05);})[_0xcaae('0x20')]();});}function uploadFile(_0x196aef){return new BPromise(function(_0x56394b,_0x22e24a){var _0x33f67a=urlParse(_0x196aef);var _0x1d8303=_0x33f67a['protocol']===_0xcaae('0x11')?https:http;var _0x27add3={'host':_0x33f67a[_0xcaae('0x12')],'path':_0x33f67a[_0xcaae('0x6')],'headers':{'user-agent':_0xcaae('0x21')}};_0x1d8303[_0xcaae('0x13')](_0x27add3,function(_0x116a6f){if(_0x116a6f['statusCode']!==0xc8){_0x22e24a(new Error(_0xcaae('0x16')+_0x196aef+_0xcaae('0x17')+_0x116a6f['statusCode']+'\x20('+_0x116a6f[_0xcaae('0x18')]+')'));return;}var _0x2c2dde='';_0x116a6f['on'](_0xcaae('0x22'),function(_0x2ced26){_0x2c2dde+=_0x2ced26;});_0x116a6f['on'](_0xcaae('0x20'),function(){_0x56394b(_0x2c2dde);});})['on'](_0xcaae('0x15'),function(_0x56be75){_0x22e24a(_0x56be75);})[_0xcaae('0x20')]();});}function convertFile(_0x1b805b,_0xa7be76){return new BPromise(function(_0x49b77c,_0x559037){var _0x22614c=sox[_0xcaae('0x23')](_0x1b805b,_0xa7be76,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x22614c['on'](_0xcaae('0x15'),function(_0x41c49a){logger['error'](_0xcaae('0x24'),_0x41c49a);_0x559037(_0x41c49a);});_0x22614c['on'](_0xcaae('0x20'),function(){logger[_0xcaae('0x1b')](_0xcaae('0x25'));_0x49b77c();});_0x22614c[_0xcaae('0x26')]();});}function base64Decode(_0x1c592c,_0x3144b0){var _0x1d8c1b=path[_0xcaae('0x27')](__dirname,_0xcaae('0x28'),rs[_0xcaae('0x29')](0x4)+'.wav');fs['writeFileSync'](_0x1d8c1b,_0x1c592c,_0xcaae('0x2a'));return convertFile(_0x1d8c1b,_0x3144b0)['then'](function(){try{fs[_0xcaae('0x1e')](_0x1d8c1b);fs[_0xcaae('0x2b')](_0x3144b0,_0xcaae('0x2c'));}catch(_0xe27e88){logger[_0xcaae('0x15')](_0xe27e88);}return _0x3144b0['split']('.')[0x0];});}function base64Encode(_0x2d72b2){var _0x9b4cf7=fs[_0xcaae('0x2d')](_0x2d72b2);return new Buffer(_0x9b4cf7)[_0xcaae('0x2e')](_0xcaae('0x2a'));}exports[_0xcaae('0x2f')]=function(_0x1566c5,_0x4e42bf,_0x2444d6,_0x2f03d4,_0x4d94e0,_0x22ebed){var _0x1389a4,_0x548a11;var _0x45a57c=_0xcaae('0x30');var _0x112c27=_0xcaae('0x31')+_0x1566c5;var _0x5bb4b0={};if(_0x4e42bf===_0xcaae('0x32')){_0x5bb4b0[_0xcaae('0x33')]={'ssml':_0x2444d6};}else{_0x5bb4b0['input']={'text':_0x2444d6};};_0x5bb4b0[_0xcaae('0x34')]={'languageCode':_0x2f03d4,'ssmlGender':_0x4d94e0};_0x5bb4b0[_0xcaae('0x35')]={'audioEncoding':_0xcaae('0x36'),'sampleRateHertz':0x1f40};var _0x30121d={'url':_0x45a57c+'text:synthesize'+_0x112c27,'method':_0xcaae('0x37'),'json':!![],'body':_0x5bb4b0};return rp(_0x30121d)[_0xcaae('0x38')](function(_0x489287){return new BPromise(function(_0x3bc11e,_0x193961){_0x1389a4=path['resolve'](__dirname,'tmp',rs[_0xcaae('0x29')](0x4)+_0xcaae('0x39'));var _0x26d7a7=Buffer[_0xcaae('0x3a')](_0x489287[_0xcaae('0x3b')],_0xcaae('0x2a'));return fs['writeFile'](_0x1389a4,_0x26d7a7,function(_0x46af54){_0x193961(_0x46af54);},function(_0x487215){fs[_0xcaae('0x2b')](_0x1389a4,_0xcaae('0x2c'));_0x3bc11e(_0x487215);});});})[_0xcaae('0x38')](function(_0x58158f){_0x548a11=path[_0xcaae('0x27')](__dirname,_0xcaae('0x28'),rs['generate'](0x4)+_0xcaae('0x3c'));return convertFile(_0x1389a4,_0x548a11);})[_0xcaae('0x38')](function(){try{fs[_0xcaae('0x1e')](_0x1389a4);fs[_0xcaae('0x2b')](_0x548a11,_0xcaae('0x2c'));}catch(_0x42709e){logger['error'](_0x42709e);}logger['info']('googleCloudTTS\x20path',_0x548a11[_0xcaae('0x3d')]('.')[0x0]);return _0x548a11[_0xcaae('0x3d')]('.')[0x0];});};exports[_0xcaae('0x3e')]=function(_0x110a03,_0x5c51d1){var _0x544827=_0xcaae('0x3f');var _0x4393c1,_0x2b6b40;var _0x1ed1fb;var _0x2d1c88={'encoding':_0xcaae('0x40'),'method':'POST','timeout':0x2710,'url':_0x544827,'headers':{'Content-Type':_0xcaae('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0xcaae('0x42')]([[[_0xcaae('0x43'),JSON[_0xcaae('0x42')]([_0x110a03,_0x5c51d1||'en',![],_0xcaae('0x44')]),null,_0xcaae('0x45')]]]))};return rp(_0x2d1c88)[_0xcaae('0x38')](function(_0x4f86b5){try{_0x1ed1fb=eval(_0x4f86b5[_0xcaae('0x46')](0x5))[0x0][0x2];}catch(_0x4a87e3){throw new Error(_0xcaae('0x47')+_0x4f86b5[_0xcaae('0x22')]);}if(!_0x1ed1fb){if(_0x110a03[_0xcaae('0x48')]>0xc8){throw new Error(_0xcaae('0x49'));}else{throw new Error(_0xcaae('0x4a')+_0x5c51d1+_0xcaae('0x4b'));}}try{_0x1ed1fb=eval(_0x1ed1fb)[0x0];}catch(_0x1d4618){throw new Error(_0xcaae('0x47')+res[_0xcaae('0x22')]);}const _0x3d26a2=_0x1ed1fb;_0x4393c1=path[_0xcaae('0x27')](__dirname,_0xcaae('0x28'),rs[_0xcaae('0x29')](0x4)+_0xcaae('0x39'));fs['writeFileSync'](_0x4393c1,_0x1ed1fb,{'encoding':_0xcaae('0x2a')});_0x2b6b40=path[_0xcaae('0x27')](__dirname,_0xcaae('0x28'),rs[_0xcaae('0x29')](0x4)+_0xcaae('0x3c'));return convertFile(_0x4393c1,_0x2b6b40);})[_0xcaae('0x38')](function(){try{fs['unlink'](_0x4393c1);fs[_0xcaae('0x2b')](_0x2b6b40,'777');}catch(_0x222dd0){logger[_0xcaae('0x15')](_0x222dd0);}logger[_0xcaae('0x1b')]('goggleTTS\x20path',_0x2b6b40[_0xcaae('0x3d')]('.')[0x0]);return _0x2b6b40[_0xcaae('0x3d')]('.')[0x0];});};exports[_0xcaae('0x4c')]=function(_0x3fe489,_0x4ddd15,_0x1533cd){return google[_0xcaae('0x4d')](_0x3fe489,_0x4ddd15,_0x1533cd)[_0xcaae('0x38')](function(_0x57082b){logger[_0xcaae('0x1b')](_0x57082b[_0xcaae('0x4e')]);return rp(_0x57082b);})[_0xcaae('0x38')](function(_0x28106d){var _0x5d2028='';var _0x40604d=0x0;try{fs[_0xcaae('0x1e')](_0x3fe489);}catch(_0x1a5f83){logger[_0xcaae('0x15')](_0x1a5f83);}if(_0x28106d&&_0x28106d[_0xcaae('0x4f')]){_0x5d2028=_0x28106d[_0xcaae('0x4f')][_0xcaae('0x50')](function(_0x6d266b){return _0x6d266b&&_0x6d266b[_0xcaae('0x51')][0x0]&&_0x6d266b[_0xcaae('0x51')][0x0][_0xcaae('0x52')]?_0x6d266b[_0xcaae('0x51')][0x0][_0xcaae('0x52')]:'';})[_0xcaae('0x53')]('\x0a');_0x40604d=_0x28106d[_0xcaae('0x4f')][_0xcaae('0x50')](function(_0x2a6f2c){return _0x2a6f2c&&_0x2a6f2c[_0xcaae('0x51')][0x0]&&_0x2a6f2c['alternatives'][0x0][_0xcaae('0x54')]?_0x2a6f2c[_0xcaae('0x51')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0xcaae('0x1b')](_0xcaae('0x55'),_0x5d2028);logger['info']('googleASR\x20confidence',_0x40604d);return{'transcript':_0x5d2028,'confidence':_0x40604d};})[_0xcaae('0x56')](function(_0xd84edf){logger[_0xcaae('0x15')](_0xcaae('0x57'),_0xd84edf['statusCode'],_0xd84edf['name'],_0xd84edf[_0xcaae('0x58')]);});};exports[_0xcaae('0x59')]=function(_0x5e0fe5,_0x37ffbb,_0x1485b7,_0x51f16c){var _0x4d64e5=apiai(_0x37ffbb,{'language':_0x51f16c||'en'});return _0x4d64e5[_0xcaae('0x5a')](_0x1485b7,{'sessionId':md5(_0x5e0fe5)})[_0xcaae('0x38')](function(_0x4105e5){logger['info'](JSON[_0xcaae('0x42')](_0x4105e5));return{'source':_0x4105e5[_0xcaae('0x5b')][_0xcaae('0x5c')],'resolvedQuery':_0x4105e5['result'][_0xcaae('0x5d')],'action':_0x4105e5['result'][_0xcaae('0x5e')],'actionIncomplete':_0x4105e5[_0xcaae('0x5b')]['actionIncomplete'],'speech':_0x4105e5[_0xcaae('0x5b')]['fulfillment']['speech'],'score':_0x4105e5[_0xcaae('0x5b')][_0xcaae('0x5f')],'statusCode':_0x4105e5[_0xcaae('0x60')][_0xcaae('0x61')],'endConversation':_0x4105e5[_0xcaae('0x5b')][_0xcaae('0x62')][_0xcaae('0x63')]||![],'isFallbackIntent':_0x4105e5['result'][_0xcaae('0x62')][_0xcaae('0x64')]};});};exports['googleDialogflowV2']=function(_0x289b03,_0x294c25,_0x172a96,_0x5618d1,_0x26a0e9,_0x5cbadd){var _0x3407b8=_0x5618d1[_0xcaae('0x65')](/\\n/g,'\x0a');var _0x5b0655={'credentials':{'private_key':_0x3407b8,'client_email':_0x172a96}};var _0x4d17df=new dialogflow[(_0xcaae('0x66'))](_0x5b0655);var _0x1d6ba1=_0x4d17df[_0xcaae('0x67')](_0x294c25,md5(_0x289b03));var _0x12d658={'session':_0x1d6ba1,'queryInput':{'text':{'text':_0x26a0e9,'languageCode':_0x5cbadd}}};return _0x4d17df['detectIntent'](_0x12d658)[_0xcaae('0x38')](function(_0x11f294){if(_0x11f294&&_0x11f294[_0xcaae('0x48')]){logger['info'](_0xcaae('0x68'),JSON['stringify'](_0x11f294));var _0x1d95a7=_0x11f294[0x0];if(_0x1d95a7){var _0x147923={'action':_0x1d95a7[_0xcaae('0x69')][_0xcaae('0x5e')],'allRequiredParamsPresent':_0x1d95a7['queryResult'][_0xcaae('0x6a')],'endConversation':_0x1d95a7[_0xcaae('0x69')]['diagnosticInfo']&&_0x1d95a7['queryResult'][_0xcaae('0x6b')][_0xcaae('0x6c')]?_0x1d95a7[_0xcaae('0x69')]['diagnosticInfo']['fields'][_0xcaae('0x6d')][_0xcaae('0x6e')]:![],'fulfillmentText':_0x1d95a7['queryResult']['fulfillmentText'],'intentName':_0x1d95a7[_0xcaae('0x69')][_0xcaae('0x6f')][_0xcaae('0x70')],'intentDisplayName':_0x1d95a7[_0xcaae('0x69')][_0xcaae('0x6f')][_0xcaae('0x71')],'isFallbackIntent':_0x1d95a7[_0xcaae('0x69')][_0xcaae('0x6f')][_0xcaae('0x72')],'languageCode':_0x1d95a7[_0xcaae('0x69')][_0xcaae('0x73')],'queryText':_0x1d95a7[_0xcaae('0x69')]['queryText'],'responseId':_0x1d95a7[_0xcaae('0x74')],'score':_0x1d95a7['queryResult'][_0xcaae('0x75')],'speech':_0x1d95a7['queryResult'][_0xcaae('0x76')],'providerResponse':JSON[_0xcaae('0x42')](_0x11f294)};return _0x147923;}}});};exports['tildeASR']=function(_0x473cd6,_0x1ea63d,_0x45f006,_0x4c9bf2){return tilde['asr'](_0x473cd6,_0x1ea63d,_0x45f006,_0x4c9bf2)['then'](function(_0x38c526){try{fs[_0xcaae('0x1e')](_0x473cd6);}catch(_0x45e19f){logger[_0xcaae('0x15')](_0x45e19f);}logger['info'](_0xcaae('0x77'),_0x38c526[_0xcaae('0x52')]);logger[_0xcaae('0x1b')](_0xcaae('0x78'),_0x38c526['confidence']);return _0x38c526;});};exports[_0xcaae('0x79')]=function(_0x869c07,_0x3e1656,_0x47cd6a,_0x2282a1,_0x517afc,_0x4caaab){var _0x21a3e6=path[_0xcaae('0x27')](__dirname,_0xcaae('0x28'),rs['generate'](0x4)+_0xcaae('0x39'));var _0x38bfac;return aws['polly'](_0x869c07,_0x3e1656,_0x47cd6a,_0x2282a1,_0x517afc,_0x4caaab,_0x21a3e6)['then'](function(){_0x38bfac=path['resolve'](__dirname,_0xcaae('0x28'),rs['generate'](0x4)+_0xcaae('0x3c'));return convertFile(_0x21a3e6,_0x38bfac);})['then'](function(){try{fs[_0xcaae('0x1e')](_0x21a3e6);fs['chmodSync'](_0x38bfac,_0xcaae('0x2c'));}catch(_0x179f64){logger[_0xcaae('0x15')](_0x179f64);}return _0x38bfac['split']('.')[0x0];});};exports['awsLex']=function(_0x2c97a4,_0x3e210d,_0x3fd453,_0x12f628,_0x4029f2,_0x24844c){return aws[_0xcaae('0x7a')](_0x2c97a4,_0x3e210d,_0x3fd453,_0x12f628,_0x4029f2,_0x24844c)['then'](function(_0xc350e2){logger[_0xcaae('0x1b')](JSON[_0xcaae('0x42')](_0xc350e2));return _0xc350e2;});};exports[_0xcaae('0x7b')]=function(_0x115771,_0x306d1e,_0xb0635a,_0x2a7e34){var _0x4ad006=util[_0xcaae('0x7c')](_0xcaae('0x7d'),ISPEECH_API,_0x115771,encodeURIComponent(_0x306d1e),_0xb0635a,_0x2a7e34);var _0x2c1eca=path[_0xcaae('0x27')](__dirname,'tmp',rs[_0xcaae('0x29')](0x4)+_0xcaae('0x39'));var _0x53abe7;return downloadFile(_0x4ad006,_0x2c1eca)['then'](function(){_0x53abe7=path['resolve'](__dirname,_0xcaae('0x28'),rs[_0xcaae('0x29')](0x4)+'.wav');return convertFile(_0x2c1eca,_0x53abe7);})[_0xcaae('0x38')](function(){try{fs['unlink'](_0x2c1eca);fs[_0xcaae('0x2b')](_0x53abe7,_0xcaae('0x2c'));}catch(_0x3a2a17){logger[_0xcaae('0x15')](_0x3a2a17);}return _0x53abe7[_0xcaae('0x3d')]('.')[0x0];});};exports[_0xcaae('0x7e')]=function(_0x1b8dac,_0x3144bc,_0xa14a41,_0x52388c){var _0x260038=util[_0xcaae('0x7c')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3144bc,_0xa14a41,base64Encode(_0x1b8dac),_0x52388c?util[_0xcaae('0x7c')](_0xcaae('0x7f'),encodeURIComponent(_0x52388c)):_0xcaae('0x80'));return uploadFile(_0x260038)[_0xcaae('0x38')](function(_0x409185){return querystring[_0xcaae('0xa')](_0x409185);});};exports[_0xcaae('0x81')]=function(_0x401e06,_0x550219){return sestek[_0xcaae('0x82')](_0x401e06,_0x550219)[_0xcaae('0x38')](function(_0x216784){logger[_0xcaae('0x1b')](JSON[_0xcaae('0x42')](_0x216784));var _0x4cebbe={'speech':_0x216784[_0xcaae('0x83')],'action':_0x216784[_0xcaae('0x84')]?_0x216784['channelData'][_0xcaae('0x85')]:undefined,'actiondata':_0x216784[_0xcaae('0x84')]?_0x216784[_0xcaae('0x84')][_0xcaae('0x86')]:undefined};if(_0x216784[_0xcaae('0x84')]&&_0x216784['channelData'][_0xcaae('0x87')]){return base64Decode(_0x216784[_0xcaae('0x84')][_0xcaae('0x87')][_0xcaae('0x88')],path[_0xcaae('0x27')](__dirname,_0xcaae('0x28'),rs[_0xcaae('0x29')](0x4)+_0xcaae('0x3c')))['then'](function(_0x53b910){_0x4cebbe[_0xcaae('0x89')]=_0x53b910;return _0x4cebbe;});}return _0x4cebbe;});};exports[_0xcaae('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 ae62690..0cb2c62 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 _0x21e6=['exports'];(function(_0x4d6ac0,_0x201628){var _0x5296c4=function(_0x3d0b3d){while(--_0x3d0b3d){_0x4d6ac0['push'](_0x4d6ac0['shift']());}};_0x5296c4(++_0x201628);}(_0x21e6,0xb1));var _0x621e=function(_0x28d391,_0x1357b3){_0x28d391=_0x28d391-0x0;var _0x3c8bf0=_0x21e6[_0x28d391];return _0x3c8bf0;};var nda=require('./nda');module[_0x621e('0x0')]={'nda':nda}; \ No newline at end of file +var _0x27e4=['./nda'];(function(_0x70dd3c,_0x1031b0){var _0x4d65b8=function(_0xb944a6){while(--_0xb944a6){_0x70dd3c['push'](_0x70dd3c['shift']());}};_0x4d65b8(++_0x1031b0);}(_0x27e4,0x14b));var _0x427e=function(_0xbaf64b,_0x2f6836){_0xbaf64b=_0xbaf64b-0x0;var _0xbd073=_0x27e4[_0xbaf64b];return _0xbd073;};var nda=require(_0x427e('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 93cfb7c..fbbdf76 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 _0xd138=['stringify','request-promise','url','../../../../../config/logger','resolve','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd138,0x1dc));var _0x8d13=function(_0x487ee3,_0x4322ab){_0x487ee3=_0x487ee3-0x0;var _0x2eb2b1=_0xd138[_0x487ee3];return _0x2eb2b1;};'use strict';var rp=require(_0x8d13('0x0'));var url=require(_0x8d13('0x1'));var logger=require(_0x8d13('0x2'))('agi');module['exports']=function(_0x4ce918,_0x13e640){var _0x4eb077={'method':'POST','uri':url[_0x8d13('0x3')](_0x13e640['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x13e640['username'],'password':_0x13e640['password']},'json':!![]};return rp(_0x4eb077)[_0x8d13('0x4')](function(_0x296da6){var _0x1ab1f6={'method':'POST','uri':url[_0x8d13('0x3')](_0x13e640['ndassistant_url'],_0x8d13('0x5')),'body':{'type':_0x13e640[_0x8d13('0x6')]||'message','channelId':'Nda','conversation':{'id':_0x4ce918[_0x8d13('0x7')]},'from':{'id':_0x4ce918[_0x8d13('0x8')],'name':_0x4ce918[_0x8d13('0x9')]},'recipient':{'id':_0x4ce918['dnid'],'name':_0x4ce918[_0x8d13('0xa')]},'text':_0x13e640[_0x8d13('0xb')],'channelData':{}},'headers':{'Authorization':_0x8d13('0xc')+_0x296da6['access_token']},'json':!![]};if(_0x13e640[_0x8d13('0xd')]){_0x1ab1f6[_0x8d13('0xe')][_0x8d13('0xf')][_0x8d13('0x10')]=_0x13e640[_0x8d13('0xd')];}if(_0x13e640[_0x8d13('0x11')]=='1'){_0x1ab1f6[_0x8d13('0xe')][_0x8d13('0xf')][_0x8d13('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x13e640[_0x8d13('0x13')]){_0x1ab1f6['body'][_0x8d13('0xf')][_0x8d13('0x14')]=_0x13e640['custom_action'];if(_0x13e640[_0x8d13('0x15')]){_0x1ab1f6[_0x8d13('0xe')][_0x8d13('0xf')][_0x8d13('0x16')]=_0x13e640[_0x8d13('0x15')];}}logger[_0x8d13('0x17')](JSON[_0x8d13('0x18')](_0x1ab1f6));return rp(_0x1ab1f6);});}; \ No newline at end of file +var _0xe630=['ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','request-promise','url','agi','exports','POST','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe630,0x149));var _0x0e63=function(_0x58b5b0,_0x599f81){_0x58b5b0=_0x58b5b0-0x0;var _0x1463ab=_0xe630[_0x58b5b0];return _0x1463ab;};'use strict';var rp=require(_0x0e63('0x0'));var url=require(_0x0e63('0x1'));var logger=require('../../../../../config/logger')(_0x0e63('0x2'));module[_0x0e63('0x3')]=function(_0x45c680,_0x500458){var _0x103691={'method':_0x0e63('0x4'),'uri':url[_0x0e63('0x5')](_0x500458['ndauth_url'],_0x0e63('0x6')),'form':{'grant_type':_0x0e63('0x7'),'username':_0x500458[_0x0e63('0x8')],'password':_0x500458[_0x0e63('0x7')]},'json':!![]};return rp(_0x103691)[_0x0e63('0x9')](function(_0x563ad9){var _0x35e304={'method':_0x0e63('0x4'),'uri':url[_0x0e63('0x5')](_0x500458[_0x0e63('0xa')],_0x0e63('0xb')),'body':{'type':_0x500458[_0x0e63('0xc')]||_0x0e63('0xd'),'channelId':_0x0e63('0xe'),'conversation':{'id':_0x45c680[_0x0e63('0xf')]},'from':{'id':_0x45c680[_0x0e63('0x10')],'name':_0x45c680[_0x0e63('0x11')]},'recipient':{'id':_0x45c680['dnid'],'name':_0x45c680[_0x0e63('0x12')]},'text':_0x500458[_0x0e63('0x13')],'channelData':{}},'headers':{'Authorization':_0x0e63('0x14')+_0x563ad9[_0x0e63('0x15')]},'json':!![]};if(_0x500458[_0x0e63('0x16')]){_0x35e304[_0x0e63('0x17')][_0x0e63('0x18')][_0x0e63('0x19')]=_0x500458[_0x0e63('0x16')];}if(_0x500458['ndagenerate_audio']=='1'){_0x35e304['body'][_0x0e63('0x18')][_0x0e63('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0e63('0x1b')};}if(_0x500458[_0x0e63('0x1c')]){_0x35e304[_0x0e63('0x17')][_0x0e63('0x18')]['CustomAction']=_0x500458['custom_action'];if(_0x500458['custom_action_data']){_0x35e304['body'][_0x0e63('0x18')][_0x0e63('0x1d')]=_0x500458[_0x0e63('0x1e')];}}logger['info'](JSON['stringify'](_0x35e304));return rp(_0x35e304);});}; \ 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 f15c545..bdf4ede 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 _0xc16a=['exports','./lib/api'];(function(_0x1f0731,_0x307241){var _0x1782c9=function(_0x308842){while(--_0x308842){_0x1f0731['push'](_0x1f0731['shift']());}};_0x1782c9(++_0x307241);}(_0xc16a,0x1dd));var _0xac16=function(_0x216feb,_0x4af079){_0x216feb=_0x216feb-0x0;var _0x4462a2=_0xc16a[_0x216feb];return _0x4462a2;};'use strict';var asr=require(_0xac16('0x0'));module[_0xac16('0x1')]=function(_0x2303bc,_0x3d3b44,_0xbfcae3,_0x2e7550){return asr(_0x2303bc,_0x3d3b44,_0xbfcae3,_0x2e7550);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x267279,_0x58f3fc,_0xf17d81,_0xcedda){return asr(_0x267279,_0x58f3fc,_0xf17d81,_0xcedda);}; \ 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 5d669bc..9d2f25e 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 _0x088e=['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','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','stringify','createReadStream','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','hypotheses','likelihood','Success.'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x088e,0x167));var _0xe088=function(_0x27b77f,_0x381ac8){_0x27b77f=_0x27b77f-0x0;var _0xd790d6=_0x088e[_0x27b77f];return _0xd790d6;};'use strict';var BPromise=require(_0xe088('0x0'));var _=require(_0xe088('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe088('0x2'));var crypto=require(_0xe088('0x3'));var logger=require(_0xe088('0x4'))(_0xe088('0x5'));module[_0xe088('0x6')]=function(_0x1d14ae,_0x819774,_0x14d5d3,_0x5a57b3){return new BPromise(function(_0x3468ba,_0x320b5d){logger[_0xe088('0x7')](_0xe088('0x8'),_0x5a57b3||_0xe088('0x9'));var _0x314867=new WebSocket(_0x5a57b3||_0xe088('0x9'),{'perMessageDeflate':![]});var _0x19c608='';var _0x165284='0';var _0x242121='1';var _0x5dc944=_0xe088('0xa');function _0x5421c9(_0x2a549a){var _0x2dc057=crypto[_0xe088('0xb')](_0xe088('0xc'));_0x2dc057[_0xe088('0xd')](_0x2a549a);return _0x2dc057[_0xe088('0xe')](_0xe088('0xf'));}function _0x49e997(){try{logger[_0xe088('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x1c4860=moment()[_0xe088('0x10')]();var _0x1291e2=_0x5421c9(_0x1c4860+_0x819774+_0x14d5d3);_0x314867['send'](JSON[_0xe088('0x11')]({'appID':_0x819774,'timestamp':_0x1c4860,'appKey':_0x1291e2}));var _0x4886da=fs[_0xe088('0x12')](_0x1d14ae);_0x4886da['on']('data',function(_0x375063){_0x314867[_0xe088('0x13')](_0x375063);});_0x4886da['on'](_0xe088('0x14'),function(){_0x314867[_0xe088('0x13')](_0xe088('0x15'));});}catch(_0x4d5632){logger[_0xe088('0x16')](_0xe088('0x17'),JSON[_0xe088('0x11')](_0x4d5632));_0x314867[_0xe088('0x18')]();}}function _0x599fd8(_0x537d0b){try{if(_0x537d0b){var _0x30553d=JSON[_0xe088('0x19')](_0x537d0b);switch(_0x30553d['status']){case 0x0:if(_0x30553d[_0xe088('0x1a')]){if(_0x30553d[_0xe088('0x1a')][_0xe088('0x1b')]){logger[_0xe088('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0xe088('0x11')](_0x30553d[_0xe088('0x1a')][_0xe088('0x1c')]));_0x19c608=_0x30553d[_0xe088('0x1a')][_0xe088('0x1c')][0x0]['transcript'];_0x165284=_0x30553d[_0xe088('0x1a')][_0xe088('0x1c')][0x0][_0xe088('0x1d')];_0x242121='0';_0x5dc944=_0xe088('0x1e');_0x314867[_0xe088('0x18')]();}}break;case 0x1:logger[_0xe088('0x7')](_0xe088('0xa'));_0x242121='1';_0x5dc944=_0xe088('0xa');break;case 0x2:logger[_0xe088('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x242121='2';_0x5dc944=_0xe088('0x1f');break;case 0x9:logger[_0xe088('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x242121='9';_0x5dc944=_0xe088('0x20');break;case 0xa:logger[_0xe088('0x7')](_0xe088('0x21'));_0x242121='10';_0x5dc944=_0xe088('0x21');break;case 0xb:logger[_0xe088('0x7')](_0xe088('0x22'));_0x242121='11';_0x5dc944='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xcb5c81){logger['error'](_0xe088('0x23'),JSON[_0xe088('0x11')](_0xcb5c81));_0x314867[_0xe088('0x18')]();}}function _0x2b90bd(){logger[_0xe088('0x7')](_0xe088('0x24'));_0x3468ba({'transcript':_0x19c608,'confidence':_0x165284,'status':_0x242121,'status_message':_0x5dc944});}function _0x5a210f(_0x2ef7af){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xe088('0x25')](_0x2ef7af)){logger['error'](_[_0xe088('0x26')](_0x2ef7af)?JSON['stringify'](_0x2ef7af):_0x2ef7af);}}_0x314867['on']('open',_0x49e997);_0x314867['on']('message',_0x599fd8);_0x314867['on'](_0xe088('0x14'),_0x2b90bd);_0x314867['on']('error',_0x5a210f);});}; \ No newline at end of file +var _0xa8ff=['bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','hex','unix','send','stringify','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','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','close'];(function(_0x5eaf5d,_0xddc9b8){var _0x445030=function(_0x44eeb7){while(--_0x44eeb7){_0x5eaf5d['push'](_0x5eaf5d['shift']());}};_0x445030(++_0xddc9b8);}(_0xa8ff,0x111));var _0xfa8f=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa8ff[_0x2112d4];return _0x434972;};'use strict';var BPromise=require(_0xfa8f('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xfa8f('0x1'));var crypto=require(_0xfa8f('0x2'));var logger=require(_0xfa8f('0x3'))(_0xfa8f('0x4'));module[_0xfa8f('0x5')]=function(_0x5e9746,_0x3874c7,_0x86f8c6,_0x45c1ce){return new BPromise(function(_0x2453ba,_0x3152e3){logger[_0xfa8f('0x6')](_0xfa8f('0x7'),_0x45c1ce||_0xfa8f('0x8'));var _0x19abf0=new WebSocket(_0x45c1ce||_0xfa8f('0x8'),{'perMessageDeflate':![]});var _0x2b4839='';var _0x269284='0';var _0x5f095c='1';var _0x3190ac='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x275725(_0x31b112){var _0x2772a9=crypto[_0xfa8f('0x9')]('sha1');_0x2772a9[_0xfa8f('0xa')](_0x31b112);return _0x2772a9[_0xfa8f('0xb')](_0xfa8f('0xc'));}function _0x460d9b(){try{logger[_0xfa8f('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x78e427=moment()[_0xfa8f('0xd')]();var _0x599b6b=_0x275725(_0x78e427+_0x3874c7+_0x86f8c6);_0x19abf0[_0xfa8f('0xe')](JSON[_0xfa8f('0xf')]({'appID':_0x3874c7,'timestamp':_0x78e427,'appKey':_0x599b6b}));var _0x2d8ab6=fs['createReadStream'](_0x5e9746);_0x2d8ab6['on'](_0xfa8f('0x10'),function(_0x92fffb){_0x19abf0[_0xfa8f('0xe')](_0x92fffb);});_0x2d8ab6['on']('close',function(){_0x19abf0[_0xfa8f('0xe')](_0xfa8f('0x11'));});}catch(_0x3187eb){logger[_0xfa8f('0x12')](_0xfa8f('0x13'),JSON[_0xfa8f('0xf')](_0x3187eb));_0x19abf0[_0xfa8f('0x14')]();}}function _0x4e2bc7(_0x2b591c){try{if(_0x2b591c){var _0x51c5d8=JSON[_0xfa8f('0x15')](_0x2b591c);switch(_0x51c5d8['status']){case 0x0:if(_0x51c5d8[_0xfa8f('0x16')]){if(_0x51c5d8[_0xfa8f('0x16')][_0xfa8f('0x17')]){logger[_0xfa8f('0x6')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x51c5d8[_0xfa8f('0x16')][_0xfa8f('0x18')]));_0x2b4839=_0x51c5d8[_0xfa8f('0x16')][_0xfa8f('0x18')][0x0][_0xfa8f('0x19')];_0x269284=_0x51c5d8[_0xfa8f('0x16')][_0xfa8f('0x18')][0x0][_0xfa8f('0x1a')];_0x5f095c='0';_0x3190ac=_0xfa8f('0x1b');_0x19abf0[_0xfa8f('0x14')]();}}break;case 0x1:logger['info'](_0xfa8f('0x1c'));_0x5f095c='1';_0x3190ac=_0xfa8f('0x1c');break;case 0x2:logger[_0xfa8f('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x5f095c='2';_0x3190ac='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xfa8f('0x1d'));_0x5f095c='9';_0x3190ac='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xfa8f('0x6')](_0xfa8f('0x1e'));_0x5f095c='10';_0x3190ac=_0xfa8f('0x1e');break;case 0xb:logger[_0xfa8f('0x6')](_0xfa8f('0x1f'));_0x5f095c='11';_0x3190ac=_0xfa8f('0x1f');}}}catch(_0x10a2fb){logger['error'](_0xfa8f('0x20'),JSON[_0xfa8f('0xf')](_0x10a2fb));_0x19abf0[_0xfa8f('0x14')]();}}function _0x37a5ea(){logger[_0xfa8f('0x6')](_0xfa8f('0x21'));_0x2453ba({'transcript':_0x2b4839,'confidence':_0x269284,'status':_0x5f095c,'status_message':_0x3190ac});}function _0x565a94(_0x416c51){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xfa8f('0x22')](_0x416c51)){logger[_0xfa8f('0x12')](_[_0xfa8f('0x23')](_0x416c51)?JSON[_0xfa8f('0xf')](_0x416c51):_0x416c51);}}_0x19abf0['on'](_0xfa8f('0x24'),_0x460d9b);_0x19abf0['on'](_0xfa8f('0x25'),_0x4e2bc7);_0x19abf0['on'](_0xfa8f('0x26'),_0x37a5ea);_0x19abf0['on']('error',_0x565a94);});}; \ 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 4ca9aa0..10cb4be 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 _0x696f=['exports','./asr'];(function(_0x307f13,_0x27e474){var _0x28eab2=function(_0x427d1d){while(--_0x427d1d){_0x307f13['push'](_0x307f13['shift']());}};_0x28eab2(++_0x27e474);}(_0x696f,0x11b));var _0xf696=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x696f[_0x5ddb1c];return _0x354adc;};var asr=require(_0xf696('0x0'));module[_0xf696('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');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 da54215..7020329 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x43b21d,_0x5d5677){var _0x1de400=function(_0x405b75){while(--_0x405b75){_0x43b21d['push'](_0x43b21d['shift']());}};_0x1de400(++_0x5d5677);}(_0xe706,0xa3));var _0x6e70=function(_0x3518b6,_0x1d6005){_0x3518b6=_0x3518b6-0x0;var _0x55a221=_0xe706[_0x3518b6];return _0x55a221;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x2f02d4,_0x27b24a){var _0x4b707d=function(_0x52f3ba){while(--_0x52f3ba){_0x2f02d4['push'](_0x2f02d4['shift']());}};_0x4b707d(++_0x27b24a);}(_0xe706,0xa3));var _0x6e70=function(_0x3d7fa1,_0x340c0e){_0x3d7fa1=_0x3d7fa1-0x0;var _0x4f5e46=_0xe706[_0x3d7fa1];return _0x4f5e46;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e3bacc7..69b952c 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 _0xcf14=['Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','agentPause','playback','opts','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','sayDigits','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','bcc','subject','template_id','debug','sendMail\x20message','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','no\x20variable\x20selected','join','exports','util','shelljs','odbc','moment','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','extension','priority','accountcode','file','createSquareMessage','createCmContact','isNil','random','isEmpty','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','method','timeout','number','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','text','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','tildeASR','appid','uri','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','isArray','split','replaceAll','extra','getAndSetVariable','result','setVariable','maxRetry','retry','mrcpsynth','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','no\x20list\x20selected','add','delay','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','dial','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','Executed\x20command\x20%s','no\x20key\x20configured','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s'];(function(_0x2a2915,_0x2e79fa){var _0x25fffd=function(_0x4d77cb){while(--_0x4d77cb){_0x2a2915['push'](_0x2a2915['shift']());}};_0x25fffd(++_0x2e79fa);}(_0xcf14,0xa1));var _0x4cf1=function(_0x40babb,_0x3d5907){_0x40babb=_0x40babb-0x0;var _0x4a8f68=_0xcf14[_0x40babb];return _0x4a8f68;};'use strict';var fs=require('fs');var util=require(_0x4cf1('0x0'));var _=require('lodash');var sh=require(_0x4cf1('0x1'));var odbc=require(_0x4cf1('0x2'))();var rs=require('randomstring');var moment=require(_0x4cf1('0x3'));var Mustache=require(_0x4cf1('0x4'));var rp=require(_0x4cf1('0x5'));var logger=require(_0x4cf1('0x6'))('agi');var config=require(_0x4cf1('0x7'));var shared=require(_0x4cf1('0x8'));var scripts=require(_0x4cf1('0x9'));var FILES_PATH=_0x4cf1('0xa');var recursiveMapAttributes=[_0x4cf1('0xb'),_0x4cf1('0xc')];var verticesWithRetry=[_0x4cf1('0xd'),'getdigits',_0x4cf1('0xe')];var AGIVertices=function(_0x208cdd,_0x46c2de,_0x37db9f){this[_0x4cf1('0xf')]=_0x208cdd;this[_0x4cf1('0x10')]=_0x46c2de;this[_0x4cf1('0x11')]=_0x37db9f;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x13')]=function(_0x28af26,_0x26d254){this[_0x4cf1('0x10')][_0x4cf1('0x14')](_0x28af26)[_0x4cf1('0x15')](function(_0x592557){_0x26d254(null,_0x592557?_0x592557[_0x4cf1('0x16')]:![]);})[_0x4cf1('0x17')](function(_0x1ae8fb){_0x26d254(_0x1ae8fb);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x18')]=function(_0x16bae8,_0x10abde){this[_0x4cf1('0x10')][_0x4cf1('0x19')](_0x16bae8)[_0x4cf1('0x15')](function(_0x3e320f){_0x10abde(null,_0x3e320f?_0x3e320f[_0x4cf1('0x16')]:![]);})[_0x4cf1('0x17')](function(_0x2a8cf7){_0x10abde(_0x2a8cf7);});};AGIVertices[_0x4cf1('0x12')]['getSquareProject']=function(_0x3e3cd8,_0x527dca){this[_0x4cf1('0x10')][_0x4cf1('0x1a')](_0x3e3cd8)[_0x4cf1('0x15')](function(_0x1f20c0){_0x527dca(null,_0x1f20c0?_0x1f20c0[_0x4cf1('0x16')]:![]);})['catch'](function(_0x4499f7){_0x527dca(_0x4499f7);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1b')]=function(_0x4557e0,_0x52b5a2){this['rpc'][_0x4cf1('0x1c')](_0x4557e0)[_0x4cf1('0x15')](function(_0x5603ae){_0x52b5a2(null,_0x5603ae?_0x5603ae[_0x4cf1('0x1d')]:![]);})[_0x4cf1('0x17')](function(_0x3cc036){_0x52b5a2(_0x3cc036);});};AGIVertices[_0x4cf1('0x12')]['getUser']=function(_0x3469ac,_0x158000){this[_0x4cf1('0x10')][_0x4cf1('0x1e')](_0x3469ac)[_0x4cf1('0x15')](function(_0x2945b4){_0x158000(null,_0x2945b4?_0x2945b4['name']:![]);})[_0x4cf1('0x17')](function(_0x5bb535){_0x158000(_0x5bb535);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1f')]=function(_0x1b0ad4,_0x371fac){this[_0x4cf1('0x10')][_0x4cf1('0x20')](_0x1b0ad4)[_0x4cf1('0x15')](function(_0x326ca6){_0x371fac(null,_0x326ca6?_0x326ca6[_0x4cf1('0x16')]:![]);})[_0x4cf1('0x17')](function(_0x395f52){_0x371fac(_0x395f52);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x21')]=function(_0x4bcd78,_0x4498b5){var _0x1ccc90=this;this[_0x4cf1('0x10')][_0x4cf1('0x22')](_0x4bcd78)[_0x4cf1('0x15')](function(_0x27d360){_0x4498b5(null,_0x27d360?_0x1ccc90[_0x4cf1('0x23')](_0x27d360[_0x4cf1('0x24')]):![]);})[_0x4cf1('0x17')](function(_0x1e8dbf){_0x4498b5(_0x1e8dbf);});};AGIVertices[_0x4cf1('0x12')]['getMailAccount']=function(_0x18232e,_0x167da0){this['rpc'][_0x4cf1('0x25')](_0x18232e)[_0x4cf1('0x15')](function(_0x29f111){_0x167da0(null,_0x29f111?_0x29f111:![]);})[_0x4cf1('0x17')](function(_0x1fab26){_0x167da0(_0x1fab26);});};AGIVertices[_0x4cf1('0x12')]['sendMailMessage']=function(_0x3763f5,_0x59d7ae,_0x31758b){this[_0x4cf1('0x11')][_0x4cf1('0x26')](_0x3763f5,_0x59d7ae)[_0x4cf1('0x15')](function(){_0x31758b(null);})[_0x4cf1('0x17')](function(_0x5e298f){_0x31758b(_0x5e298f);});};AGIVertices[_0x4cf1('0x12')]['getIntervals']=function(_0x59ba8f,_0x47dd9b){this[_0x4cf1('0x10')][_0x4cf1('0x27')](_0x59ba8f)[_0x4cf1('0x15')](function(_0x3e938b){if(_0x3e938b){if(_0x3e938b[_0x4cf1('0x28')]){_0x47dd9b(null,[_0x3e938b[_0x4cf1('0x29')]]);}else{_0x47dd9b(null,_[_0x4cf1('0x2a')](_0x3e938b[_0x4cf1('0x2b')],'interval'));}}else{_0x47dd9b(null,![]);}})['catch'](function(_0x48d93a){_0x47dd9b(_0x48d93a);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x23')]=function(_0xb0d56a){return util[_0x4cf1('0x2c')](_0x4cf1('0x2d'),FILES_PATH,_0xb0d56a);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x2e')]=function(_0x576ef2,_0x102e1a,_0x6a0a06){odbc[_0x4cf1('0x2f')](_0x576ef2,function(_0x38637f){if(_0x38637f){logger[_0x4cf1('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x38637f);_0x6a0a06(_0x38637f);}else{logger['info'](_0x4cf1('0x31'));odbc[_0x4cf1('0x32')](_0x102e1a,function(_0x835dd6,_0x2ec283){if(_0x835dd6){logger[_0x4cf1('0x33')](_0x4cf1('0x34'),_0x102e1a);_0x6a0a06(_0x835dd6);}else{logger[_0x4cf1('0x33')]('Query\x20executed\x20correctly\x20%s',_0x102e1a);odbc[_0x4cf1('0x35')](function(_0x7c23a0){if(_0x7c23a0){logger[_0x4cf1('0x30')](_0x4cf1('0x36'),_0x7c23a0);}_0x6a0a06(null,_0x2ec283);});}});}});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x37')]=function(_0x483961,_0x5348f5){this[_0x4cf1('0x10')][_0x4cf1('0x38')](_0x483961)[_0x4cf1('0x15')](function(_0x45f90f){_0x5348f5(null,_0x45f90f?_0x45f90f:![]);})[_0x4cf1('0x17')](function(_0x43d336){_0x5348f5(_0x43d336);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x39')]=function(_0x29f7a5,_0x3cd153){this[_0x4cf1('0x10')]['createSmsMessage'](_0x29f7a5)[_0x4cf1('0x15')](function(_0x2f3f00){_0x3cd153(null,_0x2f3f00);})['catch'](function(_0x25f111){_0x3cd153(_0x25f111);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x3a')]=function(_0xc2b163,_0x2b2ee4,_0x5a4078){this[_0x4cf1('0x10')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x4cf1('0x3b')],'node':_0xc2b163[_0x4cf1('0x3c')],'application':_0xc2b163[_0x4cf1('0x3d')],'data':_0x2b2ee4||null,'project_name':this[_0x4cf1('0xf')][_0x4cf1('0x3e')],'callerid':this[_0x4cf1('0xf')][_0x4cf1('0x3f')]})[_0x4cf1('0x15')](function(_0x1567cb){if(_0x5a4078){_0x5a4078(null,_0x1567cb);}})[_0x4cf1('0x17')](function(_0x1defca){if(_0x5a4078){_0x5a4078(_0x1defca);}});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x40')]=function(_0x2133fe,_0xa90309,_0x20a5a2,_0x4986fc){this[_0x4cf1('0x10')][_0x4cf1('0x40')]({'uniqueid':this[_0x4cf1('0xf')][_0x4cf1('0x3b')],'callerid':this[_0x4cf1('0xf')][_0x4cf1('0x3f')],'calleridname':this[_0x4cf1('0xf')]['calleridname'],'context':this[_0x4cf1('0xf')]['context'],'extension':this[_0x4cf1('0xf')][_0x4cf1('0x41')],'priority':this[_0x4cf1('0xf')][_0x4cf1('0x42')],'accountcode':this[_0x4cf1('0xf')][_0x4cf1('0x43')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0x4cf1('0x3e')],'saveName':_0xa90309,'filename':_0x2133fe[_0x4cf1('0x44')]||_0xa90309,'savePath':_0x20a5a2})[_0x4cf1('0x15')](function(_0x58c3cd){_0x4986fc(null,_0x58c3cd);})[_0x4cf1('0x17')](function(_0x267036){_0x4986fc(_0x267036);});};AGIVertices['prototype'][_0x4cf1('0x45')]=function(_0x3e3e5d,_0x1f228b,_0xcef16d,_0x248fb3,_0x5b6fb5){this[_0x4cf1('0x10')][_0x4cf1('0x45')]({'uniqueid':this[_0x4cf1('0xf')][_0x4cf1('0x3b')],'body':_0x3e3e5d,'direction':_0x1f228b,'providerName':_0xcef16d,'providerResponse':_0x248fb3})[_0x4cf1('0x15')](function(_0x4f7adf){if(_0x5b6fb5){_0x5b6fb5(null,_0x4f7adf);}})[_0x4cf1('0x17')](function(_0x2c1811){if(_0x5b6fb5){_0x5b6fb5(_0x2c1811);}});};AGIVertices['prototype']['createCmContact']=function(_0x5ac7d2,_0x2eda02){this[_0x4cf1('0x10')][_0x4cf1('0x46')]({'firstName':_['isEmpty'](_0x5ac7d2[_0x4cf1('0x16')])||_[_0x4cf1('0x47')](_0x5ac7d2[_0x4cf1('0x16')])?'callback_'+Math[_0x4cf1('0x48')]():_0x5ac7d2[_0x4cf1('0x16')],'lastName':_[_0x4cf1('0x49')](_0x5ac7d2[_0x4cf1('0x4a')])||_['isNil'](_0x5ac7d2[_0x4cf1('0x4a')])?null:_0x5ac7d2[_0x4cf1('0x4a')],'phone':_0x5ac7d2['phone'],'ListId':_0x5ac7d2[_0x4cf1('0x4b')],'scheduledat':_0x5ac7d2[_0x4cf1('0x4c')],'callbackUniqueid':this[_0x4cf1('0xf')]['uniqueid'],'tags':_0x4cf1('0x4d'),'description':_0x4cf1('0x4e')+_0x5ac7d2[_0x4cf1('0x4c')][_0x4cf1('0x4f')](),'priority':_0x5ac7d2[_0x4cf1('0x50')]})[_0x4cf1('0x15')](function(_0x2d161f){_0x2eda02(null,_0x2d161f);})['catch'](function(_0x5bc4c9){_0x2eda02(_0x5bc4c9);});};AGIVertices[_0x4cf1('0x12')]['getPause']=function(_0x3d38c8,_0x39b15a){this[_0x4cf1('0x10')][_0x4cf1('0x51')](_0x3d38c8)[_0x4cf1('0x15')](function(_0x23938e){_0x39b15a(null,_0x23938e?_0x23938e[_0x4cf1('0x16')]:![]);})['catch'](function(_0x25b070){_0x39b15a(_0x25b070);});};AGIVertices[_0x4cf1('0x12')]['agentPause']=function(_0x38aa06,_0xa92bc0,_0xa56dc9){var _0x5a4872={'role':_0x4cf1('0x52')};_0x5a4872[_0x38aa06]=this[_0x4cf1('0xf')][_0x4cf1('0x3f')];this[_0x4cf1('0x10')]['agentPause'](_0x5a4872,_0xa92bc0,this['channel'][_0x4cf1('0x3b')])[_0x4cf1('0x15')](function(_0x514657){_0xa56dc9(null,_[_0x4cf1('0x47')](_0x514657)?![]:!![]);})[_0x4cf1('0x17')](function(_0x3f6973){logger['error'](_0x3f6973);_0xa56dc9(null,![]);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x53')]=function(_0x80fec5,_0x572091){var _0x14a7d6={'role':_0x4cf1('0x52')};_0x14a7d6[_0x80fec5]=this[_0x4cf1('0xf')][_0x4cf1('0x3f')];this['rpc'][_0x4cf1('0x53')](_0x14a7d6)['then'](function(_0x586662){_0x572091(null,_[_0x4cf1('0x47')](_0x586662)?![]:!![]);})[_0x4cf1('0x17')](function(_0x18cc9f){logger[_0x4cf1('0x30')](_0x18cc9f);_0x572091(null,![]);});};AGIVertices['prototype'][_0x4cf1('0x54')]=function(_0x1db02d,_0x35001f){var _0x4ca89f={'role':'agent'};_0x4ca89f[_0x1db02d]=this[_0x4cf1('0xf')][_0x4cf1('0x3f')];this['rpc'][_0x4cf1('0x54')](_0x4ca89f)['then'](function(_0x2f8d03){_0x35001f(null,_[_0x4cf1('0x47')](_0x2f8d03)?![]:!![]);})[_0x4cf1('0x17')](function(_0x163fea){logger[_0x4cf1('0x30')](_0x163fea);_0x35001f(null,![]);});};AGIVertices['prototype'][_0x4cf1('0x55')]=function(_0x40c37e,_0x283424){var _0x3f711e={'role':_0x4cf1('0x52')};_0x3f711e[_0x40c37e]=this['channel'][_0x4cf1('0x3f')];var _0x4d2977=_0x40c37e!='internal'?util[_0x4cf1('0x2c')](_0x4cf1('0x56'),_0x4cf1('0x57'),this['channel'][_0x4cf1('0x3f')]):undefined;this[_0x4cf1('0x10')][_0x4cf1('0x55')](_0x3f711e,_0x4d2977)[_0x4cf1('0x15')](function(_0x2a12c7){_0x283424(null,_[_0x4cf1('0x47')](_0x2a12c7)?![]:!![]);})[_0x4cf1('0x17')](function(_0x516862){logger[_0x4cf1('0x30')](_0x516862);_0x283424(null,![]);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x58')]=function(_0x5b19ec,_0x1e831f){sh[_0x4cf1('0x59')](_[_0x4cf1('0x5a')](_0x5b19ec),function(_0x191ee7,_0x48ec33){var _0x3d3c4f=_0x48ec33[_0x4cf1('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1e831f(null,_0x3d3c4f);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x4beb0d,_0x1b204f){scripts[_0x4cf1('0x5c')](_0x4beb0d[_0x4cf1('0x5d')],_0x4beb0d['google_cloud_tts_text_type']||'text',_0x4beb0d['text'],_0x4beb0d[_0x4cf1('0x5e')]||_0x4cf1('0x5f'),_0x4beb0d[_0x4cf1('0x60')]||_0x4cf1('0x61'),_0x4beb0d[_0x4cf1('0x62')]||_0x4cf1('0x63'))['then'](function(_0x123d5a){_0x1b204f(null,_0x123d5a);})['catch'](function(_0x4987e2){_0x1b204f(_0x4987e2);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x64')]=function(_0x15fc9e,_0x3bafc2){scripts['googleTTS'](_0x15fc9e['text'],_0x15fc9e['google_tts_language']||'en',0x1)['then'](function(_0xcf5d72){_0x3bafc2(null,_0xcf5d72);})[_0x4cf1('0x17')](function(_0x472086){_0x3bafc2(_0x472086);});};AGIVertices[_0x4cf1('0x12')]['restAPI']=function(_0x39c455,_0x21c22d){var _0x4ac9b6={'uri':_0x39c455['url'],'method':_0x39c455[_0x4cf1('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x39c455[_0x4cf1('0x66')])===_0x4cf1('0x67')&&parseInt(_0x39c455[_0x4cf1('0x66')])>=0x1?parseInt(_0x39c455[_0x4cf1('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x4cf1('0x68')]([_0x4cf1('0x69'),'PUT'],_0x4ac9b6['method'][_0x4cf1('0x6a')]())){try{_0x4ac9b6[_0x4cf1('0x6b')]=_0x39c455[_0x4cf1('0xc')]?JSON[_0x4cf1('0x6c')](_0x39c455[_0x4cf1('0xc')]):{};}catch(_0x5e5769){logger[_0x4cf1('0x30')](_0x4cf1('0x6d'),_0x5e5769);}}try{_0x4ac9b6['headers']=_0x39c455[_0x4cf1('0xb')]?JSON[_0x4cf1('0x6c')](_0x39c455[_0x4cf1('0xb')]):{};}catch(_0x1c1eb9){logger['error'](_0x4cf1('0x6e'),_0x1c1eb9);}if(_0x39c455[_0x4cf1('0x6f')]){try{var _0x64e59e=require(_0x39c455[_0x4cf1('0x6f')])[_0x4cf1('0x70')](this,_0x4ac9b6);_0x4ac9b6['uri']=Mustache[_0x4cf1('0x71')](_0x39c455[_0x4cf1('0x72')],_0x64e59e,{},['$$','$$']);if(_0x4ac9b6[_0x4cf1('0x73')]){_0x4ac9b6[_0x4cf1('0x73')]=JSON[_0x4cf1('0x6c')](Mustache[_0x4cf1('0x71')](JSON[_0x4cf1('0x74')](_0x4ac9b6[_0x4cf1('0x73')]),_0x64e59e,{},['$$','$$']));}if(_0x4ac9b6['body']){_0x4ac9b6['body']=JSON[_0x4cf1('0x6c')](Mustache[_0x4cf1('0x71')](JSON[_0x4cf1('0x74')](_0x4ac9b6[_0x4cf1('0x6b')]),_0x64e59e,{},['$$','$$']));}}catch(_0x4d1ce3){logger[_0x4cf1('0x30')](_0x4cf1('0x75'),_0x4d1ce3);}}rp(_0x4ac9b6)[_0x4cf1('0x15')](function(_0x250d1e){var _0x5b6053={'statusCode':_0x250d1e[_0x4cf1('0x76')]||0xc8,'statusMessage':_0x250d1e[_0x4cf1('0x77')]||'OK','headers':_0x250d1e['headers']||{},'body':_0x250d1e[_0x4cf1('0x6b')]||{}};_0x21c22d(null,_0x5b6053);})['catch'](function(_0x24bfbe){var _0x312dc2={'statusCode':_0x24bfbe['statusCode']||0x1f4,'statusMessage':_0x24bfbe[_0x4cf1('0x78')]||_0x4cf1('0x79'),'headers':_0x24bfbe[_0x4cf1('0x7a')]['headers']||{},'body':_0x24bfbe[_0x4cf1('0x7a')][_0x4cf1('0x6b')]||{}};_0x21c22d(null,_0x312dc2);});};AGIVertices[_0x4cf1('0x12')]['googleDialogflow']=function(_0x27338e,_0x2763b7){scripts[_0x4cf1('0x7b')](this[_0x4cf1('0xf')][_0x4cf1('0x3b')],_0x27338e[_0x4cf1('0x7c')],_0x27338e[_0x4cf1('0x7d')],_0x27338e[_0x4cf1('0x7e')]||'en')[_0x4cf1('0x15')](function(_0x3fabec){_0x2763b7(null,_0x3fabec);})[_0x4cf1('0x17')](function(_0x11b4cc){_0x2763b7(_0x11b4cc);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x4d5177,_0x56f963){scripts[_0x4cf1('0x7f')](this[_0x4cf1('0xf')][_0x4cf1('0x3b')],_0x4d5177[_0x4cf1('0x80')],_0x4d5177[_0x4cf1('0x81')],_0x4d5177[_0x4cf1('0x82')],_0x4d5177[_0x4cf1('0x7d')],_0x4d5177['dialogflowV2_language']||'en')[_0x4cf1('0x15')](function(_0x2ebe0a){_0x56f963(null,_0x2ebe0a);})[_0x4cf1('0x17')](function(_0x1023d2){_0x56f963(_0x1023d2);});};AGIVertices['prototype'][_0x4cf1('0x83')]=function(_0x1cde5e,_0x7822d4){scripts[_0x4cf1('0x83')](this[_0x4cf1('0xf')],_0x1cde5e)[_0x4cf1('0x15')](function(_0xd01710){_0x7822d4(null,_0xd01710);})[_0x4cf1('0x17')](function(_0x29ca5f){_0x7822d4(_0x29ca5f);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x84')]=function(_0x341ed9,_0x59bc13){scripts[_0x4cf1('0x84')](_0x341ed9[_0x4cf1('0x7c')],_0x341ed9['text'],_0x341ed9[_0x4cf1('0x85')]||_0x4cf1('0x5f'),_0x341ed9['speed'])[_0x4cf1('0x15')](function(_0x46bfa9){_0x59bc13(null,_0x46bfa9);})[_0x4cf1('0x17')](function(_0x3d9a48){_0x59bc13(_0x3d9a48);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x86')]=function(_0x109217,_0x43f97,_0x31622b){scripts[_0x4cf1('0x86')](_0x43f97,_0x109217[_0x4cf1('0x7c')],_0x109217['ispeech_asr_language']||_0x4cf1('0x5f'),this[_0x4cf1('0x87')](_0x109217[_0x4cf1('0x88')])?_0x109217[_0x4cf1('0x88')]:undefined)['then'](function(_0x3d6c3b){_0x31622b(null,_0x3d6c3b);})[_0x4cf1('0x17')](function(_0x1c6ee7){_0x31622b(_0x1c6ee7);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x89')]=function(_0x4e0bfd,_0xa4b2c1){scripts[_0x4cf1('0x89')](_0x4e0bfd[_0x4cf1('0x8a')],_0x4e0bfd[_0x4cf1('0x8b')],_0x4e0bfd['aws_polly_region'],_0x4e0bfd[_0x4cf1('0x8c')]||_0x4cf1('0x8d'),_0x4e0bfd['text'],_0x4e0bfd[_0x4cf1('0x8e')]||_0x4cf1('0x7d'))['then'](function(_0x24b423){_0xa4b2c1(null,_0x24b423);})[_0x4cf1('0x17')](function(_0x52d857){_0xa4b2c1(_0x52d857);});};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x8f')]=function(_0x57656f,_0x1248cb){scripts[_0x4cf1('0x8f')](this[_0x4cf1('0xf')][_0x4cf1('0x3b')],_0x57656f[_0x4cf1('0x8a')],_0x57656f[_0x4cf1('0x8b')],_0x57656f['aws_lex_region'],_0x57656f[_0x4cf1('0x7d')],_0x57656f[_0x4cf1('0x90')])[_0x4cf1('0x15')](function(_0x11e17a){_0x1248cb(null,_0x11e17a);})[_0x4cf1('0x17')](function(_0x193cbd){_0x1248cb(_0x193cbd);});};AGIVertices[_0x4cf1('0x12')]['googleASR']=function(_0x3aa868,_0x49138a,_0x144860){scripts['googleASR'](_0x49138a,_0x3aa868[_0x4cf1('0x7c')],_0x3aa868['google_asr_language']||'en-US')['then'](function(_0x78206b){_0x144860(null,_0x78206b);})[_0x4cf1('0x17')](function(_0x4758f5){_0x144860(_0x4758f5);});};AGIVertices[_0x4cf1('0x12')]['tildeASR']=function(_0x179a6d,_0x258337,_0x473185){scripts[_0x4cf1('0x91')](_0x258337,_0x179a6d[_0x4cf1('0x92')],_0x179a6d['appsecret'],_0x179a6d[_0x4cf1('0x93')])[_0x4cf1('0x15')](function(_0xbc50ed){_0x473185(null,_0xbc50ed);})[_0x4cf1('0x17')](function(_0x542b59){_0x473185(_0x542b59);});};AGIVertices[_0x4cf1('0x12')]['clear']=function(_0x1698ca){var _0x4e89af=_[_0x4cf1('0x68')](verticesWithRetry,_0x1698ca[_0x4cf1('0x3d')])?_0x1698ca:_[_0x4cf1('0x94')](_0x1698ca);for(var _0x3a97fb in _0x4e89af){if(_0x4e89af[_0x4cf1('0x95')](_0x3a97fb)){if(_0x4e89af[_0x3a97fb]&&_[_0x4cf1('0x96')](_0x4e89af[_0x3a97fb])){if(_[_0x4cf1('0x68')](recursiveMapAttributes,_0x3a97fb)){_0x4e89af[_0x3a97fb]=this[_0x4cf1('0x97')](_0x4e89af[_0x3a97fb]);}else{_0x4e89af[_0x3a97fb]=this[_0x4cf1('0x98')](_0x4e89af[_0x3a97fb]);}}}}return _0x4e89af;};AGIVertices['prototype'][_0x4cf1('0x99')]=function(_0x3ef1ae){for(var _0x2364b7 in _0x3ef1ae){if(_0x3ef1ae['hasOwnProperty'](_0x2364b7)){if(_[_0x4cf1('0x9a')](_0x3ef1ae[_0x2364b7])){this[_0x4cf1('0x99')](_0x3ef1ae[_0x2364b7]);}else if(_['isArray'](_0x3ef1ae[_0x2364b7])){for(var _0x44642f=0x0;_0x44642f<_0x3ef1ae[_0x2364b7][_0x4cf1('0x9b')];_0x44642f++){this[_0x4cf1('0x99')](_0x3ef1ae[_0x2364b7][_0x44642f]);}}else if(_[_0x4cf1('0x96')](_0x3ef1ae[_0x2364b7])){_0x3ef1ae[_0x2364b7]=this[_0x4cf1('0x98')](_0x3ef1ae[_0x2364b7]);}}}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x9c')]=function(_0x4b3517,_0x67af5){for(var _0xe5be65 in _0x4b3517){if(_0x4b3517['hasOwnProperty'](_0xe5be65)){if(_[_0x4cf1('0x9a')](_0x4b3517[_0xe5be65])){if(!_[_0x4cf1('0x49')](_0x4b3517[_0xe5be65])){this[_0x4cf1('0x9c')](_0x4b3517[_0xe5be65],util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x67af5,_0xe5be65));}}else if(_[_0x4cf1('0x9e')](_0x4b3517[_0xe5be65])){for(var _0xdab395=0x0;_0xdab395<_0x4b3517[_0xe5be65][_0x4cf1('0x9b')];_0xdab395++){this[_0x4cf1('0x9c')](_0x4b3517[_0xe5be65][_0xdab395],util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x67af5,_0xe5be65+'['+_0xdab395+']'));}}else{if(!_[_0x4cf1('0x47')](_0x4b3517[_0xe5be65])){this[_0x4cf1('0xf')]['setVariable'](util[_0x4cf1('0x2c')]('%s.%s',_0x67af5,_0xe5be65),_0x4b3517[_0xe5be65]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x55dcdb){try{var _0x114dbd=JSON[_0x4cf1('0x6c')](_0x55dcdb);this['recursiveNodeIndex'](_0x114dbd);return JSON['stringify'](_0x114dbd);}catch(_0x2ce56a){return this[_0x4cf1('0x98')](_0x55dcdb);}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x98')]=function(_0x5e325f){var _0x21c66f=_0x5e325f[_0x4cf1('0x9f')]('{');for(var _0x54b6fc=0x1;_0x54b6fc<_0x21c66f[_0x4cf1('0x9b')];_0x54b6fc+=0x1){var _0x109974=_0x21c66f[_0x54b6fc][_0x4cf1('0x9f')]('}');if(_0x109974[_0x4cf1('0x9b')]>0x1){_0x5e325f=_0x5e325f[_0x4cf1('0xa0')]('{'+_0x109974[0x0]+'}',this[_0x4cf1('0xf')][_0x4cf1('0x13')](_0x109974[0x0])[_0x4cf1('0xa1')]||_0x109974[0x0]);}}if(_0x21c66f[_0x4cf1('0x9b')]===0x1){return _0x5e325f['toString']();}return this['replaceAllVariables'](_0x5e325f);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xa2')]=function(_0x116912,_0xc4cd70){var _0x3a5f9c=this['channel'][_0x4cf1('0x13')](_0x116912);if(_0x3a5f9c[_0x4cf1('0xa3')]===-0x1){return _0x3a5f9c;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xc4cd70,_0x3a5f9c[_0x4cf1('0xa1')]));return this['channel'][_0x4cf1('0xa4')](_0xc4cd70,_0x3a5f9c[_0x4cf1('0xa1')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x87')]=function(_0x166348){return _0x166348&&_0x166348!=='0'&&_0x166348!=='-1'&&_0x166348!=='';};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xa5')]=function(_0x346744){this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x346744,'-');_0x346744[_0x4cf1('0xa6')]=_0x346744[_0x4cf1('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xa7')]=function(_0x4ef0ca){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x4ef0ca[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x4ef0ca[_0x4cf1('0x7d')])){return this['channel']['noop'](_0x4cf1('0xa8'));}var _0x5d2035='\x22'+_0x4ef0ca[_0x4cf1('0x7d')]+'\x22';if(this['isConfigured'](_0x4ef0ca['options'])){_0x5d2035+=','+_0x4ef0ca[_0x4cf1('0x7a')];}var _0x340bab=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xa9'),_0x5d2035);if(_0x340bab['result']===-0x1){return _0x340bab;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xab'),_0x5d2035));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xac')]=function(_0x553888){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x553888[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x553888['grammar'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20grammar\x20configured');}var _0x33de3d=_0x553888[_0x4cf1('0xad')];if(this[_0x4cf1('0x87')](_0x553888[_0x4cf1('0x7a')])){_0x33de3d+=','+_0x553888['options'];}var _0x527014=this[_0x4cf1('0xf')]['exec'](_0x4cf1('0xae'),_0x33de3d);if(_0x527014[_0x4cf1('0xa3')]===-0x1){return _0x527014;}var _0x54ff20=this[_0x4cf1('0xa2')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x54ff20[_0x4cf1('0xa3')]===-0x1){return _0x54ff20;}var _0x1bad47=this[_0x4cf1('0xa2')](_0x4cf1('0xaf'),_0x4cf1('0xb0'));if(_0x1bad47['result']===-0x1){return _0x1bad47;}var _0x10a502=this[_0x4cf1('0xa2')]('RECOG_INSTANCE()',_0x4cf1('0xb1'));if(_0x10a502[_0x4cf1('0xa3')]===-0x1){return _0x10a502;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xb2'),_0x33de3d));};AGIVertices[_0x4cf1('0x12')]['agi']=function(_0x5adb0d){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0xb3'),_0x5adb0d[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0xb4')]([_0x5adb0d[_0x4cf1('0xb5')],_0x5adb0d[_0x4cf1('0xb6')]]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xb7')]=function(_0x2e31f1){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xb8'),_0x2e31f1[_0x4cf1('0x3c')]));if(this[_0x4cf1('0x87')](_0x2e31f1['timeout'])){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2e31f1['timeout']));var _0x63bfc8=this[_0x4cf1('0xf')][_0x4cf1('0xb9')](_0x2e31f1['timeout']);if(_0x63bfc8['result']===-0x1){return _0x63bfc8;}}return this['channel']['answer']();};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x4d')]=function(_0x48c001){logger[_0x4cf1('0x33')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x48c001[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x48c001[_0x4cf1('0x4b')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x48c001,_0x4cf1('0xba'));}_0x48c001[_0x4cf1('0x4c')]=moment();if(this['isConfigured'](_0x48c001['delay'])){_0x48c001[_0x4cf1('0x4c')]=moment()[_0x4cf1('0xbb')](_0x48c001[_0x4cf1('0xbc')],'minutes');}if(!this['isConfigured'](_0x48c001['callback_priority'])){_0x48c001[_0x4cf1('0x50')]=0x2;}this['createCmContact'][_0x4cf1('0x70')](this,_0x48c001);return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x48c001[_0x4cf1('0xbd')],_0x48c001[_0x4cf1('0x4b')],_0x48c001[_0x4cf1('0x4c')]));};AGIVertices[_0x4cf1('0x12')]['custom_app']=function(_0x445d3e){logger['info'](util['format'](_0x4cf1('0xbe'),_0x445d3e['label']));var _0x21ca4f=this['channel']['exec'](_0x445d3e[_0x4cf1('0xbf')],_0x445d3e[_0x4cf1('0x7a')]);if(_0x21ca4f[_0x4cf1('0xa3')]===-0x1){return _0x21ca4f;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0xc0'),_0x445d3e[_0x4cf1('0xbf')],_0x445d3e['options']));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xc1')]=function(_0x3a3be9){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3a3be9[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x3a3be9[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}var _0x28df1f='\x22'+_0x3a3be9['text']+'\x22';if(this['isConfigured'](_0x3a3be9[_0x4cf1('0x7a')])){_0x28df1f+=','+_0x3a3be9[_0x4cf1('0x7a')];}var _0x371b58=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xa9'),_0x28df1f);if(_0x371b58['result']===-0x1){return _0x371b58;}return this['channel'][_0x4cf1('0xaa')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x28df1f));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xc2')]=function(_0x39c80f){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x39c80f[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x39c80f[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20text\x20configured');}var _0x4b7a38='\x22'+_0x39c80f['text']+'\x22';if(this[_0x4cf1('0x87')](_0x39c80f[_0x4cf1('0x7a')])){_0x4b7a38+=','+_0x39c80f[_0x4cf1('0x7a')];}var _0xd1b0a2=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xa9'),_0x4b7a38);if(_0xd1b0a2[_0x4cf1('0xa3')]===-0x1){return _0xd1b0a2;}return this[_0x4cf1('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4b7a38));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xc3')]=function(_0x83c73e){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xc4'),_0x83c73e[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x83c73e['grammar'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xc5'));}var _0x493078=_0x83c73e[_0x4cf1('0xad')];if(this[_0x4cf1('0x87')](_0x83c73e[_0x4cf1('0x7a')])){_0x493078+=','+_0x83c73e[_0x4cf1('0x7a')];}var _0x14206b=this['channel'][_0x4cf1('0x59')](_0x4cf1('0xae'),_0x493078);if(_0x14206b[_0x4cf1('0xa3')]===-0x1){return _0x14206b;}var _0x2f084a=this[_0x4cf1('0xa2')]('RECOG_CONFIDENCE()',_0x4cf1('0xc6'));if(_0x2f084a[_0x4cf1('0xa3')]===-0x1){return _0x2f084a;}var _0x1561f5=this[_0x4cf1('0xa2')](_0x4cf1('0xaf'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x1561f5[_0x4cf1('0xa3')]===-0x1){return _0x1561f5;}var _0x4a00cb=this[_0x4cf1('0xa2')](_0x4cf1('0xc7'),'LUMENVOX_ASR_INSTANCE');if(_0x4a00cb[_0x4cf1('0xa3')]===-0x1){return _0x4a00cb;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xb2'),_0x493078));};AGIVertices['prototype'][_0x4cf1('0xc8')]=function(_0x26db70){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xc9'),_0x26db70[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x26db70['grammar'])){return this[_0x4cf1('0xf')]['noop']('no\x20grammar\x20configured');}var _0x34ba89=_0x26db70['grammar'];if(this['isConfigured'](_0x26db70['options'])){_0x34ba89+=','+_0x26db70['options'];}var _0x59e46c=this[_0x4cf1('0xf')][_0x4cf1('0x59')]('MRCPRecog',_0x34ba89);if(_0x59e46c['result']===-0x1){return _0x59e46c;}var _0x240ca4=this[_0x4cf1('0xa2')](_0x4cf1('0xca'),_0x4cf1('0xcb'));if(_0x240ca4[_0x4cf1('0xa3')]===-0x1){return _0x240ca4;}var _0x1bd248=this[_0x4cf1('0xa2')](_0x4cf1('0xaf'),_0x4cf1('0xcc'));if(_0x1bd248[_0x4cf1('0xa3')]===-0x1){return _0x1bd248;}var _0x3def7f=this['getAndSetVariable'](_0x4cf1('0xc7'),_0x4cf1('0xcd'));if(_0x3def7f[_0x4cf1('0xa3')]===-0x1){return _0x3def7f;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xb2'),_0x34ba89));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xce')]=function(_0x563a03){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0xcf'),_0x563a03['label']));if(!this['isConfigured'](_0x563a03['odbc_id'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,_0x4cf1('0xd0'));}var _0x4b8d38=this[_0x4cf1('0x1b')]['sync'](this,_0x563a03[_0x4cf1('0xd1')]);if(!_0x4b8d38){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,_0x4cf1('0xd2'));}if(!this['isConfigured'](_0x563a03[_0x4cf1('0x32')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,_0x4cf1('0xd3'));}var _0x1f62d9=_0x563a03['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x4cf1('0xaa')](util['format'](_0x4cf1('0xd4'),_0x1f62d9));var _0x2dd478=this[_0x4cf1('0x2e')]['sync'](this,_0x4b8d38,_0x1f62d9);this[_0x4cf1('0x3a')]['sync'](this,_0x563a03,_0x1f62d9);if(!this[_0x4cf1('0x87')](_0x563a03[_0x4cf1('0xd5')])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xd6'));}var _0x2ed787=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x563a03[_0x4cf1('0xd5')]);if(!_0x2ed787){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x563a03,'no\x20variable\x20found');}var _0x269b82=this;_0x2dd478[_0x4cf1('0xd7')](function(_0x122204,_0x570d5a){Object['keys'](_0x122204)[_0x4cf1('0xd7')](function(_0x5ccf9c){_0x269b82['channel'][_0x4cf1('0xa4')](util['format'](_0x4cf1('0xd8'),_0x2ed787,_0x570d5a,_0x5ccf9c),_0x122204[_0x5ccf9c]);});});this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('%s_ROWS_COUNT',_0x2ed787),_0x2dd478[_0x4cf1('0x9b')]);return this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')]('variable\x20%s\x20set',_0x2ed787));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xd9')]=function(_0x4c82f3){logger['debug'](util[_0x4cf1('0x2c')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x4c82f3['label']));if(!this[_0x4cf1('0x87')](_0x4c82f3[_0x4cf1('0xda')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4c82f3,_0x4cf1('0xdb'));}var _0x3661f6=this[_0x4cf1('0xdc')]['sync'](this,_0x4c82f3[_0x4cf1('0xda')]);if(!_0x3661f6){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4c82f3,_0x4cf1('0xdd'));}var _0x5c1c23=this['channel']['exec'](_0x4cf1('0xde'),[util[_0x4cf1('0x2c')]('SIP/%s',_0x3661f6),_0x4c82f3[_0x4cf1('0x66')],_0x4c82f3['opts'],_0x4c82f3[_0x4cf1('0x72')]]);if(_0x5c1c23[_0x4cf1('0xa3')]===-0x1){return _0x5c1c23;}return this[_0x4cf1('0xf')]['noop'](util['format'](_0x4cf1('0xdf'),_0x4cf1('0xde')));};AGIVertices[_0x4cf1('0x12')]['dialogflow']=function(_0x5c3966){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5c3966[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x5c3966[_0x4cf1('0x7c')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xe0'));}if(!this[_0x4cf1('0x87')](_0x5c3966[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20text\x20configured');}this[_0x4cf1('0xf')]['bot']=!![];this[_0x4cf1('0x3a')](_0x5c3966);this[_0x4cf1('0x45')](_0x5c3966[_0x4cf1('0x7d')],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Trying\x20Dialogflow:\x20%s',_0x5c3966[_0x4cf1('0x7d')]));var _0x5af9e1=this[_0x4cf1('0x7b')][_0x4cf1('0x70')](this,_0x5c3966);if(_0x5af9e1){for(var _0x5152ee in _0x5af9e1){if(_0x5af9e1[_0x4cf1('0x95')](_0x5152ee)){this['channel']['setVariable'](util[_0x4cf1('0x2c')](_0x4cf1('0xe1'),_0x5152ee[_0x4cf1('0x6a')]()),_0x5af9e1[_0x5152ee]);}}this[_0x4cf1('0x45')](_0x5af9e1[_0x4cf1('0xe2')],_0x4cf1('0xe3'),'dialogflow','');return this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xe4'),_0x5af9e1[_0x4cf1('0xe2')]));}return this[_0x4cf1('0xf')]['error'](_0x5c3966,_0x4cf1('0xe5'));};AGIVertices[_0x4cf1('0x12')]['dialogflowV2']=function(_0x1c11e8){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0xe6'),_0x1c11e8[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x1c11e8[_0x4cf1('0x80')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xe7'));}if(!this[_0x4cf1('0x87')](_0x1c11e8['client_email'])){return this['channel'][_0x4cf1('0xaa')]('no\x20client_email\x20configured');}if(!this[_0x4cf1('0x87')](_0x1c11e8['private_key'])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xe8'));}if(!this[_0x4cf1('0x87')](_0x1c11e8[_0x4cf1('0xe9')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20anguage\x20configured');}if(!this[_0x4cf1('0x87')](_0x1c11e8['text'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')][_0x4cf1('0xea')]=!![];this[_0x4cf1('0x3a')](_0x1c11e8);this['createSquareMessage'](_0x1c11e8[_0x4cf1('0x7d')],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xeb'),_0x1c11e8[_0x4cf1('0x7d')]));var _0x723ce7=this[_0x4cf1('0x7f')]['sync'](this,_0x1c11e8);if(_0x723ce7){for(var _0x250fab in _0x723ce7){if(_0x723ce7['hasOwnProperty'](_0x250fab)){if(_0x250fab!==_0x4cf1('0xec')){this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('DIALOGFLOW_%s',_0x250fab['toUpperCase']()),_0x723ce7[_0x250fab]);}}}this[_0x4cf1('0x45')](_0x723ce7['speech'],_0x4cf1('0xe3'),_0x4cf1('0xed'),_0x723ce7[_0x4cf1('0xec')]);return this['channel'][_0x4cf1('0xaa')](util['format']('DialogflowV2\x20Result\x20%s',_0x723ce7[_0x4cf1('0xe2')]));}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x1c11e8,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x4cf1('0x12')]['sesteknda']=function(_0x5453d0){logger[_0x4cf1('0x33')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5453d0['label']));if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xee')])){return this['channel'][_0x4cf1('0xaa')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xef')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xf0'));}if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xf1')])){return this[_0x4cf1('0xf')]['noop'](_0x4cf1('0xf2'));}if(!this[_0x4cf1('0x87')](_0x5453d0[_0x4cf1('0xf3')])){return this['channel'][_0x4cf1('0xaa')]('no\x20text\x20configured');}this[_0x4cf1('0xf')][_0x4cf1('0xea')]=!![];this[_0x4cf1('0x3a')](_0x5453d0);this[_0x4cf1('0x45')](_0x5453d0['text'],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0xf4'),_0x5453d0[_0x4cf1('0x7d')]));var _0x57e2a4=this['sestekNDA']['sync'](this,_0x5453d0);if(_0x57e2a4){for(var _0x1783ee in _0x57e2a4){if(_0x57e2a4['hasOwnProperty'](_0x1783ee)){this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('SESTEK_NDA_%s',_0x1783ee[_0x4cf1('0x6a')]()),_0x57e2a4[_0x1783ee]);}}this[_0x4cf1('0x45')](_0x57e2a4[_0x4cf1('0xe2')],_0x4cf1('0xe3'),'sesteknda','');if(_0x57e2a4[_0x4cf1('0xf5')]){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xf6'),_0x57e2a4['audiofile']));var _0x42ef0a=this['channel'][_0x4cf1('0xf7')](_0x57e2a4[_0x4cf1('0xf5')]);try{fs[_0x4cf1('0xf8')](_0x57e2a4[_0x4cf1('0xf5')]+'.wav');}catch(_0x22d4d4){logger[_0x4cf1('0x30')](_0x22d4d4);}return _0x42ef0a;}else{return this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xf9'),_0x57e2a4[_0x4cf1('0xe2')]));}}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x5453d0,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xfa')]=function(_0x4736c2){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0xfb'),_0x4736c2['label']));return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xfa'));};AGIVertices[_0x4cf1('0x12')]['ext_dial']=function(_0x555703){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x555703[_0x4cf1('0x3c')]));var _0x3f93da='';if(_0x555703[_0x4cf1('0xfc')]){if(!this['isConfigured'](_0x555703['trunk_id'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x555703,_0x4cf1('0xfd'));}else{var _0x1e8383=parseInt(_0x555703['trunk_id'],0xa);if(isNaN(_0x1e8383)){_0x3f93da=_0x555703[_0x4cf1('0xfc')];}else{_0x3f93da=this[_0x4cf1('0x1f')][_0x4cf1('0x70')](this,_0x555703[_0x4cf1('0xfc')]);if(!_0x3f93da){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x555703,_0x4cf1('0xfe'));}}}}else if(_0x555703[_0x4cf1('0xff')]){_0x3f93da=_0x555703[_0x4cf1('0xff')];}else{return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x555703,_0x4cf1('0xfd'));}var _0x3b09f4=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0xde'),[util[_0x4cf1('0x2c')](_0x4cf1('0x100'),_0x3f93da,_0x555703[_0x4cf1('0xbd')]),_0x555703[_0x4cf1('0x66')],_0x555703['opts'],_0x555703[_0x4cf1('0x72')]]);if(_0x3b09f4[_0x4cf1('0xa3')]===-0x1){return _0x3b09f4;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Executed\x20command\x20%s',_0x4cf1('0xde')));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x101')]=function(_0x15df3b){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x102'),_0x15df3b[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')]['noop'](_0x4cf1('0x101'));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x103')]=function(_0x50cec7){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x104'),_0x50cec7[_0x4cf1('0x3c')]));if(_0x50cec7[_0x4cf1('0xa6')]===0x0){return this['maxRetry'](_0x50cec7);}_0x50cec7['retry']-=0x1;if(!this[_0x4cf1('0x87')](_0x50cec7[_0x4cf1('0x105')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x50cec7,'no\x20file\x20audio\x20selected');}var _0x23b64e=this[_0x4cf1('0x21')]['sync'](this,_0x50cec7[_0x4cf1('0x105')]);if(!_0x23b64e){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x50cec7,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x50cec7[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4cf1('0xd6'));}var _0x5119e9=this[_0x4cf1('0xf')]['getData'](_0x23b64e,_0x50cec7['response'],_0x50cec7[_0x4cf1('0x106')]);var _0x2e904a=_0x5119e9['result']?_0x5119e9[_0x4cf1('0xa3')]['toString']():'';logger['info'](_0x4cf1('0x107'),JSON[_0x4cf1('0x74')](_0x5119e9));if(_0x5119e9[_0x4cf1('0xa3')]===-0x1){this[_0x4cf1('0x3a')]['sync'](this,_0x50cec7,_0x2e904a);return _0x5119e9;}else if(_0x5119e9['extra']===_0x4cf1('0x66')){_0x5119e9[_0x4cf1('0xa3')]=_0x2e904a[_0x4cf1('0x9b')]>=parseInt(_0x50cec7['mindigit'])?'x':'i';}else{_0x5119e9[_0x4cf1('0xa3')]=_0x2e904a[_0x4cf1('0x9b')]>=parseInt(_0x50cec7[_0x4cf1('0x108')])&&_0x2e904a[_0x4cf1('0x9b')]<=parseInt(_0x50cec7[_0x4cf1('0x106')])?'x':'i';}var _0x186e45=this['getVariable'][_0x4cf1('0x70')](this,_0x50cec7['variable_id']);if(!_0x186e45){return this['channel'][_0x4cf1('0x30')](_0x50cec7,_0x4cf1('0x109'));}this[_0x4cf1('0xf')]['setVariable'](_0x186e45,_0x2e904a);if(this[_0x4cf1('0x87')](_0x50cec7[_0x4cf1('0x10a')])){var _0x26771e=parseInt(_0x50cec7[_0x4cf1('0x10a')],0xa);var _0x581f1b=rs['generate']({'charset':'*','length':_0x26771e});var _0x270cd1=_0x2e904a[_0x4cf1('0x9b')];if(_0x270cd1>0x0){if(_0x270cd1>_0x26771e){this['createSquareDetailsReport'][_0x4cf1('0x70')](this,_0x50cec7,_0x50cec7['hiddendigitspos']===_0x4cf1('0x10b')?_0x581f1b+_0x2e904a[_0x4cf1('0x10c')](_0x26771e):_0x2e904a[_0x4cf1('0x10c')](0x0,_0x270cd1-_0x26771e)+_0x581f1b);}else{this['createSquareDetailsReport'][_0x4cf1('0x70')](this,_0x50cec7,rs[_0x4cf1('0x10d')]({'charset':'*','length':_0x270cd1}));}}else{this['createSquareDetailsReport']['sync'](this,_0x50cec7,'');}}else{this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x50cec7,_0x2e904a);}return _0x5119e9;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xe')]=function(_0x9632b5){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x10e'),_0x9632b5[_0x4cf1('0x3c')]));return this[_0x4cf1('0x103')](_0x9632b5);};AGIVertices['prototype'][_0x4cf1('0x10f')]=function(_0x514661){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x110'),_0x514661[_0x4cf1('0x3c')]));this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x514661,_0x514661[_0x4cf1('0x111')]);return this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x112'),_0x514661[_0x4cf1('0x111')]));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x113')]=function(_0x2c400a){logger['info'](util[_0x4cf1('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2c400a[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x2c400a[_0x4cf1('0x8a')])||!this[_0x4cf1('0x87')](_0x2c400a[_0x4cf1('0x8b')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x2c400a[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x114'),_0x2c400a[_0x4cf1('0x7d')]));var _0x5e77ad=this[_0x4cf1('0x89')][_0x4cf1('0x70')](this,_0x2c400a);if(_0x5e77ad){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x115'),_0x5e77ad));var _0x42e99e=this[_0x4cf1('0xf')][_0x4cf1('0xf7')](_0x5e77ad);try{fs[_0x4cf1('0xf8')](_0x5e77ad+_0x4cf1('0x116'));}catch(_0x28341d){logger[_0x4cf1('0x30')](_0x28341d);}return _0x42e99e;}return this[_0x4cf1('0xf')]['error'](_0x2c400a,_0x4cf1('0x117'));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x118')]=function(_0xa244bf){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x119'),_0xa244bf[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0xa244bf[_0x4cf1('0x8a')])||!this[_0x4cf1('0x87')](_0xa244bf[_0x4cf1('0x8b')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4cf1('0x87')](_0xa244bf[_0x4cf1('0x90')])){return this['channel']['noop'](_0x4cf1('0x11a'));}if(!this[_0x4cf1('0x87')](_0xa244bf['text'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20text\x20configured');}this[_0x4cf1('0xf')][_0x4cf1('0xea')]=!![];this[_0x4cf1('0x3a')](_0xa244bf);this[_0x4cf1('0x45')](_0xa244bf[_0x4cf1('0x7d')],'in','','');this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Trying\x20Amazon\x20Lex:\x20%s',_0xa244bf[_0x4cf1('0x7d')]));var _0x16a0b8=this[_0x4cf1('0x8f')][_0x4cf1('0x70')](this,_0xa244bf);if(_0x16a0b8){for(var _0x2e9e6a in _0x16a0b8){if(_0x16a0b8[_0x4cf1('0x95')](_0x2e9e6a)&&_[_0x4cf1('0x96')](_0x16a0b8[_0x2e9e6a])){this[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')](_0x4cf1('0x11b'),_0x2e9e6a[_0x4cf1('0x6a')]()),_0x16a0b8[_0x2e9e6a]);}}if(_['isNil'](_0x16a0b8[_0x4cf1('0x78')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x11c'));}else{this[_0x4cf1('0x45')](_0x16a0b8[_0x4cf1('0x78')],_0x4cf1('0xe3'),_0x4cf1('0x11d'),'');return this[_0x4cf1('0xf')]['noop'](util['format'](_0x4cf1('0x11e'),_0x16a0b8[_0x4cf1('0x78')]));}}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0xa244bf,_0x4cf1('0x11f'));};AGIVertices['prototype'][_0x4cf1('0x120')]=function(_0x445dfd){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x121'),_0x445dfd['label'],_0x445dfd[_0x4cf1('0x66')]));if(!this['isConfigured'](_0x445dfd['key'])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0xe0'));}var _0x39230d='wav';var _0x1964a9=util['format'](_0x4cf1('0x122'),FILES_PATH,rs[_0x4cf1('0x10d')](0x4));var _0x488c0e=util['format'](_0x4cf1('0x9d'),_0x1964a9,_0x39230d);var _0x278fa8=!![];if(_0x445dfd[_0x4cf1('0x123')]===_0x4cf1('0x124')){_0x278fa8=![];}var _0x225429=this[_0x4cf1('0xf')][_0x4cf1('0x125')](_0x1964a9,_0x39230d,_0x445dfd['intKey'],_0x445dfd[_0x4cf1('0x66')],undefined,_0x278fa8);if(_0x225429['result']!==-0x1){this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x126'),_0x488c0e));var _0x1e3800=this[_0x4cf1('0x127')][_0x4cf1('0x70')](this,_0x445dfd,_0x488c0e);if(_0x1e3800){for(var _0xcd7445 in _0x1e3800){if(_0x1e3800[_0x4cf1('0x95')](_0xcd7445)){this[_0x4cf1('0xf')]['setVariable'](util[_0x4cf1('0x2c')](_0x4cf1('0x128'),_0xcd7445[_0x4cf1('0x6a')]()),_0x1e3800[_0xcd7445]);}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x129'),JSON[_0x4cf1('0x74')](_0x1e3800)));}}return _0x225429;};AGIVertices['prototype'][_0x4cf1('0x12a')]=function(_0x235a41){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x12b'),_0x235a41[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x235a41[_0x4cf1('0x92')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x12c'));}if(!this[_0x4cf1('0x87')](_0x235a41[_0x4cf1('0x12d')])){return this['channel'][_0x4cf1('0xaa')](_0x4cf1('0x12e'));}var _0x1afe1f=_0x4cf1('0x12f');var _0x2d69c1=util['format'](_0x4cf1('0x122'),FILES_PATH,rs[_0x4cf1('0x10d')](0x4));var _0x592612=util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x2d69c1,_0x1afe1f);var _0x274cea=!![];if(_0x235a41[_0x4cf1('0x123')]===_0x4cf1('0x124')){_0x274cea=![];}var _0x14304c=this[_0x4cf1('0xf')][_0x4cf1('0x125')](_0x2d69c1,_0x1afe1f,_0x235a41[_0x4cf1('0x130')],_0x235a41[_0x4cf1('0x66')],undefined,_0x274cea);if(_0x14304c[_0x4cf1('0xa3')]!==-0x1){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x131'),_0x592612));var _0x35c923=this[_0x4cf1('0x91')]['sync'](this,_0x235a41,_0x592612);if(_0x35c923){for(var _0x5092ef in _0x35c923){if(_0x35c923['hasOwnProperty'](_0x5092ef)){this['channel']['setVariable'](util[_0x4cf1('0x2c')]('TILDE_ASR_%s',_0x5092ef[_0x4cf1('0x6a')]()),_0x35c923[_0x5092ef]);}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x132'),JSON[_0x4cf1('0x74')](_0x35c923)));}}return _0x14304c;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x133')]=function(_0x198131){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x134'),_0x198131['label']));return this[_0x4cf1('0xf')]['continueAt'](_0x198131[_0x4cf1('0x135')],_0x198131[_0x4cf1('0x41')],_0x198131[_0x4cf1('0x42')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x136')]=function(_0x4d927a){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x137'),_0x4d927a[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x4d927a[_0x4cf1('0x138')])){return this[_0x4cf1('0xf')]['error'](_0x4d927a,'no\x20condition\x20configured');}try{var _0x68c8ca=eval(_0x4d927a[_0x4cf1('0x138')])?_0x4cf1('0x139'):_0x4cf1('0x13a');this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x13b'),_0x4d927a[_0x4cf1('0x138')],_0x68c8ca));return{'code':0xc8,'result':_0x68c8ca};}catch(_0x157b54){return{'code':0xc8,'result':_0x4cf1('0x13a')};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x13c')]=function(_0x14c9a3){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x13d'),_0x14c9a3[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x14c9a3[_0x4cf1('0x13e')])){return this[_0x4cf1('0xf')]['error'](_0x14c9a3,_0x4cf1('0x13f'));}var _0x13b306=this[_0x4cf1('0x140')]['sync'](this,_0x14c9a3['interval_id']);if(!_0x13b306){return this['channel']['error'](_0x14c9a3,_0x4cf1('0x141'));}for(var _0x1bcb41=0x0;_0x1bcb41<_0x13b306[_0x4cf1('0x9b')];_0x1bcb41+=0x1){var _0x5d9cd3=this[_0x4cf1('0xf')][_0x4cf1('0x13')](util[_0x4cf1('0x2c')]('IFTIME(%s?true:false)',_0x13b306[_0x1bcb41]));if(_0x5d9cd3[_0x4cf1('0xa3')]===-0x1){return _0x5d9cd3;}logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],_0x5d9cd3[_0x4cf1('0xa1')]));if(_0x5d9cd3[_0x4cf1('0xa1')]===_0x4cf1('0x139')){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],'true'));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],_0x4cf1('0x139')));return{'code':0xc8,'result':_0x4cf1('0x139')};}else{logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x142'),_0x13b306[_0x1bcb41],_0x4cf1('0x13a')));this['channel']['noop'](util['format']('IFTIME\x20%s\x20%s',_0x13b306[_0x1bcb41],_0x4cf1('0x13a')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x143')]=function(_0x132ccf){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x144'),_0x132ccf[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0x143')]();};AGIVertices[_0x4cf1('0x12')]['ispeechasr']=function(_0x30f93f){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x145'),_0x30f93f['label']));if(!this[_0x4cf1('0x87')](_0x30f93f[_0x4cf1('0x7c')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xe0'));}var _0x4a8c29=_0x4cf1('0x12f');var _0x1f64f7=util['format'](_0x4cf1('0x122'),FILES_PATH,rs['generate'](0x4));var _0x57395c=util[_0x4cf1('0x2c')](_0x4cf1('0x9d'),_0x1f64f7,_0x4a8c29);var _0x57f3bc=!![];if(_0x30f93f[_0x4cf1('0x123')]==='NOBEEP'){_0x57f3bc=![];}var _0xc0bca0=this['channel'][_0x4cf1('0x125')](_0x1f64f7,_0x4a8c29,_0x30f93f[_0x4cf1('0x130')],_0x30f93f[_0x4cf1('0x66')],undefined,_0x57f3bc);if(_0xc0bca0[_0x4cf1('0xa3')]!==-0x1){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x146'),_0x57395c));var _0x39bf85=this[_0x4cf1('0x86')][_0x4cf1('0x70')](this,_0x30f93f,_0x57395c);if(_0x39bf85){for(var _0x46b37f in _0x39bf85){if(_0x39bf85[_0x4cf1('0x95')](_0x46b37f)){this[_0x4cf1('0xf')]['setVariable'](util[_0x4cf1('0x2c')](_0x4cf1('0x147'),_0x46b37f[_0x4cf1('0x6a')]()),_0x39bf85[_0x46b37f]);}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x148'),JSON[_0x4cf1('0x74')](_0x39bf85)));}}return _0xc0bca0;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x149')]=function(_0x269639){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x14a'),_0x269639[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x269639[_0x4cf1('0x7c')])){return this[_0x4cf1('0xf')]['noop']('no\x20key\x20configured');}if(!this[_0x4cf1('0x87')](_0x269639[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x14b'),_0x269639[_0x4cf1('0x7d')]));var _0x2bafe6=this[_0x4cf1('0x84')][_0x4cf1('0x70')](this,_0x269639);if(_0x2bafe6){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('ispeech\x20%s\x20file\x20created',_0x2bafe6));var _0x420af2=this[_0x4cf1('0xf')]['streamFile'](_0x2bafe6,_0x269639['intKey']);try{fs[_0x4cf1('0xf8')](_0x2bafe6+_0x4cf1('0x116'));}catch(_0xc6aa79){logger[_0x4cf1('0x30')](_0xc6aa79);}return _0x420af2;}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x269639,_0x4cf1('0x14c'));};AGIVertices['prototype']['login']=function(_0x57f9dd){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x14d'),_0x57f9dd[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x57f9dd[_0x4cf1('0x14e')])){return this[_0x4cf1('0xf')]['error'](_0x57f9dd,_0x4cf1('0x14f'));}logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x150'),this[_0x4cf1('0xf')]['callerid'],_0x57f9dd['findBy']));var _0x29e6ad=this[_0x4cf1('0x55')][_0x4cf1('0x70')](this,_0x57f9dd['findBy']);if(_0x29e6ad){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd[_0x4cf1('0x14e')]));this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd[_0x4cf1('0x14e')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd['findBy']));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x57f9dd[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x153')};}};AGIVertices['prototype']['logout']=function(_0x5d6575){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x154'),_0x5d6575[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x5d6575[_0x4cf1('0x14e')])){return this['channel'][_0x4cf1('0x30')](_0x5d6575,_0x4cf1('0x14f'));}logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x150'),this[_0x4cf1('0xf')]['callerid'],_0x5d6575[_0x4cf1('0x14e')]));var _0x3bec9d=this[_0x4cf1('0x54')][_0x4cf1('0x70')](this,_0x5d6575[_0x4cf1('0x14e')]);if(_0x3bec9d){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x5d6575['findBy']));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this['channel']['callerid'],_0x5d6575[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x155')};}else{logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x152'),this['channel'][_0x4cf1('0x3f')],_0x5d6575[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x5d6575[_0x4cf1('0x14e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x156')]=function(_0x586c71){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x157'),_0x586c71[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x586c71[_0x4cf1('0x158')])){return this[_0x4cf1('0xf')]['error'](_0x586c71,_0x4cf1('0x159'));}this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x15a'),_0x586c71['operation']));var _0x59ba72=eval(_0x586c71[_0x4cf1('0x158')]);if(!this['isConfigured'](_0x586c71[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xd6'));}var _0x610921=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x586c71[_0x4cf1('0xd5')]);if(!_0x610921){return this[_0x4cf1('0xf')]['error'](_0x586c71,'no\x20variable\x20found');}if(_[_0x4cf1('0x9e')](_0x59ba72)){var _0x5c9d5e=this;_0x59ba72[_0x4cf1('0xd7')](function(_0x54c02f,_0x4ab2b1){_0x5c9d5e[_0x4cf1('0xf')][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')]('%s[%s]',_0x610921,_0x4ab2b1),_0x54c02f);});return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x15b'),_0x610921));}else{return this[_0x4cf1('0xf')][_0x4cf1('0xa4')](_0x610921,_0x59ba72);}};AGIVertices[_0x4cf1('0x12')]['menu']=function(_0x1037be){logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x15c'),_0x1037be[_0x4cf1('0x3c')]));if(_0x1037be[_0x4cf1('0xa6')]===0x0){return this[_0x4cf1('0xa5')](_0x1037be);}_0x1037be[_0x4cf1('0xa6')]-=0x1;if(!this[_0x4cf1('0x87')](_0x1037be[_0x4cf1('0x105')])){return this['channel'][_0x4cf1('0x30')](_0x1037be,_0x4cf1('0x15d'));}var _0x4ef0fc=this['getSound'][_0x4cf1('0x70')](this,_0x1037be[_0x4cf1('0x105')]);if(!_0x4ef0fc){return this[_0x4cf1('0xf')]['error'](_0x1037be,_0x4cf1('0x15e'));}var _0x239abf=this[_0x4cf1('0xf')]['getData'](_0x4ef0fc,_0x1037be[_0x4cf1('0x15f')],_0x1037be['digit']);var _0x52d02f=_0x239abf['result'];if(_0x239abf['result']===-0x1){this[_0x4cf1('0x3a')]['sync'](this,_0x1037be,'-1');return _0x239abf;}else if(_0x239abf[_0x4cf1('0xa1')]==='timeout'){_0x239abf['result']=_0x239abf[_0x4cf1('0xa3')]['length']>0x0?_0x239abf['result']:'t';}else if(_[_0x4cf1('0x49')](_0x239abf[_0x4cf1('0xa3')])){_0x239abf[_0x4cf1('0xa3')]='#';_0x52d02f='#';}if(!this[_0x4cf1('0x87')](_0x1037be[_0x4cf1('0xd5')])){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xd6'));}else{var _0x173ad8=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x1037be[_0x4cf1('0xd5')]);if(!_0x173ad8){return this[_0x4cf1('0xf')]['error'](_0x1037be,_0x4cf1('0x109'));}this[_0x4cf1('0xf')][_0x4cf1('0xa4')](_0x173ad8,_0x52d02f);}this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x1037be,_0x52d02f);return _0x239abf;};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0xaa')]=function(_0xbc33ef){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x160'),_0xbc33ef[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0xbc33ef[_0x4cf1('0x161')]||_0xbc33ef[_0x4cf1('0x3c')]);};AGIVertices['prototype'][_0x4cf1('0x162')]=function(_0x187c16){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x163'),_0x187c16['label']));if(!this[_0x4cf1('0x87')](_0x187c16['findBy'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x187c16,_0x4cf1('0x14f'));}logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x187c16[_0x4cf1('0x14e')]));var _0x57d7d8=this[_0x4cf1('0x164')][_0x4cf1('0x70')](this,_0x187c16[_0x4cf1('0x165')]);var _0x1b90c8=this[_0x4cf1('0x166')]['sync'](this,_0x187c16[_0x4cf1('0x14e')],_0x57d7d8);if(_0x1b90c8){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x187c16[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x187c16['findBy']));return{'code':0xc8,'result':_0x4cf1('0x155')};}else{logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x152'),this[_0x4cf1('0xf')]['callerid'],_0x187c16[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')]['callerid'],_0x187c16['findBy']));return{'code':0xc8,'result':_0x4cf1('0x153')};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x167')]=function(_0x4cde24){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4cde24[_0x4cf1('0x3c')]));if(!this['isConfigured'](_0x4cde24['file_id'])){return this[_0x4cf1('0xf')]['error'](_0x4cde24,'no\x20file\x20audio\x20selected');}var _0x479350=this[_0x4cf1('0x21')][_0x4cf1('0x70')](this,_0x4cde24[_0x4cf1('0x105')]);if(!_0x479350){return this['channel'][_0x4cf1('0x30')](_0x4cde24,_0x4cf1('0x15e'));}var _0x2796cb=this[_0x4cf1('0xf')][_0x4cf1('0x59')]('PLAYBACK',[_0x479350,_0x4cde24[_0x4cf1('0x168')]]);if(_0x2796cb[_0x4cf1('0xa3')]===-0x1){return _0x2796cb;}return this['channel']['noop'](util['format'](_0x4cf1('0xc0'),'PLAYBACK',_0x479350));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x169')]=function(_0x52bb1d){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x16a'),_0x52bb1d[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x52bb1d['queue_id'])){return this['channel'][_0x4cf1('0x30')](_0x52bb1d,_0x4cf1('0x16b'));}var _0xd07b15='';var _0xef405c=parseInt(_0x52bb1d['queue_id'],0xa);if(isNaN(_0xef405c)){_0xd07b15=_0x52bb1d[_0x4cf1('0x16c')];}else{_0xd07b15=this[_0x4cf1('0x18')]['sync'](this,_0x52bb1d[_0x4cf1('0x16c')]);if(!_0xd07b15){return this[_0x4cf1('0xf')]['error'](_0x52bb1d,_0x4cf1('0x16d'));}}var _0x542596='';if(this['isConfigured'](_0x52bb1d[_0x4cf1('0x105')])){var _0x1f8646=this[_0x4cf1('0x21')][_0x4cf1('0x70')](this,_0x52bb1d['file_id']);if(_0x1f8646){_0x542596=_0x1f8646;}}this[_0x4cf1('0x3a')]['sync'](this,_0x52bb1d,_0xd07b15);if(_0x52bb1d['opts'][_0x4cf1('0x16e')]('x')<0x0){_0x52bb1d['opts']+='x';}if(_0x52bb1d['opts'][_0x4cf1('0x16e')]('X')<0x0){_0x52bb1d[_0x4cf1('0x168')]+='X';}this[_0x4cf1('0xf')][_0x4cf1('0xa4')]('XMCS-QUEUE',_0xd07b15?_0xd07b15[_0x4cf1('0x16f')]():'');var _0x338730=this[_0x4cf1('0xf')][_0x4cf1('0x59')](_0x4cf1('0x170'),[_0xd07b15,_0x52bb1d[_0x4cf1('0x168')],_0x52bb1d[_0x4cf1('0x72')],_0x542596,_0x52bb1d[_0x4cf1('0x66')],_0x52bb1d[_0x4cf1('0xb4')],_0x52bb1d[_0x4cf1('0x171')],_0x52bb1d[_0x4cf1('0x172')],'',_0x52bb1d[_0x4cf1('0x173')]]);if(_0x338730[_0x4cf1('0xa3')]===-0x1){return _0x338730;}return this[_0x4cf1('0xf')]['noop'](util['format'](_0x4cf1('0xc0'),_0x4cf1('0x170'),_0xd07b15));};AGIVertices['prototype'][_0x4cf1('0x174')]=function(_0x3ec644){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x175'),_0x3ec644[_0x4cf1('0x3c')]));var _0x1fe4b7=_0x3ec644[_0x4cf1('0x176')]||_0x4cf1('0x12f');var _0x5cdf22=util['format'](_0x4cf1('0x177'),this[_0x4cf1('0xf')]['uniqueid'],rs['generate'](0x5));var _0x481631=util[_0x4cf1('0x2c')]('%s/recordings/%s.%s',FILES_PATH,_0x5cdf22,_0x1fe4b7);var _0x166d18=util[_0x4cf1('0x2c')](_0x4cf1('0x122'),FILES_PATH,_0x5cdf22);this[_0x4cf1('0x40')][_0x4cf1('0x70')](this,_0x3ec644,_0x5cdf22,_0x481631);this[_0x4cf1('0xf')][_0x4cf1('0xa4')]('RECORDING_SAVENAME',_0x5cdf22);logger[_0x4cf1('0x33')](_0x4cf1('0x178'),_0x166d18,_0x1fe4b7,_0x3ec644['escape_digits'],_0x3ec644[_0x4cf1('0x66')]);return this['channel']['recordFile'](_0x166d18,_0x1fe4b7,_0x3ec644[_0x4cf1('0x179')],_0x3ec644['timeout'],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x50d60c){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x50d60c[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x50d60c[_0x4cf1('0x72')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x17a'));}var _0x25fec4=this['restAPI']['sync'](this,_0x50d60c);logger['info'](util['format'](_0x4cf1('0x17b'),util[_0x4cf1('0x17c')](_0x25fec4,{'showHidden':![],'depth':null})));if(!this[_0x4cf1('0x87')](_0x50d60c[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')]['noop'](_0x4cf1('0x17d'));}var _0x290ed6=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x50d60c[_0x4cf1('0xd5')]);if(!_0x290ed6){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x50d60c,_0x4cf1('0x109'));}this['channel']['setVariable'](util['format'](_0x4cf1('0x17e'),_0x290ed6),_0x25fec4[_0x4cf1('0x76')]?_0x25fec4['statusCode']:_0x4cf1('0x17f'));this['channel'][_0x4cf1('0xa4')](util[_0x4cf1('0x2c')](_0x4cf1('0x180'),_0x290ed6),_0x25fec4[_0x4cf1('0x77')]?_0x25fec4[_0x4cf1('0x77')]:'OK');if(_0x25fec4[_0x4cf1('0x6b')]){try{this[_0x4cf1('0x9c')](_0x25fec4[_0x4cf1('0x6b')],_0x290ed6);}catch(_0x3de40c){logger['error'](util[_0x4cf1('0x2c')](_0x4cf1('0x181'),_0x290ed6));}}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x182'),_0x290ed6));};AGIVertices[_0x4cf1('0x12')]['saydigits']=function(_0x1f7fbb){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1f7fbb[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0x183')](_0x1f7fbb['digits'][_0x4cf1('0x5b')](/\s+/g,''),_0x1f7fbb['escape_digits']);};AGIVertices[_0x4cf1('0x12')]['saynumber']=function(_0x5d5ea1){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5d5ea1['label']));return this[_0x4cf1('0xf')][_0x4cf1('0x184')](_0x5d5ea1[_0x4cf1('0x67')][_0x4cf1('0x5b')](/\s+/g,''),_0x5d5ea1[_0x4cf1('0x179')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x185')]=function(_0x4f0830){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x186'),_0x4f0830[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')]['sayPhonetic'](_0x4f0830[_0x4cf1('0x7d')],_0x4f0830['escape_digits']);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x187')]=function(_0x23dd79){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x188'),_0x23dd79['label']));if(!this[_0x4cf1('0x87')](_0x23dd79['account_id'])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('no\x20mail\x20account\x20configured');}var _0x2bd837=this[_0x4cf1('0x189')]['sync'](this,_0x23dd79[_0x4cf1('0x18a')]);if(!_0x2bd837||!_0x2bd837[_0x4cf1('0x18b')]){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x23dd79,_0x4cf1('0x18c'));}var _0x560530={'from':util[_0x4cf1('0x2c')]('\x22%s\x22\x20<%s>',_0x2bd837['name'],_0x2bd837['email']||_0x2bd837[_0x4cf1('0x18b')]['user']),'to':_0x23dd79['to']||'','cc':_0x23dd79['cc']||'','bcc':_0x23dd79[_0x4cf1('0x18d')]||'','subject':_0x23dd79[_0x4cf1('0x18e')],'html':_0x23dd79['text'],'text':_0x23dd79[_0x4cf1('0x7d')]};if(this['isConfigured'](_0x23dd79[_0x4cf1('0x18f')])){}logger[_0x4cf1('0x190')](_0x4cf1('0x191'),JSON[_0x4cf1('0x74')](_0x560530));this['createSquareDetailsReport']['sync'](this,_0x23dd79,_0x23dd79[_0x4cf1('0x18a')]);this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x2bd837['name']));this[_0x4cf1('0x26')][_0x4cf1('0x70')](this,_0x2bd837[_0x4cf1('0x192')],_0x560530);return this[_0x4cf1('0xf')][_0x4cf1('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x193')]=function(_0x132be7){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x194'),_0x132be7[_0x4cf1('0x3c')]));return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x195'));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x196')]=function(_0x899e6e){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x899e6e['label']));if(!this[_0x4cf1('0x87')](_0x899e6e[_0x4cf1('0x197')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x198'));}var _0x133943=this[_0x4cf1('0x37')]['sync'](this,_0x899e6e[_0x4cf1('0x197')]);if(!_0x133943){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x899e6e,'no\x20sms\x20account\x20found');}var _0x2ad23f={'body':_0x899e6e[_0x4cf1('0x199')],'phone':_0x899e6e['to']||'','SmsAccountId':_0x133943['id']};logger[_0x4cf1('0x190')](_0x4cf1('0x19a'),JSON[_0x4cf1('0x74')](_0x2ad23f));this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x899e6e,_0x899e6e['sms_account_id']);this['channel'][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x19b'),_0x133943['name']));this['createSmsMessage'][_0x4cf1('0x70')](this,_0x2ad23f);return this[_0x4cf1('0xf')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['set']=function(_0x5e0731){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x19c'),_0x5e0731[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x5e0731[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')]['error'](_0x5e0731,'no\x20variable\x20selected');}var _0x118fdc=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x5e0731[_0x4cf1('0xd5')]);if(!_0x118fdc){return this[_0x4cf1('0xf')]['error'](_0x5e0731,_0x4cf1('0x109'));}return this[_0x4cf1('0xf')][_0x4cf1('0xa4')](_0x118fdc,_0x5e0731[_0x4cf1('0x19d')]);};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x19e')]=function(_0x26fe36){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x19f'),_0x26fe36['label']));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0x1a0'));if(_0x26fe36[_0x4cf1('0xb7')]==='yes'){this[_0x4cf1('0xf')]['noop']('Answer');return this[_0x4cf1('0xf')][_0x4cf1('0xb7')]();}return this[_0x4cf1('0xf')]['noop']('Skipped\x20Answer');};AGIVertices['prototype']['subproject']=function(_0x2b12d1){logger[_0x4cf1('0x33')](util['format'](_0x4cf1('0x1a1'),_0x2b12d1[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x2b12d1[_0x4cf1('0x1a2')])){return this['channel']['error'](_0x2b12d1,_0x4cf1('0x1a3'));}var _0x17516a=this['getSquareProject'][_0x4cf1('0x70')](this,_0x2b12d1[_0x4cf1('0x1a2')]);if(!this[_0x4cf1('0x87')](_0x17516a)){return this[_0x4cf1('0xf')]['error'](_0x2b12d1,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2b12d1['project_id']));}if(_0x17516a===this[_0x4cf1('0xf')][_0x4cf1('0x3e')]){return this['channel']['error'](_0x2b12d1,_0x4cf1('0x1a4'));}this[_0x4cf1('0x3a')][_0x4cf1('0x70')](this,_0x2b12d1,_0x17516a);var _0x38983a=this[_0x4cf1('0xf')]['exec'](_0x4cf1('0x1a5'),util[_0x4cf1('0x2c')](_0x4cf1('0x1a6'),config[_0x4cf1('0xb4')][_0x4cf1('0x1a7')]||_0x4cf1('0x1a8'),_0x17516a,this['channel'][_0x4cf1('0x3e')]));if(_0x38983a[_0x4cf1('0xa3')]===-0x1){return _0x38983a;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xc0'),_0x4cf1('0x1a5'),_0x17516a));};AGIVertices[_0x4cf1('0x12')]['system']=function(_0x19a163){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x1a9'),_0x19a163[_0x4cf1('0x3c')]));var _0xc7c1ca=this[_0x4cf1('0x58')]['sync'](this,_0x19a163[_0x4cf1('0xb5')]);this[_0x4cf1('0x3a')]['sync'](this,_0x19a163,_0x19a163['command']);if(this[_0x4cf1('0x87')](_0x19a163[_0x4cf1('0xd5')])){var _0x5065cb=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x19a163['variable_id']);if(_0x5065cb){this['channel'][_0x4cf1('0xa4')](_0x5065cb,_0xc7c1ca);return this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x1aa'),_0x19a163[_0x4cf1('0xb5')],_0x5065cb));}}return this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x1ab'),_0x19a163[_0x4cf1('0xb5')]));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1ac')]=function(_0x552a57){logger['info'](util[_0x4cf1('0x2c')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x552a57[_0x4cf1('0x3c')]));_0x552a57[_0x4cf1('0x7d')]=_0x552a57[_0x4cf1('0x7d')][_0x4cf1('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x552a57[_0x4cf1('0x5d')])){return this['channel'][_0x4cf1('0xaa')]('no\x20apiKey\x20configured');}if(!this[_0x4cf1('0x87')](_0x552a57[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x1ad'),_0x552a57[_0x4cf1('0x7d')]));var _0x23ab71=this[_0x4cf1('0x5c')][_0x4cf1('0x70')](this,_0x552a57);if(_0x23ab71){this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x1ae'),_0x23ab71));var _0x5642a1=this[_0x4cf1('0xf')][_0x4cf1('0xf7')](_0x23ab71);try{fs[_0x4cf1('0xf8')](_0x23ab71+_0x4cf1('0x116'));}catch(_0x42a96d){logger[_0x4cf1('0x30')](_0x42a96d);}return _0x5642a1;}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x552a57,_0x4cf1('0x1af'));};AGIVertices[_0x4cf1('0x12')]['tts']=function(_0x4bfab2){logger['info'](util[_0x4cf1('0x2c')](_0x4cf1('0x1b0'),_0x4bfab2[_0x4cf1('0x3c')]));_0x4bfab2[_0x4cf1('0x7d')]=_0x4bfab2[_0x4cf1('0x7d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4cf1('0x87')](_0x4bfab2[_0x4cf1('0x7d')])){return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](_0x4cf1('0xa8'));}this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x1b1'),_0x4bfab2[_0x4cf1('0x7d')]));var _0x3a6522=this['googleTTS']['sync'](this,_0x4bfab2);if(_0x3a6522){this['channel'][_0x4cf1('0xaa')](util['format'](_0x4cf1('0x1b2'),_0x3a6522));var _0x23384c=this['channel']['streamFile'](_0x3a6522);try{fs['unlink'](_0x3a6522+_0x4cf1('0x116'));}catch(_0x172a4e){logger[_0x4cf1('0x30')](_0x172a4e);}return _0x23384c;}return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x4bfab2,_0x4cf1('0x1b3'));};AGIVertices['prototype'][_0x4cf1('0x1b4')]=function(_0x456f53){logger['info'](util['format'](_0x4cf1('0x1b5'),_0x456f53[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x456f53['findBy'])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x456f53,_0x4cf1('0x14f'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53[_0x4cf1('0x14e')]));var _0x42e69b=this['agentUnpause'][_0x4cf1('0x70')](this,_0x456f53['findBy']);if(_0x42e69b){logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')]['callerid'],_0x456f53[_0x4cf1('0x14e')]));this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0x151'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x155')};}else{logger[_0x4cf1('0x33')](util[_0x4cf1('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53['findBy']));this[_0x4cf1('0xf')]['noop'](util[_0x4cf1('0x2c')](_0x4cf1('0x152'),this[_0x4cf1('0xf')][_0x4cf1('0x3f')],_0x456f53[_0x4cf1('0x14e')]));return{'code':0xc8,'result':_0x4cf1('0x153')};}};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1b6')]=function(_0x540f77){logger['info'](util['format'](_0x4cf1('0x1b7'),_0x540f77[_0x4cf1('0x3c')]));var _0x4eba1d=this[_0x4cf1('0xf')]['exec']('VOICEMAIL',[_0x540f77[_0x4cf1('0x1b8')],_0x540f77['options']]);if(_0x4eba1d[_0x4cf1('0xa3')]===-0x1){return _0x4eba1d;}return this[_0x4cf1('0xf')][_0x4cf1('0xaa')](util[_0x4cf1('0x2c')](_0x4cf1('0xc0'),'VOICEMAIL',_0x540f77[_0x4cf1('0x1b8')]));};AGIVertices[_0x4cf1('0x12')][_0x4cf1('0x1b9')]=function(_0x25cbdb){logger[_0x4cf1('0x33')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x25cbdb[_0x4cf1('0x3c')]));if(!this[_0x4cf1('0x87')](_0x25cbdb[_0x4cf1('0xd5')])){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x25cbdb,_0x4cf1('0x1ba'));}var _0x6973a5=this[_0x4cf1('0x13')][_0x4cf1('0x70')](this,_0x25cbdb['variable_id']);if(!_0x6973a5){return this[_0x4cf1('0xf')][_0x4cf1('0x30')](_0x25cbdb,'no\x20variable\x20found');}var _0x278067=this[_0x4cf1('0xf')][_0x4cf1('0x13')](_0x6973a5);return{'code':0xc8,'result':_0x278067[_0x4cf1('0xa1')]?_0x278067[_0x4cf1('0xa1')]:'-'};};String['prototype'][_0x4cf1('0xa0')]=function(_0x2eec1b,_0x77823e){return this[_0x4cf1('0x9f')](_0x2eec1b)[_0x4cf1('0x1bb')](_0x77823e);};module[_0x4cf1('0x1bc')]=AGIVertices; \ No newline at end of file +var _0x97e7=['getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','url','stringify','body','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','aws_text_type','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','isPlainObject','%s.%s','length','setVariable','split','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','phone','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','MRCPSynth','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','awsLex','amazonlex','Amazon\x20Lex\x20Result\x20%s','wav','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','findBy','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','success','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','template_id','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueueById','name','getSquareProject','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount'];(function(_0x205dbf,_0x22642e){var _0x2f4eb8=function(_0x371807){while(--_0x371807){_0x205dbf['push'](_0x205dbf['shift']());}};_0x2f4eb8(++_0x22642e);}(_0x97e7,0x1a1));var _0x797e=function(_0x32c5e4,_0x510b42){_0x32c5e4=_0x32c5e4-0x0;var _0x666765=_0x97e7[_0x32c5e4];return _0x666765;};'use strict';var fs=require('fs');var util=require(_0x797e('0x0'));var _=require(_0x797e('0x1'));var sh=require(_0x797e('0x2'));var odbc=require('odbc')();var rs=require(_0x797e('0x3'));var moment=require(_0x797e('0x4'));var Mustache=require(_0x797e('0x5'));var rp=require(_0x797e('0x6'));var logger=require(_0x797e('0x7'))(_0x797e('0x8'));var config=require(_0x797e('0x9'));var shared=require(_0x797e('0xa'));var scripts=require(_0x797e('0xb'));var FILES_PATH=_0x797e('0xc');var recursiveMapAttributes=[_0x797e('0xd'),_0x797e('0xe')];var verticesWithRetry=['menu',_0x797e('0xf'),_0x797e('0x10')];var AGIVertices=function(_0x2e148f,_0x149c09,_0x5ad3cf){this[_0x797e('0x11')]=_0x2e148f;this[_0x797e('0x12')]=_0x149c09;this[_0x797e('0x13')]=_0x5ad3cf;};AGIVertices[_0x797e('0x14')][_0x797e('0x15')]=function(_0x442b39,_0x291aa8){this['rpc'][_0x797e('0x16')](_0x442b39)[_0x797e('0x17')](function(_0x1da7a4){_0x291aa8(null,_0x1da7a4?_0x1da7a4['name']:![]);})[_0x797e('0x18')](function(_0x5adb17){_0x291aa8(_0x5adb17);});};AGIVertices[_0x797e('0x14')]['getVoiceQueue']=function(_0x285968,_0x437b80){this['rpc'][_0x797e('0x19')](_0x285968)['then'](function(_0x37d007){_0x437b80(null,_0x37d007?_0x37d007[_0x797e('0x1a')]:![]);})[_0x797e('0x18')](function(_0x1ccfaa){_0x437b80(_0x1ccfaa);});};AGIVertices[_0x797e('0x14')][_0x797e('0x1b')]=function(_0x4244aa,_0xfe2fff){this[_0x797e('0x12')]['getSquareProjectById'](_0x4244aa)[_0x797e('0x17')](function(_0x26469b){_0xfe2fff(null,_0x26469b?_0x26469b[_0x797e('0x1a')]:![]);})['catch'](function(_0x112eb3){_0xfe2fff(_0x112eb3);});};AGIVertices[_0x797e('0x14')]['getSquareOdbc']=function(_0x2c1657,_0x19b2af){this[_0x797e('0x12')][_0x797e('0x1c')](_0x2c1657)[_0x797e('0x17')](function(_0x57ddae){_0x19b2af(null,_0x57ddae?_0x57ddae[_0x797e('0x1d')]:![]);})['catch'](function(_0x544225){_0x19b2af(_0x544225);});};AGIVertices['prototype']['getUser']=function(_0x47bde9,_0x2f7bdc){this[_0x797e('0x12')][_0x797e('0x1e')](_0x47bde9)[_0x797e('0x17')](function(_0x1b03d0){_0x2f7bdc(null,_0x1b03d0?_0x1b03d0[_0x797e('0x1a')]:![]);})[_0x797e('0x18')](function(_0x1023e7){_0x2f7bdc(_0x1023e7);});};AGIVertices[_0x797e('0x14')][_0x797e('0x1f')]=function(_0x1713a0,_0x506209){this[_0x797e('0x12')][_0x797e('0x20')](_0x1713a0)['then'](function(_0x2ead35){_0x506209(null,_0x2ead35?_0x2ead35[_0x797e('0x1a')]:![]);})[_0x797e('0x18')](function(_0x28189c){_0x506209(_0x28189c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x21')]=function(_0xa156f0,_0x13f7e7){var _0x3a9310=this;this[_0x797e('0x12')][_0x797e('0x22')](_0xa156f0)['then'](function(_0x281ade){_0x13f7e7(null,_0x281ade?_0x3a9310[_0x797e('0x23')](_0x281ade[_0x797e('0x24')]):![]);})[_0x797e('0x18')](function(_0x4b8d78){_0x13f7e7(_0x4b8d78);});};AGIVertices[_0x797e('0x14')][_0x797e('0x25')]=function(_0xb1c813,_0x520b4f){this[_0x797e('0x12')][_0x797e('0x26')](_0xb1c813)['then'](function(_0x50d220){_0x520b4f(null,_0x50d220?_0x50d220:![]);})[_0x797e('0x18')](function(_0x596b32){_0x520b4f(_0x596b32);});};AGIVertices['prototype'][_0x797e('0x27')]=function(_0x20be8,_0x59787b,_0x4d299a){this[_0x797e('0x13')][_0x797e('0x27')](_0x20be8,_0x59787b)[_0x797e('0x17')](function(){_0x4d299a(null);})['catch'](function(_0x4a918b){_0x4d299a(_0x4a918b);});};AGIVertices['prototype'][_0x797e('0x28')]=function(_0x267be6,_0x9e8555){this['rpc'][_0x797e('0x29')](_0x267be6)['then'](function(_0x5e6792){if(_0x5e6792){if(_0x5e6792[_0x797e('0x2a')]){_0x9e8555(null,[_0x5e6792[_0x797e('0x2b')]]);}else{_0x9e8555(null,_[_0x797e('0x2c')](_0x5e6792['Intervals'],'interval'));}}else{_0x9e8555(null,![]);}})['catch'](function(_0xc7f01e){_0x9e8555(_0xc7f01e);});};AGIVertices['prototype'][_0x797e('0x23')]=function(_0x4c7fef){return util[_0x797e('0x2d')](_0x797e('0x2e'),FILES_PATH,_0x4c7fef);};AGIVertices['prototype'][_0x797e('0x2f')]=function(_0x5abdbb,_0x5da0f1,_0x56f263){odbc['open'](_0x5abdbb,function(_0x40c347){if(_0x40c347){logger[_0x797e('0x30')](_0x797e('0x31'),_0x40c347);_0x56f263(_0x40c347);}else{logger[_0x797e('0x32')]('ODBC\x20connection\x20successfully');odbc['query'](_0x5da0f1,function(_0x5afb7f,_0x161e9c){if(_0x5afb7f){logger[_0x797e('0x32')]('Error\x20executing\x20query\x20%s',_0x5da0f1);_0x56f263(_0x5afb7f);}else{logger[_0x797e('0x32')]('Query\x20executed\x20correctly\x20%s',_0x5da0f1);odbc[_0x797e('0x33')](function(_0x79408d){if(_0x79408d){logger['error'](_0x797e('0x34'),_0x79408d);}_0x56f263(null,_0x161e9c);});}});}});};AGIVertices[_0x797e('0x14')][_0x797e('0x35')]=function(_0x415768,_0x1f0458){this[_0x797e('0x12')][_0x797e('0x36')](_0x415768)[_0x797e('0x17')](function(_0x38778b){_0x1f0458(null,_0x38778b?_0x38778b:![]);})[_0x797e('0x18')](function(_0x5a5336){_0x1f0458(_0x5a5336);});};AGIVertices[_0x797e('0x14')][_0x797e('0x37')]=function(_0x51919a,_0x13af20){this[_0x797e('0x12')][_0x797e('0x37')](_0x51919a)['then'](function(_0x8c85e3){_0x13af20(null,_0x8c85e3);})['catch'](function(_0x24d84c){_0x13af20(_0x24d84c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x38')]=function(_0x970d20,_0x55219f,_0x1dad91){this[_0x797e('0x12')][_0x797e('0x38')]({'uniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'node':_0x970d20[_0x797e('0x3a')],'application':_0x970d20['agicommand'],'data':_0x55219f||null,'project_name':this['channel'][_0x797e('0x3b')],'callerid':this['channel']['callerid']})[_0x797e('0x17')](function(_0x30fa19){if(_0x1dad91){_0x1dad91(null,_0x30fa19);}})[_0x797e('0x18')](function(_0x421e67){if(_0x1dad91){_0x1dad91(_0x421e67);}});};AGIVertices['prototype'][_0x797e('0x3c')]=function(_0x128d01,_0x1cf727,_0x367c95,_0x5eb031){this[_0x797e('0x12')][_0x797e('0x3c')]({'uniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'callerid':this[_0x797e('0x11')][_0x797e('0x3d')],'calleridname':this[_0x797e('0x11')]['calleridname'],'context':this['channel']['context'],'extension':this[_0x797e('0x11')][_0x797e('0x3e')],'priority':this['channel'][_0x797e('0x3f')],'accountcode':this[_0x797e('0x11')]['accountcode'],'dnid':this['channel'][_0x797e('0x40')],'projectName':this['channel'][_0x797e('0x3b')],'saveName':_0x1cf727,'filename':_0x128d01[_0x797e('0x41')]||_0x1cf727,'savePath':_0x367c95})[_0x797e('0x17')](function(_0x5711a1){_0x5eb031(null,_0x5711a1);})['catch'](function(_0x32814c){_0x5eb031(_0x32814c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x42')]=function(_0x5324aa,_0x473e1f,_0x561198,_0x5b13b6,_0x441f1c){this[_0x797e('0x12')][_0x797e('0x42')]({'uniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'body':_0x5324aa,'direction':_0x473e1f,'providerName':_0x561198,'providerResponse':_0x5b13b6})[_0x797e('0x17')](function(_0x1a6968){if(_0x441f1c){_0x441f1c(null,_0x1a6968);}})[_0x797e('0x18')](function(_0x41cd8b){if(_0x441f1c){_0x441f1c(_0x41cd8b);}});};AGIVertices[_0x797e('0x14')][_0x797e('0x43')]=function(_0x23836d,_0x2064bb){this[_0x797e('0x12')][_0x797e('0x43')]({'firstName':_[_0x797e('0x44')](_0x23836d[_0x797e('0x1a')])||_[_0x797e('0x45')](_0x23836d[_0x797e('0x1a')])?'callback_'+Math[_0x797e('0x46')]():_0x23836d[_0x797e('0x1a')],'lastName':_[_0x797e('0x44')](_0x23836d[_0x797e('0x47')])||_[_0x797e('0x45')](_0x23836d[_0x797e('0x47')])?null:_0x23836d[_0x797e('0x47')],'phone':_0x23836d['phone'],'ListId':_0x23836d[_0x797e('0x48')],'scheduledat':_0x23836d[_0x797e('0x49')],'callbackUniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'tags':_0x797e('0x4a'),'description':_0x797e('0x4b')+_0x23836d[_0x797e('0x49')][_0x797e('0x4c')](),'priority':_0x23836d[_0x797e('0x4d')]})[_0x797e('0x17')](function(_0xab3823){_0x2064bb(null,_0xab3823);})['catch'](function(_0x2eaabc){_0x2064bb(_0x2eaabc);});};AGIVertices[_0x797e('0x14')][_0x797e('0x4e')]=function(_0xa46318,_0x58ec56){this[_0x797e('0x12')][_0x797e('0x4f')](_0xa46318)[_0x797e('0x17')](function(_0x44b199){_0x58ec56(null,_0x44b199?_0x44b199['name']:![]);})[_0x797e('0x18')](function(_0x28ff41){_0x58ec56(_0x28ff41);});};AGIVertices[_0x797e('0x14')][_0x797e('0x50')]=function(_0x1c0994,_0x29112d,_0x4dc6e6){var _0x3a8678={'role':_0x797e('0x51')};_0x3a8678[_0x1c0994]=this[_0x797e('0x11')][_0x797e('0x3d')];this[_0x797e('0x12')]['agentPause'](_0x3a8678,_0x29112d,this[_0x797e('0x11')][_0x797e('0x39')])['then'](function(_0x9fc1b7){_0x4dc6e6(null,_[_0x797e('0x45')](_0x9fc1b7)?![]:!![]);})[_0x797e('0x18')](function(_0xd88a48){logger['error'](_0xd88a48);_0x4dc6e6(null,![]);});};AGIVertices[_0x797e('0x14')][_0x797e('0x52')]=function(_0xd0d95,_0x341013){var _0xf6259a={'role':_0x797e('0x51')};_0xf6259a[_0xd0d95]=this['channel'][_0x797e('0x3d')];this[_0x797e('0x12')][_0x797e('0x52')](_0xf6259a)['then'](function(_0x52f40f){_0x341013(null,_[_0x797e('0x45')](_0x52f40f)?![]:!![]);})[_0x797e('0x18')](function(_0x287dce){logger[_0x797e('0x30')](_0x287dce);_0x341013(null,![]);});};AGIVertices[_0x797e('0x14')][_0x797e('0x53')]=function(_0x177a75,_0x427eaa){var _0xcdce75={'role':_0x797e('0x51')};_0xcdce75[_0x177a75]=this['channel'][_0x797e('0x3d')];this[_0x797e('0x12')][_0x797e('0x53')](_0xcdce75)[_0x797e('0x17')](function(_0x24a4f9){_0x427eaa(null,_[_0x797e('0x45')](_0x24a4f9)?![]:!![]);})['catch'](function(_0x9f9d04){logger[_0x797e('0x30')](_0x9f9d04);_0x427eaa(null,![]);});};AGIVertices['prototype'][_0x797e('0x54')]=function(_0x3254e7,_0x732659){var _0x525ff1={'role':'agent'};_0x525ff1[_0x3254e7]=this[_0x797e('0x11')][_0x797e('0x3d')];var _0x289a0f=_0x3254e7!=_0x797e('0x55')?util[_0x797e('0x2d')](_0x797e('0x56'),_0x797e('0x57'),this[_0x797e('0x11')][_0x797e('0x3d')]):undefined;this[_0x797e('0x12')]['agentLogin'](_0x525ff1,_0x289a0f)[_0x797e('0x17')](function(_0x2e1238){_0x732659(null,_[_0x797e('0x45')](_0x2e1238)?![]:!![]);})['catch'](function(_0x460387){logger[_0x797e('0x30')](_0x460387);_0x732659(null,![]);});};AGIVertices[_0x797e('0x14')][_0x797e('0x58')]=function(_0x1194c1,_0x2d92c9){sh[_0x797e('0x59')](_[_0x797e('0x5a')](_0x1194c1),function(_0x55f0b3,_0x5734c0){var _0x427b63=_0x5734c0['replace'](/(\r\n|\n|\r)/gm,'');_0x2d92c9(null,_0x427b63);});};AGIVertices[_0x797e('0x14')][_0x797e('0x5b')]=function(_0x5ab7e7,_0x133880){scripts[_0x797e('0x5b')](_0x5ab7e7['apiKey'],_0x5ab7e7[_0x797e('0x5c')]||'text',_0x5ab7e7[_0x797e('0x5d')],_0x5ab7e7[_0x797e('0x5e')]||_0x797e('0x5f'),_0x5ab7e7['ssmlGender']||_0x797e('0x60'),_0x5ab7e7[_0x797e('0x61')]||_0x797e('0x62'))[_0x797e('0x17')](function(_0x20fc9e){_0x133880(null,_0x20fc9e);})[_0x797e('0x18')](function(_0x5a7dbf){_0x133880(_0x5a7dbf);});};AGIVertices[_0x797e('0x14')][_0x797e('0x63')]=function(_0x255c96,_0x48c607){scripts[_0x797e('0x63')](_0x255c96['text'],_0x255c96[_0x797e('0x64')]||'en',0x1)[_0x797e('0x17')](function(_0x347bfe){_0x48c607(null,_0x347bfe);})[_0x797e('0x18')](function(_0x1ca634){_0x48c607(_0x1ca634);});};AGIVertices[_0x797e('0x14')][_0x797e('0x65')]=function(_0x5aaf14,_0x472494){var _0x2c86cd={'uri':_0x5aaf14['url'],'method':_0x5aaf14[_0x797e('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5aaf14[_0x797e('0x67')])===_0x797e('0x68')&&parseInt(_0x5aaf14[_0x797e('0x67')])>=0x1?parseInt(_0x5aaf14['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x797e('0x69')]([_0x797e('0x6a'),_0x797e('0x6b')],_0x2c86cd[_0x797e('0x66')][_0x797e('0x6c')]())){try{_0x2c86cd['body']=_0x5aaf14[_0x797e('0xe')]?JSON[_0x797e('0x6d')](_0x5aaf14['rawBody']):{};}catch(_0x62e71){logger['error'](_0x797e('0x6e'),_0x62e71);}}try{_0x2c86cd[_0x797e('0x6f')]=_0x5aaf14[_0x797e('0xd')]?JSON[_0x797e('0x6d')](_0x5aaf14['rawHeaders']):{};}catch(_0x225aee){logger[_0x797e('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x225aee);}if(_0x5aaf14[_0x797e('0x70')]){try{var _0x543322=require(_0x5aaf14[_0x797e('0x70')])[_0x797e('0x71')](this,_0x2c86cd);_0x2c86cd[_0x797e('0x72')]=Mustache[_0x797e('0x73')](_0x5aaf14[_0x797e('0x74')],_0x543322,{},['$$','$$']);if(_0x2c86cd[_0x797e('0x6f')]){_0x2c86cd['headers']=JSON[_0x797e('0x6d')](Mustache[_0x797e('0x73')](JSON[_0x797e('0x75')](_0x2c86cd['headers']),_0x543322,{},['$$','$$']));}if(_0x2c86cd[_0x797e('0x76')]){_0x2c86cd['body']=JSON[_0x797e('0x6d')](Mustache['render'](JSON[_0x797e('0x75')](_0x2c86cd[_0x797e('0x76')]),_0x543322,{},['$$','$$']));}}catch(_0xe9a8db){logger[_0x797e('0x30')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe9a8db);}}rp(_0x2c86cd)['then'](function(_0x610e11){var _0xb3292e={'statusCode':_0x610e11[_0x797e('0x77')]||0xc8,'statusMessage':_0x610e11['statusMessage']||'OK','headers':_0x610e11['headers']||{},'body':_0x610e11['body']||{}};_0x472494(null,_0xb3292e);})[_0x797e('0x18')](function(_0x45998b){var _0x3de89c={'statusCode':_0x45998b[_0x797e('0x77')]||0x1f4,'statusMessage':_0x45998b[_0x797e('0x78')]||_0x797e('0x79'),'headers':_0x45998b[_0x797e('0x7a')][_0x797e('0x6f')]||{},'body':_0x45998b['options']['body']||{}};_0x472494(null,_0x3de89c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x7b')]=function(_0x344b59,_0x4f944b){scripts[_0x797e('0x7b')](this[_0x797e('0x11')][_0x797e('0x39')],_0x344b59['key'],_0x344b59[_0x797e('0x5d')],_0x344b59[_0x797e('0x7c')]||'en')[_0x797e('0x17')](function(_0x767d91){_0x4f944b(null,_0x767d91);})['catch'](function(_0x368929){_0x4f944b(_0x368929);});};AGIVertices[_0x797e('0x14')]['googleDialogflowV2']=function(_0x423c92,_0x514a67){scripts[_0x797e('0x7d')](this[_0x797e('0x11')][_0x797e('0x39')],_0x423c92['dialogflowV2_project_id'],_0x423c92[_0x797e('0x7e')],_0x423c92[_0x797e('0x7f')],_0x423c92[_0x797e('0x5d')],_0x423c92[_0x797e('0x80')]||'en')['then'](function(_0x3c67f9){_0x514a67(null,_0x3c67f9);})[_0x797e('0x18')](function(_0x132758){_0x514a67(_0x132758);});};AGIVertices[_0x797e('0x14')][_0x797e('0x81')]=function(_0x4c13a8,_0x384f6f){scripts[_0x797e('0x81')](this[_0x797e('0x11')],_0x4c13a8)[_0x797e('0x17')](function(_0x42db46){_0x384f6f(null,_0x42db46);})[_0x797e('0x18')](function(_0x1752fd){_0x384f6f(_0x1752fd);});};AGIVertices[_0x797e('0x14')][_0x797e('0x82')]=function(_0x411678,_0x2f23ca){scripts[_0x797e('0x82')](_0x411678['key'],_0x411678[_0x797e('0x5d')],_0x411678[_0x797e('0x83')]||_0x797e('0x5f'),_0x411678[_0x797e('0x84')])['then'](function(_0x5709d6){_0x2f23ca(null,_0x5709d6);})['catch'](function(_0x3da493){_0x2f23ca(_0x3da493);});};AGIVertices[_0x797e('0x14')][_0x797e('0x85')]=function(_0x5d075a,_0x2a5a36,_0x42f948){scripts[_0x797e('0x85')](_0x2a5a36,_0x5d075a[_0x797e('0x86')],_0x5d075a[_0x797e('0x87')]||_0x797e('0x5f'),this[_0x797e('0x88')](_0x5d075a[_0x797e('0x89')])?_0x5d075a[_0x797e('0x89')]:undefined)['then'](function(_0x2dd8b3){_0x42f948(null,_0x2dd8b3);})[_0x797e('0x18')](function(_0x23205e){_0x42f948(_0x23205e);});};AGIVertices['prototype'][_0x797e('0x8a')]=function(_0x68f24a,_0x1c33ab){scripts[_0x797e('0x8a')](_0x68f24a['aws_access_key_id'],_0x68f24a['aws_secret_access_key'],_0x68f24a[_0x797e('0x8b')],_0x68f24a[_0x797e('0x8c')]||'Amy',_0x68f24a[_0x797e('0x5d')],_0x68f24a[_0x797e('0x8d')]||_0x797e('0x5d'))[_0x797e('0x17')](function(_0x8d2056){_0x1c33ab(null,_0x8d2056);})[_0x797e('0x18')](function(_0x22aa63){_0x1c33ab(_0x22aa63);});};AGIVertices[_0x797e('0x14')]['awsLex']=function(_0x26ce84,_0x581dd2){scripts['awsLex'](this[_0x797e('0x11')]['uniqueid'],_0x26ce84['aws_access_key_id'],_0x26ce84[_0x797e('0x8e')],_0x26ce84[_0x797e('0x8f')],_0x26ce84[_0x797e('0x5d')],_0x26ce84[_0x797e('0x90')])[_0x797e('0x17')](function(_0x205945){_0x581dd2(null,_0x205945);})[_0x797e('0x18')](function(_0x5ace54){_0x581dd2(_0x5ace54);});};AGIVertices[_0x797e('0x14')][_0x797e('0x91')]=function(_0x136f90,_0x552669,_0x53aa0e){scripts[_0x797e('0x91')](_0x552669,_0x136f90[_0x797e('0x86')],_0x136f90['google_asr_language']||_0x797e('0x5f'))['then'](function(_0x595209){_0x53aa0e(null,_0x595209);})[_0x797e('0x18')](function(_0x3d3edb){_0x53aa0e(_0x3d3edb);});};AGIVertices['prototype'][_0x797e('0x92')]=function(_0x16d5e9,_0x3318b1,_0x148de8){scripts[_0x797e('0x92')](_0x3318b1,_0x16d5e9[_0x797e('0x93')],_0x16d5e9[_0x797e('0x94')],_0x16d5e9[_0x797e('0x72')])[_0x797e('0x17')](function(_0x55ac3d){_0x148de8(null,_0x55ac3d);})['catch'](function(_0x371b94){_0x148de8(_0x371b94);});};AGIVertices[_0x797e('0x14')][_0x797e('0x95')]=function(_0x2c9a47){var _0x41e08c=_['includes'](verticesWithRetry,_0x2c9a47[_0x797e('0x96')])?_0x2c9a47:_[_0x797e('0x97')](_0x2c9a47);for(var _0x58e11c in _0x41e08c){if(_0x41e08c[_0x797e('0x98')](_0x58e11c)){if(_0x41e08c[_0x58e11c]&&_[_0x797e('0x99')](_0x41e08c[_0x58e11c])){if(_[_0x797e('0x69')](recursiveMapAttributes,_0x58e11c)){_0x41e08c[_0x58e11c]=this[_0x797e('0x9a')](_0x41e08c[_0x58e11c]);}else{_0x41e08c[_0x58e11c]=this[_0x797e('0x9b')](_0x41e08c[_0x58e11c]);}}}}return _0x41e08c;};AGIVertices[_0x797e('0x14')]['recursiveNodeIndex']=function(_0x46fa5a){for(var _0x51c990 in _0x46fa5a){if(_0x46fa5a[_0x797e('0x98')](_0x51c990)){if(_['isPlainObject'](_0x46fa5a[_0x51c990])){this[_0x797e('0x9c')](_0x46fa5a[_0x51c990]);}else if(_[_0x797e('0x9d')](_0x46fa5a[_0x51c990])){for(var _0xe832a7=0x0;_0xe832a7<_0x46fa5a[_0x51c990]['length'];_0xe832a7++){this[_0x797e('0x9c')](_0x46fa5a[_0x51c990][_0xe832a7]);}}else if(_[_0x797e('0x99')](_0x46fa5a[_0x51c990])){_0x46fa5a[_0x51c990]=this[_0x797e('0x9b')](_0x46fa5a[_0x51c990]);}}}};AGIVertices[_0x797e('0x14')][_0x797e('0x9e')]=function(_0x401d5b,_0x48692c){for(var _0x39d73e in _0x401d5b){if(_0x401d5b[_0x797e('0x98')](_0x39d73e)){if(_[_0x797e('0x9f')](_0x401d5b[_0x39d73e])){if(!_[_0x797e('0x44')](_0x401d5b[_0x39d73e])){this[_0x797e('0x9e')](_0x401d5b[_0x39d73e],util[_0x797e('0x2d')](_0x797e('0xa0'),_0x48692c,_0x39d73e));}}else if(_[_0x797e('0x9d')](_0x401d5b[_0x39d73e])){for(var _0x13c45a=0x0;_0x13c45a<_0x401d5b[_0x39d73e][_0x797e('0xa1')];_0x13c45a++){this['saveRestApiResult'](_0x401d5b[_0x39d73e][_0x13c45a],util[_0x797e('0x2d')]('%s.%s',_0x48692c,_0x39d73e+'['+_0x13c45a+']'));}}else{if(!_[_0x797e('0x45')](_0x401d5b[_0x39d73e])){this['channel'][_0x797e('0xa2')](util['format']('%s.%s',_0x48692c,_0x39d73e),_0x401d5b[_0x39d73e]);}}}}};AGIVertices[_0x797e('0x14')][_0x797e('0x9a')]=function(_0x59ccce){try{var _0x34ddb4=JSON[_0x797e('0x6d')](_0x59ccce);this[_0x797e('0x9c')](_0x34ddb4);return JSON[_0x797e('0x75')](_0x34ddb4);}catch(_0x1eb1f3){return this[_0x797e('0x9b')](_0x59ccce);}};AGIVertices[_0x797e('0x14')]['replaceAllVariables']=function(_0x47a61d){var _0x35af5f=_0x47a61d['split']('{');for(var _0x440fd5=0x1;_0x440fd5<_0x35af5f[_0x797e('0xa1')];_0x440fd5+=0x1){var _0xb7bca4=_0x35af5f[_0x440fd5][_0x797e('0xa3')]('}');if(_0xb7bca4[_0x797e('0xa1')]>0x1){_0x47a61d=_0x47a61d['replaceAll']('{'+_0xb7bca4[0x0]+'}',this[_0x797e('0x11')][_0x797e('0x15')](_0xb7bca4[0x0])[_0x797e('0xa4')]||_0xb7bca4[0x0]);}}if(_0x35af5f[_0x797e('0xa1')]===0x1){return _0x47a61d[_0x797e('0x4c')]();}return this[_0x797e('0x9b')](_0x47a61d);};AGIVertices['prototype'][_0x797e('0xa5')]=function(_0x2a250c,_0x4af4f6){var _0x2af9a5=this['channel'][_0x797e('0x15')](_0x2a250c);if(_0x2af9a5[_0x797e('0xa6')]===-0x1){return _0x2af9a5;}logger[_0x797e('0x32')](util[_0x797e('0x2d')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4af4f6,_0x2af9a5[_0x797e('0xa4')]));return this['channel'][_0x797e('0xa2')](_0x4af4f6,_0x2af9a5[_0x797e('0xa4')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x88')]=function(_0x54c7ec){return _0x54c7ec&&_0x54c7ec!=='0'&&_0x54c7ec!=='-1'&&_0x54c7ec!=='';};AGIVertices['prototype'][_0x797e('0xa7')]=function(_0x48cc9e){this[_0x797e('0x38')][_0x797e('0x71')](this,_0x48cc9e,'-');_0x48cc9e[_0x797e('0xa8')]=_0x48cc9e['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x797e('0x14')][_0x797e('0xa9')]=function(_0x129932){logger['info'](util[_0x797e('0x2d')](_0x797e('0xaa'),_0x129932[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x129932[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}var _0x33d28f='\x22'+_0x129932[_0x797e('0x5d')]+'\x22';if(this['isConfigured'](_0x129932[_0x797e('0x7a')])){_0x33d28f+=','+_0x129932['options'];}var _0x4ee95f=this[_0x797e('0x11')]['exec']('MRCPSynth',_0x33d28f);if(_0x4ee95f[_0x797e('0xa6')]===-0x1){return _0x4ee95f;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xad'),_0x33d28f));};AGIVertices[_0x797e('0x14')][_0x797e('0xae')]=function(_0x6441ae){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xaf'),_0x6441ae[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x6441ae[_0x797e('0xb0')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xb1'));}var _0x1453f0=_0x6441ae[_0x797e('0xb0')];if(this[_0x797e('0x88')](_0x6441ae[_0x797e('0x7a')])){_0x1453f0+=','+_0x6441ae[_0x797e('0x7a')];}var _0x35e8c5=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xb2'),_0x1453f0);if(_0x35e8c5[_0x797e('0xa6')]===-0x1){return _0x35e8c5;}var _0x1d9536=this['getAndSetVariable'](_0x797e('0xb3'),_0x797e('0xb4'));if(_0x1d9536[_0x797e('0xa6')]===-0x1){return _0x1d9536;}var _0x3572c0=this[_0x797e('0xa5')](_0x797e('0xb5'),'MRCP_RECOG_TRANSCRIPT');if(_0x3572c0[_0x797e('0xa6')]===-0x1){return _0x3572c0;}var _0x4a5003=this['getAndSetVariable'](_0x797e('0xb6'),_0x797e('0xb7'));if(_0x4a5003[_0x797e('0xa6')]===-0x1){return _0x4a5003;}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0xb8'),_0x1453f0));};AGIVertices[_0x797e('0x14')]['agi']=function(_0x2f60df){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xb9'),_0x2f60df[_0x797e('0x3a')]));return this['channel'][_0x797e('0x8')]([_0x2f60df['command'],_0x2f60df[_0x797e('0xba')]]);};AGIVertices[_0x797e('0x14')][_0x797e('0xbb')]=function(_0x46fcbc){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x46fcbc[_0x797e('0x3a')]));if(this[_0x797e('0x88')](_0x46fcbc['timeout'])){logger['info'](util[_0x797e('0x2d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x46fcbc[_0x797e('0x67')]));var _0x4b7785=this[_0x797e('0x11')][_0x797e('0xbc')](_0x46fcbc[_0x797e('0x67')]);if(_0x4b7785[_0x797e('0xa6')]===-0x1){return _0x4b7785;}}return this[_0x797e('0x11')][_0x797e('0xbb')]();};AGIVertices[_0x797e('0x14')][_0x797e('0x4a')]=function(_0x51b16d){logger['info'](util[_0x797e('0x2d')](_0x797e('0xbd'),_0x51b16d['label']));if(!this['isConfigured'](_0x51b16d[_0x797e('0x48')])){return this[_0x797e('0x11')]['error'](_0x51b16d,_0x797e('0xbe'));}_0x51b16d[_0x797e('0x49')]=moment();if(this[_0x797e('0x88')](_0x51b16d[_0x797e('0xbf')])){_0x51b16d[_0x797e('0x49')]=moment()[_0x797e('0xc0')](_0x51b16d[_0x797e('0xbf')],_0x797e('0xc1'));}if(!this['isConfigured'](_0x51b16d[_0x797e('0x4d')])){_0x51b16d['callback_priority']=0x2;}this[_0x797e('0x43')][_0x797e('0x71')](this,_0x51b16d);return this[_0x797e('0x11')][_0x797e('0xab')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x51b16d[_0x797e('0xc2')],_0x51b16d['list_id'],_0x51b16d['scheduledAt']));};AGIVertices[_0x797e('0x14')][_0x797e('0xc3')]=function(_0x107c1a){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x107c1a[_0x797e('0x3a')]));var _0x5cf9a5=this['channel'][_0x797e('0x59')](_0x107c1a['application'],_0x107c1a[_0x797e('0x7a')]);if(_0x5cf9a5[_0x797e('0xa6')]===-0x1){return _0x5cf9a5;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xc4'),_0x107c1a[_0x797e('0xc5')],_0x107c1a['options']));};AGIVertices[_0x797e('0x14')][_0x797e('0xc6')]=function(_0x484d56){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x484d56[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x484d56[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}var _0x4c19c7='\x22'+_0x484d56[_0x797e('0x5d')]+'\x22';if(this[_0x797e('0x88')](_0x484d56[_0x797e('0x7a')])){_0x4c19c7+=','+_0x484d56[_0x797e('0x7a')];}var _0x3ec564=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xc7'),_0x4c19c7);if(_0x3ec564[_0x797e('0xa6')]===-0x1){return _0x3ec564;}return this[_0x797e('0x11')][_0x797e('0xab')](util['format'](_0x797e('0xad'),_0x4c19c7));};AGIVertices[_0x797e('0x14')][_0x797e('0xc8')]=function(_0xe9975b){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xe9975b['label']));if(!this['isConfigured'](_0xe9975b[_0x797e('0x5d')])){return this['channel'][_0x797e('0xab')](_0x797e('0xac'));}var _0x3e1fce='\x22'+_0xe9975b[_0x797e('0x5d')]+'\x22';if(this['isConfigured'](_0xe9975b[_0x797e('0x7a')])){_0x3e1fce+=','+_0xe9975b[_0x797e('0x7a')];}var _0x40328e=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xc7'),_0x3e1fce);if(_0x40328e[_0x797e('0xa6')]===-0x1){return _0x40328e;}return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3e1fce));};AGIVertices[_0x797e('0x14')][_0x797e('0xc9')]=function(_0x527c37){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xca'),_0x527c37[_0x797e('0x3a')]));if(!this['isConfigured'](_0x527c37[_0x797e('0xb0')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xb1'));}var _0x48903a=_0x527c37[_0x797e('0xb0')];if(this[_0x797e('0x88')](_0x527c37['options'])){_0x48903a+=','+_0x527c37['options'];}var _0x58231b=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xb2'),_0x48903a);if(_0x58231b['result']===-0x1){return _0x58231b;}var _0x4d0b7b=this[_0x797e('0xa5')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x4d0b7b['result']===-0x1){return _0x4d0b7b;}var _0x251e8d=this['getAndSetVariable'](_0x797e('0xb5'),_0x797e('0xcb'));if(_0x251e8d[_0x797e('0xa6')]===-0x1){return _0x251e8d;}var _0x321f8e=this[_0x797e('0xa5')](_0x797e('0xb6'),'LUMENVOX_ASR_INSTANCE');if(_0x321f8e['result']===-0x1){return _0x321f8e;}return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x48903a));};AGIVertices[_0x797e('0x14')][_0x797e('0xcc')]=function(_0x284eb2){logger['info'](util[_0x797e('0x2d')](_0x797e('0xcd'),_0x284eb2[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x284eb2[_0x797e('0xb0')])){return this['channel'][_0x797e('0xab')](_0x797e('0xb1'));}var _0x5423a6=_0x284eb2[_0x797e('0xb0')];if(this[_0x797e('0x88')](_0x284eb2[_0x797e('0x7a')])){_0x5423a6+=','+_0x284eb2[_0x797e('0x7a')];}var _0x3c655e=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xb2'),_0x5423a6);if(_0x3c655e[_0x797e('0xa6')]===-0x1){return _0x3c655e;}var _0x4dc1c5=this[_0x797e('0xa5')](_0x797e('0xb3'),_0x797e('0xce'));if(_0x4dc1c5[_0x797e('0xa6')]===-0x1){return _0x4dc1c5;}var _0x47a8ea=this[_0x797e('0xa5')](_0x797e('0xb5'),'SESTEK_ASR_TRANSCRIPT');if(_0x47a8ea[_0x797e('0xa6')]===-0x1){return _0x47a8ea;}var _0x319fb3=this['getAndSetVariable'](_0x797e('0xb6'),_0x797e('0xcf'));if(_0x319fb3[_0x797e('0xa6')]===-0x1){return _0x319fb3;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xb8'),_0x5423a6));};AGIVertices[_0x797e('0x14')][_0x797e('0xd0')]=function(_0x46e7b4){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x46e7b4[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x46e7b4[_0x797e('0xd1')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x46e7b4,_0x797e('0xd2'));}var _0x4222f3=this[_0x797e('0xd3')]['sync'](this,_0x46e7b4[_0x797e('0xd1')]);if(!_0x4222f3){return this[_0x797e('0x11')]['error'](_0x46e7b4,_0x797e('0xd4'));}if(!this['isConfigured'](_0x46e7b4[_0x797e('0xd5')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x46e7b4,_0x797e('0xd6'));}var _0xa81849=_0x46e7b4[_0x797e('0xd5')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('query:\x20%s',_0xa81849));var _0x42ab05=this['getQueryOdbc']['sync'](this,_0x4222f3,_0xa81849);this[_0x797e('0x38')][_0x797e('0x71')](this,_0x46e7b4,_0xa81849);if(!this['isConfigured'](_0x46e7b4[_0x797e('0xd7')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xd8'));}var _0x347044=this[_0x797e('0x15')]['sync'](this,_0x46e7b4['variable_id']);if(!_0x347044){return this[_0x797e('0x11')][_0x797e('0x30')](_0x46e7b4,_0x797e('0xd9'));}var _0x255e1d=this;_0x42ab05['forEach'](function(_0x3d30d3,_0x2764f3){Object['keys'](_0x3d30d3)['forEach'](function(_0x4b4fca){_0x255e1d['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xda'),_0x347044,_0x2764f3,_0x4b4fca),_0x3d30d3[_0x4b4fca]);});});this['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xdb'),_0x347044),_0x42ab05[_0x797e('0xa1')]);return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xdc'),_0x347044));};AGIVertices['prototype'][_0x797e('0xdd')]=function(_0x2c8149){logger[_0x797e('0xde')](util['format'](_0x797e('0xdf'),_0x2c8149[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x2c8149[_0x797e('0xe0')])){return this['channel'][_0x797e('0x30')](_0x2c8149,_0x797e('0xe1'));}var _0x486f41=this[_0x797e('0xe2')][_0x797e('0x71')](this,_0x2c8149['sip_id']);if(!_0x486f41){return this['channel'][_0x797e('0x30')](_0x2c8149,'no\x20user\x20found');}var _0x4b5806=this['channel'][_0x797e('0x59')](_0x797e('0xe3'),[util[_0x797e('0x2d')](_0x797e('0xe4'),_0x486f41),_0x2c8149[_0x797e('0x67')],_0x2c8149[_0x797e('0xe5')],_0x2c8149['url']]);if(_0x4b5806[_0x797e('0xa6')]===-0x1){return _0x4b5806;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xe6'),'DIAL'));};AGIVertices[_0x797e('0x14')][_0x797e('0xe7')]=function(_0x502524){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xe8'),_0x502524[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x502524['key'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}if(!this[_0x797e('0x88')](_0x502524[_0x797e('0x5d')])){return this[_0x797e('0x11')]['noop'](_0x797e('0xac'));}this[_0x797e('0x11')]['bot']=!![];this[_0x797e('0x38')](_0x502524);this[_0x797e('0x42')](_0x502524[_0x797e('0x5d')],'in','','');this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xea'),_0x502524[_0x797e('0x5d')]));var _0x31c156=this[_0x797e('0x7b')][_0x797e('0x71')](this,_0x502524);if(_0x31c156){for(var _0x505280 in _0x31c156){if(_0x31c156[_0x797e('0x98')](_0x505280)){this['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xeb'),_0x505280[_0x797e('0x6c')]()),_0x31c156[_0x505280]);}}this[_0x797e('0x42')](_0x31c156[_0x797e('0xec')],_0x797e('0xed'),'dialogflow','');return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('Dialogflow\x20Result\x20%s',_0x31c156[_0x797e('0xec')]));}return this[_0x797e('0x11')][_0x797e('0x30')](_0x502524,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x797e('0x14')][_0x797e('0xee')]=function(_0x3f5fa5){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xef'),_0x3f5fa5['label']));if(!this[_0x797e('0x88')](_0x3f5fa5[_0x797e('0xf0')])){return this['channel'][_0x797e('0xab')](_0x797e('0xf1'));}if(!this['isConfigured'](_0x3f5fa5['client_email'])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20client_email\x20configured');}if(!this[_0x797e('0x88')](_0x3f5fa5['private_key'])){return this['channel'][_0x797e('0xab')](_0x797e('0xf2'));}if(!this[_0x797e('0x88')](_0x3f5fa5['dialogflowV2_language'])){return this['channel'][_0x797e('0xab')](_0x797e('0xf3'));}if(!this[_0x797e('0x88')](_0x3f5fa5[_0x797e('0x5d')])){return this['channel'][_0x797e('0xab')](_0x797e('0xac'));}this[_0x797e('0x11')][_0x797e('0xf4')]=!![];this[_0x797e('0x38')](_0x3f5fa5);this['createSquareMessage'](_0x3f5fa5['text'],'in','','');this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xf5'),_0x3f5fa5[_0x797e('0x5d')]));var _0x7863df=this[_0x797e('0x7d')][_0x797e('0x71')](this,_0x3f5fa5);if(_0x7863df){for(var _0x1b84b5 in _0x7863df){if(_0x7863df[_0x797e('0x98')](_0x1b84b5)){if(_0x1b84b5!==_0x797e('0xf6')){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xeb'),_0x1b84b5[_0x797e('0x6c')]()),_0x7863df[_0x1b84b5]);}}}this[_0x797e('0x42')](_0x7863df[_0x797e('0xec')],_0x797e('0xed'),_0x797e('0xee'),_0x7863df[_0x797e('0xf6')]);return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xf7'),_0x7863df['speech']));}return this[_0x797e('0x11')]['error'](_0x3f5fa5,_0x797e('0xf8'));};AGIVertices[_0x797e('0x14')][_0x797e('0xf9')]=function(_0x853b21){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x853b21[_0x797e('0x3a')]));if(!this['isConfigured'](_0x853b21['ndauth_url'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xfa'));}if(!this[_0x797e('0x88')](_0x853b21['username'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xfb'));}if(!this[_0x797e('0x88')](_0x853b21[_0x797e('0xfc')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xfd'));}if(!this[_0x797e('0x88')](_0x853b21[_0x797e('0xfe')])){return this[_0x797e('0x11')]['noop'](_0x797e('0xac'));}this[_0x797e('0x11')]['bot']=!![];this[_0x797e('0x38')](_0x853b21);this[_0x797e('0x42')](_0x853b21['text'],'in','','');this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0xff'),_0x853b21[_0x797e('0x5d')]));var _0x199599=this['sestekNDA'][_0x797e('0x71')](this,_0x853b21);if(_0x199599){for(var _0x35ed1e in _0x199599){if(_0x199599[_0x797e('0x98')](_0x35ed1e)){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x100'),_0x35ed1e['toUpperCase']()),_0x199599[_0x35ed1e]);}}this[_0x797e('0x42')](_0x199599['speech'],_0x797e('0xed'),_0x797e('0xf9'),'');if(_0x199599[_0x797e('0x101')]){this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0x102'),_0x199599[_0x797e('0x101')]));var _0x27329c=this['channel']['streamFile'](_0x199599[_0x797e('0x101')]);try{fs[_0x797e('0x103')](_0x199599[_0x797e('0x101')]+_0x797e('0x104'));}catch(_0x55f854){logger['error'](_0x55f854);}return _0x27329c;}else{return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('SestekNDA\x20Result\x20%s',_0x199599[_0x797e('0xec')]));}}return this[_0x797e('0x11')][_0x797e('0x30')](_0x853b21,_0x797e('0x105'));};AGIVertices[_0x797e('0x14')]['end']=function(_0x547415){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x547415[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x106'));};AGIVertices[_0x797e('0x14')]['ext_dial']=function(_0x19809e){logger[_0x797e('0x32')](util['format'](_0x797e('0x107'),_0x19809e[_0x797e('0x3a')]));var _0x5386e6='';if(_0x19809e[_0x797e('0x108')]){if(!this['isConfigured'](_0x19809e[_0x797e('0x108')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x19809e,_0x797e('0x109'));}else{var _0x5d9f79=parseInt(_0x19809e[_0x797e('0x108')],0xa);if(isNaN(_0x5d9f79)){_0x5386e6=_0x19809e[_0x797e('0x108')];}else{_0x5386e6=this[_0x797e('0x1f')][_0x797e('0x71')](this,_0x19809e['trunk_id']);if(!_0x5386e6){return this['channel'][_0x797e('0x30')](_0x19809e,_0x797e('0x10a'));}}}}else if(_0x19809e[_0x797e('0x10b')]){_0x5386e6=_0x19809e['trunk_name'];}else{return this[_0x797e('0x11')][_0x797e('0x30')](_0x19809e,_0x797e('0x109'));}var _0x334b26=this['channel'][_0x797e('0x59')](_0x797e('0xe3'),[util[_0x797e('0x2d')](_0x797e('0x10c'),_0x5386e6,_0x19809e['phone']),_0x19809e['timeout'],_0x19809e['opts'],_0x19809e[_0x797e('0x74')]]);if(_0x334b26[_0x797e('0xa6')]===-0x1){return _0x334b26;}return this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0xe6'),_0x797e('0xe3')));};AGIVertices[_0x797e('0x14')][_0x797e('0x10d')]=function(_0x125a9c){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x125a9c[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')]('finally');};AGIVertices[_0x797e('0x14')][_0x797e('0xf')]=function(_0x54b13b){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x10e'),_0x54b13b[_0x797e('0x3a')]));if(_0x54b13b['retry']===0x0){return this[_0x797e('0xa7')](_0x54b13b);}_0x54b13b['retry']-=0x1;if(!this['isConfigured'](_0x54b13b[_0x797e('0x10f')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x54b13b,_0x797e('0x110'));}var _0x539c09=this[_0x797e('0x21')][_0x797e('0x71')](this,_0x54b13b[_0x797e('0x10f')]);if(!_0x539c09){return this[_0x797e('0x11')]['error'](_0x54b13b,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x54b13b[_0x797e('0xd7')])){return this[_0x797e('0x11')][_0x797e('0x30')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x49da2d=this[_0x797e('0x11')][_0x797e('0x111')](_0x539c09,_0x54b13b[_0x797e('0x112')],_0x54b13b[_0x797e('0x113')]);var _0x342459=_0x49da2d[_0x797e('0xa6')]?_0x49da2d[_0x797e('0xa6')][_0x797e('0x4c')]():'';logger['info'](_0x797e('0x114'),JSON[_0x797e('0x75')](_0x49da2d));if(_0x49da2d[_0x797e('0xa6')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x54b13b,_0x342459);return _0x49da2d;}else if(_0x49da2d['extra']===_0x797e('0x67')){_0x49da2d['result']=_0x342459[_0x797e('0xa1')]>=parseInt(_0x54b13b[_0x797e('0x115')])?'x':'i';}else{_0x49da2d[_0x797e('0xa6')]=_0x342459['length']>=parseInt(_0x54b13b['mindigit'])&&_0x342459[_0x797e('0xa1')]<=parseInt(_0x54b13b['maxdigit'])?'x':'i';}var _0x18870e=this['getVariable']['sync'](this,_0x54b13b[_0x797e('0xd7')]);if(!_0x18870e){return this[_0x797e('0x11')]['error'](_0x54b13b,_0x797e('0xd9'));}this['channel'][_0x797e('0xa2')](_0x18870e,_0x342459);if(this[_0x797e('0x88')](_0x54b13b[_0x797e('0x116')])){var _0x4df0f4=parseInt(_0x54b13b[_0x797e('0x116')],0xa);var _0x40628b=rs[_0x797e('0x117')]({'charset':'*','length':_0x4df0f4});var _0x1f1385=_0x342459[_0x797e('0xa1')];if(_0x1f1385>0x0){if(_0x1f1385>_0x4df0f4){this['createSquareDetailsReport'][_0x797e('0x71')](this,_0x54b13b,_0x54b13b['hiddendigitspos']===_0x797e('0x118')?_0x40628b+_0x342459[_0x797e('0x119')](_0x4df0f4):_0x342459['substr'](0x0,_0x1f1385-_0x4df0f4)+_0x40628b);}else{this[_0x797e('0x38')]['sync'](this,_0x54b13b,rs[_0x797e('0x117')]({'charset':'*','length':_0x1f1385}));}}else{this[_0x797e('0x38')][_0x797e('0x71')](this,_0x54b13b,'');}}else{this[_0x797e('0x38')][_0x797e('0x71')](this,_0x54b13b,_0x342459);}return _0x49da2d;};AGIVertices[_0x797e('0x14')][_0x797e('0x10')]=function(_0x52502e){logger['info'](util[_0x797e('0x2d')](_0x797e('0x11a'),_0x52502e[_0x797e('0x3a')]));return this[_0x797e('0xf')](_0x52502e);};AGIVertices['prototype'][_0x797e('0x11b')]=function(_0x4e691f){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x11c'),_0x4e691f['label']));this['createSquareDetailsReport'][_0x797e('0x71')](this,_0x4e691f,_0x4e691f[_0x797e('0x11d')]);return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x11e'),_0x4e691f[_0x797e('0x11d')]));};AGIVertices['prototype']['awspolly']=function(_0x1f41da){logger['info'](util[_0x797e('0x2d')](_0x797e('0x11f'),_0x1f41da['label']));if(!this[_0x797e('0x88')](_0x1f41da[_0x797e('0x120')])||!this[_0x797e('0x88')](_0x1f41da[_0x797e('0x8e')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x121'));}if(!this[_0x797e('0x88')](_0x1f41da[_0x797e('0x5d')])){return this[_0x797e('0x11')]['noop']('no\x20text\x20configured');}this[_0x797e('0x11')][_0x797e('0xab')](util['format'](_0x797e('0x122'),_0x1f41da[_0x797e('0x5d')]));var _0x410fbd=this['awsPolly']['sync'](this,_0x1f41da);if(_0x410fbd){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x123'),_0x410fbd));var _0x4f95a6=this[_0x797e('0x11')][_0x797e('0x124')](_0x410fbd);try{fs['unlink'](_0x410fbd+_0x797e('0x104'));}catch(_0x1b8aee){logger['error'](_0x1b8aee);}return _0x4f95a6;}return this[_0x797e('0x11')][_0x797e('0x30')](_0x1f41da,_0x797e('0x125'));};AGIVertices[_0x797e('0x14')][_0x797e('0x126')]=function(_0x55e81a){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x55e81a[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x55e81a['aws_access_key_id'])||!this['isConfigured'](_0x55e81a[_0x797e('0x8e')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x121'));}if(!this['isConfigured'](_0x55e81a['aws_bot_name'])){return this['channel'][_0x797e('0xab')](_0x797e('0x127'));}if(!this[_0x797e('0x88')](_0x55e81a[_0x797e('0x5d')])){return this[_0x797e('0x11')]['noop']('no\x20text\x20configured');}this[_0x797e('0x11')][_0x797e('0xf4')]=!![];this[_0x797e('0x38')](_0x55e81a);this['createSquareMessage'](_0x55e81a[_0x797e('0x5d')],'in','','');this[_0x797e('0x11')]['noop'](util['format'](_0x797e('0x128'),_0x55e81a['text']));var _0x2001cb=this[_0x797e('0x129')][_0x797e('0x71')](this,_0x55e81a);if(_0x2001cb){for(var _0x25e5a0 in _0x2001cb){if(_0x2001cb[_0x797e('0x98')](_0x25e5a0)&&_['isString'](_0x2001cb[_0x25e5a0])){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')]('AWS_LEX_%s',_0x25e5a0[_0x797e('0x6c')]()),_0x2001cb[_0x25e5a0]);}}if(_[_0x797e('0x45')](_0x2001cb[_0x797e('0x78')])){return this[_0x797e('0x11')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x797e('0x42')](_0x2001cb[_0x797e('0x78')],_0x797e('0xed'),_0x797e('0x12a'),'');return this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0x12b'),_0x2001cb['message']));}}return this[_0x797e('0x11')][_0x797e('0x30')](_0x55e81a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype']['googleasr']=function(_0x396b59){logger[_0x797e('0x32')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x396b59[_0x797e('0x3a')],_0x396b59[_0x797e('0x67')]));if(!this['isConfigured'](_0x396b59[_0x797e('0x86')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}var _0x3d5aab=_0x797e('0x12c');var _0x2450ee=util[_0x797e('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0x797e('0x117')](0x4));var _0x3ed2b3=util[_0x797e('0x2d')](_0x797e('0xa0'),_0x2450ee,_0x3d5aab);var _0x37ba32=!![];if(_0x396b59[_0x797e('0x12d')]==='NOBEEP'){_0x37ba32=![];}var _0x5e0c24=this[_0x797e('0x11')][_0x797e('0x12e')](_0x2450ee,_0x3d5aab,_0x396b59['intKey'],_0x396b59[_0x797e('0x67')],undefined,_0x37ba32);if(_0x5e0c24['result']!==-0x1){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x12f'),_0x3ed2b3));var _0xf954fe=this['googleASR'][_0x797e('0x71')](this,_0x396b59,_0x3ed2b3);if(_0xf954fe){for(var _0x22f9d7 in _0xf954fe){if(_0xf954fe['hasOwnProperty'](_0x22f9d7)){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x130'),_0x22f9d7[_0x797e('0x6c')]()),_0xf954fe[_0x22f9d7]);}}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x131'),JSON[_0x797e('0x75')](_0xf954fe)));}}return _0x5e0c24;};AGIVertices[_0x797e('0x14')][_0x797e('0x132')]=function(_0x5f20b3){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x5f20b3['label']));if(!this['isConfigured'](_0x5f20b3[_0x797e('0x93')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x133'));}if(!this[_0x797e('0x88')](_0x5f20b3['appsecret'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x134'));}var _0x9e2f4f=_0x797e('0x12c');var _0x13e2e9=util[_0x797e('0x2d')](_0x797e('0x135'),FILES_PATH,rs[_0x797e('0x117')](0x4));var _0x3a6b6b=util[_0x797e('0x2d')](_0x797e('0xa0'),_0x13e2e9,_0x9e2f4f);var _0x2bbe4d=!![];if(_0x5f20b3['beep']===_0x797e('0x136')){_0x2bbe4d=![];}var _0x4cf606=this[_0x797e('0x11')][_0x797e('0x12e')](_0x13e2e9,_0x9e2f4f,_0x5f20b3[_0x797e('0x137')],_0x5f20b3[_0x797e('0x67')],undefined,_0x2bbe4d);if(_0x4cf606[_0x797e('0xa6')]!==-0x1){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x138'),_0x3a6b6b));var _0x40dfe2=this[_0x797e('0x92')][_0x797e('0x71')](this,_0x5f20b3,_0x3a6b6b);if(_0x40dfe2){for(var _0xb48288 in _0x40dfe2){if(_0x40dfe2[_0x797e('0x98')](_0xb48288)){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x139'),_0xb48288[_0x797e('0x6c')]()),_0x40dfe2[_0xb48288]);}}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x13a'),JSON[_0x797e('0x75')](_0x40dfe2)));}}return _0x4cf606;};AGIVertices['prototype']['gotoc']=function(_0x23aa48){logger['info'](util[_0x797e('0x2d')](_0x797e('0x13b'),_0x23aa48[_0x797e('0x3a')]));return this['channel']['continueAt'](_0x23aa48[_0x797e('0x13c')],_0x23aa48['extension'],_0x23aa48[_0x797e('0x3f')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x13d')]=function(_0x456e4a){logger[_0x797e('0x32')](util['format'](_0x797e('0x13e'),_0x456e4a[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x456e4a['condition'])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x456e4a,'no\x20condition\x20configured');}try{var _0x165d91=eval(_0x456e4a[_0x797e('0x13f')])?_0x797e('0x140'):_0x797e('0x141');this[_0x797e('0x11')][_0x797e('0xab')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x456e4a[_0x797e('0x13f')],_0x165d91));return{'code':0xc8,'result':_0x165d91};}catch(_0x2f4990){return{'code':0xc8,'result':_0x797e('0x141')};}};AGIVertices['prototype'][_0x797e('0x142')]=function(_0x5387b0){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x143'),_0x5387b0['label']));if(!this[_0x797e('0x88')](_0x5387b0[_0x797e('0x144')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x5387b0,_0x797e('0x145'));}var _0x53c1da=this[_0x797e('0x28')][_0x797e('0x71')](this,_0x5387b0['interval_id']);if(!_0x53c1da){return this['channel'][_0x797e('0x30')](_0x5387b0,'no\x20intervals\x20found');}for(var _0x1d66dc=0x0;_0x1d66dc<_0x53c1da['length'];_0x1d66dc+=0x1){var _0x416253=this[_0x797e('0x11')][_0x797e('0x15')](util['format'](_0x797e('0x146'),_0x53c1da[_0x1d66dc]));if(_0x416253['result']===-0x1){return _0x416253;}logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x416253[_0x797e('0xa4')]));if(_0x416253[_0x797e('0xa4')]===_0x797e('0x140')){logger['info'](util[_0x797e('0x2d')](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x797e('0x140')));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x797e('0x140')));return{'code':0xc8,'result':_0x797e('0x140')};}else{logger[_0x797e('0x32')](util['format'](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x797e('0x141')));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('IFTIME\x20%s\x20%s',_0x53c1da[_0x1d66dc],_0x797e('0x141')));}}return{'code':0xc8,'result':_0x797e('0x141')};};AGIVertices[_0x797e('0x14')][_0x797e('0x148')]=function(_0x229f8b){logger['info'](util[_0x797e('0x2d')](_0x797e('0x149'),_0x229f8b[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0x148')]();};AGIVertices[_0x797e('0x14')][_0x797e('0x14a')]=function(_0x33e41e){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x14b'),_0x33e41e['label']));if(!this[_0x797e('0x88')](_0x33e41e[_0x797e('0x86')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}var _0x4e26d1='wav';var _0x57d2f4=util[_0x797e('0x2d')](_0x797e('0x135'),FILES_PATH,rs[_0x797e('0x117')](0x4));var _0x64dc2d=util[_0x797e('0x2d')]('%s.%s',_0x57d2f4,_0x4e26d1);var _0x593ba1=!![];if(_0x33e41e[_0x797e('0x12d')]==='NOBEEP'){_0x593ba1=![];}var _0x1c0b57=this[_0x797e('0x11')]['recordFile'](_0x57d2f4,_0x4e26d1,_0x33e41e['intKey'],_0x33e41e[_0x797e('0x67')],undefined,_0x593ba1);if(_0x1c0b57[_0x797e('0xa6')]!==-0x1){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x14c'),_0x64dc2d));var _0x431228=this[_0x797e('0x85')]['sync'](this,_0x33e41e,_0x64dc2d);if(_0x431228){for(var _0xc32c5e in _0x431228){if(_0x431228[_0x797e('0x98')](_0xc32c5e)){this[_0x797e('0x11')]['setVariable'](util[_0x797e('0x2d')](_0x797e('0x14d'),_0xc32c5e[_0x797e('0x6c')]()),_0x431228[_0xc32c5e]);}}return this[_0x797e('0x11')][_0x797e('0xab')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x797e('0x75')](_0x431228)));}}return _0x1c0b57;};AGIVertices[_0x797e('0x14')][_0x797e('0x14e')]=function(_0x1c5d82){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x14f'),_0x1c5d82[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x1c5d82[_0x797e('0x86')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}if(!this['isConfigured'](_0x1c5d82[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}this['channel'][_0x797e('0xab')](util['format'](_0x797e('0x150'),_0x1c5d82[_0x797e('0x5d')]));var _0x180213=this['ispeechTTS'][_0x797e('0x71')](this,_0x1c5d82);if(_0x180213){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x14c'),_0x180213));var _0x2a4a9f=this[_0x797e('0x11')]['streamFile'](_0x180213,_0x1c5d82['intKey']);try{fs[_0x797e('0x103')](_0x180213+_0x797e('0x104'));}catch(_0x50bb75){logger[_0x797e('0x30')](_0x50bb75);}return _0x2a4a9f;}return this[_0x797e('0x11')][_0x797e('0x30')](_0x1c5d82,_0x797e('0x151'));};AGIVertices['prototype'][_0x797e('0x152')]=function(_0x594f6f){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x153'),_0x594f6f[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x594f6f['findBy'])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x594f6f,_0x797e('0x154'));}logger[_0x797e('0x32')](util['format'](_0x797e('0x155'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x594f6f['findBy']));var _0x4c0ac6=this[_0x797e('0x54')][_0x797e('0x71')](this,_0x594f6f['findBy']);if(_0x4c0ac6){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x156'),this[_0x797e('0x11')]['callerid'],_0x594f6f[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x156'),this['channel'][_0x797e('0x3d')],_0x594f6f['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x158'),this[_0x797e('0x11')]['callerid'],_0x594f6f['findBy']));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x158'),this[_0x797e('0x11')]['callerid'],_0x594f6f[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices[_0x797e('0x14')][_0x797e('0x15a')]=function(_0x1d5fb8){logger[_0x797e('0x32')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1d5fb8[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x1d5fb8[_0x797e('0x157')])){return this[_0x797e('0x11')]['error'](_0x1d5fb8,_0x797e('0x154'));}logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x155'),this['channel'][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));var _0x575350=this['agentLogout'][_0x797e('0x71')](this,_0x1d5fb8[_0x797e('0x157')]);if(_0x575350){logger['info'](util[_0x797e('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x797e('0x11')]['callerid'],_0x1d5fb8[_0x797e('0x157')]));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x156'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x797e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices[_0x797e('0x14')][_0x797e('0x15b')]=function(_0x7f7cdd){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x15c'),_0x7f7cdd[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x7f7cdd[_0x797e('0x15d')])){return this['channel'][_0x797e('0x30')](_0x7f7cdd,_0x797e('0x15e'));}this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x15f'),_0x7f7cdd['operation']));var _0x5cc62e=eval(_0x7f7cdd['operation']);if(!this['isConfigured'](_0x7f7cdd[_0x797e('0xd7')])){return this['channel'][_0x797e('0xab')](_0x797e('0xd8'));}var _0x39dc71=this[_0x797e('0x15')]['sync'](this,_0x7f7cdd['variable_id']);if(!_0x39dc71){return this[_0x797e('0x11')][_0x797e('0x30')](_0x7f7cdd,_0x797e('0xd9'));}if(_[_0x797e('0x9d')](_0x5cc62e)){var _0x1ff648=this;_0x5cc62e[_0x797e('0x160')](function(_0x23d46b,_0x536e2){_0x1ff648['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x161'),_0x39dc71,_0x536e2),_0x23d46b);});return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('variable\x20%s[key]\x20set',_0x39dc71));}else{return this[_0x797e('0x11')][_0x797e('0xa2')](_0x39dc71,_0x5cc62e);}};AGIVertices[_0x797e('0x14')]['menu']=function(_0x448a7c){logger['info'](util['format'](_0x797e('0x162'),_0x448a7c[_0x797e('0x3a')]));if(_0x448a7c['retry']===0x0){return this['maxRetry'](_0x448a7c);}_0x448a7c[_0x797e('0xa8')]-=0x1;if(!this['isConfigured'](_0x448a7c[_0x797e('0x10f')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x448a7c,_0x797e('0x110'));}var _0x4d89c6=this['getSound'][_0x797e('0x71')](this,_0x448a7c['file_id']);if(!_0x4d89c6){return this[_0x797e('0x11')]['error'](_0x448a7c,_0x797e('0x163'));}var _0xd35282=this[_0x797e('0x11')][_0x797e('0x111')](_0x4d89c6,_0x448a7c[_0x797e('0x112')],_0x448a7c['digit']);var _0x1be8a0=_0xd35282[_0x797e('0xa6')];if(_0xd35282['result']===-0x1){this[_0x797e('0x38')][_0x797e('0x71')](this,_0x448a7c,'-1');return _0xd35282;}else if(_0xd35282[_0x797e('0xa4')]===_0x797e('0x67')){_0xd35282['result']=_0xd35282[_0x797e('0xa6')][_0x797e('0xa1')]>0x0?_0xd35282[_0x797e('0xa6')]:'t';}else if(_[_0x797e('0x44')](_0xd35282[_0x797e('0xa6')])){_0xd35282['result']='#';_0x1be8a0='#';}if(!this[_0x797e('0x88')](_0x448a7c[_0x797e('0xd7')])){this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xd8'));}else{var _0x4c60e1=this[_0x797e('0x15')]['sync'](this,_0x448a7c[_0x797e('0xd7')]);if(!_0x4c60e1){return this[_0x797e('0x11')][_0x797e('0x30')](_0x448a7c,'no\x20variable\x20found');}this['channel'][_0x797e('0xa2')](_0x4c60e1,_0x1be8a0);}this[_0x797e('0x38')]['sync'](this,_0x448a7c,_0x1be8a0);return _0xd35282;};AGIVertices['prototype'][_0x797e('0xab')]=function(_0x1a89d8){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x164'),_0x1a89d8[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')](_0x1a89d8[_0x797e('0x165')]||_0x1a89d8[_0x797e('0x3a')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x166')]=function(_0x54ac52){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x54ac52[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x54ac52['findBy'])){return this[_0x797e('0x11')]['error'](_0x54ac52,_0x797e('0x154'));}logger[_0x797e('0x32')](util['format'](_0x797e('0x155'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));var _0x1643f6=this[_0x797e('0x4e')]['sync'](this,_0x54ac52[_0x797e('0x167')]);var _0x5808da=this[_0x797e('0x50')]['sync'](this,_0x54ac52[_0x797e('0x157')],_0x1643f6);if(_0x5808da){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x156'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52['findBy']));return{'code':0xc8,'result':_0x797e('0x168')};}else{logger[_0x797e('0x32')](util['format'](_0x797e('0x158'),this['channel'][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices['prototype']['playback']=function(_0x1520e5){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x169'),_0x1520e5['label']));if(!this[_0x797e('0x88')](_0x1520e5[_0x797e('0x10f')])){return this[_0x797e('0x11')]['error'](_0x1520e5,_0x797e('0x110'));}var _0x35db00=this[_0x797e('0x21')][_0x797e('0x71')](this,_0x1520e5['file_id']);if(!_0x35db00){return this[_0x797e('0x11')][_0x797e('0x30')](_0x1520e5,_0x797e('0x163'));}var _0x3d4dc3=this['channel']['exec'](_0x797e('0x16a'),[_0x35db00,_0x1520e5['opts']]);if(_0x3d4dc3['result']===-0x1){return _0x3d4dc3;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('Executed\x20command\x20%s\x20%s',_0x797e('0x16a'),_0x35db00));};AGIVertices[_0x797e('0x14')][_0x797e('0x16b')]=function(_0x127126){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x16c'),_0x127126[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x127126[_0x797e('0x16d')])){return this[_0x797e('0x11')]['error'](_0x127126,_0x797e('0x16e'));}var _0x163461='';var _0x23e549=parseInt(_0x127126[_0x797e('0x16d')],0xa);if(isNaN(_0x23e549)){_0x163461=_0x127126['queue_id'];}else{_0x163461=this[_0x797e('0x16f')][_0x797e('0x71')](this,_0x127126['queue_id']);if(!_0x163461){return this['channel'][_0x797e('0x30')](_0x127126,_0x797e('0x170'));}}var _0x6e7ff2='';if(this[_0x797e('0x88')](_0x127126[_0x797e('0x10f')])){var _0x195c38=this[_0x797e('0x21')][_0x797e('0x71')](this,_0x127126[_0x797e('0x10f')]);if(_0x195c38){_0x6e7ff2=_0x195c38;}}this['createSquareDetailsReport']['sync'](this,_0x127126,_0x163461);if(_0x127126[_0x797e('0xe5')][_0x797e('0x171')]('x')<0x0){_0x127126[_0x797e('0xe5')]+='x';}if(_0x127126['opts'][_0x797e('0x171')]('X')<0x0){_0x127126['opts']+='X';}this[_0x797e('0x11')][_0x797e('0xa2')](_0x797e('0x172'),_0x163461?_0x163461['toLowerCase']():'');var _0x2345e9=this['channel'][_0x797e('0x59')](_0x797e('0x173'),[_0x163461,_0x127126[_0x797e('0xe5')],_0x127126[_0x797e('0x74')],_0x6e7ff2,_0x127126['timeout'],_0x127126[_0x797e('0x8')],_0x127126[_0x797e('0x174')],_0x127126['gosub'],'',_0x127126[_0x797e('0x175')]]);if(_0x2345e9[_0x797e('0xa6')]===-0x1){return _0x2345e9;}return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xc4'),_0x797e('0x173'),_0x163461));};AGIVertices[_0x797e('0x14')][_0x797e('0x176')]=function(_0x29e453){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x177'),_0x29e453[_0x797e('0x3a')]));var _0x482db2=_0x29e453[_0x797e('0x178')]||_0x797e('0x12c');var _0x20c69b=util[_0x797e('0x2d')](_0x797e('0x179'),this[_0x797e('0x11')][_0x797e('0x39')],rs[_0x797e('0x117')](0x5));var _0x2ffda2=util[_0x797e('0x2d')](_0x797e('0x17a'),FILES_PATH,_0x20c69b,_0x482db2);var _0x312988=util[_0x797e('0x2d')](_0x797e('0x135'),FILES_PATH,_0x20c69b);this[_0x797e('0x3c')][_0x797e('0x71')](this,_0x29e453,_0x20c69b,_0x2ffda2);this['channel']['setVariable']('RECORDING_SAVENAME',_0x20c69b);logger['info'](_0x797e('0x17b'),_0x312988,_0x482db2,_0x29e453[_0x797e('0x17c')],_0x29e453[_0x797e('0x67')]);return this[_0x797e('0x11')][_0x797e('0x12e')](_0x312988,_0x482db2,_0x29e453[_0x797e('0x17c')],_0x29e453[_0x797e('0x67')],undefined,!![]);};AGIVertices[_0x797e('0x14')][_0x797e('0x17d')]=function(_0x5c20ae){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x5c20ae[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x5c20ae['url'])){return this[_0x797e('0x11')]['noop']('no\x20url\x20configured');}var _0x573a8e=this['restAPI'][_0x797e('0x71')](this,_0x5c20ae);logger['info'](util[_0x797e('0x2d')]('Response:',util[_0x797e('0x17e')](_0x573a8e,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x5c20ae[_0x797e('0xd7')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x17f'));}var _0x34ac94=this[_0x797e('0x15')][_0x797e('0x71')](this,_0x5c20ae[_0x797e('0xd7')]);if(!_0x34ac94){return this['channel'][_0x797e('0x30')](_0x5c20ae,_0x797e('0xd9'));}this[_0x797e('0x11')][_0x797e('0xa2')](util['format']('%s_STATUS_CODE',_0x34ac94),_0x573a8e[_0x797e('0x77')]?_0x573a8e[_0x797e('0x77')]:_0x797e('0x180'));this['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')]('%s_STATUS_MESSAGE',_0x34ac94),_0x573a8e[_0x797e('0x181')]?_0x573a8e['statusMessage']:'OK');if(_0x573a8e[_0x797e('0x76')]){try{this[_0x797e('0x9e')](_0x573a8e[_0x797e('0x76')],_0x34ac94);}catch(_0x19ff61){logger[_0x797e('0x30')](util[_0x797e('0x2d')](_0x797e('0x182'),_0x34ac94));}}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0xdc'),_0x34ac94));};AGIVertices[_0x797e('0x14')][_0x797e('0x183')]=function(_0x58155f){logger['info'](util[_0x797e('0x2d')](_0x797e('0x184'),_0x58155f[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0x185')](_0x58155f[_0x797e('0x186')][_0x797e('0x187')](/\s+/g,''),_0x58155f[_0x797e('0x17c')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x188')]=function(_0x403536){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x189'),_0x403536[_0x797e('0x3a')]));return this[_0x797e('0x11')]['sayNumber'](_0x403536[_0x797e('0x68')][_0x797e('0x187')](/\s+/g,''),_0x403536['escape_digits']);};AGIVertices[_0x797e('0x14')]['sayphonetic']=function(_0x218964){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x18a'),_0x218964[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0x18b')](_0x218964[_0x797e('0x5d')],_0x218964['escape_digits']);};AGIVertices['prototype'][_0x797e('0x18c')]=function(_0x4e3d0a){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4e3d0a[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x4e3d0a['account_id'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x18d'));}var _0x3f0381=this[_0x797e('0x25')]['sync'](this,_0x4e3d0a[_0x797e('0x18e')]);if(!_0x3f0381||!_0x3f0381[_0x797e('0x18f')]){return this['channel'][_0x797e('0x30')](_0x4e3d0a,_0x797e('0x190'));}var _0x50e41b={'from':util[_0x797e('0x2d')](_0x797e('0x191'),_0x3f0381['name'],_0x3f0381[_0x797e('0x192')]||_0x3f0381[_0x797e('0x18f')][_0x797e('0x193')]),'to':_0x4e3d0a['to']||'','cc':_0x4e3d0a['cc']||'','bcc':_0x4e3d0a[_0x797e('0x194')]||'','subject':_0x4e3d0a['subject'],'html':_0x4e3d0a['text'],'text':_0x4e3d0a['text']};if(this[_0x797e('0x88')](_0x4e3d0a[_0x797e('0x195')])){}logger[_0x797e('0xde')](_0x797e('0x196'),JSON['stringify'](_0x50e41b));this[_0x797e('0x38')][_0x797e('0x71')](this,_0x4e3d0a,_0x4e3d0a['account_id']);this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3f0381['name']));this[_0x797e('0x27')][_0x797e('0x71')](this,_0x3f0381[_0x797e('0x197')],_0x50e41b);return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x198'));};AGIVertices[_0x797e('0x14')][_0x797e('0x199')]=function(_0x2a7410){logger['info'](util[_0x797e('0x2d')](_0x797e('0x19a'),_0x2a7410[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x19b'));};AGIVertices[_0x797e('0x14')]['sendSMS']=function(_0x5afd3f){logger[_0x797e('0x32')](util['format'](_0x797e('0x19c'),_0x5afd3f[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x5afd3f[_0x797e('0x19d')])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20sms\x20account\x20configured');}var _0x26dd2c=this[_0x797e('0x35')][_0x797e('0x71')](this,_0x5afd3f[_0x797e('0x19d')]);if(!_0x26dd2c){return this[_0x797e('0x11')][_0x797e('0x30')](_0x5afd3f,_0x797e('0x19e'));}var _0x210631={'body':_0x5afd3f[_0x797e('0x19f')],'phone':_0x5afd3f['to']||'','SmsAccountId':_0x26dd2c['id']};logger[_0x797e('0xde')](_0x797e('0x1a0'),JSON['stringify'](_0x210631));this[_0x797e('0x38')][_0x797e('0x71')](this,_0x5afd3f,_0x5afd3f[_0x797e('0x19d')]);this['channel'][_0x797e('0xab')](util['format'](_0x797e('0x1a1'),_0x26dd2c['name']));this[_0x797e('0x37')][_0x797e('0x71')](this,_0x210631);return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x1a2'));};AGIVertices[_0x797e('0x14')][_0x797e('0x1a3')]=function(_0x181ea5){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1a4'),_0x181ea5[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x181ea5['variable_id'])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x181ea5,_0x797e('0x1a5'));}var _0x330ec8=this[_0x797e('0x15')][_0x797e('0x71')](this,_0x181ea5[_0x797e('0xd7')]);if(!_0x330ec8){return this['channel'][_0x797e('0x30')](_0x181ea5,_0x797e('0xd9'));}return this[_0x797e('0x11')][_0x797e('0xa2')](_0x330ec8,_0x181ea5[_0x797e('0x1a6')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x1a7')]=function(_0x5cd696){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1a8'),_0x5cd696[_0x797e('0x3a')]));this[_0x797e('0x11')][_0x797e('0xab')]('START\x20CALLY\x20SQUARE');if(_0x5cd696[_0x797e('0xbb')]===_0x797e('0x1a9')){this['channel'][_0x797e('0xab')](_0x797e('0x1aa'));return this['channel'][_0x797e('0xbb')]();}return this['channel'][_0x797e('0xab')](_0x797e('0x1ab'));};AGIVertices[_0x797e('0x14')][_0x797e('0x1ac')]=function(_0x4856b7){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x1ad'),_0x4856b7[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x4856b7[_0x797e('0x1ae')])){return this['channel'][_0x797e('0x30')](_0x4856b7,_0x797e('0x1af'));}var _0x56f61f=this[_0x797e('0x1b')][_0x797e('0x71')](this,_0x4856b7['project_id']);if(!this[_0x797e('0x88')](_0x56f61f)){return this[_0x797e('0x11')]['error'](_0x4856b7,util['format'](_0x797e('0x1b0'),_0x4856b7[_0x797e('0x1ae')]));}if(_0x56f61f===this[_0x797e('0x11')]['arg_1']){return this['channel']['error'](_0x4856b7,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x797e('0x38')][_0x797e('0x71')](this,_0x4856b7,_0x56f61f);var _0xb2a1e0=this[_0x797e('0x11')][_0x797e('0x59')]('AGI',util['format'](_0x797e('0x1b1'),config[_0x797e('0x8')][_0x797e('0x1b2')]||'127.0.0.1',_0x56f61f,this[_0x797e('0x11')][_0x797e('0x3b')]));if(_0xb2a1e0[_0x797e('0xa6')]===-0x1){return _0xb2a1e0;}return this['channel']['noop'](util['format'](_0x797e('0xc4'),'AGI',_0x56f61f));};AGIVertices[_0x797e('0x14')][_0x797e('0x1b3')]=function(_0xf8909){logger[_0x797e('0x32')](util['format'](_0x797e('0x1b4'),_0xf8909['label']));var _0x5d0adc=this[_0x797e('0x58')][_0x797e('0x71')](this,_0xf8909[_0x797e('0x1b5')]);this[_0x797e('0x38')]['sync'](this,_0xf8909,_0xf8909[_0x797e('0x1b5')]);if(this[_0x797e('0x88')](_0xf8909[_0x797e('0xd7')])){var _0x404c7c=this[_0x797e('0x15')][_0x797e('0x71')](this,_0xf8909[_0x797e('0xd7')]);if(_0x404c7c){this[_0x797e('0x11')][_0x797e('0xa2')](_0x404c7c,_0x5d0adc);return this['channel'][_0x797e('0xab')](util['format'](_0x797e('0x1b6'),_0xf8909[_0x797e('0x1b5')],_0x404c7c));}}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x1b7'),_0xf8909[_0x797e('0x1b5')]));};AGIVertices[_0x797e('0x14')][_0x797e('0x1b8')]=function(_0x580a99){logger['info'](util['format'](_0x797e('0x1b9'),_0x580a99['label']));_0x580a99[_0x797e('0x5d')]=_0x580a99[_0x797e('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x797e('0x88')](_0x580a99['apiKey'])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x580a99['text'])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20text\x20configured');}this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x1ba'),_0x580a99['text']));var _0x3e8b09=this[_0x797e('0x5b')][_0x797e('0x71')](this,_0x580a99);if(_0x3e8b09){this[_0x797e('0x11')][_0x797e('0xab')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3e8b09));var _0x7e131c=this[_0x797e('0x11')][_0x797e('0x124')](_0x3e8b09);try{fs[_0x797e('0x103')](_0x3e8b09+'.wav');}catch(_0xd2d7b1){logger[_0x797e('0x30')](_0xd2d7b1);}return _0x7e131c;}return this[_0x797e('0x11')][_0x797e('0x30')](_0x580a99,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x797e('0x14')][_0x797e('0x1bb')]=function(_0x47935c){logger[_0x797e('0x32')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x47935c[_0x797e('0x3a')]));_0x47935c[_0x797e('0x5d')]=_0x47935c[_0x797e('0x5d')][_0x797e('0x187')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x797e('0x88')](_0x47935c[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x1bc'),_0x47935c[_0x797e('0x5d')]));var _0x47a432=this[_0x797e('0x63')]['sync'](this,_0x47935c);if(_0x47a432){this[_0x797e('0x11')]['noop'](util['format'](_0x797e('0x1bd'),_0x47a432));var _0x3bb3f2=this[_0x797e('0x11')][_0x797e('0x124')](_0x47a432);try{fs['unlink'](_0x47a432+'.wav');}catch(_0x12e3ff){logger[_0x797e('0x30')](_0x12e3ff);}return _0x3bb3f2;}return this['channel']['error'](_0x47935c,_0x797e('0x1be'));};AGIVertices[_0x797e('0x14')]['unpause']=function(_0x45b98d){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1bf'),_0x45b98d[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x45b98d[_0x797e('0x157')])){return this['channel']['error'](_0x45b98d,_0x797e('0x154'));}logger['info'](util[_0x797e('0x2d')](_0x797e('0x155'),this[_0x797e('0x11')]['callerid'],_0x45b98d[_0x797e('0x157')]));var _0x422473=this[_0x797e('0x52')][_0x797e('0x71')](this,_0x45b98d[_0x797e('0x157')]);if(_0x422473){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x156'),this['channel'][_0x797e('0x3d')],_0x45b98d[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util['format'](_0x797e('0x156'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x45b98d[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x168')};}else{logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x158'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x45b98d[_0x797e('0x157')]));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x45b98d[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices['prototype']['voicemail']=function(_0x5acba5){logger[_0x797e('0x32')](util['format'](_0x797e('0x1c0'),_0x5acba5[_0x797e('0x3a')]));var _0x25bf06=this[_0x797e('0x11')]['exec'](_0x797e('0x1c1'),[_0x5acba5[_0x797e('0x1c2')],_0x5acba5['options']]);if(_0x25bf06[_0x797e('0xa6')]===-0x1){return _0x25bf06;}return this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0xc4'),_0x797e('0x1c1'),_0x5acba5[_0x797e('0x1c2')]));};AGIVertices['prototype'][_0x797e('0x1c3')]=function(_0x69950e){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1c4'),_0x69950e[_0x797e('0x3a')]));if(!this['isConfigured'](_0x69950e[_0x797e('0xd7')])){return this['channel'][_0x797e('0x30')](_0x69950e,_0x797e('0x1a5'));}var _0x3395be=this[_0x797e('0x15')]['sync'](this,_0x69950e[_0x797e('0xd7')]);if(!_0x3395be){return this['channel'][_0x797e('0x30')](_0x69950e,_0x797e('0xd9'));}var _0x2d2a94=this[_0x797e('0x11')][_0x797e('0x15')](_0x3395be);return{'code':0xc8,'result':_0x2d2a94[_0x797e('0xa4')]?_0x2d2a94['extra']:'-'};};String[_0x797e('0x14')][_0x797e('0x1c5')]=function(_0x16a5cd,_0x36c1a6){return this[_0x797e('0xa3')](_0x16a5cd)[_0x797e('0x1c6')](_0x36c1a6);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 228cd95..85a4f48 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 _0x19be=['[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[ACW][syncHangupRequest]\x20%s','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','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','blindtransfer','milliseconds','diff','seconds','startAcw','interface','queue','ACW','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','agents','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause'];(function(_0x3f7bef,_0x56cac3){var _0x3ebd95=function(_0x3f4645){while(--_0x3f4645){_0x3f7bef['push'](_0x3f7bef['shift']());}};_0x3ebd95(++_0x56cac3);}(_0x19be,0x128));var _0xe19b=function(_0x19b042,_0x5656d7){_0x19b042=_0x19b042-0x0;var _0x1e12e6=_0x19be[_0x19b042];return _0x1e12e6;};'use strict';var util=require(_0xe19b('0x0'));var _=require(_0xe19b('0x1'));var moment=require('moment');var ami=require(_0xe19b('0x2'));var logger=require('../../../config/logger')(_0xe19b('0x3'));var RpcUser=require(_0xe19b('0x4'));var RpcVoiceAgentReport=require(_0xe19b('0x5'));function Acw(_0x199f06){this[_0xe19b('0x6')]=_0x199f06[_0xe19b('0x6')];this['agents']=_0x199f06['agents'];this[_0xe19b('0x7')]=_0x199f06['timers'];this[_0xe19b('0x8')]={};ami['on'](_0xe19b('0x9'),this[_0xe19b('0xa')][_0xe19b('0xb')](this));ami['on'](_0xe19b('0xc'),this[_0xe19b('0xd')]['bind'](this));ami['on'](_0xe19b('0xe'),this['syncHangup']['bind'](this));ami['on'](_0xe19b('0xf'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xe19b('0x10'),this['syncAttendedTransfer'][_0xe19b('0xb')](this));ami['on'](_0xe19b('0x11'),this['syncBlindTransfer'][_0xe19b('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xe19b('0xb')](this));}function getDiff(_0x36bcf9){var _0x527540=moment()[_0xe19b('0x12')](0x0);var _0x327610=moment(_0x36bcf9)[_0xe19b('0x12')](0x0);return _0x527540[_0xe19b('0x13')](_0x327610,_0xe19b('0x14'));}Acw['prototype'][_0xe19b('0x15')]=function(_0x454e54){try{var _0x5e48d1=this;var _0x4a0f2f=this[_0xe19b('0x8')][_0x454e54][_0xe19b('0x16')];var _0xb021c8=this['channels'][_0x454e54][_0xe19b('0x17')];var _0x5e173e=this['voiceQueues'][_0xb021c8];var _0x4aa9ad=![];var _0x582307=_0xe19b('0x18');if(_0x5e173e['mandatoryDisposition']){if(_0x5e173e['mandatoryDispositionPause'][_0xe19b('0x19')]){_0x4aa9ad=!![];_0x582307=_0x5e173e[_0xe19b('0x1a')][_0xe19b('0x19')];}}ami[_0xe19b('0x1b')]({'action':_0xe19b('0x1c'),'interface':_0x4a0f2f,'paused':!![],'reason':_0x582307})[_0xe19b('0x1d')](function(_0x659200){if(_0x5e48d1['agents'][_0x4a0f2f]){return RpcUser[_0xe19b('0x1e')](_0x5e48d1[_0xe19b('0x1f')][_0x4a0f2f]['id'])[_0xe19b('0x1d')](function(_0x273a5d){if(_0x273a5d&&!_0x273a5d['voicePause']){logger['info'](_0xe19b('0x20'),_0x454e54,_0x4a0f2f,_0xb021c8);var _0x207c87=_0x5e48d1['channels'][_0x454e54]['attended']&&_0x5e48d1['channels'][_0x454e54]['destlinkedid']?_0x5e48d1[_0xe19b('0x8')][_0x454e54][_0xe19b('0x21')]:_0x454e54;return RpcUser[_0xe19b('0x22')](_0x5e48d1['agents'][_0x4a0f2f],_0x582307,_0x207c87)[_0xe19b('0x1d')](function(_0x28f5e5){if(!_0x4aa9ad){_0x5e48d1[_0xe19b('0x7')][_0x4a0f2f]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x454e54,_0x5e48d1['voiceQueues'][_0xb021c8][_0xe19b('0x23')],_0x4a0f2f,_0xb021c8);_0x5e48d1[_0xe19b('0x7')][_0x4a0f2f][_0xe19b('0x24')]=setTimeout(_0x5e48d1[_0xe19b('0x25')][_0xe19b('0xb')](_0x5e48d1,_0x4a0f2f),_0x5e48d1[_0xe19b('0x6')][_0xb021c8]['acwTimeout']*0x3e8);_0x5e48d1[_0xe19b('0x7')][_0x4a0f2f][_0xe19b('0x26')]=moment()[_0xe19b('0x27')](_0xe19b('0x28'));_0x5e48d1[_0xe19b('0x7')][_0x4a0f2f][_0xe19b('0x29')]=_0x454e54;_0x5e48d1['timers'][_0x4a0f2f][_0xe19b('0x17')]=_0xb021c8;_0x5e48d1[_0xe19b('0x7')][_0x4a0f2f][_0xe19b('0x2a')]=function(){var _0x447c7e=getDiff(_0x5e48d1[_0xe19b('0x7')][_0x4a0f2f][_0xe19b('0x26')]);clearTimeout(_0x5e48d1['timers'][_0x4a0f2f][_0xe19b('0x24')]);_0x5e48d1['timers'][_0x4a0f2f]['timer']=![];RpcVoiceAgentReport[_0xe19b('0x2b')]({'acwtime':_0x447c7e},_0x5e48d1['timers'][_0x4a0f2f][_0xe19b('0x29')],_0x4a0f2f)[_0xe19b('0x1d')](function(_0x2ccb9b){logger[_0xe19b('0x2c')](_0xe19b('0x2d'),_0x454e54,_0x447c7e,_0x2ccb9b);})[_0xe19b('0x2e')](function(_0x3f946e){logger[_0xe19b('0x2f')](_0xe19b('0x30'),_0x454e54,_0x3f946e);});delete _0x5e48d1[_0xe19b('0x7')][_0x4a0f2f];};}});}else{logger[_0xe19b('0x2c')](_0xe19b('0x31'),_0x454e54,_0x4a0f2f,_0xb021c8);}});}})[_0xe19b('0x2e')](function(_0x1e97f7){logger[_0xe19b('0x2f')](_0xe19b('0x32'),_0x454e54,_0x5e48d1[_0xe19b('0x6')][_0xb021c8][_0xe19b('0x23')],_0x4a0f2f,_0xb021c8);})['finally'](function(){delete _0x5e48d1[_0xe19b('0x8')][_0x454e54];});}catch(_0x2726c9){logger[_0xe19b('0x2f')](_0xe19b('0x33'),_0x2726c9[_0xe19b('0x34')]);}};Acw[_0xe19b('0x35')]['stopAcw']=function(_0x18788d){try{var _0x4f61d3=this;if(_0x4f61d3[_0xe19b('0x7')][_0x18788d]){_0x4f61d3[_0xe19b('0x7')][_0x18788d]['timer']=![];var _0x4cb6b3=_0x4f61d3['timers'][_0x18788d]['uniqueid'];var _0x328b23=_0x4f61d3['timers'][_0x18788d][_0xe19b('0x17')];var _0x3611f1=_0x4f61d3[_0xe19b('0x6')][_0x328b23][_0xe19b('0x23')];logger[_0xe19b('0x2c')](_0xe19b('0x36'),_0x4cb6b3,_0x18788d);RpcUser[_0xe19b('0x37')](this['agents'][_0x18788d]);RpcVoiceAgentReport[_0xe19b('0x2b')]({'acwtime':_0x3611f1,'agentacw':!![]},_0x4cb6b3,_0x18788d)[_0xe19b('0x1d')](function(_0x1589bd){logger[_0xe19b('0x2c')]('[%s][UPDATE][ACWTIME:%s]',_0x4cb6b3,_0x3611f1,_0x1589bd);})[_0xe19b('0x2e')](function(_0x26a903){logger[_0xe19b('0x2f')](_0xe19b('0x30'),_0x4cb6b3,_0x26a903);});}else{logger[_0xe19b('0x2f')](_0xe19b('0x38'),_0x18788d);if(_0x4f61d3[_0xe19b('0x7')]){logger[_0xe19b('0x2c')]('[ACW][TIMERS]',JSON['stringify'](_0x4f61d3['timers']));}}}catch(_0x42df31){logger['error'](_0xe19b('0x39'),_0x42df31[_0xe19b('0x34')]);}};Acw[_0xe19b('0x35')]['syncAgentConnect']=function(_0x202737){try{if(this[_0xe19b('0x6')][_0x202737[_0xe19b('0x17')]]&&(this[_0xe19b('0x6')][_0x202737[_0xe19b('0x17')]][_0xe19b('0x3')]||this[_0xe19b('0x6')][_0x202737['queue']]['mandatoryDisposition'])){if(this[_0xe19b('0x1f')][_0x202737[_0xe19b('0x16')]]){this['channels'][_0x202737[_0xe19b('0x29')]]={'queue':_0x202737[_0xe19b('0x17')],'interface':_0x202737[_0xe19b('0x16')],'destlinkedid':_0x202737[_0xe19b('0x21')]};}}}catch(_0xfdc911){logger[_0xe19b('0x2f')](_0xe19b('0x3a'),_0xfdc911['message']);}};Acw['prototype'][_0xe19b('0x3b')]=function(_0x1bdf42){try{if(this['voiceQueues'][_0x1bdf42[_0xe19b('0x17')]]&&(this['voiceQueues'][_0x1bdf42[_0xe19b('0x17')]][_0xe19b('0x3')]||this[_0xe19b('0x6')][_0x1bdf42[_0xe19b('0x17')]]['mandatoryDisposition'])){if(this['agents'][_0x1bdf42[_0xe19b('0x16')]]){this['channels'][_0x1bdf42[_0xe19b('0x29')]]={'queue':_0x1bdf42['queue'],'interface':_0x1bdf42[_0xe19b('0x16')]};}}}catch(_0x4b797f){logger[_0xe19b('0x2f')](_0xe19b('0x3c'),_0x4b797f[_0xe19b('0x34')]);}};Acw[_0xe19b('0x35')][_0xe19b('0xd')]=function(_0x354a14){try{if(this[_0xe19b('0x8')][_0x354a14[_0xe19b('0x29')]]&&_['isUndefined'](this[_0xe19b('0x8')][_0x354a14['uniqueid']][_0xe19b('0x3d')])){logger[_0xe19b('0x2c')](_0xe19b('0x3e'),_0x354a14[_0xe19b('0x29')]);this[_0xe19b('0x15')](_0x354a14[_0xe19b('0x29')]);}else if(this['channels'][_0x354a14[_0xe19b('0x3f')]]&&_[_0xe19b('0x40')](this[_0xe19b('0x8')][_0x354a14['linkedid']][_0xe19b('0x3d')])){logger[_0xe19b('0x2c')]('[%s][HANGUP:LINKEDID]',_0x354a14['linkedid']);this[_0xe19b('0x15')](_0x354a14[_0xe19b('0x3f')]);}}catch(_0x2f8145){logger[_0xe19b('0x2f')](_0xe19b('0x41'),_0x2f8145[_0xe19b('0x34')]);}};Acw[_0xe19b('0x35')][_0xe19b('0x42')]=function(_0x40589b){try{if(this[_0xe19b('0x8')][_0x40589b[_0xe19b('0x29')]]&&this[_0xe19b('0x8')][_0x40589b[_0xe19b('0x29')]][_0xe19b('0x3d')]){logger['info'](_0xe19b('0x43'),_0x40589b['uniqueid']);this['startAcw'](_0x40589b[_0xe19b('0x29')]);}else if(this[_0xe19b('0x8')][_0x40589b[_0xe19b('0x3f')]]&&this[_0xe19b('0x8')][_0x40589b[_0xe19b('0x3f')]][_0xe19b('0x3d')]){logger[_0xe19b('0x2c')](_0xe19b('0x44'),_0x40589b[_0xe19b('0x3f')]);this[_0xe19b('0x15')](_0x40589b[_0xe19b('0x3f')]);}}catch(_0x314bf8){logger[_0xe19b('0x2f')](_0xe19b('0x45'),_0x314bf8[_0xe19b('0x34')]);}};Acw[_0xe19b('0x35')]['syncAttendedTransfer']=function(_0x2ea7ae){try{if(!_[_0xe19b('0x46')](this[_0xe19b('0x8')][_0x2ea7ae[_0xe19b('0x47')]])){this[_0xe19b('0x15')](_0x2ea7ae['transfereeuniqueid']);if(this[_0xe19b('0x8')][_0x2ea7ae['secondtransfereruniqueid']]){this[_0xe19b('0x8')][_0x2ea7ae[_0xe19b('0x48')]][_0xe19b('0x3d')]=!![];this[_0xe19b('0x8')][_0x2ea7ae[_0xe19b('0x49')]]=this['channels'][_0x2ea7ae[_0xe19b('0x48')]];delete this['channels'][_0x2ea7ae['secondtransfereruniqueid']];}}else if(!_['isNil'](this['channels'][_0x2ea7ae[_0xe19b('0x49')]])){this['startAcw'](_0x2ea7ae[_0xe19b('0x49')]);if(this[_0xe19b('0x8')][_0x2ea7ae[_0xe19b('0x4a')]]){this[_0xe19b('0x8')][_0x2ea7ae[_0xe19b('0x4a')]]['attended']=!![];this[_0xe19b('0x8')][_0x2ea7ae[_0xe19b('0x47')]]=this[_0xe19b('0x8')][_0x2ea7ae[_0xe19b('0x4a')]];delete this[_0xe19b('0x8')][_0x2ea7ae['origtransfereruniqueid']];}}}catch(_0x924ec6){logger[_0xe19b('0x2f')](_0xe19b('0x4b'),_0x924ec6[_0xe19b('0x34')]);}};Acw[_0xe19b('0x35')]['syncBlindTransfer']=function(_0x1f5cc7){try{if(this[_0xe19b('0x8')][_0x1f5cc7[_0xe19b('0x4c')]]){logger['info'](_0xe19b('0x4d'),JSON[_0xe19b('0x4e')](_0x1f5cc7[_0xe19b('0x4c')]));this[_0xe19b('0x15')](_0x1f5cc7[_0xe19b('0x4c')]);}else if(this[_0xe19b('0x8')][_0x1f5cc7[_0xe19b('0x4f')]]){logger[_0xe19b('0x2c')](_0xe19b('0x50'),JSON[_0xe19b('0x4e')](_0x1f5cc7[_0xe19b('0x4f')]));this[_0xe19b('0x15')](_0x1f5cc7[_0xe19b('0x4f')]);}}catch(_0x10403e){logger[_0xe19b('0x2f')](_0xe19b('0x51'),_0x10403e[_0xe19b('0x34')]);}};Acw[_0xe19b('0x35')][_0xe19b('0x52')]=function(_0x44ce8d){try{if(this[_0xe19b('0x6')][_0x44ce8d[_0xe19b('0x17')]]&&this['voiceQueues'][_0x44ce8d[_0xe19b('0x17')]][_0xe19b('0x53')]===_0xe19b('0x54')){if(this[_0xe19b('0x1f')][_0x44ce8d[_0xe19b('0x16')]]){logger[_0xe19b('0x2c')](_0xe19b('0x55'),_0x44ce8d['uniqueid'],_0x44ce8d[_0xe19b('0x16')],_0x44ce8d[_0xe19b('0x17')]);return RpcUser['savePause'](this['agents'][_0x44ce8d[_0xe19b('0x16')]],_0xe19b('0x56'),_0x44ce8d[_0xe19b('0x29')]);}}}catch(_0x64bf35){logger[_0xe19b('0x2f')](_0xe19b('0x57'),_0x64bf35['message']);}};module['exports']=Acw; \ No newline at end of file +var _0xfc26=['[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','update','uniqueid'];(function(_0x1b0a56,_0x2f27eb){var _0x1de1ff=function(_0x40b341){while(--_0x40b341){_0x1b0a56['push'](_0x1b0a56['shift']());}};_0x1de1ff(++_0x2f27eb);}(_0xfc26,0xda));var _0x6fc2=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0xfc26[_0x35af23];return _0x340506;};'use strict';var util=require(_0x6fc2('0x0'));var _=require(_0x6fc2('0x1'));var moment=require('moment');var ami=require(_0x6fc2('0x2'));var logger=require(_0x6fc2('0x3'))(_0x6fc2('0x4'));var RpcUser=require(_0x6fc2('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x34055e){this[_0x6fc2('0x6')]=_0x34055e[_0x6fc2('0x6')];this[_0x6fc2('0x7')]=_0x34055e[_0x6fc2('0x7')];this[_0x6fc2('0x8')]=_0x34055e[_0x6fc2('0x8')];this[_0x6fc2('0x9')]={};ami['on']('agentconnect',this[_0x6fc2('0xa')][_0x6fc2('0xb')](this));ami['on'](_0x6fc2('0xc'),this[_0x6fc2('0xd')][_0x6fc2('0xb')](this));ami['on'](_0x6fc2('0xe'),this[_0x6fc2('0xf')]['bind'](this));ami['on'](_0x6fc2('0x10'),this[_0x6fc2('0x11')][_0x6fc2('0xb')](this));ami['on'](_0x6fc2('0x12'),this[_0x6fc2('0x13')][_0x6fc2('0xb')](this));ami['on'](_0x6fc2('0x14'),this['syncBlindTransfer'][_0x6fc2('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x6fc2('0x15')]['bind'](this));}function getDiff(_0x4cf3c8){var _0x55cd85=moment()[_0x6fc2('0x16')](0x0);var _0x5a7740=moment(_0x4cf3c8)[_0x6fc2('0x16')](0x0);return _0x55cd85['diff'](_0x5a7740,_0x6fc2('0x17'));}Acw['prototype'][_0x6fc2('0x18')]=function(_0x2cba81){try{var _0x116314=this;var _0xf5f595=this[_0x6fc2('0x9')][_0x2cba81][_0x6fc2('0x19')];var _0x31305a=this['channels'][_0x2cba81][_0x6fc2('0x1a')];var _0x24fe63=this[_0x6fc2('0x6')][_0x31305a];var _0x4d5adb=![];var _0x1a0941=_0x6fc2('0x1b');if(_0x24fe63[_0x6fc2('0x1c')]){if(_0x24fe63[_0x6fc2('0x1d')][_0x6fc2('0x1e')]){_0x4d5adb=!![];_0x1a0941=_0x24fe63['mandatoryDispositionPause'][_0x6fc2('0x1e')];}}ami[_0x6fc2('0x1f')]({'action':_0x6fc2('0x20'),'interface':_0xf5f595,'paused':!![],'reason':_0x1a0941})['then'](function(_0x3bc7ad){if(_0x116314['agents'][_0xf5f595]){return RpcUser[_0x6fc2('0x21')](_0x116314[_0x6fc2('0x7')][_0xf5f595]['id'])[_0x6fc2('0x22')](function(_0x3d718e){if(_0x3d718e&&!_0x3d718e[_0x6fc2('0x23')]){logger['info'](_0x6fc2('0x24'),_0x2cba81,_0xf5f595,_0x31305a);var _0x318f06=_0x116314[_0x6fc2('0x9')][_0x2cba81]['attended']&&_0x116314['channels'][_0x2cba81][_0x6fc2('0x25')]?_0x116314[_0x6fc2('0x9')][_0x2cba81][_0x6fc2('0x25')]:_0x2cba81;return RpcUser[_0x6fc2('0x26')](_0x116314[_0x6fc2('0x7')][_0xf5f595],_0x1a0941,_0x318f06)[_0x6fc2('0x22')](function(_0x1385f7){if(!_0x4d5adb){_0x116314[_0x6fc2('0x8')][_0xf5f595]={};logger[_0x6fc2('0x27')](_0x6fc2('0x28'),_0x2cba81,_0x116314[_0x6fc2('0x6')][_0x31305a][_0x6fc2('0x29')],_0xf5f595,_0x31305a);_0x116314[_0x6fc2('0x8')][_0xf5f595][_0x6fc2('0x2a')]=setTimeout(_0x116314[_0x6fc2('0x2b')]['bind'](_0x116314,_0xf5f595),_0x116314[_0x6fc2('0x6')][_0x31305a]['acwTimeout']*0x3e8);_0x116314['timers'][_0xf5f595][_0x6fc2('0x2c')]=moment()[_0x6fc2('0x2d')](_0x6fc2('0x2e'));_0x116314[_0x6fc2('0x8')][_0xf5f595]['uniqueid']=_0x2cba81;_0x116314[_0x6fc2('0x8')][_0xf5f595][_0x6fc2('0x1a')]=_0x31305a;_0x116314[_0x6fc2('0x8')][_0xf5f595]['updateAcw']=function(){var _0x5c7b28=getDiff(_0x116314[_0x6fc2('0x8')][_0xf5f595][_0x6fc2('0x2c')]);clearTimeout(_0x116314[_0x6fc2('0x8')][_0xf5f595][_0x6fc2('0x2a')]);_0x116314[_0x6fc2('0x8')][_0xf5f595][_0x6fc2('0x2a')]=![];RpcVoiceAgentReport[_0x6fc2('0x2f')]({'acwtime':_0x5c7b28},_0x116314[_0x6fc2('0x8')][_0xf5f595][_0x6fc2('0x30')],_0xf5f595)[_0x6fc2('0x22')](function(_0x4a4d21){logger[_0x6fc2('0x27')](_0x6fc2('0x31'),_0x2cba81,_0x5c7b28,_0x4a4d21);})[_0x6fc2('0x32')](function(_0x45818b){logger[_0x6fc2('0x33')](_0x6fc2('0x34'),_0x2cba81,_0x45818b);});delete _0x116314[_0x6fc2('0x8')][_0xf5f595];};}});}else{logger['info'](_0x6fc2('0x35'),_0x2cba81,_0xf5f595,_0x31305a);}});}})['catch'](function(_0x4a5bf1){logger[_0x6fc2('0x33')](_0x6fc2('0x28'),_0x2cba81,_0x116314[_0x6fc2('0x6')][_0x31305a][_0x6fc2('0x29')],_0xf5f595,_0x31305a);})[_0x6fc2('0x36')](function(){delete _0x116314[_0x6fc2('0x9')][_0x2cba81];});}catch(_0x5ce417){logger[_0x6fc2('0x33')](_0x6fc2('0x37'),_0x5ce417[_0x6fc2('0x38')]);}};Acw[_0x6fc2('0x39')]['stopAcw']=function(_0x29779a){try{var _0x53faee=this;if(_0x53faee[_0x6fc2('0x8')][_0x29779a]){_0x53faee[_0x6fc2('0x8')][_0x29779a][_0x6fc2('0x2a')]=![];var _0xb754b7=_0x53faee['timers'][_0x29779a][_0x6fc2('0x30')];var _0x454c4d=_0x53faee['timers'][_0x29779a][_0x6fc2('0x1a')];var _0x2f5bc2=_0x53faee[_0x6fc2('0x6')][_0x454c4d]['acwTimeout'];logger[_0x6fc2('0x27')](_0x6fc2('0x3a'),_0xb754b7,_0x29779a);RpcUser[_0x6fc2('0x3b')](this[_0x6fc2('0x7')][_0x29779a]);RpcVoiceAgentReport[_0x6fc2('0x2f')]({'acwtime':_0x2f5bc2,'agentacw':!![]},_0xb754b7,_0x29779a)['then'](function(_0x142ead){logger[_0x6fc2('0x27')](_0x6fc2('0x31'),_0xb754b7,_0x2f5bc2,_0x142ead);})[_0x6fc2('0x32')](function(_0x3d93d9){logger['error'](_0x6fc2('0x34'),_0xb754b7,_0x3d93d9);});}else{logger['error'](_0x6fc2('0x3c'),_0x29779a);if(_0x53faee[_0x6fc2('0x8')]){logger[_0x6fc2('0x27')](_0x6fc2('0x3d'),JSON[_0x6fc2('0x3e')](_0x53faee[_0x6fc2('0x8')]));}}}catch(_0x2e281b){logger[_0x6fc2('0x33')](_0x6fc2('0x3f'),_0x2e281b[_0x6fc2('0x38')]);}};Acw[_0x6fc2('0x39')][_0x6fc2('0xa')]=function(_0x25e154){try{if(this[_0x6fc2('0x6')][_0x25e154[_0x6fc2('0x1a')]]&&(this[_0x6fc2('0x6')][_0x25e154[_0x6fc2('0x1a')]][_0x6fc2('0x4')]||this[_0x6fc2('0x6')][_0x25e154[_0x6fc2('0x1a')]][_0x6fc2('0x1c')])){if(this['agents'][_0x25e154[_0x6fc2('0x19')]]){this['channels'][_0x25e154[_0x6fc2('0x30')]]={'queue':_0x25e154[_0x6fc2('0x1a')],'interface':_0x25e154['interface'],'destlinkedid':_0x25e154['destlinkedid']};}}}catch(_0x57f677){logger[_0x6fc2('0x33')](_0x6fc2('0x40'),_0x57f677[_0x6fc2('0x38')]);}};Acw[_0x6fc2('0x39')]['syncAgentConnectPreview']=function(_0x321071){try{if(this[_0x6fc2('0x6')][_0x321071['queue']]&&(this['voiceQueues'][_0x321071[_0x6fc2('0x1a')]][_0x6fc2('0x4')]||this[_0x6fc2('0x6')][_0x321071[_0x6fc2('0x1a')]][_0x6fc2('0x1c')])){if(this[_0x6fc2('0x7')][_0x321071[_0x6fc2('0x19')]]){this[_0x6fc2('0x9')][_0x321071[_0x6fc2('0x30')]]={'queue':_0x321071[_0x6fc2('0x1a')],'interface':_0x321071[_0x6fc2('0x19')]};}}}catch(_0x126e56){logger[_0x6fc2('0x33')]('[ACW][syncAgentConnectPreview]\x20%s',_0x126e56[_0x6fc2('0x38')]);}};Acw[_0x6fc2('0x39')][_0x6fc2('0xd')]=function(_0x264dc0){try{if(this[_0x6fc2('0x9')][_0x264dc0[_0x6fc2('0x30')]]&&_[_0x6fc2('0x41')](this[_0x6fc2('0x9')][_0x264dc0[_0x6fc2('0x30')]][_0x6fc2('0x42')])){logger[_0x6fc2('0x27')](_0x6fc2('0x43'),_0x264dc0[_0x6fc2('0x30')]);this[_0x6fc2('0x18')](_0x264dc0[_0x6fc2('0x30')]);}else if(this[_0x6fc2('0x9')][_0x264dc0[_0x6fc2('0x44')]]&&_[_0x6fc2('0x41')](this[_0x6fc2('0x9')][_0x264dc0['linkedid']][_0x6fc2('0x42')])){logger[_0x6fc2('0x27')](_0x6fc2('0x45'),_0x264dc0['linkedid']);this[_0x6fc2('0x18')](_0x264dc0[_0x6fc2('0x44')]);}}catch(_0x5d0339){logger[_0x6fc2('0x33')](_0x6fc2('0x46'),_0x5d0339[_0x6fc2('0x38')]);}};Acw['prototype']['syncHangup']=function(_0x174227){try{if(this[_0x6fc2('0x9')][_0x174227[_0x6fc2('0x30')]]&&this[_0x6fc2('0x9')][_0x174227[_0x6fc2('0x30')]][_0x6fc2('0x42')]){logger[_0x6fc2('0x27')](_0x6fc2('0x47'),_0x174227[_0x6fc2('0x30')]);this[_0x6fc2('0x18')](_0x174227[_0x6fc2('0x30')]);}else if(this['channels'][_0x174227[_0x6fc2('0x44')]]&&this[_0x6fc2('0x9')][_0x174227['linkedid']][_0x6fc2('0x42')]){logger['info'](_0x6fc2('0x48'),_0x174227['linkedid']);this[_0x6fc2('0x18')](_0x174227[_0x6fc2('0x44')]);}}catch(_0x19480f){logger[_0x6fc2('0x33')](_0x6fc2('0x49'),_0x19480f['message']);}};Acw['prototype'][_0x6fc2('0x13')]=function(_0x199b31){try{if(!_['isNil'](this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4a')]])){this['startAcw'](_0x199b31[_0x6fc2('0x4a')]);if(this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4b')]]){this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4b')]][_0x6fc2('0x42')]=!![];this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4c')]]=this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4b')]];delete this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4b')]];}}else if(!_[_0x6fc2('0x4d')](this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4c')]])){this[_0x6fc2('0x18')](_0x199b31[_0x6fc2('0x4c')]);if(this['channels'][_0x199b31[_0x6fc2('0x4e')]]){this['channels'][_0x199b31[_0x6fc2('0x4e')]][_0x6fc2('0x42')]=!![];this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4a')]]=this['channels'][_0x199b31['origtransfereruniqueid']];delete this[_0x6fc2('0x9')][_0x199b31[_0x6fc2('0x4e')]];}}}catch(_0x39db7a){logger[_0x6fc2('0x33')](_0x6fc2('0x4f'),_0x39db7a[_0x6fc2('0x38')]);}};Acw[_0x6fc2('0x39')]['syncBlindTransfer']=function(_0xdff2e8){try{if(this[_0x6fc2('0x9')][_0xdff2e8[_0x6fc2('0x50')]]){logger[_0x6fc2('0x27')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x6fc2('0x3e')](_0xdff2e8['transfereruniqueid']));this[_0x6fc2('0x18')](_0xdff2e8[_0x6fc2('0x50')]);}else if(this[_0x6fc2('0x9')][_0xdff2e8[_0x6fc2('0x51')]]){logger[_0x6fc2('0x27')](_0x6fc2('0x52'),JSON[_0x6fc2('0x3e')](_0xdff2e8['transfererlinkedid']));this[_0x6fc2('0x18')](_0xdff2e8['transfererlinkedid']);}}catch(_0x1835f1){logger[_0x6fc2('0x33')](_0x6fc2('0x53'),_0x1835f1['message']);}};Acw[_0x6fc2('0x39')]['syncAgentRingNoAnswer']=function(_0xf6777b){try{if(this[_0x6fc2('0x6')][_0xf6777b[_0x6fc2('0x1a')]]&&this['voiceQueues'][_0xf6777b['queue']][_0x6fc2('0x54')]===_0x6fc2('0x55')){if(this[_0x6fc2('0x7')][_0xf6777b['interface']]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0xf6777b[_0x6fc2('0x30')],_0xf6777b[_0x6fc2('0x19')],_0xf6777b[_0x6fc2('0x1a')]);return RpcUser[_0x6fc2('0x26')](this[_0x6fc2('0x7')][_0xf6777b['interface']],_0x6fc2('0x56'),_0xf6777b['uniqueid']);}}}catch(_0x3d98ef){logger[_0x6fc2('0x33')](_0x6fc2('0x57'),_0x3d98ef[_0x6fc2('0x38')]);}};module[_0x6fc2('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index eeeb93c..beedda3 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x2c27e0,_0x578a8d){var _0x78a869=function(_0x2652ee){while(--_0x2652ee){_0x2c27e0['push'](_0x2c27e0['shift']());}};_0x78a869(++_0x578a8d);}(_0xb10b,0x12a));var _0xbb10=function(_0x24e8db,_0x89fc47){_0x24e8db=_0x24e8db-0x0;var _0x576cc1=_0xb10b[_0x24e8db];return _0x576cc1;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0x0713=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','[ami.js][fullybooted]','exports','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','error'];(function(_0x4bf83e,_0x429223){var _0x5647c9=function(_0x195bae){while(--_0x195bae){_0x4bf83e['push'](_0x4bf83e['shift']());}};_0x5647c9(++_0x429223);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x3071('0x0'));var util=require(_0x3071('0x1'));var _=require(_0x3071('0x2'));var logger=require(_0x3071('0x3'))(_0x3071('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x3071('0x5')][_0x3071('0x6')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')][_0x3071('0x8')],!![]);ami[_0x3071('0x9')]();ami[_0x3071('0xa')]=BPromise[_0x3071('0xb')](ami[_0x3071('0xc')]);function error(_0x2fce7a){logger[_0x3071('0xd')](util['format'](_0x3071('0xe'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')]['port'],util[_0x3071('0xf')](_0x2fce7a,![],null)));}function close(){logger[_0x3071('0xd')](util[_0x3071('0x10')](_0x3071('0x11'),config[_0x3071('0x5')]['username'],config['asterisk']['ip'],config[_0x3071('0x5')]['port']));}ami[_0x3071('0x12')]=function(){return function(){return ami[_0x3071('0xa')]({'action':'sipshowregistry'});};};ami[_0x3071('0x13')]=function(){return function(){return ami['Action']({'action':_0x3071('0x14')});};};ami[_0x3071('0x15')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x16')});};};ami[_0x3071('0x17')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x18')});};};ami[_0x3071('0x19')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x1a')});};};function connect(_0x5f3c22){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x1c'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')]));ami['once'](_0x3071('0xd'),error);ami[_0x3071('0x1d')](_0x3071('0x1e'),close);}ami['on']('connect',connect);ami['on'](_0x3071('0x1f'),function(_0x5cd80d){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x20'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')],util['inspect'](_0x5cd80d,![],null)));});ami['on']('fullybooted',function(_0x2ce48a){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x21'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')]));return BPromise['resolve']()[_0x3071('0x22')](ami[_0x3071('0x12')]())[_0x3071('0x22')](ami['actionDeviceStateList']())[_0x3071('0x22')](ami[_0x3071('0x15')]())[_0x3071('0x22')](ami[_0x3071('0x17')]())[_0x3071('0x22')](ami[_0x3071('0x19')]())[_0x3071('0x23')](function(_0x3921a1){logger[_0x3071('0xd')](_0x3071('0x24'),util[_0x3071('0xf')](_0x3921a1,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami[_0x3071('0x1d')](_0x3071('0x1e'),close);module[_0x3071('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 50efbb5..686ca87 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(_0x2bf3dd,_0x3b1c87){var _0x42ff71=function(_0x2399ad){while(--_0x2399ad){_0x2bf3dd['push'](_0x2bf3dd['shift']());}};_0x42ff71(++_0x3b1c87);}(_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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x24a05a,_0x3a8ed1){var _0x44340e=function(_0x488bd4){while(--_0x488bd4){_0x24a05a['push'](_0x24a05a['shift']());}};_0x44340e(++_0x3a8ed1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5d1718,_0x3c0926){_0x5d1718=_0x5d1718-0x0;var _0x1cd8ff=_0xbdb7[_0x5d1718];return _0x1cd8ff;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 60fea0e..653d467 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41f4=['ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','dialCutDigit','substring','exports','lodash','isNil','string','voiceQueue','name','phone','firstName','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41f4,0x191));var _0x441f=function(_0x28faa1,_0x595f4f){_0x28faa1=_0x28faa1-0x0;var _0x289a7e=_0x41f4[_0x28faa1];return _0x289a7e;};'use strict';var util=require('util');var _=require(_0x441f('0x0'));var moment=require('moment');function checkNameSurname(_0x4e3751,_0x5a0ed9,_0xf0be7e){var _0x24da37='';if(!_[_0x441f('0x1')](_0x5a0ed9)&&_0x441f('0x2')===typeof _0x5a0ed9){_0x24da37+=_0x5a0ed9;}if(!_[_0x441f('0x1')](_0xf0be7e)&&_0x441f('0x2')===typeof _0xf0be7e){_0x24da37+='\x20'+_0xf0be7e;}if(_0x24da37!==''){return _0x24da37;}return _0x4e3751;}function Action(_0x4f7527,_0x2089f2,_0x91b7cb){this[_0x441f('0x3')]=_0x4f7527;this['uniqueid']=_0x91b7cb||undefined;this[_0x441f('0x4')]=checkNameSurname(_0x2089f2['Contact'][_0x441f('0x5')],_0x2089f2['Contact'][_0x441f('0x6')],_0x2089f2[_0x441f('0x7')][_0x441f('0x8')]);this[_0x441f('0x9')]=_0x2089f2[_0x441f('0x5')];this[_0x441f('0xa')]=_0x4f7527[_0x441f('0x4')];this['active']=_0x2089f2[_0x441f('0xb')]||![];this[_0x441f('0xc')]=_0x4f7527[_0x441f('0xc')];this[_0x441f('0xd')]=_0x4f7527['dialQueueTimeout']||0x3;this[_0x441f('0xe')]=_0x2089f2[_0x441f('0xe')];this['countbusyretry']=_0x2089f2[_0x441f('0xf')];this[_0x441f('0x10')]=_0x2089f2[_0x441f('0x10')];this[_0x441f('0x11')]=_0x2089f2['countnoanswerretry'];this['countnosuchnumberretry']=_0x2089f2[_0x441f('0x12')];this[_0x441f('0x13')]=_0x2089f2['countdropretry'];this[_0x441f('0x14')]=_0x2089f2[_0x441f('0x14')];this[_0x441f('0x15')]=_0x2089f2['countmachineretry'];this[_0x441f('0x16')]=_0x2089f2[_0x441f('0x16')];this[_0x441f('0x17')]=_0x2089f2['ContactId'];this[_0x441f('0x18')]=_0x2089f2['ListId'];this['UserId']=_0x2089f2[_0x441f('0x19')];this['VoiceQueueId']=_0x2089f2[_0x441f('0x1a')];this[_0x441f('0x1b')]=_0x2089f2[_0x441f('0x1b')];this[_0x441f('0x1c')]=_0x2089f2['id'];this[_0x441f('0x1d')]=_0x2089f2[_0x441f('0x7')]['firstName']||'';this[_0x441f('0x1e')]=moment()[_0x441f('0x1f')](_0x441f('0x20'));this['callback']=_0x2089f2[_0x441f('0x21')];this['callbackuniqueid']=_0x2089f2[_0x441f('0x22')];this[_0x441f('0x23')]=_0x2089f2[_0x441f('0x23')];this[_0x441f('0x24')]=_0x2089f2['recallme'];this[_0x441f('0x25')]='';this['originatecalleridname']='';}Action[_0x441f('0x26')][_0x441f('0x27')]=function(){return util[_0x441f('0x1f')]('\x22%s\x22\x20<%s>',this[_0x441f('0x4')],this[_0x441f('0x3')][_0x441f('0x28')]>0x0?this[_0x441f('0x9')][_0x441f('0x29')](this[_0x441f('0x3')][_0x441f('0x28')]):this[_0x441f('0x9')]);};Action['prototype']['getQueue']=function(){return this[_0x441f('0xa')];};module[_0x441f('0x2a')]=Action; \ No newline at end of file +var _0x8a80=['countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','util','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x8a80,0x1e4));var _0x08a8=function(_0xbede1,_0x1549ad){_0xbede1=_0xbede1-0x0;var _0x208165=_0x8a80[_0xbede1];return _0x208165;};'use strict';var util=require(_0x08a8('0x0'));var _=require('lodash');var moment=require(_0x08a8('0x1'));function checkNameSurname(_0xea737f,_0x2183c7,_0x3bd835){var _0x1ab88d='';if(!_[_0x08a8('0x2')](_0x2183c7)&&'string'===typeof _0x2183c7){_0x1ab88d+=_0x2183c7;}if(!_[_0x08a8('0x2')](_0x3bd835)&&_0x08a8('0x3')===typeof _0x3bd835){_0x1ab88d+='\x20'+_0x3bd835;}if(_0x1ab88d!==''){return _0x1ab88d;}return _0xea737f;}function Action(_0x2117af,_0x185472,_0x4b3c8a){this[_0x08a8('0x4')]=_0x2117af;this['uniqueid']=_0x4b3c8a||undefined;this[_0x08a8('0x5')]=checkNameSurname(_0x185472[_0x08a8('0x6')][_0x08a8('0x7')],_0x185472[_0x08a8('0x6')][_0x08a8('0x8')],_0x185472[_0x08a8('0x6')][_0x08a8('0x9')]);this[_0x08a8('0xa')]=_0x185472[_0x08a8('0x7')];this[_0x08a8('0xb')]=_0x2117af[_0x08a8('0x5')];this['active']=_0x185472[_0x08a8('0xc')]||![];this[_0x08a8('0xd')]=_0x2117af[_0x08a8('0xd')];this[_0x08a8('0xe')]=_0x2117af[_0x08a8('0xe')]||0x3;this[_0x08a8('0xf')]=_0x185472[_0x08a8('0xf')];this[_0x08a8('0x10')]=_0x185472[_0x08a8('0x10')];this['countcongestionretry']=_0x185472['countcongestionretry'];this['countnoanswerretry']=_0x185472[_0x08a8('0x11')];this[_0x08a8('0x12')]=_0x185472[_0x08a8('0x12')];this[_0x08a8('0x13')]=_0x185472[_0x08a8('0x13')];this['countabandonedretry']=_0x185472[_0x08a8('0x14')];this[_0x08a8('0x15')]=_0x185472[_0x08a8('0x15')];this[_0x08a8('0x16')]=_0x185472[_0x08a8('0x16')];this['ContactId']=_0x185472[_0x08a8('0x17')];this[_0x08a8('0x18')]=_0x185472['ListId'];this['UserId']=_0x185472[_0x08a8('0x19')];this[_0x08a8('0x1a')]=_0x185472[_0x08a8('0x1a')];this[_0x08a8('0x1b')]=_0x185472[_0x08a8('0x1b')];this[_0x08a8('0x1c')]=_0x185472['id'];this['ContactFirstName']=_0x185472['Contact'][_0x08a8('0x8')]||'';this[_0x08a8('0x1d')]=moment()[_0x08a8('0x1e')](_0x08a8('0x1f'));this['callback']=_0x185472[_0x08a8('0x20')];this['callbackuniqueid']=_0x185472[_0x08a8('0x21')];this[_0x08a8('0x22')]=_0x185472[_0x08a8('0x22')];this['recallme']=_0x185472[_0x08a8('0x23')];this['originatecalleridnum']='';this[_0x08a8('0x24')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0x08a8('0x25'),this[_0x08a8('0x5')],this[_0x08a8('0x4')][_0x08a8('0x26')]>0x0?this[_0x08a8('0xa')][_0x08a8('0x27')](this['voiceQueue'][_0x08a8('0x26')]):this[_0x08a8('0xa')]);};Action[_0x08a8('0x28')][_0x08a8('0x29')]=function(){return this[_0x08a8('0xb')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b554f30..fd7e3d8 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x343b=['countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','queue','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','state','statedesc','scheduledat','type','countbusyretry'];(function(_0x513db9,_0x37c2cd){var _0x36c769=function(_0x1e6a84){while(--_0x1e6a84){_0x513db9['push'](_0x513db9['shift']());}};_0x36c769(++_0x37c2cd);}(_0x343b,0x147));var _0xb343=function(_0xc7ec9d,_0x21a74c){_0xc7ec9d=_0xc7ec9d-0x0;var _0xdded82=_0x343b[_0xc7ec9d];return _0xdded82;};'use strict';var util=require(_0xb343('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2854f8,_0x1822f6){var _0x584f4f=moment(_0x2854f8)[_0xb343('0x1')](0x0);var _0x226069=moment(_0x1822f6)[_0xb343('0x1')](0x0);return _0x584f4f[_0xb343('0x2')](_0x226069,_0xb343('0x3'));}function AgentComplete(_0x5a9766,_0x4b177a){this[_0xb343('0x4')]=0x4;this[_0xb343('0x5')]='Answer';this['scheduledat']=_0x5a9766[_0xb343('0x6')];this['type']=_0x5a9766[_0xb343('0x7')];this['campaigntype']=_0x5a9766[_0xb343('0x7')]==='outbound'?'queue':_0x5a9766[_0xb343('0x7')];this[_0xb343('0x8')]=_0x5a9766['countbusyretry'];this[_0xb343('0x9')]=_0x5a9766[_0xb343('0x9')];this['countnoanswerretry']=_0x5a9766['countnoanswerretry'];this[_0xb343('0xa')]=_0x5a9766[_0xb343('0x8')]+_0x5a9766[_0xb343('0x9')]+_0x5a9766[_0xb343('0xb')]+_0x5a9766[_0xb343('0xc')]+_0x5a9766[_0xb343('0xd')]+_0x5a9766['countabandonedretry']+_0x5a9766[_0xb343('0xe')]+_0x5a9766[_0xb343('0xf')];this[_0xb343('0xc')]=_0x5a9766[_0xb343('0xc')];this[_0xb343('0xd')]=_0x5a9766[_0xb343('0xd')];this[_0xb343('0x10')]=_0x5a9766['countabandonedretry'];this[_0xb343('0xe')]=_0x5a9766[_0xb343('0xe')];this[_0xb343('0xf')]=_0x5a9766[_0xb343('0xf')];this[_0xb343('0x11')]=_0x4b177a['uniqueid'];this[_0xb343('0x12')]=_0x5a9766[_0xb343('0x13')];this[_0xb343('0x14')]=_0x5a9766[_0xb343('0x15')];this[_0xb343('0x16')]=_0x5a9766[_0xb343('0x16')];this[_0xb343('0x17')]=_0x5a9766['responsetime'];this[_0xb343('0x18')]=_0x5a9766['answertime'];this[_0xb343('0x19')]=moment()[_0xb343('0x1a')](_0xb343('0x1b'));this['ringtime']=getSeconds(_0x5a9766[_0xb343('0x17')],_0x5a9766[_0xb343('0x16')]);this['holdtime']=getSeconds(_0x5a9766[_0xb343('0x18')],_0x5a9766[_0xb343('0x17')]);this['talktime']=getSeconds(this['endtime'],_0x5a9766[_0xb343('0x18')]);this[_0xb343('0x1c')]=_0x4b177a['queue'];this['membername']=_0x4b177a['membername'];this[_0xb343('0x1d')]=_0x4b177a[_0xb343('0x1d')];this[_0xb343('0x1e')]=_0x5a9766[_0xb343('0x1e')];this['callbackuniqueid']=_0x5a9766[_0xb343('0x1f')];this[_0xb343('0x20')]=_0x5a9766[_0xb343('0x20')];this['recallme']=_0x5a9766[_0xb343('0x21')];this[_0xb343('0x22')]=_0x5a9766['ContactId'];this[_0xb343('0x23')]=_0x5a9766['ListId'];this[_0xb343('0x24')]=_0x5a9766[_0xb343('0x24')];this[_0xb343('0x25')]=_0x5a9766[_0xb343('0x25')];this[_0xb343('0x26')]=_0x5a9766[_0xb343('0x26')];this[_0xb343('0x27')]=_0x5a9766[_0xb343('0x27')]||'';this[_0xb343('0x28')]=_0x5a9766['originatecalleridname']||'';}module[_0xb343('0x29')]=AgentComplete; \ No newline at end of file +var _0x22df=['responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x22df,0x11c));var _0xf22d=function(_0x292db7,_0x4bfea9){_0x292db7=_0x292db7-0x0;var _0x2ed099=_0x22df[_0x292db7];return _0x2ed099;};'use strict';var util=require(_0xf22d('0x0'));var _=require(_0xf22d('0x1'));var moment=require('moment');function getSeconds(_0x32542f,_0x1b8213){var _0x3abdfb=moment(_0x32542f)[_0xf22d('0x2')](0x0);var _0xecbd5=moment(_0x1b8213)[_0xf22d('0x2')](0x0);return _0x3abdfb[_0xf22d('0x3')](_0xecbd5,_0xf22d('0x4'));}function AgentComplete(_0x3c66bb,_0x318184){this[_0xf22d('0x5')]=0x4;this[_0xf22d('0x6')]=_0xf22d('0x7');this['scheduledat']=_0x3c66bb[_0xf22d('0x8')];this[_0xf22d('0x9')]=_0x3c66bb['type'];this[_0xf22d('0xa')]=_0x3c66bb[_0xf22d('0x9')]==='outbound'?_0xf22d('0xb'):_0x3c66bb[_0xf22d('0x9')];this['countbusyretry']=_0x3c66bb[_0xf22d('0xc')];this[_0xf22d('0xd')]=_0x3c66bb[_0xf22d('0xd')];this[_0xf22d('0xe')]=_0x3c66bb['countnoanswerretry'];this['countglobal']=_0x3c66bb['countbusyretry']+_0x3c66bb[_0xf22d('0xd')]+_0x3c66bb[_0xf22d('0xe')]+_0x3c66bb[_0xf22d('0xf')]+_0x3c66bb['countdropretry']+_0x3c66bb[_0xf22d('0x10')]+_0x3c66bb[_0xf22d('0x11')]+_0x3c66bb['countagentrejectretry'];this[_0xf22d('0xf')]=_0x3c66bb[_0xf22d('0xf')];this['countdropretry']=_0x3c66bb['countdropretry'];this[_0xf22d('0x10')]=_0x3c66bb[_0xf22d('0x10')];this['countmachineretry']=_0x3c66bb[_0xf22d('0x11')];this[_0xf22d('0x12')]=_0x3c66bb[_0xf22d('0x12')];this[_0xf22d('0x13')]=_0x318184[_0xf22d('0x13')];this[_0xf22d('0x14')]=_0x3c66bb[_0xf22d('0x15')];this['calleridnum']=_0x3c66bb[_0xf22d('0x16')];this[_0xf22d('0x17')]=_0x3c66bb[_0xf22d('0x17')];this['responsetime']=_0x3c66bb[_0xf22d('0x18')];this[_0xf22d('0x19')]=_0x3c66bb[_0xf22d('0x19')];this[_0xf22d('0x1a')]=moment()[_0xf22d('0x1b')](_0xf22d('0x1c'));this[_0xf22d('0x1d')]=getSeconds(_0x3c66bb[_0xf22d('0x18')],_0x3c66bb[_0xf22d('0x17')]);this[_0xf22d('0x1e')]=getSeconds(_0x3c66bb[_0xf22d('0x19')],_0x3c66bb[_0xf22d('0x18')]);this['talktime']=getSeconds(this['endtime'],_0x3c66bb['answertime']);this[_0xf22d('0xb')]=_0x318184['queue'];this[_0xf22d('0x1f')]=_0x318184[_0xf22d('0x1f')];this['reason']=_0x318184[_0xf22d('0x20')];this[_0xf22d('0x21')]=_0x3c66bb[_0xf22d('0x21')];this['callbackuniqueid']=_0x3c66bb[_0xf22d('0x22')];this[_0xf22d('0x23')]=_0x3c66bb['callbackat'];this[_0xf22d('0x24')]=_0x3c66bb['recallme'];this[_0xf22d('0x25')]=_0x3c66bb[_0xf22d('0x25')];this[_0xf22d('0x26')]=_0x3c66bb[_0xf22d('0x26')];this[_0xf22d('0x27')]=_0x3c66bb[_0xf22d('0x27')];this['VoiceQueueId']=_0x3c66bb['VoiceQueueId'];this[_0xf22d('0x28')]=_0x3c66bb[_0xf22d('0x28')];this['originatecalleridnum']=_0x3c66bb[_0xf22d('0x29')]||'';this[_0xf22d('0x2a')]=_0x3c66bb[_0xf22d('0x2a')]||'';}module[_0xf22d('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 3c5b8e9..9e040c5 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3b5=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId'];(function(_0x21a57e,_0x327c43){var _0x510922=function(_0x5b4063){while(--_0x5b4063){_0x21a57e['push'](_0x21a57e['shift']());}};_0x510922(++_0x327c43);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x4f928b,_0x558a30){_0x4f928b=_0x4f928b-0x0;var _0x56695a=_0xc3b5[_0x4f928b];return _0x56695a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5c3b('0x0'));function getSeconds(_0x3c588d,_0xbe95d4){var _0x3acf12=moment(_0x3c588d)[_0x5c3b('0x1')](0x0);var _0x34be81=moment(_0xbe95d4)[_0x5c3b('0x1')](0x0);return _0x3acf12[_0x5c3b('0x2')](_0x34be81,'seconds');}function Final(_0x181e5b){this[_0x5c3b('0x3')]=_0x181e5b['uniqueid'];this[_0x5c3b('0x4')]=_0x181e5b[_0x5c3b('0x4')];this[_0x5c3b('0x5')]=_0x181e5b[_0x5c3b('0x5')];this['campaigntype']=_0x181e5b[_0x5c3b('0x5')]===_0x5c3b('0x6')?_0x5c3b('0x7'):_0x181e5b[_0x5c3b('0x5')];this['countbusyretry']=_0x181e5b[_0x5c3b('0x8')];this[_0x5c3b('0x9')]=_0x181e5b[_0x5c3b('0x9')];this[_0x5c3b('0xa')]=_0x181e5b[_0x5c3b('0xa')];this['countglobal']=_0x181e5b[_0x5c3b('0x8')]+_0x181e5b[_0x5c3b('0x9')]+_0x181e5b['countnoanswerretry']+_0x181e5b[_0x5c3b('0xb')]+_0x181e5b[_0x5c3b('0xc')]+_0x181e5b['countabandonedretry']+_0x181e5b[_0x5c3b('0xd')]+_0x181e5b[_0x5c3b('0xe')];this[_0x5c3b('0xb')]=_0x181e5b[_0x5c3b('0xb')];this[_0x5c3b('0xc')]=_0x181e5b[_0x5c3b('0xc')];this[_0x5c3b('0xf')]=_0x181e5b['countabandonedretry'];this[_0x5c3b('0xd')]=_0x181e5b['countmachineretry'];this['countagentrejectretry']=_0x181e5b[_0x5c3b('0xe')];this[_0x5c3b('0x7')]=_0x181e5b[_0x5c3b('0x7')];this['calleridname']=_0x181e5b[_0x5c3b('0x10')];this[_0x5c3b('0x11')]=_0x181e5b[_0x5c3b('0x11')];this['starttime']=_0x181e5b[_0x5c3b('0x12')];this[_0x5c3b('0x13')]=_0x181e5b['responsetime'];this[_0x5c3b('0x14')]=_0x181e5b[_0x5c3b('0x13')];this[_0x5c3b('0x15')]=_0x181e5b[_0x5c3b('0x15')]||0x0;this[_0x5c3b('0x16')]=_0x181e5b[_0x5c3b('0x16')]||0x0;this[_0x5c3b('0x17')]=_0x181e5b[_0x5c3b('0x17')]||0x0;this[_0x5c3b('0x18')]=_0x181e5b[_0x5c3b('0x18')];this['callbackuniqueid']=_0x181e5b['callbackuniqueid'];this[_0x5c3b('0x19')]=_0x181e5b[_0x5c3b('0x19')];this['recallme']=_0x181e5b[_0x5c3b('0x1a')];this['ContactId']=_0x181e5b[_0x5c3b('0x1b')];this[_0x5c3b('0x1c')]=_0x181e5b[_0x5c3b('0x1c')];this[_0x5c3b('0x1d')]=_0x181e5b['UserId'];this[_0x5c3b('0x1e')]=_0x181e5b[_0x5c3b('0x1e')];this['CampaignId']=_0x181e5b[_0x5c3b('0x1f')];this[_0x5c3b('0x20')]=_0x181e5b[_0x5c3b('0x20')]||'';this[_0x5c3b('0x21')]=_0x181e5b['originatecalleridname']||'';}module[_0x5c3b('0x22')]=Final; \ No newline at end of file +var _0x5292=['campaigntype','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','scheduledat'];(function(_0x4995b9,_0xf6e1c){var _0x45b0ee=function(_0x2e7dd7){while(--_0x2e7dd7){_0x4995b9['push'](_0x4995b9['shift']());}};_0x45b0ee(++_0xf6e1c);}(_0x5292,0xf7));var _0x2529=function(_0x19a5fa,_0x2b2004){_0x19a5fa=_0x19a5fa-0x0;var _0x2c158d=_0x5292[_0x19a5fa];return _0x2c158d;};'use strict';var util=require(_0x2529('0x0'));var _=require(_0x2529('0x1'));var moment=require('moment');function getSeconds(_0x2ec817,_0x522ab4){var _0x1540a9=moment(_0x2ec817)[_0x2529('0x2')](0x0);var _0x29576c=moment(_0x522ab4)[_0x2529('0x2')](0x0);return _0x1540a9['diff'](_0x29576c,_0x2529('0x3'));}function Final(_0x482dba){this['uniqueid']=_0x482dba['uniqueid'];this[_0x2529('0x4')]=_0x482dba[_0x2529('0x4')];this['type']=_0x482dba['type'];this[_0x2529('0x5')]=_0x482dba[_0x2529('0x6')]==='outbound'?_0x2529('0x7'):_0x482dba[_0x2529('0x6')];this[_0x2529('0x8')]=_0x482dba[_0x2529('0x8')];this[_0x2529('0x9')]=_0x482dba[_0x2529('0x9')];this[_0x2529('0xa')]=_0x482dba[_0x2529('0xa')];this['countglobal']=_0x482dba[_0x2529('0x8')]+_0x482dba[_0x2529('0x9')]+_0x482dba['countnoanswerretry']+_0x482dba[_0x2529('0xb')]+_0x482dba[_0x2529('0xc')]+_0x482dba[_0x2529('0xd')]+_0x482dba[_0x2529('0xe')]+_0x482dba[_0x2529('0xf')];this[_0x2529('0xb')]=_0x482dba[_0x2529('0xb')];this['countdropretry']=_0x482dba[_0x2529('0xc')];this[_0x2529('0xd')]=_0x482dba[_0x2529('0xd')];this[_0x2529('0xe')]=_0x482dba[_0x2529('0xe')];this[_0x2529('0xf')]=_0x482dba[_0x2529('0xf')];this[_0x2529('0x7')]=_0x482dba['queue'];this[_0x2529('0x10')]=_0x482dba['calleridname'];this[_0x2529('0x11')]=_0x482dba[_0x2529('0x11')];this[_0x2529('0x12')]=_0x482dba['starttime'];this['responsetime']=_0x482dba[_0x2529('0x13')];this[_0x2529('0x14')]=_0x482dba[_0x2529('0x13')];this[_0x2529('0x15')]=_0x482dba[_0x2529('0x15')]||0x0;this['holdtime']=_0x482dba[_0x2529('0x16')]||0x0;this[_0x2529('0x17')]=_0x482dba[_0x2529('0x17')]||0x0;this[_0x2529('0x18')]=_0x482dba['callback'];this[_0x2529('0x19')]=_0x482dba[_0x2529('0x19')];this[_0x2529('0x1a')]=_0x482dba['callbackat'];this[_0x2529('0x1b')]=_0x482dba[_0x2529('0x1b')];this[_0x2529('0x1c')]=_0x482dba[_0x2529('0x1c')];this['ListId']=_0x482dba[_0x2529('0x1d')];this[_0x2529('0x1e')]=_0x482dba[_0x2529('0x1e')];this[_0x2529('0x1f')]=_0x482dba[_0x2529('0x1f')];this[_0x2529('0x20')]=_0x482dba['CampaignId'];this['originatecalleridnum']=_0x482dba[_0x2529('0x21')]||'';this[_0x2529('0x22')]=_0x482dba[_0x2529('0x22')]||'';}module[_0x2529('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index f65de1d..8630418 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9251=['name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','util','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x9251,0x1ed));var _0x1925=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x9251[_0xea8947];return _0x2455e9;};'use strict';var util=require(_0x1925('0x0'));var _=require(_0x1925('0x1'));var moment=require(_0x1925('0x2'));function getSeconds(_0x306928,_0x5217ea){var _0x408de3=moment(_0x306928)[_0x1925('0x3')](0x0);var _0x2ba508=moment(_0x5217ea)[_0x1925('0x3')](0x0);return _0x408de3[_0x1925('0x4')](_0x2ba508,_0x1925('0x5'));}function Hangup(_0x318f60,_0x436093){this['state']=0x4;this['statedesc']=_0x1925('0x6');this[_0x1925('0x7')]=_0x318f60[_0x1925('0x7')];this[_0x1925('0x8')]=_0x318f60['type'];this[_0x1925('0x9')]=_0x318f60[_0x1925('0x8')]===_0x1925('0xa')?_0x1925('0xb'):_0x318f60['type'];this[_0x1925('0xc')]=_0x318f60[_0x1925('0xc')];this['countcongestionretry']=_0x318f60[_0x1925('0xd')];this[_0x1925('0xe')]=_0x318f60['countnoanswerretry'];this[_0x1925('0xf')]=_0x318f60[_0x1925('0xc')]+_0x318f60[_0x1925('0xd')]+_0x318f60[_0x1925('0xe')]+_0x318f60[_0x1925('0x10')]+_0x318f60[_0x1925('0x11')]+_0x318f60['countabandonedretry']+_0x318f60[_0x1925('0x12')]+_0x318f60['countagentrejectretry'];this[_0x1925('0x10')]=_0x318f60[_0x1925('0x10')];this[_0x1925('0x11')]=_0x318f60[_0x1925('0x11')];this[_0x1925('0x13')]=_0x318f60[_0x1925('0x13')];this[_0x1925('0x12')]=_0x318f60[_0x1925('0x12')];this[_0x1925('0x14')]=_0x318f60[_0x1925('0x14')];this[_0x1925('0x15')]=_0x436093[_0x1925('0x15')];this[_0x1925('0x16')]=_0x318f60[_0x1925('0x17')];this[_0x1925('0x18')]=_0x318f60[_0x1925('0x19')];this[_0x1925('0x1a')]=_0x318f60[_0x1925('0x1a')];this[_0x1925('0x1b')]=_0x318f60[_0x1925('0x1b')];this[_0x1925('0x1c')]=moment()[_0x1925('0x1d')](_0x1925('0x1e'));this['ringtime']=getSeconds(_0x318f60['responsetime'],_0x318f60[_0x1925('0x1a')]);this[_0x1925('0x1f')]=0x0;this[_0x1925('0x20')]=getSeconds(this[_0x1925('0x1c')],_0x318f60['responsetime']);this['queue']=_0x318f60[_0x1925('0xb')];this['membername']=_0x1925('0x21');this['reason']=_0x436093[_0x1925('0x22')];this['callback']=_0x318f60[_0x1925('0x23')];this['callbackuniqueid']=_0x318f60[_0x1925('0x24')];this[_0x1925('0x25')]=_0x318f60[_0x1925('0x25')];this[_0x1925('0x26')]=_0x318f60[_0x1925('0x26')];this['ContactId']=_0x318f60[_0x1925('0x27')];this[_0x1925('0x28')]=_0x318f60[_0x1925('0x28')];this[_0x1925('0x29')]=_0x318f60[_0x1925('0x29')];this[_0x1925('0x2a')]=_0x318f60['VoiceQueueId'];this['CampaignId']=_0x318f60['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0x5a78=['VoiceQueueId','CampaignId','util','milliseconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','queue','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x197709,_0x202768){var _0x13065d=function(_0x32e01d){while(--_0x32e01d){_0x197709['push'](_0x197709['shift']());}};_0x13065d(++_0x202768);}(_0x5a78,0x10c));var _0x85a7=function(_0x325945,_0xa5e19f){_0x325945=_0x325945-0x0;var _0x45f8fa=_0x5a78[_0x325945];return _0x45f8fa;};'use strict';var util=require(_0x85a7('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1ccd46,_0x5cdd7c){var _0x243a08=moment(_0x1ccd46)[_0x85a7('0x1')](0x0);var _0x379ca3=moment(_0x5cdd7c)[_0x85a7('0x1')](0x0);return _0x243a08['diff'](_0x379ca3,'seconds');}function Hangup(_0xdcf780,_0x4a56a9){this[_0x85a7('0x2')]=0x4;this['statedesc']=_0x85a7('0x3');this[_0x85a7('0x4')]=_0xdcf780['scheduledat'];this[_0x85a7('0x5')]=_0xdcf780[_0x85a7('0x5')];this[_0x85a7('0x6')]=_0xdcf780[_0x85a7('0x5')]===_0x85a7('0x7')?'queue':_0xdcf780[_0x85a7('0x5')];this[_0x85a7('0x8')]=_0xdcf780['countbusyretry'];this[_0x85a7('0x9')]=_0xdcf780[_0x85a7('0x9')];this['countnoanswerretry']=_0xdcf780[_0x85a7('0xa')];this[_0x85a7('0xb')]=_0xdcf780['countbusyretry']+_0xdcf780['countcongestionretry']+_0xdcf780[_0x85a7('0xa')]+_0xdcf780[_0x85a7('0xc')]+_0xdcf780['countdropretry']+_0xdcf780['countabandonedretry']+_0xdcf780[_0x85a7('0xd')]+_0xdcf780[_0x85a7('0xe')];this[_0x85a7('0xc')]=_0xdcf780['countnosuchnumberretry'];this[_0x85a7('0xf')]=_0xdcf780[_0x85a7('0xf')];this[_0x85a7('0x10')]=_0xdcf780['countabandonedretry'];this[_0x85a7('0xd')]=_0xdcf780['countmachineretry'];this[_0x85a7('0xe')]=_0xdcf780[_0x85a7('0xe')];this['uniqueid']=_0x4a56a9[_0x85a7('0x11')];this[_0x85a7('0x12')]=_0xdcf780['name'];this['calleridnum']=_0xdcf780['number'];this[_0x85a7('0x13')]=_0xdcf780[_0x85a7('0x13')];this[_0x85a7('0x14')]=_0xdcf780[_0x85a7('0x14')];this[_0x85a7('0x15')]=moment()[_0x85a7('0x16')](_0x85a7('0x17'));this[_0x85a7('0x18')]=getSeconds(_0xdcf780[_0x85a7('0x14')],_0xdcf780[_0x85a7('0x13')]);this[_0x85a7('0x19')]=0x0;this['talktime']=getSeconds(this[_0x85a7('0x15')],_0xdcf780['responsetime']);this[_0x85a7('0x1a')]=_0xdcf780[_0x85a7('0x1a')];this['membername']='IVR';this[_0x85a7('0x1b')]=_0x4a56a9[_0x85a7('0x1c')];this['callback']=_0xdcf780[_0x85a7('0x1d')];this['callbackuniqueid']=_0xdcf780[_0x85a7('0x1e')];this['callbackat']=_0xdcf780[_0x85a7('0x1f')];this['recallme']=_0xdcf780[_0x85a7('0x20')];this['ContactId']=_0xdcf780[_0x85a7('0x21')];this[_0x85a7('0x22')]=_0xdcf780[_0x85a7('0x22')];this[_0x85a7('0x23')]=_0xdcf780[_0x85a7('0x23')];this['VoiceQueueId']=_0xdcf780[_0x85a7('0x24')];this[_0x85a7('0x25')]=_0xdcf780[_0x85a7('0x25')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index a46b177..c99a93f 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a87=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime'];(function(_0x43bd66,_0x27e9b3){var _0x5195cb=function(_0xe936f0){while(--_0xe936f0){_0x43bd66['push'](_0x43bd66['shift']());}};_0x5195cb(++_0x27e9b3);}(_0x4a87,0x81));var _0x74a8=function(_0x291505,_0xb246ce){_0x291505=_0x291505-0x0;var _0x6d6bd=_0x4a87[_0x291505];return _0x6d6bd;};'use strict';var util=require(_0x74a8('0x0'));var _=require(_0x74a8('0x1'));var moment=require(_0x74a8('0x2'));function getSeconds(_0x3bb1bd,_0x4ace34){var _0xcf6ed=moment(_0x3bb1bd)[_0x74a8('0x3')](0x0);var _0x29f2e1=moment(_0x4ace34)[_0x74a8('0x3')](0x0);return _0xcf6ed[_0x74a8('0x4')](_0x29f2e1,'seconds');}function History(_0x28552a){this['uniqueid']=_0x28552a[_0x74a8('0x5')];this['scheduledat']=_0x28552a[_0x74a8('0x6')]||undefined;this['type']=_0x28552a[_0x74a8('0x7')];this[_0x74a8('0x8')]=_0x28552a[_0x74a8('0x7')]===_0x74a8('0x9')?'queue':_0x28552a[_0x74a8('0x7')];this['countbusyretry']=_0x28552a[_0x74a8('0xa')];this[_0x74a8('0xb')]=_0x28552a[_0x74a8('0xb')];this[_0x74a8('0xc')]=_0x28552a[_0x74a8('0xc')];this[_0x74a8('0xd')]=_0x28552a['countbusyretry']+_0x28552a['countcongestionretry']+_0x28552a['countnoanswerretry']+_0x28552a[_0x74a8('0xe')]+_0x28552a[_0x74a8('0xf')]+_0x28552a[_0x74a8('0x10')]+_0x28552a[_0x74a8('0x11')]+_0x28552a[_0x74a8('0x12')];this[_0x74a8('0xe')]=_0x28552a[_0x74a8('0xe')];this[_0x74a8('0xf')]=_0x28552a['countdropretry'];this[_0x74a8('0x10')]=_0x28552a[_0x74a8('0x10')];this[_0x74a8('0x11')]=_0x28552a['countmachineretry'];this[_0x74a8('0x12')]=_0x28552a[_0x74a8('0x12')];this[_0x74a8('0x13')]=_0x28552a['queue'];this[_0x74a8('0x14')]=_0x28552a[_0x74a8('0x15')];this[_0x74a8('0x16')]=_0x28552a['number'];this[_0x74a8('0x17')]=_0x28552a[_0x74a8('0x17')];this[_0x74a8('0x18')]=_0x28552a[_0x74a8('0x18')];this[_0x74a8('0x19')]=_0x28552a[_0x74a8('0x18')];this[_0x74a8('0x1a')]=getSeconds(_0x28552a['responsetime'],_0x28552a[_0x74a8('0x17')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x74a8('0x1b')]=_0x28552a[_0x74a8('0x1b')];this[_0x74a8('0x1c')]=_0x28552a[_0x74a8('0x1c')];this[_0x74a8('0x1d')]=_0x28552a[_0x74a8('0x1d')];this[_0x74a8('0x1e')]=_0x28552a[_0x74a8('0x1e')];this['ContactId']=_0x28552a[_0x74a8('0x1f')];this[_0x74a8('0x20')]=_0x28552a[_0x74a8('0x20')];this[_0x74a8('0x21')]=_0x28552a['UserId'];this['VoiceQueueId']=_0x28552a[_0x74a8('0x22')];this[_0x74a8('0x23')]=_0x28552a[_0x74a8('0x23')];this[_0x74a8('0x24')]=_0x28552a[_0x74a8('0x24')]||'';this[_0x74a8('0x25')]=_0x28552a[_0x74a8('0x25')]||'';}module[_0x74a8('0x26')]=History; \ No newline at end of file +var _0xca80=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds'];(function(_0x4b1f8b,_0x561334){var _0x50aad9=function(_0x9fcb04){while(--_0x9fcb04){_0x4b1f8b['push'](_0x4b1f8b['shift']());}};_0x50aad9(++_0x561334);}(_0xca80,0x14a));var _0x0ca8=function(_0x2a8ac4,_0x41c846){_0x2a8ac4=_0x2a8ac4-0x0;var _0x790bb7=_0xca80[_0x2a8ac4];return _0x790bb7;};'use strict';var util=require(_0x0ca8('0x0'));var _=require('lodash');var moment=require(_0x0ca8('0x1'));function getSeconds(_0x1646a4,_0x578d84){var _0x500c55=moment(_0x1646a4)[_0x0ca8('0x2')](0x0);var _0x3c29c8=moment(_0x578d84)['milliseconds'](0x0);return _0x500c55['diff'](_0x3c29c8,_0x0ca8('0x3'));}function History(_0x3644fe){this[_0x0ca8('0x4')]=_0x3644fe[_0x0ca8('0x4')];this['scheduledat']=_0x3644fe[_0x0ca8('0x5')]||undefined;this[_0x0ca8('0x6')]=_0x3644fe[_0x0ca8('0x6')];this[_0x0ca8('0x7')]=_0x3644fe[_0x0ca8('0x6')]===_0x0ca8('0x8')?_0x0ca8('0x9'):_0x3644fe[_0x0ca8('0x6')];this[_0x0ca8('0xa')]=_0x3644fe[_0x0ca8('0xa')];this[_0x0ca8('0xb')]=_0x3644fe[_0x0ca8('0xb')];this[_0x0ca8('0xc')]=_0x3644fe['countnoanswerretry'];this[_0x0ca8('0xd')]=_0x3644fe[_0x0ca8('0xa')]+_0x3644fe[_0x0ca8('0xb')]+_0x3644fe[_0x0ca8('0xc')]+_0x3644fe[_0x0ca8('0xe')]+_0x3644fe[_0x0ca8('0xf')]+_0x3644fe['countabandonedretry']+_0x3644fe[_0x0ca8('0x10')]+_0x3644fe[_0x0ca8('0x11')];this[_0x0ca8('0xe')]=_0x3644fe[_0x0ca8('0xe')];this[_0x0ca8('0xf')]=_0x3644fe[_0x0ca8('0xf')];this['countabandonedretry']=_0x3644fe[_0x0ca8('0x12')];this[_0x0ca8('0x10')]=_0x3644fe[_0x0ca8('0x10')];this[_0x0ca8('0x11')]=_0x3644fe['countagentrejectretry'];this['queue']=_0x3644fe[_0x0ca8('0x9')];this[_0x0ca8('0x13')]=_0x3644fe[_0x0ca8('0x14')];this[_0x0ca8('0x15')]=_0x3644fe['number'];this[_0x0ca8('0x16')]=_0x3644fe['starttime'];this[_0x0ca8('0x17')]=_0x3644fe[_0x0ca8('0x17')];this['endtime']=_0x3644fe[_0x0ca8('0x17')];this[_0x0ca8('0x18')]=getSeconds(_0x3644fe[_0x0ca8('0x17')],_0x3644fe[_0x0ca8('0x16')]);this[_0x0ca8('0x19')]=0x0;this['talktime']=0x0;this[_0x0ca8('0x1a')]=_0x3644fe[_0x0ca8('0x1a')];this[_0x0ca8('0x1b')]=_0x3644fe[_0x0ca8('0x1b')];this['callbackat']=_0x3644fe['callbackat'];this[_0x0ca8('0x1c')]=_0x3644fe[_0x0ca8('0x1c')];this[_0x0ca8('0x1d')]=_0x3644fe[_0x0ca8('0x1d')];this[_0x0ca8('0x1e')]=_0x3644fe['ListId'];this[_0x0ca8('0x1f')]=_0x3644fe[_0x0ca8('0x1f')];this[_0x0ca8('0x20')]=_0x3644fe[_0x0ca8('0x20')];this['CampaignId']=_0x3644fe[_0x0ca8('0x21')];this[_0x0ca8('0x22')]=_0x3644fe[_0x0ca8('0x22')]||'';this[_0x0ca8('0x23')]=_0x3644fe['originatecalleridname']||'';}module[_0x0ca8('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f5a3334..2bc0e28 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 _0x402f=['NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','getVoiceQueueRtPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','predictiveIntervalHitRate','startMethodPredictive','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','countReScheduled','RUNNING','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','--------\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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','bluebird','md5','ioredis','../preview/util/util','../../../config/logger','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','./action','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','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\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','debug','inspect','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','clearZombieChannels','[actions]','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','resolve','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','pick','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','saveInDb','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','state','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','uniqueid','Machine','countmachineretry','countglobal','buildObj','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','ContactId','VoiceQueueId','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countcongestionretry','stateGlobal','YYYY-MM-DD\x20HH:mm:ss','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','syncAgentComplete','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','voiceQueue','additional','endtime','calleridname','calleridnum','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Abandoned]','syncNewExten','actionid','roundrobin','stateinterface','locked','push','paused','[unlockQueueStatus][undefined]','queueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','interval','content','indexOf','true','iftime\x20%s,%s','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','method\x20not\x20recognized','launchHandleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','\x5cw{0,','pow','random','actionOriginate','object','originate','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','ACTIVE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','dialCutDigit','trim','substring','from-sip','outboundOriginateFailureCallsDay','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....'];(function(_0x3d066c,_0x21da23){var _0x4c07b5=function(_0x3ef60c){while(--_0x3ef60c){_0x3d066c['push'](_0x3d066c['shift']());}};_0x4c07b5(++_0x21da23);}(_0x402f,0x6f));var _0xf402=function(_0x1f08d3,_0xc9edff){_0x1f08d3=_0x1f08d3-0x0;var _0x8aad30=_0x402f[_0x1f08d3];return _0x8aad30;};'use strict';var util=require(_0xf402('0x0'));var _=require('lodash');var BPromise=require(_0xf402('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0xf402('0x2'));var Redis=require(_0xf402('0x3'));var ut=require(_0xf402('0x4'));var config=require('../../../config/environment/');var logger=require(_0xf402('0x5'))('dialer');var loggerBooked=require(_0xf402('0x5'))(_0xf402('0x6'));var loggerPredictive=require(_0xf402('0x5'))(_0xf402('0x7'));var loggerPredictiveCalls=require(_0xf402('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xf402('0x8'));var ami=require(_0xf402('0x9'));config[_0xf402('0xa')]=_[_0xf402('0xb')](config[_0xf402('0xa')],{'host':_0xf402('0xc'),'port':0x18eb});var io=require(_0xf402('0xd'))(new Redis(config[_0xf402('0xa')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf402('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0xf402('0xf'));var History=require('./history');var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xf402('0x10'));var Hangup=require('./hangup');var ipAgi=process[_0xf402('0x11')][_0xf402('0x12')]||_0xf402('0x13');var strategy={'rrmemory':_0xf402('0x14'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xf402('0x15')]['enqueue']=function(_0x3af9e3){this['tail']=this['tail']?this['tail'][_0xf402('0x16')](_0x3af9e3):_0x3af9e3();};function Dialer(_0x1e66a3,_0xd406bf){this[_0xf402('0x17')]=new Sequence();this[_0xf402('0x18')]=_0xd406bf;this[_0xf402('0x19')]=_0x1e66a3[_0xf402('0x19')];this[_0xf402('0x1a')]=_0x1e66a3[_0xf402('0x1a')];this[_0xf402('0x1b')]=_0x1e66a3['agents'];this[_0xf402('0x1c')]=_0x1e66a3[_0xf402('0x1c')];this[_0xf402('0x1d')]=config[_0xf402('0x1d')]||0x2;this[_0xf402('0x1e')]={};this[_0xf402('0x1f')]={};this[_0xf402('0x20')]={};this[_0xf402('0x21')]={};this[_0xf402('0x22')]={};this['startPredictive']={};this[_0xf402('0x23')]={};this['ivrOriginated']={};this[_0xf402('0x24')]={};this[_0xf402('0x25')]={};ami['on'](_0xf402('0x26'),this[_0xf402('0x27')][_0xf402('0x28')](this));ami['on'](_0xf402('0x29'),this[_0xf402('0x2a')][_0xf402('0x28')](this));ami['on'](_0xf402('0x2b'),this[_0xf402('0x2c')][_0xf402('0x28')](this));ami['on'](_0xf402('0x2d'),this['syncAgentComplete'][_0xf402('0x28')](this));ami['on'](_0xf402('0x2e'),this[_0xf402('0x8')][_0xf402('0x28')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0xf402('0x28')](this));ami['on'](_0xf402('0x2f'),this[_0xf402('0x30')][_0xf402('0x28')](this));ami['on'](_0xf402('0x31'),this['syncNewExten'][_0xf402('0x28')](this));ami['on']('varset',this[_0xf402('0x32')][_0xf402('0x28')](this));ami['on'](_0xf402('0x33'),this[_0xf402('0x34')][_0xf402('0x28')](this));ami['on']('queuestatuscomplete',this[_0xf402('0x35')][_0xf402('0x28')](this));this[_0xf402('0x36')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0xf402('0x37')](function(_0x193f07){previewRecallmeReminderInterval=_0x193f07[_0xf402('0x38')];});}function isNotNull(_0x221d6d){return _0x221d6d!==null&&!_[_0xf402('0x39')](_0x221d6d);}function checkIsLoggedIn(_0x4a593b,_0x2631c3){return function(){if(_0x2631c3<=0x0){_0x4a593b[_0xf402('0x3a')]=_0xf402('0x3b');throw _0x4a593b[_0xf402('0x3c')]+_0xf402('0x3d');}};}function isActive(_0x1bb9ae){return _0x1bb9ae;}function checkIsActive(_0x5cd646,_0x69b6ff){return function(){if(!isActive(_0x69b6ff)){_0x5cd646[_0xf402('0x3a')]=_0xf402('0x3e');throw _0x5cd646['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x2c8041){return function(){if(!isNotNull(_0x2c8041[_0xf402('0x3f')])){_0x2c8041[_0xf402('0x3a')]='INTERVAL_IS_NULL';throw _0x2c8041[_0xf402('0x3c')]+_0xf402('0x40');}if(!isNotNull(_0x2c8041[_0xf402('0x3f')][_0xf402('0x41')])){_0x2c8041[_0xf402('0x3a')]=_0xf402('0x42');throw _0x2c8041['name']+_0xf402('0x40');}if(!isNotNull(_[_0xf402('0x43')](_0x2c8041[_0xf402('0x3f')][_0xf402('0x41')]))){_0x2c8041[_0xf402('0x3a')]='INTERVAL_IS_NULL';throw _0x2c8041[_0xf402('0x3c')]+_0xf402('0x40');}};}function msgResponse(_0x40e9e4,_0x50a430,_0x5ac297){return{'action':_0x40e9e4,'response':_0x50a430,'message':_0x5ac297,'stack':_0x5ac297};}function myreject(_0x66f414){return function(_0x52e99b){return _0x66f414(msgResponse(_0xf402('0x44'),_0xf402('0x45'),JSON['stringify'](_0x52e99b)));};}function getSeconds(_0x18c3c8,_0x535499){var _0x2bb0b1=moment(_0x18c3c8)[_0xf402('0x46')](0x0);var _0x3baa8d=moment(_0x535499)[_0xf402('0x46')](0x0);return _0x2bb0b1[_0xf402('0x47')](_0x3baa8d,_0xf402('0x48'));}function emit(_0x4ab560,_0x4e62b,_0x7301bf){io['to'](_0x4ab560)[_0xf402('0x49')](_0x4e62b,_0x7301bf);}function emitVoiceQueueSummary(_0x16b46c){if(_0x16b46c[_0xf402('0x4a')]==='outbound'){var _0x11d24c={'id':_0x16b46c['id'],'name':_0x16b46c['name'],'strategy':_0x16b46c[_0xf402('0x4b')],'answered':_0x16b46c[_0xf402('0x4c')],'available':_0x16b46c[_0xf402('0x4d')],'loggedIn':_0x16b46c[_0xf402('0x4e')],'pTalking':_0x16b46c[_0xf402('0x4f')],'sumBillable':_0x16b46c[_0xf402('0x50')],'sumDuration':_0x16b46c[_0xf402('0x51')],'sumHoldTime':_0x16b46c['sumHoldTime']||0x0,'talking':_0x16b46c['talking'],'total':_0x16b46c[_0xf402('0x52')],'type':_0x16b46c[_0xf402('0x4a')],'unmanaged':_0x16b46c[_0xf402('0x53')],'abandoned':_0x16b46c[_0xf402('0x54')],'waiting':_0x16b46c[_0xf402('0x55')],'loggedInDb':_0x16b46c[_0xf402('0x56')],'dialActive':_0x16b46c['dialActive'],'dialMethod':_0x16b46c[_0xf402('0x57')],'dialOriginateCallerIdName':_0x16b46c[_0xf402('0x58')],'dialOriginateCallerIdNumber':_0x16b46c[_0xf402('0x59')],'dialOriginateTimeout':_0x16b46c[_0xf402('0x5a')],'dialPrefix':_0x16b46c['dialPrefix'],'outboundAnswerAgiCallsDay':_0x16b46c[_0xf402('0x5b')],'outboundAnswerCallsDay':_0x16b46c[_0xf402('0x5c')],'outboundBlacklistCallsDay':_0x16b46c[_0xf402('0x5d')],'outboundBusyCallsDay':_0x16b46c[_0xf402('0x5e')],'outboundCongestionCallsDay':_0x16b46c[_0xf402('0x5f')],'outboundDropCallsDayACS':_0x16b46c[_0xf402('0x60')],'outboundDropCallsDayCallersExit':_0x16b46c['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x16b46c[_0xf402('0x61')],'outboundNoAnswerCallsDay':_0x16b46c[_0xf402('0x62')],'outboundNoSuchCallsDay':_0x16b46c['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x16b46c['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x16b46c[_0xf402('0x63')],'outboundRejectCallsDay':_0x16b46c[_0xf402('0x64')],'outboundUnknownCallsDay':_0x16b46c['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x16b46c[_0xf402('0x65')],'predictiveIntervalAvgHoldtime':_0x16b46c[_0xf402('0x66')],'predictiveIntervalAvgTalktime':_0x16b46c[_0xf402('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x16b46c['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x16b46c[_0xf402('0x68')],'predictiveIntervalErlangCalls':_0x16b46c['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x16b46c[_0xf402('0x69')],'predictiveIntervalHitRate':_0x16b46c['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x16b46c[_0xf402('0x6a')],'predictiveIntervalPauses':_0x16b46c[_0xf402('0x6b')],'predictiveIntervalAvailable':_0x16b46c['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x16b46c['predictiveIntervalTotalCalls'],'message':_0x16b46c[_0xf402('0x3a')],'originated':_0x16b46c[_0xf402('0x6c')],'erlangCalls':_0x16b46c['erlangCalls'],'erlangCallToSecond':_0x16b46c['erlangCallToSecond'],'erlangAbandonmentRate':_0x16b46c[_0xf402('0x6d')],'erlangBusyFactor':_0x16b46c[_0xf402('0x6e')],'startPredictive':_0x16b46c[_0xf402('0x6f')],'startProgressive':_0x16b46c[_0xf402('0x23')]};if(_0x16b46c[_0xf402('0x70')]){_0x11d24c[_0xf402('0x70')]={'id':_0x16b46c[_0xf402('0x70')]['id'],'name':_0x16b46c[_0xf402('0x70')][_0xf402('0x3c')],'active':_0x16b46c['Trunk'][_0xf402('0x71')],'callerid':_0x16b46c[_0xf402('0x70')][_0xf402('0x72')]};}if(_0x16b46c['Interval']){_0x11d24c[_0xf402('0x3f')]={'id':_0x16b46c[_0xf402('0x3f')]['id'],'name':_0x16b46c[_0xf402('0x3f')][_0xf402('0x3c')]};}var _0x47c7b7=md5(JSON[_0xf402('0x73')](_0x11d24c));if(_0x16b46c[_0xf402('0x2')]!==_0x47c7b7){_0x16b46c[_0xf402('0x2')]=_0x47c7b7;emit(util[_0xf402('0x74')](_0xf402('0x75'),_0x11d24c[_0xf402('0x3c')]),_0xf402('0x76'),_0x11d24c);}}}function emitCampaignSummary(_0x394d9d){if(_0x394d9d[_0xf402('0x4a')]===_0xf402('0x77')){emit(util[_0xf402('0x74')](_0xf402('0x78'),_0x394d9d[_0xf402('0x3c')]),'campaign:save',_0x394d9d);}}function checkGetDataPredictive(_0x5c947a){if(isNotNull(_0x5c947a)&&!_[_0xf402('0x43')](_0x5c947a)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xf402('0x79'),_0x5c947a[_0xf402('0x7a')]);loggerPredictive['info'](_0xf402('0x7b'),_0x5c947a[_0xf402('0x65')]);loggerPredictive[_0xf402('0x7c')](_0xf402('0x7d'),_0x5c947a[_0xf402('0x68')]);loggerPredictive[_0xf402('0x7c')](_0xf402('0x7e'),_0x5c947a[_0xf402('0x7f')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c947a[_0xf402('0x66')]);loggerPredictive[_0xf402('0x7c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c947a[_0xf402('0x67')]);loggerPredictive[_0xf402('0x7c')]('---------------------------');if(_0x5c947a['predictiveIntervalTotalCalls']>0x0){if(!_[_0xf402('0x39')](_0x5c947a['predictiveIntervalAvgTalktime'])&&_0x5c947a[_0xf402('0x67')]>0x0){return!![];}loggerPredictive['info'](_0xf402('0x80'));if(!_[_0xf402('0x39')](_0x5c947a['predictiveIntervalAvgHoldtime'])&&_0x5c947a['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xf402('0x7c')](_0xf402('0x81'));}else{loggerPredictive[_0xf402('0x7c')](_0xf402('0x82'));}}else{loggerPredictive[_0xf402('0x7c')](_0xf402('0x83'));}return![];}function mergeDataErlangB(_0x4bb648){return function(_0xe0b662){loggerPredictive[_0xf402('0x7c')](_0xf402('0x84'));loggerPredictive['info'](_0xf402('0x85'),_0xe0b662[_0xf402('0x86')]);loggerPredictive[_0xf402('0x7c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe0b662[_0xf402('0x87')]);loggerPredictive[_0xf402('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe0b662[_0xf402('0x6d')]);loggerPredictive[_0xf402('0x7c')](_0xf402('0x88'),_0xe0b662[_0xf402('0x6e')]);loggerPredictive['info'](_0xf402('0x89'),_0xe0b662[_0xf402('0x6d')]);loggerPredictive['info'](_0xf402('0x8a'));_[_0xf402('0x8b')](_0x4bb648,_0xe0b662);};}function getDiff(_0x5bc9b7){var _0x236b5d=moment()['milliseconds'](0x0);var _0x3d7317=moment(_0x5bc9b7)['milliseconds'](0x0);return _0x236b5d[_0xf402('0x47')](_0x3d7317,_0xf402('0x48'));}function ifInterval(_0xd8af92,_0x49ba01){if(_[_0xf402('0x39')](_0x49ba01)){return![];}return getDiff(_0x49ba01)<_0xd8af92*0x3c;}function freeVariablesPredictive(_0x177774){if(isNotNull(_0x177774)){if(!_['isUndefined'](_0x177774['startProgressive'])){_0x177774['startProgressive']=undefined;loggerPredictive['info'](_0x177774[_0xf402('0x3c')],_0xf402('0x8c'));}if(!_[_0xf402('0x39')](_0x177774[_0xf402('0x6f')])){_0x177774['startPredictive']=undefined;loggerPredictive[_0xf402('0x7c')](_0x177774[_0xf402('0x3c')],_0xf402('0x8d'));}if(!_[_0xf402('0x39')](_0x177774[_0xf402('0x8e')])){clearInterval(_0x177774[_0xf402('0x8e')]);_0x177774[_0xf402('0x8e')]=undefined;loggerPredictive[_0xf402('0x7c')](_0x177774[_0xf402('0x3c')],_0xf402('0x8f'));}}}function erlangb(_0x624e79,_0x5dc335){if(_0x5dc335===0x0){return 0x0;}var _0x1efd2f=0x1;for(var _0x3da6fa=0x1;_0x3da6fa<=_0x5dc335;_0x3da6fa+=0x1){_0x1efd2f=0x1+_0x1efd2f*_0x3da6fa/_0x624e79;}return 0x1/_0x1efd2f;}function isVoiceQueueOutbound(_0x387a44){return _0x387a44===_0xf402('0x90');}function isNotPreview(_0x43c95b){return _0x43c95b!==_0xf402('0x18');}function isCampaignIvr(_0xfddb50){return _0xfddb50===_0xf402('0x77');}function getCallerId(_0x1493bc,_0x47c8d9,_0x41601b){if(!_[_0xf402('0x39')](_0x41601b)&&typeof _0x41601b===_0xf402('0x91')&&!_[_0xf402('0x43')](_0x41601b)){if(!_['isUndefined'](_0x47c8d9)&&typeof _0x47c8d9==='string'&&!_[_0xf402('0x43')](_0x47c8d9)){return util['format']('\x22%s\x22\x20<%s>',_0x47c8d9,_0x41601b);}return util[_0xf402('0x74')](_0xf402('0x92'),_0x41601b,_0x41601b);}if(!_[_0xf402('0x39')](_0x1493bc)&&typeof _0x1493bc===_0xf402('0x91')&&!_['isEmpty'](_0x1493bc)){return _0x1493bc;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x4b67fa,_0x3befdd){return function(_0x23d2cd){freeVariablesPredictive(_0x3befdd);emitVoiceQueueSummary(_0x3befdd);emitCampaignSummary(_0x3befdd);loggerSyncQueueSummary[_0xf402('0x93')](_0x4b67fa,util[_0xf402('0x94')](_0x23d2cd,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x557efe,_0x400e97){return function(_0x4209e2){loggerPredictive[_0xf402('0x95')](_0x400e97[_0xf402('0x3c')],_0x557efe);loggerPredictive[_0xf402('0x95')](_0x4209e2[_0xf402('0x96')]);freeVariablesPredictive(_0x400e97);};}function loggerCatch(_0x17c8a2){return function(_0x14ac7c){logger['error'](_0x17c8a2,util['inspect'](_0x14ac7c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3122bd){return _0x3122bd&&!_[_0xf402('0x39')](_0x3122bd)&&_0x3122bd[_0xf402('0x97')]>0x0;}function decremetOriginate(_0x352b73){if(!_['isUndefined'](_0x352b73)&&_0x352b73!==null){if(typeof _0x352b73[_0xf402('0x6c')]!==_0xf402('0x98')){if(_0x352b73[_0xf402('0x6c')]>0x0){_0x352b73[_0xf402('0x6c')]-=0x1;}else{logger[_0xf402('0x95')](_0xf402('0x99'));}}}else{logger[_0xf402('0x95')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x20956b,_0x57641c,_0x470455){if(_0x57641c>_0x470455){for(var _0x511f35=0x0;_0x511f35<_0x57641c-_0x470455;_0x511f35+=0x1){decremetOriginate(_0x20956b);}}}function loggerGetContactDialer(_0x4083da,_0x42d561,_0x264714){return function(_0x3f69c4){checkContactLowerLimitOriginate(_0x42d561,_0x264714,0x0);logger[_0xf402('0x95')](_0x4083da,util[_0xf402('0x94')](_0x3f69c4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4a7366){return function(_0x8ba1c8){if(isNotNull(_0x8ba1c8)&&isNotNull(_0x8ba1c8[0x0])){if(_0x8ba1c8[0x0][_0xf402('0x9a')]>0x0){_0x4a7366['message']=_0xf402('0x9b');logger[_0xf402('0x7c')](_0xf402('0x9c')+_0x4a7366[_0xf402('0x3c')],_0x8ba1c8[0x0]['contactsRescheduled'],'contacts');}else{_0x4a7366[_0xf402('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xf402('0x7c')]('[getContactDialer2][Empty]'+_0x4a7366['name']);}}};}function notSendMessagesQueue(_0x25a014){if(_0x25a014[_0xf402('0x9d')]){freeVariablesPredictive(_0x25a014);if(_0x25a014[_0xf402('0x6c')]===0x0&&_0x25a014[_0xf402('0x9e')]===0x0&&_0x25a014[_0xf402('0x55')]===0x0&&(_0x25a014[_0xf402('0x4f')]||0x0)===0x0){_0x25a014[_0xf402('0x9d')]=![];_0x25a014[_0xf402('0x4d')]=0x0;_0x25a014[_0xf402('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xf402('0x93')](_0xf402('0x9f'),_0x25a014[_0xf402('0x3c')],_0xf402('0xa0'));}else{_0x25a014[_0xf402('0x3a')]=_0xf402('0xa1');loggerSyncQueueSummary[_0xf402('0x93')](_0xf402('0x9f'),_0x25a014[_0xf402('0x3c')],_0xf402('0xa2'));}emitVoiceQueueSummary(_0x25a014);}}function notSendMessagesCampaign(_0x5a90aa){if(_0x5a90aa['sendMessageOneNotActive']){if(_0x5a90aa['originated']===0x0){_0x5a90aa[_0xf402('0x9d')]=![];_0x5a90aa['message']=_0xf402('0x3e');loggerSyncQueueSummary[_0xf402('0x93')](_0xf402('0xa3'),_0x5a90aa['name'],'is\x20not\x20active');}else{_0x5a90aa[_0xf402('0x3a')]=_0xf402('0xa1');loggerSyncQueueSummary[_0xf402('0x93')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5a90aa['name'],_0xf402('0xa2'));}emitCampaignSummary(_0x5a90aa);}}function createObjHistory(_0x1594be,_0x5a01ac,_0x26d7d2,_0x1e3118,_0x3f57f9){_0x1594be[_0xf402('0x3a')]=_0x26d7d2;var _0x386e4b=new Action(_0x1594be,_0x5a01ac);var _0x30936d=new History(_0x386e4b);_0x30936d['state']=_0x1e3118;_0x30936d[_0xf402('0xa4')]=_0x3f57f9;_0x30936d['endtime']=_0x386e4b[_0xf402('0xa5')];return _0x30936d;}Dialer[_0xf402('0x15')]['loopClearZombieChannels']=function(){var _0x274159=this;setInterval(function(){_0x274159[_0xf402('0xa6')](_0x274159[_0xf402('0x21')],'[uniqueid]');_0x274159[_0xf402('0xa6')](_0x274159['actions'],_0xf402('0xa7'));},0x32c8);};Dialer[_0xf402('0x15')][_0xf402('0xa6')]=function(_0x48f695,_0x3d1459){var _0x20bf08=this;for(var _0x374137 in _0x48f695){if(typeof _0x48f695[_0x374137]!=='undefined'){this[_0xf402('0x17')][_0xf402('0xa8')](function(){if(!_[_0xf402('0xa9')](_0x48f695[_0x374137])){return ami[_0xf402('0xaa')]({'action':_0xf402('0xab'),'channel':_0x48f695[_0x374137][_0xf402('0xac')]})[_0xf402('0xad')](function(_0x30acd5){if(_0x30acd5[_0xf402('0x3a')]===_0xf402('0xae')){setTimeout(function(){if(_0x48f695[_0x374137]&&_0x48f695[_0x374137]['type']!==_0xf402('0x77')){_0x20bf08[_0xf402('0xaf')](_0x20bf08[_0xf402('0x19')][_0x48f695[_0x374137]['queue']]);logger[_0xf402('0x95')](_0xf402('0xb0'),_0x3d1459,_0x374137,_0x48f695[_0x374137][_0xf402('0xb1')]);delete _0x48f695[_0x374137];}if(_0x48f695[_0x374137]&&_0x48f695[_0x374137][_0xf402('0x4a')]===_0xf402('0x77')){_0x20bf08['updateOriginated'](_0x20bf08[_0xf402('0x1a')][_0x48f695[_0x374137]['queue']]);logger[_0xf402('0x95')](_0xf402('0xb2'),_0x3d1459,_0x374137,_0x48f695[_0x374137][_0xf402('0xb1')]);delete _0x48f695[_0x374137];}},0x2328);}});}});}}};Dialer[_0xf402('0x15')]['countReScheduled']=function(_0xf10f3c){return BPromise['resolve']()[_0xf402('0x37')](cmHopper['countReScheduled'](_0xf10f3c))[_0xf402('0xad')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xf402('0x15')][_0xf402('0xb3')]=function(_0x1b7c51){return BPromise['resolve']()[_0xf402('0x37')](cmHopperBlack[_0xf402('0xb3')](_0x1b7c51))[_0xf402('0xad')](loggerCatch(_0xf402('0xb4')));};Dialer[_0xf402('0x15')][_0xf402('0xb5')]=function(_0x4c196b,_0x533841,_0x4ea8e3){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopperAdditionalPhone[_0xf402('0xb5')](_0x4c196b,_0x533841,_0x4ea8e3))[_0xf402('0xad')](loggerCatch(_0xf402('0xb7')));};Dialer[_0xf402('0x15')][_0xf402('0xb8')]=function(_0x8430e3,_0x200ab8,_0x29be90){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x8430e3,_0x200ab8,_0x29be90))[_0xf402('0xad')](loggerCatch(_0xf402('0xb9')));};Dialer[_0xf402('0x15')]['checkIsBlackListIvr']=function(_0x127c15){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopperBlack[_0xf402('0xba')](_0x127c15))[_0xf402('0xad')](loggerCatch(_0xf402('0xbb')));};Dialer[_0xf402('0x15')][_0xf402('0xbc')]=function(_0x34a06e){return BPromise[_0xf402('0xb6')]()['then'](cmHopperHistory[_0xf402('0xbd')](_0x34a06e))[_0xf402('0xad')](loggerCatch(_0xf402('0xbe')));};Dialer[_0xf402('0x15')][_0xf402('0xbf')]=function(_0x2b967f){return BPromise[_0xf402('0xb6')]()['then'](cmHopper['rescheduleContact'](_0x2b967f))['catch'](loggerCatch(_0xf402('0xc0')));};Dialer['prototype'][_0xf402('0xc1')]=function(_0x46bd27,_0x243efc,_0x48c39d){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopper[_0xf402('0xc1')](_0x46bd27,_0x243efc,_0x48c39d))[_0xf402('0xad')](loggerCatch(_0xf402('0xc2')));};Dialer[_0xf402('0x15')][_0xf402('0xc3')]=function(_0x5be1d8,_0x5eb234,_0x4aaad9,_0x1510f3,_0x4443a1){return BPromise['resolve']()[_0xf402('0x37')](cmHopper[_0xf402('0xc3')](_0x5be1d8,_0x5eb234,_0x4aaad9,_0x1510f3))[_0xf402('0xad')](function(_0x21cc7a){_0x4443a1[_0xf402('0xc4')]-=_0x4aaad9;_0x4443a1[_0xf402('0xc4')]=_0x4443a1[_0xf402('0xc4')]>0x0?_0x4443a1[_0xf402('0xc4')]:0x0;loggerCatch(_0xf402('0xc5'))(_0x21cc7a);});};Dialer[_0xf402('0x15')]['getContactDialerIvr']=function(_0x97c434,_0x354825,_0x26a023,_0x382f3e){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopper[_0xf402('0xc6')](_0x97c434,_0x354825,_0x26a023))[_0xf402('0xad')](function(_0x27bb42){_0x382f3e['temp']-=_0x354825;_0x382f3e[_0xf402('0xc4')]=_0x382f3e[_0xf402('0xc4')]>0x0?_0x382f3e['temp']:0x0;loggerCatch(_0xf402('0xc7'))(_0x27bb42);});};Dialer[_0xf402('0x15')]['getVoiceQueueRtPauses']=function(_0x427fd5){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](voiceQueueRt['getVoiceQueueRtPauses'](_0x427fd5))[_0xf402('0xad')](loggerCatch(_0xf402('0xc8')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x38fb9e){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopper[_0xf402('0xc9')](_0x38fb9e))[_0xf402('0xad')](loggerCatch(_0xf402('0xca')));};Dialer[_0xf402('0x15')][_0xf402('0xcb')]=function(_0x258e73){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopperHistory[_0xf402('0xcb')](_0x258e73))['catch'](loggerCatch(_0xf402('0xcc')));};Dialer[_0xf402('0x15')][_0xf402('0xaf')]=function(_0x2fe5f5){if(!_['isUndefined'](_0x2fe5f5)&&_0x2fe5f5!==null){if(typeof _0x2fe5f5[_0xf402('0x6c')]!==_0xf402('0x98')){if(_0x2fe5f5[_0xf402('0x6c')]>0x0){_0x2fe5f5[_0xf402('0x6c')]-=0x1;}else{logger[_0xf402('0x95')](_0xf402('0xcd'));}}}else{logger['error'](_0xf402('0xce'));}};Dialer[_0xf402('0x15')][_0xf402('0xcf')]=function(_0x58eb50,_0x4d6782){var _0x28b264=this;return function(_0x15f78e){_0x28b264[_0xf402('0xaf')](_0x4d6782);logger['error'](_0x58eb50,util[_0xf402('0x94')](_0x15f78e,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x5d832b,_0x3e55ac,_0x2f3aa4){var _0x5395d5={'state':0x19,'statedesc':_0xf402('0xd0')};this['updateOriginated'](_0x3e55ac);this['saveInDb'](_['merge'](_0x5395d5,_[_0xf402('0xd1')](_0x2f3aa4,['ContactId',_0xf402('0xd2'),_0xf402('0xd3'),'VoiceQueueId',_0xf402('0xd4')])),_0xf402('0xd5'),_0xf402('0xd6'));logger[_0xf402('0x95')](_0x5d832b);};Dialer[_0xf402('0x15')][_0xf402('0xd7')]=function(_0x2341ab){return _0x2341ab===_0xf402('0xd8');};Dialer[_0xf402('0x15')][_0xf402('0xd9')]=function(_0x3fd4f0){return!_['isUndefined'](_0x3fd4f0)&&_0x3fd4f0&&!_[_0xf402('0x39')](_0x3fd4f0[_0xf402('0x3c')])&&!_[_0xf402('0x39')](_0x3fd4f0[_0xf402('0x71')])&&_0x3fd4f0[_0xf402('0x71')]&&(this[_0xf402('0x1c')][util['format'](_0xf402('0xda'),_0x3fd4f0[_0xf402('0x3c')])][_0xf402('0xab')]==='reachable'||this[_0xf402('0x1c')][util['format']('SIP/%s',_0x3fd4f0[_0xf402('0x3c')])][_0xf402('0xab')]==='unmonitored');};Dialer[_0xf402('0x15')][_0xf402('0xdb')]=function(_0x200bd2,_0x5e4840,_0x320efc){this[_0xf402('0xcb')](_0x200bd2)[_0xf402('0xad')](loggerCatch(_0x5e4840));this[_0xf402('0xc9')](_0x200bd2)[_0xf402('0xad')](loggerCatch(_0x320efc));};Dialer[_0xf402('0x15')][_0xf402('0x32')]=function(_0x242933){var _0x4aa5d0=this[_0xf402('0x21')][_0x242933['uniqueid']];var _0x32f61c;if(!_[_0xf402('0xa9')](_0x242933)&&!_[_0xf402('0xa9')](_0x242933[_0xf402('0xdc')])&&!_[_0xf402('0xa9')](_0x242933[_0xf402('0xdc')][_0xf402('0xdd')])&&_0x242933[_0xf402('0xde')]===_0xf402('0xdf')&&_0x4aa5d0){if(_0x4aa5d0[_0xf402('0x4a')]!==_0xf402('0x77')&&this[_0xf402('0x19')][_0x4aa5d0[_0xf402('0xb1')]][_0xf402('0xe0')]&&_0x242933['value']===_0xf402('0xe1')){delete this[_0xf402('0x21')][_0x242933['uniqueid']];this[_0xf402('0xaf')](this[_0xf402('0x19')][_0x4aa5d0[_0xf402('0xb1')]]);this[_0xf402('0x19')][_0x4aa5d0['queue']][_0xf402('0x5c')]+=0x1;this['voiceQueues'][_0x4aa5d0['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x32f61c=new Hangup(_0x4aa5d0,_0x242933);_0x32f61c[_0xf402('0xe2')]=0x12;_0x32f61c['statedesc']=_0xf402('0xe3');_0x32f61c[_0xf402('0xe4')]=_0xf402('0xe5');ami[_0xf402('0x49')](_0xf402('0xe6'),ut['buildObj'](_0x32f61c,_0xf402('0xe7')));this[_0xf402('0xdb')](_0x32f61c,_0xf402('0xe8'),_0xf402('0xe9'));}if(_0x4aa5d0[_0xf402('0x4a')]!==_0xf402('0x77')&&this['voiceQueues'][_0x4aa5d0[_0xf402('0xb1')]][_0xf402('0xe0')]&&_0x242933[_0xf402('0xea')]===_0xf402('0xeb')){var _0x311d1c=this;return new BPromise(function(_0x43a1f8,_0x6c04de){delete _0x311d1c[_0xf402('0x21')][_0x242933[_0xf402('0xec')]];_0x311d1c[_0xf402('0xaf')](_0x311d1c[_0xf402('0x19')][_0x4aa5d0[_0xf402('0xb1')]]);_0x311d1c[_0xf402('0x19')][_0x4aa5d0[_0xf402('0xb1')]][_0xf402('0x5c')]+=0x1;_0x311d1c[_0xf402('0x19')][_0x4aa5d0['queue']][_0xf402('0x5b')]+=0x1;var _0x21694a=_0x311d1c[_0xf402('0x19')][_0x4aa5d0[_0xf402('0xb1')]];var _0xb30915=new Hangup(_0x4aa5d0,_0x242933);_0xb30915[_0xf402('0xe2')]=0x13;_0xb30915[_0xf402('0xa4')]=_0xf402('0xed');_0xb30915['membername']='AMD';_0xb30915[_0xf402('0xee')]+=0x1;_0xb30915[_0xf402('0xef')]+=0x1;_0xb30915['amd']=!![];ami[_0xf402('0x49')](_0xf402('0xe6'),ut[_0xf402('0xf0')](_0xb30915,_0xf402('0xe7')));_0x311d1c[_0xf402('0xcb')](_0xb30915)[_0xf402('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xb30915[_0xf402('0xf1')]+_0xb30915['countcongestionretry']+_0xb30915[_0xf402('0xf2')]+_0xb30915[_0xf402('0xf3')]+_0xb30915[_0xf402('0xf4')]+_0xb30915['countabandonedretry']+_0xb30915[_0xf402('0xee')]+_0xb30915[_0xf402('0xf5')]>=_0x21694a[_0xf402('0xf6')]){_0x311d1c['stateGlobal'](_0xb30915,_0x43a1f8,_0x6c04de,_0xf402('0xf7'));}else{if(_0xb30915[_0xf402('0xee')]>=_0x21694a[_0xf402('0xf8')]){_0x311d1c[_0xf402('0xf9')](_0xb30915,_0x43a1f8,_0x6c04de,_0xf402('0xfa'));}else{_0x311d1c[_0xf402('0xbf')]({'active':![],'countmachineretry':_0xb30915[_0xf402('0xee')],'scheduledat':moment()[_0xf402('0xfb')](_0x21694a[_0xf402('0xfc')],_0xf402('0xfd'))[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb30915[_0xf402('0xfe')],'ListId':_0xb30915['ListId'],'VoiceQueueId':_0xb30915[_0xf402('0xff')]||undefined,'CampaignId':_0xb30915[_0xf402('0xd4')]||undefined})['catch'](loggerCatch(_0xf402('0x100')));_0x43a1f8({'reschedule':0x1});}}});}if(_0x4aa5d0[_0xf402('0x4a')]===_0xf402('0x77')&&this[_0xf402('0x1a')][_0x4aa5d0[_0xf402('0xb1')]]['dialAMDActive']&&_0x242933[_0xf402('0xea')]===_0xf402('0xe1')){delete this['uniqueId'][_0x242933[_0xf402('0xec')]];this[_0xf402('0xaf')](this['campaigns'][_0x4aa5d0[_0xf402('0xb1')]]);_0x32f61c=new Hangup(_0x4aa5d0,_0x242933);_0x32f61c[_0xf402('0xe2')]=0x12;_0x32f61c[_0xf402('0xa4')]='HangupInAMD';_0x32f61c[_0xf402('0xe4')]='AMD';ami[_0xf402('0x49')](_0xf402('0xe6'),ut[_0xf402('0xf0')](_0x32f61c,_0xf402('0xe7')));this[_0xf402('0xdb')](_0x32f61c,'[syncHangupInAMDIvr][createHistory]',_0xf402('0x101'));}if(_0x4aa5d0[_0xf402('0x4a')]==='ivr'&&this['campaigns'][_0x4aa5d0[_0xf402('0xb1')]]['dialAMDActive']&&_0x242933[_0xf402('0xea')]===_0xf402('0xeb')){var _0x311d1c=this;return new BPromise(function(_0x1d79dd,_0x3176cc){delete _0x311d1c[_0xf402('0x21')][_0x242933[_0xf402('0xec')]];_0x311d1c[_0xf402('0xaf')](_0x311d1c[_0xf402('0x1a')][_0x4aa5d0['queue']]);_0x311d1c[_0xf402('0x1a')][_0x4aa5d0[_0xf402('0xb1')]][_0xf402('0x5c')]+=0x1;_0x311d1c[_0xf402('0x1a')][_0x4aa5d0[_0xf402('0xb1')]][_0xf402('0x5b')]+=0x1;var _0x3cad60=_0x311d1c['campaigns'][_0x4aa5d0['queue']];var _0x27100e=new Hangup(_0x4aa5d0,_0x242933);_0x27100e[_0xf402('0xe2')]=0x13;_0x27100e[_0xf402('0xa4')]=_0xf402('0xed');_0x27100e['membername']=_0xf402('0xe5');_0x27100e[_0xf402('0xee')]+=0x1;_0x27100e[_0xf402('0xef')]+=0x1;_0x27100e[_0xf402('0xe7')]=!![];ami[_0xf402('0x49')](_0xf402('0xe6'),ut['buildObj'](_0x27100e,_0xf402('0xe7')));_0x311d1c[_0xf402('0xcb')](_0x27100e)['catch'](loggerCatch(_0xf402('0x102')));if(_0x27100e[_0xf402('0xf1')]+_0x27100e[_0xf402('0x103')]+_0x27100e[_0xf402('0xf2')]+_0x27100e[_0xf402('0xf3')]+_0x27100e['countdropretry']+_0x27100e['countabandonedretry']+_0x27100e[_0xf402('0xee')]+_0x27100e['countagentrejectretry']>=_0x3cad60[_0xf402('0xf6')]){_0x311d1c[_0xf402('0x104')](_0x27100e,_0x1d79dd,_0x3176cc,_0xf402('0xf7'));}else{if(_0x27100e[_0xf402('0xee')]>=_0x3cad60[_0xf402('0xf8')]){_0x311d1c[_0xf402('0xf9')](_0x27100e,_0x1d79dd,_0x3176cc,_0xf402('0xfa'));}else{_0x311d1c[_0xf402('0xbf')]({'active':![],'countmachineretry':_0x27100e[_0xf402('0xee')],'scheduledat':moment()['add'](_0x3cad60[_0xf402('0xfc')],_0xf402('0xfd'))['format'](_0xf402('0x105')),'ContactId':_0x27100e[_0xf402('0xfe')],'ListId':_0x27100e[_0xf402('0xd2')],'VoiceQueueId':_0x27100e['VoiceQueueId']||undefined,'CampaignId':_0x27100e[_0xf402('0xd4')]||undefined})['catch'](loggerCatch(_0xf402('0x100')));_0x1d79dd({'reschedule':0x1});}}});}}};Dialer[_0xf402('0x15')][_0xf402('0x30')]=function(_0x550e90){var _0x4d44ba=this[_0xf402('0x21')][_0x550e90[_0xf402('0xec')]];var _0x1557b4=this;var _0x1e19c4;if(_0x4d44ba&&_0x4d44ba['type']===_0xf402('0x77')){delete this[_0xf402('0x21')][_0x550e90['uniqueid']];this[_0xf402('0xaf')](this[_0xf402('0x1a')][_0x4d44ba['queue']]);this[_0xf402('0x1a')][_0x4d44ba[_0xf402('0xb1')]]['ivrAnswerCallsDay']+=0x1;_0x1e19c4=new Hangup(_0x4d44ba,_0x550e90);this[_0xf402('0xcb')](_0x1e19c4)[_0xf402('0xad')](loggerCatch(_0xf402('0x106')));this['moveContactManagedDialer'](_0x1e19c4)['catch'](loggerCatch(_0xf402('0x107')));}if(_0x4d44ba&&_0x4d44ba[_0xf402('0x4a')]!==_0xf402('0x77')&&isNotNull(this[_0xf402('0x19')][_0x4d44ba[_0xf402('0xb1')]][_0xf402('0x108')])){delete this[_0xf402('0x21')][_0x550e90[_0xf402('0xec')]];this[_0xf402('0xaf')](this[_0xf402('0x19')][_0x4d44ba[_0xf402('0xb1')]]);this['voiceQueues'][_0x4d44ba[_0xf402('0xb1')]][_0xf402('0x5c')]+=0x1;this[_0xf402('0x19')][_0x4d44ba[_0xf402('0xb1')]][_0xf402('0x5b')]+=0x1;_0x1e19c4=new Hangup(_0x4d44ba,_0x550e90);_0x1e19c4['state']=0x10;_0x1e19c4['statedesc']=_0xf402('0x109');_0x1e19c4[_0xf402('0xe4')]='AGI';this[_0xf402('0xcb')](_0x1e19c4)[_0xf402('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xf402('0xc9')](_0x1e19c4)[_0xf402('0xad')](loggerCatch(_0xf402('0x107')));}if(_0x4d44ba&&_0x4d44ba[_0xf402('0x4a')]!==_0xf402('0x77')&&!isNotNull(this[_0xf402('0x19')][_0x4d44ba[_0xf402('0xb1')]][_0xf402('0x108')])){delete this[_0xf402('0x21')][_0x550e90[_0xf402('0xec')]];this[_0xf402('0xaf')](this[_0xf402('0x19')][_0x4d44ba[_0xf402('0xb1')]]);this[_0xf402('0x19')][_0x4d44ba[_0xf402('0xb1')]]['outboundUnknownCallsDay']+=0x1;_0x1e19c4=new Hangup(_0x4d44ba,_0x550e90);_0x1e19c4[_0xf402('0xe2')]=0xc;_0x1e19c4['statedesc']=_0x550e90['cause-txt'];_0x1e19c4[_0xf402('0xe4')]=_0xf402('0x10a');this[_0xf402('0xcb')](_0x1e19c4)[_0xf402('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x1e19c4)['catch'](loggerCatch(_0xf402('0x107')));}};Dialer['prototype'][_0xf402('0x10b')]=function(_0x465716){var _0x328bde=this['uniqueId'][_0x465716[_0xf402('0xec')]];var _0x3de296=this;if(this['voiceQueues'][_0x465716['queue']]){if(_0x328bde&&_0x328bde[_0xf402('0x4a')]!==_0xf402('0x77')){delete this[_0xf402('0x21')][_0x465716[_0xf402('0xec')]];this['voiceQueues'][_0x465716[_0xf402('0xb1')]][_0xf402('0x5c')]+=0x1;var _0x51e3de=new AgentComplete(_0x328bde,_0x465716);if(_0x465716['reason']===_0xf402('0x10c')){_0x51e3de['agiafterat']=this[_0xf402('0x19')][_0x465716['queue']][_0xf402('0x10d')]&&this[_0xf402('0x19')][_0x465716['queue']][_0xf402('0x10e')]?moment()[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xf402('0xcb')](_0x51e3de)[_0xf402('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xf402('0xc9')](_0x51e3de)[_0xf402('0xad')](loggerCatch(_0xf402('0x10f')));}}};Dialer['prototype'][_0xf402('0x27')]=function(_0x4c2766){if(this[_0xf402('0x19')][_0x4c2766['queue']]){if(this[_0xf402('0x21')][_0x4c2766[_0xf402('0xec')]]&&this['uniqueId'][_0x4c2766['uniqueid']]['type']!==_0xf402('0x77')){this[_0xf402('0xaf')](this[_0xf402('0x19')][_0x4c2766[_0xf402('0xb1')]]);this[_0xf402('0x21')][_0x4c2766[_0xf402('0xec')]]['answertime']=moment()['format'](_0xf402('0x105'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x450633,_0x552568){this[_0xf402('0xcb')](_0x450633)['catch'](loggerCatch(_0xf402('0x110')));if(_0x552568==0x0){this[_0xf402('0xc9')](_0x450633)[_0xf402('0xad')](loggerCatch(_0xf402('0x111')));}};Dialer['prototype'][_0xf402('0x2a')]=function(_0x330b25){var _0x11496f=this[_0xf402('0x21')][_0x330b25[_0xf402('0xec')]];var _0x5a4ba1=this;var _0x6c8fe8=![];var _0x42214e;var _0x4c4676;if(this[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]]){if(_0x11496f&&_0x11496f[_0xf402('0x4a')]!==_0xf402('0x77')){delete this['uniqueId'][_0x330b25[_0xf402('0xec')]];this['updateOriginated'](this[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]]);_0x11496f[_0xf402('0x112')]=moment()[_0xf402('0x74')](_0xf402('0x105'));var _0xe1a5d9=new QueueCallerAbandon(_0x11496f,_0x330b25);if(getSeconds(_0x11496f[_0xf402('0x112')],_0x11496f[_0xf402('0x113')])>=_0x11496f['dialQueueTimeout']){this[_0xf402('0x19')][_0x330b25['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xf402('0x19')][_0x330b25['queue']][_0xf402('0x61')]+=0x1;this[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]][_0xf402('0x69')]+=0x1;_0xe1a5d9['state']=0xa;_0xe1a5d9[_0xf402('0xa4')]=_0xf402('0x114');_0xe1a5d9[_0xf402('0x115')]=_0xf402('0x116');_0xe1a5d9['agiafterat']=this['voiceQueues'][_0x330b25[_0xf402('0xb1')]][_0xf402('0x10d')]?moment()[_0xf402('0x74')](_0xf402('0x105')):undefined;_0xe1a5d9[_0xf402('0xf4')]+=0x1;_0xe1a5d9[_0xf402('0xef')]+=0x1;_0x42214e=this[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]][_0xf402('0x117')];_0x4c4676=this['voiceQueues'][_0x330b25['queue']]['callAdditionalPhoneAfterMin'];_0x5a4ba1[_0xf402('0xb5')](_0xe1a5d9,_0xe1a5d9['state'],_0x11496f[_0xf402('0x118')])[_0xf402('0x37')](function(_0x43b3e1){_0x6c8fe8=_0x43b3e1[_0xf402('0x119')]==0x1;if(_0xe1a5d9['countdropretry']>=_0x5a4ba1[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]]['dialDropMaxRetry']){_0x5a4ba1['queueCallerAbandonCreateState'](_0xe1a5d9,_0x43b3e1[_0xf402('0x119')]);}else{_0x5a4ba1[_0xf402('0xbf')]({'active':![],'countdropretry':_0xe1a5d9[_0xf402('0xf4')],'scheduledat':moment()[_0xf402('0xfb')](_0x5a4ba1[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]][_0xf402('0x117')],'minutes')[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x11496f[_0xf402('0xfe')],'ListId':_0x11496f['ListId'],'VoiceQueueId':_0x11496f['VoiceQueueId']||undefined,'CampaignId':_0x11496f[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch('[rescheduleContact][Drop]'));var _0x5a9051=new History(_0xe1a5d9);_0x5a9051['state']=0xa;_0x5a9051['statedesc']=_0xf402('0x114');_0x5a9051[_0xf402('0xa5')]=moment()['format'](_0xf402('0x105'));_0x5a9051[_0xf402('0x11a')]=_0x5a9051[_0xf402('0xa5')];_0x5a9051[_0xf402('0x11b')]=_0xe1a5d9[_0xf402('0x11b')];_0x5a9051[_0xf402('0x11c')]=_0xe1a5d9[_0xf402('0x11c')];_0x5a4ba1['createHistory'](_0x5a9051)[_0xf402('0xad')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xf402('0x37')](function(_0xadcc88){if(_0x6c8fe8)_0x5a4ba1[_0xf402('0xb8')](_0xe1a5d9,_0x42214e,_0x4c4676)['then'](function(_0x5311d9){return 0x1;});});}else{this[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]][_0xf402('0x7f')]+=0x1;this[_0xf402('0x19')][_0x330b25['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0xe1a5d9[_0xf402('0xe2')]=0xb;_0xe1a5d9['statedesc']=_0xf402('0x11d');_0xe1a5d9[_0xf402('0x115')]=_0xf402('0x11e');_0xe1a5d9[_0xf402('0x11f')]+=0x1;_0xe1a5d9['countglobal']+=0x1;_0x42214e=this['voiceQueues'][_0x330b25[_0xf402('0xb1')]][_0xf402('0x120')];_0x4c4676=this['voiceQueues'][_0x330b25['queue']][_0xf402('0x121')];_0x5a4ba1[_0xf402('0xb5')](_0xe1a5d9,_0xe1a5d9['state'],_0x11496f[_0xf402('0x118')])[_0xf402('0x37')](function(_0x587342){if(_0xe1a5d9[_0xf402('0x11f')]>=_0x5a4ba1[_0xf402('0x19')][_0x330b25[_0xf402('0xb1')]][_0xf402('0x122')]){_0x5a4ba1[_0xf402('0x123')](_0xe1a5d9,_0x587342['additional']);}else{_0x5a4ba1[_0xf402('0xbf')]({'active':![],'countabandonedretry':_0xe1a5d9[_0xf402('0x11f')],'scheduledat':moment()[_0xf402('0xfb')](_0x5a4ba1['voiceQueues'][_0x330b25[_0xf402('0xb1')]][_0xf402('0x120')],'minutes')[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x11496f[_0xf402('0xfe')],'ListId':_0x11496f[_0xf402('0xd2')],'VoiceQueueId':_0x11496f[_0xf402('0xff')]||undefined,'CampaignId':_0x11496f[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x124')));var _0x187142=new History(_0xe1a5d9);_0x187142[_0xf402('0xe2')]=0xb;_0x187142[_0xf402('0xa4')]=_0xf402('0x11d');_0x187142['starttime']=moment()[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x187142[_0xf402('0x11a')]=_0x187142[_0xf402('0xa5')];_0x187142['calleridname']=_0xe1a5d9[_0xf402('0x11b')];_0x187142[_0xf402('0x11c')]=_0xe1a5d9[_0xf402('0x11c')];_0x5a4ba1[_0xf402('0xcb')](_0x187142)[_0xf402('0xad')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xf402('0x37')](function(_0x30cddd){if(_0x6c8fe8)_0x5a4ba1[_0xf402('0xb8')](_0xe1a5d9,_0x42214e,_0x4c4676)[_0xf402('0x37')](function(_0x1a47ed){return 0x1;});});}}}};Dialer[_0xf402('0x15')][_0xf402('0x125')]=function(_0xda2873){if(this[_0xf402('0x1f')][_0xda2873[_0xf402('0xec')]]){this[_0xf402('0x1f')][_0xda2873[_0xf402('0xec')]][_0xf402('0xac')]=_0xda2873[_0xf402('0xac')];}if(this[_0xf402('0x21')][_0xda2873[_0xf402('0xec')]]){this['uniqueId'][_0xda2873['uniqueid']][_0xf402('0xac')]=_0xda2873[_0xf402('0xac')];}};Dialer[_0xf402('0x15')][_0xf402('0x34')]=function(_0x18b535){if(strategy[this[_0xf402('0x19')][this[_0xf402('0x1f')][_0x18b535[_0xf402('0x126')]][_0xf402('0xb1')]][_0xf402('0x4b')]]===_0xf402('0x127')){if(this['actions'][_0x18b535[_0xf402('0x126')]]&&_[_0xf402('0xa9')](this['actions'][_0x18b535['actionid']]['locked'])&&_0x18b535['status']==='1'&&_0x18b535['paused']==='0'){if(this[_0xf402('0x1b')][_0x18b535['stateinterface']]){if(!this[_0xf402('0x1b')][_0x18b535[_0xf402('0x128')]][_0xf402('0x129')]){this[_0xf402('0x1b')][_0x18b535[_0xf402('0x128')]][_0xf402('0x129')]=!![];this[_0xf402('0x1f')][_0x18b535[_0xf402('0x126')]][_0xf402('0x129')]=!![];this[_0xf402('0x1f')][_0x18b535[_0xf402('0x126')]]['stateinterface']=_0x18b535[_0xf402('0x128')];}}}}else if((strategy[this[_0xf402('0x19')][this[_0xf402('0x1f')][_0x18b535[_0xf402('0x126')]][_0xf402('0xb1')]][_0xf402('0x4b')]]||_0xf402('0x14'))==='rrmemory'){if(this[_0xf402('0x1f')][_0x18b535[_0xf402('0x126')]]){if(this[_0xf402('0x1b')][_0x18b535['stateinterface']]){this['actions'][_0x18b535['actionid']][_0xf402('0x128')]=_0x18b535[_0xf402('0x128')];if(_[_0xf402('0xa9')](this[_0xf402('0x24')][this[_0xf402('0x1f')][_0x18b535[_0xf402('0x126')]][_0xf402('0xb1')]])){this['queueBooked'][this[_0xf402('0x1f')][_0x18b535['actionid']][_0xf402('0xb1')]]=[];}this[_0xf402('0x24')][this[_0xf402('0x1f')][_0x18b535[_0xf402('0x126')]][_0xf402('0xb1')]][_0xf402('0x12a')](_['merge'](_[_0xf402('0xd1')](this['actions'][_0x18b535[_0xf402('0x126')]],['idHopper',_0xf402('0x128')]),{'status':_0x18b535[_0xf402('0xab')],'paused':_0x18b535[_0xf402('0x12b')]}));}}}};function unlockQueueStatus(_0x284924,_0x5812e8){setTimeout(function(){if(_['isUndefined'](_0x284924['queueStatusComplete'])){loggerBooked[_0xf402('0x95')](_0xf402('0x12c'),_0x5812e8);}_0x284924[_0xf402('0x12d')]=!![];loggerBooked[_0xf402('0x7c')]('[booked][unlockQueueStatus]',_0x5812e8,JSON[_0xf402('0x73')](_['pick'](_0x284924,[_0xf402('0x3c'),_0xf402('0x12d')])));},0x1f3);}Dialer[_0xf402('0x15')]['syncQueueStatusComplete']=function(_0x8a6d23){var _0x4bbf6b=this;var _0x32a9eb=_0x4bbf6b[_0xf402('0x19')][_0x4bbf6b[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]][_0xf402('0xb1')]];if(strategy[this['voiceQueues'][this[_0xf402('0x1f')][_0x8a6d23['actionid']]['queue']][_0xf402('0x4b')]]===_0xf402('0x127')){if(this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]]&&this[_0xf402('0x1f')][_0x8a6d23['actionid']][_0xf402('0x128')]){this[_0xf402('0x18')][_0xf402('0x12e')](this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]][_0xf402('0x12f')],this['actions'][_0x8a6d23['actionid']]['stateinterface'])['catch'](function(_0xb9409f){logger['error'](_0xf402('0x130'),util[_0xf402('0x94')](_0xb9409f,{'showHidden':![],'depth':null}));})[_0xf402('0x16')](function(){_0x4bbf6b[_0xf402('0xaf')](_0x4bbf6b[_0xf402('0x19')][_0x4bbf6b[_0xf402('0x1f')][_0x8a6d23['actionid']]['queue']]);_0x4bbf6b['agents'][_0x4bbf6b[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]][_0xf402('0x128')]][_0xf402('0x129')]=![];delete _0x4bbf6b[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]];unlockQueueStatus(_0x32a9eb);});}else{this[_0xf402('0xaf')](this[_0xf402('0x19')][this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]]['queue']]);this[_0xf402('0xbf')]({'active':![],'ContactId':this['actions'][_0x8a6d23['actionid']][_0xf402('0xfe')],'ListId':this['actions'][_0x8a6d23[_0xf402('0x126')]][_0xf402('0xd2')],'VoiceQueueId':this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]][_0xf402('0xff')]||undefined,'CampaignId':this['actions'][_0x8a6d23['actionid']][_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x131')));delete this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]];unlockQueueStatus(_0x32a9eb);}}else if((strategy[this[_0xf402('0x19')][this[_0xf402('0x1f')][_0x8a6d23['actionid']][_0xf402('0xb1')]][_0xf402('0x4b')]]||_0xf402('0x14'))===_0xf402('0x14')){var _0x31ded8;if(this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]]&&!_['isEmpty'](this['queueBooked'][this['actions'][_0x8a6d23['actionid']]['queue']])){if(this[_0xf402('0x25')][_0x4bbf6b[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]]['queue']]){this[_0xf402('0x25')][_0x4bbf6b[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]][_0xf402('0xb1')]]=this[_0xf402('0x25')][this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]]['queue']]?this[_0xf402('0x25')][this[_0xf402('0x1f')][_0x8a6d23['actionid']][_0xf402('0xb1')]]:this[_0xf402('0x24')][this['actions'][_0x8a6d23[_0xf402('0x126')]]['queue']]?this[_0xf402('0x24')][this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]]['queue']][_0xf402('0x132')]||0x0:0x0;}this['queueBooked'][this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]][_0xf402('0xb1')]][_0xf402('0x132')]=this['queueBookedRR'][this[_0xf402('0x1f')][_0x8a6d23[_0xf402('0x126')]]['queue']];for(var _0x112d6e=0x0;_0x112d6e=0x0;})[_0xf402('0xad')](myreject(_0x349e8d)));}}else{_0x386aa4[_0xf402('0x12a')](ami[_0xf402('0xaa')]({'action':_0xf402('0x14a'),'command':util[_0xf402('0x74')](_0xf402('0x14f'),_0x94dddc,!_[_0xf402('0x39')](config[_0xf402('0x147')][_0x3973e6])?_0x3973e6:'')})[_0xf402('0x37')](function(_0x5e85ec){return _0x5e85ec[_0xf402('0x14c')][_0xf402('0x14d')](_0xf402('0x14e'))>=0x0;})[_0xf402('0xad')](myreject(_0x349e8d)));}BPromise['all'](_0x386aa4)[_0xf402('0x37')](function(_0x59abae){var _0x1dfacb=_[_0xf402('0x150')](_0x59abae);if(_0x1dfacb){return _0x35c4b5(_0x1dfacb);}else{_0x17a632['message']=_0x3fa035?_0xf402('0x151'):_0xf402('0x152');return _0x349e8d(msgResponse(_0xf402('0x153'),_0xf402('0x145'),_0xf402('0x154')+_0x3fa035+'\x20'+_0x3a6341+_0xf402('0x155')+util['inspect'](_0x94dddc,{'showHidden':![],'depth':null})+_0xf402('0x156')+_0x3973e6));}})[_0xf402('0xad')](function(_0x229dd4){return _0x349e8d(msgResponse('ifTime',_0xf402('0x145'),JSON[_0xf402('0x73')](_0x229dd4)));});});};Dialer[_0xf402('0x15')][_0xf402('0x157')]=function(_0x4a6b0e){var _0x53ee49=this;return function(){switch(_0x4a6b0e[_0xf402('0x57')]){case _0xf402('0x158'):freeVariablesPredictive(_0x4a6b0e);_0x53ee49[_0xf402('0x159')](_0x4a6b0e,0x1);break;case _0xf402('0x15a'):freeVariablesPredictive(_0x4a6b0e);_0x53ee49[_0xf402('0x159')](_0x4a6b0e,_0x4a6b0e['dialPowerLevel']);break;case _0xf402('0x7'):_0x53ee49[_0xf402('0x7')](_0x4a6b0e);break;case _0xf402('0x6'):freeVariablesPredictive(_0x4a6b0e);_0x53ee49[_0xf402('0x159')](_0x4a6b0e,0x1);break;default:freeVariablesPredictive(_0x4a6b0e);logger[_0xf402('0x95')]('Queue',_0x4a6b0e[_0xf402('0x3c')],_0xf402('0x15b'));}};};Dialer[_0xf402('0x15')][_0xf402('0x15c')]=function(_0x25c573){var _0x240ef0=this;return function(){_0x240ef0['handleIvr'](_0x25c573);};};Dialer[_0xf402('0x15')][_0xf402('0x8')]=function(_0x27a0b7){var _0x79437f=this;if(isNotPreview(_0x27a0b7[_0xf402('0x57')])){if(isVoiceQueueOutbound(_0x27a0b7[_0xf402('0x4a')])&&isActive(_0x27a0b7['dialActive'])){_0x27a0b7[_0xf402('0x9d')]=!![];BPromise[_0xf402('0xb6')]()['then'](checkIsLoggedIn(_0x27a0b7,_0x27a0b7[_0xf402('0x4e')]))[_0xf402('0x37')](checkIsActive(_0x27a0b7,_0x27a0b7[_0xf402('0x15d')]))[_0xf402('0x37')](checkInterval(_0x27a0b7))[_0xf402('0x37')](_0x79437f[_0xf402('0x13e')](_0x27a0b7))[_0xf402('0x37')](_0x79437f[_0xf402('0x142')](_0x27a0b7[_0xf402('0x15e')],_0x27a0b7['dialTimezone'],_0x27a0b7[_0xf402('0x3c')],_0x27a0b7))[_0xf402('0x37')](_0x79437f[_0xf402('0x143')](_0x27a0b7[_0xf402('0x3f')],_0x27a0b7[_0xf402('0x15f')],_0x27a0b7[_0xf402('0x3c')],_0x27a0b7))[_0xf402('0x37')](_0x79437f[_0xf402('0x157')](_0x27a0b7))['catch'](loggerCatchQueueSummary(_0xf402('0x160'),_0x27a0b7));}else{notSendMessagesQueue(_0x27a0b7);}}else{freeVariablesPredictive(_0x27a0b7);}};Dialer[_0xf402('0x15')]['syncQueueSummaryComplete']=_[_0xf402('0x161')](function(){var _0x326a9d=_[_0xf402('0x162')](this['voiceQueues'],function(_0x356c8a){return _0x356c8a[_0xf402('0x163')];});var _0x2658ff=_[_0xf402('0x162')](this[_0xf402('0x1b')],function(_0x281c22){return _0x281c22[_0xf402('0x164')]&&_0x281c22[_0xf402('0xab')]===_0xf402('0x165');});if(_0x326a9d[_0xf402('0x97')]>0x0&&_0x2658ff[_0xf402('0x97')]>0x0){return BPromise[_0xf402('0xb6')]()[_0xf402('0x37')](cmHopper[_0xf402('0x166')](_['map'](_0x326a9d,'id'),previewRecallmeReminderInterval,_[_0xf402('0x167')](_0x2658ff,'id')))[_0xf402('0x37')](function(_0x2428bf){for(var _0x199f69=0x0;_0x199f69<_0x2428bf['length'];_0x199f69++){var _0x53db87=_0x2428bf[_0x199f69][_0xf402('0x168')][_0xf402('0x3c')];if(_0x53db87)io['to'](util[_0xf402('0x74')](_0xf402('0x169'),_0x53db87))[_0xf402('0x49')](_0xf402('0x16a'),{'hopper':_0x2428bf[_0x199f69]});}})[_0xf402('0xad')](function(_0x5b2457){logger[_0xf402('0x95')](_0xf402('0x16b'),_0x5b2457);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xf402('0x15')]['syncCampaigns']=function(){var _0x1a6f2b=this;var _0x49feb2;for(var _0x2457fa in this[_0xf402('0x1a')]){if(typeof this[_0xf402('0x1a')][_0x2457fa]!=='undefined'){_0x49feb2=this[_0xf402('0x1a')][_0x2457fa];if(isCampaignIvr(_0x49feb2[_0xf402('0x4a')])&&isActive(_0x49feb2[_0xf402('0x71')])){_0x49feb2[_0xf402('0x9d')]=!![];BPromise['resolve']()[_0xf402('0x37')](checkIsActive(_0x49feb2,_0x49feb2[_0xf402('0x71')]))[_0xf402('0x37')](checkInterval(_0x49feb2))[_0xf402('0x37')](_0x1a6f2b[_0xf402('0x13e')](_0x49feb2))[_0xf402('0x37')](_0x1a6f2b[_0xf402('0x142')](_0x49feb2[_0xf402('0x15e')],_0x49feb2[_0xf402('0x15f')],_0x49feb2[_0xf402('0x3c')],_0x49feb2))['then'](_0x1a6f2b[_0xf402('0x143')](_0x49feb2[_0xf402('0x3f')],_0x49feb2[_0xf402('0x15f')],_0x49feb2[_0xf402('0x3c')],_0x49feb2))['then'](_0x1a6f2b['launchHandleIvr'](_0x49feb2))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x49feb2));}else{notSendMessagesCampaign(_0x49feb2);}}}};function getCallerIdRandom(_0x45bbd2,_0x128c1c){var _0x386dd0;var _0x513d18;var _0x1629db;if(_0x128c1c<=0x0){_0x128c1c=0x1;}_0x386dd0=new RegExp(_0xf402('0x16c')+_0x128c1c+'}$');_0x513d18=Math[_0xf402('0x16d')](0xa,_0x128c1c-0x1);_0x1629db=Math[_0xf402('0x16d')](0xa,_0x128c1c)-0x1;return util[_0xf402('0x74')]('%s',_['replace'](_0x45bbd2,_0x386dd0,_[_0xf402('0x16e')](_0x513d18,_0x1629db)));}function extractCalleridName(_0x52a24c){var _0x189849=_0x52a24c['match'](/"(.*?)"/);return _0x189849?_0x189849[0x1]:_0x52a24c;}function extractCalleridNumber(_0x444841){var _0x3121d3=_0x444841['match'](/<(.*?)>/);return _0x3121d3?_0x3121d3[0x1]:_0x444841;}Dialer[_0xf402('0x15')][_0xf402('0x16f')]=function(_0x9b885,_0x4a95f6){var _0x2aed0f=this;var _0x123025=uuid['v4']();this[_0xf402('0x1f')][_0x123025]=new Action(_0x9b885,_0x4a95f6,_0x123025);return new BPromise(function(_0x746234,_0x4bbd2b){if(_[_0xf402('0x39')](_0x9b885)&&typeof _0x9b885!==_0xf402('0x170')){return _0x4bbd2b(msgResponse(_0xf402('0x171'),_0xf402('0x145'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x4a95f6[_0xf402('0x172')])||_0x4a95f6[_0xf402('0x172')]===null){return _0x4bbd2b(msgResponse(_0xf402('0x171'),'Failure',_0xf402('0x173')));}var _0x62294a={'XMD-CALLERID':_0x2aed0f[_0xf402('0x1f')][_0x123025]['getCaller'](),'XMD-AGI':_0x9b885[_0xf402('0x108')]?util[_0xf402('0x74')](_0xf402('0x174'),ipAgi,_0x9b885['dialQueueProject']):_0xf402('0x175'),'XMD-AGIAFTER':_0x9b885[_0xf402('0x10d')]?util[_0xf402('0x74')]('\x22agi://%s/square,%s\x22',ipAgi,_0x9b885['dialQueueProject2']):_0xf402('0x175'),'XMD-QUEUE':_0x9b885['type']===_0xf402('0x90')?util[_0xf402('0x74')](_0xf402('0x176'),_0x9b885[_0xf402('0x3c')],_0x9b885[_0xf402('0x177')]||'',_0x9b885['dialAgiAfterHangupAgent']?'c':'',_0x9b885[_0xf402('0x178')]||0x3):_0xf402('0x175'),'XMD-CONTACTID':_0x4a95f6[_0xf402('0xfe')],'XMD-CDRTYPE':_0xf402('0x179'),'CALLERID(all)':_0x2aed0f[_0xf402('0x1f')][_0x123025]['getCaller'](),'XMD-AMD':_0x9b885[_0xf402('0xe0')]?_0xf402('0x17a'):'NONE','XMD-DESTINATION':_0xf402('0xdf')};if(_0x9b885[_0xf402('0xe0')]){_0x62294a['XMD-AMDINITIALSILENCE']=_0x9b885[_0xf402('0x17b')]||0x9c4;_0x62294a['XMD-AMDGREETING']=_0x9b885['dialAMDGreeting']||0x5dc;_0x62294a[_0xf402('0x17c')]=_0x9b885[_0xf402('0x17d')]||0x320;_0x62294a[_0xf402('0x17e')]=_0x9b885[_0xf402('0x17f')]||0x1388;_0x62294a['XMD-AMDMINWORDLENGTH']=_0x9b885[_0xf402('0x180')]||0x64;_0x62294a[_0xf402('0x181')]=_0x9b885[_0xf402('0x182')]||0x32;_0x62294a[_0xf402('0x183')]=_0x9b885[_0xf402('0x184')]||0x3;_0x62294a['XMD-AMDSILENCETHRESHOLD']=_0x9b885[_0xf402('0x185')]||0x100;_0x62294a[_0xf402('0x186')]=_0x9b885[_0xf402('0x187')]||0x1388;}if(_0x9b885[_0xf402('0x4a')]===_0xf402('0x90')){_0x62294a['XMD-VOICEQUEUEID']=_0x4a95f6[_0xf402('0xff')];}else{_0x62294a[_0xf402('0x188')]=_0x4a95f6[_0xf402('0xd4')];}for(var _0x18469c in _0x4a95f6[_0xf402('0x189')]){if(typeof _0x4a95f6[_0xf402('0x189')][_0x18469c]!=='undefined'){if(isNotNull(_0x4a95f6[_0xf402('0x189')][_0x18469c])&&_0x18469c!=='id'&&_0x18469c!==_0xf402('0x18a')&&_0x18469c!=='createdAt'&&_0x18469c!=='updatedAt'){_0x62294a[util['format'](_0xf402('0x18b'),'XMD-',_[_0xf402('0x18c')](_0x18469c))]=_0x4a95f6[_0xf402('0x189')][_0x18469c];}}}var _0x1d7a99=_0x2aed0f['isTrunkReachable'](_0x9b885[_0xf402('0x70')])?getCallerId(_0x9b885[_0xf402('0x70')][_0xf402('0x72')],_0x9b885[_0xf402('0x58')],_0x9b885[_0xf402('0x18d')]>0x0?getCallerIdRandom(_0x9b885['dialOriginateCallerIdNumber'],_0x9b885[_0xf402('0x18d')]):_0x9b885[_0xf402('0x59')]):getCallerId(_[_0xf402('0xa9')](_0x9b885[_0xf402('0x13f')])?_0x9b885[_0xf402('0x70')][_0xf402('0x72')]:_0x9b885[_0xf402('0x13f')]['callerid'],_0x9b885[_0xf402('0x58')],_0x9b885[_0xf402('0x18d')]>0x0?getCallerIdRandom(_0x9b885['dialOriginateCallerIdNumber'],_0x9b885[_0xf402('0x18d')]):_0x9b885['dialOriginateCallerIdNumber']);if(_0x1d7a99){_0x62294a[_0xf402('0x18e')]=_0x2aed0f[_0xf402('0x1f')][_0x123025][_0xf402('0x18f')]=extractCalleridName(_0x1d7a99);_0x62294a[_0xf402('0x190')]=_0x4a95f6[_0xf402('0x172')];}return ami[_0xf402('0xaa')]({'actionid':_0x123025,'action':_0xf402('0x171'),'channel':_0x2aed0f[_0xf402('0xd9')](_0x9b885['Trunk'])?util[_0xf402('0x74')](_0xf402('0x191'),_0x9b885[_0xf402('0x70')][_0xf402('0x3c')],isNotNull(_0x9b885['dialPrefix'])?_0x9b885[_0xf402('0x192')]['trim']()||'':'',_0x9b885[_0xf402('0x193')]>0x0?_0x4a95f6['phone']['substring'](_0x9b885[_0xf402('0x193')]):_0x4a95f6[_0xf402('0x172')]):util[_0xf402('0x74')](_0xf402('0x191'),_[_0xf402('0xa9')](_0x9b885[_0xf402('0x13f')])?_0x9b885[_0xf402('0x70')][_0xf402('0x3c')]:_0x9b885[_0xf402('0x13f')]['name'],isNotNull(_0x9b885[_0xf402('0x192')])?_0x9b885[_0xf402('0x192')][_0xf402('0x194')]()||'':'',_0x9b885[_0xf402('0x193')]>0x0?_0x4a95f6[_0xf402('0x172')][_0xf402('0x195')](_0x9b885[_0xf402('0x193')]):_0x4a95f6[_0xf402('0x172')]),'callerid':_0x1d7a99,'Exten':'xcally-motion-dialer','Context':_0xf402('0x196'),'Priority':'1','variable':_0x62294a,'timeout':(_0x9b885[_0xf402('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x123025})[_0xf402('0x37')](function(_0x7b2380){return _0x746234(_0x7b2380);})[_0xf402('0xad')](function(_0x148495){_0x9b885[_0xf402('0x197')]+=0x1;var _0x102b13=new History(_0x2aed0f[_0xf402('0x1f')][_0x123025]);logger[_0xf402('0x95')](util[_0xf402('0x74')]('[originateError]:\x20%s',JSON[_0xf402('0x73')](_0x148495)));_0x102b13[_0xf402('0xe2')]=0xe;_0x102b13[_0xf402('0xa4')]='OriginateError';_0x102b13[_0xf402('0xa5')]=moment()['format'](_0xf402('0x105'));_0x102b13[_0xf402('0x11a')]=_0x102b13['starttime'];_0x2aed0f[_0xf402('0xcb')](_0x102b13)['catch'](loggerCatch('[originate][error]'));_0x2aed0f[_0xf402('0xc9')](_0x102b13)['catch'](loggerCatch('[originate][error]'))[_0xf402('0x16')](function(){delete _0x2aed0f[_0xf402('0x1f')][_0x123025];return _0x4bbd2b(msgResponse(_0xf402('0x171'),_0xf402('0x45'),_0xf402('0x198')));});});});};Dialer[_0xf402('0x15')][_0xf402('0x2c')]=function(_0x48b160){var _0x5630b0=this['actions'][_0x48b160[_0xf402('0x126')]];if(_0x5630b0){delete this[_0xf402('0x1f')][_0x48b160[_0xf402('0x126')]];_0x5630b0[_0xf402('0x113')]=moment()[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss');var _0x30d2da=_0x5630b0[_0xf402('0x4a')]===_0xf402('0x77')?this[_0xf402('0x1a')][_0x5630b0['queue']]:this['voiceQueues'][_0x5630b0[_0xf402('0x199')]()];if(!this[_0xf402('0xd7')](_0x48b160[_0xf402('0x19a')])){this[_0xf402('0xaf')](_0x30d2da);return this[_0xf402('0x19b')](_0x5630b0,_0x30d2da,_0x48b160)[_0xf402('0xad')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xf402('0x21')][_0x48b160['uniqueid']]=_0x5630b0;}};Dialer[_0xf402('0x15')][_0xf402('0x19c')]=function(_0x2670c2,_0x218422,_0x2813c8){var _0x251c44=new History(_0x218422);if(_0x251c44[_0xf402('0xf1')]+_0x251c44['countcongestionretry']+_0x251c44['countnoanswerretry']+_0x251c44[_0xf402('0xf3')]+_0x251c44[_0xf402('0xf4')]+_0x251c44[_0xf402('0x11f')]+_0x251c44['countmachineretry']+_0x251c44['countagentrejectretry']>=_0x2813c8[_0xf402('0xf6')]-0x1){return!![];}switch(_0x2670c2){case 0x3:if(_0x251c44[_0xf402('0xf2')]>=_0x2813c8[_0xf402('0x19d')]-0x1){return!![];}this[_0xf402('0xbf')]({'active':![],'countnoanswerretry':_0x251c44[_0xf402('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x2813c8[_0xf402('0x19e')],'minutes')[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x251c44[_0xf402('0xfe')],'ListId':_0x251c44[_0xf402('0xd2')],'VoiceQueueId':_0x251c44[_0xf402('0xff')]||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x19f')));break;case 0x5:if(_0x251c44[_0xf402('0xf1')]>=_0x2813c8[_0xf402('0x1a0')]-0x1){return!![];}this[_0xf402('0xbf')]({'active':![],'countbusyretry':_0x251c44[_0xf402('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x2813c8[_0xf402('0x1a1')],'minutes')['format'](_0xf402('0x105')),'ContactId':_0x251c44[_0xf402('0xfe')],'ListId':_0x251c44[_0xf402('0xd2')],'VoiceQueueId':_0x251c44[_0xf402('0xff')]||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})['catch'](loggerCatch(_0xf402('0x1a2')));break;case 0x8:if(_0x251c44[_0xf402('0x103')]>=_0x2813c8[_0xf402('0x1a3')]-0x1){return!![];}this[_0xf402('0xbf')]({'active':![],'countcongestionretry':_0x251c44[_0xf402('0x103')]+=0x1,'scheduledat':moment()['add'](_0x2813c8['dialCongestionRetryFrequency'],_0xf402('0xfd'))[_0xf402('0x74')](_0xf402('0x105')),'ContactId':_0x251c44[_0xf402('0xfe')],'ListId':_0x251c44[_0xf402('0xd2')],'VoiceQueueId':_0x251c44[_0xf402('0xff')]||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})['catch'](loggerCatch(_0xf402('0x1a4')));break;case 0x0:if(_0x251c44[_0xf402('0xf3')]>=_0x2813c8['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xf402('0xbf')]({'active':![],'countnosuchnumberretry':_0x251c44['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xf402('0xfb')](_0x2813c8[_0xf402('0x1a5')],_0xf402('0xfd'))[_0xf402('0x74')](_0xf402('0x105')),'ContactId':_0x251c44['ContactId'],'ListId':_0x251c44[_0xf402('0xd2')],'VoiceQueueId':_0x251c44['VoiceQueueId']||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x1a6')));}break;case 0xa:if(_0x251c44[_0xf402('0xf4')]>=_0x2813c8[_0xf402('0x1a7')]-0x1){return!![];}this[_0xf402('0xbf')]({'active':![],'countdropretry':_0x251c44[_0xf402('0xf4')]+=0x1,'scheduledat':moment()[_0xf402('0xfb')](_0x2813c8[_0xf402('0x117')],_0xf402('0xfd'))[_0xf402('0x74')](_0xf402('0x105')),'ContactId':_0x251c44[_0xf402('0xfe')],'ListId':_0x251c44[_0xf402('0xd2')],'VoiceQueueId':_0x251c44[_0xf402('0xff')]||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x1a8')));break;case 0xb:if(_0x251c44['countabandonedretry']>=_0x2813c8[_0xf402('0x122')]-0x1){return!![];}this[_0xf402('0xbf')]({'active':![],'countabandonedretry':_0x251c44[_0xf402('0x11f')]+=0x1,'scheduledat':moment()[_0xf402('0xfb')](_0x2813c8['dialAbandonedRetryFrequency'],_0xf402('0xfd'))[_0xf402('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x251c44[_0xf402('0xfe')],'ListId':_0x251c44[_0xf402('0xd2')],'VoiceQueueId':_0x251c44[_0xf402('0xff')]||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x251c44[_0xf402('0xee')]>=_0x2813c8[_0xf402('0xf8')]-0x1){return!![];}this[_0xf402('0xbf')]({'active':![],'countmachineretry':_0x251c44[_0xf402('0xee')]+=0x1,'scheduledat':moment()['add'](_0x2813c8['dialMachineRetryFrequency'],'minutes')[_0xf402('0x74')](_0xf402('0x105')),'ContactId':_0x251c44[_0xf402('0xfe')],'ListId':_0x251c44['ListId'],'VoiceQueueId':_0x251c44['VoiceQueueId']||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x100')));break;case 0x14:if(_0x251c44['countagentrejectretry']>=_0x2813c8[_0xf402('0x1a9')]-0x1){return!![];}this[_0xf402('0xbf')]({'active':![],'countagentrejectretry':_0x251c44[_0xf402('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x2813c8[_0xf402('0x1aa')],'minutes')['format'](_0xf402('0x105')),'ContactId':_0x251c44['ContactId'],'ListId':_0x251c44[_0xf402('0xd2')],'VoiceQueueId':_0x251c44[_0xf402('0xff')]||undefined,'CampaignId':_0x251c44[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x1ab')));break;default:return!![];}};Dialer[_0xf402('0x15')][_0xf402('0x19b')]=function(_0x1561b3,_0x264ff9,_0x56dea3){var _0x44e0b6=this;var _0x336110=new History(_0x1561b3);var _0x6aea89=![];var _0x444805;var _0x426fcd;return new BPromise(function(_0x7530,_0x99b0e4){if(_[_0xf402('0x39')](_0x264ff9)&&typeof _0x264ff9!==_0xf402('0x170')){return _0x99b0e4(msgResponse('[callProgressDetecting]',_0xf402('0x145'),_0xf402('0x1ac')));}if(_['isUndefined'](_0x56dea3)&&typeof _0x56dea3!==_0xf402('0x170')){return _0x99b0e4(msgResponse(_0xf402('0x1ad'),'Failure',_0xf402('0x1ae')));}_0x44e0b6[_0xf402('0xb5')](_0x336110,_0x56dea3['reason'],_0x264ff9)[_0xf402('0x37')](function(_0x2690f8){if(_0x2690f8[_0xf402('0x119')]==0x1)_0x6aea89=!![];switch(_0x56dea3[_0xf402('0x1af')]){case'0':_0x264ff9['outboundNoSuchCallsDay']+=0x1;_0x336110[_0xf402('0xe2')]=0x0;_0x336110['statedesc']=_0xf402('0x1b0');_0x336110[_0xf402('0xf3')]+=0x1;_0x336110['countglobal']+=0x1;ami['emit'](_0xf402('0x1b1'),ut['buildObj'](_0x1561b3,_0xf402('0x1b2')));_0x444805=_0x264ff9[_0xf402('0x1a5')];_0x426fcd=_0x264ff9['callAdditionalPhoneAfterMin'];_0x44e0b6[_0xf402('0xcb')](_0x336110)[_0xf402('0xad')](loggerCatch(_0xf402('0x102')));if(_0x44e0b6[_0xf402('0x19c')](0x0,_0x1561b3,_0x264ff9)&&!_0x6aea89){if(_0x336110['countnosuchnumberretry']>=_0x264ff9[_0xf402('0x1b3')]){_0x44e0b6['createStateFinal'](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1b4'));}else{_0x44e0b6['stateGlobal'](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1b4'));}}break;case'3':_0x264ff9[_0xf402('0x62')]+=0x1;_0x336110[_0xf402('0xe2')]=0x3;_0x336110['statedesc']=_0xf402('0x1b5');_0x336110[_0xf402('0xf2')]+=0x1;_0x336110[_0xf402('0xef')]+=0x1;ami[_0xf402('0x49')](_0xf402('0x1b6'),ut[_0xf402('0xf0')](_0x1561b3,'noanswer'));_0x444805=_0x264ff9['dialNoAnswerRetryFrequency'];_0x426fcd=_0x264ff9[_0xf402('0x121')];_0x44e0b6[_0xf402('0xcb')](_0x336110)[_0xf402('0xad')](loggerCatch(_0xf402('0x1b7')));if(_0x44e0b6[_0xf402('0x19c')](0x3,_0x1561b3,_0x264ff9)&&!_0x6aea89){if(_0x336110[_0xf402('0xf2')]>=_0x264ff9[_0xf402('0x19d')]){_0x44e0b6[_0xf402('0xf9')](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1b8'));}else{_0x44e0b6[_0xf402('0x104')](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1b8'));}}break;case'5':_0x264ff9[_0xf402('0x5e')]+=0x1;_0x336110[_0xf402('0xe2')]=0x5;_0x336110[_0xf402('0xa4')]='Busy';_0x336110[_0xf402('0xf1')]+=0x1;_0x336110[_0xf402('0xef')]+=0x1;ami[_0xf402('0x49')](_0xf402('0x1b9'),ut['buildObj'](_0x1561b3,_0xf402('0x1ba')));_0x444805=_0x264ff9[_0xf402('0x1a1')];_0x426fcd=_0x264ff9[_0xf402('0x121')];_0x44e0b6[_0xf402('0xcb')](_0x336110)[_0xf402('0xad')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x44e0b6[_0xf402('0x19c')](0x5,_0x1561b3,_0x264ff9)&&!_0x6aea89){if(_0x336110[_0xf402('0xf1')]>=_0x264ff9[_0xf402('0x1a0')]){_0x44e0b6['createStateFinal'](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1bb'));}else{_0x44e0b6[_0xf402('0x104')](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1bb'));}}break;case'8':_0x264ff9[_0xf402('0x5f')]+=0x1;_0x336110[_0xf402('0xe2')]=0x8;_0x336110[_0xf402('0xa4')]=_0xf402('0x1bc');_0x336110['countcongestionretry']+=0x1;_0x336110[_0xf402('0xef')]+=0x1;_0x444805=_0x264ff9[_0xf402('0x1bd')];_0x426fcd=_0x264ff9[_0xf402('0x121')];ami['emit'](_0xf402('0x1be'),ut[_0xf402('0xf0')](_0x1561b3,_0xf402('0x1bf')));_0x44e0b6[_0xf402('0xcb')](_0x336110)['catch'](loggerCatch(_0xf402('0x1c0')));if(_0x44e0b6[_0xf402('0x19c')](0x8,_0x1561b3,_0x264ff9)&&!_0x6aea89){if(_0x336110[_0xf402('0x103')]>=_0x264ff9[_0xf402('0x1a3')]){_0x44e0b6[_0xf402('0xf9')](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1c1'));}else{_0x44e0b6[_0xf402('0x104')](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1c1'));}}break;case'11':_0x264ff9['outboundAbandonedCallsDay']+=0x1;_0x336110[_0xf402('0xe2')]=0xb;_0x336110[_0xf402('0xa4')]=_0xf402('0x11d');_0x336110[_0xf402('0x11f')]+=0x1;_0x336110[_0xf402('0xef')]+=0x1;_0x444805=_0x264ff9['dialAbandonedRetryFrequency'];_0x426fcd=_0x264ff9[_0xf402('0x121')];_0x44e0b6[_0xf402('0xcb')](_0x336110)[_0xf402('0xad')](loggerCatch(_0xf402('0x1c2')));if(_0x44e0b6[_0xf402('0x19c')](0xb,_0x1561b3,_0x264ff9)&&!_0x6aea89){if(_0x336110[_0xf402('0x11f')]>=_0x264ff9['dialAbandonedMaxRetry']){_0x44e0b6[_0xf402('0xf9')](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1c3'));}else{_0x44e0b6[_0xf402('0x104')](_0x336110,_0x7530,_0x99b0e4,_0xf402('0x1c3'));}}break;case'20':_0x264ff9[_0xf402('0x64')]+=0x1;_0x336110[_0xf402('0xe2')]=0x14;_0x336110['statedesc']=_0xf402('0x1c4');_0x336110[_0xf402('0xf5')]+=0x1;_0x336110['countglobal']+=0x1;_0x444805=_0x264ff9['dialAgentRejectRetryFrequency'];_0x426fcd=_0x264ff9[_0xf402('0x121')];ami[_0xf402('0x49')]('custom:agentreject',ut[_0xf402('0xf0')](_0x1561b3,_0xf402('0x1c5')));_0x44e0b6['createHistory'](_0x336110)[_0xf402('0xad')](loggerCatch(_0xf402('0x1c6')));if(_0x44e0b6['checkRetriveMax'](0x14,_0x1561b3,_0x264ff9)&&!_0x6aea89){if(_0x336110[_0xf402('0xf5')]>=_0x264ff9['dialAgentRejectMaxRetry']){_0x44e0b6[_0xf402('0xf9')](_0x336110,_0x7530,_0x99b0e4,'reason\x2020\x20agentreject');}else{_0x44e0b6[_0xf402('0x104')](_0x336110,_0x7530,_0x99b0e4,'reason\x2020\x20agentreject');}}break;default:_0x264ff9[_0xf402('0x1c7')]+=0x1;_0x336110[_0xf402('0xe2')]=0xc;_0x336110[_0xf402('0xa4')]=_0x56dea3['reason'];_0x444805=_0x264ff9['dialAgentRejectRetryFrequency'];_0x426fcd=_0x264ff9[_0xf402('0x121')];_0x44e0b6['createHistory'](_0x336110)[_0xf402('0xad')](loggerCatch(_0xf402('0x1c8')));if(_0x44e0b6[_0xf402('0x19c')](_0x56dea3[_0xf402('0x1af')],_0x1561b3,_0x264ff9)&&!_0x6aea89){if(_0x336110[_0xf402('0xf1')]+_0x336110[_0xf402('0x103')]+_0x336110[_0xf402('0xf2')]+_0x336110[_0xf402('0xf3')]+_0x336110['countdropretry']+_0x336110['countabandonedretry']+_0x336110[_0xf402('0xee')]+_0x336110[_0xf402('0xf5')]>=_0x264ff9['dialGlobalMaxRetry']){_0x44e0b6['stateGlobal'](_0x336110,_0x7530,_0x99b0e4,_0x56dea3[_0xf402('0x1af')]);}else{_0x44e0b6[_0xf402('0xf9')](_0x336110,_0x7530,_0x99b0e4,_0x56dea3[_0xf402('0x1af')]);}}}})[_0xf402('0x37')](function(_0x530695){if(_0x6aea89){_0x44e0b6[_0xf402('0xb8')](_0x336110,_0x444805,_0x426fcd)['then'](function(_0x9a0841){return _0x7530(0x1);});}});});};Dialer[_0xf402('0x15')][_0xf402('0x104')]=function(_0x45bd3c,_0x3206dd,_0x2cba91,_0x475dd4){var _0x337074=new Final(_0x45bd3c);_0x337074['state']=0xf;_0x337074[_0xf402('0xa4')]='Global';this[_0xf402('0xf9')](_0x337074,_0x3206dd,_0x2cba91,_0x475dd4);};Dialer['prototype'][_0xf402('0xf9')]=function(_0x3573cc,_0xe9ded2,_0x19950e,_0x463698){this['moveContactManagedDialer'](_0x3573cc)[_0xf402('0x37')](function(){return _0xe9ded2(msgResponse('[callProgressDetecting]',_0xf402('0xd8'),_0x463698));})[_0xf402('0xad')](function(){return _0x19950e(msgResponse(_0xf402('0x1c9'),_0xf402('0x145'),_0xf402('0x1ca')));});};Dialer[_0xf402('0x15')][_0xf402('0x7')]=function(_0x3b6ebb){var _0xb794dd=_0x3b6ebb['dialPredictiveOptimizationPercentage']/0x64;var _0x28001b=_0x3b6ebb[_0xf402('0x61')]/(_0x3b6ebb[_0xf402('0x61')]+_0x3b6ebb[_0xf402('0x5c')]);var _0x4383e0=Math['round'](_0x3b6ebb[_0xf402('0x1cb')]*(_0x3b6ebb[_0xf402('0x1cc')]/0x64));var _0x143061=Math[_0xf402('0x1cd')](_0x3b6ebb[_0xf402('0x1cb')]*(_0x3b6ebb['predictiveIntervalMinThreshold']/0x64));var _0x5614bb=_0x3b6ebb[_0xf402('0x4d')]+_0x3b6ebb[_0xf402('0x9e')];var _0x29e296=Math[_0xf402('0x1ce')](_0x3b6ebb['erlangCalls']*_0x3b6ebb[_0xf402('0x6d')]*_0x3b6ebb['predictiveIntervalHitRate']*_0x3b6ebb[_0xf402('0x6a')]);if(_[_0xf402('0x39')](_0x3b6ebb[_0xf402('0x23')])){if(!_['isUndefined'](_0x3b6ebb[_0xf402('0x6f')])){_0x3b6ebb[_0xf402('0x6f')]=undefined;loggerPredictive['error'](_0xf402('0x1cf'),_0xf402('0x1d0'));}if(!_['isUndefined'](_0x3b6ebb['handlePredictive'])){loggerPredictive[_0xf402('0x95')](_0xf402('0x1cf'),_0xf402('0x1d1'));clearInterval(_0x3b6ebb[_0xf402('0x8e')]);_0x3b6ebb['handlePredictive']=undefined;}_0x3b6ebb[_0xf402('0x23')]=moment()[_0xf402('0x74')](_0xf402('0x105'));loggerPredictive[_0xf402('0x7c')](_0x3b6ebb[_0xf402('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x3b6ebb[_0xf402('0x23')]);this[_0xf402('0x159')](_0x3b6ebb,0x1);}else if(ifInterval(_0x3b6ebb[_0xf402('0x1d2')],_0x3b6ebb[_0xf402('0x23')])){this[_0xf402('0x159')](_0x3b6ebb,0x1);loggerPredictiveCalls['info'](_0xf402('0x1d3'),_0x3b6ebb[_0xf402('0x23')],_0x3b6ebb[_0xf402('0x3c')]);_0x3b6ebb['erlangCalls']=0x0;_0x3b6ebb[_0xf402('0x69')]=0x0;}else if(_0xb794dd<_0x28001b&&_0x3b6ebb[_0xf402('0x1d4')]==='dropRate'){freeVariablesPredictive(_0x3b6ebb);loggerPredictive[_0xf402('0x7c')](_0xf402('0x1d5'),'Dropped\x20calls\x20day',_0x28001b,_0xf402('0x23'),_0x3b6ebb['name']);}else if(_0x29e296<_0x3b6ebb[_0xf402('0x69')]&&_0x3b6ebb[_0xf402('0x1d4')]===_0xf402('0x1d6')){freeVariablesPredictive(_0x3b6ebb);loggerPredictive[_0xf402('0x7c')](_0xf402('0x1d7'),'Max\x20Drop\x20',_0x29e296,_0xf402('0x1d8'),_0x3b6ebb['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x3b6ebb['name']);}else if(!ifInterval(_0x3b6ebb[_0xf402('0x1d2')],_0x3b6ebb[_0xf402('0x23')])&&_[_0xf402('0x39')](_0x3b6ebb[_0xf402('0x6f')])&&!_['isUndefined'](_0x3b6ebb[_0xf402('0x23')])){_0x3b6ebb[_0xf402('0x6f')]=moment()['format'](_0xf402('0x105'));loggerPredictive[_0xf402('0x7c')](_0x3b6ebb[_0xf402('0x3c')],_0xf402('0x1d9'),_0x3b6ebb[_0xf402('0x6f')]);this['averageHandleTime'](_0x3b6ebb['dialPredictiveInterval'])['then'](this[_0xf402('0x1da')](_0x3b6ebb))[_0xf402('0x37')](mergeDataErlangB(_0x3b6ebb))[_0xf402('0x37')](this['startMethodPredictive'](_0x3b6ebb))[_0xf402('0xad')](loggerCatchPredictive(_0xf402('0x1db'),_0x3b6ebb));}else if(!ifInterval(_0x3b6ebb[_0xf402('0x1d2')],_0x3b6ebb[_0xf402('0x6f')])){_0x3b6ebb[_0xf402('0x69')]=0x0;_0x3b6ebb[_0xf402('0x6f')]=moment()[_0xf402('0x74')](_0xf402('0x105'));loggerPredictive[_0xf402('0x7c')](_0x3b6ebb[_0xf402('0x3c')],_0xf402('0x1dc'),_0x3b6ebb['startPredictive']);clearInterval(_0x3b6ebb[_0xf402('0x8e')]);_0x3b6ebb[_0xf402('0x8e')]=undefined;this[_0xf402('0xbc')](_0x3b6ebb[_0xf402('0x1d2')])[_0xf402('0x37')](this[_0xf402('0x1da')](_0x3b6ebb))[_0xf402('0x37')](mergeDataErlangB(_0x3b6ebb))[_0xf402('0x37')](this['startMethodPredictive'](_0x3b6ebb))[_0xf402('0xad')](loggerCatchPredictive(_0xf402('0x1dd'),_0x3b6ebb));}else if(_0x3b6ebb[_0xf402('0x1cb')]&&_0x5614bb<_0x3b6ebb[_0xf402('0x1cb')]-_0x143061){freeVariablesPredictive(_0x3b6ebb);loggerPredictive['info'](_0x3b6ebb['name'],_0xf402('0x1de'),_0x5614bb,_0xf402('0x1df'),_0x3b6ebb['predictiveIntervalAvailable'],'-',_0x143061,'=',_0x3b6ebb[_0xf402('0x1cb')]-_0x143061,')');}else if(_0x3b6ebb[_0xf402('0x1cb')]&&_0x5614bb>_0x3b6ebb[_0xf402('0x1cb')]+_0x4383e0){freeVariablesPredictive(_0x3b6ebb);loggerPredictive[_0xf402('0x7c')](_0x3b6ebb['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5614bb,_0xf402('0x1e0'),_0x3b6ebb['predictiveIntervalAvailable'],'+',_0x4383e0,'=',_0x3b6ebb['predictiveIntervalAvailable']+_0x4383e0,')');}};Dialer[_0xf402('0x15')]['getDataPredictive']=function(_0x4e02c4){var _0x170739=this;return function(_0x240386){return new BPromise(function(_0xced88e,_0x93c046){_[_0xf402('0x8b')](_0x4e02c4,_0x240386[0x0]);if(checkGetDataPredictive(_0x240386[0x0])){var _0x378035=_0x4e02c4[_0xf402('0x1cb')]=_0x4e02c4[_0xf402('0x9e')]+_0x4e02c4[_0xf402('0x4d')];var _0x4af393=_0x4e02c4[_0xf402('0x1d2')]*0x3c;var _0x458b93=_0x240386[0x0][_0xf402('0x67')]+_0x240386[0x0][_0xf402('0x66')];var _0x54058e=(_0x240386[0x0][_0xf402('0x65')]+_0x240386[0x0][_0xf402('0x68')]+_0x240386[0x0][_0xf402('0x7f')])/_0x240386[0x0]['predictiveIntervalTotalCalls'];_0x4e02c4['predictiveIntervalHitRate']=_0x54058e>0x0?_0x54058e:0x1;switch(_0x4e02c4[_0xf402('0x1d4')]){case'dropRate':var _0x54f319=_0x4e02c4[_0xf402('0x1e1')]/0x64;return _0x170739['abandonmentRate'](_0x378035,_0x4af393,_0x458b93,_0x54058e,_0x54f319)[_0xf402('0x37')](function(_0x3f9b9d){return _0xced88e(_0x3f9b9d);});case _0xf402('0x1e2'):var _0x3f5ecc=_0x4e02c4['dialPredictiveOptimizationPercentage']/0x64;return _0x170739[_0xf402('0x1e3')](_0x378035,_0x4af393,_0x458b93,_0x54058e,_0x3f5ecc)['then'](function(_0x426fbb){return _0xced88e(_0x426fbb);});default:return _0x93c046(msgResponse(_0xf402('0x1e4'),'Failure',_0xf402('0x1e5')));}}else{return _0x93c046(msgResponse(_0xf402('0x1e4'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0xf402('0x1e6')]=function(_0xca57ee){var _0x595d25=this;return function(_0x35ebe8){return new BPromise(function(_0x5e383d,_0x5ebc8e){_['merge'](_0xca57ee,_0x35ebe8[0x0]);if(checkGetDataPredictive(_0x35ebe8[0x0])){loggerPredictive[_0xf402('0x7c')](JSON[_0xf402('0x73')](_0x35ebe8[0x0]));if(_0xca57ee[_0xf402('0x1d4')]==='dropRate'){return _0x595d25[_0xf402('0x1e7')](_0xca57ee['id'])[_0xf402('0x37')](function(_0x5a8b3b){var _0x4456bf=_0xca57ee['loggedIn']-_0x5a8b3b[0x0][_0xf402('0x1e8')];var _0x34792c=_0xca57ee[_0xf402('0x1d2')]*0x3c;var _0x825992=_0x35ebe8[0x0][_0xf402('0x67')]+_0x35ebe8[0x0]['predictiveIntervalAvgHoldtime'];var _0x4d5a56=(_0x35ebe8[0x0][_0xf402('0x65')]+_0x35ebe8[0x0][_0xf402('0x68')]+_0x35ebe8[0x0][_0xf402('0x7f')])/_0x35ebe8[0x0][_0xf402('0x7a')];var _0x4ca656=_0xca57ee[_0xf402('0x1e1')]/0x64;_0xca57ee['predictiveIntervalPauses']=_0x5a8b3b[0x0][_0xf402('0x1e8')]||0x0;_0xca57ee['predictiveIntervalHitRate']=_0x4d5a56>0x0?_0x4d5a56:0x1;return _0x595d25[_0xf402('0x1e9')](_0x4456bf,_0x34792c,_0x825992,_0x4d5a56,_0x4ca656);})[_0xf402('0x37')](function(_0x3dc73f){return _0x5e383d(_0x3dc73f);})[_0xf402('0xad')](function(_0x429cf0){return _0x5ebc8e(msgResponse(_0xf402('0x1ea'),_0xf402('0x145'),JSON['stringify'](_0x429cf0)));});}if(_0xca57ee[_0xf402('0x1d4')]===_0xf402('0x1e2')){return _0x595d25['getVoiceQueueRtPauses'](_0xca57ee['id'])[_0xf402('0x37')](function(_0xca35c7){var _0x310686=_0xca57ee[_0xf402('0x4e')]-_0xca35c7[0x0]['outboundQueuePauses'];var _0xd20c22=_0xca57ee[_0xf402('0x1d2')]*0x3c;var _0x559796=_0x35ebe8[0x0]['predictiveIntervalAvgTalktime']+_0x35ebe8[0x0][_0xf402('0x66')];var _0x4809e3=(_0x35ebe8[0x0][_0xf402('0x65')]+_0x35ebe8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x35ebe8[0x0][_0xf402('0x7f')])/_0x35ebe8[0x0][_0xf402('0x7a')];var _0x176cc6=_0xca57ee[_0xf402('0x1e1')]/0x64;_0xca57ee[_0xf402('0x6b')]=_0xca35c7[0x0]['outboundQueuePauses']||0x0;_0xca57ee[_0xf402('0x1eb')]=_0x4809e3>0x0?_0x4809e3:0x1;return _0x595d25[_0xf402('0x1e3')](_0x310686,_0xd20c22,_0x559796,_0x4809e3,_0x176cc6);})[_0xf402('0x37')](function(_0x20a5e2){return _0x5e383d(_0x20a5e2);})[_0xf402('0xad')](function(_0x3cdcce){return _0x5ebc8e(msgResponse('[CatchErlangB]',_0xf402('0x145'),JSON[_0xf402('0x73')](_0x3cdcce)));});}}else{return _0x5ebc8e(msgResponse(_0xf402('0x1e4'),_0xf402('0x145'),'check\x20failure'));}});};};Dialer[_0xf402('0x15')][_0xf402('0x1ec')]=function(_0x48cbcd){var _0x5c8f0f=this;return function(){var _0x31a46a=0x0;var _0x24ae0b=Math[_0xf402('0x1ce')](_0x48cbcd['erlangCallToSecond']*0x3e8);if(_0x24ae0b>0x0){_0x24ae0b=_0x24ae0b<0x64?0x64:_0x24ae0b;loggerPredictive['info'](_0x48cbcd[_0xf402('0x3c')],_0xf402('0x1ed'),_0x24ae0b,_0xf402('0x46'));_0x48cbcd[_0xf402('0x8e')]=setInterval(function(){_0x5c8f0f[_0xf402('0x8e')](_0x48cbcd);loggerPredictiveCalls[_0xf402('0x7c')]('[handlePredictive]',_0x31a46a+=0x1);},_0x24ae0b);}else{loggerPredictive[_0xf402('0x7c')](_0x48cbcd[_0xf402('0x3c')],_0xf402('0x1ee'));}};};Dialer[_0xf402('0x15')][_0xf402('0x1ef')]=function(_0x56af75,_0x284ca0){var _0x3eab0b=this;return function(_0x2d4ba5){if(_['isEmpty'](_0x2d4ba5)){if(_[_0xf402('0xa9')](_0x284ca0[_0xf402('0xd3')])||!_0x284ca0['recallme']){if(_0x56af75[_0xf402('0x57')]===_0xf402('0x6')){_0x56af75[_0xf402('0x12d')]=_[_0xf402('0x39')](_0x56af75[_0xf402('0x12d')])?!![]:_0x56af75['queueStatusComplete'];var _0x256ee2=uuid['v4']();_0x3eab0b['actions'][_0x256ee2]=new Action(_0x56af75,_0x284ca0,_0x256ee2);loggerBooked[_0xf402('0x7c')]('[booked][checkContactBlack]',_0x256ee2,_0xf402('0x1f0'),JSON['stringify'](_0x56af75[_0xf402('0x12d')]),'Queue:\x20',_0x56af75['name']);if(_0x56af75[_0xf402('0x12d')]){_0x56af75['queueStatusComplete']=![];_0x3eab0b[_0xf402('0x24')][_0x3eab0b['actions'][_0x256ee2]['queue']]=[];ami[_0xf402('0xaa')]({'actionid':_0x256ee2,'action':_0xf402('0x1f1'),'queue':_0x56af75[_0xf402('0x3c')]})[_0xf402('0xad')](function(){_0x3eab0b[_0xf402('0xaf')](_0x56af75);_0x3eab0b[_0xf402('0xbf')]({'active':![],'ContactId':_0x3eab0b[_0xf402('0x1f')][_0x256ee2][_0xf402('0xfe')],'ListId':_0x3eab0b[_0xf402('0x1f')][_0x256ee2]['ListId'],'VoiceQueueId':_0x3eab0b[_0xf402('0x1f')][_0x256ee2][_0xf402('0xff')]||undefined,'CampaignId':_0x3eab0b[_0xf402('0x1f')][_0x256ee2][_0xf402('0xd4')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3eab0b[_0xf402('0x1f')][_0x256ee2];});}else{loggerBooked['info'](_0xf402('0x1f2'),JSON['stringify'](_0x56af75[_0xf402('0x12d')]),'Queue:\x20',_0x56af75[_0xf402('0x3c')]);_0x3eab0b[_0xf402('0xaf')](_0x56af75);_0x3eab0b[_0xf402('0xbf')]({'active':![],'ContactId':_0x3eab0b['actions'][_0x256ee2][_0xf402('0xfe')],'ListId':_0x3eab0b[_0xf402('0x1f')][_0x256ee2]['ListId'],'VoiceQueueId':_0x3eab0b['actions'][_0x256ee2][_0xf402('0xff')]||undefined,'CampaignId':_0x3eab0b[_0xf402('0x1f')][_0x256ee2][_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x1f3')));delete _0x3eab0b['actions'][_0x256ee2];}}else{return _0x3eab0b[_0xf402('0x16f')](_0x56af75,_0x284ca0);}}else{if(getDiff(_0x284ca0[_0xf402('0x1f4')])<_0x56af75[_0xf402('0x1f5')]*0x3c){if(_0x284ca0['Agent']&&!_0x284ca0['Agent'][_0xf402('0x1f6')]){_0x3eab0b[_0xf402('0x18')][_0xf402('0x12e')](_0x284ca0['id'])[_0xf402('0x16')](function(){_0x3eab0b['updateOriginated'](_0x56af75);});}else{_0x3eab0b['unlockContact']({'active':![]},_0x284ca0['id'],0x1)[_0xf402('0x16')](function(){_0x3eab0b[_0xf402('0xaf')](_0x56af75);});}}else{_0x56af75['outboundReCallsDay']+=0x1;_0x3eab0b[_0xf402('0xaf')](_0x56af75);if(_0x56af75['dialRecallInQueue']){_0x3eab0b['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x284ca0[_0xf402('0xfe')],'ListId':_0x284ca0[_0xf402('0xd2')],'VoiceQueueId':_0x284ca0[_0xf402('0xff')]||undefined,'CampaignId':_0x284ca0[_0xf402('0xd4')]||undefined})[_0xf402('0xad')](loggerCatch(_0xf402('0x1f7')));_0x3eab0b['createHistory'](createObjHistory(_0x56af75,_0x284ca0,_0xf402('0x1f8'),0x17,_0xf402('0x1f9')))[_0xf402('0xad')](loggerCatch(_0xf402('0x1fa')));}else{_0x3eab0b[_0xf402('0xdb')](createObjHistory(_0x56af75,_0x284ca0,_0xf402('0x1fb'),0x16,_0xf402('0x1fc')),_0xf402('0x1fd'),_0xf402('0x1fe'));}}}}else{_0x56af75[_0xf402('0x5d')]+=0x1;_0x3eab0b['saveInDb'](createObjHistory(_0x56af75,_0x284ca0,_0xf402('0x1ff'),0xd,_0xf402('0x200')),_0xf402('0x201'),_0xf402('0x202'));throw _0xf402('0x203');}};};Dialer[_0xf402('0x15')][_0xf402('0x204')]=function(_0x1aa528){var _0x10d141=this;var _0x1cf7ee=_0x1aa528[_0xf402('0x205')]-_0x1aa528[_0xf402('0x6c')]-_0x1aa528[_0xf402('0xc4')];emitCampaignSummary(_0x1aa528);if(_0x1cf7ee>0x0){if(_0x1cf7ee>this[_0xf402('0x1d')]){_0x1cf7ee=this[_0xf402('0x1d')];}_0x1aa528[_0xf402('0xc4')]+=_0x1cf7ee;this[_0xf402('0xc6')](_0x1aa528['id'],_0x1cf7ee,_0x1aa528['dialOrderByScheduledAt'],_0x1aa528)[_0xf402('0x37')](function(_0x9aac4f){_0x1aa528[_0xf402('0xc4')]-=_0x1cf7ee;_0x1aa528[_0xf402('0xc4')]=_0x1aa528[_0xf402('0xc4')]>0x0?_0x1aa528['temp']:0x0;if(!checkContactEmpty(_0x9aac4f)){_0x1aa528[_0xf402('0x3a')]=_0xf402('0x206');logger[_0xf402('0x7c')](_0xf402('0x207')+_0x1aa528[_0xf402('0x3c')]);}else{_0x1aa528[_0xf402('0x6c')]+=_0x9aac4f['length'];_0x1aa528['message']='RUNNING';for(var _0x180da3=0x0;_0x180da3<_0x9aac4f[_0xf402('0x97')];_0x180da3+=0x1){_0x1aa528[_0xf402('0x208')]+=0x1;if(_[_0xf402('0xa9')](_0x9aac4f[_0x180da3])||_['isNil'](_0x9aac4f[_0x180da3][_0xf402('0x189')])||_[_0xf402('0xa9')](_0x9aac4f[_0x180da3][_0xf402('0x172')])){_0x10d141[_0xf402('0x209')](_0xf402('0x20a'),_0x1aa528,_0x9aac4f[_0x180da3]);}else{_0x10d141[_0xf402('0xba')](_[_0xf402('0xd1')](_0x9aac4f[_0x180da3],[_0xf402('0xd4'),'Contact.phone']))[_0xf402('0x37')](_0x10d141[_0xf402('0x1ef')](_0x1aa528,_0x9aac4f[_0x180da3]))[_0xf402('0xad')](_0x10d141['loggerHandler'](_0xf402('0x20b'),_0x1aa528));}}}})[_0xf402('0xad')](loggerGetContactDialer(_0xf402('0x20c'),_0x1aa528,_0x1cf7ee));}};Dialer[_0xf402('0x15')]['handlePower']=function(_0x3df648,_0xed3038){var _0x2746ff=this;var _0x324c8c=[];var _0x52c081=_0xed3038>=0x1?_0xed3038:0x1;if(_0x3df648[_0xf402('0x57')]==='booked'){_0x52c081=0x1;}var _0x5d0b68=Math[_0xf402('0x1ce')](_0x3df648['available']*_0x52c081)-_0x3df648[_0xf402('0x6c')]-_0x3df648[_0xf402('0xc4')];emitVoiceQueueSummary(_0x3df648);if(_0x3df648['dialLimitQueue']>0x0){var _0x3f6671=_0x3df648[_0xf402('0x20d')]-_0x3df648[_0xf402('0x6c')]-_0x3df648[_0xf402('0x9e')]-_0x3df648['temp']-_0x3df648['pTalking'];if(_0x5d0b68>_0x3f6671){_0x5d0b68=_0x3f6671;}}if(_0x5d0b68>0x0){if(_0x3df648['dialMethod']===_0xf402('0x6')){_0x5d0b68=0x1;}if(_0x5d0b68>this[_0xf402('0x1d')]){_0x5d0b68=this[_0xf402('0x1d')];}_0x3df648[_0xf402('0xc4')]+=_0x5d0b68;for(var _0x148771 in this[_0xf402('0x1b')]){if(typeof this[_0xf402('0x1b')][_0x148771]!==_0xf402('0x98')){if(this[_0xf402('0x1b')][_0x148771][_0xf402('0xe2')]===_0xf402('0x20e')&&this['agents'][_0x148771][_0xf402('0xab')]===_0xf402('0x165')){_0x324c8c['push'](this['agents'][_0x148771]['id']);}}}this['getContactDialer'](_0x3df648['id'],_0x324c8c,_0x5d0b68,_0x3df648[_0xf402('0x20f')],_0x3df648)['then'](function(_0x544cb7){_0x3df648['temp']-=_0x5d0b68;_0x3df648['temp']=_0x3df648[_0xf402('0xc4')]>0x0?_0x3df648['temp']:0x0;if(!checkContactEmpty(_0x544cb7)){_0x2746ff[_0xf402('0x210')](_0x3df648)['then'](sendMessageReschedule(_0x3df648))[_0xf402('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x3df648[_0xf402('0x6c')]+=_0x544cb7['length'];_0x3df648[_0xf402('0x3a')]=_0x3df648[_0xf402('0x57')]===_0xf402('0x6')?'ACTIVE':_0xf402('0x211');for(var _0x33611c=0x0;_0x33611c<_0x544cb7[_0xf402('0x97')];_0x33611c+=0x1){if(_[_0xf402('0xa9')](_0x544cb7[_0x33611c])||_['isNil'](_0x544cb7[_0x33611c][_0xf402('0x189')])||_[_0xf402('0xa9')](_0x544cb7[_0x33611c][_0xf402('0x172')])){_0x2746ff['emptyContact']('[actionOriginate]\x20',_0x3df648,_0x544cb7[_0x33611c]);}else{_0x2746ff[_0xf402('0xb3')](_[_0xf402('0xd1')](_0x544cb7[_0x33611c],[_0xf402('0xff'),_0xf402('0x212')]))['then'](_0x2746ff['checkContactBlack'](_0x3df648,_0x544cb7[_0x33611c]))[_0xf402('0xad')](_0x2746ff[_0xf402('0xcf')](_0xf402('0x20a'),_0x3df648));}}}})[_0xf402('0xad')](loggerGetContactDialer('[getContactDialer2]',_0x3df648,_0x5d0b68));}};Dialer[_0xf402('0x15')][_0xf402('0x8e')]=function(_0x24533f){if(_0x24533f[_0xf402('0x20d')]>0x0){var _0x45ebb7=_0x24533f[_0xf402('0x20d')]-_0x24533f[_0xf402('0x6c')]-_0x24533f[_0xf402('0x9e')];if(_0x45ebb7>0x0){this[_0xf402('0x213')](_0x24533f);}else{loggerPredictiveCalls[_0xf402('0x7c')](_0xf402('0x214'));}}else{this[_0xf402('0x213')](_0x24533f);}};Dialer['prototype'][_0xf402('0x213')]=function(_0x49ec1d){var _0x51a15e=this;var _0x20daf6=[];_0x49ec1d[_0xf402('0x6c')]+=0x1;for(var _0xdd751b in this['agents']){if(typeof this[_0xf402('0x1b')][_0xdd751b]!==_0xf402('0x98')){if(this[_0xf402('0x1b')][_0xdd751b]['state']==='not_inuse'&&this[_0xf402('0x1b')][_0xdd751b]['status']==='reachable'){_0x20daf6[_0xf402('0x12a')](this['agents'][_0xdd751b]['id']);}}}this[_0xf402('0xc3')](_0x49ec1d['id'],_0x20daf6,0x1,_0x49ec1d['dialOrderByScheduledAt'],_0x49ec1d)[_0xf402('0x37')](function(_0x35d5b6){if(!checkContactEmpty(_0x35d5b6)){checkContactLowerLimitOriginate(_0x49ec1d,0x1,0x0);_0x51a15e[_0xf402('0x210')](_0x49ec1d)[_0xf402('0x37')](sendMessageReschedule(_0x49ec1d))[_0xf402('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x49ec1d[_0xf402('0x3a')]=_0xf402('0x211');if(_[_0xf402('0xa9')](_0x35d5b6[0x0])||_[_0xf402('0xa9')](_0x35d5b6[0x0][_0xf402('0x189')])||_['isNil'](_0x35d5b6[0x0][_0xf402('0x172')])){_0x51a15e['emptyContact']('[actionOriginate]\x20',_0x49ec1d,_0x35d5b6[0x0]);}else{_0x51a15e[_0xf402('0xb3')](_[_0xf402('0xd1')](_0x35d5b6[0x0],['VoiceQueueId',_0xf402('0x212')]))[_0xf402('0x37')](_0x51a15e[_0xf402('0x1ef')](_0x49ec1d,_0x35d5b6[0x0]))[_0xf402('0xad')](_0x51a15e[_0xf402('0xcf')]('[actionOriginatePredictive]\x20',_0x49ec1d));}}})[_0xf402('0xad')](loggerGetContactDialer('[getContactDialerPredictive]',_0x49ec1d,0x1));emitVoiceQueueSummary(_0x49ec1d);};Dialer[_0xf402('0x15')]['abandonmentRate']=function(_0x267dcc,_0x59a345,_0x42285a,_0x13563e,_0x5cc471,_0x110725){loggerPredictive[_0xf402('0x7c')](_0xf402('0x215'));loggerPredictive[_0xf402('0x7c')](_0xf402('0x216'),_0x267dcc);loggerPredictive['info'](_0xf402('0x217'),_0x59a345);loggerPredictive[_0xf402('0x7c')]('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',_0x42285a);loggerPredictive[_0xf402('0x7c')](_0xf402('0x218'),_0x13563e);loggerPredictive['info'](_0xf402('0x219'),_0x5cc471);loggerPredictive[_0xf402('0x7c')]('---------------------------');return new BPromise(function(_0x51d9f3,_0x2b688d){if(_0x267dcc<=0x0||isNaN(_0x267dcc)){return _0x2b688d(msgResponse(_0xf402('0x21a'),'Error',_0xf402('0x21b')+_0x267dcc));}if(_0x42285a<=0x0||isNaN(_0x42285a)){return _0x2b688d(msgResponse(_0xf402('0x21a'),_0xf402('0x45'),'Ts\x20=\x20'+_0x42285a));}if(_0x13563e<=0x0||isNaN(_0x13563e)){return _0x2b688d(msgResponse('[abandonmentRate]','Error',_0xf402('0x21c')+_0x13563e));}if(_0x59a345<=0x0||isNaN(_0x59a345)){return _0x2b688d(msgResponse('[abandonmentRate]',_0xf402('0x45'),_0xf402('0x21d')+_0x59a345));}if(_0x5cc471<=0x0||isNaN(_0x5cc471)){return _0x2b688d(msgResponse(_0xf402('0x21a'),'Error',_0xf402('0x21e')+_0x5cc471));}_0x110725=_0x110725||0x0;var _0xe2eebd=0x1/_0x42285a;var _0x48cdf0=0x0;var _0x4fbe2e=0x0;var _0x37b53a=0x0;var _0x454aec=0x0;for(var _0x2710eb=0x0;_0x37b53a<_0x5cc471;_0x2710eb+=0x1){_0x4fbe2e=_0x2710eb/_0x59a345;_0x48cdf0=(_0x13563e*_0x4fbe2e+_0x110725)/_0xe2eebd;_0x37b53a=erlangb(_0x48cdf0,_0x267dcc);_0x454aec=_0x48cdf0/_0x267dcc*(0x1-erlangb(_0x48cdf0,_0x267dcc));}return _0x51d9f3({'erlangCalls':_0x2710eb,'erlangCallToSecond':_0x59a345/_0x2710eb,'erlangAbandonmentRate':_0x37b53a,'erlangBusyFactor':_0x454aec});});};Dialer[_0xf402('0x15')]['busyFactor']=function(_0x395097,_0x5e9017,_0x422824,_0x3e0da6,_0x2a7bdf,_0x32ce6d){loggerPredictive[_0xf402('0x7c')](_0xf402('0x21f'));loggerPredictive[_0xf402('0x7c')](_0xf402('0x216'),_0x395097);loggerPredictive[_0xf402('0x7c')](_0xf402('0x217'),_0x5e9017);loggerPredictive['info'](_0xf402('0x220'),_0x422824);loggerPredictive[_0xf402('0x7c')](_0xf402('0x218'),_0x3e0da6);loggerPredictive[_0xf402('0x7c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2a7bdf);loggerPredictive[_0xf402('0x7c')](_0xf402('0x8a'));return new BPromise(function(_0xf8e00c,_0x35b14b){if(_0x395097<=0x0||isNaN(_0x395097)){return _0x35b14b(msgResponse(_0xf402('0x221'),_0xf402('0x45'),'m\x20=\x20'+_0x395097));}if(_0x422824<=0x0||isNaN(_0x422824)){return _0x35b14b(msgResponse(_0xf402('0x221'),_0xf402('0x45'),'Ts\x20=\x20'+_0x422824));}if(_0x3e0da6<=0x0||isNaN(_0x3e0da6)){return _0x35b14b(msgResponse(_0xf402('0x221'),_0xf402('0x45'),_0xf402('0x21c')+_0x3e0da6));}if(_0x5e9017<=0x0||isNaN(_0x5e9017)){return _0x35b14b(msgResponse(_0xf402('0x221'),_0xf402('0x45'),_0xf402('0x21d')+_0x5e9017));}if(_0x2a7bdf<=0x0||isNaN(_0x2a7bdf)){return _0x35b14b(msgResponse(_0xf402('0x221'),_0xf402('0x45'),_0xf402('0x222')+_0x2a7bdf));}_0x32ce6d=_0x32ce6d||0x0;var _0x54f139=0x1/_0x422824;var _0x442016=0x0;var _0x5632c3=0x0;var _0x3551b5=0x0;var _0x2216e3=0x0;for(var _0x11508b=0x0;_0x2216e3<_0x2a7bdf;_0x11508b+=0x1){_0x5632c3=_0x11508b/_0x5e9017;_0x442016=(_0x3e0da6*_0x5632c3+_0x32ce6d)/_0x54f139;_0x3551b5=erlangb(_0x442016,_0x395097);_0x2216e3=_0x442016/_0x395097*(0x1-erlangb(_0x442016,_0x395097));}return _0xf8e00c({'erlangCalls':_0x11508b,'erlangCallToSecond':_0x5e9017/_0x11508b,'erlangAbandonmentRate':_0x3551b5,'erlangBusyFactor':_0x2216e3});});};module[_0xf402('0x223')]=Dialer; \ No newline at end of file +var _0x2cbd=['merge','clearing\x20variable\x20start\x20progressive','handlePredictive','outbound','string','format','\x22%s\x22\x20<%s>','inspect','error','stack','length','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','available','debug','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','prototype','[uniqueid]','clearZombieChannels','[actions]','undefined','isNil','status','channel','catch','No\x20such\x20channel','queue','updateOriginated','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','active','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','state','HangupInAMD','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD]','Machine','membername','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','dialGlobalMaxRetry','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AGI','cause-txt','Unknow','[syncHangupIvr]','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','voiceQueue','dialDropMaxRetry','additional','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','countglobal','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','content','true','indexOf','all','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','checkDialMethod','[syncQueueSummary]','throttle','filter','online','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','dialTimezone','\x5cw{0,','pow','replace','match','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','%s%s','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','getVoiceQueueRtPauses','[CatchErlangB]','outboundQueuePauses','one\x20call\x20every:','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','getContactDialerIvr','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','ACTIVE','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','util','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/setting','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\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','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------'];(function(_0x54476d,_0x2dbfca){var _0x500a46=function(_0x4c18c4){while(--_0x4c18c4){_0x54476d['push'](_0x54476d['shift']());}};_0x500a46(++_0x2dbfca);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0x2cbd[_0x575b72];return _0x561c57;};'use strict';var util=require(_0xd2cb('0x0'));var _=require(_0xd2cb('0x1'));var BPromise=require('bluebird');var uuid=require(_0xd2cb('0x2'));var moment=require(_0xd2cb('0x3'));var rr=require('rr');var md5=require(_0xd2cb('0x4'));var Redis=require('ioredis');var ut=require(_0xd2cb('0x5'));var config=require(_0xd2cb('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0xd2cb('0x7'))(_0xd2cb('0x8'));var loggerPredictive=require(_0xd2cb('0x7'))(_0xd2cb('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xd2cb('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xd2cb('0xb'));var ami=require('../ami');config[_0xd2cb('0xc')]=_[_0xd2cb('0xd')](config['redis'],{'host':_0xd2cb('0xe'),'port':0x18eb});var io=require(_0xd2cb('0xf'))(new Redis(config['redis']));var cmHopper=require(_0xd2cb('0x10'));var cmHopperHistory=require(_0xd2cb('0x11'));var cmHopperFinal=require(_0xd2cb('0x12'));var cmHopperAdditionalPhone=require(_0xd2cb('0x13'));var cmHopperBlack=require(_0xd2cb('0x14'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xd2cb('0x15'));var Action=require(_0xd2cb('0x16'));var History=require(_0xd2cb('0x17'));var Final=require(_0xd2cb('0x18'));var AgentComplete=require(_0xd2cb('0x19'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xd2cb('0x1a'));var ipAgi=process[_0xd2cb('0x1b')][_0xd2cb('0x1c')]||'127.0.0.1';var strategy={'rrmemory':_0xd2cb('0x1d'),'roundrobin':_0xd2cb('0x1e')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xd2cb('0x1f')]=function(_0x4ef741){this['tail']=this[_0xd2cb('0x20')]?this[_0xd2cb('0x20')][_0xd2cb('0x21')](_0x4ef741):_0x4ef741();};function Dialer(_0x3cb143,_0x498e27){this['sequence']=new Sequence();this[_0xd2cb('0x22')]=_0x498e27;this[_0xd2cb('0x23')]=_0x3cb143['voiceQueues'];this[_0xd2cb('0x24')]=_0x3cb143[_0xd2cb('0x24')];this[_0xd2cb('0x25')]=_0x3cb143['agents'];this[_0xd2cb('0x26')]=_0x3cb143['trunks'];this['maxNumberOriginate']=config[_0xd2cb('0x27')]||0x2;this[_0xd2cb('0x28')]={};this[_0xd2cb('0x29')]={};this['contactsId']={};this[_0xd2cb('0x2a')]={};this[_0xd2cb('0x2b')]={};this[_0xd2cb('0x2c')]={};this[_0xd2cb('0x2d')]={};this[_0xd2cb('0x2e')]={};this[_0xd2cb('0x2f')]={};this[_0xd2cb('0x30')]={};ami['on'](_0xd2cb('0x31'),this['syncAgentConnect'][_0xd2cb('0x32')](this));ami['on'](_0xd2cb('0x33'),this['syncQueueCallerAbandon'][_0xd2cb('0x32')](this));ami['on'](_0xd2cb('0x34'),this[_0xd2cb('0x35')][_0xd2cb('0x32')](this));ami['on'](_0xd2cb('0x36'),this[_0xd2cb('0x37')]['bind'](this));ami['on'](_0xd2cb('0x38'),this['syncQueueSummary']['bind'](this));ami['on']('custom:queuesummarycomplete',this[_0xd2cb('0x39')][_0xd2cb('0x32')](this));ami['on'](_0xd2cb('0x3a'),this[_0xd2cb('0x3b')]['bind'](this));ami['on'](_0xd2cb('0x3c'),this[_0xd2cb('0x3d')][_0xd2cb('0x32')](this));ami['on'](_0xd2cb('0x3e'),this[_0xd2cb('0x3f')][_0xd2cb('0x32')](this));ami['on'](_0xd2cb('0x40'),this[_0xd2cb('0x41')][_0xd2cb('0x32')](this));ami['on'](_0xd2cb('0x42'),this['syncQueueStatusComplete'][_0xd2cb('0x32')](this));this[_0xd2cb('0x43')]();this['loopClearZombieChannels']();RpcSetting[_0xd2cb('0x44')]()[_0xd2cb('0x45')](function(_0x42ee93){previewRecallmeReminderInterval=_0x42ee93[_0xd2cb('0x46')];});}function isNotNull(_0x5404fb){return _0x5404fb!==null&&!_['isUndefined'](_0x5404fb);}function checkIsLoggedIn(_0x39d1de,_0x422597){return function(){if(_0x422597<=0x0){_0x39d1de[_0xd2cb('0x47')]=_0xd2cb('0x48');throw _0x39d1de[_0xd2cb('0x49')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x262453){return _0x262453;}function checkIsActive(_0x22c42b,_0x64b92){return function(){if(!isActive(_0x64b92)){_0x22c42b[_0xd2cb('0x47')]=_0xd2cb('0x4a');throw _0x22c42b[_0xd2cb('0x49')]+_0xd2cb('0x4b');}};}function checkInterval(_0x140933){return function(){if(!isNotNull(_0x140933['Interval'])){_0x140933[_0xd2cb('0x47')]='INTERVAL_IS_NULL';throw _0x140933[_0xd2cb('0x49')]+_0xd2cb('0x4c');}if(!isNotNull(_0x140933[_0xd2cb('0x4d')][_0xd2cb('0x4e')])){_0x140933[_0xd2cb('0x47')]=_0xd2cb('0x4f');throw _0x140933[_0xd2cb('0x49')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xd2cb('0x50')](_0x140933['Interval']['Intervals']))){_0x140933[_0xd2cb('0x47')]=_0xd2cb('0x4f');throw _0x140933[_0xd2cb('0x49')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x1525b1,_0x4c1d4f,_0x3e4a4f){return{'action':_0x1525b1,'response':_0x4c1d4f,'message':_0x3e4a4f,'stack':_0x3e4a4f};}function myreject(_0x4fa8c5){return function(_0x4b5361){return _0x4fa8c5(msgResponse(_0xd2cb('0x51'),_0xd2cb('0x52'),JSON[_0xd2cb('0x53')](_0x4b5361)));};}function getSeconds(_0x2a309f,_0x9d797e){var _0xe19fda=moment(_0x2a309f)[_0xd2cb('0x54')](0x0);var _0x568a80=moment(_0x9d797e)['milliseconds'](0x0);return _0xe19fda[_0xd2cb('0x55')](_0x568a80,_0xd2cb('0x56'));}function emit(_0x1e1bf0,_0x109fce,_0x3d6077){io['to'](_0x1e1bf0)['emit'](_0x109fce,_0x3d6077);}function emitVoiceQueueSummary(_0x2cdc18){if(_0x2cdc18['type']==='outbound'){var _0x35cf38={'id':_0x2cdc18['id'],'name':_0x2cdc18['name'],'strategy':_0x2cdc18[_0xd2cb('0x57')],'answered':_0x2cdc18[_0xd2cb('0x58')],'available':_0x2cdc18['available'],'loggedIn':_0x2cdc18[_0xd2cb('0x59')],'pTalking':_0x2cdc18[_0xd2cb('0x5a')],'sumBillable':_0x2cdc18[_0xd2cb('0x5b')],'sumDuration':_0x2cdc18[_0xd2cb('0x5c')],'sumHoldTime':_0x2cdc18[_0xd2cb('0x5d')]||0x0,'talking':_0x2cdc18['talking'],'total':_0x2cdc18[_0xd2cb('0x5e')],'type':_0x2cdc18[_0xd2cb('0x5f')],'unmanaged':_0x2cdc18[_0xd2cb('0x60')],'abandoned':_0x2cdc18[_0xd2cb('0x61')],'waiting':_0x2cdc18[_0xd2cb('0x62')],'loggedInDb':_0x2cdc18[_0xd2cb('0x63')],'dialActive':_0x2cdc18[_0xd2cb('0x64')],'dialMethod':_0x2cdc18[_0xd2cb('0x65')],'dialOriginateCallerIdName':_0x2cdc18['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2cdc18[_0xd2cb('0x66')],'dialOriginateTimeout':_0x2cdc18[_0xd2cb('0x67')],'dialPrefix':_0x2cdc18[_0xd2cb('0x68')],'outboundAnswerAgiCallsDay':_0x2cdc18[_0xd2cb('0x69')],'outboundAnswerCallsDay':_0x2cdc18[_0xd2cb('0x6a')],'outboundBlacklistCallsDay':_0x2cdc18[_0xd2cb('0x6b')],'outboundBusyCallsDay':_0x2cdc18[_0xd2cb('0x6c')],'outboundCongestionCallsDay':_0x2cdc18[_0xd2cb('0x6d')],'outboundDropCallsDayACS':_0x2cdc18[_0xd2cb('0x6e')],'outboundDropCallsDayCallersExit':_0x2cdc18['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2cdc18[_0xd2cb('0x6f')],'outboundNoAnswerCallsDay':_0x2cdc18[_0xd2cb('0x70')],'outboundNoSuchCallsDay':_0x2cdc18[_0xd2cb('0x71')],'outboundOriginateFailureCallsDay':_0x2cdc18[_0xd2cb('0x72')],'outboundReCallsDay':_0x2cdc18[_0xd2cb('0x73')],'outboundRejectCallsDay':_0x2cdc18['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2cdc18[_0xd2cb('0x74')],'predictiveIntervalAnsweredCalls':_0x2cdc18[_0xd2cb('0x75')],'predictiveIntervalAvgHoldtime':_0x2cdc18[_0xd2cb('0x76')],'predictiveIntervalAvgTalktime':_0x2cdc18[_0xd2cb('0x77')],'predictiveIntervalDroppedCallsCallersExit':_0x2cdc18['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2cdc18[_0xd2cb('0x78')],'predictiveIntervalErlangCalls':_0x2cdc18[_0xd2cb('0x79')],'predictiveIntervalErlangCallsDroppedCalls':_0x2cdc18[_0xd2cb('0x7a')],'predictiveIntervalHitRate':_0x2cdc18['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2cdc18[_0xd2cb('0x7b')],'predictiveIntervalPauses':_0x2cdc18[_0xd2cb('0x7c')],'predictiveIntervalAvailable':_0x2cdc18[_0xd2cb('0x7d')],'predictiveIntervalTotalCalls':_0x2cdc18[_0xd2cb('0x7e')],'message':_0x2cdc18[_0xd2cb('0x47')],'originated':_0x2cdc18['originated'],'erlangCalls':_0x2cdc18[_0xd2cb('0x7f')],'erlangCallToSecond':_0x2cdc18[_0xd2cb('0x80')],'erlangAbandonmentRate':_0x2cdc18['erlangAbandonmentRate'],'erlangBusyFactor':_0x2cdc18[_0xd2cb('0x81')],'startPredictive':_0x2cdc18['startPredictive'],'startProgressive':_0x2cdc18[_0xd2cb('0x2d')]};if(_0x2cdc18[_0xd2cb('0x82')]){_0x35cf38[_0xd2cb('0x82')]={'id':_0x2cdc18[_0xd2cb('0x82')]['id'],'name':_0x2cdc18[_0xd2cb('0x82')][_0xd2cb('0x49')],'active':_0x2cdc18[_0xd2cb('0x82')]['active'],'callerid':_0x2cdc18['Trunk']['callerid']};}if(_0x2cdc18['Interval']){_0x35cf38[_0xd2cb('0x4d')]={'id':_0x2cdc18['Interval']['id'],'name':_0x2cdc18[_0xd2cb('0x4d')]['name']};}var _0x22d1e6=md5(JSON[_0xd2cb('0x53')](_0x35cf38));if(_0x2cdc18[_0xd2cb('0x4')]!==_0x22d1e6){_0x2cdc18[_0xd2cb('0x4')]=_0x22d1e6;emit(util['format']('voice:queue:%s',_0x35cf38[_0xd2cb('0x49')]),_0xd2cb('0x83'),_0x35cf38);}}}function emitCampaignSummary(_0x4aa08e){if(_0x4aa08e['type']===_0xd2cb('0x84')){emit(util['format']('campaign:ivr:%s',_0x4aa08e['name']),_0xd2cb('0x85'),_0x4aa08e);}}function checkGetDataPredictive(_0x2956f5){if(isNotNull(_0x2956f5)&&!_[_0xd2cb('0x50')](_0x2956f5)){loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x87'));loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x88'),_0x2956f5[_0xd2cb('0x7e')]);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x89'),_0x2956f5[_0xd2cb('0x75')]);loggerPredictive[_0xd2cb('0x86')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2956f5[_0xd2cb('0x78')]);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x8a'),_0x2956f5[_0xd2cb('0x8b')]);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x8c'),_0x2956f5[_0xd2cb('0x76')]);loggerPredictive['info'](_0xd2cb('0x8d'),_0x2956f5[_0xd2cb('0x77')]);loggerPredictive[_0xd2cb('0x86')]('---------------------------');if(_0x2956f5['predictiveIntervalTotalCalls']>0x0){if(!_[_0xd2cb('0x8e')](_0x2956f5[_0xd2cb('0x77')])&&_0x2956f5[_0xd2cb('0x77')]>0x0){return!![];}loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x8f'));if(!_[_0xd2cb('0x8e')](_0x2956f5['predictiveIntervalAvgHoldtime'])&&_0x2956f5['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x90'));}else{loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x91'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1cce90){return function(_0x58eff4){loggerPredictive[_0xd2cb('0x86')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x92'),_0x58eff4[_0xd2cb('0x7f')]);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x93'),_0x58eff4[_0xd2cb('0x80')]);loggerPredictive['info'](_0xd2cb('0x94'),_0x58eff4[_0xd2cb('0x95')]);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x96'),_0x58eff4['erlangBusyFactor']);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x94'),_0x58eff4['erlangAbandonmentRate']);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x97'));_[_0xd2cb('0x98')](_0x1cce90,_0x58eff4);};}function getDiff(_0x1266e6){var _0x110d1d=moment()[_0xd2cb('0x54')](0x0);var _0x4232c1=moment(_0x1266e6)[_0xd2cb('0x54')](0x0);return _0x110d1d['diff'](_0x4232c1,_0xd2cb('0x56'));}function ifInterval(_0x1e8fe9,_0x5f273c){if(_[_0xd2cb('0x8e')](_0x5f273c)){return![];}return getDiff(_0x5f273c)<_0x1e8fe9*0x3c;}function freeVariablesPredictive(_0x3f292f){if(isNotNull(_0x3f292f)){if(!_[_0xd2cb('0x8e')](_0x3f292f[_0xd2cb('0x2d')])){_0x3f292f[_0xd2cb('0x2d')]=undefined;loggerPredictive[_0xd2cb('0x86')](_0x3f292f[_0xd2cb('0x49')],_0xd2cb('0x99'));}if(!_[_0xd2cb('0x8e')](_0x3f292f['startPredictive'])){_0x3f292f[_0xd2cb('0x2c')]=undefined;loggerPredictive['info'](_0x3f292f[_0xd2cb('0x49')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xd2cb('0x8e')](_0x3f292f[_0xd2cb('0x9a')])){clearInterval(_0x3f292f[_0xd2cb('0x9a')]);_0x3f292f[_0xd2cb('0x9a')]=undefined;loggerPredictive[_0xd2cb('0x86')](_0x3f292f[_0xd2cb('0x49')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0xac0d99,_0x5046f8){if(_0x5046f8===0x0){return 0x0;}var _0x8090d3=0x1;for(var _0x3b3e23=0x1;_0x3b3e23<=_0x5046f8;_0x3b3e23+=0x1){_0x8090d3=0x1+_0x8090d3*_0x3b3e23/_0xac0d99;}return 0x1/_0x8090d3;}function isVoiceQueueOutbound(_0x3d597a){return _0x3d597a===_0xd2cb('0x9b');}function isNotPreview(_0x44d302){return _0x44d302!=='preview';}function isCampaignIvr(_0x24812c){return _0x24812c===_0xd2cb('0x84');}function getCallerId(_0x35c7df,_0xce3c86,_0x77a13a){if(!_[_0xd2cb('0x8e')](_0x77a13a)&&typeof _0x77a13a===_0xd2cb('0x9c')&&!_[_0xd2cb('0x50')](_0x77a13a)){if(!_[_0xd2cb('0x8e')](_0xce3c86)&&typeof _0xce3c86==='string'&&!_[_0xd2cb('0x50')](_0xce3c86)){return util[_0xd2cb('0x9d')](_0xd2cb('0x9e'),_0xce3c86,_0x77a13a);}return util['format']('\x22%s\x22\x20<%s>',_0x77a13a,_0x77a13a);}if(!_[_0xd2cb('0x8e')](_0x35c7df)&&typeof _0x35c7df==='string'&&!_['isEmpty'](_0x35c7df)){return _0x35c7df;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x559472,_0x16ca9e){return function(_0x38033e){freeVariablesPredictive(_0x16ca9e);emitVoiceQueueSummary(_0x16ca9e);emitCampaignSummary(_0x16ca9e);loggerSyncQueueSummary['debug'](_0x559472,util[_0xd2cb('0x9f')](_0x38033e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3800d0,_0x592e1c){return function(_0x518661){loggerPredictive[_0xd2cb('0xa0')](_0x592e1c[_0xd2cb('0x49')],_0x3800d0);loggerPredictive['error'](_0x518661[_0xd2cb('0xa1')]);freeVariablesPredictive(_0x592e1c);};}function loggerCatch(_0x5b062c){return function(_0x4c543d){logger[_0xd2cb('0xa0')](_0x5b062c,util[_0xd2cb('0x9f')](_0x4c543d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5f4ce3){return _0x5f4ce3&&!_[_0xd2cb('0x8e')](_0x5f4ce3)&&_0x5f4ce3[_0xd2cb('0xa2')]>0x0;}function decremetOriginate(_0x22ceb8){if(!_['isUndefined'](_0x22ceb8)&&_0x22ceb8!==null){if(typeof _0x22ceb8[_0xd2cb('0xa3')]!=='undefined'){if(_0x22ceb8[_0xd2cb('0xa3')]>0x0){_0x22ceb8[_0xd2cb('0xa3')]-=0x1;}else{logger[_0xd2cb('0xa0')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xd2cb('0xa0')](_0xd2cb('0xa4'));}}function checkContactLowerLimitOriginate(_0x89832a,_0x582702,_0x44c8b8){if(_0x582702>_0x44c8b8){for(var _0x17ecf3=0x0;_0x17ecf3<_0x582702-_0x44c8b8;_0x17ecf3+=0x1){decremetOriginate(_0x89832a);}}}function loggerGetContactDialer(_0x1c554d,_0x11628a,_0xdb05c4){return function(_0x108d10){checkContactLowerLimitOriginate(_0x11628a,_0xdb05c4,0x0);logger[_0xd2cb('0xa0')](_0x1c554d,util['inspect'](_0x108d10,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1be24b){return function(_0x2be5a4){if(isNotNull(_0x2be5a4)&&isNotNull(_0x2be5a4[0x0])){if(_0x2be5a4[0x0][_0xd2cb('0xa5')]>0x0){_0x1be24b[_0xd2cb('0x47')]=_0xd2cb('0xa6');logger['info'](_0xd2cb('0xa7')+_0x1be24b[_0xd2cb('0x49')],_0x2be5a4[0x0][_0xd2cb('0xa5')],_0xd2cb('0xa8'));}else{_0x1be24b[_0xd2cb('0x47')]=_0xd2cb('0xa9');logger[_0xd2cb('0x86')](_0xd2cb('0xaa')+_0x1be24b[_0xd2cb('0x49')]);}}};}function notSendMessagesQueue(_0x205b5b){if(_0x205b5b[_0xd2cb('0xab')]){freeVariablesPredictive(_0x205b5b);if(_0x205b5b[_0xd2cb('0xa3')]===0x0&&_0x205b5b[_0xd2cb('0xac')]===0x0&&_0x205b5b[_0xd2cb('0x62')]===0x0&&(_0x205b5b['pTalking']||0x0)===0x0){_0x205b5b['sendMessageOneNotActive']=![];_0x205b5b[_0xd2cb('0xad')]=0x0;_0x205b5b['message']=_0xd2cb('0x4a');loggerSyncQueueSummary[_0xd2cb('0xae')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x205b5b[_0xd2cb('0x49')],_0xd2cb('0xaf'));}else{_0x205b5b[_0xd2cb('0x47')]=_0xd2cb('0xb0');loggerSyncQueueSummary[_0xd2cb('0xae')](_0xd2cb('0xb1'),_0x205b5b[_0xd2cb('0x49')],_0xd2cb('0xb2'));}emitVoiceQueueSummary(_0x205b5b);}}function notSendMessagesCampaign(_0x3caa39){if(_0x3caa39[_0xd2cb('0xab')]){if(_0x3caa39[_0xd2cb('0xa3')]===0x0){_0x3caa39['sendMessageOneNotActive']=![];_0x3caa39['message']='NOT_ACTIVE';loggerSyncQueueSummary['debug'](_0xd2cb('0xb3'),_0x3caa39[_0xd2cb('0x49')],'is\x20not\x20active');}else{_0x3caa39['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0xd2cb('0xae')](_0xd2cb('0xb3'),_0x3caa39[_0xd2cb('0x49')],_0xd2cb('0xb2'));}emitCampaignSummary(_0x3caa39);}}function createObjHistory(_0x5881d0,_0x30dece,_0x16a08a,_0xc1b1a8,_0x81804f){_0x5881d0[_0xd2cb('0x47')]=_0x16a08a;var _0x4579b9=new Action(_0x5881d0,_0x30dece);var _0x5480bd=new History(_0x4579b9);_0x5480bd['state']=_0xc1b1a8;_0x5480bd[_0xd2cb('0xb4')]=_0x81804f;_0x5480bd[_0xd2cb('0xb5')]=_0x4579b9[_0xd2cb('0xb6')];return _0x5480bd;}Dialer[_0xd2cb('0xb7')]['loopClearZombieChannels']=function(){var _0x569b2d=this;setInterval(function(){_0x569b2d['clearZombieChannels'](_0x569b2d[_0xd2cb('0x2a')],_0xd2cb('0xb8'));_0x569b2d[_0xd2cb('0xb9')](_0x569b2d['actions'],_0xd2cb('0xba'));},0x32c8);};Dialer[_0xd2cb('0xb7')]['clearZombieChannels']=function(_0x44c5d9,_0x5cbfff){var _0x53c2ed=this;for(var _0x9e5f55 in _0x44c5d9){if(typeof _0x44c5d9[_0x9e5f55]!==_0xd2cb('0xbb')){this['sequence'][_0xd2cb('0x1f')](function(){if(!_[_0xd2cb('0xbc')](_0x44c5d9[_0x9e5f55])){return ami['Action']({'action':_0xd2cb('0xbd'),'channel':_0x44c5d9[_0x9e5f55][_0xd2cb('0xbe')]})[_0xd2cb('0xbf')](function(_0x33bd45){if(_0x33bd45[_0xd2cb('0x47')]===_0xd2cb('0xc0')){setTimeout(function(){if(_0x44c5d9[_0x9e5f55]&&_0x44c5d9[_0x9e5f55]['type']!==_0xd2cb('0x84')){_0x53c2ed['updateOriginated'](_0x53c2ed[_0xd2cb('0x23')][_0x44c5d9[_0x9e5f55][_0xd2cb('0xc1')]]);logger['error']('[Dialer][checkChannel]',_0x5cbfff,_0x9e5f55,_0x44c5d9[_0x9e5f55][_0xd2cb('0xc1')]);delete _0x44c5d9[_0x9e5f55];}if(_0x44c5d9[_0x9e5f55]&&_0x44c5d9[_0x9e5f55][_0xd2cb('0x5f')]==='ivr'){_0x53c2ed[_0xd2cb('0xc2')](_0x53c2ed['campaigns'][_0x44c5d9[_0x9e5f55]['queue']]);logger['error']('[Dialer][checkChannel][ivr]',_0x5cbfff,_0x9e5f55,_0x44c5d9[_0x9e5f55][_0xd2cb('0xc1')]);delete _0x44c5d9[_0x9e5f55];}},0x2328);}});}});}}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xc3')]=function(_0x2dc9d4){return BPromise[_0xd2cb('0xc4')]()[_0xd2cb('0x45')](cmHopper['countReScheduled'](_0x2dc9d4))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0xc5')));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xc6')]=function(_0x5d7576){return BPromise['resolve']()[_0xd2cb('0x45')](cmHopperBlack['checkIsBlackList'](_0x5d7576))['catch'](loggerCatch(_0xd2cb('0xc7')));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xc8')]=function(_0x2c98f5,_0x127166,_0x3d30af){return BPromise[_0xd2cb('0xc4')]()[_0xd2cb('0x45')](cmHopperAdditionalPhone[_0xd2cb('0xc8')](_0x2c98f5,_0x127166,_0x3d30af))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0xc9')));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xca')]=function(_0x58ef9e,_0x192627,_0x24c090){return BPromise[_0xd2cb('0xc4')]()['then'](cmHopperAdditionalPhone[_0xd2cb('0xca')](_0x58ef9e,_0x192627,_0x24c090))['catch'](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xcb')]=function(_0x2c8799){return BPromise[_0xd2cb('0xc4')]()[_0xd2cb('0x45')](cmHopperBlack[_0xd2cb('0xcb')](_0x2c8799))['catch'](loggerCatch(_0xd2cb('0xcc')));};Dialer['prototype'][_0xd2cb('0xcd')]=function(_0xe9dacc){return BPromise[_0xd2cb('0xc4')]()[_0xd2cb('0x45')](cmHopperHistory[_0xd2cb('0xce')](_0xe9dacc))[_0xd2cb('0xbf')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xd2cb('0xcf')]=function(_0x15a25e){return BPromise[_0xd2cb('0xc4')]()['then'](cmHopper[_0xd2cb('0xcf')](_0x15a25e))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0xd0')));};Dialer['prototype'][_0xd2cb('0xd1')]=function(_0x5ed830,_0x38e7ad,_0x5acea2){return BPromise[_0xd2cb('0xc4')]()['then'](cmHopper['unlockContact'](_0x5ed830,_0x38e7ad,_0x5acea2))['catch'](loggerCatch(_0xd2cb('0xd2')));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xd3')]=function(_0x39d0b1,_0xc884a9,_0x9b37ab,_0x4ed169,_0x3dceca){return BPromise[_0xd2cb('0xc4')]()[_0xd2cb('0x45')](cmHopper[_0xd2cb('0xd3')](_0x39d0b1,_0xc884a9,_0x9b37ab,_0x4ed169))[_0xd2cb('0xbf')](function(_0x2a62c1){_0x3dceca[_0xd2cb('0xd4')]-=_0x9b37ab;_0x3dceca['temp']=_0x3dceca[_0xd2cb('0xd4')]>0x0?_0x3dceca[_0xd2cb('0xd4')]:0x0;loggerCatch(_0xd2cb('0xd5'))(_0x2a62c1);});};Dialer[_0xd2cb('0xb7')]['getContactDialerIvr']=function(_0x51b75c,_0x5c8a36,_0x5f4c9d,_0xe12f3){return BPromise[_0xd2cb('0xc4')]()['then'](cmHopper['getContactDialerIvr'](_0x51b75c,_0x5c8a36,_0x5f4c9d))[_0xd2cb('0xbf')](function(_0x4d5cc3){_0xe12f3[_0xd2cb('0xd4')]-=_0x5c8a36;_0xe12f3[_0xd2cb('0xd4')]=_0xe12f3[_0xd2cb('0xd4')]>0x0?_0xe12f3[_0xd2cb('0xd4')]:0x0;loggerCatch(_0xd2cb('0xd6'))(_0x4d5cc3);});};Dialer[_0xd2cb('0xb7')]['getVoiceQueueRtPauses']=function(_0x4e280e){return BPromise[_0xd2cb('0xc4')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x4e280e))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0xd7')));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xd8')]=function(_0x450601){return BPromise[_0xd2cb('0xc4')]()[_0xd2cb('0x45')](cmHopper['moveContactManagedDialer'](_0x450601))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xd9')]=function(_0x245de1){return BPromise['resolve']()['then'](cmHopperHistory[_0xd2cb('0xd9')](_0x245de1))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0xda')));};Dialer[_0xd2cb('0xb7')]['updateOriginated']=function(_0x3e1020){if(!_['isUndefined'](_0x3e1020)&&_0x3e1020!==null){if(typeof _0x3e1020[_0xd2cb('0xa3')]!==_0xd2cb('0xbb')){if(_0x3e1020[_0xd2cb('0xa3')]>0x0){_0x3e1020['originated']-=0x1;}else{logger[_0xd2cb('0xa0')](_0xd2cb('0xdb'));}}}else{logger['error'](_0xd2cb('0xdc'));}};Dialer['prototype'][_0xd2cb('0xdd')]=function(_0x1b5eb8,_0x4da75d){var _0x574c2a=this;return function(_0x3d3df3){_0x574c2a[_0xd2cb('0xc2')](_0x4da75d);logger[_0xd2cb('0xa0')](_0x1b5eb8,util['inspect'](_0x3d3df3,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xd2cb('0xde')]=function(_0x1b38ad,_0x5901fc,_0x25a573){var _0x10bf75={'state':0x19,'statedesc':_0xd2cb('0xdf')};this[_0xd2cb('0xc2')](_0x5901fc);this[_0xd2cb('0xe0')](_['merge'](_0x10bf75,_[_0xd2cb('0xe1')](_0x25a573,[_0xd2cb('0xe2'),_0xd2cb('0xe3'),'UserId',_0xd2cb('0xe4'),'CampaignId'])),_0xd2cb('0xe5'),_0xd2cb('0xe6'));logger['error'](_0x1b38ad);};Dialer[_0xd2cb('0xb7')]['isSuccess']=function(_0x349c8){return _0x349c8===_0xd2cb('0xe7');};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xe8')]=function(_0x2a8006){return!_[_0xd2cb('0x8e')](_0x2a8006)&&_0x2a8006&&!_['isUndefined'](_0x2a8006[_0xd2cb('0x49')])&&!_[_0xd2cb('0x8e')](_0x2a8006[_0xd2cb('0xe9')])&&_0x2a8006[_0xd2cb('0xe9')]&&(this[_0xd2cb('0x26')][util[_0xd2cb('0x9d')]('SIP/%s',_0x2a8006[_0xd2cb('0x49')])][_0xd2cb('0xbd')]===_0xd2cb('0xea')||this[_0xd2cb('0x26')][util[_0xd2cb('0x9d')](_0xd2cb('0xeb'),_0x2a8006[_0xd2cb('0x49')])][_0xd2cb('0xbd')]===_0xd2cb('0xec'));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0xe0')]=function(_0x239d76,_0x599cb8,_0x37b48e){this['createHistory'](_0x239d76)[_0xd2cb('0xbf')](loggerCatch(_0x599cb8));this[_0xd2cb('0xd8')](_0x239d76)[_0xd2cb('0xbf')](loggerCatch(_0x37b48e));};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x3f')]=function(_0x5d7b39){var _0xb1c412=this['uniqueId'][_0x5d7b39[_0xd2cb('0xed')]];var _0x2c1a06;if(!_[_0xd2cb('0xbc')](_0x5d7b39)&&!_[_0xd2cb('0xbc')](_0x5d7b39[_0xd2cb('0xee')])&&!_['isNil'](_0x5d7b39['variable'][_0xd2cb('0xef')])&&_0x5d7b39[_0xd2cb('0xf0')]===_0xd2cb('0xf1')&&_0xb1c412){if(_0xb1c412[_0xd2cb('0x5f')]!==_0xd2cb('0x84')&&this[_0xd2cb('0x23')][_0xb1c412[_0xd2cb('0xc1')]][_0xd2cb('0xf2')]&&_0x5d7b39[_0xd2cb('0xf3')]===_0xd2cb('0xf4')){delete this[_0xd2cb('0x2a')][_0x5d7b39[_0xd2cb('0xed')]];this[_0xd2cb('0xc2')](this[_0xd2cb('0x23')][_0xb1c412[_0xd2cb('0xc1')]]);this['voiceQueues'][_0xb1c412[_0xd2cb('0xc1')]][_0xd2cb('0x6a')]+=0x1;this[_0xd2cb('0x23')][_0xb1c412[_0xd2cb('0xc1')]][_0xd2cb('0x69')]+=0x1;_0x2c1a06=new Hangup(_0xb1c412,_0x5d7b39);_0x2c1a06[_0xd2cb('0xf5')]=0x12;_0x2c1a06[_0xd2cb('0xb4')]=_0xd2cb('0xf6');_0x2c1a06['membername']=_0xd2cb('0xf7');ami[_0xd2cb('0xf8')](_0xd2cb('0xf9'),ut[_0xd2cb('0xfa')](_0x2c1a06,_0xd2cb('0xfb')));this[_0xd2cb('0xe0')](_0x2c1a06,'[syncHangupInAMD][createHistory]',_0xd2cb('0xfc'));}if(_0xb1c412[_0xd2cb('0x5f')]!==_0xd2cb('0x84')&&this['voiceQueues'][_0xb1c412['queue']]['dialAMDActive']&&_0x5d7b39[_0xd2cb('0xf3')]==='MACHINE'){var _0x1f810c=this;return new BPromise(function(_0x39e614,_0x50255a){delete _0x1f810c['uniqueId'][_0x5d7b39[_0xd2cb('0xed')]];_0x1f810c[_0xd2cb('0xc2')](_0x1f810c[_0xd2cb('0x23')][_0xb1c412['queue']]);_0x1f810c[_0xd2cb('0x23')][_0xb1c412[_0xd2cb('0xc1')]][_0xd2cb('0x6a')]+=0x1;_0x1f810c[_0xd2cb('0x23')][_0xb1c412[_0xd2cb('0xc1')]][_0xd2cb('0x69')]+=0x1;var _0x25c847=_0x1f810c[_0xd2cb('0x23')][_0xb1c412[_0xd2cb('0xc1')]];var _0x556a02=new Hangup(_0xb1c412,_0x5d7b39);_0x556a02[_0xd2cb('0xf5')]=0x13;_0x556a02[_0xd2cb('0xb4')]=_0xd2cb('0xfd');_0x556a02[_0xd2cb('0xfe')]='AMD';_0x556a02[_0xd2cb('0xff')]+=0x1;_0x556a02['countglobal']+=0x1;_0x556a02[_0xd2cb('0xfb')]=!![];ami['emit'](_0xd2cb('0xf9'),ut[_0xd2cb('0xfa')](_0x556a02,'amd'));_0x1f810c[_0xd2cb('0xd9')](_0x556a02)[_0xd2cb('0xbf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x556a02[_0xd2cb('0x100')]+_0x556a02[_0xd2cb('0x101')]+_0x556a02[_0xd2cb('0x102')]+_0x556a02['countnosuchnumberretry']+_0x556a02[_0xd2cb('0x103')]+_0x556a02[_0xd2cb('0x104')]+_0x556a02[_0xd2cb('0xff')]+_0x556a02[_0xd2cb('0x105')]>=_0x25c847['dialGlobalMaxRetry']){_0x1f810c[_0xd2cb('0x106')](_0x556a02,_0x39e614,_0x50255a,_0xd2cb('0x107'));}else{if(_0x556a02['countmachineretry']>=_0x25c847['dialMachineMaxRetry']){_0x1f810c[_0xd2cb('0x108')](_0x556a02,_0x39e614,_0x50255a,_0xd2cb('0x109'));}else{_0x1f810c[_0xd2cb('0xcf')]({'active':![],'countmachineretry':_0x556a02[_0xd2cb('0xff')],'scheduledat':moment()['add'](_0x25c847[_0xd2cb('0x10a')],_0xd2cb('0x10b'))[_0xd2cb('0x9d')](_0xd2cb('0x10c')),'ContactId':_0x556a02[_0xd2cb('0xe2')],'ListId':_0x556a02[_0xd2cb('0xe3')],'VoiceQueueId':_0x556a02['VoiceQueueId']||undefined,'CampaignId':_0x556a02[_0xd2cb('0x10d')]||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x10e')));_0x39e614({'reschedule':0x1});}}});}if(_0xb1c412[_0xd2cb('0x5f')]===_0xd2cb('0x84')&&this['campaigns'][_0xb1c412['queue']][_0xd2cb('0xf2')]&&_0x5d7b39[_0xd2cb('0xf3')]===_0xd2cb('0xf4')){delete this[_0xd2cb('0x2a')][_0x5d7b39[_0xd2cb('0xed')]];this['updateOriginated'](this[_0xd2cb('0x24')][_0xb1c412[_0xd2cb('0xc1')]]);_0x2c1a06=new Hangup(_0xb1c412,_0x5d7b39);_0x2c1a06['state']=0x12;_0x2c1a06[_0xd2cb('0xb4')]=_0xd2cb('0xf6');_0x2c1a06[_0xd2cb('0xfe')]=_0xd2cb('0xf7');ami['emit'](_0xd2cb('0xf9'),ut[_0xd2cb('0xfa')](_0x2c1a06,_0xd2cb('0xfb')));this[_0xd2cb('0xe0')](_0x2c1a06,_0xd2cb('0x10f'),_0xd2cb('0x110'));}if(_0xb1c412['type']===_0xd2cb('0x84')&&this[_0xd2cb('0x24')][_0xb1c412[_0xd2cb('0xc1')]][_0xd2cb('0xf2')]&&_0x5d7b39[_0xd2cb('0xf3')]===_0xd2cb('0x111')){var _0x1f810c=this;return new BPromise(function(_0x445f7f,_0x26fc89){delete _0x1f810c['uniqueId'][_0x5d7b39[_0xd2cb('0xed')]];_0x1f810c[_0xd2cb('0xc2')](_0x1f810c[_0xd2cb('0x24')][_0xb1c412[_0xd2cb('0xc1')]]);_0x1f810c[_0xd2cb('0x24')][_0xb1c412[_0xd2cb('0xc1')]][_0xd2cb('0x6a')]+=0x1;_0x1f810c[_0xd2cb('0x24')][_0xb1c412['queue']][_0xd2cb('0x69')]+=0x1;var _0x294601=_0x1f810c[_0xd2cb('0x24')][_0xb1c412[_0xd2cb('0xc1')]];var _0x549857=new Hangup(_0xb1c412,_0x5d7b39);_0x549857[_0xd2cb('0xf5')]=0x13;_0x549857[_0xd2cb('0xb4')]=_0xd2cb('0xfd');_0x549857[_0xd2cb('0xfe')]=_0xd2cb('0xf7');_0x549857[_0xd2cb('0xff')]+=0x1;_0x549857['countglobal']+=0x1;_0x549857['amd']=!![];ami[_0xd2cb('0xf8')](_0xd2cb('0xf9'),ut[_0xd2cb('0xfa')](_0x549857,'amd'));_0x1f810c[_0xd2cb('0xd9')](_0x549857)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x112')));if(_0x549857[_0xd2cb('0x100')]+_0x549857[_0xd2cb('0x101')]+_0x549857[_0xd2cb('0x102')]+_0x549857[_0xd2cb('0x113')]+_0x549857[_0xd2cb('0x103')]+_0x549857[_0xd2cb('0x104')]+_0x549857['countmachineretry']+_0x549857['countagentrejectretry']>=_0x294601[_0xd2cb('0x114')]){_0x1f810c['stateGlobal'](_0x549857,_0x445f7f,_0x26fc89,_0xd2cb('0x107'));}else{if(_0x549857[_0xd2cb('0xff')]>=_0x294601['dialMachineMaxRetry']){_0x1f810c[_0xd2cb('0x108')](_0x549857,_0x445f7f,_0x26fc89,_0xd2cb('0x109'));}else{_0x1f810c[_0xd2cb('0xcf')]({'active':![],'countmachineretry':_0x549857['countmachineretry'],'scheduledat':moment()[_0xd2cb('0x115')](_0x294601['dialMachineRetryFrequency'],_0xd2cb('0x10b'))[_0xd2cb('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x549857[_0xd2cb('0xe2')],'ListId':_0x549857[_0xd2cb('0xe3')],'VoiceQueueId':_0x549857[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x549857['CampaignId']||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x10e')));_0x445f7f({'reschedule':0x1});}}});}}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x3b')]=function(_0x4ce196){var _0x1e466e=this['uniqueId'][_0x4ce196[_0xd2cb('0xed')]];var _0x4b1df1=this;var _0x26e31a;if(_0x1e466e&&_0x1e466e[_0xd2cb('0x5f')]===_0xd2cb('0x84')){delete this[_0xd2cb('0x2a')][_0x4ce196[_0xd2cb('0xed')]];this[_0xd2cb('0xc2')](this[_0xd2cb('0x24')][_0x1e466e[_0xd2cb('0xc1')]]);this[_0xd2cb('0x24')][_0x1e466e['queue']][_0xd2cb('0x116')]+=0x1;_0x26e31a=new Hangup(_0x1e466e,_0x4ce196);this[_0xd2cb('0xd9')](_0x26e31a)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x117')));this['moveContactManagedDialer'](_0x26e31a)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x1e466e&&_0x1e466e[_0xd2cb('0x5f')]!==_0xd2cb('0x84')&&isNotNull(this[_0xd2cb('0x23')][_0x1e466e[_0xd2cb('0xc1')]][_0xd2cb('0x118')])){delete this[_0xd2cb('0x2a')][_0x4ce196[_0xd2cb('0xed')]];this[_0xd2cb('0xc2')](this['voiceQueues'][_0x1e466e['queue']]);this[_0xd2cb('0x23')][_0x1e466e[_0xd2cb('0xc1')]][_0xd2cb('0x6a')]+=0x1;this[_0xd2cb('0x23')][_0x1e466e[_0xd2cb('0xc1')]][_0xd2cb('0x69')]+=0x1;_0x26e31a=new Hangup(_0x1e466e,_0x4ce196);_0x26e31a[_0xd2cb('0xf5')]=0x10;_0x26e31a[_0xd2cb('0xb4')]='AnswerAGI';_0x26e31a[_0xd2cb('0xfe')]=_0xd2cb('0x119');this[_0xd2cb('0xd9')](_0x26e31a)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x117')));this[_0xd2cb('0xd8')](_0x26e31a)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x1e466e&&_0x1e466e[_0xd2cb('0x5f')]!==_0xd2cb('0x84')&&!isNotNull(this[_0xd2cb('0x23')][_0x1e466e[_0xd2cb('0xc1')]][_0xd2cb('0x118')])){delete this['uniqueId'][_0x4ce196[_0xd2cb('0xed')]];this['updateOriginated'](this[_0xd2cb('0x23')][_0x1e466e['queue']]);this[_0xd2cb('0x23')][_0x1e466e['queue']][_0xd2cb('0x74')]+=0x1;_0x26e31a=new Hangup(_0x1e466e,_0x4ce196);_0x26e31a['state']=0xc;_0x26e31a[_0xd2cb('0xb4')]=_0x4ce196[_0xd2cb('0x11a')];_0x26e31a[_0xd2cb('0xfe')]=_0xd2cb('0x11b');this[_0xd2cb('0xd9')](_0x26e31a)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x117')));this[_0xd2cb('0xd8')](_0x26e31a)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x11c')));}};Dialer[_0xd2cb('0xb7')]['syncAgentComplete']=function(_0x154f6a){var _0xddcc0c=this['uniqueId'][_0x154f6a[_0xd2cb('0xed')]];var _0x175173=this;if(this[_0xd2cb('0x23')][_0x154f6a[_0xd2cb('0xc1')]]){if(_0xddcc0c&&_0xddcc0c[_0xd2cb('0x5f')]!==_0xd2cb('0x84')){delete this[_0xd2cb('0x2a')][_0x154f6a[_0xd2cb('0xed')]];this['voiceQueues'][_0x154f6a[_0xd2cb('0xc1')]][_0xd2cb('0x6a')]+=0x1;var _0x1cb67c=new AgentComplete(_0xddcc0c,_0x154f6a);if(_0x154f6a['reason']===_0xd2cb('0x11d')){_0x1cb67c[_0xd2cb('0x11e')]=this[_0xd2cb('0x23')][_0x154f6a[_0xd2cb('0xc1')]][_0xd2cb('0x11f')]&&this['voiceQueues'][_0x154f6a[_0xd2cb('0xc1')]]['dialAgiAfterHangupAgent']?moment()[_0xd2cb('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xd2cb('0xd9')](_0x1cb67c)['catch'](loggerCatch(_0xd2cb('0x120')));this[_0xd2cb('0xd8')](_0x1cb67c)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xd2cb('0xb7')]['syncAgentConnect']=function(_0x5a4df5){if(this['voiceQueues'][_0x5a4df5[_0xd2cb('0xc1')]]){if(this['uniqueId'][_0x5a4df5['uniqueid']]&&this[_0xd2cb('0x2a')][_0x5a4df5[_0xd2cb('0xed')]][_0xd2cb('0x5f')]!==_0xd2cb('0x84')){this['updateOriginated'](this[_0xd2cb('0x23')][_0x5a4df5['queue']]);this[_0xd2cb('0x2a')][_0x5a4df5[_0xd2cb('0xed')]][_0xd2cb('0x121')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x122')]=function(_0x3007b1,_0x4e25d2){this[_0xd2cb('0xd9')](_0x3007b1)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x120')));if(_0x4e25d2==0x0){this[_0xd2cb('0xd8')](_0x3007b1)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x123')));}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x268c16){var _0x1ff0d6=this[_0xd2cb('0x2a')][_0x268c16[_0xd2cb('0xed')]];var _0x22c092=this;var _0x59ffce=![];var _0xe81e84;var _0x3e935c;if(this[_0xd2cb('0x23')][_0x268c16['queue']]){if(_0x1ff0d6&&_0x1ff0d6[_0xd2cb('0x5f')]!==_0xd2cb('0x84')){delete this[_0xd2cb('0x2a')][_0x268c16[_0xd2cb('0xed')]];this[_0xd2cb('0xc2')](this[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]]);_0x1ff0d6[_0xd2cb('0x124')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x43289c=new QueueCallerAbandon(_0x1ff0d6,_0x268c16);if(getSeconds(_0x1ff0d6['droptime'],_0x1ff0d6[_0xd2cb('0x125')])>=_0x1ff0d6[_0xd2cb('0x126')]){this['voiceQueues'][_0x268c16[_0xd2cb('0xc1')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xd2cb('0x23')][_0x268c16['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]][_0xd2cb('0x7a')]+=0x1;_0x43289c[_0xd2cb('0xf5')]=0xa;_0x43289c['statedesc']='Drop';_0x43289c[_0xd2cb('0x127')]=_0xd2cb('0x128');_0x43289c[_0xd2cb('0x11e')]=this[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]][_0xd2cb('0x11f')]?moment()[_0xd2cb('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x43289c[_0xd2cb('0x103')]+=0x1;_0x43289c['countglobal']+=0x1;_0xe81e84=this[_0xd2cb('0x23')][_0x268c16['queue']]['dialDropRetryFrequency'];_0x3e935c=this[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]]['callAdditionalPhoneAfterMin'];_0x22c092[_0xd2cb('0xc8')](_0x43289c,_0x43289c[_0xd2cb('0xf5')],_0x1ff0d6[_0xd2cb('0x129')])[_0xd2cb('0x45')](function(_0x2baea5){_0x59ffce=_0x2baea5['additional']==0x1;if(_0x43289c[_0xd2cb('0x103')]>=_0x22c092[_0xd2cb('0x23')][_0x268c16['queue']][_0xd2cb('0x12a')]){_0x22c092[_0xd2cb('0x122')](_0x43289c,_0x2baea5[_0xd2cb('0x12b')]);}else{_0x22c092[_0xd2cb('0xcf')]({'active':![],'countdropretry':_0x43289c[_0xd2cb('0x103')],'scheduledat':moment()['add'](_0x22c092['voiceQueues'][_0x268c16[_0xd2cb('0xc1')]][_0xd2cb('0x12c')],_0xd2cb('0x10b'))['format'](_0xd2cb('0x10c')),'ContactId':_0x1ff0d6[_0xd2cb('0xe2')],'ListId':_0x1ff0d6['ListId'],'VoiceQueueId':_0x1ff0d6[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x1ff0d6[_0xd2cb('0x10d')]||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x12d')));var _0x4aadac=new History(_0x43289c);_0x4aadac[_0xd2cb('0xf5')]=0xa;_0x4aadac[_0xd2cb('0xb4')]=_0xd2cb('0x12e');_0x4aadac[_0xd2cb('0xb6')]=moment()[_0xd2cb('0x9d')](_0xd2cb('0x10c'));_0x4aadac[_0xd2cb('0xb5')]=_0x4aadac[_0xd2cb('0xb6')];_0x4aadac[_0xd2cb('0x12f')]=_0x43289c[_0xd2cb('0x12f')];_0x4aadac[_0xd2cb('0x130')]=_0x43289c[_0xd2cb('0x130')];_0x22c092[_0xd2cb('0xd9')](_0x4aadac)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x131')));}})['then'](function(_0x2c2312){if(_0x59ffce)_0x22c092[_0xd2cb('0xca')](_0x43289c,_0xe81e84,_0x3e935c)['then'](function(_0x540310){return 0x1;});});}else{this[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]][_0xd2cb('0x8b')]+=0x1;this[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]][_0xd2cb('0x132')]+=0x1;_0x43289c[_0xd2cb('0xf5')]=0xb;_0x43289c[_0xd2cb('0xb4')]='Abandoned';_0x43289c[_0xd2cb('0x127')]=_0xd2cb('0x133');_0x43289c['countabandonedretry']+=0x1;_0x43289c[_0xd2cb('0x134')]+=0x1;_0xe81e84=this[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]][_0xd2cb('0x135')];_0x3e935c=this[_0xd2cb('0x23')][_0x268c16['queue']][_0xd2cb('0x136')];_0x22c092[_0xd2cb('0xc8')](_0x43289c,_0x43289c[_0xd2cb('0xf5')],_0x1ff0d6[_0xd2cb('0x129')])['then'](function(_0x23d5b1){if(_0x43289c[_0xd2cb('0x104')]>=_0x22c092[_0xd2cb('0x23')][_0x268c16[_0xd2cb('0xc1')]][_0xd2cb('0x137')]){_0x22c092[_0xd2cb('0x122')](_0x43289c,_0x23d5b1[_0xd2cb('0x12b')]);}else{_0x22c092[_0xd2cb('0xcf')]({'active':![],'countabandonedretry':_0x43289c[_0xd2cb('0x104')],'scheduledat':moment()[_0xd2cb('0x115')](_0x22c092[_0xd2cb('0x23')][_0x268c16['queue']][_0xd2cb('0x135')],_0xd2cb('0x10b'))['format'](_0xd2cb('0x10c')),'ContactId':_0x1ff0d6[_0xd2cb('0xe2')],'ListId':_0x1ff0d6[_0xd2cb('0xe3')],'VoiceQueueId':_0x1ff0d6[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x1ff0d6['CampaignId']||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x138')));var _0x269a0d=new History(_0x43289c);_0x269a0d[_0xd2cb('0xf5')]=0xb;_0x269a0d[_0xd2cb('0xb4')]=_0xd2cb('0x139');_0x269a0d[_0xd2cb('0xb6')]=moment()[_0xd2cb('0x9d')]('YYYY-MM-DD\x20HH:mm:ss');_0x269a0d[_0xd2cb('0xb5')]=_0x269a0d[_0xd2cb('0xb6')];_0x269a0d[_0xd2cb('0x12f')]=_0x43289c[_0xd2cb('0x12f')];_0x269a0d[_0xd2cb('0x130')]=_0x43289c[_0xd2cb('0x130')];_0x22c092[_0xd2cb('0xd9')](_0x269a0d)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x13a')));}})[_0xd2cb('0x45')](function(_0x360ae7){if(_0x59ffce)_0x22c092['swapAdditionalPhones'](_0x43289c,_0xe81e84,_0x3e935c)[_0xd2cb('0x45')](function(_0x576500){return 0x1;});});}}}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x3d')]=function(_0x5cac4e){if(this[_0xd2cb('0x29')][_0x5cac4e[_0xd2cb('0xed')]]){this[_0xd2cb('0x29')][_0x5cac4e['uniqueid']][_0xd2cb('0xbe')]=_0x5cac4e[_0xd2cb('0xbe')];}if(this[_0xd2cb('0x2a')][_0x5cac4e[_0xd2cb('0xed')]]){this[_0xd2cb('0x2a')][_0x5cac4e['uniqueid']][_0xd2cb('0xbe')]=_0x5cac4e['channel'];}};Dialer[_0xd2cb('0xb7')]['syncQueueMember']=function(_0x487fa6){if(strategy[this[_0xd2cb('0x23')][this[_0xd2cb('0x29')][_0x487fa6['actionid']][_0xd2cb('0xc1')]][_0xd2cb('0x57')]]===_0xd2cb('0x1e')){if(this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]]&&_[_0xd2cb('0xbc')](this[_0xd2cb('0x29')][_0x487fa6['actionid']][_0xd2cb('0x13c')])&&_0x487fa6['status']==='1'&&_0x487fa6[_0xd2cb('0x13d')]==='0'){if(this[_0xd2cb('0x25')][_0x487fa6['stateinterface']]){if(!this['agents'][_0x487fa6[_0xd2cb('0x13e')]][_0xd2cb('0x13c')]){this[_0xd2cb('0x25')][_0x487fa6[_0xd2cb('0x13e')]][_0xd2cb('0x13c')]=!![];this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]]['locked']=!![];this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]][_0xd2cb('0x13e')]=_0x487fa6[_0xd2cb('0x13e')];}}}}else if((strategy[this[_0xd2cb('0x23')][this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]]['queue']]['strategy']]||'rrmemory')===_0xd2cb('0x1d')){if(this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]]){if(this[_0xd2cb('0x25')][_0x487fa6[_0xd2cb('0x13e')]]){this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]][_0xd2cb('0x13e')]=_0x487fa6[_0xd2cb('0x13e')];if(_['isNil'](this[_0xd2cb('0x2f')][this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]])){this[_0xd2cb('0x2f')][this[_0xd2cb('0x29')][_0x487fa6['actionid']][_0xd2cb('0xc1')]]=[];}this[_0xd2cb('0x2f')][this[_0xd2cb('0x29')][_0x487fa6[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]][_0xd2cb('0x13f')](_[_0xd2cb('0x98')](_[_0xd2cb('0xe1')](this['actions'][_0x487fa6['actionid']],[_0xd2cb('0x140'),_0xd2cb('0x13e')]),{'status':_0x487fa6[_0xd2cb('0xbd')],'paused':_0x487fa6['paused']}));}}}};function unlockQueueStatus(_0x168881,_0x3abcf0){setTimeout(function(){if(_['isUndefined'](_0x168881[_0xd2cb('0x141')])){loggerBooked[_0xd2cb('0xa0')](_0xd2cb('0x142'),_0x3abcf0);}_0x168881[_0xd2cb('0x141')]=!![];loggerBooked[_0xd2cb('0x86')]('[booked][unlockQueueStatus]',_0x3abcf0,JSON[_0xd2cb('0x53')](_['pick'](_0x168881,['name',_0xd2cb('0x141')])));},0x1f3);}Dialer['prototype'][_0xd2cb('0x143')]=function(_0x46486d){var _0x25d01b=this;var _0x5e08ad=_0x25d01b['voiceQueues'][_0x25d01b[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]];if(strategy[this['voiceQueues'][this['actions'][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]][_0xd2cb('0x57')]]===_0xd2cb('0x1e')){if(this['actions'][_0x46486d[_0xd2cb('0x13b')]]&&this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]]['stateinterface']){this['preview'][_0xd2cb('0x144')](this[_0xd2cb('0x29')][_0x46486d['actionid']]['idHopper'],this['actions'][_0x46486d['actionid']][_0xd2cb('0x13e')])[_0xd2cb('0xbf')](function(_0x1b91df){logger[_0xd2cb('0xa0')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x1b91df,{'showHidden':![],'depth':null}));})[_0xd2cb('0x21')](function(){_0x25d01b['updateOriginated'](_0x25d01b[_0xd2cb('0x23')][_0x25d01b['actions'][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]]);_0x25d01b['agents'][_0x25d01b[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0x13e')]][_0xd2cb('0x13c')]=![];delete _0x25d01b[_0xd2cb('0x29')][_0x46486d['actionid']];unlockQueueStatus(_0x5e08ad);});}else{this['updateOriginated'](this[_0xd2cb('0x23')][this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]]);this[_0xd2cb('0xcf')]({'active':![],'ContactId':this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xe2')],'ListId':this['actions'][_0x46486d['actionid']][_0xd2cb('0xe3')],'VoiceQueueId':this['actions'][_0x46486d['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0x10d')]||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x145')));delete this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]];unlockQueueStatus(_0x5e08ad);}}else if((strategy[this[_0xd2cb('0x23')][this[_0xd2cb('0x29')][_0x46486d['actionid']]['queue']]['strategy']]||'rrmemory')==='rrmemory'){var _0x2efeb9;if(this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]]&&!_[_0xd2cb('0x50')](this['queueBooked'][this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]])){if(this[_0xd2cb('0x30')][_0x25d01b[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]]['queue']]){this['queueBookedRR'][_0x25d01b['actions'][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]]=this['queueBookedRR'][this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]]['queue']]?this[_0xd2cb('0x30')][this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]]:this[_0xd2cb('0x2f')][this['actions'][_0x46486d[_0xd2cb('0x13b')]]['queue']]?this[_0xd2cb('0x2f')][this[_0xd2cb('0x29')][_0x46486d['actionid']][_0xd2cb('0xc1')]][_0xd2cb('0x146')]||0x0:0x0;}this['queueBooked'][this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]]['queue']]['_rr']=this['queueBookedRR'][this[_0xd2cb('0x29')][_0x46486d[_0xd2cb('0x13b')]][_0xd2cb('0xc1')]];for(var _0x268c13=0x0;_0x268c13=0x0;})[_0xd2cb('0xbf')](myreject(_0x184465)));}}else{_0x1dd7c6[_0xd2cb('0x13f')](ami[_0xd2cb('0x15c')]({'action':_0xd2cb('0x15d'),'command':util[_0xd2cb('0x9d')]('iftime\x20%s,%s',_0x3982c4,!_[_0xd2cb('0x8e')](config[_0xd2cb('0x158')][_0x550920])?_0x550920:'')})['then'](function(_0x523b5e){return _0x523b5e[_0xd2cb('0x15e')][_0xd2cb('0x160')](_0xd2cb('0x15f'))>=0x0;})[_0xd2cb('0xbf')](myreject(_0x184465)));}BPromise[_0xd2cb('0x161')](_0x1dd7c6)[_0xd2cb('0x45')](function(_0x2f2295){var _0x3a32f0=_['some'](_0x2f2295);if(_0x3a32f0){return _0x771d0a(_0x3a32f0);}else{_0x42fe2d[_0xd2cb('0x47')]=_0x1e4a82?'GLOBAL_INTERVAL_IS_OVERTIME':_0xd2cb('0x162');return _0x184465(msgResponse(_0xd2cb('0x163'),_0xd2cb('0x155'),'Global:\x20'+_0x1e4a82+'\x20'+_0x53e3f8+_0xd2cb('0x164')+util[_0xd2cb('0x9f')](_0x3982c4,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x550920));}})[_0xd2cb('0xbf')](function(_0x281390){return _0x184465(msgResponse(_0xd2cb('0x154'),_0xd2cb('0x155'),JSON[_0xd2cb('0x53')](_0x281390)));});});};Dialer[_0xd2cb('0xb7')]['checkDialMethod']=function(_0x5a7d64){var _0x4cdcb5=this;return function(){switch(_0x5a7d64[_0xd2cb('0x65')]){case'progressive':freeVariablesPredictive(_0x5a7d64);_0x4cdcb5[_0xd2cb('0x165')](_0x5a7d64,0x1);break;case _0xd2cb('0x166'):freeVariablesPredictive(_0x5a7d64);_0x4cdcb5[_0xd2cb('0x165')](_0x5a7d64,_0x5a7d64[_0xd2cb('0x167')]);break;case _0xd2cb('0x9'):_0x4cdcb5['predictive'](_0x5a7d64);break;case _0xd2cb('0x8'):freeVariablesPredictive(_0x5a7d64);_0x4cdcb5[_0xd2cb('0x165')](_0x5a7d64,0x1);break;default:freeVariablesPredictive(_0x5a7d64);logger[_0xd2cb('0xa0')]('Queue',_0x5a7d64[_0xd2cb('0x49')],_0xd2cb('0x168'));}};};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x169')]=function(_0x3897a4){var _0x4f66fd=this;return function(){_0x4f66fd[_0xd2cb('0x16a')](_0x3897a4);};};Dialer['prototype'][_0xd2cb('0xb')]=function(_0x4590c9){var _0x1b125e=this;if(isNotPreview(_0x4590c9[_0xd2cb('0x65')])){if(isVoiceQueueOutbound(_0x4590c9[_0xd2cb('0x5f')])&&isActive(_0x4590c9['dialActive'])){_0x4590c9[_0xd2cb('0xab')]=!![];BPromise['resolve']()[_0xd2cb('0x45')](checkIsLoggedIn(_0x4590c9,_0x4590c9[_0xd2cb('0x59')]))['then'](checkIsActive(_0x4590c9,_0x4590c9['dialActive']))['then'](checkInterval(_0x4590c9))[_0xd2cb('0x45')](_0x1b125e[_0xd2cb('0x16b')](_0x4590c9))[_0xd2cb('0x45')](_0x1b125e[_0xd2cb('0x16c')](_0x4590c9[_0xd2cb('0x16d')],_0x4590c9['dialTimezone'],_0x4590c9['name'],_0x4590c9))['then'](_0x1b125e[_0xd2cb('0x153')](_0x4590c9[_0xd2cb('0x4d')],_0x4590c9['dialTimezone'],_0x4590c9[_0xd2cb('0x49')],_0x4590c9))[_0xd2cb('0x45')](_0x1b125e[_0xd2cb('0x16e')](_0x4590c9))[_0xd2cb('0xbf')](loggerCatchQueueSummary(_0xd2cb('0x16f'),_0x4590c9));}else{notSendMessagesQueue(_0x4590c9);}}else{freeVariablesPredictive(_0x4590c9);}};Dialer['prototype']['syncQueueSummaryComplete']=_[_0xd2cb('0x170')](function(){var _0x10b98c=_[_0xd2cb('0x171')](this[_0xd2cb('0x23')],function(_0x164b2d){return _0x164b2d['dialPreviewRecallmeReminder'];});var _0x5f2da7=_[_0xd2cb('0x171')](this[_0xd2cb('0x25')],function(_0x9bdb89){return _0x9bdb89[_0xd2cb('0x172')]&&_0x9bdb89[_0xd2cb('0xbd')]===_0xd2cb('0xea');});if(_0x10b98c['length']>0x0&&_0x5f2da7[_0xd2cb('0xa2')]>0x0){return BPromise[_0xd2cb('0xc4')]()[_0xd2cb('0x45')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x10b98c,'id'),previewRecallmeReminderInterval,_[_0xd2cb('0x173')](_0x5f2da7,'id')))[_0xd2cb('0x45')](function(_0x4f700d){for(var _0x38a77c=0x0;_0x38a77c<_0x4f700d[_0xd2cb('0xa2')];_0x38a77c++){var _0x40b1cf=_0x4f700d[_0x38a77c]['Agent'][_0xd2cb('0x49')];if(_0x40b1cf)io['to'](util[_0xd2cb('0x9d')](_0xd2cb('0x174'),_0x40b1cf))['emit'](_0xd2cb('0x175'),{'hopper':_0x4f700d[_0x38a77c]});}})[_0xd2cb('0xbf')](function(_0x1456de){logger[_0xd2cb('0xa0')](_0xd2cb('0x176'),_0x1456de);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xd2cb('0xb7')][_0xd2cb('0x150')]=function(){var _0xc8d234=this;var _0x308020;for(var _0xe060ce in this['campaigns']){if(typeof this[_0xd2cb('0x24')][_0xe060ce]!==_0xd2cb('0xbb')){_0x308020=this['campaigns'][_0xe060ce];if(isCampaignIvr(_0x308020['type'])&&isActive(_0x308020[_0xd2cb('0xe9')])){_0x308020[_0xd2cb('0xab')]=!![];BPromise[_0xd2cb('0xc4')]()['then'](checkIsActive(_0x308020,_0x308020[_0xd2cb('0xe9')]))[_0xd2cb('0x45')](checkInterval(_0x308020))[_0xd2cb('0x45')](_0xc8d234['checkIsTrunkReachable'](_0x308020))['then'](_0xc8d234['checkIfTime'](_0x308020[_0xd2cb('0x16d')],_0x308020['dialTimezone'],_0x308020[_0xd2cb('0x49')],_0x308020))[_0xd2cb('0x45')](_0xc8d234['checkIfTimeIntervals'](_0x308020[_0xd2cb('0x4d')],_0x308020[_0xd2cb('0x177')],_0x308020['name'],_0x308020))['then'](_0xc8d234[_0xd2cb('0x169')](_0x308020))[_0xd2cb('0xbf')](loggerCatchQueueSummary('[syncCampaigns]',_0x308020));}else{notSendMessagesCampaign(_0x308020);}}}};function getCallerIdRandom(_0x1a1dfd,_0x397d28){var _0x171ff8;var _0x3d3019;var _0x10da1b;if(_0x397d28<=0x0){_0x397d28=0x1;}_0x171ff8=new RegExp(_0xd2cb('0x178')+_0x397d28+'}$');_0x3d3019=Math[_0xd2cb('0x179')](0xa,_0x397d28-0x1);_0x10da1b=Math[_0xd2cb('0x179')](0xa,_0x397d28)-0x1;return util['format']('%s',_[_0xd2cb('0x17a')](_0x1a1dfd,_0x171ff8,_['random'](_0x3d3019,_0x10da1b)));}function extractCalleridName(_0x371485){var _0x177625=_0x371485[_0xd2cb('0x17b')](/"(.*?)"/);return _0x177625?_0x177625[0x1]:_0x371485;}function extractCalleridNumber(_0xf4f5f6){var _0x51ebaf=_0xf4f5f6[_0xd2cb('0x17b')](/<(.*?)>/);return _0x51ebaf?_0x51ebaf[0x1]:_0xf4f5f6;}Dialer[_0xd2cb('0xb7')]['actionOriginate']=function(_0x1beea6,_0x4451d3){var _0x38eea4=this;var _0x2e0da9=uuid['v4']();this[_0xd2cb('0x29')][_0x2e0da9]=new Action(_0x1beea6,_0x4451d3,_0x2e0da9);return new BPromise(function(_0x9bd7c2,_0x3ea82a){if(_[_0xd2cb('0x8e')](_0x1beea6)&&typeof _0x1beea6!==_0xd2cb('0x17c')){return _0x3ea82a(msgResponse(_0xd2cb('0x17d'),_0xd2cb('0x155'),_0xd2cb('0x17e')));}if(_[_0xd2cb('0x8e')](_0x4451d3['phone'])||_0x4451d3[_0xd2cb('0x17f')]===null){return _0x3ea82a(msgResponse('originate',_0xd2cb('0x155'),_0xd2cb('0x180')));}var _0x404b0={'XMD-CALLERID':_0x38eea4[_0xd2cb('0x29')][_0x2e0da9][_0xd2cb('0x181')](),'XMD-AGI':_0x1beea6[_0xd2cb('0x118')]?util[_0xd2cb('0x9d')](_0xd2cb('0x182'),ipAgi,_0x1beea6[_0xd2cb('0x118')]):'NONE','XMD-AGIAFTER':_0x1beea6['dialQueueProject2']?util[_0xd2cb('0x9d')](_0xd2cb('0x182'),ipAgi,_0x1beea6[_0xd2cb('0x11f')]):_0xd2cb('0x183'),'XMD-QUEUE':_0x1beea6[_0xd2cb('0x5f')]===_0xd2cb('0x9b')?util['format']('\x22%s,%s%s,,,%s\x22',_0x1beea6[_0xd2cb('0x49')],_0x1beea6[_0xd2cb('0x184')]||'',_0x1beea6[_0xd2cb('0x185')]?'c':'',_0x1beea6[_0xd2cb('0x126')]||0x3):_0xd2cb('0x183'),'XMD-CONTACTID':_0x4451d3[_0xd2cb('0xe2')],'XMD-CDRTYPE':_0xd2cb('0x186'),'CALLERID(all)':_0x38eea4['actions'][_0x2e0da9][_0xd2cb('0x181')](),'XMD-AMD':_0x1beea6[_0xd2cb('0xf2')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xd2cb('0xf1')};if(_0x1beea6[_0xd2cb('0xf2')]){_0x404b0[_0xd2cb('0x187')]=_0x1beea6['dialAMDInitialSilence']||0x9c4;_0x404b0[_0xd2cb('0x188')]=_0x1beea6[_0xd2cb('0x189')]||0x5dc;_0x404b0[_0xd2cb('0x18a')]=_0x1beea6[_0xd2cb('0x18b')]||0x320;_0x404b0['XMD-AMDTOTALANALYSISTIME']=_0x1beea6[_0xd2cb('0x18c')]||0x1388;_0x404b0[_0xd2cb('0x18d')]=_0x1beea6[_0xd2cb('0x18e')]||0x64;_0x404b0[_0xd2cb('0x18f')]=_0x1beea6[_0xd2cb('0x190')]||0x32;_0x404b0[_0xd2cb('0x191')]=_0x1beea6[_0xd2cb('0x192')]||0x3;_0x404b0[_0xd2cb('0x193')]=_0x1beea6[_0xd2cb('0x194')]||0x100;_0x404b0[_0xd2cb('0x195')]=_0x1beea6['dialAMDMaximumWordLength']||0x1388;}if(_0x1beea6['type']===_0xd2cb('0x9b')){_0x404b0[_0xd2cb('0x196')]=_0x4451d3['VoiceQueueId'];}else{_0x404b0[_0xd2cb('0x197')]=_0x4451d3[_0xd2cb('0x10d')];}for(var _0x592f1c in _0x4451d3['Contact']){if(typeof _0x4451d3[_0xd2cb('0x198')][_0x592f1c]!==_0xd2cb('0xbb')){if(isNotNull(_0x4451d3['Contact'][_0x592f1c])&&_0x592f1c!=='id'&&_0x592f1c!=='tags'&&_0x592f1c!==_0xd2cb('0x199')&&_0x592f1c!==_0xd2cb('0x19a')){_0x404b0[util[_0xd2cb('0x9d')](_0xd2cb('0x19b'),'XMD-',_[_0xd2cb('0x19c')](_0x592f1c))]=_0x4451d3[_0xd2cb('0x198')][_0x592f1c];}}}var _0x1d0d60=_0x38eea4[_0xd2cb('0xe8')](_0x1beea6[_0xd2cb('0x82')])?getCallerId(_0x1beea6['Trunk'][_0xd2cb('0x19d')],_0x1beea6['dialOriginateCallerIdName'],_0x1beea6['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1beea6[_0xd2cb('0x66')],_0x1beea6['dialRandomLastDigitCallerIdNumber']):_0x1beea6[_0xd2cb('0x66')]):getCallerId(_[_0xd2cb('0xbc')](_0x1beea6[_0xd2cb('0x151')])?_0x1beea6[_0xd2cb('0x82')][_0xd2cb('0x19d')]:_0x1beea6[_0xd2cb('0x151')][_0xd2cb('0x19d')],_0x1beea6[_0xd2cb('0x19e')],_0x1beea6[_0xd2cb('0x19f')]>0x0?getCallerIdRandom(_0x1beea6[_0xd2cb('0x66')],_0x1beea6[_0xd2cb('0x19f')]):_0x1beea6[_0xd2cb('0x66')]);if(_0x1d0d60){_0x404b0[_0xd2cb('0x1a0')]=_0x38eea4[_0xd2cb('0x29')][_0x2e0da9]['originatecalleridname']=extractCalleridName(_0x1d0d60);_0x404b0[_0xd2cb('0x1a1')]=_0x4451d3[_0xd2cb('0x17f')];}return ami[_0xd2cb('0x15c')]({'actionid':_0x2e0da9,'action':'originate','channel':_0x38eea4[_0xd2cb('0xe8')](_0x1beea6[_0xd2cb('0x82')])?util[_0xd2cb('0x9d')](_0xd2cb('0x1a2'),_0x1beea6[_0xd2cb('0x82')][_0xd2cb('0x49')],isNotNull(_0x1beea6[_0xd2cb('0x68')])?_0x1beea6['dialPrefix'][_0xd2cb('0x1a3')]()||'':'',_0x1beea6[_0xd2cb('0x1a4')]>0x0?_0x4451d3['phone'][_0xd2cb('0x1a5')](_0x1beea6[_0xd2cb('0x1a4')]):_0x4451d3[_0xd2cb('0x17f')]):util['format']('SIP/%s/%s%s',_['isNil'](_0x1beea6['TrunkBackup'])?_0x1beea6['Trunk'][_0xd2cb('0x49')]:_0x1beea6[_0xd2cb('0x151')][_0xd2cb('0x49')],isNotNull(_0x1beea6[_0xd2cb('0x68')])?_0x1beea6[_0xd2cb('0x68')][_0xd2cb('0x1a3')]()||'':'',_0x1beea6['dialCutDigit']>0x0?_0x4451d3['phone'][_0xd2cb('0x1a5')](_0x1beea6[_0xd2cb('0x1a4')]):_0x4451d3[_0xd2cb('0x17f')]),'callerid':_0x1d0d60,'Exten':_0xd2cb('0xf1'),'Context':_0xd2cb('0x1a6'),'Priority':'1','variable':_0x404b0,'timeout':(_0x1beea6[_0xd2cb('0x67')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2e0da9})[_0xd2cb('0x45')](function(_0xc7e12c){return _0x9bd7c2(_0xc7e12c);})[_0xd2cb('0xbf')](function(_0x439219){_0x1beea6[_0xd2cb('0x72')]+=0x1;var _0x1d0c06=new History(_0x38eea4[_0xd2cb('0x29')][_0x2e0da9]);logger[_0xd2cb('0xa0')](util[_0xd2cb('0x9d')](_0xd2cb('0x1a7'),JSON[_0xd2cb('0x53')](_0x439219)));_0x1d0c06[_0xd2cb('0xf5')]=0xe;_0x1d0c06[_0xd2cb('0xb4')]=_0xd2cb('0x1a8');_0x1d0c06['starttime']=moment()[_0xd2cb('0x9d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d0c06[_0xd2cb('0xb5')]=_0x1d0c06[_0xd2cb('0xb6')];_0x38eea4[_0xd2cb('0xd9')](_0x1d0c06)['catch'](loggerCatch(_0xd2cb('0x1a9')));_0x38eea4[_0xd2cb('0xd8')](_0x1d0c06)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1a9')))[_0xd2cb('0x21')](function(){delete _0x38eea4['actions'][_0x2e0da9];return _0x3ea82a(msgResponse(_0xd2cb('0x17d'),'Error',_0xd2cb('0x1aa')));});});});};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x35')]=function(_0x40614f){var _0x969fb3=this[_0xd2cb('0x29')][_0x40614f[_0xd2cb('0x13b')]];if(_0x969fb3){delete this[_0xd2cb('0x29')][_0x40614f[_0xd2cb('0x13b')]];_0x969fb3['responsetime']=moment()['format'](_0xd2cb('0x10c'));var _0x38c689=_0x969fb3[_0xd2cb('0x5f')]===_0xd2cb('0x84')?this['campaigns'][_0x969fb3[_0xd2cb('0xc1')]]:this['voiceQueues'][_0x969fb3[_0xd2cb('0x1ab')]()];if(!this[_0xd2cb('0x1ac')](_0x40614f[_0xd2cb('0x1ad')])){this[_0xd2cb('0xc2')](_0x38c689);return this[_0xd2cb('0x1ae')](_0x969fb3,_0x38c689,_0x40614f)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1af')));}this[_0xd2cb('0x2a')][_0x40614f['uniqueid']]=_0x969fb3;}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x1b0')]=function(_0x3c9557,_0x32192f,_0x1c48c2){var _0x53d9ca=new History(_0x32192f);if(_0x53d9ca[_0xd2cb('0x100')]+_0x53d9ca[_0xd2cb('0x101')]+_0x53d9ca[_0xd2cb('0x102')]+_0x53d9ca[_0xd2cb('0x113')]+_0x53d9ca[_0xd2cb('0x103')]+_0x53d9ca[_0xd2cb('0x104')]+_0x53d9ca[_0xd2cb('0xff')]+_0x53d9ca[_0xd2cb('0x105')]>=_0x1c48c2[_0xd2cb('0x114')]-0x1){return!![];}switch(_0x3c9557){case 0x3:if(_0x53d9ca[_0xd2cb('0x102')]>=_0x1c48c2[_0xd2cb('0x1b1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x53d9ca[_0xd2cb('0x102')]+=0x1,'scheduledat':moment()['add'](_0x1c48c2['dialNoAnswerRetryFrequency'],_0xd2cb('0x10b'))[_0xd2cb('0x9d')](_0xd2cb('0x10c')),'ContactId':_0x53d9ca['ContactId'],'ListId':_0x53d9ca['ListId'],'VoiceQueueId':_0x53d9ca[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x53d9ca['CampaignId']||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1b2')));break;case 0x5:if(_0x53d9ca['countbusyretry']>=_0x1c48c2[_0xd2cb('0x1b3')]-0x1){return!![];}this[_0xd2cb('0xcf')]({'active':![],'countbusyretry':_0x53d9ca[_0xd2cb('0x100')]+=0x1,'scheduledat':moment()[_0xd2cb('0x115')](_0x1c48c2[_0xd2cb('0x1b4')],'minutes')['format'](_0xd2cb('0x10c')),'ContactId':_0x53d9ca['ContactId'],'ListId':_0x53d9ca['ListId'],'VoiceQueueId':_0x53d9ca[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x53d9ca['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x53d9ca[_0xd2cb('0x101')]>=_0x1c48c2[_0xd2cb('0x1b5')]-0x1){return!![];}this[_0xd2cb('0xcf')]({'active':![],'countcongestionretry':_0x53d9ca[_0xd2cb('0x101')]+=0x1,'scheduledat':moment()[_0xd2cb('0x115')](_0x1c48c2[_0xd2cb('0x1b6')],_0xd2cb('0x10b'))[_0xd2cb('0x9d')](_0xd2cb('0x10c')),'ContactId':_0x53d9ca['ContactId'],'ListId':_0x53d9ca[_0xd2cb('0xe3')],'VoiceQueueId':_0x53d9ca[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x53d9ca[_0xd2cb('0x10d')]||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1b7')));break;case 0x0:if(_0x53d9ca[_0xd2cb('0x113')]>=_0x1c48c2['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xd2cb('0xcf')]({'active':![],'countnosuchnumberretry':_0x53d9ca['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xd2cb('0x115')](_0x1c48c2[_0xd2cb('0x1b8')],_0xd2cb('0x10b'))['format'](_0xd2cb('0x10c')),'ContactId':_0x53d9ca[_0xd2cb('0xe2')],'ListId':_0x53d9ca[_0xd2cb('0xe3')],'VoiceQueueId':_0x53d9ca[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x53d9ca[_0xd2cb('0x10d')]||undefined})[_0xd2cb('0xbf')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x53d9ca[_0xd2cb('0x103')]>=_0x1c48c2[_0xd2cb('0x12a')]-0x1){return!![];}this[_0xd2cb('0xcf')]({'active':![],'countdropretry':_0x53d9ca[_0xd2cb('0x103')]+=0x1,'scheduledat':moment()[_0xd2cb('0x115')](_0x1c48c2[_0xd2cb('0x12c')],_0xd2cb('0x10b'))[_0xd2cb('0x9d')](_0xd2cb('0x10c')),'ContactId':_0x53d9ca['ContactId'],'ListId':_0x53d9ca[_0xd2cb('0xe3')],'VoiceQueueId':_0x53d9ca[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x53d9ca[_0xd2cb('0x10d')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x53d9ca['countabandonedretry']>=_0x1c48c2[_0xd2cb('0x137')]-0x1){return!![];}this[_0xd2cb('0xcf')]({'active':![],'countabandonedretry':_0x53d9ca[_0xd2cb('0x104')]+=0x1,'scheduledat':moment()[_0xd2cb('0x115')](_0x1c48c2[_0xd2cb('0x135')],_0xd2cb('0x10b'))[_0xd2cb('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53d9ca[_0xd2cb('0xe2')],'ListId':_0x53d9ca[_0xd2cb('0xe3')],'VoiceQueueId':_0x53d9ca[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x53d9ca[_0xd2cb('0x10d')]||undefined})[_0xd2cb('0xbf')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x53d9ca['countmachineretry']>=_0x1c48c2[_0xd2cb('0x1b9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x53d9ca[_0xd2cb('0xff')]+=0x1,'scheduledat':moment()[_0xd2cb('0x115')](_0x1c48c2[_0xd2cb('0x10a')],'minutes')[_0xd2cb('0x9d')](_0xd2cb('0x10c')),'ContactId':_0x53d9ca[_0xd2cb('0xe2')],'ListId':_0x53d9ca[_0xd2cb('0xe3')],'VoiceQueueId':_0x53d9ca[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x53d9ca['CampaignId']||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x10e')));break;case 0x14:if(_0x53d9ca[_0xd2cb('0x105')]>=_0x1c48c2['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x53d9ca['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x1c48c2[_0xd2cb('0x1ba')],_0xd2cb('0x10b'))['format'](_0xd2cb('0x10c')),'ContactId':_0x53d9ca[_0xd2cb('0xe2')],'ListId':_0x53d9ca[_0xd2cb('0xe3')],'VoiceQueueId':_0x53d9ca['VoiceQueueId']||undefined,'CampaignId':_0x53d9ca[_0xd2cb('0x10d')]||undefined})[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1bb')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x48a89d,_0x401b3e,_0x514284){var _0x55aeee=this;var _0xd9831e=new History(_0x48a89d);var _0x2328ec=![];var _0x286c04;var _0x47d259;return new BPromise(function(_0x30808e,_0x367586){if(_['isUndefined'](_0x401b3e)&&typeof _0x401b3e!==_0xd2cb('0x17c')){return _0x367586(msgResponse('[callProgressDetecting]',_0xd2cb('0x155'),_0xd2cb('0x1bc')));}if(_[_0xd2cb('0x8e')](_0x514284)&&typeof _0x514284!=='object'){return _0x367586(msgResponse(_0xd2cb('0x1bd'),'Failure',_0xd2cb('0x1be')));}_0x55aeee[_0xd2cb('0xc8')](_0xd9831e,_0x514284[_0xd2cb('0x1bf')],_0x401b3e)[_0xd2cb('0x45')](function(_0x3a44e0){if(_0x3a44e0[_0xd2cb('0x12b')]==0x1)_0x2328ec=!![];switch(_0x514284[_0xd2cb('0x1bf')]){case'0':_0x401b3e['outboundNoSuchCallsDay']+=0x1;_0xd9831e['state']=0x0;_0xd9831e[_0xd2cb('0xb4')]='NoSuchNumber';_0xd9831e['countnosuchnumberretry']+=0x1;_0xd9831e[_0xd2cb('0x134')]+=0x1;ami[_0xd2cb('0xf8')](_0xd2cb('0x1c0'),ut[_0xd2cb('0xfa')](_0x48a89d,_0xd2cb('0x1c1')));_0x286c04=_0x401b3e[_0xd2cb('0x1b8')];_0x47d259=_0x401b3e[_0xd2cb('0x136')];_0x55aeee[_0xd2cb('0xd9')](_0xd9831e)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x112')));if(_0x55aeee[_0xd2cb('0x1b0')](0x0,_0x48a89d,_0x401b3e)&&!_0x2328ec){if(_0xd9831e[_0xd2cb('0x113')]>=_0x401b3e[_0xd2cb('0x1c2')]){_0x55aeee['createStateFinal'](_0xd9831e,_0x30808e,_0x367586,'reason\x200\x20no\x20such\x20number....');}else{_0x55aeee[_0xd2cb('0x106')](_0xd9831e,_0x30808e,_0x367586,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x401b3e['outboundNoAnswerCallsDay']+=0x1;_0xd9831e[_0xd2cb('0xf5')]=0x3;_0xd9831e[_0xd2cb('0xb4')]=_0xd2cb('0x1c3');_0xd9831e[_0xd2cb('0x102')]+=0x1;_0xd9831e[_0xd2cb('0x134')]+=0x1;ami[_0xd2cb('0xf8')](_0xd2cb('0x1c4'),ut[_0xd2cb('0xfa')](_0x48a89d,_0xd2cb('0x1c5')));_0x286c04=_0x401b3e[_0xd2cb('0x1c6')];_0x47d259=_0x401b3e[_0xd2cb('0x136')];_0x55aeee['createHistory'](_0xd9831e)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1c7')));if(_0x55aeee[_0xd2cb('0x1b0')](0x3,_0x48a89d,_0x401b3e)&&!_0x2328ec){if(_0xd9831e[_0xd2cb('0x102')]>=_0x401b3e[_0xd2cb('0x1b1')]){_0x55aeee[_0xd2cb('0x108')](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1c8'));}else{_0x55aeee[_0xd2cb('0x106')](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1c8'));}}break;case'5':_0x401b3e[_0xd2cb('0x6c')]+=0x1;_0xd9831e[_0xd2cb('0xf5')]=0x5;_0xd9831e[_0xd2cb('0xb4')]=_0xd2cb('0x1c9');_0xd9831e[_0xd2cb('0x100')]+=0x1;_0xd9831e[_0xd2cb('0x134')]+=0x1;ami['emit'](_0xd2cb('0x1ca'),ut['buildObj'](_0x48a89d,_0xd2cb('0x1cb')));_0x286c04=_0x401b3e[_0xd2cb('0x1b4')];_0x47d259=_0x401b3e[_0xd2cb('0x136')];_0x55aeee[_0xd2cb('0xd9')](_0xd9831e)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1cc')));if(_0x55aeee[_0xd2cb('0x1b0')](0x5,_0x48a89d,_0x401b3e)&&!_0x2328ec){if(_0xd9831e[_0xd2cb('0x100')]>=_0x401b3e[_0xd2cb('0x1b3')]){_0x55aeee['createStateFinal'](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1cd'));}else{_0x55aeee[_0xd2cb('0x106')](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1cd'));}}break;case'8':_0x401b3e[_0xd2cb('0x6d')]+=0x1;_0xd9831e[_0xd2cb('0xf5')]=0x8;_0xd9831e['statedesc']=_0xd2cb('0x1ce');_0xd9831e[_0xd2cb('0x101')]+=0x1;_0xd9831e['countglobal']+=0x1;_0x286c04=_0x401b3e[_0xd2cb('0x1b6')];_0x47d259=_0x401b3e['callAdditionalPhoneAfterMin'];ami[_0xd2cb('0xf8')]('custom:agentcongestion',ut['buildObj'](_0x48a89d,_0xd2cb('0x1cf')));_0x55aeee[_0xd2cb('0xd9')](_0xd9831e)[_0xd2cb('0xbf')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x55aeee[_0xd2cb('0x1b0')](0x8,_0x48a89d,_0x401b3e)&&!_0x2328ec){if(_0xd9831e[_0xd2cb('0x101')]>=_0x401b3e['dialCongestionMaxRetry']){_0x55aeee['createStateFinal'](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1d0'));}else{_0x55aeee[_0xd2cb('0x106')](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1d0'));}}break;case'11':_0x401b3e[_0xd2cb('0x1d1')]+=0x1;_0xd9831e[_0xd2cb('0xf5')]=0xb;_0xd9831e[_0xd2cb('0xb4')]=_0xd2cb('0x139');_0xd9831e[_0xd2cb('0x104')]+=0x1;_0xd9831e[_0xd2cb('0x134')]+=0x1;_0x286c04=_0x401b3e[_0xd2cb('0x135')];_0x47d259=_0x401b3e[_0xd2cb('0x136')];_0x55aeee['createHistory'](_0xd9831e)['catch'](loggerCatch(_0xd2cb('0x13a')));if(_0x55aeee['checkRetriveMax'](0xb,_0x48a89d,_0x401b3e)&&!_0x2328ec){if(_0xd9831e[_0xd2cb('0x104')]>=_0x401b3e['dialAbandonedMaxRetry']){_0x55aeee[_0xd2cb('0x108')](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1d2'));}else{_0x55aeee[_0xd2cb('0x106')](_0xd9831e,_0x30808e,_0x367586,'reason\x2011\x20abandoned');}}break;case'20':_0x401b3e[_0xd2cb('0x1d3')]+=0x1;_0xd9831e['state']=0x14;_0xd9831e[_0xd2cb('0xb4')]=_0xd2cb('0x1d4');_0xd9831e[_0xd2cb('0x105')]+=0x1;_0xd9831e[_0xd2cb('0x134')]+=0x1;_0x286c04=_0x401b3e[_0xd2cb('0x1ba')];_0x47d259=_0x401b3e[_0xd2cb('0x136')];ami[_0xd2cb('0xf8')](_0xd2cb('0x1d5'),ut[_0xd2cb('0xfa')](_0x48a89d,_0xd2cb('0x1d6')));_0x55aeee[_0xd2cb('0xd9')](_0xd9831e)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1d7')));if(_0x55aeee[_0xd2cb('0x1b0')](0x14,_0x48a89d,_0x401b3e)&&!_0x2328ec){if(_0xd9831e[_0xd2cb('0x105')]>=_0x401b3e[_0xd2cb('0x1d8')]){_0x55aeee[_0xd2cb('0x108')](_0xd9831e,_0x30808e,_0x367586,_0xd2cb('0x1d9'));}else{_0x55aeee[_0xd2cb('0x106')](_0xd9831e,_0x30808e,_0x367586,'reason\x2020\x20agentreject');}}break;default:_0x401b3e[_0xd2cb('0x74')]+=0x1;_0xd9831e[_0xd2cb('0xf5')]=0xc;_0xd9831e['statedesc']=_0x514284[_0xd2cb('0x1bf')];_0x286c04=_0x401b3e['dialAgentRejectRetryFrequency'];_0x47d259=_0x401b3e[_0xd2cb('0x136')];_0x55aeee[_0xd2cb('0xd9')](_0xd9831e)[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x1da')));if(_0x55aeee['checkRetriveMax'](_0x514284['reason'],_0x48a89d,_0x401b3e)&&!_0x2328ec){if(_0xd9831e[_0xd2cb('0x100')]+_0xd9831e[_0xd2cb('0x101')]+_0xd9831e[_0xd2cb('0x102')]+_0xd9831e[_0xd2cb('0x113')]+_0xd9831e[_0xd2cb('0x103')]+_0xd9831e['countabandonedretry']+_0xd9831e[_0xd2cb('0xff')]+_0xd9831e['countagentrejectretry']>=_0x401b3e[_0xd2cb('0x114')]){_0x55aeee[_0xd2cb('0x106')](_0xd9831e,_0x30808e,_0x367586,_0x514284[_0xd2cb('0x1bf')]);}else{_0x55aeee['createStateFinal'](_0xd9831e,_0x30808e,_0x367586,_0x514284[_0xd2cb('0x1bf')]);}}}})[_0xd2cb('0x45')](function(_0x351a37){if(_0x2328ec){_0x55aeee['swapAdditionalPhones'](_0xd9831e,_0x286c04,_0x47d259)[_0xd2cb('0x45')](function(_0x10915d){return _0x30808e(0x1);});}});});};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x106')]=function(_0x17f678,_0x7e22da,_0x40b0be,_0x50c1fc){var _0x21bd1f=new Final(_0x17f678);_0x21bd1f[_0xd2cb('0xf5')]=0xf;_0x21bd1f['statedesc']=_0xd2cb('0x1db');this[_0xd2cb('0x108')](_0x21bd1f,_0x7e22da,_0x40b0be,_0x50c1fc);};Dialer['prototype'][_0xd2cb('0x108')]=function(_0x5c886a,_0x15f214,_0x13ec25,_0x306f00){this['moveContactManagedDialer'](_0x5c886a)[_0xd2cb('0x45')](function(){return _0x15f214(msgResponse(_0xd2cb('0x1bd'),_0xd2cb('0xe7'),_0x306f00));})[_0xd2cb('0xbf')](function(){return _0x13ec25(msgResponse(_0xd2cb('0x1dc'),_0xd2cb('0x155'),_0xd2cb('0x1dd')));});};Dialer[_0xd2cb('0xb7')]['predictive']=function(_0x26f520){var _0x25a5f7=_0x26f520['dialPredictiveOptimizationPercentage']/0x64;var _0x2b1a26=_0x26f520[_0xd2cb('0x6f')]/(_0x26f520[_0xd2cb('0x6f')]+_0x26f520[_0xd2cb('0x6a')]);var _0x1f7ad3=Math[_0xd2cb('0x1de')](_0x26f520[_0xd2cb('0x7d')]*(_0x26f520[_0xd2cb('0x1df')]/0x64));var _0x38370f=Math[_0xd2cb('0x1de')](_0x26f520[_0xd2cb('0x7d')]*(_0x26f520[_0xd2cb('0x1e0')]/0x64));var _0x36b141=_0x26f520[_0xd2cb('0xad')]+_0x26f520[_0xd2cb('0xac')];var _0x1d1e01=Math[_0xd2cb('0x1e1')](_0x26f520[_0xd2cb('0x7f')]*_0x26f520[_0xd2cb('0x95')]*_0x26f520[_0xd2cb('0x1e2')]*_0x26f520[_0xd2cb('0x7b')]);if(_[_0xd2cb('0x8e')](_0x26f520[_0xd2cb('0x2d')])){if(!_[_0xd2cb('0x8e')](_0x26f520[_0xd2cb('0x2c')])){_0x26f520[_0xd2cb('0x2c')]=undefined;loggerPredictive[_0xd2cb('0xa0')](_0xd2cb('0x1e3'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xd2cb('0x8e')](_0x26f520[_0xd2cb('0x9a')])){loggerPredictive[_0xd2cb('0xa0')]('[startMethodPredictive][StartProgressive]',_0xd2cb('0x1e4'));clearInterval(_0x26f520[_0xd2cb('0x9a')]);_0x26f520[_0xd2cb('0x9a')]=undefined;}_0x26f520[_0xd2cb('0x2d')]=moment()[_0xd2cb('0x9d')](_0xd2cb('0x10c'));loggerPredictive[_0xd2cb('0x86')](_0x26f520[_0xd2cb('0x49')],'collection\x20data\x20in\x20progressive\x20at',_0x26f520['startProgressive']);this[_0xd2cb('0x165')](_0x26f520,0x1);}else if(ifInterval(_0x26f520[_0xd2cb('0x1e5')],_0x26f520[_0xd2cb('0x2d')])){this[_0xd2cb('0x165')](_0x26f520,0x1);loggerPredictiveCalls['info'](_0xd2cb('0x1e6'),_0x26f520[_0xd2cb('0x2d')],_0x26f520[_0xd2cb('0x49')]);_0x26f520[_0xd2cb('0x7f')]=0x0;_0x26f520[_0xd2cb('0x7a')]=0x0;}else if(_0x25a5f7<_0x2b1a26&&_0x26f520[_0xd2cb('0x1e7')]===_0xd2cb('0x1e8')){freeVariablesPredictive(_0x26f520);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x1e9'),_0xd2cb('0x1ea'),_0x2b1a26,_0xd2cb('0x2d'),_0x26f520['name']);}else if(_0x1d1e01<_0x26f520['predictiveIntervalErlangCallsDroppedCalls']&&_0x26f520[_0xd2cb('0x1e7')]==='dropRate'){freeVariablesPredictive(_0x26f520);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x1eb'),_0xd2cb('0x1ec'),_0x1d1e01,'Drop\x20in\x20this\x20interval',_0x26f520[_0xd2cb('0x7a')],_0xd2cb('0x2d'),_0x26f520['name']);}else if(!ifInterval(_0x26f520['dialPredictiveInterval'],_0x26f520[_0xd2cb('0x2d')])&&_[_0xd2cb('0x8e')](_0x26f520[_0xd2cb('0x2c')])&&!_[_0xd2cb('0x8e')](_0x26f520[_0xd2cb('0x2d')])){_0x26f520[_0xd2cb('0x2c')]=moment()[_0xd2cb('0x9d')](_0xd2cb('0x10c'));loggerPredictive[_0xd2cb('0x86')](_0x26f520[_0xd2cb('0x49')],_0xd2cb('0x1ed'),_0x26f520[_0xd2cb('0x2c')]);this[_0xd2cb('0xcd')](_0x26f520[_0xd2cb('0x1e5')])[_0xd2cb('0x45')](this[_0xd2cb('0x1ee')](_0x26f520))[_0xd2cb('0x45')](mergeDataErlangB(_0x26f520))['then'](this[_0xd2cb('0x1ef')](_0x26f520))[_0xd2cb('0xbf')](loggerCatchPredictive(_0xd2cb('0x1f0'),_0x26f520));}else if(!ifInterval(_0x26f520[_0xd2cb('0x1e5')],_0x26f520['startPredictive'])){_0x26f520[_0xd2cb('0x7a')]=0x0;_0x26f520['startPredictive']=moment()['format'](_0xd2cb('0x10c'));loggerPredictive[_0xd2cb('0x86')](_0x26f520[_0xd2cb('0x49')],_0xd2cb('0x1f1'),_0x26f520['startPredictive']);clearInterval(_0x26f520[_0xd2cb('0x9a')]);_0x26f520['handlePredictive']=undefined;this['averageHandleTime'](_0x26f520[_0xd2cb('0x1e5')])[_0xd2cb('0x45')](this[_0xd2cb('0x1ee')](_0x26f520))['then'](mergeDataErlangB(_0x26f520))[_0xd2cb('0x45')](this[_0xd2cb('0x1ef')](_0x26f520))[_0xd2cb('0xbf')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x26f520));}else if(_0x26f520[_0xd2cb('0x7d')]&&_0x36b141<_0x26f520[_0xd2cb('0x7d')]-_0x38370f){freeVariablesPredictive(_0x26f520);loggerPredictive['info'](_0x26f520[_0xd2cb('0x49')],_0xd2cb('0x1f2'),_0x36b141,_0xd2cb('0x1f3'),_0x26f520[_0xd2cb('0x7d')],'-',_0x38370f,'=',_0x26f520[_0xd2cb('0x7d')]-_0x38370f,')');}else if(_0x26f520[_0xd2cb('0x7d')]&&_0x36b141>_0x26f520[_0xd2cb('0x7d')]+_0x1f7ad3){freeVariablesPredictive(_0x26f520);loggerPredictive[_0xd2cb('0x86')](_0x26f520[_0xd2cb('0x49')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x36b141,_0xd2cb('0x1f4'),_0x26f520['predictiveIntervalAvailable'],'+',_0x1f7ad3,'=',_0x26f520[_0xd2cb('0x7d')]+_0x1f7ad3,')');}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x1ee')]=function(_0x343613){var _0x234689=this;return function(_0x1a9ee2){return new BPromise(function(_0x54cb01,_0x1e503c){_['merge'](_0x343613,_0x1a9ee2[0x0]);if(checkGetDataPredictive(_0x1a9ee2[0x0])){var _0xf78617=_0x343613[_0xd2cb('0x7d')]=_0x343613[_0xd2cb('0xac')]+_0x343613[_0xd2cb('0xad')];var _0x2926c3=_0x343613['dialPredictiveInterval']*0x3c;var _0x19cd61=_0x1a9ee2[0x0]['predictiveIntervalAvgTalktime']+_0x1a9ee2[0x0]['predictiveIntervalAvgHoldtime'];var _0x19c183=(_0x1a9ee2[0x0]['predictiveIntervalAnsweredCalls']+_0x1a9ee2[0x0][_0xd2cb('0x78')]+_0x1a9ee2[0x0][_0xd2cb('0x8b')])/_0x1a9ee2[0x0][_0xd2cb('0x7e')];_0x343613[_0xd2cb('0x1e2')]=_0x19c183>0x0?_0x19c183:0x1;switch(_0x343613[_0xd2cb('0x1e7')]){case _0xd2cb('0x1e8'):var _0x169c2f=_0x343613[_0xd2cb('0x1f5')]/0x64;return _0x234689[_0xd2cb('0x1f6')](_0xf78617,_0x2926c3,_0x19cd61,_0x19c183,_0x169c2f)[_0xd2cb('0x45')](function(_0x47e9fd){return _0x54cb01(_0x47e9fd);});case _0xd2cb('0x1f7'):var _0x51751d=_0x343613['dialPredictiveOptimizationPercentage']/0x64;return _0x234689[_0xd2cb('0x1f8')](_0xf78617,_0x2926c3,_0x19cd61,_0x19c183,_0x51751d)['then'](function(_0xc8a014){return _0x54cb01(_0xc8a014);});default:return _0x1e503c(msgResponse(_0xd2cb('0x1f9'),'Failure',_0xd2cb('0x1fa')));}}else{return _0x1e503c(msgResponse(_0xd2cb('0x1f9'),'Failure',_0xd2cb('0x1fb')));}});};};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x1fc')]=function(_0x46f586){var _0xc447dc=this;return function(_0x45a211){return new BPromise(function(_0x3c7ee9,_0x4c88f6){_[_0xd2cb('0x98')](_0x46f586,_0x45a211[0x0]);if(checkGetDataPredictive(_0x45a211[0x0])){loggerPredictive['info'](JSON[_0xd2cb('0x53')](_0x45a211[0x0]));if(_0x46f586[_0xd2cb('0x1e7')]===_0xd2cb('0x1e8')){return _0xc447dc[_0xd2cb('0x1fd')](_0x46f586['id'])[_0xd2cb('0x45')](function(_0x3305de){var _0x4e3e09=_0x46f586[_0xd2cb('0x59')]-_0x3305de[0x0]['outboundQueuePauses'];var _0x2f19c4=_0x46f586['dialPredictiveInterval']*0x3c;var _0x39aac4=_0x45a211[0x0][_0xd2cb('0x77')]+_0x45a211[0x0][_0xd2cb('0x76')];var _0x298c3c=(_0x45a211[0x0][_0xd2cb('0x75')]+_0x45a211[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x45a211[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x45a211[0x0][_0xd2cb('0x7e')];var _0xd99a70=_0x46f586[_0xd2cb('0x1f5')]/0x64;_0x46f586[_0xd2cb('0x7c')]=_0x3305de[0x0]['outboundQueuePauses']||0x0;_0x46f586['predictiveIntervalHitRate']=_0x298c3c>0x0?_0x298c3c:0x1;return _0xc447dc['abandonmentRate'](_0x4e3e09,_0x2f19c4,_0x39aac4,_0x298c3c,_0xd99a70);})[_0xd2cb('0x45')](function(_0x268e7c){return _0x3c7ee9(_0x268e7c);})['catch'](function(_0x572351){return _0x4c88f6(msgResponse(_0xd2cb('0x1fe'),_0xd2cb('0x155'),JSON['stringify'](_0x572351)));});}if(_0x46f586[_0xd2cb('0x1e7')]===_0xd2cb('0x1f7')){return _0xc447dc[_0xd2cb('0x1fd')](_0x46f586['id'])[_0xd2cb('0x45')](function(_0x364049){var _0x2dd656=_0x46f586[_0xd2cb('0x59')]-_0x364049[0x0][_0xd2cb('0x1ff')];var _0x2d16c5=_0x46f586['dialPredictiveInterval']*0x3c;var _0x212655=_0x45a211[0x0][_0xd2cb('0x77')]+_0x45a211[0x0][_0xd2cb('0x76')];var _0xc8c059=(_0x45a211[0x0][_0xd2cb('0x75')]+_0x45a211[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x45a211[0x0][_0xd2cb('0x8b')])/_0x45a211[0x0]['predictiveIntervalTotalCalls'];var _0x54d244=_0x46f586[_0xd2cb('0x1f5')]/0x64;_0x46f586[_0xd2cb('0x7c')]=_0x364049[0x0][_0xd2cb('0x1ff')]||0x0;_0x46f586[_0xd2cb('0x1e2')]=_0xc8c059>0x0?_0xc8c059:0x1;return _0xc447dc[_0xd2cb('0x1f8')](_0x2dd656,_0x2d16c5,_0x212655,_0xc8c059,_0x54d244);})[_0xd2cb('0x45')](function(_0x5dbc0c){return _0x3c7ee9(_0x5dbc0c);})[_0xd2cb('0xbf')](function(_0x52c851){return _0x4c88f6(msgResponse(_0xd2cb('0x1fe'),_0xd2cb('0x155'),JSON[_0xd2cb('0x53')](_0x52c851)));});}}else{return _0x4c88f6(msgResponse(_0xd2cb('0x1f9'),_0xd2cb('0x155'),_0xd2cb('0x1fb')));}});};};Dialer[_0xd2cb('0xb7')]['startMethodPredictive']=function(_0x465ddb){var _0x4645c1=this;return function(){var _0x5c7f45=0x0;var _0x13d386=Math[_0xd2cb('0x1e1')](_0x465ddb['erlangCallToSecond']*0x3e8);if(_0x13d386>0x0){_0x13d386=_0x13d386<0x64?0x64:_0x13d386;loggerPredictive[_0xd2cb('0x86')](_0x465ddb['name'],_0xd2cb('0x200'),_0x13d386,_0xd2cb('0x54'));_0x465ddb['handlePredictive']=setInterval(function(){_0x4645c1[_0xd2cb('0x9a')](_0x465ddb);loggerPredictiveCalls[_0xd2cb('0x86')](_0xd2cb('0x201'),_0x5c7f45+=0x1);},_0x13d386);}else{loggerPredictive[_0xd2cb('0x86')](_0x465ddb[_0xd2cb('0x49')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xd2cb('0x202')]=function(_0x20479d,_0x1d292b){var _0x2c87fe=this;return function(_0x2e24f5){if(_[_0xd2cb('0x50')](_0x2e24f5)){if(_['isNil'](_0x1d292b[_0xd2cb('0x203')])||!_0x1d292b[_0xd2cb('0x204')]){if(_0x20479d[_0xd2cb('0x65')]===_0xd2cb('0x8')){_0x20479d['queueStatusComplete']=_[_0xd2cb('0x8e')](_0x20479d['queueStatusComplete'])?!![]:_0x20479d['queueStatusComplete'];var _0x32c335=uuid['v4']();_0x2c87fe['actions'][_0x32c335]=new Action(_0x20479d,_0x1d292b,_0x32c335);loggerBooked['info'](_0xd2cb('0x205'),_0x32c335,_0xd2cb('0x206'),JSON[_0xd2cb('0x53')](_0x20479d[_0xd2cb('0x141')]),'Queue:\x20',_0x20479d['name']);if(_0x20479d[_0xd2cb('0x141')]){_0x20479d[_0xd2cb('0x141')]=![];_0x2c87fe['queueBooked'][_0x2c87fe[_0xd2cb('0x29')][_0x32c335][_0xd2cb('0xc1')]]=[];ami[_0xd2cb('0x15c')]({'actionid':_0x32c335,'action':_0xd2cb('0x207'),'queue':_0x20479d[_0xd2cb('0x49')]})[_0xd2cb('0xbf')](function(){_0x2c87fe['updateOriginated'](_0x20479d);_0x2c87fe[_0xd2cb('0xcf')]({'active':![],'ContactId':_0x2c87fe[_0xd2cb('0x29')][_0x32c335][_0xd2cb('0xe2')],'ListId':_0x2c87fe[_0xd2cb('0x29')][_0x32c335][_0xd2cb('0xe3')],'VoiceQueueId':_0x2c87fe[_0xd2cb('0x29')][_0x32c335]['VoiceQueueId']||undefined,'CampaignId':_0x2c87fe[_0xd2cb('0x29')][_0x32c335]['CampaignId']||undefined})['catch'](loggerCatch(_0xd2cb('0x208')));delete _0x2c87fe[_0xd2cb('0x29')][_0x32c335];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xd2cb('0x53')](_0x20479d[_0xd2cb('0x141')]),_0xd2cb('0x209'),_0x20479d[_0xd2cb('0x49')]);_0x2c87fe[_0xd2cb('0xc2')](_0x20479d);_0x2c87fe[_0xd2cb('0xcf')]({'active':![],'ContactId':_0x2c87fe[_0xd2cb('0x29')][_0x32c335][_0xd2cb('0xe2')],'ListId':_0x2c87fe[_0xd2cb('0x29')][_0x32c335][_0xd2cb('0xe3')],'VoiceQueueId':_0x2c87fe['actions'][_0x32c335][_0xd2cb('0xe4')]||undefined,'CampaignId':_0x2c87fe['actions'][_0x32c335][_0xd2cb('0x10d')]||undefined})['catch'](loggerCatch(_0xd2cb('0x208')));delete _0x2c87fe['actions'][_0x32c335];}}else{return _0x2c87fe[_0xd2cb('0x20a')](_0x20479d,_0x1d292b);}}else{if(getDiff(_0x1d292b[_0xd2cb('0x20b')])<_0x20479d[_0xd2cb('0x20c')]*0x3c){if(_0x1d292b['Agent']&&!_0x1d292b['Agent'][_0xd2cb('0x20d')]){_0x2c87fe['preview'][_0xd2cb('0x144')](_0x1d292b['id'])[_0xd2cb('0x21')](function(){_0x2c87fe[_0xd2cb('0xc2')](_0x20479d);});}else{_0x2c87fe[_0xd2cb('0xd1')]({'active':![]},_0x1d292b['id'],0x1)['finally'](function(){_0x2c87fe[_0xd2cb('0xc2')](_0x20479d);});}}else{_0x20479d[_0xd2cb('0x73')]+=0x1;_0x2c87fe[_0xd2cb('0xc2')](_0x20479d);if(_0x20479d[_0xd2cb('0x20e')]){_0x2c87fe[_0xd2cb('0xcf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1d292b[_0xd2cb('0xe2')],'ListId':_0x1d292b[_0xd2cb('0xe3')],'VoiceQueueId':_0x1d292b[_0xd2cb('0xe4')]||undefined,'CampaignId':_0x1d292b[_0xd2cb('0x10d')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2c87fe[_0xd2cb('0xd9')](createObjHistory(_0x20479d,_0x1d292b,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0x20f')));}else{_0x2c87fe[_0xd2cb('0xe0')](createObjHistory(_0x20479d,_0x1d292b,_0xd2cb('0x210'),0x16,_0xd2cb('0x211')),_0xd2cb('0x212'),_0xd2cb('0x213'));}}}}else{_0x20479d[_0xd2cb('0x6b')]+=0x1;_0x2c87fe[_0xd2cb('0xe0')](createObjHistory(_0x20479d,_0x1d292b,_0xd2cb('0x214'),0xd,'Blacklist'),_0xd2cb('0x215'),_0xd2cb('0x216'));throw _0xd2cb('0x217');}};};Dialer['prototype'][_0xd2cb('0x16a')]=function(_0x58ada5){var _0x3065e0=this;var _0x2b9975=_0x58ada5['limitCalls']-_0x58ada5[_0xd2cb('0xa3')]-_0x58ada5[_0xd2cb('0xd4')];emitCampaignSummary(_0x58ada5);if(_0x2b9975>0x0){if(_0x2b9975>this[_0xd2cb('0x27')]){_0x2b9975=this[_0xd2cb('0x27')];}_0x58ada5[_0xd2cb('0xd4')]+=_0x2b9975;this[_0xd2cb('0x218')](_0x58ada5['id'],_0x2b9975,_0x58ada5[_0xd2cb('0x219')],_0x58ada5)['then'](function(_0x2b94b4){_0x58ada5['temp']-=_0x2b9975;_0x58ada5[_0xd2cb('0xd4')]=_0x58ada5[_0xd2cb('0xd4')]>0x0?_0x58ada5[_0xd2cb('0xd4')]:0x0;if(!checkContactEmpty(_0x2b94b4)){_0x58ada5[_0xd2cb('0x47')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xd2cb('0x86')]('[getContactCampaign2][Empty]'+_0x58ada5['name']);}else{_0x58ada5['originated']+=_0x2b94b4[_0xd2cb('0xa2')];_0x58ada5[_0xd2cb('0x47')]=_0xd2cb('0x21a');for(var _0x504223=0x0;_0x504223<_0x2b94b4[_0xd2cb('0xa2')];_0x504223+=0x1){_0x58ada5['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x2b94b4[_0x504223])||_[_0xd2cb('0xbc')](_0x2b94b4[_0x504223][_0xd2cb('0x198')])||_[_0xd2cb('0xbc')](_0x2b94b4[_0x504223][_0xd2cb('0x17f')])){_0x3065e0[_0xd2cb('0xde')](_0xd2cb('0x21b'),_0x58ada5,_0x2b94b4[_0x504223]);}else{_0x3065e0[_0xd2cb('0xcb')](_['pick'](_0x2b94b4[_0x504223],[_0xd2cb('0x10d'),_0xd2cb('0x21c')]))[_0xd2cb('0x45')](_0x3065e0['checkContactBlack'](_0x58ada5,_0x2b94b4[_0x504223]))['catch'](_0x3065e0[_0xd2cb('0xdd')](_0xd2cb('0x21d'),_0x58ada5));}}}})[_0xd2cb('0xbf')](loggerGetContactDialer(_0xd2cb('0x21e'),_0x58ada5,_0x2b9975));}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x165')]=function(_0x12f940,_0x4d5ce0){var _0x502f34=this;var _0x5f5230=[];var _0x11817e=_0x4d5ce0>=0x1?_0x4d5ce0:0x1;if(_0x12f940[_0xd2cb('0x65')]===_0xd2cb('0x8')){_0x11817e=0x1;}var _0x4aaf1d=Math[_0xd2cb('0x1e1')](_0x12f940[_0xd2cb('0xad')]*_0x11817e)-_0x12f940[_0xd2cb('0xa3')]-_0x12f940['temp'];emitVoiceQueueSummary(_0x12f940);if(_0x12f940[_0xd2cb('0x21f')]>0x0){var _0x33692e=_0x12f940[_0xd2cb('0x21f')]-_0x12f940[_0xd2cb('0xa3')]-_0x12f940[_0xd2cb('0xac')]-_0x12f940[_0xd2cb('0xd4')]-_0x12f940[_0xd2cb('0x5a')];if(_0x4aaf1d>_0x33692e){_0x4aaf1d=_0x33692e;}}if(_0x4aaf1d>0x0){if(_0x12f940['dialMethod']===_0xd2cb('0x8')){_0x4aaf1d=0x1;}if(_0x4aaf1d>this['maxNumberOriginate']){_0x4aaf1d=this[_0xd2cb('0x27')];}_0x12f940['temp']+=_0x4aaf1d;for(var _0x297990 in this[_0xd2cb('0x25')]){if(typeof this[_0xd2cb('0x25')][_0x297990]!=='undefined'){if(this[_0xd2cb('0x25')][_0x297990][_0xd2cb('0xf5')]===_0xd2cb('0x220')&&this[_0xd2cb('0x25')][_0x297990]['status']===_0xd2cb('0xea')){_0x5f5230[_0xd2cb('0x13f')](this[_0xd2cb('0x25')][_0x297990]['id']);}}}this[_0xd2cb('0xd3')](_0x12f940['id'],_0x5f5230,_0x4aaf1d,_0x12f940['dialOrderByScheduledAt'],_0x12f940)['then'](function(_0xb4e3bb){_0x12f940[_0xd2cb('0xd4')]-=_0x4aaf1d;_0x12f940[_0xd2cb('0xd4')]=_0x12f940[_0xd2cb('0xd4')]>0x0?_0x12f940[_0xd2cb('0xd4')]:0x0;if(!checkContactEmpty(_0xb4e3bb)){_0x502f34[_0xd2cb('0xc3')](_0x12f940)['then'](sendMessageReschedule(_0x12f940))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0xc5')));}else{_0x12f940[_0xd2cb('0xa3')]+=_0xb4e3bb['length'];_0x12f940[_0xd2cb('0x47')]=_0x12f940[_0xd2cb('0x65')]===_0xd2cb('0x8')?_0xd2cb('0x221'):'RUNNING';for(var _0x5efc34=0x0;_0x5efc34<_0xb4e3bb[_0xd2cb('0xa2')];_0x5efc34+=0x1){if(_['isNil'](_0xb4e3bb[_0x5efc34])||_[_0xd2cb('0xbc')](_0xb4e3bb[_0x5efc34][_0xd2cb('0x198')])||_[_0xd2cb('0xbc')](_0xb4e3bb[_0x5efc34][_0xd2cb('0x17f')])){_0x502f34[_0xd2cb('0xde')](_0xd2cb('0x21b'),_0x12f940,_0xb4e3bb[_0x5efc34]);}else{_0x502f34[_0xd2cb('0xc6')](_[_0xd2cb('0xe1')](_0xb4e3bb[_0x5efc34],['VoiceQueueId',_0xd2cb('0x21c')]))[_0xd2cb('0x45')](_0x502f34['checkContactBlack'](_0x12f940,_0xb4e3bb[_0x5efc34]))[_0xd2cb('0xbf')](_0x502f34[_0xd2cb('0xdd')]('[actionOriginate]\x20',_0x12f940));}}}})[_0xd2cb('0xbf')](loggerGetContactDialer(_0xd2cb('0x222'),_0x12f940,_0x4aaf1d));}};Dialer[_0xd2cb('0xb7')][_0xd2cb('0x9a')]=function(_0x737885){if(_0x737885['dialLimitQueue']>0x0){var _0x3d6e73=_0x737885[_0xd2cb('0x21f')]-_0x737885[_0xd2cb('0xa3')]-_0x737885[_0xd2cb('0xac')];if(_0x3d6e73>0x0){this['tryOriginatePredictive'](_0x737885);}else{loggerPredictiveCalls['info'](_0xd2cb('0x223'));}}else{this[_0xd2cb('0x224')](_0x737885);}};Dialer[_0xd2cb('0xb7')]['tryOriginatePredictive']=function(_0x58de37){var _0x16a4c0=this;var _0x41ca97=[];_0x58de37[_0xd2cb('0xa3')]+=0x1;for(var _0x2a21b2 in this[_0xd2cb('0x25')]){if(typeof this[_0xd2cb('0x25')][_0x2a21b2]!=='undefined'){if(this['agents'][_0x2a21b2][_0xd2cb('0xf5')]===_0xd2cb('0x220')&&this[_0xd2cb('0x25')][_0x2a21b2][_0xd2cb('0xbd')]===_0xd2cb('0xea')){_0x41ca97['push'](this[_0xd2cb('0x25')][_0x2a21b2]['id']);}}}this[_0xd2cb('0xd3')](_0x58de37['id'],_0x41ca97,0x1,_0x58de37[_0xd2cb('0x219')],_0x58de37)[_0xd2cb('0x45')](function(_0x7ff724){if(!checkContactEmpty(_0x7ff724)){checkContactLowerLimitOriginate(_0x58de37,0x1,0x0);_0x16a4c0[_0xd2cb('0xc3')](_0x58de37)[_0xd2cb('0x45')](sendMessageReschedule(_0x58de37))[_0xd2cb('0xbf')](loggerCatch(_0xd2cb('0xc5')));}else{_0x58de37[_0xd2cb('0x47')]='RUNNING';if(_[_0xd2cb('0xbc')](_0x7ff724[0x0])||_['isNil'](_0x7ff724[0x0][_0xd2cb('0x198')])||_[_0xd2cb('0xbc')](_0x7ff724[0x0][_0xd2cb('0x17f')])){_0x16a4c0[_0xd2cb('0xde')](_0xd2cb('0x21b'),_0x58de37,_0x7ff724[0x0]);}else{_0x16a4c0[_0xd2cb('0xc6')](_[_0xd2cb('0xe1')](_0x7ff724[0x0],[_0xd2cb('0xe4'),_0xd2cb('0x21c')]))[_0xd2cb('0x45')](_0x16a4c0[_0xd2cb('0x202')](_0x58de37,_0x7ff724[0x0]))['catch'](_0x16a4c0[_0xd2cb('0xdd')](_0xd2cb('0x225'),_0x58de37));}}})[_0xd2cb('0xbf')](loggerGetContactDialer(_0xd2cb('0x226'),_0x58de37,0x1));emitVoiceQueueSummary(_0x58de37);};Dialer['prototype'][_0xd2cb('0x1f6')]=function(_0x2b4f7b,_0x25642d,_0x31621e,_0x42611b,_0x4058e8,_0x3e43bc){loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x227'));loggerPredictive['info'](_0xd2cb('0x228'),_0x2b4f7b);loggerPredictive['info'](_0xd2cb('0x229'),_0x25642d);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x22a'),_0x31621e);loggerPredictive[_0xd2cb('0x86')]('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',_0x42611b);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x22b'),_0x4058e8);loggerPredictive['info'](_0xd2cb('0x97'));return new BPromise(function(_0x40315a,_0x43f6f2){if(_0x2b4f7b<=0x0||isNaN(_0x2b4f7b)){return _0x43f6f2(msgResponse(_0xd2cb('0x22c'),_0xd2cb('0x52'),'m\x20=\x20'+_0x2b4f7b));}if(_0x31621e<=0x0||isNaN(_0x31621e)){return _0x43f6f2(msgResponse(_0xd2cb('0x22c'),_0xd2cb('0x52'),_0xd2cb('0x22d')+_0x31621e));}if(_0x42611b<=0x0||isNaN(_0x42611b)){return _0x43f6f2(msgResponse(_0xd2cb('0x22c'),_0xd2cb('0x52'),_0xd2cb('0x22e')+_0x42611b));}if(_0x25642d<=0x0||isNaN(_0x25642d)){return _0x43f6f2(msgResponse('[abandonmentRate]','Error',_0xd2cb('0x22f')+_0x25642d));}if(_0x4058e8<=0x0||isNaN(_0x4058e8)){return _0x43f6f2(msgResponse(_0xd2cb('0x22c'),_0xd2cb('0x52'),_0xd2cb('0x230')+_0x4058e8));}_0x3e43bc=_0x3e43bc||0x0;var _0x4e672e=0x1/_0x31621e;var _0x580e39=0x0;var _0x59f4f8=0x0;var _0x3d8fa5=0x0;var _0x3486df=0x0;for(var _0x2b5e69=0x0;_0x3d8fa5<_0x4058e8;_0x2b5e69+=0x1){_0x59f4f8=_0x2b5e69/_0x25642d;_0x580e39=(_0x42611b*_0x59f4f8+_0x3e43bc)/_0x4e672e;_0x3d8fa5=erlangb(_0x580e39,_0x2b4f7b);_0x3486df=_0x580e39/_0x2b4f7b*(0x1-erlangb(_0x580e39,_0x2b4f7b));}return _0x40315a({'erlangCalls':_0x2b5e69,'erlangCallToSecond':_0x25642d/_0x2b5e69,'erlangAbandonmentRate':_0x3d8fa5,'erlangBusyFactor':_0x3486df});});};Dialer['prototype'][_0xd2cb('0x1f8')]=function(_0x2dbfbf,_0x59db42,_0x2abf54,_0x1f7bf7,_0x3709e1,_0x2f3955){loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x231'));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',_0x2dbfbf);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x229'),_0x59db42);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x22a'),_0x2abf54);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x232'),_0x1f7bf7);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x233'),_0x3709e1);loggerPredictive[_0xd2cb('0x86')](_0xd2cb('0x97'));return new BPromise(function(_0x336802,_0x189146){if(_0x2dbfbf<=0x0||isNaN(_0x2dbfbf)){return _0x189146(msgResponse('[busyFactor]',_0xd2cb('0x52'),_0xd2cb('0x234')+_0x2dbfbf));}if(_0x2abf54<=0x0||isNaN(_0x2abf54)){return _0x189146(msgResponse(_0xd2cb('0x235'),_0xd2cb('0x52'),_0xd2cb('0x22d')+_0x2abf54));}if(_0x1f7bf7<=0x0||isNaN(_0x1f7bf7)){return _0x189146(msgResponse(_0xd2cb('0x235'),'Error',_0xd2cb('0x22e')+_0x1f7bf7));}if(_0x59db42<=0x0||isNaN(_0x59db42)){return _0x189146(msgResponse(_0xd2cb('0x235'),_0xd2cb('0x52'),_0xd2cb('0x22f')+_0x59db42));}if(_0x3709e1<=0x0||isNaN(_0x3709e1)){return _0x189146(msgResponse(_0xd2cb('0x235'),_0xd2cb('0x52'),'Umin\x20=\x20'+_0x3709e1));}_0x2f3955=_0x2f3955||0x0;var _0x546701=0x1/_0x2abf54;var _0x2b5d9d=0x0;var _0x1683b4=0x0;var _0x1b0459=0x0;var _0x5759bc=0x0;for(var _0x53e9ec=0x0;_0x5759bc<_0x3709e1;_0x53e9ec+=0x1){_0x1683b4=_0x53e9ec/_0x59db42;_0x2b5d9d=(_0x1f7bf7*_0x1683b4+_0x2f3955)/_0x546701;_0x1b0459=erlangb(_0x2b5d9d,_0x2dbfbf);_0x5759bc=_0x2b5d9d/_0x2dbfbf*(0x1-erlangb(_0x2b5d9d,_0x2dbfbf));}return _0x336802({'erlangCalls':_0x53e9ec,'erlangCallToSecond':_0x59db42/_0x53e9ec,'erlangAbandonmentRate':_0x1b0459,'erlangBusyFactor':_0x5759bc});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 807fc03..955abd2 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70ff=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','uniqueid','calleridname','starttime','responsetime','droptime','ringtime','holdtime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0x70ff,0x1ce));var _0xf70f=function(_0x5a25f6,_0x3db5cb){_0x5a25f6=_0x5a25f6-0x0;var _0x5a524d=_0x70ff[_0x5a25f6];return _0x5a524d;};'use strict';var util=require(_0xf70f('0x0'));var _=require(_0xf70f('0x1'));var moment=require(_0xf70f('0x2'));function getSeconds(_0x33b3f1,_0x2498d6){var _0x2b7a2e=moment(_0x33b3f1)[_0xf70f('0x3')](0x0);var _0x37e550=moment(_0x2498d6)[_0xf70f('0x3')](0x0);return _0x2b7a2e[_0xf70f('0x4')](_0x37e550,_0xf70f('0x5'));}function QueueCallerAbandon(_0x28fb20,_0x318828){this[_0xf70f('0x6')]=_0x28fb20[_0xf70f('0x6')];this[_0xf70f('0x7')]=_0x28fb20['type'];this['campaigntype']=_0x28fb20[_0xf70f('0x7')]===_0xf70f('0x8')?_0xf70f('0x9'):_0x28fb20[_0xf70f('0x7')];this['countbusyretry']=_0x28fb20[_0xf70f('0xa')];this[_0xf70f('0xb')]=_0x28fb20[_0xf70f('0xb')];this['countnoanswerretry']=_0x28fb20['countnoanswerretry'];this[_0xf70f('0xc')]=_0x28fb20[_0xf70f('0xa')]+_0x28fb20['countcongestionretry']+_0x28fb20['countnoanswerretry']+_0x28fb20['countnosuchnumberretry']+_0x28fb20[_0xf70f('0xd')]+_0x28fb20['countabandonedretry']+_0x28fb20['countmachineretry']+_0x28fb20[_0xf70f('0xe')];this[_0xf70f('0xf')]=_0x28fb20[_0xf70f('0xf')];this[_0xf70f('0xd')]=_0x28fb20[_0xf70f('0xd')];this['countabandonedretry']=_0x28fb20[_0xf70f('0x10')];this[_0xf70f('0x11')]=_0x28fb20[_0xf70f('0x11')];this[_0xf70f('0xe')]=_0x28fb20['countagentrejectretry'];this[_0xf70f('0x12')]=_0x318828[_0xf70f('0x12')];this[_0xf70f('0x13')]=_0x28fb20['name'];this['calleridnum']=_0x28fb20['number'];this[_0xf70f('0x14')]=_0x28fb20['starttime'];this[_0xf70f('0x15')]=_0x28fb20[_0xf70f('0x15')];this['droptime']=_0x28fb20[_0xf70f('0x16')];this['endtime']=this[_0xf70f('0x16')];this[_0xf70f('0x17')]=getSeconds(_0x28fb20[_0xf70f('0x15')],_0x28fb20[_0xf70f('0x14')]);this[_0xf70f('0x18')]=getSeconds(this['droptime'],_0x28fb20[_0xf70f('0x15')]);this['talktime']=0x0;this[_0xf70f('0x9')]=_0x318828[_0xf70f('0x9')];this['membername']=_0x318828['connectedlinename'];this['reason']=_0x318828[_0xf70f('0x19')];this[_0xf70f('0x1a')]=_0x28fb20['callback'];this[_0xf70f('0x1b')]=_0x28fb20[_0xf70f('0x1b')];this[_0xf70f('0x1c')]=_0x28fb20['callbackat'];this['recallme']=_0x28fb20[_0xf70f('0x1d')];this['ContactId']=_0x28fb20[_0xf70f('0x1e')];this[_0xf70f('0x1f')]=_0x28fb20[_0xf70f('0x1f')];this['UserId']=_0x28fb20[_0xf70f('0x20')];this['VoiceQueueId']=_0x28fb20[_0xf70f('0x21')];this['CampaignId']=_0x28fb20[_0xf70f('0x22')];this['originatecalleridnum']=_0x28fb20['originatecalleridnum']||'';this[_0xf70f('0x23')]=_0x28fb20[_0xf70f('0x23')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x2090=['util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x43e3ef,_0x174a25){var _0xc0fec2=function(_0x8be268){while(--_0x8be268){_0x43e3ef['push'](_0x43e3ef['shift']());}};_0xc0fec2(++_0x174a25);}(_0x2090,0x195));var _0x0209=function(_0x131320,_0x3c6857){_0x131320=_0x131320-0x0;var _0x49158c=_0x2090[_0x131320];return _0x49158c;};'use strict';var util=require(_0x0209('0x0'));var _=require(_0x0209('0x1'));var moment=require(_0x0209('0x2'));function getSeconds(_0x1b160a,_0x4e4539){var _0x5750d5=moment(_0x1b160a)[_0x0209('0x3')](0x0);var _0x2daf74=moment(_0x4e4539)[_0x0209('0x3')](0x0);return _0x5750d5['diff'](_0x2daf74,_0x0209('0x4'));}function QueueCallerAbandon(_0x19bb67,_0x578043){this[_0x0209('0x5')]=_0x19bb67[_0x0209('0x5')];this[_0x0209('0x6')]=_0x19bb67[_0x0209('0x6')];this[_0x0209('0x7')]=_0x19bb67[_0x0209('0x6')]===_0x0209('0x8')?_0x0209('0x9'):_0x19bb67[_0x0209('0x6')];this[_0x0209('0xa')]=_0x19bb67[_0x0209('0xa')];this[_0x0209('0xb')]=_0x19bb67[_0x0209('0xb')];this['countnoanswerretry']=_0x19bb67['countnoanswerretry'];this[_0x0209('0xc')]=_0x19bb67['countbusyretry']+_0x19bb67['countcongestionretry']+_0x19bb67[_0x0209('0xd')]+_0x19bb67[_0x0209('0xe')]+_0x19bb67[_0x0209('0xf')]+_0x19bb67[_0x0209('0x10')]+_0x19bb67['countmachineretry']+_0x19bb67[_0x0209('0x11')];this[_0x0209('0xe')]=_0x19bb67[_0x0209('0xe')];this[_0x0209('0xf')]=_0x19bb67[_0x0209('0xf')];this['countabandonedretry']=_0x19bb67[_0x0209('0x10')];this[_0x0209('0x12')]=_0x19bb67['countmachineretry'];this[_0x0209('0x11')]=_0x19bb67[_0x0209('0x11')];this[_0x0209('0x13')]=_0x578043[_0x0209('0x13')];this[_0x0209('0x14')]=_0x19bb67['name'];this[_0x0209('0x15')]=_0x19bb67[_0x0209('0x16')];this['starttime']=_0x19bb67[_0x0209('0x17')];this[_0x0209('0x18')]=_0x19bb67[_0x0209('0x18')];this[_0x0209('0x19')]=_0x19bb67[_0x0209('0x19')];this[_0x0209('0x1a')]=this[_0x0209('0x19')];this[_0x0209('0x1b')]=getSeconds(_0x19bb67[_0x0209('0x18')],_0x19bb67[_0x0209('0x17')]);this[_0x0209('0x1c')]=getSeconds(this['droptime'],_0x19bb67['responsetime']);this[_0x0209('0x1d')]=0x0;this['queue']=_0x578043[_0x0209('0x9')];this[_0x0209('0x1e')]=_0x578043[_0x0209('0x1f')];this[_0x0209('0x20')]=_0x578043[_0x0209('0x20')];this[_0x0209('0x21')]=_0x19bb67[_0x0209('0x21')];this[_0x0209('0x22')]=_0x19bb67[_0x0209('0x22')];this[_0x0209('0x23')]=_0x19bb67[_0x0209('0x23')];this[_0x0209('0x24')]=_0x19bb67[_0x0209('0x24')];this[_0x0209('0x25')]=_0x19bb67[_0x0209('0x25')];this[_0x0209('0x26')]=_0x19bb67[_0x0209('0x26')];this[_0x0209('0x27')]=_0x19bb67[_0x0209('0x27')];this[_0x0209('0x28')]=_0x19bb67[_0x0209('0x28')];this[_0x0209('0x29')]=_0x19bb67[_0x0209('0x29')];this[_0x0209('0x2a')]=_0x19bb67[_0x0209('0x2a')]||'';this[_0x0209('0x2b')]=_0x19bb67[_0x0209('0x2b')]||'';}module[_0x0209('0x2c')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index c6f7505..5351d90 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(_0x402a75,_0xc3c158){var _0x67c390=function(_0x299d76){while(--_0x299d76){_0x402a75['push'](_0x402a75['shift']());}};_0x67c390(++_0xc3c158);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x584fc8,_0x2028a1){var _0x2895ab=function(_0x33ca19){while(--_0x33ca19){_0x584fc8['push'](_0x584fc8['shift']());}};_0x2895ab(++_0x2028a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 a9ed8be..0ad1abc 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 _0xf448=['\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20failed','checkAfterSend','Trunk','isValid','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','format','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','syncVarSet','bind','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','originateresponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup'];(function(_0x240119,_0x3f926c){var _0x4ef4c4=function(_0xf321ef){while(--_0xf321ef){_0x240119['push'](_0x240119['shift']());}};_0x4ef4c4(++_0x3f926c);}(_0xf448,0x10a));var _0x8f44=function(_0x5c7c31,_0x22aa86){_0x5c7c31=_0x5c7c31-0x0;var _0x193fdf=_0xf448[_0x5c7c31];return _0x193fdf;};'use strict';var util=require(_0x8f44('0x0'));var _=require(_0x8f44('0x1'));var BPromise=require(_0x8f44('0x2'));var uuid=require(_0x8f44('0x3'));var moment=require(_0x8f44('0x4'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x8f44('0x5'));var logger=require(_0x8f44('0x6'))(_0x8f44('0x7'));var ami=require(_0x8f44('0x8'));var rpcDb=require(_0x8f44('0x9'));var Channel=require(_0x8f44('0xa'));var ut=require(_0x8f44('0xb'));var Action=require(_0x8f44('0xc'));var faxAccount=require(_0x8f44('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x8f44('0xe'));function Fax(_0x2bd192){this[_0x8f44('0xf')]={};this[_0x8f44('0x10')]=_0x2bd192[_0x8f44('0x10')];this[_0x8f44('0x11')]=_0x2bd192['trunks'];this[_0x8f44('0x12')]={};ami['on']('newchannel',this[_0x8f44('0x13')]['bind'](this));ami['on']('varset',this[_0x8f44('0x14')][_0x8f44('0x15')](this));ami['on']('newstate',this['syncNewState'][_0x8f44('0x15')](this));ami['on'](_0x8f44('0x16'),this[_0x8f44('0x17')]['bind'](this));ami['on']('faxstatus',this[_0x8f44('0x18')][_0x8f44('0x15')](this));ami['on']('receivefax',this[_0x8f44('0x19')][_0x8f44('0x15')](this));ami['on'](_0x8f44('0x1a'),this['syncHangup'][_0x8f44('0x15')](this));ami['on'](_0x8f44('0x1b'),this['syncOriginateResponse']['bind'](this));}Fax[_0x8f44('0x1c')][_0x8f44('0x13')]=function(_0x2516c7){if(_0x2516c7['context']===_0x8f44('0x1d')){for(var _0x365db6 in this[_0x8f44('0x10')]){if(this[_0x8f44('0x10')][_0x8f44('0x1e')](_0x365db6)){if(_0x2516c7[_0x8f44('0x1f')]===this[_0x8f44('0x10')][_0x365db6][_0x8f44('0x20')]){this[_0x8f44('0xf')][_0x2516c7[_0x8f44('0x21')]]={};this[_0x8f44('0xf')][_0x2516c7[_0x8f44('0x21')]][_0x8f44('0x22')]=_0x2516c7[_0x8f44('0x22')];this[_0x8f44('0xf')][_0x2516c7[_0x8f44('0x21')]]['id']=this[_0x8f44('0x10')][_0x365db6]['id'];this[_0x8f44('0xf')][_0x2516c7[_0x8f44('0x21')]][_0x8f44('0x23')]=this[_0x8f44('0x10')][_0x365db6]['name'];logger['info'](_0x2516c7[_0x8f44('0x21')],_0x8f44('0x24'));}}}}if(this[_0x8f44('0x12')][_0x2516c7['uniqueid']]){this['channels'][_0x2516c7['uniqueid']]={};this['channels'][_0x2516c7[_0x8f44('0x21')]][_0x8f44('0x22')]=_0x2516c7[_0x8f44('0x22')];logger[_0x8f44('0x25')](_0x2516c7[_0x8f44('0x21')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x8f44('0x14')]=function(_0x4bacdf){if(this[_0x8f44('0xf')][_0x4bacdf[_0x8f44('0x21')]]){for(var _0x169695 in _0x4bacdf[_0x8f44('0x26')]){if(_0x4bacdf['variable'][_0x8f44('0x1e')](_0x169695)){this[_0x8f44('0xf')][_0x4bacdf[_0x8f44('0x21')]][_0x169695]=_0x4bacdf[_0x8f44('0x27')];}}}};Fax[_0x8f44('0x1c')]['syncNewState']=function(_0x3dbfb2){if(this['channels'][_0x3dbfb2[_0x8f44('0x21')]]){this['channels'][_0x3dbfb2[_0x8f44('0x21')]][_0x8f44('0x28')]=_0x3dbfb2[_0x8f44('0x28')];this[_0x8f44('0xf')][_0x3dbfb2[_0x8f44('0x21')]][_0x8f44('0x29')]=_0x3dbfb2[_0x8f44('0x29')];}};Fax[_0x8f44('0x1c')]['syncNewExten']=function(_0x16d8ad){if(this['channels'][_0x16d8ad[_0x8f44('0x21')]]){for(var _0x3f042e in _0x16d8ad['variable']){if(_0x16d8ad[_0x8f44('0x26')][_0x8f44('0x1e')](_0x3f042e)){this[_0x8f44('0xf')][_0x16d8ad[_0x8f44('0x21')]][_0x3f042e]=_0x16d8ad[_0x8f44('0x27')];}}}};Fax[_0x8f44('0x1c')]['syncFaxStatus']=function(_0x316ff9){if(this[_0x8f44('0xf')][_0x316ff9[_0x8f44('0x21')]]){this['channels'][_0x316ff9['uniqueid']]['operation']=_0x316ff9[_0x8f44('0x2a')];this['channels'][_0x316ff9[_0x8f44('0x21')]][_0x8f44('0x2b')]=_0x316ff9[_0x8f44('0x2b')];this[_0x8f44('0xf')][_0x316ff9['uniqueid']][_0x8f44('0x20')]=_0x316ff9[_0x8f44('0x20')];this[_0x8f44('0xf')][_0x316ff9[_0x8f44('0x21')]]['filename']=_0x316ff9[_0x8f44('0x2c')];logger['info'](_0x316ff9['uniqueid'],_0x8f44('0x2d'));}};Fax[_0x8f44('0x1c')]['syncReceiveFax']=function(_0x5499be){var _0x29e666=this;if(this[_0x8f44('0xf')][_0x5499be[_0x8f44('0x21')]]){var _0x58a9d7=this[_0x8f44('0xf')][_0x5499be['uniqueid']]['id'];this[_0x8f44('0xf')][_0x5499be[_0x8f44('0x21')]][_0x8f44('0x2e')]=_0x5499be['remotestationid'];this['channels'][_0x5499be[_0x8f44('0x21')]][_0x8f44('0x2f')]=_0x5499be['pagestransferred'];this[_0x8f44('0xf')][_0x5499be[_0x8f44('0x21')]]['localstationid']=_0x5499be[_0x8f44('0x20')];this[_0x8f44('0xf')][_0x5499be[_0x8f44('0x21')]][_0x8f44('0x30')]=_0x5499be['resolution'];this['channels'][_0x5499be['uniqueid']][_0x8f44('0x31')]=_0x5499be['transferrate'];this[_0x8f44('0xf')][_0x5499be[_0x8f44('0x21')]][_0x8f44('0x2c')]=_0x5499be[_0x8f44('0x2c')];this[_0x8f44('0xf')][_0x5499be[_0x8f44('0x21')]][_0x8f44('0x32')]=_0x5499be[_0x8f44('0x32')];if(this[_0x8f44('0xf')][_0x5499be[_0x8f44('0x21')]][_0x8f44('0x2f')]>0x0){tiff2pdf(_0x5499be[_0x8f44('0x2c')],_0x8f44('0x33'),function(_0x261e35){logger[_0x8f44('0x25')](_0x5499be[_0x8f44('0x21')],_0x8f44('0x34'),_0x261e35['message']);attachment['create']({'name':path['parse'](_0x5499be[_0x8f44('0x2c')])[_0x8f44('0x23')],'basename':path[_0x8f44('0x35')](_0x5499be['filename'])['name']+_0x8f44('0x36'),'type':_0x8f44('0x37')})[_0x8f44('0x38')](function(_0x5cdd83){faxAccount[_0x8f44('0x39')](_0x58a9d7,{'from':_0x5499be['calleridnum'],'mapKey':'fax','body':path['parse'](_0x5499be['filename'])[_0x8f44('0x23')]+'.pdf','AttachmentId':_0x5cdd83['id']})[_0x8f44('0x3a')](function(_0x1dc9d0){logger[_0x8f44('0x3b')](_0x5499be[_0x8f44('0x21')],_0x8f44('0x3c'),JSON[_0x8f44('0x3d')](_0x1dc9d0));});})['catch'](function(_0x38d7c4){logger['error'](_0x5499be[_0x8f44('0x21')],_0x8f44('0x3e'),JSON[_0x8f44('0x3d')](_0x38d7c4));});});}logger[_0x8f44('0x25')](_0x5499be[_0x8f44('0x21')],_0x8f44('0x3e'));}};Fax[_0x8f44('0x1c')][_0x8f44('0x3f')]=function(_0x3f42c7){if(this[_0x8f44('0x12')][_0x3f42c7[_0x8f44('0x21')]]){_[_0x8f44('0x40')](this[_0x8f44('0xf')][_0x3f42c7[_0x8f44('0x21')]],_[_0x8f44('0x41')](_0x3f42c7,[_0x8f44('0x42'),_0x8f44('0x43')]));}};function updateStatus(_0x472a58){if(_0x472a58[_0x8f44('0x44')]){faxMessage['update'](_0x472a58['AttachmentId'],{'failMessage':_0x8f44('0x45')})[_0x8f44('0x38')](function(_0x49b7a4){ut[_0x8f44('0x46')](_0x8f44('0x47'),_0x49b7a4);})['catch'](function(_0x550252){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x550252);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x8f44('0x1c')][_0x8f44('0x48')]=function(_0x5d0735,_0x4b1113,_0x2b55db){var _0x47e943=this;var _0x2eb729={};if(_0x4b1113){_0x2eb729={'read':_0x4b1113};}else{_0x2eb729={'failMessage':_0x2b55db};}if(this['actions'][_0x5d0735][_0x8f44('0x44')]){faxMessage[_0x8f44('0x49')](this[_0x8f44('0x12')][_0x5d0735][_0x8f44('0x44')],_0x2eb729)[_0x8f44('0x38')](function(_0x4d2afa){ut[_0x8f44('0x46')](_0x8f44('0x4a'),_0x4d2afa);})[_0x8f44('0x3a')](function(_0x5879b0){ut['logger'](_0x8f44('0x4b'),_0x5879b0);})[_0x8f44('0x4c')](function(){delete _0x47e943[_0x8f44('0xf')][_0x5d0735];delete _0x47e943[_0x8f44('0x12')][_0x5d0735];});}else{ut[_0x8f44('0x46')](_0x8f44('0x4d'));delete this['channels'][_0x5d0735];delete this[_0x8f44('0x12')][_0x5d0735];}};Fax[_0x8f44('0x1c')][_0x8f44('0x4e')]=function(_0x2df32c){var _0x329c37=this;if(this[_0x8f44('0xf')][_0x2df32c['uniqueid']]){if(this[_0x8f44('0x12')][_0x2df32c[_0x8f44('0x21')]]){this['channels'][_0x2df32c[_0x8f44('0x21')]]['id']=this['actions'][_0x2df32c['uniqueid']]['id'];this[_0x8f44('0xf')][_0x2df32c['uniqueid']][_0x8f44('0x23')]=this[_0x8f44('0x12')][_0x2df32c[_0x8f44('0x21')]][_0x8f44('0x23')];}logger[_0x8f44('0x25')](_0x2df32c[_0x8f44('0x21')],this[_0x8f44('0x12')][_0x2df32c['uniqueid']]?_0x8f44('0x4f'):_0x8f44('0x50'),JSON[_0x8f44('0x3d')](this[_0x8f44('0xf')][_0x2df32c[_0x8f44('0x21')]]));if(this[_0x8f44('0x12')][_0x2df32c[_0x8f44('0x21')]]){if(this[_0x8f44('0xf')][_0x2df32c[_0x8f44('0x21')]]['faxpages']>0x0&&this['channels'][_0x2df32c[_0x8f44('0x21')]][_0x8f44('0x51')]===_0x8f44('0x52')){this[_0x8f44('0x48')](_0x2df32c[_0x8f44('0x21')],!![]);}else{this['updateStatus'](_0x2df32c[_0x8f44('0x21')],![],this[_0x8f44('0xf')][_0x2df32c['uniqueid']]['faxstatusstring']?_0x8f44('0x53')+this[_0x8f44('0xf')][_0x2df32c[_0x8f44('0x21')]][_0x8f44('0x54')]:'SENDING\x20FAILED');}}}};Fax[_0x8f44('0x1c')][_0x8f44('0x55')]=function(_0x1982ab){var _0x27360f=this;return new BPromise(function(_0x5bc436,_0x3fae2a){_0x27360f[_0x8f44('0x56')](_0x1982ab,_0x27360f[_0x8f44('0x10')][_0x1982ab[_0x8f44('0x57')]])[_0x8f44('0x38')](function(_0x1427e0){ut['logger'](_0x8f44('0x58'),_0x1427e0);_0x5bc436(ut[_0x8f44('0x59')]('Fax\x20received'));})[_0x8f44('0x3a')](function(_0x2f941d){ut['logger']('[Fax][execOriginate][failure]',_0x2f941d);updateStatus(_0x1982ab);_0x3fae2a(ut[_0x8f44('0x59')](_0x8f44('0x5a')));});});};Fax[_0x8f44('0x1c')][_0x8f44('0x5b')]=function(_0x32a1f1){var _0x5ad254=this;return new BPromise(function(_0x12adc9,_0x768689){var _0x5baa51=_0x5ad254['checkTrunk'](_0x5ad254['faxAccounts'][_0x32a1f1[_0x8f44('0x57')]][_0x8f44('0x5c')],_0x32a1f1);if(_0x5baa51[_0x8f44('0x5d')]){_0x12adc9(ut[_0x8f44('0x59')]('Trunk\x20Reachable'));}else{_0x768689(ut[_0x8f44('0x59')](_0x5baa51[_0x8f44('0x59')]));}});};function originate(_0x43e60e,_0x38dbb9,_0x5e4d33){return new BPromise(function(_0x5978b8,_0x433cb1){if(_0x5e4d33){var _0x4d3797=util['format'](_0x8f44('0x5e'),path['parse'](_0x43e60e['path'])['name'],_0x43e60e[_0x8f44('0x5f')]);gs[_0x8f44('0x60')](_0x4d3797)[_0x8f44('0x38')](function(){_0x43e60e[_0x8f44('0x5f')]=util['format'](_0x8f44('0x61'),path[_0x8f44('0x35')](_0x43e60e['path'])[_0x8f44('0x62')],path[_0x8f44('0x35')](_0x43e60e[_0x8f44('0x5f')])['name']);_0x38dbb9['XMF-PATH']=_0x43e60e[_0x8f44('0x5f')];ut[_0x8f44('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0x8f44('0x63')](ut[_0x8f44('0x64')](_0x43e60e,_0x38dbb9))[_0x8f44('0x38')](function(_0x60595b){_0x5978b8(_0x60595b);})[_0x8f44('0x3a')](function(_0xb070e9){_0x433cb1(_0xb070e9);});})[_0x8f44('0x3a')](function(_0x87761c){_0x433cb1(_0x87761c);});}else{ami[_0x8f44('0x63')](ut['variablesAction'](_0x43e60e,_0x38dbb9))[_0x8f44('0x38')](function(_0xb77c89){_0x5978b8(_0xb77c89);})['catch'](function(_0x4c1ba5){_0x433cb1(_0x4c1ba5);});}});}Fax['prototype'][_0x8f44('0x56')]=function(_0x365df1,_0x2d7ae6){var _0x1cede8=this;return new BPromise(function(_0x272996,_0x13c899){var _0x3d7eba=uuid['v4']();var _0x4bbc95=ut[_0x8f44('0x65')](_0x365df1,_0x2d7ae6);_0x1cede8[_0x8f44('0x12')][_0x3d7eba]=new Action(_0x3d7eba,_0x2d7ae6,_0x365df1);var _0x527f85=_0x1cede8[_0x8f44('0x12')][_0x3d7eba];if(path[_0x8f44('0x35')](_0x365df1[_0x8f44('0x5f')])['ext']===_0x8f44('0x36')){originate(_0x527f85,_0x4bbc95,!![])['then'](function(_0x3f1efe){_0x272996(_0x3f1efe);})[_0x8f44('0x3a')](function(_0x200a0f){_0x13c899(_0x200a0f);});}else{originate(_0x527f85,_0x4bbc95,![])[_0x8f44('0x38')](function(_0x4fc5df){_0x272996(_0x4fc5df);})[_0x8f44('0x3a')](function(_0x4f10ee){_0x13c899(_0x4f10ee);});}});};Fax[_0x8f44('0x1c')][_0x8f44('0x66')]=function(_0x59eff6){return!_['isNil'](_0x59eff6)&&!_[_0x8f44('0x67')](_0x59eff6[_0x8f44('0x23')])&&!_[_0x8f44('0x67')](_0x59eff6[_0x8f44('0x68')])&&_0x59eff6['active']&&!_['isNil'](this['trunks'][util[_0x8f44('0x69')](_0x8f44('0x6a'),_0x59eff6[_0x8f44('0x23')])])&&!_[_0x8f44('0x67')](this[_0x8f44('0x11')][util[_0x8f44('0x69')](_0x8f44('0x6a'),_0x59eff6[_0x8f44('0x23')])][_0x8f44('0x2b')])&&(this[_0x8f44('0x11')][util[_0x8f44('0x69')]('SIP/%s',_0x59eff6[_0x8f44('0x23')])][_0x8f44('0x2b')]==='reachable'||this[_0x8f44('0x11')][util[_0x8f44('0x69')](_0x8f44('0x6a'),_0x59eff6['name'])]['status']===_0x8f44('0x6b'));};Fax['prototype'][_0x8f44('0x6c')]=function(_0x5694a6,_0x2e5280){if(!this[_0x8f44('0x66')](_0x5694a6)){ut[_0x8f44('0x46')](_0x8f44('0x6d'),_['isNil'](_0x5694a6)?'':_0x5694a6['name']+_0x8f44('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x2e5280[_0x8f44('0x7')])){ut['logger'](_0x8f44('0x6f'),JSON[_0x8f44('0x3d')](_0x2e5280));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x8f44('0x67')](_0x2e5280[_0x8f44('0x5f')])){ut[_0x8f44('0x46')](_0x8f44('0x70'),JSON[_0x8f44('0x3d')](_0x2e5280));return{'isValid':![],'message':_0x8f44('0x71')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x8f44('0x72')]=Fax; \ No newline at end of file +var _0xc040=['\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','actions','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','syncNewchannel','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','value','operation','status','filename'];(function(_0x4c6336,_0x2aae4b){var _0x312666=function(_0x8a93eb){while(--_0x8a93eb){_0x4c6336['push'](_0x4c6336['shift']());}};_0x312666(++_0x2aae4b);}(_0xc040,0xba));var _0x0c04=function(_0xa2d78d,_0x469d07){_0xa2d78d=_0xa2d78d-0x0;var _0x31f7bf=_0xc040[_0xa2d78d];return _0x31f7bf;};'use strict';var util=require(_0x0c04('0x0'));var _=require(_0x0c04('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x0c04('0x2'));var path=require(_0x0c04('0x3'));var tiff2pdf=require(_0x0c04('0x4'));var gs=require(_0x0c04('0x5'));var logger=require(_0x0c04('0x6'))(_0x0c04('0x7'));var ami=require('../ami');var rpcDb=require(_0x0c04('0x8'));var Channel=require(_0x0c04('0x9'));var ut=require(_0x0c04('0xa'));var Action=require(_0x0c04('0xb'));var faxAccount=require(_0x0c04('0xc'));var attachment=require(_0x0c04('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x1266f1){this[_0x0c04('0xe')]={};this[_0x0c04('0xf')]=_0x1266f1['faxAccounts'];this['trunks']=_0x1266f1['trunks'];this[_0x0c04('0x10')]={};ami['on']('newchannel',this['syncNewchannel']['bind'](this));ami['on'](_0x0c04('0x11'),this[_0x0c04('0x12')][_0x0c04('0x13')](this));ami['on'](_0x0c04('0x14'),this[_0x0c04('0x15')][_0x0c04('0x13')](this));ami['on'](_0x0c04('0x16'),this[_0x0c04('0x17')]['bind'](this));ami['on'](_0x0c04('0x18'),this[_0x0c04('0x19')][_0x0c04('0x13')](this));ami['on'](_0x0c04('0x1a'),this[_0x0c04('0x1b')][_0x0c04('0x13')](this));ami['on'](_0x0c04('0x1c'),this[_0x0c04('0x1d')][_0x0c04('0x13')](this));ami['on'](_0x0c04('0x1e'),this['syncOriginateResponse'][_0x0c04('0x13')](this));}Fax[_0x0c04('0x1f')][_0x0c04('0x20')]=function(_0x51cc3c){if(_0x51cc3c[_0x0c04('0x21')]===_0x0c04('0x22')){for(var _0x53eecd in this['faxAccounts']){if(this[_0x0c04('0xf')]['hasOwnProperty'](_0x53eecd)){if(_0x51cc3c[_0x0c04('0x23')]===this[_0x0c04('0xf')][_0x53eecd][_0x0c04('0x24')]){this[_0x0c04('0xe')][_0x51cc3c[_0x0c04('0x25')]]={};this[_0x0c04('0xe')][_0x51cc3c['uniqueid']][_0x0c04('0x26')]=_0x51cc3c[_0x0c04('0x26')];this['channels'][_0x51cc3c[_0x0c04('0x25')]]['id']=this[_0x0c04('0xf')][_0x53eecd]['id'];this['channels'][_0x51cc3c['uniqueid']][_0x0c04('0x27')]=this[_0x0c04('0xf')][_0x53eecd][_0x0c04('0x27')];logger[_0x0c04('0x28')](_0x51cc3c[_0x0c04('0x25')],'\x20syncNewchannel\x20');}}}}if(this[_0x0c04('0x10')][_0x51cc3c['uniqueid']]){this[_0x0c04('0xe')][_0x51cc3c[_0x0c04('0x25')]]={};this[_0x0c04('0xe')][_0x51cc3c['uniqueid']][_0x0c04('0x26')]=_0x51cc3c[_0x0c04('0x26')];logger[_0x0c04('0x28')](_0x51cc3c[_0x0c04('0x25')],_0x0c04('0x29'));}};Fax[_0x0c04('0x1f')]['syncVarSet']=function(_0x1a91fc){if(this[_0x0c04('0xe')][_0x1a91fc[_0x0c04('0x25')]]){for(var _0x1d44e9 in _0x1a91fc[_0x0c04('0x2a')]){if(_0x1a91fc[_0x0c04('0x2a')][_0x0c04('0x2b')](_0x1d44e9)){this['channels'][_0x1a91fc[_0x0c04('0x25')]][_0x1d44e9]=_0x1a91fc['value'];}}}};Fax[_0x0c04('0x1f')][_0x0c04('0x15')]=function(_0x27619b){if(this[_0x0c04('0xe')][_0x27619b[_0x0c04('0x25')]]){this[_0x0c04('0xe')][_0x27619b[_0x0c04('0x25')]]['channelstate']=_0x27619b[_0x0c04('0x2c')];this[_0x0c04('0xe')][_0x27619b[_0x0c04('0x25')]][_0x0c04('0x2d')]=_0x27619b[_0x0c04('0x2d')];}};Fax[_0x0c04('0x1f')][_0x0c04('0x17')]=function(_0x15f719){if(this[_0x0c04('0xe')][_0x15f719[_0x0c04('0x25')]]){for(var _0x27d807 in _0x15f719[_0x0c04('0x2a')]){if(_0x15f719['variable'][_0x0c04('0x2b')](_0x27d807)){this[_0x0c04('0xe')][_0x15f719[_0x0c04('0x25')]][_0x27d807]=_0x15f719[_0x0c04('0x2e')];}}}};Fax[_0x0c04('0x1f')][_0x0c04('0x19')]=function(_0x2a8541){if(this[_0x0c04('0xe')][_0x2a8541[_0x0c04('0x25')]]){this['channels'][_0x2a8541[_0x0c04('0x25')]][_0x0c04('0x2f')]=_0x2a8541[_0x0c04('0x2f')];this[_0x0c04('0xe')][_0x2a8541[_0x0c04('0x25')]][_0x0c04('0x30')]=_0x2a8541[_0x0c04('0x30')];this[_0x0c04('0xe')][_0x2a8541[_0x0c04('0x25')]]['localstationid']=_0x2a8541['localstationid'];this[_0x0c04('0xe')][_0x2a8541[_0x0c04('0x25')]]['filename']=_0x2a8541[_0x0c04('0x31')];logger[_0x0c04('0x28')](_0x2a8541['uniqueid'],_0x0c04('0x32'));}};Fax['prototype']['syncReceiveFax']=function(_0x38be17){var _0x48a808=this;if(this[_0x0c04('0xe')][_0x38be17['uniqueid']]){var _0x2baef3=this[_0x0c04('0xe')][_0x38be17[_0x0c04('0x25')]]['id'];this[_0x0c04('0xe')][_0x38be17['uniqueid']][_0x0c04('0x33')]=_0x38be17[_0x0c04('0x33')];this[_0x0c04('0xe')][_0x38be17[_0x0c04('0x25')]][_0x0c04('0x34')]=_0x38be17[_0x0c04('0x34')];this[_0x0c04('0xe')][_0x38be17[_0x0c04('0x25')]][_0x0c04('0x24')]=_0x38be17[_0x0c04('0x24')];this['channels'][_0x38be17[_0x0c04('0x25')]]['resolution']=_0x38be17['resolution'];this[_0x0c04('0xe')][_0x38be17['uniqueid']]['transferrate']=_0x38be17[_0x0c04('0x35')];this[_0x0c04('0xe')][_0x38be17[_0x0c04('0x25')]][_0x0c04('0x31')]=_0x38be17['filename'];this[_0x0c04('0xe')][_0x38be17[_0x0c04('0x25')]][_0x0c04('0x36')]=_0x38be17[_0x0c04('0x36')];if(this['channels'][_0x38be17['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x38be17[_0x0c04('0x31')],_0x0c04('0x37'),function(_0x15830d){logger[_0x0c04('0x28')](_0x38be17[_0x0c04('0x25')],'\x20result\x20conversion\x20file\x20',_0x15830d[_0x0c04('0x38')]);attachment[_0x0c04('0x39')]({'name':path['parse'](_0x38be17[_0x0c04('0x31')])[_0x0c04('0x27')],'basename':path[_0x0c04('0x3a')](_0x38be17[_0x0c04('0x31')])['name']+_0x0c04('0x3b'),'type':_0x0c04('0x3c')})[_0x0c04('0x3d')](function(_0xb4a8b2){faxAccount[_0x0c04('0x3e')](_0x2baef3,{'from':_0x38be17[_0x0c04('0x36')],'mapKey':_0x0c04('0x7'),'body':path[_0x0c04('0x3a')](_0x38be17[_0x0c04('0x31')])[_0x0c04('0x27')]+_0x0c04('0x3b'),'AttachmentId':_0xb4a8b2['id']})[_0x0c04('0x3f')](function(_0x222067){logger[_0x0c04('0x40')](_0x38be17[_0x0c04('0x25')],'\x20notify\x20',JSON[_0x0c04('0x41')](_0x222067));});})[_0x0c04('0x3f')](function(_0x2b6915){logger[_0x0c04('0x40')](_0x38be17[_0x0c04('0x25')],'\x20receiveFax\x20',JSON['stringify'](_0x2b6915));});});}logger[_0x0c04('0x28')](_0x38be17[_0x0c04('0x25')],_0x0c04('0x42'));}};Fax[_0x0c04('0x1f')][_0x0c04('0x43')]=function(_0x3f031c){if(this[_0x0c04('0x10')][_0x3f031c['uniqueid']]){_[_0x0c04('0x44')](this[_0x0c04('0xe')][_0x3f031c[_0x0c04('0x25')]],_[_0x0c04('0x45')](_0x3f031c,[_0x0c04('0x46'),'reason']));}};function updateStatus(_0xf7b924){if(_0xf7b924[_0x0c04('0x47')]){faxMessage[_0x0c04('0x48')](_0xf7b924[_0x0c04('0x47')],{'failMessage':_0x0c04('0x49')})[_0x0c04('0x3d')](function(_0x17394c){ut[_0x0c04('0x4a')](_0x0c04('0x4b'),_0x17394c);})[_0x0c04('0x3f')](function(_0x364797){ut[_0x0c04('0x4a')](_0x0c04('0x4c'),_0x364797);});}else{ut[_0x0c04('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x0c04('0x1f')][_0x0c04('0x4d')]=function(_0x1c1917,_0x4bd04b,_0x2b1c81){var _0x5dc22a=this;var _0xf0a3a0={};if(_0x4bd04b){_0xf0a3a0={'read':_0x4bd04b};}else{_0xf0a3a0={'failMessage':_0x2b1c81};}if(this['actions'][_0x1c1917][_0x0c04('0x47')]){faxMessage[_0x0c04('0x48')](this[_0x0c04('0x10')][_0x1c1917]['AttachmentId'],_0xf0a3a0)[_0x0c04('0x3d')](function(_0x4669b4){ut[_0x0c04('0x4a')](_0x0c04('0x4e'),_0x4669b4);})[_0x0c04('0x3f')](function(_0x35b474){ut[_0x0c04('0x4a')](_0x0c04('0x4f'),_0x35b474);})[_0x0c04('0x50')](function(){delete _0x5dc22a[_0x0c04('0xe')][_0x1c1917];delete _0x5dc22a[_0x0c04('0x10')][_0x1c1917];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x0c04('0xe')][_0x1c1917];delete this[_0x0c04('0x10')][_0x1c1917];}};Fax[_0x0c04('0x1f')][_0x0c04('0x1d')]=function(_0x2c9e8c){var _0x1a10f7=this;if(this[_0x0c04('0xe')][_0x2c9e8c['uniqueid']]){if(this['actions'][_0x2c9e8c[_0x0c04('0x25')]]){this['channels'][_0x2c9e8c[_0x0c04('0x25')]]['id']=this[_0x0c04('0x10')][_0x2c9e8c[_0x0c04('0x25')]]['id'];this[_0x0c04('0xe')][_0x2c9e8c[_0x0c04('0x25')]][_0x0c04('0x27')]=this[_0x0c04('0x10')][_0x2c9e8c[_0x0c04('0x25')]][_0x0c04('0x27')];}logger[_0x0c04('0x28')](_0x2c9e8c[_0x0c04('0x25')],this[_0x0c04('0x10')][_0x2c9e8c[_0x0c04('0x25')]]?_0x0c04('0x51'):_0x0c04('0x52'),JSON[_0x0c04('0x41')](this['channels'][_0x2c9e8c['uniqueid']]));if(this[_0x0c04('0x10')][_0x2c9e8c[_0x0c04('0x25')]]){if(this[_0x0c04('0xe')][_0x2c9e8c[_0x0c04('0x25')]][_0x0c04('0x53')]>0x0&&this[_0x0c04('0xe')][_0x2c9e8c[_0x0c04('0x25')]]['faxstatus']===_0x0c04('0x54')){this[_0x0c04('0x4d')](_0x2c9e8c[_0x0c04('0x25')],!![]);}else{this['updateStatus'](_0x2c9e8c[_0x0c04('0x25')],![],this['channels'][_0x2c9e8c[_0x0c04('0x25')]][_0x0c04('0x55')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x2c9e8c[_0x0c04('0x25')]][_0x0c04('0x55')]:'SENDING\x20FAILED');}}}};Fax[_0x0c04('0x1f')][_0x0c04('0x56')]=function(_0x410e3e){var _0x5f28b5=this;return new BPromise(function(_0x3bb9d5,_0x5b33a0){_0x5f28b5[_0x0c04('0x57')](_0x410e3e,_0x5f28b5[_0x0c04('0xf')][_0x410e3e[_0x0c04('0x58')]])[_0x0c04('0x3d')](function(_0x4db12a){ut[_0x0c04('0x4a')](_0x0c04('0x59'),_0x4db12a);_0x3bb9d5(ut[_0x0c04('0x38')](_0x0c04('0x5a')));})[_0x0c04('0x3f')](function(_0x91e9b2){ut[_0x0c04('0x4a')](_0x0c04('0x5b'),_0x91e9b2);updateStatus(_0x410e3e);_0x5b33a0(ut['message'](_0x0c04('0x5c')));});});};Fax[_0x0c04('0x1f')]['checkAfterSend']=function(_0x578b88){var _0x211116=this;return new BPromise(function(_0xbf0995,_0x291916){var _0x4ecc12=_0x211116[_0x0c04('0x5d')](_0x211116[_0x0c04('0xf')][_0x578b88[_0x0c04('0x58')]]['Trunk'],_0x578b88);if(_0x4ecc12[_0x0c04('0x5e')]){_0xbf0995(ut[_0x0c04('0x38')](_0x0c04('0x5f')));}else{_0x291916(ut[_0x0c04('0x38')](_0x4ecc12[_0x0c04('0x38')]));}});};function originate(_0x40c907,_0x20906f,_0xee05b6){return new BPromise(function(_0x247b4f,_0x544b10){if(_0xee05b6){var _0x10178e=util[_0x0c04('0x60')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x40c907[_0x0c04('0x3')])['name'],_0x40c907[_0x0c04('0x3')]);gs[_0x0c04('0x61')](_0x10178e)[_0x0c04('0x3d')](function(){_0x40c907[_0x0c04('0x3')]=util[_0x0c04('0x60')](_0x0c04('0x62'),path[_0x0c04('0x3a')](_0x40c907[_0x0c04('0x3')])['dir'],path[_0x0c04('0x3a')](_0x40c907[_0x0c04('0x3')])['name']);_0x20906f[_0x0c04('0x63')]=_0x40c907[_0x0c04('0x3')];ut['logger'](_0x0c04('0x64'),'');ami[_0x0c04('0x65')](ut['variablesAction'](_0x40c907,_0x20906f))['then'](function(_0x2ac7f5){_0x247b4f(_0x2ac7f5);})[_0x0c04('0x3f')](function(_0x172ea4){_0x544b10(_0x172ea4);});})['catch'](function(_0x58a270){_0x544b10(_0x58a270);});}else{ami[_0x0c04('0x65')](ut[_0x0c04('0x66')](_0x40c907,_0x20906f))[_0x0c04('0x3d')](function(_0x720d2f){_0x247b4f(_0x720d2f);})[_0x0c04('0x3f')](function(_0x5a7901){_0x544b10(_0x5a7901);});}});}Fax[_0x0c04('0x1f')][_0x0c04('0x57')]=function(_0x46ced9,_0x5c1703){var _0x7abf55=this;return new BPromise(function(_0x5919b2,_0x209439){var _0xb9f6c5=uuid['v4']();var _0x3ec0bd=ut[_0x0c04('0x67')](_0x46ced9,_0x5c1703);_0x7abf55[_0x0c04('0x10')][_0xb9f6c5]=new Action(_0xb9f6c5,_0x5c1703,_0x46ced9);var _0x28277b=_0x7abf55[_0x0c04('0x10')][_0xb9f6c5];if(path[_0x0c04('0x3a')](_0x46ced9[_0x0c04('0x3')])[_0x0c04('0x68')]===_0x0c04('0x3b')){originate(_0x28277b,_0x3ec0bd,!![])[_0x0c04('0x3d')](function(_0xcb74b3){_0x5919b2(_0xcb74b3);})[_0x0c04('0x3f')](function(_0x212ac6){_0x209439(_0x212ac6);});}else{originate(_0x28277b,_0x3ec0bd,![])[_0x0c04('0x3d')](function(_0x21a94e){_0x5919b2(_0x21a94e);})['catch'](function(_0x3c0d1e){_0x209439(_0x3c0d1e);});}});};Fax[_0x0c04('0x1f')][_0x0c04('0x69')]=function(_0x3263d0){return!_[_0x0c04('0x6a')](_0x3263d0)&&!_[_0x0c04('0x6a')](_0x3263d0['name'])&&!_[_0x0c04('0x6a')](_0x3263d0[_0x0c04('0x6b')])&&_0x3263d0[_0x0c04('0x6b')]&&!_[_0x0c04('0x6a')](this[_0x0c04('0x6c')][util[_0x0c04('0x60')](_0x0c04('0x6d'),_0x3263d0[_0x0c04('0x27')])])&&!_[_0x0c04('0x6a')](this[_0x0c04('0x6c')][util[_0x0c04('0x60')](_0x0c04('0x6d'),_0x3263d0[_0x0c04('0x27')])][_0x0c04('0x30')])&&(this[_0x0c04('0x6c')][util['format'](_0x0c04('0x6d'),_0x3263d0[_0x0c04('0x27')])][_0x0c04('0x30')]===_0x0c04('0x6e')||this['trunks'][util[_0x0c04('0x60')](_0x0c04('0x6d'),_0x3263d0[_0x0c04('0x27')])][_0x0c04('0x30')]===_0x0c04('0x6f'));};Fax[_0x0c04('0x1f')][_0x0c04('0x5d')]=function(_0x32a23a,_0x27c7dd){if(!this[_0x0c04('0x69')](_0x32a23a)){ut[_0x0c04('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x0c04('0x6a')](_0x32a23a)?'':_0x32a23a[_0x0c04('0x27')]+_0x0c04('0x70'));return{'isValid':![],'message':_0x0c04('0x71')};}if(_[_0x0c04('0x6a')](_0x27c7dd['fax'])){ut[_0x0c04('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x0c04('0x41')](_0x27c7dd));return{'isValid':![],'message':_0x0c04('0x72')};}if(_['isNil'](_0x27c7dd['path'])){ut[_0x0c04('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x0c04('0x41')](_0x27c7dd));return{'isValid':![],'message':_0x0c04('0x73')};}return{'isValid':!![],'message':_0x0c04('0x74')};};module[_0x0c04('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index d5c83b4..ee01276 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 _0x8e39=['preview','../rpc/faxAccount','error','inspect','notify','then','catch','[Notify]\x20','bluebird','../../../config/logger'];(function(_0x49fde0,_0x10a16a){var _0x31e6e1=function(_0x204063){while(--_0x204063){_0x49fde0['push'](_0x49fde0['shift']());}};_0x31e6e1(++_0x10a16a);}(_0x8e39,0x1b6));var _0x98e3=function(_0x451d28,_0x1bca56){_0x451d28=_0x451d28-0x0;var _0x3a4497=_0x8e39[_0x451d28];return _0x3a4497;};'use strict';var util=require('util');var BPromise=require(_0x98e3('0x0'));var logger=require(_0x98e3('0x1'))(_0x98e3('0x2'));var _=require('lodash');var faxAccount=require(_0x98e3('0x3'));function loggerCatch(_0x6a4d88){return function(_0x5ace28){logger[_0x98e3('0x4')](_0x6a4d88,util[_0x98e3('0x5')](_0x5ace28,{'showHidden':![],'depth':null}));};}exports[_0x98e3('0x6')]=function(_0x318779,_0x117a8a){return BPromise['resolve']()[_0x98e3('0x7')](faxAccount[_0x98e3('0x6')](_0x318779,_0x117a8a))[_0x98e3('0x8')](loggerCatch(_0x98e3('0x9')));}; \ No newline at end of file +var _0x28a6=['[Notify]\x20','bluebird','../../../config/logger','preview','lodash','error','resolve','notify','catch'];(function(_0x3bc060,_0x5ee015){var _0x4489f5=function(_0x5be417){while(--_0x5be417){_0x3bc060['push'](_0x3bc060['shift']());}};_0x4489f5(++_0x5ee015);}(_0x28a6,0x1ba));var _0x628a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x28a6[_0x19950b];return _0x3c6b41;};'use strict';var util=require('util');var BPromise=require(_0x628a('0x0'));var logger=require(_0x628a('0x1'))(_0x628a('0x2'));var _=require(_0x628a('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x59bfac){return function(_0x14c252){logger[_0x628a('0x4')](_0x59bfac,util['inspect'](_0x14c252,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x103337,_0x5c79ce){return BPromise[_0x628a('0x5')]()['then'](faxAccount[_0x628a('0x6')](_0x103337,_0x5c79ce))[_0x628a('0x7')](loggerCatch(_0x628a('0x8')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index aff1c29..8d34010 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 _0xc41f=['exec','Exec\x20gs','info','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','child_process'];(function(_0x4a0919,_0x3de439){var _0x479ba8=function(_0xaa558){while(--_0xaa558){_0x4a0919['push'](_0x4a0919['shift']());}};_0x479ba8(++_0x3de439);}(_0xc41f,0xc2));var _0xfc41=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xc41f[_0x3b5049];return _0x12454e;};'use strict';var util=require('util');var logger=require(_0xfc41('0x0'))(_0xfc41('0x1'));var BPromise=require(_0xfc41('0x2'));var exec=require(_0xfc41('0x3'))[_0xfc41('0x4')];exports['execute']=function(_0x4b1192){return new BPromise(function(_0x119d29,_0x5b0588){exec(_0x4b1192,function(_0x3edbe0,_0x1adb6c,_0xcc2422){logger['info'](_0xfc41('0x5'),_0x1adb6c);if(_0x3edbe0){logger[_0xfc41('0x6')](_0xfc41('0x5'),_0xfc41('0x7'),util[_0xfc41('0x8')](_0x3edbe0,{'showHidden':![],'depth':null}),_0x1adb6c,_0xcc2422);_0x5b0588(_0x3edbe0);}_0x119d29(_0x1adb6c);});});}; \ No newline at end of file +var _0x2fcc=['exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','fax','bluebird','child_process'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x2fcc,0x189));var _0xc2fc=function(_0x40739c,_0x30baea){_0x40739c=_0x40739c-0x0;var _0x163d18=_0x2fcc[_0x40739c];return _0x163d18;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0xc2fc('0x0'));var BPromise=require(_0xc2fc('0x1'));var exec=require(_0xc2fc('0x2'))[_0xc2fc('0x3')];exports[_0xc2fc('0x4')]=function(_0x4d40ff){return new BPromise(function(_0x432397,_0x4ce6a4){exec(_0x4d40ff,function(_0x2a37f7,_0x5b145d,_0x4751a4){logger['info'](_0xc2fc('0x5'),_0x5b145d);if(_0x2a37f7){logger[_0xc2fc('0x6')](_0xc2fc('0x5'),_0xc2fc('0x7'),util[_0xc2fc('0x8')](_0x2a37f7,{'showHidden':![],'depth':null}),_0x5b145d,_0x4751a4);_0x4ce6a4(_0x2a37f7);}_0x432397(_0x5b145d);});});}; \ 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 e21c3dc..3424cb0 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 _0x60f2=['info','ecm','maxrate','format','modem','gateway','faxdetect','localstationid','path','uniqueid','originate','from-sip','headerinfo','util','lodash','../../../../config/logger','message','logger'];(function(_0x5d8086,_0x4f3f72){var _0x55857f=function(_0x406851){while(--_0x406851){_0x5d8086['push'](_0x5d8086['shift']());}};_0x55857f(++_0x4f3f72);}(_0x60f2,0x1bd));var _0x260f=function(_0x43830f,_0x49cf8f){_0x43830f=_0x43830f-0x0;var _0x3c4c7f=_0x60f2[_0x43830f];return _0x3c4c7f;};'use strict';var util=require(_0x260f('0x0'));var _=require(_0x260f('0x1'));var moment=require('moment');var logger=require(_0x260f('0x2'))('fax');exports[_0x260f('0x3')]=function(_0x31b72e){return{'message':_0x31b72e};};exports[_0x260f('0x4')]=function(_0x94ea0,_0x11819c){logger[_0x260f('0x5')](_0x94ea0,util['inspect'](_0x11819c,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4e44f0,_0x31c922){var _0x422728={'XMF-ECM':_0x31c922[_0x260f('0x6')],'XMF-HEADERINFO':_0x31c922['headerinfo'],'XMF-MINRATE':_0x31c922['minrate'],'XMF-MAXRATE':_0x31c922[_0x260f('0x7')],'XMF-MODEM':util[_0x260f('0x8')]('\x22%s\x22',_0x31c922[_0x260f('0x9')]),'XMF-GATEWAY':_0x31c922[_0x260f('0xa')],'XMF-FAXDETECT':_0x31c922[_0x260f('0xb')],'XMF-T38TIMEOUT':_0x31c922['t38timeout'],'XMF-LOCALSTATIONID':_0x31c922[_0x260f('0xc')],'XMF-PATH':_0x4e44f0[_0x260f('0xd')]};return _0x422728;};exports['variablesAction']=function(_0xf54004,_0x31164c){return{'actionid':_0xf54004[_0x260f('0xe')],'action':_0x260f('0xf'),'channel':_0xf54004['channel'],'Exten':'xcally-motion-fax','Context':_0x260f('0x10'),'Priority':'1','callerid':util[_0x260f('0x8')]('\x22%s\x22\x20<%s>',_0xf54004[_0x260f('0x11')]?_0xf54004[_0x260f('0x11')]:'',_0xf54004['localstationid']),'variable':_0x31164c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xf54004[_0x260f('0xe')]};}; \ No newline at end of file +var _0x645d=['info','inspect','addVariables','headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','format','uniqueid','util','lodash','moment','fax','message','logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x645d,0x192));var _0xd645=function(_0x16eb19,_0x58cea4){_0x16eb19=_0x16eb19-0x0;var _0x312a25=_0x645d[_0x16eb19];return _0x312a25;};'use strict';var util=require(_0xd645('0x0'));var _=require(_0xd645('0x1'));var moment=require(_0xd645('0x2'));var logger=require('../../../../config/logger')(_0xd645('0x3'));exports[_0xd645('0x4')]=function(_0x32044a){return{'message':_0x32044a};};exports[_0xd645('0x5')]=function(_0x67df89,_0x5610d9){logger[_0xd645('0x6')](_0x67df89,util[_0xd645('0x7')](_0x5610d9,{'showHidden':![],'depth':null}));};exports[_0xd645('0x8')]=function(_0x2b2a5b,_0x573ce5){var _0x4ffc04={'XMF-ECM':_0x573ce5['ecm'],'XMF-HEADERINFO':_0x573ce5[_0xd645('0x9')],'XMF-MINRATE':_0x573ce5['minrate'],'XMF-MAXRATE':_0x573ce5[_0xd645('0xa')],'XMF-MODEM':util['format'](_0xd645('0xb'),_0x573ce5[_0xd645('0xc')]),'XMF-GATEWAY':_0x573ce5[_0xd645('0xd')],'XMF-FAXDETECT':_0x573ce5[_0xd645('0xe')],'XMF-T38TIMEOUT':_0x573ce5[_0xd645('0xf')],'XMF-LOCALSTATIONID':_0x573ce5[_0xd645('0x10')],'XMF-PATH':_0x2b2a5b[_0xd645('0x11')]};return _0x4ffc04;};exports[_0xd645('0x12')]=function(_0x48bb1b,_0x364724){return{'actionid':_0x48bb1b['uniqueid'],'action':_0xd645('0x13'),'channel':_0x48bb1b[_0xd645('0x14')],'Exten':_0xd645('0x15'),'Context':'from-sip','Priority':'1','callerid':util[_0xd645('0x16')]('\x22%s\x22\x20<%s>',_0x48bb1b['headerinfo']?_0x48bb1b[_0xd645('0x9')]:'',_0x48bb1b['localstationid']),'variable':_0x364724,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x48bb1b[_0xd645('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 50528db..d3ed892 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 _0x1576=['getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','moment','./server','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','hour','get','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers'];(function(_0x60bfa8,_0x11b9a0){var _0x3151ec=function(_0x4f7203){while(--_0x4f7203){_0x60bfa8['push'](_0x60bfa8['shift']());}};_0x3151ec(++_0x11b9a0);}(_0x1576,0x67));var _0x6157=function(_0x4b7976,_0x55e10b){_0x4b7976=_0x4b7976-0x0;var _0x422298=_0x1576[_0x4b7976];return _0x422298;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0x6157('0x0'));var server=require(_0x6157('0x1'));var Realtime=require('./realtime');var Report=require(_0x6157('0x2'));var Acw=require('./acw');var Trigger=require(_0x6157('0x3'));var Dialer=require(_0x6157('0x4'));var Preview=require(_0x6157('0x5'));var Fax=require(_0x6157('0x6'));var user=require(_0x6157('0x7'));var voiceQueue=require(_0x6157('0x8'));var voiceQueueReport=require(_0x6157('0x9'));var voiceCallReport=require(_0x6157('0xa'));var trunk=require(_0x6157('0xb'));var trigger=require('./rpc/trigger');var template=require(_0x6157('0xc'));var cmHopperHistory=require(_0x6157('0xd'));var campaign=require(_0x6157('0xe'));var voiceExtension=require(_0x6157('0xf'));var faxAccount=require(_0x6157('0x10'));var zendesk=require(_0x6157('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x6157('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x6157('0x13'));var zoho=require(_0x6157('0x14'));var vtiger=require(_0x6157('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x6157('0x16'));var dynamics365=require(_0x6157('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6157('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x6157('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6157('0x1a')](_0x6157('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0x6157('0x1b')]())[_0x6157('0x1c')](realtime[_0x6157('0x1d')]())['then'](user[_0x6157('0x1e')]())[_0x6157('0x1c')](realtime[_0x6157('0x1f')]())[_0x6157('0x1c')](trunk[_0x6157('0x20')]())[_0x6157('0x1c')](realtime[_0x6157('0x21')]())[_0x6157('0x1c')](voiceQueue[_0x6157('0x22')]())[_0x6157('0x1c')](realtime[_0x6157('0x23')]())['then'](trigger[_0x6157('0x24')]())[_0x6157('0x1c')](realtime['initTriggers']())['then'](template[_0x6157('0x25')]())[_0x6157('0x1c')](realtime['initTemplates']())[_0x6157('0x1c')](zendesk[_0x6157('0x26')]())['then'](realtime[_0x6157('0x27')]())[_0x6157('0x1c')](salesforce[_0x6157('0x28')]())[_0x6157('0x1c')](realtime['initSalesforceAccounts']())[_0x6157('0x1c')](sugarcrm[_0x6157('0x29')]())['then'](realtime[_0x6157('0x2a')]())[_0x6157('0x1c')](freshdesk[_0x6157('0x2b')]())['then'](realtime[_0x6157('0x2c')]())[_0x6157('0x1c')](desk[_0x6157('0x2d')]())['then'](realtime['initDeskAccounts']())[_0x6157('0x1c')](zoho[_0x6157('0x2e')]())[_0x6157('0x1c')](realtime[_0x6157('0x2f')]())[_0x6157('0x1c')](vtiger[_0x6157('0x30')]())[_0x6157('0x1c')](realtime[_0x6157('0x31')]())[_0x6157('0x1c')](freshsales['getFreshsalesAccounts']())[_0x6157('0x1c')](realtime[_0x6157('0x32')]())['then'](servicenow[_0x6157('0x33')]())[_0x6157('0x1c')](realtime['initServicenowAccounts']())[_0x6157('0x1c')](dynamics365[_0x6157('0x34')]())[_0x6157('0x1c')](realtime['initDynamics365Accounts']())[_0x6157('0x1c')](campaign[_0x6157('0x35')]())['then'](realtime[_0x6157('0x36')]())[_0x6157('0x1c')](voiceExtension[_0x6157('0x37')]())[_0x6157('0x1c')](realtime[_0x6157('0x38')]())[_0x6157('0x1c')](faxAccount[_0x6157('0x39')]())[_0x6157('0x1c')](realtime[_0x6157('0x3a')]())[_0x6157('0x1c')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x6157('0x1c')](voiceQueueReport[_0x6157('0x3b')]())[_0x6157('0x1c')](realtime['initVoiceQueueReports']())[_0x6157('0x1c')](cmHopperHistory[_0x6157('0x3c')]())[_0x6157('0x1c')](realtime[_0x6157('0x3d')]())[_0x6157('0x1c')](cmHopperHistory[_0x6157('0x3e')]())['then'](realtime[_0x6157('0x3f')]())[_0x6157('0x1c')](voiceCallReport[_0x6157('0x40')]())['then'](realtime['initVoiceCallReports']())[_0x6157('0x41')](function(_0x142eaa){logger[_0x6157('0x42')](_0x6157('0x43'),util['inspect'](_0x142eaa,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6157('0x44')](realtime,preview,fax)[_0x6157('0x1c')](function(_0x5406c1){return initRealtime();})[_0x6157('0x1c')](function(){return initParams();})[_0x6157('0x1c')](function(){report[_0x6157('0x45')]();setInterval(initRealtime,0x1388);})[_0x6157('0x41')](function(_0x3b6d57){logger[_0x6157('0x42')]('[index.js][main]',util['inspect'](_0x3b6d57,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x3016=['initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts'];(function(_0x4e172d,_0x212d83){var _0x493c2e=function(_0x487ad4){while(--_0x487ad4){_0x4e172d['push'](_0x4e172d['shift']());}};_0x493c2e(++_0x212d83);}(_0x3016,0xfc));var _0x6301=function(_0x5f1222,_0x3bca88){_0x5f1222=_0x5f1222-0x0;var _0x47c7a0=_0x3016[_0x5f1222];return _0x47c7a0;};'use strict';var BPromise=require(_0x6301('0x0'));var util=require('util');var moment=require(_0x6301('0x1'));var server=require(_0x6301('0x2'));var Realtime=require(_0x6301('0x3'));var Report=require(_0x6301('0x4'));var Acw=require(_0x6301('0x5'));var Trigger=require(_0x6301('0x6'));var Dialer=require(_0x6301('0x7'));var Preview=require(_0x6301('0x8'));var Fax=require('./fax');var user=require(_0x6301('0x9'));var voiceQueue=require(_0x6301('0xa'));var voiceQueueReport=require(_0x6301('0xb'));var voiceCallReport=require(_0x6301('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0x6301('0xd'));var template=require(_0x6301('0xe'));var cmHopperHistory=require(_0x6301('0xf'));var campaign=require(_0x6301('0x10'));var voiceExtension=require(_0x6301('0x11'));var faxAccount=require(_0x6301('0x12'));var zendesk=require(_0x6301('0x13'));var salesforce=require(_0x6301('0x14'));var sugarcrm=require(_0x6301('0x15'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x6301('0x16'));var zoho=require(_0x6301('0x17'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x6301('0x18'));var servicenow=require(_0x6301('0x19'));var dynamics365=require(_0x6301('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6301('0x1b'))(_0x6301('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6301('0x1d')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6301('0x1d')](_0x6301('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x6301('0x1f')]()[_0x6301('0x20')](user['getAgents']())['then'](realtime['initAgents']())['then'](user['getTelephones']())[_0x6301('0x20')](realtime[_0x6301('0x21')]())[_0x6301('0x20')](trunk[_0x6301('0x22')]())[_0x6301('0x20')](realtime[_0x6301('0x23')]())['then'](voiceQueue[_0x6301('0x24')]())[_0x6301('0x20')](realtime[_0x6301('0x25')]())[_0x6301('0x20')](trigger[_0x6301('0x26')]())[_0x6301('0x20')](realtime[_0x6301('0x27')]())[_0x6301('0x20')](template['getTemplates']())[_0x6301('0x20')](realtime[_0x6301('0x28')]())[_0x6301('0x20')](zendesk[_0x6301('0x29')]())[_0x6301('0x20')](realtime[_0x6301('0x2a')]())[_0x6301('0x20')](salesforce[_0x6301('0x2b')]())[_0x6301('0x20')](realtime['initSalesforceAccounts']())[_0x6301('0x20')](sugarcrm[_0x6301('0x2c')]())[_0x6301('0x20')](realtime[_0x6301('0x2d')]())[_0x6301('0x20')](freshdesk[_0x6301('0x2e')]())[_0x6301('0x20')](realtime['initFreshdeskAccounts']())[_0x6301('0x20')](desk[_0x6301('0x2f')]())['then'](realtime[_0x6301('0x30')]())[_0x6301('0x20')](zoho[_0x6301('0x31')]())[_0x6301('0x20')](realtime[_0x6301('0x32')]())[_0x6301('0x20')](vtiger[_0x6301('0x33')]())['then'](realtime[_0x6301('0x34')]())[_0x6301('0x20')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x6301('0x35')]())[_0x6301('0x20')](servicenow[_0x6301('0x36')]())['then'](realtime[_0x6301('0x37')]())[_0x6301('0x20')](dynamics365[_0x6301('0x38')]())[_0x6301('0x20')](realtime['initDynamics365Accounts']())[_0x6301('0x20')](campaign[_0x6301('0x39')]())['then'](realtime[_0x6301('0x3a')]())[_0x6301('0x20')](voiceExtension[_0x6301('0x3b')]())[_0x6301('0x20')](realtime['initVoiceExtensions']())[_0x6301('0x20')](faxAccount[_0x6301('0x3c')]())[_0x6301('0x20')](realtime[_0x6301('0x3d')]())[_0x6301('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0x6301('0x1f')]()[_0x6301('0x20')](voiceQueueReport[_0x6301('0x3e')]())[_0x6301('0x20')](realtime[_0x6301('0x3f')]())[_0x6301('0x20')](cmHopperHistory[_0x6301('0x40')]())['then'](realtime[_0x6301('0x41')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x6301('0x20')](realtime[_0x6301('0x42')]())['then'](voiceCallReport[_0x6301('0x43')]())[_0x6301('0x20')](realtime[_0x6301('0x44')]())[_0x6301('0x45')](function(_0x481112){logger[_0x6301('0x46')](_0x6301('0x47'),util[_0x6301('0x48')](_0x481112,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6301('0x49')](realtime,preview,fax)['then'](function(_0x292b24){return initRealtime();})[_0x6301('0x20')](function(){return initParams();})[_0x6301('0x20')](function(){report[_0x6301('0x4a')]();setInterval(initRealtime,0x1388);})[_0x6301('0x45')](function(_0x4fe25a){logger[_0x6301('0x46')](_0x6301('0x4b'),util['inspect'](_0x4fe25a,{'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 709de72..2f0835e 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x2e5981,_0xe4e846){var _0x6e4fef=function(_0x252b0c){while(--_0x252b0c){_0x2e5981['push'](_0x2e5981['shift']());}};_0x6e4fef(++_0xe4e846);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 0c3efaf..2c3b7d7 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 _0xa870=['name','type','campaign','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','dialQueueProject','SquareProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa870,0xf0));var _0x0a87=function(_0x38b8bb,_0x3d9db0){_0x38b8bb=_0x38b8bb-0x0;var _0x2a14a1=_0xa870[_0x38b8bb];return _0x2a14a1;};'use strict';function Campaign(_0x6b71e2){this['id']=_0x6b71e2['id']||0x0;this[_0x0a87('0x0')]=_0x6b71e2['name']||'';this[_0x0a87('0x1')]=_0x6b71e2['type']||_0x0a87('0x2');this[_0x0a87('0x3')]=0x0;this[_0x0a87('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x0a87('0x5')]=0x0;this['message']='';this[_0x0a87('0x6')]=!![];this['active']=_0x6b71e2[_0x0a87('0x7')];this[_0x0a87('0x8')]=_0x6b71e2[_0x0a87('0x8')];this[_0x0a87('0x9')]=_0x6b71e2['dialTimezone']||null;this['dialGlobalInterval']=_0x6b71e2[_0x0a87('0xa')]?_0x6b71e2[_0x0a87('0xa')]:null;this['dialOriginateCallerIdName']=_0x6b71e2[_0x0a87('0xb')];this[_0x0a87('0xc')]=_0x6b71e2['dialOriginateCallerIdNumber'];this[_0x0a87('0xd')]=_0x6b71e2[_0x0a87('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x6b71e2['dialCongestionMaxRetry'];this[_0x0a87('0xe')]=_0x6b71e2[_0x0a87('0xe')];this[_0x0a87('0xf')]=_0x6b71e2[_0x0a87('0xf')];this['dialBusyRetryFrequency']=_0x6b71e2['dialBusyRetryFrequency'];this[_0x0a87('0x10')]=_0x6b71e2[_0x0a87('0x10')];this[_0x0a87('0x11')]=_0x6b71e2['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x6b71e2[_0x0a87('0x12')];this[_0x0a87('0x13')]=_0x6b71e2[_0x0a87('0x13')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x6b71e2[_0x0a87('0x14')]||0x96;this['dialDropMaxRetry']=_0x6b71e2[_0x0a87('0x15')]||0x3;this[_0x0a87('0x16')]=_0x6b71e2[_0x0a87('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x6b71e2[_0x0a87('0x17')]||0x3;this[_0x0a87('0x18')]=_0x6b71e2[_0x0a87('0x18')]||0x96;this[_0x0a87('0x19')]=_0x6b71e2[_0x0a87('0x19')]||0x3;this[_0x0a87('0x1a')]=_0x6b71e2[_0x0a87('0x1a')]||0x96;this[_0x0a87('0x1b')]=_0x6b71e2[_0x0a87('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x6b71e2[_0x0a87('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x6b71e2[_0x0a87('0x1d')]||_0x0a87('0x1e');this[_0x0a87('0x1f')]=_0x6b71e2[_0x0a87('0x1f')]||undefined;this[_0x0a87('0x20')]=_0x6b71e2[_0x0a87('0x20')]||undefined;this[_0x0a87('0x21')]=_0x6b71e2[_0x0a87('0x21')]||undefined;this[_0x0a87('0x22')]=_0x6b71e2[_0x0a87('0x22')]?_0x6b71e2[_0x0a87('0x22')]:undefined;this[_0x0a87('0x23')]=_0x6b71e2['Trunk']?_0x6b71e2[_0x0a87('0x23')]:undefined;this[_0x0a87('0x24')]=_0x6b71e2[_0x0a87('0x24')]?_0x6b71e2[_0x0a87('0x24')]:undefined;this['SquareProject']=_0x6b71e2['SquareProject']?_0x6b71e2['SquareProject']:undefined;this[_0x0a87('0x25')]=_0x6b71e2[_0x0a87('0x26')]?_0x6b71e2[_0x0a87('0x26')]['name']:undefined;this['dialAMDActive']=_0x6b71e2['dialAMDActive']||![];this[_0x0a87('0x27')]=_0x6b71e2[_0x0a87('0x27')];this[_0x0a87('0x28')]=_0x6b71e2[_0x0a87('0x28')];this[_0x0a87('0x29')]=_0x6b71e2['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x6b71e2[_0x0a87('0x2a')];this[_0x0a87('0x2b')]=_0x6b71e2[_0x0a87('0x2b')];this[_0x0a87('0x2c')]=_0x6b71e2[_0x0a87('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x6b71e2['dialAMDMaximumNumberOfWords'];this[_0x0a87('0x2d')]=_0x6b71e2[_0x0a87('0x2d')];this[_0x0a87('0x2e')]=_0x6b71e2['dialAMDMaximumWordLength'];}module[_0x0a87('0x2f')]=Campaign; \ No newline at end of file +var _0x70e6=['message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays'];(function(_0x43842c,_0x4c286b){var _0x5f31e4=function(_0x1015ee){while(--_0x1015ee){_0x43842c['push'](_0x43842c['shift']());}};_0x5f31e4(++_0x4c286b);}(_0x70e6,0x171));var _0x670e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x70e6[_0x433a86];return _0x23000c;};'use strict';function Campaign(_0x79a502){this['id']=_0x79a502['id']||0x0;this[_0x670e('0x0')]=_0x79a502[_0x670e('0x0')]||'';this[_0x670e('0x1')]=_0x79a502['type']||_0x670e('0x2');this[_0x670e('0x3')]=0x0;this[_0x670e('0x4')]=0x0;this[_0x670e('0x5')]=0x0;this[_0x670e('0x6')]=0x0;this[_0x670e('0x7')]='';this[_0x670e('0x8')]=!![];this[_0x670e('0x9')]=_0x79a502[_0x670e('0x9')];this[_0x670e('0xa')]=_0x79a502[_0x670e('0xa')];this[_0x670e('0xb')]=_0x79a502[_0x670e('0xb')]||null;this[_0x670e('0xc')]=_0x79a502[_0x670e('0xc')]?_0x79a502['dialGlobalInterval']:null;this[_0x670e('0xd')]=_0x79a502[_0x670e('0xd')];this['dialOriginateCallerIdNumber']=_0x79a502['dialOriginateCallerIdNumber'];this[_0x670e('0xe')]=_0x79a502[_0x670e('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x79a502['dialCongestionMaxRetry'];this[_0x670e('0xf')]=_0x79a502['dialCongestionRetryFrequency'];this[_0x670e('0x10')]=_0x79a502[_0x670e('0x10')];this['dialBusyRetryFrequency']=_0x79a502[_0x670e('0x11')];this[_0x670e('0x12')]=_0x79a502['dialNoAnswerMaxRetry'];this[_0x670e('0x13')]=_0x79a502['dialNoAnswerRetryFrequency'];this[_0x670e('0x14')]=_0x79a502[_0x670e('0x14')];this[_0x670e('0x15')]=_0x79a502[_0x670e('0x15')]||0x3;this[_0x670e('0x16')]=_0x79a502[_0x670e('0x16')]||0x96;this[_0x670e('0x17')]=_0x79a502[_0x670e('0x17')]||0x3;this['dialDropRetryFrequency']=_0x79a502['dialDropRetryFrequency']||0x96;this[_0x670e('0x18')]=_0x79a502[_0x670e('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x79a502[_0x670e('0x19')]||0x96;this['dialMachineMaxRetry']=_0x79a502[_0x670e('0x1a')]||0x3;this[_0x670e('0x1b')]=_0x79a502[_0x670e('0x1b')]||0x96;this[_0x670e('0x1c')]=_0x79a502[_0x670e('0x1c')]||0x3;this[_0x670e('0x1d')]=_0x79a502[_0x670e('0x1d')]||0x96;this[_0x670e('0x1e')]=_0x79a502['dialOrderByScheduledAt']||_0x670e('0x1f');this[_0x670e('0x20')]=_0x79a502[_0x670e('0x20')]||undefined;this[_0x670e('0x21')]=_0x79a502[_0x670e('0x21')]||undefined;this['dialCutDigit']=_0x79a502['dialCutDigit']||undefined;this['TrunkBackup']=_0x79a502[_0x670e('0x22')]?_0x79a502[_0x670e('0x22')]:undefined;this[_0x670e('0x23')]=_0x79a502[_0x670e('0x23')]?_0x79a502[_0x670e('0x23')]:undefined;this[_0x670e('0x24')]=_0x79a502[_0x670e('0x24')]?_0x79a502['Interval']:undefined;this['SquareProject']=_0x79a502[_0x670e('0x25')]?_0x79a502[_0x670e('0x25')]:undefined;this['dialQueueProject']=_0x79a502[_0x670e('0x25')]?_0x79a502['SquareProject'][_0x670e('0x0')]:undefined;this[_0x670e('0x26')]=_0x79a502[_0x670e('0x26')]||![];this['dialAMDInitialSilence']=_0x79a502['dialAMDInitialSilence'];this[_0x670e('0x27')]=_0x79a502['dialAMDGreeting'];this[_0x670e('0x28')]=_0x79a502[_0x670e('0x28')];this[_0x670e('0x29')]=_0x79a502[_0x670e('0x29')];this[_0x670e('0x2a')]=_0x79a502[_0x670e('0x2a')];this[_0x670e('0x2b')]=_0x79a502[_0x670e('0x2b')];this[_0x670e('0x2c')]=_0x79a502[_0x670e('0x2c')];this[_0x670e('0x2d')]=_0x79a502[_0x670e('0x2d')];this[_0x670e('0x2e')]=_0x79a502[_0x670e('0x2e')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 34b3dec..b974166 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 _0x7031=['transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','calleridnum','calleridname','connectedlinename','accountcode','uniqueid','linkedid','answered','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','type','tag','disposition','monitor','monitorFilename','queue','monitors'];(function(_0xb71c35,_0x129343){var _0x39224f=function(_0x26eee8){while(--_0x26eee8){_0xb71c35['push'](_0xb71c35['shift']());}};_0x39224f(++_0x129343);}(_0x7031,0x19a));var _0x1703=function(_0x7655ab,_0x18066f){_0x7655ab=_0x7655ab-0x0;var _0x2b0e88=_0x7031[_0x7655ab];return _0x2b0e88;};'use strict';function Channel(){this[_0x1703('0x0')]=null;this[_0x1703('0x1')]='';this['destinationchannel']='';this[_0x1703('0x2')]=0x0;this[_0x1703('0x3')]='';this['connectedlinenum']=undefined;this[_0x1703('0x4')]=undefined;this[_0x1703('0x5')]=0x0;this['context']='';this[_0x1703('0x6')]=0x0;this[_0x1703('0x7')]=0x0;this['exten']=0x0;this[_0x1703('0x8')]=![];this['answertime']=null;this[_0x1703('0x9')]=null;this[_0x1703('0xa')]=![];this[_0x1703('0xb')]=![];this['lastapplication']='';this[_0x1703('0xc')]='';this[_0x1703('0xd')]=0x0;this[_0x1703('0xe')]=0x0;this['holdtime']=0x0;this[_0x1703('0xf')]=null;this[_0x1703('0x10')]=null;this[_0x1703('0x11')]=null;this[_0x1703('0x12')]=![];this[_0x1703('0x13')]=null;this[_0x1703('0x14')]=null;this[_0x1703('0x15')]=[];this[_0x1703('0x16')]=undefined;this[_0x1703('0x17')]=undefined;this[_0x1703('0x18')]=undefined;this[_0x1703('0x19')]=0x0;}module[_0x1703('0x1a')]=Channel; \ No newline at end of file +var _0xbbaf=['type','tag','disposition','monitor','monitors','transfercalleridnum','transferType','mohtime','starttime','channel','destinationchannel','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime'];(function(_0x1e2433,_0x4c5e9a){var _0xdf9f65=function(_0x29121b){while(--_0x29121b){_0x1e2433['push'](_0x1e2433['shift']());}};_0xdf9f65(++_0x4c5e9a);}(_0xbbaf,0x158));var _0xfbba=function(_0xecc190,_0x5962c2){_0xecc190=_0xecc190-0x0;var _0x460b42=_0xbbaf[_0xecc190];return _0x460b42;};'use strict';function Channel(){this[_0xfbba('0x0')]=null;this[_0xfbba('0x1')]='';this[_0xfbba('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0xfbba('0x3')]=undefined;this[_0xfbba('0x4')]=undefined;this[_0xfbba('0x5')]=0x0;this[_0xfbba('0x6')]='';this[_0xfbba('0x7')]=0x0;this[_0xfbba('0x8')]=0x0;this[_0xfbba('0x9')]=0x0;this[_0xfbba('0xa')]=![];this[_0xfbba('0xb')]=null;this[_0xfbba('0xc')]=null;this[_0xfbba('0xd')]=![];this[_0xfbba('0xe')]=![];this[_0xfbba('0xf')]='';this[_0xfbba('0x10')]='';this[_0xfbba('0x11')]=0x0;this[_0xfbba('0x12')]=0x0;this[_0xfbba('0x13')]=0x0;this[_0xfbba('0x14')]=null;this[_0xfbba('0x15')]=null;this[_0xfbba('0x16')]=null;this[_0xfbba('0x17')]=![];this['monitorFilename']=null;this['queue']=null;this[_0xfbba('0x18')]=[];this[_0xfbba('0x19')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xfbba('0x1a')]=undefined;this[_0xfbba('0x1b')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 70e49ed..1b250e9 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 _0x0443=['Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x536ecf,_0x1e419b){var _0x55ce22=function(_0x5652d4){while(--_0x5652d4){_0x536ecf['push'](_0x536ecf['shift']());}};_0x55ce22(++_0x1e419b);}(_0x0443,0x181));var _0x3044=function(_0x226158,_0x254157){_0x226158=_0x226158-0x0;var _0x3f1dde=_0x0443[_0x226158];return _0x3f1dde;};'use strict';function DeskAccount(_0x36b85a){this['id']=_0x36b85a['id']||0x0;this[_0x3044('0x0')]=_0x36b85a[_0x3044('0x0')]||'';this[_0x3044('0x1')]=_0x36b85a[_0x3044('0x1')]||'';this[_0x3044('0x2')]=_0x36b85a['remoteUri']||'';this['authType']=_0x36b85a[_0x3044('0x3')]||'';this[_0x3044('0x4')]=_0x36b85a[_0x3044('0x4')]||'';this[_0x3044('0x5')]=_0x36b85a[_0x3044('0x5')]||'';this['consumerSecret']=_0x36b85a[_0x3044('0x6')]||'';this[_0x3044('0x7')]=_0x36b85a['token']||'';this[_0x3044('0x8')]=_0x36b85a[_0x3044('0x8')]||'';this['type']=_0x36b85a[_0x3044('0x9')]||'';this['serverUrl']=_0x36b85a[_0x3044('0xa')]||'';this[_0x3044('0xb')]=_0x36b85a[_0x3044('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xbeef=['remoteUri','authType','consumerKey','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x69b5aa,_0x6684b7){var _0xd98d28=function(_0x174abd){while(--_0x174abd){_0x69b5aa['push'](_0x69b5aa['shift']());}};_0xd98d28(++_0x6684b7);}(_0xbeef,0x18a));var _0xfbee=function(_0x541b54,_0x3312ee){_0x541b54=_0x541b54-0x0;var _0x179a02=_0xbeef[_0x541b54];return _0x179a02;};'use strict';function DeskAccount(_0x3b00fb){this['id']=_0x3b00fb['id']||0x0;this[_0xfbee('0x0')]=_0x3b00fb[_0xfbee('0x0')]||'';this[_0xfbee('0x1')]=_0x3b00fb[_0xfbee('0x1')]||'';this[_0xfbee('0x2')]=_0x3b00fb[_0xfbee('0x2')]||'';this[_0xfbee('0x3')]=_0x3b00fb[_0xfbee('0x3')]||'';this['password']=_0x3b00fb['password']||'';this[_0xfbee('0x4')]=_0x3b00fb['consumerKey']||'';this['consumerSecret']=_0x3b00fb['consumerSecret']||'';this[_0xfbee('0x5')]=_0x3b00fb[_0xfbee('0x5')]||'';this[_0xfbee('0x6')]=_0x3b00fb[_0xfbee('0x6')]||'';this[_0xfbee('0x7')]=_0x3b00fb[_0xfbee('0x7')]||'';this[_0xfbee('0x8')]=_0x3b00fb[_0xfbee('0x8')]||'';this[_0xfbee('0x9')]=_0x3b00fb[_0xfbee('0x9')]||{};}module[_0xfbee('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index d23aec6..b6c7cd7 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 _0x5b20=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x5ba5ca,_0x27ace3){var _0x42e786=function(_0xe3ddd8){while(--_0xe3ddd8){_0x5ba5ca['push'](_0x5ba5ca['shift']());}};_0x42e786(++_0x27ace3);}(_0x5b20,0x175));var _0x05b2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b20[_0x122ef9];return _0x42fba0;};'use strict';function Dynamics365Account(_0x4f8a5c){this['id']=_0x4f8a5c['id']||0x0;this['name']=_0x4f8a5c[_0x05b2('0x0')]||'';this[_0x05b2('0x1')]=_0x4f8a5c[_0x05b2('0x1')]||'';this[_0x05b2('0x2')]=_0x4f8a5c[_0x05b2('0x2')]||'';this[_0x05b2('0x3')]=_0x4f8a5c[_0x05b2('0x3')]||'';this[_0x05b2('0x4')]=_0x4f8a5c[_0x05b2('0x4')]||'';this[_0x05b2('0x5')]=_0x4f8a5c['clientId']||'';this[_0x05b2('0x6')]=_0x4f8a5c[_0x05b2('0x6')]||{};this[_0x05b2('0x7')]=_0x4f8a5c['serverUrl']||'';this[_0x05b2('0x8')]=_0x4f8a5c[_0x05b2('0x8')]||![];this['Configurations']=_0x4f8a5c[_0x05b2('0x9')]||{};this[_0x05b2('0xa')]=_0x4f8a5c['CloudProvider']||{};}module[_0x05b2('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xb987=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x2af504,_0x46a924){var _0x2abb2e=function(_0x53f705){while(--_0x53f705){_0x2af504['push'](_0x2af504['shift']());}};_0x2abb2e(++_0x46a924);}(_0xb987,0xd2));var _0x7b98=function(_0x3c48e2,_0x586394){_0x3c48e2=_0x3c48e2-0x0;var _0x2b94ae=_0xb987[_0x3c48e2];return _0x2b94ae;};'use strict';function Dynamics365Account(_0x3819ad){this['id']=_0x3819ad['id']||0x0;this['name']=_0x3819ad[_0x7b98('0x0')]||'';this[_0x7b98('0x1')]=_0x3819ad['username']||'';this[_0x7b98('0x2')]=_0x3819ad[_0x7b98('0x2')]||'';this[_0x7b98('0x3')]=_0x3819ad['remoteUri']||'';this[_0x7b98('0x4')]=_0x3819ad[_0x7b98('0x4')]||'';this[_0x7b98('0x5')]=_0x3819ad['clientId']||'';this[_0x7b98('0x6')]=_0x3819ad['clientSecret']||{};this[_0x7b98('0x7')]=_0x3819ad['serverUrl']||'';this[_0x7b98('0x8')]=_0x3819ad[_0x7b98('0x8')]||![];this[_0x7b98('0x9')]=_0x3819ad['Configurations']||{};this[_0x7b98('0xa')]=_0x3819ad['CloudProvider']||{};}module[_0x7b98('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index c4fc09e..ddfa25f 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 _0x97db=['exports','name','ecm','headerinfo','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x97db,0x1b4));var _0xb97d=function(_0x1ca30e,_0x40d3b0){_0x1ca30e=_0x1ca30e-0x0;var _0x5bb55a=_0x97db[_0x1ca30e];return _0x5bb55a;};'use strict';function FaxAccount(_0x1f778b){this['id']=_0x1f778b['id']||0x0;this[_0xb97d('0x0')]=_0x1f778b[_0xb97d('0x0')]||'';this['description']=_0x1f778b['description'];this[_0xb97d('0x1')]=_0x1f778b[_0xb97d('0x1')];this[_0xb97d('0x2')]=_0x1f778b[_0xb97d('0x2')];this['localstationid']=_0x1f778b['localstationid'];this[_0xb97d('0x3')]=_0x1f778b[_0xb97d('0x3')]||0x960;this['maxrate']=_0x1f778b['maxrate']||0x3840;this[_0xb97d('0x4')]=_0x1f778b['modem']||_0xb97d('0x5');this[_0xb97d('0x6')]=_0x1f778b['gateway']||'no';this[_0xb97d('0x7')]=_0x1f778b[_0xb97d('0x7')]||'no';this[_0xb97d('0x8')]=_0x1f778b[_0xb97d('0x8')]||0x1388;this['tech']=_0x1f778b[_0xb97d('0x9')]||_0xb97d('0xa');this[_0xb97d('0xb')]=_0x1f778b[_0xb97d('0xb')]?_0x1f778b[_0xb97d('0xb')]:undefined;this[_0xb97d('0xc')]=_0x1f778b[_0xb97d('0xc')];this[_0xb97d('0xd')]=_0x1f778b[_0xb97d('0xd')];}module[_0xb97d('0xe')]=FaxAccount; \ No newline at end of file +var _0x3283=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key'];(function(_0x2f8175,_0x26c84b){var _0x282e32=function(_0x47f963){while(--_0x47f963){_0x2f8175['push'](_0x2f8175['shift']());}};_0x282e32(++_0x26c84b);}(_0x3283,0x1a1));var _0x3328=function(_0x587373,_0x19cc24){_0x587373=_0x587373-0x0;var _0x1b6b30=_0x3283[_0x587373];return _0x1b6b30;};'use strict';function FaxAccount(_0x20d8d1){this['id']=_0x20d8d1['id']||0x0;this[_0x3328('0x0')]=_0x20d8d1[_0x3328('0x0')]||'';this[_0x3328('0x1')]=_0x20d8d1[_0x3328('0x1')];this['ecm']=_0x20d8d1[_0x3328('0x2')];this['headerinfo']=_0x20d8d1[_0x3328('0x3')];this['localstationid']=_0x20d8d1[_0x3328('0x4')];this[_0x3328('0x5')]=_0x20d8d1[_0x3328('0x5')]||0x960;this[_0x3328('0x6')]=_0x20d8d1['maxrate']||0x3840;this[_0x3328('0x7')]=_0x20d8d1[_0x3328('0x7')]||'v17,v27,v29';this[_0x3328('0x8')]=_0x20d8d1[_0x3328('0x8')]||'no';this['faxdetect']=_0x20d8d1[_0x3328('0x9')]||'no';this[_0x3328('0xa')]=_0x20d8d1[_0x3328('0xa')]||0x1388;this['tech']=_0x20d8d1['tech']||_0x3328('0xb');this[_0x3328('0xc')]=_0x20d8d1[_0x3328('0xc')]?_0x20d8d1['Trunk']:undefined;this[_0x3328('0xd')]=_0x20d8d1[_0x3328('0xd')];this['key']=_0x20d8d1[_0x3328('0xe')];}module[_0x3328('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 9165ec7..cbbca70 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 _0xb845=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x33ae47,_0x42bf26){var _0x3ca3c8=function(_0x8b48a8){while(--_0x8b48a8){_0x33ae47['push'](_0x33ae47['shift']());}};_0x3ca3c8(++_0x42bf26);}(_0xb845,0x82));var _0x5b84=function(_0x39d38a,_0x11b2d8){_0x39d38a=_0x39d38a-0x0;var _0xca6d95=_0xb845[_0x39d38a];return _0xca6d95;};'use strict';function FreshdeskAccount(_0x52175f){this['id']=_0x52175f['id']||0x0;this[_0x5b84('0x0')]=_0x52175f['name']||'';this[_0x5b84('0x1')]=_0x52175f['username']||'';this['apiKey']=_0x52175f[_0x5b84('0x2')]||'';this[_0x5b84('0x3')]=_0x52175f['remoteUri']||'';this['serverUrl']=_0x52175f[_0x5b84('0x4')]||'';this['Configurations']=_0x52175f[_0x5b84('0x5')]||{};}module[_0x5b84('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x58fb=['Configurations','exports','username','apiKey','token','remoteUri'];(function(_0x1940ca,_0x52f9c5){var _0x4b05a8=function(_0x1a7d77){while(--_0x1a7d77){_0x1940ca['push'](_0x1940ca['shift']());}};_0x4b05a8(++_0x52f9c5);}(_0x58fb,0x104));var _0xb58f=function(_0x57fbbd,_0x47b461){_0x57fbbd=_0x57fbbd-0x0;var _0xa396cf=_0x58fb[_0x57fbbd];return _0xa396cf;};'use strict';function FreshdeskAccount(_0x29b0d4){this['id']=_0x29b0d4['id']||0x0;this['name']=_0x29b0d4['name']||'';this['username']=_0x29b0d4[_0xb58f('0x0')]||'';this[_0xb58f('0x1')]=_0x29b0d4[_0xb58f('0x2')]||'';this[_0xb58f('0x3')]=_0x29b0d4[_0xb58f('0x3')]||'';this['serverUrl']=_0x29b0d4['serverUrl']||'';this[_0xb58f('0x4')]=_0x29b0d4[_0xb58f('0x4')]||{};}module[_0xb58f('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index f6fd8fc..7dc87a1 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 _0xafdd=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x3eee3a,_0x36c997){var _0x142f96=function(_0x1a2c08){while(--_0x1a2c08){_0x3eee3a['push'](_0x3eee3a['shift']());}};_0x142f96(++_0x36c997);}(_0xafdd,0x19a));var _0xdafd=function(_0x15f86a,_0xd8c34){_0x15f86a=_0x15f86a-0x0;var _0x11d4d2=_0xafdd[_0x15f86a];return _0x11d4d2;};'use strict';function FreshsalesAccount(_0x1be989){this['id']=_0x1be989['id']||0x0;this[_0xdafd('0x0')]=_0x1be989[_0xdafd('0x0')]||'';this[_0xdafd('0x1')]=_0x1be989[_0xdafd('0x1')]||'';this[_0xdafd('0x2')]=_0x1be989[_0xdafd('0x3')]||'';this[_0xdafd('0x4')]=_0x1be989['remoteUri']||'';this[_0xdafd('0x5')]=_0x1be989[_0xdafd('0x5')]||'';this[_0xdafd('0x6')]=_0x1be989[_0xdafd('0x6')]||{};}module[_0xdafd('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x308a=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x19d40a,_0x5dcd0d){var _0x360e77=function(_0x2b5df){while(--_0x2b5df){_0x19d40a['push'](_0x19d40a['shift']());}};_0x360e77(++_0x5dcd0d);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';function FreshsalesAccount(_0x128455){this['id']=_0x128455['id']||0x0;this['name']=_0x128455[_0xa308('0x0')]||'';this[_0xa308('0x1')]=_0x128455[_0xa308('0x1')]||'';this[_0xa308('0x2')]=_0x128455['token']||'';this['remoteUri']=_0x128455[_0xa308('0x3')]||'';this[_0xa308('0x4')]=_0x128455[_0xa308('0x4')]||'';this[_0xa308('0x5')]=_0x128455[_0xa308('0x5')]||{};}module[_0xa308('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index da9277f..ba6d4ba 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 _0x7c36=['motionChannel','mohtime','exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo'];(function(_0x20aad0,_0xda69c3){var _0xb88efd=function(_0x52c8f2){while(--_0x52c8f2){_0x20aad0['push'](_0x20aad0['shift']());}};_0xb88efd(++_0xda69c3);}(_0x7c36,0x85));var _0x67c3=function(_0x38bca9,_0x2a81c2){_0x38bca9=_0x38bca9-0x0;var _0x2e624c=_0x7c36[_0x38bca9];return _0x2e624c;};'use strict';function QueueReport(){this[_0x67c3('0x0')]=_0x67c3('0x1');this[_0x67c3('0x2')]='';this['calleridnum']='';this[_0x67c3('0x3')]='';this[_0x67c3('0x4')]='';this[_0x67c3('0x5')]=null;this[_0x67c3('0x6')]=null;this[_0x67c3('0x7')]=0x1;this[_0x67c3('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x67c3('0x9')]=null;this[_0x67c3('0xa')]=![];this[_0x67c3('0xb')]=null;this[_0x67c3('0xc')]=![];this['queuecallerexitAt']=null;this[_0x67c3('0xd')]=0x1;this[_0x67c3('0xe')]='';this[_0x67c3('0xf')]='';this[_0x67c3('0x10')]='';this[_0x67c3('0x11')]='';this['context']='';this[_0x67c3('0x12')]='';this[_0x67c3('0x13')]='';this[_0x67c3('0x14')]=0x0;this[_0x67c3('0x15')]=![];this[_0x67c3('0x16')]='';this[_0x67c3('0x17')]='voice';this[_0x67c3('0x18')]=0x0;this['variables']={};}module[_0x67c3('0x19')]=QueueReport; \ No newline at end of file +var _0x3ad8=['priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','exten'];(function(_0x4ebffe,_0x54169d){var _0xe55199=function(_0x4f2cf2){while(--_0x4f2cf2){_0x4ebffe['push'](_0x4ebffe['shift']());}};_0xe55199(++_0x54169d);}(_0x3ad8,0x18f));var _0x83ad=function(_0x293701,_0x207afe){_0x293701=_0x293701-0x0;var _0xe7687c=_0x3ad8[_0x293701];return _0xe7687c;};'use strict';function QueueReport(){this[_0x83ad('0x0')]=_0x83ad('0x1');this[_0x83ad('0x2')]='';this[_0x83ad('0x3')]='';this[_0x83ad('0x4')]='';this['queue']='';this[_0x83ad('0x5')]=null;this[_0x83ad('0x6')]=null;this['position']=0x1;this[_0x83ad('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x83ad('0x8')]=![];this[_0x83ad('0x9')]=null;this[_0x83ad('0xa')]=![];this[_0x83ad('0xb')]=null;this['originalposition']=0x1;this[_0x83ad('0xc')]='';this[_0x83ad('0xd')]='';this['connectedlinename']='';this['accountcode']='';this['context']='';this[_0x83ad('0xe')]='';this[_0x83ad('0xf')]='';this[_0x83ad('0x10')]=0x0;this[_0x83ad('0x11')]=![];this[_0x83ad('0x12')]='';this[_0x83ad('0x13')]=_0x83ad('0x14');this['mohtime']=0x0;this[_0x83ad('0x15')]={};}module[_0x83ad('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index e216d67..46ae7bc 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 _0x1c52=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name','username'];(function(_0x197d2f,_0x45db3a){var _0xe9a4a4=function(_0x3ea794){while(--_0x3ea794){_0x197d2f['push'](_0x197d2f['shift']());}};_0xe9a4a4(++_0x45db3a);}(_0x1c52,0x7c));var _0x21c5=function(_0x399b6f,_0x12355b){_0x399b6f=_0x399b6f-0x0;var _0x1cd5f9=_0x1c52[_0x399b6f];return _0x1cd5f9;};'use strict';function SalesforceAccount(_0x362fd9){this['id']=_0x362fd9['id']||0x0;this[_0x21c5('0x0')]=_0x362fd9[_0x21c5('0x0')]||'';this[_0x21c5('0x1')]=_0x362fd9['username']||'';this['remoteUri']=_0x362fd9['remoteUri']||'';this[_0x21c5('0x2')]=_0x362fd9[_0x21c5('0x2')]||'';this['clientId']=_0x362fd9[_0x21c5('0x3')]||'';this[_0x21c5('0x4')]=_0x362fd9[_0x21c5('0x4')]||'';this[_0x21c5('0x5')]=_0x362fd9['securityToken']||'';this[_0x21c5('0x6')]=_0x362fd9[_0x21c5('0x6')]||'integrationTab';this[_0x21c5('0x7')]=_0x362fd9[_0x21c5('0x7')]||'';this[_0x21c5('0x8')]=_0x362fd9[_0x21c5('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xbdde=['type','integrationTab','serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xbdde,0x12e));var _0xebdd=function(_0x96e413,_0x343bd8){_0x96e413=_0x96e413-0x0;var _0x52a3cb=_0xbdde[_0x96e413];return _0x52a3cb;};'use strict';function SalesforceAccount(_0xc0399f){this['id']=_0xc0399f['id']||0x0;this['name']=_0xc0399f['name']||'';this['username']=_0xc0399f[_0xebdd('0x0')]||'';this['remoteUri']=_0xc0399f[_0xebdd('0x1')]||'';this[_0xebdd('0x2')]=_0xc0399f[_0xebdd('0x2')]||'';this['clientId']=_0xc0399f[_0xebdd('0x3')]||'';this[_0xebdd('0x4')]=_0xc0399f['clientSecret']||'';this[_0xebdd('0x5')]=_0xc0399f[_0xebdd('0x5')]||'';this[_0xebdd('0x6')]=_0xc0399f[_0xebdd('0x6')]||_0xebdd('0x7');this['serverUrl']=_0xc0399f[_0xebdd('0x8')]||'';this[_0xebdd('0x9')]=_0xc0399f[_0xebdd('0x9')]||{};}module[_0xebdd('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index f2fb075..ddc9a3a 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 _0x813a=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4b27c0,_0x4e0ede){var _0x4a67f1=function(_0x3d159c){while(--_0x3d159c){_0x4b27c0['push'](_0x4b27c0['shift']());}};_0x4a67f1(++_0x4e0ede);}(_0x813a,0x9c));var _0xa813=function(_0x5d64c6,_0x24b7b2){_0x5d64c6=_0x5d64c6-0x0;var _0x51516e=_0x813a[_0x5d64c6];return _0x51516e;};'use strict';function ServicenowAccount(_0x4a3c02){this['id']=_0x4a3c02['id']||0x0;this[_0xa813('0x0')]=_0x4a3c02['name']||'';this['username']=_0x4a3c02[_0xa813('0x1')]||'';this[_0xa813('0x2')]=_0x4a3c02['password']||'';this['remoteUri']=_0x4a3c02[_0xa813('0x3')]||'';this[_0xa813('0x4')]=_0x4a3c02[_0xa813('0x4')]||'';this[_0xa813('0x5')]=_0x4a3c02[_0xa813('0x5')]||{};}module[_0xa813('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xa6d6=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x5c1ed2,_0x4b5d57){var _0x1e954f=function(_0x553cb4){while(--_0x553cb4){_0x5c1ed2['push'](_0x5c1ed2['shift']());}};_0x1e954f(++_0x4b5d57);}(_0xa6d6,0x129));var _0x6a6d=function(_0x5d008a,_0x23cbc7){_0x5d008a=_0x5d008a-0x0;var _0x11fdfc=_0xa6d6[_0x5d008a];return _0x11fdfc;};'use strict';function ServicenowAccount(_0x306150){this['id']=_0x306150['id']||0x0;this[_0x6a6d('0x0')]=_0x306150['name']||'';this[_0x6a6d('0x1')]=_0x306150[_0x6a6d('0x1')]||'';this[_0x6a6d('0x2')]=_0x306150[_0x6a6d('0x2')]||'';this[_0x6a6d('0x3')]=_0x306150[_0x6a6d('0x3')]||'';this['serverUrl']=_0x306150[_0x6a6d('0x4')]||'';this[_0x6a6d('0x5')]=_0x306150['Configurations']||{};}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 23c14e8..c7e16a0 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 _0xc86f=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x167c57,_0xc51f4c){var _0x2a3343=function(_0x106a4c){while(--_0x106a4c){_0x167c57['push'](_0x167c57['shift']());}};_0x2a3343(++_0xc51f4c);}(_0xc86f,0xce));var _0xfc86=function(_0x389723,_0x413288){_0x389723=_0x389723-0x0;var _0x9bdfe5=_0xc86f[_0x389723];return _0x9bdfe5;};'use strict';function SugarcrmAccount(_0x3f9cdb){this['id']=_0x3f9cdb['id']||0x0;this[_0xfc86('0x0')]=_0x3f9cdb['name']||'';this[_0xfc86('0x1')]=_0x3f9cdb[_0xfc86('0x1')]||'';this[_0xfc86('0x2')]=_0x3f9cdb[_0xfc86('0x2')]||'';this[_0xfc86('0x3')]=_0x3f9cdb[_0xfc86('0x3')]||'';this[_0xfc86('0x4')]=_0x3f9cdb['serverUrl']||'';this[_0xfc86('0x5')]=_0x3f9cdb[_0xfc86('0x5')]||{};}module[_0xfc86('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xce2b=['username','password','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce2b,0x154));var _0xbce2=function(_0x4ea7c3,_0x2c4914){_0x4ea7c3=_0x4ea7c3-0x0;var _0x5c6626=_0xce2b[_0x4ea7c3];return _0x5c6626;};'use strict';function SugarcrmAccount(_0x138834){this['id']=_0x138834['id']||0x0;this['name']=_0x138834['name']||'';this[_0xbce2('0x0')]=_0x138834[_0xbce2('0x0')]||'';this['password']=_0x138834[_0xbce2('0x1')]||'';this[_0xbce2('0x2')]=_0x138834[_0xbce2('0x2')]||'';this[_0xbce2('0x3')]=_0x138834['serverUrl']||'';this[_0xbce2('0x4')]=_0x138834[_0xbce2('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 695699d..4868ef2 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 _0x29a6=['address','exports','name','state','unknown'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x29a6,0xd9));var _0x629a=function(_0x107106,_0x324e28){_0x107106=_0x107106-0x0;var _0xe0387=_0x29a6[_0x107106];return _0xe0387;};'use strict';function Telephone(_0x3a2bd8){this['id']=_0x3a2bd8['id']||0x0;this['name']=_0x3a2bd8[_0x629a('0x0')]||'';this['accountcode']=_0x3a2bd8['accountcode']||'';this[_0x629a('0x1')]=_0x629a('0x2');this['stateTime']=0x0;this['status']='unknown';this[_0x629a('0x3')]='';}module[_0x629a('0x4')]=Telephone; \ No newline at end of file +var _0x5088=['exports','name','accountcode','unknown','stateTime','status'];(function(_0x1ae7b0,_0x2301a2){var _0x2d83dc=function(_0x32a63f){while(--_0x32a63f){_0x1ae7b0['push'](_0x1ae7b0['shift']());}};_0x2d83dc(++_0x2301a2);}(_0x5088,0xa9));var _0x8508=function(_0x45ce90,_0x114609){_0x45ce90=_0x45ce90-0x0;var _0x313c45=_0x5088[_0x45ce90];return _0x313c45;};'use strict';function Telephone(_0x431580){this['id']=_0x431580['id']||0x0;this[_0x8508('0x0')]=_0x431580[_0x8508('0x0')]||'';this[_0x8508('0x1')]=_0x431580[_0x8508('0x1')]||'';this['state']=_0x8508('0x2');this[_0x8508('0x3')]=0x0;this[_0x8508('0x4')]=_0x8508('0x2');this['address']='';}module[_0x8508('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 2f140b0..70d5fde 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(_0x3bc39e,_0x1eb285){var _0x1a8e4d=function(_0x119375){while(--_0x119375){_0x3bc39e['push'](_0x3bc39e['shift']());}};_0x1a8e4d(++_0x1eb285);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x5200e4,_0x124e48){var _0x18ac01=function(_0x417e89){while(--_0x417e89){_0x5200e4['push'](_0x5200e4['shift']());}};_0x18ac01(++_0x124e48);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 115a1c3..cd4eb87 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x4a0be9,_0x4216d3){var _0x483e7c=function(_0x3984f3){while(--_0x3984f3){_0x4a0be9['push'](_0x4a0be9['shift']());}};_0x483e7c(++_0x4216d3);}(_0x4fc2,0x111));var _0x24fc=function(_0x48b819,_0x5159df){_0x48b819=_0x48b819-0x0;var _0x16b470=_0x4fc2[_0x48b819];return _0x16b470;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 3d2f77b..f80cd31 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 _0xce36=['stateTime','registry','indexOf','split','host','port','domainport','refresh','stateRegistry','defaultuser','exports','active','name','state','unknown'];(function(_0x1a1d9b,_0x5ea65a){var _0x1d7a59=function(_0xa1dea2){while(--_0xa1dea2){_0x1a1d9b['push'](_0x1a1d9b['shift']());}};_0x1d7a59(++_0x5ea65a);}(_0xce36,0x10a));var _0x6ce3=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0xce36[_0x34f701];return _0x3e2429;};'use strict';function Trunk(_0x378564){this['id']=_0x378564['id']||0x0;this['active']=_0x378564[_0x6ce3('0x0')]||![];this[_0x6ce3('0x1')]=_0x378564['name']||'';this[_0x6ce3('0x2')]=_0x6ce3('0x3');this[_0x6ce3('0x4')]=0x0;this['status']=_0x6ce3('0x3');this[_0x6ce3('0x5')]=_0x378564['registry']&&_0x378564[_0x6ce3('0x5')][_0x6ce3('0x6')](':')?_0x378564[_0x6ce3('0x5')][_0x6ce3('0x7')](':')[0x0]:'';this[_0x6ce3('0x8')]='';this[_0x6ce3('0x9')]='';this['domain']='';this[_0x6ce3('0xa')]='';this[_0x6ce3('0xb')]='';this[_0x6ce3('0xc')]=_0x6ce3('0x3');this['registrationtime']='';this['address']='';this[_0x6ce3('0xd')]=_0x378564[_0x6ce3('0xd')]||'';}module[_0x6ce3('0xe')]=Trunk; \ No newline at end of file +var _0xc0e0=['host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','state','stateTime','status','unknown','registry','indexOf'];(function(_0x10c94c,_0x60aa4b){var _0x10d2ca=function(_0x108eaa){while(--_0x108eaa){_0x10c94c['push'](_0x10c94c['shift']());}};_0x10d2ca(++_0x60aa4b);}(_0xc0e0,0x12b));var _0x0c0e=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xc0e0[_0x543084];return _0x306a57;};'use strict';function Trunk(_0x389b4a){this['id']=_0x389b4a['id']||0x0;this[_0x0c0e('0x0')]=_0x389b4a[_0x0c0e('0x0')]||![];this['name']=_0x389b4a['name']||'';this[_0x0c0e('0x1')]='unknown';this[_0x0c0e('0x2')]=0x0;this[_0x0c0e('0x3')]=_0x0c0e('0x4');this[_0x0c0e('0x5')]=_0x389b4a[_0x0c0e('0x5')]&&_0x389b4a[_0x0c0e('0x5')][_0x0c0e('0x6')](':')?_0x389b4a[_0x0c0e('0x5')]['split'](':')[0x0]:'';this[_0x0c0e('0x7')]='';this[_0x0c0e('0x8')]='';this[_0x0c0e('0x9')]='';this[_0x0c0e('0xa')]='';this[_0x0c0e('0xb')]='';this[_0x0c0e('0xc')]=_0x0c0e('0x4');this[_0x0c0e('0xd')]='';this[_0x0c0e('0xe')]='';this[_0x0c0e('0xf')]=_0x389b4a['defaultuser']||'';}module[_0x0c0e('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index af999bc..f73a416 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 _0xec65=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x4914ad,_0x551a18){var _0x3cd61f=function(_0x2a773e){while(--_0x2a773e){_0x4914ad['push'](_0x4914ad['shift']());}};_0x3cd61f(++_0x551a18);}(_0xec65,0x11f));var _0x5ec6=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0xec65[_0x10e840];return _0x405caa;};'use strict';function voiceExtension(_0x210ed4){this['id']=_0x210ed4['id']||0x0;this[_0x5ec6('0x0')]=_0x210ed4['exten']||'';this[_0x5ec6('0x1')]=_0x210ed4[_0x5ec6('0x1')]||_0x5ec6('0x2');this[_0x5ec6('0x3')]=_0x210ed4[_0x5ec6('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x0793=['recordingFormat'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x0793,0xab));var _0x3079=function(_0x1d6231,_0x48fe89){_0x1d6231=_0x1d6231-0x0;var _0x243f5b=_0x0793[_0x1d6231];return _0x243f5b;};'use strict';function voiceExtension(_0x9a992d){this['id']=_0x9a992d['id']||0x0;this['exten']=_0x9a992d['exten']||'';this[_0x3079('0x0')]=_0x9a992d[_0x3079('0x0')]||'none';this['mandatoryDisposition']=_0x9a992d['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index a18de5d..9f95958 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 _0x055b=['dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumBillable','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0x2eda7c,_0x51ea04){var _0x1204d7=function(_0x4494ae){while(--_0x4494ae){_0x2eda7c['push'](_0x2eda7c['shift']());}};_0x1204d7(++_0x51ea04);}(_0x055b,0xaf));var _0xb055=function(_0x4827b9,_0x5c31a2){_0x4827b9=_0x4827b9-0x0;var _0x2dc1e5=_0x055b[_0x4827b9];return _0x2dc1e5;};'use strict';var statusDesc=[_0xb055('0x0'),_0xb055('0x1'),_0xb055('0x2'),'busy','invalid',_0xb055('0x3'),_0xb055('0x4'),'ringinuse',_0xb055('0x5')];var monitorFormat={'wav':_0xb055('0x6'),'wav49':_0xb055('0x7'),'gsm':_0xb055('0x8')};var strategy={'rrmemory':_0xb055('0x9'),'roundrobin':_0xb055('0xa')};function VoiceQueue(_0x561647){this['id']=_0x561647['id']||0x0;this[_0xb055('0xb')]=_0x561647['name']||'';this[_0xb055('0xc')]=_0x561647[_0xb055('0xc')]||'';this[_0xb055('0xd')]=_0x561647['type']||'inbound';this[_0xb055('0xe')]=0x0;this[_0xb055('0xf')]=0x0;this[_0xb055('0x10')]=0x0;this[_0xb055('0x11')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xb055('0x12')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xb055('0x13')]=0x0;this[_0xb055('0x14')]=0x0;this[_0xb055('0x15')]=_0x561647['acw']||![];this[_0xb055('0x16')]=_0x561647[_0xb055('0x16')]||0xa;this[_0xb055('0x17')]=_0x561647[_0xb055('0x17')]||'no';this[_0xb055('0x18')]=!![];this[_0xb055('0x19')]='';this[_0xb055('0x1a')]=0x0;this[_0xb055('0x1b')]=0x0;this[_0xb055('0x1c')]=_0x561647[_0xb055('0x1c')]||null;this[_0xb055('0x1d')]=_0x561647[_0xb055('0x1d')]?_0x561647['dialGlobalInterval']:null;this['dialActive']=_0x561647[_0xb055('0x1e')];this[_0xb055('0x1f')]=_0x561647[_0xb055('0x1f')]||_0xb055('0x20');this[_0xb055('0x21')]=_0x561647[_0xb055('0x21')]||0x0;this[_0xb055('0x22')]=_0x561647[_0xb055('0x22')]||0x0;this[_0xb055('0x23')]=_0x561647['dialPowerLevel']||0x1;this[_0xb055('0x24')]=_0x561647[_0xb055('0x24')]||'dropRate';this[_0xb055('0x25')]=_0x561647['dialPredictiveOptimizationPercentage']||0.03;this[_0xb055('0x26')]=_0x561647[_0xb055('0x26')]||0x258;this[_0xb055('0x27')]=_0x561647[_0xb055('0x27')]||_0xb055('0x28');this[_0xb055('0x29')]=_0x561647[_0xb055('0x29')]||_0xb055('0x28');this[_0xb055('0x2a')]=_0x561647[_0xb055('0x2a')]||0x1e;this[_0xb055('0x2b')]=_0x561647[_0xb055('0x2b')]||_0xb055('0x2c');this[_0xb055('0x2d')]=_0x561647[_0xb055('0x2d')]||0x3;this[_0xb055('0x2e')]=_0x561647[_0xb055('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x561647['dialCongestionMaxRetry']||0x3;this[_0xb055('0x2f')]=_0x561647[_0xb055('0x2f')]||0x96;this[_0xb055('0x30')]=_0x561647['dialBusyMaxRetry']||0x3;this[_0xb055('0x31')]=_0x561647[_0xb055('0x31')]||0x96;this['dialNoAnswerMaxRetry']=_0x561647[_0xb055('0x32')]||0x3;this[_0xb055('0x33')]=_0x561647[_0xb055('0x33')]||0x96;this[_0xb055('0x34')]=_0x561647['dialNoSuchNumberMaxRetry']||0x3;this[_0xb055('0x35')]=_0x561647[_0xb055('0x35')]||0x96;this['dialDropMaxRetry']=_0x561647[_0xb055('0x36')]||0x3;this[_0xb055('0x37')]=_0x561647[_0xb055('0x37')]||0x96;this[_0xb055('0x38')]=_0x561647[_0xb055('0x38')]||0x3;this[_0xb055('0x39')]=_0x561647['dialAbandonedRetryFrequency']||0x96;this[_0xb055('0x3a')]=_0x561647[_0xb055('0x3a')]||0x3;this[_0xb055('0x3b')]=_0x561647['dialMachineRetryFrequency']||0x96;this[_0xb055('0x3c')]=_0x561647['dialAgentRejectMaxRetry']||0x3;this[_0xb055('0x3d')]=_0x561647[_0xb055('0x3d')]||0x96;this['callAdditionalPhoneAfterMin']=_0x561647['callAdditionalPhoneAfterMin']||0x3;this[_0xb055('0x3e')]=_0x561647[_0xb055('0x3e')]||0x4;this[_0xb055('0x3f')]=_0x561647['Trunk']?_0x561647[_0xb055('0x3f')]:undefined;this[_0xb055('0x40')]=_0x561647[_0xb055('0x40')]?_0x561647['TrunkBackup']:undefined;this['dialPrefix']=_0x561647[_0xb055('0x41')]||undefined;this[_0xb055('0x42')]=_0x561647[_0xb055('0x42')]?_0x561647['Interval']:undefined;this[_0xb055('0x43')]=_0x561647['dialOrderByScheduledAt']||'DESC';this[_0xb055('0x44')]=_0x561647[_0xb055('0x44')]||undefined;this[_0xb055('0x45')]=_0x561647['dialCutDigit']||undefined;this['strategy']=strategy[_0x561647[_0xb055('0x46')]]||'rrmemory';this[_0xb055('0x47')]=!![];this['dialAMDActive']=_0x561647[_0xb055('0x48')]||![];this[_0xb055('0x49')]=_0x561647[_0xb055('0x49')];this[_0xb055('0x4a')]=_0x561647[_0xb055('0x4a')];this[_0xb055('0x4b')]=_0x561647[_0xb055('0x4b')];this['dialAMDTotalAnalysisTime']=_0x561647[_0xb055('0x4c')];this['dialAMDMinWordLength']=_0x561647[_0xb055('0x4d')];this[_0xb055('0x4e')]=_0x561647[_0xb055('0x4e')];this[_0xb055('0x4f')]=_0x561647[_0xb055('0x4f')];this[_0xb055('0x50')]=_0x561647['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x561647['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xb055('0x51')]=0x0;this['timeout']=_0x561647[_0xb055('0x52')];this[_0xb055('0x53')]=0x0;this[_0xb055('0x54')]=0x0;this[_0xb055('0x55')]=0x0;this[_0xb055('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xb055('0x57')]=0x0;this[_0xb055('0x58')]=0x0;this[_0xb055('0x59')]=0x0;this[_0xb055('0x5a')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xb055('0x5b')]=0x0;this[_0xb055('0x5c')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xb055('0x5d')]=undefined;this['startPredictive']=undefined;this[_0xb055('0x5e')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xb055('0x5f')]=0x0;this[_0xb055('0x60')]=0x0;this[_0xb055('0x61')]=0x0;this[_0xb055('0x62')]=0x0;this[_0xb055('0x63')]=0x0;this[_0xb055('0x64')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xb055('0x65')]=_0x561647[_0xb055('0x66')]||0x14;this[_0xb055('0x67')]=_0x561647[_0xb055('0x66')]||0xa;this[_0xb055('0x68')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xb055('0x69')]=0x0;this[_0xb055('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xb055('0x6b')]=0x0;this[_0xb055('0x6c')]=_0x561647[_0xb055('0x6c')]||0x1e;this[_0xb055('0x6d')]=_0x561647[_0xb055('0x6d')]||![];this[_0xb055('0x6e')]=!!_0x561647[_0xb055('0x6e')]||![];this[_0xb055('0x6f')]=!!_0x561647[_0xb055('0x6f')]||![];this['dialQueueProject2']=_0x561647[_0xb055('0x70')]||undefined;this[_0xb055('0x71')]=_0x561647[_0xb055('0x71')]||![];this[_0xb055('0x72')]=_0x561647[_0xb055('0x72')]||![];this['monitor_format']=monitorFormat[_0x561647[_0xb055('0xc')]]?monitorFormat[_0x561647[_0xb055('0xc')]]:undefined;this[_0xb055('0x73')]=_0x561647['mandatoryDisposition']||![];this[_0xb055('0x74')]=_0x561647[_0xb055('0x74')]?_0x561647[_0xb055('0x74')]:undefined;}module[_0xb055('0x75')]=VoiceQueue; \ No newline at end of file +var _0xa1c7=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject'];(function(_0x25a462,_0x4b51c5){var _0xd5e3c3=function(_0x153064){while(--_0x153064){_0x25a462['push'](_0x25a462['shift']());}};_0xd5e3c3(++_0x4b51c5);}(_0xa1c7,0xc0));var _0x7a1c=function(_0x29f43b,_0x3cfd18){_0x29f43b=_0x29f43b-0x0;var _0x356319=_0xa1c7[_0x29f43b];return _0x356319;};'use strict';var statusDesc=[_0x7a1c('0x0'),_0x7a1c('0x1'),_0x7a1c('0x2'),_0x7a1c('0x3'),_0x7a1c('0x4'),_0x7a1c('0x5'),'ringing',_0x7a1c('0x6'),_0x7a1c('0x7')];var monitorFormat={'wav':_0x7a1c('0x8'),'wav49':'wav49','gsm':_0x7a1c('0x9')};var strategy={'rrmemory':_0x7a1c('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x145deb){this['id']=_0x145deb['id']||0x0;this[_0x7a1c('0xb')]=_0x145deb[_0x7a1c('0xb')]||'';this[_0x7a1c('0xc')]=_0x145deb[_0x7a1c('0xc')]||'';this['type']=_0x145deb[_0x7a1c('0xd')]||_0x7a1c('0xe');this['waiting']=0x0;this['talking']=0x0;this[_0x7a1c('0xf')]=0x0;this[_0x7a1c('0x10')]=0x0;this[_0x7a1c('0x11')]=0x0;this[_0x7a1c('0x12')]=0x0;this[_0x7a1c('0x13')]=0x0;this[_0x7a1c('0x14')]=0x0;this[_0x7a1c('0x15')]=0x0;this[_0x7a1c('0x16')]=0x0;this[_0x7a1c('0x17')]=0x0;this['acw']=_0x145deb['acw']||![];this['acwTimeout']=_0x145deb['acwTimeout']||0xa;this[_0x7a1c('0x18')]=_0x145deb[_0x7a1c('0x18')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x7a1c('0x19')]=0x0;this[_0x7a1c('0x1a')]=0x0;this[_0x7a1c('0x1b')]=_0x145deb[_0x7a1c('0x1b')]||null;this[_0x7a1c('0x1c')]=_0x145deb['dialGlobalInterval']?_0x145deb['dialGlobalInterval']:null;this['dialActive']=_0x145deb[_0x7a1c('0x1d')];this[_0x7a1c('0x1e')]=_0x145deb['dialMethod']||_0x7a1c('0x1f');this[_0x7a1c('0x20')]=_0x145deb['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x145deb[_0x7a1c('0x21')]||0x0;this[_0x7a1c('0x22')]=_0x145deb['dialPowerLevel']||0x1;this[_0x7a1c('0x23')]=_0x145deb[_0x7a1c('0x23')]||_0x7a1c('0x24');this[_0x7a1c('0x25')]=_0x145deb[_0x7a1c('0x25')]||0.03;this[_0x7a1c('0x26')]=_0x145deb[_0x7a1c('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x145deb[_0x7a1c('0x27')]||_0x7a1c('0x28');this[_0x7a1c('0x29')]=_0x145deb[_0x7a1c('0x29')]||_0x7a1c('0x28');this[_0x7a1c('0x2a')]=_0x145deb['dialOriginateTimeout']||0x1e;this[_0x7a1c('0x2b')]=_0x145deb[_0x7a1c('0x2b')]||'tTxX';this['dialQueueTimeout']=_0x145deb[_0x7a1c('0x2c')]||0x3;this[_0x7a1c('0x2d')]=_0x145deb['dialQueueProject']||undefined;this[_0x7a1c('0x2e')]=_0x145deb['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x145deb[_0x7a1c('0x2f')]||0x96;this[_0x7a1c('0x30')]=_0x145deb[_0x7a1c('0x30')]||0x3;this[_0x7a1c('0x31')]=_0x145deb[_0x7a1c('0x31')]||0x96;this[_0x7a1c('0x32')]=_0x145deb['dialNoAnswerMaxRetry']||0x3;this[_0x7a1c('0x33')]=_0x145deb[_0x7a1c('0x33')]||0x96;this[_0x7a1c('0x34')]=_0x145deb[_0x7a1c('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x145deb[_0x7a1c('0x35')]||0x96;this['dialDropMaxRetry']=_0x145deb[_0x7a1c('0x36')]||0x3;this[_0x7a1c('0x37')]=_0x145deb[_0x7a1c('0x37')]||0x96;this[_0x7a1c('0x38')]=_0x145deb[_0x7a1c('0x38')]||0x3;this[_0x7a1c('0x39')]=_0x145deb[_0x7a1c('0x39')]||0x96;this[_0x7a1c('0x3a')]=_0x145deb['dialMachineMaxRetry']||0x3;this[_0x7a1c('0x3b')]=_0x145deb['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x145deb[_0x7a1c('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x145deb[_0x7a1c('0x3d')]||0x96;this[_0x7a1c('0x3e')]=_0x145deb[_0x7a1c('0x3e')]||0x3;this[_0x7a1c('0x3f')]=_0x145deb[_0x7a1c('0x3f')]||0x4;this[_0x7a1c('0x40')]=_0x145deb[_0x7a1c('0x40')]?_0x145deb[_0x7a1c('0x40')]:undefined;this[_0x7a1c('0x41')]=_0x145deb[_0x7a1c('0x41')]?_0x145deb[_0x7a1c('0x41')]:undefined;this['dialPrefix']=_0x145deb[_0x7a1c('0x42')]||undefined;this[_0x7a1c('0x43')]=_0x145deb['Interval']?_0x145deb[_0x7a1c('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x145deb['dialOrderByScheduledAt']||_0x7a1c('0x44');this[_0x7a1c('0x45')]=_0x145deb[_0x7a1c('0x45')]||undefined;this['dialCutDigit']=_0x145deb['dialCutDigit']||undefined;this[_0x7a1c('0x46')]=strategy[_0x145deb['strategy']]||_0x7a1c('0xa');this[_0x7a1c('0x47')]=!![];this[_0x7a1c('0x48')]=_0x145deb[_0x7a1c('0x48')]||![];this['dialAMDInitialSilence']=_0x145deb[_0x7a1c('0x49')];this[_0x7a1c('0x4a')]=_0x145deb[_0x7a1c('0x4a')];this[_0x7a1c('0x4b')]=_0x145deb[_0x7a1c('0x4b')];this[_0x7a1c('0x4c')]=_0x145deb[_0x7a1c('0x4c')];this['dialAMDMinWordLength']=_0x145deb[_0x7a1c('0x4d')];this[_0x7a1c('0x4e')]=_0x145deb[_0x7a1c('0x4e')];this[_0x7a1c('0x4f')]=_0x145deb[_0x7a1c('0x4f')];this[_0x7a1c('0x50')]=_0x145deb[_0x7a1c('0x50')];this['dialAMDMaximumWordLength']=_0x145deb['dialAMDMaximumWordLength'];this[_0x7a1c('0x51')]=0x0;this[_0x7a1c('0x52')]=0x0;this[_0x7a1c('0x53')]=_0x145deb[_0x7a1c('0x53')];this[_0x7a1c('0x54')]=0x0;this[_0x7a1c('0x55')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x7a1c('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x7a1c('0x57')]=0x0;this[_0x7a1c('0x58')]=0x0;this[_0x7a1c('0x59')]=0x0;this[_0x7a1c('0x5a')]=0x0;this[_0x7a1c('0x5b')]=0x0;this[_0x7a1c('0x5c')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x7a1c('0x5d')]=0x0;this[_0x7a1c('0x5e')]=0x0;this[_0x7a1c('0x5f')]=undefined;this[_0x7a1c('0x60')]=undefined;this[_0x7a1c('0x61')]=undefined;this[_0x7a1c('0x62')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x7a1c('0x63')]=0x0;this[_0x7a1c('0x64')]=0x0;this[_0x7a1c('0x65')]=0x0;this[_0x7a1c('0x66')]=0x0;this[_0x7a1c('0x67')]=0x0;this[_0x7a1c('0x68')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x7a1c('0x69')]=_0x145deb['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x145deb[_0x7a1c('0x6a')]||0xa;this[_0x7a1c('0x6b')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x7a1c('0x6c')]=0x0;this[_0x7a1c('0x6d')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x7a1c('0x6e')]=0x0;this[_0x7a1c('0x6f')]=_0x145deb[_0x7a1c('0x6f')]||0x1e;this['dialRecallInQueue']=_0x145deb[_0x7a1c('0x70')]||![];this['dialPreviewAutoRecallMe']=!!_0x145deb['dialPreviewAutoRecallMe']||![];this[_0x7a1c('0x71')]=!!_0x145deb[_0x7a1c('0x71')]||![];this[_0x7a1c('0x72')]=_0x145deb[_0x7a1c('0x72')]||undefined;this[_0x7a1c('0x73')]=_0x145deb[_0x7a1c('0x73')]||![];this[_0x7a1c('0x74')]=_0x145deb[_0x7a1c('0x74')]||![];this[_0x7a1c('0xc')]=monitorFormat[_0x145deb['monitor_format']]?monitorFormat[_0x145deb[_0x7a1c('0xc')]]:undefined;this[_0x7a1c('0x75')]=_0x145deb['mandatoryDisposition']||![];this[_0x7a1c('0x76')]=_0x145deb['mandatoryDispositionPause']?_0x145deb[_0x7a1c('0x76')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index a52b498..8c3c289 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 _0x0958=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x187fa1,_0x2ece42){var _0x415d11=function(_0x3ea4e4){while(--_0x3ea4e4){_0x187fa1['push'](_0x187fa1['shift']());}};_0x415d11(++_0x2ece42);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';function VtigerAccount(_0x309912){this['id']=_0x309912['id']||0x0;this[_0x8095('0x0')]=_0x309912[_0x8095('0x0')]||'';this['username']=_0x309912[_0x8095('0x1')]||'';this[_0x8095('0x2')]=_0x309912['accessKey']||'';this['remoteUri']=_0x309912[_0x8095('0x3')]||'';this[_0x8095('0x4')]=_0x309912['serverUrl']||'';this['Configurations']=_0x309912[_0x8095('0x5')]||{};}module[_0x8095('0x6')]=VtigerAccount; \ No newline at end of file +var _0x9e31=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x9e31,0xc8));var _0x19e3=function(_0x80f62f,_0x2215b2){_0x80f62f=_0x80f62f-0x0;var _0x6dcd63=_0x9e31[_0x80f62f];return _0x6dcd63;};'use strict';function VtigerAccount(_0x3de923){this['id']=_0x3de923['id']||0x0;this[_0x19e3('0x0')]=_0x3de923[_0x19e3('0x0')]||'';this[_0x19e3('0x1')]=_0x3de923[_0x19e3('0x1')]||'';this[_0x19e3('0x2')]=_0x3de923[_0x19e3('0x2')]||'';this[_0x19e3('0x3')]=_0x3de923[_0x19e3('0x3')]||'';this[_0x19e3('0x4')]=_0x3de923[_0x19e3('0x4')]||'';this[_0x19e3('0x5')]=_0x3de923[_0x19e3('0x5')]||{};}module[_0x19e3('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5feca27..40a3568 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 _0x2b1f=['authType','type','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x53eff4,_0x55b2c0){var _0x1fa828=function(_0x50da64){while(--_0x50da64){_0x53eff4['push'](_0x53eff4['shift']());}};_0x1fa828(++_0x55b2c0);}(_0x2b1f,0xcd));var _0xf2b1=function(_0x3a7553,_0x2c7660){_0x3a7553=_0x3a7553-0x0;var _0x4d912c=_0x2b1f[_0x3a7553];return _0x4d912c;};'use strict';function ZendeskAccount(_0x2a3696){this['id']=_0x2a3696['id']||0x0;this['name']=_0x2a3696[_0xf2b1('0x0')]||'';this[_0xf2b1('0x1')]=_0x2a3696[_0xf2b1('0x1')]||'';this[_0xf2b1('0x2')]=_0x2a3696['password']||'';this[_0xf2b1('0x3')]=_0x2a3696[_0xf2b1('0x3')]||'';this[_0xf2b1('0x4')]=_0x2a3696[_0xf2b1('0x4')]||'';this[_0xf2b1('0x5')]=_0x2a3696[_0xf2b1('0x5')]||'';this[_0xf2b1('0x6')]=_0x2a3696['type']||'integrationTab';this['serverUrl']=_0x2a3696[_0xf2b1('0x7')]||'';this[_0xf2b1('0x8')]=_0x2a3696[_0xf2b1('0x8')]||{};}module[_0xf2b1('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xddc6=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xddc6,0x1f0));var _0x6ddc=function(_0x2c0b47,_0x8e5ea){_0x2c0b47=_0x2c0b47-0x0;var _0x48b98f=_0xddc6[_0x2c0b47];return _0x48b98f;};'use strict';function ZendeskAccount(_0x23484c){this['id']=_0x23484c['id']||0x0;this[_0x6ddc('0x0')]=_0x23484c[_0x6ddc('0x0')]||'';this[_0x6ddc('0x1')]=_0x23484c['username']||'';this['password']=_0x23484c[_0x6ddc('0x2')]||'';this[_0x6ddc('0x3')]=_0x23484c[_0x6ddc('0x3')]||'';this[_0x6ddc('0x4')]=_0x23484c['remoteUri']||'';this[_0x6ddc('0x5')]=_0x23484c[_0x6ddc('0x5')]||'';this[_0x6ddc('0x6')]=_0x23484c[_0x6ddc('0x6')]||_0x6ddc('0x7');this[_0x6ddc('0x8')]=_0x23484c[_0x6ddc('0x8')]||'';this[_0x6ddc('0x9')]=_0x23484c['Configurations']||{};}module[_0x6ddc('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index ee17119..638a7cf 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 _0xc563=['description','host','zone','clientSecret','code','refreshToken','Configurations','name'];(function(_0x47e851,_0x5d7b66){var _0x3af152=function(_0x170f49){while(--_0x170f49){_0x47e851['push'](_0x47e851['shift']());}};_0x3af152(++_0x5d7b66);}(_0xc563,0x1df));var _0x3c56=function(_0x31f4ab,_0x3fc0c9){_0x31f4ab=_0x31f4ab-0x0;var _0x3aeb12=_0xc563[_0x31f4ab];return _0x3aeb12;};'use strict';function ZohoAccount(_0x35dc13){this['id']=_0x35dc13['id']||0x0;this['name']=_0x35dc13[_0x3c56('0x0')]||'';this[_0x3c56('0x1')]=_0x35dc13[_0x3c56('0x1')]||'';this[_0x3c56('0x2')]=_0x35dc13[_0x3c56('0x2')]||'';this[_0x3c56('0x3')]=_0x35dc13[_0x3c56('0x3')]||'';this['clientId']=_0x35dc13['clientId']||'';this[_0x3c56('0x4')]=_0x35dc13['clientSecret']||'';this['serverUrl']=_0x35dc13['serverUrl']||'';this[_0x3c56('0x5')]=_0x35dc13[_0x3c56('0x5')]||'';this[_0x3c56('0x6')]=_0x35dc13['refreshToken']||'';this[_0x3c56('0x7')]=_0x35dc13[_0x3c56('0x7')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xe02c=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xe02c,0x82));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x2cc60f){this['id']=_0x2cc60f['id']||0x0;this['name']=_0x2cc60f[_0xce02('0x0')]||'';this[_0xce02('0x1')]=_0x2cc60f['description']||'';this[_0xce02('0x2')]=_0x2cc60f[_0xce02('0x2')]||'';this['zone']=_0x2cc60f[_0xce02('0x3')]||'';this[_0xce02('0x4')]=_0x2cc60f[_0xce02('0x4')]||'';this[_0xce02('0x5')]=_0x2cc60f[_0xce02('0x5')]||'';this[_0xce02('0x6')]=_0x2cc60f[_0xce02('0x6')]||'';this[_0xce02('0x7')]=_0x2cc60f[_0xce02('0x7')]||'';this[_0xce02('0x8')]=_0x2cc60f[_0xce02('0x8')]||'';this['Configurations']=_0x2cc60f[_0xce02('0x9')]||{};}module[_0xce02('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 9ef801a..66ea093 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 _0x14a0=['countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','uniqueid','idContact','type','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14a0,0x8e));var _0x014a=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x14a0[_0x414297];return _0x51ea47;};'use strict';var util=require('util');var _=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));function checkNameSurname(_0x4144ed,_0x28b0f6,_0x32e88c){var _0xd5cdc6='';if(!_[_0x014a('0x2')](_0x28b0f6)&&'string'===typeof _0x28b0f6){_0xd5cdc6+=_0x28b0f6;}if(!_['isNil'](_0x32e88c)&&_0x014a('0x3')===typeof _0x32e88c){_0xd5cdc6+='\x20'+_0x32e88c;}if(_0xd5cdc6!==''){return _0xd5cdc6;}return _0x4144ed;}function Action(_0x12e8da,_0x38a22c,_0x5ec84d,_0x5a61ac,_0x11b8ce){this[_0x014a('0x4')]=_0x5ec84d||undefined;this[_0x014a('0x5')]=_0x12e8da['id'];this['queue']=_0x38a22c['name'];this[_0x014a('0x6')]=_0x38a22c['type'];this['campaigntype']='queue';this['dialAnswer']=![];this[_0x014a('0x7')]=_['isNil'](_0x12e8da[_0x014a('0x8')])?undefined:_0x12e8da[_0x014a('0x8')]['name'];this[_0x014a('0x9')]=this[_0x014a('0x7')]?util[_0x014a('0xa')](_0x014a('0xb'),this[_0x014a('0x7')]):_0x5a61ac||undefined;this[_0x014a('0xc')]=checkNameSurname(_0x12e8da[_0x014a('0xd')][_0x014a('0xe')],_0x12e8da[_0x014a('0xd')][_0x014a('0xf')],_0x12e8da[_0x014a('0xd')][_0x014a('0x10')]);this['active']=_0x12e8da[_0x014a('0x11')]||![];this[_0x014a('0x12')]=_0x12e8da['phone'];this[_0x014a('0x13')]=_0x12e8da[_0x014a('0x13')];this['countbusyretry']=_0x12e8da[_0x014a('0x14')]||0x0;this[_0x014a('0x15')]=_0x12e8da[_0x014a('0x15')]||0x0;this[_0x014a('0x16')]=_0x12e8da[_0x014a('0x16')]||0x0;this[_0x014a('0x17')]=(_0x12e8da[_0x014a('0x14')]||0x0)+(_0x12e8da[_0x014a('0x15')]||0x0)+(_0x12e8da[_0x014a('0x16')]||0x0)+(_0x12e8da[_0x014a('0x18')]||0x0)+(_0x12e8da[_0x014a('0x19')]||0x0)+(_0x12e8da[_0x014a('0x1a')]||0x0)+(_0x12e8da[_0x014a('0x1b')]||0x0)+(_0x12e8da[_0x014a('0x1c')]||0x0);this['countnosuchnumberretry']=_0x12e8da[_0x014a('0x18')]||0x0;this[_0x014a('0x19')]=_0x12e8da[_0x014a('0x19')]||0x0;this[_0x014a('0x1a')]=_0x12e8da[_0x014a('0x1a')]||0x0;this[_0x014a('0x1b')]=_0x12e8da[_0x014a('0x1b')]||0x0;this[_0x014a('0x1c')]=_0x12e8da[_0x014a('0x1c')]||0x0;this['callback']=_0x12e8da[_0x014a('0x1d')];this['callbackuniqueid']=_0x12e8da[_0x014a('0x1e')];this[_0x014a('0x1f')]=_0x12e8da[_0x014a('0x1f')];this[_0x014a('0x20')]=_0x12e8da[_0x014a('0x20')];this[_0x014a('0x21')]=_0x12e8da[_0x014a('0x21')];this[_0x014a('0x22')]=_0x12e8da[_0x014a('0x22')];this['UserId']=_[_0x014a('0x2')](_0x12e8da['Agent'])?_0x12e8da[_0x014a('0x23')]:_0x12e8da[_0x014a('0x8')]['id'];this['VoiceQueueId']=_0x12e8da['VoiceQueueId'];this[_0x014a('0x24')]='';this[_0x014a('0x25')]='';}Action[_0x014a('0x26')]['getCaller']=function(){return util[_0x014a('0xa')](_0x014a('0x27'),this['calleridname'],this[_0x014a('0x28')]);};module[_0x014a('0x29')]=Action; \ No newline at end of file +var _0x160f=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','type','campaigntype','queue','Agent','channelAgent','membername','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat'];(function(_0x38c3ef,_0x4851a2){var _0x421227=function(_0x1d85dd){while(--_0x1d85dd){_0x38c3ef['push'](_0x38c3ef['shift']());}};_0x421227(++_0x4851a2);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf160('0x0'));var _=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));function checkNameSurname(_0x2966aa,_0x5bf9e1,_0x4513f1){var _0x2fb414='';if(!_[_0xf160('0x3')](_0x5bf9e1)&&_0xf160('0x4')===typeof _0x5bf9e1){_0x2fb414+=_0x5bf9e1;}if(!_[_0xf160('0x3')](_0x4513f1)&&_0xf160('0x4')===typeof _0x4513f1){_0x2fb414+='\x20'+_0x4513f1;}if(_0x2fb414!==''){return _0x2fb414;}return _0x2966aa;}function Action(_0x4a6f3d,_0x311d63,_0x11902f,_0x49fe49,_0x59440e){this[_0xf160('0x5')]=_0x11902f||undefined;this['idContact']=_0x4a6f3d['id'];this['queue']=_0x311d63['name'];this[_0xf160('0x6')]=_0x311d63[_0xf160('0x6')];this[_0xf160('0x7')]=_0xf160('0x8');this['dialAnswer']=![];this['membername']=_[_0xf160('0x3')](_0x4a6f3d[_0xf160('0x9')])?undefined:_0x4a6f3d[_0xf160('0x9')]['name'];this[_0xf160('0xa')]=this[_0xf160('0xb')]?util[_0xf160('0xc')](_0xf160('0xd'),this[_0xf160('0xb')]):_0x49fe49||undefined;this['calleridname']=checkNameSurname(_0x4a6f3d[_0xf160('0xe')]['phone'],_0x4a6f3d[_0xf160('0xe')][_0xf160('0xf')],_0x4a6f3d[_0xf160('0xe')][_0xf160('0x10')]);this[_0xf160('0x11')]=_0x4a6f3d[_0xf160('0x11')]||![];this[_0xf160('0x12')]=_0x4a6f3d[_0xf160('0x13')];this[_0xf160('0x14')]=_0x4a6f3d['scheduledat'];this[_0xf160('0x15')]=_0x4a6f3d[_0xf160('0x15')]||0x0;this[_0xf160('0x16')]=_0x4a6f3d[_0xf160('0x16')]||0x0;this['countnoanswerretry']=_0x4a6f3d[_0xf160('0x17')]||0x0;this['countglobal']=(_0x4a6f3d[_0xf160('0x15')]||0x0)+(_0x4a6f3d[_0xf160('0x16')]||0x0)+(_0x4a6f3d[_0xf160('0x17')]||0x0)+(_0x4a6f3d[_0xf160('0x18')]||0x0)+(_0x4a6f3d[_0xf160('0x19')]||0x0)+(_0x4a6f3d[_0xf160('0x1a')]||0x0)+(_0x4a6f3d[_0xf160('0x1b')]||0x0)+(_0x4a6f3d[_0xf160('0x1c')]||0x0);this[_0xf160('0x18')]=_0x4a6f3d['countnosuchnumberretry']||0x0;this[_0xf160('0x19')]=_0x4a6f3d[_0xf160('0x19')]||0x0;this[_0xf160('0x1a')]=_0x4a6f3d['countabandonedretry']||0x0;this[_0xf160('0x1b')]=_0x4a6f3d[_0xf160('0x1b')]||0x0;this[_0xf160('0x1c')]=_0x4a6f3d[_0xf160('0x1c')]||0x0;this[_0xf160('0x1d')]=_0x4a6f3d[_0xf160('0x1d')];this[_0xf160('0x1e')]=_0x4a6f3d['callbackuniqueid'];this[_0xf160('0x1f')]=_0x4a6f3d[_0xf160('0x1f')];this[_0xf160('0x20')]=_0x4a6f3d[_0xf160('0x20')];this['ContactId']=_0x4a6f3d[_0xf160('0x21')];this[_0xf160('0x22')]=_0x4a6f3d['ListId'];this['UserId']=_[_0xf160('0x3')](_0x4a6f3d[_0xf160('0x9')])?_0x4a6f3d[_0xf160('0x23')]:_0x4a6f3d['Agent']['id'];this[_0xf160('0x24')]=_0x4a6f3d[_0xf160('0x24')];this[_0xf160('0x25')]='';this[_0xf160('0x26')]='';}Action[_0xf160('0x27')][_0xf160('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0xf160('0x29')]);};module[_0xf160('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 13599d3..483fb82 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 _0x0f4d=['abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','name','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','originated','pTalking','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','dialRecallInQueue','createBody','createCustomerHistory','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','sendMessageOneNotActive','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','countnosuchnumberretry','dialNoSuchNumberMaxRetry','scheduledAt','activeContact','linkedid','incrementPreviewCounters','idContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','buildObj','connect','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','countbusyretry','unlockAgent','swapAdditionalPhones','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','checkInBlack','isNil','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','status','reachable','SIP/%s','unmonitored','execRun','unlock','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','unlockContact','[syncHangup][talking][transfer]','variables','syncVarSet','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','syncHangupRequest','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x38aa8f,_0x24deaf){_0x38aa8f=_0x38aa8f-0x0;var _0x59b644=_0x0f4d[_0x38aa8f];return _0x59b644;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xd0f4('0x0'));var moment=require('moment');var md5=require(_0xd0f4('0x1'));var Redis=require(_0xd0f4('0x2'));var config=require(_0xd0f4('0x3'));var logger=require(_0xd0f4('0x4'))(_0xd0f4('0x5'));var loggerAction=require(_0xd0f4('0x4'))(_0xd0f4('0x6'));var ami=require(_0xd0f4('0x7'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xd0f4('0x8'));var Action=require(_0xd0f4('0x9'));var ut=require('./util/util');config[_0xd0f4('0xa')]=_[_0xd0f4('0xb')](config['redis'],{'host':_0xd0f4('0xc'),'port':0x18eb});var io=require(_0xd0f4('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xd0f4('0xe')][_0xd0f4('0xf')]=function(_0x38b4ab){this['tail']=this['tail']?this[_0xd0f4('0x10')][_0xd0f4('0x11')](_0x38b4ab):_0x38b4ab();};function Preview(_0x288388){this[_0xd0f4('0x12')]=new Sequence();this[_0xd0f4('0x13')]=_0x288388[_0xd0f4('0x14')];this[_0xd0f4('0x15')]=_0x288388['trunks'];this[_0xd0f4('0x16')]={};this[_0xd0f4('0x17')]=_0x288388['agents'];this[_0xd0f4('0x18')]=0x0;ami['on']('originateresponse',this[_0xd0f4('0x19')]['bind'](this));ami['on'](_0xd0f4('0x1a'),this['syncHangup']['bind'](this));ami['on']('hanguprequest',this[_0xd0f4('0x1b')][_0xd0f4('0x1c')](this));ami['on'](_0xd0f4('0x1d'),this[_0xd0f4('0x1e')][_0xd0f4('0x1c')](this));ami['on'](_0xd0f4('0x1f'),this[_0xd0f4('0x20')][_0xd0f4('0x1c')](this));ami['on'](_0xd0f4('0x21'),this['syncVarSet'][_0xd0f4('0x1c')](this));ami['on'](_0xd0f4('0x22'),this[_0xd0f4('0x23')][_0xd0f4('0x1c')](this));ami['on']('blindtransfer',this[_0xd0f4('0x24')][_0xd0f4('0x1c')](this));this[_0xd0f4('0x25')](this[_0xd0f4('0x13')]);}function emit(_0x4e1689,_0x38b112,_0xda1d14){io['to'](_0x4e1689)[_0xd0f4('0x26')](_0x38b112,_0xda1d14);}function emitCampaignPreview(_0x1e799f){if(_0x1e799f[_0xd0f4('0x27')]===_0xd0f4('0x28')){var _0x25ee43={'id':_0x1e799f['id'],'name':_0x1e799f['name'],'strategy':_0x1e799f[_0xd0f4('0x29')],'answered':_0x1e799f[_0xd0f4('0x2a')],'available':_0x1e799f[_0xd0f4('0x2b')],'loggedIn':_0x1e799f[_0xd0f4('0x2c')],'pTalking':_0x1e799f['pTalking'],'sumBillable':_0x1e799f[_0xd0f4('0x2d')],'sumDuration':_0x1e799f['sumDuration'],'sumHoldTime':_0x1e799f[_0xd0f4('0x2e')]||0x0,'talking':_0x1e799f[_0xd0f4('0x2f')],'total':_0x1e799f[_0xd0f4('0x30')],'type':_0x1e799f['type'],'unmanaged':_0x1e799f[_0xd0f4('0x31')],'abandoned':_0x1e799f[_0xd0f4('0x32')],'waiting':_0x1e799f[_0xd0f4('0x33')],'loggedInDb':_0x1e799f[_0xd0f4('0x34')],'dialActive':_0x1e799f[_0xd0f4('0x35')],'dialMethod':_0x1e799f['dialMethod'],'dialOriginateCallerIdName':_0x1e799f[_0xd0f4('0x36')],'dialOriginateCallerIdNumber':_0x1e799f[_0xd0f4('0x37')],'dialOriginateTimeout':_0x1e799f[_0xd0f4('0x38')],'dialPrefix':_0x1e799f[_0xd0f4('0x39')],'outboundAnswerAgiCallsDay':_0x1e799f[_0xd0f4('0x3a')],'outboundAnswerCallsDay':_0x1e799f[_0xd0f4('0x3b')],'outboundBlacklistCallsDay':_0x1e799f[_0xd0f4('0x3c')],'outboundBusyCallsDay':_0x1e799f[_0xd0f4('0x3d')],'outboundCongestionCallsDay':_0x1e799f[_0xd0f4('0x3e')],'outboundDropCallsDayACS':_0x1e799f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1e799f[_0xd0f4('0x3f')],'outboundDropCallsDayTimeout':_0x1e799f[_0xd0f4('0x40')],'outboundNoAnswerCallsDay':_0x1e799f[_0xd0f4('0x41')],'outboundNoSuchCallsDay':_0x1e799f[_0xd0f4('0x42')],'outboundOriginateFailureCallsDay':_0x1e799f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1e799f[_0xd0f4('0x43')],'outboundRejectCallsDay':_0x1e799f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1e799f['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1e799f['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x1e799f[_0xd0f4('0x44')],'predictiveIntervalAvgHoldtime':_0x1e799f[_0xd0f4('0x45')],'predictiveIntervalAvgTalktime':_0x1e799f[_0xd0f4('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x1e799f[_0xd0f4('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x1e799f[_0xd0f4('0x48')],'predictiveIntervalErlangCalls':_0x1e799f[_0xd0f4('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x1e799f[_0xd0f4('0x4a')],'predictiveIntervalHitRate':_0x1e799f[_0xd0f4('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x1e799f['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1e799f[_0xd0f4('0x4c')],'predictiveIntervalAvailable':_0x1e799f['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1e799f[_0xd0f4('0x4d')],'message':_0x1e799f[_0xd0f4('0x4e')],'originated':_0x1e799f['originated'],'erlangCalls':_0x1e799f['erlangCalls'],'erlangCallToSecond':_0x1e799f[_0xd0f4('0x4f')],'erlangAbandonmentRate':_0x1e799f['erlangAbandonmentRate'],'erlangBusyFactor':_0x1e799f[_0xd0f4('0x50')],'startPredictive':_0x1e799f[_0xd0f4('0x51')],'startProgressive':_0x1e799f['startProgressive']};if(_0x1e799f[_0xd0f4('0x52')]){_0x25ee43[_0xd0f4('0x52')]={'id':_0x1e799f['Trunk']['id'],'name':_0x1e799f['Trunk'][_0xd0f4('0x53')],'active':_0x1e799f[_0xd0f4('0x52')]['active'],'callerid':_0x1e799f[_0xd0f4('0x52')]['callerid']};}if(_0x1e799f[_0xd0f4('0x54')]){_0x25ee43[_0xd0f4('0x54')]={'id':_0x1e799f['Interval']['id'],'name':_0x1e799f[_0xd0f4('0x54')][_0xd0f4('0x53')]};}var _0x40e383=md5(JSON[_0xd0f4('0x55')](_0x25ee43));if(_0x1e799f[_0xd0f4('0x1')]!==_0x40e383){_0x1e799f['md5']=_0x40e383;emit(util[_0xd0f4('0x56')](_0xd0f4('0x57'),_0x25ee43[_0xd0f4('0x53')]),_0xd0f4('0x58'),_0x25ee43);}}}function emitVoiceQueueChannelRemove(_0x4ccdf2){logger[_0xd0f4('0x59')](_0xd0f4('0x5a'),JSON[_0xd0f4('0x55')](_0x4ccdf2));emit(util[_0xd0f4('0x56')](_0xd0f4('0x57'),_0x4ccdf2[_0xd0f4('0x53')]),'voice_queue_channel:remove',_0x4ccdf2);io[_0xd0f4('0x26')](_0xd0f4('0x5b'),_0x4ccdf2);}function notSendMessagesQueue(_0x196ccc){if(_0x196ccc['sendMessageOneNotActive']){if(_0x196ccc[_0xd0f4('0x5c')]===0x0&&_0x196ccc[_0xd0f4('0x5d')]===0x0){_0x196ccc['sendMessageOneNotActive']=![];_0x196ccc[_0xd0f4('0x2b')]=0x0;_0x196ccc[_0xd0f4('0x5e')]=0x0;_0x196ccc['message']='NOT_ACTIVE';ut[_0xd0f4('0x5f')](_0xd0f4('0x60'),_0x196ccc[_0xd0f4('0x53')]+'\x20is\x20not\x20active');}else{_0x196ccc[_0xd0f4('0x4e')]='DEACTIVATED';ut[_0xd0f4('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x196ccc[_0xd0f4('0x53')]+_0xd0f4('0x61'));}emitCampaignPreview(_0x196ccc);}}Preview[_0xd0f4('0xe')][_0xd0f4('0x25')]=function(){var _0x4f342b=this;setInterval(function(){_0x4f342b[_0xd0f4('0x62')]();},0x7cf);};Preview[_0xd0f4('0xe')][_0xd0f4('0x62')]=function(){var _0x4c8b9a=this['campaignsPreview'];this[_0xd0f4('0x18')]+=0x1;for(var _0x457e2d in _0x4c8b9a){if(_0x4c8b9a[_0xd0f4('0x63')](_0x457e2d)&&(_0x4c8b9a[_0x457e2d][_0xd0f4('0x64')]===_0xd0f4('0x5')||_0x4c8b9a[_0x457e2d][_0xd0f4('0x64')]===_0xd0f4('0x65'))&&_0x4c8b9a[_0x457e2d][_0xd0f4('0x27')]===_0xd0f4('0x28')){if(this[_0xd0f4('0x18')]>0x7){this[_0xd0f4('0x18')]=0x0;this[_0xd0f4('0x66')]();}}if(_0x4c8b9a['hasOwnProperty'](_0x457e2d)&&_0x4c8b9a[_0x457e2d][_0xd0f4('0x64')]===_0xd0f4('0x5')&&_0x4c8b9a[_0x457e2d]['type']===_0xd0f4('0x28')){if(_0x4c8b9a[_0x457e2d][_0xd0f4('0x35')]){this[_0xd0f4('0x67')](_0x4c8b9a[_0x457e2d]);if(_0x4c8b9a[_0x457e2d][_0xd0f4('0x68')])this[_0xd0f4('0x69')](_0x4c8b9a[_0x457e2d]);}else{notSendMessagesQueue(_0x4c8b9a[_0x457e2d]);}}}};Preview[_0xd0f4('0xe')][_0xd0f4('0x6a')]=function(_0x4ae7f6){var _0x199f98=this;this[_0xd0f4('0x12')][_0xd0f4('0xf')](function(){if(!_['isNil'](_0x199f98[_0xd0f4('0x16')][_0x4ae7f6])){loggerAction[_0xd0f4('0x59')](_0xd0f4('0x6b'),_0x4ae7f6,_0xd0f4('0x6c'),_0x199f98[_0xd0f4('0x16')][_0x4ae7f6][_0xd0f4('0x6d')],'originated:\x20',JSON['stringify'](_0x199f98[_0xd0f4('0x13')][_0x199f98[_0xd0f4('0x16')][_0x4ae7f6][_0xd0f4('0x6d')]][_0xd0f4('0x5c')]),'pTalking:\x20',JSON[_0xd0f4('0x55')](_0x199f98[_0xd0f4('0x13')][_0x199f98['actions'][_0x4ae7f6][_0xd0f4('0x6d')]][_0xd0f4('0x5d')]),JSON[_0xd0f4('0x55')](_0x199f98[_0xd0f4('0x16')][_0x4ae7f6][_0xd0f4('0x6e')]),JSON[_0xd0f4('0x55')](_[_0xd0f4('0x6f')](_0x199f98[_0xd0f4('0x16')][_0x4ae7f6],[_0xd0f4('0x70'),_0xd0f4('0x71'),_0xd0f4('0x72'),_0xd0f4('0x73')])));return ami[_0xd0f4('0x74')]({'action':'status','channel':_0x199f98[_0xd0f4('0x16')][_0x4ae7f6][_0xd0f4('0x75')]})[_0xd0f4('0x76')](function(_0x52fb3d){if(_0x52fb3d[_0xd0f4('0x4e')]===_0xd0f4('0x77')){setTimeout(function(){if(_0x199f98[_0xd0f4('0x16')][_0x4ae7f6]){ut['updateOriginated'](_0x199f98[_0xd0f4('0x13')][_0x199f98['actions'][_0x4ae7f6][_0xd0f4('0x6d')]],'[clearZombieChannel]');if(_0x199f98['actions'][_0x4ae7f6][_0xd0f4('0x6e')]===!![]){ut[_0xd0f4('0x78')](_0x199f98[_0xd0f4('0x13')][_0x199f98[_0xd0f4('0x16')][_0x4ae7f6][_0xd0f4('0x6d')]],_0xd0f4('0x79'));ut['loggerError'](_0xd0f4('0x7a')+_0x4ae7f6,_0x199f98[_0xd0f4('0x16')][_0x4ae7f6][_0xd0f4('0x6d')]);}ut[_0xd0f4('0x7b')](_0xd0f4('0x7c')+_0x4ae7f6,_0x199f98[_0xd0f4('0x16')][_0x4ae7f6]['queue']);delete _0x199f98[_0xd0f4('0x16')][_0x4ae7f6];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x40d43c=this;loggerAction[_0xd0f4('0x59')](_0xd0f4('0x7d'),_['size'](this[_0xd0f4('0x16')]));for(var _0x1506e0 in this[_0xd0f4('0x16')]){if(_0x40d43c[_0xd0f4('0x16')][_0xd0f4('0x63')](_0x1506e0)){_0x40d43c[_0xd0f4('0x6a')](_0x1506e0);}}};Preview[_0xd0f4('0xe')][_0xd0f4('0x69')]=function(_0x3137e7){var _0x3cb0aa=this;rpcDb['getContactRecallMe'](_0x3137e7['id'],ut[_0xd0f4('0x7e')](this[_0xd0f4('0x17')]))[_0xd0f4('0x7f')](function(_0x13180b){if(!_['isNil'](_0x13180b)){for(var _0xb83d39=0x0;_0xb83d39<_0x13180b[_0xd0f4('0x80')];_0xb83d39+=0x1){if(ut[_0xd0f4('0x81')](_0x13180b[_0xb83d39][_0xd0f4('0x82')])<_0x3137e7[_0xd0f4('0x83')]*0x3c){if(_0x13180b[_0xb83d39][_0xd0f4('0x84')]&&!_0x13180b[_0xb83d39]['Agent']['voicePause']){_0x3cb0aa[_0xd0f4('0x85')](_0x13180b[_0xb83d39]['id'])[_0xd0f4('0x7f')](ut[_0xd0f4('0x86')](_0xd0f4('0x87')))[_0xd0f4('0x76')](ut[_0xd0f4('0x86')]('[RecallMe]'));}else{rpcDb[_0xd0f4('0x88')](_0x13180b[_0xb83d39]['id']);}}else{var _0x344ef9=new Action(_0x13180b[_0xb83d39],_0x3137e7);_0x344ef9[_0xd0f4('0x89')]=moment()['format'](_0xd0f4('0x8a'));_0x3137e7[_0xd0f4('0x43')]+=0x1;ut['logCustomer'](_0x344ef9,0x17,'RecallInQueue');if(_0x3137e7[_0xd0f4('0x8b')]){rpcDb['rescheduleContactInQueue'](ut[_0xd0f4('0x8c')](_0x13180b[_0xb83d39]));rpcDb[_0xd0f4('0x8d')](_0x344ef9,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xd0f4('0x8e')](_0x344ef9,0x16,_0xd0f4('0x8f'));rpcDb['createCustomerHistory'](_0x344ef9,_0xd0f4('0x90'));rpcDb[_0xd0f4('0x91')](_0x344ef9,_0xd0f4('0x90'));}}}}})['catch'](ut['logger2'](_0xd0f4('0x92')));};Preview[_0xd0f4('0xe')]['setMessage']=function(_0x351461){_0x351461[_0xd0f4('0x93')]=!![];if(ut['IsNotLoggedIn'](_0x351461[_0xd0f4('0x2c')])){_0x351461[_0xd0f4('0x4e')]=_0xd0f4('0x94');}else if(!ut[_0xd0f4('0x95')](_0x351461[_0xd0f4('0x35')])){_0x351461['message']=_0xd0f4('0x96');}else if(!this['isTrunkReachable'](_0x351461[_0xd0f4('0x52')])){if(!this[_0xd0f4('0x97')](_0x351461[_0xd0f4('0x98')])){_0x351461[_0xd0f4('0x4e')]=_0xd0f4('0x99');}else{_0x351461['message']='ACTIVE';}}else{_0x351461['message']=_0xd0f4('0x9a');}emitCampaignPreview(_0x351461);};Preview[_0xd0f4('0xe')][_0xd0f4('0x9b')]=function(_0x2f6423,_0x2145ad,_0xf430bb){var _0x3d9370=this;var _0x43c886=this[_0xd0f4('0x16')][_0x2145ad];var _0x685d1b=this[_0xd0f4('0x13')][_0x43c886[_0xd0f4('0x6d')]];var _0x5c60fd;var _0x4ab2aa=![];var _0x3b7c6f=0x2;var _0x53b64b=0x3;if(_0x685d1b){switch(_0xf430bb){case'1':_0x685d1b[_0xd0f4('0x42')]+=0x1;_0x43c886['countnosuchnumberretry']+=0x1;_0x43c886[_0xd0f4('0x9c')]=ut['totalGlobal'](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0x0,_0xd0f4('0x9d'));ami[_0xd0f4('0x26')](_0xd0f4('0x9e'),ut['buildObj'](_0x43c886,_0xd0f4('0x9f')));rpcDb['createCustomerHistory'](_0x43c886,_0xd0f4('0xa0'));_0x3d9370[_0xd0f4('0xa1')](_0x43c886,'0',_0x685d1b)[_0xd0f4('0x7f')](function(_0x8d1444){_0x4ab2aa=_0x8d1444[_0xd0f4('0xa2')]==0x1;_0x3b7c6f=_0x685d1b[_0xd0f4('0xa3')];_0x53b64b=_0x685d1b[_0xd0f4('0xa4')];if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut[_0xd0f4('0xa7')](_0x43c886,0xf,_0xd0f4('0xa8'));rpcDb[_0xd0f4('0x91')](_0x5c60fd,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x43c886[_0xd0f4('0xa9')]>=_0x685d1b[_0xd0f4('0xaa')]){rpcDb['createCustomerFinal'](_0x43c886,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0xd0f4('0xab')](_0x43c886,_0xd0f4('0xa9'),_0x685d1b[_0xd0f4('0xa3')]),_0x43c886['unlockAgent'],_0x43c886[_0xd0f4('0xac')]);}}delete this[_0xd0f4('0x16')][_0x2f6423[_0xd0f4('0xad')]];}else{_0x43c886[_0xd0f4('0xa9')]++;logger[_0xd0f4('0x59')]('actioncountonusuch',_0x43c886[_0xd0f4('0xa9')]);logger[_0xd0f4('0x59')]('id',_0x43c886['idContact']);_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886[_0xd0f4('0xaf')],'field':{'countnosuchnumberretry':_0x43c886['countnosuchnumberretry']}})['then'](function(){_0x3d9370['swapAdditionalPhones'](_0x43c886,_0x3b7c6f,_0x53b64b)[_0xd0f4('0x7f')](function(){});});}});break;case _0xd0f4('0xb0'):var _0xefae8c=moment()[_0xd0f4('0x56')](_0xd0f4('0x8a'));_0x43c886[_0xd0f4('0xb1')]=_0xefae8c;_0x43c886[_0xd0f4('0xb2')]=_0xefae8c;_0x43c886[_0xd0f4('0x6e')]=!![];_0x685d1b[_0xd0f4('0x5d')]+=0x1;logger[_0xd0f4('0x59')](_0xd0f4('0xb3'),_0x43c886[_0xd0f4('0xb4')],'\x20Queue',_0x685d1b[_0xd0f4('0x53')],_0xd0f4('0xb5'),_0x685d1b[_0xd0f4('0x5d')]);ami[_0xd0f4('0x26')]('custom:agentconnect',ut[_0xd0f4('0xb6')](_0x43c886,_0xd0f4('0xb7'),this[_0xd0f4('0x13')][_0x43c886[_0xd0f4('0x6d')]]));if(_0x685d1b['acw']){ami['emit'](_0xd0f4('0xb8'),ut['buildAcw'](_0x43c886));}break;case'16':ami[_0xd0f4('0x26')](_0xd0f4('0xb9'),ut[_0xd0f4('0xb6')](_0x43c886,'complete',this[_0xd0f4('0x13')][_0x43c886[_0xd0f4('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0xd0f4('0xb6')](_0x43c886,_0xd0f4('0xba')));_0x685d1b[_0xd0f4('0x3b')]+=0x1;_0x685d1b[_0xd0f4('0x30')]+=0x1;_0x685d1b[_0xd0f4('0x2a')]+=0x1;ut[_0xd0f4('0x78')](_0x685d1b,_0xd0f4('0xbb'));_0x43c886[_0xd0f4('0x9c')]=ut[_0xd0f4('0xa5')](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0x4,_0xd0f4('0xbc'));rpcDb[_0xd0f4('0x8d')](_0x43c886,_0xd0f4('0xbd'));rpcDb[_0xd0f4('0x91')](_0x43c886,_0xd0f4('0xbe'));rpcDb[_0xd0f4('0xbf')](_0x43c886);_0x685d1b[_0xd0f4('0xc0')]+=_0x43c886[_0xd0f4('0xc1')];_0x685d1b[_0xd0f4('0x2d')]+=_0x43c886[_0xd0f4('0xc1')];logger[_0xd0f4('0x59')](_0xd0f4('0xc2'),_0x43c886[_0xd0f4('0xb4')],_0xd0f4('0xc3'),_0x685d1b[_0xd0f4('0x53')],'pTalking:\x20',_0x685d1b['pTalking']);delete this['actions'][_0x2f6423[_0xd0f4('0xad')]];break;case'BUSY':_0x685d1b[_0xd0f4('0x3d')]+=0x1;_0x43c886['countbusyretry']+=0x1;_0x43c886[_0xd0f4('0x9c')]=ut['totalGlobal'](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0x5,_0xd0f4('0xc4'));_0x3b7c6f=_0x685d1b[_0xd0f4('0xc5')];_0x53b64b=_0x685d1b[_0xd0f4('0xa4')];ami[_0xd0f4('0x26')](_0xd0f4('0xc6'),ut[_0xd0f4('0xb6')](_0x43c886,'busy'));rpcDb[_0xd0f4('0x8d')](_0x43c886,_0xd0f4('0xc7'));_0x3d9370[_0xd0f4('0xa1')](_0x43c886,'5',_0x685d1b)[_0xd0f4('0x7f')](function(_0x341871){_0x4ab2aa=_0x341871[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b['dialGlobalMaxRetry']){_0x5c60fd=ut[_0xd0f4('0xa7')](_0x43c886,0xf,'Global');rpcDb['createCustomerFinal'](_0x5c60fd,_0xd0f4('0xc8'));}else{if(_0x43c886['countbusyretry']>=_0x685d1b[_0xd0f4('0xc9')]){rpcDb[_0xd0f4('0x91')](_0x43c886,_0xd0f4('0xc7'));}else{rpcDb[_0xd0f4('0xca')](ut[_0xd0f4('0xab')](_0x43c886,_0xd0f4('0xcb'),_0x685d1b[_0xd0f4('0xc5')]),_0x43c886[_0xd0f4('0xcc')],_0x43c886[_0xd0f4('0xac')]);}}}else{_0x43c886[_0xd0f4('0xcb')]++;_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886[_0xd0f4('0xaf')],'field':{'countbusyretry':_0x43c886[_0xd0f4('0xcb')]}})[_0xd0f4('0x7f')](function(){_0x3d9370[_0xd0f4('0xcd')](_0x43c886,_0x3b7c6f,_0x53b64b)['then'](function(){});});}});break;case'NOANSWER':_0x685d1b[_0xd0f4('0x41')]+=0x1;_0x43c886[_0xd0f4('0xce')]+=0x1;_0x43c886['countglobal']=ut[_0xd0f4('0xa5')](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0x3,_0xd0f4('0xcf'));_0x3b7c6f=_0x685d1b[_0xd0f4('0xd0')];_0x53b64b=_0x685d1b[_0xd0f4('0xa4')];ami[_0xd0f4('0x26')](_0xd0f4('0xd1'),ut[_0xd0f4('0xb6')](_0x43c886,_0xd0f4('0xd2')));rpcDb[_0xd0f4('0x8d')](_0x43c886,_0xd0f4('0xd3'));_0x3d9370[_0xd0f4('0xa1')](_0x43c886,'3',_0x685d1b)['then'](function(_0x3e3d05){_0x4ab2aa=_0x3e3d05[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut['cloneAction'](_0x43c886,0xf,'Global');rpcDb[_0xd0f4('0x91')](_0x5c60fd,_0xd0f4('0xd4'));}else{if(_0x43c886[_0xd0f4('0xce')]>=_0x685d1b[_0xd0f4('0xd5')]){rpcDb[_0xd0f4('0x91')](_0x43c886,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xd0f4('0xca')](ut[_0xd0f4('0xab')](_0x43c886,_0xd0f4('0xce'),_0x685d1b[_0xd0f4('0xd0')]),_0x43c886[_0xd0f4('0xcc')],_0x43c886[_0xd0f4('0xac')]);}}}else{_0x43c886[_0xd0f4('0xce')]++;_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886['idContact'],'field':{'countnoanswerretry':_0x43c886[_0xd0f4('0xce')]}})[_0xd0f4('0x7f')](function(){_0x3d9370[_0xd0f4('0xcd')](_0x43c886,_0x3b7c6f,_0x53b64b)[_0xd0f4('0x7f')](function(){});});}});break;case _0xd0f4('0xd6'):_0x685d1b[_0xd0f4('0x3e')]+=0x1;_0x43c886[_0xd0f4('0xd7')]+=0x1;_0x43c886[_0xd0f4('0x9c')]=ut[_0xd0f4('0xa5')](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0x8,_0xd0f4('0xd8'));_0x3b7c6f=_0x685d1b[_0xd0f4('0xd9')];_0x53b64b=_0x685d1b[_0xd0f4('0xa4')];ami[_0xd0f4('0x26')](_0xd0f4('0xda'),ut[_0xd0f4('0xb6')](_0x43c886,'congestion'));rpcDb[_0xd0f4('0x8d')](_0x43c886,_0xd0f4('0xdb'));_0x3d9370[_0xd0f4('0xa1')](_0x43c886,'8',_0x685d1b)[_0xd0f4('0x7f')](function(_0x2bb6ec){_0x4ab2aa=_0x2bb6ec[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut[_0xd0f4('0xa7')](_0x43c886,0xf,_0xd0f4('0xa8'));rpcDb['createCustomerFinal'](_0x5c60fd,_0xd0f4('0xdc'));}else{if(_0x43c886['countcongestionretry']>=_0x685d1b[_0xd0f4('0xdd')]){rpcDb[_0xd0f4('0x91')](_0x43c886,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0xd0f4('0xab')](_0x43c886,'countcongestionretry',_0x685d1b[_0xd0f4('0xc5')]),_0x43c886[_0xd0f4('0xcc')],_0x43c886['activeContact']);}}}else{_0x43c886[_0xd0f4('0xd7')]++;_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886[_0xd0f4('0xaf')],'field':{'countcongestionretry':_0x43c886[_0xd0f4('0xd7')]}})[_0xd0f4('0x7f')](function(){_0x3d9370[_0xd0f4('0xcd')](_0x43c886,_0x3b7c6f,_0x53b64b)[_0xd0f4('0x7f')](function(){});});}});break;case _0xd0f4('0xde'):_0x685d1b[_0xd0f4('0xdf')]+=0x1;_0x43c886[_0xd0f4('0xe0')]+=0x1;_0x43c886[_0xd0f4('0x9c')]=ut['totalGlobal'](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0x14,'AgentReject');_0x3b7c6f=_0x685d1b[_0xd0f4('0xe1')];_0x53b64b=_0x685d1b['callAdditionalPhoneAfterMin'];ami['emit'](_0xd0f4('0xe2'),ut[_0xd0f4('0xb6')](_0x43c886,_0xd0f4('0xe3')));rpcDb[_0xd0f4('0x8d')](_0x43c886,_0xd0f4('0xe4'));_0x3d9370[_0xd0f4('0xa1')](_0x43c886,'20',_0x685d1b)['then'](function(_0x259838){_0x4ab2aa=_0x259838[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut[_0xd0f4('0xa7')](_0x43c886,0x14,_0xd0f4('0xe5'));rpcDb[_0xd0f4('0x91')](_0x5c60fd,_0xd0f4('0xe6'));}else{if(_0x43c886[_0xd0f4('0xe0')]>=_0x685d1b[_0xd0f4('0xe7')]){rpcDb[_0xd0f4('0x91')](_0x43c886,_0xd0f4('0xe6'));}else{rpcDb[_0xd0f4('0xca')](ut[_0xd0f4('0xab')](_0x43c886,_0xd0f4('0xe0'),_0x685d1b[_0xd0f4('0xe1')]),_0x43c886[_0xd0f4('0xcc')],_0x43c886['activeContact']);}}}else{_0x43c886[_0xd0f4('0xce')]++;_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886[_0xd0f4('0xaf')],'field':{'countnoanswerretry':_0x43c886[_0xd0f4('0xce')]}})[_0xd0f4('0x7f')](function(){_0x3d9370[_0xd0f4('0xcd')](_0x43c886,_0x3b7c6f,_0x53b64b)[_0xd0f4('0x7f')](function(){});});}});break;case _0xd0f4('0xe8'):_0x685d1b[_0xd0f4('0xe9')]+=0x1;_0x43c886[_0xd0f4('0xea')]+=0x1;_0x43c886['countglobal']=ut[_0xd0f4('0xa5')](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0xb,_0xd0f4('0xeb'));rpcDb[_0xd0f4('0x8d')](_0x43c886,'[callProgressDetectingCustomer][logAbandoned]');_0x3d9370['verifyAdditionalPhones'](_0x43c886,'11',_0x685d1b)['then'](function(_0x468b42){_0x4ab2aa=_0x468b42[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut[_0xd0f4('0xa7')](_0x43c886,0xf,'Global');rpcDb[_0xd0f4('0x91')](_0x5c60fd,_0xd0f4('0xec'));}else{if(_0x43c886[_0xd0f4('0xed')]>=_0x685d1b[_0xd0f4('0xee')]){rpcDb['createCustomerFinal'](_0x43c886,_0xd0f4('0xec'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x43c886,_0xd0f4('0xea'),_0x685d1b[_0xd0f4('0xef')]),_0x43c886[_0xd0f4('0xcc')],_0x43c886['activeContact']);}}}else{_0x43c886['countnoanswerretry']++;_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886[_0xd0f4('0xaf')],'field':{'countnoanswerretry':_0x43c886[_0xd0f4('0xce')]}})['then'](function(){_0x3d9370[_0xd0f4('0xcd')](_0x43c886,_0x3b7c6f,_0x53b64b)[_0xd0f4('0x7f')](function(){});});}});break;case'18':_0x685d1b[_0xd0f4('0xf0')]+=0x1;_0x43c886[_0xd0f4('0xf1')]+=0x1;_0x43c886['countglobal']=ut[_0xd0f4('0xa5')](_0x43c886);ut['logCustomer'](_0x43c886,0x12,_0x2f6423[_0xd0f4('0xf2')]||_0x2f6423[_0xd0f4('0xf3')]);ami[_0xd0f4('0x26')](_0xd0f4('0xf4'),ut['buildObj'](_0x43c886,_0xd0f4('0xf5')));rpcDb['createCustomerHistory'](_0x43c886,'[callProgressDetectingCustomer][hangupInAMD]');_0x3d9370['verifyAdditionalPhones'](_0x43c886,'18',_0x685d1b)[_0xd0f4('0x7f')](function(_0x516f96){_0x4ab2aa=_0x516f96[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut[_0xd0f4('0xa7')](_0x43c886,0x12,_0xd0f4('0xa8'));rpcDb['createCustomerFinal'](_0x5c60fd,_0xd0f4('0xf6'));}else{rpcDb[_0xd0f4('0x91')](_0x43c886,_0xd0f4('0xf6'));}}else{_0x43c886[_0xd0f4('0xce')]++;_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886[_0xd0f4('0xaf')],'field':{'countnoanswerretry':_0x43c886[_0xd0f4('0xce')]}})[_0xd0f4('0x7f')](function(){_0x3d9370[_0xd0f4('0xcd')](_0x43c886,_0x3b7c6f,_0x53b64b)['then'](function(){});});}});delete this['actions'][_0x2f6423[_0xd0f4('0xad')]];break;case'19':_0x685d1b[_0xd0f4('0xf0')]+=0x1;_0x43c886[_0xd0f4('0x9c')]=ut[_0xd0f4('0xa5')](_0x43c886);ut['logCustomer'](_0x43c886,0x13,_0x2f6423['cause-txt']||_0x2f6423[_0xd0f4('0xf3')]);ami['emit'](_0xd0f4('0xf4'),ut[_0xd0f4('0xb6')](_0x43c886,'amd'));rpcDb[_0xd0f4('0x8d')](_0x43c886,'[callProgressDetectingCustomer][machine]');_0x3d9370[_0xd0f4('0xa1')](_0x43c886,'18',_0x685d1b)['then'](function(_0x4fe0b9){_0x4ab2aa=_0x4fe0b9[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut[_0xd0f4('0xa5')](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut[_0xd0f4('0xa7')](_0x43c886,0xf,_0xd0f4('0xa8'));rpcDb[_0xd0f4('0x91')](_0x5c60fd,_0xd0f4('0xf7'));}else{rpcDb[_0xd0f4('0x91')](_0x43c886,_0xd0f4('0xf7'));}}else{_0x43c886[_0xd0f4('0xce')]++;_0x3d9370[_0xd0f4('0xae')]({'id':_0x43c886['idContact'],'field':{'countnoanswerretry':_0x43c886['countnoanswerretry']}})[_0xd0f4('0x7f')](function(){_0x3d9370['swapAdditionalPhones'](_0x43c886,_0x3b7c6f,_0x53b64b)[_0xd0f4('0x7f')](function(){});});}});delete this[_0xd0f4('0x16')][_0x2f6423[_0xd0f4('0xad')]];break;default:if(_0x43c886[_0xd0f4('0x6e')]){ut[_0xd0f4('0x78')](_0x685d1b,'[default]');ut[_0xd0f4('0x7b')](_0xd0f4('0xf8')+_0x685d1b[_0xd0f4('0x53')],_0x2f6423);}_0x685d1b['outboundUnknownCallsDay']+=0x1;_0x43c886['countglobal']=ut[_0xd0f4('0xa5')](_0x43c886);ut[_0xd0f4('0x8e')](_0x43c886,0xc,_0x2f6423[_0xd0f4('0xf2')]||_0x2f6423['dialstatus']);_0x3b7c6f=_0x685d1b[_0xd0f4('0xe1')];_0x53b64b=_0x685d1b[_0xd0f4('0xa4')];rpcDb[_0xd0f4('0x8d')](_0x43c886,_0xd0f4('0xf9'));_0x3d9370[_0xd0f4('0xa1')](_0x43c886,'20',_0x685d1b)[_0xd0f4('0x7f')](function(_0x200859){_0x4ab2aa=_0x200859[_0xd0f4('0xa2')]==0x1;if(!_0x4ab2aa){if(ut['totalGlobal'](_0x43c886)>=_0x685d1b[_0xd0f4('0xa6')]){_0x5c60fd=ut['cloneAction'](_0x43c886,0xf,_0xd0f4('0xa8'));rpcDb[_0xd0f4('0x91')](_0x5c60fd,_0xd0f4('0xfa'));}else{rpcDb[_0xd0f4('0x91')](_0x43c886,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xd0f4('0x16')][_0x2f6423['linkedid']];}else{_0x3d9370[_0xd0f4('0xcd')](_0x43c886,_0x3b7c6f,_0x53b64b)[_0xd0f4('0x7f')](function(_0x3ecaea){});}});}if(!(_0x43c886[_0xd0f4('0x6e')]&&_0xf430bb==='16')){ut[_0xd0f4('0xfb')](_0x685d1b,_0xd0f4('0xfc'));logger[_0xd0f4('0x59')](_0xd0f4('0xfd'),_0x43c886['uniqueid'],_0xd0f4('0xc3'),_0x685d1b[_0xd0f4('0x53')],_0xd0f4('0xfe'),_0x685d1b[_0xd0f4('0x5c')]);}if(_0xf430bb!==_0xd0f4('0xb0')){delete this[_0xd0f4('0x16')][_0x2f6423[_0xd0f4('0xad')]];delete this[_0xd0f4('0x16')][_0x2f6423[_0xd0f4('0xff')]];}}};Preview[_0xd0f4('0xe')][_0xd0f4('0x100')]=function(_0x1b3bd7,_0x4c9fff,_0x14df47){if(_['isUndefined'](_0x4c9fff)&&_0xd0f4('0x101')!==typeof _0x4c9fff){return;}if(_[_0xd0f4('0x102')](_0x14df47)&&_0xd0f4('0x101')!==typeof _0x14df47){return;}switch(_0x14df47[_0xd0f4('0x103')]){case'0':ut[_0xd0f4('0x104')](_0x1b3bd7,0x0,_0xd0f4('0x9d'));rpcDb['createAgentHistory'](_0x1b3bd7,_0xd0f4('0x105'));break;case'3':ut['logAgent'](_0x1b3bd7,0x3,_0xd0f4('0xcf'));rpcDb[_0xd0f4('0x106')](_0x1b3bd7,_0xd0f4('0x107'));break;case'5':ut['logAgent'](_0x1b3bd7,0x5,'Busy');rpcDb[_0xd0f4('0x106')](_0x1b3bd7,_0xd0f4('0x108'));break;case'8':ut[_0xd0f4('0x104')](_0x1b3bd7,0x8,_0xd0f4('0xd8'));rpcDb[_0xd0f4('0x106')](_0x1b3bd7,_0xd0f4('0x109'));break;case'22':ut['logAgent'](_0x1b3bd7,0x16,_0xd0f4('0x10a'));rpcDb[_0xd0f4('0x106')](_0x1b3bd7,_0xd0f4('0x10b'));break;default:ut['logAgent'](_0x1b3bd7,0xc,_0x14df47[_0xd0f4('0x103')]);rpcDb[_0xd0f4('0x106')](_0x1b3bd7,'[callProgressDetectingAgent][logCongestion]');}ut[_0xd0f4('0xfb')](_0x4c9fff,_0xd0f4('0x10c'));logger[_0xd0f4('0x59')]('[originated][decrement][callProgressDetectingAgent]',_0x1b3bd7[_0xd0f4('0xb4')],'\x20Queue',_0x4c9fff[_0xd0f4('0x53')],_0xd0f4('0xfe'),_0x4c9fff[_0xd0f4('0x5c')]);delete this[_0xd0f4('0x16')][_0x1b3bd7[_0xd0f4('0xb4')]];};Preview[_0xd0f4('0xe')][_0xd0f4('0xa1')]=function(_0x2e2441,_0x5b1e32,_0x14866e){return BPromise[_0xd0f4('0x10d')]()[_0xd0f4('0x7f')](cmHopperAdditionalPhone[_0xd0f4('0xa1')](_0x2e2441,_0x5b1e32,_0x14866e))[_0xd0f4('0x76')](logger[_0xd0f4('0x59')](_0xd0f4('0x10e')));};Preview[_0xd0f4('0xe')]['swapAdditionalPhones']=function(_0x47e333,_0x5aba0b,_0x80889d){return BPromise['resolve']()[_0xd0f4('0x7f')](cmHopperAdditionalPhone[_0xd0f4('0xcd')](_0x47e333,_0x5aba0b,_0x80889d))[_0xd0f4('0x76')](logger[_0xd0f4('0x59')]('[swapAdditionalPhone]\x20'));};Preview[_0xd0f4('0xe')][_0xd0f4('0xae')]=function(_0x568c8b){return BPromise[_0xd0f4('0x10d')]()[_0xd0f4('0x7f')](cmHopperAdditionalPhone[_0xd0f4('0xae')](_0x568c8b))['catch'](logger[_0xd0f4('0x59')]('[incrementPreviewCounters]\x20'));};Preview[_0xd0f4('0xe')][_0xd0f4('0x10f')]=function(_0x4930b6,_0xa9a1ff,_0x510834,_0x17b14c,_0x520f6b){var _0x11f3cc=this;return new BPromise(function(_0x795d16,_0x485b5d){if(_[_0xd0f4('0x110')](_0xa9a1ff)||_[_0xd0f4('0x110')](_0xa9a1ff[_0xd0f4('0x111')])||_[_0xd0f4('0x110')](_0xa9a1ff[_0xd0f4('0x112')])||_[_0xd0f4('0x110')](_0xa9a1ff[_0xd0f4('0x72')])){_0x485b5d(ut[_0xd0f4('0x4e')](_0xd0f4('0x113'),_0x17b14c,_0x520f6b));return;}var _0x45f064=uuid['v4']();var _0x506ca6=_0x11f3cc[_0xd0f4('0x13')][_0xa9a1ff['Queue'][_0xd0f4('0x53')]];var _0x3486a5=_0x510834?_0x11f3cc[_0xd0f4('0x17')][_0x510834]['id']:undefined;_0x11f3cc[_0xd0f4('0x16')][_0x45f064]=new Action(_0xa9a1ff,_0x506ca6,_0x45f064,_0x510834,_0x3486a5);var _0x4ce0d6=_0x11f3cc[_0xd0f4('0x16')][_0x45f064];_0x4ce0d6[_0xd0f4('0xcc')]=_0x17b14c;_0x4ce0d6[_0xd0f4('0xac')]=_0x520f6b;_0x4ce0d6[_0xd0f4('0x114')]=_0x510834;if(_['isEmpty'](_0x4930b6)){_0x11f3cc[_0xd0f4('0x115')](_0x4ce0d6,_0x506ca6,_0xa9a1ff,_0x510834)[_0xd0f4('0x7f')](function(_0x5c3ce4){logger[_0xd0f4('0x59')](_0xd0f4('0x116'),'Queue:\x20'+_0x4ce0d6[_0xd0f4('0x6d')]+_0xd0f4('0x117')+_0x4ce0d6[_0xd0f4('0xaf')],JSON[_0xd0f4('0x55')](_0x5c3ce4));ami[_0xd0f4('0x26')](_0xd0f4('0x118'),ut[_0xd0f4('0xb6')](_0x4ce0d6,_0xd0f4('0x119'),_0x11f3cc[_0xd0f4('0x13')][_0x4ce0d6[_0xd0f4('0x6d')]]));_0x795d16(ut['message']('Calling'));})[_0xd0f4('0x76')](function(_0x36315a){ut[_0xd0f4('0x5f')](_0xd0f4('0x11a'),_0x36315a);_0x485b5d(ut[_0xd0f4('0x4e')](_0xd0f4('0x11b'),_0x17b14c,_0x520f6b));});}else{_0x506ca6[_0xd0f4('0x3c')]+=0x1;ut[_0xd0f4('0x11c')](_0x4ce0d6);rpcDb[_0xd0f4('0x11d')](_0x4ce0d6,'[Blacklist][error]');delete _0x11f3cc[_0xd0f4('0x16')][_0x45f064];_0x485b5d(ut['message'](_0xd0f4('0x11e'),_0x17b14c,_0x520f6b));}});};Preview['prototype'][_0xd0f4('0x97')]=function(_0x4f71b6){return!_['isNil'](_0x4f71b6)&&!_[_0xd0f4('0x110')](_0x4f71b6[_0xd0f4('0x53')])&&!_[_0xd0f4('0x110')](_0x4f71b6[_0xd0f4('0x11f')])&&_0x4f71b6['active']&&!_[_0xd0f4('0x110')](this[_0xd0f4('0x15')][util['format']('SIP/%s',_0x4f71b6[_0xd0f4('0x53')])])&&!_['isNil'](this[_0xd0f4('0x15')][util['format']('SIP/%s',_0x4f71b6[_0xd0f4('0x53')])][_0xd0f4('0x120')])&&(this[_0xd0f4('0x15')][util['format']('SIP/%s',_0x4f71b6['name'])]['status']===_0xd0f4('0x121')||this['trunks'][util[_0xd0f4('0x56')](_0xd0f4('0x122'),_0x4f71b6[_0xd0f4('0x53')])][_0xd0f4('0x120')]===_0xd0f4('0x123'));};Preview[_0xd0f4('0xe')][_0xd0f4('0x85')]=function(_0x253e1b,_0x22cb1f){var _0x13f920=this;return new BPromise(function(_0x2e1563,_0x37e161){_0x13f920[_0xd0f4('0x124')](_0x253e1b,_0x22cb1f)[_0xd0f4('0x7f')](function(_0x57efe0){_0x2e1563(_[_0xd0f4('0x6f')](_0x57efe0,[_0xd0f4('0x4e')]));})[_0xd0f4('0x76')](function(_0xffa419){if(_0xffa419[_0xd0f4('0x125')]){rpcDb['unlockContact'](_0x253e1b);}if(_0xffa419[_0xd0f4('0x11f')]){rpcDb[_0xd0f4('0x88')](_0x253e1b);}_0x37e161(_[_0xd0f4('0x6f')](_0xffa419,[_0xd0f4('0x4e')]));});});};Preview[_0xd0f4('0xe')][_0xd0f4('0x124')]=function(_0x3a7ffe,_0x114f86){var _0x4f5a9e=this;return new BPromise(function(_0x5348a6,_0x506b55){var _0x18094f,_0x5abedf;rpcDb['getContactPreview'](_0x3a7ffe)['then'](function(_0x5e0e26){if(!_[_0xd0f4('0x110')](_0x5e0e26[0x0])){_0x5abedf=_0x5e0e26[0x0]['recallme']?![]:!![];_0x18094f=_0x5e0e26[0x0][_0xd0f4('0x126')]?!![]:![];_0x18094f=_0x114f86?!![]:_0x18094f;}var _0x435601=_0x4f5a9e['validateContact'](_0x5e0e26);if(_0x435601[_0xd0f4('0x127')]){rpcDb[_0xd0f4('0x128')](_['pick'](_0x5e0e26[0x0],['VoiceQueueId',_0xd0f4('0x112')]))[_0xd0f4('0x7f')](function(_0x339eb2){_0x4f5a9e[_0xd0f4('0x10f')](_0x339eb2,_0x5e0e26[0x0],_0x114f86,_0x5abedf,_0x18094f)[_0xd0f4('0x7f')](function(_0x301b95){_0x5348a6(_0x301b95);})[_0xd0f4('0x76')](function(_0x4e0d03){_0x506b55(_0x4e0d03);});})['catch'](function(_0xb94930){ut[_0xd0f4('0x5f')](_0xd0f4('0x129'),_0xb94930);_0x506b55(ut[_0xd0f4('0x4e')](_0xd0f4('0x12a'),_0x5abedf,_0x18094f));});}else{_0x506b55(ut[_0xd0f4('0x4e')](_0x435601['message'],_0x5abedf,_0x18094f));}})[_0xd0f4('0x76')](function(_0x375ab6){ut[_0xd0f4('0x5f')](_0xd0f4('0x12b'),_0x375ab6);_0x506b55(ut[_0xd0f4('0x4e')](_0xd0f4('0x12a'),![],!![]));});});};Preview[_0xd0f4('0xe')][_0xd0f4('0x12c')]=function(_0x291bba){if(_[_0xd0f4('0x110')](_0x291bba)||_[_0xd0f4('0x12d')](_0x291bba)||!_[_0xd0f4('0x110')](_0x291bba[0x0]['Agent'])&&_['isNil'](_0x291bba[0x0]['Agent'][_0xd0f4('0x53')])){ut[_0xd0f4('0x5f')](_0xd0f4('0x12e'),_0x291bba);return{'isValid':![],'message':'Empty\x20Contact'};}var _0xf494dc=this['campaignsPreview'][_0x291bba[0x0][_0xd0f4('0x6c')][_0xd0f4('0x53')]];_0xf494dc['message']=_0xd0f4('0x9a');if(_[_0xd0f4('0x110')](_0xf494dc)){ut[_0xd0f4('0x5f')](_0xd0f4('0x12f'),_0xf494dc);return{'isValid':![],'message':_0xd0f4('0x130')};}if(!this[_0xd0f4('0x97')](_0xf494dc[_0xd0f4('0x52')])){ut[_0xd0f4('0x5f')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xd0f4('0x131')+_0xf494dc[_0xd0f4('0x53')]+_0xd0f4('0x132'));if(!this[_0xd0f4('0x97')](_0xf494dc['TrunkBackup'])){ut[_0xd0f4('0x5f')](_0xd0f4('0x133'),_0xf494dc['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xd0f4('0x95')](_0xf494dc[_0xd0f4('0x35')])){ut[_0xd0f4('0x5f')](_0xd0f4('0x134'),_0xf494dc['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xd0f4('0x131')+_0xf494dc[_0xd0f4('0x53')]+_0xd0f4('0x135')};}return{'isValid':!![],'message':_0xd0f4('0x136')};};Preview[_0xd0f4('0xe')][_0xd0f4('0x115')]=function(_0x1bef63,_0x4b3c0b,_0x5cc400,_0xa27ad5){var _0xe05aab=this;return new BPromise(function(_0x552c9d,_0x308666){var _0x25945c=_0x1bef63[_0xd0f4('0xb4')];var _0x485098=_0xe05aab[_0xd0f4('0x97')](_0x4b3c0b[_0xd0f4('0x52')])?util[_0xd0f4('0x56')](_0xd0f4('0x137'),_0x4b3c0b['Trunk'][_0xd0f4('0x53')],_['isNil'](_0x4b3c0b[_0xd0f4('0x39')])?'':_0x4b3c0b['dialPrefix'][_0xd0f4('0x138')]()||'',_0x4b3c0b[_0xd0f4('0x139')]>0x0?_0x5cc400[_0xd0f4('0x112')]['substring'](_0x4b3c0b[_0xd0f4('0x139')]):_0x5cc400[_0xd0f4('0x112')]):util['format']('SIP/%s/%s%s',_[_0xd0f4('0x110')](_0x4b3c0b['TrunkBackup'])?_0x4b3c0b[_0xd0f4('0x52')][_0xd0f4('0x53')]:_0x4b3c0b[_0xd0f4('0x98')][_0xd0f4('0x53')],_[_0xd0f4('0x110')](_0x4b3c0b[_0xd0f4('0x39')])?'':_0x4b3c0b['dialPrefix']['trim']()||'',_0x4b3c0b[_0xd0f4('0x139')]>0x0?_0x5cc400[_0xd0f4('0x112')][_0xd0f4('0x13a')](_0x4b3c0b[_0xd0f4('0x139')]):_0x5cc400[_0xd0f4('0x112')]);var _0x20cb6f=_0xe05aab['isTrunkReachable'](_0x4b3c0b[_0xd0f4('0x52')])?ut[_0xd0f4('0x13b')](_0x4b3c0b[_0xd0f4('0x52')][_0xd0f4('0x13c')],_0x4b3c0b[_0xd0f4('0x36')],_0x4b3c0b['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd0f4('0x13d')](_0x4b3c0b[_0xd0f4('0x37')],_0x4b3c0b['dialRandomLastDigitCallerIdNumber']):_0x4b3c0b[_0xd0f4('0x37')]):ut[_0xd0f4('0x13b')](_['isNil'](_0x4b3c0b[_0xd0f4('0x98')])?_0x4b3c0b[_0xd0f4('0x52')]['callerid']:_0x4b3c0b[_0xd0f4('0x98')]['callerid'],_0x4b3c0b[_0xd0f4('0x36')],_0x4b3c0b['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd0f4('0x13d')](_0x4b3c0b[_0xd0f4('0x37')],_0x4b3c0b['dialRandomLastDigitCallerIdNumber']):_0x4b3c0b['dialOriginateCallerIdNumber']);if(_0x20cb6f){_0x1bef63[_0xd0f4('0x13e')]=ut[_0xd0f4('0x13f')](_0x20cb6f);_0x1bef63[_0xd0f4('0x140')]=ut['extractCalleridNumber'](_0x20cb6f);}var _0x4da4ce=ut['addVariables'](_0x4b3c0b,_0x5cc400,_0x485098,_0x20cb6f,_0x25945c,_0x1bef63);_['merge'](_0x1bef63,ut[_0xd0f4('0x141')](_0x4da4ce));_0x1bef63[_0xd0f4('0x89')]=moment()[_0xd0f4('0x56')](_0xd0f4('0x8a'));ami[_0xd0f4('0x74')](ut[_0xd0f4('0x142')](_0x1bef63,_0x4b3c0b,_0x4da4ce,_0x1bef63['activeContact'],_0xa27ad5))[_0xd0f4('0x7f')](function(_0x31fa54){_0x4b3c0b[_0xd0f4('0x5c')]+=0x1;logger[_0xd0f4('0x59')](_0xd0f4('0x143'),_0x25945c,_0xd0f4('0xc3'),_0x4b3c0b['name'],_0xd0f4('0xfe'),_0x4b3c0b['originated']);_0x552c9d(_0x31fa54);})[_0xd0f4('0x76')](function(_0x1beda9){ut[_0xd0f4('0x104')](_0x1bef63,0xe,'OriginateError');rpcDb[_0xd0f4('0x106')](_0x1bef63,_0xd0f4('0x144'));_0x308666(_0x1beda9);});});};Preview['prototype'][_0xd0f4('0x20')]=function(_0x599643){if(this[_0xd0f4('0x16')][_0x599643[_0xd0f4('0xad')]]){this[_0xd0f4('0x16')][_0x599643[_0xd0f4('0xad')]][_0xd0f4('0x75')]=_0x599643[_0xd0f4('0x75')];}};Preview[_0xd0f4('0xe')][_0xd0f4('0x19')]=function(_0x52fe02){var _0x533a01=this;var _0x1a9b0b=this[_0xd0f4('0x16')][_0x52fe02[_0xd0f4('0x145')]];if(_0x1a9b0b){if(_0x1a9b0b[_0xd0f4('0x114')]&&this['agents'][_0x1a9b0b['lookAgent']]){ut[_0xd0f4('0x146')](_0x1a9b0b,this[_0xd0f4('0x17')][_0x1a9b0b['lookAgent']][_0xd0f4('0x53')],this[_0xd0f4('0x17')][_0x1a9b0b['lookAgent']]['id']);}var _0x4caa7e=_[_0xd0f4('0x147')](_0x1a9b0b);_0x4caa7e[_0xd0f4('0xb1')]=moment()[_0xd0f4('0x56')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3573b1=_0x533a01[_0xd0f4('0x13')][_0x1a9b0b[_0xd0f4('0x6d')]];if(ut[_0xd0f4('0x148')](_0x52fe02['response'])){if(_0x1a9b0b[_0xd0f4('0xcc')]){rpcDb['unlockContact'](_0x1a9b0b[_0xd0f4('0xaf')]);}if(_0x1a9b0b[_0xd0f4('0xac')]){rpcDb[_0xd0f4('0x88')](_0x1a9b0b[_0xd0f4('0xaf')]);}ami['emit'](_0xd0f4('0x149'),ut[_0xd0f4('0xb6')](_0x1a9b0b,_0xd0f4('0x14a'),this['campaignsPreview'][_0x1a9b0b['queue']]));this[_0xd0f4('0x100')](_0x4caa7e,_0x3573b1,_0x52fe02);}else{_0x1a9b0b[_0xd0f4('0x89')]=moment()['format'](_0xd0f4('0x8a'));ut[_0xd0f4('0x104')](_0x4caa7e,0x4,'Answer');rpcDb['createAgentHistory'](_0x4caa7e,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype']['syncHangup']=function(_0x31cb4e){var _0x1f8071=this;var _0x10b023=this['actions'][_0x31cb4e[_0xd0f4('0xad')]];var _0x4d81e0;if(_0x10b023){_0x4d81e0=this[_0xd0f4('0x13')][_0x10b023[_0xd0f4('0x6d')]];logger[_0xd0f4('0x59')](_0xd0f4('0x14b'),_0x31cb4e[_0xd0f4('0xad')],_0xd0f4('0xc3'),_0x4d81e0[_0xd0f4('0x53')],'pTalking:\x20',_0x4d81e0['pTalking']);}if(this[_0xd0f4('0x16')][_0x31cb4e[_0xd0f4('0xad')]]&&_0x31cb4e[_0xd0f4('0xad')]!==_0x31cb4e[_0xd0f4('0xb4')]){if(_0x31cb4e[_0xd0f4('0x14c')]==='16'&&this[_0xd0f4('0x16')][_0x31cb4e['linkedid']]['dialAnswer']){this[_0xd0f4('0x9b')](_0x31cb4e,_0x31cb4e[_0xd0f4('0xad')],_0x31cb4e[_0xd0f4('0x14c')]);}else if(this[_0xd0f4('0x16')][_0x31cb4e[_0xd0f4('0xad')]][_0xd0f4('0x6e')]){logger[_0xd0f4('0x59')](_0xd0f4('0x14d'),_0x31cb4e[_0xd0f4('0xad')],_0x31cb4e[_0xd0f4('0x14c')],_0xd0f4('0xc3'),_0x4d81e0[_0xd0f4('0x53')],_0xd0f4('0xb5'),_0x4d81e0[_0xd0f4('0x5d')]);this[_0xd0f4('0x9b')](_0x31cb4e,_0x31cb4e['linkedid'],_0x31cb4e[_0xd0f4('0x14c')]);}}else if(_0x10b023&&_['isNil'](_0x10b023[_0xd0f4('0x14e')])&&_0x4d81e0[_0xd0f4('0x14f')]&&_0x31cb4e[_0xd0f4('0xad')]===_0x31cb4e[_0xd0f4('0xb4')]&&_['isNil'](_0x31cb4e[_0xd0f4('0x103')])&&_0x31cb4e[_0xd0f4('0x14c')]==='16'&&_0x31cb4e['channelstate']==='6'&&_[_0xd0f4('0x102')](_0x10b023[_0xd0f4('0x150')])){if(_0x10b023['unlockAgent']){rpcDb[_0xd0f4('0x151')](_0x10b023[_0xd0f4('0xaf')]);}if(_0x10b023[_0xd0f4('0xac')]){rpcDb[_0xd0f4('0x88')](_0x10b023[_0xd0f4('0xaf')]);}_0x31cb4e[_0xd0f4('0x103')]='22';this[_0xd0f4('0x100')](_0x10b023,_0x4d81e0,_0x31cb4e);}else if(_0x10b023&&_0x10b023[_0xd0f4('0x150')]){if(_0x31cb4e[_0xd0f4('0x14c')]==='16'&&this[_0xd0f4('0x16')][_0x31cb4e[_0xd0f4('0xad')]][_0xd0f4('0x6e')]){logger[_0xd0f4('0x59')](_0xd0f4('0x152'),_0x31cb4e[_0xd0f4('0xad')],_0x31cb4e['cause'],'\x20Queue',_0x4d81e0['name'],'pTalking:\x20',_0x4d81e0[_0xd0f4('0x5d')]);this[_0xd0f4('0x9b')](_0x31cb4e,_0x31cb4e['linkedid'],_0x31cb4e[_0xd0f4('0x14c')]);}else if(this['actions'][_0x31cb4e['linkedid']][_0xd0f4('0x6e')]){logger[_0xd0f4('0x59')](_0xd0f4('0x14d'),_0x31cb4e['linkedid'],_0x31cb4e[_0xd0f4('0x14c')],'\x20Queue',_0x4d81e0[_0xd0f4('0x53')],_0xd0f4('0xb5'),_0x4d81e0[_0xd0f4('0x5d')]);this[_0xd0f4('0x9b')](_0x31cb4e,_0x31cb4e[_0xd0f4('0xad')],_0x31cb4e[_0xd0f4('0x14c')]);}}};Preview[_0xd0f4('0xe')][_0xd0f4('0x1e')]=function(_0x55f7bf){if(this['actions'][_0x55f7bf[_0xd0f4('0xff')]]&&_0x55f7bf[_0xd0f4('0xff')]!==_0x55f7bf['destuniqueid']){this[_0xd0f4('0x9b')](_0x55f7bf,_0x55f7bf['destlinkedid'],_0x55f7bf[_0xd0f4('0xf3')]);}};Preview[_0xd0f4('0xe')]['syncHangupRequest']=function(_0x15eac6){if(this[_0xd0f4('0x16')][_0x15eac6[_0xd0f4('0xad')]]&&_0x15eac6[_0xd0f4('0xad')]!==_0x15eac6['uniqueid']&&!this[_0xd0f4('0x16')][_0x15eac6[_0xd0f4('0xad')]][_0xd0f4('0x6e')]){if(_0x15eac6[_0xd0f4('0x14c')]==='1'){this['callProgressDetectingCustomer'](_0x15eac6,_0x15eac6[_0xd0f4('0xad')],_0x15eac6[_0xd0f4('0x14c')]);}}};Preview[_0xd0f4('0xe')]['addVariable']=function(_0x3a7a24,_0x272df6,_0x484f01){if(this[_0xd0f4('0x16')][_0x3a7a24]){if(_[_0xd0f4('0x110')](this[_0xd0f4('0x16')][_0x3a7a24][_0xd0f4('0x153')])){this[_0xd0f4('0x16')][_0x3a7a24]['variables']={};}this['actions'][_0x3a7a24]['variables'][_0x272df6]=_0x484f01;}};Preview[_0xd0f4('0xe')][_0xd0f4('0x154')]=function(_0x42b9aa){try{if(!_['isNil'](_0x42b9aa)){if(ut['filterKey'](_[_0xd0f4('0x155')](_0x42b9aa[_0xd0f4('0x156')])[0x0])){this['addVariable'](_0x42b9aa['uniqueid'],_[_0xd0f4('0x155')](_0x42b9aa[_0xd0f4('0x156')])[0x0],_0x42b9aa[_0xd0f4('0x157')]);}}}catch(_0x48aec0){logger[_0xd0f4('0x158')](_0xd0f4('0x159'),util[_0xd0f4('0x15a')](_0x48aec0,{'showHidden':![],'depth':null}));}};Preview[_0xd0f4('0xe')]['syncAttendedTransfer']=function(_0x120c5b){if(_0x120c5b){if(this[_0xd0f4('0x16')][_0x120c5b['transfertargetlinkedid']]){this[_0xd0f4('0x16')][_0x120c5b[_0xd0f4('0x15b')]]['transfer']=!![];}}};Preview['prototype'][_0xd0f4('0x24')]=function(_0x5efffc){if(_0x5efffc){if(this['actions'][_0x5efffc['transfererlinkedid']]){this['actions'][_0x5efffc[_0xd0f4('0x15c')]][_0xd0f4('0x150')]=!![];}}};module[_0xd0f4('0x15d')]=Preview; \ No newline at end of file +var _0x2123=['campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','destuniqueid','destlinkedid','syncHangupRequest','addVariable','variables','syncVarSet','keys','variable','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','redis','localhost','socket.io-emitter','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','name','strategy','answered','available','loggedIn','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','originated','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','prototype','hasOwnProperty','booked','outbound','clearZombieChannels','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pick','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','dialAnswer','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','then','length','getDiff','Agent','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','AGENTS_NOT_LOGGED','isActive','dialActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','totalGlobal','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','Answer','crateCustomerReportQueue','\x20Queue','BUSY','countbusyretry','Busy','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','[callProgressDetectingCustomer][logNoAnswer]','additional','dialNoAnswerMaxRetry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','createAgentHistory','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','unmonitored','run','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]'];(function(_0x2a49c8,_0x2301ff){var _0x5483a8=function(_0x3d371f){while(--_0x3d371f){_0x2a49c8['push'](_0x2a49c8['shift']());}};_0x5483a8(++_0x2301ff);}(_0x2123,0x190));var _0x3212=function(_0x10ae33,_0x473784){_0x10ae33=_0x10ae33-0x0;var _0x4f9a88=_0x2123[_0x10ae33];return _0x4f9a88;};'use strict';var util=require(_0x3212('0x0'));var _=require(_0x3212('0x1'));var BPromise=require(_0x3212('0x2'));var uuid=require(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var md5=require(_0x3212('0x5'));var Redis=require(_0x3212('0x6'));var config=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var loggerAction=require(_0x3212('0x8'))(_0x3212('0xa'));var ami=require('../ami');var rpcDb=require(_0x3212('0xb'));var cmHopperAdditionalPhone=require(_0x3212('0xc'));var Action=require(_0x3212('0xd'));var ut=require('./util/util');config[_0x3212('0xe')]=_['defaults'](config[_0x3212('0xe')],{'host':_0x3212('0xf'),'port':0x18eb});var io=require(_0x3212('0x10'))(new Redis(config[_0x3212('0xe')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x3a1f28){this[_0x3212('0x11')]=this[_0x3212('0x11')]?this[_0x3212('0x11')][_0x3212('0x12')](_0x3a1f28):_0x3a1f28();};function Preview(_0x2aaa7a){this[_0x3212('0x13')]=new Sequence();this[_0x3212('0x14')]=_0x2aaa7a[_0x3212('0x15')];this[_0x3212('0x16')]=_0x2aaa7a[_0x3212('0x16')];this[_0x3212('0x17')]={};this[_0x3212('0x18')]=_0x2aaa7a[_0x3212('0x18')];this[_0x3212('0x19')]=0x0;ami['on'](_0x3212('0x1a'),this[_0x3212('0x1b')][_0x3212('0x1c')](this));ami['on'](_0x3212('0x1d'),this[_0x3212('0x1e')][_0x3212('0x1c')](this));ami['on'](_0x3212('0x1f'),this['syncHangupRequest'][_0x3212('0x1c')](this));ami['on'](_0x3212('0x20'),this[_0x3212('0x21')][_0x3212('0x1c')](this));ami['on'](_0x3212('0x22'),this[_0x3212('0x23')][_0x3212('0x1c')](this));ami['on']('varset',this['syncVarSet'][_0x3212('0x1c')](this));ami['on']('attendedtransfer',this[_0x3212('0x24')][_0x3212('0x1c')](this));ami['on'](_0x3212('0x25'),this[_0x3212('0x26')][_0x3212('0x1c')](this));this['loopCampaigns'](this[_0x3212('0x14')]);}function emit(_0x462094,_0x49c598,_0x459b55){io['to'](_0x462094)[_0x3212('0x27')](_0x49c598,_0x459b55);}function emitCampaignPreview(_0x293b96){if(_0x293b96['type']==='outbound'){var _0x255d00={'id':_0x293b96['id'],'name':_0x293b96[_0x3212('0x28')],'strategy':_0x293b96[_0x3212('0x29')],'answered':_0x293b96[_0x3212('0x2a')],'available':_0x293b96[_0x3212('0x2b')],'loggedIn':_0x293b96[_0x3212('0x2c')],'pTalking':_0x293b96['pTalking'],'sumBillable':_0x293b96['sumBillable'],'sumDuration':_0x293b96[_0x3212('0x2d')],'sumHoldTime':_0x293b96['sumHoldTime']||0x0,'talking':_0x293b96[_0x3212('0x2e')],'total':_0x293b96[_0x3212('0x2f')],'type':_0x293b96[_0x3212('0x30')],'unmanaged':_0x293b96['unmanaged'],'abandoned':_0x293b96[_0x3212('0x31')],'waiting':_0x293b96[_0x3212('0x32')],'loggedInDb':_0x293b96[_0x3212('0x33')],'dialActive':_0x293b96['dialActive'],'dialMethod':_0x293b96[_0x3212('0x34')],'dialOriginateCallerIdName':_0x293b96[_0x3212('0x35')],'dialOriginateCallerIdNumber':_0x293b96[_0x3212('0x36')],'dialOriginateTimeout':_0x293b96[_0x3212('0x37')],'dialPrefix':_0x293b96[_0x3212('0x38')],'outboundAnswerAgiCallsDay':_0x293b96[_0x3212('0x39')],'outboundAnswerCallsDay':_0x293b96[_0x3212('0x3a')],'outboundBlacklistCallsDay':_0x293b96[_0x3212('0x3b')],'outboundBusyCallsDay':_0x293b96[_0x3212('0x3c')],'outboundCongestionCallsDay':_0x293b96[_0x3212('0x3d')],'outboundDropCallsDayACS':_0x293b96[_0x3212('0x3e')],'outboundDropCallsDayCallersExit':_0x293b96[_0x3212('0x3f')],'outboundDropCallsDayTimeout':_0x293b96['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x293b96[_0x3212('0x40')],'outboundNoSuchCallsDay':_0x293b96[_0x3212('0x41')],'outboundOriginateFailureCallsDay':_0x293b96[_0x3212('0x42')],'outboundReCallsDay':_0x293b96[_0x3212('0x43')],'outboundRejectCallsDay':_0x293b96[_0x3212('0x44')],'outboundUnknownCallsDay':_0x293b96[_0x3212('0x45')],'outboundAbandonedCallsDay':_0x293b96[_0x3212('0x46')],'predictiveIntervalAnsweredCalls':_0x293b96['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x293b96[_0x3212('0x47')],'predictiveIntervalAvgTalktime':_0x293b96['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x293b96[_0x3212('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x293b96['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x293b96[_0x3212('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x293b96['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x293b96['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x293b96[_0x3212('0x4a')],'predictiveIntervalPauses':_0x293b96['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x293b96[_0x3212('0x4b')],'predictiveIntervalTotalCalls':_0x293b96[_0x3212('0x4c')],'message':_0x293b96[_0x3212('0x4d')],'originated':_0x293b96['originated'],'erlangCalls':_0x293b96[_0x3212('0x4e')],'erlangCallToSecond':_0x293b96[_0x3212('0x4f')],'erlangAbandonmentRate':_0x293b96[_0x3212('0x50')],'erlangBusyFactor':_0x293b96['erlangBusyFactor'],'startPredictive':_0x293b96[_0x3212('0x51')],'startProgressive':_0x293b96[_0x3212('0x52')]};if(_0x293b96[_0x3212('0x53')]){_0x255d00[_0x3212('0x53')]={'id':_0x293b96[_0x3212('0x53')]['id'],'name':_0x293b96['Trunk'][_0x3212('0x28')],'active':_0x293b96[_0x3212('0x53')][_0x3212('0x54')],'callerid':_0x293b96['Trunk'][_0x3212('0x55')]};}if(_0x293b96[_0x3212('0x56')]){_0x255d00[_0x3212('0x56')]={'id':_0x293b96[_0x3212('0x56')]['id'],'name':_0x293b96['Interval'][_0x3212('0x28')]};}var _0x3f157c=md5(JSON[_0x3212('0x57')](_0x255d00));if(_0x293b96[_0x3212('0x5')]!==_0x3f157c){_0x293b96['md5']=_0x3f157c;emit(util['format']('voice:queue:%s',_0x255d00['name']),_0x3212('0x58'),_0x255d00);}}}function emitVoiceQueueChannelRemove(_0x436a80){logger[_0x3212('0x59')](_0x3212('0x5a'),JSON['stringify'](_0x436a80));emit(util[_0x3212('0x5b')](_0x3212('0x5c'),_0x436a80[_0x3212('0x28')]),_0x3212('0x5d'),_0x436a80);io['emit']('voice_queue_presence:remove',_0x436a80);}function notSendMessagesQueue(_0x101f4f){if(_0x101f4f[_0x3212('0x5e')]){if(_0x101f4f[_0x3212('0x5f')]===0x0&&_0x101f4f[_0x3212('0x60')]===0x0){_0x101f4f[_0x3212('0x5e')]=![];_0x101f4f[_0x3212('0x2b')]=0x0;_0x101f4f[_0x3212('0x61')]=0x0;_0x101f4f['message']=_0x3212('0x62');ut[_0x3212('0x63')](_0x3212('0x64'),_0x101f4f[_0x3212('0x28')]+'\x20is\x20not\x20active');}else{_0x101f4f[_0x3212('0x4d')]=_0x3212('0x65');ut[_0x3212('0x63')](_0x3212('0x64'),_0x101f4f['name']+_0x3212('0x66'));}emitCampaignPreview(_0x101f4f);}}Preview['prototype'][_0x3212('0x67')]=function(){var _0x1b6bae=this;setInterval(function(){_0x1b6bae[_0x3212('0x68')]();},0x7cf);};Preview[_0x3212('0x69')][_0x3212('0x68')]=function(){var _0x216469=this[_0x3212('0x14')];this[_0x3212('0x19')]+=0x1;for(var _0x5ce6cb in _0x216469){if(_0x216469[_0x3212('0x6a')](_0x5ce6cb)&&(_0x216469[_0x5ce6cb][_0x3212('0x34')]===_0x3212('0x9')||_0x216469[_0x5ce6cb][_0x3212('0x34')]===_0x3212('0x6b'))&&_0x216469[_0x5ce6cb][_0x3212('0x30')]===_0x3212('0x6c')){if(this['clockClearZombieChannels']>0x7){this[_0x3212('0x19')]=0x0;this[_0x3212('0x6d')]();}}if(_0x216469[_0x3212('0x6a')](_0x5ce6cb)&&_0x216469[_0x5ce6cb][_0x3212('0x34')]==='preview'&&_0x216469[_0x5ce6cb]['type']==='outbound'){if(_0x216469[_0x5ce6cb]['dialActive']){this[_0x3212('0x6e')](_0x216469[_0x5ce6cb]);if(_0x216469[_0x5ce6cb]['dialPreviewAutoRecallMe'])this[_0x3212('0x6f')](_0x216469[_0x5ce6cb]);}else{notSendMessagesQueue(_0x216469[_0x5ce6cb]);}}}};Preview[_0x3212('0x69')][_0x3212('0x70')]=function(_0x29f95c){var _0x4be015=this;this[_0x3212('0x13')][_0x3212('0x71')](function(){if(!_[_0x3212('0x72')](_0x4be015['actions'][_0x29f95c])){loggerAction[_0x3212('0x59')](_0x3212('0x73'),_0x29f95c,_0x3212('0x74'),_0x4be015[_0x3212('0x17')][_0x29f95c]['queue'],_0x3212('0x75'),JSON[_0x3212('0x57')](_0x4be015['campaignsPreview'][_0x4be015[_0x3212('0x17')][_0x29f95c][_0x3212('0x76')]][_0x3212('0x5f')]),'pTalking:\x20',JSON['stringify'](_0x4be015[_0x3212('0x14')][_0x4be015[_0x3212('0x17')][_0x29f95c][_0x3212('0x76')]]['pTalking']),JSON[_0x3212('0x57')](_0x4be015[_0x3212('0x17')][_0x29f95c]['dialAnswer']),JSON[_0x3212('0x57')](_[_0x3212('0x77')](_0x4be015[_0x3212('0x17')][_0x29f95c],['contactId','UserId',_0x3212('0x78'),_0x3212('0x79')])));return ami[_0x3212('0x7a')]({'action':_0x3212('0x7b'),'channel':_0x4be015['actions'][_0x29f95c][_0x3212('0x7c')]})[_0x3212('0x7d')](function(_0x3ab8c0){if(_0x3ab8c0['message']===_0x3212('0x7e')){setTimeout(function(){if(_0x4be015['actions'][_0x29f95c]){ut[_0x3212('0x7f')](_0x4be015[_0x3212('0x14')][_0x4be015[_0x3212('0x17')][_0x29f95c][_0x3212('0x76')]],'[clearZombieChannel]');if(_0x4be015[_0x3212('0x17')][_0x29f95c][_0x3212('0x80')]===!![]){ut['decrementTalkink'](_0x4be015[_0x3212('0x14')][_0x4be015[_0x3212('0x17')][_0x29f95c][_0x3212('0x76')]],_0x3212('0x81'));ut[_0x3212('0x82')](_0x3212('0x83')+_0x29f95c,_0x4be015[_0x3212('0x17')][_0x29f95c]['queue']);}ut[_0x3212('0x82')](_0x3212('0x84')+_0x29f95c,_0x4be015[_0x3212('0x17')][_0x29f95c][_0x3212('0x76')]);delete _0x4be015['actions'][_0x29f95c];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x52a506=this;loggerAction[_0x3212('0x59')]('[action]',_[_0x3212('0x85')](this[_0x3212('0x17')]));for(var _0x200c47 in this[_0x3212('0x17')]){if(_0x52a506[_0x3212('0x17')][_0x3212('0x6a')](_0x200c47)){_0x52a506[_0x3212('0x70')](_0x200c47);}}};Preview[_0x3212('0x69')][_0x3212('0x6f')]=function(_0x2b0de2){var _0x527177=this;rpcDb['getContactRecallMe'](_0x2b0de2['id'],ut['agentReadyId'](this['agents']))[_0x3212('0x86')](function(_0x291dc8){if(!_[_0x3212('0x72')](_0x291dc8)){for(var _0x4228b7=0x0;_0x4228b7<_0x291dc8[_0x3212('0x87')];_0x4228b7+=0x1){if(ut[_0x3212('0x88')](_0x291dc8[_0x4228b7]['scheduledat'])<_0x2b0de2['dialRecallMeTimeout']*0x3c){if(_0x291dc8[_0x4228b7][_0x3212('0x89')]&&!_0x291dc8[_0x4228b7][_0x3212('0x89')]['voicePause']){_0x527177['run'](_0x291dc8[_0x4228b7]['id'])[_0x3212('0x86')](ut[_0x3212('0x8a')]('[RecallMe]'))[_0x3212('0x7d')](ut[_0x3212('0x8a')](_0x3212('0x8b')));}else{rpcDb[_0x3212('0x8c')](_0x291dc8[_0x4228b7]['id']);}}else{var _0x40393d=new Action(_0x291dc8[_0x4228b7],_0x2b0de2);_0x40393d['starttime']=moment()[_0x3212('0x5b')](_0x3212('0x8d'));_0x2b0de2[_0x3212('0x43')]+=0x1;ut[_0x3212('0x8e')](_0x40393d,0x17,'RecallInQueue');if(_0x2b0de2[_0x3212('0x8f')]){rpcDb[_0x3212('0x90')](ut[_0x3212('0x91')](_0x291dc8[_0x4228b7]));rpcDb['createCustomerHistory'](_0x40393d,_0x3212('0x92'));}else{ut[_0x3212('0x8e')](_0x40393d,0x16,_0x3212('0x93'));rpcDb[_0x3212('0x94')](_0x40393d,'[HistoryRecallClose]');rpcDb[_0x3212('0x95')](_0x40393d,_0x3212('0x96'));}}}}})[_0x3212('0x7d')](ut[_0x3212('0x8a')]('[getContactRecallMe]'));};Preview[_0x3212('0x69')][_0x3212('0x6e')]=function(_0x4162ae){_0x4162ae[_0x3212('0x5e')]=!![];if(ut['IsNotLoggedIn'](_0x4162ae[_0x3212('0x2c')])){_0x4162ae[_0x3212('0x4d')]=_0x3212('0x97');}else if(!ut[_0x3212('0x98')](_0x4162ae[_0x3212('0x99')])){_0x4162ae[_0x3212('0x4d')]=_0x3212('0x62');}else if(!this[_0x3212('0x9a')](_0x4162ae[_0x3212('0x53')])){if(!this['isTrunkReachable'](_0x4162ae['TrunkBackup'])){_0x4162ae[_0x3212('0x4d')]=_0x3212('0x9b');}else{_0x4162ae['message']=_0x3212('0x9c');}}else{_0x4162ae[_0x3212('0x4d')]=_0x3212('0x9c');}emitCampaignPreview(_0x4162ae);};Preview[_0x3212('0x69')]['callProgressDetectingCustomer']=function(_0x14d97a,_0x4440f4,_0x4092c6){var _0x1298d5=this;var _0x131ade=this[_0x3212('0x17')][_0x4440f4];var _0x59ebc2=this[_0x3212('0x14')][_0x131ade[_0x3212('0x76')]];var _0x5177ea;var _0x561a6e=![];var _0xa2962b=0x2;var _0xfd4d70=0x3;if(_0x59ebc2){switch(_0x4092c6){case'1':_0x59ebc2[_0x3212('0x41')]+=0x1;_0x131ade[_0x3212('0x9d')]+=0x1;_0x131ade[_0x3212('0x9e')]=ut['totalGlobal'](_0x131ade);ut[_0x3212('0x8e')](_0x131ade,0x0,_0x3212('0x9f'));ami['emit'](_0x3212('0xa0'),ut[_0x3212('0xa1')](_0x131ade,'nosuchnumber'));rpcDb[_0x3212('0x94')](_0x131ade,_0x3212('0xa2'));_0x1298d5[_0x3212('0xa3')](_0x131ade,'0',_0x59ebc2)['then'](function(_0x304e0a){_0x561a6e=_0x304e0a['additional']==0x1;_0xa2962b=_0x59ebc2['dialNoSuchNumberRetryFrequency'];_0xfd4d70=_0x59ebc2['callAdditionalPhoneAfterMin'];if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2['dialGlobalMaxRetry']){_0x5177ea=ut[_0x3212('0xa5')](_0x131ade,0xf,'Global');rpcDb[_0x3212('0x95')](_0x5177ea,_0x3212('0xa6'));}else{if(_0x131ade[_0x3212('0x9d')]>=_0x59ebc2[_0x3212('0xa7')]){rpcDb[_0x3212('0x95')](_0x131ade,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x3212('0xa8')](ut[_0x3212('0xa9')](_0x131ade,_0x3212('0x9d'),_0x59ebc2[_0x3212('0xaa')]),_0x131ade[_0x3212('0xab')],_0x131ade[_0x3212('0xac')]);}}delete this['actions'][_0x14d97a[_0x3212('0xad')]];}else{_0x131ade[_0x3212('0x9d')]++;logger[_0x3212('0x59')](_0x3212('0xae'),_0x131ade[_0x3212('0x9d')]);logger[_0x3212('0x59')]('id',_0x131ade[_0x3212('0xaf')]);_0x1298d5[_0x3212('0xb0')]({'id':_0x131ade[_0x3212('0xaf')],'field':{'countnosuchnumberretry':_0x131ade[_0x3212('0x9d')]}})['then'](function(){_0x1298d5['swapAdditionalPhones'](_0x131ade,_0xa2962b,_0xfd4d70)[_0x3212('0x86')](function(){});});}});break;case _0x3212('0xb1'):var _0x52999f=moment()[_0x3212('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x131ade['responsetime']=_0x52999f;_0x131ade['answertime']=_0x52999f;_0x131ade['dialAnswer']=!![];_0x59ebc2['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x131ade[_0x3212('0xb2')],'\x20Queue',_0x59ebc2[_0x3212('0x28')],_0x3212('0xb3'),_0x59ebc2[_0x3212('0x60')]);ami[_0x3212('0x27')](_0x3212('0xb4'),ut[_0x3212('0xa1')](_0x131ade,_0x3212('0xb5'),this[_0x3212('0x14')][_0x131ade[_0x3212('0x76')]]));if(_0x59ebc2[_0x3212('0xb6')]){ami[_0x3212('0x27')](_0x3212('0xb7'),ut[_0x3212('0xb8')](_0x131ade));}break;case'16':ami['emit'](_0x3212('0xb9'),ut['buildObj'](_0x131ade,_0x3212('0xba'),this[_0x3212('0x14')][_0x131ade['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x131ade,'complete'));_0x59ebc2[_0x3212('0x3a')]+=0x1;_0x59ebc2['total']+=0x1;_0x59ebc2['answered']+=0x1;ut[_0x3212('0xbb')](_0x59ebc2,_0x3212('0xbc'));_0x131ade[_0x3212('0x9e')]=ut[_0x3212('0xa4')](_0x131ade);ut[_0x3212('0x8e')](_0x131ade,0x4,_0x3212('0xbd'));rpcDb['createCustomerHistory'](_0x131ade,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x131ade,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x3212('0xbe')](_0x131ade);_0x59ebc2[_0x3212('0x2d')]+=_0x131ade['talktime'];_0x59ebc2['sumBillable']+=_0x131ade['talktime'];logger[_0x3212('0x59')]('[syncHangup][talking][decrement]',_0x131ade[_0x3212('0xb2')],_0x3212('0xbf'),_0x59ebc2[_0x3212('0x28')],_0x3212('0xb3'),_0x59ebc2[_0x3212('0x60')]);delete this[_0x3212('0x17')][_0x14d97a[_0x3212('0xad')]];break;case _0x3212('0xc0'):_0x59ebc2['outboundBusyCallsDay']+=0x1;_0x131ade[_0x3212('0xc1')]+=0x1;_0x131ade[_0x3212('0x9e')]=ut[_0x3212('0xa4')](_0x131ade);ut[_0x3212('0x8e')](_0x131ade,0x5,_0x3212('0xc2'));_0xa2962b=_0x59ebc2['dialBusyRetryFrequency'];_0xfd4d70=_0x59ebc2[_0x3212('0xc3')];ami[_0x3212('0x27')]('custom:agentbusy',ut[_0x3212('0xa1')](_0x131ade,_0x3212('0xc4')));rpcDb[_0x3212('0x94')](_0x131ade,_0x3212('0xc5'));_0x1298d5[_0x3212('0xa3')](_0x131ade,'5',_0x59ebc2)[_0x3212('0x86')](function(_0x984223){_0x561a6e=_0x984223['additional']==0x1;if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2[_0x3212('0xc6')]){_0x5177ea=ut[_0x3212('0xa5')](_0x131ade,0xf,_0x3212('0xc7'));rpcDb[_0x3212('0x95')](_0x5177ea,_0x3212('0xc8'));}else{if(_0x131ade[_0x3212('0xc1')]>=_0x59ebc2[_0x3212('0xc9')]){rpcDb[_0x3212('0x95')](_0x131ade,_0x3212('0xc5'));}else{rpcDb['rescheduleContact'](ut[_0x3212('0xa9')](_0x131ade,_0x3212('0xc1'),_0x59ebc2['dialBusyRetryFrequency']),_0x131ade['unlockAgent'],_0x131ade['activeContact']);}}}else{_0x131ade[_0x3212('0xc1')]++;_0x1298d5['incrementPreviewCounters']({'id':_0x131ade[_0x3212('0xaf')],'field':{'countbusyretry':_0x131ade['countbusyretry']}})['then'](function(){_0x1298d5[_0x3212('0xca')](_0x131ade,_0xa2962b,_0xfd4d70)['then'](function(){});});}});break;case _0x3212('0xcb'):_0x59ebc2[_0x3212('0x40')]+=0x1;_0x131ade[_0x3212('0xcc')]+=0x1;_0x131ade[_0x3212('0x9e')]=ut['totalGlobal'](_0x131ade);ut[_0x3212('0x8e')](_0x131ade,0x3,_0x3212('0xcd'));_0xa2962b=_0x59ebc2[_0x3212('0xce')];_0xfd4d70=_0x59ebc2['callAdditionalPhoneAfterMin'];ami[_0x3212('0x27')]('custom:agentnoanswer',ut[_0x3212('0xa1')](_0x131ade,'noanswer'));rpcDb[_0x3212('0x94')](_0x131ade,_0x3212('0xcf'));_0x1298d5['verifyAdditionalPhones'](_0x131ade,'3',_0x59ebc2)[_0x3212('0x86')](function(_0x3b5170){_0x561a6e=_0x3b5170[_0x3212('0xd0')]==0x1;if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2[_0x3212('0xc6')]){_0x5177ea=ut[_0x3212('0xa5')](_0x131ade,0xf,_0x3212('0xc7'));rpcDb[_0x3212('0x95')](_0x5177ea,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x131ade[_0x3212('0xcc')]>=_0x59ebc2[_0x3212('0xd1')]){rpcDb['createCustomerFinal'](_0x131ade,_0x3212('0xcf'));}else{rpcDb[_0x3212('0xa8')](ut[_0x3212('0xa9')](_0x131ade,_0x3212('0xcc'),_0x59ebc2[_0x3212('0xce')]),_0x131ade['unlockAgent'],_0x131ade[_0x3212('0xac')]);}}}else{_0x131ade[_0x3212('0xcc')]++;_0x1298d5[_0x3212('0xb0')]({'id':_0x131ade[_0x3212('0xaf')],'field':{'countnoanswerretry':_0x131ade[_0x3212('0xcc')]}})['then'](function(){_0x1298d5['swapAdditionalPhones'](_0x131ade,_0xa2962b,_0xfd4d70)[_0x3212('0x86')](function(){});});}});break;case'CONGESTION':_0x59ebc2[_0x3212('0x3d')]+=0x1;_0x131ade['countcongestionretry']+=0x1;_0x131ade['countglobal']=ut[_0x3212('0xa4')](_0x131ade);ut['logCustomer'](_0x131ade,0x8,_0x3212('0xd2'));_0xa2962b=_0x59ebc2['dialCongestionRetryFrequency'];_0xfd4d70=_0x59ebc2[_0x3212('0xc3')];ami[_0x3212('0x27')](_0x3212('0xd3'),ut[_0x3212('0xa1')](_0x131ade,_0x3212('0xd4')));rpcDb[_0x3212('0x94')](_0x131ade,_0x3212('0xd5'));_0x1298d5[_0x3212('0xa3')](_0x131ade,'8',_0x59ebc2)[_0x3212('0x86')](function(_0x4b6564){_0x561a6e=_0x4b6564[_0x3212('0xd0')]==0x1;if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2[_0x3212('0xc6')]){_0x5177ea=ut['cloneAction'](_0x131ade,0xf,_0x3212('0xc7'));rpcDb[_0x3212('0x95')](_0x5177ea,_0x3212('0xd6'));}else{if(_0x131ade[_0x3212('0xd7')]>=_0x59ebc2[_0x3212('0xd8')]){rpcDb[_0x3212('0x95')](_0x131ade,_0x3212('0xd5'));}else{rpcDb[_0x3212('0xa8')](ut['scheduledAt'](_0x131ade,_0x3212('0xd7'),_0x59ebc2[_0x3212('0xd9')]),_0x131ade[_0x3212('0xab')],_0x131ade[_0x3212('0xac')]);}}}else{_0x131ade[_0x3212('0xd7')]++;_0x1298d5[_0x3212('0xb0')]({'id':_0x131ade[_0x3212('0xaf')],'field':{'countcongestionretry':_0x131ade[_0x3212('0xd7')]}})[_0x3212('0x86')](function(){_0x1298d5[_0x3212('0xca')](_0x131ade,_0xa2962b,_0xfd4d70)[_0x3212('0x86')](function(){});});}});break;case _0x3212('0xda'):_0x59ebc2[_0x3212('0x44')]+=0x1;_0x131ade['countagentrejectretry']+=0x1;_0x131ade[_0x3212('0x9e')]=ut[_0x3212('0xa4')](_0x131ade);ut[_0x3212('0x8e')](_0x131ade,0x14,_0x3212('0xdb'));_0xa2962b=_0x59ebc2[_0x3212('0xdc')];_0xfd4d70=_0x59ebc2[_0x3212('0xc3')];ami[_0x3212('0x27')](_0x3212('0xdd'),ut['buildObj'](_0x131ade,_0x3212('0xde')));rpcDb['createCustomerHistory'](_0x131ade,_0x3212('0xdf'));_0x1298d5[_0x3212('0xa3')](_0x131ade,'20',_0x59ebc2)[_0x3212('0x86')](function(_0x4ae27a){_0x561a6e=_0x4ae27a['additional']==0x1;if(!_0x561a6e){if(ut['totalGlobal'](_0x131ade)>=_0x59ebc2[_0x3212('0xc6')]){_0x5177ea=ut[_0x3212('0xa5')](_0x131ade,0x14,'AgentReject');rpcDb[_0x3212('0x95')](_0x5177ea,_0x3212('0xe0'));}else{if(_0x131ade[_0x3212('0xe1')]>=_0x59ebc2[_0x3212('0xe2')]){rpcDb[_0x3212('0x95')](_0x131ade,_0x3212('0xe0'));}else{rpcDb[_0x3212('0xa8')](ut[_0x3212('0xa9')](_0x131ade,'countagentrejectretry',_0x59ebc2[_0x3212('0xdc')]),_0x131ade[_0x3212('0xab')],_0x131ade[_0x3212('0xac')]);}}}else{_0x131ade[_0x3212('0xcc')]++;_0x1298d5[_0x3212('0xb0')]({'id':_0x131ade['idContact'],'field':{'countnoanswerretry':_0x131ade[_0x3212('0xcc')]}})[_0x3212('0x86')](function(){_0x1298d5[_0x3212('0xca')](_0x131ade,_0xa2962b,_0xfd4d70)[_0x3212('0x86')](function(){});});}});break;case _0x3212('0xe3'):_0x59ebc2['outboundAbandonedCallsDay']+=0x1;_0x131ade[_0x3212('0xe4')]+=0x1;_0x131ade['countglobal']=ut['totalGlobal'](_0x131ade);ut['logCustomer'](_0x131ade,0xb,'Abandoned');rpcDb[_0x3212('0x94')](_0x131ade,_0x3212('0xe5'));_0x1298d5[_0x3212('0xa3')](_0x131ade,'11',_0x59ebc2)[_0x3212('0x86')](function(_0x14771e){_0x561a6e=_0x14771e[_0x3212('0xd0')]==0x1;if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2[_0x3212('0xc6')]){_0x5177ea=ut['cloneAction'](_0x131ade,0xf,'Global');rpcDb[_0x3212('0x95')](_0x5177ea,_0x3212('0xe5'));}else{if(_0x131ade['countabandonedetry']>=_0x59ebc2[_0x3212('0xe6')]){rpcDb[_0x3212('0x95')](_0x131ade,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x3212('0xa8')](ut['scheduledAt'](_0x131ade,'countabandonedretry',_0x59ebc2[_0x3212('0xe7')]),_0x131ade[_0x3212('0xab')],_0x131ade[_0x3212('0xac')]);}}}else{_0x131ade[_0x3212('0xcc')]++;_0x1298d5[_0x3212('0xb0')]({'id':_0x131ade[_0x3212('0xaf')],'field':{'countnoanswerretry':_0x131ade['countnoanswerretry']}})[_0x3212('0x86')](function(){_0x1298d5[_0x3212('0xca')](_0x131ade,_0xa2962b,_0xfd4d70)['then'](function(){});});}});break;case'18':_0x59ebc2[_0x3212('0x45')]+=0x1;_0x131ade[_0x3212('0xe8')]+=0x1;_0x131ade[_0x3212('0x9e')]=ut['totalGlobal'](_0x131ade);ut[_0x3212('0x8e')](_0x131ade,0x12,_0x14d97a['cause-txt']||_0x14d97a[_0x3212('0xe9')]);ami['emit']('custom:amd',ut['buildObj'](_0x131ade,_0x3212('0xea')));rpcDb[_0x3212('0x94')](_0x131ade,'[callProgressDetectingCustomer][hangupInAMD]');_0x1298d5[_0x3212('0xa3')](_0x131ade,'18',_0x59ebc2)[_0x3212('0x86')](function(_0x26ae70){_0x561a6e=_0x26ae70[_0x3212('0xd0')]==0x1;if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2[_0x3212('0xc6')]){_0x5177ea=ut[_0x3212('0xa5')](_0x131ade,0x12,_0x3212('0xc7'));rpcDb[_0x3212('0x95')](_0x5177ea,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x3212('0x95')](_0x131ade,_0x3212('0xeb'));}}else{_0x131ade[_0x3212('0xcc')]++;_0x1298d5[_0x3212('0xb0')]({'id':_0x131ade[_0x3212('0xaf')],'field':{'countnoanswerretry':_0x131ade[_0x3212('0xcc')]}})[_0x3212('0x86')](function(){_0x1298d5[_0x3212('0xca')](_0x131ade,_0xa2962b,_0xfd4d70)[_0x3212('0x86')](function(){});});}});delete this[_0x3212('0x17')][_0x14d97a[_0x3212('0xad')]];break;case'19':_0x59ebc2[_0x3212('0x45')]+=0x1;_0x131ade[_0x3212('0x9e')]=ut['totalGlobal'](_0x131ade);ut['logCustomer'](_0x131ade,0x13,_0x14d97a[_0x3212('0xec')]||_0x14d97a[_0x3212('0xe9')]);ami['emit'](_0x3212('0xed'),ut['buildObj'](_0x131ade,_0x3212('0xea')));rpcDb[_0x3212('0x94')](_0x131ade,'[callProgressDetectingCustomer][machine]');_0x1298d5[_0x3212('0xa3')](_0x131ade,'18',_0x59ebc2)[_0x3212('0x86')](function(_0x268fde){_0x561a6e=_0x268fde[_0x3212('0xd0')]==0x1;if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2['dialGlobalMaxRetry']){_0x5177ea=ut[_0x3212('0xa5')](_0x131ade,0xf,_0x3212('0xc7'));rpcDb[_0x3212('0x95')](_0x5177ea,_0x3212('0xee'));}else{rpcDb['createCustomerFinal'](_0x131ade,_0x3212('0xee'));}}else{_0x131ade[_0x3212('0xcc')]++;_0x1298d5[_0x3212('0xb0')]({'id':_0x131ade[_0x3212('0xaf')],'field':{'countnoanswerretry':_0x131ade['countnoanswerretry']}})[_0x3212('0x86')](function(){_0x1298d5['swapAdditionalPhones'](_0x131ade,_0xa2962b,_0xfd4d70)[_0x3212('0x86')](function(){});});}});delete this[_0x3212('0x17')][_0x14d97a[_0x3212('0xad')]];break;default:if(_0x131ade['dialAnswer']){ut[_0x3212('0xbb')](_0x59ebc2,'[default]');ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x59ebc2[_0x3212('0x28')],_0x14d97a);}_0x59ebc2[_0x3212('0x45')]+=0x1;_0x131ade[_0x3212('0x9e')]=ut[_0x3212('0xa4')](_0x131ade);ut[_0x3212('0x8e')](_0x131ade,0xc,_0x14d97a['cause-txt']||_0x14d97a[_0x3212('0xe9')]);_0xa2962b=_0x59ebc2[_0x3212('0xdc')];_0xfd4d70=_0x59ebc2[_0x3212('0xc3')];rpcDb['createCustomerHistory'](_0x131ade,_0x3212('0xef'));_0x1298d5[_0x3212('0xa3')](_0x131ade,'20',_0x59ebc2)[_0x3212('0x86')](function(_0x4a9ae2){_0x561a6e=_0x4a9ae2[_0x3212('0xd0')]==0x1;if(!_0x561a6e){if(ut[_0x3212('0xa4')](_0x131ade)>=_0x59ebc2[_0x3212('0xc6')]){_0x5177ea=ut[_0x3212('0xa5')](_0x131ade,0xf,'Global');rpcDb[_0x3212('0x95')](_0x5177ea,_0x3212('0xf0'));}else{rpcDb[_0x3212('0x95')](_0x131ade,_0x3212('0xf0'));}delete this[_0x3212('0x17')][_0x14d97a[_0x3212('0xad')]];}else{_0x1298d5[_0x3212('0xca')](_0x131ade,_0xa2962b,_0xfd4d70)[_0x3212('0x86')](function(_0x150df7){});}});}if(!(_0x131ade[_0x3212('0x80')]&&_0x4092c6==='16')){ut[_0x3212('0x7f')](_0x59ebc2,'[callProgressDetectingCustomer]');logger[_0x3212('0x59')](_0x3212('0xf1'),_0x131ade[_0x3212('0xb2')],'\x20Queue',_0x59ebc2[_0x3212('0x28')],'originated:\x20',_0x59ebc2[_0x3212('0x5f')]);}if(_0x4092c6!==_0x3212('0xb1')){delete this[_0x3212('0x17')][_0x14d97a[_0x3212('0xad')]];delete this['actions'][_0x14d97a['destlinkedid']];}}};Preview[_0x3212('0x69')]['callProgressDetectingAgent']=function(_0x521a5a,_0x251efa,_0x9fdebb){if(_[_0x3212('0xf2')](_0x251efa)&&'object'!==typeof _0x251efa){return;}if(_[_0x3212('0xf2')](_0x9fdebb)&&_0x3212('0xf3')!==typeof _0x9fdebb){return;}switch(_0x9fdebb[_0x3212('0xf4')]){case'0':ut['logAgent'](_0x521a5a,0x0,_0x3212('0x9f'));rpcDb[_0x3212('0xf5')](_0x521a5a,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x3212('0xf6')](_0x521a5a,0x3,_0x3212('0xcd'));rpcDb[_0x3212('0xf5')](_0x521a5a,_0x3212('0xf7'));break;case'5':ut[_0x3212('0xf6')](_0x521a5a,0x5,_0x3212('0xc2'));rpcDb[_0x3212('0xf5')](_0x521a5a,_0x3212('0xf8'));break;case'8':ut['logAgent'](_0x521a5a,0x8,_0x3212('0xd2'));rpcDb[_0x3212('0xf5')](_0x521a5a,_0x3212('0xf9'));break;case'22':ut['logAgent'](_0x521a5a,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x521a5a,_0x3212('0xfa'));break;default:ut[_0x3212('0xf6')](_0x521a5a,0xc,_0x9fdebb[_0x3212('0xf4')]);rpcDb['createAgentHistory'](_0x521a5a,_0x3212('0xf9'));}ut[_0x3212('0x7f')](_0x251efa,_0x3212('0xfb'));logger[_0x3212('0x59')](_0x3212('0xfc'),_0x521a5a[_0x3212('0xb2')],_0x3212('0xbf'),_0x251efa[_0x3212('0x28')],_0x3212('0x75'),_0x251efa[_0x3212('0x5f')]);delete this[_0x3212('0x17')][_0x521a5a[_0x3212('0xb2')]];};Preview[_0x3212('0x69')][_0x3212('0xa3')]=function(_0x3bbb7b,_0x59dc1a,_0x5410ee){return BPromise[_0x3212('0xfd')]()[_0x3212('0x86')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3bbb7b,_0x59dc1a,_0x5410ee))[_0x3212('0x7d')](logger['info'](_0x3212('0xfe')));};Preview['prototype'][_0x3212('0xca')]=function(_0x299400,_0x5f6c86,_0x4739ea){return BPromise[_0x3212('0xfd')]()[_0x3212('0x86')](cmHopperAdditionalPhone[_0x3212('0xca')](_0x299400,_0x5f6c86,_0x4739ea))[_0x3212('0x7d')](logger['info'](_0x3212('0xff')));};Preview[_0x3212('0x69')]['incrementPreviewCounters']=function(_0x43ef03){return BPromise['resolve']()[_0x3212('0x86')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x43ef03))[_0x3212('0x7d')](logger[_0x3212('0x59')](_0x3212('0x100')));};Preview[_0x3212('0x69')][_0x3212('0x101')]=function(_0x29c722,_0x5c903f,_0x341062,_0xc8e97e,_0x2b4188){var _0x5efd81=this;return new BPromise(function(_0x3bd5a1,_0x415c93){if(_[_0x3212('0x72')](_0x5c903f)||_[_0x3212('0x72')](_0x5c903f[_0x3212('0x102')])||_[_0x3212('0x72')](_0x5c903f[_0x3212('0x103')])||_[_0x3212('0x72')](_0x5c903f[_0x3212('0x78')])){_0x415c93(ut[_0x3212('0x4d')](_0x3212('0x104'),_0xc8e97e,_0x2b4188));return;}var _0x1acfd6=uuid['v4']();var _0x2ee4cc=_0x5efd81['campaignsPreview'][_0x5c903f['Queue'][_0x3212('0x28')]];var _0x5940e0=_0x341062?_0x5efd81[_0x3212('0x18')][_0x341062]['id']:undefined;_0x5efd81['actions'][_0x1acfd6]=new Action(_0x5c903f,_0x2ee4cc,_0x1acfd6,_0x341062,_0x5940e0);var _0x14932f=_0x5efd81[_0x3212('0x17')][_0x1acfd6];_0x14932f[_0x3212('0xab')]=_0xc8e97e;_0x14932f[_0x3212('0xac')]=_0x2b4188;_0x14932f[_0x3212('0x105')]=_0x341062;if(_['isEmpty'](_0x29c722)){_0x5efd81[_0x3212('0x106')](_0x14932f,_0x2ee4cc,_0x5c903f,_0x341062)['then'](function(_0x112efd){logger[_0x3212('0x59')](_0x3212('0x107'),'Queue:\x20'+_0x14932f['queue']+'\x20IdHopper:\x20'+_0x14932f[_0x3212('0xaf')],JSON['stringify'](_0x112efd));ami['emit'](_0x3212('0x108'),ut[_0x3212('0xa1')](_0x14932f,_0x3212('0x109'),_0x5efd81[_0x3212('0x14')][_0x14932f[_0x3212('0x76')]]));_0x3bd5a1(ut[_0x3212('0x4d')](_0x3212('0x10a')));})[_0x3212('0x7d')](function(_0x10397a){ut['logger'](_0x3212('0x10b'),_0x10397a);_0x415c93(ut['message'](_0x3212('0x10c'),_0xc8e97e,_0x2b4188));});}else{_0x2ee4cc[_0x3212('0x3b')]+=0x1;ut[_0x3212('0x10d')](_0x14932f);rpcDb[_0x3212('0x10e')](_0x14932f,_0x3212('0x10f'));delete _0x5efd81[_0x3212('0x17')][_0x1acfd6];_0x415c93(ut[_0x3212('0x4d')]('Contact\x20in\x20black\x20List',_0xc8e97e,_0x2b4188));}});};Preview[_0x3212('0x69')][_0x3212('0x9a')]=function(_0x150aa9){return!_[_0x3212('0x72')](_0x150aa9)&&!_[_0x3212('0x72')](_0x150aa9['name'])&&!_[_0x3212('0x72')](_0x150aa9['active'])&&_0x150aa9['active']&&!_['isNil'](this[_0x3212('0x16')][util['format']('SIP/%s',_0x150aa9[_0x3212('0x28')])])&&!_['isNil'](this[_0x3212('0x16')][util[_0x3212('0x5b')]('SIP/%s',_0x150aa9[_0x3212('0x28')])][_0x3212('0x7b')])&&(this[_0x3212('0x16')][util[_0x3212('0x5b')](_0x3212('0x110'),_0x150aa9[_0x3212('0x28')])]['status']==='reachable'||this['trunks'][util[_0x3212('0x5b')](_0x3212('0x110'),_0x150aa9[_0x3212('0x28')])][_0x3212('0x7b')]===_0x3212('0x111'));};Preview['prototype'][_0x3212('0x112')]=function(_0x2d784d,_0xc5d9dc){var _0x99900e=this;return new BPromise(function(_0x1ae172,_0x14449b){_0x99900e['execRun'](_0x2d784d,_0xc5d9dc)[_0x3212('0x86')](function(_0x2a3824){_0x1ae172(_['pick'](_0x2a3824,[_0x3212('0x4d')]));})[_0x3212('0x7d')](function(_0x4662a3){if(_0x4662a3[_0x3212('0x113')]){rpcDb[_0x3212('0x114')](_0x2d784d);}if(_0x4662a3[_0x3212('0x54')]){rpcDb['disableContact'](_0x2d784d);}_0x14449b(_['pick'](_0x4662a3,[_0x3212('0x4d')]));});});};Preview[_0x3212('0x69')][_0x3212('0x115')]=function(_0x704ab6,_0x40fa2a){var _0xb3eaad=this;return new BPromise(function(_0xc89c04,_0x1c0864){var _0x3482bd,_0x164772;rpcDb[_0x3212('0x116')](_0x704ab6)[_0x3212('0x86')](function(_0x581eba){if(!_[_0x3212('0x72')](_0x581eba[0x0])){_0x164772=_0x581eba[0x0][_0x3212('0x117')]?![]:!![];_0x3482bd=_0x581eba[0x0][_0x3212('0x117')]?!![]:![];_0x3482bd=_0x40fa2a?!![]:_0x3482bd;}var _0x521fdd=_0xb3eaad[_0x3212('0x118')](_0x581eba);if(_0x521fdd[_0x3212('0x119')]){rpcDb[_0x3212('0x11a')](_[_0x3212('0x77')](_0x581eba[0x0],[_0x3212('0x78'),_0x3212('0x103')]))[_0x3212('0x86')](function(_0x136ee7){_0xb3eaad[_0x3212('0x101')](_0x136ee7,_0x581eba[0x0],_0x40fa2a,_0x164772,_0x3482bd)[_0x3212('0x86')](function(_0x35df06){_0xc89c04(_0x35df06);})[_0x3212('0x7d')](function(_0x1f3741){_0x1c0864(_0x1f3741);});})[_0x3212('0x7d')](function(_0x5e364e){ut[_0x3212('0x63')](_0x3212('0x11b'),_0x5e364e);_0x1c0864(ut[_0x3212('0x4d')](_0x3212('0x11c'),_0x164772,_0x3482bd));});}else{_0x1c0864(ut['message'](_0x521fdd['message'],_0x164772,_0x3482bd));}})[_0x3212('0x7d')](function(_0x1fe6b9){ut[_0x3212('0x63')](_0x3212('0x11d'),_0x1fe6b9);_0x1c0864(ut[_0x3212('0x4d')](_0x3212('0x11c'),![],!![]));});});};Preview[_0x3212('0x69')]['validateContact']=function(_0xb1c6ed){if(_[_0x3212('0x72')](_0xb1c6ed)||_[_0x3212('0x11e')](_0xb1c6ed)||!_[_0x3212('0x72')](_0xb1c6ed[0x0][_0x3212('0x89')])&&_[_0x3212('0x72')](_0xb1c6ed[0x0]['Agent'][_0x3212('0x28')])){ut[_0x3212('0x63')](_0x3212('0x11f'),_0xb1c6ed);return{'isValid':![],'message':_0x3212('0x120')};}var _0x716a06=this[_0x3212('0x14')][_0xb1c6ed[0x0][_0x3212('0x74')][_0x3212('0x28')]];_0x716a06[_0x3212('0x4d')]=_0x3212('0x9c');if(_[_0x3212('0x72')](_0x716a06)){ut[_0x3212('0x63')](_0x3212('0x121'),_0x716a06);return{'isValid':![],'message':_0x3212('0x122')};}if(!this['isTrunkReachable'](_0x716a06[_0x3212('0x53')])){ut[_0x3212('0x63')](_0x3212('0x123'),_0x3212('0x124')+_0x716a06[_0x3212('0x28')]+_0x3212('0x125'));if(!this['isTrunkReachable'](_0x716a06[_0x3212('0x126')])){ut[_0x3212('0x63')](_0x3212('0x123'),_0x716a06[_0x3212('0x28')]+_0x3212('0x127'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x3212('0x98')](_0x716a06[_0x3212('0x99')])){ut[_0x3212('0x63')]('[Preview][validateContact][Campaign\x20Active]',_0x716a06[_0x3212('0x28')]+_0x3212('0x128'));return{'isValid':![],'message':_0x3212('0x124')+_0x716a06[_0x3212('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x3212('0x129')};};Preview['prototype'][_0x3212('0x106')]=function(_0x12f84b,_0x225554,_0x6f6e0c,_0x30e305){var _0x81f1e9=this;return new BPromise(function(_0x5309b5,_0x335207){var _0x81d3ad=_0x12f84b[_0x3212('0xb2')];var _0x48bb01=_0x81f1e9[_0x3212('0x9a')](_0x225554[_0x3212('0x53')])?util[_0x3212('0x5b')](_0x3212('0x12a'),_0x225554[_0x3212('0x53')]['name'],_[_0x3212('0x72')](_0x225554[_0x3212('0x38')])?'':_0x225554[_0x3212('0x38')][_0x3212('0x12b')]()||'',_0x225554['dialCutDigit']>0x0?_0x6f6e0c[_0x3212('0x103')]['substring'](_0x225554[_0x3212('0x12c')]):_0x6f6e0c['phone']):util[_0x3212('0x5b')](_0x3212('0x12a'),_[_0x3212('0x72')](_0x225554['TrunkBackup'])?_0x225554['Trunk'][_0x3212('0x28')]:_0x225554[_0x3212('0x126')][_0x3212('0x28')],_[_0x3212('0x72')](_0x225554['dialPrefix'])?'':_0x225554[_0x3212('0x38')][_0x3212('0x12b')]()||'',_0x225554[_0x3212('0x12c')]>0x0?_0x6f6e0c[_0x3212('0x103')][_0x3212('0x12d')](_0x225554[_0x3212('0x12c')]):_0x6f6e0c[_0x3212('0x103')]);var _0xc57d1=_0x81f1e9['isTrunkReachable'](_0x225554[_0x3212('0x53')])?ut[_0x3212('0x12e')](_0x225554['Trunk'][_0x3212('0x55')],_0x225554[_0x3212('0x35')],_0x225554[_0x3212('0x12f')]>0x0?ut[_0x3212('0x130')](_0x225554[_0x3212('0x36')],_0x225554[_0x3212('0x12f')]):_0x225554['dialOriginateCallerIdNumber']):ut[_0x3212('0x12e')](_['isNil'](_0x225554[_0x3212('0x126')])?_0x225554[_0x3212('0x53')][_0x3212('0x55')]:_0x225554['TrunkBackup'][_0x3212('0x55')],_0x225554[_0x3212('0x35')],_0x225554[_0x3212('0x12f')]>0x0?ut[_0x3212('0x130')](_0x225554[_0x3212('0x36')],_0x225554[_0x3212('0x12f')]):_0x225554[_0x3212('0x36')]);if(_0xc57d1){_0x12f84b[_0x3212('0x131')]=ut[_0x3212('0x132')](_0xc57d1);_0x12f84b['originatecalleridnum']=ut[_0x3212('0x133')](_0xc57d1);}var _0x3fc66b=ut[_0x3212('0x134')](_0x225554,_0x6f6e0c,_0x48bb01,_0xc57d1,_0x81d3ad,_0x12f84b);_[_0x3212('0x135')](_0x12f84b,ut[_0x3212('0x136')](_0x3fc66b));_0x12f84b['starttime']=moment()['format'](_0x3212('0x8d'));ami['Action'](ut[_0x3212('0x137')](_0x12f84b,_0x225554,_0x3fc66b,_0x12f84b['activeContact'],_0x30e305))[_0x3212('0x86')](function(_0x3eb27d){_0x225554[_0x3212('0x5f')]+=0x1;logger['info'](_0x3212('0x138'),_0x81d3ad,_0x3212('0xbf'),_0x225554['name'],'originated:\x20',_0x225554[_0x3212('0x5f')]);_0x5309b5(_0x3eb27d);})[_0x3212('0x7d')](function(_0x23775c){ut['logAgent'](_0x12f84b,0xe,_0x3212('0x139'));rpcDb['createAgentHistory'](_0x12f84b,_0x3212('0x13a'));_0x335207(_0x23775c);});});};Preview['prototype']['syncNewExten']=function(_0x236981){if(this[_0x3212('0x17')][_0x236981[_0x3212('0xad')]]){this[_0x3212('0x17')][_0x236981[_0x3212('0xad')]][_0x3212('0x7c')]=_0x236981['channel'];}};Preview[_0x3212('0x69')][_0x3212('0x1b')]=function(_0x5492d4){var _0xb51e51=this;var _0x342d96=this[_0x3212('0x17')][_0x5492d4[_0x3212('0x13b')]];if(_0x342d96){if(_0x342d96[_0x3212('0x105')]&&this[_0x3212('0x18')][_0x342d96[_0x3212('0x105')]]){ut[_0x3212('0x13c')](_0x342d96,this['agents'][_0x342d96[_0x3212('0x105')]]['name'],this['agents'][_0x342d96[_0x3212('0x105')]]['id']);}var _0x8447c9=_['clone'](_0x342d96);_0x8447c9['responsetime']=moment()[_0x3212('0x5b')](_0x3212('0x8d'));var _0x5bff17=_0xb51e51[_0x3212('0x14')][_0x342d96[_0x3212('0x76')]];if(ut[_0x3212('0x13d')](_0x5492d4[_0x3212('0x13e')])){if(_0x342d96['unlockAgent']){rpcDb[_0x3212('0x114')](_0x342d96[_0x3212('0xaf')]);}if(_0x342d96['activeContact']){rpcDb['disableContact'](_0x342d96[_0x3212('0xaf')]);}ami[_0x3212('0x27')](_0x3212('0x13f'),ut[_0x3212('0xa1')](_0x342d96,_0x3212('0x140'),this[_0x3212('0x14')][_0x342d96['queue']]));this['callProgressDetectingAgent'](_0x8447c9,_0x5bff17,_0x5492d4);}else{_0x342d96[_0x3212('0x141')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x8447c9,0x4,'Answer');rpcDb[_0x3212('0xf5')](_0x8447c9,_0x3212('0x142'));}}};Preview[_0x3212('0x69')][_0x3212('0x1e')]=function(_0x5f537c){var _0x409508=this;var _0x23d191=this[_0x3212('0x17')][_0x5f537c[_0x3212('0xad')]];var _0x2f9271;if(_0x23d191){_0x2f9271=this[_0x3212('0x14')][_0x23d191[_0x3212('0x76')]];logger[_0x3212('0x59')](_0x3212('0x143'),_0x5f537c['linkedid'],'\x20Queue',_0x2f9271[_0x3212('0x28')],_0x3212('0xb3'),_0x2f9271[_0x3212('0x60')]);}if(this[_0x3212('0x17')][_0x5f537c[_0x3212('0xad')]]&&_0x5f537c[_0x3212('0xad')]!==_0x5f537c[_0x3212('0xb2')]){if(_0x5f537c['cause']==='16'&&this[_0x3212('0x17')][_0x5f537c[_0x3212('0xad')]]['dialAnswer']){this[_0x3212('0x144')](_0x5f537c,_0x5f537c[_0x3212('0xad')],_0x5f537c[_0x3212('0x145')]);}else if(this[_0x3212('0x17')][_0x5f537c['linkedid']][_0x3212('0x80')]){logger[_0x3212('0x59')](_0x3212('0x146'),_0x5f537c['linkedid'],_0x5f537c[_0x3212('0x145')],_0x3212('0xbf'),_0x2f9271['name'],_0x3212('0xb3'),_0x2f9271[_0x3212('0x60')]);this[_0x3212('0x144')](_0x5f537c,_0x5f537c['linkedid'],_0x5f537c[_0x3212('0x145')]);}}else if(_0x23d191&&_[_0x3212('0x72')](_0x23d191[_0x3212('0x147')])&&_0x2f9271[_0x3212('0x148')]&&_0x5f537c['linkedid']===_0x5f537c[_0x3212('0xb2')]&&_[_0x3212('0x72')](_0x5f537c['reason'])&&_0x5f537c['cause']==='16'&&_0x5f537c[_0x3212('0x149')]==='6'&&_[_0x3212('0xf2')](_0x23d191[_0x3212('0x14a')])){if(_0x23d191[_0x3212('0xab')]){rpcDb['unlockContact'](_0x23d191[_0x3212('0xaf')]);}if(_0x23d191[_0x3212('0xac')]){rpcDb[_0x3212('0x8c')](_0x23d191['idContact']);}_0x5f537c[_0x3212('0xf4')]='22';this[_0x3212('0x14b')](_0x23d191,_0x2f9271,_0x5f537c);}else if(_0x23d191&&_0x23d191[_0x3212('0x14a')]){if(_0x5f537c[_0x3212('0x145')]==='16'&&this[_0x3212('0x17')][_0x5f537c[_0x3212('0xad')]][_0x3212('0x80')]){logger['info'](_0x3212('0x14c'),_0x5f537c[_0x3212('0xad')],_0x5f537c[_0x3212('0x145')],_0x3212('0xbf'),_0x2f9271['name'],'pTalking:\x20',_0x2f9271[_0x3212('0x60')]);this[_0x3212('0x144')](_0x5f537c,_0x5f537c['linkedid'],_0x5f537c['cause']);}else if(this[_0x3212('0x17')][_0x5f537c[_0x3212('0xad')]][_0x3212('0x80')]){logger['info'](_0x3212('0x146'),_0x5f537c[_0x3212('0xad')],_0x5f537c['cause'],_0x3212('0xbf'),_0x2f9271[_0x3212('0x28')],_0x3212('0xb3'),_0x2f9271[_0x3212('0x60')]);this[_0x3212('0x144')](_0x5f537c,_0x5f537c[_0x3212('0xad')],_0x5f537c[_0x3212('0x145')]);}}};Preview[_0x3212('0x69')]['syncDialEnd']=function(_0x4cb8e3){if(this[_0x3212('0x17')][_0x4cb8e3['destlinkedid']]&&_0x4cb8e3['destlinkedid']!==_0x4cb8e3[_0x3212('0x14d')]){this[_0x3212('0x144')](_0x4cb8e3,_0x4cb8e3[_0x3212('0x14e')],_0x4cb8e3['dialstatus']);}};Preview[_0x3212('0x69')][_0x3212('0x14f')]=function(_0x4d125b){if(this[_0x3212('0x17')][_0x4d125b[_0x3212('0xad')]]&&_0x4d125b[_0x3212('0xad')]!==_0x4d125b['uniqueid']&&!this[_0x3212('0x17')][_0x4d125b['linkedid']][_0x3212('0x80')]){if(_0x4d125b[_0x3212('0x145')]==='1'){this[_0x3212('0x144')](_0x4d125b,_0x4d125b[_0x3212('0xad')],_0x4d125b[_0x3212('0x145')]);}}};Preview['prototype'][_0x3212('0x150')]=function(_0x3c0359,_0x23e662,_0x134dbc){if(this[_0x3212('0x17')][_0x3c0359]){if(_[_0x3212('0x72')](this[_0x3212('0x17')][_0x3c0359][_0x3212('0x151')])){this[_0x3212('0x17')][_0x3c0359]['variables']={};}this[_0x3212('0x17')][_0x3c0359]['variables'][_0x23e662]=_0x134dbc;}};Preview[_0x3212('0x69')][_0x3212('0x152')]=function(_0x273121){try{if(!_[_0x3212('0x72')](_0x273121)){if(ut['filterKey'](_[_0x3212('0x153')](_0x273121[_0x3212('0x154')])[0x0])){this['addVariable'](_0x273121['uniqueid'],_[_0x3212('0x153')](_0x273121[_0x3212('0x154')])[0x0],_0x273121['value']);}}}catch(_0x36c058){logger[_0x3212('0x155')]('[syncVarSet][Preview]',util[_0x3212('0x156')](_0x36c058,{'showHidden':![],'depth':null}));}};Preview[_0x3212('0x69')][_0x3212('0x24')]=function(_0x154704){if(_0x154704){if(this[_0x3212('0x17')][_0x154704[_0x3212('0x157')]]){this['actions'][_0x154704['transfertargetlinkedid']][_0x3212('0x14a')]=!![];}}};Preview[_0x3212('0x69')][_0x3212('0x26')]=function(_0x49690b){if(_0x49690b){if(this[_0x3212('0x17')][_0x49690b[_0x3212('0x158')]]){this[_0x3212('0x17')][_0x49690b['transfererlinkedid']][_0x3212('0x14a')]=!![];}}};module[_0x3212('0x159')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 060a497..fc2906a 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 _0x02d4=['queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','catch','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x02d4,0xb4));var _0x402d=function(_0x44aa91,_0x5d442c){_0x44aa91=_0x44aa91-0x0;var _0xf054e=_0x02d4[_0x44aa91];return _0xf054e;};'use strict';var util=require(_0x402d('0x0'));var BPromise=require(_0x402d('0x1'));var logger=require(_0x402d('0x2'))(_0x402d('0x3'));var _=require(_0x402d('0x4'));var cmHopper=require(_0x402d('0x5'));var cmHopperFinal=require(_0x402d('0x6'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x402d('0x7'));var voiceQueueRt=require(_0x402d('0x8'));var agentReportPreview=require(_0x402d('0x9'));var voiceQueueReport=require(_0x402d('0xa'));function loggerCatch(_0x3aef61){return function(_0xd8ed8c){logger['error'](_0x3aef61,util[_0x402d('0xb')](_0xd8ed8c,{'showHidden':![],'depth':null}));};}function create(_0x550fb2){return BPromise[_0x402d('0xc')]()[_0x402d('0xd')](cmHopperHistory['createHistory'](_0x550fb2))[_0x402d('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x21114b){return BPromise[_0x402d('0xc')]()['then'](agentReportPreview[_0x402d('0xf')](_0x21114b))[_0x402d('0xe')](loggerCatch(_0x402d('0x10')));}function moveContact(_0x70f88d){return BPromise['resolve']()[_0x402d('0xd')](cmHopper[_0x402d('0x11')](_0x70f88d,!![]))['catch'](loggerCatch(_0x402d('0x12')));}exports[_0x402d('0x13')]=function(_0x40347d){return BPromise[_0x402d('0xc')]()[_0x402d('0xd')](cmHopperBlack[_0x402d('0x13')](_0x40347d))['catch'](loggerCatch(_0x402d('0x14')));};exports[_0x402d('0x15')]=function(_0x35a067){return BPromise[_0x402d('0xc')]()['then'](cmHopper[_0x402d('0x15')](_0x35a067))[_0x402d('0xe')](loggerCatch('[getContactPreview]\x20'));};exports[_0x402d('0xf')]=function(_0x26e793,_0x1e5c1b){create(_0x26e793)[_0x402d('0xe')](loggerCatch(_0x1e5c1b));moveContact(_0x26e793)[_0x402d('0xe')](loggerCatch(_0x1e5c1b));};exports['createAgentHistory']=function(_0x514fa9,_0x2ac426){createAgent(_0x514fa9)[_0x402d('0xe')](loggerCatch(_0x2ac426));};exports[_0x402d('0x16')]=function(_0x135d4f,_0x54a1c7){create(_0x135d4f)[_0x402d('0xe')](loggerCatch(_0x54a1c7));};exports['createCustomerFinal']=function(_0x3031c3,_0x50b54f){moveContact(_0x3031c3)[_0x402d('0xe')](loggerCatch(_0x50b54f));};exports[_0x402d('0x17')]=function(_0x6cb93c,_0x2b8bb2,_0x232322){if(_0x2b8bb2){_0x6cb93c['UserId']=null;}if(_0x232322){_0x6cb93c[_0x402d('0x18')]=![];}return BPromise['resolve']()[_0x402d('0xd')](cmHopper[_0x402d('0x17')](_0x6cb93c))[_0x402d('0xe')](loggerCatch(_0x402d('0x19')));};exports[_0x402d('0x1a')]=function(_0x36f728){return BPromise[_0x402d('0xc')]()[_0x402d('0xd')](cmHopper[_0x402d('0x1a')](_0x36f728))[_0x402d('0xe')](loggerCatch(_0x402d('0x1b')));};exports[_0x402d('0x1c')]=function(_0x2408ff){return BPromise[_0x402d('0xc')]()['then'](cmHopper[_0x402d('0x1c')]({'UserId':null},_0x2408ff,0x1))['catch'](loggerCatch(_0x402d('0x1d')));};exports['disableContact']=function(_0x2c54b1){return BPromise['resolve']()[_0x402d('0xd')](cmHopper[_0x402d('0x1c')]({'active':![]},_0x2c54b1,0x1))['catch'](loggerCatch(_0x402d('0x1e')));};exports[_0x402d('0x1f')]=function(_0x299672){var _0x1d7a90={};_0x1d7a90[_0x402d('0x20')]=_0x299672['type'];_0x1d7a90['uniqueid']=_0x299672[_0x402d('0x21')];_0x1d7a90[_0x402d('0x22')]=_0x299672[_0x402d('0x22')];_0x1d7a90[_0x402d('0x23')]=_0x299672[_0x402d('0x23')];_0x1d7a90['queue']=_0x299672[_0x402d('0x24')];_0x1d7a90[_0x402d('0x25')]=_0x299672[_0x402d('0x26')];_0x1d7a90[_0x402d('0x27')]=_0x299672['answertime'];_0x1d7a90[_0x402d('0x28')]=0x1;_0x1d7a90[_0x402d('0x29')]=_0x299672[_0x402d('0x2a')];_0x1d7a90[_0x402d('0x2b')]=_0x299672['membername'];_0x1d7a90[_0x402d('0x2c')]=_0x402d('0x2d');_0x1d7a90['exten']='xcally-motion-preview';_0x1d7a90[_0x402d('0x2e')]=0x0;_0x1d7a90[_0x402d('0x2f')]=0x1;_0x1d7a90[_0x402d('0x30')]=_0x299672['membername'];_0x1d7a90[_0x402d('0x31')]='COMPLETED';return BPromise['resolve']()[_0x402d('0xd')](voiceQueueReport[_0x402d('0x32')](_0x1d7a90))['catch'](loggerCatch(_0x402d('0x33')));};exports[_0x402d('0x34')]=function(_0x443075,_0x1b6ed2){return BPromise['resolve']()[_0x402d('0xd')](cmHopper['getContactRecallMe'](_0x443075,_0x1b6ed2))['catch'](loggerCatch(_0x402d('0x35')));};exports['rescheduleContactInQueue']=function(_0x47ccfb){return BPromise[_0x402d('0xc')]()[_0x402d('0xd')](cmHopper['rescheduleContact'](_0x47ccfb,!![],!![]))[_0x402d('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xa68f=['connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','then','createHistory','[createHistory]\x20','catch','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','endtime'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa68f,0x77));var _0xfa68=function(_0x43065f,_0x4aadbe){_0x43065f=_0x43065f-0x0;var _0x29a7a2=_0xa68f[_0x43065f];return _0x29a7a2;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xfa68('0x0'))(_0xfa68('0x1'));var _=require(_0xfa68('0x2'));var cmHopper=require(_0xfa68('0x3'));var cmHopperFinal=require(_0xfa68('0x4'));var cmHopperHistory=require(_0xfa68('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xfa68('0x6'));var agentReportPreview=require(_0xfa68('0x7'));var voiceQueueReport=require(_0xfa68('0x8'));function loggerCatch(_0x5810b0){return function(_0x4a70ff){logger['error'](_0x5810b0,util['inspect'](_0x4a70ff,{'showHidden':![],'depth':null}));};}function create(_0x28915e){return BPromise[_0xfa68('0x9')]()[_0xfa68('0xa')](cmHopperHistory[_0xfa68('0xb')](_0x28915e))['catch'](loggerCatch(_0xfa68('0xc')));}function createAgent(_0x8f3dd2){return BPromise['resolve']()[_0xfa68('0xa')](agentReportPreview['createHistory'](_0x8f3dd2))[_0xfa68('0xd')](loggerCatch(_0xfa68('0xc')));}function moveContact(_0x2a0ddf){return BPromise[_0xfa68('0x9')]()['then'](cmHopper['moveContactManagedDialer'](_0x2a0ddf,!![]))['catch'](loggerCatch(_0xfa68('0xe')));}exports['checkIsBlackList']=function(_0xabd013){return BPromise[_0xfa68('0x9')]()[_0xfa68('0xa')](cmHopperBlack['checkIsBlackList'](_0xabd013))[_0xfa68('0xd')](loggerCatch(_0xfa68('0xf')));};exports[_0xfa68('0x10')]=function(_0x541874){return BPromise[_0xfa68('0x9')]()[_0xfa68('0xa')](cmHopper[_0xfa68('0x10')](_0x541874))['catch'](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x404f97,_0x51880c){create(_0x404f97)['catch'](loggerCatch(_0x51880c));moveContact(_0x404f97)[_0xfa68('0xd')](loggerCatch(_0x51880c));};exports[_0xfa68('0x11')]=function(_0x4940f2,_0x34de27){createAgent(_0x4940f2)['catch'](loggerCatch(_0x34de27));};exports[_0xfa68('0x12')]=function(_0xb78548,_0x28ebe8){create(_0xb78548)['catch'](loggerCatch(_0x28ebe8));};exports[_0xfa68('0x13')]=function(_0x49523f,_0x28bde8){moveContact(_0x49523f)[_0xfa68('0xd')](loggerCatch(_0x28bde8));};exports[_0xfa68('0x14')]=function(_0x5d1fd4,_0x2c1616,_0x3106be){if(_0x2c1616){_0x5d1fd4['UserId']=null;}if(_0x3106be){_0x5d1fd4[_0xfa68('0x15')]=![];}return BPromise['resolve']()[_0xfa68('0xa')](cmHopper[_0xfa68('0x14')](_0x5d1fd4))['catch'](loggerCatch(_0xfa68('0x16')));};exports['countReScheduled']=function(_0x4df73a){return BPromise['resolve']()['then'](cmHopper[_0xfa68('0x17')](_0x4df73a))[_0xfa68('0xd')](loggerCatch(_0xfa68('0x18')));};exports[_0xfa68('0x19')]=function(_0x25f046){return BPromise[_0xfa68('0x9')]()[_0xfa68('0xa')](cmHopper[_0xfa68('0x19')]({'UserId':null},_0x25f046,0x1))[_0xfa68('0xd')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0xcabc4){return BPromise['resolve']()[_0xfa68('0xa')](cmHopper[_0xfa68('0x19')]({'active':![]},_0xcabc4,0x1))[_0xfa68('0xd')](loggerCatch(_0xfa68('0x1a')));};exports[_0xfa68('0x1b')]=function(_0x9b56c2){var _0x12af82={};_0x12af82[_0xfa68('0x1c')]=_0x9b56c2[_0xfa68('0x1c')];_0x12af82[_0xfa68('0x1d')]=_0x9b56c2[_0xfa68('0x1d')];_0x12af82['calleridnum']=_0x9b56c2[_0xfa68('0x1e')];_0x12af82[_0xfa68('0x1f')]=_0x9b56c2['calleridname'];_0x12af82['queue']=_0x9b56c2[_0xfa68('0x20')];_0x12af82[_0xfa68('0x21')]=_0x9b56c2['answertime'];_0x12af82[_0xfa68('0x22')]=_0x9b56c2['answertime'];_0x12af82['queuecallercomplete']=0x1;_0x12af82[_0xfa68('0x23')]=_0x9b56c2[_0xfa68('0x24')];_0x12af82[_0xfa68('0x25')]=_0x9b56c2[_0xfa68('0x26')];_0x12af82[_0xfa68('0x27')]=_0xfa68('0x28');_0x12af82[_0xfa68('0x29')]=_0xfa68('0x2a');_0x12af82['holdtime']=0x0;_0x12af82[_0xfa68('0x2b')]=0x1;_0x12af82['lastAssignedTo']=_0x9b56c2[_0xfa68('0x26')];_0x12af82[_0xfa68('0x2c')]=_0xfa68('0x2d');return BPromise['resolve']()['then'](voiceQueueReport[_0xfa68('0x2e')](_0x12af82))['catch'](loggerCatch(_0xfa68('0x2f')));};exports[_0xfa68('0x30')]=function(_0x54a456,_0x1d225d){return BPromise['resolve']()[_0xfa68('0xa')](cmHopper['getContactRecallMe'](_0x54a456,_0x1d225d))[_0xfa68('0xd')](loggerCatch(_0xfa68('0x31')));};exports[_0xfa68('0x32')]=function(_0x51143f){return BPromise[_0xfa68('0x9')]()[_0xfa68('0xa')](cmHopper[_0xfa68('0x14')](_0x51143f,!![],!![]))[_0xfa68('0xd')](loggerCatch(_0xfa68('0x33')));}; \ 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 c34e69b..c5a3520 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 _0xd2b3=['moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','logger2','message','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','Contact','createdAt','updatedAt','XMD-','toLowerVariables','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','starttime','endtime','logAgent','state','statedesc','ringtime','logLookAgent','membername','logCustomer','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','dialAnswer','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash'];(function(_0x9cc1d7,_0x126bd4){var _0x294e87=function(_0x272bd3){while(--_0x272bd3){_0x9cc1d7['push'](_0x9cc1d7['shift']());}};_0x294e87(++_0x126bd4);}(_0xd2b3,0x199));var _0x3d2b=function(_0x11e1ef,_0x3cbe5e){_0x11e1ef=_0x11e1ef-0x0;var _0x125d5b=_0xd2b3[_0x11e1ef];return _0x125d5b;};'use strict';var util=require(_0x3d2b('0x0'));var _=require(_0x3d2b('0x1'));var moment=require(_0x3d2b('0x2'));var logger=require(_0x3d2b('0x3'))(_0x3d2b('0x4'));var ipAgi=process[_0x3d2b('0x5')][_0x3d2b('0x6')]||_0x3d2b('0x7');function getSeconds(_0x494456,_0x2e77a4){var _0x4b5239=moment(_0x494456)[_0x3d2b('0x8')](0x0);var _0x47f6e8=moment(_0x2e77a4)['milliseconds'](0x0);return _0x4b5239[_0x3d2b('0x9')](_0x47f6e8,_0x3d2b('0xa'));}exports['loggerCatch']=function(_0x516438){return function(_0x2524e6){logger[_0x3d2b('0xb')](_0x516438,util[_0x3d2b('0xc')](_0x2524e6,{'showHidden':![],'depth':null}));};};exports[_0x3d2b('0xd')]=function(_0x17bd4c,_0x171897){logger[_0x3d2b('0xe')](_0x17bd4c,util[_0x3d2b('0xc')](_0x171897,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x16e1bd,_0x3d8f11){logger[_0x3d2b('0xb')](_0x16e1bd,util[_0x3d2b('0xc')](_0x3d8f11,{'showHidden':![],'depth':null}));};exports[_0x3d2b('0xf')]=function(_0x50b82a){return function(_0x56f28e){logger[_0x3d2b('0xe')](_0x50b82a,util[_0x3d2b('0xc')](_0x56f28e,{'showHidden':![],'depth':null}));};};exports[_0x3d2b('0x10')]=function(_0xd1ec5f,_0x455e65,_0x4494be){return{'message':_0xd1ec5f,'unlock':_0x455e65,'active':_0x4494be};};exports['getCallerId']=function(_0x3a7421,_0x202bec,_0x2f5d95){if(!_[_0x3d2b('0x11')](_0x2f5d95)&&'string'===typeof _0x2f5d95&&!_[_0x3d2b('0x12')](_0x2f5d95)){if(!_[_0x3d2b('0x11')](_0x202bec)&&_0x3d2b('0x13')===typeof _0x202bec&&!_[_0x3d2b('0x12')](_0x202bec)){return util[_0x3d2b('0x14')]('\x22%s\x22\x20<%s>',_0x202bec,_0x2f5d95);}return util['format'](_0x3d2b('0x15'),_0x2f5d95,_0x2f5d95);}if(!_[_0x3d2b('0x11')](_0x3a7421)&&_0x3d2b('0x13')===typeof _0x3a7421&&!_[_0x3d2b('0x12')](_0x3a7421)){return _0x3a7421;}return _0x3d2b('0x16');};exports['isActive']=function(_0x1fb778){if(_[_0x3d2b('0x17')](_0x1fb778)){return![];}return _0x1fb778;};exports['addVariables']=function(_0x1685d9,_0x5b36fe,_0x46765f,_0x11fae4,_0x42c266,_0x38ee95){var _0xdeba5={'XMD-QUEUE':_0x5b36fe[_0x3d2b('0x18')]?_0x5b36fe[_0x3d2b('0x18')]['name']:'','XMD-CALLERID':_0x11fae4,'XMD-CALLERID-PREVIEW':_0x38ee95?util[_0x3d2b('0x14')]('\x22%s\x22\x20<%s>',_0x38ee95[_0x3d2b('0x19')],_0x38ee95[_0x3d2b('0x1a')]):_0x11fae4,'XMD-DIALID':_0x42c266,'XMD-CONTACTID':_0x5b36fe[_0x3d2b('0x1b')],'XMD-CDRTYPE':_0x3d2b('0x1c'),'CALLERID(all)':_0x11fae4,'XMD-VOICEQUEUEID':_0x5b36fe[_0x3d2b('0x1d')],'XMD-DIALCHANNEL':_0x46765f,'XMD-DIALTIMEOUT':_0x1685d9[_0x3d2b('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x3d2b('0x14')](_0x3d2b('0x1f'),_0x1685d9['dialQueueProject2']?'g':'',_[_0x3d2b('0x12')](_0x1685d9['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1685d9[_0x3d2b('0x20')]||'','XMD-AGI':_0x1685d9[_0x3d2b('0x21')]?util[_0x3d2b('0x14')](_0x3d2b('0x22'),ipAgi,_0x1685d9[_0x3d2b('0x21')]):'NONE','XMD-AGIAFTER':_0x1685d9[_0x3d2b('0x23')]?util[_0x3d2b('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1685d9['dialQueueProject2']):_0x3d2b('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x38ee95?_0x38ee95[_0x3d2b('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x38ee95?_0x38ee95[_0x3d2b('0x26')]:'','XMD-DESTINATION':_0x3d2b('0x27'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x3d2b('0x12')](_0x1685d9[_0x3d2b('0x28')])){_0xdeba5[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x1685d9[_0x3d2b('0x28')];_0xdeba5[util[_0x3d2b('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x42c266;}if(_0x5b36fe&&_0x5b36fe[_0x3d2b('0x29')]){for(var _0x3b9268 in _0x5b36fe[_0x3d2b('0x29')]){if(_0x5b36fe[_0x3d2b('0x29')]['hasOwnProperty'](_0x3b9268)){if(!_['isNil'](_0x5b36fe[_0x3d2b('0x29')][_0x3b9268])&&_0x3b9268!=='id'&&_0x3b9268!=='tags'&&_0x3b9268!==_0x3d2b('0x2a')&&_0x3b9268!==_0x3d2b('0x2b')){_0xdeba5[util[_0x3d2b('0x14')]('%s%s',_0x3d2b('0x2c'),_['toUpper'](_0x3b9268))]=_0x5b36fe['Contact'][_0x3b9268];}}}}return _0xdeba5;};exports[_0x3d2b('0x2d')]=function(_0x5b3b18){var _0x5b20fa={};for(var _0x3ad4e4 in _0x5b3b18){if(_0x5b3b18['hasOwnProperty'](_0x3ad4e4)){_0x5b20fa[util[_0x3d2b('0x14')]('%s',_['toLower'](_0x3ad4e4))]=_0x5b3b18[_0x3ad4e4];}}return{'variables':_0x5b20fa};};exports['updateOriginated']=function(_0x2e8356,_0x410eb6){if(!_[_0x3d2b('0x17')](_0x2e8356)){if(_0x2e8356[_0x3d2b('0x2e')](_0x3d2b('0x2f'))){if(_0x2e8356['originated']>0x0){_0x2e8356[_0x3d2b('0x2f')]-=0x1;}else{logger[_0x3d2b('0xb')](_0x3d2b('0x30'),_0x410eb6);}}}else{logger[_0x3d2b('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x410eb6);}};exports['logBlacklist']=function(_0x2b4d85){var _0x554c9d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2b4d85['state']=0xd;_0x2b4d85['statedesc']='Blacklist';_0x2b4d85[_0x3d2b('0x31')]=_0x554c9d;_0x2b4d85['responsetime']=_0x554c9d;_0x2b4d85[_0x3d2b('0x32')]=_0x554c9d;};exports[_0x3d2b('0x33')]=function(_0x2a587f,_0x37b3c5,_0x47fedb){var _0x3c7eca=moment()[_0x3d2b('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a587f[_0x3d2b('0x34')]=_0x37b3c5;_0x2a587f[_0x3d2b('0x35')]=_0x47fedb;_0x2a587f['responsetime']=_0x3c7eca;_0x2a587f[_0x3d2b('0x36')]=getSeconds(_0x2a587f['responsetime'],_0x2a587f[_0x3d2b('0x31')]);};exports[_0x3d2b('0x37')]=function(_0x15f5aa,_0x49161d,_0x50cf21){_0x15f5aa[_0x3d2b('0x38')]=_0x49161d;_0x15f5aa['UserId']=_0x50cf21;};exports[_0x3d2b('0x39')]=function(_0x318e4b,_0x109a4d,_0x278d09){var _0x33c642=moment()['format'](_0x3d2b('0x3a'));_0x318e4b[_0x3d2b('0x34')]=_0x109a4d;_0x318e4b['statedesc']=_0x278d09;_0x318e4b[_0x3d2b('0x3b')]=_0x318e4b[_0x3d2b('0x3b')]?_0x318e4b['responsetime']:_0x33c642;_0x318e4b[_0x3d2b('0x32')]=_0x318e4b[_0x3d2b('0x32')]?_0x318e4b[_0x3d2b('0x32')]:_0x33c642;_0x318e4b[_0x3d2b('0x36')]=getSeconds(_0x318e4b[_0x3d2b('0x3b')]||0x0,_0x318e4b[_0x3d2b('0x31')]||0x0);_0x318e4b['talktime']=_0x318e4b[_0x3d2b('0x3c')]?getSeconds(_0x318e4b['endtime'],_0x318e4b['answertime']):0x0;};exports['isFailure']=function(_0xd4d48e){return _0xd4d48e===_0x3d2b('0x3d');};exports[_0x3d2b('0x3e')]=function(_0x1b5a72,_0x27a762,_0x20f1b7,_0x114079,_0x211bc1){var _0x571612=_0x114079?_0x3d2b('0x3f'):_0x1b5a72[_0x3d2b('0x19')];_0x571612=_0x211bc1?_0x3d2b('0x40'):_0x571612;return{'actionid':_0x1b5a72[_0x3d2b('0x41')],'action':_0x3d2b('0x42'),'channel':_0x1b5a72[_0x3d2b('0x43')],'callerid':util[_0x3d2b('0x14')](_0x3d2b('0x15'),_0x571612,_0x1b5a72[_0x3d2b('0x1a')]),'Exten':_0x3d2b('0x27'),'Context':_0x3d2b('0x44'),'Priority':'1','variable':_0x20f1b7,'timeout':(_0x27a762[_0x3d2b('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1b5a72[_0x3d2b('0x41')]};};exports[_0x3d2b('0x46')]=function(_0x10f2d5){return _0x10f2d5[_0x3d2b('0x47')]+_0x10f2d5[_0x3d2b('0x48')]+_0x10f2d5[_0x3d2b('0x49')]+_0x10f2d5[_0x3d2b('0x4a')]+_0x10f2d5[_0x3d2b('0x4b')];};exports['cloneAction']=function(_0x1265a9){var _0x2e8fb8=_[_0x3d2b('0x4c')](_0x1265a9);_0x2e8fb8[_0x3d2b('0x34')]=0xf;_0x2e8fb8[_0x3d2b('0x35')]='Global';return _0x2e8fb8;};exports[_0x3d2b('0x4d')]=function(_0x3f817d,_0x4d2176,_0x20818a){var _0x3b9f8d={};_0x3b9f8d[_0x4d2176]=_0x3f817d[_0x4d2176];_0x3b9f8d[_0x3d2b('0x4e')]=![];_0x3b9f8d[_0x3d2b('0x4f')]=moment()['add'](_0x20818a,_0x3d2b('0x50'))[_0x3d2b('0x14')](_0x3d2b('0x3a'));_0x3b9f8d['ContactId']=_0x3f817d[_0x3d2b('0x1b')];_0x3b9f8d[_0x3d2b('0x51')]=_0x3f817d[_0x3d2b('0x51')];_0x3b9f8d[_0x3d2b('0x1d')]=_0x3f817d[_0x3d2b('0x1d')]||undefined;return _0x3b9f8d;};exports[_0x3d2b('0x52')]=function(_0x3b6834,_0x8b7f2){if(!_[_0x3d2b('0x17')](_0x3b6834)){if(_0x3b6834[_0x3d2b('0x53')]>0x0){_0x3b6834['pTalking']-=0x1;}else{logger[_0x3d2b('0xb')](_0x8b7f2,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x3d2b('0xb')](_0x8b7f2,_0x3d2b('0x54'));}};exports[_0x3d2b('0x55')]=function(_0x1d6d93){if(_0x1d6d93<=0x0){return!![];}return![];};exports[_0x3d2b('0x56')]=function(_0x3967dd,_0x64199b,_0x220d6e){_0x3967dd[_0x3d2b('0x57')]=_0x64199b;_0x3967dd['name']=_0x3967dd[_0x3d2b('0x58')];_0x3967dd[_0x3d2b('0x59')]=_0x3967dd['channelAgent'];_0x3967dd['motionChannel']=_0x3d2b('0x5a');if(_0x220d6e){_0x3967dd[_0x3d2b('0x5b')]=_0x220d6e['mandatoryDisposition'];}return _0x3967dd;};exports[_0x3d2b('0x5c')]=function(_0x38afea){var _0x4b7c3d={};_0x4b7c3d[_0x3d2b('0x58')]=_0x38afea[_0x3d2b('0x58')];_0x4b7c3d['interface']=_0x38afea[_0x3d2b('0x43')];_0x4b7c3d[_0x3d2b('0x41')]=_0x38afea['uniqueid'];return _0x4b7c3d;};exports[_0x3d2b('0x5d')]=function(_0x3f351e){var _0x57e5bc=[];for(var _0x3d0ab5 in _0x3f351e){if(_0x3f351e['hasOwnProperty'](_0x3d0ab5)){if(!_[_0x3d2b('0x17')](_0x3f351e[_0x3d0ab5])&&_0x3f351e[_0x3d0ab5][_0x3d2b('0x34')]===_0x3d2b('0x5e')&&_0x3f351e[_0x3d0ab5]['status']===_0x3d2b('0x5f')){_0x57e5bc[_0x3d2b('0x60')](_0x3f351e[_0x3d0ab5]['id']);}}}return _0x57e5bc;};exports[_0x3d2b('0x61')]=function(_0x3a5989){var _0x56858e=moment()[_0x3d2b('0x8')](0x0);var _0x1a930d=moment(_0x3a5989)[_0x3d2b('0x8')](0x0);return _0x56858e[_0x3d2b('0x9')](_0x1a930d,_0x3d2b('0xa'));};exports[_0x3d2b('0x62')]=function(_0x4a231a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a231a[_0x3d2b('0x1b')],'ListId':_0x4a231a[_0x3d2b('0x51')],'VoiceQueueId':_0x4a231a[_0x3d2b('0x1d')]||undefined,'CampaignId':_0x4a231a[_0x3d2b('0x63')]||undefined};};exports[_0x3d2b('0x64')]=function(_0x2689d6){if(_0x2689d6===_0x3d2b('0x41')||_0x2689d6===_0x3d2b('0x65')||_0x2689d6===_0x3d2b('0x58')||_0x2689d6===_0x3d2b('0x66')||_0x2689d6==='campaigntype'||_0x2689d6===_0x3d2b('0x67')||_0x2689d6===_0x3d2b('0x38')||_0x2689d6===_0x3d2b('0x43')||_0x2689d6==='calleridname'||_0x2689d6===_0x3d2b('0x4e')||_0x2689d6===_0x3d2b('0x1a')||_0x2689d6===_0x3d2b('0x4f')||_0x2689d6===_0x3d2b('0x47')||_0x2689d6===_0x3d2b('0x48')||_0x2689d6===_0x3d2b('0x49')||_0x2689d6===_0x3d2b('0x68')||_0x2689d6===_0x3d2b('0x69')||_0x2689d6==='callbackuniqueid'||_0x2689d6===_0x3d2b('0x6a')||_0x2689d6===_0x3d2b('0x6b')||_0x2689d6==='ContactId'||_0x2689d6===_0x3d2b('0x51')||_0x2689d6===_0x3d2b('0x6c')||_0x2689d6==='VoiceQueueId'||_0x2689d6===_0x3d2b('0x6d')||_0x2689d6===_0x3d2b('0x6e')||_0x2689d6===_0x3d2b('0x6f')||_0x2689d6===_0x3d2b('0x70')||_0x2689d6===_0x3d2b('0x71')||_0x2689d6===_0x3d2b('0x72')||_0x2689d6==='xmd-dialtimeout'||_0x2689d6===_0x3d2b('0x73')||_0x2689d6==='xmd-dialid'||_0x2689d6===_0x3d2b('0x74')||_0x2689d6==='xmd-contactid'||_0x2689d6===_0x3d2b('0x75')||_0x2689d6===_0x3d2b('0x76')||_0x2689d6===_0x3d2b('0x77')||_0x2689d6===_0x3d2b('0x78')||_0x2689d6===_0x3d2b('0x79')||_0x2689d6===_0x3d2b('0x7a')||_0x2689d6===_0x3d2b('0x7b')||_0x2689d6===_0x3d2b('0x7c')||_0x2689d6===_0x3d2b('0x7d')||_0x2689d6==='rtpaudioqoslossbridged'||_0x2689d6===_0x3d2b('0x7e')||_0x2689d6==='rtpaudioqosrttbridged'||_0x2689d6==='rtpaudioqos'||_0x2689d6===_0x3d2b('0x7a')||_0x2689d6==='rtpaudioqosjitter'||_0x2689d6===_0x3d2b('0x7c')||_0x2689d6==='rtpaudioqosloss'||_0x2689d6===_0x3d2b('0x7f')||_0x2689d6===_0x3d2b('0x7e')||_0x2689d6==='rtpaudioqosrttbridged'||_0x2689d6===_0x3d2b('0x80')||_0x2689d6===_0x3d2b('0x81')||_0x2689d6===_0x3d2b('0x34')||_0x2689d6===_0x3d2b('0x35')){return![];}return!![];};exports[_0x3d2b('0x82')]=function(_0x2b3f9f,_0x1ad23d){var _0x452851,_0x587b00,_0x31a452;if(_0x1ad23d<=0x0){_0x1ad23d=0x1;}_0x452851=new RegExp(_0x3d2b('0x83')+_0x1ad23d+'}$');_0x587b00=Math[_0x3d2b('0x84')](0xa,_0x1ad23d-0x1);_0x31a452=Math[_0x3d2b('0x84')](0xa,_0x1ad23d)-0x1;return util[_0x3d2b('0x14')]('%s',_[_0x3d2b('0x85')](_0x2b3f9f,_0x452851,_['random'](_0x587b00,_0x31a452)));};exports[_0x3d2b('0x86')]=function(_0x363e48){var _0x30fe35=_0x363e48[_0x3d2b('0x87')](/"(.*?)"/);return _0x30fe35?_0x30fe35[0x1]:_0x363e48;};exports[_0x3d2b('0x88')]=function(_0x356ad4){var _0x3dbe7d=_0x356ad4[_0x3d2b('0x87')](/<(.*?)>/);return _0x3dbe7d?_0x3dbe7d[0x1]:_0x356ad4;}; \ No newline at end of file +var _0x8dcd=['extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isEmpty','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','hasOwnProperty','not_inuse','status','getDiff','createBody','CampaignId','filterKey','idContact','dialAnswer','countbusyretry','countcongestionretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match'];(function(_0x5c23cc,_0x3bac85){var _0x1add2d=function(_0x349672){while(--_0x349672){_0x5c23cc['push'](_0x5c23cc['shift']());}};_0x1add2d(++_0x3bac85);}(_0x8dcd,0x1a5));var _0xd8dc=function(_0x8c6215,_0x12cd64){_0x8c6215=_0x8c6215-0x0;var _0xe6d65a=_0x8dcd[_0x8c6215];return _0xe6d65a;};'use strict';var util=require(_0xd8dc('0x0'));var _=require(_0xd8dc('0x1'));var moment=require(_0xd8dc('0x2'));var logger=require(_0xd8dc('0x3'))('preview');var ipAgi=process[_0xd8dc('0x4')][_0xd8dc('0x5')]||_0xd8dc('0x6');function getSeconds(_0x31e27a,_0x160aaa){var _0x254bf0=moment(_0x31e27a)[_0xd8dc('0x7')](0x0);var _0x52f754=moment(_0x160aaa)['milliseconds'](0x0);return _0x254bf0[_0xd8dc('0x8')](_0x52f754,_0xd8dc('0x9'));}exports[_0xd8dc('0xa')]=function(_0x2ca811){return function(_0x57a814){logger[_0xd8dc('0xb')](_0x2ca811,util[_0xd8dc('0xc')](_0x57a814,{'showHidden':![],'depth':null}));};};exports[_0xd8dc('0xd')]=function(_0x2c157d,_0x88c080){logger[_0xd8dc('0xe')](_0x2c157d,util[_0xd8dc('0xc')](_0x88c080,{'showHidden':![],'depth':null}));};exports[_0xd8dc('0xf')]=function(_0x9a24c6,_0x560eca){logger[_0xd8dc('0xb')](_0x9a24c6,util['inspect'](_0x560eca,{'showHidden':![],'depth':null}));};exports[_0xd8dc('0x10')]=function(_0x1969bc){return function(_0x6ed307){logger[_0xd8dc('0xe')](_0x1969bc,util[_0xd8dc('0xc')](_0x6ed307,{'showHidden':![],'depth':null}));};};exports[_0xd8dc('0x11')]=function(_0x4717a4,_0x3db4cb,_0x4ebb53){return{'message':_0x4717a4,'unlock':_0x3db4cb,'active':_0x4ebb53};};exports[_0xd8dc('0x12')]=function(_0x5d04ce,_0xca1299,_0x33e5ed){if(!_['isUndefined'](_0x33e5ed)&&'string'===typeof _0x33e5ed&&!_[_0xd8dc('0x13')](_0x33e5ed)){if(!_[_0xd8dc('0x14')](_0xca1299)&&_0xd8dc('0x15')===typeof _0xca1299&&!_[_0xd8dc('0x13')](_0xca1299)){return util[_0xd8dc('0x16')](_0xd8dc('0x17'),_0xca1299,_0x33e5ed);}return util['format'](_0xd8dc('0x17'),_0x33e5ed,_0x33e5ed);}if(!_[_0xd8dc('0x14')](_0x5d04ce)&&_0xd8dc('0x15')===typeof _0x5d04ce&&!_['isEmpty'](_0x5d04ce)){return _0x5d04ce;}return _0xd8dc('0x18');};exports[_0xd8dc('0x19')]=function(_0x49682d){if(_[_0xd8dc('0x1a')](_0x49682d)){return![];}return _0x49682d;};exports['addVariables']=function(_0xf63592,_0x48b248,_0x3c8a3c,_0x3926d2,_0x4d1117,_0x5c5e58){var _0x5a8a0f={'XMD-QUEUE':_0x48b248[_0xd8dc('0x1b')]?_0x48b248['Queue'][_0xd8dc('0x1c')]:'','XMD-CALLERID':_0x3926d2,'XMD-CALLERID-PREVIEW':_0x5c5e58?util['format']('\x22%s\x22\x20<%s>',_0x5c5e58[_0xd8dc('0x1d')],_0x5c5e58[_0xd8dc('0x1e')]):_0x3926d2,'XMD-DIALID':_0x4d1117,'XMD-CONTACTID':_0x48b248[_0xd8dc('0x1f')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3926d2,'XMD-VOICEQUEUEID':_0x48b248[_0xd8dc('0x20')],'XMD-DIALCHANNEL':_0x3c8a3c,'XMD-DIALTIMEOUT':_0xf63592[_0xd8dc('0x21')]||0x1e,'XMD-DIALOPTIONS':util[_0xd8dc('0x16')](_0xd8dc('0x22'),_0xf63592[_0xd8dc('0x23')]?'g':'',_[_0xd8dc('0x13')](_0xf63592[_0xd8dc('0x24')])?'':_0xd8dc('0x25')),'XMD-DIALURL':_0xf63592['dialPreviewUrl']||'','XMD-AGI':_0xf63592[_0xd8dc('0x26')]?util[_0xd8dc('0x16')](_0xd8dc('0x27'),ipAgi,_0xf63592[_0xd8dc('0x26')]):_0xd8dc('0x28'),'XMD-AGIAFTER':_0xf63592[_0xd8dc('0x23')]?util[_0xd8dc('0x16')](_0xd8dc('0x27'),ipAgi,_0xf63592[_0xd8dc('0x23')]):_0xd8dc('0x28'),'XMD-ORIGINATECALLERIDNUM':_0x5c5e58?_0x5c5e58[_0xd8dc('0x29')]:'','XMD-ORIGINATECALLERIDNAME':_0x5c5e58?_0x5c5e58['originatecalleridname']:'','XMD-DESTINATION':_0xd8dc('0x2a'),'SIPADDHEADER':_0xd8dc('0x2b')};if(!_[_0xd8dc('0x13')](_0xf63592['monitor_format'])){_0x5a8a0f[util['format']('%s',_0xd8dc('0x2c'))]=_0xf63592[_0xd8dc('0x24')];_0x5a8a0f[util[_0xd8dc('0x16')]('%s',_0xd8dc('0x2d'))]=_0x4d1117;}if(_0x48b248&&_0x48b248['Contact']){for(var _0x30a9df in _0x48b248['Contact']){if(_0x48b248[_0xd8dc('0x2e')]['hasOwnProperty'](_0x30a9df)){if(!_[_0xd8dc('0x1a')](_0x48b248[_0xd8dc('0x2e')][_0x30a9df])&&_0x30a9df!=='id'&&_0x30a9df!==_0xd8dc('0x2f')&&_0x30a9df!==_0xd8dc('0x30')&&_0x30a9df!==_0xd8dc('0x31')){_0x5a8a0f[util[_0xd8dc('0x16')](_0xd8dc('0x32'),_0xd8dc('0x33'),_[_0xd8dc('0x34')](_0x30a9df))]=_0x48b248[_0xd8dc('0x2e')][_0x30a9df];}}}}return _0x5a8a0f;};exports[_0xd8dc('0x35')]=function(_0x456917){var _0x867508={};for(var _0x36580b in _0x456917){if(_0x456917['hasOwnProperty'](_0x36580b)){_0x867508[util[_0xd8dc('0x16')]('%s',_[_0xd8dc('0x36')](_0x36580b))]=_0x456917[_0x36580b];}}return{'variables':_0x867508};};exports[_0xd8dc('0x37')]=function(_0x328598,_0x30d90a){if(!_['isNil'](_0x328598)){if(_0x328598['hasOwnProperty'](_0xd8dc('0x38'))){if(_0x328598[_0xd8dc('0x38')]>0x0){_0x328598['originated']-=0x1;}else{logger['error'](_0xd8dc('0x39'),_0x30d90a);}}}else{logger[_0xd8dc('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x30d90a);}};exports['logBlacklist']=function(_0x3c8f98){var _0x1e0feb=moment()[_0xd8dc('0x16')](_0xd8dc('0x3a'));_0x3c8f98[_0xd8dc('0x3b')]=0xd;_0x3c8f98[_0xd8dc('0x3c')]=_0xd8dc('0x3d');_0x3c8f98[_0xd8dc('0x3e')]=_0x1e0feb;_0x3c8f98[_0xd8dc('0x3f')]=_0x1e0feb;_0x3c8f98[_0xd8dc('0x40')]=_0x1e0feb;};exports[_0xd8dc('0x41')]=function(_0x60433b,_0x40c431,_0x2f7289){var _0x6f9978=moment()[_0xd8dc('0x16')](_0xd8dc('0x3a'));_0x60433b[_0xd8dc('0x3b')]=_0x40c431;_0x60433b[_0xd8dc('0x3c')]=_0x2f7289;_0x60433b[_0xd8dc('0x3f')]=_0x6f9978;_0x60433b[_0xd8dc('0x42')]=getSeconds(_0x60433b[_0xd8dc('0x3f')],_0x60433b[_0xd8dc('0x3e')]);};exports['logLookAgent']=function(_0x5f5722,_0x4b7aa1,_0x4875b7){_0x5f5722['membername']=_0x4b7aa1;_0x5f5722[_0xd8dc('0x43')]=_0x4875b7;};exports[_0xd8dc('0x44')]=function(_0x842084,_0x4d1246,_0x5f42da){var _0x4d7afb=moment()[_0xd8dc('0x16')](_0xd8dc('0x3a'));_0x842084[_0xd8dc('0x3b')]=_0x4d1246;_0x842084[_0xd8dc('0x3c')]=_0x5f42da;_0x842084['responsetime']=_0x842084[_0xd8dc('0x3f')]?_0x842084[_0xd8dc('0x3f')]:_0x4d7afb;_0x842084[_0xd8dc('0x40')]=_0x842084[_0xd8dc('0x40')]?_0x842084[_0xd8dc('0x40')]:_0x4d7afb;_0x842084[_0xd8dc('0x42')]=getSeconds(_0x842084[_0xd8dc('0x3f')]||0x0,_0x842084[_0xd8dc('0x3e')]||0x0);_0x842084[_0xd8dc('0x45')]=_0x842084[_0xd8dc('0x46')]?getSeconds(_0x842084[_0xd8dc('0x40')],_0x842084[_0xd8dc('0x46')]):0x0;};exports[_0xd8dc('0x47')]=function(_0x2ebec5){return _0x2ebec5===_0xd8dc('0x48');};exports[_0xd8dc('0x49')]=function(_0xfa4707,_0xcf849f,_0x13d697,_0x458f3d,_0x1ffd9e){var _0x4b0fef=_0x458f3d?'RECALL':_0xfa4707[_0xd8dc('0x1d')];_0x4b0fef=_0x1ffd9e?_0xd8dc('0x4a'):_0x4b0fef;return{'actionid':_0xfa4707['uniqueid'],'action':_0xd8dc('0x4b'),'channel':_0xfa4707[_0xd8dc('0x4c')],'callerid':util[_0xd8dc('0x16')](_0xd8dc('0x17'),_0x4b0fef,_0xfa4707[_0xd8dc('0x1e')]),'Exten':_0xd8dc('0x2a'),'Context':_0xd8dc('0x4d'),'Priority':'1','variable':_0x13d697,'timeout':(_0xcf849f[_0xd8dc('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0xfa4707[_0xd8dc('0x4f')]};};exports[_0xd8dc('0x50')]=function(_0x30b966){return _0x30b966['countbusyretry']+_0x30b966['countcongestionretry']+_0x30b966[_0xd8dc('0x51')]+_0x30b966[_0xd8dc('0x52')]+_0x30b966[_0xd8dc('0x53')];};exports[_0xd8dc('0x54')]=function(_0x21c38f){var _0x1fc997=_['clone'](_0x21c38f);_0x1fc997[_0xd8dc('0x3b')]=0xf;_0x1fc997['statedesc']='Global';return _0x1fc997;};exports['scheduledAt']=function(_0x495377,_0x1ac712,_0x1ee420){var _0x4b71ea={};_0x4b71ea[_0x1ac712]=_0x495377[_0x1ac712];_0x4b71ea['active']=![];_0x4b71ea[_0xd8dc('0x55')]=moment()['add'](_0x1ee420,_0xd8dc('0x56'))[_0xd8dc('0x16')](_0xd8dc('0x3a'));_0x4b71ea[_0xd8dc('0x1f')]=_0x495377[_0xd8dc('0x1f')];_0x4b71ea[_0xd8dc('0x57')]=_0x495377['ListId'];_0x4b71ea['VoiceQueueId']=_0x495377['VoiceQueueId']||undefined;return _0x4b71ea;};exports[_0xd8dc('0x58')]=function(_0x749f64,_0x4dd43d){if(!_[_0xd8dc('0x1a')](_0x749f64)){if(_0x749f64[_0xd8dc('0x59')]>0x0){_0x749f64[_0xd8dc('0x59')]-=0x1;}else{logger[_0xd8dc('0xb')](_0x4dd43d,_0xd8dc('0x5a'));}}else{logger[_0xd8dc('0xb')](_0x4dd43d,_0xd8dc('0x5b'));}};exports['IsNotLoggedIn']=function(_0x49e785){if(_0x49e785<=0x0){return!![];}return![];};exports[_0xd8dc('0x5c')]=function(_0x1d4a95,_0x4f1899,_0x5602e6){_0x1d4a95['lastevent']=_0x4f1899;_0x1d4a95[_0xd8dc('0x1c')]=_0x1d4a95['queue'];_0x1d4a95['interface']=_0x1d4a95[_0xd8dc('0x4c')];_0x1d4a95[_0xd8dc('0x5d')]=_0xd8dc('0x5e');if(_0x5602e6){_0x1d4a95[_0xd8dc('0x5f')]=_0x5602e6[_0xd8dc('0x5f')];}return _0x1d4a95;};exports[_0xd8dc('0x60')]=function(_0x368d21){var _0x3a9c56={};_0x3a9c56[_0xd8dc('0x61')]=_0x368d21[_0xd8dc('0x61')];_0x3a9c56['interface']=_0x368d21[_0xd8dc('0x4c')];_0x3a9c56[_0xd8dc('0x4f')]=_0x368d21['uniqueid'];return _0x3a9c56;};exports[_0xd8dc('0x62')]=function(_0x2800bc){var _0xdb4593=[];for(var _0x164aff in _0x2800bc){if(_0x2800bc[_0xd8dc('0x63')](_0x164aff)){if(!_[_0xd8dc('0x1a')](_0x2800bc[_0x164aff])&&_0x2800bc[_0x164aff][_0xd8dc('0x3b')]===_0xd8dc('0x64')&&_0x2800bc[_0x164aff][_0xd8dc('0x65')]==='reachable'){_0xdb4593['push'](_0x2800bc[_0x164aff]['id']);}}}return _0xdb4593;};exports[_0xd8dc('0x66')]=function(_0x314d7e){var _0x4da851=moment()[_0xd8dc('0x7')](0x0);var _0x4b20cf=moment(_0x314d7e)[_0xd8dc('0x7')](0x0);return _0x4da851[_0xd8dc('0x8')](_0x4b20cf,'seconds');};exports[_0xd8dc('0x67')]=function(_0x5c18ea){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5c18ea[_0xd8dc('0x1f')],'ListId':_0x5c18ea['ListId'],'VoiceQueueId':_0x5c18ea[_0xd8dc('0x20')]||undefined,'CampaignId':_0x5c18ea[_0xd8dc('0x68')]||undefined};};exports[_0xd8dc('0x69')]=function(_0x1434b7){if(_0x1434b7===_0xd8dc('0x4f')||_0x1434b7===_0xd8dc('0x6a')||_0x1434b7==='queue'||_0x1434b7==='type'||_0x1434b7==='campaigntype'||_0x1434b7===_0xd8dc('0x6b')||_0x1434b7==='membername'||_0x1434b7==='channelAgent'||_0x1434b7===_0xd8dc('0x1d')||_0x1434b7==='active'||_0x1434b7===_0xd8dc('0x1e')||_0x1434b7===_0xd8dc('0x55')||_0x1434b7===_0xd8dc('0x6c')||_0x1434b7===_0xd8dc('0x6d')||_0x1434b7===_0xd8dc('0x51')||_0x1434b7===_0xd8dc('0x6e')||_0x1434b7==='callback'||_0x1434b7===_0xd8dc('0x6f')||_0x1434b7===_0xd8dc('0x70')||_0x1434b7===_0xd8dc('0x71')||_0x1434b7===_0xd8dc('0x1f')||_0x1434b7==='ListId'||_0x1434b7==='UserId'||_0x1434b7==='VoiceQueueId'||_0x1434b7===_0xd8dc('0x72')||_0x1434b7===_0xd8dc('0x73')||_0x1434b7===_0xd8dc('0x74')||_0x1434b7===_0xd8dc('0x75')||_0x1434b7===_0xd8dc('0x76')||_0x1434b7==='xmd-dialurl'||_0x1434b7===_0xd8dc('0x77')||_0x1434b7==='xmd-dialoptions'||_0x1434b7===_0xd8dc('0x78')||_0x1434b7===_0xd8dc('0x79')||_0x1434b7==='xmd-contactid'||_0x1434b7===_0xd8dc('0x7a')||_0x1434b7===_0xd8dc('0x7b')||_0x1434b7==='xmd-agiafter'||_0x1434b7===_0xd8dc('0x7c')||_0x1434b7===_0xd8dc('0x7d')||_0x1434b7===_0xd8dc('0x7e')||_0x1434b7==='rtpaudioqosjitter'||_0x1434b7===_0xd8dc('0x7f')||_0x1434b7===_0xd8dc('0x80')||_0x1434b7===_0xd8dc('0x81')||_0x1434b7==='rtpaudioqosrtt'||_0x1434b7==='rtpaudioqosrttbridged'||_0x1434b7===_0xd8dc('0x7d')||_0x1434b7===_0xd8dc('0x7e')||_0x1434b7==='rtpaudioqosjitter'||_0x1434b7==='rtpaudioqosjitterbridged'||_0x1434b7==='rtpaudioqosloss'||_0x1434b7===_0xd8dc('0x81')||_0x1434b7==='rtpaudioqosrtt'||_0x1434b7===_0xd8dc('0x82')||_0x1434b7===_0xd8dc('0x83')||_0x1434b7===_0xd8dc('0x84')||_0x1434b7==='state'||_0x1434b7===_0xd8dc('0x3c')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x217d21,_0xac3b53){var _0x1b5a80,_0x21e2f0,_0x4f2282;if(_0xac3b53<=0x0){_0xac3b53=0x1;}_0x1b5a80=new RegExp(_0xd8dc('0x85')+_0xac3b53+'}$');_0x21e2f0=Math[_0xd8dc('0x86')](0xa,_0xac3b53-0x1);_0x4f2282=Math[_0xd8dc('0x86')](0xa,_0xac3b53)-0x1;return util['format']('%s',_[_0xd8dc('0x87')](_0x217d21,_0x1b5a80,_[_0xd8dc('0x88')](_0x21e2f0,_0x4f2282)));};exports[_0xd8dc('0x89')]=function(_0x6aa5a8){var _0x48dc60=_0x6aa5a8[_0xd8dc('0x8a')](/"(.*?)"/);return _0x48dc60?_0x48dc60[0x1]:_0x6aa5a8;};exports[_0xd8dc('0x8b')]=function(_0x30eea5){var _0x5608c7=_0x30eea5[_0xd8dc('0x8a')](/<(.*?)>/);return _0x5608c7?_0x5608c7[0x1]:_0x30eea5;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index e40aeda..e250417 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 _0x2a84=['voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause','voicequeuechannel','voicechannel'];(function(_0x7c90e6,_0x23b0e8){var _0x13499d=function(_0x48641d){while(--_0x48641d){_0x7c90e6['push'](_0x7c90e6['shift']());}};_0x13499d(++_0x23b0e8);}(_0x2a84,0x1d1));var _0x42a8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a84[_0x19e35c];return _0x3e1fe8;};'use strict';exports[_0x42a8('0x0')]={'queue':{'type':_0x42a8('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x42a8('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x42a8('0x2'),'required':![]}};exports[_0x42a8('0x3')]={'queue':{'type':_0x42a8('0x1'),'required':!![]},'interface':{'type':_0x42a8('0x1'),'required':!![]}};exports[_0x42a8('0x4')]={'interface':{'type':_0x42a8('0x1'),'required':!![]},'paused':{'type':_0x42a8('0x2')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x42a8('0x1'),'required':![]}};exports[_0x42a8('0x5')]={'uniqueid':{'type':_0x42a8('0x1'),'required':!![]}};exports[_0x42a8('0x6')]={'uniqueid':{'type':_0x42a8('0x1'),'required':!![]},'filename':{'type':_0x42a8('0x1')},'format':{'type':_0x42a8('0x1')},'mixmonitorid':{'type':_0x42a8('0x1')}};exports[_0x42a8('0x7')]={'uniqueid':{'type':_0x42a8('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x42a8('0x1'),'required':!![]},'exten':{'type':_0x42a8('0x1'),'required':!![]},'context':{'type':_0x42a8('0x1')}}; \ No newline at end of file +var _0x4165=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x4165,0x1c3));var _0x5416=function(_0x4ebbfe,_0x13d8b0){_0x4ebbfe=_0x4ebbfe-0x0;var _0x479873=_0x4165[_0x4ebbfe];return _0x479873;};'use strict';exports[_0x5416('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x5416('0x1'),'required':!![]},'membername':{'type':_0x5416('0x1'),'required':!![]},'penalty':{'type':_0x5416('0x2'),'required':![]},'paused':{'type':_0x5416('0x3'),'required':![]}};exports[_0x5416('0x4')]={'queue':{'type':_0x5416('0x1'),'required':!![]},'interface':{'type':_0x5416('0x1'),'required':!![]}};exports[_0x5416('0x5')]={'interface':{'type':_0x5416('0x1'),'required':!![]},'paused':{'type':_0x5416('0x3')},'reason':{'type':_0x5416('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x5416('0x1'),'required':![]}};exports[_0x5416('0x6')]={'uniqueid':{'type':_0x5416('0x1'),'required':!![]}};exports[_0x5416('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x5416('0x1')},'format':{'type':_0x5416('0x1')},'mixmonitorid':{'type':_0x5416('0x1')}};exports[_0x5416('0x8')]={'uniqueid':{'type':_0x5416('0x1'),'required':!![]}};exports[_0x5416('0x9')]={'uniqueid':{'type':_0x5416('0x1'),'required':!![]},'exten':{'type':_0x5416('0x1'),'required':!![]},'context':{'type':_0x5416('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 0a2a6b9..e470804 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 _0x81b5=['../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','channels','queueChannels','outboundChannels','timers','settings','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','name','isUndefined','mergeFromDatabase','length','initTrunks','trunks','initVoiceQueues','voiceQueues','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initDeskAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','seconds','initVoiceCallReports','outbound','duration','ANSWERED','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','moment','../model/agent'];(function(_0x512eb0,_0x27edfe){var _0x1378fe=function(_0xfd3680){while(--_0xfd3680){_0x512eb0['push'](_0x512eb0['shift']());}};_0x1378fe(++_0x27edfe);}(_0x81b5,0xca));var _0x581b=function(_0xa24cdb,_0x209212){_0xa24cdb=_0xa24cdb-0x0;var _0x9a54b4=_0x81b5[_0xa24cdb];return _0x9a54b4;};'use strict';var BPromise=require(_0x581b('0x0'));var util=require(_0x581b('0x1'));var _=require('lodash');var moment=require(_0x581b('0x2'));var Agent=require(_0x581b('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x581b('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x581b('0x5'));var Template=require(_0x581b('0x6'));var Campaign=require(_0x581b('0x7'));var VoiceExtension=require(_0x581b('0x8'));var ZendeskAccount=require(_0x581b('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x581b('0xa'));var SugarcrmAccount=require(_0x581b('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x581b('0xc'));var VtigerAccount=require(_0x581b('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x581b('0xe'));var FreshsalesAccount=require(_0x581b('0xf'));var FaxAccount=require(_0x581b('0x10'));var Realtime=function(){this[_0x581b('0x11')]={};this[_0x581b('0x12')]={};this['trunks']={};this['voiceQueues']={};this[_0x581b('0x13')]={};this[_0x581b('0x14')]={};this[_0x581b('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x581b('0x16')]={};this[_0x581b('0x17')]={};this[_0x581b('0x18')]={};this[_0x581b('0x19')]={};this[_0x581b('0x1a')]={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x581b('0x1b')]={};this[_0x581b('0x1c')]={};this[_0x581b('0x1d')]={};this[_0x581b('0x1e')]={};this[_0x581b('0x1f')]={};this['servicenowAccounts']={};this[_0x581b('0x20')]={};this[_0x581b('0x21')]={};this[_0x581b('0x22')]={};};function freeIsNotKey(_0x470e99,_0x35d93f,_0x404798){var _0x551ab2=_[_0x581b('0x23')](_0x470e99,function(_0x26fc32,_0x2f4826){return _0x26fc32[_0x404798];});for(var _0xbf05d5 in _0x35d93f){if(_0x35d93f['hasOwnProperty'](_0xbf05d5)){if(!_0x551ab2[_0xbf05d5]){delete _0x35d93f[_0xbf05d5];}}}}function freeIsNotKeySip(_0x116a1f,_0x56fba5){var _0x142566=_[_0x581b('0x23')](_0x116a1f,function(_0x56d6e6,_0x234f96){return util[_0x581b('0x24')](_0x581b('0x25'),_0x56d6e6['name']);});for(var _0x2cb474 in _0x56fba5){if(_0x56fba5[_0x581b('0x26')](_0x2cb474)){if(!_0x142566[_0x2cb474]){delete _0x56fba5[_0x2cb474];}}}}function freeIsNotKeyAgent(_0x301316,_0xd95727){var _0x2dac12=_[_0x581b('0x23')](_0x301316,function(_0x73ba69,_0x1310b5){var _0x102370=_[_0x581b('0x27')](_0x73ba69[_0x581b('0x28')])?util[_0x581b('0x24')](_0x581b('0x25'),_0x73ba69['name']):_0x73ba69[_0x581b('0x28')];return _0x102370;});for(var _0x294eee in _0xd95727){if(_0xd95727[_0x581b('0x26')](_0x294eee)){if(!_0x2dac12[_0x294eee]){delete _0xd95727[_0x294eee];}}}}function clearVoiceCallReports(_0x15287b){_0x15287b[_0x581b('0x29')]=0x0;_0x15287b[_0x581b('0x2a')]=0x0;_0x15287b[_0x581b('0x2b')]=0x0;_0x15287b[_0x581b('0x2c')]=0x0;_0x15287b['sumBillable']=0x0;}function clearCampaigns(_0x2f56b1){if(!_['isEmpty'](_0x2f56b1)){for(var _0x2484fa in _0x2f56b1){if(_0x2f56b1[_0x581b('0x26')](_0x2484fa)){_0x2f56b1[_0x2484fa][_0x581b('0x2d')]=0x0;_0x2f56b1[_0x2484fa][_0x581b('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x519ff3){if(!_['isEmpty'](_0x519ff3)){for(var _0x2fc7b6 in _0x519ff3){if(_0x519ff3[_0x581b('0x26')](_0x2fc7b6)){_0x519ff3[_0x2fc7b6]['total']=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x2a')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x2f')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x30')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x2b')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x2c')]=0x0;_0x519ff3[_0x2fc7b6]['sumBillable']=0x0;_0x519ff3[_0x2fc7b6]['outboundAnswerAgiCallsDay']=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x31')]=0x0;_0x519ff3[_0x2fc7b6]['outboundBusyCallsDay']=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x32')]=0x0;_0x519ff3[_0x2fc7b6]['outboundNoSuchCallsDay']=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x33')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x34')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x35')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x36')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x37')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x38')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x39')]=0x0;_0x519ff3[_0x2fc7b6]['outboundAnswerAgiCallsDay']=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x3a')]=0x0;_0x519ff3[_0x2fc7b6][_0x581b('0x3b')]=!![];}}}}Realtime[_0x581b('0x3c')]['mergeFromDatabase']=function(_0x297207,_0x2c2680){for(var _0x513a66 in _0x2c2680){if(_0x297207[_0x581b('0x26')](_0x513a66)){_0x297207[_0x513a66]=_0x2c2680[_0x513a66];}}};Realtime[_0x581b('0x3c')][_0x581b('0x3d')]=function(){var _0x11675a=this;return function(_0x18e855){if(_0x18e855){freeIsNotKeyAgent(_0x18e855,_0x11675a[_0x581b('0x11')]);for(var _0x16a401=0x0,_0x11153f={},_0x1c3cd5={};_0x16a401<_0x18e855['length'];_0x16a401+=0x1){_0x11153f=_0x18e855[_0x16a401];var _0x48bdd1=_[_0x581b('0x27')](_0x11153f[_0x581b('0x28')])?util[_0x581b('0x24')](_0x581b('0x25'),_0x11153f[_0x581b('0x3e')]):_0x11153f[_0x581b('0x28')];if(_[_0x581b('0x3f')](_0x11675a[_0x581b('0x11')][_0x48bdd1])){_0x11675a['agents'][_0x48bdd1]=new Agent(_0x11153f);}else{_0x11675a[_0x581b('0x40')](_0x11675a[_0x581b('0x11')][_0x48bdd1],_0x11153f);}}}return _0x11675a[_0x581b('0x11')];};};Realtime[_0x581b('0x3c')]['initTelephones']=function(){var _0xce81a0=this;return function(_0x5d1234){if(_0x5d1234){freeIsNotKeySip(_0x5d1234,_0xce81a0[_0x581b('0x12')]);for(var _0x5d63db=0x0,_0x15be72={},_0x1e0e8e={};_0x5d63db<_0x5d1234[_0x581b('0x41')];_0x5d63db+=0x1){_0x15be72=_0x5d1234[_0x5d63db];if(_[_0x581b('0x3f')](_0xce81a0['telephones'][util[_0x581b('0x24')](_0x581b('0x25'),_0x15be72[_0x581b('0x3e')])])){_0xce81a0[_0x581b('0x12')][util['format'](_0x581b('0x25'),_0x15be72[_0x581b('0x3e')])]=new Telephone(_0x15be72);}else{_0xce81a0['mergeFromDatabase'](_0xce81a0['telephones'][util['format']('SIP/%s',_0x15be72[_0x581b('0x3e')])],_0x15be72);}}}return _0xce81a0[_0x581b('0x12')];};};Realtime[_0x581b('0x3c')][_0x581b('0x42')]=function(){var _0x4ad11d=this;return function(_0x591940){if(_0x591940){freeIsNotKeySip(_0x591940,_0x4ad11d[_0x581b('0x43')]);for(var _0x36227e=0x0,_0xf00613={},_0x176d11={};_0x36227e<_0x591940[_0x581b('0x41')];_0x36227e+=0x1){_0xf00613=_0x591940[_0x36227e];if(_['isUndefined'](_0x4ad11d['trunks'][util[_0x581b('0x24')](_0x581b('0x25'),_0xf00613[_0x581b('0x3e')])])){_0x4ad11d[_0x581b('0x43')][util[_0x581b('0x24')](_0x581b('0x25'),_0xf00613[_0x581b('0x3e')])]=new Trunk(_0xf00613);}else{_0x4ad11d[_0x581b('0x40')](_0x4ad11d[_0x581b('0x43')][util['format']('SIP/%s',_0xf00613[_0x581b('0x3e')])],_0xf00613);}}}return _0x4ad11d[_0x581b('0x43')];};};Realtime[_0x581b('0x3c')][_0x581b('0x44')]=function(){var _0x10812f=this;return function(_0x3c2c70){if(_0x3c2c70){freeIsNotKey(_0x3c2c70,_0x10812f['voiceQueues'],'name');for(var _0x312dd7=0x0,_0x281f40={},_0x1e63ef={};_0x312dd7<_0x3c2c70[_0x581b('0x41')];_0x312dd7+=0x1){_0x281f40=_0x3c2c70[_0x312dd7];if(_[_0x581b('0x3f')](_0x10812f[_0x581b('0x45')][_0x281f40[_0x581b('0x3e')]])){_0x10812f[_0x581b('0x45')][_0x281f40[_0x581b('0x3e')]]=new VoiceQueue(_0x281f40);}else{_0x10812f[_0x581b('0x40')](_0x10812f['voiceQueues'][_0x281f40[_0x581b('0x3e')]],_0x281f40);}}}return _0x10812f[_0x581b('0x45')];};};Realtime[_0x581b('0x3c')]['initTriggers']=function(){var _0x40fe91=this;return function(_0x2190f3){if(_0x2190f3){freeIsNotKey(_0x2190f3,_0x40fe91['triggers'],'id');for(var _0x22e4d=0x0,_0x46efab={},_0x3a5c2f={};_0x22e4d<_0x2190f3[_0x581b('0x41')];_0x22e4d+=0x1){_0x46efab=_0x2190f3[_0x22e4d];if(_[_0x581b('0x3f')](_0x40fe91[_0x581b('0x13')][_0x46efab['id']])){_0x40fe91[_0x581b('0x13')][_0x46efab['id']]=new Trigger(_0x46efab);}else{_0x40fe91[_0x581b('0x40')](_0x40fe91[_0x581b('0x13')][_0x46efab['id']],_0x46efab);}}}return _0x40fe91[_0x581b('0x13')];};};Realtime[_0x581b('0x3c')]['initTemplates']=function(){var _0x874b92=this;return function(_0x2dfac0){if(_0x2dfac0){freeIsNotKey(_0x2dfac0,_0x874b92[_0x581b('0x15')],'id');for(var _0x1c0071=0x0,_0xa5fd68={},_0x107057={};_0x1c0071<_0x2dfac0[_0x581b('0x41')];_0x1c0071+=0x1){_0xa5fd68=_0x2dfac0[_0x1c0071];if(_[_0x581b('0x3f')](_0x874b92[_0x581b('0x15')][_0xa5fd68['id']])){_0x874b92['templates'][_0xa5fd68['id']]=new Template(_0xa5fd68);}else{_0x874b92[_0x581b('0x40')](_0x874b92['templates'][_0xa5fd68['id']],_0xa5fd68);}}}return _0x874b92[_0x581b('0x15')];};};Realtime[_0x581b('0x3c')][_0x581b('0x46')]=function(){var _0x2158be=this;return function(_0x5c5e24){if(_0x5c5e24){freeIsNotKey(_0x5c5e24,_0x2158be['zendeskAccounts'],'id');for(var _0x3397fb=0x0,_0xd2854f={},_0x3a99e6={};_0x3397fb<_0x5c5e24[_0x581b('0x41')];_0x3397fb+=0x1){_0xd2854f=_0x5c5e24[_0x3397fb];if(_['isUndefined'](_0x2158be[_0x581b('0x47')][_0xd2854f['id']])){_0x2158be['zendeskAccounts'][_0xd2854f['id']]=new ZendeskAccount(_0xd2854f);}else{_0x2158be[_0x581b('0x40')](_0x2158be[_0x581b('0x47')][_0xd2854f['id']],_0xd2854f);}}}return _0x2158be[_0x581b('0x47')];};};Realtime['prototype'][_0x581b('0x48')]=function(){var _0x5e27bd=this;return function(_0x182aa4){if(_0x182aa4){freeIsNotKey(_0x182aa4,_0x5e27bd[_0x581b('0x49')],'id');for(var _0x10fef1=0x0,_0x56c1a5={},_0x10e5af={};_0x10fef1<_0x182aa4[_0x581b('0x41')];_0x10fef1+=0x1){_0x56c1a5=_0x182aa4[_0x10fef1];if(_['isUndefined'](_0x5e27bd['salesforceAccounts'][_0x56c1a5['id']])){_0x5e27bd['salesforceAccounts'][_0x56c1a5['id']]=new SalesforceAccount(_0x56c1a5);}else{_0x5e27bd[_0x581b('0x40')](_0x5e27bd[_0x581b('0x49')][_0x56c1a5['id']],_0x56c1a5);}}}return _0x5e27bd[_0x581b('0x49')];};};Realtime[_0x581b('0x3c')]['initFreshdeskAccounts']=function(){var _0x2097b4=this;return function(_0x36f451){if(_0x36f451){freeIsNotKey(_0x36f451,_0x2097b4[_0x581b('0x1c')],'id');for(var _0x37e948=0x0,_0x240573={},_0x30b3c9={};_0x37e948<_0x36f451[_0x581b('0x41')];_0x37e948+=0x1){_0x240573=_0x36f451[_0x37e948];if(_[_0x581b('0x3f')](_0x2097b4['freshdeskAccounts'][_0x240573['id']])){_0x2097b4[_0x581b('0x1c')][_0x240573['id']]=new FreshdeskAccount(_0x240573);}else{_0x2097b4[_0x581b('0x40')](_0x2097b4[_0x581b('0x1c')][_0x240573['id']],_0x240573);}}}return _0x2097b4[_0x581b('0x1c')];};};Realtime[_0x581b('0x3c')]['initZohoAccounts']=function(){var _0x1c75d7=this;return function(_0x38cc8f){if(_0x38cc8f){freeIsNotKey(_0x38cc8f,_0x1c75d7[_0x581b('0x1d')],'id');for(var _0x211940=0x0,_0xb6ac8b={},_0x41d9d4={};_0x211940<_0x38cc8f['length'];_0x211940+=0x1){_0xb6ac8b=_0x38cc8f[_0x211940];if(_[_0x581b('0x3f')](_0x1c75d7[_0x581b('0x1d')][_0xb6ac8b['id']])){_0x1c75d7['zohoAccounts'][_0xb6ac8b['id']]=new ZohoAccount(_0xb6ac8b);}else{_0x1c75d7[_0x581b('0x40')](_0x1c75d7[_0x581b('0x1d')][_0xb6ac8b['id']],_0xb6ac8b);}}}return _0x1c75d7[_0x581b('0x1d')];};};Realtime[_0x581b('0x3c')][_0x581b('0x4a')]=function(){var _0x4866ba=this;return function(_0x348442){if(_0x348442){freeIsNotKey(_0x348442,_0x4866ba[_0x581b('0x1e')],'id');for(var _0x50b381=0x0,_0x31fa63={},_0x50b968={};_0x50b381<_0x348442[_0x581b('0x41')];_0x50b381+=0x1){_0x31fa63=_0x348442[_0x50b381];if(_[_0x581b('0x3f')](_0x4866ba[_0x581b('0x1e')][_0x31fa63['id']])){_0x4866ba[_0x581b('0x1e')][_0x31fa63['id']]=new DeskAccount(_0x31fa63);}else{_0x4866ba['mergeFromDatabase'](_0x4866ba['deskAccounts'][_0x31fa63['id']],_0x31fa63);}}}return _0x4866ba[_0x581b('0x1e')];};};Realtime[_0x581b('0x3c')]['initSugarcrmAccounts']=function(){var _0x5d85df=this;return function(_0x3af9f3){if(_0x3af9f3){freeIsNotKey(_0x3af9f3,_0x5d85df[_0x581b('0x1b')],'id');for(var _0x11b2bd=0x0,_0x5d4f35={},_0x37c5b9={};_0x11b2bd<_0x3af9f3[_0x581b('0x41')];_0x11b2bd+=0x1){_0x5d4f35=_0x3af9f3[_0x11b2bd];if(_[_0x581b('0x3f')](_0x5d85df[_0x581b('0x1b')][_0x5d4f35['id']])){_0x5d85df['sugarcrmAccounts'][_0x5d4f35['id']]=new SugarcrmAccount(_0x5d4f35);}else{_0x5d85df[_0x581b('0x40')](_0x5d85df[_0x581b('0x1b')][_0x5d4f35['id']],_0x5d4f35);}}}return _0x5d85df[_0x581b('0x1b')];};};Realtime[_0x581b('0x3c')][_0x581b('0x4b')]=function(){var _0x2ced2c=this;return function(_0xe32175){if(_0xe32175){freeIsNotKey(_0xe32175,_0x2ced2c[_0x581b('0x1f')],'id');for(var _0x54ac14=0x0,_0x416207={},_0x3431c5={};_0x54ac14<_0xe32175[_0x581b('0x41')];_0x54ac14+=0x1){_0x416207=_0xe32175[_0x54ac14];if(_[_0x581b('0x3f')](_0x2ced2c[_0x581b('0x1f')][_0x416207['id']])){_0x2ced2c[_0x581b('0x1f')][_0x416207['id']]=new VtigerAccount(_0x416207);}else{_0x2ced2c[_0x581b('0x40')](_0x2ced2c['vtigerAccounts'][_0x416207['id']],_0x416207);}}}return _0x2ced2c['vtigerAccounts'];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x17a9e4=this;return function(_0x26fd78){if(_0x26fd78){freeIsNotKey(_0x26fd78,_0x17a9e4[_0x581b('0x4c')],'id');for(var _0x1af8c9=0x0,_0x28cdde={},_0x16e1aa={};_0x1af8c9<_0x26fd78['length'];_0x1af8c9+=0x1){_0x28cdde=_0x26fd78[_0x1af8c9];if(_[_0x581b('0x3f')](_0x17a9e4[_0x581b('0x4c')][_0x28cdde['id']])){_0x17a9e4[_0x581b('0x4c')][_0x28cdde['id']]=new ServicenowAccount(_0x28cdde);}else{_0x17a9e4[_0x581b('0x40')](_0x17a9e4['servicenowAccounts'][_0x28cdde['id']],_0x28cdde);}}}return _0x17a9e4['servicenowAccounts'];};};Realtime[_0x581b('0x3c')][_0x581b('0x4d')]=function(){var _0x2c6e36=this;return function(_0x38279b){if(_0x38279b){freeIsNotKey(_0x38279b,_0x2c6e36['dynamics365Accounts'],'id');for(var _0x17bda5=0x0,_0x3c4860={},_0xdaa2dd={};_0x17bda5<_0x38279b['length'];_0x17bda5+=0x1){_0x3c4860=_0x38279b[_0x17bda5];if(_[_0x581b('0x3f')](_0x2c6e36[_0x581b('0x20')][_0x3c4860['id']])){_0x2c6e36[_0x581b('0x20')][_0x3c4860['id']]=new Dynamics365Account(_0x3c4860);}else{_0x2c6e36[_0x581b('0x40')](_0x2c6e36['dynamics365Accounts'][_0x3c4860['id']],_0x3c4860);}}}return _0x2c6e36[_0x581b('0x20')];};};Realtime[_0x581b('0x3c')][_0x581b('0x4e')]=function(){var _0x4f67c6=this;return function(_0x2cd88c){if(_0x2cd88c){freeIsNotKey(_0x2cd88c,_0x4f67c6[_0x581b('0x21')],'id');for(var _0x1185da=0x0,_0x4966d7={},_0x369c4d={};_0x1185da<_0x2cd88c[_0x581b('0x41')];_0x1185da+=0x1){_0x4966d7=_0x2cd88c[_0x1185da];if(_[_0x581b('0x3f')](_0x4f67c6[_0x581b('0x21')][_0x4966d7['id']])){_0x4f67c6[_0x581b('0x21')][_0x4966d7['id']]=new FreshsalesAccount(_0x4966d7);}else{_0x4f67c6[_0x581b('0x40')](_0x4f67c6[_0x581b('0x21')][_0x4966d7['id']],_0x4966d7);}}}return _0x4f67c6['freshsalesAccounts'];};};Realtime[_0x581b('0x3c')][_0x581b('0x4f')]=function(){var _0xd9f21f=this;return function(_0xf59076){for(var _0x4e42e4=0x0;_0x4e42e4<_0xf59076['length'];_0x4e42e4+=0x1){_['merge'](_0xd9f21f[_0x581b('0x45')][_0xf59076[_0x4e42e4][_0x581b('0x3e')]],_0xf59076[_0x4e42e4]);}return _0xd9f21f[_0x581b('0x45')];};};Realtime[_0x581b('0x3c')][_0x581b('0x50')]=function(){var _0x3f9834=this;return function(_0x2572df){clearVoiceQueues(_0x3f9834[_0x581b('0x45')]);if(_0x2572df){_0x2572df=_['groupBy'](_0x2572df,_0x581b('0x51'));for(var _0x211e37 in _0x2572df){if(_0x2572df[_0x581b('0x26')](_0x211e37)){var _0x354a19={};for(var _0x1cc0bb=0x0;_0x1cc0bb<_0x2572df[_0x211e37][_0x581b('0x41')];_0x1cc0bb+=0x1){var _0x381459=_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x52')];if(_0x3f9834[_0x581b('0x45')][_0x381459]){if(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x53')]){_0x3f9834['voiceQueues'][_0x381459][_0x581b('0x2f')]+=0x1;}if(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x54')]){_0x3f9834['voiceQueues'][_0x381459][_0x581b('0x30')]+=0x1;}_0x3f9834[_0x581b('0x45')][_0x381459][_0x581b('0x2b')]+=moment(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x55')])[_0x581b('0x56')](moment(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x57')]),'seconds')||0x0;if(_0x1cc0bb===_0x2572df[_0x211e37][_0x581b('0x41')]-0x1){_0x3f9834[_0x581b('0x45')][_0x381459]['sumDuration']+=moment(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x58')]||_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x59')]||_0x2572df[_0x211e37][_0x1cc0bb]['queuecallerexitAt'])[_0x581b('0x56')](moment(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x57')]),_0x581b('0x5a'))||0x0;_0x3f9834[_0x581b('0x45')][_0x381459]['total']+=0x1;if(_0x2572df[_0x211e37][_0x1cc0bb]['queuecallercomplete']){_0x3f9834[_0x581b('0x45')][_0x381459]['answered']+=0x1;_0x3f9834['voiceQueues'][_0x381459]['sumBillable']+=moment(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x58')])[_0x581b('0x56')](moment(_0x2572df[_0x211e37][_0x1cc0bb][_0x581b('0x55')]),_0x581b('0x5a'))||0x0;}}else{_0x3f9834[_0x581b('0x45')][_0x381459]['sumDuration']+=_0x3f9834['voiceQueues'][_0x381459][_0x581b('0x2b')]||0x0;}}}}}}return _0x3f9834[_0x581b('0x45')];};};Realtime[_0x581b('0x3c')][_0x581b('0x5b')]=function(){var _0x515e47=this;return function(_0x18d2fd){clearVoiceCallReports(_0x515e47['outbound']);if(_0x18d2fd){for(var _0x676ef5=0x0;_0x676ef5<_0x18d2fd[_0x581b('0x41')];_0x676ef5+=0x1){_0x515e47[_0x581b('0x5c')]['total']+=0x1;_0x515e47['outbound'][_0x581b('0x2c')]+=_0x18d2fd[_0x676ef5][_0x581b('0x5d')];if(_0x18d2fd[_0x676ef5]['disposition']===_0x581b('0x5e')){_0x515e47[_0x581b('0x5c')][_0x581b('0x2a')]+=0x1;_0x515e47[_0x581b('0x5c')][_0x581b('0x2b')]+=_0x18d2fd[_0x676ef5][_0x581b('0x5d')]-_0x18d2fd[_0x676ef5]['billableseconds']||0x0;_0x515e47[_0x581b('0x5c')]['sumBillable']+=_0x18d2fd[_0x676ef5]['billableseconds'];}}}return _0x515e47['outbound'];};};Realtime[_0x581b('0x3c')][_0x581b('0x5f')]=function(){var _0x578837=this;return function(_0x3df5f7){if(_0x3df5f7){freeIsNotKey(_0x3df5f7,_0x578837['campaigns'],'name');for(var _0x5b08df=0x0,_0x4209c0={};_0x5b08df<_0x3df5f7[_0x581b('0x41')];_0x5b08df+=0x1){_0x4209c0=_0x3df5f7[_0x5b08df];if(_[_0x581b('0x3f')](_0x578837[_0x581b('0x14')][_0x4209c0[_0x581b('0x3e')]])){_0x578837[_0x581b('0x14')][_0x4209c0['name']]=new Campaign(_0x4209c0);}else{_0x578837[_0x581b('0x40')](_0x578837[_0x581b('0x14')][_0x4209c0[_0x581b('0x3e')]],_0x4209c0);_0x578837['campaigns'][_0x4209c0[_0x581b('0x3e')]][_0x581b('0x60')]=_0x4209c0[_0x581b('0x61')]?_0x4209c0['SquareProject'][_0x581b('0x3e')]:undefined;}}}return _0x578837[_0x581b('0x14')];};};Realtime['prototype'][_0x581b('0x62')]=function(){var _0x67b6dc=this;return function(_0x412550){if(_0x412550){freeIsNotKey(_0x412550,_0x67b6dc[_0x581b('0x63')],'id');for(var _0x201967=0x0,_0x62d334={};_0x201967<_0x412550[_0x581b('0x41')];_0x201967+=0x1){_0x62d334=_0x412550[_0x201967];if(_[_0x581b('0x3f')](_0x67b6dc[_0x581b('0x63')][_0x62d334['id']])){_0x67b6dc[_0x581b('0x63')][_0x62d334['id']]=new VoiceExtension(_0x62d334);}else{_0x67b6dc[_0x581b('0x40')](_0x67b6dc[_0x581b('0x63')][_0x62d334['id']],_0x62d334);}}}return _0x67b6dc[_0x581b('0x63')];};};Realtime[_0x581b('0x3c')][_0x581b('0x64')]=function(){var _0x3de3dd=this;return function(_0x117bd2){clearCampaigns(_0x3de3dd['campaigns']);for(var _0x50a5ff=0x0;_0x50a5ff<_0x117bd2[_0x581b('0x41')];_0x50a5ff+=0x1){_['merge'](_0x3de3dd[_0x581b('0x14')][_0x117bd2[_0x50a5ff]['name']],_0x117bd2[_0x50a5ff]);}return _0x3de3dd[_0x581b('0x14')];};};Realtime[_0x581b('0x3c')][_0x581b('0x65')]=function(){var _0x43b8b6=this;return function(_0x51721d){if(_0x51721d){freeIsNotKey(_0x51721d,_0x43b8b6[_0x581b('0x22')],'id');for(var _0x4dd1e3=0x0,_0x1c9a94={},_0x2f2099={};_0x4dd1e3<_0x51721d[_0x581b('0x41')];_0x4dd1e3+=0x1){_0x1c9a94=_0x51721d[_0x4dd1e3];if(_['isUndefined'](_0x43b8b6[_0x581b('0x22')][_0x1c9a94['id']])){_0x43b8b6['faxAccounts'][_0x1c9a94['id']]=new FaxAccount(_0x1c9a94);}else{_0x43b8b6[_0x581b('0x40')](_0x43b8b6['faxAccounts'][_0x1c9a94['id']],_0x1c9a94);}}}return _0x43b8b6[_0x581b('0x22')];};};module[_0x581b('0x66')]=Realtime; \ No newline at end of file +var _0x73e4=['exports','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','name','interface','SIP/%s','sumHoldTime','sumDuration','sumBillable','isEmpty','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','format','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','disposition','duration','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x73e4,0x136));var _0x473e=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x73e4[_0x240261];return _0x45c332;};'use strict';var BPromise=require(_0x473e('0x0'));var util=require(_0x473e('0x1'));var _=require('lodash');var moment=require(_0x473e('0x2'));var Agent=require(_0x473e('0x3'));var Telephone=require(_0x473e('0x4'));var Trunk=require(_0x473e('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x473e('0x6'));var Template=require(_0x473e('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x473e('0x8'));var ZendeskAccount=require(_0x473e('0x9'));var SalesforceAccount=require(_0x473e('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x473e('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x473e('0xc'));var VtigerAccount=require(_0x473e('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x473e('0xe'));var FreshsalesAccount=require(_0x473e('0xf'));var FaxAccount=require(_0x473e('0x10'));var Realtime=function(){this[_0x473e('0x11')]={};this[_0x473e('0x12')]={};this[_0x473e('0x13')]={};this['voiceQueues']={};this[_0x473e('0x14')]={};this[_0x473e('0x15')]={};this[_0x473e('0x16')]={};this[_0x473e('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x473e('0x18')]={};this[_0x473e('0x19')]={};this[_0x473e('0x1a')]={};this[_0x473e('0x1b')]={};this[_0x473e('0x1c')]={};this[_0x473e('0x1d')]={};this[_0x473e('0x1e')]={};this['salesforceAccounts']={};this[_0x473e('0x1f')]={};this[_0x473e('0x20')]={};this[_0x473e('0x21')]={};this[_0x473e('0x22')]={};this[_0x473e('0x23')]={};this[_0x473e('0x24')]={};this[_0x473e('0x25')]={};this['freshsalesAccounts']={};this[_0x473e('0x26')]={};};function freeIsNotKey(_0xa97f0e,_0x49f5b0,_0x57f1b9){var _0x4f6809=_[_0x473e('0x27')](_0xa97f0e,function(_0x1e36c6,_0x956704){return _0x1e36c6[_0x57f1b9];});for(var _0x1cc8d6 in _0x49f5b0){if(_0x49f5b0[_0x473e('0x28')](_0x1cc8d6)){if(!_0x4f6809[_0x1cc8d6]){delete _0x49f5b0[_0x1cc8d6];}}}}function freeIsNotKeySip(_0xb5380a,_0x17d016){var _0x62fe6f=_[_0x473e('0x27')](_0xb5380a,function(_0x4723c9,_0x36bd02){return util['format']('SIP/%s',_0x4723c9[_0x473e('0x29')]);});for(var _0x5c646a in _0x17d016){if(_0x17d016[_0x473e('0x28')](_0x5c646a)){if(!_0x62fe6f[_0x5c646a]){delete _0x17d016[_0x5c646a];}}}}function freeIsNotKeyAgent(_0x2134ba,_0x19d07b){var _0x32e14a=_[_0x473e('0x27')](_0x2134ba,function(_0x169d00,_0x527836){var _0x638c40=_['isNil'](_0x169d00[_0x473e('0x2a')])?util['format'](_0x473e('0x2b'),_0x169d00['name']):_0x169d00[_0x473e('0x2a')];return _0x638c40;});for(var _0x2e95d5 in _0x19d07b){if(_0x19d07b['hasOwnProperty'](_0x2e95d5)){if(!_0x32e14a[_0x2e95d5]){delete _0x19d07b[_0x2e95d5];}}}}function clearVoiceCallReports(_0x1a487e){_0x1a487e['total']=0x0;_0x1a487e['answered']=0x0;_0x1a487e[_0x473e('0x2c')]=0x0;_0x1a487e[_0x473e('0x2d')]=0x0;_0x1a487e[_0x473e('0x2e')]=0x0;}function clearCampaigns(_0x5c89d2){if(!_[_0x473e('0x2f')](_0x5c89d2)){for(var _0x2426d1 in _0x5c89d2){if(_0x5c89d2[_0x473e('0x28')](_0x2426d1)){_0x5c89d2[_0x2426d1]['ivrTotalCallsDays']=0x0;_0x5c89d2[_0x2426d1]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x78dc66){if(!_['isEmpty'](_0x78dc66)){for(var _0x1c19a0 in _0x78dc66){if(_0x78dc66[_0x473e('0x28')](_0x1c19a0)){_0x78dc66[_0x1c19a0]['total']=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x30')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x31')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x32')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x2c')]=0x0;_0x78dc66[_0x1c19a0]['sumDuration']=0x0;_0x78dc66[_0x1c19a0]['sumBillable']=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x33')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x34')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x35')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x36')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x37')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x38')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x39')]=0x0;_0x78dc66[_0x1c19a0]['outboundDropCallsDayCallersExit']=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x3a')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x3b')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x3c')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x3d')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x33')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x3e')]=0x0;_0x78dc66[_0x1c19a0][_0x473e('0x3f')]=!![];}}}}Realtime[_0x473e('0x40')][_0x473e('0x41')]=function(_0x1088e8,_0x40702b){for(var _0x5f02bb in _0x40702b){if(_0x1088e8[_0x473e('0x28')](_0x5f02bb)){_0x1088e8[_0x5f02bb]=_0x40702b[_0x5f02bb];}}};Realtime[_0x473e('0x40')]['initAgents']=function(){var _0x2cf8cc=this;return function(_0x5cf38e){if(_0x5cf38e){freeIsNotKeyAgent(_0x5cf38e,_0x2cf8cc[_0x473e('0x11')]);for(var _0x13fc20=0x0,_0x2ccd30={},_0x2a5e01={};_0x13fc20<_0x5cf38e[_0x473e('0x42')];_0x13fc20+=0x1){_0x2ccd30=_0x5cf38e[_0x13fc20];var _0x4e1efd=_['isNil'](_0x2ccd30[_0x473e('0x2a')])?util['format']('SIP/%s',_0x2ccd30['name']):_0x2ccd30['interface'];if(_[_0x473e('0x43')](_0x2cf8cc[_0x473e('0x11')][_0x4e1efd])){_0x2cf8cc[_0x473e('0x11')][_0x4e1efd]=new Agent(_0x2ccd30);}else{_0x2cf8cc[_0x473e('0x41')](_0x2cf8cc['agents'][_0x4e1efd],_0x2ccd30);}}}return _0x2cf8cc['agents'];};};Realtime[_0x473e('0x40')]['initTelephones']=function(){var _0x2c7726=this;return function(_0x430a6b){if(_0x430a6b){freeIsNotKeySip(_0x430a6b,_0x2c7726[_0x473e('0x12')]);for(var _0xc7fe72=0x0,_0x186d49={},_0x32a61d={};_0xc7fe72<_0x430a6b[_0x473e('0x42')];_0xc7fe72+=0x1){_0x186d49=_0x430a6b[_0xc7fe72];if(_['isUndefined'](_0x2c7726['telephones'][util[_0x473e('0x44')](_0x473e('0x2b'),_0x186d49[_0x473e('0x29')])])){_0x2c7726[_0x473e('0x12')][util[_0x473e('0x44')](_0x473e('0x2b'),_0x186d49[_0x473e('0x29')])]=new Telephone(_0x186d49);}else{_0x2c7726['mergeFromDatabase'](_0x2c7726[_0x473e('0x12')][util['format']('SIP/%s',_0x186d49[_0x473e('0x29')])],_0x186d49);}}}return _0x2c7726[_0x473e('0x12')];};};Realtime['prototype']['initTrunks']=function(){var _0x5a78de=this;return function(_0x1205e1){if(_0x1205e1){freeIsNotKeySip(_0x1205e1,_0x5a78de[_0x473e('0x13')]);for(var _0x19fe35=0x0,_0x6870bc={},_0x13abc6={};_0x19fe35<_0x1205e1[_0x473e('0x42')];_0x19fe35+=0x1){_0x6870bc=_0x1205e1[_0x19fe35];if(_[_0x473e('0x43')](_0x5a78de[_0x473e('0x13')][util[_0x473e('0x44')](_0x473e('0x2b'),_0x6870bc[_0x473e('0x29')])])){_0x5a78de['trunks'][util[_0x473e('0x44')](_0x473e('0x2b'),_0x6870bc[_0x473e('0x29')])]=new Trunk(_0x6870bc);}else{_0x5a78de[_0x473e('0x41')](_0x5a78de[_0x473e('0x13')][util[_0x473e('0x44')](_0x473e('0x2b'),_0x6870bc['name'])],_0x6870bc);}}}return _0x5a78de['trunks'];};};Realtime['prototype'][_0x473e('0x45')]=function(){var _0x420128=this;return function(_0x54e2d5){if(_0x54e2d5){freeIsNotKey(_0x54e2d5,_0x420128[_0x473e('0x46')],_0x473e('0x29'));for(var _0x161863=0x0,_0x4c12e9={},_0x4d66c6={};_0x161863<_0x54e2d5[_0x473e('0x42')];_0x161863+=0x1){_0x4c12e9=_0x54e2d5[_0x161863];if(_[_0x473e('0x43')](_0x420128['voiceQueues'][_0x4c12e9['name']])){_0x420128['voiceQueues'][_0x4c12e9[_0x473e('0x29')]]=new VoiceQueue(_0x4c12e9);}else{_0x420128['mergeFromDatabase'](_0x420128[_0x473e('0x46')][_0x4c12e9[_0x473e('0x29')]],_0x4c12e9);}}}return _0x420128[_0x473e('0x46')];};};Realtime[_0x473e('0x40')][_0x473e('0x47')]=function(){var _0x199413=this;return function(_0x473b7c){if(_0x473b7c){freeIsNotKey(_0x473b7c,_0x199413['triggers'],'id');for(var _0x212f0f=0x0,_0x10373a={},_0x57ac32={};_0x212f0f<_0x473b7c['length'];_0x212f0f+=0x1){_0x10373a=_0x473b7c[_0x212f0f];if(_[_0x473e('0x43')](_0x199413[_0x473e('0x14')][_0x10373a['id']])){_0x199413[_0x473e('0x14')][_0x10373a['id']]=new Trigger(_0x10373a);}else{_0x199413[_0x473e('0x41')](_0x199413[_0x473e('0x14')][_0x10373a['id']],_0x10373a);}}}return _0x199413[_0x473e('0x14')];};};Realtime[_0x473e('0x40')][_0x473e('0x48')]=function(){var _0x51ec86=this;return function(_0x4a94e3){if(_0x4a94e3){freeIsNotKey(_0x4a94e3,_0x51ec86[_0x473e('0x16')],'id');for(var _0x5cdb7c=0x0,_0x3c4acc={},_0x208ead={};_0x5cdb7c<_0x4a94e3[_0x473e('0x42')];_0x5cdb7c+=0x1){_0x3c4acc=_0x4a94e3[_0x5cdb7c];if(_[_0x473e('0x43')](_0x51ec86[_0x473e('0x16')][_0x3c4acc['id']])){_0x51ec86[_0x473e('0x16')][_0x3c4acc['id']]=new Template(_0x3c4acc);}else{_0x51ec86[_0x473e('0x41')](_0x51ec86[_0x473e('0x16')][_0x3c4acc['id']],_0x3c4acc);}}}return _0x51ec86[_0x473e('0x16')];};};Realtime['prototype'][_0x473e('0x49')]=function(){var _0x40b884=this;return function(_0x2310a2){if(_0x2310a2){freeIsNotKey(_0x2310a2,_0x40b884[_0x473e('0x1e')],'id');for(var _0x1cb771=0x0,_0x1d8587={},_0x30e9cc={};_0x1cb771<_0x2310a2[_0x473e('0x42')];_0x1cb771+=0x1){_0x1d8587=_0x2310a2[_0x1cb771];if(_['isUndefined'](_0x40b884[_0x473e('0x1e')][_0x1d8587['id']])){_0x40b884['zendeskAccounts'][_0x1d8587['id']]=new ZendeskAccount(_0x1d8587);}else{_0x40b884[_0x473e('0x41')](_0x40b884['zendeskAccounts'][_0x1d8587['id']],_0x1d8587);}}}return _0x40b884['zendeskAccounts'];};};Realtime['prototype'][_0x473e('0x4a')]=function(){var _0x476e22=this;return function(_0x4f4b1d){if(_0x4f4b1d){freeIsNotKey(_0x4f4b1d,_0x476e22['salesforceAccounts'],'id');for(var _0x59d9f9=0x0,_0x27649d={},_0x2b024b={};_0x59d9f9<_0x4f4b1d['length'];_0x59d9f9+=0x1){_0x27649d=_0x4f4b1d[_0x59d9f9];if(_[_0x473e('0x43')](_0x476e22['salesforceAccounts'][_0x27649d['id']])){_0x476e22[_0x473e('0x4b')][_0x27649d['id']]=new SalesforceAccount(_0x27649d);}else{_0x476e22[_0x473e('0x41')](_0x476e22[_0x473e('0x4b')][_0x27649d['id']],_0x27649d);}}}return _0x476e22[_0x473e('0x4b')];};};Realtime[_0x473e('0x40')]['initFreshdeskAccounts']=function(){var _0x3732bf=this;return function(_0x226b9f){if(_0x226b9f){freeIsNotKey(_0x226b9f,_0x3732bf['freshdeskAccounts'],'id');for(var _0x1c5128=0x0,_0x2f1a0e={},_0xdb8f36={};_0x1c5128<_0x226b9f['length'];_0x1c5128+=0x1){_0x2f1a0e=_0x226b9f[_0x1c5128];if(_[_0x473e('0x43')](_0x3732bf['freshdeskAccounts'][_0x2f1a0e['id']])){_0x3732bf['freshdeskAccounts'][_0x2f1a0e['id']]=new FreshdeskAccount(_0x2f1a0e);}else{_0x3732bf['mergeFromDatabase'](_0x3732bf['freshdeskAccounts'][_0x2f1a0e['id']],_0x2f1a0e);}}}return _0x3732bf['freshdeskAccounts'];};};Realtime[_0x473e('0x40')][_0x473e('0x4c')]=function(){var _0xff2f1=this;return function(_0x45d058){if(_0x45d058){freeIsNotKey(_0x45d058,_0xff2f1[_0x473e('0x21')],'id');for(var _0x39a1dc=0x0,_0x236a56={},_0x90a43f={};_0x39a1dc<_0x45d058['length'];_0x39a1dc+=0x1){_0x236a56=_0x45d058[_0x39a1dc];if(_[_0x473e('0x43')](_0xff2f1[_0x473e('0x21')][_0x236a56['id']])){_0xff2f1['zohoAccounts'][_0x236a56['id']]=new ZohoAccount(_0x236a56);}else{_0xff2f1[_0x473e('0x41')](_0xff2f1[_0x473e('0x21')][_0x236a56['id']],_0x236a56);}}}return _0xff2f1['zohoAccounts'];};};Realtime['prototype'][_0x473e('0x4d')]=function(){var _0x5d0f82=this;return function(_0x5e74c8){if(_0x5e74c8){freeIsNotKey(_0x5e74c8,_0x5d0f82[_0x473e('0x22')],'id');for(var _0x3a7c9d=0x0,_0x21dd95={},_0x55829a={};_0x3a7c9d<_0x5e74c8['length'];_0x3a7c9d+=0x1){_0x21dd95=_0x5e74c8[_0x3a7c9d];if(_[_0x473e('0x43')](_0x5d0f82[_0x473e('0x22')][_0x21dd95['id']])){_0x5d0f82['deskAccounts'][_0x21dd95['id']]=new DeskAccount(_0x21dd95);}else{_0x5d0f82[_0x473e('0x41')](_0x5d0f82[_0x473e('0x22')][_0x21dd95['id']],_0x21dd95);}}}return _0x5d0f82[_0x473e('0x22')];};};Realtime[_0x473e('0x40')][_0x473e('0x4e')]=function(){var _0x2a7c79=this;return function(_0x52897e){if(_0x52897e){freeIsNotKey(_0x52897e,_0x2a7c79[_0x473e('0x1f')],'id');for(var _0x329b9c=0x0,_0x72b751={},_0x40dd2c={};_0x329b9c<_0x52897e[_0x473e('0x42')];_0x329b9c+=0x1){_0x72b751=_0x52897e[_0x329b9c];if(_[_0x473e('0x43')](_0x2a7c79[_0x473e('0x1f')][_0x72b751['id']])){_0x2a7c79[_0x473e('0x1f')][_0x72b751['id']]=new SugarcrmAccount(_0x72b751);}else{_0x2a7c79[_0x473e('0x41')](_0x2a7c79['sugarcrmAccounts'][_0x72b751['id']],_0x72b751);}}}return _0x2a7c79[_0x473e('0x1f')];};};Realtime['prototype'][_0x473e('0x4f')]=function(){var _0x554f53=this;return function(_0xe660d4){if(_0xe660d4){freeIsNotKey(_0xe660d4,_0x554f53[_0x473e('0x23')],'id');for(var _0x5f1064=0x0,_0x467d5d={},_0x1a5848={};_0x5f1064<_0xe660d4[_0x473e('0x42')];_0x5f1064+=0x1){_0x467d5d=_0xe660d4[_0x5f1064];if(_[_0x473e('0x43')](_0x554f53['vtigerAccounts'][_0x467d5d['id']])){_0x554f53[_0x473e('0x23')][_0x467d5d['id']]=new VtigerAccount(_0x467d5d);}else{_0x554f53[_0x473e('0x41')](_0x554f53[_0x473e('0x23')][_0x467d5d['id']],_0x467d5d);}}}return _0x554f53[_0x473e('0x23')];};};Realtime[_0x473e('0x40')]['initServicenowAccounts']=function(){var _0x2523bb=this;return function(_0xee7448){if(_0xee7448){freeIsNotKey(_0xee7448,_0x2523bb[_0x473e('0x24')],'id');for(var _0x4a4ddd=0x0,_0x5235bf={},_0x183df7={};_0x4a4ddd<_0xee7448[_0x473e('0x42')];_0x4a4ddd+=0x1){_0x5235bf=_0xee7448[_0x4a4ddd];if(_[_0x473e('0x43')](_0x2523bb[_0x473e('0x24')][_0x5235bf['id']])){_0x2523bb['servicenowAccounts'][_0x5235bf['id']]=new ServicenowAccount(_0x5235bf);}else{_0x2523bb[_0x473e('0x41')](_0x2523bb[_0x473e('0x24')][_0x5235bf['id']],_0x5235bf);}}}return _0x2523bb[_0x473e('0x24')];};};Realtime[_0x473e('0x40')]['initDynamics365Accounts']=function(){var _0x5ccd7f=this;return function(_0x58f967){if(_0x58f967){freeIsNotKey(_0x58f967,_0x5ccd7f[_0x473e('0x25')],'id');for(var _0x26d0c5=0x0,_0xca8cf={},_0x437648={};_0x26d0c5<_0x58f967['length'];_0x26d0c5+=0x1){_0xca8cf=_0x58f967[_0x26d0c5];if(_[_0x473e('0x43')](_0x5ccd7f[_0x473e('0x25')][_0xca8cf['id']])){_0x5ccd7f[_0x473e('0x25')][_0xca8cf['id']]=new Dynamics365Account(_0xca8cf);}else{_0x5ccd7f['mergeFromDatabase'](_0x5ccd7f[_0x473e('0x25')][_0xca8cf['id']],_0xca8cf);}}}return _0x5ccd7f[_0x473e('0x25')];};};Realtime['prototype'][_0x473e('0x50')]=function(){var _0x36b58d=this;return function(_0x2cccdd){if(_0x2cccdd){freeIsNotKey(_0x2cccdd,_0x36b58d['freshsalesAccounts'],'id');for(var _0x228026=0x0,_0x7ee34e={},_0x57ce92={};_0x228026<_0x2cccdd[_0x473e('0x42')];_0x228026+=0x1){_0x7ee34e=_0x2cccdd[_0x228026];if(_[_0x473e('0x43')](_0x36b58d['freshsalesAccounts'][_0x7ee34e['id']])){_0x36b58d[_0x473e('0x51')][_0x7ee34e['id']]=new FreshsalesAccount(_0x7ee34e);}else{_0x36b58d[_0x473e('0x41')](_0x36b58d[_0x473e('0x51')][_0x7ee34e['id']],_0x7ee34e);}}}return _0x36b58d[_0x473e('0x51')];};};Realtime['prototype'][_0x473e('0x52')]=function(){var _0x8d53f1=this;return function(_0x254c60){for(var _0x3f94a0=0x0;_0x3f94a0<_0x254c60[_0x473e('0x42')];_0x3f94a0+=0x1){_[_0x473e('0x53')](_0x8d53f1[_0x473e('0x46')][_0x254c60[_0x3f94a0]['name']],_0x254c60[_0x3f94a0]);}return _0x8d53f1[_0x473e('0x46')];};};Realtime[_0x473e('0x40')]['initVoiceQueueReports']=function(){var _0xe18e5e=this;return function(_0x5e9f07){clearVoiceQueues(_0xe18e5e[_0x473e('0x46')]);if(_0x5e9f07){_0x5e9f07=_['groupBy'](_0x5e9f07,_0x473e('0x54'));for(var _0x4ac4ee in _0x5e9f07){if(_0x5e9f07[_0x473e('0x28')](_0x4ac4ee)){var _0x4629fa={};for(var _0xf068f7=0x0;_0xf068f7<_0x5e9f07[_0x4ac4ee][_0x473e('0x42')];_0xf068f7+=0x1){var _0xbf30a3=_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x55')];if(_0xe18e5e[_0x473e('0x46')][_0xbf30a3]){if(_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x56')]){_0xe18e5e[_0x473e('0x46')][_0xbf30a3][_0x473e('0x31')]+=0x1;}if(_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x57')]){_0xe18e5e['voiceQueues'][_0xbf30a3]['abandoned']+=0x1;}_0xe18e5e[_0x473e('0x46')][_0xbf30a3][_0x473e('0x2c')]+=moment(_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x58')])[_0x473e('0x59')](moment(_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x5a')]),_0x473e('0x5b'))||0x0;if(_0xf068f7===_0x5e9f07[_0x4ac4ee]['length']-0x1){_0xe18e5e['voiceQueues'][_0xbf30a3][_0x473e('0x2d')]+=moment(_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x5c')]||_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x5d')]||_0x5e9f07[_0x4ac4ee][_0xf068f7]['queuecallerexitAt'])[_0x473e('0x59')](moment(_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x5a')]),_0x473e('0x5b'))||0x0;_0xe18e5e[_0x473e('0x46')][_0xbf30a3]['total']+=0x1;if(_0x5e9f07[_0x4ac4ee][_0xf068f7][_0x473e('0x5e')]){_0xe18e5e[_0x473e('0x46')][_0xbf30a3][_0x473e('0x30')]+=0x1;_0xe18e5e['voiceQueues'][_0xbf30a3][_0x473e('0x2e')]+=moment(_0x5e9f07[_0x4ac4ee][_0xf068f7]['queuecallercompleteAt'])['diff'](moment(_0x5e9f07[_0x4ac4ee][_0xf068f7]['queuecallerleaveAt']),_0x473e('0x5b'))||0x0;}}else{_0xe18e5e[_0x473e('0x46')][_0xbf30a3][_0x473e('0x2d')]+=_0xe18e5e['voiceQueues'][_0xbf30a3][_0x473e('0x2c')]||0x0;}}}}}}return _0xe18e5e[_0x473e('0x46')];};};Realtime[_0x473e('0x40')]['initVoiceCallReports']=function(){var _0x4f1e85=this;return function(_0x5ba915){clearVoiceCallReports(_0x4f1e85[_0x473e('0x17')]);if(_0x5ba915){for(var _0x101d06=0x0;_0x101d06<_0x5ba915[_0x473e('0x42')];_0x101d06+=0x1){_0x4f1e85[_0x473e('0x17')]['total']+=0x1;_0x4f1e85[_0x473e('0x17')][_0x473e('0x2d')]+=_0x5ba915[_0x101d06]['duration'];if(_0x5ba915[_0x101d06][_0x473e('0x5f')]==='ANSWERED'){_0x4f1e85[_0x473e('0x17')][_0x473e('0x30')]+=0x1;_0x4f1e85[_0x473e('0x17')][_0x473e('0x2c')]+=_0x5ba915[_0x101d06][_0x473e('0x60')]-_0x5ba915[_0x101d06][_0x473e('0x61')]||0x0;_0x4f1e85[_0x473e('0x17')]['sumBillable']+=_0x5ba915[_0x101d06][_0x473e('0x61')];}}}return _0x4f1e85[_0x473e('0x17')];};};Realtime['prototype']['initCampaigns']=function(){var _0x28edfe=this;return function(_0x5f3193){if(_0x5f3193){freeIsNotKey(_0x5f3193,_0x28edfe['campaigns'],'name');for(var _0x3379ae=0x0,_0x42bb89={};_0x3379ae<_0x5f3193[_0x473e('0x42')];_0x3379ae+=0x1){_0x42bb89=_0x5f3193[_0x3379ae];if(_[_0x473e('0x43')](_0x28edfe[_0x473e('0x15')][_0x42bb89['name']])){_0x28edfe[_0x473e('0x15')][_0x42bb89[_0x473e('0x29')]]=new Campaign(_0x42bb89);}else{_0x28edfe['mergeFromDatabase'](_0x28edfe[_0x473e('0x15')][_0x42bb89[_0x473e('0x29')]],_0x42bb89);_0x28edfe[_0x473e('0x15')][_0x42bb89[_0x473e('0x29')]][_0x473e('0x62')]=_0x42bb89['SquareProject']?_0x42bb89[_0x473e('0x63')][_0x473e('0x29')]:undefined;}}}return _0x28edfe[_0x473e('0x15')];};};Realtime[_0x473e('0x40')][_0x473e('0x64')]=function(){var _0x554718=this;return function(_0x5838b5){if(_0x5838b5){freeIsNotKey(_0x5838b5,_0x554718[_0x473e('0x18')],'id');for(var _0x5f51e5=0x0,_0x5d96e7={};_0x5f51e5<_0x5838b5[_0x473e('0x42')];_0x5f51e5+=0x1){_0x5d96e7=_0x5838b5[_0x5f51e5];if(_[_0x473e('0x43')](_0x554718[_0x473e('0x18')][_0x5d96e7['id']])){_0x554718[_0x473e('0x18')][_0x5d96e7['id']]=new VoiceExtension(_0x5d96e7);}else{_0x554718[_0x473e('0x41')](_0x554718['voiceExtensions'][_0x5d96e7['id']],_0x5d96e7);}}}return _0x554718[_0x473e('0x18')];};};Realtime[_0x473e('0x40')][_0x473e('0x65')]=function(){var _0x28cc92=this;return function(_0xbd9862){clearCampaigns(_0x28cc92[_0x473e('0x15')]);for(var _0x4dde56=0x0;_0x4dde56<_0xbd9862['length'];_0x4dde56+=0x1){_[_0x473e('0x53')](_0x28cc92[_0x473e('0x15')][_0xbd9862[_0x4dde56][_0x473e('0x29')]],_0xbd9862[_0x4dde56]);}return _0x28cc92['campaigns'];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x5e6b24=this;return function(_0x34fc50){if(_0x34fc50){freeIsNotKey(_0x34fc50,_0x5e6b24['faxAccounts'],'id');for(var _0x24ec39=0x0,_0x2ce3cf={},_0x184fa7={};_0x24ec39<_0x34fc50[_0x473e('0x42')];_0x24ec39+=0x1){_0x2ce3cf=_0x34fc50[_0x24ec39];if(_['isUndefined'](_0x5e6b24[_0x473e('0x26')][_0x2ce3cf['id']])){_0x5e6b24['faxAccounts'][_0x2ce3cf['id']]=new FaxAccount(_0x2ce3cf);}else{_0x5e6b24[_0x473e('0x41')](_0x5e6b24[_0x473e('0x26')][_0x2ce3cf['id']],_0x2ce3cf);}}}return _0x5e6b24['faxAccounts'];};};module[_0x473e('0x66')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 841ab3a..15d91ca 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 _0x6d5f=['forEach','indexOf','mobile','substring','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','find','name','length','connectedlinenum','assigned','lastAssignedTo','interface','isNil','format','SIP/%s','queuecallercompleteAt','queuecallerexit','match','getAgentByInternal','keys','getCallType','channel','calleridnum','internal','destination','exten','type','dialer','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','membername','create','monitorFilename','monitors','filename','createdAt','xcally-motion-dialer','voiceAgentReport','isArray'];(function(_0x1aef30,_0x3ef42e){var _0x317fba=function(_0x1b58fa){while(--_0x1b58fa){_0x1aef30['push'](_0x1aef30['shift']());}};_0x317fba(++_0x3ef42e);}(_0x6d5f,0x15d));var _0xf6d5=function(_0x30fe97,_0x34704f){_0x30fe97=_0x30fe97-0x0;var _0x4981f0=_0x6d5f[_0x30fe97];return _0x4981f0;};'use strict';var _=require(_0xf6d5('0x0'));var moment=require(_0xf6d5('0x1'));var util=require(_0xf6d5('0x2'));var config=require(_0xf6d5('0x3'));var ami=require(_0xf6d5('0x4'));var RpcVoiceAgentReport=require(_0xf6d5('0x5'));var RpcVoiceCallReport=require(_0xf6d5('0x6'));var RpcVoiceDialReport=require(_0xf6d5('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xf6d5('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xf6d5('0x9'));var VoiceAgentReport=require(_0xf6d5('0xa'));var VoiceDialReport=require(_0xf6d5('0xb'));var UserReport=require('./userReport');function Report(_0x37632d){this[_0xf6d5('0xc')]=_0x37632d;this[_0xf6d5('0xd')]=_0x37632d[_0xf6d5('0xd')];this[_0xf6d5('0xe')]=_0x37632d[_0xf6d5('0xe')];}Report[_0xf6d5('0xf')][_0xf6d5('0x10')]=function(_0x527f00){var _0x359ff2=new VoiceQueueReport(this[_0xf6d5('0xc')]);var _0x21956a=new VoiceAgentReport(this[_0xf6d5('0xc')]);var _0x34f625=new VoiceDialReport(this[_0xf6d5('0xc')]);var _0x208d82=new VoiceCallReport(this[_0xf6d5('0xc')]);var _0x3ceba9=new UserReport(this[_0xf6d5('0xc')]);if(config[_0xf6d5('0x11')]&&config[_0xf6d5('0x11')][_0xf6d5('0x12')]){ami['on'](_0xf6d5('0x13'),this[_0xf6d5('0x14')][_0xf6d5('0x15')](this));ami['on'](_0xf6d5('0x16'),this[_0xf6d5('0x17')][_0xf6d5('0x15')](this));ami['on'](_0xf6d5('0x18'),this['voiceAgentReport']['bind'](this));ami['on'](_0xf6d5('0x19'),this[_0xf6d5('0x1a')][_0xf6d5('0x15')](this));ami['on']('blindtransfer',this[_0xf6d5('0x1b')]['bind'](this));ami['on'](_0xf6d5('0x1c'),this[_0xf6d5('0x1d')][_0xf6d5('0x15')](this));}};Report[_0xf6d5('0xf')][_0xf6d5('0x1e')]=function(_0x5abbe7){var _0x532547;_0x532547=_['find'](this[_0xf6d5('0xd')],function(_0x17d626){return _0x17d626[_0xf6d5('0x1f')]==_0x5abbe7||_0x17d626['name']==_0x5abbe7;});if(_['isNil'](_0x532547)){var _0x1c6850=_[_0xf6d5('0x20')](this['telephones'],function(_0x4c95de){return _0x4c95de[_0xf6d5('0x1f')]==_0x5abbe7||_0x4c95de['name']==_0x5abbe7;});if(_0x1c6850){_0x532547=_[_0xf6d5('0x20')](this['agents'],function(_0x33fa34){return _0x33fa34['interface']==util['format']('SIP/%s',_0x1c6850[_0xf6d5('0x21')]);});}}return _0x532547;};Report[_0xf6d5('0xf')]['voiceQueueReport']=function(_0x2aa543){for(var _0x405eee=0x0;_0x405eee<_0x2aa543[_0xf6d5('0x22')];_0x405eee+=0x1){var _0x197c09=this[_0xf6d5('0x1e')](_0x2aa543[_0x405eee][_0xf6d5('0x23')]);if(_0x197c09){_0x2aa543[_0x405eee][_0xf6d5('0x1f')]=_0x197c09[_0xf6d5('0x1f')];_0x2aa543[_0x405eee][_0xf6d5('0x24')]=!![];_0x2aa543[_0x405eee][_0xf6d5('0x25')]=_0x197c09[_0xf6d5('0x21')];_0x2aa543[_0x405eee][_0xf6d5('0x26')]=_[_0xf6d5('0x27')](_0x197c09[_0xf6d5('0x26')])?util[_0xf6d5('0x28')](_0xf6d5('0x29'),_0x197c09[_0xf6d5('0x21')]):_0x197c09['interface'];if(_0x2aa543[_0x405eee]['queuecallercomplete']){_0x2aa543[_0x405eee][_0xf6d5('0x2a')]=moment()[_0xf6d5('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2aa543[_0x405eee][_0xf6d5('0x2b')]){_0x2aa543[_0x405eee]['queuecallerexitAt']=moment()[_0xf6d5('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xf6d5('0x14')](_0x2aa543[_0x405eee]);}RpcVoiceQueueReport['create'](_0x2aa543[_0x405eee]);}};function extractCalleridNumber(_0x4469cf){var _0x34b56f=_0x4469cf[_0xf6d5('0x2c')](/<(.*?)>/);return _0x34b56f?_0x34b56f[0x1]:_0x4469cf;}Report[_0xf6d5('0xf')][_0xf6d5('0x2d')]=function(_0x5d5a00){for(var _0x5d9bb9=0x0;_0x5d9bb9',_0x160beb[_0xf6d5('0x41')],_0x160beb[_0xf6d5('0x31')]);}if(RpcVoiceTransferReport[_0xf6d5('0x42')][_0x160beb['linkedid']]){var _0x15f7c4=RpcVoiceTransferReport[_0xf6d5('0x42')][_0x160beb[_0xf6d5('0x43')]];_0x15f7c4[_0xf6d5('0x44')]=_0x160beb[_0xf6d5('0x45')];RpcVoiceTransferReport[_0xf6d5('0x1b')](_0x15f7c4);delete RpcVoiceTransferReport[_0xf6d5('0x42')][_0x160beb[_0xf6d5('0x43')]];}if(_[_0xf6d5('0x27')](_0x160beb[_0xf6d5('0x35')])){_0x160beb['type']=this[_0xf6d5('0x2f')](_0x160beb);}if(_[_0xf6d5('0x27')](_0x160beb[_0xf6d5('0x46')])){var _0x565b9c=_0x160beb['channel'][_0xf6d5('0x47')]('-')[0x0];var _0x522a69=this[_0xf6d5('0xd')][_0x565b9c];if(!_0x522a69)_0x522a69=this[_0xf6d5('0x2d')](_0x160beb[_0xf6d5('0x1f')]);if(_0x522a69){_0x160beb[_0xf6d5('0x46')]=_0x522a69['id'];_0x160beb[_0xf6d5('0x48')]=_0x522a69[_0xf6d5('0x21')];}}RpcVoiceCallReport[_0xf6d5('0x49')](_0x160beb);if(_0x160beb['monitor']){for(var _0xcc038f=0x0;_0xcc038f<_0x160beb['monitors'][_0xf6d5('0x22')];_0xcc038f+=0x1){_0x160beb[_0xf6d5('0x4a')]=_0x160beb[_0xf6d5('0x4b')][_0xcc038f][_0xf6d5('0x4c')];_0x160beb[_0xf6d5('0x4d')]=_0x160beb[_0xf6d5('0x4b')][_0xcc038f][_0xf6d5('0x4d')];if(_0x160beb['exten']==_0xf6d5('0x3c')){_0x160beb['calleridnum']=_0x160beb[_0xf6d5('0x23')];_0x160beb[_0xf6d5('0x41')]=_0x160beb['connectedlinename'];_0x160beb[_0xf6d5('0x23')]=_0x160beb[_0xf6d5('0x1f')];_0x160beb['connectedlinename']=_0x160beb[_0xf6d5('0x48')];_0x160beb[_0xf6d5('0x34')]=_0x160beb[_0xf6d5('0x3e')];}else if(_0x160beb['exten']==_0xf6d5('0x4e')){_0x160beb[_0xf6d5('0x31')]=_0x160beb['destination'];_0x160beb[_0xf6d5('0x34')]=_0x160beb[_0xf6d5('0x3e')];}RpcVoiceRecording['create'](_0x160beb);}}};Report[_0xf6d5('0xf')][_0xf6d5('0x4f')]=function(_0xa7a16b){if(_[_0xf6d5('0x50')](_0xa7a16b)){_0xa7a16b[_0xf6d5('0x51')](function(_0x597c7a){RpcVoiceAgentReport[_0xf6d5('0x49')](_0x597c7a);});}else{RpcVoiceAgentReport[_0xf6d5('0x49')](_0xa7a16b);}};Report[_0xf6d5('0xf')][_0xf6d5('0x1a')]=function(_0x2da513){RpcVoiceDialReport[_0xf6d5('0x49')](_0x2da513);var _0x2a0b01;var _0x31fe43;var _0x30c457=_0x2da513[_0xf6d5('0x30')];if(_['startsWith'](_0x30c457,'Local')){_0x31fe43=_0x30c457['substring'](_0x30c457[_0xf6d5('0x52')]('/')+0x1,_0x30c457[_0xf6d5('0x52')]('@'));_0x2a0b01=_[_0xf6d5('0x20')](this['agents'],function(_0x3bf3fc){return _0x3bf3fc[_0xf6d5('0x53')]==_0x31fe43||_0x3bf3fc['phone']==_0x31fe43||_0x3bf3fc['accountcode']==_0x31fe43;});}else{_0x31fe43=_0x30c457[_0xf6d5('0x54')](_0x30c457['indexOf']('/')+0x1,_0x30c457['lastIndexOf']('-'));_0x2a0b01=this['findAgent'](_0x31fe43);}if(_0x2a0b01){_0x2da513[_0xf6d5('0x26')]=_[_0xf6d5('0x27')](_0x2a0b01[_0xf6d5('0x26')])?util['format'](_0xf6d5('0x29'),_0x2a0b01[_0xf6d5('0x21')]):_0x2a0b01[_0xf6d5('0x26')];_0x2da513[_0xf6d5('0x48')]=_0x2a0b01[_0xf6d5('0x21')];_0x2da513[_0xf6d5('0x1f')]=_0x2a0b01['accountcode'];RpcMemberReport[_0xf6d5('0x1a')](_0x2da513);}};Report['prototype'][_0xf6d5('0x1b')]=function(_0x4e6c47){RpcVoiceTransferReport[_0xf6d5('0x42')][_0x4e6c47['transfererlinkedid']]=_0x4e6c47;};Report['prototype'][_0xf6d5('0x1d')]=function(_0x1fdd81){RpcVoiceTransferReport[_0xf6d5('0x1d')](_0x1fdd81);};module[_0xf6d5('0x55')]=Report; \ No newline at end of file +var _0x0981=['attendedTransfer','exports','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','telephones','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','prototype','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','agents','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','from-voip-provider','callerid','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','voiceAgentReport','forEach','startsWith','Local','substring','indexOf','mobile'];(function(_0x1228cf,_0x5f36b0){var _0x1433ff=function(_0x22c12d){while(--_0x22c12d){_0x1228cf['push'](_0x1228cf['shift']());}};_0x1433ff(++_0x5f36b0);}(_0x0981,0x113));var _0x1098=function(_0x44166f,_0x317191){_0x44166f=_0x44166f-0x0;var _0x2b8d1c=_0x0981[_0x44166f];return _0x2b8d1c;};'use strict';var _=require('lodash');var moment=require(_0x1098('0x0'));var util=require(_0x1098('0x1'));var config=require(_0x1098('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x1098('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x1098('0x4'));var RpcMemberReport=require(_0x1098('0x5'));var RpcVoiceQueueReport=require(_0x1098('0x6'));var RpcVoiceRecording=require(_0x1098('0x7'));var RpcVoiceTransferReport=require(_0x1098('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x1098('0x9'));var VoiceAgentReport=require(_0x1098('0xa'));var VoiceDialReport=require(_0x1098('0xb'));var UserReport=require('./userReport');function Report(_0x33129e){this[_0x1098('0xc')]=_0x33129e;this['agents']=_0x33129e['agents'];this[_0x1098('0xd')]=_0x33129e[_0x1098('0xd')];}Report['prototype']['sync']=function(_0x4a834){var _0x11a373=new VoiceQueueReport(this[_0x1098('0xc')]);var _0x41ae98=new VoiceAgentReport(this[_0x1098('0xc')]);var _0x5a5836=new VoiceDialReport(this[_0x1098('0xc')]);var _0xea487d=new VoiceCallReport(this[_0x1098('0xc')]);var _0x10282b=new UserReport(this['realtime']);if(config[_0x1098('0xe')]&&config[_0x1098('0xe')][_0x1098('0xf')]){ami['on'](_0x1098('0x10'),this[_0x1098('0x11')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x1098('0x12')][_0x1098('0x13')](this));ami['on'](_0x1098('0x14'),this['voiceAgentReport'][_0x1098('0x13')](this));ami['on'](_0x1098('0x15'),this[_0x1098('0x16')][_0x1098('0x13')](this));ami['on'](_0x1098('0x17'),this[_0x1098('0x18')][_0x1098('0x13')](this));ami['on'](_0x1098('0x19'),this['attendedTransfer'][_0x1098('0x13')](this));}};Report[_0x1098('0x1a')][_0x1098('0x1b')]=function(_0x1b4bb1){var _0x505d05;_0x505d05=_[_0x1098('0x1c')](this['agents'],function(_0xad9531){return _0xad9531[_0x1098('0x1d')]==_0x1b4bb1||_0xad9531['name']==_0x1b4bb1;});if(_[_0x1098('0x1e')](_0x505d05)){var _0x50928f=_[_0x1098('0x1c')](this[_0x1098('0xd')],function(_0x8f39b5){return _0x8f39b5[_0x1098('0x1d')]==_0x1b4bb1||_0x8f39b5[_0x1098('0x1f')]==_0x1b4bb1;});if(_0x50928f){_0x505d05=_[_0x1098('0x1c')](this['agents'],function(_0x1802cb){return _0x1802cb[_0x1098('0x20')]==util[_0x1098('0x21')](_0x1098('0x22'),_0x50928f[_0x1098('0x1f')]);});}}return _0x505d05;};Report[_0x1098('0x1a')]['voiceQueueReport']=function(_0x330c26){for(var _0x3fe452=0x0;_0x3fe452<_0x330c26[_0x1098('0x23')];_0x3fe452+=0x1){var _0x31ab94=this[_0x1098('0x1b')](_0x330c26[_0x3fe452][_0x1098('0x24')]);if(_0x31ab94){_0x330c26[_0x3fe452]['accountcode']=_0x31ab94[_0x1098('0x1d')];_0x330c26[_0x3fe452][_0x1098('0x25')]=!![];_0x330c26[_0x3fe452][_0x1098('0x26')]=_0x31ab94[_0x1098('0x1f')];_0x330c26[_0x3fe452][_0x1098('0x20')]=_[_0x1098('0x1e')](_0x31ab94['interface'])?util[_0x1098('0x21')]('SIP/%s',_0x31ab94[_0x1098('0x1f')]):_0x31ab94[_0x1098('0x20')];if(_0x330c26[_0x3fe452]['queuecallercomplete']){_0x330c26[_0x3fe452][_0x1098('0x27')]=moment()[_0x1098('0x21')](_0x1098('0x28'));}if(_0x330c26[_0x3fe452][_0x1098('0x29')]){_0x330c26[_0x3fe452][_0x1098('0x2a')]=moment()[_0x1098('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x1098('0x11')](_0x330c26[_0x3fe452]);}RpcVoiceQueueReport['create'](_0x330c26[_0x3fe452]);}};function extractCalleridNumber(_0x5809ea){var _0x19cbcc=_0x5809ea[_0x1098('0x2b')](/<(.*?)>/);return _0x19cbcc?_0x19cbcc[0x1]:_0x5809ea;}Report[_0x1098('0x1a')][_0x1098('0x2c')]=function(_0x4b539a){for(var _0x5aaff0=0x0;_0x5aaff0',_0x4054e5[_0x1098('0x42')],_0x4054e5[_0x1098('0x32')]);}if(RpcVoiceTransferReport[_0x1098('0x43')][_0x4054e5[_0x1098('0x44')]]){var _0x10db3c=RpcVoiceTransferReport[_0x1098('0x43')][_0x4054e5[_0x1098('0x44')]];_0x10db3c[_0x1098('0x45')]=_0x4054e5[_0x1098('0x46')];RpcVoiceTransferReport['blindTransfer'](_0x10db3c);delete RpcVoiceTransferReport[_0x1098('0x43')][_0x4054e5['linkedid']];}if(_['isNil'](_0x4054e5['type'])){_0x4054e5[_0x1098('0x37')]=this[_0x1098('0x2f')](_0x4054e5);}if(_['isNil'](_0x4054e5[_0x1098('0x47')])){var _0x38c040=_0x4054e5['channel'][_0x1098('0x31')]('-')[0x0];var _0x153a0c=this[_0x1098('0x2e')][_0x38c040];if(!_0x153a0c)_0x153a0c=this[_0x1098('0x2c')](_0x4054e5[_0x1098('0x1d')]);if(_0x153a0c){_0x4054e5['UserId']=_0x153a0c['id'];_0x4054e5[_0x1098('0x48')]=_0x153a0c['name'];}}RpcVoiceCallReport[_0x1098('0x49')](_0x4054e5);if(_0x4054e5[_0x1098('0x4a')]){for(var _0xeb856a=0x0;_0xeb856a<_0x4054e5[_0x1098('0x4b')][_0x1098('0x23')];_0xeb856a+=0x1){_0x4054e5[_0x1098('0x4c')]=_0x4054e5[_0x1098('0x4b')][_0xeb856a][_0x1098('0x4d')];_0x4054e5[_0x1098('0x4e')]=_0x4054e5[_0x1098('0x4b')][_0xeb856a][_0x1098('0x4e')];if(_0x4054e5[_0x1098('0x36')]==_0x1098('0x4f')){_0x4054e5[_0x1098('0x32')]=_0x4054e5[_0x1098('0x24')];_0x4054e5['calleridname']=_0x4054e5[_0x1098('0x50')];_0x4054e5[_0x1098('0x24')]=_0x4054e5['accountcode'];_0x4054e5[_0x1098('0x50')]=_0x4054e5[_0x1098('0x48')];_0x4054e5[_0x1098('0x36')]=_0x4054e5[_0x1098('0x3e')];}else if(_0x4054e5[_0x1098('0x36')]==_0x1098('0x51')){_0x4054e5[_0x1098('0x32')]=_0x4054e5['destination'];_0x4054e5['exten']=_0x4054e5[_0x1098('0x3e')];}RpcVoiceRecording[_0x1098('0x49')](_0x4054e5);}}};Report[_0x1098('0x1a')][_0x1098('0x52')]=function(_0x5b9859){if(_['isArray'](_0x5b9859)){_0x5b9859[_0x1098('0x53')](function(_0x5c4580){RpcVoiceAgentReport[_0x1098('0x49')](_0x5c4580);});}else{RpcVoiceAgentReport['create'](_0x5b9859);}};Report['prototype'][_0x1098('0x16')]=function(_0x491f27){RpcVoiceDialReport['create'](_0x491f27);var _0x3b0b9f;var _0x5ab078;var _0xaaec6d=_0x491f27['channel'];if(_[_0x1098('0x54')](_0xaaec6d,_0x1098('0x55'))){_0x5ab078=_0xaaec6d[_0x1098('0x56')](_0xaaec6d[_0x1098('0x57')]('/')+0x1,_0xaaec6d[_0x1098('0x57')]('@'));_0x3b0b9f=_[_0x1098('0x1c')](this[_0x1098('0x2e')],function(_0x6aa1e8){return _0x6aa1e8[_0x1098('0x58')]==_0x5ab078||_0x6aa1e8['phone']==_0x5ab078||_0x6aa1e8[_0x1098('0x1d')]==_0x5ab078;});}else{_0x5ab078=_0xaaec6d[_0x1098('0x56')](_0xaaec6d[_0x1098('0x57')]('/')+0x1,_0xaaec6d['lastIndexOf']('-'));_0x3b0b9f=this[_0x1098('0x1b')](_0x5ab078);}if(_0x3b0b9f){_0x491f27[_0x1098('0x20')]=_[_0x1098('0x1e')](_0x3b0b9f[_0x1098('0x20')])?util[_0x1098('0x21')](_0x1098('0x22'),_0x3b0b9f[_0x1098('0x1f')]):_0x3b0b9f['interface'];_0x491f27[_0x1098('0x48')]=_0x3b0b9f['name'];_0x491f27['accountcode']=_0x3b0b9f[_0x1098('0x1d')];RpcMemberReport[_0x1098('0x16')](_0x491f27);}};Report['prototype']['blindTransfer']=function(_0x2748a9){RpcVoiceTransferReport['transfers'][_0x2748a9['transfererlinkedid']]=_0x2748a9;};Report['prototype'][_0x1098('0x59')]=function(_0x433cae){RpcVoiceTransferReport[_0x1098('0x59')](_0x433cae);};module[_0x1098('0x5a')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index eead04b..04b8493 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce85=['error','actionDeviceStateList','[userReport][devicestatelist]','inspect','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','find','state','merge','omit','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:save','[userReport][registry]','[userReport][devicestatechange]','device','local','toLowerCase','inuse','toNumber','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','syncPeerStatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','util','bluebird','../../../config/logger','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch'];(function(_0x471ec4,_0x42c871){var _0x43ab60=function(_0x178e9f){while(--_0x178e9f){_0x471ec4['push'](_0x471ec4['shift']());}};_0x43ab60(++_0x42c871);}(_0xce85,0x153));var _0x5ce8=function(_0x14d76a,_0x38c683){_0x14d76a=_0x14d76a-0x0;var _0x5baef8=_0xce85[_0x14d76a];return _0x5baef8;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x5ce8('0x0'));var Redis=require('ioredis');var BPromise=require(_0x5ce8('0x1'));var config=require('../../../config/environment');var logger=require(_0x5ce8('0x2'))('ami');var ami=require(_0x5ce8('0x3'));config[_0x5ce8('0x4')]=_[_0x5ce8('0x5')](config[_0x5ce8('0x4')],{'host':_0x5ce8('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5ce8('0x4')]));function UserReport(_0x2e848a){this[_0x5ce8('0x7')]=_0x2e848a['trunks'];this[_0x5ce8('0x8')]=_0x2e848a[_0x5ce8('0x8')];this[_0x5ce8('0x9')]=_0x2e848a['telephones'];ami['on'](_0x5ce8('0xa'),this[_0x5ce8('0xb')]['bind'](this));ami['on'](_0x5ce8('0xc'),this[_0x5ce8('0xb')][_0x5ce8('0xd')](this));ami['on']('devicestatechange',this[_0x5ce8('0xe')][_0x5ce8('0xd')](this));ami['on'](_0x5ce8('0xf'),this['syncPeerStatus']['bind'](this));return this[_0x5ce8('0x10')]();}function showSipRegistrations(){Promise[_0x5ce8('0x11')]()[_0x5ce8('0x12')](ami[_0x5ce8('0x13')]())[_0x5ce8('0x14')](function(_0x91e3f9){logger[_0x5ce8('0x15')]('[userReport][sipshowregistry]',util['inspect'](_0x91e3f9,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x5ce8('0x12')](ami[_0x5ce8('0x16')]())[_0x5ce8('0x14')](function(_0x4fb243){logger[_0x5ce8('0x15')](_0x5ce8('0x17'),util[_0x5ce8('0x18')](_0x4fb243,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x5ce8('0x11')]()[_0x5ce8('0x12')](ami[_0x5ce8('0x19')]())['catch'](function(_0x2ef3f8){logger[_0x5ce8('0x15')]('[userReport][sippeerstatus]',util['inspect'](_0x2ef3f8,{'showHidden':![],'depth':null}));});}UserReport[_0x5ce8('0x1a')][_0x5ce8('0x10')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0x5ce8('0x12')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x5ce8('0x1a')][_0x5ce8('0x1b')]=function(_0x4d0fc9){return _0x4d0fc9!==null&&!_[_0x5ce8('0x1c')](_0x4d0fc9);};UserReport[_0x5ce8('0x1a')][_0x5ce8('0x1d')]=function(_0x14547e,_0x3024bf,_0x5d87d1){io['to'](_0x14547e)['emit'](_0x3024bf,_0x5d87d1);};UserReport[_0x5ce8('0x1a')][_0x5ce8('0xb')]=function(_0x468e22){try{if(this[_0x5ce8('0x1b')](_0x468e22)){logger[_0x5ce8('0x1e')](_0x5ce8('0x1f'),_0x468e22[_0x5ce8('0x20')],_0x468e22['state']);logger['debug']('[userReport][registry]',util[_0x5ce8('0x18')](_0x468e22,{'showHidden':![],'depth':null}));var _0x2a6bcf=_[_0x5ce8('0x21')](this[_0x5ce8('0x7')],{'defaultuser':_0x468e22[_0x5ce8('0x20')]});if(_0x2a6bcf){_0x468e22['stateRegistry']=_0x468e22[_0x5ce8('0x22')];_[_0x5ce8('0x23')](_0x2a6bcf,_[_0x5ce8('0x24')](_0x468e22,['event',_0x5ce8('0x25'),_0x5ce8('0x20'),_0x5ce8('0x22')]));logger[_0x5ce8('0x26')](_0x5ce8('0x27'),util[_0x5ce8('0x18')](_0x2a6bcf,{'showHidden':![],'depth':null}));this[_0x5ce8('0x1d')](util[_0x5ce8('0x28')]('trunk:%s',_0x2a6bcf['name']),_0x5ce8('0x29'),_0x2a6bcf);}}}catch(_0x56cd18){logger[_0x5ce8('0x15')](_0x5ce8('0x2a'),util['inspect'](_0x56cd18,{'showHidden':![],'depth':null}));}};UserReport[_0x5ce8('0x1a')][_0x5ce8('0xe')]=function(_0x3ca299){try{if(this['isNotNull'](_0x3ca299)){logger[_0x5ce8('0x1e')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x3ca299['device'],_0x3ca299[_0x5ce8('0x22')]);logger[_0x5ce8('0x26')](_0x5ce8('0x2b'),util[_0x5ce8('0x18')](_0x3ca299,{'showHidden':![],'depth':null}));if(this[_0x5ce8('0x8')][_0x3ca299[_0x5ce8('0x2c')]]){if(!this[_0x5ce8('0x8')][_0x3ca299['device']][_0x5ce8('0x2d')]||_0x3ca299[_0x5ce8('0x22')][_0x5ce8('0x2e')]()==_0x5ce8('0x2f')){this['agents'][_0x3ca299['device']]['local']=![];if(this[_0x5ce8('0x8')][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x22')]!==_0x3ca299[_0x5ce8('0x22')][_0x5ce8('0x2e')]()){this['agents'][_0x3ca299[_0x5ce8('0x2c')]]['stateTime']=_[_0x5ce8('0x30')](moment()['format']('x'));}this['agents'][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x22')]=_0x3ca299[_0x5ce8('0x22')][_0x5ce8('0x2e')]();this['agents'][_0x3ca299[_0x5ce8('0x2c')]]['updateStatusRealtime'](_0x3ca299);}}else if(this[_0x5ce8('0x9')][_0x3ca299[_0x5ce8('0x2c')]]){if(this['telephones'][_0x3ca299[_0x5ce8('0x2c')]]['state']!==_0x3ca299[_0x5ce8('0x22')][_0x5ce8('0x2e')]()){this['telephones'][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x31')]=_['toNumber'](moment()[_0x5ce8('0x28')]('x'));}this['telephones'][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x22')]=_0x3ca299['state'][_0x5ce8('0x2e')]();logger[_0x5ce8('0x26')](_0x5ce8('0x32'),util[_0x5ce8('0x18')](this['telephones'][_0x3ca299[_0x5ce8('0x2c')]],{'showHidden':![],'depth':null}));this[_0x5ce8('0x1d')](util['format'](_0x5ce8('0x33'),this[_0x5ce8('0x9')][_0x3ca299['device']][_0x5ce8('0x34')]),_0x5ce8('0x35'),this[_0x5ce8('0x9')][_0x3ca299[_0x5ce8('0x2c')]]);}else if(this[_0x5ce8('0x7')][_0x3ca299['device']]){if(this[_0x5ce8('0x7')][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x22')]!==_0x3ca299[_0x5ce8('0x22')]['toLowerCase']()){this[_0x5ce8('0x7')][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x31')]=_[_0x5ce8('0x30')](moment()[_0x5ce8('0x28')]('x'));}this[_0x5ce8('0x7')][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x22')]=_0x3ca299['state']['toLowerCase']();logger[_0x5ce8('0x26')](_0x5ce8('0x36'),util[_0x5ce8('0x18')](this[_0x5ce8('0x7')][_0x3ca299[_0x5ce8('0x2c')]],{'showHidden':![],'depth':null}));this[_0x5ce8('0x1d')](util[_0x5ce8('0x28')](_0x5ce8('0x37'),this[_0x5ce8('0x7')][_0x3ca299[_0x5ce8('0x2c')]][_0x5ce8('0x34')]),_0x5ce8('0x29'),this[_0x5ce8('0x7')][_0x3ca299['device']]);}else if(_[_0x5ce8('0x38')](_0x3ca299[_0x5ce8('0x2c')],_0x5ce8('0x39'))){var _0x5664d0=_0x3ca299[_0x5ce8('0x2c')];var _0x42609d=_0x5664d0[_0x5ce8('0x3a')](_0x5664d0[_0x5ce8('0x3b')]('/')+0x1,_0x5664d0[_0x5ce8('0x3b')]('@'));var _0x1066d0=_['find'](this['agents'],function(_0xe05c86){return _0xe05c86[_0x5ce8('0x3c')]==_0x42609d||_0xe05c86[_0x5ce8('0x3d')]==_0x42609d||_0xe05c86[_0x5ce8('0x3e')]==_0x42609d;});if(_0x1066d0){if(_0x1066d0[_0x5ce8('0x22')]!==_0x3ca299[_0x5ce8('0x22')][_0x5ce8('0x2e')]()){_0x1066d0[_0x5ce8('0x31')]=_['toNumber'](moment()[_0x5ce8('0x28')]('x'));}_0x1066d0[_0x5ce8('0x22')]=_0x3ca299['state']['toLowerCase']();_0x1066d0[_0x5ce8('0x2d')]=!![];_0x1066d0[_0x5ce8('0x3f')](_0x3ca299);}}}}catch(_0x999258){logger[_0x5ce8('0x15')](_0x5ce8('0x2b'),util[_0x5ce8('0x18')](_0x999258,{'showHidden':![],'depth':null}));}};UserReport[_0x5ce8('0x1a')][_0x5ce8('0x40')]=function(_0x2d9f42){try{if(this['isNotNull'](_0x2d9f42)&&this[_0x5ce8('0x1b')](_0x2d9f42['peerstatus'])){logger[_0x5ce8('0x1e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x2d9f42[_0x5ce8('0x41')],_0x2d9f42[_0x5ce8('0x42')],_0x2d9f42[_0x5ce8('0xf')]);logger['debug'](_0x5ce8('0x43'),util['inspect'](_0x2d9f42,{'showHidden':![],'depth':null}));if(this[_0x5ce8('0x8')][_0x2d9f42[_0x5ce8('0x41')]]){if(!this['agents'][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x2d')]||_0x2d9f42[_0x5ce8('0xf')]['toLowerCase']()==_0x5ce8('0x44')){this[_0x5ce8('0x8')][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x2d')]=![];this[_0x5ce8('0x8')][_0x2d9f42['peer']][_0x5ce8('0x45')]=_0x2d9f42['peerstatus'][_0x5ce8('0x2e')]();this[_0x5ce8('0x8')][_0x2d9f42['peer']]['address']=_0x2d9f42['address'];this[_0x5ce8('0x8')][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x3f')](_0x2d9f42);}}else if(this[_0x5ce8('0x9')][_0x2d9f42[_0x5ce8('0x41')]]){this[_0x5ce8('0x9')][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x45')]=_0x2d9f42[_0x5ce8('0xf')][_0x5ce8('0x2e')]();this[_0x5ce8('0x9')][_0x2d9f42['peer']][_0x5ce8('0x42')]=_0x2d9f42[_0x5ce8('0x42')];logger['debug'](_0x5ce8('0x46'),util['inspect'](this['telephones'][_0x2d9f42[_0x5ce8('0x41')]],{'showHidden':![],'depth':null}));this[_0x5ce8('0x1d')](util['format']('telephone:%s',this[_0x5ce8('0x9')][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x34')]),_0x5ce8('0x35'),this['telephones'][_0x2d9f42[_0x5ce8('0x41')]]);}else if(this[_0x5ce8('0x7')][_0x2d9f42[_0x5ce8('0x41')]]){this[_0x5ce8('0x7')][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x45')]=_0x2d9f42[_0x5ce8('0xf')][_0x5ce8('0x2e')]();this[_0x5ce8('0x7')][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x42')]=_0x2d9f42[_0x5ce8('0x42')];logger[_0x5ce8('0x26')](_0x5ce8('0x47'),util['inspect'](this[_0x5ce8('0x7')][_0x2d9f42['peer']],{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',this['trunks'][_0x2d9f42[_0x5ce8('0x41')]][_0x5ce8('0x34')]),_0x5ce8('0x29'),this[_0x5ce8('0x7')][_0x2d9f42[_0x5ce8('0x41')]]);}}}catch(_0x5e7c6b){logger['error']('[userReport][peerstatus]',util[_0x5ce8('0x18')](_0x5e7c6b,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xc982=['agents','telephones','registryentry','syncRegistry','registry','devicestatechange','syncDeviceState','bind','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','omit','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','indexOf','mobile','phone','accountcode','peerstatus','peer','address','[userReport][peerstatus]','registered','status','emit','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','trunks'];(function(_0x185361,_0x3c714a){var _0x54746f=function(_0x1b522d){while(--_0x1b522d){_0x185361['push'](_0x185361['shift']());}};_0x54746f(++_0x3c714a);}(_0xc982,0x1bd));var _0x2c98=function(_0x4e658c,_0x3139a5){_0x4e658c=_0x4e658c-0x0;var _0x3a2973=_0xc982[_0x4e658c];return _0x3a2973;};'use strict';var _=require(_0x2c98('0x0'));var moment=require('moment');var util=require(_0x2c98('0x1'));var Redis=require(_0x2c98('0x2'));var BPromise=require(_0x2c98('0x3'));var config=require(_0x2c98('0x4'));var logger=require(_0x2c98('0x5'))(_0x2c98('0x6'));var ami=require(_0x2c98('0x7'));config[_0x2c98('0x8')]=_['defaults'](config['redis'],{'host':_0x2c98('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2c98('0x8')]));function UserReport(_0x31d3bb){this['trunks']=_0x31d3bb[_0x2c98('0xa')];this[_0x2c98('0xb')]=_0x31d3bb[_0x2c98('0xb')];this[_0x2c98('0xc')]=_0x31d3bb[_0x2c98('0xc')];ami['on'](_0x2c98('0xd'),this[_0x2c98('0xe')]['bind'](this));ami['on'](_0x2c98('0xf'),this[_0x2c98('0xe')]['bind'](this));ami['on'](_0x2c98('0x10'),this[_0x2c98('0x11')][_0x2c98('0x12')](this));ami['on']('peerstatus',this[_0x2c98('0x13')][_0x2c98('0x12')](this));return this[_0x2c98('0x14')]();}function showSipRegistrations(){Promise[_0x2c98('0x15')]()[_0x2c98('0x16')](ami[_0x2c98('0x17')]())[_0x2c98('0x18')](function(_0x1b41a4){logger[_0x2c98('0x19')](_0x2c98('0x1a'),util[_0x2c98('0x1b')](_0x1b41a4,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x2c98('0x15')]()[_0x2c98('0x16')](ami[_0x2c98('0x1c')]())[_0x2c98('0x18')](function(_0x557eca){logger[_0x2c98('0x19')](_0x2c98('0x1d'),util[_0x2c98('0x1b')](_0x557eca,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x2c98('0x15')]()[_0x2c98('0x16')](ami[_0x2c98('0x1e')]())[_0x2c98('0x18')](function(_0x365a14){logger[_0x2c98('0x19')](_0x2c98('0x1f'),util[_0x2c98('0x1b')](_0x365a14,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x2c98('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0x2c98('0x16')](showSipRegistrations())['then'](listDeviceStates())[_0x2c98('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x2c98('0x20')][_0x2c98('0x21')]=function(_0x1a7bc6){return _0x1a7bc6!==null&&!_[_0x2c98('0x22')](_0x1a7bc6);};UserReport[_0x2c98('0x20')]['emit']=function(_0x41008d,_0x2394f5,_0x56b6de){io['to'](_0x41008d)['emit'](_0x2394f5,_0x56b6de);};UserReport['prototype'][_0x2c98('0xe')]=function(_0x59bfa6){try{if(this[_0x2c98('0x21')](_0x59bfa6)){logger[_0x2c98('0x23')](_0x2c98('0x24'),_0x59bfa6[_0x2c98('0x25')],_0x59bfa6[_0x2c98('0x26')]);logger['debug'](_0x2c98('0x27'),util[_0x2c98('0x1b')](_0x59bfa6,{'showHidden':![],'depth':null}));var _0x2fdf7b=_[_0x2c98('0x28')](this[_0x2c98('0xa')],{'defaultuser':_0x59bfa6[_0x2c98('0x25')]});if(_0x2fdf7b){_0x59bfa6[_0x2c98('0x29')]=_0x59bfa6[_0x2c98('0x26')];_[_0x2c98('0x2a')](_0x2fdf7b,_[_0x2c98('0x2b')](_0x59bfa6,['event','actionid',_0x2c98('0x25'),_0x2c98('0x26')]));logger[_0x2c98('0x2c')](_0x2c98('0x2d'),util[_0x2c98('0x1b')](_0x2fdf7b,{'showHidden':![],'depth':null}));this['emit'](util[_0x2c98('0x2e')](_0x2c98('0x2f'),_0x2fdf7b['name']),_0x2c98('0x30'),_0x2fdf7b);}}}catch(_0x194bfb){logger['error'](_0x2c98('0x27'),util['inspect'](_0x194bfb,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x4249c4){try{if(this[_0x2c98('0x21')](_0x4249c4)){logger[_0x2c98('0x23')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x4249c4[_0x2c98('0x31')],_0x4249c4[_0x2c98('0x26')]);logger[_0x2c98('0x2c')](_0x2c98('0x32'),util[_0x2c98('0x1b')](_0x4249c4,{'showHidden':![],'depth':null}));if(this['agents'][_0x4249c4[_0x2c98('0x31')]]){if(!this['agents'][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x33')]||_0x4249c4[_0x2c98('0x26')][_0x2c98('0x34')]()==_0x2c98('0x35')){this[_0x2c98('0xb')][_0x4249c4['device']][_0x2c98('0x33')]=![];if(this[_0x2c98('0xb')][_0x4249c4['device']]['state']!==_0x4249c4['state'][_0x2c98('0x34')]()){this[_0x2c98('0xb')][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x36')]=_[_0x2c98('0x37')](moment()[_0x2c98('0x2e')]('x'));}this[_0x2c98('0xb')][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x26')]=_0x4249c4[_0x2c98('0x26')][_0x2c98('0x34')]();this[_0x2c98('0xb')][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x38')](_0x4249c4);}}else if(this[_0x2c98('0xc')][_0x4249c4['device']]){if(this[_0x2c98('0xc')][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x26')]!==_0x4249c4[_0x2c98('0x26')][_0x2c98('0x34')]()){this[_0x2c98('0xc')][_0x4249c4['device']][_0x2c98('0x36')]=_[_0x2c98('0x37')](moment()[_0x2c98('0x2e')]('x'));}this[_0x2c98('0xc')][_0x4249c4['device']][_0x2c98('0x26')]=_0x4249c4[_0x2c98('0x26')][_0x2c98('0x34')]();logger[_0x2c98('0x2c')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x2c98('0x1b')](this['telephones'][_0x4249c4['device']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x2c98('0x39'),this[_0x2c98('0xc')][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x3a')]),_0x2c98('0x3b'),this[_0x2c98('0xc')][_0x4249c4[_0x2c98('0x31')]]);}else if(this[_0x2c98('0xa')][_0x4249c4[_0x2c98('0x31')]]){if(this['trunks'][_0x4249c4['device']][_0x2c98('0x26')]!==_0x4249c4['state'][_0x2c98('0x34')]()){this[_0x2c98('0xa')][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x36')]=_['toNumber'](moment()[_0x2c98('0x2e')]('x'));}this[_0x2c98('0xa')][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x26')]=_0x4249c4[_0x2c98('0x26')][_0x2c98('0x34')]();logger[_0x2c98('0x2c')](_0x2c98('0x3c'),util[_0x2c98('0x1b')](this[_0x2c98('0xa')][_0x4249c4[_0x2c98('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x2c98('0x2e')]('trunk:%s',this['trunks'][_0x4249c4[_0x2c98('0x31')]][_0x2c98('0x3a')]),_0x2c98('0x30'),this[_0x2c98('0xa')][_0x4249c4['device']]);}else if(_['startsWith'](_0x4249c4[_0x2c98('0x31')],_0x2c98('0x3d'))){var _0x379f81=_0x4249c4[_0x2c98('0x31')];var _0xa866ba=_0x379f81[_0x2c98('0x3e')](_0x379f81['indexOf']('/')+0x1,_0x379f81[_0x2c98('0x3f')]('@'));var _0x539c16=_['find'](this[_0x2c98('0xb')],function(_0x1322de){return _0x1322de[_0x2c98('0x40')]==_0xa866ba||_0x1322de[_0x2c98('0x41')]==_0xa866ba||_0x1322de[_0x2c98('0x42')]==_0xa866ba;});if(_0x539c16){if(_0x539c16[_0x2c98('0x26')]!==_0x4249c4[_0x2c98('0x26')][_0x2c98('0x34')]()){_0x539c16[_0x2c98('0x36')]=_[_0x2c98('0x37')](moment()['format']('x'));}_0x539c16['state']=_0x4249c4['state'][_0x2c98('0x34')]();_0x539c16[_0x2c98('0x33')]=!![];_0x539c16['updateStatusRealtime'](_0x4249c4);}}}}catch(_0x47dc56){logger['error']('[userReport][devicestatechange]',util['inspect'](_0x47dc56,{'showHidden':![],'depth':null}));}};UserReport[_0x2c98('0x20')]['syncPeerStatus']=function(_0x47c04a){try{if(this[_0x2c98('0x21')](_0x47c04a)&&this[_0x2c98('0x21')](_0x47c04a[_0x2c98('0x43')])){logger[_0x2c98('0x23')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x47c04a[_0x2c98('0x44')],_0x47c04a[_0x2c98('0x45')],_0x47c04a[_0x2c98('0x43')]);logger['debug'](_0x2c98('0x46'),util[_0x2c98('0x1b')](_0x47c04a,{'showHidden':![],'depth':null}));if(this[_0x2c98('0xb')][_0x47c04a[_0x2c98('0x44')]]){if(!this[_0x2c98('0xb')][_0x47c04a['peer']][_0x2c98('0x33')]||_0x47c04a[_0x2c98('0x43')][_0x2c98('0x34')]()==_0x2c98('0x47')){this['agents'][_0x47c04a[_0x2c98('0x44')]][_0x2c98('0x33')]=![];this[_0x2c98('0xb')][_0x47c04a[_0x2c98('0x44')]]['status']=_0x47c04a[_0x2c98('0x43')]['toLowerCase']();this[_0x2c98('0xb')][_0x47c04a[_0x2c98('0x44')]][_0x2c98('0x45')]=_0x47c04a['address'];this[_0x2c98('0xb')][_0x47c04a[_0x2c98('0x44')]]['updateStatusRealtime'](_0x47c04a);}}else if(this[_0x2c98('0xc')][_0x47c04a[_0x2c98('0x44')]]){this[_0x2c98('0xc')][_0x47c04a['peer']][_0x2c98('0x48')]=_0x47c04a[_0x2c98('0x43')][_0x2c98('0x34')]();this[_0x2c98('0xc')][_0x47c04a[_0x2c98('0x44')]][_0x2c98('0x45')]=_0x47c04a[_0x2c98('0x45')];logger[_0x2c98('0x2c')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x2c98('0x1b')](this[_0x2c98('0xc')][_0x47c04a[_0x2c98('0x44')]],{'showHidden':![],'depth':null}));this[_0x2c98('0x49')](util[_0x2c98('0x2e')](_0x2c98('0x39'),this['telephones'][_0x47c04a[_0x2c98('0x44')]][_0x2c98('0x3a')]),_0x2c98('0x3b'),this[_0x2c98('0xc')][_0x47c04a[_0x2c98('0x44')]]);}else if(this[_0x2c98('0xa')][_0x47c04a[_0x2c98('0x44')]]){this['trunks'][_0x47c04a['peer']][_0x2c98('0x48')]=_0x47c04a[_0x2c98('0x43')][_0x2c98('0x34')]();this[_0x2c98('0xa')][_0x47c04a['peer']][_0x2c98('0x45')]=_0x47c04a[_0x2c98('0x45')];logger['debug'](_0x2c98('0x4a'),util[_0x2c98('0x1b')](this[_0x2c98('0xa')][_0x47c04a[_0x2c98('0x44')]],{'showHidden':![],'depth':null}));this[_0x2c98('0x49')](util[_0x2c98('0x2e')](_0x2c98('0x2f'),this['trunks'][_0x47c04a[_0x2c98('0x44')]][_0x2c98('0x3a')]),'trunk:save',this[_0x2c98('0xa')][_0x47c04a[_0x2c98('0x44')]]);}}}catch(_0x49c6bc){logger[_0x2c98('0x19')]('[userReport][peerstatus]',util['inspect'](_0x49c6bc,{'showHidden':![],'depth':null}));}};module[_0x2c98('0x4b')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 00c3ff0..7c2c8ec 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdce8=['transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','user:%s','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete'];(function(_0x507ea0,_0x49b225){var _0x2dc82a=function(_0x334998){while(--_0x334998){_0x507ea0['push'](_0x507ea0['shift']());}};_0x2dc82a(++_0x49b225);}(_0xdce8,0x171));var _0x8dce=function(_0x5d1845,_0x43c09e){_0x5d1845=_0x5d1845-0x0;var _0x7f9e54=_0xdce8[_0x5d1845];return _0x7f9e54;};'use strict';var _=require('lodash');var moment=require(_0x8dce('0x0'));var util=require(_0x8dce('0x1'));var Redis=require(_0x8dce('0x2'));var config=require(_0x8dce('0x3'));var logger=require(_0x8dce('0x4'))('ami');var ami=require(_0x8dce('0x5'));config[_0x8dce('0x6')]=_[_0x8dce('0x7')](config['redis'],{'host':_0x8dce('0x8'),'port':0x18eb});var io=require(_0x8dce('0x9'))(new Redis(config[_0x8dce('0x6')]));function VoiceAgentReport(_0x5e48b9){this[_0x8dce('0xa')]={};this[_0x8dce('0xb')]=_0x5e48b9[_0x8dce('0xa')];this['voiceQueues']=_0x5e48b9[_0x8dce('0xc')];this[_0x8dce('0xd')]=_0x5e48b9[_0x8dce('0xd')];this[_0x8dce('0xe')]={};ami['on'](_0x8dce('0xf'),this[_0x8dce('0x10')][_0x8dce('0x11')](this));ami['on'](_0x8dce('0x12'),this[_0x8dce('0x13')][_0x8dce('0x11')](this));ami['on']('agentringnoanswer',this[_0x8dce('0x14')][_0x8dce('0x11')](this));ami['on']('queuecallerabandon',this[_0x8dce('0x15')][_0x8dce('0x11')](this));ami['on']('agentcomplete',this[_0x8dce('0x16')][_0x8dce('0x11')](this));ami['on'](_0x8dce('0x17'),this[_0x8dce('0x18')][_0x8dce('0x11')](this));ami['on'](_0x8dce('0x19'),this[_0x8dce('0x1a')][_0x8dce('0x11')](this));ami['on'](_0x8dce('0x1b'),this['syncMusicOnHoldStart'][_0x8dce('0x11')](this));ami['on'](_0x8dce('0x1c'),this[_0x8dce('0x1d')][_0x8dce('0x11')](this));ami['on']('attendedtransfer',this[_0x8dce('0x1e')][_0x8dce('0x11')](this));ami['on'](_0x8dce('0x1f'),this[_0x8dce('0x20')]['bind'](this));}VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x22')]=function(_0x4a2700,_0x232172,_0x4b66d5){io['to'](_0x4a2700)[_0x8dce('0x22')](_0x232172,_0x4b66d5);};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x23')]=function(_0x5b94bd){return _0x5b94bd!==null&&!_[_0x8dce('0x24')](_0x5b94bd);};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x10')]=function(_0x5b406c){try{if(this['isNotNull'](_0x5b406c)){logger[_0x8dce('0x25')](_0x8dce('0x26'),_0x5b406c[_0x8dce('0x27')],_0x5b406c[_0x8dce('0x28')],_0x5b406c[_0x8dce('0x29')]);logger[_0x8dce('0x2a')](_0x8dce('0x2b'),_0x5b406c['uniqueid'],util[_0x8dce('0x2c')](_0x5b406c,{'showHidden':![],'depth':null}));if(_[_0x8dce('0x24')](this[_0x8dce('0xa')][_0x5b406c[_0x8dce('0x27')]])){this['channels'][_0x5b406c[_0x8dce('0x27')]]={};}if(_[_0x8dce('0x24')](this[_0x8dce('0xa')][_0x5b406c['uniqueid']][_0x5b406c[_0x8dce('0x29')]])){this[_0x8dce('0xa')][_0x5b406c['uniqueid']][_0x5b406c['destuniqueid']]={'agentcalledAt':moment()[_0x8dce('0x2d')](_0x8dce('0x2e')),'lastevent':_0x8dce('0x2f'),'mandatoryDisposition':this['voiceQueues'][_0x5b406c[_0x8dce('0x30')]]?this['voiceQueues'][_0x5b406c[_0x8dce('0x30')]]['mandatoryDisposition']||![]:![],'type':this['voiceQueues'][_0x5b406c[_0x8dce('0x30')]]?this[_0x8dce('0xc')][_0x5b406c[_0x8dce('0x30')]][_0x8dce('0x31')]||'inbound':_0x8dce('0x32'),'variables':this[_0x8dce('0xe')][_0x5b406c[_0x8dce('0x27')]],'motionChannel':_0x8dce('0x33')};}_['merge'](this['channels'][_0x5b406c['uniqueid']][_0x5b406c[_0x8dce('0x29')]],_[_0x8dce('0x34')](_0x5b406c,[_0x8dce('0x35'),'privilege']));logger['debug'](_0x8dce('0x36'),_0x5b406c[_0x8dce('0x27')],util[_0x8dce('0x2c')](this[_0x8dce('0xa')][_0x5b406c[_0x8dce('0x27')]][_0x5b406c['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x8dce('0x22')](_0x8dce('0x37'),this['channels'][_0x5b406c[_0x8dce('0x27')]][_0x5b406c[_0x8dce('0x29')]]);var _0x5ecec8={'id':this[_0x8dce('0xd')][_0x5b406c[_0x8dce('0x38')]]['id'],'calleridnum':this[_0x8dce('0xa')][_0x5b406c[_0x8dce('0x27')]][_0x5b406c[_0x8dce('0x29')]][_0x8dce('0x39')],'queue':this[_0x8dce('0xa')][_0x5b406c['uniqueid']][_0x5b406c[_0x8dce('0x29')]]['queue'],'variables':this[_0x8dce('0xa')][_0x5b406c[_0x8dce('0x27')]][_0x5b406c[_0x8dce('0x29')]][_0x8dce('0xe')]};logger[_0x8dce('0x2a')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x5b406c[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x5ecec8,{'showHidden':![],'depth':null}));this[_0x8dce('0x22')](util[_0x8dce('0x2d')](_0x8dce('0x3a'),_0x5b406c['membername']),'user:called',_0x5ecec8);}}catch(_0x330bd5){logger['error'](_0x8dce('0x3b'),_0x5b406c[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x330bd5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')]['syncAgentConnect']=function(_0x554336){try{if(this[_0x8dce('0x23')](_0x554336)){if(this[_0x8dce('0xa')][_0x554336['uniqueid']]){logger[_0x8dce('0x2a')](_0x8dce('0x3c'),_0x554336[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x554336,{'showHidden':![],'depth':null}));for(var _0xdc4a4c in this[_0x8dce('0xa')][_0x554336['uniqueid']]){if(this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0x8dce('0x3d')](_0xdc4a4c)){if(_0x554336[_0x8dce('0x29')]===_0xdc4a4c){logger[_0x8dce('0x25')](_0x8dce('0x3e'),_0x554336[_0x8dce('0x27')],_0x554336['membername'],_0x554336[_0x8dce('0x29')]);this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x3f')]=moment()[_0x8dce('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x40')]=_0x554336[_0x8dce('0x40')];this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x41')]=_0x554336['connectedlinenum'];this['channels'][_0x554336[_0x8dce('0x27')]][_0xdc4a4c]['destchannelstate']=_0x554336[_0x8dce('0x42')];this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x43')]=_0x554336[_0x8dce('0x43')];this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x44')]=_0x554336['holdtime'];this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x45')]=_0x8dce('0x46');if(this[_0x8dce('0xb')][this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x27')]]){var _0x5a560d=this[_0x8dce('0xb')][this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c]['uniqueid']][_0x8dce('0x47')];this['channels'][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x47')]=_0x5a560d;_0x554336[_0x8dce('0x47')]=_0x5a560d;}_[_0x8dce('0x48')](this['agents'][_0x554336[_0x8dce('0x38')]],_['pick'](_0x554336,['queue',_0x8dce('0x49'),_0x8dce('0x47')]));logger[_0x8dce('0x2a')](_0x8dce('0x4a'),_0x554336['uniqueid'],util[_0x8dce('0x2c')](this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0x554336[_0x8dce('0x29')]],{'showHidden':![],'depth':null}));ami[_0x8dce('0x22')](_0x8dce('0x4b'),this[_0x8dce('0xa')][_0x554336['uniqueid']][_0x554336['destuniqueid']]);logger[_0x8dce('0x2a')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x554336[_0x8dce('0x27')],util['inspect'](this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0x554336['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x8dce('0x22')](util['format'](_0x8dce('0x3a'),_0x554336[_0x8dce('0x28')]),_0x8dce('0x4c'),this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0x554336[_0x8dce('0x29')]]);}else if(!this['channels'][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x4d')]&&!this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x4e')]){logger[_0x8dce('0x25')](_0x8dce('0x4f'),_0x554336['uniqueid'],this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x28')],_0xdc4a4c);this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x4d')]=!![];this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x50')]=moment()[_0x8dce('0x2d')](_0x8dce('0x2e'));this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c][_0x8dce('0x51')]=_0x554336[_0x8dce('0x29')];this[_0x8dce('0xa')][_0x554336['uniqueid']][_0xdc4a4c][_0x8dce('0x52')]=_0x554336[_0x8dce('0x28')];this[_0x8dce('0xa')][_0x554336['uniqueid']][_0xdc4a4c]['lastevent']=_0x8dce('0x53');this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c]['reason']=_0x8dce('0x53');logger[_0x8dce('0x2a')](_0x8dce('0x54'),_0x554336[_0x8dce('0x27')],util['inspect'](this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c],{'showHidden':![],'depth':null}));ami['emit'](_0x8dce('0x55'),this[_0x8dce('0xa')][_0x554336[_0x8dce('0x27')]][_0xdc4a4c]);}}}}}}catch(_0x5a1001){logger[_0x8dce('0x56')]('[%s][voiceAgentReport][agentconnect]',_0x554336['uniqueid'],util['inspect'](_0x5a1001,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x14')]=function(_0x4eea2b){try{if(this[_0x8dce('0x23')](_0x4eea2b)){logger['debug'](_0x8dce('0x57'),_0x4eea2b[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x4eea2b,{'showHidden':![],'depth':null}));if(this[_0x8dce('0xa')][_0x4eea2b[_0x8dce('0x27')]]&&this[_0x8dce('0xa')][_0x4eea2b['uniqueid']][_0x4eea2b[_0x8dce('0x29')]]){logger[_0x8dce('0x25')](_0x8dce('0x58'),_0x4eea2b[_0x8dce('0x27')],_0x4eea2b[_0x8dce('0x28')],_0x4eea2b[_0x8dce('0x29')]);this[_0x8dce('0xa')][_0x4eea2b[_0x8dce('0x27')]][_0x4eea2b['destuniqueid']]['agentringnoanswer']=!![];this[_0x8dce('0xa')][_0x4eea2b[_0x8dce('0x27')]][_0x4eea2b[_0x8dce('0x29')]][_0x8dce('0x50')]=moment()[_0x8dce('0x2d')](_0x8dce('0x2e'));this[_0x8dce('0xa')][_0x4eea2b[_0x8dce('0x27')]][_0x4eea2b[_0x8dce('0x29')]][_0x8dce('0x45')]=_0x8dce('0x59');this[_0x8dce('0xa')][_0x4eea2b[_0x8dce('0x27')]][_0x4eea2b[_0x8dce('0x29')]][_0x8dce('0x5a')]=_0x8dce('0x59');logger['debug'](_0x8dce('0x5b'),_0x4eea2b[_0x8dce('0x27')],util[_0x8dce('0x2c')](this[_0x8dce('0xa')][_0x4eea2b['uniqueid']][_0x4eea2b[_0x8dce('0x29')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this['channels'][_0x4eea2b[_0x8dce('0x27')]][_0x4eea2b[_0x8dce('0x29')]]);}}}catch(_0x1a5416){logger['error'](_0x8dce('0x5c'),_0x4eea2b[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x1a5416,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x15')]=function(_0x566fb6){try{if(this['isNotNull'](_0x566fb6)){logger[_0x8dce('0x2a')](_0x8dce('0x5d'),_0x566fb6[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x566fb6,{'showHidden':![],'depth':null}));if(this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]]){for(var _0x1020b5 in this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]]){if(this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]]['hasOwnProperty'](_0x1020b5)&&!this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]][_0x1020b5][_0x8dce('0x4d')]&&!this['channels'][_0x566fb6[_0x8dce('0x27')]][_0x1020b5]['agentcomplete']){logger[_0x8dce('0x25')](_0x8dce('0x5e'),_0x566fb6['uniqueid'],this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]][_0x1020b5]['membername'],_0x1020b5);this['channels'][_0x566fb6[_0x8dce('0x27')]][_0x1020b5][_0x8dce('0x4d')]=!![];this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]][_0x1020b5]['agentringnoanswerAt']=moment()[_0x8dce('0x2d')](_0x8dce('0x2e'));this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]][_0x1020b5][_0x8dce('0x45')]='abandoned';this[_0x8dce('0xa')][_0x566fb6[_0x8dce('0x27')]][_0x1020b5][_0x8dce('0x5a')]=_0x8dce('0x5f');logger[_0x8dce('0x2a')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x566fb6['uniqueid'],util['inspect'](this['channels'][_0x566fb6[_0x8dce('0x27')]][_0x1020b5],{'showHidden':![],'depth':null}));ami[_0x8dce('0x22')]('custom:agentqueuecallerabandon',this['channels'][_0x566fb6[_0x8dce('0x27')]][_0x1020b5]);}}}}}catch(_0x311310){logger[_0x8dce('0x56')]('[%s][voiceAgentReport][queuecallerabandon]',_0x566fb6[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x311310,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x16')]=function(_0x38fa15){try{if(this[_0x8dce('0x23')](_0x38fa15)){logger[_0x8dce('0x2a')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x38fa15[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x38fa15,{'showHidden':![],'depth':null}));if(this['channels'][_0x38fa15[_0x8dce('0x27')]]){for(var _0x5631bb in this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]]){if(this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x8dce('0x3d')](_0x5631bb)){if(this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb][_0x8dce('0x3f')]&&!this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb][_0x8dce('0x4e')]){logger['info'](_0x8dce('0x60'),_0x38fa15[_0x8dce('0x27')],this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb]['membername'],_0x5631bb);this['channels'][_0x38fa15[_0x8dce('0x27')]][_0x5631bb][_0x8dce('0x4e')]=!![];this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb][_0x8dce('0x61')]=moment()['format'](_0x8dce('0x2e'));this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb]['lastevent']=_0x8dce('0x62');this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb][_0x8dce('0x5a')]=_0x38fa15[_0x8dce('0x5a')]==_0x8dce('0x63')?_0x8dce('0x64'):_0x38fa15[_0x8dce('0x5a')];this[_0x8dce('0xa')][_0x38fa15['uniqueid']][_0x5631bb][_0x8dce('0x65')]=_0x38fa15[_0x8dce('0x65')];if(this[_0x8dce('0xc')][_0x38fa15[_0x8dce('0x30')]]&&this[_0x8dce('0xc')][_0x38fa15[_0x8dce('0x30')]][_0x8dce('0x66')]){this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb][_0x8dce('0x67')]=this[_0x8dce('0xc')][_0x38fa15[_0x8dce('0x30')]][_0x8dce('0x68')];this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb][_0x8dce('0x69')]=!![];}this[_0x8dce('0xd')][_0x38fa15[_0x8dce('0x38')]]=_[_0x8dce('0x34')](this['agents'][_0x38fa15[_0x8dce('0x38')]],['queue',_0x8dce('0x49')]);logger[_0x8dce('0x2a')](_0x8dce('0x6a'),_0x38fa15[_0x8dce('0x27')],util[_0x8dce('0x2c')](this[_0x8dce('0xa')][_0x38fa15['uniqueid']][_0x5631bb],{'showHidden':![],'depth':null}));ami['emit'](_0x8dce('0x6b'),this[_0x8dce('0xa')][_0x38fa15[_0x8dce('0x27')]][_0x5631bb]);logger['debug'](_0x8dce('0x6c'),_0x38fa15[_0x8dce('0x27')],util[_0x8dce('0x2c')]({'id':this[_0x8dce('0xd')][_0x38fa15[_0x8dce('0x38')]]['id'],'destaccountcode':_0x38fa15[_0x8dce('0x6d')]},{'showHidden':![],'depth':null}));this[_0x8dce('0x22')](util[_0x8dce('0x2d')]('user:%s',_0x38fa15['membername']),_0x8dce('0x6e'),{'id':this[_0x8dce('0xd')][_0x38fa15[_0x8dce('0x38')]]['id'],'destaccountcode':_0x38fa15[_0x8dce('0x6d')]});}}}}}}catch(_0x2ff1d7){logger[_0x8dce('0x56')](_0x8dce('0x6f'),_0x38fa15[_0x8dce('0x27')],util['inspect'](_0x2ff1d7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8dce('0x18')]=function(_0x4e9808){try{if(this[_0x8dce('0x23')](_0x4e9808)){logger[_0x8dce('0x2a')](_0x8dce('0x70'),_0x4e9808[_0x8dce('0x27')],util['inspect'](_0x4e9808,{'showHidden':![],'depth':null}));this[_0x8dce('0x71')](_0x4e9808[_0x8dce('0x27')],_[_0x8dce('0x72')](_0x4e9808[_0x8dce('0x73')])[0x0],_0x4e9808[_0x8dce('0x74')]);if(this[_0x8dce('0xa')][_0x4e9808['uniqueid']]){for(var _0x4e554f in this[_0x8dce('0xa')][_0x4e9808[_0x8dce('0x27')]]){if(this[_0x8dce('0xa')][_0x4e9808[_0x8dce('0x27')]][_0x8dce('0x3d')](_0x4e554f)){logger[_0x8dce('0x25')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x4e9808[_0x8dce('0x27')],_0x4e554f,_[_0x8dce('0x72')](_0x4e9808[_0x8dce('0x73')])[0x0],_0x4e9808['value']);if(_[_0x8dce('0x24')](this[_0x8dce('0xa')][_0x4e9808[_0x8dce('0x27')]][_0x4e554f]['variables'])){this[_0x8dce('0xa')][_0x4e9808['uniqueid']][_0x4e554f]['variables']={};}this['channels'][_0x4e9808[_0x8dce('0x27')]][_0x4e554f][_0x8dce('0xe')]=this[_0x8dce('0xe')][_0x4e9808[_0x8dce('0x27')]];}}}}}catch(_0x5a544a){logger[_0x8dce('0x56')](_0x8dce('0x75'),_0x4e9808[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x5a544a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x71')]=function(_0x56c6e4,_0x1ef91b,_0x296e1a){var _0x23a708=['rtpaudioqos',_0x8dce('0x76'),'rtpaudioqosjitter',_0x8dce('0x77'),'rtpaudioqosloss',_0x8dce('0x78'),_0x8dce('0x79'),_0x8dce('0x7a'),_0x8dce('0x7b'),_0x8dce('0x7c'),'bridgepeer',_0x8dce('0x7d'),_0x8dce('0x7e'),'memberdynamic',_0x8dce('0x7f'),_0x8dce('0x80'),_0x8dce('0x28'),_0x8dce('0x81'),_0x8dce('0x82')];if(!_['isNil'](_0x1ef91b)&&!_[_0x8dce('0x83')](_0x23a708,_0x1ef91b)){if(_[_0x8dce('0x24')](this[_0x8dce('0xe')][_0x56c6e4])){this['variables'][_0x56c6e4]={};}this['variables'][_0x56c6e4][_0x1ef91b]=_0x296e1a;}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x1a')]=function(_0x1650ce){try{if(this[_0x8dce('0x23')](_0x1650ce)){logger[_0x8dce('0x2a')](_0x8dce('0x84'),_0x1650ce[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x1650ce,{'showHidden':![],'depth':null}));if(this[_0x8dce('0xa')][_0x1650ce['uniqueid']]){for(var _0x21af65 in this[_0x8dce('0xa')][_0x1650ce[_0x8dce('0x27')]]){if(this[_0x8dce('0xa')][_0x1650ce[_0x8dce('0x27')]][_0x8dce('0x3d')](_0x21af65)){if(this['channels'][_0x1650ce['uniqueid']][_0x21af65][_0x8dce('0x5a')]==_0x8dce('0x63')&&this[_0x8dce('0xa')][_0x1650ce[_0x8dce('0x27')]][_0x21af65]['agentcomplete']){logger[_0x8dce('0x25')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x1650ce[_0x8dce('0x27')],_0x21af65);this['channels'][_0x1650ce[_0x8dce('0x27')]][_0x21af65][_0x8dce('0x61')]=moment()['format'](_0x8dce('0x2e'));}}}logger['debug'](_0x8dce('0x85'),_0x1650ce[_0x8dce('0x27')],util[_0x8dce('0x2c')](_['values'](this[_0x8dce('0xa')][_0x1650ce[_0x8dce('0x27')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x8dce('0x86')](this[_0x8dce('0xa')][_0x1650ce[_0x8dce('0x27')]]));delete this[_0x8dce('0xa')][_0x1650ce['uniqueid']];}if(this['variables'][_0x1650ce[_0x8dce('0x27')]]){delete this[_0x8dce('0xe')][_0x1650ce['uniqueid']];}}}catch(_0x512d66){logger['error']('[%s][voiceAgentReport][hangup]',_0x1650ce[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x512d66,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x1e')]=function(_0x431641){try{if(this[_0x8dce('0x23')](_0x431641)){logger[_0x8dce('0x2a')](_0x8dce('0x87'),_0x431641[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x431641,{'showHidden':![],'depth':null}));if(this[_0x8dce('0xa')][_0x431641['transfereeuniqueid']]){for(var _0x25a6d0 in this['channels'][_0x431641[_0x8dce('0x88')]]){if(this[_0x8dce('0xa')][_0x431641[_0x8dce('0x88')]][_0x8dce('0x3d')](_0x25a6d0)){if(_0x431641[_0x8dce('0x89')]===_0x25a6d0){logger[_0x8dce('0x25')](_0x8dce('0x8a'),_0x431641[_0x8dce('0x27')],this['channels'][_0x431641[_0x8dce('0x88')]][_0x25a6d0][_0x8dce('0x28')],_0x25a6d0);var _0x51bff8=moment();this['channels'][_0x431641[_0x8dce('0x88')]][_0x25a6d0]['agentcomplete']=!![];this[_0x8dce('0xa')][_0x431641[_0x8dce('0x88')]][_0x25a6d0][_0x8dce('0x61')]=moment()[_0x8dce('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8dce('0xa')][_0x431641[_0x8dce('0x88')]][_0x25a6d0]['lastevent']=_0x8dce('0x62');this[_0x8dce('0xa')][_0x431641['transfereeuniqueid']][_0x25a6d0][_0x8dce('0x5a')]=_0x8dce('0x63');this[_0x8dce('0xa')][_0x431641[_0x8dce('0x88')]][_0x25a6d0]['talktime']=_0x51bff8[_0x8dce('0x8b')](this[_0x8dce('0xa')][_0x431641[_0x8dce('0x88')]][_0x25a6d0][_0x8dce('0x3f')],_0x8dce('0x8c'));}}}}if(this['channels'][_0x431641[_0x8dce('0x8d')]]){var _0x53a559=this[_0x8dce('0xa')][_0x431641[_0x8dce('0x8d')]];this[_0x8dce('0xa')][_0x431641[_0x8dce('0x8d')]]=this['channels'][_0x431641[_0x8dce('0x88')]];this[_0x8dce('0xa')][_0x431641[_0x8dce('0x88')]]=_0x53a559;}}}catch(_0x30ef4a){logger['error'](_0x8dce('0x8e'),_0x431641[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x30ef4a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8dce('0x20')]=function(_0x3c5f0f){try{if(this['isNotNull'](_0x3c5f0f)){logger['debug']('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x3c5f0f[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x3c5f0f,{'showHidden':![],'depth':null}));if(this['channels'][_0x3c5f0f[_0x8dce('0x88')]]){for(var _0x123db3 in this[_0x8dce('0xa')][_0x3c5f0f['transfereeuniqueid']]){if(this[_0x8dce('0xa')][_0x3c5f0f[_0x8dce('0x88')]][_0x8dce('0x3d')](_0x123db3)){if(_0x3c5f0f[_0x8dce('0x8f')]===_0x123db3){logger[_0x8dce('0x25')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3c5f0f[_0x8dce('0x27')],this[_0x8dce('0xa')][_0x3c5f0f['transfereeuniqueid']][_0x123db3][_0x8dce('0x28')],_0x123db3);var _0x4d07ac=moment();this[_0x8dce('0xa')][_0x3c5f0f[_0x8dce('0x88')]][_0x123db3]['agentcomplete']=!![];this[_0x8dce('0xa')][_0x3c5f0f[_0x8dce('0x88')]][_0x123db3][_0x8dce('0x61')]=_0x4d07ac;this[_0x8dce('0xa')][_0x3c5f0f[_0x8dce('0x88')]][_0x123db3][_0x8dce('0x45')]='complete';this[_0x8dce('0xa')][_0x3c5f0f['transfereeuniqueid']][_0x123db3][_0x8dce('0x5a')]=_0x8dce('0x63');this['channels'][_0x3c5f0f[_0x8dce('0x88')]][_0x123db3][_0x8dce('0x65')]=_0x4d07ac[_0x8dce('0x8b')](this['channels'][_0x3c5f0f[_0x8dce('0x88')]][_0x123db3][_0x8dce('0x3f')],_0x8dce('0x8c'));}}}}}}catch(_0x177695){logger['error'](_0x8dce('0x90'),_0x3c5f0f['uniqueid'],util[_0x8dce('0x2c')](_0x177695,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x91')]=function(_0x5a0494){var _0x34e84f='';try{if(this[_0x8dce('0x23')](_0x5a0494)){logger[_0x8dce('0x2a')](_0x8dce('0x92'),_0x5a0494['uniqueid'],util[_0x8dce('0x2c')](_0x5a0494,{'showHidden':![],'depth':null}));if(_0x5a0494[_0x8dce('0x93')]){_0x34e84f=_0x5a0494[_0x8dce('0x93')]['substring'](0x0,_0x5a0494['channel'][_0x8dce('0x94')]('-'));if(this[_0x8dce('0xd')][_0x34e84f]){logger['info'](_0x8dce('0x95'),_0x5a0494[_0x8dce('0x27')],_0x34e84f);this[_0x8dce('0xd')][_0x34e84f][_0x8dce('0x96')]=!![];}}}}catch(_0x54cd60){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x5a0494[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x54cd60,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dce('0x21')][_0x8dce('0x1d')]=function(_0x4e4330){var _0x590bbe='';try{if(this[_0x8dce('0x23')](_0x4e4330)){logger[_0x8dce('0x2a')](_0x8dce('0x97'),_0x4e4330[_0x8dce('0x27')],util['inspect'](_0x4e4330,{'showHidden':![],'depth':null}));if(_0x4e4330['channel']){_0x590bbe=_0x4e4330[_0x8dce('0x93')][_0x8dce('0x98')](0x0,_0x4e4330[_0x8dce('0x93')][_0x8dce('0x94')]('-'));if(this[_0x8dce('0xd')][_0x590bbe]){logger[_0x8dce('0x25')](_0x8dce('0x99'),_0x4e4330[_0x8dce('0x27')],_0x590bbe);this[_0x8dce('0xd')][_0x590bbe]['onhold']=![];}}}}catch(_0x5eb61a){logger[_0x8dce('0x56')](_0x8dce('0x9a'),_0x4e4330[_0x8dce('0x27')],util[_0x8dce('0x2c')](_0x5eb61a,{'showHidden':![],'depth':null}));}};module[_0x8dce('0x9b')]=VoiceAgentReport; \ No newline at end of file +var _0x5564=['ami','../ami','redis','defaults','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','attendedtransfer','blindtransfer','syncBlindTransfer','emit','prototype','isUndefined','isNotNull','info','uniqueid','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','format','called','queue','inbound','variables','voice','merge','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','interface','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acwtime','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','exports','lodash','moment','util','ioredis','../../../config/environment'];(function(_0x3b8e35,_0x5da173){var _0x1eefc1=function(_0xf68e3c){while(--_0xf68e3c){_0x3b8e35['push'](_0x3b8e35['shift']());}};_0x1eefc1(++_0x5da173);}(_0x5564,0x131));var _0x4556=function(_0x2e6462,_0xb9b53e){_0x2e6462=_0x2e6462-0x0;var _0x1ebd0e=_0x5564[_0x2e6462];return _0x1ebd0e;};'use strict';var _=require(_0x4556('0x0'));var moment=require(_0x4556('0x1'));var util=require(_0x4556('0x2'));var Redis=require(_0x4556('0x3'));var config=require(_0x4556('0x4'));var logger=require('../../../config/logger')(_0x4556('0x5'));var ami=require(_0x4556('0x6'));config[_0x4556('0x7')]=_[_0x4556('0x8')](config[_0x4556('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4556('0x9'))(new Redis(config[_0x4556('0x7')]));function VoiceAgentReport(_0xe209be){this[_0x4556('0xa')]={};this[_0x4556('0xb')]=_0xe209be[_0x4556('0xa')];this[_0x4556('0xc')]=_0xe209be[_0x4556('0xc')];this[_0x4556('0xd')]=_0xe209be[_0x4556('0xd')];this['variables']={};ami['on'](_0x4556('0xe'),this[_0x4556('0xf')][_0x4556('0x10')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x4556('0x10')](this));ami['on'](_0x4556('0x11'),this[_0x4556('0x12')][_0x4556('0x10')](this));ami['on'](_0x4556('0x13'),this[_0x4556('0x14')][_0x4556('0x10')](this));ami['on']('agentcomplete',this[_0x4556('0x15')][_0x4556('0x10')](this));ami['on'](_0x4556('0x16'),this[_0x4556('0x17')][_0x4556('0x10')](this));ami['on'](_0x4556('0x18'),this['syncHangup']['bind'](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x4556('0x10')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x4556('0x10')](this));ami['on'](_0x4556('0x19'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x4556('0x1a'),this[_0x4556('0x1b')][_0x4556('0x10')](this));}VoiceAgentReport['prototype'][_0x4556('0x1c')]=function(_0x17bb46,_0x313e0c,_0x583f8e){io['to'](_0x17bb46)[_0x4556('0x1c')](_0x313e0c,_0x583f8e);};VoiceAgentReport[_0x4556('0x1d')]['isNotNull']=function(_0x56b7f9){return _0x56b7f9!==null&&!_[_0x4556('0x1e')](_0x56b7f9);};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0xf')]=function(_0x42f285){try{if(this[_0x4556('0x1f')](_0x42f285)){logger[_0x4556('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x42f285[_0x4556('0x21')],_0x42f285[_0x4556('0x22')],_0x42f285[_0x4556('0x23')]);logger['debug'](_0x4556('0x24'),_0x42f285[_0x4556('0x21')],util['inspect'](_0x42f285,{'showHidden':![],'depth':null}));if(_[_0x4556('0x1e')](this[_0x4556('0xa')][_0x42f285[_0x4556('0x21')]])){this[_0x4556('0xa')][_0x42f285['uniqueid']]={};}if(_['isUndefined'](this[_0x4556('0xa')][_0x42f285[_0x4556('0x21')]][_0x42f285[_0x4556('0x23')]])){this[_0x4556('0xa')][_0x42f285['uniqueid']][_0x42f285[_0x4556('0x23')]]={'agentcalledAt':moment()[_0x4556('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x4556('0x26'),'mandatoryDisposition':this['voiceQueues'][_0x42f285[_0x4556('0x27')]]?this[_0x4556('0xc')][_0x42f285[_0x4556('0x27')]]['mandatoryDisposition']||![]:![],'type':this[_0x4556('0xc')][_0x42f285['queue']]?this['voiceQueues'][_0x42f285['queue']]['type']||_0x4556('0x28'):_0x4556('0x28'),'variables':this[_0x4556('0x29')][_0x42f285[_0x4556('0x21')]],'motionChannel':_0x4556('0x2a')};}_[_0x4556('0x2b')](this[_0x4556('0xa')][_0x42f285[_0x4556('0x21')]][_0x42f285[_0x4556('0x23')]],_[_0x4556('0x2c')](_0x42f285,[_0x4556('0x2d'),'privilege']));logger['debug'](_0x4556('0x2e'),_0x42f285[_0x4556('0x21')],util[_0x4556('0x2f')](this[_0x4556('0xa')][_0x42f285[_0x4556('0x21')]][_0x42f285[_0x4556('0x23')]],{'showHidden':![],'depth':null}));ami[_0x4556('0x1c')](_0x4556('0x30'),this[_0x4556('0xa')][_0x42f285[_0x4556('0x21')]][_0x42f285[_0x4556('0x23')]]);var _0x1ab25a={'id':this[_0x4556('0xd')][_0x42f285[_0x4556('0x31')]]['id'],'calleridnum':this[_0x4556('0xa')][_0x42f285[_0x4556('0x21')]][_0x42f285[_0x4556('0x23')]]['calleridnum'],'queue':this[_0x4556('0xa')][_0x42f285[_0x4556('0x21')]][_0x42f285[_0x4556('0x23')]][_0x4556('0x27')],'variables':this['channels'][_0x42f285[_0x4556('0x21')]][_0x42f285[_0x4556('0x23')]]['variables']};logger[_0x4556('0x32')](_0x4556('0x33'),_0x42f285[_0x4556('0x21')],util[_0x4556('0x2f')](_0x1ab25a,{'showHidden':![],'depth':null}));this[_0x4556('0x1c')](util[_0x4556('0x25')](_0x4556('0x34'),_0x42f285[_0x4556('0x22')]),_0x4556('0x35'),_0x1ab25a);}}catch(_0x3ff63e){logger['error']('[%s][voiceAgentReport][agentcalled]',_0x42f285['uniqueid'],util['inspect'](_0x3ff63e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0x36')]=function(_0x5ad0b6){try{if(this[_0x4556('0x1f')](_0x5ad0b6)){if(this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]]){logger[_0x4556('0x32')](_0x4556('0x37'),_0x5ad0b6[_0x4556('0x21')],util[_0x4556('0x2f')](_0x5ad0b6,{'showHidden':![],'depth':null}));for(var _0x2cbcd4 in this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]]){if(this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x4556('0x38')](_0x2cbcd4)){if(_0x5ad0b6[_0x4556('0x23')]===_0x2cbcd4){logger[_0x4556('0x20')](_0x4556('0x39'),_0x5ad0b6[_0x4556('0x21')],_0x5ad0b6[_0x4556('0x22')],_0x5ad0b6[_0x4556('0x23')]);this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x3a')]=moment()['format'](_0x4556('0x3b'));this[_0x4556('0xa')][_0x5ad0b6['uniqueid']][_0x2cbcd4][_0x4556('0x3c')]=_0x5ad0b6[_0x4556('0x3c')];this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x3d')]=_0x5ad0b6['connectedlinenum'];this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x3e')]=_0x5ad0b6[_0x4556('0x3e')];this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x3f')]=_0x5ad0b6[_0x4556('0x3f')];this['channels'][_0x5ad0b6['uniqueid']][_0x2cbcd4][_0x4556('0x40')]=_0x5ad0b6[_0x4556('0x40')];this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x41')]=_0x4556('0x42');if(this[_0x4556('0xb')][this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x21')]]){var _0x27b666=this[_0x4556('0xb')][this['channels'][_0x5ad0b6['uniqueid']][_0x2cbcd4][_0x4556('0x21')]][_0x4556('0x43')];this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x43')]=_0x27b666;_0x5ad0b6[_0x4556('0x43')]=_0x27b666;}_['merge'](this[_0x4556('0xd')][_0x5ad0b6['interface']],_[_0x4556('0x44')](_0x5ad0b6,['queue','destconnectedlinenum',_0x4556('0x43')]));logger[_0x4556('0x32')](_0x4556('0x45'),_0x5ad0b6[_0x4556('0x21')],util[_0x4556('0x2f')](this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x5ad0b6[_0x4556('0x23')]],{'showHidden':![],'depth':null}));ami[_0x4556('0x1c')]('custom:agentconnect',this[_0x4556('0xa')][_0x5ad0b6['uniqueid']][_0x5ad0b6[_0x4556('0x23')]]);logger['debug'](_0x4556('0x46'),_0x5ad0b6[_0x4556('0x21')],util['inspect'](this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x5ad0b6[_0x4556('0x23')]],{'showHidden':![],'depth':null}));this[_0x4556('0x1c')](util[_0x4556('0x25')](_0x4556('0x34'),_0x5ad0b6[_0x4556('0x22')]),_0x4556('0x47'),this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x5ad0b6[_0x4556('0x23')]]);}else if(!this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x11')]&&!this[_0x4556('0xa')][_0x5ad0b6['uniqueid']][_0x2cbcd4][_0x4556('0x48')]){logger[_0x4556('0x20')](_0x4556('0x49'),_0x5ad0b6[_0x4556('0x21')],this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4]['membername'],_0x2cbcd4);this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x11')]=!![];this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4][_0x4556('0x4a')]=moment()[_0x4556('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4556('0xa')][_0x5ad0b6['uniqueid']][_0x2cbcd4][_0x4556('0x4b')]=_0x5ad0b6[_0x4556('0x23')];this[_0x4556('0xa')][_0x5ad0b6['uniqueid']][_0x2cbcd4][_0x4556('0x4c')]=_0x5ad0b6[_0x4556('0x22')];this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4]['lastevent']=_0x4556('0x4d');this[_0x4556('0xa')][_0x5ad0b6['uniqueid']][_0x2cbcd4][_0x4556('0x4e')]=_0x4556('0x4d');logger[_0x4556('0x32')](_0x4556('0x4f'),_0x5ad0b6[_0x4556('0x21')],util[_0x4556('0x2f')](this['channels'][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4],{'showHidden':![],'depth':null}));ami[_0x4556('0x1c')]('custom:agentansweredelsewhere',this[_0x4556('0xa')][_0x5ad0b6[_0x4556('0x21')]][_0x2cbcd4]);}}}}}}catch(_0x583616){logger[_0x4556('0x50')](_0x4556('0x51'),_0x5ad0b6[_0x4556('0x21')],util[_0x4556('0x2f')](_0x583616,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0x12')]=function(_0x575151){try{if(this[_0x4556('0x1f')](_0x575151)){logger[_0x4556('0x32')](_0x4556('0x52'),_0x575151[_0x4556('0x21')],util[_0x4556('0x2f')](_0x575151,{'showHidden':![],'depth':null}));if(this[_0x4556('0xa')][_0x575151[_0x4556('0x21')]]&&this['channels'][_0x575151[_0x4556('0x21')]][_0x575151[_0x4556('0x23')]]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x575151['uniqueid'],_0x575151[_0x4556('0x22')],_0x575151[_0x4556('0x23')]);this[_0x4556('0xa')][_0x575151[_0x4556('0x21')]][_0x575151['destuniqueid']][_0x4556('0x11')]=!![];this[_0x4556('0xa')][_0x575151[_0x4556('0x21')]][_0x575151['destuniqueid']]['agentringnoanswerAt']=moment()['format'](_0x4556('0x3b'));this[_0x4556('0xa')][_0x575151[_0x4556('0x21')]][_0x575151[_0x4556('0x23')]]['lastevent']=_0x4556('0x53');this[_0x4556('0xa')][_0x575151[_0x4556('0x21')]][_0x575151[_0x4556('0x23')]][_0x4556('0x4e')]=_0x4556('0x53');logger[_0x4556('0x32')](_0x4556('0x54'),_0x575151[_0x4556('0x21')],util['inspect'](this[_0x4556('0xa')][_0x575151[_0x4556('0x21')]][_0x575151[_0x4556('0x23')]],{'showHidden':![],'depth':null}));ami['emit'](_0x4556('0x55'),this[_0x4556('0xa')][_0x575151[_0x4556('0x21')]][_0x575151[_0x4556('0x23')]]);}}}catch(_0x213f2d){logger[_0x4556('0x50')](_0x4556('0x56'),_0x575151[_0x4556('0x21')],util[_0x4556('0x2f')](_0x213f2d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0x14')]=function(_0x360331){try{if(this[_0x4556('0x1f')](_0x360331)){logger[_0x4556('0x32')](_0x4556('0x57'),_0x360331['uniqueid'],util[_0x4556('0x2f')](_0x360331,{'showHidden':![],'depth':null}));if(this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]]){for(var _0x4abad8 in this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]]){if(this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]][_0x4556('0x38')](_0x4abad8)&&!this['channels'][_0x360331[_0x4556('0x21')]][_0x4abad8][_0x4556('0x11')]&&!this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]][_0x4abad8][_0x4556('0x48')]){logger[_0x4556('0x20')](_0x4556('0x58'),_0x360331[_0x4556('0x21')],this['channels'][_0x360331['uniqueid']][_0x4abad8][_0x4556('0x22')],_0x4abad8);this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]][_0x4abad8][_0x4556('0x11')]=!![];this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]][_0x4abad8][_0x4556('0x4a')]=moment()[_0x4556('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4556('0xa')][_0x360331['uniqueid']][_0x4abad8]['lastevent']=_0x4556('0x59');this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]][_0x4abad8][_0x4556('0x4e')]=_0x4556('0x59');logger[_0x4556('0x32')](_0x4556('0x5a'),_0x360331[_0x4556('0x21')],util['inspect'](this[_0x4556('0xa')][_0x360331[_0x4556('0x21')]][_0x4abad8],{'showHidden':![],'depth':null}));ami[_0x4556('0x1c')]('custom:agentqueuecallerabandon',this[_0x4556('0xa')][_0x360331['uniqueid']][_0x4abad8]);}}}}}catch(_0x3509af){logger['error'](_0x4556('0x5b'),_0x360331[_0x4556('0x21')],util[_0x4556('0x2f')](_0x3509af,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4556('0x15')]=function(_0x1c83ef){try{if(this[_0x4556('0x1f')](_0x1c83ef)){logger[_0x4556('0x32')](_0x4556('0x5c'),_0x1c83ef[_0x4556('0x21')],util[_0x4556('0x2f')](_0x1c83ef,{'showHidden':![],'depth':null}));if(this['channels'][_0x1c83ef[_0x4556('0x21')]]){for(var _0x459230 in this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]]){if(this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x4556('0x38')](_0x459230)){if(this['channels'][_0x1c83ef['uniqueid']][_0x459230]['agentconnectAt']&&!this['channels'][_0x1c83ef[_0x4556('0x21')]][_0x459230][_0x4556('0x48')]){logger[_0x4556('0x20')](_0x4556('0x5d'),_0x1c83ef[_0x4556('0x21')],this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x459230][_0x4556('0x22')],_0x459230);this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x459230][_0x4556('0x48')]=!![];this['channels'][_0x1c83ef[_0x4556('0x21')]][_0x459230][_0x4556('0x5e')]=moment()[_0x4556('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x459230]['lastevent']=_0x4556('0x5f');this['channels'][_0x1c83ef['uniqueid']][_0x459230][_0x4556('0x4e')]=_0x1c83ef[_0x4556('0x4e')]==_0x4556('0x60')?_0x4556('0x61'):_0x1c83ef[_0x4556('0x4e')];this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x459230][_0x4556('0x62')]=_0x1c83ef[_0x4556('0x62')];if(this['voiceQueues'][_0x1c83ef['queue']]&&this['voiceQueues'][_0x1c83ef['queue']]['acw']){this['channels'][_0x1c83ef[_0x4556('0x21')]][_0x459230][_0x4556('0x63')]=this[_0x4556('0xc')][_0x1c83ef[_0x4556('0x27')]]['acwTimeout'];this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x459230][_0x4556('0x64')]=!![];}this[_0x4556('0xd')][_0x1c83ef[_0x4556('0x31')]]=_['omit'](this['agents'][_0x1c83ef[_0x4556('0x31')]],[_0x4556('0x27'),_0x4556('0x65')]);logger['debug'](_0x4556('0x66'),_0x1c83ef['uniqueid'],util['inspect'](this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x459230],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x4556('0xa')][_0x1c83ef[_0x4556('0x21')]][_0x459230]);logger[_0x4556('0x32')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x1c83ef['uniqueid'],util['inspect']({'id':this['agents'][_0x1c83ef[_0x4556('0x31')]]['id'],'destaccountcode':_0x1c83ef['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x4556('0x1c')](util[_0x4556('0x25')](_0x4556('0x34'),_0x1c83ef[_0x4556('0x22')]),_0x4556('0x67'),{'id':this[_0x4556('0xd')][_0x1c83ef[_0x4556('0x31')]]['id'],'destaccountcode':_0x1c83ef['destaccountcode']});}}}}}}catch(_0x2fe9ef){logger['error'](_0x4556('0x68'),_0x1c83ef[_0x4556('0x21')],util[_0x4556('0x2f')](_0x2fe9ef,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')]['syncVarSet']=function(_0x75125f){try{if(this[_0x4556('0x1f')](_0x75125f)){logger[_0x4556('0x32')]('[%s][voiceAgentReport][varset]\x20event:',_0x75125f[_0x4556('0x21')],util[_0x4556('0x2f')](_0x75125f,{'showHidden':![],'depth':null}));this[_0x4556('0x69')](_0x75125f[_0x4556('0x21')],_[_0x4556('0x6a')](_0x75125f[_0x4556('0x6b')])[0x0],_0x75125f[_0x4556('0x6c')]);if(this[_0x4556('0xa')][_0x75125f[_0x4556('0x21')]]){for(var _0x260a7f in this[_0x4556('0xa')][_0x75125f[_0x4556('0x21')]]){if(this[_0x4556('0xa')][_0x75125f[_0x4556('0x21')]][_0x4556('0x38')](_0x260a7f)){logger[_0x4556('0x20')](_0x4556('0x6d'),_0x75125f[_0x4556('0x21')],_0x260a7f,_[_0x4556('0x6a')](_0x75125f[_0x4556('0x6b')])[0x0],_0x75125f[_0x4556('0x6c')]);if(_[_0x4556('0x1e')](this[_0x4556('0xa')][_0x75125f['uniqueid']][_0x260a7f][_0x4556('0x29')])){this[_0x4556('0xa')][_0x75125f['uniqueid']][_0x260a7f][_0x4556('0x29')]={};}this[_0x4556('0xa')][_0x75125f[_0x4556('0x21')]][_0x260a7f][_0x4556('0x29')]=this[_0x4556('0x29')][_0x75125f[_0x4556('0x21')]];}}}}}catch(_0x46e9c8){logger[_0x4556('0x50')](_0x4556('0x6e'),_0x75125f['uniqueid'],util[_0x4556('0x2f')](_0x46e9c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0x69')]=function(_0x20214c,_0x5bfe20,_0x2de3dd){var _0x20bd3e=[_0x4556('0x6f'),_0x4556('0x70'),_0x4556('0x71'),_0x4556('0x72'),_0x4556('0x73'),_0x4556('0x74'),_0x4556('0x75'),_0x4556('0x76'),_0x4556('0x77'),'sipuri',_0x4556('0x78'),_0x4556('0x79'),_0x4556('0x7a'),_0x4556('0x7b'),_0x4556('0x7c'),_0x4556('0x7d'),_0x4556('0x22'),'memberpenalty',_0x4556('0x7e')];if(!_[_0x4556('0x7f')](_0x5bfe20)&&!_[_0x4556('0x80')](_0x20bd3e,_0x5bfe20)){if(_['isUndefined'](this['variables'][_0x20214c])){this[_0x4556('0x29')][_0x20214c]={};}this['variables'][_0x20214c][_0x5bfe20]=_0x2de3dd;}};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0x81')]=function(_0x52af3f){try{if(this['isNotNull'](_0x52af3f)){logger['debug'](_0x4556('0x82'),_0x52af3f[_0x4556('0x21')],util[_0x4556('0x2f')](_0x52af3f,{'showHidden':![],'depth':null}));if(this[_0x4556('0xa')][_0x52af3f[_0x4556('0x21')]]){for(var _0x14ace1 in this['channels'][_0x52af3f[_0x4556('0x21')]]){if(this[_0x4556('0xa')][_0x52af3f[_0x4556('0x21')]][_0x4556('0x38')](_0x14ace1)){if(this[_0x4556('0xa')][_0x52af3f['uniqueid']][_0x14ace1][_0x4556('0x4e')]==_0x4556('0x60')&&this['channels'][_0x52af3f[_0x4556('0x21')]][_0x14ace1]['agentcomplete']){logger[_0x4556('0x20')](_0x4556('0x83'),_0x52af3f[_0x4556('0x21')],_0x14ace1);this[_0x4556('0xa')][_0x52af3f['uniqueid']][_0x14ace1]['agentcompleteAt']=moment()[_0x4556('0x25')](_0x4556('0x3b'));}}}logger[_0x4556('0x32')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x52af3f[_0x4556('0x21')],util[_0x4556('0x2f')](_[_0x4556('0x84')](this[_0x4556('0xa')][_0x52af3f[_0x4556('0x21')]]),{'showHidden':![],'depth':null}));ami[_0x4556('0x1c')](_0x4556('0x85'),_[_0x4556('0x84')](this[_0x4556('0xa')][_0x52af3f[_0x4556('0x21')]]));delete this['channels'][_0x52af3f['uniqueid']];}if(this[_0x4556('0x29')][_0x52af3f[_0x4556('0x21')]]){delete this[_0x4556('0x29')][_0x52af3f['uniqueid']];}}}catch(_0x2ae4c8){logger['error']('[%s][voiceAgentReport][hangup]',_0x52af3f['uniqueid'],util['inspect'](_0x2ae4c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')]['syncAttendedTransfer']=function(_0x20ee6){try{if(this[_0x4556('0x1f')](_0x20ee6)){logger['debug'](_0x4556('0x86'),_0x20ee6['uniqueid'],util[_0x4556('0x2f')](_0x20ee6,{'showHidden':![],'depth':null}));if(this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]]){for(var _0x5d0046 in this[_0x4556('0xa')][_0x20ee6['transfereeuniqueid']]){if(this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]][_0x4556('0x38')](_0x5d0046)){if(_0x20ee6[_0x4556('0x88')]===_0x5d0046){logger['info'](_0x4556('0x89'),_0x20ee6[_0x4556('0x21')],this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]][_0x5d0046]['membername'],_0x5d0046);var _0x1436a9=moment();this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]][_0x5d0046][_0x4556('0x48')]=!![];this['channels'][_0x20ee6[_0x4556('0x87')]][_0x5d0046][_0x4556('0x5e')]=moment()[_0x4556('0x25')](_0x4556('0x3b'));this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]][_0x5d0046][_0x4556('0x41')]=_0x4556('0x5f');this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]][_0x5d0046][_0x4556('0x4e')]=_0x4556('0x60');this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]][_0x5d0046][_0x4556('0x62')]=_0x1436a9[_0x4556('0x8a')](this[_0x4556('0xa')][_0x20ee6['transfereeuniqueid']][_0x5d0046][_0x4556('0x3a')],_0x4556('0x8b'));}}}}if(this[_0x4556('0xa')][_0x20ee6[_0x4556('0x8c')]]){var _0x4e57cd=this['channels'][_0x20ee6[_0x4556('0x8c')]];this['channels'][_0x20ee6[_0x4556('0x8c')]]=this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]];this[_0x4556('0xa')][_0x20ee6[_0x4556('0x87')]]=_0x4e57cd;}}}catch(_0x3cb1bb){logger[_0x4556('0x50')](_0x4556('0x8d'),_0x20ee6[_0x4556('0x21')],util[_0x4556('0x2f')](_0x3cb1bb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0x1b')]=function(_0x7a8910){try{if(this[_0x4556('0x1f')](_0x7a8910)){logger[_0x4556('0x32')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x7a8910[_0x4556('0x21')],util[_0x4556('0x2f')](_0x7a8910,{'showHidden':![],'depth':null}));if(this[_0x4556('0xa')][_0x7a8910[_0x4556('0x87')]]){for(var _0x3b851f in this[_0x4556('0xa')][_0x7a8910[_0x4556('0x87')]]){if(this['channels'][_0x7a8910[_0x4556('0x87')]]['hasOwnProperty'](_0x3b851f)){if(_0x7a8910[_0x4556('0x8e')]===_0x3b851f){logger[_0x4556('0x20')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x7a8910['uniqueid'],this['channels'][_0x7a8910[_0x4556('0x87')]][_0x3b851f][_0x4556('0x22')],_0x3b851f);var _0x2d5ef6=moment();this[_0x4556('0xa')][_0x7a8910[_0x4556('0x87')]][_0x3b851f][_0x4556('0x48')]=!![];this[_0x4556('0xa')][_0x7a8910['transfereeuniqueid']][_0x3b851f][_0x4556('0x5e')]=_0x2d5ef6;this[_0x4556('0xa')][_0x7a8910[_0x4556('0x87')]][_0x3b851f][_0x4556('0x41')]=_0x4556('0x5f');this[_0x4556('0xa')][_0x7a8910[_0x4556('0x87')]][_0x3b851f][_0x4556('0x4e')]=_0x4556('0x60');this[_0x4556('0xa')][_0x7a8910[_0x4556('0x87')]][_0x3b851f]['talktime']=_0x2d5ef6[_0x4556('0x8a')](this['channels'][_0x7a8910['transfereeuniqueid']][_0x3b851f][_0x4556('0x3a')],_0x4556('0x8b'));}}}}}}catch(_0x5d09e1){logger[_0x4556('0x50')](_0x4556('0x8f'),_0x7a8910['uniqueid'],util['inspect'](_0x5d09e1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')]['syncMusicOnHoldStart']=function(_0x5ebabb){var _0x3458ec='';try{if(this[_0x4556('0x1f')](_0x5ebabb)){logger['debug'](_0x4556('0x90'),_0x5ebabb[_0x4556('0x21')],util[_0x4556('0x2f')](_0x5ebabb,{'showHidden':![],'depth':null}));if(_0x5ebabb['channel']){_0x3458ec=_0x5ebabb[_0x4556('0x91')]['substring'](0x0,_0x5ebabb['channel'][_0x4556('0x92')]('-'));if(this['agents'][_0x3458ec]){logger[_0x4556('0x20')](_0x4556('0x93'),_0x5ebabb[_0x4556('0x21')],_0x3458ec);this[_0x4556('0xd')][_0x3458ec]['onhold']=!![];}}}}catch(_0x228721){logger[_0x4556('0x50')](_0x4556('0x94'),_0x5ebabb[_0x4556('0x21')],util[_0x4556('0x2f')](_0x228721,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4556('0x1d')][_0x4556('0x95')]=function(_0x41a98a){var _0x1fc6b3='';try{if(this[_0x4556('0x1f')](_0x41a98a)){logger[_0x4556('0x32')](_0x4556('0x96'),_0x41a98a[_0x4556('0x21')],util[_0x4556('0x2f')](_0x41a98a,{'showHidden':![],'depth':null}));if(_0x41a98a[_0x4556('0x91')]){_0x1fc6b3=_0x41a98a[_0x4556('0x91')][_0x4556('0x97')](0x0,_0x41a98a[_0x4556('0x91')]['lastIndexOf']('-'));if(this[_0x4556('0xd')][_0x1fc6b3]){logger[_0x4556('0x20')](_0x4556('0x98'),_0x41a98a[_0x4556('0x21')],_0x1fc6b3);this[_0x4556('0xd')][_0x1fc6b3][_0x4556('0x99')]=![];}}}}catch(_0x30d0aa){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x41a98a[_0x4556('0x21')],util['inspect'](_0x30d0aa,{'showHidden':![],'depth':null}));}};module[_0x4556('0x9a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index f840704..671d723 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524a=['omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','StopMixMonitor','catch','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','transferconnectedlinenum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../rpc/setting','set','queue','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','defaults','redis','localhost','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','isUndefined','merge','pick','keys','from-sip','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','channel','name','user:agentconnect','accountcode','connectedlinenum','debug','OutgoingSpoolFailed','linkedid','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','prototype','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','channelstate','answered','answertime','holdtime','connectedlinename','destinationchannel','disposition','UserId','membername','diff','routealias','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.wav49','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x524a,0xf5));var _0xa524=function(_0x495f56,_0x3339ec){_0x495f56=_0x495f56-0x0;var _0x1c8dc0=_0x524a[_0x495f56];return _0x1c8dc0;};'use strict';var _=require(_0xa524('0x0'));var moment=require(_0xa524('0x1'));var util=require(_0xa524('0x2'));var path=require(_0xa524('0x3'));var Redis=require('ioredis');var config=require(_0xa524('0x4'));var logger=require(_0xa524('0x5'))(_0xa524('0x6'));var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require(_0xa524('0x7'));var applications=[_0xa524('0x8'),_0xa524('0x9'),'agi',_0xa524('0xa'),'playback',_0xa524('0xb')];var dispositions=[_0xa524('0xc'),'FAILED',_0xa524('0xd'),_0xa524('0xc'),_0xa524('0xc'),_0xa524('0xc'),_0xa524('0xe'),'BUSY',_0xa524('0xd'),_0xa524('0xd'),'FAILED'];config['redis']=_[_0xa524('0xf')](config[_0xa524('0x10')],{'host':_0xa524('0x11'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x14a0d6){this['channels']=_0x14a0d6[_0xa524('0x12')];this['agents']=_0x14a0d6[_0xa524('0x13')];this['blindTransfers']={};ami['on'](_0xa524('0x14'),this[_0xa524('0x15')]['bind'](this));ami['on'](_0xa524('0x16'),this[_0xa524('0x15')][_0xa524('0x17')](this));ami['on'](_0xa524('0x18'),this[_0xa524('0x19')][_0xa524('0x17')](this));ami['on'](_0xa524('0x1a'),this['syncNewState'][_0xa524('0x17')](this));ami['on'](_0xa524('0x1b'),this[_0xa524('0x1c')][_0xa524('0x17')](this));ami['on'](_0xa524('0x1d'),this[_0xa524('0x1e')][_0xa524('0x17')](this));ami['on'](_0xa524('0x1f'),this['syncNewCallerId'][_0xa524('0x17')](this));ami['on'](_0xa524('0x20'),this[_0xa524('0x21')][_0xa524('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xa524('0x17')](this));ami['on'](_0xa524('0x22'),this[_0xa524('0x23')][_0xa524('0x17')](this));ami['on'](_0xa524('0x24'),this[_0xa524('0x25')]['bind'](this));try{logger[_0xa524('0x26')](_0xa524('0x27'));ami[_0xa524('0x28')]();}catch(_0x40fb4b){logger[_0xa524('0x29')](_0xa524('0x2a'),util[_0xa524('0x2b')](_0x40fb4b,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xa524('0x2c')]=function(_0x221bf){return _0x221bf!==null&&!_['isUndefined'](_0x221bf);};VoiceCallReport['prototype'][_0xa524('0x2d')]=function(_0x2ed3b0,_0x156b8b,_0x364b8c){io['to'](_0x2ed3b0)[_0xa524('0x2d')](_0x156b8b,_0x364b8c);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x1aeabc){try{if(this[_0xa524('0x2c')](_0x1aeabc)){logger[_0xa524('0x26')](_0xa524('0x2e'),_0x1aeabc['uniqueid'],_0x1aeabc[_0xa524('0x2f')],_0x1aeabc[_0xa524('0x30')]);logger['debug'](_0xa524('0x31'),_0x1aeabc[_0xa524('0x32')],util['inspect'](_0x1aeabc,{'showHidden':![],'depth':null}));if(_0x1aeabc[_0xa524('0x32')]===_0x1aeabc['linkedid']){if(!_[_0xa524('0x33')](this[_0xa524('0x12')][_0x1aeabc[_0xa524('0x32')]])){_[_0xa524('0x34')](this[_0xa524('0x12')][_0x1aeabc[_0xa524('0x32')]],_[_0xa524('0x35')](_0x1aeabc,_[_0xa524('0x36')](this[_0xa524('0x12')][_0x1aeabc['uniqueid']])));}}if(_0x1aeabc['context']===_0xa524('0x37')){if(this['agents'][_0x1aeabc['channel'][_0xa524('0x38')]('-')[0x0]]){if(_0x1aeabc[_0xa524('0x39')]==_0xa524('0x3a')){this[_0xa524('0x13')][_0x1aeabc['channel']['split']('-')[0x0]][_0xa524('0x3b')]=_0x1aeabc['connectedlinenum'];this['emit'](util[_0xa524('0x3c')](_0xa524('0x3d'),this[_0xa524('0x13')][_0x1aeabc[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x3f')]),_0xa524('0x40'),{'destaccountcode':this[_0xa524('0x13')][_0x1aeabc[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x41')],'destconnectedlinenum':_0x1aeabc[_0xa524('0x42')]});}}}}}catch(_0x4934f8){logger['error']('[%s][voiceCallReport][newcallerid]',_0x1aeabc[_0xa524('0x32')],util[_0xa524('0x2b')](_0x4934f8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa524('0x19')]=function(_0x51fd42){try{if(this[_0xa524('0x2c')](_0x51fd42)){logger[_0xa524('0x43')]('[%s][voiceCallReport][newchannel]\x20event:',_0x51fd42[_0xa524('0x32')],util[_0xa524('0x2b')](_0x51fd42,{'showHidden':![],'depth':null}));if(this[_0xa524('0x12')][_0x51fd42['uniqueid']])return;if(_0x51fd42[_0xa524('0x3e')]===_0xa524('0x44'))return;if(_0x51fd42['uniqueid']!==_0x51fd42[_0xa524('0x45')]&&!this[_0xa524('0x46')][_0x51fd42['linkedid']])return;logger[_0xa524('0x26')](_0xa524('0x47'),_0x51fd42['uniqueid'],_0x51fd42[_0xa524('0x48')],_0x51fd42[_0xa524('0x39')]);this[_0xa524('0x12')][_0x51fd42[_0xa524('0x32')]]=new Channel();this[_0xa524('0x12')][_0x51fd42[_0xa524('0x32')]][_0xa524('0x49')]=moment()[_0xa524('0x3c')](_0xa524('0x4a'));this[_0xa524('0x12')][_0x51fd42[_0xa524('0x32')]]['disposition']=dispositions[_[_0xa524('0x4b')](_0x51fd42['channelstate'])];_[_0xa524('0x34')](this[_0xa524('0x12')][_0x51fd42[_0xa524('0x32')]],_[_0xa524('0x35')](_0x51fd42,_[_0xa524('0x36')](this[_0xa524('0x12')][_0x51fd42[_0xa524('0x32')]])));if(_0x51fd42[_0xa524('0x48')]===_0xa524('0x37')){if(this[_0xa524('0x13')][_0x51fd42['channel'][_0xa524('0x38')]('-')[0x0]]){if(_[_0xa524('0x33')](this['agents'][_0x51fd42[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]['destconnectedlinenum'])){this['agents'][_0x51fd42['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x51fd42[_0xa524('0x39')];logger[_0xa524('0x43')](_0xa524('0x4c'),_0x51fd42[_0xa524('0x32')],util['inspect']({'id':this[_0xa524('0x13')][_0x51fd42[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xa524('0x13')][_0x51fd42['channel'][_0xa524('0x38')]('-')[0x0]][_0xa524('0x41')],'destconnectedlinenum':_0x51fd42[_0xa524('0x39')]},{'showHidden':![],'depth':null}));this[_0xa524('0x2d')](util[_0xa524('0x3c')]('user:%s',this[_0xa524('0x13')][_0x51fd42[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x3f')]),_0xa524('0x40'),{'id':this[_0xa524('0x13')][_0x51fd42[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xa524('0x13')][_0x51fd42['channel']['split']('-')[0x0]][_0xa524('0x41')],'destconnectedlinenum':_0x51fd42[_0xa524('0x39')]});}}}}}catch(_0x368356){logger[_0xa524('0x29')](_0xa524('0x4d'),_0x51fd42[_0xa524('0x32')],util['inspect'](_0x368356,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa524('0x4e')][_0xa524('0x15')]=function(_0xbe44b2){try{if(this[_0xa524('0x2c')](_0xbe44b2)){logger[_0xa524('0x43')](_0xa524('0x4f'),_0xbe44b2['uniqueid'],util[_0xa524('0x2b')](_0xbe44b2,{'showHidden':![],'depth':null}));if(_0xbe44b2[_0xa524('0x3e')]===_0xa524('0x44')||_0xbe44b2[_0xa524('0x39')]==='h')return;if(_0xbe44b2[_0xa524('0x32')]===_0xbe44b2[_0xa524('0x45')]||this[_0xa524('0x46')][_0xbe44b2[_0xa524('0x45')]]){_0xbe44b2[_0xa524('0x50')]=_0xbe44b2[_0xa524('0x50')][_0xa524('0x51')]();_0xbe44b2[_0xa524('0x52')]=_0xbe44b2[_0xa524('0x53')]||_0xbe44b2[_0xa524('0x52')];if(_0xbe44b2[_0xa524('0x53')]&&!_0xbe44b2['appdata'][_0xa524('0x54')](_0xa524('0x55'))&&_0xbe44b2['application']!=='queue'){_0xbe44b2[_0xa524('0x52')]=_0xbe44b2[_0xa524('0x52')][_0xa524('0x51')]();}logger[_0xa524('0x26')](_0xa524('0x56'),_0xbe44b2[_0xa524('0x32')],_0xbe44b2[_0xa524('0x50')],_0xbe44b2['applicationdata']);if(_[_0xa524('0x33')](this[_0xa524('0x12')][_0xbe44b2[_0xa524('0x32')]])){this[_0xa524('0x12')][_0xbe44b2[_0xa524('0x32')]]=new Channel();this['channels'][_0xbe44b2[_0xa524('0x32')]]['starttime']=_0xbe44b2[_0xa524('0x57')]?moment()[_0xa524('0x58')](moment[_0xa524('0x57')](_0xbe44b2[_0xa524('0x57')])[_0xa524('0x59')](),_0xa524('0x59'))[_0xa524('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xa524('0x4a'));this[_0xa524('0x12')][_0xbe44b2[_0xa524('0x32')]]['disposition']=_0xa524('0xc');}_[_0xa524('0x34')](this['channels'][_0xbe44b2[_0xa524('0x32')]],_[_0xa524('0x35')](_0xbe44b2,_[_0xa524('0x36')](this[_0xa524('0x12')][_0xbe44b2[_0xa524('0x32')]])));if(_[_0xa524('0x5a')](applications,_0xbe44b2[_0xa524('0x50')])){this['channels'][_0xbe44b2[_0xa524('0x32')]][_0xa524('0x5b')]=_0xbe44b2[_0xa524('0x50')];this[_0xa524('0x12')][_0xbe44b2['uniqueid']][_0xa524('0x5c')]=_0xbe44b2[_0xa524('0x52')];if(_0xbe44b2['application']===_0xa524('0x8')&&_[_0xa524('0x54')](_0xbe44b2[_0xa524('0x52')][_0xa524('0x51')](),'cdr(')){var _0x491ce0=_0xbe44b2[_0xa524('0x52')]['split']('=');var _0x4d520c=_0x491ce0[0x0]['toLowerCase']()[_0xa524('0x5d')](/cdr\((.*)\)/);if(_0x4d520c){if(_0x4d520c[0x1]==='type'&&!_['isNil'](this[_0xa524('0x12')][_0xbe44b2[_0xa524('0x32')]][_0x4d520c[0x1]]))return;this[_0xa524('0x12')][_0xbe44b2[_0xa524('0x32')]][_0x4d520c[0x1]]=_0x491ce0[0x1];}}else if(_0xbe44b2['application']===_0xa524('0x9')){this[_0xa524('0x12')][_0xbe44b2[_0xa524('0x32')]]['queue']=_0xbe44b2[_0xa524('0x52')][_0xa524('0x38')](',')[0x0];}}}}}catch(_0x5da1de){logger['error'](_0xa524('0x5e'),_0xbe44b2[_0xa524('0x32')],util[_0xa524('0x2b')](_0x5da1de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa524('0x4e')]['syncNewState']=function(_0x4d1f65){try{if(this[_0xa524('0x2c')](_0x4d1f65)){logger[_0xa524('0x26')](_0xa524('0x5f'),_0x4d1f65['uniqueid'],_0x4d1f65['linkedid'],_0x4d1f65[_0xa524('0x2f')],_0x4d1f65['calleridnum']);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x4d1f65['uniqueid'],util[_0xa524('0x2b')](_0x4d1f65,{'showHidden':![],'depth':null}));if(_0x4d1f65[_0xa524('0x60')]!=='6')return;if(_0x4d1f65['uniqueid']!==_0x4d1f65['linkedid']){var _0x3c9028=moment();if(this[_0xa524('0x12')][_0x4d1f65['linkedid']]){if(!this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x61')]){this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x61')]=!![];this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x62')]=_0x3c9028[_0xa524('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x49')]){this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x63')]=_0x3c9028['diff'](this['channels'][_0x4d1f65[_0xa524('0x45')]]['starttime'],_0xa524('0x59'));}}this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x45')]=_0x4d1f65[_0xa524('0x32')];if(_0x4d1f65[_0xa524('0x30')]!==_0xa524('0x3a')){this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x42')]=_0x4d1f65[_0xa524('0x30')];}this['channels'][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x64')]=_0x4d1f65[_0xa524('0x2f')];this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x65')]=_0x4d1f65['channel'];this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x66')]=dispositions[_['toNumber'](_0x4d1f65['channelstate'])];if(this[_0xa524('0x13')][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]){this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x67')]=this[_0xa524('0x13')][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]['id'];this['channels'][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x68')]=this['agents'][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x3f')];}}if(this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]]){if(!this[_0xa524('0x12')][_0x4d1f65['uniqueid']]['answered']){this['channels'][_0x4d1f65[_0xa524('0x32')]]['answered']=!![];this['channels'][_0x4d1f65[_0xa524('0x32')]][_0xa524('0x62')]=_0x3c9028[_0xa524('0x3c')](_0xa524('0x4a'));if(this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]]['starttime']){this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]]['holdtime']=_0x3c9028[_0xa524('0x69')](this['channels'][_0x4d1f65[_0xa524('0x32')]][_0xa524('0x49')],'seconds');}}if(_0x4d1f65[_0xa524('0x30')]!=='xcally-motion-preview'){this['channels'][_0x4d1f65[_0xa524('0x32')]][_0xa524('0x42')]=_0x4d1f65[_0xa524('0x30')];}this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]][_0xa524('0x64')]=_0x4d1f65[_0xa524('0x2f')];this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]][_0xa524('0x65')]=_0x4d1f65['channel'];this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]][_0xa524('0x66')]=dispositions[_[_0xa524('0x4b')](_0x4d1f65[_0xa524('0x60')])];}}else{if(this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]]){if(this[_0xa524('0x13')][_0x4d1f65[_0xa524('0x3e')]['split']('-')[0x0]]){this[_0xa524('0x12')][_0x4d1f65['uniqueid']][_0xa524('0x67')]=this[_0xa524('0x13')][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]['id'];this[_0xa524('0x12')][_0x4d1f65['uniqueid']]['membername']=this['agents'][_0x4d1f65['channel'][_0xa524('0x38')]('-')[0x0]][_0xa524('0x3f')];}}}if(_0x4d1f65[_0xa524('0x48')]===_0xa524('0x37')){if(this[_0xa524('0x13')][_0x4d1f65[_0xa524('0x3e')]['split']('-')[0x0]]){this['agents'][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x3b')]=_0x4d1f65[_0xa524('0x39')];var _0xe45bdd,_0x262caa;if(this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]]){_0xe45bdd=this[_0xa524('0x12')][_0x4d1f65['uniqueid']]['routealias'];_0x262caa=this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x32')]][_0xa524('0x9')];}else if(this[_0xa524('0x12')][_0x4d1f65[_0xa524('0x45')]]){_0xe45bdd=this['channels'][_0x4d1f65['linkedid']][_0xa524('0x6a')];_0x262caa=this['channels'][_0x4d1f65[_0xa524('0x45')]][_0xa524('0x9')];}logger[_0xa524('0x43')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x4d1f65[_0xa524('0x32')],util[_0xa524('0x2b')]({'id':this['agents'][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xa524('0x13')][_0x4d1f65['channel']['split']('-')[0x0]][_0xa524('0x41')],'destconnectedlinenum':_0x4d1f65['exten'],'routealias':_0xe45bdd,'queue':_0x262caa||undefined},{'showHidden':![],'depth':null}));this[_0xa524('0x2d')](util[_0xa524('0x3c')](_0xa524('0x3d'),this[_0xa524('0x13')][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x3f')]),_0xa524('0x40'),{'id':this[_0xa524('0x13')][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x4d1f65[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x41')],'destconnectedlinenum':_0x4d1f65[_0xa524('0x39')],'routealias':_0xe45bdd,'queue':_0x262caa||undefined});}}}}catch(_0x5ef813){logger['error']('[%s][voiceCallReport][newstate]',_0x4d1f65[_0xa524('0x32')],util[_0xa524('0x2b')](_0x5ef813,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa524('0x4e')][_0xa524('0x6b')]=function(_0x3d6905,_0x2d7d2d){try{if(this['channels'][_0x3d6905]){logger[_0xa524('0x26')](_0xa524('0x6c'),_0x3d6905,_0x2d7d2d);this[_0xa524('0x12')][_0x3d6905][_0xa524('0x6d')]=!![];if(_[_0xa524('0x6e')](_0x2d7d2d,'.wav49')){_0x2d7d2d=_0x2d7d2d[_0xa524('0x6f')](_0xa524('0x70'),'.WAV');}this[_0xa524('0x12')][_0x3d6905]['monitorFilename']=_0x2d7d2d;var _0x378202=_[_0xa524('0x71')](this[_0xa524('0x12')][_0x3d6905][_0xa524('0x72')],{'filename':_0x2d7d2d});if(_[_0xa524('0x73')](_0x378202)){this['channels'][_0x3d6905][_0xa524('0x72')][_0xa524('0x74')]({'filename':_0x2d7d2d,'createdAt':moment()[_0xa524('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xa524('0x75')});}}}catch(_0x385768){logger[_0xa524('0x29')](_0xa524('0x76'),_0x3d6905,util[_0xa524('0x2b')](_0x385768,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa524('0x4e')]['syncVarSet']=function(_0x3cef92){try{if(this[_0xa524('0x2c')](_0x3cef92)){logger['debug'](_0xa524('0x77'),_0x3cef92[_0xa524('0x32')],util[_0xa524('0x2b')](_0x3cef92,{'showHidden':![],'depth':null}));if(this[_0xa524('0x12')][_0x3cef92['uniqueid']]&&_0x3cef92['channel']!='OutgoingSpoolFailed'){if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')])){if(this[_0xa524('0x2c')](_0x3cef92['variable'][_0xa524('0x79')])){logger[_0xa524('0x26')](_0xa524('0x7a'),_0x3cef92[_0xa524('0x32')],_0x3cef92[_0xa524('0x7b')]);this[_0xa524('0x6b')](_0x3cef92[_0xa524('0x32')],_0x3cef92[_0xa524('0x7b')]);}else if(this['isNotNull'](_0x3cef92[_0xa524('0x78')][_0xa524('0x7c')])){logger[_0xa524('0x26')](_0xa524('0x7d'),_0x3cef92['uniqueid'],_0x3cef92[_0xa524('0x7b')]);this['channels'][_0x3cef92[_0xa524('0x32')]]['calleridnum']=_0x3cef92['value'];}else if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')][_0xa524('0x7e')])){logger[_0xa524('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x3cef92[_0xa524('0x32')],_0x3cef92[_0xa524('0x7b')]);this[_0xa524('0x12')][_0x3cef92['uniqueid']][_0xa524('0x7f')]=_0x3cef92[_0xa524('0x7b')];}else if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')][_0xa524('0x80')])){logger[_0xa524('0x26')](_0xa524('0x81'),_0x3cef92[_0xa524('0x32')],_0x3cef92[_0xa524('0x7b')]);this[_0xa524('0x12')][_0x3cef92[_0xa524('0x32')]][_0xa524('0x82')]=_0x3cef92[_0xa524('0x7b')];}else if(this['isNotNull'](_0x3cef92[_0xa524('0x78')]['xmd-queue'])){logger['info'](_0xa524('0x83'),_0x3cef92[_0xa524('0x32')],_0x3cef92[_0xa524('0x7b')][_0xa524('0x38')](',')[0x0]);this[_0xa524('0x12')][_0x3cef92['uniqueid']][_0xa524('0x9')]=_0x3cef92[_0xa524('0x7b')][_0xa524('0x38')](',')[0x0];}else if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')][_0xa524('0x84')])){logger[_0xa524('0x26')](_0xa524('0x85'),_0x3cef92[_0xa524('0x32')],_0x3cef92['value']);this['channels'][_0x3cef92[_0xa524('0x32')]][_0xa524('0x86')]=_0x3cef92['value'];}else if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')]['xmd-destination'])){logger['info'](_0xa524('0x87'),_0x3cef92[_0xa524('0x32')],_0x3cef92[_0xa524('0x7b')]);this[_0xa524('0x12')][_0x3cef92[_0xa524('0x32')]][_0xa524('0x88')]=_0x3cef92['value'];}else if(this['isNotNull'](_0x3cef92[_0xa524('0x78')]['xmd-callerid-preview'])){logger[_0xa524('0x26')](_0xa524('0x89'),_0x3cef92['uniqueid'],_0x3cef92[_0xa524('0x7b')]);this[_0xa524('0x12')][_0x3cef92[_0xa524('0x32')]][_0xa524('0x8a')]=_0x3cef92[_0xa524('0x7b')];}else if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')][_0xa524('0x8b')])){logger[_0xa524('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x3cef92['uniqueid'],_0x3cef92['value']);this[_0xa524('0x12')][_0x3cef92[_0xa524('0x32')]][_0xa524('0x9')]=_0x3cef92['value'];}else if(this[_0xa524('0x2c')](_0x3cef92['variable'][_0xa524('0x8c')])){logger[_0xa524('0x26')](_0xa524('0x8d'),_0x3cef92['uniqueid'],_0x3cef92[_0xa524('0x7b')]);this[_0xa524('0x12')][_0x3cef92['uniqueid']][_0xa524('0x8e')]=_0x3cef92['value'];}}}else if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')][_0xa524('0x79')])){if(_0x3cef92[_0xa524('0x7b')]){var _0x2ff3b8=path[_0xa524('0x8f')](_0x3cef92[_0xa524('0x7b')])[_0xa524('0x3f')];logger['info'](_0xa524('0x7a'),_0x2ff3b8,_0x3cef92['value']);this['syncMixMonitorFilename'](_0x2ff3b8,_0x3cef92[_0xa524('0x7b')]);}}else if(this[_0xa524('0x12')][_0x3cef92[_0xa524('0x45')]]){if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')])){if(this[_0xa524('0x2c')](_0x3cef92[_0xa524('0x78')][_0xa524('0x8c')])){logger[_0xa524('0x26')](_0xa524('0x8d'),_0x3cef92[_0xa524('0x45')],_0x3cef92[_0xa524('0x7b')]);this[_0xa524('0x12')][_0x3cef92[_0xa524('0x45')]][_0xa524('0x90')]=_0x3cef92[_0xa524('0x7b')];}}}}}catch(_0x5be057){logger[_0xa524('0x29')](_0xa524('0x91'),_0x3cef92[_0xa524('0x32')],util[_0xa524('0x2b')](_0x5be057,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0xb2ebd5){try{if(this[_0xa524('0x2c')](_0xb2ebd5)){logger['debug'](_0xa524('0x92'),_0xb2ebd5[_0xa524('0x32')],util[_0xa524('0x2b')](_0xb2ebd5,{'showHidden':![],'depth':null}));if(this[_0xa524('0x46')][_0xb2ebd5['linkedid']]){if(this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]]['linkedid']]){this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]]['linkedid']][_0xa524('0x32')]=_0xb2ebd5[_0xa524('0x32')];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x45')]][_0xa524('0x61')]=this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x61')];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x45')]][_0xa524('0x62')]=this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x62')];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x45')]][_0xa524('0x65')]=this['channels'][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]]['linkedid']][_0xa524('0x3e')];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5['linkedid']][_0xa524('0x45')]]['disposition']=this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x66')];this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]]=this['channels'][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]]['linkedid']];delete this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]]['linkedid']];}else if(this[_0xa524('0x12')][this['blindTransfers'][_0xb2ebd5['linkedid']][_0xa524('0x32')]]){this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]][_0xa524('0x32')]=[this[_0xa524('0x12')][this['blindTransfers'][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]][_0xa524('0x45')],this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]][_0xa524('0x45')]=this['channels'][this['blindTransfers'][_0xb2ebd5['linkedid']][_0xa524('0x32')]][_0xa524('0x32')]][0x0];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]][_0xa524('0x61')]=this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]]['answered'];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]][_0xa524('0x62')]=this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]]['answertime'];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]][_0xa524('0x65')]=this['channels'][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]][_0xa524('0x3e')];this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5[_0xa524('0x45')]][_0xa524('0x32')]]['disposition']=this['channels'][_0xb2ebd5['uniqueid']][_0xa524('0x66')];this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]]=this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5['linkedid']]['uniqueid']];delete this[_0xa524('0x12')][this[_0xa524('0x46')][_0xb2ebd5['linkedid']]['uniqueid']];}}if(this['channels'][_0xb2ebd5['uniqueid']]){logger[_0xa524('0x26')](_0xa524('0x93'),_0xb2ebd5[_0xa524('0x32')],_0xb2ebd5[_0xa524('0x94')]);var _0x2e0b39=moment();this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x95')]=_0x2e0b39[_0xa524('0x3c')](_0xa524('0x4a'));this[_0xa524('0x12')][_0xb2ebd5['uniqueid']][_0xa524('0x57')]=_0x2e0b39[_0xa524('0x69')](this['channels'][_0xb2ebd5[_0xa524('0x32')]]['starttime'],_0xa524('0x59'));if(this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x61')]){this[_0xa524('0x12')][_0xb2ebd5['uniqueid']][_0xa524('0x96')]=_0x2e0b39[_0xa524('0x69')](this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x62')],_0xa524('0x59'));this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x63')]=this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x57')]-this[_0xa524('0x12')][_0xb2ebd5[_0xa524('0x32')]][_0xa524('0x96')];}if(_0xb2ebd5[_0xa524('0x48')]==='from-sip'){if(this['agents'][_0xb2ebd5[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]){this['agents'][_0xb2ebd5[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]]=_[_0xa524('0x97')](this[_0xa524('0x13')][_0xb2ebd5['channel'][_0xa524('0x38')]('-')[0x0]],[_0xa524('0x3b')]);logger['debug'](_0xa524('0x98'),_0xb2ebd5[_0xa524('0x32')],util[_0xa524('0x2b')]({'id':this['agents'][_0xb2ebd5[_0xa524('0x3e')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xa524('0x13')][_0xb2ebd5[_0xa524('0x3e')]['split']('-')[0x0]][_0xa524('0x41')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xa524('0x3c')](_0xa524('0x3d'),this[_0xa524('0x13')][_0xb2ebd5[_0xa524('0x3e')][_0xa524('0x38')]('-')[0x0]][_0xa524('0x3f')]),_0xa524('0x99'),{'id':this[_0xa524('0x13')][_0xb2ebd5[_0xa524('0x3e')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xa524('0x13')][_0xb2ebd5['channel'][_0xa524('0x38')]('-')[0x0]][_0xa524('0x41')]});for(var _0x58db82=0x0;_0x58db820x0?_0x531808:0x0;this[_0x974f('0x14')][_0x5cfc5a['queue']][_0x974f('0x2f')]=this[_0x974f('0x14')][_0x5cfc5a[_0x974f('0x69')]][_0x974f('0x2f')]>_[_0x974f('0x6e')](_0x5cfc5a['loggedin'])?_['toNumber'](_0x5cfc5a['loggedin']):this['voiceQueues'][_0x5cfc5a['queue']][_0x974f('0x2f')];this['emitVoiceQueueSummary'](this[_0x974f('0x14')][_0x5cfc5a[_0x974f('0x69')]],'queuesummary');}logger[_0x974f('0x47')](_0x974f('0x71'),util['inspect'](this[_0x974f('0x14')][_0x5cfc5a[_0x974f('0x69')]],{'showHidden':![],'depth':null}));ami[_0x974f('0x45')](_0x974f('0x72'),this[_0x974f('0x14')][_0x5cfc5a['queue']]);}}}catch(_0x1d6f7b){logger[_0x974f('0x3a')](_0x974f('0x68'),util[_0x974f('0x3e')](_0x1d6f7b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x974f('0xc')][_0x974f('0x1a')]=function(_0x9261b8){logger[_0x974f('0x47')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x974f('0x3e')](_0x9261b8,{'showHidden':![],'depth':null}));ami[_0x974f('0x45')](_0x974f('0x73'),{});this[_0x974f('0x15')]=!![];};VoiceQueueReport[_0x974f('0xc')][_0x974f('0x1c')]=function(_0x2641c9){try{if(this[_0x974f('0x63')](_0x2641c9)){logger[_0x974f('0x47')](_0x974f('0x74'),_0x2641c9[_0x974f('0x4a')],util[_0x974f('0x3e')](_0x2641c9,{'showHidden':![],'depth':null}));if(_[_0x974f('0x64')](this[_0x974f('0x3c')][_0x2641c9[_0x974f('0x4a')]]))this['queueReports'][_0x2641c9[_0x974f('0x4a')]]=[];if(_[_0x974f('0x64')](this['channels'][_0x2641c9[_0x974f('0x4a')]]))this[_0x974f('0x12')][_0x2641c9[_0x974f('0x4a')]]={};var _0x31eaca=new QueueReport();_0x31eaca[_0x974f('0x50')]=_0x2641c9[_0x974f('0x69')];_0x31eaca['type']=this['voiceQueues'][_0x31eaca[_0x974f('0x50')]]&&this[_0x974f('0x14')][_0x31eaca[_0x974f('0x50')]][_0x974f('0x53')]?this[_0x974f('0x14')][_0x31eaca[_0x974f('0x50')]][_0x974f('0x53')]||_0x974f('0x54'):_0x974f('0x54');_0x31eaca[_0x974f('0x69')]=_0x2641c9[_0x974f('0x69')];_0x31eaca[_0x974f('0x75')]=moment()[_0x974f('0x4f')](_0x974f('0x76'));_0x31eaca[_0x974f('0x77')]=_0x2641c9[_0x974f('0x77')];_0x31eaca['count']=_0x2641c9[_0x974f('0x78')];_0x31eaca[_0x974f('0x4a')]=_0x2641c9['uniqueid'];_0x31eaca['routealias']=this[_0x974f('0x12')][_0x2641c9['uniqueid']][_0x974f('0x79')];logger['info'](_0x974f('0x7a'),_0x31eaca[_0x974f('0x50')],_0x31eaca[_0x974f('0x53')]);_[_0x974f('0x7b')](_0x31eaca,_[_0x974f('0x7c')](_0x2641c9,_['keys'](_0x31eaca)));this['queueReports'][_0x2641c9[_0x974f('0x4a')]][_0x974f('0x7d')](_0x31eaca);this[_0x974f('0x12')][_0x2641c9[_0x974f('0x4a')]]=_0x31eaca;this[_0x974f('0x46')](_0x31eaca,_0x974f('0x1b'));}}catch(_0x4f5ca2){logger['error'](_0x974f('0x74'),_0x2641c9[_0x974f('0x4a')],util[_0x974f('0x3e')](_0x4f5ca2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x974f('0xc')][_0x974f('0x1e')]=function(_0x18bd61){try{if(this[_0x974f('0x63')](_0x18bd61)){logger[_0x974f('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x18bd61[_0x974f('0x4a')],util['inspect'](_0x18bd61,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x18bd61['uniqueid']]){var _0x29041d=_[_0x974f('0x7e')](this['queueReports'][_0x18bd61[_0x974f('0x4a')]]);_0x29041d['queuecallercomplete']=![];_0x29041d['queuecallercompleteAt']=null;_0x29041d[_0x974f('0x7f')]=_0x18bd61['holdtime'];_0x29041d[_0x974f('0x80')]=_0x18bd61[_0x974f('0x80')];_0x29041d[_0x974f('0x1d')]=!![];_0x29041d[_0x974f('0x81')]=moment()[_0x974f('0x4f')](_0x974f('0x76'));_0x29041d[_0x974f('0x82')]=_0x974f('0x83');_0x29041d[_0x974f('0x84')]=null;logger[_0x974f('0x6a')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x29041d[_0x974f('0x50')],_0x29041d[_0x974f('0x53')]);this[_0x974f('0x12')][_0x18bd61[_0x974f('0x4a')]]=_0x29041d;this[_0x974f('0x43')](_0x29041d,_0x974f('0x1d'));}}}catch(_0x4862c0){logger[_0x974f('0x3a')](_0x974f('0x85'),_0x18bd61[_0x974f('0x4a')],util[_0x974f('0x3e')](_0x4862c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x974f('0xc')][_0x974f('0x1f')]=function(_0x11eb64){try{if(this['isNotNull'](_0x11eb64)){logger[_0x974f('0x47')](_0x974f('0x86'),_0x11eb64[_0x974f('0x4a')],util['inspect'](_0x11eb64,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x11eb64[_0x974f('0x4a')]]){var _0x54d27d=_[_0x974f('0x7e')](this[_0x974f('0x3c')][_0x11eb64['uniqueid']]);_0x54d27d[_0x974f('0x87')]=moment()[_0x974f('0x4f')](_0x974f('0x76'));_0x54d27d[_0x974f('0x88')]=_0x11eb64['connectedlinenum'];_0x54d27d['connectedlinename']=_0x11eb64['connectedlinename'];logger[_0x974f('0x6a')](_0x974f('0x89'),_0x54d27d[_0x974f('0x50')],_0x54d27d['type'],_0x11eb64[_0x974f('0x88')],_0x11eb64[_0x974f('0x8a')]);this['channels'][_0x11eb64[_0x974f('0x4a')]]=_0x54d27d;this[_0x974f('0x46')](_0x54d27d,'queuecallerleave');}}}catch(_0x2b0eaf){logger[_0x974f('0x3a')](_0x974f('0x86'),_0x11eb64[_0x974f('0x4a')],util[_0x974f('0x3e')](_0x2b0eaf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x974f('0xc')]['syncAgentConnect']=function(_0x2c8dd2){try{if(this[_0x974f('0x63')](_0x2c8dd2)){logger['debug'](_0x974f('0x8b'),_0x2c8dd2[_0x974f('0x4a')],util[_0x974f('0x3e')](_0x2c8dd2,{'showHidden':![],'depth':null}));if(this[_0x974f('0x3c')][_0x2c8dd2[_0x974f('0x4a')]]){var _0x5db262=_['last'](this[_0x974f('0x3c')][_0x2c8dd2['uniqueid']]);_0x5db262[_0x974f('0x8c')]=!![];_0x5db262['queuecallerexitreason']=_0x974f('0x8d');logger[_0x974f('0x6a')](_0x974f('0x8e'),_0x5db262[_0x974f('0x50')],_0x5db262[_0x974f('0x53')]);}}}catch(_0x298377){logger[_0x974f('0x3a')](_0x974f('0x8b'),_0x2c8dd2['uniqueid'],util[_0x974f('0x3e')](_0x298377,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x974f('0xc')][_0x974f('0x21')]=function(_0x1827fb){try{if(this[_0x974f('0x63')](_0x1827fb)){logger[_0x974f('0x47')](_0x974f('0x8f'),_0x1827fb[_0x974f('0x4a')],util['inspect'](_0x1827fb,{'showHidden':![],'depth':null}));if(this[_0x974f('0x3c')][_0x1827fb['uniqueid']]){var _0x3b48e9=_['last'](this['queueReports'][_0x1827fb[_0x974f('0x4a')]]);_0x3b48e9['queuecallerabandon']=![];_0x3b48e9[_0x974f('0x81')]=null;_0x3b48e9[_0x974f('0x90')]=!![];_0x3b48e9['lastAssignedTo']=_0x1827fb[_0x974f('0x91')];_0x3b48e9['holdtime']=_0x1827fb[_0x974f('0x7f')];_0x3b48e9[_0x974f('0x8c')]=!![];_0x3b48e9['queuecallerexit']=![];_0x3b48e9[_0x974f('0x92')]=null;if(!_0x3b48e9[_0x974f('0x93')]){if(_0x1827fb[_0x974f('0x94')]=='transfer'){_0x3b48e9[_0x974f('0x82')]='COMPLETED';logger[_0x974f('0x6a')](_0x974f('0x95'),_0x3b48e9['name'],_0x3b48e9[_0x974f('0x53')]);}else{if(_[_0x974f('0x96')](_0x1827fb[_0x974f('0x36')][_0x974f('0x97')](),_0x974f('0x98'))){if(this[_0x974f('0x3c')][_0x1827fb[_0x974f('0x99')]]){var _0x36b25d=_[_0x974f('0x7e')](this['queueReports'][_0x1827fb['linkedid']]);_0x36b25d[_0x974f('0x8c')]=![];_0x36b25d['queuecallerexit']=!![];_0x36b25d[_0x974f('0x92')]=moment(_0x3b48e9['queuecallerjoinAt'])[_0x974f('0x9a')](_0x1827fb[_0x974f('0x7f')],_0x974f('0x9b'))[_0x974f('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x36b25d[_0x974f('0x82')]=_0x974f('0x9c');_0x36b25d['transfer']=!![];_0x36b25d['transfertype']=_0x974f('0x9d');_0x36b25d[_0x974f('0x9e')]=_0x1827fb['destexten'];_0x36b25d[_0x974f('0x9f')]=_0x1827fb['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x36b25d[_0x974f('0x50')],_0x36b25d[_0x974f('0x53')]);var _0x24d3b7=this[_0x974f('0x3c')][_0x1827fb[_0x974f('0x99')]];this[_0x974f('0x3c')][_0x1827fb[_0x974f('0x99')]]=this[_0x974f('0x3c')][_0x1827fb['uniqueid']];this[_0x974f('0x3c')][_0x1827fb[_0x974f('0x4a')]]=_0x24d3b7;}}else{_0x3b48e9[_0x974f('0x82')]=_0x974f('0xa0')+_0x1827fb['reason']['toUpperCase']();logger[_0x974f('0x6a')](_0x974f('0xa1'),_0x3b48e9[_0x974f('0x50')],_0x3b48e9[_0x974f('0x53')],_0x3b48e9[_0x974f('0x82')]);}}}this[_0x974f('0x12')][_0x1827fb['uniqueid']]=_0x3b48e9;this[_0x974f('0x43')](_0x3b48e9,'agentcomplete');}}}catch(_0x259b8c){logger[_0x974f('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x1827fb[_0x974f('0x4a')],util[_0x974f('0x3e')](_0x259b8c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x4c51c2){try{if(this[_0x974f('0x63')](_0x4c51c2)){logger[_0x974f('0x47')](_0x974f('0xa2'),_0x4c51c2[_0x974f('0x4a')],util[_0x974f('0x3e')](_0x4c51c2,{'showHidden':![],'depth':null}));this[_0x974f('0xa3')](_0x4c51c2[_0x974f('0x4a')],_[_0x974f('0xa4')](_0x4c51c2[_0x974f('0xa5')])[0x0],_0x4c51c2[_0x974f('0xa6')]);if(this[_0x974f('0x3c')][_0x4c51c2[_0x974f('0x4a')]]){var _0x459c21=_[_0x974f('0x7e')](this[_0x974f('0x3c')][_0x4c51c2[_0x974f('0x4a')]]);if(_0x459c21){if(this['isNotNull'](_0x4c51c2[_0x974f('0xa5')])&&this[_0x974f('0x63')](_0x4c51c2[_0x974f('0xa5')][_0x974f('0xa7')])){switch(_0x4c51c2[_0x974f('0xa6')]){case _0x974f('0xa8'):_0x459c21[_0x974f('0xa9')]=![];_0x459c21[_0x974f('0x92')]=null;break;case _0x974f('0xaa'):_0x459c21[_0x974f('0xab')]='timeout';_0x459c21[_0x974f('0xa9')]=!![];_0x459c21[_0x974f('0x92')]=moment()[_0x974f('0x4f')](_0x974f('0x76'));_0x459c21[_0x974f('0x87')]=moment()['format'](_0x974f('0x76'));logger[_0x974f('0x47')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4c51c2[_0x974f('0x4a')],util['inspect'](_0x459c21,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x459c21);break;default:_0x459c21['queuecallerexit']=!![];_0x459c21[_0x974f('0x92')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x459c21[_0x974f('0x87')]=moment()[_0x974f('0x4f')](_0x974f('0x76'));}_0x459c21[_0x974f('0x1d')]=![];_0x459c21[_0x974f('0x81')]=null;_0x459c21[_0x974f('0x82')]=_0x4c51c2[_0x974f('0xa6')];this[_0x974f('0x12')][_0x4c51c2[_0x974f('0x4a')]]=_0x459c21;this[_0x974f('0x43')](_0x459c21,'varset');}else if(this['isNotNull'](_0x4c51c2[_0x974f('0xa5')])&&this[_0x974f('0x63')](_0x4c51c2['variable'][_0x974f('0xac')])){if(!_0x459c21[_0x974f('0x1d')]){_0x459c21[_0x974f('0xa9')]=!![];_0x459c21[_0x974f('0x92')]=moment()['format'](_0x974f('0x76'));_0x459c21[_0x974f('0x82')]=_0x974f('0xad');_0x459c21['queuecallerleaveAt']=moment()[_0x974f('0x4f')](_0x974f('0x76'));this[_0x974f('0x12')][_0x4c51c2[_0x974f('0x4a')]]=_0x459c21;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x4c51c2['uniqueid'],_0x459c21['name'],_0x459c21[_0x974f('0x53')],_[_0x974f('0xa4')](_0x4c51c2['variable'])[0x0],_0x4c51c2['value']);_0x459c21[_0x974f('0x3f')]=this['variables'][_0x4c51c2[_0x974f('0x4a')]];}}}}catch(_0xb4dc2f){logger['error']('[%s][voiceQueueReport][varset]',_0x4c51c2[_0x974f('0x4a')],util[_0x974f('0x3e')](_0xb4dc2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x974f('0xa3')]=function(_0xa0fd04,_0x551b6c,_0x251a72){var _0x49ef7b=[_0x974f('0xae'),'rtpaudioqosbridged',_0x974f('0xaf'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x974f('0xb0'),_0x974f('0xb1'),_0x974f('0xb2'),'sipcallid',_0x974f('0xb3'),'bridgepeer',_0x974f('0xb4'),'membercalls','memberdynamic',_0x974f('0xb5'),_0x974f('0xb6'),'membername',_0x974f('0xb7'),_0x974f('0xb8')];if(!_['isNil'](_0x551b6c)&&!_[_0x974f('0xb9')](_0x49ef7b,_0x551b6c)){if(_[_0x974f('0x64')](this[_0x974f('0x3f')][_0xa0fd04])){this[_0x974f('0x3f')][_0xa0fd04]={};}this['variables'][_0xa0fd04][_0x551b6c]=_0x251a72;}};VoiceQueueReport[_0x974f('0xc')][_0x974f('0xba')]=function(_0x7e5bb4,_0x2b3ffa,_0x16a83e){var _0x4a5c00={};for(var _0x18fb5f=0x0;_0x18fb5f0x0?_0x5aea98:0x0;this[_0xe58a('0x13')][_0x1709b2[_0xe58a('0x67')]][_0xe58a('0x2d')]=this[_0xe58a('0x13')][_0x1709b2[_0xe58a('0x67')]][_0xe58a('0x2d')]>_[_0xe58a('0x6d')](_0x1709b2[_0xe58a('0x6e')])?_[_0xe58a('0x6d')](_0x1709b2[_0xe58a('0x6e')]):this[_0xe58a('0x13')][_0x1709b2[_0xe58a('0x67')]]['talking'];this[_0xe58a('0x51')](this['voiceQueues'][_0x1709b2['queue']],_0xe58a('0x17'));}logger['debug'](_0xe58a('0x6f'),util['inspect'](this[_0xe58a('0x13')][_0x1709b2[_0xe58a('0x67')]],{'showHidden':![],'depth':null}));ami[_0xe58a('0x42')](_0xe58a('0x70'),this[_0xe58a('0x13')][_0x1709b2['queue']]);}}}catch(_0x288fdb){logger[_0xe58a('0x3a')](_0xe58a('0x71'),util[_0xe58a('0x39')](_0x288fdb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe58a('0xb')]['syncQueueSummaryComplete']=function(_0x33fddb){logger[_0xe58a('0x4b')](_0xe58a('0x72'),util[_0xe58a('0x39')](_0x33fddb,{'showHidden':![],'depth':null}));ami['emit'](_0xe58a('0x73'),{});this[_0xe58a('0x14')]=!![];};VoiceQueueReport['prototype'][_0xe58a('0x74')]=function(_0x27415c){try{if(this[_0xe58a('0x62')](_0x27415c)){logger['debug'](_0xe58a('0x75'),_0x27415c[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x27415c,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x27415c[_0xe58a('0x46')]]))this['queueReports'][_0x27415c['uniqueid']]=[];if(_[_0xe58a('0x63')](this[_0xe58a('0x11')][_0x27415c[_0xe58a('0x46')]]))this[_0xe58a('0x11')][_0x27415c[_0xe58a('0x46')]]={};var _0x20ac03=new QueueReport();_0x20ac03['name']=_0x27415c['queue'];_0x20ac03['type']=this[_0xe58a('0x13')][_0x20ac03[_0xe58a('0x48')]]&&this[_0xe58a('0x13')][_0x20ac03[_0xe58a('0x48')]][_0xe58a('0x52')]?this[_0xe58a('0x13')][_0x20ac03['name']][_0xe58a('0x52')]||'inbound':'inbound';_0x20ac03[_0xe58a('0x67')]=_0x27415c['queue'];_0x20ac03[_0xe58a('0x76')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x20ac03[_0xe58a('0x77')]=_0x27415c[_0xe58a('0x77')];_0x20ac03[_0xe58a('0x78')]=_0x27415c[_0xe58a('0x78')];_0x20ac03[_0xe58a('0x46')]=_0x27415c[_0xe58a('0x46')];_0x20ac03['routealias']=this[_0xe58a('0x11')][_0x27415c[_0xe58a('0x46')]][_0xe58a('0x79')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x20ac03[_0xe58a('0x48')],_0x20ac03[_0xe58a('0x52')]);_[_0xe58a('0x7a')](_0x20ac03,_[_0xe58a('0x7b')](_0x27415c,_[_0xe58a('0x7c')](_0x20ac03)));this[_0xe58a('0xf')][_0x27415c[_0xe58a('0x46')]][_0xe58a('0x7d')](_0x20ac03);this['channels'][_0x27415c['uniqueid']]=_0x20ac03;this['emitVoiceQueueChannelSave'](_0x20ac03,_0xe58a('0x1a'));}}catch(_0x502b7b){logger[_0xe58a('0x3a')](_0xe58a('0x75'),_0x27415c['uniqueid'],util[_0xe58a('0x39')](_0x502b7b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe58a('0xb')][_0xe58a('0x1b')]=function(_0x345929){try{if(this['isNotNull'](_0x345929)){logger[_0xe58a('0x4b')](_0xe58a('0x7e'),_0x345929[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x345929,{'showHidden':![],'depth':null}));if(this[_0xe58a('0xf')][_0x345929[_0xe58a('0x46')]]){var _0x1f91a2=_['last'](this[_0xe58a('0xf')][_0x345929[_0xe58a('0x46')]]);_0x1f91a2[_0xe58a('0x7f')]=![];_0x1f91a2[_0xe58a('0x80')]=null;_0x1f91a2[_0xe58a('0x81')]=_0x345929[_0xe58a('0x81')];_0x1f91a2[_0xe58a('0x82')]=_0x345929[_0xe58a('0x82')];_0x1f91a2[_0xe58a('0x83')]=!![];_0x1f91a2[_0xe58a('0x84')]=moment()['format'](_0xe58a('0x85'));_0x1f91a2[_0xe58a('0x4d')]=_0xe58a('0x86');_0x1f91a2['lastAssignedTo']=null;logger[_0xe58a('0x69')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x1f91a2[_0xe58a('0x48')],_0x1f91a2[_0xe58a('0x52')]);this[_0xe58a('0x11')][_0x345929[_0xe58a('0x46')]]=_0x1f91a2;this[_0xe58a('0x40')](_0x1f91a2,'queuecallerabandon');}}}catch(_0x41fe88){logger[_0xe58a('0x3a')](_0xe58a('0x7e'),_0x345929[_0xe58a('0x46')],util['inspect'](_0x41fe88,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe58a('0xb')][_0xe58a('0x87')]=function(_0x21cb1a){try{if(this[_0xe58a('0x62')](_0x21cb1a)){logger[_0xe58a('0x4b')]('[%s][voiceQueueReport][queuecallerleave]',_0x21cb1a[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x21cb1a,{'showHidden':![],'depth':null}));if(this[_0xe58a('0xf')][_0x21cb1a[_0xe58a('0x46')]]){var _0x1d85bf=_[_0xe58a('0x88')](this[_0xe58a('0xf')][_0x21cb1a[_0xe58a('0x46')]]);_0x1d85bf['queuecallerleaveAt']=moment()[_0xe58a('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d85bf[_0xe58a('0x89')]=_0x21cb1a[_0xe58a('0x89')];_0x1d85bf[_0xe58a('0x8a')]=_0x21cb1a[_0xe58a('0x8a')];logger[_0xe58a('0x69')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1d85bf[_0xe58a('0x48')],_0x1d85bf[_0xe58a('0x52')],_0x21cb1a[_0xe58a('0x89')],_0x21cb1a[_0xe58a('0x8a')]);this[_0xe58a('0x11')][_0x21cb1a[_0xe58a('0x46')]]=_0x1d85bf;this[_0xe58a('0x43')](_0x1d85bf,'queuecallerleave');}}}catch(_0x27d09f){logger[_0xe58a('0x3a')](_0xe58a('0x8b'),_0x21cb1a['uniqueid'],util[_0xe58a('0x39')](_0x27d09f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe58a('0xb')][_0xe58a('0x1f')]=function(_0x213bb8){try{if(this[_0xe58a('0x62')](_0x213bb8)){logger[_0xe58a('0x4b')]('[%s][voiceQueueReport][agentconnect]',_0x213bb8[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x213bb8,{'showHidden':![],'depth':null}));if(this[_0xe58a('0xf')][_0x213bb8[_0xe58a('0x46')]]){var _0x463786=_[_0xe58a('0x88')](this[_0xe58a('0xf')][_0x213bb8[_0xe58a('0x46')]]);_0x463786[_0xe58a('0x7f')]=!![];_0x463786[_0xe58a('0x4d')]=_0xe58a('0x8c');logger[_0xe58a('0x69')](_0xe58a('0x8d'),_0x463786[_0xe58a('0x48')],_0x463786[_0xe58a('0x52')]);}}}catch(_0x190aa4){logger[_0xe58a('0x3a')](_0xe58a('0x8e'),_0x213bb8[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x190aa4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe58a('0xb')][_0xe58a('0x8f')]=function(_0x534c1d){try{if(this['isNotNull'](_0x534c1d)){logger[_0xe58a('0x4b')](_0xe58a('0x90'),_0x534c1d[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x534c1d,{'showHidden':![],'depth':null}));if(this[_0xe58a('0xf')][_0x534c1d[_0xe58a('0x46')]]){var _0xd91f7b=_[_0xe58a('0x88')](this[_0xe58a('0xf')][_0x534c1d[_0xe58a('0x46')]]);_0xd91f7b[_0xe58a('0x83')]=![];_0xd91f7b['queuecallerabandonAt']=null;_0xd91f7b[_0xe58a('0x91')]=!![];_0xd91f7b[_0xe58a('0x92')]=_0x534c1d[_0xe58a('0x93')];_0xd91f7b['holdtime']=_0x534c1d['holdtime'];_0xd91f7b['queuecallercomplete']=!![];_0xd91f7b[_0xe58a('0x94')]=![];_0xd91f7b[_0xe58a('0x95')]=null;if(!_0xd91f7b[_0xe58a('0x96')]){if(_0x534c1d['reason']==_0xe58a('0x96')){_0xd91f7b[_0xe58a('0x4d')]='COMPLETED';logger[_0xe58a('0x69')](_0xe58a('0x97'),_0xd91f7b['name'],_0xd91f7b[_0xe58a('0x52')]);}else{if(_[_0xe58a('0x98')](_0x534c1d['channel']['toLowerCase'](),_0xe58a('0x99'))){if(this[_0xe58a('0xf')][_0x534c1d[_0xe58a('0x9a')]]){var _0x444221=_['last'](this[_0xe58a('0xf')][_0x534c1d[_0xe58a('0x9a')]]);_0x444221[_0xe58a('0x7f')]=![];_0x444221[_0xe58a('0x94')]=!![];_0x444221[_0xe58a('0x95')]=moment(_0xd91f7b['queuecallerjoinAt'])[_0xe58a('0x9b')](_0x534c1d[_0xe58a('0x81')],'seconds')[_0xe58a('0x4f')](_0xe58a('0x85'));_0x444221[_0xe58a('0x4d')]='FORWARDTRANSFER';_0x444221[_0xe58a('0x96')]=!![];_0x444221[_0xe58a('0x9c')]='FORWARD';_0x444221[_0xe58a('0x9d')]=_0x534c1d[_0xe58a('0x9e')];_0x444221[_0xe58a('0x9f')]=_0x534c1d[_0xe58a('0x46')];logger['info'](_0xe58a('0xa0'),_0x444221[_0xe58a('0x48')],_0x444221[_0xe58a('0x52')]);var _0x26a44e=this[_0xe58a('0xf')][_0x534c1d['linkedid']];this[_0xe58a('0xf')][_0x534c1d[_0xe58a('0x9a')]]=this['queueReports'][_0x534c1d[_0xe58a('0x46')]];this[_0xe58a('0xf')][_0x534c1d[_0xe58a('0x46')]]=_0x26a44e;}}else{_0xd91f7b[_0xe58a('0x4d')]='COMPLETEDBY'+_0x534c1d[_0xe58a('0xa1')][_0xe58a('0xa2')]();logger[_0xe58a('0x69')](_0xe58a('0xa3'),_0xd91f7b[_0xe58a('0x48')],_0xd91f7b['type'],_0xd91f7b[_0xe58a('0x4d')]);}}}this[_0xe58a('0x11')][_0x534c1d[_0xe58a('0x46')]]=_0xd91f7b;this['emitVoiceQueueChannelRemove'](_0xd91f7b,_0xe58a('0x1d'));}}}catch(_0x943274){logger['error'](_0xe58a('0x90'),_0x534c1d['uniqueid'],util[_0xe58a('0x39')](_0x943274,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe58a('0xb')][_0xe58a('0x20')]=function(_0x2d879b){try{if(this[_0xe58a('0x62')](_0x2d879b)){logger[_0xe58a('0x4b')](_0xe58a('0xa4'),_0x2d879b[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x2d879b,{'showHidden':![],'depth':null}));this[_0xe58a('0xa5')](_0x2d879b['uniqueid'],_[_0xe58a('0x7c')](_0x2d879b[_0xe58a('0xa6')])[0x0],_0x2d879b[_0xe58a('0xa7')]);if(this[_0xe58a('0xf')][_0x2d879b[_0xe58a('0x46')]]){var _0x181d40=_[_0xe58a('0x88')](this[_0xe58a('0xf')][_0x2d879b['uniqueid']]);if(_0x181d40){if(this[_0xe58a('0x62')](_0x2d879b[_0xe58a('0xa6')])&&this[_0xe58a('0x62')](_0x2d879b[_0xe58a('0xa6')][_0xe58a('0xa8')])){switch(_0x2d879b[_0xe58a('0xa7')]){case _0xe58a('0xa9'):_0x181d40[_0xe58a('0x94')]=![];_0x181d40[_0xe58a('0x95')]=null;break;case _0xe58a('0xaa'):_0x181d40[_0xe58a('0xab')]=_0xe58a('0xac');_0x181d40[_0xe58a('0x94')]=!![];_0x181d40['queuecallerexitAt']=moment()[_0xe58a('0x4f')](_0xe58a('0x85'));_0x181d40['queuecallerleaveAt']=moment()[_0xe58a('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xe58a('0x4b')](_0xe58a('0xad'),_0x2d879b[_0xe58a('0x46')],util[_0xe58a('0x39')](_0x181d40,{'showHidden':![],'depth':null}));ami[_0xe58a('0x42')](_0xe58a('0xae'),_0x181d40);break;default:_0x181d40[_0xe58a('0x94')]=!![];_0x181d40[_0xe58a('0x95')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x181d40['queuecallerleaveAt']=moment()[_0xe58a('0x4f')](_0xe58a('0x85'));}_0x181d40[_0xe58a('0x83')]=![];_0x181d40[_0xe58a('0x84')]=null;_0x181d40[_0xe58a('0x4d')]=_0x2d879b[_0xe58a('0xa7')];this[_0xe58a('0x11')][_0x2d879b[_0xe58a('0x46')]]=_0x181d40;this[_0xe58a('0x40')](_0x181d40,_0xe58a('0xaf'));}else if(this['isNotNull'](_0x2d879b['variable'])&&this[_0xe58a('0x62')](_0x2d879b[_0xe58a('0xa6')][_0xe58a('0xb0')])){if(!_0x181d40['queuecallerabandon']){_0x181d40[_0xe58a('0x94')]=!![];_0x181d40[_0xe58a('0x95')]=moment()[_0xe58a('0x4f')](_0xe58a('0x85'));_0x181d40[_0xe58a('0x4d')]='EXITWITHKEY';_0x181d40[_0xe58a('0xb1')]=moment()[_0xe58a('0x4f')](_0xe58a('0x85'));this[_0xe58a('0x11')][_0x2d879b[_0xe58a('0x46')]]=_0x181d40;}}logger['info'](_0xe58a('0xb2'),_0x2d879b['uniqueid'],_0x181d40[_0xe58a('0x48')],_0x181d40['type'],_['keys'](_0x2d879b[_0xe58a('0xa6')])[0x0],_0x2d879b[_0xe58a('0xa7')]);_0x181d40[_0xe58a('0x16')]=this[_0xe58a('0x16')][_0x2d879b[_0xe58a('0x46')]];}}}}catch(_0xa01d10){logger[_0xe58a('0x3a')]('[%s][voiceQueueReport][varset]',_0x2d879b['uniqueid'],util['inspect'](_0xa01d10,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe58a('0xb')]['addVariable']=function(_0x478288,_0x4e2b1b,_0x1970a6){var _0x38d316=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0xe58a('0xb3'),'rtpaudioqosloss',_0xe58a('0xb4'),_0xe58a('0xb5'),_0xe58a('0xb6'),'sipcallid',_0xe58a('0xb7'),_0xe58a('0xb8'),'bridgepvtcallid',_0xe58a('0xb9'),_0xe58a('0xba'),'memberinterface','memberlastcall',_0xe58a('0x93'),_0xe58a('0xbb'),_0xe58a('0xbc')];if(!_[_0xe58a('0x34')](_0x4e2b1b)&&!_[_0xe58a('0xbd')](_0x38d316,_0x4e2b1b)){if(_[_0xe58a('0x63')](this['variables'][_0x478288])){this['variables'][_0x478288]={};}this[_0xe58a('0x16')][_0x478288][_0x4e2b1b]=_0x1970a6;}};VoiceQueueReport[_0xe58a('0xb')][_0xe58a('0xbe')]=function(_0x2c4df9,_0x15b1f9,_0x22e3b0){var _0x19ed8b={};for(var _0x536769=0x0;_0x536769=0x0?moment(_0x28ba2d[_0x35d3('0x17')])[_0x35d3('0x18')](_0x28ba2d[_0x35d3('0x16')],_0x35d3('0xd')):null,'data1':_0x35d3('0x19'),'data2':_0x28ba2d[_0x35d3('0x13')],'data3':_0x28ba2d[_0x35d3('0x10')],'data4':_0x28ba2d[_0x35d3('0x1a')]||null,'role':_0x35d3('0x1b'),'internal':_0x28ba2d[_0x35d3('0x13')]?_[_0x35d3('0x12')](_0x28ba2d[_0x35d3('0x13')]):undefined,'uniqueid':_0x28ba2d[_0x35d3('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x2c89=['diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport','CreateMemberReport','starttime','endtime','outbound','dialstring','uniqueid','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING'];(function(_0x1b7762,_0x1fcd2b){var _0x27c1e3=function(_0x5eb5da){while(--_0x5eb5da){_0x1b7762['push'](_0x1b7762['shift']());}};_0x27c1e3(++_0x1fcd2b);}(_0x2c89,0x109));var _0x92c8=function(_0x5a5bc5,_0x37d8b4){_0x5a5bc5=_0x5a5bc5-0x0;var _0x421c1a=_0x2c89[_0x5a5bc5];return _0x421c1a;};'use strict';var moment=require(_0x92c8('0x0'));var _=require(_0x92c8('0x1'));var util=require(_0x92c8('0x2'));var client=require('../client');exports[_0x92c8('0x3')]=function(_0x3f6866){var _0x55db50=_0x3f6866[_0x92c8('0x4')]||_0x3f6866[_0x92c8('0x5')];return client[_0x92c8('0x6')]('CreateMemberReport',{'body':{'channel':_0x92c8('0x7'),'membername':_0x3f6866[_0x92c8('0x8')],'interface':_[_0x92c8('0x9')](_0x3f6866[_0x92c8('0xa')])?util[_0x92c8('0xb')](_0x92c8('0xc'),_0x3f6866[_0x92c8('0x8')]):_0x3f6866[_0x92c8('0xa')],'type':_0x92c8('0xd'),'enterAt':_0x3f6866['queuecallerleaveAt'],'exitAt':_0x55db50,'duration':moment(_0x55db50)[_0x92c8('0xe')](_0x3f6866[_0x92c8('0xf')],_0x92c8('0x10')),'data1':_0x92c8('0x11'),'data2':_0x3f6866[_0x92c8('0x12')],'data3':_0x3f6866[_0x92c8('0x13')],'data4':null,'data5':_0x3f6866[_0x92c8('0x14')],'role':_0x92c8('0x15'),'internal':_0x3f6866[_0x92c8('0x16')]?_[_0x92c8('0x17')](_0x3f6866['accountcode']):undefined,'uniqueid':_0x3f6866['uniqueid']},'log':'CreateMemberReport'});};exports[_0x92c8('0x18')]=function(_0x3d66bd){return client['Request'](_0x92c8('0x19'),{'body':{'channel':_0x92c8('0x7'),'membername':_0x3d66bd['membername'],'interface':_0x3d66bd['interface'],'type':_0x92c8('0xd'),'enterAt':_0x3d66bd[_0x92c8('0x1a')],'exitAt':_0x3d66bd[_0x92c8('0x1b')],'duration':moment(_0x3d66bd[_0x92c8('0x1b')])[_0x92c8('0xe')](_0x3d66bd[_0x92c8('0x1a')],_0x92c8('0x10'))>=0x0?moment(_0x3d66bd[_0x92c8('0x1b')])['diff'](_0x3d66bd[_0x92c8('0x1a')],'seconds'):null,'data1':_0x92c8('0x1c'),'data2':_0x3d66bd[_0x92c8('0x16')],'data3':_0x3d66bd[_0x92c8('0x13')],'data4':_0x3d66bd[_0x92c8('0x1d')]||null,'role':_0x92c8('0x15'),'internal':_0x3d66bd[_0x92c8('0x16')]?_[_0x92c8('0x17')](_0x3d66bd[_0x92c8('0x16')]):undefined,'uniqueid':_0x3d66bd[_0x92c8('0x1e')]},'log':_0x92c8('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 3f89f02..b0049f8 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 _0x24e9=['GetSettings','../client','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x13d9da,_0x4c969c){var _0x52c010=function(_0x55df6e){while(--_0x55df6e){_0x13d9da['push'](_0x13d9da['shift']());}};_0x52c010(++_0x4c969c);}(_0x24e9,0x85));var _0x924e=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x24e9[_0xdd2bfa];return _0x55397e;};'use strict';var client=require(_0x924e('0x0'));exports['getSettings']=function(){return client[_0x924e('0x1')](_0x924e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x924e('0x3'),_0x924e('0x4')]},'log':_0x924e('0x5')});}; \ No newline at end of file +var _0xb03e=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','getSettings'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xb03e,0x1eb));var _0xeb03=function(_0x483c67,_0x9b6206){_0x483c67=_0x483c67-0x0;var _0x3536e3=_0xb03e[_0x483c67];return _0x3536e3;};'use strict';var client=require('../client');exports[_0xeb03('0x0')]=function(){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xeb03('0x3'),_0xeb03('0x4')]},'log':_0xeb03('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index f607b38..97e2754 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 _0x553e=['html','../client','getTemplates','Request','GetTemplate'];(function(_0x3ab4af,_0x388a83){var _0x2b574c=function(_0x1306a2){while(--_0x1306a2){_0x3ab4af['push'](_0x3ab4af['shift']());}};_0x2b574c(++_0x388a83);}(_0x553e,0x10f));var _0xe553=function(_0x544f65,_0x301f9c){_0x544f65=_0x544f65-0x0;var _0x2dd8c2=_0x553e[_0x544f65];return _0x2dd8c2;};'use strict';var client=require(_0xe553('0x0'));exports[_0xe553('0x1')]=function(_0x2310ef){return function(_0x45ded7){return client[_0xe553('0x2')](_0xe553('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xe553('0x4')]},'log':_0xe553('0x3')});};}; \ No newline at end of file +var _0xa63e=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xa63e,0x145));var _0xea63=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa63e[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xea63('0x0'));exports[_0xea63('0x1')]=function(_0x3b2d4e){return function(_0x1fb605){return client[_0xea63('0x2')](_0xea63('0x3'),{'options':{'raw':!![],'attributes':['id',_0xea63('0x4'),_0xea63('0x5')]},'log':_0xea63('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index f014d35..57b1273 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 _0xfcf5=['channel','status','Condition','value','field','Action','Actions','action','data3','data4','data6','../client','getTriggers','Request','GetTrigger'];(function(_0x477d18,_0x50639d){var _0x5b27af=function(_0x130d5d){while(--_0x130d5d){_0x477d18['push'](_0x477d18['shift']());}};_0x5b27af(++_0x50639d);}(_0xfcf5,0x1a0));var _0x5fcf=function(_0x4d3c9c,_0x25d1ad){_0x4d3c9c=_0x4d3c9c-0x0;var _0x435258=_0xfcf5[_0x4d3c9c];return _0x435258;};'use strict';var client=require(_0x5fcf('0x0'));exports[_0x5fcf('0x1')]=function(_0x205e50){return function(_0x349ffd){return client[_0x5fcf('0x2')](_0x5fcf('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x5fcf('0x4'),_0x5fcf('0x5')],'include':[{'model':_0x5fcf('0x6'),'as':'AllConditions','attributes':['id','field','operator',_0x5fcf('0x7')]},{'model':_0x5fcf('0x6'),'as':'AnyConditions','attributes':['id',_0x5fcf('0x8'),'operator',_0x5fcf('0x7')]},{'model':_0x5fcf('0x9'),'as':_0x5fcf('0xa'),'attributes':['id',_0x5fcf('0xb'),'data1','data2',_0x5fcf('0xc'),_0x5fcf('0xd'),'data5',_0x5fcf('0xe'),'data7']}]},'log':_0x5fcf('0x3')});};}; \ No newline at end of file +var _0x134b=['name','channel','status','Condition','field','operator','value','Action','action','data1','data4','data6','data7','../client','getTriggers','Request','GetTrigger'];(function(_0x449157,_0x2596d9){var _0x387b0b=function(_0x57b00a){while(--_0x57b00a){_0x449157['push'](_0x449157['shift']());}};_0x387b0b(++_0x2596d9);}(_0x134b,0xc8));var _0xb134=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x134b[_0x2235bf];return _0x4c3a64;};'use strict';var client=require(_0xb134('0x0'));exports[_0xb134('0x1')]=function(_0xc2e00e){return function(_0x564597){return client[_0xb134('0x2')](_0xb134('0x3'),{'options':{'raw':![],'attributes':['id',_0xb134('0x4'),_0xb134('0x5'),_0xb134('0x6')],'include':[{'model':_0xb134('0x7'),'as':'AllConditions','attributes':['id',_0xb134('0x8'),_0xb134('0x9'),_0xb134('0xa')]},{'model':_0xb134('0x7'),'as':'AnyConditions','attributes':['id','field',_0xb134('0x9'),_0xb134('0xa')]},{'model':_0xb134('0xb'),'as':'Actions','attributes':['id',_0xb134('0xc'),_0xb134('0xd'),'data2','data3',_0xb134('0xe'),'data5',_0xb134('0xf'),_0xb134('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b8a94a2..9569959 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 _0x81f5=['getTrunks','Request','GetTrunk','registry','defaultuser','../client'];(function(_0x59db0f,_0x466ec8){var _0x2d3a0c=function(_0x5a1a4d){while(--_0x5a1a4d){_0x59db0f['push'](_0x59db0f['shift']());}};_0x2d3a0c(++_0x466ec8);}(_0x81f5,0x77));var _0x581f=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x81f5[_0x5c351c];return _0x26f3b3;};'use strict';var client=require(_0x581f('0x0'));exports[_0x581f('0x1')]=function(_0xa01349){return function(_0x190784){return client[_0x581f('0x2')](_0x581f('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x581f('0x4'),_0x581f('0x5')]},'log':_0x581f('0x3')});};}; \ No newline at end of file +var _0x7e8e=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7e8e,0x91));var _0xe7e8=function(_0x163977,_0x4ef72e){_0x163977=_0x163977-0x0;var _0x28bf3a=_0x7e8e[_0x163977];return _0x28bf3a;};'use strict';var client=require(_0xe7e8('0x0'));exports[_0xe7e8('0x1')]=function(_0x3cc021){return function(_0x396891){return client[_0xe7e8('0x2')](_0xe7e8('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe7e8('0x4'),_0xe7e8('0x5'),_0xe7e8('0x6')]},'log':_0xe7e8('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 4c013e3..b68c8d8 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(_0x275dc2,_0x1e915b){var _0x507904=function(_0x12c20b){while(--_0x12c20b){_0x275dc2['push'](_0x275dc2['shift']());}};_0x507904(++_0x1e915b);}(_0x70e0,0x17b));var _0x070e=function(_0x22004b,_0x2a4c2f){_0x22004b=_0x22004b-0x0;var _0x463760=_0x70e0[_0x22004b];return _0x463760;};'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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x598cc1,_0x1a3cab){var _0x17d2d0=function(_0x3311db){while(--_0x3311db){_0x598cc1['push'](_0x598cc1['shift']());}};_0x17d2d0(++_0x1a3cab);}(_0x34e8,0x12c));var _0x834e=function(_0xdd7cfa,_0x146c8e){_0xdd7cfa=_0xdd7cfa-0x0;var _0x327171=_0x34e8[_0xdd7cfa];return _0x327171;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4952ae7..dd49aa9 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 _0xe6c1=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0xb2a134,_0x41bfe8){var _0x2f7242=function(_0x249300){while(--_0x249300){_0xb2a134['push'](_0xb2a134['shift']());}};_0x2f7242(++_0x41bfe8);}(_0xe6c1,0x8d));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x1e6c('0x0'));exports['create']=function(_0x18c23d){return client[_0x1e6c('0x1')](_0x1e6c('0x2'),{'body':_0x18c23d,'log':_0x1e6c('0x2')});};exports[_0x1e6c('0x3')]=function(_0x1e8164,_0x49add6,_0x2426e6){return client[_0x1e6c('0x1')](_0x1e6c('0x4'),{'body':_0x1e8164,'options':{'where':{'uniqueid':_0x49add6,'interface':_0x2426e6,'agentcomplete':!![]}},'log':_0x1e6c('0x4')});}; \ No newline at end of file +var _0xe771=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x26af93,_0x17de65){var _0x3d058d=function(_0x4077b5){while(--_0x4077b5){_0x26af93['push'](_0x26af93['shift']());}};_0x3d058d(++_0x17de65);}(_0xe771,0x16c));var _0x1e77=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0xe771[_0x1e3671];return _0x48d5f5;};'use strict';var client=require(_0x1e77('0x0'));exports[_0x1e77('0x1')]=function(_0x16d21e){return client[_0x1e77('0x2')](_0x1e77('0x3'),{'body':_0x16d21e,'log':_0x1e77('0x3')});};exports[_0x1e77('0x4')]=function(_0x416001,_0xa730b,_0x47eac6){return client[_0x1e77('0x2')]('UpdateVoiceAgentReport',{'body':_0x416001,'options':{'where':{'uniqueid':_0xa730b,'interface':_0x47eac6,'agentcomplete':!![]}},'log':_0x1e77('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 061dbb6..9c2ad19 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 _0xa36d=['Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','duration','moment','util','lodash','../client','create'];(function(_0xaf198c,_0x2266c4){var _0x3d39aa=function(_0x41eac8){while(--_0x41eac8){_0xaf198c['push'](_0xaf198c['shift']());}};_0x3d39aa(++_0x2266c4);}(_0xa36d,0x14b));var _0xda36=function(_0xbe768e,_0x151c33){_0xbe768e=_0xbe768e-0x0;var _0x1e2a45=_0xa36d[_0xbe768e];return _0x1e2a45;};'use strict';var moment=require(_0xda36('0x0'));var util=require(_0xda36('0x1'));var _=require(_0xda36('0x2'));var client=require(_0xda36('0x3'));exports[_0xda36('0x4')]=function(_0x1e86b1){return client[_0xda36('0x5')](_0xda36('0x6'),{'body':_[_0xda36('0x7')](_0x1e86b1,{'source':_0x1e86b1[_0xda36('0x8')],'destinationcontext':_0x1e86b1[_0xda36('0x9')],'callerid':_0x1e86b1[_0xda36('0xa')],'amaflags':_0xda36('0xb')}),'log':'CreateVoiceCallReport'});};exports[_0xda36('0xc')]=function(){return function(){return client[_0xda36('0x5')](_0xda36('0xd'),{'options':{'where':{'type':[_0xda36('0xe')],'createdAt':{'$between':[moment()[_0xda36('0xf')]('day')[_0xda36('0x10')](_0xda36('0x11')),moment()[_0xda36('0x12')](_0xda36('0x13'))[_0xda36('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0xda36('0x14'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x5efe=['DOCUMENTATION','GetVoiceCallReport','startOf','day','format','endOf','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','callerid'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5efe,0x191));var _0xe5ef=function(_0x3d3f36,_0x4daa42){_0x3d3f36=_0x3d3f36-0x0;var _0x2f5ced=_0x5efe[_0x3d3f36];return _0x2f5ced;};'use strict';var moment=require(_0xe5ef('0x0'));var util=require(_0xe5ef('0x1'));var _=require(_0xe5ef('0x2'));var client=require(_0xe5ef('0x3'));exports['create']=function(_0x3232e4){return client[_0xe5ef('0x4')](_0xe5ef('0x5'),{'body':_['merge'](_0x3232e4,{'source':_0x3232e4['calleridnum'],'destinationcontext':_0x3232e4['context'],'callerid':_0x3232e4[_0xe5ef('0x6')],'amaflags':_0xe5ef('0x7')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0xe5ef('0x4')](_0xe5ef('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xe5ef('0x9')](_0xe5ef('0xa'))[_0xe5ef('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xe5ef('0xc')](_0xe5ef('0xa'))[_0xe5ef('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0xe5ef('0xd'),_0xe5ef('0xe'),_0xe5ef('0xf')]},'log':_0xe5ef('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c7ac8b9..211e97b 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 _0xf763=['CreateVoiceDialReport','../client','create','Request'];(function(_0x35b2a1,_0x4cdca8){var _0x6023da=function(_0x10cd9f){while(--_0x10cd9f){_0x35b2a1['push'](_0x35b2a1['shift']());}};_0x6023da(++_0x4cdca8);}(_0xf763,0x189));var _0x3f76=function(_0x17a0ab,_0x39d830){_0x17a0ab=_0x17a0ab-0x0;var _0x16127=_0xf763[_0x17a0ab];return _0x16127;};'use strict';var client=require(_0x3f76('0x0'));exports[_0x3f76('0x1')]=function(_0x5b2ede){return client[_0x3f76('0x2')](_0x3f76('0x3'),{'body':_0x5b2ede,'log':_0x3f76('0x3')});}; \ No newline at end of file +var _0x51d4=['Request','CreateVoiceDialReport','../client','create'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x51d4,0x192));var _0x451d=function(_0x3112b8,_0x3210dd){_0x3112b8=_0x3112b8-0x0;var _0x3131ca=_0x51d4[_0x3112b8];return _0x3131ca;};'use strict';var client=require(_0x451d('0x0'));exports[_0x451d('0x1')]=function(_0x54bd55){return client[_0x451d('0x2')](_0x451d('0x3'),{'body':_0x54bd55,'log':_0x451d('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 0b25082..472b621 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 _0xca66=['GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xca66,0x8b));var _0x6ca6=function(_0x46dd84,_0x27bc41){_0x46dd84=_0x46dd84-0x0;var _0x2d40cf=_0xca66[_0x46dd84];return _0x2d40cf;};'use strict';var client=require(_0x6ca6('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x6ca6('0x1'),{'options':{'raw':!![],'attributes':['id',_0x6ca6('0x2'),_0x6ca6('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xc964=['recordingFormat','../client','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x550256,_0x7a6c11){var _0x514b20=function(_0x4a68f1){while(--_0x4a68f1){_0x550256['push'](_0x550256['shift']());}};_0x514b20(++_0x7a6c11);}(_0xc964,0x7e));var _0x4c96=function(_0x3223e9,_0x351ace){_0x3223e9=_0x3223e9-0x0;var _0x2d531f=_0xc964[_0x3223e9];return _0x2d531f;};'use strict';var client=require(_0x4c96('0x0'));exports[_0x4c96('0x1')]=function(){return function(){return client['Request'](_0x4c96('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4c96('0x3'),_0x4c96('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 2e6ccdb..4b3a832 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 _0x8c22=['monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Intervals','interval','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2'];(function(_0x2451ae,_0x2ff3a4){var _0x5d6db9=function(_0x1b0200){while(--_0x1b0200){_0x2451ae['push'](_0x2451ae['shift']());}};_0x5d6db9(++_0x2ff3a4);}(_0x8c22,0x1f1));var _0x28c2=function(_0x52d231,_0x37bc71){_0x52d231=_0x52d231-0x0;var _0x550ac5=_0x8c22[_0x52d231];return _0x550ac5;};'use strict';var client=require('../client');exports[_0x28c2('0x0')]=function(){return function(){return client['Request'](_0x28c2('0x1'),{'options':{'raw':![],'attributes':['id',_0x28c2('0x2'),'acw',_0x28c2('0x3'),_0x28c2('0x4'),'monitor_format',_0x28c2('0x5'),_0x28c2('0x6'),_0x28c2('0x7'),_0x28c2('0x8'),'dialLimitQueue',_0x28c2('0x9'),'dialPredictiveOptimization',_0x28c2('0xa'),'dialPredictiveInterval',_0x28c2('0xb'),_0x28c2('0xc'),_0x28c2('0xd'),_0x28c2('0xe'),_0x28c2('0xf'),'dialQueueProject',_0x28c2('0x10'),_0x28c2('0x11'),_0x28c2('0x12'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x28c2('0x13'),_0x28c2('0x14'),_0x28c2('0x15'),_0x28c2('0x16'),_0x28c2('0x17'),_0x28c2('0x18'),_0x28c2('0x19'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x28c2('0x1a'),_0x28c2('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x28c2('0x1c'),_0x28c2('0x1d'),_0x28c2('0x1e'),_0x28c2('0x1f'),_0x28c2('0x20'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x28c2('0x21'),_0x28c2('0x22'),_0x28c2('0x23'),_0x28c2('0x24'),_0x28c2('0x25'),'dialNoSuchNumberMaxRetry',_0x28c2('0x26'),_0x28c2('0x27'),_0x28c2('0x28'),_0x28c2('0x29'),_0x28c2('0x2a'),_0x28c2('0x2b'),_0x28c2('0x2c'),_0x28c2('0x2d'),_0x28c2('0x2e'),_0x28c2('0x2f'),'dialPredictiveIntervalMaxThreshold',_0x28c2('0x30'),_0x28c2('0x31'),'dialPreviewRecallmeReminder',_0x28c2('0x32')],'include':[{'model':_0x28c2('0x33'),'as':_0x28c2('0x33'),'attributes':['id',_0x28c2('0x2'),_0x28c2('0x34'),_0x28c2('0x35')]},{'model':_0x28c2('0x36'),'as':_0x28c2('0x37'),'attributes':['id',_0x28c2('0x2')]},{'model':_0x28c2('0x33'),'as':_0x28c2('0x38'),'attributes':['id','name',_0x28c2('0x34'),_0x28c2('0x35')]},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':'Interval','as':_0x28c2('0x39'),'attributes':['id','name',_0x28c2('0x3a')]}]}]},'log':_0x28c2('0x0')});};}; \ No newline at end of file +var _0x7798=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','active','Pause','mandatoryDispositionPause','callerid','Interval','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber'];(function(_0x928796,_0x2d6f90){var _0x3d15d3=function(_0x54b994){while(--_0x54b994){_0x928796['push'](_0x928796['shift']());}};_0x3d15d3(++_0x2d6f90);}(_0x7798,0x175));var _0x8779=function(_0x1aa04a,_0x538544){_0x1aa04a=_0x1aa04a-0x0;var _0x52b663=_0x7798[_0x1aa04a];return _0x52b663;};'use strict';var client=require(_0x8779('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x8779('0x1')](_0x8779('0x2'),{'options':{'raw':![],'attributes':['id',_0x8779('0x3'),_0x8779('0x4'),_0x8779('0x5'),_0x8779('0x6'),_0x8779('0x7'),_0x8779('0x8'),_0x8779('0x9'),_0x8779('0xa'),_0x8779('0xb'),_0x8779('0xc'),_0x8779('0xd'),_0x8779('0xe'),'dialPredictiveOptimizationPercentage',_0x8779('0xf'),_0x8779('0x10'),_0x8779('0x11'),_0x8779('0x12'),_0x8779('0x13'),_0x8779('0x14'),_0x8779('0x15'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x8779('0x16'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x8779('0x17'),_0x8779('0x18'),_0x8779('0x19'),_0x8779('0x1a'),'dialPrefix',_0x8779('0x1b'),'dialAMDActive',_0x8779('0x1c'),_0x8779('0x1d'),_0x8779('0x1e'),_0x8779('0x1f'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x8779('0x20'),_0x8779('0x21'),'dialAMDMaximumWordLength',_0x8779('0x22'),'dialRecallMeTimeout',_0x8779('0x23'),_0x8779('0x24'),'dialAgiAfterHangupAgent',_0x8779('0x25'),_0x8779('0x26'),'monitor_format','strategy',_0x8779('0x27'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x8779('0x28'),_0x8779('0x29'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0x8779('0x2a'),'dialMachineMaxRetry',_0x8779('0x2b'),_0x8779('0x2c'),_0x8779('0x2d'),'mandatoryDisposition',_0x8779('0x2e'),_0x8779('0x2f'),_0x8779('0x30'),_0x8779('0x31'),_0x8779('0x32')],'include':[{'model':_0x8779('0x33'),'as':'Trunk','attributes':['id',_0x8779('0x3'),'callerid',_0x8779('0x34')]},{'model':_0x8779('0x35'),'as':_0x8779('0x36'),'attributes':['id',_0x8779('0x3')]},{'model':_0x8779('0x33'),'as':'TrunkBackup','attributes':['id',_0x8779('0x3'),_0x8779('0x37'),_0x8779('0x34')]},{'model':_0x8779('0x38'),'as':_0x8779('0x38'),'attributes':['id',_0x8779('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8779('0x3'),_0x8779('0x39')]}]}]},'log':_0x8779('0x3a')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 347f4cd..06ab755 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(_0x3774c0,_0x4bc6bc){var _0x560b69=function(_0x21f5e8){while(--_0x21f5e8){_0x3774c0['push'](_0x3774c0['shift']());}};_0x560b69(++_0x4bc6bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x21130c,_0x1de5a2){var _0x5536d1=function(_0x10bbf0){while(--_0x10bbf0){_0x21130c['push'](_0x21130c['shift']());}};_0x5536d1(++_0x1de5a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 bb43f71..1c91a7f 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 _0x4c7e=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x5108f5,_0xa2d24c){var _0x1db890=function(_0x34e699){while(--_0x34e699){_0x5108f5['push'](_0x5108f5['shift']());}};_0x1db890(++_0xa2d24c);}(_0x4c7e,0xd0));var _0xe4c7=function(_0x4426ea,_0x314a47){_0x4426ea=_0x4426ea-0x0;var _0x4551b2=_0x4c7e[_0x4426ea];return _0x4551b2;};'use strict';var client=require(_0xe4c7('0x0'));exports[_0xe4c7('0x1')]=function(_0x16ce81){return function(){return client[_0xe4c7('0x2')](_0xe4c7('0x3'),{'options':{'where':{'VoiceQueueId':_0x16ce81,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x2e9f=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x592140,_0x5cf3c0){var _0x1fd7dd=function(_0x44bad2){while(--_0x44bad2){_0x592140['push'](_0x592140['shift']());}};_0x1fd7dd(++_0x5cf3c0);}(_0x2e9f,0x11b));var _0xf2e9=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x2e9f[_0x4b055c];return _0x4b62bb;};'use strict';var client=require(_0xf2e9('0x0'));exports[_0xf2e9('0x1')]=function(_0x1bac1d){return function(){return client['Request'](_0xf2e9('0x2'),{'options':{'where':{'VoiceQueueId':_0x1bac1d,'paused':!![]},'raw':!![]},'log':_0xf2e9('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 25c7175..18b98ef 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1152a0,_0x18d25a){var _0x76d87e=function(_0x1a4558){while(--_0x1a4558){_0x1152a0['push'](_0x1152a0['shift']());}};_0x76d87e(++_0x18d25a);}(_0x7a54,0x106));var _0x47a5=function(_0x26cc71,_0x16cb9f){_0x26cc71=_0x26cc71-0x0;var _0x292303=_0x7a54[_0x26cc71];return _0x292303;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x53c460,_0x2ca599){var _0x327414=function(_0x265c7a){while(--_0x265c7a){_0x53c460['push'](_0x53c460['shift']());}};_0x327414(++_0x2ca599);}(_0x7a54,0x106));var _0x47a5=function(_0x1ad987,_0x4d40a7){_0x1ad987=_0x1ad987-0x0;var _0x270356=_0x7a54[_0x1ad987];return _0x270356;};'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 d1c23e7..66b64b3 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 _0xf39d=['transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum'];(function(_0x394c87,_0x1d7a31){var _0x1254c8=function(_0x42b6c4){while(--_0x42b6c4){_0x394c87['push'](_0x394c87['shift']());}};_0x1254c8(++_0x1d7a31);}(_0xf39d,0xb0));var _0xdf39=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0xf39d[_0x22bee0];return _0x2d295b;};'use strict';var client=require('../client');exports[_0xdf39('0x0')]={};exports[_0xdf39('0x1')]=function(_0x1dbbe7){return client[_0xdf39('0x2')](_0xdf39('0x3'),{'body':{'result':_0x1dbbe7[_0xdf39('0x4')],'transfererchannel':_0x1dbbe7[_0xdf39('0x5')],'transferercalleridnum':_0x1dbbe7[_0xdf39('0x6')],'transferercalleridname':_0x1dbbe7[_0xdf39('0x7')],'transfererconnectedlinenum':_0x1dbbe7[_0xdf39('0x8')],'transfererconnectedlinename':_0x1dbbe7[_0xdf39('0x9')],'transfereraccountcode':_0x1dbbe7[_0xdf39('0xa')],'transferercontext':_0x1dbbe7[_0xdf39('0xb')],'transfererexten':_0x1dbbe7['transfererexten'],'transfererlinkedid':_0x1dbbe7[_0xdf39('0xc')],'transfereechannel':_0x1dbbe7[_0xdf39('0xd')],'transfereecalleridnum':_0x1dbbe7['transfereecalleridnum'],'transfereecalleridname':_0x1dbbe7['transfereecalleridname'],'transfereeconnectedlinenum':_0x1dbbe7[_0xdf39('0xe')],'transfereeconnectedlinename':_0x1dbbe7[_0xdf39('0xf')],'transfereeaccountcode':_0x1dbbe7['transfereeaccountcode'],'transfereecontext':_0x1dbbe7[_0xdf39('0x10')],'transfereeexten':_0x1dbbe7['transfereeexten'],'transfereelinkedid':_0x1dbbe7[_0xdf39('0x11')],'isexternal':_0x1dbbe7[_0xdf39('0x12')],'context':_0x1dbbe7['context'],'extension':_0x1dbbe7[_0xdf39('0x13')],'type':_0xdf39('0x14')},'log':_0xdf39('0x3')});};exports[_0xdf39('0x15')]=function(_0x36221a){return client[_0xdf39('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x36221a[_0xdf39('0x4')],'transfererchannel':_0x36221a['origtransfererchannel'],'transferercalleridnum':_0x36221a['origtransferercalleridnum'],'transferercalleridname':_0x36221a[_0xdf39('0x16')],'transfererconnectedlinenum':_0x36221a[_0xdf39('0x17')],'transfererconnectedlinename':_0x36221a[_0xdf39('0x18')],'transfereraccountcode':_0x36221a[_0xdf39('0x19')],'transferercontext':_0x36221a['secondtransferercontext'],'transfererexten':_0x36221a[_0xdf39('0x1a')],'transfererlinkedid':_0x36221a['origtransfererlinkedid'],'transfereechannel':_0x36221a['transfertargetchannel'],'transfereecalleridnum':_0x36221a['transfertargetcalleridnum'],'transfereecalleridname':_0x36221a[_0xdf39('0x1b')],'transfereeconnectedlinenum':_0x36221a[_0xdf39('0x1c')],'transfereeconnectedlinename':_0x36221a[_0xdf39('0x1d')],'transfereeaccountcode':_0x36221a[_0xdf39('0x1e')],'transfereecontext':_0x36221a[_0xdf39('0x1f')],'transfereeexten':_0x36221a[_0xdf39('0x20')],'transfereelinkedid':_0x36221a[_0xdf39('0x21')],'isexternal':_0x36221a['isexternal'],'context':_0x36221a[_0xdf39('0x22')],'extension':_0x36221a[_0xdf39('0x23')],'type':_0xdf39('0x24')},'log':_0xdf39('0x3')});}; \ No newline at end of file +var _0x2452=['CreateVoiceTransferReport','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension'];(function(_0x48f76a,_0x29b2ac){var _0x3385a6=function(_0x5491bf){while(--_0x5491bf){_0x48f76a['push'](_0x48f76a['shift']());}};_0x3385a6(++_0x29b2ac);}(_0x2452,0x106));var _0x2245=function(_0x2c8543,_0x2c2b3e){_0x2c8543=_0x2c8543-0x0;var _0x516ba2=_0x2452[_0x2c8543];return _0x516ba2;};'use strict';var client=require(_0x2245('0x0'));exports[_0x2245('0x1')]={};exports[_0x2245('0x2')]=function(_0x4e235f){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x4e235f['result'],'transfererchannel':_0x4e235f[_0x2245('0x3')],'transferercalleridnum':_0x4e235f['transferercalleridnum'],'transferercalleridname':_0x4e235f['transferercalleridname'],'transfererconnectedlinenum':_0x4e235f[_0x2245('0x4')],'transfererconnectedlinename':_0x4e235f[_0x2245('0x5')],'transfereraccountcode':_0x4e235f[_0x2245('0x6')],'transferercontext':_0x4e235f['transferercontext'],'transfererexten':_0x4e235f[_0x2245('0x7')],'transfererlinkedid':_0x4e235f['transfererlinkedid'],'transfereechannel':_0x4e235f[_0x2245('0x8')],'transfereecalleridnum':_0x4e235f[_0x2245('0x9')],'transfereecalleridname':_0x4e235f['transfereecalleridname'],'transfereeconnectedlinenum':_0x4e235f[_0x2245('0xa')],'transfereeconnectedlinename':_0x4e235f[_0x2245('0xb')],'transfereeaccountcode':_0x4e235f[_0x2245('0xc')],'transfereecontext':_0x4e235f[_0x2245('0xd')],'transfereeexten':_0x4e235f[_0x2245('0xe')],'transfereelinkedid':_0x4e235f['transfereelinkedid'],'isexternal':_0x4e235f[_0x2245('0xf')],'context':_0x4e235f[_0x2245('0x10')],'extension':_0x4e235f[_0x2245('0x11')],'type':'blind'},'log':_0x2245('0x12')});};exports[_0x2245('0x13')]=function(_0x2fabe4){return client[_0x2245('0x14')](_0x2245('0x12'),{'body':{'result':_0x2fabe4[_0x2245('0x15')],'transfererchannel':_0x2fabe4[_0x2245('0x16')],'transferercalleridnum':_0x2fabe4[_0x2245('0x17')],'transferercalleridname':_0x2fabe4['origtransferercalleridname'],'transfererconnectedlinenum':_0x2fabe4[_0x2245('0x18')],'transfererconnectedlinename':_0x2fabe4[_0x2245('0x19')],'transfereraccountcode':_0x2fabe4['origtransfereraccountcode'],'transferercontext':_0x2fabe4[_0x2245('0x1a')],'transfererexten':_0x2fabe4[_0x2245('0x1b')],'transfererlinkedid':_0x2fabe4[_0x2245('0x1c')],'transfereechannel':_0x2fabe4[_0x2245('0x1d')],'transfereecalleridnum':_0x2fabe4[_0x2245('0x1e')],'transfereecalleridname':_0x2fabe4[_0x2245('0x1f')],'transfereeconnectedlinenum':_0x2fabe4[_0x2245('0x20')],'transfereeconnectedlinename':_0x2fabe4['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2fabe4[_0x2245('0x21')],'transfereecontext':_0x2fabe4[_0x2245('0x22')],'transfereeexten':_0x2fabe4[_0x2245('0x23')],'transfereelinkedid':_0x2fabe4[_0x2245('0x24')],'isexternal':_0x2fabe4['isexternal'],'context':_0x2fabe4[_0x2245('0x25')],'extension':_0x2fabe4[_0x2245('0x26')],'type':_0x2245('0x27')},'log':_0x2245('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 86a6412..983b861 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 _0x81c6=['startProgressive','Trunk','active','callerid','Interval','omit','undefined','values','channels','join','voicechannel','validate','length','map','find','uniqueid','channel','filename','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','push','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','rec','status','MixMonitor\x20Success','mixmonitorid','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','moment','../../../config/environment','../properties','listen','format','name','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','Action','message','catch','command','Command','then','content','voiceQueues','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive'];(function(_0x1f4681,_0x129183){var _0x107c53=function(_0x16ff8c){while(--_0x16ff8c){_0x1f4681['push'](_0x1f4681['shift']());}};_0x107c53(++_0x129183);}(_0x81c6,0x1d5));var _0x681c=function(_0x5a2c7b,_0x441265){_0x5a2c7b=_0x5a2c7b-0x0;var _0x3ad931=_0x81c6[_0x5a2c7b];return _0x3ad931;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x681c('0x1'));var config=require(_0x681c('0x2'));var properties=require(_0x681c('0x3'));var ami=require('../ami');exports[_0x681c('0x4')]=function(_0x2aff9d,_0x1f2032,_0x1d31c8){return new BPromise(function(_0x4ea522,_0x45331){var _0xdc57a5={'QueuePause':function(_0x5624d7){return new Promise(function(_0x5b5f22,_0x1750e2){var _0x3fac39=util[_0x681c('0x5')]('%s/%s','SIP',_0x5624d7[_0x681c('0x6')]);if(_0x2aff9d['timers']&&_0x2aff9d[_0x681c('0x7')][_0x3fac39]&&_0x2aff9d[_0x681c('0x7')][_0x3fac39][_0x681c('0x8')]){_0x2aff9d[_0x681c('0x7')][_0x3fac39]['updateAcw']();}if(_0x2aff9d['agents'][_0x3fac39]){_0x2aff9d[_0x681c('0x9')][_0x3fac39][_0x681c('0xa')]({'statePause':_0x5624d7[_0x681c('0xb')]?!![]:![]});}_0x5b5f22({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x2e4651){var _0x5263cd=this;return new Promise(function(_0x3cf828,_0x4c3a91){if(ami[_0x681c('0xc')]()==![]){return _0x4c3a91(_0x5263cd[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')][_0x681c('0xf')],_0x681c('0x10')]['join']('\x20')));}_0x2e4651=_[_0x681c('0x11')](_0x2e4651,_[_0x681c('0x12')](properties[_0x681c('0x13')]));_0x2e4651[_0x681c('0x14')]=_0x681c('0x15');return ami[_0x681c('0x16')](_0x2e4651)['then'](function(_0xf3c042){_0x3cf828({'code':0xc8,'message':_0xf3c042[_0x681c('0x17')]});})[_0x681c('0x18')](function(_0x42304f){_0x4c3a91(_0x5263cd['error'](0x1f5,_0x42304f[_0x681c('0x17')]));});});},'Command':function(_0x24a0ce){var _0x54d27f=this;return new Promise(function(_0x161948,_0x4c22c7){if(ami[_0x681c('0xc')]()==![]){return _0x4c22c7(_0x54d27f[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')][_0x681c('0xf')],'ami\x20disconnected']['join']('\x20')));}_0x24a0ce=_['pick'](_0x24a0ce,_0x681c('0x19'));_0x24a0ce[_0x681c('0x14')]=_0x681c('0x1a');return ami[_0x681c('0x16')](_0x24a0ce)[_0x681c('0x1b')](function(_0x29f3fa){_0x161948({'code':0xc8,'message':_0x29f3fa[_0x681c('0x1c')]});})[_0x681c('0x18')](function(_0x1b3d2b){_0x4c22c7(_0x54d27f[_0x681c('0xd')](0x1f5,_0x1b3d2b[_0x681c('0x17')]));});});},'VoiceQueues':function(_0x31c9b9){return new Promise(function(_0x13de03,_0x218410){var _0x3237ed=[];for(var _0x228f59 in _0x2aff9d['voiceQueues']){if(_0x2aff9d[_0x681c('0x1d')]['hasOwnProperty'](_0x228f59)){var _0x5f8d64=_0x2aff9d['voiceQueues'][_0x228f59];var _0x583499={'id':_0x5f8d64['id'],'name':_0x5f8d64[_0x681c('0x6')],'strategy':_0x5f8d64[_0x681c('0x1e')],'answered':_0x5f8d64[_0x681c('0x1f')],'available':_0x5f8d64[_0x681c('0x20')],'loggedIn':_0x5f8d64['loggedIn'],'pTalking':_0x5f8d64[_0x681c('0x21')],'sumBillable':_0x5f8d64[_0x681c('0x22')],'sumDuration':_0x5f8d64[_0x681c('0x23')],'sumHoldTime':_0x5f8d64[_0x681c('0x24')]||0x0,'talking':_0x5f8d64[_0x681c('0x25')],'total':_0x5f8d64[_0x681c('0x26')],'type':_0x5f8d64[_0x681c('0x27')],'unmanaged':_0x5f8d64['unmanaged'],'abandoned':_0x5f8d64[_0x681c('0x28')],'waiting':_0x5f8d64[_0x681c('0x29')],'loggedInDb':_0x5f8d64[_0x681c('0x2a')]};if(_0x5f8d64['type']===_0x681c('0x2b')){_0x583499[_0x681c('0x2c')]=_0x5f8d64[_0x681c('0x2c')];_0x583499['dialMethod']=_0x5f8d64[_0x681c('0x2d')];_0x583499['dialOriginateCallerIdName']=_0x5f8d64['dialOriginateCallerIdName'];_0x583499[_0x681c('0x2e')]=_0x5f8d64[_0x681c('0x2e')];_0x583499[_0x681c('0x2f')]=_0x5f8d64['dialOriginateTimeout'];_0x583499[_0x681c('0x30')]=_0x5f8d64['dialPrefix'];_0x583499[_0x681c('0x31')]=_0x5f8d64['temp'];_0x583499['outboundAnswerAgiCallsDay']=_0x5f8d64['outboundAnswerAgiCallsDay'];_0x583499[_0x681c('0x32')]=_0x5f8d64[_0x681c('0x32')];_0x583499['outboundBlacklistCallsDay']=_0x5f8d64[_0x681c('0x33')];_0x583499['outboundBusyCallsDay']=_0x5f8d64['outboundBusyCallsDay'];_0x583499[_0x681c('0x34')]=_0x5f8d64['outboundCongestionCallsDay'];_0x583499[_0x681c('0x35')]=_0x5f8d64[_0x681c('0x35')];_0x583499[_0x681c('0x36')]=_0x5f8d64['outboundDropCallsDayCallersExit'];_0x583499['outboundDropCallsDayTimeout']=_0x5f8d64[_0x681c('0x37')];_0x583499[_0x681c('0x38')]=_0x5f8d64['outboundNoAnswerCallsDay'];_0x583499[_0x681c('0x39')]=_0x5f8d64[_0x681c('0x39')];_0x583499[_0x681c('0x3a')]=_0x5f8d64['outboundOriginateFailureCallsDay'];_0x583499[_0x681c('0x3b')]=_0x5f8d64[_0x681c('0x3b')];_0x583499['outboundRejectCallsDay']=_0x5f8d64[_0x681c('0x3c')];_0x583499[_0x681c('0x3d')]=_0x5f8d64[_0x681c('0x3d')];_0x583499[_0x681c('0x3e')]=_0x5f8d64[_0x681c('0x3e')];_0x583499['predictiveIntervalAvgHoldtime']=_0x5f8d64['predictiveIntervalAvgHoldtime'];_0x583499[_0x681c('0x3f')]=_0x5f8d64[_0x681c('0x3f')];_0x583499['predictiveIntervalDroppedCallsCallersExit']=_0x5f8d64[_0x681c('0x40')];_0x583499[_0x681c('0x41')]=_0x5f8d64['predictiveIntervalDroppedCallsTimeout'];_0x583499[_0x681c('0x42')]=_0x5f8d64[_0x681c('0x42')];_0x583499[_0x681c('0x43')]=_0x5f8d64[_0x681c('0x43')];_0x583499[_0x681c('0x44')]=_0x5f8d64[_0x681c('0x44')];_0x583499[_0x681c('0x45')]=_0x5f8d64[_0x681c('0x45')];_0x583499[_0x681c('0x46')]=_0x5f8d64[_0x681c('0x46')];_0x583499['predictiveIntervalAvailable']=_0x5f8d64[_0x681c('0x47')];_0x583499[_0x681c('0x48')]=_0x5f8d64[_0x681c('0x48')];_0x583499[_0x681c('0x17')]=_0x5f8d64[_0x681c('0x17')];_0x583499[_0x681c('0x49')]=_0x5f8d64[_0x681c('0x49')];_0x583499[_0x681c('0x4a')]=_0x5f8d64[_0x681c('0x4a')];_0x583499[_0x681c('0x4b')]=_0x5f8d64[_0x681c('0x4b')];_0x583499[_0x681c('0x4c')]=_0x5f8d64['erlangAbandonmentRate'];_0x583499[_0x681c('0x4d')]=_0x5f8d64['erlangBusyFactor'];_0x583499['startPredictive']=_0x5f8d64[_0x681c('0x4e')];_0x583499[_0x681c('0x4f')]=_0x5f8d64[_0x681c('0x4f')];}if(_0x5f8d64[_0x681c('0x50')]){_0x583499['Trunk']={'id':_0x5f8d64[_0x681c('0x50')]['id'],'name':_0x5f8d64['Trunk']['name'],'active':_0x5f8d64[_0x681c('0x50')][_0x681c('0x51')],'callerid':_0x5f8d64[_0x681c('0x50')][_0x681c('0x52')]};}if(_0x5f8d64[_0x681c('0x53')]){_0x583499[_0x681c('0x53')]={'id':_0x5f8d64['Interval']['id'],'name':_0x5f8d64[_0x681c('0x53')][_0x681c('0x6')]};}_0x3237ed['push'](_0x583499);}}_0x13de03({'count':_0x3237ed['length'],'rows':_0x3237ed});});},'UpdateVoiceQueue':function(_0x75da91){return new Promise(function(_0x57d539,_0x2cd770){var _0x487257=_['find'](_0x2aff9d['voiceQueues'],{'id':parseInt(_0x75da91['id'])});var _0x28d62d=_[_0x681c('0x54')](_0x75da91,['id']);if(_0x487257){for(var _0x8043a9 in _0x28d62d){if(typeof _0x28d62d[_0x8043a9]!=='undefined'&&typeof _0x487257[_0x8043a9]!==_0x681c('0x55')){_0x487257[_0x8043a9]=_0x28d62d[_0x8043a9];}}_0x57d539(_0x487257);}else{_0x2cd770();}});},'VoiceChannels':function(_0x2e940b){return new Promise(function(_0x5e0a54,_0x449c8b){var _0x17bb48=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x57')]);_0x5e0a54({'count':_0x17bb48['length'],'rows':_0x17bb48});});},'VoiceChannelMixMonitor':function(_0x3b9fd1){var _0x598e95=this;return new Promise(function(_0x1b3c07,_0x29141d){if(ami[_0x681c('0xc')]()==![]){return _0x29141d(_0x598e95['error'](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')][_0x681c('0xf')],_0x681c('0x10')][_0x681c('0x58')]('\x20')));}var _0x1351e9=schema(properties[_0x681c('0x59')])[_0x681c('0x5a')](_0x3b9fd1);if(_0x1351e9[_0x681c('0x5b')]>0x0){return _0x29141d(_0x598e95[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x1351e9,_0x681c('0x17'))[_0x681c('0x58')](',\x20')));}var _0x6e2f5=_[_0x681c('0x5d')](_0x2aff9d['channels'],{'uniqueid':_0x3b9fd1[_0x681c('0x5e')]});if(_0x6e2f5&&_0x6e2f5[_0x681c('0x5f')]){var _0x5ae525=util[_0x681c('0x5')]('%s.%s',_0x3b9fd1[_0x681c('0x60')]||_0x3b9fd1[_0x681c('0x5e')],_0x3b9fd1[_0x681c('0x5')]||'wav');return ami[_0x681c('0x16')]({'action':_0x681c('0x61'),'channel':_0x6e2f5['channel'],'file':_0x5ae525,'options':_0x681c('0x62')})['then'](function(_0x208c91){var _0x50452e=_[_0x681c('0x5d')](_0x6e2f5[_0x681c('0x63')],{'filename':'/var/spool/asterisk/monitor/'+_0x5ae525[_0x681c('0x64')]()});if(_['isNil'](_0x50452e)){_0x6e2f5['monitors'][_0x681c('0x65')]({'filename':_0x681c('0x66')+_0x5ae525[_0x681c('0x64')](),'createdAt':moment()['format'](_0x681c('0x67')),'mixmonitorid':_0x208c91['mixmonitorid'],'status':_0x681c('0x68')});}else{_0x50452e['mixmonitorid']=_0x208c91['mixmonitorid'];_0x50452e[_0x681c('0x69')]=_0x681c('0x68');}_0x1b3c07({'code':0xc8,'message':[_0x3b9fd1[_0x681c('0x5e')],_0x681c('0x6a'),_0x208c91['mixmonitorid']][_0x681c('0x58')]('\x20'),'mixmonitorid':_0x208c91[_0x681c('0x6b')]});})[_0x681c('0x18')](function(_0x44276c){_0x29141d(_0x598e95[_0x681c('0xd')](0x1f5,[_0x3b9fd1['uniqueid'],_0x44276c[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x29141d(_0x598e95[_0x681c('0xd')](0x1f5,_0x681c('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x2d4876){var _0x13ae02=this;return new Promise(function(_0x136246,_0x23e73e){if(ami[_0x681c('0xc')]()==![]){return _0x23e73e(_0x13ae02[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config['asterisk'][_0x681c('0xf')],_0x681c('0x10')][_0x681c('0x58')]('\x20')));}var _0x2fae66=schema(properties[_0x681c('0x59')])['validate'](_0x2d4876);if(_0x2fae66[_0x681c('0x5b')]>0x0){return _0x23e73e(_0x13ae02['error'](0x1f4,_['map'](_0x2fae66,_0x681c('0x17'))[_0x681c('0x58')](',\x20')));}var _0x57f707=_[_0x681c('0x5d')](_0x2aff9d[_0x681c('0x57')],{'uniqueid':_0x2d4876[_0x681c('0x5e')]});if(_0x57f707){return BPromise[_0x681c('0x6d')]()['then'](function(){if(_0x57f707[_0x681c('0x5f')]){return ami[_0x681c('0x16')]({'action':_0x681c('0x6e'),'channel':_0x57f707[_0x681c('0x5f')],'mixmonitorid':_0x2d4876['mixmonitorid']})[_0x681c('0x18')](function(_0x145441){});}})[_0x681c('0x1b')](function(){if(_0x57f707['destinationchannel']){return ami['Action']({'action':_0x681c('0x6e'),'channel':_0x57f707[_0x681c('0x6f')],'mixmonitorid':_0x2d4876['mixmonitorid']})[_0x681c('0x18')](function(_0x3d2a41){});}})[_0x681c('0x1b')](function(_0x27fae3){var _0xde562e=_['find'](_0x57f707[_0x681c('0x63')],{'mixmonitorid':_0x2d4876[_0x681c('0x6b')]});if(_0xde562e){_0xde562e[_0x681c('0x69')]=_0x681c('0x70');}})['then'](function(){var _0x2d6918=util[_0x681c('0x5')](_0x681c('0x71'),_0x2d4876[_0x681c('0x60')]||_0x2d4876[_0x681c('0x5e')],_0x2d4876['format']||_0x681c('0x72'));var _0x21c770=_['find'](_0x57f707['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x2d6918[_0x681c('0x64')]()});if(_0x21c770){_0x21c770['status']=_0x681c('0x70');}})[_0x681c('0x1b')](function(){_0x136246({'code':0xc8,'message':[_0x2d4876[_0x681c('0x5e')],_0x681c('0x73')][_0x681c('0x58')]('\x20')});})['catch'](function(_0x3b3ba6){_0x23e73e(_0x13ae02['error'](0x1f5,[_0x2d4876['uniqueid'],_0x3b3ba6[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x23e73e(_0x13ae02['error'](0x1f5,_0x681c('0x6c')));}});},'VoiceQueuesChannels':function(_0x24c8e7){return new Promise(function(_0x77ba54,_0x5c05b6){var _0x93c148=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x74')]);_0x77ba54({'count':_0x93c148[_0x681c('0x5b')],'rows':_0x93c148});});},'VoiceQueuesChannel':function(_0x33a3ff){var _0x3bd2a0=this;return new Promise(function(_0x12c697,_0x56e77d){var _0x51d6a6=schema(properties[_0x681c('0x75')])[_0x681c('0x5a')](_0x33a3ff);if(_0x51d6a6[_0x681c('0x5b')]>0x0){return _0x56e77d(_0x3bd2a0[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x51d6a6,_0x681c('0x17'))['join'](',\x20')));}var _0x39a13d=_[_0x681c('0x5d')](_0x2aff9d['queueChannels'],{'uniqueid':_0x33a3ff[_0x681c('0x5e')]});if(_0x39a13d){_0x12c697(_0x39a13d);}else{return _0x56e77d(_0x3bd2a0['error'](0x1f5,_0x681c('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x3f22ff){var _0x488ff9=this;return new Promise(function(_0x36cdc0,_0x2e2937){if(ami[_0x681c('0xc')]()==![]){return _0x2e2937(_0x488ff9['error'](0x1f4,[config['asterisk']['ip'],config[_0x681c('0xe')][_0x681c('0xf')],_0x681c('0x10')]['join']('\x20')));}var _0x31077d=schema(properties['voicequeuechannelhangup'])['validate'](_0x3f22ff);if(_0x31077d[_0x681c('0x5b')]>0x0){return _0x2e2937(_0x488ff9[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x31077d,'message')[_0x681c('0x58')](',\x20')));}var _0x2bab50=_[_0x681c('0x5d')](_0x2aff9d[_0x681c('0x74')],{'uniqueid':_0x3f22ff['uniqueid']});if(_0x2bab50&&_0x2bab50['channel']){return ami['Action']({'action':_0x681c('0x76'),'channel':_0x2bab50[_0x681c('0x5f')]})[_0x681c('0x1b')](function(_0x38c6da){_0x36cdc0({'code':0xc8,'message':[_0x3f22ff[_0x681c('0x5e')],_0x38c6da[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')});})[_0x681c('0x18')](function(_0x38ebfb){_0x2e2937(_0x488ff9[_0x681c('0xd')](0x1f5,[_0x3f22ff[_0x681c('0x5e')],_0x38ebfb['message'][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x2e2937(_0x488ff9[_0x681c('0xd')](0x1f5,_0x681c('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x2b166a){var _0x38bf16=this;return new Promise(function(_0x484d92,_0x205834){if(ami[_0x681c('0xc')]()==![]){return _0x205834(_0x38bf16[_0x681c('0xd')](0x1f4,[config[_0x681c('0xe')]['ip'],config[_0x681c('0xe')]['username'],'ami\x20disconnected'][_0x681c('0x58')]('\x20')));}var _0x130605=schema(properties[_0x681c('0x77')])[_0x681c('0x5a')](_0x2b166a);if(_0x130605['length']>0x0){return _0x205834(_0x38bf16[_0x681c('0xd')](0x1f4,_[_0x681c('0x5c')](_0x130605,_0x681c('0x17'))[_0x681c('0x58')](',\x20')));}var _0x2d5466=_[_0x681c('0x5d')](_0x2aff9d[_0x681c('0x74')],{'uniqueid':_0x2b166a['uniqueid']});if(_0x2d5466&&_0x2d5466[_0x681c('0x5f')]){return ami[_0x681c('0x16')]({'action':_0x681c('0x78'),'channel':_0x2d5466[_0x681c('0x5f')],'exten':_0x2b166a['exten'],'context':_0x2b166a['context']||_0x2d5466[_0x681c('0x79')],'priority':0x1})[_0x681c('0x1b')](function(_0x18f662){_0x484d92({'code':0xc8,'message':[_0x2b166a['uniqueid'],_0x18f662[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')});})[_0x681c('0x18')](function(_0x22558c){_0x205834(_0x38bf16[_0x681c('0xd')](0x1f5,[_0x2b166a[_0x681c('0x5e')],_0x22558c[_0x681c('0x17')][_0x681c('0x64')]()][_0x681c('0x58')]('\x20')));});}else{return _0x205834(_0x38bf16[_0x681c('0xd')](0x1f5,_0x681c('0x6c')));}});},'Agents':function(_0x6441d9){return new Promise(function(_0x3821ce,_0x49506d){var _0x2795b5=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x9')]);_0x3821ce({'count':_0x2795b5[_0x681c('0x5b')],'rows':_0x2795b5});});},'Telephones':function(_0x15eb95){return new Promise(function(_0x2965c5,_0xf150a3){var _0x1b130e=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x7a')]);_0x2965c5({'count':_0x1b130e['length'],'rows':_0x1b130e});});},'Trunks':function(_0x4876e2){return new Promise(function(_0x5b40de,_0x3e1712){var _0x592f3f=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x7b')]);_0x5b40de({'count':_0x592f3f[_0x681c('0x5b')],'rows':_0x592f3f});});},'OutboundChannels':function(_0xe248e5){return new Promise(function(_0x16f783,_0x326229){var _0x31b705=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x7c')]);_0x16f783({'count':_0x31b705[_0x681c('0x5b')],'rows':_0x31b705});});},'Outbound':function(_0x1dc760){return new Promise(function(_0x107beb,_0x3fcd95){_0x107beb(_0x2aff9d['outbound']);});},'Campaigns':function(_0x5a8b53){return new Promise(function(_0x18a900,_0xe5295c){var _0x44a361=_['values'](_0x2aff9d[_0x681c('0x7d')]);_0x18a900({'count':_0x44a361[_0x681c('0x5b')],'rows':_0x44a361});});},'VoiceQueuesPreview':function(_0xf3d937){var _0x231c78=this;return new Promise(function(_0x124cd3,_0x591e39){_0x1f2032[_0x681c('0x7e')](_0xf3d937['id'])['then'](function(_0xa103be){_0x124cd3({'code':0xc8,'message':_0xa103be[_0x681c('0x17')]});})['catch'](function(_0x255267){_0x591e39(_0x231c78[_0x681c('0xd')](0x1f4,_0x255267[_0x681c('0x17')]));});});},'EventManager':function(_0x1ec720){var _0x5b0c6d=this;return new Promise(function(_0x3f7138,_0x4c2b12){if(!_0x1ec720[_0x681c('0x7f')]){return _0x4c2b12(_0x5b0c6d[_0x681c('0xd')](0x1f4,_0x681c('0x80')));}ami[_0x681c('0x81')]('custom:'+_0x1ec720['event'],_0x1ec720['message']);_0x3f7138({'code':0xc8,'message':_0x1ec720});});},'FaxAccounts':function(_0x5df46f){return new Promise(function(_0x33556c,_0x47fac3){var _0x5c7af7=_[_0x681c('0x56')](_0x2aff9d[_0x681c('0x82')]);_0x33556c({'count':_0x5c7af7[_0x681c('0x5b')],'rows':_0x5c7af7});});},'SendFax':function(_0x57fddd){var _0x280bfc=this;return new Promise(function(_0x229b5e,_0x140fe4){_0x1d31c8['send'](_0x57fddd)['then'](function(_0x19d85c){_0x229b5e({'code':0xc8,'message':_0x19d85c['message']});})[_0x681c('0x18')](function(_0x350f5f){_0x140fe4(_0x280bfc[_0x681c('0xd')](0x1f4,_0x350f5f[_0x681c('0x17')]));});});},'CheckAfterSend':function(_0xc38adb){var _0x18f952=this;return new Promise(function(_0x48c8e9,_0x1ae8c3){_0x1d31c8[_0x681c('0x83')](_0xc38adb)[_0x681c('0x1b')](function(_0x1a8875){_0x48c8e9({'code':0xc8,'message':_0x1a8875[_0x681c('0x17')]});})[_0x681c('0x18')](function(_0x285848){_0x1ae8c3(_0x18f952[_0x681c('0xd')](0x1f4,_0x285848[_0x681c('0x17')]));});});}};var _0x4498e0=jayson[_0x681c('0x84')](_0xdc57a5)[_0x681c('0x85')]();_0x4498e0['on'](_0x681c('0xd'),function(_0x33645d){return _0x45331(_0x33645d);});_0x4498e0[_0x681c('0x4')](0x232a,_0x681c('0x86'),function(){console[_0x681c('0x87')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x4ea522(_0x681c('0x88')+0x232a);});});}; \ No newline at end of file +var _0xaf1b=['bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','catch','message','username','Command','then','content','voiceQueues','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x43a01,_0x455893){_0x43a01=_0x43a01-0x0;var _0x1acfb9=_0xaf1b[_0x43a01];return _0x1acfb9;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var jayson=require(_0xbaf1('0x2'));var schema=require(_0xbaf1('0x3'));var BPromise=require(_0xbaf1('0x4'));var moment=require(_0xbaf1('0x5'));var config=require(_0xbaf1('0x6'));var properties=require(_0xbaf1('0x7'));var ami=require(_0xbaf1('0x8'));exports[_0xbaf1('0x9')]=function(_0x156a67,_0x97aab,_0x7dd657){return new BPromise(function(_0x2f05ad,_0x548a29){var _0x2e05b5={'QueuePause':function(_0x5f337d){return new Promise(function(_0x16a74d,_0x4eeec4){var _0x2052c8=util[_0xbaf1('0xa')](_0xbaf1('0xb'),'SIP',_0x5f337d[_0xbaf1('0xc')]);if(_0x156a67[_0xbaf1('0xd')]&&_0x156a67['timers'][_0x2052c8]&&_0x156a67[_0xbaf1('0xd')][_0x2052c8]['timer']){_0x156a67[_0xbaf1('0xd')][_0x2052c8][_0xbaf1('0xe')]();}if(_0x156a67[_0xbaf1('0xf')][_0x2052c8]){_0x156a67[_0xbaf1('0xf')][_0x2052c8][_0xbaf1('0x10')]({'statePause':_0x5f337d[_0xbaf1('0x11')]?!![]:![]});}_0x16a74d({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x493f3f){var _0x322058=this;return new Promise(function(_0x1a10d6,_0x22edd9){if(ami[_0xbaf1('0x12')]()==![]){return _0x22edd9(_0x322058[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')]['username'],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}_0x493f3f=_[_0xbaf1('0x17')](_0x493f3f,_[_0xbaf1('0x18')](properties[_0xbaf1('0x19')]));_0x493f3f[_0xbaf1('0x1a')]=_0xbaf1('0x1b');return ami[_0xbaf1('0x1c')](_0x493f3f)['then'](function(_0x33c23b){_0x1a10d6({'code':0xc8,'message':_0x33c23b['message']});})[_0xbaf1('0x1d')](function(_0x3b13b2){_0x22edd9(_0x322058[_0xbaf1('0x13')](0x1f5,_0x3b13b2[_0xbaf1('0x1e')]));});});},'Command':function(_0x498435){var _0x43291c=this;return new Promise(function(_0x52b6da,_0x2ac412){if(ami[_0xbaf1('0x12')]()==![]){return _0x2ac412(_0x43291c['error'](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}_0x498435=_[_0xbaf1('0x17')](_0x498435,'command');_0x498435['action']=_0xbaf1('0x20');return ami[_0xbaf1('0x1c')](_0x498435)[_0xbaf1('0x21')](function(_0x496344){_0x52b6da({'code':0xc8,'message':_0x496344[_0xbaf1('0x22')]});})[_0xbaf1('0x1d')](function(_0x40a0fa){_0x2ac412(_0x43291c['error'](0x1f5,_0x40a0fa[_0xbaf1('0x1e')]));});});},'VoiceQueues':function(_0x5ef6db){return new Promise(function(_0x1e7847,_0x181c9d){var _0xae3b42=[];for(var _0x2afb55 in _0x156a67[_0xbaf1('0x23')]){if(_0x156a67['voiceQueues']['hasOwnProperty'](_0x2afb55)){var _0x1cfbcd=_0x156a67[_0xbaf1('0x23')][_0x2afb55];var _0x33abc0={'id':_0x1cfbcd['id'],'name':_0x1cfbcd[_0xbaf1('0xc')],'strategy':_0x1cfbcd['strategy'],'answered':_0x1cfbcd[_0xbaf1('0x24')],'available':_0x1cfbcd['available'],'loggedIn':_0x1cfbcd[_0xbaf1('0x25')],'pTalking':_0x1cfbcd[_0xbaf1('0x26')],'sumBillable':_0x1cfbcd[_0xbaf1('0x27')],'sumDuration':_0x1cfbcd[_0xbaf1('0x28')],'sumHoldTime':_0x1cfbcd[_0xbaf1('0x29')]||0x0,'talking':_0x1cfbcd[_0xbaf1('0x2a')],'total':_0x1cfbcd[_0xbaf1('0x2b')],'type':_0x1cfbcd['type'],'unmanaged':_0x1cfbcd[_0xbaf1('0x2c')],'abandoned':_0x1cfbcd[_0xbaf1('0x2d')],'waiting':_0x1cfbcd[_0xbaf1('0x2e')],'loggedInDb':_0x1cfbcd[_0xbaf1('0x2f')]};if(_0x1cfbcd[_0xbaf1('0x30')]===_0xbaf1('0x31')){_0x33abc0[_0xbaf1('0x32')]=_0x1cfbcd[_0xbaf1('0x32')];_0x33abc0['dialMethod']=_0x1cfbcd[_0xbaf1('0x33')];_0x33abc0[_0xbaf1('0x34')]=_0x1cfbcd[_0xbaf1('0x34')];_0x33abc0[_0xbaf1('0x35')]=_0x1cfbcd['dialOriginateCallerIdNumber'];_0x33abc0[_0xbaf1('0x36')]=_0x1cfbcd['dialOriginateTimeout'];_0x33abc0[_0xbaf1('0x37')]=_0x1cfbcd['dialPrefix'];_0x33abc0[_0xbaf1('0x38')]=_0x1cfbcd[_0xbaf1('0x38')];_0x33abc0[_0xbaf1('0x39')]=_0x1cfbcd[_0xbaf1('0x39')];_0x33abc0['outboundAnswerCallsDay']=_0x1cfbcd[_0xbaf1('0x3a')];_0x33abc0[_0xbaf1('0x3b')]=_0x1cfbcd[_0xbaf1('0x3b')];_0x33abc0[_0xbaf1('0x3c')]=_0x1cfbcd[_0xbaf1('0x3c')];_0x33abc0[_0xbaf1('0x3d')]=_0x1cfbcd[_0xbaf1('0x3d')];_0x33abc0['outboundDropCallsDayACS']=_0x1cfbcd[_0xbaf1('0x3e')];_0x33abc0[_0xbaf1('0x3f')]=_0x1cfbcd[_0xbaf1('0x3f')];_0x33abc0[_0xbaf1('0x40')]=_0x1cfbcd[_0xbaf1('0x40')];_0x33abc0[_0xbaf1('0x41')]=_0x1cfbcd[_0xbaf1('0x41')];_0x33abc0['outboundNoSuchCallsDay']=_0x1cfbcd[_0xbaf1('0x42')];_0x33abc0['outboundOriginateFailureCallsDay']=_0x1cfbcd[_0xbaf1('0x43')];_0x33abc0[_0xbaf1('0x44')]=_0x1cfbcd[_0xbaf1('0x44')];_0x33abc0[_0xbaf1('0x45')]=_0x1cfbcd[_0xbaf1('0x45')];_0x33abc0[_0xbaf1('0x46')]=_0x1cfbcd[_0xbaf1('0x46')];_0x33abc0[_0xbaf1('0x47')]=_0x1cfbcd[_0xbaf1('0x47')];_0x33abc0['predictiveIntervalAvgHoldtime']=_0x1cfbcd['predictiveIntervalAvgHoldtime'];_0x33abc0['predictiveIntervalAvgTalktime']=_0x1cfbcd[_0xbaf1('0x48')];_0x33abc0[_0xbaf1('0x49')]=_0x1cfbcd['predictiveIntervalDroppedCallsCallersExit'];_0x33abc0[_0xbaf1('0x4a')]=_0x1cfbcd[_0xbaf1('0x4a')];_0x33abc0[_0xbaf1('0x4b')]=_0x1cfbcd['predictiveIntervalErlangCalls'];_0x33abc0[_0xbaf1('0x4c')]=_0x1cfbcd[_0xbaf1('0x4c')];_0x33abc0[_0xbaf1('0x4d')]=_0x1cfbcd['predictiveIntervalHitRate'];_0x33abc0[_0xbaf1('0x4e')]=_0x1cfbcd[_0xbaf1('0x4e')];_0x33abc0['predictiveIntervalPauses']=_0x1cfbcd['predictiveIntervalPauses'];_0x33abc0[_0xbaf1('0x4f')]=_0x1cfbcd['predictiveIntervalAvailable'];_0x33abc0['predictiveIntervalTotalCalls']=_0x1cfbcd['predictiveIntervalTotalCalls'];_0x33abc0[_0xbaf1('0x1e')]=_0x1cfbcd[_0xbaf1('0x1e')];_0x33abc0[_0xbaf1('0x50')]=_0x1cfbcd[_0xbaf1('0x50')];_0x33abc0[_0xbaf1('0x51')]=_0x1cfbcd[_0xbaf1('0x51')];_0x33abc0[_0xbaf1('0x52')]=_0x1cfbcd[_0xbaf1('0x52')];_0x33abc0['erlangAbandonmentRate']=_0x1cfbcd[_0xbaf1('0x53')];_0x33abc0[_0xbaf1('0x54')]=_0x1cfbcd[_0xbaf1('0x54')];_0x33abc0[_0xbaf1('0x55')]=_0x1cfbcd['startPredictive'];_0x33abc0[_0xbaf1('0x56')]=_0x1cfbcd['startProgressive'];}if(_0x1cfbcd[_0xbaf1('0x57')]){_0x33abc0[_0xbaf1('0x57')]={'id':_0x1cfbcd[_0xbaf1('0x57')]['id'],'name':_0x1cfbcd['Trunk'][_0xbaf1('0xc')],'active':_0x1cfbcd[_0xbaf1('0x57')][_0xbaf1('0x58')],'callerid':_0x1cfbcd['Trunk'][_0xbaf1('0x59')]};}if(_0x1cfbcd['Interval']){_0x33abc0['Interval']={'id':_0x1cfbcd['Interval']['id'],'name':_0x1cfbcd[_0xbaf1('0x5a')][_0xbaf1('0xc')]};}_0xae3b42[_0xbaf1('0x5b')](_0x33abc0);}}_0x1e7847({'count':_0xae3b42[_0xbaf1('0x5c')],'rows':_0xae3b42});});},'UpdateVoiceQueue':function(_0x3ed8a0){return new Promise(function(_0x1e5955,_0x52bd9a){var _0x2e09b3=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x23')],{'id':parseInt(_0x3ed8a0['id'])});var _0x752e07=_[_0xbaf1('0x5e')](_0x3ed8a0,['id']);if(_0x2e09b3){for(var _0x21cf40 in _0x752e07){if(typeof _0x752e07[_0x21cf40]!=='undefined'&&typeof _0x2e09b3[_0x21cf40]!==_0xbaf1('0x5f')){_0x2e09b3[_0x21cf40]=_0x752e07[_0x21cf40];}}_0x1e5955(_0x2e09b3);}else{_0x52bd9a();}});},'VoiceChannels':function(_0x58b5a7){return new Promise(function(_0x5847ea,_0x300f67){var _0x12a9a1=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x61')]);_0x5847ea({'count':_0x12a9a1[_0xbaf1('0x5c')],'rows':_0x12a9a1});});},'VoiceChannelMixMonitor':function(_0x55ff0a){var _0x471d44=this;return new Promise(function(_0x4cf95d,_0x20bb7f){if(ami[_0xbaf1('0x12')]()==![]){return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x3a1f4d=schema(properties[_0xbaf1('0x62')])[_0xbaf1('0x3')](_0x55ff0a);if(_0x3a1f4d[_0xbaf1('0x5c')]>0x0){return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x3a1f4d,_0xbaf1('0x1e'))[_0xbaf1('0x16')](',\x20')));}var _0x54f00c=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x61')],{'uniqueid':_0x55ff0a[_0xbaf1('0x64')]});if(_0x54f00c&&_0x54f00c[_0xbaf1('0x65')]){var _0x55aa1e=util[_0xbaf1('0xa')](_0xbaf1('0x66'),_0x55ff0a[_0xbaf1('0x67')]||_0x55ff0a[_0xbaf1('0x64')],_0x55ff0a[_0xbaf1('0xa')]||_0xbaf1('0x68'));return ami['Action']({'action':_0xbaf1('0x69'),'channel':_0x54f00c[_0xbaf1('0x65')],'file':_0x55aa1e,'options':_0xbaf1('0x6a')})[_0xbaf1('0x21')](function(_0x20de2b){var _0x37ee43=_['find'](_0x54f00c[_0xbaf1('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x55aa1e[_0xbaf1('0x6c')]()});if(_[_0xbaf1('0x6d')](_0x37ee43)){_0x54f00c[_0xbaf1('0x6b')][_0xbaf1('0x5b')]({'filename':_0xbaf1('0x6e')+_0x55aa1e[_0xbaf1('0x6c')](),'createdAt':moment()[_0xbaf1('0xa')](_0xbaf1('0x6f')),'mixmonitorid':_0x20de2b[_0xbaf1('0x70')],'status':_0xbaf1('0x71')});}else{_0x37ee43[_0xbaf1('0x70')]=_0x20de2b['mixmonitorid'];_0x37ee43[_0xbaf1('0x72')]='rec';}_0x4cf95d({'code':0xc8,'message':[_0x55ff0a['uniqueid'],'MixMonitor\x20Success',_0x20de2b[_0xbaf1('0x70')]]['join']('\x20'),'mixmonitorid':_0x20de2b['mixmonitorid']});})[_0xbaf1('0x1d')](function(_0x131281){_0x20bb7f(_0x471d44['error'](0x1f5,[_0x55ff0a[_0xbaf1('0x64')],_0x131281[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()][_0xbaf1('0x16')]('\x20')));});}else{return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceChannelStopMixMonitor':function(_0x1784d8){var _0x18034a=this;return new Promise(function(_0x915a43,_0x2b55aa){if(ami['isConnected']()==![]){return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xbaf1('0x14')]['username'],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x3b2146=schema(properties[_0xbaf1('0x62')])[_0xbaf1('0x3')](_0x1784d8);if(_0x3b2146[_0xbaf1('0x5c')]>0x0){return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x3b2146,_0xbaf1('0x1e'))[_0xbaf1('0x16')](',\x20')));}var _0x369c22=_['find'](_0x156a67[_0xbaf1('0x61')],{'uniqueid':_0x1784d8['uniqueid']});if(_0x369c22){return BPromise[_0xbaf1('0x74')]()['then'](function(){if(_0x369c22[_0xbaf1('0x65')]){return ami[_0xbaf1('0x1c')]({'action':_0xbaf1('0x75'),'channel':_0x369c22[_0xbaf1('0x65')],'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]})['catch'](function(_0x157d17){});}})[_0xbaf1('0x21')](function(){if(_0x369c22[_0xbaf1('0x76')]){return ami['Action']({'action':_0xbaf1('0x75'),'channel':_0x369c22[_0xbaf1('0x76')],'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]})[_0xbaf1('0x1d')](function(_0x1b695e){});}})[_0xbaf1('0x21')](function(_0x547b62){var _0x2f56d6=_[_0xbaf1('0x5d')](_0x369c22[_0xbaf1('0x6b')],{'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]});if(_0x2f56d6){_0x2f56d6[_0xbaf1('0x72')]=_0xbaf1('0x77');}})['then'](function(){var _0x1c886a=util[_0xbaf1('0xa')](_0xbaf1('0x66'),_0x1784d8['filename']||_0x1784d8['uniqueid'],_0x1784d8[_0xbaf1('0xa')]||_0xbaf1('0x68'));var _0x178dd6=_['find'](_0x369c22[_0xbaf1('0x6b')],{'filename':_0xbaf1('0x6e')+_0x1c886a[_0xbaf1('0x6c')]()});if(_0x178dd6){_0x178dd6[_0xbaf1('0x72')]=_0xbaf1('0x77');}})['then'](function(){_0x915a43({'code':0xc8,'message':[_0x1784d8[_0xbaf1('0x64')],_0xbaf1('0x78')][_0xbaf1('0x16')]('\x20')});})['catch'](function(_0x4f9b26){_0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f5,[_0x1784d8[_0xbaf1('0x64')],_0x4f9b26[_0xbaf1('0x1e')]['toLowerCase']()][_0xbaf1('0x16')]('\x20')));});}else{return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceQueuesChannels':function(_0x50334e){return new Promise(function(_0x464421,_0x41afbd){var _0x50e9dd=_['values'](_0x156a67[_0xbaf1('0x79')]);_0x464421({'count':_0x50e9dd[_0xbaf1('0x5c')],'rows':_0x50e9dd});});},'VoiceQueuesChannel':function(_0x5d0909){var _0x5d28b9=this;return new Promise(function(_0x38bf32,_0x4d28d7){var _0x1f94a9=schema(properties[_0xbaf1('0x7a')])[_0xbaf1('0x3')](_0x5d0909);if(_0x1f94a9[_0xbaf1('0x5c')]>0x0){return _0x4d28d7(_0x5d28b9[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x1f94a9,_0xbaf1('0x1e'))['join'](',\x20')));}var _0x47df91=_['find'](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0x5d0909[_0xbaf1('0x64')]});if(_0x47df91){_0x38bf32(_0x47df91);}else{return _0x4d28d7(_0x5d28b9[_0xbaf1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0xab1f6e){var _0x12e901=this;return new Promise(function(_0x436da0,_0xf6a307){if(ami['isConnected']()==![]){return _0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')]['join']('\x20')));}var _0x567211=schema(properties['voicequeuechannelhangup'])[_0xbaf1('0x3')](_0xab1f6e);if(_0x567211[_0xbaf1('0x5c')]>0x0){return _0xf6a307(_0x12e901['error'](0x1f4,_[_0xbaf1('0x63')](_0x567211,'message')[_0xbaf1('0x16')](',\x20')));}var _0x56629a=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0xab1f6e['uniqueid']});if(_0x56629a&&_0x56629a[_0xbaf1('0x65')]){return ami[_0xbaf1('0x1c')]({'action':_0xbaf1('0x7b'),'channel':_0x56629a[_0xbaf1('0x65')]})[_0xbaf1('0x21')](function(_0x4f64c7){_0x436da0({'code':0xc8,'message':[_0xab1f6e[_0xbaf1('0x64')],_0x4f64c7[_0xbaf1('0x1e')]['toLowerCase']()][_0xbaf1('0x16')]('\x20')});})[_0xbaf1('0x1d')](function(_0x479a1d){_0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f5,[_0xab1f6e[_0xbaf1('0x64')],_0x479a1d[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()][_0xbaf1('0x16')]('\x20')));});}else{return _0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x215f54){var _0x32bfca=this;return new Promise(function(_0x116b32,_0x1d6e58){if(ami[_0xbaf1('0x12')]()==![]){return _0x1d6e58(_0x32bfca['error'](0x1f4,[config[_0xbaf1('0x14')]['ip'],config['asterisk'][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x1a5d4b=schema(properties[_0xbaf1('0x7c')])[_0xbaf1('0x3')](_0x215f54);if(_0x1a5d4b[_0xbaf1('0x5c')]>0x0){return _0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x1a5d4b,'message')[_0xbaf1('0x16')](',\x20')));}var _0x57505c=_['find'](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0x215f54[_0xbaf1('0x64')]});if(_0x57505c&&_0x57505c[_0xbaf1('0x65')]){return ami['Action']({'action':'Redirect','channel':_0x57505c[_0xbaf1('0x65')],'exten':_0x215f54[_0xbaf1('0x7d')],'context':_0x215f54['context']||_0x57505c[_0xbaf1('0x7e')],'priority':0x1})[_0xbaf1('0x21')](function(_0x446682){_0x116b32({'code':0xc8,'message':[_0x215f54[_0xbaf1('0x64')],_0x446682[_0xbaf1('0x1e')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x516da1){_0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f5,[_0x215f54[_0xbaf1('0x64')],_0x516da1[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()]['join']('\x20')));});}else{return _0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x21ad47){return new Promise(function(_0x537ce3,_0x35814b){var _0x5a999c=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0xf')]);_0x537ce3({'count':_0x5a999c[_0xbaf1('0x5c')],'rows':_0x5a999c});});},'Telephones':function(_0x20cdc9){return new Promise(function(_0x4973c9,_0xde578b){var _0x12c371=_['values'](_0x156a67[_0xbaf1('0x7f')]);_0x4973c9({'count':_0x12c371[_0xbaf1('0x5c')],'rows':_0x12c371});});},'Trunks':function(_0x46d111){return new Promise(function(_0x11ee42,_0x8f2a02){var _0x2ee0d8=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x80')]);_0x11ee42({'count':_0x2ee0d8['length'],'rows':_0x2ee0d8});});},'OutboundChannels':function(_0x3834dc){return new Promise(function(_0x341715,_0x2eea9c){var _0x539508=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x81')]);_0x341715({'count':_0x539508[_0xbaf1('0x5c')],'rows':_0x539508});});},'Outbound':function(_0x133089){return new Promise(function(_0x204920,_0x481aeb){_0x204920(_0x156a67[_0xbaf1('0x31')]);});},'Campaigns':function(_0x2c0572){return new Promise(function(_0x4609c2,_0x3fa01a){var _0x4ae168=_[_0xbaf1('0x60')](_0x156a67['campaigns']);_0x4609c2({'count':_0x4ae168[_0xbaf1('0x5c')],'rows':_0x4ae168});});},'VoiceQueuesPreview':function(_0x1538ec){var _0x4f1136=this;return new Promise(function(_0xca83ff,_0x57eb50){_0x97aab[_0xbaf1('0x82')](_0x1538ec['id'])[_0xbaf1('0x21')](function(_0x195218){_0xca83ff({'code':0xc8,'message':_0x195218[_0xbaf1('0x1e')]});})[_0xbaf1('0x1d')](function(_0x141e1f){_0x57eb50(_0x4f1136[_0xbaf1('0x13')](0x1f4,_0x141e1f[_0xbaf1('0x1e')]));});});},'EventManager':function(_0x24f73a){var _0x52b7ca=this;return new Promise(function(_0x453231,_0x114cdd){if(!_0x24f73a[_0xbaf1('0x83')]){return _0x114cdd(_0x52b7ca[_0xbaf1('0x13')](0x1f4,_0xbaf1('0x84')));}ami[_0xbaf1('0x85')](_0xbaf1('0x86')+_0x24f73a[_0xbaf1('0x83')],_0x24f73a[_0xbaf1('0x1e')]);_0x453231({'code':0xc8,'message':_0x24f73a});});},'FaxAccounts':function(_0x280213){return new Promise(function(_0x13b4ab,_0x281060){var _0x383b8e=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x87')]);_0x13b4ab({'count':_0x383b8e[_0xbaf1('0x5c')],'rows':_0x383b8e});});},'SendFax':function(_0x2098ee){var _0x28f833=this;return new Promise(function(_0x5a914e,_0x21f6b2){_0x7dd657[_0xbaf1('0x88')](_0x2098ee)[_0xbaf1('0x21')](function(_0x584900){_0x5a914e({'code':0xc8,'message':_0x584900['message']});})[_0xbaf1('0x1d')](function(_0x4706cc){_0x21f6b2(_0x28f833[_0xbaf1('0x13')](0x1f4,_0x4706cc['message']));});});},'CheckAfterSend':function(_0x2349c5){var _0x3516fc=this;return new Promise(function(_0x280f35,_0x44fd6c){_0x7dd657[_0xbaf1('0x89')](_0x2349c5)[_0xbaf1('0x21')](function(_0xd9436f){_0x280f35({'code':0xc8,'message':_0xd9436f[_0xbaf1('0x1e')]});})['catch'](function(_0x56b458){_0x44fd6c(_0x3516fc[_0xbaf1('0x13')](0x1f4,_0x56b458[_0xbaf1('0x1e')]));});});}};var _0x1ff946=jayson['server'](_0x2e05b5)[_0xbaf1('0x8a')]();_0x1ff946['on'](_0xbaf1('0x13'),function(_0x1728cf){return _0x548a29(_0x1728cf);});_0x1ff946['listen'](0x232a,_0xbaf1('0x8b'),function(){console[_0xbaf1('0x8c')](_0xbaf1('0x8d'),0x232a);return _0x2f05ad(_0xbaf1('0x8e')+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 9170a01..1a38af2 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 _0xe486=['emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','destcalleridnum','calleridnum','routeId','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','action','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','defaults','redis','localhost','socket.io-emitter','[CM][%s][%s]'];(function(_0x121470,_0x533ba4){var _0x14f76b=function(_0x2cbcf4){while(--_0x2cbcf4){_0x121470['push'](_0x121470['shift']());}};_0x14f76b(++_0x533ba4);}(_0xe486,0x6a));var _0x6e48=function(_0x5e4375,_0x756e2b){_0x5e4375=_0x5e4375-0x0;var _0x4bd4cd=_0xe486[_0x5e4375];return _0x4bd4cd;};'use strict';var _=require(_0x6e48('0x0'));var BPromise=require(_0x6e48('0x1'));var Redis=require(_0x6e48('0x2'));var util=require(_0x6e48('0x3'));var config=require(_0x6e48('0x4'));var logger=require(_0x6e48('0x5'))(_0x6e48('0x6'));var cmContactRpc=require('../../rpc/cmContact');config['redis']=_[_0x6e48('0x7')](config[_0x6e48('0x8')],{'host':_0x6e48('0x9'),'port':0x18eb});var io=require(_0x6e48('0xa'))(new Redis(config['redis']));function emit(_0x1ea941,_0x2dc190,_0x23d274,_0x1aaa9e,_0x3d392e){logger['info'](_0x6e48('0xb'),_0x1ea941,_0x2dc190['id'],_0x23d274,_0x1aaa9e,JSON['stringify'](_0x3d392e));io['to'](_0x23d274)[_0x6e48('0xc')](_0x1aaa9e,_0x3d392e);}exports['exec']=function(_0x1aa476,_0x15d5d6,_0x324e1f,_0x3d34dd){var _0x4fd15c,_0x18828f;var _0x53a113={};var _0x5819cb;var _0x2fe0e6=Number(_0x324e1f[_0x6e48('0xd')]);var _0x1bfa97=_0x324e1f[_0x6e48('0xe')]?Boolean(Number(_0x324e1f['data2'])):![];var _0x395328;var _0x304838=![];if(!_[_0x6e48('0xf')](_0x324e1f[_0x6e48('0x10')])){if(_0x324e1f[_0x6e48('0x10')]=='1')_0x304838=!![];}if(!_0x304838){if(_0x3d34dd[_0x6e48('0x11')]){_0x53a113['id']=_0x3d34dd[_0x6e48('0x11')];}}if(!_0x53a113['id']){_0x53a113[_0x6e48('0x12')]=_0x2fe0e6;_0x395328=_0x324e1f[_0x6e48('0x13')]&&_0x324e1f['data3']!=='0'?_0x324e1f[_0x6e48('0x13')][_0x6e48('0x14')](','):[_0x6e48('0x15')];_0x53a113[_0x6e48('0x16')]=_['map'](_0x395328,function(_0x45e94b){var _0x2a00a7={};_0x2a00a7[_0x45e94b]=_0x3d34dd['routeId']?_0x3d34dd[_0x6e48('0x17')]:_0x3d34dd[_0x6e48('0x18')];return _0x2a00a7;});_0x5819cb=_0x3d34dd[_0x6e48('0x19')]?_0x3d34dd[_0x6e48('0x17')]:_0x3d34dd[_0x6e48('0x18')];}var _0x419fd8=['id',_0x6e48('0x1a'),_0x6e48('0x1b'),'phone',_0x6e48('0x1c'),_0x6e48('0x1d'),_0x6e48('0x12'),_0x6e48('0x1e'),_0x6e48('0x1f'),_0x6e48('0x20')];var _0x5cb22e=_[_0x6e48('0x21')](_0x419fd8,_0x395328);BPromise['resolve']()[_0x6e48('0x22')](cmContactRpc['getContacts']({'attributes':_0x5cb22e,'where':_0x53a113,'phone':_0x5819cb}))['then'](function(_0x52bbef){_0x18828f=_0x52bbef;if(!_[_0x6e48('0x23')](_0x18828f)){if(_0x18828f[_0x6e48('0x24')]===0x1){_0x4fd15c=_0x18828f[0x0];logger[_0x6e48('0x25')](_0x6e48('0x26'),_0x3d34dd[_0x6e48('0x27')],_0x15d5d6['id'],_0x4fd15c['id']);}else{logger['info'](_0x6e48('0x28'),_0x3d34dd[_0x6e48('0x27')],_0x15d5d6['id'],_[_0x6e48('0x29')](_0x18828f,'id')[_0x6e48('0x2a')](','));}return;}else{logger[_0x6e48('0x25')](_0x6e48('0x2b'),_0x3d34dd[_0x6e48('0x27')],_0x15d5d6['id']);var _0x4b1952={'ListId':_0x2fe0e6};var _0x4d5cbc=_0x324e1f[_0x6e48('0x2c')]&&_0x324e1f[_0x6e48('0x2c')]!=='0'?_0x324e1f['data4']:_0x6e48('0x15');if(_0x1bfa97){logger['info'](_0x6e48('0x2d'),_0x3d34dd['uniqueid'],_0x15d5d6['id']);_0x4b1952[_0x4d5cbc]=_['isNil'](_0x3d34dd['routeId'])?_0x3d34dd[_0x6e48('0x18')]:_0x3d34dd[_0x6e48('0x17')];if(_[_0x6e48('0xf')](_0x3d34dd[_0x6e48('0x19')])){_0x4b1952['firstName']=_0x3d34dd[_0x6e48('0x2e')]&&_0x3d34dd[_0x6e48('0x2e')]!==''?_0x3d34dd[_0x6e48('0x2e')]:_0x6e48('0x2f');}else{_0x4b1952['firstName']=_0x3d34dd[_0x6e48('0x30')]&&_0x3d34dd['destcalleridname']!==_0x6e48('0x31')?_0x3d34dd[_0x6e48('0x30')]:'Unknown';}return BPromise[_0x6e48('0x32')]()[_0x6e48('0x22')](cmContactRpc[_0x6e48('0x33')](_0x4b1952))['then'](function(_0x64f13d){_0x4fd15c=_0x64f13d;_0x18828f[_0x6e48('0x34')](_0x64f13d);if(_0x4fd15c){logger['info'](_0x6e48('0x35'),_0x3d34dd[_0x6e48('0x27')],_0x15d5d6['id'],_0x4fd15c['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x3d34dd['uniqueid'],_0x15d5d6['id']);_0x4b1952[_0x4d5cbc]=_[_0x6e48('0xf')](_0x3d34dd['routeId'])?_0x3d34dd[_0x6e48('0x18')]:_0x3d34dd[_0x6e48('0x17')];if(_[_0x6e48('0xf')](_0x3d34dd['routeId'])){_0x4b1952['firstName']=_0x3d34dd[_0x6e48('0x2e')]&&_0x3d34dd[_0x6e48('0x2e')]!==''?_0x3d34dd['calleridname']:_0x6e48('0x2f');}else{_0x4b1952[_0x6e48('0x1a')]=_0x3d34dd[_0x6e48('0x30')]&&_0x3d34dd[_0x6e48('0x30')]!==_0x6e48('0x31')?_0x3d34dd[_0x6e48('0x30')]:_0x6e48('0x2f');}_0x4fd15c=_0x4b1952;_0x18828f['push'](_0x4b1952);return;}}})['then'](function(){if(_0x1aa476){emit(_0x3d34dd[_0x6e48('0x27')],_0x15d5d6,util[_0x6e48('0x36')](_0x6e48('0x37'),_0x1aa476[_0x6e48('0x38')]),util['format'](_0x6e48('0x39'),_0x324e1f[_0x6e48('0x3a')]['toLowerCase']()),{'evt':_['merge'](_0x3d34dd,{'autoCreate':_0x1bfa97}),'contact':_0x4fd15c===undefined?{}:_0x4fd15c,'contacts':_0x18828f[_0x6e48('0x24')]===0x0?undefined:_0x18828f});}});}; \ No newline at end of file +var _0xac99=['format','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/logger','defaults','redis','localhost','info','[CM][%s][%s]','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','resolve','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','then','[CM][%s][%s]\x20Contact\x20created:%s','push','user:%s','name'];(function(_0x33ffa2,_0x2ed662){var _0x42bfd4=function(_0x4ba8bb){while(--_0x4ba8bb){_0x33ffa2['push'](_0x33ffa2['shift']());}};_0x42bfd4(++_0x2ed662);}(_0xac99,0x108));var _0x9ac9=function(_0x3bf6bb,_0x4b85c7){_0x3bf6bb=_0x3bf6bb-0x0;var _0x4f9809=_0xac99[_0x3bf6bb];return _0x4f9809;};'use strict';var _=require(_0x9ac9('0x0'));var BPromise=require(_0x9ac9('0x1'));var Redis=require(_0x9ac9('0x2'));var util=require(_0x9ac9('0x3'));var config=require('../../../../config/environment');var logger=require(_0x9ac9('0x4'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config['redis']=_[_0x9ac9('0x5')](config[_0x9ac9('0x6')],{'host':_0x9ac9('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4f7aa8,_0x3dcacf,_0x835e26,_0x2d4db7,_0x1c92cd){logger[_0x9ac9('0x8')](_0x9ac9('0x9'),_0x4f7aa8,_0x3dcacf['id'],_0x835e26,_0x2d4db7,JSON['stringify'](_0x1c92cd));io['to'](_0x835e26)[_0x9ac9('0xa')](_0x2d4db7,_0x1c92cd);}exports[_0x9ac9('0xb')]=function(_0x541d7a,_0x357b8a,_0x3eb06a,_0x2568d2){var _0xdb437f,_0x11759a;var _0x209f3b={};var _0x5b1c15;var _0x27a715=Number(_0x3eb06a[_0x9ac9('0xc')]);var _0x2920e9=_0x3eb06a[_0x9ac9('0xd')]?Boolean(Number(_0x3eb06a[_0x9ac9('0xd')])):![];var _0x4a677c;var _0xa4f73f=![];if(!_['isNil'](_0x3eb06a[_0x9ac9('0xe')])){if(_0x3eb06a[_0x9ac9('0xe')]=='1')_0xa4f73f=!![];}if(!_0xa4f73f){if(_0x2568d2[_0x9ac9('0xf')]){_0x209f3b['id']=_0x2568d2[_0x9ac9('0xf')];}}if(!_0x209f3b['id']){_0x209f3b[_0x9ac9('0x10')]=_0x27a715;_0x4a677c=_0x3eb06a['data3']&&_0x3eb06a[_0x9ac9('0x11')]!=='0'?_0x3eb06a[_0x9ac9('0x11')][_0x9ac9('0x12')](','):[_0x9ac9('0x13')];_0x209f3b[_0x9ac9('0x14')]=_[_0x9ac9('0x15')](_0x4a677c,function(_0x5158d7){var _0x4bb7f1={};_0x4bb7f1[_0x5158d7]=_0x2568d2[_0x9ac9('0x16')]?_0x2568d2[_0x9ac9('0x17')]:_0x2568d2[_0x9ac9('0x18')];return _0x4bb7f1;});_0x5b1c15=_0x2568d2[_0x9ac9('0x16')]?_0x2568d2[_0x9ac9('0x17')]:_0x2568d2[_0x9ac9('0x18')];}var _0xffbed7=['id',_0x9ac9('0x19'),_0x9ac9('0x1a'),_0x9ac9('0x13'),_0x9ac9('0x1b'),_0x9ac9('0x1c'),_0x9ac9('0x10'),'createdAt',_0x9ac9('0x1d'),_0x9ac9('0x1e')];var _0x4b65e1=_['union'](_0xffbed7,_0x4a677c);BPromise[_0x9ac9('0x1f')]()['then'](cmContactRpc['getContacts']({'attributes':_0x4b65e1,'where':_0x209f3b,'phone':_0x5b1c15}))['then'](function(_0x1cd5ff){_0x11759a=_0x1cd5ff;if(!_['isEmpty'](_0x11759a)){if(_0x11759a[_0x9ac9('0x20')]===0x1){_0xdb437f=_0x11759a[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x2568d2[_0x9ac9('0x21')],_0x357b8a['id'],_0xdb437f['id']);}else{logger[_0x9ac9('0x8')](_0x9ac9('0x22'),_0x2568d2[_0x9ac9('0x21')],_0x357b8a['id'],_[_0x9ac9('0x15')](_0x11759a,'id')['join'](','));}return;}else{logger[_0x9ac9('0x8')](_0x9ac9('0x23'),_0x2568d2[_0x9ac9('0x21')],_0x357b8a['id']);var _0x4e0de1={'ListId':_0x27a715};var _0x36a011=_0x3eb06a[_0x9ac9('0x24')]&&_0x3eb06a[_0x9ac9('0x24')]!=='0'?_0x3eb06a['data4']:_0x9ac9('0x13');if(_0x2920e9){logger['info'](_0x9ac9('0x25'),_0x2568d2[_0x9ac9('0x21')],_0x357b8a['id']);_0x4e0de1[_0x36a011]=_['isNil'](_0x2568d2[_0x9ac9('0x16')])?_0x2568d2[_0x9ac9('0x18')]:_0x2568d2['destcalleridnum'];if(_[_0x9ac9('0x26')](_0x2568d2[_0x9ac9('0x16')])){_0x4e0de1[_0x9ac9('0x19')]=_0x2568d2[_0x9ac9('0x27')]&&_0x2568d2['calleridname']!==_0x9ac9('0x28')?_0x2568d2[_0x9ac9('0x27')]:_0x9ac9('0x29');}else{_0x4e0de1['firstName']=_0x2568d2[_0x9ac9('0x2a')]&&_0x2568d2[_0x9ac9('0x2a')]!==_0x9ac9('0x28')?_0x2568d2[_0x9ac9('0x2a')]:_0x9ac9('0x29');}return BPromise[_0x9ac9('0x1f')]()[_0x9ac9('0x2b')](cmContactRpc['createContact'](_0x4e0de1))[_0x9ac9('0x2b')](function(_0x4b955e){_0xdb437f=_0x4b955e;_0x11759a['push'](_0x4b955e);if(_0xdb437f){logger[_0x9ac9('0x8')](_0x9ac9('0x2c'),_0x2568d2[_0x9ac9('0x21')],_0x357b8a['id'],_0xdb437f['id']);}return;});}else{logger[_0x9ac9('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2568d2[_0x9ac9('0x21')],_0x357b8a['id']);_0x4e0de1[_0x36a011]=_[_0x9ac9('0x26')](_0x2568d2[_0x9ac9('0x16')])?_0x2568d2['calleridnum']:_0x2568d2[_0x9ac9('0x17')];if(_['isNil'](_0x2568d2['routeId'])){_0x4e0de1[_0x9ac9('0x19')]=_0x2568d2[_0x9ac9('0x27')]&&_0x2568d2[_0x9ac9('0x27')]!==_0x9ac9('0x28')?_0x2568d2['calleridname']:_0x9ac9('0x29');}else{_0x4e0de1[_0x9ac9('0x19')]=_0x2568d2[_0x9ac9('0x2a')]&&_0x2568d2[_0x9ac9('0x2a')]!==''?_0x2568d2[_0x9ac9('0x2a')]:_0x9ac9('0x29');}_0xdb437f=_0x4e0de1;_0x11759a[_0x9ac9('0x2d')](_0x4e0de1);return;}}})[_0x9ac9('0x2b')](function(){if(_0x541d7a){emit(_0x2568d2[_0x9ac9('0x21')],_0x357b8a,util['format'](_0x9ac9('0x2e'),_0x541d7a[_0x9ac9('0x2f')]),util[_0x9ac9('0x30')](_0x9ac9('0x31'),_0x3eb06a[_0x9ac9('0x32')][_0x9ac9('0x33')]()),{'evt':_['merge'](_0x2568d2,{'autoCreate':_0x2920e9}),'contact':_0xdb437f===undefined?{}:_0xdb437f,'contacts':_0x11759a[_0x9ac9('0x20')]===0x0?undefined:_0x11759a});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 898ee79..1d4a245 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 _0x29b6=['exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','redis','defaults','localhost','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','undefined','motionChannel','voice','checkTriggers','interface','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','buildUri','data3','isNil','data4','location','uriLocation','data5','800','windowHeight','data6','winArguments','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','exec','integration','voiceQueues','routeId','urlforward','script','parse','replace','AllConditions','length','every','checkConditions','some','AnyConditions','channel','field','account','ChatWebsiteId','value','AccountId','interaction','message','event','operator','queue','agent','membername','lastevent','mailSubstatus','null','substatus','created','equals'];(function(_0x1f04d9,_0x248e72){var _0xc3c713=function(_0x485007){while(--_0x485007){_0x1f04d9['push'](_0x1f04d9['shift']());}};_0xc3c713(++_0x248e72);}(_0x29b6,0x17e));var _0x629b=function(_0x539303,_0x2a692e){_0x539303=_0x539303-0x0;var _0x5f2e4e=_0x29b6[_0x539303];return _0x5f2e4e;};'use strict';var util=require(_0x629b('0x0'));var _=require(_0x629b('0x1'));var url=require(_0x629b('0x2'));var Mustache=require(_0x629b('0x3'));var Redis=require(_0x629b('0x4'));var urlforward=require(_0x629b('0x5'));var integration=require(_0x629b('0x6'));var cmContact=require(_0x629b('0x7'));var script=require(_0x629b('0x8'));var config=require(_0x629b('0x9'));var logger=require('../../../config/logger')(_0x629b('0xa'));var ami=require('../ami');config[_0x629b('0xb')]=_[_0x629b('0xc')](config[_0x629b('0xb')],{'host':_0x629b('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x629b('0xb')]));var operators={'equals':function(_0x1b586f,_0x579fcf){return _0x1b586f==_0x579fcf;},'not_equals':function(_0x28c152,_0x232630){return _0x28c152!=_0x232630;}};var barAndWebActions=[_0x629b('0xe'),_0x629b('0x2'),_0x629b('0xf')];function Trigger(_0x3fc3d3){this[_0x629b('0x10')]=_0x3fc3d3[_0x629b('0x10')];this[_0x629b('0x11')]=_0x3fc3d3[_0x629b('0x11')];this['voiceQueues']=_0x3fc3d3['voiceQueues'];this[_0x629b('0x12')]=_0x3fc3d3[_0x629b('0x12')];this[_0x629b('0x13')]=_0x3fc3d3['voiceExtensions'];this[_0x629b('0x14')]=_0x3fc3d3[_0x629b('0x14')];this[_0x629b('0x15')]=_0x3fc3d3[_0x629b('0x15')];this['salesforceAccounts']=_0x3fc3d3[_0x629b('0x16')];this[_0x629b('0x17')]=_0x3fc3d3[_0x629b('0x17')];this[_0x629b('0x18')]=_0x3fc3d3[_0x629b('0x18')];this['deskAccounts']=_0x3fc3d3[_0x629b('0x19')];this['vtigerAccounts']=_0x3fc3d3[_0x629b('0x1a')];this[_0x629b('0x1b')]=_0x3fc3d3[_0x629b('0x1b')];this['dynamics365Accounts']=_0x3fc3d3[_0x629b('0x1c')];this['freshsalesAccounts']=_0x3fc3d3[_0x629b('0x1d')];this['accounts']={'zendesk':this[_0x629b('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x629b('0x15')],'sugarcrm':this[_0x629b('0x17')],'zoho':this[_0x629b('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x629b('0x1a')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x629b('0x1d')],'servicenow':this[_0x629b('0x1b')]};ami['on'](_0x629b('0x1e'),this[_0x629b('0x1f')]['bind'](this));ami['on'](_0x629b('0x20'),this['syncCustomEvent'][_0x629b('0x21')](this));ami['on'](_0x629b('0x22'),this[_0x629b('0x1f')]['bind'](this));ami['on'](_0x629b('0x23'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x24'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x25'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x629b('0x21')](this));ami['on'](_0x629b('0x26'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x27'),this[_0x629b('0x1f')]['bind'](this));ami['on'](_0x629b('0x28'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x29'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x2a'),this[_0x629b('0x1f')]['bind'](this));ami['on']('custom:dialbegin',this[_0x629b('0x2b')][_0x629b('0x21')](this));ami['on']('custom:dialconnect',this[_0x629b('0x2b')]['bind'](this));ami['on'](_0x629b('0x2c'),this[_0x629b('0x2b')]['bind'](this));ami['on'](_0x629b('0x2d'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x2e'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on']('custom:substatus',this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x2f'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x30'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x31'),this[_0x629b('0x1f')][_0x629b('0x21')](this));ami['on'](_0x629b('0x32'),this[_0x629b('0x1f')]['bind'](this));ami['on']('custom:offlineMessage',this[_0x629b('0x1f')][_0x629b('0x21')](this));}Trigger[_0x629b('0x33')][_0x629b('0x34')]=function(_0x564590,_0x311e82,_0x202348){logger[_0x629b('0x35')](_0x564590,_0x311e82,JSON[_0x629b('0x36')](_0x202348));io['to'](_0x564590)['emit'](_0x311e82,_0x202348);};Trigger[_0x629b('0x33')][_0x629b('0x1f')]=function(_0x394729){var _0x316787=_[_0x629b('0x37')](_0x394729);if(typeof _0x316787['motionChannel']===_0x629b('0x38')){_0x316787[_0x629b('0x39')]=_0x629b('0x3a');}this[_0x629b('0x3b')](_0x316787);};Trigger[_0x629b('0x33')][_0x629b('0x2b')]=function(_0x384783){if(this[_0x629b('0x11')][_0x384783[_0x629b('0x3c')]]){this['syncCustomEvent'](_0x384783);}};Trigger[_0x629b('0x33')][_0x629b('0x3b')]=function(_0x49a951){var _0x20f01f;for(var _0x3fdb62 in this[_0x629b('0x10')]){if(this[_0x629b('0x10')]['hasOwnProperty'](_0x3fdb62)){if(this['triggers'][_0x3fdb62][_0x629b('0x3d')]){_0x20f01f=this[_0x629b('0x3e')](this[_0x629b('0x10')][_0x3fdb62],_0x49a951);if(_0x20f01f){_[_0x629b('0x3f')](_0x49a951,_0x49a951[_0x629b('0x40')]);for(var _0x488afd=0x0,_0x3dd1e1,_0x1b30d5,_0xd7d17a;_0x488afd0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x3733ea,_0x58d0e6){var _0x16cab4=function(_0xf72e80){while(--_0xf72e80){_0x3733ea['push'](_0x3733ea['shift']());}};_0x16cab4(++_0x58d0e6);}(_0x55ca,0x126));var _0xa55c=function(_0xe95af,_0x4b849b){_0xe95af=_0xe95af-0x0;var _0x16effb=_0x55ca[_0xe95af];return _0x16effb;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 5612c0d..f009d35 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 _0x9fa4=[']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','tenantId','CloudProvider','resolve','data5','POST','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','catch','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','body','headers','odata-entityid','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','type','customField','idField','substring','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','/systemusers(','callDirection','queue','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','%s/api/data/v9.0/','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9fa4,0x1c1));var _0x49fa=function(_0x3e69cd,_0x10b857){_0x3e69cd=_0x3e69cd-0x0;var _0x4950bd=_0x9fa4[_0x3e69cd];return _0x4950bd;};'use strict';var _=require(_0x49fa('0x0'));var rp=require(_0x49fa('0x1'));var util=require(_0x49fa('0x2'));var intUtil=require(_0x49fa('0x3'));var md5=require(_0x49fa('0x4'));var Redis=require(_0x49fa('0x5'));var logger=require(_0x49fa('0x6'))(_0x49fa('0x7'));var config=require(_0x49fa('0x8'));config[_0x49fa('0x9')]=_[_0x49fa('0xa')](config['redis'],{'host':_0x49fa('0xb'),'port':0x18eb});var io=require(_0x49fa('0xc'))(new Redis(config['redis']));function getAuthToken(_0x67d927,_0x2bf40f,_0xe5e8ca){if(_0x67d927[_0x49fa('0xd')]){_0x67d927['remoteUri']=_0x67d927['CloudProvider']['data7'];_0x67d927[_0x49fa('0xe')]=_0x67d927[_0x49fa('0xf')]['data2'];return Promise[_0x49fa('0x10')](_0x67d927[_0x49fa('0xf')][_0x49fa('0x11')]);}var _0x32d414={'method':_0x49fa('0x12'),'uri':_0x2bf40f,'form':{'client_id':_0x67d927['clientId'],'resource':_0x67d927[_0x49fa('0x13')],'username':_0x67d927[_0x49fa('0x14')],'password':_0x67d927[_0x49fa('0x15')],'grant_type':_0x49fa('0x15'),'client_secret':_0x67d927[_0x49fa('0x16')]},'json':!![]};return rp(_0x32d414)[_0x49fa('0x17')](function(_0x1205a7){return _0x1205a7[_0x49fa('0x18')];})['catch'](function(_0x7c567d){logger[_0x49fa('0x19')]('['+[_0xe5e8ca[_0x49fa('0x1a')]()]+_0x49fa('0x1b'));return _0x7c567d['message'];});}function getUser(_0x36ad47,_0x2bda27,_0x274b70,_0x40550a,_0x15202d,_0x5a8216){return new Promise(function(_0x21899b,_0x27a218){return getAuthToken(_0x2bda27,_0x40550a,_0x5a8216)[_0x49fa('0x17')](function(_0x3c11dc){var _0x3d2e48={'method':_0x49fa('0x1c'),'uri':_0x15202d+_0x49fa('0x1d'),'headers':{'Authorization':_0x49fa('0x1e')+_0x3c11dc,'OData-Version':_0x49fa('0x1f')},'json':!![]};return rp(_0x3d2e48);})[_0x49fa('0x17')](function(_0x2f4c05){var _0x3cc7ff=_0x2f4c05[_0x49fa('0x20')];var _0x120705=![];var _0x3da433=null;if(!_[_0x49fa('0x21')](_0x274b70)){if(intUtil['validateEmail'](_0x274b70[_0x49fa('0x22')])){_0x36ad47['userEmail']=_0x274b70[_0x49fa('0x22')];for(_0x3da433=0x0;_0x3da433<_0x3cc7ff[_0x49fa('0x23')];_0x3da433++){if(_0x3cc7ff[_0x3da433][_0x49fa('0x24')]===_0x274b70[_0x49fa('0x22')]&&!_0x3cc7ff[_0x3da433][_0x49fa('0x25')]){_0x120705=!![];logger[_0x49fa('0x26')]('['+[_0x5a8216['toUpperCase']()]+_0x49fa('0x27')+_0x3cc7ff[_0x3da433][_0x49fa('0x28')]+'!');_0x36ad47[_0x49fa('0x29')]=_0x3cc7ff[_0x3da433][_0x49fa('0x28')];}}}}if(!_0x120705){logger['info']('['+[_0x5a8216['toUpperCase']()]+_0x49fa('0x2a'));_0x36ad47[_0x49fa('0x2b')]=_0x2bda27[_0x49fa('0x14')];for(_0x3da433=0x0;_0x3da433<_0x3cc7ff[_0x49fa('0x23')];_0x3da433++){if(_0x3cc7ff[_0x3da433]['internalemailaddress']===_0x2bda27[_0x49fa('0x14')]){_0x36ad47['userId']=_0x3cc7ff[_0x3da433][_0x49fa('0x28')];}}}_0x21899b(_0x36ad47);})[_0x49fa('0x2c')](function(_0x14a575){_0x27a218(_0x14a575[_0x49fa('0x2d')]);});});}function createEndUser(_0x4bdf94,_0x4d43a4,_0x2bb73a,_0x325852,_0x1e78b7,_0x359bf5,_0x14dde3){return new Promise(function(_0x28402d,_0x3e8bb5){return getAuthToken(_0x4d43a4,_0x2bb73a,_0x359bf5)[_0x49fa('0x17')](function(_0x5c4daa){var _0x1b960f=_0x359bf5[_0x49fa('0x2e')]()===_0x49fa('0x2f')?_0x1e78b7[_0x49fa('0x30')]:_0x1e78b7[_0x49fa('0x31')];var _0x1d8e26={'method':_0x49fa('0x12'),'uri':_0x325852+_0x49fa('0x32'),'body':{'fullname':_0x1b960f,'firstname':_0x1b960f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4bdf94['userId']+')'},'headers':{'Authorization':_0x49fa('0x1e')+_0x5c4daa,'OData-Version':_0x49fa('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x1d8e26[_0x49fa('0x33')][_0x14dde3]=_0x1b960f;return rp(_0x1d8e26);})['then'](function(_0x190374){var _0xb2bd67=_0x190374[_0x49fa('0x34')][_0x49fa('0x35')];var _0x5487cf=_0xb2bd67['substring'](_0xb2bd67[_0x49fa('0x36')]('(')+0x1,_0xb2bd67[_0x49fa('0x36')](')'));_0x4bdf94[_0x49fa('0x37')]=_0x5487cf;_0x28402d(_0x4bdf94);})[_0x49fa('0x2c')](function(_0x3b353f){_0x3e8bb5(_0x3b353f[_0x49fa('0x2d')]);});});}function getEndUser(_0x95841f,_0x22b45f,_0x126bac,_0x413221,_0x239d5,_0x4dff5b,_0x12cc12,_0x2ba04e){var _0x1577b9=_0x4dff5b[_0x49fa('0x2e')]()==='outbound'?_0x239d5['destcalleridnum']:_0x239d5[_0x49fa('0x31')];return getAuthToken(_0x22b45f,_0x126bac,_0x4dff5b)[_0x49fa('0x17')](function(_0x463641){_0x2ba04e=_0x2ba04e?_0x2ba04e:_0x49fa('0x38');var _0x8c1b91={'method':_0x49fa('0x1c'),'uri':_0x413221+_0x49fa('0x39')+_0x2ba04e+_0x49fa('0x3a')+_0x2ba04e+'\x20eq\x20\x27'+_0x1577b9[_0x49fa('0x3b')]('+',_0x49fa('0x3c'))+'\x27','headers':{'Authorization':_0x49fa('0x1e')+_0x463641,'If-None-Match':null,'OData-Version':_0x49fa('0x1f')},'json':!![]};return rp(_0x8c1b91);})['then'](function(_0x1d31ac){var _0x5c22c6=![];if(!_0x1d31ac)return _0x5c22c6;var _0xcbe214=_0x1d31ac['value'];for(var _0x5e2116=0x0;_0x5e2116<_0xcbe214['length'];_0x5e2116++){if(_0xcbe214[_0x5e2116][_0x2ba04e]===_0x1577b9){_0x5c22c6=!![];_0x95841f['enduserId']=_0xcbe214[_0x5e2116][_0x49fa('0x3d')];}}return _0x5c22c6;})[_0x49fa('0x17')](function(_0x2e03f5){if(_0x2e03f5)return _0x95841f;if(_0x12cc12==='nothing'){logger[_0x49fa('0x26')]('['+[_0x4dff5b[_0x49fa('0x1a')]()]+_0x49fa('0x3e'));return _0x95841f;}return createEndUser(_0x95841f,_0x22b45f,_0x126bac,_0x413221,_0x239d5,_0x4dff5b,_0x2ba04e)[_0x49fa('0x17')](function(_0x1b0041){logger['info']('['+[_0x4dff5b[_0x49fa('0x1a')]()]+']\x20Enduser\x20created!',_0x1b0041[_0x49fa('0x37')]);return _0x1b0041;});});}function getCustomFields(_0xe2fa12,_0x5d0849,_0x5444be){var _0x268c38={};if(_0xe2fa12[_0x49fa('0x23')]>0x0){_[_0x49fa('0x3f')](_0xe2fa12,function(_0x575a76){if(_[_0x49fa('0x40')](['string','picklist'],_0x575a76[_0x49fa('0x41')])&&_0x575a76['nameField']&&!_0x575a76[_0x49fa('0x42')]){var _0x230892=_0x575a76[_0x49fa('0x43')][_0x49fa('0x2e')]();var _0x44608e=_0x230892[_0x49fa('0x44')](0x0,_0x230892[_0x49fa('0x45')]('_'));var _0x122690=_0x230892[_0x49fa('0x44')](_0x230892[_0x49fa('0x45')]('_')+0x1);if(_0x44608e===_0x5444be){_0x268c38[_0x122690]=_0x575a76[_0x49fa('0x46')];}}});}return _0x268c38;}function getTicket(_0x58c8b3,_0x1346a3,_0x1757bd,_0x5549a8,_0x28ccfd,_0x3f9bce,_0x6fc2d5){return new Promise(function(_0x4c8c5b,_0x413767){var _0x20c54d;return getAuthToken(_0x1346a3,_0x1757bd,_0x6fc2d5)[_0x49fa('0x17')](function(_0x59fc91){if(_0x3f9bce[_0x49fa('0x47')]===_0x49fa('0x48')){_0x20c54d={'method':_0x49fa('0x12'),'uri':_0x5549a8+_0x49fa('0x49'),'body':Object['assign']({},{'title':intUtil[_0x49fa('0x4a')](_0x3f9bce[_0x49fa('0x4b')],_0x28ccfd,'\x20'),'description':intUtil['getString'](_0x3f9bce[_0x49fa('0x4c')],_0x28ccfd,'\x0a'),'customerid_contact@odata.bind':_0x58c8b3['enduserId']?_0x49fa('0x4d')+_0x58c8b3[_0x49fa('0x37')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x58c8b3[_0x49fa('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x3f9bce[_0x49fa('0x4e')],_0x28ccfd,_0x3f9bce[_0x49fa('0x47')])),'headers':{'Authorization':_0x49fa('0x1e')+_0x59fc91,'OData-Version':_0x49fa('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3f9bce[_0x49fa('0x47')]===_0x49fa('0x4f')){var _0x9627cb=_0x58c8b3['enduserId']?[{'partyid_systemuser@odata.bind':_0x49fa('0x50')+_0x58c8b3[_0x49fa('0x29')]+')','participationtypemask':_0x58c8b3[_0x49fa('0x51')]===_0x49fa('0x52')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x58c8b3[_0x49fa('0x37')]+')','participationtypemask':_0x58c8b3[_0x49fa('0x51')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x49fa('0x50')+_0x58c8b3[_0x49fa('0x29')]+')','participationtypemask':_0x58c8b3[_0x49fa('0x51')]===_0x49fa('0x52')?0x2:0x1}];_0x20c54d={'method':_0x49fa('0x12'),'uri':_0x5549a8+'phonecalls','body':Object['assign']({},{'subject':intUtil['getString'](_0x3f9bce[_0x49fa('0x4b')],_0x28ccfd,'\x20'),'phonenumber':String(_0x28ccfd[_0x49fa('0x31')]),'description':intUtil['getString'](_0x3f9bce['Descriptions'],_0x28ccfd,'\x0a'),'regardingobjectid_contact@odata.bind':_0x58c8b3[_0x49fa('0x37')]?_0x49fa('0x4d')+_0x58c8b3['enduserId']+')':undefined,'ownerid@odata.bind':_0x49fa('0x50')+_0x58c8b3['userId']+')','directioncode':_0x58c8b3[_0x49fa('0x51')]===_0x49fa('0x52')?![]:!![],'phonecall_activity_parties':_0x9627cb},getCustomFields(_0x3f9bce[_0x49fa('0x4e')],_0x28ccfd,_0x3f9bce['ticketType'])),'headers':{'Authorization':_0x49fa('0x1e')+_0x59fc91,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x20c54d);})['then'](function(_0x1ec81e){var _0x3c3cfc=_0x1ec81e[_0x49fa('0x34')][_0x49fa('0x35')];var _0x4b5ffa=_0x3c3cfc[_0x49fa('0x44')](_0x3c3cfc[_0x49fa('0x36')]('(')+0x1,_0x3c3cfc['lastIndexOf'](')'));_0x58c8b3[_0x49fa('0x53')]=_0x4b5ffa;_0x4c8c5b(_0x58c8b3);})['catch'](function(_0x331444){_0x413767(_0x331444[_0x49fa('0x2d')]);});});}function emit(_0x103944,_0x3d60b0,_0x4b1808,_0x3109cd){var _0x77537f={'uri':util[_0x49fa('0x54')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x103944,_0x4b1808,_0x3109cd)};io['to'](util[_0x49fa('0x54')](_0x49fa('0x55'),_0x3d60b0))[_0x49fa('0x56')](_0x49fa('0x57'),_0x77537f);}exports['cs']=function(_0x55c2a3,_0x42e504,_0x442ff6,_0x21d42f,_0xcd9406,_0x4be726,_0x5a77b6,_0x52954c){var _0x524345={};_0x4be726[_0x49fa('0x13')]=_0x4be726['modernAuthentication']?intUtil[_0x49fa('0x58')](_0x4be726[_0x49fa('0xf')][_0x49fa('0x59')]):intUtil['stripTrailingSlash'](_0x4be726[_0x49fa('0x13')]);_0x4be726[_0x49fa('0x5a')]=intUtil['stripTrailingSlash'](_0x4be726['serverUrl']);_0x524345['callDirection']=_0x52954c==='queue'||_0x52954c==='unmanaged'?_0x49fa('0x52'):_0x49fa('0x2f');var _0x1542c0=_0x4be726[_0x49fa('0xd')]?util['format'](_0x49fa('0x5b'),_0x4be726['CloudProvider'][_0x49fa('0x59')]):util['format'](_0x49fa('0x5b'),_0x4be726[_0x49fa('0x13')]);var _0x545e3b=util[_0x49fa('0x54')]('https://login.microsoftonline.com/%s/oauth2/token',_0x4be726[_0x49fa('0xe')]);var _0x42bade=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4be726[_0x49fa('0x5a')],_0x42e504['uniqueid'],md5(_0x42e504[_0x49fa('0x5c')]));if(_0xcd9406&&_0xcd9406[_0x49fa('0x5d')]){logger[_0x49fa('0x26')](_0x49fa('0x5e'),'Recording\x20is\x20enabled!');_0x42e504[_0x49fa('0x5f')]=_0x42bade;}else if(_0x5a77b6&&_0x5a77b6['recordingFormat']&&_0x5a77b6[_0x49fa('0x60')]!==_0x49fa('0x61')){logger[_0x49fa('0x26')](_0x49fa('0x62'),_0x49fa('0x63'));_0x42e504[_0x49fa('0x5f')]=_0x42bade;}else{_0x42e504[_0x49fa('0x5f')]='';}return getUser(_0x524345,_0x4be726,_0x21d42f,_0x545e3b,_0x1542c0,_0x52954c)[_0x49fa('0x17')](function(_0x180051){logger[_0x49fa('0x26')]('['+_0x52954c[_0x49fa('0x1a')]()+_0x49fa('0x64'),_0x180051[_0x49fa('0x29')]);logger[_0x49fa('0x26')]('['+_0x52954c[_0x49fa('0x1a')]()+_0x49fa('0x65'),_0x180051[_0x49fa('0x2b')]);return getEndUser(_0x180051,_0x4be726,_0x545e3b,_0x1542c0,_0x42e504,_0x52954c,_0x442ff6['moduleCreate'],_0x442ff6[_0x49fa('0x66')]);})[_0x49fa('0x17')](function(_0x18bb3b){logger['info']('['+_0x52954c[_0x49fa('0x1a')]()+_0x49fa('0x67'),_0x18bb3b[_0x49fa('0x37')]);logger[_0x49fa('0x26')]('['+_0x52954c[_0x49fa('0x1a')]()+_0x49fa('0x68'),_0x42e504['calleridnum']);return getTicket(_0x18bb3b,_0x4be726,_0x545e3b,_0x1542c0,_0x42e504,_0x442ff6,_0x52954c);})[_0x49fa('0x17')](function(_0x252d56){logger[_0x49fa('0x26')](util[_0x49fa('0x54')]('['+_0x52954c[_0x49fa('0x1a')]()+_0x49fa('0x69'),_0x442ff6['ticketType'],_0x252d56[_0x49fa('0x53')]));logger[_0x49fa('0x26')](util[_0x49fa('0x54')]('['+_0x52954c[_0x49fa('0x1a')]()+_0x49fa('0x6a'),_0x52954c));if(_0x52954c!==_0x49fa('0x6b')){logger['info']('['+_0x52954c[_0x49fa('0x1a')]()+']',_0x49fa('0x6c'));emit(_0x4be726[_0x49fa('0x13')],_0x21d42f[_0x49fa('0x6d')],_0x442ff6[_0x49fa('0x47')],_0x252d56[_0x49fa('0x53')]);}})['catch'](function(_0x15c737){logger[_0x49fa('0x19')]('['+_0x52954c[_0x49fa('0x1a')]()+_0x49fa('0x6e'),_0x15c737[_0x49fa('0x2d')]);});}; \ No newline at end of file +var _0xc97b=['emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','modernAuthentication','remoteUri','CloudProvider','data7','data2','data5','POST','clientId','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','userEmail','email','internalemailaddress','isdisabled','info','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','contacts','4.0','body','headers','odata-entityid','substring','lastIndexOf','enduserId','outbound','destcalleridnum','calleridnum','telephone1','&$filter=','\x20eq\x20\x27','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','picklist','type','nameField','customField','idField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/systemusers(','Fields','ticketType','phonecall','callDirection','queue','/contacts(','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s'];(function(_0xf44a8e,_0x481e2d){var _0x5eb525=function(_0x38d13e){while(--_0x38d13e){_0xf44a8e['push'](_0xf44a8e['shift']());}};_0x5eb525(++_0x481e2d);}(_0xc97b,0x1c8));var _0xbc97=function(_0x1cbff5,_0x4d5c69){_0x1cbff5=_0x1cbff5-0x0;var _0x5fcda9=_0xc97b[_0x1cbff5];return _0x5fcda9;};'use strict';var _=require(_0xbc97('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0xbc97('0x1'));var md5=require(_0xbc97('0x2'));var Redis=require(_0xbc97('0x3'));var logger=require('../../../../config/logger')(_0xbc97('0x4'));var config=require(_0xbc97('0x5'));config[_0xbc97('0x6')]=_[_0xbc97('0x7')](config[_0xbc97('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbc97('0x6')]));function getAuthToken(_0x1f5679,_0x3f201c,_0x2fef13){if(_0x1f5679[_0xbc97('0x8')]){_0x1f5679[_0xbc97('0x9')]=_0x1f5679[_0xbc97('0xa')][_0xbc97('0xb')];_0x1f5679['tenantId']=_0x1f5679[_0xbc97('0xa')][_0xbc97('0xc')];return Promise['resolve'](_0x1f5679[_0xbc97('0xa')][_0xbc97('0xd')]);}var _0x31bd06={'method':_0xbc97('0xe'),'uri':_0x3f201c,'form':{'client_id':_0x1f5679[_0xbc97('0xf')],'resource':_0x1f5679[_0xbc97('0x9')],'username':_0x1f5679[_0xbc97('0x10')],'password':_0x1f5679[_0xbc97('0x11')],'grant_type':_0xbc97('0x11'),'client_secret':_0x1f5679[_0xbc97('0x12')]},'json':!![]};return rp(_0x31bd06)[_0xbc97('0x13')](function(_0x561aa3){return _0x561aa3['access_token'];})[_0xbc97('0x14')](function(_0x3694fd){logger[_0xbc97('0x15')]('['+[_0x2fef13[_0xbc97('0x16')]()]+_0xbc97('0x17'));return _0x3694fd[_0xbc97('0x18')];});}function getUser(_0x1aeff0,_0x546a04,_0x11ead1,_0x4c957b,_0x1d305d,_0x36b0d1){return new Promise(function(_0x5b3dfe,_0x3808b8){return getAuthToken(_0x546a04,_0x4c957b,_0x36b0d1)[_0xbc97('0x13')](function(_0x2202ad){var _0x3c792e={'method':_0xbc97('0x19'),'uri':_0x1d305d+_0xbc97('0x1a'),'headers':{'Authorization':_0xbc97('0x1b')+_0x2202ad,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c792e);})[_0xbc97('0x13')](function(_0x1cd7c1){var _0x4b5f12=_0x1cd7c1[_0xbc97('0x1c')];var _0x3d2281=![];var _0x102f8a=null;if(!_[_0xbc97('0x1d')](_0x11ead1)){if(intUtil[_0xbc97('0x1e')](_0x11ead1['email'])){_0x1aeff0[_0xbc97('0x1f')]=_0x11ead1[_0xbc97('0x20')];for(_0x102f8a=0x0;_0x102f8a<_0x4b5f12['length'];_0x102f8a++){if(_0x4b5f12[_0x102f8a][_0xbc97('0x21')]===_0x11ead1['email']&&!_0x4b5f12[_0x102f8a][_0xbc97('0x22')]){_0x3d2281=!![];logger[_0xbc97('0x23')]('['+[_0x36b0d1['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x4b5f12[_0x102f8a]['systemuserid']+'!');_0x1aeff0[_0xbc97('0x24')]=_0x4b5f12[_0x102f8a][_0xbc97('0x25')];}}}}if(!_0x3d2281){logger['info']('['+[_0x36b0d1['toUpperCase']()]+_0xbc97('0x26'));_0x1aeff0['userEmail']=_0x546a04[_0xbc97('0x10')];for(_0x102f8a=0x0;_0x102f8a<_0x4b5f12[_0xbc97('0x27')];_0x102f8a++){if(_0x4b5f12[_0x102f8a][_0xbc97('0x21')]===_0x546a04[_0xbc97('0x10')]){_0x1aeff0['userId']=_0x4b5f12[_0x102f8a][_0xbc97('0x25')];}}}_0x5b3dfe(_0x1aeff0);})['catch'](function(_0x5b15b6){_0x3808b8(_0x5b15b6[_0xbc97('0x18')]);});});}function createEndUser(_0x49a661,_0x1c7d8e,_0x26a3e4,_0x7b61bf,_0xb0b2b5,_0x4ef4b4,_0xac0aac){return new Promise(function(_0x5378a2,_0x341a68){return getAuthToken(_0x1c7d8e,_0x26a3e4,_0x4ef4b4)[_0xbc97('0x13')](function(_0x4d95c5){var _0x29551f=_0x4ef4b4[_0xbc97('0x28')]()==='outbound'?_0xb0b2b5['destcalleridnum']:_0xb0b2b5['calleridnum'];var _0x1ca171={'method':'POST','uri':_0x7b61bf+_0xbc97('0x29'),'body':{'fullname':_0x29551f,'firstname':_0x29551f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x49a661[_0xbc97('0x24')]+')'},'headers':{'Authorization':_0xbc97('0x1b')+_0x4d95c5,'OData-Version':_0xbc97('0x2a')},'json':!![],'resolveWithFullResponse':!![]};_0x1ca171[_0xbc97('0x2b')][_0xac0aac]=_0x29551f;return rp(_0x1ca171);})[_0xbc97('0x13')](function(_0x3fd2a6){var _0x294632=_0x3fd2a6[_0xbc97('0x2c')][_0xbc97('0x2d')];var _0x329de4=_0x294632[_0xbc97('0x2e')](_0x294632[_0xbc97('0x2f')]('(')+0x1,_0x294632[_0xbc97('0x2f')](')'));_0x49a661[_0xbc97('0x30')]=_0x329de4;_0x5378a2(_0x49a661);})['catch'](function(_0x29ae67){_0x341a68(_0x29ae67[_0xbc97('0x18')]);});});}function getEndUser(_0x1ccd8d,_0x5464e0,_0x1599ff,_0x4ec303,_0x50e114,_0x59e9d1,_0x20c234,_0x1eff06){var _0x190707=_0x59e9d1[_0xbc97('0x28')]()===_0xbc97('0x31')?_0x50e114[_0xbc97('0x32')]:_0x50e114[_0xbc97('0x33')];return getAuthToken(_0x5464e0,_0x1599ff,_0x59e9d1)[_0xbc97('0x13')](function(_0x58b766){_0x1eff06=_0x1eff06?_0x1eff06:_0xbc97('0x34');var _0x2f6ece={'method':_0xbc97('0x19'),'uri':_0x4ec303+'contacts?$select='+_0x1eff06+_0xbc97('0x35')+_0x1eff06+_0xbc97('0x36')+_0x190707['replace']('+',_0xbc97('0x37'))+'\x27','headers':{'Authorization':_0xbc97('0x1b')+_0x58b766,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2f6ece);})[_0xbc97('0x13')](function(_0x1fc3bb){var _0x38a3f4=![];if(!_0x1fc3bb)return _0x38a3f4;var _0x46cc99=_0x1fc3bb[_0xbc97('0x1c')];for(var _0x1e26b7=0x0;_0x1e26b7<_0x46cc99[_0xbc97('0x27')];_0x1e26b7++){if(_0x46cc99[_0x1e26b7][_0x1eff06]===_0x190707){_0x38a3f4=!![];_0x1ccd8d[_0xbc97('0x30')]=_0x46cc99[_0x1e26b7][_0xbc97('0x38')];}}return _0x38a3f4;})[_0xbc97('0x13')](function(_0x4cdbc7){if(_0x4cdbc7)return _0x1ccd8d;if(_0x20c234===_0xbc97('0x39')){logger[_0xbc97('0x23')]('['+[_0x59e9d1['toUpperCase']()]+_0xbc97('0x3a'));return _0x1ccd8d;}return createEndUser(_0x1ccd8d,_0x5464e0,_0x1599ff,_0x4ec303,_0x50e114,_0x59e9d1,_0x1eff06)[_0xbc97('0x13')](function(_0x51d939){logger[_0xbc97('0x23')]('['+[_0x59e9d1['toUpperCase']()]+']\x20Enduser\x20created!',_0x51d939[_0xbc97('0x30')]);return _0x51d939;});});}function getCustomFields(_0x11249a,_0x7543b7,_0x51bcc1){var _0x565bc6={};if(_0x11249a[_0xbc97('0x27')]>0x0){_[_0xbc97('0x3b')](_0x11249a,function(_0x49da23){if(_['includes'](['string',_0xbc97('0x3c')],_0x49da23[_0xbc97('0x3d')])&&_0x49da23[_0xbc97('0x3e')]&&!_0x49da23[_0xbc97('0x3f')]){var _0x2a31a8=_0x49da23[_0xbc97('0x40')][_0xbc97('0x28')]();var _0x6ee914=_0x2a31a8[_0xbc97('0x2e')](0x0,_0x2a31a8[_0xbc97('0x41')]('_'));var _0x38812e=_0x2a31a8['substring'](_0x2a31a8['indexOf']('_')+0x1);if(_0x6ee914===_0x51bcc1){_0x565bc6[_0x38812e]=_0x49da23[_0xbc97('0x42')];}}});}return _0x565bc6;}function getTicket(_0x3ce5c8,_0x196d76,_0x1185f3,_0x1213fc,_0x22245a,_0x38cd38,_0xe543d){return new Promise(function(_0x25addb,_0x4bf569){var _0x3378cb;return getAuthToken(_0x196d76,_0x1185f3,_0xe543d)['then'](function(_0x241307){if(_0x38cd38['ticketType']===_0xbc97('0x43')){_0x3378cb={'method':'POST','uri':_0x1213fc+_0xbc97('0x44'),'body':Object[_0xbc97('0x45')]({},{'title':intUtil[_0xbc97('0x46')](_0x38cd38[_0xbc97('0x47')],_0x22245a,'\x20'),'description':intUtil[_0xbc97('0x46')](_0x38cd38[_0xbc97('0x48')],_0x22245a,'\x0a'),'customerid_contact@odata.bind':_0x3ce5c8[_0xbc97('0x30')]?'/contacts('+_0x3ce5c8[_0xbc97('0x30')]+')':undefined,'ownerid@odata.bind':_0xbc97('0x49')+_0x3ce5c8['userId']+')','caseorigincode':'1'},getCustomFields(_0x38cd38[_0xbc97('0x4a')],_0x22245a,_0x38cd38[_0xbc97('0x4b')])),'headers':{'Authorization':_0xbc97('0x1b')+_0x241307,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x38cd38[_0xbc97('0x4b')]===_0xbc97('0x4c')){var _0x1687ea=_0x3ce5c8[_0xbc97('0x30')]?[{'partyid_systemuser@odata.bind':_0xbc97('0x49')+_0x3ce5c8[_0xbc97('0x24')]+')','participationtypemask':_0x3ce5c8[_0xbc97('0x4d')]===_0xbc97('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0xbc97('0x4f')+_0x3ce5c8[_0xbc97('0x30')]+')','participationtypemask':_0x3ce5c8[_0xbc97('0x4d')]===_0xbc97('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xbc97('0x49')+_0x3ce5c8[_0xbc97('0x24')]+')','participationtypemask':_0x3ce5c8['callDirection']===_0xbc97('0x4e')?0x2:0x1}];_0x3378cb={'method':'POST','uri':_0x1213fc+'phonecalls','body':Object[_0xbc97('0x45')]({},{'subject':intUtil[_0xbc97('0x46')](_0x38cd38['Subjects'],_0x22245a,'\x20'),'phonenumber':String(_0x22245a[_0xbc97('0x33')]),'description':intUtil['getString'](_0x38cd38[_0xbc97('0x48')],_0x22245a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3ce5c8[_0xbc97('0x30')]?_0xbc97('0x4f')+_0x3ce5c8[_0xbc97('0x30')]+')':undefined,'ownerid@odata.bind':_0xbc97('0x49')+_0x3ce5c8[_0xbc97('0x24')]+')','directioncode':_0x3ce5c8['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x1687ea},getCustomFields(_0x38cd38[_0xbc97('0x4a')],_0x22245a,_0x38cd38[_0xbc97('0x4b')])),'headers':{'Authorization':'Bearer\x20'+_0x241307,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3378cb);})['then'](function(_0x434a2b){var _0x2a21ef=_0x434a2b[_0xbc97('0x2c')]['odata-entityid'];var _0x5cb491=_0x2a21ef['substring'](_0x2a21ef[_0xbc97('0x2f')]('(')+0x1,_0x2a21ef['lastIndexOf'](')'));_0x3ce5c8[_0xbc97('0x50')]=_0x5cb491;_0x25addb(_0x3ce5c8);})[_0xbc97('0x14')](function(_0xcee78d){_0x4bf569(_0xcee78d[_0xbc97('0x18')]);});});}function emit(_0x9acd96,_0x2390d8,_0x3b9012,_0x5e26a2){var _0x32e057={'uri':util['format'](_0xbc97('0x51'),_0x9acd96,_0x3b9012,_0x5e26a2)};io['to'](util[_0xbc97('0x52')](_0xbc97('0x53'),_0x2390d8))[_0xbc97('0x54')]('trigger:browser:url',_0x32e057);}exports['cs']=function(_0x1a56ad,_0x8a284d,_0x2e5cc0,_0xade733,_0x54a479,_0x1153b1,_0x1bee8c,_0xd7cacb){var _0x4755de={};_0x1153b1[_0xbc97('0x9')]=_0x1153b1[_0xbc97('0x8')]?intUtil[_0xbc97('0x55')](_0x1153b1[_0xbc97('0xa')][_0xbc97('0xb')]):intUtil[_0xbc97('0x55')](_0x1153b1[_0xbc97('0x9')]);_0x1153b1['serverUrl']=intUtil[_0xbc97('0x55')](_0x1153b1[_0xbc97('0x56')]);_0x4755de[_0xbc97('0x4d')]=_0xd7cacb===_0xbc97('0x4e')||_0xd7cacb==='unmanaged'?_0xbc97('0x4e'):_0xbc97('0x31');var _0x20676b=_0x1153b1[_0xbc97('0x8')]?util[_0xbc97('0x52')]('%s/api/data/v9.0/',_0x1153b1[_0xbc97('0xa')][_0xbc97('0xb')]):util['format'](_0xbc97('0x57'),_0x1153b1[_0xbc97('0x9')]);var _0x133e23=util[_0xbc97('0x52')](_0xbc97('0x58'),_0x1153b1[_0xbc97('0x59')]);var _0x12227f=util[_0xbc97('0x52')](_0xbc97('0x5a'),_0x1153b1['serverUrl'],_0x8a284d[_0xbc97('0x5b')],md5(_0x8a284d['uniqueid']));if(_0x54a479&&_0x54a479['monitor_format']){logger[_0xbc97('0x23')](_0xbc97('0x5c'),_0xbc97('0x5d'));_0x8a284d[_0xbc97('0x5e')]=_0x12227f;}else if(_0x1bee8c&&_0x1bee8c[_0xbc97('0x5f')]&&_0x1bee8c[_0xbc97('0x5f')]!==_0xbc97('0x60')){logger['info'](_0xbc97('0x61'),_0xbc97('0x5d'));_0x8a284d['recordingURL']=_0x12227f;}else{_0x8a284d[_0xbc97('0x5e')]='';}return getUser(_0x4755de,_0x1153b1,_0xade733,_0x133e23,_0x20676b,_0xd7cacb)[_0xbc97('0x13')](function(_0x1cc3ba){logger['info']('['+_0xd7cacb[_0xbc97('0x16')]()+_0xbc97('0x62'),_0x1cc3ba[_0xbc97('0x24')]);logger['info']('['+_0xd7cacb['toUpperCase']()+_0xbc97('0x63'),_0x1cc3ba['userEmail']);return getEndUser(_0x1cc3ba,_0x1153b1,_0x133e23,_0x20676b,_0x8a284d,_0xd7cacb,_0x2e5cc0[_0xbc97('0x64')],_0x2e5cc0[_0xbc97('0x65')]);})['then'](function(_0x23e617){logger['info']('['+_0xd7cacb[_0xbc97('0x16')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x23e617[_0xbc97('0x30')]);logger[_0xbc97('0x23')]('['+_0xd7cacb[_0xbc97('0x16')]()+_0xbc97('0x66'),_0x8a284d[_0xbc97('0x33')]);return getTicket(_0x23e617,_0x1153b1,_0x133e23,_0x20676b,_0x8a284d,_0x2e5cc0,_0xd7cacb);})['then'](function(_0x58dd84){logger[_0xbc97('0x23')](util[_0xbc97('0x52')]('['+_0xd7cacb[_0xbc97('0x16')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2e5cc0['ticketType'],_0x58dd84[_0xbc97('0x50')]));logger[_0xbc97('0x23')](util[_0xbc97('0x52')]('['+_0xd7cacb['toUpperCase']()+_0xbc97('0x67'),_0xd7cacb));if(_0xd7cacb!==_0xbc97('0x68')){logger[_0xbc97('0x23')]('['+_0xd7cacb['toUpperCase']()+']',_0xbc97('0x69'));emit(_0x1153b1[_0xbc97('0x9')],_0xade733[_0xbc97('0x6a')],_0x2e5cc0[_0xbc97('0x4b')],_0x58dd84[_0xbc97('0x50')]);}})[_0xbc97('0x14')](function(_0xe20d2){logger['error']('['+_0xd7cacb[_0xbc97('0x16')]()+_0xbc97('0x6b'),_0xe20d2[_0xbc97('0x18')]);});}; \ 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 545234f..d09f033 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 _0xa3fd=['../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','application/json','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','find','contact','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','customField','idField','push','content','toString','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','stringify','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','[OUTBOUND]','%s/helpdesk/tickets/%d','error','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util'];(function(_0x1ce543,_0xfa9ae){var _0x5e4815=function(_0x1e88c6){while(--_0x1e88c6){_0x1ce543['push'](_0x1ce543['shift']());}};_0x5e4815(++_0xfa9ae);}(_0xa3fd,0x111));var _0xda3f=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xa3fd[_0x580b15];return _0x1adb1b;};'use strict';var _=require(_0xda3f('0x0'));var rp=require(_0xda3f('0x1'));var md5=require(_0xda3f('0x2'));var util=require(_0xda3f('0x3'));var Redis=require(_0xda3f('0x4'));var intUtil=require(_0xda3f('0x5'));var config=require(_0xda3f('0x6'));var logger=require(_0xda3f('0x7'))(_0xda3f('0x8'));config[_0xda3f('0x9')]=_[_0xda3f('0xa')](config[_0xda3f('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xda3f('0x9')]));var headers={'Content-Type':'application/json','Accept':_0xda3f('0xb')};function emit(_0x25b603,_0x385984,_0x28373f){io['to'](_0x25b603)['emit'](_0x385984,_0x28373f);}function getTicket(_0x12ee18,_0x1c5070,_0x3b93d3,_0x373da4,_0x241bb9){logger[_0xda3f('0xc')]('Creating\x20new\x20ticket...');var _0x4b86a2=_[_0xda3f('0xd')]({'responder_id':_0x1c5070['id'],'requester_id':_0x3b93d3['id'],'name':util[_0xda3f('0xe')](_0xda3f('0xf'),_0x241bb9[_0xda3f('0x10')]),'phone':_0x241bb9[_0xda3f('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x373da4['Subjects'],_0x241bb9,'\x20'),'description':intUtil[_0xda3f('0x12')](_0x373da4[_0xda3f('0x13')],_0x241bb9,'
'),'tags':getTags(_0x373da4[_0xda3f('0x14')],_0xda3f('0x15'))},getCustomFields(_0x373da4[_0xda3f('0x16')],_0x241bb9));_0x4b86a2[_0xda3f('0x17')]=_[_0xda3f('0x18')](_[_0xda3f('0x19')](_0x4b86a2['custom_fields'],'id'),_0xda3f('0x1a'));return request({'uri':util[_0xda3f('0xe')]('%s/api/v2/tickets',_0x12ee18[_0xda3f('0x1b')]),'method':_0xda3f('0x1c'),'body':_0x4b86a2})[_0xda3f('0x1d')](function(_0xfc12fe){logger[_0xda3f('0xc')](_0xda3f('0x1e'));return _0xfc12fe;});}function getUser(_0xf792b9,_0x37595e){if(intUtil['validateEmail'](_0x37595e)){return request({'uri':util['format'](_0xda3f('0x1f'),_0xf792b9[_0xda3f('0x1b')]),'qs':{'email':_0x37595e}})[_0xda3f('0x1d')](function(_0x53e03e){if(_0x53e03e[_0xda3f('0x20')]){logger[_0xda3f('0xc')]('Agent\x20found!');return _[_0xda3f('0x21')](_0x53e03e,function(_0x4044a0){return _0x4044a0[_0xda3f('0x22')]['email']===_0x37595e;});}else{logger[_0xda3f('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xda3f('0xe')]('%s/api/v2/agents/me',_0xf792b9[_0xda3f('0x1b')])})[_0xda3f('0x1d')](function(_0x3229a7){logger[_0xda3f('0xc')](_0xda3f('0x23'));return _0x3229a7;});}});}else{logger[_0xda3f('0xc')](_0xda3f('0x24'));return request({'uri':util[_0xda3f('0xe')](_0xda3f('0x25'),_0xf792b9[_0xda3f('0x1b')])})[_0xda3f('0x1d')](function(_0x18f8f5){logger[_0xda3f('0xc')](_0xda3f('0x23'));return _0x18f8f5;});}}function getEndUser(_0x3380f4,_0xedd873,_0x115228){logger[_0xda3f('0xc')]('Searching\x20enduser\x20with\x20phone',_0x115228);return request({'uri':util['format'](_0xda3f('0x26'),_0x3380f4[_0xda3f('0x1b')]),'qs':{'phone':_0x115228}})[_0xda3f('0x1d')](function(_0x59e2a4){if(_0x59e2a4['length']){logger[_0xda3f('0xc')](_0xda3f('0x27'));return _[_0xda3f('0x21')](_0x59e2a4,{'phone':_0x115228});}else{logger['info'](_0xda3f('0x28'));return request({'uri':util[_0xda3f('0xe')](_0xda3f('0x26'),_0x3380f4[_0xda3f('0x1b')]),'method':_0xda3f('0x1c'),'body':{'name':_0xedd873,'phone':_0x115228}})[_0xda3f('0x1d')](function(_0x52b06e){logger[_0xda3f('0xc')](_0xda3f('0x29'));return _0x52b06e;});}});}function getAuth(_0x1840bf){return util['format'](_0xda3f('0x2a'),new Buffer(_0x1840bf['apiKey']+':X')['toString'](_0xda3f('0x2b')));}function request(_0x135485){logger[_0xda3f('0x2c')](_0xda3f('0x2d'),JSON['stringify'](_0x135485));return rp(_[_0xda3f('0xa')](_0x135485,{'method':_0xda3f('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x53ce1f,_0x597cae){var _0x50a394=[];if(_0x53ce1f&&_0x53ce1f[_0xda3f('0x20')]>0x0){_0x50a394=_[_0xda3f('0x2f')](_0x53ce1f,_0x597cae);}return _0x50a394;}function getCustomFields(_0x2e41bb,_0x2c2015){var _0x49a2f6=[];var _0x554b88={'custom_fields':[]};if(_0x2e41bb[_0xda3f('0x20')]>0x0){_[_0xda3f('0x30')](_0x2e41bb,function(_0x56f155){if(_[_0xda3f('0x31')]([_0xda3f('0x32'),_0xda3f('0x33')],_0x56f155[_0xda3f('0x34')])&&_0x56f155[_0xda3f('0x35')]&&!_0x56f155[_0xda3f('0x36')]){_0x554b88[_0x56f155['nameField']['toLowerCase']()]=_0x56f155['content']['toString']();}else if(_[_0xda3f('0x31')]([_0xda3f('0x32'),_0xda3f('0x33')],_0x56f155['type'])&&_0x56f155[_0xda3f('0x37')]&&_0x56f155[_0xda3f('0x36')]){_0x554b88[_0xda3f('0x17')][_0xda3f('0x38')]({'id':_0x56f155[_0xda3f('0x37')],'value':_0x56f155[_0xda3f('0x39')][_0xda3f('0x3a')]()});}else if(_0x56f155[_0xda3f('0x34')]===_0xda3f('0x3b')&&_0x56f155[_0xda3f('0x3c')]&&_0x56f155[_0xda3f('0x37')]&&_0x56f155[_0xda3f('0x36')]){_0x2c2015[_0x56f155[_0xda3f('0x3c')]]&&_0x554b88[_0xda3f('0x17')]['push']({'id':_0x56f155['idField'],'value':_0x2c2015[_0x56f155[_0xda3f('0x3c')]][_0xda3f('0x3a')]()});}else if(_0x56f155[_0xda3f('0x34')]===_0xda3f('0x3d')&&_0x56f155[_0xda3f('0x3e')]&&_0x56f155[_0xda3f('0x3e')]['name']&&_0x56f155[_0xda3f('0x37')]&&_0x56f155[_0xda3f('0x36')]){_0x2c2015[_0x56f155[_0xda3f('0x3e')]['name'][_0xda3f('0x3f')]()]&&_0x554b88['custom_fields']['push']({'id':_0x56f155[_0xda3f('0x37')],'value':_0x2c2015[_0x56f155[_0xda3f('0x3e')][_0xda3f('0x15')][_0xda3f('0x3f')]()][_0xda3f('0x3a')]()});}});}return _0x554b88;}exports[_0xda3f('0x40')]=function(_0x38513e,_0x37849f,_0xd09447,_0x1d50c8,_0x13b5e6,_0x4dc73c){var _0x1c798f,_0x577b66;_0x4dc73c[_0xda3f('0x1b')]=intUtil[_0xda3f('0x41')](_0x4dc73c[_0xda3f('0x1b')]);_0x4dc73c['serverUrl']=intUtil['stripTrailingSlash'](_0x4dc73c[_0xda3f('0x42')]);if(_0x13b5e6&&_0x13b5e6[_0xda3f('0x43')]){logger['info'](_0xda3f('0x44'),_0xda3f('0x45'));_0x37849f[_0xda3f('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4dc73c[_0xda3f('0x42')],_0x37849f['uniqueid'],md5(_0x37849f[_0xda3f('0x47')]));}else{_0x37849f[_0xda3f('0x46')]='';}headers[_0xda3f('0x48')]=getAuth(_0x4dc73c);return getUser(_0x4dc73c,_0x1d50c8[_0xda3f('0x49')])['then'](function(_0xce234e){_0x1c798f=_0xce234e;logger[_0xda3f('0xc')]('The\x20User\x20ID\x20is:',_0x1c798f['id']);return getEndUser(_0x4dc73c,_0x37849f[_0xda3f('0x10')],_0x37849f[_0xda3f('0x11')]);})['then'](function(_0x1a9e47){_0x577b66=_0x1a9e47;logger[_0xda3f('0xc')](_0xda3f('0x4a'),_0x577b66['id']);return getTicket(_0x4dc73c,_0x1c798f,_0x577b66,_0xd09447,_0x37849f);})[_0xda3f('0x1d')](function(_0x20ba7f){if(_0x20ba7f&&_0x20ba7f['id']){logger[_0xda3f('0xc')](_0xda3f('0x1e'));logger['info'](_0xda3f('0x4b'),_0x20ba7f['id']);logger['info'](_0xda3f('0x44'),_0xda3f('0x4c'));emit(util[_0xda3f('0xe')](_0xda3f('0x4d'),_0x1d50c8[_0xda3f('0x15')]),_0xda3f('0x4e'),{'uri':util[_0xda3f('0xe')]('%s/helpdesk/tickets/%d',_0x4dc73c[_0xda3f('0x1b')],_0x20ba7f['id'])});}})[_0xda3f('0x4f')](function(_0x4ef484){logger['error'](_0xda3f('0x44'),JSON[_0xda3f('0x50')](_0x4ef484));});};exports[_0xda3f('0x51')]=function(_0x4adb8d,_0x297870,_0x2788f1,_0x33768e,_0x5487c3,_0x255e0c,_0x43378f){var _0x423dc2,_0x58e66d;_0x255e0c[_0xda3f('0x1b')]=intUtil[_0xda3f('0x41')](_0x255e0c[_0xda3f('0x1b')]);_0x255e0c[_0xda3f('0x42')]=intUtil[_0xda3f('0x41')](_0x255e0c['serverUrl']);if(_0x43378f&&_0x43378f[_0xda3f('0x52')]&&_0x43378f[_0xda3f('0x52')]!==_0xda3f('0x53')){logger[_0xda3f('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x297870[_0xda3f('0x46')]=util['format'](_0xda3f('0x54'),_0x255e0c[_0xda3f('0x42')],_0x297870[_0xda3f('0x47')],md5(_0x297870['uniqueid']));}headers['Authorization']=getAuth(_0x255e0c);return getUser(_0x255e0c,_0x33768e[_0xda3f('0x49')])['then'](function(_0x4af48c){_0x423dc2=_0x4af48c;logger[_0xda3f('0xc')](_0xda3f('0x55'),_0x423dc2['id']);return getEndUser(_0x255e0c,_0x297870[_0xda3f('0x56')],_0x297870['destcalleridnum']);})[_0xda3f('0x1d')](function(_0xe37333){_0x58e66d=_0xe37333;logger['info']('The\x20Enduser\x20ID\x20is:',_0x58e66d['id']);return getTicket(_0x255e0c,_0x423dc2,_0x58e66d,_0x2788f1,_0x297870);})[_0xda3f('0x1d')](function(_0x32c7aa){if(_0x32c7aa&&_0x32c7aa['id']){logger[_0xda3f('0xc')](_0xda3f('0x1e'));logger[_0xda3f('0xc')]('The\x20Ticket\x20ID\x20is:',_0x32c7aa['id']);logger[_0xda3f('0xc')](_0xda3f('0x57'),_0xda3f('0x4c'));emit(util[_0xda3f('0xe')](_0xda3f('0x4d'),_0x33768e[_0xda3f('0x15')]),_0xda3f('0x4e'),{'uri':util[_0xda3f('0xe')](_0xda3f('0x58'),_0x255e0c[_0xda3f('0x1b')],_0x32c7aa['id'])});}})[_0xda3f('0x4f')](function(_0x107260){logger[_0xda3f('0x59')]('[OUTBOUND]',JSON[_0xda3f('0x50')](_0x107260));});};exports[_0xda3f('0x5a')]=function(_0x109ffa,_0x270946,_0x1fb121,_0x4d295,_0x22f934,_0x165435){var _0x3f3d1a,_0x58b98d;_0x165435[_0xda3f('0x1b')]=intUtil[_0xda3f('0x41')](_0x165435[_0xda3f('0x1b')]);_0x165435[_0xda3f('0x42')]=intUtil['stripTrailingSlash'](_0x165435['serverUrl']);if(_0x22f934&&_0x22f934[_0xda3f('0x43')]){logger['info']('['+_0x270946['lastevent'][_0xda3f('0x5b')]()+']','Recording\x20is\x20enabled!');_0x270946[_0xda3f('0x46')]=util[_0xda3f('0xe')](_0xda3f('0x54'),_0x165435[_0xda3f('0x42')],_0x270946['uniqueid'],md5(_0x270946[_0xda3f('0x47')]));}else{_0x270946['recordingURL']='';}headers[_0xda3f('0x48')]=getAuth(_0x165435);return getUser(_0x165435,'')['then'](function(_0xfdf79){_0x3f3d1a=_0xfdf79;logger[_0xda3f('0xc')](_0xda3f('0x55'),_0x3f3d1a['id']);return getEndUser(_0x165435,_0x270946[_0xda3f('0x10')],_0x270946[_0xda3f('0x11')]);})['then'](function(_0x466004){_0x58b98d=_0x466004;logger[_0xda3f('0xc')]('The\x20Enduser\x20ID\x20is:',_0x58b98d['id']);return getTicket(_0x165435,_0x3f3d1a,_0x58b98d,_0x1fb121,_0x270946);})[_0xda3f('0x1d')](function(_0x456b26){if(_0x456b26){logger[_0xda3f('0xc')](_0xda3f('0x1e'));logger[_0xda3f('0xc')](_0xda3f('0x4b'),_0x456b26['id']);}})['catch'](function(_0x565250){logger[_0xda3f('0x59')]('['+_0x270946[_0xda3f('0x5c')][_0xda3f('0x5b')]()+']',JSON['stringify'](_0x565250));});}; \ No newline at end of file +var _0x5bd2=['apiKey','base64','debug','[HTTP]','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','toString','includes','idField','push','variable','variableName','Variable','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','user:%s','trigger:browser:url','stringify','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','find','Enduser\x20created.'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5bd2,0xe3));var _0x25bd=function(_0x11da95,_0x1bf0c9){_0x11da95=_0x11da95-0x0;var _0x5a2800=_0x5bd2[_0x11da95];return _0x5a2800;};'use strict';var _=require(_0x25bd('0x0'));var rp=require(_0x25bd('0x1'));var md5=require(_0x25bd('0x2'));var util=require(_0x25bd('0x3'));var Redis=require(_0x25bd('0x4'));var intUtil=require(_0x25bd('0x5'));var config=require(_0x25bd('0x6'));var logger=require(_0x25bd('0x7'))(_0x25bd('0x8'));config[_0x25bd('0x9')]=_[_0x25bd('0xa')](config[_0x25bd('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x25bd('0xb'))(new Redis(config[_0x25bd('0x9')]));var headers={'Content-Type':_0x25bd('0xc'),'Accept':_0x25bd('0xc')};function emit(_0x195e6f,_0x139be1,_0x246146){io['to'](_0x195e6f)[_0x25bd('0xd')](_0x139be1,_0x246146);}function getTicket(_0x44815a,_0x390308,_0x89f2fd,_0x2bc3e0,_0x5b3194){logger[_0x25bd('0xe')](_0x25bd('0xf'));var _0x18767e=_[_0x25bd('0x10')]({'responder_id':_0x390308['id'],'requester_id':_0x89f2fd['id'],'name':util[_0x25bd('0x11')](_0x25bd('0x12'),_0x5b3194[_0x25bd('0x13')]),'phone':_0x5b3194[_0x25bd('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x25bd('0x15')](_0x2bc3e0['Subjects'],_0x5b3194,'\x20'),'description':intUtil[_0x25bd('0x15')](_0x2bc3e0['Descriptions'],_0x5b3194,_0x25bd('0x16')),'tags':getTags(_0x2bc3e0[_0x25bd('0x17')],_0x25bd('0x18'))},getCustomFields(_0x2bc3e0[_0x25bd('0x19')],_0x5b3194));_0x18767e[_0x25bd('0x1a')]=_[_0x25bd('0x1b')](_[_0x25bd('0x1c')](_0x18767e[_0x25bd('0x1a')],'id'),_0x25bd('0x1d'));return request({'uri':util[_0x25bd('0x11')]('%s/api/v2/tickets',_0x44815a[_0x25bd('0x1e')]),'method':_0x25bd('0x1f'),'body':_0x18767e})[_0x25bd('0x20')](function(_0x27f43e){logger['info'](_0x25bd('0x21'));return _0x27f43e;});}function getUser(_0x459692,_0x531a22){if(intUtil[_0x25bd('0x22')](_0x531a22)){return request({'uri':util[_0x25bd('0x11')](_0x25bd('0x23'),_0x459692['remoteUri']),'qs':{'email':_0x531a22}})['then'](function(_0x274e37){if(_0x274e37['length']){logger[_0x25bd('0xe')](_0x25bd('0x24'));return _['find'](_0x274e37,function(_0x149970){return _0x149970[_0x25bd('0x25')][_0x25bd('0x26')]===_0x531a22;});}else{logger[_0x25bd('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x25bd('0x11')](_0x25bd('0x27'),_0x459692[_0x25bd('0x1e')])})['then'](function(_0x42bbbd){logger['info']('Admin\x20account\x20selected.');return _0x42bbbd;});}});}else{logger[_0x25bd('0xe')](_0x25bd('0x28'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x459692[_0x25bd('0x1e')])})[_0x25bd('0x20')](function(_0x932232){logger['info'](_0x25bd('0x29'));return _0x932232;});}}function getEndUser(_0x54dd8e,_0x489af5,_0x340f36){logger[_0x25bd('0xe')](_0x25bd('0x2a'),_0x340f36);return request({'uri':util['format']('%s/api/v2/contacts',_0x54dd8e[_0x25bd('0x1e')]),'qs':{'phone':_0x340f36}})[_0x25bd('0x20')](function(_0x215bfa){if(_0x215bfa[_0x25bd('0x2b')]){logger[_0x25bd('0xe')]('Enduser\x20found!');return _[_0x25bd('0x2c')](_0x215bfa,{'phone':_0x340f36});}else{logger[_0x25bd('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x25bd('0x11')]('%s/api/v2/contacts',_0x54dd8e['remoteUri']),'method':_0x25bd('0x1f'),'body':{'name':_0x489af5,'phone':_0x340f36}})[_0x25bd('0x20')](function(_0x78a6cb){logger[_0x25bd('0xe')](_0x25bd('0x2d'));return _0x78a6cb;});}});}function getAuth(_0x576eb9){return util['format']('Basic\x20%s',new Buffer(_0x576eb9[_0x25bd('0x2e')]+':X')['toString'](_0x25bd('0x2f')));}function request(_0x42dd3d){logger[_0x25bd('0x30')](_0x25bd('0x31'),JSON['stringify'](_0x42dd3d));return rp(_[_0x25bd('0xa')](_0x42dd3d,{'method':_0x25bd('0x32'),'headers':headers,'json':!![]}));}function getTags(_0xbed50d,_0x5a0a13){var _0x1b7142=[];if(_0xbed50d&&_0xbed50d[_0x25bd('0x2b')]>0x0){_0x1b7142=_[_0x25bd('0x33')](_0xbed50d,_0x5a0a13);}return _0x1b7142;}function getCustomFields(_0x4b335f,_0x34939b){var _0x591f97=[];var _0x5e1419={'custom_fields':[]};if(_0x4b335f[_0x25bd('0x2b')]>0x0){_[_0x25bd('0x34')](_0x4b335f,function(_0x55906a){if(_['includes']([_0x25bd('0x35'),_0x25bd('0x36')],_0x55906a[_0x25bd('0x37')])&&_0x55906a[_0x25bd('0x38')]&&!_0x55906a[_0x25bd('0x39')]){_0x5e1419[_0x55906a['nameField'][_0x25bd('0x3a')]()]=_0x55906a['content'][_0x25bd('0x3b')]();}else if(_[_0x25bd('0x3c')](['string',_0x25bd('0x36')],_0x55906a[_0x25bd('0x37')])&&_0x55906a[_0x25bd('0x3d')]&&_0x55906a[_0x25bd('0x39')]){_0x5e1419['custom_fields'][_0x25bd('0x3e')]({'id':_0x55906a[_0x25bd('0x3d')],'value':_0x55906a['content']['toString']()});}else if(_0x55906a['type']===_0x25bd('0x3f')&&_0x55906a[_0x25bd('0x40')]&&_0x55906a[_0x25bd('0x3d')]&&_0x55906a['customField']){_0x34939b[_0x55906a[_0x25bd('0x40')]]&&_0x5e1419[_0x25bd('0x1a')][_0x25bd('0x3e')]({'id':_0x55906a['idField'],'value':_0x34939b[_0x55906a[_0x25bd('0x40')]][_0x25bd('0x3b')]()});}else if(_0x55906a[_0x25bd('0x37')]==='customVariable'&&_0x55906a['Variable']&&_0x55906a['Variable'][_0x25bd('0x18')]&&_0x55906a[_0x25bd('0x3d')]&&_0x55906a[_0x25bd('0x39')]){_0x34939b[_0x55906a[_0x25bd('0x41')][_0x25bd('0x18')]['toLowerCase']()]&&_0x5e1419[_0x25bd('0x1a')][_0x25bd('0x3e')]({'id':_0x55906a[_0x25bd('0x3d')],'value':_0x34939b[_0x55906a[_0x25bd('0x41')][_0x25bd('0x18')]['toLowerCase']()][_0x25bd('0x3b')]()});}});}return _0x5e1419;}exports['queue']=function(_0x144468,_0x5cdbd7,_0x405be3,_0x3ac6ad,_0x502104,_0x31fda7){var _0x331c9f,_0x276450;_0x31fda7['remoteUri']=intUtil[_0x25bd('0x42')](_0x31fda7[_0x25bd('0x1e')]);_0x31fda7['serverUrl']=intUtil[_0x25bd('0x42')](_0x31fda7['serverUrl']);if(_0x502104&&_0x502104[_0x25bd('0x43')]){logger[_0x25bd('0xe')](_0x25bd('0x44'),'Recording\x20is\x20enabled!');_0x5cdbd7[_0x25bd('0x45')]=util[_0x25bd('0x11')](_0x25bd('0x46'),_0x31fda7[_0x25bd('0x47')],_0x5cdbd7[_0x25bd('0x48')],md5(_0x5cdbd7[_0x25bd('0x48')]));}else{_0x5cdbd7[_0x25bd('0x45')]='';}headers[_0x25bd('0x49')]=getAuth(_0x31fda7);return getUser(_0x31fda7,_0x3ac6ad[_0x25bd('0x26')])[_0x25bd('0x20')](function(_0x103ed4){_0x331c9f=_0x103ed4;logger['info'](_0x25bd('0x4a'),_0x331c9f['id']);return getEndUser(_0x31fda7,_0x5cdbd7[_0x25bd('0x13')],_0x5cdbd7[_0x25bd('0x14')]);})[_0x25bd('0x20')](function(_0xf58c0c){_0x276450=_0xf58c0c;logger[_0x25bd('0xe')](_0x25bd('0x4b'),_0x276450['id']);return getTicket(_0x31fda7,_0x331c9f,_0x276450,_0x405be3,_0x5cdbd7);})[_0x25bd('0x20')](function(_0x343763){if(_0x343763&&_0x343763['id']){logger['info'](_0x25bd('0x21'));logger[_0x25bd('0xe')](_0x25bd('0x4c'),_0x343763['id']);logger[_0x25bd('0xe')](_0x25bd('0x44'),_0x25bd('0x4d'));emit(util['format']('user:%s',_0x3ac6ad['name']),'trigger:browser:url',{'uri':util[_0x25bd('0x11')](_0x25bd('0x4e'),_0x31fda7[_0x25bd('0x1e')],_0x343763['id'])});}})[_0x25bd('0x4f')](function(_0x88f0d3){logger[_0x25bd('0x50')](_0x25bd('0x44'),JSON['stringify'](_0x88f0d3));});};exports[_0x25bd('0x51')]=function(_0x83eb0c,_0x48cff4,_0x1e306f,_0x3d11c,_0x4f254d,_0x4ff54b,_0x33772e){var _0x215b66,_0x5be921;_0x4ff54b[_0x25bd('0x1e')]=intUtil['stripTrailingSlash'](_0x4ff54b['remoteUri']);_0x4ff54b[_0x25bd('0x47')]=intUtil[_0x25bd('0x42')](_0x4ff54b['serverUrl']);if(_0x33772e&&_0x33772e[_0x25bd('0x52')]&&_0x33772e[_0x25bd('0x52')]!==_0x25bd('0x53')){logger[_0x25bd('0xe')](_0x25bd('0x54'),_0x25bd('0x55'));_0x48cff4[_0x25bd('0x45')]=util['format'](_0x25bd('0x46'),_0x4ff54b[_0x25bd('0x47')],_0x48cff4[_0x25bd('0x48')],md5(_0x48cff4[_0x25bd('0x48')]));}headers[_0x25bd('0x49')]=getAuth(_0x4ff54b);return getUser(_0x4ff54b,_0x3d11c['email'])[_0x25bd('0x20')](function(_0x1d6867){_0x215b66=_0x1d6867;logger[_0x25bd('0xe')]('The\x20User\x20ID\x20is:',_0x215b66['id']);return getEndUser(_0x4ff54b,_0x48cff4['destcalleridname'],_0x48cff4['destcalleridnum']);})['then'](function(_0x43b18f){_0x5be921=_0x43b18f;logger[_0x25bd('0xe')](_0x25bd('0x4b'),_0x5be921['id']);return getTicket(_0x4ff54b,_0x215b66,_0x5be921,_0x1e306f,_0x48cff4);})[_0x25bd('0x20')](function(_0x340984){if(_0x340984&&_0x340984['id']){logger[_0x25bd('0xe')](_0x25bd('0x21'));logger[_0x25bd('0xe')](_0x25bd('0x4c'),_0x340984['id']);logger['info'](_0x25bd('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x25bd('0x11')](_0x25bd('0x56'),_0x3d11c['name']),_0x25bd('0x57'),{'uri':util[_0x25bd('0x11')]('%s/helpdesk/tickets/%d',_0x4ff54b[_0x25bd('0x1e')],_0x340984['id'])});}})[_0x25bd('0x4f')](function(_0x99ac17){logger['error']('[OUTBOUND]',JSON[_0x25bd('0x58')](_0x99ac17));});};exports['unmanaged']=function(_0x14d6d3,_0x305544,_0x18f349,_0xef985,_0x2baf7e,_0x1cea3f){var _0x590eda,_0x168e9d;_0x1cea3f[_0x25bd('0x1e')]=intUtil['stripTrailingSlash'](_0x1cea3f[_0x25bd('0x1e')]);_0x1cea3f['serverUrl']=intUtil['stripTrailingSlash'](_0x1cea3f['serverUrl']);if(_0x2baf7e&&_0x2baf7e[_0x25bd('0x43')]){logger[_0x25bd('0xe')]('['+_0x305544[_0x25bd('0x59')][_0x25bd('0x5a')]()+']',_0x25bd('0x55'));_0x305544['recordingURL']=util['format'](_0x25bd('0x46'),_0x1cea3f[_0x25bd('0x47')],_0x305544['uniqueid'],md5(_0x305544[_0x25bd('0x48')]));}else{_0x305544['recordingURL']='';}headers['Authorization']=getAuth(_0x1cea3f);return getUser(_0x1cea3f,'')['then'](function(_0x1fd715){_0x590eda=_0x1fd715;logger[_0x25bd('0xe')](_0x25bd('0x4a'),_0x590eda['id']);return getEndUser(_0x1cea3f,_0x305544[_0x25bd('0x13')],_0x305544[_0x25bd('0x14')]);})[_0x25bd('0x20')](function(_0x362774){_0x168e9d=_0x362774;logger[_0x25bd('0xe')](_0x25bd('0x4b'),_0x168e9d['id']);return getTicket(_0x1cea3f,_0x590eda,_0x168e9d,_0x18f349,_0x305544);})['then'](function(_0x7ca087){if(_0x7ca087){logger[_0x25bd('0xe')](_0x25bd('0x21'));logger[_0x25bd('0xe')](_0x25bd('0x4c'),_0x7ca087['id']);}})[_0x25bd('0x4f')](function(_0xea45a4){logger['error']('['+_0x305544['lastevent'][_0x25bd('0x5a')]()+']',JSON[_0x25bd('0x58')](_0xea45a4));});}; \ 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 2f6ed7b..61b45d3 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 _0xaaca=['stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','users','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','catch','error','&f=','&entities=contact','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','/api/contacts','format','Creating\x20new\x20task','POST','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri'];(function(_0x59ab07,_0x3f52ee){var _0x2fe358=function(_0xb03a55){while(--_0xb03a55){_0x59ab07['push'](_0x59ab07['shift']());}};_0x2fe358(++_0x3f52ee);}(_0xaaca,0x107));var _0xaaac=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xaaca[_0x5c6299];return _0x23b564;};'use strict';var _=require('lodash');var rp=require(_0xaaac('0x0'));var md5=require('md5');var util=require(_0xaaac('0x1'));var moment=require(_0xaaac('0x2'));var Promise=require(_0xaaac('0x3'));var Redis=require(_0xaaac('0x4'));var intUtil=require(_0xaaac('0x5'));var config=require(_0xaaac('0x6'));var logger=require(_0xaaac('0x7'))(_0xaaac('0x8'));config[_0xaaac('0x9')]=_['defaults'](config[_0xaaac('0x9')],{'host':_0xaaac('0xa'),'port':0x18eb});var io=require(_0xaaac('0xb'))(new Redis(config[_0xaaac('0x9')]));function getAdminId(_0xe11da6,_0x21766e,_0x5127de,_0x1c2576){return new Promise(function(_0x596480,_0x210f54){var _0x431009=![];var _0x2ff923={'method':_0xaaac('0xc'),'uri':_0x1c2576+'/api/selector/owners','json':!![]};_0x2ff923[_0xaaac('0xd')]=_0x5127de;logger[_0xaaac('0xe')](_0xaaac('0xf'));return rp(_0x2ff923)['then'](function(_0x15c975){if(_0x15c975){var _0x570be8=_0x15c975[_0xaaac('0x10')];var _0x5c832b=null;for(_0x5c832b=0x0;_0x5c832b<_0x570be8['length'];_0x5c832b++){if(_0x570be8[_0x5c832b]['email']===_0xe11da6[_0xaaac('0x11')]){_0xe11da6[_0xaaac('0x12')]=_0x570be8[_0x5c832b]['id'];_0x431009=!![];}}if(_0x431009){logger[_0xaaac('0xe')](_0xaaac('0x13'),_0xe11da6[_0xaaac('0x12')]);_0x596480(_0xe11da6);}else{_0x210f54({'statusCode':0x194,'message':_0xaaac('0x14')});}}else{_0x210f54({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x35266b){logger['error']('['+[_0x21766e[_0xaaac('0x15')]()]+']',_0x35266b[_0xaaac('0x16')]);_0x210f54(_0x35266b);});});}function getUser(_0x1a5de6,_0x2af545,_0x1cca6b){return function(_0x4a266e){return new Promise(function(_0xc62f61,_0x420834){var _0x3bb8a4={'method':'GET','uri':_0x1cca6b+'/api/selector/owners','json':!![]};_0x3bb8a4['headers']=_0x2af545;logger[_0xaaac('0xe')](_0xaaac('0x17'));return rp(_0x3bb8a4)[_0xaaac('0x18')](function(_0x2f8970){if(_0x2f8970){var _0x4a2f9e=_0x2f8970[_0xaaac('0x10')];var _0x1b749a=![];var _0x3bc112=null;if(_0x4a266e[_0xaaac('0x19')]!==null){logger[_0xaaac('0xe')](_0xaaac('0x1a'),_0x4a266e['agentEmail']);_0x4a266e[_0xaaac('0x1b')]=_0x4a266e[_0xaaac('0x19')];for(_0x3bc112=0x0;_0x3bc112<_0x4a2f9e['length'];_0x3bc112++){if(_0x4a2f9e[_0x3bc112][_0xaaac('0x1c')]===_0x4a266e[_0xaaac('0x19')]){_0x1b749a=!![];_0x4a266e[_0xaaac('0x1d')]=_0x4a2f9e[_0x3bc112]['id'];logger['info'](_0xaaac('0x1e'),_0x4a266e[_0xaaac('0x1d')]);}}}if(!_0x1b749a){logger[_0xaaac('0xe')](_0xaaac('0x1f'));_0x4a266e[_0xaaac('0x1b')]=_0x4a266e[_0xaaac('0x11')];_0x4a266e[_0xaaac('0x1d')]=_0x4a266e[_0xaaac('0x12')];_0x1b749a=!![];}if(_0x1b749a){_0xc62f61(_0x4a266e);}else{_0x420834({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x420834({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xaaac('0x20')](function(_0x2592ce){logger[_0xaaac('0x21')]('['+[_0x1a5de6[_0xaaac('0x15')]()]+']',_0x2592ce[_0xaaac('0x16')]);_0x420834(_0x2592ce);});});};}function searchContact(_0xd6aa5d,_0x7ce688,_0x5de9d9,_0x2d92d4){return new Promise(function(_0x309ef6,_0x2d5364){var _0x281473={'method':_0xaaac('0xc'),'headers':_0x7ce688,'uri':_0xd6aa5d+'/api/lookup?q='+_0x2d92d4+_0xaaac('0x22')+_0x5de9d9+_0xaaac('0x23'),'json':!![]};rp(_0x281473)[_0xaaac('0x18')](function(_0x52de13){var _0x580c4a=_[_0xaaac('0x24')](_0x52de13[_0xaaac('0x25')][_0xaaac('0x25')],[_0x5de9d9,_0x2d92d4]);_0x309ef6(_0x580c4a);})[_0xaaac('0x20')](function(_0x493aa7){_0x2d5364(_0x493aa7);});});}function getEndUser(_0x10a591,_0x58c653,_0x3cb3af){return function(_0x3fdb02){return new Promise(function(_0x468dcd,_0x4cac97){logger[_0xaaac('0xe')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x3fdb02[_0xaaac('0x26')]));searchContact(_0x3cb3af,_0x58c653,_0xaaac('0x27'),_0x3fdb02[_0xaaac('0x26')])[_0xaaac('0x18')](function(_0x592a16){if(_0x592a16){_0x3fdb02[_0xaaac('0x28')]=_0x592a16['id'];logger['info'](_0xaaac('0x29'),_0x3fdb02['endUserId']);return _0x468dcd(_0x3fdb02);}searchContact(_0x3cb3af,_0x58c653,'work_number',_0x3fdb02[_0xaaac('0x26')])[_0xaaac('0x18')](function(_0x3ebe1d){if(_0x3ebe1d){_0x3fdb02[_0xaaac('0x28')]=_0x3ebe1d['id'];logger['info'](_0xaaac('0x2a'),_0x3fdb02[_0xaaac('0x28')]);return _0x468dcd(_0x3fdb02);}createEndUser(_0x3fdb02,_0x10a591,_0x58c653,_0x3cb3af)['then'](function(_0x40a4ff){logger[_0xaaac('0xe')]('Contact\x20created:',_0x40a4ff['endUserId']);return _0x468dcd(_0x40a4ff);});});})[_0xaaac('0x20')](function(_0x5c7554){_0x4cac97(_0x5c7554);});});};}function createEndUser(_0xfe3507,_0x49e99c,_0x4c917b,_0x30c787){return new Promise(function(_0xda64ca,_0x31ed95){var _0x28227a=moment();var _0x99cbce={'method':'POST','uri':_0x30c787+_0xaaac('0x2b'),'body':{'contact':{'last_name':_0xfe3507[_0xaaac('0x26')],'work_number':_0xfe3507[_0xaaac('0x26')],'mobile_number':_0xfe3507[_0xaaac('0x26')],'owner_id':_0xfe3507[_0xaaac('0x1d')],'created_at':_0x28227a[_0xaaac('0x2c')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x99cbce[_0xaaac('0xd')]=_0x4c917b;logger[_0xaaac('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x99cbce)['then'](function(_0x326138){_0xfe3507[_0xaaac('0x28')]=_0x326138['contact']['id'];_0xda64ca(_0xfe3507);})[_0xaaac('0x20')](function(_0x36b081){logger[_0xaaac('0x21')]('['+[_0x49e99c[_0xaaac('0x15')]()]+']',_0x36b081[_0xaaac('0x16')]);_0x31ed95(_0x36b081[_0xaaac('0x16')]);});});}function getTicket(_0x5c5a11,_0x130d90,_0x3f3226,_0x5ef7d4,_0xc7acc2){return function(_0x4eb5f8){logger[_0xaaac('0xe')](_0xaaac('0x2d'));return new Promise(function(_0x2a9a88,_0x158a9f){var _0x5da63e=moment();var _0x1454bc={'method':_0xaaac('0x2e'),'uri':_0x3f3226+'/api/tasks','body':{'title':intUtil[_0xaaac('0x2f')](_0x5ef7d4[_0xaaac('0x30')],_0xc7acc2,'\x20'),'description':intUtil[_0xaaac('0x2f')](_0x5ef7d4[_0xaaac('0x31')],_0xc7acc2,'\x0a'),'owner_id':_0x4eb5f8[_0xaaac('0x1d')],'creater_id':_0x4eb5f8['adminId'],'targetable_id':_0x4eb5f8[_0xaaac('0x28')],'targetable_type':_0xaaac('0x32'),'created_at':_0x5da63e[_0xaaac('0x2c')](_0xaaac('0x33')),'due_date':_0x5da63e[_0xaaac('0x34')](0x1e,'m')['format'](_0xaaac('0x33'))},'json':!![]};_0x1454bc[_0xaaac('0xd')]=_0x130d90;return rp(_0x1454bc)['then'](function(_0x864bb9){_0x4eb5f8[_0xaaac('0x35')]=_0x864bb9['task']['id'];logger[_0xaaac('0xe')](_0xaaac('0x36'),_0x4eb5f8[_0xaaac('0x35')]);_0x2a9a88(_0x4eb5f8);})['catch'](function(_0x3b75b1){logger[_0xaaac('0x21')]('['+[_0x5c5a11[_0xaaac('0x15')]()]+']',_0x3b75b1[_0xaaac('0x16')]);_0x158a9f(_0x3b75b1[_0xaaac('0x16')]);});});};}function emit(_0x305a76,_0x48a4be,_0x51ffe8){var _0xe82b92={'uri':_0x305a76+'/contacts/'+_0x51ffe8};io['to'](util['format'](_0xaaac('0x37'),_0x48a4be))[_0xaaac('0x38')](_0xaaac('0x39'),_0xe82b92);}exports['cs']=function(_0xd7df92,_0x3eba4b,_0xcc0201,_0x5256fc,_0x17fc36,_0x2074c2,_0x4fcce4,_0x157789){var _0x5e5c64={};var _0x3a0570={'Authorization':_0xaaac('0x3a')+_0x2074c2[_0xaaac('0x3b')]};_0x2074c2[_0xaaac('0x3c')]=intUtil[_0xaaac('0x3d')](_0x2074c2[_0xaaac('0x3c')]);_0x2074c2[_0xaaac('0x3e')]=intUtil[_0xaaac('0x3d')](_0x2074c2[_0xaaac('0x3e')]);var _0x918683=_0x2074c2[_0xaaac('0x3c')];_0x5e5c64[_0xaaac('0x11')]=_0x2074c2[_0xaaac('0x3f')];_0x5e5c64[_0xaaac('0x26')]=_0x157789[_0xaaac('0x40')]()===_0xaaac('0x41')?_0x3eba4b['destcalleridnum']:_0x3eba4b[_0xaaac('0x42')];_0x5e5c64['callDirection']=_0x157789===_0xaaac('0x43')||_0x157789==='unmanaged'?_0xaaac('0x43'):'outbound';if(_0x5256fc){_0x5e5c64[_0xaaac('0x19')]=_0x5256fc[_0xaaac('0x1c')];}var _0x1166be=util['format'](_0xaaac('0x44'),_0x2074c2[_0xaaac('0x3e')],_0x3eba4b[_0xaaac('0x45')],md5(_0x3eba4b['uniqueid']));if(_0x17fc36&&_0x17fc36['monitor_format']){logger['info'](_0xaaac('0x46'),_0xaaac('0x47'));_0x3eba4b[_0xaaac('0x48')]=_0x1166be;}else if(_0x4fcce4&&_0x4fcce4['recordingFormat']&&_0x4fcce4[_0xaaac('0x49')]!==_0xaaac('0x4a')){logger[_0xaaac('0xe')](_0xaaac('0x4b'),'Recording\x20is\x20enabled!');_0x3eba4b[_0xaaac('0x48')]=_0x1166be;}else{_0x3eba4b['recordingURL']='';}return getAdminId(_0x5e5c64,_0x157789,_0x3a0570,_0x918683)[_0xaaac('0x18')](getUser(_0x157789,_0x3a0570,_0x918683))[_0xaaac('0x18')](getEndUser(_0x157789,_0x3a0570,_0x918683))[_0xaaac('0x18')](getTicket(_0x157789,_0x3a0570,_0x918683,_0xcc0201,_0x3eba4b))[_0xaaac('0x18')](function(_0x3fac58){logger[_0xaaac('0xe')](util['format'](_0xaaac('0x4c'),_0x3fac58['ticketId']));if(_0x157789!=='unmanaged'){logger[_0xaaac('0xe')]('['+[_0x157789[_0xaaac('0x15')]()]+']',_0xaaac('0x4d'));emit(_0x918683,_0x5256fc[_0xaaac('0x4e')],_0x3fac58[_0xaaac('0x28')]);}})[_0xaaac('0x20')](function(_0x528569){logger['error']('['+[_0x157789[_0xaaac('0x15')]()]+_0xaaac('0x4f'),util[_0xaaac('0x50')](_0x528569,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc0a6=['[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','info','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','Getting\x20user\x20list','users','agentEmail','userEmail','userId','Admin\x20selected','catch','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','toLowerCase','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat'];(function(_0x1b00f1,_0x15ffa8){var _0x5c3dad=function(_0x5d37fd){while(--_0x5d37fd){_0x1b00f1['push'](_0x1b00f1['shift']());}};_0x5c3dad(++_0x15ffa8);}(_0xc0a6,0x100));var _0x6c0a=function(_0x3dbd8b,_0x13ebd2){_0x3dbd8b=_0x3dbd8b-0x0;var _0x213ce5=_0xc0a6[_0x3dbd8b];return _0x213ce5;};'use strict';var _=require('lodash');var rp=require(_0x6c0a('0x0'));var md5=require('md5');var util=require('util');var moment=require(_0x6c0a('0x1'));var Promise=require(_0x6c0a('0x2'));var Redis=require(_0x6c0a('0x3'));var intUtil=require(_0x6c0a('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6c0a('0x5'))(_0x6c0a('0x6'));config[_0x6c0a('0x7')]=_[_0x6c0a('0x8')](config[_0x6c0a('0x7')],{'host':_0x6c0a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6c0a('0x7')]));function getAdminId(_0x4f064c,_0x32fb69,_0x4824d9,_0x511037){return new Promise(function(_0x46bd2a,_0x2e6627){var _0x233397=![];var _0xdf03e8={'method':_0x6c0a('0xa'),'uri':_0x511037+_0x6c0a('0xb'),'json':!![]};_0xdf03e8[_0x6c0a('0xc')]=_0x4824d9;logger[_0x6c0a('0xd')]('Getting\x20admin\x20information');return rp(_0xdf03e8)[_0x6c0a('0xe')](function(_0x3b249f){if(_0x3b249f){var _0x3bd756=_0x3b249f['users'];var _0x5f3ea4=null;for(_0x5f3ea4=0x0;_0x5f3ea4<_0x3bd756[_0x6c0a('0xf')];_0x5f3ea4++){if(_0x3bd756[_0x5f3ea4][_0x6c0a('0x10')]===_0x4f064c[_0x6c0a('0x11')]){_0x4f064c[_0x6c0a('0x12')]=_0x3bd756[_0x5f3ea4]['id'];_0x233397=!![];}}if(_0x233397){logger[_0x6c0a('0xd')](_0x6c0a('0x13'),_0x4f064c[_0x6c0a('0x12')]);_0x46bd2a(_0x4f064c);}else{_0x2e6627({'statusCode':0x194,'message':_0x6c0a('0x14')});}}else{_0x2e6627({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x39b7d1){logger[_0x6c0a('0x15')]('['+[_0x32fb69[_0x6c0a('0x16')]()]+']',_0x39b7d1['message']);_0x2e6627(_0x39b7d1);});});}function getUser(_0x2d2983,_0x5a0079,_0x2a427e){return function(_0x590816){return new Promise(function(_0x1f4086,_0x365af3){var _0x288d11={'method':'GET','uri':_0x2a427e+_0x6c0a('0xb'),'json':!![]};_0x288d11['headers']=_0x5a0079;logger[_0x6c0a('0xd')](_0x6c0a('0x17'));return rp(_0x288d11)[_0x6c0a('0xe')](function(_0x4186f8){if(_0x4186f8){var _0xde3f38=_0x4186f8[_0x6c0a('0x18')];var _0x12a11d=![];var _0x243774=null;if(_0x590816[_0x6c0a('0x19')]!==null){logger[_0x6c0a('0xd')]('Getting\x20user\x20with\x20email',_0x590816['agentEmail']);_0x590816[_0x6c0a('0x1a')]=_0x590816[_0x6c0a('0x19')];for(_0x243774=0x0;_0x243774<_0xde3f38[_0x6c0a('0xf')];_0x243774++){if(_0xde3f38[_0x243774][_0x6c0a('0x10')]===_0x590816[_0x6c0a('0x19')]){_0x12a11d=!![];_0x590816[_0x6c0a('0x1b')]=_0xde3f38[_0x243774]['id'];logger['info']('User\x20found:',_0x590816[_0x6c0a('0x1b')]);}}}if(!_0x12a11d){logger['info'](_0x6c0a('0x1c'));_0x590816[_0x6c0a('0x1a')]=_0x590816[_0x6c0a('0x11')];_0x590816[_0x6c0a('0x1b')]=_0x590816[_0x6c0a('0x12')];_0x12a11d=!![];}if(_0x12a11d){_0x1f4086(_0x590816);}else{_0x365af3({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x365af3({'statusCode':0x194,'message':_0x6c0a('0x14')});}})[_0x6c0a('0x1d')](function(_0x3971da){logger['error']('['+[_0x2d2983[_0x6c0a('0x16')]()]+']',_0x3971da[_0x6c0a('0x1e')]);_0x365af3(_0x3971da);});});};}function searchContact(_0x2c76c9,_0x5837e6,_0x10a245,_0x339453){return new Promise(function(_0x1f4c45,_0x46084d){var _0x3e6cf5={'method':_0x6c0a('0xa'),'headers':_0x5837e6,'uri':_0x2c76c9+_0x6c0a('0x1f')+_0x339453+_0x6c0a('0x20')+_0x10a245+_0x6c0a('0x21'),'json':!![]};rp(_0x3e6cf5)[_0x6c0a('0xe')](function(_0x2d2df1){var _0x31c257=_[_0x6c0a('0x22')](_0x2d2df1[_0x6c0a('0x23')]['contacts'],[_0x10a245,_0x339453]);_0x1f4c45(_0x31c257);})[_0x6c0a('0x1d')](function(_0x497c9f){_0x46084d(_0x497c9f);});});}function getEndUser(_0x2c9b13,_0x4dfb6f,_0x14b656){return function(_0x239989){return new Promise(function(_0x3d7a39,_0x5623f6){logger[_0x6c0a('0xd')](util[_0x6c0a('0x24')](_0x6c0a('0x25'),_0x239989[_0x6c0a('0x26')]));searchContact(_0x14b656,_0x4dfb6f,_0x6c0a('0x27'),_0x239989[_0x6c0a('0x26')])[_0x6c0a('0xe')](function(_0x26b0f7){if(_0x26b0f7){_0x239989[_0x6c0a('0x28')]=_0x26b0f7['id'];logger[_0x6c0a('0xd')](_0x6c0a('0x29'),_0x239989['endUserId']);return _0x3d7a39(_0x239989);}searchContact(_0x14b656,_0x4dfb6f,_0x6c0a('0x2a'),_0x239989[_0x6c0a('0x26')])[_0x6c0a('0xe')](function(_0x31b1e3){if(_0x31b1e3){_0x239989[_0x6c0a('0x28')]=_0x31b1e3['id'];logger['info'](_0x6c0a('0x2b'),_0x239989[_0x6c0a('0x28')]);return _0x3d7a39(_0x239989);}createEndUser(_0x239989,_0x2c9b13,_0x4dfb6f,_0x14b656)['then'](function(_0xaa9847){logger[_0x6c0a('0xd')](_0x6c0a('0x2c'),_0xaa9847[_0x6c0a('0x28')]);return _0x3d7a39(_0xaa9847);});});})[_0x6c0a('0x1d')](function(_0x4ab6b5){_0x5623f6(_0x4ab6b5);});});};}function createEndUser(_0x4fde8b,_0x3f5579,_0x596a32,_0xdb416b){return new Promise(function(_0x53a555,_0x47d826){var _0x5a38ff=moment();var _0x3a7d94={'method':_0x6c0a('0x2d'),'uri':_0xdb416b+_0x6c0a('0x2e'),'body':{'contact':{'last_name':_0x4fde8b['contactNumber'],'work_number':_0x4fde8b[_0x6c0a('0x26')],'mobile_number':_0x4fde8b['contactNumber'],'owner_id':_0x4fde8b[_0x6c0a('0x1b')],'created_at':_0x5a38ff[_0x6c0a('0x24')](_0x6c0a('0x2f'))}},'json':!![]};_0x3a7d94[_0x6c0a('0xc')]=_0x596a32;logger['info'](_0x6c0a('0x30'));return rp(_0x3a7d94)[_0x6c0a('0xe')](function(_0x486505){_0x4fde8b[_0x6c0a('0x28')]=_0x486505[_0x6c0a('0x31')]['id'];_0x53a555(_0x4fde8b);})[_0x6c0a('0x1d')](function(_0x182175){logger['error']('['+[_0x3f5579[_0x6c0a('0x16')]()]+']',_0x182175['message']);_0x47d826(_0x182175['message']);});});}function getTicket(_0x44efae,_0x425cf9,_0x48e9ee,_0x2495cb,_0xbc0a7e){return function(_0x37904e){logger['info'](_0x6c0a('0x32'));return new Promise(function(_0x1617cb,_0x43db1b){var _0x546d88=moment();var _0x34cfb7={'method':'POST','uri':_0x48e9ee+_0x6c0a('0x33'),'body':{'title':intUtil[_0x6c0a('0x34')](_0x2495cb['Subjects'],_0xbc0a7e,'\x20'),'description':intUtil['getString'](_0x2495cb[_0x6c0a('0x35')],_0xbc0a7e,'\x0a'),'owner_id':_0x37904e[_0x6c0a('0x1b')],'creater_id':_0x37904e[_0x6c0a('0x12')],'targetable_id':_0x37904e['endUserId'],'targetable_type':'Contact','created_at':_0x546d88[_0x6c0a('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x546d88[_0x6c0a('0x36')](0x1e,'m')['format'](_0x6c0a('0x2f'))},'json':!![]};_0x34cfb7[_0x6c0a('0xc')]=_0x425cf9;return rp(_0x34cfb7)[_0x6c0a('0xe')](function(_0x444079){_0x37904e[_0x6c0a('0x37')]=_0x444079[_0x6c0a('0x38')]['id'];logger[_0x6c0a('0xd')](_0x6c0a('0x39'),_0x37904e[_0x6c0a('0x37')]);_0x1617cb(_0x37904e);})[_0x6c0a('0x1d')](function(_0x2a2cb0){logger[_0x6c0a('0x15')]('['+[_0x44efae[_0x6c0a('0x16')]()]+']',_0x2a2cb0[_0x6c0a('0x1e')]);_0x43db1b(_0x2a2cb0['message']);});});};}function emit(_0x45a471,_0x3c07b3,_0x39664d){var _0x51dcaf={'uri':_0x45a471+_0x6c0a('0x3a')+_0x39664d};io['to'](util['format'](_0x6c0a('0x3b'),_0x3c07b3))[_0x6c0a('0x3c')](_0x6c0a('0x3d'),_0x51dcaf);}exports['cs']=function(_0x5482a5,_0x107772,_0x31dec6,_0x5d506b,_0x4709a2,_0xc45a79,_0x2d58f2,_0x2302cf){var _0x28213f={};var _0x45d31a={'Authorization':_0x6c0a('0x3e')+_0xc45a79[_0x6c0a('0x3f')]};_0xc45a79[_0x6c0a('0x40')]=intUtil['stripTrailingSlash'](_0xc45a79[_0x6c0a('0x40')]);_0xc45a79['serverUrl']=intUtil['stripTrailingSlash'](_0xc45a79[_0x6c0a('0x41')]);var _0x40644d=_0xc45a79['remoteUri'];_0x28213f[_0x6c0a('0x11')]=_0xc45a79['username'];_0x28213f['contactNumber']=_0x2302cf[_0x6c0a('0x42')]()==='outbound'?_0x107772['destcalleridnum']:_0x107772[_0x6c0a('0x43')];_0x28213f[_0x6c0a('0x44')]=_0x2302cf===_0x6c0a('0x45')||_0x2302cf===_0x6c0a('0x46')?_0x6c0a('0x45'):_0x6c0a('0x47');if(_0x5d506b){_0x28213f[_0x6c0a('0x19')]=_0x5d506b[_0x6c0a('0x10')];}var _0x11fb6b=util[_0x6c0a('0x24')](_0x6c0a('0x48'),_0xc45a79[_0x6c0a('0x41')],_0x107772[_0x6c0a('0x49')],md5(_0x107772[_0x6c0a('0x49')]));if(_0x4709a2&&_0x4709a2['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x107772[_0x6c0a('0x4a')]=_0x11fb6b;}else if(_0x2d58f2&&_0x2d58f2[_0x6c0a('0x4b')]&&_0x2d58f2['recordingFormat']!=='none'){logger[_0x6c0a('0xd')](_0x6c0a('0x4c'),_0x6c0a('0x4d'));_0x107772[_0x6c0a('0x4a')]=_0x11fb6b;}else{_0x107772[_0x6c0a('0x4a')]='';}return getAdminId(_0x28213f,_0x2302cf,_0x45d31a,_0x40644d)[_0x6c0a('0xe')](getUser(_0x2302cf,_0x45d31a,_0x40644d))[_0x6c0a('0xe')](getEndUser(_0x2302cf,_0x45d31a,_0x40644d))[_0x6c0a('0xe')](getTicket(_0x2302cf,_0x45d31a,_0x40644d,_0x31dec6,_0x107772))['then'](function(_0x29823b){logger[_0x6c0a('0xd')](util[_0x6c0a('0x24')](_0x6c0a('0x4e'),_0x29823b[_0x6c0a('0x37')]));if(_0x2302cf!==_0x6c0a('0x46')){logger[_0x6c0a('0xd')]('['+[_0x2302cf[_0x6c0a('0x16')]()]+']',_0x6c0a('0x4f'));emit(_0x40644d,_0x5d506b[_0x6c0a('0x50')],_0x29823b[_0x6c0a('0x28')]);}})[_0x6c0a('0x1d')](function(_0x410984){logger[_0x6c0a('0x15')]('['+[_0x2302cf[_0x6c0a('0x16')]()]+_0x6c0a('0x51'),util[_0x6c0a('0x52')](_0x410984,{'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 e827fb0..5115c44 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 _0x95bb=['../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','sugarcrm','desk','log','unknown\x20integration'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x95bb,0x1b2));var _0xb95b=function(_0x2ff890,_0x448bdd){_0x2ff890=_0x2ff890-0x0;var _0xb0f82f=_0x95bb[_0x2ff890];return _0xb0f82f;};'use strict';var _=require(_0xb95b('0x0'));var util=require(_0xb95b('0x1'));var zendesk=require(_0xb95b('0x2'));var salesforce=require(_0xb95b('0x3'));var sugarcrm=require(_0xb95b('0x4'));var freshdesk=require(_0xb95b('0x5'));var zoho=require(_0xb95b('0x6'));var desk=require('./desk');var vtiger=require(_0xb95b('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0xb95b('0x8'));var freshsales=require(_0xb95b('0x9'));var integrations=[_0xb95b('0xa'),_0xb95b('0xb'),'sugarcrm',_0xb95b('0xc'),_0xb95b('0xd'),'desk','vtiger',_0xb95b('0xe'),_0xb95b('0xf'),_0xb95b('0x10')];exports[_0xb95b('0x11')]=function(_0x26171b,_0x31d13f,_0x52d7b8,_0x30397e,_0x250344,_0x6f5f14){if(_0x52d7b8){if(_[_0xb95b('0x12')](integrations,_0x26171b['data1']['toLowerCase']())){try{var _0x28c76a=null;var _0x18bc70='';var _0x27769c=_0x52d7b8[_0x26171b[_0xb95b('0x13')][_0xb95b('0x14')]()];if(_0x27769c){var _0x29d678=_0x27769c[_0x26171b[_0xb95b('0x15')]];if(_0x29d678){var _0x23d138=_[_0xb95b('0x16')](_0x29d678[_0xb95b('0x17')],{'id':parseInt(_0x26171b[_0xb95b('0x18')],0xa)});if(_0x23d138){if(_0x30397e){if(_0x250344&&_0x31d13f[_0xb95b('0x19')]){_0x18bc70='queue';}else if(_0x31d13f[_0xb95b('0x1a')]){_0x18bc70=_0xb95b('0x1b');}else{console['log'](_0xb95b('0x1c'),_0x31d13f);}}else{_0x18bc70=_0xb95b('0x1d');}switch(_0x26171b[_0xb95b('0x13')][_0xb95b('0x14')]()){case _0xb95b('0xa'):zendesk[_0x18bc70](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14);break;case _0xb95b('0xb'):salesforce[_0x18bc70](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14);break;case _0xb95b('0x1e'):sugarcrm[_0x18bc70](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14);break;case _0xb95b('0xc'):freshdesk[_0x18bc70](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14);break;case'zoho':zoho[_0x18bc70](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14);break;case _0xb95b('0x1f'):desk[_0x18bc70](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14);break;case'vtiger':vtiger[_0x18bc70](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14);break;case'freshsales':freshsales['cs'](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14,_0x18bc70);break;case'servicenow':servicenow['cs'](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14,_0x18bc70);break;case _0xb95b('0xe'):dynamics365['cs'](_0x26171b,_0x31d13f,_0x23d138,_0x30397e,_0x250344,_0x29d678,_0x6f5f14,_0x18bc70);break;default:console[_0xb95b('0x20')](_0xb95b('0x21'));}}else{_0x28c76a=require(_0xb95b('0x22'))(_0x26171b[_0xb95b('0x13')][_0xb95b('0x14')]());_0x28c76a[_0xb95b('0x23')]('[EXEC]',util['format'](_0xb95b('0x24'),_0x26171b['data1'][_0xb95b('0x14')](),_0x26171b[_0xb95b('0x18')]));}}else{_0x28c76a=require('../../../../config/logger')(_0x26171b[_0xb95b('0x13')][_0xb95b('0x14')]());_0x28c76a['error'](_0xb95b('0x25'),util[_0xb95b('0x26')]('%s\x20account\x20#%s\x20not\x20found',_0x26171b[_0xb95b('0x13')][_0xb95b('0x14')](),_0x26171b['data2']));}}else{}}catch(_0x5a8111){console[_0xb95b('0x23')](_0x5a8111);}}}}; \ No newline at end of file +var _0xd9bf=['freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','zendesk','salesforce','desk','log','unknown\x20integration','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm'];(function(_0x106ea3,_0x2df5ce){var _0x206ddd=function(_0x5f5c66){while(--_0x5f5c66){_0x106ea3['push'](_0x106ea3['shift']());}};_0x206ddd(++_0x2df5ce);}(_0xd9bf,0x1d2));var _0xfd9b=function(_0x2c3a2b,_0x35aa5f){_0x2c3a2b=_0x2c3a2b-0x0;var _0x37a6bb=_0xd9bf[_0x2c3a2b];return _0x37a6bb;};'use strict';var _=require(_0xfd9b('0x0'));var util=require(_0xfd9b('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xfd9b('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xfd9b('0x3'));var desk=require(_0xfd9b('0x4'));var vtiger=require(_0xfd9b('0x5'));var servicenow=require(_0xfd9b('0x6'));var dynamics365=require(_0xfd9b('0x7'));var freshsales=require(_0xfd9b('0x8'));var integrations=['zendesk','salesforce',_0xfd9b('0x9'),_0xfd9b('0xa'),_0xfd9b('0xb'),'desk',_0xfd9b('0xc'),_0xfd9b('0xd'),_0xfd9b('0xe'),_0xfd9b('0xf')];exports[_0xfd9b('0x10')]=function(_0x16914f,_0x21bb26,_0x2bfe5c,_0x527f4f,_0xe91075,_0x11742c){if(_0x2bfe5c){if(_[_0xfd9b('0x11')](integrations,_0x16914f[_0xfd9b('0x12')]['toLowerCase']())){try{var _0x48994e=null;var _0x266b29='';var _0x124b51=_0x2bfe5c[_0x16914f['data1'][_0xfd9b('0x13')]()];if(_0x124b51){var _0x22e329=_0x124b51[_0x16914f[_0xfd9b('0x14')]];if(_0x22e329){var _0x578b3e=_[_0xfd9b('0x15')](_0x22e329[_0xfd9b('0x16')],{'id':parseInt(_0x16914f[_0xfd9b('0x17')],0xa)});if(_0x578b3e){if(_0x527f4f){if(_0xe91075&&_0x21bb26['queue']){_0x266b29=_0xfd9b('0x18');}else if(_0x21bb26[_0xfd9b('0x19')]){_0x266b29=_0xfd9b('0x1a');}else{console['log']('EVENT\x20UNKNOWN',_0x21bb26);}}else{_0x266b29='unmanaged';}switch(_0x16914f[_0xfd9b('0x12')]['toLowerCase']()){case _0xfd9b('0x1b'):zendesk[_0x266b29](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c);break;case _0xfd9b('0x1c'):salesforce[_0x266b29](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c);break;case _0xfd9b('0x9'):sugarcrm[_0x266b29](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c);break;case _0xfd9b('0xa'):freshdesk[_0x266b29](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c);break;case _0xfd9b('0xb'):zoho[_0x266b29](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c);break;case _0xfd9b('0x1d'):desk[_0x266b29](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c);break;case _0xfd9b('0xc'):vtiger[_0x266b29](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c);break;case _0xfd9b('0xe'):freshsales['cs'](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c,_0x266b29);break;case _0xfd9b('0xf'):servicenow['cs'](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c,_0x266b29);break;case _0xfd9b('0xd'):dynamics365['cs'](_0x16914f,_0x21bb26,_0x578b3e,_0x527f4f,_0xe91075,_0x22e329,_0x11742c,_0x266b29);break;default:console[_0xfd9b('0x1e')](_0xfd9b('0x1f'));}}else{_0x48994e=require('../../../../config/logger')(_0x16914f[_0xfd9b('0x12')][_0xfd9b('0x13')]());_0x48994e[_0xfd9b('0x20')]('[EXEC]',util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x16914f[_0xfd9b('0x12')][_0xfd9b('0x13')](),_0x16914f['data3']));}}else{_0x48994e=require('../../../../config/logger')(_0x16914f[_0xfd9b('0x12')][_0xfd9b('0x13')]());_0x48994e[_0xfd9b('0x20')]('[EXEC]',util['format'](_0xfd9b('0x21'),_0x16914f[_0xfd9b('0x12')][_0xfd9b('0x13')](),_0x16914f['data2']));}}else{}}catch(_0x541909){console[_0xfd9b('0x20')](_0x541909);}}}}; \ 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 0d28b04..9f63d45 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 _0x5f74=['variable','variableName','customVariable','name','Variable','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','./util','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','emit','getString','Subjects','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','lead','WhoId','account','WhatId','contact','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','Email','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','$or','Contact','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','merge','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString'];(function(_0x1e13d4,_0x41ea86){var _0x3fbd02=function(_0x5f09ef){while(--_0x5f09ef){_0x1e13d4['push'](_0x1e13d4['shift']());}};_0x3fbd02(++_0x41ea86);}(_0x5f74,0x1ad));var _0x45f7=function(_0x511bcf,_0x28c2d8){_0x511bcf=_0x511bcf-0x0;var _0x3198c7=_0x5f74[_0x511bcf];return _0x3198c7;};'use strict';var _=require(_0x45f7('0x0'));var rp=require(_0x45f7('0x1'));var moment=require(_0x45f7('0x2'));var BPromise=require('bluebird');var md5=require(_0x45f7('0x3'));var jsforce=require(_0x45f7('0x4'));var util=require(_0x45f7('0x5'));var Redis=require('ioredis');var intUtil=require(_0x45f7('0x6'));var config=require('../../../../config/environment');var logger=require(_0x45f7('0x7'))(_0x45f7('0x8'));config['redis']=_[_0x45f7('0x9')](config[_0x45f7('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x45f7('0xb'))(new Redis(config[_0x45f7('0xa')]));function emit(_0xb4426a,_0xb2613f,_0x2ef681){io['to'](_0xb4426a)[_0x45f7('0xc')](_0xb2613f,_0x2ef681);}function getTicket(_0x3e9abd,_0x31477d,_0x6e870e,_0xf5b090,_0x24984f,_0x5c88af,_0xdce361,_0x91ce2f){var _0x33c9d2=Object['assign']({},{'OwnerId':_0x31477d['id'],'Subject':intUtil[_0x45f7('0xd')](_0xf5b090[_0x45f7('0xe')],_0x24984f,'\x20'),'Description':intUtil[_0x45f7('0xd')](_0xf5b090['Descriptions'],_0x24984f,'\x0a')},getCustomFields(_0x5c88af,_0x24984f));if(_0x6e870e){if(_0xf5b090[_0x45f7('0xf')]===_0x45f7('0x10')){_0x33c9d2[_0x45f7('0x11')]=moment[_0x45f7('0x12')]();_0x33c9d2[_0x45f7('0x13')]=![];_0x33c9d2['IsRecurrence']=![];if(_0x6e870e[_0x45f7('0x14')]==='contact'||_0x6e870e['endUserType']===_0x45f7('0x15')){_0x33c9d2[_0x45f7('0x16')]=_0x6e870e['id'];}else if(_0x6e870e['endUserType']===_0x45f7('0x17')){_0x33c9d2[_0x45f7('0x18')]=_0x6e870e['id'];}}else if(_0xf5b090[_0x45f7('0xf')]==='Case'){if(_0x6e870e['endUserType']===_0x45f7('0x19')){_0x33c9d2['ContactId']=_0x6e870e['id'];}else if(_0x6e870e[_0x45f7('0x14')]===_0x45f7('0x17')){_0x33c9d2['AccountId']=_0x6e870e['id'];}else if(_0x6e870e[_0x45f7('0x14')]==='lead'&&_0xf5b090[_0x45f7('0x1a')]){_0x33c9d2[_0xf5b090['leadId']]=_0x6e870e['id'];}else{logger[_0x45f7('0x1b')](_0x45f7('0x1c'));}}}return _0xdce361[_0x45f7('0x1d')](_0xf5b090[_0x45f7('0xf')])[_0x45f7('0x1e')](_0x33c9d2);}function getUser(_0x4e28ba,_0x516f88,_0x401708){if(!_['isNil'](_0x516f88)&&intUtil[_0x45f7('0x1f')](_0x516f88)){var _0x264189={'Email':_0x516f88};var _0x263bb5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x401708[_0x45f7('0x1d')](_0x45f7('0x20'))[_0x45f7('0x21')](_0x264189,_0x263bb5)[_0x45f7('0x22')]()[_0x45f7('0x23')](function(_0x31e77f){if(_0x31e77f[_0x45f7('0x24')]){var _0x760064=_[_0x45f7('0x21')](_0x31e77f,function(_0x3ad8a7){return _0x3ad8a7[_0x45f7('0x25')]===_0x516f88;});if(_0x760064){logger[_0x45f7('0x1b')]('Agent\x20%s\x20found.',_0x516f88);return BPromise[_0x45f7('0x26')]({'id':_0x760064['Id'],'name':_0x760064['Name']});}}else{logger[_0x45f7('0x1b')](_0x45f7('0x27'),_0x516f88);return _0x401708[_0x45f7('0x28')]()[_0x45f7('0x23')](function(_0x22c10b){return BPromise[_0x45f7('0x26')]({'id':_0x22c10b[_0x45f7('0x29')],'name':_0x22c10b[_0x45f7('0x2a')]});});}});}else{logger['info'](_0x45f7('0x27'),_0x516f88);return _0x401708[_0x45f7('0x28')]()[_0x45f7('0x23')](function(_0x4fd9bf){return BPromise[_0x45f7('0x26')]({'id':_0x4fd9bf[_0x45f7('0x29')],'name':_0x4fd9bf[_0x45f7('0x2a')]});});}}function getEndUser(_0x3c921c,_0x2d7492,_0x4a127c,_0x35c7e7,_0x4e233a){var _0x141c16={'$or':{'Phone':_0x35c7e7}};var _0x10f1f0={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x45f7('0x26')]()[_0x45f7('0x23')](function(){logger['info'](_0x45f7('0x2b'),_0x35c7e7,_0x2d7492[_0x45f7('0x2c')]);switch(_0x2d7492[_0x45f7('0x2c')]){case _0x45f7('0x2d'):var _0x3d018e=_['cloneDeep'](_0x141c16);if(_0x2d7492[_0x45f7('0x2e')]){var _0x1b96b1={};_0x1b96b1[_0x2d7492[_0x45f7('0x2e')]]=_0x35c7e7;_['merge'](_0x3d018e[_0x45f7('0x2f')],_0x1b96b1);}return _0x4e233a[_0x45f7('0x1d')](_0x45f7('0x30'))[_0x45f7('0x21')](_0x3d018e,_0x10f1f0)[_0x45f7('0x22')]()[_0x45f7('0x23')](function(_0xb10128){if(_0xb10128&&_0xb10128['length']){return _0xb10128;}else{var _0x41412a=_[_0x45f7('0x31')](_0x141c16);if(_0x2d7492[_0x45f7('0x32')]){var _0x1bb470={};_0x1bb470[_0x2d7492[_0x45f7('0x32')]]=_0x35c7e7;_['merge'](_0x41412a['$or'],_0x1bb470);}return _0x4e233a[_0x45f7('0x1d')](_0x45f7('0x33'))['find'](_0x41412a,_0x10f1f0);}});case _0x45f7('0x34'):var _0x19d326=_[_0x45f7('0x31')](_0x141c16);if(_0x2d7492[_0x45f7('0x35')]){var _0x1b96b1={};_0x1b96b1[_0x2d7492[_0x45f7('0x35')]]=_0x35c7e7;_[_0x45f7('0x36')](_0x19d326[_0x45f7('0x2f')],_0x1b96b1);}return _0x4e233a[_0x45f7('0x1d')](_0x45f7('0x37'))[_0x45f7('0x21')](_0x19d326,_0x10f1f0)[_0x45f7('0x22')]()[_0x45f7('0x23')](function(_0x45ee99){if(_0x45ee99&&_0x45ee99['length']){return _0x45ee99;}else{var _0x329d15=_[_0x45f7('0x31')](_0x141c16);if(_0x2d7492['additionalSearchContact']){var _0x3ffb51={};_0x3ffb51[_0x2d7492['additionalSearchContact']]=_0x35c7e7;_[_0x45f7('0x36')](_0x329d15[_0x45f7('0x2f')],_0x3ffb51);}return _0x4e233a[_0x45f7('0x1d')](_0x45f7('0x30'))['find'](_0x329d15,_0x10f1f0)[_0x45f7('0x23')](function(_0xadafc3){if(_0xadafc3&&_0xadafc3[_0x45f7('0x24')]){return _0xadafc3;}else{var _0xad498e=_[_0x45f7('0x31')](_0x141c16);if(_0x2d7492[_0x45f7('0x32')]){var _0x365afa={};_0x365afa[_0x2d7492[_0x45f7('0x32')]]=_0x35c7e7;_[_0x45f7('0x36')](_0xad498e[_0x45f7('0x2f')],_0x365afa);}return _0x4e233a[_0x45f7('0x1d')](_0x45f7('0x33'))[_0x45f7('0x21')](_0xad498e,_0x10f1f0);}});}});case _0x45f7('0x19'):var _0x3d018e=_[_0x45f7('0x31')](_0x141c16);if(_0x2d7492[_0x45f7('0x2e')]){var _0x1b96b1={};_0x1b96b1[_0x2d7492['additionalSearchContact']]=_0x35c7e7;_[_0x45f7('0x36')](_0x3d018e['$or'],_0x1b96b1);}return _0x4e233a[_0x45f7('0x1d')]('Contact')[_0x45f7('0x21')](_0x3d018e,_0x10f1f0)['execute']();case _0x45f7('0x15'):var _0x34f7f6=_[_0x45f7('0x31')](_0x141c16);if(_0x2d7492[_0x45f7('0x32')]){var _0x1b96b1={};_0x1b96b1[_0x2d7492[_0x45f7('0x32')]]=_0x35c7e7;_[_0x45f7('0x36')](_0x34f7f6[_0x45f7('0x2f')],_0x1b96b1);}return _0x4e233a['sobject'](_0x45f7('0x33'))['find'](_0x34f7f6,_0x10f1f0);case _0x45f7('0x17'):var _0x19d326=_[_0x45f7('0x31')](_0x141c16);if(_0x2d7492['additionalSearchAccount']){var _0x1b96b1={};_0x1b96b1[_0x2d7492['additionalSearchAccount']]=_0x35c7e7;_[_0x45f7('0x36')](_0x19d326[_0x45f7('0x2f')],_0x1b96b1);}return _0x4e233a['sobject'](_0x45f7('0x37'))[_0x45f7('0x21')](_0x19d326,_0x10f1f0);default:return null;}})['then'](function(_0x14209f){if(_0x14209f&&_0x14209f[_0x45f7('0x24')]){var _0x2e03b7=_[_0x45f7('0x38')](_0x14209f);if(_0x2e03b7){return BPromise[_0x45f7('0x26')]({'id':_0x2e03b7['Id'],'name':_0x2e03b7[_0x45f7('0x39')],'phone':_0x2e03b7[_0x45f7('0x3a')],'endUserType':_0x2e03b7[_0x45f7('0x3b')][_0x45f7('0x3c')][_0x45f7('0x3d')]()});}}})[_0x45f7('0x23')](function(_0x3c195c){if(_0x3c195c){logger[_0x45f7('0x1b')](_0x45f7('0x3e'),_0x3c195c[_0x45f7('0x14')],_0x35c7e7);return BPromise['resolve'](_0x3c195c);}else{logger[_0x45f7('0x1b')](_0x45f7('0x3f'),_0x35c7e7);var _0x23653e={'Phone':_0x35c7e7};if(_0x2d7492[_0x45f7('0x40')]){if(_0x2d7492[_0x45f7('0x40')]===_0x45f7('0x19')){logger[_0x45f7('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x35c7e7,_0x2d7492[_0x45f7('0x40')]);_0x23653e['LastName']=_0x4a127c!==''?_0x4a127c:util[_0x45f7('0x41')]('Caller\x20-\x20%s',_0x35c7e7);}else if(_0x2d7492[_0x45f7('0x40')]==='lead'){logger[_0x45f7('0x1b')](_0x45f7('0x42'),_0x35c7e7,_0x2d7492[_0x45f7('0x40')]);_0x23653e['LastName']=_0x4a127c!==_0x45f7('0x43')?_0x4a127c:util[_0x45f7('0x41')](_0x45f7('0x44'),_0x35c7e7);_0x23653e[_0x45f7('0x45')]=_0x45f7('0x46');}else if(_0x2d7492[_0x45f7('0x40')]==='account'){logger['info'](_0x45f7('0x42'),_0x35c7e7,_0x2d7492[_0x45f7('0x40')]);_0x23653e[_0x45f7('0x39')]=_0x4a127c!==_0x45f7('0x43')?_0x4a127c:util['format'](_0x45f7('0x44'),_0x35c7e7);}else{return null;}}return _0x4e233a[_0x45f7('0x1d')](_[_0x45f7('0x47')](_0x2d7492['moduleCreate']))[_0x45f7('0x1e')](_0x23653e)['then'](function(_0x5f2536){return BPromise[_0x45f7('0x26')]({'id':_0x5f2536['id'],'endUserType':_0x2d7492[_0x45f7('0x40')]});});}});}function getCustomFields(_0x414d19,_0x537460){var _0x47245f={};if(_0x414d19[_0x45f7('0x24')]>0x0){_[_0x45f7('0x48')](_0x414d19,function(_0x4d48d5){if(_[_0x45f7('0x49')]([_0x45f7('0x4a'),_0x45f7('0x4b')],_0x4d48d5[_0x45f7('0x3c')])&&_0x4d48d5[_0x45f7('0x4c')]){_0x47245f[_0x4d48d5[_0x45f7('0x4c')]]=_0x4d48d5[_0x45f7('0x4d')][_0x45f7('0x4e')]();}else if(_0x4d48d5[_0x45f7('0x3c')]===_0x45f7('0x4f')&&_0x4d48d5[_0x45f7('0x50')]&&_0x4d48d5['idField']){_0x537460[_0x4d48d5[_0x45f7('0x50')]]&&(_0x47245f[_0x4d48d5[_0x45f7('0x4c')]]=_0x537460[_0x4d48d5[_0x45f7('0x50')]][_0x45f7('0x4e')]());}else if(_0x4d48d5[_0x45f7('0x3c')]===_0x45f7('0x51')&&_0x4d48d5['Variable']&&_0x4d48d5['Variable'][_0x45f7('0x52')]&&_0x4d48d5[_0x45f7('0x4c')]){_0x537460[_0x4d48d5[_0x45f7('0x53')]['name'][_0x45f7('0x3d')]()]&&(_0x47245f[_0x4d48d5[_0x45f7('0x4c')]]=_0x537460[_0x4d48d5[_0x45f7('0x53')][_0x45f7('0x52')][_0x45f7('0x3d')]()][_0x45f7('0x4e')]());}});}return _0x47245f;}function getConnection(_0x57e6e2){var _0x10a020=_0x57e6e2[_0x45f7('0x54')][_0x45f7('0x55')](_0x57e6e2[_0x45f7('0x56')]);var _0x1d7c98=new jsforce[(_0x45f7('0x57'))]({'oauth2':{'loginUrl':_0x57e6e2[_0x45f7('0x58')]||'https://login.salesforce.com','clientId':_0x57e6e2[_0x45f7('0x59')],'clientSecret':_0x57e6e2[_0x45f7('0x5a')]}});return _0x1d7c98[_0x45f7('0x5b')](_0x57e6e2['username'],_0x10a020)[_0x45f7('0x23')](function(){logger[_0x45f7('0x1b')]('Connection\x20established.');return _0x1d7c98;});}exports['queue']=function(_0x44b6ef,_0x552573,_0x22543e,_0x4b7c51,_0x14cf4f,_0x51d9c7){var _0x4b708e,_0x5094a3,_0x5b374e,_0x2aeddd;_0x51d9c7[_0x45f7('0x5c')]=intUtil[_0x45f7('0x5d')](_0x51d9c7['serverUrl']);_0x51d9c7[_0x45f7('0x58')]=intUtil[_0x45f7('0x5d')](_0x51d9c7[_0x45f7('0x58')]);if(_0x14cf4f&&_0x14cf4f[_0x45f7('0x5e')]){logger[_0x45f7('0x1b')](_0x45f7('0x5f'),_0x45f7('0x60'));_0x552573[_0x45f7('0x61')]=util['format'](_0x45f7('0x62'),_0x51d9c7[_0x45f7('0x5c')],_0x552573[_0x45f7('0x63')],md5(_0x552573[_0x45f7('0x63')]));}else{_0x552573[_0x45f7('0x61')]='';}return getConnection(_0x51d9c7)[_0x45f7('0x23')](function(_0x4e3093){_0x2aeddd=_0x4e3093;return getUser(_0x51d9c7,_0x4b7c51['email'],_0x2aeddd);})[_0x45f7('0x23')](function(_0x245815){_0x4b708e=_0x245815;return getEndUser(_0x51d9c7,_0x22543e,_0x552573[_0x45f7('0x64')],_0x552573[_0x45f7('0x65')],_0x2aeddd);})[_0x45f7('0x23')](function(_0x2f4c61){_0x5094a3=_0x2f4c61;return getTicket(_0x51d9c7,_0x4b708e,_0x5094a3,_0x22543e,_0x552573,_0x22543e[_0x45f7('0x66')],_0x2aeddd,_0x45f7('0x67'));})[_0x45f7('0x23')](function(_0x21e45d){_0x5b374e=_0x21e45d;logger[_0x45f7('0x1b')](_0x45f7('0x68'),_0x5b374e['id']);logger[_0x45f7('0x1b')](_0x45f7('0x69'),_0x5b374e['id'],_0x4b7c51['name'],_0x51d9c7[_0x45f7('0x3c')]);switch(_0x51d9c7[_0x45f7('0x3c')]){case _0x45f7('0x6a'):emit(util[_0x45f7('0x41')](_0x45f7('0x6b'),_0x4b7c51[_0x45f7('0x52')]),_0x45f7('0x6c'),{'recordId':_0x5b374e['id']});break;case _0x45f7('0x6d'):emit(util['format'](_0x45f7('0x6b'),_0x4b7c51[_0x45f7('0x52')]),_0x45f7('0x6e'),{'uri':util['format']('%s/%s/e',_0x2aeddd[_0x45f7('0x6f')],_0x5b374e['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x45f7('0x70')](function(_0xde5210){logger[_0x45f7('0x71')](_0x45f7('0x5f'),_0xde5210);});};exports[_0x45f7('0x72')]=function(_0x25085f,_0x291e2e,_0x474fb5,_0x39beaa,_0x465b80,_0x175d9e,_0x453012){var _0x913b95,_0x4bf153,_0x141f77,_0x1f6fb2;_0x175d9e[_0x45f7('0x5c')]=intUtil[_0x45f7('0x5d')](_0x175d9e[_0x45f7('0x5c')]);_0x175d9e['remoteUri']=intUtil[_0x45f7('0x5d')](_0x175d9e[_0x45f7('0x58')]);if(_0x453012&&_0x453012[_0x45f7('0x73')]&&_0x453012['recordingFormat']!==_0x45f7('0x74')){logger[_0x45f7('0x1b')](_0x45f7('0x75'),_0x45f7('0x60'));_0x291e2e[_0x45f7('0x61')]=util[_0x45f7('0x41')](_0x45f7('0x62'),_0x175d9e[_0x45f7('0x5c')],_0x291e2e[_0x45f7('0x63')],md5(_0x291e2e['uniqueid']));}return getConnection(_0x175d9e)['then'](function(_0x3a2a13){_0x1f6fb2=_0x3a2a13;return getUser(_0x175d9e,_0x39beaa['email'],_0x1f6fb2);})[_0x45f7('0x23')](function(_0x2bb523){_0x913b95=_0x2bb523;return getEndUser(_0x175d9e,_0x474fb5,_0x291e2e[_0x45f7('0x76')],_0x291e2e['destcalleridnum'],_0x1f6fb2);})[_0x45f7('0x23')](function(_0x586e5e){_0x4bf153=_0x586e5e;return getTicket(_0x175d9e,_0x913b95,_0x4bf153,_0x474fb5,_0x291e2e,_0x474fb5[_0x45f7('0x66')],_0x1f6fb2,_0x45f7('0x72'));})[_0x45f7('0x23')](function(_0x41cecb){_0x141f77=_0x41cecb;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x141f77['id']);logger[_0x45f7('0x1b')](_0x45f7('0x77'),_0x141f77['id'],_0x39beaa['name'],_0x175d9e[_0x45f7('0x3c')]);switch(_0x175d9e[_0x45f7('0x3c')]){case _0x45f7('0x6a'):emit(util[_0x45f7('0x41')](_0x45f7('0x6b'),_0x39beaa[_0x45f7('0x52')]),_0x45f7('0x6c'),{'recordId':_0x141f77['id']});break;case _0x45f7('0x6d'):emit(util[_0x45f7('0x41')](_0x45f7('0x6b'),_0x39beaa[_0x45f7('0x52')]),_0x45f7('0x6e'),{'uri':util[_0x45f7('0x41')](_0x45f7('0x78'),_0x1f6fb2[_0x45f7('0x6f')],_0x141f77['id'])});break;default:logger['error'](_0x45f7('0x75'),_0x45f7('0x79'));}})[_0x45f7('0x70')](function(_0x5d3e59){logger[_0x45f7('0x71')]('[OUTBOUND]',_0x5d3e59);});};exports['unmanaged']=function(_0x4d8609,_0x49bbb7,_0x3e6e69,_0x3a57e2,_0x870e6d,_0x5daa2a){var _0x41f5f8,_0xe2a32,_0x57255f,_0x546e77;_0x5daa2a[_0x45f7('0x5c')]=intUtil[_0x45f7('0x5d')](_0x5daa2a[_0x45f7('0x5c')]);_0x5daa2a[_0x45f7('0x58')]=intUtil[_0x45f7('0x5d')](_0x5daa2a[_0x45f7('0x58')]);if(_0x870e6d&&_0x870e6d[_0x45f7('0x5e')]){logger[_0x45f7('0x1b')]('['+_0x49bbb7[_0x45f7('0x7a')][_0x45f7('0x7b')]()+']',_0x45f7('0x60'));_0x49bbb7[_0x45f7('0x61')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5daa2a[_0x45f7('0x5c')],_0x49bbb7[_0x45f7('0x63')],md5(_0x49bbb7[_0x45f7('0x63')]));}else{_0x49bbb7['recordingURL']='';}return getConnection(_0x5daa2a)[_0x45f7('0x23')](function(_0x7718ec){_0x546e77=_0x7718ec;if(!_[_0x45f7('0x7c')](_0x3a57e2)){return getUser(_0x5daa2a,_0x3a57e2[_0x45f7('0x52')],_0x546e77);}else{return getUser(_0x5daa2a,null,_0x546e77);}})[_0x45f7('0x23')](function(_0x3209b4){_0x41f5f8=_0x3209b4;return getEndUser(_0x5daa2a,_0x3e6e69,_0x49bbb7['calleridname'],_0x49bbb7['calleridnum'],_0x546e77);})[_0x45f7('0x23')](function(_0x44274d){_0xe2a32=_0x44274d;return getTicket(_0x5daa2a,_0x41f5f8,_0xe2a32,_0x3e6e69,_0x49bbb7,_0x3e6e69[_0x45f7('0x66')],_0x546e77);})['then'](function(_0x589b5a){_0x57255f=_0x589b5a;logger[_0x45f7('0x1b')]('['+_0x49bbb7[_0x45f7('0x7a')][_0x45f7('0x7b')]()+_0x45f7('0x7d'),_0x57255f['id']);logger[_0x45f7('0x1b')]('['+_0x49bbb7[_0x45f7('0x7a')][_0x45f7('0x7b')]()+_0x45f7('0x7e'),_0x5daa2a['type']);})[_0x45f7('0x70')](function(_0x1f924b){logger['error']('['+_0x49bbb7[_0x45f7('0x7a')]['toUpperCase']()+']',_0x1f924b);});}; \ No newline at end of file +var _0x4fd4=['queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','ticketType','Case','ContactId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','length','Email','info','Agent\x20%s\x20found.','identity','then','display_name','resolve','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','contact','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','create','forEach','includes','picklist','content','variable','variableName','idField','toString','customVariable','Variable','name','password','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.'];(function(_0x250b5a,_0xd1c5ce){var _0x53d2b2=function(_0x5293ec){while(--_0x5293ec){_0x250b5a['push'](_0x250b5a['shift']());}};_0x53d2b2(++_0xd1c5ce);}(_0x4fd4,0x12d));var _0x44fd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4fd4[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x44fd('0x0'));var rp=require(_0x44fd('0x1'));var moment=require(_0x44fd('0x2'));var BPromise=require(_0x44fd('0x3'));var md5=require(_0x44fd('0x4'));var jsforce=require(_0x44fd('0x5'));var util=require(_0x44fd('0x6'));var Redis=require('ioredis');var intUtil=require(_0x44fd('0x7'));var config=require(_0x44fd('0x8'));var logger=require(_0x44fd('0x9'))('salesforce');config[_0x44fd('0xa')]=_['defaults'](config['redis'],{'host':_0x44fd('0xb'),'port':0x18eb});var io=require(_0x44fd('0xc'))(new Redis(config[_0x44fd('0xa')]));function emit(_0x14aab3,_0x3a85ee,_0x1af4b6){io['to'](_0x14aab3)[_0x44fd('0xd')](_0x3a85ee,_0x1af4b6);}function getTicket(_0x1854d0,_0x4491fe,_0x4df6f4,_0x4a1f87,_0xc47653,_0xb4c65f,_0xf6055c,_0x3e194a){var _0x235230=Object[_0x44fd('0xe')]({},{'OwnerId':_0x4491fe['id'],'Subject':intUtil[_0x44fd('0xf')](_0x4a1f87[_0x44fd('0x10')],_0xc47653,'\x20'),'Description':intUtil[_0x44fd('0xf')](_0x4a1f87[_0x44fd('0x11')],_0xc47653,'\x0a')},getCustomFields(_0xb4c65f,_0xc47653));if(_0x4df6f4){if(_0x4a1f87['ticketType']===_0x44fd('0x12')){_0x235230[_0x44fd('0x13')]=moment['utc']();_0x235230[_0x44fd('0x14')]=![];_0x235230[_0x44fd('0x15')]=![];if(_0x4df6f4[_0x44fd('0x16')]==='contact'||_0x4df6f4['endUserType']===_0x44fd('0x17')){_0x235230[_0x44fd('0x18')]=_0x4df6f4['id'];}else if(_0x4df6f4[_0x44fd('0x16')]===_0x44fd('0x19')){_0x235230[_0x44fd('0x1a')]=_0x4df6f4['id'];}}else if(_0x4a1f87[_0x44fd('0x1b')]===_0x44fd('0x1c')){if(_0x4df6f4['endUserType']==='contact'){_0x235230[_0x44fd('0x1d')]=_0x4df6f4['id'];}else if(_0x4df6f4[_0x44fd('0x16')]==='account'){_0x235230['AccountId']=_0x4df6f4['id'];}else if(_0x4df6f4[_0x44fd('0x16')]==='lead'&&_0x4a1f87[_0x44fd('0x1e')]){_0x235230[_0x4a1f87[_0x44fd('0x1e')]]=_0x4df6f4['id'];}else{logger['info'](_0x44fd('0x1f'));}}}return _0xf6055c[_0x44fd('0x20')](_0x4a1f87[_0x44fd('0x1b')])['create'](_0x235230);}function getUser(_0xb36423,_0x3a9e56,_0x34639b){if(!_[_0x44fd('0x21')](_0x3a9e56)&&intUtil[_0x44fd('0x22')](_0x3a9e56)){var _0x142550={'Email':_0x3a9e56};var _0x136244={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x34639b[_0x44fd('0x20')](_0x44fd('0x23'))[_0x44fd('0x24')](_0x142550,_0x136244)[_0x44fd('0x25')]()['then'](function(_0x5577c3){if(_0x5577c3[_0x44fd('0x26')]){var _0x1b0950=_[_0x44fd('0x24')](_0x5577c3,function(_0x910775){return _0x910775[_0x44fd('0x27')]===_0x3a9e56;});if(_0x1b0950){logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x3a9e56);return BPromise['resolve']({'id':_0x1b0950['Id'],'name':_0x1b0950['Name']});}}else{logger[_0x44fd('0x28')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3a9e56);return _0x34639b[_0x44fd('0x2a')]()[_0x44fd('0x2b')](function(_0x211666){return BPromise['resolve']({'id':_0x211666['user_id'],'name':_0x211666[_0x44fd('0x2c')]});});}});}else{logger[_0x44fd('0x28')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3a9e56);return _0x34639b[_0x44fd('0x2a')]()['then'](function(_0x14fe7c){return BPromise[_0x44fd('0x2d')]({'id':_0x14fe7c[_0x44fd('0x2e')],'name':_0x14fe7c[_0x44fd('0x2c')]});});}}function getEndUser(_0xeb6a8c,_0x20dc59,_0x26b5ac,_0x5496a5,_0x110ae1){var _0x183c73={'$or':{'Phone':_0x5496a5}};var _0x5dd8ca={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x44fd('0x2b')](function(){logger[_0x44fd('0x28')](_0x44fd('0x2f'),_0x5496a5,_0x20dc59[_0x44fd('0x30')]);switch(_0x20dc59[_0x44fd('0x30')]){case _0x44fd('0x31'):var _0x590f9b=_[_0x44fd('0x32')](_0x183c73);if(_0x20dc59[_0x44fd('0x33')]){var _0x4aa3a9={};_0x4aa3a9[_0x20dc59[_0x44fd('0x33')]]=_0x5496a5;_['merge'](_0x590f9b[_0x44fd('0x34')],_0x4aa3a9);}return _0x110ae1['sobject'](_0x44fd('0x35'))[_0x44fd('0x24')](_0x590f9b,_0x5dd8ca)[_0x44fd('0x25')]()[_0x44fd('0x2b')](function(_0x49ed42){if(_0x49ed42&&_0x49ed42[_0x44fd('0x26')]){return _0x49ed42;}else{var _0x1c130a=_[_0x44fd('0x32')](_0x183c73);if(_0x20dc59[_0x44fd('0x36')]){var _0x399213={};_0x399213[_0x20dc59['additionalSearchLead']]=_0x5496a5;_[_0x44fd('0x37')](_0x1c130a[_0x44fd('0x34')],_0x399213);}return _0x110ae1[_0x44fd('0x20')](_0x44fd('0x38'))[_0x44fd('0x24')](_0x1c130a,_0x5dd8ca);}});case _0x44fd('0x39'):var _0x3f98e9=_[_0x44fd('0x32')](_0x183c73);if(_0x20dc59[_0x44fd('0x3a')]){var _0x4aa3a9={};_0x4aa3a9[_0x20dc59[_0x44fd('0x3a')]]=_0x5496a5;_[_0x44fd('0x37')](_0x3f98e9[_0x44fd('0x34')],_0x4aa3a9);}return _0x110ae1[_0x44fd('0x20')](_0x44fd('0x3b'))[_0x44fd('0x24')](_0x3f98e9,_0x5dd8ca)[_0x44fd('0x25')]()[_0x44fd('0x2b')](function(_0x3be3ed){if(_0x3be3ed&&_0x3be3ed[_0x44fd('0x26')]){return _0x3be3ed;}else{var _0x4bf99c=_[_0x44fd('0x32')](_0x183c73);if(_0x20dc59[_0x44fd('0x33')]){var _0xf78597={};_0xf78597[_0x20dc59[_0x44fd('0x33')]]=_0x5496a5;_['merge'](_0x4bf99c[_0x44fd('0x34')],_0xf78597);}return _0x110ae1[_0x44fd('0x20')](_0x44fd('0x35'))['find'](_0x4bf99c,_0x5dd8ca)[_0x44fd('0x2b')](function(_0x4c79cb){if(_0x4c79cb&&_0x4c79cb[_0x44fd('0x26')]){return _0x4c79cb;}else{var _0x3583be=_['cloneDeep'](_0x183c73);if(_0x20dc59[_0x44fd('0x36')]){var _0x176387={};_0x176387[_0x20dc59['additionalSearchLead']]=_0x5496a5;_['merge'](_0x3583be['$or'],_0x176387);}return _0x110ae1[_0x44fd('0x20')](_0x44fd('0x38'))['find'](_0x3583be,_0x5dd8ca);}});}});case _0x44fd('0x3c'):var _0x590f9b=_[_0x44fd('0x32')](_0x183c73);if(_0x20dc59[_0x44fd('0x33')]){var _0x4aa3a9={};_0x4aa3a9[_0x20dc59[_0x44fd('0x33')]]=_0x5496a5;_[_0x44fd('0x37')](_0x590f9b[_0x44fd('0x34')],_0x4aa3a9);}return _0x110ae1[_0x44fd('0x20')](_0x44fd('0x35'))['find'](_0x590f9b,_0x5dd8ca)[_0x44fd('0x25')]();case _0x44fd('0x17'):var _0xcea085=_['cloneDeep'](_0x183c73);if(_0x20dc59['additionalSearchLead']){var _0x4aa3a9={};_0x4aa3a9[_0x20dc59[_0x44fd('0x36')]]=_0x5496a5;_[_0x44fd('0x37')](_0xcea085['$or'],_0x4aa3a9);}return _0x110ae1[_0x44fd('0x20')](_0x44fd('0x38'))['find'](_0xcea085,_0x5dd8ca);case _0x44fd('0x19'):var _0x3f98e9=_[_0x44fd('0x32')](_0x183c73);if(_0x20dc59[_0x44fd('0x3a')]){var _0x4aa3a9={};_0x4aa3a9[_0x20dc59['additionalSearchAccount']]=_0x5496a5;_[_0x44fd('0x37')](_0x3f98e9[_0x44fd('0x34')],_0x4aa3a9);}return _0x110ae1[_0x44fd('0x20')](_0x44fd('0x3b'))['find'](_0x3f98e9,_0x5dd8ca);default:return null;}})[_0x44fd('0x2b')](function(_0x4786b2){if(_0x4786b2&&_0x4786b2[_0x44fd('0x26')]){var _0x504d9e=_[_0x44fd('0x3d')](_0x4786b2);if(_0x504d9e){return BPromise[_0x44fd('0x2d')]({'id':_0x504d9e['Id'],'name':_0x504d9e[_0x44fd('0x3e')],'phone':_0x504d9e[_0x44fd('0x3f')],'endUserType':_0x504d9e[_0x44fd('0x40')][_0x44fd('0x41')][_0x44fd('0x42')]()});}}})['then'](function(_0x33b7bf){if(_0x33b7bf){logger[_0x44fd('0x28')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x33b7bf['endUserType'],_0x5496a5);return BPromise[_0x44fd('0x2d')](_0x33b7bf);}else{logger[_0x44fd('0x28')](_0x44fd('0x43'),_0x5496a5);var _0x16ac67={'Phone':_0x5496a5};if(_0x20dc59[_0x44fd('0x44')]){if(_0x20dc59[_0x44fd('0x44')]==='contact'){logger[_0x44fd('0x28')](_0x44fd('0x45'),_0x5496a5,_0x20dc59[_0x44fd('0x44')]);_0x16ac67[_0x44fd('0x46')]=_0x26b5ac!==_0x44fd('0x47')?_0x26b5ac:util[_0x44fd('0x48')](_0x44fd('0x49'),_0x5496a5);}else if(_0x20dc59[_0x44fd('0x44')]==='lead'){logger[_0x44fd('0x28')](_0x44fd('0x45'),_0x5496a5,_0x20dc59[_0x44fd('0x44')]);_0x16ac67[_0x44fd('0x46')]=_0x26b5ac!==_0x44fd('0x47')?_0x26b5ac:util[_0x44fd('0x48')]('Caller\x20-\x20%s',_0x5496a5);_0x16ac67[_0x44fd('0x4a')]='No\x20Company';}else if(_0x20dc59[_0x44fd('0x44')]===_0x44fd('0x19')){logger[_0x44fd('0x28')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5496a5,_0x20dc59[_0x44fd('0x44')]);_0x16ac67[_0x44fd('0x3e')]=_0x26b5ac!==''?_0x26b5ac:util[_0x44fd('0x48')](_0x44fd('0x49'),_0x5496a5);}else{return null;}}return _0x110ae1[_0x44fd('0x20')](_[_0x44fd('0x4b')](_0x20dc59['moduleCreate']))[_0x44fd('0x4c')](_0x16ac67)['then'](function(_0x490bf2){return BPromise['resolve']({'id':_0x490bf2['id'],'endUserType':_0x20dc59[_0x44fd('0x44')]});});}});}function getCustomFields(_0x50156f,_0x2c8791){var _0x2744c9={};if(_0x50156f[_0x44fd('0x26')]>0x0){_[_0x44fd('0x4d')](_0x50156f,function(_0x340c8b){if(_[_0x44fd('0x4e')](['string',_0x44fd('0x4f')],_0x340c8b[_0x44fd('0x41')])&&_0x340c8b['idField']){_0x2744c9[_0x340c8b['idField']]=_0x340c8b[_0x44fd('0x50')]['toString']();}else if(_0x340c8b[_0x44fd('0x41')]===_0x44fd('0x51')&&_0x340c8b[_0x44fd('0x52')]&&_0x340c8b[_0x44fd('0x53')]){_0x2c8791[_0x340c8b[_0x44fd('0x52')]]&&(_0x2744c9[_0x340c8b[_0x44fd('0x53')]]=_0x2c8791[_0x340c8b[_0x44fd('0x52')]][_0x44fd('0x54')]());}else if(_0x340c8b[_0x44fd('0x41')]===_0x44fd('0x55')&&_0x340c8b[_0x44fd('0x56')]&&_0x340c8b['Variable'][_0x44fd('0x57')]&&_0x340c8b[_0x44fd('0x53')]){_0x2c8791[_0x340c8b[_0x44fd('0x56')]['name']['toLowerCase']()]&&(_0x2744c9[_0x340c8b[_0x44fd('0x53')]]=_0x2c8791[_0x340c8b['Variable'][_0x44fd('0x57')][_0x44fd('0x42')]()]['toString']());}});}return _0x2744c9;}function getConnection(_0x59fec4){var _0x46236a=_0x59fec4[_0x44fd('0x58')]['concat'](_0x59fec4[_0x44fd('0x59')]);var _0x2a2763=new jsforce['Connection']({'oauth2':{'loginUrl':_0x59fec4[_0x44fd('0x5a')]||_0x44fd('0x5b'),'clientId':_0x59fec4[_0x44fd('0x5c')],'clientSecret':_0x59fec4[_0x44fd('0x5d')]}});return _0x2a2763['login'](_0x59fec4['username'],_0x46236a)[_0x44fd('0x2b')](function(){logger['info'](_0x44fd('0x5e'));return _0x2a2763;});}exports[_0x44fd('0x5f')]=function(_0x25776d,_0x1dc119,_0x3ff220,_0x4fe385,_0x2ac194,_0x3aac52){var _0xb39a9,_0x1a523e,_0x4fa3e6,_0x4c774b;_0x3aac52[_0x44fd('0x60')]=intUtil[_0x44fd('0x61')](_0x3aac52[_0x44fd('0x60')]);_0x3aac52[_0x44fd('0x5a')]=intUtil['stripTrailingSlash'](_0x3aac52['remoteUri']);if(_0x2ac194&&_0x2ac194[_0x44fd('0x62')]){logger[_0x44fd('0x28')](_0x44fd('0x63'),_0x44fd('0x64'));_0x1dc119[_0x44fd('0x65')]=util[_0x44fd('0x48')](_0x44fd('0x66'),_0x3aac52['serverUrl'],_0x1dc119[_0x44fd('0x67')],md5(_0x1dc119[_0x44fd('0x67')]));}else{_0x1dc119[_0x44fd('0x65')]='';}return getConnection(_0x3aac52)[_0x44fd('0x2b')](function(_0x41be39){_0x4c774b=_0x41be39;return getUser(_0x3aac52,_0x4fe385[_0x44fd('0x68')],_0x4c774b);})[_0x44fd('0x2b')](function(_0x3ad44c){_0xb39a9=_0x3ad44c;return getEndUser(_0x3aac52,_0x3ff220,_0x1dc119[_0x44fd('0x69')],_0x1dc119['calleridnum'],_0x4c774b);})['then'](function(_0x3c51d0){_0x1a523e=_0x3c51d0;return getTicket(_0x3aac52,_0xb39a9,_0x1a523e,_0x3ff220,_0x1dc119,_0x3ff220['Fields'],_0x4c774b,_0x44fd('0x5f'));})[_0x44fd('0x2b')](function(_0x597f8a){_0x4fa3e6=_0x597f8a;logger[_0x44fd('0x28')](_0x44fd('0x6a'),_0x4fa3e6['id']);logger[_0x44fd('0x28')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4fa3e6['id'],_0x4fe385[_0x44fd('0x57')],_0x3aac52[_0x44fd('0x41')]);switch(_0x3aac52['type']){case _0x44fd('0x6b'):emit(util[_0x44fd('0x48')](_0x44fd('0x6c'),_0x4fe385[_0x44fd('0x57')]),_0x44fd('0x6d'),{'recordId':_0x4fa3e6['id']});break;case _0x44fd('0x6e'):emit(util['format'](_0x44fd('0x6c'),_0x4fe385[_0x44fd('0x57')]),'trigger:browser:url',{'uri':util[_0x44fd('0x48')](_0x44fd('0x6f'),_0x4c774b[_0x44fd('0x70')],_0x4fa3e6['id'])});break;default:logger['error'](_0x44fd('0x71'));}})[_0x44fd('0x72')](function(_0x116c88){logger[_0x44fd('0x73')]('[QUEUE]',_0x116c88);});};exports[_0x44fd('0x74')]=function(_0x5ac96a,_0x1c40a5,_0x3ca287,_0x195e79,_0x1d7d99,_0x2f5ab3,_0x26d3ca){var _0x1bbdb6,_0x4a35ba,_0x130358,_0x1baa30;_0x2f5ab3[_0x44fd('0x60')]=intUtil['stripTrailingSlash'](_0x2f5ab3[_0x44fd('0x60')]);_0x2f5ab3['remoteUri']=intUtil[_0x44fd('0x61')](_0x2f5ab3[_0x44fd('0x5a')]);if(_0x26d3ca&&_0x26d3ca[_0x44fd('0x75')]&&_0x26d3ca[_0x44fd('0x75')]!==_0x44fd('0x76')){logger[_0x44fd('0x28')](_0x44fd('0x77'),_0x44fd('0x64'));_0x1c40a5[_0x44fd('0x65')]=util[_0x44fd('0x48')](_0x44fd('0x66'),_0x2f5ab3['serverUrl'],_0x1c40a5[_0x44fd('0x67')],md5(_0x1c40a5['uniqueid']));}return getConnection(_0x2f5ab3)[_0x44fd('0x2b')](function(_0x173049){_0x1baa30=_0x173049;return getUser(_0x2f5ab3,_0x195e79[_0x44fd('0x68')],_0x1baa30);})[_0x44fd('0x2b')](function(_0x4b30af){_0x1bbdb6=_0x4b30af;return getEndUser(_0x2f5ab3,_0x3ca287,_0x1c40a5[_0x44fd('0x78')],_0x1c40a5[_0x44fd('0x79')],_0x1baa30);})['then'](function(_0x13c121){_0x4a35ba=_0x13c121;return getTicket(_0x2f5ab3,_0x1bbdb6,_0x4a35ba,_0x3ca287,_0x1c40a5,_0x3ca287[_0x44fd('0x7a')],_0x1baa30,'outbound');})[_0x44fd('0x2b')](function(_0x102dd4){_0x130358=_0x102dd4;logger[_0x44fd('0x28')](_0x44fd('0x7b'),_0x130358['id']);logger['info'](_0x44fd('0x7c'),_0x130358['id'],_0x195e79['name'],_0x2f5ab3[_0x44fd('0x41')]);switch(_0x2f5ab3[_0x44fd('0x41')]){case _0x44fd('0x6b'):emit(util[_0x44fd('0x48')](_0x44fd('0x6c'),_0x195e79[_0x44fd('0x57')]),_0x44fd('0x6d'),{'recordId':_0x130358['id']});break;case _0x44fd('0x6e'):emit(util[_0x44fd('0x48')](_0x44fd('0x6c'),_0x195e79[_0x44fd('0x57')]),_0x44fd('0x7d'),{'uri':util['format'](_0x44fd('0x6f'),_0x1baa30[_0x44fd('0x70')],_0x130358['id'])});break;default:logger[_0x44fd('0x73')](_0x44fd('0x77'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x44fd('0x72')](function(_0x587d79){logger[_0x44fd('0x73')](_0x44fd('0x77'),_0x587d79);});};exports[_0x44fd('0x7e')]=function(_0xc1822c,_0x269fe3,_0x1d412e,_0x324a14,_0x3daa17,_0x94fea5){var _0x39c906,_0x38892c,_0x430eb9,_0x92399f;_0x94fea5[_0x44fd('0x60')]=intUtil[_0x44fd('0x61')](_0x94fea5['serverUrl']);_0x94fea5[_0x44fd('0x5a')]=intUtil['stripTrailingSlash'](_0x94fea5['remoteUri']);if(_0x3daa17&&_0x3daa17[_0x44fd('0x62')]){logger[_0x44fd('0x28')]('['+_0x269fe3[_0x44fd('0x7f')][_0x44fd('0x80')]()+']',_0x44fd('0x64'));_0x269fe3[_0x44fd('0x65')]=util['format'](_0x44fd('0x66'),_0x94fea5[_0x44fd('0x60')],_0x269fe3[_0x44fd('0x67')],md5(_0x269fe3['uniqueid']));}else{_0x269fe3['recordingURL']='';}return getConnection(_0x94fea5)[_0x44fd('0x2b')](function(_0x4d8ec4){_0x92399f=_0x4d8ec4;if(!_[_0x44fd('0x21')](_0x324a14)){return getUser(_0x94fea5,_0x324a14[_0x44fd('0x57')],_0x92399f);}else{return getUser(_0x94fea5,null,_0x92399f);}})[_0x44fd('0x2b')](function(_0x5572cb){_0x39c906=_0x5572cb;return getEndUser(_0x94fea5,_0x1d412e,_0x269fe3[_0x44fd('0x69')],_0x269fe3[_0x44fd('0x81')],_0x92399f);})[_0x44fd('0x2b')](function(_0x2a73d6){_0x38892c=_0x2a73d6;return getTicket(_0x94fea5,_0x39c906,_0x38892c,_0x1d412e,_0x269fe3,_0x1d412e[_0x44fd('0x7a')],_0x92399f);})[_0x44fd('0x2b')](function(_0x56a9de){_0x430eb9=_0x56a9de;logger[_0x44fd('0x28')]('['+_0x269fe3[_0x44fd('0x7f')][_0x44fd('0x80')]()+_0x44fd('0x82'),_0x430eb9['id']);logger[_0x44fd('0x28')]('['+_0x269fe3[_0x44fd('0x7f')][_0x44fd('0x80')]()+_0x44fd('0x83'),_0x94fea5[_0x44fd('0x41')]);})['catch'](function(_0x46cc10){logger[_0x44fd('0x73')]('['+_0x269fe3[_0x44fd('0x7f')][_0x44fd('0x80')]()+']',_0x46cc10);});}; \ 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 65ea23e..f4d3578 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 _0x5a2c=['Descriptions','Fields','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','length','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','emit','password','sysparm_display_value=true','stripTrailingSlash','serverUrl','format','%s/api/now/table/','remoteUri','isNil','email','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','true','userId','adminEmail','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','getString'];(function(_0x2fb28c,_0x458fc5){var _0x22ee82=function(_0x47aa1c){while(--_0x47aa1c){_0x2fb28c['push'](_0x2fb28c['shift']());}};_0x22ee82(++_0x458fc5);}(_0x5a2c,0x1d3));var _0xc5a2=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x5a2c[_0x72a33d];return _0x2621d5;};'use strict';var _=require(_0xc5a2('0x0'));var Promise=require(_0xc5a2('0x1'));var rp=require(_0xc5a2('0x2'));var util=require(_0xc5a2('0x3'));var md5=require(_0xc5a2('0x4'));var Redis=require(_0xc5a2('0x5'));var intUtil=require('./util');var config=require(_0xc5a2('0x6'));var logger=require(_0xc5a2('0x7'))(_0xc5a2('0x8'));config[_0xc5a2('0x9')]=_[_0xc5a2('0xa')](config['redis'],{'host':_0xc5a2('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x39557c,_0x7e2006,_0x5370a7,_0x129439,_0x420545,_0xb8bea3){return new Promise(function(_0x13046e,_0x2e2c5b){var _0x1ca14a={'method':_0xc5a2('0xc'),'uri':_0x129439+_0xc5a2('0xd')+'&'+_0x420545+'&'+_0xb8bea3,'auth':_0x7e2006,'json':!![]};return rp(_0x1ca14a)['then'](function(_0x19c4d1){if(_0x19c4d1['result']['length']>0x0){_0x5370a7[_0xc5a2('0xe')]=_0x19c4d1[_0xc5a2('0xf')][0x0][_0xc5a2('0x10')];}logger[_0xc5a2('0x11')]('['+[_0x39557c[_0xc5a2('0x12')]()]+_0xc5a2('0x13'),_0x5370a7);_0x13046e(_0x5370a7);})['catch'](function(_0x4d0481){logger[_0xc5a2('0x14')]('['+[_0x39557c[_0xc5a2('0x12')]()]+']',_0x4d0481[_0xc5a2('0x15')]);_0x2e2c5b(_0x4d0481[_0xc5a2('0x15')]);});});}function getUser(_0x5ecf5b,_0x3c7230,_0xeecd7d,_0x30695b,_0x33ef3a){return function(_0x144093){logger[_0xc5a2('0x11')]('['+[_0x5ecf5b['toUpperCase']()]+_0xc5a2('0x16'),_0x144093);return new Promise(function(_0x1bd4d0,_0x3edec4){if(intUtil[_0xc5a2('0x17')](_0x144093[_0xc5a2('0x18')])){var _0x54f9bf={'method':'GET','uri':_0xeecd7d+_0xc5a2('0x19')+_0x144093[_0xc5a2('0x18')]+'&'+_0x30695b+'&'+_0x33ef3a,'auth':_0x3c7230,'json':!![]};logger[_0xc5a2('0x11')]('['+[_0x5ecf5b[_0xc5a2('0x12')]()]+_0xc5a2('0x1a'),_0x54f9bf);return rp(_0x54f9bf)[_0xc5a2('0x1b')](function(_0x526983){logger[_0xc5a2('0x11')]('['+[_0x5ecf5b['toUpperCase']()]+'],\x20getUser\x20entity',_0x526983);if(_0x526983[_0xc5a2('0xf')]['length']>0x0&&String(_0x526983['result'][0x0][_0xc5a2('0x1c')])===_0xc5a2('0x1d')){_0x144093[_0xc5a2('0x1e')]=_0x526983[_0xc5a2('0xf')][0x0][_0xc5a2('0x10')];}else{_0x144093[_0xc5a2('0x1e')]=_0x144093['adminId'];_0x144093[_0xc5a2('0x18')]=_0x144093[_0xc5a2('0x1f')];}logger[_0xc5a2('0x11')]('['+[_0x5ecf5b[_0xc5a2('0x12')]()]+'],\x20getUser\x20crm',_0x144093);_0x1bd4d0(_0x144093);})[_0xc5a2('0x20')](function(_0xf286c3){logger[_0xc5a2('0x14')]('['+[_0x5ecf5b[_0xc5a2('0x12')]()]+']',_0xf286c3[_0xc5a2('0x15')]);_0x3edec4(_0xf286c3[_0xc5a2('0x15')]);});}else{logger[_0xc5a2('0x11')]('['+[_0x5ecf5b['toUpperCase']()]+_0xc5a2('0x21'));_0x144093[_0xc5a2('0x1e')]=_0x144093['adminId'];_0x144093[_0xc5a2('0x18')]=_0x144093[_0xc5a2('0x1f')];_0x1bd4d0(_0x144093);}});};}function createEndUser(_0xaa1bf,_0x2583b8,_0x5e5086,_0xe78978,_0x485d11){logger[_0xc5a2('0x11')]('['+[_0xaa1bf['toUpperCase']()]+_0xc5a2('0x22'),_0x5e5086);return new Promise(function(_0x270c30,_0x5c5fda){var _0x14fc36={'method':_0xc5a2('0x23'),'uri':_0xe78978+_0xc5a2('0x24')+_0x485d11,'body':{'user_name':_0x5e5086[_0xc5a2('0x25')],'roles':_0xc5a2('0x26'),'first_name':_0x5e5086[_0xc5a2('0x25')],'active':_0xc5a2('0x1d'),'date_format':'System','phone':_0x5e5086[_0xc5a2('0x25')]},'auth':_0x2583b8,'json':!![]};return rp(_0x14fc36)['then'](function(_0x3e17c7){logger['info']('['+[_0xaa1bf[_0xc5a2('0x12')]()]+'],\x20EndUser\x20schema',_0x3e17c7[_0xc5a2('0xf')]);_0x5e5086[_0xc5a2('0x27')]=_0x3e17c7['result'][_0xc5a2('0x10')];_0x270c30(_0x5e5086);})['catch'](function(_0x2ccfff){logger[_0xc5a2('0x14')]('['+[_0xaa1bf[_0xc5a2('0x12')]()]+']',_0x2ccfff[_0xc5a2('0x15')]);_0x5c5fda(_0x2ccfff['message']);});});}function getEndUser(_0x3847f5,_0x2f5074,_0x5e98e5,_0x4cd915,_0x1fe9ba){return function(_0x56171e){logger[_0xc5a2('0x11')]('['+[_0x3847f5['toUpperCase']()]+_0xc5a2('0x28'),_0x56171e);return new Promise(function(_0x5838ca,_0x232018){var _0x16d6a9={'method':'GET','uri':_0x5e98e5+'sys_user?sysparm_query=phone%3D'+_0x56171e[_0xc5a2('0x25')]+'&'+_0x4cd915+'&'+_0x1fe9ba,'auth':_0x2f5074,'json':!![]};return rp(_0x16d6a9)[_0xc5a2('0x1b')](function(_0xb45b50){if(_0xb45b50[_0xc5a2('0xf')]['length']>0x0){_0x56171e[_0xc5a2('0x27')]=_0xb45b50[_0xc5a2('0xf')][0x0][_0xc5a2('0x10')];logger[_0xc5a2('0x11')]('['+[_0x3847f5['toUpperCase']()]+_0xc5a2('0x29'),_0x56171e);_0x5838ca(_0x56171e);}else{return createEndUser(_0x3847f5,_0x2f5074,_0x56171e,_0x5e98e5,_0x4cd915)[_0xc5a2('0x1b')](function(_0x4779f7){logger[_0xc5a2('0x11')]('['+[_0x3847f5[_0xc5a2('0x12')]()]+'],\x20createEndUser\x20crm',_0x4779f7);_0x5838ca(_0x4779f7);});}})[_0xc5a2('0x20')](function(_0x4edc8b){logger[_0xc5a2('0x14')]('['+[_0x3847f5[_0xc5a2('0x12')]()]+']',_0x4edc8b[_0xc5a2('0x15')]);_0x232018(_0x4edc8b[_0xc5a2('0x15')]);});});};}function getCustomFields(_0x4dca3d,_0x239486){var _0x5b6227={};if(_0x4dca3d['length']>0x0){_[_0xc5a2('0x2a')](_0x4dca3d,function(_0x585bcb){if(_[_0xc5a2('0x2b')]([_0xc5a2('0x2c'),'picklist'],_0x585bcb[_0xc5a2('0x2d')])&&_0x585bcb[_0xc5a2('0x2e')]&&!_0x585bcb[_0xc5a2('0x2f')]){_0x5b6227[_0x585bcb[_0xc5a2('0x2e')][_0xc5a2('0x30')]()]=_0x585bcb[_0xc5a2('0x31')][_0xc5a2('0x32')]();}else if(_[_0xc5a2('0x2b')](['string',_0xc5a2('0x33')],_0x585bcb[_0xc5a2('0x2d')])&&_0x585bcb['idField']&&_0x585bcb[_0xc5a2('0x2f')]){_0x5b6227[_0x585bcb[_0xc5a2('0x34')]['toLowerCase']()]=_0x585bcb['content'][_0xc5a2('0x32')]();}else if(_0x585bcb['type']===_0xc5a2('0x35')&&_0x585bcb[_0xc5a2('0x36')]&&_0x585bcb['idField']&&_0x585bcb['customField']){_0x5b6227[_0x585bcb[_0xc5a2('0x34')]['toLowerCase']()]=_0x239486[_0x585bcb[_0xc5a2('0x36')]][_0xc5a2('0x32')]();}else if(_0x585bcb[_0xc5a2('0x2d')]==='customVariable'&&_0x585bcb[_0xc5a2('0x37')]&&_0x585bcb['Variable'][_0xc5a2('0x38')]&&_0x585bcb['idField']&&_0x585bcb['customField']){_0x5b6227[_0x585bcb[_0xc5a2('0x34')][_0xc5a2('0x30')]()]=_0x239486[_0x585bcb[_0xc5a2('0x37')]['name'][_0xc5a2('0x30')]()]['toString']();}});}return _0x5b6227;}function getTicket(_0x18511a,_0x305666,_0x4f9344,_0x4f6c05,_0x3b165a,_0x2dfff9){return function(_0x19c465){logger['info']('['+[_0x18511a[_0xc5a2('0x12')]()]+_0xc5a2('0x39'),_0x19c465);return new Promise(function(_0x269a02,_0x126765){var _0x3a9fdd=_0x18511a[_0xc5a2('0x30')]()===_0xc5a2('0x3a')?_0x19c465[_0xc5a2('0x1e')]:_0x19c465[_0xc5a2('0x27')];var _0x46bd6b={'method':_0xc5a2('0x23'),'uri':_0x4f9344+_0xc5a2('0x3b')+'?'+_0x2dfff9,'body':Object[_0xc5a2('0x3c')]({},{'active':_0xc5a2('0x1d'),'caller_id':_0x3a9fdd,'assigned_to':_0x19c465[_0xc5a2('0x1e')],'short_description':intUtil['getString'](_0x4f6c05[_0xc5a2('0x3d')],_0x3b165a,'\x20'),'description':intUtil[_0xc5a2('0x3e')](_0x4f6c05[_0xc5a2('0x3f')],_0x3b165a,'\x0a')},getCustomFields(_0x4f6c05[_0xc5a2('0x40')],_0x3b165a)),'auth':_0x305666,'json':!![]};return rp(_0x46bd6b)['then'](function(_0x13d716){logger[_0xc5a2('0x11')]('['+[_0x18511a[_0xc5a2('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x13d716[_0xc5a2('0xf')]);_0x19c465[_0xc5a2('0x41')]=_0x13d716[_0xc5a2('0xf')]['sys_id'];_0x19c465[_0xc5a2('0x42')]=_0x13d716[_0xc5a2('0xf')][_0xc5a2('0x43')];logger['info']('['+[_0x18511a[_0xc5a2('0x12')]()]+']\x20getTicket\x20crm',_0x19c465);_0x269a02(_0x19c465);})[_0xc5a2('0x20')](function(_0x53acf4){logger[_0xc5a2('0x14')]('['+[_0x18511a[_0xc5a2('0x12')]()]+']',_0x53acf4[_0xc5a2('0x15')]);_0x126765(_0x53acf4[_0xc5a2('0x15')]);});});};}function createRemoteTag(_0x2842ef,_0x159f6b,_0x40d678,_0x564f5d){return new Promise(function(_0x3b3013,_0x1996d){var _0x360f58={'method':_0xc5a2('0x23'),'uri':_0x40d678+_0xc5a2('0x44')+'?'+_0x564f5d,'body':{'short_description':_0x2842ef,'global':!![],'active':!![],'name':_0x2842ef},'auth':_0x159f6b,'json':!![]};return rp(_0x360f58)[_0xc5a2('0x1b')](function(_0xf9df96){var _0x3dedf7=_0xf9df96['result'][_0xc5a2('0x10')];_0x3b3013(_0x3dedf7);});});}function getRemoteTag(_0x8c617e,_0x5adc1b,_0x3c6be4,_0x1ba46a,_0x58a7a8){return new Promise(function(_0x59f231,_0x457b26){var _0x420d86={'method':_0xc5a2('0xc'),'uri':_0x3c6be4+'label'+_0xc5a2('0x45')+_0x8c617e+'&'+_0x1ba46a,'auth':_0x5adc1b,'json':!![]};return rp(_0x420d86)['then'](function(_0x4a753b){if(_0x4a753b[_0xc5a2('0xf')][_0xc5a2('0x46')]>0x0){var _0x7facec=_0x4a753b[_0xc5a2('0xf')][0x0][_0xc5a2('0x10')];_0x59f231(_0x7facec);}else{return createRemoteTag(_0x8c617e,_0x5adc1b,_0x3c6be4,_0x1ba46a)[_0xc5a2('0x1b')](function(_0x4ffd42){_0x59f231(_0x4ffd42);});}});});}function assignTagToIncident(_0xd6c98e,_0x461ec6,_0xfc5d23,_0xabbc85,_0x36d05c){return new Promise(function(_0xc1adf3,_0x2a535c){var _0x3e1ffe={'method':'POST','uri':_0xfc5d23+_0xc5a2('0x47')+'?'+_0x36d05c,'body':{'label':_0xd6c98e,'table':_0xc5a2('0x3b'),'id_type':_0xc5a2('0x48'),'table_key':_0xabbc85['ticketId'],'title':_0xc5a2('0x49')+_0xabbc85[_0xc5a2('0x42')],'id_display':_0xabbc85[_0xc5a2('0x42')]},'auth':_0x461ec6,'json':!![]};return rp(_0x3e1ffe)[_0xc5a2('0x1b')](function(_0x3ab651){_0xc1adf3();})[_0xc5a2('0x20')](function(){_0xc1adf3();});});}function manageTags(_0x53db0f,_0x293302,_0x460e59,_0x21a232,_0x187db1,_0x3943f1,_0x4f943b){return new Promise(function(_0x4e1a85,_0x2e4d6b){var _0x234662=[];_0x293302['forEach'](function(_0x107a55){_0x234662['push'](getRemoteTag(_0x107a55,_0x460e59,_0x21a232,_0x3943f1,_0x4f943b));});return Promise[_0xc5a2('0x4a')](_0x234662)[_0xc5a2('0x1b')](function(_0x3e2508){if(_0x3e2508[_0xc5a2('0x46')]){logger['info']('['+[_0x53db0f[_0xc5a2('0x12')]()]+_0xc5a2('0x4b'),_0x3e2508);var _0x1ccb05=[];_0x3e2508[_0xc5a2('0x2a')](function(_0x10625b){_0x1ccb05[_0xc5a2('0x4c')](assignTagToIncident(_0x10625b,_0x460e59,_0x21a232,_0x187db1,_0x3943f1));});return Promise['all'](_0x1ccb05)[_0xc5a2('0x1b')](function(){_0x4e1a85();})[_0xc5a2('0x20')](function(){_0x4e1a85();});}else{_0x4e1a85();}});});}function getTags(_0x1e8a7d,_0x2fbf0c,_0x101161,_0x32eeda,_0x5544bb,_0x56ea86){return function(_0x3491b2){return new Promise(function(_0x1b55ad,_0x16f5ef){var _0x52c47b=[];var _0x4a94c2=_0x32eeda['Tags'];if(_0x4a94c2&&_0x4a94c2['length']>0x0){_0x52c47b=_[_0xc5a2('0x4d')](_0x4a94c2,_0xc5a2('0x38'));}if(_0x52c47b[_0xc5a2('0x46')]>0x0){return manageTags(_0x1e8a7d,_0x52c47b,_0x2fbf0c,_0x101161,_0x3491b2,_0x5544bb,_0x56ea86)[_0xc5a2('0x1b')](function(){_0x1b55ad(_0x3491b2);});}else{_0x1b55ad(_0x3491b2);}});};}function emit(_0x36fba8,_0x2f6c2c,_0x17f103){var _0x4d1134=_0xc5a2('0x4e')+_0xc5a2('0x4f')+_0xc5a2('0x50')+'%255EORDERBYDESCnumber';var _0x14f8d4={'uri':_0x36fba8+_0xc5a2('0x51')+_0x17f103+_0x4d1134};io['to'](util['format']('user:%s',_0x2f6c2c))[_0xc5a2('0x52')]('trigger:browser:url',_0x14f8d4);}exports['cs']=function(_0x4813c9,_0x529cf8,_0x108bbd,_0x3771d6,_0x467a9f,_0x12b772,_0x42da09,_0x39f295){var _0x3d08c2={};var _0x38ce3e={'user':_0x12b772['username'],'pass':_0x12b772[_0xc5a2('0x53')]};var _0x2a601f='sysparm_limit=1';var _0x38cf39=_0xc5a2('0x54');_0x12b772['remoteUri']=intUtil[_0xc5a2('0x55')](_0x12b772['remoteUri']);_0x12b772[_0xc5a2('0x56')]=intUtil[_0xc5a2('0x55')](_0x12b772[_0xc5a2('0x56')]);var _0x39c2fd=util[_0xc5a2('0x57')](_0xc5a2('0x58'),_0x12b772[_0xc5a2('0x59')]);_0x3d08c2['userEmail']=!_[_0xc5a2('0x5a')](_0x3771d6)?_0x3771d6[_0xc5a2('0x5b')]:null;_0x3d08c2[_0xc5a2('0x1f')]=_0x12b772['email'];_0x3d08c2[_0xc5a2('0x25')]=_0x39f295[_0xc5a2('0x30')]()===_0xc5a2('0x3a')?_0x529cf8['destcalleridnum']:_0x529cf8['calleridnum'];_0x3d08c2['callDirection']=_0x39f295===_0xc5a2('0x5c')||_0x39f295===_0xc5a2('0x5d')?_0xc5a2('0x5c'):_0xc5a2('0x3a');var _0x3156d5=util[_0xc5a2('0x57')](_0xc5a2('0x5e'),_0x12b772[_0xc5a2('0x56')],_0x529cf8['uniqueid'],md5(_0x529cf8[_0xc5a2('0x5f')]));if(_0x467a9f&&_0x467a9f[_0xc5a2('0x60')]){logger[_0xc5a2('0x11')]('[QUEUE]',_0xc5a2('0x61'));_0x529cf8[_0xc5a2('0x62')]=_0x3156d5;}else if(_0x42da09&&_0x42da09[_0xc5a2('0x63')]&&_0x42da09[_0xc5a2('0x63')]!==_0xc5a2('0x64')){logger[_0xc5a2('0x11')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x529cf8[_0xc5a2('0x62')]=_0x3156d5;}else{_0x529cf8[_0xc5a2('0x62')]='';}return getAdminUser(_0x39f295,_0x38ce3e,_0x3d08c2,_0x39c2fd,_0x38cf39,_0x2a601f)['then'](getUser(_0x39f295,_0x38ce3e,_0x39c2fd,_0x38cf39,_0x2a601f))['then'](getEndUser(_0x39f295,_0x38ce3e,_0x39c2fd,_0x38cf39,_0x2a601f))[_0xc5a2('0x1b')](getTicket(_0x39f295,_0x38ce3e,_0x39c2fd,_0x108bbd,_0x529cf8,_0x38cf39))[_0xc5a2('0x1b')](function(_0x17f53d){logger[_0xc5a2('0x11')](util[_0xc5a2('0x57')](_0xc5a2('0x65'),_0x17f53d['ticketId']));logger[_0xc5a2('0x11')](util[_0xc5a2('0x57')](_0xc5a2('0x66'),_0x39f295));if(_0x39f295!==_0xc5a2('0x5d')){logger[_0xc5a2('0x11')]('['+[_0x39f295[_0xc5a2('0x12')]()]+']',_0xc5a2('0x67'));emit(_0x12b772[_0xc5a2('0x59')],_0x3771d6[_0xc5a2('0x38')],_0x17f53d[_0xc5a2('0x41')]);}})[_0xc5a2('0x20')](function(_0x347648){logger[_0xc5a2('0x14')]('['+[_0x39f295[_0xc5a2('0x12')]()]+_0xc5a2('0x68'),util[_0xc5a2('0x69')](_0x347648,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x98b6=['POST','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','forEach',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','catch','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','active','true','userId','adminEmail','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId','],\x20getEndUser\x20crm','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound'];(function(_0x5212d9,_0x24aa66){var _0x1d6930=function(_0xeb7c2d){while(--_0xeb7c2d){_0x5212d9['push'](_0x5212d9['shift']());}};_0x1d6930(++_0x24aa66);}(_0x98b6,0xa9));var _0x698b=function(_0xc3ea,_0x5a4420){_0xc3ea=_0xc3ea-0x0;var _0x47f77e=_0x98b6[_0xc3ea];return _0x47f77e;};'use strict';var _=require(_0x698b('0x0'));var Promise=require(_0x698b('0x1'));var rp=require(_0x698b('0x2'));var util=require(_0x698b('0x3'));var md5=require(_0x698b('0x4'));var Redis=require(_0x698b('0x5'));var intUtil=require('./util');var config=require(_0x698b('0x6'));var logger=require(_0x698b('0x7'))(_0x698b('0x8'));config[_0x698b('0x9')]=_[_0x698b('0xa')](config[_0x698b('0x9')],{'host':_0x698b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x698b('0x9')]));function getAdminUser(_0x363254,_0x4d7b48,_0x4c88a4,_0x51a784,_0x4873b7,_0x3f401e){return new Promise(function(_0x36fc8e,_0x5d8aa1){var _0x4f2760={'method':_0x698b('0xc'),'uri':_0x51a784+_0x698b('0xd')+'&'+_0x4873b7+'&'+_0x3f401e,'auth':_0x4d7b48,'json':!![]};return rp(_0x4f2760)[_0x698b('0xe')](function(_0x5de833){if(_0x5de833[_0x698b('0xf')][_0x698b('0x10')]>0x0){_0x4c88a4[_0x698b('0x11')]=_0x5de833[_0x698b('0xf')][0x0][_0x698b('0x12')];}logger[_0x698b('0x13')]('['+[_0x363254['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x4c88a4);_0x36fc8e(_0x4c88a4);})[_0x698b('0x14')](function(_0x3c470d){logger['error']('['+[_0x363254[_0x698b('0x15')]()]+']',_0x3c470d['message']);_0x5d8aa1(_0x3c470d[_0x698b('0x16')]);});});}function getUser(_0x507079,_0x1cfe94,_0x216609,_0x2d794b,_0x46f4f1){return function(_0x3742cd){logger[_0x698b('0x13')]('['+[_0x507079['toUpperCase']()]+_0x698b('0x17'),_0x3742cd);return new Promise(function(_0x481b57,_0x5e17c5){if(intUtil[_0x698b('0x18')](_0x3742cd[_0x698b('0x19')])){var _0x3d51bf={'method':_0x698b('0xc'),'uri':_0x216609+_0x698b('0x1a')+_0x3742cd[_0x698b('0x19')]+'&'+_0x2d794b+'&'+_0x46f4f1,'auth':_0x1cfe94,'json':!![]};logger[_0x698b('0x13')]('['+[_0x507079['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x3d51bf);return rp(_0x3d51bf)['then'](function(_0x5896cb){logger[_0x698b('0x13')]('['+[_0x507079[_0x698b('0x15')]()]+'],\x20getUser\x20entity',_0x5896cb);if(_0x5896cb[_0x698b('0xf')]['length']>0x0&&String(_0x5896cb['result'][0x0][_0x698b('0x1b')])===_0x698b('0x1c')){_0x3742cd[_0x698b('0x1d')]=_0x5896cb[_0x698b('0xf')][0x0][_0x698b('0x12')];}else{_0x3742cd[_0x698b('0x1d')]=_0x3742cd['adminId'];_0x3742cd[_0x698b('0x19')]=_0x3742cd[_0x698b('0x1e')];}logger[_0x698b('0x13')]('['+[_0x507079[_0x698b('0x15')]()]+'],\x20getUser\x20crm',_0x3742cd);_0x481b57(_0x3742cd);})[_0x698b('0x14')](function(_0x30b0a0){logger[_0x698b('0x1f')]('['+[_0x507079[_0x698b('0x15')]()]+']',_0x30b0a0[_0x698b('0x16')]);_0x5e17c5(_0x30b0a0[_0x698b('0x16')]);});}else{logger[_0x698b('0x13')]('['+[_0x507079['toUpperCase']()]+_0x698b('0x20'));_0x3742cd['userId']=_0x3742cd[_0x698b('0x11')];_0x3742cd[_0x698b('0x19')]=_0x3742cd[_0x698b('0x1e')];_0x481b57(_0x3742cd);}});};}function createEndUser(_0x30012a,_0x443868,_0x221b17,_0x805ca4,_0x5cf5a6){logger[_0x698b('0x13')]('['+[_0x30012a[_0x698b('0x15')]()]+_0x698b('0x21'),_0x221b17);return new Promise(function(_0x15fa1f,_0x9070fb){var _0x3859d9={'method':'POST','uri':_0x805ca4+_0x698b('0x22')+_0x5cf5a6,'body':{'user_name':_0x221b17[_0x698b('0x23')],'roles':_0x698b('0x24'),'first_name':_0x221b17['endUserNumber'],'active':_0x698b('0x1c'),'date_format':_0x698b('0x25'),'phone':_0x221b17[_0x698b('0x23')]},'auth':_0x443868,'json':!![]};return rp(_0x3859d9)[_0x698b('0xe')](function(_0x38269b){logger[_0x698b('0x13')]('['+[_0x30012a[_0x698b('0x15')]()]+_0x698b('0x26'),_0x38269b[_0x698b('0xf')]);_0x221b17['endUserId']=_0x38269b[_0x698b('0xf')][_0x698b('0x12')];_0x15fa1f(_0x221b17);})[_0x698b('0x14')](function(_0x406eed){logger['error']('['+[_0x30012a[_0x698b('0x15')]()]+']',_0x406eed['message']);_0x9070fb(_0x406eed[_0x698b('0x16')]);});});}function getEndUser(_0x521934,_0x11f991,_0x1d55e4,_0x7b7619,_0x2b6483){return function(_0x136d23){logger['info']('['+[_0x521934['toUpperCase']()]+_0x698b('0x27'),_0x136d23);return new Promise(function(_0x53e380,_0x22557c){var _0x3da063={'method':_0x698b('0xc'),'uri':_0x1d55e4+'sys_user?sysparm_query=phone%3D'+_0x136d23[_0x698b('0x23')]+'&'+_0x7b7619+'&'+_0x2b6483,'auth':_0x11f991,'json':!![]};return rp(_0x3da063)['then'](function(_0x23fd24){if(_0x23fd24['result'][_0x698b('0x10')]>0x0){_0x136d23[_0x698b('0x28')]=_0x23fd24['result'][0x0]['sys_id'];logger[_0x698b('0x13')]('['+[_0x521934['toUpperCase']()]+_0x698b('0x29'),_0x136d23);_0x53e380(_0x136d23);}else{return createEndUser(_0x521934,_0x11f991,_0x136d23,_0x1d55e4,_0x7b7619)[_0x698b('0xe')](function(_0x53ded8){logger[_0x698b('0x13')]('['+[_0x521934[_0x698b('0x15')]()]+'],\x20createEndUser\x20crm',_0x53ded8);_0x53e380(_0x53ded8);});}})[_0x698b('0x14')](function(_0x5582c6){logger['error']('['+[_0x521934[_0x698b('0x15')]()]+']',_0x5582c6[_0x698b('0x16')]);_0x22557c(_0x5582c6[_0x698b('0x16')]);});});};}function getCustomFields(_0x59ed57,_0x2ab8f9){var _0x4537e8={};if(_0x59ed57[_0x698b('0x10')]>0x0){_['forEach'](_0x59ed57,function(_0x4a4cb4){if(_[_0x698b('0x2a')]([_0x698b('0x2b'),_0x698b('0x2c')],_0x4a4cb4[_0x698b('0x2d')])&&_0x4a4cb4[_0x698b('0x2e')]&&!_0x4a4cb4['customField']){_0x4537e8[_0x4a4cb4[_0x698b('0x2e')][_0x698b('0x2f')]()]=_0x4a4cb4[_0x698b('0x30')]['toString']();}else if(_[_0x698b('0x2a')](['string',_0x698b('0x2c')],_0x4a4cb4[_0x698b('0x2d')])&&_0x4a4cb4[_0x698b('0x31')]&&_0x4a4cb4[_0x698b('0x32')]){_0x4537e8[_0x4a4cb4[_0x698b('0x31')][_0x698b('0x2f')]()]=_0x4a4cb4['content'][_0x698b('0x33')]();}else if(_0x4a4cb4[_0x698b('0x2d')]===_0x698b('0x34')&&_0x4a4cb4['variableName']&&_0x4a4cb4[_0x698b('0x31')]&&_0x4a4cb4['customField']){_0x4537e8[_0x4a4cb4[_0x698b('0x31')][_0x698b('0x2f')]()]=_0x2ab8f9[_0x4a4cb4[_0x698b('0x35')]][_0x698b('0x33')]();}else if(_0x4a4cb4[_0x698b('0x2d')]===_0x698b('0x36')&&_0x4a4cb4['Variable']&&_0x4a4cb4[_0x698b('0x37')]['name']&&_0x4a4cb4[_0x698b('0x31')]&&_0x4a4cb4['customField']){_0x4537e8[_0x4a4cb4[_0x698b('0x31')][_0x698b('0x2f')]()]=_0x2ab8f9[_0x4a4cb4[_0x698b('0x37')][_0x698b('0x38')][_0x698b('0x2f')]()][_0x698b('0x33')]();}});}return _0x4537e8;}function getTicket(_0x5b06cd,_0x5d99e5,_0xc652f7,_0x1fed63,_0x2941a7,_0x3206ee){return function(_0x5e26e1){logger['info']('['+[_0x5b06cd[_0x698b('0x15')]()]+_0x698b('0x39'),_0x5e26e1);return new Promise(function(_0x5cf6e7,_0x1ca0a1){var _0x23a643=_0x5b06cd[_0x698b('0x2f')]()===_0x698b('0x3a')?_0x5e26e1[_0x698b('0x1d')]:_0x5e26e1['endUserId'];var _0x2a3872={'method':_0x698b('0x3b'),'uri':_0xc652f7+_0x698b('0x3c')+'?'+_0x3206ee,'body':Object[_0x698b('0x3d')]({},{'active':'true','caller_id':_0x23a643,'assigned_to':_0x5e26e1['userId'],'short_description':intUtil[_0x698b('0x3e')](_0x1fed63[_0x698b('0x3f')],_0x2941a7,'\x20'),'description':intUtil[_0x698b('0x3e')](_0x1fed63[_0x698b('0x40')],_0x2941a7,'\x0a')},getCustomFields(_0x1fed63[_0x698b('0x41')],_0x2941a7)),'auth':_0x5d99e5,'json':!![]};return rp(_0x2a3872)[_0x698b('0xe')](function(_0x283bd6){logger[_0x698b('0x13')]('['+[_0x5b06cd[_0x698b('0x15')]()]+_0x698b('0x42'),_0x283bd6[_0x698b('0xf')]);_0x5e26e1['ticketId']=_0x283bd6[_0x698b('0xf')][_0x698b('0x12')];_0x5e26e1['ticketNumber']=_0x283bd6[_0x698b('0xf')][_0x698b('0x43')];logger[_0x698b('0x13')]('['+[_0x5b06cd[_0x698b('0x15')]()]+_0x698b('0x44'),_0x5e26e1);_0x5cf6e7(_0x5e26e1);})[_0x698b('0x14')](function(_0xcbb48f){logger[_0x698b('0x1f')]('['+[_0x5b06cd[_0x698b('0x15')]()]+']',_0xcbb48f['message']);_0x1ca0a1(_0xcbb48f[_0x698b('0x16')]);});});};}function createRemoteTag(_0x1880c7,_0x3ea785,_0x53cd04,_0x2b5be8){return new Promise(function(_0x20ff88,_0x30de69){var _0x5f4c52={'method':_0x698b('0x3b'),'uri':_0x53cd04+_0x698b('0x45')+'?'+_0x2b5be8,'body':{'short_description':_0x1880c7,'global':!![],'active':!![],'name':_0x1880c7},'auth':_0x3ea785,'json':!![]};return rp(_0x5f4c52)[_0x698b('0xe')](function(_0x307603){var _0x594f8c=_0x307603[_0x698b('0xf')][_0x698b('0x12')];_0x20ff88(_0x594f8c);});});}function getRemoteTag(_0x43a1b8,_0x1fc635,_0x48c7e7,_0x31ffbc,_0x5a4512){return new Promise(function(_0x488424,_0x29f6d7){var _0x29fe31={'method':_0x698b('0xc'),'uri':_0x48c7e7+_0x698b('0x45')+'?sysparm_query=name%3D'+_0x43a1b8+'&'+_0x31ffbc,'auth':_0x1fc635,'json':!![]};return rp(_0x29fe31)[_0x698b('0xe')](function(_0x3d84f2){if(_0x3d84f2[_0x698b('0xf')][_0x698b('0x10')]>0x0){var _0x15e2ca=_0x3d84f2[_0x698b('0xf')][0x0]['sys_id'];_0x488424(_0x15e2ca);}else{return createRemoteTag(_0x43a1b8,_0x1fc635,_0x48c7e7,_0x31ffbc)[_0x698b('0xe')](function(_0x5a0ba4){_0x488424(_0x5a0ba4);});}});});}function assignTagToIncident(_0x26966d,_0x37b488,_0xef17f8,_0x12d54a,_0x1a1f3f){return new Promise(function(_0x12716b,_0x4cef23){var _0x467158={'method':_0x698b('0x3b'),'uri':_0xef17f8+_0x698b('0x46')+'?'+_0x1a1f3f,'body':{'label':_0x26966d,'table':_0x698b('0x3c'),'id_type':_0x698b('0x47'),'table_key':_0x12d54a[_0x698b('0x48')],'title':_0x698b('0x49')+_0x12d54a[_0x698b('0x4a')],'id_display':_0x12d54a[_0x698b('0x4a')]},'auth':_0x37b488,'json':!![]};return rp(_0x467158)['then'](function(_0x105c99){_0x12716b();})['catch'](function(){_0x12716b();});});}function manageTags(_0x3ac77b,_0x494038,_0x35d2d5,_0x297504,_0x1ec0cb,_0x18540d,_0x326667){return new Promise(function(_0x17bcce,_0x45c505){var _0x391f27=[];_0x494038[_0x698b('0x4b')](function(_0x5520af){_0x391f27['push'](getRemoteTag(_0x5520af,_0x35d2d5,_0x297504,_0x18540d,_0x326667));});return Promise['all'](_0x391f27)[_0x698b('0xe')](function(_0x47355b){if(_0x47355b[_0x698b('0x10')]){logger[_0x698b('0x13')]('['+[_0x3ac77b[_0x698b('0x15')]()]+_0x698b('0x4c'),_0x47355b);var _0x3b529e=[];_0x47355b[_0x698b('0x4b')](function(_0x3a1539){_0x3b529e[_0x698b('0x4d')](assignTagToIncident(_0x3a1539,_0x35d2d5,_0x297504,_0x1ec0cb,_0x18540d));});return Promise[_0x698b('0x4e')](_0x3b529e)[_0x698b('0xe')](function(){_0x17bcce();})[_0x698b('0x14')](function(){_0x17bcce();});}else{_0x17bcce();}});});}function getTags(_0x4fa34d,_0x592c96,_0x55b305,_0xfcbfe7,_0x432b9b,_0x2fce5c){return function(_0x3331cc){return new Promise(function(_0x342c58,_0x4b655d){var _0x49cd88=[];var _0x4d32b0=_0xfcbfe7[_0x698b('0x4f')];if(_0x4d32b0&&_0x4d32b0[_0x698b('0x10')]>0x0){_0x49cd88=_[_0x698b('0x50')](_0x4d32b0,_0x698b('0x38'));}if(_0x49cd88[_0x698b('0x10')]>0x0){return manageTags(_0x4fa34d,_0x49cd88,_0x592c96,_0x55b305,_0x3331cc,_0x432b9b,_0x2fce5c)[_0x698b('0xe')](function(){_0x342c58(_0x3331cc);});}else{_0x342c58(_0x3331cc);}});};}function emit(_0x16b9d7,_0xc644d2,_0x3c00db){var _0x5d8df3='%26sysparm_record_target%3Dincident'+_0x698b('0x51')+_0x698b('0x52')+'%255EORDERBYDESCnumber';var _0x5f2c26={'uri':_0x16b9d7+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x3c00db+_0x5d8df3};io['to'](util['format'](_0x698b('0x53'),_0xc644d2))[_0x698b('0x54')](_0x698b('0x55'),_0x5f2c26);}exports['cs']=function(_0x10834b,_0x2c4216,_0x1aa10a,_0x4f064e,_0x270d07,_0x21fb21,_0x4076ed,_0x136f45){var _0xe1d005={};var _0x59cf1e={'user':_0x21fb21[_0x698b('0x56')],'pass':_0x21fb21[_0x698b('0x57')]};var _0x95741=_0x698b('0x58');var _0xcefb5b=_0x698b('0x59');_0x21fb21[_0x698b('0x5a')]=intUtil[_0x698b('0x5b')](_0x21fb21[_0x698b('0x5a')]);_0x21fb21['serverUrl']=intUtil['stripTrailingSlash'](_0x21fb21[_0x698b('0x5c')]);var _0x3b7dc1=util[_0x698b('0x5d')](_0x698b('0x5e'),_0x21fb21[_0x698b('0x5a')]);_0xe1d005[_0x698b('0x19')]=!_[_0x698b('0x5f')](_0x4f064e)?_0x4f064e[_0x698b('0x60')]:null;_0xe1d005['adminEmail']=_0x21fb21[_0x698b('0x60')];_0xe1d005[_0x698b('0x23')]=_0x136f45[_0x698b('0x2f')]()===_0x698b('0x3a')?_0x2c4216[_0x698b('0x61')]:_0x2c4216['calleridnum'];_0xe1d005[_0x698b('0x62')]=_0x136f45===_0x698b('0x63')||_0x136f45==='unmanaged'?_0x698b('0x63'):_0x698b('0x3a');var _0x6896d2=util['format'](_0x698b('0x64'),_0x21fb21[_0x698b('0x5c')],_0x2c4216[_0x698b('0x65')],md5(_0x2c4216[_0x698b('0x65')]));if(_0x270d07&&_0x270d07[_0x698b('0x66')]){logger[_0x698b('0x13')](_0x698b('0x67'),_0x698b('0x68'));_0x2c4216[_0x698b('0x69')]=_0x6896d2;}else if(_0x4076ed&&_0x4076ed[_0x698b('0x6a')]&&_0x4076ed[_0x698b('0x6a')]!=='none'){logger[_0x698b('0x13')](_0x698b('0x6b'),'Recording\x20is\x20enabled!');_0x2c4216[_0x698b('0x69')]=_0x6896d2;}else{_0x2c4216[_0x698b('0x69')]='';}return getAdminUser(_0x136f45,_0x59cf1e,_0xe1d005,_0x3b7dc1,_0xcefb5b,_0x95741)[_0x698b('0xe')](getUser(_0x136f45,_0x59cf1e,_0x3b7dc1,_0xcefb5b,_0x95741))[_0x698b('0xe')](getEndUser(_0x136f45,_0x59cf1e,_0x3b7dc1,_0xcefb5b,_0x95741))[_0x698b('0xe')](getTicket(_0x136f45,_0x59cf1e,_0x3b7dc1,_0x1aa10a,_0x2c4216,_0xcefb5b))['then'](function(_0x40443d){logger[_0x698b('0x13')](util[_0x698b('0x5d')](_0x698b('0x6c'),_0x40443d[_0x698b('0x48')]));logger[_0x698b('0x13')](util['format'](_0x698b('0x6d'),_0x136f45));if(_0x136f45!==_0x698b('0x6e')){logger[_0x698b('0x13')]('['+[_0x136f45['toUpperCase']()]+']',_0x698b('0x6f'));emit(_0x21fb21[_0x698b('0x5a')],_0x4f064e[_0x698b('0x38')],_0x40443d[_0x698b('0x48')]);}})[_0x698b('0x14')](function(_0x27b44a){logger['error']('['+[_0x136f45[_0x698b('0x15')]()]+_0x698b('0x70'),util[_0x698b('0x71')](_0x27b44a,{'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 ddfcc22..cdbd388 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 _0x26ed=['login','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','Fields','Inbound','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','getString','Subjects','created_by','description','Descriptions','slice','replace','duration_hours','parent_id','Contacts','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','format','apiKey','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','stringify','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','type','string','nameField','customField','toLowerCase','content','toString','variable','custom_fields','customVariable','Variable'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x26ed,0x117));var _0xd26e=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x26ed[_0x2338fa];return _0x42df9b;};'use strict';var _=require('lodash');var rp=require(_0xd26e('0x0'));var BPromise=require('bluebird');var md5=require(_0xd26e('0x1'));var util=require(_0xd26e('0x2'));var Redis=require(_0xd26e('0x3'));var intUtil=require(_0xd26e('0x4'));var config=require(_0xd26e('0x5'));var logger=require(_0xd26e('0x6'))(_0xd26e('0x7'));config[_0xd26e('0x8')]=_[_0xd26e('0x9')](config[_0xd26e('0x8')],{'host':_0xd26e('0xa'),'port':0x18eb});var io=require(_0xd26e('0xb'))(new Redis(config['redis']));var def={'method':_0xd26e('0xc'),'json':!![]};function emit(_0x2ba376,_0x4576e6,_0x55126d){io['to'](_0x2ba376)['emit'](_0x4576e6,_0x55126d);}function getTicket(_0x26cbd5,_0xe101eb,_0x3258d4,_0x7479bb,_0x1db950,_0x1f5f38,_0x1cb945,_0x5498f5){logger['info'](_0xd26e('0xd'));var _0x4e4e02=new Date();var _0x4d7969=[{'name':'name','value':intUtil[_0xd26e('0xe')](_0x7479bb[_0xd26e('0xf')],_0x1db950,'\x20')},{'name':'assigned_user_id','value':_0xe101eb['id']},{'name':_0xd26e('0x10'),'value':_0xe101eb['id']},{'name':_0xd26e('0x11'),'value':intUtil[_0xd26e('0xe')](_0x7479bb[_0xd26e('0x12')],_0x1db950,'\x0a')},{'name':'date_start','value':_0x4e4e02['toISOString']()[_0xd26e('0x13')](0x0,0x13)[_0xd26e('0x14')]('T','\x20')},{'name':_0xd26e('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xd26e('0x16'),'value':_0x3258d4['id']},{'name':'parent_type','value':_0xd26e('0x17')},{'name':'parent_name','value':_0x3258d4[_0xd26e('0x18')]},{'name':_0xd26e('0x19'),'value':_0x5498f5}];if(_0x1f5f38[_0xd26e('0x1a')]){_[_0xd26e('0x1b')](_0x1f5f38,function(_0x2cf5ff){if(_0x1db950[_0x2cf5ff[_0xd26e('0x1c')]]){_0x4d7969[_0xd26e('0x1d')]({'name':_0x2cf5ff[_0xd26e('0x1e')],'value':_0x1db950[_0x2cf5ff[_0xd26e('0x1c')]]});}});}return request({'form':{'method':_0xd26e('0x1f'),'input_type':_0xd26e('0x20'),'response_type':_0xd26e('0x20'),'rest_data':JSON['stringify']({'session':_0x1cb945['id'],'module_name':_0xd26e('0x21'),'name_value_list':_0x4d7969})}});}function getAuth(_0x560700){return util[_0xd26e('0x22')]('Basic\x20%s',new Buffer(_0x560700[_0xd26e('0x23')]+':X')['toString'](_0xd26e('0x24')));}function getServerInfo(_0x4d75d8){return request({'form':{'method':'get_server_info','input_type':_0xd26e('0x20'),'response_type':_0xd26e('0x20'),'rest_data':JSON['stringify']({'session':_0x4d75d8['id']})}});}function getUser(_0x47db64,_0x4d2768,_0xe7a4db){if(!_[_0xd26e('0x25')](_0x4d2768)){logger[_0xd26e('0x26')](_0xd26e('0x27'),_0x4d2768);return request({'form':{'method':_0xd26e('0x28'),'input_type':'JSON','response_type':_0xd26e('0x20'),'rest_data':JSON[_0xd26e('0x29')]({'session':_0xe7a4db['id'],'module_name':_0xd26e('0x2a'),'query':util[_0xd26e('0x22')](_0xd26e('0x2b'),_0x4d2768),'order_by':'','offset':'0','select_fields':['id',_0xd26e('0x18'),_0xd26e('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1c076a){if(_0x1c076a[_0xd26e('0x2d')][_0xd26e('0x1a')]){var _0x4598b9=_[_0xd26e('0x2e')](_0x1c076a['entry_list'],function(_0x560baa){return _0x560baa['name_value_list']['user_name'][_0xd26e('0x2f')]===_0x4d2768;});if(_0x4598b9){logger['info']('Agent\x20found!');return BPromise[_0xd26e('0x30')]({'id':_0x4598b9[_0xd26e('0x31')]['id']['value'],'name':_0x4598b9[_0xd26e('0x31')][_0xd26e('0x18')][_0xd26e('0x2f')]});}}logger[_0xd26e('0x26')](_0xd26e('0x32'));return BPromise[_0xd26e('0x30')]({'id':_0xe7a4db['name_value_list'][_0xd26e('0x33')][_0xd26e('0x2f')],'name':_0xe7a4db[_0xd26e('0x31')][_0xd26e('0x2c')][_0xd26e('0x2f')]});});}else{logger[_0xd26e('0x26')](_0xd26e('0x34'));return BPromise[_0xd26e('0x30')]({'id':_0xe7a4db[_0xd26e('0x31')][_0xd26e('0x33')][_0xd26e('0x2f')],'name':_0xe7a4db['name_value_list'][_0xd26e('0x2c')][_0xd26e('0x2f')]});}}function getEndUser(_0x1efaec,_0x21b1a5,_0x4ebc70,_0x3298f0){logger[_0xd26e('0x26')]('Searching\x20enduser\x20with\x20phone',_0x4ebc70);return request({'form':{'method':_0xd26e('0x28'),'input_type':_0xd26e('0x20'),'response_type':_0xd26e('0x20'),'rest_data':JSON[_0xd26e('0x29')]({'session':_0x3298f0['id'],'module_name':'Contacts','query':util[_0xd26e('0x22')](_0xd26e('0x35'),_0x4ebc70),'order_by':'','offset':'0','select_fields':['id',_0xd26e('0x18'),_0xd26e('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd26e('0x37')](function(_0x2bb4bd){if(_0x2bb4bd['entry_list'][_0xd26e('0x1a')]){var _0x4553f8=_[_0xd26e('0x2e')](_0x2bb4bd[_0xd26e('0x2d')],function(_0x53e4c6){return _0x53e4c6['name_value_list'][_0xd26e('0x36')]['value']===_0x4ebc70;});if(_0x4553f8){logger[_0xd26e('0x26')](_0xd26e('0x38'));return BPromise[_0xd26e('0x30')]({'id':_0x4553f8[_0xd26e('0x31')]['id'][_0xd26e('0x2f')],'name':_0x4553f8[_0xd26e('0x31')][_0xd26e('0x18')][_0xd26e('0x2f')],'phone':_0x4553f8[_0xd26e('0x31')][_0xd26e('0x36')][_0xd26e('0x2f')]});}}else{logger[_0xd26e('0x26')](_0xd26e('0x39'));return request({'form':{'method':'set_entry','input_type':_0xd26e('0x20'),'response_type':_0xd26e('0x20'),'rest_data':JSON[_0xd26e('0x29')]({'session':_0x3298f0['id'],'module_name':_0xd26e('0x17'),'name_value_list':[{'name':_0xd26e('0x3a'),'value':_0x21b1a5!==_0xd26e('0x3b')?_0x21b1a5:util['format'](_0xd26e('0x3c'),_0x4ebc70)},{'name':_0xd26e('0x36'),'value':_0x4ebc70}]})}})[_0xd26e('0x37')](function(_0xbc2c5d){logger['info'](_0xd26e('0x3d'));return BPromise['resolve']({'id':_0xbc2c5d['id'],'name':_0xbc2c5d['entry_list'][_0xd26e('0x3a')]['value'],'phone':_0xbc2c5d['entry_list'][_0xd26e('0x36')][_0xd26e('0x2f')]});});}});}function request(_0x2c8ad2){logger[_0xd26e('0x3e')](_0xd26e('0x3f'),JSON[_0xd26e('0x29')](_0x2c8ad2));return rp(_['merge'](def,_0x2c8ad2));}function getTags(_0x87134d,_0x25f0be){var _0xdb7b75=[];if(_0x87134d&&_0x87134d['length']>0x0){_0xdb7b75=_['map'](_0x87134d,_0x25f0be);}return _0xdb7b75;}function getCustomFields(_0x17daaa,_0x190113){var _0x545473=[];var _0x467eaa={'custom_fields':[]};if(_0x17daaa[_0xd26e('0x1a')]>0x0){_[_0xd26e('0x1b')](_0x17daaa,function(_0x4db7f2){if(_0x4db7f2[_0xd26e('0x40')]===_0xd26e('0x41')&&_0x4db7f2[_0xd26e('0x42')]&&!_0x4db7f2[_0xd26e('0x43')]){_0x467eaa[_0x4db7f2['nameField'][_0xd26e('0x44')]()]=_0x4db7f2[_0xd26e('0x45')][_0xd26e('0x46')]();}else if(_0x4db7f2['type']===_0xd26e('0x41')&&_0x4db7f2[_0xd26e('0x1e')]&&_0x4db7f2[_0xd26e('0x43')]){_0x467eaa['custom_fields']['push']({'id':_0x4db7f2[_0xd26e('0x1e')],'value':_0x4db7f2['content'][_0xd26e('0x46')]()});}else if(_0x4db7f2['type']===_0xd26e('0x47')&&_0x4db7f2[_0xd26e('0x1c')]&&_0x4db7f2[_0xd26e('0x1e')]&&_0x4db7f2['customField']){_0x190113[_0x4db7f2['variableName']]&&_0x467eaa[_0xd26e('0x48')][_0xd26e('0x1d')]({'id':_0x4db7f2[_0xd26e('0x1e')],'value':_0x190113[_0x4db7f2[_0xd26e('0x1c')]]['toString']()});}else if(_0x4db7f2['type']===_0xd26e('0x49')&&_0x4db7f2[_0xd26e('0x4a')]&&_0x4db7f2[_0xd26e('0x4a')]['name']&&_0x4db7f2[_0xd26e('0x1e')]&&_0x4db7f2[_0xd26e('0x43')]){_0x190113[_0x4db7f2[_0xd26e('0x4a')]['name'][_0xd26e('0x44')]()]&&_0x467eaa[_0xd26e('0x48')]['push']({'id':_0x4db7f2[_0xd26e('0x1e')],'value':_0x190113[_0x4db7f2[_0xd26e('0x4a')][_0xd26e('0x18')][_0xd26e('0x44')]()][_0xd26e('0x46')]()});}});}return _0x467eaa;}function getConnection(_0x481a8e){return request({'method':_0xd26e('0xc'),'form':{'method':_0xd26e('0x4b'),'input_type':_0xd26e('0x20'),'response_type':_0xd26e('0x20'),'rest_data':JSON[_0xd26e('0x29')]({'user_auth':{'user_name':_0x481a8e['username'],'password':_0x481a8e[_0xd26e('0x4c')],'encryption':'PLAIN'},'application':_0xd26e('0x4d')})}})['then'](function(_0x2514ae){var _0x234ff9=_0x2514ae;if(_0x234ff9['id']){def[_0xd26e('0x4e')]=_0x234ff9['id'];return BPromise[_0xd26e('0x30')](_0x234ff9);}else{throw new Error(util[_0xd26e('0x22')](_0xd26e('0x4f'),_0x481a8e['id']));}});}function setRelationship(_0x17f7e7,_0x2653bf,_0x90019e,_0x5227cc){return request({'form':{'method':_0xd26e('0x50'),'input_type':_0xd26e('0x20'),'response_type':_0xd26e('0x20'),'rest_data':JSON['stringify']({'session':_0x17f7e7['id'],'module_name':_0xd26e('0x21'),'module_id':_0x90019e['id'],'link_field_name':_0x5227cc,'related_ids':[_0x2653bf['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xd26e('0x51')]=function(_0x123dc9,_0x3141b6,_0x457ae0,_0x1da000,_0xd996cd,_0x39c008){var _0x428f98,_0x122ae2,_0x42d0d6,_0x318fa9;_0x39c008[_0xd26e('0x52')]=intUtil['stripTrailingSlash'](_0x39c008['remoteUri']);_0x39c008[_0xd26e('0x53')]=intUtil[_0xd26e('0x54')](_0x39c008[_0xd26e('0x53')]);def[_0xd26e('0x55')]=util['format']('%s/service/v4_1/rest.php',_0x39c008[_0xd26e('0x52')]);if(_0xd996cd&&_0xd996cd[_0xd26e('0x56')]){logger[_0xd26e('0x26')](_0xd26e('0x57'),_0xd26e('0x58'));_0x3141b6['recordingURL']=util[_0xd26e('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39c008[_0xd26e('0x53')],_0x3141b6[_0xd26e('0x59')],md5(_0x3141b6['uniqueid']));}else{_0x3141b6[_0xd26e('0x5a')]='';}return getConnection(_0x39c008)[_0xd26e('0x37')](function(_0x34c1e9){_0x318fa9=_0x34c1e9;return getUser(_0x39c008,_0x1da000['name'],_0x318fa9);})['then'](function(_0x161739){_0x428f98=_0x161739;logger[_0xd26e('0x26')](_0xd26e('0x5b'),_0x428f98['id']);return getEndUser(_0x39c008,_0x3141b6['calleridname'],_0x3141b6['calleridnum'],_0x318fa9);})[_0xd26e('0x37')](function(_0x305c7e){_0x122ae2=_0x305c7e;logger[_0xd26e('0x26')]('The\x20Enduser\x20ID\x20is:',_0x122ae2['id']);return getTicket(_0x39c008,_0x428f98,_0x122ae2,_0x457ae0,_0x3141b6,_0x457ae0[_0xd26e('0x5c')],_0x318fa9,_0xd26e('0x5d'));})[_0xd26e('0x37')](function(_0x17b506){_0x42d0d6=_0x17b506;logger[_0xd26e('0x26')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x42d0d6['id']);return setRelationship(_0x318fa9,_0x428f98,_0x42d0d6,_0xd26e('0x5e'));})[_0xd26e('0x37')](function(){return setRelationship(_0x318fa9,_0x122ae2,_0x42d0d6,_0xd26e('0x5f'));})[_0xd26e('0x37')](function(){return getServerInfo(_0x318fa9);})[_0xd26e('0x37')](function(_0x1a4657){var _0xe21bc6=parseInt(_0x1a4657['version'][_0xd26e('0x60')](0x0));var _0x30226d=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x39c008['remoteUri'],_0x42d0d6['id']);if(_0xe21bc6>0x6){_0x30226d=util[_0xd26e('0x22')](_0xd26e('0x61'),_0x39c008[_0xd26e('0x52')],_0x42d0d6['id']);}logger['info'](_0xd26e('0x57'),_0xd26e('0x62'));emit(util[_0xd26e('0x22')](_0xd26e('0x63'),_0x1da000[_0xd26e('0x18')]),_0xd26e('0x64'),{'uri':_0x30226d});})[_0xd26e('0x65')](function(_0x2d277e){logger[_0xd26e('0x66')]('[QUEUE]',JSON[_0xd26e('0x29')](_0x2d277e));});};exports['outbound']=function(_0x1c7bf2,_0x4f7edd,_0x2ea72e,_0x4d4f8e,_0x206937,_0xe57882,_0x58a5c0){var _0x2a261f,_0xd22c50,_0x3a030,_0x4acfbb;_0xe57882[_0xd26e('0x52')]=intUtil[_0xd26e('0x54')](_0xe57882[_0xd26e('0x52')]);_0xe57882[_0xd26e('0x53')]=intUtil[_0xd26e('0x54')](_0xe57882['serverUrl']);def[_0xd26e('0x55')]=util['format']('%s/service/v4_1/rest.php',_0xe57882[_0xd26e('0x52')]);if(_0x58a5c0&&_0x58a5c0[_0xd26e('0x67')]&&_0x58a5c0['recordingFormat']!==_0xd26e('0x68')){logger[_0xd26e('0x26')](_0xd26e('0x69'),_0xd26e('0x58'));_0x4f7edd[_0xd26e('0x5a')]=util['format'](_0xd26e('0x6a'),_0xe57882['serverUrl'],_0x4f7edd['uniqueid'],md5(_0x4f7edd[_0xd26e('0x59')]));}return getConnection(_0xe57882)['then'](function(_0x9524cc){_0x4acfbb=_0x9524cc;return getUser(_0xe57882,_0x4d4f8e[_0xd26e('0x18')],_0x4acfbb);})[_0xd26e('0x37')](function(_0x41f29c){_0x2a261f=_0x41f29c;logger['info'](_0xd26e('0x5b'),_0x2a261f['id']);return getEndUser(_0xe57882,_0x4f7edd[_0xd26e('0x6b')],_0x4f7edd[_0xd26e('0x6c')],_0x4acfbb);})[_0xd26e('0x37')](function(_0x5652c7){_0xd22c50=_0x5652c7;logger[_0xd26e('0x26')]('The\x20Enduser\x20ID\x20is:',_0xd22c50['id']);return getTicket(_0xe57882,_0x2a261f,_0xd22c50,_0x2ea72e,_0x4f7edd,_0x2ea72e[_0xd26e('0x5c')],_0x4acfbb,_0xd26e('0x6d'));})[_0xd26e('0x37')](function(_0x5b14ab){_0x3a030=_0x5b14ab;logger[_0xd26e('0x26')]('Ticket\x20created!');logger[_0xd26e('0x26')]('The\x20Ticket\x20ID\x20is:',_0x3a030['id']);return setRelationship(_0x4acfbb,_0x2a261f,_0x3a030,_0xd26e('0x5e'));})[_0xd26e('0x37')](function(){return setRelationship(_0x4acfbb,_0xd22c50,_0x3a030,'contacts');})['then'](function(){return getServerInfo(_0x4acfbb);})[_0xd26e('0x37')](function(_0xba2f98){var _0x1f3a64=parseInt(_0xba2f98['version']['charAt'](0x0));var _0xd819f0=util[_0xd26e('0x22')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xe57882['remoteUri'],_0x3a030['id']);if(_0x1f3a64>0x6){_0xd819f0=util[_0xd26e('0x22')](_0xd26e('0x61'),_0xe57882[_0xd26e('0x52')],_0x3a030['id']);}logger['info'](_0xd26e('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd26e('0x22')](_0xd26e('0x63'),_0x4d4f8e[_0xd26e('0x18')]),_0xd26e('0x64'),{'uri':_0xd819f0});})[_0xd26e('0x65')](function(_0x445639){logger[_0xd26e('0x66')](_0xd26e('0x69'),JSON[_0xd26e('0x29')](_0x445639));});};exports[_0xd26e('0x6e')]=function(_0x43dca9,_0x48f756,_0x241182,_0x32c3a1,_0xacf2b8,_0x3c8191){var _0x283bae,_0x255839,_0x1b6250,_0x2f4862;_0x3c8191[_0xd26e('0x52')]=intUtil[_0xd26e('0x54')](_0x3c8191['remoteUri']);_0x3c8191[_0xd26e('0x53')]=intUtil['stripTrailingSlash'](_0x3c8191[_0xd26e('0x53')]);def[_0xd26e('0x55')]=util[_0xd26e('0x22')]('%s/service/v4_1/rest.php',_0x3c8191['remoteUri']);if(_0xacf2b8&&_0xacf2b8[_0xd26e('0x56')]){logger[_0xd26e('0x26')]('['+_0x48f756[_0xd26e('0x6f')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x48f756['recordingURL']=util['format'](_0xd26e('0x6a'),_0x3c8191[_0xd26e('0x53')],_0x48f756[_0xd26e('0x59')],md5(_0x48f756[_0xd26e('0x59')]));}else{_0x48f756[_0xd26e('0x5a')]='';}return getConnection(_0x3c8191)[_0xd26e('0x37')](function(_0x3ae4ff){_0x2f4862=_0x3ae4ff;if(!_[_0xd26e('0x25')](_0x32c3a1)){return getUser(_0x3c8191,_0x32c3a1[_0xd26e('0x18')],_0x2f4862);}else{return getUser(_0x3c8191,null,_0x2f4862);}})['then'](function(_0x1b0e18){_0x283bae=_0x1b0e18;logger[_0xd26e('0x26')](_0xd26e('0x5b'),_0x283bae['id']);return getEndUser(_0x3c8191,_0x48f756[_0xd26e('0x70')],_0x48f756[_0xd26e('0x71')],_0x2f4862);})[_0xd26e('0x37')](function(_0x7b6867){_0x255839=_0x7b6867;logger[_0xd26e('0x26')](_0xd26e('0x72'),_0x255839['id']);return getTicket(_0x3c8191,_0x283bae,_0x255839,_0x241182,_0x48f756,_0x241182[_0xd26e('0x5c')],_0x2f4862,'Inbound');})['then'](function(_0x2a3ba4){_0x1b6250=_0x2a3ba4;logger[_0xd26e('0x26')](_0xd26e('0x73'));logger[_0xd26e('0x26')](_0xd26e('0x74'),_0x1b6250['id']);return setRelationship(_0x2f4862,_0x283bae,_0x1b6250,_0xd26e('0x5e'));})[_0xd26e('0x37')](function(){return setRelationship(_0x2f4862,_0x255839,_0x1b6250,_0xd26e('0x5f'));})[_0xd26e('0x37')](function(){return getServerInfo(_0x2f4862);})[_0xd26e('0x65')](function(_0x31abb5){logger['error']('['+_0x48f756[_0xd26e('0x6f')][_0xd26e('0x75')]()+']',JSON[_0xd26e('0x29')](_0x31abb5));});}; \ No newline at end of file +var _0x8633=['bluebird','md5','util','ioredis','../../../../config/logger','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','nameField','customField','toLowerCase','content','type','string','custom_fields','Variable','username','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','%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','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Fields','users','version','charAt','unmanaged','toUpperCase','lastevent','lodash','request-promise'];(function(_0x680c2f,_0x100b57){var _0x2dc9e4=function(_0x34c8ec){while(--_0x34c8ec){_0x680c2f['push'](_0x680c2f['shift']());}};_0x2dc9e4(++_0x100b57);}(_0x8633,0x77));var _0x3863=function(_0x27ba8a,_0x367a9c){_0x27ba8a=_0x27ba8a-0x0;var _0x56c89a=_0x8633[_0x27ba8a];return _0x56c89a;};'use strict';var _=require(_0x3863('0x0'));var rp=require(_0x3863('0x1'));var BPromise=require(_0x3863('0x2'));var md5=require(_0x3863('0x3'));var util=require(_0x3863('0x4'));var Redis=require(_0x3863('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3863('0x6'))('sugarcrm');config['redis']=_['defaults'](config[_0x3863('0x7')],{'host':_0x3863('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x3863('0x9'),'json':!![]};function emit(_0x20377a,_0x3cd056,_0x55d3dd){io['to'](_0x20377a)[_0x3863('0xa')](_0x3cd056,_0x55d3dd);}function getTicket(_0x34d8b1,_0x4cc0b1,_0x5c36ad,_0x142ca4,_0x45a450,_0x2a7ad3,_0x1cf5bf,_0x2b8bde){logger[_0x3863('0xb')](_0x3863('0xc'));var _0x17e50a=new Date();var _0x3dcc58=[{'name':_0x3863('0xd'),'value':intUtil[_0x3863('0xe')](_0x142ca4[_0x3863('0xf')],_0x45a450,'\x20')},{'name':_0x3863('0x10'),'value':_0x4cc0b1['id']},{'name':_0x3863('0x11'),'value':_0x4cc0b1['id']},{'name':_0x3863('0x12'),'value':intUtil[_0x3863('0xe')](_0x142ca4[_0x3863('0x13')],_0x45a450,'\x0a')},{'name':'date_start','value':_0x17e50a[_0x3863('0x14')]()[_0x3863('0x15')](0x0,0x13)[_0x3863('0x16')]('T','\x20')},{'name':_0x3863('0x17'),'value':'0'},{'name':_0x3863('0x18'),'value':'15'},{'name':_0x3863('0x19'),'value':_0x5c36ad['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x3863('0x1a'),'value':_0x5c36ad[_0x3863('0xd')]},{'name':_0x3863('0x1b'),'value':_0x2b8bde}];if(_0x2a7ad3[_0x3863('0x1c')]){_[_0x3863('0x1d')](_0x2a7ad3,function(_0x3059fe){if(_0x45a450[_0x3059fe[_0x3863('0x1e')]]){_0x3dcc58[_0x3863('0x1f')]({'name':_0x3059fe[_0x3863('0x20')],'value':_0x45a450[_0x3059fe['variableName']]});}});}return request({'form':{'method':_0x3863('0x21'),'input_type':_0x3863('0x22'),'response_type':_0x3863('0x22'),'rest_data':JSON['stringify']({'session':_0x1cf5bf['id'],'module_name':'Calls','name_value_list':_0x3dcc58})}});}function getAuth(_0x37409c){return util[_0x3863('0x23')](_0x3863('0x24'),new Buffer(_0x37409c[_0x3863('0x25')]+':X')[_0x3863('0x26')](_0x3863('0x27')));}function getServerInfo(_0x1ecc8d){return request({'form':{'method':_0x3863('0x28'),'input_type':_0x3863('0x22'),'response_type':_0x3863('0x22'),'rest_data':JSON[_0x3863('0x29')]({'session':_0x1ecc8d['id']})}});}function getUser(_0x25cc60,_0x26f662,_0xd0037b){if(!_[_0x3863('0x2a')](_0x26f662)){logger[_0x3863('0xb')]('Getting\x20agent\x20with\x20name',_0x26f662);return request({'form':{'method':_0x3863('0x2b'),'input_type':'JSON','response_type':_0x3863('0x22'),'rest_data':JSON[_0x3863('0x29')]({'session':_0xd0037b['id'],'module_name':_0x3863('0x2c'),'query':util[_0x3863('0x23')](_0x3863('0x2d'),_0x26f662),'order_by':'','offset':'0','select_fields':['id',_0x3863('0xd'),_0x3863('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3863('0x2f')](function(_0x24e355){if(_0x24e355[_0x3863('0x30')][_0x3863('0x1c')]){var _0x353602=_['find'](_0x24e355[_0x3863('0x30')],function(_0x4d74f8){return _0x4d74f8['name_value_list'][_0x3863('0x2e')][_0x3863('0x31')]===_0x26f662;});if(_0x353602){logger[_0x3863('0xb')](_0x3863('0x32'));return BPromise[_0x3863('0x33')]({'id':_0x353602['name_value_list']['id']['value'],'name':_0x353602['name_value_list'][_0x3863('0xd')][_0x3863('0x31')]});}}logger[_0x3863('0xb')](_0x3863('0x34'));return BPromise[_0x3863('0x33')]({'id':_0xd0037b[_0x3863('0x35')]['user_id']['value'],'name':_0xd0037b[_0x3863('0x35')][_0x3863('0x2e')][_0x3863('0x31')]});});}else{logger['info'](_0x3863('0x36'));return BPromise['resolve']({'id':_0xd0037b[_0x3863('0x35')][_0x3863('0x37')][_0x3863('0x31')],'name':_0xd0037b[_0x3863('0x35')][_0x3863('0x2e')][_0x3863('0x31')]});}}function getEndUser(_0x45dbde,_0x284d2d,_0x593656,_0x172f22){logger[_0x3863('0xb')]('Searching\x20enduser\x20with\x20phone',_0x593656);return request({'form':{'method':_0x3863('0x2b'),'input_type':_0x3863('0x22'),'response_type':_0x3863('0x22'),'rest_data':JSON[_0x3863('0x29')]({'session':_0x172f22['id'],'module_name':_0x3863('0x38'),'query':util[_0x3863('0x23')](_0x3863('0x39'),_0x593656),'order_by':'','offset':'0','select_fields':['id',_0x3863('0xd'),_0x3863('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3863('0x2f')](function(_0x14a601){if(_0x14a601[_0x3863('0x30')][_0x3863('0x1c')]){var _0x4d0054=_[_0x3863('0x3b')](_0x14a601[_0x3863('0x30')],function(_0x18df08){return _0x18df08['name_value_list'][_0x3863('0x3a')][_0x3863('0x31')]===_0x593656;});if(_0x4d0054){logger[_0x3863('0xb')](_0x3863('0x3c'));return BPromise[_0x3863('0x33')]({'id':_0x4d0054[_0x3863('0x35')]['id']['value'],'name':_0x4d0054[_0x3863('0x35')][_0x3863('0xd')][_0x3863('0x31')],'phone':_0x4d0054[_0x3863('0x35')]['phone_home'][_0x3863('0x31')]});}}else{logger[_0x3863('0xb')](_0x3863('0x3d'));return request({'form':{'method':_0x3863('0x21'),'input_type':_0x3863('0x22'),'response_type':_0x3863('0x22'),'rest_data':JSON['stringify']({'session':_0x172f22['id'],'module_name':_0x3863('0x38'),'name_value_list':[{'name':_0x3863('0x3e'),'value':_0x284d2d!==''?_0x284d2d:util[_0x3863('0x23')](_0x3863('0x3f'),_0x593656)},{'name':'phone_home','value':_0x593656}]})}})[_0x3863('0x2f')](function(_0x25deb){logger['info'](_0x3863('0x40'));return BPromise['resolve']({'id':_0x25deb['id'],'name':_0x25deb['entry_list'][_0x3863('0x3e')][_0x3863('0x31')],'phone':_0x25deb['entry_list'][_0x3863('0x3a')][_0x3863('0x31')]});});}});}function request(_0x2572ff){logger[_0x3863('0x41')](_0x3863('0x42'),JSON[_0x3863('0x29')](_0x2572ff));return rp(_[_0x3863('0x43')](def,_0x2572ff));}function getTags(_0x2e8e8f,_0xa0e1ea){var _0x21ef96=[];if(_0x2e8e8f&&_0x2e8e8f['length']>0x0){_0x21ef96=_[_0x3863('0x44')](_0x2e8e8f,_0xa0e1ea);}return _0x21ef96;}function getCustomFields(_0x44bb9c,_0x527084){var _0x568993=[];var _0x23e4d0={'custom_fields':[]};if(_0x44bb9c['length']>0x0){_['forEach'](_0x44bb9c,function(_0x983943){if(_0x983943['type']==='string'&&_0x983943[_0x3863('0x45')]&&!_0x983943[_0x3863('0x46')]){_0x23e4d0[_0x983943['nameField'][_0x3863('0x47')]()]=_0x983943[_0x3863('0x48')]['toString']();}else if(_0x983943[_0x3863('0x49')]===_0x3863('0x4a')&&_0x983943[_0x3863('0x20')]&&_0x983943[_0x3863('0x46')]){_0x23e4d0[_0x3863('0x4b')][_0x3863('0x1f')]({'id':_0x983943[_0x3863('0x20')],'value':_0x983943[_0x3863('0x48')][_0x3863('0x26')]()});}else if(_0x983943['type']==='variable'&&_0x983943[_0x3863('0x1e')]&&_0x983943['idField']&&_0x983943['customField']){_0x527084[_0x983943['variableName']]&&_0x23e4d0['custom_fields']['push']({'id':_0x983943[_0x3863('0x20')],'value':_0x527084[_0x983943['variableName']][_0x3863('0x26')]()});}else if(_0x983943[_0x3863('0x49')]==='customVariable'&&_0x983943['Variable']&&_0x983943['Variable']['name']&&_0x983943['idField']&&_0x983943['customField']){_0x527084[_0x983943['Variable'][_0x3863('0xd')]['toLowerCase']()]&&_0x23e4d0[_0x3863('0x4b')][_0x3863('0x1f')]({'id':_0x983943['idField'],'value':_0x527084[_0x983943[_0x3863('0x4c')][_0x3863('0xd')]['toLowerCase']()]['toString']()});}});}return _0x23e4d0;}function getConnection(_0x5d6739){return request({'method':_0x3863('0x9'),'form':{'method':'login','input_type':'JSON','response_type':_0x3863('0x22'),'rest_data':JSON[_0x3863('0x29')]({'user_auth':{'user_name':_0x5d6739[_0x3863('0x4d')],'password':_0x5d6739['password'],'encryption':'PLAIN'},'application':_0x3863('0x4e')})}})[_0x3863('0x2f')](function(_0x36f3bd){var _0x313cdb=_0x36f3bd;if(_0x313cdb['id']){def[_0x3863('0x4f')]=_0x313cdb['id'];return BPromise[_0x3863('0x33')](_0x313cdb);}else{throw new Error(util[_0x3863('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x5d6739['id']));}});}function setRelationship(_0x4e6009,_0x42ec8b,_0x5b1a3b,_0x37c83c){return request({'form':{'method':_0x3863('0x50'),'input_type':_0x3863('0x22'),'response_type':'JSON','rest_data':JSON[_0x3863('0x29')]({'session':_0x4e6009['id'],'module_name':_0x3863('0x51'),'module_id':_0x5b1a3b['id'],'link_field_name':_0x37c83c,'related_ids':[_0x42ec8b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3863('0x52')]=function(_0x3b2cad,_0x9c5599,_0x1ba6b0,_0x6c1d88,_0x2641ce,_0xe2e674){var _0x3ec57e,_0x544b31,_0x5d2140,_0x306786;_0xe2e674[_0x3863('0x53')]=intUtil[_0x3863('0x54')](_0xe2e674[_0x3863('0x53')]);_0xe2e674[_0x3863('0x55')]=intUtil[_0x3863('0x54')](_0xe2e674[_0x3863('0x55')]);def[_0x3863('0x56')]=util[_0x3863('0x23')](_0x3863('0x57'),_0xe2e674[_0x3863('0x53')]);if(_0x2641ce&&_0x2641ce[_0x3863('0x58')]){logger[_0x3863('0xb')]('[QUEUE]',_0x3863('0x59'));_0x9c5599[_0x3863('0x5a')]=util[_0x3863('0x23')](_0x3863('0x5b'),_0xe2e674['serverUrl'],_0x9c5599['uniqueid'],md5(_0x9c5599['uniqueid']));}else{_0x9c5599['recordingURL']='';}return getConnection(_0xe2e674)['then'](function(_0x404404){_0x306786=_0x404404;return getUser(_0xe2e674,_0x6c1d88[_0x3863('0xd')],_0x306786);})[_0x3863('0x2f')](function(_0x5b052b){_0x3ec57e=_0x5b052b;logger[_0x3863('0xb')](_0x3863('0x5c'),_0x3ec57e['id']);return getEndUser(_0xe2e674,_0x9c5599[_0x3863('0x5d')],_0x9c5599[_0x3863('0x5e')],_0x306786);})[_0x3863('0x2f')](function(_0x23790f){_0x544b31=_0x23790f;logger[_0x3863('0xb')](_0x3863('0x5f'),_0x544b31['id']);return getTicket(_0xe2e674,_0x3ec57e,_0x544b31,_0x1ba6b0,_0x9c5599,_0x1ba6b0['Fields'],_0x306786,_0x3863('0x60'));})['then'](function(_0x34571d){_0x5d2140=_0x34571d;logger['info'](_0x3863('0x61'));logger['info'](_0x3863('0x62'),_0x5d2140['id']);return setRelationship(_0x306786,_0x3ec57e,_0x5d2140,'users');})[_0x3863('0x2f')](function(){return setRelationship(_0x306786,_0x544b31,_0x5d2140,_0x3863('0x63'));})['then'](function(){return getServerInfo(_0x306786);})[_0x3863('0x2f')](function(_0x322a89){var _0x233df5=parseInt(_0x322a89['version']['charAt'](0x0));var _0x3f7e17=util[_0x3863('0x23')](_0x3863('0x64'),_0xe2e674[_0x3863('0x53')],_0x5d2140['id']);if(_0x233df5>0x6){_0x3f7e17=util['format'](_0x3863('0x65'),_0xe2e674[_0x3863('0x53')],_0x5d2140['id']);}logger[_0x3863('0xb')](_0x3863('0x66'),_0x3863('0x67'));emit(util[_0x3863('0x23')](_0x3863('0x68'),_0x6c1d88[_0x3863('0xd')]),_0x3863('0x69'),{'uri':_0x3f7e17});})[_0x3863('0x6a')](function(_0xebe194){logger[_0x3863('0x6b')]('[QUEUE]',JSON['stringify'](_0xebe194));});};exports[_0x3863('0x6c')]=function(_0x16a1e5,_0x2a7dcd,_0x174dc7,_0x563dbd,_0x3198e4,_0x4483a0,_0x74a642){var _0xf3404c,_0x10a399,_0x1e8b51,_0x375f43;_0x4483a0[_0x3863('0x53')]=intUtil[_0x3863('0x54')](_0x4483a0['remoteUri']);_0x4483a0[_0x3863('0x55')]=intUtil['stripTrailingSlash'](_0x4483a0[_0x3863('0x55')]);def[_0x3863('0x56')]=util[_0x3863('0x23')](_0x3863('0x57'),_0x4483a0['remoteUri']);if(_0x74a642&&_0x74a642[_0x3863('0x6d')]&&_0x74a642[_0x3863('0x6d')]!==_0x3863('0x6e')){logger[_0x3863('0xb')](_0x3863('0x6f'),'Recording\x20is\x20enabled!');_0x2a7dcd[_0x3863('0x5a')]=util[_0x3863('0x23')](_0x3863('0x5b'),_0x4483a0['serverUrl'],_0x2a7dcd[_0x3863('0x70')],md5(_0x2a7dcd['uniqueid']));}return getConnection(_0x4483a0)[_0x3863('0x2f')](function(_0x4ff501){_0x375f43=_0x4ff501;return getUser(_0x4483a0,_0x563dbd['name'],_0x375f43);})[_0x3863('0x2f')](function(_0x3473d3){_0xf3404c=_0x3473d3;logger[_0x3863('0xb')](_0x3863('0x5c'),_0xf3404c['id']);return getEndUser(_0x4483a0,_0x2a7dcd[_0x3863('0x71')],_0x2a7dcd['destcalleridnum'],_0x375f43);})[_0x3863('0x2f')](function(_0x5bdcd4){_0x10a399=_0x5bdcd4;logger['info'](_0x3863('0x5f'),_0x10a399['id']);return getTicket(_0x4483a0,_0xf3404c,_0x10a399,_0x174dc7,_0x2a7dcd,_0x174dc7[_0x3863('0x72')],_0x375f43,'Outbound');})[_0x3863('0x2f')](function(_0x325817){_0x1e8b51=_0x325817;logger[_0x3863('0xb')](_0x3863('0x61'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1e8b51['id']);return setRelationship(_0x375f43,_0xf3404c,_0x1e8b51,_0x3863('0x73'));})[_0x3863('0x2f')](function(){return setRelationship(_0x375f43,_0x10a399,_0x1e8b51,_0x3863('0x63'));})[_0x3863('0x2f')](function(){return getServerInfo(_0x375f43);})[_0x3863('0x2f')](function(_0xb1e981){var _0x207875=parseInt(_0xb1e981[_0x3863('0x74')][_0x3863('0x75')](0x0));var _0x2b98f7=util[_0x3863('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4483a0[_0x3863('0x53')],_0x1e8b51['id']);if(_0x207875>0x6){_0x2b98f7=util[_0x3863('0x23')](_0x3863('0x65'),_0x4483a0[_0x3863('0x53')],_0x1e8b51['id']);}logger[_0x3863('0xb')](_0x3863('0x6f'),_0x3863('0x67'));emit(util[_0x3863('0x23')](_0x3863('0x68'),_0x563dbd[_0x3863('0xd')]),'trigger:browser:url',{'uri':_0x2b98f7});})[_0x3863('0x6a')](function(_0x589956){logger[_0x3863('0x6b')]('[OUTBOUND]',JSON[_0x3863('0x29')](_0x589956));});};exports[_0x3863('0x76')]=function(_0x374aa1,_0x1ee1f7,_0x4c5d5d,_0x5509fd,_0x306b51,_0x5b4aeb){var _0x12600d,_0x5c31c8,_0x53c661,_0x16d329;_0x5b4aeb[_0x3863('0x53')]=intUtil[_0x3863('0x54')](_0x5b4aeb[_0x3863('0x53')]);_0x5b4aeb[_0x3863('0x55')]=intUtil[_0x3863('0x54')](_0x5b4aeb[_0x3863('0x55')]);def[_0x3863('0x56')]=util[_0x3863('0x23')](_0x3863('0x57'),_0x5b4aeb[_0x3863('0x53')]);if(_0x306b51&&_0x306b51[_0x3863('0x58')]){logger[_0x3863('0xb')]('['+_0x1ee1f7['lastevent'][_0x3863('0x77')]()+']',_0x3863('0x59'));_0x1ee1f7[_0x3863('0x5a')]=util[_0x3863('0x23')](_0x3863('0x5b'),_0x5b4aeb[_0x3863('0x55')],_0x1ee1f7[_0x3863('0x70')],md5(_0x1ee1f7[_0x3863('0x70')]));}else{_0x1ee1f7[_0x3863('0x5a')]='';}return getConnection(_0x5b4aeb)[_0x3863('0x2f')](function(_0x281958){_0x16d329=_0x281958;if(!_[_0x3863('0x2a')](_0x5509fd)){return getUser(_0x5b4aeb,_0x5509fd[_0x3863('0xd')],_0x16d329);}else{return getUser(_0x5b4aeb,null,_0x16d329);}})[_0x3863('0x2f')](function(_0x2ab9d3){_0x12600d=_0x2ab9d3;logger[_0x3863('0xb')]('The\x20User\x20ID\x20is:',_0x12600d['id']);return getEndUser(_0x5b4aeb,_0x1ee1f7[_0x3863('0x5d')],_0x1ee1f7[_0x3863('0x5e')],_0x16d329);})['then'](function(_0x6309f){_0x5c31c8=_0x6309f;logger[_0x3863('0xb')](_0x3863('0x5f'),_0x5c31c8['id']);return getTicket(_0x5b4aeb,_0x12600d,_0x5c31c8,_0x4c5d5d,_0x1ee1f7,_0x4c5d5d[_0x3863('0x72')],_0x16d329,'Inbound');})['then'](function(_0x373b23){_0x53c661=_0x373b23;logger[_0x3863('0xb')](_0x3863('0x61'));logger[_0x3863('0xb')](_0x3863('0x62'),_0x53c661['id']);return setRelationship(_0x16d329,_0x12600d,_0x53c661,'users');})[_0x3863('0x2f')](function(){return setRelationship(_0x16d329,_0x5c31c8,_0x53c661,_0x3863('0x63'));})[_0x3863('0x2f')](function(){return getServerInfo(_0x16d329);})[_0x3863('0x6a')](function(_0x2e3381){logger[_0x3863('0x6b')]('['+_0x1ee1f7[_0x3863('0x78')][_0x3863('0x77')]()+']',JSON[_0x3863('0x29')](_0x2e3381));});}; \ 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 f479cf6..e759b14 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 _0x140a=['content','variable','variableName','toString','customVariable','Variable','name','keyValue','string','key','%s:\x20%s','keyType','format','toLowerCase','join','stripTrailingSlash','substring','lastIndexOf','test','lodash','util','getString','length','sortBy','type','push'];(function(_0x3098ea,_0x2c7f15){var _0x11cd68=function(_0x39b00e){while(--_0x39b00e){_0x3098ea['push'](_0x3098ea['shift']());}};_0x11cd68(++_0x2c7f15);}(_0x140a,0x7b));var _0xa140=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x140a[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xa140('0x0'));var util=require(_0xa140('0x1'));exports[_0xa140('0x2')]=function(_0x39d956,_0x1a54c0,_0x382d30){var _0x2c42bc=[];if(_0x39d956[_0xa140('0x3')]>0x0){var _0xbdb052=_[_0xa140('0x4')](_0x39d956,['id']);for(var _0x5136ec=0x0;_0x5136ec<_0xbdb052[_0xa140('0x3')];_0x5136ec++){var _0x489810=_0xbdb052[_0x5136ec];if(_0x489810[_0xa140('0x5')]==='string'){_0x2c42bc[_0xa140('0x6')](_0x489810[_0xa140('0x7')]);}else if(_0x489810[_0xa140('0x5')]===_0xa140('0x8')&&_0x489810[_0xa140('0x9')]){_0x1a54c0[_0x489810[_0xa140('0x9')]]&&_0x2c42bc[_0xa140('0x6')](_0x1a54c0[_0x489810['variableName']][_0xa140('0xa')]());}else if(_0x489810[_0xa140('0x5')]===_0xa140('0xb')&&_0x489810['Variable']&&_0x489810[_0xa140('0xc')][_0xa140('0xd')]){_0x1a54c0[_0x489810[_0xa140('0xc')]['name']['toLowerCase']()]&&_0x2c42bc['push'](_0x1a54c0[_0x489810['Variable']['name']['toLowerCase']()][_0xa140('0xa')]());}else if(_0x489810[_0xa140('0x5')]===_0xa140('0xe')){if(_0x489810['keyType']===_0xa140('0xf')&&_0x489810[_0xa140('0x10')]){_0x2c42bc['push'](util['format'](_0xa140('0x11'),_0x489810[_0xa140('0x10')],_0x489810['keyContent']));}else if(_0x489810[_0xa140('0x12')]===_0xa140('0x8')&&_0x489810[_0xa140('0x9')]&&_0x489810['key']){_0x1a54c0[_0x489810['variableName']]&&_0x2c42bc[_0xa140('0x6')](util[_0xa140('0x13')]('%s:\x20%s',_0x489810['key'],_0x1a54c0[_0x489810[_0xa140('0x9')]]));}else if(_0x489810[_0xa140('0x12')]==='customVariable'&&_0x489810['Variable']&&_0x489810['Variable']['name']&&_0x489810[_0xa140('0x10')]){_0x1a54c0[_0x489810['Variable'][_0xa140('0xd')][_0xa140('0x14')]()]&&_0x2c42bc[_0xa140('0x6')](util['format']('%s:\x20%s',_0x489810[_0xa140('0x10')],_0x1a54c0[_0x489810[_0xa140('0xc')][_0xa140('0xd')][_0xa140('0x14')]()]));}}}}return _0x2c42bc[_0xa140('0x15')](_0x382d30);};exports[_0xa140('0x16')]=function(_0x32f32c){var _0xc94c62=_0x32f32c['slice'](-0x1);if(_0xc94c62==='/'){_0x32f32c=_0x32f32c[_0xa140('0x17')](0x0,_0x32f32c[_0xa140('0x18')](_0xc94c62));}return _0x32f32c;};exports['validateEmail']=function(_0x4fe726){if(!_['isNil'](_0x4fe726)&&_0x4fe726!==''){var _0x410605=/^(([^<>()\[\]\\.,;:\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 _0x410605[_0xa140('0x19')](String(_0x4fe726)[_0xa140('0x14')]());}else{return![];}}; \ No newline at end of file +var _0xdaa4=['length','sortBy','string','push','content','type','variable','variableName','Variable','name','toLowerCase','toString','key','format','%s:\x20%s','keyContent','keyType','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString'];(function(_0x34aeea,_0x5eac7d){var _0x5a2a23=function(_0x49b6d9){while(--_0x49b6d9){_0x34aeea['push'](_0x34aeea['shift']());}};_0x5a2a23(++_0x5eac7d);}(_0xdaa4,0xc8));var _0x4daa=function(_0x16c2b1,_0x36a70c){_0x16c2b1=_0x16c2b1-0x0;var _0x199ac4=_0xdaa4[_0x16c2b1];return _0x199ac4;};'use strict';var _=require(_0x4daa('0x0'));var util=require(_0x4daa('0x1'));exports[_0x4daa('0x2')]=function(_0x516793,_0xb9ab28,_0xaba653){var _0x38df3b=[];if(_0x516793[_0x4daa('0x3')]>0x0){var _0x27fc24=_[_0x4daa('0x4')](_0x516793,['id']);for(var _0x5f04c6=0x0;_0x5f04c6<_0x27fc24[_0x4daa('0x3')];_0x5f04c6++){var _0x53a2a4=_0x27fc24[_0x5f04c6];if(_0x53a2a4['type']===_0x4daa('0x5')){_0x38df3b[_0x4daa('0x6')](_0x53a2a4[_0x4daa('0x7')]);}else if(_0x53a2a4[_0x4daa('0x8')]===_0x4daa('0x9')&&_0x53a2a4[_0x4daa('0xa')]){_0xb9ab28[_0x53a2a4[_0x4daa('0xa')]]&&_0x38df3b[_0x4daa('0x6')](_0xb9ab28[_0x53a2a4['variableName']]['toString']());}else if(_0x53a2a4[_0x4daa('0x8')]==='customVariable'&&_0x53a2a4['Variable']&&_0x53a2a4[_0x4daa('0xb')][_0x4daa('0xc')]){_0xb9ab28[_0x53a2a4[_0x4daa('0xb')][_0x4daa('0xc')][_0x4daa('0xd')]()]&&_0x38df3b[_0x4daa('0x6')](_0xb9ab28[_0x53a2a4[_0x4daa('0xb')][_0x4daa('0xc')]['toLowerCase']()][_0x4daa('0xe')]());}else if(_0x53a2a4[_0x4daa('0x8')]==='keyValue'){if(_0x53a2a4['keyType']===_0x4daa('0x5')&&_0x53a2a4[_0x4daa('0xf')]){_0x38df3b[_0x4daa('0x6')](util[_0x4daa('0x10')](_0x4daa('0x11'),_0x53a2a4[_0x4daa('0xf')],_0x53a2a4[_0x4daa('0x12')]));}else if(_0x53a2a4[_0x4daa('0x13')]===_0x4daa('0x9')&&_0x53a2a4[_0x4daa('0xa')]&&_0x53a2a4['key']){_0xb9ab28[_0x53a2a4[_0x4daa('0xa')]]&&_0x38df3b[_0x4daa('0x6')](util[_0x4daa('0x10')]('%s:\x20%s',_0x53a2a4['key'],_0xb9ab28[_0x53a2a4[_0x4daa('0xa')]]));}else if(_0x53a2a4[_0x4daa('0x13')]===_0x4daa('0x14')&&_0x53a2a4[_0x4daa('0xb')]&&_0x53a2a4[_0x4daa('0xb')]['name']&&_0x53a2a4[_0x4daa('0xf')]){_0xb9ab28[_0x53a2a4[_0x4daa('0xb')][_0x4daa('0xc')][_0x4daa('0xd')]()]&&_0x38df3b[_0x4daa('0x6')](util[_0x4daa('0x10')](_0x4daa('0x11'),_0x53a2a4[_0x4daa('0xf')],_0xb9ab28[_0x53a2a4['Variable'][_0x4daa('0xc')]['toLowerCase']()]));}}}}return _0x38df3b[_0x4daa('0x15')](_0xaba653);};exports[_0x4daa('0x16')]=function(_0x198103){var _0x1d1b15=_0x198103[_0x4daa('0x17')](-0x1);if(_0x1d1b15==='/'){_0x198103=_0x198103[_0x4daa('0x18')](0x0,_0x198103[_0x4daa('0x19')](_0x1d1b15));}return _0x198103;};exports[_0x4daa('0x1a')]=function(_0x2f44fc){if(!_[_0x4daa('0x1b')](_0x2f44fc)&&_0x2f44fc!==''){var _0x11db85=/^(([^<>()\[\]\\.,;:\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 _0x11db85[_0x4daa('0x1c')](String(_0x2f44fc)[_0x4daa('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 57f08cc..784089f 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x54121c,_0x5b72f4){var _0xd3b07f=function(_0x2fbf58){while(--_0x2fbf58){_0x54121c['push'](_0x54121c['shift']());}};_0xd3b07f(++_0x5b72f4);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _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(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 d907fee..9da1c2d 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 _0xfb02=['Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','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','length','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','stringify','defaults','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','includes','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb02,0xd0));var _0x2fb0=function(_0x12e073,_0x2a6387){_0x12e073=_0x12e073-0x0;var _0x17e67b=_0xfb02[_0x12e073];return _0x17e67b;};'use strict';var _=require('lodash');var rp=require(_0x2fb0('0x0'));var md5=require(_0x2fb0('0x1'));var util=require(_0x2fb0('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x2fb0('0x3'));var logger=require(_0x2fb0('0x4'))(_0x2fb0('0x5'));config[_0x2fb0('0x6')]=_['defaults'](config[_0x2fb0('0x6')],{'host':_0x2fb0('0x7'),'port':0x18eb});var io=require(_0x2fb0('0x8'))(new Redis(config[_0x2fb0('0x6')]));function emit(_0x313796,_0x65e35e,_0x493c72){io['to'](_0x313796)[_0x2fb0('0x9')](_0x65e35e,_0x493c72);}var headers={'Content-Type':_0x2fb0('0xa'),'Accept':'application/json'};function getTicket(_0x1d7877,_0x346688,_0x1d83a5,_0x2d1919,_0x4a9ad3){logger[_0x2fb0('0xb')](_0x2fb0('0xc'));return request({'uri':util[_0x2fb0('0xd')](_0x2fb0('0xe'),_0x1d7877[_0x2fb0('0xf')]),'method':_0x2fb0('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x1d83a5['id'],'submitter_id':_0x346688?_0x346688['id']:undefined,'assignee_id':_0x346688?_0x346688['id']:undefined,'tags':getTags(_0x2d1919['Tags'],_0x2fb0('0x11')),'subject':intUtil[_0x2fb0('0x12')](_0x2d1919[_0x2fb0('0x13')],_0x4a9ad3,'\x20'),'description':intUtil['getString'](_0x2d1919[_0x2fb0('0x14')],_0x4a9ad3,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2fb0('0x12')](_0x2d1919[_0x2fb0('0x14')],_0x4a9ad3,'\x0a')}},getCustomFields(_0x2d1919['Fields'],_0x4a9ad3))}})[_0x2fb0('0x15')](function(_0x2024c2){logger[_0x2fb0('0xb')](_0x2fb0('0x16'));return _0x2024c2[_0x2fb0('0x17')];});}function getUser(_0x2d6699,_0x26ff83){if(intUtil['validateEmail'](_0x26ff83)){logger[_0x2fb0('0xb')](_0x2fb0('0x18'),_0x26ff83);return request({'uri':util[_0x2fb0('0xd')](_0x2fb0('0x19'),_0x2d6699[_0x2fb0('0xf')]),'qs':{'query':util['format'](_0x2fb0('0x1a'),_0x26ff83)}})[_0x2fb0('0x15')](function(_0xb37d79){if(_0xb37d79[_0x2fb0('0x1b')]){logger['info'](_0x2fb0('0x1c'));return _['find'](_0xb37d79[_0x2fb0('0x1d')],{'email':_0x26ff83,'role':'agent'});}else{logger[_0x2fb0('0xb')](_0x2fb0('0x1e'));return request({'uri':util['format'](_0x2fb0('0x1f'),_0x2d6699[_0x2fb0('0xf')])})['then'](function(_0x3ab11d){logger[_0x2fb0('0xb')](_0x2fb0('0x20'));return _0x3ab11d[_0x2fb0('0x21')];});}});}else{logger[_0x2fb0('0xb')](_0x2fb0('0x1e'));return request({'uri':util[_0x2fb0('0xd')](_0x2fb0('0x1f'),_0x2d6699[_0x2fb0('0xf')])})[_0x2fb0('0x15')](function(_0x38c1b0){logger[_0x2fb0('0xb')](_0x2fb0('0x20'));return _0x38c1b0[_0x2fb0('0x21')];});}}function getEndUser(_0x9f7f20,_0x49f14f,_0x1cd0d7){logger['info'](_0x2fb0('0x22'),_0x1cd0d7);return request({'uri':util['format'](_0x2fb0('0x19'),_0x9f7f20[_0x2fb0('0xf')]),'qs':{'query':util['format'](_0x2fb0('0x23'),_0x1cd0d7)}})[_0x2fb0('0x15')](function(_0x2d0c89){var _0x286b26;if(_0x2d0c89[_0x2fb0('0x1d')][_0x2fb0('0x24')]){_0x2d0c89[_0x2fb0('0x1d')]=_['filter'](_0x2d0c89[_0x2fb0('0x1d')],{'suspended':![],'role':_0x2fb0('0x25')});if(_0x2d0c89[_0x2fb0('0x1d')][_0x2fb0('0x24')]){_0x286b26=_['first'](_0x2d0c89[_0x2fb0('0x1d')]);}}if(_0x286b26){logger[_0x2fb0('0xb')]('Enduser\x20found!');return _0x286b26;}else{logger['info'](_0x2fb0('0x26'));return request({'uri':util[_0x2fb0('0xd')](_0x2fb0('0x27'),_0x9f7f20[_0x2fb0('0xf')]),'method':_0x2fb0('0x10'),'body':{'user':{'role':_0x2fb0('0x25'),'name':util['format'](_0x2fb0('0x28'),_0x49f14f||_0x1cd0d7),'phone':_0x1cd0d7}}})[_0x2fb0('0x15')](function(_0x2d89c4){logger[_0x2fb0('0xb')]('Enduser\x20created.');return _0x2d89c4[_0x2fb0('0x21')];});}});}function getAuth(_0x51b74f){var _0x84125;if(_0x51b74f[_0x2fb0('0x29')]==='password'){_0x84125=util[_0x2fb0('0xd')](_0x2fb0('0x2a'),_0x51b74f[_0x2fb0('0x2b')],_0x51b74f[_0x2fb0('0x2c')]);}else if(_0x51b74f[_0x2fb0('0x29')]===_0x2fb0('0x2d')){_0x84125=util[_0x2fb0('0xd')](_0x2fb0('0x2e'),_0x51b74f[_0x2fb0('0x2b')],_0x51b74f[_0x2fb0('0x2d')]);}return util[_0x2fb0('0xd')](_0x2fb0('0x2f'),new Buffer(_0x84125)[_0x2fb0('0x30')](_0x2fb0('0x31')));}function request(_0x55068d){logger['debug']('[HTTP]',JSON[_0x2fb0('0x32')](_0x55068d));return rp(_[_0x2fb0('0x33')](_0x55068d,{'method':_0x2fb0('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x29fea5,_0x157fd7){var _0x581e5f=[];if(_0x29fea5&&_0x29fea5[_0x2fb0('0x24')]>0x0){_0x581e5f=_[_0x2fb0('0x35')](_0x29fea5,_0x157fd7);}return _0x581e5f;}function getCustomFields(_0x4c084f,_0x2c3ab9){var _0x4cb498=[];var _0x5207f2={'custom_fields':[]};if(_0x4c084f[_0x2fb0('0x24')]>0x0){_[_0x2fb0('0x36')](_0x4c084f,function(_0x27d5f4){if(_['includes']([_0x2fb0('0x37'),_0x2fb0('0x38')],_0x27d5f4[_0x2fb0('0x39')])&&_0x27d5f4[_0x2fb0('0x3a')]&&!_0x27d5f4[_0x2fb0('0x3b')]){_0x5207f2[_0x27d5f4[_0x2fb0('0x3a')][_0x2fb0('0x3c')]()]=_0x27d5f4['content'][_0x2fb0('0x30')]();}else if(_[_0x2fb0('0x3d')]([_0x2fb0('0x37'),_0x2fb0('0x38')],_0x27d5f4[_0x2fb0('0x39')])&&_0x27d5f4[_0x2fb0('0x3e')]&&_0x27d5f4[_0x2fb0('0x3b')]){_0x5207f2[_0x2fb0('0x3f')][_0x2fb0('0x40')]({'id':_0x27d5f4['idField'],'value':_0x27d5f4[_0x2fb0('0x41')][_0x2fb0('0x30')]()});}else if(_0x27d5f4[_0x2fb0('0x39')]===_0x2fb0('0x42')&&_0x27d5f4[_0x2fb0('0x43')]&&_0x27d5f4['idField']&&_0x27d5f4[_0x2fb0('0x3b')]){_0x2c3ab9[_0x27d5f4[_0x2fb0('0x43')]]&&_0x5207f2[_0x2fb0('0x3f')][_0x2fb0('0x40')]({'id':_0x27d5f4[_0x2fb0('0x3e')],'value':_0x2c3ab9[_0x27d5f4[_0x2fb0('0x43')]]['toString']()});}else if(_0x27d5f4[_0x2fb0('0x39')]===_0x2fb0('0x44')&&_0x27d5f4['Variable']&&_0x27d5f4['Variable']['name']&&_0x27d5f4[_0x2fb0('0x3e')]&&_0x27d5f4['customField']){_0x2c3ab9[_0x27d5f4['Variable']['name'][_0x2fb0('0x3c')]()]&&_0x5207f2[_0x2fb0('0x3f')][_0x2fb0('0x40')]({'id':_0x27d5f4[_0x2fb0('0x3e')],'value':_0x2c3ab9[_0x27d5f4[_0x2fb0('0x45')]['name'][_0x2fb0('0x3c')]()][_0x2fb0('0x30')]()});}});}return _0x5207f2;}exports['queue']=function(_0x53b524,_0x341b7b,_0x5a0d5e,_0x38c60e,_0x581944,_0x9d5ef9){var _0xaa6374,_0x5ad3f7;_0x9d5ef9[_0x2fb0('0xf')]=intUtil['stripTrailingSlash'](_0x9d5ef9[_0x2fb0('0xf')]);_0x9d5ef9[_0x2fb0('0x46')]=intUtil[_0x2fb0('0x47')](_0x9d5ef9[_0x2fb0('0x46')]);if(_0x581944&&_0x581944[_0x2fb0('0x48')]){logger['info'](_0x2fb0('0x49'),'Recording\x20is\x20enabled!');_0x341b7b[_0x2fb0('0x4a')]=util[_0x2fb0('0xd')](_0x2fb0('0x4b'),_0x9d5ef9[_0x2fb0('0x46')],_0x341b7b['uniqueid'],md5(_0x341b7b[_0x2fb0('0x4c')]));}else{_0x341b7b[_0x2fb0('0x4a')]='';}headers[_0x2fb0('0x4d')]=getAuth(_0x9d5ef9);return getUser(_0x9d5ef9,_0x38c60e[_0x2fb0('0x4e')])['then'](function(_0x46e95d){_0xaa6374=_0x46e95d;logger[_0x2fb0('0xb')](_0x2fb0('0x4f'),_0xaa6374['id']);return getEndUser(_0x9d5ef9,_0x341b7b[_0x2fb0('0x50')],_0x341b7b[_0x2fb0('0x51')]);})[_0x2fb0('0x15')](function(_0x519e4a){_0x5ad3f7=_0x519e4a;logger['info'](_0x2fb0('0x52'),_0x5ad3f7['id']);return getTicket(_0x9d5ef9,_0xaa6374,_0x5ad3f7,_0x5a0d5e,_0x341b7b);})[_0x2fb0('0x15')](function(_0x4f591a){if(_0x4f591a){logger[_0x2fb0('0xb')](_0x2fb0('0x53'),_0x4f591a['id']);switch(_0x9d5ef9[_0x2fb0('0x39')]){case _0x2fb0('0x54'):logger[_0x2fb0('0xb')](_0x2fb0('0x49'),_0x2fb0('0x55'));return request({'uri':util[_0x2fb0('0xd')](_0x2fb0('0x56'),_0x9d5ef9['remoteUri'],_0xaa6374['id'],_0x4f591a['id']),'method':_0x2fb0('0x10')});case _0x2fb0('0x57'):logger['info'](_0x2fb0('0x49'),_0x2fb0('0x58'));emit(util[_0x2fb0('0xd')](_0x2fb0('0x59'),_0x38c60e[_0x2fb0('0x11')]),_0x2fb0('0x5a'),{'uri':util['format'](_0x2fb0('0x5b'),_0x9d5ef9['remoteUri'][_0x2fb0('0x5c')](_0x2fb0('0x5d'),''),_0x4f591a['id'])});break;default:logger[_0x2fb0('0x5e')]('[QUEUE]',_0x2fb0('0x5f'));}}})['catch'](function(_0xf6fbcc){logger[_0x2fb0('0x5e')](_0x2fb0('0x60'),util[_0x2fb0('0x61')](_0xf6fbcc,{'showHidden':!![],'depth':null}));});};exports[_0x2fb0('0x62')]=function(_0x4bebfd,_0xf985b1,_0x347d87,_0x442a15,_0x150447,_0x108152,_0x22356a){var _0x4eb309,_0x253eec;_0x108152[_0x2fb0('0xf')]=intUtil['stripTrailingSlash'](_0x108152[_0x2fb0('0xf')]);_0x108152['serverUrl']=intUtil[_0x2fb0('0x47')](_0x108152[_0x2fb0('0x46')]);if(_0x22356a&&_0x22356a[_0x2fb0('0x63')]&&_0x22356a[_0x2fb0('0x63')]!=='none'){logger['info'](_0x2fb0('0x64'),'Recording\x20is\x20enabled!');_0xf985b1['recordingURL']=util[_0x2fb0('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x108152[_0x2fb0('0x46')],_0xf985b1[_0x2fb0('0x4c')],md5(_0xf985b1['uniqueid']));}headers['Authorization']=getAuth(_0x108152);return getUser(_0x108152,_0x442a15[_0x2fb0('0x4e')])[_0x2fb0('0x15')](function(_0x1f330a){_0x4eb309=_0x1f330a;logger[_0x2fb0('0xb')](_0x2fb0('0x4f'),_0x4eb309['id']);return getEndUser(_0x108152,_0xf985b1[_0x2fb0('0x65')],_0xf985b1[_0x2fb0('0x66')]);})['then'](function(_0x5e991){_0x253eec=_0x5e991;logger['info'](_0x2fb0('0x52'),_0x253eec['id']);return getTicket(_0x108152,_0x4eb309,_0x253eec,_0x347d87,_0xf985b1);})['then'](function(_0x50315a){if(_0x50315a){logger['info'](_0x2fb0('0x53'),_0x50315a['id']);switch(_0x108152[_0x2fb0('0x39')]){case _0x2fb0('0x54'):logger[_0x2fb0('0xb')](_0x2fb0('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2fb0('0xd')](_0x2fb0('0x56'),_0x108152[_0x2fb0('0xf')],_0x4eb309['id'],_0x50315a['id']),'method':'POST'});case'newTab':logger[_0x2fb0('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2fb0('0x59'),_0x442a15['name']),_0x2fb0('0x5a'),{'uri':util['format'](_0x2fb0('0x5b'),_0x108152[_0x2fb0('0xf')][_0x2fb0('0x5c')](_0x2fb0('0x5d'),''),_0x50315a['id'])});break;default:logger[_0x2fb0('0x5e')](_0x2fb0('0x64'),_0x2fb0('0x5f'));}}})[_0x2fb0('0x67')](function(_0x37a83b){logger[_0x2fb0('0x5e')](_0x2fb0('0x68'),util[_0x2fb0('0x61')](_0x37a83b,{'showHidden':!![],'depth':null}));});};exports[_0x2fb0('0x69')]=function(_0x458d75,_0x344cd9,_0x29bc74,_0x2c2b36,_0x3ef35d,_0x2e3f3e){var _0x4a25db,_0x15d37b;_0x2e3f3e[_0x2fb0('0xf')]=intUtil[_0x2fb0('0x47')](_0x2e3f3e['remoteUri']);_0x2e3f3e['serverUrl']=intUtil['stripTrailingSlash'](_0x2e3f3e[_0x2fb0('0x46')]);if(_0x3ef35d&&_0x3ef35d['monitor_format']){logger['info']('['+_0x344cd9[_0x2fb0('0x6a')][_0x2fb0('0x6b')]()+']',_0x2fb0('0x6c'));_0x344cd9['recordingURL']=util[_0x2fb0('0xd')](_0x2fb0('0x4b'),_0x2e3f3e[_0x2fb0('0x46')],_0x344cd9[_0x2fb0('0x4c')],md5(_0x344cd9['uniqueid']));}else{_0x344cd9[_0x2fb0('0x4a')]='';}headers[_0x2fb0('0x4d')]=getAuth(_0x2e3f3e);return getUser(_0x2e3f3e)[_0x2fb0('0x15')](function(_0x25e7d4){_0x4a25db=_0x25e7d4;logger['info'](_0x2fb0('0x4f'),_0x4a25db['id']);return getEndUser(_0x2e3f3e,_0x344cd9['calleridname'],_0x344cd9[_0x2fb0('0x51')]);})[_0x2fb0('0x15')](function(_0x514f6d){_0x15d37b=_0x514f6d;logger[_0x2fb0('0xb')](_0x2fb0('0x52'),_0x15d37b['id']);return getTicket(_0x2e3f3e,_0x4a25db,_0x15d37b,_0x29bc74,_0x344cd9);})[_0x2fb0('0x15')](function(_0x138b58){if(_0x138b58){logger[_0x2fb0('0xb')](_0x2fb0('0x53'),_0x138b58['id']);}})['catch'](function(_0x49855f){logger[_0x2fb0('0x5e')]('['+_0x344cd9[_0x2fb0('0x6a')][_0x2fb0('0x6b')]()+']'+_0x2fb0('0x6d'),util[_0x2fb0('0x61')](_0x49855f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa82a=['[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','token','%s/token:%s','username','base64','stringify','defaults','GET','forEach','type','toLowerCase','includes','idField','customField','toString','variable','variableName','customVariable','Variable','custom_fields','push','stripTrailingSlash','serverUrl','[QUEUE]','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:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]'];(function(_0x57e32a,_0x35659c){var _0x5c5fef=function(_0x8e5cc7){while(--_0x8e5cc7){_0x57e32a['push'](_0x57e32a['shift']());}};_0x5c5fef(++_0x35659c);}(_0xa82a,0x1b2));var _0xaa82=function(_0x43a3d1,_0x3576e1){_0x43a3d1=_0x43a3d1-0x0;var _0x168f9d=_0xa82a[_0x43a3d1];return _0x168f9d;};'use strict';var _=require(_0xaa82('0x0'));var rp=require(_0xaa82('0x1'));var md5=require(_0xaa82('0x2'));var util=require(_0xaa82('0x3'));var Redis=require(_0xaa82('0x4'));var intUtil=require(_0xaa82('0x5'));var config=require(_0xaa82('0x6'));var logger=require('../../../../config/logger')('zendesk');config[_0xaa82('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xaa82('0x8'))(new Redis(config[_0xaa82('0x7')]));function emit(_0x4c72c6,_0x21c758,_0x3187be){io['to'](_0x4c72c6)['emit'](_0x21c758,_0x3187be);}var headers={'Content-Type':'application/json','Accept':_0xaa82('0x9')};function getTicket(_0x5ad3e9,_0x4278a4,_0x1e90c9,_0x490a92,_0x2d0628){logger[_0xaa82('0xa')](_0xaa82('0xb'));return request({'uri':util['format'](_0xaa82('0xc'),_0x5ad3e9['remoteUri']),'method':_0xaa82('0xd'),'body':{'ticket':_[_0xaa82('0xe')]({'requester_id':_0x1e90c9['id'],'submitter_id':_0x4278a4?_0x4278a4['id']:undefined,'assignee_id':_0x4278a4?_0x4278a4['id']:undefined,'tags':getTags(_0x490a92[_0xaa82('0xf')],_0xaa82('0x10')),'subject':intUtil['getString'](_0x490a92[_0xaa82('0x11')],_0x2d0628,'\x20'),'description':intUtil[_0xaa82('0x12')](_0x490a92[_0xaa82('0x13')],_0x2d0628,'\x0a'),'comment':{'public':![],'body':intUtil[_0xaa82('0x12')](_0x490a92[_0xaa82('0x13')],_0x2d0628,'\x0a')}},getCustomFields(_0x490a92[_0xaa82('0x14')],_0x2d0628))}})[_0xaa82('0x15')](function(_0x39cec2){logger[_0xaa82('0xa')](_0xaa82('0x16'));return _0x39cec2[_0xaa82('0x17')];});}function getUser(_0x277c05,_0x440927){if(intUtil[_0xaa82('0x18')](_0x440927)){logger[_0xaa82('0xa')](_0xaa82('0x19'),_0x440927);return request({'uri':util['format']('%s/search.json',_0x277c05[_0xaa82('0x1a')]),'qs':{'query':util[_0xaa82('0x1b')](_0xaa82('0x1c'),_0x440927)}})[_0xaa82('0x15')](function(_0x496847){if(_0x496847[_0xaa82('0x1d')]){logger['info'](_0xaa82('0x1e'));return _[_0xaa82('0x1f')](_0x496847[_0xaa82('0x20')],{'email':_0x440927,'role':_0xaa82('0x21')});}else{logger[_0xaa82('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xaa82('0x1b')](_0xaa82('0x22'),_0x277c05[_0xaa82('0x1a')])})[_0xaa82('0x15')](function(_0x541447){logger['info']('Admin\x20account\x20selected.');return _0x541447[_0xaa82('0x23')];});}});}else{logger[_0xaa82('0xa')](_0xaa82('0x24'));return request({'uri':util[_0xaa82('0x1b')]('%s/users/me.json',_0x277c05['remoteUri'])})[_0xaa82('0x15')](function(_0x2aba71){logger[_0xaa82('0xa')](_0xaa82('0x25'));return _0x2aba71[_0xaa82('0x23')];});}}function getEndUser(_0x391496,_0x1bc855,_0x5a92aa){logger[_0xaa82('0xa')]('Searching\x20enduser\x20with\x20phone',_0x5a92aa);return request({'uri':util[_0xaa82('0x1b')](_0xaa82('0x26'),_0x391496['remoteUri']),'qs':{'query':util['format'](_0xaa82('0x27'),_0x5a92aa)}})[_0xaa82('0x15')](function(_0x3c217c){var _0xf6b4fe;if(_0x3c217c[_0xaa82('0x20')][_0xaa82('0x28')]){_0x3c217c[_0xaa82('0x20')]=_['filter'](_0x3c217c['results'],{'suspended':![],'role':_0xaa82('0x29')});if(_0x3c217c[_0xaa82('0x20')][_0xaa82('0x28')]){_0xf6b4fe=_[_0xaa82('0x2a')](_0x3c217c['results']);}}if(_0xf6b4fe){logger[_0xaa82('0xa')](_0xaa82('0x2b'));return _0xf6b4fe;}else{logger[_0xaa82('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xaa82('0x1b')]('%s/users.json',_0x391496[_0xaa82('0x1a')]),'method':_0xaa82('0xd'),'body':{'user':{'role':_0xaa82('0x29'),'name':util[_0xaa82('0x1b')](_0xaa82('0x2c'),_0x1bc855||_0x5a92aa),'phone':_0x5a92aa}}})[_0xaa82('0x15')](function(_0x5c4048){logger[_0xaa82('0xa')](_0xaa82('0x2d'));return _0x5c4048[_0xaa82('0x23')];});}});}function getAuth(_0x26bb89){var _0x1f60d3;if(_0x26bb89[_0xaa82('0x2e')]==='password'){_0x1f60d3=util[_0xaa82('0x1b')](_0xaa82('0x2f'),_0x26bb89['username'],_0x26bb89['password']);}else if(_0x26bb89['authType']===_0xaa82('0x30')){_0x1f60d3=util['format'](_0xaa82('0x31'),_0x26bb89[_0xaa82('0x32')],_0x26bb89[_0xaa82('0x30')]);}return util[_0xaa82('0x1b')]('Basic\x20%s',new Buffer(_0x1f60d3)['toString'](_0xaa82('0x33')));}function request(_0x382d9f){logger['debug']('[HTTP]',JSON[_0xaa82('0x34')](_0x382d9f));return rp(_[_0xaa82('0x35')](_0x382d9f,{'method':_0xaa82('0x36'),'headers':headers,'json':!![]}));}function getTags(_0xe411d,_0x3ad007){var _0x4975c3=[];if(_0xe411d&&_0xe411d[_0xaa82('0x28')]>0x0){_0x4975c3=_['map'](_0xe411d,_0x3ad007);}return _0x4975c3;}function getCustomFields(_0x59e370,_0x42d9f3){var _0x3c3136=[];var _0x7f81d5={'custom_fields':[]};if(_0x59e370[_0xaa82('0x28')]>0x0){_[_0xaa82('0x37')](_0x59e370,function(_0x263131){if(_['includes'](['string','picklist'],_0x263131[_0xaa82('0x38')])&&_0x263131['nameField']&&!_0x263131['customField']){_0x7f81d5[_0x263131['nameField'][_0xaa82('0x39')]()]=_0x263131['content']['toString']();}else if(_[_0xaa82('0x3a')](['string','picklist'],_0x263131[_0xaa82('0x38')])&&_0x263131[_0xaa82('0x3b')]&&_0x263131[_0xaa82('0x3c')]){_0x7f81d5['custom_fields']['push']({'id':_0x263131['idField'],'value':_0x263131['content'][_0xaa82('0x3d')]()});}else if(_0x263131[_0xaa82('0x38')]===_0xaa82('0x3e')&&_0x263131[_0xaa82('0x3f')]&&_0x263131[_0xaa82('0x3b')]&&_0x263131['customField']){_0x42d9f3[_0x263131[_0xaa82('0x3f')]]&&_0x7f81d5['custom_fields']['push']({'id':_0x263131[_0xaa82('0x3b')],'value':_0x42d9f3[_0x263131[_0xaa82('0x3f')]][_0xaa82('0x3d')]()});}else if(_0x263131[_0xaa82('0x38')]===_0xaa82('0x40')&&_0x263131[_0xaa82('0x41')]&&_0x263131['Variable'][_0xaa82('0x10')]&&_0x263131[_0xaa82('0x3b')]&&_0x263131[_0xaa82('0x3c')]){_0x42d9f3[_0x263131[_0xaa82('0x41')][_0xaa82('0x10')]['toLowerCase']()]&&_0x7f81d5[_0xaa82('0x42')][_0xaa82('0x43')]({'id':_0x263131[_0xaa82('0x3b')],'value':_0x42d9f3[_0x263131[_0xaa82('0x41')][_0xaa82('0x10')]['toLowerCase']()][_0xaa82('0x3d')]()});}});}return _0x7f81d5;}exports['queue']=function(_0x922265,_0x3969c3,_0x21bb07,_0x2e58dd,_0x939bb1,_0x56b945){var _0x2e032b,_0x30357f;_0x56b945[_0xaa82('0x1a')]=intUtil[_0xaa82('0x44')](_0x56b945[_0xaa82('0x1a')]);_0x56b945['serverUrl']=intUtil[_0xaa82('0x44')](_0x56b945[_0xaa82('0x45')]);if(_0x939bb1&&_0x939bb1['monitor_format']){logger['info'](_0xaa82('0x46'),_0xaa82('0x47'));_0x3969c3[_0xaa82('0x48')]=util[_0xaa82('0x1b')](_0xaa82('0x49'),_0x56b945[_0xaa82('0x45')],_0x3969c3['uniqueid'],md5(_0x3969c3[_0xaa82('0x4a')]));}else{_0x3969c3['recordingURL']='';}headers['Authorization']=getAuth(_0x56b945);return getUser(_0x56b945,_0x2e58dd[_0xaa82('0x4b')])['then'](function(_0x21a031){_0x2e032b=_0x21a031;logger['info'](_0xaa82('0x4c'),_0x2e032b['id']);return getEndUser(_0x56b945,_0x3969c3[_0xaa82('0x4d')],_0x3969c3[_0xaa82('0x4e')]);})[_0xaa82('0x15')](function(_0x816622){_0x30357f=_0x816622;logger[_0xaa82('0xa')](_0xaa82('0x4f'),_0x30357f['id']);return getTicket(_0x56b945,_0x2e032b,_0x30357f,_0x21bb07,_0x3969c3);})[_0xaa82('0x15')](function(_0x4a52fd){if(_0x4a52fd){logger[_0xaa82('0xa')](_0xaa82('0x50'),_0x4a52fd['id']);switch(_0x56b945[_0xaa82('0x38')]){case _0xaa82('0x51'):logger['info'](_0xaa82('0x46'),_0xaa82('0x52'));return request({'uri':util['format'](_0xaa82('0x53'),_0x56b945[_0xaa82('0x1a')],_0x2e032b['id'],_0x4a52fd['id']),'method':'POST'});case _0xaa82('0x54'):logger['info'](_0xaa82('0x46'),_0xaa82('0x55'));emit(util[_0xaa82('0x1b')](_0xaa82('0x56'),_0x2e58dd[_0xaa82('0x10')]),_0xaa82('0x57'),{'uri':util['format'](_0xaa82('0x58'),_0x56b945[_0xaa82('0x1a')][_0xaa82('0x59')](_0xaa82('0x5a'),''),_0x4a52fd['id'])});break;default:logger[_0xaa82('0x5b')](_0xaa82('0x46'),_0xaa82('0x5c'));}}})[_0xaa82('0x5d')](function(_0x1709d7){logger[_0xaa82('0x5b')](_0xaa82('0x5e'),util[_0xaa82('0x5f')](_0x1709d7,{'showHidden':!![],'depth':null}));});};exports[_0xaa82('0x60')]=function(_0x17b980,_0xf1be08,_0x672c6b,_0x149620,_0x35a888,_0x1bf9f0,_0x4e7104){var _0x3dda5a,_0x5d393a;_0x1bf9f0[_0xaa82('0x1a')]=intUtil[_0xaa82('0x44')](_0x1bf9f0[_0xaa82('0x1a')]);_0x1bf9f0[_0xaa82('0x45')]=intUtil['stripTrailingSlash'](_0x1bf9f0[_0xaa82('0x45')]);if(_0x4e7104&&_0x4e7104['recordingFormat']&&_0x4e7104[_0xaa82('0x61')]!=='none'){logger[_0xaa82('0xa')]('[OUTBOUND]',_0xaa82('0x47'));_0xf1be08[_0xaa82('0x48')]=util[_0xaa82('0x1b')](_0xaa82('0x49'),_0x1bf9f0['serverUrl'],_0xf1be08[_0xaa82('0x4a')],md5(_0xf1be08[_0xaa82('0x4a')]));}headers['Authorization']=getAuth(_0x1bf9f0);return getUser(_0x1bf9f0,_0x149620[_0xaa82('0x4b')])['then'](function(_0x226f54){_0x3dda5a=_0x226f54;logger['info']('The\x20User\x20ID\x20is:',_0x3dda5a['id']);return getEndUser(_0x1bf9f0,_0xf1be08[_0xaa82('0x62')],_0xf1be08[_0xaa82('0x63')]);})['then'](function(_0x261cae){_0x5d393a=_0x261cae;logger['info'](_0xaa82('0x4f'),_0x5d393a['id']);return getTicket(_0x1bf9f0,_0x3dda5a,_0x5d393a,_0x672c6b,_0xf1be08);})[_0xaa82('0x15')](function(_0x32e550){if(_0x32e550){logger[_0xaa82('0xa')](_0xaa82('0x50'),_0x32e550['id']);switch(_0x1bf9f0[_0xaa82('0x38')]){case _0xaa82('0x51'):logger[_0xaa82('0xa')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xaa82('0x1b')](_0xaa82('0x53'),_0x1bf9f0[_0xaa82('0x1a')],_0x3dda5a['id'],_0x32e550['id']),'method':'POST'});case'newTab':logger[_0xaa82('0xa')](_0xaa82('0x64'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaa82('0x1b')](_0xaa82('0x56'),_0x149620[_0xaa82('0x10')]),_0xaa82('0x57'),{'uri':util[_0xaa82('0x1b')](_0xaa82('0x58'),_0x1bf9f0['remoteUri'][_0xaa82('0x59')](_0xaa82('0x5a'),''),_0x32e550['id'])});break;default:logger['error'](_0xaa82('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xaa82('0x5d')](function(_0x18d2e3){logger[_0xaa82('0x5b')](_0xaa82('0x65'),util['inspect'](_0x18d2e3,{'showHidden':!![],'depth':null}));});};exports[_0xaa82('0x66')]=function(_0x48eabb,_0x2c0e17,_0x53b145,_0x22ee10,_0x41b363,_0x47a859){var _0x4819ab,_0x7ab7b5;_0x47a859[_0xaa82('0x1a')]=intUtil[_0xaa82('0x44')](_0x47a859[_0xaa82('0x1a')]);_0x47a859['serverUrl']=intUtil['stripTrailingSlash'](_0x47a859[_0xaa82('0x45')]);if(_0x41b363&&_0x41b363[_0xaa82('0x67')]){logger[_0xaa82('0xa')]('['+_0x2c0e17['lastevent'][_0xaa82('0x68')]()+']',_0xaa82('0x47'));_0x2c0e17[_0xaa82('0x48')]=util[_0xaa82('0x1b')](_0xaa82('0x49'),_0x47a859[_0xaa82('0x45')],_0x2c0e17['uniqueid'],md5(_0x2c0e17[_0xaa82('0x4a')]));}else{_0x2c0e17[_0xaa82('0x48')]='';}headers['Authorization']=getAuth(_0x47a859);return getUser(_0x47a859)[_0xaa82('0x15')](function(_0x5c2d84){_0x4819ab=_0x5c2d84;logger[_0xaa82('0xa')](_0xaa82('0x4c'),_0x4819ab['id']);return getEndUser(_0x47a859,_0x2c0e17[_0xaa82('0x4d')],_0x2c0e17[_0xaa82('0x4e')]);})[_0xaa82('0x15')](function(_0x3d1aad){_0x7ab7b5=_0x3d1aad;logger['info'](_0xaa82('0x4f'),_0x7ab7b5['id']);return getTicket(_0x47a859,_0x4819ab,_0x7ab7b5,_0x53b145,_0x2c0e17);})[_0xaa82('0x15')](function(_0x183541){if(_0x183541){logger[_0xaa82('0xa')]('The\x20Ticket\x20ID\x20is:',_0x183541['id']);}})['catch'](function(_0x5ce5aa){logger['error']('['+_0x2c0e17[_0xaa82('0x69')][_0xaa82('0x68')]()+']'+_0xaa82('0x6a'),util[_0xaa82('0x5f')](_0x5ce5aa,{'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 748df21..4499389 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 _0x5393=['toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','info','Agent\x20found!','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','SUCCESS','enduserType','moduleCreate','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','lead','Owner','profile','administrator','last_name','Subject','Subjects','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','/crm/v2/Calls','code','Call\x20created!','details','err','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','toUpperCase','/api/voice/recordings/','lodash','request-promise','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','stringify','length','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name'];(function(_0x25a136,_0x57320e){var _0x5b7159=function(_0x32c8f9){while(--_0x32c8f9){_0x25a136['push'](_0x25a136['shift']());}};_0x5b7159(++_0x57320e);}(_0x5393,0x1b6));var _0x3539=function(_0x187302,_0x2c5da4){_0x187302=_0x187302-0x0;var _0x5b8ef4=_0x5393[_0x187302];return _0x5b8ef4;};'use strict';var _=require(_0x3539('0x0'));var rp=require(_0x3539('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x3539('0x2'));var moment=require('moment');var Redis=require(_0x3539('0x3'));var BPromise=require(_0x3539('0x4'));var config=require(_0x3539('0x5'));var logger=require(_0x3539('0x6'))(_0x3539('0x7'));config[_0x3539('0x8')]=_['defaults'](config['redis'],{'host':_0x3539('0x9'),'port':0x18eb});var io=require(_0x3539('0xa'))(new Redis(config[_0x3539('0x8')]));function emit(_0x50cca8,_0x30aa88,_0x5033b0){io['to'](_0x50cca8)[_0x3539('0xb')](_0x30aa88,_0x5033b0);}function request(_0xd97598){logger[_0x3539('0xc')]('[HTTP]',JSON[_0x3539('0xd')](_0xd97598));return rp(_0xd97598);}function getCustomFields(_0x4a7138,_0x483ba0){var _0x1ce365={};if(_0x4a7138[_0x3539('0xe')]>0x0){_['forEach'](_0x4a7138,function(_0x36d866){if(_[_0x3539('0xf')]([_0x3539('0x10'),_0x3539('0x11')],_0x36d866[_0x3539('0x12')])&&_0x36d866['idField']){_0x1ce365[_0x36d866[_0x3539('0x13')]]=_0x36d866[_0x3539('0x14')][_0x3539('0x15')]();}else if(_0x36d866['type']===_0x3539('0x16')&&_0x36d866['variableName']&&_0x36d866['idField']&&_0x483ba0[_0x36d866[_0x3539('0x17')]]){_0x1ce365[_0x36d866[_0x3539('0x13')]]=_0x483ba0[_0x36d866[_0x3539('0x17')]]['toString']();}else if(_0x36d866[_0x3539('0x12')]===_0x3539('0x18')&&_0x36d866['Variable']&&_0x36d866[_0x3539('0x19')][_0x3539('0x1a')]&&_0x36d866['idField']&&_0x483ba0[_0x36d866[_0x3539('0x19')][_0x3539('0x1a')][_0x3539('0x1b')]()]){_0x1ce365[_0x36d866[_0x3539('0x13')]]=_0x483ba0[_0x36d866[_0x3539('0x19')][_0x3539('0x1a')]['toLowerCase']()][_0x3539('0x15')]();}});}return _0x1ce365;}function getName(_0xd7a026){if(_0xd7a026[_0x3539('0x1c')]('\x20')>0x0){var _0x1e86ba=_0xd7a026[_0x3539('0x1d')](/ (.+)/);if(_0x1e86ba[0x1]){return _0x1e86ba;}}return[_0xd7a026,_0xd7a026];}var accountsTokens={};function getAccessToken(_0x5acb81){return new Promise(function(_0x55accc,_0x4bba4b){if(!_[_0x3539('0x1e')](accountsTokens[_0x5acb81['id']])&&!_[_0x3539('0x1e')](accountsTokens[_0x5acb81['id']][_0x3539('0x1f')])){if(moment()[_0x3539('0x20')](accountsTokens[_0x5acb81['id']]['expires_in'])){_0x55accc(accountsTokens[_0x5acb81['id']][_0x3539('0x1f')]);}}var _0x1d0890;switch(_0x5acb81[_0x3539('0x21')]){case'US':_0x1d0890=_0x3539('0x22');break;case'AU':_0x1d0890=_0x3539('0x23');break;case'EU':_0x1d0890='https://accounts.zoho.eu';break;case'IN':_0x1d0890=_0x3539('0x24');break;case'CN':_0x1d0890=_0x3539('0x25');break;default:_0x1d0890=_0x3539('0x26');break;}var _0x2dee03={'method':'POST','uri':_0x1d0890+_0x3539('0x27'),'qs':{'refresh_token':_0x5acb81[_0x3539('0x28')],'client_id':_0x5acb81[_0x3539('0x29')],'client_secret':_0x5acb81[_0x3539('0x2a')],'grant_type':_0x3539('0x2b')},'json':!![]};return rp(_0x2dee03)[_0x3539('0x2c')](function(_0x4a5229){accountsTokens[_0x5acb81['id']]={'access_token':_0x4a5229[_0x3539('0x1f')],'expires_in':moment()['add'](_0x4a5229[_0x3539('0x2d')],_0x3539('0x2e'))};_0x55accc(_0x4a5229[_0x3539('0x1f')]);})[_0x3539('0x2f')](function(_0x117ae0){logger['error'](_0x3539('0x30'),_0x117ae0[_0x3539('0x31')]);_0x4bba4b(_0x117ae0);});});}function getUser(_0x150b31,_0x1cb0ca,_0x58df86,_0x2fd726){logger['info'](_0x3539('0x32'));return request({'method':_0x3539('0x33'),'uri':util[_0x3539('0x34')](_0x3539('0x35'),_0x1cb0ca),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x3539('0x36')+_0x150b31},'json':!![]})[_0x3539('0x2c')](function(_0xa38a5f){if(_0xa38a5f[_0x3539('0x37')]){var _0x5ef82d=-0x1;if(_[_0x3539('0x38')](_0xa38a5f[_0x3539('0x37')])){if(!_[_0x3539('0x1e')](_0x2fd726)){_0x5ef82d=_[_0x3539('0x39')](_0xa38a5f[_0x3539('0x37')],function(_0x5d8b4d){return _0x5d8b4d['email']===_0x2fd726;});}if(_0x5ef82d>=0x0){logger[_0x3539('0x3a')](_0x3539('0x3b'));}else{logger[_0x3539('0x3a')]('Using\x20the\x20admin\x20account!');_0x5ef82d=_[_0x3539('0x39')](_0xa38a5f[_0x3539('0x37')],function(_0x47e91d){return _0x47e91d['profile']['name']===_0x3539('0x3c');});}return _0xa38a5f['users'][_0x5ef82d];}else{if(_0xa38a5f[_0x3539('0x3d')]['profile'][_0x3539('0x1a')]===_0x3539('0x3c')){logger[_0x3539('0x3a')](_0x3539('0x3e'));user=_0xa38a5f['user'];return user;}else{logger[_0x3539('0x3f')](_0x3539('0x40'),JSON[_0x3539('0xd')](_0xa38a5f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0xa38a5f));}}}else{logger[_0x3539('0x3f')]('The\x20failing\x20result\x20is',JSON['stringify'](_0xa38a5f));throw new Error(_0x3539('0x41')+JSON[_0x3539('0xd')](_0xa38a5f));}})['catch'](function(_0x441696){console['error'](_0x441696);});}function getZohoUser(_0x1a7715,_0x5b09dd){return new BPromise(function(_0x315dc5,_0x4c348b){request(_0x1a7715)[_0x3539('0x2c')](function(_0x3a2293){var _0x28ff2e=null;if(_0x3a2293){_0x28ff2e=_0x3a2293[_0x3539('0x42')][0x0];_0x28ff2e['enduserType']=_0x5b09dd;}_0x315dc5(_0x28ff2e);})['catch'](function(_0x477c01){_0x4c348b(_0x477c01);});});}function createEndUser(_0xa59ef3,_0x286fe6,_0xa17e91,_0x2569a4,_0x490a2a,_0x35c33d){var _0xa17e91=getName(_0xa17e91);return request({'method':_0x3539('0x43'),'uri':_0x3539('0x44')+_0x286fe6+_0x3539('0x45')+_[_0x3539('0x46')](_0x35c33d['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xa17e91[0x1],'First_Name':_0xa17e91[0x0],'Phone':_0x2569a4,'Owner':{'name':!_[_0x3539('0x1e')](_0x490a2a[_0x3539('0x47')]['name'])?_0x490a2a['role'][_0x3539('0x1a')]:!_['isNil'](_0x490a2a[_0x3539('0x48')])?_0x490a2a[_0x3539('0x48')]+'\x20'+_0x490a2a['last_name']:_0x490a2a['last_name'],'id':_0x490a2a['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xa59ef3},'json':!![]})['then'](function(_0x2033ba){if(_0x2033ba&&_0x2033ba[_0x3539('0x42')][0x0]['code']===_0x3539('0x49')){var _0x15b70a=_0x2033ba[_0x3539('0x42')][0x0]['details'];_0x15b70a[_0x3539('0x4a')]=_[_0x3539('0x46')](_0x35c33d[_0x3539('0x4b')])+'s';return _0x15b70a;}logger['error'](_0x3539('0x40'),JSON[_0x3539('0xd')](data));throw new Error('Error:\x20'+JSON[_0x3539('0xd')](data));})[_0x3539('0x2f')](function(_0x2c6d61){console[_0x3539('0x4c')](_0x3539('0x4d'),_0x2c6d61);});}function getEndUser(_0x3ff84c,_0x3dcc49,_0x50bb54,_0x359b8b,_0x16461e,_0x58d9ac,_0x5f0187){var _0x3e81f7={'method':_0x3539('0x33'),'uri':'','headers':{'Authorization':_0x3539('0x36')+_0x3ff84c},'json':!![]};switch(_0x5f0187[_0x3539('0x4e')]){case'contact_lead':_0x3e81f7[_0x3539('0x4f')]=_0x3539('0x44')+_0x3dcc49+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x16461e+'))';return getZohoUser(_0x3e81f7,'Contacts')['then'](function(_0x1a9e75){if(_0x1a9e75)return _0x1a9e75;_0x3e81f7[_0x3539('0x4f')]=_0x3539('0x44')+_0x3dcc49+_0x3539('0x50')+_0x16461e+'))';return getZohoUser(_0x3e81f7,_0x3539('0x51'))[_0x3539('0x2c')](function(_0x30bae2){if(_0x30bae2)return _0x30bae2;if(_0x5f0187[_0x3539('0x4b')]!=_0x3539('0x52')){return createEndUser(_0x3ff84c,_0x3dcc49,_0x359b8b,_0x16461e,_0x58d9ac,_0x5f0187);}else{return{};}});});break;case _0x3539('0x53'):_0x3e81f7['uri']=_0x3539('0x44')+_0x3dcc49+_0x3539('0x54')+_0x16461e+'))';return getZohoUser(_0x3e81f7,_0x3539('0x55'))[_0x3539('0x2c')](function(_0x3c89a7){if(_0x3c89a7)return _0x3c89a7;if(_0x5f0187[_0x3539('0x4b')]!=_0x3539('0x52')){return createEndUser(_0x3ff84c,_0x3dcc49,_0x359b8b,_0x16461e,_0x58d9ac,_0x5f0187);}else{return{};}});break;case _0x3539('0x56'):_0x3e81f7['uri']=_0x3539('0x44')+_0x3dcc49+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x16461e+'))';return getZohoUser(_0x3e81f7,_0x3539('0x51'))[_0x3539('0x2c')](function(_0x6cb27c){if(_0x6cb27c)return _0x6cb27c;if(_0x5f0187[_0x3539('0x4b')]!='nothing'){return createEndUser(_0x3ff84c,_0x3dcc49,_0x359b8b,_0x16461e,_0x58d9ac,_0x5f0187);}else{return{};}});break;}}function getCall(_0x2e2b8d,_0x4ca6ba,_0x27f3a9,_0x4ff5c9,_0x37c1df,_0x1697b0,_0x250a0f,_0x5daf18){logger[_0x3539('0x3a')]('Creating\x20new\x20call...');var _0x4eecc4={};_0x4eecc4[_0x3539('0x57')]={'name':!_[_0x3539('0x1e')](_0x4ff5c9[_0x3539('0x47')][_0x3539('0x1a')])&&!_[_0x3539('0x1e')](_0x4ff5c9['profile'][_0x3539('0x1a')])&&_0x4ff5c9[_0x3539('0x58')]['name']===_0x3539('0x59')?_0x4ff5c9[_0x3539('0x47')][_0x3539('0x1a')]:!_[_0x3539('0x1e')](_0x4ff5c9[_0x3539('0x48')])?_0x4ff5c9[_0x3539('0x48')]+'\x20'+_0x4ff5c9['last_name']:_0x4ff5c9[_0x3539('0x5a')],'id':_0x4ff5c9['id']};_0x4eecc4[_0x3539('0x5b')]=intUtil['getString'](_0x1697b0[_0x3539('0x5c')],_0x250a0f,'\x20');_0x4eecc4['Description']=intUtil[_0x3539('0x5d')](_0x1697b0[_0x3539('0x5e')],_0x250a0f,'\x0a');if(_0x37c1df['enduserType']===_0x3539('0x55')){_0x4eecc4[_0x3539('0x5f')]={'name':!_[_0x3539('0x1e')](_0x37c1df['Full_Name'])?_0x37c1df[_0x3539('0x60')]:!_[_0x3539('0x1e')](_0x37c1df[_0x3539('0x61')])?_0x37c1df[_0x3539('0x61')]+'\x20'+_0x37c1df['Last_Name']:_0x37c1df[_0x3539('0x62')],'id':_0x37c1df['id']};}if(_0x37c1df[_0x3539('0x4a')]==='Leads'){_0x4eecc4[_0x3539('0x63')]={'name':!_[_0x3539('0x1e')](_0x37c1df[_0x3539('0x60')])?_0x37c1df[_0x3539('0x60')]:!_[_0x3539('0x1e')](_0x37c1df[_0x3539('0x61')])?_0x37c1df[_0x3539('0x61')]+'\x20'+_0x37c1df[_0x3539('0x62')]:_0x37c1df['Last_Name'],'id':_0x37c1df['id']};_0x4eecc4[_0x3539('0x64')]=_[_0x3539('0x46')](_0x37c1df[_0x3539('0x4a')]);}if(_0x250a0f[_0x3539('0x65')]){_0x4eecc4[_0x3539('0x66')]=moment[_0x3539('0x67')](parseInt(_0x250a0f[_0x3539('0x65')])*0x3e8)['format'](_0x3539('0x68'));}else if(_0x250a0f[_0x3539('0x69')]&&_0x250a0f[_0x3539('0x6a')]){_0x4eecc4['Call_Duration']=moment[_0x3539('0x67')](moment(_0x250a0f[_0x3539('0x6a')],'YYYY-MM-DDTHH:mm:ss')[_0x3539('0x6b')](moment(_0x250a0f[_0x3539('0x6c')],_0x3539('0x6d'))))[_0x3539('0x34')]('mm:ss');}switch(_0x250a0f[_0x3539('0x6e')]){case'called':_0x4eecc4[_0x3539('0x6f')]=_0x3539('0x70');break;case _0x3539('0x71'):case'connect':_0x4eecc4[_0x3539('0x6f')]=_0x3539('0x72');break;case _0x3539('0x73'):_0x4eecc4[_0x3539('0x6f')]=_0x3539('0x74');break;case'abandoned':_0x4eecc4[_0x3539('0x6f')]=_0x3539('0x75');break;case'timeout':_0x4eecc4[_0x3539('0x6f')]='Timeout';default:}_0x4eecc4[_0x3539('0x76')]=(_0x5daf18===_0x3539('0x77')?moment(_0x250a0f[_0x3539('0x6c')])[_0x3539('0x34')](_0x3539('0x6d')):moment(_0x250a0f[_0x3539('0x78')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x3539('0x34')](_0x3539('0x6d'));_0x4eecc4[_0x3539('0x79')]=_0x5daf18||'Inbound';_0x4eecc4=_['merge'](_0x4eecc4,getCustomFields(_0x1697b0['Fields'],_0x250a0f));return request({'method':_0x3539('0x43'),'uri':_0x3539('0x44')+_0x4ca6ba+_0x3539('0x7a'),'headers':{'Authorization':_0x3539('0x36')+_0x2e2b8d},'body':{'data':[_0x4eecc4]},'json':!![]})[_0x3539('0x2c')](function(_0x2aaff7){if(_0x2aaff7&&_0x2aaff7[_0x3539('0x42')][0x0][_0x3539('0x7b')]==='SUCCESS'){logger[_0x3539('0x3a')](_0x3539('0x7c'));return{'id':_0x2aaff7[_0x3539('0x42')][0x0][_0x3539('0x7d')]['id']};}})[_0x3539('0x2f')](function(_0x22800c){logger[_0x3539('0x3a')](_0x3539('0x7e'),_0x22800c['stack']);console[_0x3539('0x4c')]('err',_0x22800c);});}exports['queue']=function(_0x120250,_0x2e419a,_0x3e1558,_0x581224,_0x56ed40,_0x538f99){var _0x3040b8,_0x127330,_0x39cecd;_0x538f99['host']=intUtil['stripTrailingSlash'](_0x538f99[_0x3539('0x7f')]);_0x538f99[_0x3539('0x80')]=intUtil[_0x3539('0x81')](_0x538f99[_0x3539('0x80')]);if(_0x56ed40&&_0x56ed40[_0x3539('0x82')]){logger[_0x3539('0x3a')](_0x3539('0x83'),'Recording\x20is\x20enabled!');_0x2e419a[_0x3539('0x84')]=_0x538f99[_0x3539('0x80')]+'/api/voice/recordings/'+_0x2e419a[_0x3539('0x85')]+_0x3539('0x86')+md5(_0x2e419a[_0x3539('0x85')]);}else{_0x2e419a[_0x3539('0x84')]='';}var _0x9d29e1=_0x538f99[_0x3539('0x7f')]===_0x3539('0x87')?'eu':_0x3539('0x88');return getAccessToken(_0x538f99)['then'](function(_0x142d20){_0x39cecd=_0x142d20;return getUser(_0x39cecd,_0x9d29e1,_0x538f99,_0x581224[_0x3539('0x89')]);})[_0x3539('0x2c')](function(_0x4b5940){_0x3040b8=_0x4b5940;logger[_0x3539('0x3a')]('The\x20User\x20ID\x20is:',_0x3040b8['id']);return getEndUser(_0x39cecd,_0x9d29e1,_0x538f99,_0x2e419a[_0x3539('0x8a')],_0x2e419a[_0x3539('0x8b')],_0x3040b8,_0x3e1558);})[_0x3539('0x2c')](function(_0x256ddd){_0x127330=_0x256ddd;return getCall(_0x39cecd,_0x9d29e1,_0x538f99,_0x3040b8,_0x127330,_0x3e1558,_0x2e419a,_0x3539('0x8c'));})[_0x3539('0x2c')](function(_0x395f0e){if(_0x395f0e){logger[_0x3539('0x3a')](_0x3539('0x8d'),_0x395f0e['id']);logger[_0x3539('0x3a')](_0x3539('0x83'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x3539('0x8e'),_0x581224[_0x3539('0x1a')]),_0x3539('0x8f'),{'uri':_0x3539('0x90')+_0x538f99[_0x3539('0x7f')]+_0x3539('0x91')+_0x395f0e['id']});}})[_0x3539('0x2f')](function(_0x261eb3){logger[_0x3539('0x3f')](_0x3539('0x83'),JSON[_0x3539('0xd')](_0x261eb3));});};exports[_0x3539('0x77')]=function(_0x3d2674,_0x2b5c75,_0x3479a9,_0x3fe78a,_0x511c68,_0x473538,_0x4ae832){var _0x3c73ab,_0x54f020,_0x2d7781;_0x473538['host']=intUtil[_0x3539('0x81')](_0x473538[_0x3539('0x7f')]);_0x473538[_0x3539('0x80')]=intUtil[_0x3539('0x81')](_0x473538['serverUrl']);if(_0x4ae832&&_0x4ae832[_0x3539('0x92')]&&_0x4ae832['recordingFormat']!==_0x3539('0x93')){logger[_0x3539('0x3a')](_0x3539('0x94'),_0x3539('0x95'));_0x2b5c75[_0x3539('0x84')]=_0x473538[_0x3539('0x80')]+'/api/voice/recordings/'+_0x2b5c75[_0x3539('0x85')]+_0x3539('0x86')+md5(_0x2b5c75['uniqueid']);}var _0x5b67c7=_0x473538[_0x3539('0x7f')]==='zoho.eu'?'eu':_0x3539('0x88');return getAccessToken(_0x473538)[_0x3539('0x2c')](function(_0x5f3dcc){_0x2d7781=_0x5f3dcc;return getUser(_0x2d7781,_0x5b67c7,_0x473538,_0x3fe78a[_0x3539('0x89')]);})[_0x3539('0x2c')](function(_0x505132){_0x3c73ab=_0x505132;logger[_0x3539('0x3a')](_0x3539('0x96'),_0x3c73ab['id']);return getEndUser(_0x2d7781,_0x5b67c7,_0x473538,_0x2b5c75['destcalleridname'],_0x2b5c75['destcalleridnum'],_0x3c73ab,_0x3479a9);})['then'](function(_0x5ce320){_0x54f020=_0x5ce320;return getCall(_0x2d7781,_0x5b67c7,_0x473538,_0x3c73ab,_0x54f020,_0x3479a9,_0x2b5c75,_0x3539('0x97'));})[_0x3539('0x2c')](function(_0x2f5148){if(_0x2f5148){logger[_0x3539('0x3a')](_0x3539('0x8d'),_0x2f5148['id']);logger[_0x3539('0x3a')]('[OUTBOUND]',_0x3539('0x98'));emit(util[_0x3539('0x34')](_0x3539('0x8e'),_0x3fe78a[_0x3539('0x1a')]),_0x3539('0x8f'),{'uri':'https://crm.'+_0x473538[_0x3539('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2f5148['id']});}})['catch'](function(_0x56ba15){logger[_0x3539('0x3f')](_0x3539('0x94'),JSON[_0x3539('0xd')](_0x56ba15));});};exports['unmanaged']=function(_0x208b4b,_0x57d9d1,_0x5b548d,_0x86a861,_0x10ae91,_0x2f2166){var _0x1c759d,_0x2d58b,_0x120e91;_0x2f2166['host']=intUtil[_0x3539('0x81')](_0x2f2166['host']);_0x2f2166[_0x3539('0x80')]=intUtil[_0x3539('0x81')](_0x2f2166[_0x3539('0x80')]);if(_0x10ae91&&_0x10ae91['monitor_format']){logger[_0x3539('0x3a')]('['+_0x57d9d1[_0x3539('0x6e')][_0x3539('0x99')]()+']',_0x3539('0x95'));_0x57d9d1[_0x3539('0x84')]=_0x2f2166[_0x3539('0x80')]+_0x3539('0x9a')+_0x57d9d1['uniqueid']+_0x3539('0x86')+md5(_0x57d9d1[_0x3539('0x85')]);}else{_0x57d9d1[_0x3539('0x84')]='';}var _0x55a837=_0x2f2166[_0x3539('0x7f')]===_0x3539('0x87')?'eu':'com';return getAccessToken(_0x2f2166)[_0x3539('0x2c')](function(_0x5da0b7){_0x120e91=_0x5da0b7;return getUser(_0x120e91,_0x55a837,_0x2f2166);})[_0x3539('0x2c')](function(_0x57e11d){_0x1c759d=_0x57e11d;logger[_0x3539('0x3a')]('The\x20User\x20ID\x20is:',_0x1c759d['id']);return getEndUser(_0x120e91,_0x55a837,_0x2f2166,_0x57d9d1[_0x3539('0x8a')],_0x57d9d1['calleridnum'],_0x1c759d,_0x5b548d);})[_0x3539('0x2c')](function(_0x5ead34){_0x2d58b=_0x5ead34;return getCall(_0x120e91,_0x55a837,_0x2f2166,_0x1c759d,_0x2d58b,_0x5b548d,_0x57d9d1,'Inbound');})[_0x3539('0x2c')](function(_0x28abc0){if(_0x28abc0){logger[_0x3539('0x3a')](_0x3539('0x8d'),_0x28abc0['id']);}})['catch'](function(_0x27fe6d){logger[_0x3539('0x3f')]('['+_0x57d9d1[_0x3539('0x6e')][_0x3539('0x99')]()+']',JSON[_0x3539('0xd')](_0x27fe6d));});}; \ No newline at end of file +var _0x8820=['Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','mm:ss','endtime','utc','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','complete','connect','Answered','rejected','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','Inbound','The\x20Call\x20ID\x20is:','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','calleridname','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','redis','defaults','localhost','emit','debug','[HTTP]','stringify','includes','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','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','POST','refreshToken','clientId','refresh_token','then','add','seconds','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Descriptions'];(function(_0x1f7cbe,_0x3295da){var _0x2f48b1=function(_0x40c54f){while(--_0x40c54f){_0x1f7cbe['push'](_0x1f7cbe['shift']());}};_0x2f48b1(++_0x3295da);}(_0x8820,0x16c));var _0x0882=function(_0x3c3529,_0x3d83b3){_0x3c3529=_0x3c3529-0x0;var _0x193dcd=_0x8820[_0x3c3529];return _0x193dcd;};'use strict';var _=require(_0x0882('0x0'));var rp=require('request-promise');var md5=require(_0x0882('0x1'));var util=require(_0x0882('0x2'));var intUtil=require(_0x0882('0x3'));var moment=require(_0x0882('0x4'));var Redis=require(_0x0882('0x5'));var BPromise=require(_0x0882('0x6'));var config=require('../../../../config/environment');var logger=require(_0x0882('0x7'))('zoho');config[_0x0882('0x8')]=_[_0x0882('0x9')](config[_0x0882('0x8')],{'host':_0x0882('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0882('0x8')]));function emit(_0x445602,_0x39efaf,_0x35a378){io['to'](_0x445602)[_0x0882('0xb')](_0x39efaf,_0x35a378);}function request(_0x1c56e9){logger[_0x0882('0xc')](_0x0882('0xd'),JSON[_0x0882('0xe')](_0x1c56e9));return rp(_0x1c56e9);}function getCustomFields(_0x2a4fa8,_0xe6fc44){var _0x3e6317={};if(_0x2a4fa8['length']>0x0){_['forEach'](_0x2a4fa8,function(_0xb1e3c6){if(_[_0x0882('0xf')](['string','picklist'],_0xb1e3c6[_0x0882('0x10')])&&_0xb1e3c6[_0x0882('0x11')]){_0x3e6317[_0xb1e3c6['idField']]=_0xb1e3c6[_0x0882('0x12')][_0x0882('0x13')]();}else if(_0xb1e3c6['type']===_0x0882('0x14')&&_0xb1e3c6[_0x0882('0x15')]&&_0xb1e3c6[_0x0882('0x11')]&&_0xe6fc44[_0xb1e3c6['variableName']]){_0x3e6317[_0xb1e3c6[_0x0882('0x11')]]=_0xe6fc44[_0xb1e3c6[_0x0882('0x15')]][_0x0882('0x13')]();}else if(_0xb1e3c6['type']===_0x0882('0x16')&&_0xb1e3c6[_0x0882('0x17')]&&_0xb1e3c6['Variable'][_0x0882('0x18')]&&_0xb1e3c6['idField']&&_0xe6fc44[_0xb1e3c6[_0x0882('0x17')][_0x0882('0x18')][_0x0882('0x19')]()]){_0x3e6317[_0xb1e3c6[_0x0882('0x11')]]=_0xe6fc44[_0xb1e3c6[_0x0882('0x17')][_0x0882('0x18')]['toLowerCase']()][_0x0882('0x13')]();}});}return _0x3e6317;}function getName(_0x940f69){if(_0x940f69['indexOf']('\x20')>0x0){var _0x377c39=_0x940f69[_0x0882('0x1a')](/ (.+)/);if(_0x377c39[0x1]){return _0x377c39;}}return[_0x940f69,_0x940f69];}var accountsTokens={};function getAccessToken(_0x330009){return new Promise(function(_0x5d26c1,_0x29f484){if(!_[_0x0882('0x1b')](accountsTokens[_0x330009['id']])&&!_['isNil'](accountsTokens[_0x330009['id']][_0x0882('0x1c')])){if(moment()[_0x0882('0x1d')](accountsTokens[_0x330009['id']][_0x0882('0x1e')])){_0x5d26c1(accountsTokens[_0x330009['id']][_0x0882('0x1c')]);}}var _0x29a994;switch(_0x330009[_0x0882('0x1f')]){case'US':_0x29a994=_0x0882('0x20');break;case'AU':_0x29a994=_0x0882('0x21');break;case'EU':_0x29a994='https://accounts.zoho.eu';break;case'IN':_0x29a994=_0x0882('0x22');break;case'CN':_0x29a994=_0x0882('0x23');break;default:_0x29a994='https://accounts.zoho.eu';break;}var _0xe029a={'method':_0x0882('0x24'),'uri':_0x29a994+'/oauth/v2/token','qs':{'refresh_token':_0x330009[_0x0882('0x25')],'client_id':_0x330009[_0x0882('0x26')],'client_secret':_0x330009['clientSecret'],'grant_type':_0x0882('0x27')},'json':!![]};return rp(_0xe029a)[_0x0882('0x28')](function(_0x23301d){accountsTokens[_0x330009['id']]={'access_token':_0x23301d[_0x0882('0x1c')],'expires_in':moment()[_0x0882('0x29')](_0x23301d[_0x0882('0x1e')],_0x0882('0x2a'))};_0x5d26c1(_0x23301d[_0x0882('0x1c')]);})['catch'](function(_0x5014fd){logger[_0x0882('0x2b')]('Failing\x20creating\x20the\x20access_token',_0x5014fd[_0x0882('0x2c')]);_0x29f484(_0x5014fd);});});}function getUser(_0x52e85b,_0x301325,_0x2da0af,_0x109596){logger[_0x0882('0x2d')](_0x0882('0x2e'));return request({'method':_0x0882('0x2f'),'uri':util[_0x0882('0x30')](_0x0882('0x31'),_0x301325),'qs':{'type':_0x0882('0x32')},'headers':{'Authorization':_0x0882('0x33')+_0x52e85b},'json':!![]})[_0x0882('0x28')](function(_0x50f9b9){if(_0x50f9b9[_0x0882('0x34')]){var _0xaac35f=-0x1;if(_[_0x0882('0x35')](_0x50f9b9['users'])){if(!_['isNil'](_0x109596)){_0xaac35f=_['findIndex'](_0x50f9b9[_0x0882('0x34')],function(_0x379b66){return _0x379b66[_0x0882('0x36')]===_0x109596;});}if(_0xaac35f>=0x0){logger[_0x0882('0x2d')]('Agent\x20found!');}else{logger[_0x0882('0x2d')](_0x0882('0x37'));_0xaac35f=_['findIndex'](_0x50f9b9[_0x0882('0x34')],function(_0x9bd443){return _0x9bd443[_0x0882('0x38')][_0x0882('0x18')]===_0x0882('0x39');});}return _0x50f9b9['users'][_0xaac35f];}else{if(_0x50f9b9[_0x0882('0x3a')]['profile'][_0x0882('0x18')]===_0x0882('0x39')){logger[_0x0882('0x2d')]('Using\x20the\x20admin\x20account!');user=_0x50f9b9[_0x0882('0x3a')];return user;}else{logger['error'](_0x0882('0x3b'),JSON['stringify'](_0x50f9b9));throw new Error(_0x0882('0x3c')+JSON[_0x0882('0xe')](_0x50f9b9));}}}else{logger[_0x0882('0x2b')](_0x0882('0x3b'),JSON[_0x0882('0xe')](_0x50f9b9));throw new Error(_0x0882('0x3c')+JSON[_0x0882('0xe')](_0x50f9b9));}})[_0x0882('0x3d')](function(_0x2b26c2){console['error'](_0x2b26c2);});}function getZohoUser(_0x35db7e,_0x5c9e5c){return new BPromise(function(_0x1e8657,_0x405e86){request(_0x35db7e)[_0x0882('0x28')](function(_0x28fc48){var _0x340730=null;if(_0x28fc48){_0x340730=_0x28fc48[_0x0882('0x3e')][0x0];_0x340730[_0x0882('0x3f')]=_0x5c9e5c;}_0x1e8657(_0x340730);})[_0x0882('0x3d')](function(_0x30a8fa){_0x405e86(_0x30a8fa);});});}function createEndUser(_0x3422c9,_0x4cb15b,_0x3cde1a,_0x7dc271,_0x41a56b,_0x580ff9){var _0x3cde1a=getName(_0x3cde1a);return request({'method':'POST','uri':_0x0882('0x40')+_0x4cb15b+_0x0882('0x41')+_[_0x0882('0x42')](_0x580ff9['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3cde1a[0x1],'First_Name':_0x3cde1a[0x0],'Phone':_0x7dc271,'Owner':{'name':!_[_0x0882('0x1b')](_0x41a56b['role'][_0x0882('0x18')])?_0x41a56b[_0x0882('0x43')][_0x0882('0x18')]:!_[_0x0882('0x1b')](_0x41a56b[_0x0882('0x44')])?_0x41a56b[_0x0882('0x44')]+'\x20'+_0x41a56b['last_name']:_0x41a56b[_0x0882('0x45')],'id':_0x41a56b['id']}}]},'headers':{'Authorization':_0x0882('0x33')+_0x3422c9},'json':!![]})[_0x0882('0x28')](function(_0x4505b){if(_0x4505b&&_0x4505b[_0x0882('0x3e')][0x0][_0x0882('0x46')]===_0x0882('0x47')){var _0x5b7a3a=_0x4505b[_0x0882('0x3e')][0x0][_0x0882('0x48')];_0x5b7a3a[_0x0882('0x3f')]=_[_0x0882('0x42')](_0x580ff9[_0x0882('0x49')])+'s';return _0x5b7a3a;}logger[_0x0882('0x2b')](_0x0882('0x3b'),JSON['stringify'](data));throw new Error(_0x0882('0x4a')+JSON[_0x0882('0xe')](data));})[_0x0882('0x3d')](function(_0x4748e7){console[_0x0882('0x4b')](_0x0882('0x4c'),_0x4748e7);});}function getEndUser(_0x1bfd6b,_0x11155d,_0x4b3f0e,_0x16dc4f,_0x19f8c6,_0x4e4f7b,_0x2d86dd){var _0x19c367={'method':_0x0882('0x2f'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1bfd6b},'json':!![]};switch(_0x2d86dd[_0x0882('0x4d')]){case _0x0882('0x4e'):_0x19c367['uri']=_0x0882('0x40')+_0x11155d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x19f8c6+'))';return getZohoUser(_0x19c367,_0x0882('0x4f'))[_0x0882('0x28')](function(_0x2a025c){if(_0x2a025c)return _0x2a025c;_0x19c367[_0x0882('0x50')]='https://www.zohoapis.'+_0x11155d+_0x0882('0x51')+_0x19f8c6+'))';return getZohoUser(_0x19c367,_0x0882('0x52'))[_0x0882('0x28')](function(_0x2a5aee){if(_0x2a5aee)return _0x2a5aee;if(_0x2d86dd['moduleCreate']!='nothing'){return createEndUser(_0x1bfd6b,_0x11155d,_0x16dc4f,_0x19f8c6,_0x4e4f7b,_0x2d86dd);}else{return{};}});});break;case'contact':_0x19c367[_0x0882('0x50')]=_0x0882('0x40')+_0x11155d+_0x0882('0x53')+_0x19f8c6+'))';return getZohoUser(_0x19c367,_0x0882('0x4f'))['then'](function(_0x304ac){if(_0x304ac)return _0x304ac;if(_0x2d86dd[_0x0882('0x49')]!=_0x0882('0x54')){return createEndUser(_0x1bfd6b,_0x11155d,_0x16dc4f,_0x19f8c6,_0x4e4f7b,_0x2d86dd);}else{return{};}});break;case _0x0882('0x55'):_0x19c367['uri']=_0x0882('0x40')+_0x11155d+_0x0882('0x51')+_0x19f8c6+'))';return getZohoUser(_0x19c367,'Leads')[_0x0882('0x28')](function(_0x4a84ee){if(_0x4a84ee)return _0x4a84ee;if(_0x2d86dd['moduleCreate']!=_0x0882('0x54')){return createEndUser(_0x1bfd6b,_0x11155d,_0x16dc4f,_0x19f8c6,_0x4e4f7b,_0x2d86dd);}else{return{};}});break;}}function getCall(_0x486ccb,_0x455c00,_0x43bf05,_0x3487a5,_0x4c45a7,_0xb4b0e7,_0x20a39a,_0xee2e55){logger[_0x0882('0x2d')](_0x0882('0x56'));var _0x53475f={};_0x53475f[_0x0882('0x57')]={'name':!_[_0x0882('0x1b')](_0x3487a5['role'][_0x0882('0x18')])&&!_[_0x0882('0x1b')](_0x3487a5[_0x0882('0x38')]['name'])&&_0x3487a5[_0x0882('0x38')][_0x0882('0x18')]===_0x0882('0x58')?_0x3487a5[_0x0882('0x43')][_0x0882('0x18')]:!_[_0x0882('0x1b')](_0x3487a5[_0x0882('0x44')])?_0x3487a5[_0x0882('0x44')]+'\x20'+_0x3487a5['last_name']:_0x3487a5[_0x0882('0x45')],'id':_0x3487a5['id']};_0x53475f['Subject']=intUtil[_0x0882('0x59')](_0xb4b0e7[_0x0882('0x5a')],_0x20a39a,'\x20');_0x53475f['Description']=intUtil[_0x0882('0x59')](_0xb4b0e7[_0x0882('0x5b')],_0x20a39a,'\x0a');if(_0x4c45a7[_0x0882('0x3f')]===_0x0882('0x4f')){_0x53475f[_0x0882('0x5c')]={'name':!_[_0x0882('0x1b')](_0x4c45a7[_0x0882('0x5d')])?_0x4c45a7['Full_Name']:!_['isNil'](_0x4c45a7['First_Name'])?_0x4c45a7['First_Name']+'\x20'+_0x4c45a7[_0x0882('0x5e')]:_0x4c45a7['Last_Name'],'id':_0x4c45a7['id']};}if(_0x4c45a7[_0x0882('0x3f')]==='Leads'){_0x53475f[_0x0882('0x5f')]={'name':!_[_0x0882('0x1b')](_0x4c45a7[_0x0882('0x5d')])?_0x4c45a7['Full_Name']:!_[_0x0882('0x1b')](_0x4c45a7[_0x0882('0x60')])?_0x4c45a7[_0x0882('0x60')]+'\x20'+_0x4c45a7['Last_Name']:_0x4c45a7['Last_Name'],'id':_0x4c45a7['id']};_0x53475f[_0x0882('0x61')]=_[_0x0882('0x42')](_0x4c45a7[_0x0882('0x3f')]);}if(_0x20a39a[_0x0882('0x62')]){_0x53475f[_0x0882('0x63')]=moment['utc'](parseInt(_0x20a39a['talktime'])*0x3e8)[_0x0882('0x30')](_0x0882('0x64'));}else if(_0x20a39a['answertime']&&_0x20a39a[_0x0882('0x65')]){_0x53475f[_0x0882('0x63')]=moment[_0x0882('0x66')](moment(_0x20a39a[_0x0882('0x65')],_0x0882('0x67'))['diff'](moment(_0x20a39a[_0x0882('0x68')],_0x0882('0x67'))))[_0x0882('0x30')](_0x0882('0x64'));}switch(_0x20a39a[_0x0882('0x69')]){case _0x0882('0x6a'):_0x53475f[_0x0882('0x6b')]='Called';break;case _0x0882('0x6c'):case _0x0882('0x6d'):_0x53475f[_0x0882('0x6b')]=_0x0882('0x6e');break;case _0x0882('0x6f'):_0x53475f[_0x0882('0x6b')]='Rejected';break;case _0x0882('0x70'):_0x53475f['Call_Result']='Abandoned';break;case _0x0882('0x71'):_0x53475f['Call_Result']=_0x0882('0x72');default:}_0x53475f[_0x0882('0x73')]=(_0xee2e55==='outbound'?moment(_0x20a39a[_0x0882('0x68')])['format'](_0x0882('0x67')):moment(_0x20a39a[_0x0882('0x74')])[_0x0882('0x30')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x0882('0x30')](_0x0882('0x67'));_0x53475f[_0x0882('0x75')]=_0xee2e55||'Inbound';_0x53475f=_[_0x0882('0x76')](_0x53475f,getCustomFields(_0xb4b0e7[_0x0882('0x77')],_0x20a39a));return request({'method':_0x0882('0x24'),'uri':_0x0882('0x40')+_0x455c00+_0x0882('0x78'),'headers':{'Authorization':_0x0882('0x33')+_0x486ccb},'body':{'data':[_0x53475f]},'json':!![]})[_0x0882('0x28')](function(_0x1fa34e){if(_0x1fa34e&&_0x1fa34e[_0x0882('0x3e')][0x0][_0x0882('0x46')]===_0x0882('0x47')){logger[_0x0882('0x2d')](_0x0882('0x79'));return{'id':_0x1fa34e['data'][0x0][_0x0882('0x48')]['id']};}})[_0x0882('0x3d')](function(_0xf07ad3){logger[_0x0882('0x2d')](_0x0882('0x7a'),_0xf07ad3['stack']);console[_0x0882('0x4b')](_0x0882('0x7a'),_0xf07ad3);});}exports[_0x0882('0x7b')]=function(_0x42017f,_0x207b2b,_0x34e8a0,_0x38adb5,_0x450a28,_0x25666a){var _0x506198,_0x37df03,_0x19fb5c;_0x25666a[_0x0882('0x7c')]=intUtil[_0x0882('0x7d')](_0x25666a[_0x0882('0x7c')]);_0x25666a['serverUrl']=intUtil[_0x0882('0x7d')](_0x25666a[_0x0882('0x7e')]);if(_0x450a28&&_0x450a28['monitor_format']){logger[_0x0882('0x2d')](_0x0882('0x7f'),_0x0882('0x80'));_0x207b2b[_0x0882('0x81')]=_0x25666a[_0x0882('0x7e')]+_0x0882('0x82')+_0x207b2b[_0x0882('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x207b2b[_0x0882('0x83')]);}else{_0x207b2b[_0x0882('0x81')]='';}var _0x103cdf=_0x25666a[_0x0882('0x7c')]===_0x0882('0x84')?'eu':_0x0882('0x85');return getAccessToken(_0x25666a)[_0x0882('0x28')](function(_0x29f812){_0x19fb5c=_0x29f812;return getUser(_0x19fb5c,_0x103cdf,_0x25666a,_0x38adb5[_0x0882('0x36')]);})[_0x0882('0x28')](function(_0x93292b){_0x506198=_0x93292b;logger[_0x0882('0x2d')](_0x0882('0x86'),_0x506198['id']);return getEndUser(_0x19fb5c,_0x103cdf,_0x25666a,_0x207b2b['calleridname'],_0x207b2b[_0x0882('0x87')],_0x506198,_0x34e8a0);})[_0x0882('0x28')](function(_0x2d817e){_0x37df03=_0x2d817e;return getCall(_0x19fb5c,_0x103cdf,_0x25666a,_0x506198,_0x37df03,_0x34e8a0,_0x207b2b,_0x0882('0x88'));})[_0x0882('0x28')](function(_0xa934bb){if(_0xa934bb){logger[_0x0882('0x2d')](_0x0882('0x89'),_0xa934bb['id']);logger['info']('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x0882('0x8a'),_0x38adb5[_0x0882('0x18')]),'trigger:browser:url',{'uri':_0x0882('0x8b')+_0x25666a['host']+'/crm/EntityInfo.do?module=Calls&id='+_0xa934bb['id']});}})[_0x0882('0x3d')](function(_0x194c6b){logger['error'](_0x0882('0x7f'),JSON[_0x0882('0xe')](_0x194c6b));});};exports['outbound']=function(_0x95ed6a,_0x3a4847,_0x12a854,_0x196fd7,_0x4c9c11,_0x39ce90,_0x33a233){var _0x5f06ff,_0x23ec4e,_0x20c18e;_0x39ce90[_0x0882('0x7c')]=intUtil[_0x0882('0x7d')](_0x39ce90[_0x0882('0x7c')]);_0x39ce90[_0x0882('0x7e')]=intUtil[_0x0882('0x7d')](_0x39ce90['serverUrl']);if(_0x33a233&&_0x33a233[_0x0882('0x8c')]&&_0x33a233[_0x0882('0x8c')]!==_0x0882('0x8d')){logger[_0x0882('0x2d')](_0x0882('0x8e'),_0x0882('0x80'));_0x3a4847[_0x0882('0x81')]=_0x39ce90[_0x0882('0x7e')]+_0x0882('0x82')+_0x3a4847[_0x0882('0x83')]+_0x0882('0x8f')+md5(_0x3a4847[_0x0882('0x83')]);}var _0x328d2a=_0x39ce90[_0x0882('0x7c')]===_0x0882('0x84')?'eu':'com';return getAccessToken(_0x39ce90)[_0x0882('0x28')](function(_0x289d72){_0x20c18e=_0x289d72;return getUser(_0x20c18e,_0x328d2a,_0x39ce90,_0x196fd7[_0x0882('0x36')]);})[_0x0882('0x28')](function(_0x407727){_0x5f06ff=_0x407727;logger[_0x0882('0x2d')](_0x0882('0x86'),_0x5f06ff['id']);return getEndUser(_0x20c18e,_0x328d2a,_0x39ce90,_0x3a4847['destcalleridname'],_0x3a4847[_0x0882('0x90')],_0x5f06ff,_0x12a854);})[_0x0882('0x28')](function(_0x3979bd){_0x23ec4e=_0x3979bd;return getCall(_0x20c18e,_0x328d2a,_0x39ce90,_0x5f06ff,_0x23ec4e,_0x12a854,_0x3a4847,'Outbound');})[_0x0882('0x28')](function(_0x2d021e){if(_0x2d021e){logger[_0x0882('0x2d')](_0x0882('0x89'),_0x2d021e['id']);logger[_0x0882('0x2d')](_0x0882('0x8e'),_0x0882('0x91'));emit(util['format'](_0x0882('0x8a'),_0x196fd7['name']),_0x0882('0x92'),{'uri':_0x0882('0x8b')+_0x39ce90['host']+_0x0882('0x93')+_0x2d021e['id']});}})['catch'](function(_0x1f540e){logger[_0x0882('0x2b')]('[OUTBOUND]',JSON['stringify'](_0x1f540e));});};exports[_0x0882('0x94')]=function(_0x17afe5,_0x238294,_0x5208b1,_0x51b16d,_0x37b227,_0x1d91c5){var _0x54a59e,_0x3d4852,_0x357304;_0x1d91c5[_0x0882('0x7c')]=intUtil['stripTrailingSlash'](_0x1d91c5[_0x0882('0x7c')]);_0x1d91c5[_0x0882('0x7e')]=intUtil['stripTrailingSlash'](_0x1d91c5[_0x0882('0x7e')]);if(_0x37b227&&_0x37b227[_0x0882('0x95')]){logger['info']('['+_0x238294['lastevent'][_0x0882('0x96')]()+']',_0x0882('0x80'));_0x238294[_0x0882('0x81')]=_0x1d91c5[_0x0882('0x7e')]+'/api/voice/recordings/'+_0x238294['uniqueid']+_0x0882('0x8f')+md5(_0x238294[_0x0882('0x83')]);}else{_0x238294[_0x0882('0x81')]='';}var _0x2dd7fe=_0x1d91c5['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x1d91c5)['then'](function(_0x4dca80){_0x357304=_0x4dca80;return getUser(_0x357304,_0x2dd7fe,_0x1d91c5);})[_0x0882('0x28')](function(_0x482d9a){_0x54a59e=_0x482d9a;logger[_0x0882('0x2d')](_0x0882('0x86'),_0x54a59e['id']);return getEndUser(_0x357304,_0x2dd7fe,_0x1d91c5,_0x238294[_0x0882('0x97')],_0x238294[_0x0882('0x87')],_0x54a59e,_0x5208b1);})[_0x0882('0x28')](function(_0x51869a){_0x3d4852=_0x51869a;return getCall(_0x357304,_0x2dd7fe,_0x1d91c5,_0x54a59e,_0x3d4852,_0x5208b1,_0x238294,'Inbound');})[_0x0882('0x28')](function(_0x1cbfec){if(_0x1cbfec){logger[_0x0882('0x2d')](_0x0882('0x89'),_0x1cbfec['id']);}})[_0x0882('0x3d')](function(_0x548214){logger[_0x0882('0x2b')]('['+_0x238294[_0x0882('0x69')][_0x0882('0x96')]()+']',JSON[_0x0882('0xe')](_0x548214));});}; \ 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 a0493a8..f2a21a8 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 _0x6fa4=['util','shelljs','mustache','../../../../config/logger','data2','Script','data3','render','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x6fa4,0xe4));var _0x46fa=function(_0x18941c,_0x1744c4){_0x18941c=_0x18941c-0x0;var _0x150409=_0x6fa4[_0x18941c];return _0x150409;};'use strict';var util=require(_0x46fa('0x0'));var sh=require(_0x46fa('0x1'));var Mustache=require(_0x46fa('0x2'));var logger=require(_0x46fa('0x3'))('trigger');exports['exec']=function(_0x585a06,_0x372c82){var _0x43e3f1=_0x585a06[_0x46fa('0x4')]?_0x585a06[_0x46fa('0x4')]:_0x46fa('0x5');var _0xbd640e=_0x585a06[_0x46fa('0x6')]?Mustache[_0x46fa('0x7')](_0x585a06['data3'],_0x372c82):_0x372c82;sh['exec'](_0xbd640e,function(_0x11a71b,_0x5558c2,_0xd9e24a){if(_0x11a71b!==0x0){logger[_0x46fa('0x8')](util[_0x46fa('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x43e3f1,_0xbd640e,_0x11a71b,_0xd9e24a));}else{logger[_0x46fa('0xa')](util['format'](_0x46fa('0xb'),_0x43e3f1,_0xbd640e,_0x5558c2));}});}; \ No newline at end of file +var _0xcb86=['mustache','../../../../config/logger','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0xcb86,0x136));var _0x6cb8=function(_0x4fa9e4,_0xacadd8){_0x4fa9e4=_0x4fa9e4-0x0;var _0x4edc06=_0xcb86[_0x4fa9e4];return _0x4edc06;};'use strict';var util=require(_0x6cb8('0x0'));var sh=require(_0x6cb8('0x1'));var Mustache=require(_0x6cb8('0x2'));var logger=require(_0x6cb8('0x3'))('trigger');exports['exec']=function(_0x3ec85a,_0xa720f9){var _0x1d9f1e=_0x3ec85a[_0x6cb8('0x4')]?_0x3ec85a[_0x6cb8('0x4')]:_0x6cb8('0x5');var _0x3d9246=_0x3ec85a[_0x6cb8('0x6')]?Mustache['render'](_0x3ec85a['data3'],_0xa720f9):_0xa720f9;sh['exec'](_0x3d9246,function(_0x18e882,_0x4fdbf8,_0x19319e){if(_0x18e882!==0x0){logger[_0x6cb8('0x7')](util[_0x6cb8('0x8')](_0x6cb8('0x9'),_0x1d9f1e,_0x3d9246,_0x18e882,_0x19319e));}else{logger[_0x6cb8('0xa')](util[_0x6cb8('0x8')](_0x6cb8('0xb'),_0x1d9f1e,_0x3d9246,_0x4fdbf8));}});}; \ 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 e481e94..a767107 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 _0x9fab=['statusCode','name','message','util','lodash','mustache','trigger','data1','toUpperCase','number','data5','headers','data6','parse','error','stack','GET','DELETE','POST','PUT','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0xf617e6,_0x276a2e){var _0x1bba3e=function(_0xb9f5c2){while(--_0xb9f5c2){_0xf617e6['push'](_0xf617e6['shift']());}};_0x1bba3e(++_0x276a2e);}(_0x9fab,0x1ed));var _0xb9fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fab[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var util=require(_0xb9fa('0x0'));var _=require(_0xb9fa('0x1'));var Mustache=require(_0xb9fa('0x2'));var logger=require('../../../../config/logger')(_0xb9fa('0x3'));exports['exec']=function(_0xd91319,_0x2cb0b0){var _0x463785,_0x135757;var _0x2d52c6={'method':_0xd91319[_0xb9fa('0x4')][_0xb9fa('0x5')](),'uri':Mustache['render'](_0xd91319['data2'],_0x2cb0b0),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xd91319['data5'])===_0xb9fa('0x6')&&parseInt(_0xd91319['data5'])>=0x1&&parseInt(_0xd91319[_0xb9fa('0x7')])<=0xa?parseInt(_0xd91319['data5'])*0x3e8:0x5*0x3e8};try{_0x2d52c6[_0xb9fa('0x8')]=_0xd91319[_0xb9fa('0x9')]?JSON[_0xb9fa('0xa')](Mustache['render'](_0xd91319['data6'],_0x2cb0b0)):{};}catch(_0x5b9376){logger[_0xb9fa('0xb')](_0x5b9376[_0xb9fa('0xc')]);}switch(_0xd91319['data1'][_0xb9fa('0x5')]()){case _0xb9fa('0xd'):case _0xb9fa('0xe'):_0x463785=null;_0x2d52c6['qs']=_0x2cb0b0;break;case _0xb9fa('0xf'):case _0xb9fa('0x10'):if(_0xd91319['data7']){try{_0x463785=JSON[_0xb9fa('0xa')](Mustache[_0xb9fa('0x11')](_0xd91319['data7'],_0x2cb0b0));_0x2d52c6[_0xb9fa('0x12')]=_0x463785;}catch(_0x149f69){logger[_0xb9fa('0xb')](_0x149f69['stack']);logger[_0xb9fa('0xb')](_0xb9fa('0x13'));}}else{_0x463785=_0x2cb0b0;_0x2d52c6['body']=_0x463785;}break;}logger[_0xb9fa('0x14')](util['format'](_0xb9fa('0x15'),_0xd91319[_0xb9fa('0x4')],_0xd91319[_0xb9fa('0x16')],JSON[_0xb9fa('0x17')](_0x2d52c6)));rp(_0x2d52c6)[_0xb9fa('0x18')](function(_0x4d1ebb){_0x463785=!_[_0xb9fa('0x19')](_0x463785)?_0xb9fa('0x1a')+_0x463785:'';_0x135757=typeof _0x4d1ebb[_0xb9fa('0x12')]===_0xb9fa('0x1b')?JSON[_0xb9fa('0x17')](_0x4d1ebb[_0xb9fa('0x12')]):_0x4d1ebb['body'];logger['info'](util[_0xb9fa('0x1c')](_0xb9fa('0x1d'),_0xd91319[_0xb9fa('0x4')],_0xd91319[_0xb9fa('0x16')],_0x4d1ebb['statusCode'],_0x135757));})[_0xb9fa('0x1e')](function(_0x3a8685){logger[_0xb9fa('0xb')](util[_0xb9fa('0x1c')](_0xb9fa('0x1f'),_0xd91319['data1'],_0xd91319[_0xb9fa('0x16')],_0x3a8685[_0xb9fa('0x20')],_0x3a8685[_0xb9fa('0x21')],_0x3a8685[_0xb9fa('0x22')]));});}; \ No newline at end of file +var _0x941d=['request-promise','util','lodash','trigger','exec','render','data5','headers','data6','parse','error','stack','data1','GET','DELETE','PUT','data7','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name'];(function(_0x2a98e3,_0x488997){var _0x370a71=function(_0x3b71cb){while(--_0x3b71cb){_0x2a98e3['push'](_0x2a98e3['shift']());}};_0x370a71(++_0x488997);}(_0x941d,0xc0));var _0xd941=function(_0x222c76,_0x2a472e){_0x222c76=_0x222c76-0x0;var _0xd7ff8d=_0x941d[_0x222c76];return _0xd7ff8d;};'use strict';var rp=require(_0xd941('0x0'));var util=require(_0xd941('0x1'));var _=require(_0xd941('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xd941('0x3'));exports[_0xd941('0x4')]=function(_0x1ad695,_0x3c2b7f){var _0x31f6de,_0x41936e;var _0x4334b2={'method':_0x1ad695['data1']['toUpperCase'](),'uri':Mustache[_0xd941('0x5')](_0x1ad695['data2'],_0x3c2b7f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1ad695[_0xd941('0x6')])==='number'&&parseInt(_0x1ad695[_0xd941('0x6')])>=0x1&&parseInt(_0x1ad695['data5'])<=0xa?parseInt(_0x1ad695[_0xd941('0x6')])*0x3e8:0x5*0x3e8};try{_0x4334b2[_0xd941('0x7')]=_0x1ad695[_0xd941('0x8')]?JSON[_0xd941('0x9')](Mustache['render'](_0x1ad695[_0xd941('0x8')],_0x3c2b7f)):{};}catch(_0x126a41){logger[_0xd941('0xa')](_0x126a41[_0xd941('0xb')]);}switch(_0x1ad695[_0xd941('0xc')]['toUpperCase']()){case _0xd941('0xd'):case _0xd941('0xe'):_0x31f6de=null;_0x4334b2['qs']=_0x3c2b7f;break;case'POST':case _0xd941('0xf'):if(_0x1ad695[_0xd941('0x10')]){try{_0x31f6de=JSON[_0xd941('0x9')](Mustache[_0xd941('0x5')](_0x1ad695[_0xd941('0x10')],_0x3c2b7f));_0x4334b2[_0xd941('0x11')]=_0x31f6de;}catch(_0x187485){logger[_0xd941('0xa')](_0x187485['stack']);logger[_0xd941('0xa')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x31f6de=_0x3c2b7f;_0x4334b2['body']=_0x31f6de;}break;}logger[_0xd941('0x12')](util['format'](_0xd941('0x13'),_0x1ad695[_0xd941('0xc')],_0x1ad695[_0xd941('0x14')],JSON['stringify'](_0x4334b2)));rp(_0x4334b2)[_0xd941('0x15')](function(_0x459c86){_0x31f6de=!_[_0xd941('0x16')](_0x31f6de)?_0xd941('0x17')+_0x31f6de:'';_0x41936e=typeof _0x459c86[_0xd941('0x11')]===_0xd941('0x18')?JSON[_0xd941('0x19')](_0x459c86[_0xd941('0x11')]):_0x459c86[_0xd941('0x11')];logger[_0xd941('0x12')](util[_0xd941('0x1a')](_0xd941('0x1b'),_0x1ad695['data1'],_0x1ad695[_0xd941('0x14')],_0x459c86[_0xd941('0x1c')],_0x41936e));})[_0xd941('0x1d')](function(_0x486ab6){logger[_0xd941('0xa')](util['format'](_0xd941('0x1e'),_0x1ad695['data1'],_0x1ad695['data2'],_0x486ab6[_0xd941('0x1c')],_0x486ab6[_0xd941('0x1f')],_0x486ab6['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4f48700..570fa07 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 _0xd933=['error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','debug','rpc'];(function(_0x5c1429,_0x5db7a9){var _0x161a71=function(_0x3bce2b){while(--_0x3bce2b){_0x5c1429['push'](_0x5c1429['shift']());}};_0x161a71(++_0x5db7a9);}(_0xd933,0x118));var _0x3d93=function(_0x54c777,_0x3136f4){_0x54c777=_0x54c777-0x0;var _0x17f9f0=_0xd933[_0x54c777];return _0x17f9f0;};'use strict';var jayson=require(_0x3d93('0x0'));var BPromise=require(_0x3d93('0x1'));var logger=require(_0x3d93('0x2'))(_0x3d93('0x3'));var client=jayson[_0x3d93('0x4')][_0x3d93('0x5')]({'port':0x2329});client['Request']=function(_0xf3594d,_0x425d37){return new BPromise(function(_0x1f2048,_0x2aa676){return client['request'](_0xf3594d,_0x425d37)['then'](function(_0x36eeb8){logger[_0x3d93('0x6')](_0x3d93('0x7'),'routing',_0xf3594d,_0x425d37,_0x36eeb8);if(_0x36eeb8['error']){logger[_0x3d93('0x8')](_0x3d93('0x7'),_0x3d93('0x3'),_0xf3594d,_0x36eeb8['error'][_0x3d93('0x9')],_0x425d37);return _0x2aa676(_0x36eeb8['error']['message']);}else{return _0x1f2048(_0x36eeb8[_0x3d93('0xa')]);}})['catch'](function(_0x542c4d){logger[_0x3d93('0x8')](_0x3d93('0x7'),'routing',_0xf3594d,_0x542c4d,_0x425d37);return _0x2aa676(_0x542c4d);});});};module[_0x3d93('0xb')]=client; \ No newline at end of file +var _0xc4f4=['bluebird','routing','http','Request','request','then','debug','rpc','error','message','result','catch','jayson/promise'];(function(_0x380c7f,_0x234003){var _0x57f3c2=function(_0x5b0848){while(--_0x5b0848){_0x380c7f['push'](_0x380c7f['shift']());}};_0x57f3c2(++_0x234003);}(_0xc4f4,0x192));var _0x4c4f=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc4f4[_0x5ddb1c];return _0x354adc;};'use strict';var jayson=require(_0x4c4f('0x0'));var BPromise=require(_0x4c4f('0x1'));var logger=require('../../config/logger')(_0x4c4f('0x2'));var client=jayson['client'][_0x4c4f('0x3')]({'port':0x2329});client[_0x4c4f('0x4')]=function(_0x48a866,_0x25e0b5){return new BPromise(function(_0x2f8205,_0x10b536){return client[_0x4c4f('0x5')](_0x48a866,_0x25e0b5)[_0x4c4f('0x6')](function(_0x2075a0){logger[_0x4c4f('0x7')](_0x4c4f('0x8'),'routing',_0x48a866,_0x25e0b5,_0x2075a0);if(_0x2075a0[_0x4c4f('0x9')]){logger[_0x4c4f('0x9')](_0x4c4f('0x8'),'routing',_0x48a866,_0x2075a0['error'][_0x4c4f('0xa')],_0x25e0b5);return _0x10b536(_0x2075a0[_0x4c4f('0x9')][_0x4c4f('0xa')]);}else{return _0x2f8205(_0x2075a0[_0x4c4f('0xb')]);}})[_0x4c4f('0xc')](function(_0x9d54b2){logger[_0x4c4f('0x9')]('rpc',_0x4c4f('0x2'),_0x48a866,_0x9d54b2,_0x25e0b5);return _0x10b536(_0x9d54b2);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index cb00198..c6529ab 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 _0x5d7d=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','initMailAccounts','refresh','catch','error','Email\x20service\x20initialization','./server'];(function(_0x480b08,_0x2fc855){var _0x4ab596=function(_0x55199a){while(--_0x55199a){_0x480b08['push'](_0x480b08['shift']());}};_0x4ab596(++_0x2fc855);}(_0x5d7d,0x68));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var server=require(_0xd5d7('0x0'));var Realtime=require(_0xd5d7('0x1'));var EmailChannel=require(_0xd5d7('0x2'));var mailAccount=require(_0xd5d7('0x3'));var setting=require(_0xd5d7('0x4'));var logger=require(_0xd5d7('0x5'))(_0xd5d7('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xd5d7('0x7')]()['then'](mailAccount[_0xd5d7('0x8')]())[_0xd5d7('0x9')](realtime[_0xd5d7('0xa')]())[_0xd5d7('0x9')](function(){email[_0xd5d7('0xb')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xd5d7('0x9')](function(){return initRealtime();})[_0xd5d7('0x9')](function(){return setting['getSettings']();})['then'](function(_0x769b37){return setInterval(initRealtime,_0x769b37['loginMailFrequency']*0x3e8);})[_0xd5d7('0xc')](function(_0x4080db){logger[_0xd5d7('0xd')](_0xd5d7('0xe'),_0x4080db);});}main(); \ No newline at end of file +var _0x790c=['./rpc/setting','../../config/logger','email','then','refresh','mailAccounts','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x790c,0x19d));var _0xc790=function(_0x3f94cc,_0x5754f5){_0x3f94cc=_0x3f94cc-0x0;var _0x3a68ef=_0x790c[_0x3f94cc];return _0x3a68ef;};'use strict';var server=require('./server');var Realtime=require(_0xc790('0x0'));var EmailChannel=require(_0xc790('0x1'));var mailAccount=require(_0xc790('0x2'));var setting=require(_0xc790('0x3'));var logger=require(_0xc790('0x4'))(_0xc790('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xc790('0x6')](mailAccount['getMailAccounts']())[_0xc790('0x6')](realtime['initMailAccounts']())[_0xc790('0x6')](function(){email[_0xc790('0x7')](realtime[_0xc790('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xc790('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xc790('0x9')]();})[_0xc790('0x6')](function(_0x2554fb){return setInterval(initRealtime,_0x2554fb[_0xc790('0xa')]*0x3e8);})[_0xc790('0xb')](function(_0x20ac41){logger['error'](_0xc790('0xc'),_0x20ac41);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 70b042f..d79cb2b 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 _0x07a8=['isNil','stringify','mailAccount:update','prototype','refresh','service','provider','custom','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','connected','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','info','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','then','verified','verify','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','status','messageStatus','Imap'];(function(_0x1151a7,_0x459964){var _0x4912cc=function(_0x1bc07a){while(--_0x1bc07a){_0x1151a7['push'](_0x1151a7['shift']());}};_0x4912cc(++_0x459964);}(_0x07a8,0x1a1));var _0x807a=function(_0x5961b0,_0x318a5f){_0x5961b0=_0x5961b0-0x0;var _0x29f94b=_0x07a8[_0x5961b0];return _0x29f94b;};'use strict';var _=require('lodash');var moment=require(_0x807a('0x0'));var BPromise=require(_0x807a('0x1'));var md5=require(_0x807a('0x2'));var Redis=require(_0x807a('0x3'));var config=require(_0x807a('0x4'));var logger=require(_0x807a('0x5'))(_0x807a('0x6'));config[_0x807a('0x7')]=_[_0x807a('0x8')](config['redis'],{'host':_0x807a('0x9'),'port':0x18eb});var io=require(_0x807a('0xa'))(new Redis(config[_0x807a('0x7')]));var EmailImap=require(_0x807a('0xb'));var EmailSmtp=require(_0x807a('0xc'));var mailAccount=require(_0x807a('0xd'));var md5Accounts={};function EmailChannel(_0x30f53e){logger['info'](_0x807a('0xe'));this['mailAccounts']=_0x30f53e[_0x807a('0xf')];this[_0x807a('0x10')]={};this[_0x807a('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0x807a('0x12')]=function(_0x583b94){var _0x4cbb4e=this[_0x807a('0xf')][_0x583b94];var _0x4356ca={'id':_0x4cbb4e['id'],'name':_0x4cbb4e['name'],'key':_0x4cbb4e[_0x807a('0x13')],'active':_0x4cbb4e[_0x807a('0x14')],'Imap':{'status':_0x4cbb4e['Imap'][_0x807a('0x15')],'messageStatus':_0x4cbb4e['Imap'][_0x807a('0x16')],'total':_0x4cbb4e[_0x807a('0x17')]['total']}};if(_[_0x807a('0x18')](md5Accounts[_0x583b94])){md5Accounts[_0x583b94]={};}var _0x391ef8=md5(JSON[_0x807a('0x19')](_0x4356ca));if(md5Accounts[_0x583b94]['md5']!==_0x391ef8){md5Accounts[_0x583b94][_0x807a('0x2')]=_0x391ef8;io['emit'](_0x807a('0x1a'),_0x4356ca);}};EmailChannel[_0x807a('0x1b')][_0x807a('0x1c')]=function(_0x4eec4d){for(var _0x50fdda in _0x4eec4d){if(_0x4eec4d['hasOwnProperty'](_0x50fdda)){if(_0x4eec4d[_0x50fdda][_0x807a('0x17')]&&_0x4eec4d[_0x50fdda][_0x807a('0x14')]){var _0x46107a=_0x4eec4d[_0x50fdda][_0x807a('0x17')];if(!_0x46107a[_0x807a('0x1d')]&&_0x4eec4d[_0x50fdda][_0x807a('0x1e')]!==_0x807a('0x1f'))_0x46107a[_0x807a('0x1d')]=_0x4eec4d[_0x50fdda][_0x807a('0x1e')];if(!this[_0x807a('0x10')][_0x807a('0x20')](_0x46107a['id'])){this['imapAccounts'][_0x46107a['id']]=new EmailImap(_0x46107a,_0x4eec4d[_0x50fdda][_0x807a('0x6')]);this[_0x807a('0x10')][_0x46107a['id']]['on'](_0x807a('0x21'),this[_0x807a('0x22')][_0x807a('0x23')](this,_0x50fdda));this[_0x807a('0x10')][_0x46107a['id']]['on'](_0x807a('0x6'),this[_0x807a('0x24')][_0x807a('0x23')](this,_0x50fdda));this[_0x807a('0x10')][_0x46107a['id']]['on'](_0x807a('0x25'),this[_0x807a('0x26')][_0x807a('0x23')](this,_0x50fdda));this[_0x807a('0x10')][_0x46107a['id']]['on'](_0x807a('0x27'),this['handleImapError'][_0x807a('0x23')](this,_0x50fdda));}}else{if(_[_0x807a('0x18')](this[_0x807a('0xf')][_0x50fdda][_0x807a('0x17')])){this[_0x807a('0xf')][_0x50fdda][_0x807a('0x17')]={};}this[_0x807a('0xf')][_0x50fdda][_0x807a('0x17')][_0x807a('0x15')]=_0x807a('0x28');this[_0x807a('0xf')][_0x50fdda][_0x807a('0x17')][_0x807a('0x16')]='';this[_0x807a('0x12')](_0x50fdda);}}}};EmailChannel[_0x807a('0x1b')]['handleImapBox']=function(_0x33846c,_0x21dd8a){if(this['mailAccounts'][_0x33846c]){this['mailAccounts'][_0x33846c][_0x807a('0x17')]['status']=_0x807a('0x29');this['mailAccounts'][_0x33846c][_0x807a('0x17')]['messageStatus']=_0x21dd8a[_0x807a('0x2a')];if(_0x21dd8a[_0x807a('0x2b')]){this['mailAccounts'][_0x33846c][_0x807a('0x17')]['total']=_0x21dd8a['messages'][_0x807a('0x2c')];}return this[_0x807a('0x12')](_0x33846c);}};EmailChannel[_0x807a('0x1b')]['handleImapEmail']=function(_0x1d5e2b,_0x321367){logger['info'](_0x807a('0x2d'),_0x321367[_0x807a('0x2e')],_0x321367[_0x807a('0x2f')],_0x321367[_0x807a('0x30')],_0x1d5e2b);if(this['mailAccounts'][_0x1d5e2b]){return mailAccount[_0x807a('0x31')](_0x1d5e2b,_0x321367)['then'](function(_0x96fb08){if(_0x96fb08){logger[_0x807a('0x32')]('Mail\x20accepted\x20from\x20routing');}})[_0x807a('0x33')](function(_0x17c4e8){logger['error'](_0x807a('0x34'),JSON['stringify'](_0x17c4e8));});}};EmailChannel[_0x807a('0x1b')]['handleImapEnd']=function(_0x4744b6){if(this['mailAccounts'][_0x4744b6]&&this['mailAccounts'][_0x4744b6]['Imap']){if(this[_0x807a('0x10')][this[_0x807a('0xf')][_0x4744b6][_0x807a('0x17')]['id']]){delete this[_0x807a('0x10')][this[_0x807a('0xf')][_0x4744b6][_0x807a('0x17')]['id']];}this['mailAccounts'][_0x4744b6][_0x807a('0x17')][_0x807a('0x35')]=moment();this[_0x807a('0x12')](_0x4744b6);}};EmailChannel[_0x807a('0x1b')][_0x807a('0x36')]=function(_0x362e9f,_0x46318e){if(this[_0x807a('0xf')][_0x362e9f]){this[_0x807a('0xf')][_0x362e9f]['Imap'][_0x807a('0x15')]=_0x807a('0x27');this[_0x807a('0xf')][_0x362e9f]['Imap'][_0x807a('0x16')]=_0x46318e;return this[_0x807a('0x12')](_0x362e9f);}};EmailChannel[_0x807a('0x1b')][_0x807a('0x37')]=function(_0x3d8fe9,_0x5c42b0){return this['smtp'][_0x807a('0x38')](_0x3d8fe9,_0x5c42b0);};EmailChannel['prototype'][_0x807a('0x39')]=function(_0x36f1d9){var _0x5c3716=this;if(this[_0x807a('0xf')][_0x36f1d9['id']]){if(_[_0x807a('0x18')](this[_0x807a('0xf')][_0x36f1d9['id']][_0x807a('0x3a')])){this['mailAccounts'][_0x36f1d9['id']]['Smtp']={};}this[_0x807a('0xf')][_0x36f1d9['id']][_0x807a('0x3a')]['lastSync']=moment();return new BPromise(function(_0xcb11c3,_0x597af3){return _0x5c3716[_0x807a('0x11')]['verify'](_0x36f1d9)[_0x807a('0x3b')](function(_0x3eddec){_0x5c3716[_0x807a('0xf')][_0x36f1d9['id']][_0x807a('0x3a')]['status']=_0x807a('0x3c');_0x5c3716[_0x807a('0xf')][_0x36f1d9['id']]['Smtp'][_0x807a('0x16')]='';_0x5c3716[_0x807a('0x12')](_0x36f1d9['id']);_0xcb11c3(_0x3eddec);})[_0x807a('0x33')](function(_0x8173e2){_0x5c3716[_0x807a('0xf')][_0x36f1d9['id']][_0x807a('0x3a')][_0x807a('0x15')]=_0x807a('0x27');_0x5c3716['mailAccounts'][_0x36f1d9['id']][_0x807a('0x3a')][_0x807a('0x16')]=_0x8173e2;_0x5c3716[_0x807a('0x12')](_0x36f1d9['id']);_0x597af3(_0x8173e2);});});}return this['smtp'][_0x807a('0x3d')](_0x36f1d9);};module[_0x807a('0x3e')]=EmailChannel; \ No newline at end of file +var _0xd7af=['info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','verified','verify','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','stringify','mailAccount:update','refresh','service','provider','custom','imapAccounts','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','connected','messages','total'];(function(_0xc2760c,_0x58d232){var _0x2903dc=function(_0x5f5126){while(--_0x5f5126){_0xc2760c['push'](_0xc2760c['shift']());}};_0x2903dc(++_0x58d232);}(_0xd7af,0xc9));var _0xfd7a=function(_0x118754,_0x5caabe){_0x118754=_0x118754-0x0;var _0x1955fb=_0xd7af[_0x118754];return _0x1955fb;};'use strict';var _=require(_0xfd7a('0x0'));var moment=require(_0xfd7a('0x1'));var BPromise=require(_0xfd7a('0x2'));var md5=require(_0xfd7a('0x3'));var Redis=require(_0xfd7a('0x4'));var config=require(_0xfd7a('0x5'));var logger=require(_0xfd7a('0x6'))('email');config[_0xfd7a('0x7')]=_[_0xfd7a('0x8')](config[_0xfd7a('0x7')],{'host':_0xfd7a('0x9'),'port':0x18eb});var io=require(_0xfd7a('0xa'))(new Redis(config[_0xfd7a('0x7')]));var EmailImap=require(_0xfd7a('0xb'));var EmailSmtp=require(_0xfd7a('0xc'));var mailAccount=require(_0xfd7a('0xd'));var md5Accounts={};function EmailChannel(_0x3aa610){logger['info'](_0xfd7a('0xe'));this[_0xfd7a('0xf')]=_0x3aa610[_0xfd7a('0xf')];this['imapAccounts']={};this[_0xfd7a('0x10')]=new EmailSmtp();}EmailChannel[_0xfd7a('0x11')][_0xfd7a('0x12')]=function(_0x2c3bb5){var _0x39e1d7=this['mailAccounts'][_0x2c3bb5];var _0x2f8d93={'id':_0x39e1d7['id'],'name':_0x39e1d7[_0xfd7a('0x13')],'key':_0x39e1d7[_0xfd7a('0x14')],'active':_0x39e1d7[_0xfd7a('0x15')],'Imap':{'status':_0x39e1d7['Imap'][_0xfd7a('0x16')],'messageStatus':_0x39e1d7[_0xfd7a('0x17')][_0xfd7a('0x18')],'total':_0x39e1d7[_0xfd7a('0x17')]['total']}};if(_['isNil'](md5Accounts[_0x2c3bb5])){md5Accounts[_0x2c3bb5]={};}var _0x4f31ce=md5(JSON[_0xfd7a('0x19')](_0x2f8d93));if(md5Accounts[_0x2c3bb5][_0xfd7a('0x3')]!==_0x4f31ce){md5Accounts[_0x2c3bb5][_0xfd7a('0x3')]=_0x4f31ce;io[_0xfd7a('0x12')](_0xfd7a('0x1a'),_0x2f8d93);}};EmailChannel[_0xfd7a('0x11')][_0xfd7a('0x1b')]=function(_0xd64fff){for(var _0x26ce12 in _0xd64fff){if(_0xd64fff['hasOwnProperty'](_0x26ce12)){if(_0xd64fff[_0x26ce12][_0xfd7a('0x17')]&&_0xd64fff[_0x26ce12][_0xfd7a('0x15')]){var _0x12ff3b=_0xd64fff[_0x26ce12][_0xfd7a('0x17')];if(!_0x12ff3b[_0xfd7a('0x1c')]&&_0xd64fff[_0x26ce12][_0xfd7a('0x1d')]!==_0xfd7a('0x1e'))_0x12ff3b[_0xfd7a('0x1c')]=_0xd64fff[_0x26ce12][_0xfd7a('0x1d')];if(!this[_0xfd7a('0x1f')][_0xfd7a('0x20')](_0x12ff3b['id'])){this[_0xfd7a('0x1f')][_0x12ff3b['id']]=new EmailImap(_0x12ff3b,_0xd64fff[_0x26ce12][_0xfd7a('0x21')]);this['imapAccounts'][_0x12ff3b['id']]['on'](_0xfd7a('0x22'),this[_0xfd7a('0x23')][_0xfd7a('0x24')](this,_0x26ce12));this[_0xfd7a('0x1f')][_0x12ff3b['id']]['on'](_0xfd7a('0x21'),this[_0xfd7a('0x25')]['bind'](this,_0x26ce12));this[_0xfd7a('0x1f')][_0x12ff3b['id']]['on'](_0xfd7a('0x26'),this[_0xfd7a('0x27')][_0xfd7a('0x24')](this,_0x26ce12));this[_0xfd7a('0x1f')][_0x12ff3b['id']]['on'](_0xfd7a('0x28'),this[_0xfd7a('0x29')][_0xfd7a('0x24')](this,_0x26ce12));}}else{if(_[_0xfd7a('0x2a')](this[_0xfd7a('0xf')][_0x26ce12][_0xfd7a('0x17')])){this[_0xfd7a('0xf')][_0x26ce12]['Imap']={};}this['mailAccounts'][_0x26ce12][_0xfd7a('0x17')][_0xfd7a('0x16')]=_0xfd7a('0x2b');this[_0xfd7a('0xf')][_0x26ce12][_0xfd7a('0x17')][_0xfd7a('0x18')]='';this['emit'](_0x26ce12);}}}};EmailChannel[_0xfd7a('0x11')][_0xfd7a('0x23')]=function(_0x19a420,_0x3f9a1a){if(this[_0xfd7a('0xf')][_0x19a420]){this[_0xfd7a('0xf')][_0x19a420][_0xfd7a('0x17')][_0xfd7a('0x16')]=_0xfd7a('0x2c');this[_0xfd7a('0xf')][_0x19a420][_0xfd7a('0x17')][_0xfd7a('0x18')]=_0x3f9a1a[_0xfd7a('0x13')];if(_0x3f9a1a[_0xfd7a('0x2d')]){this[_0xfd7a('0xf')][_0x19a420][_0xfd7a('0x17')][_0xfd7a('0x2e')]=_0x3f9a1a[_0xfd7a('0x2d')][_0xfd7a('0x2e')];}return this['emit'](_0x19a420);}};EmailChannel['prototype']['handleImapEmail']=function(_0x26a7b7,_0x5a420a){logger[_0xfd7a('0x2f')](_0xfd7a('0x30'),_0x5a420a['firstName'],_0x5a420a[_0xfd7a('0x31')],_0x5a420a[_0xfd7a('0x32')],_0x26a7b7);if(this[_0xfd7a('0xf')][_0x26a7b7]){return mailAccount[_0xfd7a('0x33')](_0x26a7b7,_0x5a420a)[_0xfd7a('0x34')](function(_0x4e8a82){if(_0x4e8a82){logger[_0xfd7a('0x2f')](_0xfd7a('0x35'));}})[_0xfd7a('0x36')](function(_0x278837){logger[_0xfd7a('0x28')](_0xfd7a('0x37'),JSON[_0xfd7a('0x19')](_0x278837));});}};EmailChannel['prototype'][_0xfd7a('0x27')]=function(_0xc6714f){if(this['mailAccounts'][_0xc6714f]&&this[_0xfd7a('0xf')][_0xc6714f][_0xfd7a('0x17')]){if(this[_0xfd7a('0x1f')][this['mailAccounts'][_0xc6714f][_0xfd7a('0x17')]['id']]){delete this[_0xfd7a('0x1f')][this[_0xfd7a('0xf')][_0xc6714f][_0xfd7a('0x17')]['id']];}this['mailAccounts'][_0xc6714f]['Imap']['lastSync']=moment();this['emit'](_0xc6714f);}};EmailChannel[_0xfd7a('0x11')]['handleImapError']=function(_0x4737b5,_0x31ca1d){if(this[_0xfd7a('0xf')][_0x4737b5]){this['mailAccounts'][_0x4737b5]['Imap'][_0xfd7a('0x16')]='error';this['mailAccounts'][_0x4737b5]['Imap'][_0xfd7a('0x18')]=_0x31ca1d;return this['emit'](_0x4737b5);}};EmailChannel['prototype'][_0xfd7a('0x38')]=function(_0x4510df,_0x59d918){return this[_0xfd7a('0x10')][_0xfd7a('0x39')](_0x4510df,_0x59d918);};EmailChannel[_0xfd7a('0x11')][_0xfd7a('0x3a')]=function(_0x41cd57){var _0x2f5d80=this;if(this[_0xfd7a('0xf')][_0x41cd57['id']]){if(_['isNil'](this[_0xfd7a('0xf')][_0x41cd57['id']]['Smtp'])){this[_0xfd7a('0xf')][_0x41cd57['id']][_0xfd7a('0x3b')]={};}this['mailAccounts'][_0x41cd57['id']][_0xfd7a('0x3b')]['lastSync']=moment();return new BPromise(function(_0x35b63b,_0x303cfe){return _0x2f5d80[_0xfd7a('0x10')]['verify'](_0x41cd57)[_0xfd7a('0x34')](function(_0xa98b){_0x2f5d80[_0xfd7a('0xf')][_0x41cd57['id']][_0xfd7a('0x3b')]['status']=_0xfd7a('0x3c');_0x2f5d80[_0xfd7a('0xf')][_0x41cd57['id']][_0xfd7a('0x3b')][_0xfd7a('0x18')]='';_0x2f5d80[_0xfd7a('0x12')](_0x41cd57['id']);_0x35b63b(_0xa98b);})[_0xfd7a('0x36')](function(_0x277dd6){_0x2f5d80['mailAccounts'][_0x41cd57['id']]['Smtp'][_0xfd7a('0x16')]=_0xfd7a('0x28');_0x2f5d80[_0xfd7a('0xf')][_0x41cd57['id']][_0xfd7a('0x3b')][_0xfd7a('0x18')]=_0x277dd6;_0x2f5d80[_0xfd7a('0x12')](_0x41cd57['id']);_0x303cfe(_0x277dd6);});});}return this[_0xfd7a('0x10')][_0xfd7a('0x3d')](_0x41cd57);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index bbb6709..69a27d2 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 _0x07e8=['UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','lodash','util','imap','simpleParser','Iconv','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','CloudProvider','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x07e8,0x10f));var _0x807e=function(_0x2f89a1,_0x5b95ea){_0x2f89a1=_0x2f89a1-0x0;var _0x166868=_0x07e8[_0x2f89a1];return _0x166868;};'use strict';var _=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var Imap=require(_0x807e('0x2'));var simpleParser=require('mailparser')[_0x807e('0x3')];var Iconv=require('iconv')[_0x807e('0x4')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0x807e('0x5'));var logger=require(_0x807e('0x6'))(_0x807e('0x7'));function EmailImap(_0x59981c,_0x5a768b){this[_0x807e('0x8')]=_0x807e('0x9');this[_0x807e('0xa')]=this[_0x807e('0xb')](_0x59981c,_0x5a768b);this['imap']=new Imap(this[_0x807e('0xa')]);this[_0x807e('0x2')][_0x807e('0xc')](_0x807e('0xd'),this[_0x807e('0xe')][_0x807e('0xf')](this));this[_0x807e('0x2')][_0x807e('0xc')](_0x807e('0x10'),this[_0x807e('0x11')][_0x807e('0xf')](this));this[_0x807e('0x2')]['on'](_0x807e('0x12'),this[_0x807e('0x13')]['bind'](this));this[_0x807e('0x2')][_0x807e('0x14')]();}util[_0x807e('0x15')](EmailImap,EventEmitter);EmailImap[_0x807e('0x16')][_0x807e('0xb')]=function(_0x46a368,_0x826454){var _0x4ee485={'connTimeout':_0x46a368['connTimeout']?_0x46a368[_0x807e('0x17')]*0x3e8:0x2710,'authTimeout':_0x46a368[_0x807e('0x18')]?_0x46a368[_0x807e('0x18')]*0x3e8:0x1388};if(_0x46a368[_0x807e('0x19')]){_0x4ee485['user']=_0x46a368[_0x807e('0x1a')];_0x4ee485[_0x807e('0x7')]=_0x826454||_0x46a368[_0x807e('0x1a')]||_0x807e('0x1b');if(_0x46a368[_0x807e('0x1c')]){_0x4ee485[_0x807e('0x1d')]=utils['generateXOAuth2Token'](_0x46a368[_0x807e('0x1e')]['data5'],_0x46a368[_0x807e('0x1a')]);}else{_0x4ee485[_0x807e('0x1f')]=_0x46a368[_0x807e('0x1f')];}}else{if(_0x46a368[_0x807e('0x20')]){_0x4ee485[_0x807e('0x1a')]=_0x46a368[_0x807e('0x1a')];_0x4ee485[_0x807e('0x1f')]=_0x46a368[_0x807e('0x1f')];}}_0x4ee485[_0x807e('0x21')]=_0x46a368['host'];_0x4ee485['port']=_0x46a368[_0x807e('0x22')]||0x3e1;if(_0x46a368[_0x807e('0x23')]){_0x4ee485[_0x807e('0x23')]=!![];}else{_0x4ee485[_0x807e('0x23')]=![];_0x4ee485[_0x807e('0x24')]=_0x807e('0x25');}return _0x4ee485;};EmailImap[_0x807e('0x16')][_0x807e('0xe')]=function(){this['imap'][_0x807e('0x26')](this[_0x807e('0x8')],![],this[_0x807e('0x27')][_0x807e('0xf')](this));};EmailImap[_0x807e('0x16')][_0x807e('0x27')]=function(_0x55f7c9,_0x277560){if(_0x55f7c9){this['handleError'](_0x55f7c9,!![]);}else{this[_0x807e('0x28')](_0x807e('0x29'),_0x277560);this[_0x807e('0x2a')]();}};EmailImap['prototype'][_0x807e('0x2b')]=function(_0xfe6cb6){if(_0xfe6cb6){this[_0x807e('0x13')](_0xfe6cb6,!![]);}else{this[_0x807e('0x2')][_0x807e('0x10')]();}};EmailImap[_0x807e('0x16')]['readUnseen']=function(){this[_0x807e('0x2')]['search']([_0x807e('0x2c')],this[_0x807e('0x2d')][_0x807e('0xf')](this));};EmailImap['prototype'][_0x807e('0x2d')]=function(_0x38f846,_0x5ae99f){if(_0x38f846){this[_0x807e('0x13')](_0x38f846,!![]);}else{if(_0x5ae99f[_0x807e('0x2e')]){try{var _0x57af90=this[_0x807e('0x2')][_0x807e('0x2f')](_0x5ae99f,{'bodies':'','markSeen':!![]});_0x57af90['on'](_0x807e('0x30'),this[_0x807e('0x31')][_0x807e('0xf')](this));_0x57af90[_0x807e('0xc')]('error',this['handleFetchError'][_0x807e('0xf')](this));_0x57af90[_0x807e('0xc')](_0x807e('0x10'),this[_0x807e('0x32')][_0x807e('0xf')](this));}catch(_0x4d066c){logger['error'](_0x4d066c);}}else{this[_0x807e('0x2')][_0x807e('0x33')](!![],this['handleCloseBox'][_0x807e('0xf')](this));}}};EmailImap[_0x807e('0x16')][_0x807e('0x31')]=function(_0x1532aa){_0x1532aa['on'](_0x807e('0x34'),this[_0x807e('0x35')][_0x807e('0xf')](this));_0x1532aa[_0x807e('0xc')](_0x807e('0x36'),this[_0x807e('0x37')]['bind'](this));_0x1532aa[_0x807e('0xc')](_0x807e('0x10'),this[_0x807e('0x38')]['bind'](this));};EmailImap[_0x807e('0x16')][_0x807e('0x35')]=function(_0x1230b9){simpleParser(_0x1230b9,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x807e('0x16')]['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x807e('0x38')]=function(){};EmailImap[_0x807e('0x16')][_0x807e('0x39')]=function(_0x293451,_0x3dcd43){if(_0x293451){logger[_0x807e('0x12')](_0x293451);}else{var _0x17c295=this;utils[_0x807e('0x3a')](this[_0x807e('0xa')],_0x3dcd43,function(_0x54caf3){_0x17c295['emit'](_0x807e('0x7'),_0x54caf3);});}};EmailImap['prototype'][_0x807e('0x32')]=function(){this[_0x807e('0x2')][_0x807e('0x33')](!![],this['handleCloseBox'][_0x807e('0xf')](this));};EmailImap[_0x807e('0x16')][_0x807e('0x3b')]=function(_0x160a5c){this['handleError'](_0x160a5c);this['imap'][_0x807e('0x33')](!![],this[_0x807e('0x2b')][_0x807e('0xf')](this));};EmailImap[_0x807e('0x16')]['handleEnd']=function(){this['emit'](_0x807e('0x10'));};EmailImap[_0x807e('0x16')][_0x807e('0x13')]=function(_0x226f9a,_0x2dbc79){logger[_0x807e('0x12')](_0x807e('0x13'),this[_0x807e('0xa')][_0x807e('0x7')],JSON[_0x807e('0x3c')](_0x226f9a));var _0x16d3b4='';if(_0x226f9a){if(_0x226f9a[_0x807e('0x3d')]){_0x16d3b4=_0x226f9a[_0x807e('0x3d')];}else{for(var _0x54900f in _0x226f9a){if(_0x226f9a[_0x807e('0x3e')](_0x54900f)){_0x16d3b4+=_['upperFirst'](_0x54900f)+':\x20'+_0x226f9a[_0x54900f]+'\x0a';}}}}if(_0x2dbc79){this[_0x807e('0x2')][_0x807e('0x10')]();}else{this['emit'](_0x807e('0x12'),_0x16d3b4);this[_0x807e('0x28')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x9f0e=['end','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','simpleParser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','ready','handleReady','bind','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','host','port','tls','autotls','required','openBox','handleOpenBox','emit','readUnseen','handleCloseBox'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3d6b07,_0x4adb76){_0x3d6b07=_0x3d6b07-0x0;var _0x275cf5=_0x9f0e[_0x3d6b07];return _0x275cf5;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var Imap=require(_0xe9f0('0x2'));var simpleParser=require(_0xe9f0('0x3'))[_0xe9f0('0x4')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0xe9f0('0x5'))[_0xe9f0('0x6')];var utils=require(_0xe9f0('0x7'));var logger=require(_0xe9f0('0x8'))(_0xe9f0('0x9'));function EmailImap(_0x50313d,_0x5b87c1){this[_0xe9f0('0xa')]=_0xe9f0('0xb');this[_0xe9f0('0xc')]=this['getAccount'](_0x50313d,_0x5b87c1);this[_0xe9f0('0x2')]=new Imap(this[_0xe9f0('0xc')]);this[_0xe9f0('0x2')][_0xe9f0('0xd')](_0xe9f0('0xe'),this[_0xe9f0('0xf')][_0xe9f0('0x10')](this));this[_0xe9f0('0x2')][_0xe9f0('0xd')]('end',this[_0xe9f0('0x11')][_0xe9f0('0x10')](this));this[_0xe9f0('0x2')]['on']('error',this[_0xe9f0('0x12')]['bind'](this));this[_0xe9f0('0x2')][_0xe9f0('0x13')]();}util[_0xe9f0('0x14')](EmailImap,EventEmitter);EmailImap[_0xe9f0('0x15')]['getAccount']=function(_0x2cf75d,_0x5a10c6){var _0x1e3ba8={'connTimeout':_0x2cf75d[_0xe9f0('0x16')]?_0x2cf75d[_0xe9f0('0x16')]*0x3e8:0x2710,'authTimeout':_0x2cf75d['authTimeout']?_0x2cf75d[_0xe9f0('0x17')]*0x3e8:0x1388};if(_0x2cf75d[_0xe9f0('0x18')]){_0x1e3ba8[_0xe9f0('0x19')]=_0x2cf75d['user'];_0x1e3ba8[_0xe9f0('0x9')]=_0x5a10c6||_0x2cf75d[_0xe9f0('0x19')]||_0xe9f0('0x1a');if(_0x2cf75d[_0xe9f0('0x1b')]){_0x1e3ba8[_0xe9f0('0x1c')]=utils[_0xe9f0('0x1d')](_0x2cf75d[_0xe9f0('0x1e')]['data5'],_0x2cf75d[_0xe9f0('0x19')]);}else{_0x1e3ba8[_0xe9f0('0x1f')]=_0x2cf75d[_0xe9f0('0x1f')];}}else{if(_0x2cf75d['authentication']){_0x1e3ba8[_0xe9f0('0x19')]=_0x2cf75d[_0xe9f0('0x19')];_0x1e3ba8[_0xe9f0('0x1f')]=_0x2cf75d[_0xe9f0('0x1f')];}}_0x1e3ba8['host']=_0x2cf75d[_0xe9f0('0x20')];_0x1e3ba8[_0xe9f0('0x21')]=_0x2cf75d['port']||0x3e1;if(_0x2cf75d['tls']){_0x1e3ba8['tls']=!![];}else{_0x1e3ba8[_0xe9f0('0x22')]=![];_0x1e3ba8[_0xe9f0('0x23')]=_0xe9f0('0x24');}return _0x1e3ba8;};EmailImap[_0xe9f0('0x15')][_0xe9f0('0xf')]=function(){this['imap'][_0xe9f0('0x25')](this[_0xe9f0('0xa')],![],this[_0xe9f0('0x26')][_0xe9f0('0x10')](this));};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x26')]=function(_0x37c0fc,_0x1321bb){if(_0x37c0fc){this[_0xe9f0('0x12')](_0x37c0fc,!![]);}else{this[_0xe9f0('0x27')]('box',_0x1321bb);this[_0xe9f0('0x28')]();}};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x29')]=function(_0x1a8478){if(_0x1a8478){this['handleError'](_0x1a8478,!![]);}else{this[_0xe9f0('0x2')][_0xe9f0('0x2a')]();}};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x28')]=function(){this[_0xe9f0('0x2')]['search']([_0xe9f0('0x2b')],this[_0xe9f0('0x2c')][_0xe9f0('0x10')](this));};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x2c')]=function(_0xd19788,_0x1d788a){if(_0xd19788){this[_0xe9f0('0x12')](_0xd19788,!![]);}else{if(_0x1d788a[_0xe9f0('0x2d')]){try{var _0x3dbe49=this[_0xe9f0('0x2')][_0xe9f0('0x2e')](_0x1d788a,{'bodies':'','markSeen':!![]});_0x3dbe49['on'](_0xe9f0('0x2f'),this[_0xe9f0('0x30')][_0xe9f0('0x10')](this));_0x3dbe49[_0xe9f0('0xd')](_0xe9f0('0x31'),this[_0xe9f0('0x32')][_0xe9f0('0x10')](this));_0x3dbe49[_0xe9f0('0xd')](_0xe9f0('0x2a'),this[_0xe9f0('0x33')][_0xe9f0('0x10')](this));}catch(_0x3611c0){logger['error'](_0x3611c0);}}else{this['imap']['closeBox'](!![],this[_0xe9f0('0x29')]['bind'](this));}}};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x30')]=function(_0x4d3bd6){_0x4d3bd6['on'](_0xe9f0('0x34'),this['handleMessageBody']['bind'](this));_0x4d3bd6['once'](_0xe9f0('0x35'),this[_0xe9f0('0x36')]['bind'](this));_0x4d3bd6[_0xe9f0('0xd')](_0xe9f0('0x2a'),this[_0xe9f0('0x37')]['bind'](this));};EmailImap['prototype'][_0xe9f0('0x38')]=function(_0x3ff42d){simpleParser(_0x3ff42d,{'Iconv':Iconv},this[_0xe9f0('0x39')]['bind'](this));};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x36')]=function(){};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x37')]=function(){};EmailImap[_0xe9f0('0x15')]['handleSimpleParser']=function(_0x2ab492,_0x3a2b23){if(_0x2ab492){logger[_0xe9f0('0x31')](_0x2ab492);}else{var _0x5a8c5a=this;utils[_0xe9f0('0x3a')](this[_0xe9f0('0xc')],_0x3a2b23,function(_0x4825f2){_0x5a8c5a[_0xe9f0('0x27')]('email',_0x4825f2);});}};EmailImap[_0xe9f0('0x15')]['handleFetchEnd']=function(){this['imap']['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xe9f0('0x15')][_0xe9f0('0x32')]=function(_0x2d8f93){this[_0xe9f0('0x12')](_0x2d8f93);this[_0xe9f0('0x2')][_0xe9f0('0x3b')](!![],this[_0xe9f0('0x29')][_0xe9f0('0x10')](this));};EmailImap[_0xe9f0('0x15')]['handleEnd']=function(){this[_0xe9f0('0x27')](_0xe9f0('0x2a'));};EmailImap[_0xe9f0('0x15')]['handleError']=function(_0x519035,_0x3cbf49){logger['error'](_0xe9f0('0x12'),this[_0xe9f0('0xc')][_0xe9f0('0x9')],JSON[_0xe9f0('0x3c')](_0x519035));var _0x4f1663='';if(_0x519035){if(_0x519035[_0xe9f0('0x3d')]){_0x4f1663=_0x519035[_0xe9f0('0x3d')];}else{for(var _0x43e971 in _0x519035){if(_0x519035[_0xe9f0('0x3e')](_0x43e971)){_0x4f1663+=_[_0xe9f0('0x3f')](_0x43e971)+':\x20'+_0x519035[_0x43e971]+'\x0a';}}}}if(_0x3cbf49){this['imap'][_0xe9f0('0x2a')]();}else{this[_0xe9f0('0x27')](_0xe9f0('0x31'),_0x4f1663);this[_0xe9f0('0x27')](_0xe9f0('0x2a'));}};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 f897705..e70917c 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 _0x15c9=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x15c9,0x116));var _0x915c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x15c9[_0x321bb2];return _0x9c12ed;};'use strict';var nodemailer=require(_0x915c('0x0'));var inlineBase64=require(_0x915c('0x1'));function EmailSmtp(){}EmailSmtp[_0x915c('0x2')][_0x915c('0x3')]=function(_0x1ccaa9,_0x3d89df){return new Promise(function(_0x4d910b,_0x5adfd0){var _0x31c28d=nodemailer[_0x915c('0x4')](_0x1ccaa9);_0x31c28d['use'](_0x915c('0x5'),inlineBase64());_0x31c28d[_0x915c('0x6')](_0x3d89df,function(_0xc98c9b,_0x3cb3c0){if(_0xc98c9b){_0x5adfd0(_0xc98c9b[_0x915c('0x7')]());}else{_0x4d910b(_0x3cb3c0);}});});};EmailSmtp['prototype']['verify']=function(_0x32a7d2){return new Promise(function(_0x49eea1,_0x21ac23){var _0x3769b7=nodemailer[_0x915c('0x4')](_0x32a7d2);_0x3769b7[_0x915c('0x8')](function(_0x209d1a,_0x228cb0){if(_0x209d1a){_0x21ac23(_0x209d1a[_0x915c('0x7')]());}else{if(_0x228cb0){_0x49eea1(_0x228cb0);}else{_0x21ac23(_0x915c('0x9'));}}});});};module[_0x915c('0xa')]=EmailSmtp; \ No newline at end of file +var _0xd412=['sendMail','toString','prototype','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','compile'];(function(_0x24a620,_0x44a35b){var _0x570531=function(_0x257208){while(--_0x257208){_0x24a620['push'](_0x24a620['shift']());}};_0x570531(++_0x44a35b);}(_0xd412,0x19f));var _0x2d41=function(_0x4e3843,_0x571529){_0x4e3843=_0x4e3843-0x0;var _0x2537db=_0xd412[_0x4e3843];return _0x2537db;};'use strict';var nodemailer=require(_0x2d41('0x0'));var inlineBase64=require(_0x2d41('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x2d41('0x2')]=function(_0x5d1e3c,_0x29c176){return new Promise(function(_0x2764d4,_0x25c868){var _0x14af89=nodemailer[_0x2d41('0x3')](_0x5d1e3c);_0x14af89['use'](_0x2d41('0x4'),inlineBase64());_0x14af89[_0x2d41('0x5')](_0x29c176,function(_0x517d3b,_0x2e7bea){if(_0x517d3b){_0x25c868(_0x517d3b[_0x2d41('0x6')]());}else{_0x2764d4(_0x2e7bea);}});});};EmailSmtp[_0x2d41('0x7')][_0x2d41('0x8')]=function(_0x123077){return new Promise(function(_0x1cfbbc,_0x56defc){var _0x3c17f8=nodemailer['createTransport'](_0x123077);_0x3c17f8[_0x2d41('0x8')](function(_0xb2b6fa,_0x3159a5){if(_0xb2b6fa){_0x56defc(_0xb2b6fa[_0x2d41('0x6')]());}else{if(_0x3159a5){_0x1cfbbc(_0x3159a5);}else{_0x56defc(_0x2d41('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 66d78ec..ec66122 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 _0x5fb8=['email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','length','slice','Anonymous','split','pop','isEmpty','generate','html','test','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','0x1?_0x49ec51[_0x85fb('0xe')](0x0,-0x1)['join']('\x20'):_0x28c268[_0x85fb('0xc')];}return _0x85fb('0xf');}function getLastName(_0x71479c){var _0x3c73a2=_[_0x85fb('0x7')](_0x71479c[_0x85fb('0x8')]);if(_0x3c73a2&&_0x3c73a2[_0x85fb('0xc')]){var _0x5837d1=_0x3c73a2[_0x85fb('0xc')][_0x85fb('0x10')](/\s+/);return _0x5837d1[_0x85fb('0xd')]>0x1?_0x5837d1[_0x85fb('0x11')]():'';}return'';}function getMails(_0x139a37,_0x1230c2){var _0x22f38b='';for(var _0x1273bf=0x0;_0x1273bf<_0x1230c2['value'][_0x85fb('0xd')];_0x1273bf+=0x1){if(_0x1230c2[_0x85fb('0x8')][_0x1273bf][_0x85fb('0x9')]!==_0x139a37){if(!_[_0x85fb('0x12')](_0x22f38b)){_0x22f38b+=',';}_0x22f38b+=_0x1230c2[_0x85fb('0x8')][_0x1273bf][_0x85fb('0xc')]||_0x1230c2[_0x85fb('0x8')][_0x1273bf][_0x85fb('0x9')]||'';_0x22f38b+='\x20<';_0x22f38b+=_0x1230c2[_0x85fb('0x8')][_0x1273bf][_0x85fb('0x9')]?_0x1230c2[_0x85fb('0x8')][_0x1273bf][_0x85fb('0x9')]:_0x85fb('0xa')+random[_0x85fb('0x13')](0x6)+_0x85fb('0xb');_0x22f38b+='>';}}return _0x22f38b;}function parseEmail(_0x53f72a,_0x340f7a,_0x5108d7){if(_0x340f7a[_0x85fb('0x14')]){var _0x4aac67=/)<[^<]*)*<\/script>/gi;while(_0x4aac67[_0x85fb('0x15')](_0x340f7a['html'])){_0x340f7a[_0x85fb('0x14')]=_0x340f7a[_0x85fb('0x14')][_0x85fb('0x16')](_0x4aac67,'');}if(_0x340f7a[_0x85fb('0x14')][_0x85fb('0x17')]('{_0x27a071[_0x85fb('0x1a')](_0x1c9256[_0x85fb('0x1b')]);});var _0x44c00d=/]+>/g;var _0x3fe5ef=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x32fd1f=_0x340f7a[_0x85fb('0x14')][_0x85fb('0x16')](_0x3fe5ef,_0x85fb('0x1c'));var _0x432211=_0x32fd1f[_0x85fb('0x16')](_0x44c00d,_0x85fb('0x1d'));for(let _0x1875c0=0x0;_0x1875c0<_0x27a071[_0x85fb('0xd')];_0x1875c0++){var _0x351bf6=_0x432211[_0x85fb('0x16')]('_IMG',_0x85fb('0x1e')+_0x27a071[_0x1875c0]+_0x85fb('0x1f'));_0x432211=_0x351bf6;}_0x340f7a['html']=_0x432211;}_0x5108d7['body']=_0x340f7a[_0x85fb('0x14')];}else{_0x5108d7['body']=_0x340f7a['textAsHtml'];}if(_0x5108d7[_0x85fb('0x20')]){_0x5108d7[_0x85fb('0x20')]=_0x5108d7[_0x85fb('0x20')]['replace'](/0x0){var _0x589cb0=['Auto-Submitted:\x20auto-replied',_0x85fb('0x32'),_0x85fb('0x33')];for(var _0xade544=0x0;_0xade544<_0x340f7a['headerLines'][_0x85fb('0xd')];_0xade544++){var _0x1242e3=_['indexOf'](_0x589cb0,_0x340f7a[_0x85fb('0x31')][_0xade544]['line']);if(_0x1242e3>=0x0){_0x5108d7[_0x85fb('0x34')]=!![];}}}return _0x5108d7;}exports[_0x85fb('0x35')]=function(_0x2d5d9a,_0x3bda0e,_0x1658a0){var _0x5e0d59={'from':getAddress(_0x3bda0e[_0x85fb('0x36')]),'firstName':getFirstName(_0x3bda0e[_0x85fb('0x36')]),'lastName':getLastName(_0x3bda0e[_0x85fb('0x36')]),'mapKey':_0x85fb('0x5'),'message':{'from':getMails(_0x2d5d9a['email'],_0x3bda0e[_0x85fb('0x36')]),'to':_0x2d5d9a[_0x85fb('0x5')],'cc':'','subject':_0x3bda0e[_0x85fb('0x37')]||'','messageId':_0x3bda0e['messageId'],'inReplyTo':_0x3bda0e[_0x85fb('0x38')],'sentAt':moment(_0x3bda0e[_0x85fb('0x39')])[_0x85fb('0x29')](_0x85fb('0x3a')),'attach':![],'attachments':[]}};if(!_0x3bda0e['html']&&!_0x3bda0e[_0x85fb('0x3b')]){var _0x211f14=_[_0x85fb('0x3c')](_0x3bda0e['attachments'],{'contentType':'application/ms-tnef'});if(_0x211f14['length']){logger[_0x85fb('0x3d')](util[_0x85fb('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x3bda0e['messageId']));tnef['parseBuffer'](_['first'](_0x211f14)[_0x85fb('0x2f')],function(_0x14d241,_0x36e498){if(_0x36e498){_0x3bda0e[_0x85fb('0x14')]=_0x36e498['BodyHTML']||'

Empty\x20message

';if(_0x36e498['Attachments']){for(var _0x3ae6f7=0x0;_0x3ae6f7<_0x36e498[_0x85fb('0x3e')]['length'];_0x3ae6f7++){var _0x619eb=_0x36e498['Attachments'][_0x3ae6f7];_0x5e0d59[_0x85fb('0x22')][_0x85fb('0x18')][_0x85fb('0x1a')]({'filename':_0x619eb['Title'],'content':Buffer[_0x85fb('0x36')](_0x619eb['Data'])});}}}_0x1658a0(parseEmail(_0x2d5d9a,_0x3bda0e,_0x5e0d59));});}else{_0x3bda0e[_0x85fb('0x14')]='

Empty\x20message

';_0x1658a0(parseEmail(_0x2d5d9a,_0x3bda0e,_0x5e0d59));}}else{_0x1658a0(parseEmail(_0x2d5d9a,_0x3bda0e,_0x5e0d59));}};exports[_0x85fb('0x3f')]=function(_0x31c3eb,_0xb5cf71){var _0x3440a1=[_0x85fb('0x40')+(_0xb5cf71||''),_0x85fb('0x41')+_0x31c3eb,'',''];return Buffer[_0x85fb('0x36')](_0x3440a1[_0x85fb('0x42')](''),'utf-8')[_0x85fb('0x43')](_0x85fb('0x44'));}; \ No newline at end of file +var _0xe049=['Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','indexOf','parser','from','messageId','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','lodash','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','substring','split','length','slice','join','isEmpty','html','test','replace','includes','','body','textAsHtml','0x1?_0x237042[_0x9e04('0x10')](0x0,-0x1)[_0x9e04('0x11')]('\x20'):_0x15bf72[_0x9e04('0xc')];}return'Anonymous';}function getLastName(_0x590fea){var _0xfd9bfc=_[_0x9e04('0x7')](_0x590fea[_0x9e04('0x8')]);if(_0xfd9bfc&&_0xfd9bfc[_0x9e04('0xc')]){var _0x129660=_0xfd9bfc[_0x9e04('0xc')][_0x9e04('0xe')](/\s+/);return _0x129660['length']>0x1?_0x129660['pop']():'';}return'';}function getMails(_0x14013a,_0x30e0ef){var _0xa3a7b8='';for(var _0x47ed6c=0x0;_0x47ed6c<_0x30e0ef[_0x9e04('0x8')]['length'];_0x47ed6c+=0x1){if(_0x30e0ef[_0x9e04('0x8')][_0x47ed6c][_0x9e04('0x9')]!==_0x14013a){if(!_[_0x9e04('0x12')](_0xa3a7b8)){_0xa3a7b8+=',';}_0xa3a7b8+=_0x30e0ef[_0x9e04('0x8')][_0x47ed6c][_0x9e04('0xc')]||_0x30e0ef[_0x9e04('0x8')][_0x47ed6c][_0x9e04('0x9')]||'';_0xa3a7b8+='\x20<';_0xa3a7b8+=_0x30e0ef['value'][_0x47ed6c][_0x9e04('0x9')]?_0x30e0ef[_0x9e04('0x8')][_0x47ed6c][_0x9e04('0x9')]:'anonymous'+random[_0x9e04('0xb')](0x6)+'@xcally.com';_0xa3a7b8+='>';}}return _0xa3a7b8;}function parseEmail(_0x268856,_0xa4776a,_0x5c3bc7){if(_0xa4776a[_0x9e04('0x13')]){var _0x21b4dc=/)<[^<]*)*<\/script>/gi;while(_0x21b4dc[_0x9e04('0x14')](_0xa4776a[_0x9e04('0x13')])){_0xa4776a[_0x9e04('0x13')]=_0xa4776a['html'][_0x9e04('0x15')](_0x21b4dc,'');}if(_0xa4776a[_0x9e04('0x13')][_0x9e04('0x16')](_0x9e04('0x17'))){var _0x50aa70=[];_0xa4776a[_0x9e04('0x18')][_0x9e04('0x19')](_0x4bc8d7=>{_0x50aa70[_0x9e04('0x1a')](_0x4bc8d7[_0x9e04('0x1b')]);});var _0x33dff5=/]+>/g;var _0x14bfc6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x58fd76=_0xa4776a[_0x9e04('0x13')][_0x9e04('0x15')](_0x14bfc6,'_SRC');var _0x537a8a=_0x58fd76[_0x9e04('0x15')](_0x33dff5,_0x9e04('0x1c'));for(let _0x2c16ad=0x0;_0x2c16ad<_0x50aa70['length'];_0x2c16ad++){var _0x335cde=_0x537a8a[_0x9e04('0x15')](_0x9e04('0x1c'),'\x20[Attachment:\x20'+_0x50aa70[_0x2c16ad]+_0x9e04('0x1d'));_0x537a8a=_0x335cde;}_0xa4776a[_0x9e04('0x13')]=_0x537a8a;}_0x5c3bc7[_0x9e04('0x1e')]=_0xa4776a[_0x9e04('0x13')];}else{_0x5c3bc7['body']=_0xa4776a[_0x9e04('0x1f')];}if(_0x5c3bc7[_0x9e04('0x1e')]){_0x5c3bc7[_0x9e04('0x1e')]=_0x5c3bc7[_0x9e04('0x1e')][_0x9e04('0x15')](/0x0){var _0xbfb12a=[_0x9e04('0x2c'),'X-Auto-Response-Suppress:\x20All',_0x9e04('0x2d')];for(var _0x1adced=0x0;_0x1adced<_0xa4776a[_0x9e04('0x2b')][_0x9e04('0xf')];_0x1adced++){var _0x280b06=_[_0x9e04('0x2e')](_0xbfb12a,_0xa4776a[_0x9e04('0x2b')][_0x1adced]['line']);if(_0x280b06>=0x0){_0x5c3bc7['isAutoreply']=!![];}}}return _0x5c3bc7;}exports[_0x9e04('0x2f')]=function(_0x59e7b6,_0x36cd3a,_0x23d1ef){var _0x5a9263={'from':getAddress(_0x36cd3a[_0x9e04('0x30')]),'firstName':getFirstName(_0x36cd3a[_0x9e04('0x30')]),'lastName':getLastName(_0x36cd3a['from']),'mapKey':_0x9e04('0x5'),'message':{'from':getMails(_0x59e7b6[_0x9e04('0x5')],_0x36cd3a[_0x9e04('0x30')]),'to':_0x59e7b6[_0x9e04('0x5')],'cc':'','subject':_0x36cd3a['subject']||'','messageId':_0x36cd3a[_0x9e04('0x31')],'inReplyTo':_0x36cd3a['inReplyTo'],'sentAt':moment(_0x36cd3a[_0x9e04('0x32')])[_0x9e04('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x36cd3a[_0x9e04('0x13')]&&!_0x36cd3a[_0x9e04('0x1f')]){var _0x568b35=_[_0x9e04('0x33')](_0x36cd3a[_0x9e04('0x18')],{'contentType':_0x9e04('0x34')});if(_0x568b35[_0x9e04('0xf')]){logger[_0x9e04('0x35')](util[_0x9e04('0x28')](_0x9e04('0x36'),_0x36cd3a[_0x9e04('0x31')]));tnef[_0x9e04('0x37')](_[_0x9e04('0x38')](_0x568b35)['content'],function(_0x2e16cf,_0x54b8f6){if(_0x54b8f6){_0x36cd3a['html']=_0x54b8f6[_0x9e04('0x39')]||_0x9e04('0x3a');if(_0x54b8f6[_0x9e04('0x3b')]){for(var _0x569cc7=0x0;_0x569cc7<_0x54b8f6[_0x9e04('0x3b')]['length'];_0x569cc7++){var _0x41fa9d=_0x54b8f6[_0x9e04('0x3b')][_0x569cc7];_0x5a9263[_0x9e04('0x21')]['attachments'][_0x9e04('0x1a')]({'filename':_0x41fa9d[_0x9e04('0x3c')],'content':Buffer['from'](_0x41fa9d[_0x9e04('0x3d')])});}}}_0x23d1ef(parseEmail(_0x59e7b6,_0x36cd3a,_0x5a9263));});}else{_0x36cd3a[_0x9e04('0x13')]='

Empty\x20message

';_0x23d1ef(parseEmail(_0x59e7b6,_0x36cd3a,_0x5a9263));}}else{_0x23d1ef(parseEmail(_0x59e7b6,_0x36cd3a,_0x5a9263));}};exports[_0x9e04('0x3e')]=function(_0x24e65b,_0xd1c85c){var _0x255bda=[_0x9e04('0x3f')+(_0xd1c85c||''),'auth=Bearer\x20'+_0x24e65b,'',''];return Buffer[_0x9e04('0x30')](_0x255bda[_0x9e04('0x11')](''),_0x9e04('0x40'))['toString']('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 1030596..30ad8c2 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 _0xa23c=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x540f42,_0x3e9a3e){var _0x4581df=function(_0x1a3013){while(--_0x1a3013){_0x540f42['push'](_0x540f42['shift']());}};_0x4581df(++_0x3e9a3e);}(_0xa23c,0x178));var _0xca23=function(_0x28f757,_0x39009e){_0x28f757=_0x28f757-0x0;var _0x1d03a4=_0xa23c[_0x28f757];return _0x1d03a4;};'use strict';var _=require(_0xca23('0x0'));function MailAccount(_0x297a80){this['id']=_0x297a80['id']||0x0;this[_0xca23('0x1')]=_0x297a80[_0xca23('0x1')]||_0xca23('0x2');this['key']=_0x297a80[_0xca23('0x3')]||_0xca23('0x4');this[_0xca23('0x5')]=_0x297a80[_0xca23('0x5')]||![];this[_0xca23('0x6')]=_0x297a80[_0xca23('0x6')]||[];this[_0xca23('0x7')]=_0x297a80[_0xca23('0x7')]||[];}module[_0xca23('0x8')]=MailAccount; \ No newline at end of file +var _0x72b7=['Service','key','active','Imap','Smtp','lodash','name'];(function(_0x53098b,_0x553214){var _0x3ad86a=function(_0x284cb1){while(--_0x284cb1){_0x53098b['push'](_0x53098b['shift']());}};_0x3ad86a(++_0x553214);}(_0x72b7,0x1e1));var _0x772b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x72b7[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x772b('0x0'));function MailAccount(_0x34a7ef){this['id']=_0x34a7ef['id']||0x0;this[_0x772b('0x1')]=_0x34a7ef[_0x772b('0x1')]||_0x772b('0x2');this['key']=_0x34a7ef[_0x772b('0x3')]||'SERV';this['active']=_0x34a7ef[_0x772b('0x4')]||![];this[_0x772b('0x5')]=_0x34a7ef['Imap']||[];this[_0x772b('0x6')]=_0x34a7ef[_0x772b('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4b9f08e..664b191 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 _0x8c57=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','mailAccounts','isUndefined','merge','exports','../model/mailAccount'];(function(_0x3a34f6,_0x586397){var _0x99473a=function(_0x49a962){while(--_0x49a962){_0x3a34f6['push'](_0x3a34f6['shift']());}};_0x99473a(++_0x586397);}(_0x8c57,0x182));var _0x78c5=function(_0x3d23e4,_0x164466){_0x3d23e4=_0x3d23e4-0x0;var _0x1aedd6=_0x8c57[_0x3d23e4];return _0x1aedd6;};'use strict';var _=require('lodash');var MailAccount=require(_0x78c5('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3ae804,_0xb321bd,_0x384b){var _0x454f89=_[_0x78c5('0x1')](_0x3ae804,function(_0x1f9de7,_0x4af39e){return _0x1f9de7[_0x384b];});for(var _0x1b57ba in _0xb321bd){if(_0xb321bd[_0x78c5('0x2')](_0x1b57ba)){if(!_0x454f89[_0x1b57ba]){delete _0xb321bd[_0x1b57ba];}}}}Realtime[_0x78c5('0x3')][_0x78c5('0x4')]=function(_0x97c695,_0x5ec203){for(var _0x4ac9a5 in _0x5ec203){if(_0x97c695[_0x78c5('0x2')](_0x4ac9a5)){_0x97c695[_0x4ac9a5]=_0x5ec203[_0x4ac9a5];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x15a626=this;return function(_0x430cec){if(_0x430cec){freeIsNotKey(_0x430cec,_0x15a626[_0x78c5('0x5')],'id');for(var _0x12b59a=0x0,_0x47ed37={},_0x428617={};_0x12b59a<_0x430cec['length'];_0x12b59a+=0x1){_0x47ed37=_0x430cec[_0x12b59a];if(_[_0x78c5('0x6')](_0x15a626[_0x78c5('0x5')][_0x47ed37['id']])){_0x15a626['mailAccounts'][_0x47ed37['id']]=new MailAccount(_0x47ed37);}else{_[_0x78c5('0x7')](_0x15a626[_0x78c5('0x5')][_0x47ed37['id']],_0x47ed37);}}}return _0x15a626[_0x78c5('0x5')];};};module[_0x78c5('0x8')]=Realtime; \ No newline at end of file +var _0x81dd=['exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype','initMailAccounts','mailAccounts','length'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x81dd,0x169));var _0xd81d=function(_0x4fb8de,_0x151ea6){_0x4fb8de=_0x4fb8de-0x0;var _0x397ff9=_0x81dd[_0x4fb8de];return _0x397ff9;};'use strict';var _=require(_0xd81d('0x0'));var MailAccount=require(_0xd81d('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x4f331c,_0x2b8878,_0x505e5d){var _0x21f4a2=_[_0xd81d('0x2')](_0x4f331c,function(_0x94c8b7,_0x119e9c){return _0x94c8b7[_0x505e5d];});for(var _0x25ccce in _0x2b8878){if(_0x2b8878[_0xd81d('0x3')](_0x25ccce)){if(!_0x21f4a2[_0x25ccce]){delete _0x2b8878[_0x25ccce];}}}}Realtime[_0xd81d('0x4')]['mergeFromDatabase']=function(_0x29d5e4,_0x5a0c6a){for(var _0xfd3d04 in _0x5a0c6a){if(_0x29d5e4[_0xd81d('0x3')](_0xfd3d04)){_0x29d5e4[_0xfd3d04]=_0x5a0c6a[_0xfd3d04];}}};Realtime[_0xd81d('0x4')][_0xd81d('0x5')]=function(){var _0x50ef47=this;return function(_0x2591b1){if(_0x2591b1){freeIsNotKey(_0x2591b1,_0x50ef47[_0xd81d('0x6')],'id');for(var _0x516262=0x0,_0x57137a={},_0x38b214={};_0x516262<_0x2591b1[_0xd81d('0x7')];_0x516262+=0x1){_0x57137a=_0x2591b1[_0x516262];if(_['isUndefined'](_0x50ef47[_0xd81d('0x6')][_0x57137a['id']])){_0x50ef47[_0xd81d('0x6')][_0x57137a['id']]=new MailAccount(_0x57137a);}else{_['merge'](_0x50ef47[_0xd81d('0x6')][_0x57137a['id']],_0x57137a);}}}return _0x50ef47[_0xd81d('0x6')];};};module[_0xd81d('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 355d236..c27575f 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 _0x2876=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','email','active','key','ListId','MailServerIn','CloudProvider','name','service','type','MailServerOut','Smtp','data5','getMailAccount'];(function(_0x19122e,_0x488e77){var _0x2ed0a7=function(_0x495bb2){while(--_0x495bb2){_0x19122e['push'](_0x19122e['shift']());}};_0x2ed0a7(++_0x488e77);}(_0x2876,0x91));var _0x6287=function(_0x27ca91,_0x44c175){_0x27ca91=_0x27ca91-0x0;var _0xc1399a=_0x2876[_0x27ca91];return _0xc1399a;};'use strict';var client=require(_0x6287('0x0'));exports[_0x6287('0x1')]=function(){return function(){return client[_0x6287('0x2')](_0x6287('0x3'),{'options':{'attributes':['id','name','provider','service',_0x6287('0x4'),_0x6287('0x5'),_0x6287('0x6'),_0x6287('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0x6287('0x8'),'as':'Imap','include':[{'model':_0x6287('0x9'),'attributes':['id',_0x6287('0xa'),_0x6287('0xb'),_0x6287('0xc'),'data5'],'as':_0x6287('0x9')}]},{'model':_0x6287('0xd'),'as':_0x6287('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0x6287('0xa'),_0x6287('0xb'),_0x6287('0xc'),_0x6287('0xf')],'as':'CloudProvider'}]}]},'log':_0x6287('0x10')});};};exports['notify']=function(_0x4e0219,_0x185b64){return client['Request'](_0x6287('0x11'),{'account':{'id':_0x4e0219},'body':_0x185b64,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x3837=['name','type','data5','MailServerOut','Smtp','getMailAccount','notify','Request','NotifyMailAccount','getMailAccounts','GetMailAccount','provider','service','email','active','key','MailServerIn','Imap','CloudProvider'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x3837,0x1d1));var _0x7383=function(_0x3a998f,_0x1c187e){_0x3a998f=_0x3a998f-0x0;var _0x2fd262=_0x3837[_0x3a998f];return _0x2fd262;};'use strict';var client=require('../client');exports[_0x7383('0x0')]=function(){return function(){return client['Request'](_0x7383('0x1'),{'options':{'attributes':['id','name',_0x7383('0x2'),_0x7383('0x3'),_0x7383('0x4'),_0x7383('0x5'),_0x7383('0x6'),'ListId','TemplateId'],'raw':![],'include':[{'model':_0x7383('0x7'),'as':_0x7383('0x8'),'include':[{'model':_0x7383('0x9'),'attributes':['id',_0x7383('0xa'),_0x7383('0x3'),_0x7383('0xb'),_0x7383('0xc')],'as':'CloudProvider'}]},{'model':_0x7383('0xd'),'as':_0x7383('0xe'),'include':[{'model':_0x7383('0x9'),'attributes':['id',_0x7383('0xa'),_0x7383('0x3'),_0x7383('0xb'),_0x7383('0xc')],'as':'CloudProvider'}]}]},'log':_0x7383('0xf')});};};exports[_0x7383('0x10')]=function(_0x1d2221,_0x3c29dc){return client[_0x7383('0x11')](_0x7383('0x12'),{'account':{'id':_0x1d2221},'body':_0x3c29dc,'log':_0x7383('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 17b02da..dab1aa6 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 _0x72db=['loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x1d432d,_0x401149){var _0x338acb=function(_0x194623){while(--_0x194623){_0x1d432d['push'](_0x1d432d['shift']());}};_0x338acb(++_0x401149);}(_0x72db,0x1da));var _0xb72d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72db[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb72d('0x0'));exports[_0xb72d('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb72d('0x2')]},'log':_0xb72d('0x3')});}; \ No newline at end of file +var _0xdbaf=['Request','loginMailFrequency','GetSettings','../client'];(function(_0x256478,_0x3de540){var _0x778d0=function(_0x47467c){while(--_0x47467c){_0x256478['push'](_0x256478['shift']());}};_0x778d0(++_0x3de540);}(_0xdbaf,0x1df));var _0xfdba=function(_0x38d7a7,_0x30f017){_0x38d7a7=_0x38d7a7-0x0;var _0x2b650b=_0xdbaf[_0x38d7a7];return _0x2b650b;};'use strict';var client=require(_0xfdba('0x0'));exports['getSettings']=function(){return client[_0xfdba('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfdba('0x2')]},'log':_0xfdba('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 1ef7091..c7ea007 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 02d7602..e1af3a2 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 _0x45af=['exports','lodash','http','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','localhost','adapter','socket.io-redis','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x4c15e7,_0x4ad7f5){var _0x1f119a=function(_0x5b3da8){while(--_0x5b3da8){_0x4c15e7['push'](_0x4c15e7['shift']());}};_0x1f119a(++_0x4ad7f5);}(_0x45af,0x9b));var _0xf45a=function(_0x442031,_0x10fb78){_0x442031=_0x442031-0x0;var _0xfea758=_0x45af[_0x442031];return _0xfea758;};'use strict';var _=require(_0xf45a('0x0'));var http=require(_0xf45a('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0xf45a('0x2'));var config=require(_0xf45a('0x3'));var app=express();var server=http[_0xf45a('0x4')](app);server[_0xf45a('0x5')]=0xdbba0;if(sticky[_0xf45a('0x6')](server,config[_0xf45a('0x7')])){var socketio=require(_0xf45a('0x8'))(server,{'transports':[_0xf45a('0x9'),'polling']});config['redis']=_['defaults'](config[_0xf45a('0xa')],{'host':_0xf45a('0xb'),'port':0x18eb});socketio[_0xf45a('0xc')](require(_0xf45a('0xd'))({'pubClient':new Redis(config[_0xf45a('0xa')]),'subClient':new Redis(config[_0xf45a('0xa')])}));require('../../config/triggers')[_0xf45a('0xe')]();require('../../config/socketio')[_0xf45a('0xe')](socketio);require(_0xf45a('0xf'))['default'](app);require(_0xf45a('0x10'))[_0xf45a('0xe')](app);}else{server[_0xf45a('0x11')](_0xf45a('0x12'),function(){console[_0xf45a('0x13')](_0xf45a('0x14'),config[_0xf45a('0x7')]);});}exports=module[_0xf45a('0x15')]=app; \ No newline at end of file +var _0xaaa0=['exports','lodash','express','../../config/environment','timeout','port','websocket','polling','redis','localhost','adapter','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xaaa0,0x1a3));var _0x0aaa=function(_0x4cffbd,_0x30b003){_0x4cffbd=_0x4cffbd-0x0;var _0x5108c5=_0xaaa0[_0x4cffbd];return _0x5108c5;};'use strict';var _=require(_0x0aaa('0x0'));var http=require('http');var express=require(_0x0aaa('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x0aaa('0x2'));var app=express();var server=http['createServer'](app);server[_0x0aaa('0x3')]=0xdbba0;if(sticky['listen'](server,config[_0x0aaa('0x4')])){var socketio=require('socket.io')(server,{'transports':[_0x0aaa('0x5'),_0x0aaa('0x6')]});config[_0x0aaa('0x7')]=_['defaults'](config[_0x0aaa('0x7')],{'host':_0x0aaa('0x8'),'port':0x18eb});socketio[_0x0aaa('0x9')](require('socket.io-redis')({'pubClient':new Redis(config[_0x0aaa('0x7')]),'subClient':new Redis(config['redis'])}));require(_0x0aaa('0xa'))['default']();require(_0x0aaa('0xb'))[_0x0aaa('0xc')](socketio);require(_0x0aaa('0xd'))[_0x0aaa('0xc')](app);require(_0x0aaa('0xe'))['default'](app);}else{server[_0x0aaa('0xf')](_0x0aaa('0x10'),function(){console['log'](_0x0aaa('0x11'),config[_0x0aaa('0x4')]);});}exports=module[_0x0aaa('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 4900455..840004c 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 _0x56f2=['request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request'];(function(_0x5cb71a,_0x263bdf){var _0x3f380f=function(_0x4faf0e){while(--_0x4faf0e){_0x5cb71a['push'](_0x5cb71a['shift']());}};_0x3f380f(++_0x263bdf);}(_0x56f2,0x180));var _0x256f=function(_0x2658b6,_0x3326be){_0x2658b6=_0x2658b6-0x0;var _0x455870=_0x56f2[_0x2658b6];return _0x455870;};'use strict';var jayson=require(_0x256f('0x0'));var BPromise=require(_0x256f('0x1'));var logger=require('../../config/logger')(_0x256f('0x2'));var client=jayson[_0x256f('0x3')][_0x256f('0x4')]({'port':0x2329});client[_0x256f('0x5')]=function(_0x4497a9,_0x18c821){return new BPromise(function(_0x492748,_0x4aadcc){return client[_0x256f('0x6')](_0x4497a9,_0x18c821)[_0x256f('0x7')](function(_0x15f7c3){logger[_0x256f('0x8')](_0x256f('0x9'),_0x256f('0x2'),_0x4497a9,_0x18c821,_0x15f7c3);if(_0x15f7c3[_0x256f('0xa')]){logger['error'](_0x256f('0x9'),_0x256f('0x2'),_0x4497a9,_0x15f7c3[_0x256f('0xa')][_0x256f('0xb')],_0x18c821);return _0x4aadcc(_0x15f7c3[_0x256f('0xa')][_0x256f('0xb')]);}else{return _0x492748(_0x15f7c3[_0x256f('0xc')]);}})[_0x256f('0xd')](function(_0x5936b9){logger[_0x256f('0xa')](_0x256f('0x9'),_0x256f('0x2'),_0x4497a9,_0x5936b9,_0x18c821);return _0x4aadcc(_0x5936b9);});});};module[_0x256f('0xe')]=client; \ No newline at end of file +var _0xb9da=['message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','routing','error','rpc'];(function(_0x1a0d58,_0x526d2b){var _0x37d070=function(_0x20733a){while(--_0x20733a){_0x1a0d58['push'](_0x1a0d58['shift']());}};_0x37d070(++_0x526d2b);}(_0xb9da,0x94));var _0xab9d=function(_0xc2b4c8,_0x756a49){_0xc2b4c8=_0xc2b4c8-0x0;var _0x402443=_0xb9da[_0xc2b4c8];return _0x402443;};'use strict';var jayson=require(_0xab9d('0x0'));var BPromise=require(_0xab9d('0x1'));var logger=require(_0xab9d('0x2'))('routing');var client=jayson[_0xab9d('0x3')][_0xab9d('0x4')]({'port':0x2329});client[_0xab9d('0x5')]=function(_0xd9623a,_0xf434f5){return new BPromise(function(_0x5d72f4,_0x5da6af){return client[_0xab9d('0x6')](_0xd9623a,_0xf434f5)[_0xab9d('0x7')](function(_0x59a970){logger[_0xab9d('0x8')]('rpc',_0xab9d('0x9'),_0xd9623a,_0xf434f5,_0x59a970);if(_0x59a970['error']){logger[_0xab9d('0xa')](_0xab9d('0xb'),'routing',_0xd9623a,_0x59a970['error'][_0xab9d('0xc')],_0xf434f5);return _0x5da6af(_0x59a970['error'][_0xab9d('0xc')]);}else{return _0x5d72f4(_0x59a970[_0xab9d('0xd')]);}})[_0xab9d('0xe')](function(_0x19b46b){logger[_0xab9d('0xa')](_0xab9d('0xb'),_0xab9d('0x9'),_0xd9623a,_0x19b46b,_0xf434f5);return _0x5da6af(_0x19b46b);});});};module[_0xab9d('0xf')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 9456a22..38cf6cf 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 _0x93a2=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue'];(function(_0x217810,_0x9bd066){var _0x309751=function(_0x4f880e){while(--_0x4f880e){_0x217810['push'](_0x217810['shift']());}};_0x309751(++_0x9bd066);}(_0x93a2,0xa3));var _0x293a=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x93a2[_0x420b24];return _0x4da552;};'use strict';var BPromise=require('bluebird');var server=require(_0x293a('0x0'));var Realtime=require(_0x293a('0x1'));var user=require(_0x293a('0x2'));var interval=require(_0x293a('0x3'));var openchannelQueue=require(_0x293a('0x4'));var chatQueue=require(_0x293a('0x5'));var smsQueue=require(_0x293a('0x6'));var mailQueue=require(_0x293a('0x7'));var faxQueue=require(_0x293a('0x8'));var whatsappQueue=require(_0x293a('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x293a('0xa')](user[_0x293a('0xb')]())['then'](realtime[_0x293a('0xc')]())[_0x293a('0xa')](interval[_0x293a('0xd')]())[_0x293a('0xa')](realtime['initIntervals']())[_0x293a('0xa')](openchannelQueue[_0x293a('0xe')]())[_0x293a('0xa')](realtime['initOpenchannelQueues']())['then'](chatQueue['getChatQueues']())[_0x293a('0xa')](realtime[_0x293a('0xf')]())[_0x293a('0xa')](smsQueue['getSmsQueues']())[_0x293a('0xa')](realtime[_0x293a('0x10')]())[_0x293a('0xa')](mailQueue[_0x293a('0x11')]())[_0x293a('0xa')](realtime[_0x293a('0x12')]())[_0x293a('0xa')](faxQueue[_0x293a('0x13')]())[_0x293a('0xa')](realtime[_0x293a('0x14')]())[_0x293a('0xa')](whatsappQueue[_0x293a('0x15')]())[_0x293a('0xa')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x293a('0x16')](realtime)[_0x293a('0xa')](function(_0x26ee3b){return initRealtime();})[_0x293a('0xa')](function(_0xb0aa4b){return setInterval(initRealtime,0x1388);})[_0x293a('0x17')](function(_0x4603e8){console['log'](_0x4603e8);});}main(); \ No newline at end of file +var _0xaa49=['initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals'];(function(_0x5bae0f,_0x44d842){var _0x589663=function(_0x3e8b01){while(--_0x3e8b01){_0x5bae0f['push'](_0x5bae0f['shift']());}};_0x589663(++_0x44d842);}(_0xaa49,0x178));var _0x9aa4=function(_0xa4a218,_0x552aab){_0xa4a218=_0xa4a218-0x0;var _0x388f2b=_0xaa49[_0xa4a218];return _0x388f2b;};'use strict';var BPromise=require(_0x9aa4('0x0'));var server=require('./server');var Realtime=require(_0x9aa4('0x1'));var user=require(_0x9aa4('0x2'));var interval=require(_0x9aa4('0x3'));var openchannelQueue=require(_0x9aa4('0x4'));var chatQueue=require(_0x9aa4('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x9aa4('0x6'));var faxQueue=require(_0x9aa4('0x7'));var whatsappQueue=require(_0x9aa4('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9aa4('0x9')]()['then'](user[_0x9aa4('0xa')]())[_0x9aa4('0xb')](realtime[_0x9aa4('0xc')]())[_0x9aa4('0xb')](interval[_0x9aa4('0xd')]())['then'](realtime[_0x9aa4('0xe')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0x9aa4('0xb')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x9aa4('0xf')]())['then'](realtime[_0x9aa4('0x10')]())[_0x9aa4('0xb')](smsQueue[_0x9aa4('0x11')]())['then'](realtime[_0x9aa4('0x12')]())[_0x9aa4('0xb')](mailQueue['getMailQueues']())['then'](realtime[_0x9aa4('0x13')]())[_0x9aa4('0xb')](faxQueue[_0x9aa4('0x14')]())[_0x9aa4('0xb')](realtime[_0x9aa4('0x15')]())[_0x9aa4('0xb')](whatsappQueue[_0x9aa4('0x16')]())[_0x9aa4('0xb')](realtime[_0x9aa4('0x17')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x37950f){return initRealtime();})[_0x9aa4('0xb')](function(_0xe4885f){return setInterval(initRealtime,0x1388);})[_0x9aa4('0x18')](function(_0x59a05f){console[_0x9aa4('0x19')](_0x59a05f);});}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 a9e9df9..7497ddc 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(_0x246c15,_0x3fd853){var _0xf8cc92=function(_0x452bde){while(--_0x452bde){_0x246c15['push'](_0x246c15['shift']());}};_0xf8cc92(++_0x3fd853);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x2d3b66,_0x44f3ae){var _0x4cf0df=function(_0x36a009){while(--_0x36a009){_0x2d3b66['push'](_0x2d3b66['shift']());}};_0x4cf0df(++_0x44f3ae);}(_0x7a54,0x106));var _0x47a5=function(_0x368a1e,_0x471636){_0x368a1e=_0x368a1e-0x0;var _0xd02679=_0x7a54[_0x368a1e];return _0xd02679;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 074b246..bf0eca0 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 _0x824a=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message','result'];(function(_0x498315,_0x23852b){var _0x392649=function(_0xad01a4){while(--_0xad01a4){_0x498315['push'](_0x498315['shift']());}};_0x392649(++_0x23852b);}(_0x824a,0x9d));var _0xa824=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x824a[_0x4b369d];return _0x571a98;};'use strict';var BPromise=require(_0xa824('0x0'));var jayson=require(_0xa824('0x1'));var client=jayson[_0xa824('0x2')][_0xa824('0x3')]({'port':0x232b});function request(_0x30c003,_0x1a2055){return new BPromise(function(_0x5b65ef,_0x485859){return client[_0xa824('0x4')](_0x30c003,_0x1a2055)['then'](function(_0x2c6c57){if(_0x2c6c57[_0xa824('0x5')]){return _0x485859(_0x2c6c57['error'][_0xa824('0x6')]);}else{return _0x5b65ef(_0x2c6c57[_0xa824('0x7')]);}})[_0xa824('0x8')](function(_0x2bc764){return _0x485859(_0x2bc764);});});}exports[_0xa824('0x9')]=function(_0x58c2b2,_0x270cec){return request(_0xa824('0xa'),{'account':_0x58c2b2,'message':_0x270cec});}; \ No newline at end of file +var _0xbd7b=['SendMail','bluebird','jayson/promise','http','error','message','result','sendMailMessage'];(function(_0x1fcb13,_0x13a9ed){var _0x3ec941=function(_0x1848f9){while(--_0x1848f9){_0x1fcb13['push'](_0x1fcb13['shift']());}};_0x3ec941(++_0x13a9ed);}(_0xbd7b,0x141));var _0xbbd7=function(_0xe9d880,_0x2c1ef0){_0xe9d880=_0xe9d880-0x0;var _0x186188=_0xbd7b[_0xe9d880];return _0x186188;};'use strict';var BPromise=require(_0xbbd7('0x0'));var jayson=require(_0xbbd7('0x1'));var client=jayson['client'][_0xbbd7('0x2')]({'port':0x232b});function request(_0x5e8525,_0x2e419c){return new BPromise(function(_0x3b348a,_0x530f40){return client['request'](_0x5e8525,_0x2e419c)['then'](function(_0x493d7f){if(_0x493d7f[_0xbbd7('0x3')]){return _0x530f40(_0x493d7f[_0xbbd7('0x3')][_0xbbd7('0x4')]);}else{return _0x3b348a(_0x493d7f[_0xbbd7('0x5')]);}})['catch'](function(_0x472d3c){return _0x530f40(_0x472d3c);});});}exports[_0xbbd7('0x6')]=function(_0x4be385,_0x509b15){return request(_0xbbd7('0x7'),{'account':_0x4be385,'message':_0x509b15});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 195d393..126e034 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 _0x0137=['socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','format','smsCurrentCapacity','whatsappCurrentCapacity','busyQueue','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost'];(function(_0x5e8791,_0x3509b0){var _0x5dbbe0=function(_0x5aa535){while(--_0x5aa535){_0x5e8791['push'](_0x5e8791['shift']());}};_0x5dbbe0(++_0x3509b0);}(_0x0137,0x1d8));var _0x7013=function(_0x4a248b,_0x29e290){_0x4a248b=_0x4a248b-0x0;var _0x565f8c=_0x0137[_0x4a248b];return _0x565f8c;};'use strict';var _=require(_0x7013('0x0'));var moment=require(_0x7013('0x1'));var md5=require(_0x7013('0x2'));var Redis=require(_0x7013('0x3'));var config=require(_0x7013('0x4'));config['redis']=_[_0x7013('0x5')](config[_0x7013('0x6')],{'host':_0x7013('0x7'),'port':0x18eb});var io=require(_0x7013('0x8'))(new Redis(config[_0x7013('0x6')]));function Agent(_0x17c3c8){this['id']=_0x17c3c8['id']||0x0;this['name']=_0x17c3c8[_0x7013('0x9')]||'';this[_0x7013('0xa')]=_0x17c3c8['online']||!![];this[_0x7013('0xb')]=_0x17c3c8[_0x7013('0xb')]||![];this[_0x7013('0xc')]=_0x17c3c8['chatPause']||![];this[_0x7013('0xd')]=_0x17c3c8[_0x7013('0xd')]||![];this[_0x7013('0xe')]=_0x17c3c8[_0x7013('0xe')]||![];this['smsPause']=_0x17c3c8[_0x7013('0xf')]||![];this[_0x7013('0x10')]=_0x17c3c8[_0x7013('0x10')]||![];this[_0x7013('0x11')]=_0x7013('0x12');this[_0x7013('0x13')]=0x0;this['chatCapacity']=_0x17c3c8[_0x7013('0x14')]||0x0;this[_0x7013('0x15')]=0x0;this[_0x7013('0x16')]=_0x7013('0x12');this[_0x7013('0x17')]=0x0;this[_0x7013('0x18')]=_0x17c3c8[_0x7013('0x18')]||0x0;this[_0x7013('0x19')]=0x0;this[_0x7013('0x1a')]=_0x7013('0x12');this[_0x7013('0x1b')]=0x0;this['faxCapacity']=_0x17c3c8['faxCapacity']||0x0;this[_0x7013('0x1c')]=0x0;this[_0x7013('0x1d')]=_0x7013('0x12');this[_0x7013('0x1e')]=0x0;this[_0x7013('0x1f')]=_0x17c3c8['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x7013('0x20')]=_0x7013('0x12');this[_0x7013('0x21')]=0x0;this[_0x7013('0x22')]=_0x17c3c8[_0x7013('0x22')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x7013('0x23')]=_0x7013('0x12');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x17c3c8[_0x7013('0x24')]||0x0;this[_0x7013('0x25')]=0x0;this[_0x7013('0x26')]=![];this['busyQueue']=undefined;this[_0x7013('0x2')]='';this['updateRealtime']();}Agent[_0x7013('0x27')][_0x7013('0x28')]=function(_0x2f0af8){if(this[_0x2f0af8+_0x7013('0x29')]>0x0){if(this[_0x2f0af8+_0x7013('0x2a')]>0x0&&this[_0x2f0af8+_0x7013('0x29')]>=this[_0x2f0af8+_0x7013('0x2a')]){return _0x7013('0x2b');}else{return _0x7013('0x2c');}}else{return _0x7013('0x2d');}};Agent[_0x7013('0x27')][_0x7013('0x2e')]=function(){var _0x34811e=[_0x7013('0x2f'),_0x7013('0x30'),_0x7013('0x31'),_0x7013('0x32'),_0x7013('0x33'),_0x7013('0x34')];for(var _0x2e591b=0x0;_0x2e591b<_0x34811e[_0x7013('0x35')];_0x2e591b+=0x1){var _0x5a967f=this[_0x7013('0x28')](_0x34811e[_0x2e591b]);if(this[_0x34811e[_0x2e591b]+_0x7013('0x36')]!==_0x5a967f){this[_0x34811e[_0x2e591b]+_0x7013('0x37')]=_['toNumber'](moment()[_0x7013('0x38')]('x'));}this[_0x34811e[_0x2e591b]+'Status']=_0x5a967f;}var _0xedca92={'id':this['id'],'name':this[_0x7013('0x9')],'online':this['online'],'voicePause':this[_0x7013('0xb')],'chatPause':this['chatPause'],'mailPause':this[_0x7013('0xd')],'smsPause':this[_0x7013('0xf')],'faxPause':this[_0x7013('0xe')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x7013('0x11')],'chatStatusTime':this[_0x7013('0x13')],'chatCapacity':this[_0x7013('0x14')],'chatCurrentCapacity':this[_0x7013('0x15')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x7013('0x17')],'mailCapacity':this[_0x7013('0x18')],'mailCurrentCapacity':this[_0x7013('0x19')],'faxStatus':this[_0x7013('0x1a')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x7013('0x1c')],'smsStatus':this[_0x7013('0x1d')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x7013('0x1f')],'smsCurrentCapacity':this[_0x7013('0x39')],'whatsappStatus':this[_0x7013('0x20')],'whatsappStatusTime':this[_0x7013('0x21')],'whatsappCapacity':this[_0x7013('0x22')],'whatsappCurrentCapacity':this[_0x7013('0x3a')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x7013('0x24')],'openchannelCurrentCapacity':this[_0x7013('0x25')],'busy':this[_0x7013('0x26')],'busyQueue':this[_0x7013('0x3b')]};var _0x92d968=md5(JSON['stringify'](_0xedca92));if(this[_0x7013('0x2')]!==_0x92d968){this['md5']=_0x92d968;io['emit']('user:save',_0xedca92);}};module['exports']=Agent; \ No newline at end of file +var _0x25e1=['faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','working','mail','sms','whatsapp','length','StatusTime','toNumber','format','Status','chatStatusTime','faxStatus','smsStatus','whatsappCurrentCapacity','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25e1,0x1d0));var _0x125e=function(_0x57c4aa,_0x48d34d){_0x57c4aa=_0x57c4aa-0x0;var _0xde4a65=_0x25e1[_0x57c4aa];return _0xde4a65;};'use strict';var _=require(_0x125e('0x0'));var moment=require('moment');var md5=require(_0x125e('0x1'));var Redis=require(_0x125e('0x2'));var config=require(_0x125e('0x3'));config[_0x125e('0x4')]=_[_0x125e('0x5')](config[_0x125e('0x4')],{'host':_0x125e('0x6'),'port':0x18eb});var io=require(_0x125e('0x7'))(new Redis(config[_0x125e('0x4')]));function Agent(_0x3079b1){this['id']=_0x3079b1['id']||0x0;this[_0x125e('0x8')]=_0x3079b1[_0x125e('0x8')]||'';this[_0x125e('0x9')]=_0x3079b1[_0x125e('0x9')]||!![];this['voicePause']=_0x3079b1[_0x125e('0xa')]||![];this[_0x125e('0xb')]=_0x3079b1[_0x125e('0xb')]||![];this[_0x125e('0xc')]=_0x3079b1['mailPause']||![];this[_0x125e('0xd')]=_0x3079b1['faxPause']||![];this[_0x125e('0xe')]=_0x3079b1[_0x125e('0xe')]||![];this[_0x125e('0xf')]=_0x3079b1[_0x125e('0xf')]||![];this[_0x125e('0x10')]=_0x125e('0x11');this['chatStatusTime']=0x0;this[_0x125e('0x12')]=_0x3079b1[_0x125e('0x12')]||0x0;this[_0x125e('0x13')]=0x0;this[_0x125e('0x14')]=_0x125e('0x11');this[_0x125e('0x15')]=0x0;this[_0x125e('0x16')]=_0x3079b1[_0x125e('0x16')]||0x0;this[_0x125e('0x17')]=0x0;this['faxStatus']=_0x125e('0x11');this[_0x125e('0x18')]=0x0;this[_0x125e('0x19')]=_0x3079b1[_0x125e('0x19')]||0x0;this[_0x125e('0x1a')]=0x0;this['smsStatus']=_0x125e('0x11');this[_0x125e('0x1b')]=0x0;this[_0x125e('0x1c')]=_0x3079b1[_0x125e('0x1c')]||0x0;this[_0x125e('0x1d')]=0x0;this[_0x125e('0x1e')]='unknown';this[_0x125e('0x1f')]=0x0;this[_0x125e('0x20')]=_0x3079b1[_0x125e('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x125e('0x21')]=_0x125e('0x11');this[_0x125e('0x22')]=0x0;this[_0x125e('0x23')]=_0x3079b1[_0x125e('0x23')]||0x0;this[_0x125e('0x24')]=0x0;this[_0x125e('0x25')]=![];this[_0x125e('0x26')]=undefined;this[_0x125e('0x1')]='';this[_0x125e('0x27')]();}Agent[_0x125e('0x28')][_0x125e('0x29')]=function(_0x49b979){if(this[_0x49b979+'CurrentCapacity']>0x0){if(this[_0x49b979+_0x125e('0x2a')]>0x0&&this[_0x49b979+_0x125e('0x2b')]>=this[_0x49b979+_0x125e('0x2a')]){return'maxcapacity';}else{return _0x125e('0x2c');}}else{return'idle';}};Agent['prototype'][_0x125e('0x27')]=function(){var _0x3b4e3b=[_0x125e('0x2d'),'chat','openchannel','fax',_0x125e('0x2e'),_0x125e('0x2f')];for(var _0x4cfd57=0x0;_0x4cfd57<_0x3b4e3b[_0x125e('0x30')];_0x4cfd57+=0x1){var _0x1aa29d=this[_0x125e('0x29')](_0x3b4e3b[_0x4cfd57]);if(this[_0x3b4e3b[_0x4cfd57]+'Status']!==_0x1aa29d){this[_0x3b4e3b[_0x4cfd57]+_0x125e('0x31')]=_[_0x125e('0x32')](moment()[_0x125e('0x33')]('x'));}this[_0x3b4e3b[_0x4cfd57]+_0x125e('0x34')]=_0x1aa29d;}var _0xc02a18={'id':this['id'],'name':this['name'],'online':this[_0x125e('0x9')],'voicePause':this[_0x125e('0xa')],'chatPause':this[_0x125e('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0x125e('0xe')],'faxPause':this[_0x125e('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x125e('0x10')],'chatStatusTime':this[_0x125e('0x35')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x125e('0x13')],'mailStatus':this[_0x125e('0x14')],'mailStatusTime':this[_0x125e('0x15')],'mailCapacity':this[_0x125e('0x16')],'mailCurrentCapacity':this[_0x125e('0x17')],'faxStatus':this[_0x125e('0x36')],'faxStatusTime':this[_0x125e('0x18')],'faxCapacity':this[_0x125e('0x19')],'faxCurrentCapacity':this[_0x125e('0x1a')],'smsStatus':this[_0x125e('0x37')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x125e('0x1c')],'smsCurrentCapacity':this[_0x125e('0x1d')],'whatsappStatus':this[_0x125e('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x125e('0x20')],'whatsappCurrentCapacity':this[_0x125e('0x38')],'openchannelStatus':this[_0x125e('0x21')],'openchannelStatusTime':this[_0x125e('0x22')],'openchannelCapacity':this[_0x125e('0x23')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x125e('0x26')]};var _0x4880c0=md5(JSON[_0x125e('0x39')](_0xc02a18));if(this[_0x125e('0x1')]!==_0x4880c0){this[_0x125e('0x1')]=_0x4880c0;io[_0x125e('0x3a')](_0x125e('0x3b'),_0xc02a18);}};module[_0x125e('0x3c')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index f315785..9c20c6d 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 _0xbc35=['waiting','stringify','format','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','chatPause','available'];(function(_0x5c0ff6,_0x22cdd2){var _0x1135cd=function(_0x55d5b0){while(--_0x55d5b0){_0x5c0ff6['push'](_0x5c0ff6['shift']());}};_0x1135cd(++_0x22cdd2);}(_0xbc35,0x17f));var _0x5bc3=function(_0x483489,_0x277dda){_0x483489=_0x483489-0x0;var _0x491f41=_0xbc35[_0x483489];return _0x491f41;};'use strict';var _=require(_0x5bc3('0x0'));var md5=require(_0x5bc3('0x1'));var util=require(_0x5bc3('0x2'));var Redis=require('ioredis');var config=require(_0x5bc3('0x3'));config[_0x5bc3('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5bc3('0x5'))(new Redis(config[_0x5bc3('0x4')]));function ChatQueue(_0x2e1e41){this['id']=_0x2e1e41['id']||0x0;this[_0x5bc3('0x6')]=_0x2e1e41['name']||'';this[_0x5bc3('0x7')]=_0x2e1e41[_0x5bc3('0x7')]||0xa;this[_0x5bc3('0x8')]=_0x2e1e41[_0x5bc3('0x8')]||_0x5bc3('0x9');this[_0x5bc3('0xa')]=_0x2e1e41['Agents'];this[_0x5bc3('0xb')]={};this['waiting']=0x0;this[_0x5bc3('0x1')]='';this[_0x5bc3('0xc')]();this[_0x5bc3('0xd')]();}ChatQueue[_0x5bc3('0xe')][_0x5bc3('0xc')]=function(){var _0x22776e=this[_0x5bc3('0xb')][_0x5bc3('0xf')];this[_0x5bc3('0xb')]=_['map'](this['Agents'],'id');this[_0x5bc3('0xb')][_0x5bc3('0xf')]=_0x22776e;};ChatQueue[_0x5bc3('0xe')][_0x5bc3('0xd')]=function(){this[_0x5bc3('0x10')]=0x0;this[_0x5bc3('0x11')]=0x0;for(var _0x2fb845=0x0;_0x2fb845=0x0?this['available']:0x0;var _0x4a6c71={'id':this['id'],'available':this[_0x5bc3('0x15')],'loggedIn':this[_0x5bc3('0x10')],'name':this['name'],'paused':this[_0x5bc3('0x11')],'waiting':this[_0x5bc3('0x16')]};var _0x3e18b6=md5(JSON[_0x5bc3('0x17')](_0x4a6c71));if(this[_0x5bc3('0x1')]!==_0x3e18b6){this[_0x5bc3('0x1')]=_0x3e18b6;io['to'](util[_0x5bc3('0x18')]('chat:queue:%s',_0x4a6c71[_0x5bc3('0x6')]))['emit'](_0x5bc3('0x19'),_0x4a6c71);}};module[_0x5bc3('0x1a')]=ChatQueue; \ No newline at end of file +var _0x8470=['format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','paused','length','online','chatPause','available','waiting','stringify'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8470,0x164));var _0x0847=function(_0x475ef6,_0x5f1b4f){_0x475ef6=_0x475ef6-0x0;var _0x40fc1e=_0x8470[_0x475ef6];return _0x40fc1e;};'use strict';var _=require(_0x0847('0x0'));var md5=require(_0x0847('0x1'));var util=require(_0x0847('0x2'));var Redis=require(_0x0847('0x3'));var config=require(_0x0847('0x4'));config[_0x0847('0x5')]=_[_0x0847('0x6')](config[_0x0847('0x5')],{'host':_0x0847('0x7'),'port':0x18eb});var io=require(_0x0847('0x8'))(new Redis(config[_0x0847('0x5')]));function ChatQueue(_0x6cade){this['id']=_0x6cade['id']||0x0;this[_0x0847('0x9')]=_0x6cade['name']||'';this[_0x0847('0xa')]=_0x6cade[_0x0847('0xa')]||0xa;this[_0x0847('0xb')]=_0x6cade[_0x0847('0xb')]||_0x0847('0xc');this['Agents']=_0x6cade['Agents'];this[_0x0847('0xd')]={};this['waiting']=0x0;this[_0x0847('0x1')]='';this[_0x0847('0xe')]();this[_0x0847('0xf')]();}ChatQueue[_0x0847('0x10')]['updateRouting']=function(){var _0x23d045=this['mapAgentsId'][_0x0847('0x11')];this[_0x0847('0xd')]=_[_0x0847('0x12')](this[_0x0847('0x13')],'id');this[_0x0847('0xd')][_0x0847('0x11')]=_0x23d045;};ChatQueue[_0x0847('0x10')][_0x0847('0xf')]=function(){this[_0x0847('0x14')]=0x0;this[_0x0847('0x15')]=0x0;for(var _0x313ceb=0x0;_0x313ceb=0x0?this['available']:0x0;var _0x3f09b7={'id':this['id'],'available':this[_0x0847('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x0847('0x15')],'waiting':this[_0x0847('0x1a')]};var _0xf892f0=md5(JSON[_0x0847('0x1b')](_0x3f09b7));if(this[_0x0847('0x1')]!==_0xf892f0){this[_0x0847('0x1')]=_0xf892f0;io['to'](util[_0x0847('0x1c')](_0x0847('0x1d'),_0x3f09b7[_0x0847('0x9')]))[_0x0847('0x1e')](_0x0847('0x1f'),_0x3f09b7);}};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 c4a435c..de1feea 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 _0xb5a6=['loggedIn','paused','length','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','md5','updateRealtime','prototype','updateRouting','_rr'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb5a6,0x8b));var _0x6b5a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb5a6[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x6b5a('0x0'));var md5=require('md5');var util=require(_0x6b5a('0x1'));var Redis=require(_0x6b5a('0x2'));var config=require(_0x6b5a('0x3'));config[_0x6b5a('0x4')]=_[_0x6b5a('0x5')](config['redis'],{'host':_0x6b5a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6b5a('0x4')]));function FaxQueue(_0x332900){this['id']=_0x332900['id']||0x0;this[_0x6b5a('0x7')]=_0x332900[_0x6b5a('0x7')]||'';this[_0x6b5a('0x8')]=_0x332900[_0x6b5a('0x8')]||0xa;this['strategy']=_0x332900[_0x6b5a('0x9')]||'beepall';this[_0x6b5a('0xa')]=_0x332900[_0x6b5a('0xa')];this[_0x6b5a('0xb')]={};this['waiting']=0x0;this[_0x6b5a('0xc')]='';this['updateRouting']();this[_0x6b5a('0xd')]();}FaxQueue[_0x6b5a('0xe')][_0x6b5a('0xf')]=function(){var _0x381cf8=this['mapAgentsId']['_rr'];this[_0x6b5a('0xb')]=_['map'](this[_0x6b5a('0xa')],'id');this[_0x6b5a('0xb')][_0x6b5a('0x10')]=_0x381cf8;};FaxQueue[_0x6b5a('0xe')][_0x6b5a('0xd')]=function(){this[_0x6b5a('0x11')]=0x0;this[_0x6b5a('0x12')]=0x0;for(var _0x1807ad=0x0;_0x1807ad=0x0?this['available']:0x0;var _0x3938bc={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6b5a('0x11')],'name':this[_0x6b5a('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x1fe5de=md5(JSON['stringify'](_0x3938bc));if(this[_0x6b5a('0xc')]!==_0x1fe5de){this[_0x6b5a('0xc')]=_0x1fe5de;io['to'](util[_0x6b5a('0x16')](_0x6b5a('0x17'),_0x3938bc[_0x6b5a('0x7')]))[_0x6b5a('0x18')](_0x6b5a('0x19'),_0x3938bc);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x0b4e=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x0b4e,0x1b8));var _0xe0b4=function(_0x5cd02e,_0x27eca1){_0x5cd02e=_0x5cd02e-0x0;var _0x4c5cba=_0x0b4e[_0x5cd02e];return _0x4c5cba;};'use strict';var _=require(_0xe0b4('0x0'));var md5=require(_0xe0b4('0x1'));var util=require(_0xe0b4('0x2'));var Redis=require(_0xe0b4('0x3'));var config=require(_0xe0b4('0x4'));config[_0xe0b4('0x5')]=_['defaults'](config[_0xe0b4('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe0b4('0x6'))(new Redis(config[_0xe0b4('0x5')]));function FaxQueue(_0x401f08){this['id']=_0x401f08['id']||0x0;this[_0xe0b4('0x7')]=_0x401f08[_0xe0b4('0x7')]||'';this['timeout']=_0x401f08[_0xe0b4('0x8')]||0xa;this[_0xe0b4('0x9')]=_0x401f08[_0xe0b4('0x9')]||_0xe0b4('0xa');this[_0xe0b4('0xb')]=_0x401f08['Agents'];this[_0xe0b4('0xc')]={};this['waiting']=0x0;this[_0xe0b4('0x1')]='';this[_0xe0b4('0xd')]();this[_0xe0b4('0xe')]();}FaxQueue[_0xe0b4('0xf')][_0xe0b4('0xd')]=function(){var _0x46375e=this[_0xe0b4('0xc')]['_rr'];this[_0xe0b4('0xc')]=_[_0xe0b4('0x10')](this[_0xe0b4('0xb')],'id');this[_0xe0b4('0xc')][_0xe0b4('0x11')]=_0x46375e;};FaxQueue['prototype'][_0xe0b4('0xe')]=function(){this[_0xe0b4('0x12')]=0x0;this[_0xe0b4('0x13')]=0x0;for(var _0x338824=0x0;_0x338824=0x0?this['available']:0x0;var _0x107742={'id':this['id'],'available':this[_0xe0b4('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xe0b4('0x7')],'paused':this[_0xe0b4('0x13')],'waiting':this['waiting']};var _0x2f89fe=md5(JSON[_0xe0b4('0x17')](_0x107742));if(this[_0xe0b4('0x1')]!==_0x2f89fe){this[_0xe0b4('0x1')]=_0x2f89fe;io['to'](util[_0xe0b4('0x18')](_0xe0b4('0x19'),_0x107742[_0xe0b4('0x7')]))[_0xe0b4('0x1a')](_0xe0b4('0x1b'),_0x107742);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index bcd26f7..94a65b8 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 _0x2267=['Intervals','exports','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2267,0x74));var _0x7226=function(_0x5eb01c,_0x37da86){_0x5eb01c=_0x5eb01c-0x0;var _0x520464=_0x2267[_0x5eb01c];return _0x520464;};'use strict';function Interval(_0x45bbae){this['id']=_0x45bbae['id']||0x0;this[_0x7226('0x0')]=_0x45bbae[_0x7226('0x0')]||'';this[_0x7226('0x1')]=_0x45bbae[_0x7226('0x1')]||{};}module[_0x7226('0x2')]=Interval; \ No newline at end of file +var _0x2963=['Intervals','exports','name'];(function(_0x282466,_0x4eeaaf){var _0x38fc78=function(_0x4ea153){while(--_0x4ea153){_0x282466['push'](_0x282466['shift']());}};_0x38fc78(++_0x4eeaaf);}(_0x2963,0x9e));var _0x3296=function(_0x4dea7d,_0x289adb){_0x4dea7d=_0x4dea7d-0x0;var _0x9ef3aa=_0x2963[_0x4dea7d];return _0x9ef3aa;};'use strict';function Interval(_0x1ebd78){this['id']=_0x1ebd78['id']||0x0;this[_0x3296('0x0')]=_0x1ebd78[_0x3296('0x0')]||'';this[_0x3296('0x1')]=_0x1ebd78[_0x3296('0x1')]||{};}module[_0x3296('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 666b99f..2333dde 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 _0xcd0e=['localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','name','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x1853dd,_0x1dc653){var _0xae059e=function(_0x5c83da){while(--_0x5c83da){_0x1853dd['push'](_0x1853dd['shift']());}};_0xae059e(++_0x1dc653);}(_0xcd0e,0x18c));var _0xecd0=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xcd0e[_0x34bc6c];return _0x168820;};'use strict';var _=require(_0xecd0('0x0'));var md5=require(_0xecd0('0x1'));var util=require(_0xecd0('0x2'));var Redis=require(_0xecd0('0x3'));var config=require(_0xecd0('0x4'));config[_0xecd0('0x5')]=_[_0xecd0('0x6')](config[_0xecd0('0x5')],{'host':_0xecd0('0x7'),'port':0x18eb});var io=require(_0xecd0('0x8'))(new Redis(config[_0xecd0('0x5')]));function MailQueue(_0x36f3c9){this['id']=_0x36f3c9['id']||0x0;this['name']=_0x36f3c9['name']||'';this[_0xecd0('0x9')]=_0x36f3c9['timeout']||0xa;this['strategy']=_0x36f3c9[_0xecd0('0xa')]||'beepall';this[_0xecd0('0xb')]=_0x36f3c9[_0xecd0('0xb')];this[_0xecd0('0xc')]={};this[_0xecd0('0xd')]=0x0;this[_0xecd0('0x1')]='';this[_0xecd0('0xe')]();this[_0xecd0('0xf')]();}MailQueue[_0xecd0('0x10')][_0xecd0('0xe')]=function(){var _0x254409=this[_0xecd0('0xc')][_0xecd0('0x11')];this['mapAgentsId']=_[_0xecd0('0x12')](this['Agents'],'id');this[_0xecd0('0xc')][_0xecd0('0x11')]=_0x254409;};MailQueue[_0xecd0('0x10')][_0xecd0('0xf')]=function(){this[_0xecd0('0x13')]=0x0;this[_0xecd0('0x14')]=0x0;for(var _0x4a5a6c=0x0;_0x4a5a6c=0x0?this[_0xecd0('0x18')]:0x0;var _0x1f193f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xecd0('0x13')],'name':this[_0xecd0('0x19')],'paused':this[_0xecd0('0x14')],'waiting':this[_0xecd0('0xd')]};var _0x4e78fe=md5(JSON['stringify'](_0x1f193f));if(this[_0xecd0('0x1')]!==_0x4e78fe){this['md5']=_0x4e78fe;io['to'](util[_0xecd0('0x1a')](_0xecd0('0x1b'),_0x1f193f['name']))[_0xecd0('0x1c')](_0xecd0('0x1d'),_0x1f193f);}};module[_0xecd0('0x1e')]=MailQueue; \ No newline at end of file +var _0x83f5=['waiting','md5','updateRouting','prototype','_rr','map','updateRealtime','paused','length','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x1dec3f,_0x3b01e1){var _0x3fc029=function(_0x336d3e){while(--_0x336d3e){_0x1dec3f['push'](_0x1dec3f['shift']());}};_0x3fc029(++_0x3b01e1);}(_0x83f5,0xfa));var _0x583f=function(_0x4fb8de,_0xdfd35b){_0x4fb8de=_0x4fb8de-0x0;var _0x114ff1=_0x83f5[_0x4fb8de];return _0x114ff1;};'use strict';var _=require(_0x583f('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x583f('0x1')]=_[_0x583f('0x2')](config[_0x583f('0x1')],{'host':_0x583f('0x3'),'port':0x18eb});var io=require(_0x583f('0x4'))(new Redis(config[_0x583f('0x1')]));function MailQueue(_0x2a9321){this['id']=_0x2a9321['id']||0x0;this['name']=_0x2a9321[_0x583f('0x5')]||'';this[_0x583f('0x6')]=_0x2a9321[_0x583f('0x6')]||0xa;this[_0x583f('0x7')]=_0x2a9321[_0x583f('0x7')]||_0x583f('0x8');this['Agents']=_0x2a9321[_0x583f('0x9')];this[_0x583f('0xa')]={};this[_0x583f('0xb')]=0x0;this[_0x583f('0xc')]='';this[_0x583f('0xd')]();this['updateRealtime']();}MailQueue[_0x583f('0xe')][_0x583f('0xd')]=function(){var _0x13bffa=this[_0x583f('0xa')][_0x583f('0xf')];this[_0x583f('0xa')]=_[_0x583f('0x10')](this['Agents'],'id');this[_0x583f('0xa')][_0x583f('0xf')]=_0x13bffa;};MailQueue[_0x583f('0xe')][_0x583f('0x11')]=function(){this['loggedIn']=0x0;this[_0x583f('0x12')]=0x0;for(var _0x20d394=0x0;_0x20d394=0x0?this['available']:0x0;var _0x1ff741={'id':this['id'],'available':this[_0x583f('0x17')],'loggedIn':this[_0x583f('0x15')],'name':this[_0x583f('0x5')],'paused':this['paused'],'waiting':this[_0x583f('0xb')]};var _0xea876f=md5(JSON[_0x583f('0x18')](_0x1ff741));if(this[_0x583f('0xc')]!==_0xea876f){this['md5']=_0xea876f;io['to'](util[_0x583f('0x19')](_0x583f('0x1a'),_0x1ff741[_0x583f('0x5')]))[_0x583f('0x1b')](_0x583f('0x1c'),_0x1ff741);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index fd37085..d251030 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x326f,0xd1));var _0xf326=function(_0x35de59,_0x190c1a){_0x35de59=_0x35de59-0x0;var _0x3d2771=_0x326f[_0x35de59];return _0x3d2771;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x1261,0x144));var _0x1126=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x1261[_0x470b0a];return _0x4463f6;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 8109ec0..22e73b8 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 _0x2333=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','format','sms:queue:%s','emit','exports','lodash','md5','../../../config/environment','redis'];(function(_0x26462e,_0x416ff7){var _0x31c3f0=function(_0xd387ea){while(--_0xd387ea){_0x26462e['push'](_0x26462e['shift']());}};_0x31c3f0(++_0x416ff7);}(_0x2333,0x11a));var _0x3233=function(_0x5dd237,_0x81424f){_0x5dd237=_0x5dd237-0x0;var _0x2aa826=_0x2333[_0x5dd237];return _0x2aa826;};'use strict';var _=require(_0x3233('0x0'));var md5=require(_0x3233('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x3233('0x2'));config[_0x3233('0x3')]=_['defaults'](config[_0x3233('0x3')],{'host':_0x3233('0x4'),'port':0x18eb});var io=require(_0x3233('0x5'))(new Redis(config[_0x3233('0x3')]));function SmsQueue(_0x40768d){this['id']=_0x40768d['id']||0x0;this[_0x3233('0x6')]=_0x40768d[_0x3233('0x6')]||'';this[_0x3233('0x7')]=_0x40768d[_0x3233('0x7')]||0xa;this[_0x3233('0x8')]=_0x40768d[_0x3233('0x8')]||_0x3233('0x9');this[_0x3233('0xa')]=_0x40768d[_0x3233('0xa')];this[_0x3233('0xb')]={};this[_0x3233('0xc')]=0x0;this[_0x3233('0x1')]='';this[_0x3233('0xd')]();this[_0x3233('0xe')]();}SmsQueue[_0x3233('0xf')][_0x3233('0xd')]=function(){var _0x5dc591=this[_0x3233('0xb')][_0x3233('0x10')];this[_0x3233('0xb')]=_[_0x3233('0x11')](this[_0x3233('0xa')],'id');this[_0x3233('0xb')][_0x3233('0x10')]=_0x5dc591;};SmsQueue[_0x3233('0xf')][_0x3233('0xe')]=function(){this[_0x3233('0x12')]=0x0;this[_0x3233('0x13')]=0x0;for(var _0x27e9fd=0x0;_0x27e9fd=0x0?this['available']:0x0;var _0x38a9c0={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3233('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x298f71=md5(JSON['stringify'](_0x38a9c0));if(this[_0x3233('0x1')]!==_0x298f71){this['md5']=_0x298f71;io['to'](util[_0x3233('0x16')](_0x3233('0x17'),_0x38a9c0[_0x3233('0x6')]))[_0x3233('0x18')]('sms_queue:save',_0x38a9c0);}};module[_0x3233('0x19')]=SmsQueue; \ No newline at end of file +var _0xf874=['name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','map','loggedIn','length','smsPause','paused','available','stringify','format','sms:queue:%s','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter'];(function(_0x394c68,_0x399fdc){var _0x58a0ac=function(_0x2cc867){while(--_0x2cc867){_0x394c68['push'](_0x394c68['shift']());}};_0x58a0ac(++_0x399fdc);}(_0xf874,0xed));var _0x4f87=function(_0x4eaef6,_0x34cb2f){_0x4eaef6=_0x4eaef6-0x0;var _0x53512f=_0xf874[_0x4eaef6];return _0x53512f;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x4f87('0x0'));var Redis=require(_0x4f87('0x1'));var config=require(_0x4f87('0x2'));config[_0x4f87('0x3')]=_[_0x4f87('0x4')](config[_0x4f87('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x4f87('0x5'))(new Redis(config[_0x4f87('0x3')]));function SmsQueue(_0x2974d5){this['id']=_0x2974d5['id']||0x0;this[_0x4f87('0x6')]=_0x2974d5[_0x4f87('0x6')]||'';this[_0x4f87('0x7')]=_0x2974d5['timeout']||0xa;this[_0x4f87('0x8')]=_0x2974d5[_0x4f87('0x8')]||'beepall';this[_0x4f87('0x9')]=_0x2974d5[_0x4f87('0x9')];this['mapAgentsId']={};this[_0x4f87('0xa')]=0x0;this[_0x4f87('0xb')]='';this[_0x4f87('0xc')]();this[_0x4f87('0xd')]();}SmsQueue[_0x4f87('0xe')][_0x4f87('0xc')]=function(){var _0xb63ffc=this['mapAgentsId']['_rr'];this[_0x4f87('0xf')]=_[_0x4f87('0x10')](this[_0x4f87('0x9')],'id');this['mapAgentsId']['_rr']=_0xb63ffc;};SmsQueue[_0x4f87('0xe')][_0x4f87('0xd')]=function(){this[_0x4f87('0x11')]=0x0;this['paused']=0x0;for(var _0x2f11d2=0x0;_0x2f11d2=0x0?this[_0x4f87('0x15')]:0x0;var _0x6a3017={'id':this['id'],'available':this[_0x4f87('0x15')],'loggedIn':this[_0x4f87('0x11')],'name':this[_0x4f87('0x6')],'paused':this[_0x4f87('0x14')],'waiting':this[_0x4f87('0xa')]};var _0x3b9f89=md5(JSON[_0x4f87('0x16')](_0x6a3017));if(this[_0x4f87('0xb')]!==_0x3b9f89){this[_0x4f87('0xb')]=_0x3b9f89;io['to'](util[_0x4f87('0x17')](_0x4f87('0x18'),_0x6a3017['name']))['emit'](_0x4f87('0x19'),_0x6a3017);}};module[_0x4f87('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 78bc74d..8a80c55 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 _0xae3c=['Agents','waiting','updateRealtime','updateRouting','mapAgentsId','_rr','map','prototype','loggedIn','paused','online','available','stringify','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall'];(function(_0x5bde78,_0xef666d){var _0x587f12=function(_0x3b39a4){while(--_0x3b39a4){_0x5bde78['push'](_0x5bde78['shift']());}};_0x587f12(++_0xef666d);}(_0xae3c,0x154));var _0xcae3=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xae3c[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xcae3('0x0'));var md5=require(_0xcae3('0x1'));var util=require(_0xcae3('0x2'));var Redis=require(_0xcae3('0x3'));var config=require(_0xcae3('0x4'));config[_0xcae3('0x5')]=_['defaults'](config['redis'],{'host':_0xcae3('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcae3('0x5')]));function WhatsappQueue(_0x1a172a){this['id']=_0x1a172a['id']||0x0;this[_0xcae3('0x7')]=_0x1a172a['name']||'';this['timeout']=_0x1a172a[_0xcae3('0x8')]||0xa;this['strategy']=_0x1a172a[_0xcae3('0x9')]||_0xcae3('0xa');this[_0xcae3('0xb')]=_0x1a172a[_0xcae3('0xb')];this['mapAgentsId']={};this[_0xcae3('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0xcae3('0xd')]();}WhatsappQueue['prototype'][_0xcae3('0xe')]=function(){var _0x2cb6fd=this[_0xcae3('0xf')][_0xcae3('0x10')];this[_0xcae3('0xf')]=_[_0xcae3('0x11')](this[_0xcae3('0xb')],'id');this[_0xcae3('0xf')][_0xcae3('0x10')]=_0x2cb6fd;};WhatsappQueue[_0xcae3('0x12')]['updateRealtime']=function(){this[_0xcae3('0x13')]=0x0;this[_0xcae3('0x14')]=0x0;for(var _0x40f1a8=0x0;_0x40f1a8=0x0?this[_0xcae3('0x16')]:0x0;var _0x3cc01a={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcae3('0x13')],'name':this[_0xcae3('0x7')],'paused':this[_0xcae3('0x14')],'waiting':this[_0xcae3('0xc')]};var _0x5f350d=md5(JSON[_0xcae3('0x17')](_0x3cc01a));if(this[_0xcae3('0x1')]!==_0x5f350d){this[_0xcae3('0x1')]=_0x5f350d;io['to'](util['format'](_0xcae3('0x18'),_0x3cc01a[_0xcae3('0x7')]))['emit'](_0xcae3('0x19'),_0x3cc01a);}};module[_0xcae3('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xcb6c=['Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp_queue:save','exports','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x48e20a,_0x258870){var _0x1c110d=function(_0x39372b){while(--_0x39372b){_0x48e20a['push'](_0x48e20a['shift']());}};_0x1c110d(++_0x258870);}(_0xcb6c,0x67));var _0xccb6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcb6c[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0xccb6('0x0'));var config=require(_0xccb6('0x1'));config[_0xccb6('0x2')]=_[_0xccb6('0x3')](config[_0xccb6('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xccb6('0x4'))(new Redis(config[_0xccb6('0x2')]));function WhatsappQueue(_0x1a6d07){this['id']=_0x1a6d07['id']||0x0;this[_0xccb6('0x5')]=_0x1a6d07[_0xccb6('0x5')]||'';this['timeout']=_0x1a6d07[_0xccb6('0x6')]||0xa;this[_0xccb6('0x7')]=_0x1a6d07[_0xccb6('0x7')]||_0xccb6('0x8');this[_0xccb6('0x9')]=_0x1a6d07[_0xccb6('0x9')];this['mapAgentsId']={};this[_0xccb6('0xa')]=0x0;this[_0xccb6('0xb')]='';this[_0xccb6('0xc')]();this[_0xccb6('0xd')]();}WhatsappQueue[_0xccb6('0xe')][_0xccb6('0xc')]=function(){var _0x458a09=this[_0xccb6('0xf')][_0xccb6('0x10')];this[_0xccb6('0xf')]=_[_0xccb6('0x11')](this[_0xccb6('0x9')],'id');this[_0xccb6('0xf')][_0xccb6('0x10')]=_0x458a09;};WhatsappQueue[_0xccb6('0xe')][_0xccb6('0xd')]=function(){this[_0xccb6('0x12')]=0x0;this[_0xccb6('0x13')]=0x0;for(var _0x5172f6=0x0;_0x5172f6=0x0?this[_0xccb6('0x17')]:0x0;var _0x3cc912={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xccb6('0x13')],'waiting':this[_0xccb6('0xa')]};var _0xde8f56=md5(JSON[_0xccb6('0x18')](_0x3cc912));if(this['md5']!==_0xde8f56){this[_0xccb6('0xb')]=_0xde8f56;io['to'](util[_0xccb6('0x19')]('whatsapp:queue:%s',_0x3cc912['name']))['emit'](_0xccb6('0x1a'),_0x3cc912);}};module[_0xccb6('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 75cbe15..4a3244c 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0xfdc13c,_0x5ad7ad){var _0x458515=function(_0xc1a7ed){while(--_0xc1a7ed){_0xfdc13c['push'](_0xfdc13c['shift']());}};_0x458515(++_0x5ad7ad);}(_0xb10b,0x12a));var _0xbb10=function(_0x463a6e,_0x1b47b5){_0x463a6e=_0x463a6e-0x0;var _0x51d8c6=_0xb10b[_0x463a6e];return _0x51d8c6;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x47565f,_0x578b78){var _0x46d4e0=function(_0xdeba0b){while(--_0xdeba0b){_0x47565f['push'](_0x47565f['shift']());}};_0x46d4e0(++_0x578b78);}(_0xb10b,0x12a));var _0xbb10=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0xb10b[_0x2525f1];return _0x13c1b5;};'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 4749442..7cd93ad 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 _0x9b79=['UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x591d95,_0x3df684){var _0x472982=function(_0x20942b){while(--_0x20942b){_0x591d95['push'](_0x591d95['shift']());}};_0x472982(++_0x3df684);}(_0x9b79,0x15e));var _0x99b7=function(_0x1314d6,_0x214f2f){_0x1314d6=_0x1314d6-0x0;var _0x28b527=_0x9b79[_0x1314d6];return _0x28b527;};'use strict';var client=require(_0x99b7('0x0'));exports[_0x99b7('0x1')]=function(_0x532cee,_0x24758a){return client['Request'](_0x99b7('0x2'),{'body':_0x24758a,'options':{'where':{'id':_0x532cee}},'log':_0x99b7('0x3')});};exports[_0x99b7('0x4')]=function(_0x2aed07,_0x3f2355){return client[_0x99b7('0x5')](_0x99b7('0x6'),{'body':_0x3f2355,'options':{'where':{'id':_0x2aed07}},'log':_0x99b7('0x7')});}; \ No newline at end of file +var _0xccbe=['Request','updateChatInteraction','addTags','../client'];(function(_0xb4947e,_0x39de27){var _0x2af6df=function(_0x308271){while(--_0x308271){_0xb4947e['push'](_0xb4947e['shift']());}};_0x2af6df(++_0x39de27);}(_0xccbe,0x127));var _0xeccb=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xccbe[_0x1b5aea];return _0x15cfc6;};'use strict';var client=require(_0xeccb('0x0'));exports['update']=function(_0x355fcf,_0x11861d){return client[_0xeccb('0x1')]('UpdateChatInteraction',{'body':_0x11861d,'options':{'where':{'id':_0x355fcf}},'log':_0xeccb('0x2')});};exports[_0xeccb('0x3')]=function(_0x27ec88,_0xef7cd4){return client[_0xeccb('0x1')]('AddTagsToChatInteraction',{'body':_0xef7cd4,'options':{'where':{'id':_0x27ec88}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 5b6a4d0..3566d4e 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 _0x1364=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x36da16,_0xdac68c){var _0x1217ec=function(_0x4af7b3){while(--_0x4af7b3){_0x36da16['push'](_0x36da16['shift']());}};_0x1217ec(++_0xdac68c);}(_0x1364,0xb0));var _0x4136=function(_0x41282c,_0x5a7481){_0x41282c=_0x41282c-0x0;var _0x56447a=_0x1364[_0x41282c];return _0x56447a;};'use strict';var client=require(_0x4136('0x0'));exports[_0x4136('0x1')]=function(_0x4eacbc){return client[_0x4136('0x2')](_0x4136('0x3'),{'body':_0x4eacbc,'log':_0x4136('0x4')});}; \ No newline at end of file +var _0x009f=['../client','Request','CreateChatMessage','createChatMessage'];(function(_0x406d4f,_0x15b21){var _0x56f9ee=function(_0x565d55){while(--_0x565d55){_0x406d4f['push'](_0x406d4f['shift']());}};_0x56f9ee(++_0x15b21);}(_0x009f,0x110));var _0xf009=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0x009f[_0x441f7a];return _0x4821da;};'use strict';var client=require(_0xf009('0x0'));exports['create']=function(_0x4db155){return client[_0xf009('0x1')](_0xf009('0x2'),{'body':_0x4db155,'log':_0xf009('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c79c992..3a16646 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 _0xb2ef=['timeout','strategy','Agents','online','chatPause','../client','getChatQueues','Request','name'];(function(_0x3aff04,_0x45e2ae){var _0x4b769e=function(_0x2108ac){while(--_0x2108ac){_0x3aff04['push'](_0x3aff04['shift']());}};_0x4b769e(++_0x45e2ae);}(_0xb2ef,0xa7));var _0xfb2e=function(_0xb86a8f,_0xf6a3c5){_0xb86a8f=_0xb86a8f-0x0;var _0x95b549=_0xb2ef[_0xb86a8f];return _0x95b549;};'use strict';var client=require(_0xfb2e('0x0'));exports[_0xfb2e('0x1')]=function(){return function(){return client[_0xfb2e('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xfb2e('0x3'),_0xfb2e('0x4'),_0xfb2e('0x5')],'include':[{'model':'User','as':_0xfb2e('0x6'),'attributes':['id',_0xfb2e('0x3'),_0xfb2e('0x7'),_0xfb2e('0x8')]}]},'log':_0xfb2e('0x1')});};}; \ No newline at end of file +var _0xf2e0=['chatPause','../client','getChatQueues','GetChatQueue','name','strategy','User','Agents','online'];(function(_0x1dbaf5,_0x364bb8){var _0x329218=function(_0x28f482){while(--_0x28f482){_0x1dbaf5['push'](_0x1dbaf5['shift']());}};_0x329218(++_0x364bb8);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf2e0[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x0f2e('0x0'));exports[_0x0f2e('0x1')]=function(){return function(){return client['Request'](_0x0f2e('0x2'),{'options':{'raw':![],'attributes':['id',_0x0f2e('0x3'),'timeout',_0x0f2e('0x4')],'include':[{'model':_0x0f2e('0x5'),'as':_0x0f2e('0x6'),'attributes':['id','name',_0x0f2e('0x7'),_0x0f2e('0x8')]}]},'log':_0x0f2e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6cea6ff..5bbf0d7 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 _0x94dc=['Request','UpdateChatQueueReport','DESC','../client','CreateChatQueueReport','update'];(function(_0x2f3ca5,_0x3ba4ac){var _0x11cc85=function(_0x14b941){while(--_0x14b941){_0x2f3ca5['push'](_0x2f3ca5['shift']());}};_0x11cc85(++_0x3ba4ac);}(_0x94dc,0xb1));var _0xc94d=function(_0x43aef,_0x159ab2){_0x43aef=_0x43aef-0x0;var _0x2fe811=_0x94dc[_0x43aef];return _0x2fe811;};'use strict';var client=require(_0xc94d('0x0'));exports['create']=function(_0x2d9149){return client['Request'](_0xc94d('0x1'),{'body':_0x2d9149,'log':_0xc94d('0x1')});};exports[_0xc94d('0x2')]=function(_0x4b2dcc,_0x306706){return client[_0xc94d('0x3')](_0xc94d('0x4'),{'body':_0x306706,'options':{'where':{'uniqueid':_0x4b2dcc},'order':[['id',_0xc94d('0x5')]],'limit':0x1},'log':_0xc94d('0x4')});}; \ No newline at end of file +var _0x885e=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x4a704,_0x5337ec){var _0x581f3a=function(_0x5a45e1){while(--_0x5a45e1){_0x4a704['push'](_0x4a704['shift']());}};_0x581f3a(++_0x5337ec);}(_0x885e,0xe4));var _0xe885=function(_0x138fb7,_0x36f01b){_0x138fb7=_0x138fb7-0x0;var _0x390464=_0x885e[_0x138fb7];return _0x390464;};'use strict';var client=require(_0xe885('0x0'));exports[_0xe885('0x1')]=function(_0x53d182){return client[_0xe885('0x2')](_0xe885('0x3'),{'body':_0x53d182,'log':_0xe885('0x3')});};exports[_0xe885('0x4')]=function(_0x861437,_0x4fcd9b){return client['Request'](_0xe885('0x5'),{'body':_0x4fcd9b,'options':{'where':{'uniqueid':_0x861437},'order':[['id',_0xe885('0x6')]],'limit':0x1},'log':_0xe885('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 0471749..9643482 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x7a54,0x106));var _0x47a5=function(_0x24d539,_0x316f01){_0x24d539=_0x24d539-0x0;var _0x64c6a0=_0x7a54[_0x24d539];return _0x64c6a0;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4ecd53,_0xc9af83){var _0x3c2427=function(_0x577f99){while(--_0x577f99){_0x4ecd53['push'](_0x4ecd53['shift']());}};_0x3c2427(++_0xc9af83);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 7c592f2..e0985d9 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 _0x9d5f=['Request','CreateFaxMessage','../client'];(function(_0xaa8c2c,_0x36d94f){var _0x18f841=function(_0x332014){while(--_0x332014){_0xaa8c2c['push'](_0xaa8c2c['shift']());}};_0x18f841(++_0x36d94f);}(_0x9d5f,0x122));var _0xf9d5=function(_0x1c8f0d,_0x44aa14){_0x1c8f0d=_0x1c8f0d-0x0;var _0x56437e=_0x9d5f[_0x1c8f0d];return _0x56437e;};'use strict';var client=require(_0xf9d5('0x0'));exports['create']=function(_0x1321f7){return client[_0xf9d5('0x1')](_0xf9d5('0x2'),{'body':_0x1321f7,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x8eb7=['Request'];(function(_0x4f0a6e,_0x3f7a4e){var _0x1f8845=function(_0x5d3ab1){while(--_0x5d3ab1){_0x4f0a6e['push'](_0x4f0a6e['shift']());}};_0x1f8845(++_0x3f7a4e);}(_0x8eb7,0xb7));var _0x78eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8eb7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x4416c6){return client[_0x78eb('0x0')]('CreateFaxMessage',{'body':_0x4416c6,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 0cdc443..abec8a3 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 _0x2e12=['GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause','getFaxQueues','Request'];(function(_0x5bf5c9,_0x12ffec){var _0x2dcbd8=function(_0x27c400){while(--_0x27c400){_0x5bf5c9['push'](_0x5bf5c9['shift']());}};_0x2dcbd8(++_0x12ffec);}(_0x2e12,0x149));var _0x22e1=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x2e12[_0x455c6c];return _0x488242;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x22e1('0x0')](_0x22e1('0x1'),{'options':{'raw':![],'attributes':['id',_0x22e1('0x2'),_0x22e1('0x3'),_0x22e1('0x4')],'include':[{'model':_0x22e1('0x5'),'as':_0x22e1('0x6'),'attributes':['id','name',_0x22e1('0x7'),_0x22e1('0x8')]}]},'log':_0x22e1('0x9')});};}; \ No newline at end of file +var _0xbced=['Request','GetFaxQueue','name','timeout','strategy','User','Agents','getFaxQueues'];(function(_0x5bbf96,_0x45d9b4){var _0xebe176=function(_0x59c44b){while(--_0x59c44b){_0x5bbf96['push'](_0x5bbf96['shift']());}};_0xebe176(++_0x45d9b4);}(_0xbced,0x14f));var _0xdbce=function(_0x1ab115,_0x482f39){_0x1ab115=_0x1ab115-0x0;var _0x360167=_0xbced[_0x1ab115];return _0x360167;};'use strict';var client=require('../client');exports[_0xdbce('0x0')]=function(){return function(){return client[_0xdbce('0x1')](_0xdbce('0x2'),{'options':{'raw':![],'attributes':['id',_0xdbce('0x3'),_0xdbce('0x4'),_0xdbce('0x5')],'include':[{'model':_0xdbce('0x6'),'as':_0xdbce('0x7'),'attributes':['id',_0xdbce('0x3'),'online','faxPause']}]},'log':_0xdbce('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index cd36996..e0faa9b 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 _0x046a=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x398612,_0x445897){var _0x34dd66=function(_0x59999f){while(--_0x59999f){_0x398612['push'](_0x398612['shift']());}};_0x34dd66(++_0x445897);}(_0x046a,0x1af));var _0xa046=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x046a[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0xa046('0x0'));exports[_0xa046('0x1')]=function(_0x580410){return client[_0xa046('0x2')](_0xa046('0x3'),{'body':_0x580410,'log':_0xa046('0x3')});};exports[_0xa046('0x4')]=function(_0x522de0,_0x3dd636){return client['Request'](_0xa046('0x5'),{'body':_0x3dd636,'options':{'where':{'uniqueid':_0x522de0},'order':[['id',_0xa046('0x6')]],'limit':0x1},'log':_0xa046('0x5')});}; \ No newline at end of file +var _0xe221=['Request','CreateFaxQueueReport','UpdateFaxQueueReport','../client'];(function(_0x1381db,_0x2d93e9){var _0x50603c=function(_0x5af2f1){while(--_0x5af2f1){_0x1381db['push'](_0x1381db['shift']());}};_0x50603c(++_0x2d93e9);}(_0xe221,0x1d7));var _0x1e22=function(_0x27bc1d,_0x5b53d5){_0x27bc1d=_0x27bc1d-0x0;var _0x170135=_0xe221[_0x27bc1d];return _0x170135;};'use strict';var client=require(_0x1e22('0x0'));exports['create']=function(_0x4a1649){return client[_0x1e22('0x1')](_0x1e22('0x2'),{'body':_0x4a1649,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x33052f,_0x310c89){return client['Request'](_0x1e22('0x3'),{'body':_0x310c89,'options':{'where':{'uniqueid':_0x33052f},'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 3888130..96e9142 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 _0x06cd=['GetInterval','name','Interval','Intervals','getIntervals','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x06cd,0x106));var _0xd06c=function(_0x2384bb,_0x4d1756){_0x2384bb=_0x2384bb-0x0;var _0x561d35=_0x06cd[_0x2384bb];return _0x561d35;};'use strict';var client=require('../client');exports[_0xd06c('0x0')]=function(){return function(){return client[_0xd06c('0x1')](_0xd06c('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd06c('0x3')],'include':[{'model':_0xd06c('0x4'),'as':_0xd06c('0x5'),'attributes':['id',_0xd06c('0x3'),'interval']}]},'log':_0xd06c('0x0')});};}; \ No newline at end of file +var _0x05f2=['name','Interval','Intervals','interval','../client','getIntervals','GetInterval'];(function(_0x5a7481,_0x51f7d9){var _0x568792=function(_0xeba2e6){while(--_0xeba2e6){_0x5a7481['push'](_0x5a7481['shift']());}};_0x568792(++_0x51f7d9);}(_0x05f2,0x10e));var _0x205f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x05f2[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x205f('0x0'));exports[_0x205f('0x1')]=function(){return function(){return client['Request'](_0x205f('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x205f('0x3')],'include':[{'model':_0x205f('0x4'),'as':_0x205f('0x5'),'attributes':['id',_0x205f('0x3'),_0x205f('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 74da68f..bf2a924 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 _0x1893=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x439c70,_0x2f769a){var _0x179c0a=function(_0x27e599){while(--_0x27e599){_0x439c70['push'](_0x439c70['shift']());}};_0x179c0a(++_0x2f769a);}(_0x1893,0xa2));var _0x3189=function(_0x5e7361,_0x31140d){_0x5e7361=_0x5e7361-0x0;var _0x248a05=_0x1893[_0x5e7361];return _0x248a05;};'use strict';var client=require('../client');exports['update']=function(_0x1bfe8b,_0x3aec2b){return client[_0x3189('0x0')](_0x3189('0x1'),{'body':_0x3aec2b,'options':{'where':{'id':_0x1bfe8b}},'log':_0x3189('0x2')});};exports[_0x3189('0x3')]=function(_0x3953a2,_0x5371db){return client[_0x3189('0x0')](_0x3189('0x4'),{'body':_0x5371db,'options':{'where':{'id':_0x3953a2}},'log':_0x3189('0x5')});}; \ No newline at end of file +var _0x8aad=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x41fb98,_0x470189){var _0x4b0044=function(_0xf8b2ec){while(--_0xf8b2ec){_0x41fb98['push'](_0x41fb98['shift']());}};_0x4b0044(++_0x470189);}(_0x8aad,0x146));var _0xd8aa=function(_0x4d8b5a,_0x199caa){_0x4d8b5a=_0x4d8b5a-0x0;var _0x5e129d=_0x8aad[_0x4d8b5a];return _0x5e129d;};'use strict';var client=require(_0xd8aa('0x0'));exports[_0xd8aa('0x1')]=function(_0x54a6de,_0x11554c){return client['Request'](_0xd8aa('0x2'),{'body':_0x11554c,'options':{'where':{'id':_0x54a6de}},'log':_0xd8aa('0x3')});};exports['addTags']=function(_0x4a4235,_0x401aef){return client['Request']('AddTagsToMailInteraction',{'body':_0x401aef,'options':{'where':{'id':_0x4a4235}},'log':_0xd8aa('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 62d2f39..5df50b9 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 _0x53a7=['CreateMailMessage','createMailMessage','create'];(function(_0x1be07f,_0x5231bf){var _0x4243b1=function(_0x34bc3f){while(--_0x34bc3f){_0x1be07f['push'](_0x1be07f['shift']());}};_0x4243b1(++_0x5231bf);}(_0x53a7,0xf5));var _0x753a=function(_0x201de4,_0x26e3fb){_0x201de4=_0x201de4-0x0;var _0x37b482=_0x53a7[_0x201de4];return _0x37b482;};'use strict';var client=require('../client');exports[_0x753a('0x0')]=function(_0x49d5d9){return client['Request'](_0x753a('0x1'),{'body':_0x49d5d9,'log':_0x753a('0x2')});}; \ No newline at end of file +var _0x10a9=['Request','CreateMailMessage','createMailMessage'];(function(_0x21544f,_0x1b2b15){var _0x2585ff=function(_0x94d123){while(--_0x94d123){_0x21544f['push'](_0x21544f['shift']());}};_0x2585ff(++_0x1b2b15);}(_0x10a9,0x126));var _0x910a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x10a9[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['create']=function(_0x1b40fe){return client[_0x910a('0x0')](_0x910a('0x1'),{'body':_0x1b40fe,'log':_0x910a('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 8c0cde6..71df8a6 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 _0xd04f=['GetMailQueue','strategy','User','Agents','name','online','mailPause','../client','getMailQueues','Request'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xd04f,0x1e7));var _0xfd04=function(_0x541d27,_0x4ef82a){_0x541d27=_0x541d27-0x0;var _0x5a6ce6=_0xd04f[_0x541d27];return _0x5a6ce6;};'use strict';var client=require(_0xfd04('0x0'));exports[_0xfd04('0x1')]=function(){return function(){return client[_0xfd04('0x2')](_0xfd04('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xfd04('0x4')],'include':[{'model':_0xfd04('0x5'),'as':_0xfd04('0x6'),'attributes':['id',_0xfd04('0x7'),_0xfd04('0x8'),_0xfd04('0x9')]}]},'log':_0xfd04('0x1')});};}; \ No newline at end of file +var _0xcc24=['online','mailPause','getMailQueues','../client','Request','GetMailQueue','name','strategy','User','Agents'];(function(_0x254d73,_0x2447ca){var _0x5ab133=function(_0x383aef){while(--_0x383aef){_0x254d73['push'](_0x254d73['shift']());}};_0x5ab133(++_0x2447ca);}(_0xcc24,0x1bb));var _0x4cc2=function(_0x576f11,_0x2e4301){_0x576f11=_0x576f11-0x0;var _0x16ad6c=_0xcc24[_0x576f11];return _0x16ad6c;};'use strict';var client=require(_0x4cc2('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x4cc2('0x1')](_0x4cc2('0x2'),{'options':{'raw':![],'attributes':['id',_0x4cc2('0x3'),'timeout',_0x4cc2('0x4')],'include':[{'model':_0x4cc2('0x5'),'as':_0x4cc2('0x6'),'attributes':['id',_0x4cc2('0x3'),_0x4cc2('0x7'),_0x4cc2('0x8')]}]},'log':_0x4cc2('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 6d04681..5133b35 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 _0x56fa=['create','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x451b85,_0x24e31b){var _0x1addf0=function(_0x3a4baa){while(--_0x3a4baa){_0x451b85['push'](_0x451b85['shift']());}};_0x1addf0(++_0x24e31b);}(_0x56fa,0xf5));var _0xa56f=function(_0x2e7d35,_0x1651e7){_0x2e7d35=_0x2e7d35-0x0;var _0x1acb86=_0x56fa[_0x2e7d35];return _0x1acb86;};'use strict';var client=require(_0xa56f('0x0'));exports[_0xa56f('0x1')]=function(_0xf25e00){return client['Request'](_0xa56f('0x2'),{'body':_0xf25e00,'log':_0xa56f('0x2')});};exports[_0xa56f('0x3')]=function(_0x56ff03,_0x399296){return client['Request'](_0xa56f('0x4'),{'body':_0x399296,'options':{'where':{'uniqueid':_0x56ff03},'order':[['id',_0xa56f('0x5')]],'limit':0x1},'log':_0xa56f('0x4')});}; \ No newline at end of file +var _0xf5b6=['DESC','../client','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5b6,0x12d));var _0x6f5b=function(_0x4d0a29,_0x34b030){_0x4d0a29=_0x4d0a29-0x0;var _0x525a60=_0xf5b6[_0x4d0a29];return _0x525a60;};'use strict';var client=require(_0x6f5b('0x0'));exports['create']=function(_0x2c96a9){return client[_0x6f5b('0x1')](_0x6f5b('0x2'),{'body':_0x2c96a9,'log':_0x6f5b('0x2')});};exports[_0x6f5b('0x3')]=function(_0xb68adf,_0x2324ba){return client[_0x6f5b('0x1')](_0x6f5b('0x4'),{'body':_0x2324ba,'options':{'where':{'uniqueid':_0xb68adf},'order':[['id',_0x6f5b('0x5')]],'limit':0x1},'log':_0x6f5b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b518b70..f991a8c 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 _0xbdec=['addTagsToChatInteraction','../client','Request','AddTagsToOpenchannelInteraction'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbdec,0x1b5));var _0xcbde=function(_0x1ed05e,_0x307328){_0x1ed05e=_0x1ed05e-0x0;var _0x598183=_0xbdec[_0x1ed05e];return _0x598183;};'use strict';var client=require(_0xcbde('0x0'));exports['update']=function(_0x434121,_0x2b9497){return client[_0xcbde('0x1')]('UpdateOpenchannelInteraction',{'body':_0x2b9497,'options':{'where':{'id':_0x434121}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x427923,_0x4524e2){return client['Request'](_0xcbde('0x2'),{'body':_0x4524e2,'options':{'where':{'id':_0x427923}},'log':_0xcbde('0x3')});}; \ No newline at end of file +var _0x2b5d=['update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2b5d,0x11e));var _0xd2b5=function(_0x30c3fb,_0x5ab531){_0x30c3fb=_0x30c3fb-0x0;var _0xb3fc6=_0x2b5d[_0x30c3fb];return _0xb3fc6;};'use strict';var client=require(_0xd2b5('0x0'));exports[_0xd2b5('0x1')]=function(_0x1c37cf,_0x14a6ae){return client[_0xd2b5('0x2')]('UpdateOpenchannelInteraction',{'body':_0x14a6ae,'options':{'where':{'id':_0x1c37cf}},'log':_0xd2b5('0x3')});};exports[_0xd2b5('0x4')]=function(_0x35b0b5,_0x16d060){return client[_0xd2b5('0x2')](_0xd2b5('0x5'),{'body':_0x16d060,'options':{'where':{'id':_0x35b0b5}},'log':_0xd2b5('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 5725a9b..95df13d 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 _0x1859=['Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x490519,_0x52fb6f){var _0x4a33e7=function(_0x40fe16){while(--_0x40fe16){_0x490519['push'](_0x490519['shift']());}};_0x4a33e7(++_0x52fb6f);}(_0x1859,0x96));var _0x9185=function(_0x343a11,_0x579481){_0x343a11=_0x343a11-0x0;var _0x5da167=_0x1859[_0x343a11];return _0x5da167;};'use strict';var client=require('../client');exports['create']=function(_0x210568){return client[_0x9185('0x0')](_0x9185('0x1'),{'body':_0x210568,'log':_0x9185('0x2')});}; \ No newline at end of file +var _0x2e5c=['Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x2e5c,0x162));var _0xc2e5=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x2e5c[_0x20589d];return _0x422de9;};'use strict';var client=require('../client');exports['create']=function(_0x15862a){return client[_0xc2e5('0x0')](_0xc2e5('0x1'),{'body':_0x15862a,'log':_0xc2e5('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 67666c4..71aaf60 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 _0x0284=['online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','Agents'];(function(_0x1ccb95,_0x1b3be8){var _0x1a9725=function(_0x1a6bf7){while(--_0x1a6bf7){_0x1ccb95['push'](_0x1ccb95['shift']());}};_0x1a9725(++_0x1b3be8);}(_0x0284,0xd1));var _0x4028=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x0284[_0x10f6e8];return _0x35bb3c;};'use strict';var client=require('../client');exports[_0x4028('0x0')]=function(){return function(){return client[_0x4028('0x1')](_0x4028('0x2'),{'options':{'raw':![],'attributes':['id',_0x4028('0x3'),_0x4028('0x4'),_0x4028('0x5')],'include':[{'model':'User','as':_0x4028('0x6'),'attributes':['id',_0x4028('0x3'),_0x4028('0x7'),_0x4028('0x8')]}]},'log':_0x4028('0x0')});};}; \ No newline at end of file +var _0x2845=['Request','GetOpenchannelQueue','name','timeout','User','online','openchannelPause','getOpenchannelQueues'];(function(_0x18f854,_0x3ee5a8){var _0x48c7c6=function(_0xc8ad2e){while(--_0xc8ad2e){_0x18f854['push'](_0x18f854['shift']());}};_0x48c7c6(++_0x3ee5a8);}(_0x2845,0x100));var _0x5284=function(_0x3c3d7b,_0x565a6d){_0x3c3d7b=_0x3c3d7b-0x0;var _0x484bbb=_0x2845[_0x3c3d7b];return _0x484bbb;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x5284('0x0')](_0x5284('0x1'),{'options':{'raw':![],'attributes':['id',_0x5284('0x2'),_0x5284('0x3'),'strategy'],'include':[{'model':_0x5284('0x4'),'as':'Agents','attributes':['id',_0x5284('0x2'),_0x5284('0x5'),_0x5284('0x6')]}]},'log':_0x5284('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index d2ceca9..c9eee08 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 _0x0de4=['Request','UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport'];(function(_0x2b4feb,_0x2c7dc4){var _0x2ead15=function(_0x10ef80){while(--_0x10ef80){_0x2b4feb['push'](_0x2b4feb['shift']());}};_0x2ead15(++_0x2c7dc4);}(_0x0de4,0xe7));var _0x40de=function(_0x200907,_0x4b422e){_0x200907=_0x200907-0x0;var _0x48d586=_0x0de4[_0x200907];return _0x48d586;};'use strict';var client=require(_0x40de('0x0'));exports[_0x40de('0x1')]=function(_0x2859ec){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x2859ec,'log':_0x40de('0x2')});};exports['update']=function(_0x50fc29,_0x1c3d8a){return client[_0x40de('0x3')](_0x40de('0x4'),{'body':_0x1c3d8a,'options':{'where':{'uniqueid':_0x50fc29},'order':[['id',_0x40de('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xbfa0=['UpdateOpenchannelQueueReport','DESC','create','CreateOpenchannelQueueReport'];(function(_0x21f06a,_0x29758f){var _0x1fc2eb=function(_0xc56a40){while(--_0xc56a40){_0x21f06a['push'](_0x21f06a['shift']());}};_0x1fc2eb(++_0x29758f);}(_0xbfa0,0x86));var _0x0bfa=function(_0x5248c7,_0x33198e){_0x5248c7=_0x5248c7-0x0;var _0x58cff6=_0xbfa0[_0x5248c7];return _0x58cff6;};'use strict';var client=require('../client');exports[_0x0bfa('0x0')]=function(_0x352529){return client['Request'](_0x0bfa('0x1'),{'body':_0x352529,'log':_0x0bfa('0x1')});};exports['update']=function(_0x1d12c1,_0x10e0e7){return client['Request'](_0x0bfa('0x2'),{'body':_0x10e0e7,'options':{'where':{'uniqueid':_0x1d12c1},'order':[['id',_0x0bfa('0x3')]],'limit':0x1},'log':_0x0bfa('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index ebbea52..9356825 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 _0x87df=['addTags','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0xa521cb,_0x274e3e){var _0x159b3d=function(_0x5424d6){while(--_0x5424d6){_0xa521cb['push'](_0xa521cb['shift']());}};_0x159b3d(++_0x274e3e);}(_0x87df,0x167));var _0xf87d=function(_0x227c9b,_0x34d983){_0x227c9b=_0x227c9b-0x0;var _0x37f247=_0x87df[_0x227c9b];return _0x37f247;};'use strict';var client=require(_0xf87d('0x0'));exports[_0xf87d('0x1')]=function(_0x34023a,_0x3151d0){return client[_0xf87d('0x2')](_0xf87d('0x3'),{'body':_0x3151d0,'options':{'where':{'id':_0x34023a}},'log':_0xf87d('0x4')});};exports[_0xf87d('0x5')]=function(_0x25290a,_0x1d4ff6){return client['Request']('AddTagsToSmsInteraction',{'body':_0x1d4ff6,'options':{'where':{'id':_0x25290a}},'log':_0xf87d('0x6')});}; \ No newline at end of file +var _0x032e=['addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','updateSmsInteraction'];(function(_0x24619d,_0x4436c){var _0x31513b=function(_0x5e0451){while(--_0x5e0451){_0x24619d['push'](_0x24619d['shift']());}};_0x31513b(++_0x4436c);}(_0x032e,0x124));var _0xe032=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x032e[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0xe032('0x0'));exports['update']=function(_0x299adf,_0x1cf95c){return client['Request']('UpdateSmsInteraction',{'body':_0x1cf95c,'options':{'where':{'id':_0x299adf}},'log':_0xe032('0x1')});};exports[_0xe032('0x2')]=function(_0x2f44f6,_0x1983cc){return client[_0xe032('0x3')](_0xe032('0x4'),{'body':_0x1983cc,'options':{'where':{'id':_0x2f44f6}},'log':_0xe032('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 600bd85..aec37c9 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 _0xb95c=['../client','create','Request'];(function(_0x5cdacf,_0x7c82b1){var _0xa68a8b=function(_0x4b3818){while(--_0x4b3818){_0x5cdacf['push'](_0x5cdacf['shift']());}};_0xa68a8b(++_0x7c82b1);}(_0xb95c,0x156));var _0xcb95=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb95c[_0x565c49];return _0x20ca34;};'use strict';var client=require(_0xcb95('0x0'));exports[_0xcb95('0x1')]=function(_0x4c3e8c){return client[_0xcb95('0x2')]('CreateSmsMessage',{'body':_0x4c3e8c,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xd4aa=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x2b0026,_0x30a1f0){var _0x182ae5=function(_0x5a5d02){while(--_0x5a5d02){_0x2b0026['push'](_0x2b0026['shift']());}};_0x182ae5(++_0x30a1f0);}(_0xd4aa,0x1c8));var _0xad4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xd4aa[_0x1969a7];return _0x3d665f;};'use strict';var client=require('../client');exports[_0xad4a('0x0')]=function(_0x2336a1){return client[_0xad4a('0x1')](_0xad4a('0x2'),{'body':_0x2336a1,'log':_0xad4a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index aee3ea8..4d9e286 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x419253,_0x626783){var _0xc9c96f=function(_0x2f167f){while(--_0x2f167f){_0x419253['push'](_0x419253['shift']());}};_0xc9c96f(++_0x626783);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xcb91[_0x258b93];return _0x35484b;};'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 +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x193920,_0x3805b7){var _0x49063e=function(_0xd85019){while(--_0xd85019){_0x193920['push'](_0x193920['shift']());}};_0x49063e(++_0x3805b7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index bea312d..504bf06 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x25831a,_0x3027d1){var _0x141686=function(_0xac7268){while(--_0xac7268){_0x25831a['push'](_0x25831a['shift']());}};_0x141686(++_0x3027d1);}(_0x008c,0x188));var _0xc008=function(_0x2ce9c3,_0x20a165){_0x2ce9c3=_0x2ce9c3-0x0;var _0x109b3a=_0x008c[_0x2ce9c3];return _0x109b3a;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x37b20e,_0x2359d6){var _0x5db28f=function(_0x290a17){while(--_0x290a17){_0x37b20e['push'](_0x37b20e['shift']());}};_0x5db28f(++_0x2359d6);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8770093..b838677 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(_0x17099f,_0x52db2a){var _0x2078fe=function(_0x5779d1){while(--_0x5779d1){_0x17099f['push'](_0x17099f['shift']());}};_0x2078fe(++_0x52db2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x14189f,_0x1de4a3){var _0x59ac9c=function(_0x1d6405){while(--_0x1d6405){_0x14189f['push'](_0x14189f['shift']());}};_0x59ac9c(++_0x1de4a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 9ff99f9..76e4118 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 _0x9bd9=['../client','update','Request','UpdateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x1df3e5,_0x2d37f1){_0x1df3e5=_0x1df3e5-0x0;var _0x422d0c=_0x9bd9[_0x1df3e5];return _0x422d0c;};'use strict';var client=require(_0x99bd('0x0'));exports[_0x99bd('0x1')]=function(_0x2a3101,_0x3ed553){return client[_0x99bd('0x2')](_0x99bd('0x3'),{'body':_0x3ed553,'options':{'where':{'id':_0x2a3101}},'log':'updateWhatsappInteraction'});};exports[_0x99bd('0x4')]=function(_0x4a0491,_0x204fbb){return client[_0x99bd('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x204fbb,'options':{'where':{'id':_0x4a0491}},'log':_0x99bd('0x5')});}; \ No newline at end of file +var _0x8085=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request'];(function(_0x3b2421,_0xf30f91){var _0x288bde=function(_0x1d1db6){while(--_0x1d1db6){_0x3b2421['push'](_0x3b2421['shift']());}};_0x288bde(++_0xf30f91);}(_0x8085,0x71));var _0x5808=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x8085[_0x4eafed];return _0x159c85;};'use strict';var client=require(_0x5808('0x0'));exports['update']=function(_0x51b546,_0x8666b5){return client[_0x5808('0x1')](_0x5808('0x2'),{'body':_0x8666b5,'options':{'where':{'id':_0x51b546}},'log':_0x5808('0x3')});};exports['addTags']=function(_0x55952d,_0x46a877){return client[_0x5808('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x46a877,'options':{'where':{'id':_0x55952d}},'log':_0x5808('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index aa00bbd..07911e4 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 _0xc8bb=['CreateWhatsappMessage','../client','create','Request'];(function(_0x16ca8e,_0x60f267){var _0x4c560e=function(_0x40e8e5){while(--_0x40e8e5){_0x16ca8e['push'](_0x16ca8e['shift']());}};_0x4c560e(++_0x60f267);}(_0xc8bb,0x71));var _0xbc8b=function(_0x17cf56,_0x3750d3){_0x17cf56=_0x17cf56-0x0;var _0x3437ab=_0xc8bb[_0x17cf56];return _0x3437ab;};'use strict';var client=require(_0xbc8b('0x0'));exports[_0xbc8b('0x1')]=function(_0x5c84d7){return client[_0xbc8b('0x2')](_0xbc8b('0x3'),{'body':_0x5c84d7,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x2859=['CreateWhatsappMessage','createWhatsappMessage','create','Request'];(function(_0x48e6bb,_0x17d21b){var _0x170bec=function(_0x1a1b74){while(--_0x1a1b74){_0x48e6bb['push'](_0x48e6bb['shift']());}};_0x170bec(++_0x17d21b);}(_0x2859,0x9e));var _0x9285=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2859[_0x502c7d];return _0x30b7ed;};'use strict';var client=require('../client');exports[_0x9285('0x0')]=function(_0x13a201){return client[_0x9285('0x1')](_0x9285('0x2'),{'body':_0x13a201,'log':_0x9285('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 1a97957..0801f70 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 _0x116a=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User','Agents'];(function(_0x3468a2,_0x2ea696){var _0x686f60=function(_0x5a7e63){while(--_0x5a7e63){_0x3468a2['push'](_0x3468a2['shift']());}};_0x686f60(++_0x2ea696);}(_0x116a,0x174));var _0xa116=function(_0x496be8,_0x5cc6d8){_0x496be8=_0x496be8-0x0;var _0x52a808=_0x116a[_0x496be8];return _0x52a808;};'use strict';var client=require(_0xa116('0x0'));exports[_0xa116('0x1')]=function(){return function(){return client[_0xa116('0x2')](_0xa116('0x3'),{'options':{'raw':![],'attributes':['id',_0xa116('0x4'),'timeout',_0xa116('0x5')],'include':[{'model':_0xa116('0x6'),'as':_0xa116('0x7'),'attributes':['id',_0xa116('0x4'),_0xa116('0x8'),_0xa116('0x9')]}]},'log':_0xa116('0x1')});};}; \ No newline at end of file +var _0x3209=['User','Agents','../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy'];(function(_0x50a52e,_0x58877d){var _0x2f68d4=function(_0x3a7ebb){while(--_0x3a7ebb){_0x50a52e['push'](_0x50a52e['shift']());}};_0x2f68d4(++_0x58877d);}(_0x3209,0x1ca));var _0x9320=function(_0x21a38d,_0x29b6c1){_0x21a38d=_0x21a38d-0x0;var _0x94ce0c=_0x3209[_0x21a38d];return _0x94ce0c;};'use strict';var client=require(_0x9320('0x0'));exports[_0x9320('0x1')]=function(){return function(){return client['Request'](_0x9320('0x2'),{'options':{'raw':![],'attributes':['id',_0x9320('0x3'),_0x9320('0x4'),_0x9320('0x5')],'include':[{'model':_0x9320('0x6'),'as':_0x9320('0x7'),'attributes':['id','name','online','whatsappPause']}]},'log':_0x9320('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index c1002dd..d4c786c 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 _0xea6f=['../client','create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0x3d0247,_0x2e5a09){var _0x5d2f3a=function(_0x441e19){while(--_0x441e19){_0x3d0247['push'](_0x3d0247['shift']());}};_0x5d2f3a(++_0x2e5a09);}(_0xea6f,0x192));var _0xfea6=function(_0x33f2ed,_0x38e148){_0x33f2ed=_0x33f2ed-0x0;var _0x4fdb56=_0xea6f[_0x33f2ed];return _0x4fdb56;};'use strict';var client=require(_0xfea6('0x0'));exports[_0xfea6('0x1')]=function(_0x40b9ac){return client['Request'](_0xfea6('0x2'),{'body':_0x40b9ac,'log':_0xfea6('0x2')});};exports[_0xfea6('0x3')]=function(_0x463462,_0xf42285){return client[_0xfea6('0x4')](_0xfea6('0x5'),{'body':_0xf42285,'options':{'where':{'uniqueid':_0x463462},'order':[['id','DESC']],'limit':0x1},'log':_0xfea6('0x5')});}; \ No newline at end of file +var _0xa41b=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0x3b9b2e,_0x1d3afe){var _0x3e1a74=function(_0x1d5439){while(--_0x1d5439){_0x3b9b2e['push'](_0x3b9b2e['shift']());}};_0x3e1a74(++_0x1d3afe);}(_0xa41b,0xe6));var _0xba41=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xa41b[_0x256b72];return _0x2183e3;};'use strict';var client=require('../client');exports[_0xba41('0x0')]=function(_0x7ccc9d){return client[_0xba41('0x1')](_0xba41('0x2'),{'body':_0x7ccc9d,'log':_0xba41('0x2')});};exports['update']=function(_0x217a2f,_0x4b25a1){return client['Request'](_0xba41('0x3'),{'body':_0x4b25a1,'options':{'where':{'uniqueid':_0x217a2f},'order':[['id',_0xba41('0x4')]],'limit':0x1},'log':_0xba41('0x3')});}; \ 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 8df12b7..b00a2f5 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 _0xc277=['end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','stop','complete','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','map','find','agents','timeout','createQueue','atimeout','channel','START:%s'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0xc277,0x107));var _0x7c27=function(_0x1014a6,_0x3338b2){_0x1014a6=_0x1014a6-0x0;var _0x28e221=_0xc277[_0x1014a6];return _0x28e221;};'use strict';var schema=require(_0x7c27('0x0'));var _=require(_0x7c27('0x1'));var util=require(_0x7c27('0x2'));var seqqueue=require(_0x7c27('0x3'));var logger=require(_0x7c27('0x4'))(_0x7c27('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x7c27('0x6'),'required':!![],'message':_0x7c27('0x7')},'timeout':{'type':_0x7c27('0x8'),'message':_0x7c27('0x9')}});function writeLog(_0x42bc11,_0x429931,_0x3a06e2){return logger[_0x7c27('0xa')](util[_0x7c27('0xb')](_0x7c27('0xc'),_0x42bc11,_0x429931[_0x7c27('0xd')],_0x3a06e2));}function handleFindAgent(_0x36883e){return function(_0x586d71){return _0x586d71['name']['toLowerCase']()===_0x36883e[_0x7c27('0xe')]();};}exports['consequence']=function(_0x909672,_0x36dc5d,_0x2dabfd,_0x5c696e){return function(_0x5b87c6){try{var _0x42dd02={'name':_0x36dc5d[0x0],'timeout':_0x36dc5d[0x1]};var _0x1fedc0=queue[_0x7c27('0x0')](_0x42dd02,{'typecast':!![]});if(_0x1fedc0[_0x7c27('0xf')]){logger[_0x7c27('0x10')]('[%s][AGENT]\x20%s',_0x909672,_[_0x7c27('0x11')](_0x1fedc0,'message')['join'](',\x20'));_0x5b87c6['stop']();}else{var _0x29f954=_[_0x7c27('0x12')](_0x2dabfd[_0x7c27('0x13')],handleFindAgent(_0x42dd02['name']));if(_0x29f954){var _0x15c47d=(_0x42dd02[_0x7c27('0x14')]||0xa)*0x3e8;var _0x32ae42,_0x55f993;var _0x49dc70=seqqueue[_0x7c27('0x15')](_0x15c47d);_0x49dc70['id']=_0x909672;_0x49dc70[_0x7c27('0x16')]=_0x15c47d;_0x49dc70[_0x7c27('0x17')]=_0x5c696e[_0x7c27('0x17')];writeLog(_0x909672,_0x29f954,util['format'](_0x7c27('0x18'),_0x15c47d));_0x2dabfd['rules'][_0x909672]['on'](_0x7c27('0x19'),function(){logger[_0x7c27('0xa')](_0x7c27('0x1a'),_0x909672);clearTimeout(_0x55f993);_0x55f993=undefined;_0x49dc70[_0x7c27('0x1b')]();if(_0x2dabfd[_0x7c27('0x1c')][_0x909672]){delete _0x2dabfd[_0x7c27('0x1c')][_0x909672];}_0x5b87c6[_0x7c27('0x1d')]();});_0x2dabfd[_0x7c27('0x1c')][_0x909672]['on'](_0x7c27('0x1e'),function(){if(_0x2dabfd[_0x7c27('0x1c')][_0x909672]){delete _0x2dabfd[_0x7c27('0x1c')][_0x909672];}});_0x55f993=setTimeout(function(){logger[_0x7c27('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x909672);clearTimeout(_0x55f993);_0x49dc70[_0x7c27('0x1b')]();_0x5b87c6[_0x7c27('0x1f')]();},_0x15c47d);strategy[_0x7c27('0x20')](_0x49dc70,_0x29f954,_0x2dabfd,_0x5c696e);}else{logger[_0x7c27('0x10')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x909672,_0x42dd02[_0x7c27('0xd')]);_0x5b87c6[_0x7c27('0x1d')]();}}}catch(_0x199303){console[_0x7c27('0x21')](_0x199303);logger[_0x7c27('0x10')](_0x7c27('0x22'),_0x909672,_0x199303[_0x7c27('0x23')]);_0x5b87c6[_0x7c27('0x1d')]();}};}; \ No newline at end of file +var _0x8360=['channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','stop','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','length','error','message','join','find','agents','timeout','createQueue','atimeout'];(function(_0x1aee0d,_0x51aa5e){var _0x4a34c4=function(_0xbddc9a){while(--_0xbddc9a){_0x1aee0d['push'](_0x1aee0d['shift']());}};_0x4a34c4(++_0x51aa5e);}(_0x8360,0x18e));var _0x0836=function(_0x21c7a2,_0x1b1d44){_0x21c7a2=_0x21c7a2-0x0;var _0x4c8548=_0x8360[_0x21c7a2];return _0x4c8548;};'use strict';var schema=require('validate');var _=require(_0x0836('0x0'));var util=require(_0x0836('0x1'));var seqqueue=require(_0x0836('0x2'));var logger=require(_0x0836('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0x0836('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x0836('0x5'),'message':_0x0836('0x6')}});function writeLog(_0x5df682,_0x3e4a4c,_0x41a2b0){return logger[_0x0836('0x7')](util[_0x0836('0x8')](_0x0836('0x9'),_0x5df682,_0x3e4a4c['name'],_0x41a2b0));}function handleFindAgent(_0x45d43b){return function(_0x5541d7){return _0x5541d7[_0x0836('0xa')]['toLowerCase']()===_0x45d43b[_0x0836('0xb')]();};}exports['consequence']=function(_0x226af6,_0x776367,_0x241482,_0x19253e){return function(_0x5e674c){try{var _0x5e85e8={'name':_0x776367[0x0],'timeout':_0x776367[0x1]};var _0x47cfc7=queue[_0x0836('0xc')](_0x5e85e8,{'typecast':!![]});if(_0x47cfc7[_0x0836('0xd')]){logger[_0x0836('0xe')]('[%s][AGENT]\x20%s',_0x226af6,_['map'](_0x47cfc7,_0x0836('0xf'))[_0x0836('0x10')](',\x20'));_0x5e674c['stop']();}else{var _0x1c6ff7=_[_0x0836('0x11')](_0x241482[_0x0836('0x12')],handleFindAgent(_0x5e85e8[_0x0836('0xa')]));if(_0x1c6ff7){var _0x32f223=(_0x5e85e8[_0x0836('0x13')]||0xa)*0x3e8;var _0x256a90,_0xcc7d26;var _0x2449c0=seqqueue[_0x0836('0x14')](_0x32f223);_0x2449c0['id']=_0x226af6;_0x2449c0[_0x0836('0x15')]=_0x32f223;_0x2449c0[_0x0836('0x16')]=_0x19253e['channel'];writeLog(_0x226af6,_0x1c6ff7,util['format']('START:%s',_0x32f223));_0x241482[_0x0836('0x17')][_0x226af6]['on'](_0x0836('0x18'),function(){logger['info'](_0x0836('0x19'),_0x226af6);clearTimeout(_0xcc7d26);_0xcc7d26=undefined;_0x2449c0[_0x0836('0x1a')]();if(_0x241482[_0x0836('0x17')][_0x226af6]){delete _0x241482[_0x0836('0x17')][_0x226af6];}_0x5e674c['stop']();});_0x241482[_0x0836('0x17')][_0x226af6]['on'](_0x0836('0x1b'),function(){if(_0x241482[_0x0836('0x17')][_0x226af6]){delete _0x241482[_0x0836('0x17')][_0x226af6];}});_0xcc7d26=setTimeout(function(){logger[_0x0836('0x7')](_0x0836('0x1c'),_0x226af6);clearTimeout(_0xcc7d26);_0x2449c0['close']();_0x5e674c[_0x0836('0x1d')]();},_0x32f223);strategy[_0x0836('0x1e')](_0x2449c0,_0x1c6ff7,_0x241482,_0x19253e);}else{logger[_0x0836('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x226af6,_0x5e85e8[_0x0836('0xa')]);_0x5e674c[_0x0836('0x1f')]();}}}catch(_0x2b7eab){console[_0x0836('0x20')](_0x2b7eab);logger[_0x0836('0xe')](_0x0836('0x21'),_0x226af6,_0x2b7eab[_0x0836('0x22')]);_0x5e674c[_0x0836('0x1f')]();}};}; \ 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 6627780..c71c54d 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 _0xe1e7=['interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','LexRuntime','$LATEST','message','body','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','stop','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil'];(function(_0x192ebe,_0x12ad28){var _0x427cfa=function(_0x42e5ec){while(--_0x42e5ec){_0x192ebe['push'](_0x192ebe['shift']());}};_0x427cfa(++_0x12ad28);}(_0xe1e7,0x1ae));var _0x7e1e=function(_0x1714b2,_0x5b728){_0x1714b2=_0x1714b2-0x0;var _0x510d01=_0xe1e7[_0x1714b2];return _0x510d01;};'use strict';var _=require(_0x7e1e('0x0'));var moment=require(_0x7e1e('0x1'));var AWS=require(_0x7e1e('0x2'));var utils=require(_0x7e1e('0x3'));var logger=require(_0x7e1e('0x4'))(_0x7e1e('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7e1e('0x6')),'mailMessage':require(_0x7e1e('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7e1e('0x8'))};exports[_0x7e1e('0x9')]=function(_0x17f753,_0x5948da){return function(_0x1af6b4){try{if(!_[_0x7e1e('0xa')](this[_0x7e1e('0xb')][_0x7e1e('0xc')])){logger[_0x7e1e('0xd')](_0x7e1e('0xe'),_0x17f753,_0x7e1e('0xf'));return _0x1af6b4[_0x7e1e('0x10')]();}var _0x21fcc7={'ContactId':this[_0x7e1e('0x11')]['id'],'sentAt':moment()[_0x7e1e('0x12')](_0x7e1e('0x13')),'direction':'out'};if(this[_0x7e1e('0x14')]==='sms'||this[_0x7e1e('0x14')]===_0x7e1e('0x15')){_0x21fcc7['phone']=this[_0x7e1e('0xb')][_0x7e1e('0x16')];}var _0x5425=this[_0x7e1e('0x14')];if(_0x5425===_0x7e1e('0x17')){_0x21fcc7[_0x7e1e('0x18')]=this['account']['id'];}else{_0x21fcc7[_[_0x7e1e('0x19')](_0x5425)+_0x7e1e('0x1a')]=this[_0x7e1e('0x1b')]['id'];}_0x21fcc7[_['upperFirst'](_0x5425)+'InteractionId']=this[_0x7e1e('0xb')]['id'];if(this[_0x7e1e('0xb')]['created']){var _0x90d695=_0x5948da[0x4];if(!_['isEmpty'](_0x90d695)){_0x21fcc7['body']=utils[_0x7e1e('0x1c')](_0x90d695,this);return rpc[_0x5425+_0x7e1e('0x1d')][_0x7e1e('0x1e')](_0x21fcc7)[_0x7e1e('0x1f')](function(_0x3586d4){logger[_0x7e1e('0xd')]('[%s][AMAZONLEX]\x20%s',_0x17f753,_0x21fcc7['body']);})[_0x7e1e('0x20')](function(_0x276028){logger[_0x7e1e('0x21')](_0x7e1e('0xe'),_0x17f753,JSON[_0x7e1e('0x22')](_0x276028));})[_0x7e1e('0x23')](function(){logger['info'](_0x7e1e('0x24'),_0x17f753);_0x1af6b4['stop']();});}else{logger[_0x7e1e('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x17f753);_0x1af6b4['stop']();}}else{var _0x54d97b=this;var _0x5a3ba6=new AWS[(_0x7e1e('0x25'))]({'accessKeyId':_0x5948da[0x0],'secretAccessKey':_0x5948da[0x1],'region':_0x5948da[0x2]});var _0x241370={'botAlias':_0x7e1e('0x26'),'botName':_0x5948da[0x3],'inputText':this[_0x7e1e('0x27')][_0x7e1e('0x28')],'userId':this[_0x7e1e('0x14')]+':'+this[_0x7e1e('0xb')]['id'][_0x7e1e('0x29')]()};_0x5a3ba6[_0x7e1e('0x2a')](_0x241370,function(_0x47b3dc,_0x83b33e){if(_0x47b3dc){logger['error']('[%s][AMAZONLEX]\x20%s',_0x17f753,_0x47b3dc[_0x7e1e('0x27')]);_0x1af6b4[_0x7e1e('0x10')]();}else if(_0x83b33e&&_0x83b33e[_0x7e1e('0x27')]){_0x54d97b[_0x7e1e('0x28')][_0x7e1e('0x2b')]=_0x83b33e;_0x21fcc7[_0x7e1e('0x28')]=_0x83b33e['message'];_0x21fcc7[_0x7e1e('0x2c')]='amazonlex';_0x21fcc7[_0x7e1e('0x2d')]=JSON[_0x7e1e('0x22')](_0x83b33e);return rpc[_0x5425+'Message'][_0x7e1e('0x1e')](_0x21fcc7)[_0x7e1e('0x1f')](function(_0xc87b27){logger[_0x7e1e('0xd')](_0x7e1e('0xe'),_0x17f753,_0x21fcc7[_0x7e1e('0x28')]);if(_0x83b33e[_0x7e1e('0x2e')]==_0x7e1e('0x2f')){_0x1af6b4[_0x7e1e('0x10')]();}else{_0x1af6b4[_0x7e1e('0x30')]();}})['catch'](function(_0xa21da3){logger[_0x7e1e('0x21')](_0x7e1e('0xe'),_0x17f753,JSON[_0x7e1e('0x22')](_0xa21da3));_0x1af6b4[_0x7e1e('0x10')]();});}else{_0x1af6b4[_0x7e1e('0x10')]();}});}}catch(_0x2683e7){logger[_0x7e1e('0x21')]('[%s][AMAZONLEX]\x20%s',_0x17f753,JSON['stringify'](_0x2683e7));_0x1af6b4['stop']();}};}; \ No newline at end of file +var _0x2ed0=['upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerResponse','stringify','Failed','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','sms','phone','chat','ChatWebsiteId','account'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x2ed0,0x1bd));var _0x02ed=function(_0x14c56c,_0x2a156a){_0x14c56c=_0x14c56c-0x0;var _0x14613f=_0x2ed0[_0x14c56c];return _0x14613f;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x02ed('0x0'));var logger=require('../../../../config/logger')(_0x02ed('0x1'));var rpc={'chatMessage':require(_0x02ed('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x02ed('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x5e0c44,_0x16e661){return function(_0x43b0f3){try{if(!_['isNil'](this[_0x02ed('0x4')][_0x02ed('0x5')])){logger['info'](_0x02ed('0x6'),_0x5e0c44,_0x02ed('0x7'));return _0x43b0f3[_0x02ed('0x8')]();}var _0x433d71={'ContactId':this[_0x02ed('0x9')]['id'],'sentAt':moment()[_0x02ed('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x02ed('0xb')]===_0x02ed('0xc')||this[_0x02ed('0xb')]==='whatsapp'){_0x433d71[_0x02ed('0xd')]=this['interaction'][_0x02ed('0xd')];}var _0x434520=this[_0x02ed('0xb')];if(_0x434520===_0x02ed('0xe')){_0x433d71[_0x02ed('0xf')]=this[_0x02ed('0x10')]['id'];}else{_0x433d71[_[_0x02ed('0x11')](_0x434520)+_0x02ed('0x12')]=this[_0x02ed('0x10')]['id'];}_0x433d71[_[_0x02ed('0x11')](_0x434520)+'InteractionId']=this[_0x02ed('0x4')]['id'];if(this[_0x02ed('0x4')][_0x02ed('0x13')]){var _0x1b9513=_0x16e661[0x4];if(!_[_0x02ed('0x14')](_0x1b9513)){_0x433d71[_0x02ed('0x15')]=utils[_0x02ed('0x16')](_0x1b9513,this);return rpc[_0x434520+_0x02ed('0x17')][_0x02ed('0x18')](_0x433d71)[_0x02ed('0x19')](function(_0xc5d14f){logger[_0x02ed('0x1a')](_0x02ed('0x6'),_0x5e0c44,_0x433d71[_0x02ed('0x15')]);})[_0x02ed('0x1b')](function(_0xdb6b4f){logger[_0x02ed('0x1c')](_0x02ed('0x6'),_0x5e0c44,JSON['stringify'](_0xdb6b4f));})[_0x02ed('0x1d')](function(){logger['info'](_0x02ed('0x1e'),_0x5e0c44);_0x43b0f3[_0x02ed('0x1f')]();});}else{logger[_0x02ed('0x1a')](_0x02ed('0x20'),_0x5e0c44);_0x43b0f3[_0x02ed('0x1f')]();}}else{var _0x27ce17=this;var _0x5bfc1a=new AWS[(_0x02ed('0x21'))]({'accessKeyId':_0x16e661[0x0],'secretAccessKey':_0x16e661[0x1],'region':_0x16e661[0x2]});var _0x577505={'botAlias':_0x02ed('0x22'),'botName':_0x16e661[0x3],'inputText':this[_0x02ed('0x23')][_0x02ed('0x15')],'userId':this['channel']+':'+this[_0x02ed('0x4')]['id'][_0x02ed('0x24')]()};_0x5bfc1a[_0x02ed('0x25')](_0x577505,function(_0x9e50ea,_0x15ce5d){if(_0x9e50ea){logger[_0x02ed('0x1c')](_0x02ed('0x6'),_0x5e0c44,_0x9e50ea[_0x02ed('0x23')]);_0x43b0f3['next']();}else if(_0x15ce5d&&_0x15ce5d[_0x02ed('0x23')]){_0x27ce17[_0x02ed('0x15')][_0x02ed('0x26')]=_0x15ce5d;_0x433d71[_0x02ed('0x15')]=_0x15ce5d[_0x02ed('0x23')];_0x433d71['providerName']=_0x02ed('0x26');_0x433d71[_0x02ed('0x27')]=JSON[_0x02ed('0x28')](_0x15ce5d);return rpc[_0x434520+_0x02ed('0x17')][_0x02ed('0x18')](_0x433d71)[_0x02ed('0x19')](function(_0x52e245){logger[_0x02ed('0x1a')](_0x02ed('0x6'),_0x5e0c44,_0x433d71[_0x02ed('0x15')]);if(_0x15ce5d['dialogState']==_0x02ed('0x29')){_0x43b0f3['next']();}else{_0x43b0f3[_0x02ed('0x1f')]();}})[_0x02ed('0x1b')](function(_0xd604d6){logger['error'](_0x02ed('0x6'),_0x5e0c44,JSON[_0x02ed('0x28')](_0xd604d6));_0x43b0f3[_0x02ed('0x8')]();});}else{_0x43b0f3[_0x02ed('0x8')]();}});}}catch(_0xbd75d7){logger[_0x02ed('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x5e0c44,JSON[_0x02ed('0x28')](_0xbd75d7));_0x43b0f3['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 cbc67c6..4647921 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 _0xad6d=['sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','stop','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','account','upperFirst','InteractionId','Message','inReplyTo','messageId','html','','','headers','auto-replied','All','auto_reply'];(function(_0x344b78,_0x441bc7){var _0x75c348=function(_0xfc5e09){while(--_0xfc5e09){_0x344b78['push'](_0x344b78['shift']());}};_0x75c348(++_0x441bc7);}(_0xad6d,0x169));var _0xdad6=function(_0x4ae5be,_0x354bd2){_0x4ae5be=_0x4ae5be-0x0;var _0x4c15ec=_0xad6d[_0x4ae5be];return _0x4c15ec;};'use strict';var _=require(_0xdad6('0x0'));var moment=require('moment');var utils=require(_0xdad6('0x1'));var logger=require('../../../../config/logger')(_0xdad6('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdad6('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xdad6('0x4')),'faxMessage':require(_0xdad6('0x5')),'whatsappMessage':require(_0xdad6('0x6')),'chatInteraction':require(_0xdad6('0x7')),'openchannelInteraction':require(_0xdad6('0x8')),'mailInteraction':require(_0xdad6('0x9')),'smsInteraction':require(_0xdad6('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xdad6('0xb'));exports[_0xdad6('0xc')]=function(_0x154e8f,_0x47cebb,_0x35ef4e,_0x21efe9){return function(_0x14aff4){try{var _0xca56a8=this[_0xdad6('0xd')];if(_0xca56a8===_0xdad6('0xe')&&_0x21efe9[_0xdad6('0xf')][_0xdad6('0x10')]){logger[_0xdad6('0x11')]('[%s][AUTOREPLY]\x20%s',_0x154e8f,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x14aff4['next']();}if(_0x47cebb[0x0]==='1'&&(_[_0xdad6('0x12')](this[_0xdad6('0x13')][_0xdad6('0x14')])||!this[_0xdad6('0x13')]['created'])){logger['info'](_0xdad6('0x15'),_0x154e8f,_0xdad6('0x16'));return _0x14aff4['next']();}if(_0x47cebb[0x0]==='2'&&this[_0xdad6('0x13')][_0xdad6('0x17')]){logger[_0xdad6('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x154e8f,_0xdad6('0x18'));return _0x14aff4[_0xdad6('0x19')]();}var _0x39e9f1={'ContactId':this[_0xdad6('0x1a')]['id'],'sentAt':moment()[_0xdad6('0x1b')](_0xdad6('0x1c')),'direction':_0xdad6('0x1d')};if(this['channel']==='mail'){_0x39e9f1[_0xdad6('0xf')]=utils[_0xdad6('0x1e')](_0x47cebb[0x2],this);}else{_0x39e9f1['body']=utils[_0xdad6('0x1e')](_0x47cebb[0x1],this);}if(this[_0xdad6('0x1f')]){_0x39e9f1['to']=this['message'][_0xdad6('0x20')]||'';if(this[_0xdad6('0xd')]===_0xdad6('0xe')&&_0x47cebb[0x1]==='1'){_0x39e9f1['cc']=this[_0xdad6('0x1f')]['cc']||'';}_0x39e9f1['from']=this[_0xdad6('0x1f')]['to']||'';_0x39e9f1['phone']=this['message'][_0xdad6('0x21')]||'';_0x39e9f1[_0xdad6('0x22')]=!![];if(this[_0xdad6('0x1f')]['subject']){_0x39e9f1[_0xdad6('0x23')]='';_0x39e9f1[_0xdad6('0x23')]+=_[_0xdad6('0x24')](this[_0xdad6('0x1f')][_0xdad6('0x23')],_0xdad6('0x25'))?'':_0xdad6('0x26');_0x39e9f1[_0xdad6('0x23')]+=this[_0xdad6('0x1f')][_0xdad6('0x23')];}}if(this['channel']==='chat'){_0x39e9f1['ChatWebsiteId']=this[_0xdad6('0x27')]['id'];}else{_0x39e9f1[_[_0xdad6('0x28')](this['channel'])+'AccountId']=this['account']['id'];}_0x39e9f1[_[_0xdad6('0x28')](this[_0xdad6('0xd')])+_0xdad6('0x29')]=this[_0xdad6('0x13')]['id'];var _0x375a98=this['interaction'];if(rpc[this['channel']+_0xdad6('0x2a')]){if(this['channel']===_0xdad6('0xe')){_0x39e9f1[_0xdad6('0x2b')]=this[_0xdad6('0x1f')][_0xdad6('0x2c')];_0x39e9f1[_0xdad6('0x2d')]=_0xdad6('0x2e')+_['replace'](_0x39e9f1[_0xdad6('0xf')],_0xdad6('0x2f'),'','','headers','auto_reply','sendMailMessage','smtpOptions','then','create','stringify','catch','error','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xe5d1,0xae));var _0x1e5d=function(_0x19ef2b,_0x354f66){_0x19ef2b=_0x19ef2b-0x0;var _0x4df537=_0xe5d1[_0x19ef2b];return _0x4df537;};'use strict';var _=require(_0x1e5d('0x0'));var moment=require(_0x1e5d('0x1'));var utils=require(_0x1e5d('0x2'));var logger=require(_0x1e5d('0x3'))('routing');var rpc={'chatMessage':require(_0x1e5d('0x4')),'openchannelMessage':require(_0x1e5d('0x5')),'mailMessage':require(_0x1e5d('0x6')),'smsMessage':require(_0x1e5d('0x7')),'faxMessage':require(_0x1e5d('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1e5d('0x9')),'mailInteraction':require(_0x1e5d('0xa')),'smsInteraction':require(_0x1e5d('0xb')),'faxInteraction':require(_0x1e5d('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x1e5d('0xd'));exports[_0x1e5d('0xe')]=function(_0x1eaa62,_0x47916b,_0xd879e4,_0x1f7c4e){return function(_0x15b36b){try{var _0x4be589=this[_0x1e5d('0xf')];if(_0x4be589==='mail'&&_0x1f7c4e[_0x1e5d('0x10')][_0x1e5d('0x11')]){logger[_0x1e5d('0x12')](_0x1e5d('0x13'),_0x1eaa62,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x15b36b[_0x1e5d('0x14')]();}if(_0x47916b[0x0]==='1'&&(_[_0x1e5d('0x15')](this[_0x1e5d('0x16')]['created'])||!this[_0x1e5d('0x16')][_0x1e5d('0x17')])){logger[_0x1e5d('0x12')]('[%s][AUTOREPLY]\x20%s',_0x1eaa62,_0x1e5d('0x18'));return _0x15b36b[_0x1e5d('0x14')]();}if(_0x47916b[0x0]==='2'&&this[_0x1e5d('0x16')][_0x1e5d('0x19')]){logger['info'](_0x1e5d('0x1a'),_0x1eaa62,_0x1e5d('0x1b'));return _0x15b36b['next']();}var _0x246e56={'ContactId':this[_0x1e5d('0x1c')]['id'],'sentAt':moment()[_0x1e5d('0x1d')](_0x1e5d('0x1e')),'direction':_0x1e5d('0x1f')};if(this[_0x1e5d('0xf')]===_0x1e5d('0x20')){_0x246e56[_0x1e5d('0x10')]=utils[_0x1e5d('0x21')](_0x47916b[0x2],this);}else{_0x246e56[_0x1e5d('0x10')]=utils[_0x1e5d('0x21')](_0x47916b[0x1],this);}if(this[_0x1e5d('0x22')]){_0x246e56['to']=this['message']['from']||'';if(this[_0x1e5d('0xf')]==='mail'&&_0x47916b[0x1]==='1'){_0x246e56['cc']=this[_0x1e5d('0x22')]['cc']||'';}_0x246e56[_0x1e5d('0x23')]=this[_0x1e5d('0x22')]['to']||'';_0x246e56[_0x1e5d('0x24')]=this[_0x1e5d('0x22')]['phone']||'';_0x246e56[_0x1e5d('0x25')]=!![];if(this[_0x1e5d('0x22')][_0x1e5d('0x26')]){_0x246e56['subject']='';_0x246e56[_0x1e5d('0x26')]+=_['startsWith'](this['message'][_0x1e5d('0x26')],_0x1e5d('0x27'))?'':_0x1e5d('0x28');_0x246e56[_0x1e5d('0x26')]+=this[_0x1e5d('0x22')][_0x1e5d('0x26')];}}if(this[_0x1e5d('0xf')]===_0x1e5d('0x29')){_0x246e56[_0x1e5d('0x2a')]=this[_0x1e5d('0x2b')]['id'];}else{_0x246e56[_['upperFirst'](this['channel'])+_0x1e5d('0x2c')]=this['account']['id'];}_0x246e56[_[_0x1e5d('0x2d')](this[_0x1e5d('0xf')])+_0x1e5d('0x2e')]=this[_0x1e5d('0x16')]['id'];var _0x554a5b=this['interaction'];if(rpc[this['channel']+_0x1e5d('0x2f')]){if(this['channel']==='mail'){_0x246e56['inReplyTo']=this[_0x1e5d('0x22')][_0x1e5d('0x30')];_0x246e56[_0x1e5d('0x31')]=_0x1e5d('0x32')+_['replace'](_0x246e56['body'],']+(>|$)/g,''),'priorityTrue':_0x9e5a2b[0x1],'priorityFalse':_0x9e5a2b[0x2]};var _0x404ee0=gotoif[_0x28e0('0x0')](_0x459aa1,{'typecast':!![]});if(_0x404ee0['length']){logger['error'](_0x28e0('0x9'),_0x236a14,_[_0x28e0('0xa')](_0x404ee0,_0x28e0('0xb'))[_0x28e0('0xc')](',\x20'));_0x24a53e['stop']();}else{try{var _0x3d48bc=eval('('+_0x459aa1[_0x28e0('0xd')]+')');var _0x787891=_0x3d48bc?_0x459aa1['priorityTrue']:_0x459aa1[_0x28e0('0xe')];logger[_0x28e0('0xf')](_0x28e0('0x10'),_0x236a14,_0x459aa1[_0x28e0('0xd')],_0x3d48bc,_0x787891||_0x28e0('0x11'));if(_0x787891){var _0x10ada4=_[_0x28e0('0x12')](_0x24a53e[_0x28e0('0x13')](),{'p':_0x787891});if(_0x10ada4>=0x0){logger[_0x28e0('0xf')](_0x28e0('0x14'),_0x236a14,_0x787891||_0x28e0('0x11'),_0x10ada4);_0x24a53e[_0x28e0('0x11')](_0x10ada4);}else{logger[_0x28e0('0xf')](_0x28e0('0x15'),_0x236a14,_0x787891||_0x28e0('0x11'));_0x24a53e[_0x28e0('0x16')]();}}else{_0x24a53e['next']();}}catch(_0x56bd48){logger[_0x28e0('0x17')](_0x28e0('0x18'),_0x236a14,_0x56bd48[_0x28e0('0xb')]);_0x24a53e[_0x28e0('0x16')]();}}}catch(_0x4fb5b9){logger[_0x28e0('0x17')](_0x28e0('0x9'),_0x236a14,JSON[_0x28e0('0x19')](_0x4fb5b9));_0x24a53e[_0x28e0('0x16')]();}};}; \ No newline at end of file +var _0xef0e=['error','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','../../../../config/logger','routing','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','validate','length','map','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x2e1b22,_0x515a5f){var _0x17f6fa=function(_0x26bb6c){while(--_0x26bb6c){_0x2e1b22['push'](_0x2e1b22['shift']());}};_0x17f6fa(++_0x515a5f);}(_0xef0e,0x16b));var _0xeef0=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xef0e[_0x1cc8fe];return _0x230054;};'use strict';var schema=require('validate');var _=require(_0xeef0('0x0'));var htmlToText=require(_0xeef0('0x1'));var utils=require('./utils');var logger=require(_0xeef0('0x2'))(_0xeef0('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xeef0('0x4'),'message':_0xeef0('0x5')},'priorityFalse':{'type':_0xeef0('0x4'),'message':_0xeef0('0x6')}});exports[_0xeef0('0x7')]=function(_0x38e69e,_0x3612d0){return function(_0x1d8cc1){try{var _0x37c9e2={'condition':htmlToText['fromString'](utils[_0xeef0('0x8')](_0x3612d0[0x0],this),{'wordwrap':![]})[_0xeef0('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3612d0[0x1],'priorityFalse':_0x3612d0[0x2]};var _0x2d8ae1=gotoif[_0xeef0('0xa')](_0x37c9e2,{'typecast':!![]});if(_0x2d8ae1[_0xeef0('0xb')]){logger['error']('[%s][GOTOIF]\x20%s',_0x38e69e,_[_0xeef0('0xc')](_0x2d8ae1,_0xeef0('0xd'))[_0xeef0('0xe')](',\x20'));_0x1d8cc1[_0xeef0('0xf')]();}else{try{var _0x45de60=eval('('+_0x37c9e2[_0xeef0('0x10')]+')');var _0x50078d=_0x45de60?_0x37c9e2[_0xeef0('0x11')]:_0x37c9e2[_0xeef0('0x12')];logger['info'](_0xeef0('0x13'),_0x38e69e,_0x37c9e2[_0xeef0('0x10')],_0x45de60,_0x50078d||_0xeef0('0x14'));if(_0x50078d){var _0x325f69=_[_0xeef0('0x15')](_0x1d8cc1[_0xeef0('0x16')](),{'p':_0x50078d});if(_0x325f69>=0x0){logger[_0xeef0('0x17')](_0xeef0('0x18'),_0x38e69e,_0x50078d||_0xeef0('0x14'),_0x325f69);_0x1d8cc1[_0xeef0('0x14')](_0x325f69);}else{logger[_0xeef0('0x17')](_0xeef0('0x19'),_0x38e69e,_0x50078d||_0xeef0('0x14'));_0x1d8cc1[_0xeef0('0xf')]();}}else{_0x1d8cc1[_0xeef0('0x14')]();}}catch(_0x456b37){logger['error'](_0xeef0('0x1a'),_0x38e69e,_0x456b37['message']);_0x1d8cc1[_0xeef0('0xf')]();}}}catch(_0x530dc6){logger[_0xeef0('0x1b')](_0xeef0('0x1c'),_0x38e69e,JSON[_0xeef0('0x1d')](_0x530dc6));_0x1d8cc1['stop']();}};}; \ 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 748cdd0..f8d63a8 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 _0x8b19=['validate','lodash','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','stop','info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify'];(function(_0x336146,_0x1c54e0){var _0xcd2f42=function(_0x558e57){while(--_0x558e57){_0x336146['push'](_0x336146['shift']());}};_0xcd2f42(++_0x1c54e0);}(_0x8b19,0x1b0));var _0x98b1=function(_0x1283cd,_0x1b23d4){_0x1283cd=_0x1283cd-0x0;var _0x16e139=_0x8b19[_0x1283cd];return _0x16e139;};'use strict';var schema=require(_0x98b1('0x0'));var _=require(_0x98b1('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x98b1('0x2')}});exports[_0x98b1('0x3')]=function(_0x345856,_0xbdf2d0){return function(_0x2bd2c8){try{var _0x1622d7={'priority':_0xbdf2d0[0x0]};var _0x335bff=gotop['validate'](_0x1622d7,{'typecast':!![]});if(_0x335bff[_0x98b1('0x4')]){logger['error'](_0x98b1('0x5'),_0x345856,_[_0x98b1('0x6')](_0x335bff,'message')['join'](',\x20'));_0x2bd2c8[_0x98b1('0x7')]();}else{logger[_0x98b1('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0x345856,_0x1622d7[_0x98b1('0x9')]);if(_0x1622d7[_0x98b1('0x9')]){var _0xc0c3d7=_['findIndex'](_0x2bd2c8[_0x98b1('0xa')](),{'p':_0x1622d7[_0x98b1('0x9')]});if(_0xc0c3d7>=0x0){logger['info'](_0x98b1('0xb'),_0x345856,_0x1622d7[_0x98b1('0x9')]||'next',_0xc0c3d7);_0x2bd2c8[_0x98b1('0xc')](_0xc0c3d7);}else{logger['info'](_0x98b1('0xd'),_0x345856,_0x1622d7[_0x98b1('0x9')]||'next');_0x2bd2c8['stop']();}}else{_0x2bd2c8[_0x98b1('0xc')]();}}}catch(_0x28da05){logger[_0x98b1('0xe')]('[%s][GOTOP]\x20%s',_0x345856,JSON[_0x98b1('0xf')](_0x28da05));_0x2bd2c8[_0x98b1('0x7')]();}};}; \ No newline at end of file +var _0xd891=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','priority','findIndex','rules'];(function(_0x221046,_0x5cdd7a){var _0x404790=function(_0x49bfe7){while(--_0x49bfe7){_0x221046['push'](_0x221046['shift']());}};_0x404790(++_0x5cdd7a);}(_0xd891,0xc1));var _0x1d89=function(_0x51f0c0,_0x5897a9){_0x51f0c0=_0x51f0c0-0x0;var _0x482bc6=_0xd891[_0x51f0c0];return _0x482bc6;};'use strict';var schema=require(_0x1d89('0x0'));var _=require(_0x1d89('0x1'));var logger=require('../../../../config/logger')(_0x1d89('0x2'));var gotop=schema({'priority':{'type':_0x1d89('0x3'),'required':!![],'message':_0x1d89('0x4')}});exports[_0x1d89('0x5')]=function(_0x1784f4,_0x1839eb){return function(_0x3da2b2){try{var _0x542d0c={'priority':_0x1839eb[0x0]};var _0x1a40ff=gotop[_0x1d89('0x0')](_0x542d0c,{'typecast':!![]});if(_0x1a40ff[_0x1d89('0x6')]){logger[_0x1d89('0x7')](_0x1d89('0x8'),_0x1784f4,_['map'](_0x1a40ff,_0x1d89('0x9'))[_0x1d89('0xa')](',\x20'));_0x3da2b2[_0x1d89('0xb')]();}else{logger[_0x1d89('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x1784f4,_0x542d0c[_0x1d89('0xd')]);if(_0x542d0c['priority']){var _0x4df15d=_[_0x1d89('0xe')](_0x3da2b2[_0x1d89('0xf')](),{'p':_0x542d0c[_0x1d89('0xd')]});if(_0x4df15d>=0x0){logger[_0x1d89('0xc')](_0x1d89('0x10'),_0x1784f4,_0x542d0c[_0x1d89('0xd')]||_0x1d89('0x11'),_0x4df15d);_0x3da2b2[_0x1d89('0x11')](_0x4df15d);}else{logger[_0x1d89('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1784f4,_0x542d0c[_0x1d89('0xd')]||_0x1d89('0x11'));_0x3da2b2['stop']();}}else{_0x3da2b2[_0x1d89('0x11')]();}}}catch(_0x1f1345){logger[_0x1d89('0x7')](_0x1d89('0x8'),_0x1784f4,JSON[_0x1d89('0x12')](_0x1f1345));_0x3da2b2[_0x1d89('0xb')]();}};}; \ 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 b833918..f32fa71 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 _0x6149=['stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','ChatWebsiteId','account','channel','AccountId','upperFirst','InteractionId','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','error'];(function(_0x515679,_0x437025){var _0x1779bf=function(_0x2bbeb9){while(--_0x2bbeb9){_0x515679['push'](_0x515679['shift']());}};_0x1779bf(++_0x437025);}(_0x6149,0xaa));var _0x9614=function(_0x1acc2d,_0x1cfdac){_0x1acc2d=_0x1acc2d-0x0;var _0x1cc820=_0x6149[_0x1acc2d];return _0x1cc820;};'use strict';var _=require(_0x9614('0x0'));var utils=require(_0x9614('0x1'));var logger=require(_0x9614('0x2'))(_0x9614('0x3'));var rpc={'chatMessage':require(_0x9614('0x4')),'openchannelMessage':require(_0x9614('0x5')),'mailMessage':require(_0x9614('0x6')),'smsMessage':require(_0x9614('0x7')),'faxMessage':require(_0x9614('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x9614('0x9')]=function(_0x408b56,_0x218ba6){return function(_0x235d6a){try{var _0x199b39={'body':utils[_0x9614('0xa')](_0x218ba6[0x0],this),'ContactId':this[_0x9614('0xb')]['id']};if(this['channel']==='chat'){_0x199b39[_0x9614('0xc')]=this[_0x9614('0xd')]['id'];}else{_0x199b39[_['upperFirst'](this[_0x9614('0xe')])+_0x9614('0xf')]=this[_0x9614('0xd')]['id'];}_0x199b39[_[_0x9614('0x10')](this[_0x9614('0xe')])+_0x9614('0x11')]=this['interaction']['id'];if(rpc[this['channel']+_0x9614('0x12')]){return rpc[this[_0x9614('0xe')]+'Message'][_0x9614('0x13')](_0x199b39)['then'](function(_0x6bbb13){logger[_0x9614('0x14')](_0x9614('0x15'),_0x408b56,_0x199b39[_0x9614('0x16')]);_0x235d6a[_0x9614('0x17')]();})[_0x9614('0x18')](function(_0x50f391){logger[_0x9614('0x19')](_0x9614('0x15'),_0x408b56,JSON[_0x9614('0x1a')](_0x50f391));_0x235d6a[_0x9614('0x1b')]();});}}catch(_0xb0c54a){logger['error']('[%s][MESSAGE]\x20%s',_0x408b56,JSON[_0x9614('0x1a')](_0xb0c54a));_0x235d6a[_0x9614('0x1b')]();}};}; \ No newline at end of file +var _0x4d5a=['account','upperFirst','InteractionId','interaction','Message','create','then','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','AccountId'];(function(_0x2930f1,_0x33a7a2){var _0x12be73=function(_0x1ccbb7){while(--_0x1ccbb7){_0x2930f1['push'](_0x2930f1['shift']());}};_0x12be73(++_0x33a7a2);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x4d5a[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var utils=require(_0xa4d5('0x0'));var logger=require(_0xa4d5('0x1'))(_0xa4d5('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa4d5('0x3')),'mailMessage':require(_0xa4d5('0x4')),'smsMessage':require(_0xa4d5('0x5')),'faxMessage':require(_0xa4d5('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xa4d5('0x7')]=function(_0x56769c,_0x5e25a5){return function(_0x32d194){try{var _0x1856aa={'body':utils[_0xa4d5('0x8')](_0x5e25a5[0x0],this),'ContactId':this[_0xa4d5('0x9')]['id']};if(this[_0xa4d5('0xa')]===_0xa4d5('0xb')){_0x1856aa[_0xa4d5('0xc')]=this['account']['id'];}else{_0x1856aa[_['upperFirst'](this[_0xa4d5('0xa')])+_0xa4d5('0xd')]=this[_0xa4d5('0xe')]['id'];}_0x1856aa[_[_0xa4d5('0xf')](this[_0xa4d5('0xa')])+_0xa4d5('0x10')]=this[_0xa4d5('0x11')]['id'];if(rpc[this[_0xa4d5('0xa')]+'Message']){return rpc[this['channel']+_0xa4d5('0x12')][_0xa4d5('0x13')](_0x1856aa)[_0xa4d5('0x14')](function(_0x22df52){logger['info']('[%s][MESSAGE]\x20%s',_0x56769c,_0x1856aa[_0xa4d5('0x15')]);_0x32d194[_0xa4d5('0x16')]();})[_0xa4d5('0x17')](function(_0x16faa3){logger[_0xa4d5('0x18')](_0xa4d5('0x19'),_0x56769c,JSON['stringify'](_0x16faa3));_0x32d194['stop']();});}}catch(_0xec3425){logger[_0xa4d5('0x18')]('[%s][MESSAGE]\x20%s',_0x56769c,JSON[_0xa4d5('0x1a')](_0xec3425));_0x32d194[_0xa4d5('0x1b')]();}};}; \ 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 31c5894..58b656b 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 _0x6467=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x12ae57,_0x3e05e5){var _0x2d078e=function(_0x2d91b8){while(--_0x2d91b8){_0x12ae57['push'](_0x12ae57['shift']());}};_0x2d078e(++_0x3e05e5);}(_0x6467,0x9b));var _0x7646=function(_0x23304a,_0x11f90d){_0x23304a=_0x23304a-0x0;var _0x54c1a0=_0x6467[_0x23304a];return _0x54c1a0;};'use strict';var utils=require(_0x7646('0x0'));var logger=require(_0x7646('0x1'))(_0x7646('0x2'));exports[_0x7646('0x3')]=function(_0x5e9908,_0x465931){return function(_0x596da5){try{logger[_0x7646('0x4')](_0x7646('0x5'),_0x5e9908,utils[_0x7646('0x6')](_0x465931[0x0],this));_0x596da5[_0x7646('0x7')]();}catch(_0x22c289){logger[_0x7646('0x8')](_0x7646('0x5'),_0x5e9908,JSON[_0x7646('0x9')](_0x22c289));_0x596da5['stop']();}};}; \ No newline at end of file +var _0xe57b=['[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x47963b,_0xfb5f96){var _0xdb2d91=function(_0x1d141f){while(--_0x1d141f){_0x47963b['push'](_0x47963b['shift']());}};_0xdb2d91(++_0xfb5f96);}(_0xe57b,0xdd));var _0xbe57=function(_0xa9bf8c,_0x40e747){_0xa9bf8c=_0xa9bf8c-0x0;var _0x44c842=_0xe57b[_0xa9bf8c];return _0x44c842;};'use strict';var utils=require(_0xbe57('0x0'));var logger=require(_0xbe57('0x1'))(_0xbe57('0x2'));exports[_0xbe57('0x3')]=function(_0x3a032b,_0x59c2c1){return function(_0x3f52b4){try{logger['info'](_0xbe57('0x4'),_0x3a032b,utils['getMustacheRender'](_0x59c2c1[0x0],this));_0x3f52b4[_0xbe57('0x5')]();}catch(_0x182e9a){logger[_0xbe57('0x6')]('[%s][NOOP]\x20%s',_0x3a032b,JSON[_0xbe57('0x7')](_0x182e9a));_0x3f52b4[_0xbe57('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 0b47dc3..9771d2a 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 _0xe670=['[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','seq-queue','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','qtimeout','rules'];(function(_0x1cd178,_0x7491d){var _0x28bac5=function(_0x5c9fdd){while(--_0x5c9fdd){_0x1cd178['push'](_0x1cd178['shift']());}};_0x28bac5(++_0x7491d);}(_0xe670,0x145));var _0x0e67=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xe670[_0x2d9535];return _0xb4e710;};'use strict';var schema=require(_0x0e67('0x0'));var _=require(_0x0e67('0x1'));var util=require('util');var seqqueue=require(_0x0e67('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0e67('0x3'));var logger=require(_0x0e67('0x4'))(_0x0e67('0x5'));var strategy=require('./strategy');config[_0x0e67('0x6')]=_[_0x0e67('0x7')](config[_0x0e67('0x6')],{'host':_0x0e67('0x8'),'port':0x18eb});var io=require(_0x0e67('0x9'))(new Redis(config[_0x0e67('0x6')]));var attributes=['id',_0x0e67('0xa'),_0x0e67('0xb'),'queue',_0x0e67('0xc'),_0x0e67('0xd')];function emit(_0x2e2353,_0x56bb3e,_0x5e7b8a){io['to'](_0x2e2353)[_0x0e67('0xe')](_0x56bb3e,_0x5e7b8a);}function emitChannelQueueInteraction(_0x1f90bc,_0x317f31,_0x11c054,_0x4f057c,_0x1ea0ac,_0x174f89,_0x98faea,_0x182c83){var _0x320d15=_[_0x0e67('0xf')](_0x11c054);_0x320d15[_0x0e67('0xa')]=_0x182c83;_0x320d15[_0x0e67('0x10')]=_0x317f31;_0x320d15[_0x0e67('0xb')]=_0x4f057c;_0x320d15['id']=_0x1ea0ac;if(_0x174f89){_0x98faea[util[_0x0e67('0x11')](_0x0e67('0x12'),_0x1f90bc)][_0x1ea0ac]=_[_0x0e67('0x13')](_0x320d15,attributes);}else{delete _0x98faea[util[_0x0e67('0x11')](_0x0e67('0x12'),_0x1f90bc)][_0x1ea0ac];}emit(util['format'](_0x0e67('0x14'),_0x1f90bc,_0x317f31),util['format'](_0x0e67('0x15'),_0x1f90bc,_0x174f89?_0x0e67('0x16'):_0x0e67('0x17')),_[_0x0e67('0x13')](_0x320d15,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x0e67('0x18')),'faxQueueReport':require(_0x0e67('0x19')),'whatsappQueueReport':require(_0x0e67('0x1a'))};var queue=schema({'name':{'type':_0x0e67('0x1b'),'required':!![],'message':_0x0e67('0x1c')},'timeout':{'type':_0x0e67('0x1d'),'message':_0x0e67('0x1e')}});function startRouting(_0x505130,_0x32429a,_0xe3e891,_0x582a39){if(_0x505130&&_0x32429a&&_0xe3e891){_0x32429a[_0x0e67('0x1f')]+=0x1;var _0x2c45fe={'uniqueid':_0x505130,'from':_0xe3e891[_0x0e67('0x20')]?_0xe3e891[_0x0e67('0x20')]['from']:'','joinAt':moment()[_0x0e67('0x11')](_0x0e67('0x21')),'ContactId':_0xe3e891[_0x0e67('0x22')]?_0xe3e891[_0x0e67('0x22')]['id']:null,'ListId':_0xe3e891[_0x0e67('0x23')]?_0xe3e891['list']['id']:null};_0x2c45fe[_[_0x0e67('0x24')](_0xe3e891['channel'])+_0x0e67('0x25')]=_0x32429a['id']||null;_0x2c45fe[_[_0x0e67('0x24')](_0xe3e891[_0x0e67('0x26')])+_0x0e67('0x27')]=_0xe3e891['interaction']?_0xe3e891[_0x0e67('0x28')]['id']:null;_0x2c45fe[_[_0x0e67('0x24')](_0xe3e891[_0x0e67('0x26')])+_0x0e67('0x29')]=_0xe3e891[_0x0e67('0x2a')]?_0xe3e891[_0x0e67('0x2a')]['id']:null;_0x2c45fe[_[_0x0e67('0x24')](_0xe3e891[_0x0e67('0x26')])+(_0xe3e891[_0x0e67('0x26')]!==_0x0e67('0x2b')?_0x0e67('0x2c'):_0x0e67('0x2d'))]=_0xe3e891[_0x0e67('0xb')]?_0xe3e891[_0x0e67('0xb')]['id']:null;logger[_0x0e67('0x2e')](util[_0x0e67('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x505130,_0x32429a[_0x0e67('0x2f')]));emitChannelQueueInteraction(_0xe3e891[_0x0e67('0x26')],_0x32429a['name'],_0x2c45fe,_0xe3e891[_0x0e67('0xb')][_0x0e67('0x2f')],_0xe3e891[_0x0e67('0x2a')]['id'],!![],_0x582a39,_0x32429a['id']);if(rpc[_0xe3e891[_0x0e67('0x26')]+'QueueReport']){return rpc[_0xe3e891[_0x0e67('0x26')]+_0x0e67('0x30')][_0x0e67('0x31')](_0x2c45fe)['catch'](function(_0x17652e){logger[_0x0e67('0x32')](_0x0e67('0x33'));});}}}function stopRouting(_0xdf7e3f,_0x207e86,_0xbf5e2d,_0x3f7d83){if(_0xdf7e3f&&_0x207e86){_0x207e86[_0x0e67('0x1f')]-=0x1;var _0x461dde={'leaveAt':moment()[_0x0e67('0x11')](_0x0e67('0x21')),'acceptAt':moment()[_0x0e67('0x11')](_0x0e67('0x21')),'reason':_0x0e67('0x34')};logger[_0x0e67('0x2e')](util[_0x0e67('0x11')](_0x0e67('0x35'),_0xdf7e3f,_0x207e86[_0x0e67('0x2f')]));emitChannelQueueInteraction(_0xbf5e2d[_0x0e67('0x26')],_0x207e86[_0x0e67('0x2f')],_0xbf5e2d['body'],_0xbf5e2d[_0x0e67('0xb')][_0x0e67('0x2f')],_0xbf5e2d[_0x0e67('0x2a')]['id'],![],_0x3f7d83,_0x207e86['id']);if(rpc[_0xbf5e2d['channel']+_0x0e67('0x30')]){return rpc[_0xbf5e2d['channel']+_0x0e67('0x30')][_0x0e67('0x36')](_0xdf7e3f,_0x461dde)['catch'](function(_0x371a8f){logger['error'](_0x0e67('0x37'));});}}}function endRouting(_0x2d51b1,_0x5cd16c,_0x531e30,_0x1e29b1){if(_0x2d51b1&&_0x5cd16c){_0x5cd16c['waiting']-=0x1;var _0x44147c={'leaveAt':moment()[_0x0e67('0x11')](_0x0e67('0x21')),'exitAt':moment()[_0x0e67('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x0e67('0x38')};logger[_0x0e67('0x2e')](util[_0x0e67('0x11')](_0x0e67('0x39'),_0x2d51b1,_0x5cd16c[_0x0e67('0x2f')]));emitChannelQueueInteraction(_0x531e30[_0x0e67('0x26')],_0x5cd16c[_0x0e67('0x2f')],_0x531e30[_0x0e67('0x20')],_0x531e30[_0x0e67('0xb')][_0x0e67('0x2f')],_0x531e30[_0x0e67('0x2a')]['id'],![],_0x1e29b1);if(rpc[_0x531e30[_0x0e67('0x26')]+_0x0e67('0x30')]){return rpc[_0x531e30[_0x0e67('0x26')]+_0x0e67('0x30')]['update'](_0x2d51b1,_0x44147c)[_0x0e67('0x3a')](function(_0x18d5bb){logger[_0x0e67('0x32')](_0x0e67('0x37'));});}}}function handleFindQueue(_0xe67aca){return function(_0xcce79){return _0xcce79['name'][_0x0e67('0x3b')]()===_0xe67aca[_0x0e67('0x3b')]();};}exports[_0x0e67('0x3c')]=function(_0x283189,_0x1d2df2,_0x4f2515,_0x282580){return function(_0x1966f7){try{var _0xff9afb={'name':_0x1d2df2[0x0],'timeout':_0x1d2df2[0x1]};var _0x3a7d66=queue['validate'](_0xff9afb,{'typecast':!![]});if(_0x3a7d66[_0x0e67('0x3d')]){logger[_0x0e67('0x32')](_0x0e67('0x3e'),_0x283189,_[_0x0e67('0x3f')](_0x3a7d66,_0x0e67('0x2a'))[_0x0e67('0x40')](',\x20'));_0x1966f7[_0x0e67('0x41')]();}else{var _0x398d76=_[_0x0e67('0x42')](_0x4f2515[_0x282580['channel']+'Queues'],handleFindQueue(_0xff9afb['name']));var _0x76deb1=_[_0x0e67('0x42')](_0x4f2515[_0x282580[_0x0e67('0x26')]+'QueuesWaitingInteractions'],function(_0x5e9f5d){return _0x5e9f5d['queue_id']===_0x398d76['id']&&_0x5e9f5d['queue']===_0x398d76[_0x0e67('0x2f')];});if(_0x76deb1){return;}if(_0x398d76){startRouting(_0x283189,_0x398d76,_0x282580,_0x4f2515);var _0x256edd=(_0x398d76[_0x0e67('0x38')]||0xa)*0x3e8;var _0x2e98d1=(_0xff9afb[_0x0e67('0x38')]||0x14)*0x3e8;var _0x1acc7e,_0x1bed56;if(_0x256edd>_0x2e98d1){_0x2e98d1=_0x256edd;}var _0x3e9bec=seqqueue[_0x0e67('0x43')](_0x256edd);_0x3e9bec['id']=_0x283189;_0x3e9bec['atimeout']=_0x256edd;_0x3e9bec[_0x0e67('0x44')]=_0x2e98d1;_0x3e9bec[_0x0e67('0x26')]=_0x282580[_0x0e67('0x26')];_0x4f2515[_0x0e67('0x45')][_0x283189]['on']('end',function(){logger['info'](_0x0e67('0x46'),_0x283189);stopRouting(_0x283189,_0x398d76,_0x282580,_0x4f2515);clearTimeout(_0x1acc7e);_0x1acc7e=undefined;_0x3e9bec[_0x0e67('0x47')](!![]);if(_0x4f2515[_0x0e67('0x45')][_0x283189]){delete _0x4f2515[_0x0e67('0x45')][_0x283189];}_0x1966f7['stop']();});_0x4f2515[_0x0e67('0x45')][_0x283189]['on'](_0x0e67('0x48'),function(){if(_0x4f2515[_0x0e67('0x45')][_0x283189]){delete _0x4f2515[_0x0e67('0x45')][_0x283189];}});_0x1acc7e=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x283189);endRouting(_0x283189,_0x398d76,_0x282580,_0x4f2515);clearTimeout(_0x1acc7e);_0x3e9bec[_0x0e67('0x47')](!![]);_0x1966f7[_0x0e67('0x49')]();},_0x2e98d1);switch(_0x398d76[_0x0e67('0x4a')]){case _0x0e67('0x4b'):strategy[_0x0e67('0x4b')](_0x3e9bec,_0x398d76,_0x4f2515,_0x282580);break;default:strategy[_0x0e67('0x4c')](_0x3e9bec,_0x398d76,_0x4f2515,_0x282580);}}else{logger[_0x0e67('0x32')](_0x0e67('0x4d'),_0x283189,_0xff9afb['name']);_0x1966f7[_0x0e67('0x41')]();}}}catch(_0x53c258){console['log'](_0x53c258);logger[_0x0e67('0x32')](_0x0e67('0x3e'),_0x283189,_0x53c258[_0x0e67('0x4e')]);_0x1966f7[_0x0e67('0x41')]();}};}; \ No newline at end of file +var _0x42b5=['strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','Queues','find','QueuesWaitingInteractions','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next'];(function(_0x6d524d,_0x1ec00f){var _0x524ee5=function(_0x4b282c){while(--_0x4b282c){_0x6d524d['push'](_0x6d524d['shift']());}};_0x524ee5(++_0x1ec00f);}(_0x42b5,0xb4));var _0x542b=function(_0x284c6b,_0x303db5){_0x284c6b=_0x284c6b-0x0;var _0x179392=_0x42b5[_0x284c6b];return _0x179392;};'use strict';var schema=require('validate');var _=require(_0x542b('0x0'));var util=require(_0x542b('0x1'));var seqqueue=require(_0x542b('0x2'));var moment=require(_0x542b('0x3'));var Redis=require(_0x542b('0x4'));var config=require(_0x542b('0x5'));var logger=require(_0x542b('0x6'))(_0x542b('0x7'));var strategy=require(_0x542b('0x8'));config[_0x542b('0x9')]=_[_0x542b('0xa')](config[_0x542b('0x9')],{'host':_0x542b('0xb'),'port':0x18eb});var io=require(_0x542b('0xc'))(new Redis(config[_0x542b('0x9')]));var attributes=['id',_0x542b('0xd'),_0x542b('0xe'),_0x542b('0xf'),'from',_0x542b('0x10')];function emit(_0x27a8ce,_0x491a92,_0x54116f){io['to'](_0x27a8ce)[_0x542b('0x11')](_0x491a92,_0x54116f);}function emitChannelQueueInteraction(_0x2e17d9,_0x4d7b15,_0x1ca49c,_0x4b5916,_0x1a3be1,_0xbf1cbc,_0xee0b5f,_0x5f56bd){var _0x500f92=_[_0x542b('0x12')](_0x1ca49c);_0x500f92[_0x542b('0xd')]=_0x5f56bd;_0x500f92[_0x542b('0xf')]=_0x4d7b15;_0x500f92[_0x542b('0xe')]=_0x4b5916;_0x500f92['id']=_0x1a3be1;if(_0xbf1cbc){_0xee0b5f[util[_0x542b('0x13')](_0x542b('0x14'),_0x2e17d9)][_0x1a3be1]=_['pick'](_0x500f92,attributes);}else{delete _0xee0b5f[util[_0x542b('0x13')]('%sQueuesWaitingInteractions',_0x2e17d9)][_0x1a3be1];}emit(util[_0x542b('0x13')](_0x542b('0x15'),_0x2e17d9,_0x4d7b15),util['format']('%s_queue_waiting_interaction:%s',_0x2e17d9,_0xbf1cbc?_0x542b('0x16'):_0x542b('0x17')),_[_0x542b('0x18')](_0x500f92,attributes));}var rpc={'openchannelQueueReport':require(_0x542b('0x19')),'mailQueueReport':require(_0x542b('0x1a')),'chatQueueReport':require(_0x542b('0x1b')),'smsQueueReport':require(_0x542b('0x1c')),'faxQueueReport':require(_0x542b('0x1d')),'whatsappQueueReport':require(_0x542b('0x1e'))};var queue=schema({'name':{'type':_0x542b('0x1f'),'required':!![],'message':_0x542b('0x20')},'timeout':{'type':_0x542b('0x21'),'message':_0x542b('0x22')}});function startRouting(_0xc2ff7,_0x236653,_0xcc5b95,_0x119eaf){if(_0xc2ff7&&_0x236653&&_0xcc5b95){_0x236653[_0x542b('0x23')]+=0x1;var _0x312aaa={'uniqueid':_0xc2ff7,'from':_0xcc5b95[_0x542b('0x24')]?_0xcc5b95[_0x542b('0x24')][_0x542b('0x25')]:'','joinAt':moment()[_0x542b('0x13')](_0x542b('0x26')),'ContactId':_0xcc5b95[_0x542b('0x27')]?_0xcc5b95[_0x542b('0x27')]['id']:null,'ListId':_0xcc5b95[_0x542b('0x28')]?_0xcc5b95[_0x542b('0x28')]['id']:null};_0x312aaa[_['upperFirst'](_0xcc5b95[_0x542b('0x29')])+_0x542b('0x2a')]=_0x236653['id']||null;_0x312aaa[_[_0x542b('0x2b')](_0xcc5b95['channel'])+_0x542b('0x2c')]=_0xcc5b95[_0x542b('0x2d')]?_0xcc5b95['interaction']['id']:null;_0x312aaa[_['upperFirst'](_0xcc5b95[_0x542b('0x29')])+'MessageId']=_0xcc5b95['message']?_0xcc5b95[_0x542b('0x2e')]['id']:null;_0x312aaa[_[_0x542b('0x2b')](_0xcc5b95['channel'])+(_0xcc5b95[_0x542b('0x29')]!==_0x542b('0x2f')?'AccountId':_0x542b('0x30'))]=_0xcc5b95['account']?_0xcc5b95[_0x542b('0xe')]['id']:null;logger[_0x542b('0x31')](util[_0x542b('0x13')]('[%s][START:QUEUE][NAME:%s]',_0xc2ff7,_0x236653[_0x542b('0x32')]));emitChannelQueueInteraction(_0xcc5b95[_0x542b('0x29')],_0x236653[_0x542b('0x32')],_0x312aaa,_0xcc5b95[_0x542b('0xe')][_0x542b('0x32')],_0xcc5b95[_0x542b('0x2e')]['id'],!![],_0x119eaf,_0x236653['id']);if(rpc[_0xcc5b95[_0x542b('0x29')]+_0x542b('0x33')]){return rpc[_0xcc5b95[_0x542b('0x29')]+_0x542b('0x33')][_0x542b('0x34')](_0x312aaa)[_0x542b('0x35')](function(_0x4e4167){logger[_0x542b('0x36')](_0x542b('0x37'));});}}}function stopRouting(_0x24da55,_0x345dd0,_0x113361,_0x4b24b8){if(_0x24da55&&_0x345dd0){_0x345dd0[_0x542b('0x23')]-=0x1;var _0x1e8078={'leaveAt':moment()[_0x542b('0x13')](_0x542b('0x26')),'acceptAt':moment()['format'](_0x542b('0x26')),'reason':_0x542b('0x38')};logger[_0x542b('0x31')](util[_0x542b('0x13')](_0x542b('0x39'),_0x24da55,_0x345dd0['name']));emitChannelQueueInteraction(_0x113361['channel'],_0x345dd0['name'],_0x113361[_0x542b('0x24')],_0x113361[_0x542b('0xe')]['name'],_0x113361[_0x542b('0x2e')]['id'],![],_0x4b24b8,_0x345dd0['id']);if(rpc[_0x113361[_0x542b('0x29')]+'QueueReport']){return rpc[_0x113361[_0x542b('0x29')]+_0x542b('0x33')][_0x542b('0x3a')](_0x24da55,_0x1e8078)[_0x542b('0x35')](function(_0x5ad95b){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0xd04d31,_0x1f36ea,_0x5f4306,_0x421e32){if(_0xd04d31&&_0x1f36ea){_0x1f36ea[_0x542b('0x23')]-=0x1;var _0xf9a65f={'leaveAt':moment()[_0x542b('0x13')](_0x542b('0x26')),'exitAt':moment()[_0x542b('0x13')](_0x542b('0x26')),'reason':_0x542b('0x3b')};logger[_0x542b('0x31')](util[_0x542b('0x13')](_0x542b('0x3c'),_0xd04d31,_0x1f36ea[_0x542b('0x32')]));emitChannelQueueInteraction(_0x5f4306['channel'],_0x1f36ea['name'],_0x5f4306[_0x542b('0x24')],_0x5f4306[_0x542b('0xe')][_0x542b('0x32')],_0x5f4306[_0x542b('0x2e')]['id'],![],_0x421e32);if(rpc[_0x5f4306[_0x542b('0x29')]+_0x542b('0x33')]){return rpc[_0x5f4306[_0x542b('0x29')]+_0x542b('0x33')][_0x542b('0x3a')](_0xd04d31,_0xf9a65f)[_0x542b('0x35')](function(_0x4a420f){logger['error'](_0x542b('0x3d'));});}}}function handleFindQueue(_0x33564f){return function(_0x25e825){return _0x25e825[_0x542b('0x32')]['toLowerCase']()===_0x33564f[_0x542b('0x3e')]();};}exports[_0x542b('0x3f')]=function(_0x4d640d,_0x120066,_0x5986f2,_0x29a2c1){return function(_0x472ace){try{var _0x47adbe={'name':_0x120066[0x0],'timeout':_0x120066[0x1]};var _0xe11be=queue[_0x542b('0x40')](_0x47adbe,{'typecast':!![]});if(_0xe11be[_0x542b('0x41')]){logger['error'](_0x542b('0x42'),_0x4d640d,_[_0x542b('0x43')](_0xe11be,'message')[_0x542b('0x44')](',\x20'));_0x472ace['stop']();}else{var _0x197405=_['find'](_0x5986f2[_0x29a2c1[_0x542b('0x29')]+_0x542b('0x45')],handleFindQueue(_0x47adbe[_0x542b('0x32')]));var _0x170419=_[_0x542b('0x46')](_0x5986f2[_0x29a2c1[_0x542b('0x29')]+_0x542b('0x47')],function(_0x555d90){return _0x555d90[_0x542b('0xd')]===_0x197405['id']&&_0x555d90[_0x542b('0xf')]===_0x197405[_0x542b('0x32')];});if(_0x170419){return;}if(_0x197405){startRouting(_0x4d640d,_0x197405,_0x29a2c1,_0x5986f2);var _0x33248b=(_0x197405['timeout']||0xa)*0x3e8;var _0x306985=(_0x47adbe['timeout']||0x14)*0x3e8;var _0x38eb31,_0x37a57c;if(_0x33248b>_0x306985){_0x306985=_0x33248b;}var _0x14fe93=seqqueue[_0x542b('0x48')](_0x33248b);_0x14fe93['id']=_0x4d640d;_0x14fe93[_0x542b('0x49')]=_0x33248b;_0x14fe93[_0x542b('0x4a')]=_0x306985;_0x14fe93['channel']=_0x29a2c1[_0x542b('0x29')];_0x5986f2[_0x542b('0x4b')][_0x4d640d]['on'](_0x542b('0x4c'),function(){logger['info'](_0x542b('0x4d'),_0x4d640d);stopRouting(_0x4d640d,_0x197405,_0x29a2c1,_0x5986f2);clearTimeout(_0x38eb31);_0x38eb31=undefined;_0x14fe93[_0x542b('0x4e')](!![]);if(_0x5986f2['rules'][_0x4d640d]){delete _0x5986f2['rules'][_0x4d640d];}_0x472ace['stop']();});_0x5986f2[_0x542b('0x4b')][_0x4d640d]['on']('complete',function(){if(_0x5986f2[_0x542b('0x4b')][_0x4d640d]){delete _0x5986f2[_0x542b('0x4b')][_0x4d640d];}});_0x38eb31=setTimeout(function(){logger[_0x542b('0x31')](_0x542b('0x4f'),_0x4d640d);endRouting(_0x4d640d,_0x197405,_0x29a2c1,_0x5986f2);clearTimeout(_0x38eb31);_0x14fe93['close'](!![]);_0x472ace[_0x542b('0x50')]();},_0x306985);switch(_0x197405[_0x542b('0x51')]){case'rrmemory':strategy['rrmemory'](_0x14fe93,_0x197405,_0x5986f2,_0x29a2c1);break;default:strategy[_0x542b('0x52')](_0x14fe93,_0x197405,_0x5986f2,_0x29a2c1);}}else{logger[_0x542b('0x36')](_0x542b('0x53'),_0x4d640d,_0x47adbe[_0x542b('0x32')]);_0x472ace[_0x542b('0x54')]();}}}catch(_0x39f484){console[_0x542b('0x55')](_0x39f484);logger[_0x542b('0x36')](_0x542b('0x42'),_0x4d640d,_0x39f484[_0x542b('0x56')]);_0x472ace['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 70da1f4..160e016 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 _0x1481=['agent','realtime','routing','handleRun','bind','handleTimeout','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busy','busyQueue','showNotification','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue'];(function(_0x1ec428,_0x303ee5){var _0x14698f=function(_0x509e0b){while(--_0x509e0b){_0x1ec428['push'](_0x1ec428['shift']());}};_0x14698f(++_0x303ee5);}(_0x1481,0x95));var _0x1148=function(_0x2ae666,_0x1785fe){_0x2ae666=_0x2ae666-0x0;var _0x38b099=_0x1481[_0x2ae666];return _0x38b099;};'use strict';var _=require(_0x1148('0x0'));var uuid=require(_0x1148('0x1'));var util=require(_0x1148('0x2'));var logger=require(_0x1148('0x3'))('routing');var Agent=function(_0x107a61,_0x32fb22,_0x1ebefd,_0x4e3719){this[_0x1148('0x4')]=uuid['v4']();this[_0x1148('0x5')]=_0x107a61;this[_0x1148('0x6')]=_0x32fb22;this[_0x1148('0x7')]=_0x1ebefd;this[_0x1148('0x8')]=_0x4e3719;this['squeue']['push'](this[_0x1148('0x9')][_0x1148('0xa')](this),this[_0x1148('0xb')][_0x1148('0xa')](this));this[_0x1148('0x5')]['on']('timeout',this[_0x1148('0xb')]['bind'](this));this[_0x1148('0x5')]['on']('drained',this['handleDrained'][_0x1148('0xa')](this));};Agent[_0x1148('0xc')][_0x1148('0xd')]=function(){this['squeue'][_0x1148('0xd')](this[_0x1148('0x9')][_0x1148('0xa')](this),this[_0x1148('0xb')][_0x1148('0xa')](this));};Agent[_0x1148('0xc')][_0x1148('0xe')]=function(){this[_0x1148('0xb')](!![]);};Agent['prototype'][_0x1148('0x9')]=function(_0x36b2ed){logger[_0x1148('0xf')](_0x1148('0x10'),this['squeue']['id'],this[_0x1148('0x6')]['id']);if(_[_0x1148('0x11')](this[_0x1148('0x7')]['agents'][this['agent']['id']])){logger[_0x1148('0xf')](_0x1148('0x12'),this[_0x1148('0x5')]['id'],this[_0x1148('0x6')]['id']);setTimeout(this[_0x1148('0xd')][_0x1148('0xa')](this),0x3e8);}else{if(this[_0x1148('0x8')][_0x1148('0x13')]||util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0x1148('0x14')][this[_0x1148('0x6')]['id']],this[_0x1148('0x5')][_0x1148('0x15')],![])){this[_0x1148('0x7')][_0x1148('0x14')][this[_0x1148('0x6')]['id']][_0x1148('0x16')]=!![];this[_0x1148('0x7')]['agents'][this[_0x1148('0x6')]['id']][_0x1148('0x17')]=undefined;util[_0x1148('0x18')](this[_0x1148('0x4')],this['squeue']['id'],this[_0x1148('0x7')][_0x1148('0x14')][this[_0x1148('0x6')]['id']],null,this[_0x1148('0x8')]);util['writeLog'](this[_0x1148('0x5')]['id'],this[_0x1148('0x7')][_0x1148('0x14')][this[_0x1148('0x6')]['id']],_0x1148('0x19')+(this[_0x1148('0x8')][_0x1148('0x13')]?':FORCED':''));}else{logger[_0x1148('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x1148('0x5')]['id'],this[_0x1148('0x6')]['id']);setTimeout(this[_0x1148('0xd')][_0x1148('0xa')](this),0x3e8);}}};Agent[_0x1148('0xc')][_0x1148('0xb')]=function(_0x5f50ae){if(_['isNil'](this[_0x1148('0x7')][_0x1148('0x14')][this[_0x1148('0x6')]['id']])){return logger[_0x1148('0xf')](_0x1148('0x12'),this[_0x1148('0x5')]['id'],this[_0x1148('0x6')]['id']);}else{logger['info'](_0x1148('0x1a'),this[_0x1148('0x5')]['id'],this[_0x1148('0x6')]['id']);util[_0x1148('0x1b')](this['notificationId'],this[_0x1148('0x5')]['id'],this[_0x1148('0x7')][_0x1148('0x14')][this[_0x1148('0x6')]['id']],null,this[_0x1148('0x8')]);this[_0x1148('0x7')]['agents'][this[_0x1148('0x6')]['id']]['busy']=![];this['realtime'][_0x1148('0x14')][this[_0x1148('0x6')]['id']][_0x1148('0x17')]=undefined;util[_0x1148('0x1c')](this['squeue']['id'],this['realtime'][_0x1148('0x14')][this[_0x1148('0x6')]['id']],_0x5f50ae?_0x1148('0x1d'):'TIMEOUT');}if(!_0x5f50ae){setTimeout(this[_0x1148('0xd')][_0x1148('0xa')](this),0x3e8);}};function agent(_0x3462c5,_0x31e220,_0x4df02a,_0x2137d6){return new Agent(_0x3462c5,_0x31e220,_0x4df02a,_0x2137d6);}module[_0x1148('0x1e')]=agent; \ No newline at end of file +var _0xaee2=['./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','showNotification','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','busyQueue','writeLog','TIMEOUT','exports','lodash','uuid'];(function(_0x5f34c0,_0x51a32d){var _0x3aa812=function(_0x13a40d){while(--_0x13a40d){_0x5f34c0['push'](_0x5f34c0['shift']());}};_0x3aa812(++_0x51a32d);}(_0xaee2,0x15e));var _0x2aee=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xaee2[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x2aee('0x0'));var uuid=require(_0x2aee('0x1'));var util=require(_0x2aee('0x2'));var logger=require(_0x2aee('0x3'))(_0x2aee('0x4'));var Agent=function(_0x1208a7,_0x1ee796,_0x49f4a4,_0x159081){this[_0x2aee('0x5')]=uuid['v4']();this[_0x2aee('0x6')]=_0x1208a7;this[_0x2aee('0x7')]=_0x1ee796;this['realtime']=_0x49f4a4;this['routing']=_0x159081;this[_0x2aee('0x6')][_0x2aee('0x8')](this[_0x2aee('0x9')][_0x2aee('0xa')](this),this[_0x2aee('0xb')][_0x2aee('0xa')](this));this[_0x2aee('0x6')]['on']('timeout',this[_0x2aee('0xb')][_0x2aee('0xa')](this));this[_0x2aee('0x6')]['on']('drained',this[_0x2aee('0xc')][_0x2aee('0xa')](this));};Agent[_0x2aee('0xd')]['push']=function(){this[_0x2aee('0x6')][_0x2aee('0x8')](this[_0x2aee('0x9')][_0x2aee('0xa')](this),this[_0x2aee('0xb')][_0x2aee('0xa')](this));};Agent[_0x2aee('0xd')][_0x2aee('0xc')]=function(){this[_0x2aee('0xb')](!![]);};Agent[_0x2aee('0xd')][_0x2aee('0x9')]=function(_0x25206e){logger[_0x2aee('0xe')](_0x2aee('0xf'),this[_0x2aee('0x6')]['id'],this['agent']['id']);if(_[_0x2aee('0x10')](this[_0x2aee('0x11')][_0x2aee('0x12')][this[_0x2aee('0x7')]['id']])){logger[_0x2aee('0xe')](_0x2aee('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x2aee('0x8')][_0x2aee('0xa')](this),0x3e8);}else{if(this[_0x2aee('0x4')][_0x2aee('0x14')]||util[_0x2aee('0x15')](this['squeue']['id'],this[_0x2aee('0x11')][_0x2aee('0x12')][this[_0x2aee('0x7')]['id']],this[_0x2aee('0x6')][_0x2aee('0x16')],![])){this[_0x2aee('0x11')]['agents'][this[_0x2aee('0x7')]['id']]['busy']=!![];this[_0x2aee('0x11')][_0x2aee('0x12')][this[_0x2aee('0x7')]['id']]['busyQueue']=undefined;util[_0x2aee('0x17')](this[_0x2aee('0x5')],this[_0x2aee('0x6')]['id'],this[_0x2aee('0x11')]['agents'][this[_0x2aee('0x7')]['id']],null,this[_0x2aee('0x4')]);util['writeLog'](this[_0x2aee('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],_0x2aee('0x18')+(this[_0x2aee('0x4')][_0x2aee('0x14')]?':FORCED':''));}else{logger[_0x2aee('0xe')](_0x2aee('0x19'),this['squeue']['id'],this[_0x2aee('0x7')]['id']);setTimeout(this[_0x2aee('0x8')]['bind'](this),0x3e8);}}};Agent[_0x2aee('0xd')][_0x2aee('0xb')]=function(_0xb4cf1){if(_[_0x2aee('0x10')](this[_0x2aee('0x11')][_0x2aee('0x12')][this[_0x2aee('0x7')]['id']])){return logger[_0x2aee('0xe')](_0x2aee('0x13'),this[_0x2aee('0x6')]['id'],this[_0x2aee('0x7')]['id']);}else{logger['info'](_0x2aee('0x1a'),this[_0x2aee('0x6')]['id'],this[_0x2aee('0x7')]['id']);util['hideNotification'](this[_0x2aee('0x5')],this['squeue']['id'],this['realtime'][_0x2aee('0x12')][this[_0x2aee('0x7')]['id']],null,this[_0x2aee('0x4')]);this[_0x2aee('0x11')]['agents'][this[_0x2aee('0x7')]['id']][_0x2aee('0x1b')]=![];this['realtime'][_0x2aee('0x12')][this['agent']['id']][_0x2aee('0x1c')]=undefined;util[_0x2aee('0x1d')](this[_0x2aee('0x6')]['id'],this[_0x2aee('0x11')][_0x2aee('0x12')][this[_0x2aee('0x7')]['id']],_0xb4cf1?'STOP':_0x2aee('0x1e'));}if(!_0xb4cf1){setTimeout(this[_0x2aee('0x8')][_0x2aee('0xa')](this),0x3e8);}};function agent(_0x3bd7cd,_0x28c79c,_0x295482,_0x46836a){return new Agent(_0x3bd7cd,_0x28c79c,_0x295482,_0x46836a);}module[_0x2aee('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 7683ee9..b35f98f 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 _0x6bff=['exports','lodash','uuid','../../../../../config/logger','squeue','queue','realtime','routing','push','handleRun','bind','timeout','handleTimeout','drained','prototype','isNil','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','busyQueue','name','showNotification','notificationId','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6bff,0xa6));var _0xf6bf=function(_0x1f799f,_0x267bbb){_0x1f799f=_0x1f799f-0x0;var _0x1bc3fc=_0x6bff[_0x1f799f];return _0x1bc3fc;};'use strict';var _=require(_0xf6bf('0x0'));var uuid=require(_0xf6bf('0x1'));var util=require('./util');var logger=require(_0xf6bf('0x2'))('routing');var Beepall=function(_0x290028,_0xd1df50,_0x3ab762,_0x14a2d8){this['notificationId']=uuid['v4']();this[_0xf6bf('0x3')]=_0x290028;this[_0xf6bf('0x4')]=_0xd1df50;this[_0xf6bf('0x5')]=_0x3ab762;this[_0xf6bf('0x6')]=_0x14a2d8;this[_0xf6bf('0x3')][_0xf6bf('0x7')](this[_0xf6bf('0x8')][_0xf6bf('0x9')](this),this['handleTimeout']['bind'](this));this['squeue']['on'](_0xf6bf('0xa'),this[_0xf6bf('0xb')][_0xf6bf('0x9')](this));this[_0xf6bf('0x3')]['on'](_0xf6bf('0xc'),this['handleDrained'][_0xf6bf('0x9')](this));};Beepall[_0xf6bf('0xd')]['push']=function(){this['squeue'][_0xf6bf('0x7')](this[_0xf6bf('0x8')]['bind'](this),this[_0xf6bf('0xb')]['bind'](this));};Beepall[_0xf6bf('0xd')]['handleDrained']=function(_0x1aed26){this[_0xf6bf('0xb')](!![]);};Beepall['prototype']['handleRun']=function(_0xfd2b28){var _0x532cb1=!![];if(!_[_0xf6bf('0xe')](this[_0xf6bf('0x4')])&&!_[_0xf6bf('0xe')](this[_0xf6bf('0x4')][_0xf6bf('0xf')])&&this[_0xf6bf('0x4')]['Agents'][_0xf6bf('0x10')]>0x0){for(var _0x3608bf=0x0,_0x14e33f;_0x3608bf0x0){for(var _0x5c6b5d=0x0,_0x3a44e1;_0x5c6b5d0x0&&_0x2f7c45[_0x15c4a9+'CurrentCapacity']>=_0x2f7c45[_0x15c4a9+_0xbd8f('0x21')]){writeLog(_0x1628f5,_0x2f7c45,_0x15c4a9[_0xbd8f('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xbd8f('0x24')]=function(_0x557daa,_0x41b2a6,_0x30d62e,_0x991401,_0x202126){return sendNotification(!![],_0x557daa,_0x41b2a6,_0x30d62e,_0x991401,_0x202126);};exports[_0xbd8f('0x25')]=function(_0x247b07,_0x4c4431,_0x166de7,_0x14f3cb,_0x39714d){return sendNotification(![],_0x247b07,_0x4c4431,_0x166de7,_0x14f3cb,_0x39714d);};exports[_0xbd8f('0x26')]=writeLog; \ No newline at end of file +var _0x0a6b=['hideNotification','writeLog','lodash','ioredis','../../../../../config/logger','routing','redis','socket.io-emitter','emit','format','name','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','user:%s','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x496cdc,_0x9d6db3){_0x496cdc=_0x496cdc-0x0;var _0x103a8e=_0x0a6b[_0x496cdc];return _0x103a8e;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0xb0a6('0x1'));var config=require('../../../../../config/environment');var logger=require(_0xb0a6('0x2'))(_0xb0a6('0x3'));config[_0xb0a6('0x4')]=_['defaults'](config[_0xb0a6('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xb0a6('0x5'))(new Redis(config[_0xb0a6('0x4')]));function emit(_0x5e2d2d,_0x11cd5b,_0x24515c){io['to'](_0x5e2d2d)[_0xb0a6('0x6')](_0x11cd5b,_0x24515c);}function sendNotification(_0x530c05,_0x47c553,_0x5161af,_0x2ded05,_0x43e5a5,_0x34b835){io['to'](util[_0xb0a6('0x7')]('user:%s',_0x2ded05[_0xb0a6('0x8')]))[_0xb0a6('0x6')]('user:save',_0x2ded05);var _0x23eade=_0x34b835||{};var _0x24e4fd=_0x5161af[_0xb0a6('0x9')]('.');var _0x2a5bb3={'uniqueid':_0x47c553,'channel':_0x24e4fd[0x0],'id':_0x24e4fd[0x1],'title':_0x24e4fd[0x0]+_0xb0a6('0xa'),'interactionId':_0x24e4fd[0x2],'queue':_0x43e5a5?_0x43e5a5[_0xb0a6('0x8')]:null,'sound':_0x23eade[_0xb0a6('0xb')][_0xb0a6('0xc')],'shake':_0x23eade[_0xb0a6('0xb')][_0xb0a6('0xd')]};try{if(!_0x23eade['body']){_0x23eade[_0xb0a6('0xe')]={};}if(_0x43e5a5){_0x23eade['body'][_0xb0a6('0xf')]=_0x43e5a5;}else if(_0x23eade['body'][_0xb0a6('0xf')]){delete _0x23eade['body'][_0xb0a6('0xf')];}_0x2a5bb3[_0xb0a6('0x10')]=utils[_0xb0a6('0x11')](_0x23eade['account']['notificationTemplate'],_0x23eade);}catch(_0x51105b){_0x2a5bb3[_0xb0a6('0x10')]=_0xb0a6('0x12');logger[_0xb0a6('0x13')](util[_0xb0a6('0x7')](_0xb0a6('0x14'),_0x47c553,_0x51105b['message']));}io['to'](util[_0xb0a6('0x7')](_0xb0a6('0x15'),_0x2ded05[_0xb0a6('0x8')]))[_0xb0a6('0x6')](util[_0xb0a6('0x7')](_0xb0a6('0x16'),_0x530c05?'save':_0xb0a6('0x17')),_0x2a5bb3);}function writeLog(_0x6d2003,_0x2d0fca,_0x6bdcc1){return logger[_0xb0a6('0x18')](util[_0xb0a6('0x7')](_0xb0a6('0x19'),_0x6d2003,_0x2d0fca[_0xb0a6('0x8')],_0x6bdcc1));}exports['isAgentAvailable']=function(_0x3db6a6,_0x5c6e66,_0x1322ec,_0x2f1e97){if(_0x5c6e66['busy']){writeLog(_0x3db6a6,_0x5c6e66,'BUSY');return![];}if(!_0x5c6e66[_0xb0a6('0x1a')]){writeLog(_0x3db6a6,_0x5c6e66,_0xb0a6('0x1b'));return![];}if(_0x5c6e66[_0x1322ec+'Pause']){writeLog(_0x3db6a6,_0x5c6e66,_0xb0a6('0x1c'));return![];}if(_0x2f1e97&&_0x5c6e66[_0xb0a6('0x1d')](_0x1322ec+_0xb0a6('0x1e'))&&_0x5c6e66[_0xb0a6('0x1d')](_0x1322ec+'CurrentCapacity')){if(_0x5c6e66[_0x1322ec+'Capacity']>0x0&&_0x5c6e66[_0x1322ec+_0xb0a6('0x1f')]>=_0x5c6e66[_0x1322ec+_0xb0a6('0x1e')]){writeLog(_0x3db6a6,_0x5c6e66,_0x1322ec[_0xb0a6('0x20')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xb0a6('0x21')]=function(_0x3347ac,_0x3edd9a,_0xc1c647,_0x10cf86,_0x3aef2b){return sendNotification(!![],_0x3347ac,_0x3edd9a,_0xc1c647,_0x10cf86,_0x3aef2b);};exports[_0xb0a6('0x22')]=function(_0x305661,_0x4255b9,_0x4ced9f,_0x12d683,_0x26eb41){return sendNotification(![],_0x305661,_0x4255b9,_0x4ced9f,_0x12d683,_0x26eb41);};exports[_0xb0a6('0x23')]=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 0be85e2..726d814 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 _0x9d3e=['message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x46c9f1,_0x23ab9e){var _0xfa62b=function(_0x2902cc){while(--_0x2902cc){_0x46c9f1['push'](_0x46c9f1['shift']());}};_0xfa62b(++_0x23ab9e);}(_0x9d3e,0xd5));var _0xe9d3=function(_0xb7c645,_0x5d5c94){_0xb7c645=_0xb7c645-0x0;var _0x2ac686=_0x9d3e[_0xb7c645];return _0x2ac686;};'use strict';var schema=require(_0xe9d3('0x0'));var sh=require('shelljs');var _=require(_0xe9d3('0x1'));var utils=require('./utils');var logger=require(_0xe9d3('0x2'))(_0xe9d3('0x3'));var system=schema({'command':{'type':_0xe9d3('0x4'),'required':!![],'message':_0xe9d3('0x5')}});exports[_0xe9d3('0x6')]=function(_0x4cb47e,_0x35b03c){return function(_0x5529bc){try{var _0x4dc214={'command':_0x35b03c[0x0]};var _0x4d8ea2=system[_0xe9d3('0x0')](_0x4dc214,{'typecast':!![]});if(_0x4d8ea2[_0xe9d3('0x7')]){logger[_0xe9d3('0x8')](_0xe9d3('0x9'),_0x4cb47e,_[_0xe9d3('0xa')](_0x4d8ea2,_0xe9d3('0xb'))[_0xe9d3('0xc')](',\x20'));logger[_0xe9d3('0xd')](_0xe9d3('0xe'),_0x4cb47e);_0x5529bc[_0xe9d3('0xf')]();}else{var _0x5003dd=this;var _0x40126e=utils['getMustacheRender'](_0x35b03c[0x0],this);logger[_0xe9d3('0xd')](_0xe9d3('0x10'),_0x4cb47e,_0x40126e);sh[_0xe9d3('0x11')](_[_0xe9d3('0x12')](_0x40126e),function(_0x503967,_0x105223){logger[_0xe9d3('0xd')](_0xe9d3('0x13'),_0x4cb47e,_0x503967);if(_0x503967==0x0){var _0x4cf310=_0x105223[_0xe9d3('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0xe9d3('0x15')](_0x35b03c[0x1])||_[_0xe9d3('0x16')](_0x35b03c[0x1])){logger[_0xe9d3('0xd')](_0xe9d3('0x17'),_0x4cb47e);_0x5003dd[_0xe9d3('0x18')][_0x35b03c[0x1]]=_0x4cf310;}else{logger[_0xe9d3('0xd')](_0xe9d3('0x19'),_0x4cb47e,_0x35b03c[0x1],_0x4cf310);_0x5003dd[_0xe9d3('0x18')][_0x35b03c[0x1]]=_0x4cf310;}}_0x5529bc['next']();});}}catch(_0x5d1d14){logger[_0xe9d3('0x8')](_0xe9d3('0x9'),_0x4cb47e,_[_0xe9d3('0x1a')](_0x5d1d14)?JSON[_0xe9d3('0x1b')](_0x5d1d14):_0x5d1d14);logger['info'](_0xe9d3('0xe'),_0x4cb47e);_0x5529bc[_0xe9d3('0xf')]();}};}; \ No newline at end of file +var _0x7694=['length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x34da30,_0x2115ec){var _0x2ffe1f=function(_0x1117d0){while(--_0x1117d0){_0x34da30['push'](_0x34da30['shift']());}};_0x2ffe1f(++_0x2115ec);}(_0x7694,0x1a2));var _0x4769=function(_0x273c5e,_0x250533){_0x273c5e=_0x273c5e-0x0;var _0x41f46e=_0x7694[_0x273c5e];return _0x41f46e;};'use strict';var schema=require(_0x4769('0x0'));var sh=require(_0x4769('0x1'));var _=require('lodash');var utils=require(_0x4769('0x2'));var logger=require(_0x4769('0x3'))(_0x4769('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x4769('0x5')}});exports[_0x4769('0x6')]=function(_0x37d55a,_0x128b87){return function(_0x47f980){try{var _0x216a40={'command':_0x128b87[0x0]};var _0x3a3d40=system[_0x4769('0x0')](_0x216a40,{'typecast':!![]});if(_0x3a3d40[_0x4769('0x7')]){logger[_0x4769('0x8')](_0x4769('0x9'),_0x37d55a,_[_0x4769('0xa')](_0x3a3d40,_0x4769('0xb'))[_0x4769('0xc')](',\x20'));logger[_0x4769('0xd')](_0x4769('0xe'),_0x37d55a);_0x47f980['next']();}else{var _0x587c2f=this;var _0x229319=utils[_0x4769('0xf')](_0x128b87[0x0],this);logger[_0x4769('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x37d55a,_0x229319);sh['exec'](_[_0x4769('0x10')](_0x229319),function(_0x514735,_0x5da327){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x37d55a,_0x514735);if(_0x514735==0x0){var _0x634357=_0x5da327[_0x4769('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x4769('0x12')](_0x128b87[0x1])||_['isEmpty'](_0x128b87[0x1])){logger[_0x4769('0xd')](_0x4769('0x13'),_0x37d55a);_0x587c2f[_0x4769('0x14')][_0x128b87[0x1]]=_0x634357;}else{logger[_0x4769('0xd')](_0x4769('0x15'),_0x37d55a,_0x128b87[0x1],_0x634357);_0x587c2f[_0x4769('0x14')][_0x128b87[0x1]]=_0x634357;}}_0x47f980[_0x4769('0x16')]();});}}catch(_0x43b2d6){logger['error'](_0x4769('0x9'),_0x37d55a,_[_0x4769('0x17')](_0x43b2d6)?JSON[_0x4769('0x18')](_0x43b2d6):_0x43b2d6);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x37d55a);_0x47f980[_0x4769('0x16')]();}};}; \ 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 3715a87..f58aa18 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 _0xd99d=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20%s','stringify','finally','validate','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xd99d,0x1d6));var _0xdd99=function(_0x4ff5ee,_0x1e3b5b){_0x4ff5ee=_0x4ff5ee-0x0;var _0x2ac3a5=_0xd99d[_0x4ff5ee];return _0x2ac3a5;};'use strict';var schema=require(_0xdd99('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xdd99('0x1')),'smsInteraction':require(_0xdd99('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xdd99('0x3')),'whatsappInteraction':require(_0xdd99('0x4'))};var logger=require(_0xdd99('0x5'))(_0xdd99('0x6'));var tag=schema({'tag':{'type':_0xdd99('0x7'),'required':!![],'message':_0xdd99('0x8')}});exports[_0xdd99('0x9')]=function(_0x27e9e9,_0x1c07da,_0xd932bb,_0x3cd475){return function(_0x203bc9){try{var _0x612118={'tag':_0x1c07da[0x0]};var _0x10f8b0=tag[_0xdd99('0x0')](_0x612118,{'typecast':!![]});if(_0x10f8b0[_0xdd99('0xa')]){logger[_0xdd99('0xb')]('[%s][TAG]\x20%s',_0x27e9e9,_[_0xdd99('0xc')](_0x10f8b0,_0xdd99('0xd'))[_0xdd99('0xe')](',\x20'));logger['info'](_0xdd99('0xf'),_0x27e9e9);_0x203bc9[_0xdd99('0x10')]();}else{var _0x5d77b7={'ids':[_0x1c07da[0x0]]};if(rpc[_0x3cd475[_0xdd99('0x11')]+'Interaction']){rpc[_0x3cd475[_0xdd99('0x11')]+_0xdd99('0x12')][_0xdd99('0x13')](_0x3cd475['interaction']['id'],_0x5d77b7)[_0xdd99('0x14')](function(_0x2e42f0){logger[_0xdd99('0x15')](_0xdd99('0x16'),_0x27e9e9,_0x1c07da[0x1],_0x3cd475[_0xdd99('0x11')],_0x3cd475[_0xdd99('0x17')]['id']);})[_0xdd99('0x18')](function(_0x82deb){logger[_0xdd99('0xb')](_0xdd99('0x19'),_0x27e9e9,JSON[_0xdd99('0x1a')](_0x82deb));logger[_0xdd99('0x15')](_0xdd99('0xf'),_0x27e9e9);})[_0xdd99('0x1b')](function(){_0x203bc9['next']();});}}}catch(_0x224a30){logger[_0xdd99('0xb')](_0xdd99('0x19'),_0x27e9e9,_['isObject'](_0x224a30)?JSON[_0xdd99('0x1a')](_0x224a30):_0x224a30);logger[_0xdd99('0x15')](_0xdd99('0xf'),_0x27e9e9);_0x203bc9[_0xdd99('0x10')]();}};}; \ No newline at end of file +var _0x46fa=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','next','isObject','validate','lodash','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x2352d6,_0x3edf41){var _0x3ebf53=function(_0x1b7cb7){while(--_0x1b7cb7){_0x2352d6['push'](_0x2352d6['shift']());}};_0x3ebf53(++_0x3edf41);}(_0x46fa,0x1e9));var _0xa46f=function(_0x148ea2,_0x178ae7){_0x148ea2=_0x148ea2-0x0;var _0x4447a5=_0x46fa[_0x148ea2];return _0x4447a5;};'use strict';var schema=require(_0xa46f('0x0'));var _=require(_0xa46f('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xa46f('0x2')),'whatsappInteraction':require(_0xa46f('0x3'))};var logger=require(_0xa46f('0x4'))(_0xa46f('0x5'));var tag=schema({'tag':{'type':_0xa46f('0x6'),'required':!![],'message':_0xa46f('0x7')}});exports[_0xa46f('0x8')]=function(_0x33b943,_0x2a4ab0,_0xf2a110,_0x470e13){return function(_0xc9128f){try{var _0x295f81={'tag':_0x2a4ab0[0x0]};var _0x5050e8=tag[_0xa46f('0x0')](_0x295f81,{'typecast':!![]});if(_0x5050e8[_0xa46f('0x9')]){logger[_0xa46f('0xa')](_0xa46f('0xb'),_0x33b943,_[_0xa46f('0xc')](_0x5050e8,_0xa46f('0xd'))[_0xa46f('0xe')](',\x20'));logger[_0xa46f('0xf')](_0xa46f('0x10'),_0x33b943);_0xc9128f['next']();}else{var _0x529517={'ids':[_0x2a4ab0[0x0]]};if(rpc[_0x470e13['channel']+_0xa46f('0x11')]){rpc[_0x470e13[_0xa46f('0x12')]+_0xa46f('0x11')][_0xa46f('0x13')](_0x470e13[_0xa46f('0x14')]['id'],_0x529517)[_0xa46f('0x15')](function(_0x281a47){logger[_0xa46f('0xf')](_0xa46f('0x16'),_0x33b943,_0x2a4ab0[0x1],_0x470e13[_0xa46f('0x12')],_0x470e13[_0xa46f('0x14')]['id']);})['catch'](function(_0x42cfc7){logger[_0xa46f('0xa')]('[%s][TAG]\x20%s',_0x33b943,JSON[_0xa46f('0x17')](_0x42cfc7));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x33b943);})['finally'](function(){_0xc9128f[_0xa46f('0x18')]();});}}}catch(_0x557433){logger[_0xa46f('0xa')](_0xa46f('0xb'),_0x33b943,_[_0xa46f('0x19')](_0x557433)?JSON[_0xa46f('0x17')](_0x557433):_0x557433);logger[_0xa46f('0xf')](_0xa46f('0x10'),_0x33b943);_0xc9128f[_0xa46f('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 f28cc23..f747034 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 _0xf420=['&serviceId=','&sessionId=','stringify','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','consequence','\x20-\x20','includes','push','urlOnRing','title','jsonrpc','2.0','method','login','utf8','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId='];(function(_0x563e99,_0x181622){var _0x196311=function(_0x2d7dac){while(--_0x2d7dac){_0x563e99['push'](_0x563e99['shift']());}};_0x196311(++_0x181622);}(_0xf420,0x191));var _0x0f42=function(_0x41a60b,_0xc398d){_0x41a60b=_0x41a60b-0x0;var _0x10c95a=_0xf420[_0x41a60b];return _0x10c95a;};'use strict';var rp=require(_0x0f42('0x0'));var logger=require(_0x0f42('0x1'))('routing');var _=require('lodash');var arr=[];exports[_0x0f42('0x2')]=function(_0x557f51,_0x499eb4){return function(_0xce4fe0){var _0x288b03=_0x499eb4[0xa];var _0x55bf75=_0x499eb4[0xb];var _0x989315=_0x499eb4[0xc];var _0x573eaf=_0x499eb4[0xd];var _0x5bc73a=_0x499eb4[0xe];var _0x53b716=_0x499eb4[0xf]['replace'](/\n/g,_0x0f42('0x3'));var _0x28c24a=_0x499eb4[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x0f42('0x4')](_0x55bf75)){arr[_0x0f42('0x5')](_0x55bf75);var _0x930426=_0x499eb4[0x3];var _0x321805=_0x499eb4[0x4];var _0x41458=_0x499eb4[0x1];var _0xd1f228=_0x499eb4[0x0];var _0x4690b3={};_0x4690b3['urlOnAnswer']=_0x499eb4[0x8]+'?params='+_0x989315+'|'+_0x288b03+'|'+_0x573eaf+'|'+_0x55bf75+'|'+_0x5bc73a;_0x4690b3[_0x0f42('0x6')]=_0x499eb4[0x7]+'?params='+_0x989315+'|'+_0x288b03+'|'+_0x573eaf+'|'+_0x55bf75+'|'+_0x5bc73a+'|'+_0x53b716+'|'+_0x28c24a;_0x4690b3[_0x0f42('0x7')]=_0x499eb4[0x9];var _0x575d35={};_0x575d35[_0x0f42('0x8')]=_0x0f42('0x9');_0x575d35[_0x0f42('0xa')]=_0x0f42('0xb');var _0x488fff=[];_0x488fff['push'](_0x499eb4[0x2]);_0x488fff[_0x0f42('0x5')](_0x499eb4[0x5]);_0x488fff[_0x0f42('0x5')](_0x499eb4[0x6]);_0x575d35['params']=_0x488fff;_0x575d35['id']=0x1;var _0x52fd80=JSON['stringify'](_0x575d35);var _0x2b65dc={'encoding':_0x0f42('0xc'),'method':'POST','timeout':0x2710,'url':_0x930426,'headers':{'Content-Type':_0x0f42('0xd')},'body':_0x52fd80};return rp(_0x2b65dc)[_0x0f42('0xe')](function(_0x59024b){const _0x439013=JSON[_0x0f42('0xf')](_0x59024b);if(!_0x439013[_0x0f42('0x10')]['logged']){throw new Error(_0x0f42('0x11'));}var _0x24ff9b=_0x55bf75;var _0x52b308=_0x0f42('0x12')+_0x41458+_0x0f42('0x13')+_0xd1f228+_0x0f42('0x14')+_0x24ff9b+'&data='+JSON[_0x0f42('0x15')](_0x4690b3);var _0x43d361=_0x321805+'?'+_0x52b308;return rp(_0x43d361);})[_0x0f42('0xe')](function(_0x1aad34){logger[_0x0f42('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x557f51,_0x1aad34);_0xce4fe0[_0x0f42('0x17')]();})[_0x0f42('0x18')](function(_0x257421){logger[_0x0f42('0x19')](_0x0f42('0x1a'),_0x557f51,_[_0x0f42('0x1b')](_0x257421)?JSON[_0x0f42('0x15')](_0x257421):_0x257421);_0xce4fe0[_0x0f42('0x17')]();});}else{logger[_0x0f42('0x16')](_0x0f42('0x1c'),_0x557f51);_0xce4fe0[_0x0f42('0x1d')]();}};}; \ No newline at end of file +var _0xc99a=['Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','then','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','push','params','stringify','utf8','application/json-rpc','parse','result','logged'];(function(_0x79bfad,_0x3017f0){var _0x24b30c=function(_0x1629ec){while(--_0x1629ec){_0x79bfad['push'](_0x79bfad['shift']());}};_0x24b30c(++_0x3017f0);}(_0xc99a,0xc1));var _0xac99=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc99a[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require(_0xac99('0x0'));var logger=require(_0xac99('0x1'))(_0xac99('0x2'));var _=require(_0xac99('0x3'));var arr=[];exports[_0xac99('0x4')]=function(_0x355406,_0x388d6b){return function(_0x7efa7f){var _0x1572ca=_0x388d6b[0xa];var _0x572e4f=_0x388d6b[0xb];var _0xa75056=_0x388d6b[0xc];var _0x3e1502=_0x388d6b[0xd];var _0x50a171=_0x388d6b[0xe];var _0x4874fc=_0x388d6b[0xf]['replace'](/\n/g,_0xac99('0x5'));var _0x3838df=_0x388d6b[0x10][_0xac99('0x6')](/\n/g,'\x20');if(!arr[_0xac99('0x7')](_0x572e4f)){arr['push'](_0x572e4f);var _0x25b2c8=_0x388d6b[0x3];var _0x47d1f6=_0x388d6b[0x4];var _0x282c57=_0x388d6b[0x1];var _0x2825bf=_0x388d6b[0x0];var _0x21f61d={};_0x21f61d[_0xac99('0x8')]=_0x388d6b[0x8]+'?params='+_0xa75056+'|'+_0x1572ca+'|'+_0x3e1502+'|'+_0x572e4f+'|'+_0x50a171;_0x21f61d['urlOnRing']=_0x388d6b[0x7]+_0xac99('0x9')+_0xa75056+'|'+_0x1572ca+'|'+_0x3e1502+'|'+_0x572e4f+'|'+_0x50a171+'|'+_0x4874fc+'|'+_0x3838df;_0x21f61d[_0xac99('0xa')]=_0x388d6b[0x9];var _0x5333c0={};_0x5333c0[_0xac99('0xb')]=_0xac99('0xc');_0x5333c0[_0xac99('0xd')]=_0xac99('0xe');var _0x2930b7=[];_0x2930b7[_0xac99('0xf')](_0x388d6b[0x2]);_0x2930b7[_0xac99('0xf')](_0x388d6b[0x5]);_0x2930b7[_0xac99('0xf')](_0x388d6b[0x6]);_0x5333c0[_0xac99('0x10')]=_0x2930b7;_0x5333c0['id']=0x1;var _0x500f58=JSON[_0xac99('0x11')](_0x5333c0);var _0x24e2b7={'encoding':_0xac99('0x12'),'method':'POST','timeout':0x2710,'url':_0x25b2c8,'headers':{'Content-Type':_0xac99('0x13')},'body':_0x500f58};return rp(_0x24e2b7)['then'](function(_0x36610b){const _0x1bca79=JSON[_0xac99('0x14')](_0x36610b);if(!_0x1bca79[_0xac99('0x15')][_0xac99('0x16')]){throw new Error(_0xac99('0x17'));}var _0x504e1d=_0x572e4f;var _0x1cccdd='channelId='+_0x282c57+_0xac99('0x18')+_0x2825bf+_0xac99('0x19')+_0x504e1d+_0xac99('0x1a')+JSON[_0xac99('0x11')](_0x21f61d);var _0x1f7476=_0x47d1f6+'?'+_0x1cccdd;return rp(_0x1f7476);})[_0xac99('0x1b')](function(_0x3018a8){logger['info'](_0xac99('0x1c'),_0x355406,_0x3018a8);_0x7efa7f[_0xac99('0x1d')]();})[_0xac99('0x1e')](function(_0x9d73e1){logger[_0xac99('0x1f')](_0xac99('0x20'),_0x355406,_[_0xac99('0x21')](_0x9d73e1)?JSON[_0xac99('0x11')](_0x9d73e1):_0x9d73e1);_0x7efa7f[_0xac99('0x1d')]();});}else{logger[_0xac99('0x22')](_0xac99('0x23'),_0x355406);_0x7efa7f['next']();}};}; \ 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 d2d9d33..458aaf1 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x43ca75,_0x3ea084){var _0x24fb1c=function(_0x805dd3){while(--_0x805dd3){_0x43ca75['push'](_0x43ca75['shift']());}};_0x24fb1c(++_0x3ea084);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0xba42a2,_0x539e86){var _0x149e46=function(_0x330418){while(--_0x330418){_0xba42a2['push'](_0xba42a2['shift']());}};_0x149e46(++_0x539e86);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index a62e03d..2935070 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 _0x235a=['../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','interaction','applications','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','message','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','agents','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','mailQueues','loggedIn','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport'];(function(_0x451231,_0xcc9ee){var _0x3b5b08=function(_0x131dda){while(--_0x131dda){_0x451231['push'](_0x451231['shift']());}};_0x3b5b08(++_0xcc9ee);}(_0x235a,0x1ef));var _0xa235=function(_0x2b6e76,_0x98195a){_0x2b6e76=_0x2b6e76-0x0;var _0x5d32b3=_0x235a[_0x2b6e76];return _0x5d32b3;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var path=require(_0xa235('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xa235('0x3'));var uuid=require('uuid');var utils=require(_0xa235('0x4'));var config=require(_0xa235('0x5'));var logger=require(_0xa235('0x6'))(_0xa235('0x7'));var rpc={'openchannelQueueReport':require(_0xa235('0x8')),'mailQueueReport':require(_0xa235('0x9')),'chatQueueReport':require(_0xa235('0xa')),'smsQueueReport':require(_0xa235('0xb')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa235('0xc'))};var RuleEngine=require(_0xa235('0xd'));function getId(_0x450e27,_0x2f3403,_0x5c60d9){return util[_0xa235('0xe')]('%s.%s.%s',_0x450e27,_0x2f3403||0x0,_0x5c60d9||0x0);}function getIntervals(_0x560eb1,_0x10bb4f){var _0x504b60=[];if(!_[_0xa235('0xf')](_0x10bb4f['IntervalId'])&&!_['isNil'](_0x560eb1[_0x10bb4f['IntervalId']])&&!_[_0xa235('0xf')](_0x560eb1[_0x10bb4f[_0xa235('0x10')]][_0xa235('0x11')])){_0x504b60=_[_0xa235('0x12')](_0x560eb1[_0x10bb4f['IntervalId']]['Intervals'],'interval');}else if(!_[_0xa235('0xf')](_0x10bb4f[_0xa235('0x13')])){_0x504b60=[_0x10bb4f[_0xa235('0x13')]];}return _0x504b60;}exports[_0xa235('0x14')]=function(_0x36b4b1){_0x36b4b1[_0xa235('0x15')]={};return new BPromise(function(_0x2eb1ff,_0x1e03a8){var _0x1369de={'Start':function(_0x4aceee){var _0x352463=this;return new Promise(function(_0x20cd67,_0x26fd63){if(_0x4aceee){try{var _0x128244=[];var _0x16dbe9=getId(_0x4aceee[_0xa235('0x16')],_0x4aceee['message']?_0x4aceee['message']['id']:0x0,_0x4aceee[_0xa235('0x17')]?_0x4aceee[_0xa235('0x17')]['id']:0x0);if(_0x4aceee[_0xa235('0x18')]&&_['isArray'](_0x4aceee[_0xa235('0x18')])&&_0x4aceee[_0xa235('0x18')][_0xa235('0x19')]){for(var _0x3b115=0x0;_0x3b115<_0x4aceee[_0xa235('0x18')][_0xa235('0x19')];_0x3b115+=0x1){var _0x37faca=_0x4aceee['applications'][_0x3b115];if(fs['existsSync'](path[_0xa235('0x1a')](__dirname,_0xa235('0x18'),_0x37faca[_0xa235('0x1b')]+_0xa235('0x1c')))){var _0x2e38e=[];switch(_0x37faca[_0xa235('0x1b')][_0xa235('0x1d')]()){case _0xa235('0x1e'):var _0x42e367=_0x37faca[_0xa235('0x1f')][_0xa235('0x20')](',');if(_0x4aceee[_0xa235('0x16')]===_0xa235('0x21')){_0x2e38e[_0xa235('0x22')](_0x42e367[0x0]);_0x2e38e[_0xa235('0x22')](_0x42e367[0x1]);_0x2e38e[_0xa235('0x22')](_0x42e367[_0xa235('0x23')](0x2,_0x42e367[_0xa235('0x19')])[_0xa235('0x1a')](','));}else{_0x2e38e[_0xa235('0x22')](_0x42e367[0x0]);_0x2e38e[_0xa235('0x22')](_0x42e367['slice'](0x1,_0x42e367[_0xa235('0x19')])['join'](','));}break;case _0xa235('0x24'):var _0x53ec70=_0x37faca[_0xa235('0x1f')][_0xa235('0x20')](',');_0x2e38e[_0xa235('0x22')](_0x53ec70[0x0]);_0x2e38e[_0xa235('0x22')](_0x53ec70[0x1]);_0x2e38e[_0xa235('0x22')](_0x53ec70['slice'](0x2,_0x53ec70[_0xa235('0x19')])[_0xa235('0x1a')](','));break;case'dialogflowv2':var _0x4b33ef=_0x37faca['appdata']['split'](',');_0x2e38e[_0xa235('0x22')](_0x4b33ef[0x0]);_0x2e38e[_0xa235('0x22')](_0x4b33ef[0x1]);_0x2e38e[_0xa235('0x22')](_0x4b33ef[0x2]);_0x2e38e[_0xa235('0x22')](_0x4b33ef[0x3]);_0x2e38e[_0xa235('0x22')](_0x4b33ef[_0xa235('0x23')](0x4,_0x4b33ef[_0xa235('0x19')])['join'](','));break;case'amazonlex':var _0x2832be=_0x37faca[_0xa235('0x1f')]['split'](',');_0x2e38e[_0xa235('0x22')](_0x2832be[0x0]);_0x2e38e[_0xa235('0x22')](_0x2832be[0x1]);_0x2e38e[_0xa235('0x22')](_0x2832be[0x2]);_0x2e38e[_0xa235('0x22')](_0x2832be[0x3]);_0x2e38e[_0xa235('0x22')](_0x2832be[_0xa235('0x23')](0x4,_0x2832be[_0xa235('0x19')])[_0xa235('0x1a')](','));break;case'message':_0x2e38e[_0xa235('0x22')](_0x37faca['appdata']);break;case _0xa235('0x25'):_0x2e38e[_0xa235('0x22')](_0x37faca[_0xa235('0x26')]);_0x2e38e[_0xa235('0x22')](_0x37faca[_0xa235('0x1f')]);break;case _0xa235('0x27'):var _0x43752f=utils[_0xa235('0x28')](_0x4aceee[_0xa235('0x29')][_0xa235('0x2a')],_0x4aceee);var _0x291fb3=_0x37faca[_0xa235('0x1f')][_0xa235('0x20')](',');_0x2e38e['push'](_0x291fb3[0x0]);_0x2e38e['push'](_0x291fb3[0x1]);_0x2e38e['push'](_0x291fb3[0x2]);_0x2e38e[_0xa235('0x22')](_0x291fb3[0x3]);_0x2e38e['push'](_0x291fb3[0x4]);_0x2e38e[_0xa235('0x22')](_0x291fb3[0x5]);_0x2e38e[_0xa235('0x22')](_0x291fb3[0x6]);_0x2e38e[_0xa235('0x22')](_0x291fb3[0x7]);_0x2e38e[_0xa235('0x22')](_0x291fb3[0x8]);_0x2e38e[_0xa235('0x22')](_0x291fb3[0x9]);_0x2e38e[_0xa235('0x22')](_0x291fb3[0xa]);_0x2e38e[_0xa235('0x22')](_0x4aceee['interaction']['id']);_0x2e38e[_0xa235('0x22')](_0x4aceee[_0xa235('0x2b')]['id']);_0x2e38e['push'](_0x37faca[_0xa235('0x2c')]);_0x2e38e[_0xa235('0x22')](_0x4aceee[_0xa235('0x17')][_0xa235('0x2d')]);_0x2e38e[_0xa235('0x22')](_0x4aceee[_0xa235('0x2e')][_0xa235('0x2e')]);_0x2e38e[_0xa235('0x22')](_0x43752f);break;default:_0x2e38e=_[_0xa235('0xf')](_0x37faca['appdata'])?[]:_0x37faca[_0xa235('0x1f')][_0xa235('0x20')](',');}var _0xd2a85e={'id':util[_0xa235('0xe')](_0xa235('0x2f'),_0x16dbe9,_0x37faca['id'],_0x37faca['app']),'condition':require(_0xa235('0x30'))[_0xa235('0x31')](_0x16dbe9,getIntervals(_0x36b4b1[_0xa235('0x32')],_0x37faca),_0x36b4b1),'consequence':require(_0xa235('0x33')+_0x37faca['app'])[_0xa235('0x34')](_0x16dbe9,_0x2e38e,_0x36b4b1,_0x4aceee),'p':_0x37faca[_0xa235('0x35')]||0x0};logger[_0xa235('0x36')](_0xa235('0x37'),_0xd2a85e['id'],_0xa235('0x38'),getIntervals(_0x36b4b1[_0xa235('0x32')],_0x37faca)[_0xa235('0x1a')]('\x20|\x20'));_0x128244[_0xa235('0x22')](_0xd2a85e);}else{logger[_0xa235('0x39')](_0xa235('0x3a'),path[_0xa235('0x1a')](__dirname,_0xa235('0x18'),_0x37faca['app']+_0xa235('0x1c')));}}_0x36b4b1[_0xa235('0x15')][_0x16dbe9]=new RuleEngine(_0x128244);_0x36b4b1[_0xa235('0x15')][_0x16dbe9][_0xa235('0x3b')](_0x4aceee,function(_0x2de91a){logger['info'](_0xa235('0x3c'),JSON[_0xa235('0x3d')](_0x2de91a[_0xa235('0x3e')]));if(_0x36b4b1[_0xa235('0x15')][_0x16dbe9]){_0x36b4b1[_0xa235('0x15')][_0x16dbe9][_0xa235('0x3f')](_0xa235('0x40'));}});return _0x20cd67({'code':0xc8,'message':_0x4aceee});}else{logger[_0xa235('0x36')]('No\x20applications\x20to\x20execute');return _0x20cd67({'code':0xc8,'message':_0x4aceee});}}catch(_0x1837b3){logger[_0xa235('0x39')](_0x1837b3[_0xa235('0x41')]);return _0x26fd63(_0x352463[_0xa235('0x39')](0x1f4,_0x1837b3));}}return _0x26fd63(_0xa235('0x42'));});},'AcceptMessage':function(_0x461fa3){var _0x248692=this;return new Promise(function(_0x2ec301,_0xec860f){if(_0x461fa3['agent']&&_0x461fa3[_0xa235('0x43')]['id']){if(_0x36b4b1[_0xa235('0x44')][_0x461fa3[_0xa235('0x43')]['id']]){_0x36b4b1[_0xa235('0x44')][_0x461fa3[_0xa235('0x43')]['id']]['busy']=![];_0x36b4b1[_0xa235('0x44')][_0x461fa3[_0xa235('0x43')]['id']]['busyQueue']=undefined;}}if(_0x461fa3[_0xa235('0x2b')]&&_0x461fa3[_0xa235('0x2b')]['id']){try{var _0x2ba694=getId(_0x461fa3[_0xa235('0x16')],_0x461fa3['message']?_0x461fa3[_0xa235('0x2b')]['id']:0x0,_0x461fa3['interaction']?_0x461fa3[_0xa235('0x17')]['id']:0x0);if(_0x36b4b1[_0xa235('0x15')][_0x2ba694]){_0x36b4b1['rules'][_0x2ba694][_0xa235('0x3f')](_0xa235('0x45'));if(rpc[_0x461fa3[_0xa235('0x16')]+_0xa235('0x46')]){rpc[_0x461fa3[_0xa235('0x16')]+_0xa235('0x46')][_0xa235('0x47')](_0x2ba694,{'UserId':_0x461fa3[_0xa235('0x2b')]['UserId']})['catch'](function(_0x508473){logger[_0xa235('0x39')](_0xa235('0x48'));});}}return _0x2ec301({'code':0xc8,'message':_0x461fa3});}catch(_0x476401){logger[_0xa235('0x39')](_0x476401['stack']);return _0xec860f(_0x248692[_0xa235('0x39')](0x1f4,_0x476401));}}logger['error'](_0xa235('0x49'));return _0xec860f(_0x248692[_0xa235('0x39')](0x1f4,_0xa235('0x49')));});},'RejectMessage':function(_0x1c9f2b){var _0x54edb0=this;return new Promise(function(_0x5041f5,_0x51144e){if(_0x1c9f2b[_0xa235('0x43')]&&_0x1c9f2b[_0xa235('0x43')]['id']){try{if(_0x36b4b1['agents'][_0x1c9f2b[_0xa235('0x43')]['id']]){_0x36b4b1[_0xa235('0x44')][_0x1c9f2b[_0xa235('0x43')]['id']][_0xa235('0x4a')]=![];_0x36b4b1['agents'][_0x1c9f2b['agent']['id']]['busyQueue']=undefined;}return _0x5041f5({'code':0xc8,'message':_0x1c9f2b});}catch(_0x386ba7){logger[_0xa235('0x39')](_0x386ba7['stack']);return _0x51144e(_0x54edb0['error'](0x1f4,_0x386ba7));}}logger[_0xa235('0x39')]('message\x20is\x20empty');return _0x51144e(_0x54edb0['error'](0x1f4,_0xa235('0x49')));});},'AbandonInteraction':function(_0x16b035){var _0x873161=this;return new Promise(function(_0x2b7e0e,_0x50bfa4){if(_0x16b035[_0xa235('0x16')]&&_0x16b035[_0xa235('0x17')]&&_0x16b035[_0xa235('0x17')]['id']){try{var _0x2e1667=getId(_0x16b035[_0xa235('0x16')],_0x16b035[_0xa235('0x2b')]?_0x16b035[_0xa235('0x2b')]['id']:0x0,_0x16b035[_0xa235('0x17')]?_0x16b035[_0xa235('0x17')]['id']:0x0);if(_0x36b4b1[_0xa235('0x15')][_0x2e1667]){_0x36b4b1['rules'][_0x2e1667][_0xa235('0x3f')](_0xa235('0x45'));}return _0x2b7e0e({'code':0xc8,'message':_0x16b035});}catch(_0x9604a5){logger[_0xa235('0x39')](_0x9604a5[_0xa235('0x41')]);return _0x50bfa4(_0x873161['error'](0x1f4,_0x9604a5));}}logger[_0xa235('0x39')](_0xa235('0x49'));return _0x50bfa4(_0x873161['error'](0x1f4,_0xa235('0x49')));});},'AgentCapacity':function(_0xe80ed0){var _0x479861=this;return new Promise(function(_0x4e05fa,_0x5c6dd2){if(_0x36b4b1[_0xa235('0x44')][_0xa235('0x4b')](_0xe80ed0['id'])){for(var _0x55392a in _0xe80ed0[_0xa235('0x4c')]){if(_0xe80ed0['capacity']['hasOwnProperty'](_0x55392a)){if(_0x36b4b1[_0xa235('0x44')][_0xe80ed0['id']]['hasOwnProperty'](_0x55392a+_0xa235('0x4d'))){_0x36b4b1[_0xa235('0x44')][_0xe80ed0['id']][_0x55392a+_0xa235('0x4d')]=parseInt(_0xe80ed0[_0xa235('0x4c')][_0x55392a],0xa);}}}_0x36b4b1[_0xa235('0x44')][_0xe80ed0['id']][_0xa235('0x4e')]();return _0x4e05fa({'code':0xc8,'message':_0x36b4b1[_0xa235('0x44')][_0xe80ed0['id']]});}else{return _0x5c6dd2(_0x479861[_0xa235('0x39')](0x1f4,_0xa235('0x4f')));}});},'Agents':function(_0xa7749a){return new Promise(function(_0x1b19f2,_0x17cb61){var _0x972dba=_[_0xa235('0x50')](_0x36b4b1[_0xa235('0x44')]);_0x1b19f2({'count':_0x972dba[_0xa235('0x19')],'rows':_0x972dba});});},'ChatQueues':function(_0x4576c8){return new Promise(function(_0x5dbc35,_0xbd740e){var _0xe9cc76=[];for(var _0x8ead7 in _0x36b4b1['chatQueues']){if(_0x36b4b1['chatQueues'][_0xa235('0x4b')](_0x8ead7)){var _0x1851db=_0x36b4b1[_0xa235('0x51')][_0x8ead7];var _0x5798e9={'id':_0x1851db['id'],'available':_0x1851db[_0xa235('0x52')],'loggedIn':_0x1851db['loggedIn'],'name':_0x1851db[_0xa235('0x53')],'paused':_0x1851db['paused'],'waiting':_0x1851db['waiting']};_0xe9cc76[_0xa235('0x22')](_0x5798e9);}}_0x5dbc35({'count':_0xe9cc76['length'],'rows':_0xe9cc76});});},'MailQueues':function(_0x52298e){return new Promise(function(_0x53cbbb,_0x532353){var _0x582e39=[];for(var _0x30003c in _0x36b4b1[_0xa235('0x54')]){if(_0x36b4b1[_0xa235('0x54')]['hasOwnProperty'](_0x30003c)){var _0x3adc13=_0x36b4b1[_0xa235('0x54')][_0x30003c];var _0x2ad01a={'id':_0x3adc13['id'],'available':_0x3adc13[_0xa235('0x52')],'loggedIn':_0x3adc13[_0xa235('0x55')],'name':_0x3adc13['name'],'paused':_0x3adc13[_0xa235('0x56')],'waiting':_0x3adc13[_0xa235('0x57')]};_0x582e39[_0xa235('0x22')](_0x2ad01a);}}_0x53cbbb({'count':_0x582e39[_0xa235('0x19')],'rows':_0x582e39});});},'OpenchannelQueues':function(_0x33146a){return new Promise(function(_0x1f3988,_0x6f1489){var _0x488dd0=[];for(var _0x5bde03 in _0x36b4b1[_0xa235('0x58')]){if(_0x36b4b1[_0xa235('0x58')][_0xa235('0x4b')](_0x5bde03)){var _0x51ee05=_0x36b4b1[_0xa235('0x58')][_0x5bde03];var _0x582d4d={'id':_0x51ee05['id'],'available':_0x51ee05[_0xa235('0x52')],'loggedIn':_0x51ee05[_0xa235('0x55')],'name':_0x51ee05['name'],'paused':_0x51ee05[_0xa235('0x56')],'waiting':_0x51ee05[_0xa235('0x57')]};_0x488dd0[_0xa235('0x22')](_0x582d4d);}}_0x1f3988({'count':_0x488dd0[_0xa235('0x19')],'rows':_0x488dd0});});},'SmsQueues':function(_0x2043ae){return new Promise(function(_0x3bf214,_0x4f1576){var _0x154f45=[];for(var _0x35b07b in _0x36b4b1[_0xa235('0x59')]){if(_0x36b4b1[_0xa235('0x59')][_0xa235('0x4b')](_0x35b07b)){var _0x541d3e=_0x36b4b1[_0xa235('0x59')][_0x35b07b];var _0x25ee35={'id':_0x541d3e['id'],'available':_0x541d3e[_0xa235('0x52')],'loggedIn':_0x541d3e[_0xa235('0x55')],'name':_0x541d3e[_0xa235('0x53')],'paused':_0x541d3e['paused'],'waiting':_0x541d3e[_0xa235('0x57')]};_0x154f45[_0xa235('0x22')](_0x25ee35);}}_0x3bf214({'count':_0x154f45[_0xa235('0x19')],'rows':_0x154f45});});},'FaxQueues':function(_0x11df6f){return new Promise(function(_0x3620bb,_0xcd7efd){var _0x5dc85e=[];for(var _0x1af3bc in _0x36b4b1[_0xa235('0x5a')]){if(_0x36b4b1['faxQueues'][_0xa235('0x4b')](_0x1af3bc)){var _0x4f3b5b=_0x36b4b1[_0xa235('0x5a')][_0x1af3bc];var _0x33ad4b={'id':_0x4f3b5b['id'],'available':_0x4f3b5b['available'],'loggedIn':_0x4f3b5b[_0xa235('0x55')],'name':_0x4f3b5b['name'],'paused':_0x4f3b5b['paused'],'waiting':_0x4f3b5b[_0xa235('0x57')]};_0x5dc85e[_0xa235('0x22')](_0x33ad4b);}}_0x3620bb({'count':_0x5dc85e[_0xa235('0x19')],'rows':_0x5dc85e});});},'WhatsappQueues':function(_0xec784d){return new Promise(function(_0x14046f,_0x2b7725){var _0x371176=[];for(var _0x295664 in _0x36b4b1[_0xa235('0x5b')]){if(_0x36b4b1['whatsappQueues'][_0xa235('0x4b')](_0x295664)){var _0x541251=_0x36b4b1[_0xa235('0x5b')][_0x295664];var _0x38b8b8={'id':_0x541251['id'],'available':_0x541251[_0xa235('0x52')],'loggedIn':_0x541251['loggedIn'],'name':_0x541251[_0xa235('0x53')],'paused':_0x541251[_0xa235('0x56')],'waiting':_0x541251[_0xa235('0x57')]};_0x371176[_0xa235('0x22')](_0x38b8b8);}}_0x14046f({'count':_0x371176['length'],'rows':_0x371176});});},'ChatQueuesWaitingInteractions':function(_0x490da0){return new Promise(function(_0x384358,_0x5d2960){var _0x1fd843=_[_0xa235('0x50')](_0x36b4b1[_0xa235('0x5c')]);_0x384358({'count':_0x1fd843['length'],'rows':_0x1fd843});});},'MailQueuesWaitingInteractions':function(_0x4243fd){return new Promise(function(_0x36902d,_0xc862f3){var _0x2c67a4=_[_0xa235('0x50')](_0x36b4b1[_0xa235('0x5d')]);_0x36902d({'count':_0x2c67a4['length'],'rows':_0x2c67a4});});},'OpenchannelQueuesWaitingInteractions':function(_0x3dcc89){return new Promise(function(_0x1e91fe,_0x23917c){var _0x24e95a=_[_0xa235('0x50')](_0x36b4b1[_0xa235('0x5e')]);_0x1e91fe({'count':_0x24e95a[_0xa235('0x19')],'rows':_0x24e95a});});},'SmsQueuesWaitingInteractions':function(_0x14a129){return new Promise(function(_0x510ca7,_0x4ccffe){var _0x39a2b7=_[_0xa235('0x50')](_0x36b4b1[_0xa235('0x5f')]);_0x510ca7({'count':_0x39a2b7[_0xa235('0x19')],'rows':_0x39a2b7});});},'FaxQueuesWaitingInteractions':function(_0x4cecb9){return new Promise(function(_0x462398,_0x25c836){var _0x353b14=_[_0xa235('0x50')](_0x36b4b1['faxQueuesWaitingInteractions']);_0x462398({'count':_0x353b14[_0xa235('0x19')],'rows':_0x353b14});});},'WhatsappQueuesWaitingInteractions':function(_0x307048){return new Promise(function(_0x1a007f,_0x165f3e){var _0x4f759c=_[_0xa235('0x50')](_0x36b4b1[_0xa235('0x60')]);_0x1a007f({'count':_0x4f759c[_0xa235('0x19')],'rows':_0x4f759c});});}};var _0x2ed830=jayson['server'](_0x1369de)[_0xa235('0x61')]();_0x2ed830['on']('error',function(_0x31053e){logger[_0xa235('0x39')](JSON[_0xa235('0x3d')](_0x31053e));return _0x1e03a8(_0x31053e);});_0x2ed830[_0xa235('0x14')](0x232c,_0xa235('0x62'),function(){console['log'](_0xa235('0x63'),0x232c);return _0x2eb1ff(_0xa235('0x64')+0x232c);});});}; \ No newline at end of file +var _0xeebe=['./interval','consequence','priority','info','Push\x20new\x20rule','intervals','\x20|\x20','execute','Applications\x20executed','stringify','matchPath','emit','complete','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','app','.js','appdata','split','mail','push','join','slice','dialogflow','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s'];(function(_0x3eb855,_0x36ad21){var _0xcb2c56=function(_0x5e5701){while(--_0x5e5701){_0x3eb855['push'](_0x3eb855['shift']());}};_0xcb2c56(++_0x36ad21);}(_0xeebe,0xff));var _0xeeeb=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xeebe[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xeeeb('0x0'));var util=require('util');var path=require(_0xeeeb('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xeeeb('0x2'));var uuid=require(_0xeeeb('0x3'));var utils=require(_0xeeeb('0x4'));var config=require(_0xeeeb('0x5'));var logger=require(_0xeeeb('0x6'))(_0xeeeb('0x7'));var rpc={'openchannelQueueReport':require(_0xeeeb('0x8')),'mailQueueReport':require(_0xeeeb('0x9')),'chatQueueReport':require(_0xeeeb('0xa')),'smsQueueReport':require(_0xeeeb('0xb')),'faxQueueReport':require(_0xeeeb('0xc')),'whatsappQueueReport':require(_0xeeeb('0xd'))};var RuleEngine=require(_0xeeeb('0xe'));function getId(_0x1f88ea,_0xc3e1ba,_0x263799){return util[_0xeeeb('0xf')](_0xeeeb('0x10'),_0x1f88ea,_0xc3e1ba||0x0,_0x263799||0x0);}function getIntervals(_0x4a1161,_0x4f4bb7){var _0x2564e0=[];if(!_[_0xeeeb('0x11')](_0x4f4bb7[_0xeeeb('0x12')])&&!_['isNil'](_0x4a1161[_0x4f4bb7[_0xeeeb('0x12')]])&&!_[_0xeeeb('0x11')](_0x4a1161[_0x4f4bb7[_0xeeeb('0x12')]]['Intervals'])){_0x2564e0=_[_0xeeeb('0x13')](_0x4a1161[_0x4f4bb7['IntervalId']]['Intervals'],_0xeeeb('0x14'));}else if(!_[_0xeeeb('0x11')](_0x4f4bb7[_0xeeeb('0x14')])){_0x2564e0=[_0x4f4bb7[_0xeeeb('0x14')]];}return _0x2564e0;}exports[_0xeeeb('0x15')]=function(_0x1bf055){_0x1bf055[_0xeeeb('0x16')]={};return new BPromise(function(_0x2ebb9a,_0x40b8e8){var _0x21cf7a={'Start':function(_0x441095){var _0xd23e0e=this;return new Promise(function(_0x1cbbbc,_0x25a5be){if(_0x441095){try{var _0x253cf4=[];var _0x1b1d02=getId(_0x441095[_0xeeeb('0x17')],_0x441095[_0xeeeb('0x18')]?_0x441095[_0xeeeb('0x18')]['id']:0x0,_0x441095[_0xeeeb('0x19')]?_0x441095[_0xeeeb('0x19')]['id']:0x0);if(_0x441095[_0xeeeb('0x1a')]&&_[_0xeeeb('0x1b')](_0x441095[_0xeeeb('0x1a')])&&_0x441095[_0xeeeb('0x1a')][_0xeeeb('0x1c')]){for(var _0x434cdf=0x0;_0x434cdf<_0x441095['applications'][_0xeeeb('0x1c')];_0x434cdf+=0x1){var _0x496311=_0x441095['applications'][_0x434cdf];if(fs['existsSync'](path['join'](__dirname,_0xeeeb('0x1a'),_0x496311[_0xeeeb('0x1d')]+_0xeeeb('0x1e')))){var _0x2d2b7f=[];switch(_0x496311[_0xeeeb('0x1d')]['toLowerCase']()){case'autoreply':var _0x3409aa=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');if(_0x441095[_0xeeeb('0x17')]===_0xeeeb('0x21')){_0x2d2b7f['push'](_0x3409aa[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa[0x1]);_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa['slice'](0x2,_0x3409aa['length'])[_0xeeeb('0x23')](','));}else{_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa[_0xeeeb('0x24')](0x1,_0x3409aa[_0xeeeb('0x1c')])[_0xeeeb('0x23')](','));}break;case _0xeeeb('0x25'):var _0x2f5854=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');_0x2d2b7f[_0xeeeb('0x22')](_0x2f5854[0x0]);_0x2d2b7f['push'](_0x2f5854[0x1]);_0x2d2b7f['push'](_0x2f5854[_0xeeeb('0x24')](0x2,_0x2f5854[_0xeeeb('0x1c')])[_0xeeeb('0x23')](','));break;case'dialogflowv2':var _0x1d7c1e=_0x496311[_0xeeeb('0x1f')]['split'](',');_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x1]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x2]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x3]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[_0xeeeb('0x24')](0x4,_0x1d7c1e['length'])[_0xeeeb('0x23')](','));break;case'amazonlex':var _0x21a812=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');_0x2d2b7f[_0xeeeb('0x22')](_0x21a812[0x0]);_0x2d2b7f['push'](_0x21a812[0x1]);_0x2d2b7f['push'](_0x21a812[0x2]);_0x2d2b7f[_0xeeeb('0x22')](_0x21a812[0x3]);_0x2d2b7f[_0xeeeb('0x22')](_0x21a812[_0xeeeb('0x24')](0x4,_0x21a812[_0xeeeb('0x1c')])[_0xeeeb('0x23')](','));break;case _0xeeeb('0x18'):_0x2d2b7f['push'](_0x496311[_0xeeeb('0x1f')]);break;case'tag':_0x2d2b7f[_0xeeeb('0x22')](_0x496311[_0xeeeb('0x26')]);_0x2d2b7f[_0xeeeb('0x22')](_0x496311[_0xeeeb('0x1f')]);break;case'tvox':var _0x4fa5f0=utils[_0xeeeb('0x27')](_0x441095[_0xeeeb('0x28')][_0xeeeb('0x29')],_0x441095);var _0x28c4d7=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x1]);_0x2d2b7f['push'](_0x28c4d7[0x2]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x3]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x4]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x5]);_0x2d2b7f['push'](_0x28c4d7[0x6]);_0x2d2b7f['push'](_0x28c4d7[0x7]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x8]);_0x2d2b7f['push'](_0x28c4d7[0x9]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0xa]);_0x2d2b7f['push'](_0x441095[_0xeeeb('0x19')]['id']);_0x2d2b7f['push'](_0x441095['message']['id']);_0x2d2b7f[_0xeeeb('0x22')](_0x496311['ChatWebsiteId']);_0x2d2b7f[_0xeeeb('0x22')](_0x441095['interaction'][_0xeeeb('0x2a')]);_0x2d2b7f[_0xeeeb('0x22')](_0x441095[_0xeeeb('0x2b')]['body']);_0x2d2b7f[_0xeeeb('0x22')](_0x4fa5f0);break;default:_0x2d2b7f=_[_0xeeeb('0x11')](_0x496311['appdata'])?[]:_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');}var _0xfe4a35={'id':util[_0xeeeb('0xf')](_0xeeeb('0x2c'),_0x1b1d02,_0x496311['id'],_0x496311['app']),'condition':require(_0xeeeb('0x2d'))['condition'](_0x1b1d02,getIntervals(_0x1bf055['intervals'],_0x496311),_0x1bf055),'consequence':require('./applications/'+_0x496311['app'])[_0xeeeb('0x2e')](_0x1b1d02,_0x2d2b7f,_0x1bf055,_0x441095),'p':_0x496311[_0xeeeb('0x2f')]||0x0};logger[_0xeeeb('0x30')](_0xeeeb('0x31'),_0xfe4a35['id'],'on\x20interval',getIntervals(_0x1bf055[_0xeeeb('0x32')],_0x496311)[_0xeeeb('0x23')](_0xeeeb('0x33')));_0x253cf4[_0xeeeb('0x22')](_0xfe4a35);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x496311[_0xeeeb('0x1d')]+_0xeeeb('0x1e')));}}_0x1bf055[_0xeeeb('0x16')][_0x1b1d02]=new RuleEngine(_0x253cf4);_0x1bf055[_0xeeeb('0x16')][_0x1b1d02][_0xeeeb('0x34')](_0x441095,function(_0x226bfe){logger['info'](_0xeeeb('0x35'),JSON[_0xeeeb('0x36')](_0x226bfe[_0xeeeb('0x37')]));if(_0x1bf055[_0xeeeb('0x16')][_0x1b1d02]){_0x1bf055['rules'][_0x1b1d02][_0xeeeb('0x38')](_0xeeeb('0x39'));}});return _0x1cbbbc({'code':0xc8,'message':_0x441095});}else{logger[_0xeeeb('0x30')]('No\x20applications\x20to\x20execute');return _0x1cbbbc({'code':0xc8,'message':_0x441095});}}catch(_0x986d6a){logger[_0xeeeb('0x3a')](_0x986d6a['stack']);return _0x25a5be(_0xd23e0e[_0xeeeb('0x3a')](0x1f4,_0x986d6a));}}return _0x25a5be(_0xeeeb('0x3b'));});},'AcceptMessage':function(_0x1b7d0b){var _0x2ebf0d=this;return new Promise(function(_0x443057,_0x19f204){if(_0x1b7d0b['agent']&&_0x1b7d0b[_0xeeeb('0x3c')]['id']){if(_0x1bf055['agents'][_0x1b7d0b[_0xeeeb('0x3c')]['id']]){_0x1bf055[_0xeeeb('0x3d')][_0x1b7d0b[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3e')]=![];_0x1bf055['agents'][_0x1b7d0b[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3f')]=undefined;}}if(_0x1b7d0b[_0xeeeb('0x18')]&&_0x1b7d0b[_0xeeeb('0x18')]['id']){try{var _0x5293b6=getId(_0x1b7d0b[_0xeeeb('0x17')],_0x1b7d0b['message']?_0x1b7d0b[_0xeeeb('0x18')]['id']:0x0,_0x1b7d0b[_0xeeeb('0x19')]?_0x1b7d0b[_0xeeeb('0x19')]['id']:0x0);if(_0x1bf055[_0xeeeb('0x16')][_0x5293b6]){_0x1bf055[_0xeeeb('0x16')][_0x5293b6][_0xeeeb('0x38')](_0xeeeb('0x40'));if(rpc[_0x1b7d0b['channel']+_0xeeeb('0x41')]){rpc[_0x1b7d0b[_0xeeeb('0x17')]+'QueueReport'][_0xeeeb('0x42')](_0x5293b6,{'UserId':_0x1b7d0b[_0xeeeb('0x18')][_0xeeeb('0x43')]})[_0xeeeb('0x44')](function(_0x31b100){logger[_0xeeeb('0x3a')](_0xeeeb('0x45'));});}}return _0x443057({'code':0xc8,'message':_0x1b7d0b});}catch(_0x152d64){logger[_0xeeeb('0x3a')](_0x152d64[_0xeeeb('0x46')]);return _0x19f204(_0x2ebf0d['error'](0x1f4,_0x152d64));}}logger[_0xeeeb('0x3a')](_0xeeeb('0x47'));return _0x19f204(_0x2ebf0d[_0xeeeb('0x3a')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5c03ad){var _0x1cc95b=this;return new Promise(function(_0x5bd1fb,_0x4b3f9f){if(_0x5c03ad[_0xeeeb('0x3c')]&&_0x5c03ad[_0xeeeb('0x3c')]['id']){try{if(_0x1bf055[_0xeeeb('0x3d')][_0x5c03ad['agent']['id']]){_0x1bf055[_0xeeeb('0x3d')][_0x5c03ad[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3e')]=![];_0x1bf055[_0xeeeb('0x3d')][_0x5c03ad[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3f')]=undefined;}return _0x5bd1fb({'code':0xc8,'message':_0x5c03ad});}catch(_0x53e185){logger[_0xeeeb('0x3a')](_0x53e185['stack']);return _0x4b3f9f(_0x1cc95b[_0xeeeb('0x3a')](0x1f4,_0x53e185));}}logger[_0xeeeb('0x3a')](_0xeeeb('0x47'));return _0x4b3f9f(_0x1cc95b[_0xeeeb('0x3a')](0x1f4,_0xeeeb('0x47')));});},'AbandonInteraction':function(_0x43ab07){var _0x587bcb=this;return new Promise(function(_0x4ec59e,_0x4fdf85){if(_0x43ab07['channel']&&_0x43ab07[_0xeeeb('0x19')]&&_0x43ab07[_0xeeeb('0x19')]['id']){try{var _0x30bb33=getId(_0x43ab07[_0xeeeb('0x17')],_0x43ab07[_0xeeeb('0x18')]?_0x43ab07[_0xeeeb('0x18')]['id']:0x0,_0x43ab07[_0xeeeb('0x19')]?_0x43ab07[_0xeeeb('0x19')]['id']:0x0);if(_0x1bf055['rules'][_0x30bb33]){_0x1bf055['rules'][_0x30bb33]['emit'](_0xeeeb('0x40'));}return _0x4ec59e({'code':0xc8,'message':_0x43ab07});}catch(_0x1ad67b){logger['error'](_0x1ad67b[_0xeeeb('0x46')]);return _0x4fdf85(_0x587bcb['error'](0x1f4,_0x1ad67b));}}logger[_0xeeeb('0x3a')](_0xeeeb('0x47'));return _0x4fdf85(_0x587bcb['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1b2e9e){var _0x9254bd=this;return new Promise(function(_0x2e631a,_0x2fdf5d){if(_0x1bf055['agents'][_0xeeeb('0x48')](_0x1b2e9e['id'])){for(var _0x300e8f in _0x1b2e9e[_0xeeeb('0x49')]){if(_0x1b2e9e[_0xeeeb('0x49')]['hasOwnProperty'](_0x300e8f)){if(_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']][_0xeeeb('0x48')](_0x300e8f+'CurrentCapacity')){_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']][_0x300e8f+_0xeeeb('0x4a')]=parseInt(_0x1b2e9e[_0xeeeb('0x49')][_0x300e8f],0xa);}}}_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']][_0xeeeb('0x4b')]();return _0x2e631a({'code':0xc8,'message':_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']]});}else{return _0x2fdf5d(_0x9254bd['error'](0x1f4,_0xeeeb('0x4c')));}});},'Agents':function(_0x346ecc){return new Promise(function(_0x5b0bcf,_0xc679ac){var _0xd6851b=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x3d')]);_0x5b0bcf({'count':_0xd6851b[_0xeeeb('0x1c')],'rows':_0xd6851b});});},'ChatQueues':function(_0x20b42e){return new Promise(function(_0x12d595,_0x2555e5){var _0x4585b7=[];for(var _0x1069fb in _0x1bf055['chatQueues']){if(_0x1bf055[_0xeeeb('0x4e')]['hasOwnProperty'](_0x1069fb)){var _0x1e087b=_0x1bf055[_0xeeeb('0x4e')][_0x1069fb];var _0x539619={'id':_0x1e087b['id'],'available':_0x1e087b['available'],'loggedIn':_0x1e087b[_0xeeeb('0x4f')],'name':_0x1e087b['name'],'paused':_0x1e087b[_0xeeeb('0x50')],'waiting':_0x1e087b[_0xeeeb('0x51')]};_0x4585b7['push'](_0x539619);}}_0x12d595({'count':_0x4585b7[_0xeeeb('0x1c')],'rows':_0x4585b7});});},'MailQueues':function(_0x1655f6){return new Promise(function(_0x1a3002,_0x3dd195){var _0x11d8af=[];for(var _0x388a2e in _0x1bf055[_0xeeeb('0x52')]){if(_0x1bf055[_0xeeeb('0x52')]['hasOwnProperty'](_0x388a2e)){var _0x24e384=_0x1bf055[_0xeeeb('0x52')][_0x388a2e];var _0xee4612={'id':_0x24e384['id'],'available':_0x24e384[_0xeeeb('0x53')],'loggedIn':_0x24e384[_0xeeeb('0x4f')],'name':_0x24e384[_0xeeeb('0x54')],'paused':_0x24e384['paused'],'waiting':_0x24e384[_0xeeeb('0x51')]};_0x11d8af[_0xeeeb('0x22')](_0xee4612);}}_0x1a3002({'count':_0x11d8af[_0xeeeb('0x1c')],'rows':_0x11d8af});});},'OpenchannelQueues':function(_0x149708){return new Promise(function(_0x4704f2,_0x170601){var _0x2bd357=[];for(var _0x5b4d5c in _0x1bf055['openchannelQueues']){if(_0x1bf055[_0xeeeb('0x55')]['hasOwnProperty'](_0x5b4d5c)){var _0xedb3a2=_0x1bf055[_0xeeeb('0x55')][_0x5b4d5c];var _0x384afa={'id':_0xedb3a2['id'],'available':_0xedb3a2['available'],'loggedIn':_0xedb3a2[_0xeeeb('0x4f')],'name':_0xedb3a2[_0xeeeb('0x54')],'paused':_0xedb3a2['paused'],'waiting':_0xedb3a2[_0xeeeb('0x51')]};_0x2bd357['push'](_0x384afa);}}_0x4704f2({'count':_0x2bd357[_0xeeeb('0x1c')],'rows':_0x2bd357});});},'SmsQueues':function(_0x5bf11b){return new Promise(function(_0x40729c,_0xbca82b){var _0x201483=[];for(var _0x4ee448 in _0x1bf055[_0xeeeb('0x56')]){if(_0x1bf055['smsQueues'][_0xeeeb('0x48')](_0x4ee448)){var _0x4b273b=_0x1bf055['smsQueues'][_0x4ee448];var _0x4f875f={'id':_0x4b273b['id'],'available':_0x4b273b[_0xeeeb('0x53')],'loggedIn':_0x4b273b[_0xeeeb('0x4f')],'name':_0x4b273b[_0xeeeb('0x54')],'paused':_0x4b273b['paused'],'waiting':_0x4b273b[_0xeeeb('0x51')]};_0x201483[_0xeeeb('0x22')](_0x4f875f);}}_0x40729c({'count':_0x201483['length'],'rows':_0x201483});});},'FaxQueues':function(_0x46a3d7){return new Promise(function(_0x10a44c,_0x289410){var _0x2a15ff=[];for(var _0x569b9a in _0x1bf055['faxQueues']){if(_0x1bf055[_0xeeeb('0x57')][_0xeeeb('0x48')](_0x569b9a)){var _0x397714=_0x1bf055['faxQueues'][_0x569b9a];var _0x1ecd3d={'id':_0x397714['id'],'available':_0x397714['available'],'loggedIn':_0x397714[_0xeeeb('0x4f')],'name':_0x397714['name'],'paused':_0x397714[_0xeeeb('0x50')],'waiting':_0x397714[_0xeeeb('0x51')]};_0x2a15ff[_0xeeeb('0x22')](_0x1ecd3d);}}_0x10a44c({'count':_0x2a15ff[_0xeeeb('0x1c')],'rows':_0x2a15ff});});},'WhatsappQueues':function(_0x3b72cd){return new Promise(function(_0x1be024,_0x5962f1){var _0x476b32=[];for(var _0x1537da in _0x1bf055[_0xeeeb('0x58')]){if(_0x1bf055[_0xeeeb('0x58')][_0xeeeb('0x48')](_0x1537da)){var _0x53f878=_0x1bf055[_0xeeeb('0x58')][_0x1537da];var _0x4c3b57={'id':_0x53f878['id'],'available':_0x53f878[_0xeeeb('0x53')],'loggedIn':_0x53f878['loggedIn'],'name':_0x53f878[_0xeeeb('0x54')],'paused':_0x53f878['paused'],'waiting':_0x53f878[_0xeeeb('0x51')]};_0x476b32[_0xeeeb('0x22')](_0x4c3b57);}}_0x1be024({'count':_0x476b32['length'],'rows':_0x476b32});});},'ChatQueuesWaitingInteractions':function(_0x86be9d){return new Promise(function(_0x56fbdc,_0x49e49c){var _0x54e154=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x59')]);_0x56fbdc({'count':_0x54e154['length'],'rows':_0x54e154});});},'MailQueuesWaitingInteractions':function(_0x5af5a4){return new Promise(function(_0x3caeb1,_0x4fb2fe){var _0x20dd64=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5a')]);_0x3caeb1({'count':_0x20dd64[_0xeeeb('0x1c')],'rows':_0x20dd64});});},'OpenchannelQueuesWaitingInteractions':function(_0x14f33b){return new Promise(function(_0x4192a3,_0xace43d){var _0x4931cb=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5b')]);_0x4192a3({'count':_0x4931cb[_0xeeeb('0x1c')],'rows':_0x4931cb});});},'SmsQueuesWaitingInteractions':function(_0x301982){return new Promise(function(_0x2feddf,_0x17f378){var _0x479c2e=_['values'](_0x1bf055[_0xeeeb('0x5c')]);_0x2feddf({'count':_0x479c2e[_0xeeeb('0x1c')],'rows':_0x479c2e});});},'FaxQueuesWaitingInteractions':function(_0x44109e){return new Promise(function(_0x1459d0,_0x5c3813){var _0x40185f=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5d')]);_0x1459d0({'count':_0x40185f[_0xeeeb('0x1c')],'rows':_0x40185f});});},'WhatsappQueuesWaitingInteractions':function(_0x11aca1){return new Promise(function(_0xd21fba,_0x2e64ff){var _0x12c0c8=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5e')]);_0xd21fba({'count':_0x12c0c8[_0xeeeb('0x1c')],'rows':_0x12c0c8});});}};var _0x226dbb=jayson[_0xeeeb('0x5f')](_0x21cf7a)[_0xeeeb('0x60')]();_0x226dbb['on'](_0xeeeb('0x3a'),function(_0x47d725){logger[_0xeeeb('0x3a')](JSON[_0xeeeb('0x36')](_0x47d725));return _0x40b8e8(_0x47d725);});_0x226dbb[_0xeeeb('0x15')](0x232c,_0xeeeb('0x61'),function(){console[_0xeeeb('0x62')](_0xeeeb('0x63'),0x232c);return _0x2ebb9a('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 120704e..bc235b9 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 _0xb725=['routing','client','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','then','indexOf','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger'];(function(_0x51e049,_0x19c15b){var _0x214213=function(_0x2cfec0){while(--_0x2cfec0){_0x51e049['push'](_0x51e049['shift']());}};_0x214213(++_0x19c15b);}(_0xb725,0x100));var _0x5b72=function(_0x5e90c8,_0x1b9897){_0x5e90c8=_0x5e90c8-0x0;var _0x58b731=_0xb725[_0x5e90c8];return _0x58b731;};'use strict';var util=require(_0x5b72('0x0'));var BPromise=require(_0x5b72('0x1'));var jayson=require(_0x5b72('0x2'));var _=require(_0x5b72('0x3'));var logger=require(_0x5b72('0x4'))(_0x5b72('0x5'));var client=jayson[_0x5b72('0x6')]['http']({'port':0x232a});function request(_0x57f568,_0x3813bb){return new BPromise(function(_0x39e84a,_0x5187e1){return client['request'](_0x57f568,_0x3813bb)['then'](function(_0x1fa4a2){if(_0x1fa4a2[_0x5b72('0x7')]){return _0x5187e1(_0x1fa4a2['error'][_0x5b72('0x8')]);}else{return _0x39e84a(_0x1fa4a2['result']);}})[_0x5b72('0x9')](function(_0x1d00a3){return _0x5187e1(_0x1d00a3);});});}exports['condition']=function(_0x2dea45,_0x421f9e,_0x3edca3){return function(_0x1860a0){if(_0x3edca3[_0x5b72('0xa')]&&!_0x3edca3[_0x5b72('0xa')][_0x2dea45]){logger[_0x5b72('0xb')](_0x5b72('0xc'),_0x2dea45);return _0x1860a0[_0x5b72('0xd')]();}var _0x1a4ff7=[];for(var _0x178bb2=0x0;_0x178bb2<_0x421f9e[_0x5b72('0xe')];_0x178bb2+=0x1){_0x1a4ff7[_0x5b72('0xf')](request(_0x5b72('0x10'),{'command':util[_0x5b72('0x11')](_0x5b72('0x12'),_0x421f9e[_0x178bb2])})[_0x5b72('0x13')](function(_0x4b4a22){return _0x4b4a22&&_0x4b4a22['message']&&_0x4b4a22[_0x5b72('0x8')][_0x5b72('0x14')]('true')>=0x0?!![]:![];})[_0x5b72('0x9')](function(_0x359363){logger[_0x5b72('0x7')](_0x5b72('0x15'),_0x2dea45,_0x421f9e[_0x178bb2]);}));}BPromise['all'](_0x1a4ff7)[_0x5b72('0x13')](function(_0x246775){var _0x365dd=_[_0x5b72('0x16')](_0x246775);logger[_0x5b72('0xb')](_0x5b72('0x17'),_0x2dea45,_0x421f9e['join']('\x20|\x20'),_0x365dd);_0x1860a0[_0x5b72('0x18')](_0x365dd);})[_0x5b72('0x9')](function(_0x392c6){console[_0x5b72('0x19')](_0x392c6);logger['error'](_0x5b72('0x17'),_0x2dea45,_0x421f9e[_0x5b72('0x1a')](_0x5b72('0x1b')),_0x392c6[_0x5b72('0x1c')]);_0x1860a0[_0x5b72('0xd')]();});};}; \ No newline at end of file +var _0x1114=['indexOf','true','[%s][INTERVAL]\x20%s','some','when','log','[%s][INTERVAL]\x20%s\x20%s','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','format','iftime\x20%s','message'];(function(_0x4c7d8b,_0x572388){var _0x187158=function(_0x5e956d){while(--_0x5e956d){_0x4c7d8b['push'](_0x4c7d8b['shift']());}};_0x187158(++_0x572388);}(_0x1114,0x8e));var _0x4111=function(_0x1d70e6,_0x31f6eb){_0x1d70e6=_0x1d70e6-0x0;var _0x2d61cb=_0x1114[_0x1d70e6];return _0x2d61cb;};'use strict';var util=require(_0x4111('0x0'));var BPromise=require(_0x4111('0x1'));var jayson=require(_0x4111('0x2'));var _=require(_0x4111('0x3'));var logger=require(_0x4111('0x4'))(_0x4111('0x5'));var client=jayson['client'][_0x4111('0x6')]({'port':0x232a});function request(_0x285ad4,_0x487be7){return new BPromise(function(_0x2ea03b,_0x194d6b){return client[_0x4111('0x7')](_0x285ad4,_0x487be7)[_0x4111('0x8')](function(_0x4554e3){if(_0x4554e3['error']){return _0x194d6b(_0x4554e3[_0x4111('0x9')]['message']);}else{return _0x2ea03b(_0x4554e3[_0x4111('0xa')]);}})[_0x4111('0xb')](function(_0x490bf4){return _0x194d6b(_0x490bf4);});});}exports['condition']=function(_0x50b934,_0x384bde,_0x582a26){return function(_0x3dbc56){if(_0x582a26[_0x4111('0xc')]&&!_0x582a26['rules'][_0x50b934]){logger[_0x4111('0xd')](_0x4111('0xe'),_0x50b934);return _0x3dbc56[_0x4111('0xf')]();}var _0x5bfe72=[];for(var _0x58d861=0x0;_0x58d861<_0x384bde[_0x4111('0x10')];_0x58d861+=0x1){_0x5bfe72['push'](request('Command',{'command':util[_0x4111('0x11')](_0x4111('0x12'),_0x384bde[_0x58d861])})[_0x4111('0x8')](function(_0x1abd6a){return _0x1abd6a&&_0x1abd6a[_0x4111('0x13')]&&_0x1abd6a[_0x4111('0x13')][_0x4111('0x14')](_0x4111('0x15'))>=0x0?!![]:![];})[_0x4111('0xb')](function(_0x290ea4){logger['error'](_0x4111('0x16'),_0x50b934,_0x384bde[_0x58d861]);}));}BPromise['all'](_0x5bfe72)[_0x4111('0x8')](function(_0x121b4a){var _0x21710e=_[_0x4111('0x17')](_0x121b4a);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x50b934,_0x384bde['join']('\x20|\x20'),_0x21710e);_0x3dbc56[_0x4111('0x18')](_0x21710e);})[_0x4111('0xb')](function(_0xb2cb46){console[_0x4111('0x19')](_0xb2cb46);logger[_0x4111('0x9')](_0x4111('0x1a'),_0x50b934,_0x384bde['join']('\x20|\x20'),_0xb2cb46['stack']);_0x3dbc56['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 940fcbf..6915012 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(_0x5c6d79,_0x543803){var _0x453212=function(_0x367763){while(--_0x367763){_0x5c6d79['push'](_0x5c6d79['shift']());}};_0x453212(++_0x543803);}(_0xbf6e,0x149));var _0xebf6=function(_0x2c1ee7,_0x3443b8){_0x2c1ee7=_0x2c1ee7-0x0;var _0x2f9e25=_0xbf6e[_0x2c1ee7];return _0x2f9e25;};'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 _0x34b7=['acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','secondtransfererexten','transfertargetuniqueid','clone','calleridname','[%s][agents][hangup]','cause','rejected','indexOf','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw'];(function(_0x3a3795,_0x4c1b8d){var _0x42706d=function(_0x248334){while(--_0x248334){_0x3a3795['push'](_0x3a3795['shift']());}};_0x42706d(++_0x4c1b8d);}(_0x34b7,0x196));var _0x734b=function(_0x2619a0,_0x4ab479){_0x2619a0=_0x2619a0-0x0;var _0x94f5f8=_0x34b7[_0x2619a0];return _0x94f5f8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x734b('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1aedd0,_0x6e4318){utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x3'),_0x1aedd0['uniqueid'],_0x1aedd0['channel'],_0x1aedd0[_0x734b('0x4')],_0x1aedd0[_0x734b('0x5')],_0x1aedd0[_0x734b('0x6')],_0x1aedd0[_0x734b('0x7')],_0x1aedd0[_0x734b('0x8')],_0x1aedd0[_0x734b('0x9')]));if(_0x1aedd0['queue']){utils[_0x734b('0xa')](_0x1aedd0[_0x734b('0x4')])['then'](function(_0x53f163){if(_0x53f163){_0x1aedd0['type']=_0x53f163[_0x734b('0xb')];_0x1aedd0['agentacw']=_0x1aedd0[_0x734b('0xc')]?_0x53f163[_0x734b('0xd')]:![];_0x1aedd0[_0x734b('0xe')]=_0x1aedd0[_0x734b('0xf')]?_0x53f163[_0x734b('0x10')]:0x0;}utils[_0x734b('0x11')](_0x734b('0x12'),_0x1aedd0);});}else{utils[_0x734b('0x11')](_0x734b('0x12'),_0x1aedd0);}if(_0x6e4318){delete transfers[_0x1aedd0[_0x734b('0x13')]];}else{delete agents[_0x1aedd0[_0x734b('0x14')]];}}exports[_0x734b('0x15')]=function(_0x145ec3){try{utils[_0x734b('0x16')](util['format'](_0x734b('0x17'),_0x145ec3[_0x734b('0x13')]),_0x145ec3);agents[_0x145ec3[_0x734b('0x14')]]=_0x145ec3;agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x9')]=_0x734b('0x1a');agents[_0x145ec3[_0x734b('0x14')]][_0x734b('0x8')]=null;agents[_0x145ec3['destuniqueid']][_0x734b('0x1b')]=null;utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x1c'),_0x145ec3['uniqueid'],agents[_0x145ec3['destuniqueid']][_0x734b('0x5')],_0x145ec3[_0x734b('0x14')]));}catch(_0x1e6ed9){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x17'),_0x145ec3[_0x734b('0x13')]),_0x1e6ed9);}};exports[_0x734b('0x1e')]=function(_0x67eed){try{if(!_[_0x734b('0x1f')](agents[_0x67eed[_0x734b('0x14')]])){utils[_0x734b('0x16')](util[_0x734b('0x2')](_0x734b('0x20'),_0x67eed['uniqueid']),_0x67eed);utils[_0x734b('0x1')](util[_0x734b('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x67eed[_0x734b('0x13')],agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x5')],_0x67eed[_0x734b('0x14')]));agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x1e')]=!![];agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x21')]=utils[_0x734b('0x19')]();agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x9')]=_0x734b('0x22');agents[_0x67eed[_0x734b('0x14')]]['reason']='timeout';agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x23')]=_0x67eed['ringtime']?parseInt(_0x67eed[_0x734b('0x24')])/0x3e8:0x0;agents[_0x67eed[_0x734b('0x14')]][_0x734b('0x25')]=0x0;unanswered[_0x734b('0x26')](_0x67eed[_0x734b('0x14')]);}}catch(_0x1b8295){utils[_0x734b('0x1d')](util['format'](_0x734b('0x20'),_0x67eed[_0x734b('0x13')]),_0x1b8295);}};exports[_0x734b('0x27')]=function(_0x241c89){try{_[_0x734b('0x28')](agents,function(_0x427c36,_0x1fed72){if(_0x427c36[_0x734b('0x13')]==_0x241c89[_0x734b('0x13')]&&!_[_0x734b('0x29')](unanswered,_0x427c36['destuniqueid'])){utils[_0x734b('0x16')](util[_0x734b('0x2')]('[%s][agents][queuecallerabandon]',_0x241c89[_0x734b('0x13')]),_0x241c89);utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x2a'),_0x241c89[_0x734b('0x13')],_0x427c36[_0x734b('0x5')],_0x427c36[_0x734b('0x14')]));_0x427c36[_0x734b('0x1e')]=!![];_0x427c36[_0x734b('0x21')]=utils[_0x734b('0x19')]();_0x427c36[_0x734b('0x9')]=_0x734b('0x2b');_0x427c36[_0x734b('0x2c')]=_0x734b('0x2b');_0x427c36[_0x734b('0x23')]=_0x241c89['holdtime'];_0x427c36[_0x734b('0x25')]=0x0;writeDB(_0x427c36);}});}catch(_0x5e2444){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x2d'),_0x241c89[_0x734b('0x13')]),_0x5e2444);}};exports[_0x734b('0x2e')]=function(_0x16ab66){try{if(agents[_0x16ab66['destuniqueid']]){utils['debug'](util[_0x734b('0x2')]('[%s][agents][agentconnect]',_0x16ab66[_0x734b('0x13')]),_0x16ab66);utils['info'](util[_0x734b('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x16ab66[_0x734b('0x13')],agents[_0x16ab66['destuniqueid']][_0x734b('0x5')],_0x16ab66[_0x734b('0x14')]));agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x2f')]=utils[_0x734b('0x19')]();agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x8')]=_0x16ab66['connectedlinenum'];agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x1b')]=_0x16ab66['connectedlinename'];agents[_0x16ab66[_0x734b('0x14')]][_0x734b('0x23')]=_0x16ab66[_0x734b('0x24')];agents[_0x16ab66[_0x734b('0x14')]]['lastevent']=_0x734b('0x30');_[_0x734b('0x28')](agents,function(_0x4efb1f,_0x40674c){if(_0x4efb1f[_0x734b('0x14')]!=_0x16ab66['destuniqueid']&&_0x4efb1f[_0x734b('0x13')]==_0x16ab66[_0x734b('0x13')]){_0x4efb1f[_0x734b('0x25')]=0x0;_0x4efb1f[_0x734b('0x23')]=_0x16ab66['ringtime'];_0x4efb1f['agentringnoanswer']=!![];_0x4efb1f[_0x734b('0x21')]=utils['now']();_0x4efb1f['lastevent']=_0x734b('0x31');_0x4efb1f['reason']=_0x734b('0x31');_0x4efb1f['answeredelsewheredestinationuniqueid']=_0x16ab66[_0x734b('0x14')];_0x4efb1f[_0x734b('0x32')]=_0x16ab66[_0x734b('0x5')];writeDB(_0x4efb1f);}});}}catch(_0x4c3fdc){utils['error'](util[_0x734b('0x2')]('[%s][agents][agentconnect]',_0x16ab66['uniqueid']),_0x4c3fdc);}};exports[_0x734b('0xc')]=function(_0x159db9){try{if(!_['isNil'](agents[_0x159db9[_0x734b('0x14')]])){utils['debug'](util[_0x734b('0x2')](_0x734b('0x33'),_0x159db9[_0x734b('0x13')]),_0x159db9);utils['info'](util[_0x734b('0x2')](_0x734b('0x34'),_0x159db9[_0x734b('0x13')],agents[_0x159db9[_0x734b('0x14')]]['membername'],_0x159db9['destuniqueid']));agents[_0x159db9['destuniqueid']][_0x734b('0xc')]=!![];agents[_0x159db9['destuniqueid']]['agentcompleteAt']=utils[_0x734b('0x19')]();agents[_0x159db9['destuniqueid']][_0x734b('0x25')]=utils[_0x734b('0x35')](agents[_0x159db9[_0x734b('0x14')]][_0x734b('0x36')],agents[_0x159db9['destuniqueid']][_0x734b('0x2f')]);agents[_0x159db9['destuniqueid']][_0x734b('0x2c')]=_0x159db9[_0x734b('0x2c')];agents[_0x159db9[_0x734b('0x14')]]['lastevent']=_0x734b('0x37');writeDB(agents[_0x159db9['destuniqueid']]);}}catch(_0x357ae4){utils[_0x734b('0x1d')](util['format'](_0x734b('0x33'),_0x159db9[_0x734b('0x13')]),_0x357ae4);}};exports[_0x734b('0x38')]=function(_0x38125a){try{if(!_[_0x734b('0x1f')](agents[_0x38125a['transfereruniqueid']])){utils[_0x734b('0x16')](util['format'](_0x734b('0x39'),_0x38125a['uniqueid']),_0x38125a);utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x3a'),_0x38125a[_0x734b('0x13')],agents[_0x38125a[_0x734b('0x3b')]]['membername'],agents[_0x38125a['transfereruniqueid']]['uniqueid']));agents[_0x38125a[_0x734b('0x3b')]][_0x734b('0x3c')]=!![];agents[_0x38125a['transfereruniqueid']][_0x734b('0x3d')]=_0x734b('0x3e');agents[_0x38125a['transfereruniqueid']][_0x734b('0x3f')]=_0x38125a[_0x734b('0x40')];agents[_0x38125a[_0x734b('0x3b')]]['transferuniqueid']=agents[_0x38125a[_0x734b('0x3b')]][_0x734b('0x13')];}}catch(_0x423b22){utils[_0x734b('0x1d')](util['format'](_0x734b('0x39'),_0x38125a[_0x734b('0x13')]),_0x423b22);}};exports[_0x734b('0x41')]=function(_0x432a96){try{utils['debug'](util[_0x734b('0x2')]('[%s][agents][attendedtransfer]',_0x432a96[_0x734b('0x42')]),_0x432a96);if(_0x432a96[_0x734b('0x42')]==_0x432a96[_0x734b('0x43')]){if(!_[_0x734b('0x1f')](agents[_0x432a96['secondtransfereruniqueid']])){utils[_0x734b('0x1')](util[_0x734b('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x432a96['origtransfereruniqueid'],agents[_0x432a96[_0x734b('0x44')]]['membername']));agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x3c')]=!![];agents[_0x432a96[_0x734b('0x44')]]['transfertype']=_0x734b('0x45');agents[_0x432a96['secondtransfereruniqueid']][_0x734b('0x3f')]=_0x432a96[_0x734b('0x46')];agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x47')]=_0x432a96['origtransfereruniqueid'];}if(_0x432a96[_0x734b('0x48')]&&agents[_0x432a96['transfereeuniqueid']]){agents[_0x432a96[_0x734b('0x48')]][_0x734b('0x49')]=0x1;transfers[_0x432a96[_0x734b('0x48')]]=_['clone'](agents[_0x432a96[_0x734b('0x48')]]);transfers[_0x432a96['transfereeuniqueid']][_0x734b('0x7')]=agents[_0x432a96[_0x734b('0x44')]][_0x734b('0x7')];transfers[_0x432a96[_0x734b('0x48')]]['calleridname']=agents[_0x432a96[_0x734b('0x44')]]['calleridname'];transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();transfers[_0x432a96['transfereeuniqueid']][_0x734b('0x2f')]=utils[_0x734b('0x19')]();transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x23')]=0x0;transfers[_0x432a96[_0x734b('0x48')]][_0x734b('0x49')]=0x2;}}else if(_0x432a96[_0x734b('0x44')]==_0x432a96['secondtransfererlinkedid']){if(!_[_0x734b('0x1f')](agents[_0x432a96[_0x734b('0x42')]])){utils[_0x734b('0x1')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x432a96[_0x734b('0x42')],agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x5')]));agents[_0x432a96[_0x734b('0x42')]]['transfer']=!![];agents[_0x432a96['origtransfereruniqueid']]['transfertype']=_0x734b('0x45');agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x3f')]=_0x432a96[_0x734b('0x4a')];agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x47')]=_0x432a96[_0x734b('0x44')];}if(_0x432a96[_0x734b('0x4b')]&&agents[_0x432a96[_0x734b('0x4b')]]){agents[_0x432a96[_0x734b('0x4b')]][_0x734b('0x49')]=0x1;transfers[_0x432a96[_0x734b('0x4b')]]=_[_0x734b('0x4c')](agents[_0x432a96[_0x734b('0x4b')]]);transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x7')]=agents[_0x432a96[_0x734b('0x42')]][_0x734b('0x7')];transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x4d')]=agents[_0x432a96[_0x734b('0x42')]]['calleridname'];transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x18')]=utils[_0x734b('0x19')]();transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x2f')]=utils['now']();transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x23')]=0x0;transfers[_0x432a96[_0x734b('0x4b')]][_0x734b('0x49')]=0x2;}}}catch(_0x3c7d93){utils[_0x734b('0x1d')](util['format']('[%s][agents][attendedtransfer]',_0x432a96['origtransfereruniqueid']),_0x3c7d93);}};exports['hangup']=function(_0x4d95c7){try{utils[_0x734b('0x16')](util[_0x734b('0x2')](_0x734b('0x4e'),_0x4d95c7[_0x734b('0x13')]),_0x4d95c7);if(agents[_0x4d95c7['uniqueid']]&&agents[_0x4d95c7['uniqueid']][_0x734b('0x2c')]===_0x734b('0x22')){if(_0x4d95c7[_0x734b('0x4f')]==='21'){agents[_0x4d95c7[_0x734b('0x13')]]['reason']=_0x734b('0x50');agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x50');}utils['info'](util[_0x734b('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d95c7[_0x734b('0x13')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x5')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')],agents[_0x4d95c7['uniqueid']][_0x734b('0x9')]));writeDB(agents[_0x4d95c7[_0x734b('0x13')]]);var _0x3c40b5=unanswered[_0x734b('0x51')](_0x4d95c7[_0x734b('0x13')]);if(_0x3c40b5>-0x1){unanswered['splice'](_0x3c40b5,0x1);}}if(transfers[_0x4d95c7[_0x734b('0x13')]]){transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0xc')]=!![];transfers[_0x4d95c7[_0x734b('0x13')]]['agentcompleteAt']=utils[_0x734b('0x19')]();transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x25')]=utils[_0x734b('0x35')](transfers[_0x4d95c7[_0x734b('0x13')]]['agentcompleteAt'],transfers[_0x4d95c7[_0x734b('0x13')]]['agentconnectAt']);transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')]=_0x734b('0x52');transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d95c7[_0x734b('0x13')],transfers[_0x4d95c7['uniqueid']][_0x734b('0x5')],transfers[_0x4d95c7[_0x734b('0x13')]]['reason'],transfers[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]));writeDB(transfers[_0x4d95c7[_0x734b('0x13')]],!![]);}if(agents[_0x4d95c7[_0x734b('0x13')]]&&agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2f')]){agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0xc')]=!![];agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x36')]=utils['now']();agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x25')]=utils[_0x734b('0x35')](agents[_0x4d95c7['uniqueid']][_0x734b('0x36')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2f')]);agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x2c')]=agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x3c')]?_0x734b('0x3c'):'agent';agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]=_0x734b('0x37');utils[_0x734b('0x1')](util[_0x734b('0x2')](_0x734b('0x53'),_0x4d95c7[_0x734b('0x13')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x5')],agents[_0x4d95c7['uniqueid']][_0x734b('0x2c')],agents[_0x4d95c7[_0x734b('0x13')]][_0x734b('0x9')]));writeDB(agents[_0x4d95c7['uniqueid']]);}}catch(_0x31e1ec){utils[_0x734b('0x1d')](util[_0x734b('0x2')](_0x734b('0x4e'),_0x4d95c7[_0x734b('0x13')]),_0x31e1ec);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 10a1c02..7bd5bc4 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 _0xae75=['accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','systemanswertime','linkedid','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','error','hangup','debug','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','noop','execif','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','queue','interface','calleridnum','connectedlinenum','lastevent'];(function(_0x2c589e,_0xdb4532){var _0xa06216=function(_0x221e7){while(--_0x221e7){_0x2c589e['push'](_0x2c589e['shift']());}};_0xa06216(++_0xdb4532);}(_0xae75,0xce));var _0x5ae7=function(_0x3df839,_0x1b5e39){_0x3df839=_0x3df839-0x0;var _0x34820f=_0xae75[_0x3df839];return _0x34820f;};'use strict';var _=require(_0x5ae7('0x0'));var util=require(_0x5ae7('0x1'));var utils=require('./utils');var transfers=require(_0x5ae7('0x2'));var dispositions=[_0x5ae7('0x3'),_0x5ae7('0x4'),_0x5ae7('0x4'),_0x5ae7('0x3'),_0x5ae7('0x3'),_0x5ae7('0x3'),_0x5ae7('0x5'),_0x5ae7('0x6'),_0x5ae7('0x4'),_0x5ae7('0x4'),_0x5ae7('0x4')];var channels={};function writeDB(_0x25faef){var _0x10276c;if(transfers[_0x5ae7('0x7')][_0x25faef[_0x5ae7('0x8')]]){_0x10276c=_0x25faef['uniqueid'];_0x25faef[_0x5ae7('0x8')]=transfers[_0x5ae7('0x7')][_0x25faef['uniqueid']]['transfereeuniqueid'];}utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x25faef[_0x5ae7('0x8')],_0x25faef['channel'],_0x25faef[_0x5ae7('0xb')],_0x25faef['membername'],_0x25faef[_0x5ae7('0xc')],_0x25faef[_0x5ae7('0xd')],_0x25faef[_0x5ae7('0xe')],_0x25faef[_0x5ae7('0xf')]));if(_0x25faef[_0x5ae7('0x10')]){utils[_0x5ae7('0x11')](_0x25faef['accountcode'])[_0x5ae7('0x12')](function(_0xc761fd){if(_0xc761fd){_0x25faef['UserId']=_0xc761fd['id'];}utils[_0x5ae7('0x13')](_0x5ae7('0x14'),_0x25faef);});}else{utils[_0x5ae7('0x13')](_0x5ae7('0x14'),_0x25faef);}if(channels[_0x25faef[_0x5ae7('0x8')]]){delete channels[_0x25faef[_0x5ae7('0x8')]];}else if(_0x10276c&&channels[_0x10276c]){if(!transfers[_0x5ae7('0x7')][_0x10276c][_0x5ae7('0x15')])delete transfers['blinds'][_0x10276c];delete channels[_0x10276c];}}exports[_0x5ae7('0x16')]=function(_0x597e45){try{utils['debug'](util['format'](_0x5ae7('0x17'),_0x597e45['uniqueid']),_0x597e45);if(_0x597e45['uniqueid']==_0x597e45['linkedid']&&_0x597e45['channel']!=_0x5ae7('0x18')){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x19'),_0x597e45['uniqueid'],_0x597e45[_0x5ae7('0x1a')],_0x597e45[_0x5ae7('0x1b')]));channels[_0x597e45[_0x5ae7('0x8')]]={'uniqueid':_0x597e45[_0x5ae7('0x8')],'accountcode':_0x597e45[_0x5ae7('0x10')],'source':_0x597e45[_0x5ae7('0xd')],'destination':_0x597e45[_0x5ae7('0x1b')],'destinationcontext':_0x597e45[_0x5ae7('0x1a')],'channel':_0x597e45[_0x5ae7('0x1c')],'starttime':utils[_0x5ae7('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5ae7('0x3'),'amaflags':_0x5ae7('0x1e')};}}catch(_0x358ec1){utils['error'](util[_0x5ae7('0xa')](_0x5ae7('0x17'),_0x597e45[_0x5ae7('0x8')]),_0x358ec1);}};exports[_0x5ae7('0x1f')]=function(_0x2b0649){try{utils['debug'](util[_0x5ae7('0xa')](_0x5ae7('0x20'),_0x2b0649[_0x5ae7('0x8')]),_0x2b0649);if(!_[_0x5ae7('0x21')](channels[_0x2b0649[_0x5ae7('0x8')]])&&_0x2b0649['channelstate']==0x6){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x2b0649[_0x5ae7('0x8')],_0x2b0649[_0x5ae7('0x1a')],_0x2b0649[_0x5ae7('0x1c')]));if(_[_0x5ae7('0x21')](channels[_0x2b0649[_0x5ae7('0x8')]][_0x5ae7('0x22')])){channels[_0x2b0649[_0x5ae7('0x8')]][_0x5ae7('0x22')]=utils[_0x5ae7('0x1d')]();}}else if(!_['isNil'](channels[_0x2b0649[_0x5ae7('0x23')]])&&_0x2b0649[_0x5ae7('0x24')]==0x6&&_0x2b0649[_0x5ae7('0x1a')]!=_0x5ae7('0x25')){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x26'),_0x2b0649['uniqueid'],_0x2b0649['linkedid'],_0x2b0649['context'],_0x2b0649[_0x5ae7('0x1c')]));channels[_0x2b0649[_0x5ae7('0x23')]][_0x5ae7('0x10')]=_0x2b0649['accountcode'];channels[_0x2b0649[_0x5ae7('0x23')]]['destinationchannel']=_0x2b0649[_0x5ae7('0x1c')];if(_[_0x5ae7('0x21')](channels[_0x2b0649[_0x5ae7('0x23')]][_0x5ae7('0x27')])){channels[_0x2b0649[_0x5ae7('0x23')]][_0x5ae7('0x27')]=utils[_0x5ae7('0x1d')]();}channels[_0x2b0649['linkedid']][_0x5ae7('0x28')]=dispositions[_['toNumber'](_0x2b0649['channelstate'])]||'ANSWERED';}}catch(_0x974e24){utils[_0x5ae7('0x29')](util[_0x5ae7('0xa')](_0x5ae7('0x20'),_0x2b0649['uniqueid']),_0x974e24);}};exports[_0x5ae7('0x2a')]=function(_0x2e1672){try{if(!_[_0x5ae7('0x21')](channels[_0x2e1672[_0x5ae7('0x8')]])){utils[_0x5ae7('0x2b')](util[_0x5ae7('0xa')](_0x5ae7('0x2c'),_0x2e1672[_0x5ae7('0x8')]),_0x2e1672);if(_[_0x5ae7('0x21')](channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x2d')])){channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x2d')]=_0x2e1672[_0x5ae7('0x2e')]+'\x20<'+_0x2e1672['calleridnum']+'>';}utils[_0x5ae7('0x9')](util['format'](_0x5ae7('0x2f'),_0x2e1672['uniqueid'],channels[_0x2e1672['uniqueid']][_0x5ae7('0x2d')],_0x2e1672[_0x5ae7('0x30')]));channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x31')]=utils[_0x5ae7('0x1d')]();channels[_0x2e1672['uniqueid']][_0x5ae7('0x32')]=utils[_0x5ae7('0x33')](channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x31')],channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x34')]);channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x35')]=channels[_0x2e1672['uniqueid']][_0x5ae7('0x27')]?utils[_0x5ae7('0x33')](channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x31')],channels[_0x2e1672[_0x5ae7('0x8')]][_0x5ae7('0x27')]):0x0;writeDB(channels[_0x2e1672[_0x5ae7('0x8')]]);}}catch(_0x5cbb5e){utils[_0x5ae7('0x29')](util['format'](_0x5ae7('0x2c'),_0x2e1672[_0x5ae7('0x8')]),_0x5cbb5e);}};exports[_0x5ae7('0x36')]=function(_0x2df363){try{if(!_[_0x5ae7('0x21')](channels[_0x2df363[_0x5ae7('0x37')]])){utils[_0x5ae7('0x2b')](util[_0x5ae7('0xa')](_0x5ae7('0x38'),_0x2df363[_0x5ae7('0x39')]),_0x2df363);if(channels[_0x2df363[_0x5ae7('0x37')]][_0x5ae7('0x1c')]==_0x2df363[_0x5ae7('0x3a')]){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x3b'),_0x2df363[_0x5ae7('0x39')],_0x2df363[_0x5ae7('0x37')],_0x2df363['secondtransfererchannel']));channels[_0x2df363['localtwolinkedid']][_0x5ae7('0x3c')]=_0x2df363[_0x5ae7('0x3d')];channels[_0x2df363['localtwolinkedid']]['userfield']=_0x5ae7('0x3e');}else if(channels[_0x2df363[_0x5ae7('0x37')]]['channel']=_0x2df363[_0x5ae7('0x3f')]){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x3b'),_0x2df363['origtransfereruniqueid'],_0x2df363['localtwolinkedid'],_0x2df363['origtransfererchannel']));channels[_0x2df363[_0x5ae7('0x37')]][_0x5ae7('0x3c')]=_0x2df363[_0x5ae7('0x40')];channels[_0x2df363[_0x5ae7('0x37')]]['userfield']=_0x5ae7('0x3e');}}}catch(_0x3e0354){utils[_0x5ae7('0x29')](util[_0x5ae7('0xa')](_0x5ae7('0x38'),_0x2df363[_0x5ae7('0x39')]),_0x3e0354);}};exports[_0x5ae7('0x41')]=function(_0x11ac2d){try{if(!_[_0x5ae7('0x21')](channels[_0x11ac2d[_0x5ae7('0x8')]])){utils['debug'](util[_0x5ae7('0xa')](_0x5ae7('0x42'),_0x11ac2d[_0x5ae7('0x8')]),_0x11ac2d);channels[_0x11ac2d[_0x5ae7('0x8')]][_0x5ae7('0x43')]=utils[_0x5ae7('0x1d')]();utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x11ac2d[_0x5ae7('0x8')],channels[_0x11ac2d[_0x5ae7('0x8')]][_0x5ae7('0x43')]));}}catch(_0x37c367){utils['error'](util[_0x5ae7('0xa')](_0x5ae7('0x42'),_0x11ac2d['uniqueid']),_0x37c367);}};exports[_0x5ae7('0x44')]=function(_0x3e8e7f){try{if(!_[_0x5ae7('0x21')](channels[_0x3e8e7f['uniqueid']])){utils[_0x5ae7('0x2b')](util[_0x5ae7('0xa')](_0x5ae7('0x45'),_0x3e8e7f[_0x5ae7('0x8')]),_0x3e8e7f);if(!_[_0x5ae7('0x21')](channels[_0x3e8e7f['uniqueid']][_0x5ae7('0x43')])){channels[_0x3e8e7f[_0x5ae7('0x8')]][_0x5ae7('0x46')]+=utils[_0x5ae7('0x33')](utils[_0x5ae7('0x1d')](),channels[_0x3e8e7f[_0x5ae7('0x8')]]['musiconholdstartAt']);utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x47'),_0x3e8e7f[_0x5ae7('0x8')],channels[_0x3e8e7f[_0x5ae7('0x8')]]['mohtime']));delete channels[_0x3e8e7f[_0x5ae7('0x8')]][_0x5ae7('0x43')];}}}catch(_0x14906){utils[_0x5ae7('0x29')](util[_0x5ae7('0xa')](_0x5ae7('0x45'),_0x3e8e7f[_0x5ae7('0x8')]),_0x14906);}};exports['varset']=function(_0x2871d9){try{if(!_[_0x5ae7('0x21')](channels[_0x2871d9[_0x5ae7('0x8')]])){utils[_0x5ae7('0x2b')](util[_0x5ae7('0xa')](_0x5ae7('0x48'),_0x2871d9['uniqueid']),_0x2871d9);if(!_[_0x5ae7('0x21')](_0x2871d9['variable'][_0x5ae7('0x49')])){utils[_0x5ae7('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2871d9['uniqueid'],_0x2871d9[_0x5ae7('0x4a')]));channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x4b')]=_0x2871d9[_0x5ae7('0x4a')];}if(!_['isNil'](_0x2871d9['variable']['xmd-phone'])){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x4c'),_0x2871d9['uniqueid'],_0x2871d9[_0x5ae7('0x4a')]));channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x4d')]=_0x2871d9['value'];channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x2d')]='\x22'+_0x2871d9[_0x5ae7('0x4a')]+_0x5ae7('0x4e')+_0x2871d9[_0x5ae7('0x4a')]+'>';}if(!_['isNil'](_0x2871d9[_0x5ae7('0x4f')]['xmd-callerid-preview'])||!_[_0x5ae7('0x21')](_0x2871d9[_0x5ae7('0x4f')]['xmd-callerid'])){utils['info'](util[_0x5ae7('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2871d9[_0x5ae7('0x8')],!_[_0x5ae7('0x21')](_0x2871d9['variable'][_0x5ae7('0x50')])?_0x5ae7('0x50'):_0x5ae7('0x51'),_0x2871d9['value']));channels[_0x2871d9['uniqueid']][_0x5ae7('0x2d')]=_0x2871d9['value'];}if(!_['isNil'](_0x2871d9[_0x5ae7('0x4f')]['xmd-queue'])||!_['isNil'](_0x2871d9['variable']['xmcs-queue'])){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x52'),_0x2871d9[_0x5ae7('0x8')],!_[_0x5ae7('0x21')](_0x2871d9['variable']['xmd-queue'])?_0x5ae7('0x53'):_0x5ae7('0x54'),_0x2871d9[_0x5ae7('0x4a')]));channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x55')]=_0x5ae7('0x56');channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x57')]=_0x2871d9['value'];channels[_0x2871d9['uniqueid']][_0x5ae7('0xb')]=!![];}if(!_[_0x5ae7('0x21')](_0x2871d9['variable'][_0x5ae7('0x58')])){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x59'),_0x2871d9['uniqueid'],_0x2871d9['value']));channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x5a')]=_0x2871d9[_0x5ae7('0x4a')];}if(!_[_0x5ae7('0x21')](_0x2871d9[_0x5ae7('0x4f')]['xmd-cdrtype'])){utils[_0x5ae7('0x9')](util['format'](_0x5ae7('0x5b'),_0x2871d9['uniqueid'],_0x2871d9['value']));channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x5c')]=_0x2871d9['value'];}if(!_[_0x5ae7('0x21')](_0x2871d9[_0x5ae7('0x4f')][_0x5ae7('0x5d')])){utils[_0x5ae7('0x9')](util['format'](_0x5ae7('0x5e'),_0x2871d9[_0x5ae7('0x8')],_0x2871d9[_0x5ae7('0x4a')]));channels[_0x2871d9[_0x5ae7('0x8')]][_0x5ae7('0x5f')]=_0x2871d9[_0x5ae7('0x4a')];}if(!_[_0x5ae7('0x21')](_0x2871d9[_0x5ae7('0x4f')][_0x5ae7('0x60')])){utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x61'),_0x2871d9[_0x5ae7('0x8')],_0x2871d9[_0x5ae7('0x4a')]));channels[_0x2871d9[_0x5ae7('0x8')]]['sipcallid']=_0x2871d9['value'];}}}catch(_0x53e2dd){utils[_0x5ae7('0x29')](util[_0x5ae7('0xa')](_0x5ae7('0x48'),_0x2871d9[_0x5ae7('0x8')]),_0x53e2dd);}};exports[_0x5ae7('0x62')]=function(_0x373878){try{if(!_[_0x5ae7('0x21')](channels[_0x373878[_0x5ae7('0x8')]])){utils['debug'](util[_0x5ae7('0xa')](_0x5ae7('0x63'),_0x373878[_0x5ae7('0x8')]),_0x373878);utils[_0x5ae7('0x9')](util[_0x5ae7('0xa')](_0x5ae7('0x64'),_0x373878[_0x5ae7('0x8')],_0x373878[_0x5ae7('0x65')],_0x373878[_0x5ae7('0x66')]));if(_0x373878['application'][_0x5ae7('0x67')]()==_0x5ae7('0x68')&&_[_0x5ae7('0x69')](_0x373878['appdata'][_0x5ae7('0x67')](),_0x5ae7('0x6a'))){var _0x180652=_0x373878[_0x5ae7('0x66')][_0x5ae7('0x6b')]('=');var _0x260d75=_0x180652[0x0]['substring'](_0x180652[0x0]['lastIndexOf']('(')+0x1,_0x180652[0x0]['lastIndexOf'](')'));var _0x415a7b=_0x180652[0x1];channels[_0x373878[_0x5ae7('0x8')]][_0x260d75]=_0x415a7b;}if(!_['includes'](['hangup',_0x5ae7('0x6c'),_0x5ae7('0x6d'),'set',_0x5ae7('0x6e')],_0x373878[_0x5ae7('0x65')][_0x5ae7('0x67')]())){channels[_0x373878[_0x5ae7('0x8')]]['lastapplication']=_0x373878[_0x5ae7('0x65')];channels[_0x373878[_0x5ae7('0x8')]][_0x5ae7('0x57')]=_0x373878['appdata'];}}}catch(_0x5dd18a){utils[_0x5ae7('0x29')](util[_0x5ae7('0xa')]('[%s][calls][newexten]',_0x373878['uniqueid']),_0x5dd18a);}}; \ No newline at end of file +var _0xf69c=['appdata','split','substring','lastIndexOf','includes','hangup','execif','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','recording','newchannel','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','exten','context','now','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','ANSWERED','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','localtwolinkedid','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0xf69c,0x151));var _0xcf69=function(_0x2f1ac4,_0x236a72){_0x2f1ac4=_0x2f1ac4-0x0;var _0x18e1a5=_0xf69c[_0x2f1ac4];return _0x18e1a5;};'use strict';var _=require(_0xcf69('0x0'));var util=require('util');var utils=require(_0xcf69('0x1'));var transfers=require(_0xcf69('0x2'));var dispositions=['NO\x20ANSWER',_0xcf69('0x3'),'FAILED',_0xcf69('0x4'),'NO\x20ANSWER',_0xcf69('0x4'),'ANSWERED',_0xcf69('0x5'),_0xcf69('0x3'),_0xcf69('0x3'),_0xcf69('0x3')];var channels={};function writeDB(_0x3b7608){var _0x5f1e98;if(transfers[_0xcf69('0x6')][_0x3b7608[_0xcf69('0x7')]]){_0x5f1e98=_0x3b7608[_0xcf69('0x7')];_0x3b7608[_0xcf69('0x7')]=transfers['blinds'][_0x3b7608[_0xcf69('0x7')]][_0xcf69('0x8')];}utils[_0xcf69('0x9')](util[_0xcf69('0xa')](_0xcf69('0xb'),_0x3b7608[_0xcf69('0x7')],_0x3b7608['channel'],_0x3b7608[_0xcf69('0xc')],_0x3b7608['membername'],_0x3b7608[_0xcf69('0xd')],_0x3b7608[_0xcf69('0xe')],_0x3b7608[_0xcf69('0xf')],_0x3b7608[_0xcf69('0x10')]));if(_0x3b7608[_0xcf69('0x11')]){utils[_0xcf69('0x12')](_0x3b7608[_0xcf69('0x11')])[_0xcf69('0x13')](function(_0x537a1c){if(_0x537a1c){_0x3b7608['UserId']=_0x537a1c['id'];}utils['request']('CreateVoiceCallReport',_0x3b7608);});}else{utils[_0xcf69('0x14')]('CreateVoiceCallReport',_0x3b7608);}if(channels[_0x3b7608[_0xcf69('0x7')]]){delete channels[_0x3b7608[_0xcf69('0x7')]];}else if(_0x5f1e98&&channels[_0x5f1e98]){if(!transfers[_0xcf69('0x6')][_0x5f1e98][_0xcf69('0x15')])delete transfers['blinds'][_0x5f1e98];delete channels[_0x5f1e98];}}exports[_0xcf69('0x16')]=function(_0x17787b){try{utils['debug'](util['format'](_0xcf69('0x17'),_0x17787b[_0xcf69('0x7')]),_0x17787b);if(_0x17787b[_0xcf69('0x7')]==_0x17787b[_0xcf69('0x18')]&&_0x17787b[_0xcf69('0x19')]!=_0xcf69('0x1a')){utils[_0xcf69('0x9')](util[_0xcf69('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x17787b[_0xcf69('0x7')],_0x17787b['context'],_0x17787b[_0xcf69('0x1b')]));channels[_0x17787b[_0xcf69('0x7')]]={'uniqueid':_0x17787b[_0xcf69('0x7')],'accountcode':_0x17787b[_0xcf69('0x11')],'source':_0x17787b[_0xcf69('0xe')],'destination':_0x17787b[_0xcf69('0x1b')],'destinationcontext':_0x17787b[_0xcf69('0x1c')],'channel':_0x17787b[_0xcf69('0x19')],'starttime':utils[_0xcf69('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xcf69('0x4'),'amaflags':_0xcf69('0x1e')};}}catch(_0x7d86bc){utils[_0xcf69('0x1f')](util[_0xcf69('0xa')](_0xcf69('0x17'),_0x17787b['uniqueid']),_0x7d86bc);}};exports[_0xcf69('0x20')]=function(_0x1abce9){try{utils[_0xcf69('0x21')](util[_0xcf69('0xa')](_0xcf69('0x22'),_0x1abce9[_0xcf69('0x7')]),_0x1abce9);if(!_['isNil'](channels[_0x1abce9['uniqueid']])&&_0x1abce9[_0xcf69('0x23')]==0x6){utils['info'](util[_0xcf69('0xa')](_0xcf69('0x24'),_0x1abce9[_0xcf69('0x7')],_0x1abce9[_0xcf69('0x1c')],_0x1abce9[_0xcf69('0x19')]));if(_[_0xcf69('0x25')](channels[_0x1abce9[_0xcf69('0x7')]][_0xcf69('0x26')])){channels[_0x1abce9['uniqueid']]['systemanswertime']=utils[_0xcf69('0x1d')]();}}else if(!_[_0xcf69('0x25')](channels[_0x1abce9[_0xcf69('0x18')]])&&_0x1abce9[_0xcf69('0x23')]==0x6&&_0x1abce9['context']!=_0xcf69('0x27')){utils[_0xcf69('0x9')](util[_0xcf69('0xa')](_0xcf69('0x28'),_0x1abce9[_0xcf69('0x7')],_0x1abce9[_0xcf69('0x18')],_0x1abce9[_0xcf69('0x1c')],_0x1abce9[_0xcf69('0x19')]));channels[_0x1abce9[_0xcf69('0x18')]][_0xcf69('0x11')]=_0x1abce9['accountcode'];channels[_0x1abce9[_0xcf69('0x18')]]['destinationchannel']=_0x1abce9[_0xcf69('0x19')];if(_[_0xcf69('0x25')](channels[_0x1abce9[_0xcf69('0x18')]][_0xcf69('0x29')])){channels[_0x1abce9[_0xcf69('0x18')]][_0xcf69('0x29')]=utils[_0xcf69('0x1d')]();}channels[_0x1abce9[_0xcf69('0x18')]][_0xcf69('0x2a')]=dispositions[_[_0xcf69('0x2b')](_0x1abce9['channelstate'])]||_0xcf69('0x2c');}}catch(_0x10da39){utils['error'](util[_0xcf69('0xa')]('[%s][calls][newstate]',_0x1abce9[_0xcf69('0x7')]),_0x10da39);}};exports['hangup']=function(_0x5211a0){try{if(!_[_0xcf69('0x25')](channels[_0x5211a0[_0xcf69('0x7')]])){utils[_0xcf69('0x21')](util[_0xcf69('0xa')](_0xcf69('0x2d'),_0x5211a0[_0xcf69('0x7')]),_0x5211a0);if(_['isNil'](channels[_0x5211a0['uniqueid']][_0xcf69('0x2e')])){channels[_0x5211a0[_0xcf69('0x7')]][_0xcf69('0x2e')]=_0x5211a0[_0xcf69('0x2f')]+'\x20<'+_0x5211a0[_0xcf69('0xe')]+'>';}utils[_0xcf69('0x9')](util[_0xcf69('0xa')](_0xcf69('0x30'),_0x5211a0[_0xcf69('0x7')],channels[_0x5211a0[_0xcf69('0x7')]][_0xcf69('0x2e')],_0x5211a0[_0xcf69('0x31')]));channels[_0x5211a0[_0xcf69('0x7')]][_0xcf69('0x32')]=utils[_0xcf69('0x1d')]();channels[_0x5211a0[_0xcf69('0x7')]][_0xcf69('0x33')]=utils[_0xcf69('0x34')](channels[_0x5211a0[_0xcf69('0x7')]][_0xcf69('0x32')],channels[_0x5211a0[_0xcf69('0x7')]]['starttime']);channels[_0x5211a0['uniqueid']][_0xcf69('0x35')]=channels[_0x5211a0[_0xcf69('0x7')]][_0xcf69('0x29')]?utils[_0xcf69('0x34')](channels[_0x5211a0['uniqueid']][_0xcf69('0x32')],channels[_0x5211a0[_0xcf69('0x7')]][_0xcf69('0x29')]):0x0;writeDB(channels[_0x5211a0[_0xcf69('0x7')]]);}}catch(_0x161f11){utils['error'](util[_0xcf69('0xa')](_0xcf69('0x2d'),_0x5211a0['uniqueid']),_0x161f11);}};exports[_0xcf69('0x36')]=function(_0x326c2f){try{if(!_[_0xcf69('0x25')](channels[_0x326c2f['localtwolinkedid']])){utils[_0xcf69('0x21')](util['format'](_0xcf69('0x37'),_0x326c2f[_0xcf69('0x38')]),_0x326c2f);if(channels[_0x326c2f['localtwolinkedid']]['channel']==_0x326c2f[_0xcf69('0x39')]){utils[_0xcf69('0x9')](util[_0xcf69('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x326c2f['origtransfereruniqueid'],_0x326c2f[_0xcf69('0x3a')],_0x326c2f[_0xcf69('0x3b')]));channels[_0x326c2f['localtwolinkedid']][_0xcf69('0x3c')]=_0x326c2f[_0xcf69('0x3b')];channels[_0x326c2f[_0xcf69('0x3a')]][_0xcf69('0x3d')]=_0xcf69('0x3e');}else if(channels[_0x326c2f[_0xcf69('0x3a')]]['channel']=_0x326c2f[_0xcf69('0x3f')]){utils[_0xcf69('0x9')](util[_0xcf69('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x326c2f[_0xcf69('0x38')],_0x326c2f['localtwolinkedid'],_0x326c2f[_0xcf69('0x40')]));channels[_0x326c2f[_0xcf69('0x3a')]][_0xcf69('0x3c')]=_0x326c2f[_0xcf69('0x40')];channels[_0x326c2f[_0xcf69('0x3a')]]['userfield']='_attended';}}}catch(_0xca4bc0){utils[_0xcf69('0x1f')](util[_0xcf69('0xa')]('[%s][calls][attendedtransfer]',_0x326c2f['origtransfereruniqueid']),_0xca4bc0);}};exports['musiconholdstart']=function(_0x2f2b20){try{if(!_[_0xcf69('0x25')](channels[_0x2f2b20[_0xcf69('0x7')]])){utils['debug'](util[_0xcf69('0xa')]('[%s][calls][musiconholdstart]',_0x2f2b20[_0xcf69('0x7')]),_0x2f2b20);channels[_0x2f2b20['uniqueid']][_0xcf69('0x41')]=utils[_0xcf69('0x1d')]();utils[_0xcf69('0x9')](util[_0xcf69('0xa')](_0xcf69('0x42'),_0x2f2b20[_0xcf69('0x7')],channels[_0x2f2b20[_0xcf69('0x7')]][_0xcf69('0x41')]));}}catch(_0x34eb1a){utils[_0xcf69('0x1f')](util[_0xcf69('0xa')]('[%s][calls][musiconholdstart]',_0x2f2b20[_0xcf69('0x7')]),_0x34eb1a);}};exports[_0xcf69('0x43')]=function(_0x337c4a){try{if(!_['isNil'](channels[_0x337c4a[_0xcf69('0x7')]])){utils['debug'](util[_0xcf69('0xa')](_0xcf69('0x44'),_0x337c4a[_0xcf69('0x7')]),_0x337c4a);if(!_[_0xcf69('0x25')](channels[_0x337c4a[_0xcf69('0x7')]][_0xcf69('0x41')])){channels[_0x337c4a[_0xcf69('0x7')]][_0xcf69('0x45')]+=utils[_0xcf69('0x34')](utils[_0xcf69('0x1d')](),channels[_0x337c4a[_0xcf69('0x7')]][_0xcf69('0x41')]);utils[_0xcf69('0x9')](util['format'](_0xcf69('0x46'),_0x337c4a[_0xcf69('0x7')],channels[_0x337c4a[_0xcf69('0x7')]]['mohtime']));delete channels[_0x337c4a['uniqueid']][_0xcf69('0x41')];}}}catch(_0x5d0df7){utils[_0xcf69('0x1f')](util[_0xcf69('0xa')]('[%s][calls][musiconholdstop]',_0x337c4a[_0xcf69('0x7')]),_0x5d0df7);}};exports['varset']=function(_0x4eb387){try{if(!_[_0xcf69('0x25')](channels[_0x4eb387[_0xcf69('0x7')]])){utils[_0xcf69('0x21')](util[_0xcf69('0xa')]('[%s][calls][varset]',_0x4eb387[_0xcf69('0x7')]),_0x4eb387);if(!_[_0xcf69('0x25')](_0x4eb387[_0xcf69('0x47')]['xmd-originatecalleridnum'])){utils['info'](util[_0xcf69('0xa')](_0xcf69('0x48'),_0x4eb387[_0xcf69('0x7')],_0x4eb387['value']));channels[_0x4eb387['uniqueid']]['source']=_0x4eb387['value'];}if(!_['isNil'](_0x4eb387['variable'][_0xcf69('0x49')])){utils[_0xcf69('0x9')](util['format'](_0xcf69('0x4a'),_0x4eb387[_0xcf69('0x7')],_0x4eb387[_0xcf69('0x4b')]));channels[_0x4eb387[_0xcf69('0x7')]][_0xcf69('0x4c')]=_0x4eb387[_0xcf69('0x4b')];channels[_0x4eb387['uniqueid']]['callerid']='\x22'+_0x4eb387[_0xcf69('0x4b')]+_0xcf69('0x4d')+_0x4eb387[_0xcf69('0x4b')]+'>';}if(!_[_0xcf69('0x25')](_0x4eb387['variable']['xmd-callerid-preview'])||!_['isNil'](_0x4eb387['variable'][_0xcf69('0x4e')])){utils[_0xcf69('0x9')](util[_0xcf69('0xa')](_0xcf69('0x4f'),_0x4eb387[_0xcf69('0x7')],!_[_0xcf69('0x25')](_0x4eb387['variable'][_0xcf69('0x50')])?_0xcf69('0x50'):_0xcf69('0x4e'),_0x4eb387[_0xcf69('0x4b')]));channels[_0x4eb387[_0xcf69('0x7')]][_0xcf69('0x2e')]=_0x4eb387[_0xcf69('0x4b')];}if(!_[_0xcf69('0x25')](_0x4eb387[_0xcf69('0x47')][_0xcf69('0x51')])||!_[_0xcf69('0x25')](_0x4eb387['variable'][_0xcf69('0x52')])){utils[_0xcf69('0x9')](util[_0xcf69('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4eb387[_0xcf69('0x7')],!_['isNil'](_0x4eb387[_0xcf69('0x47')]['xmd-queue'])?'xmd-queue':_0xcf69('0x52'),_0x4eb387[_0xcf69('0x4b')]));channels[_0x4eb387[_0xcf69('0x7')]][_0xcf69('0x53')]=_0xcf69('0x54');channels[_0x4eb387['uniqueid']][_0xcf69('0x55')]=_0x4eb387[_0xcf69('0x4b')];channels[_0x4eb387[_0xcf69('0x7')]]['queue']=!![];}if(!_['isNil'](_0x4eb387['variable'][_0xcf69('0x56')])){utils[_0xcf69('0x9')](util['format'](_0xcf69('0x57'),_0x4eb387['uniqueid'],_0x4eb387[_0xcf69('0x4b')]));channels[_0x4eb387[_0xcf69('0x7')]][_0xcf69('0x58')]=_0x4eb387[_0xcf69('0x4b')];}if(!_[_0xcf69('0x25')](_0x4eb387['variable']['xmd-cdrtype'])){utils[_0xcf69('0x9')](util['format'](_0xcf69('0x59'),_0x4eb387['uniqueid'],_0x4eb387['value']));channels[_0x4eb387['uniqueid']][_0xcf69('0x5a')]=_0x4eb387[_0xcf69('0x4b')];}if(!_[_0xcf69('0x25')](_0x4eb387[_0xcf69('0x47')][_0xcf69('0x5b')])){utils[_0xcf69('0x9')](util['format'](_0xcf69('0x5c'),_0x4eb387['uniqueid'],_0x4eb387[_0xcf69('0x4b')]));channels[_0x4eb387[_0xcf69('0x7')]]['routeid']=_0x4eb387[_0xcf69('0x4b')];}if(!_[_0xcf69('0x25')](_0x4eb387[_0xcf69('0x47')]['sipcallid'])){utils['info'](util[_0xcf69('0xa')](_0xcf69('0x5d'),_0x4eb387['uniqueid'],_0x4eb387[_0xcf69('0x4b')]));channels[_0x4eb387[_0xcf69('0x7')]][_0xcf69('0x5e')]=_0x4eb387['value'];}}}catch(_0x48774f){utils[_0xcf69('0x1f')](util['format'](_0xcf69('0x5f'),_0x4eb387[_0xcf69('0x7')]),_0x48774f);}};exports['newexten']=function(_0x8bdaa5){try{if(!_[_0xcf69('0x25')](channels[_0x8bdaa5['uniqueid']])){utils[_0xcf69('0x21')](util['format'](_0xcf69('0x60'),_0x8bdaa5[_0xcf69('0x7')]),_0x8bdaa5);utils[_0xcf69('0x9')](util[_0xcf69('0xa')](_0xcf69('0x61'),_0x8bdaa5[_0xcf69('0x7')],_0x8bdaa5[_0xcf69('0x62')],_0x8bdaa5['appdata']));if(_0x8bdaa5[_0xcf69('0x62')][_0xcf69('0x63')]()==_0xcf69('0x64')&&_[_0xcf69('0x65')](_0x8bdaa5['appdata']['toLowerCase'](),_0xcf69('0x66'))){var _0xdee466=_0x8bdaa5[_0xcf69('0x67')][_0xcf69('0x68')]('=');var _0x445674=_0xdee466[0x0][_0xcf69('0x69')](_0xdee466[0x0]['lastIndexOf']('(')+0x1,_0xdee466[0x0][_0xcf69('0x6a')](')'));var _0x21040b=_0xdee466[0x1];channels[_0x8bdaa5[_0xcf69('0x7')]][_0x445674]=_0x21040b;}if(!_[_0xcf69('0x6b')]([_0xcf69('0x6c'),'noop',_0xcf69('0x6d'),'set','gotoif'],_0x8bdaa5[_0xcf69('0x62')][_0xcf69('0x63')]())){channels[_0x8bdaa5['uniqueid']]['lastapplication']=_0x8bdaa5['application'];channels[_0x8bdaa5[_0xcf69('0x7')]][_0xcf69('0x55')]=_0x8bdaa5[_0xcf69('0x67')];}}}catch(_0x687234){utils[_0xcf69('0x1f')](util[_0xcf69('0xa')]('[%s][calls][newexten]',_0x8bdaa5[_0xcf69('0x7')]),_0x687234);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e8b3fcb..170b327 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 _0xc3e6=['[core]\x20close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','[core]\x20error','close'];(function(_0x147dcc,_0x425af5){var _0x27d467=function(_0x17a4a2){while(--_0x17a4a2){_0x147dcc['push'](_0x147dcc['shift']());}};_0x27d467(++_0x425af5);}(_0xc3e6,0x17c));var _0x6c3e=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0xc3e6[_0x2351c4];return _0x1dd3f8;};'use strict';var utils=require(_0x6c3e('0x0'));exports[_0x6c3e('0x1')]=function(){utils[_0x6c3e('0x2')]('[core]\x20connected');};exports[_0x6c3e('0x3')]=function(){utils[_0x6c3e('0x2')](_0x6c3e('0x4'));};exports['fullybooted']=function(){utils[_0x6c3e('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0x1872d6){utils['error'](_0x6c3e('0x5'),_0x1872d6);};exports[_0x6c3e('0x6')]=function(){utils[_0x6c3e('0x2')](_0x6c3e('0x7'));};exports[_0x6c3e('0x8')]=function(_0xcdd288){}; \ No newline at end of file +var _0x9362=['[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','fullybooted','error'];(function(_0x544beb,_0x194d3e){var _0x502287=function(_0x91e691){while(--_0x91e691){_0x544beb['push'](_0x544beb['shift']());}};_0x502287(++_0x194d3e);}(_0x9362,0x111));var _0x2936=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9362[_0x20a584];return _0x4b41a8;};'use strict';var utils=require(_0x2936('0x0'));exports[_0x2936('0x1')]=function(){utils[_0x2936('0x2')]('[core]\x20connected');};exports[_0x2936('0x3')]=function(){utils[_0x2936('0x2')](_0x2936('0x4'));};exports[_0x2936('0x5')]=function(){utils[_0x2936('0x2')]('[core]\x20fullybooted');};exports[_0x2936('0x6')]=function(_0x55233a){utils[_0x2936('0x6')](_0x2936('0x7'),_0x55233a);};exports['close']=function(){utils[_0x2936('0x2')](_0x2936('0x8'));};exports[_0x2936('0x9')]=function(_0x21dc79){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 6116559..20f03de 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 _0xfe86=['newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr(routeid)','split','format','varset','debug','[%s][dials][varset]','isNil','variable','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','assign','starttime','now','lastevent','[%s][dials][dialbegin]','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','calleridnum','calleridname','cause-txt','duration','diffTime','endtime','holdtime','[%s][dials][hangup]','lodash','util','./utils','uniqueid','channel','connectedlinenum','dialstatus','CreateVoiceDialReport'];(function(_0x13c927,_0x1380f9){var _0x4c8438=function(_0x4b371d){while(--_0x4b371d){_0x13c927['push'](_0x13c927['shift']());}};_0x4c8438(++_0x1380f9);}(_0xfe86,0x168));var _0x6fe8=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xfe86[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x6fe8('0x0'));var util=require(_0x6fe8('0x1'));var utils=require(_0x6fe8('0x2'));var dials={};function writeDB(_0x14cf3f){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x14cf3f[_0x6fe8('0x3')],_0x14cf3f[_0x6fe8('0x4')],_0x14cf3f['dialstring'],_0x14cf3f['calleridnum'],_0x14cf3f[_0x6fe8('0x5')],_0x14cf3f[_0x6fe8('0x6')]));utils['request'](_0x6fe8('0x7'),_0x14cf3f);delete dials[_0x14cf3f[_0x6fe8('0x3')]];}exports[_0x6fe8('0x8')]=function(_0x3a93fd){try{utils['debug'](util['format'](_0x6fe8('0x9'),_0x3a93fd[_0x6fe8('0x3')]),_0x3a93fd);utils['info'](util['format'](_0x6fe8('0xa'),_0x3a93fd['uniqueid'],_0x3a93fd[_0x6fe8('0xb')],_0x3a93fd[_0x6fe8('0xc')]));if(_0x3a93fd[_0x6fe8('0xb')][_0x6fe8('0xd')]()=='set'&&_['startsWith'](_0x3a93fd[_0x6fe8('0xc')][_0x6fe8('0xd')](),_0x6fe8('0xe'))){var _0x4f26f9=_0x3a93fd[_0x6fe8('0xc')][_0x6fe8('0xf')]('=');dials[_0x3a93fd[_0x6fe8('0x3')]]={'routeId':_0x4f26f9[0x1]};}}catch(_0x4acc2d){utils['error'](util[_0x6fe8('0x10')](_0x6fe8('0x9'),_0x3a93fd[_0x6fe8('0x3')]),_0x4acc2d);}};exports[_0x6fe8('0x11')]=function(_0x34f490){try{utils[_0x6fe8('0x12')](util['format'](_0x6fe8('0x13'),_0x34f490[_0x6fe8('0x3')]),_0x34f490);if(!_[_0x6fe8('0x14')](_0x34f490[_0x6fe8('0x15')]['outboundrouteid'])){utils[_0x6fe8('0x16')](util[_0x6fe8('0x10')](_0x6fe8('0x17'),_0x34f490[_0x6fe8('0x3')],_0x34f490[_0x6fe8('0x18')]));dials[_0x34f490['uniqueid']]={'routeId':_0x34f490[_0x6fe8('0x18')]};}}catch(_0x32e576){utils[_0x6fe8('0x19')](util[_0x6fe8('0x10')](_0x6fe8('0x13'),_0x34f490[_0x6fe8('0x3')]),_0x32e576);}};exports[_0x6fe8('0x1a')]=function(_0x1605bb){try{if(!_[_0x6fe8('0x14')](dials[_0x1605bb[_0x6fe8('0x3')]])){utils[_0x6fe8('0x12')](util[_0x6fe8('0x10')]('[%s][dials][dialbegin]',_0x1605bb[_0x6fe8('0x3')]),_0x1605bb);dials[_0x1605bb[_0x6fe8('0x3')]]=_[_0x6fe8('0x1b')](dials[_0x1605bb[_0x6fe8('0x3')]],_0x1605bb);dials[_0x1605bb[_0x6fe8('0x3')]][_0x6fe8('0x1c')]=utils[_0x6fe8('0x1d')]();dials[_0x1605bb['uniqueid']][_0x6fe8('0x1e')]='called';utils[_0x6fe8('0x16')](util[_0x6fe8('0x10')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1605bb[_0x6fe8('0x3')],dials[_0x1605bb[_0x6fe8('0x3')]]['starttime']));}}catch(_0x2ae86d){utils[_0x6fe8('0x19')](util[_0x6fe8('0x10')](_0x6fe8('0x1f'),_0x1605bb['uniqueid']),_0x2ae86d);}};exports['dialend']=function(_0x5ebc06){try{if(!_[_0x6fe8('0x14')](dials[_0x5ebc06[_0x6fe8('0x3')]])){utils[_0x6fe8('0x12')](util['format'](_0x6fe8('0x20'),_0x5ebc06[_0x6fe8('0x3')]),_0x5ebc06);dials[_0x5ebc06[_0x6fe8('0x3')]][_0x6fe8('0x6')]=_0x5ebc06[_0x6fe8('0x6')];if(_0x5ebc06[_0x6fe8('0x6')]==_0x6fe8('0x21')){dials[_0x5ebc06[_0x6fe8('0x3')]]=_[_0x6fe8('0x1b')](dials[_0x5ebc06[_0x6fe8('0x3')]],_0x5ebc06);dials[_0x5ebc06[_0x6fe8('0x3')]][_0x6fe8('0x22')]=utils[_0x6fe8('0x1d')]();dials[_0x5ebc06[_0x6fe8('0x3')]][_0x6fe8('0x1e')]=_0x6fe8('0x23');utils[_0x6fe8('0x16')](util[_0x6fe8('0x10')](_0x6fe8('0x24'),_0x5ebc06['uniqueid'],_0x5ebc06['dialstatus'],dials[_0x5ebc06[_0x6fe8('0x3')]][_0x6fe8('0x22')]));}else{utils[_0x6fe8('0x16')](util['format'](_0x6fe8('0x25'),_0x5ebc06[_0x6fe8('0x3')],_0x5ebc06[_0x6fe8('0x6')]));}}}catch(_0x3a62a2){utils['error'](util['format']('[%s][dials][dialend]',_0x5ebc06[_0x6fe8('0x3')]),_0x3a62a2);}};exports['hangup']=function(_0x54cdf0){try{if(!_[_0x6fe8('0x14')](dials[_0x54cdf0[_0x6fe8('0x3')]])){utils[_0x6fe8('0x12')](util[_0x6fe8('0x10')]('[%s][dials][hangup]',_0x54cdf0[_0x6fe8('0x3')]),_0x54cdf0);utils[_0x6fe8('0x16')](util[_0x6fe8('0x10')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x54cdf0[_0x6fe8('0x3')],_0x54cdf0[_0x6fe8('0x26')],_0x54cdf0[_0x6fe8('0x27')],_0x54cdf0[_0x6fe8('0x28')]));dials[_0x54cdf0['uniqueid']]=_[_0x6fe8('0x1b')](dials[_0x54cdf0[_0x6fe8('0x3')]],{'endtime':utils[_0x6fe8('0x1d')](),'lastevent':'complete'});dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x29')]=utils[_0x6fe8('0x2a')](dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x2b')],dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x1c')]);dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x2c')]=utils[_0x6fe8('0x2a')](dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x22')]||dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x2b')],dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x1c')]);dials[_0x54cdf0[_0x6fe8('0x3')]]['billableseconds']=dials[_0x54cdf0[_0x6fe8('0x3')]]['answertime']?utils['diffTime'](dials[_0x54cdf0[_0x6fe8('0x3')]][_0x6fe8('0x2b')],dials[_0x54cdf0['uniqueid']][_0x6fe8('0x22')]):0x0;writeDB(dials[_0x54cdf0['uniqueid']]);}}catch(_0x1db258){utils[_0x6fe8('0x19')](util['format'](_0x6fe8('0x2d'),_0x54cdf0['uniqueid']),_0x1db258);}}; \ No newline at end of file +var _0x2e41=['calleridname','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]','lodash','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','newexten','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','[%s][dials][dialend]','ANSWER','answertime','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s'];(function(_0x3592ab,_0x4f669a){var _0x13298a=function(_0x25f018){while(--_0x25f018){_0x3592ab['push'](_0x3592ab['shift']());}};_0x13298a(++_0x4f669a);}(_0x2e41,0x121));var _0x12e4=function(_0x1fa469,_0x5e19b1){_0x1fa469=_0x1fa469-0x0;var _0x22cc36=_0x2e41[_0x1fa469];return _0x22cc36;};'use strict';var _=require(_0x12e4('0x0'));var util=require('util');var utils=require(_0x12e4('0x1'));var dials={};function writeDB(_0x3375d0){utils[_0x12e4('0x2')](util['format'](_0x12e4('0x3'),_0x3375d0[_0x12e4('0x4')],_0x3375d0[_0x12e4('0x5')],_0x3375d0['dialstring'],_0x3375d0[_0x12e4('0x6')],_0x3375d0[_0x12e4('0x7')],_0x3375d0[_0x12e4('0x8')]));utils['request']('CreateVoiceDialReport',_0x3375d0);delete dials[_0x3375d0['uniqueid']];}exports[_0x12e4('0x9')]=function(_0x5ed1ef){try{utils[_0x12e4('0xa')](util[_0x12e4('0xb')]('[%s][dials][newexten]',_0x5ed1ef[_0x12e4('0x4')]),_0x5ed1ef);utils[_0x12e4('0x2')](util[_0x12e4('0xb')](_0x12e4('0xc'),_0x5ed1ef[_0x12e4('0x4')],_0x5ed1ef[_0x12e4('0xd')],_0x5ed1ef['appdata']));if(_0x5ed1ef[_0x12e4('0xd')]['toLowerCase']()==_0x12e4('0xe')&&_[_0x12e4('0xf')](_0x5ed1ef[_0x12e4('0x10')][_0x12e4('0x11')](),_0x12e4('0x12'))){var _0x15b914=_0x5ed1ef['appdata'][_0x12e4('0x13')]('=');dials[_0x5ed1ef['uniqueid']]={'routeId':_0x15b914[0x1]};}}catch(_0x55a96c){utils['error'](util[_0x12e4('0xb')](_0x12e4('0x14'),_0x5ed1ef['uniqueid']),_0x55a96c);}};exports[_0x12e4('0x15')]=function(_0x7acfba){try{utils['debug'](util[_0x12e4('0xb')](_0x12e4('0x16'),_0x7acfba['uniqueid']),_0x7acfba);if(!_[_0x12e4('0x17')](_0x7acfba[_0x12e4('0x18')][_0x12e4('0x19')])){utils[_0x12e4('0x2')](util['format'](_0x12e4('0x1a'),_0x7acfba[_0x12e4('0x4')],_0x7acfba['value']));dials[_0x7acfba[_0x12e4('0x4')]]={'routeId':_0x7acfba['value']};}}catch(_0x576d0f){utils['error'](util[_0x12e4('0xb')](_0x12e4('0x16'),_0x7acfba[_0x12e4('0x4')]),_0x576d0f);}};exports['dialbegin']=function(_0x381db0){try{if(!_[_0x12e4('0x17')](dials[_0x381db0[_0x12e4('0x4')]])){utils[_0x12e4('0xa')](util[_0x12e4('0xb')](_0x12e4('0x1b'),_0x381db0[_0x12e4('0x4')]),_0x381db0);dials[_0x381db0[_0x12e4('0x4')]]=_[_0x12e4('0x1c')](dials[_0x381db0[_0x12e4('0x4')]],_0x381db0);dials[_0x381db0[_0x12e4('0x4')]][_0x12e4('0x1d')]=utils[_0x12e4('0x1e')]();dials[_0x381db0[_0x12e4('0x4')]]['lastevent']=_0x12e4('0x1f');utils[_0x12e4('0x2')](util[_0x12e4('0xb')](_0x12e4('0x20'),_0x381db0['uniqueid'],dials[_0x381db0[_0x12e4('0x4')]][_0x12e4('0x1d')]));}}catch(_0x261edc){utils[_0x12e4('0x21')](util[_0x12e4('0xb')](_0x12e4('0x1b'),_0x381db0[_0x12e4('0x4')]),_0x261edc);}};exports['dialend']=function(_0x2f9766){try{if(!_[_0x12e4('0x17')](dials[_0x2f9766[_0x12e4('0x4')]])){utils[_0x12e4('0xa')](util[_0x12e4('0xb')](_0x12e4('0x22'),_0x2f9766[_0x12e4('0x4')]),_0x2f9766);dials[_0x2f9766['uniqueid']]['dialstatus']=_0x2f9766[_0x12e4('0x8')];if(_0x2f9766[_0x12e4('0x8')]==_0x12e4('0x23')){dials[_0x2f9766[_0x12e4('0x4')]]=_[_0x12e4('0x1c')](dials[_0x2f9766[_0x12e4('0x4')]],_0x2f9766);dials[_0x2f9766[_0x12e4('0x4')]][_0x12e4('0x24')]=utils[_0x12e4('0x1e')]();dials[_0x2f9766['uniqueid']][_0x12e4('0x25')]='connect';utils[_0x12e4('0x2')](util[_0x12e4('0xb')](_0x12e4('0x26'),_0x2f9766[_0x12e4('0x4')],_0x2f9766[_0x12e4('0x8')],dials[_0x2f9766[_0x12e4('0x4')]][_0x12e4('0x24')]));}else{utils[_0x12e4('0x2')](util[_0x12e4('0xb')](_0x12e4('0x27'),_0x2f9766['uniqueid'],_0x2f9766['dialstatus']));}}}catch(_0x3b9eb5){utils['error'](util[_0x12e4('0xb')](_0x12e4('0x22'),_0x2f9766[_0x12e4('0x4')]),_0x3b9eb5);}};exports['hangup']=function(_0x567878){try{if(!_[_0x12e4('0x17')](dials[_0x567878['uniqueid']])){utils['debug'](util[_0x12e4('0xb')]('[%s][dials][hangup]',_0x567878[_0x12e4('0x4')]),_0x567878);utils[_0x12e4('0x2')](util[_0x12e4('0xb')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x567878[_0x12e4('0x4')],_0x567878[_0x12e4('0x6')],_0x567878[_0x12e4('0x28')],_0x567878['cause-txt']));dials[_0x567878[_0x12e4('0x4')]]=_[_0x12e4('0x1c')](dials[_0x567878['uniqueid']],{'endtime':utils[_0x12e4('0x1e')](),'lastevent':_0x12e4('0x29')});dials[_0x567878[_0x12e4('0x4')]][_0x12e4('0x2a')]=utils[_0x12e4('0x2b')](dials[_0x567878[_0x12e4('0x4')]][_0x12e4('0x2c')],dials[_0x567878['uniqueid']][_0x12e4('0x1d')]);dials[_0x567878['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x567878[_0x12e4('0x4')]][_0x12e4('0x24')]||dials[_0x567878[_0x12e4('0x4')]][_0x12e4('0x2c')],dials[_0x567878[_0x12e4('0x4')]][_0x12e4('0x1d')]);dials[_0x567878[_0x12e4('0x4')]][_0x12e4('0x2d')]=dials[_0x567878['uniqueid']]['answertime']?utils[_0x12e4('0x2b')](dials[_0x567878['uniqueid']][_0x12e4('0x2c')],dials[_0x567878['uniqueid']][_0x12e4('0x24')]):0x0;writeDB(dials[_0x567878[_0x12e4('0x4')]]);}}catch(_0x1f861a){utils['error'](util[_0x12e4('0xb')](_0x12e4('0x2e'),_0x567878[_0x12e4('0x4')]),_0x1f861a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 558aa2f..a51565f 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 _0xbfad=['username','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./members.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','[%s][index][devicestatechange]','device','format','[%s][index][agentcalled]','uniqueid','agentcalled','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]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','./utils','util','xdr','disabled','env','production','local','asterisk','port'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0xbfad,0x107));var _0xdbfa=function(_0x40b6b5,_0x4b6002){_0x40b6b5=_0x40b6b5-0x0;var _0x56c22d=_0xbfad[_0x40b6b5];return _0x56c22d;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0xdbfa('0x0'));var util=require(_0xdbfa('0x1'));var isXDREnabled=config[_0xdbfa('0x2')]&&config[_0xdbfa('0x2')]['disabled']?!config[_0xdbfa('0x2')][_0xdbfa('0x3')]:!![];var isProduction=config[_0xdbfa('0x4')]===_0xdbfa('0x5')||![];var isLocalAsterisk=config['xdr']&&config[_0xdbfa('0x2')][_0xdbfa('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xdbfa('0x7')][_0xdbfa('0x8')],config[_0xdbfa('0x7')]['ip'],config[_0xdbfa('0x7')][_0xdbfa('0x9')],config[_0xdbfa('0x7')][_0xdbfa('0xa')],!![]);ami[_0xdbfa('0xb')]();if(!isXDREnabled){utils[_0xdbfa('0xc')](_0xdbfa('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xdbfa('0xe'));var calls=require(_0xdbfa('0xf'));var queues=require(_0xdbfa('0x10'));var recordings=require('./recordings.controller');var members=require(_0xdbfa('0x11'));var dials=require('./dials.controller');var transfers=require(_0xdbfa('0x12'));var core=require('./core.controller');ami['on'](_0xdbfa('0x13'),core[_0xdbfa('0x13')]);ami['on'](_0xdbfa('0x14'),core['shutdown']);ami['on']('fullybooted',core[_0xdbfa('0x15')]);ami['on'](_0xdbfa('0x16'),core[_0xdbfa('0x16')]);ami['on'](_0xdbfa('0x17'),core[_0xdbfa('0x17')]);ami['on'](_0xdbfa('0x18'),core[_0xdbfa('0x18')]);ami['on']('devicestatechange',function(_0x5269b0){try{utils[_0xdbfa('0x19')](util['format'](_0xdbfa('0x1a'),_0x5269b0[_0xdbfa('0x1b')]),_0x5269b0);members['devicestatechange'](_0x5269b0);}catch(_0x3f1e01){utils[_0xdbfa('0x16')](util['format'](_0xdbfa('0x1a'),_0x5269b0['device']),_0x3f1e01);}});ami['on']('agentcalled',function(_0x571202){try{utils['debug'](util[_0xdbfa('0x1c')](_0xdbfa('0x1d'),_0x571202[_0xdbfa('0x1e')]),_0x571202);agents[_0xdbfa('0x1f')](_0x571202);}catch(_0x3ed69a){utils['error'](util[_0xdbfa('0x1c')](_0xdbfa('0x1d'),_0x571202[_0xdbfa('0x1e')]),_0x3ed69a);}});ami['on'](_0xdbfa('0x20'),function(_0xd12d04){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x21'),_0xd12d04[_0xdbfa('0x1e')]),_0xd12d04);agents['agentringnoanswer'](_0xd12d04);}catch(_0x4c3b9c){utils[_0xdbfa('0x16')](util['format'](_0xdbfa('0x21'),_0xd12d04[_0xdbfa('0x1e')]),_0x4c3b9c);}});ami['on'](_0xdbfa('0x22'),function(_0x3d3dd9){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x23'),_0x3d3dd9[_0xdbfa('0x1e')]),_0x3d3dd9);agents['agentconnect'](_0x3d3dd9);queues[_0xdbfa('0x22')](_0x3d3dd9);}catch(_0x1baeda){utils[_0xdbfa('0x16')](util['format']('[%s][index][agentconnect]',_0x3d3dd9['uniqueid']),_0x1baeda);}});ami['on'](_0xdbfa('0x24'),function(_0x3bba7e){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x25'),_0x3bba7e['uniqueid']),_0x3bba7e);agents['agentcomplete'](_0x3bba7e);queues['agentcomplete'](_0x3bba7e);members['agentcomplete'](_0x3bba7e);}catch(_0xd05a65){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x25'),_0x3bba7e[_0xdbfa('0x1e')]),_0xd05a65);}});ami['on'](_0xdbfa('0x26'),function(_0x42aed8){try{utils['debug'](util[_0xdbfa('0x1c')](_0xdbfa('0x27'),_0x42aed8[_0xdbfa('0x1e')]),_0x42aed8);agents[_0xdbfa('0x26')](_0x42aed8);queues[_0xdbfa('0x26')](_0x42aed8);}catch(_0x24299c){utils[_0xdbfa('0x16')](util['format'](_0xdbfa('0x27'),_0x42aed8[_0xdbfa('0x1e')]),_0x24299c);}});ami['on'](_0xdbfa('0x28'),function(_0x1c2008){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x29'),_0x1c2008['uniqueid']),_0x1c2008);queues[_0xdbfa('0x28')](_0x1c2008);recordings[_0xdbfa('0x28')](_0x1c2008);}catch(_0x509b2d){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x29'),_0x1c2008['uniqueid']),_0x509b2d);}});ami['on'](_0xdbfa('0x2a'),function(_0x1654b7){try{utils[_0xdbfa('0x19')](util['format'](_0xdbfa('0x2b'),_0x1654b7[_0xdbfa('0x1e')]),_0x1654b7);queues[_0xdbfa('0x2a')](_0x1654b7);}catch(_0x5a9339){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')]('[%s][index][queuecallerleave]',_0x1654b7[_0xdbfa('0x1e')]),_0x5a9339);}});ami['on'](_0xdbfa('0x2c'),function(_0x3e6576){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x2d'),_0x3e6576[_0xdbfa('0x1e')]),_0x3e6576);queues[_0xdbfa('0x2c')](_0x3e6576);calls[_0xdbfa('0x2c')](_0x3e6576);}catch(_0x298669){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x2d'),_0x3e6576['uniqueid']),_0x298669);}});ami['on'](_0xdbfa('0x2e'),function(_0x3db6e4){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x2f'),_0x3db6e4[_0xdbfa('0x1e')]),_0x3db6e4);queues['musiconholdstop'](_0x3db6e4);calls['musiconholdstop'](_0x3db6e4);}catch(_0x1480e7){utils['error'](util[_0xdbfa('0x1c')](_0xdbfa('0x2f'),_0x3db6e4['uniqueid']),_0x1480e7);}});ami['on']('newstate',function(_0x5c81b3){try{utils[_0xdbfa('0x19')](util['format'](_0xdbfa('0x30'),_0x5c81b3[_0xdbfa('0x1e')]),_0x5c81b3);calls[_0xdbfa('0x31')](_0x5c81b3);recordings[_0xdbfa('0x31')](_0x5c81b3);}catch(_0x20d135){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x30'),_0x5c81b3[_0xdbfa('0x1e')]),_0x20d135);}});ami['on'](_0xdbfa('0x32'),function(_0x44735f){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x33'),_0x44735f[_0xdbfa('0x1e')]),_0x44735f);calls['hangup'](_0x44735f);recordings[_0xdbfa('0x32')](_0x44735f);dials[_0xdbfa('0x32')](_0x44735f);agents[_0xdbfa('0x32')](_0x44735f);queues[_0xdbfa('0x32')](_0x44735f);}catch(_0x3283ce){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x33'),_0x44735f['uniqueid']),_0x3283ce);}});ami['on'](_0xdbfa('0x34'),function(_0x308b40){try{utils[_0xdbfa('0x19')](util['format']('[%s][index][cdr]',_0x308b40['uniqueid']),_0x308b40);members['cdr'](_0x308b40);}catch(_0x2759fd){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')]('[%s][index][cdr]',_0x308b40[_0xdbfa('0x1e')]),_0x2759fd);}});ami['on'](_0xdbfa('0x35'),function(_0xe50f01){try{utils['debug'](util[_0xdbfa('0x1c')]('[%s][index][blindtransfer]',_0xe50f01[_0xdbfa('0x1e')]),_0xe50f01);queues[_0xdbfa('0x35')](_0xe50f01);agents[_0xdbfa('0x35')](_0xe50f01);transfers[_0xdbfa('0x35')](_0xe50f01);recordings[_0xdbfa('0x35')](_0xe50f01);}catch(_0x30b231){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x36'),_0xe50f01[_0xdbfa('0x1e')]),_0x30b231);}});ami['on']('attendedtransfer',function(_0x10cb06){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x37'),_0x10cb06[_0xdbfa('0x38')]),_0x10cb06);queues[_0xdbfa('0x39')](_0x10cb06);transfers[_0xdbfa('0x39')](_0x10cb06);agents[_0xdbfa('0x39')](_0x10cb06);calls['attendedtransfer'](_0x10cb06);}catch(_0x40110c){utils[_0xdbfa('0x16')](util['format'](_0xdbfa('0x37'),_0x10cb06['origtransfereruniqueid']),_0x40110c);}});ami['on'](_0xdbfa('0x3a'),function(_0x49e80a){try{utils['debug'](util['format'](_0xdbfa('0x3b'),_0x49e80a[_0xdbfa('0x1e')]),_0x49e80a);queues[_0xdbfa('0x3a')](_0x49e80a);recordings[_0xdbfa('0x3a')](_0x49e80a);calls[_0xdbfa('0x3a')](_0x49e80a);dials['varset'](_0x49e80a);}catch(_0x29e6f8){utils['error'](util[_0xdbfa('0x1c')](_0xdbfa('0x3b'),_0x49e80a[_0xdbfa('0x1e')]),_0x29e6f8);}});ami['on'](_0xdbfa('0x3c'),function(_0x570aab){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x3d'),_0x570aab[_0xdbfa('0x1e')]),_0x570aab);calls['newexten'](_0x570aab);recordings[_0xdbfa('0x3c')](_0x570aab);dials[_0xdbfa('0x3c')](_0x570aab);}catch(_0x122364){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x3d'),_0x570aab[_0xdbfa('0x1e')]),_0x122364);}});ami['on'](_0xdbfa('0x3e'),function(_0x2f64d6){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x3f'),_0x2f64d6[_0xdbfa('0x1e')]),_0x2f64d6);calls[_0xdbfa('0x3e')](_0x2f64d6);recordings[_0xdbfa('0x3e')](_0x2f64d6);}catch(_0x471b42){utils['error'](util[_0xdbfa('0x1c')](_0xdbfa('0x3f'),_0x2f64d6['uniqueid']),_0x471b42);}});ami['on'](_0xdbfa('0x40'),function(_0x4c9f57){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x41'),_0x4c9f57[_0xdbfa('0x1e')]),_0x4c9f57);dials['dialbegin'](_0x4c9f57);}catch(_0x1ebfe2){utils[_0xdbfa('0x16')](util['format']('[%s]dialbegin',_0x4c9f57[_0xdbfa('0x1e')]),_0x1ebfe2);}});ami['on']('dialend',function(_0x51b8e0){try{utils[_0xdbfa('0x19')](util[_0xdbfa('0x1c')](_0xdbfa('0x42'),_0x51b8e0[_0xdbfa('0x1e')]),_0x51b8e0);dials[_0xdbfa('0x43')](_0x51b8e0);}catch(_0x39764e){utils[_0xdbfa('0x16')](util[_0xdbfa('0x1c')](_0xdbfa('0x42'),_0x51b8e0['uniqueid']),_0x39764e);}});} \ No newline at end of file +var _0x64d1=['asterisk-manager','util','xdr','disabled','local','port','asterisk','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x208770,_0x2970ee){var _0x4503ca=function(_0x36ec8e){while(--_0x36ec8e){_0x208770['push'](_0x208770['shift']());}};_0x4503ca(++_0x2970ee);}(_0x64d1,0xcf));var _0x164d=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x64d1[_0x12f688];return _0x59c3de;};var AsteriskManager=require(_0x164d('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x164d('0x1'));var isXDREnabled=config[_0x164d('0x2')]&&config[_0x164d('0x2')]['disabled']?!config[_0x164d('0x2')][_0x164d('0x3')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x164d('0x2')]&&config[_0x164d('0x2')][_0x164d('0x4')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x164d('0x5')],config['asterisk']['ip'],config[_0x164d('0x6')][_0x164d('0x7')],config[_0x164d('0x6')][_0x164d('0x8')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x164d('0x9')](_0x164d('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x164d('0xb'));}else{var agents=require(_0x164d('0xc'));var calls=require(_0x164d('0xd'));var queues=require(_0x164d('0xe'));var recordings=require(_0x164d('0xf'));var members=require(_0x164d('0x10'));var dials=require(_0x164d('0x11'));var transfers=require(_0x164d('0x12'));var core=require(_0x164d('0x13'));ami['on'](_0x164d('0x14'),core[_0x164d('0x14')]);ami['on'](_0x164d('0x15'),core[_0x164d('0x15')]);ami['on'](_0x164d('0x16'),core[_0x164d('0x16')]);ami['on'](_0x164d('0x17'),core[_0x164d('0x17')]);ami['on'](_0x164d('0x18'),core['close']);ami['on'](_0x164d('0x19'),core['managerevent']);ami['on'](_0x164d('0x1a'),function(_0x22a5de){try{utils['debug'](util['format'](_0x164d('0x1b'),_0x22a5de[_0x164d('0x1c')]),_0x22a5de);members[_0x164d('0x1a')](_0x22a5de);}catch(_0x34df31){utils[_0x164d('0x17')](util[_0x164d('0x1d')]('[%s][index][devicestatechange]',_0x22a5de[_0x164d('0x1c')]),_0x34df31);}});ami['on']('agentcalled',function(_0x3ac128){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')](_0x164d('0x1f'),_0x3ac128[_0x164d('0x20')]),_0x3ac128);agents['agentcalled'](_0x3ac128);}catch(_0x269c43){utils['error'](util[_0x164d('0x1d')](_0x164d('0x1f'),_0x3ac128[_0x164d('0x20')]),_0x269c43);}});ami['on'](_0x164d('0x21'),function(_0x18778e){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')]('[%s][index][agentringnoanswer]',_0x18778e['uniqueid']),_0x18778e);agents[_0x164d('0x21')](_0x18778e);}catch(_0x538974){utils['error'](util[_0x164d('0x1d')](_0x164d('0x22'),_0x18778e[_0x164d('0x20')]),_0x538974);}});ami['on'](_0x164d('0x23'),function(_0x3771f0){try{utils[_0x164d('0x1e')](util['format'](_0x164d('0x24'),_0x3771f0[_0x164d('0x20')]),_0x3771f0);agents[_0x164d('0x23')](_0x3771f0);queues[_0x164d('0x23')](_0x3771f0);}catch(_0x2979b1){utils[_0x164d('0x17')](util[_0x164d('0x1d')](_0x164d('0x24'),_0x3771f0[_0x164d('0x20')]),_0x2979b1);}});ami['on'](_0x164d('0x25'),function(_0x39eb8a){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')](_0x164d('0x26'),_0x39eb8a['uniqueid']),_0x39eb8a);agents['agentcomplete'](_0x39eb8a);queues[_0x164d('0x25')](_0x39eb8a);members[_0x164d('0x25')](_0x39eb8a);}catch(_0x1d6f0f){utils[_0x164d('0x17')](util[_0x164d('0x1d')](_0x164d('0x26'),_0x39eb8a[_0x164d('0x20')]),_0x1d6f0f);}});ami['on']('queuecallerabandon',function(_0x4fd204){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')](_0x164d('0x27'),_0x4fd204[_0x164d('0x20')]),_0x4fd204);agents[_0x164d('0x28')](_0x4fd204);queues[_0x164d('0x28')](_0x4fd204);}catch(_0x3a4820){utils[_0x164d('0x17')](util['format'](_0x164d('0x27'),_0x4fd204[_0x164d('0x20')]),_0x3a4820);}});ami['on']('queuecallerjoin',function(_0x5a7553){try{utils[_0x164d('0x1e')](util['format'](_0x164d('0x29'),_0x5a7553['uniqueid']),_0x5a7553);queues[_0x164d('0x2a')](_0x5a7553);recordings[_0x164d('0x2a')](_0x5a7553);}catch(_0x29eddd){utils[_0x164d('0x17')](util[_0x164d('0x1d')]('[%s][index][queuecallerjoin]',_0x5a7553[_0x164d('0x20')]),_0x29eddd);}});ami['on'](_0x164d('0x2b'),function(_0x383f95){try{utils['debug'](util['format'](_0x164d('0x2c'),_0x383f95[_0x164d('0x20')]),_0x383f95);queues[_0x164d('0x2b')](_0x383f95);}catch(_0xb671a7){utils[_0x164d('0x17')](util['format'](_0x164d('0x2c'),_0x383f95[_0x164d('0x20')]),_0xb671a7);}});ami['on'](_0x164d('0x2d'),function(_0x1fe66f){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')](_0x164d('0x2e'),_0x1fe66f['uniqueid']),_0x1fe66f);queues[_0x164d('0x2d')](_0x1fe66f);calls[_0x164d('0x2d')](_0x1fe66f);}catch(_0x4e63e1){utils['error'](util[_0x164d('0x1d')]('[%s][index][musiconholdstart]',_0x1fe66f[_0x164d('0x20')]),_0x4e63e1);}});ami['on'](_0x164d('0x2f'),function(_0x28686c){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')](_0x164d('0x30'),_0x28686c['uniqueid']),_0x28686c);queues[_0x164d('0x2f')](_0x28686c);calls[_0x164d('0x2f')](_0x28686c);}catch(_0x6e8bb8){utils['error'](util[_0x164d('0x1d')]('[%s][index][musiconholdstop]',_0x28686c['uniqueid']),_0x6e8bb8);}});ami['on'](_0x164d('0x31'),function(_0x3f1e0f){try{utils['debug'](util[_0x164d('0x1d')]('[%s][index][newstate]',_0x3f1e0f[_0x164d('0x20')]),_0x3f1e0f);calls[_0x164d('0x31')](_0x3f1e0f);recordings[_0x164d('0x31')](_0x3f1e0f);}catch(_0xbfe98c){utils[_0x164d('0x17')](util[_0x164d('0x1d')]('[%s][index][newstate]',_0x3f1e0f[_0x164d('0x20')]),_0xbfe98c);}});ami['on'](_0x164d('0x32'),function(_0x16c478){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')](_0x164d('0x33'),_0x16c478[_0x164d('0x20')]),_0x16c478);calls[_0x164d('0x32')](_0x16c478);recordings[_0x164d('0x32')](_0x16c478);dials[_0x164d('0x32')](_0x16c478);agents[_0x164d('0x32')](_0x16c478);queues[_0x164d('0x32')](_0x16c478);}catch(_0x5656f7){utils['error'](util[_0x164d('0x1d')](_0x164d('0x33'),_0x16c478[_0x164d('0x20')]),_0x5656f7);}});ami['on'](_0x164d('0x34'),function(_0x2738ad){try{utils['debug'](util[_0x164d('0x1d')](_0x164d('0x35'),_0x2738ad[_0x164d('0x20')]),_0x2738ad);members[_0x164d('0x34')](_0x2738ad);}catch(_0x4bb6e8){utils[_0x164d('0x17')](util[_0x164d('0x1d')](_0x164d('0x35'),_0x2738ad['uniqueid']),_0x4bb6e8);}});ami['on'](_0x164d('0x36'),function(_0x24eb75){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')](_0x164d('0x37'),_0x24eb75[_0x164d('0x20')]),_0x24eb75);queues[_0x164d('0x36')](_0x24eb75);agents[_0x164d('0x36')](_0x24eb75);transfers[_0x164d('0x36')](_0x24eb75);recordings[_0x164d('0x36')](_0x24eb75);}catch(_0x5dac8a){utils[_0x164d('0x17')](util['format'](_0x164d('0x37'),_0x24eb75[_0x164d('0x20')]),_0x5dac8a);}});ami['on'](_0x164d('0x38'),function(_0x2e9b2e){try{utils[_0x164d('0x1e')](util['format'](_0x164d('0x39'),_0x2e9b2e[_0x164d('0x3a')]),_0x2e9b2e);queues['attendedtransfer'](_0x2e9b2e);transfers[_0x164d('0x38')](_0x2e9b2e);agents[_0x164d('0x38')](_0x2e9b2e);calls[_0x164d('0x38')](_0x2e9b2e);}catch(_0x582374){utils[_0x164d('0x17')](util['format']('[%s][index][attendedtransfer]',_0x2e9b2e[_0x164d('0x3a')]),_0x582374);}});ami['on']('varset',function(_0x55be1f){try{utils[_0x164d('0x1e')](util['format'](_0x164d('0x3b'),_0x55be1f[_0x164d('0x20')]),_0x55be1f);queues[_0x164d('0x3c')](_0x55be1f);recordings['varset'](_0x55be1f);calls[_0x164d('0x3c')](_0x55be1f);dials[_0x164d('0x3c')](_0x55be1f);}catch(_0x319801){utils['error'](util['format'](_0x164d('0x3b'),_0x55be1f[_0x164d('0x20')]),_0x319801);}});ami['on']('newexten',function(_0x2e8aea){try{utils['debug'](util[_0x164d('0x1d')]('[%s][index][newexten]',_0x2e8aea[_0x164d('0x20')]),_0x2e8aea);calls[_0x164d('0x3d')](_0x2e8aea);recordings[_0x164d('0x3d')](_0x2e8aea);dials[_0x164d('0x3d')](_0x2e8aea);}catch(_0x352ecd){utils[_0x164d('0x17')](util[_0x164d('0x1d')](_0x164d('0x3e'),_0x2e8aea['uniqueid']),_0x352ecd);}});ami['on'](_0x164d('0x3f'),function(_0xc20910){try{utils[_0x164d('0x1e')](util['format']('[%s][index][newchannel]',_0xc20910['uniqueid']),_0xc20910);calls[_0x164d('0x3f')](_0xc20910);recordings[_0x164d('0x3f')](_0xc20910);}catch(_0x522ff9){utils[_0x164d('0x17')](util[_0x164d('0x1d')](_0x164d('0x40'),_0xc20910[_0x164d('0x20')]),_0x522ff9);}});ami['on'](_0x164d('0x41'),function(_0x5f48c0){try{utils[_0x164d('0x1e')](util[_0x164d('0x1d')]('[%s][index][dialbegin]',_0x5f48c0[_0x164d('0x20')]),_0x5f48c0);dials[_0x164d('0x41')](_0x5f48c0);}catch(_0x51a6d1){utils[_0x164d('0x17')](util['format'](_0x164d('0x42'),_0x5f48c0[_0x164d('0x20')]),_0x51a6d1);}});ami['on'](_0x164d('0x43'),function(_0xfd4b56){try{utils[_0x164d('0x1e')](util['format'](_0x164d('0x44'),_0xfd4b56[_0x164d('0x20')]),_0xfd4b56);dials[_0x164d('0x43')](_0xfd4b56);}catch(_0x247b7f){utils[_0x164d('0x17')](util[_0x164d('0x1d')]('[%s][index][dialend]',_0xfd4b56[_0x164d('0x20')]),_0x247b7f);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6c73262..845178e 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 _0x88b4=['duration','diffTime','enterAt','agentcomplete','isNil','debug','[%s][members][agentcomplete]','info','queue','assign','cdr','[%s][members][cdr]','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','lodash','util','./utils','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','internal','request','getUserByName','split','then','name','CreateMemberReport','error','[%s][members][writeDB]','startsWith','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','exitAt'];(function(_0x7a7eb5,_0x7a340f){var _0x24aef9=function(_0x1e31d9){while(--_0x1e31d9){_0x7a7eb5['push'](_0x7a7eb5['shift']());}};_0x24aef9(++_0x7a340f);}(_0x88b4,0xa8));var _0x488b=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x88b4[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x488b('0x0'));var util=require(_0x488b('0x1'));var utils=require(_0x488b('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x488b('0x3')];function writeDB(_0x4e56da){utils['info'](util[_0x488b('0x4')](_0x488b('0x5'),_0x4e56da[_0x488b('0x6')],_0x4e56da[_0x488b('0x7')],_0x4e56da[_0x488b('0x8')],_0x4e56da[_0x488b('0x9')],_0x4e56da[_0x488b('0xa')],_0x4e56da[_0x488b('0xb')]));if(_0x4e56da[_0x488b('0x7')]){utils[_0x488b('0xc')](_0x4e56da[_0x488b('0x7')])['then'](function(_0x555037){if(_0x555037){_0x4e56da[_0x488b('0xa')]=_0x555037['name'];_0x4e56da['internal']=_0x555037[_0x488b('0xd')];utils[_0x488b('0xe')]('CreateMemberReport',_0x4e56da);}else{utils[_0x488b('0xf')](_0x4e56da[_0x488b('0x7')][_0x488b('0x10')]('/')[0x1])[_0x488b('0x11')](function(_0x2b8c53){if(_0x2b8c53){_0x4e56da[_0x488b('0xa')]=_0x2b8c53[_0x488b('0x12')];_0x4e56da[_0x488b('0xd')]=_0x2b8c53[_0x488b('0xd')];utils[_0x488b('0xe')](_0x488b('0x13'),_0x4e56da);}});}})['catch'](function(_0x2ec5bc){utils[_0x488b('0x14')](util[_0x488b('0x4')](_0x488b('0x15'),_0x4e56da['uniqueid']),_0x2ec5bc);});}delete members[_0x4e56da[_0x488b('0x7')]];}function startsWith(_0x26797d,_0x555be4){return _['some'](_0x26797d,function(_0x5f390b){return _[_0x488b('0x16')](_0x555be4,_0x5f390b);});}exports['devicestatechange']=function(_0x523c81){try{utils['debug'](util['format'](_0x488b('0x17'),members[_0x523c81[_0x488b('0x18')]]?members[_0x523c81[_0x488b('0x18')]][_0x488b('0x6')]:_0x523c81[_0x488b('0x18')]),_0x523c81);utils['info'](util['format'](_0x488b('0x19'),members[_0x523c81[_0x488b('0x18')]]?members[_0x523c81['device']][_0x488b('0x6')]:_0x523c81[_0x488b('0x18')],_0x523c81[_0x488b('0x1a')],_0x523c81[_0x488b('0x18')]));switch(_0x523c81[_0x488b('0x1a')]){case'INUSE':case _0x488b('0x1b'):if(!startsWith(exclude,_0x523c81['device'])){members[_0x523c81[_0x488b('0x18')]]={'channel':_0x488b('0x1c'),'interface':_0x523c81[_0x488b('0x18')],'type':_0x488b('0x1d'),'enterAt':utils[_0x488b('0x1e')](),'role':'agent'};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x523c81[_0x488b('0x18')]])){members[_0x523c81[_0x488b('0x18')]][_0x488b('0x1f')]=utils[_0x488b('0x1e')]();members[_0x523c81[_0x488b('0x18')]][_0x488b('0x20')]=utils[_0x488b('0x21')](members[_0x523c81[_0x488b('0x18')]][_0x488b('0x1f')],members[_0x523c81[_0x488b('0x18')]][_0x488b('0x22')]);if(members[_0x523c81[_0x488b('0x18')]][_0x488b('0x6')]){writeDB(members[_0x523c81[_0x488b('0x18')]]);}}break;default:break;}}catch(_0x4c57e5){utils[_0x488b('0x14')](util[_0x488b('0x4')](_0x488b('0x17'),members[_0x523c81['device']]?members[_0x523c81['device']][_0x488b('0x6')]:_0x523c81[_0x488b('0x18')]),_0x4c57e5);}};exports[_0x488b('0x23')]=function(_0x3195d2){try{if(!_[_0x488b('0x24')](members[_0x3195d2[_0x488b('0x7')]])){utils[_0x488b('0x25')](util['format'](_0x488b('0x26'),_0x3195d2[_0x488b('0x6')]),_0x3195d2);utils[_0x488b('0x27')](util[_0x488b('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x3195d2['uniqueid'],_0x3195d2['interface'],_0x3195d2[_0x488b('0x28')]));members[_0x3195d2['interface']]=_[_0x488b('0x29')](members[_0x3195d2[_0x488b('0x7')]],{'data4':_0x3195d2[_0x488b('0x28')],'uniqueid':_0x3195d2[_0x488b('0x6')]});}}catch(_0x24467b){utils[_0x488b('0x14')](util['format'](_0x488b('0x26'),_0x3195d2['uniqueid']),_0x24467b);}};exports[_0x488b('0x2a')]=function(_0x414f14){try{utils[_0x488b('0x25')](util[_0x488b('0x4')](_0x488b('0x2b'),_0x414f14[_0x488b('0x6')]),_0x414f14);if(_0x414f14[_0x488b('0x8')]){var _0x19ac57=_0x414f14[_0x488b('0x8')][_0x488b('0x10')]('-')[0x0];if(!_[_0x488b('0x24')](members[_0x19ac57])){members[_0x19ac57]=_[_0x488b('0x29')](members[_0x19ac57],{'data1':members[_0x19ac57][_0x488b('0x2c')]||_0x414f14[_0x488b('0xb')],'data2':members[_0x19ac57][_0x488b('0x9')]||_0x414f14[_0x488b('0x2d')],'data3':members[_0x19ac57]['data3']||_0x414f14[_0x488b('0x2e')],'uniqueid':members[_0x19ac57]['uniqueid']||_0x414f14[_0x488b('0x6')]});utils['info'](util[_0x488b('0x4')](_0x488b('0x2f'),_0x414f14['uniqueid'],members[_0x19ac57]['data1'],members[_0x19ac57][_0x488b('0x9')],members[_0x19ac57][_0x488b('0x30')]));if(members[_0x19ac57][_0x488b('0x1f')]){writeDB(members[_0x19ac57]);}}}if(_0x414f14[_0x488b('0x31')]){var _0x4b5b8a=_0x414f14[_0x488b('0x31')][_0x488b('0x10')]('-')[0x0];if(!_[_0x488b('0x24')](members[_0x4b5b8a])){members[_0x4b5b8a]=_[_0x488b('0x29')](members[_0x4b5b8a],{'data1':members[_0x4b5b8a][_0x488b('0x2c')]||_0x414f14[_0x488b('0xb')],'data2':members[_0x4b5b8a][_0x488b('0x9')]||_0x414f14[_0x488b('0x2d')],'data3':members[_0x4b5b8a][_0x488b('0x30')]||_0x414f14[_0x488b('0x2e')],'uniqueid':members[_0x4b5b8a][_0x488b('0x6')]||_0x414f14[_0x488b('0x6')]});utils[_0x488b('0x27')](util[_0x488b('0x4')](_0x488b('0x2f'),_0x414f14[_0x488b('0x6')],members[_0x4b5b8a]['data1'],members[_0x4b5b8a]['data2'],members[_0x4b5b8a]['data3']));if(members[_0x4b5b8a]['exitAt']){writeDB(members[_0x4b5b8a]);}}}}catch(_0x29799f){utils[_0x488b('0x14')](util['format'](_0x488b('0x2b'),_0x414f14[_0x488b('0x6')]),_0x29799f);}}; \ No newline at end of file +var _0x795a=['agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','split','data1','type','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','source','[%s][members][cdr]','util','./utils','Queue:','info','format','interface','channel','data2','membername','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','uniqueid','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','TALKING'];(function(_0x467c35,_0xeea803){var _0x3bcf81=function(_0x44b486){while(--_0x44b486){_0x467c35['push'](_0x467c35['shift']());}};_0x3bcf81(++_0xeea803);}(_0x795a,0xa2));var _0xa795=function(_0x90d735,_0x1144fd){_0x90d735=_0x90d735-0x0;var _0x4cce04=_0x795a[_0x90d735];return _0x4cce04;};'use strict';var _=require('lodash');var util=require(_0xa795('0x0'));var utils=require(_0xa795('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xa795('0x2')];function writeDB(_0x4e8f61){utils[_0xa795('0x3')](util[_0xa795('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x4e8f61['uniqueid'],_0x4e8f61[_0xa795('0x5')],_0x4e8f61[_0xa795('0x6')],_0x4e8f61[_0xa795('0x7')],_0x4e8f61[_0xa795('0x8')],_0x4e8f61['type']));if(_0x4e8f61[_0xa795('0x5')]){utils['getUserByInterface'](_0x4e8f61[_0xa795('0x5')])['then'](function(_0x4bb5b5){if(_0x4bb5b5){_0x4e8f61[_0xa795('0x8')]=_0x4bb5b5[_0xa795('0x9')];_0x4e8f61[_0xa795('0xa')]=_0x4bb5b5[_0xa795('0xa')];utils[_0xa795('0xb')](_0xa795('0xc'),_0x4e8f61);}else{utils[_0xa795('0xd')](_0x4e8f61[_0xa795('0x5')]['split']('/')[0x1])['then'](function(_0x15a7b3){if(_0x15a7b3){_0x4e8f61[_0xa795('0x8')]=_0x15a7b3[_0xa795('0x9')];_0x4e8f61['internal']=_0x15a7b3[_0xa795('0xa')];utils[_0xa795('0xb')]('CreateMemberReport',_0x4e8f61);}});}})[_0xa795('0xe')](function(_0x1fa71a){utils[_0xa795('0xf')](util[_0xa795('0x4')](_0xa795('0x10'),_0x4e8f61[_0xa795('0x11')]),_0x1fa71a);});}delete members[_0x4e8f61[_0xa795('0x5')]];}function startsWith(_0x4b0bc9,_0x1e4d13){return _[_0xa795('0x12')](_0x4b0bc9,function(_0x558e04){return _['startsWith'](_0x1e4d13,_0x558e04);});}exports[_0xa795('0x13')]=function(_0x56db2c){try{utils[_0xa795('0x14')](util[_0xa795('0x4')](_0xa795('0x15'),members[_0x56db2c[_0xa795('0x16')]]?members[_0x56db2c[_0xa795('0x16')]]['uniqueid']:_0x56db2c[_0xa795('0x16')]),_0x56db2c);utils[_0xa795('0x3')](util[_0xa795('0x4')](_0xa795('0x17'),members[_0x56db2c[_0xa795('0x16')]]?members[_0x56db2c[_0xa795('0x16')]][_0xa795('0x11')]:_0x56db2c['device'],_0x56db2c['state'],_0x56db2c[_0xa795('0x16')]));switch(_0x56db2c[_0xa795('0x18')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x56db2c[_0xa795('0x16')])){members[_0x56db2c[_0xa795('0x16')]]={'channel':'voice','interface':_0x56db2c[_0xa795('0x16')],'type':_0xa795('0x19'),'enterAt':utils['now'](),'role':_0xa795('0x1a')};}break;case _0xa795('0x1b'):if(!_[_0xa795('0x1c')](members[_0x56db2c[_0xa795('0x16')]])){members[_0x56db2c[_0xa795('0x16')]][_0xa795('0x1d')]=utils[_0xa795('0x1e')]();members[_0x56db2c[_0xa795('0x16')]][_0xa795('0x1f')]=utils[_0xa795('0x20')](members[_0x56db2c[_0xa795('0x16')]]['exitAt'],members[_0x56db2c[_0xa795('0x16')]]['enterAt']);if(members[_0x56db2c[_0xa795('0x16')]][_0xa795('0x11')]){writeDB(members[_0x56db2c['device']]);}}break;default:break;}}catch(_0x20eaef){utils['error'](util['format']('[%s][members][devicestatechange]',members[_0x56db2c[_0xa795('0x16')]]?members[_0x56db2c['device']][_0xa795('0x11')]:_0x56db2c[_0xa795('0x16')]),_0x20eaef);}};exports[_0xa795('0x21')]=function(_0x432587){try{if(!_['isNil'](members[_0x432587['interface']])){utils['debug'](util[_0xa795('0x4')](_0xa795('0x22'),_0x432587['uniqueid']),_0x432587);utils['info'](util[_0xa795('0x4')](_0xa795('0x23'),_0x432587['uniqueid'],_0x432587[_0xa795('0x5')],_0x432587['queue']));members[_0x432587[_0xa795('0x5')]]=_[_0xa795('0x24')](members[_0x432587['interface']],{'data4':_0x432587[_0xa795('0x25')],'uniqueid':_0x432587[_0xa795('0x11')]});}}catch(_0x4fbf57){utils[_0xa795('0xf')](util[_0xa795('0x4')]('[%s][members][agentcomplete]',_0x432587['uniqueid']),_0x4fbf57);}};exports[_0xa795('0x26')]=function(_0x210cfa){try{utils['debug'](util[_0xa795('0x4')]('[%s][members][cdr]',_0x210cfa['uniqueid']),_0x210cfa);if(_0x210cfa[_0xa795('0x6')]){var _0x5455a1=_0x210cfa[_0xa795('0x6')][_0xa795('0x27')]('-')[0x0];if(!_[_0xa795('0x1c')](members[_0x5455a1])){members[_0x5455a1]=_['assign'](members[_0x5455a1],{'data1':members[_0x5455a1][_0xa795('0x28')]||_0x210cfa[_0xa795('0x29')],'data2':members[_0x5455a1]['data2']||_0x210cfa['source'],'data3':members[_0x5455a1][_0xa795('0x2a')]||_0x210cfa[_0xa795('0x2b')],'uniqueid':members[_0x5455a1]['uniqueid']||_0x210cfa[_0xa795('0x11')]});utils[_0xa795('0x3')](util[_0xa795('0x4')](_0xa795('0x2c'),_0x210cfa[_0xa795('0x11')],members[_0x5455a1][_0xa795('0x28')],members[_0x5455a1][_0xa795('0x7')],members[_0x5455a1]['data3']));if(members[_0x5455a1]['exitAt']){writeDB(members[_0x5455a1]);}}}if(_0x210cfa['destinationchannel']){var _0x2fc1e3=_0x210cfa['destinationchannel'][_0xa795('0x27')]('-')[0x0];if(!_[_0xa795('0x1c')](members[_0x2fc1e3])){members[_0x2fc1e3]=_['assign'](members[_0x2fc1e3],{'data1':members[_0x2fc1e3][_0xa795('0x28')]||_0x210cfa[_0xa795('0x29')],'data2':members[_0x2fc1e3][_0xa795('0x7')]||_0x210cfa[_0xa795('0x2d')],'data3':members[_0x2fc1e3][_0xa795('0x2a')]||_0x210cfa['destination'],'uniqueid':members[_0x2fc1e3]['uniqueid']||_0x210cfa['uniqueid']});utils[_0xa795('0x3')](util['format'](_0xa795('0x2c'),_0x210cfa[_0xa795('0x11')],members[_0x2fc1e3][_0xa795('0x28')],members[_0x2fc1e3][_0xa795('0x7')],members[_0x2fc1e3][_0xa795('0x2a')]));if(members[_0x2fc1e3][_0xa795('0x1d')]){writeDB(members[_0x2fc1e3]);}}}}catch(_0x18f3eb){utils[_0xa795('0xf')](util['format'](_0xa795('0x2e'),_0x210cfa[_0xa795('0x11')]),_0x18f3eb);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 8f57039..02bb896 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 _0xd967=['queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerleaveAt','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','lastAssignedTo','membername','reason','transfer','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','queuecallerabandon','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','queueposition'];(function(_0x4693b5,_0x2de981){var _0x6609ff=function(_0x3ab1b7){while(--_0x3ab1b7){_0x4693b5['push'](_0x4693b5['shift']());}};_0x6609ff(++_0x2de981);}(_0xd967,0xa9));var _0x7d96=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xd967[_0x5e6cb8];return _0x3faeb3;};'use strict';var _=require(_0x7d96('0x0'));var util=require(_0x7d96('0x1'));var utils=require(_0x7d96('0x2'));var queues={};function writeDB(_0x4f4dba){utils[_0x7d96('0x3')](util[_0x7d96('0x4')](_0x7d96('0x5'),_0x4f4dba[_0x7d96('0x6')],_0x4f4dba[_0x7d96('0x7')],_0x4f4dba[_0x7d96('0x8')],_0x4f4dba['lastAssignedTo'],_0x4f4dba[_0x7d96('0x9')],_0x4f4dba[_0x7d96('0xa')],_0x4f4dba[_0x7d96('0xb')]));if(_0x4f4dba[_0x7d96('0x8')]){utils[_0x7d96('0xc')](_0x4f4dba[_0x7d96('0x8')])[_0x7d96('0xd')](function(_0x3fafd5){if(_0x3fafd5){_0x4f4dba[_0x7d96('0xe')]=_0x3fafd5[_0x7d96('0xe')];}utils[_0x7d96('0xf')](_0x7d96('0x10'),_0x4f4dba);});}else{utils[_0x7d96('0xf')]('CreateVoiceQueueReport',_0x4f4dba);}if(_0x4f4dba[_0x7d96('0x11')]){delete queues[_0x4f4dba['transfereduniqueid']];}else{delete queues[_0x4f4dba[_0x7d96('0x6')]];}}exports[_0x7d96('0x12')]=function(_0x2fa987){try{utils[_0x7d96('0x13')](util[_0x7d96('0x4')](_0x7d96('0x14'),_0x2fa987['uniqueid']),_0x2fa987);utils['info'](util['format'](_0x7d96('0x15'),_0x2fa987['uniqueid'],_0x2fa987['queue'],_0x2fa987[_0x7d96('0x16')]));queues[_0x2fa987[_0x7d96('0x6')]]=_[_0x7d96('0x17')](_0x2fa987,{'originalposition':_0x2fa987['position'],'queuecallerjoinAt':utils[_0x7d96('0x18')](),'mohtime':0x0});}catch(_0x24e458){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x14'),_0x2fa987['uniqueid']),_0x24e458);}};exports['hangup']=function(_0x3a7b65){try{if(!_[_0x7d96('0x1a')](queues[_0x3a7b65['uniqueid']])){utils[_0x7d96('0x13')](util['format'](_0x7d96('0x1b'),_0x3a7b65[_0x7d96('0x6')]),_0x3a7b65);if(queues[_0x3a7b65[_0x7d96('0x6')]]['queuecallerleaveAt']){if(!queues[_0x3a7b65[_0x7d96('0x6')]]['queuecallerabandon']&&!queues[_0x3a7b65[_0x7d96('0x6')]]['queuecallerexit']){queues[_0x3a7b65[_0x7d96('0x6')]][_0x7d96('0x1c')]=!![];queues[_0x3a7b65[_0x7d96('0x6')]][_0x7d96('0x1d')]=utils[_0x7d96('0x18')]();queues[_0x3a7b65['uniqueid']][_0x7d96('0xb')]=_0x7d96('0x1e');}utils[_0x7d96('0x3')](util['format'](_0x7d96('0x1f'),_0x3a7b65[_0x7d96('0x6')],queues[_0x3a7b65[_0x7d96('0x6')]]['name'],queues[_0x3a7b65[_0x7d96('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x3a7b65[_0x7d96('0x6')]]);}else if(queues[_0x3a7b65[_0x7d96('0x6')]]['transfereduniqueid']){utils[_0x7d96('0x3')](util[_0x7d96('0x4')](_0x7d96('0x20'),_0x3a7b65['uniqueid'],queues[_0x3a7b65[_0x7d96('0x6')]]['name'],queues[_0x3a7b65[_0x7d96('0x6')]]['transfereduniqueid']));queues[queues[_0x3a7b65['uniqueid']][_0x7d96('0x11')]]=queues[_0x3a7b65[_0x7d96('0x6')]];queues[queues[_0x3a7b65['uniqueid']]['transfereduniqueid']][_0x7d96('0x21')]=0x2;delete queues[_0x3a7b65[_0x7d96('0x6')]];}}}catch(_0x5c88d4){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x1b'),_0x3a7b65[_0x7d96('0x6')]),_0x5c88d4);}};exports[_0x7d96('0x22')]=function(_0x56d1de){try{utils[_0x7d96('0x13')](util[_0x7d96('0x4')](_0x7d96('0x23'),_0x56d1de[_0x7d96('0x6')]),_0x56d1de);if(!_[_0x7d96('0x1a')](_0x56d1de[_0x7d96('0x24')][_0x7d96('0x25')])&&_0x56d1de[_0x7d96('0x26')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x7d96('0x1a')](queues[_0x56d1de['uniqueid']])){queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x27')]=![];queues[_0x56d1de[_0x7d96('0x6')]]['queuecallerabandonAt']=null;queues[_0x56d1de['uniqueid']][_0x7d96('0x28')]=!![];queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x29')]=utils['now']();queues[_0x56d1de['uniqueid']][_0x7d96('0xb')]=_0x56d1de['value']['toUpperCase']();utils[_0x7d96('0x3')](util['format'](_0x7d96('0x2a'),_0x56d1de[_0x7d96('0x6')],queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x2b')],_0x56d1de[_0x7d96('0x26')],queues[_0x56d1de['uniqueid']][_0x7d96('0xb')]));writeDB(queues[_0x56d1de[_0x7d96('0x6')]]);}}else if(!_[_0x7d96('0x1a')](_0x56d1de[_0x7d96('0x24')][_0x7d96('0x2c')])){if(!_['isNil'](queues[_0x56d1de[_0x7d96('0x6')]])&&!queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x27')]){queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x27')]=![];queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x2d')]=null;queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x28')]=!![];queues[_0x56d1de['uniqueid']][_0x7d96('0x29')]=utils[_0x7d96('0x18')]();queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0xb')]=_0x7d96('0x2e');utils['info'](util[_0x7d96('0x4')](_0x7d96('0x2f'),_0x56d1de[_0x7d96('0x6')],queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0x2b')],_0x56d1de['value'],queues[_0x56d1de[_0x7d96('0x6')]][_0x7d96('0xb')]));}}}catch(_0x1459c3){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x23'),_0x56d1de['uniqueid']),_0x1459c3);}};exports[_0x7d96('0x27')]=function(_0x5f58a2){try{if(!_[_0x7d96('0x1a')](queues[_0x5f58a2[_0x7d96('0x6')]])){utils[_0x7d96('0x13')](util[_0x7d96('0x4')](_0x7d96('0x30'),_0x5f58a2['uniqueid']),_0x5f58a2);queues[_0x5f58a2[_0x7d96('0x6')]][_0x7d96('0x28')]=![];queues[_0x5f58a2[_0x7d96('0x6')]][_0x7d96('0x29')]=null;queues[_0x5f58a2['uniqueid']][_0x7d96('0x27')]=!![];queues[_0x5f58a2[_0x7d96('0x6')]][_0x7d96('0x2d')]=utils[_0x7d96('0x18')]();queues[_0x5f58a2[_0x7d96('0x6')]][_0x7d96('0xb')]='ABANDONED';utils['info'](util[_0x7d96('0x4')](_0x7d96('0x31'),_0x5f58a2[_0x7d96('0x6')],queues[_0x5f58a2['uniqueid']][_0x7d96('0x2b')],queues[_0x5f58a2['uniqueid']]['queuecallerexitreason']));}}catch(_0x501777){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x30'),_0x5f58a2[_0x7d96('0x6')]),_0x501777);}};exports[_0x7d96('0x32')]=function(_0x5aac6a){try{if(!_['isNil'](queues[_0x5aac6a['uniqueid']])){utils['debug'](util['format'](_0x7d96('0x33'),_0x5aac6a[_0x7d96('0x6')]),_0x5aac6a);utils[_0x7d96('0x3')](util[_0x7d96('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5aac6a['uniqueid'],queues[_0x5aac6a[_0x7d96('0x6')]][_0x7d96('0x2b')],_0x5aac6a[_0x7d96('0x34')],_0x5aac6a[_0x7d96('0x35')]));queues[_0x5aac6a[_0x7d96('0x6')]]['queuecallerleave']=!![];queues[_0x5aac6a[_0x7d96('0x6')]]['queuecallerleaveAt']=utils[_0x7d96('0x18')]();queues[_0x5aac6a[_0x7d96('0x6')]][_0x7d96('0x36')]=utils[_0x7d96('0x37')](queues[_0x5aac6a[_0x7d96('0x6')]][_0x7d96('0x38')],queues[_0x5aac6a['uniqueid']]['queuecallerjoinAt']);queues[_0x5aac6a[_0x7d96('0x6')]][_0x7d96('0x16')]=_0x5aac6a[_0x7d96('0x16')];queues[_0x5aac6a[_0x7d96('0x6')]][_0x7d96('0x39')]=_0x5aac6a[_0x7d96('0x39')];queues[_0x5aac6a[_0x7d96('0x6')]][_0x7d96('0x34')]=_0x5aac6a['connectedlinenum'];queues[_0x5aac6a[_0x7d96('0x6')]][_0x7d96('0x35')]=_0x5aac6a[_0x7d96('0x35')];}}catch(_0x508d06){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x33'),_0x5aac6a[_0x7d96('0x6')]),_0x508d06);}};exports[_0x7d96('0x3a')]=function(_0x3673ef){try{if(!_[_0x7d96('0x1a')](queues[_0x3673ef[_0x7d96('0x6')]])){utils[_0x7d96('0x13')](util[_0x7d96('0x4')](_0x7d96('0x3b'),_0x3673ef[_0x7d96('0x6')]),_0x3673ef);utils['info'](util[_0x7d96('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3673ef[_0x7d96('0x6')],queues[_0x3673ef[_0x7d96('0x6')]][_0x7d96('0x2b')],_0x3673ef['membername'],_0x3673ef[_0x7d96('0x3c')]));queues[_0x3673ef[_0x7d96('0x6')]][_0x7d96('0x27')]=![];queues[_0x3673ef[_0x7d96('0x6')]][_0x7d96('0x27')]=![];queues[_0x3673ef[_0x7d96('0x6')]][_0x7d96('0x2d')]=null;queues[_0x3673ef[_0x7d96('0x6')]][_0x7d96('0x28')]=![];queues[_0x3673ef[_0x7d96('0x6')]][_0x7d96('0xb')]=null;queues[_0x3673ef[_0x7d96('0x6')]]['queuecallerexitAt']=null;queues[_0x3673ef['uniqueid']][_0x7d96('0x3d')]=!![];queues[_0x3673ef[_0x7d96('0x6')]]['accountcode']=_0x3673ef['destaccountcode'];queues[_0x3673ef['uniqueid']][_0x7d96('0x3e')]=_0x3673ef[_0x7d96('0x3f')];}}catch(_0x540b9f){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x3b'),_0x3673ef[_0x7d96('0x6')]),_0x540b9f);}};exports['agentcomplete']=function(_0x2e5409){try{if(!_['isNil'](queues[_0x2e5409['uniqueid']])){if(queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x38')]){utils[_0x7d96('0x13')](util[_0x7d96('0x4')]('[%s][queues][agentcomplete]',_0x2e5409[_0x7d96('0x6')]),_0x2e5409);queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x27')]=![];queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x27')]=![];queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x2d')]=null;queues[_0x2e5409['uniqueid']]['queuecallerexit']=![];queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x29')]=null;queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x3d')]=!![];queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x3e')]=_0x2e5409['membername'];queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x1c')]=!![];queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x1d')]=utils[_0x7d96('0x18')]();if(_0x2e5409[_0x7d96('0x40')]==_0x7d96('0x41')){if(!queues[_0x2e5409['uniqueid']][_0x7d96('0x41')]){queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0xb')]='TRANSFER';}}else{queues[_0x2e5409['uniqueid']]['queuecallerexitreason']=_0x7d96('0x42')+_0x2e5409[_0x7d96('0x40')][_0x7d96('0x43')]();}utils[_0x7d96('0x3')](util[_0x7d96('0x4')](_0x7d96('0x44'),_0x2e5409['uniqueid'],queues[_0x2e5409[_0x7d96('0x6')]][_0x7d96('0x2b')],_0x2e5409[_0x7d96('0x3f')],queues[_0x2e5409[_0x7d96('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x2e5409[_0x7d96('0x6')]]);}}}catch(_0x116309){utils['error'](util['format'](_0x7d96('0x45'),_0x2e5409[_0x7d96('0x6')]),_0x116309);}};exports[_0x7d96('0x46')]=function(_0x5b2348){try{if(!_[_0x7d96('0x1a')](queues[_0x5b2348[_0x7d96('0x47')]])){utils[_0x7d96('0x13')](util[_0x7d96('0x4')](_0x7d96('0x48'),_0x5b2348[_0x7d96('0x6')]),_0x5b2348);queues[_0x5b2348[_0x7d96('0x47')]][_0x7d96('0x41')]=!![];queues[_0x5b2348[_0x7d96('0x47')]][_0x7d96('0x49')]=_0x7d96('0x4a');queues[_0x5b2348[_0x7d96('0x47')]][_0x7d96('0x4b')]=_0x5b2348[_0x7d96('0x4c')];queues[_0x5b2348[_0x7d96('0x47')]][_0x7d96('0x4d')]=_0x5b2348[_0x7d96('0x47')];queues[_0x5b2348[_0x7d96('0x47')]][_0x7d96('0xb')]=_0x7d96('0x4e');utils['info'](util[_0x7d96('0x4')](_0x7d96('0x4f'),_0x5b2348[_0x7d96('0x6')],queues[_0x5b2348[_0x7d96('0x47')]]['name'],_0x5b2348[_0x7d96('0x47')],_0x5b2348[_0x7d96('0x4c')]));}}catch(_0x4d7195){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x48'),_0x5b2348[_0x7d96('0x6')]),_0x4d7195);}};exports[_0x7d96('0x50')]=function(_0x23836a){try{utils['debug'](util['format'](_0x7d96('0x51'),_0x23836a[_0x7d96('0x52')]),_0x23836a);if(_0x23836a[_0x7d96('0x52')]==_0x23836a[_0x7d96('0x53')]){if(!_[_0x7d96('0x1a')](queues[_0x23836a[_0x7d96('0x54')]])){utils[_0x7d96('0x3')](util['format'](_0x7d96('0x55'),_0x23836a['origtransfereruniqueid'],queues[_0x23836a[_0x7d96('0x54')]][_0x7d96('0x2b')],_0x23836a[_0x7d96('0x56')]));queues[_0x23836a['secondtransfererlinkedid']][_0x7d96('0x41')]=!![];queues[_0x23836a[_0x7d96('0x54')]][_0x7d96('0x49')]=_0x7d96('0x57');queues[_0x23836a[_0x7d96('0x54')]][_0x7d96('0x4b')]=_0x23836a['origtransfererexten'];queues[_0x23836a['secondtransfererlinkedid']][_0x7d96('0x4d')]=_0x23836a[_0x7d96('0x52')];queues[_0x23836a[_0x7d96('0x54')]][_0x7d96('0xb')]=_0x7d96('0x58');}if(!_[_0x7d96('0x1a')](queues[_0x23836a[_0x7d96('0x53')]])){if(_0x23836a['transfereelinkedid']&&queues[_0x23836a['transfereelinkedid']]){queues[_0x23836a[_0x7d96('0x59')]][_0x7d96('0x21')]=0x1;queues[_0x23836a[_0x7d96('0x47')]]=_[_0x7d96('0x5a')](queues[_0x23836a[_0x7d96('0x59')]]);queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x11')]=_0x23836a[_0x7d96('0x5b')];queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x21')]=0x2;queues[_0x23836a[_0x7d96('0x47')]]['calleridnum']=queues[_0x23836a[_0x7d96('0x54')]][_0x7d96('0x9')];queues[_0x23836a['transfereeuniqueid']][_0x7d96('0x5c')]=queues[_0x23836a['secondtransfererlinkedid']][_0x7d96('0x5c')];queues[_0x23836a[_0x7d96('0x47')]]['queuecallerjoinAt']=utils[_0x7d96('0x18')]();queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x38')]=utils[_0x7d96('0x18')]();queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x36')]=0x0;queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x5d')]=0x0;utils[_0x7d96('0x3')](util[_0x7d96('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x23836a[_0x7d96('0x52')],queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x2b')],queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x9')],queues[_0x23836a[_0x7d96('0x47')]][_0x7d96('0x5c')]));}else{utils[_0x7d96('0x3')](util[_0x7d96('0x4')](_0x7d96('0x5e'),_0x23836a[_0x7d96('0x52')],queues[_0x23836a[_0x7d96('0x53')]]['name'],_0x23836a['secondtransfererlinkedid']));queues[_0x23836a[_0x7d96('0x53')]][_0x7d96('0x11')]=_0x23836a[_0x7d96('0x54')];}}}else if(_0x23836a[_0x7d96('0x5f')]==_0x23836a[_0x7d96('0x54')]){if(!_['isNil'](queues[_0x23836a[_0x7d96('0x53')]])){utils[_0x7d96('0x3')](util[_0x7d96('0x4')](_0x7d96('0x60'),_0x23836a[_0x7d96('0x52')],queues[_0x23836a[_0x7d96('0x53')]]['name'],_0x23836a[_0x7d96('0x5f')],_0x23836a['secondtransfererexten']));queues[_0x23836a[_0x7d96('0x53')]][_0x7d96('0x41')]=!![];queues[_0x23836a[_0x7d96('0x53')]][_0x7d96('0x49')]=_0x7d96('0x57');queues[_0x23836a[_0x7d96('0x53')]][_0x7d96('0x4b')]=_0x23836a[_0x7d96('0x61')];queues[_0x23836a[_0x7d96('0x53')]]['transferuniqueid']=_0x23836a[_0x7d96('0x5f')];queues[_0x23836a[_0x7d96('0x53')]][_0x7d96('0xb')]=_0x7d96('0x58');}if(!_[_0x7d96('0x1a')](queues[_0x23836a[_0x7d96('0x54')]])){if(_0x23836a[_0x7d96('0x62')]&&queues[_0x23836a[_0x7d96('0x62')]]){queues[_0x23836a[_0x7d96('0x62')]][_0x7d96('0x21')]=0x1;queues[_0x23836a[_0x7d96('0x5b')]]=_[_0x7d96('0x5a')](queues[_0x23836a[_0x7d96('0x62')]]);queues[_0x23836a['transfertargetuniqueid']][_0x7d96('0x11')]=_0x23836a[_0x7d96('0x5b')];queues[_0x23836a[_0x7d96('0x5b')]]['queuecallerenterreason']=0x2;queues[_0x23836a['transfertargetuniqueid']][_0x7d96('0x9')]=queues[_0x23836a[_0x7d96('0x53')]][_0x7d96('0x9')];queues[_0x23836a[_0x7d96('0x5b')]][_0x7d96('0x5c')]=queues[_0x23836a[_0x7d96('0x53')]][_0x7d96('0x5c')];queues[_0x23836a['transfertargetuniqueid']][_0x7d96('0x63')]=utils['now']();queues[_0x23836a['transfertargetuniqueid']][_0x7d96('0x38')]=utils[_0x7d96('0x18')]();queues[_0x23836a[_0x7d96('0x5b')]][_0x7d96('0x36')]=0x0;queues[_0x23836a['transfertargetuniqueid']][_0x7d96('0x5d')]=0x0;utils[_0x7d96('0x3')](util['format'](_0x7d96('0x64'),_0x23836a['origtransfereruniqueid'],queues[_0x23836a[_0x7d96('0x5b')]][_0x7d96('0x2b')],queues[_0x23836a[_0x7d96('0x5b')]]['transfereduniqueid'],queues[_0x23836a['transfertargetuniqueid']][_0x7d96('0x9')],queues[_0x23836a[_0x7d96('0x5b')]][_0x7d96('0x5c')]));}else{utils[_0x7d96('0x3')](util[_0x7d96('0x4')](_0x7d96('0x5e'),_0x23836a['origtransfereruniqueid'],queues[_0x23836a[_0x7d96('0x54')]][_0x7d96('0x2b')],_0x23836a[_0x7d96('0x53')]));queues[_0x23836a['secondtransfererlinkedid']]['transfereduniqueid']=_0x23836a[_0x7d96('0x53')];}}}}catch(_0x4a4565){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x51'),_0x23836a['origtransfereruniqueid']),_0x4a4565);}};exports[_0x7d96('0x65')]=function(_0x2e329e){try{if(!_[_0x7d96('0x1a')](queues[_0x2e329e['uniqueid']])){utils[_0x7d96('0x13')](util[_0x7d96('0x4')]('[%s][queues][musiconholdstart]',_0x2e329e['uniqueid']),_0x2e329e);queues[_0x2e329e[_0x7d96('0x6')]][_0x7d96('0x66')]=utils['now']();utils[_0x7d96('0x3')](util['format'](_0x7d96('0x67'),_0x2e329e['uniqueid'],queues[_0x2e329e[_0x7d96('0x6')]][_0x7d96('0x2b')],queues[_0x2e329e[_0x7d96('0x6')]][_0x7d96('0x66')]));}}catch(_0x1eed31){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x68'),_0x2e329e['uniqueid']),_0x1eed31);}};exports['musiconholdstop']=function(_0x5a4370){try{if(!_['isNil'](queues[_0x5a4370[_0x7d96('0x6')]])){if(!_[_0x7d96('0x1a')](queues[_0x5a4370[_0x7d96('0x6')]][_0x7d96('0x66')])){utils['debug'](util['format'](_0x7d96('0x69'),_0x5a4370[_0x7d96('0x6')]),_0x5a4370);queues[_0x5a4370['uniqueid']][_0x7d96('0x5d')]+=utils[_0x7d96('0x37')](utils['now'](),queues[_0x5a4370['uniqueid']]['musiconholdstartAt']);utils[_0x7d96('0x3')](util[_0x7d96('0x4')](_0x7d96('0x6a'),_0x5a4370[_0x7d96('0x6')],queues[_0x5a4370[_0x7d96('0x6')]]['name'],queues[_0x5a4370[_0x7d96('0x6')]][_0x7d96('0x5d')]));delete queues[_0x5a4370[_0x7d96('0x6')]][_0x7d96('0x66')];}}}catch(_0x1b173e){utils[_0x7d96('0x19')](util[_0x7d96('0x4')](_0x7d96('0x69'),_0x5a4370[_0x7d96('0x6')]),_0x1b173e);}}; \ No newline at end of file +var _0xf489=['uniqueid','channel','queue','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercompleteAt','now','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','accountcode','destaccountcode','lastAssignedTo','membername','queuecallercomplete','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf489,0xce));var _0x9f48=function(_0x25a7ba,_0x464f6a){_0x25a7ba=_0x25a7ba-0x0;var _0x360415=_0xf489[_0x25a7ba];return _0x360415;};'use strict';var _=require('lodash');var util=require(_0x9f48('0x0'));var utils=require(_0x9f48('0x1'));var queues={};function writeDB(_0x3217f5){utils['info'](util[_0x9f48('0x2')](_0x9f48('0x3'),_0x3217f5[_0x9f48('0x4')],_0x3217f5[_0x9f48('0x5')],_0x3217f5[_0x9f48('0x6')],_0x3217f5['lastAssignedTo'],_0x3217f5[_0x9f48('0x7')],_0x3217f5['accountcode'],_0x3217f5[_0x9f48('0x8')]));if(_0x3217f5[_0x9f48('0x6')]){utils[_0x9f48('0x9')](_0x3217f5['queue'])[_0x9f48('0xa')](function(_0x1c3d10){if(_0x1c3d10){_0x3217f5[_0x9f48('0xb')]=_0x1c3d10[_0x9f48('0xb')];}utils['request'](_0x9f48('0xc'),_0x3217f5);});}else{utils['request']('CreateVoiceQueueReport',_0x3217f5);}if(_0x3217f5[_0x9f48('0xd')]){delete queues[_0x3217f5['transfereduniqueid']];}else{delete queues[_0x3217f5[_0x9f48('0x4')]];}}exports[_0x9f48('0xe')]=function(_0x58512e){try{utils[_0x9f48('0xf')](util[_0x9f48('0x2')](_0x9f48('0x10'),_0x58512e[_0x9f48('0x4')]),_0x58512e);utils[_0x9f48('0x11')](util[_0x9f48('0x2')](_0x9f48('0x12'),_0x58512e[_0x9f48('0x4')],_0x58512e[_0x9f48('0x6')],_0x58512e[_0x9f48('0x13')]));queues[_0x58512e[_0x9f48('0x4')]]=_[_0x9f48('0x14')](_0x58512e,{'originalposition':_0x58512e[_0x9f48('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x5953c0){utils[_0x9f48('0x15')](util[_0x9f48('0x2')](_0x9f48('0x10'),_0x58512e[_0x9f48('0x4')]),_0x5953c0);}};exports[_0x9f48('0x16')]=function(_0x413e9a){try{if(!_[_0x9f48('0x17')](queues[_0x413e9a['uniqueid']])){utils['debug'](util['format'](_0x9f48('0x18'),_0x413e9a[_0x9f48('0x4')]),_0x413e9a);if(queues[_0x413e9a[_0x9f48('0x4')]][_0x9f48('0x19')]){if(!queues[_0x413e9a[_0x9f48('0x4')]]['queuecallerabandon']&&!queues[_0x413e9a[_0x9f48('0x4')]]['queuecallerexit']){queues[_0x413e9a[_0x9f48('0x4')]]['queuecallercomplete']=!![];queues[_0x413e9a['uniqueid']][_0x9f48('0x1a')]=utils[_0x9f48('0x1b')]();queues[_0x413e9a[_0x9f48('0x4')]][_0x9f48('0x8')]='COMPLETEDBYAGENT';}utils['info'](util[_0x9f48('0x2')](_0x9f48('0x1c'),_0x413e9a[_0x9f48('0x4')],queues[_0x413e9a['uniqueid']][_0x9f48('0x1d')],queues[_0x413e9a['uniqueid']][_0x9f48('0x8')]));writeDB(queues[_0x413e9a['uniqueid']]);}else if(queues[_0x413e9a['uniqueid']][_0x9f48('0xd')]){utils[_0x9f48('0x11')](util['format'](_0x9f48('0x1e'),_0x413e9a[_0x9f48('0x4')],queues[_0x413e9a[_0x9f48('0x4')]][_0x9f48('0x1d')],queues[_0x413e9a[_0x9f48('0x4')]][_0x9f48('0xd')]));queues[queues[_0x413e9a[_0x9f48('0x4')]][_0x9f48('0xd')]]=queues[_0x413e9a[_0x9f48('0x4')]];queues[queues[_0x413e9a[_0x9f48('0x4')]]['transfereduniqueid']][_0x9f48('0x1f')]=0x2;delete queues[_0x413e9a['uniqueid']];}}}catch(_0x5f123b){utils[_0x9f48('0x15')](util[_0x9f48('0x2')](_0x9f48('0x18'),_0x413e9a[_0x9f48('0x4')]),_0x5f123b);}};exports[_0x9f48('0x20')]=function(_0x44a8d9){try{utils[_0x9f48('0xf')](util[_0x9f48('0x2')]('[%s][queues][varset]',_0x44a8d9[_0x9f48('0x4')]),_0x44a8d9);if(!_[_0x9f48('0x17')](_0x44a8d9['variable'][_0x9f48('0x21')])&&_0x44a8d9[_0x9f48('0x22')][_0x9f48('0x23')]()!==_0x9f48('0x24')){if(!_['isNil'](queues[_0x44a8d9[_0x9f48('0x4')]])){queues[_0x44a8d9[_0x9f48('0x4')]]['queuecallerabandon']=![];queues[_0x44a8d9[_0x9f48('0x4')]]['queuecallerabandonAt']=null;queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x25')]=!![];queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x26')]=utils[_0x9f48('0x1b')]();queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x8')]=_0x44a8d9[_0x9f48('0x22')][_0x9f48('0x23')]();utils[_0x9f48('0x11')](util[_0x9f48('0x2')](_0x9f48('0x27'),_0x44a8d9['uniqueid'],queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x1d')],_0x44a8d9[_0x9f48('0x22')],queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x8')]));writeDB(queues[_0x44a8d9['uniqueid']]);}}else if(!_[_0x9f48('0x17')](_0x44a8d9['variable'][_0x9f48('0x28')])){if(!_[_0x9f48('0x17')](queues[_0x44a8d9[_0x9f48('0x4')]])&&!queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x29')]){queues[_0x44a8d9[_0x9f48('0x4')]]['queuecallerabandon']=![];queues[_0x44a8d9['uniqueid']]['queuecallerabandonAt']=null;queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x25')]=!![];queues[_0x44a8d9['uniqueid']]['queuecallerexitAt']=utils[_0x9f48('0x1b')]();queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x8')]=_0x9f48('0x2a');utils['info'](util[_0x9f48('0x2')](_0x9f48('0x2b'),_0x44a8d9[_0x9f48('0x4')],queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x1d')],_0x44a8d9[_0x9f48('0x22')],queues[_0x44a8d9[_0x9f48('0x4')]][_0x9f48('0x8')]));}}}catch(_0x307368){utils['error'](util[_0x9f48('0x2')](_0x9f48('0x2c'),_0x44a8d9['uniqueid']),_0x307368);}};exports[_0x9f48('0x29')]=function(_0x6985a4){try{if(!_[_0x9f48('0x17')](queues[_0x6985a4[_0x9f48('0x4')]])){utils[_0x9f48('0xf')](util[_0x9f48('0x2')](_0x9f48('0x2d'),_0x6985a4[_0x9f48('0x4')]),_0x6985a4);queues[_0x6985a4['uniqueid']][_0x9f48('0x25')]=![];queues[_0x6985a4[_0x9f48('0x4')]][_0x9f48('0x26')]=null;queues[_0x6985a4[_0x9f48('0x4')]][_0x9f48('0x29')]=!![];queues[_0x6985a4[_0x9f48('0x4')]][_0x9f48('0x2e')]=utils[_0x9f48('0x1b')]();queues[_0x6985a4['uniqueid']][_0x9f48('0x8')]=_0x9f48('0x2f');utils['info'](util['format'](_0x9f48('0x30'),_0x6985a4[_0x9f48('0x4')],queues[_0x6985a4[_0x9f48('0x4')]]['name'],queues[_0x6985a4[_0x9f48('0x4')]][_0x9f48('0x8')]));}}catch(_0x48f28f){utils['error'](util[_0x9f48('0x2')](_0x9f48('0x2d'),_0x6985a4[_0x9f48('0x4')]),_0x48f28f);}};exports[_0x9f48('0x31')]=function(_0x5090ed){try{if(!_['isNil'](queues[_0x5090ed['uniqueid']])){utils['debug'](util[_0x9f48('0x2')](_0x9f48('0x32'),_0x5090ed['uniqueid']),_0x5090ed);utils['info'](util[_0x9f48('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5090ed[_0x9f48('0x4')],queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x1d')],_0x5090ed[_0x9f48('0x33')],_0x5090ed[_0x9f48('0x34')]));queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x31')]=!![];queues[_0x5090ed[_0x9f48('0x4')]]['queuecallerleaveAt']=utils['now']();queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x35')]=utils[_0x9f48('0x36')](queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x19')],queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x37')]);queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x13')]=_0x5090ed[_0x9f48('0x13')];queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x38')]=_0x5090ed['count'];queues[_0x5090ed['uniqueid']]['connectedlinenum']=_0x5090ed['connectedlinenum'];queues[_0x5090ed[_0x9f48('0x4')]][_0x9f48('0x34')]=_0x5090ed[_0x9f48('0x34')];}}catch(_0x1d749d){utils['error'](util[_0x9f48('0x2')](_0x9f48('0x32'),_0x5090ed[_0x9f48('0x4')]),_0x1d749d);}};exports[_0x9f48('0x39')]=function(_0x5accd3){try{if(!_[_0x9f48('0x17')](queues[_0x5accd3[_0x9f48('0x4')]])){utils[_0x9f48('0xf')](util['format'](_0x9f48('0x3a'),_0x5accd3[_0x9f48('0x4')]),_0x5accd3);utils['info'](util[_0x9f48('0x2')](_0x9f48('0x3b'),_0x5accd3[_0x9f48('0x4')],queues[_0x5accd3[_0x9f48('0x4')]][_0x9f48('0x1d')],_0x5accd3['membername'],_0x5accd3['destaccountcode']));queues[_0x5accd3[_0x9f48('0x4')]][_0x9f48('0x29')]=![];queues[_0x5accd3[_0x9f48('0x4')]][_0x9f48('0x29')]=![];queues[_0x5accd3['uniqueid']][_0x9f48('0x2e')]=null;queues[_0x5accd3[_0x9f48('0x4')]][_0x9f48('0x25')]=![];queues[_0x5accd3[_0x9f48('0x4')]][_0x9f48('0x8')]=null;queues[_0x5accd3[_0x9f48('0x4')]]['queuecallerexitAt']=null;queues[_0x5accd3[_0x9f48('0x4')]]['assigned']=!![];queues[_0x5accd3[_0x9f48('0x4')]][_0x9f48('0x3c')]=_0x5accd3[_0x9f48('0x3d')];queues[_0x5accd3[_0x9f48('0x4')]][_0x9f48('0x3e')]=_0x5accd3['membername'];}}catch(_0x233b3b){utils['error'](util['format']('[%s][queues][agentconnect]',_0x5accd3[_0x9f48('0x4')]),_0x233b3b);}};exports['agentcomplete']=function(_0x5e2f8e){try{if(!_[_0x9f48('0x17')](queues[_0x5e2f8e[_0x9f48('0x4')]])){if(queues[_0x5e2f8e['uniqueid']][_0x9f48('0x19')]){utils['debug'](util[_0x9f48('0x2')]('[%s][queues][agentcomplete]',_0x5e2f8e[_0x9f48('0x4')]),_0x5e2f8e);queues[_0x5e2f8e['uniqueid']][_0x9f48('0x29')]=![];queues[_0x5e2f8e[_0x9f48('0x4')]][_0x9f48('0x29')]=![];queues[_0x5e2f8e['uniqueid']][_0x9f48('0x2e')]=null;queues[_0x5e2f8e['uniqueid']]['queuecallerexit']=![];queues[_0x5e2f8e[_0x9f48('0x4')]][_0x9f48('0x26')]=null;queues[_0x5e2f8e['uniqueid']]['assigned']=!![];queues[_0x5e2f8e[_0x9f48('0x4')]][_0x9f48('0x3e')]=_0x5e2f8e[_0x9f48('0x3f')];queues[_0x5e2f8e[_0x9f48('0x4')]][_0x9f48('0x40')]=!![];queues[_0x5e2f8e['uniqueid']]['queuecallercompleteAt']=utils[_0x9f48('0x1b')]();if(_0x5e2f8e['reason']=='transfer'){if(!queues[_0x5e2f8e['uniqueid']][_0x9f48('0x41')]){queues[_0x5e2f8e['uniqueid']][_0x9f48('0x8')]=_0x9f48('0x42');}}else{queues[_0x5e2f8e[_0x9f48('0x4')]][_0x9f48('0x8')]=_0x9f48('0x43')+_0x5e2f8e[_0x9f48('0x44')][_0x9f48('0x23')]();}utils[_0x9f48('0x11')](util['format'](_0x9f48('0x45'),_0x5e2f8e[_0x9f48('0x4')],queues[_0x5e2f8e[_0x9f48('0x4')]]['name'],_0x5e2f8e[_0x9f48('0x3f')],queues[_0x5e2f8e[_0x9f48('0x4')]][_0x9f48('0x8')]));writeDB(queues[_0x5e2f8e[_0x9f48('0x4')]]);}}}catch(_0x500612){utils['error'](util['format'](_0x9f48('0x46'),_0x5e2f8e[_0x9f48('0x4')]),_0x500612);}};exports[_0x9f48('0x47')]=function(_0x30fff8){try{if(!_[_0x9f48('0x17')](queues[_0x30fff8[_0x9f48('0x48')]])){utils[_0x9f48('0xf')](util['format'](_0x9f48('0x49'),_0x30fff8[_0x9f48('0x4')]),_0x30fff8);queues[_0x30fff8[_0x9f48('0x48')]]['transfer']=!![];queues[_0x30fff8[_0x9f48('0x48')]]['transfertype']=_0x9f48('0x4a');queues[_0x30fff8[_0x9f48('0x48')]][_0x9f48('0x4b')]=_0x30fff8[_0x9f48('0x4c')];queues[_0x30fff8['transfereeuniqueid']]['transferuniqueid']=_0x30fff8[_0x9f48('0x48')];queues[_0x30fff8['transfereeuniqueid']][_0x9f48('0x8')]='BLINDTRANSFER';utils['info'](util[_0x9f48('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x30fff8[_0x9f48('0x4')],queues[_0x30fff8[_0x9f48('0x48')]]['name'],_0x30fff8[_0x9f48('0x48')],_0x30fff8['extension']));}}catch(_0x1650c0){utils[_0x9f48('0x15')](util[_0x9f48('0x2')](_0x9f48('0x49'),_0x30fff8[_0x9f48('0x4')]),_0x1650c0);}};exports[_0x9f48('0x4d')]=function(_0x42dabc){try{utils[_0x9f48('0xf')](util[_0x9f48('0x2')]('[%s][queues][attendedtransfer]',_0x42dabc['origtransfereruniqueid']),_0x42dabc);if(_0x42dabc[_0x9f48('0x4e')]==_0x42dabc[_0x9f48('0x4f')]){if(!_['isNil'](queues[_0x42dabc[_0x9f48('0x50')]])){utils[_0x9f48('0x11')](util[_0x9f48('0x2')](_0x9f48('0x51'),_0x42dabc[_0x9f48('0x4e')],queues[_0x42dabc['secondtransfererlinkedid']]['name'],_0x42dabc[_0x9f48('0x52')]));queues[_0x42dabc[_0x9f48('0x50')]]['transfer']=!![];queues[_0x42dabc[_0x9f48('0x50')]][_0x9f48('0x53')]=_0x9f48('0x54');queues[_0x42dabc[_0x9f48('0x50')]][_0x9f48('0x4b')]=_0x42dabc[_0x9f48('0x52')];queues[_0x42dabc[_0x9f48('0x50')]][_0x9f48('0x55')]=_0x42dabc[_0x9f48('0x4e')];queues[_0x42dabc['secondtransfererlinkedid']][_0x9f48('0x8')]=_0x9f48('0x56');}if(!_[_0x9f48('0x17')](queues[_0x42dabc[_0x9f48('0x4f')]])){if(_0x42dabc[_0x9f48('0x57')]&&queues[_0x42dabc['transfereelinkedid']]){queues[_0x42dabc[_0x9f48('0x57')]]['queuecallerenterreason']=0x1;queues[_0x42dabc[_0x9f48('0x48')]]=_['clone'](queues[_0x42dabc['transfereelinkedid']]);queues[_0x42dabc[_0x9f48('0x48')]][_0x9f48('0xd')]=_0x42dabc[_0x9f48('0x58')];queues[_0x42dabc['transfereeuniqueid']][_0x9f48('0x1f')]=0x2;queues[_0x42dabc[_0x9f48('0x48')]][_0x9f48('0x7')]=queues[_0x42dabc['secondtransfererlinkedid']][_0x9f48('0x7')];queues[_0x42dabc['transfereeuniqueid']][_0x9f48('0x59')]=queues[_0x42dabc[_0x9f48('0x50')]]['calleridname'];queues[_0x42dabc['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x9f48('0x1b')]();queues[_0x42dabc[_0x9f48('0x48')]][_0x9f48('0x19')]=utils['now']();queues[_0x42dabc['transfereeuniqueid']]['holdtime']=0x0;queues[_0x42dabc['transfereeuniqueid']][_0x9f48('0x5a')]=0x0;utils['info'](util[_0x9f48('0x2')](_0x9f48('0x5b'),_0x42dabc['origtransfereruniqueid'],queues[_0x42dabc[_0x9f48('0x48')]][_0x9f48('0x1d')],queues[_0x42dabc[_0x9f48('0x48')]][_0x9f48('0x7')],queues[_0x42dabc[_0x9f48('0x48')]][_0x9f48('0x59')]));}else{utils[_0x9f48('0x11')](util[_0x9f48('0x2')](_0x9f48('0x5c'),_0x42dabc['origtransfereruniqueid'],queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0x1d')],_0x42dabc['secondtransfererlinkedid']));queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0xd')]=_0x42dabc['secondtransfererlinkedid'];}}}else if(_0x42dabc[_0x9f48('0x5d')]==_0x42dabc['secondtransfererlinkedid']){if(!_[_0x9f48('0x17')](queues[_0x42dabc[_0x9f48('0x4f')]])){utils[_0x9f48('0x11')](util[_0x9f48('0x2')](_0x9f48('0x5e'),_0x42dabc[_0x9f48('0x4e')],queues[_0x42dabc['origtransfererlinkedid']][_0x9f48('0x1d')],_0x42dabc['secondtransfereruniqueid'],_0x42dabc[_0x9f48('0x5f')]));queues[_0x42dabc[_0x9f48('0x4f')]]['transfer']=!![];queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0x53')]=_0x9f48('0x54');queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0x4b')]=_0x42dabc['secondtransfererexten'];queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0x55')]=_0x42dabc['secondtransfereruniqueid'];queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0x8')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x42dabc['secondtransfererlinkedid']])){if(_0x42dabc[_0x9f48('0x60')]&&queues[_0x42dabc[_0x9f48('0x60')]]){queues[_0x42dabc[_0x9f48('0x60')]]['queuecallerenterreason']=0x1;queues[_0x42dabc[_0x9f48('0x58')]]=_[_0x9f48('0x61')](queues[_0x42dabc[_0x9f48('0x60')]]);queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0xd')]=_0x42dabc[_0x9f48('0x58')];queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x1f')]=0x2;queues[_0x42dabc[_0x9f48('0x58')]]['calleridnum']=queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0x7')];queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x59')]=queues[_0x42dabc[_0x9f48('0x4f')]][_0x9f48('0x59')];queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x37')]=utils[_0x9f48('0x1b')]();queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x19')]=utils[_0x9f48('0x1b')]();queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x35')]=0x0;queues[_0x42dabc[_0x9f48('0x58')]]['mohtime']=0x0;utils[_0x9f48('0x11')](util['format'](_0x9f48('0x62'),_0x42dabc[_0x9f48('0x4e')],queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x1d')],queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0xd')],queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x7')],queues[_0x42dabc[_0x9f48('0x58')]][_0x9f48('0x59')]));}else{utils['info'](util[_0x9f48('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x42dabc['origtransfereruniqueid'],queues[_0x42dabc['secondtransfererlinkedid']][_0x9f48('0x1d')],_0x42dabc[_0x9f48('0x4f')]));queues[_0x42dabc[_0x9f48('0x50')]][_0x9f48('0xd')]=_0x42dabc[_0x9f48('0x4f')];}}}}catch(_0x1e719d){utils[_0x9f48('0x15')](util[_0x9f48('0x2')](_0x9f48('0x63'),_0x42dabc[_0x9f48('0x4e')]),_0x1e719d);}};exports[_0x9f48('0x64')]=function(_0x116b18){try{if(!_[_0x9f48('0x17')](queues[_0x116b18[_0x9f48('0x4')]])){utils[_0x9f48('0xf')](util[_0x9f48('0x2')]('[%s][queues][musiconholdstart]',_0x116b18[_0x9f48('0x4')]),_0x116b18);queues[_0x116b18[_0x9f48('0x4')]][_0x9f48('0x65')]=utils[_0x9f48('0x1b')]();utils[_0x9f48('0x11')](util[_0x9f48('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x116b18[_0x9f48('0x4')],queues[_0x116b18[_0x9f48('0x4')]][_0x9f48('0x1d')],queues[_0x116b18['uniqueid']]['musiconholdstartAt']));}}catch(_0x442dd9){utils[_0x9f48('0x15')](util[_0x9f48('0x2')]('[%s][queues][musiconholdstart]',_0x116b18[_0x9f48('0x4')]),_0x442dd9);}};exports[_0x9f48('0x66')]=function(_0x423363){try{if(!_[_0x9f48('0x17')](queues[_0x423363[_0x9f48('0x4')]])){if(!_[_0x9f48('0x17')](queues[_0x423363[_0x9f48('0x4')]][_0x9f48('0x65')])){utils[_0x9f48('0xf')](util[_0x9f48('0x2')](_0x9f48('0x67'),_0x423363[_0x9f48('0x4')]),_0x423363);queues[_0x423363[_0x9f48('0x4')]][_0x9f48('0x5a')]+=utils[_0x9f48('0x36')](utils[_0x9f48('0x1b')](),queues[_0x423363[_0x9f48('0x4')]][_0x9f48('0x65')]);utils['info'](util['format'](_0x9f48('0x68'),_0x423363[_0x9f48('0x4')],queues[_0x423363[_0x9f48('0x4')]][_0x9f48('0x1d')],queues[_0x423363[_0x9f48('0x4')]][_0x9f48('0x5a')]));delete queues[_0x423363[_0x9f48('0x4')]][_0x9f48('0x65')];}}}catch(_0x173f1a){utils[_0x9f48('0x15')](util[_0x9f48('0x2')](_0x9f48('0x67'),_0x423363[_0x9f48('0x4')]),_0x173f1a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 00acf1f..2dff036 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 _0x4c70=['cause-txt','connectedlinenum','connectedlinename','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','util','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','accountcode','then','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname'];(function(_0x28e6aa,_0x5ee9c2){var _0x368c53=function(_0x6ebf01){while(--_0x6ebf01){_0x28e6aa['push'](_0x28e6aa['shift']());}};_0x368c53(++_0x5ee9c2);}(_0x4c70,0x1bc));var _0x04c7=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0x4c70[_0x4382bc];return _0x13c82a;};'use strict';var _=require('lodash');var util=require(_0x04c7('0x0'));var utils=require('./utils');var transfers=require(_0x04c7('0x1'));var recordings={};function writeDB(_0x1b44c1){var _0x3708cf;utils[_0x04c7('0x2')](util[_0x04c7('0x3')](_0x04c7('0x4'),_0x1b44c1['uniqueid']));if(transfers[_0x04c7('0x5')][_0x1b44c1[_0x04c7('0x6')]]){_0x3708cf=_0x1b44c1[_0x04c7('0x6')];_0x1b44c1[_0x04c7('0x6')]=transfers[_0x04c7('0x5')][_0x1b44c1['uniqueid']]['transfereeuniqueid'];}if(_0x1b44c1[_0x04c7('0x7')]){utils['getUserByInternal'](_0x1b44c1[_0x04c7('0x7')])[_0x04c7('0x8')](function(_0x1dba07){if(_0x1dba07){_0x1b44c1['membername']=_0x1dba07[_0x04c7('0x9')];_0x1b44c1[_0x04c7('0xa')]=_0x1dba07['id'];}utils['request'](_0x04c7('0xb'),_0x1b44c1);});}else{utils[_0x04c7('0xc')](_0x04c7('0xb'),_0x1b44c1);}if(_0x3708cf)delete transfers[_0x04c7('0x5')][_0x3708cf];}exports[_0x04c7('0xd')]=function(_0x3c9fef){try{utils[_0x04c7('0xe')](util[_0x04c7('0x3')](_0x04c7('0xf'),_0x3c9fef[_0x04c7('0x6')]),_0x3c9fef);if(_0x3c9fef[_0x04c7('0x6')]==_0x3c9fef[_0x04c7('0x10')]){utils[_0x04c7('0x2')](util[_0x04c7('0x3')](_0x04c7('0x11'),_0x3c9fef[_0x04c7('0x6')],_0x3c9fef[_0x04c7('0x12')],_0x3c9fef['exten']));recordings[_0x3c9fef[_0x04c7('0x6')]]={'uniqueid':_0x3c9fef[_0x04c7('0x6')],'accountcode':_0x3c9fef['accountcode'],'exten':_0x3c9fef['exten'],'context':_0x3c9fef[_0x04c7('0x12')],'channel':_0x3c9fef[_0x04c7('0x13')],'monitors':[]};}}catch(_0x226558){utils[_0x04c7('0x14')](util[_0x04c7('0x3')](_0x04c7('0xf'),_0x3c9fef[_0x04c7('0x6')]),_0x226558);}};exports[_0x04c7('0x15')]=function(_0xdebb){try{utils[_0x04c7('0xe')](util[_0x04c7('0x3')](_0x04c7('0x16'),_0xdebb[_0x04c7('0x6')]),_0xdebb);if(!_[_0x04c7('0x17')](recordings[_0xdebb['uniqueid']])&&_0xdebb[_0x04c7('0x18')]==0x6){utils[_0x04c7('0x2')](util['format'](_0x04c7('0x19'),_0xdebb['uniqueid'],_0xdebb[_0x04c7('0x12')],_0xdebb[_0x04c7('0x13')]));}else if(!_[_0x04c7('0x17')](recordings[_0xdebb['linkedid']])&&_0xdebb[_0x04c7('0x18')]==0x6&&_0xdebb['context']!=_0x04c7('0x1a')){utils[_0x04c7('0x2')](util[_0x04c7('0x3')](_0x04c7('0x1b'),_0xdebb[_0x04c7('0x6')],_0xdebb[_0x04c7('0x10')],_0xdebb['context'],_0xdebb['channel']));recordings[_0xdebb[_0x04c7('0x10')]]['accountcode']=_0xdebb[_0x04c7('0x7')];}}catch(_0x54dd9b){utils[_0x04c7('0x14')](util[_0x04c7('0x3')](_0x04c7('0x16'),_0xdebb[_0x04c7('0x6')]),_0x54dd9b);}};exports[_0x04c7('0x1c')]=function(_0x57e321){try{if(!_[_0x04c7('0x17')](_0x57e321['variable'])&&!_['isNil'](_0x57e321[_0x04c7('0x1d')][_0x04c7('0x1e')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x57e321[_0x04c7('0x6')]),_0x57e321);utils[_0x04c7('0x2')](util[_0x04c7('0x3')](_0x04c7('0x1f'),_0x57e321[_0x04c7('0x6')],_0x57e321['variable'],_0x57e321['value']));if(_[_0x04c7('0x20')](_0x57e321[_0x04c7('0x21')],'.wav49')){_0x57e321['value']=_0x57e321[_0x04c7('0x21')][_0x04c7('0x22')](_0x04c7('0x23'),_0x04c7('0x24'));}if(recordings[_0x57e321[_0x04c7('0x10')]]){var _0x4aba71=_[_0x04c7('0x25')](recordings[_0x57e321['linkedid']][_0x04c7('0x26')],{'value':_0x57e321[_0x04c7('0x21')]});if(_['isNil'](_0x4aba71)){recordings[_0x57e321['linkedid']][_0x04c7('0x26')][_0x04c7('0x27')]({'value':_0x57e321[_0x04c7('0x21')]});}}}}catch(_0x2b893b){utils[_0x04c7('0x14')](util[_0x04c7('0x3')](_0x04c7('0x28'),_0x57e321[_0x04c7('0x6')]),_0x2b893b);}};exports[_0x04c7('0x29')]=function(_0x174a7c){try{if(!_[_0x04c7('0x17')](recordings[_0x174a7c[_0x04c7('0x6')]])){utils['debug'](util['format'](_0x04c7('0x2a'),_0x174a7c[_0x04c7('0x6')]),_0x174a7c);utils['info'](util[_0x04c7('0x3')](_0x04c7('0x2b'),_0x174a7c['uniqueid'],_0x174a7c[_0x04c7('0x2c')],_0x174a7c[_0x04c7('0x2d')],_0x174a7c[_0x04c7('0x2e')]));recordings[_0x174a7c[_0x04c7('0x6')]][_0x04c7('0x2c')]=_0x174a7c[_0x04c7('0x2c')];recordings[_0x174a7c[_0x04c7('0x6')]]['calleridname']=_0x174a7c[_0x04c7('0x2d')];recordings[_0x174a7c[_0x04c7('0x6')]]['connectedlinenum']=_0x174a7c[_0x04c7('0x2f')];recordings[_0x174a7c['uniqueid']][_0x04c7('0x30')]=_0x174a7c[_0x04c7('0x30')];if(recordings[_0x174a7c[_0x04c7('0x6')]]['type']=='outbound'&&recordings[_0x174a7c['uniqueid']]['accountcode']){recordings[_0x174a7c['uniqueid']][_0x04c7('0x2f')]=recordings[_0x174a7c[_0x04c7('0x6')]][_0x04c7('0x7')];recordings[_0x174a7c[_0x04c7('0x6')]][_0x04c7('0x30')]='';}recordings[_0x174a7c[_0x04c7('0x6')]][_0x04c7('0x26')][_0x04c7('0x31')](function(_0x85e281){var _0x56ed9a=_[_0x04c7('0x32')](recordings[_0x174a7c['uniqueid']]);_0x56ed9a['value']=_0x85e281[_0x04c7('0x21')];writeDB(_0x56ed9a);});delete recordings[_0x174a7c['uniqueid']];}}catch(_0x56ed33){utils[_0x04c7('0x14')](util[_0x04c7('0x3')](_0x04c7('0x2a'),_0x174a7c['uniqueid']),_0x56ed33);}};exports['newexten']=function(_0x433dfa){try{if(!_[_0x04c7('0x17')](recordings[_0x433dfa[_0x04c7('0x6')]])){utils['debug'](util[_0x04c7('0x3')](_0x04c7('0x33'),_0x433dfa[_0x04c7('0x6')]),_0x433dfa);utils[_0x04c7('0x2')](util[_0x04c7('0x3')](_0x04c7('0x34'),_0x433dfa['uniqueid'],_0x433dfa[_0x04c7('0x35')],_0x433dfa['appdata']));if(_0x433dfa[_0x04c7('0x35')][_0x04c7('0x36')]()==_0x04c7('0x37')&&_[_0x04c7('0x38')](_0x433dfa[_0x04c7('0x39')]['toLowerCase'](),'cdr')){var _0x40d2af=_0x433dfa[_0x04c7('0x39')]['split']('=');var _0x18880f=_0x40d2af[0x0][_0x04c7('0x3a')](_0x40d2af[0x0][_0x04c7('0x3b')]('(')+0x1,_0x40d2af[0x0][_0x04c7('0x3b')](')'));var _0x32e369=_0x40d2af[0x1];recordings[_0x433dfa[_0x04c7('0x6')]][_0x18880f]=_0x32e369;}}}catch(_0x33b82f){utils[_0x04c7('0x14')](util[_0x04c7('0x3')]('[%s][recordings][newexten]',_0x433dfa[_0x04c7('0x6')]),_0x33b82f);}};exports[_0x04c7('0x3c')]=function(_0x193c4d){try{if(!_[_0x04c7('0x17')](recordings[_0x193c4d[_0x04c7('0x6')]])){utils[_0x04c7('0xe')](util[_0x04c7('0x3')](_0x04c7('0x3d'),_0x193c4d['uniqueid']),_0x193c4d);utils[_0x04c7('0x2')](util[_0x04c7('0x3')](_0x04c7('0x3e'),_0x193c4d['uniqueid'],_0x193c4d['queue']));recordings[_0x193c4d[_0x04c7('0x6')]][_0x04c7('0x3f')]=_0x193c4d[_0x04c7('0x3f')];}}catch(_0x2f76a9){utils[_0x04c7('0x14')](util[_0x04c7('0x3')](_0x04c7('0x3d'),_0x193c4d[_0x04c7('0x6')]),_0x2f76a9);}};exports['blindtransfer']=function(_0x525f7a){try{utils[_0x04c7('0xe')](util['format'](_0x04c7('0x40'),_0x525f7a[_0x04c7('0x6')]),_0x525f7a);utils[_0x04c7('0x2')](util[_0x04c7('0x3')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x525f7a[_0x04c7('0x6')],_0x525f7a[_0x04c7('0x41')],_0x525f7a[_0x04c7('0x42')],_0x525f7a['transfereecalleridnum'],_0x525f7a[_0x04c7('0x43')]));if(recordings[_0x525f7a[_0x04c7('0x44')]]&&transfers['blinds'][_0x525f7a['transfereruniqueid']]){transfers['blinds'][_0x525f7a['transfereruniqueid']][_0x04c7('0x45')]=!![];}}catch(_0x57c7a9){utils['error'](util[_0x04c7('0x3')](_0x04c7('0x40'),_0x525f7a[_0x04c7('0x6')]),_0x57c7a9);}}; \ No newline at end of file +var _0xceea=['transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','uniqueid','blinds','getUserByInternal','accountcode','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','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','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname'];(function(_0x3f288e,_0x8cdada){var _0x271e04=function(_0x28621a){while(--_0x28621a){_0x3f288e['push'](_0x3f288e['shift']());}};_0x271e04(++_0x8cdada);}(_0xceea,0x11a));var _0xacee=function(_0x4d216c,_0x3c8cc6){_0x4d216c=_0x4d216c-0x0;var _0x71baed=_0xceea[_0x4d216c];return _0x71baed;};'use strict';var _=require(_0xacee('0x0'));var util=require(_0xacee('0x1'));var utils=require(_0xacee('0x2'));var transfers=require(_0xacee('0x3'));var recordings={};function writeDB(_0x5e97d5){var _0x56daa1;utils[_0xacee('0x4')](util[_0xacee('0x5')]('[%s][recordings][writeDB]',_0x5e97d5[_0xacee('0x6')]));if(transfers[_0xacee('0x7')][_0x5e97d5[_0xacee('0x6')]]){_0x56daa1=_0x5e97d5[_0xacee('0x6')];_0x5e97d5[_0xacee('0x6')]=transfers[_0xacee('0x7')][_0x5e97d5[_0xacee('0x6')]]['transfereeuniqueid'];}if(_0x5e97d5['accountcode']){utils[_0xacee('0x8')](_0x5e97d5[_0xacee('0x9')])[_0xacee('0xa')](function(_0x137c75){if(_0x137c75){_0x5e97d5[_0xacee('0xb')]=_0x137c75['name'];_0x5e97d5[_0xacee('0xc')]=_0x137c75['id'];}utils[_0xacee('0xd')]('CreateVoiceRecording',_0x5e97d5);});}else{utils[_0xacee('0xd')](_0xacee('0xe'),_0x5e97d5);}if(_0x56daa1)delete transfers[_0xacee('0x7')][_0x56daa1];}exports[_0xacee('0xf')]=function(_0x284c4a){try{utils[_0xacee('0x10')](util[_0xacee('0x5')](_0xacee('0x11'),_0x284c4a[_0xacee('0x6')]),_0x284c4a);if(_0x284c4a[_0xacee('0x6')]==_0x284c4a[_0xacee('0x12')]){utils['info'](util['format'](_0xacee('0x13'),_0x284c4a[_0xacee('0x6')],_0x284c4a['context'],_0x284c4a['exten']));recordings[_0x284c4a[_0xacee('0x6')]]={'uniqueid':_0x284c4a['uniqueid'],'accountcode':_0x284c4a[_0xacee('0x9')],'exten':_0x284c4a[_0xacee('0x14')],'context':_0x284c4a[_0xacee('0x15')],'channel':_0x284c4a[_0xacee('0x16')],'monitors':[]};}}catch(_0x37fd44){utils[_0xacee('0x17')](util[_0xacee('0x5')](_0xacee('0x11'),_0x284c4a['uniqueid']),_0x37fd44);}};exports['newstate']=function(_0x2575df){try{utils['debug'](util[_0xacee('0x5')]('[%s][recordings][newstate]',_0x2575df[_0xacee('0x6')]),_0x2575df);if(!_[_0xacee('0x18')](recordings[_0x2575df[_0xacee('0x6')]])&&_0x2575df[_0xacee('0x19')]==0x6){utils[_0xacee('0x4')](util[_0xacee('0x5')](_0xacee('0x1a'),_0x2575df['uniqueid'],_0x2575df[_0xacee('0x15')],_0x2575df[_0xacee('0x16')]));}else if(!_[_0xacee('0x18')](recordings[_0x2575df['linkedid']])&&_0x2575df['channelstate']==0x6&&_0x2575df[_0xacee('0x15')]!=_0xacee('0x1b')){utils['info'](util[_0xacee('0x5')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2575df[_0xacee('0x6')],_0x2575df[_0xacee('0x12')],_0x2575df[_0xacee('0x15')],_0x2575df[_0xacee('0x16')]));recordings[_0x2575df[_0xacee('0x12')]][_0xacee('0x9')]=_0x2575df[_0xacee('0x9')];}}catch(_0x329be6){utils['error'](util[_0xacee('0x5')]('[%s][recordings][newstate]',_0x2575df[_0xacee('0x6')]),_0x329be6);}};exports[_0xacee('0x1c')]=function(_0x2161c9){try{if(!_['isNil'](_0x2161c9[_0xacee('0x1d')])&&!_[_0xacee('0x18')](_0x2161c9[_0xacee('0x1d')][_0xacee('0x1e')])){utils[_0xacee('0x10')](util[_0xacee('0x5')](_0xacee('0x1f'),_0x2161c9[_0xacee('0x6')]),_0x2161c9);utils[_0xacee('0x4')](util[_0xacee('0x5')](_0xacee('0x20'),_0x2161c9[_0xacee('0x6')],_0x2161c9[_0xacee('0x1d')],_0x2161c9[_0xacee('0x21')]));if(_[_0xacee('0x22')](_0x2161c9[_0xacee('0x21')],_0xacee('0x23'))){_0x2161c9[_0xacee('0x21')]=_0x2161c9[_0xacee('0x21')]['replace'](_0xacee('0x23'),_0xacee('0x24'));}if(recordings[_0x2161c9['linkedid']]){var _0x2bd047=_[_0xacee('0x25')](recordings[_0x2161c9[_0xacee('0x12')]][_0xacee('0x26')],{'value':_0x2161c9[_0xacee('0x21')]});if(_['isNil'](_0x2bd047)){recordings[_0x2161c9[_0xacee('0x12')]][_0xacee('0x26')]['push']({'value':_0x2161c9[_0xacee('0x21')]});}}}}catch(_0x8984a0){utils['error'](util[_0xacee('0x5')](_0xacee('0x1f'),_0x2161c9[_0xacee('0x6')]),_0x8984a0);}};exports[_0xacee('0x27')]=function(_0x4c1f11){try{if(!_['isNil'](recordings[_0x4c1f11[_0xacee('0x6')]])){utils[_0xacee('0x10')](util[_0xacee('0x5')](_0xacee('0x28'),_0x4c1f11[_0xacee('0x6')]),_0x4c1f11);utils['info'](util[_0xacee('0x5')](_0xacee('0x29'),_0x4c1f11[_0xacee('0x6')],_0x4c1f11['calleridnum'],_0x4c1f11[_0xacee('0x2a')],_0x4c1f11['cause-txt']));recordings[_0x4c1f11['uniqueid']]['calleridnum']=_0x4c1f11[_0xacee('0x2b')];recordings[_0x4c1f11[_0xacee('0x6')]][_0xacee('0x2a')]=_0x4c1f11[_0xacee('0x2a')];recordings[_0x4c1f11[_0xacee('0x6')]][_0xacee('0x2c')]=_0x4c1f11[_0xacee('0x2c')];recordings[_0x4c1f11[_0xacee('0x6')]][_0xacee('0x2d')]=_0x4c1f11['connectedlinename'];if(recordings[_0x4c1f11['uniqueid']][_0xacee('0x2e')]==_0xacee('0x2f')&&recordings[_0x4c1f11[_0xacee('0x6')]][_0xacee('0x9')]){recordings[_0x4c1f11[_0xacee('0x6')]][_0xacee('0x2c')]=recordings[_0x4c1f11[_0xacee('0x6')]][_0xacee('0x9')];recordings[_0x4c1f11[_0xacee('0x6')]]['connectedlinename']='';}recordings[_0x4c1f11[_0xacee('0x6')]][_0xacee('0x26')][_0xacee('0x30')](function(_0x2495dc){var _0x1b1097=_['clone'](recordings[_0x4c1f11[_0xacee('0x6')]]);_0x1b1097[_0xacee('0x21')]=_0x2495dc['value'];writeDB(_0x1b1097);});delete recordings[_0x4c1f11['uniqueid']];}}catch(_0x5c128d){utils[_0xacee('0x17')](util[_0xacee('0x5')](_0xacee('0x28'),_0x4c1f11[_0xacee('0x6')]),_0x5c128d);}};exports[_0xacee('0x31')]=function(_0x71a2f1){try{if(!_[_0xacee('0x18')](recordings[_0x71a2f1[_0xacee('0x6')]])){utils[_0xacee('0x10')](util[_0xacee('0x5')](_0xacee('0x32'),_0x71a2f1[_0xacee('0x6')]),_0x71a2f1);utils[_0xacee('0x4')](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x71a2f1[_0xacee('0x6')],_0x71a2f1['application'],_0x71a2f1['appdata']));if(_0x71a2f1[_0xacee('0x33')][_0xacee('0x34')]()==_0xacee('0x35')&&_[_0xacee('0x36')](_0x71a2f1[_0xacee('0x37')]['toLowerCase'](),_0xacee('0x38'))){var _0x506571=_0x71a2f1['appdata']['split']('=');var _0x111531=_0x506571[0x0][_0xacee('0x39')](_0x506571[0x0][_0xacee('0x3a')]('(')+0x1,_0x506571[0x0]['lastIndexOf'](')'));var _0x599448=_0x506571[0x1];recordings[_0x71a2f1[_0xacee('0x6')]][_0x111531]=_0x599448;}}}catch(_0x1f41f6){utils[_0xacee('0x17')](util['format'](_0xacee('0x32'),_0x71a2f1['uniqueid']),_0x1f41f6);}};exports[_0xacee('0x3b')]=function(_0x48e76a){try{if(!_[_0xacee('0x18')](recordings[_0x48e76a[_0xacee('0x6')]])){utils['debug'](util['format'](_0xacee('0x3c'),_0x48e76a[_0xacee('0x6')]),_0x48e76a);utils['info'](util[_0xacee('0x5')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x48e76a[_0xacee('0x6')],_0x48e76a[_0xacee('0x3d')]));recordings[_0x48e76a[_0xacee('0x6')]]['queue']=_0x48e76a['queue'];}}catch(_0x4fae60){utils[_0xacee('0x17')](util[_0xacee('0x5')](_0xacee('0x3c'),_0x48e76a[_0xacee('0x6')]),_0x4fae60);}};exports[_0xacee('0x3e')]=function(_0x33d90a){try{utils[_0xacee('0x10')](util[_0xacee('0x5')](_0xacee('0x3f'),_0x33d90a[_0xacee('0x6')]),_0x33d90a);utils[_0xacee('0x4')](util[_0xacee('0x5')](_0xacee('0x40'),_0x33d90a[_0xacee('0x6')],_0x33d90a[_0xacee('0x41')],_0x33d90a['transferercalleridname'],_0x33d90a[_0xacee('0x42')],_0x33d90a[_0xacee('0x43')]));if(recordings[_0x33d90a['transfereruniqueid']]&&transfers[_0xacee('0x7')][_0x33d90a[_0xacee('0x44')]]){transfers[_0xacee('0x7')][_0x33d90a[_0xacee('0x44')]][_0xacee('0x45')]=!![];}}catch(_0x28ccda){utils[_0xacee('0x17')](util[_0xacee('0x5')](_0xacee('0x3f'),_0x33d90a[_0xacee('0x6')]),_0x28ccda);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2c2c05a..36f2ae2 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 _0xf82d=['secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','debug','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x4a5878,_0x24edf6){var _0x1c07c1=function(_0x40ddfb){while(--_0x40ddfb){_0x4a5878['push'](_0x4a5878['shift']());}};_0x1c07c1(++_0x24edf6);}(_0xf82d,0x1da));var _0xdf82=function(_0xa7a7b0,_0x48425c){_0xa7a7b0=_0xa7a7b0-0x0;var _0xf9060f=_0xf82d[_0xa7a7b0];return _0xf9060f;};'use strict';var _=require(_0xdf82('0x0'));var util=require(_0xdf82('0x1'));var utils=require(_0xdf82('0x2'));function writeDB(_0x45f8bc){utils[_0xdf82('0x3')](util[_0xdf82('0x4')](_0xdf82('0x5'),_0x45f8bc[_0xdf82('0x6')]===_0xdf82('0x7')?_0x45f8bc['origtransfereruniqueid']:_0x45f8bc['uniqueid'],_0x45f8bc[_0xdf82('0x6')]));utils[_0xdf82('0x8')](_0xdf82('0x9'),_0x45f8bc);}exports[_0xdf82('0xa')]={};exports[_0xdf82('0xb')]=function(_0x56e5fe){try{utils['debug'](util['format']('[%s][transfers][blindtransfer]',_0x56e5fe['uniqueid']),_0x56e5fe);utils[_0xdf82('0x3')](util[_0xdf82('0x4')](_0xdf82('0xc'),_0x56e5fe[_0xdf82('0xd')],_0x56e5fe[_0xdf82('0xe')],_0x56e5fe['transferercalleridname'],_0x56e5fe['transfereecalleridnum'],_0x56e5fe['transfereecalleridname']));_0x56e5fe[_0xdf82('0x6')]=_0xdf82('0xf');exports['blinds'][_0x56e5fe[_0xdf82('0x10')]]=_0x56e5fe;writeDB(_0x56e5fe);}catch(_0x234864){utils[_0xdf82('0x11')](util[_0xdf82('0x4')](_0xdf82('0x12'),_0x56e5fe[_0xdf82('0xd')]),_0x234864);}};exports[_0xdf82('0x13')]=function(_0xf0a615){try{utils[_0xdf82('0x14')](util[_0xdf82('0x4')]('[%s][transfers][attendedtransfer]',_0xf0a615[_0xdf82('0x15')]),_0xf0a615);utils[_0xdf82('0x3')](util[_0xdf82('0x4')](_0xdf82('0x16'),_0xf0a615[_0xdf82('0x15')],_0xf0a615['origtransferercalleridnum'],_0xf0a615[_0xdf82('0x17')],_0xf0a615[_0xdf82('0x18')],_0xf0a615['transfertargetcalleridname']));_0xf0a615=_[_0xdf82('0x19')](_0xf0a615,{'transfererchannel':_0xf0a615[_0xdf82('0x1a')],'transferercalleridnum':_0xf0a615['origtransferercalleridnum'],'transferercalleridname':_0xf0a615[_0xdf82('0x17')],'transfererconnectedlinenum':_0xf0a615[_0xdf82('0x1b')],'transfererconnectedlinename':_0xf0a615[_0xdf82('0x1c')],'transfereraccountcode':_0xf0a615[_0xdf82('0x1d')],'transferercontext':_0xf0a615[_0xdf82('0x1e')],'transfererexten':_0xf0a615[_0xdf82('0x1f')],'transfererlinkedid':_0xf0a615['origtransfererlinkedid'],'context':_0xf0a615[_0xdf82('0x20')],'extension':_0xf0a615['origtransfererexten'],'type':_0xdf82('0x7')});if(_[_0xdf82('0x21')](_0xf0a615[_0xdf82('0x22')])){_0xf0a615=_[_0xdf82('0x19')](_0xf0a615,{'transfereechannel':_0xf0a615[_0xdf82('0x23')],'transfereecalleridnum':_0xf0a615['transfertargetcalleridnum'],'transfereecalleridname':_0xf0a615[_0xdf82('0x24')],'transfereeconnectedlinenum':_0xf0a615[_0xdf82('0x25')],'transfereeconnectedlinename':_0xf0a615['transfertargetconnectedlinename'],'transfereeaccountcode':_0xf0a615[_0xdf82('0x26')],'transfereecontext':_0xf0a615[_0xdf82('0x27')],'transfereeexten':_0xf0a615['transfertargetexten'],'transfereelinkedid':_0xf0a615[_0xdf82('0x28')]});}writeDB(_0xf0a615);}catch(_0x4a400e){utils['error'](util[_0xdf82('0x4')](_0xdf82('0x29'),_0xf0a615[_0xdf82('0x15')]),_0x4a400e);}}; \ No newline at end of file +var _0x083a=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','[%s][transfers][attendedtransfer]','lodash','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','error','[%s][transfers][blindtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x3c0276,_0x3e2e1d){var _0x554860=function(_0x55f6ac){while(--_0x55f6ac){_0x3c0276['push'](_0x3c0276['shift']());}};_0x554860(++_0x3e2e1d);}(_0x083a,0x164));var _0xa083=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x083a[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xa083('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x11118b){utils[_0xa083('0x1')](util['format'](_0xa083('0x2'),_0x11118b[_0xa083('0x3')]===_0xa083('0x4')?_0x11118b[_0xa083('0x5')]:_0x11118b[_0xa083('0x6')],_0x11118b[_0xa083('0x3')]));utils[_0xa083('0x7')](_0xa083('0x8'),_0x11118b);}exports[_0xa083('0x9')]={};exports[_0xa083('0xa')]=function(_0x97383){try{utils[_0xa083('0xb')](util[_0xa083('0xc')]('[%s][transfers][blindtransfer]',_0x97383[_0xa083('0x6')]),_0x97383);utils[_0xa083('0x1')](util['format'](_0xa083('0xd'),_0x97383[_0xa083('0x6')],_0x97383[_0xa083('0xe')],_0x97383[_0xa083('0xf')],_0x97383[_0xa083('0x10')],_0x97383['transfereecalleridname']));_0x97383[_0xa083('0x3')]='blind';exports[_0xa083('0x9')][_0x97383['transfereruniqueid']]=_0x97383;writeDB(_0x97383);}catch(_0x320d8d){utils[_0xa083('0x11')](util[_0xa083('0xc')](_0xa083('0x12'),_0x97383[_0xa083('0x6')]),_0x320d8d);}};exports['attendedtransfer']=function(_0x49973f){try{utils[_0xa083('0xb')](util[_0xa083('0xc')]('[%s][transfers][attendedtransfer]',_0x49973f[_0xa083('0x5')]),_0x49973f);utils[_0xa083('0x1')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x49973f[_0xa083('0x5')],_0x49973f[_0xa083('0x13')],_0x49973f[_0xa083('0x14')],_0x49973f[_0xa083('0x15')],_0x49973f['transfertargetcalleridname']));_0x49973f=_['assign'](_0x49973f,{'transfererchannel':_0x49973f[_0xa083('0x16')],'transferercalleridnum':_0x49973f[_0xa083('0x13')],'transferercalleridname':_0x49973f[_0xa083('0x14')],'transfererconnectedlinenum':_0x49973f[_0xa083('0x17')],'transfererconnectedlinename':_0x49973f[_0xa083('0x18')],'transfereraccountcode':_0x49973f[_0xa083('0x19')],'transferercontext':_0x49973f[_0xa083('0x1a')],'transfererexten':_0x49973f[_0xa083('0x1b')],'transfererlinkedid':_0x49973f['origtransfererlinkedid'],'context':_0x49973f[_0xa083('0x1c')],'extension':_0x49973f['origtransfererexten'],'type':'attended'});if(_[_0xa083('0x1d')](_0x49973f['transfereechannel'])){_0x49973f=_[_0xa083('0x1e')](_0x49973f,{'transfereechannel':_0x49973f[_0xa083('0x1f')],'transfereecalleridnum':_0x49973f[_0xa083('0x15')],'transfereecalleridname':_0x49973f[_0xa083('0x20')],'transfereeconnectedlinenum':_0x49973f[_0xa083('0x21')],'transfereeconnectedlinename':_0x49973f[_0xa083('0x22')],'transfereeaccountcode':_0x49973f[_0xa083('0x23')],'transfereecontext':_0x49973f[_0xa083('0x24')],'transfereeexten':_0x49973f[_0xa083('0x25')],'transfereelinkedid':_0x49973f['transfertargetlinkedid']});}writeDB(_0x49973f);}catch(_0x1f84df){utils[_0xa083('0x11')](util['format'](_0xa083('0x26'),_0x49973f[_0xa083('0x5')]),_0x1f84df);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 0aa8218..504acb0 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 _0xc0b8=['seconds','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','now','format','isAfter','isBefore','bluebird','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add'];(function(_0x489829,_0x2f7140){var _0x56ee25=function(_0x250785){while(--_0x250785){_0x489829['push'](_0x489829['shift']());}};_0x56ee25(++_0x2f7140);}(_0xc0b8,0x153));var _0x8c0b=function(_0xcc773f,_0x46cdde){_0xcc773f=_0xcc773f-0x0;var _0x2a2409=_0xc0b8[_0xcc773f];return _0x2a2409;};'use strict';var BPromise=require(_0x8c0b('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x8c0b('0x1'));var client=jayson[_0x8c0b('0x2')][_0x8c0b('0x3')]({'port':0x2329});var logger=require(_0x8c0b('0x4'))(_0x8c0b('0x5'));exports[_0x8c0b('0x6')]=function(_0x5474d3,_0x4c3430){logger[_0x8c0b('0x6')](_0x5474d3,_0x4c3430?util[_0x8c0b('0x7')](_0x4c3430,{'showHidden':![],'depth':null}):'');};exports[_0x8c0b('0x8')]=function(_0x15dc1f,_0x318781){logger[_0x8c0b('0x8')](_0x15dc1f,_0x318781?util[_0x8c0b('0x7')](_0x318781,{'showHidden':![],'depth':null}):'');};exports[_0x8c0b('0x9')]=function(_0x49a634,_0x53f413){logger[_0x8c0b('0x9')](_0x49a634,_0x53f413?util[_0x8c0b('0x7')](_0x53f413,{'showHidden':![],'depth':null}):'');};exports[_0x8c0b('0xa')]=function(_0x351b29,_0x29ade0){return client['request'](_0x351b29,{'body':_0x29ade0})[_0x8c0b('0xb')](function(_0x320ff3){logger['debug']('[utils][request]\x20name:%s',_0x351b29,_0x320ff3?util[_0x8c0b('0x7')](_0x320ff3,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x51f8a6){logger[_0x8c0b('0x9')]('[utils][request]\x20name:%s',_0x351b29,_0x51f8a6?util[_0x8c0b('0x7')](_0x51f8a6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x6cbc7f){return client[_0x8c0b('0xa')](_0x8c0b('0xc'),{'options':{'raw':!![],'attributes':['id',_0x8c0b('0xd'),_0x8c0b('0xe'),_0x8c0b('0xf')],'where':_0x6cbc7f,'limit':0x1}})[_0x8c0b('0xb')](function(_0xdc0a41){logger[_0x8c0b('0x8')](_0x8c0b('0x10'),JSON['stringify'](_0x6cbc7f),_0xdc0a41?util[_0x8c0b('0x7')](_0xdc0a41,{'showHidden':![],'depth':null}):'');return _0xdc0a41[_0x8c0b('0x11')][_0x8c0b('0x12')]?_0xdc0a41[_0x8c0b('0x11')][0x0]:null;});}exports[_0x8c0b('0x13')]=function(_0x31ffce){return new BPromise(function(_0x143315,_0x55ff53){if(_0x31ffce){return getUser({'internal':_0x31ffce})[_0x8c0b('0xb')](function(_0x3236f5){logger['info'](_0x8c0b('0x14'),_0x31ffce,_0x3236f5?_0x8c0b('0x15'):_0x8c0b('0x16'));return _0x143315(_0x3236f5);})[_0x8c0b('0x17')](function(_0x5c3200){logger['error'](_0x8c0b('0x18'),_0x5c3200?util[_0x8c0b('0x7')](_0x5c3200,{'showHidden':![],'depth':null}):'');return _0x143315(null);});}return _0x143315(null);});};exports['getUserByInterface']=function(_0x306ec2){return new BPromise(function(_0x16d8d2,_0x1f8be7){if(_0x306ec2){return getUser({'interface':_0x306ec2})[_0x8c0b('0xb')](function(_0xb9b810){logger['info'](_0x8c0b('0x19'),_0x306ec2,_0xb9b810?_0x8c0b('0x15'):_0x8c0b('0x16'));return _0x16d8d2(_0xb9b810);})['catch'](function(_0x4a381a){logger[_0x8c0b('0x9')](_0x8c0b('0x1a'),_0x4a381a?util[_0x8c0b('0x7')](_0x4a381a,{'showHidden':![],'depth':null}):'');return _0x16d8d2(null);});}return _0x16d8d2(null);});};exports[_0x8c0b('0x1b')]=function(_0x3d5a35){return new BPromise(function(_0x22df5c,_0x13dda7){if(_0x3d5a35){return getUser({'name':_0x3d5a35})[_0x8c0b('0xb')](function(_0x4a17dd){logger[_0x8c0b('0x6')](_0x8c0b('0x1c'),_0x3d5a35,_0x4a17dd?'found':'notfound');return _0x22df5c(_0x4a17dd);})[_0x8c0b('0x17')](function(_0x5d2ebc){logger[_0x8c0b('0x9')](_0x8c0b('0x1d'),_0x5d2ebc?util['inspect'](_0x5d2ebc,{'showHidden':![],'depth':null}):'');return _0x22df5c(null);});}return _0x22df5c(null);});};exports[_0x8c0b('0x1e')]=function(_0x5d9c0c){return new BPromise(function(_0x467e55,_0xf3f26e){if(_0x5d9c0c){return client['request'](_0x8c0b('0x1f'),{'options':{'raw':!![],'attributes':['id','name','type','acw','acwTimeout'],'where':{'name':_0x5d9c0c},'limit':0x1}})[_0x8c0b('0xb')](function(_0x2b31b7){logger[_0x8c0b('0x8')](_0x8c0b('0x20'),_0x5d9c0c,_0x2b31b7?util['inspect'](_0x2b31b7,{'showHidden':![],'depth':null}):'');logger[_0x8c0b('0x6')](_0x8c0b('0x21'),_0x5d9c0c,_0x2b31b7?_0x8c0b('0x15'):_0x8c0b('0x16'));return _0x467e55(_0x2b31b7['result'][_0x8c0b('0x12')]?_0x2b31b7[_0x8c0b('0x11')][0x0]:null);})[_0x8c0b('0x17')](function(_0x45b796){logger[_0x8c0b('0x9')](_0x8c0b('0x22'),_0x45b796?util[_0x8c0b('0x7')](_0x45b796,{'showHidden':![],'depth':null}):'');return _0x467e55(null);});}return _0x467e55(null);});};exports[_0x8c0b('0x23')]=function(_0x3009eb,_0x26ad94){return moment(_0x3009eb)[_0x8c0b('0x24')](_0x26ad94,_0x8c0b('0x25'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x8c0b('0x26')]=function(_0x4dc042,_0x383a69){return moment(_0x4dc042)[_0x8c0b('0x27')](_0x383a69,_0x8c0b('0x25'))['format'](_0x8c0b('0x28'));};exports[_0x8c0b('0x29')]=function(_0x388574,_0x384f37){return moment(_0x388574)[_0x8c0b('0x2a')](moment(_0x384f37),_0x8c0b('0x25'));};exports['sumTime']=function(_0x1e9191,_0x1c8075){return parseInt(_0x1e9191,0xa)+parseInt(_0x1c8075,0xa);};exports[_0x8c0b('0x2b')]=function(){return moment()[_0x8c0b('0x2c')](_0x8c0b('0x28'));};exports[_0x8c0b('0x2d')]=function(_0x251788,_0x31d08c){if(_0x31d08c){return moment(_0x251788)[_0x8c0b('0x2d')](_0x31d08c);}return!![];};exports[_0x8c0b('0x2e')]=function(_0x27c884,_0x2c90e){if(_0x2c90e){return moment(_0x27c884)['isBefore'](_0x2c90e);}else if(_0x27c884){return!![];}return![];}; \ No newline at end of file +var _0xe574=['result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify'];(function(_0x5f2696,_0x25bb55){var _0x341efd=function(_0x50e3ea){while(--_0x50e3ea){_0x5f2696['push'](_0x5f2696['shift']());}};_0x341efd(++_0x25bb55);}(_0xe574,0x100));var _0x4e57=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe574[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0x4e57('0x0'));var jayson=require('jayson/promise');var moment=require(_0x4e57('0x1'));var util=require(_0x4e57('0x2'));var client=jayson[_0x4e57('0x3')][_0x4e57('0x4')]({'port':0x2329});var logger=require(_0x4e57('0x5'))(_0x4e57('0x6'));exports[_0x4e57('0x7')]=function(_0x44569b,_0x4378ea){logger[_0x4e57('0x7')](_0x44569b,_0x4378ea?util[_0x4e57('0x8')](_0x4378ea,{'showHidden':![],'depth':null}):'');};exports[_0x4e57('0x9')]=function(_0x588b4e,_0x5f0071){logger[_0x4e57('0x9')](_0x588b4e,_0x5f0071?util['inspect'](_0x5f0071,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x846d2f,_0x3371ee){logger[_0x4e57('0xa')](_0x846d2f,_0x3371ee?util[_0x4e57('0x8')](_0x3371ee,{'showHidden':![],'depth':null}):'');};exports[_0x4e57('0xb')]=function(_0x53e34a,_0x251aac){return client[_0x4e57('0xb')](_0x53e34a,{'body':_0x251aac})[_0x4e57('0xc')](function(_0x1e9cf8){logger[_0x4e57('0x9')](_0x4e57('0xd'),_0x53e34a,_0x1e9cf8?util[_0x4e57('0x8')](_0x1e9cf8,{'showHidden':![],'depth':null}):'');})[_0x4e57('0xe')](function(_0xed8cbc){logger[_0x4e57('0xa')](_0x4e57('0xd'),_0x53e34a,_0xed8cbc?util[_0x4e57('0x8')](_0xed8cbc,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1e3361){return client[_0x4e57('0xb')](_0x4e57('0xf'),{'options':{'raw':!![],'attributes':['id',_0x4e57('0x10'),'name',_0x4e57('0x11')],'where':_0x1e3361,'limit':0x1}})['then'](function(_0x254285){logger['debug'](_0x4e57('0x12'),JSON[_0x4e57('0x13')](_0x1e3361),_0x254285?util['inspect'](_0x254285,{'showHidden':![],'depth':null}):'');return _0x254285[_0x4e57('0x14')][_0x4e57('0x15')]?_0x254285[_0x4e57('0x14')][0x0]:null;});}exports[_0x4e57('0x16')]=function(_0x5377cf){return new BPromise(function(_0x2ed980,_0xca7317){if(_0x5377cf){return getUser({'internal':_0x5377cf})[_0x4e57('0xc')](function(_0x29984f){logger[_0x4e57('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x5377cf,_0x29984f?_0x4e57('0x17'):_0x4e57('0x18'));return _0x2ed980(_0x29984f);})[_0x4e57('0xe')](function(_0x43e77f){logger['error'](_0x4e57('0x19'),_0x43e77f?util['inspect'](_0x43e77f,{'showHidden':![],'depth':null}):'');return _0x2ed980(null);});}return _0x2ed980(null);});};exports[_0x4e57('0x1a')]=function(_0x5b6127){return new BPromise(function(_0x4586b3,_0x4251e6){if(_0x5b6127){return getUser({'interface':_0x5b6127})[_0x4e57('0xc')](function(_0x43c9a7){logger[_0x4e57('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x5b6127,_0x43c9a7?'found':_0x4e57('0x18'));return _0x4586b3(_0x43c9a7);})['catch'](function(_0x315f7c){logger['error'](_0x4e57('0x1b'),_0x315f7c?util[_0x4e57('0x8')](_0x315f7c,{'showHidden':![],'depth':null}):'');return _0x4586b3(null);});}return _0x4586b3(null);});};exports[_0x4e57('0x1c')]=function(_0x2477f8){return new BPromise(function(_0x29df93,_0xc75cb3){if(_0x2477f8){return getUser({'name':_0x2477f8})['then'](function(_0x417105){logger[_0x4e57('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2477f8,_0x417105?_0x4e57('0x17'):_0x4e57('0x18'));return _0x29df93(_0x417105);})[_0x4e57('0xe')](function(_0x2ccc1f){logger[_0x4e57('0xa')](_0x4e57('0x1d'),_0x2ccc1f?util[_0x4e57('0x8')](_0x2ccc1f,{'showHidden':![],'depth':null}):'');return _0x29df93(null);});}return _0x29df93(null);});};exports['getVoiceQueueByName']=function(_0x1a26f6){return new BPromise(function(_0x431794,_0x1da085){if(_0x1a26f6){return client[_0x4e57('0xb')](_0x4e57('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type',_0x4e57('0x1f'),_0x4e57('0x20')],'where':{'name':_0x1a26f6},'limit':0x1}})[_0x4e57('0xc')](function(_0xb7c60){logger['debug'](_0x4e57('0x21'),_0x1a26f6,_0xb7c60?util[_0x4e57('0x8')](_0xb7c60,{'showHidden':![],'depth':null}):'');logger[_0x4e57('0x7')](_0x4e57('0x22'),_0x1a26f6,_0xb7c60?_0x4e57('0x17'):'notfound');return _0x431794(_0xb7c60[_0x4e57('0x14')][_0x4e57('0x15')]?_0xb7c60['result'][0x0]:null);})[_0x4e57('0xe')](function(_0x486f33){logger['error'](_0x4e57('0x23'),_0x486f33?util[_0x4e57('0x8')](_0x486f33,{'showHidden':![],'depth':null}):'');return _0x431794(null);});}return _0x431794(null);});};exports[_0x4e57('0x24')]=function(_0x53d39b,_0x9b26d8){return moment(_0x53d39b)['add'](_0x9b26d8,_0x4e57('0x25'))[_0x4e57('0x26')](_0x4e57('0x27'));};exports['subtractTime']=function(_0x67f8fe,_0x165df9){return moment(_0x67f8fe)[_0x4e57('0x28')](_0x165df9,_0x4e57('0x25'))[_0x4e57('0x26')](_0x4e57('0x27'));};exports[_0x4e57('0x29')]=function(_0x1224d6,_0x2e6eb5){return moment(_0x1224d6)[_0x4e57('0x2a')](moment(_0x2e6eb5),_0x4e57('0x25'));};exports['sumTime']=function(_0x2f1a6e,_0x5df7d3){return parseInt(_0x2f1a6e,0xa)+parseInt(_0x5df7d3,0xa);};exports[_0x4e57('0x2b')]=function(){return moment()[_0x4e57('0x26')](_0x4e57('0x27'));};exports[_0x4e57('0x2c')]=function(_0x5383b8,_0x535670){if(_0x535670){return moment(_0x5383b8)[_0x4e57('0x2c')](_0x535670);}return!![];};exports[_0x4e57('0x2d')]=function(_0x31b58e,_0x1aa0c3){if(_0x1aa0c3){return moment(_0x31b58e)[_0x4e57('0x2d')](_0x1aa0c3);}else if(_0x31b58e){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 16ec8fe..74477a6 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 _0xed3a=['other','agent_id','agent_name','path','util','./loggers','fileLogger','./safe-template','maskSensitiveData','join','/var','xcally','client','role','name','ensureDir','then','log','user','timestamp','catch','error','api','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','headers','x-forwarded-for','connection','url','statusCode','responseTime','inspect','use','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress'];(function(_0x51c364,_0x15e62c){var _0x1cd404=function(_0x487f80){while(--_0x487f80){_0x51c364['push'](_0x51c364['shift']());}};_0x1cd404(++_0x15e62c);}(_0xed3a,0x7b));var _0xaed3=function(_0x2e0fed,_0xe809e3){_0x2e0fed=_0x2e0fed-0x0;var _0x58e9cf=_0xed3a[_0x2e0fed];return _0x58e9cf;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require('express-winston');var path=require(_0xaed3('0x0'));var util=require(_0xaed3('0x1'));var fileLogger=require(_0xaed3('0x2'))[_0xaed3('0x3')];var safeTemplate=require(_0xaed3('0x4'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0xaed3('0x5')];function ClientSideLogger(){function _0x5231ca(_0x5a1012){var _0x38bb14=path[_0xaed3('0x6')](_0xaed3('0x7'),'log',_0xaed3('0x8'));var _0x254eca=path['join'](_0xaed3('0x9'),_0x5a1012[_0xaed3('0xa')]+'-'+_0x5a1012[_0xaed3('0xb')]);return fs[_0xaed3('0xc')](path[_0xaed3('0x6')](_0x38bb14,_0x254eca))[_0xaed3('0xd')](function(){var _0x171456=fileLogger(_0xaed3('0x9'),path[_0xaed3('0x6')](_0x38bb14,_0x254eca));return _0x171456;})['catch'](function(_0x138f7d){throw _0x138f7d;});}this[_0xaed3('0xe')]=function(_0x49c85b,_0x565cc7,_0x56b63c,_0x19254a){return _0x5231ca(_0x49c85b[_0xaed3('0xf')])[_0xaed3('0xd')](function(_0x2d7567){var _0x4cf035=_0x2d7567[_0x565cc7];return _0x4cf035;})[_0xaed3('0xd')](function(_0x569a82){var _0x98df0c=_0x49c85b['user']?_0x49c85b[_0xaed3('0xf')]['id']:'no-user';var _0x5da1b4=_0x19254a['data'];var _0x21e04c=_0x19254a[_0xaed3('0x10')];var _0x55397a=new Date(Number(_0x21e04c));return _0x569a82(_0x98df0c,_0x55397a,_0x56b63c,_0x5da1b4);})[_0xaed3('0x11')](function(_0x16bc08){fileLogger('client')[_0xaed3('0x12')](_0x16bc08);});};}function setupLoggers(_0x4522a4){return new Promise(function(_0x353c9e){var _0x738645=new ClientSideLogger();var _0x3eb2da=fileLogger(_0xaed3('0x13'));var _0x5d843f=fileLogger('auth');_0x4522a4[_0xaed3('0x14')](_0xaed3('0x15'),_0x738645);_0x4522a4['use'](ewinston[_0xaed3('0x16')]({'winstonInstance':_0x3eb2da,'meta':![],'statusLevels':!![],'msg':function(_0x3803cb,_0x96935a){var _0x507cfd=_0xaed3('0x17');if(!_['isEmpty'](_0x3803cb[_0xaed3('0x18')])){_0x507cfd+=_0xaed3('0x19');var _0x42517e=_0x3803cb['body'];maskSensitiveData(_0x42517e);}return safeTemplate(util['format'](_0x507cfd,_0x3803cb['method'],_0x3803cb[_0xaed3('0x1a')]['x-forwarded-for']?_0x3803cb[_0xaed3('0x1a')][_0xaed3('0x1b')]:_0x3803cb[_0xaed3('0x1c')]['remoteAddress']||_0x3803cb['ip'],_0x3803cb[_0xaed3('0x1d')],_0x96935a[_0xaed3('0x1e')],_0x96935a[_0xaed3('0x1f')],_0x3803cb[_0xaed3('0xf')]?_0x3803cb[_0xaed3('0xf')]['id']:null,_0x3803cb['user']?_0x3803cb['user'][_0xaed3('0xb')]:null,_0x3803cb[_0xaed3('0xf')]?_0x3803cb['user'][_0xaed3('0xa')]:null,_0x42517e?util[_0xaed3('0x20')](_0x42517e,![],null):''));}}));_0x4522a4[_0xaed3('0x21')](ewinston[_0xaed3('0x16')]({'winstonInstance':_0x5d843f,'meta':![],'statusLevels':!![],'msg':function(_0x125c93,_0x51ba55){var _0xae6c21='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x125c93[_0xaed3('0x18')]&&_0x125c93['body'][_0xaed3('0x22')]&&_0x125c93[_0xaed3('0x18')]['agent_id']){_0xae6c21=_0xaed3('0x23');}return util['format'](_0xae6c21,_0x125c93['method'],_0x125c93[_0xaed3('0x1a')][_0xaed3('0x1b')]?_0x125c93[_0xaed3('0x1a')][_0xaed3('0x1b')]:_0x125c93[_0xaed3('0x1c')][_0xaed3('0x24')]||_0x125c93['ip'],_0x125c93[_0xaed3('0x1d')],_0x51ba55[_0xaed3('0x1e')],_0x51ba55['responseTime'],_0x125c93[_0xaed3('0xf')]?_0x125c93[_0xaed3('0xf')]['id']:null,_0x125c93[_0xaed3('0xf')]?_0x125c93[_0xaed3('0xf')][_0xaed3('0xb')]:null,_0x125c93[_0xaed3('0xf')]?_0x125c93[_0xaed3('0xf')][_0xaed3('0xa')]:null,_0x125c93[_0xaed3('0x18')]&&_0x125c93[_0xaed3('0x18')][_0xaed3('0x22')]?_0x125c93[_0xaed3('0x18')]['device']:_0xaed3('0x25'),_0x125c93['body']&&_0x125c93[_0xaed3('0x18')][_0xaed3('0x26')]?_0x125c93[_0xaed3('0x18')][_0xaed3('0x26')]:'',_0x125c93[_0xaed3('0x18')]&&_0x125c93['body'][_0xaed3('0x27')]?_0x125c93[_0xaed3('0x18')][_0xaed3('0x27')]:'');},'ignoreRoute':function(_0x1b0d8d){var _0x51a266=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x51a266['test'](_0x1b0d8d[_0xaed3('0x1d')]);}}));return _0x353c9e();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x861a=['log','xcally','client','role','name','ensureDir','catch','user','then','no-user','data','timestamp','error','auth','use','body','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','format','remoteAddress','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join'];(function(_0x42c7e1,_0x2be6af){var _0xdcea98=function(_0x2a822f){while(--_0x2a822f){_0x42c7e1['push'](_0x42c7e1['shift']());}};_0xdcea98(++_0x2be6af);}(_0x861a,0x15d));var _0xa861=function(_0xae99c1,_0x474cb9){_0xae99c1=_0xae99c1-0x0;var _0x4df7c6=_0x861a[_0xae99c1];return _0x4df7c6;};var fs=require(_0xa861('0x0'));var _=require(_0xa861('0x1'));var ewinston=require(_0xa861('0x2'));var path=require(_0xa861('0x3'));var util=require(_0xa861('0x4'));var fileLogger=require(_0xa861('0x5'))['fileLogger'];var safeTemplate=require(_0xa861('0x6'))[_0xa861('0x7')];var maskSensitiveData=require(_0xa861('0x8'))[_0xa861('0x9')];function ClientSideLogger(){function _0x34b0c7(_0xdc5327){var _0x5020c3=path[_0xa861('0xa')]('/var',_0xa861('0xb'),_0xa861('0xc'));var _0x2affa5=path[_0xa861('0xa')](_0xa861('0xd'),_0xdc5327[_0xa861('0xe')]+'-'+_0xdc5327[_0xa861('0xf')]);return fs[_0xa861('0x10')](path[_0xa861('0xa')](_0x5020c3,_0x2affa5))['then'](function(){var _0x33271d=fileLogger(_0xa861('0xd'),path[_0xa861('0xa')](_0x5020c3,_0x2affa5));return _0x33271d;})[_0xa861('0x11')](function(_0x2f6350){throw _0x2f6350;});}this['log']=function(_0x44d278,_0x1fe1c6,_0x39d22e,_0x1850a0){return _0x34b0c7(_0x44d278[_0xa861('0x12')])[_0xa861('0x13')](function(_0x264cdb){var _0x26f165=_0x264cdb[_0x1fe1c6];return _0x26f165;})[_0xa861('0x13')](function(_0x5117ab){var _0x4dd055=_0x44d278['user']?_0x44d278['user']['id']:_0xa861('0x14');var _0x247a07=_0x1850a0[_0xa861('0x15')];var _0xc2401e=_0x1850a0[_0xa861('0x16')];var _0x4a496d=new Date(Number(_0xc2401e));return _0x5117ab(_0x4dd055,_0x4a496d,_0x39d22e,_0x247a07);})[_0xa861('0x11')](function(_0x5b359f){fileLogger(_0xa861('0xd'))[_0xa861('0x17')](_0x5b359f);});};}function setupLoggers(_0x2c28bf){return new Promise(function(_0x49625f){var _0x3e8dd3=new ClientSideLogger();var _0xc05f1f=fileLogger('api');var _0x51d5a8=fileLogger(_0xa861('0x18'));_0x2c28bf['set']('client-side-logger',_0x3e8dd3);_0x2c28bf[_0xa861('0x19')](ewinston['logger']({'winstonInstance':_0xc05f1f,'meta':![],'statusLevels':!![],'msg':function(_0x3bd798,_0x100dec){var _0x2bd15f='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x3bd798[_0xa861('0x1a')])){_0x2bd15f+='\x20body=%s';var _0x141506=_0x3bd798[_0xa861('0x1a')];maskSensitiveData(_0x141506);}return safeTemplate(util['format'](_0x2bd15f,_0x3bd798[_0xa861('0x1b')],_0x3bd798[_0xa861('0x1c')]['x-forwarded-for']?_0x3bd798['headers'][_0xa861('0x1d')]:_0x3bd798[_0xa861('0x1e')]['remoteAddress']||_0x3bd798['ip'],_0x3bd798[_0xa861('0x1f')],_0x100dec[_0xa861('0x20')],_0x100dec[_0xa861('0x21')],_0x3bd798[_0xa861('0x12')]?_0x3bd798[_0xa861('0x12')]['id']:null,_0x3bd798[_0xa861('0x12')]?_0x3bd798[_0xa861('0x12')][_0xa861('0xf')]:null,_0x3bd798[_0xa861('0x12')]?_0x3bd798[_0xa861('0x12')][_0xa861('0xe')]:null,_0x141506?util[_0xa861('0x22')](_0x141506,![],null):''));}}));_0x2c28bf['use'](ewinston[_0xa861('0x23')]({'winstonInstance':_0x51d5a8,'meta':![],'statusLevels':!![],'msg':function(_0x2b850b,_0x570228){var _0x249eca=_0xa861('0x24');if(_0x2b850b[_0xa861('0x1a')]&&_0x2b850b[_0xa861('0x1a')]['device']&&_0x2b850b[_0xa861('0x1a')][_0xa861('0x25')]){_0x249eca='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xa861('0x26')](_0x249eca,_0x2b850b[_0xa861('0x1b')],_0x2b850b['headers'][_0xa861('0x1d')]?_0x2b850b['headers']['x-forwarded-for']:_0x2b850b[_0xa861('0x1e')][_0xa861('0x27')]||_0x2b850b['ip'],_0x2b850b[_0xa861('0x1f')],_0x570228[_0xa861('0x20')],_0x570228[_0xa861('0x21')],_0x2b850b[_0xa861('0x12')]?_0x2b850b[_0xa861('0x12')]['id']:null,_0x2b850b['user']?_0x2b850b[_0xa861('0x12')][_0xa861('0xf')]:null,_0x2b850b['user']?_0x2b850b[_0xa861('0x12')]['role']:null,_0x2b850b[_0xa861('0x1a')]&&_0x2b850b[_0xa861('0x1a')][_0xa861('0x28')]?_0x2b850b[_0xa861('0x1a')][_0xa861('0x28')]:_0xa861('0x29'),_0x2b850b['body']&&_0x2b850b['body'][_0xa861('0x25')]?_0x2b850b[_0xa861('0x1a')][_0xa861('0x25')]:'',_0x2b850b['body']&&_0x2b850b[_0xa861('0x1a')]['agent_name']?_0x2b850b[_0xa861('0x1a')][_0xa861('0x2a')]:'');},'ignoreRoute':function(_0x2fd121){var _0xd9e04e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xd9e04e[_0xa861('0x2b')](_0x2fd121[_0xa861('0x1f')]);}}));return _0x49625f();});}exports[_0xa861('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index bb528e8..000213a 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa62=['message','{{{','replace','}}}','format','level','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','File','%s-%s','error','warn','consoleLogger','fileLogger','util','moment','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join'];(function(_0x5ef97a,_0x5aabb8){var _0x44c72d=function(_0x16cb15){while(--_0x16cb15){_0x5ef97a['push'](_0x5ef97a['shift']());}};_0x44c72d(++_0x5aabb8);}(_0xaa62,0x158));var _0x2aa6=function(_0x592ac2,_0x209334){_0x592ac2=_0x592ac2-0x0;var _0x3e80f5=_0xaa62[_0x592ac2];return _0x3e80f5;};'use strict';var path=require('path');var util=require(_0x2aa6('0x0'));var moment=require(_0x2aa6('0x1'));var winston=require('winston');var config=require(_0x2aa6('0x2'));var debugLevel=config[_0x2aa6('0x3')]?config[_0x2aa6('0x3')][_0x2aa6('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':_0x2aa6('0x5'),'error':_0x2aa6('0x6'),'warn':_0x2aa6('0x7'),'info':_0x2aa6('0x8'),'print':'bold\x20white','success':_0x2aa6('0x9'),'http':'gray','verbose':_0x2aa6('0xa'),'debug':_0x2aa6('0xb'),'silly':_0x2aa6('0xc')};winston[_0x2aa6('0xd')](XC_LOG_COLORS);function getLogFileName(_0x176f01,_0x3f747e,_0x4c0d1b){var _0x1f5561=_0x176f01||_0x2aa6('0xe');return path[_0x2aa6('0xf')](_0x1f5561,util['format']('%s-%s.log',_0x3f747e,_0x4c0d1b));}function formatter(_0x28d95f,_0x57a01c){_0x57a01c[_0x2aa6('0x10')]=_0x57a01c[_0x2aa6('0x10')]['replace'](/@@{/g,_0x2aa6('0x11'))[_0x2aa6('0x12')](/}@@/g,_0x2aa6('0x13'))[_0x2aa6('0x12')](/@{/g,'{{')[_0x2aa6('0x12')](/}@/g,'}}');return util[_0x2aa6('0x14')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x57a01c[_0x2aa6('0x15')]['toUpperCase'](),_0x28d95f,_0x57a01c[_0x2aa6('0x10')]);}function fileFormat(_0x4bf274,_0x2e9bf0){_0x2e9bf0[_0x2aa6('0x10')]=_0x2e9bf0[_0x2aa6('0x10')][_0x2aa6('0x12')](/@@{/g,_0x2aa6('0x11'))[_0x2aa6('0x12')](/}@@/g,_0x2aa6('0x13'))[_0x2aa6('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x590dd1=_0x2e9bf0['meta']&&Object['keys'](_0x2e9bf0[_0x2aa6('0x16')])[_0x2aa6('0x17')]?'\x0a\x09'+JSON[_0x2aa6('0x18')](_0x2e9bf0['meta']):'';return util['format'](_0x2aa6('0x19'),moment()[_0x2aa6('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2e9bf0[_0x2aa6('0x15')][_0x2aa6('0x1a')](),_0x4bf274,_0x2e9bf0[_0x2aa6('0x10')],_0x590dd1);}function consoleLogger(){var _0x4495a7=new winston[(_0x2aa6('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2aa6('0x1c'))][(_0x2aa6('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x4e175d){return formatter('',_0x4e175d);}})]});return _0x4495a7;}function fileLogger(_0x2baaf5,_0x482d8d){var _0x2ad1c3=new winston[(_0x2aa6('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x2aa6('0x1e'))]({'name':util[_0x2aa6('0x14')](_0x2aa6('0x1f'),_0x2baaf5,_0x2aa6('0x20')),'filename':getLogFileName(_0x482d8d,_0x2baaf5,_0x2aa6('0x20')),'level':_0x2aa6('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4f8abf){return fileFormat(_0x2baaf5,_0x4f8abf);}}),new winston['transports'][(_0x2aa6('0x1e'))]({'name':util['format'](_0x2aa6('0x1f'),_0x2baaf5,debugLevel),'filename':getLogFileName(_0x482d8d,_0x2baaf5,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1d1d02){return fileFormat(_0x2baaf5,_0x1d1d02);}}),new winston[(_0x2aa6('0x1c'))][(_0x2aa6('0x1d'))]({'level':_0x2aa6('0x21'),'json':![],'formatter':function(_0x3a80fe){return fileFormat(_0x2baaf5,_0x3a80fe);}})]});return _0x2ad1c3;}exports[_0x2aa6('0x22')]=consoleLogger;exports[_0x2aa6('0x23')]=fileLogger; \ No newline at end of file +var _0x39fc=['warn','File','%s-%s','error','Console','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20cyan','join','%s-%s.log','message','{{{','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','Logger','transports'];(function(_0x40a197,_0x41fc70){var _0x297034=function(_0x1e89bb){while(--_0x1e89bb){_0x40a197['push'](_0x40a197['shift']());}};_0x297034(++_0x41fc70);}(_0x39fc,0x153));var _0xc39f=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x39fc[_0x5783f4];return _0x28e380;};'use strict';var path=require(_0xc39f('0x0'));var util=require(_0xc39f('0x1'));var moment=require(_0xc39f('0x2'));var winston=require(_0xc39f('0x3'));var config=require('../config/environment');var debugLevel=config[_0xc39f('0x4')]?config[_0xc39f('0x4')][_0xc39f('0x5')]():_0xc39f('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':_0xc39f('0x7'),'error':_0xc39f('0x8'),'warn':_0xc39f('0x9'),'info':_0xc39f('0xa'),'print':_0xc39f('0xb'),'success':'bold\x20green','http':_0xc39f('0xc'),'verbose':_0xc39f('0xd'),'debug':'bold\x20blue','silly':_0xc39f('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x384f93,_0x123731,_0x380e4d){var _0x27e8ff=_0x384f93||'/var/log/xcally';return path[_0xc39f('0xf')](_0x27e8ff,util['format'](_0xc39f('0x10'),_0x123731,_0x380e4d));}function formatter(_0x491eb0,_0x11fd31){_0x11fd31[_0xc39f('0x11')]=_0x11fd31[_0xc39f('0x11')]['replace'](/@@{/g,_0xc39f('0x12'))[_0xc39f('0x13')](/}@@/g,_0xc39f('0x14'))[_0xc39f('0x13')](/@{/g,'{{')[_0xc39f('0x13')](/}@/g,'}}');return util[_0xc39f('0x15')](_0xc39f('0x16'),moment()[_0xc39f('0x15')](_0xc39f('0x17')),_0x11fd31[_0xc39f('0x18')][_0xc39f('0x19')](),_0x491eb0,_0x11fd31['message']);}function fileFormat(_0x1601af,_0x5333c4){_0x5333c4[_0xc39f('0x11')]=_0x5333c4['message'][_0xc39f('0x13')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0xc39f('0x13')](/@{/g,'{{')[_0xc39f('0x13')](/}@/g,'}}');var _0xbe1f2d=_0x5333c4[_0xc39f('0x1a')]&&Object[_0xc39f('0x1b')](_0x5333c4['meta'])[_0xc39f('0x1c')]?'\x0a\x09'+JSON['stringify'](_0x5333c4[_0xc39f('0x1a')]):'';return util[_0xc39f('0x15')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0xc39f('0x17')),_0x5333c4[_0xc39f('0x18')][_0xc39f('0x19')](),_0x1601af,_0x5333c4['message'],_0xbe1f2d);}function consoleLogger(){var _0xb8652=new winston[(_0xc39f('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc39f('0x1e'))]['Console']({'level':_0xc39f('0x1f'),'json':![],'formatter':function(_0x32a01a){return formatter('',_0x32a01a);}})]});return _0xb8652;}function fileLogger(_0x123fab,_0x5c43ac){var _0x2bf27d=new winston[(_0xc39f('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc39f('0x1e'))][(_0xc39f('0x20'))]({'name':util[_0xc39f('0x15')](_0xc39f('0x21'),_0x123fab,_0xc39f('0x22')),'filename':getLogFileName(_0x5c43ac,_0x123fab,_0xc39f('0x22')),'level':_0xc39f('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c8da7){return fileFormat(_0x123fab,_0x5c8da7);}}),new winston['transports'][(_0xc39f('0x20'))]({'name':util[_0xc39f('0x15')](_0xc39f('0x21'),_0x123fab,debugLevel),'filename':getLogFileName(_0x5c43ac,_0x123fab,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3fc186){return fileFormat(_0x123fab,_0x3fc186);}}),new winston['transports'][(_0xc39f('0x23'))]({'level':_0xc39f('0x1f'),'json':![],'formatter':function(_0x3e3477){return fileFormat(_0x123fab,_0x3e3477);}})]});return _0x2bf27d;}exports['consoleLogger']=consoleLogger;exports[_0xc39f('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index e4e6e5c..08b02a0 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 _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x1a85,0x178));var _0x51a8=function(_0x3d07f2,_0x19854d){_0x3d07f2=_0x3d07f2-0x0;var _0x26052a=_0x1a85[_0x3d07f2];return _0x26052a;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x22e105,_0x3d7702){var _0x277075=function(_0x496a84){while(--_0x496a84){_0x22e105['push'](_0x22e105['shift']());}};_0x277075(++_0x3d7702);}(_0xadb5,0xad));var _0x5adb=function(_0x535f3b,_0x538151){_0x535f3b=_0x535f3b-0x0;var _0xc41f72=_0xadb5[_0x535f3b];return _0xc41f72;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 1f87195..3d29cc9 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 _0x5c3c=['\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','lodash','{\x20{\x20'];(function(_0x55fc5f,_0x41c859){var _0x4822b1=function(_0x59c76c){while(--_0x59c76c){_0x55fc5f['push'](_0x55fc5f['shift']());}};_0x4822b1(++_0x41c859);}(_0x5c3c,0x132));var _0xc5c3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5c3c[_0x173441];return _0x2423a8;};var _=require(_0xc5c3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x40ad71){return _0x40ad71==='{{'?_0xc5c3('0x1'):_0xc5c3('0x2');}function safeTemplate(_0x4b9233){var _0x400726=_0x4b9233;if(typeof _0x4b9233===_0xc5c3('0x3')){_0x400726=_0x4b9233[_0xc5c3('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc5c3('0x5')](_0x4b9233)){_0x400726=_0x4b9233[_0xc5c3('0x6')](function(_0x36525d){return safeTemplate(_0x36525d);});}else if(_[_0xc5c3('0x7')](_0x4b9233)){_0x400726=Object[_0xc5c3('0x8')](_0x4b9233)[_0xc5c3('0x9')](function(_0x5a392b,_0x4b8404){_0x5a392b[_0x4b8404]=safeTemplate(_0x4b9233[_0x4b8404]);return _0x5a392b;},{});}return _0x400726;}module['exports'][_0xc5c3('0xa')]=safeTemplate; \ No newline at end of file +var _0x9ffd=['{\x20{\x20','string','replace','map','keys','reduce','exports','safeTemplate','lodash'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x149bae,_0x50e3d6){_0x149bae=_0x149bae-0x0;var _0x4c8886=_0x9ffd[_0x149bae];return _0x4c8886;};var _=require(_0xd9ff('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x413161){return _0x413161==='{{'?_0xd9ff('0x1'):'\x20}\x20}';}function safeTemplate(_0x3480c0){var _0x1530b1=_0x3480c0;if(typeof _0x3480c0===_0xd9ff('0x2')){_0x1530b1=_0x3480c0[_0xd9ff('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x3480c0)){_0x1530b1=_0x3480c0[_0xd9ff('0x4')](function(_0x111697){return safeTemplate(_0x111697);});}else if(_['isPlainObject'](_0x3480c0)){_0x1530b1=Object[_0xd9ff('0x5')](_0x3480c0)[_0xd9ff('0x6')](function(_0x13ea8c,_0x270eb2){_0x13ea8c[_0x270eb2]=safeTemplate(_0x3480c0[_0x270eb2]);return _0x13ea8c;},{});}return _0x1530b1;}module[_0xd9ff('0x7')][_0xd9ff('0x8')]=safeTemplate; \ No newline at end of file